From d4a26b0b2ed012cc035f64317a8b5cfd4284946b Mon Sep 17 00:00:00 2001 From: arthurdead Date: Mon, 29 Mar 2021 16:43:37 -0300 Subject: [PATCH 01/24] update hl2sdk-l4d2 --- game/server/nav.h | 160 ++++-- game/server/nav_area.h | 830 +++++++++++++++++++++++-------- game/server/nav_colors.h | 10 +- game/server/nav_entities.h | 71 +++ game/server/nav_ladder.h | 61 ++- game/server/nav_mesh.h | 957 +++++++++++++++++++++++++++++------- game/server/nav_node.h | 34 +- game/server/nav_pathfind.h | 449 ++++++++++++----- game/shared/util_shared.h | 10 +- public/engine/ivmodelinfo.h | 1 + public/tier1/utlmemory.h | 127 +++++ public/tier1/utlvector.h | 263 ++++++++++ 12 files changed, 2414 insertions(+), 559 deletions(-) create mode 100644 game/server/nav_entities.h diff --git a/game/server/nav.h b/game/server/nav.h index bf3c7757c..997ad3c99 100644 --- a/game/server/nav.h +++ b/game/server/nav.h @@ -18,20 +18,34 @@ * Below are several constants used by the navigation system. * @todo Move these into TheNavMesh singleton. */ -const float GenerationStepSize = 25.0f; ///< (30) was 20, but bots can't fit always fit -const float StepHeight = 18.0f; ///< if delta Z is greater than this, we have to jump to get up -const float JumpHeight = 41.8f; ///< if delta Z is less than this, we can jump up on it -const float JumpCrouchHeight = 58.0f; ///< (48) if delta Z is less than or equal to this, we can jumpcrouch up on it +const float GenerationStepSize = 25.0f; // (30) was 20, but bots can't fit always fit +const float JumpHeight = 41.8f; // if delta Z is less than this, we can jump up on it +const float JumpCrouchHeight = 64.0f; // (48) if delta Z is less than or equal to this, we can jumpcrouch up on it -const float BotRadius = 10.0f; ///< circular extent that contains bot -const float DeathDrop = 200.0f; ///< (300) distance at which we will die if we fall - should be about 600, and pay attention to fall damage during pathfind +// There are 3 different definitions of StepHeight throughout the code, waiting to produce bugs if the 18.0 is ever changed. +#ifdef INFESTED_DLL +const float StepHeight = 24.0f; ///< if delta Z is greater than this, we have to jump to get up +#else +const float StepHeight = 18.0f; // if delta Z is greater than this, we have to jump to get up +#endif // INFESTED_DLL -const float HalfHumanWidth = 16.0f; -const float HalfHumanHeight = 36.0f; -const float HumanHeight = 72.0f; -#define NAV_MAGIC_NUMBER 0xFEEDFACE ///< to help identify nav files +// TERROR: Increased DeathDrop from 200, since zombies don't take falling damage +const float DeathDrop = 400.0f; // (300) distance at which we will die if we fall - should be about 600, and pay attention to fall damage during pathfind +const float ClimbUpHeight = 200.0f; // height to check for climbing up +const float CliffHeight = 300.0f; // height which we consider a significant cliff which we would not want to fall off of + +// TERROR: Converted these values to use the same numbers as the player bounding boxes etc +#define HalfHumanWidth 16 +#define HalfHumanHeight 35.5 +#define HumanHeight 71 +#define HumanEyeHeight 62 +#define HumanCrouchHeight 55 +#define HumanCrouchEyeHeight 37 + + +#define NAV_MAGIC_NUMBER 0xFEEDFACE // to help identify nav files /** * A place is a named group of navigation areas @@ -48,24 +62,38 @@ enum NavErrorType NAV_BAD_FILE_VERSION, NAV_FILE_OUT_OF_DATE, NAV_CORRUPT_DATA, + NAV_OUT_OF_MEMORY, }; enum NavAttributeType { - NAV_MESH_CROUCH = 0x0001, ///< must crouch to use this node/area - NAV_MESH_JUMP = 0x0002, ///< must jump to traverse this area - NAV_MESH_PRECISE = 0x0004, ///< do not adjust for obstacles, just move along area - NAV_MESH_NO_JUMP = 0x0008, ///< inhibit discontinuity jumping - NAV_MESH_STOP = 0x0010, ///< must stop when entering this area - NAV_MESH_RUN = 0x0020, ///< must run to traverse this area - NAV_MESH_WALK = 0x0040, ///< must walk to traverse this area - NAV_MESH_AVOID = 0x0080, ///< avoid this area unless alternatives are too dangerous - NAV_MESH_TRANSIENT = 0x0100, ///< area may become blocked, and should be periodically checked - NAV_MESH_DONT_HIDE = 0x0200, ///< area should not be considered for hiding spot generation - NAV_MESH_STAND = 0x0400, ///< bots hiding in this area should stand - NAV_MESH_NO_HOSTAGES = 0x0800, ///< hostages shouldn't use this area + NAV_MESH_INVALID = 0, + NAV_MESH_CROUCH = 0x0000001, // must crouch to use this node/area + NAV_MESH_JUMP = 0x0000002, // must jump to traverse this area (only used during generation) + NAV_MESH_PRECISE = 0x0000004, // do not adjust for obstacles, just move along area + NAV_MESH_NO_JUMP = 0x0000008, // inhibit discontinuity jumping + NAV_MESH_STOP = 0x0000010, // must stop when entering this area + NAV_MESH_RUN = 0x0000020, // must run to traverse this area + NAV_MESH_WALK = 0x0000040, // must walk to traverse this area + NAV_MESH_AVOID = 0x0000080, // avoid this area unless alternatives are too dangerous + NAV_MESH_TRANSIENT = 0x0000100, // area may become blocked, and should be periodically checked + NAV_MESH_DONT_HIDE = 0x0000200, // area should not be considered for hiding spot generation + NAV_MESH_STAND = 0x0000400, // bots hiding in this area should stand + NAV_MESH_NO_HOSTAGES = 0x0000800, // hostages shouldn't use this area + NAV_MESH_STAIRS = 0x0001000, // this area represents stairs, do not attempt to climb or jump them - just walk up + NAV_MESH_NO_MERGE = 0x0002000, // don't merge this area with adjacent areas + NAV_MESH_OBSTACLE_TOP = 0x0004000, // this nav area is the climb point on the tip of an obstacle + NAV_MESH_CLIFF = 0x0008000, // this nav area is adjacent to a drop of at least CliffHeight + + NAV_MESH_FIRST_CUSTOM = 0x00010000, // apps may define custom app-specific bits starting with this value + NAV_MESH_LAST_CUSTOM = 0x04000000, // apps must not define custom app-specific bits higher than with this value + + NAV_MESH_HAS_ELEVATOR = 0x40000000, // area is in an elevator's path + NAV_MESH_NAV_BLOCKER = 0x80000000 // area is blocked by nav blocker ( Alas, needed to hijack a bit in the attributes to get within a cache line [7/24/2008 tom]) }; +extern NavAttributeType NameToNavAttribute( const char *name ); + enum NavDirType { NORTH = 0, @@ -86,9 +114,12 @@ enum NavTraverseType GO_EAST, GO_SOUTH, GO_WEST, + GO_LADDER_UP, GO_LADDER_DOWN, GO_JUMP, + GO_ELEVATOR_UP, + GO_ELEVATOR_DOWN, NUM_TRAVERSE_TYPES }; @@ -125,6 +156,11 @@ struct Extent hi.Init(); } + void Init( CBaseEntity *entity ) + { + entity->CollisionProp()->WorldSpaceSurroundingBounds( &lo, &hi ); + } + float SizeX( void ) const { return hi.x - lo.x; } float SizeY( void ) const { return hi.y - lo.y; } float SizeZ( void ) const { return hi.z - lo.z; } @@ -146,6 +182,13 @@ struct Extent } } + // Increase bounds to contain the given extent + void Encompass( const Extent &extent ) + { + Encompass( extent.lo ); + Encompass( extent.hi ); + } + /// return true if 'pos' is inside of this extent bool Contains( const Vector &pos ) const { @@ -153,6 +196,14 @@ struct Extent pos.y >= lo.y && pos.y <= hi.y && pos.z >= lo.z && pos.z <= hi.z); } + + /// return true if this extent overlaps the given one + bool IsOverlapping( const Extent &other ) const + { + return (lo.x <= other.hi.x && hi.x >= other.lo.x && + lo.y <= other.hi.y && hi.y >= other.lo.y && + lo.z <= other.hi.z && hi.z >= other.lo.z); + } }; struct Ray @@ -174,7 +225,6 @@ inline NavDirType OppositeDirection( NavDirType dir ) case SOUTH: return NORTH; case EAST: return WEST; case WEST: return EAST; - default: break; } return NORTH; @@ -189,7 +239,6 @@ inline NavDirType DirectionLeft( NavDirType dir ) case SOUTH: return EAST; case EAST: return NORTH; case WEST: return SOUTH; - default: break; } return NORTH; @@ -204,7 +253,6 @@ inline NavDirType DirectionRight( NavDirType dir ) case SOUTH: return WEST; case EAST: return SOUTH; case WEST: return NORTH; - default: break; } return NORTH; @@ -219,7 +267,6 @@ inline void AddDirectionVector( Vector *v, NavDirType dir, float amount ) case SOUTH: v->y += amount; return; case EAST: v->x += amount; return; case WEST: v->x -= amount; return; - default: break; } } @@ -232,7 +279,6 @@ inline float DirectionToAngle( NavDirType dir ) case SOUTH: return 90.0f; case EAST: return 0.0f; case WEST: return 180.0f; - default: break; } return 0.0f; @@ -268,7 +314,6 @@ inline void DirectionToVector2D( NavDirType dir, Vector2D *v ) case SOUTH: v->x = 0.0f; v->y = 1.0f; break; case EAST: v->x = 1.0f; v->y = 0.0f; break; case WEST: v->x = -1.0f; v->y = 0.0f; break; - default: break; } } @@ -282,21 +327,57 @@ inline void CornerToVector2D( NavCornerType dir, Vector2D *v ) case NORTH_EAST: v->x = 1.0f; v->y = -1.0f; break; case SOUTH_EAST: v->x = 1.0f; v->y = 1.0f; break; case SOUTH_WEST: v->x = -1.0f; v->y = 1.0f; break; - default: break; } v->NormalizeInPlace(); } +//-------------------------------------------------------------------------------------------------------------- +// Gets the corner types that surround the given direction +inline void GetCornerTypesInDirection( NavDirType dir, NavCornerType *first, NavCornerType *second ) +{ + switch ( dir ) + { + case NORTH: + *first = NORTH_WEST; + *second = NORTH_EAST; + break; + case SOUTH: + *first = SOUTH_WEST; + *second = SOUTH_EAST; + break; + case EAST: + *first = NORTH_EAST; + *second = SOUTH_EAST; + break; + case WEST: + *first = NORTH_WEST; + *second = SOUTH_WEST; + break; + } +} + + +//-------------------------------------------------------------------------------------------------------------- +inline float RoundToUnits( float val, float unit ) +{ + val = val + ((val < 0.0f) ? -unit*0.5f : unit*0.5f); + return (float)( unit * ( ((int)val) / (int)unit ) ); +} + + //-------------------------------------------------------------------------------------------------------------- /** * Return true if given entity can be ignored when moving */ -#define WALK_THRU_DOORS 0x01 -#define WALK_THRU_BREAKABLES 0x02 -#define WALK_THRU_TOGGLE_BRUSHES 0x04 +#define WALK_THRU_PROP_DOORS 0x01 +#define WALK_THRU_FUNC_DOORS 0x02 +#define WALK_THRU_DOORS (WALK_THRU_PROP_DOORS | WALK_THRU_FUNC_DOORS) +#define WALK_THRU_BREAKABLES 0x04 +#define WALK_THRU_TOGGLE_BRUSHES 0x08 #define WALK_THRU_EVERYTHING (WALK_THRU_DOORS | WALK_THRU_BREAKABLES | WALK_THRU_TOGGLE_BRUSHES) +extern ConVar nav_solid_props; inline bool IsEntityWalkable( CBaseEntity *entity, unsigned int flags ) { if (FClassnameIs( entity, "worldspawn" )) @@ -306,8 +387,11 @@ inline bool IsEntityWalkable( CBaseEntity *entity, unsigned int flags ) return false; // if we hit a door, assume its walkable because it will open when we touch it - if (FClassnameIs( entity, "prop_door*" ) || FClassnameIs( entity, "func_door*" )) - return (flags & WALK_THRU_DOORS) ? true : false; + if (FClassnameIs( entity, "func_door*" )) + return (flags & WALK_THRU_FUNC_DOORS) ? true : false; + + if (FClassnameIs( entity, "prop_door*" )) + return (flags & WALK_THRU_PROP_DOORS) ? true : false; // if we hit a clip brush, ignore it if it is not BRUSHSOLID_ALWAYS if (FClassnameIs( entity, "func_brush" )) @@ -331,6 +415,12 @@ inline bool IsEntityWalkable( CBaseEntity *entity, unsigned int flags ) if (FClassnameIs( entity, "func_breakable_surf" ) && entity->m_takedamage == DAMAGE_YES) return (flags & WALK_THRU_BREAKABLES) ? true : false; + if ( FClassnameIs( entity, "func_playerinfected_clip" ) == true ) + return true; + + if ( nav_solid_props.GetBool() && FClassnameIs( entity, "prop_*" ) ) + return true; + return false; } @@ -362,6 +452,6 @@ class CTraceFilterWalkableEntities : public CTraceFilterNoNPCsOrPlayer }; -extern bool IsWalkableTraceLineClear( Vector &from, Vector &to, unsigned int flags = 0 ); +extern bool IsWalkableTraceLineClear( const Vector &from, const Vector &to, unsigned int flags = 0 ); #endif // _NAV_H_ diff --git a/game/server/nav_area.h b/game/server/nav_area.h index 2c7e40fac..c055de5a5 100644 --- a/game/server/nav_area.h +++ b/game/server/nav_area.h @@ -13,27 +13,77 @@ #define _NAV_AREA_H_ #include "nav_ladder.h" +#include "tier1/memstack.h" // BOTPORT: Clean up relationship between team index and danger storage in nav areas enum { MAX_NAV_TEAMS = 2 }; +class CFuncElevator; + +class CNavVectorNoEditAllocator +{ +public: + CNavVectorNoEditAllocator(); + + static void Reset(); + static void *Alloc( size_t nSize ); + static void *Realloc( void *pMem, size_t nSize ); + static void Free( void *pMem ); + static size_t GetSize( void *pMem ); + +private: + static CMemoryStack m_memory; + static void *m_pCurrent; + static int m_nBytesCurrent; +}; + +#if !defined(_X360) +typedef CUtlVectorUltraConservativeAllocator CNavVectorAllocator; +#else +typedef CNavVectorNoEditAllocator CNavVectorAllocator; +#endif + + +//------------------------------------------------------------------------------------------------------------------- +/** + * Functor interface for iteration + */ +class IForEachNavArea +{ +public: + virtual bool Inspect( const CNavArea *area ) = 0; // Invoked once on each area of the iterated set. Return false to stop iterating. + virtual void PostIteration( bool wasCompleteIteration ) { } // Invoked after the iteration has ended. 'wasCompleteIteration' will be true if the entire set was iterated (ie: Inspect() never returned false) +}; + //------------------------------------------------------------------------------------------------------------------- /** * The NavConnect union is used to refer to connections to areas */ -union NavConnect +struct NavConnect { - unsigned int id; - CNavArea *area; + NavConnect() + { + id = 0; + length = -1; + } + + union + { + unsigned int id; + CNavArea *area; + }; + + mutable float length; bool operator==( const NavConnect &other ) const { return (area == other.area) ? true : false; } }; -typedef CUtlLinkedList NavConnectList; + +typedef CUtlVectorUltraConservative NavConnectVector; //------------------------------------------------------------------------------------------------------------------- @@ -50,7 +100,7 @@ union NavLadderConnect return (ladder == other.ladder) ? true : false; } }; -typedef CUtlLinkedList NavLadderConnectList; +typedef CUtlVectorUltraConservative NavLadderConnectVector; //-------------------------------------------------------------------------------------------------------------- @@ -64,26 +114,26 @@ class HidingSpot enum { - IN_COVER = 0x01, ///< in a corner with good hard cover nearby - GOOD_SNIPER_SPOT = 0x02, ///< had at least one decent sniping corridor - IDEAL_SNIPER_SPOT = 0x04, ///< can see either very far, or a large area, or both - EXPOSED = 0x08 ///< spot in the open, usually on a ledge or cliff + IN_COVER = 0x01, // in a corner with good hard cover nearby + GOOD_SNIPER_SPOT = 0x02, // had at least one decent sniping corridor + IDEAL_SNIPER_SPOT = 0x04, // can see either very far, or a large area, or both + EXPOSED = 0x08 // spot in the open, usually on a ledge or cliff }; - bool HasGoodCover( void ) const { return (m_flags & IN_COVER) ? true : false; } ///< return true if hiding spot in in cover + bool HasGoodCover( void ) const { return (m_flags & IN_COVER) ? true : false; } // return true if hiding spot in in cover bool IsGoodSniperSpot( void ) const { return (m_flags & GOOD_SNIPER_SPOT) ? true : false; } bool IsIdealSniperSpot( void ) const { return (m_flags & IDEAL_SNIPER_SPOT) ? true : false; } bool IsExposed( void ) const { return (m_flags & EXPOSED) ? true : false; } int GetFlags( void ) const { return m_flags; } - void Save( FileHandle_t file, unsigned int version ) const; - void Load( FileHandle_t file, unsigned int version ); + void Save( CUtlBuffer &fileBuffer, unsigned int version ) const; + void Load( CUtlBuffer &fileBuffer, unsigned int version ); NavErrorType PostLoad( void ); - const Vector &GetPosition( void ) const { return m_pos; } ///< get the position of the hiding spot + const Vector &GetPosition( void ) const { return m_pos; } // get the position of the hiding spot unsigned int GetID( void ) const { return m_id; } - const CNavArea *GetArea( void ) const { return m_area; } ///< return nav area this hiding spot is within + const CNavArea *GetArea( void ) const { return m_area; } // return nav area this hiding spot is within void Mark( void ) { m_marker = m_masterMarker; } bool IsMarked( void ) const { return (m_marker == m_masterMarker) ? true : false; } @@ -91,27 +141,27 @@ class HidingSpot public: - void SetFlags( int flags ) { m_flags |= flags; } ///< FOR INTERNAL USE ONLY - void SetPosition( const Vector &pos ) { m_pos = pos; } ///< FOR INTERNAL USE ONLY + void SetFlags( int flags ) { m_flags |= flags; } // FOR INTERNAL USE ONLY + void SetPosition( const Vector &pos ) { m_pos = pos; } // FOR INTERNAL USE ONLY private: friend class CNavMesh; friend void ClassifySniperSpot( HidingSpot *spot ); - HidingSpot( void ); ///< must use factory to create + HidingSpot( void ); // must use factory to create - Vector m_pos; ///< world coordinates of the spot - unsigned int m_id; ///< this spot's unique ID - unsigned int m_marker; ///< this spot's unique marker - CNavArea *m_area; ///< the nav area containing this hiding spot + Vector m_pos; // world coordinates of the spot + unsigned int m_id; // this spot's unique ID + unsigned int m_marker; // this spot's unique marker + CNavArea *m_area; // the nav area containing this hiding spot - unsigned char m_flags; ///< bit flags + unsigned char m_flags; // bit flags - static unsigned int m_nextID; ///< used when allocating spot ID's - static unsigned int m_masterMarker; ///< used to mark spots + static unsigned int m_nextID; // used when allocating spot ID's + static unsigned int m_masterMarker; // used to mark spots }; -typedef CUtlLinkedList< HidingSpot *, int > HidingSpotList; -extern HidingSpotList TheHidingSpotList; +typedef CUtlVectorUltraConservative< HidingSpot * > HidingSpotVector; +extern HidingSpotVector TheHidingSpots; extern HidingSpot *GetHidingSpotByID( unsigned int id ); @@ -122,14 +172,14 @@ extern HidingSpot *GetHidingSpotByID( unsigned int id ); */ struct SpotOrder { - float t; ///< parametric distance along ray where this spot first has LOS to our path + float t; // parametric distance along ray where this spot first has LOS to our path union { - HidingSpot *spot; ///< the spot to look at - unsigned int id; ///< spot ID for save/load + HidingSpot *spot; // the spot to look at + unsigned int id; // spot ID for save/load }; }; -typedef CUtlLinkedList< SpotOrder, int > SpotOrderList; +typedef CUtlVector< SpotOrder > SpotOrderVector; /** * This struct stores possible path segments thru a CNavArea, and the dangerous spots @@ -141,132 +191,219 @@ struct SpotEncounter NavDirType fromDir; NavConnect to; NavDirType toDir; - Ray path; ///< the path segment - SpotOrderList spotList; ///< list of spots to look at, in order of occurrence + Ray path; // the path segment + SpotOrderVector spots; // list of spots to look at, in order of occurrence }; -typedef CUtlLinkedList< SpotEncounter *, int > SpotEncounterList; +typedef CUtlVectorUltraConservative< SpotEncounter * > SpotEncounterVector; //------------------------------------------------------------------------------------------------------------------- /** * A CNavArea is a rectangular region defining a walkable area in the environment */ -class CNavArea + +class CNavAreaCriticalData +{ +protected: + // --- Begin critical data, which is heavily hit during pathing operations and carefully arranged for cache performance [7/24/2008 tom] --- + + /* 0 */ Vector m_nwCorner; // north-west corner position (2D mins) + /* 12 */ Vector m_seCorner; // south-east corner position (2D maxs) + /* 24 */ float m_invDxCorners; + /* 28 */ float m_invDyCorners; + /* 32 */ float m_neZ; // height of the implicit corner defined by (m_seCorner.x, m_nwCorner.y, m_neZ) + /* 36 */ float m_swZ; // height of the implicit corner defined by (m_nwCorner.x, m_seCorner.y, m_neZ) + /* 40 */ Vector m_center; // centroid of area + + /* 52 */ unsigned char m_playerCount[ MAX_NAV_TEAMS ]; // the number of players currently in this area + + /* 54 */ bool m_isBlocked[ MAX_NAV_TEAMS ]; // if true, some part of the world is preventing movement through this nav area + + /* 56 */ unsigned int m_marker; // used to flag the area as visited + /* 60 */ float m_totalCost; // the distance so far plus an estimate of the distance left + /* 64 */ float m_costSoFar; // distance travelled so far + + /* 68 */ CNavArea *m_nextOpen, *m_prevOpen; // only valid if m_openMarker == m_masterMarker + /* 76 */ unsigned int m_openMarker; // if this equals the current marker value, we are on the open list + + /* 80 */ int m_attributeFlags; // set of attribute bit flags (see NavAttributeType) + + //- connections to adjacent areas ------------------------------------------------------------------- + /* 84 */ NavConnectVector m_connect[ NUM_DIRECTIONS ]; // a list of adjacent areas for each direction + /* 100*/ NavLadderConnectVector m_ladder[ CNavLadder::NUM_LADDER_DIRECTIONS ]; // list of ladders leading up and down from this area + /* 108*/ NavConnectVector m_elevatorAreas; // a list of areas reachable via elevator from this area + + /* 112*/ unsigned int m_nearNavSearchMarker; // used in GetNearestNavArea() + + /* 116*/ CNavArea *m_parent; // the area just prior to this on in the search path + /* 120*/ NavTraverseType m_parentHow; // how we get from parent to us + + /* 124*/ float m_pathLengthSoFar; // length of path so far, needed for limiting pathfind max path length + + /* *************** 360 cache line *************** */ + + /* 128*/ CFuncElevator *m_elevator; // if non-NULL, this area is in an elevator's path. The elevator can transport us vertically to another area. + + // --- End critical data --- +}; + + +class CNavArea : protected CNavAreaCriticalData { public: - CNavArea( CNavNode *nwNode, CNavNode *neNode, CNavNode *seNode, CNavNode *swNode ); + DECLARE_CLASS_NOBASE( CNavArea ) + CNavArea( void ); - CNavArea( const Vector &corner, const Vector &otherCorner ); - CNavArea( const Vector &nwCorner, const Vector &neCorner, const Vector &seCorner, const Vector &swCorner ); + virtual ~CNavArea(); + + virtual void OnServerActivate( void ); // (EXTEND) invoked when map is initially loaded + virtual void OnRoundRestart( void ); // (EXTEND) invoked for each area when the round restarts + virtual void OnRoundRestartPreEntity( void ) { } // invoked for each area when the round restarts, but before entities are deleted and recreated + virtual void OnEnter( CBaseCombatCharacter *who, CNavArea *areaJustLeft ) { } // invoked when player enters this area + virtual void OnExit( CBaseCombatCharacter *who, CNavArea *areaJustEntered ) { } // invoked when player exits this area - ~CNavArea(); + virtual void OnDestroyNotify( CNavArea *dead ); // invoked when given area is going away + virtual void OnDestroyNotify( CNavLadder *dead ); // invoked when given ladder is going away - void ConnectTo( CNavArea *area, NavDirType dir ); ///< connect this area to given area in given direction - void Disconnect( CNavArea *area ); ///< disconnect this area from given area + virtual void OnEditCreateNotify( CNavArea *newArea ) { } // invoked when given area has just been added to the mesh in edit mode + virtual void OnEditDestroyNotify( CNavArea *deadArea ) { } // invoked when given area has just been deleted from the mesh in edit mode + virtual void OnEditDestroyNotify( CNavLadder *deadLadder ) { } // invoked when given ladder has just been deleted from the mesh in edit mode - void ConnectTo( CNavLadder *ladder ); ///< connect this area to given ladder - void Disconnect( CNavLadder *ladder ); ///< disconnect this area from given ladder + virtual void Save( CUtlBuffer &fileBuffer, unsigned int version ) const; // (EXTEND) + virtual NavErrorType Load( CUtlBuffer &fileBuffer, unsigned int version, unsigned int subVersion ); // (EXTEND) + virtual NavErrorType PostLoad( void ); // (EXTEND) invoked after all areas have been loaded - for pointer binding, etc - void Save( FileHandle_t file, unsigned int version ) const; - void Load( FileHandle_t file, unsigned int version ); - NavErrorType PostLoad( void ); + virtual void SaveToSelectedSet( KeyValues *areaKey ) const; // (EXTEND) saves attributes for the area to a KeyValues + virtual void RestoreFromSelectedSet( KeyValues *areaKey ); // (EXTEND) restores attributes from a KeyValues - unsigned int GetID( void ) const { return m_id; } ///< return this area's unique ID - static void CompressIDs( void ); ///< re-orders area ID's so they are continuous + // for interactively building or generating nav areas + void Build( CNavNode *nwNode, CNavNode *neNode, CNavNode *seNode, CNavNode *swNode ); + void Build( const Vector &corner, const Vector &otherCorner ); + void Build( const Vector &nwCorner, const Vector &neCorner, const Vector &seCorner, const Vector &swCorner ); - void SetAttributes( int bits ) { m_attributeFlags = (unsigned short)bits; } - int GetAttributes( void ) const { return m_attributeFlags; } + void ConnectTo( CNavArea *area, NavDirType dir ); // connect this area to given area in given direction + void Disconnect( CNavArea *area ); // disconnect this area from given area - void SetPlace( Place place ) { m_place = place; } ///< set place descriptor - Place GetPlace( void ) const { return m_place; } ///< get place descriptor + void ConnectTo( CNavLadder *ladder ); // connect this area to given ladder + void Disconnect( CNavLadder *ladder ); // disconnect this area from given ladder + + unsigned int GetID( void ) const { return m_id; } // return this area's unique ID + static void CompressIDs( void ); // re-orders area ID's so they are continuous + unsigned int GetDebugID( void ) const { return m_debugid; } + + void SetAttributes( int bits ) { m_attributeFlags = bits; } + int GetAttributes( void ) const { return m_attributeFlags; } + bool HasAttributes( int bits ) const { return ( m_attributeFlags & bits ) ? true : false; } + void RemoveAttributes( int bits ) { m_attributeFlags &= ( ~bits ); } + + void SetPlace( Place place ) { m_place = place; } // set place descriptor + Place GetPlace( void ) const { return m_place; } // get place descriptor + + void MarkAsBlocked( int teamID, CBaseEntity *blocker, bool bGenerateEvent = true ); // An entity can force a nav area to be blocked + virtual void UpdateBlocked( bool force = false, int teamID = TEAM_ANY ); // Updates the (un)blocked status of the nav area (throttled) + bool IsBlocked( int teamID, bool ignoreNavBlockers = false ) const; + + void CheckFloor( CBaseEntity *ignore ); // Checks if there is a floor under the nav area, in case a breakable floor is gone + + void MarkObstacleToAvoid( float obstructionHeight ); + void UpdateAvoidanceObstacles( void ); + bool HasAvoidanceObstacle( float maxObstructionHeight = StepHeight ) const; // is there a large, immobile object obstructing this area + float GetAvoidanceObstacleHeight( void ) const; // returns the maximum height of the obstruction above the ground - void UpdateBlocked( void ); ///< Updates the (un)blocked status of the nav area - void CheckFloor( CBaseEntity *ignore ); ///< Checks if there is a floor under the nav area, in case a breakable floor is gone - bool IsBlocked( void ) const { return m_isBlocked; } void CheckWaterLevel( void ); bool IsUnderwater( void ) const { return m_isUnderwater; } - bool IsOverlapping( const Vector &pos, float tolerance = 0.0f ) const; ///< return true if 'pos' is within 2D extents of area. - bool IsOverlapping( const CNavArea *area ) const; ///< return true if 'area' overlaps our 2D extents - bool IsOverlappingX( const CNavArea *area ) const; ///< return true if 'area' overlaps our X extent - bool IsOverlappingY( const CNavArea *area ) const; ///< return true if 'area' overlaps our Y extent - float GetZ( const Vector &pos ) const; ///< return Z of area at (x,y) of 'pos' - float GetZ( float x, float y ) const; ///< return Z of area at (x,y) of 'pos' - bool Contains( const Vector &pos ) const; ///< return true if given point is on or above this area, but no others - bool IsCoplanar( const CNavArea *area ) const; ///< return true if this area and given area are approximately co-planar - void GetClosestPointOnArea( const Vector &pos, Vector *close ) const; ///< return closest point to 'pos' on this area - returned point in 'close' - float GetDistanceSquaredToPoint( const Vector &pos ) const; ///< return shortest distance between point and this area - bool IsDegenerate( void ) const; ///< return true if this area is badly formed - bool IsRoughlySquare( void ) const; ///< return true if this area is approximately square - bool IsFlat( void ) const; ///< return true if this area is approximately flat - - bool IsEdge( NavDirType dir ) const; ///< return true if there are no bi-directional links on the given side - - bool IsVisible( const Vector &eye, Vector *visSpot = NULL ) const; ///< return true if area is visible from the given eyepoint, return visible spot - - int GetAdjacentCount( NavDirType dir ) const { return m_connect[ dir ].Count(); } ///< return number of connected areas in given direction - CNavArea *GetAdjacentArea( NavDirType dir, int i ) const; /// return the i'th adjacent area in the given direction + bool IsOverlapping( const Vector &pos, float tolerance = 0.0f ) const; // return true if 'pos' is within 2D extents of area. + bool IsOverlapping( const CNavArea *area ) const; // return true if 'area' overlaps our 2D extents + bool IsOverlapping( const Extent &extent ) const; // return true if 'extent' overlaps our 2D extents + bool IsOverlappingX( const CNavArea *area ) const; // return true if 'area' overlaps our X extent + bool IsOverlappingY( const CNavArea *area ) const; // return true if 'area' overlaps our Y extent + inline float GetZ( const Vector * RESTRICT pPos ) const ; // return Z of area at (x,y) of 'pos' + inline float GetZ( const Vector &pos ) const; // return Z of area at (x,y) of 'pos' + float GetZ( float x, float y ) const RESTRICT; // return Z of area at (x,y) of 'pos' + bool Contains( const Vector &pos ) const; // return true if given point is on or above this area, but no others + bool Contains( const CNavArea *area ) const; + bool IsCoplanar( const CNavArea *area ) const; // return true if this area and given area are approximately co-planar + void GetClosestPointOnArea( const Vector * RESTRICT pPos, Vector *close ) const RESTRICT; // return closest point to 'pos' on this area - returned point in 'close' + void GetClosestPointOnArea( const Vector &pos, Vector *close ) const { return GetClosestPointOnArea( &pos, close ); } + float GetDistanceSquaredToPoint( const Vector &pos ) const; // return shortest distance between point and this area + bool IsDegenerate( void ) const; // return true if this area is badly formed + bool IsRoughlySquare( void ) const; // return true if this area is approximately square + bool IsFlat( void ) const; // return true if this area is approximately flat + bool HasNodes( void ) const; + void GetNodes( NavDirType dir, CUtlVector< CNavNode * > *nodes ) const; // build a vector of nodes along the given direction + CNavNode *FindClosestNode( const Vector &pos, NavDirType dir ) const; // returns the closest node along the given edge to the given point + + bool IsContiguous( const CNavArea *other ) const; // return true if the given area and 'other' share a colinear edge (ie: no drop-down or step/jump/climb) + float ComputeAdjacentConnectionHeightChange( const CNavArea *destinationArea ) const; // return height change between edges of adjacent nav areas (not actual underlying ground) + + bool IsEdge( NavDirType dir ) const; // return true if there are no bi-directional links on the given side + + bool IsDamaging( void ) const; // Return true if continuous damage (ie: fire) is in this area + void MarkAsDamaging( float duration ); // Mark this area is damaging for the next 'duration' seconds + + bool IsVisible( const Vector &eye, Vector *visSpot = NULL ) const; // return true if area is visible from the given eyepoint, return visible spot + + int GetAdjacentCount( NavDirType dir ) const { return m_connect[ dir ].Count(); } // return number of connected areas in given direction + CNavArea *GetAdjacentArea( NavDirType dir, int i ) const; // return the i'th adjacent area in the given direction CNavArea *GetRandomAdjacentArea( NavDirType dir ) const; - const NavConnectList *GetAdjacentList( NavDirType dir ) const { return &m_connect[dir]; } - bool IsConnected( const CNavArea *area, NavDirType dir ) const; ///< return true if given area is connected in given direction - bool IsConnected( const CNavLadder *ladder, CNavLadder::LadderDirectionType dir ) const; ///< return true if given ladder is connected in given direction - float ComputeHeightChange( const CNavArea *area ); ///< compute change in height from this area to given area + const NavConnectVector *GetAdjacentAreas( NavDirType dir ) const { return &m_connect[dir]; } + bool IsConnected( const CNavArea *area, NavDirType dir ) const; // return true if given area is connected in given direction + bool IsConnected( const CNavLadder *ladder, CNavLadder::LadderDirectionType dir ) const; // return true if given ladder is connected in given direction + float ComputeGroundHeightChange( const CNavArea *area ); // compute change in actual ground height from this area to given area - const NavLadderConnectList *GetLadderList( CNavLadder::LadderDirectionType dir ) const { return &m_ladder[dir]; } + const NavConnectVector *GetIncomingConnections( NavDirType dir ) const { return &m_incomingConnect[dir]; } // get areas connected TO this area by a ONE-WAY link (ie: we have no connection back to them) + void AddIncomingConnection( CNavArea *source, NavDirType incomingEdgeDir ); - void ComputePortal( const CNavArea *to, NavDirType dir, Vector *center, float *halfWidth ) const; ///< compute portal to adjacent area - void ComputeClosestPointInPortal( const CNavArea *to, NavDirType dir, const Vector &fromPos, Vector *closePos ) const; ///< compute closest point within the "portal" between to adjacent areas - NavDirType ComputeDirection( Vector *point ) const; ///< return direction from this area to the given point + const NavLadderConnectVector *GetLadders( CNavLadder::LadderDirectionType dir ) const { return &m_ladder[dir]; } + CFuncElevator *GetElevator( void ) const { Assert( !( m_attributeFlags & NAV_MESH_HAS_ELEVATOR ) == (m_elevator == NULL) ); return ( m_attributeFlags & NAV_MESH_HAS_ELEVATOR ) ? m_elevator : NULL; } + const NavConnectVector &GetElevatorAreas( void ) const { return m_elevatorAreas; } // return collection of areas reachable via elevator from this area + + void ComputePortal( const CNavArea *to, NavDirType dir, Vector *center, float *halfWidth ) const; // compute portal to adjacent area + NavDirType ComputeLargestPortal( const CNavArea *to, Vector *center, float *halfWidth ) const; // compute largest portal to adjacent area, returning direction + void ComputeClosestPointInPortal( const CNavArea *to, NavDirType dir, const Vector &fromPos, Vector *closePos ) const; // compute closest point within the "portal" between to adjacent areas + NavDirType ComputeDirection( Vector *point ) const; // return direction from this area to the given point //- for hunting algorithm --------------------------------------------------------------------------- - void SetClearedTimestamp( int teamID ); ///< set this area's "clear" timestamp to now - float GetClearedTimestamp( int teamID ) const; ///< get time this area was marked "clear" + void SetClearedTimestamp( int teamID ); // set this area's "clear" timestamp to now + float GetClearedTimestamp( int teamID ) const; // get time this area was marked "clear" //- hiding spots ------------------------------------------------------------------------------------ - const HidingSpotList *GetHidingSpotList( void ) const { return &m_hidingSpotList; } - void ComputeHidingSpots( void ); ///< analyze local area neighborhood to find "hiding spots" in this area - for map learning - void ComputeSniperSpots( void ); ///< analyze local area neighborhood to find "sniper spots" in this area - for map learning + const HidingSpotVector *GetHidingSpots( void ) const { return &m_hidingSpots; } - SpotEncounter *GetSpotEncounter( const CNavArea *from, const CNavArea *to ); ///< given the areas we are moving between, return the spots we will encounter - void ComputeSpotEncounters( void ); ///< compute spot encounter data - for map learning - int GetSpotEncounterCount( void ) const { return m_spotEncounterList.Count(); } + SpotEncounter *GetSpotEncounter( const CNavArea *from, const CNavArea *to ); // given the areas we are moving between, return the spots we will encounter + int GetSpotEncounterCount( void ) const { return m_spotEncounters.Count(); } //- "danger" ---------------------------------------------------------------------------------------- - void IncreaseDanger( int teamID, float amount ); ///< increase the danger of this area for the given team - float GetDanger( int teamID ); ///< return the danger of this area (decays over time) + void IncreaseDanger( int teamID, float amount ); // increase the danger of this area for the given team + float GetDanger( int teamID ); // return the danger of this area (decays over time) + virtual float GetDangerDecayRate( void ) const; // return danger decay rate per second //- extents ----------------------------------------------------------------------------------------- - float GetSizeX( void ) const { return m_extent.hi.x - m_extent.lo.x; } - float GetSizeY( void ) const { return m_extent.hi.y - m_extent.lo.y; } - const Extent &GetExtent( void ) const { return m_extent; } + float GetSizeX( void ) const { return m_seCorner.x - m_nwCorner.x; } + float GetSizeY( void ) const { return m_seCorner.y - m_nwCorner.y; } + void GetExtent( Extent *extent ) const; // return a computed extent (XY is in m_nwCorner and m_seCorner, Z is computed) const Vector &GetCenter( void ) const { return m_center; } - const Vector &GetCorner( NavCornerType corner ) const; + Vector GetRandomPoint( void ) const; + Vector GetCorner( NavCornerType corner ) const; void SetCorner( NavCornerType corner, const Vector& newPosition ); - void ComputeNormal( Vector *normal, bool alternate = false ) const; ///< Computes the area's normal based on m_extent.lo. If 'alternate' is specified, m_extent.hi is used instead. - - //- approach areas ---------------------------------------------------------------------------------- - struct ApproachInfo - { - NavConnect here; ///< the approach area - NavConnect prev; ///< the area just before the approach area on the path - NavTraverseType prevToHereHow; - NavConnect next; ///< the area just after the approach area on the path - NavTraverseType hereToNextHow; - }; - const ApproachInfo *GetApproachInfo( int i ) const { return &m_approach[i]; } - int GetApproachInfoCount( void ) const { return m_approachCount; } - void ComputeApproachAreas( void ); ///< determine the set of "approach areas" - for map learning + void ComputeNormal( Vector *normal, bool alternate = false ) const; // Computes the area's normal based on m_nwCorner. If 'alternate' is specified, m_seCorner is used instead. + void RemoveOrthogonalConnections( NavDirType dir ); //- occupy time ------------------------------------------------------------------------------------ - float GetEarliestOccupyTime( int teamID ) const; ///< returns the minimum time for someone of the given team to reach this spot from their spawn - bool IsBattlefront( void ) const { return m_isBattlefront; } ///< true if this area is a "battlefront" - where rushing teams initially meet + float GetEarliestOccupyTime( int teamID ) const; // returns the minimum time for someone of the given team to reach this spot from their spawn + bool IsBattlefront( void ) const { return m_isBattlefront; } // true if this area is a "battlefront" - where rushing teams initially meet //- player counting -------------------------------------------------------------------------------- - void IncrementPlayerCount( int teamID ); ///< add one player to this area's count - void DecrementPlayerCount( int teamID ); ///< subtract one player from this area's count - void ClearPlayerCount( void ); ///< set the player count to zero - unsigned char GetPlayerCount( int teamID = 0 ) const; ///< return number of players of given team currently within this area (team of zero means any/all) + void IncrementPlayerCount( int teamID, int entIndex ); // add one player to this area's count + void DecrementPlayerCount( int teamID, int entIndex ); // subtract one player from this area's count + unsigned char GetPlayerCount( int teamID = 0 ) const; // return number of players of given team currently within this area (team of zero means any/all) + + //- lighting ---------------------------------------------------------------------------------------- + float GetLightIntensity( const Vector &pos ) const; // returns a 0..1 light intensity for the given point + float GetLightIntensity( float x, float y ) const; // returns a 0..1 light intensity for the given point + float GetLightIntensity( void ) const; // returns a 0..1 light intensity averaged over the whole area //- A* pathfinding algorithm ------------------------------------------------------------------------ static void MakeNewMarker( void ) { ++m_masterMarker; if (m_masterMarker == 0) m_masterMarker = 1; } @@ -277,50 +414,225 @@ class CNavArea CNavArea *GetParent( void ) const { return m_parent; } NavTraverseType GetParentHow( void ) const { return m_parentHow; } - bool IsOpen( void ) const; ///< true if on "open list" - void AddToOpenList( void ); ///< add to open list in decreasing value order - void UpdateOnOpenList( void ); ///< a smaller value has been found, update this area on the open list + bool IsOpen( void ) const; // true if on "open list" + void AddToOpenList( void ); // add to open list in decreasing value order + void AddToOpenListTail( void ); // add to tail of the open list + void UpdateOnOpenList( void ); // a smaller value has been found, update this area on the open list void RemoveFromOpenList( void ); static bool IsOpenListEmpty( void ); - static CNavArea *PopOpenList( void ); ///< remove and return the first element of the open list + static CNavArea *PopOpenList( void ); // remove and return the first element of the open list - bool IsClosed( void ) const; ///< true if on "closed list" - void AddToClosedList( void ); ///< add to the closed list + bool IsClosed( void ) const; // true if on "closed list" + void AddToClosedList( void ); // add to the closed list void RemoveFromClosedList( void ); - static void ClearSearchLists( void ); ///< clears the open and closed lists for a new search + static void ClearSearchLists( void ); // clears the open and closed lists for a new search - void SetTotalCost( float value ) { m_totalCost = value; } + void SetTotalCost( float value ) { Assert( value >= 0.0 && !IS_NAN(value) ); m_totalCost = value; } float GetTotalCost( void ) const { return m_totalCost; } - void SetCostSoFar( float value ) { m_costSoFar = value; } + void SetCostSoFar( float value ) { Assert( value >= 0.0 && !IS_NAN(value) ); m_costSoFar = value; } float GetCostSoFar( void ) const { return m_costSoFar; } + void SetPathLengthSoFar( float value ) { Assert( value >= 0.0 && !IS_NAN(value) ); m_pathLengthSoFar = value; } + float GetPathLengthSoFar( void ) const { return m_pathLengthSoFar; } + //- editing ----------------------------------------------------------------------------------------- - void Draw( void ) const; ///< draw area for debugging & editing + virtual void Draw( void ) const; // draw area for debugging & editing + virtual void DrawFilled( int r, int g, int b, int a, float deltaT = 0.1f, bool noDepthTest = true, float margin = 5.0f ) const; // draw area as a filled rect of the given color + virtual void DrawSelectedSet( const Vector &shift ) const; // draw this area as part of a selected set + void DrawDragSelectionSet( Color &dragSelectionSetColor ) const; void DrawConnectedAreas( void ) const; void DrawHidingSpots( void ) const; - bool SplitEdit( bool splitAlongX, float splitEdge, CNavArea **outAlpha = NULL, CNavArea **outBeta = NULL ); ///< split this area into two areas at the given edge - bool MergeEdit( CNavArea *adj ); ///< merge this area and given adjacent area - bool SpliceEdit( CNavArea *other ); ///< create a new area between this area and given area - void RaiseCorner( NavCornerType corner, int amount, bool raiseAdjacentCorners = true ); ///< raise/lower a corner (or all corners if corner == NUM_CORNERS) - void PlaceOnGround( NavCornerType corner, float inset = 0.0f ); ///< places a corner (or all corners if corner == NUM_CORNERS) on the ground + bool SplitEdit( bool splitAlongX, float splitEdge, CNavArea **outAlpha = NULL, CNavArea **outBeta = NULL ); // split this area into two areas at the given edge + bool MergeEdit( CNavArea *adj ); // merge this area and given adjacent area + bool SpliceEdit( CNavArea *other ); // create a new area between this area and given area + void RaiseCorner( NavCornerType corner, int amount, bool raiseAdjacentCorners = true ); // raise/lower a corner (or all corners if corner == NUM_CORNERS) + void PlaceOnGround( NavCornerType corner, float inset = 0.0f ); // places a corner (or all corners if corner == NUM_CORNERS) on the ground NavCornerType GetCornerUnderCursor( void ) const; - bool GetCornerHotspot( NavCornerType corner, Vector hotspot[NUM_CORNERS] ) const; ///< returns true if the corner is under the cursor + bool GetCornerHotspot( NavCornerType corner, Vector hotspot[NUM_CORNERS] ) const; // returns true if the corner is under the cursor + void Shift( const Vector &shift ); // shift the nav area //- ladders ----------------------------------------------------------------------------------------- void AddLadderUp( CNavLadder *ladder ); void AddLadderDown( CNavLadder *ladder ); + //- generation and analysis ------------------------------------------------------------------------- + virtual void ComputeHidingSpots( void ); // analyze local area neighborhood to find "hiding spots" in this area - for map learning + virtual void ComputeSniperSpots( void ); // analyze local area neighborhood to find "sniper spots" in this area - for map learning + virtual void ComputeSpotEncounters( void ); // compute spot encounter data - for map learning + virtual void ComputeEarliestOccupyTimes( void ); + virtual void CustomAnalysis( bool isIncremental = false ) { } // for game-specific analysis + virtual bool ComputeLighting( void ); // compute 0..1 light intensity at corners and center (requires client via listenserver) + bool TestStairs( void ); // Test an area for being on stairs + virtual bool IsAbleToMergeWith( CNavArea *other ) const; + + virtual void InheritAttributes( CNavArea *first, CNavArea *second = NULL ); + + + //- visibility ------------------------------------------------------------------------------------- + enum VisibilityType + { + NOT_VISIBLE = 0x00, + POTENTIALLY_VISIBLE = 0x01, + COMPLETELY_VISIBLE = 0x02, + }; + + VisibilityType ComputeVisibility( const CNavArea *area, bool isPVSValid, bool bCheckPVS = true, bool *pOutsidePVS = NULL ) const; // do actual line-of-sight traces to determine if any part of given area is visible from this area + void SetupPVS( void ) const; + bool IsInPVS( void ) const; // return true if this area is within the current PVS + + struct AreaBindInfo // for pointer loading and binding + { + union + { + CNavArea *area; + unsigned int id; + }; + + unsigned char attributes; // VisibilityType + + bool operator==( const AreaBindInfo &other ) const + { + return ( area == other.area ); + } + }; + + virtual bool IsEntirelyVisible( const Vector &eye, CBaseEntity *ignore = NULL ) const; // return true if entire area is visible from given eyepoint (CPU intensive) + virtual bool IsPartiallyVisible( const Vector &eye, CBaseEntity *ignore = NULL ) const; // return true if any portion of the area is visible from given eyepoint (CPU intensive) + + virtual bool IsPotentiallyVisible( const CNavArea *area ) const; // return true if given area is potentially visible from somewhere in this area (very fast) + virtual bool IsPotentiallyVisibleToTeam( int team ) const; // return true if any portion of this area is visible to anyone on the given team (very fast) + + virtual bool IsCompletelyVisible( const CNavArea *area ) const; // return true if given area is completely visible from somewhere in this area (very fast) + virtual bool IsCompletelyVisibleToTeam( int team ) const; // return true if given area is completely visible from somewhere in this area by someone on the team (very fast) + + //------------------------------------------------------------------------------------- + /** + * Apply the functor to all navigation areas that are potentially + * visible from this area. + */ + template < typename Functor > + bool ForAllPotentiallyVisibleAreas( Functor &func ) + { + int i; + + ++s_nCurrVisTestCounter; + + for ( i=0; im_nVisTestCounter != s_nCurrVisTestCounter ); + area->m_nVisTestCounter = s_nCurrVisTestCounter; + + if ( m_potentiallyVisibleAreas[i].attributes == NOT_VISIBLE ) + continue; + + if ( func( area ) == false ) + return false; + } + + // for each inherited area + if ( !m_inheritVisibilityFrom.area ) + return true; + + CAreaBindInfoArray &inherited = m_inheritVisibilityFrom.area->m_potentiallyVisibleAreas; + + for ( i=0; im_nVisTestCounter == s_nCurrVisTestCounter ) + continue; + + // Theoretically, this shouldn't matter. But, just in case! + inherited[i].area->m_nVisTestCounter = s_nCurrVisTestCounter; + + if ( inherited[i].attributes == NOT_VISIBLE ) + continue; + + if ( func( inherited[i].area ) == false ) + return false; + } + + return true; + } + + //------------------------------------------------------------------------------------- + /** + * Apply the functor to all navigation areas that are + * completely visible from somewhere in this area. + */ + template < typename Functor > + bool ForAllCompletelyVisibleAreas( Functor &func ) + { + int i; + + ++s_nCurrVisTestCounter; + + for ( i=0; im_nVisTestCounter != s_nCurrVisTestCounter ); + area->m_nVisTestCounter = s_nCurrVisTestCounter; + + if ( ( m_potentiallyVisibleAreas[i].attributes & COMPLETELY_VISIBLE ) == 0 ) + continue; + + if ( func( area ) == false ) + return false; + } + + if ( !m_inheritVisibilityFrom.area ) + return true; + + // for each inherited area + CAreaBindInfoArray &inherited = m_inheritVisibilityFrom.area->m_potentiallyVisibleAreas; + + for ( i=0; im_nVisTestCounter == s_nCurrVisTestCounter ) + continue; + + // Theoretically, this shouldn't matter. But, just in case! + inherited[i].area->m_nVisTestCounter = s_nCurrVisTestCounter; + + if ( ( inherited[i].attributes & COMPLETELY_VISIBLE ) == 0 ) + continue; + + if ( func( inherited[i].area ) == false ) + return false; + } + + return true; + } + + +protected: + void UnblockArea( void ); + private: friend class CNavMesh; friend class CNavLadder; - void Initialize( void ); ///< to keep constructors consistent - static bool m_isReset; ///< if true, don't bother cleaning up in destructor since everything is going away + static bool m_isReset; // if true, don't bother cleaning up in destructor since everything is going away /* - extent.lo + m_nwCorner nw ne +-----------+ | +-->x | @@ -330,89 +642,103 @@ class CNavArea | | +-----------+ sw se - extent.hi + m_seCorner */ - static unsigned int m_nextID; ///< used to allocate unique IDs - unsigned int m_id; ///< unique area ID - Extent m_extent; ///< extents of area in world coords (NOTE: lo.z is not necessarily the minimum Z, but corresponds to Z at point (lo.x, lo.y), etc - Vector m_center; ///< centroid of area - unsigned short m_attributeFlags; ///< set of attribute bit flags (see NavAttributeType) - Place m_place; ///< place descriptor - bool m_isBlocked; ///< if true, some part of the world is preventing movement through this nav area - bool m_isUnderwater; ///< true if the center of the area is underwater + static unsigned int m_nextID; // used to allocate unique IDs + unsigned int m_id; // unique area ID + unsigned int m_debugid; - /// height of the implicit corners - float m_neZ; - float m_swZ; + Place m_place; // place descriptor + + CountdownTimer m_blockedTimer; // Throttle checks on our blocked state while blocked + void UpdateBlockedFromNavBlockers( void ); // checks if nav blockers are still blocking the area + + bool m_isUnderwater; // true if the center of the area is underwater + + bool m_isBattlefront; + + float m_avoidanceObstacleHeight; // if nonzero, a prop is obstructing movement through this nav area + CountdownTimer m_avoidanceObstacleTimer; // Throttle checks on our obstructed state while obstructed //- for hunting ------------------------------------------------------------------------------------- - float m_clearedTimestamp[ MAX_NAV_TEAMS ]; ///< time this area was last "cleared" of enemies + float m_clearedTimestamp[ MAX_NAV_TEAMS ]; // time this area was last "cleared" of enemies //- "danger" ---------------------------------------------------------------------------------------- - float m_danger[ MAX_NAV_TEAMS ]; ///< danger of this area, allowing bots to avoid areas where they died in the past - zero is no danger - float m_dangerTimestamp[ MAX_NAV_TEAMS ]; ///< time when danger value was set - used for decaying + float m_danger[ MAX_NAV_TEAMS ]; // danger of this area, allowing bots to avoid areas where they died in the past - zero is no danger + float m_dangerTimestamp[ MAX_NAV_TEAMS ]; // time when danger value was set - used for decaying void DecayDanger( void ); //- hiding spots ------------------------------------------------------------------------------------ - HidingSpotList m_hidingSpotList; - bool IsHidingSpotCollision( const Vector &pos ) const; ///< returns true if an existing hiding spot is too close to given position + HidingSpotVector m_hidingSpots; + bool IsHidingSpotCollision( const Vector &pos ) const; // returns true if an existing hiding spot is too close to given position //- encounter spots --------------------------------------------------------------------------------- - SpotEncounterList m_spotEncounterList; ///< list of possible ways to move thru this area, and the spots to look at as we do - void AddSpotEncounters( const CNavArea *from, NavDirType fromDir, const CNavArea *to, NavDirType toDir ); ///< add spot encounter data when moving from area to area - - //- approach areas ---------------------------------------------------------------------------------- - enum { MAX_APPROACH_AREAS = 16 }; - ApproachInfo m_approach[ MAX_APPROACH_AREAS ]; - unsigned char m_approachCount; + SpotEncounterVector m_spotEncounters; // list of possible ways to move thru this area, and the spots to look at as we do + void AddSpotEncounters( const CNavArea *from, NavDirType fromDir, const CNavArea *to, NavDirType toDir ); // add spot encounter data when moving from area to area - float m_earliestOccupyTime[ MAX_NAV_TEAMS ]; ///< min time to reach this spot from spawn - void ComputeEarliestOccupyTimes( void ); - bool m_isBattlefront; + float m_earliestOccupyTime[ MAX_NAV_TEAMS ]; // min time to reach this spot from spawn - unsigned char m_playerCount[ MAX_NAV_TEAMS ]; ///< the number of players currently in this area +#ifdef DEBUG_AREA_PLAYERCOUNTS + CUtlVector< int > m_playerEntIndices[ MAX_NAV_TEAMS ]; +#endif - void Strip( void ); ///< remove "analyzed" data from nav area + //- lighting ---------------------------------------------------------------------------------------- + float m_lightIntensity[ NUM_CORNERS ]; // 0..1 light intensity at corners //- A* pathfinding algorithm ------------------------------------------------------------------------ static unsigned int m_masterMarker; - unsigned int m_marker; ///< used to flag the area as visited - CNavArea *m_parent; ///< the area just prior to this on in the search path - NavTraverseType m_parentHow; ///< how we get from parent to us - float m_totalCost; ///< the distance so far plus an estimate of the distance left - float m_costSoFar; ///< distance travelled so far static CNavArea *m_openList; - CNavArea *m_nextOpen, *m_prevOpen; ///< only valid if m_openMarker == m_masterMarker - unsigned int m_openMarker; ///< if this equals the current marker value, we are on the open list + static CNavArea *m_openListTail; //- connections to adjacent areas ------------------------------------------------------------------- - NavConnectList m_connect[ NUM_DIRECTIONS ]; ///< a list of adjacent areas for each direction - NavLadderConnectList m_ladder[ CNavLadder::NUM_LADDER_DIRECTIONS ]; ///< list of ladders leading up and down from this area + NavConnectVector m_incomingConnect[ NUM_DIRECTIONS ]; // a list of adjacent areas for each direction that connect TO us, but we have no connection back to them //--------------------------------------------------------------------------------------------------- - CNavNode *m_node[ NUM_CORNERS ]; ///< nav nodes at each corner of the area + CNavNode *m_node[ NUM_CORNERS ]; // nav nodes at each corner of the area - void ResetNodes( void ); ///< nodes are going away as part of an incremental nav generation - bool HasNodes( void ) const; + void ResetNodes( void ); // nodes are going away as part of an incremental nav generation + void Strip( void ); // remove "analyzed" data from nav area + + void FinishMerge( CNavArea *adjArea ); // recompute internal data once nodes have been adjusted during merge + void MergeAdjacentConnections( CNavArea *adjArea ); // for merging with "adjArea" - pick up all of "adjArea"s connections + void AssignNodes( CNavArea *area ); // assign internal nodes to the given area + + void FinishSplitEdit( CNavArea *newArea, NavDirType ignoreEdge ); // given the portion of the original area, update its internal data + + void CalcDebugID(); + + CNavArea *m_prevHash, *m_nextHash; // for hash table in CNavMesh - void FinishMerge( CNavArea *adjArea ); ///< recompute internal data once nodes have been adjusted during merge - void MergeAdjacentConnections( CNavArea *adjArea ); ///< for merging with "adjArea" - pick up all of "adjArea"s connections - void AssignNodes( CNavArea *area ); ///< assign internal nodes to the given area + void ConnectElevators( void ); // find elevator connections between areas - void FinishSplitEdit( CNavArea *newArea, NavDirType ignoreEdge ); ///< given the portion of the original area, update its internal data + int m_damagingTickCount; // this area is damaging through this tick count - CUtlLinkedList m_overlapList; ///< list of areas that overlap this area - void OnDestroyNotify( CNavArea *dead ); ///< invoked when given area is going away - void OnDestroyNotify( CNavLadder *dead ); ///< invoked when given ladder is going away + //- visibility -------------------------------------------------------------------------------------- + void ComputeVisibilityToMesh( void ); // compute visibility to surrounding mesh + void ResetPotentiallyVisibleAreas(); + static void ComputeVisToArea( CNavArea *&pOtherArea ); - CNavArea *m_prevHash, *m_nextHash; ///< for hash table in CNavMesh +#ifndef _X360 + typedef CUtlVectorConservative CAreaBindInfoArray; // shaves 8 bytes off structure caused by need to support editing +#else + typedef CUtlVector CAreaBindInfoArray; // Need to use this on 360 to support external allocation pattern +#endif + + AreaBindInfo m_inheritVisibilityFrom; // if non-NULL, m_potentiallyVisibleAreas becomes a list of additions and deletions (NOT_VISIBLE) to the list of this area + CAreaBindInfoArray m_potentiallyVisibleAreas; // list of areas potentially visible from inside this area (after PostLoad(), use area portion of union) + bool m_isInheritedFrom; // latch used during visibility inheritance computation + + const CAreaBindInfoArray &ComputeVisibilityDelta( const CNavArea *other ) const; // return a list of the delta between our visibility list and the given adjacent area + + uint32 m_nVisTestCounter; + static uint32 s_nCurrVisTestCounter; }; -typedef CUtlLinkedList< CNavArea *, int > NavAreaList; -extern NavAreaList TheNavAreaList; +typedef CUtlVector< CNavArea * > NavAreaVector; +extern NavAreaVector TheNavAreas; //-------------------------------------------------------------------------------------------------------------- @@ -421,17 +747,23 @@ extern NavAreaList TheNavAreaList; // Inlines // +//-------------------------------------------------------------------------------------------------------------- +inline float CNavArea::GetDangerDecayRate( void ) const +{ + // one kill == 1.0, which we will forget about in two minutes + return 1.0f / 120.0f; +} + //-------------------------------------------------------------------------------------------------------------- inline bool CNavArea::IsDegenerate( void ) const { - return (m_extent.lo.x >= m_extent.hi.x || m_extent.lo.y >= m_extent.hi.y); + return (m_nwCorner.x >= m_seCorner.x || m_nwCorner.y >= m_seCorner.y); } //-------------------------------------------------------------------------------------------------------------- inline CNavArea *CNavArea::GetAdjacentArea( NavDirType dir, int i ) const { - int iter; - for( iter = m_connect[dir].Head(); iter != m_connect[dir].InvalidIndex(); iter=m_connect[dir].Next( iter ) ) + for( int iter = 0; iter < m_connect[dir].Count(); ++iter ) { if (i == 0) return m_connect[dir][iter].area; @@ -450,22 +782,31 @@ inline bool CNavArea::IsOpen( void ) const //-------------------------------------------------------------------------------------------------------------- inline bool CNavArea::IsOpenListEmpty( void ) { + Assert( (m_openList && m_openList->m_prevOpen == NULL) || m_openList == NULL ); return (m_openList) ? false : true; } //-------------------------------------------------------------------------------------------------------------- inline CNavArea *CNavArea::PopOpenList( void ) { - if (m_openList) + Assert( (m_openList && m_openList->m_prevOpen == NULL) || m_openList == NULL ); + + if ( m_openList ) { CNavArea *area = m_openList; // disconnect from list area->RemoveFromOpenList(); + area->m_prevOpen = NULL; + area->m_nextOpen = NULL; + + Assert( (m_openList && m_openList->m_prevOpen == NULL) || m_openList == NULL ); return area; } + Assert( (m_openList && m_openList->m_prevOpen == NULL) || m_openList == NULL ); + return NULL; } @@ -509,6 +850,34 @@ inline float CNavArea::GetEarliestOccupyTime( int teamID ) const } +//-------------------------------------------------------------------------------------------------------------- +inline bool CNavArea::IsDamaging( void ) const +{ + return ( gpGlobals->tickcount <= m_damagingTickCount ); +} + + +//-------------------------------------------------------------------------------------------------------------- +inline void CNavArea::MarkAsDamaging( float duration ) +{ + m_damagingTickCount = gpGlobals->tickcount + TIME_TO_TICKS( duration ); +} + + +//-------------------------------------------------------------------------------------------------------------- +inline bool CNavArea::HasAvoidanceObstacle( float maxObstructionHeight ) const +{ + return m_avoidanceObstacleHeight > maxObstructionHeight; +} + + +//-------------------------------------------------------------------------------------------------------------- +inline float CNavArea::GetAvoidanceObstacleHeight( void ) const +{ + return m_avoidanceObstacleHeight; +} + + //-------------------------------------------------------------------------------------------------------------- inline bool CNavArea::IsVisible( const Vector &eye, Vector *visSpot ) const { @@ -518,7 +887,7 @@ inline bool CNavArea::IsVisible( const Vector &eye, Vector *visSpot ) const const float offset = 0.75f * HumanHeight; // check center first - UTIL_TraceLine( eye, GetCenter() + Vector( 0, 0, offset ), MASK_BLOCKLOS_AND_NPCS, &traceFilter, &result ); + UTIL_TraceLine( eye, GetCenter() + Vector( 0, 0, offset ), MASK_BLOCKLOS_AND_NPCS|CONTENTS_IGNORE_NODRAW_OPAQUE, &traceFilter, &result ); if (result.fraction == 1.0f) { // we can see this area @@ -532,7 +901,7 @@ inline bool CNavArea::IsVisible( const Vector &eye, Vector *visSpot ) const for( int c=0; cz is not used. +*/ +inline float CNavArea::GetZ( const Vector * RESTRICT pos ) const RESTRICT +{ + return GetZ( pos->x, pos->y ); +} + +inline float CNavArea::GetZ( const Vector & pos ) const RESTRICT +{ + return GetZ( pos.x, pos.y ); +} + +//-------------------------------------------------------------------------------------------------------------- +/** +* Return the coordinates of the area's corner. +*/ +inline Vector CNavArea::GetCorner( NavCornerType corner ) const +{ + // @TODO: Confirm compiler does the "right thing" in release builds, or change this function to to take a pointer [2/4/2009 tom] + Vector pos; + + switch( corner ) + { + default: + Assert( false && "GetCorner: Invalid type" ); + case NORTH_WEST: + return m_nwCorner; + + case NORTH_EAST: + pos.x = m_seCorner.x; + pos.y = m_nwCorner.y; + pos.z = m_neZ; + return pos; + + case SOUTH_WEST: + pos.x = m_nwCorner.x; + pos.y = m_seCorner.y; + pos.z = m_swZ; + return pos; + + case SOUTH_EAST: + return m_seCorner; + } +} + #endif // _NAV_AREA_H_ diff --git a/game/server/nav_colors.h b/game/server/nav_colors.h index 213b7defe..ad93c1d8a 100644 --- a/game/server/nav_colors.h +++ b/game/server/nav_colors.h @@ -27,7 +27,8 @@ enum NavEditColor NavMarkedColor, NavNormalColor, NavCornerColor, - NavBlockedColor, + NavBlockedByDoorColor, + NavBlockedByFuncNavBlockerColor, // Hiding spot colors NavIdealSniperColor, @@ -39,12 +40,16 @@ enum NavEditColor // Connector colors NavConnectedTwoWaysColor, NavConnectedOneWayColor, + NavConnectedContiguous, + NavConnectedNonContiguous, // Editing colors NavCursorColor, NavSplitLineColor, NavCreationColor, + NavInvalidCreationColor, NavGridColor, + NavDragSelectionColor, // Nav attribute colors NavAttributeCrouchColor, @@ -55,14 +60,17 @@ enum NavEditColor NavAttributeRunColor, NavAttributeWalkColor, NavAttributeAvoidColor, + NavAttributeStairColor, }; //-------------------------------------------------------------------------------------------------------------- void NavDrawLine( const Vector& from, const Vector& to, NavEditColor navColor ); void NavDrawTriangle( const Vector& point1, const Vector& point2, const Vector& point3, NavEditColor navColor ); +void NavDrawFilledTriangle( const Vector& point1, const Vector& point2, const Vector& point3, NavEditColor navColor, bool dark ); void NavDrawHorizontalArrow( const Vector& from, const Vector& to, float width, NavEditColor navColor ); void NavDrawDashedLine( const Vector& from, const Vector& to, NavEditColor navColor ); +void NavDrawVolume( const Vector &vMin, const Vector &vMax, int zMidline, NavEditColor navColor ); //-------------------------------------------------------------------------------------------------------------- diff --git a/game/server/nav_entities.h b/game/server/nav_entities.h new file mode 100644 index 000000000..940ae9566 --- /dev/null +++ b/game/server/nav_entities.h @@ -0,0 +1,71 @@ +//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// nav_entities.h +// Navigation entities +// Author: Michael S. Booth (mike@turtlerockstudios.com), January 2003 + +#ifndef NAV_ENTITIES_H +#define NAV_ENTITIES_H + +//----------------------------------------------------------------------------------------------------- +/** + * An entity that can block/unblock nav areas. This is meant for semi-transient areas that block + * pathfinding but can be ignored for longer-term queries like computing L4D flow distances and + * escape routes. + */ +class CFuncNavBlocker : public CBaseEntity +{ + DECLARE_DATADESC(); + DECLARE_CLASS( CFuncNavBlocker, CBaseEntity ); + +public: + void Spawn(); + virtual void UpdateOnRemove( void ); + + void InputBlockNav( inputdata_t &inputdata ); + void InputUnblockNav( inputdata_t &inputdata ); + + inline bool IsBlockingNav( int teamNumber ) const + { + if ( teamNumber == TEAM_ANY ) + { + bool isBlocked = false; + for ( int i=0; i gm_NavBlockers; + + void BlockNav( void ); + void UnblockNav( void ); + bool m_isBlockingNav[MAX_NAV_TEAMS]; + int m_blockedTeamNumber; + bool m_bDisabled; + Vector m_CachedMins, m_CachedMaxs; + +}; + +#endif // NAV_ENTITIES_H diff --git a/game/server/nav_ladder.h b/game/server/nav_ladder.h index ae087d0dd..5104bff36 100644 --- a/game/server/nav_ladder.h +++ b/game/server/nav_ladder.h @@ -11,25 +11,9 @@ #ifndef _NAV_LADDER_H_ #define _NAV_LADDER_H_ -class CNavArea; - -//-------------------------------------------------------------------------------------------------------------- -/** - * Placeholder ladder class that holds the mins and maxs for a ladder, since its brushes - * are merged into the world during the compile. - */ -class CInfoLadder : public CBaseEntity -{ -public: - DECLARE_CLASS( CInfoLadder, CBaseEntity ); - DECLARE_DATADESC(); - - bool KeyValue( const char *szKeyName, const char *szValue ); - - Vector mins; - Vector maxs; -}; +#include "nav.h" +class CNavArea; //-------------------------------------------------------------------------------------------------------------- /** @@ -53,8 +37,10 @@ class CNavLadder ~CNavLadder(); - void Save( FileHandle_t file, unsigned int version ) const; - void Load( FileHandle_t file, unsigned int version ); + void OnRoundRestart( void ); ///< invoked when a game round restarts + + void Save( CUtlBuffer &fileBuffer, unsigned int version ) const; + void Load( CUtlBuffer &fileBuffer, unsigned int version ); unsigned int GetID( void ) const { return m_id; } ///< return this ladder's unique ID static void CompressIDs( void ); /// NavLadderList; +typedef CUtlVector< CNavLadder * > NavLadderVector; + + +//-------------------------------------------------------------------------------------------------------------- +inline bool CNavLadder::IsUsableByTeam( int teamNumber ) const +{ + if ( m_ladderEntity.Get() == NULL ) + return true; + + int ladderTeamNumber = m_ladderEntity->GetTeamNumber(); + return ( teamNumber == ladderTeamNumber || ladderTeamNumber == TEAM_UNASSIGNED ); +} + + +//-------------------------------------------------------------------------------------------------------------- +inline CBaseEntity *CNavLadder::GetLadderEntity( void ) const +{ + return m_ladderEntity.Get(); +} //-------------------------------------------------------------------------------------------------------------- diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index df1a7d3aa..b74da37c4 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -19,7 +19,9 @@ #ifndef _NAV_MESH_H_ #define _NAV_MESH_H_ +#include "utlbuffer.h" #include "filesystem.h" +#include "GameEventListener.h" #include "nav.h" #include "nav_area.h" @@ -28,68 +30,279 @@ class CNavArea; class CBaseEntity; +class CBreakable; extern ConVar nav_edit; extern ConVar nav_quicksave; extern ConVar nav_show_approach_points; extern ConVar nav_show_danger; +//-------------------------------------------------------------------------------------------------------- +class NavAreaCollector +{ + bool m_checkForDuplicates; +public: + NavAreaCollector( bool checkForDuplicates = false ) + { + m_checkForDuplicates = checkForDuplicates; + } + + bool operator() ( CNavArea *area ) + { + if ( m_checkForDuplicates && m_area.HasElement( area ) ) + return true; + + m_area.AddToTail( area ); + return true; + } + CUtlVector< CNavArea * > m_area; +}; + + +//-------------------------------------------------------------------------------------------------------- +class EditDestroyNotification +{ + CNavArea *m_deadArea; + +public: + EditDestroyNotification( CNavArea *deadArea ) + { + m_deadArea = deadArea; + } + + bool operator()( CBaseCombatCharacter *actor ) + { + actor->OnNavAreaRemoved( m_deadArea ); + return true; + } +}; + + +//-------------------------------------------------------------------------------------------------------- +class NavAttributeClearer +{ +public: + NavAttributeClearer( NavAttributeType attribute ) + { + m_attribute = attribute; + } + + bool operator() ( CNavArea *area ) + { + area->SetAttributes( area->GetAttributes() & (~m_attribute) ); + + return true; + } + + NavAttributeType m_attribute; +}; + + +//-------------------------------------------------------------------------------------------------------- +class NavAttributeSetter +{ +public: + NavAttributeSetter( NavAttributeType attribute ) + { + m_attribute = attribute; + } + + bool operator() ( CNavArea *area ) + { + area->SetAttributes( area->GetAttributes() | m_attribute ); + + return true; + } + + NavAttributeType m_attribute; +}; + + +//-------------------------------------------------------------------------------------------------------- +class NavAttributeToggler +{ +public: + NavAttributeToggler( NavAttributeType attribute ) + { + m_attribute = attribute; + } + + bool operator() ( CNavArea *area ); + + NavAttributeType m_attribute; +}; + + +//-------------------------------------------------------------------------------------------------------- +struct NavAttributeLookup +{ + const char *name; + NavAttributeType attribute; +}; + +extern NavAttributeLookup TheNavAttributeTable[]; + +//-------------------------------------------------------------------------------------------------------- +class SelectOverlappingAreas +{ +public: + bool operator()( CNavArea *area ); +}; + +//-------------------------------------------------------------------------------------------------------- +abstract_class INavAvoidanceObstacle +{ +public: + virtual bool IsPotentiallyAbleToObstructNavAreas( void ) const = 0; // could we at some future time obstruct nav? + virtual float GetNavObstructionHeight( void ) const = 0; // height at which to obstruct nav areas + virtual bool CanObstructNavAreas( void ) const = 0; // can we obstruct nav right this instant? + virtual CBaseEntity *GetObstructingEntity( void ) = 0; + virtual void OnNavMeshLoaded( void ) = 0; +}; + +//-------------------------------------------------------------------------------------------------------- +enum GetNavAreaFlags_t +{ + GETNAVAREA_CHECK_LOS = 0x1, + GETNAVAREA_ALLOW_BLOCKED_AREAS = 0x2, + GETNAVAREA_CHECK_GROUND = 0x4, +}; + + +//-------------------------------------------------------------------------------------------------------- +// for nav mesh visibilty computation +struct NavVisPair_t +{ + void SetPair( CNavArea *pArea1, CNavArea *pArea2 ) + { + int iArea1 = (int)( pArea1 > pArea2 ); + int iArea2 = ( iArea1 + 1 ) % 2; + pAreas[iArea1] = pArea1; + pAreas[iArea2] = pArea2; + } + + CNavArea *pAreas[2]; +}; + + +// for nav mesh visibilty computation +class CVisPairHashFuncs +{ +public: + CVisPairHashFuncs( int ) {} + + bool operator()( const NavVisPair_t &lhs, const NavVisPair_t &rhs ) const + { + return ( lhs.pAreas[0] == rhs.pAreas[0] && lhs.pAreas[1] == rhs.pAreas[1] ); + } + + unsigned int operator()( const NavVisPair_t &item ) const + { + COMPILE_TIME_ASSERT( sizeof(CNavArea *) == 4 ); + int key[2] = { (int)item.pAreas[0] + item.pAreas[1]->GetID(), (int)item.pAreas[1] + item.pAreas[0]->GetID() }; + return Hash8( key ); + } +}; + + //-------------------------------------------------------------------------------------------------------- /** * The CNavMesh is the global interface to the Navigation Mesh. * @todo Make this an abstract base class interface, and derive mod-specific implementations. */ -class CNavMesh +class CNavMesh : public CGameEventListener { public: CNavMesh( void ); virtual ~CNavMesh(); - - virtual HidingSpot *CreateHidingSpot( void ) const; ///< Hiding Spot factory - - virtual void Reset( void ); ///< destroy Navigation Mesh data and revert to initial state - virtual void Update( void ); ///< invoked on each game frame - - virtual NavErrorType Load( void ); ///< load navigation data from a file - bool IsLoaded( void ) const { return m_isLoaded; } ///< return true if a Navigation Mesh has been loaded - virtual bool Save( void ) const; ///< store Navigation Mesh to a file - bool IsFromCurrentMap( void ) const { return m_isFromCurrentMap; } ///< return true if the Navigation Mesh was last edited with the current map version - - unsigned int GetNavAreaCount( void ) const { return m_areaCount; } ///< return total number of nav areas - - CNavArea *GetNavArea( const Vector &pos, float beneathLimt = 120.0f ) const; ///< given a position, return the nav area that IsOverlapping and is *immediately* beneath it + + virtual void PreLoadAreas( int nAreas ) {} + virtual CNavArea *CreateArea( void ) const; // CNavArea factory + virtual void DestroyArea( CNavArea * ) const; + virtual HidingSpot *CreateHidingSpot( void ) const; // Hiding Spot factory + + virtual void Reset( void ); // destroy Navigation Mesh data and revert to initial state + virtual void Update( void ); // invoked on each game frame + + virtual void FireGameEvent( IGameEvent *event ); // incoming event processing + + virtual NavErrorType Load( void ); // load navigation data from a file + virtual NavErrorType PostLoad( unsigned int version ); // (EXTEND) invoked after all areas have been loaded - for pointer binding, etc + bool IsLoaded( void ) const { return m_isLoaded; } // return true if a Navigation Mesh has been loaded + bool IsAnalyzed( void ) const { return m_isAnalyzed; } // return true if a Navigation Mesh has been analyzed + + const CUtlVector< Place > *GetPlacesFromNavFile( bool *hasUnnamedPlaces ); // Reads the used place names from the nav file (can be used to selectively precache before the nav is loaded) + + virtual bool Save( void ) const; // store Navigation Mesh to a file + bool IsOutOfDate( void ) const { return m_isOutOfDate; } // return true if the Navigation Mesh is older than the current map version + + virtual unsigned int GetSubVersionNumber( void ) const; // returns sub-version number of data format used by derived classes + virtual void SaveCustomData( CUtlBuffer &fileBuffer ) const { } // store custom mesh data for derived classes + virtual void LoadCustomData( CUtlBuffer &fileBuffer, unsigned int subVersion ) { } // load custom mesh data for derived classes + virtual void SaveCustomDataPreArea( CUtlBuffer &fileBuffer ) const { } // store custom mesh data for derived classes that needs to be loaded before areas are read in + virtual void LoadCustomDataPreArea( CUtlBuffer &fileBuffer, unsigned int subVersion ) { } // load custom mesh data for derived classes that needs to be loaded before areas are read in + + // events + virtual void OnServerActivate( void ); // (EXTEND) invoked when server loads a new map + virtual void OnRoundRestart( void ); // invoked when a game round restarts + virtual void OnRoundRestartPreEntity( void ); // invoked when a game round restarts, but before entities are deleted and recreated + virtual void OnBreakableCreated( CBaseEntity *breakable ) { } // invoked when a breakable is created + virtual void OnBreakableBroken( CBaseEntity *broken ) { } // invoked when a breakable is broken + virtual void OnAreaBlocked( CNavArea *area ); // invoked when the area becomes blocked + virtual void OnAreaUnblocked( CNavArea *area ); // invoked when the area becomes un-blocked + virtual void OnAvoidanceObstacleEnteredArea( CNavArea *area ); // invoked when the area becomes obstructed + virtual void OnAvoidanceObstacleLeftArea( CNavArea *area ); // invoked when the area becomes un-obstructed + + virtual void OnEditCreateNotify( CNavArea *newArea ); // invoked when given area has just been added to the mesh in edit mode + virtual void OnEditDestroyNotify( CNavArea *deadArea ); // invoked when given area has just been deleted from the mesh in edit mode + virtual void OnEditDestroyNotify( CNavLadder *deadLadder ); // invoked when given ladder has just been deleted from the mesh in edit mode + virtual void OnNodeAdded( CNavNode *node ) {}; + + // Obstructions + void RegisterAvoidanceObstacle( INavAvoidanceObstacle *obstruction ); + void UnregisterAvoidanceObstacle( INavAvoidanceObstacle *obstruction ); + const CUtlVector< INavAvoidanceObstacle * > &GetObstructions( void ) const { return m_avoidanceObstacles; } + + unsigned int GetNavAreaCount( void ) const { return m_areaCount; } // return total number of nav areas + + // See GetNavAreaFlags_t for flags + CNavArea *GetNavArea( const Vector &pos, float beneathLimt = 120.0f ) const; // given a position, return the nav area that IsOverlapping and is *immediately* beneath it + CNavArea *GetNavArea( CBaseEntity *pEntity, int nGetNavAreaFlags, float flBeneathLimit = 120.0f ) const; CNavArea *GetNavAreaByID( unsigned int id ) const; - CNavArea *GetNearestNavArea( const Vector &pos, bool anyZ = false, float maxDist = 10000.0f, bool checkLOS = false ) const; + CNavArea *GetNearestNavArea( const Vector &pos, bool anyZ = false, float maxDist = 10000.0f, bool checkLOS = false, bool checkGround = true, bool ) const; + CNavArea *GetNearestNavArea( CBaseEntity *pEntity, int nGetNavAreaFlags = GETNAVAREA_CHECK_GROUND, float maxDist = 10000.0f ) const; - Place GetPlace( const Vector &pos ) const; ///< return Place at given coordinate - const char *PlaceToName( Place place ) const; ///< given a place, return its name - Place NameToPlace( const char *name ) const; ///< given a place name, return a place ID or zero if no place is defined - Place PartialNameToPlace( const char *name ) const; ///< given the first part of a place name, return a place ID or zero if no place is defined, or the partial match is ambiguous - void PrintAllPlaces( void ) const; ///< output a list of names to the console - int PlaceNameAutocomplete( char const *partial, char commands[ COMMAND_COMPLETION_MAXITEMS ][ COMMAND_COMPLETION_ITEM_LENGTH ] ); ///< Given a partial place name, fill in possible place names for ConCommand autocomplete + Place GetPlace( const Vector &pos ) const; // return Place at given coordinate + const char *PlaceToName( Place place ) const; // given a place, return its name + Place NameToPlace( const char *name ) const; // given a place name, return a place ID or zero if no place is defined + Place PartialNameToPlace( const char *name ) const; // given the first part of a place name, return a place ID or zero if no place is defined, or the partial match is ambiguous + void PrintAllPlaces( void ) const; // output a list of names to the console + int PlaceNameAutocomplete( char const *partial, char commands[ COMMAND_COMPLETION_MAXITEMS ][ COMMAND_COMPLETION_ITEM_LENGTH ] ); // Given a partial place name, fill in possible place names for ConCommand autocomplete - bool GetGroundHeight( const Vector &pos, float *height, Vector *normal = NULL ) const; ///< get the Z coordinate of the topmost ground level below the given point - bool GetSimpleGroundHeight( const Vector &pos, float *height, Vector *normal = NULL ) const;///< get the Z coordinate of the ground level directly below the given point + bool GetGroundHeight( const Vector &pos, float *height, Vector *normal = NULL ) const; // get the Z coordinate of the topmost ground level below the given point + bool GetSimpleGroundHeight( const Vector &pos, float *height, Vector *normal = NULL ) const;// get the Z coordinate of the ground level directly below the given point /// increase "danger" weights in the given nav area and nearby ones - void IncreaseDangerNearby( int teamID, float amount, CNavArea *area, const Vector &pos, float maxRadius ); - void DrawDanger( void ) const; ///< draw the current danger levels + void IncreaseDangerNearby( int teamID, float amount, CNavArea *area, const Vector &pos, float maxRadius, float dangerLimit = -1.0f ); + void DrawDanger( void ) const; // draw the current danger levels - void ClearPlayerCounts( void ); ///< zero player counts in all areas - void DrawPlayerCounts( void ) const; ///< draw the current player counts for each area + void DrawPlayerCounts( void ) const; // draw the current player counts for each area //------------------------------------------------------------------------------------- // Auto-generation // - void BeginGeneration( bool incremental = false ); ///< initiate the generation process - void BeginAnalysis( void ); ///< re-analyze an existing Mesh. Determine Hiding Spots, Encounter Spots, etc. - - bool IsGenerating( void ) const { return m_generationMode != GENERATE_NONE; } ///< return true while a Navigation Mesh is being generated - const char *GetPlayerSpawnName( void ) const; ///< return name of player spawn entity - void SetPlayerSpawnName( const char *name ); ///< define the name of player spawn entities - void AddWalkableSeed( const Vector &pos, const Vector &normal ); ///< add given walkable position to list of seed positions for map sampling - void ClearWalkableSeeds( void ) { m_walkableSeedList.RemoveAll(); } ///< erase all walkable seed positions + #define INCREMENTAL_GENERATION true + void BeginGeneration( bool incremental = false ); // initiate the generation process + void BeginAnalysis( bool quitWhenFinished = false ); // re-analyze an existing Mesh. Determine Hiding Spots, Encounter Spots, etc. + + bool IsGenerating( void ) const { return m_generationMode != GENERATE_NONE; } // return true while a Navigation Mesh is being generated + const char *GetPlayerSpawnName( void ) const; // return name of player spawn entity + void SetPlayerSpawnName( const char *name ); // define the name of player spawn entities + void AddWalkableSeed( const Vector &pos, const Vector &normal ); // add given walkable position to list of seed positions for map sampling + virtual void AddWalkableSeeds( void ); // adds walkable positions for any/all positions a mod specifies + void ClearWalkableSeeds( void ) { m_walkableSeeds.RemoveAll(); } // erase all walkable seed positions + void MarkStairAreas( void ); //------------------------------------------------------------------------------------- // Edit mode @@ -98,60 +311,148 @@ class CNavMesh void SetNavPlace( unsigned int place ) { m_navPlace = place; } // Edit callbacks from ConCommands - void CommandNavDelete( void ); ///< delete current area - void CommandNavDeleteMarked( void ); ///< delete current marked area - void CommandNavSplit( void ); ///< split current area - void CommandNavMerge( void ); ///< merge adjacent areas - void CommandNavMark( const CCommand &args ); ///< mark an area for further operations - void CommandNavUnmark( void ); ///< removes the mark - void CommandNavBeginArea( void ); ///< begin creating a new nav area - void CommandNavEndArea( void ); ///< end creation of the new nav area - void CommandNavConnect( void ); ///< connect marked area to selected area - void CommandNavDisconnect( void ); ///< disconnect marked area from selected area - void CommandNavSplice( void ); ///< create new area in between marked and selected areas - void CommandNavCrouch( void ); ///< toggle crouch attribute on current area - void CommandNavTogglePlaceMode( void ); ///< switch between normal and place editing - void CommandNavSetPlaceMode( void ); ///< switch between normal and place editing - void CommandNavPlaceFloodFill( void ); ///< floodfill areas out from current area - void CommandNavPlacePick( void ); ///< "pick up" the place at the current area - void CommandNavTogglePlacePainting( void ); ///< switch between "painting" places onto areas - void CommandNavMarkUnnamed( void ); ///< mark an unnamed area for further operations - void CommandNavCornerSelect( void ); ///< select a corner on the current area - void CommandNavCornerRaise( void ); ///< raise a corner on the current area - void CommandNavCornerLower( void ); ///< lower a corner on the current area - void CommandNavCornerPlaceOnGround( const CCommand &args ); ///< position a corner on the current area at ground height - void CommandNavWarpToMark( void ); ///< warp a spectating local player to the selected mark - void CommandNavLadderFlip( void ); ///< Flips the direction a ladder faces - void CommandNavToggleAttribute( NavAttributeType attribute ); ///< toggle an attribute on current area - void CommandNavMakeSniperSpots( void ); ///< cuts up the marked area into individual areas suitable for sniper spots - void CommandNavBuildLadder( void ); ///< builds a nav ladder on the climbable surface under the cursor - void CommandNavRemoveUnusedJumpAreas( void ); ///< removes jump areas with at most 1 connection to a ladder or non-jump area - - // IN-PROGRESS COMMANDS FOR MANIPULATING EXISTING AREAS - void CommandNavPickArea( void ); - void CommandNavResizeHorizontal( void ); - void CommandNavResizeVertical( void ); - void CommandNavResizeEnd( void ); - - bool IsPlaceMode( void ) const { return m_navEditMode == NAV_EDIT_PLACE; } - - void GetEditVectors( Vector *pos, Vector *forward ); ///< Gets the eye position and view direction of the editing player - - CNavArea *GetMarkedArea( void ) const { return m_markedArea; } ///< return area marked by user in edit mode - CNavLadder *GetMarkedLadder( void ) const { return m_markedLadder; } ///< return ladder marked by user in edit mode - - CNavArea *GetSelectedArea( void ) const { return m_selectedArea; } ///< return area selected by user in edit mode - CNavLadder *GetSelectedLadder( void ) const { return m_selectedLadder; } ///< return ladder selected by user in edit mode - - void CreateLadder( const Vector& mins, const Vector& maxs, const Vector2D *ladderDir ); - - float SnapToGrid( float x, bool forceGrid = false ) const; ///< snap given coordinate to generation grid boundary - Vector SnapToGrid( const Vector& in, bool snapX = true, bool snapY = true, bool forceGrid = false ) const; ///< snap given vector's X & Y coordinates to generation grid boundary - - const Vector &GetEditCursorPosition( void ) const { return m_editCursorPos; } ///< return position of edit cursor - void StripNavigationAreas( void ); - const char *GetFilename( void ) const; ///< return the filename for this map's "nav" file - + void CommandNavDelete( void ); // delete current area + void CommandNavDeleteMarked( void ); // delete current marked area + + virtual void CommandNavFloodSelect( const CCommand &args ); // select current area and all connected areas, recursively + void CommandNavToggleSelectedSet( void ); // toggles all areas into/out of the selected set + void CommandNavStoreSelectedSet( void ); // stores the current selected set for later + void CommandNavRecallSelectedSet( void ); // restores an older selected set + void CommandNavAddToSelectedSet( void ); // add current area to selected set + void CommandNavAddToSelectedSetByID( const CCommand &args ); // add specified area id to selected set + void CommandNavRemoveFromSelectedSet( void ); // remove current area from selected set + void CommandNavToggleInSelectedSet( void ); // add/remove current area from selected set + void CommandNavClearSelectedSet( void ); // clear the selected set to empty + void CommandNavBeginSelecting( void ); // start continuously selecting areas into the selected set + void CommandNavEndSelecting( void ); // stop continuously selecting areas into the selected set + void CommandNavBeginDragSelecting( void ); // start dragging a selection area + void CommandNavEndDragSelecting( void ); // stop dragging a selection area + void CommandNavBeginDragDeselecting( void ); // start dragging a deselection area + void CommandNavEndDragDeselecting( void ); // stop dragging a deselection area + void CommandNavRaiseDragVolumeMax( void ); // raise the top of the drag volume + void CommandNavLowerDragVolumeMax( void ); // lower the top of the drag volume + void CommandNavRaiseDragVolumeMin( void ); // raise the bottom of the drag volume + void CommandNavLowerDragVolumeMin( void ); // lower the bottom of the drag volume + void CommandNavToggleSelecting( bool playSound = true ); // start/stop continuously selecting areas into the selected set + void CommandNavBeginDeselecting( void ); // start continuously de-selecting areas from the selected set + void CommandNavEndDeselecting( void ); // stop continuously de-selecting areas from the selected set + void CommandNavToggleDeselecting( bool playSound = true ); // start/stop continuously de-selecting areas from the selected set + void CommandNavSelectInvalidAreas( void ); // adds invalid areas to the selected set + void CommandNavSelectBlockedAreas( void ); // adds blocked areas to the selected set + void CommandNavSelectObstructedAreas( void ); // adds obstructed areas to the selected set + void CommandNavSelectDamagingAreas( void ); // adds damaging areas to the selected set + void CommandNavSelectHalfSpace( const CCommand &args ); // selects all areas that intersect the half-space + void CommandNavSelectStairs( void ); // adds stairs areas to the selected set + + void CommandNavSplit( void ); // split current area + void CommandNavMerge( void ); // merge adjacent areas + void CommandNavMark( const CCommand &args ); // mark an area for further operations + void CommandNavUnmark( void ); // removes the mark + + void CommandNavBeginArea( void ); // begin creating a new nav area + void CommandNavEndArea( void ); // end creation of the new nav area + + void CommandNavBeginShiftXY( void ); // begin shifting selected set in the XY plane + void CommandNavEndShiftXY( void ); // end shifting selected set in the XY plane + + void CommandNavConnect( void ); // connect marked area to selected area + void CommandNavDisconnect( void ); // disconnect marked area from selected area + void CommandNavSplice( void ); // create new area in between marked and selected areas + void CommandNavCrouch( void ); // toggle crouch attribute on current area + void CommandNavTogglePlaceMode( void ); // switch between normal and place editing + void CommandNavSetPlaceMode( void ); // switch between normal and place editing + void CommandNavPlaceFloodFill( void ); // floodfill areas out from current area + void CommandNavPlaceSet( void ); // sets the Place for the selected set + void CommandNavPlacePick( void ); // "pick up" the place at the current area + void CommandNavTogglePlacePainting( void ); // switch between "painting" places onto areas + void CommandNavMarkUnnamed( void ); // mark an unnamed area for further operations + void CommandNavCornerSelect( void ); // select a corner on the current area + void CommandNavCornerRaise( const CCommand &args ); // raise a corner on the current area + void CommandNavCornerLower( const CCommand &args ); // lower a corner on the current area + void CommandNavCornerPlaceOnGround( const CCommand &args ); // position a corner on the current area at ground height + void CommandNavWarpToMark( void ); // warp a spectating local player to the selected mark + void CommandNavLadderFlip( void ); // Flips the direction a ladder faces + void CommandNavToggleAttribute( NavAttributeType attribute ); // toggle an attribute on current area + void CommandNavMakeSniperSpots( void ); // cuts up the marked area into individual areas suitable for sniper spots + void CommandNavBuildLadder( void ); // builds a nav ladder on the climbable surface under the cursor + void CommandNavRemoveJumpAreas( void ); // removes jump areas, replacing them with connections + void CommandNavSubdivide( const CCommand &args ); // subdivide each nav area in X and Y to create 4 new areas - limit min size + void CommandNavSaveSelected( const CCommand &args ); // Save selected set to disk + void CommandNavMergeMesh( const CCommand &args ); // Merge a saved selected set into the current mesh + void CommandNavMarkWalkable( void ); + + void AddToDragSelectionSet( CNavArea *pArea ); + void RemoveFromDragSelectionSet( CNavArea *pArea ); + void ClearDragSelectionSet( void ); + + CNavArea *GetMarkedArea( void ) const; // return area marked by user in edit mode + CNavLadder *GetMarkedLadder( void ) const { return m_markedLadder; } // return ladder marked by user in edit mode + + CNavArea *GetSelectedArea( void ) const { return m_selectedArea; } // return area user is pointing at in edit mode + CNavLadder *GetSelectedLadder( void ) const { return m_selectedLadder; } // return ladder user is pointing at in edit mode + void SetMarkedLadder( CNavLadder *ladder ); // mark ladder for further edit operations + void SetMarkedArea( CNavArea *area ); // mark area for further edit operations + + bool IsContinuouslySelecting( void ) const + { + return m_isContinuouslySelecting; + } + + bool IsContinuouslyDeselecting( void ) const + { + return m_isContinuouslyDeselecting; + } + + void CreateLadder( const Vector &mins, const Vector &maxs, float maxHeightAboveTopArea ); + void CreateLadder( const Vector &top, const Vector &bottom, float width, const Vector2D &ladderDir, float maxHeightAboveTopArea ); + + float SnapToGrid( float x, bool forceGrid = false ) const; // snap given coordinate to generation grid boundary + Vector SnapToGrid( const Vector& in, bool snapX = true, bool snapY = true, bool forceGrid = false ) const; // snap given vector's X & Y coordinates to generation grid boundary + + const Vector &GetEditCursorPosition( void ) const { return m_editCursorPos; } // return position of edit cursor + virtual void StripNavigationAreas( void ); + const char *GetFilename( void ) const; // return the filename for this map's "nav" file + + /// @todo Remove old select code and make all commands use this selected set + void AddToSelectedSet( CNavArea *area ); // add area to the currently selected set + void RemoveFromSelectedSet( CNavArea *area ); // remove area from the currently selected set + void ClearSelectedSet( void ); // clear the currently selected set to empty + bool IsSelectedSetEmpty( void ) const; // return true if the selected set is empty + bool IsInSelectedSet( const CNavArea *area ) const; // return true if the given area is in the selected set + int GetSelecteSetSize( void ) const; + const NavAreaVector &GetSelectedSet( void ) const; // return the selected set + + /** + * Apply the functor to all navigation areas in the Selected Set, + * or the current selected area. + * If functor returns false, stop processing and return false. + */ + template < typename Functor > + bool ForAllSelectedAreas( Functor &func ) + { + if (IsSelectedSetEmpty()) + { + CNavArea *area = GetSelectedArea(); + + if (area) + { + if (func( area ) == false) + return false; + } + } + else + { + FOR_EACH_VEC( m_selectedSet, it ) + { + CNavArea *area = m_selectedSet[ it ]; + + if (func( area ) == false) + return false; + } + } + + return true; + } //------------------------------------------------------------------------------------- /** @@ -161,9 +462,24 @@ class CNavMesh template < typename Functor > bool ForAllAreas( Functor &func ) { - FOR_EACH_LL( TheNavAreaList, it ) + FOR_EACH_VEC( TheNavAreas, it ) + { + CNavArea *area = TheNavAreas[ it ]; + + if (func( area ) == false) + return false; + } + + return true; + } + + // const version of the above + template < typename Functor > + bool ForAllAreas( Functor &func ) const + { + FOR_EACH_VEC( TheNavAreas, it ) { - CNavArea *area = TheNavAreaList[ it ]; + const CNavArea *area = TheNavAreas[ it ]; if (func( area ) == false) return false; @@ -172,166 +488,469 @@ class CNavMesh return true; } - NavLadderList& GetLadders( void ) { return m_ladderList; } ///< Returns the list of ladders + //------------------------------------------------------------------------------------- + /** + * Apply the functor to all navigation areas that overlap the given extent. + * If functor returns false, stop processing and return false. + */ + template < typename Functor > + bool ForAllAreasOverlappingExtent( Functor &func, const Extent &extent ) + { + VPROF_BUDGET( "CNavMesh::ForAllAreasOverlappingExtent", "NextBot" ); + + if ( !m_grid.Count() ) + { +#if _DEBUG + Warning("Query before nav mesh is loaded! %d\n", TheNavAreas.Count() ); +#endif + return true; + } + static unsigned int searchMarker = RandomInt(0, 1024*1024 ); + if ( ++searchMarker == 0 ) + { + ++searchMarker; + } + + Extent areaExtent; + + // get list in cell that contains position + int startX = WorldToGridX( extent.lo.x ); + int endX = WorldToGridX( extent.hi.x ); + int startY = WorldToGridY( extent.lo.y ); + int endY = WorldToGridY( extent.hi.y ); + + for( int x = startX; x <= endX; ++x ) + { + for( int y = startY; y <= endY; ++y ) + { + int iGrid = x + y*m_gridSizeX; + if ( iGrid >= m_grid.Count() ) + { + ExecuteNTimes( 10, Warning( "** Walked off of the CNavMesh::m_grid in ForAllAreasOverlappingExtent()\n" ) ); + return true; + } + + NavAreaVector *areaVector = &m_grid[ iGrid ]; + + // find closest area in this cell + FOR_EACH_VEC( (*areaVector), it ) + { + CNavArea *area = (*areaVector)[ it ]; + + // skip if we've already visited this area + if ( area->m_nearNavSearchMarker == searchMarker ) + continue; + + // mark as visited + area->m_nearNavSearchMarker = searchMarker; + area->GetExtent( &areaExtent ); + + if ( extent.IsOverlapping( areaExtent ) ) + { + if ( func( area ) == false ) + return false; + } + } + } + } + return true; + } + + template < typename Functor > + bool ForAllAreasInRadius( Functor &func, const Vector &pos, float radius ) + { + // use a unique marker for this method, so it can be used within a SearchSurroundingArea() call + static unsigned int searchMarker = RandomInt(0, 1024*1024 ); + + ++searchMarker; + + if ( searchMarker == 0 ) + { + ++searchMarker; + } + + + // get list in cell that contains position + int originX = WorldToGridX( pos.x ); + int originY = WorldToGridY( pos.y ); + int shiftLimit = ceil( radius / m_gridCellSize ); + float radiusSq = radius * radius; + if ( radius == 0.0f ) + { + shiftLimit = MAX( m_gridSizeX, m_gridSizeY ); // range 0 means all areas + } + + for( int x = originX - shiftLimit; x <= originX + shiftLimit; ++x ) + { + if ( x < 0 || x >= m_gridSizeX ) + continue; + + for( int y = originY - shiftLimit; y <= originY + shiftLimit; ++y ) + { + if ( y < 0 || y >= m_gridSizeY ) + continue; + + NavAreaVector *areaVector = &m_grid[ x + y*m_gridSizeX ]; + + // find closest area in this cell + FOR_EACH_VEC( (*areaVector), it ) + { + CNavArea *area = (*areaVector)[ it ]; + + // skip if we've already visited this area + if ( area->m_nearNavSearchMarker == searchMarker ) + continue; + + // mark as visited + area->m_nearNavSearchMarker = searchMarker; + + float distSq = ( area->GetCenter() - pos ).LengthSqr(); + + if ( ( distSq <= radiusSq ) || ( radiusSq == 0 ) ) + { + if ( func( area ) == false ) + return false; + } + } + } + } + return true; + } + + //------------------------------------------------------------------------------------- + /** + * Apply the functor to all navigation ladders. + * If functor returns false, stop processing and return false. + */ + template < typename Functor > + bool ForAllLadders( Functor &func ) + { + for ( int i=0; i + bool ForAllLadders( Functor &func ) const + { + for ( int i=0; i void StitchAreaIntoMesh( CNavArea *area, NavDirType dir, Functor &func ); + + //------------------------------------------------------------------------------------- + /** + * Use the functor to test if an area is needing stitching into the existing nav mesh. + * The functor is different from how we normally use functors - it does no processing, + * and it's return value is true if the area is in the new set to be stiched, and false + * if it's a pre-existing area. + */ + template < typename Functor > + bool StitchMesh( Functor &func ) + { + FOR_EACH_VEC( TheNavAreas, it ) + { + CNavArea *area = TheNavAreas[ it ]; + + if ( func( area ) ) + { + StitchAreaIntoMesh( area, NORTH, func ); + StitchAreaIntoMesh( area, SOUTH, func ); + StitchAreaIntoMesh( area, EAST, func ); + StitchAreaIntoMesh( area, WEST, func ); + } + } + + return true; + } + + NavLadderVector& GetLadders( void ) { return m_ladders; } // Returns the list of ladders CNavLadder *GetLadderByID( unsigned int id ) const; CUtlVector< CNavArea * >& GetTransientAreas( void ) { return m_transientAreas; } + enum EditModeType + { + NORMAL, // normal mesh editing + PLACE_PAINTING, // in place painting mode + CREATING_AREA, // creating a new nav area + CREATING_LADDER, // creating a nav ladder + DRAG_SELECTING, // drag selecting a set of areas + SHIFTING_XY, // shifting selected set in XY plane + SHIFTING_Z, // shifting selected set in Z plane + }; + EditModeType GetEditMode( void ) const; // return the current edit mode + void SetEditMode( EditModeType mode ); // change the edit mode + bool IsEditMode( EditModeType mode ) const; // return true if current mode matches given mode + + bool FindNavAreaOrLadderAlongRay( const Vector &start, const Vector &end, CNavArea **area, CNavLadder **ladder, CNavArea *ignore = NULL ); + + void PostProcessCliffAreas(); + void SimplifySelectedAreas( void ); // Simplifies the selected set by reducing to 1x1 areas and re-merging them up with loosened tolerances + +protected: + virtual void PostCustomAnalysis( void ) { } // invoked when custom analysis step is complete + bool FindActiveNavArea( void ); // Finds the area or ladder the local player is currently pointing at. Returns true if a surface was hit by the traceline. + virtual void RemoveNavArea( CNavArea *area ); // remove an area from the grid + bool FindGroundForNode( Vector *pos, Vector *normal ); + void GenerateNodes( const Extent &bounds ); + void RemoveNodes( void ); + private: friend class CNavArea; friend class CNavNode; + friend class CNavUIBasePanel; - NavAreaList *m_grid; - float m_gridCellSize; ///< the width/height of a grid cell for spatially partitioning nav areas for fast access + mutable CUtlVector m_grid; + float m_gridCellSize; // the width/height of a grid cell for spatially partitioning nav areas for fast access int m_gridSizeX; int m_gridSizeY; float m_minX; float m_minY; - unsigned int m_areaCount; ///< total number of nav areas + unsigned int m_areaCount; // total number of nav areas - bool m_isLoaded; ///< true if a Navigation Mesh has been loaded - bool m_isFromCurrentMap; ///< true if the Navigation Mesh was last saved with the current map + bool m_isLoaded; // true if a Navigation Mesh has been loaded + bool m_isOutOfDate; // true if the Navigation Mesh is older than the actual BSP + bool m_isAnalyzed; // true if the Navigation Mesh needs analysis enum { HASH_TABLE_SIZE = 256 }; - CNavArea *m_hashTable[ HASH_TABLE_SIZE ]; ///< hash table to optimize lookup by ID - int ComputeHashKey( unsigned int id ) const; ///< returns a hash key for the given nav area ID + CNavArea *m_hashTable[ HASH_TABLE_SIZE ]; // hash table to optimize lookup by ID + int ComputeHashKey( unsigned int id ) const; // returns a hash key for the given nav area ID - int WorldToGridX( float wx ) const; ///< given X component, return grid index - int WorldToGridY( float wy ) const; ///< given Y component, return grid index - void AllocateGrid( float minX, float maxX, float minY, float maxY ); ///< clear and reset the grid to the given extents + int WorldToGridX( float wx ) const; // given X component, return grid index + int WorldToGridY( float wy ) const; // given Y component, return grid index + void AllocateGrid( float minX, float maxX, float minY, float maxY ); // clear and reset the grid to the given extents void GridToWorld( int gridX, int gridY, Vector *pos ) const; - void AddNavArea( CNavArea *area ); ///< add an area to the grid - void RemoveNavArea( CNavArea *area ); ///< remove an area from the grid + void AddNavArea( CNavArea *area ); // add an area to the grid - void DestroyNavigationMesh( bool incremental = false ); ///< free all resources of the mesh and reset it to empty state + void DestroyNavigationMesh( bool incremental = false ); // free all resources of the mesh and reset it to empty state void DestroyHidingSpots( void ); - void ComputeBattlefrontAreas( void ); ///< determine areas where rushing teams will first meet + void ComputeBattlefrontAreas( void ); // determine areas where rushing teams will first meet //---------------------------------------------------------------------------------- // Place directory // - char **m_placeName; ///< master directory of place names (ie: "places") - unsigned int m_placeCount; ///< number of "places" defined in placeName[] - void LoadPlaceDatabase( void ); ///< load the place names from a file + char **m_placeName; // master directory of place names (ie: "places") + unsigned int m_placeCount; // number of "places" defined in placeName[] + void LoadPlaceDatabase( void ); // load the place names from a file //---------------------------------------------------------------------------------- // Edit mode // - unsigned int m_navPlace; ///< current navigation place for editing - void OnEditModeStart( void ); ///< called when edit mode has just been enabled - void DrawEditMode( void ); ///< draw navigation areas - void OnEditModeEnd( void ); ///< called when edit mode has just been disabled - bool m_isEditing; ///< true if in edit mode - Vector m_editCursorPos; ///< current position of the cursor - CNavArea *m_markedArea; ///< currently marked area for edit operations - CNavArea *m_selectedArea; ///< area that is selected this frame - CNavArea *m_lastSelectedArea; ///< area that was selected last frame - NavCornerType m_markedCorner; ///< currently marked corner for edit operations - Vector m_anchor; ///< first corner of an area being created - bool m_isPlacePainting; ///< if true, we set an area's place by pointing at it - bool m_splitAlongX; ///< direction the selected nav area would be split - float m_splitEdge; ///< location of the possible split - - enum NavEditMode { - NAV_EDIT_NORMAL = 0, - NAV_EDIT_CREATE, ///< manually creating a new nav area - NAV_EDIT_RESIZE_HORIZONTAL, - NAV_EDIT_RESIZE_VERTICAL, - NAV_EDIT_PLACE ///< place-editing mode - }; - NavEditMode m_navEditMode; - - bool m_climbableSurface; ///< if true, the cursor is pointing at a climable surface - Vector m_surfaceNormal; ///< Normal of the surface the cursor is pointing at - Vector m_ladderAnchor; ///< first corner of a ladder being created - Vector m_ladderNormal; ///< Normal of the surface of the ladder being created - bool m_isCreatingLadder; ///< if true, we are manually creating a ladder - CNavLadder *m_selectedLadder; ///< ladder that is selected this frame - CNavLadder *m_lastSelectedLadder; ///< ladder that was selected last frame - CNavLadder *m_markedLadder; ///< currently marked ladder for edit operations + EditModeType m_editMode; // the current edit mode + bool m_isEditing; // true if in edit mode + + unsigned int m_navPlace; // current navigation place for editing + void OnEditModeStart( void ); // called when edit mode has just been enabled + void DrawEditMode( void ); // draw navigation areas + void OnEditModeEnd( void ); // called when edit mode has just been disabled + void UpdateDragSelectionSet( void ); // update which areas are overlapping the drag selected bounds + Vector m_editCursorPos; // current position of the cursor + CNavArea *m_markedArea; // currently marked area for edit operations + CNavArea *m_selectedArea; // area that is selected this frame + CNavArea *m_lastSelectedArea; // area that was selected last frame + NavCornerType m_markedCorner; // currently marked corner for edit operations + Vector m_anchor; // first corner of an area being created + bool m_isPlacePainting; // if true, we set an area's place by pointing at it + bool m_splitAlongX; // direction the selected nav area would be split + float m_splitEdge; // location of the possible split + + bool m_climbableSurface; // if true, the cursor is pointing at a climable surface + Vector m_surfaceNormal; // Normal of the surface the cursor is pointing at + Vector m_ladderAnchor; // first corner of a ladder being created + Vector m_ladderNormal; // Normal of the surface of the ladder being created + CNavLadder *m_selectedLadder; // ladder that is selected this frame + CNavLadder *m_lastSelectedLadder; // ladder that was selected last frame + CNavLadder *m_markedLadder; // currently marked ladder for edit operations + + bool FindLadderCorners( Vector *c1, Vector *c2, Vector *c3 ); // computes the other corners of a ladder given m_ladderAnchor, m_editCursorPos, and m_ladderNormal + + void GetEditVectors( Vector *pos, Vector *forward ); // Gets the eye position and view direction of the editing player + + CountdownTimer m_showAreaInfoTimer; // Timer that controls how long area info is displayed + + NavAreaVector m_selectedSet; // all currently selected areas + NavAreaVector m_dragSelectionSet; // all areas in the current drag selection + bool m_isContinuouslySelecting; // if true, we are continuously adding to the selected set + bool m_isContinuouslyDeselecting; // if true, we are continuously removing from the selected set - bool GetActiveNavArea( void ); ///< Finds the area or ladder the local player is currently pointing at. Returns true if a surface was hit by the traceline. + bool m_bIsDragDeselecting; + int m_nDragSelectionVolumeZMax; + int m_nDragSelectionVolumeZMin; - void SetEditMode( bool isPlaceMode ); ///< sets/clears place mode - void SetPlacePaintingMode( bool painting ); ///< Sets place-painting, if we're in place mode - void SetMarkedLadder( CNavLadder *ladder ); ///< mark ladder for further edit operations - void SetMarkedArea( CNavArea *area ); ///< mark area for further edit operations + void DoToggleAttribute( CNavArea *area, NavAttributeType attribute ); // toggle an attribute on given area - CountdownTimer m_showAreaInfoTimer; ///< Timer that controls how long area info is displayed //---------------------------------------------------------------------------------- // Auto-generation // - bool UpdateGeneration( float maxTime = 0.25f ); ///< process the auto-generation for 'maxTime' seconds. return false if generation is complete. + bool UpdateGeneration( float maxTime = 0.25f ); // process the auto-generation for 'maxTime' seconds. return false if generation is complete. - CNavNode *m_currentNode; ///< the current node we are sampling from + virtual void BeginCustomAnalysis( bool bIncremental ) {} + virtual void EndCustomAnalysis() {} + + CNavNode *m_currentNode; // the current node we are sampling from NavDirType m_generationDir; - CNavNode *AddNode( const Vector &destPos, const Vector &destNormal, NavDirType dir, CNavNode *source ); ///< add a nav node and connect it, update current node + CNavNode *AddNode( const Vector &destPos, const Vector &destNormal, NavDirType dir, CNavNode *source, bool isOnDisplacement, float obstacleHeight, float flObstacleStartDist, float flObstacleEndDist ); // add a nav node and connect it, update current node - NavLadderList m_ladderList; ///< list of ladder navigation representations + NavLadderVector m_ladders; // list of ladder navigation representations void BuildLadders( void ); void DestroyLadders( void ); - bool SampleStep( void ); ///< sample the walkable areas of the map - void CreateNavAreasFromNodes( void ); ///< cover all of the sampled nodes with nav areas + bool SampleStep( void ); // sample the walkable areas of the map + void CreateNavAreasFromNodes( void ); // cover all of the sampled nodes with nav areas - bool TestArea( CNavNode *node, int width, int height ); ///< check if an area of size (width, height) can fit, starting from node as upper left corner - int BuildArea( CNavNode *node, int width, int height ); ///< create a CNavArea of size (width, height) starting fom node at upper left corner + bool TestArea( CNavNode *node, int width, int height ); // check if an area of size (width, height) can fit, starting from node as upper left corner + int BuildArea( CNavNode *node, int width, int height ); // create a CNavArea of size (width, height) starting fom node at upper left corner + bool CheckObstacles( CNavNode *node, int width, int height, int x, int y ); - void RemoveUnusedJumpAreas( void ); + void MarkPlayerClipAreas( void ); void MarkJumpAreas( void ); + void StichAndRemoveJumpAreas( void ); + void RemoveJumpAreas( void ); void SquareUpAreas( void ); void MergeGeneratedAreas( void ); void ConnectGeneratedAreas( void ); + void FixUpGeneratedAreas( void ); + void FixCornerOnCornerAreas( void ); + void FixConnections( void ); + void SplitAreasUnderOverhangs( void ); + void ValidateNavAreaConnections( void ); + void StitchGeneratedAreas( void ); // Stitches incrementally-generated areas into the existing mesh + void StitchAreaSet( CUtlVector< CNavArea * > *areas ); // Stitches an arbitrary set of areas into the existing mesh + void HandleObstacleTopAreas( void ); // Handles fixing/generating areas on top of slim obstacles such as fences and railings + void RaiseAreasWithInternalObstacles(); + void CreateObstacleTopAreas(); + bool CreateObstacleTopAreaIfNecessary( CNavArea *area, CNavArea *areaOther, NavDirType dir, bool bMultiNode ); + void RemoveOverlappingObstacleTopAreas(); + enum GenerationStateType { SAMPLE_WALKABLE_SPACE, CREATE_AREAS_FROM_SAMPLES, FIND_HIDING_SPOTS, - FIND_APPROACH_AREAS, FIND_ENCOUNTER_SPOTS, FIND_SNIPER_SPOTS, FIND_EARLIEST_OCCUPY_TIMES, + FIND_LIGHT_INTENSITY, + COMPUTE_MESH_VISIBILITY, + CUSTOM, // mod-specific generation step SAVE_NAV_MESH, NUM_GENERATION_STATES } - m_generationState; ///< the state of the generation process + m_generationState; // the state of the generation process enum GenerationModeType { GENERATE_NONE, GENERATE_FULL, GENERATE_INCREMENTAL, + GENERATE_SIMPLIFY, GENERATE_ANALYSIS_ONLY, } - m_generationMode; ///< true while a Navigation Mesh is being generated - int m_generationIndex; ///< used for iterating nav areas during generation process - int m_sampleTick; ///< counter for displaying pseudo-progress while sampling walkable space + m_generationMode; // true while a Navigation Mesh is being generated + int m_generationIndex; // used for iterating nav areas during generation process + int m_sampleTick; // counter for displaying pseudo-progress while sampling walkable space + bool m_bQuitWhenFinished; + float m_generationStartTime; + Extent m_simplifyGenerationExtent; - char *m_spawnName; ///< name of player spawn entity, used to initiate sampling + char *m_spawnName; // name of player spawn entity, used to initiate sampling struct WalkableSeedSpot { Vector pos; Vector normal; }; - CUtlLinkedList< WalkableSeedSpot, int > m_walkableSeedList; ///< list of walkable seed spots for sampling + CUtlVector< WalkableSeedSpot > m_walkableSeeds; // list of walkable seed spots for sampling - CNavNode *GetNextWalkableSeedNode( void ); ///< return the next walkable seed as a node + CNavNode *GetNextWalkableSeedNode( void ); // return the next walkable seed as a node int m_seedIdx; + int m_hostThreadModeRestoreValue; // stores the value of host_threadmode before we changed it void BuildTransientAreaList( void ); CUtlVector< CNavArea * > m_transientAreas; + + void UpdateAvoidanceObstacleAreas( void ); + CUtlVector< CNavArea * > m_avoidanceObstacleAreas; + CUtlVector< INavAvoidanceObstacle * > m_avoidanceObstacles; + + void UpdateBlockedAreas( void ); + CUtlVector< CNavArea * > m_blockedAreas; + + CUtlVector< int > m_storedSelectedSet; // "Stored" selected set, so we can do some editing and then restore the old selected set. Done by ID, so we don't have to worry about split/delete/etc. + + void BeginVisibilityComputations( void ); + void EndVisibilityComputations( void ); }; // the global singleton interface extern CNavMesh *TheNavMesh; +// factory for creating the Navigation Mesh +extern CNavMesh *NavMeshFactory( void ); + +// for debugging the A* algorithm, if nonzero, show debug display and decrement for each pathfind +extern int g_DebugPathfindCounter; +//-------------------------------------------------------------------------------------------------------------- +inline bool CNavMesh::IsEditMode( EditModeType mode ) const +{ + return m_editMode == mode; +} + +//-------------------------------------------------------------------------------------------------------------- +inline CNavMesh::EditModeType CNavMesh::GetEditMode( void ) const +{ + return m_editMode; +} + +//-------------------------------------------------------------------------------------------------------------- +inline unsigned int CNavMesh::GetSubVersionNumber( void ) const +{ + return 0; +} + + +//-------------------------------------------------------------------------------------------------------------- +inline CNavArea *CNavMesh::CreateArea( void ) const +{ + return new CNavArea; +} + +//-------------------------------------------------------------------------------------------------------------- +inline void CNavMesh::DestroyArea( CNavArea *pArea ) const +{ + delete pArea; +} + //-------------------------------------------------------------------------------------------------------------- inline int CNavMesh::ComputeHashKey( unsigned int id ) const { @@ -365,6 +984,13 @@ inline int CNavMesh::WorldToGridY( float wy ) const } +//-------------------------------------------------------------------------------------------------------------- +inline unsigned int CNavMesh::GetGenerationTraceMask( void ) const +{ + return MASK_NPCSOLID_BRUSHONLY; +} + + //-------------------------------------------------------------------------------------------------------------- // // Function prototypes @@ -372,5 +998,6 @@ inline int CNavMesh::WorldToGridY( float wy ) const extern void ApproachAreaAnalysisPrep( void ); extern void CleanupApproachAreaAnalysisPrep( void ); +extern bool IsHeightDifferenceValid( float test, float other1, float other2, float other3 ); #endif // _NAV_MESH_H_ diff --git a/game/server/nav_node.h b/game/server/nav_node.h index a56ef76f5..744f711b8 100644 --- a/game/server/nav_node.h +++ b/game/server/nav_node.h @@ -16,11 +16,7 @@ // If DEBUG_NAV_NODES is true, nav_show_nodes controls drawing node positions, and // nav_show_node_id allows you to show the IDs of nodes that didn't get used to create areas. -#ifdef _DEBUG #define DEBUG_NAV_NODES 1 -#else -#define DEBUG_NAV_NODES 0 -#endif //-------------------------------------------------------------------------------------------------------------- /** @@ -31,9 +27,11 @@ class CNavNode { public: - CNavNode( const Vector &pos, const Vector &normal, CNavNode *parent = NULL ); + CNavNode( const Vector &pos, const Vector &normal, CNavNode *parent, bool onDisplacement ); + ~CNavNode(); static CNavNode *GetNode( const Vector &pos ); ///< return navigation node at the position, or NULL if none exists + static void CleanupGeneration(); CNavNode *GetConnectedNode( NavDirType dir ) const; ///< get navigation node connected in given direction, or NULL if cant go that way const Vector *GetPosition( void ) const; @@ -46,7 +44,7 @@ class CNavNode void Draw( void ); - void ConnectTo( CNavNode *node, NavDirType dir ); ///< create a connection FROM this node TO the given node, in the given direction + void ConnectTo( CNavNode *node, NavDirType dir, float obstacleHeight, float flObstacleStartDist, float flObstacleEndDist ); ///< create a connection FROM this node TO the given node, in the given direction CNavNode *GetParent( void ) const; void MarkAsVisited( NavDirType dir ); ///< mark the given direction as having been visited @@ -60,24 +58,34 @@ class CNavNode void AssignArea( CNavArea *area ); ///< assign the given area to this node CNavArea *GetArea( void ) const; ///< return associated area - void SetAttributes( unsigned char bits ) { m_attributeFlags = bits; } - unsigned char GetAttributes( void ) const { return m_attributeFlags; } + void SetAttributes( int bits ) { m_attributeFlags = bits; } + int GetAttributes( void ) const { return m_attributeFlags; } + float GetGroundHeightAboveNode( NavCornerType cornerType ) const; ///< return ground height above node in given corner direction (NUM_CORNERS for highest in any direction) + bool IsBlockedInAnyDirection( void) const; ///< return true if the node is blocked in any direction + + bool IsOnDisplacement( void ) const { return m_isOnDisplacement; } private: + CNavNode() {} // constructor used only for hash lookup friend class CNavMesh; + bool TestForCrouchArea( NavCornerType cornerNum, const Vector& mins, const Vector& maxs, float *groundHeightAboveNode ); void CheckCrouch( void ); Vector m_pos; ///< position of this node in the world Vector m_normal; ///< surface normal at this location CNavNode *m_to[ NUM_DIRECTIONS ]; ///< links to north, south, east, and west. NULL if no link + float m_obstacleHeight[ NUM_DIRECTIONS ]; ///< obstacle height (delta from nav node z position) that must be climbed to reach next node in this direction + float m_obstacleStartDist[ NUM_DIRECTIONS ]; ///< distance along this direction to reach the beginning of the obstacle + float m_obstacleEndDist[ NUM_DIRECTIONS ]; ///< distance along this direction to reach the end of the obstacle unsigned int m_id; ///< unique ID of this node - unsigned char m_attributeFlags; ///< set of attribute bit flags (see NavAttributeType) + int m_attributeFlags; ///< set of attribute bit flags (see NavAttributeType) static CNavNode *m_list; ///< the master list of all nodes for this map static unsigned int m_listLength; static unsigned int m_nextID; CNavNode *m_next; ///< next link in master list + CNavNode *m_nextAtXY; ///< next link at a particular position // below are only needed when generating unsigned char m_visited; ///< flags for automatic node generation. If direction bit is clear, that direction hasn't been explored yet. @@ -85,7 +93,10 @@ class CNavNode bool m_isCovered; ///< true when this node is "covered" by a CNavArea CNavArea *m_area; ///< the area this node is contained within + bool m_isBlocked[ NUM_CORNERS ]; bool m_crouch[ NUM_CORNERS ]; + float m_groundHeightAboveNode[ NUM_CORNERS ]; + bool m_isOnDisplacement; }; //-------------------------------------------------------------------------------------------------------------- @@ -131,5 +142,10 @@ inline CNavArea *CNavNode::GetArea( void ) const return m_area; } +inline bool CNavNode::IsBlockedInAnyDirection( void ) const +{ + return m_isBlocked[ SOUTH_EAST ] || m_isBlocked[ SOUTH_WEST ] || m_isBlocked[ NORTH_EAST ] || m_isBlocked[ NORTH_WEST ]; +} + #endif // _NAV_NODE_H_ diff --git a/game/server/nav_pathfind.h b/game/server/nav_pathfind.h index df9a18f25..32e77667c 100644 --- a/game/server/nav_pathfind.h +++ b/game/server/nav_pathfind.h @@ -12,14 +12,23 @@ #ifndef _NAV_PATHFIND_H_ #define _NAV_PATHFIND_H_ +#include "tier0/vprof.h" +#include "mathlib/ssemath.h" +#include "nav_area.h" + +extern int g_DebugPathfindCounter; + + //------------------------------------------------------------------------------------------------------------------- /** * Used when building a path to determine the kind of path to build */ enum RouteType { + DEFAULT_ROUTE, FASTEST_ROUTE, SAFEST_ROUTE, + RETREAT_ROUTE, }; @@ -30,34 +39,42 @@ enum RouteType class ShortestPathCost { public: - float operator() ( CNavArea *area, CNavArea *fromArea, const CNavLadder *ladder ) + float operator() ( CNavArea *area, CNavArea *fromArea, const CNavLadder *ladder, const CFuncElevator *elevator, float length ) { - if (fromArea == NULL) + if ( fromArea == NULL ) { // first area in path, no cost return 0.0f; } else { - // compute distance travelled along path so far + // compute distance traveled along path so far float dist; - if (ladder) + if ( ladder ) + { dist = ladder->m_length; + } + else if ( length > 0.0 ) + { + dist = length; + } else - dist = (area->GetCenter() - fromArea->GetCenter()).Length(); + { + dist = ( area->GetCenter() - fromArea->GetCenter() ).Length(); + } float cost = dist + fromArea->GetCostSoFar(); // if this is a "crouch" area, add penalty - if (area->GetAttributes() & NAV_MESH_CROUCH) + if ( area->GetAttributes() & NAV_MESH_CROUCH ) { const float crouchPenalty = 20.0f; // 10 cost += crouchPenalty * dist; } // if this is a "jump" area, add penalty - if (area->GetAttributes() & NAV_MESH_JUMP) + if ( area->GetAttributes() & NAV_MESH_JUMP ) { const float jumpPenalty = 5.0f; cost += jumpPenalty * dist; @@ -77,15 +94,26 @@ class ShortestPathCost * If 'closestArea' is non-NULL, the closest area to the goal is returned (useful if the path fails). * If 'goalArea' is NULL, will compute a path as close as possible to 'goalPos'. * If 'goalPos' is NULL, will use the center of 'goalArea' as the goal position. + * If 'maxPathLength' is nonzero, path building will stop when this length is reached. * Returns true if a path exists. */ +#define IGNORE_NAV_BLOCKERS true template< typename CostFunctor > -bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, CostFunctor &costFunc, CNavArea **closestArea = NULL ) +bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *startPos, const Vector *goalPos, CostFunctor &costFunc, CNavArea **closestArea = NULL, float maxPathLength = 0.0f, int teamID = TEAM_ANY, bool ignoreNavBlockers = false ) { + VPROF_BUDGET( "NavAreaBuildPath", "NextBotSpiky" ); + + if ( closestArea ) + { + *closestArea = startArea; + } + + bool isDebug = ( g_DebugPathfindCounter-- > 0 ); + if (startArea == NULL) return false; - if (goalArea != NULL && goalArea->IsBlocked()) + if (goalArea != NULL && goalArea->IsBlocked( teamID, ignoreNavBlockers )) goalArea = NULL; if (goalArea == NULL && goalPos == NULL) @@ -110,10 +138,11 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go /// @todo Cost might work as "manhattan distance" startArea->SetTotalCost( (startArea->GetCenter() - actualGoalPos).Length() ); - float initCost = costFunc( startArea, NULL, NULL ); + float initCost = costFunc( startArea, NULL, NULL, NULL, -1.0f ); if (initCost < 0.0f) return false; startArea->SetCostSoFar( initCost ); + startArea->SetPathLengthSoFar( 0.0 ); startArea->AddToOpenList(); @@ -128,8 +157,13 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go // get next area to check CNavArea *area = CNavArea::PopOpenList(); + if ( isDebug ) + { + area->DrawFilled( 0, 255, 0, 128, 30.0f ); + } + // don't consider blocked areas - if ( area->IsBlocked() ) + if ( area->IsBlocked( teamID, ignoreNavBlockers ) ) continue; // check if we have found the goal area or position @@ -144,89 +178,111 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go } // search adjacent areas - bool searchFloor = true; + enum SearchType + { + SEARCH_FLOOR, SEARCH_LADDERS, SEARCH_ELEVATORS + }; + SearchType searchWhere = SEARCH_FLOOR; + int searchIndex = 0; + int dir = NORTH; - const NavConnectList *floorList = area->GetAdjacentList( NORTH ); - int floorIter = floorList->Head(); + const NavConnectVector *floorList = area->GetAdjacentAreas( NORTH ); bool ladderUp = true; - const NavLadderConnectList *ladderList = NULL; - int ladderIter = NavLadderConnectList::InvalidIndex(); + const NavLadderConnectVector *ladderList = NULL; enum { AHEAD = 0, LEFT, RIGHT, BEHIND, NUM_TOP_DIRECTIONS }; int ladderTopDir = AHEAD; - - while(true) + bool bHaveMaxPathLength = ( maxPathLength > 0.0f ); + float length = -1; + + while( true ) { - CNavArea *newArea; + CNavArea *newArea = NULL; NavTraverseType how; const CNavLadder *ladder = NULL; + const CFuncElevator *elevator = NULL; // // Get next adjacent area - either on floor or via ladder // - if (searchFloor) + if ( searchWhere == SEARCH_FLOOR ) { // if exhausted adjacent connections in current direction, begin checking next direction - if (floorIter == floorList->InvalidIndex()) + if ( searchIndex >= floorList->Count() ) { ++dir; - if (dir == NUM_DIRECTIONS) + if ( dir == NUM_DIRECTIONS ) { // checked all directions on floor - check ladders next - searchFloor = false; + searchWhere = SEARCH_LADDERS; - ladderList = area->GetLadderList( CNavLadder::LADDER_UP ); - ladderIter = ladderList->Head(); + ladderList = area->GetLadders( CNavLadder::LADDER_UP ); + searchIndex = 0; ladderTopDir = AHEAD; } else { // start next direction - floorList = area->GetAdjacentList( (NavDirType)dir ); - floorIter = floorList->Head(); + floorList = area->GetAdjacentAreas( (NavDirType)dir ); + searchIndex = 0; } continue; } - newArea = floorList->Element(floorIter).area; + const NavConnect &floorConnect = floorList->Element( searchIndex ); + newArea = floorConnect.area; + length = floorConnect.length; how = (NavTraverseType)dir; - floorIter = floorList->Next( floorIter ); + ++searchIndex; + + if ( IsX360() && searchIndex < floorList->Count() ) + { + PREFETCH360( floorList->Element( searchIndex ).area, 0 ); + } } - else // search ladders + else if ( searchWhere == SEARCH_LADDERS ) { - if (ladderIter == ladderList->InvalidIndex()) + if ( searchIndex >= ladderList->Count() ) { - if (!ladderUp) + if ( !ladderUp ) { - // checked both ladder directions - done - break; + // checked both ladder directions - check elevators next + searchWhere = SEARCH_ELEVATORS; + searchIndex = 0; + ladder = NULL; } else { // check down ladders ladderUp = false; - ladderList = area->GetLadderList( CNavLadder::LADDER_DOWN ); - ladderIter = ladderList->Head(); + ladderList = area->GetLadders( CNavLadder::LADDER_DOWN ); + searchIndex = 0; } continue; } - if (ladderUp) + if ( ladderUp ) { - ladder = ladderList->Element( ladderIter ).ladder; + ladder = ladderList->Element( searchIndex ).ladder; // do not use BEHIND connection, as its very hard to get to when going up a ladder - if (ladderTopDir == AHEAD) + if ( ladderTopDir == AHEAD ) + { newArea = ladder->m_topForwardArea; - else if (ladderTopDir == LEFT) + } + else if ( ladderTopDir == LEFT ) + { newArea = ladder->m_topLeftArea; - else if (ladderTopDir == RIGHT) + } + else if ( ladderTopDir == RIGHT ) + { newArea = ladder->m_topRightArea; + } else { - ladderIter = ladderList->Next( ladderIter ); + ++searchIndex; ladderTopDir = AHEAD; continue; } @@ -236,31 +292,71 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go } else { - newArea = ladderList->Element(ladderIter).ladder->m_bottomArea; + newArea = ladderList->Element( searchIndex ).ladder->m_bottomArea; how = GO_LADDER_DOWN; - ladder = ladderList->Element(ladderIter).ladder; - ladderIter = ladderList->Next( ladderIter ); + ladder = ladderList->Element(searchIndex).ladder; + ++searchIndex; } - if (newArea == NULL) + if ( newArea == NULL ) continue; + + length = -1.0f; + } + else // if ( searchWhere == SEARCH_ELEVATORS ) + { + const NavConnectVector &elevatorAreas = area->GetElevatorAreas(); + + elevator = area->GetElevator(); + + if ( elevator == NULL || searchIndex >= elevatorAreas.Count() ) + { + // done searching connected areas + elevator = NULL; + break; + } + + newArea = elevatorAreas[ searchIndex++ ].area; + if ( newArea->GetCenter().z > area->GetCenter().z ) + { + how = GO_ELEVATOR_UP; + } + else + { + how = GO_ELEVATOR_DOWN; + } + + length = -1.0f; } + // don't backtrack - if (newArea == area) + if ( newArea == area ) continue; // don't consider blocked areas - if ( newArea->IsBlocked() ) + if ( newArea->IsBlocked( teamID, ignoreNavBlockers ) ) continue; - float newCostSoFar = costFunc( newArea, area, ladder ); - + float newCostSoFar = costFunc( newArea, area, ladder, elevator, length ); + // check if cost functor says this area is a dead-end - if (newCostSoFar < 0.0f) + if ( newCostSoFar < 0.0f ) continue; + + // stop if path length limit reached + if ( bHaveMaxPathLength ) + { + // keep track of path length so far + float deltaLength = ( newArea->GetCenter() - area->GetCenter() ).Length(); + float newLengthSoFar = area->GetPathLengthSoFar() + deltaLength; + if ( newLengthSoFar > maxPathLength ) + continue; + + newArea->SetPathLengthSoFar( newLengthSoFar ); + } - if ((newArea->IsOpen() || newArea->IsClosed()) && newArea->GetCostSoFar() <= newCostSoFar) + if ( ( newArea->IsOpen() || newArea->IsClosed() ) && newArea->GetCostSoFar() <= newCostSoFar ) { // this is a worse path - skip it continue; @@ -268,23 +364,25 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go else { // compute estimate of distance left to go - float newCostRemaining = (newArea->GetCenter() - actualGoalPos).Length(); + float distSq = ( newArea->GetCenter() - actualGoalPos ).LengthSqr(); + float newCostRemaining = ( distSq > 0.0 ) ? FastSqrt( distSq ) : 0.0 ; // track closest area to goal in case path fails - if (closestArea && newCostRemaining < closestAreaDist) + if ( closestArea && newCostRemaining < closestAreaDist ) { *closestArea = newArea; closestAreaDist = newCostRemaining; } - newArea->SetParent( area, how ); newArea->SetCostSoFar( newCostSoFar ); newArea->SetTotalCost( newCostSoFar + newCostRemaining ); - if (newArea->IsClosed()) + if ( newArea->IsClosed() ) + { newArea->RemoveFromClosedList(); + } - if (newArea->IsOpen()) + if ( newArea->IsOpen() ) { // area already on open list, update the list order to keep costs sorted newArea->UpdateOnOpenList(); @@ -293,6 +391,8 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go { newArea->AddToOpenList(); } + + newArea->SetParent( area, how ); } } @@ -309,7 +409,7 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go * Compute distance between two areas. Return -1 if can't reach 'endArea' from 'startArea'. */ template< typename CostFunctor > -float NavAreaTravelDistance( CNavArea *startArea, CNavArea *endArea, CostFunctor &costFunc ) +float NavAreaTravelDistance( CNavArea *startArea, CNavArea *endArea, CostFunctor &costFunc, float maxPathLength = 0.0f ) { if (startArea == NULL) return -1.0f; @@ -321,7 +421,7 @@ float NavAreaTravelDistance( CNavArea *startArea, CNavArea *endArea, CostFunctor return 0.0f; // compute path between areas using given cost heuristic - if (NavAreaBuildPath( startArea, endArea, NULL, costFunc ) == false) + if (NavAreaBuildPath( startArea, endArea, NULL, costFunc, NULL, maxPathLength ) == false) return -1.0f; // compute distance along path @@ -335,54 +435,6 @@ float NavAreaTravelDistance( CNavArea *startArea, CNavArea *endArea, CostFunctor } -//-------------------------------------------------------------------------------------------------------------- -/** - * Compute travel distance along shortest path from startPos to goalPos. - * Return -1 if can't reach endPos from goalPos. - */ -template< typename CostFunctor > -float NavAreaTravelDistance( const Vector &startPos, const Vector &goalPos, CostFunctor &costFunc ) -{ - CNavArea *startArea = TheNavMesh->GetNearestNavArea( startPos ); - if (startArea == NULL) - { - return -1.0f; - } - - // compute path between areas using given cost heuristic - CNavArea *goalArea = NULL; - if (NavAreaBuildPath( startArea, NULL, &goalPos, costFunc, &goalArea ) == false) - { - return -1.0f; - } - - // compute distance along path - if (goalArea->GetParent() == NULL) - { - // both points are in the same area - return euclidean distance - return (goalPos - startPos).Length(); - } - else - { - CNavArea *area; - float distance; - - // goalPos is assumed to be inside goalArea (or very close to it) - skip to next area - area = goalArea->GetParent(); - distance = (goalPos - area->GetCenter()).Length(); - - for( ; area->GetParent(); area = area->GetParent() ) - { - distance += (area->GetCenter() - area->GetParent()->GetCenter()).Length(); - } - - // add in distance to startPos - distance += (startPos - area->GetCenter()).Length(); - - return distance; - } -} - //-------------------------------------------------------------------------------------------------------------- /** @@ -434,8 +486,15 @@ inline void AddAreaToOpenList( CNavArea *area, CNavArea *parent, const Vector &s } +/**************************************************************** + * DEPRECATED: Use filter-based SearchSurroundingAreas below + ****************************************************************/ +#define INCLUDE_INCOMING_CONNECTIONS 0x1 +#define INCLUDE_BLOCKED_AREAS 0x2 +#define EXCLUDE_OUTGOING_CONNECTIONS 0x4 +#define EXCLUDE_ELEVATORS 0x8 template < typename Functor > -void SearchSurroundingAreas( CNavArea *startArea, const Vector &startPos, Functor &func, float maxRange = -1.0f ) +void SearchSurroundingAreas( CNavArea *startArea, const Vector &startPos, Functor &func, float maxRange = -1.0f, unsigned int options = 0, int teamID = TEAM_ANY ) { if (startArea == NULL) return; @@ -455,7 +514,7 @@ void SearchSurroundingAreas( CNavArea *startArea, const Vector &startPos, Functo CNavArea *area = CNavArea::PopOpenList(); // don't use blocked areas - if ( area->IsBlocked() ) + if ( area->IsBlocked( teamID ) && !(options & INCLUDE_BLOCKED_AREAS) ) continue; // invoke functor on area @@ -468,19 +527,42 @@ void SearchSurroundingAreas( CNavArea *startArea, const Vector &startPos, Functo for( int i=0; iGetAdjacentArea( (NavDirType)dir, i ); + if ( options & EXCLUDE_OUTGOING_CONNECTIONS ) + { + if ( !adjArea->IsConnected( area, NUM_DIRECTIONS ) ) + { + continue; // skip this outgoing connection + } + } AddAreaToOpenList( adjArea, area, startPos, maxRange ); } } + + // potentially include areas that connect TO this area via a one-way link + if (options & INCLUDE_INCOMING_CONNECTIONS) + { + for( int dir=0; dirGetIncomingConnections( (NavDirType)dir ); + + FOR_EACH_VEC( (*list), it ) + { + NavConnect connect = (*list)[ it ]; + + AddAreaToOpenList( connect.area, area, startPos, maxRange ); + } + } + } // explore adjacent areas connected by ladders // check up ladders - const NavLadderConnectList *ladderList = area->GetLadderList( CNavLadder::LADDER_UP ); + const NavLadderConnectVector *ladderList = area->GetLadders( CNavLadder::LADDER_UP ); if (ladderList) { - FOR_EACH_LL( (*ladderList), it ) + FOR_EACH_VEC( (*ladderList), it ) { const CNavLadder *ladder = (*ladderList)[ it ].ladder; @@ -492,21 +574,147 @@ void SearchSurroundingAreas( CNavArea *startArea, const Vector &startPos, Functo } // check down ladders - ladderList = area->GetLadderList( CNavLadder::LADDER_DOWN ); + ladderList = area->GetLadders( CNavLadder::LADDER_DOWN ); if (ladderList) { - FOR_EACH_LL( (*ladderList), it ) + FOR_EACH_VEC( (*ladderList), it ) { const CNavLadder *ladder = (*ladderList)[ it ].ladder; AddAreaToOpenList( ladder->m_bottomArea, area, startPos, maxRange ); } } + + if ( (options & EXCLUDE_ELEVATORS) == 0 ) + { + const NavConnectVector &elevatorList = area->GetElevatorAreas(); + FOR_EACH_VEC( elevatorList, it ) + { + CNavArea *elevatorArea = elevatorList[ it ].area; + AddAreaToOpenList( elevatorArea, area, startPos, maxRange ); + } + } } } } +//-------------------------------------------------------------------------------------------------------------- +/** + * Derive your own custom search functor from this interface method for use with SearchSurroundingAreas below. + */ +class ISearchSurroundingAreasFunctor +{ +public: + virtual ~ISearchSurroundingAreasFunctor() { } + + /** + * Perform user-defined action on area. + * Return 'false' to end the search (ie: you found what you were looking for) + */ + virtual bool operator() ( CNavArea *area, CNavArea *priorArea, float travelDistanceSoFar ) = 0; + + // return true if 'adjArea' should be included in the ongoing search + virtual bool ShouldSearch( CNavArea *adjArea, CNavArea *currentArea, float travelDistanceSoFar ) + { + return !adjArea->IsBlocked( TEAM_ANY ); + } + + /** + * Collect adjacent areas to continue the search by calling 'IncludeInSearch' on each + */ + virtual void IterateAdjacentAreas( CNavArea *area, CNavArea *priorArea, float travelDistanceSoFar ) + { + // search adjacent outgoing connections + for( int dir=0; dirGetAdjacentCount( (NavDirType)dir ); + for( int i=0; iGetAdjacentArea( (NavDirType)dir, i ); + + if ( ShouldSearch( adjArea, area, travelDistanceSoFar ) ) + { + IncludeInSearch( adjArea, area ); + } + } + } + } + + // Invoked after the search has completed + virtual void PostSearch( void ) { } + + // consider 'area' in upcoming search steps + void IncludeInSearch( CNavArea *area, CNavArea *priorArea ) + { + if ( area == NULL ) + return; + + if ( !area->IsMarked() ) + { + area->Mark(); + area->SetTotalCost( 0.0f ); + area->SetParent( priorArea ); + + // compute approximate travel distance from start area of search + if ( priorArea ) + { + float distAlong = priorArea->GetCostSoFar(); + distAlong += ( area->GetCenter() - priorArea->GetCenter() ).Length(); + area->SetCostSoFar( distAlong ); + } + else + { + area->SetCostSoFar( 0.0f ); + } + + // adding an area to the open list also marks it + area->AddToOpenList(); + } + } +}; + + +/** + * Do a breadth-first search starting from 'startArea' and continuing outward based on + * adjacent areas that pass the given filter + */ +inline void SearchSurroundingAreas( CNavArea *startArea, ISearchSurroundingAreasFunctor &func ) +{ + if ( startArea ) + { + CNavArea::MakeNewMarker(); + CNavArea::ClearSearchLists(); + + startArea->AddToOpenList(); + startArea->SetTotalCost( 0.0f ); + startArea->SetCostSoFar( 0.0f ); + startArea->SetParent( NULL ); + startArea->Mark(); + + CUtlVector< CNavArea * > adjVector; + + while( !CNavArea::IsOpenListEmpty() ) + { + // get next area to check + CNavArea *area = CNavArea::PopOpenList(); + + if ( func( area, area->GetParent(), area->GetCostSoFar() ) ) + { + func.IterateAdjacentAreas( area, area->GetParent(), area->GetCostSoFar() ); + } + else + { + // search aborted + break; + } + } + } + + func.PostSearch(); +} + + //-------------------------------------------------------------------------------------------------------------- /** * Fuctor that returns lowest cost for farthest away areas @@ -563,17 +771,16 @@ CNavArea *FindMinimumCostArea( CNavArea *startArea, CostFunctor &costFunc ) cheapAreaSet[ NUM_CHEAP_AREAS ]; int cheapAreaSetCount = 0; - FOR_EACH_LL( TheNavAreaList, iter ) + FOR_EACH_VEC( TheNavAreas, iter ) { - CNavArea *area = TheNavAreaList[iter]; + CNavArea *area = TheNavAreas[iter]; // skip the small areas - const Extent &extent = area->GetExtent(); - if (extent.hi.x - extent.lo.x < minSize || extent.hi.y - extent.lo.y < minSize) + if ( area->GetSizeX() < minSize || area->GetSizeY() < minSize) continue; // compute cost of this area - float cost = costFunc( area, startArea, NULL ); + float cost = costFunc( area, startArea, NULL, NULL ); if (cheapAreaSetCount < NUM_CHEAP_AREAS) { @@ -604,13 +811,13 @@ CNavArea *FindMinimumCostArea( CNavArea *startArea, CostFunctor &costFunc ) else { // degenerate case - no decent sized areas - pick a random area - int numAreas = TheNavAreaList.Count(); + int numAreas = TheNavAreas.Count(); int which = RandomInt( 0, numAreas-1 ); - FOR_EACH_LL( TheNavAreaList, iter ) + FOR_EACH_VEC( TheNavAreas, iter ) { if (which-- == 0) - return TheNavAreaList[iter]; + return TheNavAreas[iter]; } } diff --git a/game/shared/util_shared.h b/game/shared/util_shared.h index 8a8781fdb..e068e07f8 100644 --- a/game/shared/util_shared.h +++ b/game/shared/util_shared.h @@ -424,6 +424,8 @@ inline float DistanceToRay( const Vector &pos, const Vector &rayStart, const Vec class IntervalTimer { public: + DECLARE_EMBEDDED_NETWORKVAR(); + IntervalTimer( void ) { m_timestamp = -1.0f; @@ -466,7 +468,7 @@ class IntervalTimer } private: - float m_timestamp; + CNetworkVar( float, m_timestamp ); float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime }; @@ -479,6 +481,8 @@ class IntervalTimer class CountdownTimer { public: + DECLARE_EMBEDDED_NETWORKVAR(); + CountdownTimer( void ) { m_timestamp = -1.0f; @@ -528,8 +532,8 @@ class CountdownTimer } private: - float m_duration; - float m_timestamp; + CNetworkVar( float, m_duration ); + CNetworkVar( float, m_timestamp ); float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime }; diff --git a/public/engine/ivmodelinfo.h b/public/engine/ivmodelinfo.h index 11b918ddb..93a0cedc9 100644 --- a/public/engine/ivmodelinfo.h +++ b/public/engine/ivmodelinfo.h @@ -67,6 +67,7 @@ class IVModelInfo virtual const char *GetModelName( const model_t *model ) const = 0; virtual vcollide_t *GetVCollide( const model_t *model ) const = 0; virtual vcollide_t *GetVCollide( int modelindex ) const = 0; + virtual vcollide_t *GetPhysics2VCollide(int) const = 0; virtual void GetModelBounds( const model_t *model, Vector& mins, Vector& maxs ) const = 0; virtual void GetModelRenderBounds( const model_t *model, Vector& mins, Vector& maxs ) const = 0; virtual int GetModelFrameCount( const model_t *model ) const = 0; diff --git a/public/tier1/utlmemory.h b/public/tier1/utlmemory.h index 5b0c8ffb4..aac299e26 100644 --- a/public/tier1/utlmemory.h +++ b/public/tier1/utlmemory.h @@ -264,6 +264,133 @@ class CUtlMemoryFixed char m_Memory[ SIZE*sizeof(T) + nAlignment ]; }; +#ifdef _LINUX +#define REMEMBER_ALLOC_SIZE_FOR_VALGRIND 1 +#endif + +//----------------------------------------------------------------------------- +// The CUtlMemoryConservative class: +// A dynamic memory class that tries to minimize overhead (itself small, no custom grow factor) +//----------------------------------------------------------------------------- +template< typename T > +class CUtlMemoryConservative +{ + +public: + // constructor, destructor + CUtlMemoryConservative( int nGrowSize = 0, int nInitSize = 0 ) : m_pMemory( NULL ) + { +#ifdef REMEMBER_ALLOC_SIZE_FOR_VALGRIND + m_nCurAllocSize = 0; +#endif + + } + CUtlMemoryConservative( T* pMemory, int numElements ) { Assert( 0 ); } + ~CUtlMemoryConservative() { if ( m_pMemory ) free( m_pMemory ); } + + // Can we use this index? + bool IsIdxValid( int i ) const { return ( IsDebug() ) ? ( i >= 0 && i < NumAllocated() ) : ( i >= 0 ); } + static int InvalidIndex() { return -1; } + + // Gets the base address + T* Base() { return m_pMemory; } + const T* Base() const { return m_pMemory; } + + // element access + T& operator[]( int i ) { Assert( IsIdxValid(i) ); return Base()[i]; } + const T& operator[]( int i ) const { Assert( IsIdxValid(i) ); return Base()[i]; } + T& Element( int i ) { Assert( IsIdxValid(i) ); return Base()[i]; } + const T& Element( int i ) const { Assert( IsIdxValid(i) ); return Base()[i]; } + + // Attaches the buffer to external memory.... + void SetExternalBuffer( T* pMemory, int numElements ) { Assert( 0 ); } + + // Size + FORCEINLINE void RememberAllocSize( size_t sz ) + { +#ifdef REMEMBER_ALLOC_SIZE_FOR_VALGRIND + m_nCurAllocSize = sz; +#endif + } + + size_t AllocSize( void ) const + { +#ifdef REMEMBER_ALLOC_SIZE_FOR_VALGRIND + return m_nCurAllocSize; +#else + return ( m_pMemory ) ? g_pMemAlloc->GetSize( m_pMemory ) : 0; +#endif + } + + int NumAllocated() const + { + return AllocSize() / sizeof( T ); + } + int Count() const + { + return NumAllocated(); + } + + FORCEINLINE void ReAlloc( size_t sz ) + { + m_pMemory = (T*)realloc( m_pMemory, sz ); + RememberAllocSize( sz ); + } + // Grows the memory, so that at least allocated + num elements are allocated + void Grow( int num = 1 ) + { + int nCurN = NumAllocated(); + ReAlloc( ( nCurN + num ) * sizeof( T ) ); + } + + // Makes sure we've got at least this much memory + void EnsureCapacity( int num ) + { + size_t nSize = sizeof( T ) * MAX( num, Count() ); + ReAlloc( nSize ); + } + + // Memory deallocation + void Purge() + { + free( m_pMemory ); + RememberAllocSize( 0 ); + m_pMemory = NULL; + } + + // Purge all but the given number of elements + void Purge( int numElements ) { ReAlloc( numElements * sizeof(T) ); } + + // is the memory externally allocated? + bool IsExternallyAllocated() const { return false; } + + // Set the size by which the memory grows + void SetGrowSize( int size ) {} + + class Iterator_t + { + public: + Iterator_t( int i, int _limit ) : index( i ), limit( _limit ) {} + int index; + int limit; + bool operator==( const Iterator_t it ) const { return index == it.index; } + bool operator!=( const Iterator_t it ) const { return index != it.index; } + }; + Iterator_t First() const { int limit = NumAllocated(); return Iterator_t( limit ? 0 : InvalidIndex(), limit ); } + Iterator_t Next( const Iterator_t &it ) const { return Iterator_t( ( it.index + 1 < it.limit ) ? it.index + 1 : InvalidIndex(), it.limit ); } + int GetIndex( const Iterator_t &it ) const { return it.index; } + bool IsIdxAfter( int i, const Iterator_t &it ) const { return i > it.index; } + bool IsValidIterator( const Iterator_t &it ) const { return IsIdxValid( it.index ) && ( it.index < it.limit ); } + Iterator_t InvalidIterator() const { return Iterator_t( InvalidIndex(), 0 ); } + +private: + T *m_pMemory; +#ifdef REMEMBER_ALLOC_SIZE_FOR_VALGRIND + size_t m_nCurAllocSize; +#endif + +}; + //----------------------------------------------------------------------------- // constructor, destructor //----------------------------------------------------------------------------- diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index 3dd9186e9..a4940be05 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -224,6 +224,269 @@ class CUtlVectorFixedGrowable : public CUtlVector< T, CUtlMemoryFixedGrowable +class CUtlVectorConservative : public CUtlVector< T, CUtlMemoryConservative > +{ + typedef CUtlVector< T, CUtlMemoryConservative > BaseClass; +public: + + // constructor, destructor + CUtlVectorConservative( int growSize = 0, int initSize = 0 ) : BaseClass( growSize, initSize ) {} + CUtlVectorConservative( T* pMemory, int numElements ) : BaseClass( pMemory, numElements ) {} +}; + + +//----------------------------------------------------------------------------- +// The CUtlVectorUltra Conservative class: +// A array class with a very conservative allocation scheme, with customizable allocator +// Especialy useful if you have a lot of vectors that are sparse, or if you're +// carefully packing holders of vectors +//----------------------------------------------------------------------------- +#pragma warning(push) +#pragma warning(disable : 4200) // warning C4200: nonstandard extension used : zero-sized array in struct/union +#pragma warning(disable : 4815 ) // warning C4815: 'staticData' : zero-sized array in stack object will have no elements + +class CUtlVectorUltraConservativeAllocator +{ +public: + static void *Alloc( size_t nSize ) + { + return malloc( nSize ); + } + + static void *Realloc( void *pMem, size_t nSize ) + { + return realloc( pMem, nSize ); + } + + static void Free( void *pMem ) + { + free( pMem ); + } + + static size_t GetSize( void *pMem ) + { + return mallocsize( pMem ); + } + +}; + +template +class CUtlVectorUltraConservative : private A +{ +public: + CUtlVectorUltraConservative() + { + m_pData = StaticData(); + } + + ~CUtlVectorUltraConservative() + { + RemoveAll(); + } + + int Count() const + { + return m_pData->m_Size; + } + + static int InvalidIndex() + { + return -1; + } + + inline bool IsValidIndex( int i ) const + { + return (i >= 0) && (i < Count()); + } + + T& operator[]( int i ) + { + Assert( IsValidIndex( i ) ); + return m_pData->m_Elements[i]; + } + + const T& operator[]( int i ) const + { + Assert( IsValidIndex( i ) ); + return m_pData->m_Elements[i]; + } + + T& Element( int i ) + { + Assert( IsValidIndex( i ) ); + return m_pData->m_Elements[i]; + } + + const T& Element( int i ) const + { + Assert( IsValidIndex( i ) ); + return m_pData->m_Elements[i]; + } + + void EnsureCapacity( int num ) + { + int nCurCount = Count(); + if ( num <= nCurCount ) + { + return; + } + if ( m_pData == StaticData() ) + { + m_pData = (Data_t *)A::Alloc( sizeof(int) + ( num * sizeof(T) ) ); + m_pData->m_Size = 0; + } + else + { + int nNeeded = sizeof(int) + ( num * sizeof(T) ); + int nHave = A::GetSize( m_pData ); + if ( nNeeded > nHave ) + { + m_pData = (Data_t *)A::Realloc( m_pData, nNeeded ); + } + } + } + + int AddToTail( const T& src ) + { + int iNew = Count(); + EnsureCapacity( Count() + 1 ); + m_pData->m_Elements[iNew] = src; + m_pData->m_Size++; + return iNew; + } + + void RemoveAll() + { + if ( Count() ) + { + for (int i = m_pData->m_Size; --i >= 0; ) + { + Destruct(&m_pData->m_Elements[i]); + } + } + if ( m_pData != StaticData() ) + { + A::Free( m_pData ); + m_pData = StaticData(); + + } + } + + void PurgeAndDeleteElements() + { + if ( m_pData != StaticData() ) + { + for( int i=0; i < m_pData->m_Size; i++ ) + { + delete Element(i); + } + RemoveAll(); + } + } + + void FastRemove( int elem ) + { + Assert( IsValidIndex(elem) ); + + Destruct( &Element(elem) ); + if (Count() > 0) + { + if ( elem != m_pData->m_Size -1 ) + memcpy( &Element(elem), &Element(m_pData->m_Size-1), sizeof(T) ); + --m_pData->m_Size; + } + if ( !m_pData->m_Size ) + { + A::Free( m_pData ); + m_pData = StaticData(); + } + } + + void Remove( int elem ) + { + Destruct( &Element(elem) ); + ShiftElementsLeft(elem); + --m_pData->m_Size; + if ( !m_pData->m_Size ) + { + A::Free( m_pData ); + m_pData = StaticData(); + } + } + + int Find( const T& src ) const + { + int nCount = Count(); + for ( int i = 0; i < nCount; ++i ) + { + if (Element(i) == src) + return i; + } + return -1; + } + + bool FindAndRemove( const T& src ) + { + int elem = Find( src ); + if ( elem != -1 ) + { + Remove( elem ); + return true; + } + return false; + } + + + bool FindAndFastRemove( const T& src ) + { + int elem = Find( src ); + if ( elem != -1 ) + { + FastRemove( elem ); + return true; + } + return false; + } + + struct Data_t + { + int m_Size; + T m_Elements[]; + }; + + Data_t *m_pData; +private: + void ShiftElementsLeft( int elem, int num = 1 ) + { + int Size = Count(); + Assert( IsValidIndex(elem) || ( Size == 0 ) || ( num == 0 )); + int numToMove = Size - elem - num; + if ((numToMove > 0) && (num > 0)) + { + Q_memmove( &Element(elem), &Element(elem+num), numToMove * sizeof(T) ); + +#ifdef _DEBUG + Q_memset( &Element(Size-num), 0xDD, num * sizeof(T) ); +#endif + } + } + + + + static Data_t *StaticData() + { + static Data_t staticData; + Assert( staticData.m_Size == 0 ); + return &staticData; + } +}; + +#pragma warning(pop) //----------------------------------------------------------------------------- // The CCopyableUtlVector class: From 74bf01cc77ffcdee8ef66fcedeca8b0287af9b9f Mon Sep 17 00:00:00 2001 From: arthurdead Date: Tue, 30 Mar 2021 23:04:45 -0300 Subject: [PATCH 02/24] add mallocsize --- public/tier0/platform.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/tier0/platform.h b/public/tier0/platform.h index 95778f503..3366ec091 100644 --- a/public/tier0/platform.h +++ b/public/tier0/platform.h @@ -423,6 +423,18 @@ typedef void * HINSTANCE; #define stackfree( _p ) #endif +#if defined( GNUC ) +#ifdef _LINUX + #define mallocsize( _p ) ( malloc_usable_size( _p ) ) +#elif defined(OSX) + #define mallocsize( _p ) ( malloc_size( _p ) ) +#else +#error +#endif +#elif defined ( _WIN32 ) + #define mallocsize( _p ) ( _msize( _p ) ) +#endif + #ifdef _WIN32 #define RESTRICT __restrict #define RESTRICT_FUNC __declspec(restrict) From 473c9aa2ecc1da42958432fd34a58e3d7971392b Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 00:58:45 -0300 Subject: [PATCH 03/24] more updates --- game/server/nav_mesh.h | 4 +- game/server/util.cpp | 359 +- game/server/util.h | 122 +- game/shared/activitylist.cpp | 862 +---- game/shared/ai_activity.h | 866 +---- game/shared/animation.cpp | 245 +- game/shared/animation.h | 11 +- game/shared/eventlist.cpp | 34 +- game/shared/eventlist.h | 24 + game/shared/npcevent.h | 118 +- game/shared/predictioncopy.cpp | 2951 +++++++--------- game/shared/predictioncopy.h | 319 +- game/shared/shareddefs.h | 185 +- game/shared/util_shared.cpp | 3091 +++++++++++------ game/shared/util_shared.h | 1475 +++++--- .../isoundemittersystembase.h | 24 +- public/SoundParametersInternal.cpp | 28 +- public/appframework/IAppSystem.h | 9 + public/basehandle.h | 20 +- public/bittools.h | 46 + public/bitvec.h | 76 +- public/bone_accessor.cpp | 3 + public/bone_accessor.h | 26 +- public/bone_setup.h | 197 +- public/collisionutils.cpp | 187 +- public/collisionutils.h | 41 + public/const.h | 78 +- public/datamap.h | 67 +- public/dt_common.h | 10 + public/dt_send.cpp | 186 +- public/dt_send.h | 59 +- public/dt_utlvector_common.cpp | 3 +- public/dt_utlvector_common.h | 29 +- public/dt_utlvector_send.cpp | 10 + public/engine_hlds_api.h | 4 + public/entitydefs.h | 21 + public/gamebspfile.h | 80 +- public/iachievementmgr.h | 24 +- public/idedicatedexports.h | 1 + public/inetchannelinfo.h | 3 + public/inetmessage.h | 3 +- public/ispatialpartition.h | 10 +- public/ispsharedmemory.h | 27 + public/istudiorender.h | 113 +- public/jigglebones.cpp | 103 +- public/jigglebones.h | 1 + public/materialsystem/IColorCorrection.h | 8 +- public/materialsystem/IShader.h | 70 +- public/materialsystem/MaterialSystemUtil.cpp | 46 +- public/materialsystem/MaterialSystemUtil.h | 15 +- public/materialsystem/idebugtextureinfo.h | 1 - public/materialsystem/imaterial.h | 285 +- public/materialsystem/imaterialproxyfactory.h | 1 + public/materialsystem/imaterialsystem.h | 590 +++- .../imaterialsystemhardwareconfig.h | 61 +- public/materialsystem/imesh.h | 645 ++-- public/materialsystem/itexture.h | 18 +- public/materialsystem/ivballoctracker.h | 3 +- public/materialsystem/materialsystem_config.h | 49 +- public/mathlib/mathlib.h | 24 + public/model_types.h | 11 +- public/mouthinfo.h | 19 +- public/networkvar.h | 259 +- public/optimize.h | 55 +- public/posedebugger.cpp | 19 +- public/raytrace.h | 47 +- public/server_class.h | 8 +- public/shake.h | 48 +- public/soundchars.h | 7 +- public/soundflags.h | 6 +- public/soundinfo.h | 48 +- public/steam/isteamgameserver.h | 226 ++ public/steam/isteamgameserverstats.h | 93 + public/steam/isteammasterserverupdater.h | 103 + public/steam/isteamnetworking.h | 278 ++ public/steam/isteamremotestorage.h | 45 + public/steam/steam_gameserver.h | 143 + public/studio.cpp | 561 ++- public/studio.h | 624 +++- public/studio_virtualmodel.cpp | 26 +- public/tier1/checksum_md5.h | 12 + public/vcollide.h | 1 + public/vcollide_parse.h | 25 +- public/vphysics/constraints.h | 8 + public/vphysics_interface.h | 14 +- 85 files changed, 10077 insertions(+), 6580 deletions(-) create mode 100644 public/bittools.h create mode 100644 public/entitydefs.h create mode 100644 public/ispsharedmemory.h create mode 100644 public/steam/isteamgameserver.h create mode 100644 public/steam/isteamgameserverstats.h create mode 100644 public/steam/isteammasterserverupdater.h create mode 100644 public/steam/isteamnetworking.h create mode 100644 public/steam/isteamremotestorage.h create mode 100644 public/steam/steam_gameserver.h diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index b74da37c4..20f7e94c6 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -269,7 +269,7 @@ class CNavMesh : public CGameEventListener CNavArea *GetNavArea( const Vector &pos, float beneathLimt = 120.0f ) const; // given a position, return the nav area that IsOverlapping and is *immediately* beneath it CNavArea *GetNavArea( CBaseEntity *pEntity, int nGetNavAreaFlags, float flBeneathLimit = 120.0f ) const; CNavArea *GetNavAreaByID( unsigned int id ) const; - CNavArea *GetNearestNavArea( const Vector &pos, bool anyZ = false, float maxDist = 10000.0f, bool checkLOS = false, bool checkGround = true, bool ) const; + CNavArea *GetNearestNavArea( const Vector &pos, bool anyZ = false, float maxDist = 10000.0f, bool checkLOS = false, bool checkGround = true, bool unknown = false ) const; CNavArea *GetNearestNavArea( CBaseEntity *pEntity, int nGetNavAreaFlags = GETNAVAREA_CHECK_GROUND, float maxDist = 10000.0f ) const; Place GetPlace( const Vector &pos ) const; // return Place at given coordinate @@ -304,6 +304,8 @@ class CNavMesh : public CGameEventListener void ClearWalkableSeeds( void ) { m_walkableSeeds.RemoveAll(); } // erase all walkable seed positions void MarkStairAreas( void ); + unsigned int GetGenerationTraceMask( void ) const; // return the mask used by traces when generating the mesh + //------------------------------------------------------------------------------------- // Edit mode // diff --git a/game/server/util.cpp b/game/server/util.cpp index 1a27f5822..eaa275820 100644 --- a/game/server/util.cpp +++ b/game/server/util.cpp @@ -36,17 +36,17 @@ #include "datacache/imdlcache.h" #include "util.h" -#ifdef PORTAL -#include "PortalSimulation.h" -//#include "Portal_PhysicsEnvironmentMgr.h" -#endif + // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" -extern short g_sModelIndexSmoke; // (in combatweapon.cpp) holds the index for the smoke cloud -extern short g_sModelIndexBloodDrop; // (in combatweapon.cpp) holds the sprite index for the initial blood -extern short g_sModelIndexBloodSpray; // (in combatweapon.cpp) holds the sprite index for splattered blood +extern int g_sModelIndexSmoke; // (in combatweapon.cpp) holds the index for the smoke cloud +extern int g_sModelIndexBloodDrop; // (in combatweapon.cpp) holds the sprite index for the initial blood +extern int g_sModelIndexBloodSpray; // (in combatweapon.cpp) holds the sprite index for splattered blood + +// this is true if the engine should be sent log output. Once per frame it is rechecked to see if logging has been enabled. +bool g_bIsLogging = true; #ifdef DEBUG void DBG_AssertFunction( bool fExpr, const char *szExpr, const char *szFile, int szLine, const char *szMessage ) @@ -141,7 +141,7 @@ IEntityFactory *CEntityFactoryDictionary::FindFactory( const char *pClassName ) //----------------------------------------------------------------------------- void CEntityFactoryDictionary::InstallFactory( IEntityFactory *pFactory, const char *pClassName ) { - Assert( FindFactory( pClassName ) == NULL ); + AssertMsg1( FindFactory( pClassName ) == NULL, "Double installation of factory for %s", pClassName ); m_Factories.Insert( pClassName, pFactory ); } @@ -198,46 +198,6 @@ void CEntityFactoryDictionary::ReportEntitySizes() } -//----------------------------------------------------------------------------- -// class CFlaggedEntitiesEnum -//----------------------------------------------------------------------------- - -CFlaggedEntitiesEnum::CFlaggedEntitiesEnum( CBaseEntity **pList, int listMax, int flagMask ) -{ - m_pList = pList; - m_listMax = listMax; - m_flagMask = flagMask; - m_count = 0; -} - -bool CFlaggedEntitiesEnum::AddToList( CBaseEntity *pEntity ) -{ - if ( m_count >= m_listMax ) - { - AssertMsgOnce( 0, "reached enumerated list limit. Increase limit, decrease radius, or make it so entity flags will work for you" ); - return false; - } - m_pList[m_count] = pEntity; - m_count++; - return true; -} - -IterationRetval_t CFlaggedEntitiesEnum::EnumElement( IHandleEntity *pHandleEntity ) -{ - CBaseEntity *pEntity = gEntList.GetBaseEntity( pHandleEntity->GetRefEHandle() ); - if ( pEntity ) - { - if ( m_flagMask && !(pEntity->GetFlags() & m_flagMask) ) // Does it meet the criteria? - return ITERATION_CONTINUE; - - if ( !AddToList( pEntity ) ) - return ITERATION_STOP; - } - - return ITERATION_CONTINUE; -} - - //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- @@ -276,12 +236,6 @@ int UTIL_EntitiesInBox( const Vector &mins, const Vector &maxs, CFlaggedEntities return pEnum->GetCount(); } -int UTIL_EntitiesAlongRay( const Ray_t &ray, CFlaggedEntitiesEnum *pEnum ) -{ - partition->EnumerateElementsAlongRay( PARTITION_ENGINE_NON_STATIC_EDICTS, ray, false, pEnum ); - return pEnum->GetCount(); -} - int UTIL_EntitiesInSphere( const Vector ¢er, float radius, CFlaggedEntitiesEnum *pEnum ) { partition->EnumerateElementsInSphere( PARTITION_ENGINE_NON_STATIC_EDICTS, center, radius, false, pEnum ); @@ -464,9 +418,7 @@ void UTIL_Remove( IServerNetworkable *oldObj ) CBaseEntity *pBaseEnt = oldObj->GetBaseEntity(); if ( pBaseEnt ) { -#ifdef PORTAL //make sure entities are in the primary physics environment for the portal mod, this code should be safe even if the entity is in neither extra environment - CPortalSimulator::Pre_UTIL_Remove( pBaseEnt ); -#endif + g_bReceivedChainedUpdateOnRemove = false; pBaseEnt->UpdateOnRemove(); @@ -475,9 +427,7 @@ void UTIL_Remove( IServerNetworkable *oldObj ) // clear oldObj targetname / other flags now pBaseEnt->SetName( NULL_STRING ); -#ifdef PORTAL - CPortalSimulator::Post_UTIL_Remove( pBaseEnt ); -#endif + } gEntList.AddToDeleteList( oldObj ); @@ -517,9 +467,7 @@ void UTIL_RemoveImmediate( CBaseEntity *oldObj ) return; } -#ifdef PORTAL //make sure entities are in the primary physics environment for the portal mod, this code should be safe even if the entity is in neither extra environment - CPortalSimulator::Pre_UTIL_Remove( oldObj ); -#endif + oldObj->AddEFlags( EFL_KILLME ); // Make sure to ignore further calls into here or UTIL_Remove. @@ -533,9 +481,7 @@ void UTIL_RemoveImmediate( CBaseEntity *oldObj ) delete oldObj; g_bDisableEhandleAccess = false; -#ifdef PORTAL - CPortalSimulator::Post_UTIL_Remove( oldObj ); -#endif + } @@ -701,6 +647,12 @@ int ENTINDEX( CBaseEntity *pEnt ) void UTIL_GetPlayerConnectionInfo( int playerIndex, int& ping, int &packetloss ) { CBasePlayer *player = UTIL_PlayerByIndex( playerIndex ); + if ( player->IsSplitScreenPlayer() && + player->GetSplitScreenPlayerOwner() ) + { + player = player->GetSplitScreenPlayerOwner(); + playerIndex = player->entindex(); + } INetChannelInfo *nci = engine->GetPlayerNetInfo(playerIndex); @@ -719,10 +671,10 @@ void UTIL_GetPlayerConnectionInfo( int playerIndex, int& ping, int &packetloss ) // Source pings by half a tick to match the old GoldSrc pings. latency -= TICKS_TO_TIME( 0.5f ); - ping = (int)(latency * 1000.0f); // as msecs + ping = latency * 1000.0f; // as msecs ping = clamp( ping, 5, 1000 ); // set bounds, dont show pings under 5 msecs - packetloss = (int)(100.0f * nci->GetAvgLoss( FLOW_INCOMING )); // loss in percentage + packetloss = 100.0f * nci->GetAvgLoss( FLOW_INCOMING ); // loss in percentage packetloss = clamp( packetloss, 0, 100 ); } else @@ -736,7 +688,7 @@ static unsigned short FixedUnsigned16( float value, float scale ) { int output; - output = (int)(value * scale); + output = value * scale; if ( output < 0 ) output = 0; if ( output > 0xFFFF ) @@ -810,7 +762,7 @@ inline void TransmitShakeEvent( CBasePlayer *pPlayer, float localAmplitude, floa // bAirShake - if this is false, then it will only shake players standing on the ground. //----------------------------------------------------------------------------- const float MAX_SHAKE_AMPLITUDE = 16.0f; -void UTIL_ScreenShake( const Vector ¢er, float amplitude, float frequency, float duration, float radius, ShakeCommand_t eCommand, bool bAirShake ) +void UTIL_ScreenShake( const Vector ¢er, float amplitude, float frequency, float duration, float radius, ShakeCommand_t eCommand, bool bAirShake, CUtlVector *ignore ) { int i; float localAmplitude; @@ -821,7 +773,7 @@ void UTIL_ScreenShake( const Vector ¢er, float amplitude, float frequency, f } for ( i = 1; i <= gpGlobals->maxClients; i++ ) { - CBaseEntity *pPlayer = UTIL_PlayerByIndex( i ); + CBasePlayer *pPlayer = UTIL_PlayerByIndex( i ); // // Only start shakes for players that are on the ground unless doing an air shake. @@ -831,6 +783,11 @@ void UTIL_ScreenShake( const Vector ¢er, float amplitude, float frequency, f continue; } + if ( ignore && ignore->HasElement( pPlayer ) ) + { + continue; + } + localAmplitude = ComputeShakeAmplitude( center, pPlayer->WorldSpaceCenter(), amplitude, radius ); // This happens if the player is outside the radius, in which case we should ignore @@ -838,7 +795,7 @@ void UTIL_ScreenShake( const Vector ¢er, float amplitude, float frequency, f if (localAmplitude < 0) continue; - TransmitShakeEvent( (CBasePlayer *)pPlayer, localAmplitude, frequency, duration, eCommand ); + TransmitShakeEvent( pPlayer, localAmplitude, frequency, duration, eCommand ); } } @@ -864,7 +821,7 @@ void UTIL_ScreenShakeObject( CBaseEntity *pEnt, const Vector ¢er, float ampl { localAmplitude = amplitude; } - else if ((pPlayer->GetFlags() & FL_ONGROUND) && (pPlayer->GetGroundEntity()->GetRootMoveParent() == pHighestParent)) + else if ((pPlayer->GetFlags() & FL_ONGROUND) && pPlayer->GetGroundEntity() && (pPlayer->GetGroundEntity()->GetRootMoveParent() == pHighestParent)) { // If the player is standing on the object, use maximum amplitude localAmplitude = amplitude; @@ -890,6 +847,67 @@ void UTIL_ScreenShakeObject( CBaseEntity *pEnt, const Vector ¢er, float ampl } +//----------------------------------------------------------------------------- +// Transmits the actual tilt event +//----------------------------------------------------------------------------- +inline void TransmitTiltEvent( CBasePlayer *pPlayer, QAngle tiltAngle, float duration, float tiltTime, ShakeCommand_t eCommand, bool bEaseInOut ) +{ + CSingleUserRecipientFilter user( pPlayer ); + user.MakeReliable(); + UserMessageBegin( user, "Tilt" ); + WRITE_BYTE( eCommand ); // tilt command (SHAKE_START, STOP, FREQUENCY, AMPLITUDE) + WRITE_BYTE( bEaseInOut ); // tilt ease in/out + WRITE_FLOAT( tiltAngle.x ); // tilt angle + WRITE_FLOAT( tiltAngle.y ); + WRITE_FLOAT( tiltAngle.z ); + WRITE_FLOAT( duration ); // tilt lasts this long + WRITE_FLOAT( tiltTime ); // tilt time + MessageEnd(); +} + +//----------------------------------------------------------------------------- +// Purpose: Tilt the screen of all clients within radius. +// radius == 0, shake all clients +// Input : center - Center of screen tilt, radius is measured from here. +// tiltAngle - Angle that the world is pretending to tilt +// duration - duration of tilt in seconds. +// radius - Radius of effect, 0 shakes all clients. +// tiltTime - how long it takes to reach full tilt +// command - One of the following values: +// SHAKE_START - starts the screen tilt for all players within the radius +// SHAKE_STOP - stops the screen tilt for all players within the radius +// SHAKE_AMPLITUDE - modifies the amplitude of the screen tilt +// for all players within the radius +// SHAKE_FREQUENCY - modifies the frequency of the screen tilt +// for all players within the radius +// bAirShake - if this is false, then it will only tilt players standing on the ground. +//----------------------------------------------------------------------------- +void UTIL_ScreenTilt( const Vector ¢er, const QAngle &tiltAngle, float duration, float radius, float tiltTime, ShakeCommand_t eCommand, bool bEaseInOut ) +{ + int i; + + for ( i = 1; i <= gpGlobals->maxClients; i++ ) + { + CBaseEntity *pPlayer = UTIL_PlayerByIndex( i ); + + // + // Only start shakes for players that are on the ground unless doing an air shake. + // + if ( !pPlayer ) + { + continue; + } + + // This happens if the player is outside the radius, in which case we should ignore + // all commands + if ( radius != 0.0f && pPlayer->WorldSpaceCenter().DistTo( center ) > radius ) + continue; + + TransmitTiltEvent( (CBasePlayer *)pPlayer, tiltAngle, duration, tiltTime, eCommand, bEaseInOut ); + } +} + + //----------------------------------------------------------------------------- // Purpose: Punches the view of all clients within radius. // If radius is 0, punches all clients. @@ -952,10 +970,17 @@ void UTIL_ScreenFadeWrite( const ScreenFade_t &fade, CBaseEntity *pEntity ) if ( !pEntity || !pEntity->IsNetClient() ) return; - CSingleUserRecipientFilter user( (CBasePlayer *)pEntity ); + CBasePlayer *pRecipient = static_cast< CBasePlayer * >( pEntity ); + + if ( pRecipient->ShouldThrottleUserMessage( "Fade" ) ) + { + return; + } + + CSingleUserRecipientFilter user( pRecipient ); user.MakeReliable(); - UserMessageBegin( user, "Fade" ); // use the magic #1 for "one client" + UserMessageBegin( user, "Fade" ); WRITE_SHORT( fade.duration ); // fade lasts this long WRITE_SHORT( fade.holdTime ); // fade lasts this long WRITE_SHORT( fade.fadeFlags ); // fade type (in / out) @@ -1192,6 +1217,57 @@ void UTIL_ShowMessageAll( const char *pString ) UTIL_ShowMessage( pString, NULL ); } + +//------------------------------------------------------------------------------------------------- +// HudMessagePanel helper +void UTIL_MessageTextAll( const char *text, Color color ) +{ + CReliableBroadcastRecipientFilter filter; + UserMessageBegin( filter, "MessageText" ); + WRITE_BYTE( color.r() ); + WRITE_BYTE( color.g() ); + WRITE_BYTE( color.b() ); + WRITE_STRING( text ); + MessageEnd(); +} + + +//------------------------------------------------------------------------------------------------- +// HudMessagePanel helper +void UTIL_MessageText( CBasePlayer *player, const char *text, Color color ) +{ + CSingleUserRecipientFilter filter( player ); + filter.MakeReliable(); + UserMessageBegin( filter, "MessageText" ); + WRITE_BYTE( color.r() ); + WRITE_BYTE( color.g() ); + WRITE_BYTE( color.b() ); + WRITE_STRING( text ); + MessageEnd(); +} + + +//------------------------------------------------------------------------------------------------- +// HudMessagePanel helper +void UTIL_ResetMessageTextAll( void ) +{ + CReliableBroadcastRecipientFilter filter; + UserMessageBegin( filter, "MessageText" ); + MessageEnd(); +} + + +//------------------------------------------------------------------------------------------------- +// HudMessagePanel helper +void UTIL_ResetMessageText( CBasePlayer *player ) +{ + CSingleUserRecipientFilter filter( player ); + filter.MakeReliable(); + UserMessageBegin( filter, "MessageText" ); + MessageEnd(); +} + + // So we always return a valid surface static csurface_t g_NullSurface = { "**empty**", 0 }; @@ -1296,7 +1372,7 @@ void UTIL_SetOrigin( CBaseEntity *entity, const Vector &vecOrigin, bool bFireTri } -void UTIL_ParticleEffect( const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount ) +void UTIL_ParticleEffect( const Vector &vecOrigin, const Vector &vecDirection, uint32 ulColor, int ulCount ) { Msg( "UTIL_ParticleEffect: Disabled\n" ); } @@ -1387,7 +1463,7 @@ Vector UTIL_RandomBloodVector( void ) // Input : // Output : //------------------------------------------------------------------------------ -void UTIL_ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName ) +void UTIL_ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ) { CBaseEntity *pEntity = pTrace->m_pEnt; @@ -1506,18 +1582,18 @@ float UTIL_WaterLevel( const Vector &position, float minz, float maxz ) Vector midUp = position; midUp.z = minz; - if ( !(UTIL_PointContents(midUp) & MASK_WATER) ) + if ( !(UTIL_PointContents(midUp, MASK_WATER) & MASK_WATER) ) return minz; midUp.z = maxz; - if ( UTIL_PointContents(midUp) & MASK_WATER ) + if ( UTIL_PointContents(midUp, MASK_WATER) & MASK_WATER ) return maxz; float diff = maxz - minz; while (diff > 1.0) { midUp.z = minz + diff/2.0; - if ( UTIL_PointContents(midUp) & MASK_WATER ) + if ( UTIL_PointContents(midUp, MASK_WATER) & MASK_WATER ) { minz = midUp.z; } @@ -1571,7 +1647,7 @@ float UTIL_FindWaterSurface( const Vector &position, float minz, float maxz ) } -extern short g_sModelIndexBubbles;// holds the index for the bubbles model +extern int g_sModelIndexBubbles;// holds the index for the bubbles model void UTIL_Bubbles( const Vector& mins, const Vector& maxs, int count ) { @@ -1766,8 +1842,11 @@ void UTIL_PrecacheOther( const char *szClassname, const char *modelName ) // UTIL_LogPrintf - Prints a logged message to console. // Preceded by LOG: ( timestamp ) < message > //========================================================= -void UTIL_LogPrintf( const char *fmt, ... ) +void UTIL_LogPrintf( char *fmt, ... ) { + if ( !g_bIsLogging ) + return; + va_list argptr; char tempString[1024]; @@ -1842,7 +1921,7 @@ extern "C" void Sys_Error( char *error, ... ) // *mapData - pointer a block of entity map data // Output : -1 if the entity was not successfully created; 0 on success //----------------------------------------------------------------------------- -int DispatchSpawn( CBaseEntity *pEntity ) +int DispatchSpawn( CBaseEntity *pEntity, bool bRunVScripts ) { if ( pEntity ) { @@ -1857,6 +1936,13 @@ int DispatchSpawn( CBaseEntity *pEntity ) //pEntity->SetAbsMins( pEntity->GetOrigin() - Vector(1,1,1) ); //pEntity->SetAbsMaxs( pEntity->GetOrigin() + Vector(1,1,1) ); + + if( bRunVScripts ) + { + pEntity->RunVScripts(); + pEntity->RunPrecacheScripts(); + } + #if defined(TRACK_ENTITY_MEMORY) && defined(USE_MEM_DEBUG) const char *pszClassname = NULL; int iClassname = ((CEntityFactoryDictionary*)EntityFactoryDictionary())->m_Factories.Find( pEntity->GetClassname() ); @@ -1922,6 +2008,12 @@ int DispatchSpawn( CBaseEntity *pEntity ) } gEntList.NotifySpawn( pEntity ); + + if( bRunVScripts ) + { + pEntity->RunOnPostSpawnScripts(); + } + } return 0; @@ -2106,7 +2198,7 @@ static int UTIL_GetNewCheckClient( int check ) i = 1; } - ent = engine->PEntityOfEntIndex( i ); + ent = INDEXENT( i ); if ( !ent ) continue; @@ -2148,6 +2240,8 @@ static int UTIL_GetNewCheckClient( int check ) { g_CheckClient.m_checkCluster = clusterIndex; engine->GetPVSForCluster( clusterIndex, sizeof(g_CheckClient.m_checkPVS), g_CheckClient.m_checkPVS ); + + } } @@ -2171,7 +2265,7 @@ static edict_t *UTIL_GetCurrentCheckClient() } // return check if it might be visible - ent = engine->PEntityOfEntIndex( g_CheckClient.m_lastcheck ); + ent = INDEXENT( g_CheckClient.m_lastcheck ); // Allow dead clients -- JAY // Our monsters know the difference, and this function gates alot of behavior @@ -2185,11 +2279,13 @@ static edict_t *UTIL_GetCurrentCheckClient() return ent; } + + void UTIL_SetClientVisibilityPVS( edict_t *pClient, const unsigned char *pvs, int pvssize ) { if ( pClient == UTIL_GetCurrentCheckClient() ) { - Assert( pvssize <= (int)sizeof(g_CheckClient.m_checkVisibilityPVS) ); + Assert( pvssize <= sizeof(g_CheckClient.m_checkVisibilityPVS) ); g_CheckClient.m_bClientPVSIsExpanded = false; @@ -2262,7 +2358,7 @@ CBaseEntity *UTIL_FindClientInPVS( const Vector &vecBoxMins, const Vector &vecBo //----------------------------------------------------------------------------- ConVar sv_strict_notarget( "sv_strict_notarget", "0", 0, "If set, notarget will cause entities to never think they are in the pvs" ); -static edict_t *UTIL_FindClientInPVSGuts(edict_t *pEdict, unsigned char *pvs, unsigned pvssize ) +edict_t *UTIL_FindClientInPVSGuts(edict_t *pEdict, unsigned char *pvs, unsigned pvssize ) { Vector view; @@ -2301,7 +2397,7 @@ static edict_t *UTIL_FindClientInPVSGuts(edict_t *pEdict, unsigned char *pvs, un edict_t *UTIL_FindClientInPVS(edict_t *pEdict) { - return UTIL_FindClientInPVSGuts( pEdict, g_CheckClient.m_checkPVS, sizeof( g_CheckClient.m_checkPVS ) ); + return g_pGameRules->DoFindClientInPVS( pEdict, g_CheckClient.m_checkPVS, sizeof( g_CheckClient.m_checkPVS ) ); } //----------------------------------------------------------------------------- @@ -2309,7 +2405,7 @@ edict_t *UTIL_FindClientInPVS(edict_t *pEdict) //----------------------------------------------------------------------------- edict_t *UTIL_FindClientInVisibilityPVS( edict_t *pEdict ) { - return UTIL_FindClientInPVSGuts( pEdict, g_CheckClient.m_checkVisibilityPVS, sizeof( g_CheckClient.m_checkVisibilityPVS ) ); + return g_pGameRules->DoFindClientInPVS( pEdict, g_CheckClient.m_checkVisibilityPVS, sizeof( g_CheckClient.m_checkVisibilityPVS ) ); } @@ -2327,6 +2423,7 @@ CBaseEntity *UTIL_EntitiesInPVS( CBaseEntity *pPVSEntity, CBaseEntity *pStarting Vector org; static byte pvs[ MAX_MAP_CLUSTERS/8 ]; static Vector lastOrg( 0, 0, 0 ); + static int lastCluster = -1; if ( !pPVSEntity ) return NULL; @@ -2689,7 +2786,7 @@ bool UTIL_LoadAndSpawnEntitiesFromScript( CUtlVector &entities, c { KeyValues *pkvFile = new KeyValues( pBlock ); - if ( pkvFile->LoadFromFile( filesystem, pScriptFile, "MOD" ) ) + if ( pkvFile->LoadFromFile( filesystem, pScriptFile, "GAME" ) ) { // Load each block, and spawn the entities KeyValues *pkvNode = pkvFile->GetFirstSubKey(); @@ -2861,6 +2958,84 @@ void UTIL_BoundToWorldSize( Vector *pVecPos ) } } +//-------------------------------------------------------------------------------------------------------- +/** + * Return true if ground is fairly level within the given radius around an entity + * Trace 4 vertical hull-quadrants and test their collisions and ground heights and normals + */ +bool UTIL_IsGroundLevel( float radius, const Vector &position, float hullHeight, int mask, const CBaseEntity *ignore, bool debugTraces ) +{ + const int subdivisions = 3; + const int samples = subdivisions * subdivisions; + + // trace down below floor level to detect ledges and overhangs + trace_t result[ samples ]; + float size = 2.0f * radius / subdivisions; + + int i, j, s = 0; + float x, y = -radius; + for( j=0; jGetCrouchHullHeight() ), GetPosition() + Vector( 0, 0, -100 ), Vector( -radius, -radius, 0 ), Vector( 0, 0, 10.0f ), MASK_ZOMBIESOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &result[0] ); +// UTIL_TraceHull( GetPosition() + Vector( 0, 0, body->GetCrouchHullHeight() ), GetPosition() + Vector( 0, 0, -100 ), Vector( -radius, 0, 0 ), Vector( 0, radius, 10.0f ), MASK_ZOMBIESOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &result[1] ); +// UTIL_TraceHull( GetPosition() + Vector( 0, 0, body->GetCrouchHullHeight() ), GetPosition() + Vector( 0, 0, -100 ), Vector( 0, 0, 0 ), Vector( radius, radius, 10.0f ), MASK_ZOMBIESOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &result[2] ); +// UTIL_TraceHull( GetPosition() + Vector( 0, 0, body->GetCrouchHullHeight() ), GetPosition() + Vector( 0, 0, -100 ), Vector( 0, -radius, 0 ), Vector( radius, 0, 10.0f ), MASK_ZOMBIESOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &result[3] ); + + for( i=0; i maxZDelta ) + { + return false; + } + } + } + } + + return true; +} //============================================================================= // // Tests! @@ -3225,7 +3400,7 @@ void CC_CollisionTest( const CCommand &args ) int nMask = MASK_ALL & ~(CONTENTS_MONSTER | CONTENTS_HITBOX ); for ( int j = 0; j < 2; j++ ) { - float startTime = engine->Time(); + float startTime = Plat_FloatTime(); if ( testType == 1 ) { trace_t tr; @@ -3255,7 +3430,7 @@ void CC_CollisionTest( const CCommand &args ) } } - duration += engine->Time() - startTime; + duration += Plat_FloatTime() - startTime; } test[testType] = duration; Msg("%d collisions in %.2f ms (%u dots)\n", NUM_COLLISION_TESTS, duration*1000, dots ); diff --git a/game/server/util.h b/game/server/util.h index 330cd97c9..9784c562d 100644 --- a/game/server/util.h +++ b/game/server/util.h @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: Misc utility code. // @@ -45,13 +45,13 @@ class IEntityFactory; #include "tier0/memdbgon.h" -CBaseEntity *CreateEntityByName(const char *className, int iForceEdictIndex); // entity creation // creates an entity that has not been linked to a classname template< class T > T *_CreateEntityTemplate( T *newEnt, const char *className ) { + MEM_ALLOC_CREDIT_("Entities"); newEnt = new T; // this is the only place 'new' should be used! newEnt->PostConstructor( className ); return newEnt; @@ -59,24 +59,6 @@ T *_CreateEntityTemplate( T *newEnt, const char *className ) #include "tier0/memdbgoff.h" -// creates an entity by name, and ensure it's correctness -// does not spawn the entity -// use the CREATE_ENTITY() macro which wraps this, instead of using it directly -template< class T > -T *_CreateEntity( T *newClass, const char *className ) -{ - T *newEnt = dynamic_cast( CreateEntityByName(className, -1) ); - if ( !newEnt ) - { - Warning( "classname %s used to create wrong class type\n" ); - Assert(0); - } - - return newEnt; -} - -#define CREATE_ENTITY( newClass, className ) _CreateEntity( (newClass*)NULL, className ) -#define CREATE_UNSAVED_ENTITY( newClass, className ) _CreateEntityTemplate( (newClass*)NULL, className ) // This is the glue that hooks .MAP entity class names to our CPP classes @@ -142,18 +124,28 @@ class CEntityFactory : public IEntityFactory // Conversion among the three types of "entity", including identity-conversions. // extern CGlobalVars *gpGlobals; -inline int ENTINDEX( edict_t *pEdict) +extern bool g_bIsLogging; + +inline int ENTINDEX( edict_t *pEdict ) { - return (int)(pEdict - gpGlobals->pEdicts); + if ( !pEdict ) + return 0; + int edictIndex = pEdict - gpGlobals->pEdicts; + Assert( edictIndex < MAX_EDICTS && edictIndex >= 0 ); + return edictIndex; } int ENTINDEX( CBaseEntity *pEnt ); inline edict_t* INDEXENT( int iEdictNum ) -{ - if (iEdictNum >= 0 && iEdictNum < gpGlobals->maxEntities) +{ + Assert(iEdictNum>=0 && iEdictNum < MAX_EDICTS); + if ( gpGlobals->pEdicts ) { - return (edict_t *)(gpGlobals->pEdicts + iEdictNum); + edict_t *pEdict = gpGlobals->pEdicts + iEdictNum; + if ( pEdict->IsFree() ) + return NULL; + return pEdict; } return NULL; } @@ -173,8 +165,6 @@ inline bool FNullEnt(const edict_t* pent) class CBaseEntity; class CBasePlayer; -extern CGlobalVars *gpGlobals; - // Misc useful inline bool FStrEq(const char *sz1, const char *sz2) { @@ -222,6 +212,23 @@ CBasePlayer* UTIL_GetLocalPlayer( void ); // get the local player on a listen server CBasePlayer *UTIL_GetListenServerHost( void ); +// Convenience function so we don't have to make this check all over +inline CBasePlayer * UTIL_GetLocalPlayerOrListenServerHost( void ) +{ + if ( gpGlobals->maxClients > 1 ) + { + if ( engine->IsDedicatedServer() ) + { + return NULL; + } + + return UTIL_GetListenServerHost(); + } + + return UTIL_GetLocalPlayer(); +} + + CBasePlayer* UTIL_PlayerByUserId( int userID ); CBasePlayer* UTIL_PlayerByName( const char *name ); // not case sensitive @@ -236,40 +243,20 @@ void UTIL_GetPlayerConnectionInfo( int playerIndex, int& ping, int &packetloss void UTIL_SetClientVisibilityPVS( edict_t *pClient, const unsigned char *pvs, int pvssize ); bool UTIL_ClientPVSIsExpanded(); + + edict_t *UTIL_FindClientInPVS( edict_t *pEdict ); edict_t *UTIL_FindClientInVisibilityPVS( edict_t *pEdict ); +edict_t *UTIL_FindClientInPVSGuts(edict_t *pEdict, unsigned char *pvs, unsigned pvssize ); + // This is a version which finds any clients whose PVS intersects the box CBaseEntity *UTIL_FindClientInPVS( const Vector &vecBoxMins, const Vector &vecBoxMaxs ); CBaseEntity *UTIL_EntitiesInPVS( CBaseEntity *pPVSEntity, CBaseEntity *pStartingEntity ); -//----------------------------------------------------------------------------- -// class CFlaggedEntitiesEnum -//----------------------------------------------------------------------------- -// enumerate entities that match a set of edict flags into a static array -class CFlaggedEntitiesEnum : public IPartitionEnumerator -{ -public: - CFlaggedEntitiesEnum( CBaseEntity **pList, int listMax, int flagMask ); - - // This gets called by the enumeration methods with each element - // that passes the test. - virtual IterationRetval_t EnumElement( IHandleEntity *pHandleEntity ); - - int GetCount() { return m_count; } - bool AddToList( CBaseEntity *pEntity ); - -private: - CBaseEntity **m_pList; - int m_listMax; - int m_flagMask; - int m_count; -}; - // Pass in an array of pointers and an array size, it fills the array and returns the number inserted int UTIL_EntitiesInBox( const Vector &mins, const Vector &maxs, CFlaggedEntitiesEnum *pEnum ); -int UTIL_EntitiesAlongRay( const Ray_t &ray, CFlaggedEntitiesEnum *pEnum ); int UTIL_EntitiesInSphere( const Vector ¢er, float radius, CFlaggedEntitiesEnum *pEnum ); inline int UTIL_EntitiesInBox( CBaseEntity **pList, int listMax, const Vector &mins, const Vector &maxs, int flagMask ) @@ -278,12 +265,6 @@ inline int UTIL_EntitiesInBox( CBaseEntity **pList, int listMax, const Vector &m return UTIL_EntitiesInBox( mins, maxs, &boxEnum ); } -inline int UTIL_EntitiesAlongRay( CBaseEntity **pList, int listMax, const Ray_t &ray, int flagMask ) -{ - CFlaggedEntitiesEnum rayEnum( pList, listMax, flagMask ); - return UTIL_EntitiesAlongRay( ray, &rayEnum ); -} - inline int UTIL_EntitiesInSphere( CBaseEntity **pList, int listMax, const Vector ¢er, float radius, int flagMask ) { CFlaggedEntitiesEnum sphereEnum( pList, listMax, flagMask ); @@ -327,9 +308,10 @@ bool UTIL_CheckBottom( CBaseEntity *pEntity, ITraceFilter *pTraceFilter, float void UTIL_SetOrigin ( CBaseEntity *entity, const Vector &vecOrigin, bool bFireTriggers = false ); void UTIL_EmitAmbientSound ( int entindex, const Vector &vecOrigin, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float soundtime = 0.0f, float *duration = NULL ); -void UTIL_ParticleEffect ( const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount ); -void UTIL_ScreenShake ( const Vector ¢er, float amplitude, float frequency, float duration, float radius, ShakeCommand_t eCommand, bool bAirShake=false ); +void UTIL_ParticleEffect ( const Vector &vecOrigin, const Vector &vecDirection, uint32 ulColor, int ulCount ); +void UTIL_ScreenShake ( const Vector ¢er, float amplitude, float frequency, float duration, float radius, ShakeCommand_t eCommand, bool bAirShake = false, CUtlVector *ignore = NULL ); void UTIL_ScreenShakeObject ( CBaseEntity *pEnt, const Vector ¢er, float amplitude, float frequency, float duration, float radius, ShakeCommand_t eCommand, bool bAirShake=false ); +void UTIL_ScreenTilt ( const Vector ¢er, const QAngle &tiltAngle, float duration, float radius, float tiltTime, ShakeCommand_t eCommand, bool bEaseInOut ); void UTIL_ViewPunch ( const Vector ¢er, QAngle angPunch, float radius, bool bInAir ); void UTIL_ShowMessage ( const char *pString, CBasePlayer *pPlayer ); void UTIL_ShowMessageAll ( const char *pString ); @@ -343,8 +325,9 @@ int UTIL_EntityInSolid( CBaseEntity *ent ); bool UTIL_IsMasterTriggered (string_t sMaster, CBaseEntity *pActivator); void UTIL_BloodStream( const Vector &origin, const Vector &direction, int color, int amount ); void UTIL_BloodSpray( const Vector &pos, const Vector &dir, int color, int amount, int flags ); +void UTIL_BloodSprayPrecache(); Vector UTIL_RandomBloodVector( void ); -void UTIL_ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName = NULL ); +void UTIL_ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName = NULL ); void UTIL_PlayerDecalTrace( trace_t *pTrace, int playernum ); void UTIL_Smoke( const Vector &origin, const float scale, const float framerate ); void UTIL_AxisStringToPointDir( Vector &start, Vector &dir, const char *pString ); @@ -466,7 +449,7 @@ void UTIL_HudMessage( CBasePlayer *pToPlayer, const hudtextparms_t &textparms, void UTIL_HudHintText( CBaseEntity *pEntity, const char *pMessage ); // Writes message to console with timestamp and FragLog header. -void UTIL_LogPrintf( const char *fmt, ... ); +void UTIL_LogPrintf( char *fmt, ... ); // Sorta like FInViewCone, but for nonNPCs. float UTIL_DotPoints ( const Vector &vecSrc, const Vector &vecCheck, const Vector &vecDir ); @@ -509,12 +492,11 @@ void DBG_AssertFunction(bool fExpr, const char* szExpr, const char* szFile, int #define SF_BRUSH_ROTATE_BACKWARDS 2 #define SF_BRUSH_ROTATE_Z_AXIS 4 #define SF_BRUSH_ROTATE_X_AXIS 8 -#define SF_BRUSH_ROTATE_CLIENTSIDE 16 - #define SF_BRUSH_ROTATE_SMALLRADIUS 128 #define SF_BRUSH_ROTATE_MEDIUMRADIUS 256 #define SF_BRUSH_ROTATE_LARGERADIUS 512 +#define SF_BRUSH_ROTATE_CLIENTSIDE 1024 #define PUSH_BLOCK_ONLY_X 1 #define PUSH_BLOCK_ONLY_Y 2 @@ -621,7 +603,6 @@ extern void *UTIL_FunctionFromName( datamap_t *pMap, const char *pName ); int UTIL_GetCommandClientIndex( void ); CBasePlayer *UTIL_GetCommandClient( void ); -bool UTIL_GetModDir( char *lpszTextOut, unsigned int nSize ); AngularImpulse WorldToLocalRotation( const VMatrix &localToWorld, const Vector &worldAxis, float rotation ); void UTIL_WorldToParentSpace( CBaseEntity *pEntity, Vector &vecPosition, QAngle &vecAngles ); @@ -631,6 +612,19 @@ void UTIL_ParentToWorldSpace( CBaseEntity *pEntity, Vector &vecPosition, Quatern bool UTIL_LoadAndSpawnEntitiesFromScript( CUtlVector &entities, const char *pScriptFile, const char *pBlock, bool bActivate = true ); +// HudMessagePanel helpers +void UTIL_MessageTextAll( const char *text, Color color = Color( 0, 0, 0, 0 ) ); // Send a HudMessagePanel string to clients +void UTIL_MessageText( CBasePlayer *player, const char *text, Color color = Color( 0, 0, 0, 0 ) ); // Send a HudMessagePanel string to a client +void UTIL_ResetMessageTextAll( void ); // Reset clients' HudMessagePanel +void UTIL_ResetMessageText( CBasePlayer *player ); // Reset a client's HudMessagePanel + +//-------------------------------------------------------------------------------------------------------- +/** + * Return true if ground is fairly level within the given radius around an entity + * Trace 4 vertical hull-quadrants and test their collisions and ground heights and normals + */ +bool UTIL_IsGroundLevel( float radius, const Vector &position, float hullHeight, int mask, const CBaseEntity *ignore, bool debugTraces = false ); + // Given a vector, clamps the scalar axes to MAX_COORD_FLOAT ranges from worldsize.h void UTIL_BoundToWorldSize( Vector *pVecPos ); diff --git a/game/shared/activitylist.cpp b/game/shared/activitylist.cpp index 266cd922b..b8e00c49c 100644 --- a/game/shared/activitylist.cpp +++ b/game/shared/activitylist.cpp @@ -94,7 +94,7 @@ static activitylist_t *ListFromString( const char *pString ) static activitylist_t *ListFromActivity( int activityIndex ) { // ugly linear search - for ( int i = 0; i < g_ActivityList.Size(); i++ ) + for ( int i = 0; i < g_ActivityList.Count(); i++ ) { if ( g_ActivityList[i].activityIndex == activityIndex ) { @@ -239,6 +239,8 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_CROUCHIDLE ); REGISTER_SHARED_ACTIVITY( ACT_STAND ); REGISTER_SHARED_ACTIVITY( ACT_USE ); + REGISTER_SHARED_ACTIVITY( ACT_ALIEN_BURROW_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_ALIEN_BURROW_OUT ); REGISTER_SHARED_ACTIVITY( ACT_SIGNAL1 ); REGISTER_SHARED_ACTIVITY( ACT_SIGNAL2 ); REGISTER_SHARED_ACTIVITY( ACT_SIGNAL3 ); @@ -330,6 +332,14 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_FLINCH_RIGHTLEG ); REGISTER_SHARED_ACTIVITY( ACT_FLINCH_PHYSICS ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_HEAD_BACK ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_CHEST_BACK ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_STOMACH_BACK ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_CROUCH_FRONT ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_CROUCH_BACK ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_CROUCH_LEFT ); + REGISTER_SHARED_ACTIVITY( ACT_FLINCH_CROUCH_RIGHT ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_ON_FIRE ); REGISTER_SHARED_ACTIVITY( ACT_WALK_ON_FIRE ); REGISTER_SHARED_ACTIVITY( ACT_RUN_ON_FIRE ); @@ -385,6 +395,7 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_BARNACLE_CHEW ); REGISTER_SHARED_ACTIVITY( ACT_DO_NOT_DISTURB ); + REGISTER_SHARED_ACTIVITY( ACT_SPECIFIC_SEQUENCE ); // Viewmodel activities may belong elsewhere, but since where is unclear right now, // they'll be placed here. @@ -737,46 +748,13 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_DEPLOY_IDLE ); REGISTER_SHARED_ACTIVITY( ACT_UNDEPLOY ); -//=========================== -// HL1 Specific Activities -//=========================== - - // Grenades - REGISTER_SHARED_ACTIVITY( ACT_GRENADE_ROLL ); - REGISTER_SHARED_ACTIVITY( ACT_GRENADE_TOSS ); - - // Hand grenade - REGISTER_SHARED_ACTIVITY( ACT_HANDGRENADE_THROW1 ); - REGISTER_SHARED_ACTIVITY( ACT_HANDGRENADE_THROW2 ); - REGISTER_SHARED_ACTIVITY( ACT_HANDGRENADE_THROW3 ); - - // Shotgun - REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_IDLE_DEEP ); - REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_IDLE4 ); - - // Glock - REGISTER_SHARED_ACTIVITY( ACT_GLOCK_SHOOTEMPTY ); - REGISTER_SHARED_ACTIVITY( ACT_GLOCK_SHOOT_RELOAD ); - - // RPG - REGISTER_SHARED_ACTIVITY( ACT_RPG_DRAW_UNLOADED ); - REGISTER_SHARED_ACTIVITY( ACT_RPG_HOLSTER_UNLOADED ); - REGISTER_SHARED_ACTIVITY( ACT_RPG_IDLE_UNLOADED ); - REGISTER_SHARED_ACTIVITY( ACT_RPG_FIDGET_UNLOADED ); - // Crossbow REGISTER_SHARED_ACTIVITY( ACT_CROSSBOW_DRAW_UNLOADED ); - REGISTER_SHARED_ACTIVITY( ACT_CROSSBOW_IDLE_UNLOADED ); - REGISTER_SHARED_ACTIVITY( ACT_CROSSBOW_FIDGET_UNLOADED ); // Gauss REGISTER_SHARED_ACTIVITY( ACT_GAUSS_SPINUP ); REGISTER_SHARED_ACTIVITY( ACT_GAUSS_SPINCYCLE ); - // Tripmine - REGISTER_SHARED_ACTIVITY( ACT_TRIPMINE_GROUND ); - REGISTER_SHARED_ACTIVITY( ACT_TRIPMINE_WORLD ); - //=========================== // CSPort Specific Activities //=========================== @@ -789,6 +767,12 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_EMPTY_LEFT ); REGISTER_SHARED_ACTIVITY ( ACT_VM_DRYFIRE_LEFT ); + + // new for CS2 + REGISTER_SHARED_ACTIVITY ( ACT_VM_IS_DRAW ); + REGISTER_SHARED_ACTIVITY ( ACT_VM_IS_HOLSTER ); + REGISTER_SHARED_ACTIVITY ( ACT_VM_IS_IDLE ); + REGISTER_SHARED_ACTIVITY ( ACT_VM_IS_PRIMARYATTACK ); REGISTER_SHARED_ACTIVITY ( ACT_PLAYER_IDLE_FIRE ); REGISTER_SHARED_ACTIVITY ( ACT_PLAYER_CROUCH_FIRE ); @@ -798,668 +782,8 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY ( ACT_IDLETORUN ); REGISTER_SHARED_ACTIVITY ( ACT_RUNTOIDLE ); -//=========================== -// DoD Specific Activities -//=========================== - - REGISTER_SHARED_ACTIVITY ( ACT_SPRINT ); - - // To get in and out of prone state. - REGISTER_SHARED_ACTIVITY ( ACT_GET_DOWN_STAND ); - REGISTER_SHARED_ACTIVITY ( ACT_GET_UP_STAND ); - REGISTER_SHARED_ACTIVITY ( ACT_GET_DOWN_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_GET_UP_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_PRONE_FORWARD ); - REGISTER_SHARED_ACTIVITY ( ACT_PRONE_IDLE ); - - REGISTER_SHARED_ACTIVITY ( ACT_DEEPIDLE1 ); - REGISTER_SHARED_ACTIVITY ( ACT_DEEPIDLE2 ); - REGISTER_SHARED_ACTIVITY ( ACT_DEEPIDLE3 ); - REGISTER_SHARED_ACTIVITY ( ACT_DEEPIDLE4 ); - - REGISTER_SHARED_ACTIVITY ( ACT_VM_RELOAD_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_RELOAD_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DRAW_DEPLOYED ); - //Weapon is empty activities - REGISTER_SHARED_ACTIVITY ( ACT_VM_DRAW_EMPTY ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_EMPTY ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_RELOAD_EMPTY ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_EMPTY ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_EMPTY ); - - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_8 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_7 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_6 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_5 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_4 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_3 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_2 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_1 ); - - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_8 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_7 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_6 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_5 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_4 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_3 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_2 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_IDLE_DEPLOYED_1 ); - - // Animation from prone idle to standing/crouch idle. Number designates bullets left - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_8 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_7 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_6 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_5 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_4 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_3 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_2 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_1 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_UNDEPLOY_EMPTY ); - - // Animation from standing/crouch idle to prone idle. Number designates bullets left - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_8 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_7 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_6 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_5 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_4 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_3 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_2 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_1 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_DEPLOY_EMPTY ); - - // Shooting animations for standing/crouch position. Number designates bullets left at START of animation - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_8 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_7 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_6 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_5 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_4 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_3 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_2 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_1 ); - - // Shooting animations for prone position. Number designates bullets left at START of animation - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_8 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_7 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_6 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_5 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_4 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_3 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_2 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_1 ); - REGISTER_SHARED_ACTIVITY ( ACT_VM_PRIMARYATTACK_DEPLOYED_EMPTY ); - - // Player anim ACTs - - // Base activities, we translate from these - REGISTER_SHARED_ACTIVITY ( ACT_DOD_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_IDLE_ZOOMED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_ZOOMED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_ZOOMED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_ZOOMED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOMED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_FORWARD_ZOOMED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_DEPLOYED ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_PRONE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM ); - - // Positions - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_PISTOL ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_C96 ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_RIFLE ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_BOLT ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_TOMMY ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_MP40 ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_MP44 ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_GREASE ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_MG ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_30CAL ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_AIM_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_AIM_GREN_FRAG ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_AIM_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_AIM_GREN_STICK ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_AIM_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_AIM_KNIFE ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_AIM_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_AIM_SPADE ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_BAZOOKA ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_PSCHRECK ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_AIM_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_AIM_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_AIM_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_AIM_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_AIM_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_AIM_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_BAR ); - - // ZOom - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_ZOOM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_ZOOM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_ZOOM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_ZOOM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_ZOOM_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_RIFLE ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_ZOOM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_ZOOM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_ZOOM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_ZOOM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_ZOOM_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_BOLT ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_ZOOM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_ZOOM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_ZOOM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_ZOOM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_ZOOM_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_BAZOOKA ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_ZOOM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_ZOOM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_ZOOM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_ZOOM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_ZOOM_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_PSCHRECK ); - - // Deployed Aim - REGISTER_SHARED_ACTIVITY ( ACT_DOD_DEPLOY_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_DEPLOY_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_DEPLOY_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_DEPLOY_30CAL ); - - // Prone Deployed Aim - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_DEPLOY_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_DEPLOY_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_DEPLOY_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_DEPLOY_30CAL ); - - // Attacks - - // Rifle - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_PRONE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_DEPLOYED_RIFLE ); - - // Bolt - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_PRONE_BOLT ); - - // Tommy - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_PRONE_TOMMY ); - - // MP40 - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_PRONE_MP40 ); - - // MP44 - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_MP44 ); - - // Greasegun - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_GREASE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_GREASE ); - - // Pistols (Colt, Luger) - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_C96 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_C96 ); - - // Mgs (mg42, mg34) - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_DEPLOYED_MG ); - - // 30cal - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_DEPLOYED_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_30CAL ); - - // Grenades - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_GREN_STICK ); - - // Knife - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_KNIFE ); - - // Spade - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_SPADE ); - - // Bazooka - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_BAZOOKA ); - - // Pschreck - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_PSCHRECK ); - - // Bar - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_PRONE_BAR ); - - // Reloads - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_GARAND ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_K43 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_M1CARBINE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_GREASEGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_FG42 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_RIFLEGRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_C96 ); - - // Crouch - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_RIFLEGRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_M1CARBINE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_CROUCH_C96 ); - - // Bazookas - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_ZOOMLOAD_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_ZOOMLOAD_PSCHRECK ); - - // Deployed - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_DEPLOYED_FG42 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_DEPLOYED_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_DEPLOYED_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_DEPLOYED_MG34 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_DEPLOYED_BAR ); - - // Prone - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_GARAND ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_M1CARBINE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_K43 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_MP40 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_GREASEGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_FG42 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_RIFLEGRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_C96 ); - - // Prone bazooka - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_ZOOMLOAD_PRONE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_ZOOMLOAD_PRONE_PSCHRECK ); - - // Prone deployed - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_DEPLOYED_BAR ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_DEPLOYED_FG42 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_DEPLOYED_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_DEPLOYED_MG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RELOAD_PRONE_DEPLOYED_MG34 ); - - // Prone zoomed aim - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_FORWARD_RIFLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_FORWARD_BOLT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_FORWARD_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONE_ZOOM_FORWARD_PSCHRECK ); - - // Crouch attack. - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_CROUCH_SPADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_CROUCH_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_CROUCH_GREN_FRAG ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRIMARYATTACK_CROUCH_GREN_STICK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_CROUCH_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SECONDARYATTACK_CROUCH_MP40 ); - - // Hand Signals - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_MG42 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_STICKGRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_IDLE_K98 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_30CAL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_BAZOOKA ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_PSCHRECK ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_KNIFE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_MG42 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_STICKGRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_TOMMY ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_MP44 ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_HS_CROUCH_K98 ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_STAND_IDLE_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCH_IDLE_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_CROUCHWALK_IDLE_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_WALK_IDLE_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_RUN_IDLE_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_SPRINT_IDLE_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PRONEWALK_IDLE_TNT ); - - REGISTER_SHARED_ACTIVITY ( ACT_DOD_PLANT_TNT ); - REGISTER_SHARED_ACTIVITY ( ACT_DOD_DEFUSE_TNT ); - -//HL2MP - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_PISTOL ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_PISTOL ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_SMG1 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_SMG1 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_SMG1 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_SMG1 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_SMG1 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_SMG1 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_SMG1 ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_AR2 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_AR2 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_AR2 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_AR2 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_AR2 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_AR2 ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_AR2 ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_SHOTGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_SHOTGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_SHOTGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_SHOTGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_SHOTGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_SHOTGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_SHOTGUN ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_RPG ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_RPG ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_RPG ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_RPG ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_RPG ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_RPG ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_RPG ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_GRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_GRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_GRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_GRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_GRENADE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_GRENADE ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_PHYSGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_PHYSGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_PHYSGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_PHYSGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_PHYSGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_PHYSGUN ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_PHYSGUN ); - - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_CROSSBOW ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_MELEE ); REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_MELEE ); REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_MELEE ); @@ -1468,14 +792,6 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_MELEE ); REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_MELEE ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_SLAM ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_RUN_SLAM ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_IDLE_CROUCH_SLAM ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_WALK_CROUCH_SLAM ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RANGE_ATTACK_SLAM ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_GESTURE_RELOAD_SLAM ); - REGISTER_SHARED_ACTIVITY ( ACT_HL2MP_JUMP_SLAM ); - // Portal REGISTER_SHARED_ACTIVITY ( ACT_VM_FIZZLE ); @@ -1635,11 +951,53 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY ( ACT_MP_ATTACK_SWIM_GRENADE_MELEE ); REGISTER_SHARED_ACTIVITY ( ACT_MP_ATTACK_AIRWALK_GRENADE_MELEE ); + // Item1 + REGISTER_SHARED_ACTIVITY( ACT_MP_STAND_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_CROUCH_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_RUN_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_WALK_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_AIRWALK_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_CROUCHWALK_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_START_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_FLOAT_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_LAND_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_SWIM_ITEM1 ); + + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_STAND_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_STAND_ITEM1_SECONDARY ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_CROUCH_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_CROUCH_ITEM1_SECONDARY ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_SWIM_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_AIRWALK_ITEM1 ); + + // Item2 + REGISTER_SHARED_ACTIVITY( ACT_MP_STAND_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_CROUCH_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_RUN_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_WALK_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_AIRWALK_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_CROUCHWALK_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_START_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_FLOAT_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_JUMP_LAND_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_SWIM_ITEM2 ); + + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_STAND_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_STAND_ITEM2_SECONDARY ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_CROUCH_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_CROUCH_ITEM2_SECONDARY ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_SWIM_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_ATTACK_AIRWALK_ITEM2 ); + // Flinches REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_PRIMARY ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_SECONDARY ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_MELEE ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_ITEM2 ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_HEAD ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_FLINCH_CHEST ); @@ -1678,6 +1036,19 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY ( ACT_MP_MELEE_GRENADE2_IDLE ); REGISTER_SHARED_ACTIVITY ( ACT_MP_MELEE_GRENADE2_ATTACK ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM1_GRENADE1_DRAW ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM1_GRENADE1_IDLE ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM1_GRENADE1_ATTACK ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM1_GRENADE2_DRAW ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM1_GRENADE2_IDLE ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM1_GRENADE2_ATTACK ); + + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM2_GRENADE1_DRAW ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM2_GRENADE1_IDLE ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM2_GRENADE1_ATTACK ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM2_GRENADE2_DRAW ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM2_GRENADE2_IDLE ); + REGISTER_SHARED_ACTIVITY ( ACT_MP_ITEM2_GRENADE2_ATTACK ); // Building REGISTER_SHARED_ACTIVITY ( ACT_MP_STAND_BUILDING ); @@ -1746,6 +1117,20 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_NODYES_MELEE ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_NODNO_MELEE ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_HANDMOUTH_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_FINGERPOINT_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_FISTPUMP_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_THUMBSUP_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_NODYES_ITEM1 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_NODNO_ITEM1 ); + + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_HANDMOUTH_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_FINGERPOINT_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_FISTPUMP_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_THUMBSUP_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_NODYES_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_NODNO_ITEM2 ); + REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_HANDMOUTH_BUILDING ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_FINGERPOINT_BUILDING ); REGISTER_SHARED_ACTIVITY( ACT_MP_GESTURE_VC_FISTPUMP_BUILDING ); @@ -1812,6 +1197,78 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_PDA_VM_IDLE_LOWERED ); REGISTER_SHARED_ACTIVITY( ACT_PDA_VM_LOWERED_TO_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_DRAW ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_HOLSTER ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_PULLBACK ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_PRIMARYATTACK ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_SECONDARYATTACK ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_RELOAD ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_DRYFIRE ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_IDLE_TO_LOWERED ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_IDLE_LOWERED ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM1_VM_LOWERED_TO_IDLE ); + + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_DRAW ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_HOLSTER ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_PULLBACK ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_PRIMARYATTACK ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_SECONDARYATTACK ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_RELOAD ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_DRYFIRE ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_IDLE_TO_LOWERED ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_IDLE_LOWERED ); + REGISTER_SHARED_ACTIVITY( ACT_ITEM2_VM_LOWERED_TO_IDLE ); + + // infested + REGISTER_SHARED_ACTIVITY( ACT_RELOAD_SUCCEED ); + REGISTER_SHARED_ACTIVITY( ACT_RELOAD_FAIL ); + REGISTER_SHARED_ACTIVITY( ACT_WALK_AIM_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_RUN_AIM_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_AIM_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_RELOAD_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_CROUCH_IDLE_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_JUMP_AUTOGUN ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_AIM_PISTOL ); + REGISTER_SHARED_ACTIVITY( ACT_WALK_AIM_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_RUN_AIM_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_AIM_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_RELOAD_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_CROUCH_IDLE_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_JUMP_DUAL ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_SHOTGUN ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_AIM_SHOTGUN ); + REGISTER_SHARED_ACTIVITY( ACT_CROUCH_IDLE_SHOTGUN ); + REGISTER_SHARED_ACTIVITY( ACT_JUMP_SHOTGUN ); + REGISTER_SHARED_ACTIVITY( ACT_IDLE_AIM_RIFLE ); + REGISTER_SHARED_ACTIVITY( ACT_RELOAD_RIFLE ); + REGISTER_SHARED_ACTIVITY( ACT_CROUCH_IDLE_RIFLE ); + REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_RIFLE ); + REGISTER_SHARED_ACTIVITY( ACT_JUMP_RIFLE ); + // Infested General AI + REGISTER_SHARED_ACTIVITY( ACT_SLEEP ); + REGISTER_SHARED_ACTIVITY( ACT_WAKE ); + // Shield Bug + REGISTER_SHARED_ACTIVITY( ACT_FLICK_LEFT ); + REGISTER_SHARED_ACTIVITY( ACT_FLICK_LEFT_MIDDLE ); + REGISTER_SHARED_ACTIVITY( ACT_FLICK_RIGHT_MIDDLE ); + REGISTER_SHARED_ACTIVITY( ACT_FLICK_RIGHT ); + REGISTER_SHARED_ACTIVITY( ACT_SPINAROUND ); + // Mortar Bug + REGISTER_SHARED_ACTIVITY( ACT_PREP_TO_FIRE ); + REGISTER_SHARED_ACTIVITY( ACT_FIRE ); + REGISTER_SHARED_ACTIVITY( ACT_FIRE_RECOVER ); + // Shaman + REGISTER_SHARED_ACTIVITY( ACT_SPRAY ); + // Boomer + REGISTER_SHARED_ACTIVITY( ACT_PREP_EXPLODE ); + REGISTER_SHARED_ACTIVITY( ACT_EXPLODE ); + AssertMsg( g_HighestActivity == LAST_SHARED_ACTIVITY - 1, "Not all activities from ai_activity.h registered in activitylist.cpp" ); } @@ -1914,7 +1371,6 @@ void UTIL_LoadActivityRemapFile( const char *filename, const char *section, CUtl KeyValues *pRemapKey = pTestKey->GetFirstSubKey(); CActivityRemap actMap; - actMap.mappedActivity = ACT_IDLE; actMap.activity = ActBase; while ( pRemapKey ) diff --git a/game/shared/ai_activity.h b/game/shared/ai_activity.h index 71c7e77e7..ddfb415ec 100644 --- a/game/shared/ai_activity.h +++ b/game/shared/ai_activity.h @@ -64,6 +64,9 @@ typedef enum ACT_CROUCHIDLE, // FIXME: obsolete? only used be soldier (holding body in crouched position (loops)) ACT_STAND, // FIXME: obsolete? should be transition (the act of standing from a crouched position) ACT_USE, + ACT_ALIEN_BURROW_IDLE, + ACT_ALIEN_BURROW_OUT, + ACT_SIGNAL1, ACT_SIGNAL2, ACT_SIGNAL3, @@ -150,6 +153,13 @@ typedef enum ACT_FLINCH_LEFTLEG, ACT_FLINCH_RIGHTLEG, ACT_FLINCH_PHYSICS, + ACT_FLINCH_HEAD_BACK, + ACT_FLINCH_CHEST_BACK, + ACT_FLINCH_STOMACH_BACK, + ACT_FLINCH_CROUCH_FRONT, + ACT_FLINCH_CROUCH_BACK, + ACT_FLINCH_CROUCH_LEFT, + ACT_FLINCH_CROUCH_RIGHT, ACT_IDLE_ON_FIRE, // ON FIRE animations ACT_WALK_ON_FIRE, @@ -214,6 +224,8 @@ typedef enum // with the NPC's current sequence. (SJB) ACT_DO_NOT_DISTURB, + ACT_SPECIFIC_SEQUENCE, + // viewmodel (weapon) activities // FIXME: move these to the specific viewmodels, no need to make global ACT_VM_DRAW, @@ -570,45 +582,13 @@ typedef enum ACT_DEPLOY_IDLE, ACT_UNDEPLOY, -//=========================== -// HL1 Specific Activities -//=========================== - // Grenades - ACT_GRENADE_ROLL, - ACT_GRENADE_TOSS, - - // Hand grenade - ACT_HANDGRENADE_THROW1, - ACT_HANDGRENADE_THROW2, - ACT_HANDGRENADE_THROW3, - - // Shotgun - ACT_SHOTGUN_IDLE_DEEP, - ACT_SHOTGUN_IDLE4, - - // Glock - ACT_GLOCK_SHOOTEMPTY, - ACT_GLOCK_SHOOT_RELOAD, - - // RPG - ACT_RPG_DRAW_UNLOADED, - ACT_RPG_HOLSTER_UNLOADED, - ACT_RPG_IDLE_UNLOADED, - ACT_RPG_FIDGET_UNLOADED, - // Crossbow ACT_CROSSBOW_DRAW_UNLOADED, - ACT_CROSSBOW_IDLE_UNLOADED, - ACT_CROSSBOW_FIDGET_UNLOADED, // Gauss ACT_GAUSS_SPINUP, ACT_GAUSS_SPINCYCLE, - // Tripmine - ACT_TRIPMINE_GROUND, - ACT_TRIPMINE_WORLD, - //=========================== // CSPort Specific Activities //=========================== @@ -621,6 +601,12 @@ typedef enum ACT_VM_IDLE_EMPTY_LEFT, ACT_VM_DRYFIRE_LEFT, + // new for CS2 + ACT_VM_IS_DRAW, + ACT_VM_IS_HOLSTER, + ACT_VM_IS_IDLE, + ACT_VM_IS_PRIMARYATTACK, + ACT_PLAYER_IDLE_FIRE, ACT_PLAYER_CROUCH_FIRE, ACT_PLAYER_CROUCH_WALK_FIRE, @@ -630,664 +616,8 @@ typedef enum ACT_IDLETORUN, ACT_RUNTOIDLE, - -//=========================== -// DoD Specific Activities -//=========================== - ACT_SPRINT, - - ACT_GET_DOWN_STAND, - ACT_GET_UP_STAND, - ACT_GET_DOWN_CROUCH, - ACT_GET_UP_CROUCH, - ACT_PRONE_FORWARD, - ACT_PRONE_IDLE, - - ACT_DEEPIDLE1, - ACT_DEEPIDLE2, - ACT_DEEPIDLE3, - ACT_DEEPIDLE4, - - ACT_VM_RELOAD_DEPLOYED, - ACT_VM_RELOAD_IDLE, - ACT_VM_DRAW_DEPLOYED, - //Weapon is empty activities - ACT_VM_DRAW_EMPTY, - ACT_VM_PRIMARYATTACK_EMPTY, - ACT_VM_RELOAD_EMPTY, - ACT_VM_IDLE_EMPTY, - ACT_VM_IDLE_DEPLOYED_EMPTY, - - ACT_VM_IDLE_8, - ACT_VM_IDLE_7, - ACT_VM_IDLE_6, - ACT_VM_IDLE_5, - ACT_VM_IDLE_4, - ACT_VM_IDLE_3, - ACT_VM_IDLE_2, - ACT_VM_IDLE_1, - - ACT_VM_IDLE_DEPLOYED, - ACT_VM_IDLE_DEPLOYED_8, - ACT_VM_IDLE_DEPLOYED_7, - ACT_VM_IDLE_DEPLOYED_6, - ACT_VM_IDLE_DEPLOYED_5, - ACT_VM_IDLE_DEPLOYED_4, - ACT_VM_IDLE_DEPLOYED_3, - ACT_VM_IDLE_DEPLOYED_2, - ACT_VM_IDLE_DEPLOYED_1, - - // Animation from prone idle to standing/crouch idle. Number designates bullets left - ACT_VM_UNDEPLOY, - ACT_VM_UNDEPLOY_8, - ACT_VM_UNDEPLOY_7, - ACT_VM_UNDEPLOY_6, - ACT_VM_UNDEPLOY_5, - ACT_VM_UNDEPLOY_4, - ACT_VM_UNDEPLOY_3, - ACT_VM_UNDEPLOY_2, - ACT_VM_UNDEPLOY_1, - ACT_VM_UNDEPLOY_EMPTY, - - // Animation from standing/crouch idle to prone idle. Number designates bullets left - ACT_VM_DEPLOY, - ACT_VM_DEPLOY_8, - ACT_VM_DEPLOY_7, - ACT_VM_DEPLOY_6, - ACT_VM_DEPLOY_5, - ACT_VM_DEPLOY_4, - ACT_VM_DEPLOY_3, - ACT_VM_DEPLOY_2, - ACT_VM_DEPLOY_1, - ACT_VM_DEPLOY_EMPTY, - - // Shooting animations for standing/crouch position. Number designates bullets left at START of animation - ACT_VM_PRIMARYATTACK_8, - ACT_VM_PRIMARYATTACK_7, - ACT_VM_PRIMARYATTACK_6, - ACT_VM_PRIMARYATTACK_5, - ACT_VM_PRIMARYATTACK_4, - ACT_VM_PRIMARYATTACK_3, - ACT_VM_PRIMARYATTACK_2, - ACT_VM_PRIMARYATTACK_1, - - // Shooting animations for prone position. Number designates bullets left at START of animation - ACT_VM_PRIMARYATTACK_DEPLOYED, - ACT_VM_PRIMARYATTACK_DEPLOYED_8, - ACT_VM_PRIMARYATTACK_DEPLOYED_7, - ACT_VM_PRIMARYATTACK_DEPLOYED_6, - ACT_VM_PRIMARYATTACK_DEPLOYED_5, - ACT_VM_PRIMARYATTACK_DEPLOYED_4, - ACT_VM_PRIMARYATTACK_DEPLOYED_3, - ACT_VM_PRIMARYATTACK_DEPLOYED_2, - ACT_VM_PRIMARYATTACK_DEPLOYED_1, - ACT_VM_PRIMARYATTACK_DEPLOYED_EMPTY, - - // Player anim ACTs - ACT_DOD_DEPLOYED, - ACT_DOD_PRONE_DEPLOYED, - ACT_DOD_IDLE_ZOOMED, - ACT_DOD_WALK_ZOOMED, - ACT_DOD_CROUCH_ZOOMED, - ACT_DOD_CROUCHWALK_ZOOMED, - ACT_DOD_PRONE_ZOOMED, - ACT_DOD_PRONE_FORWARD_ZOOMED, - ACT_DOD_PRIMARYATTACK_DEPLOYED, - ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED, - ACT_DOD_RELOAD_DEPLOYED, - ACT_DOD_RELOAD_PRONE_DEPLOYED, - ACT_DOD_PRIMARYATTACK_PRONE, - ACT_DOD_SECONDARYATTACK_PRONE, - ACT_DOD_RELOAD_CROUCH, - ACT_DOD_RELOAD_PRONE, - ACT_DOD_STAND_IDLE, - ACT_DOD_STAND_AIM, - ACT_DOD_CROUCH_IDLE, - ACT_DOD_CROUCH_AIM, - ACT_DOD_CROUCHWALK_IDLE, - ACT_DOD_CROUCHWALK_AIM, - ACT_DOD_WALK_IDLE, - ACT_DOD_WALK_AIM, - ACT_DOD_RUN_IDLE, - ACT_DOD_RUN_AIM, - - // Positions - ACT_DOD_STAND_AIM_PISTOL, - ACT_DOD_CROUCH_AIM_PISTOL, - ACT_DOD_CROUCHWALK_AIM_PISTOL, - ACT_DOD_WALK_AIM_PISTOL, - ACT_DOD_RUN_AIM_PISTOL, - ACT_DOD_PRONE_AIM_PISTOL, - ACT_DOD_STAND_IDLE_PISTOL, - ACT_DOD_CROUCH_IDLE_PISTOL, - ACT_DOD_CROUCHWALK_IDLE_PISTOL, - ACT_DOD_WALK_IDLE_PISTOL, - ACT_DOD_RUN_IDLE_PISTOL, - ACT_DOD_SPRINT_IDLE_PISTOL, - ACT_DOD_PRONEWALK_IDLE_PISTOL, - - ACT_DOD_STAND_AIM_C96, - ACT_DOD_CROUCH_AIM_C96, - ACT_DOD_CROUCHWALK_AIM_C96, - ACT_DOD_WALK_AIM_C96, - ACT_DOD_RUN_AIM_C96, - ACT_DOD_PRONE_AIM_C96, - ACT_DOD_STAND_IDLE_C96, - ACT_DOD_CROUCH_IDLE_C96, - ACT_DOD_CROUCHWALK_IDLE_C96, - ACT_DOD_WALK_IDLE_C96, - ACT_DOD_RUN_IDLE_C96, - ACT_DOD_SPRINT_IDLE_C96, - ACT_DOD_PRONEWALK_IDLE_C96, - - ACT_DOD_STAND_AIM_RIFLE, - ACT_DOD_CROUCH_AIM_RIFLE, - ACT_DOD_CROUCHWALK_AIM_RIFLE, - ACT_DOD_WALK_AIM_RIFLE, - ACT_DOD_RUN_AIM_RIFLE, - ACT_DOD_PRONE_AIM_RIFLE, - ACT_DOD_STAND_IDLE_RIFLE, - ACT_DOD_CROUCH_IDLE_RIFLE, - ACT_DOD_CROUCHWALK_IDLE_RIFLE, - ACT_DOD_WALK_IDLE_RIFLE, - ACT_DOD_RUN_IDLE_RIFLE, - ACT_DOD_SPRINT_IDLE_RIFLE, - ACT_DOD_PRONEWALK_IDLE_RIFLE, - - ACT_DOD_STAND_AIM_BOLT, - ACT_DOD_CROUCH_AIM_BOLT, - ACT_DOD_CROUCHWALK_AIM_BOLT, - ACT_DOD_WALK_AIM_BOLT, - ACT_DOD_RUN_AIM_BOLT, - ACT_DOD_PRONE_AIM_BOLT, - ACT_DOD_STAND_IDLE_BOLT, - ACT_DOD_CROUCH_IDLE_BOLT, - ACT_DOD_CROUCHWALK_IDLE_BOLT, - ACT_DOD_WALK_IDLE_BOLT, - ACT_DOD_RUN_IDLE_BOLT, - ACT_DOD_SPRINT_IDLE_BOLT, - ACT_DOD_PRONEWALK_IDLE_BOLT, - - ACT_DOD_STAND_AIM_TOMMY, - ACT_DOD_CROUCH_AIM_TOMMY, - ACT_DOD_CROUCHWALK_AIM_TOMMY, - ACT_DOD_WALK_AIM_TOMMY, - ACT_DOD_RUN_AIM_TOMMY, - ACT_DOD_PRONE_AIM_TOMMY, - ACT_DOD_STAND_IDLE_TOMMY, - ACT_DOD_CROUCH_IDLE_TOMMY, - ACT_DOD_CROUCHWALK_IDLE_TOMMY, - ACT_DOD_WALK_IDLE_TOMMY, - ACT_DOD_RUN_IDLE_TOMMY, - ACT_DOD_SPRINT_IDLE_TOMMY, - ACT_DOD_PRONEWALK_IDLE_TOMMY, - - ACT_DOD_STAND_AIM_MP40, - ACT_DOD_CROUCH_AIM_MP40, - ACT_DOD_CROUCHWALK_AIM_MP40, - ACT_DOD_WALK_AIM_MP40, - ACT_DOD_RUN_AIM_MP40, - ACT_DOD_PRONE_AIM_MP40, - ACT_DOD_STAND_IDLE_MP40, - ACT_DOD_CROUCH_IDLE_MP40, - ACT_DOD_CROUCHWALK_IDLE_MP40, - ACT_DOD_WALK_IDLE_MP40, - ACT_DOD_RUN_IDLE_MP40, - ACT_DOD_SPRINT_IDLE_MP40, - ACT_DOD_PRONEWALK_IDLE_MP40, - - ACT_DOD_STAND_AIM_MP44, - ACT_DOD_CROUCH_AIM_MP44, - ACT_DOD_CROUCHWALK_AIM_MP44, - ACT_DOD_WALK_AIM_MP44, - ACT_DOD_RUN_AIM_MP44, - ACT_DOD_PRONE_AIM_MP44, - ACT_DOD_STAND_IDLE_MP44, - ACT_DOD_CROUCH_IDLE_MP44, - ACT_DOD_CROUCHWALK_IDLE_MP44, - ACT_DOD_WALK_IDLE_MP44, - ACT_DOD_RUN_IDLE_MP44, - ACT_DOD_SPRINT_IDLE_MP44, - ACT_DOD_PRONEWALK_IDLE_MP44, - - ACT_DOD_STAND_AIM_GREASE, - ACT_DOD_CROUCH_AIM_GREASE, - ACT_DOD_CROUCHWALK_AIM_GREASE, - ACT_DOD_WALK_AIM_GREASE, - ACT_DOD_RUN_AIM_GREASE, - ACT_DOD_PRONE_AIM_GREASE, - ACT_DOD_STAND_IDLE_GREASE, - ACT_DOD_CROUCH_IDLE_GREASE, - ACT_DOD_CROUCHWALK_IDLE_GREASE, - ACT_DOD_WALK_IDLE_GREASE, - ACT_DOD_RUN_IDLE_GREASE, - ACT_DOD_SPRINT_IDLE_GREASE, - ACT_DOD_PRONEWALK_IDLE_GREASE, - - ACT_DOD_STAND_AIM_MG, - ACT_DOD_CROUCH_AIM_MG, - ACT_DOD_CROUCHWALK_AIM_MG, - ACT_DOD_WALK_AIM_MG, - ACT_DOD_RUN_AIM_MG, - ACT_DOD_PRONE_AIM_MG, - ACT_DOD_STAND_IDLE_MG, - ACT_DOD_CROUCH_IDLE_MG, - ACT_DOD_CROUCHWALK_IDLE_MG, - ACT_DOD_WALK_IDLE_MG, - ACT_DOD_RUN_IDLE_MG, - ACT_DOD_SPRINT_IDLE_MG, - ACT_DOD_PRONEWALK_IDLE_MG, - - ACT_DOD_STAND_AIM_30CAL, - ACT_DOD_CROUCH_AIM_30CAL, - ACT_DOD_CROUCHWALK_AIM_30CAL, - ACT_DOD_WALK_AIM_30CAL, - ACT_DOD_RUN_AIM_30CAL, - ACT_DOD_PRONE_AIM_30CAL, - ACT_DOD_STAND_IDLE_30CAL, - ACT_DOD_CROUCH_IDLE_30CAL, - ACT_DOD_CROUCHWALK_IDLE_30CAL, - ACT_DOD_WALK_IDLE_30CAL, - ACT_DOD_RUN_IDLE_30CAL, - ACT_DOD_SPRINT_IDLE_30CAL, - ACT_DOD_PRONEWALK_IDLE_30CAL, - - ACT_DOD_STAND_AIM_GREN_FRAG, - ACT_DOD_CROUCH_AIM_GREN_FRAG, - ACT_DOD_CROUCHWALK_AIM_GREN_FRAG, - ACT_DOD_WALK_AIM_GREN_FRAG, - ACT_DOD_RUN_AIM_GREN_FRAG, - ACT_DOD_PRONE_AIM_GREN_FRAG, - ACT_DOD_SPRINT_AIM_GREN_FRAG, - ACT_DOD_PRONEWALK_AIM_GREN_FRAG, - ACT_DOD_STAND_AIM_GREN_STICK, - ACT_DOD_CROUCH_AIM_GREN_STICK, - ACT_DOD_CROUCHWALK_AIM_GREN_STICK, - ACT_DOD_WALK_AIM_GREN_STICK, - ACT_DOD_RUN_AIM_GREN_STICK, - ACT_DOD_PRONE_AIM_GREN_STICK, - ACT_DOD_SPRINT_AIM_GREN_STICK, - ACT_DOD_PRONEWALK_AIM_GREN_STICK, - - ACT_DOD_STAND_AIM_KNIFE, - ACT_DOD_CROUCH_AIM_KNIFE, - ACT_DOD_CROUCHWALK_AIM_KNIFE, - ACT_DOD_WALK_AIM_KNIFE, - ACT_DOD_RUN_AIM_KNIFE, - ACT_DOD_PRONE_AIM_KNIFE, - ACT_DOD_SPRINT_AIM_KNIFE, - ACT_DOD_PRONEWALK_AIM_KNIFE, - - ACT_DOD_STAND_AIM_SPADE, - ACT_DOD_CROUCH_AIM_SPADE, - ACT_DOD_CROUCHWALK_AIM_SPADE, - ACT_DOD_WALK_AIM_SPADE, - ACT_DOD_RUN_AIM_SPADE, - ACT_DOD_PRONE_AIM_SPADE, - ACT_DOD_SPRINT_AIM_SPADE, - ACT_DOD_PRONEWALK_AIM_SPADE, - - ACT_DOD_STAND_AIM_BAZOOKA, - ACT_DOD_CROUCH_AIM_BAZOOKA, - ACT_DOD_CROUCHWALK_AIM_BAZOOKA, - ACT_DOD_WALK_AIM_BAZOOKA, - ACT_DOD_RUN_AIM_BAZOOKA, - ACT_DOD_PRONE_AIM_BAZOOKA, - ACT_DOD_STAND_IDLE_BAZOOKA, - ACT_DOD_CROUCH_IDLE_BAZOOKA, - ACT_DOD_CROUCHWALK_IDLE_BAZOOKA, - ACT_DOD_WALK_IDLE_BAZOOKA, - ACT_DOD_RUN_IDLE_BAZOOKA, - ACT_DOD_SPRINT_IDLE_BAZOOKA, - ACT_DOD_PRONEWALK_IDLE_BAZOOKA, - - ACT_DOD_STAND_AIM_PSCHRECK, - ACT_DOD_CROUCH_AIM_PSCHRECK, - ACT_DOD_CROUCHWALK_AIM_PSCHRECK, - ACT_DOD_WALK_AIM_PSCHRECK, - ACT_DOD_RUN_AIM_PSCHRECK, - ACT_DOD_PRONE_AIM_PSCHRECK, - ACT_DOD_STAND_IDLE_PSCHRECK, - ACT_DOD_CROUCH_IDLE_PSCHRECK, - ACT_DOD_CROUCHWALK_IDLE_PSCHRECK, - ACT_DOD_WALK_IDLE_PSCHRECK, - ACT_DOD_RUN_IDLE_PSCHRECK, - ACT_DOD_SPRINT_IDLE_PSCHRECK, - ACT_DOD_PRONEWALK_IDLE_PSCHRECK, - - ACT_DOD_STAND_AIM_BAR, - ACT_DOD_CROUCH_AIM_BAR, - ACT_DOD_CROUCHWALK_AIM_BAR, - ACT_DOD_WALK_AIM_BAR, - ACT_DOD_RUN_AIM_BAR, - ACT_DOD_PRONE_AIM_BAR, - ACT_DOD_STAND_IDLE_BAR, - ACT_DOD_CROUCH_IDLE_BAR, - ACT_DOD_CROUCHWALK_IDLE_BAR, - ACT_DOD_WALK_IDLE_BAR, - ACT_DOD_RUN_IDLE_BAR, - ACT_DOD_SPRINT_IDLE_BAR, - ACT_DOD_PRONEWALK_IDLE_BAR, - - // Zoomed aims - ACT_DOD_STAND_ZOOM_RIFLE, - ACT_DOD_CROUCH_ZOOM_RIFLE, - ACT_DOD_CROUCHWALK_ZOOM_RIFLE, - ACT_DOD_WALK_ZOOM_RIFLE, - ACT_DOD_RUN_ZOOM_RIFLE, - ACT_DOD_PRONE_ZOOM_RIFLE, - - ACT_DOD_STAND_ZOOM_BOLT, - ACT_DOD_CROUCH_ZOOM_BOLT, - ACT_DOD_CROUCHWALK_ZOOM_BOLT, - ACT_DOD_WALK_ZOOM_BOLT, - ACT_DOD_RUN_ZOOM_BOLT, - ACT_DOD_PRONE_ZOOM_BOLT, - - ACT_DOD_STAND_ZOOM_BAZOOKA, - ACT_DOD_CROUCH_ZOOM_BAZOOKA, - ACT_DOD_CROUCHWALK_ZOOM_BAZOOKA, - ACT_DOD_WALK_ZOOM_BAZOOKA, - ACT_DOD_RUN_ZOOM_BAZOOKA, - ACT_DOD_PRONE_ZOOM_BAZOOKA, - - ACT_DOD_STAND_ZOOM_PSCHRECK, - ACT_DOD_CROUCH_ZOOM_PSCHRECK, - ACT_DOD_CROUCHWALK_ZOOM_PSCHRECK, - ACT_DOD_WALK_ZOOM_PSCHRECK, - ACT_DOD_RUN_ZOOM_PSCHRECK, - ACT_DOD_PRONE_ZOOM_PSCHRECK, - - // Deployed Aim - ACT_DOD_DEPLOY_RIFLE, - ACT_DOD_DEPLOY_TOMMY, - ACT_DOD_DEPLOY_MG, - ACT_DOD_DEPLOY_30CAL, - - // Prone Deployed Aim - ACT_DOD_PRONE_DEPLOY_RIFLE , - ACT_DOD_PRONE_DEPLOY_TOMMY, - ACT_DOD_PRONE_DEPLOY_MG, - ACT_DOD_PRONE_DEPLOY_30CAL, - - // Attacks - - // Rifle - ACT_DOD_PRIMARYATTACK_RIFLE, - ACT_DOD_SECONDARYATTACK_RIFLE, - ACT_DOD_PRIMARYATTACK_PRONE_RIFLE, - ACT_DOD_SECONDARYATTACK_PRONE_RIFLE, - ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_RIFLE, - ACT_DOD_PRIMARYATTACK_DEPLOYED_RIFLE, - - // Bolt - ACT_DOD_PRIMARYATTACK_BOLT, - ACT_DOD_SECONDARYATTACK_BOLT, - ACT_DOD_PRIMARYATTACK_PRONE_BOLT , - ACT_DOD_SECONDARYATTACK_PRONE_BOLT , - - // Tommy - ACT_DOD_PRIMARYATTACK_TOMMY, - ACT_DOD_PRIMARYATTACK_PRONE_TOMMY, - ACT_DOD_SECONDARYATTACK_TOMMY, - ACT_DOD_SECONDARYATTACK_PRONE_TOMMY, - - // MP40 - ACT_DOD_PRIMARYATTACK_MP40, - ACT_DOD_PRIMARYATTACK_PRONE_MP40 , - ACT_DOD_SECONDARYATTACK_MP40, - ACT_DOD_SECONDARYATTACK_PRONE_MP40 , - - // MP44 - ACT_DOD_PRIMARYATTACK_MP44, - ACT_DOD_PRIMARYATTACK_PRONE_MP44 , - - // Greasegun - ACT_DOD_PRIMARYATTACK_GREASE, - ACT_DOD_PRIMARYATTACK_PRONE_GREASE , - - // Pistols (Colt, Luger) - ACT_DOD_PRIMARYATTACK_PISTOL, - ACT_DOD_PRIMARYATTACK_PRONE_PISTOL , - ACT_DOD_PRIMARYATTACK_C96, - ACT_DOD_PRIMARYATTACK_PRONE_C96, - - // Mgs (mg42, mg34) - ACT_DOD_PRIMARYATTACK_MG, - ACT_DOD_PRIMARYATTACK_PRONE_MG , - ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_MG , - ACT_DOD_PRIMARYATTACK_DEPLOYED_MG , - - // 30cal - ACT_DOD_PRIMARYATTACK_30CAL, - ACT_DOD_PRIMARYATTACK_PRONE_30CAL, - ACT_DOD_PRIMARYATTACK_DEPLOYED_30CAL, - ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_30CAL , - - // Grenades - ACT_DOD_PRIMARYATTACK_GREN_FRAG, - ACT_DOD_PRIMARYATTACK_PRONE_GREN_FRAG, - ACT_DOD_PRIMARYATTACK_GREN_STICK, - ACT_DOD_PRIMARYATTACK_PRONE_GREN_STICK, - - // Knife - ACT_DOD_PRIMARYATTACK_KNIFE, - ACT_DOD_PRIMARYATTACK_PRONE_KNIFE, - - // Spade - ACT_DOD_PRIMARYATTACK_SPADE, - ACT_DOD_PRIMARYATTACK_PRONE_SPADE, - - // Bazooka - ACT_DOD_PRIMARYATTACK_BAZOOKA, - ACT_DOD_PRIMARYATTACK_PRONE_BAZOOKA, - - // Pschreck - ACT_DOD_PRIMARYATTACK_PSCHRECK, - ACT_DOD_PRIMARYATTACK_PRONE_PSCHRECK , - - // Bar - ACT_DOD_PRIMARYATTACK_BAR, - ACT_DOD_PRIMARYATTACK_PRONE_BAR, - - // Reloads - ACT_DOD_RELOAD_GARAND, - ACT_DOD_RELOAD_K43, - ACT_DOD_RELOAD_BAR, - ACT_DOD_RELOAD_MP40, - ACT_DOD_RELOAD_MP44, - ACT_DOD_RELOAD_BOLT, - ACT_DOD_RELOAD_M1CARBINE, - ACT_DOD_RELOAD_TOMMY, - ACT_DOD_RELOAD_GREASEGUN, - ACT_DOD_RELOAD_PISTOL, - ACT_DOD_RELOAD_FG42, - ACT_DOD_RELOAD_RIFLE, - ACT_DOD_RELOAD_RIFLEGRENADE, - ACT_DOD_RELOAD_C96, - - // Crouch - ACT_DOD_RELOAD_CROUCH_BAR, - ACT_DOD_RELOAD_CROUCH_RIFLE, - ACT_DOD_RELOAD_CROUCH_RIFLEGRENADE, - ACT_DOD_RELOAD_CROUCH_BOLT, - ACT_DOD_RELOAD_CROUCH_MP44, - ACT_DOD_RELOAD_CROUCH_MP40, - ACT_DOD_RELOAD_CROUCH_TOMMY, - ACT_DOD_RELOAD_CROUCH_BAZOOKA, - ACT_DOD_RELOAD_CROUCH_PSCHRECK, - ACT_DOD_RELOAD_CROUCH_PISTOL, - ACT_DOD_RELOAD_CROUCH_M1CARBINE, - ACT_DOD_RELOAD_CROUCH_C96, - - // Bazookas - ACT_DOD_RELOAD_BAZOOKA, - ACT_DOD_ZOOMLOAD_BAZOOKA, - ACT_DOD_RELOAD_PSCHRECK, - ACT_DOD_ZOOMLOAD_PSCHRECK, - - // Deployed - ACT_DOD_RELOAD_DEPLOYED_FG42, - ACT_DOD_RELOAD_DEPLOYED_30CAL, - ACT_DOD_RELOAD_DEPLOYED_MG, - ACT_DOD_RELOAD_DEPLOYED_MG34, - ACT_DOD_RELOAD_DEPLOYED_BAR, - - // Prone - ACT_DOD_RELOAD_PRONE_PISTOL, - ACT_DOD_RELOAD_PRONE_GARAND, - ACT_DOD_RELOAD_PRONE_M1CARBINE, - ACT_DOD_RELOAD_PRONE_BOLT, - ACT_DOD_RELOAD_PRONE_K43, - ACT_DOD_RELOAD_PRONE_MP40, - ACT_DOD_RELOAD_PRONE_MP44, - ACT_DOD_RELOAD_PRONE_BAR, - ACT_DOD_RELOAD_PRONE_GREASEGUN, - ACT_DOD_RELOAD_PRONE_TOMMY, - ACT_DOD_RELOAD_PRONE_FG42, - ACT_DOD_RELOAD_PRONE_RIFLE, - ACT_DOD_RELOAD_PRONE_RIFLEGRENADE, - ACT_DOD_RELOAD_PRONE_C96, - - // Prone bazooka - ACT_DOD_RELOAD_PRONE_BAZOOKA, - ACT_DOD_ZOOMLOAD_PRONE_BAZOOKA, - ACT_DOD_RELOAD_PRONE_PSCHRECK, - ACT_DOD_ZOOMLOAD_PRONE_PSCHRECK, - - // Prone deployed - ACT_DOD_RELOAD_PRONE_DEPLOYED_BAR, - ACT_DOD_RELOAD_PRONE_DEPLOYED_FG42, - ACT_DOD_RELOAD_PRONE_DEPLOYED_30CAL, - ACT_DOD_RELOAD_PRONE_DEPLOYED_MG, - ACT_DOD_RELOAD_PRONE_DEPLOYED_MG34, - - // Prone zoomed aim - ACT_DOD_PRONE_ZOOM_FORWARD_RIFLE, - ACT_DOD_PRONE_ZOOM_FORWARD_BOLT, - ACT_DOD_PRONE_ZOOM_FORWARD_BAZOOKA, - ACT_DOD_PRONE_ZOOM_FORWARD_PSCHRECK, - - // Crouch attack - ACT_DOD_PRIMARYATTACK_CROUCH, - ACT_DOD_PRIMARYATTACK_CROUCH_SPADE, - ACT_DOD_PRIMARYATTACK_CROUCH_KNIFE, - ACT_DOD_PRIMARYATTACK_CROUCH_GREN_FRAG, - ACT_DOD_PRIMARYATTACK_CROUCH_GREN_STICK, - ACT_DOD_SECONDARYATTACK_CROUCH, - ACT_DOD_SECONDARYATTACK_CROUCH_TOMMY, - ACT_DOD_SECONDARYATTACK_CROUCH_MP40, - - // Hand Signals - ACT_DOD_HS_IDLE, - ACT_DOD_HS_CROUCH, - ACT_DOD_HS_IDLE_30CAL, - ACT_DOD_HS_IDLE_BAZOOKA, - ACT_DOD_HS_IDLE_PSCHRECK, - ACT_DOD_HS_IDLE_KNIFE, - ACT_DOD_HS_IDLE_MG42, - ACT_DOD_HS_IDLE_PISTOL, - ACT_DOD_HS_IDLE_STICKGRENADE, - ACT_DOD_HS_IDLE_TOMMY, - ACT_DOD_HS_IDLE_MP44, - ACT_DOD_HS_IDLE_K98, - ACT_DOD_HS_CROUCH_30CAL, - ACT_DOD_HS_CROUCH_BAZOOKA, - ACT_DOD_HS_CROUCH_PSCHRECK, - ACT_DOD_HS_CROUCH_KNIFE, - ACT_DOD_HS_CROUCH_MG42, - ACT_DOD_HS_CROUCH_PISTOL, - ACT_DOD_HS_CROUCH_STICKGRENADE, - ACT_DOD_HS_CROUCH_TOMMY, - ACT_DOD_HS_CROUCH_MP44, - ACT_DOD_HS_CROUCH_K98, - - ACT_DOD_STAND_IDLE_TNT, - ACT_DOD_CROUCH_IDLE_TNT, - ACT_DOD_CROUCHWALK_IDLE_TNT, - ACT_DOD_WALK_IDLE_TNT, - ACT_DOD_RUN_IDLE_TNT, - ACT_DOD_SPRINT_IDLE_TNT, - ACT_DOD_PRONEWALK_IDLE_TNT, - - ACT_DOD_PLANT_TNT, - ACT_DOD_DEFUSE_TNT, - -// HL2MP - ACT_HL2MP_IDLE, - ACT_HL2MP_RUN, - ACT_HL2MP_IDLE_CROUCH, - ACT_HL2MP_WALK_CROUCH, - ACT_HL2MP_GESTURE_RANGE_ATTACK, - ACT_HL2MP_GESTURE_RELOAD, - ACT_HL2MP_JUMP, - - ACT_HL2MP_IDLE_PISTOL, - ACT_HL2MP_RUN_PISTOL, - ACT_HL2MP_IDLE_CROUCH_PISTOL, - ACT_HL2MP_WALK_CROUCH_PISTOL, - ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, - ACT_HL2MP_GESTURE_RELOAD_PISTOL, - ACT_HL2MP_JUMP_PISTOL, - - ACT_HL2MP_IDLE_SMG1, - ACT_HL2MP_RUN_SMG1, - ACT_HL2MP_IDLE_CROUCH_SMG1, - ACT_HL2MP_WALK_CROUCH_SMG1, - ACT_HL2MP_GESTURE_RANGE_ATTACK_SMG1, - ACT_HL2MP_GESTURE_RELOAD_SMG1, - ACT_HL2MP_JUMP_SMG1, - - ACT_HL2MP_IDLE_AR2, - ACT_HL2MP_RUN_AR2, - ACT_HL2MP_IDLE_CROUCH_AR2, - ACT_HL2MP_WALK_CROUCH_AR2, - ACT_HL2MP_GESTURE_RANGE_ATTACK_AR2, - ACT_HL2MP_GESTURE_RELOAD_AR2, - ACT_HL2MP_JUMP_AR2, - - ACT_HL2MP_IDLE_SHOTGUN, - ACT_HL2MP_RUN_SHOTGUN, - ACT_HL2MP_IDLE_CROUCH_SHOTGUN, - ACT_HL2MP_WALK_CROUCH_SHOTGUN, - ACT_HL2MP_GESTURE_RANGE_ATTACK_SHOTGUN, - ACT_HL2MP_GESTURE_RELOAD_SHOTGUN, - ACT_HL2MP_JUMP_SHOTGUN, - - ACT_HL2MP_IDLE_RPG, - ACT_HL2MP_RUN_RPG, - ACT_HL2MP_IDLE_CROUCH_RPG, - ACT_HL2MP_WALK_CROUCH_RPG, - ACT_HL2MP_GESTURE_RANGE_ATTACK_RPG, - ACT_HL2MP_GESTURE_RELOAD_RPG, - ACT_HL2MP_JUMP_RPG, - - ACT_HL2MP_IDLE_GRENADE, - ACT_HL2MP_RUN_GRENADE, - ACT_HL2MP_IDLE_CROUCH_GRENADE, - ACT_HL2MP_WALK_CROUCH_GRENADE, - ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, - ACT_HL2MP_GESTURE_RELOAD_GRENADE, - ACT_HL2MP_JUMP_GRENADE, - - ACT_HL2MP_IDLE_PHYSGUN, - ACT_HL2MP_RUN_PHYSGUN, - ACT_HL2MP_IDLE_CROUCH_PHYSGUN, - ACT_HL2MP_WALK_CROUCH_PHYSGUN, - ACT_HL2MP_GESTURE_RANGE_ATTACK_PHYSGUN, - ACT_HL2MP_GESTURE_RELOAD_PHYSGUN, - ACT_HL2MP_JUMP_PHYSGUN, - - ACT_HL2MP_IDLE_CROSSBOW, - ACT_HL2MP_RUN_CROSSBOW, - ACT_HL2MP_IDLE_CROUCH_CROSSBOW, - ACT_HL2MP_WALK_CROUCH_CROSSBOW, - ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, - ACT_HL2MP_GESTURE_RELOAD_CROSSBOW, - ACT_HL2MP_JUMP_CROSSBOW, - ACT_HL2MP_IDLE_MELEE, ACT_HL2MP_RUN_MELEE, ACT_HL2MP_IDLE_CROUCH_MELEE, @@ -1296,14 +626,6 @@ typedef enum ACT_HL2MP_GESTURE_RELOAD_MELEE, ACT_HL2MP_JUMP_MELEE, - ACT_HL2MP_IDLE_SLAM, - ACT_HL2MP_RUN_SLAM, - ACT_HL2MP_IDLE_CROUCH_SLAM, - ACT_HL2MP_WALK_CROUCH_SLAM, - ACT_HL2MP_GESTURE_RANGE_ATTACK_SLAM, - ACT_HL2MP_GESTURE_RELOAD_SLAM, - ACT_HL2MP_JUMP_SLAM, - // Portal! ACT_VM_FIZZLE, @@ -1463,11 +785,53 @@ typedef enum ACT_MP_ATTACK_SWIM_GRENADE_MELEE, ACT_MP_ATTACK_AIRWALK_GRENADE_MELEE, + // Item1 + ACT_MP_STAND_ITEM1, + ACT_MP_CROUCH_ITEM1, + ACT_MP_RUN_ITEM1, + ACT_MP_WALK_ITEM1, + ACT_MP_AIRWALK_ITEM1, + ACT_MP_CROUCHWALK_ITEM1, + ACT_MP_JUMP_ITEM1, + ACT_MP_JUMP_START_ITEM1, + ACT_MP_JUMP_FLOAT_ITEM1, + ACT_MP_JUMP_LAND_ITEM1, + ACT_MP_SWIM_ITEM1, + + ACT_MP_ATTACK_STAND_ITEM1, // RUN, WALK + ACT_MP_ATTACK_STAND_ITEM1_SECONDARY, + ACT_MP_ATTACK_CROUCH_ITEM1, // CROUCHWALK + ACT_MP_ATTACK_CROUCH_ITEM1_SECONDARY, + ACT_MP_ATTACK_SWIM_ITEM1, + ACT_MP_ATTACK_AIRWALK_ITEM1, + + // Item2 + ACT_MP_STAND_ITEM2, + ACT_MP_CROUCH_ITEM2, + ACT_MP_RUN_ITEM2, + ACT_MP_WALK_ITEM2, + ACT_MP_AIRWALK_ITEM2, + ACT_MP_CROUCHWALK_ITEM2, + ACT_MP_JUMP_ITEM2, + ACT_MP_JUMP_START_ITEM2, + ACT_MP_JUMP_FLOAT_ITEM2, + ACT_MP_JUMP_LAND_ITEM2, + ACT_MP_SWIM_ITEM2, + + ACT_MP_ATTACK_STAND_ITEM2, // RUN, WALK + ACT_MP_ATTACK_STAND_ITEM2_SECONDARY, + ACT_MP_ATTACK_CROUCH_ITEM2, // CROUCHWALK + ACT_MP_ATTACK_CROUCH_ITEM2_SECONDARY, + ACT_MP_ATTACK_SWIM_ITEM2, + ACT_MP_ATTACK_AIRWALK_ITEM2, + // Flinches ACT_MP_GESTURE_FLINCH, ACT_MP_GESTURE_FLINCH_PRIMARY, ACT_MP_GESTURE_FLINCH_SECONDARY, ACT_MP_GESTURE_FLINCH_MELEE, + ACT_MP_GESTURE_FLINCH_ITEM1, + ACT_MP_GESTURE_FLINCH_ITEM2, ACT_MP_GESTURE_FLINCH_HEAD, ACT_MP_GESTURE_FLINCH_CHEST, @@ -1506,6 +870,20 @@ typedef enum ACT_MP_MELEE_GRENADE2_IDLE, ACT_MP_MELEE_GRENADE2_ATTACK, + ACT_MP_ITEM1_GRENADE1_DRAW, + ACT_MP_ITEM1_GRENADE1_IDLE, + ACT_MP_ITEM1_GRENADE1_ATTACK, + ACT_MP_ITEM1_GRENADE2_DRAW, + ACT_MP_ITEM1_GRENADE2_IDLE, + ACT_MP_ITEM1_GRENADE2_ATTACK, + + ACT_MP_ITEM2_GRENADE1_DRAW, + ACT_MP_ITEM2_GRENADE1_IDLE, + ACT_MP_ITEM2_GRENADE1_ATTACK, + ACT_MP_ITEM2_GRENADE2_DRAW, + ACT_MP_ITEM2_GRENADE2_IDLE, + ACT_MP_ITEM2_GRENADE2_ATTACK, + // Building ACT_MP_STAND_BUILDING, ACT_MP_CROUCH_BUILDING, @@ -1572,6 +950,20 @@ typedef enum ACT_MP_GESTURE_VC_NODYES_MELEE, ACT_MP_GESTURE_VC_NODNO_MELEE, + ACT_MP_GESTURE_VC_HANDMOUTH_ITEM1, + ACT_MP_GESTURE_VC_FINGERPOINT_ITEM1, + ACT_MP_GESTURE_VC_FISTPUMP_ITEM1, + ACT_MP_GESTURE_VC_THUMBSUP_ITEM1, + ACT_MP_GESTURE_VC_NODYES_ITEM1, + ACT_MP_GESTURE_VC_NODNO_ITEM1, + + ACT_MP_GESTURE_VC_HANDMOUTH_ITEM2, + ACT_MP_GESTURE_VC_FINGERPOINT_ITEM2, + ACT_MP_GESTURE_VC_FISTPUMP_ITEM2, + ACT_MP_GESTURE_VC_THUMBSUP_ITEM2, + ACT_MP_GESTURE_VC_NODYES_ITEM2, + ACT_MP_GESTURE_VC_NODNO_ITEM2, + ACT_MP_GESTURE_VC_HANDMOUTH_BUILDING, ACT_MP_GESTURE_VC_FINGERPOINT_BUILDING, ACT_MP_GESTURE_VC_FISTPUMP_BUILDING, @@ -1640,6 +1032,88 @@ typedef enum ACT_PDA_VM_IDLE_LOWERED, ACT_PDA_VM_LOWERED_TO_IDLE, + ACT_ITEM1_VM_DRAW, + ACT_ITEM1_VM_HOLSTER, + ACT_ITEM1_VM_IDLE, + ACT_ITEM1_VM_PULLBACK, + ACT_ITEM1_VM_PRIMARYATTACK, + ACT_ITEM1_VM_SECONDARYATTACK, + ACT_ITEM1_VM_RELOAD, + ACT_ITEM1_VM_DRYFIRE, + ACT_ITEM1_VM_IDLE_TO_LOWERED, + ACT_ITEM1_VM_IDLE_LOWERED, + ACT_ITEM1_VM_LOWERED_TO_IDLE, + + ACT_ITEM2_VM_DRAW, + ACT_ITEM2_VM_HOLSTER, + ACT_ITEM2_VM_IDLE, + ACT_ITEM2_VM_PULLBACK, + ACT_ITEM2_VM_PRIMARYATTACK, + ACT_ITEM2_VM_SECONDARYATTACK, + ACT_ITEM2_VM_RELOAD, + ACT_ITEM2_VM_DRYFIRE, + ACT_ITEM2_VM_IDLE_TO_LOWERED, + ACT_ITEM2_VM_IDLE_LOWERED, + ACT_ITEM2_VM_LOWERED_TO_IDLE, + + // Infested activities + ACT_RELOAD_SUCCEED, + ACT_RELOAD_FAIL, + // Autogun + ACT_WALK_AIM_AUTOGUN, + ACT_RUN_AIM_AUTOGUN, + ACT_IDLE_AUTOGUN, + ACT_IDLE_AIM_AUTOGUN, + ACT_RELOAD_AUTOGUN, + ACT_CROUCH_IDLE_AUTOGUN, + ACT_RANGE_ATTACK_AUTOGUN, + ACT_JUMP_AUTOGUN, + // Pistol + ACT_IDLE_AIM_PISTOL, + // PDW + ACT_WALK_AIM_DUAL, + ACT_RUN_AIM_DUAL, + ACT_IDLE_DUAL, + ACT_IDLE_AIM_DUAL, + ACT_RELOAD_DUAL, + ACT_CROUCH_IDLE_DUAL, + ACT_RANGE_ATTACK_DUAL, + ACT_JUMP_DUAL, + // Shotgun + ACT_IDLE_SHOTGUN, + ACT_IDLE_AIM_SHOTGUN, + ACT_CROUCH_IDLE_SHOTGUN, + ACT_JUMP_SHOTGUN, + // Rifle + ACT_IDLE_AIM_RIFLE, + ACT_RELOAD_RIFLE, + ACT_CROUCH_IDLE_RIFLE, + ACT_RANGE_ATTACK_RIFLE, + ACT_JUMP_RIFLE, + + // Infested General AI + ACT_SLEEP, + ACT_WAKE, + + // Shield Bug + ACT_FLICK_LEFT, + ACT_FLICK_LEFT_MIDDLE, + ACT_FLICK_RIGHT_MIDDLE, + ACT_FLICK_RIGHT, + ACT_SPINAROUND, + + // Mortar Bug + ACT_PREP_TO_FIRE, + ACT_FIRE, + ACT_FIRE_RECOVER, + + // Shaman + ACT_SPRAY, + + // Boomer + ACT_PREP_EXPLODE, + ACT_EXPLODE, + // this is the end of the global activities, private per-monster activities start here. LAST_SHARED_ACTIVITY, } Activity; diff --git a/game/shared/animation.cpp b/game/shared/animation.cpp index 3668dc4c3..80d79a150 100644 --- a/game/shared/animation.cpp +++ b/game/shared/animation.cpp @@ -25,10 +25,7 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" -#ifdef _MSC_VER #pragma warning( disable : 4244 ) -#endif - #define iabs(i) (( (i) >= 0 ) ? (i) : -(i) ) int ExtractBbox( CStudioHdr *pstudiohdr, int sequence, Vector& mins, Vector& maxs ) @@ -65,14 +62,18 @@ void SetEventIndexForSequence( mstudioseqdesc_t &seqdesc ) if ( &seqdesc == NULL ) return; - seqdesc.flags |= STUDIO_EVENT; - if ( seqdesc.numevents == 0 ) return; +#ifndef CLIENT_DLL + seqdesc.flags |= STUDIO_EVENT; +#else + seqdesc.flags |= STUDIO_EVENT_CLIENT; +#endif + for ( int index = 0; index < (int)seqdesc.numevents; index++ ) { - mstudioevent_t *pevent = seqdesc.pEvent( index ); + mstudioevent_t *pevent = (mstudioevent_for_client_server_t*)seqdesc.pEvent( index ); if ( !pevent ) continue; @@ -85,25 +86,29 @@ void SetEventIndexForSequence( mstudioseqdesc_t &seqdesc ) if ( iEventIndex == -1 ) { - pevent->event = EventList_RegisterPrivateEvent( pEventName ); + pevent->event_newsystem = EventList_RegisterPrivateEvent( pEventName ); } else { - pevent->event = iEventIndex; + pevent->event_newsystem = iEventIndex; pevent->type |= EventList_GetEventType( iEventIndex ); } } } } -mstudioevent_t *GetEventIndexForSequence( mstudioseqdesc_t &seqdesc ) +mstudioevent_for_client_server_t *GetEventIndexForSequence( mstudioseqdesc_t &seqdesc ) { - if (!(seqdesc.flags & STUDIO_EVENT)) +#ifndef CLIENT_DLL + if ( !(seqdesc.flags & STUDIO_EVENT) ) +#else + if ( !(seqdesc.flags & STUDIO_EVENT_CLIENT) ) +#endif { SetEventIndexForSequence( seqdesc ); } - return seqdesc.pEvent( 0 ); + return (mstudioevent_for_client_server_t*)seqdesc.pEvent( 0 ); } @@ -232,6 +237,11 @@ bool IsInPrediction() int SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequence ) { VPROF( "SelectWeightedSequence" ); +#ifdef CLIENT_DLL + VPROF_INCREMENT_COUNTER( "Client SelectWeightedSequence", 1 ); +#else // ifdef GAME_DLL + VPROF_INCREMENT_COUNTER( "Server SelectWeightedSequence", 1 ); +#endif if (! pstudiohdr) return 0; @@ -241,38 +251,13 @@ int SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequenc VerifySequenceIndex( pstudiohdr ); -#if STUDIO_SEQUENCE_ACTIVITY_LOOKUPS_ARE_SLOW - int weighttotal = 0; - int seq = ACTIVITY_NOT_AVAILABLE; - int weight = 0; - for (int i = 0; i < pstudiohdr->GetNumSeq(); i++) + int numSeq = pstudiohdr->GetNumSeq(); + if ( numSeq == 1 ) { - int curActivity = GetSequenceActivity( pstudiohdr, i, &weight ); - if (curActivity == activity) - { - if ( curSequence == i && weight < 0 ) - { - seq = i; - break; - } - weighttotal += iabs(weight); - - int randomValue; - - if ( IsInPrediction() ) - randomValue = SharedRandomInt( "SelectWeightedSequence", 0, weighttotal - 1, i ); - else - randomValue = RandomInt( 0, weighttotal - 1 ); - - if (!weighttotal || randomValue < iabs(weight)) - seq = i; - } + return ( GetSequenceActivity( pstudiohdr, 0, NULL ) == activity ) ? 0 : ACTIVITY_NOT_AVAILABLE; } - return seq; -#else return pstudiohdr->SelectWeightedSequence( activity, curSequence ); -#endif } @@ -282,6 +267,26 @@ int SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequenc // sequence having a number of spaces corresponding to its weight. int CStudioHdr::CActivityToSequenceMapping::SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequence ) { + // is the current sequence appropriate? + if (curSequence >= 0) + { + mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( curSequence ); + + if (seqdesc.activity == activity && seqdesc.actweight < 0) + return curSequence; + } + + if ( !pstudiohdr->SequencesAvailable() ) + { + return ACTIVITY_NOT_AVAILABLE; + } + + if ( pstudiohdr->GetNumSeq() == 1 ) + { + AssertMsg( 0, "Expected single sequence case to be handled in ::SelectWeightedSequence()" ); + return ACTIVITY_NOT_AVAILABLE; + } + if (!ValidateAgainst(pstudiohdr)) { AssertMsg1(false, "CStudioHdr %s has changed its vmodel pointer without reinitializing its activity mapping! Now performing emergency reinitialization.", pstudiohdr->pszName()); @@ -293,15 +298,6 @@ int CStudioHdr::CActivityToSequenceMapping::SelectWeightedSequence( CStudioHdr * if (!m_pSequenceTuples) return ACTIVITY_NOT_AVAILABLE; - // is the current sequence appropriate? - if (curSequence >= 0) - { - mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( curSequence ); - - if (seqdesc.activity == activity && seqdesc.actweight < 0) - return curSequence; - } - // get the data for the given activity HashValueType dummy( activity, 0, 0, 0 ); UtlHashHandle_t handle = m_ActToSeqHash.Find(dummy); @@ -311,18 +307,36 @@ int CStudioHdr::CActivityToSequenceMapping::SelectWeightedSequence( CStudioHdr * } const HashValueType * __restrict actData = &m_ActToSeqHash[handle]; + AssertMsg2( actData->totalWeight > 0, "Activity %s has total weight of %d!", + activity, actData->totalWeight ); int weighttotal = actData->totalWeight; - // generate a random number from 0 to the total weight - int randomValue; - if ( IsInPrediction() ) + + // failsafe if the weight is 0: assume the artist screwed up and that the first sequence + // for this activity should be returned. + int randomValue = 0; + if ( actData->totalWeight <= 0 ) { - randomValue = SharedRandomInt( "SelectWeightedSequence", 0, weighttotal - 1 ); + Warning( "Activity %s has %d sequences with a total weight of %d!", ActivityList_NameForIndex(activity), actData->count, actData->totalWeight ); + return (m_pSequenceTuples + actData->startingIdx)->seqnum; + } + else if ( actData->totalWeight == 1 ) + { + randomValue = 0; } else { - randomValue = RandomInt( 0, weighttotal - 1 ); + // generate a random number from 0 to the total weight + if ( IsInPrediction() ) + { + randomValue = SharedRandomInt( "SelectWeightedSequence", 0, weighttotal - 1 ); + } + else + { + randomValue = RandomInt( 0, weighttotal - 1 ); + } } + // chug through the entries in the list (they are sequential therefore cache-coherent) // until we run out of random juice SequenceTuple * __restrict sequenceInfo = m_pSequenceTuples + actData->startingIdx; @@ -342,6 +356,77 @@ int CStudioHdr::CActivityToSequenceMapping::SelectWeightedSequence( CStudioHdr * } +int CStudioHdr::CActivityToSequenceMapping::SelectWeightedSequenceFromModifiers( CStudioHdr *pstudiohdr, int activity, CUtlSymbol *pActivityModifiers, int iModifierCount ) +{ + if ( !pstudiohdr->SequencesAvailable() ) + { + return ACTIVITY_NOT_AVAILABLE; + } + + VerifySequenceIndex( pstudiohdr ); + + if ( pstudiohdr->GetNumSeq() == 1 ) + { + return ( ::GetSequenceActivity( pstudiohdr, 0, NULL ) == activity ) ? 0 : ACTIVITY_NOT_AVAILABLE; + } + + if (!ValidateAgainst(pstudiohdr)) + { + AssertMsg1(false, "CStudioHdr %s has changed its vmodel pointer without reinitializing its activity mapping! Now performing emergency reinitialization.", pstudiohdr->pszName()); + ExecuteOnce(DebuggerBreakIfDebugging()); + Reinitialize(pstudiohdr); + } + + // a null m_pSequenceTuples just means that this studio header has no activities. + if (!m_pSequenceTuples) + return ACTIVITY_NOT_AVAILABLE; + + // get the data for the given activity + HashValueType dummy( activity, 0, 0, 0 ); + UtlHashHandle_t handle = m_ActToSeqHash.Find(dummy); + if (!m_ActToSeqHash.IsValidHandle(handle)) + { + return ACTIVITY_NOT_AVAILABLE; + } + const HashValueType * __restrict actData = &m_ActToSeqHash[handle]; + + // go through each sequence and give it a score + int top_score = -1; + CUtlVector topScoring( actData->count, actData->count ); + for ( int i = 0; i < actData->count; i++ ) + { + SequenceTuple * __restrict sequenceInfo = m_pSequenceTuples + actData->startingIdx + i; + int score = 0; + // count matching activity modifiers + for ( int m = 0; m < iModifierCount; m++ ) + { + int num_modifiers = sequenceInfo->iNumActivityModifiers; + for ( int k = 0; k < num_modifiers; k++ ) + { + if ( sequenceInfo->pActivityModifiers[ k ] == pActivityModifiers[ m ] ) + { + score++; + break; + } + } + } + if ( score > top_score ) + { + topScoring.RemoveAll(); + topScoring.AddToTail( sequenceInfo->seqnum ); + top_score = score; + } + } + + // randomly pick between the highest scoring sequences ( NOTE: this method of selecting a sequence ignores activity weights ) + if ( IsInPrediction() ) + { + return topScoring[ SharedRandomInt( "SelectWeightedSequence", 0, topScoring.Count() - 1 ) ]; + } + + return topScoring[ RandomInt( 0, topScoring.Count() - 1 ) ]; +} + #endif @@ -476,6 +561,36 @@ void GetSequenceLinearMotion( CStudioHdr *pstudiohdr, int iSequence, const float QAngle vecAngles; Studio_SeqMovement( pstudiohdr, iSequence, 0, 1.0, poseParameter, (*pVec), vecAngles ); } + +float GetSequenceLinearMotionAndDuration( CStudioHdr *pstudiohdr, int iSequence, const float poseParameter[], Vector *pVec ) +{ + pVec->Init(); + if ( !pstudiohdr ) + { + Msg( "Bad pstudiohdr in GetSequenceLinearMotion()!\n" ); + return 0.0f; + } + + if ( !pstudiohdr->SequencesAvailable() ) + return 0.0f; + + if ( iSequence < 0 || iSequence >= pstudiohdr->GetNumSeq() ) + { + // Don't spam on bogus model + if ( pstudiohdr->GetNumSeq() > 0 ) + { + static int msgCount = 0; + while ( ++msgCount < 10 ) + { + Msg( "Bad sequence (%i out of %i max) in GetSequenceLinearMotion() for model '%s'!\n", iSequence, pstudiohdr->GetNumSeq(), pstudiohdr->pszName() ); + } + } + return 0.0f; + } + + return Studio_SeqMovementAndDuration( pstudiohdr, iSequence, 0, 1.0, poseParameter, (*pVec) ); +} + #endif const char *GetSequenceName( CStudioHdr *pstudiohdr, int iSequence ) @@ -549,7 +664,7 @@ bool HasAnimationEventOfType( CStudioHdr *pstudiohdr, int sequence, int type ) int index; for ( index = 0; index < (int)seqdesc.numevents; index++ ) { - if ( pevent[ index ].event == type ) + if ( pevent[ index ].Event() == type ) { return true; } @@ -577,7 +692,7 @@ int GetAnimationEvent( CStudioHdr *pstudiohdr, int sequence, animevent_t *pNPCEv if ( !(pevent[index].type & AE_TYPE_SERVER) ) continue; } - else if ( pevent[index].event >= EVENT_CLIENT ) //Adrian - Support the old event system + else if ( pevent[index].Event_OldSystem() >= EVENT_CLIENT ) //Adrian - Support the old event system continue; bool bOverlapEvent = false; @@ -604,9 +719,9 @@ int GetAnimationEvent( CStudioHdr *pstudiohdr, int sequence, animevent_t *pNPCEv #else pNPCEvent->eventtime = 0.0f; #endif - pNPCEvent->event = pevent[index].event; - pNPCEvent->options = pevent[index].pszOptions(); pNPCEvent->type = pevent[index].type; + pNPCEvent->Event( pevent[index].Event() ); + pNPCEvent->options = pevent[index].pszOptions(); return index + 1; } } @@ -850,6 +965,21 @@ const char *GetBodygroupName( CStudioHdr *pstudiohdr, int iGroup ) return pbodypart->pszName(); } +const char *GetBodygroupPartName( CStudioHdr *pstudiohdr, int iGroup, int iPart ) +{ + if ( !pstudiohdr) + return ""; + + if (iGroup >= pstudiohdr->numbodyparts()) + return ""; + + mstudiobodyparts_t *pbodypart = pstudiohdr->pBodypart( iGroup ); + if ( iPart < 0 && iPart >= pbodypart->nummodels ) + return ""; + + return pbodypart->pModel( iPart )->name; +} + int FindBodygroupByName( CStudioHdr *pstudiohdr, const char *name ) { if ( !pstudiohdr ) @@ -897,6 +1027,7 @@ int GetSequenceActivity( CStudioHdr *pstudiohdr, int sequence, int *pweight ) return 0; } + Assert(sequence >= 0 && sequence < pstudiohdr->GetNumSeq()); mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( sequence ); if (!(seqdesc.flags & STUDIO_ACTIVITY)) diff --git a/game/shared/animation.h b/game/shared/animation.h index 464cfac04..a6a73e5fe 100644 --- a/game/shared/animation.h +++ b/game/shared/animation.h @@ -1,13 +1,18 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // // $NoKeywords: $ // -//=============================================================================// +//===========================================================================// #ifndef ANIMATION_H #define ANIMATION_H +#ifdef _WIN32 +#pragma once +#endif + + #define ACTIVITY_NOT_AVAILABLE -1 struct animevent_t; @@ -25,6 +30,7 @@ int SelectHeaviestSequence( CStudioHdr *pstudiohdr, int activity ); void SetEventIndexForSequence( mstudioseqdesc_t &seqdesc ); void BuildAllAnimationEventIndexes( CStudioHdr *pstudiohdr ); void ResetEventIndexes( CStudioHdr *pstudiohdr ); +float GetSequenceLinearMotionAndDuration( CStudioHdr *pstudiohdr, int iSequence, const float poseParameter[], Vector *pVec ); void GetEyePosition( CStudioHdr *pstudiohdr, Vector &vecEyePosition ); @@ -49,6 +55,7 @@ int GetBodygroup( CStudioHdr *pstudiohdr, int body, int iGroup ); const char *GetBodygroupName( CStudioHdr *pstudiohdr, int iGroup ); int FindBodygroupByName( CStudioHdr *pstudiohdr, const char *name ); +const char *GetBodygroupPartName( CStudioHdr *pstudiohdr, int iGroup, int iPart ); int GetBodygroupCount( CStudioHdr *pstudiohdr, int iGroup ); int GetNumBodyGroups( CStudioHdr *pstudiohdr ); diff --git a/game/shared/eventlist.cpp b/game/shared/eventlist.cpp index 2f791ab49..167b2a16b 100644 --- a/game/shared/eventlist.cpp +++ b/game/shared/eventlist.cpp @@ -85,7 +85,7 @@ static eventlist_t *ListFromString( const char *pString ) static eventlist_t *ListFromEvent( int eventIndex ) { // ugly linear search - for ( int i = 0; i < g_EventList.Size(); i++ ) + for ( int i = 0; i < g_EventList.Count(); i++ ) { if ( g_EventList[i].eventIndex == eventIndex ) { @@ -154,7 +154,13 @@ Animevent EventList_RegisterPrivateEvent( const char *pszEventName ) } } - pList = EventList_AddEventEntry( pszEventName, g_HighestEvent+1, true, AE_TYPE_SERVER ); + int iType = AE_TYPE_SERVER; + +#ifdef CLIENT_DLL + iType = AE_TYPE_CLIENT; +#endif + + pList = EventList_AddEventEntry( pszEventName, g_HighestEvent+1, true, iType ); return (Animevent)pList->eventIndex; } @@ -233,12 +239,16 @@ void EventList_RegisterSharedEvents( void ) REGISTER_SHARED_ANIMEVENT( AE_SV_DUSTTRAIL, AE_TYPE_SERVER ); REGISTER_SHARED_ANIMEVENT( AE_CL_CREATE_PARTICLE_EFFECT, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_CL_STOP_PARTICLE_EFFECT, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_CL_ADD_PARTICLE_EFFECT_CP, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_CL_CREATE_PARTICLE_BRASS, AE_TYPE_CLIENT ); REGISTER_SHARED_ANIMEVENT( AE_RAGDOLL, AE_TYPE_SERVER ); REGISTER_SHARED_ANIMEVENT( AE_CL_ENABLE_BODYGROUP, AE_TYPE_CLIENT ); REGISTER_SHARED_ANIMEVENT( AE_CL_DISABLE_BODYGROUP, AE_TYPE_CLIENT ); REGISTER_SHARED_ANIMEVENT( AE_CL_BODYGROUP_SET_VALUE, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_CL_BODYGROUP_SET_VALUE_CMODEL_WPN, AE_TYPE_CLIENT ); REGISTER_SHARED_ANIMEVENT( AE_WPN_PRIMARYATTACK, AE_TYPE_CLIENT | AE_TYPE_SERVER ); REGISTER_SHARED_ANIMEVENT( AE_WPN_INCREMENTAMMO, AE_TYPE_CLIENT | AE_TYPE_SERVER ); @@ -246,5 +256,25 @@ void EventList_RegisterSharedEvents( void ) REGISTER_SHARED_ANIMEVENT( AE_WPN_HIDE, AE_TYPE_CLIENT | AE_TYPE_SERVER ); REGISTER_SHARED_ANIMEVENT( AE_WPN_UNHIDE, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_ASW_FOOTSTEP, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_MARINE_FOOTSTEP, AE_TYPE_CLIENT ); + + REGISTER_SHARED_ANIMEVENT( AE_MARINE_RELOAD_SOUND_A, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_MARINE_RELOAD_SOUND_B, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_MARINE_RELOAD_SOUND_C, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_REMOVE_CLIENT_AIM, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_WPN_PLAYWPNSOUND, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + + REGISTER_SHARED_ANIMEVENT( AE_MELEE_DAMAGE, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_MELEE_START_COLLISION_DAMAGE, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_MELEE_STOP_COLLISION_DAMAGE, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_SCREEN_SHAKE, AE_TYPE_CLIENT ); + REGISTER_SHARED_ANIMEVENT( AE_START_DETECTING_COMBO, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_STOP_DETECTING_COMBO, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_COMBO_TRANSITION, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_ALLOW_MOVEMENT, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_SKILL_EVENT, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + + REGISTER_SHARED_ANIMEVENT( AE_TUG_INCAP, AE_TYPE_SERVER ); } diff --git a/game/shared/eventlist.h b/game/shared/eventlist.h index 732433a65..f38ea927b 100644 --- a/game/shared/eventlist.h +++ b/game/shared/eventlist.h @@ -69,12 +69,16 @@ typedef enum AE_SV_DUSTTRAIL, AE_CL_CREATE_PARTICLE_EFFECT, + AE_CL_STOP_PARTICLE_EFFECT, + AE_CL_ADD_PARTICLE_EFFECT_CP, + AE_CL_CREATE_PARTICLE_BRASS, AE_RAGDOLL, AE_CL_ENABLE_BODYGROUP, AE_CL_DISABLE_BODYGROUP, AE_CL_BODYGROUP_SET_VALUE, + AE_CL_BODYGROUP_SET_VALUE_CMODEL_WPN, AE_WPN_PRIMARYATTACK, // Used by weapons that want their primary attack to occur during an attack anim (i.e. grenade throwing) AE_WPN_INCREMENTAMMO, @@ -84,6 +88,26 @@ typedef enum AE_WPN_PLAYWPNSOUND, // Play a weapon sound from the weapon script file + // Alien Swarm Infested shared events + AE_ASW_FOOTSTEP, // asw, played as each foot steps down + AE_MARINE_FOOTSTEP, + AE_MARINE_RELOAD_SOUND_A, // anim event fired reloading sound + AE_MARINE_RELOAD_SOUND_B, // anim event fired reloading sound + AE_MARINE_RELOAD_SOUND_C, // anim event fired reloading sound + AE_REMOVE_CLIENT_AIM, // asw, removes this entity from the client autoaim list + + AE_MELEE_DAMAGE, + AE_MELEE_START_COLLISION_DAMAGE, + AE_MELEE_STOP_COLLISION_DAMAGE, + AE_SCREEN_SHAKE, + AE_START_DETECTING_COMBO, + AE_STOP_DETECTING_COMBO, + AE_COMBO_TRANSITION, + AE_ALLOW_MOVEMENT, + AE_SKILL_EVENT, // marine skill event triggered (event options describes the skill) + + AE_TUG_INCAP, + LAST_SHARED_ANIMEVENT, } Animevent; diff --git a/game/shared/npcevent.h b/game/shared/npcevent.h index a3037426d..61086c515 100644 --- a/game/shared/npcevent.h +++ b/game/shared/npcevent.h @@ -11,16 +11,60 @@ #pragma once #endif + +#include "eventlist.h" + + class CBaseAnimating; struct animevent_t { - int event; +#ifdef CLIENT_DLL + // see mstudioevent_for_client_server_t comment below + union + { + unsigned short _event_highword; + unsigned short event_newsystem; + }; + unsigned short _event_lowword; +#else + // see mstudioevent_for_client_server_t comment below + unsigned short _event_highword; + union + { + unsigned short _event_lowword; + unsigned short event_newsystem; + }; +#endif + const char *options; float cycle; float eventtime; int type; CBaseAnimating *pSource; + bool m_bHandledByScript; + + // see mstudioevent_for_client_server_t comment below + int Event_OldSystem( void ) const { return *static_cast< const int* >( static_cast< const void* >( &_event_highword ) ); } + void Event_OldSystem( int nEvent ) { *static_cast< int* >( static_cast< void* >( &_event_highword ) ) = nEvent; } + int Event( void ) const + { + if ( type & AE_TYPE_NEWEVENTSYSTEM ) + return event_newsystem; + + return Event_OldSystem(); + } + void Event( int nEvent ) + { + if ( type & AE_TYPE_NEWEVENTSYSTEM ) + { + event_newsystem = nEvent; + } + else + { + Event_OldSystem( nEvent ); + } + } }; #define EVENT_SPECIFIC 0 #define EVENT_SCRIPTED 1000 // see scriptevent.h @@ -74,4 +118,76 @@ struct animevent_t // NOTE: MUST BE THE LAST WEAPON EVENT -- ONLY WEAPON EVENTS BETWEEN EVENT_WEAPON AND THIS #define EVENT_WEAPON_LAST 3999 + +// Because the client and server have a shared memory space for event data, +// but use different indexes for the event (servers cache them all upfront, +// while client creates them as sequences fire) we're going to store the server +// index in the low word and the client index in the high word. +// +// studio.h is a public header, so we'll use this matching struct to do the +// conversion and not force us to macro all the code that checks the event member. +// This struct's data MUST match mstudioevent_t +// +// BUT events that use the old event system use the entire dword which will always +// match between client and server. Instead of wrapping everything in if checks, +// for ( type & AE_TYPE_NEWEVENTSYSTEM ) we use the Event accessors to set/get +// while doing the check under the hood. +// +// -Jeep +struct mstudioevent_for_client_server_t +{ + DECLARE_BYTESWAP_DATADESC(); + float cycle; +#ifdef CLIENT_DLL + union + { + // Client shares with the high word + unsigned short _event_highword; + unsigned short event_newsystem; + }; + unsigned short _event_lowword; // Placeholder for the low word +#else + unsigned short _event_highword; // Placeholder for the high word + union + { + // Server shares with the low word + unsigned short _event_lowword; + unsigned short event_newsystem; + }; +#endif + + int type; + inline const char * pszOptions( void ) const { return options; } + char options[64]; + + int szeventindex; + inline char * const pszEventName( void ) const { return ((char *)this) + szeventindex; } + + // For setting and getting through Event, check the AE_TYPE_NEWEVENTSYSTEM flag to decide + // if we should set/get just the short used by the client/server or use the whole int. + int Event_OldSystem( void ) const { return *static_cast< const int* >( static_cast< const void* >( &_event_highword ) ); } + void Event_OldSystem( int nEvent ) { *static_cast< int* >( static_cast< void* >( &_event_highword ) ) = nEvent; } + int Event( void ) const + { + if ( type & AE_TYPE_NEWEVENTSYSTEM ) + return event_newsystem; + + return Event_OldSystem(); + } + void Event( int nEvent ) + { + if ( type & AE_TYPE_NEWEVENTSYSTEM ) + { + event_newsystem = nEvent; + } + else + { + Event_OldSystem( nEvent ); + } + } +}; + +#define mstudioevent_t mstudioevent_for_client_server_t + + #endif // NPCEVENT_H diff --git a/game/shared/predictioncopy.cpp b/game/shared/predictioncopy.cpp index 74535d747..b41f6557d 100644 --- a/game/shared/predictioncopy.cpp +++ b/game/shared/predictioncopy.cpp @@ -9,12 +9,9 @@ #if !defined( NO_ENTITY_PREDICTION ) -#if defined( CLIENT_DLL ) - #include "IGameSystem.h" #include - -#endif +#include "cdll_int.h" #include #include #include "tier0/dbg.h" @@ -22,10 +19,15 @@ #include "predictioncopy.h" #include "engine/ivmodelinfo.h" #include "tier1/fmtstr.h" +#include "utlvector.h" +#include "tier0/vprof.h" +#include "tier1/tokenset.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +CClassMemoryPool< optimized_datamap_t > g_OptimizedDataMapPool( 20, CUtlMemoryPool::GROW_SLOW ); + // -------------------------------------------------------------- // // CSave @@ -62,246 +64,500 @@ static const char *g_FieldTypes[ FIELD_TYPECOUNT ] = "FIELD_MODELINDEX" // FIELD_MODELINDEX }; -CPredictionCopy::CPredictionCopy( int type, void *dest, bool dest_packed, void const *src, bool src_packed, - bool counterrors /*= false*/, bool reporterrors /*= false*/, bool performcopy /*= true*/, - bool describefields /*= false*/, FN_FIELD_COMPARE func /*= NULL*/ ) -{ +static int g_FieldSizes[FIELD_TYPECOUNT] = +{ + 0, // FIELD_VOID + sizeof(float), // FIELD_FLOAT + sizeof(int), // FIELD_STRING + sizeof(Vector), // FIELD_VECTOR + sizeof(Quaternion), // FIELD_QUATERNION + sizeof(int), // FIELD_INTEGER + sizeof(char), // FIELD_BOOLEAN + sizeof(short), // FIELD_SHORT + sizeof(char), // FIELD_CHARACTER + sizeof(color32), // FIELD_COLOR32 + sizeof(int), // FIELD_EMBEDDED (handled specially) + sizeof(int), // FIELD_CUSTOM (handled specially) + + //--------------------------------- + + sizeof(int), // FIELD_CLASSPTR + sizeof(EHANDLE), // FIELD_EHANDLE + sizeof(int), // FIELD_EDICT + + sizeof(Vector), // FIELD_POSITION_VECTOR + sizeof(float), // FIELD_TIME + sizeof(int), // FIELD_TICK + sizeof(int), // FIELD_MODELNAME + sizeof(int), // FIELD_SOUNDNAME + + sizeof(int), // FIELD_INPUT (uses custom type) + sizeof(int *), // FIELD_FUNCTION + sizeof(VMatrix), // FIELD_VMATRIX + sizeof(VMatrix), // FIELD_VMATRIX_WORLDSPACE + sizeof(matrix3x4_t),// FIELD_MATRIX3X4_WORLDSPACE // NOTE: Use array(FIELD_FLOAT, 12) for matrix3x4_t NOT in worldspace + sizeof(interval_t), // FIELD_INTERVAL + sizeof(int), // FIELD_MODELINDEX +}; + +#define PREDICTIONCOPY_APPLY( func, nFieldType, pCurrentMap, pField, pOutputData, pInputData, fieldSize ) \ + switch( nFieldType ) \ + { \ + case FIELD_EMBEDDED: \ + { \ + Error( "FIELD_EMBEDDED in flat list!!!" ); \ + } \ + break; \ + case FIELD_FLOAT: \ + func( pCurrentMap, pField, (float *)pOutputData, (const float *)pInputData, fieldSize ); \ + break; \ + case FIELD_STRING: \ + func( pCurrentMap, pField, (char *)pOutputData, (const char *)pInputData, fieldSize ); \ + break; \ + case FIELD_VECTOR: \ + func( pCurrentMap, pField, (Vector *)pOutputData, (const Vector *)pInputData, fieldSize ); \ + break; \ + case FIELD_QUATERNION: \ + func( pCurrentMap, pField, (Quaternion *)pOutputData, (const Quaternion *)pInputData, fieldSize );\ + break; \ + case FIELD_COLOR32: \ + func( pCurrentMap, pField, (color32 *)pOutputData, (const color32 *)pInputData, fieldSize ); \ + break; \ + case FIELD_BOOLEAN: \ + func( pCurrentMap, pField, (bool *)pOutputData, (const bool *)pInputData, fieldSize ); \ + break; \ + case FIELD_INTEGER: \ + func( pCurrentMap, pField, (int *)pOutputData, (const int *)pInputData, fieldSize ); \ + break; \ + case FIELD_SHORT: \ + func( pCurrentMap, pField, (short *)pOutputData, (const short *)pInputData, fieldSize ); \ + break; \ + case FIELD_CHARACTER: \ + func( pCurrentMap, pField, (uint8 *)pOutputData, (const uint8 *)pInputData, fieldSize ); \ + break; \ + case FIELD_EHANDLE: \ + func( pCurrentMap, pField, (EHANDLE *)pOutputData, (const EHANDLE *)pInputData, fieldSize );\ + break; \ + default: \ + break; \ + } + +#define PREDICTIONCOPY_APPLY_NOEMBEDDED( func, nFieldType, pCurrentMap, pField, pOutputData, pInputData, fieldSize ) \ + switch( nFieldType ) \ + { \ + case FIELD_FLOAT: \ + func( pCurrentMap, pField, (float *)pOutputData, (const float *)pInputData, fieldSize ); \ + break; \ + case FIELD_STRING: \ + func( pCurrentMap, pField, (char *)pOutputData, (const char *)pInputData, fieldSize ); \ + break; \ + case FIELD_VECTOR: \ + func( pCurrentMap, pField, (Vector *)pOutputData, (const Vector *)pInputData, fieldSize ); \ + break; \ + case FIELD_QUATERNION: \ + func( pCurrentMap, pField, (Quaternion *)pOutputData, (const Quaternion *)pInputData, fieldSize );\ + break; \ + case FIELD_COLOR32: \ + func( pCurrentMap, pField, (color32 *)pOutputData, (const color32 *)pInputData, fieldSize ); \ + break; \ + case FIELD_BOOLEAN: \ + func( pCurrentMap, pField, (bool *)pOutputData, (const bool *)pInputData, fieldSize ); \ + break; \ + case FIELD_INTEGER: \ + func( pCurrentMap, pField, (int *)pOutputData, (const int *)pInputData, fieldSize ); \ + break; \ + case FIELD_SHORT: \ + func( pCurrentMap, pField, (short *)pOutputData, (const short *)pInputData, fieldSize ); \ + break; \ + case FIELD_CHARACTER: \ + func( pCurrentMap, pField, (uint8 *)pOutputData, (const uint8 *)pInputData, fieldSize ); \ + break; \ + case FIELD_EHANDLE: \ + func( pCurrentMap, pField, (EHANDLE *)pOutputData, (const EHANDLE *)pInputData, fieldSize );\ + break; \ + default: \ + break; \ + } + +CPredictionCopy::CPredictionCopy( int type, byte *dest, bool dest_packed, const byte *src, bool src_packed, + optype_t opType, FN_FIELD_COMPARE func /*= NULL*/ ) +{ + m_OpType = opType; m_nType = type; m_pDest = dest; m_pSrc = src; m_nDestOffsetIndex = dest_packed ? TD_OFFSET_PACKED : TD_OFFSET_NORMAL; m_nSrcOffsetIndex = src_packed ? TD_OFFSET_PACKED : TD_OFFSET_NORMAL; - m_bErrorCheck = counterrors; - m_bReportErrors = reporterrors; - m_bPerformCopy = performcopy; - m_bDescribeFields = describefields; - - m_pCurrentField = NULL; - m_pCurrentMap = NULL; - m_pCurrentClassName = NULL; - m_bShouldReport = false; - m_bShouldDescribe = false; + m_nErrorCount = 0; + m_nEntIndex = -1; + m_pWatchField = NULL; m_FieldCompareFunc = func; } -//----------------------------------------------------------------------------- -// Purpose: -// Input : *fmt - -// ... - -//----------------------------------------------------------------------------- -void CPredictionCopy::ReportFieldsDiffer( const char *fmt, ... ) -{ - ++m_nErrorCount; +static ConVar cl_pred_error_verbose( "cl_pred_error_verbose", "0", 0, "Show more field info when spewing prediction errors." ); - if ( !m_bShouldReport ) - return; +template< class T > +inline void CPredictionCopy::CopyField( difftype_t difftype, T *outvalue, const T *invalue, int count ) +{ + for ( int i = 0; i < count; ++i ) + { + outvalue[ i ] = invalue[ i ]; + } +} - if ( m_bDescribeFields && m_FieldCompareFunc ) - return; +// specialized for strings +template<> +inline void CPredictionCopy::CopyField( difftype_t difftype, char *outvalue, const char *invalue, int count ) +{ + Q_strcpy( outvalue, invalue ); +} - Assert( m_pCurrentMap ); - Assert( m_pCurrentClassName ); +template< class T > +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const T *outvalue, int count ) +{ + Assert( 0 ); +} - const char *fieldname = "empty"; - int flags = 0; +// Short +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const short *outvalue, int count ) +{ + WatchMsg( pField, "short (%i)", (int)(outvalue[0]) ); +} - if ( m_pCurrentField ) +// Int +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const int *outvalue, int count ) +{ + bool described = false; + if ( pField->flags & FTYPEDESC_MODELINDEX ) { - flags = m_pCurrentField->flags; - fieldname = m_pCurrentField->fieldName ? m_pCurrentField->fieldName : "NULL"; - } + int modelindex = outvalue[0]; + model_t const *m = modelinfo->GetModel( modelindex ); + if ( m ) + { + described = true; + char shortfile[ 512 ]; + shortfile[ 0 ] = 0; + Q_FileBase( modelinfo->GetModelName( m ), shortfile, sizeof( shortfile ) ); - va_list argptr; - char data[ 4096 ]; - int len; - va_start(argptr, fmt); - len = Q_vsnprintf(data, sizeof( data ), fmt, argptr); - va_end(argptr); + WatchMsg( pField, "integer (%i->%s)", outvalue[0], shortfile ); + } + } - if ( m_nErrorCount == 1 ) + if ( !described ) { - Msg( "\n" ); + WatchMsg( pField, "integer (%i)", outvalue[0] ); } +} - Msg( "%03i %s::%s - %s", - m_nErrorCount, - m_pCurrentClassName, - fieldname, - data ); +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const bool *outvalue, int count ) +{ + WatchMsg( pField, "bool (%s)", (outvalue[0]) ? "true" : "false" ); +} - m_bShouldReport = false; +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const float *outvalue, int count ) +{ + WatchMsg( pField, "float (%f)", outvalue[ 0 ] ); } -//----------------------------------------------------------------------------- -// Purpose: -// Input : *fmt - -// ... - -//----------------------------------------------------------------------------- -void CPredictionCopy::DescribeFields( difftype_t dt, const char *fmt, ... ) +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const char *outstring, int count ) { - if ( !m_bShouldDescribe ) - return; + WatchMsg( pField, "string (%s)", outstring ); +} - if ( !m_FieldCompareFunc ) - return; +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const Vector* outValue, int count ) +{ + WatchMsg( pField, "vector (%f %f %f)", outValue[0].x, outValue[0].y, outValue[0].z ); +} - Assert( m_pCurrentMap ); - Assert( m_pCurrentClassName ); +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const Quaternion* outValue, int count ) +{ + WatchMsg( pField, "quaternion (%f %f %f %f)", outValue[0].x, outValue[0].y, outValue[0].z, outValue[0].w ); +} - const char *fieldname = "empty"; - int flags = 0; +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const EHANDLE *outvalue, int count ) +{ + C_BaseEntity *ent = outvalue[0].Get(); + if ( ent ) + { + const char *classname = ent->GetClassname(); + if ( !classname[0] ) + { + classname = typeid( *ent ).name(); + } - if ( m_pCurrentField ) + WatchMsg( pField, "EHandle (0x%p->%s)", (void *)outvalue[ 0 ], classname ); + } + else { - flags = m_pCurrentField->flags; - fieldname = m_pCurrentField->fieldName ? m_pCurrentField->fieldName : "NULL"; + WatchMsg( pField, "EHandle (NULL)" ); } +} - va_list argptr; - char data[ 4096 ]; - int len; - va_start(argptr, fmt); - len = Q_vsnprintf(data, sizeof( data ), fmt, argptr); - va_end(argptr); - - bool isnetworked = ( flags & FTYPEDESC_INSENDTABLE ) ? true : false; - bool isnoterrorchecked = ( flags & FTYPEDESC_NOERRORCHECK ) ? true : false; - - ( *m_FieldCompareFunc )( - m_pCurrentClassName, - fieldname, - g_FieldTypes[ m_pCurrentField->fieldType ], - isnetworked, - isnoterrorchecked, - dt != IDENTICAL ? true : false, - dt == WITHINTOLERANCE ? true : false, - data - ); - - m_bShouldDescribe = false; +void CPredictionCopy::DumpWatchField( const typedescription_t *pField, const byte *outvalue, int count ) +{ + switch ( pField->fieldType ) + { + case FIELD_FLOAT: + WatchField( pField, (const float *)outvalue, count ); + break; + case FIELD_STRING: + WatchField( pField, (const char *)outvalue, count ); + break; + case FIELD_VECTOR: + WatchField( pField, (const Vector *)outvalue, count ); + break; + case FIELD_QUATERNION: + WatchField( pField, (const Quaternion *)outvalue, count ); + break; + case FIELD_COLOR32: + WatchField( pField, (const color32 *)outvalue, count ); + break; + case FIELD_BOOLEAN: + WatchField( pField, (const bool *)outvalue, count ); + break; + case FIELD_INTEGER: + WatchField( pField, (const int *)outvalue, count ); + break; + case FIELD_SHORT: + WatchField( pField, (const short *)outvalue, count ); + break; + case FIELD_CHARACTER: + WatchField( pField, (const uint8 *)outvalue, count ); + break; + case FIELD_EHANDLE: + WatchField( pField, (const EHANDLE *)outvalue, count ); + break; + default: + break; + } } -//----------------------------------------------------------------------------- -// Purpose: -// Output : Returns true on success, false on failure. -//----------------------------------------------------------------------------- -bool CPredictionCopy::CanCheck( void ) +// color32 +template<> +inline void CPredictionCopy::WatchField( const typedescription_t *pField, const color32 *outvalue, int count ) { - Assert( m_pCurrentField ); + WatchMsg( pField, "color32 (%d %d %d %d)", outvalue[0].r, outvalue[0].g, outvalue[0].b, outvalue[0].a ); +} - if ( m_pCurrentField->flags & FTYPEDESC_NOERRORCHECK ) +inline bool QuaternionCompare( const Quaternion& q1, const Quaternion& q2 ) +{ + for ( int i = 0; i < 4; ++i ) { - return false; + if ( q1[i] != q2[i] ) + return false; } - return true; } -//----------------------------------------------------------------------------- -// Purpose: -// Input : size - -// *outdata - -// *indata - -//----------------------------------------------------------------------------- -/* -void CPredictionCopy::CopyData( difftype_t dt, int size, char *outdata, const char *indata ) +template< class T > +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const T *outvalue, const T *invalue, int count ) { - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - memcpy( outdata, indata, size ); + for ( int i = 0; i < count; i++ ) + { + if ( outvalue[ i ] == invalue[ i ] ) + continue; + return DIFFERS; + } + return IDENTICAL; } -*/ -CPredictionCopy::difftype_t CPredictionCopy::CompareData( int size, char *outdata, const char *indata ) +// float uses tolerance +template<> +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const float *outvalue, const float *invalue, int count ) { - if ( !m_bErrorCheck ) - return DIFFERS; + difftype_t retval = IDENTICAL; + + float tolerance = pField->fieldTolerance; + Assert( tolerance >= 0.0f ); + bool usetolerance = tolerance > 0.0f; - if ( CanCheck() ) + if ( usetolerance ) { - if ( memcmp( outdata, indata, size ) ) + for ( int i = 0; i < count; ++i ) { + float diff = fabs( outvalue[ i ] - invalue[ i ] ); + if ( diff <= tolerance ) + { + retval = WITHINTOLERANCE; + continue; + } + return DIFFERS; } - else + } + else + { + for ( int i = 0; i < count; ++i ) { - // No difference, so no need to copy - return IDENTICAL; + if ( outvalue[ i ] == invalue[ i ] ) + continue; + return DIFFERS; } } - - // Fields differ - return IDENTICAL; + return retval; } -void CPredictionCopy::DescribeData( difftype_t dt, int size, char *outdata, const char *indata ) +// vector uses tolerance +template<> +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const Vector *outvalue, const Vector *invalue, int count ) { - if ( !m_bErrorCheck ) - return; + difftype_t retval = IDENTICAL; + + float tolerance = pField->fieldTolerance; + Assert( tolerance >= 0.0f ); + bool usetolerance = tolerance > 0.0f; - if ( dt == DIFFERS ) + if ( usetolerance ) { - ReportFieldsDiffer( "binary data differs (%i bytes)\n", size ); - } + for ( int i = 0; i < count; ++i ) + { + Vector delta = outvalue[ i ] - invalue[ i ]; + + if ( delta.x <= tolerance && + delta.y <= tolerance && + delta.z <= tolerance ) + { + retval = WITHINTOLERANCE; + continue; + } - DescribeFields( dt, "binary (%i bytes)\n", size ); + return DIFFERS; + } + } + else + { + for ( int i = 0; i < count; ++i ) + { + if ( outvalue[ i ] == invalue[ i ] ) + continue; + return DIFFERS; + } + } + return retval; } -void CPredictionCopy::WatchData( difftype_t dt, int size, char *outdata, const char *indata ) +// quaternion uses tolerance +template<> +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const Quaternion *outvalue, const Quaternion *invalue, int count ) { - if ( m_pWatchField != m_pCurrentField ) - return; + difftype_t retval = IDENTICAL; + + + float tolerance = pField->fieldTolerance; + Assert( tolerance >= 0.0f ); + bool usetolerance = tolerance > 0.0f; + + if ( usetolerance ) + { + for ( int i = 0; i < count; ++i ) + { + Quaternion delta; + for ( int j = 0; j < 4; j++ ) + { + delta[i] = outvalue[i][j] - invalue[i][j]; + } + + if ( delta.x <= tolerance && + delta.y <= tolerance && + delta.z <= tolerance && + delta.w <= tolerance ) + { + retval = WITHINTOLERANCE; + continue; + } - WatchMsg( "binary (%i bytes)", size ); + return DIFFERS; + } + } + else + { + for ( int i = 0; i < count; ++i ) + { + if ( QuaternionCompare( outvalue[ i ], invalue[ i ] ) ) + continue; + return DIFFERS; + } + } + return retval; } -void CPredictionCopy::DescribeShort( difftype_t dt, short *outvalue, const short *invalue, int count ) +// string +template<> +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const char *outvalue, const char *invalue, int count ) { - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + if ( Q_strcmp( outvalue, invalue ) ) { - int i = 0; - ReportFieldsDiffer( "short differs (net %i pred %i) diff(%i)\n", (int)(invalue[i]), (int)(outvalue[i]), (int)(outvalue[i] - invalue[i]) ); + return DIFFERS; } + return IDENTICAL; +} - DescribeFields( dt, "short (%i)\n", (int)(outvalue[0]) ); +// ehandle +template<> +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const EHANDLE *outvalue, const EHANDLE *invalue, int count ) +{ + for ( int i = 0; i < count; i++ ) + { + if ( outvalue[ i ].Get() == invalue[ i ].Get() ) + continue; + return DIFFERS; + } + return IDENTICAL; } -void CPredictionCopy::WatchShort( difftype_t dt, short *outvalue, const short *invalue, int count ) +// color32 +template<> +inline CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const color32 *outvalue, const color32 *invalue, int count ) { - if ( m_pWatchField != m_pCurrentField ) - return; + for ( int i = 0; i < count; i++ ) + { + if ( outvalue[ i ] != invalue[ i ] ) + return DIFFERS; + } + return IDENTICAL; +} - WatchMsg( "short (%i)", (int)(outvalue[0]) ); +template< class T > +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const T *outvalue, const T *invalue, int count ) +{ + Assert( 0 ); } -#if defined( CLIENT_DLL ) -#include "cdll_int.h" +// short +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const short *outvalue, const short *invalue, int count ) +{ + if ( difftype == DIFFERS ) + { + int i = 0; + ReportFieldsDiffer( pCurrentMap, pField, "short differs (net %i pred %i) diff(%i)\n", (int)(invalue[i]), (int)(outvalue[i]), (int)(outvalue[i] - invalue[i]) ); + } -#endif + OutputFieldDescription( pCurrentMap, pField, difftype, "short (%i)\n", (int)(outvalue[0]) ); +} -void CPredictionCopy::DescribeInt( difftype_t dt, int *outvalue, const int *invalue, int count ) +// int +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const int *outvalue, const int *invalue, int count ) { - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + if ( difftype == DIFFERS ) { int i = 0; - ReportFieldsDiffer( "int differs (net %i pred %i) diff(%i)\n", invalue[i], outvalue[i], outvalue[i] - invalue[i] ); + ReportFieldsDiffer( pCurrentMap, pField, "int differs (net %i pred %i) diff(%i)\n", invalue[i], outvalue[i], outvalue[i] - invalue[i] ); } -#if defined( CLIENT_DLL ) bool described = false; - if ( m_pCurrentField->flags & FTYPEDESC_MODELINDEX ) + if ( pField->flags & FTYPEDESC_MODELINDEX ) { int modelindex = outvalue[0]; model_t const *m = modelinfo->GetModel( modelindex ); @@ -312,280 +568,98 @@ void CPredictionCopy::DescribeInt( difftype_t dt, int *outvalue, const int *inva shortfile[ 0 ] = 0; Q_FileBase( modelinfo->GetModelName( m ), shortfile, sizeof( shortfile ) ); - DescribeFields( dt, "integer (%i->%s)\n", outvalue[0], shortfile ); + OutputFieldDescription( pCurrentMap, pField, difftype, "integer (%i->%s)\n", outvalue[0], shortfile ); } } if ( !described ) { - DescribeFields( dt, "integer (%i)\n", outvalue[0] ); + OutputFieldDescription( pCurrentMap, pField, difftype, "integer (%i)\n", outvalue[0] ); } -#else - DescribeFields( dt, "integer (%i)\n", outvalue[0] ); -#endif } -void CPredictionCopy::WatchInt( difftype_t dt, int *outvalue, const int *invalue, int count ) +// bool +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const bool *outvalue, const bool *invalue, int count ) { - if ( m_pWatchField != m_pCurrentField ) - return; + if ( difftype == DIFFERS ) + { + int i = 0; + ReportFieldsDiffer( pCurrentMap, pField, "bool differs (net %s pred %s)\n", (invalue[i]) ? "true" : "false", (outvalue[i]) ? "true" : "false" ); + } -#if defined( CLIENT_DLL ) - bool described = false; - if ( m_pCurrentField->flags & FTYPEDESC_MODELINDEX ) - { - int modelindex = outvalue[0]; - model_t const *m = modelinfo->GetModel( modelindex ); - if ( m ) - { - described = true; - char shortfile[ 512 ]; - shortfile[ 0 ] = 0; - Q_FileBase( modelinfo->GetModelName( m ), shortfile, sizeof( shortfile ) ); - - WatchMsg( "integer (%i->%s)", outvalue[0], shortfile ); - } - } - - if ( !described ) - { - WatchMsg( "integer (%i)", outvalue[0] ); - } -#else - WatchMsg( "integer (%i)", outvalue[0] ); -#endif -} - -void CPredictionCopy::DescribeBool( difftype_t dt, bool *outvalue, const bool *invalue, int count ) -{ - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) - { - int i = 0; - ReportFieldsDiffer( "bool differs (net %s pred %s)\n", (invalue[i]) ? "true" : "false", (outvalue[i]) ? "true" : "false" ); - } - - DescribeFields( dt, "bool (%s)\n", (outvalue[0]) ? "true" : "false" ); -} - - -void CPredictionCopy::WatchBool( difftype_t dt, bool *outvalue, const bool *invalue, int count ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "bool (%s)", (outvalue[0]) ? "true" : "false" ); -} - -void CPredictionCopy::DescribeFloat( difftype_t dt, float *outvalue, const float *invalue, int count ) -{ - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + OutputFieldDescription( pCurrentMap, pField, difftype, "bool (%s)\n", (outvalue[0]) ? "true" : "false" ); +} + +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const float *outvalue, const float *invalue, int count ) +{ + if ( difftype == DIFFERS ) { int i = 0; - ReportFieldsDiffer( "float differs (net %f pred %f) diff(%f)\n", invalue[ i ], outvalue[ i ], outvalue[ i ] - invalue[ i ] ); - } - - DescribeFields( dt, "float (%f)\n", outvalue[ 0 ] ); -} - -void CPredictionCopy::WatchFloat( difftype_t dt, float *outvalue, const float *invalue, int count ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "float (%f)", outvalue[ 0 ] ); -} - -void CPredictionCopy::DescribeString( difftype_t dt, char *outstring, const char *instring ) -{ - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) - { - ReportFieldsDiffer( "string differs (net %s pred %s)\n", instring, outstring ); + ReportFieldsDiffer( pCurrentMap, pField, "float differs (net %f pred %f) diff(%f)\n", invalue[ i ], outvalue[ i ], outvalue[ i ] - invalue[ i ] ); } - DescribeFields( dt, "string (%s)\n", outstring ); -} - -void CPredictionCopy::WatchString( difftype_t dt, char *outstring, const char *instring ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "string (%s)", outstring ); + OutputFieldDescription( pCurrentMap, pField, difftype, "float (%f)\n", outvalue[ 0 ] ); } -void CPredictionCopy::DescribeVector( difftype_t dt, Vector& outValue, const Vector &inValue ) +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const char *outstring, const char *instring, int count ) { - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + if ( difftype == DIFFERS ) { - Vector delta = outValue - inValue; - - ReportFieldsDiffer( "vec differs (net %f %f %f - pred %f %f %f) delta(%f %f %f)\n", - inValue.x, inValue.y, inValue.z, - outValue.x, outValue.y, outValue.z, - delta.x, delta.y, delta.z ); + ReportFieldsDiffer( pCurrentMap, pField, "string differs (net %s pred %s)\n", instring, outstring ); } - DescribeFields( dt, "vector (%f %f %f)\n", - outValue.x, outValue.y, outValue.z ); + OutputFieldDescription( pCurrentMap, pField, difftype, "string (%s)\n", outstring ); } -void CPredictionCopy::DescribeVector( difftype_t dt, Vector* outValue, const Vector *inValue, int count ) +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const Vector *outValue, const Vector *inValue, int count ) { - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + if ( difftype == DIFFERS ) { int i = 0; Vector delta = outValue[ i ] - inValue[ i ]; - - ReportFieldsDiffer( "vec[] differs (1st diff) (net %f %f %f - pred %f %f %f) delta(%f %f %f)\n", + ReportFieldsDiffer( pCurrentMap, pField, "vec[] differs (1st diff) (net %f %f %f - pred %f %f %f) delta(%f %f %f)\n", inValue[i].x, inValue[i].y, inValue[i].z, outValue[i].x, outValue[i].y, outValue[i].z, delta.x, delta.y, delta.z ); } - - DescribeFields( dt, "vector (%f %f %f)\n", - outValue[0].x, outValue[0].y, outValue[0].z ); -} - -void CPredictionCopy::WatchVector( difftype_t dt, Vector& outValue, const Vector &inValue ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "vector (%f %f %f)", outValue.x, outValue.y, outValue.z ); -} - -void CPredictionCopy::WatchVector( difftype_t dt, Vector* outValue, const Vector *inValue, int count ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "vector (%f %f %f)", outValue[0].x, outValue[0].y, outValue[0].z ); -} - - - -void CPredictionCopy::DescribeQuaternion( difftype_t dt, Quaternion& outValue, const Quaternion &inValue ) -{ - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) - { - Quaternion delta; - - for ( int i = 0; i < 4; i++ ) - { - delta[i] = outValue[i] - inValue[i]; - } - - ReportFieldsDiffer( "quaternion differs (net %f %f %f %f - pred %f %f %f %f) delta(%f %f %f %f)\n", - inValue[0], inValue[1], inValue[2], inValue[3], - outValue[0], outValue[1], outValue[2], outValue[3], - delta[0], delta[1], delta[2], delta[3] ); - } - - DescribeFields( dt, "quaternion (%f %f %f %f)\n", - outValue[0], outValue[1], outValue[2], outValue[3] ); + OutputFieldDescription( pCurrentMap, pField, difftype, "vector (%f %f %f)\n", + outValue[0].x, outValue[0].y, outValue[0].z ); } -void CPredictionCopy::DescribeQuaternion( difftype_t dt, Quaternion* outValue, const Quaternion *inValue, int count ) +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const Quaternion *outValue, const Quaternion *inValue, int count ) { - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + if ( difftype == DIFFERS ) { int i = 0; Quaternion delta; - for ( int j = 0; j < 4; j++ ) { delta[i] = outValue[i][j] - inValue[i][j]; } - ReportFieldsDiffer( "quaternion[] differs (1st diff) (net %f %f %f %f - pred %f %f %f %f) delta(%f %f %f %f)\n", - inValue->x, inValue->y, inValue->z, inValue->w, - outValue->x, outValue->y, outValue->z, outValue->w, - delta.x, delta.y, delta.z, delta.w ); + ReportFieldsDiffer( pCurrentMap, pField, "quaternion[] differs (1st diff) (net %f %f %f %f - pred %f %f %f %f) delta(%f %f %f %f)\n", + inValue[i].x, inValue[i].y, inValue[i].z, inValue[i].w, + outValue[i].x, outValue[i].y, outValue[i].z, outValue[i].w, + delta[0], delta[1], delta[2], delta[3] ); } - DescribeFields( dt, "quaternion (%f %f %f %f)\n", - outValue->x, outValue->y, outValue->z, outValue->w ); -} - -void CPredictionCopy::WatchQuaternion( difftype_t dt, Quaternion& outValue, const Quaternion &inValue ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "quaternion (%f %f %f %f)", outValue[0], outValue[1], outValue[2], outValue[3] ); + OutputFieldDescription( pCurrentMap, pField, difftype, "quaternion (%f %f %f %f)\n", outValue[0][0], outValue[0][1], outValue[0][2], outValue[3] ); } -void CPredictionCopy::WatchQuaternion( difftype_t dt, Quaternion* outValue, const Quaternion *inValue, int count ) +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const EHANDLE *outvalue, EHANDLE const *invalue, int count ) { - if ( m_pWatchField != m_pCurrentField ) - return; - - WatchMsg( "quaternion (%f %f %f %f)", outValue[0][0], outValue[0][1], outValue[0][2], outValue[0][3] ); -} - - - -void CPredictionCopy::DescribeEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE const *invalue, int count ) -{ - if ( !m_bErrorCheck ) - return; - - if ( dt == DIFFERS ) + if ( difftype == DIFFERS ) { int i = 0; - ReportFieldsDiffer( "EHandles differ (net) 0x%p (pred) 0x%p\n", (void const *)invalue[ i ].Get(), (void *)outvalue[ i ].Get() ); - } - -#if defined( CLIENT_DLL ) - C_BaseEntity *ent = outvalue[0].Get(); - if ( ent ) - { - const char *classname = ent->GetClassname(); - if ( !classname[0] ) - { - classname = typeid( *ent ).name(); - } - - DescribeFields( dt, "EHandle (0x%p->%s)", (void *)outvalue[ 0 ], classname ); + ReportFieldsDiffer( pCurrentMap, pField, "EHandles differ (net) 0x%p (pred) 0x%p\n", (void const *)invalue[ i ].Get(), (void *)outvalue[ i ].Get() ); } - else - { - DescribeFields( dt, "EHandle (NULL)" ); - } - -#else - DescribeFields( dt, "EHandle (0x%p)", (void *)outvalue[ 0 ] ); -#endif - -} -void CPredictionCopy::WatchEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE const *invalue, int count ) -{ - if ( m_pWatchField != m_pCurrentField ) - return; - -#if defined( CLIENT_DLL ) C_BaseEntity *ent = outvalue[0].Get(); if ( ent ) { @@ -595,733 +669,229 @@ void CPredictionCopy::WatchEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE co classname = typeid( *ent ).name(); } - WatchMsg( "EHandle (0x%p->%s)", (void *)outvalue[ 0 ], classname ); + OutputFieldDescription( pCurrentMap, pField, difftype, "EHandle (0x%p->%s)", (void *)outvalue[ 0 ], classname ); } else { - WatchMsg( "EHandle (NULL)" ); + OutputFieldDescription( pCurrentMap, pField, difftype, "EHandle (NULL)" ); } - -#else - WatchMsg( "EHandle (0x%p)", (void *)outvalue[ 0 ] ); -#endif - -} - -void CPredictionCopy::CopyShort( difftype_t dt, short *outvalue, const short *invalue, int count ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - CopyData( dt, sizeof(short) * count, (char *)outvalue, (const char *)invalue ); } -CPredictionCopy::difftype_t CPredictionCopy::CompareShort( short *outvalue, const short *invalue, int count ) +// color32 +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const color32 *outvalue, const color32 *invalue, int count ) { - if ( !m_bErrorCheck ) - return DIFFERS; - - if ( CanCheck() ) + if ( difftype == DIFFERS ) { - for ( int i = 0; i < count; i++ ) - { - if ( outvalue[ i ] == invalue[ i ] ) - continue; - - return DIFFERS; - } + ReportFieldsDiffer( pCurrentMap, pField, "color differs (net %d %d %d %d pred %d %d %d %d)\n", + outvalue[ 0 ].r, + outvalue[ 0 ].g, + outvalue[ 0 ].b, + outvalue[ 0 ].a, + invalue[ 0 ].r, + invalue[ 0 ].g, + invalue[ 0 ].b, + invalue[ 0 ].a + ); } - return IDENTICAL; -} - - -void CPredictionCopy::CopyInt( difftype_t dt, int *outvalue, const int *invalue, int count ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - CopyData( dt, sizeof(int) * count, (char *)outvalue, (const char *)invalue ); + OutputFieldDescription( pCurrentMap, pField, difftype, "color (%d %d %d %d)\n", + outvalue[ 0 ].r, + outvalue[ 0 ].g, + outvalue[ 0 ].b, + outvalue[ 0 ].a ); } -CPredictionCopy::difftype_t CPredictionCopy::CompareInt( int *outvalue, const int *invalue, int count ) +template<> +inline void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const uint8 *outstring, const uint8 *instring, int count ) { - if ( !m_bErrorCheck ) - return DIFFERS; - - if ( CanCheck() ) + if ( difftype == DIFFERS ) { - for ( int i = 0; i < count; i++ ) - { - if ( outvalue[ i ] == invalue[ i ] ) - continue; - - ReportFieldsDiffer( "int differs (net %i pred %i) diff(%i)\n", invalue[i], outvalue[i], outvalue[i] - invalue[i] ); - return DIFFERS; - } + ReportFieldsDiffer( pCurrentMap, pField, "byte differs (net %d pred %d)\n", int(instring[0]), int(outstring[0]) ); } - return IDENTICAL; + OutputFieldDescription( pCurrentMap, pField, difftype, "byte (%d)\n", int(outstring[0]) ); } -void CPredictionCopy::CopyBool( difftype_t dt, bool *outvalue, const bool *invalue, int count ) +//----------------------------------------------------------------------------- +// Purpose: +// Input : *fmt - +// ... - +//----------------------------------------------------------------------------- +void CPredictionCopy::ReportFieldsDiffer( const datamap_t *pCurrentMap, const typedescription_t *pField, const char *fmt, ... ) { - if ( !m_bPerformCopy ) - return; + ++m_nErrorCount; - if ( dt == IDENTICAL ) + if ( m_FieldCompareFunc ) return; - CopyData( dt, sizeof( bool ) * count, (char *)outvalue, (const char *)invalue ); -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareBool( bool *outvalue, const bool *invalue, int count ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; + const char *fieldname = "empty"; + const char *classname = "empty"; + int flags = 0; - if ( CanCheck() ) + if ( pField ) { - for ( int i = 0; i < count; i++ ) - { - if ( outvalue[ i ] == invalue[ i ] ) - continue; - - return DIFFERS; - } + flags = pField->flags; + fieldname = pField->fieldName ? pField->fieldName : "NULL"; + classname = pCurrentMap->dataClassName; } - return IDENTICAL; -} - -void CPredictionCopy::CopyFloat( difftype_t dt, float *outvalue, const float *invalue, int count ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - CopyData( dt, sizeof( float ) * count, (char *)outvalue, (const char *)invalue ); -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareFloat( float *outvalue, const float *invalue, int count ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - difftype_t retval = IDENTICAL; + va_list argptr; + char data[ 4096 ]; + int len; + va_start(argptr, fmt); + len = Q_vsnprintf(data, sizeof( data ), fmt, argptr); + va_end(argptr); - if ( CanCheck() ) + bool bUseLongName = cl_pred_error_verbose.GetBool(); + CUtlString longName; + for ( int i = 0; i < m_FieldStack.Count(); ++i ) { - float tolerance = m_pCurrentField->fieldTolerance; - Assert( tolerance >= 0.0f ); - bool usetolerance = tolerance > 0.0f; - - for ( int i = 0; i < count; i++ ) - { - if ( outvalue[ i ] == invalue[ i ] ) - continue; + const typedescription_t *top = m_FieldStack[ i ]; + if ( !top ) + continue; - if ( usetolerance && - ( fabs( outvalue[ i ] - invalue[ i ] ) <= tolerance ) ) - { - retval = WITHINTOLERANCE; - continue; - } + if ( top->flags & FTYPEDESC_KEY ) + bUseLongName = true; - return DIFFERS; - } + longName += top->fieldName ? top->fieldName : "NULL"; + longName += "/"; } - return retval; -} - -void CPredictionCopy::CopyString( difftype_t dt, char *outstring, const char *instring ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - CopyData( dt, Q_strlen( instring ) + 1, (char *)outstring, (const char *)instring ); -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareString( char *outstring, const char *instring ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - if ( CanCheck() ) + if ( bUseLongName ) + { + Msg( "%2d (%d)%s%s::%s - %s", + m_nErrorCount, + m_nEntIndex, + longName.String(), + classname, + fieldname, + data ); + } + else { - if ( Q_strcmp( outstring, instring ) ) - { - return DIFFERS; - } + Msg( "%2d (%d)%s::%s - %s", + m_nErrorCount, + m_nEntIndex, + classname, + fieldname, + data ); } - - return IDENTICAL; -} - -void CPredictionCopy::CopyVector( difftype_t dt, Vector& outValue, const Vector &inValue ) -{ - CopyVector( dt, &outValue, &inValue, 1 ); } -void CPredictionCopy::CopyQuaternion( difftype_t dt, Quaternion& outValue, const Quaternion &inValue ) -{ - CopyQuaternion( dt, &outValue, &inValue, 1 ); -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareVector( Vector& outValue, const Vector &inValue ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - if ( CanCheck() ) - { - float tolerance = m_pCurrentField->fieldTolerance; - Assert( tolerance >= 0.0f ); - - if ( outValue != inValue && ( tolerance > 0.0f ) ) - { - Vector delta = outValue - inValue; - - if ( fabs( delta.x ) <= tolerance && - fabs( delta.y ) <= tolerance && - fabs( delta.z ) <= tolerance ) - { - return WITHINTOLERANCE; - } - } - - return DIFFERS; - } - - return IDENTICAL; -} - -static int QuaternionCompare (const Quaternion& q1, const Quaternion& q2 ) -{ - for ( int i = 0; i < 4; i++ ) - { - if ( q1[i] != q2[i] ) - return 0; - } - - return 1; -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareQuaternion( Quaternion& outValue, const Quaternion &inValue ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - if ( CanCheck() ) - { - float tolerance = m_pCurrentField->fieldTolerance; - Assert( tolerance >= 0.0f ); - - if ( QuaternionCompare( outValue, inValue ) == 0 - && ( tolerance > 0.0f ) ) - { - Quaternion delta; - - for ( int j = 0; j < 4; j++ ) - { - delta[j] = outValue[j] - inValue[j]; - } - - if ( fabs( delta[0] ) <= tolerance && - fabs( delta[1] ) <= tolerance && - fabs( delta[2] ) <= tolerance && - fabs( delta[3] ) <= tolerance ) - { - return WITHINTOLERANCE; - } - } - - return DIFFERS; - } - - return IDENTICAL; -} - -void CPredictionCopy::CopyVector( difftype_t dt, Vector* outValue, const Vector *inValue, int count ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - CopyData( dt, sizeof( Vector ) * count, (char *)outValue, (const char *)inValue ); -} - -void CPredictionCopy::CopyQuaternion( difftype_t dt, Quaternion* outValue, const Quaternion *inValue, int count ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - CopyData( dt, sizeof( Quaternion ) * count, (char *)outValue, (const char *)inValue ); -} - - -CPredictionCopy::difftype_t CPredictionCopy::CompareVector( Vector* outValue, const Vector *inValue, int count ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - difftype_t retval = IDENTICAL; - - if ( CanCheck() ) - { - float tolerance = m_pCurrentField->fieldTolerance; - Assert( tolerance >= 0.0f ); - - for ( int i = 0; i < count; i++ ) - { - if ( outValue[ i ] == inValue[ i ] ) - continue; - - Vector delta = outValue[ i ] - inValue[ i ]; - - if ( tolerance > 0.0f ) - { - if ( fabs( delta.x ) <= tolerance && - fabs( delta.y ) <= tolerance && - fabs( delta.z ) <= tolerance ) - { - retval = WITHINTOLERANCE; - continue; - } - } - return DIFFERS; - } - } - - return retval; -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareQuaternion( Quaternion* outValue, const Quaternion *inValue, int count ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - difftype_t retval = IDENTICAL; - - if ( CanCheck() ) - { - float tolerance = m_pCurrentField->fieldTolerance; - Assert( tolerance >= 0.0f ); - - for ( int i = 0; i < count; i++ ) - { - if ( QuaternionCompare( outValue[ i ], inValue[ i ] ) ) - continue; - - Quaternion delta; - - for ( int j = 0; j < 4; j++ ) - { - delta[i] = outValue[i][j] - inValue[i][j]; - } - - if ( tolerance > 0.0f ) - { - if ( fabs( delta[0] ) <= tolerance && - fabs( delta[1] ) <= tolerance && - fabs( delta[2] ) <= tolerance && - fabs( delta[3] ) <= tolerance ) - { - retval = WITHINTOLERANCE; - continue; - } - } - return DIFFERS; - } - } - - return retval; -} - -void CPredictionCopy::CopyEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE const *invalue, int count ) -{ - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - for ( int i = 0; i < count; i++ ) - { - outvalue[ i ] = invalue[ i ]; - } -} - -CPredictionCopy::difftype_t CPredictionCopy::CompareEHandle( EHANDLE *outvalue, EHANDLE const *invalue, int count ) -{ - if ( !m_bErrorCheck ) - return DIFFERS; - - int i; - if ( CanCheck() ) - { - for ( i = 0; i < count; i++ ) - { - if ( outvalue[ i ].Get() == invalue[ i ].Get() ) - continue; - - return DIFFERS; - } - } - - return IDENTICAL; -} - -void CPredictionCopy::CopyFields( int chain_count, datamap_t *pRootMap, typedescription_t *pFields, int fieldCount ) -{ - int i; - int flags; - int fieldOffsetSrc; - int fieldOffsetDest; - int fieldSize; - - m_pCurrentMap = pRootMap; - if ( !m_pCurrentClassName ) - { - m_pCurrentClassName = pRootMap->dataClassName; - } - - for ( i = 0; i < fieldCount; i++ ) - { - m_pCurrentField = &pFields[ i ]; - flags = m_pCurrentField->flags; - - // Mark any subchains first - if ( m_pCurrentField->override_field != NULL ) - { - m_pCurrentField->override_field->override_count = chain_count; - } - - // Skip this field? - if ( m_pCurrentField->override_count == chain_count ) - { - continue; - } - - // Always recurse into embeddeds - if ( m_pCurrentField->fieldType != FIELD_EMBEDDED ) - { - // Don't copy fields that are private to server or client - if ( flags & FTYPEDESC_PRIVATE ) - continue; - - // For PC_NON_NETWORKED_ONLYs skip any fields that are present in the network send tables - if ( m_nType == PC_NON_NETWORKED_ONLY && ( flags & FTYPEDESC_INSENDTABLE ) ) - continue; - - // For PC_NETWORKED_ONLYs skip any fields that are not present in the network send tables - if ( m_nType == PC_NETWORKED_ONLY && !( flags & FTYPEDESC_INSENDTABLE ) ) - continue; - } - - void *pOutputData; - void const *pInputData; - - fieldOffsetDest = m_pCurrentField->fieldOffset[ m_nDestOffsetIndex ]; - fieldOffsetSrc = m_pCurrentField->fieldOffset[ m_nSrcOffsetIndex ]; - fieldSize = m_pCurrentField->fieldSize; - - pOutputData = (void *)((char *)m_pDest + fieldOffsetDest ); - pInputData = (void const *)((char *)m_pSrc + fieldOffsetSrc ); - - // Assume we can report - m_bShouldReport = m_bReportErrors; - m_bShouldDescribe = true; - - bool bShouldWatch = m_pWatchField == m_pCurrentField; - - difftype_t difftype; - - switch( m_pCurrentField->fieldType ) - { - case FIELD_EMBEDDED: - { - typedescription_t *save = m_pCurrentField; - void *saveDest = m_pDest; - void const *saveSrc = m_pSrc; - const char *saveName = m_pCurrentClassName; - - m_pCurrentClassName = m_pCurrentField->td->dataClassName; - - // FIXME: Should this be done outside the FIELD_EMBEDDED case?? - // Don't follow the pointer if we're reading from a compressed packet - m_pSrc = pInputData; - if ( ( flags & FTYPEDESC_PTR ) && (m_nSrcOffsetIndex == PC_DATA_NORMAL) ) - { - m_pSrc = *((void**)m_pSrc); - } - - m_pDest = pOutputData; - if ( ( flags & FTYPEDESC_PTR ) && (m_nDestOffsetIndex == PC_DATA_NORMAL) ) - { - m_pDest = *((void**)m_pDest); - } - - CopyFields( chain_count, pRootMap, m_pCurrentField->td->dataDesc, m_pCurrentField->td->dataNumFields ); - - m_pCurrentClassName = saveName; - m_pCurrentField = save; - m_pDest = saveDest; - m_pSrc = saveSrc; - } - break; - case FIELD_FLOAT: - { - difftype = CompareFloat( (float *)pOutputData, (float const *)pInputData, fieldSize ); - CopyFloat( difftype, (float *)pOutputData, (float const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeFloat( difftype, (float *)pOutputData, (float const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchFloat( difftype, (float *)pOutputData, (float const *)pInputData, fieldSize ); - } - break; - - case FIELD_TIME: - case FIELD_TICK: - Assert( 0 ); - break; - - case FIELD_STRING: - { - difftype = CompareString( (char *)pOutputData, (char const*)pInputData ); - CopyString( difftype, (char *)pOutputData, (char const*)pInputData ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeString( difftype,(char *)pOutputData, (char const*)pInputData ); - if ( bShouldWatch ) WatchString( difftype,(char *)pOutputData, (char const*)pInputData ); - } - break; - - case FIELD_MODELINDEX: - Assert( 0 ); - break; - - case FIELD_MODELNAME: - case FIELD_SOUNDNAME: - Assert( 0 ); - break; - - case FIELD_CUSTOM: - Assert( 0 ); - break; - - case FIELD_CLASSPTR: - case FIELD_EDICT: - Assert( 0 ); - break; - - case FIELD_POSITION_VECTOR: - Assert( 0 ); - break; - - case FIELD_VECTOR: - { - difftype = CompareVector( (Vector *)pOutputData, (Vector const *)pInputData, fieldSize ); - CopyVector( difftype, (Vector *)pOutputData, (Vector const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeVector( difftype, (Vector *)pOutputData, (Vector const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchVector( difftype, (Vector *)pOutputData, (Vector const *)pInputData, fieldSize ); - } - break; - - case FIELD_QUATERNION: - { - difftype = CompareQuaternion( (Quaternion *)pOutputData, (Quaternion const *)pInputData, fieldSize ); - CopyQuaternion( difftype, (Quaternion *)pOutputData, (Quaternion const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeQuaternion( difftype, (Quaternion *)pOutputData, (Quaternion const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchQuaternion( difftype, (Quaternion *)pOutputData, (Quaternion const *)pInputData, fieldSize ); - } - break; - - case FIELD_COLOR32: - { - difftype = CompareData( 4*fieldSize, (char *)pOutputData, (const char *)pInputData ); - CopyData( difftype, 4*fieldSize, (char *)pOutputData, (const char *)pInputData ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeData( difftype, 4*fieldSize, (char *)pOutputData, (const char *)pInputData ); - if ( bShouldWatch ) WatchData( difftype, 4*fieldSize, (char *)pOutputData, (const char *)pInputData ); - } - break; - - case FIELD_BOOLEAN: - { - difftype = CompareBool( (bool *)pOutputData, (bool const *)pInputData, fieldSize ); - CopyBool( difftype, (bool *)pOutputData, (bool const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeBool( difftype, (bool *)pOutputData, (bool const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchBool( difftype, (bool *)pOutputData, (bool const *)pInputData, fieldSize ); - } - break; - - case FIELD_INTEGER: - { - difftype = CompareInt( (int *)pOutputData, (int const *)pInputData, fieldSize ); - CopyInt( difftype, (int *)pOutputData, (int const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeInt( difftype, (int *)pOutputData, (int const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchInt( difftype, (int *)pOutputData, (int const *)pInputData, fieldSize ); - } - break; - - case FIELD_SHORT: - { - difftype = CompareShort( (short *)pOutputData, (short const *)pInputData, fieldSize ); - CopyShort( difftype, (short *)pOutputData, (short const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeShort( difftype, (short *)pOutputData, (short const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchShort( difftype, (short *)pOutputData, (short const *)pInputData, fieldSize ); - } - break; - - case FIELD_CHARACTER: - { - difftype = CompareData( fieldSize, ((char *)pOutputData), (const char *)pInputData ); - CopyData( difftype, fieldSize, ((char *)pOutputData), (const char *)pInputData ); - - int valOut = *((char *)pOutputData); - int valIn = *((const char *)pInputData); - - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeInt( difftype, &valOut, &valIn, fieldSize ); - if ( bShouldWatch ) WatchData( difftype, fieldSize, ((char *)pOutputData), (const char *)pInputData ); - } - break; - case FIELD_EHANDLE: - { - difftype = CompareEHandle( (EHANDLE *)pOutputData, (EHANDLE const *)pInputData, fieldSize ); - CopyEHandle( difftype, (EHANDLE *)pOutputData, (EHANDLE const *)pInputData, fieldSize ); - if ( m_bErrorCheck && m_bShouldDescribe ) DescribeEHandle( difftype, (EHANDLE *)pOutputData, (EHANDLE const *)pInputData, fieldSize ); - if ( bShouldWatch ) WatchEHandle( difftype, (EHANDLE *)pOutputData, (EHANDLE const *)pInputData, fieldSize ); - } - break; - case FIELD_FUNCTION: - { - Assert( 0 ); - } - break; - case FIELD_VOID: - { - // Don't do anything, it's an empty data description - } - break; - default: - { - Warning( "Bad field type\n" ); - Assert(0); - } - break; - } - } - - m_pCurrentClassName = NULL; -} - -void CPredictionCopy::TransferData_R( int chaincount, datamap_t *dmap ) -{ - // Copy from here first, then baseclasses - CopyFields( chaincount, dmap, dmap->dataDesc, dmap->dataNumFields ); - - if ( dmap->baseMap ) - { - TransferData_R( chaincount, dmap->baseMap ); - } -} - -static int g_nChainCount = 1; - -static typedescription_t *FindFieldByName_R( const char *fieldname, datamap_t *dmap ) -{ - int c = dmap->dataNumFields; - for ( int i = 0; i < c; i++ ) - { - typedescription_t *td = &dmap->dataDesc[ i ]; - if ( td->fieldType == FIELD_VOID ) - continue; - - if ( td->fieldType == FIELD_EMBEDDED ) - { - // TODO: this will only find the first subclass with the variable of the specified name - // At some point we might want to support multiple levels of overriding automatically - typedescription_t *ret = FindFieldByName_R( fieldname, td->td ); - if ( ret ) - { - return ret; - } - } +//----------------------------------------------------------------------------- +// Purpose: +// Input : *fmt - +// ... - +//----------------------------------------------------------------------------- +void CPredictionCopy::OutputFieldDescription( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t dt, const char *fmt, ... ) +{ + if ( !m_FieldCompareFunc ) + return; - if ( !stricmp( td->fieldName, fieldname ) ) - { - return td; - } - } + const char *fieldname = "empty"; + const char *classname = "empty"; + int flags = 0; - if ( dmap->baseMap ) + if ( pField ) { - return FindFieldByName_R( fieldname, dmap->baseMap ); + flags = pField->flags; + fieldname = pField->fieldName ? pField->fieldName : "NULL"; + classname = pCurrentMap->dataClassName; } - return NULL; + + va_list argptr; + char data[ 4096 ]; + int len; + va_start(argptr, fmt); + len = Q_vsnprintf(data, sizeof( data ), fmt, argptr); + va_end(argptr); + + bool isnetworked = ( flags & FTYPEDESC_INSENDTABLE ) ? true : false; + bool isnoterrorchecked = ( flags & FTYPEDESC_NOERRORCHECK ) ? true : false; + + ( *m_FieldCompareFunc )( + classname, + fieldname, + g_FieldTypes[ pField->fieldType ], + isnetworked, + isnoterrorchecked, + dt != IDENTICAL ? true : false, + dt == WITHINTOLERANCE ? true : false, + data + ); } -void ValidateChains_R( datamap_t *dmap ) +void CPredictionCopy::DescribeFields( const CUtlVector< const datamap_t * > &vecGroups, const datamap_t *pCurrentMap, int nPredictionCopyType ) { - dmap->chains_validated = true; + int i; + int flags; + int fieldOffsetSrc; + int fieldOffsetDest; + int fieldSize; - int c = dmap->dataNumFields; - for ( int i = 0; i < c; i++ ) - { - typedescription_t *td = &dmap->dataDesc[ i ]; - if ( td->fieldType == FIELD_VOID ) - continue; + const flattenedoffsets_t &flat = pCurrentMap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; + int fieldCount = flat.m_Flattened.Count(); + const typedescription_t * RESTRICT pField = &flat.m_Flattened[ 0 ]; + PREFETCH360(pField, 0); - if ( td->fieldType == FIELD_EMBEDDED ) + for ( i = 0; i < fieldCount; ++i, pField++ ) + { +#if _X360 + if ( !(i & 0xF) ) { - ValidateChains_R( td->td ); - continue; + PREFETCH360(pField, 128); } +#endif + flags = pField->flags; + int nFieldType = pField->fieldType; - if ( !( td->flags & FTYPEDESC_OVERRIDE ) ) - continue; + const byte * RESTRICT pOutputData; + const byte * RESTRICT pInputData; - if ( dmap->baseMap ) - { - typedescription_t *basefield = FindFieldByName_R( td->fieldName, dmap->baseMap ); - if ( basefield ) - { - td->override_field = basefield; - } - } - } + fieldOffsetDest = pField->flatOffset[ m_nSrcOffsetIndex ]; + fieldOffsetSrc = pField->flatOffset[ m_nDestOffsetIndex ]; + fieldSize = pField->fieldSize; - if ( dmap->baseMap ) - { - if ( !dmap->baseMap->chains_validated ) + pOutputData = (m_pDest + fieldOffsetDest ); + pInputData = (m_pSrc + fieldOffsetSrc ); + + const datamap_t *sourceGroup = pCurrentMap; + if ( pField->flatGroup >= 0 && pField->flatGroup < vecGroups.Count() ) { - ValidateChains_R( dmap->baseMap ); + sourceGroup = vecGroups[ pField->flatGroup ]; } + + PREDICTIONCOPY_APPLY( ProcessField_Describe, nFieldType, sourceGroup, pField, pOutputData, pInputData, fieldSize ); } } + //----------------------------------------------------------------------------- -// Purpose: +// Purpose: static method // Input : *fieldname - // *dmap - // Output : typedescription_t //----------------------------------------------------------------------------- -typedescription_t *FindFieldByName( const char *fieldname, datamap_t *dmap ) +// static method +const typedescription_t *CPredictionCopy::FindFlatFieldByName( const char *fieldname, const datamap_t *dmap ) { - return FindFieldByName_R( fieldname, dmap ); + PrepareDataMap( const_cast< datamap_t * >( dmap ) ); + + for ( int i = 0; i < PC_COPYTYPE_COUNT; ++i ) + { + const flattenedoffsets_t &flat = dmap->m_pOptimizedDataMap->m_Info[ i ].m_Flat; + int c = flat.m_Flattened.Count(); + for ( int j = 0; j < c; ++j ) + { + const typedescription_t *td = &flat.m_Flattened[ j ]; + if ( !Q_stricmp( td->fieldName, fieldname ) ) + { + return td; + } + } + } + return NULL; } static ConVar pwatchent( "pwatchent", "-1", FCVAR_CHEAT, "Entity to watch for prediction system changes." ); @@ -1332,9 +902,9 @@ static ConVar pwatchvar( "pwatchvar", "", FCVAR_CHEAT, "Entity variable to watch // Input : *fmt - // ... - //----------------------------------------------------------------------------- -void CPredictionCopy::WatchMsg( const char *fmt, ... ) +void CPredictionCopy::WatchMsg( const typedescription_t *pField, const char *fmt, ... ) { - Assert( m_pCurrentField && (m_pCurrentField == m_pWatchField) ); + Assert( pField ); Assert( m_pOperation ); va_list argptr; @@ -1344,7 +914,7 @@ void CPredictionCopy::WatchMsg( const char *fmt, ... ) len = Q_vsnprintf(data, sizeof( data ), fmt, argptr); va_end(argptr); - Msg( "%i %s %s : %s\n", gpGlobals->tickcount, m_pOperation, m_pCurrentField->fieldName, data ); + Msg( "%i %s %s : %s\n", gpGlobals->tickcount, m_pOperation, pField->fieldName, data ); } //----------------------------------------------------------------------------- @@ -1353,7 +923,7 @@ void CPredictionCopy::WatchMsg( const char *fmt, ... ) // entindex - // *dmap - //----------------------------------------------------------------------------- -void CPredictionCopy::DetermineWatchField( const char *operation, int entindex, datamap_t *dmap ) +void CPredictionCopy::DetermineWatchField( const char *operation, int entindex, const datamap_t *dmap ) { m_pWatchField = NULL; m_pOperation = operation; @@ -1371,873 +941,786 @@ void CPredictionCopy::DetermineWatchField( const char *operation, int entindex, if ( pwatchvar.GetString()[0] == 0 ) return; - m_pWatchField = FindFieldByName( pwatchvar.GetString(), dmap ); + m_pWatchField = CPredictionCopy::FindFlatFieldByName( pwatchvar.GetString(), dmap ); } -//----------------------------------------------------------------------------- -// Purpose: -// Input : *operation - -// entindex - -// *dmap - -// Output : int -//----------------------------------------------------------------------------- -int CPredictionCopy::TransferData( const char *operation, int entindex, datamap_t *dmap ) +static void RemoveFieldsByName( char const *pchFieldName, CUtlVector< typedescription_t > &build ) { - ++g_nChainCount; - - if ( !dmap->chains_validated ) + // Don't start at final field, since it the one we just added with FTYPEDESC_OVERRIDE + for ( int i = build.Count() - 2; i >= 0 ; --i ) { - ValidateChains_R( dmap ); - } - - DetermineWatchField( operation, entindex, dmap ); - - TransferData_R( g_nChainCount, dmap ); + // Embedded field "offsets" can be the same as their first data field, so don't remove + if ( build[ i ].fieldType == FIELD_EMBEDDED ) + continue; - return m_nErrorCount; + if ( !Q_stricmp( build[ i ].fieldName, pchFieldName ) ) + { + // Msg( "Removing %s %d due to override\n", build[ i ]->fieldName, build[ i ]->flatOffset[ TD_OFFSET_NORMAL ] ); + build.Remove( i ); + } + } } -/* -//----------------------------------------------------------------------------- -// Purpose: Simply dumps all data fields in object -//----------------------------------------------------------------------------- -class CPredictionDescribeData -{ -public: - CPredictionDescribeData( void const *src ); - - void DescribeShort( const short *invalue, int count ); - void DescribeInt( const int *invalue, int count ); - void DescribeBool( const bool *invalue, int count ); - void DescribeFloat( const float *invalue, int count ); - void DescribeData( int size, const char *indata ); - void DescribeString( const char *instring ); - void DescribeVector( const Vector &inValue ); - void DescribeVector( const Vector *inValue, int count ); - void DescribeEHandle( EHANDLE const *invalue, int count ); - - void DescribeFields( datamap_t *pMap, typedescription_t *pFields, int fieldCount ); - -private: - - void const *m_pSrc; - void Describe( const char *fmt, ... ); - - typedescription_t *m_pCurrentField; - char const *m_pCurrentClassName; - datamap_t *m_pCurrentMap; -}; -*/ - -CPredictionDescribeData::CPredictionDescribeData( void const *src, bool src_packed, FN_FIELD_DESCRIPTION func /*= 0*/ ) +static void BuildGroupList_R( int nPredictionCopyType, int nGroup, const datamap_t *dmap, CUtlVector< const datamap_t * > &vecGroups ) { - m_pSrc = src; - m_nSrcOffsetIndex = src_packed ? TD_OFFSET_PACKED : TD_OFFSET_NORMAL; - - m_pCurrentField = NULL; - m_pCurrentMap = NULL; - m_pCurrentClassName = NULL; - m_bShouldReport = false; + // Descend to base classes first so FTYPEDESC_OVERRIDE can remove the previous ones + if ( dmap->baseMap ) + { + BuildGroupList_R( nPredictionCopyType, nGroup + 1, dmap->baseMap, vecGroups ); + } - m_FieldDescFunc = func; + vecGroups.AddToTail( dmap ); } -//----------------------------------------------------------------------------- -// Purpose: -// Input : *fmt - -// ... - -//----------------------------------------------------------------------------- -void CPredictionDescribeData::Describe( const char *fmt, ... ) +static void BuildFlattenedChains_R( + int nPredictionCopyType, + int &nMaxGroupSeen, + int nGroup, + datamap_t *dmap, + CUtlVector< typedescription_t > &build, + int nBaseOffset ) { -// if ( !m_bShouldReport ) -// return; - - Assert( m_pCurrentMap ); - Assert( m_pCurrentClassName ); - - const char *fieldname = "empty"; - int flags = 0; - - if ( m_pCurrentField ) + // Descend to base classes first so FTYPEDESC_OVERRIDE can remove the previous ones + if ( dmap->baseMap ) { - flags = m_pCurrentField->flags; - fieldname = m_pCurrentField->fieldName ? m_pCurrentField->fieldName : "NULL"; + BuildFlattenedChains_R( nPredictionCopyType, nMaxGroupSeen, nGroup + 1, dmap->baseMap, build, nBaseOffset ); } - va_list argptr; - char data[ 4096 ]; - int len; - va_start(argptr, fmt); - len = Q_vsnprintf(data, sizeof( data ), fmt, argptr); - va_end(argptr); - - bool isprivate = ( flags & FTYPEDESC_PRIVATE ) ? true : false; - bool isnetworked = ( flags & FTYPEDESC_INSENDTABLE ) ? true : false; - - if ( m_FieldDescFunc ) + if ( nGroup > nMaxGroupSeen ) { - (*m_FieldDescFunc)( - m_pCurrentClassName, - m_pCurrentField->fieldName, - g_FieldTypes[ m_pCurrentField->fieldType ], - isnetworked, - data ); + nMaxGroupSeen = nGroup; } - else + + int c = dmap->dataNumFields; + for ( int i = 0; i < c; i++ ) { - char suffix[ 128 ]; + typedescription_t *pField = &dmap->dataDesc[ i ]; + if ( pField->fieldType == FIELD_VOID ) + continue; - suffix[ 0 ] = 0; - if ( isprivate ) + bool bAdd = true; + if ( pField->fieldType != FIELD_EMBEDDED ) { - Q_strncat( suffix, "private", sizeof( suffix ), COPY_ALL_CHARACTERS ); - } - if ( isnetworked ) - { - if ( suffix[ 0 ] ) + if ( pField->flags & FTYPEDESC_PRIVATE ) { - Q_strncat( suffix, " - ", sizeof( suffix ), COPY_ALL_CHARACTERS ); + if ( pField->flags & FTYPEDESC_OVERRIDE ) + { + // Find previous field targeting same offset + RemoveFieldsByName( pField->fieldName, build ); + } + continue; } - Q_strncat( suffix, "net", sizeof( suffix ), COPY_ALL_CHARACTERS ); - } - if ( suffix[ 0 ] ) - { - Msg( "%s::%s(%s) - %s", - m_pCurrentClassName, - fieldname, - suffix, - data ); + // For PC_NON_NETWORKED_ONLYs skip any fields that are present in the network send tables + if ( nPredictionCopyType == PC_NON_NETWORKED_ONLY && ( pField->flags & FTYPEDESC_INSENDTABLE ) ) + { + bAdd = false; + } + // For PC_NETWORKED_ONLYs skip any fields that are not present in the network send tables + if ( nPredictionCopyType == PC_NETWORKED_ONLY && !( pField->flags & FTYPEDESC_INSENDTABLE ) ) + { + bAdd = false; + } } else { - Msg( "%s::%s - %s", - m_pCurrentClassName, - fieldname, - data ); + bAdd = false; } - } - - m_bShouldReport = false; -} - -//----------------------------------------------------------------------------- -// Purpose: -// Input : size - -// *outdata - -// *indata - -//----------------------------------------------------------------------------- -void CPredictionDescribeData::DescribeData( int size, const char *indata ) -{ - if ( !indata ) - return; - - Describe( "binary (%i bytes)\n", size ); -} - - -void CPredictionDescribeData::DescribeShort( const short *invalue, int count ) -{ - Describe( "short (%i)\n", (int)(invalue[0]) ); -} - - -void CPredictionDescribeData::DescribeInt( const int *invalue, int count ) -{ - for ( int i = 0; i < count; ++i ) - { - Describe( "[%i] integer (%i)\n", i, invalue[i] ); - } -} - -void CPredictionDescribeData::DescribeBool( const bool *invalue, int count ) -{ - Describe( "bool (%s)\n", (invalue[0]) ? "true" : "false" ); -} - -void CPredictionDescribeData::DescribeFloat( const float *invalue, int count ) -{ - Describe( "float (%f)\n", invalue[ 0 ] ); -} -void CPredictionDescribeData::DescribeString( const char *instring ) -{ - Describe( "string (%s)\n", instring ); -} + pField->flatGroup = nGroup; + pField->flatOffset[ TD_OFFSET_NORMAL ] = nBaseOffset + pField->fieldOffset; -void CPredictionDescribeData::DescribeVector( const Vector &inValue ) -{ - Describe( "vector (%f %f %f)\n", - inValue.x, inValue.y, inValue.z ); -} + if ( bAdd ) + { + build.AddToTail( *pField ); + } + // Msg( "Visit %s offset %d\n", pField->fieldName, pField->flatOffset[ nPackType ] ); -void CPredictionDescribeData::DescribeVector( const Vector *inValue, int count ) -{ - Describe( "vector (%f %f %f)\n", - inValue[0].x, inValue[0].y, inValue[0].z ); -} + if ( pField->fieldType == FIELD_EMBEDDED ) + { + AssertFatalMsg( !(pField->flags & FTYPEDESC_PTR ), ( "Prediction copy does not support FTYPEDESC_PTR(%d)", pField->fieldName ) ); + BuildFlattenedChains_R( nPredictionCopyType, nMaxGroupSeen, nGroup, pField->td, build, pField->flatOffset[ TD_OFFSET_NORMAL ] ); + } -void CPredictionDescribeData::DescribeQuaternion( const Quaternion &inValue ) -{ - Describe( "quaternion (%f %f %f %f)\n", - inValue[0], inValue[1], inValue[2], inValue[3] ); + if ( pField->flags & FTYPEDESC_OVERRIDE ) + { + // Find previous field targeting same offset + RemoveFieldsByName( pField->fieldName, build ); + } + } } - -void CPredictionDescribeData::DescribeQuaternion( const Quaternion *inValue, int count ) +static int __cdecl CompareFlattenedOffsets( const void *pv1, const void *pv2 ) { - Describe( "quaternion (%f %f %f %f)\n", - inValue[0][0], inValue[0][1], inValue[0][2], inValue[0][3] ); -} + const typedescription_t *td1 = (const typedescription_t *)pv1; + const typedescription_t *td2 = (const typedescription_t *)pv2; + if ( td1->flatOffset[ TD_OFFSET_NORMAL ] < td2->flatOffset[ TD_OFFSET_NORMAL ] ) + return -1; + else if ( td1->flatOffset[ TD_OFFSET_NORMAL ] > td2->flatOffset[ TD_OFFSET_NORMAL ] ) + return 1; + if ( td1->flatGroup < td2->flatGroup ) + return -1; + else if ( td1->flatGroup > td2->flatGroup ) + return 1; -void CPredictionDescribeData::DescribeEHandle( EHANDLE const *invalue, int count ) -{ - Describe( "EHandle (%p)\n", invalue->Get() ); + return 0; } -void CPredictionDescribeData::DescribeFields_R( int chain_count, datamap_t *pRootMap, typedescription_t *pFields, int fieldCount ) +static int BuildPackedFlattenedOffsets( int nStartOffset, flattenedoffsets_t &flat ) { - int i; - int flags; - int fieldOffsetSrc; - int fieldSize; - - m_pCurrentMap = pRootMap; - if ( !m_pCurrentClassName ) - { - m_pCurrentClassName = pRootMap->dataClassName; - } + int current_position = nStartOffset; - for ( i = 0; i < fieldCount; i++ ) + for ( int i = 0; i < flat.m_Flattened.Count(); ++i ) { - m_pCurrentField = &pFields[ i ]; - flags = m_pCurrentField->flags; - - // Mark any subchains first - if ( m_pCurrentField->override_field != NULL ) - { - m_pCurrentField->override_field->override_count = chain_count; - } - - // Skip this field? - if ( m_pCurrentField->override_count == chain_count ) - { - continue; - } + typedescription_t *field = &flat.m_Flattened[ i ]; - void const *pInputData; - - fieldOffsetSrc = m_pCurrentField->fieldOffset[ m_nSrcOffsetIndex ]; - fieldSize = m_pCurrentField->fieldSize; - - pInputData = (void const *)((char *)m_pSrc + fieldOffsetSrc ); - - // Assume we can report - m_bShouldReport = true; - - switch( m_pCurrentField->fieldType ) + switch ( field->fieldType ) { - case FIELD_EMBEDDED: - { - typedescription_t *save = m_pCurrentField; - void const *saveSrc = m_pSrc; - const char *saveName = m_pCurrentClassName; - - m_pCurrentClassName = m_pCurrentField->td->dataClassName; - - m_pSrc = pInputData; - if ( ( flags & FTYPEDESC_PTR ) && (m_nSrcOffsetIndex == PC_DATA_NORMAL) ) - { - m_pSrc = *((void**)m_pSrc); - } - - DescribeFields_R( chain_count, pRootMap, m_pCurrentField->td->dataDesc, m_pCurrentField->td->dataNumFields ); - - m_pCurrentClassName = saveName; - m_pCurrentField = save; - m_pSrc = saveSrc; - } - break; - case FIELD_FLOAT: - DescribeFloat( (float const *)pInputData, fieldSize ); - break; - case FIELD_TIME: - case FIELD_TICK: - Assert( 0 ); - break; - case FIELD_STRING: - DescribeString( (char const*)pInputData ); - break; - + default: + case FIELD_MODELINDEX: case FIELD_MODELNAME: case FIELD_SOUNDNAME: - Assert( 0 ); - break; - - case FIELD_MODELINDEX: - Assert( 0 ); - break; - + case FIELD_TIME: + case FIELD_TICK: case FIELD_CUSTOM: - Assert( 0 ); - break; - case FIELD_CLASSPTR: case FIELD_EDICT: - break; case FIELD_POSITION_VECTOR: + case FIELD_FUNCTION: Assert( 0 ); break; - case FIELD_VECTOR: - DescribeVector( (const Vector *)pInputData, fieldSize ); + + case FIELD_EMBEDDED: + { + Error( "Not expecting FIELD_EMBEDDED in flattened list (%s)", field->fieldName ); + } break; + + case FIELD_FLOAT: + case FIELD_VECTOR: case FIELD_QUATERNION: - DescribeQuaternion( ( const Quaternion * )pInputData, fieldSize ); - break; - - case FIELD_COLOR32: - DescribeData( 4*fieldSize, (const char *)pInputData ); - break; - - case FIELD_BOOLEAN: - DescribeBool( (bool const *)pInputData, fieldSize ); - break; case FIELD_INTEGER: - DescribeInt( (int const *)pInputData, fieldSize ); + case FIELD_EHANDLE: + case FIELD_COLOR32: + case FIELD_VMATRIX: + case FIELD_VECTOR4D: + { + current_position = ALIGN_VALUE( current_position, 4 ); + field->flatOffset[ TD_OFFSET_PACKED ] = current_position; + current_position += field->fieldSizeInBytes; + } break; - case FIELD_SHORT: - DescribeShort( (short const *)pInputData, fieldSize ); + { + current_position = ALIGN_VALUE( current_position, 2 ); + field->flatOffset[ TD_OFFSET_PACKED ] = current_position; + current_position += field->fieldSizeInBytes; + } break; - + case FIELD_STRING: + case FIELD_BOOLEAN: case FIELD_CHARACTER: - DescribeData( fieldSize, (const char *)pInputData ); - break; - - case FIELD_EHANDLE: - DescribeEHandle( (EHANDLE const *)pInputData, fieldSize ); - break; - case FIELD_FUNCTION: - Assert( 0 ); + { + field->flatOffset[ TD_OFFSET_PACKED ] = current_position; + current_position += field->fieldSizeInBytes; + } break; case FIELD_VOID: - Describe( "FIELD_VOID: empty field\n" ); - break; - default: - Warning( "Bad field type\n" ); - Assert(0); + { + // Special case, just skip it + } break; } - } - - m_pCurrentClassName = NULL; -} - -void CPredictionDescribeData::DumpDescription( datamap_t *pMap ) -{ - ++g_nChainCount; - if ( !pMap->chains_validated ) - { - ValidateChains_R( pMap ); + // Msg( "%s packed to %d size %d\n", field->fieldName, field->flatOffset[ TD_OFFSET_PACKED ], field->fieldSizeInBytes ); } - while ( pMap ) - { - DescribeFields_R( g_nChainCount, pMap, pMap->dataDesc, pMap->dataNumFields ); - pMap = pMap->baseMap; - } -} + flat.m_nPackedStartOffset = nStartOffset; + flat.m_nPackedSize = current_position - nStartOffset; -#if defined( CLIENT_DLL ) -CValueChangeTracker::CValueChangeTracker() : - m_bActive( false ), - m_bTracking( false ) -{ - Q_memset( m_OrigValueBuf, 0, sizeof( m_OrigValueBuf ) ); -} + current_position = ALIGN_VALUE( current_position, 4 ); -C_BaseEntity *CValueChangeTracker::GetEntity() -{ - return m_hEntityToTrack.Get(); + return current_position; } -void CValueChangeTracker::GetValue( char *buf, size_t bufsize ) +static void BuildDataRuns( datamap_t *dmap ) { - buf[ 0 ] = 0; + for ( int pc = 0; pc < PC_COPYTYPE_COUNT; ++pc ) + { + datamapinfo_t &info = dmap->m_pOptimizedDataMap->m_Info[ pc ]; + datacopyruns_t *runs = &info.m_CopyRuns; - Assert( IsActive() ); + Assert( !info.m_CopyRuns.m_vecRuns.Count() ); - if ( !m_hEntityToTrack.Get() ) - return; + const flattenedoffsets_t &flat = info.m_Flat; - void const *pInputData = ( const void * )m_hEntityToTrack.Get(); - typedescription_t *td = NULL; - for ( int i = 0; i < m_FieldStack.Count(); ++i ) - { - td = m_FieldStack[ i ]; - Assert( ( i == ( m_FieldStack.Count() -1 ) ) || - ( td->fieldType & FIELD_EMBEDDED ) ); - int fieldOffsetSrc = td->fieldOffset[ TD_OFFSET_NORMAL ]; - const void *pSaveSrc = (const void *)( (char *)pInputData + fieldOffsetSrc ); - if ( ( td->flags & FTYPEDESC_PTR ) && - ( td->fieldType & FIELD_EMBEDDED ) ) - { - pInputData = *(const void **)pSaveSrc; - } - else + int nRunStartField = 0; + int nCurrentRunStartOffset = 0; + int nLastFieldEndOffset = 0; + + CUtlVector< datarun_t > &vecRuns = runs->m_vecRuns; + + int i; + for ( i = 0; i < flat.m_Flattened.Count(); ++i ) { - pInputData = (void const *)((char *)pSaveSrc ); - } - } + const typedescription_t *td = &flat.m_Flattened[ i ]; + int offset = td->flatOffset[ TD_OFFSET_NORMAL ]; + if ( i == 0 ) + { + nRunStartField = i; + nLastFieldEndOffset = offset; + nCurrentRunStartOffset = offset; + } - if ( !td || !pInputData ) - return; + if ( td->fieldType == FIELD_EMBEDDED ) + { + Assert( 0 ); + continue; + } - int fieldType = td->fieldType; + if ( nLastFieldEndOffset != offset ) + { + datarun_t run; + run.m_nStartFlatField = nRunStartField; + run.m_nEndFlatField = i; + Assert( nCurrentRunStartOffset == flat.m_Flattened[ nRunStartField ].flatOffset[ TD_OFFSET_NORMAL ] ); + run.m_nStartOffset[ TD_OFFSET_NORMAL ] = nCurrentRunStartOffset; + run.m_nStartOffset[ TD_OFFSET_PACKED ] = flat.m_Flattened[ nRunStartField ].flatOffset[ TD_OFFSET_PACKED ]; + run.m_nLength = nLastFieldEndOffset - nCurrentRunStartOffset; + +#ifdef _X360 + if ( vecRuns.Count() > 0 ) + { + for ( int td = 0; td < TD_OFFSET_COUNT; ++td ) + { + vecRuns[ vecRuns.Count() - 1 ].m_nPrefetchOffset[ td ] = run.m_nStartOffset[ td ]; + } + } +#endif + vecRuns.AddToTail( run ); - switch( fieldType ) - { - default: - case FIELD_EMBEDDED: - case FIELD_MODELNAME: - case FIELD_SOUNDNAME: - case FIELD_CUSTOM: - case FIELD_CLASSPTR: - case FIELD_EDICT: - case FIELD_POSITION_VECTOR: - case FIELD_VOID: - case FIELD_FUNCTION: - { - Assert( 0 ); - } - break; - case FIELD_FLOAT: - case FIELD_TIME: - Q_snprintf( buf, bufsize, "%f", *(float const *)pInputData ); - break; - case FIELD_STRING: - Q_snprintf( buf, bufsize, "%s", (char const*)pInputData ); - break; - case FIELD_VECTOR: - { - const Vector *pVec = (const Vector *)pInputData; - Q_snprintf( buf, bufsize, "%f %f %f", pVec->x, pVec->y, pVec->z ); - } - break; - case FIELD_QUATERNION: - { - const Quaternion *p = ( const Quaternion * )pInputData; - Q_snprintf( buf, bufsize, "%f %f %f %f", p->x, p->y, p->z, p->w ); + nRunStartField = i; + nCurrentRunStartOffset = offset; + } + nLastFieldEndOffset = td->flatOffset[ TD_OFFSET_NORMAL ] + td->fieldSizeInBytes; } - break; - case FIELD_COLOR32: + // Close off last run + if ( nLastFieldEndOffset != nCurrentRunStartOffset ) { - const Color *color = ( const Color * )pInputData; - Q_snprintf( buf, bufsize, "%d %d %d %d", color->r(), color->g(), color->b(), color->a() ); + datarun_t run; + run.m_nStartFlatField = nRunStartField; + run.m_nEndFlatField = i - 1; + Assert( nCurrentRunStartOffset == flat.m_Flattened[ nRunStartField ].flatOffset[ TD_OFFSET_NORMAL ] ); + run.m_nStartOffset[ TD_OFFSET_NORMAL ] = nCurrentRunStartOffset; + run.m_nStartOffset[ TD_OFFSET_PACKED ] = flat.m_Flattened[ nRunStartField ].flatOffset[ TD_OFFSET_PACKED ]; + run.m_nLength = nLastFieldEndOffset - nCurrentRunStartOffset; + +#ifdef _X360 + if ( vecRuns.Count() > 0 ) + { + for ( int td = 0; td < TD_OFFSET_COUNT; ++td ) + { + vecRuns[ vecRuns.Count() - 1 ].m_nPrefetchOffset[ td ] = run.m_nStartOffset[ td ]; + } + } +#endif + vecRuns.AddToTail( run ); } - break; - - case FIELD_BOOLEAN: - Q_snprintf( buf, bufsize, "%s", (*(const bool *)pInputData) ? "true" : "false" ); - break; - case FIELD_INTEGER: - case FIELD_TICK: - case FIELD_MODELINDEX: - Q_snprintf( buf, bufsize, "%i", *(const int*)pInputData ); - break; - - case FIELD_SHORT: - Q_snprintf( buf, bufsize, "%i", (int)*(const short*)pInputData ); - break; - - case FIELD_CHARACTER: - Q_snprintf( buf, bufsize, "%c", *(const char *)pInputData ); - break; - - case FIELD_EHANDLE: - Q_snprintf( buf, bufsize, "eh 0x%p", (void const *)((const EHANDLE *)pInputData)->Get() ); - break; } } -void CValueChangeTracker::StartTrack( char const *pchContext ) +static void BuildFlattenedChains( datamap_t *dmap ) { - if ( !IsActive() ) + if ( dmap->m_pOptimizedDataMap ) return; + dmap->m_pOptimizedDataMap = g_OptimizedDataMapPool.AllocZero(); - m_strContext = pchContext; - - // Grab current value into scratch buffer - GetValue( m_OrigValueBuf, sizeof( m_OrigValueBuf ) ); + int nMaxGroupSeen[ PC_COPYTYPE_COUNT ] = { 0 }; - m_bTracking = true; -} + for ( int nPredictionCopyType = 0; nPredictionCopyType < PC_COPYTYPE_COUNT; ++nPredictionCopyType ) + { + CUtlVector< typedescription_t > &build = dmap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat.m_Flattened; -void CValueChangeTracker::EndTrack() -{ - if ( !IsActive() ) - return; + int nGroupCount = 0; + int nBaseOffset = 0; + BuildFlattenedChains_R( + nPredictionCopyType, + nMaxGroupSeen[ nPredictionCopyType ], + nGroupCount, + dmap, + build, + nBaseOffset ); + // Msg( "%d == %d entries\n", nPredictionCopyType, build[ nPredictionCopyType ].Count() ); + } - if ( !m_bTracking ) - return; - m_bTracking = false; + for ( int nPredictionCopyType = 0; nPredictionCopyType < PC_COPYTYPE_COUNT; ++nPredictionCopyType ) + { + int nMaxGroup = nMaxGroupSeen[ nPredictionCopyType ]; - char final[ eChangeTrackerBufSize ]; - GetValue( final, sizeof( final ) ); + CUtlVector< typedescription_t > &build = dmap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat.m_Flattened; - CUtlString *history = &m_History[ m_History.AddToTail() ]; - if ( Q_stricmp( final, m_OrigValueBuf ) ) - { - history->Set( CFmtStr( "+++ %-20.20s: %s (was %s)", m_strContext.String(), final, m_OrigValueBuf ) ); + for ( int i = 0; i < build.Count(); ++i ) + { + typedescription_t *field = &build[ i ]; + field->flatGroup = nMaxGroup - field->flatGroup; + } } - else + + int nPackedDataStartOffset = 0; + for ( int nPredictionCopyType = 0; nPredictionCopyType < PC_COPYTYPE_COUNT; ++nPredictionCopyType ) { - history->Set( CFmtStr( " %-20.20s: %s", m_strContext.String(), final ) ); + flattenedoffsets_t &flat = dmap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; + qsort( flat.m_Flattened.Base(), flat.m_Flattened.Count(), sizeof( typedescription_t ), (int (__cdecl *)(const void *, const void *))CompareFlattenedOffsets ); + + nPackedDataStartOffset = BuildPackedFlattenedOffsets( nPackedDataStartOffset, flat ); + dmap->m_nPackedSize = nPackedDataStartOffset; } - Msg( ":%s\n", history->String() ); + BuildDataRuns( dmap ); } -void CValueChangeTracker::ClearTracking() +const tokenset_t< int > s_PredCopyType[] = { - m_bActive = false; - m_bTracking = false; - m_hEntityToTrack = NULL; - m_strFieldName = ""; - m_History.RemoveAll(); - m_FieldStack.RemoveAll(); -} + { "Non-Sendtable" , PC_NON_NETWORKED_ONLY }, + { "SendTable" , PC_NETWORKED_ONLY }, + { "Everything" , PC_EVERYTHING }, + { NULL, -1 } +}; -static bool FindFieldStackByName_R( const char *fieldname, datamap_t *dmap, CUtlVector< typedescription_t * >& stack ) +const tokenset_t< int > s_PredPackType[] = { - int c = dmap->dataNumFields; - for ( int i = 0; i < c; i++ ) + { "Normal" , TD_OFFSET_NORMAL }, + { "Packed" , TD_OFFSET_PACKED }, + { NULL, -1 } +}; + +static void DescribeRuns( const datamap_t *dmap, int nPredictionCopyType, int packType ) +{ + const datacopyruns_t &runs = dmap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_CopyRuns; + const flattenedoffsets_t &flat = dmap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; + Msg( " Runs for copy type: %s, packing: %s\n", s_PredCopyType->GetNameByToken( nPredictionCopyType ), s_PredPackType->GetNameByToken( packType ) ); + for ( int i = 0; i < runs.m_vecRuns.Count(); ++i ) { - typedescription_t *td = &dmap->dataDesc[ i ]; + const datarun_t *run = &runs.m_vecRuns[ i ]; + Msg( " %5d: %5d -> %5d (%5d bytes): %s to %s\n", + i, run->m_nStartOffset[ packType ], run->m_nStartOffset[ packType ] + run->m_nLength, run->m_nLength, + flat.m_Flattened[ run->m_nStartFlatField ].fieldName, + flat.m_Flattened[ run->m_nEndFlatField ].fieldName ); + } +} - if ( td->fieldType == FIELD_VOID ) - continue; +static void DescribeFlattenedList( const datamap_t *dmap, int nPredictionCopyType, int packType ) +{ + char const *prefix = dmap->dataClassName; - stack.AddToTail( td ); + Msg( "->Sorted %s for copy type: %s, packing: %s\n", prefix, s_PredCopyType->GetNameByToken( nPredictionCopyType ), s_PredPackType->GetNameByToken( packType ) ); + // Now dump the flattened list + int nLastFieldEnd = 0; + int nCurrentRunStartOffset = 0; - if ( td->fieldType == FIELD_EMBEDDED ) + int nRuns = 0; + int nBytesInRuns = 0; + int offset = 0; + + const flattenedoffsets_t &list = dmap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; + for ( int i = 0; i < list.m_Flattened.Count(); ++i ) + { + const typedescription_t *td = &list.m_Flattened[ i ]; + offset = td->flatOffset[ packType ]; + if ( i == 0 ) { - // TODO: this will only find the first subclass with the variable of the specified name - // At some point we might want to support multiple levels of overriding automatically - bool ret = FindFieldStackByName_R( fieldname, td->td, stack ); - if ( ret ) - { - return ret; - } + nLastFieldEnd = offset; + nCurrentRunStartOffset = offset; } - if ( !Q_stricmp( td->fieldName, fieldname ) ) + if ( td->fieldType != FIELD_EMBEDDED ) { - return true; + if ( nLastFieldEnd != offset ) + { + Msg( " gap of %d bytes [last run %d]\n", offset - nLastFieldEnd, ( nLastFieldEnd - nCurrentRunStartOffset ) ); + ++nRuns; + nBytesInRuns += ( nLastFieldEnd - nCurrentRunStartOffset ); + + nCurrentRunStartOffset = offset; + } + nLastFieldEnd = td->flatOffset[ packType ] + td->fieldSizeInBytes; } - stack.FindAndRemove( td ); + Msg( "group %s [flat %d] [sort %d] %d bytes\n", + td->fieldName, + td->flatOffset[ packType ], + td->flatOffset[ TD_OFFSET_NORMAL ], + td->fieldSizeInBytes ); } - if ( dmap->baseMap ) + // Close off last run + if ( nLastFieldEnd != nCurrentRunStartOffset ) { - return FindFieldStackByName_R( fieldname, dmap->baseMap, stack ); + Msg( "Last run %d\n", nLastFieldEnd - nCurrentRunStartOffset ); + ++nRuns; + nBytesInRuns += ( nLastFieldEnd - nCurrentRunStartOffset ); } - return false; -} - -void CValueChangeTracker::SetupTracking( C_BaseEntity *ent, char const *pchFieldName ) -{ - ClearTracking(); - // Find the field - datamap_t *dmap = ent->GetPredDescMap(); - if ( !dmap ) + if ( nRuns > 0 ) { - Msg( "No prediction datamap_t for entity %d/%s\n", ent->index, ent->GetClassname() ); - return; - } + float flAvgBytesPerRun = (float)nBytesInRuns/(float)nRuns; - bool bFound = FindFieldStackByName_R( pchFieldName, dmap, m_FieldStack ); - if ( !bFound || !m_FieldStack.Count() ) - { - Msg( "No field '%s' in datamap_t for entity %d/%s\n", pchFieldName, ent->index, ent->GetClassname() ); - return; + Msg( "%d runs, %d bytes in runs, %f avg bytes per run\n", + nRuns, nBytesInRuns, flAvgBytesPerRun ); } + Msg( "->\n" ); - m_hEntityToTrack = ent; - m_strFieldName = pchFieldName; - m_bActive = true; + DescribeRuns( dmap, nPredictionCopyType, packType ); } -void CValueChangeTracker::Reset() +void CPredictionCopy::CopyFlatFieldsUsingRuns( const datamap_t *pCurrentMap, int nPredictionCopyType ) { - m_History.RemoveAll(); -} + int fieldOffsetSrc; + int fieldOffsetDest; + byte * RESTRICT pOutputData; + const byte * RESTRICT pInputData; -bool CValueChangeTracker::IsActive() const -{ - return m_bActive; -} + const datacopyruns_t &runs = pCurrentMap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_CopyRuns; -void CValueChangeTracker::Spew() -{ - if ( IsActive() ) + byte * RESTRICT pDest = ( byte * RESTRICT )m_pDest; + const byte * RESTRICT pSrc = (const byte * RESTRICT)m_pSrc; + + PREFETCH360( pSrc, 0 ); + PREFETCH360( pDest, 0 ); + + int c = runs.m_vecRuns.Count(); + for ( int i = 0; i < c; ++i ) { - for ( int i = 0 ; i < m_History.Count(); ++i ) - { - Msg( "%s\n", m_History[ i ].String() ); - } - } + const datarun_t * RESTRICT run = &runs.m_vecRuns[ i ]; + fieldOffsetDest = run->m_nStartOffset[ m_nDestOffsetIndex ]; + fieldOffsetSrc = run->m_nStartOffset[ m_nSrcOffsetIndex ]; + pOutputData = pDest + fieldOffsetDest; + pInputData = pSrc + fieldOffsetSrc; - Reset(); -} +#ifdef _X360 + PREFETCH360( pDest + run->m_nPrefetchOffset[ m_nDestOffsetIndex ], 0 ); + PREFETCH360( pSrc + run->m_nPrefetchOffset[ m_nSrcOffsetIndex ], 0 ); +#endif -static CValueChangeTracker g_ChangeTracker; -CValueChangeTracker *g_pChangeTracker = &g_ChangeTracker; + Q_memcpy( pOutputData, pInputData, run->m_nLength ); + } +} -CON_COMMAND_F( cl_pred_track, " : Track changes to entity index entindex, for field fieldname.", 0 ) +void CPredictionCopy::CopyFlatFields( const datamap_t *pCurrentMap, int nPredictionCopyType ) { - g_pChangeTracker->ClearTracking(); + int fieldOffsetSrc; + int fieldOffsetDest; + byte * RESTRICT pOutputData; + const byte * RESTRICT pInputData; - if ( args.ArgC() != 3 ) - { - Msg( "cl_pred_track \n" ); - return; - } + byte * RESTRICT pDest = (byte * RESTRICT)m_pDest; + const byte * RESTRICT pSrc = (const byte * RESTRICT)m_pSrc; - int iEntIndex = Q_atoi( args[1] ); + PREFETCH360( pSrc, 0 ); + PREFETCH360( pDest, 0 ); - C_BaseEntity *ent = cl_entitylist->GetBaseEntity( iEntIndex ); - if ( !ent ) - { - Msg( "cl_pred_track: Unknown ent index %d\n", iEntIndex ); - return; - } + const flattenedoffsets_t &flat = pCurrentMap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; - g_pChangeTracker->SetupTracking( ent, args[2] ); -} + int fieldCount = flat.m_Flattened.Count(); + for ( int i = 0; i < fieldCount; ++i ) + { + const typedescription_t *pField = &flat.m_Flattened[ i ]; -#endif + fieldOffsetDest = pField->flatOffset[ m_nDestOffsetIndex ]; + fieldOffsetSrc = pField->flatOffset[ m_nSrcOffsetIndex ]; + pOutputData = pDest + fieldOffsetDest; + PREFETCH360( pOutputData, 0 ); + pInputData = pSrc + fieldOffsetSrc; + PREFETCH360( pInputData, 0 ); -#if defined( CLIENT_DLL ) && defined( COPY_CHECK_STRESSTEST ) + Q_memcpy( pOutputData, pInputData, pField->fieldSizeInBytes ); + } +} -class CPredictionCopyTester : public IGameSystem +void CPredictionCopy::ErrorCheckFlatFields_NoSpew( const datamap_t *pCurrentMap, int nPredictionCopyType ) { -public: + int i; + int flags; + int fieldOffsetSrc; + int fieldOffsetDest; + int fieldSize; - // Init, shutdown - virtual void Init() - { - RunTests(); - Remove( this ); - } + const flattenedoffsets_t &flat = pCurrentMap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; + const typedescription_t *pBase = &flat.m_Flattened[ 0 ]; + PREFETCH360( pBase, 0 ); + int fieldCount = flat.m_Flattened.Count(); - virtual void Shutdown() {} + const byte * RESTRICT pDest = (const byte * RESTRICT)m_pDest; + const byte * RESTRICT pSrc = (const byte * RESTRICT)m_pSrc; + + const byte *pOutputData; + const byte *pInputData; - // Level init, shutdown - virtual void LevelInit() {} - // The level is shutdown in two parts - virtual void LevelShutdownPreEntity() {} - // Entities are deleted / released here... - virtual void LevelShutdownPostEntity() {} - // end of level shutdown + PREFETCH360( pSrc, 0 ); + PREFETCH360( pDest, 0 ); - // Called before rendering - virtual void PreRender ( ) {} + for ( i = 0; i < fieldCount && !m_nErrorCount; ++i ) + { + const typedescription_t * RESTRICT pField = &pBase[ i ]; - // Called after rendering - virtual void PostRender() {} + flags = pField->flags; + if ( flags & FTYPEDESC_NOERRORCHECK ) + continue; - // Gets called each frame - virtual void Update( float frametime ) {} +#if _X360 + if ( !(i & 0xF) ) + { + PREFETCH360(pField, 128); + } +#endif -private: + fieldOffsetDest = pField->flatOffset[ m_nDestOffsetIndex ]; + fieldOffsetSrc = pField->flatOffset[ m_nSrcOffsetIndex ]; - void RunTests( void ); -}; + pOutputData = pDest + fieldOffsetDest; + PREFETCH360( pOutputData, 0 ); + pInputData = pSrc + fieldOffsetSrc; + PREFETCH360( pInputData, 0 ); -IGameSystem* GetPredictionCopyTester( void ) -{ - static CPredictionCopyTester s_PredictionCopyTesterSystem; - return &s_PredictionCopyTesterSystem; + fieldSize = pField->fieldSize; + int nFieldType = pField->fieldType; + + PREDICTIONCOPY_APPLY( ProcessField_Compare_NoSpew, nFieldType, pCurrentMap, pField, pOutputData, pInputData, fieldSize ); + } } -class CCopyTesterData +void CPredictionCopy::ErrorCheckFlatFields_Spew( const datamap_t *pCurrentMap, int nPredictionCopyType ) { -public: - - CCopyTesterData() - { - m_CharValue = 'a'; - m_ShortValue = (short)100; - m_IntValue = (int)100; - m_FloatValue = 1.0f; - Q_strncpy( m_szValue, "primarydata", sizeof( m_szValue ) ); - m_Vector = Vector( 100, 100, 100 ); - m_Bool = false; - m_Clr.r = m_Clr.g = m_Clr.b = m_Clr.a = 255; + int i; + int flags; + int fieldOffsetSrc; + int fieldOffsetDest; + int fieldSize; - m_Ptr = (void *)0xfedcba98; - // m_hEHandle = NULL; - } + const flattenedoffsets_t &flat = pCurrentMap->m_pOptimizedDataMap->m_Info[ nPredictionCopyType ].m_Flat; + const typedescription_t *pBase = &flat.m_Flattened[ 0 ]; + PREFETCH360( pBase, 0 ); + int fieldCount = flat.m_Flattened.Count(); - void MakeDifferent( void ) - { - m_CharValue = 'd'; - m_ShortValue = (short)400; - m_IntValue = (int)400; - m_FloatValue = 4.0f; - Q_strncpy( m_szValue, "secondarydata", sizeof( m_szValue ) ); - m_Vector = Vector( 400, 400, 400 ); - m_Bool = true; - m_Clr.r = m_Clr.g = m_Clr.b = m_Clr.a = 1; - m_Ptr = (void *)0x00000001; - // m_hEHandle = (C_BaseEntity *)0x00000001; - } + const byte * RESTRICT pDest = m_pDest; + const byte * RESTRICT pSrc = m_pSrc; - DECLARE_PREDICTABLE(); + const byte *pOutputData; + const byte *pInputData; - char m_CharValue; - short m_ShortValue; - int m_IntValue; - float m_FloatValue; - char m_szValue[ 128 ]; - Vector m_Vector; - bool m_Bool; - color32 m_Clr; - void *m_Ptr; -// EHANDLE m_hEHandle; + PREFETCH360( pSrc, 0 ); + PREFETCH360( pDest, 0 ); -}; + for ( i = 0; i < fieldCount ; ++i ) + { + const typedescription_t * RESTRICT pField = &pBase[ i ]; -BEGIN_PREDICTION_DATA_NO_BASE( CCopyTesterData ) + flags = pField->flags; + if ( flags & FTYPEDESC_NOERRORCHECK ) + continue; - DEFINE_FIELD( CCopyTesterData, m_CharValue, FIELD_CHARACTER ), - DEFINE_FIELD( CCopyTesterData, m_ShortValue, FIELD_SHORT ), - DEFINE_FIELD( CCopyTesterData, m_IntValue, FIELD_INTEGER ), - DEFINE_FIELD( CCopyTesterData, m_FloatValue, FIELD_FLOAT ), - DEFINE_FIELD( CCopyTesterData, m_szValue, FIELD_STRING ), - DEFINE_FIELD( CCopyTesterData, m_Vector, FIELD_VECTOR ), - DEFINE_FIELD( CCopyTesterData, m_Bool, FIELD_BOOLEAN ), - DEFINE_FIELD( CCopyTesterData, m_Clr, FIELD_COLOR32 ), -// DEFINE_FIELD( CCopyTesterData, m_hEHandle, FIELD_EHANDLE ), +#if _X360 + if ( !(i & 0xF) ) + { + PREFETCH360(pField, 128); + } +#endif -END_PREDICTION_DATA() + fieldOffsetDest = pField->flatOffset[ m_nDestOffsetIndex ]; + fieldOffsetSrc = pField->flatOffset[ m_nSrcOffsetIndex ]; -class CCopyTesterData2 : public C_BaseEntity -{ - DECLARE_CLASS( CCopyTesterData2, C_BaseEntity ); + pOutputData = pDest + fieldOffsetDest; + PREFETCH360( pOutputData, 0 ); + pInputData = pSrc + fieldOffsetSrc; + PREFETCH360( pInputData, 0 ); -public: - CCopyTesterData2() - { - CONSTRUCT_PREDICTABLE( CCopyTesterData2 ); + fieldSize = pField->fieldSize; + flags = pField->flags; + int nFieldType = pField->fieldType; - m_CharValue = 'b'; - m_ShortValue = (short)200; - m_IntValue = (int)200; - m_FloatValue = 2.0f; + PREDICTIONCOPY_APPLY( ProcessField_Compare_Spew, nFieldType, pCurrentMap, pField, pOutputData, pInputData, fieldSize ); } +} - void MakeDifferent( void ) +bool CPredictionCopy::PrepareDataMap( datamap_t *dmap ) +{ + bool bPerformedPrepare = false; + if ( dmap && !dmap->m_pOptimizedDataMap ) { - m_CharValue = 'e'; - m_ShortValue = (short)500; - m_IntValue = (int)500; - m_FloatValue = 5.0f; - m_FooData.MakeDifferent(); + bPerformedPrepare = true; + BuildFlattenedChains( dmap ); + dmap = dmap->baseMap; } - DECLARE_PREDICTABLE(); - - char m_CharValue; - short m_ShortValue; - int m_IntValue; - float m_FloatValue; - - CCopyTesterData m_FooData; -}; - -BEGIN_PREDICTION_DATA_NO_BASE( CCopyTesterData2 ) - - DEFINE_FIELD( CCopyTesterData2, m_CharValue, FIELD_CHARACTER ), - DEFINE_FIELD( CCopyTesterData2, m_ShortValue, FIELD_SHORT ), - DEFINE_PRED_TYPEDESCRIPTION( CCopyTesterData2, m_FooData, CCopyTesterData ), - DEFINE_FIELD( CCopyTesterData2, m_IntValue, FIELD_INTEGER ), - DEFINE_FIELD( CCopyTesterData2, m_FloatValue, FIELD_FLOAT ), - -END_PREDICTION_DATA() + return bPerformedPrepare; +} -void CPredictionCopyTester::RunTests( void ) +CON_COMMAND( cl_predictioncopy_describe, "Describe datamap_t for entindex" ) { - CCopyTesterData2 *foo1, *foo2, *foo3; + if ( args.ArgC() <= 1 ) + { + Msg( "Usage: %s ", args[ 0 ] ); + return; + } + int entindex = Q_atoi( args[ 1 ] ); + C_BaseEntity *ent = C_BaseEntity::Instance( entindex ); + if ( !ent ) + { + Msg( "cl_predictioncopy_describe: no such entity %d\n", entindex ); + return; + } - foo1 = new CCopyTesterData2; - foo2 = new CCopyTesterData2; - foo3 = new CCopyTesterData2; + datamap_t *dmap = ent->GetPredDescMap(); + if ( !dmap ) + { + return; + } + CPredictionCopy::PrepareDataMap( dmap ); - foo2->MakeDifferent(); + for ( int nPredictionCopyType = 0; nPredictionCopyType < PC_COPYTYPE_COUNT; ++nPredictionCopyType ) + { + //for ( int i = 0; i < TD_OFFSET_COUNT; ++i ) + { + DescribeFlattenedList( dmap, nPredictionCopyType, 0 ); + } + } +} +// 0 PC_NON_NETWORKED_ONLY = (1<<0) or (1) +// 1 PC_NETWORKED_ONLY = (1<<1) or (2) +// 2 PC_EVERYTHING = ( PC_NON_NETWORKED_ONLY | PC_NETWORKED_ONLY ) or 3 +// So for these three options, we just take the type and add one!!! +FORCEINLINE int ComputeTypeMask( int nType ) +{ + return nType + 1; +} +#if 0 // Enable this for perf testing +static ConVar cl_predictioncopy_runs( "cl_predictioncopy_runs", "1" ); +static ConVar cl_predictioncopy_repeats( "cl_predictioncopy_repeats", "1" ); +void CPredictionCopy::TransferDataCopyOnly( datamap_t *dmap ) +{ + int repeat = cl_predictioncopy_repeats.GetInt(); + for ( int k = 0; k < repeat; ++k ) { - Msg( "Comparing and copying == objects, should have zero diffcount\n" ); - - CPredictionCopy tester( PC_NON_NETWORKED_ONLY, foo1, false, foo3, false, true ); - int diff_count = 0; - diff_count = tester.TransferData( foo3->GetPredDescMap(), foo1->GetPredDescMap()->dataDesc, foo1->GetPredDescMap()->dataNumFields ); - - Msg( "diff_count == %i\n", diff_count ); - Assert( !diff_count ); + int types = ComputeTypeMask( m_nType ); + for ( int i = 0; i < PC_COPYTYPE_COUNT; ++i ) + { + if ( types & (1<GetPredDescMap(), foo1->GetPredDescMap()->dataDesc, foo1->GetPredDescMap()->dataNumFields ); - - Msg( "diff_count == %i (should be 12)\n", diff_count ); - Assert( diff_count == 12 ); + if ( types & (1<GetPredDescMap(), foo1->GetPredDescMap()->dataDesc, foo1->GetPredDescMap()->dataNumFields ); - - Msg( "diff_count == %i (should be 12)\n", diff_count ); - Assert( diff_count == 12 ); +void CPredictionCopy::TransferDataErrorCheckSpew( char const *pchOperation, const datamap_t *dmap ) +{ + int types = ComputeTypeMask( m_nType ); + for ( int i = 0; i < PC_COPYTYPE_COUNT; ++i ) + { + if ( types & (1< vecGroups; + int nGroup = 0; + BuildGroupList_R( i, nGroup, dmap, vecGroups ); + DescribeFields( vecGroups, dmap, i ); + } + } +} + +int CPredictionCopy::TransferData( const char *operation, int entindex, datamap_t *dmap ) +{ + m_nEntIndex = entindex; - CPredictionCopy tester( PC_NON_NETWORKED_ONLY, foo1, false, foo2, false, true ); - int diff_count = 0; - diff_count = tester.TransferData( foo2->GetPredDescMap(), foo1->GetPredDescMap()->dataDesc, foo1->GetPredDescMap()->dataNumFields ); + PrepareDataMap( dmap ); - Msg( "diff_count == %i\n", diff_count ); - Assert( !diff_count ); + switch ( m_OpType ) + { + default: + Assert( 0 ); + case TRANSFERDATA_COPYONLY: // Data copying only (uses runs) + { + // Watch is based on "destination" of any write operation + DetermineWatchField( operation, entindex, dmap ); + TransferDataCopyOnly( dmap ); + } + break; + case TRANSFERDATA_ERRORCHECK_NOSPEW: // Checks for errors, returns after first error found + { + TransferDataErrorCheckNoSpew( operation, dmap ); + } + break; + case TRANSFERDATA_ERRORCHECK_SPEW: // checks for errors, reports all errors to console + { + TransferDataErrorCheckSpew( operation, dmap ); + } + break; + case TRANSFERDATA_ERRORCHECK_DESCRIBE: + { + TransferDataDescribe( operation, dmap ); + } + break; } + if ( m_pWatchField ) { - CPredictionDescribeData describe( foo1, false ); - describe.DumpDescription( foo1->GetPredDescMap(), foo1->GetPredDescMap()->dataDesc, foo1->GetPredDescMap()->dataNumFields ); + // Watch is based on "destination" of any write operation + DumpWatchField( m_pWatchField, m_pDest + m_pWatchField->flatOffset[ m_nDestOffsetIndex ], m_pWatchField->fieldSize ); } - - delete foo3; - delete foo2; - delete foo1; + return m_nErrorCount; } -#endif // CLIENT_DLL -#endif // !NO_ENTITY_PREDICTION ) +#endif + + + diff --git a/game/shared/predictioncopy.h b/game/shared/predictioncopy.h index 47b0ac728..91014f927 100644 --- a/game/shared/predictioncopy.h +++ b/game/shared/predictioncopy.h @@ -15,13 +15,15 @@ #include "datamap.h" #include "ehandle.h" #include "tier1/utlstring.h" +#include "tier1/utlrbtree.h" +#include "tier1/utlstack.h" #if defined( CLIENT_DLL ) class C_BaseEntity; typedef CHandle EHANDLE; -#if defined( _DEBUG ) // #define COPY_CHECK_STRESSTEST +#if defined( COPY_CHECK_STRESSTEST ) class IGameSystem; IGameSystem* GetPredictionCopyTester( void ); #endif @@ -31,18 +33,69 @@ class CBaseEntity; typedef CHandle EHANDLE; #endif -enum +typedef void ( *FN_FIELD_COMPARE )( const char *classname, const char *fieldname, const char *fieldtype, + bool networked, bool noterrorchecked, bool differs, bool withintolerance, const char *value ); + +// Each datamap_t is broken down into two flattened arrays of fields, +// one for PC_NETWORKED_DATA and one for PC_NON_NETWORKED_ONLY (optimized_datamap_t::datamapinfo_t::flattenedoffsets_t) +// Each flattened array is sorted by offset for better cache performance +// Finally, contiguous "runs" off offsets are precomputed (optimized_datamap_t::datamapinfo_t::datacopyruns_t) for fast copy operations + +// A data run is a set of DEFINE_PRED_FIELD fields in a c++ object which are contiguous and can be processing +// using a single memcpy operation +struct datarun_t { - PC_EVERYTHING = 0, - PC_NON_NETWORKED_ONLY, - PC_NETWORKED_ONLY, + datarun_t() : m_nStartFlatField( 0 ), m_nEndFlatField( 0 ), m_nLength( 0 ) + { + for ( int i = 0 ; i < TD_OFFSET_COUNT; ++i ) + { + m_nStartOffset[ i ] = 0; +#ifdef _X360 + // These are the offsets of the next run, for priming the L1 cache + m_nPrefetchOffset[ i ] = 0; +#endif + } + } + + // Indices of start/end fields in the flattened typedescription_t list + int m_nStartFlatField; + int m_nEndFlatField; + + // Offsets for run in the packed/unpacked data (I think the run starts need to be properly aligned) + int m_nStartOffset[ TD_OFFSET_COUNT ]; +#ifdef _X360 + // These are the offsets of the next run, for priming the L1 cache + int m_nPrefetchOffset[ TD_OFFSET_COUNT ]; +#endif + int m_nLength; }; -#define PC_DATA_PACKED true -#define PC_DATA_NORMAL false +struct datacopyruns_t +{ +public: + CUtlVector< datarun_t > m_vecRuns; +}; -typedef void ( *FN_FIELD_COMPARE )( const char *classname, const char *fieldname, const char *fieldtype, - bool networked, bool noterrorchecked, bool differs, bool withintolerance, const char *value ); +struct flattenedoffsets_t +{ + CUtlVector< typedescription_t > m_Flattened; + int m_nPackedSize; // Contiguous memory to pack all of these together for TD_OFFSET_PACKED + int m_nPackedStartOffset; +}; + +struct datamapinfo_t +{ + // Flattened list, with FIELD_EMBEDDED, FTYPEDESC_PRIVATE, + // and FTYPEDESC_OVERRIDE (overridden) fields removed + flattenedoffsets_t m_Flat; + datacopyruns_t m_CopyRuns; +}; + +struct optimized_datamap_t +{ + // Optimized info for PC_NON_NETWORKED and PC_NETWORKED data + datamapinfo_t m_Info[ PC_COPYTYPE_COUNT ]; +}; class CPredictionCopy { @@ -54,152 +107,164 @@ class CPredictionCopy WITHINTOLERANCE, } difftype_t; - CPredictionCopy( int type, void *dest, bool dest_packed, void const *src, bool src_packed, - bool counterrors = false, bool reporterrors = false, bool performcopy = true, - bool describefields = false, FN_FIELD_COMPARE func = NULL ); - - void CopyShort( difftype_t dt, short *outvalue, const short *invalue, int count ); - void CopyInt( difftype_t dt, int *outvalue, const int *invalue, int count ); // Copy an int - void CopyBool( difftype_t dt, bool *outvalue, const bool *invalue, int count ); // Copy a bool - void CopyFloat( difftype_t dt, float *outvalue, const float *invalue, int count ); // Copy a float - void CopyString( difftype_t dt, char *outstring, const char *instring ); // Copy a null-terminated string - void CopyVector( difftype_t dt, Vector& outValue, const Vector &inValue ); // Copy a vector - void CopyVector( difftype_t dt, Vector* outValue, const Vector *inValue, int count ); // Copy a vector array - void CopyQuaternion( difftype_t dt, Quaternion& outValue, const Quaternion &inValue ); // Copy a quaternion - void CopyQuaternion( difftype_t dt, Quaternion* outValue, const Quaternion *inValue, int count ); // Copy a quaternion array - void CopyEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE const *invalue, int count ); - - void FORCEINLINE CopyData( difftype_t dt, int size, char *outdata, const char *indata ) // Copy a binary data block + typedef enum { - if ( !m_bPerformCopy ) - return; - - if ( dt == IDENTICAL ) - return; - - memcpy( outdata, indata, size ); - } - + TRANSFERDATA_COPYONLY = 0, // Data copying only (uses runs) + TRANSFERDATA_ERRORCHECK_NOSPEW, // Checks for errors, returns after first error found + TRANSFERDATA_ERRORCHECK_SPEW, // checks for errors, reports all errors to console + TRANSFERDATA_ERRORCHECK_DESCRIBE, // used by hud_pdump, dumps values, etc, for all fields + } optype_t; + + CPredictionCopy( int type, byte *dest, bool dest_packed, const byte *src, bool src_packed, + optype_t opType, FN_FIELD_COMPARE func = NULL ); + int TransferData( const char *operation, int entindex, datamap_t *dmap ); + static bool PrepareDataMap( datamap_t *dmap ); + static const typedescription_t *FindFlatFieldByName( const char *fieldname, const datamap_t *dmap ); private: - void TransferData_R( int chaincount, datamap_t *dmap ); - - void DetermineWatchField( const char *operation, int entindex, datamap_t *dmap ); - void DumpWatchField( typedescription_t *field ); - void WatchMsg( const char *fmt, ... ); - - difftype_t CompareShort( short *outvalue, const short *invalue, int count ); - difftype_t CompareInt( int *outvalue, const int *invalue, int count ); // Compare an int - difftype_t CompareBool( bool *outvalue, const bool *invalue, int count ); // Compare a bool - difftype_t CompareFloat( float *outvalue, const float *invalue, int count ); // Compare a float - difftype_t CompareData( int size, char *outdata, const char *indata ); // Compare a binary data block - difftype_t CompareString( char *outstring, const char *instring ); // Compare a null-terminated string - difftype_t CompareVector( Vector& outValue, const Vector &inValue ); // Compare a vector - difftype_t CompareVector( Vector* outValue, const Vector *inValue, int count ); // Compare a vector array - difftype_t CompareQuaternion( Quaternion& outValue, const Quaternion &inValue ); // Compare a Quaternion - difftype_t CompareQuaternion( Quaternion* outValue, const Quaternion *inValue, int count ); // Compare a Quaternion array - difftype_t CompareEHandle( EHANDLE *outvalue, EHANDLE const *invalue, int count ); - - void DescribeShort( difftype_t dt, short *outvalue, const short *invalue, int count ); - void DescribeInt( difftype_t dt, int *outvalue, const int *invalue, int count ); // Compare an int - void DescribeBool( difftype_t dt, bool *outvalue, const bool *invalue, int count ); // Compare a bool - void DescribeFloat( difftype_t dt, float *outvalue, const float *invalue, int count ); // Compare a float - void DescribeData( difftype_t dt, int size, char *outdata, const char *indata ); // Compare a binary data block - void DescribeString( difftype_t dt, char *outstring, const char *instring ); // Compare a null-terminated string - void DescribeVector( difftype_t dt, Vector& outValue, const Vector &inValue ); // Compare a vector - void DescribeVector( difftype_t dt, Vector* outValue, const Vector *inValue, int count ); // Compare a vector array - void DescribeQuaternion( difftype_t dt, Quaternion& outValue, const Quaternion &inValue ); // Compare a Quaternion - void DescribeQuaternion( difftype_t dt, Quaternion* outValue, const Quaternion *inValue, int count ); // Compare a Quaternion array - void DescribeEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE const *invalue, int count ); - - void WatchShort( difftype_t dt, short *outvalue, const short *invalue, int count ); - void WatchInt( difftype_t dt, int *outvalue, const int *invalue, int count ); // Compare an int - void WatchBool( difftype_t dt, bool *outvalue, const bool *invalue, int count ); // Compare a bool - void WatchFloat( difftype_t dt, float *outvalue, const float *invalue, int count ); // Compare a float - void WatchData( difftype_t dt, int size, char *outdata, const char *indata ); // Compare a binary data block - void WatchString( difftype_t dt, char *outstring, const char *instring ); // Compare a null-terminated string - void WatchVector( difftype_t dt, Vector& outValue, const Vector &inValue ); // Compare a vector - void WatchVector( difftype_t dt, Vector* outValue, const Vector *inValue, int count ); // Compare a vector array - void WatchQuaternion( difftype_t dt, Quaternion& outValue, const Quaternion &inValue ); // Compare a Quaternion - void WatchQuaternion( difftype_t dt, Quaternion* outValue, const Quaternion *inValue, int count ); // Compare a Quaternion array - void WatchEHandle( difftype_t dt, EHANDLE *outvalue, EHANDLE const *invalue, int count ); + + // Operations: + void TransferDataCopyOnly( const datamap_t *dmap ); + void TransferDataErrorCheckNoSpew( char const *pchOperation, const datamap_t *dmap ); + void TransferDataErrorCheckSpew( char const *pchOperation, const datamap_t *dmap ); + void TransferDataDescribe( char const *pchOperation, const datamap_t *dmap ); + // Report function - void ReportFieldsDiffer( const char *fmt, ... ); - void DescribeFields( difftype_t dt, const char *fmt, ... ); + void ReportFieldsDiffer( const datamap_t *pCurrentMap, const typedescription_t *pField, const char *fmt, ... ); + void OutputFieldDescription( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t dt, const char *fmt, ... ); - bool CanCheck( void ); - - void CopyFields( int chaincount, datamap_t *pMap, typedescription_t *pFields, int fieldCount ); + // Helper for TransferDataCopyOnly + void CopyFlatFieldsUsingRuns( const datamap_t *pCurrentMap, int nPredictionCopyType ); + void CopyFlatFields( const datamap_t *pCurrentMap, int nPredictionCopyType ); + template< class T > + FORCEINLINE void CopyField( difftype_t difftype, T *outvalue, const T *invalue, int count ); + + // Helper for TransferDataErrorCheckNoSpew + void ErrorCheckFlatFields_NoSpew( const datamap_t *pCurrentMap, int nPredictionCopyType ); + template< class T > + FORCEINLINE void ProcessField_Compare_NoSpew( const datamap_t *pCurrentMap, const typedescription_t *pField, const T *pOutputData, const T *pInputData, int fieldSize ); + + // Helper for TransferDataErrorCheckSpew + void ErrorCheckFlatFields_Spew( const datamap_t *pCurrentMap, int nPredictionCopyType ); + template< class T > + FORCEINLINE void ProcessField_Compare_Spew( const datamap_t *pCurrentMap, const typedescription_t *pField, const T *pOutputData, const T *pInputData, int fieldSize ); + + // Helper for TransferDataDescribe + void DescribeFields( const CUtlVector< const datamap_t * > &vecGroups, const datamap_t *pCurrentMap, int nPredictionCopyType ); + // Main entry point + template< class T > + FORCEINLINE void ProcessField_Describe( const datamap_t *pCurrentMap, const typedescription_t *pField, const T *pOutputData, const T *pInputData, int fieldSize ); + + // Helpers for entity field watcher + void DetermineWatchField( const char *operation, int entindex, const datamap_t *dmap ); + void WatchMsg( const typedescription_t *pField, const char *fmt, ... ); + void DumpWatchField( const typedescription_t *pField, const byte *outvalue, int count ); + template< class T > + FORCEINLINE void WatchField( const typedescription_t *pField, const T *outvalue, int count ); + + // Helper for ErrorCheck ops + template< class T > + FORCEINLINE difftype_t CompareField( const typedescription_t *pField, const T *outvalue, const T *invalue, int count ); + // Used by TRANSFERDATA_ERRORCHECK_SPEW and by TRANSFERDATA_ERRORCHECK_DESCRIBE + template< class T > + FORCEINLINE void DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const T *outvalue, const T *invalue, int count ); private: + optype_t m_OpType; int m_nType; - void *m_pDest; - void const *m_pSrc; + byte *m_pDest; + const byte *m_pSrc; int m_nDestOffsetIndex; int m_nSrcOffsetIndex; - - - bool m_bErrorCheck; - bool m_bReportErrors; - bool m_bDescribeFields; - typedescription_t *m_pCurrentField; - char const *m_pCurrentClassName; - datamap_t *m_pCurrentMap; - bool m_bShouldReport; - bool m_bShouldDescribe; int m_nErrorCount; - bool m_bPerformCopy; + int m_nEntIndex; FN_FIELD_COMPARE m_FieldCompareFunc; - typedescription_t *m_pWatchField; + const typedescription_t *m_pWatchField; char const *m_pOperation; + + CUtlStack< const typedescription_t * > m_FieldStack; }; typedef void (*FN_FIELD_DESCRIPTION)( const char *classname, const char *fieldname, const char *fieldtype, bool networked, const char *value ); -//----------------------------------------------------------------------------- -// Purpose: Simply dumps all data fields in object -//----------------------------------------------------------------------------- -class CPredictionDescribeData -{ -public: - CPredictionDescribeData( void const *src, bool src_packed, FN_FIELD_DESCRIPTION func = 0 ); - - void DescribeShort( const short *invalue, int count ); - void DescribeInt( const int *invalue, int count ); - void DescribeBool( const bool *invalue, int count ); - void DescribeFloat( const float *invalue, int count ); - void DescribeData( int size, const char *indata ); - void DescribeString( const char *instring ); - void DescribeVector( const Vector &inValue ); - void DescribeVector( const Vector *inValue, int count ); - void DescribeQuaternion( const Quaternion &inValue ); - void DescribeQuaternion( const Quaternion *inValue, int count ); - void DescribeEHandle( EHANDLE const *invalue, int count ); - - void DumpDescription( datamap_t *pMap ); +// +// Compare methods +// +// Specializations +template<> FORCEINLINE CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const float *outvalue, const float *invalue, int count ); +template<> FORCEINLINE CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const Vector *outvalue, const Vector *invalue, int count ); +template<> FORCEINLINE CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const Quaternion *outvalue, const Quaternion *invalue, int count ); +template<> FORCEINLINE CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const char *outvalue, const char *invalue, int count ); +template<> FORCEINLINE CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const EHANDLE *outvalue, const EHANDLE *invalue, int count ); +template<> FORCEINLINE CPredictionCopy::difftype_t CPredictionCopy::CompareField( const typedescription_t *pField, const color32 *outvalue, const color32 *invalue, int count ); -private: - void DescribeFields_R( int chain_count, datamap_t *pMap, typedescription_t *pFields, int fieldCount ); +// +// Describe Methods +// - void const *m_pSrc; - int m_nSrcOffsetIndex; +// Specializations +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const short *outvalue, const short *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const int *outvalue, const int *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const bool *outvalue, const bool *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const float *outvalue, const float *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const char *outvalue, const char *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const Vector* outValue, const Vector *inValue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const Quaternion* outValue, const Quaternion *inValue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const EHANDLE *outvalue, const EHANDLE *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const color32 *outvalue, const color32 *invalue, int count ); +template<> FORCEINLINE void CPredictionCopy::DescribeField( const datamap_t *pCurrentMap, const typedescription_t *pField, difftype_t difftype, const uint8 *outvalue, const uint8 *invalue, int count ); + + +// +// Watch Methods +// +// Specializations +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const short *outvalue,int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const int *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const bool *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const float *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const Vector *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const Quaternion *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const EHANDLE *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const char *outvalue, int count ); +template<> FORCEINLINE void CPredictionCopy::WatchField( const typedescription_t *pField, const color32 *outvalue, int count ); +// +// Copy Methods +// +// specializations +template<> FORCEINLINE void CPredictionCopy::CopyField( difftype_t difftype, char *outvalue, const char *invalue, int count ); - void Describe( const char *fmt, ... ); +template< class T > +FORCEINLINE void CPredictionCopy::ProcessField_Compare_NoSpew( const datamap_t *pCurrentMap, const typedescription_t *pField, const T *pOutputData, const T *pInputData, int fieldSize ) +{ + difftype_t difftype = CompareField( pField, pOutputData, pInputData, fieldSize ); + if ( difftype == DIFFERS ) + { + ++m_nErrorCount; + } +} - typedescription_t *m_pCurrentField; - char const *m_pCurrentClassName; - datamap_t *m_pCurrentMap; - bool m_bShouldReport; +template< class T > +FORCEINLINE void CPredictionCopy::ProcessField_Compare_Spew( const datamap_t *pCurrentMap, const typedescription_t *pField, const T *pOutputData, const T *pInputData, int fieldSize ) +{ + difftype_t difftype = CompareField( pField, pOutputData, pInputData, fieldSize ); + DescribeField( pCurrentMap, pField, difftype, pOutputData, pInputData, fieldSize ); +} - FN_FIELD_DESCRIPTION m_FieldDescFunc; -}; + +template< class T > +FORCEINLINE void CPredictionCopy::ProcessField_Describe( const datamap_t *pCurrentMap, const typedescription_t *pField, const T *pOutputData, const T *pInputData, int fieldSize ) +{ + difftype_t difftype = CompareField( pField, pOutputData, pInputData, fieldSize ); + DescribeField( pCurrentMap, pField, difftype, pOutputData, pInputData, fieldSize ); +} #if defined( CLIENT_DLL ) class CValueChangeTracker @@ -234,7 +299,7 @@ class CValueChangeTracker bool m_bActive : 1; bool m_bTracking : 1; EHANDLE m_hEntityToTrack; - CUtlVector< typedescription_t * > m_FieldStack; + const typedescription_t *m_pTrackField; CUtlString m_strFieldName; CUtlString m_strContext; // First 128 bytes of data is all we will consider diff --git a/game/shared/shareddefs.h b/game/shared/shareddefs.h index 704d110c2..22c21e82d 100644 --- a/game/shared/shareddefs.h +++ b/game/shared/shareddefs.h @@ -1,17 +1,17 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//======= Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ====== // // Purpose: Definitions that are shared by the game DLL and the client DLL. // -// $NoKeywords: $ -//=============================================================================// +//=============================================================================== + #ifndef SHAREDDEFS_H #define SHAREDDEFS_H #ifdef _WIN32 #pragma once #endif -#include "mathlib/vector.h" -#include "utlvector.h" + +#include "bittools.h" #define TICK_INTERVAL (gpGlobals->interval_per_tick) @@ -21,13 +21,17 @@ #define ROUND_TO_TICKS( t ) ( TICK_INTERVAL * TIME_TO_TICKS( t ) ) #define TICK_NEVER_THINK (-1) -#if defined( TF_DLL ) -#define ANIMATION_CYCLE_BITS 10 -#else + #define ANIMATION_CYCLE_BITS 15 -#endif + #define ANIMATION_CYCLE_MINFRAC (1.0f / (1< 1 ) ? true : false; +} + +//----------------------------------------------------------------------------- +// For invalidate physics recursive +//----------------------------------------------------------------------------- +enum InvalidatePhysicsBits_t +{ + POSITION_CHANGED = 0x1, + ANGLES_CHANGED = 0x2, + VELOCITY_CHANGED = 0x4, + ANIMATION_CHANGED = 0x8, // Means cycle has changed, or any other event which would cause render-to-texture shadows to need to be rerendeded + BOUNDS_CHANGED = 0x10, // Means render bounds have changed, so shadow decal projection is required, etc. + SEQUENCE_CHANGED = 0x20, // Means sequence has changed, only interesting when surrounding bounds depends on sequence +}; + +enum Class_T +{ + CLASS_NONE = 0, + CLASS_PLAYER, + CLASS_PLAYER_ALLY, + CLASS_PLAYER_ALLY_VITAL, + CLASS_ANTLION, + CLASS_BARNACLE, + CLASS_BLOB, + CLASS_BULLSEYE, + //CLASS_BULLSQUID, + CLASS_CITIZEN_PASSIVE, + CLASS_CITIZEN_REBEL, + CLASS_COMBINE, + CLASS_COMBINE_GUNSHIP, + CLASS_CONSCRIPT, + CLASS_HEADCRAB, + //CLASS_HOUNDEYE, + CLASS_MANHACK, + CLASS_METROPOLICE, + CLASS_MILITARY, + CLASS_SCANNER, + CLASS_STALKER, + CLASS_VORTIGAUNT, + CLASS_ZOMBIE, + CLASS_PROTOSNIPER, + CLASS_MISSILE, + CLASS_FLARE, + CLASS_EARTH_FAUNA, + CLASS_HACKED_ROLLERMINE, + CLASS_COMBINE_HUNTER, + + LAST_SHARED_ENTITY_CLASS, +}; + +// Factions +#define FACTION_NONE 0 // Not assigned a faction. Entities not assigned a faction will not do faction tests. +#define LAST_SHARED_FACTION (FACTION_NONE) +#define NUM_SHARED_FACTIONS (FACTION_NONE + 1) + #endif // SHAREDDEFS_H diff --git a/game/shared/util_shared.cpp b/game/shared/util_shared.cpp index 068e956e2..485ce1b62 100644 --- a/game/shared/util_shared.cpp +++ b/game/shared/util_shared.cpp @@ -1,1072 +1,2019 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -//=============================================================================// - -#include "cbase.h" -#include "mathlib/mathlib.h" -#include "util_shared.h" -#include "model_types.h" -#include "convar.h" -#include "IEffects.h" -#include "vphysics/object_hash.h" -#include "mathlib/IceKey.H" -#include "checksum_crc.h" -#include "particle_parse.h" -#include "KeyValues.h" - -#ifdef CLIENT_DLL - #include "c_te_effect_dispatch.h" -#else - #include "te_effect_dispatch.h" - -bool NPC_CheckBrushExclude( CBaseEntity *pEntity, CBaseEntity *pBrush ); -#endif - - -// memdbgon must be the last include file in a .cpp file!!! -#include "tier0/memdbgon.h" - -ConVar r_visualizetraces( "r_visualizetraces", "0", FCVAR_CHEAT ); -ConVar developer("developer", "0", 0, "Set developer message level" ); // developer mode - -float UTIL_VecToYaw( const Vector &vec ) -{ - if (vec.y == 0 && vec.x == 0) - return 0; - - float yaw = atan2( vec.y, vec.x ); - - yaw = RAD2DEG(yaw); - - if (yaw < 0) - yaw += 360; - - return yaw; -} - - -float UTIL_VecToPitch( const Vector &vec ) -{ - if (vec.y == 0 && vec.x == 0) - { - if (vec.z < 0) - return 180.0; - else - return -180.0; - } - - float dist = vec.Length2D(); - float pitch = atan2( -vec.z, dist ); - - pitch = RAD2DEG(pitch); - - return pitch; -} - -float UTIL_VecToYaw( const matrix3x4_t &matrix, const Vector &vec ) -{ - Vector tmp = vec; - VectorNormalize( tmp ); - - float x = matrix[0][0] * tmp.x + matrix[1][0] * tmp.y + matrix[2][0] * tmp.z; - float y = matrix[0][1] * tmp.x + matrix[1][1] * tmp.y + matrix[2][1] * tmp.z; - - if (x == 0.0f && y == 0.0f) - return 0.0f; - - float yaw = atan2( -y, x ); - - yaw = RAD2DEG(yaw); - - if (yaw < 0) - yaw += 360; - - return yaw; -} - - -float UTIL_VecToPitch( const matrix3x4_t &matrix, const Vector &vec ) -{ - Vector tmp = vec; - VectorNormalize( tmp ); - - float x = matrix[0][0] * tmp.x + matrix[1][0] * tmp.y + matrix[2][0] * tmp.z; - float z = matrix[0][2] * tmp.x + matrix[1][2] * tmp.y + matrix[2][2] * tmp.z; - - if (x == 0.0f && z == 0.0f) - return 0.0f; - - float pitch = atan2( z, x ); - - pitch = RAD2DEG(pitch); - - if (pitch < 0) - pitch += 360; - - return pitch; -} - -Vector UTIL_YawToVector( float yaw ) -{ - Vector ret; - - ret.z = 0; - float angle = DEG2RAD( yaw ); - SinCos( angle, &ret.y, &ret.x ); - - return ret; -} - -//----------------------------------------------------------------------------- -// Purpose: Helper function get get determinisitc random values for shared/prediction code -// Input : seedvalue - -// *module - -// line - -// Output : static int -//----------------------------------------------------------------------------- -static int SeedFileLineHash( int seedvalue, const char *sharedname, int additionalSeed ) -{ - CRC32_t retval; - - CRC32_Init( &retval ); - - CRC32_ProcessBuffer( &retval, (void *)&seedvalue, sizeof( int ) ); - CRC32_ProcessBuffer( &retval, (void *)&additionalSeed, sizeof( int ) ); - CRC32_ProcessBuffer( &retval, (void *)sharedname, Q_strlen( sharedname ) ); - - CRC32_Final( &retval ); - - return (int)( retval ); -} - -float SharedRandomFloat( const char *sharedname, float flMinVal, float flMaxVal, int additionalSeed /*=0*/ ) -{ - Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); - - int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); - RandomSeed( seed ); - return RandomFloat( flMinVal, flMaxVal ); -} - -int SharedRandomInt( const char *sharedname, int iMinVal, int iMaxVal, int additionalSeed /*=0*/ ) -{ - Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); - - int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); - RandomSeed( seed ); - return RandomInt( iMinVal, iMaxVal ); -} - -Vector SharedRandomVector( const char *sharedname, float minVal, float maxVal, int additionalSeed /*=0*/ ) -{ - Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); - - int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); - RandomSeed( seed ); - // HACK: Can't call RandomVector/Angle because it uses rand() not vstlib Random*() functions! - // Get a random vector. - Vector random; - random.x = RandomFloat( minVal, maxVal ); - random.y = RandomFloat( minVal, maxVal ); - random.z = RandomFloat( minVal, maxVal ); - return random; -} - -QAngle SharedRandomAngle( const char *sharedname, float minVal, float maxVal, int additionalSeed /*=0*/ ) -{ - Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); - - int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); - RandomSeed( seed ); - - // HACK: Can't call RandomVector/Angle because it uses rand() not vstlib Random*() functions! - // Get a random vector. - Vector random; - random.x = RandomFloat( minVal, maxVal ); - random.y = RandomFloat( minVal, maxVal ); - random.z = RandomFloat( minVal, maxVal ); - return QAngle( random.x, random.y, random.z ); -} - - -//----------------------------------------------------------------------------- -// -// Shared client/server trace filter code -// -//----------------------------------------------------------------------------- -bool PassServerEntityFilter( const IHandleEntity *pTouch, const IHandleEntity *pPass ) -{ - if ( !pPass ) - return true; - - if ( pTouch == pPass ) - return false; - - const CBaseEntity *pEntTouch = EntityFromEntityHandle( pTouch ); - const CBaseEntity *pEntPass = EntityFromEntityHandle( pPass ); - if ( !pEntTouch || !pEntPass ) - return true; - - // don't clip against own missiles - if ( pEntTouch->GetOwnerEntity() == pEntPass ) - return false; - - // don't clip against owner - if ( pEntPass->GetOwnerEntity() == pEntTouch ) - return false; - - - return true; -} - - -//----------------------------------------------------------------------------- -// A standard filter to be applied to just about everything. -//----------------------------------------------------------------------------- -bool StandardFilterRules( IHandleEntity *pHandleEntity, int fContentsMask ) -{ - CBaseEntity *pCollide = EntityFromEntityHandle( pHandleEntity ); - - // Static prop case... - if ( !pCollide ) - return true; - - SolidType_t solid = pCollide->GetSolid(); - const model_t *pModel = pCollide->GetModel(); - - if ( ( modelinfo->GetModelType( pModel ) != mod_brush ) || (solid != SOLID_BSP && solid != SOLID_VPHYSICS) ) - { - if ( (fContentsMask & CONTENTS_MONSTER) == 0 ) - return false; - } - - // This code is used to cull out tests against see-thru entities - if ( !(fContentsMask & CONTENTS_WINDOW) && pCollide->IsTransparent() ) - return false; - - // FIXME: this is to skip BSP models that are entities that can be - // potentially moved/deleted, similar to a monster but doors don't seem to - // be flagged as monsters - // FIXME: the FL_WORLDBRUSH looked promising, but it needs to be set on - // everything that's actually a worldbrush and it currently isn't - if ( !(fContentsMask & CONTENTS_MOVEABLE) && (pCollide->GetMoveType() == MOVETYPE_PUSH))// !(touch->flags & FL_WORLDBRUSH) ) - return false; - - return true; -} - - - -//----------------------------------------------------------------------------- -// Simple trace filter -//----------------------------------------------------------------------------- -CTraceFilterSimple::CTraceFilterSimple( const IHandleEntity *passedict, int collisionGroup ) -{ - m_pPassEnt = passedict; - m_collisionGroup = collisionGroup; -} - - -//----------------------------------------------------------------------------- -// The trace filter! -//----------------------------------------------------------------------------- -bool CTraceFilterSimple::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - if ( !StandardFilterRules( pHandleEntity, contentsMask ) ) - return false; - - if ( m_pPassEnt ) - { - if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt ) ) - { - return false; - } - } - - // Don't test if the game code tells us we should ignore this collision... - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity ) - return false; - if ( !pEntity->ShouldCollide( m_collisionGroup, contentsMask ) ) - return false; - if ( pEntity && !g_pGameRules->ShouldCollide( m_collisionGroup, pEntity->GetCollisionGroup() ) ) - return false; - - return true; -} - -//----------------------------------------------------------------------------- -// Purpose: Trace filter that only hits NPCs and the player -//----------------------------------------------------------------------------- -bool CTraceFilterOnlyNPCsAndPlayer::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - if ( CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ) ) - { - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity ) - return false; - -#ifdef CSTRIKE_DLL -#ifndef CLIENT_DLL - if ( pEntity->Classify() == CLASS_PLAYER_ALLY ) - return true; // CS hostages are CLASS_PLAYER_ALLY but not IsNPC() -#endif // !CLIENT_DLL -#endif // CSTRIKE_DLL - return (pEntity->IsNPC() || pEntity->IsPlayer()); - } - return false; -} - -//----------------------------------------------------------------------------- -// Purpose: Trace filter that only hits anything but NPCs and the player -//----------------------------------------------------------------------------- -bool CTraceFilterNoNPCsOrPlayer::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - if ( CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ) ) - { - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity ) - return false; -#ifndef CLIENT_DLL - if ( pEntity->Classify() == CLASS_PLAYER_ALLY ) - return false; // CS hostages are CLASS_PLAYER_ALLY but not IsNPC() -#endif - return (!pEntity->IsNPC() && !pEntity->IsPlayer()); - } - return false; -} - -//----------------------------------------------------------------------------- -// Trace filter that skips two entities -//----------------------------------------------------------------------------- -CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities( const IHandleEntity *passentity, const IHandleEntity *passentity2, int collisionGroup ) : - BaseClass( passentity, collisionGroup ), m_pPassEnt2(passentity2) -{ -} - -bool CTraceFilterSkipTwoEntities::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - Assert( pHandleEntity ); - if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt2 ) ) - return false; - - return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); -} - - -//----------------------------------------------------------------------------- -// Trace filter that can take a list of entities to ignore -//----------------------------------------------------------------------------- -CTraceFilterSimpleList::CTraceFilterSimpleList( int collisionGroup ) : - CTraceFilterSimple( NULL, collisionGroup ) -{ -} - - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -bool CTraceFilterSimpleList::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - if ( m_PassEntities.Find(pHandleEntity) != m_PassEntities.InvalidIndex() ) - return false; - - return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); -} - - -//----------------------------------------------------------------------------- -// Purpose: Add an entity to my list of entities to ignore in the trace -//----------------------------------------------------------------------------- -void CTraceFilterSimpleList::AddEntityToIgnore( IHandleEntity *pEntity ) -{ - m_PassEntities.AddToTail( pEntity ); -} - - -//----------------------------------------------------------------------------- -// Purpose: Custom trace filter used for NPC LOS traces -//----------------------------------------------------------------------------- -CTraceFilterLOS::CTraceFilterLOS( IHandleEntity *pHandleEntity, int collisionGroup, IHandleEntity *pHandleEntity2 ) : - CTraceFilterSkipTwoEntities( pHandleEntity, pHandleEntity2, collisionGroup ) -{ -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -bool CTraceFilterLOS::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - - if ( !pEntity->BlocksLOS() ) - return false; - - return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); -} - -//----------------------------------------------------------------------------- -// Trace filter that can take a classname to ignore -//----------------------------------------------------------------------------- -CTraceFilterSkipClassname::CTraceFilterSkipClassname( const IHandleEntity *passentity, const char *pchClassname, int collisionGroup ) : -CTraceFilterSimple( passentity, collisionGroup ), m_pchClassname( pchClassname ) -{ -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -bool CTraceFilterSkipClassname::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity || FClassnameIs( pEntity, m_pchClassname ) ) - return false; - - return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); -} - -//----------------------------------------------------------------------------- -// Trace filter that skips two classnames -//----------------------------------------------------------------------------- -CTraceFilterSkipTwoClassnames::CTraceFilterSkipTwoClassnames( const IHandleEntity *passentity, const char *pchClassname, const char *pchClassname2, int collisionGroup ) : -BaseClass( passentity, pchClassname, collisionGroup ), m_pchClassname2(pchClassname2) -{ -} - -bool CTraceFilterSkipTwoClassnames::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity || FClassnameIs( pEntity, m_pchClassname2 ) ) - return false; - - return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); -} - -//----------------------------------------------------------------------------- -// Trace filter that can take a list of entities to ignore -//----------------------------------------------------------------------------- -CTraceFilterSimpleClassnameList::CTraceFilterSimpleClassnameList( const IHandleEntity *passentity, int collisionGroup ) : -CTraceFilterSimple( passentity, collisionGroup ) -{ -} - - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -bool CTraceFilterSimpleClassnameList::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity ) - return false; - - for ( int i = 0; i < m_PassClassnames.Count(); ++i ) - { - if ( FClassnameIs( pEntity, m_PassClassnames[ i ] ) ) - return false; - } - - return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); -} - - -//----------------------------------------------------------------------------- -// Purpose: Add an entity to my list of entities to ignore in the trace -//----------------------------------------------------------------------------- -void CTraceFilterSimpleClassnameList::AddClassnameToIgnore( const char *pchClassname ) -{ - m_PassClassnames.AddToTail( pchClassname ); -} - -CTraceFilterChain::CTraceFilterChain( ITraceFilter *pTraceFilter1, ITraceFilter *pTraceFilter2 ) -{ - m_pTraceFilter1 = pTraceFilter1; - m_pTraceFilter2 = pTraceFilter2; -} - -bool CTraceFilterChain::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) -{ - bool bResult1 = true; - bool bResult2 = true; - - if ( m_pTraceFilter1 ) - bResult1 = m_pTraceFilter1->ShouldHitEntity( pHandleEntity, contentsMask ); - - - if ( m_pTraceFilter2 ) - bResult2 = m_pTraceFilter2->ShouldHitEntity( pHandleEntity, contentsMask ); - - return ( bResult1 && bResult2 ); -} - -//----------------------------------------------------------------------------- -// Sweeps against a particular model, using collision rules -//----------------------------------------------------------------------------- -void UTIL_TraceModel( const Vector &vecStart, const Vector &vecEnd, const Vector &hullMin, - const Vector &hullMax, CBaseEntity *pentModel, int collisionGroup, trace_t *ptr ) -{ - // Cull it.... - if ( pentModel && pentModel->ShouldCollide( collisionGroup, MASK_ALL ) ) - { - Ray_t ray; - ray.Init( vecStart, vecEnd, hullMin, hullMax ); - enginetrace->ClipRayToEntity( ray, MASK_ALL, pentModel, ptr ); - } - else - { - memset( ptr, 0, sizeof(trace_t) ); - ptr->fraction = 1.0f; - } -} - -bool UTIL_EntityHasMatchingRootParent( CBaseEntity *pRootParent, CBaseEntity *pEntity ) -{ - if ( pRootParent ) - { - // NOTE: Don't let siblings/parents collide. - if ( pRootParent == pEntity->GetRootMoveParent() ) - return true; - if ( pEntity->GetOwnerEntity() && pRootParent == pEntity->GetOwnerEntity()->GetRootMoveParent() ) - return true; - } - return false; -} - -//----------------------------------------------------------------------------- -// Sweep an entity from the starting to the ending position -//----------------------------------------------------------------------------- -class CTraceFilterEntity : public CTraceFilterSimple -{ - DECLARE_CLASS( CTraceFilterEntity, CTraceFilterSimple ); - -public: - CTraceFilterEntity( CBaseEntity *pEntity, int nCollisionGroup ) - : CTraceFilterSimple( pEntity, nCollisionGroup ) - { - m_pRootParent = pEntity->GetRootMoveParent(); - m_pEntity = pEntity; - m_checkHash = g_EntityCollisionHash->IsObjectInHash(pEntity); - } - - bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) - { - CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); - if ( !pEntity ) - return false; - - // Check parents against each other - // NOTE: Don't let siblings/parents collide. - if ( UTIL_EntityHasMatchingRootParent( m_pRootParent, pEntity ) ) - return false; - - if ( m_checkHash ) - { - if ( g_EntityCollisionHash->IsObjectPairInHash( m_pEntity, pEntity ) ) - return false; - } - -#ifndef CLIENT_DLL - if ( m_pEntity->IsNPC() ) - { - if ( NPC_CheckBrushExclude( m_pEntity, pEntity ) ) - return false; - - } -#endif - - return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); - } - -private: - - CBaseEntity *m_pRootParent; - CBaseEntity *m_pEntity; - bool m_checkHash; -}; - -class CTraceFilterEntityIgnoreOther : public CTraceFilterEntity -{ - DECLARE_CLASS( CTraceFilterEntityIgnoreOther, CTraceFilterEntity ); -public: - CTraceFilterEntityIgnoreOther( CBaseEntity *pEntity, const IHandleEntity *pIgnore, int nCollisionGroup ) : - CTraceFilterEntity( pEntity, nCollisionGroup ), m_pIgnoreOther( pIgnore ) - { - } - - bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) - { - if ( pHandleEntity == m_pIgnoreOther ) - return false; - - return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); - } - -private: - const IHandleEntity *m_pIgnoreOther; -}; - -//----------------------------------------------------------------------------- -// Sweeps a particular entity through the world -//----------------------------------------------------------------------------- -void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, unsigned int mask, trace_t *ptr ) -{ - ICollideable *pCollision = pEntity->GetCollideable(); - - // Adding this assertion here so game code catches it, but really the assertion belongs in the engine - // because one day, rotated collideables will work! - Assert( pCollision->GetCollisionAngles() == vec3_angle ); - - CTraceFilterEntity traceFilter( pEntity, pCollision->GetCollisionGroup() ); - -#ifdef PORTAL - UTIL_Portal_TraceEntity( pEntity, vecAbsStart, vecAbsEnd, mask, &traceFilter, ptr ); -#else - enginetrace->SweepCollideable( pCollision, vecAbsStart, vecAbsEnd, pCollision->GetCollisionAngles(), mask, &traceFilter, ptr ); -#endif -} - -void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, - unsigned int mask, const IHandleEntity *pIgnore, int nCollisionGroup, trace_t *ptr ) -{ - ICollideable *pCollision; - pCollision = pEntity->GetCollideable(); - - // Adding this assertion here so game code catches it, but really the assertion belongs in the engine - // because one day, rotated collideables will work! - Assert( pCollision->GetCollisionAngles() == vec3_angle ); - - CTraceFilterEntityIgnoreOther traceFilter( pEntity, pIgnore, nCollisionGroup ); - -#ifdef PORTAL - UTIL_Portal_TraceEntity( pEntity, vecAbsStart, vecAbsEnd, mask, &traceFilter, ptr ); -#else - enginetrace->SweepCollideable( pCollision, vecAbsStart, vecAbsEnd, pCollision->GetCollisionAngles(), mask, &traceFilter, ptr ); -#endif -} - -void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, - unsigned int mask, ITraceFilter *pFilter, trace_t *ptr ) -{ - ICollideable *pCollision; - pCollision = pEntity->GetCollideable(); - - // Adding this assertion here so game code catches it, but really the assertion belongs in the engine - // because one day, rotated collideables will work! - Assert( pCollision->GetCollisionAngles() == vec3_angle ); - -#ifdef PORTAL - UTIL_Portal_TraceEntity( pEntity, vecAbsStart, vecAbsEnd, mask, pFilter, ptr ); -#else - enginetrace->SweepCollideable( pCollision, vecAbsStart, vecAbsEnd, pCollision->GetCollisionAngles(), mask, pFilter, ptr ); -#endif -} - -// ---- -// This is basically a regular TraceLine that uses the FilterEntity filter. -void UTIL_TraceLineFilterEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, - unsigned int mask, int nCollisionGroup, trace_t *ptr ) -{ - CTraceFilterEntity traceFilter( pEntity, nCollisionGroup ); - UTIL_TraceLine( vecAbsStart, vecAbsEnd, mask, &traceFilter, ptr ); -} - -void UTIL_ClipTraceToPlayers( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, ITraceFilter *filter, trace_t *tr ) -{ - trace_t playerTrace; - Ray_t ray; - float smallestFraction = tr->fraction; - const float maxRange = 60.0f; - - ray.Init( vecAbsStart, vecAbsEnd ); - - for ( int k = 1; k <= gpGlobals->maxClients; ++k ) - { - CBasePlayer *player = UTIL_PlayerByIndex( k ); - - if ( !player || !player->IsAlive() ) - continue; - -#ifdef CLIENT_DLL - if ( player->IsDormant() ) - continue; -#endif // CLIENT_DLL - - if ( filter && filter->ShouldHitEntity( player, mask ) == false ) - continue; - - float range = DistanceToRay( player->WorldSpaceCenter(), vecAbsStart, vecAbsEnd ); - if ( range < 0.0f || range > maxRange ) - continue; - - enginetrace->ClipRayToEntity( ray, mask|CONTENTS_HITBOX, player, &playerTrace ); - if ( playerTrace.fraction < smallestFraction ) - { - // we shortened the ray - save off the trace - *tr = playerTrace; - smallestFraction = playerTrace.fraction; - } - } -} - -//----------------------------------------------------------------------------- -// Purpose: Make a tracer using a particle effect -//----------------------------------------------------------------------------- -void UTIL_ParticleTracer( const char *pszTracerEffectName, const Vector &vecStart, const Vector &vecEnd, - int iEntIndex, int iAttachment, bool bWhiz ) -{ - int iParticleIndex = GetParticleSystemIndex( pszTracerEffectName ); - UTIL_Tracer( vecStart, vecEnd, iEntIndex, iAttachment, 0, bWhiz, "ParticleTracer", iParticleIndex ); -} - -//----------------------------------------------------------------------------- -// Purpose: Make a tracer effect using the old, non-particle system, tracer effects. -//----------------------------------------------------------------------------- -void UTIL_Tracer( const Vector &vecStart, const Vector &vecEnd, int iEntIndex, - int iAttachment, float flVelocity, bool bWhiz, const char *pCustomTracerName, int iParticleID ) -{ - CEffectData data; - data.m_vStart = vecStart; - data.m_vOrigin = vecEnd; -#ifdef CLIENT_DLL - data.m_hEntity = ClientEntityList().EntIndexToHandle( iEntIndex ); -#else - data.m_nEntIndex = iEntIndex; -#endif - data.m_flScale = flVelocity; - data.m_nHitBox = iParticleID; - - // Flags - if ( bWhiz ) - { - data.m_fFlags |= TRACER_FLAG_WHIZ; - } - - if ( iAttachment != TRACER_DONT_USE_ATTACHMENT ) - { - data.m_fFlags |= TRACER_FLAG_USEATTACHMENT; - data.m_nAttachmentIndex = iAttachment; - } - - // Fire it off - if ( pCustomTracerName ) - { - DispatchEffect( pCustomTracerName, data ); - } - else - { - DispatchEffect( "Tracer", data ); - } -} - - -void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, int amount ) -{ - if ( !UTIL_ShouldShowBlood( color ) ) - return; - - if ( color == DONT_BLEED || amount == 0 ) - return; - - if ( g_Language.GetInt() == LANGUAGE_GERMAN && color == BLOOD_COLOR_RED ) - color = 0; - - if ( g_pGameRules->IsMultiplayer() ) - { - // scale up blood effect in multiplayer for better visibility - amount *= 5; - } - - if ( amount > 255 ) - amount = 255; - - if (color == BLOOD_COLOR_MECH) - { - g_pEffects->Sparks(origin); - if (random->RandomFloat(0, 2) >= 1) - { - UTIL_Smoke(origin, random->RandomInt(10, 15), 10); - } - } - else - { - // Normal blood impact - UTIL_BloodImpact( origin, direction, color, amount ); - } -} - -//----------------------------------------------------------------------------- -// Purpose: Returns low violence settings -//----------------------------------------------------------------------------- -static ConVar violence_hblood( "violence_hblood","1", 0, "Draw human blood" ); -static ConVar violence_hgibs( "violence_hgibs","1", 0, "Show human gib entities" ); -static ConVar violence_ablood( "violence_ablood","1", 0, "Draw alien blood" ); -static ConVar violence_agibs( "violence_agibs","1", 0, "Show alien gib entities" ); - -bool UTIL_IsLowViolence( void ) -{ - // These convars are no longer necessary -- the engine is the final arbiter of - // violence settings -- but they're here for legacy support and for testing low - // violence when the engine is in normal violence mode. - if ( !violence_hblood.GetBool() || !violence_ablood.GetBool() || !violence_hgibs.GetBool() || !violence_agibs.GetBool() ) - return true; - - return engine->IsLowViolence(); -} - -bool UTIL_ShouldShowBlood( int color ) -{ - if ( color != DONT_BLEED ) - { - if ( color == BLOOD_COLOR_RED ) - { - return violence_hblood.GetBool(); - } - else - { - return violence_ablood.GetBool(); - } - } - return false; -} - - -//------------------------------------------------------------------------------ -// Purpose : Use trace to pass a specific decal type to the entity being decaled -// Input : -// Output : -//------------------------------------------------------------------------------ -void UTIL_DecalTrace( trace_t *pTrace, char const *decalName ) -{ - if (pTrace->fraction == 1.0) - return; - - CBaseEntity *pEntity = pTrace->m_pEnt; - pEntity->DecalTrace( pTrace, decalName ); -} - - -void UTIL_BloodDecalTrace( trace_t *pTrace, int bloodColor ) -{ - if ( UTIL_ShouldShowBlood( bloodColor ) ) - { - if ( bloodColor == BLOOD_COLOR_RED ) - { - UTIL_DecalTrace( pTrace, "Blood" ); - } - else - { - UTIL_DecalTrace( pTrace, "YellowBlood" ); - } - } -} - -//----------------------------------------------------------------------------- -// Purpose: -// Input : &pos - -// &dir - -// color - -// amount - -//----------------------------------------------------------------------------- -void UTIL_BloodImpact( const Vector &pos, const Vector &dir, int color, int amount ) -{ - CEffectData data; - - data.m_vOrigin = pos; - data.m_vNormal = dir; - data.m_flScale = (float)amount; - data.m_nColor = (unsigned char)color; - - DispatchEffect( "bloodimpact", data ); -} - -bool UTIL_IsSpaceEmpty( CBaseEntity *pMainEnt, const Vector &vMin, const Vector &vMax ) -{ - Vector vHalfDims = ( vMax - vMin ) * 0.5f; - Vector vCenter = vMin + vHalfDims; - - trace_t trace; - - UTIL_TraceHull( vCenter, vCenter, -vHalfDims, vHalfDims, MASK_SOLID, pMainEnt, COLLISION_GROUP_NONE, &trace ); - - bool bClear = ( trace.fraction == 1 && trace.allsolid != 1 && (trace.startsolid != 1) ); - return bClear; -} - -void UTIL_StringToFloatArray( float *pVector, int count, const char *pString ) -{ - char *pstr, *pfront, tempString[128]; - int j; - - Q_strncpy( tempString, pString, sizeof(tempString) ); - pstr = pfront = tempString; - - for ( j = 0; j < count; j++ ) // lifted from pr_edict.c - { - pVector[j] = atof( pfront ); - - // skip any leading whitespace - while ( *pstr && *pstr <= ' ' ) - pstr++; - - // skip to next whitespace - while ( *pstr && *pstr > ' ' ) - pstr++; - - if (!*pstr) - break; - - pstr++; - pfront = pstr; - } - for ( j++; j < count; j++ ) - { - pVector[j] = 0; - } -} - -void UTIL_StringToVector( float *pVector, const char *pString ) -{ - UTIL_StringToFloatArray( pVector, 3, pString ); -} - -void UTIL_StringToIntArray( int *pVector, int count, const char *pString ) -{ - char *pstr, *pfront, tempString[128]; - int j; - - Q_strncpy( tempString, pString, sizeof(tempString) ); - pstr = pfront = tempString; - - for ( j = 0; j < count; j++ ) // lifted from pr_edict.c - { - pVector[j] = atoi( pfront ); - - while ( *pstr && *pstr != ' ' ) - pstr++; - if (!*pstr) - break; - pstr++; - pfront = pstr; - } - - for ( j++; j < count; j++ ) - { - pVector[j] = 0; - } -} - -void UTIL_StringToColor32( color32 *color, const char *pString ) -{ - int tmp[4]; - UTIL_StringToIntArray( tmp, 4, pString ); - color->r = tmp[0]; - color->g = tmp[1]; - color->b = tmp[2]; - color->a = tmp[3]; -} - -#ifndef _XBOX -void UTIL_DecodeICE( unsigned char * buffer, int size, const unsigned char *key) -{ - if ( !key ) - return; - - IceKey ice( 0 ); // level 0 = 64bit key - ice.set( key ); // set key - - int blockSize = ice.blockSize(); - - unsigned char *temp = (unsigned char *)_alloca( PAD_NUMBER( size, blockSize ) ); - unsigned char *p1 = buffer; - unsigned char *p2 = temp; - - // encrypt data in 8 byte blocks - int bytesLeft = size; - while ( bytesLeft >= blockSize ) - { - ice.decrypt( p1, p2 ); - bytesLeft -= blockSize; - p1+=blockSize; - p2+=blockSize; - } - - // copy encrypted data back to original buffer - Q_memcpy( buffer, temp, size-bytesLeft ); -} -#endif - -// work-around since client header doesn't like inlined gpGlobals->curtime -float IntervalTimer::Now( void ) const -{ - return gpGlobals->curtime; -} - -// work-around since client header doesn't like inlined gpGlobals->curtime -float CountdownTimer::Now( void ) const -{ - return gpGlobals->curtime; -} - - -#ifdef CLIENT_DLL - CBasePlayer *UTIL_PlayerByIndex( int entindex ) - { - return ToBasePlayer( ClientEntityList().GetEnt( entindex ) ); - } -#endif - - -unsigned short UTIL_GetAchievementEventMask( void ) -{ - CRC32_t mapCRC; - CRC32_Init( &mapCRC ); - - char lowercase[ 256 ]; -#ifdef CLIENT_DLL - Q_FileBase( engine->GetLevelName(), lowercase, sizeof( lowercase ) ); -#else - Q_strncpy( lowercase, STRING( gpGlobals->mapname ), sizeof( lowercase ) ); -#endif - Q_strlower( lowercase ); - - CRC32_ProcessBuffer( &mapCRC, lowercase, Q_strlen( lowercase ) ); - CRC32_Final( &mapCRC ); - - return ( mapCRC & 0xFFFF ); -} - -const char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename ) -{ - const char *pValue = pSub->GetString( pName, NULL ); - if ( !pValue ) - { - if ( pFilename ) - { - DevWarning( "Can't get key value '%s' from file '%s'.\n", pName, pFilename ); - } - return ""; - } - - int len = Q_strlen( pValue ) + 1; - char *pAlloced = new char[ len ]; - Assert( pAlloced ); - Q_strncpy( pAlloced, pValue, len ); - return pAlloced; -} - -int UTIL_StringFieldToInt( const char *szValue, const char **pValueStrings, int iNumStrings ) -{ - if ( !szValue || !szValue[0] ) - return -1; - - for ( int i = 0; i < iNumStrings; i++ ) - { - if ( FStrEq(szValue, pValueStrings[i]) ) - return i; - } - - Assert(0); - return -1; -} +//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +// +// Purpose: +// +//===========================================================================// + +#include "cbase.h" +#include "mathlib/mathlib.h" +#include "util_shared.h" +#include "model_types.h" +#include "convar.h" +#include "IEffects.h" +#include "vphysics/object_hash.h" +#include "mathlib/IceKey.H" +#include "checksum_crc.h" +#include "particle_parse.h" +#include "KeyValues.h" +#include "icommandline.h" + +#ifdef CLIENT_DLL + #include "clientleafsystem.h" + #include "c_te_effect_dispatch.h" +#else + #include "te_effect_dispatch.h" + +bool NPC_CheckBrushExclude( CBaseEntity *pEntity, CBaseEntity *pBrush ); +#endif + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +ConVar r_visualizetraces( "r_visualizetraces", "0", FCVAR_CHEAT ); +ConVar developer("developer", "0", FCVAR_RELEASE, "Set developer message level" ); // developer mode + +#ifdef DETECT_TRACE_SPIKES +float g_TraceSpikeTolerance = 0.25; +ConVar trace_spike_tolerance( "trace_spike_tolerance", "0.25" ); + +void DoReportExpensiveTrace( bool repeat, float time ) +{ + if ( g_TraceSpikeTolerance > 0.0f ) + { + Msg( "%s%f!\n", ( repeat ) ? " R: " : "", time ); + } + g_TraceSpikeTolerance = trace_spike_tolerance.GetFloat(); +} +#endif + +float UTIL_VecToYaw( const Vector &vec ) +{ + if (vec.y == 0 && vec.x == 0) + return 0; + + float yaw = atan2( vec.y, vec.x ); + + yaw = RAD2DEG(yaw); + + if (yaw < 0) + yaw += 360; + + return yaw; +} + +float UTIL_VecToPitch( const Vector &vec ) +{ + float pitch = 0; + Vector tmp = vec; + if ( VectorNormalize( tmp ) > 0 ) + { + pitch = RAD2DEG( asin( -tmp.z ) ); + } + return pitch; +} + +float UTIL_VecToYaw( const matrix3x4_t &matrix, const Vector &vec ) +{ + Vector tmp = vec; + VectorNormalize( tmp ); + + float x = matrix[0][0] * tmp.x + matrix[1][0] * tmp.y + matrix[2][0] * tmp.z; + float y = matrix[0][1] * tmp.x + matrix[1][1] * tmp.y + matrix[2][1] * tmp.z; + + if (x == 0.0f && y == 0.0f) + return 0.0f; + + float yaw = atan2( -y, x ); + + yaw = RAD2DEG(yaw); + + if (yaw < 0) + yaw += 360; + + return yaw; +} + +float UTIL_VecToPitch( const matrix3x4_t &matrix, const Vector &vec ) +{ + float pitch = 0; + Vector tmp = vec; + if ( VectorNormalize( tmp ) > 0 ) + { + float z = matrix[0][2] * tmp.x + matrix[1][2] * tmp.y + matrix[2][2] * tmp.z; + pitch = RAD2DEG( asin( -z ) ); + if (pitch < 0) + pitch += 360; + } + return pitch; +} + +Vector UTIL_YawToVector( float yaw ) +{ + Vector ret; + + ret.z = 0; + float angle = DEG2RAD( yaw ); + SinCos( angle, &ret.y, &ret.x ); + + return ret; +} + +//----------------------------------------------------------------------------- +// Purpose: Helper function get get determinisitc random values for shared/prediction code +// Input : seedvalue - +// *module - +// line - +// Output : static int +//----------------------------------------------------------------------------- +static int SeedFileLineHash( int seedvalue, const char *sharedname, int additionalSeed ) +{ + CRC32_t retval; + + CRC32_Init( &retval ); + + CRC32_ProcessBuffer( &retval, (void *)&seedvalue, sizeof( int ) ); + CRC32_ProcessBuffer( &retval, (void *)&additionalSeed, sizeof( int ) ); + CRC32_ProcessBuffer( &retval, (void *)sharedname, Q_strlen( sharedname ) ); + + CRC32_Final( &retval ); + + return (int)( retval ); +} + +float SharedRandomFloat( const char *sharedname, float flMinVal, float flMaxVal, int additionalSeed /*=0*/ ) +{ + Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); + + int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); + RandomSeed( seed ); + return RandomFloat( flMinVal, flMaxVal ); +} + +int SharedRandomInt( const char *sharedname, int iMinVal, int iMaxVal, int additionalSeed /*=0*/ ) +{ + Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); + + int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); + RandomSeed( seed ); + return RandomInt( iMinVal, iMaxVal ); +} + +Vector SharedRandomVector( const char *sharedname, float minVal, float maxVal, int additionalSeed /*=0*/ ) +{ + Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); + + int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); + RandomSeed( seed ); + // HACK: Can't call RandomVector/Angle because it uses rand() not vstlib Random*() functions! + // Get a random vector. + Vector random; + random.x = RandomFloat( minVal, maxVal ); + random.y = RandomFloat( minVal, maxVal ); + random.z = RandomFloat( minVal, maxVal ); + return random; +} + +QAngle SharedRandomAngle( const char *sharedname, float minVal, float maxVal, int additionalSeed /*=0*/ ) +{ + Assert( CBaseEntity::GetPredictionRandomSeed() != -1 ); + + int seed = SeedFileLineHash( CBaseEntity::GetPredictionRandomSeed(), sharedname, additionalSeed ); + RandomSeed( seed ); + + // HACK: Can't call RandomVector/Angle because it uses rand() not vstlib Random*() functions! + // Get a random vector. + Vector random; + random.x = RandomFloat( minVal, maxVal ); + random.y = RandomFloat( minVal, maxVal ); + random.z = RandomFloat( minVal, maxVal ); + return QAngle( random.x, random.y, random.z ); +} + + +//----------------------------------------------------------------------------- +// +// Shared client/server trace filter code +// +//----------------------------------------------------------------------------- +bool PassServerEntityFilter( const IHandleEntity *pTouch, const IHandleEntity *pPass ) +{ + if ( !pPass ) + return true; + + if ( pTouch == pPass ) + return false; + + const CBaseEntity *pEntTouch = EntityFromEntityHandle( pTouch ); + const CBaseEntity *pEntPass = EntityFromEntityHandle( pPass ); + if ( !pEntTouch || !pEntPass ) + return true; + + // don't clip against own missiles + if ( pEntTouch->GetOwnerEntity() == pEntPass ) + return false; + + // don't clip against owner + if ( pEntPass->GetOwnerEntity() == pEntTouch ) + return false; + + + return true; +} + + +//----------------------------------------------------------------------------- +// A standard filter to be applied to just about everything. +//----------------------------------------------------------------------------- +bool StandardFilterRules( IHandleEntity *pHandleEntity, int fContentsMask ) +{ + CBaseEntity *pCollide = EntityFromEntityHandle( pHandleEntity ); + + // Static prop case... + if ( !pCollide ) + return true; + + SolidType_t solid = pCollide->GetSolid(); + const model_t *pModel = pCollide->GetModel(); + + if ( ( modelinfo->GetModelType( pModel ) != mod_brush ) || (solid != SOLID_BSP && solid != SOLID_VPHYSICS) ) + { + if ( (fContentsMask & CONTENTS_MONSTER) == 0 ) + return false; + } + + // This code is used to cull out tests against see-thru entities + if ( !(fContentsMask & CONTENTS_WINDOW) ) + { +#ifdef CLIENT_DLL + if ( g_pClientLeafSystem->GetTranslucencyType( pCollide->RenderHandle() ) == RENDERABLE_IS_TRANSLUCENT ) + return false; +#else + bool bIsTranslucent = modelinfo->IsTranslucent( pModel ); + bool bIsTwoPass = modelinfo->IsTranslucentTwoPass( pModel ); + if ( bIsTranslucent && !bIsTwoPass ) + return false; +#endif + } + + // FIXME: this is to skip BSP models that are entities that can be + // potentially moved/deleted, similar to a monster but doors don't seem to + // be flagged as monsters + // FIXME: the FL_WORLDBRUSH looked promising, but it needs to be set on + // everything that's actually a worldbrush and it currently isn't + if ( !(fContentsMask & CONTENTS_MOVEABLE) && (pCollide->GetMoveType() == MOVETYPE_PUSH))// !(touch->flags & FL_WORLDBRUSH) ) + return false; + + return true; +} + + + +//----------------------------------------------------------------------------- +// Simple trace filter +//----------------------------------------------------------------------------- +CTraceFilterSimple::CTraceFilterSimple( const IHandleEntity *passedict, int collisionGroup, + ShouldHitFunc_t pExtraShouldHitFunc ) +{ + m_pPassEnt = passedict; + m_collisionGroup = collisionGroup; + m_pExtraShouldHitCheckFunction = pExtraShouldHitFunc; +} + + +//----------------------------------------------------------------------------- +// The trace filter! +//----------------------------------------------------------------------------- +bool CTraceFilterSimple::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + if ( !StandardFilterRules( pHandleEntity, contentsMask ) ) + return false; + + if ( m_pPassEnt ) + { + if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt ) ) + { + return false; + } + } + + // Don't test if the game code tells us we should ignore this collision... + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity ) + return false; + if ( !pEntity->ShouldCollide( m_collisionGroup, contentsMask ) ) + return false; + if ( pEntity && !g_pGameRules->ShouldCollide( m_collisionGroup, pEntity->GetCollisionGroup() ) ) + return false; + if ( m_pExtraShouldHitCheckFunction && + (! ( m_pExtraShouldHitCheckFunction( pHandleEntity, contentsMask ) ) ) ) + return false; + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Trace filter that only hits NPCs and the player +//----------------------------------------------------------------------------- +bool CTraceFilterOnlyNPCsAndPlayer::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + if ( CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ) ) + { + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity ) + return false; + + + return (pEntity->IsNPC() || pEntity->IsPlayer()); + } + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Trace filter that only hits anything but NPCs and the player +//----------------------------------------------------------------------------- +bool CTraceFilterNoNPCsOrPlayer::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + if ( CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ) ) + { + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity ) + return NULL; +#ifndef CLIENT_DLL + if ( pEntity->Classify() == CLASS_PLAYER_ALLY ) + return false; // CS hostages are CLASS_PLAYER_ALLY but not IsNPC() +#endif + return (!pEntity->IsNPC() && !pEntity->IsPlayer()); + } + return false; +} + +//----------------------------------------------------------------------------- +// Trace filter that skips two entities +//----------------------------------------------------------------------------- +CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities( const IHandleEntity *passentity, const IHandleEntity *passentity2, int collisionGroup ) : + BaseClass( passentity, collisionGroup ), m_pPassEnt2(passentity2) +{ +} + +bool CTraceFilterSkipTwoEntities::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + Assert( pHandleEntity ); + if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt2 ) ) + return false; + + return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); +} + + +//----------------------------------------------------------------------------- +// Trace filter that can take a list of entities to ignore +//----------------------------------------------------------------------------- +CTraceFilterSimpleList::CTraceFilterSimpleList( int collisionGroup ) : + CTraceFilterSimple( NULL, collisionGroup ) +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CTraceFilterSimpleList::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + if ( m_PassEntities.Find(pHandleEntity) != m_PassEntities.InvalidIndex() ) + return false; + + return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Add an entity to my list of entities to ignore in the trace +//----------------------------------------------------------------------------- +void CTraceFilterSimpleList::AddEntityToIgnore( IHandleEntity *pEntity ) +{ + m_PassEntities.AddToTail( pEntity ); +} + +void CTraceFilterSimpleList::AddEntitiesToIgnore( int nCount, IHandleEntity **ppEntities ) +{ + int nIndex = m_PassEntities.AddMultipleToTail( nCount ); + memcpy( &m_PassEntities[nIndex], ppEntities, nCount * sizeof( IHandleEntity* ) ); +} + +//----------------------------------------------------------------------------- +// Trace filter that hits only the pass entity +//----------------------------------------------------------------------------- +CTraceFilterOnlyHitThis::CTraceFilterOnlyHitThis( const IHandleEntity *hitentity ) +{ + m_pHitEnt = hitentity; +} + +bool CTraceFilterOnlyHitThis::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + return m_pHitEnt == pHandleEntity; +} + + +//----------------------------------------------------------------------------- +// Purpose: Custom trace filter used for NPC LOS traces +//----------------------------------------------------------------------------- +CTraceFilterLOS::CTraceFilterLOS( IHandleEntity *pHandleEntity, int collisionGroup, IHandleEntity *pHandleEntity2 ) : + CTraceFilterSkipTwoEntities( pHandleEntity, pHandleEntity2, collisionGroup ) +{ +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CTraceFilterLOS::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + + if ( !pEntity->BlocksLOS() ) + return false; + + return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); +} + +//----------------------------------------------------------------------------- +// Trace filter that can take a classname to ignore +//----------------------------------------------------------------------------- +CTraceFilterSkipClassname::CTraceFilterSkipClassname( const IHandleEntity *passentity, const char *pchClassname, int collisionGroup ) : +CTraceFilterSimple( passentity, collisionGroup ), m_pchClassname( pchClassname ) +{ +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CTraceFilterSkipClassname::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity || FClassnameIs( pEntity, m_pchClassname ) ) + return false; + + return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); +} + +//----------------------------------------------------------------------------- +// Trace filter that skips two classnames +//----------------------------------------------------------------------------- +CTraceFilterSkipTwoClassnames::CTraceFilterSkipTwoClassnames( const IHandleEntity *passentity, const char *pchClassname, const char *pchClassname2, int collisionGroup ) : +BaseClass( passentity, pchClassname, collisionGroup ), m_pchClassname2(pchClassname2) +{ +} + +bool CTraceFilterSkipTwoClassnames::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity || FClassnameIs( pEntity, m_pchClassname2 ) ) + return false; + + return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); +} + +//----------------------------------------------------------------------------- +// Trace filter that can take a list of entities to ignore +//----------------------------------------------------------------------------- +CTraceFilterSimpleClassnameList::CTraceFilterSimpleClassnameList( const IHandleEntity *passentity, int collisionGroup ) : +CTraceFilterSimple( passentity, collisionGroup ) +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CTraceFilterSimpleClassnameList::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity ) + return false; + + for ( int i = 0; i < m_PassClassnames.Count(); ++i ) + { + if ( FClassnameIs( pEntity, m_PassClassnames[ i ] ) ) + return false; + } + + return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Add an entity to my list of entities to ignore in the trace +//----------------------------------------------------------------------------- +void CTraceFilterSimpleClassnameList::AddClassnameToIgnore( const char *pchClassname ) +{ + m_PassClassnames.AddToTail( pchClassname ); +} + +CTraceFilterChain::CTraceFilterChain( ITraceFilter *pTraceFilter1, ITraceFilter *pTraceFilter2 ) +{ + m_pTraceFilter1 = pTraceFilter1; + m_pTraceFilter2 = pTraceFilter2; +} + +bool CTraceFilterChain::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) +{ + bool bResult1 = true; + bool bResult2 = true; + + if ( m_pTraceFilter1 ) + bResult1 = m_pTraceFilter1->ShouldHitEntity( pHandleEntity, contentsMask ); + + if ( m_pTraceFilter2 ) + bResult2 = m_pTraceFilter2->ShouldHitEntity( pHandleEntity, contentsMask ); + + return ( bResult1 && bResult2 ); +} + +//----------------------------------------------------------------------------- +// Sweeps against a particular model, using collision rules +//----------------------------------------------------------------------------- +void UTIL_TraceModel( const Vector &vecStart, const Vector &vecEnd, const Vector &hullMin, + const Vector &hullMax, CBaseEntity *pentModel, int collisionGroup, trace_t *ptr ) +{ + // Cull it.... + if ( pentModel && pentModel->ShouldCollide( collisionGroup, MASK_ALL ) ) + { + Ray_t ray; + ray.Init( vecStart, vecEnd, hullMin, hullMax ); + enginetrace->ClipRayToEntity( ray, MASK_ALL, pentModel, ptr ); + } + else + { + memset( ptr, 0, sizeof(trace_t) ); + ptr->fraction = 1.0f; + } +} + +bool UTIL_EntityHasMatchingRootParent( CBaseEntity *pRootParent, CBaseEntity *pEntity ) +{ + if ( pRootParent ) + { + // NOTE: Don't let siblings/parents collide. + if ( pRootParent == pEntity->GetRootMoveParent() ) + return true; + if ( pEntity->GetOwnerEntity() && pRootParent == pEntity->GetOwnerEntity()->GetRootMoveParent() ) + return true; + } + return false; +} + +//----------------------------------------------------------------------------- +// Sweep an entity from the starting to the ending position +//----------------------------------------------------------------------------- +class CTraceFilterEntity : public CTraceFilterSimple +{ + DECLARE_CLASS( CTraceFilterEntity, CTraceFilterSimple ); + +public: + CTraceFilterEntity( CBaseEntity *pEntity, int nCollisionGroup ) + : CTraceFilterSimple( pEntity, nCollisionGroup ) + { + m_pRootParent = pEntity->GetRootMoveParent(); + m_pEntity = pEntity; + m_checkHash = g_EntityCollisionHash->IsObjectInHash(pEntity); + } + + bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) + { + CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); + if ( !pEntity ) + return false; + + // Check parents against each other + // NOTE: Don't let siblings/parents collide. + if ( UTIL_EntityHasMatchingRootParent( m_pRootParent, pEntity ) ) + return false; + + if ( m_checkHash ) + { + if ( g_EntityCollisionHash->IsObjectPairInHash( m_pEntity, pEntity ) ) + return false; + } + +#ifndef CLIENT_DLL + if ( m_pEntity->IsNPC() ) + { + if ( NPC_CheckBrushExclude( m_pEntity, pEntity ) ) + return false; + + } +#endif + + return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); + } + +private: + + CBaseEntity *m_pRootParent; + CBaseEntity *m_pEntity; + bool m_checkHash; +}; + +class CTraceFilterEntityIgnoreOther : public CTraceFilterEntity +{ + DECLARE_CLASS( CTraceFilterEntityIgnoreOther, CTraceFilterEntity ); +public: + CTraceFilterEntityIgnoreOther( CBaseEntity *pEntity, const IHandleEntity *pIgnore, int nCollisionGroup ) : + CTraceFilterEntity( pEntity, nCollisionGroup ), m_pIgnoreOther( pIgnore ) + { + } + + bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) + { + if ( pHandleEntity == m_pIgnoreOther ) + return false; + + return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); + } + +private: + const IHandleEntity *m_pIgnoreOther; +}; + +//----------------------------------------------------------------------------- +// Sweeps a particular entity through the world +//----------------------------------------------------------------------------- +void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, unsigned int mask, trace_t *ptr ) +{ + ICollideable *pCollision = pEntity->GetCollideable(); + + // Adding this assertion here so game code catches it, but really the assertion belongs in the engine + // because one day, rotated collideables will work! + Assert( pCollision->GetCollisionAngles() == vec3_angle ); + + CTraceFilterEntity traceFilter( pEntity, pCollision->GetCollisionGroup() ); + + + enginetrace->SweepCollideable( pCollision, vecAbsStart, vecAbsEnd, pCollision->GetCollisionAngles(), mask, &traceFilter, ptr ); + +} + +void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, + unsigned int mask, const IHandleEntity *pIgnore, int nCollisionGroup, trace_t *ptr ) +{ + ICollideable *pCollision; + pCollision = pEntity->GetCollideable(); + + // Adding this assertion here so game code catches it, but really the assertion belongs in the engine + // because one day, rotated collideables will work! + Assert( pCollision->GetCollisionAngles() == vec3_angle ); + + CTraceFilterEntityIgnoreOther traceFilter( pEntity, pIgnore, nCollisionGroup ); + + + enginetrace->SweepCollideable( pCollision, vecAbsStart, vecAbsEnd, pCollision->GetCollisionAngles(), mask, &traceFilter, ptr ); + +} + +void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, + unsigned int mask, ITraceFilter *pFilter, trace_t *ptr ) +{ + ICollideable *pCollision; + pCollision = pEntity->GetCollideable(); + + // Adding this assertion here so game code catches it, but really the assertion belongs in the engine + // because one day, rotated collideables will work! + Assert( pCollision->GetCollisionAngles() == vec3_angle ); + + + enginetrace->SweepCollideable( pCollision, vecAbsStart, vecAbsEnd, pCollision->GetCollisionAngles(), mask, pFilter, ptr ); + +} + +// ---- +// This is basically a regular TraceLine that uses the FilterEntity filter. +void UTIL_TraceLineFilterEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, + unsigned int mask, int nCollisionGroup, trace_t *ptr ) +{ + CTraceFilterEntity traceFilter( pEntity, nCollisionGroup ); + UTIL_TraceLine( vecAbsStart, vecAbsEnd, mask, &traceFilter, ptr ); +} + +void UTIL_ClipTraceToPlayers( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, ITraceFilter *filter, trace_t *tr ) +{ + trace_t playerTrace; + Ray_t ray; + float smallestFraction = tr->fraction; + const float maxRange = 60.0f; + + ray.Init( vecAbsStart, vecAbsEnd ); + + for ( int k = 1; k <= gpGlobals->maxClients; ++k ) + { + CBasePlayer *player = UTIL_PlayerByIndex( k ); + + if ( !player || !player->IsAlive() ) + continue; + +#ifdef CLIENT_DLL + if ( player->IsDormant() ) + continue; +#endif // CLIENT_DLL + + if ( filter && filter->ShouldHitEntity( player, mask ) == false ) + continue; + + float range = DistanceToRay( player->WorldSpaceCenter(), vecAbsStart, vecAbsEnd ); + if ( range < 0.0f || range > maxRange ) + continue; + + enginetrace->ClipRayToEntity( ray, mask|CONTENTS_HITBOX, player, &playerTrace ); + if ( playerTrace.fraction < smallestFraction ) + { + // we shortened the ray - save off the trace + *tr = playerTrace; + smallestFraction = playerTrace.fraction; + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Make a tracer using a particle effect +//----------------------------------------------------------------------------- +void UTIL_ParticleTracer( const char *pszTracerEffectName, const Vector &vecStart, const Vector &vecEnd, + int iEntIndex, int iAttachment, bool bWhiz ) +{ + int iParticleIndex = GetParticleSystemIndex( pszTracerEffectName ); + UTIL_Tracer( vecStart, vecEnd, iEntIndex, iAttachment, 0, bWhiz, "ParticleTracer", iParticleIndex ); +} + +//----------------------------------------------------------------------------- +// Purpose: Make a tracer effect using the old, non-particle system, tracer effects. +//----------------------------------------------------------------------------- +void UTIL_Tracer( const Vector &vecStart, const Vector &vecEnd, int iEntIndex, + int iAttachment, float flVelocity, bool bWhiz, const char *pCustomTracerName, int iParticleID ) +{ + CEffectData data; + data.m_vStart = vecStart; + data.m_vOrigin = vecEnd; +#ifdef CLIENT_DLL + data.m_hEntity = ClientEntityList().EntIndexToHandle( iEntIndex ); +#else + data.m_nEntIndex = iEntIndex; +#endif + data.m_flScale = flVelocity; + data.m_nHitBox = iParticleID; + + // Flags + if ( bWhiz ) + { + data.m_fFlags |= TRACER_FLAG_WHIZ; + } + + if ( iAttachment != TRACER_DONT_USE_ATTACHMENT ) + { + data.m_fFlags |= TRACER_FLAG_USEATTACHMENT; + // Stomp the start, since it's not going to be used anyway + data.m_nAttachmentIndex = iAttachment; + } + + // Fire it off + if ( pCustomTracerName ) + { + DispatchEffect( pCustomTracerName, data ); + } + else + { + DispatchEffect( "Tracer", data ); + } +} + + +void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, int amount ) +{ + if ( !UTIL_ShouldShowBlood( color ) ) + return; + + if ( color == DONT_BLEED || amount == 0 ) + return; + + if ( g_Language.GetInt() == LANGUAGE_GERMAN && color == BLOOD_COLOR_RED ) + color = 0; + + if ( g_pGameRules->IsMultiplayer() ) + { + // scale up blood effect in multiplayer for better visibility + amount *= 5; + } + + if ( amount > 255 ) + amount = 255; + + if (color == BLOOD_COLOR_MECH) + { + g_pEffects->Sparks(origin); + if (random->RandomFloat(0, 2) >= 1) + { + UTIL_Smoke(origin, random->RandomInt(10, 15), 10); + } + } + else + { + // Normal blood impact + UTIL_BloodImpact( origin, direction, color, amount ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Returns low violence settings +//----------------------------------------------------------------------------- +static ConVar violence_hblood( "violence_hblood","1", 0, "Draw human blood" ); +static ConVar violence_hgibs( "violence_hgibs","1", 0, "Show human gib entities" ); +static ConVar violence_ablood( "violence_ablood","1", 0, "Draw alien blood" ); +static ConVar violence_agibs( "violence_agibs","1", 0, "Show alien gib entities" ); + +bool UTIL_IsLowViolence( void ) +{ + // These convars are no longer necessary -- the engine is the final arbiter of + // violence settings -- but they're here for legacy support and for testing low + // violence when the engine is in normal violence mode. + if ( !violence_hblood.GetBool() || !violence_ablood.GetBool() || !violence_hgibs.GetBool() || !violence_agibs.GetBool() ) + return true; + + return engine->IsLowViolence(); +} + +bool UTIL_ShouldShowBlood( int color ) +{ + if ( color != DONT_BLEED ) + { + if ( color == BLOOD_COLOR_RED ) + { + return violence_hblood.GetBool(); + } + else + { + return violence_ablood.GetBool(); + } + } + return false; +} + + +//------------------------------------------------------------------------------ +// Purpose : Use trace to pass a specific decal type to the entity being decaled +// Input : +// Output : +//------------------------------------------------------------------------------ +void UTIL_DecalTrace( trace_t *pTrace, char const *decalName ) +{ + if (pTrace->fraction == 1.0) + return; + + CBaseEntity *pEntity = pTrace->m_pEnt; + if ( !pEntity ) + return; + pEntity->DecalTrace( pTrace, decalName ); +} + + +void UTIL_BloodDecalTrace( trace_t *pTrace, int bloodColor ) +{ + if ( UTIL_ShouldShowBlood( bloodColor ) ) + { + if ( bloodColor == BLOOD_COLOR_RED ) + { + UTIL_DecalTrace( pTrace, "Blood" ); + } +#if defined( HL2_EPISODIC ) + else if ( bloodColor == BLOOD_COLOR_BLOB ) + { + UTIL_DecalTrace( pTrace, "BlobBlood" ); + } + //don't draw a any decals if the blob is frozen + else if ( bloodColor == BLOOD_COLOR_BLOB_FROZEN ) + { + return; + } +#endif + else if (bloodColor == BLOOD_COLOR_BRIGHTGREEN) + { + UTIL_DecalTrace( pTrace, "GreenBlood" ); + } + else + { + UTIL_DecalTrace( pTrace, "YellowBlood" ); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : &pos - +// &dir - +// color - +// amount - +//----------------------------------------------------------------------------- +void UTIL_BloodImpact( const Vector &pos, const Vector &dir, int color, int amount ) +{ + CEffectData data; + + data.m_vOrigin = pos; + data.m_vNormal = dir; + data.m_flScale = (float)amount; + data.m_nColor = (unsigned char)color; + + DispatchEffect( "bloodimpact", data ); +} + +bool UTIL_IsSpaceEmpty( CBaseEntity *pMainEnt, const Vector &vMin, const Vector &vMax ) +{ + Vector vHalfDims = ( vMax - vMin ) * 0.5f; + Vector vCenter = vMin + vHalfDims; + + trace_t trace; + int mask = (pMainEnt) ? pMainEnt->PhysicsSolidMaskForEntity() : MASK_SOLID; + UTIL_TraceHull( vCenter, vCenter, -vHalfDims, vHalfDims, mask, pMainEnt, COLLISION_GROUP_NONE, &trace ); + + bool bClear = ( trace.fraction == 1 && trace.allsolid != 1 && (trace.startsolid != 1) ); + return bClear; +} + +bool UTIL_IsSpaceEmpty( CBaseEntity *pMainEnt, const Vector &vMin, const Vector &vMax, unsigned int mask, ITraceFilter *pFilter ) +{ + Vector vHalfDims = ( vMax - vMin ) * 0.5f; + Vector vCenter = vMin + vHalfDims; + + trace_t trace; + UTIL_TraceHull( vCenter, vCenter, -vHalfDims, vHalfDims, mask, pFilter, &trace ); + + bool bClear = ( trace.fraction == 1 && trace.allsolid != 1 && (trace.startsolid != 1) ); + return bClear; +} + +void UTIL_StringToFloatArray( float *pVector, int count, const char *pString ) +{ + char *pstr, *pfront, tempString[128]; + int j; + + Q_strncpy( tempString, pString, sizeof(tempString) ); + pstr = pfront = tempString; + + for ( j = 0; j < count; j++ ) // lifted from pr_edict.c + { + pVector[j] = atof( pfront ); + + // skip any leading whitespace + while ( *pstr && *pstr <= ' ' ) + pstr++; + + // skip to next whitespace + while ( *pstr && *pstr > ' ' ) + pstr++; + + if (!*pstr) + break; + + pstr++; + pfront = pstr; + } + for ( j++; j < count; j++ ) + { + pVector[j] = 0; + } +} + +void UTIL_StringToVector( float *pVector, const char *pString ) +{ + UTIL_StringToFloatArray( pVector, 3, pString ); +} + +#ifndef _XBOX +void UTIL_DecodeICE( unsigned char * buffer, int size, const unsigned char *key ) +{ + if ( !key ) + return; + + IceKey ice( 0 ); // level 0 = 64bit key + ice.set( key ); // set key + + int blockSize = ice.blockSize(); + + unsigned char *temp = (unsigned char *) stackalloc( PAD_NUMBER( size, blockSize ) ); + unsigned char *p1 = buffer; + unsigned char *p2 = temp; + + // encrypt data in 8 byte blocks + int bytesLeft = size; + while ( bytesLeft >= blockSize ) + { + ice.decrypt( p1, p2 ); + bytesLeft -= blockSize; + p1+=blockSize; + p2+=blockSize; + } + + // copy encrypted data back to original buffer + Q_memcpy( buffer, temp, size-bytesLeft ); +} + +void UTIL_EncodeICE( unsigned char * buffer, unsigned int size, const unsigned char *key ) +{ + if ( !key ) + return; + + IceKey ice( 0 ); // level 0 = 64bit key + ice.set( key ); // set key + + unsigned char *cipherText = buffer; + unsigned char *plainText = buffer; + uint bytesEncrypted = 0; + + while (bytesEncrypted < size) + { + ice.encrypt( plainText, cipherText ); + bytesEncrypted += 8; + cipherText += 8; + plainText += 8; + } +} +#endif + +// work-around since client header doesn't like inlined gpGlobals->curtime +float IntervalTimer::Now( void ) const +{ + return gpGlobals->curtime; +} + +// work-around since client header doesn't like inlined gpGlobals->curtime +float CountdownTimer::Now( void ) const +{ + return gpGlobals->curtime; +} + + +BEGIN_DATADESC_NO_BASE( IntervalTimer ) +END_DATADESC() + +BEGIN_NETWORK_TABLE_NOBASE( IntervalTimer, DT_IntervalTimer ) +#ifdef CLIENT_DLL + RecvPropFloat(RECVINFO(m_timestamp)), +#else + SendPropFloat (SENDINFO(m_timestamp), 0, SPROP_NOSCALE ), +#endif +END_NETWORK_TABLE() + +#ifdef CLIENT_DLL +BEGIN_PREDICTION_DATA_NO_BASE( IntervalTimer ) + DEFINE_PRED_FIELD( m_timestamp, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ), +END_PREDICTION_DATA() +#endif + + +#ifdef CLIENT_DLL +BEGIN_RECV_TABLE_NOBASE( CountdownTimer, DT_CountdownTimer ) + RecvPropFloat(RECVINFO(m_duration)), + RecvPropFloat(RECVINFO(m_timestamp)), +END_RECV_TABLE() +BEGIN_PREDICTION_DATA_NO_BASE( CountdownTimer ) + DEFINE_PRED_FIELD( m_duration, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ), + DEFINE_PRED_FIELD( m_timestamp, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ), +END_PREDICTION_DATA() +#else +BEGIN_SEND_TABLE_NOBASE( CountdownTimer, DT_CountdownTimer ) + SendPropFloat (SENDINFO(m_duration), 0, SPROP_NOSCALE ), + SendPropFloat (SENDINFO(m_timestamp), 0, SPROP_NOSCALE ), +END_SEND_TABLE() +#endif + + +BEGIN_DATADESC( CTimeline ) + DEFINE_ARRAY( m_flValues, FIELD_FLOAT, TIMELINE_ARRAY_SIZE ), + DEFINE_ARRAY( m_nValueCounts, FIELD_FLOAT, TIMELINE_ARRAY_SIZE ), + DEFINE_FIELD( m_nBucketCount, FIELD_INTEGER ), + DEFINE_FIELD( m_flInterval, FIELD_FLOAT ), + DEFINE_FIELD( m_flFinalValue, FIELD_FLOAT ), + DEFINE_FIELD( m_nCompressionType, FIELD_INTEGER ), + DEFINE_FIELD( m_bStopped, FIELD_BOOLEAN ), +END_DATADESC() + +BEGIN_NETWORK_TABLE_NOBASE( CTimeline, DT_Timeline ) +#ifdef CLIENT_DLL + RecvPropArray3( RECVINFO_ARRAY( m_flValues ), RecvPropFloat( RECVINFO( m_flValues[0] ) ) ), + RecvPropArray3( RECVINFO_ARRAY( m_nValueCounts ), RecvPropFloat( RECVINFO( m_nValueCounts[0] ) ) ), + RecvPropInt( RECVINFO( m_nBucketCount ) ), + RecvPropFloat( RECVINFO( m_flInterval ) ), + RecvPropFloat( RECVINFO( m_flFinalValue ) ), + RecvPropInt( RECVINFO( m_nCompressionType ) ), + RecvPropBool( RECVINFO( m_bStopped ) ), +#else + SendPropArray3( SENDINFO_ARRAY3( m_flValues ), SendPropFloat( SENDINFO_ARRAY( m_flValues ), 0, SPROP_NOSCALE ) ), + SendPropArray3( SENDINFO_ARRAY3( m_nValueCounts ), SendPropFloat( SENDINFO_ARRAY( m_nValueCounts ), 0, SPROP_NOSCALE ) ), + SendPropInt( SENDINFO( m_nBucketCount ), NumBitsForCount( TIMELINE_ARRAY_SIZE ), SPROP_UNSIGNED ), + SendPropFloat( SENDINFO( m_flInterval ), 0, SPROP_NOSCALE ), + SendPropFloat( SENDINFO( m_flFinalValue ), 0, SPROP_NOSCALE ), + SendPropInt( SENDINFO( m_nCompressionType ), -1, SPROP_UNSIGNED ), + SendPropBool( SENDINFO( m_bStopped ) ), +#endif +END_NETWORK_TABLE() + +void CTimeline::ClearValues( void ) +{ + Invalidate(); + + memset( m_flValues.m_Value, 0, sizeof( m_flValues.m_Value ) ); + memset( m_nValueCounts.m_Value, 0, sizeof( m_nValueCounts.m_Value ) ); + m_nBucketCount = 0; + m_flInterval = TIMELINE_INTERVAL_START; + m_flFinalValue = 0.0f; + m_bStopped = false; +} + +void CTimeline::RecordValue( float flValue ) +{ + if ( !HasStarted() || m_bStopped ) + return; + + int iBucket = GetCurrentBucket(); + + Assert( iBucket >= 0 ); + + while ( iBucket >= TIMELINE_ARRAY_SIZE ) + { + Compress(); + iBucket = GetCurrentBucket(); + } + + if ( iBucket >= m_nBucketCount ) + { + m_nBucketCount = iBucket + 1; + } + + m_flValues.GetForModify( iBucket ) += flValue; + m_nValueCounts.GetForModify( iBucket )++; + + if ( m_nCompressionType == TIMELINE_COMPRESSION_SUM || + m_nCompressionType == TIMELINE_COMPRESSION_AVERAGE || + m_nCompressionType == TIMELINE_COMPRESSION_AVERAGE_BLEND ) + { + // Fill in blank preceding entries + float flCurrentValue = m_flValues[ iBucket ] / m_nValueCounts[ iBucket ]; + + int iPrecedingBucket = iBucket - 1; + + while ( iPrecedingBucket >= 0 && m_nValueCounts[ iPrecedingBucket ] <= 0 ) + { + iPrecedingBucket--; + } + + // Get the last logged value (or the current if this is the first) + float flPrecedingValue = flCurrentValue; + + if ( iPrecedingBucket >= 0 ) + { + // Last logged value + if ( m_nCompressionType == TIMELINE_COMPRESSION_SUM ) + { + flPrecedingValue = m_flValues[ iPrecedingBucket ]; + + if ( m_nValueCounts[ iBucket ] == 1 ) + { + // Sum in the previous bucket if this is the first value in this bucket + m_flValues.GetForModify( iBucket ) += flPrecedingValue; + } + } + else + { + flPrecedingValue = m_flFinalValue; + } + } + + // Number of buckets for blending from old to new value + float flNumBuckets = ( iBucket - iPrecedingBucket ) + 1; + + if ( flNumBuckets >= 3.0f ) + { + if ( m_nCompressionType == TIMELINE_COMPRESSION_AVERAGE_BLEND ) + { + // Blend empty values between preceding and current + float flInterpBucket = 1.0f; + + for ( int i = iPrecedingBucket + 1; i < iBucket; ++i, flInterpBucket += 1.0f ) + { + float flInterp = flInterpBucket / flNumBuckets; + m_flValues.Set( i, flPrecedingValue * ( 1.0f - flInterp ) + flCurrentValue * flInterp ); + m_nValueCounts.Set( i, 1 ); + } + } + else + { + // Set empty values to preceding value + for ( int i = iPrecedingBucket + 1; i < iBucket; ++i ) + { + m_flValues.Set( i, flPrecedingValue ); + m_nValueCounts.Set( i, 1 ); + } + } + } + } + + m_flFinalValue = flValue; +} + +float CTimeline::GetValue( int i ) const +{ + Assert( i >= 0 && i < m_nBucketCount ); + + if ( i < 0 || i >= m_nBucketCount ) + { + return 0.0f; + } + + if ( m_nValueCounts[ i ] <= 0 ) + { + return 0.0f; + } + else if ( i == 0 && m_nCompressionType == TIMELINE_COMPRESSION_SUM && m_nBucketCount > 1 ) + { + // Aways start at 0 for sums! + return 0.0; + } + else + { + switch ( m_nCompressionType ) + { + case TIMELINE_COMPRESSION_AVERAGE: + case TIMELINE_COMPRESSION_AVERAGE_BLEND: + return m_flValues[ i ] / m_nValueCounts[ i ]; + + case TIMELINE_COMPRESSION_SUM: + case TIMELINE_COMPRESSION_COUNT_PER_INTERVAL: + default: + return m_flValues[ i ]; + } + } +} + +float CTimeline::GetValueAtInterp( float fInterp ) const +{ + if ( fInterp <= 0.0f ) + { + return GetValue( 0 ); + } + + if ( fInterp >= 1.0f ) + { + if ( m_nCompressionType == TIMELINE_COMPRESSION_SUM || + m_nCompressionType == TIMELINE_COMPRESSION_COUNT_PER_INTERVAL ) + { + return GetValue( Count() - 1 ); + } + else + { + return m_flFinalValue; + } + } + + float fBucket = fInterp * ( Count() - 1 ); + int nBucket = fBucket; + fBucket -= nBucket; + + float fValue = GetValue( nBucket ); + float fNextValue = GetValue( nBucket + 1 ); + + return fValue * ( 1.0f - fBucket ) + fNextValue * fBucket; +} + +void CTimeline::Compress( void ) +{ + int i, j; + + switch ( m_nCompressionType ) + { + case TIMELINE_COMPRESSION_SUM: + for ( i = 0, j = 0; i < TIMELINE_ARRAY_SIZE; i += 2, ++j ) + { + m_flValues.GetForModify( j ) = MAX( m_flValues[ i ], m_flValues[ i + 1 ] ); + m_nValueCounts.GetForModify( j ) = m_nValueCounts[ i ] + m_nValueCounts[ i + 1 ]; + } + break; + + default: + for ( i = 0, j = 0; i < TIMELINE_ARRAY_SIZE; i += 2, ++j ) + { + m_flValues.GetForModify( j ) = m_flValues[ i ] + m_flValues[ i + 1 ]; + m_nValueCounts.GetForModify( j ) = m_nValueCounts[ i ] + m_nValueCounts[ i + 1 ]; + } + break; + } + + int nRemainingBytes = ( TIMELINE_ARRAY_SIZE - j ) * sizeof( m_flValues[0] ); + + memset( &( m_flValues.GetForModify( j ) ), 0, nRemainingBytes ); + memset( &( m_nValueCounts.GetForModify( j ) ), 0, nRemainingBytes ); + + m_flInterval *= 2.0f; + + m_nBucketCount = j; +} + + +#ifdef CLIENT_DLL + CBasePlayer *UTIL_PlayerByIndex( int entindex ) + { + // Sanity check the index being passed in + if ( entindex < 1 || entindex > gpGlobals->maxClients ) + return NULL; + + return ToBasePlayer( ClientEntityList().GetEnt( entindex ) ); + } +#endif + +unsigned short UTIL_GetAchievementEventMask( void ) +{ + CRC32_t mapCRC; + CRC32_Init( &mapCRC ); + + char lowercase[ 256 ]; +#ifdef CLIENT_DLL + Q_FileBase( engine->GetLevelName(), lowercase, sizeof( lowercase ) ); +#else + Q_strncpy( lowercase, STRING( gpGlobals->mapname ), sizeof( lowercase ) ); +#endif + Q_strlower( lowercase ); + + CRC32_ProcessBuffer( &mapCRC, lowercase, Q_strlen( lowercase ) ); + CRC32_Final( &mapCRC ); + + return ( mapCRC & 0xFFFF ); +} + +char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename ) +{ + const char *pValue = pSub->GetString( pName, NULL ); + if ( !pValue ) + { + if ( pFilename ) + { + DevWarning( "Can't get key value '%s' from file '%s'.\n", pName, pFilename ); + } + return ""; + } + + int len = Q_strlen( pValue ) + 1; + char *pAlloced = new char[ len ]; + Assert( pAlloced ); + Q_strncpy( pAlloced, pValue, len ); + return pAlloced; +} + +int UTIL_StringFieldToInt( const char *szValue, const char **pValueStrings, int iNumStrings ) +{ + if ( !szValue || !szValue[0] ) + return -1; + + for ( int i = 0; i < iNumStrings; i++ ) + { + if ( FStrEq(szValue, pValueStrings[i]) ) + return i; + } + + Assert(0); + return -1; +} + +static char s_NumBitsInNibble[ 16 ] = +{ + 0, // 0000 = 0 + 1, // 0001 = 1 + 1, // 0010 = 2 + 2, // 0011 = 3 + 1, // 0100 = 4 + 2, // 0101 = 5 + 2, // 0110 = 6 + 3, // 0111 = 7 + 1, // 1000 = 8 + 2, // 1001 = 9 + 2, // 1010 = 10 + 3, // 1011 = 11 + 2, // 1100 = 12 + 3, // 1101 = 13 + 3, // 1110 = 14 + 4, // 1111 = 15 +}; + +int UTIL_CountNumBitsSet( unsigned int nVar ) +{ + int nNumBits = 0; + + while ( nVar > 0 ) + { + // Look up and add in bits in the bottom nibble + nNumBits += s_NumBitsInNibble[ nVar & 0x0f ]; + + // Shift one nibble to the right + nVar >>= 4; + } + + return nNumBits; +} + +int UTIL_CountNumBitsSet( uint64 nVar ) +{ + int nNumBits = 0; + + while ( nVar > 0 ) + { + // Look up and add in bits in the bottom nibble + nNumBits += s_NumBitsInNibble[ nVar & 0x0f ]; + + // Shift one nibble to the right + nVar >>= 4; + } + + return nNumBits; +} + +bool UTIL_FindClosestPassableSpace( const Vector &vOriginalCenter, const Vector &vExtents, const Vector &vIndecisivePush, ITraceFilter *pTraceFilter, unsigned int fMask, unsigned int iIterations, Vector &vCenterOut, int nAxisRestrictionFlags ) +{ + Assert( vExtents != vec3_origin ); + + trace_t traces[2]; + Ray_t entRay; + entRay.m_Extents = vExtents; + entRay.m_IsRay = false; + entRay.m_IsSwept = true; + entRay.m_StartOffset = vec3_origin; + + Vector vOriginalExtents = vExtents; + Vector vCenter = vOriginalCenter; + Vector vGrowSize = vExtents * (1.0f / (float)(iIterations + 1)); + Vector vCurrentExtents = vExtents - vGrowSize; + + int iLargestExtent = 0; + { + float fLargestExtent = vOriginalExtents[0]; + for( int i = 1; i != 3; ++i ) + { + if( vOriginalExtents[i] > fLargestExtent ) + { + iLargestExtent = i; + fLargestExtent = vOriginalExtents[i]; + } + } + } + + + Ray_t testRay; + testRay.m_Extents = vGrowSize; + testRay.m_IsRay = false; + testRay.m_IsSwept = true; + testRay.m_StartOffset = vec3_origin; + + float fOriginalExtentDists[8]; //distance between extents + //generate distance lookup. We reference this by XOR'ing the indices of two extents to find the axis of difference + { + //Since the ratios of lengths never change, we're going to normalize these distances to a value so we can simply scale on each iteration + //We've picked the largest extent as the basis simply because it's nonzero + float fNormalizer = 1.0f / vOriginalExtents[iLargestExtent]; + + float fXDiff = vOriginalExtents.x * 2.0f * fNormalizer; + float fXSqr = fXDiff * fXDiff; + + float fYDiff = vOriginalExtents.y * 2.0f * fNormalizer; + float fYSqr = fYDiff * fYDiff; + + float fZDiff = vOriginalExtents.z * 2.0f * fNormalizer; + float fZSqr = fZDiff * fZDiff; + + fOriginalExtentDists[0] = 0.0f; //should never get hit + fOriginalExtentDists[1] = fXDiff; //line along x axis + fOriginalExtentDists[2] = fYDiff; //line along y axis + fOriginalExtentDists[3] = sqrt( fXSqr + fYSqr ); //diagonal perpendicular to z-axis + fOriginalExtentDists[4] = fZDiff; //line along z axis + fOriginalExtentDists[5] = sqrt( fXSqr + fZSqr ); //diagonal perpendicular to y-axis + fOriginalExtentDists[6] = sqrt( fYSqr + fZSqr ); //diagonal perpendicular to x-axis + fOriginalExtentDists[7] = sqrt( fXSqr + fYSqr + fZSqr ); //diagonal on all axes + } + + Vector ptExtents[8]; //ordering is going to be like 3 bits, where 0 is a min on the related axis, and 1 is a max on the same axis, axis order x y z + float fExtentsValidation[8]; //some points are more valid than others, and this is our measure + + vCenter.z += 0.001f; //to satisfy m_IsSwept on first pass + + unsigned int iFailCount; + for( iFailCount = 0; iFailCount != iIterations; ++iFailCount ) + { + //float fXDistribution[2] = { -vCurrentExtents.x, vCurrentExtents.x }; + //float fYDistribution[3] = { -vCurrentExtents.y, 0.0f, vCurrentExtents.y }; + //float fZDistribution[5] = { -vCurrentExtents.z, 0.0f, 0.0f, 0.0f, vCurrentExtents.z }; + + //hey look, they can overlap + float fExtentDistribution[6]; + fExtentDistribution[ 0 ] = vCenter.z + ( ( ( nAxisRestrictionFlags & FL_AXIS_DIRECTION_NZ ) == 0 ) ? ( -vCurrentExtents.z ) : ( 0.0f ) ); // Z- + fExtentDistribution[ 1 ] = vCenter.x + ( ( ( nAxisRestrictionFlags & FL_AXIS_DIRECTION_NX ) == 0 ) ? ( -vCurrentExtents.x ) : ( 0.0f ) ); // X- + fExtentDistribution[ 2 ] = vCenter.x + ( ( ( nAxisRestrictionFlags & FL_AXIS_DIRECTION_X ) == 0 ) ? ( vCurrentExtents.x ) : ( 0.0f ) ); // X+ + fExtentDistribution[ 3 ] = vCenter.y + ( ( ( nAxisRestrictionFlags & FL_AXIS_DIRECTION_NY ) == 0 ) ? ( -vCurrentExtents.y ) : ( 0.0f ) ); // Y- + fExtentDistribution[ 4 ] = vCenter.z + ( ( ( nAxisRestrictionFlags & FL_AXIS_DIRECTION_Z ) == 0 ) ? ( vCurrentExtents.z ) : ( 0.0f ) ); // Z+ + fExtentDistribution[ 5 ] = vCenter.y + ( ( ( nAxisRestrictionFlags & FL_AXIS_DIRECTION_Y ) == 0 ) ? ( vCurrentExtents.y ) : ( 0.0f ) ); // Y+ + + float *pXDistribution = &fExtentDistribution[1]; + float *pYDistribution = &fExtentDistribution[3]; + + bool bExtentInvalid[8]; + float fExtentDists[8]; + bool bAnyInvalid = false; + for( int i = 0; i != 8; ++i ) + { + ptExtents[i].x = pXDistribution[i & (1<<0)]; //fExtentDistribution[(0 or 1) + 1] + ptExtents[i].y = pYDistribution[i & (1<<1)]; //fExtentDistribution[(0 or 2) + 3] + ptExtents[i].z = fExtentDistribution[i & (1<<2)]; //fExtentDistribution[(0 or 4)] + + fExtentsValidation[i] = 0.0f; + bExtentInvalid[i] = enginetrace->PointOutsideWorld( ptExtents[i] ); + bAnyInvalid |= bExtentInvalid[i]; + fExtentDists[i] = fOriginalExtentDists[i] * vExtents[iLargestExtent]; + } + + //trace from all extents to all other extents and rate the validity + { + unsigned int counters[2]; //I know it's weird, get over it + for( counters[0] = 0; counters[0] != 7; ++counters[0] ) + { + for( counters[1] = counters[0] + 1; counters[1] != 8; ++counters[1] ) + { + for( int i = 0; i != 2; ++i ) + { + if( bExtentInvalid[counters[i]] ) + { + traces[i].startsolid = true; + traces[i].fraction = 0.0f; + } + else + { + testRay.m_Start = ptExtents[counters[i]]; + testRay.m_Delta = ptExtents[counters[1-i]] - ptExtents[counters[i]]; + enginetrace->TraceRay( testRay, fMask, pTraceFilter, &traces[i] ); + } + } + + float fDistance = fExtentDists[counters[0] ^ counters[1]]; + + for( int i = 0; i != 2; ++i ) + { + if( (traces[i].fraction == 1.0f) && (traces[1-i].fraction != 1.0f) ) + { + //One sided collision >_< + traces[i].startsolid = true; + traces[i].fraction = 0.0f; + break; + } + } + + for( int i = 0; i != 2; ++i ) + { + if( traces[i].startsolid ) + { + bExtentInvalid[counters[i]] = true; + bAnyInvalid = true; + } + else + { + fExtentsValidation[counters[i]] += traces[i].fraction * fDistance; + } + } + } + } + } + + //optimally we should do this check before tracing extents. But one sided collision is a bitch + if( !bAnyInvalid ) + { + //try to trace back to the starting position (if we start in valid, the endpoint will be closer to the original center) + entRay.m_Start = vCenter; + entRay.m_Delta = vOriginalCenter - vCenter; + + enginetrace->TraceRay( entRay, fMask, pTraceFilter, &traces[0] ); + if( traces[0].startsolid == false ) + { + //damned one sided collision + vCenterOut = traces[0].endpos; + return true; //current placement worked + } + } + + //find the direction to move based on the extent validity + { + Vector vNewOriginDirection( 0.0f, 0.0f, 0.0f ); + float fTotalValidation = 0.0f; + for( int i = 0; i != 8; ++i ) + { + if( !bExtentInvalid[i] ) + { + vNewOriginDirection += (ptExtents[i] - vCenter) * fExtentsValidation[i]; + fTotalValidation += fExtentsValidation[i]; + } + } + + if( fTotalValidation != 0.0f ) + { + vCenter += (vNewOriginDirection / fTotalValidation); + + //increase sizing + testRay.m_Extents += vGrowSize; //increase the ray size + vCurrentExtents -= vGrowSize; //while reducing the overall test region size (so outermost ray extents are the same) + } + else + { + //no point was valid, apply the indecisive vector + vCenter += vIndecisivePush; + + //reset sizing + testRay.m_Extents = vGrowSize; + vCurrentExtents = vOriginalExtents - vGrowSize; + } + } + } + + //Warning( "FindClosestPassableSpace() failure.\n" ); + + // X360TBD: Hits in portal devtest + //AssertMsg( IsX360() || iFailCount != iIterations, "FindClosestPassableSpace() failure." ); + vCenterOut = vOriginalCenter; + return false; +} + +bool UTIL_FindClosestPassableSpace( CBaseEntity *pEntity, const Vector &vIndecisivePush, unsigned int fMask, unsigned int iIterations, Vector &vOriginOut, Vector *pStartingPosition, int nAxisRestrictionFlags ) //assumes the object is already in a mostly passable space +{ + // Don't ever do this to entities with a move parent + if ( pEntity->GetMoveParent() ) + { + vOriginOut = pEntity->GetAbsOrigin(); + return false; + } + + Vector vEntityMaxs; + Vector vEntityMins; + pEntity->CollisionProp()->WorldSpaceAABB( &vEntityMins, &vEntityMaxs ); + + Vector ptEntityCenter = ((vEntityMins + vEntityMaxs) / 2.0f); + //vEntityMins -= ptEntityCenter; + vEntityMaxs -= ptEntityCenter; + + Vector vCenterToOrigin = pEntity->GetAbsOrigin() - ptEntityCenter; + if( pStartingPosition != NULL ) + { + Vector vOriginOffset = (*pStartingPosition) - pEntity->GetAbsOrigin(); + ptEntityCenter += vOriginOffset; + } + + CTraceFilterSimple traceFilter( pEntity, pEntity->GetCollisionGroup() ); + + Vector vResult; + bool bSuccess = UTIL_FindClosestPassableSpace( ptEntityCenter, vEntityMaxs, vIndecisivePush, &traceFilter, fMask, iIterations, vResult, nAxisRestrictionFlags ); + vOriginOut = vResult + vCenterToOrigin; + return bSuccess; +} + + +bool UTIL_FindClosestPassableSpace( CBaseEntity *pEntity, const Vector &vIndecisivePush, unsigned int fMask, Vector *pStartingPosition, int nAxisRestrictionFlags ) +{ + Vector vNewPos; + bool bWorked = UTIL_FindClosestPassableSpace( pEntity, vIndecisivePush, fMask, 100, vNewPos, pStartingPosition, nAxisRestrictionFlags ); + if( bWorked ) + { +#ifdef CLIENT_DLL + pEntity->SetAbsOrigin( vNewPos ); +#else + pEntity->Teleport( &vNewPos, NULL, NULL ); +#endif + } + return bWorked; +} + +//----------------------------------------------------------------------------- +// Purpose: Retrieves the MOD directory for the active game (ie. "hl2") +//----------------------------------------------------------------------------- + +bool UTIL_GetModDir( char *lpszTextOut, unsigned int nSize ) +{ + // Must pass in a buffer at least large enough to hold the desired string + const char *pGameDir = CommandLine()->ParmValue( "-game", "hl2" ); + Assert( strlen(pGameDir) <= nSize ); + if ( strlen(pGameDir) > nSize ) + return false; + + Q_strncpy( lpszTextOut, pGameDir, nSize ); + if ( Q_strnchr( lpszTextOut, '/', nSize ) || Q_strnchr( lpszTextOut, '\\', nSize ) ) + { + // Strip the last directory off (which will be our game dir) + Q_StripLastDir( lpszTextOut, nSize ); + + // Find the difference in string lengths and take that difference from the original string as the mod dir + int dirlen = Q_strlen( lpszTextOut ); + Q_strncpy( lpszTextOut, pGameDir + dirlen, Q_strlen( pGameDir ) - dirlen + 1 ); + } + + return true; +} + +//#define FRUSTUM_DEBUGGING //for dumping some clipping information in UTIL_CalcFrustumThroughConvexPolygon + +int UTIL_CalcFrustumThroughConvexPolygon( const Vector *pPolyVertices, int iPolyVertCount, const Vector &vFrustumOrigin, const VPlane *pInputFrustumPlanes, int iInputFrustumPlanes, VPlane *pOutputFrustumPlanes, int iMaxOutputPlanes, int iPreserveCount ) +{ + Assert( iPreserveCount <= iMaxOutputPlanes ); + Assert( iPreserveCount <= iInputFrustumPlanes ); + if( iPolyVertCount < 3 ) + return 0; + +#if defined( FRUSTUM_DEBUGGING ) + //put case-specific debug logic here and it will propogate + const bool bDebugThisCall = (iInputFrustumPlanes > 0); + const float fDisplayTime = 0.0f; +#endif + + int iMaxComplexity = iMaxOutputPlanes - iPreserveCount; + + Vector *pClippedVerts; + int iClippedVertCount; + if( iInputFrustumPlanes > 0 ) + { + //clip the polygon by the input frustum + int iAllocSize = iPolyVertCount + iInputFrustumPlanes; + + Vector *pWorkVerts[2]; + pWorkVerts[0] = (Vector *)stackalloc( sizeof( Vector ) * iAllocSize * 2 ); //possible to add 1 point per cut, iPolyVertCount starting points, iInputFrustumPlaneCount cuts + pWorkVerts[1] = pWorkVerts[0] + iAllocSize; + + //clip by first plane and put output into pInVerts + iClippedVertCount = ClipPolyToPlane( (Vector *)pPolyVertices, iPolyVertCount, pWorkVerts[0], pInputFrustumPlanes[0].m_Normal, pInputFrustumPlanes[0].m_Dist, 0.01f ); + + //clip by other planes and flipflop in and out pointers + for( int i = 1; i != iInputFrustumPlanes; ++i ) + { + if( iClippedVertCount < 3 ) + return 0; //nothing left in the frustum + + iClippedVertCount = ClipPolyToPlane( pWorkVerts[(i & 1) ^ 1], iClippedVertCount, pWorkVerts[i & 1], pInputFrustumPlanes[i].m_Normal, pInputFrustumPlanes[i].m_Dist, 0.01f ); + } + + if( iClippedVertCount < 3 ) + return false; //nothing left in the frustum + + pClippedVerts = pWorkVerts[(iInputFrustumPlanes & 1) ^ 1]; + } + else + { + //no input frustum + if( iPolyVertCount > iMaxComplexity ) + { + //we'll need to reduce our output frustum, copy the input polygon + pClippedVerts = (Vector *)stackalloc( sizeof( Vector ) * iPolyVertCount ); + memcpy( pClippedVerts, pPolyVertices, sizeof( Vector ) * iPolyVertCount ); + } + else + { + //we won't need to simplify the polygon to reduce output planes, just point at the input polygon + pClippedVerts = (Vector *)pPolyVertices; + } + iClippedVertCount = iPolyVertCount; + } + +#if defined( FRUSTUM_DEBUGGING ) //for visibility culling debugging + if( bDebugThisCall ) + { + NDebugOverlay::Line( pClippedVerts[iClippedVertCount - 1], pClippedVerts[0], 255, 0, 0, true, fDisplayTime ); + for( int j = 0; j != iClippedVertCount - 1; ++j ) + { + NDebugOverlay::Line( pClippedVerts[j], pClippedVerts[j+1], 255, 0, 0, true, fDisplayTime ); + } + } +#endif + + Assert( iClippedVertCount <= (iPolyVertCount + iInputFrustumPlanes) ); + + if( iClippedVertCount > iMaxComplexity ) + { +#if defined( FRUSTUM_DEBUGGING ) + if( bDebugThisCall ) + { + NDebugOverlay::Line( pClippedVerts[iClippedVertCount - 1], pClippedVerts[0], 0, 255, 0, false, fDisplayTime ); + for( int j = 0; j != iClippedVertCount - 1; ++j ) + { + NDebugOverlay::Line( pClippedVerts[j], pClippedVerts[j+1], 0, 255, 0, true, fDisplayTime ); + } + } +#endif + float *fLineLengthSqr = (float *)stackalloc( sizeof( float ) * iClippedVertCount ); + + for( int i = 0; i != (iClippedVertCount - 1); ++i ) + { + fLineLengthSqr[i] = (pClippedVerts[i + 1] - pClippedVerts[i]).LengthSqr(); + } + fLineLengthSqr[(iClippedVertCount - 1)] = (pClippedVerts[0] - pClippedVerts[(iClippedVertCount - 1)]).LengthSqr(); //wrap around + + +#if defined( FRUSTUM_DEBUGGING ) //for visibility culling debugging + Vector vDebugBoxExtent; + vDebugBoxExtent.Init( 1.0f, 1.0f, 1.0f ); +#endif + while( iClippedVertCount > iMaxComplexity ) //vert count == number of planes we need to bound the polygon + { + //we have too many verts to represent this accurately in the output frustum plane count + //so, we're going to eliminate the smallest sides one at a time and bridge the surrounding sides until we're down to iMaxComplexity + float fMinSide = fLineLengthSqr[0]; + int iMinSideFirstPoint = 0; + int iOldVertCount = iClippedVertCount; + --iClippedVertCount; //we're going to decrement this sometime in this block, it makes math easier to do it now + + for( int i = 1; i != iOldVertCount; ++i ) + { + if( fLineLengthSqr[i] < fMinSide ) + { + fMinSide = fLineLengthSqr[i]; + iMinSideFirstPoint = i; + } + } + + int i1, i2, i3, i4; + i1 = (iMinSideFirstPoint + iClippedVertCount)%(iOldVertCount); //-1 with a wrap + i2 = iMinSideFirstPoint; + i3 = (iMinSideFirstPoint + 1)%(iOldVertCount); + i4 = (iMinSideFirstPoint + 2)%(iOldVertCount); + + Vector *p1, *p2, *p3, *p4; + p1 = &pClippedVerts[i1]; + p2 = &pClippedVerts[i2]; + p3 = &pClippedVerts[i3]; //this is the one we'll actually be dropping in the merge + p4 = &pClippedVerts[i4]; + + + //now we know the two points that we have to merge to one, project and make a merged point from the surrounding lines + //if( fMinSide >= 0.1f ) //only worth doing the math if it's actually going to be accurate and make a difference + { + //http://mathworld.wolfram.com/Line-LineIntersection.html (20) + Vector vA = *p2 - *p1; + Vector vB = *p4 - *p3; + Vector vC = *p3 - *p1; + Vector vCxB = vC.Cross( vB ); + Vector vAxB = vA.Cross( vB ); + float fS = vCxB.Dot(vAxB)/vAxB.LengthSqr(); + + *p2 = *p1 + (vA * fS); + + fLineLengthSqr[i1] = (*p2 - *p1).LengthSqr(); + } + + fLineLengthSqr[i2] = (*p4 - *p2).LengthSqr(); //must do this BEFORE possibly shifting points p4+ left + + if( i3 < i4 ) //not the last point in the array + { + int iElementShift = (iOldVertCount - i4); + + //eliminate p3, we merged p2+p3 and already stored the result in p2 + memmove( p3, p4, sizeof( Vector ) * iElementShift ); + memmove( &fLineLengthSqr[i3], &fLineLengthSqr[i4], sizeof( float ) * iElementShift ); + } + } + +#if defined(FRUSTUM_DEBUGGING) //for visibility culling debugging + if( bDebugThisCall ) + { + NDebugOverlay::Line( pClippedVerts[iClippedVertCount - 1], pClippedVerts[0], 0, 0, 255, false, fDisplayTime ); + for( int j = 0; j != iClippedVertCount - 1; ++j ) + { + NDebugOverlay::Line( pClippedVerts[j], pClippedVerts[j+1], 0, 0, 255, true, fDisplayTime ); + } + } +#endif + } + + //generate planes defined by each line around the convex and the frustum origin + { + int iFlipNormalsXOR = 0; //this algorithm was written assuming polygon vertices would be in a clockwise order from the perspective of vFrustumOrigin, some logic needs to flip if the inverse is true + { + Vector vLine1 = pPolyVertices[1] - pPolyVertices[0]; + Vector vLine2 = pPolyVertices[2] - pPolyVertices[1]; + Vector vFrontFace = vLine2.Cross( vLine1 ); + + iFlipNormalsXOR = (vFrontFace.Dot( vFrustumOrigin - pPolyVertices[0] ) < 0.0f) ? 1 : 0; //this will assist in reversing the normal by flipping the cross product + } + + Vector vTemp[2]; + vTemp[0] = pClippedVerts[iClippedVertCount - 1] - vFrustumOrigin; + for( int i = 0; i != iClippedVertCount; ++i ) + { + int iIndexing = i & 1; //we can carry over the line computation from one iteration to the next, flip which order we look at the temps with + vTemp[iIndexing ^ 1] = pClippedVerts[i] - vFrustumOrigin; + + Vector vNormal = vTemp[iIndexing ^ iFlipNormalsXOR].Cross( vTemp[(iIndexing ^ iFlipNormalsXOR) ^ 1] ); //vLine1.Cross( vLine2 ); + vNormal.NormalizeInPlace(); + + pOutputFrustumPlanes[i].Init( vNormal, vNormal.Dot( vFrustumOrigin ) ); + } + } + + //preserve input planes on request + if( iPreserveCount > 0 ) + { + memcpy( &pOutputFrustumPlanes[iClippedVertCount], &pInputFrustumPlanes[iInputFrustumPlanes - iPreserveCount], sizeof( VPlane ) * iPreserveCount ); + } + + return (iClippedVertCount + iPreserveCount); +} + + + +//----------------------------------------------------------------------------- +// class CFlaggedEntitiesEnum +//----------------------------------------------------------------------------- + +CFlaggedEntitiesEnum::CFlaggedEntitiesEnum( CBaseEntity **pList, int listMax, int flagMask ) +{ + m_pList = pList; + m_listMax = listMax; + m_flagMask = flagMask; + m_count = 0; +} + +bool CFlaggedEntitiesEnum::AddToList( CBaseEntity *pEntity ) +{ + if ( m_count >= m_listMax ) + { + AssertMsgOnce( 0, "reached enumerated list limit. Increase limit, decrease radius, or make it so entity flags will work for you" ); + return false; + } + m_pList[m_count] = pEntity; + m_count++; + return true; +} + +IterationRetval_t CFlaggedEntitiesEnum::EnumElement( IHandleEntity *pHandleEntity ) +{ +#if defined( CLIENT_DLL ) + IClientEntity *pClientEntity = cl_entitylist->GetClientEntityFromHandle( pHandleEntity->GetRefEHandle() ); + C_BaseEntity *pEntity = pClientEntity ? pClientEntity->GetBaseEntity() : NULL; +#else + CBaseEntity *pEntity = gEntList.GetBaseEntity( pHandleEntity->GetRefEHandle() ); +#endif + if ( pEntity ) + { + if ( m_flagMask && !(pEntity->GetFlags() & m_flagMask) ) // Does it meet the criteria? + return ITERATION_CONTINUE; + + if ( !AddToList( pEntity ) ) + return ITERATION_STOP; + } + + return ITERATION_CONTINUE; +} + + +//----------------------------------------------------------------------------- +// class CHurtableEntitiesEnum +//----------------------------------------------------------------------------- + +CHurtableEntitiesEnum::CHurtableEntitiesEnum( CBaseEntity **pList, int listMax ) +{ + m_pList = pList; + m_listMax = listMax; + m_count = 0; +} + +bool CHurtableEntitiesEnum::AddToList( CBaseEntity *pEntity ) +{ + if ( m_count >= m_listMax ) + { + AssertMsgOnce( 0, "reached enumerated list limit. Increase limit, decrease radius, or make it so entity flags will work for you" ); + return false; + } + m_pList[m_count] = pEntity; + m_count++; + return true; +} + +IterationRetval_t CHurtableEntitiesEnum::EnumElement( IHandleEntity *pHandleEntity ) +{ +#if defined( CLIENT_DLL ) + IClientEntity *pClientEntity = cl_entitylist->GetClientEntityFromHandle( pHandleEntity->GetRefEHandle() ); + C_BaseEntity *pEntity = pClientEntity ? pClientEntity->GetBaseEntity() : NULL; +#else + CBaseEntity *pEntity = gEntList.GetBaseEntity( pHandleEntity->GetRefEHandle() ); +#endif + if ( pEntity ) + { + if ( ( pEntity->m_takedamage == DAMAGE_NO || pEntity->GetHealth() <= 0 ) && pEntity->GetMoveType() != MOVETYPE_VPHYSICS ) // Does it meet the criteria? + return ITERATION_CONTINUE; + + if ( !AddToList( pEntity ) ) + return ITERATION_STOP; + } + + return ITERATION_CONTINUE; +} + + + +int UTIL_EntitiesAlongRay( const Ray_t &ray, CFlaggedEntitiesEnum *pEnum ) +{ +#if defined( CLIENT_DLL ) + partition->EnumerateElementsAlongRay( PARTITION_CLIENT_NON_STATIC_EDICTS, ray, false, pEnum ); +#else + partition->EnumerateElementsAlongRay( PARTITION_ENGINE_NON_STATIC_EDICTS, ray, false, pEnum ); +#endif + return pEnum->GetCount(); +} diff --git a/game/shared/util_shared.h b/game/shared/util_shared.h index e068e07f8..77ceaf4e6 100644 --- a/game/shared/util_shared.h +++ b/game/shared/util_shared.h @@ -1,544 +1,931 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// -// -// Purpose: Shared util code between client and server. -// -//=============================================================================// - -#ifndef UTIL_SHARED_H -#define UTIL_SHARED_H -#ifdef _WIN32 -#pragma once -#endif - -#include "mathlib/vector.h" -#include "cmodel.h" -#include "utlvector.h" -#include "networkvar.h" -#include "engine/IEngineTrace.h" -#include "engine/IStaticPropMgr.h" -#include "shared_classnames.h" - -#ifdef CLIENT_DLL -#include "cdll_client_int.h" -#endif - -#ifdef PORTAL -#include "portal_util_shared.h" -#endif - -//----------------------------------------------------------------------------- -// Forward declarations -//----------------------------------------------------------------------------- -class CGameTrace; -class CBasePlayer; -typedef CGameTrace trace_t; - -extern ConVar developer; // developer mode - - -//----------------------------------------------------------------------------- -// Language IDs. -//----------------------------------------------------------------------------- -#define LANGUAGE_ENGLISH 0 -#define LANGUAGE_GERMAN 1 -#define LANGUAGE_FRENCH 2 -#define LANGUAGE_BRITISH 3 - - -//----------------------------------------------------------------------------- -// Pitch + yaw -//----------------------------------------------------------------------------- -float UTIL_VecToYaw (const Vector &vec); -float UTIL_VecToPitch (const Vector &vec); -float UTIL_VecToYaw (const matrix3x4_t& matrix, const Vector &vec); -float UTIL_VecToPitch (const matrix3x4_t& matrix, const Vector &vec); -Vector UTIL_YawToVector ( float yaw ); - -//----------------------------------------------------------------------------- -// Shared random number generators for shared/predicted code: -// whenever generating random numbers in shared/predicted code, these functions -// have to be used. Each call should specify a unique "sharedname" string that -// seeds the random number generator. In loops make sure the "additionalSeed" -// is increased with the loop counter, otherwise it will always return the -// same random number -//----------------------------------------------------------------------------- -float SharedRandomFloat( const char *sharedname, float flMinVal, float flMaxVal, int additionalSeed = 0 ); -int SharedRandomInt( const char *sharedname, int iMinVal, int iMaxVal, int additionalSeed = 0 ); -Vector SharedRandomVector( const char *sharedname, float minVal, float maxVal, int additionalSeed = 0 ); -QAngle SharedRandomAngle( const char *sharedname, float minVal, float maxVal, int additionalSeed = 0 ); - -//----------------------------------------------------------------------------- -// Standard collision filters... -//----------------------------------------------------------------------------- -bool PassServerEntityFilter( const IHandleEntity *pTouch, const IHandleEntity *pPass ); -bool StandardFilterRules( IHandleEntity *pHandleEntity, int fContentsMask ); - - -//----------------------------------------------------------------------------- -// Converts an IHandleEntity to an CBaseEntity -//----------------------------------------------------------------------------- -inline const CBaseEntity *EntityFromEntityHandle( const IHandleEntity *pConstHandleEntity ) -{ - IHandleEntity *pHandleEntity = const_cast(pConstHandleEntity); - -#ifdef CLIENT_DLL - IClientUnknown *pUnk = (IClientUnknown*)pHandleEntity; - return pUnk->GetBaseEntity(); -#else - if ( staticpropmgr->IsStaticProp( pHandleEntity ) ) - return NULL; - - IServerUnknown *pUnk = (IServerUnknown*)pHandleEntity; - return pUnk->GetBaseEntity(); -#endif -} - -inline CBaseEntity *EntityFromEntityHandle( IHandleEntity *pHandleEntity ) -{ -#ifdef CLIENT_DLL - IClientUnknown *pUnk = (IClientUnknown*)pHandleEntity; - return pUnk->GetBaseEntity(); -#else - if ( staticpropmgr->IsStaticProp( pHandleEntity ) ) - return NULL; - - IServerUnknown *pUnk = (IServerUnknown*)pHandleEntity; - return pUnk->GetBaseEntity(); -#endif -} - - -//----------------------------------------------------------------------------- -// traceline methods -//----------------------------------------------------------------------------- -class CTraceFilterSimple : public CTraceFilter -{ -public: - // It does have a base, but we'll never network anything below here.. - DECLARE_CLASS_NOBASE( CTraceFilterSimple ); - - CTraceFilterSimple( const IHandleEntity *passentity, int collisionGroup ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - virtual void SetPassEntity( const IHandleEntity *pPassEntity ) { m_pPassEnt = pPassEntity; } - virtual void SetCollisionGroup( int iCollisionGroup ) { m_collisionGroup = iCollisionGroup; } - - const IHandleEntity *GetPassEntity( void ){ return m_pPassEnt;} - -private: - const IHandleEntity *m_pPassEnt; - int m_collisionGroup; -}; - -class CTraceFilterSkipTwoEntities : public CTraceFilterSimple -{ -public: - // It does have a base, but we'll never network anything below here.. - DECLARE_CLASS( CTraceFilterSkipTwoEntities, CTraceFilterSimple ); - - CTraceFilterSkipTwoEntities( const IHandleEntity *passentity, const IHandleEntity *passentity2, int collisionGroup ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - virtual void SetPassEntity2( const IHandleEntity *pPassEntity2 ) { m_pPassEnt2 = pPassEntity2; } - -private: - const IHandleEntity *m_pPassEnt2; -}; - -class CTraceFilterSimpleList : public CTraceFilterSimple -{ -public: - CTraceFilterSimpleList( int collisionGroup ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - - void AddEntityToIgnore( IHandleEntity *pEntity ); -protected: - CUtlVector m_PassEntities; -}; - -class CTraceFilterOnlyNPCsAndPlayer : public CTraceFilterSimple -{ -public: - CTraceFilterOnlyNPCsAndPlayer( const IHandleEntity *passentity, int collisionGroup ) - : CTraceFilterSimple( passentity, collisionGroup ) - { - } - - virtual TraceType_t GetTraceType() const - { - return TRACE_ENTITIES_ONLY; - } - - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); -}; - -class CTraceFilterNoNPCsOrPlayer : public CTraceFilterSimple -{ -public: - CTraceFilterNoNPCsOrPlayer( const IHandleEntity *passentity, int collisionGroup ) - : CTraceFilterSimple( passentity, collisionGroup ) - { - } - - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); -}; - -//----------------------------------------------------------------------------- -// Purpose: Custom trace filter used for NPC LOS traces -//----------------------------------------------------------------------------- -class CTraceFilterLOS : public CTraceFilterSkipTwoEntities -{ -public: - CTraceFilterLOS( IHandleEntity *pHandleEntity, int collisionGroup, IHandleEntity *pHandleEntity2 = NULL ); - bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); -}; - -class CTraceFilterSkipClassname : public CTraceFilterSimple -{ -public: - CTraceFilterSkipClassname( const IHandleEntity *passentity, const char *pchClassname, int collisionGroup ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - -private: - - const char *m_pchClassname; -}; - -class CTraceFilterSkipTwoClassnames : public CTraceFilterSkipClassname -{ -public: - // It does have a base, but we'll never network anything below here.. - DECLARE_CLASS( CTraceFilterSkipTwoClassnames, CTraceFilterSkipClassname ); - - CTraceFilterSkipTwoClassnames( const IHandleEntity *passentity, const char *pchClassname, const char *pchClassname2, int collisionGroup ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - -private: - const char *m_pchClassname2; -}; - -class CTraceFilterSimpleClassnameList : public CTraceFilterSimple -{ -public: - CTraceFilterSimpleClassnameList( const IHandleEntity *passentity, int collisionGroup ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - - void AddClassnameToIgnore( const char *pchClassname ); -private: - CUtlVector m_PassClassnames; -}; - -class CTraceFilterChain : public CTraceFilter -{ -public: - CTraceFilterChain( ITraceFilter *pTraceFilter1, ITraceFilter *pTraceFilter2 ); - virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); - -private: - ITraceFilter *m_pTraceFilter1; - ITraceFilter *m_pTraceFilter2; -}; - -// helper -void DebugDrawLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, int r, int g, int b, bool test, float duration ); - -extern ConVar r_visualizetraces; - -inline void UTIL_TraceLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, - const IHandleEntity *ignore, int collisionGroup, trace_t *ptr ) -{ - Ray_t ray; - ray.Init( vecAbsStart, vecAbsEnd ); - CTraceFilterSimple traceFilter( ignore, collisionGroup ); - - enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); - - if( r_visualizetraces.GetBool() ) - { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); - } -} - -inline void UTIL_TraceLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, - ITraceFilter *pFilter, trace_t *ptr ) -{ - Ray_t ray; - ray.Init( vecAbsStart, vecAbsEnd ); - - enginetrace->TraceRay( ray, mask, pFilter, ptr ); - - if( r_visualizetraces.GetBool() ) - { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); - } -} - -inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, const Vector &hullMin, - const Vector &hullMax, unsigned int mask, const IHandleEntity *ignore, - int collisionGroup, trace_t *ptr ) -{ - Ray_t ray; - ray.Init( vecAbsStart, vecAbsEnd, hullMin, hullMax ); - CTraceFilterSimple traceFilter( ignore, collisionGroup ); - - enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); - - if( r_visualizetraces.GetBool() ) - { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, -1.0f ); - } -} - -inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, const Vector &hullMin, - const Vector &hullMax, unsigned int mask, ITraceFilter *pFilter, trace_t *ptr ) -{ - Ray_t ray; - ray.Init( vecAbsStart, vecAbsEnd, hullMin, hullMax ); - - enginetrace->TraceRay( ray, mask, pFilter, ptr ); - - if( r_visualizetraces.GetBool() ) - { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, -1.0f ); - } -} - -inline void UTIL_TraceRay( const Ray_t &ray, unsigned int mask, - const IHandleEntity *ignore, int collisionGroup, trace_t *ptr ) -{ - CTraceFilterSimple traceFilter( ignore, collisionGroup ); - - enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); - - if( r_visualizetraces.GetBool() ) - { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); - } -} - -// Sweeps a particular entity through the world -void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, unsigned int mask, trace_t *ptr ); -void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, - unsigned int mask, ITraceFilter *pFilter, trace_t *ptr ); -void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, - unsigned int mask, const IHandleEntity *ignore, int collisionGroup, trace_t *ptr ); - -bool UTIL_EntityHasMatchingRootParent( CBaseEntity *pRootParent, CBaseEntity *pEntity ); - -inline int UTIL_PointContents( const Vector &vec ) -{ - return enginetrace->GetPointContents( vec ); -} - -// Sweeps against a particular model, using collision rules -void UTIL_TraceModel( const Vector &vecStart, const Vector &vecEnd, const Vector &hullMin, - const Vector &hullMax, CBaseEntity *pentModel, int collisionGroup, trace_t *ptr ); - -void UTIL_ClipTraceToPlayers( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, ITraceFilter *filter, trace_t *tr ); - -// Particle effect tracer -void UTIL_ParticleTracer( const char *pszTracerEffectName, const Vector &vecStart, const Vector &vecEnd, int iEntIndex = 0, int iAttachment = 0, bool bWhiz = false ); - -// Old style, non-particle system, tracers -void UTIL_Tracer( const Vector &vecStart, const Vector &vecEnd, int iEntIndex = 0, int iAttachment = TRACER_DONT_USE_ATTACHMENT, float flVelocity = 0, bool bWhiz = false, const char *pCustomTracerName = NULL, int iParticleID = 0 ); - -bool UTIL_IsLowViolence( void ); -bool UTIL_ShouldShowBlood( int bloodColor ); -void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, int amount ); - -void UTIL_BloodImpact( const Vector &pos, const Vector &dir, int color, int amount ); -void UTIL_BloodDecalTrace( trace_t *pTrace, int bloodColor ); -void UTIL_DecalTrace( trace_t *pTrace, char const *decalName ); -bool UTIL_IsSpaceEmpty( CBaseEntity *pMainEnt, const Vector &vMin, const Vector &vMax ); - -void UTIL_StringToVector( float *pVector, const char *pString ); -void UTIL_StringToIntArray( int *pVector, int count, const char *pString ); -void UTIL_StringToFloatArray( float *pVector, int count, const char *pString ); -void UTIL_StringToColor32( color32 *color, const char *pString ); - -CBasePlayer *UTIL_PlayerByIndex( int entindex ); - -// decodes a buffer using a 64bit ICE key (inplace) -void UTIL_DecodeICE( unsigned char * buffer, int size, const unsigned char *key); - -unsigned short UTIL_GetAchievementEventMask( void ); - - -//-------------------------------------------------------------------------------------------------------------- -/** - * Given a position and a ray, return the shortest distance between the two. - * If 'pos' is beyond either end of the ray, the returned distance is negated. - */ -inline float DistanceToRay( const Vector &pos, const Vector &rayStart, const Vector &rayEnd, float *along = NULL, Vector *pointOnRay = NULL ) -{ - Vector to = pos - rayStart; - Vector dir = rayEnd - rayStart; - float length = dir.NormalizeInPlace(); - - float rangeAlong = DotProduct( dir, to ); - if (along) - { - *along = rangeAlong; - } - - float range; - - if (rangeAlong < 0.0f) - { - // off start point - range = -(pos - rayStart).Length(); - - if (pointOnRay) - { - *pointOnRay = rayStart; - } - } - else if (rangeAlong > length) - { - // off end point - range = -(pos - rayEnd).Length(); - - if (pointOnRay) - { - *pointOnRay = rayEnd; - } - } - else // within ray bounds - { - Vector onRay = rayStart + rangeAlong * dir; - range = (pos - onRay).Length(); - - if (pointOnRay) - { - *pointOnRay = onRay; - } - } - - return range; -} - - -//-------------------------------------------------------------------------------------------------------------- -/** - * Simple class for tracking intervals of game time. - * Upon creation, the timer is invalidated. To measure time intervals, start the timer via Start(). - */ -class IntervalTimer -{ -public: - DECLARE_EMBEDDED_NETWORKVAR(); - - IntervalTimer( void ) - { - m_timestamp = -1.0f; - } - - void Reset( void ) - { - m_timestamp = Now(); - } - - void Start( void ) - { - m_timestamp = Now(); - } - - void Invalidate( void ) - { - m_timestamp = -1.0f; - } - - bool HasStarted( void ) const - { - return (m_timestamp > 0.0f); - } - - /// if not started, elapsed time is very large - float GetElapsedTime( void ) const - { - return (HasStarted()) ? (Now() - m_timestamp) : 99999.9f; - } - - bool IsLessThen( float duration ) const - { - return (Now() - m_timestamp < duration) ? true : false; - } - - bool IsGreaterThen( float duration ) const - { - return (Now() - m_timestamp > duration) ? true : false; - } - -private: - CNetworkVar( float, m_timestamp ); - float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime -}; - - -//-------------------------------------------------------------------------------------------------------------- -/** - * Simple class for counting down a short interval of time. - * Upon creation, the timer is invalidated. Invalidated countdown timers are considered to have elapsed. - */ -class CountdownTimer -{ -public: - DECLARE_EMBEDDED_NETWORKVAR(); - - CountdownTimer( void ) - { - m_timestamp = -1.0f; - m_duration = 0.0f; - } - - void Reset( void ) - { - m_timestamp = Now() + m_duration; - } - - void Start( float duration ) - { - m_timestamp = Now() + duration; - m_duration = duration; - } - - void Invalidate( void ) - { - m_timestamp = -1.0f; - } - - bool HasStarted( void ) const - { - return (m_timestamp > 0.0f); - } - - bool IsElapsed( void ) const - { - return (Now() > m_timestamp); - } - - float GetElapsedTime( void ) const - { - return Now() - m_timestamp + m_duration; - } - - float GetRemainingTime( void ) const - { - return (m_timestamp - Now()); - } - - /// return original countdown time - float GetCountdownDuration( void ) const - { - return (m_timestamp > 0.0f) ? m_duration : 0.0f; - } - -private: - CNetworkVar( float, m_duration ); - CNetworkVar( float, m_timestamp ); - float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime -}; - -const char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename = NULL ); - -int UTIL_StringFieldToInt( const char *szValue, const char **pValueStrings, int iNumStrings ); - -#endif // UTIL_SHARED_H +//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +// +// Purpose: Shared util code between client and server. +// +//=============================================================================// + +#ifndef UTIL_SHARED_H +#define UTIL_SHARED_H +#ifdef _WIN32 +#pragma once +#endif + +#include "mathlib/vector.h" +#include "cmodel.h" +#include "utlvector.h" +#include "networkvar.h" +#include "engine/IEngineTrace.h" +#include "engine/IStaticPropMgr.h" +#include "shared_classnames.h" + +#ifdef CLIENT_DLL +#include "cdll_client_int.h" +#endif + +#ifdef PORTAL +#include "portal_util_shared.h" +#endif + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class CGameTrace; +class CBasePlayer; +typedef CGameTrace trace_t; + +extern ConVar developer; // developer mode + + +//----------------------------------------------------------------------------- +// Language IDs. +//----------------------------------------------------------------------------- +#define LANGUAGE_ENGLISH 0 +#define LANGUAGE_GERMAN 1 +#define LANGUAGE_FRENCH 2 +#define LANGUAGE_BRITISH 3 + + +//----------------------------------------------------------------------------- +// Pitch + yaw +//----------------------------------------------------------------------------- +float UTIL_VecToYaw (const Vector &vec); +float UTIL_VecToPitch (const Vector &vec); +float UTIL_VecToYaw (const matrix3x4_t& matrix, const Vector &vec); +float UTIL_VecToPitch (const matrix3x4_t& matrix, const Vector &vec); +Vector UTIL_YawToVector ( float yaw ); + +//----------------------------------------------------------------------------- +// Shared random number generators for shared/predicted code: +// whenever generating random numbers in shared/predicted code, these functions +// have to be used. Each call should specify a unique "sharedname" string that +// seeds the random number generator. In loops make sure the "additionalSeed" +// is increased with the loop counter, otherwise it will always return the +// same random number +//----------------------------------------------------------------------------- +float SharedRandomFloat( const char *sharedname, float flMinVal, float flMaxVal, int additionalSeed = 0 ); +int SharedRandomInt( const char *sharedname, int iMinVal, int iMaxVal, int additionalSeed = 0 ); +Vector SharedRandomVector( const char *sharedname, float minVal, float maxVal, int additionalSeed = 0 ); +QAngle SharedRandomAngle( const char *sharedname, float minVal, float maxVal, int additionalSeed = 0 ); + +//----------------------------------------------------------------------------- +// Standard collision filters... +//----------------------------------------------------------------------------- +bool PassServerEntityFilter( const IHandleEntity *pTouch, const IHandleEntity *pPass ); +bool StandardFilterRules( IHandleEntity *pHandleEntity, int fContentsMask ); + + +//----------------------------------------------------------------------------- +// Converts an IHandleEntity to an CBaseEntity +//----------------------------------------------------------------------------- +inline const CBaseEntity *EntityFromEntityHandle( const IHandleEntity *pConstHandleEntity ) +{ + IHandleEntity *pHandleEntity = const_cast(pConstHandleEntity); + +#ifdef CLIENT_DLL + IClientUnknown *pUnk = (IClientUnknown*)pHandleEntity; + return pUnk->GetBaseEntity(); +#else + if ( staticpropmgr->IsStaticProp( pHandleEntity ) ) + return NULL; + + IServerUnknown *pUnk = (IServerUnknown*)pHandleEntity; + return pUnk->GetBaseEntity(); +#endif +} + +inline CBaseEntity *EntityFromEntityHandle( IHandleEntity *pHandleEntity ) +{ +#ifdef CLIENT_DLL + IClientUnknown *pUnk = (IClientUnknown*)pHandleEntity; + return pUnk->GetBaseEntity(); +#else +#ifndef _X360 + if ( staticpropmgr->IsStaticProp( pHandleEntity ) ) + return NULL; +#else + if ( !pHandleEntity || pHandleEntity->m_bIsStaticProp ) + return NULL; +#endif + + IServerUnknown *pUnk = (IServerUnknown*)pHandleEntity; + Assert( !pUnk || pUnk->GetBaseEntity() ); + return pUnk->GetBaseEntity(); +#endif +} + + +typedef bool (*ShouldHitFunc_t)( IHandleEntity *pHandleEntity, int contentsMask ); + +//----------------------------------------------------------------------------- +// traceline methods +//----------------------------------------------------------------------------- +class CTraceFilterSimple : public CTraceFilter +{ +public: + // It does have a base, but we'll never network anything below here.. + DECLARE_CLASS_NOBASE( CTraceFilterSimple ); + + CTraceFilterSimple( const IHandleEntity *passentity, int collisionGroup, ShouldHitFunc_t pExtraShouldHitCheckFn = NULL ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + virtual void SetPassEntity( const IHandleEntity *pPassEntity ) { m_pPassEnt = pPassEntity; } + virtual void SetCollisionGroup( int iCollisionGroup ) { m_collisionGroup = iCollisionGroup; } + + const IHandleEntity *GetPassEntity( void ){ return m_pPassEnt;} + +private: + const IHandleEntity *m_pPassEnt; + int m_collisionGroup; + ShouldHitFunc_t m_pExtraShouldHitCheckFunction; + +}; + +class CTraceFilterSkipTwoEntities : public CTraceFilterSimple +{ +public: + // It does have a base, but we'll never network anything below here.. + DECLARE_CLASS( CTraceFilterSkipTwoEntities, CTraceFilterSimple ); + + CTraceFilterSkipTwoEntities( const IHandleEntity *passentity = NULL, const IHandleEntity *passentity2 = NULL, int collisionGroup = COLLISION_GROUP_NONE ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + virtual void SetPassEntity2( const IHandleEntity *pPassEntity2 ) { m_pPassEnt2 = pPassEntity2; } + +private: + const IHandleEntity *m_pPassEnt2; +}; + +class CTraceFilterSimpleList : public CTraceFilterSimple +{ +public: + CTraceFilterSimpleList( int collisionGroup ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + + void AddEntityToIgnore( IHandleEntity *pEntity ); + void AddEntitiesToIgnore( int nCount, IHandleEntity **ppEntities ); + +protected: + CUtlVector m_PassEntities; +}; + +class CTraceFilterOnlyHitThis : public CTraceFilter +{ +public: + // It does have a base, but we'll never network anything below here.. + DECLARE_CLASS_NOBASE( CTraceFilterOnlyHitThis ); + + CTraceFilterOnlyHitThis( const IHandleEntity *hitentity ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + +private: + const IHandleEntity *m_pHitEnt; +}; + +class CTraceFilterOnlyNPCsAndPlayer : public CTraceFilterSimple +{ +public: + CTraceFilterOnlyNPCsAndPlayer( const IHandleEntity *passentity, int collisionGroup ) + : CTraceFilterSimple( passentity, collisionGroup ) + { + } + + virtual TraceType_t GetTraceType() const + { + return TRACE_ENTITIES_ONLY; + } + + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); +}; + +class CTraceFilterNoNPCsOrPlayer : public CTraceFilterSimple +{ +public: + CTraceFilterNoNPCsOrPlayer( const IHandleEntity *passentity = NULL, int collisionGroup = COLLISION_GROUP_NONE ) + : CTraceFilterSimple( passentity, collisionGroup ) + { + } + + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); +}; + +//----------------------------------------------------------------------------- +// Purpose: Custom trace filter used for NPC LOS traces +//----------------------------------------------------------------------------- +class CTraceFilterLOS : public CTraceFilterSkipTwoEntities +{ +public: + CTraceFilterLOS( IHandleEntity *pHandleEntity, int collisionGroup, IHandleEntity *pHandleEntity2 = NULL ); + bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); +}; + +class CTraceFilterSkipClassname : public CTraceFilterSimple +{ +public: + CTraceFilterSkipClassname( const IHandleEntity *passentity, const char *pchClassname, int collisionGroup ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + +private: + + const char *m_pchClassname; +}; + +class CTraceFilterSkipTwoClassnames : public CTraceFilterSkipClassname +{ +public: + // It does have a base, but we'll never network anything below here.. + DECLARE_CLASS( CTraceFilterSkipTwoClassnames, CTraceFilterSkipClassname ); + + CTraceFilterSkipTwoClassnames( const IHandleEntity *passentity, const char *pchClassname, const char *pchClassname2, int collisionGroup ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + +private: + const char *m_pchClassname2; +}; + +class CTraceFilterSimpleClassnameList : public CTraceFilterSimple +{ +public: + CTraceFilterSimpleClassnameList( const IHandleEntity *passentity, int collisionGroup ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + + void AddClassnameToIgnore( const char *pchClassname ); +private: + CUtlVector m_PassClassnames; +}; + +class CTraceFilterChain : public CTraceFilter +{ +public: + CTraceFilterChain( ITraceFilter *pTraceFilter1, ITraceFilter *pTraceFilter2 ); + virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ); + +private: + ITraceFilter *m_pTraceFilter1; + ITraceFilter *m_pTraceFilter2; +}; + +// helper +void DebugDrawLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, int r, int g, int b, bool test, float duration ); + +extern ConVar r_visualizetraces; + +#ifdef DETECT_TRACE_SPIKES +#define BeginDetectTraceSpike() \ + extern void DoReportExpensiveTrace( bool repeat, float time ); \ + extern float g_TraceSpikeTolerance; \ + CFastTimer spikeTimer; \ + spikeTimer.Start() + +#define EndDetectTraceSpike() \ + spikeTimer.End() + +#define DidTraceSpike() \ + ( spikeTimer.GetDuration().GetMillisecondsF() > g_TraceSpikeTolerance ) + +#define ReportExpensiveTrace( repeat ) if ( DidTraceSpike() ) DoReportExpensiveTrace( repeat, spikeTimer.GetDuration().GetMillisecondsF() ) + +#else + +#define BeginDetectTraceSpike() ((void)0) +#define EndDetectTraceSpike() ((void)0) +#define DidTraceSpike() false +#define ReportExpensiveTrace( repeat ) ((void)0) +#endif + +inline void UTIL_TraceLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, + const IHandleEntity *ignore, int collisionGroup, trace_t *ptr ) +{ + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd ); + CTraceFilterSimple traceFilter( ignore, collisionGroup ); + + enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); + EndDetectTraceSpike(); + + if( r_visualizetraces.GetBool() || DidTraceSpike() ) + { + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + ReportExpensiveTrace( false ); + if ( DidTraceSpike() ) // Opimizer will remove this block + { + ReportExpensiveTrace( false ); + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd ); + CTraceFilterSimple traceFilter( ignore, collisionGroup ); + + enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); + EndDetectTraceSpike(); + if ( DidTraceSpike() ) + { + ReportExpensiveTrace( true ); + } + } + } +} + +inline void UTIL_TraceLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, + ITraceFilter *pFilter, trace_t *ptr ) +{ + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd ); + + enginetrace->TraceRay( ray, mask, pFilter, ptr ); + EndDetectTraceSpike(); + + if( r_visualizetraces.GetBool() || DidTraceSpike() ) + { + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + ReportExpensiveTrace( false ); + if ( DidTraceSpike() ) // Opimizer will remove this block + { + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd ); + + enginetrace->TraceRay( ray, mask, pFilter, ptr ); + EndDetectTraceSpike(); + + if ( DidTraceSpike() ) + { + ReportExpensiveTrace( true ); + } + } + } +} + +inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, const Vector &hullMin, + const Vector &hullMax, unsigned int mask, const IHandleEntity *ignore, + int collisionGroup, trace_t *ptr ) +{ + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd, hullMin, hullMax ); + CTraceFilterSimple traceFilter( ignore, collisionGroup ); + + enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); + EndDetectTraceSpike(); + + if( r_visualizetraces.GetBool() || DidTraceSpike() ) + { + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + ReportExpensiveTrace( false ); + if ( DidTraceSpike() ) // Opimizer will remove this block + { + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd, hullMin, hullMax ); + CTraceFilterSimple traceFilter( ignore, collisionGroup ); + + enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); + EndDetectTraceSpike(); + + if ( DidTraceSpike() ) + { + ReportExpensiveTrace( true ); + } + } + } +} + +inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, const Vector &hullMin, + const Vector &hullMax, unsigned int mask, ITraceFilter *pFilter, trace_t *ptr ) +{ + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd, hullMin, hullMax ); + + enginetrace->TraceRay( ray, mask, pFilter, ptr ); + + EndDetectTraceSpike(); + if( r_visualizetraces.GetBool() || DidTraceSpike() ) + { + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + ReportExpensiveTrace( false ); + if ( DidTraceSpike() ) // Opimizer will remove this block + { + BeginDetectTraceSpike(); + Ray_t ray; + ray.Init( vecAbsStart, vecAbsEnd, hullMin, hullMax ); + + enginetrace->TraceRay( ray, mask, pFilter, ptr ); + + EndDetectTraceSpike(); + if( DidTraceSpike() ) + { + ReportExpensiveTrace( true ); + } + } + } +} + +inline void UTIL_TraceRay( const Ray_t &ray, unsigned int mask, + const IHandleEntity *ignore, int collisionGroup, trace_t *ptr ) +{ + CTraceFilterSimple traceFilter( ignore, collisionGroup ); + + enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); + + if( r_visualizetraces.GetBool() ) + { + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); + } +} + +inline void UTIL_TraceRay( const Ray_t &ray, unsigned int mask, + ITraceFilter *pFilter, trace_t *ptr ) +{ + enginetrace->TraceRay( ray, mask, pFilter, ptr ); + + if( r_visualizetraces.GetBool() ) + { + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); + } +} +// Sweeps a particular entity through the world +void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, unsigned int mask, trace_t *ptr ); +void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, + unsigned int mask, ITraceFilter *pFilter, trace_t *ptr ); +void UTIL_TraceEntity( CBaseEntity *pEntity, const Vector &vecAbsStart, const Vector &vecAbsEnd, + unsigned int mask, const IHandleEntity *ignore, int collisionGroup, trace_t *ptr ); + +bool UTIL_EntityHasMatchingRootParent( CBaseEntity *pRootParent, CBaseEntity *pEntity ); + +inline int UTIL_PointContents( const Vector &vec, int contentsMask ) +{ + return enginetrace->GetPointContents( vec, contentsMask ); +} + +// Sweeps against a particular model, using collision rules +void UTIL_TraceModel( const Vector &vecStart, const Vector &vecEnd, const Vector &hullMin, + const Vector &hullMax, CBaseEntity *pentModel, int collisionGroup, trace_t *ptr ); + +void UTIL_ClipTraceToPlayers( const Vector& vecAbsStart, const Vector& vecAbsEnd, unsigned int mask, ITraceFilter *filter, trace_t *tr ); + +// Particle effect tracer +void UTIL_ParticleTracer( const char *pszTracerEffectName, const Vector &vecStart, const Vector &vecEnd, int iEntIndex = 0, int iAttachment = 0, bool bWhiz = false ); + +// Old style, non-particle system, tracers +void UTIL_Tracer( const Vector &vecStart, const Vector &vecEnd, int iEntIndex = 0, int iAttachment = TRACER_DONT_USE_ATTACHMENT, float flVelocity = 0, bool bWhiz = false, const char *pCustomTracerName = NULL, int iParticleID = 0 ); + +bool UTIL_IsLowViolence( void ); +bool UTIL_ShouldShowBlood( int bloodColor ); +void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, int amount ); + +void UTIL_BloodImpact( const Vector &pos, const Vector &dir, int color, int amount ); +void UTIL_BloodDecalTrace( trace_t *pTrace, int bloodColor ); +void UTIL_DecalTrace( trace_t *pTrace, char const *decalName ); +bool UTIL_IsSpaceEmpty( CBaseEntity *pMainEnt, const Vector &vMin, const Vector &vMax ); +bool UTIL_IsSpaceEmpty( CBaseEntity *pMainEnt, const Vector &vMin, const Vector &vMax, unsigned int mask, ITraceFilter *pFilter ); + +void UTIL_StringToVector( float *pVector, const char *pString ); +void UTIL_StringToFloatArray( float *pVector, int count, const char *pString ); + +CBasePlayer *UTIL_PlayerByIndex( int entindex ); + +// decodes/encodes a buffer using a 64bit ICE key (inplace) +void UTIL_DecodeICE( unsigned char * buffer, int size, const unsigned char *key ); +void UTIL_EncodeICE( unsigned char * buffer, unsigned int size, const unsigned char *key ); +unsigned short UTIL_GetAchievementEventMask( void ); + +//assumes the object is already in a mostly passable space +#define FL_AXIS_DIRECTION_NONE ( 0 ) +#define FL_AXIS_DIRECTION_X ( 1 << 0 ) +#define FL_AXIS_DIRECTION_NX ( 1 << 1 ) +#define FL_AXIS_DIRECTION_Y ( 1 << 2 ) +#define FL_AXIS_DIRECTION_NY ( 1 << 3 ) +#define FL_AXIS_DIRECTION_Z ( 1 << 4 ) +#define FL_AXIS_DIRECTION_NZ ( 1 << 5 ) + +bool UTIL_FindClosestPassableSpace( const Vector &vCenter, const Vector &vExtents, const Vector &vIndecisivePush, ITraceFilter *pTraceFilter, unsigned int fMask, unsigned int iIterations, Vector &vCenterOut, int nAxisRestrictionFlags = FL_AXIS_DIRECTION_NONE ); +bool UTIL_FindClosestPassableSpace( CBaseEntity *pEntity, const Vector &vIndecisivePush, unsigned int fMask, unsigned int iIterations, Vector &vOriginOut, Vector *pStartingPosition = NULL, int nAxisRestrictionFlags = FL_AXIS_DIRECTION_NONE ); +bool UTIL_FindClosestPassableSpace( CBaseEntity *pEntity, const Vector &vIndecisivePush, unsigned int fMask, Vector *pStartingPosition = NULL, int nAxisRestrictionFlags = FL_AXIS_DIRECTION_NONE ); + + +//-------------------------------------------------------------------------------------------------------------- +/** + * Given a position and a ray, return the shortest distance between the two. + * If 'pos' is beyond either end of the ray, the returned distance is negated. + */ +inline float DistanceToRay( const Vector &pos, const Vector &rayStart, const Vector &rayEnd, float *along = NULL, Vector *pointOnRay = NULL ) +{ + Vector to = pos - rayStart; + Vector dir = rayEnd - rayStart; + float length = dir.NormalizeInPlace(); + + float rangeAlong = DotProduct( dir, to ); + if (along) + { + *along = rangeAlong; + } + + float range; + + if (rangeAlong < 0.0f) + { + // off start point + range = -(pos - rayStart).Length(); + + if (pointOnRay) + { + *pointOnRay = rayStart; + } + } + else if (rangeAlong > length) + { + // off end point + range = -(pos - rayEnd).Length(); + + if (pointOnRay) + { + *pointOnRay = rayEnd; + } + } + else // within ray bounds + { + Vector onRay = rayStart + rangeAlong * dir; + range = (pos - onRay).Length(); + + if (pointOnRay) + { + *pointOnRay = onRay; + } + } + + return range; +} + + +//-------------------------------------------------------------------------------------------------------------- +/** +* Macro for creating an interface that when inherited from automatically maintains a list of instances +* that inherit from that interface. +*/ + +// interface for entities that want to a auto maintained global list +#define DECLARE_AUTO_LIST( interfaceName ) \ + class interfaceName; \ + abstract_class interfaceName \ + { \ + public: \ + interfaceName( bool bAutoAdd = true ); \ + virtual ~interfaceName(); \ + virtual CBaseEntity* GetEntity( void ) = 0; \ + static void Add( interfaceName *pElement ) { m_##interfaceName##AutoList.AddToTail( pElement ); } \ + static void Remove( interfaceName *pElement ) { m_##interfaceName##AutoList.FindAndFastRemove( pElement ); } \ + static const CUtlVector< interfaceName* >& AutoList( void ) { return m_##interfaceName##AutoList; } \ + private: \ + static CUtlVector< interfaceName* > m_##interfaceName##AutoList; \ + }; + +// Creates a simple function for accessing the higher level entity +#define IMPLEMENT_AUTO_LIST_GET() \ + virtual CBaseEntity* GetEntity( void ) { return this; } + +// Creates the auto add/remove constructor/destructor... +// Pass false to the constructor to not auto add +#define IMPLEMENT_AUTO_LIST( interfaceName ) \ + CUtlVector< class interfaceName* > interfaceName::m_##interfaceName##AutoList; \ + interfaceName::interfaceName( bool bAutoAdd ) \ + { \ + if ( bAutoAdd ) \ + { \ + Add( this ); \ + } \ + } \ + interfaceName::~interfaceName() \ + { \ + Remove( this ); \ + } + + +//-------------------------------------------------------------------------------------------------------------- +/** + * Simple class for tracking intervals of game time. + * Upon creation, the timer is invalidated. To measure time intervals, start the timer via Start(). + */ +class IntervalTimer +{ +public: +#ifdef CLIENT_DLL + DECLARE_PREDICTABLE(); +#endif + DECLARE_DATADESC(); + DECLARE_CLASS_NOBASE( IntervalTimer ); + DECLARE_EMBEDDED_NETWORKVAR(); + + IntervalTimer( void ) : m_timestamp( -1.0f ) + { + } + + void Reset( void ) + { + m_timestamp = Now(); + } + + void Start( void ) + { + m_timestamp = Now(); + } + + void StartFromTime( float startTime ) + { + m_timestamp = startTime; + } + + void Invalidate( void ) + { + m_timestamp = -1.0f; + } + + bool HasStarted( void ) const + { + return (m_timestamp > 0.0f); + } + + /// if not started, elapsed time is very large + float GetElapsedTime( void ) const + { + return (HasStarted()) ? (Now() - m_timestamp) : 99999.9f; + } + + bool IsLessThen( float duration ) const + { + return (Now() - m_timestamp < duration) ? true : false; + } + + bool IsGreaterThen( float duration ) const + { + return (Now() - m_timestamp > duration) ? true : false; + } + + float GetStartTime( void ) const + { + return m_timestamp; + } + +protected: + CNetworkVar( float, m_timestamp ); + float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime +}; + +#ifdef CLIENT_DLL +EXTERN_RECV_TABLE(DT_IntervalTimer); +#else +EXTERN_SEND_TABLE(DT_IntervalTimer); +#endif + +//-------------------------------------------------------------------------------------------------------------- +/** + * Simple class for counting down a short interval of time. + * Upon creation, the timer is invalidated. Invalidated countdown timers are considered to have elapsed. + */ +class CountdownTimer +{ +public: +#ifdef CLIENT_DLL + DECLARE_PREDICTABLE(); +#endif + DECLARE_CLASS_NOBASE( CountdownTimer ); + DECLARE_EMBEDDED_NETWORKVAR(); + + CountdownTimer( void ) : + m_duration( 0.0f ), m_timestamp( -1.0f) + { + } + + void Reset( void ) + { + m_timestamp = Now() + m_duration; + } + + void Start( float duration ) + { + m_timestamp = Now() + duration; + m_duration = duration; + } + + void StartFromTime( float startTime, float duration ) + { + m_timestamp = startTime + duration; + m_duration = duration; + } + + void Invalidate( void ) + { + m_timestamp = -1.0f; + } + + bool HasStarted( void ) const + { + return (m_timestamp > 0.0f); + } + + bool IsElapsed( void ) const + { + return (Now() > m_timestamp); + } + + float GetElapsedTime( void ) const + { + return Now() - m_timestamp + m_duration; + } + + float GetRemainingTime( void ) const + { + return (m_timestamp - Now()); + } + + /// return original countdown time + float GetCountdownDuration( void ) const + { + return (m_timestamp > 0.0f) ? m_duration : 0.0f; + } + + /// 1.0 for newly started, 0.0 for elapsed + float GetRemainingRatio( void ) const + { + if ( HasStarted() ) + { + float left = GetRemainingTime() / m_duration; + if ( left < 0.0f ) + return 0.0f; + if ( left > 1.0f ) + return 1.0f; + return left; + } + + return 0.0f; + } + +private: + CNetworkVar( float, m_duration ); + CNetworkVar( float, m_timestamp ); + float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime +}; + +#ifdef CLIENT_DLL +EXTERN_RECV_TABLE(DT_CountdownTimer); +#else +EXTERN_SEND_TABLE(DT_CountdownTimer); +#endif + + +//-------------------------------------------------------------------------------------------------------------- +/** +* Simple class for tracking change in values over time. +*/ +#define TIMELINE_ARRAY_SIZE 64 +#define TIMELINE_INTERVAL_START 0.25f + +enum TimelineCompression_t +{ + TIMELINE_COMPRESSION_SUM, + TIMELINE_COMPRESSION_COUNT_PER_INTERVAL, + TIMELINE_COMPRESSION_AVERAGE, + TIMELINE_COMPRESSION_AVERAGE_BLEND, + + TIMELINE_COMPRESSION_TOTAL +}; + +class CTimeline : public IntervalTimer +{ +public: + DECLARE_DATADESC(); + DECLARE_CLASS( CTimeline, IntervalTimer ); + DECLARE_EMBEDDED_NETWORKVAR(); + + CTimeline( void ) + { + ClearValues(); + } + + void ClearValues( void ); + void ClearAndStart( void ) { ClearValues(); Start(); } + void StopRecording( void ) { m_bStopped = true; } + void RecordValue( float flValue ); + void RecordFinalValue( float flValue ) { RecordValue( flValue ); StopRecording(); } + + int Count( void ) const + { + return m_nBucketCount; + } + + float GetValue( int i ) const; + + float GetValueAtInterp( float fInterp ) const; + + float GetValueTime( int i ) const + { + Assert( i >= 0 && i < m_nBucketCount ); + return static_cast( i ) * m_flInterval; + } + + float GetInterval( void ) const + { + return m_flInterval; + } + + void SetCompressionType( TimelineCompression_t nCompressionType ) + { + m_nCompressionType = nCompressionType; + } + + TimelineCompression_t GetCompressionType( void ) const + { + return m_nCompressionType; + } + +private: + int GetCurrentBucket( void ) + { + return static_cast( Now() - m_timestamp ) / m_flInterval; + } + + void Compress( void ); + + CNetworkArray( float, m_flValues, TIMELINE_ARRAY_SIZE ); + CNetworkArray( int, m_nValueCounts, TIMELINE_ARRAY_SIZE ); + CNetworkVar( int, m_nBucketCount ); + CNetworkVar( float, m_flInterval ); + CNetworkVar( float, m_flFinalValue ); + CNetworkVar( TimelineCompression_t, m_nCompressionType ); + CNetworkVar( bool, m_bStopped ); +}; + +#ifdef CLIENT_DLL +EXTERN_RECV_TABLE(DT_Timeline); +#else +EXTERN_SEND_TABLE(DT_Timeline); +#endif + +char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename = NULL ); + +int UTIL_StringFieldToInt( const char *szValue, const char **pValueStrings, int iNumStrings ); + +int UTIL_CountNumBitsSet( unsigned int nVar ); +int UTIL_CountNumBitsSet( uint64 nVar ); + +bool UTIL_GetModDir( char *lpszTextOut, unsigned int nSize ); + +/*UTIL_CalcFrustumThroughPolygon - Given a frustum and a polygon, calculate how the current frustum would clip the polygon, then generate a new frustum that runs along the edge of the clipped polygon. +-returns number of planes in the output frustum, 0 if the polygon was completely clipped by the input frustum +-vFrustumOrigin can be thought of as the camera origin if your frustum is a view frustum +-planes should face inward +-iPreserveCount will preserve N planes at the end of your input frustum and ensure they're at the end of your output frustum. Assuming your input frustum is of type "Frustum", a value of 2 would preserve your near and far planes +-to ensure that your output frustum can hold the entire complex frustum we generate. Make it of size (iPolyVertCount + iCurrentFrustumPlanes + iPreserveCount). Otherwise the output frustum will be simplified to fit your maximum output by eliminating bounding planes with the clipped area. +-a lack of input frustum is considered valid input*/ +int UTIL_CalcFrustumThroughConvexPolygon( const Vector *pPolyVertices, int iPolyVertCount, const Vector &vFrustumOrigin, const VPlane *pInputFrustumPlanes, int iInputFrustumPlanes, VPlane *pOutputFrustumPlanes, int iMaxOutputPlanes, int iPreserveCount ); + + +//----------------------------------------------------------------------------- +// class CFlaggedEntitiesEnum +//----------------------------------------------------------------------------- +// enumerate entities that match a set of edict flags into a static array +class CFlaggedEntitiesEnum : public IPartitionEnumerator +{ +public: + CFlaggedEntitiesEnum( CBaseEntity **pList, int listMax, int flagMask ); + + // This gets called by the enumeration methods with each element + // that passes the test. + virtual IterationRetval_t EnumElement( IHandleEntity *pHandleEntity ); + + int GetCount() { return m_count; } + bool AddToList( CBaseEntity *pEntity ); + +private: + CBaseEntity **m_pList; + int m_listMax; + int m_flagMask; + int m_count; +}; + +class CHurtableEntitiesEnum : public IPartitionEnumerator +{ +public: + CHurtableEntitiesEnum( CBaseEntity **pList, int listMax ); + + // This gets called by the enumeration methods with each element + // that passes the test. + virtual IterationRetval_t EnumElement( IHandleEntity *pHandleEntity ); + + int GetCount() { return m_count; } + bool AddToList( CBaseEntity *pEntity ); + +private: + CBaseEntity **m_pList; + int m_listMax; + int m_count; +}; + +int UTIL_EntitiesAlongRay( const Ray_t &ray, CFlaggedEntitiesEnum *pEnum ); + +inline int UTIL_EntitiesAlongRay( CBaseEntity **pList, int listMax, const Ray_t &ray, int flagMask ) +{ + CFlaggedEntitiesEnum rayEnum( pList, listMax, flagMask ); + return UTIL_EntitiesAlongRay( ray, &rayEnum ); +} + + +#endif // UTIL_SHARED_H diff --git a/public/SoundEmitterSystem/isoundemittersystembase.h b/public/SoundEmitterSystem/isoundemittersystembase.h index 46bd4b2b9..364737643 100644 --- a/public/SoundEmitterSystem/isoundemittersystembase.h +++ b/public/SoundEmitterSystem/isoundemittersystembase.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -16,12 +16,14 @@ #include "soundflags.h" #include "mathlib/compressed_vector.h" #include "appframework/IAppSystem.h" +#include "tier3/tier3.h" #define SOUNDEMITTERSYSTEM_INTERFACE_VERSION "VSoundEmitter002" #define SOUNDGENDER_MACRO "$gender" #define SOUNDGENDER_MACRO_LENGTH 7 // Length of above including $ +class KeyValues; typedef short HSOUNDSCRIPTHANDLE; #define SOUNDEMITTER_INVALID_HANDLE (HSOUNDSCRIPTHANDLE)-1 @@ -103,8 +105,8 @@ struct sound_interval_t T range; interval_t &ToInterval( interval_t &dest ) const { dest.start = start; dest.range = range; return dest; } - void FromInterval( const interval_t &from ) { start = (T)from.start; range = (T)from.range; } - float Random() const { interval_t temp = { start, range }; return RandomInterval( temp ); } + void FromInterval( const interval_t &from ) { start = from.start; range = from.range; } + float Random() const { return RandomFloat( start, start+range ); } }; @@ -146,8 +148,8 @@ struct CSoundParametersInternal void SetChannel( int newChannel ) { channel = newChannel; } void SetVolume( float start, float range = 0.0 ) { volume.start = start; volume.range = range; } - void SetPitch( float start, float range = 0.0 ) { pitch.start = (uint8)start; pitch.range = (uint8)range; } - void SetSoundLevel( float start, float range = 0.0 ) { soundlevel.start = (uint16)start; soundlevel.range = (uint16)range; } + void SetPitch( float start, float range = 0.0 ) { pitch.start = start; pitch.range = range; } + void SetSoundLevel( float start, float range = 0.0 ) { soundlevel.start = start; soundlevel.range = range; } void SetDelayMsec( int delay ) { delay_msec = delay; } void SetShouldPreload( bool bShouldPreload ) { m_bShouldPreload = bShouldPreload; } void SetOnlyPlayToOwner( bool b ) { play_to_owner_only = b; } @@ -189,7 +191,7 @@ struct CSoundParametersInternal byte reserved; // 28 - + KeyValues * m_pGameData; // 32 }; #pragma pack() @@ -260,6 +262,16 @@ abstract_class ISoundEmitterSystemBase : public IAppSystem virtual bool GetParametersForSoundEx( const char *soundname, HSOUNDSCRIPTHANDLE& handle, CSoundParameters& params, gender_t gender, bool isbeingemitted = false ) = 0; virtual soundlevel_t LookupSoundLevelByHandle( char const *soundname, HSOUNDSCRIPTHANDLE& handle ) = 0; + + virtual char const *GetSoundNameForHash( unsigned int hash ) = 0; // Returns NULL if hash not found!!! + virtual unsigned int HashSoundName( char const *pchSndName ) = 0; + virtual bool IsValidHash( unsigned int hash ) = 0; + + virtual void DescribeSound( char const *soundname ) = 0; + // Flush and reload + virtual void Flush() = 0; + + virtual void AddSoundsFromFile( const char *filename, bool bPreload, bool bIsOverride = false ) = 0; }; #endif // ISOUNDEMITTERSYSTEMBASE_H diff --git a/public/SoundParametersInternal.cpp b/public/SoundParametersInternal.cpp index 95f034c18..7b2628da0 100644 --- a/public/SoundParametersInternal.cpp +++ b/public/SoundParametersInternal.cpp @@ -11,8 +11,9 @@ #if !defined(_STATIC_LINKED) || defined(SOUNDEMITTERSYSTEM_DLL) #include "SoundEmitterSystem/isoundemittersystembase.h" -#include "interval.h" +#include "tier2/interval.h" #include "soundchars.h" +#include "KeyValues.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -339,29 +340,42 @@ CSoundParametersInternal::CSoundParametersInternal() had_missing_wave_files = false; uses_gender_token = false; + // TERROR: + m_pGameData = NULL; + } CSoundParametersInternal::CSoundParametersInternal( const CSoundParametersInternal& src ) { m_pSoundNames = NULL; m_pConvertedNames = NULL; + // TERROR: + m_pGameData = NULL; + // TERROR: + m_pGameData = NULL; + CopyFrom( src ); } CSoundParametersInternal::~CSoundParametersInternal() { if ( m_nSoundNames > 1 ) - delete m_pSoundNames; + free(m_pSoundNames ); if ( m_nConvertedNames > 1 ) - delete m_pConvertedNames; + free( m_pConvertedNames); + + m_pConvertedNames = NULL; + m_pSoundNames = NULL; + m_nSoundNames = 0; + m_nConvertedNames = 0; } void CSoundParametersInternal::CopyFrom( const CSoundParametersInternal& src ) { if ( m_nSoundNames > 1 ) - delete m_pSoundNames; + free(m_pSoundNames); if ( m_nConvertedNames > 1 ) - delete m_pConvertedNames; + free(m_pConvertedNames); channel = src.channel; volume = src.volume; @@ -375,7 +389,7 @@ void CSoundParametersInternal::CopyFrom( const CSoundParametersInternal& src ) { if ( m_nSoundNames > 1 ) { - m_pSoundNames = new SoundFile[m_nSoundNames]; + m_pSoundNames = (SoundFile*)malloc( sizeof(SoundFile)*m_nSoundNames); memcpy( m_pSoundNames, src.m_pSoundNames, m_nSoundNames * sizeof(SoundFile) ); } else @@ -393,7 +407,7 @@ void CSoundParametersInternal::CopyFrom( const CSoundParametersInternal& src ) { if ( m_nConvertedNames > 1 ) { - m_pConvertedNames = new SoundFile[m_nConvertedNames]; + m_pConvertedNames = (SoundFile*)malloc( sizeof(SoundFile)*m_nConvertedNames); memcpy( m_pConvertedNames, src.m_pConvertedNames, m_nConvertedNames * sizeof(SoundFile) ); } else diff --git a/public/appframework/IAppSystem.h b/public/appframework/IAppSystem.h index 1552725cd..7e1acea06 100644 --- a/public/appframework/IAppSystem.h +++ b/public/appframework/IAppSystem.h @@ -32,6 +32,15 @@ enum InitReturnVal_t INIT_LAST_VAL, }; +enum AppSystemTier_t +{ + APP_SYSTEM_TIER0 = 0, + APP_SYSTEM_TIER1, + APP_SYSTEM_TIER2, + APP_SYSTEM_TIER3, + + APP_SYSTEM_TIER_OTHER, +}; abstract_class IAppSystem { diff --git a/public/basehandle.h b/public/basehandle.h index 492a20b3a..e02ddd313 100644 --- a/public/basehandle.h +++ b/public/basehandle.h @@ -92,10 +92,10 @@ inline CBaseHandle::CBaseHandle( int iEntry, int iSerialNumber ) inline void CBaseHandle::Init( int iEntry, int iSerialNumber ) { - Assert( iEntry >= 0 && iEntry < NUM_ENT_ENTRIES ); + Assert( iEntry >= 0 && (iEntry & ENT_ENTRY_MASK) == iEntry); Assert( iSerialNumber >= 0 && iSerialNumber < (1 << NUM_SERIAL_NUM_BITS) ); - m_Index = iEntry | (iSerialNumber << NUM_ENT_ENTRY_BITS); + m_Index = iEntry | (iSerialNumber << NUM_SERIAL_NUM_SHIFT_BITS); } inline void CBaseHandle::Term() @@ -110,12 +110,26 @@ inline bool CBaseHandle::IsValid() const inline int CBaseHandle::GetEntryIndex() const { + // There is a hack here: due to a bug in the original implementation of the + // entity handle system, an attempt to look up an invalid entity index in + // certain cirumstances might fall through to the the mask operation below. + // This would mask an invalid index to be in fact a lookup of entity number + // NUM_ENT_ENTRIES, so invalid ent indexes end up actually looking up the + // last slot in the entities array. Since this slot is always empty, the + // lookup returns NULL and the expected behavior occurs through this unexpected + // route. + // A lot of code actually depends on this behavior, and the bug was only exposed + // after a change to NUM_SERIAL_NUM_BITS increased the number of allowable + // static props in the world. So the if-stanza below detects this case and + // retains the prior (bug-submarining) behavior. + if ( !IsValid() ) + return NUM_ENT_ENTRIES-1; return m_Index & ENT_ENTRY_MASK; } inline int CBaseHandle::GetSerialNumber() const { - return m_Index >> NUM_ENT_ENTRY_BITS; + return m_Index >> NUM_SERIAL_NUM_SHIFT_BITS; } inline int CBaseHandle::ToInt() const diff --git a/public/bittools.h b/public/bittools.h new file mode 100644 index 000000000..8efd19984 --- /dev/null +++ b/public/bittools.h @@ -0,0 +1,46 @@ +//===== Copyright © 1996-2009, Valve Corporation, All rights reserved. ======// +// +// Purpose: +// +// $NoKeywords: $ +//===========================================================================// + +#ifndef BITTOOLS_H +#define BITTOOLS_H +#ifdef _WIN32 +#pragma once +#endif + +namespace bittools +{ + template + struct RecurseBit + { + enum {result = RecurseBit::result}; + }; + + template + struct RecurseBit<0, C> + { + enum {result = C}; + }; + + template + struct RecursePow2 + { + enum {result = RecursePow2::result}; + }; + + template + struct RecursePow2<0, C> + { + enum {result = C}; + }; + +} + +#define ROUND_TO_POWER_OF_2( n ) ( bittools::RecursePow2< (n) - 1 >::result ) +#define MINIMUM_BITS_NEEDED( n ) ( bittools::RecurseBit< (n) - 1 >::result ) + +#endif //BITTOOLS_H + diff --git a/public/bitvec.h b/public/bitvec.h index c14a41056..be13e3f58 100644 --- a/public/bitvec.h +++ b/public/bitvec.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -574,8 +574,8 @@ inline CBitVecAccessor CBitVecT::operator[](int i) template inline void CBitVecT::Init( int val ) { - if ( CBitVecT::Base() ) - memset( CBitVecT::Base(), ( val ) ? 0xff : 0, CBitVecT::GetNumDWords() * sizeof(int) ); + if ( this->Base() ) + memset( this->Base(), ( val ) ? 0xff : 0, this->GetNumDWords() * sizeof(int) ); } //----------------------------------------------------------------------------- @@ -636,7 +636,7 @@ inline void CBitVecT::Clear(int bitNum) template inline void CBitVecT::Set( int bitNum, bool bNewVal ) { - uint32 *pInt = CBitVecT::Base() + BitVec_Int( bitNum ); + uint32 *pInt = this->Base() + BitVec_Int( bitNum ); uint32 bitMask = BitVec_Bit( bitNum ); if ( bNewVal ) { @@ -653,7 +653,7 @@ inline void CBitVecT::Set( int bitNum, bool bNewVal ) template inline void CBitVecT::Set( uint32 offset, uint32 mask ) { - uint32 *pInt = CBitVecT::Base() + offset; + uint32 *pInt = this->Base() + offset; *pInt |= mask; } @@ -662,7 +662,7 @@ inline void CBitVecT::Set( uint32 offset, uint32 mask ) template inline void CBitVecT::Clear( uint32 offset, uint32 mask ) { - uint32 *pInt = CBitVecT::Base() + offset; + uint32 *pInt = this->Base() + offset; *pInt &= ~mask; } @@ -671,7 +671,7 @@ inline void CBitVecT::Clear( uint32 offset, uint32 mask ) template inline uint32 CBitVecT::Get( uint32 offset, uint32 mask ) { - uint32 *pInt = CBitVecT::Base() + offset; + uint32 *pInt = this->Base() + offset; return ( *pInt & mask ); } @@ -687,10 +687,10 @@ inline void CBitVecT::And(const CBitVecT &addStr, CBitVecT *out) const ValidateOperand( *out ); uint32 * pDest = out->Base(); - const uint32 *pOperand1 = CBitVecT::Base(); + const uint32 *pOperand1 = this->Base(); const uint32 *pOperand2 = addStr.Base(); - for (int i = CBitVecT::GetNumDWords() - 1; i >= 0 ; --i) + for (int i = this->GetNumDWords() - 1; i >= 0 ; --i) { pDest[i] = pOperand1[i] & pOperand2[i]; } @@ -708,10 +708,10 @@ inline void CBitVecT::Or(const CBitVecT &orStr, CBitVecT *out) const ValidateOperand( *out ); uint32 * pDest = out->Base(); - const uint32 *pOperand1 = CBitVecT::Base(); + const uint32 *pOperand1 = this->Base(); const uint32 *pOperand2 = orStr.Base(); - for (int i = CBitVecT::GetNumDWords() - 1; i >= 0; --i) + for (int i = this->GetNumDWords() - 1; i >= 0; --i) { pDest[i] = pOperand1[i] | pOperand2[i]; } @@ -726,10 +726,10 @@ template inline void CBitVecT::Xor(const CBitVecT &xorStr, CBitVecT *out) const { uint32 * pDest = out->Base(); - const uint32 *pOperand1 = CBitVecT::Base(); + const uint32 *pOperand1 = this->Base(); const uint32 *pOperand2 = xorStr.Base(); - for (int i = CBitVecT::GetNumDWords() - 1; i >= 0; --i) + for (int i = this->GetNumDWords() - 1; i >= 0; --i) { pDest[i] = pOperand1[i] ^ pOperand2[i]; } @@ -746,9 +746,9 @@ inline void CBitVecT::Not(CBitVecT *out) const ValidateOperand( *out ); uint32 * pDest = out->Base(); - const uint32 *pOperand = CBitVecT::Base(); + const uint32 *pOperand = this->Base(); - for (int i = CBitVecT::GetNumDWords() - 1; i >= 0; --i) + for (int i = this->GetNumDWords() - 1; i >= 0; --i) { pDest[i] = ~(pOperand[i]); } @@ -762,12 +762,12 @@ inline void CBitVecT::Not(CBitVecT *out) const template inline void CBitVecT::CopyTo(CBitVecT *out) const { - out->Resize( CBitVecT::GetNumBits() ); + out->Resize( this->GetNumBits() ); ValidateOperand( *out ); Assert( out != this ); - memcpy( out->Base(), CBitVecT::Base(), CBitVecT::GetNumDWords() * sizeof( int ) ); + memcpy( out->Base(), this->Base(), this->GetNumDWords() * sizeof( int ) ); } //----------------------------------------------------------------------------- @@ -781,11 +781,11 @@ inline bool CBitVecT::IsAllClear(void) const // Number of available bits may be more than the number // actually used, so make sure to mask out unused bits // before testing for zero - (const_cast(this))->Base()[CBitVecT::GetNumDWords()-1] &= CBitVecT::GetEndMask(); // external semantics of const retained + (const_cast(this))->Base()[this->GetNumDWords()-1] &= CBitVecT::GetEndMask(); // external semantics of const retained - for (int i = CBitVecT::GetNumDWords() - 1; i >= 0; --i) + for (int i = this->GetNumDWords() - 1; i >= 0; --i) { - if ( CBitVecT::Base()[i] !=0 ) + if ( this->Base()[i] !=0 ) { return false; } @@ -804,11 +804,11 @@ inline bool CBitVecT::IsAllSet(void) const // Number of available bits may be more than the number // actually used, so make sure to mask out unused bits // before testing for set bits - (const_cast(this))->Base()[CBitVecT::GetNumDWords()-1] |= ~CBitVecT::GetEndMask(); // external semantics of const retained + (const_cast(this))->Base()[this->GetNumDWords()-1] |= ~CBitVecT::GetEndMask(); // external semantics of const retained - for (int i = CBitVecT::GetNumDWords() - 1; i >= 0; --i) + for (int i = this->GetNumDWords() - 1; i >= 0; --i) { - if ( CBitVecT::Base()[i] != ~0 ) + if ( this->Base()[i] != ~0 ) { return false; } @@ -824,8 +824,8 @@ inline bool CBitVecT::IsAllSet(void) const template inline void CBitVecT::SetAll(void) { - if ( CBitVecT::Base() ) - memset( CBitVecT::Base(), 0xff, CBitVecT::GetNumDWords() * sizeof(int) ); + if ( this->Base() ) + memset( this->Base(), 0xff, this->GetNumDWords() * sizeof(int) ); } //----------------------------------------------------------------------------- @@ -836,8 +836,8 @@ inline void CBitVecT::SetAll(void) template inline void CBitVecT::ClearAll(void) { - if ( CBitVecT::Base() ) - memset( CBitVecT::Base(), 0, CBitVecT::GetNumDWords() * sizeof(int) ); + if ( this->Base() ) + memset( this->Base(), 0, this->GetNumDWords() * sizeof(int) ); } //----------------------------------------------------------------------------- @@ -849,12 +849,12 @@ inline void CBitVecT::Copy( const CBitVecT &other, int nBits nBits = other.GetNumBits(); } - CBitVecT::Resize( nBits ); + this->Resize( nBits ); ValidateOperand( other ); Assert( &other != this ); - memcpy( CBitVecT::Base(), other.Base(), CBitVecT::GetNumDWords() * sizeof( uint32 ) ); + memcpy( this->Base(), other.Base(), this->GetNumDWords() * sizeof( uint32 ) ); } //----------------------------------------------------------------------------- @@ -863,7 +863,7 @@ inline bool CBitVecT::Compare( const CBitVecT &other, int nB { if ( nBits == - 1 ) { - if ( other.GetNumBits() != CBitVecT::GetNumBits() ) + if ( other.GetNumBits() != this->GetNumBits() ) { return false; } @@ -871,33 +871,33 @@ inline bool CBitVecT::Compare( const CBitVecT &other, int nB nBits = other.GetNumBits(); } - if ( nBits > other.GetNumBits() || nBits > CBitVecT::GetNumBits() ) + if ( nBits > other.GetNumBits() || nBits > this->GetNumBits() ) { return false; } - (const_cast(this))->Base()[CBitVecT::GetNumDWords()-1] &= CBitVecT::GetEndMask(); // external semantics of const retained - (const_cast(&other))->Base()[CBitVecT::GetNumDWords()-1] &= other.CBitVecT::GetEndMask(); // external semantics of const retained + (const_cast(this))->Base()[this->GetNumDWords()-1] &= CBitVecT::GetEndMask(); // external semantics of const retained + (const_cast(&other))->Base()[this->GetNumDWords()-1] &= other.CBitVecT::GetEndMask(); // external semantics of const retained int nBytes = PAD_NUMBER( nBits, 8 ) >> 3; - return ( memcmp( CBitVecT::Base(), other.Base(), nBytes ) == 0 ); + return ( memcmp( this->Base(), other.Base(), nBytes ) == 0 ); } //----------------------------------------------------------------------------- template inline uint32 CBitVecT::GetDWord(int i) const { - Assert(i >= 0 && i < CBitVecT::GetNumDWords()); - return CBitVecT::Base()[i]; + Assert(i >= 0 && i < this->GetNumDWords()); + return this->Base()[i]; } //----------------------------------------------------------------------------- template inline void CBitVecT::SetDWord(int i, uint32 val) { - Assert(i >= 0 && i < CBitVecT::GetNumDWords()); - CBitVecT::Base()[i] = val; + Assert(i >= 0 && i < this->GetNumDWords()); + this->Base()[i] = val; } //----------------------------------------------------------------------------- diff --git a/public/bone_accessor.cpp b/public/bone_accessor.cpp index ddd49624b..fb54cf873 100644 --- a/public/bone_accessor.cpp +++ b/public/bone_accessor.cpp @@ -7,6 +7,9 @@ #include "cbase.h" #include "bone_accessor.h" +// NOTE: This has to be the last file included! +#include "tier0/memdbgon.h" + #if defined( CLIENT_DLL ) && defined( _DEBUG ) diff --git a/public/bone_accessor.h b/public/bone_accessor.h index 32e4dd144..665ee24bb 100644 --- a/public/bone_accessor.h +++ b/public/bone_accessor.h @@ -22,11 +22,11 @@ class CBoneAccessor public: CBoneAccessor(); - CBoneAccessor( matrix3x4_t *pBones ); // This can be used to allow access to all bones. + CBoneAccessor( matrix3x4a_t *pBones ); // This can be used to allow access to all bones. // Initialize. #if defined( CLIENT_DLL ) - void Init( const C_BaseAnimating *pAnimating, matrix3x4_t *pBones ); + void Init( const C_BaseAnimating *pAnimating, matrix3x4a_t *pBones ); #endif int GetReadableBones(); @@ -36,11 +36,11 @@ class CBoneAccessor void SetWritableBones( int flags ); // Get bones for read or write access. - const matrix3x4_t& GetBone( int iBone ) const; - const matrix3x4_t& operator[]( int iBone ) const; - matrix3x4_t& GetBoneForWrite( int iBone ); + const matrix3x4a_t& GetBone( int iBone ) const; + const matrix3x4a_t& operator[]( int iBone ) const; + matrix3x4a_t& GetBoneForWrite( int iBone ); - matrix3x4_t *GetBoneArrayForWrite( ) const; + matrix3x4a_t *GetBoneArrayForWrite( ) const; private: @@ -51,7 +51,7 @@ class CBoneAccessor // Only used in the client DLL for debug verification. const C_BaseAnimating *m_pAnimating; - matrix3x4_t *m_pBones; + matrix3x4a_t *m_pBones; int m_ReadableBones; // Which bones can be read. int m_WritableBones; // Which bones can be written. @@ -65,14 +65,14 @@ inline CBoneAccessor::CBoneAccessor() m_ReadableBones = m_WritableBones = 0; } -inline CBoneAccessor::CBoneAccessor( matrix3x4_t *pBones ) +inline CBoneAccessor::CBoneAccessor( matrix3x4a_t *pBones ) { m_pAnimating = NULL; m_pBones = pBones; } #if defined( CLIENT_DLL ) - inline void CBoneAccessor::Init( const C_BaseAnimating *pAnimating, matrix3x4_t *pBones ) + inline void CBoneAccessor::Init( const C_BaseAnimating *pAnimating, matrix3x4a_t *pBones ) { m_pAnimating = pAnimating; m_pBones = pBones; @@ -99,7 +99,7 @@ inline void CBoneAccessor::SetWritableBones( int flags ) m_WritableBones = flags; } -inline const matrix3x4_t& CBoneAccessor::GetBone( int iBone ) const +inline const matrix3x4a_t& CBoneAccessor::GetBone( int iBone ) const { #if defined( CLIENT_DLL ) && defined( _DEBUG ) SanityCheckBone( iBone, true ); @@ -107,7 +107,7 @@ inline const matrix3x4_t& CBoneAccessor::GetBone( int iBone ) const return m_pBones[iBone]; } -inline const matrix3x4_t& CBoneAccessor::operator[]( int iBone ) const +inline const matrix3x4a_t& CBoneAccessor::operator[]( int iBone ) const { #if defined( CLIENT_DLL ) && defined( _DEBUG ) SanityCheckBone( iBone, true ); @@ -115,7 +115,7 @@ inline const matrix3x4_t& CBoneAccessor::operator[]( int iBone ) const return m_pBones[iBone]; } -inline matrix3x4_t& CBoneAccessor::GetBoneForWrite( int iBone ) +inline matrix3x4a_t& CBoneAccessor::GetBoneForWrite( int iBone ) { #if defined( CLIENT_DLL ) && defined( _DEBUG ) SanityCheckBone( iBone, false ); @@ -123,7 +123,7 @@ inline matrix3x4_t& CBoneAccessor::GetBoneForWrite( int iBone ) return m_pBones[iBone]; } -inline matrix3x4_t *CBoneAccessor::GetBoneArrayForWrite( void ) const +inline matrix3x4a_t *CBoneAccessor::GetBoneArrayForWrite( void ) const { return m_pBones; } diff --git a/public/bone_setup.h b/public/bone_setup.h index f4e0fd03c..e8b3e103e 100644 --- a/public/bone_setup.h +++ b/public/bone_setup.h @@ -20,6 +20,7 @@ class CBoneToWorld; class CIKContext; class CBoneAccessor; +class IPoseDebugger; // This provides access to networked arrays, so if this code actually changes a value, @@ -47,8 +48,6 @@ class CBoneBitList : public CBitVec }; - - //----------------------------------------------------------------------------- // Purpose: blends together all the bones from two p:q lists // @@ -61,67 +60,29 @@ void SlerpBones( Vector pos1[MAXSTUDIOBONES], mstudioseqdesc_t &seqdesc, // source of q2 and pos2 int sequence, - const Quaternion q2[MAXSTUDIOBONES], + const QuaternionAligned q2[MAXSTUDIOBONES], const Vector pos2[MAXSTUDIOBONES], float s, int boneMask ); -void InitPose( - const CStudioHdr *pStudioHdr, - Vector pos[], - Quaternion q[], - int boneMask - ); - -void CalcPose( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, //optional - Vector pos[], - Quaternion q[], - int sequence, - float cycle, - const float poseParameter[], - int boneMask, - float flWeight = 1.0f, - float flTime = 0.0f - ); - -bool CalcPoseSingle( - const CStudioHdr *pStudioHdr, - Vector pos[], - Quaternion q[], - mstudioseqdesc_t &seqdesc, - int sequence, - float cycle, - const float poseParameter[], - int boneMask, - float flTime - ); - -void AccumulatePose( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, //optional - Vector pos[], - Quaternion q[], - int sequence, - float cycle, - const float poseParameter[], - int boneMask, - float flWeight, - float flTime - ); +class CBoneSetup; +class IBoneSetup +{ +public: + IBoneSetup( const CStudioHdr *pStudioHdr, int boneMask, const float poseParameter[], IPoseDebugger *pPoseDebugger = NULL ); + ~IBoneSetup( void ); + void InitPose( Vector pos[], QuaternionAligned q[] ); + void AccumulatePose( Vector pos[], Quaternion q[], int sequence, float cycle, float flWeight, float flTime, CIKContext *pIKContext ); + void CalcAutoplaySequences( Vector pos[], Quaternion q[], float flRealTime, CIKContext *pIKContext ); + void CalcBoneAdj( Vector pos[], Quaternion q[], const float controllers[] ); -// takes a "controllers[]" array normalized to 0..1 and adds in the adjustments to pos[], and q[]. -void CalcBoneAdj( - const CStudioHdr *pStudioHdr, - Vector pos[], - Quaternion q[], - const float controllers[], - int boneMask - ); + CStudioHdr *GetStudioHdr(); +private: + CBoneSetup *m_pBoneSetup; +}; // Given two samples of a bone separated in time by dt, // compute the velocity and angular velocity of that bone @@ -142,19 +103,19 @@ void SetupSingleBoneMatrix( // Purpose: build boneToWorld transforms for a specific bone void BuildBoneChain( const CStudioHdr *pStudioHdr, - const matrix3x4_t &rootxform, + const matrix3x4a_t &rootxform, const Vector pos[], const Quaternion q[], int iBone, - matrix3x4_t *pBoneToWorld ); + matrix3x4a_t *pBoneToWorld ); void BuildBoneChain( const CStudioHdr *pStudioHdr, - const matrix3x4_t &rootxform, + const matrix3x4a_t &rootxform, const Vector pos[], const Quaternion q[], int iBone, - matrix3x4_t *pBoneToWorld, + matrix3x4a_t *pBoneToWorld, CBoneBitList &boneComputed ); @@ -220,7 +181,7 @@ class CIKTarget private: // internally latched footset, position struct x1 { - // matrix3x4_t worldTarget; + // matrix3x4a_t worldTarget; bool bNeedsLatch; bool bHasLatch; float influence; @@ -300,11 +261,11 @@ struct ikcontextikrule_t }; -void Studio_AlignIKMatrix( matrix3x4_t &mMat, const Vector &vAlignTo ); +void Studio_AlignIKMatrix( matrix3x4a_t &mMat, const Vector &vAlignTo ); -bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, matrix3x4_t* pBoneToWorld ); +bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, matrix3x4a_t* pBoneToWorld ); -bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vector &targetKneePos, Vector &targetKneeDir, matrix3x4_t* pBoneToWorld ); +bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vector &targetKneePos, Vector &targetKneeDir, matrix3x4a_t* pBoneToWorld ); @@ -316,9 +277,9 @@ class CIKContext void AddDependencies( mstudioseqdesc_t &seqdesc, int iSequence, float flCycle, const float poseParameters[], float flWeight = 1.0f ); void ClearTargets( void ); - void UpdateTargets( Vector pos[], Quaternion q[], matrix3x4_t boneToWorld[], CBoneBitList &boneComputed ); + void UpdateTargets( Vector pos[], Quaternion q[], matrix3x4a_t boneToWorld[], CBoneBitList &boneComputed ); void AutoIKRelease( void ); - void SolveDependencies( Vector pos[], Quaternion q[], matrix3x4_t boneToWorld[], CBoneBitList &boneComputed ); + void SolveDependencies( Vector pos[], Quaternion q[], matrix3x4a_t boneToWorld[], CBoneBitList &boneComputed ); void AddAutoplayLocks( Vector pos[], Quaternion q[] ); void SolveAutoplayLocks( Vector pos[], Quaternion q[] ); @@ -329,7 +290,7 @@ class CIKContext void AddAllLocks( Vector pos[], Quaternion q[] ); void SolveAllLocks( Vector pos[], Quaternion q[] ); - void SolveLock( const mstudioiklock_t *plock, int i, Vector pos[], Quaternion q[], matrix3x4_t boneToWorld[], CBoneBitList &boneComputed ); + void SolveLock( const mstudioiklock_t *plock, int i, Vector pos[], Quaternion q[], matrix3x4a_t boneToWorld[], CBoneBitList &boneComputed ); CUtlVectorFixed< CIKTarget, 12 > m_target; @@ -338,12 +299,12 @@ class CIKContext CStudioHdr const *m_pStudioHdr; bool Estimate( int iSequence, float flCycle, int iTarget, const float poseParameter[], float flWeight = 1.0f ); - void BuildBoneChain( const Vector pos[], const Quaternion q[], int iBone, matrix3x4_t *pBoneToWorld, CBoneBitList &boneComputed ); + void BuildBoneChain( const Vector pos[], const Quaternion q[], int iBone, matrix3x4a_t *pBoneToWorld, CBoneBitList &boneComputed ); // virtual IK rules, filtered and combined from each sequence CUtlVector< CUtlVector< ikcontextikrule_t > > m_ikChainRule; CUtlVector< ikcontextikrule_t > m_ikLock; - matrix3x4_t m_rootxform; + matrix3x4a_t m_rootxform; int m_iFramecounter; float m_flTime; @@ -355,16 +316,6 @@ class CIKContext // Purpose: //----------------------------------------------------------------------------- -// takes a "poseparameters[]" array normalized to 0..1 and layers on the sequences driven by them -void CalcAutoplaySequences( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, //optional - Vector pos[], - Quaternion q[], - const float poseParameters[], - int boneMask, - float time - ); // replaces the bonetoworld transforms for all bones that are procedural bool CalcProceduralBone( @@ -380,7 +331,8 @@ void Studio_BuildMatrices( const Vector pos[], const Quaternion q[], int iBone, - matrix3x4_t bonetoworld[MAXSTUDIOBONES], + float flScale, + matrix3x4a_t bonetoworld[MAXSTUDIOBONES], int boneMask ); @@ -401,6 +353,7 @@ float Studio_SetController( const CStudioHdr *pStudioHdr, int iController, float // return value = value in bone space float Studio_GetController( const CStudioHdr *pStudioHdr, int iController, float ctlValue ); +void Studio_CalcDefaultPoseParameters( const CStudioHdr *pStudioHdr, float flPoseParameter[MAXSTUDIOPOSEPARAM], int nCount ); float Studio_GetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, float ctlValue ); float Studio_SetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, float flValue, float &ctlValue ); @@ -413,6 +366,7 @@ float Studio_FPS( const CStudioHdr *pStudioHdr, int iSequence, const float poseP float Studio_CPS( const CStudioHdr *pStudioHdr, mstudioseqdesc_t &seqdesc, int iSequence, const float poseParameter[] ); float Studio_Duration( const CStudioHdr *pStudioHdr, int iSequence, const float poseParameter[] ); void Studio_MovementRate( const CStudioHdr *pStudioHdr, int iSequence, const float poseParameter[], Vector *pVec ); +float Studio_SeqMovementAndDuration( const CStudioHdr *pStudioHdr, int iSequence, float flCycleFrom, float flCycleTo, const float poseParameter[], Vector &deltaPos ); // void Studio_Movement( const CStudioHdr *pStudioHdr, int iSequence, const float poseParameter[], Vector *pVec ); @@ -435,7 +389,7 @@ FORWARD_DECLARE_HANDLE( memhandle_t ); struct bonecacheparams_t { CStudioHdr *pStudioHdr; - matrix3x4_t *pBoneToWorld; + matrix3x4a_t *pBoneToWorld; float curtime; int boneMask; }; @@ -461,7 +415,7 @@ class CBoneCache void Init( const bonecacheparams_t ¶ms, unsigned int size, short *pStudioToCached, short *pCachedToStudio, int cachedBoneCount ); void UpdateBones( const matrix3x4_t *pBoneToWorld, int numbones, float curtime ); - matrix3x4_t *GetCachedBone( int studioIndex ); + matrix3x4a_t *GetCachedBone( int studioIndex ); void ReadCachedBones( matrix3x4_t *pBoneToWorld ); void ReadCachedBonePointers( matrix3x4_t **bones, int numbones ); @@ -472,7 +426,7 @@ class CBoneCache int m_boneMask; private: - matrix3x4_t *BoneArray(); + matrix3x4a_t *BoneArray(); short *StudioToCached(); short *CachedToStudio(); @@ -483,18 +437,89 @@ class CBoneCache unsigned short m_boneOutOffset; }; -CBoneCache *Studio_GetBoneCache( memhandle_t cacheHandle ); +void Studio_LockBoneCache(); +void Studio_UnlockBoneCache(); + +CBoneCache *Studio_GetBoneCache( memhandle_t cacheHandle, bool bLock = false ); +void Studio_ReleaseBoneCache( memhandle_t cacheHandle ); memhandle_t Studio_CreateBoneCache( bonecacheparams_t ¶ms ); void Studio_DestroyBoneCache( memhandle_t cacheHandle ); void Studio_InvalidateBoneCache( memhandle_t cacheHandle ); // Given a ray, trace for an intersection with this studiomodel. Get the array of bones from StudioSetupHitboxBones -bool TraceToStudio( class IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHdr *pStudioHdr, mstudiohitboxset_t *set, matrix3x4_t **hitboxbones, int fContentsMask, trace_t &trace ); - +bool TraceToStudio( class IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHdr *pStudioHdr, mstudiohitboxset_t *set, matrix3x4_t **hitboxbones, int fContentsMask, const Vector &vecOrigin, float flScale, trace_t &trace ); +// TERROR: TraceToStudio variant that prioritizes hitgroups, so bullets can pass through arms and chest to hit the head, for instance +bool TraceToStudioGrouped( IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHdr *pStudioHdr, mstudiohitboxset_t *set, + matrix3x4_t **hitboxbones, int fContentsMask, trace_t &tr, const CUtlVector< int > &sortedHitgroups ); void QuaternionSM( float s, const Quaternion &p, const Quaternion &q, Quaternion &qt ); void QuaternionMA( const Quaternion &p, float s, const Quaternion &q, Quaternion &qt ); bool Studio_PrefetchSequence( const CStudioHdr *pStudioHdr, int iSequence ); -#endif // BONE_SETUP_H +void Studio_RunBoneFlexDrivers( float *pFlexController, const CStudioHdr *pStudioHdr, const Vector *pPositions, const matrix3x4_t *pBoneToWorld, const matrix3x4_t &mRootToWorld ); + +//----------------------------------------------------------------------------- +// Computes a number of twist bones given a parent/child pair +// pqTwists, pflWeights, pqTwistBinds must all have at least nCount elements +//----------------------------------------------------------------------------- +void ComputeTwistBones( + Quaternion *pqTwists, + int nCount, + bool bInverse, + const Vector &vUp, + const Quaternion &qParent, + const matrix3x4_t &mChild, + const Quaternion &qBaseInv, + const float *pflWeights, + const Quaternion *pqTwistBinds ); + + + +//----------------------------------------------------------------------------- +// Find the non-linear transforms that fit a model with attachments to another model with attachments +//----------------------------------------------------------------------------- + +class CAttachmentFit +{ +public: + CAttachmentFit() { + m_bHasConverged = false; + m_localCenter.Init(); + m_posError.Init(); + m_bHasPosition = false; + m_scaleError.Init(); + m_rotError = quat_identity; + }; + + void LocalTransform( const matrix3x4_t &matFollowBoneToWorld, matrix3x4_t &matLocalBoneToWorld ); + + int m_nFollowBone; // bone to follow, as taken from attachment matches + CUtlVector< int > m_nLocalAtt; // index of local attachments + CUtlVector< int > m_nFollowAtt; // index of attachments that are being followed + + bool m_bHasConverged; // solution for this bone converged + Vector m_localCenter; // idealized rotation center of attachments + Vector m_posError; // accumulated position error to add to transform + bool m_bHasPosition; // flag to not calc rotation/scale until position error has been estimated + Vector m_scaleError; // accumulated axis independant scale error (relative to 1) + Quaternion m_rotError; // accumulated rotation error +}; + +class CAttachmentFitter +{ +public: + CAttachmentFitter( CStudioHdr *pStudioHdr, CStudioHdr *pFollowParent ); + bool Converg( const matrix3x4_t *pFollowBoneToWorld, matrix3x4_t *pLocalBoneToWorld ); + bool LocalTransform( int iBone, const matrix3x4_t *pFollowBoneToWorld, matrix3x4_t *pLocalBoneToWorld ); + bool IsValid( void ) { return (m_pFits.Count() > 0); } + +private: + bool m_bHasConverged; + CStudioHdr *m_pLocalHdr; + CStudioHdr *m_pFollowHdr; + + CUtlVector< CAttachmentFit *> m_pFits; // indexed by bones +}; + +#endif // BONE_SETUP_H \ No newline at end of file diff --git a/public/collisionutils.cpp b/public/collisionutils.cpp index c3013299b..6ee8f846f 100644 --- a/public/collisionutils.cpp +++ b/public/collisionutils.cpp @@ -1374,6 +1374,14 @@ bool IntersectRayWithOBB( const Vector &vecRayStart, const Vector &vecRayDelta, if ( !IntersectRayWithBox( start, extent, vecOBBMins, vecOBBMaxs, flTolerance, pTrace ) ) return false; + // Fix up the start/end pos and fraction + Vector vecTemp; + VectorTransform( pTrace->endpos, matOBBToWorld, vecTemp ); + pTrace->endpos = vecTemp; + + pTrace->startpos = vecRayStart; + pTrace->fraction *= 2.0f; + // Fix up the plane information float flSign = pTrace->plane.normal[ pTrace->plane.type ]; pTrace->plane.normal[0] = flSign * matOBBToWorld[0][pTrace->plane.type]; @@ -1381,6 +1389,7 @@ bool IntersectRayWithOBB( const Vector &vecRayStart, const Vector &vecRayDelta, pTrace->plane.normal[2] = flSign * matOBBToWorld[2][pTrace->plane.type]; pTrace->plane.dist = DotProduct( pTrace->endpos, pTrace->plane.normal ); pTrace->plane.type = 3; + return true; } @@ -1917,9 +1926,9 @@ QuadBarycentricRetval_t PointInQuadToBarycentric( const Vector &v1, const Vector // NOTE: axisU[0][projAxes[0]] < axisU[0][projAxes[1]], // this is done to decrease error when dividing later // - if( FloatMakePositive( axisU[0][(int)projAxes[0]] ) < FloatMakePositive( axisU[0][(int)projAxes[1]] ) ) + if( FloatMakePositive( axisU[0][projAxes[0]] ) < FloatMakePositive( axisU[0][projAxes[1]] ) ) { - int tmp = (int)projAxes[0]; + int tmp = projAxes[0]; projAxes[0] = projAxes[1]; projAxes[1] = tmp; } @@ -1948,21 +1957,21 @@ QuadBarycentricRetval_t PointInQuadToBarycentric( const Vector &v1, const Vector double s = 0.0, t = 0.0; double A, negB, C; - A = ( axisU[0][(int)projAxes[1]] * axisV[0][(int)projAxes[0]] ) - - ( axisU[0][(int)projAxes[0]] * axisV[0][(int)projAxes[1]] ) - - ( axisU[1][(int)projAxes[1]] * axisV[0][(int)projAxes[0]] ) + - ( axisU[1][(int)projAxes[0]] * axisV[0][(int)projAxes[1]] ); - C = ( v1[(int)projAxes[1]] * axisU[0][(int)projAxes[0]] ) - - ( point[(int)projAxes[1]] * axisU[0][(int)projAxes[0]] ) - - ( v1[(int)projAxes[0]] * axisU[0][(int)projAxes[1]] ) + - ( point[(int)projAxes[0]] * axisU[0][(int)projAxes[1]] ); + A = ( axisU[0][projAxes[1]] * axisV[0][projAxes[0]] ) - + ( axisU[0][projAxes[0]] * axisV[0][projAxes[1]] ) - + ( axisU[1][projAxes[1]] * axisV[0][projAxes[0]] ) + + ( axisU[1][projAxes[0]] * axisV[0][projAxes[1]] ); + C = ( v1[projAxes[1]] * axisU[0][projAxes[0]] ) - + ( point[projAxes[1]] * axisU[0][projAxes[0]] ) - + ( v1[projAxes[0]] * axisU[0][projAxes[1]] ) + + ( point[projAxes[0]] * axisU[0][projAxes[1]] ); negB = C - - ( v1[(int)projAxes[1]] * axisU[1][(int)projAxes[0]] ) + - ( point[(int)projAxes[1]] * axisU[1][(int)projAxes[0]] ) + - ( v1[(int)projAxes[0]] * axisU[1][(int)projAxes[1]] ) - - ( point[(int)projAxes[0]] * axisU[1][(int)projAxes[1]] ) + - ( axisU[0][(int)projAxes[1]] * axisV[0][(int)projAxes[0]] ) - - ( axisU[0][(int)projAxes[0]] * axisV[0][(int)projAxes[1]] ); + ( v1[projAxes[1]] * axisU[1][projAxes[0]] ) + + ( point[projAxes[1]] * axisU[1][projAxes[0]] ) + + ( v1[projAxes[0]] * axisU[1][projAxes[1]] ) - + ( point[projAxes[0]] * axisU[1][projAxes[1]] ) + + ( axisU[0][projAxes[1]] * axisV[0][projAxes[0]] ) - + ( axisU[0][projAxes[0]] * axisV[0][projAxes[1]] ); if( ( A > -PIQ_PLANE_EPSILON ) && ( A < PIQ_PLANE_EPSILON ) ) { @@ -2008,7 +2017,7 @@ QuadBarycentricRetval_t PointInQuadToBarycentric( const Vector &v1, const Vector double QPlus = ( negB + quad ) / ( 2.0f * A ); double QMinus = ( negB - quad ) / ( 2.0f * A ); - ResolveQuadratic( QPlus, QMinus, axisU[0], axisU[1], axisV[0], axisV[1], v1, point, (int)projAxes[0], s, t ); + ResolveQuadratic( QPlus, QMinus, axisU[0], axisU[1], axisV[0], axisV[1], v1, point, projAxes[0], s, t ); } if( !bFlipped ) @@ -3250,4 +3259,148 @@ bool RayHasFullyContainedIntersectionWithQuad( const Ray_t &ray, return true; //there were lines crossing the quad plane, and every line crossing that plane had its intersection with the plane within the quad's boundaries } +//----------------------------------------------------------------------------- +// Purpose: override how single player rays hit the player +//----------------------------------------------------------------------------- + +bool LineCircleIntersection(const Vector2D ¢er, + const float radius, + const Vector2D &vLinePt, + const Vector2D &vLineDir, + float *fIntersection1, + float *fIntersection2) +{ + // Line = P + Vt + // Sphere = r (assume we've translated to origin) + // (P + Vt)^2 = r^2 + // VVt^2 + 2PVt + (PP - r^2) + // Solve as quadratic: (-b +/- sqrt(b^2 - 4ac)) / 2a + // If (b^2 - 4ac) is < 0 there is no solution. + // If (b^2 - 4ac) is = 0 there is one solution + // If (b^2 - 4ac) is > 0 there are two solutions. + + // Translate circle to origin. + const Vector2D P( vLinePt - center ); + + const float a = vLineDir.Dot(vLineDir); + const float b = 2.0f * P.Dot(vLineDir); + const float c = P.Dot(P) - (radius * radius); + + const float insideSqr = b*b - 4*a*c; + + // No solution - (b^2 - 4ac) is < 0 + if( insideSqr < -1.0e-6f ) + { + return false; + } + else + { + const float sqr = (float)FastSqrt(insideSqr); + const float denom = 1.0 / (2.0f * a); + const float t0 = (-b - sqr) * denom; + const float t1 = (-b + sqr) * denom; + + // One solution - (b^2 - 4ac) is = 0 + if( insideSqr < 1.0e-6f ) + { + // a = 0 if the line direction is the zero vector, in which case, + // the line starts inside the circle but will never exit. We fudge + // it for this case and say it intersects at the origin of the line. + // Otherwise, the result is the smallest positive result + *fIntersection1 = *fIntersection2 = ( a == 0.0f ) ? 0.0f : ( t0 < 0 ? t1 : t0 ); + Assert( !IS_NAN(*fIntersection1) ); + + // Started inside of the sphere (the only way we get one solution, unless + // the ray direction is the zero vector) + return c < 0; + } + // Two solutions - (b^2 - 4ac) is > 0 + else + { + *fIntersection1 = t0; + *fIntersection2 = t1; + } + + return true; + } +} + +bool IntersectRayWithAACylinder( const Ray_t &ray, + const Vector ¢er, float radius, float height, CBaseTrace *pTrace ) +{ + Assert( ray.m_IsRay ); + Collision_ClearTrace( ray.m_Start, ray.m_Delta, pTrace ); + + // First intersect the ray with the top + bottom planes + float halfHeight = height * 0.5; + + // Handle parallel case + Vector vStart = ray.m_Start - center; + Vector vEnd = vStart + ray.m_Delta; + + float flEnterFrac, flLeaveFrac; + if (FloatMakePositive(ray.m_Delta.z) < 1e-8) + { + if ( (vStart.z < -halfHeight) || (vStart.z > halfHeight) ) + { + return false; // no hit + } + flEnterFrac = 0.0f; flLeaveFrac = 1.0f; + } + else + { + // Clip the ray to the top and bottom of box + flEnterFrac = IntersectRayWithAAPlane( vStart, vEnd, 2, 1, halfHeight); + flLeaveFrac = IntersectRayWithAAPlane( vStart, vEnd, 2, 1, -halfHeight); + + if ( flLeaveFrac < flEnterFrac ) + { + float temp = flLeaveFrac; + flLeaveFrac = flEnterFrac; + flEnterFrac = temp; + } + + if ( flLeaveFrac < 0 || flEnterFrac > 1) + { + return false; + } + } + + // Intersect with circle + float flCircleEnterFrac, flCircleLeaveFrac; + if ( !LineCircleIntersection( vec3_origin.AsVector2D(), radius, + vStart.AsVector2D(), ray.m_Delta.AsVector2D(), &flCircleEnterFrac, &flCircleLeaveFrac ) ) + { + return false; // no hit + } + + Assert( flCircleEnterFrac <= flCircleLeaveFrac ); + if ( flCircleLeaveFrac < 0 || flCircleEnterFrac > 1) + { + return false; + } + + if ( flEnterFrac < flCircleEnterFrac ) + flEnterFrac = flCircleEnterFrac; + if ( flLeaveFrac > flCircleLeaveFrac ) + flLeaveFrac = flCircleLeaveFrac; + + if ( flLeaveFrac < flEnterFrac ) + return false; + + VectorMA( ray.m_Start, flEnterFrac , ray.m_Delta, pTrace->endpos ); + pTrace->fraction = flEnterFrac; + pTrace->contents = CONTENTS_SOLID; + + // Calculate the point on our center line where we're nearest the intersection point + Vector collisionCenter; + CalcClosestPointOnLineSegment( pTrace->endpos, center + Vector( 0, 0, halfHeight ), center - Vector( 0, 0, halfHeight ), collisionCenter ); + + // Our normal is the direction from that center point to the intersection point + pTrace->plane.normal = pTrace->endpos - collisionCenter; + VectorNormalize( pTrace->plane.normal ); + + return true; +} + #endif // !_STATIC_LINKED || _SHARED_LIB diff --git a/public/collisionutils.h b/public/collisionutils.h index 35cc3e30d..d59705682 100644 --- a/public/collisionutils.h +++ b/public/collisionutils.h @@ -190,6 +190,27 @@ bool IsBoxIntersectingSphere( const Vector& boxMin, const Vector& boxMax, bool IsBoxIntersectingSphereExtents( const Vector& boxCenter, const Vector& boxHalfDiag, const Vector& center, float radius ); + +//----------------------------------------------------------------------------- +// Returns true if a box intersects with a sphere +// NOTE: f4RadiusSq must have the radius sq in all components +//----------------------------------------------------------------------------- +FORCEINLINE bool IsBoxIntersectingSphere( const Vector& boxMin, const Vector& boxMax, + const fltx4& f4Center, const fltx4& f4RadiusSq ) +{ + // See Graphics Gems, box-sphere intersection + fltx4 f4Mins = LoadUnalignedSIMD( &boxMin.x ); + fltx4 f4Maxs = LoadUnalignedSIMD( &boxMax.x ); + fltx4 f4MinDelta = SubSIMD( f4Mins, f4Center ); + fltx4 f4MaxDelta = SubSIMD( f4Center, f4Maxs ); + f4MinDelta = MaxSIMD( f4MinDelta, Four_Zeros ); + f4MaxDelta = MaxSIMD( f4MaxDelta, Four_Zeros ); + fltx4 f4Delta = AddSIMD( f4MinDelta, f4MaxDelta ); + fltx4 f4DistSq = Dot3SIMD( f4Delta, f4Delta ); + return IsAllGreaterThan( f4RadiusSq, f4DistSq ); +} + + //----------------------------------------------------------------------------- // returns true if there's an intersection between ray and sphere //----------------------------------------------------------------------------- @@ -423,6 +444,26 @@ bool RayHasFullyContainedIntersectionWithQuad( const Ray_t &ray, +//----------------------------------------------------------------------------- +// Compute the intersection of a line and a circle +//----------------------------------------------------------------------------- +bool LineCircleIntersection(const Vector2D ¢er, + const float radius, + const Vector2D &vLinePt, + const Vector2D &vLineDir, + float *fIntersection1, + float *fIntersection2); + + +//----------------------------------------------------------------------------- +// Find the intersection of a ray with an axis-aligned cylinder +//----------------------------------------------------------------------------- +bool IntersectRayWithAACylinder( const Ray_t &ray, + const Vector ¢er, + float radius, + float height, + CBaseTrace *pTrace ); + //----------------------------------------------------------------------------- // INLINES //----------------------------------------------------------------------------- diff --git a/public/const.h b/public/const.h index ea82d4c44..5f44760c8 100644 --- a/public/const.h +++ b/public/const.h @@ -25,14 +25,21 @@ #define INVALID_STEAM_LOGGED_IN_ELSEWHERE "This Steam account is being used in another location\n" // This is the default, see shareddefs.h for mod-specific value, which can override this -#define DEFAULT_TICK_INTERVAL (0.015) // 15 msec is the default +#define DEFAULT_TICK_INTERVAL (1.0f / 60.0f) // 16.666667 msec is the default #define MINIMUM_TICK_INTERVAL (0.001) #define MAXIMUM_TICK_INTERVAL (0.1) // This is the max # of players the engine can handle -#define ABSOLUTE_PLAYER_LIMIT 255 // not 256, so we can send the limit as a byte +// Note, must be power of 2 +#define ABSOLUTE_PLAYER_LIMIT 64 #define ABSOLUTE_PLAYER_LIMIT_DW ( (ABSOLUTE_PLAYER_LIMIT/32) + 1 ) +#if ABSOLUTE_PLAYER_LIMIT > 32 +#define CPlayerBitVec CBitVec +#else +#define CPlayerBitVec CDWordBitVec +#endif + // a player name may have 31 chars + 0 on the PC. // the 360 only allows 15 char + 0, but stick with the larger PC size for cross-platform communication #define MAX_PLAYER_NAME_LENGTH 32 @@ -63,12 +70,13 @@ #define SIGNED_GUID_LEN 32 // Hashed CD Key (32 hex alphabetic chars + 0 terminator ) // Used for networking ehandles. -#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 1) +#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 2) #define NUM_ENT_ENTRIES (1 << NUM_ENT_ENTRY_BITS) -#define ENT_ENTRY_MASK (NUM_ENT_ENTRIES - 1) #define INVALID_EHANDLE_INDEX 0xFFFFFFFF -#define NUM_SERIAL_NUM_BITS (32 - NUM_ENT_ENTRY_BITS) +#define NUM_SERIAL_NUM_BITS 16 // (32 - NUM_ENT_ENTRY_BITS) +#define NUM_SERIAL_NUM_SHIFT_BITS (32 - NUM_SERIAL_NUM_BITS) +#define ENT_ENTRY_MASK (( 1 << NUM_SERIAL_NUM_BITS) - 1) // Networked ehandles use less bits to encode the serial number. @@ -103,12 +111,12 @@ #define FL_ATCONTROLS (1<<6) // Player can't move, but keeps key inputs for controlling another entity #define FL_CLIENT (1<<7) // Is a player #define FL_FAKECLIENT (1<<8) // Fake client, simulated server side; don't send network messages to them +#define FL_INWATER (1<<9) // In water // NOTE if you move things up, make sure to change this value -#define PLAYER_FLAG_BITS 9 +#define PLAYER_FLAG_BITS 10 // NON-PLAYER SPECIFIC (i.e., not used by GameMovement or the client .dll ) -- Can still be applied to players, though -#define FL_INWATER (1<<9) // In water #define FL_FLY (1<<10) // Changes the SV_Movestep() behavior to not need to be on ground #define FL_SWIM (1<<11) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) #define FL_CONVEYOR (1<<12) @@ -130,6 +138,7 @@ #define FL_DISSOLVING (1<<28) // We're dissolving! #define FL_TRANSRAGDOLL (1<<29) // In the process of turning into a client side ragdoll. #define FL_UNBLOCKABLE_BY_PLAYER (1<<30) // pusher that can't be blocked by the player +#define FL_FREEZING (1<<31) // We're becoming frozen! // edict->movetype values enum MoveType_t @@ -201,8 +210,10 @@ enum SolidFlags_t FSOLID_USE_TRIGGER_BOUNDS = 0x0080, // Uses a special trigger bounds separate from the normal OBB FSOLID_ROOT_PARENT_ALIGNED = 0x0100, // Collisions are defined in root parent's local coordinate space FSOLID_TRIGGER_TOUCH_DEBRIS = 0x0200, // This trigger will touch debris objects + FSOLID_TRIGGER_TOUCH_PLAYER = 0x0400, // This trigger will touch only players + FSOLID_NOT_MOVEABLE = 0x0800, // Assume this object will not move - FSOLID_MAX_BITS = 10 + FSOLID_MAX_BITS = 12 }; //----------------------------------------------------------------------------- @@ -293,7 +304,7 @@ enum // if this is changed, update common/MaterialSystem/Sprite.cpp enum RenderMode_t { - kRenderNormal, // src + kRenderNormal = 0, // src kRenderTransColor, // c*a+dest*(1-a) kRenderTransTexture, // src*a+dest*(1-a) kRenderGlow, // src*a+dest -- No Z buffer checks -- Fixed size in screen space @@ -304,6 +315,8 @@ enum RenderMode_t kRenderTransAlphaAdd, // src + dest*(1-a) kRenderWorldGlow, // Same as kRenderGlow but not fixed size in screen space kRenderNone, // Don't render. + + kRenderModeCount, // must be last }; enum RenderFx_t @@ -313,26 +326,24 @@ enum RenderFx_t kRenderFxPulseFast, kRenderFxPulseSlowWide, kRenderFxPulseFastWide, + kRenderFxFadeSlow, kRenderFxFadeFast, kRenderFxSolidSlow, kRenderFxSolidFast, kRenderFxStrobeSlow, + kRenderFxStrobeFast, kRenderFxStrobeFaster, kRenderFxFlickerSlow, kRenderFxFlickerFast, kRenderFxNoDissipation, - kRenderFxDistort, // Distort/scale/translate flicker - kRenderFxHologram, // kRenderFxDistort + distance fade - kRenderFxExplode, // Scale up really big! - kRenderFxGlowShell, // Glowing Shell - kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) - kRenderFxEnvRain, // for environmental rendermode, make rain - kRenderFxEnvSnow, // " " " , make snow - kRenderFxSpotlight, // TEST CODE for experimental spotlight - kRenderFxRagdoll, // HACKHACK: TEST CODE for signalling death of a ragdoll character + + kRenderFxFadeOut, + kRenderFxFadeIn, kRenderFxPulseFastWider, + kRenderFxGlowShell, // Glowing Shell + kRenderFxMax }; @@ -360,6 +371,11 @@ enum Collision_Group_t COLLISION_GROUP_NPC_ACTOR, // Used so NPCs in scripts ignore the player. COLLISION_GROUP_NPC_SCRIPTED, // USed for NPCs in scripts that should not collide with each other + COLLISION_GROUP_PZ_CLIP, + + + + COLLISION_GROUP_DEBRIS_BLOCK_PROJECTILE, // Only collides with bullets LAST_SHARED_COLLISION_GROUP }; @@ -368,12 +384,25 @@ enum Collision_Group_t #define SOUND_NORMAL_CLIP_DIST 1000.0f +//----------------------------------------------------------------------------- +// Base light indices to avoid index collision +//----------------------------------------------------------------------------- + +enum +{ + LIGHT_INDEX_TE_DYNAMIC = 0x10000000, + LIGHT_INDEX_PLAYER_BRIGHT = 0x20000000, + LIGHT_INDEX_MUZZLEFLASH = 0x40000000, + LIGHT_INDEX_LOW_PRIORITY = 0x64000000, +}; + // How many networked area portals do we allow? #define MAX_AREA_STATE_BYTES 32 #define MAX_AREA_PORTAL_STATE_BYTES 24 // user message max payload size (note, this value is used by the engine, so MODs cannot change it) -#define MAX_USER_MSG_DATA 255 +#define MAX_USER_MSG_BITS 12 +#define MAX_USER_MSG_DATA ( ( 1 << ( MAX_USER_MSG_BITS - 3 ) ) - 1 ) #define MAX_ENTITY_MSG_DATA 255 #define SOURCE_MT @@ -385,5 +414,16 @@ class CThreadNullMutex; typedef CThreadNullMutex CSourceMutex; #endif +#if defined( CLIENT_DLL ) +#define IsServerDll() false +#define IsClientDll() true +#elif defined( GAME_DLL ) +#define IsServerDll() true +#define IsClientDll() false +#else +#define IsServerDll() false +#define IsClientDll() false +#endif + #endif diff --git a/public/datamap.h b/public/datamap.h index 40d7c3181..bddb18e58 100644 --- a/public/datamap.h +++ b/public/datamap.h @@ -66,6 +66,7 @@ typedef enum _fieldtypes FIELD_VECTOR2D, // 2 floats FIELD_INTEGER64, // 64bit integer + FIELD_VECTOR4D, // 4 floats FIELD_TYPECOUNT, // MUST BE LAST } fieldtype_t; @@ -98,6 +99,7 @@ DECLARE_FIELD_SIZE( FIELD_FLOAT, sizeof(float) ) DECLARE_FIELD_SIZE( FIELD_STRING, sizeof(int) ) DECLARE_FIELD_SIZE( FIELD_VECTOR, 3 * sizeof(float) ) DECLARE_FIELD_SIZE( FIELD_VECTOR2D, 2 * sizeof(float) ) +DECLARE_FIELD_SIZE( FIELD_VECTOR4D, 4 * sizeof( float ) ) DECLARE_FIELD_SIZE( FIELD_QUATERNION, 4 * sizeof(float)) DECLARE_FIELD_SIZE( FIELD_INTEGER, sizeof(int)) DECLARE_FIELD_SIZE( FIELD_INTEGER64, sizeof(int64)) @@ -126,50 +128,51 @@ DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, sizeof(int) ) #define ARRAYSIZE2D(p) (sizeof(p)/sizeof(p[0][0])) #define SIZE_OF_ARRAY(p) _ARRAYSIZE(p) -#define _FIELD(name, fieldtype, count, flags, mapname, tolerance) { fieldtype, #name, { offsetof(classNameTypedef, name), 0 }, count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, tolerance } -#define _FIELD_NETARRAY(array, i, fieldtype, count, flags, mapname, tolerance) { fieldtype, #array "[" #i "]", { offsetof(classNameTypedef, array) + offsetof(classNameTypedef::NetworkVar_##array, m_Value[i]), 0 }, count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->array ), NULL, 0, tolerance } -#define DEFINE_FIELD_NULL { FIELD_VOID,0, {0,0},0,0,0,0,0,0} +#define _FIELD(name,fieldtype,count,flags,mapname,tolerance) { fieldtype, #name, offsetof(classNameTypedef, name), count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, tolerance } +#define DEFINE_FIELD_NULL { FIELD_VOID,0,0,0,0,0,0,0,0} #define DEFINE_FIELD(name,fieldtype) _FIELD(name, fieldtype, 1, FTYPEDESC_SAVE, NULL, 0 ) +#define DEFINE_FIELD_NOT_SAVED(name,fieldtype) _FIELD(name, fieldtype, 1, 0, NULL, 0 ) + #define DEFINE_KEYFIELD(name,fieldtype, mapname) _FIELD(name, fieldtype, 1, FTYPEDESC_KEY | FTYPEDESC_SAVE, mapname, 0 ) -#define DEFINE_KEYFIELD_NETARRAY(array, i, fieldtype, mapname) _FIELD_NETARRAY(array, i, fieldtype, 1, FTYPEDESC_KEY | FTYPEDESC_SAVE, mapname, 0 ) #define DEFINE_KEYFIELD_NOT_SAVED(name,fieldtype, mapname)_FIELD(name, fieldtype, 1, FTYPEDESC_KEY, mapname, 0 ) #define DEFINE_AUTO_ARRAY(name,fieldtype) _FIELD(name, fieldtype, SIZE_OF_ARRAY(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, NULL, 0 ) #define DEFINE_AUTO_ARRAY_KEYFIELD(name,fieldtype,mapname) _FIELD(name, fieldtype, SIZE_OF_ARRAY(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, mapname, 0 ) #define DEFINE_ARRAY(name,fieldtype, count) _FIELD(name, fieldtype, count, FTYPEDESC_SAVE, NULL, 0 ) +#define DEFINE_ARRAY_NOT_SAVED(name,fieldtype, count) _FIELD(name, fieldtype, count, 0, NULL, 0 ) #define DEFINE_ENTITY_FIELD(name,fieldtype) _FIELD(edict_t, name, fieldtype, 1, FTYPEDESC_KEY | FTYPEDESC_SAVE, #name, 0 ) #define DEFINE_ENTITY_GLOBAL_FIELD(name,fieldtype) _FIELD(edict_t, name, fieldtype, 1, FTYPEDESC_KEY | FTYPEDESC_SAVE | FTYPEDESC_GLOBAL, #name, 0 ) #define DEFINE_GLOBAL_FIELD(name,fieldtype) _FIELD(name, fieldtype, 1, FTYPEDESC_GLOBAL | FTYPEDESC_SAVE, NULL, 0 ) #define DEFINE_GLOBAL_KEYFIELD(name,fieldtype, mapname) _FIELD(name, fieldtype, 1, FTYPEDESC_GLOBAL | FTYPEDESC_KEY | FTYPEDESC_SAVE, mapname, 0 ) -#define DEFINE_CUSTOM_FIELD(name,datafuncs) { FIELD_CUSTOM, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE, NULL, datafuncs, NULL } -#define DEFINE_CUSTOM_KEYFIELD(name,datafuncs,mapname) { FIELD_CUSTOM, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE | FTYPEDESC_KEY, mapname, datafuncs, NULL } +#define DEFINE_CUSTOM_FIELD(name,datafuncs) { FIELD_CUSTOM, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE, NULL, datafuncs, NULL } +#define DEFINE_CUSTOM_KEYFIELD(name,datafuncs,mapname) { FIELD_CUSTOM, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE | FTYPEDESC_KEY, mapname, datafuncs, NULL } #define DEFINE_AUTO_ARRAY2D(name,fieldtype) _FIELD(name, fieldtype, ARRAYSIZE2D(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, NULL, 0 ) // Used by byteswap datadescs #define DEFINE_BITFIELD(name,fieldtype,bitcount) DEFINE_ARRAY(name,fieldtype,((bitcount+FIELD_BITS(fieldtype)-1)&~(FIELD_BITS(fieldtype)-1)) / FIELD_BITS(fieldtype) ) #define DEFINE_INDEX(name,fieldtype) _FIELD(name, fieldtype, 1, FTYPEDESC_INDEX, NULL, 0 ) #define DEFINE_EMBEDDED( name ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE, NULL, NULL, NULL, &(((classNameTypedef *)0)->name.m_DataMap), sizeof( ((classNameTypedef *)0)->name ), NULL, 0, 0.0f } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE, NULL, NULL, NULL, &(((classNameTypedef *)0)->name.m_DataMap), sizeof( ((classNameTypedef *)0)->name ), NULL, 0, 0.0f } #define DEFINE_EMBEDDED_OVERRIDE( name, overridetype ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE, NULL, NULL, NULL, &((overridetype *)0)->m_DataMap, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, 0.0f } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE, NULL, NULL, NULL, &((overridetype *)0)->m_DataMap, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, 0.0f } #define DEFINE_EMBEDDEDBYREF( name ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE | FTYPEDESC_PTR, NULL, NULL, NULL, &(((classNameTypedef *)0)->name->m_DataMap), sizeof( *(((classNameTypedef *)0)->name) ), NULL, 0, 0.0f } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE | FTYPEDESC_PTR, NULL, NULL, NULL, &(((classNameTypedef *)0)->name->m_DataMap), sizeof( *(((classNameTypedef *)0)->name) ), NULL, 0, 0.0f } #define DEFINE_EMBEDDED_ARRAY( name, count ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, count, FTYPEDESC_SAVE, NULL, NULL, NULL, &(((classNameTypedef *)0)->name->m_DataMap), sizeof( ((classNameTypedef *)0)->name[0] ), NULL, 0, 0.0f } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), count, FTYPEDESC_SAVE, NULL, NULL, NULL, &(((classNameTypedef *)0)->name->m_DataMap), sizeof( ((classNameTypedef *)0)->name[0] ), NULL, 0, 0.0f } #define DEFINE_EMBEDDED_AUTO_ARRAY( name ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, SIZE_OF_ARRAY( ((classNameTypedef *)0)->name ), FTYPEDESC_SAVE, NULL, NULL, NULL, &(((classNameTypedef *)0)->name->m_DataMap), sizeof( ((classNameTypedef *)0)->name[0] ), NULL, 0, 0.0f } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), SIZE_OF_ARRAY( ((classNameTypedef *)0)->name ), FTYPEDESC_SAVE, NULL, NULL, NULL, &(((classNameTypedef *)0)->name->m_DataMap), sizeof( ((classNameTypedef *)0)->name[0] ), NULL, 0, 0.0f } #ifndef NO_ENTITY_PREDICTION // FTYPEDESC_KEY tells the prediction copy system to report the full nameof the field when reporting errors #define DEFINE_PRED_TYPEDESCRIPTION( name, fieldtype ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE, NULL, NULL, NULL, &fieldtype::m_PredMap } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE | FTYPEDESC_KEY, NULL, NULL, NULL, &fieldtype::m_PredMap } #define DEFINE_PRED_TYPEDESCRIPTION_PTR( name, fieldtype ) \ - { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE | FTYPEDESC_PTR, NULL, NULL, NULL, &fieldtype::m_PredMap } + { FIELD_EMBEDDED, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_SAVE | FTYPEDESC_PTR | FTYPEDESC_KEY, NULL, NULL, NULL, &fieldtype::m_PredMap } #else @@ -190,18 +193,18 @@ DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, sizeof(int) ) //#define DEFINE_DATA( name, fieldextname, flags ) _FIELD(name, fieldtype, 1, flags, extname ) // INPUTS -#define DEFINE_INPUT( name, fieldtype, inputname ) { fieldtype, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_INPUT | FTYPEDESC_SAVE | FTYPEDESC_KEY, inputname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ) } -#define DEFINE_INPUTFUNC( fieldtype, inputname, inputfunc ) { fieldtype, #inputfunc, { 0, 0 }, 1, FTYPEDESC_INPUT, inputname, NULL, static_cast (&classNameTypedef::inputfunc) } +#define DEFINE_INPUT( name, fieldtype, inputname ) { fieldtype, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_INPUT | FTYPEDESC_SAVE | FTYPEDESC_KEY, inputname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ) } +#define DEFINE_INPUTFUNC( fieldtype, inputname, inputfunc ) { fieldtype, #inputfunc, NULL, 1, FTYPEDESC_INPUT, inputname, NULL, static_cast (&classNameTypedef::inputfunc) } // OUTPUTS // the variable 'name' MUST BE derived from CBaseOutput // we know the output type from the variable itself, so it doesn't need to be specified here class ISaveRestoreOps; extern ISaveRestoreOps *eventFuncs; -#define DEFINE_OUTPUT( name, outputname ) { FIELD_CUSTOM, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_OUTPUT | FTYPEDESC_SAVE | FTYPEDESC_KEY, outputname, eventFuncs } +#define DEFINE_OUTPUT( name, outputname ) { FIELD_CUSTOM, #name, offsetof(classNameTypedef, name), 1, FTYPEDESC_OUTPUT | FTYPEDESC_SAVE | FTYPEDESC_KEY, outputname, eventFuncs } // replaces EXPORT table for portability and non-DLL based systems (xbox) -#define DEFINE_FUNCTION_RAW( function, func_type ) { FIELD_VOID, nameHolder.GenerateName(#function), { 0, 0 }, 1, FTYPEDESC_FUNCTIONTABLE, NULL, NULL, (inputfunc_t)((func_type)(&classNameTypedef::function)) } +#define DEFINE_FUNCTION_RAW( function, func_type ) { FIELD_VOID, nameHolder.GenerateName(#function), NULL, 1, FTYPEDESC_FUNCTIONTABLE, NULL, NULL, (inputfunc_t)((func_type)(&classNameTypedef::function)) } #define DEFINE_FUNCTION( function ) DEFINE_FUNCTION_RAW( function, inputfunc_t ) @@ -322,12 +325,22 @@ struct datamap_t // // Macros used to implement datadescs // +#define DECLARE_FRIEND_DATADESC_ACCESS() \ + template friend void DataMapAccess(T *, datamap_t **p); \ + template friend datamap_t *DataMapInit(T *); + #define DECLARE_SIMPLE_DATADESC() \ static datamap_t m_DataMap; \ static datamap_t *GetBaseMap(); \ template friend void DataMapAccess(T *, datamap_t **p); \ template friend datamap_t *DataMapInit(T *); +#define DECLARE_SIMPLE_DATADESC_INSIDE_NAMESPACE() \ + static datamap_t m_DataMap; \ + static datamap_t *GetBaseMap(); \ + template friend void ::DataMapAccess(T *, datamap_t **p); \ + template friend datamap_t *::DataMapInit(T *); + #define DECLARE_DATADESC() \ DECLARE_SIMPLE_DATADESC() \ virtual datamap_t *GetDataDescMap( void ); @@ -369,7 +382,25 @@ struct datamap_t className::m_DataMap.baseMap = className::GetBaseMap(); \ static typedescription_t dataDesc[] = \ { \ - { FIELD_VOID,0, {0,0},0,0,0,0,0,0}, /* so you can define "empty" tables */ + { FIELD_VOID,0,0,0,0,0,0,0,0}, /* so you can define "empty" tables */ + + +#define BEGIN_DATADESC_GUTS_NAMESPACE( className, nameSpace ) \ + template datamap_t *nameSpace::DataMapInit(T *); \ + template <> datamap_t *nameSpace::DataMapInit( className * ); \ + namespace className##_DataDescInit \ + { \ + datamap_t *g_DataMapHolder = nameSpace::DataMapInit( (className *)NULL ); /* This can/will be used for some clean up duties later */ \ + } \ + \ + template <> datamap_t *nameSpace::DataMapInit( className * ) \ + { \ + typedef className classNameTypedef; \ + static CDatadescGeneratedNameHolder nameHolder(#className); \ + className::m_DataMap.baseMap = className::GetBaseMap(); \ + static typedescription_t dataDesc[] = \ + { \ + { FIELD_VOID,0,0,0,0,0,0,0,0}, /* so you can define "empty" tables */ #define END_DATADESC() \ }; \ diff --git a/public/dt_common.h b/public/dt_common.h index 6dcbf90cb..de9a49333 100644 --- a/public/dt_common.h +++ b/public/dt_common.h @@ -18,6 +18,11 @@ #include "tier1/strtools.h" #include +#ifdef LINUX +#undef offsetof +#define offsetof(s,m) (size_t)&(((s *)0)->m) +#endif + // Max number of properties in a datatable and its children. #define MAX_DATATABLES 1024 // must be a power of 2. #define MAX_DATATABLE_PROPS 4096 @@ -115,6 +120,7 @@ typedef enum #if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!! DPT_Quaternion, #endif + DPT_Int64, DPT_NUMSendPropTypes } SendPropType; @@ -163,6 +169,9 @@ class DVariant case DPT_DataTable : Q_snprintf( text, sizeof(text), "DataTable" ); break; + case DPT_Int64: + Q_snprintf( text, sizeof(text), "%I64d", m_Int64 ); + break; default : Q_snprintf( text, sizeof(text), "DVariant type %i unknown", m_Type ); break; @@ -182,6 +191,7 @@ class DVariant #else float m_Vector[3]; #endif + int64 m_Int64; }; SendPropType m_Type; }; diff --git a/public/dt_send.cpp b/public/dt_send.cpp index ffc1c1773..6794ee346 100644 --- a/public/dt_send.cpp +++ b/public/dt_send.cpp @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -25,6 +25,7 @@ static CNonModifiedPointerProxy *s_pNonModifiedPointerProxyHead = NULL; void SendProxy_UInt8ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID); void SendProxy_UInt16ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID); void SendProxy_UInt32ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID); +void SendProxy_UInt64ToInt64( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID); const char *s_ElementNames[MAX_ARRAY_ELEMENTS] = { @@ -148,10 +149,12 @@ CStandardSendProxiesV1::CStandardSendProxiesV1() m_Int8ToInt32 = SendProxy_Int8ToInt32; m_Int16ToInt32 = SendProxy_Int16ToInt32; m_Int32ToInt32 = SendProxy_Int32ToInt32; + m_Int64ToInt64 = SendProxy_Int64ToInt64; m_UInt8ToInt32 = SendProxy_UInt8ToInt32; m_UInt16ToInt32 = SendProxy_UInt16ToInt32; m_UInt32ToInt32 = SendProxy_UInt32ToInt32; + m_UInt64ToInt64 = SendProxy_UInt64ToInt64; m_FloatToFloat = SendProxy_FloatToFloat; m_VectorToVector = SendProxy_VectorToVector; @@ -160,7 +163,6 @@ CStandardSendProxiesV1::CStandardSendProxiesV1() CStandardSendProxies::CStandardSendProxies() { m_DataTableToDataTable = SendProxy_DataTableToDataTable; - m_SendLocalDataTable = SendProxy_SendLocalDataTable; m_ppNonModifiedPointerProxies = &s_pNonModifiedPointerProxyHead; } @@ -203,6 +205,14 @@ void SendProxy_VectorToVector( const SendProp *pProp, const void *pStruct, const pOut->m_Vector[2] = v[2]; } +void SendProxy_VectorXYToVectorXY( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID) +{ + Vector& v = *(Vector*)pData; + Assert( v.IsValid() ); + pOut->m_Vector[0] = v[0]; + pOut->m_Vector[1] = v[1]; +} + #if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!! void SendProxy_QuaternionToQuaternion( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID) { @@ -230,6 +240,17 @@ void SendProxy_Int32ToInt32( const SendProp *pProp, const void *pStruct, const v pOut->m_Int = *((int*)pData); } +void SendProxy_Color32ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ) +{ + //Always send/receive as little endian to preserve byte order across network byte swaps + pOut->m_Int = LittleDWord( *((uint32 *)pData) ); +} + +void SendProxy_Int64ToInt64( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID) +{ + pOut->m_Int64 = *((int64*)pData); +} + void SendProxy_UInt8ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID) { pOut->m_Int = *((unsigned char*)pData); @@ -245,6 +266,11 @@ void SendProxy_UInt32ToInt32( const SendProp *pProp, const void *pStruct, const *((unsigned long*)&pOut->m_Int) = *((unsigned long*)pData); } +void SendProxy_UInt64ToInt64( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID) +{ + *((int64*)&pOut->m_Int64) = *((uint64*)pData); +} + void SendProxy_StringToString( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID) { pOut->m_pString = (char*)pData; @@ -264,25 +290,6 @@ static void SendProxy_Empty( const SendProp *pProp, const void *pStruct, const v { } -//----------------------------------------------------------------------------- -// Purpose: If the recipient is the same as objectID, go ahead and iterate down -// the m_Local stuff, otherwise, act like it wasn't there at all. -// This way, only the local player receives information about him/herself. -// Input : *pVarData - -// *pOut - -// objectID - -//----------------------------------------------------------------------------- - -void* SendProxy_SendLocalDataTable( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ) -{ - pRecipients->SetOnly( objectID - 1 ); - return ( void * )pVarData; -} - - - - - // ---------------------------------------------------------------------- // // Prop setup functions (for building tables). // ---------------------------------------------------------------------- // @@ -295,6 +302,8 @@ float AssignRangeMultiplier( int nBits, double range ) iHighValue = ((1 << (unsigned long)nBits) - 1); float fHighLowMul = iHighValue / range; + if ( CloseEnough( range, 0 ) ) + fHighLowMul = iHighValue; // If the precision is messing us up, then adjust it so it won't. if ( (unsigned long)(fHighLowMul * range) > iHighValue || @@ -303,7 +312,7 @@ float AssignRangeMultiplier( int nBits, double range ) // Squeeze it down smaller and smaller until it's going to produce an integer // in the valid range when given the highest value. float multipliers[] = { 0.9999, 0.99, 0.9, 0.8, 0.7 }; - size_t i; + int i; for ( i=0; i < ARRAYSIZE( multipliers ); i++ ) { float fHighLowMul = (float)( iHighValue / range ) * multipliers[i]; @@ -339,7 +348,8 @@ SendProp SendPropFloat( int flags, float fLowValue, // For floating point, low and high values. float fHighValue, // High value. If HIGH_DEFAULT, it's (1< m_Bits; + CPlayerBitVec m_Bits; }; inline void CSendProxyRecipients::SetAllRecipients() @@ -138,21 +141,6 @@ inline void CSendProxyRecipients::ClearAllRecipients() m_Bits.ClearAll(); } -inline void CSendProxyRecipients::SetRecipient( int iClient ) -{ - m_Bits.Set( iClient ); -} - -inline void CSendProxyRecipients::ClearRecipient( int iClient ) -{ - m_Bits.Clear( iClient ); -} - -inline void CSendProxyRecipients::SetOnly( int iClient ) -{ - m_Bits.ClearAll(); - m_Bits.Set( iClient ); -} @@ -596,7 +584,6 @@ inline void SendTable::SetHasPropsEncodedAgainstTickcount( bool bState ) #define SENDINFO_ARRAY(varName) #varName, offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName), sizeof(((currentSendDTClass*)0)->varName[0]) #define SENDINFO_ARRAY3(varName) #varName, offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName), sizeof(((currentSendDTClass*)0)->varName[0]), sizeof(((currentSendDTClass*)0)->varName)/sizeof(((currentSendDTClass*)0)->varName[0]) #define SENDINFO_ARRAYELEM(varName, i) #varName "[" #i "]", offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName[i]), sizeof(((currentSendDTClass*)0)->varName[0]) -#define SENDINFO_ARRAYELEM2(varName, i) #varName "[" #i "]", offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName) + offsetof(currentSendDTClass::MakeANetworkVar_##varName::NetworkVar_##varName, m_Value[i]), sizeof(((currentSendDTClass*)0)->varName[0]) #define SENDINFO_NETWORKARRAYELEM(varName, i)#varName "[" #i "]", offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName.m_Value[i]), sizeof(((currentSendDTClass*)0)->varName.m_Value[0]) // NOTE: Be VERY careful to specify any other vector elems for the same vector IN ORDER and @@ -604,14 +591,12 @@ inline void SendTable::SetHasPropsEncodedAgainstTickcount( bool bState ) // // Note: this macro specifies a negative offset so the engine can detect it and setup m_pNext #define SENDINFO_VECTORELEM(varName, i) #varName "[" #i "]", -(int)offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName.m_Value[i]), sizeof(((currentSendDTClass*)0)->varName.m_Value[0]) -#define SENDINFO_VECTORELEM2(varName, i, which) #varName "[" #i "]", -(int)offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName.m_Value.which), sizeof(((currentSendDTClass*)0)->varName.m_Value[0]) #define SENDINFO_STRUCTELEM(varName) #varName, offsetof(currentSendDTClass, varName), sizeof(((currentSendDTClass*)0)->varName.m_Value) #define SENDINFO_STRUCTARRAYELEM(varName, i)#varName "[" #i "]", offsetof(currentSendDTClass, varName.m_Value[i]), sizeof(((currentSendDTClass*)0)->varName.m_Value[0]) // Use this when you're not using a CNetworkVar to represent the data you're sending. #define SENDINFO_NOCHECK(varName) #varName, offsetof(currentSendDTClass, varName), sizeof(((currentSendDTClass*)0)->varName) -#define SENDINFO_NOCHECK_VECTORELEM(varName, i, which) #varName "[" #i "]", offsetof(currentSendDTClass, varName.which), sizeof(((currentSendDTClass*)0)->varName.which) #define SENDINFO_STRING_NOCHECK(varName) #varName, offsetof(currentSendDTClass, varName) #define SENDINFO_DT(varName) #varName, offsetof(currentSendDTClass, varName) #define SENDINFO_DT_NAME(varName, remoteVarName) #remoteVarName, offsetof(currentSendDTClass, varName) @@ -636,18 +621,17 @@ void SendProxy_QuaternionToQuaternion( const SendProp *pProp, const void *pStruc void SendProxy_Int8ToInt32 ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); void SendProxy_Int16ToInt32 ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); void SendProxy_Int32ToInt32 ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); +void SendProxy_Int64ToInt64 ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); +void SendProxy_Color32ToInt32 ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); void SendProxy_StringToString ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); + // pData is the address of a data table. void* SendProxy_DataTableToDataTable( const SendProp *pProp, const void *pStructBase, const void *pData, CSendProxyRecipients *pRecipients, int objectID ); // pData is the address of a pointer to a data table. void* SendProxy_DataTablePtrToDataTable( const SendProp *pProp, const void *pStructBase, const void *pData, CSendProxyRecipients *pRecipients, int objectID ); -// Used on player entities - only sends the data to the local player (objectID-1). -void* SendProxy_SendLocalDataTable( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ); - - // ------------------------------------------------------------------------ // // Use these functions to setup your data tables. // ------------------------------------------------------------------------ // @@ -766,6 +750,33 @@ SendProp SendPropArray3( +// +// Only use this if you change the array infrequently and you usually change all the elements +// when you do change it. +// +// The array data is all sent together, so even if you only change one element, +// it'll send all the elements. +// +// The upside is that it doesn't need extra bits to encode indices of all the variables. +// +#define SendPropArray_AllAtOnce( arrayName, propDefinition ) \ + SendPropArray( propDefinition, arrayName ) + + +// +// This is what you should use for most arrays. It will generate a separate SendProp for each array element +// in your array. That way, if you change one element of the array, it will only transmit that array element +// and not the whole array. +// +// Example: +// +// GenerateSendPropsForArrayElements( m_Array, SendPropInt( SENDINFO_ARRAY( m_Array ) ) +// +#define SendPropArray_UniqueElements( arrayName, propDefinition ) \ + SendPropArray3( SENDINFO_ARRAY3( arrayName ), propDefinition ) + + + // Use the macro to let it automatically generate a table name. You shouldn't // ever need to reference the table name. If you want to exclude this array, then // reference the name of the variable in varTemplate. diff --git a/public/dt_utlvector_common.cpp b/public/dt_utlvector_common.cpp index 537f36bce..640ae058a 100644 --- a/public/dt_utlvector_common.cpp +++ b/public/dt_utlvector_common.cpp @@ -9,10 +9,9 @@ #include "tier0/memdbgon.h" -#ifdef _DEBUG static CUtlDict *g_STDict = 0; static CUtlDict *g_RTDict = 0; -#endif + char* AllocateStringHelper2( const char *pFormat, va_list marker ) { diff --git a/public/dt_utlvector_common.h b/public/dt_utlvector_common.h index abc679dc0..d85fb819a 100644 --- a/public/dt_utlvector_common.h +++ b/public/dt_utlvector_common.h @@ -34,23 +34,30 @@ class UtlVectorTemplate pVec->AddMultipleToTail( len - pVec->Count() ); else if ( pVec->Count() > len ) pVec->RemoveMultiple( len, pVec->Count()-len ); + + // Ensure capacity + pVec->EnsureCapacity( len ); + + int nNumAllocated = pVec->NumAllocated(); + + // This is important to do because EnsureCapacity doesn't actually call the constructors + // on the elements, but we need them to be initialized, otherwise it'll have out-of-range + // values which will piss off the datatable encoder. + UtlVector_InitializeAllocatedElements( pVec->Base() + pVec->Count(), nNumAllocated - pVec->Count() ); } static void EnsureCapacity( void *pStruct, int offsetToUtlVector, int len ) { CUtlVector *pVec = (CUtlVector*)((char*)pStruct + offsetToUtlVector); + + pVec->EnsureCapacity( len ); - int oldNumAllocated = pVec->Count(); - - if ( oldNumAllocated < len ) - { - pVec->EnsureCapacity( len ); - - // This is important to do because EnsureCapacity doesn't actually call the constructors - // on the elements, but we need them to be initialized, otherwise it'll have out-of-range - // values which will piss off the datatable encoder. - UtlVector_InitializeAllocatedElements( pVec->Base() + oldNumAllocated, len - oldNumAllocated ); - } + int nNumAllocated = pVec->NumAllocated(); + + // This is important to do because EnsureCapacity doesn't actually call the constructors + // on the elements, but we need them to be initialized, otherwise it'll have out-of-range + // values which will piss off the datatable encoder. + UtlVector_InitializeAllocatedElements( pVec->Base() + pVec->Count(), nNumAllocated - pVec->Count() ); } }; diff --git a/public/dt_utlvector_send.cpp b/public/dt_utlvector_send.cpp index db73cf864..5c30b4b20 100644 --- a/public/dt_utlvector_send.cpp +++ b/public/dt_utlvector_send.cpp @@ -17,6 +17,16 @@ extern const char *s_ElementNames[MAX_ARRAY_ELEMENTS]; class CSendPropExtra_UtlVector { public: + CSendPropExtra_UtlVector() : + m_DataTableProxyFn( NULL ), + m_ProxyFn( NULL ), + m_EnsureCapacityFn( NULL ), + m_ElementStride( 0 ), + m_Offset( 0 ), + m_nMaxElements( 0 ) + { + } + SendTableProxyFn m_DataTableProxyFn; // If it's a datatable, then this is the proxy they specified. SendVarProxyFn m_ProxyFn; // If it's a non-datatable, then this is the proxy they specified. EnsureCapacityFn m_EnsureCapacityFn; diff --git a/public/engine_hlds_api.h b/public/engine_hlds_api.h index 05a24f413..635840325 100644 --- a/public/engine_hlds_api.h +++ b/public/engine_hlds_api.h @@ -48,6 +48,10 @@ class IDedicatedServerAPI : public IAppSystem virtual void UpdateStatus(float *fps, int *nActive, int *nMaxPlayers, char *pszMap, int maxlen ) = 0; // Get current Hostname to display in the hlds UI (console window title bar, e.g. ) virtual void UpdateHostname(char *pszHostname, int maxlen) = 0; + + // for the multi-processed fork() server, set the server instance number (1..) + virtual void SetSubProcessID( int nID, int nSocketHandle ) = 0; + }; #endif // ENGINE_HLDS_API_H diff --git a/public/entitydefs.h b/public/entitydefs.h new file mode 100644 index 000000000..8f9811b8f --- /dev/null +++ b/public/entitydefs.h @@ -0,0 +1,21 @@ +//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ==== +// +// Entity definitions needed by hammer, compile tools, and the game. +// +//============================================================================= + +#ifndef ENTITYDEFS_H +#define ENTITYDEFS_H +#ifdef _WIN32 +#pragma once +#endif + + +#define MAX_ENTITY_NAME_LEN 256 +#define MAX_IO_NAME_LEN 256 + +#define VMF_IOPARAM_STRING_DELIMITER 0x1b // Use ESC as a delimiter so we can pass commas etc. in I/O parameters + + +#endif // ENTITYDEFS_H + diff --git a/public/gamebspfile.h b/public/gamebspfile.h index 706577e5c..d0bd0efb1 100644 --- a/public/gamebspfile.h +++ b/public/gamebspfile.h @@ -34,7 +34,8 @@ enum { GAMELUMP_DETAIL_PROPS_VERSION = 4, GAMELUMP_DETAIL_PROP_LIGHTING_VERSION = 0, - GAMELUMP_STATIC_PROPS_VERSION = 6, + GAMELUMP_STATIC_PROPS_MIN_VERSION = 4, + GAMELUMP_STATIC_PROPS_VERSION = 9, GAMELUMP_STATIC_PROP_LIGHTING_VERSION = 0, GAMELUMP_DETAIL_PROP_LIGHTING_HDR_VERSION = 0, }; @@ -130,7 +131,7 @@ enum // These are set in WC STATIC_PROP_IGNORE_NORMALS = 0x8, STATIC_PROP_NO_SHADOW = 0x10, - STATIC_PROP_SCREEN_SPACE_FADE = 0x20, + STATIC_PROP_UNUSED = 0x20, STATIC_PROP_NO_PER_VERTEX_LIGHTING = 0x40, // in vrad, compute lighting at // lighting origin, not for each vertex @@ -140,6 +141,11 @@ enum STATIC_PROP_WC_MASK = 0xd8, // all flags settable in hammer (?) }; +enum +{ + STATIC_PROP_SCREEN_SPACE_FADE_OBSOLETE = 0x20, // only keeping these here to be able to report errors +}; + struct StaticPropDictLump_t { DECLARE_BYTESWAP_DATADESC(); @@ -181,7 +187,27 @@ struct StaticPropLumpV5_t // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump }; -struct StaticPropLump_t +struct StaticPropLumpV6_t +{ + DECLARE_BYTESWAP_DATADESC(); + Vector m_Origin; + QAngle m_Angles; + unsigned short m_PropType; + unsigned short m_FirstLeaf; + unsigned short m_LeafCount; + unsigned char m_Solid; + unsigned char m_Flags; + int m_Skin; + float m_FadeMinDist; + float m_FadeMaxDist; + Vector m_LightingOrigin; + float m_flForcedFadeScale; + unsigned short m_nMinDXLevel; + unsigned short m_nMaxDXLevel; + // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump +}; + +struct StaticPropLumpV7_t { DECLARE_BYTESWAP_DATADESC(); Vector m_Origin; @@ -199,6 +225,54 @@ struct StaticPropLump_t unsigned short m_nMinDXLevel; unsigned short m_nMaxDXLevel; // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump + color32 m_DiffuseModulation; // per instance color and alpha modulation +}; + +struct StaticPropLumpV8_t +{ + DECLARE_BYTESWAP_DATADESC(); + Vector m_Origin; + QAngle m_Angles; + unsigned short m_PropType; + unsigned short m_FirstLeaf; + unsigned short m_LeafCount; + unsigned char m_Solid; + unsigned char m_Flags; + int m_Skin; + float m_FadeMinDist; + float m_FadeMaxDist; + Vector m_LightingOrigin; + float m_flForcedFadeScale; + unsigned char m_nMinCPULevel; + unsigned char m_nMaxCPULevel; + unsigned char m_nMinGPULevel; + unsigned char m_nMaxGPULevel; + // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump + color32 m_DiffuseModulation; // per instance color and alpha modulation +}; + +struct StaticPropLump_t +{ + DECLARE_BYTESWAP_DATADESC(); + Vector m_Origin; + QAngle m_Angles; + unsigned short m_PropType; + unsigned short m_FirstLeaf; + unsigned short m_LeafCount; + unsigned char m_Solid; + unsigned char m_Flags; + int m_Skin; + float m_FadeMinDist; + float m_FadeMaxDist; + Vector m_LightingOrigin; + float m_flForcedFadeScale; + unsigned char m_nMinCPULevel; + unsigned char m_nMaxCPULevel; + unsigned char m_nMinGPULevel; + unsigned char m_nMaxGPULevel; + // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump + color32 m_DiffuseModulation; // per instance color and alpha modulation + bool m_bDisableX360; }; struct StaticPropLeafLump_t diff --git a/public/iachievementmgr.h b/public/iachievementmgr.h index b4b7f84e7..36027af27 100644 --- a/public/iachievementmgr.h +++ b/public/iachievementmgr.h @@ -26,21 +26,24 @@ abstract_class IAchievement virtual int GetPointValue() = 0; virtual bool ShouldSaveWithGame() = 0; virtual bool ShouldHideUntilAchieved() = 0; + virtual const char *GetIconPath() = 0; + virtual int GetDisplayOrder() = 0; }; abstract_class IAchievementMgr { public: - virtual IAchievement* GetAchievementByIndex( int index ) = 0; - virtual CBaseAchievement* GetAchievementByID ( int id ) = 0; + virtual IAchievement* GetAchievementByIndex( int index, int nPlayerSlot ) = 0; + virtual IAchievement* GetAchievementByDisplayOrder( int orderIndex, int nPlayerSlot ) = 0; + virtual CBaseAchievement* GetAchievementByID ( int id, int nPlayerSlot ) = 0; virtual int GetAchievementCount() = 0; - virtual void InitializeAchievements() = 0; - virtual void AwardAchievement( int iAchievementID ) = 0; - virtual void OnMapEvent( const char *pchEventName ) = 0; - virtual void DownloadUserData() = 0; - virtual void EnsureGlobalStateLoaded() = 0; - virtual void SaveGlobalStateIfDirty( bool bAsync ) = 0; + virtual void InitializeAchievements( ) = 0; + virtual void AwardAchievement( int nAchievementID, int nPlayerSlot ) = 0; + virtual void OnMapEvent( const char *pchEventName, int nPlayerSlot ) = 0; + virtual void SaveGlobalStateIfDirty( ) = 0; + virtual bool HasAchieved( const char *pchName, int nPlayerSlot ) = 0; + virtual const CUtlVector& GetAchievedDuringCurrentGame( int nPlayerSlot ) = 0; }; // flags for IAchievement::GetFlags @@ -54,6 +57,7 @@ abstract_class IAchievementMgr #define ACH_FILTER_ATTACKER_IS_PLAYER 0x0100 #define ACH_FILTER_VICTIM_IS_PLAYER_ENEMY 0x0200 #define ACH_FILTER_FULL_ROUND_ONLY 0x0400 +#define ACH_FILTER_LOCAL_PLAYER_EVENTS 0x0800 // Evaluate player-specific events only #define ACH_LISTEN_PLAYER_KILL_ENEMY_EVENTS ACH_LISTEN_KILL_EVENTS | ACH_FILTER_ATTACKER_IS_PLAYER | ACH_FILTER_VICTIM_IS_PLAYER_ENEMY #define ACH_LISTEN_KILL_ENEMY_EVENTS ACH_LISTEN_KILL_EVENTS | ACH_FILTER_VICTIM_IS_PLAYER_ENEMY @@ -74,3 +78,7 @@ abstract_class IAchievementMgr ( ACHIEVEMENT_LOCALIZED_DESC_FROM_STR( pAchievement->GetName() ) ) #endif // IACHIEVEMENTMGR_H + +// Special slot designations +#define SINGLE_PLAYER_SLOT 0 +#define STEAM_PLAYER_SLOT 0 \ No newline at end of file diff --git a/public/idedicatedexports.h b/public/idedicatedexports.h index c9f134120..fbd430086 100644 --- a/public/idedicatedexports.h +++ b/public/idedicatedexports.h @@ -20,6 +20,7 @@ abstract_class IDedicatedExports : public IAppSystem public: virtual void Sys_Printf( char *text ) = 0; virtual void RunServer() = 0; + virtual bool IsGuiDedicatedServer() = 0; }; #define VENGINE_DEDICATEDEXPORTS_API_VERSION "VENGINE_DEDICATEDEXPORTS_API_VERSION003" diff --git a/public/inetchannelinfo.h b/public/inetchannelinfo.h index 6fe89b01c..9f74e3938 100644 --- a/public/inetchannelinfo.h +++ b/public/inetchannelinfo.h @@ -32,6 +32,7 @@ class INetChannelInfo ENTITIES, // all other entity bytes SOUNDS, // game sounds EVENTS, // event messages + TEMPENTS, // temp entities USERMESSAGES, // user messages ENTMESSAGES, // entity messages VOICE, // voice data @@ -75,3 +76,5 @@ class INetChannelInfo }; #endif // INETCHANNELINFO_H + + diff --git a/public/inetmessage.h b/public/inetmessage.h index 0c3332f44..eceb87343 100644 --- a/public/inetmessage.h +++ b/public/inetmessage.h @@ -28,7 +28,7 @@ class INetMessage virtual void SetNetChannel(INetChannel * netchan) = 0; // netchannel this message is from/for virtual void SetReliable( bool state ) = 0; // set to true if it's a reliable message - virtual bool Process( void ) = 0; // calles the recently set handler to process this message + virtual bool Process( void ) = 0; // calls the recently set handler to process this message virtual bool ReadFromBuffer( bf_read &buffer ) = 0; // returns true if parsing was OK virtual bool WriteToBuffer( bf_write &buffer ) = 0; // returns true if writing was OK @@ -40,6 +40,7 @@ class INetMessage virtual const char *GetName( void ) const = 0; // returns network message name, eg "svc_serverinfo" virtual INetChannel *GetNetChannel( void ) const = 0; virtual const char *ToString( void ) const = 0; // returns a human readable string about message content + virtual size_t GetSize() const = 0; }; diff --git a/public/ispatialpartition.h b/public/ispatialpartition.h index cc783c556..c4adb0428 100644 --- a/public/ispatialpartition.h +++ b/public/ispatialpartition.h @@ -37,6 +37,8 @@ enum PARTITION_CLIENT_STATIC_PROPS = (1 << 5), PARTITION_ENGINE_STATIC_PROPS = (1 << 6), PARTITION_CLIENT_NON_STATIC_EDICTS = (1 << 7), // everything except the static props + PARTITION_CLIENT_TRIGGER_ENTITIES = (1 << 8), // client side prediction related triggers + PARTITION_CLIENT_IK_ATTACHMENT = (1 << 9), // Can be used as an IK attachment }; // Use this to look for all client edicts. @@ -44,7 +46,8 @@ enum PARTITION_CLIENT_NON_STATIC_EDICTS | \ PARTITION_CLIENT_STATIC_PROPS | \ PARTITION_CLIENT_RESPONSIVE_EDICTS | \ - PARTITION_CLIENT_SOLID_EDICTS \ + PARTITION_CLIENT_SOLID_EDICTS | \ + PARTITION_CLIENT_TRIGGER_ENTITIES \ ) @@ -92,7 +95,6 @@ class IPartitionEnumerator class IPartitionQueryCallback { public: - virtual void OnPreQuery_V1() = 0; virtual void OnPreQuery( SpatialPartitionListMask_t listMask ) = 0; virtual void OnPostQuery( SpatialPartitionListMask_t listMask ) = 0; }; @@ -144,7 +146,7 @@ abstract_class ISpatialPartition virtual void UnhideElement( SpatialPartitionHandle_t handle, SpatialTempHandle_t tempHandle ) = 0; // Installs callbacks to get called right before a query occurs - virtual void InstallQueryCallback_V1( IPartitionQueryCallback *pCallback ) = 0; + virtual void InstallQueryCallback( IPartitionQueryCallback *pCallback ) = 0; virtual void RemoveQueryCallback( IPartitionQueryCallback *pCallback ) = 0; // Gets all entities in a particular volume... @@ -201,8 +203,6 @@ abstract_class ISpatialPartition virtual void RenderObjectsAlongRay( const Ray_t& ray, float flTime ) = 0; virtual void ReportStats( const char *pFileName ) = 0; - - virtual void InstallQueryCallback( IPartitionQueryCallback *pCallback ) = 0; }; #endif diff --git a/public/ispsharedmemory.h b/public/ispsharedmemory.h new file mode 100644 index 000000000..13d6596e1 --- /dev/null +++ b/public/ispsharedmemory.h @@ -0,0 +1,27 @@ +//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +// +// Purpose: +// +//===========================================================================// + +#ifndef ISPSHAREDMEMORY_H +#define ISPSHAREDMEMORY_H +#ifdef _WIN32 +#pragma once +#endif + +#include "basetypes.h" +#include "platform.h" + +abstract_class ISPSharedMemory +{ +public: + virtual bool Init( size_t iSize ) = 0; //Initial implementation assumes the size is fixed/hardcoded, returns true if this call actually created the memory, false if it already existed + virtual uint8 * Base( void ) = 0; + virtual size_t Size( void ) = 0; + + virtual void AddRef( void ) = 0; + virtual void Release( void ) = 0; +}; + +#endif diff --git a/public/istudiorender.h b/public/istudiorender.h index e418d7469..20ceeec2b 100644 --- a/public/istudiorender.h +++ b/public/istudiorender.h @@ -20,6 +20,7 @@ #include "materialsystem/imaterialsystem.h" #include "appframework/IAppSystem.h" #include "datacache/imdlcache.h" +#include "tier0/fasttimer.h" #include "studio.h" @@ -42,6 +43,9 @@ struct FlashlightState_t; class VMatrix; namespace OptimizedModel { struct FileHeader_t; } class IPooledVBAllocator; +struct MeshInstanceData_t; +struct ShaderStencilState_t; + // undone: what's the standard for function type naming? typedef void (*StudioRender_Printf_t)( const char *fmt, ... ); @@ -113,7 +117,11 @@ enum STUDIORENDER_DRAW_ITEM_BLINK = 0x100, - STUDIORENDER_SHADOWDEPTHTEXTURE = 0x200 + STUDIORENDER_SHADOWDEPTHTEXTURE = 0x200, + + STUDIORENDER_NO_SKIN = 0x400, + + STUDIORENDER_SKIP_DECALS = 0x800, }; @@ -126,11 +134,7 @@ enum #define VERTEX_TEXCOORD0_2D ( ( (uint64) 2 ) << ( TEX_COORD_SIZE_BIT + ( 3*0 ) ) ) enum MaterialVertexFormat_t { - MATERIAL_VERTEX_FORMAT_MODEL_SKINNED = (VertexFormat_t) VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_BONEWEIGHT(2) | VERTEX_BONE_INDEX | VERTEX_USERDATA_SIZE(4), - MATERIAL_VERTEX_FORMAT_MODEL_SKINNED_DX7 = (VertexFormat_t) VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_BONEWEIGHT(2) | VERTEX_BONE_INDEX, - MATERIAL_VERTEX_FORMAT_MODEL = (VertexFormat_t) VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_USERDATA_SIZE(4), - MATERIAL_VERTEX_FORMAT_MODEL_DX7 = (VertexFormat_t) VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D, - MATERIAL_VERTEX_FORMAT_COLOR = (VertexFormat_t) VERTEX_SPECULAR + MATERIAL_VERTEX_FORMAT_MODEL = (VertexFormat_t) VERTEX_POSITION | VERTEX_COLOR_STREAM_1 | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_USERDATA_SIZE(4), }; @@ -195,9 +199,64 @@ struct DrawModelInfo_t int m_Lod; ColorMeshInfo_t *m_pColorMeshes; bool m_bStaticLighting; - Vector m_vecAmbientCube[6]; // ambient, and lights that aren't in locallight[] - int m_nLocalLightCount; - LightDesc_t m_LocalLightDescs[4]; + MaterialLightingState_t m_LightingState; +}; + +enum +{ + // This is because we store which flashlights are on which model + // in a 32-bit field (see ModelArrayInstanceData_t::m_nFlashlightUsage) + MAX_FLASHLIGHTS_PER_INSTANCE_DRAW_CALL = 32 +}; + +struct FlashlightInstance_t +{ + IMaterial *m_pDebugMaterial; + FlashlightState_t m_FlashlightState; + VMatrix m_WorldToTexture; + ITexture *m_pFlashlightDepthTexture; +}; + +struct StudioModelArrayInfo2_t +{ + int m_nFlashlightCount; + FlashlightInstance_t *m_pFlashlights; // NOTE: Can have at most MAX_FLASHLIGHTS_PER_INSTANCE_DRAW_CALL of these +}; + +struct StudioModelArrayInfo_t : public StudioModelArrayInfo2_t +{ + studiohdr_t *m_pStudioHdr; + studiohwdata_t *m_pHardwareData; +}; + +struct StudioArrayData_t +{ + studiohdr_t *m_pStudioHdr; + studiohwdata_t *m_pHardwareData; + void *m_pInstanceData; // See StudioShadowArrayInstanceData_t or StudioArrayInstanceData_t + int m_nCount; +}; + +struct StudioShadowArrayInstanceData_t +{ + int m_nLOD; + int m_nBody; + int m_nSkin; + matrix3x4a_t *m_pPoseToWorld; + float *m_pFlexWeights; + float *m_pDelayedFlexWeights; +}; + +struct StudioArrayInstanceData_t : public StudioShadowArrayInstanceData_t +{ + MaterialLightingState_t *m_pLightingState; + MaterialLightingState_t *m_pDecalLightingState; + ITexture *m_pEnvCubemapTexture; + StudioDecalHandle_t m_Decals; + uint32 m_nFlashlightUsage; // Mask indicating which flashlights to use. + ShaderStencilState_t *m_pStencilState; + ColorMeshInfo_t *m_pColorMeshInfo; + Vector4D m_DiffuseModulation; }; struct GetTriangles_Vertex_t @@ -224,14 +283,6 @@ struct GetTriangles_Output_t matrix3x4_t m_PoseToWorld[MAXSTUDIOBONES]; }; - -struct model_array_instance_t -{ - matrix3x4_t modelToWorld; - - // UNDONE: Per instance lighting values? -}; - //----------------------------------------------------------------------------- // Cache Callback Function // implementation can either statically persist data (tools) or lru cache (engine) it. @@ -252,8 +303,6 @@ abstract_class IStudioDataCache : public IAppSystem //----------------------------------------------------------------------------- // Studio render interface //----------------------------------------------------------------------------- -#define STUDIO_RENDER_INTERFACE_VERSION "VStudioRender025" - abstract_class IStudioRender : public IAppSystem { public: @@ -290,15 +339,6 @@ abstract_class IStudioRender : public IAppSystem virtual void SetViewState( const Vector& viewOrigin, const Vector& viewRight, const Vector& viewUp, const Vector& viewPlaneNormal ) = 0; - // Allocates flex weights for use in rendering - // NOTE: Pass in a non-null second parameter to lock delayed flex weights - virtual void LockFlexWeights( int nWeightCount, float **ppFlexWeights, float **ppFlexDelayedWeights = NULL ) = 0; - virtual void UnlockFlexWeights() = 0; - - // Used to allocate bone matrices to be used to pass into DrawModel - virtual matrix3x4_t* LockBoneMatrices( int nBoneCount ) = 0; - virtual void UnlockBoneMatrices() = 0; - // LOD stuff virtual int GetNumLODs( const studiohwdata_t &hardwareData ) const = 0; virtual float GetLODSwitchValue( const studiohwdata_t &hardwareData, int lod ) const = 0; @@ -357,10 +397,21 @@ abstract_class IStudioRender : public IAppSystem // Returns materials used by a particular model virtual int GetMaterialList( studiohdr_t *pStudioHdr, int count, IMaterial** ppMaterials ) = 0; virtual int GetMaterialListFromBodyAndSkin( MDLHandle_t studio, int nSkin, int nBody, int nCountOutputMaterials, IMaterial** ppOutputMaterials ) = 0; + + // no debug modes, just fastest drawing path + virtual void DrawModelArrayStaticProp( const DrawModelInfo_t& drawInfo, int nInstanceCount, const MeshInstanceData_t *pInstanceData, ColorMeshInfo_t **pColorMeshes ) = 0; + // draw an array of models with the same state - virtual void DrawModelArray( const DrawModelInfo_t &drawInfo, int arrayCount, model_array_instance_t *pInstanceData, int instanceStride, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL ) = 0; -}; + virtual void DrawModelArray( const StudioModelArrayInfo_t &drawInfo, int nCount, + StudioArrayInstanceData_t *pInstanceData, int nInstanceStride, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL ) = 0; + + // draw an array of models with the same state + virtual void DrawModelShadowArray( int nCount, StudioArrayData_t *pShadowData, + int nInstanceStride, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL ) = 0; -extern IStudioRender *g_pStudioRender; + // draw an array of models with the same state + virtual void DrawModelArray( const StudioModelArrayInfo2_t &info, int nCount, StudioArrayData_t *pArrayData, + int nInstanceStride, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL ) = 0; +}; #endif // ISTUDIORENDER_H diff --git a/public/jigglebones.cpp b/public/jigglebones.cpp index c9d227f8d..daa249e85 100644 --- a/public/jigglebones.cpp +++ b/public/jigglebones.cpp @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -7,6 +7,10 @@ #include "tier1/convar.h" #include "jigglebones.h" +#ifdef CLIENT_DLL +#include "engine/ivdebugoverlay.h" +#include "cdll_client_int.h" +#endif // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -15,28 +19,76 @@ ConVar JiggleBoneDebug( "cl_jiggle_bone_debug", "0", FCVAR_CHEAT, "Display physics-based 'jiggle bone' debugging information" ); ConVar JiggleBoneDebugYawConstraints( "cl_jiggle_bone_debug_yaw_constraints", "0", FCVAR_CHEAT, "Display physics-based 'jiggle bone' debugging information" ); ConVar JiggleBoneDebugPitchConstraints( "cl_jiggle_bone_debug_pitch_constraints", "0", FCVAR_CHEAT, "Display physics-based 'jiggle bone' debugging information" ); +ConVar JiggleBoneInvert( "cl_jiggle_bone_invert", "0", FCVAR_CHEAT ); +ConVar JiggleBoneSanity( "cl_jiggle_bone_sanity", "1", 0, "Prevent jiggle bones from pointing directly away from their target in case of numerical instability." ); +static int s_id = 2; + +#ifdef CLIENT_DLL +char *VarArgs( const char *format, ... ); +#else class CDummyOverlay { public: void AddLineOverlay(const Vector& origin, const Vector& dest, int r, int g, int b, bool noDepthTest, float duration) {}; + void AddTextOverlay(const Vector &origin, float duration, const char *text) {} }; -CDummyOverlay *debugoverlay = new CDummyOverlay; +SELECTANY CDummyOverlay *debugoverlay = new CDummyOverlay; + +char *VarArgs( const char *format, ... ) +{ + return NULL; +} +#endif //----------------------------------------------------------------------------- -JiggleData * CJiggleBones::GetJiggleData( int bone, float currenttime, const Vector &initBasePos, const Vector &initTipPos ) +JiggleData *CJiggleBones::GetJiggleData( int bone, float currenttime, const Vector &initBasePos, const Vector &initTipPos ) { FOR_EACH_LL( m_jiggleBoneState, it ) { if ( m_jiggleBoneState[it].bone == bone ) { + JiggleData *data = &m_jiggleBoneState[it]; + if ( !IsFinite( data->lastUpdate ) ) + { + Warning( "lastUpdate NaN\n" ); + } + if ( !data->basePos.IsValid() ) + { + Warning( "basePos NaN\n" ); + } + if ( !data->baseLastPos.IsValid() ) + { + Warning( "baseLastPos NaN\n" ); + } + if ( !data->baseVel.IsValid() ) + { + Warning( "baseVel NaN\n" ); + } + if ( !data->baseAccel.IsValid() ) + { + Warning( "baseAccel NaN\n" ); + } + if ( !data->tipPos.IsValid() ) + { + Warning( "tipPos NaN\n" ); + } + if ( !data->tipVel.IsValid() ) + { + Warning( "tipVel NaN\n" ); + } + if ( !data->tipAccel.IsValid() ) + { + Warning( "tipAccel NaN\n" ); + } return &m_jiggleBoneState[it]; } } JiggleData data; data.Init( bone, currenttime, initBasePos, initTipPos ); + data.id = s_id++; int idx = m_jiggleBoneState.AddToHead( data ); if ( idx == m_jiggleBoneState.InvalidIndex() ) @@ -75,6 +127,45 @@ void CJiggleBones::BuildJiggleTransformations( int boneIndex, float currenttime, data->Init( boneIndex, currenttime, goalBasePosition, goalTip ); } + if ( JiggleBoneInvert.GetBool() ) + { + data->basePos = -data->basePos; + data->baseLastPos = -data->baseLastPos; + data->baseVel = -data->baseVel; + data->baseAccel = -data->baseAccel; + data->tipPos = -data->tipPos; + data->tipVel = -data->tipVel; + data->tipAccel = -data->tipAccel; + } + +#ifdef CLIENT_DLL + if ( data->id == JiggleBoneDebug.GetInt() ) + { + int line = 20; + engine->Con_NPrintf( line++, "basePos %f %f %f", data->basePos.x, data->basePos.y, data->basePos.z ); + engine->Con_NPrintf( line++, "baseLastPos %f %f %f", data->baseLastPos.x, data->baseLastPos.y, data->baseLastPos.z ); + engine->Con_NPrintf( line++, "baseVel %f %f %f", data->baseVel.x, data->baseVel.y, data->baseVel.z ); + engine->Con_NPrintf( line++, "baseAccel %f %f %f", data->baseAccel.x, data->baseAccel.y, data->baseAccel.z ); + engine->Con_NPrintf( line++, "tipPos %f %f %f", data->tipPos.x, data->tipPos.y, data->tipPos.z ); + engine->Con_NPrintf( line++, "tipVel %f %f %f", data->tipVel.x, data->tipVel.y, data->tipVel.z ); + engine->Con_NPrintf( line++, "tipAccel %f %f %f", data->tipAccel.x, data->tipAccel.y, data->tipAccel.z ); + } +#endif + + if ( JiggleBoneSanity.GetBool() ) + { + Vector goalDir = goalTip - goalBasePosition; + goalDir.NormalizeInPlace(); + Vector dataDir = data->tipPos - goalBasePosition; + dataDir.NormalizeInPlace(); + + float dot = goalDir.Dot( dataDir ); + if ( dot < -0.9f ) // if we end up pointing almost completely away, just reset + { + data->Init( boneIndex, currenttime, goalBasePosition, goalTip ); + } + } + //Vector bodyVel; //EstimateAbsVelocity( bodyVel ); @@ -106,6 +197,7 @@ void CJiggleBones::BuildJiggleTransformations( int boneIndex, float currenttime, Vector localVel; localVel.x = DotProduct( goalLeft, data->tipVel ); localVel.y = DotProduct( goalUp, data->tipVel ); + localVel.z = 0.0f; // TODO: this was uninitialized, but is being used // yaw spring float yawAccel = jiggleInfo->yawStiffness * localError.x - jiggleInfo->yawDamping * localVel.x; @@ -235,6 +327,7 @@ void CJiggleBones::BuildJiggleTransformations( int boneIndex, float currenttime, // yaw friction - rubbing along limit plane Vector limitVel; + limitVel.x = 0.0f; // TODO: this was uninitialized, and is used when yawBounce is non-zero! limitVel.y = DotProduct( limitUp, data->tipVel ); limitVel.z = DotProduct( limitForward, data->tipVel ); @@ -335,6 +428,7 @@ void CJiggleBones::BuildJiggleTransformations( int boneIndex, float currenttime, // pitch friction - rubbing along limit plane Vector limitVel; + limitVel.x = 0.0f; // TODO: this was uninitialized, but is being used limitVel.y = DotProduct( limitUp, data->tipVel ); limitVel.z = DotProduct( limitForward, data->tipVel ); @@ -510,7 +604,7 @@ void CJiggleBones::BuildJiggleTransformations( int boneIndex, float currenttime, // debug display - if ( JiggleBoneDebug.GetBool() ) + if ( JiggleBoneDebug.GetInt() == 1 || JiggleBoneDebug.GetInt() == data->id ) { float dT = 0.01f; const float axisSize = 5.0f; @@ -518,6 +612,7 @@ void CJiggleBones::BuildJiggleTransformations( int boneIndex, float currenttime, debugoverlay->AddLineOverlay( goalBasePosition, goalBasePosition + axisSize * goalUp, 0, 255, 0, true, dT ); debugoverlay->AddLineOverlay( goalBasePosition, goalBasePosition + axisSize * goalForward, 0, 0, 255, true, dT ); + debugoverlay->AddTextOverlay( goalBasePosition, dT, VarArgs( "%d", data->id ) ); const float sz = 1.0f; diff --git a/public/jigglebones.h b/public/jigglebones.h index f2290b3a0..04c05aa32 100644 --- a/public/jigglebones.h +++ b/public/jigglebones.h @@ -39,6 +39,7 @@ struct JiggleData } int bone; + int id; float lastUpdate; // based on gpGlobals->realtime diff --git a/public/materialsystem/IColorCorrection.h b/public/materialsystem/IColorCorrection.h index 49ed4dc93..c3cc07c56 100644 --- a/public/materialsystem/IColorCorrection.h +++ b/public/materialsystem/IColorCorrection.h @@ -12,13 +12,12 @@ #endif #include "tier1/interface.h" +#include "tier0/basetypes.h" #include "bitmap/imageformat.h" typedef unsigned int ColorCorrectionHandle_t; struct ShaderColorCorrectionInfo_t; -#define COLORCORRECTION_INTERFACE_VERSION "COLORCORRECTION_VERSION_1" - abstract_class IColorCorrectionSystem { public: @@ -36,7 +35,7 @@ abstract_class IColorCorrectionSystem virtual void LockLookup( ColorCorrectionHandle_t handle ) = 0; virtual void UnlockLookup() = 0; - virtual void UnlockLookup( ColorCorrectionHandle_t handle ) = 0; + virtual void UnlockLookup( ColorCorrectionHandle_t handle, bool bDownload = true ) = 0; virtual void SetLookup( RGBX5551_t inColor, color24 outColor ) = 0; virtual void SetLookup( ColorCorrectionHandle_t handle, RGBX5551_t inColor, color24 outColor ) = 0; @@ -68,6 +67,9 @@ abstract_class IColorCorrectionSystem // FIXME: Move this to a private interface only the material system can see? virtual void GetCurrentColorCorrection( ShaderColorCorrectionInfo_t* pInfo ) = 0; + + virtual void OnProceduralRegenComplete( ColorCorrectionHandle_t handle ) = 0; }; #endif + diff --git a/public/materialsystem/IShader.h b/public/materialsystem/IShader.h index 1948cf57a..0b0f829a1 100644 --- a/public/materialsystem/IShader.h +++ b/public/materialsystem/IShader.h @@ -1,10 +1,10 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // // $NoKeywords: $ // -//=============================================================================// +//===========================================================================// #ifndef ISHADER_H #define ISHADER_H @@ -27,6 +27,7 @@ class IShaderDynamicAPI; class IShaderInit; class CBasePerMaterialContextData; + //----------------------------------------------------------------------------- // Shader flags //----------------------------------------------------------------------------- @@ -58,6 +59,44 @@ struct ShaderParamInfo_t }; + +//----------------------------------------------------------------------------- +// shaders can keep per material data in classes descended from this +//----------------------------------------------------------------------------- +class CBasePerMaterialContextData +{ +public: + uint32 m_nVarChangeID; + bool m_bMaterialVarsChanged; // set by mat system when material vars change. shader should rehtink and then clear the var + + FORCEINLINE CBasePerMaterialContextData( void ) + { + m_bMaterialVarsChanged = true; + m_nVarChangeID = 0xffffffff; + } + + // virtual destructor so that derived classes can have their own data to be cleaned up on + // delete of material + virtual ~CBasePerMaterialContextData( void ) + { + } +}; + + +//----------------------------------------------------------------------------- +// shaders can keep per instance data in classes descended from this +//----------------------------------------------------------------------------- +class CBasePerInstanceContextData +{ +public: + // virtual destructor so that derived classes can have their own data + // to be cleaned up on delete of material + virtual ~CBasePerInstanceContextData( void ) + { + } +}; + + //----------------------------------------------------------------------------- // Standard vertex shader constants //----------------------------------------------------------------------------- @@ -70,7 +109,7 @@ enum VERTEX_SHADER_LIGHT_INDEX = 3, VERTEX_SHADER_MODELVIEWPROJ = 4, VERTEX_SHADER_VIEWPROJ = 8, - VERTEX_SHADER_UNUSED = 12, + VERTEX_SHADER_SHADER_SPECIFIC_CONST_12 = 12, VERTEX_SHADER_FLEXSCALE = 13, VERTEX_SHADER_SHADER_SPECIFIC_CONST_10 = 14, VERTEX_SHADER_SHADER_SPECIFIC_CONST_11 = 15, @@ -91,11 +130,15 @@ enum VERTEX_SHADER_SHADER_SPECIFIC_CONST_8 = 56, VERTEX_SHADER_SHADER_SPECIFIC_CONST_9 = 57, VERTEX_SHADER_MODEL = 58, + // + // We reserve up through 217 for the 53 bones supported on DX9 + // VERTEX_SHADER_FLEX_WEIGHTS = 1024, VERTEX_SHADER_MAX_FLEX_WEIGHT_COUNT = 512, }; +#define VERTEX_SHADER_BONE_TRANSFORM( k ) ( VERTEX_SHADER_MODEL + 3 * (k) ) //----------------------------------------------------------------------------- // Standard vertex shader constants @@ -115,6 +158,9 @@ enum VERTEX_SHADER_SHADER_SPECIFIC_BOOL_CONST_6 = 10, VERTEX_SHADER_SHADER_SPECIFIC_BOOL_CONST_7 = 11, }; + + +//----------------------------------------------------------------------------- // The public methods exposed by each shader //----------------------------------------------------------------------------- abstract_class IShader @@ -127,18 +173,15 @@ abstract_class IShader virtual char const* GetFallbackShader( IMaterialVar** params ) const = 0; // Shader parameters - virtual int GetNumParams( ) const = 0; + virtual int GetParamCount( ) const = 0; + virtual const ShaderParamInfo_t& GetParamInfo( int paramIndex ) const = 0; // These functions must be implemented by the shader virtual void InitShaderParams( IMaterialVar** ppParams, const char *pMaterialName ) = 0; virtual void InitShaderInstance( IMaterialVar** ppParams, IShaderInit *pShaderInit, const char *pMaterialName, const char *pTextureGroupName ) = 0; virtual void DrawElements( IMaterialVar **params, int nModulationFlags, - IShaderShadow* pShaderShadow, IShaderDynamicAPI* pShaderAPI, VertexCompressionType_t vertexCompression, CBasePerMaterialContextData **pContextDataPtr ) = 0; - - virtual char const* GetParamName( int paramIndex ) const = 0; - virtual char const* GetParamHelp( int paramIndex ) const = 0; - virtual ShaderParamType_t GetParamType( int paramIndex ) const = 0; - virtual char const* GetParamDefault( int paramIndex ) const = 0; + IShaderShadow* pShaderShadow, IShaderDynamicAPI* pShaderAPI, + VertexCompressionType_t vertexCompression, CBasePerMaterialContextData **pContextDataPtr, CBasePerInstanceContextData** pInstanceDataPtr ) = 0; // FIXME: Figure out a better way to do this? virtual int ComputeModulationFlags( IMaterialVar** params, IShaderDynamicAPI* pShaderAPI ) = 0; @@ -146,12 +189,7 @@ abstract_class IShader virtual bool NeedsFullFrameBufferTexture( IMaterialVar **params, bool bCheckSpecificToThisFrame ) const = 0; virtual bool IsTranslucent( IMaterialVar **params ) const = 0; - virtual int GetParamFlags( int paramIndex ) const = 0; - virtual int GetFlags() const = 0; - - // FIXME: Remove GetParamName, etc. above -// virtual const ShaderParamInfo_t& GetParamInfo( int paramIndex ) const = 0; }; @@ -173,7 +211,7 @@ enum PrecompiledShaderType_t enum { // runtime flags - SHADER_DYNAMIC_COMPILE_IS_HLSL = 0x1, + SHADER_IS_ASM = 0x1, SHADER_FAILED_LOAD = 0x2, }; diff --git a/public/materialsystem/MaterialSystemUtil.cpp b/public/materialsystem/MaterialSystemUtil.cpp index 89f2a36d4..c34912e35 100644 --- a/public/materialsystem/MaterialSystemUtil.cpp +++ b/public/materialsystem/MaterialSystemUtil.cpp @@ -31,6 +31,12 @@ CMaterialReference::CMaterialReference( char const* pMaterialName, const char *p } } +const CMaterialReference& CMaterialReference::operator=( const CMaterialReference &ref ) +{ + Init( ref.m_pMaterial ); + return *this; +} + CMaterialReference::~CMaterialReference() { Shutdown(); @@ -89,11 +95,15 @@ void CMaterialReference::Init( CMaterialReference& ref ) //----------------------------------------------------------------------------- // Detach from a material //----------------------------------------------------------------------------- -void CMaterialReference::Shutdown( ) +void CMaterialReference::Shutdown( bool bDeleteIfUnreferenced /*=false*/ ) { if ( m_pMaterial && materials ) { m_pMaterial->DecrementReferenceCount(); + if ( bDeleteIfUnreferenced ) + { + m_pMaterial->DeleteIfUnreferenced(); + } m_pMaterial = NULL; } } @@ -110,22 +120,15 @@ CTextureReference::CTextureReference( ) : m_pTexture(NULL) { } -CTextureReference::CTextureReference( const CTextureReference &ref ) +CTextureReference::CTextureReference( const CTextureReference &ref ) : m_pTexture( NULL ) { - m_pTexture = ref.m_pTexture; - if ( m_pTexture ) - { - m_pTexture->IncrementReferenceCount(); - } + Init( ref.m_pTexture ); } -void CTextureReference::operator=( CTextureReference &ref ) +const CTextureReference& CTextureReference::operator=( CTextureReference &ref ) { - m_pTexture = ref.m_pTexture; - if ( m_pTexture ) - { - m_pTexture->IncrementReferenceCount(); - } + Init( ref.m_pTexture ); + return *this; } CTextureReference::~CTextureReference( ) @@ -148,12 +151,15 @@ void CTextureReference::Init( char const* pTextureName, const char *pTextureGrou void CTextureReference::Init( ITexture* pTexture ) { - Shutdown(); - - m_pTexture = pTexture; - if (m_pTexture) + if ( m_pTexture != pTexture ) { - m_pTexture->IncrementReferenceCount(); + Shutdown(); + + m_pTexture = pTexture; + if (m_pTexture) + { + m_pTexture->IncrementReferenceCount(); + } } } @@ -236,12 +242,12 @@ void CTextureReference::InitRenderTargetTexture( int w, int h, RenderTargetSizeM // The paired system memory texture can be built in an alternate format. //----------------------------------------------------------------------------- #if defined( _X360 ) -void CTextureReference::InitRenderTargetSurface( int width, int height, ImageFormat fmt, bool bSameAsTexture ) +void CTextureReference::InitRenderTargetSurface( int width, int height, ImageFormat fmt, bool bSameAsTexture, RTMultiSampleCount360_t multiSampleCount ) { // texture has to be created first Assert( m_pTexture && m_pTexture->IsRenderTarget() ); - m_pTexture->CreateRenderTargetSurface( width, height, fmt, bSameAsTexture ); + m_pTexture->CreateRenderTargetSurface( width, height, fmt, bSameAsTexture, multiSampleCount ); } #endif diff --git a/public/materialsystem/MaterialSystemUtil.h b/public/materialsystem/MaterialSystemUtil.h index bfd94ed7f..a84e510d5 100644 --- a/public/materialsystem/MaterialSystemUtil.h +++ b/public/materialsystem/MaterialSystemUtil.h @@ -15,12 +15,11 @@ #include "bitmap/imageformat.h" //ImageFormat enum definition #include "materialsystem/imaterialsystem.h" // RenderTargetSizeMode_t and MaterialRenderTargetDepth_t definition - +#include "materialsystem/itexture.h" //----------------------------------------------------------------------------- // Forward declarations //----------------------------------------------------------------------------- class IMaterial; -class ITexture; class KeyValues; class KeyValues; @@ -44,15 +43,21 @@ class CMaterialReference void Init( const char *pMaterialName, const char *pTextureGroupName, KeyValues *pVMTKeyValues ); // Detach from a material - void Shutdown(); + void Shutdown( bool bDeleteIfUnreferenced = false ); bool IsValid() { return m_pMaterial != 0; } // Automatic casts to IMaterial operator IMaterial*() { return m_pMaterial; } operator IMaterial const*() const { return m_pMaterial; } IMaterial* operator->() { return m_pMaterial; } + + // Assignment operator + const CMaterialReference& operator=( const CMaterialReference &ref ); + private: + CMaterialReference( CMaterialReference &ref ) { } + IMaterial* m_pMaterial; }; @@ -74,7 +79,7 @@ class CTextureReference #if defined( _X360 ) // used when RT coupling is disparate (texture is DDR based, surface is EDRAM based) void InitRenderTargetTexture( int width, int height, RenderTargetSizeMode_t sizeMode, ImageFormat fmt, MaterialRenderTargetDepth_t depth, bool bHDR, char *pStrOptionalName = NULL ); - void InitRenderTargetSurface( int width, int height, ImageFormat fmt, bool bSameAsTexture ); + void InitRenderTargetSurface( int width, int height, ImageFormat fmt, bool bSameAsTexture, RTMultiSampleCount360_t multiSampleCount = RT_MULTISAMPLE_NONE ); #endif void Init( ITexture* pTexture ); @@ -88,7 +93,7 @@ class CTextureReference ITexture* operator->() { return m_pTexture; } // Assignment operator - void operator=( CTextureReference &ref ); + const CTextureReference& operator=( CTextureReference &ref ); private: ITexture* m_pTexture; diff --git a/public/materialsystem/idebugtextureinfo.h b/public/materialsystem/idebugtextureinfo.h index 78542536d..eb462a55d 100644 --- a/public/materialsystem/idebugtextureinfo.h +++ b/public/materialsystem/idebugtextureinfo.h @@ -15,7 +15,6 @@ class KeyValues; // This interface is actually exported by the shader API DLL. -#define DEBUG_TEXTURE_INFO_VERSION "DebugTextureInfo001" abstract_class IDebugTextureInfo diff --git a/public/materialsystem/imaterial.h b/public/materialsystem/imaterial.h index 75089735c..49afbd929 100644 --- a/public/materialsystem/imaterial.h +++ b/public/materialsystem/imaterial.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -17,7 +17,7 @@ #include "materialsystem/imaterialsystem.h" //----------------------------------------------------------------------------- -// forward declaraions +// Forward declarations //----------------------------------------------------------------------------- class IMaterialVar; @@ -31,7 +31,7 @@ class Vector; enum VertexFormatFlags_t { // Indicates an uninitialized VertexFormat_t value - VERTEX_FORMAT_INVALID = 0xFFFFFFFFFFFFFFFFLL, + VERTEX_FORMAT_INVALID = 0xFFFFFFFFFFFFFFFFull, VERTEX_POSITION = 0x0001, VERTEX_NORMAL = 0x0002, @@ -48,8 +48,8 @@ enum VertexFormatFlags_t // Indicates we're using bone indices VERTEX_BONE_INDEX = 0x0080, - // Indicates this is a vertex shader - VERTEX_FORMAT_VERTEX_SHADER = 0x0100, + // Indicates this expects a color stream on stream 1 + VERTEX_COLOR_STREAM_1 = 0x0100, // Indicates this format shouldn't be bloated to cache align it // (only used for VertexUsage) @@ -58,8 +58,11 @@ enum VertexFormatFlags_t // Indicates that compressed vertex elements are to be used (see also VertexCompressionType_t) VERTEX_FORMAT_COMPRESSED = 0x400, + // Position or normal (if present) should be 4D not 3D + VERTEX_FORMAT_PAD_POS_NORM = 0x800, + // Update this if you add or remove bits... - VERTEX_LAST_BIT = 10, + VERTEX_LAST_BIT = 11, VERTEX_BONE_WEIGHT_BIT = VERTEX_LAST_BIT + 1, USER_DATA_SIZE_BIT = VERTEX_LAST_BIT + 4, @@ -113,14 +116,9 @@ inline int TexCoordSize( int nTexCoordIndex, VertexFormat_t vertexFormat ) return static_cast ( (vertexFormat >> (TEX_COORD_SIZE_BIT + 3*nTexCoordIndex) ) & 0x7 ); } -inline bool UsesVertexShader( VertexFormat_t vertexFormat ) -{ - return (vertexFormat & VERTEX_FORMAT_VERTEX_SHADER) != 0; -} - inline VertexCompressionType_t CompressionType( VertexFormat_t vertexFormat ) { - // This is trivial now, but we may add multiple flavours of compressed vertex later on + // This is trivial now, but we may add multiple flavors of compressed vertex later on if ( vertexFormat & VERTEX_FORMAT_COMPRESSED ) return VERTEX_COMPRESSION_ON; else @@ -140,112 +138,116 @@ enum VertexElement_t // #!#!#NOTE#!#!# update GetVertexElementSize, VertexElementToDeclType and // CVBAllocTracker (elementTable) when you update this! VERTEX_ELEMENT_POSITION = 0, - VERTEX_ELEMENT_NORMAL = 1, - VERTEX_ELEMENT_COLOR = 2, - VERTEX_ELEMENT_SPECULAR = 3, - VERTEX_ELEMENT_TANGENT_S = 4, - VERTEX_ELEMENT_TANGENT_T = 5, - VERTEX_ELEMENT_WRINKLE = 6, - VERTEX_ELEMENT_BONEINDEX = 7, - VERTEX_ELEMENT_BONEWEIGHTS1 = 8, - VERTEX_ELEMENT_BONEWEIGHTS2 = 9, - VERTEX_ELEMENT_BONEWEIGHTS3 = 10, - VERTEX_ELEMENT_BONEWEIGHTS4 = 11, - VERTEX_ELEMENT_USERDATA1 = 12, - VERTEX_ELEMENT_USERDATA2 = 13, - VERTEX_ELEMENT_USERDATA3 = 14, - VERTEX_ELEMENT_USERDATA4 = 15, - VERTEX_ELEMENT_TEXCOORD1D_0 = 16, - VERTEX_ELEMENT_TEXCOORD1D_1 = 17, - VERTEX_ELEMENT_TEXCOORD1D_2 = 18, - VERTEX_ELEMENT_TEXCOORD1D_3 = 19, - VERTEX_ELEMENT_TEXCOORD1D_4 = 20, - VERTEX_ELEMENT_TEXCOORD1D_5 = 21, - VERTEX_ELEMENT_TEXCOORD1D_6 = 22, - VERTEX_ELEMENT_TEXCOORD1D_7 = 23, - VERTEX_ELEMENT_TEXCOORD2D_0 = 24, - VERTEX_ELEMENT_TEXCOORD2D_1 = 25, - VERTEX_ELEMENT_TEXCOORD2D_2 = 26, - VERTEX_ELEMENT_TEXCOORD2D_3 = 27, - VERTEX_ELEMENT_TEXCOORD2D_4 = 28, - VERTEX_ELEMENT_TEXCOORD2D_5 = 29, - VERTEX_ELEMENT_TEXCOORD2D_6 = 30, - VERTEX_ELEMENT_TEXCOORD2D_7 = 31, - VERTEX_ELEMENT_TEXCOORD3D_0 = 32, - VERTEX_ELEMENT_TEXCOORD3D_1 = 33, - VERTEX_ELEMENT_TEXCOORD3D_2 = 34, - VERTEX_ELEMENT_TEXCOORD3D_3 = 35, - VERTEX_ELEMENT_TEXCOORD3D_4 = 36, - VERTEX_ELEMENT_TEXCOORD3D_5 = 37, - VERTEX_ELEMENT_TEXCOORD3D_6 = 38, - VERTEX_ELEMENT_TEXCOORD3D_7 = 39, - VERTEX_ELEMENT_TEXCOORD4D_0 = 40, - VERTEX_ELEMENT_TEXCOORD4D_1 = 41, - VERTEX_ELEMENT_TEXCOORD4D_2 = 42, - VERTEX_ELEMENT_TEXCOORD4D_3 = 43, - VERTEX_ELEMENT_TEXCOORD4D_4 = 44, - VERTEX_ELEMENT_TEXCOORD4D_5 = 45, - VERTEX_ELEMENT_TEXCOORD4D_6 = 46, - VERTEX_ELEMENT_TEXCOORD4D_7 = 47, - - VERTEX_ELEMENT_NUMELEMENTS = 48 + VERTEX_ELEMENT_POSITION4D = 1, + VERTEX_ELEMENT_NORMAL = 2, + VERTEX_ELEMENT_NORMAL4D = 3, + VERTEX_ELEMENT_COLOR = 4, + VERTEX_ELEMENT_SPECULAR = 5, + VERTEX_ELEMENT_TANGENT_S = 6, + VERTEX_ELEMENT_TANGENT_T = 7, + VERTEX_ELEMENT_WRINKLE = 8, + VERTEX_ELEMENT_BONEINDEX = 9, + VERTEX_ELEMENT_BONEWEIGHTS1 = 10, + VERTEX_ELEMENT_BONEWEIGHTS2 = 11, + VERTEX_ELEMENT_BONEWEIGHTS3 = 12, + VERTEX_ELEMENT_BONEWEIGHTS4 = 13, + VERTEX_ELEMENT_USERDATA1 = 14, + VERTEX_ELEMENT_USERDATA2 = 15, + VERTEX_ELEMENT_USERDATA3 = 16, + VERTEX_ELEMENT_USERDATA4 = 17, + VERTEX_ELEMENT_TEXCOORD1D_0 = 18, + VERTEX_ELEMENT_TEXCOORD1D_1 = 19, + VERTEX_ELEMENT_TEXCOORD1D_2 = 20, + VERTEX_ELEMENT_TEXCOORD1D_3 = 21, + VERTEX_ELEMENT_TEXCOORD1D_4 = 22, + VERTEX_ELEMENT_TEXCOORD1D_5 = 23, + VERTEX_ELEMENT_TEXCOORD1D_6 = 24, + VERTEX_ELEMENT_TEXCOORD1D_7 = 25, + VERTEX_ELEMENT_TEXCOORD2D_0 = 26, + VERTEX_ELEMENT_TEXCOORD2D_1 = 27, + VERTEX_ELEMENT_TEXCOORD2D_2 = 28, + VERTEX_ELEMENT_TEXCOORD2D_3 = 29, + VERTEX_ELEMENT_TEXCOORD2D_4 = 30, + VERTEX_ELEMENT_TEXCOORD2D_5 = 31, + VERTEX_ELEMENT_TEXCOORD2D_6 = 32, + VERTEX_ELEMENT_TEXCOORD2D_7 = 33, + VERTEX_ELEMENT_TEXCOORD3D_0 = 34, + VERTEX_ELEMENT_TEXCOORD3D_1 = 35, + VERTEX_ELEMENT_TEXCOORD3D_2 = 36, + VERTEX_ELEMENT_TEXCOORD3D_3 = 37, + VERTEX_ELEMENT_TEXCOORD3D_4 = 38, + VERTEX_ELEMENT_TEXCOORD3D_5 = 39, + VERTEX_ELEMENT_TEXCOORD3D_6 = 40, + VERTEX_ELEMENT_TEXCOORD3D_7 = 41, + VERTEX_ELEMENT_TEXCOORD4D_0 = 42, + VERTEX_ELEMENT_TEXCOORD4D_1 = 43, + VERTEX_ELEMENT_TEXCOORD4D_2 = 44, + VERTEX_ELEMENT_TEXCOORD4D_3 = 45, + VERTEX_ELEMENT_TEXCOORD4D_4 = 46, + VERTEX_ELEMENT_TEXCOORD4D_5 = 47, + VERTEX_ELEMENT_TEXCOORD4D_6 = 48, + VERTEX_ELEMENT_TEXCOORD4D_7 = 49, + + VERTEX_ELEMENT_NUMELEMENTS = 50 }; inline void Detect_VertexElement_t_Changes( VertexElement_t element ) // GREPs for VertexElement_t will hit this { // Make it harder for someone to change VertexElement_t without noticing that dependent code // (GetVertexElementSize, VertexElementToDeclType, CVBAllocTracker) needs updating - Assert( VERTEX_ELEMENT_NUMELEMENTS == 48 ); + Assert( VERTEX_ELEMENT_NUMELEMENTS == 50 ); switch ( element ) { case VERTEX_ELEMENT_POSITION: Assert( VERTEX_ELEMENT_POSITION == 0 ); break; - case VERTEX_ELEMENT_NORMAL: Assert( VERTEX_ELEMENT_NORMAL == 1 ); break; - case VERTEX_ELEMENT_COLOR: Assert( VERTEX_ELEMENT_COLOR == 2 ); break; - case VERTEX_ELEMENT_SPECULAR: Assert( VERTEX_ELEMENT_SPECULAR == 3 ); break; - case VERTEX_ELEMENT_TANGENT_S: Assert( VERTEX_ELEMENT_TANGENT_S == 4 ); break; - case VERTEX_ELEMENT_TANGENT_T: Assert( VERTEX_ELEMENT_TANGENT_T == 5 ); break; - case VERTEX_ELEMENT_WRINKLE: Assert( VERTEX_ELEMENT_WRINKLE == 6 ); break; - case VERTEX_ELEMENT_BONEINDEX: Assert( VERTEX_ELEMENT_BONEINDEX == 7 ); break; - case VERTEX_ELEMENT_BONEWEIGHTS1: Assert( VERTEX_ELEMENT_BONEWEIGHTS1 == 8 ); break; - case VERTEX_ELEMENT_BONEWEIGHTS2: Assert( VERTEX_ELEMENT_BONEWEIGHTS2 == 9 ); break; - case VERTEX_ELEMENT_BONEWEIGHTS3: Assert( VERTEX_ELEMENT_BONEWEIGHTS3 == 10 ); break; - case VERTEX_ELEMENT_BONEWEIGHTS4: Assert( VERTEX_ELEMENT_BONEWEIGHTS4 == 11 ); break; - case VERTEX_ELEMENT_USERDATA1: Assert( VERTEX_ELEMENT_USERDATA1 == 12 ); break; - case VERTEX_ELEMENT_USERDATA2: Assert( VERTEX_ELEMENT_USERDATA2 == 13 ); break; - case VERTEX_ELEMENT_USERDATA3: Assert( VERTEX_ELEMENT_USERDATA3 == 14 ); break; - case VERTEX_ELEMENT_USERDATA4: Assert( VERTEX_ELEMENT_USERDATA4 == 15 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_0: Assert( VERTEX_ELEMENT_TEXCOORD1D_0 == 16 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_1: Assert( VERTEX_ELEMENT_TEXCOORD1D_1 == 17 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_2: Assert( VERTEX_ELEMENT_TEXCOORD1D_2 == 18 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_3: Assert( VERTEX_ELEMENT_TEXCOORD1D_3 == 19 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_4: Assert( VERTEX_ELEMENT_TEXCOORD1D_4 == 20 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_5: Assert( VERTEX_ELEMENT_TEXCOORD1D_5 == 21 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_6: Assert( VERTEX_ELEMENT_TEXCOORD1D_6 == 22 ); break; - case VERTEX_ELEMENT_TEXCOORD1D_7: Assert( VERTEX_ELEMENT_TEXCOORD1D_7 == 23 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_0: Assert( VERTEX_ELEMENT_TEXCOORD2D_0 == 24 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_1: Assert( VERTEX_ELEMENT_TEXCOORD2D_1 == 25 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_2: Assert( VERTEX_ELEMENT_TEXCOORD2D_2 == 26 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_3: Assert( VERTEX_ELEMENT_TEXCOORD2D_3 == 27 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_4: Assert( VERTEX_ELEMENT_TEXCOORD2D_4 == 28 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_5: Assert( VERTEX_ELEMENT_TEXCOORD2D_5 == 29 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_6: Assert( VERTEX_ELEMENT_TEXCOORD2D_6 == 30 ); break; - case VERTEX_ELEMENT_TEXCOORD2D_7: Assert( VERTEX_ELEMENT_TEXCOORD2D_7 == 31 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_0: Assert( VERTEX_ELEMENT_TEXCOORD3D_0 == 32 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_1: Assert( VERTEX_ELEMENT_TEXCOORD3D_1 == 33 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_2: Assert( VERTEX_ELEMENT_TEXCOORD3D_2 == 34 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_3: Assert( VERTEX_ELEMENT_TEXCOORD3D_3 == 35 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_4: Assert( VERTEX_ELEMENT_TEXCOORD3D_4 == 36 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_5: Assert( VERTEX_ELEMENT_TEXCOORD3D_5 == 37 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_6: Assert( VERTEX_ELEMENT_TEXCOORD3D_6 == 38 ); break; - case VERTEX_ELEMENT_TEXCOORD3D_7: Assert( VERTEX_ELEMENT_TEXCOORD3D_7 == 39 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_0: Assert( VERTEX_ELEMENT_TEXCOORD4D_0 == 40 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_1: Assert( VERTEX_ELEMENT_TEXCOORD4D_1 == 41 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_2: Assert( VERTEX_ELEMENT_TEXCOORD4D_2 == 42 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_3: Assert( VERTEX_ELEMENT_TEXCOORD4D_3 == 43 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_4: Assert( VERTEX_ELEMENT_TEXCOORD4D_4 == 44 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_5: Assert( VERTEX_ELEMENT_TEXCOORD4D_5 == 45 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_6: Assert( VERTEX_ELEMENT_TEXCOORD4D_6 == 46 ); break; - case VERTEX_ELEMENT_TEXCOORD4D_7: Assert( VERTEX_ELEMENT_TEXCOORD4D_7 == 47 ); break; + case VERTEX_ELEMENT_POSITION4D: Assert( VERTEX_ELEMENT_POSITION4D == 1 ); break; + case VERTEX_ELEMENT_NORMAL: Assert( VERTEX_ELEMENT_NORMAL == 2 ); break; + case VERTEX_ELEMENT_NORMAL4D: Assert( VERTEX_ELEMENT_NORMAL4D == 3 ); break; + case VERTEX_ELEMENT_COLOR: Assert( VERTEX_ELEMENT_COLOR == 4 ); break; + case VERTEX_ELEMENT_SPECULAR: Assert( VERTEX_ELEMENT_SPECULAR == 5 ); break; + case VERTEX_ELEMENT_TANGENT_S: Assert( VERTEX_ELEMENT_TANGENT_S == 6 ); break; + case VERTEX_ELEMENT_TANGENT_T: Assert( VERTEX_ELEMENT_TANGENT_T == 7 ); break; + case VERTEX_ELEMENT_WRINKLE: Assert( VERTEX_ELEMENT_WRINKLE == 8 ); break; + case VERTEX_ELEMENT_BONEINDEX: Assert( VERTEX_ELEMENT_BONEINDEX == 9 ); break; + case VERTEX_ELEMENT_BONEWEIGHTS1: Assert( VERTEX_ELEMENT_BONEWEIGHTS1 == 10 ); break; + case VERTEX_ELEMENT_BONEWEIGHTS2: Assert( VERTEX_ELEMENT_BONEWEIGHTS2 == 11 ); break; + case VERTEX_ELEMENT_BONEWEIGHTS3: Assert( VERTEX_ELEMENT_BONEWEIGHTS3 == 12 ); break; + case VERTEX_ELEMENT_BONEWEIGHTS4: Assert( VERTEX_ELEMENT_BONEWEIGHTS4 == 13 ); break; + case VERTEX_ELEMENT_USERDATA1: Assert( VERTEX_ELEMENT_USERDATA1 == 14 ); break; + case VERTEX_ELEMENT_USERDATA2: Assert( VERTEX_ELEMENT_USERDATA2 == 15 ); break; + case VERTEX_ELEMENT_USERDATA3: Assert( VERTEX_ELEMENT_USERDATA3 == 16 ); break; + case VERTEX_ELEMENT_USERDATA4: Assert( VERTEX_ELEMENT_USERDATA4 == 17 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_0: Assert( VERTEX_ELEMENT_TEXCOORD1D_0 == 18 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_1: Assert( VERTEX_ELEMENT_TEXCOORD1D_1 == 19 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_2: Assert( VERTEX_ELEMENT_TEXCOORD1D_2 == 20 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_3: Assert( VERTEX_ELEMENT_TEXCOORD1D_3 == 21 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_4: Assert( VERTEX_ELEMENT_TEXCOORD1D_4 == 22 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_5: Assert( VERTEX_ELEMENT_TEXCOORD1D_5 == 23 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_6: Assert( VERTEX_ELEMENT_TEXCOORD1D_6 == 24 ); break; + case VERTEX_ELEMENT_TEXCOORD1D_7: Assert( VERTEX_ELEMENT_TEXCOORD1D_7 == 25 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_0: Assert( VERTEX_ELEMENT_TEXCOORD2D_0 == 26 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_1: Assert( VERTEX_ELEMENT_TEXCOORD2D_1 == 27 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_2: Assert( VERTEX_ELEMENT_TEXCOORD2D_2 == 28 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_3: Assert( VERTEX_ELEMENT_TEXCOORD2D_3 == 29 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_4: Assert( VERTEX_ELEMENT_TEXCOORD2D_4 == 30 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_5: Assert( VERTEX_ELEMENT_TEXCOORD2D_5 == 31 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_6: Assert( VERTEX_ELEMENT_TEXCOORD2D_6 == 32 ); break; + case VERTEX_ELEMENT_TEXCOORD2D_7: Assert( VERTEX_ELEMENT_TEXCOORD2D_7 == 33 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_0: Assert( VERTEX_ELEMENT_TEXCOORD3D_0 == 34 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_1: Assert( VERTEX_ELEMENT_TEXCOORD3D_1 == 35 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_2: Assert( VERTEX_ELEMENT_TEXCOORD3D_2 == 36 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_3: Assert( VERTEX_ELEMENT_TEXCOORD3D_3 == 37 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_4: Assert( VERTEX_ELEMENT_TEXCOORD3D_4 == 38 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_5: Assert( VERTEX_ELEMENT_TEXCOORD3D_5 == 39 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_6: Assert( VERTEX_ELEMENT_TEXCOORD3D_6 == 40 ); break; + case VERTEX_ELEMENT_TEXCOORD3D_7: Assert( VERTEX_ELEMENT_TEXCOORD3D_7 == 41 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_0: Assert( VERTEX_ELEMENT_TEXCOORD4D_0 == 42 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_1: Assert( VERTEX_ELEMENT_TEXCOORD4D_1 == 43 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_2: Assert( VERTEX_ELEMENT_TEXCOORD4D_2 == 44 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_3: Assert( VERTEX_ELEMENT_TEXCOORD4D_3 == 45 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_4: Assert( VERTEX_ELEMENT_TEXCOORD4D_4 == 46 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_5: Assert( VERTEX_ELEMENT_TEXCOORD4D_5 == 47 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_6: Assert( VERTEX_ELEMENT_TEXCOORD4D_6 == 48 ); break; + case VERTEX_ELEMENT_TEXCOORD4D_7: Assert( VERTEX_ELEMENT_TEXCOORD4D_7 == 49 ); break; default: Assert( 0 ); // Invalid input or VertexElement_t has definitely changed break; @@ -295,7 +297,9 @@ inline int GetVertexElementSize( VertexElement_t element, VertexCompressionType_ switch ( element ) { case VERTEX_ELEMENT_POSITION: return ( 3 * sizeof( float ) ); + case VERTEX_ELEMENT_POSITION4D: return ( 4 * sizeof( float ) ); case VERTEX_ELEMENT_NORMAL: return ( 3 * sizeof( float ) ); + case VERTEX_ELEMENT_NORMAL4D: return ( 4 * sizeof( float ) ); case VERTEX_ELEMENT_COLOR: return ( 4 * sizeof( unsigned char ) ); case VERTEX_ELEMENT_SPECULAR: return ( 4 * sizeof( unsigned char ) ); case VERTEX_ELEMENT_TANGENT_S: return ( 3 * sizeof( float ) ); @@ -366,7 +370,7 @@ enum MaterialVarFlags_t MATERIAL_VAR_SELFILLUM = (1 << 6), MATERIAL_VAR_ADDITIVE = (1 << 7), MATERIAL_VAR_ALPHATEST = (1 << 8), - MATERIAL_VAR_MULTIPASS = (1 << 9), +// MATERIAL_VAR_UNUSED = (1 << 9), MATERIAL_VAR_ZNEARER = (1 << 10), MATERIAL_VAR_MODEL = (1 << 11), MATERIAL_VAR_FLAT = (1 << 12), @@ -374,19 +378,21 @@ enum MaterialVarFlags_t MATERIAL_VAR_NOFOG = (1 << 14), MATERIAL_VAR_IGNOREZ = (1 << 15), MATERIAL_VAR_DECAL = (1 << 16), - MATERIAL_VAR_ENVMAPSPHERE = (1 << 17), - MATERIAL_VAR_NOALPHAMOD = (1 << 18), - MATERIAL_VAR_ENVMAPCAMERASPACE = (1 << 19), + MATERIAL_VAR_ENVMAPSPHERE = (1 << 17), // OBSOLETE +// MATERIAL_VAR_UNUSED = (1 << 18), + MATERIAL_VAR_ENVMAPCAMERASPACE = (1 << 19), // OBSOLETE MATERIAL_VAR_BASEALPHAENVMAPMASK = (1 << 20), MATERIAL_VAR_TRANSLUCENT = (1 << 21), MATERIAL_VAR_NORMALMAPALPHAENVMAPMASK = (1 << 22), - MATERIAL_VAR_NEEDS_SOFTWARE_SKINNING = (1 << 23), + MATERIAL_VAR_NEEDS_SOFTWARE_SKINNING = (1 << 23), // OBSOLETE MATERIAL_VAR_OPAQUETEXTURE = (1 << 24), - MATERIAL_VAR_ENVMAPMODE = (1 << 25), + MATERIAL_VAR_ENVMAPMODE = (1 << 25), // OBSOLETE MATERIAL_VAR_SUPPRESS_DECALS = (1 << 26), MATERIAL_VAR_HALFLAMBERT = (1 << 27), MATERIAL_VAR_WIREFRAME = (1 << 28), MATERIAL_VAR_ALLOWALPHATOCOVERAGE = (1 << 29), + MATERIAL_VAR_ALPHA_MODIFIED_BY_PROXY = (1 << 30), + MATERIAL_VAR_VERTEXFOG = (1 << 31), // NOTE: Only add flags here that either should be read from // .vmts or can be set directly from client code. Other, internal @@ -429,6 +435,10 @@ enum MaterialVarFlags2_t MATERIAL_VAR2_USES_VERTEXID = (1 << 17), MATERIAL_VAR2_SUPPORTS_HW_SKINNING = (1 << 18), MATERIAL_VAR2_SUPPORTS_FLASHLIGHT = (1 << 19), + MATERIAL_VAR2_USE_GBUFFER0 = (1 << 20), + MATERIAL_VAR2_USE_GBUFFER1 = (1 << 21), + MATERIAL_VAR2_SELFILLUMMASK = (1 << 22), + MATERIAL_VAR2_SUPPORTS_TESSELLATION = (1 << 23) }; @@ -581,8 +591,8 @@ abstract_class IMaterial virtual float GetAlphaModulation() = 0; virtual void GetColorModulation( float *r, float *g, float *b ) = 0; - // Gets the morph format - virtual MorphFormat_t GetMorphFormat() const = 0; + // Is this translucent given a particular alpha modulation? + virtual bool IsTranslucentUnderModulation( float fAlphaModulation = 1.0f ) const = 0; // fast find that stores the index of the found var in the string table in local cache virtual IMaterialVar * FindVarFast( char const *pVarName, unsigned int *pToken ) = 0; @@ -609,4 +619,45 @@ inline bool IsErrorMaterial( IMaterial *pMat ) } +// +// Vertex stream specifications +// + +struct VertexStreamSpec_t +{ + enum StreamSpec_t + { + STREAM_DEFAULT, // stream 0: with position, normal, etc. + STREAM_SPECULAR1, // stream 1: following specular vhv lighting + STREAM_FLEXDELTA, // stream 2: flex deltas + STREAM_MORPH, // stream 3: morph + STREAM_UNIQUE_A, // unique stream 4 + STREAM_UNIQUE_B, // unique stream 5 + STREAM_UNIQUE_C, // unique stream 6 + STREAM_UNIQUE_D, // unique stream 7 + STREAM_SUBDQUADS, // stream 8: quad buffer for subd's + }; + + enum + { + MAX_UNIQUE_STREAMS = 4 + }; + + VertexFormatFlags_t iVertexDataElement; + StreamSpec_t iStreamSpec; +}; + +inline VertexStreamSpec_t * FindVertexStreamSpec( VertexFormat_t iElement, VertexStreamSpec_t *arrVertexStreamSpec ) +{ + for ( ; arrVertexStreamSpec && + arrVertexStreamSpec->iVertexDataElement != VERTEX_FORMAT_UNKNOWN ; + ++ arrVertexStreamSpec ) + { + if ( arrVertexStreamSpec->iVertexDataElement == iElement ) + return arrVertexStreamSpec; + } + return NULL; +} + + #endif // IMATERIAL_H diff --git a/public/materialsystem/imaterialproxyfactory.h b/public/materialsystem/imaterialproxyfactory.h index ba73a0776..3a6af9ddd 100644 --- a/public/materialsystem/imaterialproxyfactory.h +++ b/public/materialsystem/imaterialproxyfactory.h @@ -20,6 +20,7 @@ abstract_class IMaterialProxyFactory public: virtual IMaterialProxy *CreateProxy( const char *proxyName ) = 0; virtual void DeleteProxy( IMaterialProxy *pProxy ) = 0; + virtual CreateInterfaceFn GetFactory() = 0; }; #endif // IMATERIALPROXYFACTORY_H diff --git a/public/materialsystem/imaterialsystem.h b/public/materialsystem/imaterialsystem.h index 8d863224a..e6997b710 100644 --- a/public/materialsystem/imaterialsystem.h +++ b/public/materialsystem/imaterialsystem.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -31,6 +31,10 @@ #include "materialsystem/imaterialsystemhardwareconfig.h" #include "materialsystem/IColorCorrection.h" +#if !defined( _X360 ) +// NOTE: Disable this for l4d2 in general!!! It allocates 4mb of rendertargets and causes Release/Reallocation of rendertargets. +//#define FEATURE_SUBD_SUPPORT +#endif //----------------------------------------------------------------------------- // forward declarations @@ -52,6 +56,13 @@ class IMatRenderContext; class ICallQueue; struct MorphWeight_t; class IFileList; +struct VertexStreamSpec_t; +struct ShaderStencilState_t; +struct MeshInstanceData_t; +class IClientMaterialSystem; +class CPaintMaterial; +class IPaintMapDataManager; +class IPaintMapTextureManager; //----------------------------------------------------------------------------- @@ -62,11 +73,6 @@ typedef uint64 VertexFormat_t; //----------------------------------------------------------------------------- // important enumeration //----------------------------------------------------------------------------- - -// NOTE NOTE NOTE!!!! If you up this, grep for "NEW_INTERFACE" to see if there is anything -// waiting to be enabled during an interface revision. -#define MATERIAL_SYSTEM_INTERFACE_VERSION "VMaterialSystem079" - enum ShaderParamType_t { SHADER_PARAM_TYPE_TEXTURE, @@ -89,23 +95,19 @@ enum MaterialMatrixMode_t MATERIAL_VIEW = 0, MATERIAL_PROJECTION, - // Texture matrices - MATERIAL_TEXTURE0, - MATERIAL_TEXTURE1, - MATERIAL_TEXTURE2, - MATERIAL_TEXTURE3, - MATERIAL_TEXTURE4, - MATERIAL_TEXTURE5, - MATERIAL_TEXTURE6, - MATERIAL_TEXTURE7, + MATERIAL_MATRIX_UNUSED0, + MATERIAL_MATRIX_UNUSED1, + MATERIAL_MATRIX_UNUSED2, + MATERIAL_MATRIX_UNUSED3, + MATERIAL_MATRIX_UNUSED4, + MATERIAL_MATRIX_UNUSED5, + MATERIAL_MATRIX_UNUSED6, + MATERIAL_MATRIX_UNUSED7, MATERIAL_MODEL, // Total number of matrices NUM_MATRIX_MODES = MATERIAL_MODEL+1, - - // Number of texture transforms - NUM_TEXTURE_TRANSFORMS = MATERIAL_TEXTURE7 - MATERIAL_TEXTURE0 + 1 }; // FIXME: How do I specify the actual number of matrix modes? @@ -122,6 +124,8 @@ enum MaterialPrimitiveType_t MATERIAL_LINE_LOOP, // a single line loop MATERIAL_POLYGON, // this is a *single* polygon MATERIAL_QUADS, + MATERIAL_SUBD_QUADS_EXTRA, // Extraordinary sub-d quads + MATERIAL_SUBD_QUADS_REG, // Regular sub-d quads MATERIAL_INSTANCED_QUADS, // (X360) like MATERIAL_QUADS, but uses vertex instancing // This is used for static meshes that contain multiple types of @@ -130,6 +134,13 @@ enum MaterialPrimitiveType_t MATERIAL_HETEROGENOUS }; +enum TessellationMode_t +{ + TESSELLATION_MODE_DISABLED = 0, + TESSELLATION_MODE_ACC_PATCHES_EXTRA, + TESSELLATION_MODE_ACC_PATCHES_REG +}; + enum MaterialPropertyTypes_t { MATERIAL_PROPERTY_NEEDS_LIGHTMAP = 0, // bool @@ -223,49 +234,27 @@ enum MaterialContextType_t //----------------------------------------------------------------------------- #include "mathlib/lightdesc.h" -#if 0 -enum LightType_t +enum { - MATERIAL_LIGHT_DISABLE = 0, - MATERIAL_LIGHT_POINT, - MATERIAL_LIGHT_DIRECTIONAL, - MATERIAL_LIGHT_SPOT, + MATERIAL_MAX_LIGHT_COUNT = 4, }; -enum LightType_OptimizationFlags_t +struct MaterialLightingState_t { - LIGHTTYPE_OPTIMIZATIONFLAGS_HAS_ATTENUATION0 = 1, - LIGHTTYPE_OPTIMIZATIONFLAGS_HAS_ATTENUATION1 = 2, - LIGHTTYPE_OPTIMIZATIONFLAGS_HAS_ATTENUATION2 = 4, -}; + Vector m_vecAmbientCube[6]; // ambient, and lights that aren't in locallight[] + Vector m_vecLightingOrigin; // The position from which lighting state was computed + int m_nLocalLightCount; + LightDesc_t m_pLocalLightDesc[MATERIAL_MAX_LIGHT_COUNT]; + MaterialLightingState_t &operator=( const MaterialLightingState_t &src ) + { + memcpy( this, &src, sizeof(MaterialLightingState_t) - MATERIAL_MAX_LIGHT_COUNT * sizeof(LightDesc_t) ); + memcpy( m_pLocalLightDesc, &src.m_pLocalLightDesc, src.m_nLocalLightCount * sizeof(LightDesc_t) ); + return *this; + } +}; -struct LightDesc_t -{ - LightType_t m_Type; - Vector m_Color; - Vector m_Position; - Vector m_Direction; - float m_Range; - float m_Falloff; - float m_Attenuation0; - float m_Attenuation1; - float m_Attenuation2; - float m_Theta; - float m_Phi; - // These aren't used by DX8. . used for software lighting. - float m_ThetaDot; - float m_PhiDot; - unsigned int m_Flags; - - - LightDesc_t() {} -private: - // No copy constructors allowed - LightDesc_t(const LightDesc_t& vOther); -}; -#endif #define CREATERENDERTARGETFLAGS_HDR 0x00000001 #define CREATERENDERTARGETFLAGS_AUTOMIPMAP 0x00000002 @@ -275,59 +264,6 @@ struct LightDesc_t #define CREATERENDERTARGETFLAGS_TEMP 0x00000010 // only allocates memory upon first resolve, destroyed at level end -//----------------------------------------------------------------------------- -// allowed stencil operations. These match the d3d operations -//----------------------------------------------------------------------------- -enum StencilOperation_t -{ -#if !defined( _X360 ) - STENCILOPERATION_KEEP = 1, - STENCILOPERATION_ZERO = 2, - STENCILOPERATION_REPLACE = 3, - STENCILOPERATION_INCRSAT = 4, - STENCILOPERATION_DECRSAT = 5, - STENCILOPERATION_INVERT = 6, - STENCILOPERATION_INCR = 7, - STENCILOPERATION_DECR = 8, -#else - STENCILOPERATION_KEEP = D3DSTENCILOP_KEEP, - STENCILOPERATION_ZERO = D3DSTENCILOP_ZERO, - STENCILOPERATION_REPLACE = D3DSTENCILOP_REPLACE, - STENCILOPERATION_INCRSAT = D3DSTENCILOP_INCRSAT, - STENCILOPERATION_DECRSAT = D3DSTENCILOP_DECRSAT, - STENCILOPERATION_INVERT = D3DSTENCILOP_INVERT, - STENCILOPERATION_INCR = D3DSTENCILOP_INCR, - STENCILOPERATION_DECR = D3DSTENCILOP_DECR, -#endif - STENCILOPERATION_FORCE_DWORD = 0x7fffffff -}; - -enum StencilComparisonFunction_t -{ -#if !defined( _X360 ) - STENCILCOMPARISONFUNCTION_NEVER = 1, - STENCILCOMPARISONFUNCTION_LESS = 2, - STENCILCOMPARISONFUNCTION_EQUAL = 3, - STENCILCOMPARISONFUNCTION_LESSEQUAL = 4, - STENCILCOMPARISONFUNCTION_GREATER = 5, - STENCILCOMPARISONFUNCTION_NOTEQUAL = 6, - STENCILCOMPARISONFUNCTION_GREATEREQUAL = 7, - STENCILCOMPARISONFUNCTION_ALWAYS = 8, -#else - STENCILCOMPARISONFUNCTION_NEVER = D3DCMP_NEVER, - STENCILCOMPARISONFUNCTION_LESS = D3DCMP_LESS, - STENCILCOMPARISONFUNCTION_EQUAL = D3DCMP_EQUAL, - STENCILCOMPARISONFUNCTION_LESSEQUAL = D3DCMP_LESSEQUAL, - STENCILCOMPARISONFUNCTION_GREATER = D3DCMP_GREATER, - STENCILCOMPARISONFUNCTION_NOTEQUAL = D3DCMP_NOTEQUAL, - STENCILCOMPARISONFUNCTION_GREATEREQUAL = D3DCMP_GREATEREQUAL, - STENCILCOMPARISONFUNCTION_ALWAYS = D3DCMP_ALWAYS, -#endif - - STENCILCOMPARISONFUNCTION_FORCE_DWORD = 0x7fffffff -}; - - //----------------------------------------------------------------------------- // Enumeration for the various fields capable of being morphed //----------------------------------------------------------------------------- @@ -383,6 +319,7 @@ struct MaterialAdapterInfo_t unsigned int m_SubSysID; unsigned int m_Revision; int m_nDXSupportLevel; // This is the *preferred* dx support level + int m_nMinDXSupportLevel; int m_nMaxDXSupportLevel; unsigned int m_nDriverVersionHigh; unsigned int m_nDriverVersionLow; @@ -400,6 +337,40 @@ struct MaterialVideoMode_t int m_RefreshRate; // 0 == default (ignored for windowed mode) }; + +//-------------------------------------------------------------------------------- +// Uberlight parameters +//-------------------------------------------------------------------------------- +struct UberlightState_t +{ + UberlightState_t() + { + m_fNearEdge = 2.0f; + m_fFarEdge = 100.0f; + m_fCutOn = 10.0f; + m_fCutOff = 650.0f; + m_fShearx = 0.0f; + m_fSheary = 0.0f; + m_fWidth = 0.3f; + m_fWedge = 0.05f; + m_fHeight = 0.3f; + m_fHedge = 0.05f; + m_fRoundness = 0.8f; + } + + float m_fNearEdge; + float m_fFarEdge; + float m_fCutOn; + float m_fCutOff; + float m_fShearx; + float m_fSheary; + float m_fWidth; + float m_fWedge; + float m_fHeight; + float m_fHedge; + float m_fRoundness; +}; + // fixme: should move this into something else. struct FlashlightState_t { @@ -413,12 +384,39 @@ struct FlashlightState_t m_flShadowDepthBias = 0.0005f; m_flShadowJitterSeed = 0.0f; m_flShadowAtten = 0.0f; + m_flAmbientOcclusion = 0.0f; + m_nShadowQuality = 0; + m_bShadowHighRes = false; + m_bScissor = false; m_nLeft = -1; m_nTop = -1; m_nRight = -1; m_nBottom = -1; - m_nShadowQuality = 0; + + m_bUberlight = false; + + m_bVolumetric = false; + m_flNoiseStrength = 0.8f; + m_flFlashlightTime = 0.0f; + m_nNumPlanes = 64; + m_flPlaneOffset = 0.0f; + m_flVolumetricIntensity = 1.0f; + + m_bOrtho = false; + m_fOrthoLeft = -1.0f; + m_fOrthoRight = 1.0f; + m_fOrthoTop = -1.0f; + m_fOrthoBottom = 1.0f; + + m_fBrightnessScale = 1.0f; + m_pSpotlightTexture = NULL; + m_pProjectedMaterial = NULL; + m_bGlobalLight = false; + + m_bSimpleProjection = false; + m_flProjectionSize = 500.0f; + m_flProjectionRotation = 0.0f; } Vector m_vecLightOrigin; @@ -427,12 +425,23 @@ struct FlashlightState_t float m_FarZ; float m_fHorizontalFOVDegrees; float m_fVerticalFOVDegrees; + + bool m_bOrtho; + float m_fOrthoLeft; + float m_fOrthoRight; + float m_fOrthoTop; + float m_fOrthoBottom; + float m_fQuadraticAtten; float m_fLinearAtten; float m_fConstantAtten; + float m_FarZAtten; float m_Color[4]; + float m_fBrightnessScale; ITexture *m_pSpotlightTexture; + IMaterial *m_pProjectedMaterial; int m_nSpotlightTextureFrame; + bool m_bGlobalLight; // Shadow depth mapping parameters bool m_bEnableShadows; @@ -443,14 +452,32 @@ struct FlashlightState_t float m_flShadowDepthBias; float m_flShadowJitterSeed; float m_flShadowAtten; + float m_flAmbientOcclusion; int m_nShadowQuality; + bool m_bShadowHighRes; + + // simple projection + bool m_bSimpleProjection; + float m_flProjectionSize; + float m_flProjectionRotation; + + // Uberlight parameters + bool m_bUberlight; + UberlightState_t m_uberlightState; + + bool m_bVolumetric; + float m_flNoiseStrength; + float m_flFlashlightTime; + int m_nNumPlanes; + float m_flPlaneOffset; + float m_flVolumetricIntensity; // Getters for scissor members - bool DoScissor() { return m_bScissor; } - int GetLeft() { return m_nLeft; } - int GetTop() { return m_nTop; } - int GetRight() { return m_nRight; } - int GetBottom() { return m_nBottom; } + bool DoScissor() const { return m_bScissor; } + int GetLeft() const { return m_nLeft; } + int GetTop() const { return m_nTop; } + int GetRight() const { return m_nRight; } + int GetBottom() const { return m_nBottom; } private: @@ -494,6 +521,7 @@ enum MaterialRenderTargetDepth_t enum RestoreChangeFlags_t { MATERIAL_RESTORE_VERTEX_FORMAT_CHANGED = 0x1, + MATERIAL_RESTORE_RELEASE_MANAGED_RESOURCES = 0x2, }; @@ -511,11 +539,12 @@ enum RenderTargetSizeMode_t RT_SIZE_FULL_FRAME_BUFFER_ROUNDED_UP=6 // Same size as the frame buffer, rounded up if necessary for systems that can't do non-power of two textures. }; -typedef void (*MaterialBufferReleaseFunc_t)( ); +typedef void (*MaterialBufferReleaseFunc_t)( int nChangeFlags ); // see RestoreChangeFlags_t typedef void (*MaterialBufferRestoreFunc_t)( int nChangeFlags ); // see RestoreChangeFlags_t typedef void (*ModeChangeCallbackFunc_t)( void ); +typedef void (*EndFrameCleanupFunc_t)( void ); -typedef int VertexBufferHandle_t; +//typedef int VertexBufferHandle_t; typedef unsigned short MaterialHandle_t; DECLARE_POINTER_HANDLE( OcclusionQueryObjectHandle_t ); @@ -528,6 +557,20 @@ class CShadowMgr; DECLARE_POINTER_HANDLE( MaterialLock_t ); +//----------------------------------------------------------------------------- +// Information about a material texture +//----------------------------------------------------------------------------- + +struct MaterialTextureInfo_t +{ + // Exclude information: + // -1 texture is not subject to exclude-handling + // 0 texture is completely excluded + // >0 texture is clamped according to exclude-instruction + int iExcludeInformation; +}; + + //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- @@ -639,8 +682,6 @@ abstract_class IMaterialSystem : public IAppSystem // Use this to spew information about the 3D layer virtual void SpewDriverInfo() const = 0; - virtual void GetDXLevelDefaults(uint &max_dxlevel,uint &recommended_dxlevel) = 0; - // Get the image format of the back buffer. . useful when creating render targets, etc. virtual void GetBackBufferDimensions( int &width, int &height) const = 0; virtual ImageFormat GetBackBufferFormat() const = 0; @@ -691,6 +732,10 @@ abstract_class IMaterialSystem : public IAppSystem virtual void AddRestoreFunc( MaterialBufferRestoreFunc_t func ) = 0; virtual void RemoveRestoreFunc( MaterialBufferRestoreFunc_t func ) = 0; + // Installs a function to be called when we need to delete objects at the end of the render frame + virtual void AddEndFrameCleanupFunc( EndFrameCleanupFunc_t func ) = 0; + virtual void RemoveEndFrameCleanupFunc( EndFrameCleanupFunc_t func ) = 0; + // Release temporary HW memory... virtual void ResetTempHWMemory( bool bExitingLevel = false ) = 0; @@ -732,7 +777,7 @@ abstract_class IMaterialSystem : public IAppSystem // Used to enable editor materials. Must be called before Init. virtual void EnableEditorMaterials() = 0; - + virtual void EnableGBuffers() = 0; // ----------------------------------------------------------- // Stub mode mode @@ -935,7 +980,7 @@ abstract_class IMaterialSystem : public IAppSystem virtual void ListUsedMaterials( void ) = 0; virtual HXUIFONT OpenTrueTypeFont( const char *pFontname, int tall, int style ) = 0; virtual void CloseTrueTypeFont( HXUIFONT hFont ) = 0; - virtual bool GetTrueTypeFontMetrics( HXUIFONT hFont, XUIFontMetrics *pFontMetrics, XUICharMetrics charMetrics[256] ) = 0; + virtual bool GetTrueTypeFontMetrics( HXUIFONT hFont, wchar_t wchFirst, wchar_t wchLast, XUIFontMetrics *pFontMetrics, XUICharMetrics *pCharMetrics ) = 0; // Render a sequence of characters and extract the data into a buffer // For each character, provide the width+height of the font texture subrect, // an offset to apply when rendering the glyph, and an offset into a buffer to receive the RGBA data @@ -950,7 +995,6 @@ abstract_class IMaterialSystem : public IAppSystem // ----------------------------------------------------------- virtual IMatRenderContext * GetRenderContext() = 0; - virtual bool SupportsShadowDepthTextures( void ) = 0; virtual void BeginUpdateLightmaps( void ) = 0; virtual void EndUpdateLightmaps( void ) = 0; @@ -960,11 +1004,6 @@ abstract_class IMaterialSystem : public IAppSystem virtual MaterialLock_t Lock() = 0; virtual void Unlock( MaterialLock_t ) = 0; - // Vendor-dependent shadow depth texture format - virtual ImageFormat GetShadowDepthTextureFormat() = 0; - - virtual bool SupportsFetch4( void ) = 0; - // Create a custom render context. Cannot be used to create MATERIAL_HARDWARE_CONTEXT virtual IMatRenderContext *CreateRenderContext( MaterialContextType_t type ) = 0; @@ -978,8 +1017,6 @@ abstract_class IMaterialSystem : public IAppSystem // Finds or create a procedural material. virtual IMaterial * FindProceduralMaterial( const char *pMaterialName, const char *pTextureGroupName, KeyValues *pVMTKeyValues ) = 0; - virtual ImageFormat GetNullTextureFormat() = 0; - virtual void AddTextureAlias( const char *pAlias, const char *pRealName ) = 0; virtual void RemoveTextureAlias( const char *pAlias ) = 0; @@ -997,6 +1034,24 @@ abstract_class IMaterialSystem : public IAppSystem // For sv_pure mode. The filesystem figures out which files the client needs to reload to be "pure" ala the server's preferences. virtual void ReloadFilesInList( IFileList *pFilesToReload ) = 0; + + // Get information about the texture for texture management tools + virtual bool GetTextureInformation( char const *szTextureName, MaterialTextureInfo_t &info ) const = 0; + + // call this once the render targets are allocated permanently at the beginning of the game + virtual void FinishRenderTargetAllocation( void ) = 0; + + virtual void ReEnableRenderTargetAllocation_IRealizeIfICallThisAllTexturesWillBeUnloadedAndLoadTimeWillSufferHorribly( void ) = 0; + virtual bool AllowThreading( bool bAllow, int nServiceThread ) = 0; + + virtual bool GetRecommendedVideoConfig( KeyValues *pKeyValues ) = 0; + + virtual IClientMaterialSystem* GetClientMaterialSystemInterface() = 0; + + virtual bool CanDownloadTextures() const = 0; + virtual int GetNumLightmapPages() const = 0; + + virtual IPaintMapTextureManager *RegisterPaintMapDataManager( IPaintMapDataManager *pDataManager ) = 0; //You supply an interface we can query for bits, it gives back an interface you can use to drive updates }; @@ -1035,8 +1090,8 @@ abstract_class IMatRenderContext : public IRefCounted virtual void ReadPixels( int x, int y, int width, int height, unsigned char *data, ImageFormat dstFormat ) = 0; // Sets lighting - virtual void SetAmbientLight( float r, float g, float b ) = 0; - virtual void SetLight( int lightNum, const LightDesc_t& desc ) = 0; + virtual void SetLightingState( const MaterialLightingState_t& state ) = 0; + virtual void SetLights( int nCount, const LightDesc_t *pLights ) = 0; // The faces of the cube are specified in the same order as cubemap textures virtual void SetAmbientLightCube( Vector4D cube[6] ) = 0; @@ -1079,6 +1134,7 @@ abstract_class IMatRenderContext : public IRefCounted // The cull mode virtual void CullMode( MaterialCullMode_t cullMode ) = 0; + virtual void FlipCullMode( void ) = 0; //CW->CCW or CCW->CW, intended for mirror support where the view matrix is flipped horizontally // end matrix api @@ -1105,7 +1161,7 @@ abstract_class IMatRenderContext : public IRefCounted virtual void SetNumBoneWeights( int numBones ) = 0; // Creates/destroys Mesh - virtual IMesh* CreateStaticMesh( VertexFormat_t fmt, const char *pTextureBudgetGroup, IMaterial * pMaterial = NULL ) = 0; + virtual IMesh* CreateStaticMesh( VertexFormat_t fmt, const char *pTextureBudgetGroup, IMaterial * pMaterial = NULL, VertexStreamSpec_t *pStreamSpec = NULL ) = 0; virtual void DestroyStaticMesh( IMesh* mesh ) = 0; // Gets the dynamic mesh associated with the currently bound material @@ -1143,7 +1199,7 @@ abstract_class IMatRenderContext : public IRefCounted virtual void DestroyIndexBuffer( IIndexBuffer * ) = 0; // Do we need to specify the stream here in the case of locking multiple dynamic VBs on different streams? virtual IVertexBuffer *GetDynamicVertexBuffer( int streamID, VertexFormat_t vertexFormat, bool bBuffered = true ) = 0; - virtual IIndexBuffer *GetDynamicIndexBuffer( MaterialIndexFormat_t fmt, bool bBuffered = true ) = 0; + virtual IIndexBuffer *GetDynamicIndexBuffer() = 0; virtual void BindVertexBuffer( int streamID, IVertexBuffer *pVertexBuffer, int nOffsetInBytes, int nFirstVertex, int nVertexCount, VertexFormat_t fmt, int nRepetitions = 1 ) = 0; virtual void BindIndexBuffer( IIndexBuffer *pIndexBuffer, int nOffsetInBytes ) = 0; virtual void Draw( MaterialPrimitiveType_t primitiveType, int firstIndex, int numIndices ) = 0; @@ -1217,9 +1273,6 @@ abstract_class IMatRenderContext : public IRefCounted // Used to make the handle think it's never had a successful query before virtual void ResetOcclusionQueryObject( OcclusionQueryObjectHandle_t ) = 0; - // FIXME: Remove - virtual void Unused3() {} - // Creates/destroys morph data associated w/ a particular material virtual IMorph *CreateMorph( MorphFormat_t format, const char *pDebugName ) = 0; virtual void DestroyMorph( IMorph *pMorph ) = 0; @@ -1230,12 +1283,22 @@ abstract_class IMatRenderContext : public IRefCounted // Sets flexweights for rendering virtual void SetFlexWeights( int nFirstWeight, int nCount, const MorphWeight_t* pWeights ) = 0; - // FIXME: Remove - virtual void Unused4() {}; - virtual void Unused5() {}; - virtual void Unused6() {}; - virtual void Unused7() {}; - virtual void Unused8() {}; + // Allocates temp render data. Renderdata goes out of scope at frame end in multicore + // Renderdata goes out of scope after refcount goes to zero in singlecore. + // Locking/unlocking increases + decreases refcount + virtual void * LockRenderData( int nSizeInBytes ) = 0; + virtual void UnlockRenderData( void *pData ) = 0; + + // Typed version. If specified, pSrcData is copied into the locked memory. + template< class E > E* LockRenderDataTyped( int nCount, const E* pSrcData = NULL ); + + // Temp render data gets immediately freed after it's all unlocked in single core. + // This prevents it from being freed + virtual void AddRefRenderData() = 0; + virtual void ReleaseRenderData() = 0; + + // Returns whether a pointer is render data. NOTE: passing NULL returns true + virtual bool IsRenderData( const void *pData ) const = 0; // Read w/ stretch to a host-memory buffer virtual void ReadPixelsAndStretch( Rect_t *pSrcRect, Rect_t *pDstRect, unsigned char *pBuffer, ImageFormat dstFormat, int nDstStride ) = 0; @@ -1286,6 +1349,9 @@ abstract_class IMatRenderContext : public IRefCounted // Special off-center perspective matrix for DoF, MSAA jitter and poster rendering virtual void PerspectiveOffCenterX( double fovx, double aspect, double zNear, double zFar, double bottom, double top, double left, double right ) = 0; + // Sets the ambient light color + virtual void SetAmbientLightColor( float r, float g, float b ) = 0; + // Rendering parameters control special drawing modes withing the material system, shader // system, shaders, and engine. renderparm.h has their definitions. virtual void SetFloatRenderingParameter(int parm_number, float value) = 0; @@ -1293,14 +1359,7 @@ abstract_class IMatRenderContext : public IRefCounted virtual void SetVectorRenderingParameter(int parm_number, Vector const &value) = 0; // stencil buffer operations. - virtual void SetStencilEnable(bool onoff) = 0; - virtual void SetStencilFailOperation(StencilOperation_t op) = 0; - virtual void SetStencilZFailOperation(StencilOperation_t op) = 0; - virtual void SetStencilPassOperation(StencilOperation_t op) = 0; - virtual void SetStencilCompareFunction(StencilComparisonFunction_t cmpfn) = 0; - virtual void SetStencilReferenceValue(int ref) = 0; - virtual void SetStencilTestMask(uint32 msk) = 0; - virtual void SetStencilWriteMask(uint32 msk) = 0; + virtual void SetStencilState( const ShaderStencilState_t &state ) = 0; virtual void ClearStencilBufferRectangle(int xmin, int ymin, int xmax, int ymax,int value) =0; virtual void SetRenderTargetEx( int nRenderTargetID, ITexture *pTexture ) = 0; @@ -1327,6 +1386,7 @@ abstract_class IMatRenderContext : public IRefCounted virtual IMesh *GetFlexMesh() = 0; virtual void SetFlashlightStateEx( const FlashlightState_t &state, const VMatrix &worldToTexture, ITexture *pFlashlightDepthTexture ) = 0; + virtual void SetFlashlightStateExDeRef( const FlashlightState_t &state, ITexture *pFlashlightDepthTexture ) = 0; // Returns the currently bound local cubemap virtual ITexture *GetLocalCubemap( ) = 0; @@ -1360,19 +1420,11 @@ abstract_class IMatRenderContext : public IRefCounted virtual void GetWorldSpaceCameraPosition( Vector *pCameraPos ) = 0; virtual void GetWorldSpaceCameraVectors( Vector *pVecForward, Vector *pVecRight, Vector *pVecUp ) = 0; - // Tone mapping - virtual void ResetToneMappingScale( float monoscale) = 0; // set scale to monoscale instantly with no chasing - virtual void SetGoalToneMappingScale( float monoscale) = 0; // set scale to monoscale instantly with no chasing - - // call TurnOnToneMapping before drawing the 3d scene to get the proper interpolated brightness - // value set. - virtual void TurnOnToneMapping() = 0; - // Set a linear vector color scale for all 3D rendering. // A value of [1.0f, 1.0f, 1.0f] should match non-tone-mapped rendering. virtual void SetToneMappingScaleLinear( const Vector &scale ) = 0; - virtual Vector GetToneMappingScaleLinear( void ) = 0; + virtual void SetShadowDepthBiasFactors( float fSlopeScaleDepthBias, float fDepthBias ) = 0; // Apply stencil operations to every pixel on the screen without disturbing depth or color buffers @@ -1384,7 +1436,7 @@ abstract_class IMatRenderContext : public IRefCounted // Set scissor rect for rendering virtual void SetScissorRect( const int nLeft, const int nTop, const int nRight, const int nBottom, const bool bEnableScissor ) = 0; - // Methods used to build the morph accumulator that is read from when HW morph CW) + virtual void FlipCulling( bool bFlipCulling ) = 0; + + virtual void SetTextureRenderingParameter(int parm_number, ITexture *pTexture) = 0; + + //only actually sets a bool that can be read in from shaders, doesn't do any of the legwork + virtual void EnableSinglePassFlashlightMode( bool bEnable ) = 0; + + // Draws instances with different meshes + virtual void DrawInstances( int nInstanceCount, const MeshInstanceData_t *pInstance ) = 0; + + // Allows us to override the color/alpha write settings of a material + virtual void OverrideAlphaWriteEnable( bool bOverrideEnable, bool bAlphaWriteEnable ) = 0; + virtual void OverrideColorWriteEnable( bool bOverrideEnable, bool bColorWriteEnable ) = 0; + + virtual void ClearBuffersObeyStencilEx( bool bClearColor, bool bClearAlpha, bool bClearDepth ) = 0; + + // Subdivision surface interface + virtual int GetSubDBufferWidth() = 0; + virtual float* LockSubDBuffer( int nNumRows ) = 0; + virtual void UnlockSubDBuffer() = 0; + + // Update current frame's game time for the shader api. + virtual void UpdateGameTime( float flTime ) = 0; + + virtual void PrintfVA( char *fmt, va_list vargs ) = 0; + virtual void Printf( char *fmt, ... ) = 0; + virtual float Knob( char *knobname, float *setvalue = NULL ) = 0; +}; + + +template< class E > inline E* IMatRenderContext::LockRenderDataTyped( int nCount, const E* pSrcData ) +{ + int nSizeInBytes = nCount * sizeof(E); + E *pDstData = (E*)LockRenderData( nSizeInBytes ); + if ( pSrcData && pDstData ) + { + memcpy( pDstData, pSrcData, nSizeInBytes ); + } + return pDstData; +} + + +//----------------------------------------------------------------------------- +// Utility class for addreffing/releasing render data (prevents freeing on single core) +//----------------------------------------------------------------------------- +class CMatRenderDataReference +{ +public: + CMatRenderDataReference(); + CMatRenderDataReference( IMatRenderContext* pRenderContext ); + ~CMatRenderDataReference(); + void Lock( IMatRenderContext *pRenderContext ); + void Release(); + +private: + IMatRenderContext *m_pRenderContext; +}; + + +inline CMatRenderDataReference::CMatRenderDataReference() +{ + m_pRenderContext = NULL; +} + +inline CMatRenderDataReference::CMatRenderDataReference( IMatRenderContext* pRenderContext ) +{ + m_pRenderContext = NULL; + Lock( pRenderContext ); +} + +inline CMatRenderDataReference::~CMatRenderDataReference() +{ + Release(); +} + +inline void CMatRenderDataReference::Lock( IMatRenderContext* pRenderContext ) +{ + if ( !m_pRenderContext ) + { + m_pRenderContext = pRenderContext; + m_pRenderContext->AddRefRenderData( ); + } +} + +inline void CMatRenderDataReference::Release() +{ + if ( m_pRenderContext ) + { + m_pRenderContext->ReleaseRenderData( ); + m_pRenderContext = NULL; + } +} + + +//----------------------------------------------------------------------------- +// Utility class for locking/unlocking render data +//----------------------------------------------------------------------------- +template< typename E > +class CMatRenderData +{ +public: + CMatRenderData( IMatRenderContext* pRenderContext ); + CMatRenderData( IMatRenderContext* pRenderContext, int nCount, const E *pSrcData = NULL ); + ~CMatRenderData(); + E* Lock( int nCount, const E* pSrcData = NULL ); + void Release(); + bool IsValid() const; + const E* Base() const; + E* Base(); + const E& operator[]( int i ) const; + E& operator[]( int i ); + +private: + IMatRenderContext* m_pRenderContext; + E *m_pRenderData; + int m_nCount; + bool m_bNeedsUnlock; }; +template< typename E > +inline CMatRenderData::CMatRenderData( IMatRenderContext* pRenderContext ) +{ + m_pRenderContext = pRenderContext; + m_nCount = 0; + m_pRenderData = 0; + m_bNeedsUnlock = false; +} + +template< typename E > +inline CMatRenderData::CMatRenderData( IMatRenderContext* pRenderContext, int nCount, const E* pSrcData ) +{ + m_pRenderContext = pRenderContext; + m_nCount = 0; + m_pRenderData = 0; + m_bNeedsUnlock = false; + Lock( nCount, pSrcData ); +} + +template< typename E > +inline CMatRenderData::~CMatRenderData() +{ + Release(); +} + +template< typename E > +inline bool CMatRenderData::IsValid() const +{ + return m_pRenderData != NULL; +} + +template< typename E > +inline E* CMatRenderData::Lock( int nCount, const E* pSrcData ) +{ + m_nCount = nCount; + if ( pSrcData && m_pRenderContext->IsRenderData( pSrcData ) ) + { + // Yes, we're const-casting away, but that should be ok since + // the src data is render data + m_pRenderData = const_cast( pSrcData ); + m_pRenderContext->AddRefRenderData(); + m_bNeedsUnlock = false; + return m_pRenderData; + } + m_pRenderData = m_pRenderContext->LockRenderDataTyped( nCount, pSrcData ); + m_bNeedsUnlock = true; + return m_pRenderData; +} + +template< typename E > +inline void CMatRenderData::Release() +{ + if ( m_pRenderContext && m_pRenderData ) + { + if ( m_bNeedsUnlock ) + { + m_pRenderContext->UnlockRenderData( m_pRenderData ); + } + else + { + m_pRenderContext->ReleaseRenderData(); + } + } + m_pRenderData = NULL; + m_nCount = 0; + m_bNeedsUnlock = false; +} + +template< typename E > +inline E* CMatRenderData::Base() +{ + return m_pRenderData; +} + +template< typename E > +inline const E* CMatRenderData::Base() const +{ + return m_pRenderData; +} + +template< typename E > +inline E& CMatRenderData::operator[]( int i ) +{ + Assert( ( i >= 0 ) && ( i < m_nCount ) ); + return m_pRenderData[i]; +} + +template< typename E > +inline const E& CMatRenderData::operator[]( int i ) const +{ + Assert( ( i >= 0 ) && ( i < m_nCount ) ); + return m_pRenderData[i]; +} + + //----------------------------------------------------------------------------- class CMatRenderContextPtr : public CRefPtr @@ -1511,7 +1782,4 @@ static void DoMatSysQueueMark( IMaterialSystem *pMaterialSystem, const char *psz //----------------------------------------------------------------------------- -extern IMaterialSystem *materials; -extern IMaterialSystem *g_pMaterialSystem; - #endif // IMATERIALSYSTEM_H diff --git a/public/materialsystem/imaterialsystemhardwareconfig.h b/public/materialsystem/imaterialsystemhardwareconfig.h index c4f14e553..50b517420 100644 --- a/public/materialsystem/imaterialsystemhardwareconfig.h +++ b/public/materialsystem/imaterialsystemhardwareconfig.h @@ -15,12 +15,14 @@ #include "tier1/interface.h" +#include "tier2/tier2.h" + +#include "bitmap/imageformat.h" //----------------------------------------------------------------------------- // Material system interface version //----------------------------------------------------------------------------- -#define MATERIALSYSTEM_HARDWARECONFIG_INTERFACE_VERSION "MaterialSystemHardwareConfig012" // HDRFIXME NOTE: must match common_ps_fxc.h enum HDRType_t @@ -76,39 +78,19 @@ virtual ret_type method const = 0; class IMaterialSystemHardwareConfig { public: - // on xbox, some methods are inlined to return constants - - DEFCONFIGMETHOD( bool, HasDestAlphaBuffer(), true ); - DEFCONFIGMETHOD( bool, HasStencilBuffer(), true ); virtual int GetFrameBufferColorDepth() const = 0; virtual int GetSamplerCount() const = 0; virtual bool HasSetDeviceGammaRamp() const = 0; - DEFCONFIGMETHOD( bool, SupportsCompressedTextures(), true ); virtual VertexCompressionType_t SupportsCompressedVertices() const = 0; - DEFCONFIGMETHOD( bool, SupportsNormalMapCompression(), true ); - DEFCONFIGMETHOD( bool, SupportsVertexAndPixelShaders(), true ); - DEFCONFIGMETHOD( bool, SupportsPixelShaders_1_4(), true ); - DEFCONFIGMETHOD( bool, SupportsPixelShaders_2_0(), true ); - DEFCONFIGMETHOD( bool, SupportsVertexShaders_2_0(), true ); virtual int MaximumAnisotropicLevel() const = 0; // 0 means no anisotropic filtering virtual int MaxTextureWidth() const = 0; virtual int MaxTextureHeight() const = 0; virtual int TextureMemorySize() const = 0; - virtual bool SupportsOverbright() const = 0; - virtual bool SupportsCubeMaps() const = 0; virtual bool SupportsMipmappedCubemaps() const = 0; - virtual bool SupportsNonPow2Textures() const = 0; - // The number of texture stages represents the number of computations - // we can do in the fixed-function pipeline, it is *not* related to the - // simultaneous number of textures we can use - virtual int GetTextureStageCount() const = 0; virtual int NumVertexShaderConstants() const = 0; virtual int NumPixelShaderConstants() const = 0; virtual int MaxNumLights() const = 0; - virtual bool SupportsHardwareLighting() const = 0; - virtual int MaxBlendMatrices() const = 0; - virtual int MaxBlendMatrixIndices() const = 0; virtual int MaxTextureAspectRatio() const = 0; virtual int MaxVertexShaderBlendMatrices() const = 0; virtual int MaxUserClipPlanes() const = 0; @@ -126,18 +108,9 @@ class IMaterialSystemHardwareConfig DEFCONFIGMETHOD( bool, SupportsHDR(), true ); - virtual bool HasProjectedBumpEnv() const = 0; - virtual bool SupportsSpheremapping() const = 0; virtual bool NeedsAAClamp() const = 0; virtual bool NeedsATICentroidHack() const = 0; - virtual bool SupportsColorOnSecondStream() const = 0; - virtual bool SupportsStaticPlusDynamicLighting() const = 0; - - // Does our card have a hard time with fillrate - // relative to other cards w/ the same dx level? - virtual bool PreferReducedFillrate() const = 0; - // This is the max dx support level supported by the card virtual int GetMaxDXSupportLevel() const = 0; @@ -150,7 +123,7 @@ class IMaterialSystemHardwareConfig virtual bool IsAAEnabled() const = 0; // Is antialiasing being used? // NOTE: Anything after this was added after shipping HL2. - virtual int GetVertexTextureCount() const = 0; + virtual int GetVertexSamplerCount() const = 0; virtual int GetMaxVertexTextureDimension() const = 0; virtual int MaxTextureDepth() const = 0; @@ -158,7 +131,6 @@ class IMaterialSystemHardwareConfig virtual HDRType_t GetHDRType() const = 0; virtual HDRType_t GetHardwareHDRType() const = 0; - DEFCONFIGMETHOD( bool, SupportsPixelShaders_2_b(), true ); virtual bool SupportsStreamOffset() const = 0; virtual int StencilBufferBits() const = 0; @@ -172,13 +144,9 @@ class IMaterialSystemHardwareConfig DEFCONFIGMETHOD( bool, UsesSRGBCorrectBlending(), true ); - virtual bool SupportsShaderModel_3_0() const = 0; virtual bool HasFastVertexTextures() const = 0; virtual int MaxHWMorphBatchCount() const = 0; - // Does the board actually support this? - DEFCONFIGMETHOD( bool, ActuallySupportsPixelShaders_2_b(), true ); - virtual bool SupportsHDRMode( HDRType_t nHDRMode ) const = 0; virtual bool GetHDREnabled( void ) const = 0; @@ -186,6 +154,27 @@ class IMaterialSystemHardwareConfig virtual bool SupportsBorderColor( void ) const = 0; virtual bool SupportsFetch4( void ) const = 0; + + virtual float GetShadowDepthBias() const = 0; + virtual float GetShadowSlopeScaleDepthBias() const = 0; + + virtual bool PreferZPrepass() const = 0; + + virtual bool SuppressPixelShaderCentroidHackFixup() const = 0; + virtual bool PreferTexturesInHWMemory() const = 0; + virtual bool PreferHardwareSync() const = 0; + virtual bool ActualHasFastVertexTextures() const = 0; + + virtual bool SupportsShadowDepthTextures( void ) const = 0; + virtual ImageFormat GetShadowDepthTextureFormat( void ) const = 0; + virtual ImageFormat GetNullTextureFormat( void ) const = 0; + virtual int GetMinDXSupportLevel() const = 0; + virtual bool IsUnsupported() const = 0; + + // Backward compat for stdshaders +#if defined ( STDSHADER_DBG_DLL_EXPORT ) || defined( STDSHADER_DX9_DLL_EXPORT ) + inline bool SupportsPixelShaders_2_b() const { return GetDXSupportLevel() >= 92; } +#endif }; #endif // IMATERIALSYSTEMHARDWARECONFIG_H diff --git a/public/materialsystem/imesh.h b/public/materialsystem/imesh.h index 617bbf824..16fce7b18 100644 --- a/public/materialsystem/imesh.h +++ b/public/materialsystem/imesh.h @@ -18,6 +18,10 @@ #include "tier0/dbg.h" #include "tier2/meshutils.h" +#ifdef OSX + // leaving this disabled while we test out EXT_vertex_array_bgra on 10.6.4 drivers + //#define OPENGL_SWAP_COLORS defined +#endif //----------------------------------------------------------------------------- // forward declarations @@ -26,6 +30,7 @@ class IMaterial; class CMeshBuilder; class IMaterialVar; typedef uint64 VertexFormat_t; +struct ShaderStencilState_t; //----------------------------------------------------------------------------- @@ -157,7 +162,7 @@ struct IndexDesc_t // 1 if the device is active, 0 if the device isn't active. // Faster than doing if checks for null m_pIndices if someone is // trying to write the m_pIndices while the device is inactive. - unsigned char m_nIndexSize; + unsigned int m_nIndexSize; }; @@ -172,19 +177,48 @@ struct MeshDesc_t : public VertexDesc_t, public IndexDesc_t //----------------------------------------------------------------------------- // Standard vertex formats for models //----------------------------------------------------------------------------- -struct ModelVertexDX7_t +struct ModelVertexDX8_t { Vector m_vecPosition; - Vector2D m_flBoneWeights; - unsigned int m_nBoneIndices; Vector m_vecNormal; - unsigned int m_nColor; // ARGB Vector2D m_vecTexCoord; + Vector4D m_vecUserData; }; -struct ModelVertexDX8_t : public ModelVertexDX7_t +//--------------------------------------------------------------------------------------- +// Thin Vertex format for use with ATI tessellator in quad mode +//--------------------------------------------------------------------------------------- +struct QuadTessVertex_t { - Vector4D m_vecUserData; + Vector4D m_vTangent; // last component is Binormal flip and Wrinkle weight + Vector4D m_vUV01; // UV coordinates for points Interior (0), and Parametric V Edge (1) + Vector4D m_vUV23; // UV coordinates for points Parametric U Edge (2), and Corner (3) +}; + +struct MeshBoneRemap_t // see BoneStateChangeHeader_t +{ + DECLARE_BYTESWAP_DATADESC(); + int m_nActualBoneIndex; + int m_nSrcBoneIndex; +}; + +struct MeshInstanceData_t +{ + int m_nIndexOffset; + int m_nIndexCount; + int m_nBoneCount; + MeshBoneRemap_t * m_pBoneRemap; // there are bone count of these, they index into pose to world + matrix3x4_t * m_pPoseToWorld; // transforms for the *entire* model, indexed into by m_pBoneIndex. Potentially more than bone count of these + const ITexture * m_pEnvCubemap; + MaterialLightingState_t *m_pLightingState; + MaterialPrimitiveType_t m_nPrimType; + const IVertexBuffer * m_pVertexBuffer; + int m_nVertexOffsetInBytes; + const IIndexBuffer * m_pIndexBuffer; + const IVertexBuffer * m_pColorBuffer; + int m_nColorVertexOffsetInBytes; + ShaderStencilState_t * m_pStencilState; + Vector4D m_DiffuseModulation; }; @@ -286,7 +320,7 @@ abstract_class IIndexBuffer virtual bool Lock( int nMaxIndexCount, bool bAppend, IndexDesc_t &desc ) = 0; virtual void Unlock( int nWrittenIndexCount, IndexDesc_t &desc ) = 0; - // FIXME: Remove this!! + // FIXME: Remove this!! Here only for backward compat on IMesh // Locks, unlocks the index buffer for modify virtual void ModifyBegin( bool bReadOnly, int nFirstIndex, int nIndexCount, IndexDesc_t& desc ) = 0; virtual void ModifyEnd( IndexDesc_t& desc ) = 0; @@ -296,6 +330,9 @@ abstract_class IIndexBuffer // Ensures the data in the index buffer is valid virtual void ValidateData( int nIndexCount, const IndexDesc_t &desc ) = 0; + + // For backward compat to IMesh + virtual IMesh* GetMesh() = 0; }; @@ -352,6 +389,11 @@ abstract_class IMesh : public IVertexBuffer, public IIndexBuffer virtual void MarkAsDrawn() = 0; + // NOTE: I chose to create this method strictly because it's 2 days to code lock + // and I could use the DrawInstances technique without a larger code change + // Draws the mesh w/ modulation. + virtual void DrawModulated( const Vector4D &diffuseModulation, int nFirstIndex = -1, int nIndexCount = 0 ) = 0; + #if defined( _X360 ) virtual unsigned ComputeMemoryUsed() = 0; #endif @@ -362,6 +404,13 @@ abstract_class IMesh : public IVertexBuffer, public IIndexBuffer #define INVALID_BUFFER_OFFSET 0xFFFFFFFFUL +// flags for advancevertex optimization +#define VTX_HAVEPOS 1 +#define VTX_HAVENORMAL 2 +#define VTX_HAVECOLOR 4 +#define VTX_HAVEALL ( VTX_HAVEPOS | VTX_HAVENORMAL | VTX_HAVECOLOR ) + + //----------------------------------------------------------------------------- // // Helper class used to define vertex buffers @@ -431,7 +480,8 @@ class CVertexBuilder : private VertexDesc_t void SelectVertex( int idx ); // Advances the current vertex and index by one - void AdvanceVertex(); + void AdvanceVertex( void ); + template void AdvanceVertexF( void ); void AdvanceVertices( int nVerts ); int GetCurrentVertex() const; @@ -485,6 +535,8 @@ class CVertexBuilder : private VertexDesc_t void Color3ubv( unsigned char const* rgb ); void Color4ub( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); void Color4ubv( unsigned char const* rgba ); + void Color4Packed( int packedColor ); + int PackColor4( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); // specular color setting void Specular3f( float r, float g, float b ); @@ -522,11 +574,14 @@ class CVertexBuilder : private VertexDesc_t // bone weights void BoneWeight( int idx, float weight ); + void BoneWeights2( float weight1, float weight2 ); + // bone weights (templatized for code which needs to support compressed vertices) template void CompressedBoneWeight3fv( const float * pWeights ); // bone matrix index void BoneMatrix( int idx, int matrixIndex ); + void BoneMatrices4( int matrixIdx0, int matrixIdx1, int matrixIdx2, int matrixIdx3 ); // Generic per-vertex data void UserData( const float* pData ); @@ -536,18 +591,9 @@ class CVertexBuilder : private VertexDesc_t // Fast Vertex! No need to call advance vertex, and no random access allowed. // WARNING - these are low level functions that are intended only for use // in the software vertex skinner. - void FastVertex( const ModelVertexDX7_t &vertex ); - void FastVertexSSE( const ModelVertexDX7_t &vertex ); - - // store 4 dx7 vertices fast. for special sse dx7 pipeline - void Fast4VerticesSSE( - ModelVertexDX7_t const *vtx_a, - ModelVertexDX7_t const *vtx_b, - ModelVertexDX7_t const *vtx_c, - ModelVertexDX7_t const *vtx_d); - void FastVertex( const ModelVertexDX8_t &vertex ); void FastVertexSSE( const ModelVertexDX8_t &vertex ); + void FastQuadVertexSSE( const QuadTessVertex_t &vertex ); // Add number of verts and current vert since FastVertex routines do not update. void FastAdvanceNVertices( int n ); @@ -581,8 +627,8 @@ class CVertexBuilder : private VertexDesc_t // Optimization: Pointer to the current pos, norm, texcoord, and color mutable float *m_pCurrPosition; mutable float *m_pCurrNormal; - mutable float *m_pCurrTexCoord[VERTEX_MAX_TEXTURE_COORDINATES]; mutable unsigned char *m_pCurrColor; + mutable float *m_pCurrTexCoord[VERTEX_MAX_TEXTURE_COORDINATES]; // Total number of vertices appended int m_nTotalVertexCount; @@ -1038,26 +1084,38 @@ inline void CVertexBuilder::SelectVertex( int nIndex ) //----------------------------------------------------------------------------- // Advances vertex after you're done writing to it. //----------------------------------------------------------------------------- -inline void CVertexBuilder::AdvanceVertex() + +template FORCEINLINE void CVertexBuilder::AdvanceVertexF() { if ( ++m_nCurrentVertex > m_nVertexCount ) { m_nVertexCount = m_nCurrentVertex; } - IncrementFloatPointer( m_pCurrPosition, m_VertexSize_Position ); - IncrementFloatPointer( m_pCurrNormal, m_VertexSize_Normal ); + if ( nFlags & VTX_HAVEPOS ) + IncrementFloatPointer( m_pCurrPosition, m_VertexSize_Position ); + if ( nFlags & VTX_HAVENORMAL ) + IncrementFloatPointer( m_pCurrNormal, m_VertexSize_Normal ); + if ( nFlags & VTX_HAVECOLOR ) + m_pCurrColor += m_VertexSize_Color; COMPILE_TIME_ASSERT( VERTEX_MAX_TEXTURE_COORDINATES == 8 ); - IncrementFloatPointer( m_pCurrTexCoord[0], m_VertexSize_TexCoord[0] ); - IncrementFloatPointer( m_pCurrTexCoord[1], m_VertexSize_TexCoord[1] ); - IncrementFloatPointer( m_pCurrTexCoord[2], m_VertexSize_TexCoord[2] ); - IncrementFloatPointer( m_pCurrTexCoord[3], m_VertexSize_TexCoord[3] ); - IncrementFloatPointer( m_pCurrTexCoord[4], m_VertexSize_TexCoord[4] ); - IncrementFloatPointer( m_pCurrTexCoord[5], m_VertexSize_TexCoord[5] ); - IncrementFloatPointer( m_pCurrTexCoord[6], m_VertexSize_TexCoord[6] ); - IncrementFloatPointer( m_pCurrTexCoord[7], m_VertexSize_TexCoord[7] ); - m_pCurrColor += m_VertexSize_Color; + if ( nNumTexCoords > 0 ) + IncrementFloatPointer( m_pCurrTexCoord[0], m_VertexSize_TexCoord[0] ); + if ( nNumTexCoords > 1 ) + IncrementFloatPointer( m_pCurrTexCoord[1], m_VertexSize_TexCoord[1] ); + if ( nNumTexCoords > 2 ) + IncrementFloatPointer( m_pCurrTexCoord[2], m_VertexSize_TexCoord[2] ); + if ( nNumTexCoords > 3 ) + IncrementFloatPointer( m_pCurrTexCoord[3], m_VertexSize_TexCoord[3] ); + if ( nNumTexCoords > 4 ) + IncrementFloatPointer( m_pCurrTexCoord[4], m_VertexSize_TexCoord[4] ); + if ( nNumTexCoords > 5 ) + IncrementFloatPointer( m_pCurrTexCoord[5], m_VertexSize_TexCoord[5] ); + if ( nNumTexCoords > 6 ) + IncrementFloatPointer( m_pCurrTexCoord[6], m_VertexSize_TexCoord[6] ); + if ( nNumTexCoords > 7 ) + IncrementFloatPointer( m_pCurrTexCoord[7], m_VertexSize_TexCoord[7] ); #if ( defined( _DEBUG ) && ( COMPRESSED_NORMALS_TYPE == COMPRESSED_NORMALS_COMBINEDTANGENTS_UBYTE4 ) ) m_bWrittenNormal = false; @@ -1065,6 +1123,12 @@ inline void CVertexBuilder::AdvanceVertex() #endif } +inline void CVertexBuilder::AdvanceVertex() +{ + AdvanceVertexF(); +} + + inline void CVertexBuilder::AdvanceVertices( int nVerts ) { m_nCurrentVertex += nVerts; @@ -1103,11 +1167,7 @@ inline void CVertexBuilder::FastAdvanceNVertices( int n ) m_nVertexCount = m_nCurrentVertex; } - -//----------------------------------------------------------------------------- -// Fast Vertex! No need to call advance vertex, and no random access allowed -//----------------------------------------------------------------------------- -inline void CVertexBuilder::FastVertex( const ModelVertexDX7_t &vertex ) +inline void CVertexBuilder::FastVertex( const ModelVertexDX8_t &vertex ) { Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed Assert( m_nCurrentVertex < m_nMaxVertexCount ); @@ -1115,7 +1175,6 @@ inline void CVertexBuilder::FastVertex( const ModelVertexDX7_t &vertex ) #if defined( _WIN32 ) && !defined( _X360 ) const void *pRead = &vertex; void *pCurrPos = m_pCurrPosition; - __asm { mov esi, pRead @@ -1137,12 +1196,34 @@ inline void CVertexBuilder::FastVertex( const ModelVertexDX7_t &vertex ) emms } +#elif defined(GNUC) + const void *pRead = &vertex; + void *pCurrPos = m_pCurrPosition; + __asm__ __volatile__ ( + "movq (%0), %%mm0\n" + "movq 8(%0), %%mm1\n" + "movq 16(%0), %%mm2\n" + "movq 24(%0), %%mm3\n" + "movq 32(%0), %%mm4\n" + "movq 40(%0), %%mm5\n" + "movq 48(%0), %%mm6\n" + "movq 56(%0), %%mm7\n" + "movntq %%mm0, (%1)\n" + "movntq %%mm1, 8(%1)\n" + "movntq %%mm2, 16(%1)\n" + "movntq %%mm3, 24(%1)\n" + "movntq %%mm4, 32(%1)\n" + "movntq %%mm5, 40(%1)\n" + "movntq %%mm6, 48(%1)\n" + "movntq %%mm7, 56(%1)\n" + "emms\n" + :: "r" (pRead), "r" (pCurrPos) : "memory"); #else - Error( "Implement CMeshBuilder::FastVertex(dx7) "); + Error( "Implement CMeshBuilder::FastVertex(dx8)" ); #endif IncrementFloatPointer( m_pCurrPosition, m_VertexSize_Position ); - //m_nVertexCount = ++m_nCurrentVertex; + // m_nVertexCount = ++m_nCurrentVertex; #if ( defined( _DEBUG ) && ( COMPRESSED_NORMALS_TYPE == COMPRESSED_NORMALS_COMBINEDTANGENTS_UBYTE4 ) ) m_bWrittenNormal = false; @@ -1150,7 +1231,7 @@ inline void CVertexBuilder::FastVertex( const ModelVertexDX7_t &vertex ) #endif } -inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex ) +inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) { Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed Assert( m_nCurrentVertex < m_nMaxVertexCount ); @@ -1161,126 +1242,31 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex ) __asm { mov esi, pRead - mov edi, pCurrPos + mov edi, pCurrPos - movaps xmm0, [esi + 0] + movaps xmm0, [esi + 0] movaps xmm1, [esi + 16] movaps xmm2, [esi + 32] movntps [edi + 0], xmm0 - movntps [edi + 16], xmm1 - movntps [edi + 32], xmm2 - } -#else - Error( "Implement CMeshBuilder::FastVertexSSE(dx7)" ); -#endif - - IncrementFloatPointer( m_pCurrPosition, m_VertexSize_Position ); - //m_nVertexCount = ++m_nCurrentVertex; - -#if ( defined( _DEBUG ) && ( COMPRESSED_NORMALS_TYPE == COMPRESSED_NORMALS_COMBINEDTANGENTS_UBYTE4 ) ) - m_bWrittenNormal = false; - m_bWrittenUserData = false; -#endif -} - -inline void CVertexBuilder::Fast4VerticesSSE( - ModelVertexDX7_t const *vtx_a, - ModelVertexDX7_t const *vtx_b, - ModelVertexDX7_t const *vtx_c, - ModelVertexDX7_t const *vtx_d) -{ - Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed - Assert( m_nCurrentVertex < m_nMaxVertexCount-3 ); - -#if defined( _WIN32 ) && !defined( _X360 ) - void *pCurrPos = m_pCurrPosition; - __asm - { - mov esi, vtx_a - mov ebx, vtx_b - - mov edi, pCurrPos - nop - - movaps xmm0, [esi + 0] - movaps xmm1, [esi + 16] - movaps xmm2, [esi + 32] - movaps xmm3, [ebx + 0] - movaps xmm4, [ebx + 16] - movaps xmm5, [ebx + 32] - - mov esi, vtx_c - mov ebx, vtx_d - - movntps [edi + 0], xmm0 - movntps [edi + 16], xmm1 - movntps [edi + 32], xmm2 - movntps [edi + 48], xmm3 - movntps [edi + 64], xmm4 - movntps [edi + 80], xmm5 - - movaps xmm0, [esi + 0] - movaps xmm1, [esi + 16] - movaps xmm2, [esi + 32] - movaps xmm3, [ebx + 0] - movaps xmm4, [ebx + 16] - movaps xmm5, [ebx + 32] - - movntps [edi + 0+96], xmm0 - movntps [edi + 16+96], xmm1 - movntps [edi + 32+96], xmm2 - movntps [edi + 48+96], xmm3 - movntps [edi + 64+96], xmm4 - movntps [edi + 80+96], xmm5 - + movntps [edi + 16], xmm1 + movntps [edi + 32], xmm2 } -#else - Error( "Implement CMeshBuilder::Fast4VerticesSSE\n"); -#endif - IncrementFloatPointer( m_pCurrPosition, 4*m_VertexSize_Position ); - -#if ( defined( _DEBUG ) && ( COMPRESSED_NORMALS_TYPE == COMPRESSED_NORMALS_COMBINEDTANGENTS_UBYTE4 ) ) - m_bWrittenNormal = false; - m_bWrittenUserData = false; -#endif -} - -inline void CVertexBuilder::FastVertex( const ModelVertexDX8_t &vertex ) -{ - Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed - Assert( m_nCurrentVertex < m_nMaxVertexCount ); - -#if defined( _WIN32 ) && !defined( _X360 ) +#elif defined(GNUC) const void *pRead = &vertex; void *pCurrPos = m_pCurrPosition; - __asm - { - mov esi, pRead - mov edi, pCurrPos - - movq mm0, [esi + 0] - movq mm1, [esi + 8] - movq mm2, [esi + 16] - movq mm3, [esi + 24] - movq mm4, [esi + 32] - movq mm5, [esi + 40] - movq mm6, [esi + 48] - movq mm7, [esi + 56] - - movntq [edi + 0], mm0 - movntq [edi + 8], mm1 - movntq [edi + 16], mm2 - movntq [edi + 24], mm3 - movntq [edi + 32], mm4 - movntq [edi + 40], mm5 - movntq [edi + 48], mm6 - movntq [edi + 56], mm7 - - emms - } + __asm__ __volatile__ ( + "movaps (%0), %%xmm0\n" + "movaps 16(%0), %%xmm1\n" + "movaps 32(%0), %%xmm2\n" + "movaps 48(%0), %%xmm3\n" + "movntps %%xmm0, (%1)\n" + "movntps %%xmm1, 16(%1)\n" + "movntps %%xmm2, 32(%1)\n" + "movntps %%xmm3, 48(%1)\n" + :: "r" (pRead), "r" (pCurrPos) : "memory"); #else - Error( "Implement CMeshBuilder::FastVertex(dx8)" ); + Error( "Implement CMeshBuilder::FastVertexSSE((dx8)" ); #endif IncrementFloatPointer( m_pCurrPosition, m_VertexSize_Position ); @@ -1292,7 +1278,8 @@ inline void CVertexBuilder::FastVertex( const ModelVertexDX8_t &vertex ) #endif } -inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) + +inline void CVertexBuilder::FastQuadVertexSSE( const QuadTessVertex_t &vertex ) { Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed Assert( m_nCurrentVertex < m_nMaxVertexCount ); @@ -1303,20 +1290,16 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) __asm { mov esi, pRead - mov edi, pCurrPos + mov edi, pCurrPos - movaps xmm0, [esi + 0] + movaps xmm0, [esi + 0] movaps xmm1, [esi + 16] movaps xmm2, [esi + 32] - movaps xmm3, [esi + 48] movntps [edi + 0], xmm0 - movntps [edi + 16], xmm1 - movntps [edi + 32], xmm2 - movntps [edi + 48], xmm3 + movntps [edi + 16], xmm1 + movntps [edi + 32], xmm2 } -#else - Error( "Implement CMeshBuilder::FastVertexSSE((dx8)" ); #endif IncrementFloatPointer( m_pCurrPosition, m_VertexSize_Position ); @@ -1329,6 +1312,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) } + //----------------------------------------------------------------------------- // Returns the current vertex //----------------------------------------------------------------------------- @@ -1355,22 +1339,6 @@ inline void CVertexBuilder::VertexDX8ToX360( const ModelVertexDX8_t &vertex ) memcpy( pDst, vertex.m_vecPosition.Base(), sizeof( vertex.m_vecPosition ) ); pDst += sizeof( vertex.m_vecPosition ); - if ( m_VertexSize_BoneWeight ) - { - Assert( vertex.m_flBoneWeights[0] >= 0 && vertex.m_flBoneWeights[0] <= 1.0f ); - Assert( vertex.m_flBoneWeights[1] >= 0 && vertex.m_flBoneWeights[1] <= 1.0f ); - Assert( GetVertexElementSize( VERTEX_ELEMENT_BONEWEIGHTS2, VERTEX_COMPRESSION_NONE ) == sizeof( vertex.m_flBoneWeights ) ); - memcpy( pDst, vertex.m_flBoneWeights.Base(), sizeof( vertex.m_flBoneWeights ) ); - pDst += sizeof( vertex.m_flBoneWeights ); - - if ( m_VertexSize_BoneMatrixIndex ) - { - Assert( GetVertexElementSize( VERTEX_ELEMENT_BONEINDEX, VERTEX_COMPRESSION_NONE ) == sizeof( vertex.m_nBoneIndices ) ); - *(unsigned int*)pDst = vertex.m_nBoneIndices; - pDst += sizeof( vertex.m_nBoneIndices ); - } - } - if ( m_VertexSize_Normal ) { Assert( GetVertexElementSize( VERTEX_ELEMENT_NORMAL, VERTEX_COMPRESSION_NONE ) == sizeof( vertex.m_vecNormal ) ); @@ -1378,13 +1346,6 @@ inline void CVertexBuilder::VertexDX8ToX360( const ModelVertexDX8_t &vertex ) pDst += sizeof( vertex.m_vecNormal ); } - if ( m_VertexSize_Color ) - { - Assert( GetVertexElementSize( VERTEX_ELEMENT_COLOR, VERTEX_COMPRESSION_NONE ) == sizeof( vertex.m_nColor ) ); - *(unsigned int*)pDst = vertex.m_nColor; - pDst += sizeof( vertex.m_nColor ); - } - if ( m_VertexSize_TexCoord[0] ) { Assert( GetVertexElementSize( VERTEX_ELEMENT_TEXCOORD2D_0, VERTEX_COMPRESSION_NONE ) == sizeof( vertex.m_vecTexCoord ) ); @@ -1716,10 +1677,18 @@ inline void CVertexBuilder::Color4fv( const float *rgba ) //----------------------------------------------------------------------------- // Faster versions of color //----------------------------------------------------------------------------- + +// note that on the OSX target (OpenGL) whenever there is vertex data being written as bytes - they need to be written in R,G,B,A memory order + inline void CVertexBuilder::Color3ub( unsigned char r, unsigned char g, unsigned char b ) { Assert( m_pColor && m_pCurrColor ); - int col = b | (g << 8) | (r << 16) | 0xFF000000; + #ifdef OPENGL_SWAP_COLORS + int col = r | (g << 8) | (b << 16) | 0xFF000000; // r, g, b, a in memory + #else + int col = b | (g << 8) | (r << 16) | 0xFF000000; + #endif + *(int*)m_pCurrColor = col; } @@ -1727,15 +1696,24 @@ inline void CVertexBuilder::Color3ubv( unsigned char const* rgb ) { Assert(rgb); Assert( m_pColor && m_pCurrColor ); + #ifdef OPENGL_SWAP_COLORS + int col = rgb[0] | (rgb[1] << 8) | (rgb[2] << 16) | 0xFF000000; // r, g, b, a in memory + #else + int col = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16) | 0xFF000000; + #endif - int col = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16) | 0xFF000000; *(int*)m_pCurrColor = col; } inline void CVertexBuilder::Color4ub( unsigned char r, unsigned char g, unsigned char b, unsigned char a ) { Assert( m_pColor && m_pCurrColor ); - int col = b | (g << 8) | (r << 16) | (a << 24); + #ifdef OPENGL_SWAP_COLORS + int col = r | (g << 8) | (b << 16) | (a << 24); // r, g, b, a in memory + #else + int col = b | (g << 8) | (r << 16) | (a << 24); + #endif + *(int*)m_pCurrColor = col; } @@ -1743,10 +1721,25 @@ inline void CVertexBuilder::Color4ubv( unsigned char const* rgba ) { Assert( rgba ); Assert( m_pColor && m_pCurrColor ); - int col = rgba[2] | (rgba[1] << 8) | (rgba[0] << 16) | (rgba[3] << 24); + #ifdef OPENGL_SWAP_COLORS + int col = rgba[0] | (rgba[1] << 8) | (rgba[2] << 16) | (rgba[3] << 24); // r, g, b, a in memory + #else + int col = rgba[2] | (rgba[1] << 8) | (rgba[0] << 16) | (rgba[3] << 24); + #endif *(int*)m_pCurrColor = col; } +FORCEINLINE void CVertexBuilder::Color4Packed( int packedColor ) +{ + *(int*)m_pCurrColor = packedColor; +} + +FORCEINLINE int CVertexBuilder::PackColor4( unsigned char r, unsigned char g, unsigned char b, unsigned char a ) +{ + return b | (g << 8) | (r << 16) | (a << 24); +} + + inline void CVertexBuilder::Specular3f( float r, float g, float b ) { Assert( m_pSpecular ); @@ -1801,7 +1794,13 @@ inline void CVertexBuilder::Specular3ub( unsigned char r, unsigned char g, unsig { Assert( m_pSpecular ); unsigned char *pSpecular = &m_pSpecular[m_nCurrentVertex * m_VertexSize_Specular]; - int col = b | (g << 8) | (r << 16) | 0xFF000000; + + #ifdef OPENGL_SWAP_COLORS + int col = r | (g << 8) | (b << 16) | 0xFF000000; // r, g, b, a in memory + #else + int col = b | (g << 8) | (r << 16) | 0xFF000000; + #endif + *(int*)pSpecular = col; } @@ -1809,7 +1808,13 @@ inline void CVertexBuilder::Specular3ubv( unsigned char const *c ) { Assert( m_pSpecular ); unsigned char *pSpecular = &m_pSpecular[m_nCurrentVertex * m_VertexSize_Specular]; - int col = c[2] | (c[1] << 8) | (c[0] << 16) | 0xFF000000; + + #ifdef OPENGL_SWAP_COLORS + int col = c[0] | (c[1] << 8) | (c[2] << 16) | 0xFF000000; // r, g, b, a in memory + #else + int col = c[2] | (c[1] << 8) | (c[0] << 16) | 0xFF000000; + #endif + *(int*)pSpecular = col; } @@ -1817,7 +1822,13 @@ inline void CVertexBuilder::Specular4ub( unsigned char r, unsigned char g, unsig { Assert( m_pSpecular ); unsigned char *pSpecular = &m_pSpecular[m_nCurrentVertex * m_VertexSize_Specular]; - int col = b | (g << 8) | (r << 16) | (a << 24); + + #ifdef OPENGL_SWAP_COLORS + int col = r | (g << 8) | (b << 16) | (a << 24); // r, g, b, a in memory + #else + int col = b | (g << 8) | (r << 16) | (a << 24); + #endif + *(int*)pSpecular = col; } @@ -1825,7 +1836,13 @@ inline void CVertexBuilder::Specular4ubv( unsigned char const *c ) { Assert( m_pSpecular ); unsigned char *pSpecular = &m_pSpecular[m_nCurrentVertex * m_VertexSize_Specular]; - int col = c[2] | (c[1] << 8) | (c[0] << 16) | (c[3] << 24); + + #ifdef OPENGL_SWAP_COLORS + int col = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24); + #else + int col = c[2] | (c[1] << 8) | (c[0] << 16) | (c[3] << 24); + #endif + *(int*)pSpecular = col; } @@ -2016,6 +2033,19 @@ inline void CVertexBuilder::BoneWeight( int idx, float weight ) } } +inline void CVertexBuilder::BoneWeights2( float weight1, float weight2 ) +{ + Assert( m_pBoneWeight ); + Assert( IsFinite( weight1 ) && IsFinite( weight2 ) ); + AssertOnce( m_NumBoneWeights == 2 ); + + // This test is here because we store N-1 bone weights (the Nth is computed in + // the vertex shader as "1 - C", where C is the sum of the (N-1) other weights) + float* pBoneWeight = OffsetFloatPointer( m_pBoneWeight, m_nCurrentVertex, m_VertexSize_BoneWeight ); + pBoneWeight[0] = weight1; + pBoneWeight[1] = weight2; +} + inline void CVertexBuilder::BoneMatrix( int idx, int matrixIdx ) { Assert( m_pBoneMatrixIndex ); @@ -2043,6 +2073,38 @@ inline void CVertexBuilder::BoneMatrix( int idx, int matrixIdx ) #endif } +inline void CVertexBuilder::BoneMatrices4( int matrixIdx0, int matrixIdx1, int matrixIdx2, int matrixIdx3 ) +{ + Assert( m_pBoneMatrixIndex ); + + // garymcthack + Assert( matrixIdx0 != BONE_MATRIX_INDEX_INVALID ); + Assert( matrixIdx1 != BONE_MATRIX_INDEX_INVALID ); + Assert( matrixIdx2 != BONE_MATRIX_INDEX_INVALID ); + Assert( matrixIdx3 != BONE_MATRIX_INDEX_INVALID ); + +#ifndef NEW_SKINNING + int nVal; + if ( IsX360() ) + { + // store sequentially as wzyx order, gpu delivers as xyzw + nVal = matrixIdx3 | ( matrixIdx2 << 8 ) | ( matrixIdx1 << 16 ) | ( matrixIdx0 << 24 ); + } + else + { + nVal = matrixIdx0 | ( matrixIdx1 << 8 ) | ( matrixIdx2 << 16 ) | ( matrixIdx3 << 24 ); + } + int* pBoneMatrix = (int*)( &m_pBoneMatrixIndex[m_nCurrentVertex * m_VertexSize_BoneMatrixIndex] ); + *pBoneMatrix = nVal; +#else + float* pBoneMatrix = &m_pBoneMatrixIndex[m_nCurrentVertex * m_VertexSize_BoneMatrixIndex]; + pBoneMatrix[0] = matrixIdx0; + pBoneMatrix[1] = matrixIdx1; + pBoneMatrix[2] = matrixIdx2; + pBoneMatrix[3] = matrixIdx3; +#endif +} + //----------------------------------------------------------------------------- // Templatized bone weight setting methods which support compressed vertices //----------------------------------------------------------------------------- @@ -2256,6 +2318,12 @@ class CIndexBuilder : private IndexDesc_t void AttachBeginModify( IMesh* pMesh, int nFirstIndex, int nIndexCount, const MeshDesc_t &desc ); void AttachEndModify(); + void FastTriangle( int startVert ); + void FastQuad( int startVert ); + void FastPolygon( int startVert, int numTriangles ); + void FastPolygonList( int startVert, int *pVertexCount, int polygonCount ); + void FastIndexList( const unsigned short *pIndexList, int startVert, int indexCount ); + private: // The mesh we're modifying IIndexBuffer *m_pIndexBuffer; @@ -2344,6 +2412,7 @@ inline bool CIndexBuilder::Lock( int nMaxIndexCount, int nIndexOffset, bool bApp m_bModify = false; m_nIndexOffset = nIndexOffset; m_nMaxIndexCount = nMaxIndexCount; + m_nIndexCount = 0; bool bFirstLock = ( m_nBufferOffset == INVALID_BUFFER_OFFSET ); if ( bFirstLock ) { @@ -2662,6 +2731,99 @@ inline void CIndexBuilder::FastIndex( unsigned short nIndex ) m_nIndexCount = m_nCurrentIndex; } +FORCEINLINE void CIndexBuilder::FastTriangle( int startVert ) +{ + startVert += m_nIndexOffset; + unsigned short *pIndices = &m_pIndices[m_nCurrentIndex]; + *pIndices++ = startVert++; + *pIndices++ = startVert++; + *pIndices++ = startVert; + AdvanceIndices(3); +} + +FORCEINLINE void CIndexBuilder::FastQuad( int startVert ) +{ + startVert += m_nIndexOffset; + unsigned short *pIndices = &m_pIndices[m_nCurrentIndex]; + *pIndices++ = startVert++; + *pIndices++ = startVert++; + *pIndices++ = startVert; + + *pIndices++ = startVert - 2; + *pIndices++ = startVert++; + *pIndices++ = startVert; + AdvanceIndices(6); +} + +inline void CIndexBuilder::FastPolygon( int startVert, int triangleCount ) +{ + unsigned short *pIndex = &m_pIndices[m_nCurrentIndex]; + startVert += m_nIndexOffset; + if ( !IsX360() ) + { + // NOTE: IndexSize is 1 or 0 (0 for alt-tab) + // This prevents us from writing into bogus memory + Assert( m_nIndexSize == 0 || m_nIndexSize == 1 ); + triangleCount *= m_nIndexSize; + } + for ( int v = 0; v < triangleCount; ++v ) + { + *pIndex++ = startVert; + *pIndex++ = startVert + v + 1; + *pIndex++ = startVert + v + 2; + } + AdvanceIndices(triangleCount*3); +} + +inline void CIndexBuilder::FastPolygonList( int startVert, int *pVertexCount, int polygonCount ) +{ + unsigned short *pIndex = &m_pIndices[m_nCurrentIndex]; + startVert += m_nIndexOffset; + int indexOut = 0; + + if ( !IsX360() ) + { + // NOTE: IndexSize is 1 or 0 (0 for alt-tab) + // This prevents us from writing into bogus memory + Assert( m_nIndexSize == 0 || m_nIndexSize == 1 ); + polygonCount *= m_nIndexSize; + } + + for ( int i = 0; i < polygonCount; i++ ) + { + int vertexCount = pVertexCount[i]; + int triangleCount = vertexCount-2; + for ( int v = 0; v < triangleCount; ++v ) + { + *pIndex++ = startVert; + *pIndex++ = startVert + v + 1; + *pIndex++ = startVert + v + 2; + } + startVert += vertexCount; + indexOut += triangleCount * 3; + } + AdvanceIndices(indexOut); +} + +inline void CIndexBuilder::FastIndexList( const unsigned short *pIndexList, int startVert, int indexCount ) +{ + unsigned short *pIndexOut = &m_pIndices[m_nCurrentIndex]; + startVert += m_nIndexOffset; + if ( !IsX360() ) + { + // NOTE: IndexSize is 1 or 0 (0 for alt-tab) + // This prevents us from writing into bogus memory + Assert( m_nIndexSize == 0 || m_nIndexSize == 1 ); + indexCount *= m_nIndexSize; + } + for ( int i = 0; i < indexCount; ++i ) + { + pIndexOut[i] = startVert + pIndexList[i]; + } + AdvanceIndices(indexCount); +} + + //----------------------------------------------------------------------------- // NOTE: This version is the one you really want to achieve write-combining; // Write combining only works if you write in 4 bytes chunks. @@ -2721,6 +2883,8 @@ inline void CIndexBuilder::GenerateIndices( MaterialPrimitiveType_t primitiveTyp case MATERIAL_POINTS: Assert(0); // Shouldn't get here (this primtype is unindexed) break; + case MATERIAL_SUBD_QUADS_EXTRA: + case MATERIAL_SUBD_QUADS_REG: default: GenerateSequentialIndexBuffer( pIndices, nIndexCount, m_nIndexOffset ); break; @@ -2743,6 +2907,8 @@ class CMeshBuilder : public MeshDesc_t CMeshBuilder(); ~CMeshBuilder() { Assert(!m_pMesh); } // if this fires you did a Begin() without an End() + operator CIndexBuilder&() { return m_IndexBuilder; } + // This must be called before Begin, if a vertex buffer with a compressed format is to be used void SetCompressionType( VertexCompressionType_t compressionType ); @@ -2799,6 +2965,7 @@ class CMeshBuilder : public MeshDesc_t // Advances the current vertex and index by one void AdvanceVertex(); + template void AdvanceVertexF(); void AdvanceVertices( int nVerts ); void AdvanceIndex(); void AdvanceIndices( int nIndices ); @@ -2856,6 +3023,8 @@ class CMeshBuilder : public MeshDesc_t void Color3ubv( unsigned char const* rgb ); void Color4ub( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); void Color4ubv( unsigned char const* rgba ); + void Color4Packed( int packedColor ); + int PackColor4( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); // specular color setting void Specular3f( float r, float g, float b ); @@ -2893,11 +3062,14 @@ class CMeshBuilder : public MeshDesc_t // bone weights void BoneWeight( int idx, float weight ); + void BoneWeights2( float weight1, float weight2 ); + // bone weights (templatized for code which needs to support compressed vertices) template void CompressedBoneWeight3fv( const float * pWeights ); // bone matrix index void BoneMatrix( int idx, int matrixIndex ); + void BoneMatrices4( int matrixIdx0, int matrixIdx1, int matrixIdx2, int matrixIdx3 ); // Generic per-vertex data void UserData( const float *pData ); @@ -2913,22 +3085,14 @@ class CMeshBuilder : public MeshDesc_t // Fast Index! No need to call advance index, and no random access allowed void FastIndex( unsigned short index ); + void FastQuad( int index ); // Fast Vertex! No need to call advance vertex, and no random access allowed. // WARNING - these are low level functions that are intended only for use // in the software vertex skinner. - void FastVertex( const ModelVertexDX7_t &vertex ); - void FastVertexSSE( const ModelVertexDX7_t &vertex ); - - // store 4 dx7 vertices fast. for special sse dx7 pipeline - void Fast4VerticesSSE( - ModelVertexDX7_t const *vtx_a, - ModelVertexDX7_t const *vtx_b, - ModelVertexDX7_t const *vtx_c, - ModelVertexDX7_t const *vtx_d); - void FastVertex( const ModelVertexDX8_t &vertex ); void FastVertexSSE( const ModelVertexDX8_t &vertex ); + void FastQuadVertexSSE( const QuadTessVertex_t &vertex ); // Add number of verts and current vert since FastVertexxx routines do not update. void FastAdvanceNVertices(int n); @@ -2937,6 +3101,18 @@ class CMeshBuilder : public MeshDesc_t void VertexDX8ToX360( const ModelVertexDX8_t &vertex ); #endif + // this low level function gets you a pointer to the vertex output data. It is dangerous - any + // caller using it must understand the vertex layout that it is building. It is for optimized + // meshbuilding loops like particle drawing that use special shaders. After writing to the output + // data, you shuodl call FastAdvanceNVertices + FORCEINLINE void *GetVertexDataPtr( int nWhatSizeIThinkItIs ) + { + if ( m_VertexBuilder.m_VertexSize_Position != nWhatSizeIThinkItIs ) + return NULL; + return m_VertexBuilder.m_pCurrPosition; + } + + private: // Computes number of verts and indices void ComputeNumVertsAndIndices( int *pMaxVertices, int *pMaxIndices, @@ -3079,6 +3255,7 @@ inline int CMeshBuilder::IndicesFromVertices( MaterialPrimitiveType_t type, int //----------------------------------------------------------------------------- inline void CMeshBuilder::SetCompressionType( VertexCompressionType_t vertexCompressionType ) { + m_CompressionType = vertexCompressionType; m_VertexBuilder.SetCompressionType( vertexCompressionType ); } @@ -3289,6 +3466,10 @@ FORCEINLINE void CMeshBuilder::SelectIndex( int idx ) //----------------------------------------------------------------------------- // Advances the current vertex and index by one //----------------------------------------------------------------------------- +template FORCEINLINE void CMeshBuilder::AdvanceVertexF() +{ + m_VertexBuilder.AdvanceVertexF(); +} FORCEINLINE void CMeshBuilder::AdvanceVertex() { m_VertexBuilder.AdvanceVertex(); @@ -3332,38 +3513,38 @@ inline void CMeshBuilder::DrawQuad( IMesh* pMesh, const float* v1, const float* Position3fv (v1); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); Position3fv (v2); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); Position3fv (v4); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); Position3fv (v3); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); } else { Begin( pMesh, MATERIAL_LINE_LOOP, 4 ); Position3fv (v1); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); Position3fv (v2); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); Position3fv (v3); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); Position3fv (v4); Color4ubv( pColor ); - AdvanceVertex(); + AdvanceVertexF(); } End(); @@ -3476,6 +3657,11 @@ FORCEINLINE void CMeshBuilder::FastIndex2( unsigned short nIndex1, unsigned shor m_IndexBuilder.FastIndex2( nIndex1, nIndex2 ); } +FORCEINLINE void CMeshBuilder::FastQuad( int nIndex ) +{ + m_IndexBuilder.FastQuad( nIndex ); +} + //----------------------------------------------------------------------------- // For use with the FastVertex methods, advances the current vertex by N //----------------------------------------------------------------------------- @@ -3488,32 +3674,21 @@ FORCEINLINE void CMeshBuilder::FastAdvanceNVertices( int nVertexCount ) //----------------------------------------------------------------------------- // Fast Vertex! No need to call advance vertex, and no random access allowed //----------------------------------------------------------------------------- -FORCEINLINE void CMeshBuilder::FastVertex( const ModelVertexDX7_t &vertex ) +FORCEINLINE void CMeshBuilder::FastVertex( const ModelVertexDX8_t &vertex ) { m_VertexBuilder.FastVertex( vertex ); } -FORCEINLINE void CMeshBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex ) +FORCEINLINE void CMeshBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) { m_VertexBuilder.FastVertexSSE( vertex ); } -FORCEINLINE void CMeshBuilder::Fast4VerticesSSE( - const ModelVertexDX7_t *vtx_a, const ModelVertexDX7_t *vtx_b, - const ModelVertexDX7_t *vtx_c, const ModelVertexDX7_t *vtx_d ) +FORCEINLINE void CMeshBuilder::FastQuadVertexSSE( const QuadTessVertex_t &vertex ) { - m_VertexBuilder.Fast4VerticesSSE( vtx_a, vtx_b, vtx_c, vtx_d ); + m_VertexBuilder.FastQuadVertexSSE( vertex ); } -FORCEINLINE void CMeshBuilder::FastVertex( const ModelVertexDX8_t &vertex ) -{ - m_VertexBuilder.FastVertex( vertex ); -} - -FORCEINLINE void CMeshBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) -{ - m_VertexBuilder.FastVertexSSE( vertex ); -} //----------------------------------------------------------------------------- // Copies a vertex into the x360 format @@ -3598,6 +3773,16 @@ FORCEINLINE void CMeshBuilder::Color4ubv( unsigned char const* rgba ) m_VertexBuilder.Color4ubv( rgba ); } +FORCEINLINE void CMeshBuilder::Color4Packed( int packedColor ) +{ + m_VertexBuilder.Color4Packed(packedColor); +} + +FORCEINLINE int CMeshBuilder::PackColor4( unsigned char r, unsigned char g, unsigned char b, unsigned char a ) +{ + return m_VertexBuilder.PackColor4(r,g,b,a); +} + FORCEINLINE void CMeshBuilder::Specular3f( float r, float g, float b ) { m_VertexBuilder.Specular3f( r, g, b ); @@ -3713,6 +3898,11 @@ FORCEINLINE void CMeshBuilder::BoneWeight( int nIndex, float flWeight ) m_VertexBuilder.BoneWeight( nIndex, flWeight ); } +FORCEINLINE void CMeshBuilder::BoneWeights2( float weight1, float weight2 ) +{ + m_VertexBuilder.BoneWeights2( weight1, weight2 ); +} + template FORCEINLINE void CMeshBuilder::CompressedBoneWeight3fv( const float * pWeights ) { m_VertexBuilder.CompressedBoneWeight3fv( pWeights ); @@ -3723,6 +3913,11 @@ FORCEINLINE void CMeshBuilder::BoneMatrix( int nIndex, int nMatrixIdx ) m_VertexBuilder.BoneMatrix( nIndex, nMatrixIdx ); } +FORCEINLINE void CMeshBuilder::BoneMatrices4( int matrixIdx0, int matrixIdx1, int matrixIdx2, int matrixIdx3 ) +{ + m_VertexBuilder.BoneMatrices4( matrixIdx0, matrixIdx1, matrixIdx2, matrixIdx3 ); +} + FORCEINLINE void CMeshBuilder::UserData( const float* pData ) { m_VertexBuilder.UserData( pData ); diff --git a/public/materialsystem/itexture.h b/public/materialsystem/itexture.h index 6db2bb873..025b3e073 100644 --- a/public/materialsystem/itexture.h +++ b/public/materialsystem/itexture.h @@ -20,6 +20,16 @@ class IVTFTexture; class ITexture; struct Rect_t; +#ifdef _X360 +enum RTMultiSampleCount360_t +{ + RT_MULTISAMPLE_NONE = 0, + RT_MULTISAMPLE_2_SAMPLES = 2, + RT_MULTISAMPLE_4_SAMPLES = 4, + RT_MULTISAMPLE_MATCH_BACKBUFFER +}; +#endif + //----------------------------------------------------------------------------- // This will get called on procedural textures to re-fill the textures // with the appropriate bit pattern. Calling Download() will also @@ -72,7 +82,7 @@ abstract_class ITexture inline void Release() { DecrementReferenceCount(); } // Used to modify the texture bits (procedural textures only) - virtual void SetTextureRegenerator( ITextureRegenerator *pTextureRegen ) = 0; + virtual void SetTextureRegenerator( ITextureRegenerator *pTextureRegen, bool releaseExisting = true ) = 0; // Reconstruct the texture bits in HW memory @@ -94,7 +104,6 @@ abstract_class ITexture virtual int GetActualDepth() const = 0; virtual ImageFormat GetImageFormat() const = 0; - virtual NormalDecodeMode_t GetNormalDecodeMode() const = 0; // Various information about the texture virtual bool IsRenderTarget() const = 0; @@ -106,7 +115,7 @@ abstract_class ITexture #if defined( _X360 ) virtual bool ClearTexture( int r, int g, int b, int a ) = 0; - virtual bool CreateRenderTargetSurface( int width, int height, ImageFormat format, bool bSameAsTexture ) = 0; + virtual bool CreateRenderTargetSurface( int width, int height, ImageFormat format, bool bSameAsTexture, RTMultiSampleCount360_t multiSampleCount = RT_MULTISAMPLE_NONE ) = 0; #endif // swap everything except the name with another texture @@ -117,6 +126,9 @@ abstract_class ITexture // Force LOD override (automatically downloads the texture) virtual void ForceLODOverride( int iNumLodsOverrideUpOrDown ) = 0; + + // Force exclude override (automatically downloads the texture) + virtual void ForceExcludeOverride( int iExcludeOverride ) = 0; }; diff --git a/public/materialsystem/ivballoctracker.h b/public/materialsystem/ivballoctracker.h index 5200931d7..e907a5831 100644 --- a/public/materialsystem/ivballoctracker.h +++ b/public/materialsystem/ivballoctracker.h @@ -18,7 +18,6 @@ #endif // This interface is actually exported by the shader API DLL. -#define VB_ALLOC_TRACKER_INTERFACE_VERSION "VBAllocTracker001" // Interface to the VB mem alloc tracker abstract_class IVBAllocTracker @@ -32,4 +31,4 @@ abstract_class IVBAllocTracker virtual void TrackMeshAllocations( const char * allocatorName ) = 0; }; -#endif IVBALLOCTRACKER_H +#endif // IVBALLOCTRACKER_H diff --git a/public/materialsystem/materialsystem_config.h b/public/materialsystem/materialsystem_config.h index 2cf58597c..12aaac056 100644 --- a/public/materialsystem/materialsystem_config.h +++ b/public/materialsystem/materialsystem_config.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -13,7 +13,7 @@ #include "materialsystem/imaterialsystem.h" -#define MATERIALSYSTEM_CONFIG_VERSION "VMaterialSystemConfig002" +#define MATERIALSYSTEM_CONFIG_VERSION "VMaterialSystemConfig004" enum MaterialSystem_Config_Flags_t { @@ -21,17 +21,16 @@ enum MaterialSystem_Config_Flags_t MATSYS_VIDCFG_FLAGS_RESIZING = ( 1 << 1 ), MATSYS_VIDCFG_FLAGS_NO_WAIT_FOR_VSYNC = ( 1 << 3 ), MATSYS_VIDCFG_FLAGS_STENCIL = ( 1 << 4 ), - MATSYS_VIDCFG_FLAGS_FORCE_TRILINEAR = ( 1 << 5 ), - MATSYS_VIDCFG_FLAGS_FORCE_HWSYNC = ( 1 << 6 ), MATSYS_VIDCFG_FLAGS_DISABLE_SPECULAR = ( 1 << 7 ), MATSYS_VIDCFG_FLAGS_DISABLE_BUMPMAP = ( 1 << 8 ), MATSYS_VIDCFG_FLAGS_ENABLE_PARALLAX_MAPPING = ( 1 << 9 ), MATSYS_VIDCFG_FLAGS_USE_Z_PREFILL = ( 1 << 10 ), - MATSYS_VIDCFG_FLAGS_REDUCE_FILLRATE = ( 1 << 11 ), MATSYS_VIDCFG_FLAGS_ENABLE_HDR = ( 1 << 12 ), MATSYS_VIDCFG_FLAGS_LIMIT_WINDOWED_SIZE = ( 1 << 13 ), MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION = ( 1 << 14 ), MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS = ( 1 << 15 ), + MATSYS_VIDCFG_FLAGS_DISABLE_PHONG = ( 1 << 16 ), + MATSYS_VIDCFG_FLAGS_NO_WINDOW_BORDER = ( 1 << 17 ), }; struct MaterialSystemHardwareIdentifier_t @@ -44,16 +43,14 @@ struct MaterialSystemHardwareIdentifier_t struct MaterialSystem_Config_t { bool Windowed() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_WINDOWED ) != 0; } + bool NoWindowBorder() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_NO_WINDOW_BORDER ) != 0; } bool Resizing() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_RESIZING ) != 0; } bool WaitForVSync() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_NO_WAIT_FOR_VSYNC ) == 0; } bool Stencil() const { return (m_Flags & MATSYS_VIDCFG_FLAGS_STENCIL ) != 0; } - bool ForceTrilinear() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_FORCE_TRILINEAR ) != 0; } - bool ForceHWSync() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_FORCE_HWSYNC ) != 0; } bool UseSpecular() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_DISABLE_SPECULAR ) == 0; } bool UseBumpmapping() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_DISABLE_BUMPMAP ) == 0; } bool UseParallaxMapping() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_ENABLE_PARALLAX_MAPPING ) != 0; } bool UseZPrefill() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_USE_Z_PREFILL ) != 0; } - bool ReduceFillrate() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_REDUCE_FILLRATE ) != 0; } bool HDREnabled() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_ENABLE_HDR ) != 0; } bool LimitWindowedSize() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_LIMIT_WINDOWED_SIZE ) != 0; } bool ScaleToOutputResolution() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION ) != 0; } @@ -61,6 +58,7 @@ struct MaterialSystem_Config_t bool ShadowDepthTexture() const { return m_bShadowDepthTexture; } bool MotionBlur() const { return m_bMotionBlur; } bool SupportFlashlight() const { return m_bSupportFlashlight; } + bool UsePhong() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_DISABLE_PHONG ) == 0; } void SetFlag( unsigned int flag, bool val ) { @@ -82,6 +80,7 @@ struct MaterialSystem_Config_t float m_fGammaTVExponent; bool m_bGammaTVEnabled; + bool m_bWantTripleBuffered; // We only get triple buffering if fullscreen and vsync'd int m_nAASamples; int m_nForceAnisotropicLevel; int skipMipLevels; @@ -112,21 +111,6 @@ struct MaterialSystem_Config_t bool bShowSpecular; // This is the fast version that doesn't require reloading materials bool bShowDiffuse; // This is the fast version that doesn't require reloading materials - // misc - int m_nReserved; // Currently unused - - // No depth bias - float m_SlopeScaleDepthBias_Normal; - float m_DepthBias_Normal; - - // Depth bias for rendering decals closer to the camera - float m_SlopeScaleDepthBias_Decal; - float m_DepthBias_Decal; - - // Depth bias for biasing shadow depth map rendering away from the camera - float m_SlopeScaleDepthBias_ShadowMap; - float m_DepthBias_ShadowMap; - uint m_WindowedSizeLimitWidth; uint m_WindowedSizeLimitHeight; int m_nAAQuality; @@ -134,22 +118,24 @@ struct MaterialSystem_Config_t bool m_bMotionBlur; bool m_bSupportFlashlight; + bool m_bPaintInGame; + bool m_bPaintInMap; + + MaterialSystem_Config_t() { memset( this, 0, sizeof( *this ) ); // video config defaults SetFlag( MATSYS_VIDCFG_FLAGS_WINDOWED, false ); + SetFlag( MATSYS_VIDCFG_FLAGS_NO_WINDOW_BORDER, false ); SetFlag( MATSYS_VIDCFG_FLAGS_RESIZING, false ); SetFlag( MATSYS_VIDCFG_FLAGS_NO_WAIT_FOR_VSYNC, true ); SetFlag( MATSYS_VIDCFG_FLAGS_STENCIL, false ); - SetFlag( MATSYS_VIDCFG_FLAGS_FORCE_TRILINEAR, true ); - SetFlag( MATSYS_VIDCFG_FLAGS_FORCE_HWSYNC, true ); SetFlag( MATSYS_VIDCFG_FLAGS_DISABLE_SPECULAR, false ); SetFlag( MATSYS_VIDCFG_FLAGS_DISABLE_BUMPMAP, false ); SetFlag( MATSYS_VIDCFG_FLAGS_ENABLE_PARALLAX_MAPPING, true ); SetFlag( MATSYS_VIDCFG_FLAGS_USE_Z_PREFILL, false ); - SetFlag( MATSYS_VIDCFG_FLAGS_REDUCE_FILLRATE, false ); SetFlag( MATSYS_VIDCFG_FLAGS_LIMIT_WINDOWED_SIZE, false ); SetFlag( MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION, false ); SetFlag( MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS, false ); @@ -170,6 +156,7 @@ struct MaterialSystem_Config_t m_fGammaTVExponent = 2.5; m_bGammaTVEnabled = IsX360(); + m_bWantTripleBuffered = false; m_nAASamples = 1; m_bShadowDepthTexture = false; m_bMotionBlur = false; @@ -200,14 +187,12 @@ struct MaterialSystem_Config_t proxiesTestMode = 0; m_bFastNoBump = false; m_bSuppressRendering = false; - m_SlopeScaleDepthBias_Decal = -0.5f; - m_SlopeScaleDepthBias_Normal = 0.0f; - m_SlopeScaleDepthBias_ShadowMap = 0.5f; - m_DepthBias_Decal = -262144; - m_DepthBias_Normal = 0.0f; - m_DepthBias_ShadowMap = 262144; m_WindowedSizeLimitWidth = 1280; m_WindowedSizeLimitHeight = 1024; + + // PAINT + m_bPaintInGame = false; + m_bPaintInMap = false; } }; diff --git a/public/mathlib/mathlib.h b/public/mathlib/mathlib.h index 7b24b1ad0..e16441ed3 100644 --- a/public/mathlib/mathlib.h +++ b/public/mathlib/mathlib.h @@ -108,6 +108,8 @@ void GeneratePerspectiveFrustum( const Vector& origin, const Vector &forward, co bool R_CullBox( const Vector& mins, const Vector& maxs, const Frustum_t &frustum ); bool R_CullBoxSkipNear( const Vector& mins, const Vector& maxs, const Frustum_t &frustum ); +class matrix3x4a_t; + struct matrix3x4_t { matrix3x4_t() {} @@ -160,6 +162,14 @@ struct matrix3x4_t float m_flMatVal[3][4]; }; +class ALIGN16 matrix3x4a_t : public matrix3x4_t +{ +public: + /* + matrix3x4a_t() { if (((size_t)Base()) % 16 != 0) { Error( "matrix3x4a_t missaligned" ); } } + */ + matrix3x4a_t& operator=( const matrix3x4_t& src ) { memcpy( Base(), src.Base(), sizeof( float ) * 3 * 4 ); return *this; }; +}; #ifndef M_PI #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h @@ -2066,7 +2076,21 @@ void RGBtoHSV( const Vector &rgb, Vector &hsv ); //----------------------------------------------------------------------------- void HSVtoRGB( const Vector &hsv, Vector &rgb ); +//----------------------------------------------------------------------------- +// For testing float equality +//----------------------------------------------------------------------------- +inline bool CloseEnough( float a, float b, float epsilon = EQUAL_EPSILON ) +{ + return fabs( a - b ) <= epsilon; +} + +inline bool CloseEnough( const Vector &a, const Vector &b, float epsilon = EQUAL_EPSILON ) +{ + return fabs( a.x - b.x ) <= epsilon && + fabs( a.y - b.y ) <= epsilon && + fabs( a.z - b.z ) <= epsilon; +} #endif // MATH_BASE_H diff --git a/public/model_types.h b/public/model_types.h index 50d69be99..d0c233d2b 100644 --- a/public/model_types.h +++ b/public/model_types.h @@ -1,11 +1,11 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // // $Workfile: $ // $Date: $ // $NoKeywords: $ -//=============================================================================// +//===========================================================================// #if !defined( MODEL_TYPES_H ) #define MODEL_TYPES_H #ifdef _WIN32 @@ -22,6 +22,9 @@ #define STUDIO_ITEM_BLINK 0x00000040 #define STUDIO_NOSHADOWS 0x00000080 #define STUDIO_WIREFRAME_VCOLLIDE 0x00000100 +#define STUDIO_NOLIGHTING_OR_CUBEMAP 0x00000200 +#define STUDIO_SKIP_FLEXES 0x00000400 +#define STUDIO_DONOTMODIFYSTENCILSTATE 0x00000800 // TERROR // Not a studio flag, but used to flag model as a non-sorting brush model #define STUDIO_TRANSPARENCY 0x80000000 @@ -29,6 +32,10 @@ // Not a studio flag, but used to flag model as using shadow depth material override #define STUDIO_SHADOWDEPTHTEXTURE 0x40000000 +// Not a studio flag, but used to flag model as doing custom rendering into shadow texture +#define STUDIO_SHADOWTEXTURE 0x20000000 + +#define STUDIO_SKIP_DECALS 0x10000000 enum modtype_t { diff --git a/public/mouthinfo.h b/public/mouthinfo.h index 891fc3be2..571cd6726 100644 --- a/public/mouthinfo.h +++ b/public/mouthinfo.h @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -18,6 +18,7 @@ class CAudioSource; +#pragma pack(push,4) class CVoiceData { public: @@ -77,7 +78,7 @@ class CMouthInfo public: CMouthInfo( void ) { m_nVoiceSources = 0; m_needsEnvelope = false; } - virtual ~CMouthInfo( void ) { ClearVoiceSources(); } + ~CMouthInfo( void ) { ClearVoiceSources(); } int GetNumVoiceSources( void ); CVoiceData *GetVoiceSource( int number ); @@ -101,10 +102,12 @@ class CMouthInfo MAX_VOICE_DATA = 4 }; - CVoiceData m_VoiceSources[ MAX_VOICE_DATA ]; short m_nVoiceSources; - short m_needsEnvelope; + short m_needsEnvelope; + CVoiceData m_VoiceSources[ MAX_VOICE_DATA ]; }; +#pragma pack(pop) + inline bool CMouthInfo::IsActive( void ) { @@ -166,7 +169,11 @@ inline void CMouthInfo::RemoveSourceByIndex( int index ) if ( index < 0 || index >= m_nVoiceSources ) return; - m_VoiceSources[ index ] = m_VoiceSources[ --m_nVoiceSources ]; + --m_nVoiceSources; + if ( m_nVoiceSources > 0 ) + { + m_VoiceSources[ index ] = m_VoiceSources[ m_nVoiceSources ]; + } } inline CVoiceData *CMouthInfo::AddSource( CAudioSource *source, bool bIgnorePhonemes ) @@ -191,4 +198,4 @@ inline CVoiceData *CMouthInfo::AddSource( CAudioSource *source, bool bIgnorePhon return data; } -#endif // MOUTHINFO_H +#endif // MOUTHINFO_H \ No newline at end of file diff --git a/public/networkvar.h b/public/networkvar.h index cc04351d7..11521f849 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -18,13 +18,13 @@ #include "basehandle.h" #endif -#ifdef _MSC_VER + #pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) -#endif #define MyOffsetOf( type, var ) ( (int)&((type*)0)->var ) #ifdef _DEBUG + #undef new extern bool g_bUseNetworkVars; #define CHECK_USENETWORKVARS if(g_bUseNetworkVars) #else @@ -33,6 +33,44 @@ +// network vars use memcmp when fields are set. To ensure proper behavior your +// object's memory should be initialized to zero. This happens for entities automatically +// use this for other classes. +class CMemZeroOnNew +{ +public: + void *operator new( size_t nSize ) + { + void *pMem = MemAlloc_Alloc( nSize ); + V_memset( pMem, 0, nSize ); + return pMem; + } + + void* operator new( size_t nSize, int nBlockUse, const char *pFileName, int nLine ) + { + void *pMem = MemAlloc_Alloc( nSize, pFileName, nLine ); + V_memset( pMem, 0, nSize ); + return pMem; + } + + void operator delete(void *pData) + { + if ( pData ) + { + MemAlloc_Free(pData); + } + } + + void operator delete( void* pData, int nBlockUse, const char *pFileName, int nLine ) + { + if ( pData ) + { + MemAlloc_Free(pData, pFileName, nLine ); + } + } +}; + + inline int InternalCheckDeclareClass( const char *pClassName, const char *pClassNameMatch, void *pTestPtr, void *pBasePtr ) { // This makes sure that casting from ThisClass to BaseClass works right. You'll get a compiler error if it doesn't @@ -167,6 +205,7 @@ static inline void DispatchNetworkStateChanged( T *pObj, void *pVar ) template< class T > NetworkVar_##name& operator=( const T &val ) { *((type*)this) = val; return *this; } \ public: \ void CopyFrom( const type &src ) { *((type *)this) = src; NetworkStateChanged(); } \ + type & GetForModify( void ) { NetworkStateChanged(); return *((type *)this); } \ virtual void NetworkStateChanged() \ { \ DispatchNetworkStateChanged( (ThisClass_##name*)( ((char*)this) - GetOffset_##name() ) ); \ @@ -184,21 +223,26 @@ template< class Type, class Changer > class CNetworkVarBase { public: - template< class C > - const Type& operator=( const C &val ) - { - return Set( ( const Type )val ); + CNetworkVarBase() + { } - - template< class C > - const Type& operator=( const CNetworkVarBase< C, Changer > &val ) - { - return Set( ( const Type )val.m_Value ); + + FORCEINLINE explicit CNetworkVarBase( Type val ) + : m_Value( val ) + { + NetworkStateChanged(); } - - const Type& Set( const Type &val ) + + FORCEINLINE const Type& SetDirect( const Type &val ) { - if ( memcmp( &m_Value, &val, sizeof(Type) ) ) + NetworkStateChanged(); + m_Value = val; + return m_Value; + } + + FORCEINLINE const Type& Set( const Type &val ) + { + if ( m_Value != val ) { NetworkStateChanged(); m_Value = val; @@ -206,66 +250,78 @@ class CNetworkVarBase return m_Value; } - Type& GetForModify() + template< class C > + FORCEINLINE const Type& operator=( const C &val ) + { + return Set( ( const Type )val ); + } + + template< class C > + FORCEINLINE const Type& operator=( const CNetworkVarBase< C, Changer > &val ) + { + return Set( ( const Type )val.m_Value ); + } + + FORCEINLINE Type& GetForModify() { NetworkStateChanged(); return m_Value; } template< class C > - const Type& operator+=( const C &val ) + FORCEINLINE const Type& operator+=( const C &val ) { return Set( m_Value + ( const Type )val ); } template< class C > - const Type& operator-=( const C &val ) + FORCEINLINE const Type& operator-=( const C &val ) { return Set( m_Value - ( const Type )val ); } template< class C > - const Type& operator/=( const C &val ) + FORCEINLINE const Type& operator/=( const C &val ) { return Set( m_Value / ( const Type )val ); } template< class C > - const Type& operator*=( const C &val ) + FORCEINLINE const Type& operator*=( const C &val ) { return Set( m_Value * ( const Type )val ); } template< class C > - const Type& operator^=( const C &val ) + FORCEINLINE const Type& operator^=( const C &val ) { return Set( m_Value ^ ( const Type )val ); } template< class C > - const Type& operator|=( const C &val ) + FORCEINLINE const Type& operator|=( const C &val ) { return Set( m_Value | ( const Type )val ); } - const Type& operator++() + FORCEINLINE const Type& operator++() { return (*this += 1); } - Type operator--() + FORCEINLINE Type operator--() { return (*this -= 1); } - Type operator++( int ) // postfix version.. + FORCEINLINE Type operator++( int ) // postfix version.. { Type val = m_Value; (*this += 1); return val; } - Type operator--( int ) // postfix version.. + FORCEINLINE Type operator--( int ) // postfix version.. { Type val = m_Value; (*this -= 1); @@ -276,22 +332,22 @@ class CNetworkVarBase // CNetworkVarBase = 0x1 // (it warns about converting from an int to an unsigned char). template< class C > - const Type& operator&=( const C &val ) + FORCEINLINE const Type& operator&=( const C &val ) { return Set( m_Value & ( const Type )val ); } - operator const Type&() const + FORCEINLINE operator const Type&() const { return m_Value; } - const Type& Get() const + FORCEINLINE const Type& Get() const { return m_Value; } - const Type* operator->() const + FORCEINLINE const Type* operator->() const { return &m_Value; } @@ -299,16 +355,16 @@ class CNetworkVarBase Type m_Value; protected: - inline void NetworkStateChanged() + FORCEINLINE void NetworkStateChanged() { Changer::NetworkStateChanged( this ); } }; - template< class Type, class Changer > class CNetworkColor32Base : public CNetworkVarBase< Type, Changer > { + typedef CNetworkVarBase< Type, Changer > base; public: inline void Init( byte rVal, byte gVal, byte bVal ) { @@ -331,17 +387,17 @@ class CNetworkColor32Base : public CNetworkVarBase< Type, Changer > const Type& operator=( const CNetworkColor32Base &val ) { - return CNetworkVarBase::Set( val.m_Value ); + return base::Set( val.m_Value ); } - inline byte GetR() const { return CNetworkColor32Base::m_Value.r; } - inline byte GetG() const { return CNetworkColor32Base::m_Value.g; } - inline byte GetB() const { return CNetworkColor32Base::m_Value.b; } - inline byte GetA() const { return CNetworkColor32Base::m_Value.a; } - inline void SetR( byte val ) { SetVal( CNetworkColor32Base::m_Value.r, val ); } - inline void SetG( byte val ) { SetVal( CNetworkColor32Base::m_Value.g, val ); } - inline void SetB( byte val ) { SetVal( CNetworkColor32Base::m_Value.b, val ); } - inline void SetA( byte val ) { SetVal( CNetworkColor32Base::m_Value.a, val ); } + inline byte GetR() const { return this->m_Value.r; } + inline byte GetG() const { return this->m_Value.g; } + inline byte GetB() const { return this->m_Value.b; } + inline byte GetA() const { return this->m_Value.a; } + inline void SetR( byte val ) { SetVal( this->m_Value.r, val ); } + inline void SetG( byte val ) { SetVal( this->m_Value.g, val ); } + inline void SetB( byte val ) { SetVal( this->m_Value.b, val ); } + inline void SetA( byte val ) { SetVal( this->m_Value.a, val ); } protected: inline void SetVal( byte &out, const byte &in ) @@ -359,76 +415,75 @@ class CNetworkColor32Base : public CNetworkVarBase< Type, Changer > template< class Type, class Changer > class CNetworkVectorBase : public CNetworkVarBase< Type, Changer > { + typedef CNetworkVarBase< Type, Changer > base; public: - inline void Init( float ix=0, float iy=0, float iz=0 ) + FORCEINLINE void Init( float ix=0, float iy=0, float iz=0 ) { - SetX( ix ); - SetY( iy ); - SetZ( iz ); + base::Set( Type( ix, iy, iz ) ); } - const Type& operator=( const Type &val ) + FORCEINLINE const Type& operator=( const Type &val ) { - return CNetworkVarBase< Type, Changer >::Set( val ); + return base::Set( val ); } - const Type& operator=( const CNetworkVectorBase &val ) + FORCEINLINE const Type& operator=( const CNetworkVectorBase &val ) { - return CNetworkVarBase::Set( val.m_Value ); + return base::Set( val.m_Value ); } - inline float GetX() const { return CNetworkVectorBase::m_Value.x; } - inline float GetY() const { return CNetworkVectorBase::m_Value.y; } - inline float GetZ() const { return CNetworkVectorBase::m_Value.z; } - inline float operator[]( int i ) const { return CNetworkVectorBase::m_Value[i]; } + FORCEINLINE float GetX() const { return this->m_Value.x; } + FORCEINLINE float GetY() const { return this->m_Value.y; } + FORCEINLINE float GetZ() const { return this->m_Value.z; } + FORCEINLINE float operator[]( int i ) const { return this->m_Value[i]; } - inline void SetX( float val ) { DetectChange( CNetworkVectorBase::m_Value.x, val ); } - inline void SetY( float val ) { DetectChange( CNetworkVectorBase::m_Value.y, val ); } - inline void SetZ( float val ) { DetectChange( CNetworkVectorBase::m_Value.z, val ); } - inline void Set( int i, float val ) { DetectChange( CNetworkVectorBase::m_Value[i], val ); } + FORCEINLINE void SetX( float val ) { DetectChange( this->m_Value.x, val ); } + FORCEINLINE void SetY( float val ) { DetectChange( this->m_Value.y, val ); } + FORCEINLINE void SetZ( float val ) { DetectChange( this->m_Value.z, val ); } + FORCEINLINE void Set( int i, float val ) { DetectChange( this->m_Value[i], val ); } - bool operator==( const Type &val ) const + FORCEINLINE bool operator==( const Type &val ) const { - return CNetworkVectorBase::m_Value == (Type)val; + return this->m_Value == (Type)val; } - bool operator!=( const Type &val ) const + FORCEINLINE bool operator!=( const Type &val ) const { - return CNetworkVectorBase::m_Value != (Type)val; + return this->m_Value != (Type)val; } - const Type operator+( const Type &val ) const + FORCEINLINE const Type operator+( const Type &val ) const { - return CNetworkVectorBase::m_Value + val; + return this->m_Value + val; } - const Type operator-( const Type &val ) const + FORCEINLINE const Type operator-( const Type &val ) const { - return CNetworkVectorBase::m_Value - val; + return this->m_Value - val; } - const Type operator*( const Type &val ) const + FORCEINLINE const Type operator*( const Type &val ) const { - return CNetworkVectorBase::m_Value * val; + return this->m_Value * val; } - const Type& operator*=( float val ) + FORCEINLINE const Type& operator*=( float val ) { - return CNetworkVarBase< Type, Changer >::Set( CNetworkVectorBase::m_Value * val ); + return base::Set( this->m_Value * val ); } - const Type operator*( float val ) const + FORCEINLINE const Type operator*( float val ) const { - return CNetworkVectorBase::m_Value * val; + return this->m_Value * val; } - const Type operator/( const Type &val ) const + FORCEINLINE const Type operator/( const Type &val ) const { - return CNetworkVectorBase::m_Value / val; + return this->m_Value / val; } private: - inline void DetectChange( float &out, float in ) + FORCEINLINE void DetectChange( float &out, float in ) { if ( out != in ) { @@ -443,75 +498,73 @@ class CNetworkVectorBase : public CNetworkVarBase< Type, Changer > template< class Type, class Changer > class CNetworkQuaternionBase : public CNetworkVarBase< Type, Changer > { + typedef CNetworkVarBase< Type, Changer > base; public: inline void Init( float ix=0, float iy=0, float iz=0, float iw = 0 ) { - SetX( ix ); - SetY( iy ); - SetZ( iz ); - SetZ( iw ); + base::Set( Quaternion( ix, iy, iz, iw ) ); } const Type& operator=( const Type &val ) { - return CNetworkVarBase< Type, Changer >::Set( val ); + return Set( val ); } const Type& operator=( const CNetworkQuaternionBase &val ) { - return CNetworkVarBase::Set( val.m_Value ); + return Set( val.m_Value ); } - inline float GetX() const { return CNetworkQuaternionBase::m_Value.x; } - inline float GetY() const { return CNetworkQuaternionBase::m_Value.y; } - inline float GetZ() const { return CNetworkQuaternionBase::m_Value.z; } - inline float GetW() const { return CNetworkQuaternionBase::m_Value.w; } - inline float operator[]( int i ) const { return CNetworkQuaternionBase::m_Value[i]; } + inline float GetX() const { return this->m_Value.x; } + inline float GetY() const { return this->m_Value.y; } + inline float GetZ() const { return this->m_Value.z; } + inline float GetW() const { return this->m_Value.w; } + inline float operator[]( int i ) const { return this->m_Value[i]; } - inline void SetX( float val ) { DetectChange( CNetworkQuaternionBase::m_Value.x, val ); } - inline void SetY( float val ) { DetectChange( CNetworkQuaternionBase::m_Value.y, val ); } - inline void SetZ( float val ) { DetectChange( CNetworkQuaternionBase::m_Value.z, val ); } - inline void SetW( float val ) { DetectChange( CNetworkQuaternionBase::m_Value.w, val ); } - inline void Set( int i, float val ) { DetectChange( CNetworkQuaternionBase::m_Value[i], val ); } + inline void SetX( float val ) { DetectChange( this->m_Value.x, val ); } + inline void SetY( float val ) { DetectChange( this->m_Value.y, val ); } + inline void SetZ( float val ) { DetectChange( this->m_Value.z, val ); } + inline void SetW( float val ) { DetectChange( this->m_Value.w, val ); } + inline void Set( int i, float val ) { DetectChange( this->m_Value[i], val ); } bool operator==( const Type &val ) const { - return CNetworkQuaternionBase::m_Value == (Type)val; + return this->m_Value == (Type)val; } bool operator!=( const Type &val ) const { - return CNetworkQuaternionBase::m_Value != (Type)val; + return this->m_Value != (Type)val; } const Type operator+( const Type &val ) const { - return CNetworkQuaternionBase::m_Value + val; + return this->m_Value + val; } const Type operator-( const Type &val ) const { - return CNetworkQuaternionBase::m_Value - val; + return this->m_Value - val; } const Type operator*( const Type &val ) const { - return CNetworkQuaternionBase::m_Value * val; + return this->m_Value * val; } const Type& operator*=( float val ) { - return CNetworkQuaternionBase< Type, Changer >::Set( CNetworkQuaternionBase::m_Value * val ); + return Set( this->m_Value * val ); } const Type operator*( float val ) const { - return CNetworkQuaternionBase::m_Value * val; + return this->m_Value * val; } const Type operator/( const Type &val ) const { - return CNetworkQuaternionBase::m_Value / val; + return this->m_Value / val; } private: @@ -531,6 +584,7 @@ class CNetworkQuaternionBase : public CNetworkVarBase< Type, Changer > template< class Type, class Changer > class CNetworkHandleBase : public CNetworkVarBase< CBaseHandle, Changer > { + typedef CNetworkVarBase< CBaseHandle, Changer > base; public: const Type* operator=( const Type *val ) { @@ -545,12 +599,12 @@ class CNetworkQuaternionBase : public CNetworkVarBase< Type, Changer > bool operator !() const { - return !CNetworkHandleBase::m_Value.Get(); + return !this->m_Value.Get(); } operator Type*() const { - return static_cast< Type* >( CNetworkHandleBase::m_Value.Get() ); + return static_cast< Type* >( this->m_Value.Get() ); } const Type* Set( const Type *val ) @@ -699,8 +753,7 @@ class CNetworkQuaternionBase : public CNetworkVarBase< Type, Changer > class NetworkVar_##name \ { \ public: \ - template friend int ServerClassInit(T *); \ - template friend datamap_t *DataMapInit(T *); \ + template friend int ServerClassInit(T *); \ const type& operator[]( int i ) const \ { \ return Get( i ); \ @@ -730,12 +783,12 @@ class CNetworkQuaternionBase : public CNetworkVarBase< Type, Changer > } \ const type* Base() const { return m_Value; } \ int Count() const { return count; } \ + type m_Value[count]; \ protected: \ inline void NetworkStateChanged( int index ) \ { \ CHECK_USENETWORKVARS ((ThisClass*)(((char*)this) - MyOffsetOf(ThisClass,name)))->stateChangedFn( &m_Value[index] ); \ } \ - type m_Value[count]; \ }; \ NetworkVar_##name name; diff --git a/public/optimize.h b/public/optimize.h index b7c857cfc..9536f2066 100644 --- a/public/optimize.h +++ b/public/optimize.h @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -14,9 +14,6 @@ #include "studio.h" - -// NOTE: You can change this without affecting the vtx file format. -#define MAX_NUM_BONES_PER_TRI ( MAX_NUM_BONES_PER_VERT * 3 ) #define MAX_NUM_BONES_PER_STRIP 512 #define OPTIMIZED_MODEL_FILE_VERSION 7 @@ -51,44 +48,47 @@ struct Vertex_t char boneID[MAX_NUM_BONES_PER_VERT]; }; -enum StripHeaderFlags_t { - STRIP_IS_TRILIST = 0x01, - STRIP_IS_TRISTRIP = 0x02 +// We don't do actual strips anymore, only triangle lists and subd quad lists +enum StripHeaderFlags_t +{ + STRIP_IS_TRILIST = 0x01, + STRIP_IS_QUADLIST_REG = 0x02, // Regular sub-d quads + STRIP_IS_QUADLIST_EXTRA = 0x04 // Extraordinary sub-d quads }; -// a strip is a piece of a stripgroup that is divided by bones -// (and potentially tristrips if we remove some degenerates.) +// A strip is a piece of a stripgroup that is divided by bones struct StripHeader_t { DECLARE_BYTESWAP_DATADESC(); - // indexOffset offsets into the mesh's index array. - int numIndices; + int numIndices; // indexOffset offsets into the mesh's index array int indexOffset; - // vertexOffset offsets into the mesh's vert array. - int numVerts; + int numVerts; // vertexOffset offsets into the mesh's vert array int vertOffset; - // use this to enable/disable skinning. - // May decide (in optimize.cpp) to put all with 1 bone in a different strip + // Use this to enable/disable skinning. + // May decide (in optimize.cpp) to put all with 1 bone in a different strip // than those that need skinning. - short numBones; + short numBones; unsigned char flags; int numBoneStateChanges; int boneStateChangeOffset; - inline BoneStateChangeHeader_t *pBoneStateChange( int i ) const - { - return (BoneStateChangeHeader_t *)(((byte *)this) + boneStateChangeOffset) + i; + inline BoneStateChangeHeader_t *pBoneStateChange( int i ) const + { + return (BoneStateChangeHeader_t *)(((byte *)this) + boneStateChangeOffset) + i; }; + + // These go last on purpose! + int numTopologyIndices; + int topologyOffset; }; -enum StripGroupFlags_t +enum StripGroupFlags_t { - STRIPGROUP_IS_FLEXED = 0x01, - STRIPGROUP_IS_HWSKINNED = 0x02, - STRIPGROUP_IS_DELTA_FLEXED = 0x04, + STRIPGROUP_IS_HWSKINNED = 0x02, + STRIPGROUP_IS_DELTA_FLEXED = 0x04, STRIPGROUP_SUPPRESS_HW_MORPH = 0x08, // NOTE: This is a temporary flag used at run time. }; @@ -121,6 +121,13 @@ struct StripGroupHeader_t }; unsigned char flags; + + int numTopologyIndices; + int topologyOffset; + inline unsigned short *pTopologyIndex( int i ) const + { + return (unsigned short *)(((byte *)this) + topologyOffset) + i; + }; }; enum MeshFlags_t { @@ -222,7 +229,7 @@ struct FileHeader_t // hardware params that affect how the model is to be optimized. int vertCacheSize; unsigned short maxBonesPerStrip; - unsigned short maxBonesPerTri; + unsigned short maxBonesPerFace; int maxBonesPerVert; // must match checkSum in the .mdl diff --git a/public/posedebugger.cpp b/public/posedebugger.cpp index f937eabb6..52c997a9d 100644 --- a/public/posedebugger.cpp +++ b/public/posedebugger.cpp @@ -392,6 +392,12 @@ void CPoseDebuggerImpl::StartBlending( IClientNetworkable *pEntity, const CStudi // if ( !pVMdl ) // return; + if ( !ThreadInMainThread() ) + { + ExecuteOnce( "Turn of threading when using pose debugger\n" ); + return; + } + // If we are starting a new model then finalize the previous one if ( pStudioHdr != m_pLastModel && m_pLastModel ) { @@ -470,6 +476,11 @@ void CPoseDebuggerImpl::AccumulatePose( const CStudioHdr *pStudioHdr, CIKContext // if ( !pVMdl ) // return; + if ( !ThreadInMainThread() ) + { + return; + } + studiohdr_t const *pRMdl = pStudioHdr->GetRenderHdr(); if ( !pRMdl || !pRMdl->numincludemodels ) @@ -495,12 +506,12 @@ void CPoseDebuggerImpl::AccumulatePose( const CStudioHdr *pStudioHdr, CIKContext // Actual processing // - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( sequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( sequence ); if ( sequence >= pStudioHdr->GetNumSeq() ) { sequence = 0; - seqdesc = pStudioHdr->pSeqdesc( sequence ); + seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( sequence ); } enum @@ -546,9 +557,9 @@ void CPoseDebuggerImpl::AccumulatePose( const CStudioHdr *pStudioHdr, CIKContext 7, pOldTxt ? pOldTxt->m_flTimeAlive : 0.f, 5, - cycle * ( pStudioHdr->pAnimdesc( seqdesc.anim( 0, 0 ) ).numframes - 1 ), + cycle * ( ((CStudioHdr *)pStudioHdr)->pAnimdesc( seqdesc.anim( 0, 0 ) ).numframes - 1 ), 3, - pStudioHdr->pAnimdesc( seqdesc.anim( 0, 0 ) ).numframes, + ((CStudioHdr *)pStudioHdr)->pAnimdesc( seqdesc.anim( 0, 0 ) ).numframes, widthPercent, flWeight * 100.0f ); diff --git a/public/raytrace.h b/public/raytrace.h index 6959b1972..d4d77daf4 100644 --- a/public/raytrace.h +++ b/public/raytrace.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -120,7 +121,10 @@ struct CacheOptimizedTriangle // computing intersections. int ClassifyAgainstAxisSplit(int split_plane, float split_value); // PLANECHECK_xxx below - + + // Debug - take a triangle that has been converted to intersection format and extract the vertices + // from by intersecting the planes + void ExtractVerticesFromIntersectionFormat( Vector &v0, Vector &v1, Vector &v2 ) const; }; #define PLANECHECK_POSITIVE 1 @@ -203,7 +207,7 @@ struct RayTracingSingleResult struct RayTracingResult { FourVectors surface_normal; // surface normal at intersection - ALIGN16 int32 HitIds[4]; // -1=no hit. otherwise, triangle index + ALIGN16 int32 HitIds[4] ALIGN16_POST; // -1=no hit. otherwise, triangle index fltx4 HitDistance; // distance to intersection }; @@ -252,6 +256,16 @@ class ITransparentTriangleCallback virtual bool VisitTriangle_ShouldContinue( const TriIntersectData_t &triangle, const FourRays &rays, fltx4 *hitMask, fltx4 *b0, fltx4 *b1, fltx4 *b2, int32 hitID ) = 0; }; +enum RTECullMode_t +{ + RTE_CULL_NONE = 0, + RTE_CULL_FRONT, + RTE_CULL_BACK +}; + +// serialization flag bits and defines +#define RT_ENV_SERIALIZE_COLORS 1 + class RayTracingEnvironment { public: @@ -274,6 +288,12 @@ class RayTracingEnvironment Flags=0; } +#if !( defined ( _DEBUG ) && defined ( HAMMER_RAYTRACE ) ) + inline void* operator new( size_t size ) { MEM_ALLOC_CREDIT_( "RayTracingEnvironment" ); return MemAlloc_AllocAligned( size, 16 ); } + inline void* operator new( size_t size, int nBlockUse, const char *pFileName, int nLine ) { MEM_ALLOC_CREDIT_( "RayTracingEnvironment" ); return MemAlloc_AllocAligned( size, 16 ); } + inline void operator delete( void* p ) { MemAlloc_FreeAligned( p ); } + inline void operator delete( void* p, int nBlockUse, const char *pFileName, int nLine ) { MemAlloc_FreeAligned( p ); } +#endif // call AddTriangle to set up the world void AddTriangle(int32 id, const Vector &v1, const Vector &v2, const Vector &v3, @@ -296,18 +316,23 @@ class RayTracingEnvironment // SetupAccelerationStructure to prepare for tracing void SetupAccelerationStructure(void); - // lowest level intersection routine - fire 4 rays through the scene. all 4 rays must pass the // Check() function, and t extents must be initialized. skipid can be set to exclude a // particular id (such as the origin surface). This function finds the closest intersection. + template + void Trace4Rays(const FourRays &rays, fltx4 TMin, fltx4 TMax,int DirectionSignMask, + RayTracingResult *rslt_out, + int32 skip_id=-1, ITransparentTriangleCallback *pCallback = NULL ); + + // wrapper for the low level trace4 rays routine void Trace4Rays(const FourRays &rays, fltx4 TMin, fltx4 TMax,int DirectionSignMask, RayTracingResult *rslt_out, - int32 skip_id=-1, ITransparentTriangleCallback *pCallback = NULL); + int32 skip_id=-1, ITransparentTriangleCallback *pCallback = NULL, RTECullMode_t cullMode = RTE_CULL_NONE ); // higher level intersection routine that handles computing the mask and handling rays which do not match in direciton sign void Trace4Rays(const FourRays &rays, fltx4 TMin, fltx4 TMax, RayTracingResult *rslt_out, - int32 skip_id=-1, ITransparentTriangleCallback *pCallback = NULL); + int32 skip_id=-1, ITransparentTriangleCallback *pCallback = NULL, RTECullMode_t cullMode = RTE_CULL_NONE ); // compute virtual light sources to model inter-reflection void ComputeVirtualLightSources(void); @@ -332,13 +357,14 @@ class RayTracingEnvironment /// the rays by direction, tracing them 4 at a time, and de-interleaving the results. void AddToRayStream(RayStream &s, - Vector const &start,Vector const &end,RayTracingSingleResult *rslt_out); + Vector const &start,Vector const &end,RayTracingSingleResult *rslt_out, + RTECullMode_t cullMode = RTE_CULL_NONE); - inline void RayTracingEnvironment::FlushStreamEntry(RayStream &s,int msk); + inline void FlushStreamEntry(RayStream &s, int msk, RTECullMode_t cullMode = RTE_CULL_NONE); /// call this when you are done. handles all cleanup. After this is called, all rslt ptrs /// previously passed to AddToRaySteam will have been filled in. - void FinishRayStream(RayStream &s); + void FinishRayStream(RayStream &s, RTECullMode_t cullMode = RTE_CULL_NONE); int MakeLeafNode(int first_tri, int last_tri); @@ -382,6 +408,11 @@ class RayTracingEnvironment return TriangleColors[triID]; } + // (un)serialization + size_t GetSerializationNumBytes( uint32 nSerializationFlags = 0 ) const; + void Serialize( CUtlBuffer &outbuf, uint32 nSerializationFlags = 0 ) const; + void UnSerialize( CUtlBuffer &inbuf ); + }; diff --git a/public/server_class.h b/public/server_class.h index 4ca7501f8..adc747a1c 100644 --- a/public/server_class.h +++ b/public/server_class.h @@ -43,8 +43,10 @@ class ServerClass ServerClass *p1 = g_pServerClassHead; ServerClass *p2 = p1->m_pNext; - // use _stricmp because Q_stricmp isn't hooked up properly yet - if ( _stricmp( p1->GetName(), pNetworkName ) > 0) + // Comment from Alfred on 7/2/2004 6:43:24 PM in CL 91253, //ValveGames/main/src/public/server_class.h#18: + // ---> use _stricmp because Q_stricmp isn't hooked up properly yet + // [Sergiy, 10/19/2009] hooking up V_stricmp + if ( V_stricmp( p1->GetName(), pNetworkName ) > 0) { m_pNext = g_pServerClassHead; g_pServerClassHead = this; @@ -53,7 +55,7 @@ class ServerClass while( p1 ) { - if ( p2 == NULL || _stricmp( p2->GetName(), pNetworkName ) > 0) + if ( p2 == NULL || V_stricmp( p2->GetName(), pNetworkName ) > 0) { m_pNext = p2; p1->m_pNext = this; diff --git a/public/shake.h b/public/shake.h index 69a0c0fb9..1951ad8e2 100644 --- a/public/shake.h +++ b/public/shake.h @@ -14,16 +14,6 @@ // // Commands for the screen shake effect. -// - -struct ScreenShake_t -{ - int command; - float amplitude; - float frequency; - float duration; -}; - enum ShakeCommand_t { SHAKE_START = 0, // Starts the screen shake for all players within the radius. @@ -34,12 +24,42 @@ enum ShakeCommand_t SHAKE_START_NORUMBLE, // Starts a shake that does NOT rumble the controller. }; +// This structure must have a working copy/assignment constructor. +// At the time of this writing, the implicit one works properly. + +struct ScreenShake_t +{ + ShakeCommand_t command; + float amplitude; + float frequency; + float duration; + Vector direction; + + inline ScreenShake_t() : direction(0,0,0) {}; + inline ScreenShake_t( ShakeCommand_t _command, float _amplitude, float _frequency, + float _duration, const Vector &_direction ); +}; + // // Screen shake message. // extern int gmsgShake; + +// +// Commands for the screen tilt effect. +// + +struct ScreenTilt_t +{ + int command; + bool easeInOut; + QAngle angle; + float duration; + float time; +}; + // Fade in/out extern int gmsgFade; @@ -60,4 +80,12 @@ struct ScreenFade_t }; +// inline funcs: + +inline ScreenShake_t::ScreenShake_t( ShakeCommand_t _command, float _amplitude, float _frequency, + float _duration, const Vector &_direction ) : + command(_command), amplitude(_amplitude), frequency(_frequency), + duration(_duration), direction(_direction) +{} + #endif // SHAKE_H diff --git a/public/soundchars.h b/public/soundchars.h index 554325b02..6a7f80182 100644 --- a/public/soundchars.h +++ b/public/soundchars.h @@ -19,14 +19,17 @@ #define CHAR_DISTVARIANT '^' // as one of 1st 2 chars in name, indicates distance variant encoded stereo wav (left is close, right is far) #define CHAR_OMNI '@' // as one of 1st 2 chars in name, indicates non-directional wav (default mono or stereo) #define CHAR_SPATIALSTEREO ')' // as one of 1st 2 chars in name, indicates spatialized stereo wav +#define CHAR_DIRSTEREO '(' // as one of 1st 2 chars in name, indicates directional stereo wav (like doppler) #define CHAR_FAST_PITCH '}' // as one of 1st 2 chars in name, forces low quality, non-interpolated pitch shift +#define CHAR_SUBTITLED '$' // as one of 1st 2 chars in name, indicates the subtitles are forced inline bool IsSoundChar(char c) { bool b; - b = (c == CHAR_STREAM || c == CHAR_USERVOX || c == CHAR_SENTENCE || c == CHAR_DRYMIX || c == CHAR_OMNI ); - b = b || (c == CHAR_DOPPLER || c == CHAR_DIRECTIONAL || c == CHAR_DISTVARIANT || c == CHAR_SPATIALSTEREO || c == CHAR_FAST_PITCH ); + b = ( c == CHAR_STREAM || c == CHAR_USERVOX || c == CHAR_SENTENCE || c == CHAR_DRYMIX || c == CHAR_OMNI || c== CHAR_DIRSTEREO ); + b = b || ( c == CHAR_DOPPLER || c == CHAR_DIRECTIONAL || c == CHAR_DISTVARIANT || c == CHAR_SPATIALSTEREO || c == CHAR_FAST_PITCH ); + b = b || ( c == CHAR_SUBTITLED ); return b; } diff --git a/public/soundflags.h b/public/soundflags.h index eb8ff3d2e..5d7b386fb 100644 --- a/public/soundflags.h +++ b/public/soundflags.h @@ -27,6 +27,10 @@ enum CHAN_STREAM = 5, // allocate stream channel from the static or dynamic area CHAN_STATIC = 6, // allocate channel from the static area CHAN_VOICE_BASE = 7, // allocate channel for network voice data +}; + +enum +{ CHAN_USER_BASE = (CHAN_VOICE_BASE+128) // Anything >= this number is allocated to game code. }; @@ -102,7 +106,7 @@ enum soundlevel_t #define ATTN_TO_SNDLVL( a ) (soundlevel_t)(int)((a) ? (50 + 20 / ((float)a)) : 0 ) -#define SNDLVL_TO_ATTN( a ) ((a > 50) ? (20.0f / (float)(a - 50)) : 4.0 ) +#define SNDLVL_TO_ATTN( a ) ( (a > 50) ? (20.0f / (float)(a - 50)) : ( (a == 0) ? (0.0f) : (4.0f) ) ) // This is a limit due to network encoding. // It encodes attenuation * 64 in 8 bits, so the maximum is (255 / 64) diff --git a/public/soundinfo.h b/public/soundinfo.h index d53608d64..4073febd8 100644 --- a/public/soundinfo.h +++ b/public/soundinfo.h @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -67,26 +67,31 @@ // This means any negative sound delay greater than -100ms will get encoded at full precision #define SOUND_DELAY_OFFSET (0.100f) +#pragma pack(4) +// the full float time for now. +#define SEND_SOUND_TIME 1 + //----------------------------------------------------------------------------- struct SoundInfo_t { - int nSequenceNumber; - int nEntityIndex; - int nChannel; - const char *pszName; // UNDONE: Make this a FilenameHandle_t to avoid bugs with arrays of these Vector vOrigin; Vector vDirection; + Vector vListenerOrigin; + const char *pszName; // UNDONE: Make this a FilenameHandle_t to avoid bugs with arrays of these float fVolume; - soundlevel_t Soundlevel; - bool bLooping; + float fDelay; + float fTickTime; // delay is encoded relative to this tick, fix up if packet is delayed + int nSequenceNumber; + int nEntityIndex; + int nChannel; int nPitch; - Vector vListenerOrigin; int nFlags; int nSoundNum; - float fDelay; + int nSpeakerEntity; + soundlevel_t Soundlevel; bool bIsSentence; bool bIsAmbient; - int nSpeakerEntity; + bool bLooping; //--------------------------------- @@ -114,6 +119,7 @@ struct SoundInfo_t void SetDefault() { fDelay = DEFAULT_SOUND_PACKET_DELAY; + fTickTime = 0; fVolume = DEFAULT_SOUND_PACKET_VOLUME; Soundlevel = SNDLVL_NORM; nPitch = DEFAULT_SOUND_PACKET_PITCH; @@ -150,7 +156,7 @@ struct SoundInfo_t } // this cries for Send/RecvTables: - void WriteDelta( SoundInfo_t *delta, bf_write &buffer) + void WriteDelta( SoundInfo_t *delta, bf_write &buffer, float finalTickTime ) { if ( nEntityIndex == delta->nEntityIndex ) { @@ -215,7 +221,12 @@ struct SoundInfo_t WRITE_DELTA_UINT( nPitch, 8 ); - if ( fDelay == delta->fDelay ) + float delayValue = fDelay; + if ( (nFlags & SND_DELAY) && fTickTime != finalTickTime ) + { + delayValue += fTickTime - finalTickTime; + } + if ( delayValue == delta->fDelay ) { buffer.WriteOneBit( 0 ); } @@ -223,12 +234,15 @@ struct SoundInfo_t { buffer.WriteOneBit( 1 ); +#if SEND_SOUND_TIME + buffer.WriteFloat( delayValue ); +#else // skipahead works in 10 ms increments // bias results so that we only incur the precision loss on relatively large skipaheads - fDelay += SOUND_DELAY_OFFSET; + delayValue += SOUND_DELAY_OFFSET; // Convert to msecs - int iDelay = fDelay * 1000.0f; + int iDelay = delayValue * 1000.0f; iDelay = clamp( iDelay, (int)(-10 * MAX_SOUND_DELAY_MSEC), (int)(MAX_SOUND_DELAY_MSEC) ); @@ -238,6 +252,7 @@ struct SoundInfo_t } buffer.WriteSBitLong( iDelay , MAX_SOUND_DELAY_MSEC_ENCODE_BITS ); +#endif } // don't transmit sounds with high precision @@ -318,6 +333,9 @@ struct SoundInfo_t if ( buffer.ReadOneBit() != 0 ) { +#if SEND_SOUND_TIME + fDelay = buffer.ReadFloat(); +#else // Up to 4096 msec delay fDelay = (float)buffer.ReadSBitLong( MAX_SOUND_DELAY_MSEC_ENCODE_BITS ) / 1000.0f; ; @@ -327,6 +345,7 @@ struct SoundInfo_t } // bias results so that we only incur the precision loss on relatively large skipaheads fDelay -= SOUND_DELAY_OFFSET; +#endif } else { @@ -364,5 +383,6 @@ struct SpatializationInfo_t QAngle *pAngles; float *pflRadius; }; +#pragma pack() #endif // SOUNDINFO_H diff --git a/public/steam/isteamgameserver.h b/public/steam/isteamgameserver.h new file mode 100644 index 000000000..bad4d35f9 --- /dev/null +++ b/public/steam/isteamgameserver.h @@ -0,0 +1,226 @@ +//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam for game servers +// +//============================================================================= + +#ifndef ISTEAMGAMESERVER_H +#define ISTEAMGAMESERVER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + + +//----------------------------------------------------------------------------- +// Purpose: Functions for authenticating users via Steam to play on a game server +//----------------------------------------------------------------------------- +class ISteamGameServer +{ +public: + // connection functions + virtual void LogOn() = 0; + virtual void LogOff() = 0; + + // status functions + virtual bool BLoggedOn() = 0; + virtual bool BSecure() = 0; + virtual CSteamID GetSteamID() = 0; + + // Handles receiving a new connection from a Steam user. This call will ask the Steam + // servers to validate the users identity, app ownership, and VAC status. If the Steam servers + // are off-line, then it will validate the cached ticket itself which will validate app ownership + // and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection() + // and must then be sent up to the game server for authentication. + // + // Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL + // If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication + // for the user has succeeded or failed (the steamid in the callback will match the one returned by this call) + virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0; + + // Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation. + // + // Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect() + // when this user leaves the server just like you would for a real user. + virtual CSteamID CreateUnauthenticatedUserConnection() = 0; + + // Should be called whenever a user leaves our game server, this lets Steam internally + // track which users are currently on which servers for the purposes of preventing a single + // account being logged into multiple servers, showing who is currently on a server, etc. + virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0; + + // Update the data to be displayed in the server browser and matchmaking interfaces for a user + // currently connected to the server. For regular users you must call this after you receive a + // GSUserValidationSuccess callback. + // + // Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player) + virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0; + + // You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once. + // + // To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below. + // + // Input: nGameAppID - The Steam assigned AppID for the game + // unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below) + // unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY) + // unGamePort - The port which the server is listening for client connections on + // unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported + // usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests + // pchGameDir - A unique string identifier for your game + // pchVersion - The current version of the server as a string like 1.0.0.0 + // bLanMode - Is this a LAN only server? + // + // bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used, + // and stop calling it in SteamGameServer_Init()? + virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort, + uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0; + + // Updates server status values which shows up in the server browser and matchmaking APIs + virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers, + const char *pchServerName, const char *pSpectatorServerName, + const char *pchMapName ) = 0; + + // This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now). + virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0; + + // Sets a string defining the "gametags" for this server, this is optional, but if it is set + // it allows users to filter in the matchmaking/server-browser interfaces based on the value + virtual void SetGameTags( const char *pchGameTags ) = 0; + + // Ask for the gameplay stats for the server. Results returned in a callback + virtual void GetGameplayStats( ) = 0; + + // Gets the reputation score for the game server. This API also checks if the server or some + // other server on the same IP is banned from the Steam master servers. + virtual SteamAPICall_t GetServerReputation( ) = 0; + + // Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t + // returns false if we're not connected to the steam servers and thus cannot ask + virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0; + + // Returns the public IP of the server according to Steam, useful when the server is + // behind NAT and you want to advertise its IP in a lobby for other clients to directly + // connect to + virtual uint32 GetPublicIP() = 0; + + // Sets a string defining the "gamedata" for this server, this is optional, but if it is set + // it allows users to filter in the matchmaking/server-browser interfaces based on the value + // don't set this unless it actually changes, its only uploaded to the master once (when + // acknowledged) + virtual void SetGameData( const char *pchGameData) = 0; + + // After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function + // to determine if the user owns downloadable content specified by the provided AppID. + virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0; +}; + +#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer010" + +// game server flags +const uint32 k_unServerFlagNone = 0x00; +const uint32 k_unServerFlagActive = 0x01; // server has users playing +const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure +const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated +const uint32 k_unServerFlagLinux = 0x08; // linux build +const uint32 k_unServerFlagPassworded = 0x10; // password protected +const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and + // won't enforce authentication of users that connect to the server. + // Useful when you run a server where the clients may not + // be connected to the internet but you want them to play (i.e LANs) + + +// callbacks +#pragma pack( push, 8 ) + + +// client has been approved to connect to this game server +struct GSClientApprove_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 1 }; + CSteamID m_SteamID; +}; + + +// client has been denied to connection to this game server +struct GSClientDeny_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 2 }; + CSteamID m_SteamID; + EDenyReason m_eDenyReason; + char m_rgchOptionalText[128]; +}; + + +// request the game server should kick the user +struct GSClientKick_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 3 }; + CSteamID m_SteamID; + EDenyReason m_eDenyReason; +}; + +// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks, +// do not reuse them here. + + +// client achievement info +struct GSClientAchievementStatus_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 6 }; + uint64 m_SteamID; + char m_pchAchievement[128]; + bool m_bUnlocked; +}; + +// received when the game server requests to be displayed as secure (VAC protected) +// m_bSecure is true if the game server should display itself as secure to users, false otherwise +struct GSPolicyResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 15 }; + uint8 m_bSecure; +}; + +// GS gameplay stats info +struct GSGameplayStats_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 7 }; + EResult m_eResult; // Result of the call + int32 m_nRank; // Overall rank of the server (0-based) + uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server + uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server +}; + +// send as a reply to RequestUserGroupStatus() +struct GSClientGroupStatus_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 8 }; + CSteamID m_SteamIDUser; + CSteamID m_SteamIDGroup; + bool m_bMember; + bool m_bOfficer; +}; + +// Sent as a reply to GetServerReputation() +struct GSReputation_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 9 }; + EResult m_eResult; // Result of the call; + uint32 m_unReputationScore; // The reputation score for the game server + bool m_bBanned; // True if the server is banned from the Steam + // master servers + + // The following members are only filled out if m_bBanned is true. They will all + // be set to zero otherwise. Master server bans are by IP so it is possible to be + // banned even when the score is good high if there is a bad server on another port. + // This information can be used to determine which server is bad. + + uint32 m_unBannedIP; // The IP of the banned server + uint16 m_usBannedPort; // The port of the banned server + uint64 m_ulBannedGameID; // The game ID the banned server is serving + uint32 m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) +}; + +#pragma pack( pop ) + +#endif // ISTEAMGAMESERVER_H diff --git a/public/steam/isteamgameserverstats.h b/public/steam/isteamgameserverstats.h new file mode 100644 index 000000000..988b284dd --- /dev/null +++ b/public/steam/isteamgameserverstats.h @@ -0,0 +1,93 @@ +//====== Copyright © Valve Corporation, All rights reserved. ======= +// +// Purpose: interface for game servers to steam stats and achievements +// +//============================================================================= + +#ifndef ISTEAMGAMESERVERSTATS_H +#define ISTEAMGAMESERVERSTATS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +//----------------------------------------------------------------------------- +// Purpose: Functions for authenticating users via Steam to play on a game server +//----------------------------------------------------------------------------- +class ISteamGameServerStats +{ +public: + // downloads stats for the user + // returns a GSStatsReceived_t callback when completed + // if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail + // these stats will only be auto-updated for clients playing on the server. For other + // users you'll need to call RequestUserStats() again to refresh any data + virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; + + // requests stat information for a user, usable after a successful call to RequestUserStats() + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0; + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0; + virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0; + + // Set / update stats and achievements. + // Note: These updates will work only on stats game servers are allowed to edit and only for + // game servers that have been declared as officially controlled by the game creators. + // Set the IP range of your official servers on the Steamworks page + virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0; + virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0; + virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0; + + virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; + virtual bool ClearUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; + + // Store the current data on the server, will get a GSStatsStored_t callback when set. + // + // If the callback has a result of k_EResultInvalidParam, one or more stats + // uploaded has been rejected, either because they broke constraints + // or were out of date. In this case the server sends back updated values. + // The stats should be re-iterated to keep in sync. + virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0; +}; + +#define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001" + +// callbacks +#pragma pack( push, 8 ) + +//----------------------------------------------------------------------------- +// Purpose: called when the latests stats and achievements have been received +// from the server +//----------------------------------------------------------------------------- +struct GSStatsReceived_t +{ + enum { k_iCallback = k_iSteamGameServerStatsCallbacks }; + EResult m_eResult; // Success / error fetching the stats + CSteamID m_steamIDUser; // The user for whom the stats are retrieved for +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the user stats for a game +//----------------------------------------------------------------------------- +struct GSStatsStored_t +{ + enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 }; + EResult m_eResult; // success / error + CSteamID m_steamIDUser; // The user for whom the stats were stored +}; + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that a user's stats have been unloaded. +// Call RequestUserStats again to access stats for this user +//----------------------------------------------------------------------------- +struct GSStatsUnloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 }; + CSteamID m_steamIDUser; // User whose stats have been unloaded +}; + +#pragma pack( pop ) + + +#endif // ISTEAMGAMESERVERSTATS_H diff --git a/public/steam/isteammasterserverupdater.h b/public/steam/isteammasterserverupdater.h new file mode 100644 index 000000000..9ea09a8b4 --- /dev/null +++ b/public/steam/isteammasterserverupdater.h @@ -0,0 +1,103 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam for retrieving list of game servers +// +//============================================================================= + +#ifndef ISTEAMMASTERSERVERUPDATER_H +#define ISTEAMMASTERSERVERUPDATER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1) + + +//----------------------------------------------------------------------------- +// Purpose: Game engines use this to tell the Steam master servers +// about their games so their games can show up in the server browser. +//----------------------------------------------------------------------------- +class ISteamMasterServerUpdater +{ +public: + + // Call this as often as you like to tell the master server updater whether or not + // you want it to be active (default: off). + virtual void SetActive( bool bActive ) = 0; + + // You usually don't need to modify this. + // Pass -1 to use the default value for iHeartbeatInterval. + // Some mods change this. + virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0; + + +// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own +// socket to talk to the master server on, it lets the game use its socket to forward messages +// back and forth. This prevents us from requiring server ops to open up yet another port +// in their firewalls. +// +// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001 + + // These are used when you've elected to multiplex the game server's UDP socket + // rather than having the master server updater use its own sockets. + // + // Source games use this to simplify the job of the server admins, so they + // don't have to open up more ports on their firewalls. + + // Call this when a packet that starts with 0xFFFFFFFF comes in. That means + // it's for us. + virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0; + + // AFTER calling HandleIncomingPacket for any packets that came in that frame, call this. + // This gets a packet that the master server updater needs to send out on UDP. + // It returns the length of the packet it wants to send, or 0 if there are no more packets to send. + // Call this each frame until it returns 0. + virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0; + + +// Functions to set various fields that are used to respond to queries. + + // Call this to set basic data that is passed to the server browser. + virtual void SetBasicServerData( + unsigned short nProtocolVersion, + bool bDedicatedServer, + const char *pRegionName, + const char *pProductName, + unsigned short nMaxReportedClients, + bool bPasswordProtected, + const char *pGameDescription ) = 0; + + // Call this to clear the whole list of key/values that are sent in rules queries. + virtual void ClearAllKeyValues() = 0; + + // Call this to add/update a key/value pair. + virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0; + + + // You can call this upon shutdown to clear out data stored for this game server and + // to tell the master servers that this server is going away. + virtual void NotifyShutdown() = 0; + + // Returns true if the master server has requested a restart. + // Only returns true once per request. + virtual bool WasRestartRequested() = 0; + + // Force it to request a heartbeat from the master servers. + virtual void ForceHeartbeat() = 0; + + // Manually edit and query the master server list. + // It will provide name resolution and use the default master server port if none is provided. + virtual bool AddMasterServer( const char *pServerAddress ) = 0; + virtual bool RemoveMasterServer( const char *pServerAddress ) = 0; + + virtual int GetNumMasterServers() = 0; + + // Returns the # of bytes written to pOut. + virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0; +}; + +#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001" + +#endif // ISTEAMMASTERSERVERUPDATER_H diff --git a/public/steam/isteamnetworking.h b/public/steam/isteamnetworking.h new file mode 100644 index 000000000..5161fc213 --- /dev/null +++ b/public/steam/isteamnetworking.h @@ -0,0 +1,278 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam managing network connections between game clients & servers +// +//============================================================================= + +#ifndef ISTEAMNETWORKING +#define ISTEAMNETWORKING +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" + + +// list of possible errors returned by SendP2PPacket() API +// these will be posted in the P2PSessionConnectFail_t callback +enum EP2PSessionError +{ + k_EP2PSessionErrorNone = 0, + k_EP2PSessionErrorNotRunningApp = 1, // target is not running the same game + k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running + k_EP2PSessionErrorDestinationNotLoggedIn = 3, // target user isn't connected to Steam + k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser() + // corporate firewalls can also block this (NAT traversal is not firewall traversal) + // make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction + +}; + +// SendP2PPacket() send types +// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets +enum EP2PSend +{ + // Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare). + // The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or + // there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again. + k_EP2PSendUnreliable = 0, + + // As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first + // packet sent to a remote host almost guarantees the packet will be dropped. + // This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets + k_EP2PSendUnreliableNoDelay = 1, + + // Reliable message send. Can send up to 1MB of data in a single message. + // Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data. + k_EP2PSendReliable = 2, + + // As above, but applies the Nagle algorithm to the send - sends will accumulate + // until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm). + // Useful if you want to send a set of smaller messages but have the coalesced into a single packet + // Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then + // do a normal k_EP2PSendReliable to force all the buffered data to be sent. + k_EP2PSendReliableWithBuffering = 3, + +}; + + +// connection state to a specified user, returned by GetP2PSessionState() +// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin +#pragma pack( push, 8 ) +struct P2PSessionState_t +{ + uint8 m_bConnectionActive; // true if we've got an active open connection + uint8 m_bConnecting; // true if we're currently trying to establish a connection + uint8 m_eP2PSessionError; // last error recorded (see enum above) + uint8 m_bUsingRelay; // true if it's going through a relay server (TURN) + int32 m_nBytesQueuedForSend; + int32 m_nPacketsQueuedForSend; + uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server. + uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's +}; +#pragma pack( pop ) + + +// handle to a socket +typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket() +typedef uint32 SNetListenSocket_t; // CreateListenSocket() + +// connection progress indicators, used by CreateP2PConnectionSocket() +enum ESNetSocketState +{ + k_ESNetSocketStateInvalid = 0, + + // communication is valid + k_ESNetSocketStateConnected = 1, + + // states while establishing a connection + k_ESNetSocketStateInitiated = 10, // the connection state machine has started + + // p2p connections + k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info + k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info + + // direct connections + k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server + + // failure states + k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end + k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown + k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection + k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us + k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke + +}; + +// describes how the socket is currently connected +enum ESNetSocketConnectionType +{ + k_ESNetSocketConnectionTypeNotConnected = 0, + k_ESNetSocketConnectionTypeUDP = 1, + k_ESNetSocketConnectionTypeUDPRelay = 2, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for making connections and sending data between clients, +// traversing NAT's where possible +//----------------------------------------------------------------------------- +class ISteamNetworking +{ +public: + //////////////////////////////////////////////////////////////////////////////////////////// + // Session-less connection functions + // automatically establishes NAT-traversing or Relay server connections + + // Sends a P2P packet to the specified user + // UDP-like, unreliable and a max packet size of 1200 bytes + // the first packet send may be delayed as the NAT-traversal code runs + // if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t + // see EP2PSend enum above for the descriptions of the different ways of sending packets + virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType ) = 0; + + // returns true if any data is available for read, and the amount of data that will need to be read + virtual bool IsP2PPacketAvailable( uint32 *pcubMsgSize ) = 0; + + // reads in a packet that has been sent from another user via SendP2PPacket() + // returns the size of the message and the steamID of the user who sent it in the last two parameters + // if the buffer passed in is too small, the message will be truncated + // this call is not blocking, and will return false if no data is available + virtual bool ReadP2PPacket( void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote ) = 0; + + // AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback + // P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet + // if you don't want to talk to the user, just ignore the request + // if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically + // this may be called multiple times for a single user + // (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request) + virtual bool AcceptP2PSessionWithUser( CSteamID steamIDRemote ) = 0; + + // call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood + // if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted + virtual bool CloseP2PSessionWithUser( CSteamID steamIDRemote ) = 0; + + // fills out P2PSessionState_t structure with details about the underlying connection to the user + // should only needed for debugging purposes + // returns false if no connection exists to the specified user + virtual bool GetP2PSessionState( CSteamID steamIDRemote, P2PSessionState_t *pConnectionState ) = 0; + + + //////////////////////////////////////////////////////////////////////////////////////////// + // LISTEN / CONNECT style interface functions + // + // This is an older set of functions designed around the Berkeley TCP sockets model + // it's preferential that you use the above P2P functions, they're more robust + // and these older functions will be removed eventually + // + //////////////////////////////////////////////////////////////////////////////////////////// + + + // creates a socket and listens others to connect + // will trigger a SocketStatusCallback_t callback on another client connecting + // nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports + // this can usually just be 0 unless you want multiple sets of connections + // unIP is the local IP address to bind to + // pass in 0 if you just want the default local IP + // unPort is the port to use + // pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only + virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0; + + // creates a socket and begin connection to a remote destination + // can connect via a known steamID (client or game server), or directly to an IP + // on success will trigger a SocketStatusCallback_t callback + // on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState + virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0; + virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0; + + // disconnects the connection to the socket, if any, and invalidates the handle + // any unread data on the socket will be thrown away + // if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect + virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; + // destroying a listen socket will automatically kill all the regular sockets generated from it + virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; + + // sending data + // must be a handle to a connected socket + // data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets + // use the reliable flag with caution; although the resend rate is pretty aggressive, + // it can still cause stalls in receiving data (like TCP) + virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0; + + // receiving data + // returns false if there is no data remaining + // fills out *pcubMsgSize with the size of the next message, in bytes + virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0; + + // fills in pubDest with the contents of the message + // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) + // if *pcubMsgSize < cubDest, only partial data is written + // returns false if no data is available + virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; + + // checks for data from any socket that has been connected off this listen socket + // returns false if there is no data remaining + // fills out *pcubMsgSize with the size of the next message, in bytes + // fills out *phSocket with the socket that data is available on + virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; + + // retrieves data from any socket that has been connected off this listen socket + // fills in pubDest with the contents of the message + // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) + // if *pcubMsgSize < cubDest, only partial data is written + // returns false if no data is available + // fills out *phSocket with the socket that data is available on + virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; + + // returns information about the specified socket, filling out the contents of the pointers + virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0; + + // returns which local port the listen socket is bound to + // *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only + virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0; + + // returns true to describe how the socket ended up connecting + virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0; + + // max packet size, in bytes + virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0; +}; +#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking003" + +// callbacks +#pragma pack( push, 8 ) + +// callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API +// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them +struct P2PSessionRequest_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 }; + CSteamID m_steamIDRemote; // user who wants to talk to us +}; + + +// callback notification - packets can't get through to the specified user via the SendP2PPacket() API +// all packets queued packets unsent at this point will be dropped +// further attempts to send will retry making the connection (but will be dropped if we fail again) +struct P2PSessionConnectFail_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 }; + CSteamID m_steamIDRemote; // user we were sending packets to + uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble +}; + + +// callback notification - status of a socket has changed +// used as part of the CreateListenSocket() / CreateP2PConnectionSocket() +struct SocketStatusCallback_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 }; + SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host + SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection + CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one + int m_eSNetSocketState; // socket state, ESNetSocketState +}; + +#pragma pack( pop ) + +#endif // ISTEAMNETWORKING diff --git a/public/steam/isteamremotestorage.h b/public/steam/isteamremotestorage.h new file mode 100644 index 000000000..8287228b8 --- /dev/null +++ b/public/steam/isteamremotestorage.h @@ -0,0 +1,45 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMREMOTESTORAGE_H +#define ISTEAMREMOTESTORAGE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing, reading and writing files stored remotely +// and cached locally +//----------------------------------------------------------------------------- +class ISteamRemoteStorage +{ + public: + // NOTE + // + // Filenames are case-insensitive, and will be converted to lowercase automatically. + // So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then + // iterate the files, the filename returned will be "foo.bar". + // + + // file operations + virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; + virtual int32 GetFileSize( const char *pchFile ) = 0; + virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; + virtual bool FileExists( const char *pchFile ) = 0; + + // iteration + virtual int32 GetFileCount() = 0; + virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0; + + // quota management + virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0; +}; + +#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION002" + +#endif // ISTEAMREMOTESTORAGE_H diff --git a/public/steam/steam_gameserver.h b/public/steam/steam_gameserver.h new file mode 100644 index 000000000..014f53e66 --- /dev/null +++ b/public/steam/steam_gameserver.h @@ -0,0 +1,143 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: +// +//============================================================================= + +#ifndef STEAM_GAMESERVER_H +#define STEAM_GAMESERVER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api.h" +#include "isteamgameserver.h" +#include "isteammasterserverupdater.h" +#include "isteamgameserverstats.h" + +enum EServerMode +{ + eServerModeInvalid = 0, // DO NOT USE + eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list + eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect + eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients +}; + +// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode, +// which means that the game is responsible for sending and receiving UDP packets for the master +// server updater. See references to GameSocketShare in isteammasterserverupdater.h. +// +// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report +// what's running based on that. +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString ); +#else +S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString ); + +S_API ISteamGameServer *SteamGameServer(); +S_API ISteamUtils *SteamGameServerUtils(); +S_API ISteamMasterServerUpdater *SteamMasterServerUpdater(); +S_API ISteamNetworking *SteamGameServerNetworking(); +S_API ISteamGameServerStats *SteamGameServerStats(); +#endif + +S_API void SteamGameServer_Shutdown(); +S_API void SteamGameServer_RunCallbacks(); + +S_API bool SteamGameServer_BSecure(); +S_API uint64 SteamGameServer_GetSteamID(); + +#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam ) + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steamclient.dll private wrapper functions +// +// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +S_API HSteamPipe SteamGameServer_GetHSteamPipe(); + +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that +// lets them each specify the interface versions they are compiled with. +// +// It's important that these stay inlined in the header so the calling module specifies the interface versions +// for whatever Steam API version it has. +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +S_API HSteamUser SteamGameServer_GetHSteamUser(); + +class CSteamGameServerAPIContext +{ +public: + CSteamGameServerAPIContext(); + void Clear(); + + bool Init(); + + ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; } + ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; } + ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; } + ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; } + ISteamGameServerStats *SteamGameServerStats() { return m_pSteamGameServerStats; } + +private: + ISteamGameServer *m_pSteamGameServer; + ISteamUtils *m_pSteamGameServerUtils; + ISteamMasterServerUpdater *m_pSteamMasterServerUpdater; + ISteamNetworking *m_pSteamGameServerNetworking; + ISteamGameServerStats *m_pSteamGameServerStats; +}; + +inline CSteamGameServerAPIContext::CSteamGameServerAPIContext() +{ + Clear(); +} + +inline void CSteamGameServerAPIContext::Clear() +{ + m_pSteamGameServer = NULL; + m_pSteamGameServerUtils = NULL; + m_pSteamMasterServerUpdater = NULL; + m_pSteamGameServerNetworking = NULL; + m_pSteamGameServerStats = NULL; +} + +S_API ISteamClient *g_pSteamClientGameServer; +// This function must be inlined so the module using steam_api.dll gets the version names they want. +inline bool CSteamGameServerAPIContext::Init() +{ + if ( !g_pSteamClientGameServer ) + return false; + + HSteamUser hSteamUser = SteamGameServer_GetHSteamUser(); + HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe(); + + m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION ); + if ( !m_pSteamGameServer ) + return false; + + m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); + if ( !m_pSteamGameServerUtils ) + return false; + + m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION ); + if ( !m_pSteamMasterServerUpdater ) + return false; + + m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); + if ( !m_pSteamGameServerNetworking ) + return false; + + m_pSteamGameServerStats = g_pSteamClientGameServer->GetISteamGameServerStats( hSteamUser, hSteamPipe, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); + if ( !m_pSteamGameServerStats ) + return false; + + return true; +} + +#endif // VERSION_SAFE_STEAM_API_INTERFACES + + +#endif // STEAM_GAMESERVER_H diff --git a/public/studio.cpp b/public/studio.cpp index f303fdb69..fe2525a54 100644 --- a/public/studio.cpp +++ b/public/studio.cpp @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -10,6 +10,8 @@ #include "datacache/idatacache.h" #include "datacache/imdlcache.h" #include "convar.h" +#include "tier1/utlmap.h" +#include "tier0/vprof.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -40,24 +42,24 @@ mstudioanimdesc_t &studiohdr_t::pAnimdesc( int i ) const // Purpose: //----------------------------------------------------------------------------- -mstudioanim_t *mstudioanimdesc_t::pAnimBlock( int block, int index ) const +byte *mstudioanimdesc_t::pAnimBlock( int block, int index ) const { if (block == -1) { - return (mstudioanim_t *)NULL; + return (byte *)NULL; } if (block == 0) { - return (mstudioanim_t *)(((byte *)this) + index); + return (((byte *)this) + index); } byte *pAnimBlock = pStudiohdr()->GetAnimBlock( block ); if ( pAnimBlock ) { - return (mstudioanim_t *)(pAnimBlock + index); + return pAnimBlock + index; } - return (mstudioanim_t *)NULL; + return (byte *)NULL; } //----------------------------------------------------------------------------- @@ -65,15 +67,15 @@ mstudioanim_t *mstudioanimdesc_t::pAnimBlock( int block, int index ) const //----------------------------------------------------------------------------- static ConVar mod_load_showstall( "mod_load_showstall", "0", 0, "1 - show hitches , 2 - show stalls" ); -mstudioanim_t *mstudioanimdesc_t::pAnim( int *piFrame ) const +byte *mstudioanimdesc_t::pAnim( int *piFrame ) const { float flStall; return pAnim( piFrame, flStall ); } -mstudioanim_t *mstudioanimdesc_t::pAnim( int *piFrame, float &flStall ) const +byte *mstudioanimdesc_t::pAnim( int *piFrame, float &flStall ) const { - mstudioanim_t *panim = NULL; + byte *panim = NULL; int block = animblock; int index = animindex; @@ -176,23 +178,27 @@ mstudioanim_t *mstudioanimdesc_t::pAnim( int *piFrame, float &flStall ) const mstudioikrule_t *mstudioanimdesc_t::pIKRule( int i ) const { - if (ikruleindex) + if (numikrules) { - return (mstudioikrule_t *)(((byte *)this) + ikruleindex) + i; - } - else if (animblockikruleindex) - { - if (animblock == 0) + if (ikruleindex) { - return (mstudioikrule_t *)(((byte *)this) + animblockikruleindex) + i; + return (mstudioikrule_t *)(((byte *)this) + ikruleindex) + i; } - else + else { - byte *pAnimBlocks = pStudiohdr()->GetAnimBlock( animblock ); - - if ( pAnimBlocks ) + if (animblock == 0) { - return (mstudioikrule_t *)(pAnimBlocks + animblockikruleindex) + i; + AssertOnce(0); // Should never happen + return (mstudioikrule_t *)(((byte *)this) + animblockikruleindex) + i; + } + else + { + byte *pAnimBlock = pStudiohdr()->GetAnimBlock( animblock ); + + if ( pAnimBlock ) + { + return (mstudioikrule_t *)(pAnimBlock + animblockikruleindex) + i; + } } } } @@ -211,11 +217,11 @@ mstudiolocalhierarchy_t *mstudioanimdesc_t::pHierarchy( int i ) const } else { - byte *pAnimBlocks = pStudiohdr()->GetAnimBlock( animblock ); + byte *pAnimBlock = pStudiohdr()->GetAnimBlock( animblock ); - if ( pAnimBlocks ) + if ( pAnimBlock ) { - return (mstudiolocalhierarchy_t *)(pAnimBlocks + localhierarchyindex) + i; + return (mstudiolocalhierarchy_t *)(pAnimBlock + localhierarchyindex) + i; } } } @@ -342,7 +348,7 @@ int studiohdr_t::GetNumPoseParameters( void ) const // Purpose: //----------------------------------------------------------------------------- -const mstudioposeparamdesc_t &studiohdr_t::pPoseParameter( int i ) const +const mstudioposeparamdesc_t &studiohdr_t::pPoseParameter( int i ) { if (numincludemodels == 0) { @@ -391,7 +397,7 @@ int studiohdr_t::GetSharedPoseParameter( int iSequence, int iLocalPose ) const // Purpose: //----------------------------------------------------------------------------- -int studiohdr_t::EntryNode( int iSequence ) const +int studiohdr_t::EntryNode( int iSequence ) { mstudioseqdesc_t &seqdesc = pSeqdesc( iSequence ); @@ -414,7 +420,7 @@ int studiohdr_t::EntryNode( int iSequence ) const //----------------------------------------------------------------------------- -int studiohdr_t::ExitNode( int iSequence ) const +int studiohdr_t::ExitNode( int iSequence ) { mstudioseqdesc_t &seqdesc = pSeqdesc( iSequence ); @@ -476,7 +482,7 @@ const mstudioattachment_t &studiohdr_t::pAttachment( int i ) const // Purpose: //----------------------------------------------------------------------------- -int studiohdr_t::GetAttachmentBone( int i ) const +int studiohdr_t::GetAttachmentBone( int i ) { const mstudioattachment_t &attachment = pAttachment( i ); @@ -516,7 +522,7 @@ void studiohdr_t::SetAttachmentBone( int iAttachment, int iBone ) // Purpose: //----------------------------------------------------------------------------- -const char *studiohdr_t::pszNodeName( int iNode ) const +char *studiohdr_t::pszNodeName( int iNode ) { if (numincludemodels == 0) { @@ -555,7 +561,7 @@ int studiohdr_t::GetTransition( int iFrom, int iTo ) const } -int studiohdr_t::GetActivityListVersion( void ) const +int studiohdr_t::GetActivityListVersion( void ) { if (numincludemodels == 0) { @@ -624,7 +630,7 @@ int studiohdr_t::GetNumIKAutoplayLocks( void ) const return pVModel->m_iklock.Count(); } -const mstudioiklock_t &studiohdr_t::pIKAutoplayLock( int i ) const +const mstudioiklock_t &studiohdr_t::pIKAutoplayLock( int i ) { if (numincludemodels == 0) { @@ -744,20 +750,9 @@ void CStudioHdr::Init( const studiohdr_t *pStudioHdr, IMDLCache *mdlcache ) m_nFrameUnlockCounter = *m_pFrameUnlockCounter - 1; } - if (m_pStudioHdr->numincludemodels == 0) - { -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE -#else - m_ActivityToSequence.Initialize(this); -#endif - } - else + if (m_pStudioHdr->numincludemodels != 0) { ResetVModel( m_pStudioHdr->GetVirtualModel() ); -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE -#else - m_ActivityToSequence.Initialize(this); -#endif } m_boneFlags.EnsureCount( numbones() ); @@ -767,10 +762,14 @@ void CStudioHdr::Init( const studiohdr_t *pStudioHdr, IMDLCache *mdlcache ) m_boneFlags[i] = pBone( i )->flags; m_boneParent[i] = pBone( i )->parent; } + + m_pActivityToSequence = NULL; } void CStudioHdr::Term() { + CActivityToSequenceMapping::ReleaseMapping( m_pActivityToSequence ); + m_pActivityToSequence = NULL; } //----------------------------------------------------------------------------- @@ -799,9 +798,9 @@ const virtualmodel_t * CStudioHdr::ResetVModel( const virtualmodel_t *pVModel ) if (pVModel != NULL) { m_pVModel = (virtualmodel_t *)pVModel; - #if defined(_WIN32) && !defined(THREAD_PROFILER) +#if !defined( POSIX ) Assert( !pVModel->m_Lock.GetOwnerId() ); - #endif +#endif m_pStudioHdrCache.SetCount( m_pVModel->m_group.Count() ); int i; @@ -819,7 +818,7 @@ const virtualmodel_t * CStudioHdr::ResetVModel( const virtualmodel_t *pVModel ) } } -const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) const +const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) { if ( !this ) { @@ -840,7 +839,7 @@ const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) const if ( !m_pStudioHdrCache.IsValidIndex( i ) ) { const char *pszName = ( m_pStudioHdr ) ? m_pStudioHdr->pszName() : "<>"; - ExecuteNTimes( 5, Warning( "Invalid index passed to CStudioHdr(%s)::GroupStudioHdr(): %d, but max is %d [%d]\n", pszName, i, m_pStudioHdrCache.Count() ) ); + ExecuteNTimes( 5, Warning( "Invalid index passed to CStudioHdr(%s)::GroupStudioHdr(): %d [%d]\n", pszName, i, m_pStudioHdrCache.Count() ) ); DebuggerBreakIfDebugging(); return m_pStudioHdr; // return something known to probably exist, certainly things will be messed up, but hopefully not crash before the warning is noticed } @@ -849,9 +848,9 @@ const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) const if (pStudioHdr == NULL) { - #if defined(_WIN32) && !defined(THREAD_PROFILER) +#if !defined( POSIX ) Assert( !m_pVModel->m_Lock.GetOwnerId() ); - #endif +#endif virtualgroup_t *pGroup = &m_pVModel->m_group[ i ]; pStudioHdr = pGroup->GetStudioHdr(); m_pStudioHdrCache[ i ] = pStudioHdr; @@ -862,7 +861,7 @@ const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) const } -const studiohdr_t *CStudioHdr::pSeqStudioHdr( int sequence ) const +const studiohdr_t *CStudioHdr::pSeqStudioHdr( int sequence ) { if (m_pVModel == NULL) { @@ -875,7 +874,7 @@ const studiohdr_t *CStudioHdr::pSeqStudioHdr( int sequence ) const } -const studiohdr_t *CStudioHdr::pAnimStudioHdr( int animation ) const +const studiohdr_t *CStudioHdr::pAnimStudioHdr( int animation ) { if (m_pVModel == NULL) { @@ -889,7 +888,7 @@ const studiohdr_t *CStudioHdr::pAnimStudioHdr( int animation ) const -mstudioanimdesc_t &CStudioHdr::pAnimdesc( int i ) const +mstudioanimdesc_t &CStudioHdr::pAnimdesc( int i ) { if (m_pVModel == NULL) { @@ -919,7 +918,7 @@ int CStudioHdr::GetNumSeq( void ) const // Purpose: //----------------------------------------------------------------------------- -mstudioseqdesc_t &CStudioHdr::pSeqdesc( int i ) const +mstudioseqdesc_t &CStudioHdr::pSeqdesc( int i ) { Assert( i >= 0 && i < GetNumSeq() ); if ( i < 0 || i >= GetNumSeq() ) @@ -995,7 +994,7 @@ int CStudioHdr::GetNumPoseParameters( void ) const // Purpose: //----------------------------------------------------------------------------- -const mstudioposeparamdesc_t &CStudioHdr::pPoseParameter( int i ) const +const mstudioposeparamdesc_t &CStudioHdr::pPoseParameter( int i ) { if (m_pVModel == NULL) { @@ -1037,7 +1036,7 @@ int CStudioHdr::GetSharedPoseParameter( int iSequence, int iLocalPose ) const // Purpose: //----------------------------------------------------------------------------- -int CStudioHdr::EntryNode( int iSequence ) const +int CStudioHdr::EntryNode( int iSequence ) { mstudioseqdesc_t &seqdesc = pSeqdesc( iSequence ); @@ -1059,7 +1058,7 @@ int CStudioHdr::EntryNode( int iSequence ) const //----------------------------------------------------------------------------- -int CStudioHdr::ExitNode( int iSequence ) const +int CStudioHdr::ExitNode( int iSequence ) { mstudioseqdesc_t &seqdesc = pSeqdesc( iSequence ); @@ -1098,7 +1097,7 @@ int CStudioHdr::GetNumAttachments( void ) const // Purpose: //----------------------------------------------------------------------------- -const mstudioattachment_t &CStudioHdr::pAttachment( int i ) const +const mstudioattachment_t &CStudioHdr::pAttachment( int i ) { if (m_pVModel == NULL) { @@ -1116,7 +1115,7 @@ const mstudioattachment_t &CStudioHdr::pAttachment( int i ) const // Purpose: //----------------------------------------------------------------------------- -int CStudioHdr::GetAttachmentBone( int i ) const +int CStudioHdr::GetAttachmentBone( int i ) { if (m_pVModel == 0) { @@ -1153,7 +1152,7 @@ void CStudioHdr::SetAttachmentBone( int iAttachment, int iBone ) // Purpose: //----------------------------------------------------------------------------- -const char *CStudioHdr::pszNodeName( int iNode ) const +char *CStudioHdr::pszNodeName( int iNode ) { if (m_pVModel == NULL) { @@ -1194,7 +1193,7 @@ int CStudioHdr::GetTransition( int iFrom, int iTo ) const // Purpose: //----------------------------------------------------------------------------- -int CStudioHdr::GetActivityListVersion( void ) const +int CStudioHdr::GetActivityListVersion( void ) { if (m_pVModel == NULL) { @@ -1237,7 +1236,7 @@ void CStudioHdr::SetActivityListVersion( int version ) // Purpose: //----------------------------------------------------------------------------- -int CStudioHdr::GetEventListVersion( void ) const +int CStudioHdr::GetEventListVersion( void ) { if (m_pVModel == NULL) { @@ -1290,7 +1289,7 @@ int CStudioHdr::GetNumIKAutoplayLocks( void ) const return m_pVModel->m_iklock.Count(); } -const mstudioiklock_t &CStudioHdr::pIKAutoplayLock( int i ) const +const mstudioiklock_t &CStudioHdr::pIKAutoplayLock( int i ) { if (m_pVModel == NULL) { @@ -1360,15 +1359,11 @@ int CStudioHdr::RemapAnimBone( int iAnim, int iLocalBone ) const return iLocalBone; } -// JasonM hack -//ConVar flex_maxrule( "flex_maxrule", "0" ); - - //----------------------------------------------------------------------------- // Purpose: run the interpreted FAC's expressions, converting flex_controller // values into FAC weights //----------------------------------------------------------------------------- -void CStudioHdr::RunFlexRules( const float *src, float *dest ) +void CStudioHdr::RunFlexRulesOld( const float *src, float *dest ) { int i, j; @@ -1385,16 +1380,7 @@ void CStudioHdr::RunFlexRules( const float *src, float *dest ) mstudioflexrule_t *prule = pFlexRule( i ); mstudioflexop_t *pops = prule->iFlexOp( 0 ); -/* - // JasonM hack for flex perf testing... - int nFlexRulesToRun = 0; // 0 means run them all - const char *pszExpression = flex_maxrule.GetString(); - if ( pszExpression ) - { - nFlexRulesToRun = atoi(pszExpression); // 0 will be returned if not a numeric string - } - // end JasonM hack -//*/ + // debugoverlay->AddTextOverlay( GetAbsOrigin() + Vector( 0, 0, 64 ), i + 1, 0, "%2d:%d\n", i, prule->flex ); for (j = 0; j < prule->numops; j++) @@ -1576,27 +1562,271 @@ void CStudioHdr::RunFlexRules( const float *src, float *dest ) } dest[prule->flex] = stack[0]; -/* - // JasonM hack - if ( nFlexRulesToRun == 0) // 0 means run all rules correctly - { - dest[prule->flex] = stack[0]; - } - else // run only up to nFlexRulesToRun correctly...zero out the rest - { - if ( j < nFlexRulesToRun ) - dest[prule->flex] = stack[0]; - else - dest[prule->flex] = 0.0f; - } + } +} - dest[prule->flex] = 1.0f; -//*/ - // end JasonM hack +void CStudioHdr::RunFlexRulesNew( const float *src, float *dest ) +{ + // FIXME: this shouldn't be needed, flex without rules should be stripped in studiomdl + memset( dest, 0, sizeof( dest[0] ) * numflexdesc() ); + + for (int i = 0; i < numflexrules(); i++) + { + float stack[32]; + float *pSP = stack + ARRAYSIZE( stack ); + mstudioflexrule_t *prule = pFlexRule( i ); + + mstudioflexop_t *pops = prule->iFlexOp( 0 ); + + int nOps = prule->numops; + float flTOS = 0.; + if ( nOps ) + do + { + switch (pops->op) + { + case STUDIO_ADD: + flTOS += *(pSP++); + break; + + case STUDIO_SUB: + flTOS = *(pSP++) - flTOS; + break; + + case STUDIO_MUL: + flTOS *= *(pSP++); + break; + case STUDIO_DIV: + if (flTOS > 0.0001) + { + flTOS = *(pSP) / flTOS; + } + else + { + flTOS = 0.; + } + pSP++; + break; + + case STUDIO_NEG: + flTOS = -flTOS; + break; + + case STUDIO_MAX: + { + float flNos = *(pSP++); + flTOS = MAX( flTOS, flNos ); + break; + } + + case STUDIO_MIN: + { + float flNos = *(pSP++); + flTOS = MIN( flTOS, flNos); + break; + } + case STUDIO_CONST: + *(--pSP) = flTOS; + flTOS = pops->d.value; + break; + + case STUDIO_FETCH1: + { + *(--pSP ) = flTOS; + int m = pFlexcontroller( (LocalFlexController_t)pops->d.index)->localToGlobal; + flTOS = src[m]; + break; + } + case STUDIO_FETCH2: + { + *(--pSP) = flTOS; + flTOS = dest[pops->d.index]; + break; + } + case STUDIO_COMBO: + { + // tos = prod( top m elements on stack) + int m = pops->d.index; + while( --m ) + { + flTOS *= *(pSP++); + } + break; + } + break; + + case STUDIO_DOMINATE: + { + // tos *= 1-prod( next top m elements on stack) + int m = pops->d.index; + float dv = *(pSP++); + while( --m ) + { + dv *= *(pSP++); + } + flTOS *= 1.0 - dv; + break; + } + break; + case STUDIO_2WAY_0: + { + int m = pFlexcontroller( (LocalFlexController_t)pops->d.index )->localToGlobal; + *(--pSP) = flTOS; + flTOS = RemapValClamped( src[m], -1.0f, 0.0f, 1.0f, 0.0f ); + } + break; + + case STUDIO_2WAY_1: + { + int m = pFlexcontroller( (LocalFlexController_t)pops->d.index )->localToGlobal; + *(--pSP) = flTOS; + flTOS = RemapValClamped( src[m], 0.0f, 1.0f, 0.0f, 1.0f ); + } + break; + + case STUDIO_NWAY: + { + LocalFlexController_t valueControllerIndex = static_cast< LocalFlexController_t >( (int) flTOS ); + int m = pFlexcontroller( valueControllerIndex )->localToGlobal; + float flValue = src[ m ]; + int v = pFlexcontroller( (LocalFlexController_t)pops->d.index )->localToGlobal; + + const Vector4D filterRamp( pSP[3], pSP[2], pSP[1], pSP[0] ); + + // Apply multicontrol remapping + if ( flValue <= filterRamp.x || flValue >= filterRamp.w ) + { + flValue = 0.0f; + } + else if ( flValue < filterRamp.y ) + { + flValue = RemapValClamped( flValue, filterRamp.x, filterRamp.y, 0.0f, 1.0f ); + } + else if ( flValue > filterRamp.z ) + { + flValue = RemapValClamped( flValue, filterRamp.z, filterRamp.w, 1.0f, 0.0f ); + } + else + { + flValue = 1.0f; + } + + pSP+= 4; + flTOS = flValue * src[ v ]; + } + break; + + case STUDIO_DME_LOWER_EYELID: + { + const mstudioflexcontroller_t *const pCloseLidV = + pFlexcontroller( (LocalFlexController_t)pops->d.index ); + const float flCloseLidV = + RemapValClamped( src[ pCloseLidV->localToGlobal ], pCloseLidV->min, pCloseLidV->max, 0.0f, 1.0f ); + + const mstudioflexcontroller_t *const pCloseLid = + pFlexcontroller( static_cast< LocalFlexController_t >( (int)flTOS ) ); + const float flCloseLid = + RemapValClamped( src[ pCloseLid->localToGlobal ], pCloseLid->min, pCloseLid->max, 0.0f, 1.0f ); + + int nBlinkIndex = static_cast< int >( pSP[0] ); + float flBlink = 0.0f; + if ( nBlinkIndex >= 0 ) + { + const mstudioflexcontroller_t *const pBlink = + pFlexcontroller( static_cast< LocalFlexController_t >( nBlinkIndex ) ); + flBlink = RemapValClamped( src[ pBlink->localToGlobal ], pBlink->min, pBlink->max, 0.0f, 1.0f ); + } + + int nEyeUpDownIndex = static_cast< int >( pSP[1] ); + float flEyeUpDown = 0.0f; + if ( nEyeUpDownIndex >= 0 ) + { + const mstudioflexcontroller_t *const pEyeUpDown = + pFlexcontroller( static_cast< LocalFlexController_t >( nEyeUpDownIndex ) ); + flEyeUpDown = RemapValClamped( src[ pEyeUpDown->localToGlobal ], pEyeUpDown->min, pEyeUpDown->max, -1.0f, 1.0f ); + } + + if ( flEyeUpDown > 0.0 ) + { + flTOS = ( 1.0f - flEyeUpDown ) * ( 1.0f - flCloseLidV ) * flCloseLid; + } + else + { + flTOS = ( 1.0f - flCloseLidV ) * flCloseLid; + } + pSP += 2; + } + break; + + case STUDIO_DME_UPPER_EYELID: + { + const mstudioflexcontroller_t *const pCloseLidV = pFlexcontroller( (LocalFlexController_t)pops->d.index ); + const float flCloseLidV = RemapValClamped( src[ pCloseLidV->localToGlobal ], pCloseLidV->min, pCloseLidV->max, 0.0f, 1.0f ); + + const mstudioflexcontroller_t *const pCloseLid = pFlexcontroller( static_cast< LocalFlexController_t >( (int)flTOS ) ); + const float flCloseLid = RemapValClamped( src[ pCloseLid->localToGlobal ], pCloseLid->min, pCloseLid->max, 0.0f, 1.0f ); + + int nBlinkIndex = static_cast< int >( pSP[0] ); + float flBlink = 0.0f; + if ( nBlinkIndex >= 0 ) + { + const mstudioflexcontroller_t *const pBlink = pFlexcontroller( static_cast< LocalFlexController_t >( nBlinkIndex ) ); + flBlink = RemapValClamped( src[ pBlink->localToGlobal ], pBlink->min, pBlink->max, 0.0f, 1.0f ); + } + + int nEyeUpDownIndex = static_cast< int >( pSP[1] ); + float flEyeUpDown = 0.0f; + if ( nEyeUpDownIndex >= 0 ) + { + const mstudioflexcontroller_t *const pEyeUpDown = pFlexcontroller( static_cast< LocalFlexController_t >( nEyeUpDownIndex ) ); + flEyeUpDown = RemapValClamped( src[ pEyeUpDown->localToGlobal ], pEyeUpDown->min, pEyeUpDown->max, -1.0f, 1.0f ); + } + + if ( flEyeUpDown < 0.0f ) + { + flTOS = ( 1.0f + flEyeUpDown ) * flCloseLidV * flCloseLid; + } + else + { + flTOS = flCloseLidV * flCloseLid; + } + pSP += 2; + } + break; + } + + pops++; + } while( --nOps ); + dest[prule->flex] = flTOS; } } +#define USE_OLD_FLEX_RULES_INTERPRETER + +void CStudioHdr::RunFlexRules( const float *src, float *dest ) +{ +#ifndef USE_OLD_FLEX_RULES_INTERPRETER + RunFlexRulesNew( src, dest ); +#else + RunFlexRulesOld( src, dest ); +#endif + +#if defined(_DEBUG) && !defined(USE_OLD_FLEX_RULES_INTERPRETER) + float d1[ MAXSTUDIOFLEXDESC ]; + RunFlexRulesOld( src, d1 ); + + for ( int i =0; i < numflexdesc(); i++) + { + if ( fabs( d1[i] - dest[i] ) > 0.001 ) + { + Warning("bad %d old =%f new=%f\n", i, dest[i], d1[i] ); + } + } +#endif // _DEBUG +} + + //----------------------------------------------------------------------------- @@ -1604,43 +1834,43 @@ void CStudioHdr::RunFlexRules( const float *src, float *dest ) //----------------------------------------------------------------------------- #define iabs(i) (( (i) >= 0 ) ? (i) : -(i) ) +CUtlSymbolTable g_ActivityModifiersTable; extern void SetActivityForSequence( CStudioHdr *pstudiohdr, int i ); -void CStudioHdr::CActivityToSequenceMapping::Initialize( CStudioHdr * __restrict pstudiohdr ) +void CStudioHdr::CActivityToSequenceMapping::Initialize( const CStudioHdr * __restrict pstudiohdr ) { + VPROF( "CStudioHdr::CActivityToSequenceMapping::Initialize" ); // Algorithm: walk through every sequence in the model, determine to which activity // it corresponds, and keep a count of sequences per activity. Once the total count // is available, allocate an array large enough to contain them all, update the // starting indices for every activity's section in the array, and go back through, // populating the array with its data. + m_pStudioHdr = pstudiohdr->m_pStudioHdr; + AssertMsg1( m_pSequenceTuples == NULL, "Tried to double-initialize sequence mapping for %s", pstudiohdr->pszName() ); if ( m_pSequenceTuples != NULL ) return; // don't double initialize. - SetValidationPair(pstudiohdr); + SetValidation(pstudiohdr); if ( ! pstudiohdr->SequencesAvailable() ) return; // nothing to do. -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE - m_bIsInitialized = true; -#endif - // Some studio headers have no activities at all. In those // cases we can avoid a lot of this effort. - bool bFoundOne = false; + bool bFoundOne = false; // for each sequence in the header... const int NumSeq = pstudiohdr->GetNumSeq(); for ( int i = 0 ; i < NumSeq ; ++i ) { - const mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( i ); + const mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pstudiohdr)->pSeqdesc( i ); #if defined(SERVER_DLL) || defined(CLIENT_DLL) || defined(GAME_DLL) if (!(seqdesc.flags & STUDIO_ACTIVITY)) { // AssertMsg2( false, "Sequence %d on studiohdr %s didn't have its activity initialized!", i, pstudiohdr->pszName() ); - SetActivityForSequence( pstudiohdr, i ); + SetActivityForSequence( (CStudioHdr *)pstudiohdr, i ); } #endif @@ -1710,7 +1940,7 @@ void CStudioHdr::CActivityToSequenceMapping::Initialize( CStudioHdr * __restrict // our little table. for ( int i = 0 ; i < NumSeq ; ++i ) { - const mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( i ); + const mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pstudiohdr)->pSeqdesc( i ); if (seqdesc.activity >= 0) { const HashValueType &element = m_ActToSeqHash[m_ActToSeqHash.Find(HashValueType(seqdesc.activity, 0, 0, 0))]; @@ -1720,6 +1950,23 @@ void CStudioHdr::CActivityToSequenceMapping::Initialize( CStudioHdr * __restrict int tupleOffset = seqsPerAct[seqdesc.activity]; Assert( tupleOffset < element.count ); + if ( seqdesc.numactivitymodifiers > 0 ) + { + // add entries for this model's activity modifiers + (tupleList + element.startingIdx + tupleOffset)->pActivityModifiers = new CUtlSymbol[ seqdesc.numactivitymodifiers ]; + (tupleList + element.startingIdx + tupleOffset)->iNumActivityModifiers = seqdesc.numactivitymodifiers; + + for ( int k = 0; k < seqdesc.numactivitymodifiers; k++ ) + { + (tupleList + element.startingIdx + tupleOffset)->pActivityModifiers[ k ] = g_ActivityModifiersTable.AddString( seqdesc.pActivityModifier( k )->pszName() ); + } + } + else + { + (tupleList + element.startingIdx + tupleOffset)->pActivityModifiers = NULL; + (tupleList + element.startingIdx + tupleOffset)->iNumActivityModifiers = 0; + } + // You might be tempted to collapse this pointer math into a single pointer -- // don't! the tuple list is marked __restrict above. (tupleList + element.startingIdx + tupleOffset)->seqnum = i; // store sequence number @@ -1744,7 +1991,6 @@ void CStudioHdr::CActivityToSequenceMapping::Initialize( CStudioHdr * __restrict /// Force Initialize() to occur again, even if it has already occured. void CStudioHdr::CActivityToSequenceMapping::Reinitialize( CStudioHdr *pstudiohdr ) { - m_bIsInitialized = false; if (m_pSequenceTuples) { delete m_pSequenceTuples; @@ -1802,22 +2048,113 @@ int CStudioHdr::CActivityToSequenceMapping::NumSequencesForActivity( int forActi } } +static CStudioHdr::CActivityToSequenceMapping emptyMapping; + // double-check that the data I point to hasn't changed bool CStudioHdr::CActivityToSequenceMapping::ValidateAgainst( const CStudioHdr * RESTRICT pstudiohdr ) RESTRICT { - if (m_bIsInitialized) + return ( this == &emptyMapping || + ( m_pStudioHdr == pstudiohdr->m_pStudioHdr && m_expectedVModel == pstudiohdr->GetVirtualModel() ) ); +} + +void CStudioHdr::CActivityToSequenceMapping::SetValidation( const CStudioHdr *RESTRICT pstudiohdr ) RESTRICT +{ + m_expectedVModel = pstudiohdr->GetVirtualModel(); +} + +struct StudioHdrToActivityMapEntry_t +{ + long checksum; + char name[64]; + int nRefs; + CStudioHdr::CActivityToSequenceMapping *pMap; +}; + +CUtlMap g_StudioHdrToActivityMaps( DefLessFunc( const studiohdr_t * ) ); +CThreadFastMutex g_StudioHdrToActivityMapsLock; + +CStudioHdr::CActivityToSequenceMapping *CStudioHdr::CActivityToSequenceMapping::FindMapping( const CStudioHdr *pHdr ) +{ + VPROF( "CStudioHdr::CActivityToSequenceMapping::FindMapping" ); + + if ( !pHdr->SequencesAvailable() || pHdr->GetNumSeq() <= 1 ) { - return m_expectedPStudioHdr == pstudiohdr->GetRenderHdr() && - m_expectedVModel == pstudiohdr->GetVirtualModel(); + return &emptyMapping; } - else + + Assert( !pHdr->m_pActivityToSequence ); + + AUTO_LOCK( g_StudioHdrToActivityMapsLock ); + const studiohdr_t *pRealHdr = pHdr->m_pStudioHdr; + int i = g_StudioHdrToActivityMaps.Find( pRealHdr ); + if ( i != g_StudioHdrToActivityMaps.InvalidIndex() ) { - return true; // Allow an ordinary initialization to take place without printing a panicky assert. + if ( !IsX360() && ( g_StudioHdrToActivityMaps[i].checksum != pRealHdr->checksum || Q_strcmp( g_StudioHdrToActivityMaps[i].name, pRealHdr->name ) != 0 ) ) + { + AssertFatal( g_StudioHdrToActivityMaps[i].nRefs == 0 ); + delete g_StudioHdrToActivityMaps[i].pMap; + g_StudioHdrToActivityMaps.RemoveAt( i ); + } + else + { + Assert( g_StudioHdrToActivityMaps[i].checksum == pRealHdr->checksum && Q_strcmp( g_StudioHdrToActivityMaps[i].name, pRealHdr->name ) == 0 ); + g_StudioHdrToActivityMaps[i].nRefs++; + return g_StudioHdrToActivityMaps[i].pMap; + } } + + i = g_StudioHdrToActivityMaps.Insert( pRealHdr ); + + g_StudioHdrToActivityMaps[i].checksum = pRealHdr->checksum; + Q_strncpy( g_StudioHdrToActivityMaps[i].name, pRealHdr->name, 64 ); + g_StudioHdrToActivityMaps[i].nRefs = 1; + g_StudioHdrToActivityMaps[i].pMap = new CStudioHdr::CActivityToSequenceMapping; + g_StudioHdrToActivityMaps[i].pMap->Initialize( pHdr ); + + return g_StudioHdrToActivityMaps[i].pMap; } -void CStudioHdr::CActivityToSequenceMapping::SetValidationPair( const CStudioHdr *RESTRICT pstudiohdr ) RESTRICT +void CStudioHdr::CActivityToSequenceMapping::ReleaseMapping( CActivityToSequenceMapping *pMap ) { - m_expectedPStudioHdr = pstudiohdr->GetRenderHdr(); - m_expectedVModel = pstudiohdr->GetVirtualModel(); + if ( pMap && pMap != &emptyMapping) + { + VPROF( "CStudioHdr::CActivityToSequenceMapping::ReleaseMapping" ); + AUTO_LOCK( g_StudioHdrToActivityMapsLock ); + int i = g_StudioHdrToActivityMaps.Find( pMap->m_pStudioHdr ); + if ( i != g_StudioHdrToActivityMaps.InvalidIndex() ) + { + Assert( g_StudioHdrToActivityMaps[i].nRefs > 0 ); + g_StudioHdrToActivityMaps[i].nRefs--; + } + else + { + Assert( 0 ); + } + } } + +void CStudioHdr::CActivityToSequenceMapping::ResetMappings() +{ + for ( int i = g_StudioHdrToActivityMaps.FirstInorder(); i != g_StudioHdrToActivityMaps.InvalidIndex(); i = g_StudioHdrToActivityMaps.NextInorder( i ) ) + { + if ( g_StudioHdrToActivityMaps[i].nRefs == 0 ) + { + delete g_StudioHdrToActivityMaps[i].pMap; + } + else + { + Msg( "****************************************************************\n" ); + Msg( "****************************************************************\n" ); + Msg( "************* DO NOT IGNORE ME *******************************\n" ); + Msg( "****************************************************************\n" ); + Msg( "****************************************************************\n" ); + Warning( "Studio activity sequence mapping leak! (%s, %d)\n", g_StudioHdrToActivityMaps[i].name, g_StudioHdrToActivityMaps[i].nRefs ); + Msg( "****************************************************************\n" ); + Msg( "****************************************************************\n" ); + Msg( "****************************************************************\n" ); + Msg( "****************************************************************\n" ); + Msg( "****************************************************************\n" ); + } + } + g_StudioHdrToActivityMaps.RemoveAll(); +} \ No newline at end of file diff --git a/public/studio.h b/public/studio.h index fd127aa0b..b318f40b4 100644 --- a/public/studio.h +++ b/public/studio.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======// // // Purpose: // @@ -26,22 +26,12 @@ #include "datamap.h" #include "generichash.h" #include "localflexcontroller.h" - +#include "utlsymbol.h" #define STUDIO_ENABLE_PERF_COUNTERS #define STUDIO_SEQUENCE_ACTIVITY_LOOKUPS_ARE_SLOW 0 -// If this is set to 1, then the activity->sequence mapping inside -// the CStudioHdr will not be initialized until the first call to -// SelectWeightedSequence() or HaveSequenceForActivity(). If set -// to zero, the mapping will be initialized from CStudioHdr::Init() -// (itself called from the constructor). -// As of June 4 2007, this was set to 1 because physics, among other -// systems, extemporaneously declares CStudioHdrs inside local function -// scopes without querying their activity/sequence mapping at all. -#define STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE 1 - //----------------------------------------------------------------------------- // forward declarations //----------------------------------------------------------------------------- @@ -68,16 +58,18 @@ Studio models are position independent, so the cache manager can move them. ============================================================================== */ -#define STUDIO_VERSION 48 +#define STUDIO_VERSION 49 + +struct studiohdr_t; -#ifndef _XBOX +#ifdef _X360 +#define MAXSTUDIOTRIANGLES 65536 // +#define MAXSTUDIOVERTS 32768 // These numbers save memory in CCachedRenderData, but restrict usable model sizes on 360 +#define MAXSTUDIOFLEXVERTS 4096 // +#else #define MAXSTUDIOTRIANGLES 65536 // TODO: tune this #define MAXSTUDIOVERTS 65536 // TODO: tune this #define MAXSTUDIOFLEXVERTS 10000 // max number of verts that can be flexed per mesh. TODO: tune this -#else -#define MAXSTUDIOTRIANGLES 25000 -#define MAXSTUDIOVERTS 10000 -#define MAXSTUDIOFLEXVERTS 1000 #endif #define MAXSTUDIOSKINS 32 // total textures #define MAXSTUDIOBONES 128 // total bones actually used @@ -105,7 +97,9 @@ struct mstudiodata_t #define STUDIO_PROC_QUATINTERP 2 #define STUDIO_PROC_AIMATBONE 3 #define STUDIO_PROC_AIMATATTACH 4 -#define STUDIO_PROC_JIGGLE 5 +#define STUDIO_PROC_JIGGLE 5 +#define STUDIO_PROC_TWIST_MASTER 6 +#define STUDIO_PROC_TWIST_SLAVE 7 // Multiple twist bones are computed at once for the same parent/child combo so TWIST_NULL do nothing struct mstudioaxisinterpbone_t { @@ -227,6 +221,50 @@ struct mstudioaimatbone_t mstudioaimatbone_t(const mstudioaimatbone_t& vOther); }; + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +struct mstudiotwistbonetarget_t +{ + DECLARE_BYTESWAP_DATADESC(); + + int m_nBone; + float m_flWeight; + Vector m_vBaseTranslate; + Quaternion m_qBaseRotation; + + mstudiotwistbonetarget_t() {} +private: + // No copy constructors allowed + mstudiotwistbonetarget_t( const mstudiotwistbonetarget_t &vOther ); +}; + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +struct mstudiotwistbone_t +{ + DECLARE_BYTESWAP_DATADESC(); + + bool m_bInverse; // False: Apply child rotation to twist targets True: Apply parent rotation to twist targets + Vector m_vUpVector; // In parent space, projected into plane defined by vector between parent & child + int m_nParentBone; + Quaternion m_qBaseInv; // The base rotation of the parent, used if m_bInverse is true + int m_nChildBone; + + int m_nTargetCount; + int m_nTargetIndex; + inline mstudiotwistbonetarget_t *pTarget( int i ) const { return ( mstudiotwistbonetarget_t * )( ( ( byte * )this) + m_nTargetIndex ) + i; } + + mstudiotwistbone_t() {} +private: + // No copy constructors allowed + mstudiotwistbone_t( const mstudiotwistbone_t &vOther ); +}; + + // bones struct mstudiobone_t { @@ -253,9 +291,11 @@ struct mstudiobone_t inline void *pProcedure( ) const { if (procindex == 0) return NULL; else return (void *)(((byte *)this) + procindex); }; int surfacepropidx; // index into string tablefor property name inline char * const pszSurfaceProp( void ) const { return ((char *)this) + surfacepropidx; } - int contents; // See BSPFlags.h for the contents flags + inline int GetSurfaceProp( void ) const { return surfacepropLookup; } - int unused[8]; // remove as appropriate + int contents; // See BSPFlags.h for the contents flags + int surfacepropLookup; // this index must be cached by the loader, not saved in the file + int unused[7]; // remove as appropriate mstudiobone_t(){} private: @@ -277,25 +317,25 @@ struct mstudiolinearbone_t inline int parent( int i ) const { Assert( i >= 0 && i < numbones); return *((int *)(((byte *)this) + parentindex) + i); }; int posindex; - inline Vector pos( int i ) const { Assert( i >= 0 && i < numbones); return *((Vector *)(((byte *)this) + posindex) + i); }; + inline const Vector &pos( int i ) const { Assert( i >= 0 && i < numbones); return *((Vector *)(((byte *)this) + posindex) + i); }; int quatindex; - inline Quaternion quat( int i ) const { Assert( i >= 0 && i < numbones); return *((Quaternion *)(((byte *)this) + quatindex) + i); }; + inline const Quaternion &quat( int i ) const { Assert( i >= 0 && i < numbones); return *((Quaternion *)(((byte *)this) + quatindex) + i); }; int rotindex; - inline RadianEuler rot( int i ) const { Assert( i >= 0 && i < numbones); return *((RadianEuler *)(((byte *)this) + rotindex) + i); }; + inline const RadianEuler &rot( int i ) const { Assert( i >= 0 && i < numbones); return *((RadianEuler *)(((byte *)this) + rotindex) + i); }; int posetoboneindex; - inline matrix3x4_t poseToBone( int i ) const { Assert( i >= 0 && i < numbones); return *((matrix3x4_t *)(((byte *)this) + posetoboneindex) + i); }; + inline const matrix3x4_t &poseToBone( int i ) const { Assert( i >= 0 && i < numbones); return *((matrix3x4_t *)(((byte *)this) + posetoboneindex) + i); }; int posscaleindex; - inline Vector posscale( int i ) const { Assert( i >= 0 && i < numbones); return *((Vector *)(((byte *)this) + posscaleindex) + i); }; + inline const Vector &posscale( int i ) const { Assert( i >= 0 && i < numbones); return *((Vector *)(((byte *)this) + posscaleindex) + i); }; int rotscaleindex; - inline Vector rotscale( int i ) const { Assert( i >= 0 && i < numbones); return *((Vector *)(((byte *)this) + rotscaleindex) + i); }; + inline const Vector &rotscale( int i ) const { Assert( i >= 0 && i < numbones); return *((Vector *)(((byte *)this) + rotscaleindex) + i); }; int qalignmentindex; - inline Quaternion qalignment( int i ) const { Assert( i >= 0 && i < numbones); return *((Quaternion *)(((byte *)this) + qalignmentindex) + i); }; + inline const Quaternion &qalignment( int i ) const { Assert( i >= 0 && i < numbones); return *((Quaternion *)(((byte *)this) + qalignmentindex) + i); }; int unused[6]; @@ -306,6 +346,63 @@ struct mstudiolinearbone_t }; +//----------------------------------------------------------------------------- +// The component of the bone used by mstudioboneflexdriver_t +//----------------------------------------------------------------------------- +enum StudioBoneFlexComponent_t +{ + STUDIO_BONE_FLEX_INVALID = -1, // Invalid + STUDIO_BONE_FLEX_TX = 0, // Translate X + STUDIO_BONE_FLEX_TY = 1, // Translate Y + STUDIO_BONE_FLEX_TZ = 2 // Translate Z +}; + + +//----------------------------------------------------------------------------- +// Component is one of Translate X, Y or Z [0,2] (StudioBoneFlexComponent_t) +//----------------------------------------------------------------------------- +struct mstudioboneflexdrivercontrol_t +{ + DECLARE_BYTESWAP_DATADESC(); + + int m_nBoneComponent; // Bone component that drives flex, StudioBoneFlexComponent_t + int m_nFlexControllerIndex; // Flex controller to drive + float m_flMin; // Min value of bone component mapped to 0 on flex controller + float m_flMax; // Max value of bone component mapped to 1 on flex controller + + mstudioboneflexdrivercontrol_t(){} +private: + // No copy constructors allowed + mstudioboneflexdrivercontrol_t( const mstudioboneflexdrivercontrol_t &vOther ); +}; + + +//----------------------------------------------------------------------------- +// Drive flex controllers from bone components +//----------------------------------------------------------------------------- +struct mstudioboneflexdriver_t +{ + DECLARE_BYTESWAP_DATADESC(); + + int m_nBoneIndex; // Bone to drive flex controller + int m_nControlCount; // Number of flex controllers being driven + int m_nControlIndex; // Index into data where controllers are (relative to this) + + inline mstudioboneflexdrivercontrol_t *pBoneFlexDriverControl( int i ) const + { + Assert( i >= 0 && i < m_nControlCount ); + return (mstudioboneflexdrivercontrol_t *)(((byte *)this) + m_nControlIndex) + i; + } + + int unused[3]; + + mstudioboneflexdriver_t(){} +private: + // No copy constructors allowed + mstudioboneflexdriver_t( const mstudioboneflexdriver_t &vOther ); +}; + + #define BONE_CALCULATE_MASK 0x1F #define BONE_PHYSICALLY_SIMULATED 0x01 // bone is physically simulated when physics are active #define BONE_PHYSICS_PROCEDURAL 0x02 // procedural when physics is active @@ -337,7 +434,8 @@ struct mstudiolinearbone_t #define BONE_FIXED_ALIGNMENT 0x00100000 // bone can't spin 360 degrees, all interpolation is normalized around a fixed orientation #define BONE_HAS_SAVEFRAME_POS 0x00200000 // Vector48 -#define BONE_HAS_SAVEFRAME_ROT 0x00400000 // Quaternion64 +#define BONE_HAS_SAVEFRAME_ROT64 0x00400000 // Quaternion64 +#define BONE_HAS_SAVEFRAME_ROT32 0x00800000 // Quaternion32 // bone controllers struct mstudiobonecontroller_t @@ -363,12 +461,12 @@ struct mstudiobbox_t int szhitboxnameindex; // offset to the name of the hitbox. int unused[8]; - const char* pszHitboxName() + const char* pszHitboxName() const { if( szhitboxnameindex == 0 ) return ""; - return ((char*)this) + szhitboxnameindex; + return ((const char*)this) + szhitboxnameindex; } mstudiobbox_t() {} @@ -395,6 +493,7 @@ struct mstudiomodelgrouplookup_t }; // events +// NOTE: If you modify this struct you MUST also modify mstudioevent_for_client_server_t in npcevent.h!!! struct mstudioevent_t { DECLARE_BYTESWAP_DATADESC(); @@ -509,6 +608,17 @@ struct mstudioikrule_t }; +struct mstudioikrulezeroframe_t +{ + short chain; + short slot; + float16 start; // beginning of influence + float16 peak; // start of full influence + float16 tail; // end of full influence + float16 end; // end of all influence +}; + + struct mstudioiklock_t { DECLARE_BYTESWAP_DATADESC(); @@ -567,16 +677,15 @@ struct mstudioanim_valueptr_t #define STUDIO_ANIM_DELTA 0x10 #define STUDIO_ANIM_RAWROT2 0x20 // Quaternion64 - -// per bone per animation DOF and weight pointers -struct mstudioanim_t +// per bone per animation DOF and weight pointers, RLE encoded +struct mstudio_rle_anim_t { DECLARE_BYTESWAP_DATADESC(); byte bone; byte flags; // weighing options // valid for animating data only - inline byte *pData( void ) const { return (((byte *)this) + sizeof( struct mstudioanim_t )); }; + inline byte *pData( void ) const { return (((byte *)this) + sizeof( struct mstudio_rle_anim_t )); }; inline mstudioanim_valueptr_t *pRotV( void ) const { return (mstudioanim_valueptr_t *)(pData()); }; inline mstudioanim_valueptr_t *pPosV( void ) const { return (mstudioanim_valueptr_t *)(pData()) + ((flags & STUDIO_ANIM_ANIMROT) != 0); }; @@ -585,10 +694,37 @@ struct mstudioanim_t inline Quaternion64 *pQuat64( void ) const { return (Quaternion64 *)(pData()); }; inline Vector48 *pPos( void ) const { return (Vector48 *)(pData() + ((flags & STUDIO_ANIM_RAWROT) != 0) * sizeof( *pQuat48() ) + ((flags & STUDIO_ANIM_RAWROT2) != 0) * sizeof( *pQuat64() ) ); }; + // points to next bone in the list short nextoffset; - inline mstudioanim_t *pNext( void ) const { if (nextoffset != 0) return (mstudioanim_t *)(((byte *)this) + nextoffset); else return NULL; }; + inline mstudio_rle_anim_t *pNext( void ) const { if (nextoffset != 0) return (mstudio_rle_anim_t *)(((byte *)this) + nextoffset); else return NULL; }; }; + +#define STUDIO_FRAME_RAWPOS 0x01 // Vector48 in constants +#define STUDIO_FRAME_RAWROT 0x02 // Quaternion48 in constants +#define STUDIO_FRAME_ANIMPOS 0x04 // Vector48 in framedata +#define STUDIO_FRAME_ANIMROT 0x08 // Quaternion48 in framedata +#define STUDIO_FRAME_FULLANIMPOS 0x10 // Vector in framedata + + +struct mstudio_frame_anim_t +{ + DECLARE_BYTESWAP_DATADESC(); + + inline byte *pBoneFlags( void ) const { return (((byte *)this) + sizeof( struct mstudio_frame_anim_t )); }; + + int constantsoffset; + inline byte *pConstantData( void ) const { return (((byte *)this) + constantsoffset); }; + + int frameoffset; + int framelength; + inline byte *pFrameData( int iFrame ) const { return (((byte *)this) + frameoffset + iFrame * framelength); }; + + int unused[3]; +}; + + + struct mstudiomovement_t { DECLARE_BYTESWAP_DATADESC(); @@ -606,8 +742,6 @@ struct mstudiomovement_t mstudiomovement_t(const mstudiomovement_t& vOther); }; -struct studiohdr_t; - // used for piecewise loading of animation data struct mstudioanimblock_t { @@ -642,16 +776,19 @@ struct mstudioanimdesc_t int movementindex; inline mstudiomovement_t * const pMovement( int i ) const { return (mstudiomovement_t *)(((byte *)this) + movementindex) + i; }; - int unused1[6]; // remove as appropriate (and zero if loading older versions) + int ikrulezeroframeindex; + mstudioikrulezeroframe_t *pIKRuleZeroFrame( int i ) const { if (ikrulezeroframeindex) return (mstudioikrulezeroframe_t *)(((byte *)this) + ikrulezeroframeindex) + i; else return NULL; }; + + int unused1[5]; // remove as appropriate (and zero if loading older versions) int animblock; int animindex; // non-zero when anim data isn't in sections - mstudioanim_t *pAnimBlock( int block, int index ) const; // returns pointer to a specific anim block (local or external) - mstudioanim_t *pAnim( int *piFrame, float &flStall ) const; // returns pointer to data and new frame index - mstudioanim_t *pAnim( int *piFrame ) const; // returns pointer to data and new frame index + byte *pAnimBlock( int block, int index ) const; // returns pointer to a specific anim block (local or external) + byte *pAnim( int *piFrame, float &flStall ) const; // returns pointer to data and new frame index + byte *pAnim( int *piFrame ) const; // returns pointer to data and new frame index int numikrules; - int ikruleindex; // non-zero when IK data is stored in the mdl + int ikruleindex; // non-zero when IK rule is stored in the mdl int animblockikruleindex; // non-zero when IK data is stored in animblock file mstudioikrule_t *pIKRule( int i ) const; @@ -691,6 +828,14 @@ struct mstudioautolayer_t float end; // end of all influence }; +struct mstudioactivitymodifier_t +{ + DECLARE_BYTESWAP_DATADESC(); + + int sznameindex; + inline char *pszName() { return (sznameindex) ? (char *)(((byte *)this) + sznameindex ) : NULL; } +}; + // sequence descriptions struct mstudioseqdesc_t { @@ -787,7 +932,11 @@ struct mstudioseqdesc_t int cycleposeindex; // index of pose parameter to use as cycle index - int unused[7]; // remove/add as appropriate (grow back to 8 ints on version change!) + int activitymodifierindex; + int numactivitymodifiers; + inline mstudioactivitymodifier_t *pActivityModifier( int i ) const { Assert( i >= 0 && i < numactivitymodifiers); return activitymodifierindex != 0 ? (mstudioactivitymodifier_t *)(((byte *)this) + activitymodifierindex) + i : NULL; }; + + int unused[5]; // remove/add as appropriate (grow back to 8 ints on version change!) mstudioseqdesc_t(){} private: @@ -895,33 +1044,6 @@ struct mstudioflexcontrollerui_t }; -// these are the on-disk format vertex anims -struct dstudiovertanim_t -{ - unsigned short index; - byte speed; // 255/max_length_in_flex - byte side; // 255/left_right - Vector48 delta; - Vector48 ndelta; - -private: - // No copy constructors allowed - dstudiovertanim_t(const dstudiovertanim_t& vOther); -}; - - -struct dstudiovertanim_wrinkle_t : public dstudiovertanim_t -{ - short wrinkledelta; // Encodes a range from -1 to 1. NOTE: -32768 == -32767 == -1.0f, 32767 = 1.0f - -private: - // No copy constructors allowed - dstudiovertanim_wrinkle_t( const dstudiovertanim_t& vOther ); -}; - -const float g_VertAnimFixedPointScale = 1.0f / 4096.0f; -const float g_VertAnimFixedPointScaleInv = 1.0f / g_VertAnimFixedPointScale; - // this is the memory image of vertex anims (16-bit fixed point) struct mstudiovertanim_t { @@ -931,7 +1053,6 @@ struct mstudiovertanim_t byte side; // 255/left_right protected: - // JasonM changing this type a lot, to prefer fixed point 16 bit... union { short delta[3]; @@ -945,21 +1066,31 @@ struct mstudiovertanim_t }; public: - inline Vector GetDeltaFixed() + inline void ConvertToFixed( float flVertAnimFixedPointScale ) + { + delta[0] = flDelta[0].GetFloat() / flVertAnimFixedPointScale; + delta[1] = flDelta[1].GetFloat() / flVertAnimFixedPointScale; + delta[2] = flDelta[2].GetFloat() / flVertAnimFixedPointScale; + ndelta[0] = flNDelta[0].GetFloat() / flVertAnimFixedPointScale; + ndelta[1] = flNDelta[1].GetFloat() / flVertAnimFixedPointScale; + ndelta[2] = flNDelta[2].GetFloat() / flVertAnimFixedPointScale; + } + + inline Vector GetDeltaFixed( float flVertAnimFixedPointScale ) { - return Vector( delta[0]*g_VertAnimFixedPointScale, delta[1]*g_VertAnimFixedPointScale, delta[2]*g_VertAnimFixedPointScale ); + return Vector( delta[0] * flVertAnimFixedPointScale, delta[1] * flVertAnimFixedPointScale, delta[2] * flVertAnimFixedPointScale ); } - inline Vector GetNDeltaFixed() + inline Vector GetNDeltaFixed( float flVertAnimFixedPointScale ) { - return Vector( ndelta[0]*g_VertAnimFixedPointScale, ndelta[1]*g_VertAnimFixedPointScale, ndelta[2]*g_VertAnimFixedPointScale ); + return Vector( ndelta[0] * flVertAnimFixedPointScale, ndelta[1] * flVertAnimFixedPointScale, ndelta[2] * flVertAnimFixedPointScale ); } - inline void GetDeltaFixed4DAligned( Vector4DAligned *vFillIn ) + inline void GetDeltaFixed4DAligned( Vector4DAligned *vFillIn, float flVertAnimFixedPointScale ) { - vFillIn->Set( delta[0]*g_VertAnimFixedPointScale, delta[1]*g_VertAnimFixedPointScale, delta[2]*g_VertAnimFixedPointScale, 0.0f ); + vFillIn->Set( delta[0] * flVertAnimFixedPointScale, delta[1] * flVertAnimFixedPointScale, delta[2] * flVertAnimFixedPointScale, 0.0f ); } - inline void GetNDeltaFixed4DAligned( Vector4DAligned *vFillIn ) + inline void GetNDeltaFixed4DAligned( Vector4DAligned *vFillIn, float flVertAnimFixedPointScale ) { - vFillIn->Set( ndelta[0]*g_VertAnimFixedPointScale, ndelta[1]*g_VertAnimFixedPointScale, ndelta[2]*g_VertAnimFixedPointScale, 0.0f ); + vFillIn->Set( ndelta[0] * flVertAnimFixedPointScale, ndelta[1] * flVertAnimFixedPointScale, ndelta[2] * flVertAnimFixedPointScale, 0.0f ); } inline Vector GetDeltaFloat() { @@ -969,17 +1100,17 @@ struct mstudiovertanim_t { return Vector (flNDelta[0].GetFloat(), flNDelta[1].GetFloat(), flNDelta[2].GetFloat()); } - inline void SetDeltaFixed( const Vector& vInput ) + inline void SetDeltaFixed( const Vector& vInput, float flVertAnimFixedPointScale ) { - delta[0] = static_cast(vInput.x * g_VertAnimFixedPointScaleInv); - delta[1] = static_cast(vInput.y * g_VertAnimFixedPointScaleInv); - delta[2] = static_cast(vInput.z * g_VertAnimFixedPointScaleInv); + delta[0] = vInput.x / flVertAnimFixedPointScale; + delta[1] = vInput.y / flVertAnimFixedPointScale; + delta[2] = vInput.z / flVertAnimFixedPointScale; } - inline void SetNDeltaFixed( const Vector& vInputNormal ) + inline void SetNDeltaFixed( const Vector& vInputNormal, float flVertAnimFixedPointScale ) { - ndelta[0] = static_cast(vInputNormal.x * g_VertAnimFixedPointScaleInv); - ndelta[1] = static_cast(vInputNormal.y * g_VertAnimFixedPointScaleInv); - ndelta[2] = static_cast(vInputNormal.z * g_VertAnimFixedPointScaleInv); + ndelta[0] = vInputNormal.x / flVertAnimFixedPointScale; + ndelta[1] = vInputNormal.y / flVertAnimFixedPointScale; + ndelta[2] = vInputNormal.z / flVertAnimFixedPointScale; } // Ick...can also force fp16 data into this structure for writing to file in legacy format... @@ -996,10 +1127,20 @@ struct mstudiovertanim_t flNDelta[2].SetFloat( vInputNormal.z ); } + class CSortByIndex + { + public: + bool operator()(const mstudiovertanim_t &left, const mstudiovertanim_t & right)const + { + return left.index < right.index; + } + }; + friend class CSortByIndex; + mstudiovertanim_t(){} -private: - // No copy constructors allowed - mstudiovertanim_t(const mstudiovertanim_t& vOther); +//private: +// No copy constructors allowed, but it's needed for std::sort() +// mstudiovertanim_t(const mstudiovertanim_t& vOther); }; @@ -1010,20 +1151,25 @@ struct mstudiovertanim_wrinkle_t : public mstudiovertanim_t short wrinkledelta; - inline void SetWrinkleFixed( float flWrinkle ) + inline void SetWrinkleFixed( float flWrinkle, float flVertAnimFixedPointScale ) { - int nWrinkleDeltaInt = static_cast(flWrinkle * g_VertAnimFixedPointScaleInv); + int nWrinkleDeltaInt = flWrinkle / flVertAnimFixedPointScale; wrinkledelta = clamp( nWrinkleDeltaInt, -32767, 32767 ); } - inline Vector4D GetDeltaFixed() + inline Vector4D GetDeltaFixed( float flVertAnimFixedPointScale ) { - return Vector4D( delta[0]*g_VertAnimFixedPointScale, delta[1]*g_VertAnimFixedPointScale, delta[2]*g_VertAnimFixedPointScale, wrinkledelta*g_VertAnimFixedPointScale ); + return Vector4D( delta[0] * flVertAnimFixedPointScale, delta[1] * flVertAnimFixedPointScale, delta[2] * flVertAnimFixedPointScale, wrinkledelta * flVertAnimFixedPointScale ); } - inline void GetDeltaFixed4DAligned( Vector4DAligned *vFillIn ) + inline void GetDeltaFixed4DAligned( Vector4DAligned *vFillIn, float flVertAnimFixedPointScale ) { - vFillIn->Set( delta[0]*g_VertAnimFixedPointScale, delta[1]*g_VertAnimFixedPointScale, delta[2]*g_VertAnimFixedPointScale, wrinkledelta*g_VertAnimFixedPointScale ); + vFillIn->Set( delta[0] * flVertAnimFixedPointScale, delta[1] * flVertAnimFixedPointScale, delta[2] * flVertAnimFixedPointScale, wrinkledelta * flVertAnimFixedPointScale ); + } + + inline float GetWrinkleDeltaFixed( float flVertAnimFixedPointScale ) + { + return wrinkledelta * flVertAnimFixedPointScale; } }; @@ -1034,6 +1180,7 @@ enum StudioVertAnimType_t STUDIO_VERT_ANIM_WRINKLE, }; + struct mstudioflex_t { DECLARE_BYTESWAP_DATADESC(); @@ -1057,6 +1204,7 @@ struct mstudioflex_t unsigned char vertanimtype; // See StudioVertAnimType_t unsigned char unusedchar[3]; int unused[6]; + }; @@ -1187,12 +1335,15 @@ struct mstudioikchain_t // FIXME: add unused entries }; - struct mstudioiface_t { - unsigned short a, b, c; // Indices to vertices -}; + mstudioiface_t() + { + a = b = c = d = 0xFFFF; + } + unsigned short a, b, c, d; // Indices to vertices (If d is 0xFFFF, this is a triangle, else it's a quad) +}; struct mstudiomodel_t; @@ -1437,26 +1588,26 @@ inline mstudiovertex_t *mstudio_meshvertexdata_t::Vertex( int i ) const // a group of studio model data enum studiomeshgroupflags_t { - MESHGROUP_IS_FLEXED = 0x1, MESHGROUP_IS_HWSKINNED = 0x2, MESHGROUP_IS_DELTA_FLEXED = 0x4 }; // ---------------------------------------------------------- -// runtime stuff +// Runtime stuff // ---------------------------------------------------------- struct studiomeshgroup_t { IMesh *m_pMesh; int m_NumStrips; - int m_Flags; // see studiomeshgroupflags_t + int m_Flags; // see studiomeshgroupflags_t OptimizedModel::StripHeader_t *m_pStripData; unsigned short *m_pGroupIndexToMeshIndex; int m_NumVertices; - int *m_pUniqueTris; // for performance measurements + int *m_pUniqueFaces; // for performance measurements unsigned short *m_pIndices; + unsigned short *m_pTopologyIndices; bool m_MeshNeedsRestore; short m_ColorMeshID; IMorph *m_pMorph; @@ -1750,17 +1901,36 @@ struct thinModelVertices_t UnpackNormal_UBYTE4( &packedNormal, pNormal->Base() ); } - void GetBoneWeights( int vertIndex, mstudioboneweight_t *pBoneWeights ) const + void GetBoneWeights( int vertIndex, mstudioboneweight_t * RESTRICT pBoneWeights ) const { Assert( pBoneWeights ); Assert( ( m_numBoneInfluences <= 1 ) || ( m_boneWeights != NULL ) ); Assert( ( m_numBoneInfluences <= 0 ) || ( m_boneIndices != NULL ) ); int numStoredWeights = MAX( 0, ( m_numBoneInfluences - 1 ) ); - float *pBaseWeight = m_boneWeights + vertIndex*numStoredWeights; - char *pBaseIndex = m_boneIndices + vertIndex*m_numBoneInfluences; + float * RESTRICT pBaseWeight = m_boneWeights + vertIndex*numStoredWeights; + char * RESTRICT pBaseIndex = m_boneIndices + vertIndex*m_numBoneInfluences; float sum = 0.0f; + // TODO: unroll this loop? It's only three. We could use a switch + // and code it explicitly for the various possible m_numBoneInfluences + // which would improve scheduling but bloat code. for (int i = 0;i < MAX_NUM_BONES_PER_VERT;i++) { + float weight; + if ( i < ( m_numBoneInfluences - 1 ) ) + { + weight = pBaseWeight[i]; + sum += weight; + } + else + { + weight = 1.0f - sum; + sum = 1.0f; + } + + pBoneWeights->weight[i] = weight; + pBoneWeights->bone[i] = ( i < m_numBoneInfluences ) ? pBaseIndex[i] : 0; + + /* if ( i < ( m_numBoneInfluences - 1 ) ) pBoneWeights->weight[i] = pBaseWeight[i]; else @@ -1768,6 +1938,7 @@ struct thinModelVertices_t sum += pBoneWeights->weight[i]; pBoneWeights->bone[i] = ( i < m_numBoneInfluences ) ? pBaseIndex[i] : 0; + */ } // Treat 'zero weights' as '100% binding to bone zero': @@ -1781,6 +1952,41 @@ struct thinModelVertices_t unsigned short *m_vecNormals; // Normals are compressed into 16 bits apiece (see PackNormal_UBYTE4() ) }; + +// ---------------------------------------------------------- +// Studio Model Stream Data File +// ---------------------------------------------------------- + +// little-endian "IDSS" +#define MODEL_STREAM_FILE_ID (('S'<<24)+('S'<<16)+('D'<<8)+'I') +#define MODEL_STREAM_FILE_VERSION 1 + +struct vertexStreamFileHeader_t +{ + DECLARE_BYTESWAP_DATADESC(); + int id; // MODEL_STREAM_FILE_ID + int version; // MODEL_STREAM_FILE_VERSION + long checksum; // same as studiohdr_t, ensures sync + long flags; // flags + int numVerts; // number of vertices + int uv2StreamStart; // offset from base to uv2 stream + int uv2ElementSize; // size of each uv2 element + int pad; // pad + +public: + + // Accessor to uv2 stream + const void *GetStreamUv2() const + { + if ( ( id == MODEL_STREAM_FILE_ID ) && ( uv2StreamStart != 0 ) ) + return ( void * ) ( uv2StreamStart + (byte *)this ); + else + return NULL; + } +}; + + + // ---------------------------------------------------------- // Studio Model Vertex Data File // Position independent flat data for cache manager @@ -1791,6 +1997,8 @@ struct thinModelVertices_t #define MODEL_VERTEX_FILE_VERSION 4 // this id (IDCV) is used once the vertex data has been compressed (see CMDLCache::CreateThinVertexes) #define MODEL_VERTEX_FILE_THIN_ID (('V'<<24)+('C'<<16)+('D'<<8)+'I') +// this id (IDDV) is used once the vertex data has been discarded (see CMDLCache::CreateNullVertexes) +#define MODEL_VERTEX_FILE_NULL_ID (('V'<<24)+('D'<<16)+('D'<<8)+'I') struct vertexFileHeader_t { @@ -1935,6 +2143,17 @@ struct vertexFileFixup_t // alpha textures should cast shadows in vrad on this model (ONLY prop_static!) #define STUDIOHDR_FLAGS_CAST_TEXTURE_SHADOWS ( 1 << 18 ) +// Model has a quad-only Catmull-Clark SubD cage +#define STUDIOHDR_FLAGS_SUBDIVISION_SURFACE ( 1 << 19 ) + +// flagged on load to indicate no animation events on this model +#define STUDIOHDR_FLAGS_NO_ANIM_EVENTS ( 1 << 20 ) + +// If flag is set then studiohdr_t.flVertAnimFixedPointScale contains the +// scale value for fixed point vert anim data, if not set then the +// scale value is the default of 1.0 / 4096.0. Regardless use +// studiohdr_t::VertAnimFixedPointScale() to always retrieve the scale value +#define STUDIOHDR_FLAGS_VERT_ANIM_FIXED_POINT_SCALE ( 1 << 21 ) // NOTE! Next time we up the .mdl file format, remove studiohdr2_t // and insert all fields in this structure into studiohdr_t. @@ -1956,7 +2175,14 @@ struct studiohdr2_t int linearboneindex; inline mstudiolinearbone_t *pLinearBones() const { return (linearboneindex) ? (mstudiolinearbone_t *)(((byte *)this) + linearboneindex) : NULL; } - int reserved[59]; + int sznameindex; + inline char *pszName() { return (sznameindex) ? (char *)(((byte *)this) + sznameindex ) : NULL; } + + int m_nBoneFlexDriverCount; + int m_nBoneFlexDriverIndex; + inline mstudioboneflexdriver_t *pBoneFlexDriver( int i ) const { Assert( i >= 0 && i < m_nBoneFlexDriverCount ); return (mstudioboneflexdriver_t *)(((byte *)this) + m_nBoneFlexDriverIndex) + i; } + + int reserved[56]; }; struct studiohdr_t @@ -1967,10 +2193,10 @@ struct studiohdr_t long checksum; // this has to be the same in the phy and vtx files to load! - inline const char * pszName( void ) const { return name; } + inline const char * pszName( void ) const { if (studiohdr2index && pStudioHdr2()->pszName()) return pStudioHdr2()->pszName(); else return name; } char name[64]; - int length; + int length; Vector eyeposition; // ideal eye position @@ -2048,10 +2274,10 @@ struct studiohdr_t //public: int GetSequenceActivity( int iSequence ); void SetSequenceActivity( int iSequence, int iActivity ); - int GetActivityListVersion( void ) const; + int GetActivityListVersion( void ); void SetActivityListVersion( int version ) const; - int GetEventListVersion( void ) const; - void SetEventListVersion( int version ) const; + int GetEventListVersion( void ); + void SetEventListVersion( int version ); // raw textures int numtextures; @@ -2082,7 +2308,7 @@ struct studiohdr_t //public: int GetNumAttachments( void ) const; const mstudioattachment_t &pAttachment( int i ) const; - int GetAttachmentBone( int i ) const; + int GetAttachmentBone( int i ); // used on my tools in hlmv, not persistant void SetAttachmentBone( int iAttachment, int iBone ); @@ -2095,9 +2321,9 @@ struct studiohdr_t inline byte *pLocalTransition( int i ) const { Assert( i >= 0 && i < (numlocalnodes * numlocalnodes)); return (byte *)(((byte *)this) + localnodeindex) + i; }; //public: - int EntryNode( int iSequence ) const; - int ExitNode( int iSequence ) const; - const char *pszNodeName( int iNode ) const; + int EntryNode( int iSequence ); + int ExitNode( int iSequence ); + char *pszNodeName( int iNode ); int GetTransition( int iFrom, int iTo ) const; int numflexdesc; @@ -2126,11 +2352,12 @@ struct studiohdr_t inline mstudioposeparamdesc_t *pLocalPoseParameter( int i ) const { Assert( i >= 0 && i < numlocalposeparameters); return (mstudioposeparamdesc_t *)(((byte *)this) + localposeparamindex) + i; }; //public: int GetNumPoseParameters( void ) const; - const mstudioposeparamdesc_t &pPoseParameter( int i ) const; + const mstudioposeparamdesc_t &pPoseParameter( int i ); int GetSharedPoseParameter( int iSequence, int iLocalPose ) const; int surfacepropindex; inline char * const pszSurfaceProp( void ) const { return ((char *)this) + surfacepropindex; } + inline int GetSurfaceProp() const { return surfacepropLookup; } // Key values int keyvalueindex; @@ -2142,7 +2369,7 @@ struct studiohdr_t inline mstudioiklock_t *pLocalIKAutoplayLock( int i ) const { Assert( i >= 0 && i < numlocalikautoplaylocks); return (mstudioiklock_t *)(((byte *)this) + localikautoplaylockindex) + i; }; int GetNumIKAutoplayLocks( void ) const; - const mstudioiklock_t &pIKAutoplayLock( int i ) const; + const mstudioiklock_t &pIKAutoplayLock( int i ); int CountAutoplaySequences() const; int CopyAutoplaySequences( unsigned short *pOut, int outCount ) const; int GetAutoplayList( unsigned short **pOut ) const; @@ -2203,7 +2430,10 @@ struct studiohdr_t int flexcontrolleruiindex; mstudioflexcontrollerui_t *pFlexControllerUI( int i ) const { Assert( i >= 0 && i < numflexcontrollerui); return (mstudioflexcontrollerui_t *)(((byte *)this) + flexcontrolleruiindex) + i; } - int unused3[2]; + float flVertAnimFixedPointScale; + inline float VertAnimFixedPointScale() const { return ( flags & STUDIOHDR_FLAGS_VERT_ANIM_FIXED_POINT_SCALE ) ? flVertAnimFixedPointScale : 1.0f / 4096.0f; } + + mutable int surfacepropLookup; // this index must be cached by the loader, not saved in the file // FIXME: Remove when we up the model version. Move all fields of studiohdr2_t into studiohdr_t. int studiohdr2index; @@ -2219,6 +2449,9 @@ struct studiohdr_t inline mstudiolinearbone_t *pLinearBones() const { return studiohdr2index ? pStudioHdr2()->pLinearBones() : NULL; } + inline int BoneFlexDriverCount() const { return studiohdr2index ? pStudioHdr2()->m_nBoneFlexDriverCount : 0; } + inline const mstudioboneflexdriver_t* BoneFlexDriver( int i ) const { Assert( i >= 0 && i < BoneFlexDriverCount() ); return studiohdr2index ? pStudioHdr2()->pBoneFlexDriver( i ) : NULL; } + // NOTE: No room to add stuff? Up the .mdl file format version // [and move all fields in studiohdr2_t into studiohdr_t and kill studiohdr2_t], // or add your stuff to studiohdr2_t. See NumSrcBoneTransforms/SrcBoneTransform for the pattern to use. @@ -2258,15 +2491,15 @@ class CStudioHdr inline bool IsReadyForAccess( void ) const { return (m_pStudioHdr != NULL); }; inline virtualmodel_t *GetVirtualModel( void ) const { return m_pVModel; }; inline const studiohdr_t *GetRenderHdr( void ) const { return m_pStudioHdr; }; - const studiohdr_t *pSeqStudioHdr( int sequence ) const; - const studiohdr_t *pAnimStudioHdr( int animation )const; + const studiohdr_t *pSeqStudioHdr( int sequence ); + const studiohdr_t *pAnimStudioHdr( int animation ); private: mutable const studiohdr_t *m_pStudioHdr; mutable virtualmodel_t *m_pVModel; const virtualmodel_t * ResetVModel( const virtualmodel_t *pVModel ) const; - const studiohdr_t *GroupStudioHdr( int group ) const; + const studiohdr_t *GroupStudioHdr( int group ); mutable CUtlVector< const studiohdr_t * > m_pStudioHdrCache; mutable int m_nFrameUnlockCounter; @@ -2281,36 +2514,36 @@ class CStudioHdr bool SequencesAvailable() const; int GetNumSeq( void ) const; - mstudioanimdesc_t &pAnimdesc( int i ) const; - mstudioseqdesc_t &pSeqdesc( int iSequence ) const; + mstudioanimdesc_t &pAnimdesc( int i ); + mstudioseqdesc_t &pSeqdesc( int iSequence ); int iRelativeAnim( int baseseq, int relanim ) const; // maps seq local anim reference to global anim index int iRelativeSeq( int baseseq, int relseq ) const; // maps seq local seq reference to global seq index int GetSequenceActivity( int iSequence ); void SetSequenceActivity( int iSequence, int iActivity ); - int GetActivityListVersion( void ) const; + int GetActivityListVersion( void ); void SetActivityListVersion( int version ); - int GetEventListVersion( void ) const; + int GetEventListVersion( void ); void SetEventListVersion( int version ); int GetNumAttachments( void ) const; - const mstudioattachment_t &pAttachment( int i ) const; - int GetAttachmentBone( int i ) const; + const mstudioattachment_t &pAttachment( int i ); + int GetAttachmentBone( int i ); // used on my tools in hlmv, not persistant void SetAttachmentBone( int iAttachment, int iBone ); - int EntryNode( int iSequence ) const; - int ExitNode( int iSequence ) const; - const char *pszNodeName( int iNode ) const; + int EntryNode( int iSequence ); + int ExitNode( int iSequence ); + char *pszNodeName( int iNode ); // FIXME: where should this one be? int GetTransition( int iFrom, int iTo ) const; int GetNumPoseParameters( void ) const; - const mstudioposeparamdesc_t &pPoseParameter( int i ) const; + const mstudioposeparamdesc_t &pPoseParameter( int i ); int GetSharedPoseParameter( int iSequence, int iLocalPose ) const; int GetNumIKAutoplayLocks( void ) const; - const mstudioiklock_t &pIKAutoplayLock( int i ) const; + const mstudioiklock_t &pIKAutoplayLock( int i ); inline int CountAutoplaySequences() const { return m_pStudioHdr->CountAutoplaySequences(); }; inline int CopyAutoplaySequences( unsigned short *pOut, int outCount ) const { return m_pStudioHdr->CopyAutoplaySequences( pOut, outCount ); }; @@ -2335,7 +2568,7 @@ class CStudioHdr inline int numflexcontrollerui() const{ return m_pStudioHdr->numflexcontrollerui; }; inline mstudioflexcontrollerui_t *pFlexcontrollerUI( int i ) const { return m_pStudioHdr->pFlexControllerUI( i ); }; - inline const char *name() const { return m_pStudioHdr->name; }; // deprecated -- remove after full xbox merge + inline const char *name() const { return m_pStudioHdr->pszName(); }; // deprecated -- remove after full xbox merge inline const char *pszName() const { return m_pStudioHdr->pszName(); }; inline int numbonecontrollers() const { return m_pStudioHdr->numbonecontrollers; }; @@ -2356,6 +2589,7 @@ class CStudioHdr inline int flags() const { return m_pStudioHdr->flags; }; inline char *const pszSurfaceProp( void ) const { return m_pStudioHdr->pszSurfaceProp(); }; + inline int GetSurfaceProp()const { return m_pStudioHdr->surfacepropLookup; } inline float mass() const { return m_pStudioHdr->mass; }; inline int contents() const { return m_pStudioHdr->contents; } @@ -2378,15 +2612,22 @@ class CStudioHdr inline mstudiolinearbone_t *pLinearBones() const { return m_pStudioHdr->pLinearBones(); } + inline int BoneFlexDriverCount() const { return m_pStudioHdr->BoneFlexDriverCount(); } + inline const mstudioboneflexdriver_t *BoneFlexDriver( int i ) const { return m_pStudioHdr->BoneFlexDriver( i ); } + public: int IsSequenceLooping( int iSequence ); float GetSequenceCycleRate( int iSequence ); void RunFlexRules( const float *src, float *dest ); + void RunFlexRulesOld( const float *src, float *dest ); + void RunFlexRulesNew( const float *src, float *dest ); public: inline int boneFlags( int iBone ) const { return m_boneFlags[ iBone ]; } + inline void setBoneFlags( int iBone, int flags ) { m_boneFlags[ iBone ] |= flags; } + inline void clearBoneFlags( int iBone, int flags ) { m_boneFlags[ iBone ] &= ~flags; } inline int boneParent( int iBone ) const { return m_boneParent[ iBone ]; } private: @@ -2394,6 +2635,7 @@ class CStudioHdr CUtlVector< int > m_boneParent; public: + // This class maps an activity to sequences allowed for that activity, accelerating the resolution // of SelectWeightedSequence(), especially on PowerPC. Iterating through every sequence // attached to a model turned out to be a very destructive cache access pattern on 360. @@ -2409,8 +2651,10 @@ class CStudioHdr // A tuple of a sequence and its corresponding weight. Lists of these correspond to activities. struct SequenceTuple { - short seqnum; - short weight; // the absolute value of the weight from the sequence header + short seqnum; + short weight; // the absolute value of the weight from the sequence header + CUtlSymbol *pActivityModifiers; // list of activity modifier symbols + int iNumActivityModifiers; }; // The type of the hash's stored data, a composite of both key and value @@ -2468,20 +2712,22 @@ class CStudioHdr typedef CUtlHash ActivityToValueIdxHash; + // These must be here because IFM does not compile/link studio.cpp (?!?) + // ctor CActivityToSequenceMapping( void ) - : m_pSequenceTuples(NULL), m_iSequenceTuplesCount(0), -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE - m_bIsInitialized(false), -#endif - m_ActToSeqHash(8,0,0), m_expectedPStudioHdr(NULL), m_expectedVModel(NULL) + : m_pSequenceTuples(NULL), m_iSequenceTuplesCount(0), m_ActToSeqHash(8,0,0), m_expectedVModel(NULL), m_pStudioHdr(NULL) {}; // dtor -- not virtual because this class has no inheritors ~CActivityToSequenceMapping() - { + { if ( m_pSequenceTuples != NULL ) { + if ( m_pSequenceTuples->pActivityModifiers != NULL ) + { + delete[] m_pSequenceTuples->pActivityModifiers; + } delete[] m_pSequenceTuples; } } @@ -2496,15 +2742,15 @@ class CStudioHdr /// The number of sequences available for an activity. int NumSequencesForActivity( int forActivity ); -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE - inline bool IsInitialized( void ) { return m_bIsInitialized; } -#endif + static CActivityToSequenceMapping *FindMapping( const CStudioHdr *pstudiohdr ); + static void ReleaseMapping( CActivityToSequenceMapping *pMap ); + static void ResetMappings(); private: /// Allocate my internal array. (It is freed in the destructor.) Also, /// build the hash of activities to sequences and populate m_pSequenceTuples. - void Initialize( CStudioHdr *pstudiohdr ); + void Initialize( const CStudioHdr *pstudiohdr ); /// Force Initialize() to occur again, even if it has already occured. void Reinitialize( CStudioHdr *pstudiohdr ); @@ -2512,12 +2758,12 @@ class CStudioHdr /// A more efficient version of the old SelectWeightedSequence() function in animation.cpp. int SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequence ); + // selects the sequence with the most matching modifiers + int SelectWeightedSequenceFromModifiers( CStudioHdr *pstudiohdr, int activity, CUtlSymbol *pActivityModifiers, int iModifierCount ); + // Actually a big array, into which the hash values index. SequenceTuple *m_pSequenceTuples; unsigned int m_iSequenceTuplesCount; // (size of the whole array) -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE - bool m_bIsInitialized; -#endif // we don't store an outer pointer because we can't initialize it at construction time // (warning c4355) -- there are ways around this but it's easier to just pass in a @@ -2527,51 +2773,60 @@ class CStudioHdr ActivityToValueIdxHash m_ActToSeqHash; + const studiohdr_t *m_pStudioHdr; + // we store these so we can know if the contents of the studiohdr have changed // from underneath our feet (this is an emergency data integrity check) - const void *m_expectedPStudioHdr; const void *m_expectedVModel; + // double-check that the data I point to hasn't changed bool ValidateAgainst( const CStudioHdr * RESTRICT pstudiohdr ); - void SetValidationPair( const CStudioHdr *RESTRICT pstudiohdr ); + void SetValidation( const CStudioHdr *RESTRICT pstudiohdr ); friend class CStudioHdr; }; - CActivityToSequenceMapping m_ActivityToSequence; + CActivityToSequenceMapping *m_pActivityToSequence; + + void InitActivityToSequence() + { + if ( !m_pActivityToSequence ) + { + m_pActivityToSequence = CActivityToSequenceMapping::FindMapping( this ); + } + } /// A more efficient version of the old SelectWeightedSequence() function in animation.cpp. /// Returns -1 on failure to find a sequence inline int SelectWeightedSequence( int activity, int curSequence ) { -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE - // We lazy-initialize the header on demand here, because CStudioHdr::Init() is - // called from the constructor, at which time the this pointer is illegitimate. - if ( !m_ActivityToSequence.IsInitialized() ) - { - m_ActivityToSequence.Initialize(this); - } -#endif - return m_ActivityToSequence.SelectWeightedSequence( this, activity, curSequence ); + InitActivityToSequence(); + return m_pActivityToSequence->SelectWeightedSequence( this, activity, curSequence ); + } + + inline int SelectWeightedSequenceFromModifiers( int activity, CUtlSymbol *pActivityModifiers, int iModifierCount ) + { + InitActivityToSequence(); + return m_pActivityToSequence->SelectWeightedSequenceFromModifiers( this, activity, pActivityModifiers, iModifierCount ); } /// True iff there is at least one sequence for the given activity. inline bool HaveSequenceForActivity( int activity ) { -#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE - if ( !m_ActivityToSequence.IsInitialized() ) - { - m_ActivityToSequence.Initialize(this); - } -#endif - return (m_ActivityToSequence.NumSequencesForActivity( activity ) > 0); + InitActivityToSequence(); + return (m_pActivityToSequence->NumSequencesForActivity( activity ) > 0); } // Force this CStudioHdr's activity-to-sequence mapping to be reinitialized inline void ReinitializeSequenceMapping(void) { - m_ActivityToSequence.Reinitialize(this); + if ( m_pActivityToSequence ) + { + CActivityToSequenceMapping::ReleaseMapping( m_pActivityToSequence ); + m_pActivityToSequence = NULL; + } + m_pActivityToSequence = CActivityToSequenceMapping::FindMapping( this ); } #ifdef STUDIO_ENABLE_PERF_COUNTERS @@ -2840,15 +3095,18 @@ inline const mstudioflexcontroller_t *mstudioflexcontrollerui_t::pController( in #define STUDIO_AUTOPLAY 0x0008 // temporary flag that forces the sequence to always play #define STUDIO_POST 0x0010 // #define STUDIO_ALLZEROS 0x0020 // this animation/sequence has no real animation data -// 0x0040 +#define STUDIO_FRAMEANIM 0x0040 // animation is encoded as by frame x bone instead of RLE bone x frame #define STUDIO_CYCLEPOSE 0x0080 // cycle index is taken from a pose parameter index #define STUDIO_REALTIME 0x0100 // cycle index is taken from a real-time clock, not the animations cycle index #define STUDIO_LOCAL 0x0200 // sequence has a local context sequence #define STUDIO_HIDDEN 0x0400 // don't show in default selection views #define STUDIO_OVERRIDE 0x0800 // a forward declared sequence (empty) #define STUDIO_ACTIVITY 0x1000 // Has been updated at runtime to activity index -#define STUDIO_EVENT 0x2000 // Has been updated at runtime to event index +#define STUDIO_EVENT 0x2000 // Has been updated at runtime to event index on server #define STUDIO_WORLD 0x4000 // sequence blends in worldspace +#define STUDIO_NOFORCELOOP 0x8000 // do not force the animation loop +#define STUDIO_EVENT_CLIENT 0x10000 // Has been updated at runtime to event index on client + // autolayer flags // 0x0001 // 0x0002 @@ -2867,12 +3125,11 @@ inline const mstudioflexcontroller_t *mstudioflexcontrollerui_t::pController( in #define STUDIO_AL_POSE 0x4000 // layer blends using a pose parameter instead of parent cycle -// Insert this code anywhere that you need to allow for conversion from an old STUDIO_VERSION -// to a new one. +// Insert this code anywhere that you need to allow for conversion from an old STUDIO_VERSION to a new one. // If we only support the current version, this function should be empty. inline bool Studio_ConvertStudioHdrToNewVersion( studiohdr_t *pStudioHdr ) { - COMPILE_TIME_ASSERT( STUDIO_VERSION == 48 ); // put this to make sure this code is updated upon changing version. + COMPILE_TIME_ASSERT( STUDIO_VERSION == 49 ); // put this to make sure this code is updated upon changing version. int version = pStudioHdr->version; if ( version == STUDIO_VERSION ) @@ -2901,7 +3158,7 @@ inline bool Studio_ConvertStudioHdrToNewVersion( studiohdr_t *pStudioHdr ) if (version < 47) { - // used to contain zeroframe cache data + // now used to contain zeroframe cache data, make sure it's empty if (pStudioHdr->unused4 != 0) { pStudioHdr->unused4 = 0; @@ -2916,6 +3173,7 @@ inline bool Studio_ConvertStudioHdrToNewVersion( studiohdr_t *pStudioHdr ) } else if (version == 47) { + // clear out stale version of zeroframe cache data for (int i = 0; i < pStudioHdr->numlocalanim; i++) { mstudioanimdesc_t *pAnim = (mstudioanimdesc_t *)pStudioHdr->pLocalAnimdesc( i ); @@ -2928,6 +3186,19 @@ inline bool Studio_ConvertStudioHdrToNewVersion( studiohdr_t *pStudioHdr ) } } + if (version < 49) + { + // remove any frameanim flag settings that might be stale + for (int i = 0; i < pStudioHdr->numlocalanim; i++) + { + mstudioanimdesc_t *pAnim = (mstudioanimdesc_t *)pStudioHdr->pLocalAnimdesc( i ); + if (pAnim->flags & STUDIO_FRAMEANIM) + { + pAnim->flags &= ~STUDIO_FRAMEANIM; + bResult = false; + } + } + } // for now, just slam the version number since they're compatible pStudioHdr->version = STUDIO_VERSION; @@ -3088,4 +3359,5 @@ inline int Studio_LoadVertexes( const vertexFileHeader_t *pTempVvdHdr, vertexFil return target; } + #endif // STUDIO_H diff --git a/public/studio_virtualmodel.cpp b/public/studio_virtualmodel.cpp index 8f2c53f31..6469dea74 100644 --- a/public/studio_virtualmodel.cpp +++ b/public/studio_virtualmodel.cpp @@ -348,6 +348,15 @@ void virtualmodel_t::AppendBonemap( int group, const studiohdr_t *pStudioHdr ) { Warning( "%s/%s : missmatched parent bones on \"%s\"\n", pBaseStudioHdr->pszName(), pStudioHdr->pszName(), pStudioHdr->pBone( j )->pszName() ); } + + // merge the bone use flags and pass up the chain + int flags = (pStudioHdr->pBone( j )->flags | pBaseStudioHdr->pBone( k )->flags) & BONE_USED_MASK; + int n = k; + while (n != -1 && flags != pBaseStudioHdr->pBone( n )->flags) + { + pBaseStudioHdr->pBone( n )->flags |= flags; + n = pBaseStudioHdr->pBone( n )->parent; + } } else { @@ -405,23 +414,6 @@ void virtualmodel_t::AppendAttachments( int group, const studiohdr_t *pStudioHdr tmp.group = group; tmp.index = j; k = attachment.AddToTail( tmp ); - - // make sure bone flags are set so attachment calculates - if ((m_group[ 0 ].GetStudioHdr()->pBone( n )->flags & BONE_USED_BY_ATTACHMENT) == 0) - { - while (n != -1) - { - m_group[ 0 ].GetStudioHdr()->pBone( n )->flags |= BONE_USED_BY_ATTACHMENT; - - if (m_group[ 0 ].GetStudioHdr()->pLinearBones()) - { - *m_group[ 0 ].GetStudioHdr()->pLinearBones()->pflags(n) |= BONE_USED_BY_ATTACHMENT; - } - - n = m_group[ 0 ].GetStudioHdr()->pBone( n )->parent; - } - continue; - } } m_group[ group ].masterAttachment[ j ] = k; diff --git a/public/tier1/checksum_md5.h b/public/tier1/checksum_md5.h index 134d2b526..8f38577bc 100644 --- a/public/tier1/checksum_md5.h +++ b/public/tier1/checksum_md5.h @@ -13,6 +13,18 @@ // 16 bytes == 128 bit digest #define MD5_DIGEST_LENGTH 16 +#define MD5_BIT_LENGTH ( MD5_DIGEST_LENGTH * sizeof(unsigned char) ) +struct MD5Value_t +{ + unsigned char bits[MD5_DIGEST_LENGTH]; + + void Zero(); + bool IsZero() const; + + bool operator==( const MD5Value_t &src ) const; + bool operator!=( const MD5Value_t &src ) const; + +}; // MD5 Hash typedef struct diff --git a/public/vcollide.h b/public/vcollide.h index 13af7e46f..3eace8dbc 100644 --- a/public/vcollide.h +++ b/public/vcollide.h @@ -21,6 +21,7 @@ struct vcollide_t // VPhysicsSolids CPhysCollide **solids; char *pKeyValues; + void *pUserData; }; #endif // VCOLLIDE_H diff --git a/public/vcollide_parse.h b/public/vcollide_parse.h index 50bd49094..dcd57658c 100644 --- a/public/vcollide_parse.h +++ b/public/vcollide_parse.h @@ -15,11 +15,12 @@ struct solid_t { - int index; char name[512]; char parent[512]; char surfaceprop[512]; Vector massCenterOverride; + int index; + int contents; objectparams_t params; }; @@ -37,6 +38,26 @@ struct fluid_t } }; +struct ragdollcollisionrules_t +{ + void Defaults( IPhysics *pPhysics, IPhysicsCollisionSet *pSetIn ) + { + pCollisionSet = pSetIn; + bSelfCollisions = true; + } + int bSelfCollisions; + IPhysicsCollisionSet *pCollisionSet; +}; + +struct ragdollanimatedfriction_t +{ + float minFriction; + float maxFriction; + float timeIn; + float timeOut; + float timeHold; +}; + //----------------------------------------------------------------------------- // Purpose: Pass this into the parser to handle the keys that vphysics does not // parse. @@ -63,6 +84,8 @@ class IVPhysicsKeyParser virtual void ParseCustom( void *pCustom, IVPhysicsKeyHandler *unknownKeyHandler ) = 0; virtual void ParseVehicle( vehicleparams_t *pVehicle, IVPhysicsKeyHandler *unknownKeyHandler ) = 0; virtual void SkipBlock( void ) = 0; + virtual void ParseCollisionRules( ragdollcollisionrules_t *pRules, IVPhysicsKeyHandler *unknownKeyHandler ) = 0; + virtual void ParseRagdollAnimatedFriction( ragdollanimatedfriction_t *pFriction, IVPhysicsKeyHandler *unknownKeyHandler ) = 0; }; #endif // VCOLLIDE_PARSE_H diff --git a/public/vphysics/constraints.h b/public/vphysics/constraints.h index 36677e49e..d101d7ff4 100644 --- a/public/vphysics/constraints.h +++ b/public/vphysics/constraints.h @@ -287,6 +287,14 @@ struct constraint_lengthparams_t minLength = rigid ? totalLength : 0; } + void Init( IPhysicsObject *pRef, IPhysicsObject *pAttached, float flLength, bool rigid = false ) + { + objectPosition[0] = vec3_origin; + objectPosition[1] = vec3_origin; + totalLength = flLength; + minLength = rigid ? totalLength : 0; + } + inline void Defaults() { constraint.Defaults(); diff --git a/public/vphysics_interface.h b/public/vphysics_interface.h index 544312427..a4e2b1032 100644 --- a/public/vphysics_interface.h +++ b/public/vphysics_interface.h @@ -1,9 +1,9 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: Public interfaces to vphysics DLL // // $NoKeywords: $ -//=============================================================================// +//===========================================================================// #ifndef VPHYSICS_INTERFACE_H #define VPHYSICS_INTERFACE_H @@ -17,7 +17,7 @@ #include "mathlib/vector.h" #include "mathlib/vector4d.h" #include "vcollide.h" - +#include "tier3/tier3.h" // ------------------------------------------------------------------------------------ // UNITS: @@ -696,6 +696,12 @@ enum callbackflags CALLBACK_MARKED_FOR_TEST = 0x8000, // debug -- marked object is being debugged }; +enum collisionhints +{ + COLLISION_HINT_DEBRIS = 0x0001, + COLLISION_HINT_STATICSOLID = 0x0002, +}; + abstract_class IPhysicsObject { public: @@ -777,7 +783,7 @@ abstract_class IPhysicsObject // Get the radius if this is a sphere object (zero if this is a polygonal mesh) virtual float GetSphereRadius() const = 0; // Set the radius on a sphere. May need to force recalculation of contact points - virtual void SetSphereRadius( float radius ) = 0; + virtual void SetSphereRadius(float radius) = 0; virtual float GetEnergy() const = 0; virtual Vector GetMassCenterLocalSpace() const = 0; From 412b0365f42a4fbe14103030638669f833e1959a Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 02:03:00 -0300 Subject: [PATCH 04/24] dont check g_bUseNetworkVars on debug --- public/networkvar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/networkvar.h b/public/networkvar.h index 11521f849..c00ec09e3 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -26,7 +26,7 @@ #ifdef _DEBUG #undef new extern bool g_bUseNetworkVars; - #define CHECK_USENETWORKVARS if(g_bUseNetworkVars) + #define CHECK_USENETWORKVARS #else #define CHECK_USENETWORKVARS // don't check for g_bUseNetworkVars #endif From 50f523e655a9ae54f279dd2423835b171ef1b7c0 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 15:13:32 -0300 Subject: [PATCH 05/24] fix handles and update threadtools --- public/basehandle.h | 6 +- public/const.h | 6 +- public/tier0/threadtools.h | 168 ++++++++++++++++++++++++------------- public/tier1/refcount.h | 4 +- 4 files changed, 117 insertions(+), 67 deletions(-) diff --git a/public/basehandle.h b/public/basehandle.h index e02ddd313..b625a2714 100644 --- a/public/basehandle.h +++ b/public/basehandle.h @@ -92,10 +92,10 @@ inline CBaseHandle::CBaseHandle( int iEntry, int iSerialNumber ) inline void CBaseHandle::Init( int iEntry, int iSerialNumber ) { - Assert( iEntry >= 0 && (iEntry & ENT_ENTRY_MASK) == iEntry); + Assert( iEntry >= 0 && iEntry < NUM_ENT_ENTRIES ); Assert( iSerialNumber >= 0 && iSerialNumber < (1 << NUM_SERIAL_NUM_BITS) ); - m_Index = iEntry | (iSerialNumber << NUM_SERIAL_NUM_SHIFT_BITS); + m_Index = iEntry | (iSerialNumber << NUM_ENT_ENTRY_BITS); } inline void CBaseHandle::Term() @@ -129,7 +129,7 @@ inline int CBaseHandle::GetEntryIndex() const inline int CBaseHandle::GetSerialNumber() const { - return m_Index >> NUM_SERIAL_NUM_SHIFT_BITS; + return m_Index >> NUM_ENT_ENTRY_BITS; } inline int CBaseHandle::ToInt() const diff --git a/public/const.h b/public/const.h index 5f44760c8..d4b1797b6 100644 --- a/public/const.h +++ b/public/const.h @@ -70,13 +70,13 @@ #define SIGNED_GUID_LEN 32 // Hashed CD Key (32 hex alphabetic chars + 0 terminator ) // Used for networking ehandles. -#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 2) +#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 1) #define NUM_ENT_ENTRIES (1 << NUM_ENT_ENTRY_BITS) #define INVALID_EHANDLE_INDEX 0xFFFFFFFF -#define NUM_SERIAL_NUM_BITS 16 // (32 - NUM_ENT_ENTRY_BITS) +#define NUM_SERIAL_NUM_BITS (32 - NUM_ENT_ENTRY_BITS) #define NUM_SERIAL_NUM_SHIFT_BITS (32 - NUM_SERIAL_NUM_BITS) -#define ENT_ENTRY_MASK (( 1 << NUM_SERIAL_NUM_BITS) - 1) +#define ENT_ENTRY_MASK (NUM_ENT_ENTRIES - 1) // Networked ehandles use less bits to encode the serial number. diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index 3b0e47100..3b7a5d1cc 100644 --- a/public/tier0/threadtools.h +++ b/public/tier0/threadtools.h @@ -158,13 +158,57 @@ inline int ThreadWaitForObject( HANDLE handle, bool bWaitAll = true, unsigned ti #define NOINLINE __attribute__ ((noinline)) #endif -#if defined(_WIN32) && !defined(_X360) -#if ( _MSC_VER >= 1310 ) +#if defined( _LINUX ) || defined( _OSX ) +#define USE_INTRINSIC_INTERLOCKED +// linux implementation +inline int32 ThreadInterlockedIncrement( int32 volatile *p ) +{ + Assert( (size_t)p % 4 == 0 ); + return __sync_fetch_and_add( p, 1 ) + 1; +} + +inline int32 ThreadInterlockedDecrement( int32 volatile *p ) +{ + Assert( (size_t)p % 4 == 0 ); + return __sync_fetch_and_add( p, -1 ) - 1; +} + +inline int32 ThreadInterlockedExchange( int32 volatile *p, int32 value ) +{ + Assert( (size_t)p % 4 == 0 ); + int32 nRet; + + // Note: The LOCK instruction prefix is assumed on the XCHG instruction and GCC gets very confused on the Mac when we use it. + __asm __volatile( + "xchgl %2,(%1)" + : "=r" (nRet) + : "r" (p), "0" (value) + : "memory"); + return nRet; +} + +inline int32 ThreadInterlockedExchangeAdd( int32 volatile *p, int32 value ) +{ + Assert( (size_t)p % 4 == 0 ); + return __sync_fetch_and_add( p, value ); +} +inline int32 ThreadInterlockedCompareExchange( int32 volatile *p, int32 value, int32 comperand ) +{ + Assert( (size_t)p % 4 == 0 ); + return __sync_val_compare_and_swap( p, comperand, value ); +} + + +inline bool ThreadInterlockedAssignIf( int32 volatile *p, int32 value, int32 comperand ) +{ + Assert( (size_t)p % 4 == 0 ); + return __sync_bool_compare_and_swap( p, comperand, value ); +} + +#elif ( defined( COMPILER_MSVC32 ) && ( _MSC_VER >= 1310 ) ) +// windows 32 implemnetation using compiler intrinsics #define USE_INTRINSIC_INTERLOCKED -#endif -#endif -#ifdef USE_INTRINSIC_INTERLOCKED extern "C" { long __cdecl _InterlockedIncrement(volatile long*); @@ -180,60 +224,66 @@ extern "C" #pragma intrinsic( _InterlockedExchangeAdd ) #pragma intrinsic( _InterlockedIncrement ) -inline long ThreadInterlockedIncrement( long volatile *p ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedIncrement( p ); } -inline long ThreadInterlockedDecrement( long volatile *p ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedDecrement( p ); } -inline long ThreadInterlockedExchange( long volatile *p, long value ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedExchange( p, value ); } -inline long ThreadInterlockedExchangeAdd( long volatile *p, long value ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedExchangeAdd( p, value ); } -inline long ThreadInterlockedCompareExchange( long volatile *p, long value, long comperand ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedCompareExchange( p, value, comperand ); } -inline bool ThreadInterlockedAssignIf( long volatile *p, long value, long comperand ) { Assert( (size_t)p % 4 == 0 ); return ( _InterlockedCompareExchange( p, value, comperand ) == comperand ); } +inline int32 ThreadInterlockedIncrement( int32 volatile *p ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedIncrement( (volatile long*)p ); } +inline int32 ThreadInterlockedDecrement( int32 volatile *p ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedDecrement( (volatile long*)p ); } +inline int32 ThreadInterlockedExchange( int32 volatile *p, int32 value ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedExchange( (volatile long*)p, value ); } +inline int32 ThreadInterlockedExchangeAdd( int32 volatile *p, int32 value ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedExchangeAdd( (volatile long*)p, value ); } +inline int32 ThreadInterlockedCompareExchange( int32 volatile *p, int32 value, int32 comperand ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedCompareExchange( (volatile long*)p, value, comperand ); } +inline bool ThreadInterlockedAssignIf( int32 volatile *p, int32 value, int32 comperand ) { Assert( (size_t)p % 4 == 0 ); return ( _InterlockedCompareExchange( (volatile long*)p, value, comperand ) == comperand ); } #else -TT_INTERFACE long ThreadInterlockedIncrement( long volatile * ); -TT_INTERFACE long ThreadInterlockedDecrement( long volatile * ); -TT_INTERFACE long ThreadInterlockedExchange( long volatile *, long value ); -TT_INTERFACE long ThreadInterlockedExchangeAdd( long volatile *, long value ); -TT_INTERFACE long ThreadInterlockedCompareExchange( long volatile *, long value, long comperand ); -TT_INTERFACE bool ThreadInterlockedAssignIf( long volatile *, long value, long comperand ); +// non 32-bit windows and 360 implementation +PLATFORM_INTERFACE int32 ThreadInterlockedIncrement( int32 volatile * ) NOINLINE; +PLATFORM_INTERFACE int32 ThreadInterlockedDecrement( int32 volatile * ) NOINLINE; +PLATFORM_INTERFACE int32 ThreadInterlockedExchange( int32 volatile *, int32 value ) NOINLINE; +PLATFORM_INTERFACE int32 ThreadInterlockedExchangeAdd( int32 volatile *, int32 value ) NOINLINE; +PLATFORM_INTERFACE int32 ThreadInterlockedCompareExchange( int32 volatile *, int32 value, int32 comperand ) NOINLINE; +PLATFORM_INTERFACE bool ThreadInterlockedAssignIf( int32 volatile *, int32 value, int32 comperand ) NOINLINE; #endif -inline unsigned ThreadInterlockedExchangeSubtract( long volatile *p, long value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, -value ); } -#if defined( USE_INTRINSIC_INTERLOCKED ) && !defined( _WIN64 ) +#if defined( USE_INTRINSIC_INTERLOCKED ) && !defined( PLATFORM_64BITS ) #define TIPTR() -inline void *ThreadInterlockedExchangePointer( void * volatile *p, void *value ) { return (void *)_InterlockedExchange( reinterpret_cast(p), reinterpret_cast(value) ); } -inline void *ThreadInterlockedCompareExchangePointer( void * volatile *p, void *value, void *comperand ) { return (void *)_InterlockedCompareExchange( reinterpret_cast(p), reinterpret_cast(value), reinterpret_cast(comperand) ); } -inline bool ThreadInterlockedAssignPointerIf( void * volatile *p, void *value, void *comperand ) { return ( _InterlockedCompareExchange( reinterpret_cast(p), reinterpret_cast(value), reinterpret_cast(comperand) ) == reinterpret_cast(comperand) ); } +inline void *ThreadInterlockedExchangePointer( void * volatile *p, void *value ) { return (void *)( ( intp )ThreadInterlockedExchange( reinterpret_cast(p), reinterpret_cast(value) ) ); } +inline void *ThreadInterlockedCompareExchangePointer( void * volatile *p, void *value, void *comperand ) { return (void *)( ( intp )ThreadInterlockedCompareExchange( reinterpret_cast(p), reinterpret_cast(value), reinterpret_cast(comperand) ) ); } +inline bool ThreadInterlockedAssignPointerIf( void * volatile *p, void *value, void *comperand ) { return ( ThreadInterlockedCompareExchange( reinterpret_cast(p), reinterpret_cast(value), reinterpret_cast(comperand) ) == reinterpret_cast(comperand) ); } #else -TT_INTERFACE void *ThreadInterlockedExchangePointer( void * volatile *, void *value ); -TT_INTERFACE void *ThreadInterlockedCompareExchangePointer( void * volatile *, void *value, void *comperand ); -TT_INTERFACE bool ThreadInterlockedAssignPointerIf( void * volatile *, void *value, void *comperand ); +PLATFORM_INTERFACE void *ThreadInterlockedExchangePointer( void * volatile *, void *value ) NOINLINE; +PLATFORM_INTERFACE void *ThreadInterlockedCompareExchangePointer( void * volatile *, void *value, void *comperand ) NOINLINE; +PLATFORM_INTERFACE bool ThreadInterlockedAssignPointerIf( void * volatile *, void *value, void *comperand ) NOINLINE; #endif + +inline unsigned ThreadInterlockedExchangeSubtract( int32 volatile *p, int32 value ) { return ThreadInterlockedExchangeAdd( (int32 volatile *)p, -value ); } + inline void const *ThreadInterlockedExchangePointerToConst( void const * volatile *p, void const *value ) { return ThreadInterlockedExchangePointer( const_cast < void * volatile * > ( p ), const_cast < void * > ( value ) ); } inline void const *ThreadInterlockedCompareExchangePointerToConst( void const * volatile *p, void const *value, void const *comperand ) { return ThreadInterlockedCompareExchangePointer( const_cast < void * volatile * > ( p ), const_cast < void * > ( value ), const_cast < void * > ( comperand ) ); } inline bool ThreadInterlockedAssignPointerToConstIf( void const * volatile *p, void const *value, void const *comperand ) { return ThreadInterlockedAssignPointerIf( const_cast < void * volatile * > ( p ), const_cast < void * > ( value ), const_cast < void * > ( comperand ) ); } -TT_INTERFACE int64 ThreadInterlockedIncrement64( int64 volatile * ); -TT_INTERFACE int64 ThreadInterlockedDecrement64( int64 volatile * ); -TT_INTERFACE int64 ThreadInterlockedCompareExchange64( int64 volatile *, int64 value, int64 comperand ); -TT_INTERFACE int64 ThreadInterlockedExchange64( int64 volatile *, int64 value ); -TT_INTERFACE int64 ThreadInterlockedExchangeAdd64( int64 volatile *, int64 value ); -TT_INTERFACE bool ThreadInterlockedAssignIf64(volatile int64 *pDest, int64 value, int64 comperand ); - -inline unsigned ThreadInterlockedExchangeSubtract( unsigned volatile *p, unsigned value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, value ); } -inline unsigned ThreadInterlockedIncrement( unsigned volatile *p ) { return ThreadInterlockedIncrement( (long volatile *)p ); } -inline unsigned ThreadInterlockedDecrement( unsigned volatile *p ) { return ThreadInterlockedDecrement( (long volatile *)p ); } -inline unsigned ThreadInterlockedExchange( unsigned volatile *p, unsigned value ) { return ThreadInterlockedExchange( (long volatile *)p, value ); } -inline unsigned ThreadInterlockedExchangeAdd( unsigned volatile *p, unsigned value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, value ); } -inline unsigned ThreadInterlockedCompareExchange( unsigned volatile *p, unsigned value, unsigned comperand ) { return ThreadInterlockedCompareExchange( (long volatile *)p, value, comperand ); } -inline bool ThreadInterlockedAssignIf( unsigned volatile *p, unsigned value, unsigned comperand ) { return ThreadInterlockedAssignIf( (long volatile *)p, value, comperand ); } - -inline int ThreadInterlockedExchangeSubtract( int volatile *p, int value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, value ); } -inline int ThreadInterlockedIncrement( int volatile *p ) { return ThreadInterlockedIncrement( (long volatile *)p ); } -inline int ThreadInterlockedDecrement( int volatile *p ) { return ThreadInterlockedDecrement( (long volatile *)p ); } -inline int ThreadInterlockedExchange( int volatile *p, int value ) { return ThreadInterlockedExchange( (long volatile *)p, value ); } -inline int ThreadInterlockedExchangeAdd( int volatile *p, int value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, value ); } -inline int ThreadInterlockedCompareExchange( int volatile *p, int value, int comperand ) { return ThreadInterlockedCompareExchange( (long volatile *)p, value, comperand ); } -inline bool ThreadInterlockedAssignIf( int volatile *p, int value, int comperand ) { return ThreadInterlockedAssignIf( (long volatile *)p, value, comperand ); } + +PLATFORM_INTERFACE int64 ThreadInterlockedCompareExchange64( int64 volatile *, int64 value, int64 comperand ) NOINLINE; +PLATFORM_INTERFACE bool ThreadInterlockedAssignIf64( volatile int64 *pDest, int64 value, int64 comperand ) NOINLINE; + +PLATFORM_INTERFACE int64 ThreadInterlockedExchange64( int64 volatile *, int64 value ) NOINLINE; +PLATFORM_INTERFACE int64 ThreadInterlockedIncrement64( int64 volatile * ) NOINLINE; +PLATFORM_INTERFACE int64 ThreadInterlockedDecrement64( int64 volatile * ) NOINLINE; +PLATFORM_INTERFACE int64 ThreadInterlockedExchangeAdd64( int64 volatile *, int64 value ) NOINLINE; + +inline unsigned ThreadInterlockedExchangeSubtract( uint32 volatile *p, uint32 value ) { return ThreadInterlockedExchangeAdd( (int32 volatile *)p, value ); } +inline unsigned ThreadInterlockedIncrement( uint32 volatile *p ) { return ThreadInterlockedIncrement( (int32 volatile *)p ); } +inline unsigned ThreadInterlockedDecrement( uint32 volatile *p ) { return ThreadInterlockedDecrement( (int32 volatile *)p ); } +inline unsigned ThreadInterlockedExchange( uint32 volatile *p, uint32 value ) { return ThreadInterlockedExchange( (int32 volatile *)p, value ); } +inline unsigned ThreadInterlockedExchangeAdd( uint32 volatile *p, uint32 value ) { return ThreadInterlockedExchangeAdd( (int32 volatile *)p, value ); } +inline unsigned ThreadInterlockedCompareExchange( uint32 volatile *p, uint32 value, uint32 comperand ) { return ThreadInterlockedCompareExchange( (int32 volatile *)p, value, comperand ); } +inline bool ThreadInterlockedAssignIf( uint32 volatile *p, uint32 value, uint32 comperand ) { return ThreadInterlockedAssignIf( (int32 volatile *)p, value, comperand ); } + +//inline int ThreadInterlockedExchangeSubtract( int volatile *p, int value ) { return ThreadInterlockedExchangeAdd( (int32 volatile *)p, value ); } +//inline int ThreadInterlockedIncrement( int volatile *p ) { return ThreadInterlockedIncrement( (int32 volatile *)p ); } +//inline int ThreadInterlockedDecrement( int volatile *p ) { return ThreadInterlockedDecrement( (int32 volatile *)p ); } +//inline int ThreadInterlockedExchange( int volatile *p, int value ) { return ThreadInterlockedExchange( (int32 volatile *)p, value ); } +//inline int ThreadInterlockedExchangeAdd( int volatile *p, int value ) { return ThreadInterlockedExchangeAdd( (int32 volatile *)p, value ); } +//inline int ThreadInterlockedCompareExchange( int volatile *p, int value, int comperand ) { return ThreadInterlockedCompareExchange( (int32 volatile *)p, value, comperand ); } +//inline bool ThreadInterlockedAssignIf( int volatile *p, int value, int comperand ) { return ThreadInterlockedAssignIf( (int32 volatile *)p, value, comperand ); } + //----------------------------------------------------------------------------- // Access to VTune thread profiling @@ -379,7 +429,7 @@ template class CInterlockedIntT { public: - CInterlockedIntT() : m_value( 0 ) { COMPILE_TIME_ASSERT( sizeof(T) == sizeof(long) ); } + CInterlockedIntT() : m_value( 0 ) { COMPILE_TIME_ASSERT( sizeof(T) == sizeof(int32) ); } CInterlockedIntT( T value ) : m_value( value ) {} operator T() const { return m_value; } @@ -388,17 +438,17 @@ class CInterlockedIntT bool operator==( T rhs ) const { return ( m_value == rhs ); } bool operator!=( T rhs ) const { return ( m_value != rhs ); } - T operator++() { return (T)ThreadInterlockedIncrement( (long *)&m_value ); } + T operator++() { return (T)ThreadInterlockedIncrement( (int32 *)&m_value ); } T operator++(int) { return operator++() - 1; } - T operator--() { return (T)ThreadInterlockedDecrement( (long *)&m_value ); } + T operator--() { return (T)ThreadInterlockedDecrement( (int32 *)&m_value ); } T operator--(int) { return operator--() + 1; } - bool AssignIf( T conditionValue, T newValue ) { return ThreadInterlockedAssignIf( (long *)&m_value, (long)newValue, (long)conditionValue ); } + bool AssignIf( T conditionValue, T newValue ) { return ThreadInterlockedAssignIf( (int32 *)&m_value, (int32)newValue, (int32)conditionValue ); } - T operator=( T newValue ) { ThreadInterlockedExchange((long *)&m_value, newValue); return m_value; } + T operator=( T newValue ) { ThreadInterlockedExchange((int32 *)&m_value, newValue); return m_value; } - void operator+=( T add ) { ThreadInterlockedExchangeAdd( (long *)&m_value, (long)add ); } + void operator+=( T add ) { ThreadInterlockedExchangeAdd( (int32 *)&m_value, (int32)add ); } void operator-=( T subtract ) { operator+=( -subtract ); } void operator*=( T multiplier ) { T original, result; @@ -433,7 +483,7 @@ template class CInterlockedPtr { public: - CInterlockedPtr() : m_value( 0 ) { COMPILE_TIME_ASSERT( sizeof(T *) == sizeof(long) ); /* Will need to rework operator+= for 64 bit */ } + CInterlockedPtr() : m_value( 0 ) { COMPILE_TIME_ASSERT( sizeof(T *) == sizeof(int32) ); /* Will need to rework operator+= for 64 bit */ } CInterlockedPtr( T *value ) : m_value( value ) {} operator T *() const { return m_value; } @@ -442,17 +492,17 @@ class CInterlockedPtr bool operator==( T *rhs ) const { return ( m_value == rhs ); } bool operator!=( T *rhs ) const { return ( m_value != rhs ); } - T *operator++() { return ((T *)ThreadInterlockedExchangeAdd( (long *)&m_value, sizeof(T) )) + 1; } - T *operator++(int) { return (T *)ThreadInterlockedExchangeAdd( (long *)&m_value, sizeof(T) ); } + T *operator++() { return ((T *)ThreadInterlockedExchangeAdd( (int32 *)&m_value, sizeof(T) )) + 1; } + T *operator++(int) { return (T *)ThreadInterlockedExchangeAdd( (int32 *)&m_value, sizeof(T) ); } - T *operator--() { return ((T *)ThreadInterlockedExchangeAdd( (long *)&m_value, -sizeof(T) )) - 1; } - T *operator--(int) { return (T *)ThreadInterlockedExchangeAdd( (long *)&m_value, -sizeof(T) ); } + T *operator--() { return ((T *)ThreadInterlockedExchangeAdd( (int32 *)&m_value, -sizeof(T) )) - 1; } + T *operator--(int) { return (T *)ThreadInterlockedExchangeAdd( (int32 *)&m_value, -sizeof(T) ); } bool AssignIf( T *conditionValue, T *newValue ) { return ThreadInterlockedAssignPointerToConstIf( (void const **) &m_value, (void const *) newValue, (void const *) conditionValue ); } T *operator=( T *newValue ) { ThreadInterlockedExchangePointerToConst( (void const **) &m_value, (void const *) newValue ); return newValue; } - void operator+=( int add ) { ThreadInterlockedExchangeAdd( (long *)&m_value, add * sizeof(T) ); } + void operator+=( int add ) { ThreadInterlockedExchangeAdd( (int32 *)&m_value, add * sizeof(T) ); } void operator-=( int subtract ) { operator+=( -subtract ); } T *operator+( int rhs ) const { return m_value + rhs; } diff --git a/public/tier1/refcount.h b/public/tier1/refcount.h index 16318b31d..4fb20a427 100644 --- a/public/tier1/refcount.h +++ b/public/tier1/refcount.h @@ -159,8 +159,8 @@ class CRefPtr : public CBaseAutoPtr class CRefMT { public: - static int Increment( int *p) { return ThreadInterlockedIncrement( (long *)p ); } - static int Decrement( int *p) { return ThreadInterlockedDecrement( (long *)p ); } + static int Increment( int *p) { return ThreadInterlockedIncrement( (int32 *)p ); } + static int Decrement( int *p) { return ThreadInterlockedDecrement( (int32 *)p ); } }; class CRefST From 5135706a5dc0ecdd4e0e0f128c86cea42c5070b0 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 21:05:47 -0300 Subject: [PATCH 06/24] recompile tier1 and mathlib --- .gitignore | 1 + lib/linux/mathlib_i486.a | Bin 208902 -> 250684 bytes lib/linux/tier1_i486.a | Bin 457170 -> 499438 bytes linux_sdk/Makefile | 3 ++- 4 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..19a2f036e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +linux_sdk/obj/ diff --git a/lib/linux/mathlib_i486.a b/lib/linux/mathlib_i486.a index 963b347ae45d0c3b59624e6676fedff9ddd0b16d..e84278f339746d2eab341c59b4c36d732a8f6bb7 100644 GIT binary patch literal 250684 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 z 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 Vn}&Nd?9%Xk4gJtTFujQy{vUpV6CVHo diff --git a/lib/linux/tier1_i486.a b/lib/linux/tier1_i486.a index 3e1cce21ece5ca69bb976d4b773142acdacf1487..b12705b8ec439021e596cffc5c51a7b5af376cc2 100644 GIT binary patch literal 499438 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 diff --git a/linux_sdk/Makefile b/linux_sdk/Makefile index 30c14ab6c..206d39c51 100644 --- a/linux_sdk/Makefile +++ b/linux_sdk/Makefile @@ -95,8 +95,9 @@ DEFINES +=-DGNUC -DPOSIX -D_POSIX -DVPROF_LEVEL=1 -DSWDS -D_finite=finite -Dstri -Dstrnicmp=strncasecmp -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp UNDEF = -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE -BASE_CFLAGS = -fno-strict-aliasing -Wall -Wsign-compare -Werror -Wno-conversion -Wno-overloaded-virtual -Wno-non-virtual-dtor -Wno-invalid-offsetof \ +BASE_CFLAGS = -fno-strict-aliasing -Wall -Wsign-compare -Wno-conversion -Wno-overloaded-virtual -Wno-non-virtual-dtor -Wno-invalid-offsetof \ -Wno-delete-non-virtual-dtor +BASE_CFLAGS += -Wno-class-memaccess -Wno-unknown-pragmas -Wno-narrowing -fpermissive SHLIBCFLAGS = -fPIC # Flags passed to the c compiler From ab89377316b40a969bed057bd0f2909d52770d6a Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 21:29:16 -0300 Subject: [PATCH 07/24] add bone_setup.cpp --- public/bone_setup.cpp | 653 +++++++++++++++++++++++++++------------ public/mathlib/mathlib.h | 11 + public/tier0/platform.h | 25 ++ 3 files changed, 489 insertions(+), 200 deletions(-) diff --git a/public/bone_setup.cpp b/public/bone_setup.cpp index 00aa3de86..835f284ee 100644 --- a/public/bone_setup.cpp +++ b/public/bone_setup.cpp @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -28,6 +28,23 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +class CBoneSetup +{ +public: + CBoneSetup( const CStudioHdr *pStudioHdr, int boneMask, const float poseParameter[], IPoseDebugger *pPoseDebugger = NULL ); + void InitPose( Vector pos[], Quaternion q[] ); + void AccumulatePose( Vector pos[], Quaternion q[], int sequence, float cycle, float flWeight, float flTime, CIKContext *pIKContext ); + void CalcAutoplaySequences( Vector pos[], Quaternion q[], float flRealTime, CIKContext *pIKContext ); +private: + void AddSequenceLayers( Vector pos[], Quaternion q[], mstudioseqdesc_t &seqdesc, int sequence, float cycle, float flWeight, float flTime, CIKContext *pIKContext ); + void AddLocalLayers( Vector pos[], Quaternion q[], mstudioseqdesc_t &seqdesc, int sequence, float cycle, float flWeight, float flTime, CIKContext *pIKContext ); +public: + const CStudioHdr *m_pStudioHdr; + int m_boneMask; + const float *m_flPoseParameter; + IPoseDebugger *m_pPoseDebugger; +}; + // ----------------------------------------------------------------- template class CBoneSetupMemoryPool @@ -40,7 +57,9 @@ class CBoneSetupMemoryPool { p = new T[MAXSTUDIOBONES]; if ( ((size_t)p) % TSLIST_NODE_ALIGNMENT != 0 ) + { DebuggerBreak(); + } } return p; @@ -57,7 +76,7 @@ class CBoneSetupMemoryPool CBoneSetupMemoryPool g_QaternionPool; CBoneSetupMemoryPool g_VectorPool; -CBoneSetupMemoryPool g_MatrixPool; +CBoneSetupMemoryPool g_MatrixPool; // ----------------------------------------------------------------- CBoneCache *CBoneCache::CreateResource( const bonecacheparams_t ¶ms ) @@ -138,7 +157,7 @@ void CBoneCache::UpdateBones( const matrix3x4_t *pBoneToWorld, int numbones, flo m_timeValid = curtime; } -matrix3x4_t *CBoneCache::GetCachedBone( int studioIndex ) +matrix3x4a_t *CBoneCache::GetCachedBone( int studioIndex ) { int cachedIndex = StudioToCached()[studioIndex]; if ( cachedIndex >= 0 ) @@ -178,9 +197,9 @@ bool CBoneCache::IsValid( float curtime, float dt ) // private functions -matrix3x4_t *CBoneCache::BoneArray() +matrix3x4a_t *CBoneCache::BoneArray() { - return (matrix3x4_t *)( (char *)(this+1) + m_matrixOffset ); + return (matrix3x4a_t *)( (char *)(this+1) + m_matrixOffset ); } short *CBoneCache::StudioToCached() @@ -194,7 +213,7 @@ short *CBoneCache::CachedToStudio() } // Construct a singleton -static CDataManager g_StudioBoneCache( 24 * 1024L ); +static CDataManager g_StudioBoneCache( 128 * 1024L ); CBoneCache *Studio_GetBoneCache( memhandle_t cacheHandle ) { @@ -230,11 +249,11 @@ void Studio_InvalidateBoneCache( memhandle_t cacheHandle ) void BuildBoneChain( const CStudioHdr *pStudioHdr, - const matrix3x4_t &rootxform, + const matrix3x4a_t &rootxform, const Vector pos[], const Quaternion q[], int iBone, - matrix3x4_t *pBoneToWorld ) + matrix3x4a_t *pBoneToWorld ) { CBoneBitList boneComputed; BuildBoneChain( pStudioHdr, rootxform, pos, q, iBone, pBoneToWorld, boneComputed ); @@ -355,7 +374,7 @@ void ExtractAnimValue( int frame, mstudioanimvalue_t *panimvalue, float scale, f void CalcBoneQuaternion( int frame, float s, const Quaternion &baseQuat, const RadianEuler &baseRot, const Vector &baseRotScale, int iBaseFlags, const Quaternion &baseAlignment, - const mstudioanim_t *panim, Quaternion &q ) + const mstudio_rle_anim_t *panim, Quaternion &q ) { if ( panim->flags & STUDIO_ANIM_RAWROT ) { @@ -457,7 +476,7 @@ void CalcBoneQuaternion( int frame, float s, inline void CalcBoneQuaternion( int frame, float s, const mstudiobone_t *pBone, const mstudiolinearbone_t *pLinearBones, - const mstudioanim_t *panim, Quaternion &q ) + const mstudio_rle_anim_t *panim, Quaternion &q ) { if (pLinearBones) { @@ -478,7 +497,7 @@ inline void CalcBoneQuaternion( int frame, float s, //----------------------------------------------------------------------------- void CalcBonePosition( int frame, float s, const Vector &basePos, const Vector &baseBoneScale, - const mstudioanim_t *panim, Vector &pos ) + const mstudio_rle_anim_t *panim, Vector &pos ) { if (panim->flags & STUDIO_ANIM_RAWPOS) { @@ -534,7 +553,7 @@ void CalcBonePosition( int frame, float s, inline void CalcBonePosition( int frame, float s, const mstudiobone_t *pBone, const mstudiolinearbone_t *pLinearBones, - const mstudioanim_t *panim, Vector &pos ) + const mstudio_rle_anim_t *panim, Vector &pos ) { if (pLinearBones) { @@ -558,7 +577,7 @@ void SetupSingleBoneMatrix( mstudioseqdesc_t &seqdesc = pOwnerHdr->pSeqdesc( nSequence ); mstudioanimdesc_t &animdesc = pOwnerHdr->pAnimdesc( seqdesc.anim( 0, 0 ) ); int iLocalFrame = iFrame; - mstudioanim_t *panim = animdesc.pAnim( &iLocalFrame ); + mstudio_rle_anim_t *panim = (mstudio_rle_anim_t *)animdesc.pAnim( &iLocalFrame ); float s = 0; mstudiobone_t *pbone = pOwnerHdr->pBone( iBone ); @@ -644,7 +663,7 @@ static void CalcDecompressedAnimation( const mstudiocompressedikerror_t *pCompre //----------------------------------------------------------------------------- static void CalcLocalHierarchyAnimation( const CStudioHdr *pStudioHdr, - matrix3x4_t *boneToWorld, + matrix3x4a_t *boneToWorld, CBoneBitList &boneComputed, Vector *pos, Quaternion *q, @@ -659,11 +678,17 @@ static void CalcLocalHierarchyAnimation( int boneMask ) { +#ifdef STAGING_ONLY + Assert( iNewParent == -1 || (iNewParent >= 0 && iNewParent < MAXSTUDIOBONES) ); + Assert( iBone > 0 ); + Assert( iBone < MAXSTUDIOBONES ); +#endif // STAGING_ONLY + Vector localPos; Quaternion localQ; // make fake root transform - static matrix3x4_t rootXform( 1.0f, 0, 0, 0, 0, 1.0f, 0, 0, 0, 0, 1.0f, 0 ); + static ALIGN16 matrix3x4a_t rootXform ALIGN16_POST ( 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f ); // FIXME: missing check to see if seq has a weight for this bone float weight = 1.0f; @@ -696,12 +721,19 @@ static void CalcLocalHierarchyAnimation( CalcDecompressedAnimation( pHierarchy->pLocalAnim(), iFrame - pHierarchy->iStart, flFraq, localPos, localQ ); BuildBoneChain( pStudioHdr, rootXform, pos, q, iBone, boneToWorld, boneComputed ); - BuildBoneChain( pStudioHdr, rootXform, pos, q, iNewParent, boneToWorld, boneComputed ); matrix3x4_t localXform; AngleMatrix( localQ, localPos, localXform ); - ConcatTransforms( boneToWorld[iNewParent], localXform, boneToWorld[iBone] ); + if ( iNewParent != -1 ) + { + BuildBoneChain( pStudioHdr, rootXform, pos, q, iNewParent, boneToWorld, boneComputed ); + ConcatTransforms( boneToWorld[iNewParent], localXform, boneToWorld[iBone] ); + } + else + { + boneToWorld[iBone] = localXform; + } // back solve Vector p1; @@ -775,7 +807,7 @@ static void CalcZeroframeData( const CStudioHdr *pStudioHdr, const studiohdr_t * } pData += sizeof( Vector48 ); } - if (pAnimbone[j].flags & BONE_HAS_SAVEFRAME_ROT) + if (pAnimbone[j].flags & BONE_HAS_SAVEFRAME_ROT64) { if ((i >= 0) && (pStudioHdr->boneFlags(i) & boneMask)) { @@ -790,7 +822,7 @@ static void CalcZeroframeData( const CStudioHdr *pStudioHdr, const studiohdr_t * else { float s1; - int index = (int)(fFrame / animdesc.zeroframespan); + int index = fFrame / animdesc.zeroframespan; if (index >= animdesc.zeroframecount - 1) { index = animdesc.zeroframecount - 2; @@ -800,9 +832,9 @@ static void CalcZeroframeData( const CStudioHdr *pStudioHdr, const studiohdr_t * { s1 = clamp( (fFrame - index * animdesc.zeroframespan) / animdesc.zeroframespan, 0.0f, 1.0f ); } - int i0 = MAX( index - 1, 0 ); + int i0 = max( index - 1, 0 ); int i1 = index; - int i2 = MIN( index + 1, animdesc.zeroframecount - 1 ); + int i2 = min( index + 1, animdesc.zeroframecount - 1 ); for (j = 0; j < pAnimStudioHdr->numbones; j++) { if (pAnimGroup) @@ -824,7 +856,7 @@ static void CalcZeroframeData( const CStudioHdr *pStudioHdr, const studiohdr_t * } pData += sizeof( Vector48 ) * animdesc.zeroframecount; } - if (pAnimbone[j].flags & BONE_HAS_SAVEFRAME_ROT) + if (pAnimbone[j].flags & BONE_HAS_SAVEFRAME_ROT64) { if ((i >= 0) && (pStudioHdr->boneFlags(i) & boneMask)) { @@ -865,7 +897,7 @@ static void CalcVirtualAnimation( virtualmodel_t *pVModel, const CStudioHdr *pSt const studiohdr_t *pSeqStudioHdr; const mstudiolinearbone_t *pSeqLinearBones; const mstudiobone_t *pSeqbone; - const mstudioanim_t *panim; + const mstudio_rle_anim_t *panim; const studiohdr_t *pAnimStudioHdr; const mstudiolinearbone_t *pAnimLinearBones; const mstudiobone_t *pAnimbone; @@ -873,12 +905,12 @@ static void CalcVirtualAnimation( virtualmodel_t *pVModel, const CStudioHdr *pSt pSeqGroup = pVModel->pSeqGroup( sequence ); int baseanimation = pStudioHdr->iRelativeAnim( sequence, animation ); - mstudioanimdesc_t &animdesc = pStudioHdr->pAnimdesc( baseanimation ); - pSeqStudioHdr = pStudioHdr->pSeqStudioHdr( sequence ); + mstudioanimdesc_t &animdesc = ((CStudioHdr *)pStudioHdr)->pAnimdesc( baseanimation ); + pSeqStudioHdr = ((CStudioHdr *)pStudioHdr)->pSeqStudioHdr( sequence ); pSeqLinearBones = pSeqStudioHdr->pLinearBones(); pSeqbone = pSeqStudioHdr->pBone( 0 ); pAnimGroup = pVModel->pAnimGroup( baseanimation ); - pAnimStudioHdr = pStudioHdr->pAnimStudioHdr( baseanimation ); + pAnimStudioHdr = ((CStudioHdr *)pStudioHdr)->pAnimStudioHdr( baseanimation ); pAnimLinearBones = pAnimStudioHdr->pLinearBones(); pAnimbone = pAnimStudioHdr->pBone( 0 ); @@ -892,7 +924,7 @@ static void CalcVirtualAnimation( virtualmodel_t *pVModel, const CStudioHdr *pSt int iLocalFrame = iFrame; float flStall; - panim = animdesc.pAnim( &iLocalFrame, flStall ); + panim = (mstudio_rle_anim_t *)animdesc.pAnim( &iLocalFrame, flStall ); float *pweight = seqdesc.pBoneweight( 0 ); pbone = pStudioHdr->pBone( 0 ); @@ -929,7 +961,7 @@ static void CalcVirtualAnimation( virtualmodel_t *pVModel, const CStudioHdr *pSt // if the animation isn't available, look for the zero frame cache if (!panim) { - CalcZeroframeData( pStudioHdr, pAnimStudioHdr, pAnimGroup, pAnimbone, animdesc, fFrame, pos, q, boneMask, 1.0 ); + CalcZeroframeData( ((CStudioHdr *)pStudioHdr), pAnimStudioHdr, pAnimGroup, pAnimbone, animdesc, fFrame, pos, q, boneMask, 1.0 ); return; } @@ -962,7 +994,7 @@ static void CalcVirtualAnimation( virtualmodel_t *pVModel, const CStudioHdr *pSt // calculate a local hierarchy override if (animdesc.numlocalhierarchy) { - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int i; @@ -976,10 +1008,17 @@ static void CalcVirtualAnimation( virtualmodel_t *pVModel, const CStudioHdr *pSt int iBone = pAnimGroup->masterBone[pHierarchy->iBone]; if (iBone >= 0 && (pStudioHdr->boneFlags(iBone) & boneMask)) { - int iNewParent = pAnimGroup->masterBone[pHierarchy->iNewParent]; - if (iNewParent >= 0 && (pStudioHdr->boneFlags(iNewParent) & boneMask)) + if ( pHierarchy->iNewParent != -1 ) { - CalcLocalHierarchyAnimation( pStudioHdr, boneToWorld, boneComputed, pos, q, pbone, pHierarchy, iBone, iNewParent, cycle, iFrame, s, boneMask ); + int iNewParent = pAnimGroup->masterBone[pHierarchy->iNewParent]; + if (iNewParent >= 0 && (pStudioHdr->boneFlags(iNewParent) & boneMask)) + { + CalcLocalHierarchyAnimation( pStudioHdr, boneToWorld, boneComputed, pos, q, pbone, pHierarchy, iBone, iNewParent, cycle, iFrame, s, boneMask ); + } + } + else + { + CalcLocalHierarchyAnimation( pStudioHdr, boneToWorld, boneComputed, pos, q, pbone, pHierarchy, iBone, -1, cycle, iFrame, s, boneMask ); } } } @@ -1011,7 +1050,7 @@ static void CalcAnimation( const CStudioHdr *pStudioHdr, Vector *pos, Quaternion return; } - mstudioanimdesc_t &animdesc = pStudioHdr->pAnimdesc( animation ); + mstudioanimdesc_t &animdesc = ((CStudioHdr *)pStudioHdr)->pAnimdesc( animation ); mstudiobone_t *pbone = pStudioHdr->pBone( 0 ); const mstudiolinearbone_t *pLinearBones = pStudioHdr->pLinearBones(); @@ -1026,7 +1065,7 @@ static void CalcAnimation( const CStudioHdr *pStudioHdr, Vector *pos, Quaternion int iLocalFrame = iFrame; float flStall; - mstudioanim_t *panim = animdesc.pAnim( &iLocalFrame, flStall ); + mstudio_rle_anim_t *panim = (mstudio_rle_anim_t *)animdesc.pAnim( &iLocalFrame, flStall ); float *pweight = seqdesc.pBoneweight( 0 ); @@ -1099,7 +1138,7 @@ static void CalcAnimation( const CStudioHdr *pStudioHdr, Vector *pos, Quaternion if (animdesc.numlocalhierarchy) { - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int i; @@ -1228,17 +1267,17 @@ void WorldSpaceSlerp( float s2; // weight for q2, pos2 // make fake root transform - matrix3x4_t rootXform; + matrix3x4a_t rootXform; SetIdentityMatrix( rootXform ); // matrices for q2, pos2 - matrix3x4_t *srcBoneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *srcBoneToWorld = g_MatrixPool.Alloc(); CBoneBitList srcBoneComputed; - matrix3x4_t *destBoneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *destBoneToWorld = g_MatrixPool.Alloc(); CBoneBitList destBoneComputed; - matrix3x4_t *targetBoneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *targetBoneToWorld = g_MatrixPool.Alloc(); CBoneBitList targetBoneComputed; virtualmodel_t *pVModel = pStudioHdr->GetVirtualModel(); @@ -1314,10 +1353,10 @@ void WorldSpaceSlerp( } else { - matrix3x4_t worldToBone; + matrix3x4a_t worldToBone; MatrixInvert( targetBoneToWorld[n], worldToBone ); - matrix3x4_t local; + matrix3x4a_t local; ConcatTransforms( worldToBone, targetBoneToWorld[i], local ); MatrixAngles( local, q1[i], tmp ); @@ -1607,7 +1646,7 @@ void ScaleBones( int i, j; Quaternion q3; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( sequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( sequence ); virtualmodel_t *pVModel = pStudioHdr->GetVirtualModel(); const virtualgroup_t *pSeqGroup = NULL; @@ -1658,7 +1697,7 @@ void Studio_LocalPoseParameter( const CStudioHdr *pStudioHdr, const float posePa return; } - const mstudioposeparamdesc_t &Pose = pStudioHdr->pPoseParameter( iPose ); + const mstudioposeparamdesc_t &Pose = ((CStudioHdr *)pStudioHdr)->pPoseParameter( iPose ); float flValue = poseParameter[iPose]; @@ -1786,7 +1825,7 @@ inline bool PoseIsAllZeros( // remove "zero" positional blends baseanim = pStudioHdr->iRelativeAnim( sequence, seqdesc.anim(i0 ,i1 ) ); - mstudioanimdesc_t &anim = pStudioHdr->pAnimdesc( baseanim ); + mstudioanimdesc_t &anim = ((CStudioHdr *)pStudioHdr)->pAnimdesc( baseanim ); return (anim.flags & STUDIO_ALLZEROS) != 0; } @@ -1902,7 +1941,7 @@ bool CalcPoseSingle( if (sequence >= pStudioHdr->GetNumSeq()) { sequence = 0; - seqdesc = pStudioHdr->pSeqdesc( sequence ); + seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( sequence ); } @@ -1925,7 +1964,7 @@ bool CalcPoseSingle( if (iPose != -1) { /* - const mstudioposeparamdesc_t &Pose = pStudioHdr->pPoseParameter( iPose ); + const mstudioposeparamdesc_t &Pose = ((CStudioHdr *)pStudioHdr)->pPoseParameter( iPose ); cycle = poseParameter[ iPose ] * (Pose.end - Pose.start) + Pose.start; */ cycle = poseParameter[ iPose ]; @@ -2083,19 +2122,16 @@ bool CalcPoseSingle( // Purpose: calculate a pose for a single sequence // adds autolayers, runs local ik rukes //----------------------------------------------------------------------------- -void AddSequenceLayers( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, - Vector pos[], - Quaternion q[], - mstudioseqdesc_t &seqdesc, - int sequence, - float cycle, - const float poseParameter[], - int boneMask, - float flWeight, - float flTime - ) +void CBoneSetup::AddSequenceLayers( + Vector pos[], + Quaternion q[], + mstudioseqdesc_t &seqdesc, + int sequence, + float cycle, + float flWeight, + float flTime, + CIKContext *pIKContext + ) { for (int i = 0; i < seqdesc.numautolayers; i++) { @@ -2118,12 +2154,12 @@ void AddSequenceLayers( } else { - int iSequence = pStudioHdr->iRelativeSeq( sequence, pLayer->iSequence ); - int iPose = pStudioHdr->GetSharedPoseParameter( iSequence, pLayer->iPose ); + int iSequence = m_pStudioHdr->iRelativeSeq( sequence, pLayer->iSequence ); + int iPose = m_pStudioHdr->GetSharedPoseParameter( iSequence, pLayer->iPose ); if (iPose != -1) { - const mstudioposeparamdesc_t &Pose = pStudioHdr->pPoseParameter( iPose ); - index = poseParameter[ iPose ] * (Pose.end - Pose.start) + Pose.start; + const mstudioposeparamdesc_t &Pose = ((CStudioHdr *)m_pStudioHdr)->pPoseParameter( iPose ); + index = m_flPoseParameter[ iPose ] * (Pose.end - Pose.start) + Pose.start; } else { @@ -2169,8 +2205,8 @@ void AddSequenceLayers( } } - int iSequence = pStudioHdr->iRelativeSeq( sequence, pLayer->iSequence ); - AccumulatePose( pStudioHdr, pIKContext, pos, q, iSequence, layerCycle, poseParameter, boneMask, layerWeight, flTime ); + int iSequence = m_pStudioHdr->iRelativeSeq( sequence, pLayer->iSequence ); + AccumulatePose( pos, q, iSequence, layerCycle, layerWeight, flTime, pIKContext ); } } @@ -2179,18 +2215,15 @@ void AddSequenceLayers( // Purpose: calculate a pose for a single sequence // adds autolayers, runs local ik rukes //----------------------------------------------------------------------------- -void AddLocalLayers( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, +void CBoneSetup::AddLocalLayers( Vector pos[], Quaternion q[], mstudioseqdesc_t &seqdesc, int sequence, float cycle, - const float poseParameter[], - int boneMask, float flWeight, - float flTime + float flTime, + CIKContext *pIKContext ) { if (!(seqdesc.flags & STUDIO_LOCAL)) @@ -2247,11 +2280,65 @@ void AddLocalLayers( layerCycle = (cycle - pLayer->start) / (pLayer->end - pLayer->start); } - int iSequence = pStudioHdr->iRelativeSeq( sequence, pLayer->iSequence ); - AccumulatePose( pStudioHdr, pIKContext, pos, q, iSequence, layerCycle, poseParameter, boneMask, layerWeight, flTime ); + int iSequence = m_pStudioHdr->iRelativeSeq( sequence, pLayer->iSequence ); + AccumulatePose( pos, q, iSequence, layerCycle, layerWeight, flTime, pIKContext ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: my sleezy attempt at an interface only class +//----------------------------------------------------------------------------- + +IBoneSetup::IBoneSetup( const CStudioHdr *pStudioHdr, int boneMask, const float poseParameter[], IPoseDebugger *pPoseDebugger ) +{ + m_pBoneSetup = new CBoneSetup( pStudioHdr, boneMask, poseParameter, pPoseDebugger ); +} + +IBoneSetup::~IBoneSetup( void ) +{ + if ( m_pBoneSetup ) + { + delete m_pBoneSetup; } } +void IBoneSetup::InitPose( Vector pos[], QuaternionAligned q[] ) +{ + ::InitPose( m_pBoneSetup->m_pStudioHdr, pos, q, m_pBoneSetup->m_boneMask ); +} + +void IBoneSetup::AccumulatePose( Vector pos[], Quaternion q[], int sequence, float cycle, float flWeight, float flTime, CIKContext *pIKContext ) +{ + m_pBoneSetup->AccumulatePose( pos, q, sequence, cycle, flWeight, flTime, pIKContext ); +} + +void IBoneSetup::CalcAutoplaySequences( Vector pos[], Quaternion q[], float flRealTime, CIKContext *pIKContext ) +{ + m_pBoneSetup->CalcAutoplaySequences( pos, q, flRealTime, pIKContext ); +} + +void CalcBoneAdj( const CStudioHdr *pStudioHdr, Vector pos[], Quaternion q[], const float controllers[], int boneMask ); + +// takes a "controllers[]" array normalized to 0..1 and adds in the adjustments to pos[], and q[]. +void IBoneSetup::CalcBoneAdj( Vector pos[], Quaternion q[], const float controllers[] ) +{ + ::CalcBoneAdj( m_pBoneSetup->m_pStudioHdr, pos, q, controllers, m_pBoneSetup->m_boneMask ); +} + +CStudioHdr *IBoneSetup::GetStudioHdr() +{ + return (CStudioHdr *)m_pBoneSetup->m_pStudioHdr; +} + +CBoneSetup::CBoneSetup( const CStudioHdr *pStudioHdr, int boneMask, const float poseParameter[], IPoseDebugger *pPoseDebugger ) +{ + m_pStudioHdr = pStudioHdr; + m_boneMask = boneMask; + m_flPoseParameter = poseParameter; + m_pPoseDebugger = pPoseDebugger; +} + +#if 0 //----------------------------------------------------------------------------- // Purpose: calculate a pose for a single sequence // adds autolayers, runs local ik rukes @@ -2269,7 +2356,7 @@ void CalcPose( float flTime ) { - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( sequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( sequence ); Assert( flWeight >= 0.0f && flWeight <= 1.0f ); // This shouldn't be necessary, but the Assert should help us catch whoever is screwing this up @@ -2297,23 +2384,20 @@ void CalcPose( seq_ik.SolveSequenceLocks( seqdesc, pos, q ); } } - +#endif //----------------------------------------------------------------------------- // Purpose: accumulate a pose for a single sequence on top of existing animation // adds autolayers, runs local ik rukes //----------------------------------------------------------------------------- -void AccumulatePose( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, +void CBoneSetup::AccumulatePose( Vector pos[], Quaternion q[], int sequence, float cycle, - const float poseParameter[], - int boneMask, float flWeight, - float flTime + float flTime, + CIKContext *pIKContext ) { Vector pos2[MAXSTUDIOBONES]; @@ -2328,37 +2412,41 @@ void AccumulatePose( #ifdef CLIENT_DLL // Trigger pose debugger - g_pPoseDebugger->AccumulatePose( pStudioHdr, pIKContext, pos, q, sequence, cycle, poseParameter, boneMask, flWeight, flTime ); + if (m_pPoseDebugger) + { + m_pPoseDebugger->AccumulatePose( m_pStudioHdr, pIKContext, pos, q, sequence, cycle, m_flPoseParameter, m_boneMask, flWeight, flTime ); + } #endif - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( sequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)m_pStudioHdr)->pSeqdesc( sequence ); // add any IK locks to prevent extremities from moving CIKContext seq_ik; if (seqdesc.numiklocks) { - seq_ik.Init( pStudioHdr, vec3_angle, vec3_origin, 0.0, 0, boneMask ); // local space relative so absolute position doesn't mater + seq_ik.Init( m_pStudioHdr, vec3_angle, vec3_origin, 0.0, 0, m_boneMask ); // local space relative so absolute position doesn't mater seq_ik.AddSequenceLocks( seqdesc, pos, q ); } if (seqdesc.flags & STUDIO_LOCAL) { - InitPose( pStudioHdr, pos2, q2, boneMask ); + ::InitPose( m_pStudioHdr, pos2, q2, m_boneMask ); } - if (CalcPoseSingle( pStudioHdr, pos2, q2, seqdesc, sequence, cycle, poseParameter, boneMask, flTime )) + if (CalcPoseSingle( m_pStudioHdr, pos2, q2, seqdesc, sequence, cycle, m_flPoseParameter, m_boneMask, flTime )) { // this weight is wrong, the IK rules won't composite at the correct intensity - AddLocalLayers( pStudioHdr, pIKContext, pos2, q2, seqdesc, sequence, cycle, poseParameter, boneMask, 1.0, flTime ); - SlerpBones( pStudioHdr, q, pos, seqdesc, sequence, q2, pos2, flWeight, boneMask ); + AddLocalLayers( pos2, q2, seqdesc, sequence, cycle, 1.0, flTime, pIKContext ); + SlerpBones( m_pStudioHdr, q, pos, seqdesc, sequence, q2, pos2, flWeight, m_boneMask ); } + if ( pIKContext ) { - pIKContext->AddDependencies( seqdesc, sequence, cycle, poseParameter, flWeight ); + pIKContext->AddDependencies( seqdesc, sequence, cycle, m_flPoseParameter, flWeight ); } - AddSequenceLayers( pStudioHdr, pIKContext, pos, q, seqdesc, sequence, cycle, poseParameter, boneMask, flWeight, flTime ); + AddSequenceLayers( pos, q, seqdesc, sequence, cycle, flWeight, flTime, pIKContext ); if (seqdesc.numiklocks) { @@ -2600,7 +2688,7 @@ void debugLine(const Vector& origin, const Vector& dest, int r, int g, int b, bo //----------------------------------------------------------------------------- // Purpose: for a 2 bone chain, find the IK solution and reset the matrices //----------------------------------------------------------------------------- -bool Studio_SolveIK( mstudioikchain_t *pikchain, Vector &targetFoot, matrix3x4_t *pBoneToWorld ) +bool Studio_SolveIK( mstudioikchain_t *pikchain, Vector &targetFoot, matrix3x4a_t *pBoneToWorld ) { if (pikchain->pLink(0)->kneeDir.LengthSqr() > 0.0) { @@ -2624,7 +2712,7 @@ bool Studio_SolveIK( mstudioikchain_t *pikchain, Vector &targetFoot, matrix3x4_t // Purpose: Solve Knee position for a known hip and foot location, but no specific knee direction preference //----------------------------------------------------------------------------- -bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, matrix3x4_t *pBoneToWorld ) +bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, matrix3x4a_t *pBoneToWorld ) { Vector worldFoot, worldKnee, worldThigh; @@ -2710,8 +2798,8 @@ bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vecto // exaggerate knee targets for legs that are nearly straight // FIXME: should be configurable, and the ikKnee should be from the original animation, not modifed - float d = (targetFoot-worldThigh).Length() - MIN( l1, l2 ); - d = MAX( l1 + l2, d ); + float d = (targetFoot-worldThigh).Length() - min( l1, l2 ); + d = max( l1 + l2, d ); // FIXME: too short knee directions cause trouble d = d * 100; @@ -2731,7 +2819,7 @@ bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vecto // too close? // limit distance to about an 80 degree knee bend - float minDist = MAX( fabs(l1 - l2) * 1.15, MIN( l1, l2 ) * 0.15 ); + float minDist = max( fabs(l1 - l2) * 1.15, min( l1, l2 ) * 0.15 ); if (ikFoot.Length() < minDist) { // too close to get an accurate vector, just use original vector @@ -3195,7 +3283,7 @@ void CIKContext::AddDependencies( mstudioseqdesc_t &seqdesc, int iSequence, floa } else { - flCycle = MAX( 0.0, MIN( flCycle, 0.9999 ) ); + flCycle = max( 0.0, min( flCycle, 0.9999 ) ); } } @@ -3261,7 +3349,7 @@ void CIKContext::AddAutoplayLocks( Vector pos[], Quaternion q[] ) return; } - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int ikOffset = m_ikLock.AddMultipleToTail( m_pStudioHdr->GetNumIKAutoplayLocks() ); @@ -3269,7 +3357,7 @@ void CIKContext::AddAutoplayLocks( Vector pos[], Quaternion q[] ) for (int i = 0; i < m_pStudioHdr->GetNumIKAutoplayLocks(); i++) { - const mstudioiklock_t &lock = m_pStudioHdr->pIKAutoplayLock( i ); + const mstudioiklock_t &lock = ((CStudioHdr *)m_pStudioHdr)->pIKAutoplayLock( i ); mstudioikchain_t *pchain = m_pStudioHdr->pIKChain( lock.chain ); int bone = pchain->pLink( 2 )->bone; @@ -3320,7 +3408,7 @@ void CIKContext::AddSequenceLocks( mstudioseqdesc_t &seqdesc, Vector pos[], Quat return; } - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int ikOffset = m_ikLock.AddMultipleToTail( seqdesc.numiklocks ); @@ -3366,7 +3454,7 @@ void CIKContext::BuildBoneChain( const Vector pos[], const Quaternion q[], int iBone, - matrix3x4_t *pBoneToWorld, + matrix3x4a_t *pBoneToWorld, CBoneBitList &boneComputed ) { Assert( m_pStudioHdr->boneFlags( iBone ) & m_boneMask ); @@ -3624,7 +3712,7 @@ void CIKContext::ClearTargets( void ) // transform into a pos and q in parents bonespace //----------------------------------------------------------------------------- -void CIKContext::UpdateTargets( Vector pos[], Quaternion q[], matrix3x4_t boneToWorld[], CBoneBitList &boneComputed ) +void CIKContext::UpdateTargets( Vector pos[], Quaternion q[], matrix3x4a_t boneToWorld[], CBoneBitList &boneComputed ) { int i, j; @@ -3689,7 +3777,7 @@ void CIKContext::UpdateTargets( Vector pos[], Quaternion q[], matrix3x4_t boneTo pTarget->est.floor = Lerp( pRule->flRuleWeight, pTarget->est.floor, pRule->floor ); pTarget->est.radius = Lerp( pRule->flRuleWeight, pTarget->est.radius, pRule->radius ); //pTarget->est.latched = Lerp( pRule->flRuleWeight, pTarget->est.latched, pRule->latched ); - pTarget->est.latched = MIN( pTarget->est.latched, pRule->latched ); + pTarget->est.latched = min( pTarget->est.latched, pRule->latched ); pTarget->est.release = Lerp( pRule->flRuleWeight, pTarget->est.release, pRule->release ); pTarget->est.flWeight = Lerp( pRule->flRuleWeight, pTarget->est.flWeight, pRule->flWeight ); } @@ -3707,7 +3795,7 @@ void CIKContext::UpdateTargets( Vector pos[], Quaternion q[], matrix3x4_t boneTo if (pRule->latched > 0.0) pTarget->est.latched = 0.0; else - pTarget->est.latched = MIN( pTarget->est.latched, 1.0f - pRule->flWeight ); + pTarget->est.latched = min( pTarget->est.latched, 1.0f - pRule->flWeight ); } break; case IK_RELEASE: @@ -3716,7 +3804,7 @@ void CIKContext::UpdateTargets( Vector pos[], Quaternion q[], matrix3x4_t boneTo if (pRule->latched > 0.0) pTarget->est.latched = 0.0; else - pTarget->est.latched = MIN( pTarget->est.latched, 1.0f - pRule->flWeight ); + pTarget->est.latched = min( pTarget->est.latched, 1.0f - pRule->flWeight ); pTarget->est.flWeight = (pTarget->est.flWeight) * (1 - pRule->flWeight * pRule->flRuleWeight); } @@ -3882,40 +3970,23 @@ void CIKContext::AutoIKRelease( void ) float ft = m_flTime - pTarget->error.flErrorTime; if (dt < 0.25) { - pTarget->error.ramp = MIN( pTarget->error.ramp + ft * 4.0, 1.0 ); + pTarget->error.ramp = min( pTarget->error.ramp + ft * 4.0, 1.0 ); } else { - pTarget->error.ramp = MAX( pTarget->error.ramp - ft * 4.0, 0.0 ); + pTarget->error.ramp = max( pTarget->error.ramp - ft * 4.0, 0.0 ); } if (pTarget->error.ramp > 0.0) { ikcontextikrule_t ikrule; - ikrule.index = -1; ikrule.chain = pTarget->chain; ikrule.bone = 0; ikrule.type = IK_RELEASE; ikrule.slot = i; - ikrule.height = 0.0f; - ikrule.radius = 0.0f; - ikrule.floor = 0.0f; - ikrule.pos = Vector(0.0f, 0.0f, 0.0f); - ikrule.q = Quaternion(0.0f, 0.0f, 0.0f, 0.0f); - ikrule.start = 0.0f; - ikrule.peak = 0.0f; - ikrule.tail = 0.0f; - ikrule.end = 0.0f; - ikrule.top = 0.0f; - ikrule.drop = 0.0f; - ikrule.commit = 0.0f; - ikrule.release = 0.0f; ikrule.flWeight = SimpleSpline( pTarget->error.ramp ); ikrule.flRuleWeight = 1.0; ikrule.latched = dt < 0.25 ? 0.0 : ikrule.flWeight; - ikrule.szLabel = NULL; - ikrule.kneeDir = Vector(0.0f, 0.0f, 0.0f); - ikrule.kneePos = Vector(0.0f, 0.0f, 0.0f); // don't bother with AutoIKRelease if the bone isn't going to be calculated // this code is crashing for some unknown reason. @@ -3946,22 +4017,22 @@ void CIKContext::AutoIKRelease( void ) } else { - DevWarning( 1, "AutoIKRelease (%s) got a NULL pBone %d\n", m_pStudioHdr->name(), bone ); + DevWarning( 1, "AutoIKRelease (%s) got a NULL pBone %d\n", m_pStudioHdr->pszName(), bone ); } } else { - DevWarning( 1, "AutoIKRelease (%s) got an out of range bone %d (%d)\n", m_pStudioHdr->name(), bone, m_pStudioHdr->numbones() ); + DevWarning( 1, "AutoIKRelease (%s) got an out of range bone %d (%d)\n", m_pStudioHdr->pszName(), bone, m_pStudioHdr->numbones() ); } } else { - DevWarning( 1, "AutoIKRelease (%s) got a NULL pchain %d\n", m_pStudioHdr->name(), pTarget->chain ); + DevWarning( 1, "AutoIKRelease (%s) got a NULL pchain %d\n", m_pStudioHdr->pszName(), pTarget->chain ); } } else { - DevWarning( 1, "AutoIKRelease (%s) got an out of range chain %d (%d)\n", m_pStudioHdr->name(), pTarget->chain, m_pStudioHdr->numikchains()); + DevWarning( 1, "AutoIKRelease (%s) got an out of range chain %d (%d)\n", m_pStudioHdr->pszName(), pTarget->chain, m_pStudioHdr->numikchains()); } } else @@ -3975,7 +4046,7 @@ void CIKContext::AutoIKRelease( void ) -void CIKContext::SolveDependencies( Vector pos[], Quaternion q[], matrix3x4_t boneToWorld[], CBoneBitList &boneComputed ) +void CIKContext::SolveDependencies( Vector pos[], Quaternion q[], matrix3x4a_t boneToWorld[], CBoneBitList &boneComputed ) { // ASSERT_NO_REENTRY(); @@ -4206,13 +4277,13 @@ void CIKContext::SolveAutoplayLocks( Quaternion q[] ) { - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int i; for (i = 0; i < m_ikLock.Count(); i++) { - const mstudioiklock_t &lock = m_pStudioHdr->pIKAutoplayLock( i ); + const mstudioiklock_t &lock = ((CStudioHdr *)m_pStudioHdr)->pIKAutoplayLock( i ); SolveLock( &lock, i, pos, q, boneToWorld, boneComputed ); } g_MatrixPool.Free( boneToWorld ); @@ -4230,7 +4301,7 @@ void CIKContext::SolveSequenceLocks( Quaternion q[] ) { - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int i; @@ -4255,7 +4326,7 @@ void CIKContext::AddAllLocks( Vector pos[], Quaternion q[] ) return; } - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int ikOffset = m_ikLock.AddMultipleToTail( m_pStudioHdr->GetNumIKChains() ); @@ -4307,7 +4378,7 @@ void CIKContext::SolveAllLocks( Quaternion q[] ) { - matrix3x4_t *boneToWorld = g_MatrixPool.Alloc(); + matrix3x4a_t *boneToWorld = g_MatrixPool.Alloc(); CBoneBitList boneComputed; int i; @@ -4336,7 +4407,7 @@ void CIKContext::SolveLock( int i, Vector pos[], Quaternion q[], - matrix3x4_t boneToWorld[], + matrix3x4a_t boneToWorld[], CBoneBitList &boneComputed ) { @@ -4386,18 +4457,15 @@ void CIKContext::SolveLock( //----------------------------------------------------------------------------- // Purpose: run all animations that automatically play and are driven off of poseParameters //----------------------------------------------------------------------------- -void CalcAutoplaySequences( - const CStudioHdr *pStudioHdr, - CIKContext *pIKContext, - Vector pos[], - Quaternion q[], - const float poseParameters[], - int boneMask, - float realTime - ) +void CBoneSetup::CalcAutoplaySequences( + Vector pos[], + Quaternion q[], + float flRealTime, + CIKContext *pIKContext + ) { -// ASSERT_NO_REENTRY(); - + // ASSERT_NO_REENTRY(); + int i; if ( pIKContext ) { @@ -4405,19 +4473,19 @@ void CalcAutoplaySequences( } unsigned short *pList = NULL; - int count = pStudioHdr->GetAutoplayList( &pList ); + int count = m_pStudioHdr->GetAutoplayList( &pList ); for (i = 0; i < count; i++) { int sequenceIndex = pList[i]; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( sequenceIndex ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)m_pStudioHdr)->pSeqdesc( sequenceIndex ); if (seqdesc.flags & STUDIO_AUTOPLAY) { float cycle = 0; - float cps = Studio_CPS( pStudioHdr, seqdesc, sequenceIndex, poseParameters ); - cycle = realTime * cps; + float cps = Studio_CPS( m_pStudioHdr, seqdesc, sequenceIndex, m_flPoseParameter ); + cycle = flRealTime * cps; cycle = cycle - (int)cycle; - AccumulatePose( pStudioHdr, NULL, pos, q, sequenceIndex, cycle, poseParameters, boneMask, 1.0, realTime ); + AccumulatePose( pos, q, sequenceIndex, cycle, 1.0, flRealTime, pIKContext ); } } @@ -4438,13 +4506,14 @@ void Studio_BuildMatrices( const Vector pos[], const Quaternion q[], int iBone, + float flScale, matrix3x4_t bonetoworld[MAXSTUDIOBONES], int boneMask ) { int i, j; - int chain[MAXSTUDIOBONES]; + int chain[MAXSTUDIOBONES] = {}; int chainlength = 0; if (iBone < -1 || iBone >= pStudioHdr->numbones()) @@ -4473,7 +4542,23 @@ void Studio_BuildMatrices( matrix3x4_t bonematrix; matrix3x4_t rotationmatrix; // model to world transformation - AngleMatrix( angles, origin, rotationmatrix); + AngleMatrix( angles, origin, rotationmatrix ); + + // Account for a change in scale + if ( flScale < 1.0f-FLT_EPSILON || flScale > 1.0f+FLT_EPSILON ) + { + Vector vecOffset; + MatrixGetColumn( rotationmatrix, 3, vecOffset ); + vecOffset -= origin; + vecOffset *= flScale; + vecOffset += origin; + MatrixSetColumn( vecOffset, 3, rotationmatrix ); + + // Scale it uniformly + VectorScale( rotationmatrix[0], flScale, rotationmatrix[0] ); + VectorScale( rotationmatrix[1], flScale, rotationmatrix[1] ); + VectorScale( rotationmatrix[2], flScale, rotationmatrix[2] ); + } for (j = chainlength - 1; j >= 0; j--) { @@ -4645,9 +4730,9 @@ void DoQuatInterpBone( { float dot = fabs( QuaternionDotProduct( pProc->pTrigger( i )->trigger, src ) ); // FIXME: a fast acos should be acceptable - dot = clamp( dot, -1, 1 ); + dot = clamp( dot, -1.f, 1.f ); weight[i] = 1 - (2 * acos( dot ) * pProc->pTrigger( i )->inv_tolerance ); - weight[i] = MAX( 0, weight[i] ); + weight[i] = max( 0, weight[i] ); scale += weight[i]; } @@ -4758,7 +4843,7 @@ void DoAimAtBone( if ( pStudioHdr ) { // This means it's AIMATATTACH - const mstudioattachment_t &attachment( pStudioHdr->pAttachment( pProc->aim ) ); + const mstudioattachment_t &attachment( ((CStudioHdr *)pStudioHdr)->pAttachment( pProc->aim ) ); ConcatTransforms( bonetoworld.GetBone( attachment.localbone ), attachment.local, @@ -4981,6 +5066,34 @@ float Studio_GetController( const CStudioHdr *pStudioHdr, int iController, float } +//----------------------------------------------------------------------------- +// Purpose: Calculates default values for the pose parameters +// Output: fills in an array +//----------------------------------------------------------------------------- + +void Studio_CalcDefaultPoseParameters( const CStudioHdr *pStudioHdr, float flPoseParameter[], int nCount ) +{ + int nPoseCount = pStudioHdr->GetNumPoseParameters(); + int nNumParams = MIN( nCount, MAXSTUDIOPOSEPARAM ); + + for ( int i = 0; i < nNumParams; ++i ) + { + // Default to middle of the pose parameter range + flPoseParameter[ i ] = 0.5f; + if ( i < nPoseCount ) + { + const mstudioposeparamdesc_t &Pose = ((CStudioHdr *)pStudioHdr)->pPoseParameter( i ); + + // Want to try for a zero state. If one doesn't exist set it to .5 by default. + if ( Pose.start < 0.0f && Pose.end > 0.0f ) + { + float flPoseDelta = Pose.end - Pose.start; + flPoseParameter[i] = -Pose.start / flPoseDelta; + } + } + } +} + //----------------------------------------------------------------------------- // Purpose: converts a ranged pose parameter value into a 0..1 encoded value // Output: ctlValue contains 0..1 encoding. @@ -4994,7 +5107,7 @@ float Studio_SetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, flo return 0; } - const mstudioposeparamdesc_t &PoseParam = pStudioHdr->pPoseParameter( iParameter ); + const mstudioposeparamdesc_t &PoseParam = ((CStudioHdr *)pStudioHdr)->pPoseParameter( iParameter ); Assert( IsFinite( flValue ) ); @@ -5029,12 +5142,12 @@ float Studio_GetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, flo return 0; } - const mstudioposeparamdesc_t &PoseParam = pStudioHdr->pPoseParameter( iParameter ); + const mstudioposeparamdesc_t &PoseParam = ((CStudioHdr *)pStudioHdr)->pPoseParameter( iParameter ); return ctlValue * (PoseParam.end - PoseParam.start) + PoseParam.start; } -#ifdef _MSC_VER +#ifdef _WIN32 #pragma warning (disable : 4701) #endif @@ -5043,6 +5156,7 @@ float Studio_GetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, flo //----------------------------------------------------------------------------- static int ClipRayToHitbox( const Ray_t &ray, mstudiobbox_t *pbox, matrix3x4_t& matrix, trace_t &tr ) { + const float flProjEpsilon = 0.01f; // scale by current t so hits shorten the ray and increase the likelihood of early outs Vector delta2; VectorScale( ray.m_Delta, (0.5f * tr.fraction), delta2 ); @@ -5085,29 +5199,42 @@ static int ClipRayToHitbox( const Ray_t &ray, mstudiobbox_t *pbox, matrix3x4_t& } // now check cross axes for separation - float tmp, cextent; + float tmp, tmpfix, cextent; Vector cross; CrossProduct( delta2, segmentCenter, cross ); cextent = cross.x * matrix[0][0] + cross.y * matrix[1][0] + cross.z * matrix[2][0]; cextent = fabsf(cextent); tmp = boxextents[1]*uextent[2] + boxextents[2]*uextent[1]; - if ( cextent > tmp ) + tmpfix = MAX(tmp, flProjEpsilon); + if ( cextent > tmpfix ) return -1; + +// if ( cextent > tmp && cextent <= tmpfix ) +// DevWarning( "ClipRayToHitbox trace precision error case\n" ); cextent = cross.x * matrix[0][1] + cross.y * matrix[1][1] + cross.z * matrix[2][1]; cextent = fabsf(cextent); tmp = boxextents[0]*uextent[2] + boxextents[2]*uextent[0]; - if ( cextent > tmp ) + tmpfix = MAX(tmp, flProjEpsilon); + if ( cextent > tmpfix ) return -1; +// if ( cextent > tmp && cextent <= tmpfix ) +// DevWarning( "ClipRayToHitbox trace precision error case\n" ); + cextent = cross.x * matrix[0][2] + cross.y * matrix[1][2] + cross.z * matrix[2][2]; cextent = fabsf(cextent); tmp = boxextents[0]*uextent[1] + boxextents[1]*uextent[0]; - if ( cextent > tmp ) + tmpfix = MAX(tmp, flProjEpsilon); + if ( cextent > tmpfix ) return -1; +// if ( cextent > tmp && cextent <= tmpfix ) +// DevWarning( "ClipRayToHitbox trace precision error case\n" ); + // !!! We hit this box !!! compute intersection point and return Vector start; + // Compute ray start in bone space VectorITransform( ray.m_Start, matrix, start ); // extent is delta2 in bone space, recompute delta in bone space @@ -5118,6 +5245,7 @@ static int ClipRayToHitbox( const Ray_t &ray, mstudiobbox_t *pbox, matrix3x4_t& trace_t boxTrace; if ( !IntersectRayWithBox( start, extent, pbox->bbmin, pbox->bbmax, 0.0f, &boxTrace ) ) return -1; + Assert( IsFinite(boxTrace.fraction) ); tr.fraction *= boxTrace.fraction; tr.startsolid = boxTrace.startsolid; @@ -5129,7 +5257,7 @@ static int ClipRayToHitbox( const Ray_t &ray, mstudiobbox_t *pbox, matrix3x4_t& return hitside; } -#ifdef _MSC_VER +#ifdef _WIN32 #pragma warning (default : 4701) #endif @@ -5154,6 +5282,7 @@ bool SweepBoxToStudio( IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHd if ( ( fBoneContents & fContentsMask ) == 0 ) continue; + //FIXME: Won't work with scaling! trace_t obbTrace; if ( IntersectRayWithOBB( clippedRay, *hitboxbones[pbox->bone], pbox->bbmin, pbox->bbmax, 0.0f, &obbTrace ) ) { @@ -5194,7 +5323,7 @@ bool SweepBoxToStudio( IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHd // Purpose: //----------------------------------------------------------------------------- bool TraceToStudio( IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHdr *pStudioHdr, mstudiohitboxset_t *set, - matrix3x4_t **hitboxbones, int fContentsMask, trace_t &tr ) + matrix3x4_t **hitboxbones, int fContentsMask, const Vector &vecOrigin, float flScale, trace_t &tr ) { if ( !ray.m_IsRay ) { @@ -5220,8 +5349,50 @@ bool TraceToStudio( IPhysicsSurfaceProps *pProps, const Ray_t& ray, CStudioHdr * // columns are axes of the bones in world space, translation is in world space matrix3x4_t& matrix = *hitboxbones[pbox->bone]; + + // Because we're sending in a matrix with scale data, and because the matrix inversion in the hitbox + // code does not handle that case, we pre-scale the bones and ray down here and do our collision checks + // in unscaled space. We can then rescale the results afterwards. + + int side = -1; + if ( flScale < 1.0f-FLT_EPSILON || flScale > 1.0f+FLT_EPSILON ) + { + matrix3x4_t matScaled; + MatrixCopy( matrix, matScaled ); + + float invScale = 1.0f / flScale; + + Vector vecBoneOrigin; + MatrixGetColumn( matScaled, 3, vecBoneOrigin ); + + // Pre-scale the origin down + Vector vecNewOrigin = vecBoneOrigin - vecOrigin; + vecNewOrigin *= invScale; + vecNewOrigin += vecOrigin; + MatrixSetColumn( vecNewOrigin, 3, matScaled ); + + // Scale it uniformly + VectorScale( matScaled[0], invScale, matScaled[0] ); + VectorScale( matScaled[1], invScale, matScaled[1] ); + VectorScale( matScaled[2], invScale, matScaled[2] ); + + // Pre-scale our ray as well + Vector vecRayStart = ray.m_Start - vecOrigin; + vecRayStart *= invScale; + vecRayStart += vecOrigin; + + Vector vecRayDelta = ray.m_Delta * invScale; + + Ray_t newRay; + newRay.Init( vecRayStart, vecRayStart + vecRayDelta ); + + side = ClipRayToHitbox( newRay, pbox, matScaled, tr ); + } + else + { + side = ClipRayToHitbox( ray, pbox, matrix, tr ); + } - int side = ClipRayToHitbox( ray, pbox, matrix, tr ); if ( side >= 0 ) { hitbox = i; @@ -5289,16 +5460,16 @@ void Studio_SeqAnims( const CStudioHdr *pStudioHdr, mstudioseqdesc_t &seqdesc, i Studio_LocalPoseParameter( pStudioHdr, poseParameter, seqdesc, iSequence, 0, s0, i0 ); Studio_LocalPoseParameter( pStudioHdr, poseParameter, seqdesc, iSequence, 1, s1, i1 ); - panim[0] = &pStudioHdr->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0 , i1 ) ) ); + panim[0] = &((CStudioHdr *)pStudioHdr)->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0 , i1 ) ) ); weight[0] = (1 - s0) * (1 - s1); - panim[1] = &pStudioHdr->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0+1, i1 ) ) ); + panim[1] = &((CStudioHdr *)pStudioHdr)->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0+1, i1 ) ) ); weight[1] = (s0) * (1 - s1); - panim[2] = &pStudioHdr->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0 , i1+1 ) ) ); + panim[2] = &((CStudioHdr *)pStudioHdr)->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0 , i1+1 ) ) ); weight[2] = (1 - s0) * (s1); - panim[3] = &pStudioHdr->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0+1, i1+1 ) ) ); + panim[3] = &((CStudioHdr *)pStudioHdr)->pAnimdesc( pStudioHdr->iRelativeAnim( iSequence, seqdesc.anim( i0+1, i1+1 ) ) ); weight[3] = (s0) * (s1); Assert( weight[0] >= 0.0f && weight[1] >= 0.0f && weight[2] >= 0.0f && weight[3] >= 0.0f ); @@ -5313,7 +5484,7 @@ int Studio_MaxFrame( const CStudioHdr *pStudioHdr, int iSequence, const float po mstudioanimdesc_t *panim[4]; float weight[4]; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); Studio_SeqAnims( pStudioHdr, seqdesc, iSequence, poseParameter, panim, weight ); float maxFrame = 0; @@ -5330,7 +5501,7 @@ int Studio_MaxFrame( const CStudioHdr *pStudioHdr, int iSequence, const float po // FIXME: why does the weights sometimes not exactly add it 1.0 and this sometimes rounds down? - return static_cast(maxFrame + 0.01); + return (maxFrame + 0.01); } @@ -5343,7 +5514,7 @@ float Studio_FPS( const CStudioHdr *pStudioHdr, int iSequence, const float poseP mstudioanimdesc_t *panim[4]; float weight[4]; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); Studio_SeqAnims( pStudioHdr, seqdesc, iSequence, poseParameter, panim, weight ); float t = 0; @@ -5388,7 +5559,7 @@ float Studio_CPS( const CStudioHdr *pStudioHdr, mstudioseqdesc_t &seqdesc, int i float Studio_Duration( const CStudioHdr *pStudioHdr, int iSequence, const float poseParameter[] ) { - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); float cps = Studio_CPS( pStudioHdr, seqdesc, iSequence, poseParameter ); if( cps == 0 ) @@ -5574,7 +5745,7 @@ bool Studio_SeqMovement( const CStudioHdr *pStudioHdr, int iSequence, float flCy mstudioanimdesc_t *panim[4]; float weight[4]; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); Studio_SeqAnims( pStudioHdr, seqdesc, iSequence, poseParameter, panim, weight ); @@ -5621,7 +5792,7 @@ bool Studio_SeqVelocity( const CStudioHdr *pStudioHdr, int iSequence, float flCy mstudioanimdesc_t *panim[4]; float weight[4]; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); Studio_SeqAnims( pStudioHdr, seqdesc, iSequence, poseParameter, panim, weight ); vecVelocity.Init( ); @@ -5653,7 +5824,7 @@ float Studio_FindSeqDistance( const CStudioHdr *pStudioHdr, int iSequence, const mstudioanimdesc_t *panim[4]; float weight[4]; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); Studio_SeqAnims( pStudioHdr, seqdesc, iSequence, poseParameter, panim, weight ); float flCycle = 0; @@ -5680,7 +5851,7 @@ int Studio_FindAttachment( const CStudioHdr *pStudioHdr, const char *pAttachment // Extract the bone index from the name for (int i = 0; i < pStudioHdr->GetNumAttachments(); i++) { - if (!stricmp(pAttachmentName,pStudioHdr->pAttachment(i).pszName( ))) + if (!V_stricmp(pAttachmentName,((CStudioHdr *)pStudioHdr)->pAttachment(i).pszName( ))) { return i; } @@ -5704,7 +5875,7 @@ int Studio_FindRandomAttachment( const CStudioHdr *pStudioHdr, const char *pAtta // Extract the bone index from the name for (int i = 0; i < pStudioHdr->GetNumAttachments(); i++) { - if ( strstr( pStudioHdr->pAttachment(i).pszName(), pAttachmentName ) ) + if ( strstr( ((CStudioHdr *)pStudioHdr)->pAttachment(i).pszName(), pAttachmentName ) ) { matchingAttachments.AddToTail(i); } @@ -5724,28 +5895,32 @@ int Studio_FindRandomAttachment( const CStudioHdr *pStudioHdr, const char *pAtta int Studio_BoneIndexByName( const CStudioHdr *pStudioHdr, const char *pName ) { - // binary search for the bone matching pName - int start = 0, end = pStudioHdr->numbones()-1; - const byte *pBoneTable = pStudioHdr->GetBoneTableSortedByName(); - mstudiobone_t *pbones = pStudioHdr->pBone( 0 ); - while (start <= end) + if ( pStudioHdr ) { - int mid = (start + end) >> 1; - int cmp = Q_stricmp( pbones[pBoneTable[mid]].pszName(), pName ); - - if ( cmp < 0 ) - { - start = mid + 1; - } - else if ( cmp > 0 ) + // binary search for the bone matching pName + int start = 0, end = pStudioHdr->numbones()-1; + const byte *pBoneTable = pStudioHdr->GetBoneTableSortedByName(); + mstudiobone_t *pbones = pStudioHdr->pBone( 0 ); + while (start <= end) { - end = mid - 1; - } - else - { - return pBoneTable[mid]; + int mid = (start + end) >> 1; + int cmp = Q_stricmp( pbones[pBoneTable[mid]].pszName(), pName ); + + if ( cmp < 0 ) + { + start = mid + 1; + } + else if ( cmp > 0 ) + { + end = mid - 1; + } + else + { + return pBoneTable[mid]; + } } } + return -1; } @@ -5769,7 +5944,7 @@ const char *Studio_GetKeyValueText( const CStudioHdr *pStudioHdr, int iSequence { if (iSequence >= 0 && iSequence < pStudioHdr->GetNumSeq()) { - return pStudioHdr->pSeqdesc( iSequence ).KeyValueText(); + return ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ).KeyValueText(); } } return NULL; @@ -5778,16 +5953,16 @@ const char *Studio_GetKeyValueText( const CStudioHdr *pStudioHdr, int iSequence bool Studio_PrefetchSequence( const CStudioHdr *pStudioHdr, int iSequence ) { bool pendingload = false; - mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence ); + mstudioseqdesc_t &seqdesc = ((CStudioHdr *)pStudioHdr)->pSeqdesc( iSequence ); int size0 = seqdesc.groupsize[ 0 ]; int size1 = seqdesc.groupsize[ 1 ]; for ( int i = 0; i < size0; ++i ) { for ( int j = 0; j < size1; ++j ) { - mstudioanimdesc_t &animdesc = pStudioHdr->pAnimdesc( seqdesc.anim( i, j ) ); + mstudioanimdesc_t &animdesc = ((CStudioHdr *)pStudioHdr)->pAnimdesc( seqdesc.anim( i, j ) ); int iFrame = 0; - mstudioanim_t *panim = animdesc.pAnim( &iFrame ); + byte *panim = animdesc.pAnim( &iFrame ); if ( !panim ) { pendingload = true; @@ -5798,3 +5973,81 @@ bool Studio_PrefetchSequence( const CStudioHdr *pStudioHdr, int iSequence ) // Everything for this sequence is resident? return !pendingload; } + + +//----------------------------------------------------------------------------- +// Purpose: Drive a flex controller from a component of a bone +//----------------------------------------------------------------------------- +void Studio_RunBoneFlexDrivers( float *pflFlexControllerWeights, const CStudioHdr *pStudioHdr, const Vector *pvPositions, const matrix3x4_t *pBoneToWorld, const matrix3x4_t &mRootToWorld ) +{ + bool bRootToWorldInvComputed = false; + matrix3x4_t mRootToWorldInv; + matrix3x4_t mParentInv; + matrix3x4_t mBoneLocal; + + const int nBoneFlexDriverCount = pStudioHdr->BoneFlexDriverCount(); + + for ( int i = 0; i < nBoneFlexDriverCount; ++i ) + { + const mstudioboneflexdriver_t *pBoneFlexDriver = pStudioHdr->BoneFlexDriver( i ); + const mstudiobone_t *pStudioBone = pStudioHdr->pBone( pBoneFlexDriver->m_nBoneIndex ); + + const int nControllerCount = pBoneFlexDriver->m_nControlCount; + + if ( pStudioBone->flags & BONE_USED_BY_BONE_MERGE ) + { + // The local space version of the bone is not available if this is a bonemerged bone + // so do the slow computation of the local version of the bone from boneToWorld + + if ( pStudioBone->parent < 0 ) + { + if ( !bRootToWorldInvComputed ) + { + MatrixInvert( mRootToWorld, mRootToWorldInv ); + bRootToWorldInvComputed = true; + } + + MatrixMultiply( mRootToWorldInv, pBoneToWorld[ pBoneFlexDriver->m_nBoneIndex ], mBoneLocal ); + } + else + { + MatrixInvert( pBoneToWorld[ pStudioBone->parent ], mParentInv ); + MatrixMultiply( mParentInv, pBoneToWorld[ pBoneFlexDriver->m_nBoneIndex ], mBoneLocal ); + } + + for ( int j = 0; j < nControllerCount; ++j ) + { + const mstudioboneflexdrivercontrol_t *pController = pBoneFlexDriver->pBoneFlexDriverControl( j ); + const mstudioflexcontroller_t *pFlexController = pStudioHdr->pFlexcontroller( static_cast< LocalFlexController_t >( pController->m_nFlexControllerIndex ) ); + + if ( pFlexController->localToGlobal < 0 ) + continue; + + Assert( pController->m_nFlexControllerIndex >= 0 && pController->m_nFlexControllerIndex < pStudioHdr->numflexcontrollers() ); + Assert( pController->m_nBoneComponent >= 0 && pController->m_nBoneComponent <= 2 ); + pflFlexControllerWeights[pFlexController->localToGlobal] = + RemapValClamped( mBoneLocal[pController->m_nBoneComponent][3], pController->m_flMin, pController->m_flMax, 0.0f, 1.0f ); + } + } + else + { + // Use the local space version of the bone directly for non-bonemerged bones + + const Vector &position = pvPositions[ pBoneFlexDriver->m_nBoneIndex ]; + + for ( int j = 0; j < nControllerCount; ++j ) + { + const mstudioboneflexdrivercontrol_t *pController = pBoneFlexDriver->pBoneFlexDriverControl( j ); + const mstudioflexcontroller_t *pFlexController = pStudioHdr->pFlexcontroller( static_cast< LocalFlexController_t >( pController->m_nFlexControllerIndex ) ); + + if ( pFlexController->localToGlobal < 0 ) + continue; + + Assert( pController->m_nFlexControllerIndex >= 0 && pController->m_nFlexControllerIndex < pStudioHdr->numflexcontrollers() ); + Assert( pController->m_nBoneComponent >= 0 && pController->m_nBoneComponent <= 2 ); + pflFlexControllerWeights[pFlexController->localToGlobal] = + RemapValClamped( position[pController->m_nBoneComponent], pController->m_flMin, pController->m_flMax, 0.0f, 1.0f ); + } + } + } +} diff --git a/public/mathlib/mathlib.h b/public/mathlib/mathlib.h index e16441ed3..c464197e9 100644 --- a/public/mathlib/mathlib.h +++ b/public/mathlib/mathlib.h @@ -169,6 +169,17 @@ class ALIGN16 matrix3x4a_t : public matrix3x4_t matrix3x4a_t() { if (((size_t)Base()) % 16 != 0) { Error( "matrix3x4a_t missaligned" ); } } */ matrix3x4a_t& operator=( const matrix3x4_t& src ) { memcpy( Base(), src.Base(), sizeof( float ) * 3 * 4 ); return *this; }; + + matrix3x4a_t() {} + matrix3x4a_t( + float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23 ) + { + m_flMatVal[0][0] = m00; m_flMatVal[0][1] = m01; m_flMatVal[0][2] = m02; m_flMatVal[0][3] = m03; + m_flMatVal[1][0] = m10; m_flMatVal[1][1] = m11; m_flMatVal[1][2] = m12; m_flMatVal[1][3] = m13; + m_flMatVal[2][0] = m20; m_flMatVal[2][1] = m21; m_flMatVal[2][2] = m22; m_flMatVal[2][3] = m23; + } }; #ifndef M_PI diff --git a/public/tier0/platform.h b/public/tier0/platform.h index 3366ec091..b387a4995 100644 --- a/public/tier0/platform.h +++ b/public/tier0/platform.h @@ -300,11 +300,36 @@ typedef void * HINSTANCE; #define DECL_ALIGN(x) /* */ #endif +#ifdef _MSC_VER +// MSVC has the align at the start of the struct +#define ALIGN4 DECL_ALIGN(4) #define ALIGN8 DECL_ALIGN(8) #define ALIGN16 DECL_ALIGN(16) #define ALIGN32 DECL_ALIGN(32) #define ALIGN128 DECL_ALIGN(128) +#define ALIGN4_POST +#define ALIGN8_POST +#define ALIGN16_POST +#define ALIGN32_POST +#define ALIGN128_POST +#elif defined( GNUC ) +// gnuc has the align decoration at the end +#define ALIGN4 +#define ALIGN8 +#define ALIGN16 +#define ALIGN32 +#define ALIGN128 + +#define ALIGN4_POST DECL_ALIGN(4) +#define ALIGN8_POST DECL_ALIGN(8) +#define ALIGN16_POST DECL_ALIGN(16) +#define ALIGN32_POST DECL_ALIGN(32) +#define ALIGN128_POST DECL_ALIGN(128) +#else +#error +#endif + // Linux had a few areas where it didn't construct objects in the same order that Windows does. // So when CVProfile::CVProfile() would access g_pMemAlloc, it would crash because the allocator wasn't initalized yet. From a4cb8bdcc75e0a5d82aaf5dbdbd15420dbf2b4d5 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 21:43:06 -0300 Subject: [PATCH 08/24] i missed these --- public/bone_setup.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/public/bone_setup.cpp b/public/bone_setup.cpp index 835f284ee..2a1477a22 100644 --- a/public/bone_setup.cpp +++ b/public/bone_setup.cpp @@ -2750,7 +2750,7 @@ bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, matri //----------------------------------------------------------------------------- // Purpose: Realign the matrix so that its X axis points along the desired axis. //----------------------------------------------------------------------------- -void Studio_AlignIKMatrix( matrix3x4_t &mMat, const Vector &vAlignTo ) +void Studio_AlignIKMatrix( matrix3x4a_t &mMat, const Vector &vAlignTo ) { Vector tmp1, tmp2, tmp3; @@ -2776,7 +2776,7 @@ void Studio_AlignIKMatrix( matrix3x4_t &mMat, const Vector &vAlignTo ) // Purpose: Solve Knee position for a known hip and foot location, and a known knee direction //----------------------------------------------------------------------------- -bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vector &targetKneePos, Vector &targetKneeDir, matrix3x4_t *pBoneToWorld ) +bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vector &targetKneePos, Vector &targetKneeDir, matrix3x4a_t *pBoneToWorld ) { Vector worldFoot, worldKnee, worldThigh; @@ -2831,9 +2831,9 @@ bool Studio_SolveIK( int iThigh, int iKnee, int iFoot, Vector &targetFoot, Vecto CIKSolver ik; if (ik.solve( l1, l2, ikFoot.Base(), ikTargetKnee.Base(), ikKnee.Base() )) { - matrix3x4_t& mWorldThigh = pBoneToWorld[ iThigh ]; - matrix3x4_t& mWorldKnee = pBoneToWorld[ iKnee ]; - matrix3x4_t& mWorldFoot = pBoneToWorld[ iFoot ]; + matrix3x4a_t& mWorldThigh = pBoneToWorld[ iThigh ]; + matrix3x4a_t& mWorldKnee = pBoneToWorld[ iKnee ]; + matrix3x4a_t& mWorldFoot = pBoneToWorld[ iFoot ]; //debugLine( worldThigh, ikKnee + worldThigh, 255, 0, 0, true, 0 ); //debugLine( ikKnee + worldThigh, ikFoot + worldThigh, 255, 0, 0, true,0 ); @@ -3468,17 +3468,17 @@ void CIKContext::BuildBoneChain( //----------------------------------------------------------------------------- void BuildBoneChain( const CStudioHdr *pStudioHdr, - const matrix3x4_t &rootxform, + const matrix3x4a_t &rootxform, const Vector pos[], const Quaternion q[], int iBone, - matrix3x4_t *pBoneToWorld, + matrix3x4a_t *pBoneToWorld, CBoneBitList &boneComputed ) { if ( boneComputed.IsBoneMarked(iBone) ) return; - matrix3x4_t bonematrix; + matrix3x4a_t bonematrix; QuaternionMatrix( q[iBone], pos[iBone], bonematrix ); int parent = pStudioHdr->boneParent( iBone ); @@ -5780,6 +5780,13 @@ bool Studio_SeqMovement( const CStudioHdr *pStudioHdr, int iSequence, float flCy return found; } +float Studio_SeqMovementAndDuration( const CStudioHdr *pStudioHdr, int iSequence, float flCycleFrom, float flCycleTo, const float poseParameter[], Vector &deltaPos ) +{ + QAngle deltaAngles; + Studio_SeqMovement( pStudioHdr, iSequence, flCycleFrom, flCycleTo, poseParameter, deltaPos, deltaAngles ); + + return Studio_Duration( pStudioHdr, iSequence, poseParameter ); +} //----------------------------------------------------------------------------- // Purpose: calculate instantaneous velocity in ips at a given point in the sequence's cycle From 368a669842214faff6d7a95e45fdffe319263816 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Wed, 31 Mar 2021 22:05:56 -0300 Subject: [PATCH 09/24] remove bad asserts --- public/studio.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/public/studio.cpp b/public/studio.cpp index fe2525a54..37b4ee9b2 100644 --- a/public/studio.cpp +++ b/public/studio.cpp @@ -798,9 +798,6 @@ const virtualmodel_t * CStudioHdr::ResetVModel( const virtualmodel_t *pVModel ) if (pVModel != NULL) { m_pVModel = (virtualmodel_t *)pVModel; -#if !defined( POSIX ) - Assert( !pVModel->m_Lock.GetOwnerId() ); -#endif m_pStudioHdrCache.SetCount( m_pVModel->m_group.Count() ); int i; @@ -848,9 +845,6 @@ const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) if (pStudioHdr == NULL) { -#if !defined( POSIX ) - Assert( !m_pVModel->m_Lock.GetOwnerId() ); -#endif virtualgroup_t *pGroup = &m_pVModel->m_group[ i ]; pStudioHdr = pGroup->GetStudioHdr(); m_pStudioHdrCache[ i ] = pStudioHdr; @@ -2157,4 +2151,4 @@ void CStudioHdr::CActivityToSequenceMapping::ResetMappings() } } g_StudioHdrToActivityMaps.RemoveAll(); -} \ No newline at end of file +} From ed1b2ff4fafa3d6a82c5dff6b62bd60aaaedd8ac Mon Sep 17 00:00:00 2001 From: arthurdead Date: Fri, 2 Apr 2021 04:19:59 -0300 Subject: [PATCH 10/24] fix CThreadMutex --- public/tier0/threadtools.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index 3b7a5d1cc..128966c84 100644 --- a/public/tier0/threadtools.h +++ b/public/tier0/threadtools.h @@ -574,13 +574,6 @@ class TT_CLASS CThreadMutex #else #error #endif - -#ifdef THREAD_MUTEX_TRACING_SUPPORTED - // Debugging (always here to allow mixed debug/release builds w/o changing size) - uint m_currentOwnerID; - uint16 m_lockCount; - bool m_bTrace; -#endif }; //----------------------------------------------------------------------------- From 4e63872e7c5b73d37bf7d26e8c3c4d78e6c10422 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Fri, 2 Apr 2021 22:45:06 -0300 Subject: [PATCH 11/24] missing stuff --- common/crypto.cpp | 2219 ++++ common/crypto.h | 281 + common/language.cpp | 218 + common/language.h | 56 + common/simplebitstring.cpp | 234 + common/simplebitstring.h | 159 + external/crypto++-5.6.3/3way.cpp | 143 + external/crypto++-5.6.3/3way.h | 69 + external/crypto++-5.6.3/Doxyfile | 2373 ++++ external/crypto++-5.6.3/Filelist.txt | 393 + external/crypto++-5.6.3/GNUmakefile | 575 + external/crypto++-5.6.3/GNUmakefile-cross | 186 + external/crypto++-5.6.3/Install.txt | 169 + external/crypto++-5.6.3/License.txt | 51 + external/crypto++-5.6.3/Readme.txt | 499 + external/crypto++-5.6.3/TestData/3desval.dat | 3 + external/crypto++-5.6.3/TestData/3wayval.dat | 5 + external/crypto++-5.6.3/TestData/camellia.dat | 45 + external/crypto++-5.6.3/TestData/cast128v.dat | 11 + external/crypto++-5.6.3/TestData/cast256v.dat | 11 + external/crypto++-5.6.3/TestData/descert.dat | 171 + external/crypto++-5.6.3/TestData/dh1024.dat | 1 + external/crypto++-5.6.3/TestData/dh2048.dat | 1 + external/crypto++-5.6.3/TestData/dlie1024.dat | 1 + external/crypto++-5.6.3/TestData/dlie2048.dat | 1 + external/crypto++-5.6.3/TestData/dsa1024.dat | 1 + external/crypto++-5.6.3/TestData/dsa1024b.dat | 1 + external/crypto++-5.6.3/TestData/dsa512.dat | 1 + external/crypto++-5.6.3/TestData/elgc1024.dat | 1 + external/crypto++-5.6.3/TestData/esig1023.dat | 1 + external/crypto++-5.6.3/TestData/esig1536.dat | 1 + external/crypto++-5.6.3/TestData/esig2046.dat | 1 + external/crypto++-5.6.3/TestData/gostval.dat | 23 + external/crypto++-5.6.3/TestData/ideaval.dat | 11 + external/crypto++-5.6.3/TestData/luc1024.dat | 1 + external/crypto++-5.6.3/TestData/luc2048.dat | 1 + external/crypto++-5.6.3/TestData/lucc1024.dat | 1 + external/crypto++-5.6.3/TestData/lucc512.dat | 1 + external/crypto++-5.6.3/TestData/lucd1024.dat | 4 + external/crypto++-5.6.3/TestData/lucd512.dat | 2 + external/crypto++-5.6.3/TestData/lucs1024.dat | 1 + external/crypto++-5.6.3/TestData/lucs512.dat | 1 + external/crypto++-5.6.3/TestData/marsval.dat | 9 + external/crypto++-5.6.3/TestData/mqv1024.dat | 1 + external/crypto++-5.6.3/TestData/mqv2048.dat | 1 + external/crypto++-5.6.3/TestData/nr1024.dat | 1 + external/crypto++-5.6.3/TestData/nr2048.dat | 1 + external/crypto++-5.6.3/TestData/rabi1024.dat | 1 + external/crypto++-5.6.3/TestData/rabi2048.dat | 1 + external/crypto++-5.6.3/TestData/rc2val.dat | 48 + external/crypto++-5.6.3/TestData/rc5val.dat | 5 + external/crypto++-5.6.3/TestData/rc6val.dat | 17 + external/crypto++-5.6.3/TestData/rijndael.dat | 9 + external/crypto++-5.6.3/TestData/rsa1024.dat | 32 + external/crypto++-5.6.3/TestData/rsa2048.dat | 61 + external/crypto++-5.6.3/TestData/rsa400pb.dat | 10 + external/crypto++-5.6.3/TestData/rsa400pv.dat | 41 + external/crypto++-5.6.3/TestData/rsa512a.dat | 35 + external/crypto++-5.6.3/TestData/rw1024.dat | 1 + external/crypto++-5.6.3/TestData/rw2048.dat | 1 + external/crypto++-5.6.3/TestData/saferval.dat | 16 + external/crypto++-5.6.3/TestData/serpentv.dat | 12 + external/crypto++-5.6.3/TestData/shacal2v.dat | 14 + external/crypto++-5.6.3/TestData/sharkval.dat | 7 + external/crypto++-5.6.3/TestData/skipjack.dat | 1 + external/crypto++-5.6.3/TestData/squareva.dat | 8 + external/crypto++-5.6.3/TestData/twofishv.dat | 9 + external/crypto++-5.6.3/TestData/usage.dat | 81 + external/crypto++-5.6.3/TestData/xtrdh171.dat | 3 + external/crypto++-5.6.3/TestData/xtrdh342.dat | 5 + .../crypto++-5.6.3/TestVectors/Readme.txt | 76 + external/crypto++-5.6.3/TestVectors/aes.txt | 241 + external/crypto++-5.6.3/TestVectors/all.txt | 32 + .../crypto++-5.6.3/TestVectors/camellia.txt | 8646 +++++++++++++++ external/crypto++-5.6.3/TestVectors/ccm.txt | 240 + external/crypto++-5.6.3/TestVectors/cmac.txt | 38 + external/crypto++-5.6.3/TestVectors/dlies.txt | 542 + external/crypto++-5.6.3/TestVectors/dsa.txt | 397 + .../crypto++-5.6.3/TestVectors/dsa_1363.txt | 553 + external/crypto++-5.6.3/TestVectors/eax.txt | 75 + external/crypto++-5.6.3/TestVectors/esign.txt | 93 + external/crypto++-5.6.3/TestVectors/gcm.txt | 168 + external/crypto++-5.6.3/TestVectors/hkdf.txt | 175 + external/crypto++-5.6.3/TestVectors/hmac.txt | 281 + external/crypto++-5.6.3/TestVectors/mars.txt | 66 + external/crypto++-5.6.3/TestVectors/nr.txt | 615 ++ .../crypto++-5.6.3/TestVectors/panama.txt | 76 + .../crypto++-5.6.3/TestVectors/rsa_oaep.txt | 1765 +++ .../TestVectors/rsa_pkcs1_1_5.txt | 89 + .../crypto++-5.6.3/TestVectors/rsa_pss.txt | 2083 ++++ external/crypto++-5.6.3/TestVectors/rw.txt | 166 + external/crypto++-5.6.3/TestVectors/salsa.txt | 463 + external/crypto++-5.6.3/TestVectors/seal.txt | 137 + external/crypto++-5.6.3/TestVectors/seed.txt | 19 + external/crypto++-5.6.3/TestVectors/sha.txt | 59 + external/crypto++-5.6.3/TestVectors/sha3.txt | 861 ++ .../crypto++-5.6.3/TestVectors/shacal2.txt | 5123 +++++++++ .../crypto++-5.6.3/TestVectors/sosemanuk.txt | 25 + external/crypto++-5.6.3/TestVectors/tea.txt | 711 ++ external/crypto++-5.6.3/TestVectors/ttmac.txt | 40 + external/crypto++-5.6.3/TestVectors/vmac.txt | 77 + external/crypto++-5.6.3/TestVectors/wake.txt | 10 + .../crypto++-5.6.3/TestVectors/whrlpool.txt | 39 + external/crypto++-5.6.3/adhoc.cpp.proto | 23 + external/crypto++-5.6.3/adler32.cpp | 82 + external/crypto++-5.6.3/adler32.h | 34 + external/crypto++-5.6.3/aes.h | 21 + external/crypto++-5.6.3/algebra.cpp | 341 + external/crypto++-5.6.3/algebra.h | 295 + external/crypto++-5.6.3/algparam.cpp | 77 + external/crypto++-5.6.3/algparam.h | 511 + external/crypto++-5.6.3/arc4.cpp | 122 + external/crypto++-5.6.3/arc4.h | 83 + external/crypto++-5.6.3/argnames.h | 88 + external/crypto++-5.6.3/asn.cpp | 606 ++ external/crypto++-5.6.3/asn.h | 389 + external/crypto++-5.6.3/authenc.cpp | 180 + external/crypto++-5.6.3/authenc.h | 57 + external/crypto++-5.6.3/base32.cpp | 39 + external/crypto++-5.6.3/base32.h | 70 + external/crypto++-5.6.3/base64.cpp | 76 + external/crypto++-5.6.3/base64.h | 135 + external/crypto++-5.6.3/basecode.cpp | 247 + external/crypto++-5.6.3/basecode.h | 142 + external/crypto++-5.6.3/bench.cpp | 399 + external/crypto++-5.6.3/bench.h | 13 + external/crypto++-5.6.3/bench2.cpp | 337 + external/crypto++-5.6.3/bfinit.cpp | 277 + external/crypto++-5.6.3/blowfish.cpp | 99 + external/crypto++-5.6.3/blowfish.h | 56 + external/crypto++-5.6.3/blumshub.cpp | 64 + external/crypto++-5.6.3/blumshub.h | 63 + external/crypto++-5.6.3/build.sh | 10 + external/crypto++-5.6.3/camellia.cpp | 532 + external/crypto++-5.6.3/camellia.h | 48 + external/crypto++-5.6.3/cast.cpp | 296 + external/crypto++-5.6.3/cast.h | 93 + external/crypto++-5.6.3/casts.cpp | 545 + external/crypto++-5.6.3/cbcmac.cpp | 62 + external/crypto++-5.6.3/cbcmac.h | 56 + external/crypto++-5.6.3/ccm.cpp | 140 + external/crypto++-5.6.3/ccm.h | 106 + external/crypto++-5.6.3/channels.cpp | 312 + external/crypto++-5.6.3/channels.h | 134 + external/crypto++-5.6.3/clean-vs.cmd | 48 + external/crypto++-5.6.3/cmac.cpp | 126 + external/crypto++-5.6.3/cmac.h | 58 + external/crypto++-5.6.3/config.h | 715 ++ external/crypto++-5.6.3/config.recommend | 708 ++ external/crypto++-5.6.3/cpu.cpp | 268 + external/crypto++-5.6.3/cpu.h | 413 + external/crypto++-5.6.3/crc.cpp | 160 + external/crypto++-5.6.3/crc.h | 48 + external/crypto++-5.6.3/cryptdll.dsp | 606 ++ external/crypto++-5.6.3/cryptdll.vcproj | 2639 +++++ external/crypto++-5.6.3/cryptest.dsp | 207 + external/crypto++-5.6.3/cryptest.dsw | 74 + external/crypto++-5.6.3/cryptest.sh | 839 ++ external/crypto++-5.6.3/cryptest.vcproj | 1711 +++ external/crypto++-5.6.3/cryptest_bds.bdsgroup | 22 + external/crypto++-5.6.3/cryptest_bds.bdsproj | 267 + external/crypto++-5.6.3/cryptest_bds.bpf | 5 + external/crypto++-5.6.3/cryptlib.cpp | 949 ++ external/crypto++-5.6.3/cryptlib.dsp | 1216 +++ external/crypto++-5.6.3/cryptlib.h | 2667 +++++ external/crypto++-5.6.3/cryptlib.vcproj | 9653 +++++++++++++++++ external/crypto++-5.6.3/cryptlib_bds.bdsproj | 378 + external/crypto++-5.6.3/cryptlib_bds.cpp | 10 + .../crypto++-5.6.3/cryptodisablewarnings.h | 30 + .../crypto++-5.6.3/cryptopopdisablewarnings.h | 9 + external/crypto++-5.6.3/cryptopp.rc | 104 + external/crypto++-5.6.3/cryptopp563.diff | 0 .../cryptopushdisablewarnings.h | 11 + external/crypto++-5.6.3/datatest.cpp | 813 ++ external/crypto++-5.6.3/default.cpp | 273 + external/crypto++-5.6.3/default.h | 201 + external/crypto++-5.6.3/des.cpp | 453 + external/crypto++-5.6.3/des.h | 146 + external/crypto++-5.6.3/dessp.cpp | 95 + external/crypto++-5.6.3/dh.cpp | 21 + external/crypto++-5.6.3/dh.h | 107 + external/crypto++-5.6.3/dh2.cpp | 24 + external/crypto++-5.6.3/dh2.h | 65 + external/crypto++-5.6.3/dll.cpp | 160 + external/crypto++-5.6.3/dll.h | 77 + external/crypto++-5.6.3/dlltest.cpp | 207 + external/crypto++-5.6.3/dlltest.dsp | 90 + external/crypto++-5.6.3/dlltest.vcproj | 346 + external/crypto++-5.6.3/dmac.h | 99 + external/crypto++-5.6.3/dsa.cpp | 66 + external/crypto++-5.6.3/dsa.h | 41 + external/crypto++-5.6.3/eax.cpp | 59 + external/crypto++-5.6.3/eax.h | 112 + external/crypto++-5.6.3/ec2n.cpp | 294 + external/crypto++-5.6.3/ec2n.h | 134 + external/crypto++-5.6.3/eccrypto.cpp | 719 ++ external/crypto++-5.6.3/eccrypto.h | 671 ++ external/crypto++-5.6.3/ecp.cpp | 476 + external/crypto++-5.6.3/ecp.h | 145 + external/crypto++-5.6.3/elgamal.cpp | 19 + external/crypto++-5.6.3/elgamal.h | 144 + external/crypto++-5.6.3/emsa2.cpp | 35 + external/crypto++-5.6.3/emsa2.h | 88 + external/crypto++-5.6.3/eprecomp.cpp | 113 + external/crypto++-5.6.3/eprecomp.h | 93 + external/crypto++-5.6.3/esign.cpp | 221 + external/crypto++-5.6.3/esign.h | 133 + external/crypto++-5.6.3/factory.h | 139 + external/crypto++-5.6.3/files.cpp | 258 + external/crypto++-5.6.3/files.h | 113 + external/crypto++-5.6.3/filters.cpp | 1168 ++ external/crypto++-5.6.3/filters.h | 979 ++ external/crypto++-5.6.3/fips140.cpp | 88 + external/crypto++-5.6.3/fips140.h | 113 + external/crypto++-5.6.3/fipsalgt.cpp | 1294 +++ external/crypto++-5.6.3/fipstest.cpp | 615 ++ external/crypto++-5.6.3/fltrimpl.h | 85 + external/crypto++-5.6.3/gcm.cpp | 864 ++ external/crypto++-5.6.3/gcm.h | 127 + external/crypto++-5.6.3/gf256.cpp | 34 + external/crypto++-5.6.3/gf256.h | 67 + external/crypto++-5.6.3/gf2_32.cpp | 99 + external/crypto++-5.6.3/gf2_32.h | 68 + external/crypto++-5.6.3/gf2n.cpp | 903 ++ external/crypto++-5.6.3/gf2n.h | 370 + external/crypto++-5.6.3/gfpcrypt.cpp | 306 + external/crypto++-5.6.3/gfpcrypt.h | 636 ++ external/crypto++-5.6.3/gost.cpp | 123 + external/crypto++-5.6.3/gost.h | 60 + external/crypto++-5.6.3/gzip.cpp | 99 + external/crypto++-5.6.3/gzip.h | 74 + external/crypto++-5.6.3/hex.cpp | 44 + external/crypto++-5.6.3/hex.h | 42 + external/crypto++-5.6.3/hkdf.h | 100 + external/crypto++-5.6.3/hmac.cpp | 86 + external/crypto++-5.6.3/hmac.h | 64 + external/crypto++-5.6.3/hrtimer.cpp | 142 + external/crypto++-5.6.3/hrtimer.h | 63 + external/crypto++-5.6.3/ida.cpp | 423 + external/crypto++-5.6.3/ida.h | 161 + external/crypto++-5.6.3/idea.cpp | 193 + external/crypto++-5.6.3/idea.h | 63 + external/crypto++-5.6.3/integer.cpp | 4404 ++++++++ external/crypto++-5.6.3/integer.h | 570 + external/crypto++-5.6.3/iterhash.cpp | 162 + external/crypto++-5.6.3/iterhash.h | 106 + external/crypto++-5.6.3/lubyrack.h | 142 + external/crypto++-5.6.3/luc.cpp | 215 + external/crypto++-5.6.3/luc.h | 305 + external/crypto++-5.6.3/mars.cpp | 154 + external/crypto++-5.6.3/mars.h | 56 + external/crypto++-5.6.3/marss.cpp | 140 + external/crypto++-5.6.3/md2.cpp | 120 + external/crypto++-5.6.3/md2.h | 46 + external/crypto++-5.6.3/md4.cpp | 110 + external/crypto++-5.6.3/md4.h | 35 + external/crypto++-5.6.3/md5.cpp | 120 + external/crypto++-5.6.3/md5.h | 33 + external/crypto++-5.6.3/mdc.h | 73 + external/crypto++-5.6.3/mersenne.h | 193 + external/crypto++-5.6.3/misc.cpp | 210 + external/crypto++-5.6.3/misc.h | 2116 ++++ external/crypto++-5.6.3/modarith.h | 177 + external/crypto++-5.6.3/modes.cpp | 280 + external/crypto++-5.6.3/modes.h | 459 + external/crypto++-5.6.3/modexppc.h | 36 + external/crypto++-5.6.3/mqueue.cpp | 174 + external/crypto++-5.6.3/mqueue.h | 105 + external/crypto++-5.6.3/mqv.cpp | 15 + external/crypto++-5.6.3/mqv.h | 155 + external/crypto++-5.6.3/nbtheory.cpp | 1125 ++ external/crypto++-5.6.3/nbtheory.h | 173 + external/crypto++-5.6.3/network.cpp | 553 + external/crypto++-5.6.3/network.h | 235 + external/crypto++-5.6.3/nr.h | 6 + external/crypto++-5.6.3/oaep.cpp | 98 + external/crypto++-5.6.3/oaep.h | 43 + external/crypto++-5.6.3/oids.h | 129 + external/crypto++-5.6.3/osrng.cpp | 202 + external/crypto++-5.6.3/osrng.h | 256 + external/crypto++-5.6.3/panama.cpp | 518 + external/crypto++-5.6.3/panama.h | 154 + external/crypto++-5.6.3/pch.cpp | 1 + external/crypto++-5.6.3/pch.h | 24 + external/crypto++-5.6.3/pkcspad.cpp | 129 + external/crypto++-5.6.3/pkcspad.h | 99 + external/crypto++-5.6.3/polynomi.cpp | 577 + external/crypto++-5.6.3/polynomi.h | 467 + external/crypto++-5.6.3/pssr.cpp | 161 + external/crypto++-5.6.3/pssr.h | 73 + external/crypto++-5.6.3/pubkey.cpp | 170 + external/crypto++-5.6.3/pubkey.h | 1968 ++++ external/crypto++-5.6.3/pwdbased.h | 227 + external/crypto++-5.6.3/queue.cpp | 574 + external/crypto++-5.6.3/queue.h | 149 + external/crypto++-5.6.3/rabin.cpp | 222 + external/crypto++-5.6.3/rabin.h | 111 + external/crypto++-5.6.3/randpool.cpp | 74 + external/crypto++-5.6.3/randpool.h | 36 + external/crypto++-5.6.3/rc2.cpp | 118 + external/crypto++-5.6.3/rc2.h | 95 + external/crypto++-5.6.3/rc5.cpp | 80 + external/crypto++-5.6.3/rc5.h | 56 + external/crypto++-5.6.3/rc6.cpp | 97 + external/crypto++-5.6.3/rc6.h | 56 + external/crypto++-5.6.3/rdrand-masm.cmd | 117 + external/crypto++-5.6.3/rdrand-nasm.sh | 24 + external/crypto++-5.6.3/rdrand.S | 596 + external/crypto++-5.6.3/rdrand.asm | 557 + external/crypto++-5.6.3/rdrand.cpp | 515 + external/crypto++-5.6.3/rdrand.h | 186 + external/crypto++-5.6.3/rdtables.cpp | 172 + external/crypto++-5.6.3/regtest.cpp | 166 + external/crypto++-5.6.3/resource.h | 15 + external/crypto++-5.6.3/rijndael.cpp | 1277 +++ external/crypto++-5.6.3/rijndael.h | 83 + external/crypto++-5.6.3/ripemd.cpp | 803 ++ external/crypto++-5.6.3/ripemd.h | 54 + external/crypto++-5.6.3/rng.cpp | 155 + external/crypto++-5.6.3/rng.h | 110 + external/crypto++-5.6.3/rsa.cpp | 308 + external/crypto++-5.6.3/rsa.h | 178 + external/crypto++-5.6.3/rw.cpp | 204 + external/crypto++-5.6.3/rw.h | 106 + external/crypto++-5.6.3/safer.cpp | 157 + external/crypto++-5.6.3/safer.h | 88 + external/crypto++-5.6.3/salsa.cpp | 625 ++ external/crypto++-5.6.3/salsa.h | 84 + external/crypto++-5.6.3/seal.cpp | 219 + external/crypto++-5.6.3/seal.h | 50 + external/crypto++-5.6.3/secblock.h | 804 ++ external/crypto++-5.6.3/seckey.h | 428 + external/crypto++-5.6.3/seed.cpp | 104 + external/crypto++-5.6.3/seed.h | 40 + external/crypto++-5.6.3/serpent.cpp | 125 + external/crypto++-5.6.3/serpent.h | 54 + external/crypto++-5.6.3/serpentp.h | 434 + external/crypto++-5.6.3/sha.cpp | 925 ++ external/crypto++-5.6.3/sha.h | 70 + external/crypto++-5.6.3/sha3.cpp | 290 + external/crypto++-5.6.3/sha3.h | 69 + external/crypto++-5.6.3/shacal2.cpp | 140 + external/crypto++-5.6.3/shacal2.h | 56 + external/crypto++-5.6.3/shark.cpp | 140 + external/crypto++-5.6.3/shark.h | 67 + external/crypto++-5.6.3/sharkbox.cpp | 4166 +++++++ external/crypto++-5.6.3/simple.cpp | 13 + external/crypto++-5.6.3/simple.h | 289 + external/crypto++-5.6.3/skipjack.cpp | 202 + external/crypto++-5.6.3/skipjack.h | 63 + external/crypto++-5.6.3/smartptr.h | 321 + external/crypto++-5.6.3/socketft.cpp | 546 + external/crypto++-5.6.3/socketft.h | 223 + external/crypto++-5.6.3/sosemanuk.cpp | 717 ++ external/crypto++-5.6.3/sosemanuk.h | 52 + external/crypto++-5.6.3/square.cpp | 187 + external/crypto++-5.6.3/square.h | 60 + external/crypto++-5.6.3/squaretb.cpp | 582 + external/crypto++-5.6.3/stdcpp.h | 55 + external/crypto++-5.6.3/strciphr.cpp | 252 + external/crypto++-5.6.3/strciphr.h | 325 + external/crypto++-5.6.3/tea.cpp | 161 + external/crypto++-5.6.3/tea.h | 136 + external/crypto++-5.6.3/test.cpp | 963 ++ external/crypto++-5.6.3/tftables.cpp | 323 + external/crypto++-5.6.3/tiger.cpp | 276 + external/crypto++-5.6.3/tiger.h | 24 + external/crypto++-5.6.3/tigertab.cpp | 525 + external/crypto++-5.6.3/trdlocal.cpp | 104 + external/crypto++-5.6.3/trdlocal.h | 44 + external/crypto++-5.6.3/trunhash.h | 52 + external/crypto++-5.6.3/ttmac.cpp | 338 + external/crypto++-5.6.3/ttmac.h | 39 + external/crypto++-5.6.3/twofish.cpp | 169 + external/crypto++-5.6.3/twofish.h | 61 + external/crypto++-5.6.3/validat1.cpp | 1639 +++ external/crypto++-5.6.3/validat2.cpp | 852 ++ external/crypto++-5.6.3/validat3.cpp | 741 ++ external/crypto++-5.6.3/validate.h | 100 + external/crypto++-5.6.3/vmac.cpp | 910 ++ external/crypto++-5.6.3/vmac.h | 86 + external/crypto++-5.6.3/vs2010.zip | Bin 0 -> 19917 bytes external/crypto++-5.6.3/wait.cpp | 435 + external/crypto++-5.6.3/wait.h | 217 + external/crypto++-5.6.3/wake.cpp | 114 + external/crypto++-5.6.3/wake.h | 68 + external/crypto++-5.6.3/whrlpool.cpp | 723 ++ external/crypto++-5.6.3/whrlpool.h | 21 + external/crypto++-5.6.3/winpipes.cpp | 206 + external/crypto++-5.6.3/winpipes.h | 143 + external/crypto++-5.6.3/words.h | 108 + external/crypto++-5.6.3/x64dll.asm | 1968 ++++ external/crypto++-5.6.3/x64masm.asm | 1565 +++ external/crypto++-5.6.3/xtr.cpp | 102 + external/crypto++-5.6.3/xtr.h | 217 + external/crypto++-5.6.3/xtrcrypt.cpp | 112 + external/crypto++-5.6.3/xtrcrypt.h | 56 + external/crypto++-5.6.3/zdeflate.cpp | 815 ++ external/crypto++-5.6.3/zdeflate.h | 132 + external/crypto++-5.6.3/zinflate.cpp | 637 ++ external/crypto++-5.6.3/zinflate.h | 153 + external/crypto++-5.6.3/zlib.cpp | 93 + external/crypto++-5.6.3/zlib.h | 60 + public/bitvec.h | 99 +- public/dt_common.h | 5 - public/steam/isteamapplist.h | 63 + public/steam/isteamapps.h | 193 +- public/steam/isteamappticket.h | 28 + public/steam/isteamclient.h | 640 +- public/steam/isteamcontroller.h | 210 + public/steam/isteamfriends.h | 797 +- public/steam/isteamgamecoordinator.h | 75 + public/steam/isteamgameserver.h | 610 +- public/steam/isteamgameserverstats.h | 192 +- public/steam/isteamgamestats.h | 75 + public/steam/isteamhtmlsurface.h | 444 + public/steam/isteamhttp.h | 210 + public/steam/isteaminventory.h | 354 + public/steam/isteammasterserverupdater.h | 105 +- public/steam/isteammatchmaking.h | 1047 +- public/steam/isteammusic.h | 67 + public/steam/isteammusicremote.h | 129 + public/steam/isteamnetworking.h | 584 +- public/steam/isteamps3overlayrenderer.h | 91 + public/steam/isteamremotestorage.h | 720 +- public/steam/isteamscreenshots.h | 96 + public/steam/isteamstreamlauncher.h | 85 + public/steam/isteamugc.h | 385 + public/steam/isteamunifiedmessages.h | 63 + public/steam/isteamuser.h | 554 +- public/steam/isteamuserstats.h | 577 +- public/steam/isteamutils.h | 384 +- public/steam/isteamvideo.h | 60 + public/steam/matchmakingtypes.h | 486 +- public/steam/steam_api.h | 945 +- public/steam/steam_api.json | 7241 +++++++++++++ public/steam/steam_api_flat.h | 657 ++ public/steam/steam_api_interop.cs | 8803 +++++++++++++++ public/steam/steam_gameserver.h | 334 +- public/steam/steamclientpublic.h | 1874 ++-- public/steam/steamencryptedappticket.h | 32 + public/steam/steamhttpenums.h | 97 + public/steam/steamps3params.h | 112 + public/steam/steamtypes.h | 254 +- public/steam/steamuniverse.h | 27 + public/steam/steamvr_flat.h | 33 + public/steam/steamvr_interop.cs | 285 + public/tier0/annotations.h | 84 + public/tier0/dbg.h | 21 + public/tier0/fasttimer.h | 4 +- public/tier0/platform.h | 21 +- public/tier0/threadtools.h | 2 + public/tier0/valve_minmax_off.h | 7 + public/tier0/valve_minmax_on.h | 9 + public/tier1/KeyValues.h | 20 + public/tier1/UtlSortVector.h | 225 +- public/tier1/checksum_sha1.h | 174 + public/tier1/convar.h | 1 + public/tier1/fmtstr.h | 106 +- public/tier1/ilocalize.h | 504 + public/tier1/kvpacker.h | 49 + public/tier1/mempool.h | 16 +- public/tier1/passwordhash.h | 94 + public/tier1/reliabletimer.h | 183 + public/tier1/smartptr.h | 16 +- public/tier1/thash.h | 698 ++ public/tier1/utlallocation.h | 134 + public/tier1/utlcommon.h | 371 + public/tier1/utldict.h | 4 +- public/tier1/utlhashtable.h | 988 ++ public/tier1/utlmap.h | 32 +- public/tier1/utlrbtree.h | 10 + public/tier1/utlstring.h | 130 + public/tier1/utlvector.h | 94 +- public/vstdlib/coroutine.h | 69 + public/vstdlib/osversion.h | 60 + tier1/checksum_sha1.cpp | 299 + tier1/reliabletimer.cpp | 93 + 478 files changed, 165556 insertions(+), 3331 deletions(-) create mode 100644 common/crypto.cpp create mode 100644 common/crypto.h create mode 100644 common/language.cpp create mode 100644 common/language.h create mode 100644 common/simplebitstring.cpp create mode 100644 common/simplebitstring.h create mode 100644 external/crypto++-5.6.3/3way.cpp create mode 100644 external/crypto++-5.6.3/3way.h create mode 100644 external/crypto++-5.6.3/Doxyfile create mode 100644 external/crypto++-5.6.3/Filelist.txt create mode 100644 external/crypto++-5.6.3/GNUmakefile create mode 100644 external/crypto++-5.6.3/GNUmakefile-cross create mode 100644 external/crypto++-5.6.3/Install.txt create mode 100644 external/crypto++-5.6.3/License.txt create mode 100644 external/crypto++-5.6.3/Readme.txt create mode 100644 external/crypto++-5.6.3/TestData/3desval.dat create mode 100644 external/crypto++-5.6.3/TestData/3wayval.dat create mode 100644 external/crypto++-5.6.3/TestData/camellia.dat create mode 100644 external/crypto++-5.6.3/TestData/cast128v.dat create mode 100644 external/crypto++-5.6.3/TestData/cast256v.dat create mode 100644 external/crypto++-5.6.3/TestData/descert.dat create mode 100644 external/crypto++-5.6.3/TestData/dh1024.dat create mode 100644 external/crypto++-5.6.3/TestData/dh2048.dat create mode 100644 external/crypto++-5.6.3/TestData/dlie1024.dat create mode 100644 external/crypto++-5.6.3/TestData/dlie2048.dat create mode 100644 external/crypto++-5.6.3/TestData/dsa1024.dat create mode 100644 external/crypto++-5.6.3/TestData/dsa1024b.dat create mode 100644 external/crypto++-5.6.3/TestData/dsa512.dat create mode 100644 external/crypto++-5.6.3/TestData/elgc1024.dat create mode 100644 external/crypto++-5.6.3/TestData/esig1023.dat create mode 100644 external/crypto++-5.6.3/TestData/esig1536.dat create mode 100644 external/crypto++-5.6.3/TestData/esig2046.dat create mode 100644 external/crypto++-5.6.3/TestData/gostval.dat create mode 100644 external/crypto++-5.6.3/TestData/ideaval.dat create mode 100644 external/crypto++-5.6.3/TestData/luc1024.dat create mode 100644 external/crypto++-5.6.3/TestData/luc2048.dat create mode 100644 external/crypto++-5.6.3/TestData/lucc1024.dat create mode 100644 external/crypto++-5.6.3/TestData/lucc512.dat create mode 100644 external/crypto++-5.6.3/TestData/lucd1024.dat create mode 100644 external/crypto++-5.6.3/TestData/lucd512.dat create mode 100644 external/crypto++-5.6.3/TestData/lucs1024.dat create mode 100644 external/crypto++-5.6.3/TestData/lucs512.dat create mode 100644 external/crypto++-5.6.3/TestData/marsval.dat create mode 100644 external/crypto++-5.6.3/TestData/mqv1024.dat create mode 100644 external/crypto++-5.6.3/TestData/mqv2048.dat create mode 100644 external/crypto++-5.6.3/TestData/nr1024.dat create mode 100644 external/crypto++-5.6.3/TestData/nr2048.dat create mode 100644 external/crypto++-5.6.3/TestData/rabi1024.dat create mode 100644 external/crypto++-5.6.3/TestData/rabi2048.dat create mode 100644 external/crypto++-5.6.3/TestData/rc2val.dat create mode 100644 external/crypto++-5.6.3/TestData/rc5val.dat create mode 100644 external/crypto++-5.6.3/TestData/rc6val.dat create mode 100644 external/crypto++-5.6.3/TestData/rijndael.dat create mode 100644 external/crypto++-5.6.3/TestData/rsa1024.dat create mode 100644 external/crypto++-5.6.3/TestData/rsa2048.dat create mode 100644 external/crypto++-5.6.3/TestData/rsa400pb.dat create mode 100644 external/crypto++-5.6.3/TestData/rsa400pv.dat create mode 100644 external/crypto++-5.6.3/TestData/rsa512a.dat create mode 100644 external/crypto++-5.6.3/TestData/rw1024.dat create mode 100644 external/crypto++-5.6.3/TestData/rw2048.dat create mode 100644 external/crypto++-5.6.3/TestData/saferval.dat create mode 100644 external/crypto++-5.6.3/TestData/serpentv.dat create mode 100644 external/crypto++-5.6.3/TestData/shacal2v.dat create mode 100644 external/crypto++-5.6.3/TestData/sharkval.dat create mode 100644 external/crypto++-5.6.3/TestData/skipjack.dat create mode 100644 external/crypto++-5.6.3/TestData/squareva.dat create mode 100644 external/crypto++-5.6.3/TestData/twofishv.dat create mode 100644 external/crypto++-5.6.3/TestData/usage.dat create mode 100644 external/crypto++-5.6.3/TestData/xtrdh171.dat create mode 100644 external/crypto++-5.6.3/TestData/xtrdh342.dat create mode 100644 external/crypto++-5.6.3/TestVectors/Readme.txt create mode 100644 external/crypto++-5.6.3/TestVectors/aes.txt create mode 100644 external/crypto++-5.6.3/TestVectors/all.txt create mode 100644 external/crypto++-5.6.3/TestVectors/camellia.txt create mode 100644 external/crypto++-5.6.3/TestVectors/ccm.txt create mode 100644 external/crypto++-5.6.3/TestVectors/cmac.txt create mode 100644 external/crypto++-5.6.3/TestVectors/dlies.txt create mode 100644 external/crypto++-5.6.3/TestVectors/dsa.txt create mode 100644 external/crypto++-5.6.3/TestVectors/dsa_1363.txt create mode 100644 external/crypto++-5.6.3/TestVectors/eax.txt create mode 100644 external/crypto++-5.6.3/TestVectors/esign.txt create mode 100644 external/crypto++-5.6.3/TestVectors/gcm.txt create mode 100644 external/crypto++-5.6.3/TestVectors/hkdf.txt create mode 100644 external/crypto++-5.6.3/TestVectors/hmac.txt create mode 100644 external/crypto++-5.6.3/TestVectors/mars.txt create mode 100644 external/crypto++-5.6.3/TestVectors/nr.txt create mode 100644 external/crypto++-5.6.3/TestVectors/panama.txt create mode 100644 external/crypto++-5.6.3/TestVectors/rsa_oaep.txt create mode 100644 external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt create mode 100644 external/crypto++-5.6.3/TestVectors/rsa_pss.txt create mode 100644 external/crypto++-5.6.3/TestVectors/rw.txt create mode 100644 external/crypto++-5.6.3/TestVectors/salsa.txt create mode 100644 external/crypto++-5.6.3/TestVectors/seal.txt create mode 100644 external/crypto++-5.6.3/TestVectors/seed.txt create mode 100644 external/crypto++-5.6.3/TestVectors/sha.txt create mode 100644 external/crypto++-5.6.3/TestVectors/sha3.txt create mode 100644 external/crypto++-5.6.3/TestVectors/shacal2.txt create mode 100644 external/crypto++-5.6.3/TestVectors/sosemanuk.txt create mode 100644 external/crypto++-5.6.3/TestVectors/tea.txt create mode 100644 external/crypto++-5.6.3/TestVectors/ttmac.txt create mode 100644 external/crypto++-5.6.3/TestVectors/vmac.txt create mode 100644 external/crypto++-5.6.3/TestVectors/wake.txt create mode 100644 external/crypto++-5.6.3/TestVectors/whrlpool.txt create mode 100644 external/crypto++-5.6.3/adhoc.cpp.proto create mode 100644 external/crypto++-5.6.3/adler32.cpp create mode 100644 external/crypto++-5.6.3/adler32.h create mode 100644 external/crypto++-5.6.3/aes.h create mode 100644 external/crypto++-5.6.3/algebra.cpp create mode 100644 external/crypto++-5.6.3/algebra.h create mode 100644 external/crypto++-5.6.3/algparam.cpp create mode 100644 external/crypto++-5.6.3/algparam.h create mode 100644 external/crypto++-5.6.3/arc4.cpp create mode 100644 external/crypto++-5.6.3/arc4.h create mode 100644 external/crypto++-5.6.3/argnames.h create mode 100644 external/crypto++-5.6.3/asn.cpp create mode 100644 external/crypto++-5.6.3/asn.h create mode 100644 external/crypto++-5.6.3/authenc.cpp create mode 100644 external/crypto++-5.6.3/authenc.h create mode 100644 external/crypto++-5.6.3/base32.cpp create mode 100644 external/crypto++-5.6.3/base32.h create mode 100644 external/crypto++-5.6.3/base64.cpp create mode 100644 external/crypto++-5.6.3/base64.h create mode 100644 external/crypto++-5.6.3/basecode.cpp create mode 100644 external/crypto++-5.6.3/basecode.h create mode 100644 external/crypto++-5.6.3/bench.cpp create mode 100644 external/crypto++-5.6.3/bench.h create mode 100644 external/crypto++-5.6.3/bench2.cpp create mode 100644 external/crypto++-5.6.3/bfinit.cpp create mode 100644 external/crypto++-5.6.3/blowfish.cpp create mode 100644 external/crypto++-5.6.3/blowfish.h create mode 100644 external/crypto++-5.6.3/blumshub.cpp create mode 100644 external/crypto++-5.6.3/blumshub.h create mode 100644 external/crypto++-5.6.3/build.sh create mode 100644 external/crypto++-5.6.3/camellia.cpp create mode 100644 external/crypto++-5.6.3/camellia.h create mode 100644 external/crypto++-5.6.3/cast.cpp create mode 100644 external/crypto++-5.6.3/cast.h create mode 100644 external/crypto++-5.6.3/casts.cpp create mode 100644 external/crypto++-5.6.3/cbcmac.cpp create mode 100644 external/crypto++-5.6.3/cbcmac.h create mode 100644 external/crypto++-5.6.3/ccm.cpp create mode 100644 external/crypto++-5.6.3/ccm.h create mode 100644 external/crypto++-5.6.3/channels.cpp create mode 100644 external/crypto++-5.6.3/channels.h create mode 100644 external/crypto++-5.6.3/clean-vs.cmd create mode 100644 external/crypto++-5.6.3/cmac.cpp create mode 100644 external/crypto++-5.6.3/cmac.h create mode 100644 external/crypto++-5.6.3/config.h create mode 100644 external/crypto++-5.6.3/config.recommend create mode 100644 external/crypto++-5.6.3/cpu.cpp create mode 100644 external/crypto++-5.6.3/cpu.h create mode 100644 external/crypto++-5.6.3/crc.cpp create mode 100644 external/crypto++-5.6.3/crc.h create mode 100644 external/crypto++-5.6.3/cryptdll.dsp create mode 100644 external/crypto++-5.6.3/cryptdll.vcproj create mode 100644 external/crypto++-5.6.3/cryptest.dsp create mode 100644 external/crypto++-5.6.3/cryptest.dsw create mode 100644 external/crypto++-5.6.3/cryptest.sh create mode 100644 external/crypto++-5.6.3/cryptest.vcproj create mode 100644 external/crypto++-5.6.3/cryptest_bds.bdsgroup create mode 100644 external/crypto++-5.6.3/cryptest_bds.bdsproj create mode 100644 external/crypto++-5.6.3/cryptest_bds.bpf create mode 100644 external/crypto++-5.6.3/cryptlib.cpp create mode 100644 external/crypto++-5.6.3/cryptlib.dsp create mode 100644 external/crypto++-5.6.3/cryptlib.h create mode 100644 external/crypto++-5.6.3/cryptlib.vcproj create mode 100644 external/crypto++-5.6.3/cryptlib_bds.bdsproj create mode 100644 external/crypto++-5.6.3/cryptlib_bds.cpp create mode 100644 external/crypto++-5.6.3/cryptodisablewarnings.h create mode 100644 external/crypto++-5.6.3/cryptopopdisablewarnings.h create mode 100644 external/crypto++-5.6.3/cryptopp.rc create mode 100644 external/crypto++-5.6.3/cryptopp563.diff create mode 100644 external/crypto++-5.6.3/cryptopushdisablewarnings.h create mode 100644 external/crypto++-5.6.3/datatest.cpp create mode 100644 external/crypto++-5.6.3/default.cpp create mode 100644 external/crypto++-5.6.3/default.h create mode 100644 external/crypto++-5.6.3/des.cpp create mode 100644 external/crypto++-5.6.3/des.h create mode 100644 external/crypto++-5.6.3/dessp.cpp create mode 100644 external/crypto++-5.6.3/dh.cpp create mode 100644 external/crypto++-5.6.3/dh.h create mode 100644 external/crypto++-5.6.3/dh2.cpp create mode 100644 external/crypto++-5.6.3/dh2.h create mode 100644 external/crypto++-5.6.3/dll.cpp create mode 100644 external/crypto++-5.6.3/dll.h create mode 100644 external/crypto++-5.6.3/dlltest.cpp create mode 100644 external/crypto++-5.6.3/dlltest.dsp create mode 100644 external/crypto++-5.6.3/dlltest.vcproj create mode 100644 external/crypto++-5.6.3/dmac.h create mode 100644 external/crypto++-5.6.3/dsa.cpp create mode 100644 external/crypto++-5.6.3/dsa.h create mode 100644 external/crypto++-5.6.3/eax.cpp create mode 100644 external/crypto++-5.6.3/eax.h create mode 100644 external/crypto++-5.6.3/ec2n.cpp create mode 100644 external/crypto++-5.6.3/ec2n.h create mode 100644 external/crypto++-5.6.3/eccrypto.cpp create mode 100644 external/crypto++-5.6.3/eccrypto.h create mode 100644 external/crypto++-5.6.3/ecp.cpp create mode 100644 external/crypto++-5.6.3/ecp.h create mode 100644 external/crypto++-5.6.3/elgamal.cpp create mode 100644 external/crypto++-5.6.3/elgamal.h create mode 100644 external/crypto++-5.6.3/emsa2.cpp create mode 100644 external/crypto++-5.6.3/emsa2.h create mode 100644 external/crypto++-5.6.3/eprecomp.cpp create mode 100644 external/crypto++-5.6.3/eprecomp.h create mode 100644 external/crypto++-5.6.3/esign.cpp create mode 100644 external/crypto++-5.6.3/esign.h create mode 100644 external/crypto++-5.6.3/factory.h create mode 100644 external/crypto++-5.6.3/files.cpp create mode 100644 external/crypto++-5.6.3/files.h create mode 100644 external/crypto++-5.6.3/filters.cpp create mode 100644 external/crypto++-5.6.3/filters.h create mode 100644 external/crypto++-5.6.3/fips140.cpp create mode 100644 external/crypto++-5.6.3/fips140.h create mode 100644 external/crypto++-5.6.3/fipsalgt.cpp create mode 100644 external/crypto++-5.6.3/fipstest.cpp create mode 100644 external/crypto++-5.6.3/fltrimpl.h create mode 100644 external/crypto++-5.6.3/gcm.cpp create mode 100644 external/crypto++-5.6.3/gcm.h create mode 100644 external/crypto++-5.6.3/gf256.cpp create mode 100644 external/crypto++-5.6.3/gf256.h create mode 100644 external/crypto++-5.6.3/gf2_32.cpp create mode 100644 external/crypto++-5.6.3/gf2_32.h create mode 100644 external/crypto++-5.6.3/gf2n.cpp create mode 100644 external/crypto++-5.6.3/gf2n.h create mode 100644 external/crypto++-5.6.3/gfpcrypt.cpp create mode 100644 external/crypto++-5.6.3/gfpcrypt.h create mode 100644 external/crypto++-5.6.3/gost.cpp create mode 100644 external/crypto++-5.6.3/gost.h create mode 100644 external/crypto++-5.6.3/gzip.cpp create mode 100644 external/crypto++-5.6.3/gzip.h create mode 100644 external/crypto++-5.6.3/hex.cpp create mode 100644 external/crypto++-5.6.3/hex.h create mode 100644 external/crypto++-5.6.3/hkdf.h create mode 100644 external/crypto++-5.6.3/hmac.cpp create mode 100644 external/crypto++-5.6.3/hmac.h create mode 100644 external/crypto++-5.6.3/hrtimer.cpp create mode 100644 external/crypto++-5.6.3/hrtimer.h create mode 100644 external/crypto++-5.6.3/ida.cpp create mode 100644 external/crypto++-5.6.3/ida.h create mode 100644 external/crypto++-5.6.3/idea.cpp create mode 100644 external/crypto++-5.6.3/idea.h create mode 100644 external/crypto++-5.6.3/integer.cpp create mode 100644 external/crypto++-5.6.3/integer.h create mode 100644 external/crypto++-5.6.3/iterhash.cpp create mode 100644 external/crypto++-5.6.3/iterhash.h create mode 100644 external/crypto++-5.6.3/lubyrack.h create mode 100644 external/crypto++-5.6.3/luc.cpp create mode 100644 external/crypto++-5.6.3/luc.h create mode 100644 external/crypto++-5.6.3/mars.cpp create mode 100644 external/crypto++-5.6.3/mars.h create mode 100644 external/crypto++-5.6.3/marss.cpp create mode 100644 external/crypto++-5.6.3/md2.cpp create mode 100644 external/crypto++-5.6.3/md2.h create mode 100644 external/crypto++-5.6.3/md4.cpp create mode 100644 external/crypto++-5.6.3/md4.h create mode 100644 external/crypto++-5.6.3/md5.cpp create mode 100644 external/crypto++-5.6.3/md5.h create mode 100644 external/crypto++-5.6.3/mdc.h create mode 100644 external/crypto++-5.6.3/mersenne.h create mode 100644 external/crypto++-5.6.3/misc.cpp create mode 100644 external/crypto++-5.6.3/misc.h create mode 100644 external/crypto++-5.6.3/modarith.h create mode 100644 external/crypto++-5.6.3/modes.cpp create mode 100644 external/crypto++-5.6.3/modes.h create mode 100644 external/crypto++-5.6.3/modexppc.h create mode 100644 external/crypto++-5.6.3/mqueue.cpp create mode 100644 external/crypto++-5.6.3/mqueue.h create mode 100644 external/crypto++-5.6.3/mqv.cpp create mode 100644 external/crypto++-5.6.3/mqv.h create mode 100644 external/crypto++-5.6.3/nbtheory.cpp create mode 100644 external/crypto++-5.6.3/nbtheory.h create mode 100644 external/crypto++-5.6.3/network.cpp create mode 100644 external/crypto++-5.6.3/network.h create mode 100644 external/crypto++-5.6.3/nr.h create mode 100644 external/crypto++-5.6.3/oaep.cpp create mode 100644 external/crypto++-5.6.3/oaep.h create mode 100644 external/crypto++-5.6.3/oids.h create mode 100644 external/crypto++-5.6.3/osrng.cpp create mode 100644 external/crypto++-5.6.3/osrng.h create mode 100644 external/crypto++-5.6.3/panama.cpp create mode 100644 external/crypto++-5.6.3/panama.h create mode 100644 external/crypto++-5.6.3/pch.cpp create mode 100644 external/crypto++-5.6.3/pch.h create mode 100644 external/crypto++-5.6.3/pkcspad.cpp create mode 100644 external/crypto++-5.6.3/pkcspad.h create mode 100644 external/crypto++-5.6.3/polynomi.cpp create mode 100644 external/crypto++-5.6.3/polynomi.h create mode 100644 external/crypto++-5.6.3/pssr.cpp create mode 100644 external/crypto++-5.6.3/pssr.h create mode 100644 external/crypto++-5.6.3/pubkey.cpp create mode 100644 external/crypto++-5.6.3/pubkey.h create mode 100644 external/crypto++-5.6.3/pwdbased.h create mode 100644 external/crypto++-5.6.3/queue.cpp create mode 100644 external/crypto++-5.6.3/queue.h create mode 100644 external/crypto++-5.6.3/rabin.cpp create mode 100644 external/crypto++-5.6.3/rabin.h create mode 100644 external/crypto++-5.6.3/randpool.cpp create mode 100644 external/crypto++-5.6.3/randpool.h create mode 100644 external/crypto++-5.6.3/rc2.cpp create mode 100644 external/crypto++-5.6.3/rc2.h create mode 100644 external/crypto++-5.6.3/rc5.cpp create mode 100644 external/crypto++-5.6.3/rc5.h create mode 100644 external/crypto++-5.6.3/rc6.cpp create mode 100644 external/crypto++-5.6.3/rc6.h create mode 100644 external/crypto++-5.6.3/rdrand-masm.cmd create mode 100644 external/crypto++-5.6.3/rdrand-nasm.sh create mode 100644 external/crypto++-5.6.3/rdrand.S create mode 100644 external/crypto++-5.6.3/rdrand.asm create mode 100644 external/crypto++-5.6.3/rdrand.cpp create mode 100644 external/crypto++-5.6.3/rdrand.h create mode 100644 external/crypto++-5.6.3/rdtables.cpp create mode 100644 external/crypto++-5.6.3/regtest.cpp create mode 100644 external/crypto++-5.6.3/resource.h create mode 100644 external/crypto++-5.6.3/rijndael.cpp create mode 100644 external/crypto++-5.6.3/rijndael.h create mode 100644 external/crypto++-5.6.3/ripemd.cpp create mode 100644 external/crypto++-5.6.3/ripemd.h create mode 100644 external/crypto++-5.6.3/rng.cpp create mode 100644 external/crypto++-5.6.3/rng.h create mode 100644 external/crypto++-5.6.3/rsa.cpp create mode 100644 external/crypto++-5.6.3/rsa.h create mode 100644 external/crypto++-5.6.3/rw.cpp create mode 100644 external/crypto++-5.6.3/rw.h create mode 100644 external/crypto++-5.6.3/safer.cpp create mode 100644 external/crypto++-5.6.3/safer.h create mode 100644 external/crypto++-5.6.3/salsa.cpp create mode 100644 external/crypto++-5.6.3/salsa.h create mode 100644 external/crypto++-5.6.3/seal.cpp create mode 100644 external/crypto++-5.6.3/seal.h create mode 100644 external/crypto++-5.6.3/secblock.h create mode 100644 external/crypto++-5.6.3/seckey.h create mode 100644 external/crypto++-5.6.3/seed.cpp create mode 100644 external/crypto++-5.6.3/seed.h create mode 100644 external/crypto++-5.6.3/serpent.cpp create mode 100644 external/crypto++-5.6.3/serpent.h create mode 100644 external/crypto++-5.6.3/serpentp.h create mode 100644 external/crypto++-5.6.3/sha.cpp create mode 100644 external/crypto++-5.6.3/sha.h create mode 100644 external/crypto++-5.6.3/sha3.cpp create mode 100644 external/crypto++-5.6.3/sha3.h create mode 100644 external/crypto++-5.6.3/shacal2.cpp create mode 100644 external/crypto++-5.6.3/shacal2.h create mode 100644 external/crypto++-5.6.3/shark.cpp create mode 100644 external/crypto++-5.6.3/shark.h create mode 100644 external/crypto++-5.6.3/sharkbox.cpp create mode 100644 external/crypto++-5.6.3/simple.cpp create mode 100644 external/crypto++-5.6.3/simple.h create mode 100644 external/crypto++-5.6.3/skipjack.cpp create mode 100644 external/crypto++-5.6.3/skipjack.h create mode 100644 external/crypto++-5.6.3/smartptr.h create mode 100644 external/crypto++-5.6.3/socketft.cpp create mode 100644 external/crypto++-5.6.3/socketft.h create mode 100644 external/crypto++-5.6.3/sosemanuk.cpp create mode 100644 external/crypto++-5.6.3/sosemanuk.h create mode 100644 external/crypto++-5.6.3/square.cpp create mode 100644 external/crypto++-5.6.3/square.h create mode 100644 external/crypto++-5.6.3/squaretb.cpp create mode 100644 external/crypto++-5.6.3/stdcpp.h create mode 100644 external/crypto++-5.6.3/strciphr.cpp create mode 100644 external/crypto++-5.6.3/strciphr.h create mode 100644 external/crypto++-5.6.3/tea.cpp create mode 100644 external/crypto++-5.6.3/tea.h create mode 100644 external/crypto++-5.6.3/test.cpp create mode 100644 external/crypto++-5.6.3/tftables.cpp create mode 100644 external/crypto++-5.6.3/tiger.cpp create mode 100644 external/crypto++-5.6.3/tiger.h create mode 100644 external/crypto++-5.6.3/tigertab.cpp create mode 100644 external/crypto++-5.6.3/trdlocal.cpp create mode 100644 external/crypto++-5.6.3/trdlocal.h create mode 100644 external/crypto++-5.6.3/trunhash.h create mode 100644 external/crypto++-5.6.3/ttmac.cpp create mode 100644 external/crypto++-5.6.3/ttmac.h create mode 100644 external/crypto++-5.6.3/twofish.cpp create mode 100644 external/crypto++-5.6.3/twofish.h create mode 100644 external/crypto++-5.6.3/validat1.cpp create mode 100644 external/crypto++-5.6.3/validat2.cpp create mode 100644 external/crypto++-5.6.3/validat3.cpp create mode 100644 external/crypto++-5.6.3/validate.h create mode 100644 external/crypto++-5.6.3/vmac.cpp create mode 100644 external/crypto++-5.6.3/vmac.h create mode 100644 external/crypto++-5.6.3/vs2010.zip create mode 100644 external/crypto++-5.6.3/wait.cpp create mode 100644 external/crypto++-5.6.3/wait.h create mode 100644 external/crypto++-5.6.3/wake.cpp create mode 100644 external/crypto++-5.6.3/wake.h create mode 100644 external/crypto++-5.6.3/whrlpool.cpp create mode 100644 external/crypto++-5.6.3/whrlpool.h create mode 100644 external/crypto++-5.6.3/winpipes.cpp create mode 100644 external/crypto++-5.6.3/winpipes.h create mode 100644 external/crypto++-5.6.3/words.h create mode 100644 external/crypto++-5.6.3/x64dll.asm create mode 100644 external/crypto++-5.6.3/x64masm.asm create mode 100644 external/crypto++-5.6.3/xtr.cpp create mode 100644 external/crypto++-5.6.3/xtr.h create mode 100644 external/crypto++-5.6.3/xtrcrypt.cpp create mode 100644 external/crypto++-5.6.3/xtrcrypt.h create mode 100644 external/crypto++-5.6.3/zdeflate.cpp create mode 100644 external/crypto++-5.6.3/zdeflate.h create mode 100644 external/crypto++-5.6.3/zinflate.cpp create mode 100644 external/crypto++-5.6.3/zinflate.h create mode 100644 external/crypto++-5.6.3/zlib.cpp create mode 100644 external/crypto++-5.6.3/zlib.h create mode 100644 public/steam/isteamapplist.h create mode 100644 public/steam/isteamappticket.h create mode 100644 public/steam/isteamcontroller.h create mode 100644 public/steam/isteamgamecoordinator.h create mode 100644 public/steam/isteamgamestats.h create mode 100644 public/steam/isteamhtmlsurface.h create mode 100644 public/steam/isteamhttp.h create mode 100644 public/steam/isteaminventory.h create mode 100644 public/steam/isteammusic.h create mode 100644 public/steam/isteammusicremote.h create mode 100644 public/steam/isteamps3overlayrenderer.h create mode 100644 public/steam/isteamscreenshots.h create mode 100644 public/steam/isteamstreamlauncher.h create mode 100644 public/steam/isteamugc.h create mode 100644 public/steam/isteamunifiedmessages.h create mode 100644 public/steam/isteamvideo.h create mode 100644 public/steam/steam_api.json create mode 100644 public/steam/steam_api_flat.h create mode 100644 public/steam/steam_api_interop.cs create mode 100644 public/steam/steamencryptedappticket.h create mode 100644 public/steam/steamhttpenums.h create mode 100644 public/steam/steamps3params.h create mode 100644 public/steam/steamuniverse.h create mode 100644 public/steam/steamvr_flat.h create mode 100644 public/steam/steamvr_interop.cs create mode 100644 public/tier0/annotations.h create mode 100644 public/tier0/valve_minmax_off.h create mode 100644 public/tier0/valve_minmax_on.h create mode 100644 public/tier1/checksum_sha1.h create mode 100644 public/tier1/ilocalize.h create mode 100644 public/tier1/kvpacker.h create mode 100644 public/tier1/passwordhash.h create mode 100644 public/tier1/reliabletimer.h create mode 100644 public/tier1/thash.h create mode 100644 public/tier1/utlallocation.h create mode 100644 public/tier1/utlcommon.h create mode 100644 public/tier1/utlhashtable.h create mode 100644 public/vstdlib/coroutine.h create mode 100644 public/vstdlib/osversion.h create mode 100644 tier1/checksum_sha1.cpp create mode 100644 tier1/reliabletimer.cpp diff --git a/common/crypto.cpp b/common/crypto.cpp new file mode 100644 index 000000000..8ef69cdf8 --- /dev/null +++ b/common/crypto.cpp @@ -0,0 +1,2219 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// Note: not using precompiled headers. The crypto++ headers create gunk that anyone including them +// has to link to, so they can't be included in the global project file. They also contain +// string functions which are deprecated by the global project file so they can't be included after, either. +// So we can't use the global precompiled header, need to manually include the things we need. + +//#include "winlite.h" + +#ifdef POSIX +#include +#include +#endif + +/* this stuff needs to be before the crypto headers, as it relies on memdbg, which doesn't + do the right thing in the face of xdebug getting included below */ +// tier0 +//#include "tier0/tier0.h" +#include "tier0/basetypes.h" +#include "tier0/vprof.h" +//#include "constants.h" +#include "vstdlib/vstdlib.h" +#include "strtools.h" +//#include "version.h" +//#include "globals.h" +//#include "ivalidate.h" +#include "tier1/utlvector.h" +#include "simplebitstring.h" +#include "tier1/checksum_sha1.h" +#include "tier0/memdbgon.h" +#include "tier0/tslist.h" +#include "tier0/memdbgoff.h" + + +#ifdef ENABLE_OPENSSLCONNECTION +#define USE_OPENSSL_AES_DECRYPT 1 +#endif + +#ifdef USE_OPENSSL_AES_DECRYPT +// openssl optimized AES routines +#include "openssl/aes.h" +#if defined(_M_IX86) || defined (_M_X64) || defined(__i386__) || defined(__x86_64__) +#include +#endif +#endif + +// crypto ++ +#include "tier0/valve_off.h" +#include "../external/crypto++-5.6.3/cryptopushdisablewarnings.h" +#if _MSC_VER < 1400 // doesn't work with vc8, things below need xdebug +#define _XDEBUG_ // keep crypto++-5.2 from including xdebug +// these are defined in xdebug and used in some subsequent headers, define them to be our version +#define _NEW_CRT new +#define _DELETE_CRT(_P) delete (_P) +#define _DELETE_CRT_VEC(_P) delete[] (_P) +#define _STRING_CRT string +#endif +#define CRYPTOPP_DLL +#undef min +#undef max +#undef Verify +#define VPROF_BUDGETGROUP_ENCRYPTION _T("Encryption") +#define SPEW_CRYPTO "crypto" +const int k_cMedBuff = 1024; // medium buffer + +#if defined(GNUC) +#pragma GCC diagnostic ignored "-Wshadow" +#endif + +#include "../external/crypto++-5.6.3/cryptlib.h" +#include "../external/crypto++-5.6.3/osrng.h" +#include "../external/crypto++-5.6.3/crc.h" +#include "../external/crypto++-5.6.3/modes.h" +#include "../external/crypto++-5.6.3/files.h" +#include "../external/crypto++-5.6.3/hex.h" +#include "../external/crypto++-5.6.3/base64.h" +#include "../external/crypto++-5.6.3/base32.h" +#include "../external/crypto++-5.6.3/words.h" +#include "../external/crypto++-5.6.3/rsa.h" +#include "../external/crypto++-5.6.3/aes.h" +#include "../external/crypto++-5.6.3/hmac.h" +#include "../external/crypto++-5.6.3/zlib.h" +#include "../external/crypto++-5.6.3/gzip.h" +#include "../external/crypto++-5.6.3/pwdbased.h" +using namespace CryptoPP; +typedef AutoSeededX917RNG CAutoSeededRNG; +#include "../external/crypto++-5.6.3/cryptopopdisablewarnings.h" + +#if defined(GNUC) +#pragma GCC diagnostic warning "-Wshadow" +#endif + +#include "tier0/memdbgon.h" +#include "tier0/valve_on.h" + +#include "crypto.h" +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) + + +// list of auto-seeded RNG pointers +// these are very expensive to construct, so it makes sense to cache them +CTSList g_tslistPAutoSeededRNG; + +// to avoid deconstructor order issuses we allow to manually free the list +void FreeListRNG() +{ + g_tslistPAutoSeededRNG.Purge(); +} + +//----------------------------------------------------------------------------- +// Purpose: thread-safe access to a pool of cryptoPP random number generators +//----------------------------------------------------------------------------- +class CPoolAllocatedRNG +{ +public: + CPoolAllocatedRNG() + { + m_pRNGNode = g_tslistPAutoSeededRNG.Pop(); + if ( !m_pRNGNode ) + { + m_pRNGNode = new CTSList::Node_t; + } + } + + ~CPoolAllocatedRNG() + { + g_tslistPAutoSeededRNG.Push( m_pRNGNode ); + } + + CAutoSeededRNG &GetRNG() + { + return m_pRNGNode->elem; + } + +private: + CTSList::Node_t *m_pRNGNode; +}; + +// force run this static construction code +class CGlobalInitConstructor +{ +public: + CGlobalInitConstructor() + { + // we have to use this function once since the underlying static constructor + // is not thread safe. See use of MicrosoftCryptoProvider in Crypto++ + CAutoSeededRNG rng; + rng.GenerateByte(); + } +}; + +volatile static CGlobalInitConstructor s_StaticCryptoConstructor; + +//----------------------------------------------------------------------------- +// Purpose: Encrypts the specified data with the specified key. Uses AES (Rijndael) symmetric +// encryption. The encrypted data may then be decrypted by calling SymmetricDecrypt +// with the same key. +// Input: pubPlaintextData - Data to be encrypted +// cubPlaintextData - Size of data to be encrypted +// pIV - Pointer to initialization vector +// cubIV - Size of initialization vector +// pubEncryptedData - Pointer to buffer to receive encrypted data +// pcubEncryptedData - Pointer to a variable that at time of call contains the size of +// the receive buffer for encrypted data. When the method returns, this will contain +// the actual size of the encrypted data. +// pubKey - the key to encrypt the data with +// cubKey - Size of the key (must be k_nSymmetricKeyLen) +// Output: true if successful, false if encryption failed +//----------------------------------------------------------------------------- +bool CCrypto::SymmetricEncryptWithIV( const uint8 *pubPlaintextData, const uint32 cubPlaintextData, + const uint8 *pIV, const uint32 cubIV, + uint8 *pubEncryptedData, uint32 *pcubEncryptedData, + const uint8 *pubKey, const uint32 cubKey ) +{ + //VPROF_BUDGET( "CCrypto::SymmetricEncrypt", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubPlaintextData ); + Assert( cubPlaintextData ); + Assert( pubEncryptedData ); + Assert( pcubEncryptedData ); + Assert( *pcubEncryptedData ); + Assert( pubKey ); + Assert( k_nSymmetricKeyLen == cubKey ); // the only key length supported is k_nSymmetricKeyLen + + bool bRet = false; + + uint32 cubEncryptedData = *pcubEncryptedData; // remember how big the caller's buffer is + bool bUseTempBuffer = false; + uint8 *pTemp = pubEncryptedData; + + + // + // Crypto++ does not play well with overlapping buffers. If the buffers are + // overlapping, then allocate some temp space to use for the encryption. + // + // It does work fine with _identical_ buffers. + // + if ( ( pubEncryptedData + cubEncryptedData >= pubPlaintextData ) && + ( pubPlaintextData + cubPlaintextData >= pubEncryptedData ) ) + { + pTemp = new uint8[cubEncryptedData]; + bUseTempBuffer = true; + } + + try // handle any exceptions crypto++ may throw + { + if ( pTemp != NULL ) + { + AESEncryption aesEncrypt( pubKey, cubKey ); + + byte rgubIVEncrypted[k_cMedBuff]; + Assert( Q_ARRAYSIZE( rgubIVEncrypted ) >= aesEncrypt.BlockSize() ); + Assert( pIV != NULL && cubIV >= aesEncrypt.BlockSize() ); + + ArraySink * pOutputSink = new ArraySink( pTemp, *pcubEncryptedData ); + + // encrypt the initial vector with the key + aesEncrypt.ProcessBlock( pIV, rgubIVEncrypted ); + + // store the encrypted IV in the output - the recipient will need it + pOutputSink->Put( rgubIVEncrypted, aesEncrypt.BlockSize() ); + + // encrypt the message, given the key & IV + CBC_Mode_ExternalCipher::Encryption cipher( aesEncrypt, pIV ); + // Note: StreamTransformationFilter now owns the pointer to pOutputSink and will + // free it when the filter goes out of scope and destructs + StreamTransformationFilter filter( cipher, pOutputSink ); + filter.Put( (byte *) pubPlaintextData, cubPlaintextData ); + filter.MessageEnd(); + // return length of encrypted data to caller + *pcubEncryptedData = pOutputSink->TotalPutLength(); + // CryptoPP may leave garbage hanging around in the caller's buffer past the stated output length. + // Just to be safe, zero out caller's buffer from end out output to end of max buffer + if ( bUseTempBuffer ) + { + Q_memcpy( pubEncryptedData, pTemp, *pcubEncryptedData ); + } + Q_memset( pubEncryptedData + *pcubEncryptedData, 0, (cubEncryptedData - *pcubEncryptedData ) ); + bRet = true; + } + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::SymmetricEncrypt: crypto++ threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + if ( bUseTempBuffer ) + { + delete[] pTemp; + } + + return bRet; +} + +//----------------------------------------------------------------------------- +// Purpose: Encrypts the specified data with the specified key. Uses AES (Rijndael) symmetric +// encryption. The encrypted data may then be decrypted by calling SymmetricDecrypt +// with the same key. Generates a random initialization vector of the +// appropriate size. +// Input: pubPlaintextData - Data to be encrypted +// cubPlaintextData - Size of data to be encrypted +// pubEncryptedData - Pointer to buffer to receive encrypted data +// pcubEncryptedData - Pointer to a variable that at time of call contains the size of +// the receive buffer for encrypted data. When the method returns, this will contain +// the actual size of the encrypted data. +// pubKey - the key to encrypt the data with +// cubKey - Size of the key (must be k_nSymmetricKeyLen) +// Output: true if successful, false if encryption failed +//----------------------------------------------------------------------------- + +bool CCrypto::SymmetricEncrypt( const uint8 *pubPlaintextData, const uint32 cubPlaintextData, + uint8 *pubEncryptedData, uint32 *pcubEncryptedData, + const uint8 *pubKey, const uint32 cubKey ) +{ + bool bRet = false; + + // + // Generate a random IV + // + AESEncryption aesEncrypt( pubKey, cubKey ); + byte rgubIV[k_cMedBuff]; + CPoolAllocatedRNG rng; + rng.GetRNG().GenerateBlock( rgubIV, aesEncrypt.BlockSize() ); + + bRet = SymmetricEncryptWithIV( pubPlaintextData, cubPlaintextData, rgubIV, aesEncrypt.BlockSize(), pubEncryptedData, pcubEncryptedData, pubKey, cubKey ); + + return bRet; +} + + +#ifdef USE_OPENSSL_AES_DECRYPT + +// Local helper to perform AES+CBC decryption using optimized OpenSSL AES routines +static bool BDecryptAESUsingOpenSSL( const uint8 *pubEncryptedData, uint32 cubEncryptedData, uint8 *pubPlaintextData, uint32 *pcubPlaintextData, AES_KEY *key, const uint8 *pIV ) +{ + COMPILE_TIME_ASSERT( k_nSymmetricBlockSize == 16 ); + + // Block cipher encrypted text must be a multiple of the block size + if ( cubEncryptedData % k_nSymmetricBlockSize != 0 ) + return false; + + // Enough input? Requirement is one padded final block + if ( cubEncryptedData < k_nSymmetricBlockSize ) + return false; + + // Enough output space for all the full non-final blocks? + if ( *pcubPlaintextData < cubEncryptedData - k_nSymmetricBlockSize ) + return false; + + uint8 rgubWorking[k_nSymmetricBlockSize]; + uint32 nDecrypted = 0; + + // Process non-final blocks +#if defined(_M_IX86) || defined (_M_X64) || defined(__i386__) || defined(__x86_64__) + // ... believe it or not, Steam client on Windows supports Athlon XP without SSE2 + if ( !IsWindows() || GetCPUInformation().m_bSSE2 ) + { + while ( nDecrypted < cubEncryptedData - k_nSymmetricBlockSize ) + { + AES_decrypt( pubEncryptedData + nDecrypted, rgubWorking, key ); + __m128i m128Temp = _mm_xor_si128( _mm_loadu_si128( (__m128i*)pIV ), _mm_loadu_si128( (__m128i*)rgubWorking ) ); + pIV = pubEncryptedData + nDecrypted; + nDecrypted += k_nSymmetricBlockSize; + _mm_storeu_si128( (__m128i* RESTRICT)( pubPlaintextData + nDecrypted - k_nSymmetricBlockSize ), m128Temp ); + } + } + else +#endif + { + while ( nDecrypted < cubEncryptedData - k_nSymmetricBlockSize ) + { + AES_decrypt( pubEncryptedData + nDecrypted, rgubWorking, key ); + for ( int i = 0; i < k_nSymmetricBlockSize; ++i ) + pubPlaintextData[nDecrypted + i] = rgubWorking[i] ^ pIV[i]; + pIV = pubEncryptedData + nDecrypted; + nDecrypted += k_nSymmetricBlockSize; + } + } + + // Process final block into rgubWorking for padding inspection + Assert( nDecrypted == cubEncryptedData - k_nSymmetricBlockSize ); + AES_decrypt( pubEncryptedData + nDecrypted, rgubWorking, key ); + for ( int i = 0; i < k_nSymmetricBlockSize; ++i ) + rgubWorking[i] ^= pIV[i]; + + // Get final block padding length and make sure it is backfilled properly (PKCS#5) + uint8 pad = rgubWorking[ k_nSymmetricBlockSize - 1 ]; + if ( pad < 1 || pad > k_nSymmetricBlockSize ) + return false; + for ( int i = k_nSymmetricBlockSize - pad; i < k_nSymmetricBlockSize; ++i ) + if ( rgubWorking[i] != pad ) + return false; + + // Check that we have enough space for final bytes + if ( *pcubPlaintextData < nDecrypted + k_nSymmetricBlockSize - pad ) + return false; + + // Write any non-pad bytes from rgubWorking to pubPlaintextData + for ( int i = 0; i < k_nSymmetricBlockSize - pad; ++i ) + pubPlaintextData[nDecrypted++] = rgubWorking[i]; + + // The old CryptoPP path zeros out the entire destination buffer, but that + // behavior isn't documented or even expected. We'll just zero out one byte + // in case anyone relies on string termination, but that zero isn't counted. + if ( *pcubPlaintextData > nDecrypted ) + pubPlaintextData[nDecrypted] = 0; + + *pcubPlaintextData = nDecrypted; + return true; +} + +#else + +/* function, not method */ +static bool SymmetricDecryptWorker( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + const uint8 * pIV, uint32 cubIV, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, + AESDecryption &aesDecrypt ) +{ + //VPROF_BUDGET( "CCrypto::SymmetricDecrypt", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubEncryptedData ); + Assert( cubEncryptedData); + Assert( pIV ); + Assert( cubIV ); + Assert( pubPlaintextData ); + Assert( pcubPlaintextData ); + Assert( *pcubPlaintextData ); + + bool bRet = false; + + uint32 cubPlaintextData = *pcubPlaintextData; // remember how big the caller's buffer is + bool bUseTempBuffer = false; + uint8* pTemp = pubPlaintextData; + + // + // Crypto++ does not play nice with decrypting in place. If the buffers are + // overlapping, then allocate some temp space to use for the decryption. + // + // It does work fine with _identical_ buffers, but due to the way we store + // the IV in the returned encrypted data we never actually hit that case. + // + if ( ( pubEncryptedData + cubEncryptedData >= pubPlaintextData ) && + ( pubPlaintextData + cubPlaintextData >= pubEncryptedData ) ) + { + pTemp = new uint8[cubPlaintextData]; + bUseTempBuffer = true; + } + + try // handle any exceptions crypto++ may throw + { + if ( pTemp != NULL ) + { + CryptoPP::ArraySink* pOutputSink = new CryptoPP::ArraySink( pTemp, *pcubPlaintextData ); + CryptoPP::CBC_Mode_ExternalCipher::Decryption cbc( aesDecrypt, pIV ); + // Note: StreamTransformationFilter now owns the pointer to pOutputSink and will + // free it when the filter goes out of scope and destructs + CryptoPP::StreamTransformationFilter padding( cbc, pOutputSink ); + padding.Put( pubEncryptedData, cubEncryptedData ); + padding.MessageEnd(); + // return length of decrypted data to caller + *pcubPlaintextData = pOutputSink->TotalPutLength(); + // CryptoPP may leave garbage hanging around in the caller's buffer past the stated output length. + // Just to be safe, zero out caller's buffer from end out output to end of max buffer + if ( bUseTempBuffer ) + { + Q_memcpy( pubPlaintextData, pTemp, *pcubPlaintextData ); + } + Q_memset( pubPlaintextData + *pcubPlaintextData, 0, (cubPlaintextData - *pcubPlaintextData ) ); + + bRet = true; + } + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 4, "CCrypto::SymmetricDecrypt: crypto++ threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + if ( bUseTempBuffer ) + { + delete[] pTemp; + } + + return bRet; +} + +#endif + + +//----------------------------------------------------------------------------- +// Purpose: Decrypts the specified data with the specified key. Uses AES (Rijndael) symmetric +// decryption. +// Input: pubEncryptedData - Data to be decrypted +// cubEncryptedData - Size of data to be decrypted +// pubPlaintextData - Pointer to buffer to receive decrypted data +// pcubPlaintextData - Pointer to a variable that at time of call contains the size of +// the receive buffer for decrypted data. When the method returns, this will contain +// the actual size of the decrypted data. +// pubKey - the key to decrypt the data with +// cubKey - Size of the key (must be k_nSymmetricKeyLen) +// Output: true if successful, false if decryption failed +//----------------------------------------------------------------------------- +bool CCrypto::SymmetricDecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, + const uint8 *pubKey, const uint32 cubKey ) +{ + Assert( pubEncryptedData ); + Assert( cubEncryptedData); + Assert( pubPlaintextData ); + Assert( pcubPlaintextData ); + Assert( *pcubPlaintextData ); + Assert( pubKey ); + Assert( k_nSymmetricKeyLen == cubKey ); // the only key length supported is k_nSymmetricKeyLen + + // the initialization vector (IV) must be stored in the first block of bytes. + // If the size of encrypted data is not at least the block size, it is not valid + if ( cubEncryptedData < k_nSymmetricBlockSize ) + return false; + +#ifdef USE_OPENSSL_AES_DECRYPT + + AES_KEY key; + if ( AES_set_decrypt_key( pubKey, cubKey * 8, &key ) < 0 ) + return false; + + // Our first block is straight AES block encryption of IV with user key, no XOR. + uint8 rgubIV[ k_nSymmetricBlockSize ]; + AES_decrypt( pubEncryptedData, rgubIV, &key ); + pubEncryptedData += k_nSymmetricBlockSize; + cubEncryptedData -= k_nSymmetricBlockSize; + + return BDecryptAESUsingOpenSSL( pubEncryptedData, cubEncryptedData, pubPlaintextData, pcubPlaintextData, &key, rgubIV ); + +#else + + AESDecryption aesDecrypt( pubKey, cubKey ); + Assert( k_nSymmetricBlockSize == aesDecrypt.BlockSize() ); + + // Decrypt the IV + byte rgubIV[k_cMedBuff]; + Assert( Q_ARRAYSIZE( rgubIV ) >= aesDecrypt.BlockSize() ); + aesDecrypt.ProcessBlock( pubEncryptedData, rgubIV ); + + // We have now consumed the IV, so remove it from the front of the message + pubEncryptedData += k_nSymmetricBlockSize; + cubEncryptedData -= k_nSymmetricBlockSize; + + // given the IV stored in the message, and the key, decrypt the message + return SymmetricDecryptWorker( pubEncryptedData, cubEncryptedData, + rgubIV, aesDecrypt.BlockSize(), + pubPlaintextData, pcubPlaintextData, + aesDecrypt ); + +#endif +} + +//----------------------------------------------------------------------------- +// Purpose: Decrypts the specified data with the specified key. Uses AES (Rijndael) symmetric +// decryption. +// Input: pubEncryptedData - Data to be decrypted +// cubEncryptedData - Size of data to be decrypted +// pIV - Initialization vector. Byte array one block in size. +// cubIV - size of IV. This should be 16 (one block, 128 bits) +// pubPlaintextData - Pointer to buffer to receive decrypted data +// pcubPlaintextData - Pointer to a variable that at time of call contains the size of +// the receive buffer for decrypted data. When the method returns, this will contain +// the actual size of the decrypted data. +// pubKey - the key to decrypt the data with +// cubKey - Size of the key (must be k_nSymmetricKeyLen) +// Output: true if successful, false if decryption failed +//----------------------------------------------------------------------------- +bool CCrypto::SymmetricDecryptWithIV( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + const uint8 * pIV, uint32 cubIV, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, + const uint8 *pubKey, const uint32 cubKey ) +{ + Assert( pubEncryptedData ); + Assert( cubEncryptedData); + Assert( pIV ); + Assert( cubIV ); + Assert( pubPlaintextData ); + Assert( pcubPlaintextData ); + Assert( *pcubPlaintextData ); + Assert( pubKey ); + Assert( k_nSymmetricKeyLen == cubKey ); // the only key length supported is k_nSymmetricKeyLen + + // IV input into CBC must be exactly one block size + if ( cubIV != k_nSymmetricBlockSize ) + return false; + +#ifdef USE_OPENSSL_AES_DECRYPT + + AES_KEY key; + if ( AES_set_decrypt_key( pubKey, cubKey * 8, &key ) < 0 ) + return false; + + return BDecryptAESUsingOpenSSL( pubEncryptedData, cubEncryptedData, pubPlaintextData, pcubPlaintextData, &key, pIV ); + +#else + + AESDecryption aesDecrypt( pubKey, cubKey ); + Assert( k_nSymmetricBlockSize == aesDecrypt.BlockSize() ); + + return SymmetricDecryptWorker( pubEncryptedData, cubEncryptedData, + pIV, cubIV, + pubPlaintextData, pcubPlaintextData, + aesDecrypt ); + +#endif +} + + +//----------------------------------------------------------------------------- +// Purpose: For specified plaintext data size, returns what size of symmetric +// encrypted data will be +//----------------------------------------------------------------------------- +uint32 CCrypto::GetSymmetricEncryptedSize( uint32 cubPlaintextData ) +{ + // empirically determined encrypted size as function of plaintext size for AES encryption + uint k_cubBlock = 16; + uint k_cubHeader = 16; + return k_cubHeader + ( ( cubPlaintextData / k_cubBlock ) * k_cubBlock ) + k_cubBlock; +} + + +//----------------------------------------------------------------------------- +// Purpose: Encrypts the specified data with the specified text password. +// Uses the SHA256 hash of the password as the key for AES (Rijndael) symmetric +// encryption. A SHA1 HMAC of the result is appended, for authentication on +// the receiving end. +// The encrypted data may then be decrypted by calling DecryptWithPasswordAndAuthenticate +// with the same password. +// Input: pubPlaintextData - Data to be encrypted +// cubPlaintextData - Size of data to be encrypted +// pubEncryptedData - Pointer to buffer to receive encrypted data +// pcubEncryptedData - Pointer to a variable that at time of call contains the size of +// the receive buffer for encrypted data. When the method returns, this will contain +// the actual size of the encrypted data. +// pchPassword - text password +// Output: true if successful, false if encryption failed +//----------------------------------------------------------------------------- +bool CCrypto::EncryptWithPasswordAndHMAC( const uint8 *pubPlaintextData, uint32 cubPlaintextData, + uint8 * pubEncryptedData, uint32 * pcubEncryptedData, + const char *pchPassword ) +{ + // + // Generate a random IV + // + byte rgubIV[k_nSymmetricBlockSize]; + CPoolAllocatedRNG rng; + rng.GetRNG().GenerateBlock( rgubIV, k_nSymmetricBlockSize ); + + return EncryptWithPasswordAndHMACWithIV( pubPlaintextData, cubPlaintextData, rgubIV, k_nSymmetricBlockSize, pubEncryptedData, pcubEncryptedData, pchPassword ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Encrypts the specified data with the specified text password. +// Uses the SHA256 hash of the password as the key for AES (Rijndael) symmetric +// encryption. A SHA1 HMAC of the result is appended, for authentication on +// the receiving end. +// The encrypted data may then be decrypted by calling DecryptWithPasswordAndAuthenticate +// with the same password. +// Input: pubPlaintextData - Data to be encrypted +// cubPlaintextData - Size of data to be encrypted +// pIV - IV to use for AES encryption. Should be random and never used before unless you know +// exactly what you're doing. +// cubIV - size of the IV - should be same ase the AES blocksize. +// pubEncryptedData - Pointer to buffer to receive encrypted data +// pcubEncryptedData - Pointer to a variable that at time of call contains the size of +// the receive buffer for encrypted data. When the method returns, this will contain +// the actual size of the encrypted data. +// pchPassword - text password +// Output: true if successful, false if encryption failed +//----------------------------------------------------------------------------- +bool CCrypto::EncryptWithPasswordAndHMACWithIV( const uint8 *pubPlaintextData, uint32 cubPlaintextData, + const uint8 * pIV, uint32 cubIV, + uint8 * pubEncryptedData, uint32 * pcubEncryptedData, + const char *pchPassword ) +{ + uint8 rgubKey[k_nSymmetricKeyLen]; + if ( !pchPassword || !pchPassword[0] ) + return false; + + if ( !cubPlaintextData ) + return false; + + uint32 cubBuffer = *pcubEncryptedData; + uint32 cubExpectedResult = GetSymmetricEncryptedSize( cubPlaintextData ) + sizeof( SHADigest_t ); + + if ( cubBuffer < cubExpectedResult ) + return false; + + try + { + CryptoPP::SHA256().CalculateDigest( rgubKey, (const uint8 *)pchPassword, Q_strlen( pchPassword ) ); + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 4, "CCrypto::EncryptWithPassword: crypto++ threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + return false; + } + + bool bRet = SymmetricEncryptWithIV( pubPlaintextData, cubPlaintextData, pIV, cubIV, pubEncryptedData, pcubEncryptedData, rgubKey, k_nSymmetricKeyLen ); + if ( bRet ) + { + // calc HMAC + uint32 cubEncrypted = *pcubEncryptedData; + *pcubEncryptedData += sizeof( SHADigest_t ); + if ( cubBuffer < *pcubEncryptedData ) + return false; + + SHADigest_t *pHMAC = (SHADigest_t*)( pubEncryptedData + cubEncrypted ); + bRet = CCrypto::GenerateHMAC( pubEncryptedData, cubEncrypted, rgubKey, k_nSymmetricKeyLen, pHMAC ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Decrypts the specified data with the specified password. Uses AES (Rijndael) symmetric +// decryption. First, the HMAC is verified - if it is not correct, then we know that +// the key is incorrect or the data is corrupted, and the decryption fails. +// Input: pubEncryptedData - Data to be decrypted +// cubEncryptedData - Size of data to be decrypted +// pubPlaintextData - Pointer to buffer to receive decrypted data +// pcubPlaintextData - Pointer to a variable that at time of call contains the size of +// the receive buffer for decrypted data. When the method returns, this will contain +// the actual size of the decrypted data. +// pchPassword - the text password to decrypt the data with +// Output: true if successful, false if decryption failed +//----------------------------------------------------------------------------- +bool CCrypto::DecryptWithPasswordAndAuthenticate( const uint8 * pubEncryptedData, uint32 cubEncryptedData, + uint8 * pubPlaintextData, uint32 * pcubPlaintextData, + const char *pchPassword ) +{ + uint8 rgubKey[k_nSymmetricKeyLen]; + if ( !pchPassword || !pchPassword[0] ) + return false; + + if ( cubEncryptedData <= sizeof( SHADigest_t ) ) + return false; + + try + { + CryptoPP::SHA256().CalculateDigest( rgubKey, (const uint8 *)pchPassword, Q_strlen( pchPassword ) ); + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 4, "CCrypto::EncryptWithPassword: crypto++ threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + return false; + } + + uint32 cubCiphertext = cubEncryptedData - sizeof( SHADigest_t ); + SHADigest_t *pHMAC = (SHADigest_t*)( pubEncryptedData + cubCiphertext ); + SHADigest_t hmacActual; + bool bRet = CCrypto::GenerateHMAC( pubEncryptedData, cubCiphertext, rgubKey, k_nSymmetricKeyLen, &hmacActual ); + + if ( bRet ) + { + // invalid ciphertext or key + if ( Q_memcmp( &hmacActual, pHMAC, sizeof( SHADigest_t ) ) ) + return false; + + bRet = SymmetricDecrypt( pubEncryptedData, cubCiphertext, pubPlaintextData, pcubPlaintextData, rgubKey, k_nSymmetricKeyLen ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generates a new pair of private/public RSA keys +// Input: pubPublicKey - Pointer to buffer to receive public key (should be of size k_nRSAKeyLenMax) +// pcubPublicKey - Pointer to variable that contains size of pubPublicKey buffer. At exit, +// this is filled in with the actual size of the public key +// pubPrivateKey - Pointer to buffer to receive private key (should be of size k_nRSAKeyLenMax) +// pcubPrivateKey - Pointer to variable that contains size of pubPrivateKey buffer. At exit, +// this is filled in with the actual size of the private key +// Output: true if successful, false if key generation failed +//----------------------------------------------------------------------------- +bool CCrypto::RSAGenerateKeys( uint8 *pubPublicKey, uint32 *pcubPublicKey, uint8 *pubPrivateKey, uint32 *pcubPrivateKey ) +{ + VPROF_BUDGET( "CCrypto::RSAGenerateKeys", VPROF_BUDGETGROUP_ENCRYPTION ); + bool bRet = false; + Assert( pubPublicKey ); + Assert( pcubPublicKey ); + Assert( pubPrivateKey ); + Assert( pcubPrivateKey ); + + try // handle any exceptions crypto++ may throw + { + // generate private key + ArraySink arraySinkPrivateKey( pubPrivateKey, *pcubPrivateKey ); + CPoolAllocatedRNG rng; + RSAES_OAEP_SHA_Decryptor priv( rng.GetRNG(), k_nRSAKeyBits ); + priv.DEREncode( arraySinkPrivateKey ); + *pcubPrivateKey = arraySinkPrivateKey.TotalPutLength(); + // generate public key + ArraySink arraySinkPublicKey( pubPublicKey, *pcubPublicKey ); + RSAES_OAEP_SHA_Encryptor pub(priv); + pub.DEREncode( arraySinkPublicKey ); + *pcubPublicKey = arraySinkPublicKey.TotalPutLength(); + bRet = true; + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSAGenerateKeys: crypto++ threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Encrypts the specified data with the specified RSA public key. +// The encrypted data may then be decrypted by calling RSADecrypt with the +// corresponding RSA private key. +// Input: pubPlaintextData - Data to be encrypted +// cubPlaintextData - Size of data to be encrypted +// pubEncryptedData - Pointer to buffer to receive encrypted data +// pcubEncryptedData - Pointer to a variable that at time of call contains the size of +// the receive buffer for encrypted data. When the method returns, this will contain +// the actual size of the encrypted data. +// pubPublicKey - the RSA public key to encrypt the data with +// cubPublicKey - Size of the key (must be k_nSymmetricKeyLen) +// Output: true if successful, false if encryption failed +//----------------------------------------------------------------------------- +bool CCrypto::RSAEncrypt( const uint8 *pubPlaintextData, uint32 cubPlaintextData, + uint8 *pubEncryptedData, uint32 *pcubEncryptedData, + const uint8 *pubPublicKey, const uint32 cubPublicKey ) +{ + VPROF_BUDGET( "CCrypto::RSAEncrypt", VPROF_BUDGETGROUP_ENCRYPTION ); + bool bRet = false; + Assert( cubPlaintextData > 0 ); // must pass in some data + + try // handle any exceptions crypto++ may throw + { + StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); + RSAES_OAEP_SHA_Encryptor rsaEncryptor( stringSourcePublicKey ); + + // calculate how many blocks of encryption will we need to do + AssertFatal( rsaEncryptor.FixedMaxPlaintextLength() <= ULONG_MAX ); + uint32 cBlocks = 1 + ( ( cubPlaintextData - 1 ) / (uint32)rsaEncryptor.FixedMaxPlaintextLength() ); + // calculate how big the output will be + AssertFatal( rsaEncryptor.FixedCiphertextLength() <= ULONG_MAX / cBlocks ); + uint32 cubCipherText = cBlocks * (uint32)rsaEncryptor.FixedCiphertextLength(); + Assert( cubCipherText > 0 ); + + // ensure there is sufficient room in output buffer for result + if ( cubCipherText > ( *pcubEncryptedData ) ) + { + /*AssertMsg2( false, "CCrypto::RSAEncrypt: insufficient output buffer for encryption, needed %d got %d\n", + cubCipherText, *pcubEncryptedData );*/ + return false; + } + + // encrypt the message, using as many blocks as required + CPoolAllocatedRNG rng; + for ( uint32 nBlock = 0; nBlock < cBlocks; nBlock++ ) + { + // encrypt either all remaining plaintext, or maximum allowed plaintext per RSA encryption operation + uint32 cubToEncrypt = min( cubPlaintextData, (uint32)rsaEncryptor.FixedMaxPlaintextLength() ); + // encrypt the plaintext + rsaEncryptor.Encrypt( rng.GetRNG(), pubPlaintextData, cubToEncrypt, pubEncryptedData ); + // adjust input and output pointers and remaining plaintext byte count + pubPlaintextData += cubToEncrypt; + cubPlaintextData -= cubToEncrypt; + pubEncryptedData += rsaEncryptor.FixedCiphertextLength(); + } + Assert( 0 == cubPlaintextData ); // should have no remaining plaintext to encrypt + *pcubEncryptedData = cubCipherText; + + bRet = true; + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSAEncrypt: Encrypt() threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Decrypts the specified data with the specified RSA private key +// Input: pubEncryptedData - Data to be decrypted +// cubEncryptedData - Size of data to be decrypted +// pubPlaintextData - Pointer to buffer to receive decrypted data +// pcubPlaintextData - Pointer to a variable that at time of call contains the size of +// the receive buffer for decrypted data. When the method returns, this will contain +// the actual size of the decrypted data. +// pubPrivateKey - the RSA private key key to decrypt the data with +// cubPrivateKey - Size of the key (must be k_nSymmetricKeyLen) +// Output: true if successful, false if decryption failed +//----------------------------------------------------------------------------- +bool CCrypto::RSADecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, + const uint8 *pubPrivateKey, const uint32 cubPrivateKey ) +{ + VPROF_BUDGET( "CCrypto::RSADecrypt", VPROF_BUDGETGROUP_ENCRYPTION ); + bool bRet = false; + + Assert( cubEncryptedData > 0 ); // must pass in some data + + try // handle any exceptions crypto++ may throw + { + StringSource stringSourcePrivateKey( pubPrivateKey, cubPrivateKey, true ); + RSAES_OAEP_SHA_Decryptor rsaDecryptor( stringSourcePrivateKey ); + + // calculate how many blocks of decryption will we need to do + AssertFatal( rsaDecryptor.FixedCiphertextLength() <= ULONG_MAX ); + uint32 cubFixedCiphertextLength = (uint32)rsaDecryptor.FixedCiphertextLength(); + // Ensure encrypted data is valid and has length that is exact multiple of 128 bytes + if ( 0 != ( cubEncryptedData % cubFixedCiphertextLength ) ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSADecrypt: invalid ciphertext length %d, needs to be a multiple of %d\n", + cubEncryptedData, cubFixedCiphertextLength ); + return false; + } + uint32 cBlocks = cubEncryptedData / cubFixedCiphertextLength; + + // calculate how big the maximum output will be + size_t cubMaxPlaintext = rsaDecryptor.MaxPlaintextLength( rsaDecryptor.FixedCiphertextLength() ); + AssertFatal( cubMaxPlaintext <= ULONG_MAX / cBlocks ); + uint32 cubPlaintextDataMax = cBlocks * (uint32)cubMaxPlaintext; + Assert( cubPlaintextDataMax > 0 ); + // ensure there is sufficient room in output buffer for result + if ( cubPlaintextDataMax >= ( *pcubPlaintextData ) ) + { + /*AssertMsg2( false, "CCrypto::RSADecrypt: insufficient output buffer for decryption, needed %d got %d\n", + cubPlaintextDataMax, *pcubPlaintextData );*/ + return false; + } + + // decrypt the data, using as many blocks as required + CPoolAllocatedRNG rng; + uint32 cubPlaintextData = 0; + for ( uint32 nBlock = 0; nBlock < cBlocks; nBlock++ ) + { + // decrypt one block (always of fixed size) + int cubToDecrypt = cubFixedCiphertextLength; + DecodingResult decodingResult = rsaDecryptor.Decrypt( rng.GetRNG(), pubEncryptedData, cubToDecrypt, pubPlaintextData ); + if ( !decodingResult.isValidCoding ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSADecrypt: failed to decrypt\n" ); + return false; + } + // adjust input and output pointers and remaining encrypted byte count + pubEncryptedData += cubToDecrypt; + cubEncryptedData -= cubToDecrypt; + pubPlaintextData += decodingResult.messageLength; + AssertFatal( decodingResult.messageLength <= ULONG_MAX ); + cubPlaintextData += (uint32)decodingResult.messageLength; + } + Assert( 0 == cubEncryptedData ); // should have no remaining encrypted data to decrypt + *pcubPlaintextData = cubPlaintextData; + + bRet = true; + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSADecrypt: Decrypt() threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Decrypts the specified data with the specified RSA PUBLIC key, +// using no padding (eg un-padded signature). +// Input: pubEncryptedData - Data to be decrypted +// cubEncryptedData - Size of data to be decrypted +// pubPlaintextData - Pointer to buffer to receive decrypted data +// pcubPlaintextData - Pointer to a variable that at time of call contains the size of +// the receive buffer for decrypted data. When the method returns, this will contain +// the actual size of the decrypted data. +// pubPublicKey - the RSA public key key to decrypt the data with +// cubPublicKey - Size of the key +// Output: true if successful, false if decryption failed +//----------------------------------------------------------------------------- +bool CCrypto::RSAPublicDecrypt_NoPadding( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, + const uint8 *pubPublicKey, const uint32 cubPublicKey ) +{ + VPROF_BUDGET( "CCrypto::RSADecrypt", VPROF_BUDGETGROUP_ENCRYPTION ); + bool bRet = false; + + Assert( cubEncryptedData > 0 ); // must pass in some data + + // BUGBUG taylor + // This probably only works for reasonably small ciphertext sizes. + + try // handle any exceptions crypto++-5.2 may throw + { + StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); + + // 1. We need to use a Verifier because a Decryptor expects a private key, + // which is encoded differently + // 2. We are using neither PKCS1v15 padding nor SHA in any way, we are simply + // using this object as a means of instantiating the key decryption function + RSASSA_PKCS1v15_SHA_Verifier pub( stringSourcePublicKey ); + + // Ask for the data to be decrypted + // Caveat: this may "succeed" even if the ciphertext is bogus, so it + // is up to the caller to do any MAC or other sanity checking + Integer x = pub.AccessKey().ApplyFunction(Integer(pubEncryptedData, cubEncryptedData)); + + // Result is an 'Integer', essentially a string of bytes for our + // purposes though. + uint32 nBytes = x.ByteCount(); + if ( nBytes > *pcubPlaintextData ) + { + return false; + } + + // don't tell it to encode to the full buffer size, because it will + // pre-pad with zeros. Just squeeze it in to the first nBytes of the + // buffer. + x.Encode( pubPlaintextData, nBytes ); + *pcubPlaintextData = nBytes; + + bRet = true; + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSAPublicDecrypt_NoPadding: Decrypt() threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generates an RSA signature block for the specified data with the specified +// RSA private key. The signature can be verified by calling RSAVerifySignature +// with the RSA public key. +// Input: pubData - Data to be signed +// cubData - Size of data to be signed +// pubSignature - Pointer to buffer to receive signature block +// pcubSignature - Pointer to a variable that at time of call contains the size of +// the pubSignature buffer. When the method returns, this will contain +// the actual size of the signature block +// pubPrivateKey - The RSA private key to use to sign the data +// cubPrivateKey - Size of the key +// Output: true if successful, false if signature failed +//----------------------------------------------------------------------------- +bool CCrypto::RSASign( const uint8 *pubData, const uint32 cubData, + uint8 *pubSignature, uint32 *pcubSignature, + const uint8 *pubPrivateKey, const uint32 cubPrivateKey ) +{ + VPROF_BUDGET( "CCrypto::RSASign", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( pubPrivateKey ); + Assert( cubPrivateKey > 0 ); + Assert( pubSignature ); + Assert( pcubSignature ); + bool bRet = false; + try // handle any exceptions crypto++ may throw + { + StringSource stringSourcePrivateKey( pubPrivateKey, cubPrivateKey, true ); + RSASSA_PKCS1v15_SHA_Signer rsaSigner( stringSourcePrivateKey ); + CPoolAllocatedRNG rng; + size_t len = rsaSigner.SignMessage( rng.GetRNG(), (byte *)pubData, cubData, pubSignature ); + AssertFatal( len <= ULONG_MAX ); + *pcubSignature = (uint32)len; + bRet = true; + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: SignMessage threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Verifies that signature block is authentic for given data & RSA public key +// Input: pubData - Data that was signed +// cubData - Size of data that was signed signed +// pubSignature - Signature block +// cubSignature - Size of signature block +// pubPublicKey - The RSA public key to use to verify the signature +// (must be from same pair as RSA private key used to generate signature) +// cubPublicKey - Size of the key +// Output: true if successful and signature is authentic, false if signature does not match or other error +//----------------------------------------------------------------------------- +bool CCrypto::RSAVerifySignature( const uint8 *pubData, const uint32 cubData, + const uint8 *pubSignature, const uint32 cubSignature, + const uint8 *pubPublicKey, const uint32 cubPublicKey ) +{ + VPROF_BUDGET( "CCrypto::RSAVerifySignature", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( pubSignature ); + Assert( pubPublicKey ); + + bool bRet = false; + try // handle any exceptions crypto++ may throw + { + StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); + RSASSA_PKCS1v15_SHA_Verifier pub( stringSourcePublicKey ); + bRet = pub.VerifyMessage( pubData, cubData, pubSignature, cubSignature ); + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: VerifyMessage threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + +//----------------------------------------------------------------------------- +// Purpose: Generates an RSA signature block for the specified data with the specified +// RSA private key. The signature can be verified by calling RSAVerifySignature +// with the RSA public key. +// Input: pubData - Data to be signed +// cubData - Size of data to be signed +// pubSignature - Pointer to buffer to receive signature block +// pcubSignature - Pointer to a variable that at time of call contains the size of +// the pubSignature buffer. When the method returns, this will contain +// the actual size of the signature block +// pubPrivateKey - The RSA private key to use to sign the data +// cubPrivateKey - Size of the key +// Output: true if successful, false if signature failed +//----------------------------------------------------------------------------- +bool CCrypto::RSASignSHA256( const uint8 *pubData, const uint32 cubData, + uint8 *pubSignature, uint32 *pcubSignature, + const uint8 *pubPrivateKey, const uint32 cubPrivateKey ) +{ + VPROF_BUDGET( "CCrypto::RSASign", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( pubPrivateKey ); + Assert( cubPrivateKey > 0 ); + Assert( pubSignature ); + Assert( pcubSignature ); + bool bRet = false; + try // handle any exceptions crypto++ may throw + { + StringSource stringSourcePrivateKey( pubPrivateKey, cubPrivateKey, true ); + RSASS::Signer rsaSigner( stringSourcePrivateKey ); + CPoolAllocatedRNG rng; + size_t len = rsaSigner.SignMessage( rng.GetRNG(), (byte *)pubData, cubData, pubSignature ); + AssertFatal( len <= ULONG_MAX ); + *pcubSignature = (uint32)len; + bRet = true; + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: SignMessage threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Verifies that signature block is authentic for given data & RSA public key +// Input: pubData - Data that was signed +// cubData - Size of data that was signed signed +// pubSignature - Signature block +// cubSignature - Size of signature block +// pubPublicKey - The RSA public key to use to verify the signature +// (must be from same pair as RSA private key used to generate signature) +// cubPublicKey - Size of the key +// Output: true if successful and signature is authentic, false if signature does not match or other error +//----------------------------------------------------------------------------- +bool CCrypto::RSAVerifySignatureSHA256( const uint8 *pubData, const uint32 cubData, + const uint8 *pubSignature, const uint32 cubSignature, + const uint8 *pubPublicKey, const uint32 cubPublicKey ) +{ + //VPROF_BUDGET( "CCrypto::RSAVerifySignature", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( pubSignature ); + Assert( pubPublicKey ); + + bool bRet = false; + try // handle any exceptions crypto++ may throw + { + StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); + RSASS::Verifier pub( stringSourcePublicKey ); + bRet = pub.VerifyMessage( pubData, cubData, pubSignature, cubSignature ); + } + catch ( Exception e ) + { + DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: VerifyMessage threw exception %s (%d)\n", + e.what(), e.GetErrorType() ); + } + + return bRet; +} + + +//----------------------------------------------------------------------------- +// Purpose: Hex-encodes a block of data. (Binary -> text representation.) The output +// is null-terminated and can be treated as a string. +// Input: pubData - Data to encode +// cubData - Size of data to encode +// pchEncodedData - Pointer to string buffer to store output in +// cchEncodedData - Size of pchEncodedData buffer +//----------------------------------------------------------------------------- +bool CCrypto::HexEncode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ) +{ + VPROF_BUDGET( "CCrypto::HexEncode", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( cubData ); + Assert( pchEncodedData ); + Assert( cchEncodedData > 0 ); + + if ( cchEncodedData < ( ( cubData * 2 ) + 1 ) ) + { + Assert( cchEncodedData >= ( cubData * 2 ) + 1 ); // expands to 2x input + NULL, must have room in output buffer + *pchEncodedData = '\0'; + return false; + } + + ArraySink * pArraySinkOutput = new ArraySink( (byte *) pchEncodedData, cchEncodedData ); + // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs + HexEncoder hexEncoder( pArraySinkOutput ); + hexEncoder.Put( pubData, cubData ); + hexEncoder.MessageEnd(); + + uint32 len = pArraySinkOutput->TotalPutLength(); + if ( len >= cchEncodedData ) + { + /*AssertMsg2( false, "CCrypto::HexEncode: insufficient output buffer for encoding, needed %d got %d\n", + len, cchEncodedData );*/ + return false; + } + + pchEncodedData[len] = 0; // NULL-terminate + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Hex-decodes a block of data. (Text -> binary representation.) +// Input: pchData - Null-terminated hex-encoded string +// pubDecodedData - Pointer to buffer to store output in +// pcubDecodedData - Pointer to variable that contains size of +// output buffer. At exit, is filled in with actual size +// of decoded data. +//----------------------------------------------------------------------------- +bool CCrypto::HexDecode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ) +{ + VPROF_BUDGET( "CCrypto::HexDecode", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pchData ); + Assert( pubDecodedData ); + Assert( pcubDecodedData ); + Assert( *pcubDecodedData ); + + ArraySink * pArraySinkOutput = new ArraySink( pubDecodedData, *pcubDecodedData ); + // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs + HexDecoder hexDecoder( pArraySinkOutput ); + hexDecoder.Put( (byte *) pchData, Q_strlen( pchData ) ); + hexDecoder.MessageEnd(); + + uint32 len = pArraySinkOutput->TotalPutLength(); + if ( len > *pcubDecodedData ) + { + /*AssertMsg2( false, "CCrypto::HexDecode: insufficient output buffer for decoding, needed %d got %d\n", + len, *pcubDecodedData );*/ + return false; + } + *pcubDecodedData = len; + + return true; +} + + +static const int k_LineBreakEveryNGroups = 18; // line break every 18 groups of 4 characters (every 72 characters) + +//----------------------------------------------------------------------------- +// Purpose: Returns the expected buffer size that should be passed to Base64Encode. +// Input: cubData - Size of data to encode +// bInsertLineBreaks - If line breaks should be inserted automatically +//----------------------------------------------------------------------------- +uint32 CCrypto::Base64EncodeMaxOutput( const uint32 cubData, const char *pszLineBreak ) +{ + // terminating null + 4 chars per 3-byte group + line break after every 18 groups (72 output chars) + final line break + uint32 nGroups = (cubData+2)/3; + str_size cchRequired = 1 + nGroups*4 + ( pszLineBreak ? Q_strlen(pszLineBreak)*(1+(nGroups-1)/k_LineBreakEveryNGroups) : 0 ); + return cchRequired; +} + + +//----------------------------------------------------------------------------- +// Purpose: Base64-encodes a block of data. (Binary -> text representation.) The output +// is null-terminated and can be treated as a string. +// Input: pubData - Data to encode +// cubData - Size of data to encode +// pchEncodedData - Pointer to string buffer to store output in +// cchEncodedData - Size of pchEncodedData buffer +// bInsertLineBreaks - If "\n" line breaks should be inserted automatically +//----------------------------------------------------------------------------- +bool CCrypto::Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32 cchEncodedData, bool bInsertLineBreaks ) +{ + const char *pszLineBreak = bInsertLineBreaks ? "\n" : NULL; + uint32 cchRequired = Base64EncodeMaxOutput( cubData, pszLineBreak ); + (void)cchRequired; + //AssertMsg2( cchEncodedData >= cchRequired, "CCrypto::Base64Encode: insufficient output buffer for encoding, needed %d got %d\n", cchRequired, cchEncodedData ); + return Base64Encode( pubData, cubData, pchEncodedData, &cchEncodedData, pszLineBreak ); +} + +//----------------------------------------------------------------------------- +// Purpose: Base64-encodes a block of data. (Binary -> text representation.) The output +// is null-terminated and can be treated as a string. +// Input: pubData - Data to encode +// cubData - Size of data to encode +// pchEncodedData - Pointer to string buffer to store output in +// pcchEncodedData - Pointer to size of pchEncodedData buffer; adjusted to number of characters written (before NULL) +// pszLineBreak - String to be inserted every 72 characters; empty string or NULL pointer for no line breaks +// Note: if pchEncodedData is NULL and *pcchEncodedData is zero, *pcchEncodedData is filled with the actual required length +// for output. A simpler approximation for maximum output size is (cubData * 4 / 3) + 5 if there are no linebreaks. +//----------------------------------------------------------------------------- +bool CCrypto::Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32* pcchEncodedData, const char *pszLineBreak ) +{ + VPROF_BUDGET( "CCrypto::Base64Encode", VPROF_BUDGETGROUP_ENCRYPTION ); + + if ( pchEncodedData == NULL ) + { + //AssertMsg( *pcchEncodedData == 0, "NULL output buffer with non-zero size passed to Base64Encode" ); + *pcchEncodedData = Base64EncodeMaxOutput( cubData, pszLineBreak ); + return true; + } + + const uint8 *pubDataEnd = pubData + cubData; + char *pchEncodedDataStart = pchEncodedData; + str_size unLineBreakLen = pszLineBreak ? Q_strlen( pszLineBreak ) : 0; + int nNextLineBreak = unLineBreakLen ? k_LineBreakEveryNGroups : INT_MAX; + + const char * const pszBase64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + uint32 cchEncodedData = *pcchEncodedData; + if ( cchEncodedData == 0 ) + goto out_of_space; + + --cchEncodedData; // pre-decrement for the terminating null so we don't forget about it + + // input 3 x 8-bit, output 4 x 6-bit + while ( pubDataEnd - pubData >= 3 ) + { + if ( cchEncodedData < 4 + unLineBreakLen ) + goto out_of_space; + + if ( nNextLineBreak == 0 ) + { + memcpy( pchEncodedData, pszLineBreak, unLineBreakLen ); + pchEncodedData += unLineBreakLen; + cchEncodedData -= unLineBreakLen; + nNextLineBreak = k_LineBreakEveryNGroups; + } + + uint32 un24BitsData; + un24BitsData = (uint32) pubData[0] << 16; + un24BitsData |= (uint32) pubData[1] << 8; + un24BitsData |= (uint32) pubData[2]; + pubData += 3; + + pchEncodedData[0] = pszBase64Chars[ (un24BitsData >> 18) & 63 ]; + pchEncodedData[1] = pszBase64Chars[ (un24BitsData >> 12) & 63 ]; + pchEncodedData[2] = pszBase64Chars[ (un24BitsData >> 6) & 63 ]; + pchEncodedData[3] = pszBase64Chars[ (un24BitsData ) & 63 ]; + pchEncodedData += 4; + cchEncodedData -= 4; + --nNextLineBreak; + } + + // Clean up remaining 1 or 2 bytes of input, pad output with '=' + if ( pubData != pubDataEnd ) + { + if ( cchEncodedData < 4 + unLineBreakLen ) + goto out_of_space; + + if ( nNextLineBreak == 0 ) + { + memcpy( pchEncodedData, pszLineBreak, unLineBreakLen ); + pchEncodedData += unLineBreakLen; + cchEncodedData -= unLineBreakLen; + } + + uint32 un24BitsData; + un24BitsData = (uint32) pubData[0] << 16; + if ( pubData+1 != pubDataEnd ) + { + un24BitsData |= (uint32) pubData[1] << 8; + } + pchEncodedData[0] = pszBase64Chars[ (un24BitsData >> 18) & 63 ]; + pchEncodedData[1] = pszBase64Chars[ (un24BitsData >> 12) & 63 ]; + pchEncodedData[2] = pubData+1 != pubDataEnd ? pszBase64Chars[ (un24BitsData >> 6) & 63 ] : '='; + pchEncodedData[3] = '='; + pchEncodedData += 4; + cchEncodedData -= 4; + } + + if ( unLineBreakLen ) + { + if ( cchEncodedData < unLineBreakLen ) + goto out_of_space; + memcpy( pchEncodedData, pszLineBreak, unLineBreakLen ); + pchEncodedData += unLineBreakLen; + cchEncodedData -= unLineBreakLen; + } + + *pchEncodedData = 0; + *pcchEncodedData = pchEncodedData - pchEncodedDataStart; + return true; + +out_of_space: + *pchEncodedData = 0; + *pcchEncodedData = Base64EncodeMaxOutput( cubData, pszLineBreak ); + //AssertMsg( false, "CCrypto::Base64Encode: insufficient output buffer (up to n*4/3+5 bytes required, plus linebreaks)" ); + return false; +} + + +//----------------------------------------------------------------------------- +// Purpose: Base64-decodes a block of data. (Text -> binary representation.) +// Input: pchData - Null-terminated hex-encoded string +// pubDecodedData - Pointer to buffer to store output in +// pcubDecodedData - Pointer to variable that contains size of +// output buffer. At exit, is filled in with actual size +// of decoded data. +// Note: if NULL is passed as the output buffer and *pcubDecodedData is zero, the function +// will calculate the actual required size and place it in *pcubDecodedData. A simpler upper +// bound on the required size is ( strlen(pchData)*3/4 + 1 ). +//----------------------------------------------------------------------------- +bool CCrypto::Base64Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters ) +{ + return Base64Decode( pchData, ~0u, pubDecodedData, pcubDecodedData, bIgnoreInvalidCharacters ); +} + +//----------------------------------------------------------------------------- +// Purpose: Base64-decodes a block of data. (Text -> binary representation.) +// Input: pchData - base64-encoded string, null terminated +// cchDataMax - maximum length of string unless a null is encountered first +// pubDecodedData - Pointer to buffer to store output in +// pcubDecodedData - Pointer to variable that contains size of +// output buffer. At exit, is filled in with actual size +// of decoded data. +// Note: if NULL is passed as the output buffer and *pcubDecodedData is zero, the function +// will calculate the actual required size and place it in *pcubDecodedData. A simpler upper +// bound on the required size is ( strlen(pchData)*3/4 + 2 ). +//----------------------------------------------------------------------------- +bool CCrypto::Base64Decode( const char *pchData, uint32 cchDataMax, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters ) +{ + //VPROF_BUDGET( "CCrypto::Base64Decode", VPROF_BUDGETGROUP_ENCRYPTION ); + + uint32 cubDecodedData = *pcubDecodedData; + uint32 cubDecodedDataOrig = cubDecodedData; + + if ( pubDecodedData == NULL ) + { + //AssertMsg( *pcubDecodedData == 0, "NULL output buffer with non-zero size passed to Base64Decode" ); + cubDecodedDataOrig = cubDecodedData = ~0u; + } + + // valid base64 character range: '+' (0x2B) to 'z' (0x7A) + // table entries are 0-63, -1 for invalid entries, -2 for '=' + static const char rgchInvBase64[] = { + 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51 + }; + COMPILE_TIME_ASSERT( Q_ARRAYSIZE(rgchInvBase64) == 0x7A - 0x2B + 1 ); + + uint32 un24BitsWithSentinel = 1; + while ( cchDataMax-- > 0 ) + { + char c = *pchData++; + + if ( (uint8)(c - 0x2B) >= Q_ARRAYSIZE( rgchInvBase64 ) ) + { + if ( c == '\0' ) + break; + + if ( !bIgnoreInvalidCharacters && !( c == '\r' || c == '\n' || c == '\t' || c == ' ' ) ) + goto decode_failed; + else + continue; + } + + c = rgchInvBase64[(uint8)(c - 0x2B)]; + if ( c < 0 ) + { + if ( c == -2 ) // -2 -> terminating '=' + break; + + if ( !bIgnoreInvalidCharacters ) + goto decode_failed; + else + continue; + } + + un24BitsWithSentinel <<= 6; + un24BitsWithSentinel |= c; + if ( un24BitsWithSentinel & (1<<24) ) + { + if ( cubDecodedData < 3 ) // out of space? go to final write logic + break; + if ( pubDecodedData ) + { + pubDecodedData[0] = (uint8)( un24BitsWithSentinel >> 16 ); + pubDecodedData[1] = (uint8)( un24BitsWithSentinel >> 8); + pubDecodedData[2] = (uint8)( un24BitsWithSentinel ); + pubDecodedData += 3; + } + cubDecodedData -= 3; + un24BitsWithSentinel = 1; + } + } + + // If un24BitsWithSentinel contains data, output the remaining full bytes + if ( un24BitsWithSentinel >= (1<<6) ) + { + // Possibilities are 3, 2, 1, or 0 full output bytes. + int nWriteBytes = 3; + while ( un24BitsWithSentinel < (1<<24) ) + { + nWriteBytes--; + un24BitsWithSentinel <<= 6; + } + + // Write completed bytes to output + while ( nWriteBytes-- > 0 ) + { + if ( cubDecodedData == 0 ) + { + //AssertMsg( false, "CCrypto::Base64Decode: insufficient output buffer (up to n*3/4+2 bytes required)" ); + goto decode_failed; + } + if ( pubDecodedData ) + { + *pubDecodedData++ = (uint8)(un24BitsWithSentinel >> 16); + } + --cubDecodedData; + un24BitsWithSentinel <<= 8; + } + } + + *pcubDecodedData = cubDecodedDataOrig - cubDecodedData; + return true; + +decode_failed: + *pcubDecodedData = cubDecodedDataOrig - cubDecodedData; + return false; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generate a SHA1 hash +// Input: pchInput - Plaintext string of item to hash (null terminated) +// pOutDigest - Pointer to receive hashed digest output +//----------------------------------------------------------------------------- +bool CCrypto::GenerateSHA1Digest( const uint8 *pubInput, const int cubInput, SHADigest_t *pOutDigest ) +{ + //VPROF_BUDGET( "CCrypto::GenerateSHA1Digest", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubInput ); + Assert( cubInput > 0 ); + Assert( pOutDigest ); + + bool bSuccess = true; + try + { + CryptoPP::SHA().CalculateDigest( *pOutDigest, pubInput, cubInput ); + } + catch(...) + { + bSuccess = false; + } + + return bSuccess; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generate a hash Salt - be careful, over-writing an existing salt +// will render the hashed value unverifiable. +//----------------------------------------------------------------------------- +bool CCrypto::GenerateSalt( Salt_t *pSalt ) +{ + //VPROF_BUDGET( "CCrypto::GenerateSalt", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pSalt ); + + bool bSuccess = true; + try + { + CPoolAllocatedRNG rng; + rng.GetRNG().GenerateBlock( (byte*)pSalt, sizeof(Salt_t) ); + } + catch(...) + { + bSuccess = false; + } + + return bSuccess; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generate a SHA1 hash using a salt. +// Input: pchInput - Plaintext string of item to hash (null terminated) +// pSalt - Salt +// pOutDigest - Pointer to receive salted digest output +//----------------------------------------------------------------------------- +bool CCrypto::GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSalt, SHADigest_t *pOutDigest ) +{ + //VPROF_BUDGET( "CCrypto::GenerateSaltedSHA1Digest", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pchInput ); + Assert( pSalt ); + Assert( pOutDigest ); + + int iInputLen = Q_strlen( pchInput ); + uint8 *pubSaltedInput = new uint8[ iInputLen + sizeof( Salt_t ) ]; + + // Insert half the salt before the input string and half at the end. + // This is probably unnecessary (to split the salt) but we're stuck with it for historical reasons. + uint8 *pubCursor = pubSaltedInput; + Q_memcpy( pubCursor, (uint8 *)pSalt, sizeof(Salt_t) / 2 ); + pubCursor += sizeof( Salt_t ) / 2; + Q_memcpy( pubCursor, pchInput, iInputLen ); + pubCursor += iInputLen; + Q_memcpy( pubCursor, (uint8 *)pSalt + sizeof(Salt_t) / 2, sizeof(Salt_t) / 2 ); + + bool bSuccess = true; + try + { + CryptoPP::SHA().CalculateDigest( *pOutDigest, pubSaltedInput, iInputLen + sizeof( Salt_t ) ); + } + catch(...) + { + bSuccess = false; + } + + delete [] pubSaltedInput; + + return bSuccess; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generates a random block of data +//----------------------------------------------------------------------------- +bool CCrypto::GenerateRandomBlock( uint8 *pubDest, int cubDest ) +{ + CPoolAllocatedRNG rng; + rng.GetRNG().GenerateBlock( pubDest, cubDest ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generate a keyed-hash MAC using SHA1 +// Input: pubData - Plaintext data to digest +// cubData - length of data +// pubKey - key to use in HMAC +// cubKey - length of key +// pOutDigest - Pointer to receive hashed digest output +//----------------------------------------------------------------------------- +bool CCrypto::GenerateHMAC( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHADigest_t *pOutputDigest ) +{ + //VPROF_BUDGET( "CCrypto::GenerateHMAC", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( cubData > 0 ); + Assert( pubKey ); + Assert( cubKey > 0 ); + Assert( pOutputDigest ); + + bool bSuccess = true; + try + { + CryptoPP::HMAC< CryptoPP::SHA1 > hmac( pubKey, cubKey ); + hmac.CalculateDigest( *pOutputDigest, pubData, cubData ); + } + catch(...) + { + bSuccess = false; + } + + return bSuccess; +} + + +//----------------------------------------------------------------------------- +// Purpose: Generate a keyed-hash MAC using SHA-256 +//----------------------------------------------------------------------------- +bool CCrypto::GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest ) +{ + //VPROF_BUDGET( "CCrypto::GenerateHMAC256", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( cubData > 0 ); + Assert( pubKey ); + Assert( cubKey > 0 ); + Assert( pOutputDigest ); + + bool bSuccess = true; + try + { + CryptoPP::HMAC< CryptoPP::SHA256 > hmac( pubKey, cubKey ); + hmac.CalculateDigest( *pOutputDigest, pubData, cubData ); + } + catch(...) + { + bSuccess = false; + } + + return bSuccess; +} + + +bool CCrypto::BGzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ) +{ + bool bSuccess = true; + try + { + std::string gzip_output; + StringSource( (byte *)pubData, cubData, true, new Gzip( new StringSink( gzip_output ) ) ); + bufOutput.Set( (uint8*)gzip_output.c_str(), (uint32)gzip_output.length() ); + } + catch( ... ) + { + bSuccess = false; + } + return bSuccess; +} + + +bool CCrypto::BGunzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ) +{ + bool bSuccess = true; + try + { + std::string gunzip_output; + StringSource( (byte *)pubData, cubData, true, new Gunzip( new StringSink( gunzip_output ) ) ); + bufOutput.Set( (uint8*)gunzip_output.c_str(), (uint32)gunzip_output.length() ); + } + catch( ... ) + { + bSuccess = false; + } + return bSuccess; +} + + +//! These are all needed to get around stack-overflow bug in Initialize() +class HexDecoderTKS : public HexDecoder +{ +public: + HexDecoderTKS(BufferedTransformation *attachment, const int *pnDecodingArray) + : HexDecoder(attachment) + { + BaseN_Decoder::IsolatedInitialize( MakeParameters( Name::DecodingLookupArray(), pnDecodingArray )( Name::Log2Base(), 4 ) ); + } +}; + +class Base32DecoderTKS : public Base32Decoder +{ +public: + Base32DecoderTKS(BufferedTransformation *attachment, const int *pnDecodingArray) + : Base32Decoder(attachment) + { + BaseN_Decoder::IsolatedInitialize( MakeParameters( Name::DecodingLookupArray(), pnDecodingArray )( Name::Log2Base(), 5 ) ); + } +}; + + +//----------------------------------------------------------------------------- +// Purpose: Implement hex encoding / decoding using a custom lookup table. +// This is a class because the decoding is done via a generated +// reverse-lookup table, and to save time it's best to just create +// that table once. +//----------------------------------------------------------------------------- +CCustomHexEncoder::CCustomHexEncoder( const char *pchEncodingTable ) +{ + m_bValidEncoding = false; + if ( Q_strlen( pchEncodingTable ) == sizeof( m_rgubEncodingTable ) ) + { + Q_memcpy( m_rgubEncodingTable, pchEncodingTable, sizeof( m_rgubEncodingTable ) ); + + BaseN_Decoder::InitializeDecodingLookupArray( m_rgnDecodingTable, m_rgubEncodingTable, 16, false ); + m_bValidEncoding = true; + } + else + { + //AssertMsg( false, "CCrypto::CustomHexEncoder: Improper encoding table\n" ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CCustomHexEncoder::~CCustomHexEncoder() +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: Hex-encodes a block of data. (Binary -> text representation.) The output +// is null-terminated and can be treated as a string. +// Uses the supplied custom encoding characters +// Input: pubData - Data to encode +// cubData - Size of data to encode +// pchEncodedData - Pointer to string buffer to store output in +// cchEncodedData - Size of pchEncodedData buffer +//----------------------------------------------------------------------------- +bool CCustomHexEncoder::Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ) +{ + //VPROF_BUDGET( "CCrypto::CustomHexEncode", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( cubData ); + Assert( pchEncodedData ); + Assert( cchEncodedData > 0 ); + + if ( !m_bValidEncoding ) + return false; + + ArraySink * pArraySinkOutput = new ArraySink( (byte *) pchEncodedData, cchEncodedData ); + // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs + HexEncoder hexEncoder( pArraySinkOutput ); + hexEncoder.IsolatedInitialize( MakeParameters( Name::EncodingLookupArray(), (const uint8 *)m_rgubEncodingTable ) ); + hexEncoder.Put( pubData, cubData ); + hexEncoder.MessageEnd(); + + uint32 len = pArraySinkOutput->TotalPutLength(); + pchEncodedData[len] = 0; // NULL-terminate + if ( len >= cchEncodedData ) + { + /*AssertMsg2( false, "CCrypto::CustomHexEncode: insufficient output buffer for encoding, needed %d got %d\n", + len, cchEncodedData );*/ + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Hex-decodes a block of data. (Text -> binary representation.) +// With custom encoding-table +// Input: pchData - Null-terminated hex-encoded string +// pubDecodedData - Pointer to buffer to store output in +// pcubDecodedData - Pointer to variable that contains size of +// output buffer. At exit, is filled in with actual size +// of decoded data. +//----------------------------------------------------------------------------- +bool CCustomHexEncoder::Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ) +{ + //VPROF_BUDGET( "CCrypto::CustomHexDecode", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pchData ); + Assert( pubDecodedData ); + Assert( pcubDecodedData ); + Assert( *pcubDecodedData ); + + if ( !m_bValidEncoding ) + return false; + + ArraySink * pArraySinkOutput = new ArraySink( pubDecodedData, *pcubDecodedData ); + // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs + HexDecoderTKS hexDecoder( pArraySinkOutput, (const int *)m_rgnDecodingTable ); + hexDecoder.Put( (byte *) pchData, Q_strlen( pchData ) ); + hexDecoder.MessageEnd(); + + uint32 len = pArraySinkOutput->TotalPutLength(); + if ( len > *pcubDecodedData ) + { + /*AssertMsg2( false, "CCrypto::CustomHexDecode: insufficient output buffer for decoding, needed %d got %d\n", + len, *pcubDecodedData );*/ + return false; + } + *pcubDecodedData = len; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Implement hex encoding / decoding using a custom lookup table. +// This is a class because the decoding is done via a generated +// reverse-lookup table, and to save time it's best to just create +// that table once. +//----------------------------------------------------------------------------- +CCustomBase32Encoder::CCustomBase32Encoder( const char *pchEncodingTable ) +{ + m_bValidEncoding = false; + if ( Q_strlen( pchEncodingTable ) == sizeof( m_rgubEncodingTable ) ) + { + Q_memcpy( m_rgubEncodingTable, pchEncodingTable, sizeof( m_rgubEncodingTable ) ); + + BaseN_Decoder::InitializeDecodingLookupArray( m_rgnDecodingTable, m_rgubEncodingTable, 32, false ); + m_bValidEncoding = true; + } + else + { + //AssertMsg( false, "CCrypto::CustomBase32Encoder: Improper encoding table\n" ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CCustomBase32Encoder::~CCustomBase32Encoder() +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: Base32-encodes a block of data. (Binary -> text representation.) The output +// is null-terminated and can be treated as a string. +// Uses the supplied custom encoding table +// Input: pubData - Data to encode +// cubData - Size of data to encode +// pchEncodedData - Pointer to string buffer to store output in +// cchEncodedData - Size of pchEncodedData buffer +//----------------------------------------------------------------------------- +bool CCustomBase32Encoder::Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ) +{ + //VPROF_BUDGET( "CCrypto::CustomBase32Encode", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pubData ); + Assert( cubData ); + Assert( pchEncodedData ); + Assert( cchEncodedData > 0 ); + + if ( !m_bValidEncoding ) + return false; + + ArraySink * pArraySinkOutput = new ArraySink( (byte *) pchEncodedData, cchEncodedData ); + // Note: Base32Encoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs + Base32Encoder base32Encoder( pArraySinkOutput ); + base32Encoder.IsolatedInitialize( MakeParameters( Name::EncodingLookupArray(), (const uint8 *)m_rgubEncodingTable ) ); + base32Encoder.Put( pubData, cubData ); + base32Encoder.MessageEnd(); + + uint32 len = pArraySinkOutput->TotalPutLength(); + pchEncodedData[len] = 0; // NULL-terminate + if ( len >= cchEncodedData ) + { + /*AssertMsg2( false, "CCrypto::CustomBase32Encode: insufficient output buffer for encoding, needed %d got %d\n", + len, cchEncodedData );*/ + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Base32-decodes a block of data. (Text -> binary representation.) +// With custom encoding table +// Input: pchData - Null-terminated hex-encoded string +// pubDecodedData - Pointer to buffer to store output in +// pcubDecodedData - Pointer to variable that contains size of +// output buffer. At exit, is filled in with actual size +// of decoded data. +//----------------------------------------------------------------------------- +bool CCustomBase32Encoder::Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ) +{ + //VPROF_BUDGET( "CCrypto::CustomBase32Decode", VPROF_BUDGETGROUP_ENCRYPTION ); + Assert( pchData ); + Assert( pubDecodedData ); + Assert( pcubDecodedData ); + Assert( *pcubDecodedData ); + + if ( !m_bValidEncoding ) + return false; + + ArraySink * pArraySinkOutput = new ArraySink( pubDecodedData, *pcubDecodedData ); + // Note: Base32Encoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs + Base32DecoderTKS base32Decoder( pArraySinkOutput, (const int *)m_rgnDecodingTable ); + base32Decoder.Put( (byte *) pchData, Q_strlen( pchData ) ); + base32Decoder.MessageEnd(); + + uint32 len = pArraySinkOutput->TotalPutLength(); + if ( len > *pcubDecodedData ) + { + /*AssertMsg2( false, "CCrypto::CustomBase32Decode: insufficient output buffer for decoding, needed %d got %d\n", + len, *pcubDecodedData );*/ + return false; + } + *pcubDecodedData = len; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Base32-encodes a block of data. (Binary -> text representation.) The output +// is null-terminated and can be treated as a string. +// Uses the supplied custom encoding table, and a bit-stream input source +// (not necessarily an integer number of bytes). +// Input: pBitStringData - Data to encode +// pchEncodedData - Pointer to string buffer to store output in +// cchEncodedData - Size of pchEncodedData buffer +//----------------------------------------------------------------------------- +bool CCustomBase32Encoder::Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, uint32 cchEncodedData ) +{ + // This is useful if you have, say, 125 bits of information and + // want to encode them into 25 base32-encoded characters. + uint32 cBits = pBitStringData->GetCurrNumBits(); + + uint32 cCharacters = (cBits / 5); + uint32 cBitsRemainder = cBits % 5; + if ( cBitsRemainder ) + cCharacters++; + + // GTE because of NULL + if ( cCharacters >= cchEncodedData ) + return false; + + CSimpleBitString::iterator itBitString( *pBitStringData ); + uint ich = 0; + for ( ; ich < cCharacters; ++ich ) + { + uint32 unCodon = itBitString.GetNextBits( 5 ); + // Pad w/ zero bits to integer num codons + if ( ich == (cCharacters - 1) ) + unCodon <<= cBitsRemainder; + + pchEncodedData[ich] = m_rgubEncodingTable[ unCodon ]; + } + + // NULL + pchEncodedData[ich] = 0; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Base32-decodes a block of data. (Text -> binary representation.) +// With custom encoding table, and a BitString output +// Input: pchData - Null-terminated base32-encoded string +// pBitStringDecodedData - Pointer to BitString to receive decoded data +//----------------------------------------------------------------------------- +bool CCustomBase32Encoder::Decode( const char *pchData, CSimpleBitString *pBitStringDecodedData ) +{ + // Note: 25 base32-encoded characters contain 125 bits of information. + // Decoded into a byte buffer, this yields 15 bytes plus 5 bits of padding. + // Decoded into a CSimpleBitString, it will yield all 125 bits + while ( *pchData ) + { + uint32 unData = m_rgnDecodingTable[(unsigned)*pchData++]; + if ( unData == 0xFFFFFFFF ) + return false; + + pBitStringDecodedData->AppendBits( unData, 5 ); + } + + return true; +} + +#ifdef DBGFLAG_VALIDATE +//----------------------------------------------------------------------------- +// Purpose: validates memory structures +//----------------------------------------------------------------------------- +void CCrypto::ValidateStatics( CValidator &validator, const char *pchName ) +{ + ValidateObj( g_tslistPAutoSeededRNG ); +} +#endif // DBGFLAG_VALIDATE + + +//----------------------------------------------------------------------------- +// Purpose: Given a plaintext password, check whether it matches an existing +// hash +//----------------------------------------------------------------------------- +bool CCrypto::BValidatePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const PasswordHash_t &DigestStored, const Salt_t &Salt, PasswordHash_t *pDigestComputed ) +{ + //VPROF_BUDGET( "CCrypto::BValidatePasswordHash", VPROF_BUDGETGROUP_ENCRYPTION ); + + bool bResult = false; + size_t cDigest = k_HashLengths[hashType]; + Assert( cDigest != 0 ); + PasswordHash_t tmpDigest; + PasswordHash_t *pOutputDigest = pDigestComputed; + if ( pOutputDigest == NULL ) + { + pOutputDigest = &tmpDigest; + } + + BGeneratePasswordHash( pchInput, hashType, Salt, *pOutputDigest ); + bResult = ( 0 == Q_memcmp( &DigestStored, pOutputDigest, cDigest ) ); + + return bResult; +} + +//----------------------------------------------------------------------------- +// Purpose: Given a plaintext password and salt, generate a password hash of +// the requested type. +//----------------------------------------------------------------------------- +bool CCrypto::BGeneratePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const Salt_t &Salt, PasswordHash_t &OutPasswordHash ) +{ + //VPROF_BUDGET( "CCrypto::BGeneratePasswordHash", VPROF_BUDGETGROUP_ENCRYPTION ); + + bool bResult = false; + size_t cDigest = k_HashLengths[hashType]; + + switch ( hashType ) + { + case k_EHashSHA1: + bResult = CCrypto::GenerateSaltedSHA1Digest( pchInput, &Salt, (SHADigest_t *)&OutPasswordHash.sha ); + break; + case k_EHashBigPassword: + { + // + // This is a fake algorithm to test widening of the column. It's a salted SHA-1 hash with 0x01 padding + // on either side of it. + // + size_t cDigestSHA1 = k_HashLengths[k_EHashSHA1]; + size_t cPadding = ( cDigest - cDigestSHA1 ) / 2; + + //AssertMsg( ( ( cDigest - cDigestSHA1 ) % 2 ) == 0, "Invalid hash width for k_EHashBigPassword, needs to be even." ); + + CCrypto::GenerateSaltedSHA1Digest( pchInput, &Salt, (SHADigest_t *)( (uint8 *)&OutPasswordHash.bigpassword + cPadding ) ); + Q_memset( (uint8 *)&OutPasswordHash, 0x01, cPadding ); + Q_memset( (uint8 *)&OutPasswordHash + cPadding + cDigestSHA1 , 0x01, cPadding ); + bResult = true; + break; + } + case k_EHashPBKDF2_1000: + bResult = CCrypto::BGeneratePBKDF2Hash( pchInput, Salt, 1000, OutPasswordHash ); + break; + case k_EHashPBKDF2_5000: + bResult = CCrypto::BGeneratePBKDF2Hash( pchInput, Salt, 5000, OutPasswordHash ); + break; + case k_EHashPBKDF2_10000: + bResult = CCrypto::BGeneratePBKDF2Hash( pchInput, Salt, 10000, OutPasswordHash ); + break; + case k_EHashSHA1WrappedWithPBKDF2_10000: + bResult = CCrypto::BGenerateWrappedSHA1PasswordHash( pchInput, Salt, 10000, OutPasswordHash ); + break; + default: + //AssertMsg1( false, "Invalid password hash type %u passed to BGeneratePasswordHash\n", hashType ); + bResult = false; + } + + return bResult; +} + +//----------------------------------------------------------------------------- +// Purpose: Given a plaintext password and salt and a count of rounds, generate a PBKDF2 hash +// with the requested number of rounds. +//----------------------------------------------------------------------------- +bool CCrypto::BGeneratePBKDF2Hash( const char* pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ) +{ + PKCS5_PBKDF2_HMAC pbkdf; + + unsigned int iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)pchInput, Q_strlen(pchInput), (const byte *)&Salt, sizeof(Salt), rounds ); + + return ( iterations == rounds ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Given a plaintext password and salt and a count of rounds, generate a SHA1 hash wrapped with +// a PBKDF2 hash with the specified number of rounds. +// Used to provide a stronger password hash for accounts that haven't logged in in a while. +//----------------------------------------------------------------------------- +bool CCrypto::BGenerateWrappedSHA1PasswordHash( const char *pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ) +{ + bool bResult; + bResult = CCrypto::GenerateSaltedSHA1Digest( pchInput, &Salt, (SHADigest_t *)&OutPasswordHash.sha ); + if ( bResult ) + { + PKCS5_PBKDF2_HMAC pbkdf; + unsigned int iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)&OutPasswordHash.sha, sizeof(OutPasswordHash.sha), (const byte *)&Salt, sizeof(Salt), rounds ); + + bResult = ( iterations == rounds ); + } + return bResult; +} + +//----------------------------------------------------------------------------- +// Purpose: Given an existing password hash and salt, attempt to construct a stronger +// password hash and return the new hash type. +// +// Currently the only transformation available is from a SHA1 (or BigPassword) +// hash to a PBKDF2 hash with 10,000 rounds. In the future this function +// may be extended to allow additional transformations. +//----------------------------------------------------------------------------- +bool CCrypto::BUpgradeOrWrapPasswordHash( PasswordHash_t &InPasswordHash, EPasswordHashAlg hashTypeIn, const Salt_t &Salt, PasswordHash_t &OutPasswordHash, EPasswordHashAlg &hashTypeOut ) +{ + bool bResult = true;; + + if ( hashTypeIn == k_EHashSHA1 || hashTypeIn == k_EHashBigPassword ) + { + // + // Can wrap a SHA1 hash with any PBKDF variant, but right now only 10,000 rounds is + // implemented. + // + if ( hashTypeOut == k_EHashPBKDF2_10000 ) + { + hashTypeOut = k_EHashSHA1WrappedWithPBKDF2_10000; + + byte * pbHash; + if ( hashTypeIn == k_EHashSHA1 ) + { + pbHash = (byte *)&InPasswordHash.sha; + } + else + { + // + // Need to unroll BigPasswordHash into unpadded SHA1 + // + size_t cDigest = k_HashLengths[k_EHashBigPassword]; + size_t cDigestSHA1 = k_HashLengths[k_EHashSHA1]; + size_t cPadding = ( cDigest - cDigestSHA1 ) / 2; + + AssertMsg( ( ( cDigest - cDigestSHA1 ) % 2 ) == 0, "Invalid hash width for k_EHashBigPassword, needs to be even." ); + pbHash = (byte *)&InPasswordHash.sha + cPadding; + } + + PKCS5_PBKDF2_HMAC pbkdf; + PasswordHash_t passOut; + unsigned int iterations = pbkdf.DeriveKey( (byte *)passOut.pbkdf2, sizeof(passOut.pbkdf2), 0, pbHash, k_HashLengths[k_EHashSHA1], (const byte *)&Salt, sizeof(Salt), 10000 ); + + bResult = ( iterations == 10000 ); + if ( bResult ) + { + Q_memcpy( &OutPasswordHash, &passOut, sizeof(OutPasswordHash) ); + } + } + else + { + Assert( hashTypeOut == k_EHashPBKDF2_10000 ); + bResult = false; + } + } + else + { + bResult = false; + Assert( false ); + } + + return bResult; +} + diff --git a/common/crypto.h b/common/crypto.h new file mode 100644 index 000000000..80b25b2c9 --- /dev/null +++ b/common/crypto.h @@ -0,0 +1,281 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: This module is for wrapping Crypto++ functions, including crypto++ +// directly has nasty consequences polluting the global namespace, and +// conflicting with xdebug and locale stuff, so we only include it here +// and use this wrapper in the rest of our code. +// +// $NoKeywords: $ +//============================================================================= + +#ifndef CRYPTO_H +#define CRYPTO_H + +#include // for Assert & AssertMsg +#include "tier1/passwordhash.h" +#include "tier1/utlmemory.h" +#include // for Salt_t + +extern void FreeListRNG(); + +const unsigned int k_cubSHA256Hash = 32; +typedef unsigned char SHA256Digest_t[ k_cubSHA256Hash ]; + +const int k_nSymmetricBlockSize = 16; // AES block size (128 bits) +const int k_nSymmetricKeyLen = 32; // length in bytes of keys used for symmetric encryption + +const int k_nRSAKeyLenMax = 1024; // max length in bytes of keys used for RSA encryption (includes DER encoding) +const int k_nRSAKeyLenMaxEncoded = k_nRSAKeyLenMax*2; // max length in bytes of hex-encoded key (hex encoding exactly doubles size) +const int k_nRSAKeyBits = 1024; // length in bits of keys used for RSA encryption +const int k_cubRSAEncryptedBlockSize = 128; +const int k_cubRSAPlaintextBlockSize = 86 + 1; // assume plaintext is text, so add a byte for the trailing \0 +const uint32 k_cubRSASignature = k_cubRSAEncryptedBlockSize; + +// Simple buffer class to encapsulate output from crypto functions with unknown output size +class CCryptoOutBuffer +{ +public: + + CCryptoOutBuffer() + { + m_pubData = NULL; + m_cubData = 0; + } + + ~CCryptoOutBuffer() + { + if ( m_pubData ) + delete[] m_pubData; + m_pubData = NULL; + m_cubData = 0; + } + + void Set( uint8 *pubData, uint32 cubData ) + { + if ( !pubData || !cubData ) + return; + + if ( m_pubData ) + delete[] m_pubData; + + m_pubData = new uint8[ cubData ]; + memcpy( m_pubData, pubData, cubData ); + m_cubData = cubData; + } + + void Allocate( uint32 cubData ) + { + if ( m_pubData ) + delete[] m_pubData; + + m_pubData = new uint8[ cubData ]; + m_cubData = cubData; + } + + void Trim( uint32 cubTrim ) + { + Assert( cubTrim <= m_cubData ); + m_cubData = cubTrim; + } + + uint8 *PubData() { return m_pubData; } + uint32 CubData() { return m_cubData; } + +private: + uint8 *m_pubData; + uint32 m_cubData; +}; + +#if !defined(_PS3) +class CCrypto +{ +public: + static uint32 GetSymmetricEncryptedSize( uint32 cubPlaintextData ); + + // this method writes the encrypted IV, then the ciphertext + static bool SymmetricEncryptWithIV( const uint8 * pubPlaintextData, uint32 cubPlaintextData, + const uint8 * pIV, uint32 cubIV, + uint8 * pubEncryptedData, uint32 * pcubEncryptedData, + const uint8 * pubKey, uint32 cubKey ); + static bool SymmetricEncrypt( const uint8 * pubPlaintextData, uint32 cubPlaintextData, + uint8 * pubEncryptedData, uint32 * pcubEncryptedData, + const uint8 * pubKey, uint32 cubKey ); + // this method assumes there is no IV before the payload - dissimilar to SymmetricEncryptWithIV + static bool SymmetricDecryptWithIV( const uint8 * pubEncryptedData, uint32 cubEncryptedData, + const uint8 * pIV, uint32 cubIV, + uint8 * pubPlaintextData, uint32 * pcubPlaintextData, + const uint8 * pubKey, uint32 cubKey ); + static bool SymmetricDecrypt( const uint8 * pubEncryptedData, uint32 cubEncryptedData, + uint8 * pubPlaintextData, uint32 * pcubPlaintextData, + const uint8 * pubKey, uint32 cubKey ); + + // symmetrically encrypt data with a text password. A SHA256 hash of the password + // is used as an AES encryption key (calls SymmetricEncrypt, above). + // An HMAC of the ciphertext is appended, for authentication. + static bool EncryptWithPasswordAndHMAC( const uint8 *pubPlaintextData, uint32 cubPlaintextData, + uint8 * pubEncryptedData, uint32 * pcubEncryptedData, + const char *pchPassword ); + + // Same as above but uses an explicit IV. The format of the ciphertext is the same. + // Be sure you know what you're doing if you use this - a random IV is much more secure in general! + static bool EncryptWithPasswordAndHMACWithIV( const uint8 *pubPlaintextData, uint32 cubPlaintextData, + const uint8 * pIV, uint32 cubIV, + uint8 * pubEncryptedData, uint32 * pcubEncryptedData, + const char *pchPassword ); + + // Symmetrically decrypt data with the given password (see above). + // If the HMAC does not match what we expect, then we know that either the password is + // incorrect or the message is corrupted. + static bool DecryptWithPasswordAndAuthenticate( const uint8 * pubEncryptedData, uint32 cubEncryptedData, + uint8 * pubPlaintextData, uint32 * pcubPlaintextData, + const char *pchPassword ); + + static bool RSAGenerateKeys( uint8 *pubPublicKey, uint32 *pcubPublicKey, uint8 *pubPrivateKey, uint32 *pcubPrivateKey ); + + static bool RSAEncrypt( const uint8 *pubPlaintextPlaintextData, const uint32 cubData, uint8 *pubEncryptedData, + uint32 *pcubEncryptedData, const uint8 *pubPublicKey, const uint32 cubPublicKey ); + static bool RSADecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPrivateKey, const uint32 cubPrivateKey ); + + // decrypt using a public key, and no padding + static bool RSAPublicDecrypt_NoPadding( const uint8 *pubEncryptedData, uint32 cubEncryptedData, + uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPublicKey, const uint32 cubPublicKey ); + + static bool RSASign( const uint8 *pubData, const uint32 cubData, + uint8 *pubSignature, uint32 *pcubSignature, + const uint8 * pubPrivateKey, const uint32 cubPrivateKey ); + static bool RSAVerifySignature( const uint8 *pubData, const uint32 cubData, + const uint8 *pubSignature, const uint32 cubSignature, + const uint8 *pubPublicKey, const uint32 cubPublicKey ); + + static bool RSASignSHA256( const uint8 *pubData, const uint32 cubData, + uint8 *pubSignature, uint32 *pcubSignature, + const uint8 * pubPrivateKey, const uint32 cubPrivateKey ); + static bool RSAVerifySignatureSHA256( const uint8 *pubData, const uint32 cubData, + const uint8 *pubSignature, const uint32 cubSignature, + const uint8 *pubPublicKey, const uint32 cubPublicKey ); + + static bool HexEncode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); + static bool HexDecode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); + + static uint32 Base64EncodeMaxOutput( uint32 cubData, const char *pszLineBreakOrNull ); + static bool Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32 cchEncodedData, bool bInsertLineBreaks = true ); // legacy, deprecated + static bool Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32 *pcchEncodedData, const char *pszLineBreak = "\n" ); + + static uint32 Base64DecodeMaxOutput( uint32 cubData ) { return ( (cubData + 3 ) / 4) * 3 + 1; } + static bool Base64Decode( const char *pchEncodedData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters = true ); // legacy, deprecated + static bool Base64Decode( const char *pchEncodedData, uint32 cchEncodedData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters = true ); + + static bool GenerateSalt( Salt_t *pSalt ); + static bool GenerateSHA1Digest( const uint8 *pubInput, const int cubInput, SHADigest_t *pOutDigest ); + static bool GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSalt, SHADigest_t *pOutDigest ); + static bool GenerateRandomBlock( uint8 *pubDest, int cubDest ); + + static bool GenerateHMAC( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHADigest_t *pOutputDigest ); + static bool GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest ); + + static bool BGeneratePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const Salt_t &Salt, PasswordHash_t &OutPasswordHash ); + static bool BValidatePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const PasswordHash_t &DigestStored, const Salt_t &Salt, PasswordHash_t *pDigestComputed ); + static bool BGeneratePBKDF2Hash( const char *pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ); + static bool BGenerateWrappedSHA1PasswordHash( const char *pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ); + static bool BUpgradeOrWrapPasswordHash( PasswordHash_t &InPasswordHash, EPasswordHashAlg hashTypeIn, const Salt_t &Salt, PasswordHash_t &OutPasswordHash, EPasswordHashAlg &hashTypeOut ); + + static bool BGzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); + static bool BGunzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); + +#ifdef DBGFLAG_VALIDATE + static void ValidateStatics( CValidator &validator, const char *pchName ); +#endif +}; + +#else + +// bugbug ps3 - stub until we implement from PS3 libs +class CCrypto +{ +public: + // ps3 only + static bool Init(); + static void Shutdown(); + + //shared + static uint32 GetSymmetricEncryptedSize( uint32 cubPlaintextData ); + + static bool SymmetricEncrypt( const uint8 * pubPlaintextData, uint32 cubPlaintextData, uint8 * pubEncryptedData, uint32 * pcubEncryptedData, const uint8 * pubKey, uint32 cubKey ); + static bool SymmetricDecrypt( const uint8 * pubEncryptedData, uint32 cubEncryptedData, uint8 * pubPlaintextData, uint32 * pcubPlaintextData, const uint8 * pubKey, uint32 cubKey ); + static bool RSAGenerateKeys( uint8 *pubPublicKey, uint32 *pcubPublicKey, uint8 *pubPrivateKey, uint32 *pcubPrivateKey ) { AssertMsg( false, "RSAGenerateKeys not implemented on PS3" ); return false; } + static bool RSAEncrypt( const uint8 *pubPlaintextPlaintextData, const uint32 cubData, uint8 *pubEncryptedData, uint32 *pcubEncryptedData, const uint8 *pubPublicKey, const uint32 cubPublicKey ); + static bool RSADecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPrivateKey, const uint32 cubPrivateKey ); + static bool RSAPublicDecrypt_NoPadding( const uint8 *pubEncryptedData, uint32 cubEncryptedData, uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPublicKey, const uint32 cubPublicKey ) { AssertMsg( false, "RSAPublicDecrypt_NoPadding not implemented on PS3" ); return false; } + static bool RSASign( const uint8 *pubData, const uint32 cubData, uint8 *pubSignature, uint32 *pcubSignature, const uint8 * pubPrivateKey, const uint32 cubPrivateKey ); + static bool RSAVerifySignature( const uint8 *pubData, const uint32 cubData, const uint8 *pubSignature, const uint32 cubSignature, const uint8 *pubPublicKey, const uint32 cubPublicKey ); + static bool HexEncode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); + static bool HexDecode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); + static bool Base64Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData, bool bInsertLineBreaks = true ) { AssertMsg( false, "Base64Encode not implemented on PS3" ); return false; } // cellHttpUtilBase64Encoder() + static bool Base64Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters = true ) { AssertMsg( false, "Base64Decode not implemented on PS3" ); return false; } // cellHttpUtilBase64Decoder() + static bool GenerateSalt( Salt_t *pSalt ); + static bool GenerateSHA1Digest( const uint8 *pubInput, const int cubInput, SHADigest_t *pOutDigest ); + static bool GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSalt, SHADigest_t *pOutDigest ) { AssertMsg( false, "GenerateSaltedSHA1Digest not implemented on PS3" ); return false; } + static bool GenerateRandomBlock( uint8 *pubDest, int cubDest ); + static bool GenerateHMAC( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHADigest_t *pOutputDigest ) { AssertMsg( false, "GenerateHMAC not implemented on PS3" ); return false; } + static bool GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest ) { AssertMsg( false, "GenerateHMAC256 not implemented on PS3" ); return false; } + static bool BGzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); + static bool BGunzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); + +#ifdef DBGFLAG_VALIDATE + static void ValidateStatics( CValidator &validator, const char *pchName ); +#endif +}; + + +#endif //!_PS3 + + +class CSimpleBitString; + +//----------------------------------------------------------------------------- +// Purpose: Implement hex encoding / decoding using a custom lookup table. +// This is a class because the decoding is done via a generated +// reverse-lookup table, and to save time it's best to just create +// that table once. +//----------------------------------------------------------------------------- +class CCustomHexEncoder +{ +public: + CCustomHexEncoder( const char *pchEncodingTable ); + ~CCustomHexEncoder(); + + bool Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); + bool Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); + +private: + bool m_bValidEncoding; + uint8 m_rgubEncodingTable[16]; + int m_rgnDecodingTable[256]; +}; + +//----------------------------------------------------------------------------- +// Purpose: Implement base32 encoding / decoding using a custom lookup table. +// This is a class because the decoding is done via a generated +// reverse-lookup table, and to save time it's best to just create +// that table once. +//----------------------------------------------------------------------------- +class CCustomBase32Encoder +{ +public: + CCustomBase32Encoder( const char *pchEncodingTable ); + ~CCustomBase32Encoder(); + + bool Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); + bool Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); + + bool Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, uint32 cchEncodedData ); + bool Decode( const char *pchData, CSimpleBitString *pBitStringDecodedData ); + +private: + bool m_bValidEncoding; + uint8 m_rgubEncodingTable[32]; + int m_rgnDecodingTable[256]; +}; + +#endif // CRYPTO_H diff --git a/common/language.cpp b/common/language.cpp new file mode 100644 index 000000000..33877f602 --- /dev/null +++ b/common/language.cpp @@ -0,0 +1,218 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: languages definition +// +//============================================================================= + +#include "language.h" +#include "tier0/dbg.h" +#include "tier1/strtools.h" + +// NOTE: This has to be the last file included! +#include "tier0/memdbgon.h" + + +struct Language_t +{ + const char *m_pchName; + const char *m_pchShortName; + const char *m_pchVGUILocalizationName; + const char *m_pchICUName; // used by osx; ISO-639-1 + ISO-3166-1 alpha-2. http://userguide.icu-project.org/locale/examples + ELanguage m_ELanguage; + int m_LanguageCodeID; +}; + + +// REVIEW +// es_ES - use new world spanish country code instead? +// zh_CN - validate that SC date formats come through +// bt_BR - assume we should use Brazilian rather than Iberian portguese + +static const Language_t s_LanguageNames[] = +{ + { "None", "none", "None", "none", k_Lang_None, 0 }, + { "English", "english", "#GameUI_Language_English", "en_US", k_Lang_English, 1033 }, + { "German", "german", "#GameUI_Language_German", "de_DE", k_Lang_German, 1031 } , + { "French", "french", "#GameUI_Language_French", "fr_FR", k_Lang_French, 1036 } , + { "Italian", "italian", "#GameUI_Language_Italian", "it_IT", k_Lang_Italian, 1040 } , + { "Korean", "koreana", "#GameUI_Language_Korean", "ko_KR", k_Lang_Korean, 1042 } , + { "Spanish", "spanish", "#GameUI_Language_Spanish", "es_ES", k_Lang_Spanish, 1034 }, + { "Simplified_Chinese", "schinese", "#GameUI_Language_Simplified_Chinese", "zh_CN", k_Lang_Simplified_Chinese, 2052 }, + { "Traditional_Chinese", "tchinese", "#GameUI_Language_Traditional_Chinese", "zh_TW", k_Lang_Traditional_Chinese, 1028 }, + { "Russian", "russian", "#GameUI_Language_Russian", "ru_RU", k_Lang_Russian, 1049 } , + { "Thai", "thai", "#GameUI_Language_Thai", "th_TH", k_Lang_Thai, 1054 } , + { "Japanese", "japanese", "#GameUI_Language_Japanese", "ja_JP", k_Lang_Japanese, 1041 } , + { "Portuguese", "portuguese", "#GameUI_Language_Portuguese", "pt_PT", k_Lang_Portuguese, 2070 } , + { "Polish", "polish", "#GameUI_Language_Polish", "pl_PL", k_Lang_Polish, 1045 } , + { "Danish", "danish", "#GameUI_Language_Danish", "da_DK", k_Lang_Danish, 1030 } , + { "Dutch", "dutch", "#GameUI_Language_Dutch", "nl_NL", k_Lang_Dutch, 1043 } , + { "Finnish", "finnish", "#GameUI_Language_Finnish", "fi_FI", k_Lang_Finnish, 1035 } , + { "Norwegian", "norwegian", "#GameUI_Language_Norwegian", "no_NO", k_Lang_Norwegian, 1044 } , + { "Swedish", "swedish", "#GameUI_Language_Swedish", "sv_SE", k_Lang_Swedish, 1053 } , + { "Romanian", "romanian", "#GameUI_Language_Romanian", "ro_RO", k_Lang_Romanian, 1048 } , + { "Turkish", "turkish", "#GameUI_Language_Turkish", "tr_TR", k_Lang_Turkish, 1055 } , + { "Hungarian", "hungarian", "#GameUI_Language_Hungarian", "hu_HU", k_Lang_Hungarian, 1038 } , + { "Czech", "czech", "#GameUI_Language_Czech", "cs_CZ", k_Lang_Czech, 1029 } , + { "Brazilian", "brazilian", "#GameUI_Language_Brazilian", "pt_BR", k_Lang_Brazilian, 1046 } , + { "Bulgarian", "bulgarian", "#GameUI_Language_Bulgarian", "bg_BG", k_Lang_Bulgarian, 1026 } , + { "Greek", "greek", "#GameUI_Language_Greek", "el_GR", k_Lang_Greek, 1032 }, + { "Ukrainian", "ukrainian", "#GameUI_Language_Ukrainian", "uk_UA", k_Lang_Ukrainian, 1058 }, +}; + +//----------------------------------------------------------------------------- +// Purpose: translate language enum into closests windows language code ID +//----------------------------------------------------------------------------- +int GetLanguageCodeID(ELanguage eLang) +{ + for ( uint iLang = 0; iLang < Q_ARRAYSIZE(s_LanguageNames); ++iLang ) + { + if ( s_LanguageNames[iLang].m_ELanguage == eLang ) + return s_LanguageNames[iLang].m_LanguageCodeID; + } + + // default to English + return 1033; +} + +//----------------------------------------------------------------------------- +// Purpose: find the language by name +//----------------------------------------------------------------------------- +ELanguage PchLanguageToELanguage( const char *pchShortName, ELanguage eDefault ) +{ + Assert( Q_ARRAYSIZE(s_LanguageNames) == k_Lang_MAX + 1 ); + if ( !pchShortName ) + return eDefault; + + for ( uint iLang = 0; iLang < Q_ARRAYSIZE(s_LanguageNames); ++iLang ) + { + if ( !Q_stricmp( pchShortName, s_LanguageNames[iLang].m_pchShortName ) ) + { + return s_LanguageNames[iLang].m_ELanguage; + } + } + + // return default + return eDefault; +} + +//----------------------------------------------------------------------------- +// Purpose: find the language by ICU short code +//----------------------------------------------------------------------------- +ELanguage PchLanguageICUCodeToELanguage( const char *pchICUCode, ELanguage eDefault ) +{ + Assert( Q_ARRAYSIZE(s_LanguageNames) == k_Lang_MAX + 1 ); + if ( !pchICUCode ) + return eDefault; + + // Match to no more than the param length so either a short 'en' or + // full 'zh-Hant' can match + int nLen = Q_strlen( pchICUCode ); + + // we only have 5 character ICU codes so this should be enough room + char rchCleanedCode[ 6 ]; + Q_strncpy( rchCleanedCode, pchICUCode, Q_ARRAYSIZE( rchCleanedCode ) ); + if( nLen >= 3 && rchCleanedCode[ 2 ] == '-' ) + { + rchCleanedCode[ 2 ] = '_'; + } + + for ( uint iLang = 0; iLang < Q_ARRAYSIZE(s_LanguageNames); ++iLang ) + { + if ( !Q_strnicmp( rchCleanedCode, s_LanguageNames[iLang].m_pchICUName, nLen ) ) + { + return s_LanguageNames[iLang].m_ELanguage; + } + } + + // return default + return eDefault; +} + + +//----------------------------------------------------------------------------- +// Purpose: return the short string name used for this language by SteamUI +//----------------------------------------------------------------------------- +const char *GetLanguageShortName( ELanguage eLang ) +{ + COMPILE_TIME_ASSERT( Q_ARRAYSIZE(s_LanguageNames) == k_Lang_MAX + 1 ); + if ( s_LanguageNames[ eLang + 1 ].m_ELanguage == eLang ) + { + Assert( eLang + 1 < ARRAYSIZE(s_LanguageNames) ); + return s_LanguageNames[ eLang + 1 ].m_pchShortName; + } + + Assert( !"enum ELanguage order mismatched from Language_t s_LanguageNames, fix it!" ); + return s_LanguageNames[0].m_pchShortName; +} + +//----------------------------------------------------------------------------- +// Purpose: return the ICU code used for this language by SteamUI +//----------------------------------------------------------------------------- +const char *GetLanguageICUName( ELanguage eLang ) +{ + COMPILE_TIME_ASSERT( Q_ARRAYSIZE(s_LanguageNames) == k_Lang_MAX + 1 ); + if ( s_LanguageNames[ eLang + 1 ].m_ELanguage == eLang ) + { + Assert( eLang + 1 < ARRAYSIZE(s_LanguageNames) ); + return s_LanguageNames[ eLang + 1 ].m_pchICUName; + } + + Assert( !"enum ELanguage order mismatched from Language_t s_LanguageNames, fix it!" ); + return s_LanguageNames[0].m_pchICUName; +} + +//----------------------------------------------------------------------------- +// Purpose: return the CLocale name that works with setlocale() +//----------------------------------------------------------------------------- +const char *GetLangugeCLocaleName( ELanguage eLang ) +{ + if ( eLang == k_Lang_None ) + return ""; + +#ifdef _WIN32 + // table for Win32 is here: http://msdn.microsoft.com/en-us/library/hzz3tw78(v=VS.80).aspx + // shortname works except for chinese + + switch ( eLang ) + { + case k_Lang_Simplified_Chinese: + return "chs"; // or "chinese-simplified" + case k_Lang_Traditional_Chinese: + return "cht"; // or "chinese-traditional" + case k_Lang_Korean: + return "korean"; // steam likes "koreana" for the name for some reason. + default: + return GetLanguageShortName( eLang ); + } + +#else + switch ( eLang ) + { + case k_Lang_Simplified_Chinese: + case k_Lang_Traditional_Chinese: + return "zh_CN"; + default: + ; + } + + // ICU codes work on linux/osx + return GetLanguageICUName( eLang ); +#endif +} + +//----------------------------------------------------------------------------- +// Purpose: return the short string name used for this language by SteamUI +//----------------------------------------------------------------------------- +const char *GetLanguageVGUILocalization( ELanguage eLang ) +{ + COMPILE_TIME_ASSERT( Q_ARRAYSIZE(s_LanguageNames) == k_Lang_MAX + 1 ); + if ( s_LanguageNames[ eLang + 1 ].m_ELanguage == eLang ) + { + Assert( eLang + 1 < ARRAYSIZE(s_LanguageNames) ); + return s_LanguageNames[ eLang + 1 ].m_pchVGUILocalizationName; + } + + Assert( !"enum ELanguage order mismatched from Language_t s_LanguageNames, fix it!" ); + return s_LanguageNames[0].m_pchVGUILocalizationName; +} + diff --git a/common/language.h b/common/language.h new file mode 100644 index 000000000..b16c492fb --- /dev/null +++ b/common/language.h @@ -0,0 +1,56 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: represent a canonical list of the languages we support, +// +//============================================================================= + +#ifndef LANG_H +#define LANG_H +#ifdef _WIN32 +#pragma once +#endif + +// if you change this enum also change language.cpp:s_LanguageNames +enum ELanguage +{ + k_Lang_None = -1, + k_Lang_First = 0, + k_Lang_English = 0, + k_Lang_German, + k_Lang_French, + k_Lang_Italian, + k_Lang_Korean, + k_Lang_Spanish, + k_Lang_Simplified_Chinese, + k_Lang_Traditional_Chinese, + k_Lang_Russian, + k_Lang_Thai, + k_Lang_Japanese, + k_Lang_Portuguese, + k_Lang_Polish, + k_Lang_Danish, + k_Lang_Dutch, + k_Lang_Finnish, + k_Lang_Norwegian, + k_Lang_Swedish, + k_Lang_Romanian, + k_Lang_Turkish, + k_Lang_Hungarian, + k_Lang_Czech, + k_Lang_Brazilian, + k_Lang_Bulgarian, + k_Lang_Greek, + k_Lang_Ukrainian, + k_Lang_MAX +}; + +#define FOR_EACH_LANGUAGE( eLang ) for ( int eLang = (int)k_Lang_First; eLang < k_Lang_MAX; ++eLang ) + +ELanguage PchLanguageToELanguage(const char *pchShortName, ELanguage eDefault = k_Lang_English); +ELanguage PchLanguageICUCodeToELanguage( const char *pchICUCode, ELanguage eDefault = k_Lang_English ); +const char *GetLanguageShortName( ELanguage eLang ); +const char *GetLanguageICUName( ELanguage eLang ); +const char *GetLanguageVGUILocalization( ELanguage eLang ); +const char *GetLanguageName( ELanguage eLang ); + +#endif /* LANG_H */ diff --git a/common/simplebitstring.cpp b/common/simplebitstring.cpp new file mode 100644 index 000000000..e8a568425 --- /dev/null +++ b/common/simplebitstring.cpp @@ -0,0 +1,234 @@ + +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +//***************************************************************************** +// +// Contents: +// +// CSimpleBitString +// +// Authors: chrisn +// +// Target restrictions: +// +// Tool restrictions: +// +// Things to do: +// +//***************************************************************************** + + +//***************************************************************************** +// +// Include files required to build and use this module. +// +//***************************************************************************** + +// Precompiled header (must come first - includes project common headers) +//#include "stdafx.h" +#include "tier0/platform.h" +#include "tier1/utlvector.h" +#include "simplebitstring.h" + + + +//***************************************************************************** +// +// Class definitions: +// +//***************************************************************************** + +// +// class CSimpleBitString::iterator +// + + +//----------------------------------------------------------------------------- +// +// Function: +// +//----------------------------------------------------------------------------- +void CSimpleBitString::AppendBits( uint64 u64Data, uint32 NumSignificantLowBitsOfData ) +{ + Assert + ( + NumSignificantLowBitsOfData <= 64 + ); + + while ( NumSignificantLowBitsOfData > 0 ) + { + // Clear top bits of data + if ( NumSignificantLowBitsOfData < 64 ) + u64Data &= ( (1ULL << NumSignificantLowBitsOfData) - 1 ); // will fail for 64 bits + + uint32 Idx = m_uNumBits / 8; + uint32 NumUsedBitsInLastByte = m_uNumBits % 8; + + uint32 NumAvailableBitsInLastByte = 8 - NumUsedBitsInLastByte; + + uint32 NumBitsToPutInThisByte + = min( NumAvailableBitsInLastByte, NumSignificantLowBitsOfData ); + + uint8 BitsForThisByte + = ( u64Data >> (NumSignificantLowBitsOfData - NumBitsToPutInThisByte) ) + & ( (1ULL << NumBitsToPutInThisByte) - 1 ); + + m_vecU8[Idx] |= ( BitsForThisByte + << ( NumAvailableBitsInLastByte - NumBitsToPutInThisByte ) ); + + m_uNumBits += NumBitsToPutInThisByte; + + NumAvailableBitsInLastByte -= NumBitsToPutInThisByte; + if ( NumAvailableBitsInLastByte == 0 ) + { + m_vecU8[ m_vecU8.AddToTail() ] = 0x00; + } + + // We've used the top N bits of data + NumSignificantLowBitsOfData -= NumBitsToPutInThisByte; + } +} + + +//----------------------------------------------------------------------------- +// +// Function: +// +//----------------------------------------------------------------------------- +void CSimpleBitString::AppendBits( const uint8 * pData, uint32 NumBitsOfData ) +{ + Assert( pData ); + + uint32 NumBytes = NumBitsOfData / 8; + for ( uint32 i = 0; i < NumBytes; ++i ) + { + AppendBits( *(pData++), 8 ); + } + uint32 NumTailBits = NumBitsOfData % 8; + AppendBits( (*pData) >> (8U - NumTailBits), NumTailBits ); +} + + + +//----------------------------------------------------------------------------- +// +// Function: +// +//----------------------------------------------------------------------------- +void CSimpleBitString::ReversiblyObfusticateBitsFromStart( uint NumBits, const uint8 * pObfusticationData, size_t uSizeOfObfusticationData ) +{ + Assert( pObfusticationData ); + + if ( NumBits > m_uNumBits + || NumBits > uSizeOfObfusticationData * 8 + ) + { + //AssertMsg( false, "ReversiblyObfusticateBitsFromStart(): Bad NumBits" ); + return; // bugbug taylor bool return + } + + uint8 * pBits = & m_vecU8[0]; + + uint NumBytes = NumBits / 8; + for ( uint i = 0; i < NumBytes; ++i ) + { + *(pBits++) ^= *(pObfusticationData++); + } + uint NumTailBits = NumBits % 8; + if ( NumTailBits > 0 ) + { + *pBits ^= ( *(pObfusticationData++) & (((1U << NumTailBits) - 1) << (8U - NumTailBits) ) ); + } +} + + +//----------------------------------------------------------------------------- +// +// Function: +// +//----------------------------------------------------------------------------- +uint8 CSimpleBitString::GetByteChecksumFromStart( uint NumBits ) const +{ + if ( NumBits > m_uNumBits ) + { + //AssertMsg( false, "GenerateByteChecksumFromStart(): Bad NumBits" ); + return 0; + } + + uint8 u8Checksum = 0; + const uint8 * pBits = & m_vecU8[0]; + + uint NumBytes = NumBits / 8; + for ( uint i = 0; i < NumBytes; ++i ) + { + u8Checksum += *(pBits++); + } + uint NumTailBits = NumBits % 8; + if ( NumTailBits > 0 ) + { + u8Checksum += ( *(pBits) & (((1U << NumTailBits) - 1) << (8U - NumTailBits) ) ); + } + + return u8Checksum; +} + + + +// +// class CSimpleBitString::iterator +// +uint32 CSimpleBitString::iterator::GetNextBits( uint32 NumBitsToGet ) +{ + Assert + ( + NumBitsToGet <= 32 + ); + + return static_cast( GetNextBits64( NumBitsToGet ) ); +} + +uint64 CSimpleBitString::iterator::GetNextBits64( uint32 NumBitsToGet ) +{ + Assert + ( + NumBitsToGet <= 64 + ); + + if ( m_uNextBitIdx + NumBitsToGet > m_rSimpleBitString.m_uNumBits ) + { + //AssertMsg( false, "Not enough bits in CSimpleBitString" ); + return 0; + } + + uint64 u64Data = 0; + + while ( NumBitsToGet > 0 ) + { + uint32 Idx = m_uNextBitIdx / 8; + Assert( Idx < (uint32)m_rSimpleBitString.m_vecU8.Count() ); + + uint32 NumConsumedBitsInThisByte = m_uNextBitIdx % 8; + uint32 NumAvailableBitsInThisByte = 8 - NumConsumedBitsInThisByte; + + uint32 NumBitsToGetFromThisByte + = min( NumAvailableBitsInThisByte, NumBitsToGet ); + + uint8 BitsFromThisByte + = ( m_rSimpleBitString.m_vecU8[Idx] >> (NumAvailableBitsInThisByte - NumBitsToGetFromThisByte) ) + & ( (1UL << NumBitsToGetFromThisByte) - 1 ); + + u64Data <<= NumBitsToGetFromThisByte; + u64Data |= BitsFromThisByte; + + m_uNextBitIdx += NumBitsToGetFromThisByte; + NumBitsToGet -= NumBitsToGetFromThisByte; + } + + return u64Data; +} + diff --git a/common/simplebitstring.h b/common/simplebitstring.h new file mode 100644 index 000000000..7d42d67ce --- /dev/null +++ b/common/simplebitstring.h @@ -0,0 +1,159 @@ + +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +//***************************************************************************** +// +// Contents: +// +// CSimpleBitString +// +// Authors: +// +// Target restrictions: +// +// Tool restrictions: +// +// Things to do: +// +// +// +//***************************************************************************** + +#ifndef INCLUDED_COMMON_SIMPLEBITSTRING_H +#define INCLUDED_COMMON_SIMPLEBITSTRING_H + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + + +//***************************************************************************** +// +// Include files required by this header. +// +// Note: Do NOT place any 'using' directives or declarations in header files - +// put them at the top of the source files that require them. +// Use fully-qualified names in header files. +// +//***************************************************************************** + +// All precompiled headers (Stable.h) include this first to give use a common +// place for including order-dependent library headers (things that need to go first). + + + + + +class CSimpleBitString +{ +public: + explicit CSimpleBitString( uint32 ReserveNumBits = 0 ) + : + m_uNumBits( 0 ), + m_vecU8() + { + m_vecU8.EnsureCapacity( (ReserveNumBits / 8) + 1 ); + m_vecU8[ m_vecU8.AddToTail() ] = 0x00; // always need 1 byte + } + + void clear() + { + m_uNumBits = 0; + m_vecU8.RemoveAll(); + m_vecU8[ m_vecU8.AddToTail() ] = 0x00; // always need 1 byte + } + + void AppendBits( uint64 data, uint32 NumSignificantLowBitsOfData ); + void AppendBits( const uint8 * pData, uint32 NumBitsOfData ); + + void ReversiblyObfusticateBitsFromStart( uint32 NumBits, const uint8 * pObfusticationData, size_t uSizeOfObfusticationData ); + uint8 GetByteChecksumFromStart( uint32 NumBits ) const; + + uint GetCurrNumBits() const + { + return m_uNumBits; + } + + const uint8 * data() const + { + return & m_vecU8[0]; + } + + size_t size() const + { + return m_vecU8.Count(); + } + +private: + uint32 m_uNumBits; + CUtlVector m_vecU8; + +public: + + // Iterator class for retrieving bits + class iterator + { + public: + explicit iterator( const CSimpleBitString & bs ) + : + m_rSimpleBitString( bs ), + m_uNextBitIdx( 0 ) + { + } + + void ResetToStart() + { + m_uNextBitIdx = 0; + } + + uint32 GetNumConsumedBits() const + { + return m_uNextBitIdx; + } + + uint32 GetNumRemainingBits() const + { + return m_rSimpleBitString.m_uNumBits - m_uNextBitIdx; + } + + uint32 GetNextBits( uint32 NumBitsToGet ); + uint64 GetNextBits64( uint32 NumBitsToGet ); + + void SkipNextBits( uint32 NumBitsToSkip ) + { + if ( m_uNextBitIdx + NumBitsToSkip > m_rSimpleBitString.m_uNumBits ) + { + AssertMsg( false, "Not enough bits in CSimpleBitString" ); + NumBitsToSkip = 0; + } + + m_uNextBitIdx += NumBitsToSkip; + } + + bool operator ==( const iterator & other ) const + { + return (& m_rSimpleBitString == & other.m_rSimpleBitString) + && m_uNextBitIdx == other.m_uNextBitIdx; + } + + void DoAssertClassInvariant() const; + + private: + const CSimpleBitString & m_rSimpleBitString; //lint !e1725 reference + uint32 m_uNextBitIdx; + }; + + friend class iterator; + +}; + + + + + +#endif diff --git a/external/crypto++-5.6.3/3way.cpp b/external/crypto++-5.6.3/3way.cpp new file mode 100644 index 000000000..066ab3304 --- /dev/null +++ b/external/crypto++-5.6.3/3way.cpp @@ -0,0 +1,143 @@ +// 3way.cpp - modifed by Wei Dai from Joan Daemen's 3way.c +// The original code and all modifications are in the public domain. + +#include "pch.h" +#include "3way.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void ThreeWay_TestInstantiations() +{ + ThreeWay::Encryption x1; + ThreeWay::Decryption x2; +} +#endif + +static const word32 START_E = 0x0b0b; // round constant of first encryption round +static const word32 START_D = 0xb1b1; // round constant of first decryption round +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +static const word32 RC_MODULUS = 0x11011; +#endif + +static inline word32 reverseBits(word32 a) +{ + a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1); + a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2); + return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4); +} + +#define mu(a0, a1, a2) \ +{ \ + a1 = reverseBits(a1); \ + word32 t = reverseBits(a0); \ + a0 = reverseBits(a2); \ + a2 = t; \ +} + +#define pi_gamma_pi(a0, a1, a2) \ +{ \ + word32 b0, b2; \ + b2 = rotlFixed(a2, 1U); \ + b0 = rotlFixed(a0, 22U); \ + a0 = rotlFixed(b0 ^ (a1|(~b2)), 1U); \ + a2 = rotlFixed(b2 ^ (b0|(~a1)), 22U);\ + a1 ^= (b2|(~b0)); \ +} + +// thanks to Paulo Barreto for this optimized theta() +#define theta(a0, a1, a2) \ +{ \ + word32 b0, b1, c; \ + c = a0 ^ a1 ^ a2; \ + c = rotlFixed(c, 16U) ^ rotlFixed(c, 8U); \ + b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \ + b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \ + a0 ^= c ^ b0; \ + a1 ^= c ^ b1; \ + a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \ +} + +#define rho(a0, a1, a2) \ +{ \ + theta(a0, a1, a2); \ + pi_gamma_pi(a0, a1, a2); \ +} + +void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(length); + + m_rounds = GetRoundsAndThrowIfInvalid(params, this); + + for (unsigned int i=0; i<3; i++) + m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24); + + if (!IsForwardTransformation()) + { + theta(m_k[0], m_k[1], m_k[2]); + mu(m_k[0], m_k[1], m_k[2]); + m_k[0] = ByteReverse(m_k[0]); + m_k[1] = ByteReverse(m_k[1]); + m_k[2] = ByteReverse(m_k[2]); + } +} + +void ThreeWay::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + typedef BlockGetAndPut Block; + + word32 a0, a1, a2; + Block::Get(inBlock)(a0)(a1)(a2); + + word32 rc = START_E; + + for(unsigned i=0; i Block; + + word32 a0, a1, a2; + Block::Get(inBlock)(a0)(a1)(a2); + + word32 rc = START_D; + + mu(a0, a1, a2); + for(unsigned i=0; i, public FixedKeyLength<12>, public VariableRounds<11> +{ + static const char *StaticAlgorithmName() {return "3-Way";} +}; + +// 3-Way + +//! \class ThreeWay +//! \brief Provides 3-Way encryption and decryption +class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation +{ + //! \class Base + //! \brief Class specific implementation and overrides used to operate the cipher. + //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + + protected: + unsigned int m_rounds; + FixedSizeSecBlock m_k; + }; + + //! \class Enc + //! \brief Class specific methods used to operate the cipher in the forward direction. + //! \details Implementations and overrides in \p Enc apply to \p ENCRYPTION. + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + //! \class Dec + //! \brief Class specific methods used to operate the cipher in the reverse direction. + //! \details Implementations and overrides in \p Dec apply to \p DECRYPTION. + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef ThreeWay::Encryption ThreeWayEncryption; +typedef ThreeWay::Decryption ThreeWayDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/Doxyfile b/external/crypto++-5.6.3/Doxyfile new file mode 100644 index 000000000..dbc50acf1 --- /dev/null +++ b/external/crypto++-5.6.3/Doxyfile @@ -0,0 +1,2373 @@ +# Doxyfile 1.8.9 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# The file can be upgraded to the latest version of Doxygen with `doxygen -u

Crypto++" $(LIB_MAJOR).$(LIB_MINOR).$(LIB_REVISION) "Benchmarks

" >> benchmarks.html + echo "

Here are speed benchmarks for some commonly used cryptographic algorithms.

" >> benchmarks.html + ./cryptest.exe b 3 2.4 >> benchmarks.html + echo "" >> benchmarks.html + echo "" >> benchmarks.html + +adhoc.cpp: adhoc.cpp.proto +ifeq ($(wildcard adhoc.cpp),) + cp adhoc.cpp.proto adhoc.cpp +else + touch adhoc.cpp +endif + +# Include dependencies, if present. You must issue `make deps` to create them. +ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps) +-include GNUmakefile.deps +endif # Dependencies + +# MacPorts/GCC issue with init_priority. Apple/GCC and Fink/GCC are fine; limit to MacPorts. +# Also see http://lists.macosforge.org/pipermail/macports-users/2015-September/039223.html +ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER),11) +ifeq ($(findstring -DMACPORTS_GCC_COMPILER,$(CXXFLAGS)),) +cryptlib.o: + $(CXX) $(CXXFLAGS) -DMACPORTS_GCC_COMPILER=1 -c cryptlib.cpp +cpu.o: + $(CXX) $(CXXFLAGS) -DMACPORTS_GCC_COMPILER=1 -c cpu.cpp +endif +endif + +%.dllonly.o : %.cpp + $(CXX) $(CXXFLAGS) -DCRYPTOPP_DLL_ONLY -c $< -o $@ + +%.import.o : %.cpp + $(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@ + +%.export.o : %.cpp + $(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@ + +%.o : %.cpp + $(CXX) $(CXXFLAGS) -c $< + +# Verify the options. +start_status: + @echo $(BUILDVERSION); + @if [ "$(MAKE_DEBUG)" == "1" ]; then\ + echo ""; \ + echo ""; \ + echo "NOTE: Relevant environment variables detected.";\ + if [ "$(MAKE_DEBUG)" == "1" ]; then\ + echo " MAKE_DEBUG was found so optimizations will be reduced.";\ + echo "";\ + echo "";\ + fi;\ + fi + +end_status: + @if [ "$(MAKE_DEBUG)" == "1" ]; then\ + echo ""; \ + echo ""; \ + echo "NOTE: MAKE_DEBUG was found so a debug build was made.";\ + echo ""; \ + echo ""; \ + fi + +# Warn of potential configurations issues. They will go away after 5.6.3. +UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h) +NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h) +COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h) +.PHONY: public_service +public_service: +ifneq ($(UNALIGNED_ACCESS),0) + $(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.) +endif +ifneq ($(NO_INIT_PRIORITY),0) + $(info WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.) +endif +ifneq ($(COMPATIBILITY_562),0) + $(info WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.) +endif +ifneq ($(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),000) + $(info WARNING: You should make these changes in config.h, and not CXXFLAGS.) + $(info WARNING: You can 'mv config.recommend config.h', but it breaks versioning.) + $(info WARNING: See http://cryptopp.com/wiki/config.h for more details.) + $(info ) +endif diff --git a/external/crypto++-5.6.3/GNUmakefile-cross b/external/crypto++-5.6.3/GNUmakefile-cross new file mode 100644 index 000000000..83aebf66c --- /dev/null +++ b/external/crypto++-5.6.3/GNUmakefile-cross @@ -0,0 +1,186 @@ +CXXFLAGS ?= -DNDEBUG -g2 -Os -fPIC -pipe + +# The following options reduce code size, but breaks link or makes link very slow on some systems +# CXXFLAGS += -ffunction-sections -fdata-sections +# LDFLAGS += -Wl,--gc-sections + +ARFLAGS = -cr # ar needs the dash on OpenBSD +RANLIB ?= ranlib +CP = cp +MKDIR = mkdir +EGREP = egrep +CHMOD = chmod + +CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang") + +IS_X86=0 +IS_LINUX=0 +IS_MINGW=0 +IS_DARWIN=0 +UNAME=CrossCompile + +# Default prefix for make install +ifeq ($(PREFIX),) +PREFIX = /usr/local +endif + +# Sadly, we can't actually use GCC_PRAGMA_AWARE because of GCC bug 53431. +# Its a shame because GCC has so much to offer by the way of analysis. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 +ifneq ($(CLANG_COMPILER),0) +CXXFLAGS += -Wall +endif + +# iOS cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE. +# See http://www.cryptopp.com/wiki/iOS_(Command_Line). +ifeq ($(IS_IOS),1) + CXX = clang++ + + CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(IOS_FLAGS) + CXXFLAGS += -arch $(IOS_ARCH) -isysroot $(IOS_SYSROOT) + CXXFLAGS += -stdlib=libc++ + + AR = libtool + ARFLAGS = -static -o +endif + +# Android cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE. +# See http://www.cryptopp.com/wiki/Android_(Command_Line). +ifeq ($(IS_ANDROID),1) + # CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-android.sh' + CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ANDROID_FLAGS) + CXXFLAGS += --sysroot=$(ANDROID_SYSROOT) -I$(ANDROID_STL_INC) + LDLIBS += $(ANDROID_STL_LIB) +endif + +# ARM embedded cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE. +# See http://www.cryptopp.com/wiki/ARM_Embedded_(Command_Line) +# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal). +ifeq ($(IS_ARM_EMBEDDED),1) + # CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-embedded.sh' + CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ARM_EMBEDDED_FLAGS) + CXXFLAGS += --sysroot=$(ARM_EMBEDDED_SYSROOT) +endif + +# List cryptlib.cpp first in an attempt to tame C++ static initialization problems +SRCS := cryptlib.cpp cpu.cpp $(filter-out cryptlib.cpp cpu.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp)) + +# List of objects with crytlib.o at the first index position +OBJS := $(SRCS:.cpp=.o) + +# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?) +TESTOBJS := bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o +LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS)) + +# List cryptlib.cpp first in an attempt to tame C++ static initialization problems +DLLSRCS := cryptlib.cpp cpu.cpp algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp +DLLOBJS := $(DLLSRCS:.cpp=.export.o) + +# Import lib testing +LIBIMPORTOBJS := $(LIBOBJS:.o=.import.o) +TESTIMPORTOBJS := $(TESTOBJS:.o=.import.o) +DLLTESTOBJS := dlltest.dllonly.o + +all: cryptest.exe + +ifneq ($(IS_DARWIN),0) +static: libcryptopp.a +shared dynamic dylib: libcryptopp.dylib +else +static: libcryptopp.a +shared dynamic: libcryptopp.so +endif + +test: cryptest.exe + ./cryptest.exe v + +.PHONY: clean +clean: + -$(RM) cryptest.exe dlltest.exe libcryptopp.a libcryptopp.so libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe ct + -$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS) +ifneq ($(wildcard *.dSYM),) + -$(RM) -r cryptest.exe.dSYM dlltest.exe.dSYM +endif + +.PHONY: distclean +distclean: clean + -$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps cryptopp$(LIB_VER).diff cryptopp$(LIB_VER).zip *.o *.ii *.s + +.PHONY: install +install: + $(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin + -$(CP) *.h $(PREFIX)/include/cryptopp + -$(CHMOD) 755 $(PREFIX)/include/cryptopp + -$(CHMOD) 644 $(PREFIX)/include/cryptopp/*.h + -$(CP) libcryptopp.a $(PREFIX)/lib + -$(CHMOD) 644 $(PREFIX)/lib/libcryptopp.a + -$(CP) cryptest.exe $(PREFIX)/bin + -$(CHMOD) 755 $(PREFIX)/bin/cryptest.exe +ifneq ($(IS_DARWIN),0) + -$(CP) libcryptopp.dylib $(PREFIX)/lib + -$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.dylib +else + -$(CP) libcryptopp.so $(PREFIX)/lib + -$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.so +endif + +.PHONY: remove uninstall +remove uninstall: + -$(RM) -r $(PREFIX)/include/cryptopp + -$(RM) $(PREFIX)/lib/libcryptopp.a + -$(RM) $(PREFIX)/bin/cryptest.exe +ifneq ($(IS_DARWIN),0) + -$(RM) $(PREFIX)/lib/libcryptopp.dylib +else + -$(RM) $(PREFIX)/lib/libcryptopp.so +endif + +libcryptopp.a: public_service | $(LIBOBJS) + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ + +libcryptopp.so: public_service | $(LIBOBJS) + $(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBJS) $(LDFLAGS) $(LDLIBS) + +cryptest.exe: public_service | libcryptopp.a $(TESTOBJS) + $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS) + +adhoc.cpp: adhoc.cpp.proto +ifeq ($(wildcard adhoc.cpp),) + cp adhoc.cpp.proto adhoc.cpp +else + touch adhoc.cpp +endif + +# Include dependencies, if present. You must issue `make deps` to create them. +ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps) +-include GNUmakefile.deps +endif # Dependencies + +%.o : %.cpp + $(CXX) $(CXXFLAGS) -c $< + +GNUmakefile.deps: + $(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps + +# Warn of potential configurations issues. This will go away after 5.6.3 +UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h) +NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h) +COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h) +.PHONY: public_service +public_service: +ifneq ($(UNALIGNED_ACCESS),0) + $(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.) +endif +ifneq ($(NO_INIT_PRIORITY),0) + $(info WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.) +endif +ifneq ($(COMPATIBILITY_562),0) + $(info WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.) +endif +ifneq (x$(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),x000) + $(info WARNING: You should make these changes in config.h, and not CXXFLAGS.) + $(info WARNING: You can 'mv config.recommend config.h', but it breaks versioning.) + $(info WARNING: See http://cryptopp.com/wiki/config.h for more details.) + $(info ) +endif diff --git a/external/crypto++-5.6.3/Install.txt b/external/crypto++-5.6.3/Install.txt new file mode 100644 index 000000000..9a116b38c --- /dev/null +++ b/external/crypto++-5.6.3/Install.txt @@ -0,0 +1,169 @@ +CONTENTS OF THIS FILE +--------------------- + +* Introduction +* Building the Library +* Installing the Library +* Makefile Targets +* DataDir Patch +* Dynamic Analysis +* Acceptance Testing +* Reporting problems + +INTRODUCTION +------------ + +Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. It was written and placed in public domain by Wei Dai. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at https://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt. + +These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. On BSD you will likely have to use `gmake` to build the library. On Linux, OS X, Solaris and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions. + +Crypto++ uses a GNU makefile, which combines configuration and a non-anemic make. You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. Please pay particular attention to CRYPTOPP_NO_UNALIGNED_DATA_ACCESS in config.h. + +Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use Cmake, and does not use Boost. + + +BUILDING THE LIBRARY +-------------------- + +In general, all you should have to do is open a terminal, and then: + + make + make test + sudo make install + +The command above builds the static library and cryptest.exe program. If you want to build the shared object, then issue: + + make static dynamic cryptest.exe + +Or: + + make libcryptopp.a libcryptopp.so cryptest.exe + + +If you would like to use a different compiler, the set CXX: + + export CXX=/opt/intel/bin/icpc + make + +If you want to build using C++11, then: + + make CXXFLAGS="-std=c++11" + +Or: + + CXXFLAGS="-std=c++11" + make + +LLVM's libc++ is also supported, so you can: + + CXXFLAGS="-std=c++11 -stdlib=libc++" + make + + +INSTALLING THE LIBRARY +---------------------- + +To install the library into a user selected directory, perform: + + make install PREFIX=/usr/local + +During install, the makefile copies cryptest.exe into $PREFIX/bin, copies headers into $PREFIX/include/cryptopp, and copies libraries into $PREFIX/lib. If you only built a static or dynamic version of the library, then only one library is copied. The install recipe does not fail if the static library or shared object is not built. + +PREFIX is non-standard, but its retained for historical purposes. The makefile also responds to `prefix=`. + +There are some open issues installing the library because cryptest.exe is not sympathetic to path changes of of its test vectors and test data. See the DataDir patch below to fix it. + + +MAKEFILE TARGETS +---------------- + +The following are some of the targets provided by the GNU makefile. + +`make` invokes the default rule, which builds the Crypto++ static library and test harness. They are called `libcryptopp.a` and `cryptest.exe`, respectively. `cryptest.exe` links against `libcryptopp.a`, so the static library is a prerequisite for the target. + +`make libcryptopp.a` and `make static` build the static version of the library. + +`make libcryptopp.so` and `make dynamic` build the dynamic version of the library. On Mac OS X, the recipe builds `libcryptopp.dylib` instead. + +`make cryptest.exe` builds the library test harness. + +`make test` and `make check` are the same recipe and invoke the test harness with the the validation option. That is, it executes `cryptest.exe v`. + +`make install` installs the library. By default, the makefile copies into `/usr`. On OpenBSD, `make install` uses `/usr/local` by default because C++ headers should not be placed with the system headers. + +`make clean` cleans most transient and temporary objects. + +`make disclean` cleans most objects that are not part of the original distribution. + +`make dist` and `make zip` build s ZIP file that is suitable for distribution. + + +DATADIR PATCH +------------- + +The library offers a DataDir patch to help with post-installation issues regarding the location of the test vectors and test data. Its a patch provided by the community, so it must be applied manually. To acquire the patch, see http://www.cryptopp.com/wiki/DataDir. + + +DYNAMIC ANALYSIS +---------------- + +The Crypto++ embraces tools like Undefined Behavior sanitizer (UBsan), Address sanitizer (Asan) and Valgrind. Both Clang 3.2 and above and GCC 4.8 and above provide sanitizers. Please check with your distribution on how to install the compiler with its sanitizer libraries (they are sometimes a separate install item). + +UBsan and Asan are mutually exclusive options, so you can perform only one of these at a time: + + make ubsan + ./cryptest.exe v 2>&1 | egrep "(error|FAILED)" + ./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)" + +Or: + + make asan + ./cryptest.exe v 2>&1 | egrep "(error|FAILED)" + ./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)" + +If you experience self test failures or see reports of undefined behavior, then you should ensure CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is defined in config.h. CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined due to historical purposes. + +If you experience failures under Asan, then gather more information with: + + ./cryptest.exe v 2>&1 | asan_symbolize + +If you moved Crypto++ such that the paths have changed, then perform: + + ./cryptest.exe v 2>&1 | sed "s///g" | asan_symbolize + + +ACCEPTANCE TESTING +------------------ + +Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture. + +The first gate is code review and discussion of proposed patches. Git commits often cross reference a User Group discussions. + +Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves. + +Third, the code must pass cleanly though GCC and Clang's Undefined Behavior sanitizer (UBsan) and Address sanitizer (Asan) with CRYPTOPP_NO_UNALIGNED_DATA_ACCESS defined in config.h. See DYNAMIC ANALYSIS above on how to execute them. + +Fourth, the test harness provides a "validation" option which performs basic system checks (like endianess and word sizes) and exercises algorithms (like AES and SHA). You run the validation suite as shown below. The tail of the output should indicate 0 failed tests. + + ./cryptest.exe v + ... + + All tests passed! + Test ended at Sun Jul 26 02:10:57 2015 + Seed used was: 1437891055 + +Fifth, the test harness provides a "test vector" option which uses many known test vectors, even those published by other people (like Brian Gladman for AES). You run the test vectors as shown below. The tail of the output should indicate 0 failed tests. + + ./cryptest.exe tv all + ... + + Testing SymmetricCipher algorithm MARS/ECB. + ................. + Tests complete. Total tests = 4094. Failed tests = 0. + +REPORTING PROBLEMS +------------------ + +Dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at https://groups.google.com/forum/#!forum/cryptopp-users. + +Also see http://www.cryptopp.com/wiki/Bug_Report. diff --git a/external/crypto++-5.6.3/License.txt b/external/crypto++-5.6.3/License.txt new file mode 100644 index 000000000..c5d3f34b1 --- /dev/null +++ b/external/crypto++-5.6.3/License.txt @@ -0,0 +1,51 @@ +Compilation Copyright (c) 1995-2013 by Wei Dai. All rights reserved. +This copyright applies only to this software distribution package +as a compilation, and does not imply a copyright on any particular +file in the package. + +All individual files in this compilation are placed in the public domain by +Wei Dai and other contributors. + +I would like to thank the following authors for placing their works into +the public domain: + +Joan Daemen - 3way.cpp +Leonard Janke - cast.cpp, seal.cpp +Steve Reid - cast.cpp +Phil Karn - des.cpp +Andrew M. Kuchling - md2.cpp, md4.cpp +Colin Plumb - md5.cpp +Seal Woods - rc6.cpp +Chris Morgan - rijndael.cpp +Paulo Baretto - rijndael.cpp, skipjack.cpp, square.cpp +Richard De Moliner - safer.cpp +Matthew Skala - twofish.cpp +Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp +Ronny Van Keer - sha3.cpp + +The Crypto++ Library (as a compilation) is currently licensed under the Boost +Software License 1.0 (http://www.boost.org/users/license.html). + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/external/crypto++-5.6.3/Readme.txt b/external/crypto++-5.6.3/Readme.txt new file mode 100644 index 000000000..f76d282cc --- /dev/null +++ b/external/crypto++-5.6.3/Readme.txt @@ -0,0 +1,499 @@ +Crypto++: a C++ Class Library of Cryptographic Schemes +Version 5.6.3 - NOV/20/2015 + +Crypto++ Library is a free C++ class library of cryptographic schemes. +Currently the library contains the following algorithms: + + algorithm type name + + authenticated encryption schemes GCM, CCM, EAX + + high speed stream ciphers Panama, Sosemanuk, Salsa20, XSalsa20 + + AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent, + CAST-256 + + IDEA, Triple-DES (DES-EDE2 and DES-EDE3), + other block ciphers Camellia, SEED, RC5, Blowfish, TEA, XTEA, + Skipjack, SHACAL-2 + + block cipher modes of operation ECB, CBC, CBC ciphertext stealing (CTS), + CFB, OFB, counter mode (CTR) + + message authentication codes VMAC, HMAC, GMAC, CMAC, CBC-MAC, DMAC, + Two-Track-MAC + + SHA-1, SHA-2 (SHA-224, SHA-256, SHA-384, and + hash functions SHA-512), SHA-3, Tiger, WHIRLPOOL, RIPEMD-128, + RIPEMD-256, RIPEMD-160, RIPEMD-320 + + RSA, DSA, ElGamal, Nyberg-Rueppel (NR), + public-key cryptography Rabin-Williams (RW), LUC, LUCELG, + DLIES (variants of DHAES), ESIGN + + padding schemes for public-key PKCS#1 v2.0, OAEP, PSS, PSSR, IEEE P1363 + systems EMSA2 and EMSA5 + + Diffie-Hellman (DH), Unified Diffie-Hellman + key agreement schemes (DH2), Menezes-Qu-Vanstone (MQV), LUCDIF, + XTR-DH + + elliptic curve cryptography ECDSA, ECNR, ECIES, ECDH, ECMQV + + insecure or obsolescent MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL +algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2, + compatibility and historical SAFER, 3-WAY, GOST, SHARK, CAST-128, Square + value + +Other features include: + + * pseudo random number generators (PRNG): ANSI X9.17 appendix C, RandomPool + * password based key derivation functions: PBKDF1 and PBKDF2 from PKCS #5, + PBKDF from PKCS #12 appendix B + * Shamir's secret sharing scheme and Rabin's information dispersal algorithm + (IDA) + * fast multi-precision integer (bignum) and polynomial operations + * finite field arithmetics, including GF(p) and GF(2^n) + * prime number generation and verification + * useful non-cryptographic algorithms + + DEFLATE (RFC 1951) compression/decompression with gzip (RFC 1952) and + zlib (RFC 1950) format support + + hex, base-32, and base-64 coding/decoding + + 32-bit CRC and Adler32 checksum + * class wrappers for these operating system features (optional): + + high resolution timers on Windows, Unix, and Mac OS + + Berkeley and Windows style sockets + + Windows named pipes + + /dev/random, /dev/urandom, /dev/srandom + + Microsoft's CryptGenRandom on Windows + * A high level interface for most of the above, using a filter/pipeline + metaphor + * benchmarks and validation testing + * x86, x86-64 (x64), MMX, and SSE2 assembly code for the most commonly used + algorithms, with run-time CPU feature detection and code selection + * some versions are available in FIPS 140-2 validated form + +You are welcome to use it for any purpose without paying me, but see +License.txt for the fine print. + +The following compilers are supported for this release. Please visit +http://www.cryptopp.com the most up to date build instructions and porting notes. + + * MSVC 6.0 - 2015 + * GCC 3.3 - 5.2 + * C++Builder 2010 + * Intel C++ Compiler 9 - 16.0 + * Sun Studio 12u1, Express 11/08, Express 06/10 + +*** Important Usage Notes *** + +1. If a constructor for A takes a pointer to an object B (except primitive +types such as int and char), then A owns B and will delete B at A's +destruction. If a constructor for A takes a reference to an object B, +then the caller retains ownership of B and should not destroy it until +A no longer needs it. + +2. Crypto++ is thread safe at the class level. This means you can use +Crypto++ safely in a multithreaded application, but you must provide +synchronization when multiple threads access a common Crypto++ object. + +*** MSVC-Specific Information *** + +On Windows, Crypto++ can be compiled into 3 forms: a static library +including all algorithms, a DLL with only FIPS Approved algorithms, and +a static library with only algorithms not in the DLL. +(FIPS Approved means Approved according to the FIPS 140-2 standard.) +The DLL may be used by itself, or it may be used together with the second +form of the static library. MSVC project files are included to build +all three forms, and sample applications using each of the three forms +are also included. + +To compile Crypto++ with MSVC, open the "cryptest.dsw" (for MSVC 6 and MSVC .NET +2003) or "cryptest.sln" (for MSVC 2005 - 2010) workspace file and build one or +more of the following projects: + +cryptopp - This builds the DLL. Please note that if you wish to use Crypto++ + as a FIPS validated module, you must use a pre-built DLL that has undergone + the FIPS validation process instead of building your own. +dlltest - This builds a sample application that only uses the DLL. +cryptest Non-DLL-Import Configuration - This builds the full static library + along with a full test driver. +cryptest DLL-Import Configuration - This builds a static library containing + only algorithms not in the DLL, along with a full test driver that uses + both the DLL and the static library. + +To use the Crypto++ DLL in your application, #include "dll.h" before including +any other Crypto++ header files, and place the DLL in the same directory as +your .exe file. dll.h includes the line #pragma comment(lib, "cryptopp") +so you don't have to explicitly list the import library in your project +settings. To use a static library form of Crypto++, make the "cryptlib" +project a dependency of your application project, or specify it as +an additional library to link with in your project settings. +In either case you should check the compiler options to +make sure that the library and your application are using the same C++ +run-time libraries and calling conventions. + +*** DLL Memory Management *** + +Because it's possible for the Crypto++ DLL to delete objects allocated +by the calling application, they must use the same C++ memory heap. Three +methods are provided to achieve this. +1. The calling application can tell Crypto++ what heap to use. This method + is required when the calling application uses a non-standard heap. +2. Crypto++ can tell the calling application what heap to use. This method + is required when the calling application uses a statically linked C++ Run + Time Library. (Method 1 does not work in this case because the Crypto++ DLL + is initialized before the calling application's heap is initialized.) +3. Crypto++ can automatically use the heap provided by the calling application's + dynamically linked C++ Run Time Library. The calling application must + make sure that the dynamically linked C++ Run Time Library is initialized + before Crypto++ is loaded. (At this time it is not clear if it is possible + to control the order in which DLLs are initialized on Windows 9x machines, + so it might be best to avoid using this method.) + +When Crypto++ attaches to a new process, it searches all modules loaded +into the process space for exported functions "GetNewAndDeleteForCryptoPP" +and "SetNewAndDeleteFromCryptoPP". If one of these functions is found, +Crypto++ uses methods 1 or 2, respectively, by calling the function. +Otherwise, method 3 is used. + +*** GCC-Specific Information *** + +A makefile is included for you to compile Crypto++ with GCC. Make sure +you are using GNU Make and GNU ld. The make process will produce two files, +libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the validation +suite. + +*** Documentation and Support *** + +Crypto++ is documented through inline comments in header files, which are +processed through Doxygen to produce an HTML reference manual. You can find +a link to the manual from http://www.cryptopp.com. Also at that site is +the Crypto++ FAQ, which you should browse through before attempting to +use this library, because it will likely answer many of questions that +may come up. + +If you run into any problems, please try the Crypto++ mailing list. +The subscription information and the list archive are available on +http://www.cryptopp.com. You can also email me directly by visiting +http://www.weidai.com, but you will probably get a faster response through +the mailing list. + +*** History *** + +1.0 - First public release. Withdrawn at the request of RSA DSI. + - included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA, + MD5, RC4, RC5, RSA, SHA, WAKE, secret sharing, DEFLATE compression + - had a serious bug in the RSA key generation code. + +1.1 - Removed RSA, RC4, RC5 + - Disabled calls to RSAREF's non-public functions + - Minor bugs fixed + +2.0 - a completely new, faster multiprecision integer class + - added MD5-MAC, HAVAL, 3-WAY, TEA, SAFER, LUC, Rabin, BlumGoldwasser, + elliptic curve algorithms + - added the Lucas strong probable primality test + - ElGamal encryption and signature schemes modified to avoid weaknesses + - Diamond changed to Diamond2 because of key schedule weakness + - fixed bug in WAKE key setup + - SHS class renamed to SHA + - lots of miscellaneous optimizations + +2.1 - added Tiger, HMAC, GOST, RIPE-MD160, LUCELG, LUCDIF, XOR-MAC, + OAEP, PSSR, SHARK + - added precomputation to DH, ElGamal, DSA, and elliptic curve algorithms + - added back RC5 and a new RSA + - optimizations in elliptic curves over GF(p) + - changed Rabin to use OAEP and PSSR + - changed many classes to allow copy constructors to work correctly + - improved exception generation and handling + +2.2 - added SEAL, CAST-128, Square + - fixed bug in HAVAL (padding problem) + - fixed bug in triple-DES (decryption order was reversed) + - fixed bug in RC5 (couldn't handle key length not a multiple of 4) + - changed HMAC to conform to RFC-2104 (which is not compatible + with the original HMAC) + - changed secret sharing and information dispersal to use GF(2^32) + instead of GF(65521) + - removed zero knowledge prover/verifier for graph isomorphism + - removed several utility classes in favor of the C++ standard library + +2.3 - ported to EGCS + - fixed incomplete workaround of min/max conflict in MSVC + +3.0 - placed all names into the "CryptoPP" namespace + - added MD2, RC2, RC6, MARS, RW, DH2, MQV, ECDHC, CBC-CTS + - added abstract base classes PK_SimpleKeyAgreementDomain and + PK_AuthenticatedKeyAgreementDomain + - changed DH and LUCDIF to implement the PK_SimpleKeyAgreementDomain + interface and to perform domain parameter and key validation + - changed interfaces of PK_Signer and PK_Verifier to sign and verify + messages instead of message digests + - changed OAEP to conform to PKCS#1 v2.0 + - changed benchmark code to produce HTML tables as output + - changed PSSR to track IEEE P1363a + - renamed ElGamalSignature to NR and changed it to track IEEE P1363 + - renamed ECKEP to ECMQVC and changed it to track IEEE P1363 + - renamed several other classes for clarity + - removed support for calling RSAREF + - removed option to compile old SHA (SHA-0) + - removed option not to throw exceptions + +3.1 - added ARC4, Rijndael, Twofish, Serpent, CBC-MAC, DMAC + - added interface for querying supported key lengths of symmetric ciphers + and MACs + - added sample code for RSA signature and verification + - changed CBC-CTS to be compatible with RFC 2040 + - updated SEAL to version 3.0 of the cipher specification + - optimized multiprecision squaring and elliptic curves over GF(p) + - fixed bug in MARS key setup + - fixed bug with attaching objects to Deflator + +3.2 - added DES-XEX3, ECDSA, DefaultEncryptorWithMAC + - renamed DES-EDE to DES-EDE2 and TripleDES to DES-EDE3 + - optimized ARC4 + - generalized DSA to allow keys longer than 1024 bits + - fixed bugs in GF2N and ModularArithmetic that can cause calculation errors + - fixed crashing bug in Inflator when given invalid inputs + - fixed endian bug in Serpent + - fixed padding bug in Tiger + +4.0 - added Skipjack, CAST-256, Panama, SHA-2 (SHA-256, SHA-384, and SHA-512), + and XTR-DH + - added a faster variant of Rabin's Information Dispersal Algorithm (IDA) + - added class wrappers for these operating system features: + - high resolution timers on Windows, Unix, and MacOS + - Berkeley and Windows style sockets + - Windows named pipes + - /dev/random and /dev/urandom on Linux and FreeBSD + - Microsoft's CryptGenRandom on Windows + - added support for SEC 1 elliptic curve key format and compressed points + - added support for X.509 public key format (subjectPublicKeyInfo) for + RSA, DSA, and elliptic curve schemes + - added support for DER and OpenPGP signature format for DSA + - added support for ZLIB compressed data format (RFC 1950) + - changed elliptic curve encryption to use ECIES (as defined in SEC 1) + - changed MARS key schedule to reflect the latest specification + - changed BufferedTransformation interface to support multiple channels + and messages + - changed CAST and SHA-1 implementations to use public domain source code + - fixed bug in StringSource + - optmized multi-precision integer code for better performance + +4.1 - added more support for the recommended elliptic curve parameters in SEC 2 + - added Panama MAC, MARC4 + - added IV stealing feature to CTS mode + - added support for PKCS #8 private key format for RSA, DSA, and elliptic + curve schemes + - changed Deflate, MD5, Rijndael, and Twofish to use public domain code + - fixed a bug with flushing compressed streams + - fixed a bug with decompressing stored blocks + - fixed a bug with EC point decompression using non-trinomial basis + - fixed a bug in NetworkSource::GeneralPump() + - fixed a performance issue with EC over GF(p) decryption + - fixed syntax to allow GCC to compile without -fpermissive + - relaxed some restrictions in the license + +4.2 - added support for longer HMAC keys + - added MD4 (which is not secure so use for compatibility purposes only) + - added compatibility fixes/workarounds for STLport 4.5, GCC 3.0.2, + and MSVC 7.0 + - changed MD2 to use public domain code + - fixed a bug with decompressing multiple messages with the same object + - fixed a bug in CBC-MAC with MACing multiple messages with the same object + - fixed a bug in RC5 and RC6 with zero-length keys + - fixed a bug in Adler32 where incorrect checksum may be generated + +5.0 - added ESIGN, DLIES, WAKE-OFB, PBKDF1 and PBKDF2 from PKCS #5 + - added key validation for encryption and signature public/private keys + - renamed StreamCipher interface to SymmetricCipher, which is now implemented + by both stream ciphers and block cipher modes including ECB and CBC + - added keying interfaces to support resetting of keys and IVs without + having to destroy and recreate objects + - changed filter interface to support non-blocking input/output + - changed SocketSource and SocketSink to use overlapped I/O on Microsoft Windows + - grouped related classes inside structs to help templates, for example + AESEncryption and AESDecryption are now AES::Encryption and AES::Decryption + - where possible, typedefs have been added to improve backwards + compatibility when the CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY macro is defined + - changed Serpent, HAVAL and IDEA to use public domain code + - implemented SSE2 optimizations for Integer operations + - fixed a bug in HMAC::TruncatedFinal() + - fixed SKIPJACK byte ordering following NIST clarification dated 5/9/02 + +5.01 - added known answer test for X9.17 RNG in FIPS 140 power-up self test + - submitted to NIST/CSE, but not publicly released + +5.02 - changed EDC test to MAC integrity check using HMAC/SHA1 + - improved performance of integrity check + - added blinding to defend against RSA timing attack + +5.03 - created DLL version of Crypto++ for FIPS 140-2 validation + - fixed vulnerabilities in GetNextIV for CTR and OFB modes + +5.0.4 - Removed DES, SHA-256, SHA-384, SHA-512 from DLL + +5.1 - added PSS padding and changed PSSR to track IEEE P1363a draft standard + - added blinding for RSA and Rabin to defend against timing attacks + on decryption operations + - changed signing and decryption APIs to support the above + - changed WaitObjectContainer to allow waiting for more than 64 + objects at a time on Win32 platforms + - fixed a bug in CBC and ECB modes with processing non-aligned data + - fixed standard conformance bugs in DLIES (DHAES mode) and RW/EMSA2 + signature scheme (these fixes are not backwards compatible) + - fixed a number of compiler warnings, minor bugs, and portability problems + - removed Sapphire + +5.2 - merged in changes for 5.01 - 5.0.4 + - added support for using encoding parameters and key derivation parameters + with public key encryption (implemented by OAEP and DL/ECIES) + - added Camellia, SHACAL-2, Two-Track-MAC, Whirlpool, RIPEMD-320, + RIPEMD-128, RIPEMD-256, Base-32 coding, FIPS variant of CFB mode + - added ThreadUserTimer for timing thread CPU usage + - added option for password-based key derivation functions + to iterate until a mimimum elapsed thread CPU time is reached + - added option (on by default) for DEFLATE compression to detect + uncompressible files and process them more quickly + - improved compatibility and performance on 64-bit platforms, + including Alpha, IA-64, x86-64, PPC64, Sparc64, and MIPS64 + - fixed ONE_AND_ZEROS_PADDING to use 0x80 instead 0x01 as padding. + - fixed encoding/decoding of PKCS #8 privateKeyInfo to properly + handle optional attributes + +5.2.1 - fixed bug in the "dlltest" DLL testing program + - fixed compiling with STLport using VC .NET + - fixed compiling with -fPIC using GCC + - fixed compiling with -msse2 on systems without memalign() + - fixed inability to instantiate PanamaMAC + - fixed problems with inline documentation + +5.2.2 - added SHA-224 + - put SHA-256, SHA-384, SHA-512, RSASSA-PSS into DLL + +5.2.3 - fixed issues with FIPS algorithm test vectors + - put RSASSA-ISO into DLL + +5.3 - ported to MSVC 2005 with support for x86-64 + - added defense against AES timing attacks, and more AES test vectors + - changed StaticAlgorithmName() of Rijndael to "AES", CTR to "CTR" + +5.4 - added Salsa20 + - updated Whirlpool to version 3.0 + - ported to GCC 4.1, Sun C++ 5.8, and Borland C++Builder 2006 + +5.5 - added VMAC and Sosemanuk (with x86-64 and SSE2 assembly) + - improved speed of integer arithmetic, AES, SHA-512, Tiger, Salsa20, + Whirlpool, and PANAMA cipher using assembly (x86-64, MMX, SSE2) + - optimized Camellia and added defense against timing attacks + - updated benchmarks code to show cycles per byte and to time key/IV setup + - started using OpenMP for increased multi-core speed + - enabled GCC optimization flags by default in GNUmakefile + - added blinding and computational error checking for RW signing + - changed RandomPool, X917RNG, GetNextIV, DSA/NR/ECDSA/ECNR to reduce + the risk of reusing random numbers and IVs after virtual machine state + rollback + - changed default FIPS mode RNG from AutoSeededX917RNG to + AutoSeededX917RNG + - fixed PANAMA cipher interface to accept 256-bit key and 256-bit IV + - moved MD2, MD4, MD5, PanamaHash, ARC4, WAKE_CFB into the namespace "Weak" + - removed HAVAL, MD5-MAC, XMAC + +5.5.1 - fixed VMAC validation failure on 32-bit big-endian machines + +5.5.2 - ported x64 assembly language code for AES, Salsa20, Sosemanuk, and Panama + to MSVC 2005 (using MASM since MSVC doesn't support inline assembly on x64) + - fixed Salsa20 initialization crash on non-SSE2 machines + - fixed Whirlpool crash on Pentium 2 machines + - fixed possible branch prediction analysis (BPA) vulnerability in + MontgomeryReduce(), which may affect security of RSA, RW, LUC + - fixed link error with MSVC 2003 when using "debug DLL" form of runtime library + - fixed crash in SSE2_Add on P4 machines when compiled with + MSVC 6.0 SP5 with Processor Pack + - ported to MSVC 2008, GCC 4.2, Sun CC 5.9, Intel C++ Compiler 10.0, + and Borland C++Builder 2007 + +5.6.0 - added AuthenticatedSymmetricCipher interface class and Filter wrappers + - added CCM, GCM (with SSE2 assembly), EAX, CMAC, XSalsa20, and SEED + - added support for variable length IVs + - added OIDs for Brainpool elliptic curve parameters + - improved AES and SHA-256 speed on x86 and x64 + - changed BlockTransformation interface to no longer assume data alignment + - fixed incorrect VMAC computation on message lengths + that are >64 mod 128 (x86 assembly version is not affected) + - fixed compiler error in vmac.cpp on x86 with GCC -fPIC + - fixed run-time validation error on x86-64 with GCC 4.3.2 -O2 + - fixed HashFilter bug when putMessage=true + - fixed AES-CTR data alignment bug that causes incorrect encryption on ARM + - removed WORD64_AVAILABLE; compiler support for 64-bit int is now required + - ported to GCC 4.3, C++Builder 2009, Sun CC 5.10, Intel C++ Compiler 11 + +5.6.1 - added support for AES-NI and CLMUL instruction sets in AES and GMAC/GCM + - removed WAKE-CFB + - fixed several bugs in the SHA-256 x86/x64 assembly code: + * incorrect hash on non-SSE2 x86 machines on non-aligned input + * incorrect hash on x86 machines when input crosses 0x80000000 + * incorrect hash on x64 when compiled with GCC with optimizations enabled + - fixed bugs in AES x86 and x64 assembly causing crashes in some MSVC build configurations + - switched to a public domain implementation of MARS + - ported to MSVC 2010, GCC 4.5.1, Sun Studio 12u1, C++Builder 2010, Intel C++ Compiler 11.1 + - renamed the MSVC DLL project to "cryptopp" for compatibility with MSVC 2010 + +5.6.2 - changed license to Boost Software License 1.0 + - added SHA-3 (Keccak) + - updated DSA to FIPS 186-3 (see DSA2 class) + - fixed Blowfish minimum keylength to be 4 bytes (32 bits) + - fixed Salsa validation failure when compiling with GCC 4.6 + - fixed infinite recursion when on x64, assembly disabled, and no AESNI + - ported to MSVC 2012, GCC 4.7, Clang 3.2, Solaris Studio 12.3, Intel C++ Compiler 13.0 + +5.6.3 - maintenance release, honored API/ABI/Versioning requirements + - expanded processes to include community and its input + - fixed CVE-2015-2141 + - cleared most Undefined Behavior Sanitizer (UBsan) findings + - cleared all Address Sanitizer (Asan) findings + - cleared all Valgrind findings + - cleared all Coverity findings + - cleared all Enterprise Analysis (/analyze) findings + - cleared most GCC warnings with -Wall + - cleared most Clang warnings with -Wall + - cleared most MSVC warnings with /W4 + - added -fPIC 64-bit builds. Off by default for i386 + - added HKDF class from RFC 5868 + - switched to member_ptr due to C++ 11 warnings for auto_ptr + - initialization of C++ static objects, off by default + * GCC and init_priotirty/constructor attributes + * MSVC and init_seg(lib) + * CRYPTOPP_INIT_PRIORITY disabled by default, but available + - improved OS X support + - improved GNUmakefile support for Testing and QA + - added self tests for additional Testing and QA + - added cryptest.sh for systematic Testing and QA + - added GNU Gold linker support + - added Visual Studio 2010 solution and project files in vs2010.zip + - added Clang integrated assembler support + - unconditionally define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS for Makefile + target 'ubsan' and at -O3 due to GCC vectorization on x86 and x86_64 + - workaround ARMEL/GCC 5.2 bug and failed self test + - fixed crash in MQV due to GCC 4.9+ and inlining + - fixed hang in SHA due to GCC 4.9+ and inlining + - fixed missing rdtables::Te under VS with ALIGNED_DATA_ACCESS + - fixed S/390 and big endian feature detection + - fixed S/390 and int128_t/uint128_t detection + - fixed X32 (ILP32) feature detection + - removed _CRT_SECURE_NO_DEPRECATE for Microsoft platforms + - utilized bound checking interfaces from ISO/IEC TR 24772 when available + - improved ARM, ARM64, MIPS, MIPS64, S/390 and X32 (ILP32) support + - introduced CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + - added additional Doxygen-based documentation + - ported to MSVC 2015, Xcode 7.2, GCC 5.2, Clang 3.7, Intel C++ 16.00 + +5.7 - nearly identical to 5.6.3 + - minor breaks to the ABI and API + - cleared remaining Undefined Behavior Sanitizer (UBsan) findings + - cleared remaining GCC and Visual Studio warnings + - removed CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + +Written by Wei Dai and the Crypto++ Project diff --git a/external/crypto++-5.6.3/TestData/3desval.dat b/external/crypto++-5.6.3/TestData/3desval.dat new file mode 100644 index 000000000..1d5883ed8 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/3desval.dat @@ -0,0 +1,3 @@ +0123456789abcdeffedcba9876543210 0123456789abcde7 7f1d0a77826b8aff +0123456789abcdeffedcba987654321089abcdef01234567 0123456789abcde7 de0b7c06ae5e0ed5 +0123456789ABCDEF01010101010101011011121314151617 94DBE082549A14EF 9011121314151617 diff --git a/external/crypto++-5.6.3/TestData/3wayval.dat b/external/crypto++-5.6.3/TestData/3wayval.dat new file mode 100644 index 000000000..51bb6c164 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/3wayval.dat @@ -0,0 +1,5 @@ +000000000000000000000000 000000010000000100000001 4059c76e83ae9dc4ad21ecf7 +000000060000000500000004 000000030000000200000001 d2f05b5ed6144138cab920cd +def01234456789abbcdef012 234567899abcdef001234567 0aa55dbb9cdddb6d7cdb76b2 +d2f05b5ed6144138cab920cd 4059c76e83ae9dc4ad21ecf7 478ea8716b13f17c15b155ed + diff --git a/external/crypto++-5.6.3/TestData/camellia.dat b/external/crypto++-5.6.3/TestData/camellia.dat new file mode 100644 index 000000000..c4fcc1259 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/camellia.dat @@ -0,0 +1,45 @@ +0123456789ABCDEFFEDCBA9876543210 0123456789ABCDEFFEDCBA9876543210 67673138549669730857065648EABE43 +80000000000000000000000000000000 00000000000000000000000000000000 6C227F749319A3AA7DA235A9BBA05A2C +00000000000000000000000000000001 00000000000000000000000000000000 41E0E6DC2DDEC65D8B8120E60977B82D +00000000000000000000000000000000 80000000000000000000000000000000 07923A39EB0A817D1C4D87BDB82D1F1C +00000000000000000000000000000000 00000000000000000000000000000001 F5574ACC3148DFCB9015200631024DF9 +00000000000000000000000000000000 00000000000000000000000000000000 3D028025B156327C17F762C1F2CBCA71 +01010101010101010101010101010101 01010101010101010101010101010101 637084CB1120D6F25DB618893040AA27 +02020202020202020202020202020202 02020202020202020202020202020202 612834AAC9EF906BAEAA076E1C75179D +04040404040404040404040404040404 04040404040404040404040404040404 B24FAF8A579E4EFE986571FB2F68B5B4 +08080808080808080808080808080808 08080808080808080808080808080808 3E5CAFBB70545AABB1109293A1C44C14 +10101010101010101010101010101010 10101010101010101010101010101010 E1FA5FD3F40B766BBE3DF469AF41B420 +20202020202020202020202020202020 20202020202020202020202020202020 7E724027BB2F591C63254D936FCC4B43 +40404040404040404040404040404040 40404040404040404040404040404040 538ADCBE104A3483B3C2A3D8CE72FBD6 +80808080808080808080808080808080 80808080808080808080808080808080 AA7627F70F6B54C217C3EF232D362459 +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 25DD9EB9DD67FBC6E8431F56F4FBE651 +0123456789ABCDEFFEDCBA98765432100011223344556677 0123456789ABCDEFFEDCBA9876543210 B4993401B3E996F84EE5CEE7D79B09B9 +800000000000000000000000000000000000000000000000 00000000000000000000000000000000 1B6220D365C2176C1D41A5826520FCA1 +000000000000000000000000000000000000000000000001 00000000000000000000000000000000 E37577F71E0E643C4D3F55219ABA1394 +000000000000000000000000000000000000000000000000 80000000000000000000000000000000 3EB6CC5618EFC98455B5992050D474E7 +000000000000000000000000000000000000000000000000 00000000000000000000000000000001 BA9AE89FDDCE4B51131E17C4D65CE587 +000000000000000000000000000000000000000000000000 00000000000000000000000000000000 56E1E129CA5C02C7F9AC6AFDEF86ADC3 +010101010101010101010101010101010101010101010101 01010101010101010101010101010101 8F764397C10BE84BA876CEEFA4225BFF +020202020202020202020202020202020202020202020202 02020202020202020202020202020202 60B00674BFD444D07B5A19851E6151CD +040404040404040404040404040404040404040404040404 04040404040404040404040404040404 81B26FF4F6B4377CC555873504B3A38B +080808080808080808080808080808080808080808080808 08080808080808080808080808080808 A2AA1C6693DC2B70D75C9B39B9B214D0 +101010101010101010101010101010101010101010101010 10101010101010101010101010101010 A907BFDAEEF8C81D05855235E8D3BE08 +202020202020202020202020202020202020202020202020 20202020202020202020202020202020 87F8EA30332036F17CEAC0097CE33BC1 +404040404040404040404040404040404040404040404040 40404040404040404040404040404040 A2C32EA499E41A248565253BACC11E3B +808080808080808080808080808080808080808080808080 80808080808080808080808080808080 F602BA7F515B082983B8F7A27F92408F +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3F8D5676F51CE23DC3BDB627F8B3883E +0123456789ABCDEFFEDCBA987654321000112233445566778899AABBCCDDEEFF 0123456789ABCDEFFEDCBA9876543210 9ACC237DFF16D76C20EF7C919E3A7509 +8000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 2136FABDA091DFB5171B94B8EFBB5D08 +0000000000000000000000000000000000000000000000000000000000000001 00000000000000000000000000000000 AFCD38B195E0A736304E89B9AE3019D3 +0000000000000000000000000000000000000000000000000000000000000000 80000000000000000000000000000000 B0C6B88AEA518AB09E847248E91B1B9D +0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000001 9CDB269B5D293BC5DB9C55B057D9B591 +0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 396154111ADEFC500CF6E5C99038BC17 +0101010101010101010101010101010101010101010101010101010101010101 01010101010101010101010101010101 438D0C2E7E86869B56EBA23B66086A01 +0202020202020202020202020202020202020202020202020202020202020202 02020202020202020202020202020202 D4F553BFA794F55EF3B7A578629F6DEA +0404040404040404040404040404040404040404040404040404040404040404 04040404040404040404040404040404 5E858730ABC9823A93CA4CAB67F0B423 +0808080808080808080808080808080808080808080808080808080808080808 08080808080808080808080808080808 F9A9C1540AE1B314DBEDF9A49054DC9D +1010101010101010101010101010101010101010101010101010101010101010 10101010101010101010101010101010 6693FC130669F194F81E8D175194DDA2 +2020202020202020202020202020202020202020202020202020202020202020 20202020202020202020202020202020 F3E1FDA6B9C8314799F4654C29F1C690 +4040404040404040404040404040404040404040404040404040404040404040 40404040404040404040404040404040 4A30476F1141FBF303ED63FCD3CB0536 +8080808080808080808080808080808080808080808080808080808080808080 80808080808080808080808080808080 0C765AA494E048FC8BB23139F2124CB6 +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 4F05F28CA23EEAE205B67B1C95CD5280 diff --git a/external/crypto++-5.6.3/TestData/cast128v.dat b/external/crypto++-5.6.3/TestData/cast128v.dat new file mode 100644 index 000000000..4445305b1 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/cast128v.dat @@ -0,0 +1,11 @@ +01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A +01 23 45 67 89 AB CD EF +23 8B 4F E5 84 7E 44 B2 + +01 23 45 67 12 34 56 78 23 45 +01 23 45 67 89 AB CD EF +EB 6A 71 1A 2C 02 27 1B + +01 23 45 67 12 +01 23 45 67 89 AB CD EF +7A C8 16 D1 6E 9B 30 2E diff --git a/external/crypto++-5.6.3/TestData/cast256v.dat b/external/crypto++-5.6.3/TestData/cast256v.dat new file mode 100644 index 000000000..65a15dc26 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/cast256v.dat @@ -0,0 +1,11 @@ +2342bb9efa38542c0af75647f29f615d +00000000000000000000000000000000 +c842a08972b43d20836c91d1b7530f6b + +2342bb9efa38542cbed0ac83940ac298bac77a7717942863 +00000000000000000000000000000000 +1b386c0210dcadcbdd0e41aa08a7a7e8 + +2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604 +00000000000000000000000000000000 +4f6a2038286897b9c9870136553317fa diff --git a/external/crypto++-5.6.3/TestData/descert.dat b/external/crypto++-5.6.3/TestData/descert.dat new file mode 100644 index 000000000..5d3ddc7d3 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/descert.dat @@ -0,0 +1,171 @@ +0101010101010101 95F8A5E5DD31D900 8000000000000000 +0101010101010101 DD7F121CA5015619 4000000000000000 +0101010101010101 2E8653104F3834EA 2000000000000000 +0101010101010101 4BD388FF6CD81D4F 1000000000000000 +0101010101010101 20B9E767B2FB1456 0800000000000000 +0101010101010101 55579380D77138EF 0400000000000000 +0101010101010101 6CC5DEFAAF04512F 0200000000000000 +0101010101010101 0D9F279BA5D87260 0100000000000000 +0101010101010101 D9031B0271BD5A0A 0080000000000000 +0101010101010101 424250B37C3DD951 0040000000000000 +0101010101010101 B8061B7ECD9A21E5 0020000000000000 +0101010101010101 F15D0F286B65BD28 0010000000000000 +0101010101010101 ADD0CC8D6E5DEBA1 0008000000000000 +0101010101010101 E6D5F82752AD63D1 0004000000000000 +0101010101010101 ECBFE3BD3F591A5E 0002000000000000 +0101010101010101 F356834379D165CD 0001000000000000 +0101010101010101 2B9F982F20037FA9 0000800000000000 +0101010101010101 889DE068A16F0BE6 0000400000000000 +0101010101010101 E19E275D846A1298 0000200000000000 +0101010101010101 329A8ED523D71AEC 0000100000000000 +0101010101010101 E7FCE22557D23C97 0000080000000000 +0101010101010101 12A9F5817FF2D65D 0000040000000000 +0101010101010101 A484C3AD38DC9C19 0000020000000000 +0101010101010101 FBE00A8A1EF8AD72 0000010000000000 +0101010101010101 750D079407521363 0000008000000000 +0101010101010101 64FEED9C724C2FAF 0000004000000000 +0101010101010101 F02B263B328E2B60 0000002000000000 +0101010101010101 9D64555A9A10B852 0000001000000000 +0101010101010101 D106FF0BED5255D7 0000000800000000 +0101010101010101 E1652C6B138C64A5 0000000400000000 +0101010101010101 E428581186EC8F46 0000000200000000 +0101010101010101 AEB5F5EDE22D1A36 0000000100000000 +0101010101010101 E943D7568AEC0C5C 0000000080000000 +0101010101010101 DF98C8276F54B04B 0000000040000000 +0101010101010101 B160E4680F6C696F 0000000020000000 +0101010101010101 FA0752B07D9C4AB8 0000000010000000 +0101010101010101 CA3A2B036DBC8502 0000000008000000 +0101010101010101 5E0905517BB59BCF 0000000004000000 +0101010101010101 814EEB3B91D90726 0000000002000000 +0101010101010101 4D49DB1532919C9F 0000000001000000 +0101010101010101 25EB5FC3F8CF0621 0000000000800000 +0101010101010101 AB6A20C0620D1C6F 0000000000400000 +0101010101010101 79E90DBC98F92CCA 0000000000200000 +0101010101010101 866ECEDD8072BB0E 0000000000100000 +0101010101010101 8B54536F2F3E64A8 0000000000080000 +0101010101010101 EA51D3975595B86B 0000000000040000 +0101010101010101 CAFFC6AC4542DE31 0000000000020000 +0101010101010101 8DD45A2DDF90796C 0000000000010000 +0101010101010101 1029D55E880EC2D0 0000000000008000 +0101010101010101 5D86CB23639DBEA9 0000000000004000 +0101010101010101 1D1CA853AE7C0C5F 0000000000002000 +0101010101010101 CE332329248F3228 0000000000001000 +0101010101010101 8405D1ABE24FB942 0000000000000800 +0101010101010101 E643D78090CA4207 0000000000000400 +0101010101010101 48221B9937748A23 0000000000000200 +0101010101010101 DD7C0BBD61FAFD54 0000000000000100 +0101010101010101 2FBC291A570DB5C4 0000000000000080 +0101010101010101 E07C30D7E4E26E12 0000000000000040 +0101010101010101 0953E2258E8E90A1 0000000000000020 +0101010101010101 5B711BC4CEEBF2EE 0000000000000010 +0101010101010101 CC083F1E6D9E85F6 0000000000000008 +0101010101010101 D2FD8867D50D2DFE 0000000000000004 +0101010101010101 06E7EA22CE92708F 0000000000000002 +0101010101010101 166B40B44ABA4BD6 0000000000000001 +8001010101010101 0000000000000000 95A8D72813DAA94D +4001010101010101 0000000000000000 0EEC1487DD8C26D5 +2001010101010101 0000000000000000 7AD16FFB79C45926 +1001010101010101 0000000000000000 D3746294CA6A6CF3 +0801010101010101 0000000000000000 809F5F873C1FD761 +0401010101010101 0000000000000000 C02FAFFEC989D1FC +0201010101010101 0000000000000000 4615AA1D33E72F10 +0180010101010101 0000000000000000 2055123350C00858 +0140010101010101 0000000000000000 DF3B99D6577397C8 +0120010101010101 0000000000000000 31FE17369B5288C9 +0110010101010101 0000000000000000 DFDD3CC64DAE1642 +0108010101010101 0000000000000000 178C83CE2B399D94 +0104010101010101 0000000000000000 50F636324A9B7F80 +0102010101010101 0000000000000000 A8468EE3BC18F06D +0101800101010101 0000000000000000 A2DC9E92FD3CDE92 +0101400101010101 0000000000000000 CAC09F797D031287 +0101200101010101 0000000000000000 90BA680B22AEB525 +0101100101010101 0000000000000000 CE7A24F350E280B6 +0101080101010101 0000000000000000 882BFF0AA01A0B87 +0101040101010101 0000000000000000 25610288924511C2 +0101020101010101 0000000000000000 C71516C29C75D170 +0101018001010101 0000000000000000 5199C29A52C9F059 +0101014001010101 0000000000000000 C22F0A294A71F29F +0101012001010101 0000000000000000 EE371483714C02EA +0101011001010101 0000000000000000 A81FBD448F9E522F +0101010801010101 0000000000000000 4F644C92E192DFED +0101010401010101 0000000000000000 1AFA9A66A6DF92AE +0101010201010101 0000000000000000 B3C1CC715CB879D8 +0101010180010101 0000000000000000 19D032E64AB0BD8B +0101010140010101 0000000000000000 3CFAA7A7DC8720DC +0101010120010101 0000000000000000 B7265F7F447AC6F3 +0101010110010101 0000000000000000 9DB73B3C0D163F54 +0101010108010101 0000000000000000 8181B65BABF4A975 +0101010104010101 0000000000000000 93C9B64042EAA240 +0101010102010101 0000000000000000 5570530829705592 +0101010101800101 0000000000000000 8638809E878787A0 +0101010101400101 0000000000000000 41B9A79AF79AC208 +0101010101200101 0000000000000000 7A9BE42F2009A892 +0101010101100101 0000000000000000 29038D56BA6D2745 +0101010101080101 0000000000000000 5495C6ABF1E5DF51 +0101010101040101 0000000000000000 AE13DBD561488933 +0101010101020101 0000000000000000 024D1FFA8904E389 +0101010101018001 0000000000000000 D1399712F99BF02E +0101010101014001 0000000000000000 14C1D7C1CFFEC79E +0101010101012001 0000000000000000 1DE5279DAE3BED6F +0101010101011001 0000000000000000 E941A33F85501303 +0101010101010801 0000000000000000 DA99DBBC9A03F379 +0101010101010401 0000000000000000 B7FC92F91D8E92E9 +0101010101010201 0000000000000000 AE8E5CAA3CA04E85 +0101010101010180 0000000000000000 9CC62DF43B6EED74 +0101010101010140 0000000000000000 D863DBB5C59A91A0 +0101010101010120 0000000000000000 A1AB2190545B91D7 +0101010101010110 0000000000000000 0875041E64C570F7 +0101010101010108 0000000000000000 5A594528BEBEF1CC +0101010101010104 0000000000000000 FCDB3291DE21F0C0 +0101010101010102 0000000000000000 869EFD7F9F265A09 +1046913489980131 0000000000000000 88D55E54F54C97B4 +1007103489988020 0000000000000000 0C0CC00C83EA48FD +10071034C8980120 0000000000000000 83BC8EF3A6570183 +1046103489988020 0000000000000000 DF725DCAD94EA2E9 +1086911519190101 0000000000000000 E652B53B550BE8B0 +1086911519580101 0000000000000000 AF527120C485CBB0 +5107B01519580101 0000000000000000 0F04CE393DB926D5 +1007B01519190101 0000000000000000 C9F00FFC74079067 +3107915498080101 0000000000000000 7CFD82A593252B4E +3107919498080101 0000000000000000 CB49A2F9E91363E3 +10079115B9080140 0000000000000000 00B588BE70D23F56 +3107911598090140 0000000000000000 406A9A6AB43399AE +1007D01589980101 0000000000000000 6CB773611DCA9ADA +9107911589980101 0000000000000000 67FD21C17DBB5D70 +9107D01589190101 0000000000000000 9592CB4110430787 +1007D01598980120 0000000000000000 A6B7FF68A318DDD3 +1007940498190101 0000000000000000 4D102196C914CA16 +0107910491190401 0000000000000000 2DFA9F4573594965 +0107910491190101 0000000000000000 B46604816C0E0774 +0107940491190401 0000000000000000 6E7E6221A4F34E87 +19079210981A0101 0000000000000000 AA85E74643233199 +1007911998190801 0000000000000000 2E5A19DB4D1962D6 +10079119981A0801 0000000000000000 23A866A809D30894 +1007921098190101 0000000000000000 D812D961F017D320 +100791159819010B 0000000000000000 055605816E58608F +1004801598190101 0000000000000000 ABD88E8B1B7716F1 +1004801598190102 0000000000000000 537AC95BE69DA1E1 +1004801598190108 0000000000000000 AED0F6AE3C25CDD8 +1002911598100104 0000000000000000 B3E35A5EE53E7B8D +1002911598190104 0000000000000000 61C79C71921A2EF8 +1002911598100201 0000000000000000 E2F5728F0995013C +1002911698100101 0000000000000000 1AEAC39A61F0A464 +7CA110454A1A6E57 01A1D6D039776742 690F5B0D9A26939B +0131D9619DC1376E 5CD54CA83DEF57DA 7A389D10354BD271 +07A1133E4A0B2686 0248D43806F67172 868EBB51CAB4599A +3849674C2602319E 51454B582DDF440A 7178876E01F19B2A +04B915BA43FEB5B6 42FD443059577FA2 AF37FB421F8C4095 +0113B970FD34F2CE 059B5E0851CF143A 86A560F10EC6D85B +0170F175468FB5E6 0756D8E0774761D2 0CD3DA020021DC09 +43297FAD38E373FE 762514B829BF486A EA676B2CB7DB2B7A +07A7137045DA2A16 3BDD119049372802 DFD64A815CAF1A0F +04689104C2FD3B2F 26955F6835AF609A 5C513C9C4886C088 +37D06BB516CB7546 164D5E404F275232 0A2AEEAE3FF4AB77 +1F08260D1AC2465E 6B056E18759F5CCA EF1BF03E5DFA575A +584023641ABA6176 004BD6EF09176062 88BF0DB6D70DEE56 +025816164629B007 480D39006EE762F2 A1F9915541020B56 +49793EBC79B3258F 437540C8698F3CFA 6FBF1CAFCFFD0556 +4FB05E1515AB73A7 072D43A077075292 2F22E49BAB7CA1AC +49E95D6D4CA229BF 02FE55778117F12A 5A6B612CC26CCE4A +018310DC409B26D6 1D9D5C5018F728C2 5F4C038ED12B2E41 +1C587F1C13924FEF 305532286D6F295A 63FAC0D034D9F793 diff --git a/external/crypto++-5.6.3/TestData/dh1024.dat b/external/crypto++-5.6.3/TestData/dh1024.dat new file mode 100644 index 000000000..86a955182 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dh1024.dat @@ -0,0 +1 @@ +30818702818100DA9A18547FF03B385CC16508C173A7EF4EB61CB40EF8FEF3B31F145051676166BCDC3FE6B799FC394D08C26385F9413F896E09117E46209D6923602683CEA100924A6EE695281775C619DAA94EA8CB3691B4275B0183F1D39639EBC92995FE645D6C1BC28D409E585549BBD2C5DCDD6C208B04EADD8B7A6D997F72CBAD88390F020102 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dh2048.dat b/external/crypto++-5.6.3/TestData/dh2048.dat new file mode 100644 index 000000000..bd5255fa0 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dh2048.dat @@ -0,0 +1 @@ +308201080282010100EB60DBD494AAFBCD2EAC6A36DB8E7DD4A2A64512A5BBB15B9BFB581C7C1CAFB647D4612973C3770C2166D75EEA695F67EA8261557591DB78BCF5A886AA5294F3AEE4D25B57C8EE8C7FE8DBF70C132CD7FFCB6F89426F807F552C5DAE2FB1F329E340094E4B30D8EF6265AB4D350E9837B151C86AC524DE4E1FC04746C668BE318275E420D51AEDDFBDF887D435CDEEF6AC81293DB45287132F8236A43AD8F4D6642D7CA6732DA06A1DE008259008C9D74403B68ADAC788CF8AB5BEFFC310DCCCD32901D1F290E5B7A993D2CF6A652AF81B6DA0FD2E70678D1AE086150E41444522F20621195AD2A1F0975652B4AF7DE5261A9FD46B9EA8B443641F3BBA695B9B020103 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dlie1024.dat b/external/crypto++-5.6.3/TestData/dlie1024.dat new file mode 100644 index 000000000..892128b31 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dlie1024.dat @@ -0,0 +1 @@ +308201370201003082011706072A8648CE3804013082010A02818100D4EC6B7A18416519C76766726B3D2D5F054D107B30E97691B15EB0DCDF452B77F10E12C14450AB107BE349C2DF3A2DBD9D844A24ABA21B328D568E8EC6B959E70BADE5C49879AE4447F643360523469B55AFDC459B45634F657AA79918772F2BA9508ACD43C95C16650A1251B8173EBA1B9B59FE8C57F6240EA49A4FE8855CEF0281806A7635BD0C20B28CE3B3B339359E96AF82A6883D9874BB48D8AF586E6FA295BBF8870960A22855883DF1A4E16F9D16DECEC2251255D10D9946AB4747635CACF385D6F2E24C3CD72223FB219B0291A34DAAD7EE22CDA2B1A7B2BD53CC8C3B9795D4A84566A1E4AE0B32850928DC0B9F5D0DCDACFF462BFB1207524D27F442AE77020102041702150C9C14EEFA749DCE9A2A4B7065768767BA48BBB62F \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dlie2048.dat b/external/crypto++-5.6.3/TestData/dlie2048.dat new file mode 100644 index 000000000..06351c7a8 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dlie2048.dat @@ -0,0 +1 @@ +308202410201003082021906072A8648CE3804013082020C0282010100A8E87254E7F56CB5857786364ACC39F2A0F79FFF8ED6C62C64EE45FC1C775CDDBFD9CBCEF8262DBD2CECE4E5AFECA239B9B4B7D3CBA228366500F5B2203CA6C0CB0AB6698F73921B4831BA598DFA8268A07368A64774C77808AB7CB7978F839304B10567F8C9C34F8DBDB66BB928EDE6327773AA6C20A8F4E9C2AE0C66A0516E057BBC87760CF39270726F1863260CD5ADDAF366318E7029851A6F85B2349DF29629319A3662354DBCAD0789D02AC6BD804C06523900166501041963BD7EFFE0069694A54F4542172A29B1F09D26E3F052AE5274A898058BE549650BC2066DDFDB84D582E6503AF42BCB2B674F2A2A77C54678FD622FFCA2D9718BF8B0525AEF028201005474392A73FAB65AC2BBC31B25661CF9507BCFFFC76B6316327722FE0E3BAE6EDFECE5E77C1316DE96767272D7F6511CDCDA5BE9E5D1141B32807AD9101E536065855B34C7B9C90DA418DD2CC6FD41345039B45323BA63BC0455BE5BCBC7C1C9825882B3FC64E1A7C6DEDB35DC9476F3193BB9D53610547A74E15706335028B702BDDE43BB0679C93839378C3193066AD6ED79B318C73814C28D37C2D91A4EF94B1498CD1B311AA6DE5683C4E815635EC02603291C800B3280820CB1DEBF7FF0034B4A52A7A2A10B9514D8F84E9371F82957293A544C02C5F2A4B285E10336EFEDC26AC173281D7A15E595B3A795153BE2A33C7EB117FE516CB8C5FC58292D77020102041F021D031D7EC405D3E11D031B7B66DF9EFFCC5173B9B1639E4EC920731484EE \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dsa1024.dat b/external/crypto++-5.6.3/TestData/dsa1024.dat new file mode 100644 index 000000000..8e5912027 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dsa1024.dat @@ -0,0 +1 @@ +3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dsa1024b.dat b/external/crypto++-5.6.3/TestData/dsa1024b.dat new file mode 100644 index 000000000..edfb808a0 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dsa1024b.dat @@ -0,0 +1 @@ +308201B73082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0381850002818100D30312B7179661DA4691EDE39A71CB961199CD792C50AED6EA7E1A24C53590B6BCD92F26509D3372B2849A17C99C0962FBE4A2606CA37E6DF10244805363450FFAA24A7C274DF0B5D24AE7F31A8319FD2AA6E98AC6E7E3364E7AEDE575A9993609B0DFA387084141EA0B5B2D59B6DE718C0DAB4F86BC59F0DBE8602AED933494 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dsa512.dat b/external/crypto++-5.6.3/TestData/dsa512.dat new file mode 100644 index 000000000..0d63cfdb6 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/dsa512.dat @@ -0,0 +1 @@ +3081C60201003081A806072A8648CE38040130819C0241008DF2A494492276AA3D25759BB06869CBEAC0D83AFB8D0CF7CBB8324F0D7882E5D0762FC5B7210EAFC2E9ADAC32AB7AAC49693DFBF83724C2EC0736EE31C80291021500C773218C737EC8EE993B4F2DED30F48EDACE915F0240626D027839EA0A13413163A55B4CB500299D5522956CEFCB3BFF10F399CE2C2E71CB9DE5FA24BABF58E5B79521925C9CC42E9F6F464B088CC572AF53E6D78802041602142070B3223DBA372FDE1C0FFC7B2E3B498B260614 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/elgc1024.dat b/external/crypto++-5.6.3/TestData/elgc1024.dat new file mode 100644 index 000000000..37518b6fb --- /dev/null +++ b/external/crypto++-5.6.3/TestData/elgc1024.dat @@ -0,0 +1 @@ +3082018E028181008B333697371663F8869E3EC80A414E46BBAFE41F6D40E754A01ADA60FE7D12ACD16DE311C4115293114F6B92A54195909276380F04BCD4ED5CD993ED7F516DF7A752B928E5035E0D3A1A979A1CDE8387734338793C02001D59B662D4FC8F2BF0EABB1F553F9F46F57E74BCABCBA4E458812DB601FCD04609D435317181236B9702010202818038FBC56751763146BC107ECC59E9BAD3852EBC38799B41B40EF5745810BCF9DCC6D569B7E61063EA358B0DF2A194910029B72A9CFD11AD240681D3F976EDCB18D79C0530AB2944DC1E314C2B520BE23066C802754C19BF2EC15DE0439E2663383CEA5163DC857B6A5F91079F54FB47C9B33F23A9EB6B3FCBA8581524B3EC5C75028181008B333697371663F8869E3EC80A414E46BBAFE41F6D40E754A01ADA60FE7D12ACD16DE311C4115293114F6B92A54195909276380F04BCD4ED5CD993ED7F516DF7A752B928E5035E0D3A1A979A1CDE8387734338793C02001D59B662D4FC8F2BF0EABB1F553F9F46F57E74BC7F3EC6725F2FC0A6155ADCA43CEE7319E623824852 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/esig1023.dat b/external/crypto++-5.6.3/TestData/esig1023.dat new file mode 100644 index 000000000..4e43ad462 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/esig1023.dat @@ -0,0 +1 @@ +3081E00281807040653BA4FCD5C66E3318B31E82654C5A62957F68D2EE6AE10BD6678D7A14EEF8EBF0C85F28FE22056C12B2A2DD4E9C897EB2FF06D57DB03B872C049ED2806DC3E4D86F2947D134065AC642F233F95FBCB55C533274FA91FFDC0CEB9E71B8795B71A977C7956001FC19E28DE18A80B20E4AE8F775B952CEEA0DEFEAE8E93D7F020120022B1EC74E9FC5EEA090E8DDF4BDB64861C7DC3F8EC7E64286EC2FE39DA55B4763C582DB48146521BDEF0146D5022B1E559EB15755298408E4E4C6F4791BF075C7A8C9B3C7F5B7FA3E8C322BA0A160C09A9DB6BBC4974BE0F877 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/esig1536.dat b/external/crypto++-5.6.3/TestData/esig1536.dat new file mode 100644 index 000000000..8e10d134c --- /dev/null +++ b/external/crypto++-5.6.3/TestData/esig1536.dat @@ -0,0 +1 @@ +3082014D0281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD52D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D64CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D4116CE5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1F93193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB020120024100FAF0F292EE96D4F449024F86C0A104E0633C722586EC00AD33E0234629825D2081BA337597889CAC55DC6BEBDD8F13FE3AA2133D6371601A37D195DA7BC45EF3024100EBE16F88887A425AA08E271467CC2220DC44012AB24ED4FF3512A96E8CB600C8BBCB771459FF0EE63D4B6786952A83A7143A775073F0A1D69B6D0B5817755673 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/esig2046.dat b/external/crypto++-5.6.3/TestData/esig2046.dat new file mode 100644 index 000000000..1c318540a --- /dev/null +++ b/external/crypto++-5.6.3/TestData/esig2046.dat @@ -0,0 +1 @@ +308201B70282010028B1F9CDF87EF6D74F3AC2EA83C17CE376215FB2B3B4817145F1A137FB86B0F7BF0F9BA1BDCF7CC15DF1884DD1B150A983279B90F7A1E4392CB3C16390771DA5668E68621C3898DF66BD254F3787ECFB64B3435E707D5C237A6C09F407D8CD618CC3BBFBAB3DEBA38A0D1A88B2A4E09AE32FF2064EF1896348D5B83047EC2E079D85662EED4A66FBB9C159A617EE3C333BAED66989740F54C3CB336C0EF71130786E70648F2698F4F4192DA06C1578FDB065F8E320EFB63049E4BA664F215924B3E89F69131C5987F357C54593BE173A7AED2D37BE69F90CB574EF83AD49145EB15950FADE9E848DA83BC2CACBEDCAFC4A3B31BFFBBFC4DD03B8E47A218A51410201200256033F9C3F8BDDC021503A687BEC90438F38FF9C0E4C050DD95E46BACA370F478B843611A94BC37B5E838AABFD4ECCCE757BAC967DF8A7DD219B3A71A4DA64D54AB367622B7EB9B4282E898755F02036E91D2A12C81F41025603DB3DE2AE2B52889148C98D68F2B7606B0E5112E60E6A6FF5FD98E5D74143C000B43BEC77082F17C1EF4C82127010B12438D498AAFE8521E21EE6391627D464B54D1BE31F57FFF18C27EC38F08093EA65139A61A2C1 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/gostval.dat b/external/crypto++-5.6.3/TestData/gostval.dat new file mode 100644 index 000000000..f89c98bde --- /dev/null +++ b/external/crypto++-5.6.3/TestData/gostval.dat @@ -0,0 +1,23 @@ +BE5EC2006CFF9DCF52354959F1FF0CBFE95061B5A648C10387069C25997C0672 +0DF82802B741A292 07F9027DF7F7DF89 + +B385272AC8D72A5A8B344BC80363AC4D09BF58F41F540624CBCB8FDCF55307D7 +1354EE9C0A11CD4C 4FB50536F960A7B1 + +AEE02F609A35660E4097E546FD3026B032CD107C7D459977ADF489BEF2652262 +6693D492C4B0CC39 670034AC0FA811B5 + +320E9D8422165D58911DFC7D8BBB1F81B0ECD924023BF94D9DF7DCF7801240E0 +99E2D13080928D79 8118FF9D3B3CFE7D + +C9F703BBBFC63691BFA3B7B87EA8FD5E8E8EF384EF733F1A61AEF68C8FFA265F +D1E787749C72814C A083826A790D3E0C + +728FEE32F04B4C654AD7F607D71C660C2C2670D7C999713233149A1C0C17A1F0 +D4C05323A4F7A7B5 4D1F2E6B0D9DE2CE + +35FC96402209500FCFDEF5352D1ABB038FE33FC0D9D58512E56370B22BAA133B +8742D9A05F6A3AF6 2F3BB84879D11E52 + +D416F630BE65B7FE150656183370E07018234EE5DA3D89C4CE9152A03E5BFB77 +F86506DA04E41CB8 96F0A5C77A04F5CE diff --git a/external/crypto++-5.6.3/TestData/ideaval.dat b/external/crypto++-5.6.3/TestData/ideaval.dat new file mode 100644 index 000000000..f7cd6fe11 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/ideaval.dat @@ -0,0 +1,11 @@ +00010002000300040005000600070008 0000000100020003 11FBED2B01986DE5 +00010002000300040005000600070008 0102030405060708 540E5FEA18C2F8B1 +00010002000300040005000600070008 0019324B647D96AF 9F0A0AB6E10CED78 +00010002000300040005000600070008 F5202D5B9C671B08 CF18FD7355E2C5C5 +00010002000300040005000600070008 FAE6D2BEAA96826E 85DF52005608193D +00010002000300040005000600070008 0A141E28323C4650 2F7DE750212FB734 +00010002000300040005000600070008 050A0F14191E2328 7B7314925DE59C09 +0005000A000F00140019001E00230028 0102030405060708 3EC04780BEFF6E20 +3A984E2000195DB32EE501C8C47CEA60 0102030405060708 97BCD8200780DA86 +006400C8012C019001F4025802BC0320 05320A6414C819FA 65BE87E7A2538AED +9D4075C103BC322AFB03E7BE6AB30006 0808080808080808 F5DB1AC45E5EF9F9 diff --git a/external/crypto++-5.6.3/TestData/luc1024.dat b/external/crypto++-5.6.3/TestData/luc1024.dat new file mode 100644 index 000000000..f81dea0c6 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/luc1024.dat @@ -0,0 +1 @@ +3082015202010002818100B7FE59813AF3A5DA48144EF03E5D229E3CFB55B0E3CEB63F9F973AC8655651409C3B36BBBE83698516F42A2E0FDC87DD83541697249D67FB5A91FA73470089C4997667811283CF22C74856F1E71129DB70FB23620A60E532B7931B7F93C0B9AA6B9D60E87529002BF2204B743773F501F6C370D067C7B22F6AD9DC07E8097347020111024100CFEA6177386C04D1668C984C39A7F889B36BB2B3BED2C7B83241D267F8D2038529AEB56D82CDE43264168873375C8D1F0897666CCC3F617C2F6B52E5143303C7024100E28BAB645993166EE1A984967AE8839EA41685F1E6392DBEB83EE6CA85A54396505DBD4E5C9024BAFCF27AD24D571DC6A3795CE7F0432669BCE742AF8FAF1481024078C6F402C266595B4F85098370528C2C0309BE93F6C45FC049F6AD987471A979FE215CC41455AA85F5A5B664F59E2F8E33C97C211698D14AD05FC65044F99510 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/luc2048.dat b/external/crypto++-5.6.3/TestData/luc2048.dat new file mode 100644 index 000000000..a4b3cefb8 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/luc2048.dat @@ -0,0 +1 @@ +308202960201000282010100EF8E1C8C8FB330A26C2449F1A50F7BD457D131C66D3194ECA20CE06138CC95CBE32E1DF910E13FF2D74823363286E3461E4BA3037EA32D4728F262C2364692E5948B8577F651292D72EF42445C2AAF11A526D2235DCE172A6E762EB86178BB5B4A06B8736567DB1525C8BDEB7242C81CC9090F5EF7CFC193FABEA3E5B5407E7DFDDF2D557487C65302148969F28DEC68AC3166FD52D44F1DE2EA74451A4BA0508F09E2F4AB85D89E7D68EEE4E8F9BD5A4858BAE8BF36E3A31FF06DDECDD40AE70932ECD09B65617B3208FF203EFBB0D822CDC1887EF343EBECBB762FA9C5D9F9339C80C96D6F3D8E4F7298FF6C94581C3CBC21C8CA94015F2E48400C0556B70502011102818100FDAD5D856662FC0284BEEF8470DC328B3B853F5819F037EBC786EB0225FD5C45B5BF99073F6E6CE31E4D1BC31105A4BAABA3BEC3C28F40E5912E7D3D6E6BE6178164E52F615C65FED1AE61D9D8F858282AF3C59C25A650A9CA72DD2105D95219CFEFEDDEB067647FDBABB659FBF2FF82F33C1A3A8BA73FB5F3D0C5509DFD38FF02818100F1BFA4A7A9506E020F9A57019F4326AE3D974DE9CCEF9BCA284B313DE287378411BDF1C9A1859D9165604EFF2EB1C9A685C0B317A08CF50E5F45AF570EE2C79B35BEA60B38109B4A450E87811CB10D6873F50726248055FE645C5C74FD0482F22CB541D77ED93F8B44CA72C9F550331C516BD061816325F9EF543C4995832BFB0281805184D4DC8796329003CF0EDC79048A12C4C78A1F44D8DE37A5939776A4E19CAA1ADBC4B78BE72EF23F1A5EFFF7377439138ED19D166285D1325CE6C2A7CFA182BDD7B82B2AB63A041C80B17A4D78161C240EDB2D6A494BEB27D28168E02DAE83C50C01EE8384E31111B756DA9B5423A6817F9078E8A750D0DE2CE62CF223601D \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucc1024.dat b/external/crypto++-5.6.3/TestData/lucc1024.dat new file mode 100644 index 000000000..4366892c1 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/lucc1024.dat @@ -0,0 +1 @@ +3082013F0201003082011706072A8648CE3804013082010A02818100E16B572E39DB4D90689753D09CEA97B9CAE9C0AF04203AE5BC7FC985B85D5BB50B1EDEA30CAAD003B455640FEEA79E342F3E8CFF6761051B38D6931A2B0FD0DF8E2210E7DA74CAC5DC1A79D80CD8C0F9FC09D81BAEC94E2F3663F25B0140DF6B3D5AD04CBA27BCF24A92963319FB992E39544370FD28642FE07EB17EDA4D47B902818070B5AB971CEDA6C8344BA9E84E754BDCE574E05782101D72DE3FE4C2DC2EADDA858F6F5186556801DA2AB207F753CF1A179F467FB3B0828D9C6B498D1587E86FC7110873ED3A6562EE0D3CEC066C607CFE04EC0DD764A7179B31F92D80A06FB59EAD68265D13DE7925494B198CFDCC971CAA21B87E943217F03F58BF6D26A3DD020107041F021D03BDAFBB087B5A628730212217B01F15B303A0133D6AF4FC3CAF7286A8 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucc512.dat b/external/crypto++-5.6.3/TestData/lucc512.dat new file mode 100644 index 000000000..9c2cf1aba --- /dev/null +++ b/external/crypto++-5.6.3/TestData/lucc512.dat @@ -0,0 +1 @@ +3081B302010030819406072A8648CE380401308188024100B89A4AD4826B8FDDBFE3A6C0F5C8F805B7093AFF9BB2BD697C7D113C236BAC99ABF69000E169575CA2A2DDCDD1C7D9D06C63DCCC880121D933DCF598DD85C52102405C4D256A4135C7EEDFF1D3607AE47C02DB849D7FCDD95EB4BE3E889E11B5D64CD5FB480070B4ABAE51516EE6E8E3ECE83631EE66440090EC99EE7ACC6EC2E291020107041702150268EA4C567B18D0E35B1DA9D517CE5D359CD06779 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucd1024.dat b/external/crypto++-5.6.3/TestData/lucd1024.dat new file mode 100644 index 000000000..7c2c79f74 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/lucd1024.dat @@ -0,0 +1,4 @@ +30818702818100EE9C91E2C1D8B0AB999B3F32B3115A36AA95A36B23CC8507D2340FA21EAAF6F6EB +1B900839CD9F8AFBFC155467F91FD8917DD46EAC55A266B246DFFFEDDDA79D674F77884D34709DB3 +452C2C1E2578CCC0CCA91C504039C52762F23F2A391A58B2CAD2DB05666DDF5B9E3C1AC33DB487B7 +70C82B7E7DCDEE4381562FCEE427FD02010A diff --git a/external/crypto++-5.6.3/TestData/lucd512.dat b/external/crypto++-5.6.3/TestData/lucd512.dat new file mode 100644 index 000000000..9c97005b1 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/lucd512.dat @@ -0,0 +1,2 @@ +3046024100C339D027E5812ED5D9DE044F3697D0273625E5EA9EC4EF3FB89ADBFA9CD1FBF4D8C0EC +1118C44609F499EF644EEAECE2F38B3F67FAC81A075F31A60B5757A87D020109 diff --git a/external/crypto++-5.6.3/TestData/lucs1024.dat b/external/crypto++-5.6.3/TestData/lucs1024.dat new file mode 100644 index 000000000..13931998c --- /dev/null +++ b/external/crypto++-5.6.3/TestData/lucs1024.dat @@ -0,0 +1 @@ +3082015B0201003082013306072A8648CE3804013082012602818100D57B7B758DC8041CE6CFC57DFE0AAA33FC8FEC48BEEA37562AD13359236FFFF6EED3CEB3A7BBC4269A384ED9A296160F12BC666066548E28201CE293B1791F951C8D2C5965696D82B336EFADCF1E0D619EDA43DBB86415BF3EE6F721C0AB17E770EA7B2360A054D3E4E878647245FCF87B2335098303004CDDC2B9DCDA57DB51021D034E48F160EC5855CCCD9F995988AD1B554AD1B591E64283E91A07D151028180017324ADC1F93CF002FA2B0619C60F897CDED488E457685625E1565377483C0FA4A7FD1CAE848C727E76654434CE3CCAF81EC6E6AAA156EEBBEA095F642FD0DA2D043996ACC14A1B1A6110B19C094638E29890B89AF5812E97C5F96F33B1FD7415079947994442295CA34447807662FB70621F069A98AE274D01B2777BF4E97E041F021D00F9F02A2BC1930F1AC93198F3D532BC937941D7C9A1E16F0EB932476E \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucs512.dat b/external/crypto++-5.6.3/TestData/lucs512.dat new file mode 100644 index 000000000..f8fd288b0 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/lucs512.dat @@ -0,0 +1 @@ +3081C70201003081A806072A8648CE38040130819C024100E64283E91A07D10F557B7B758DC8041CE6CFC57DFE0AAA33FC8FEC48BEEA37562AD13359236FFFF6EED3FB921690D2FD1339F8E1DD406EED70D7EE3085E3AADD02150F4E48F160EC5855CCCD9F995988AD1B554AD1B5F3024062503DFB092F0FD0D8BBD90B50A834A6BD5B0995BCFC1CC8C8C83103AA6837F3FBFF3E042E1B25E36963DB2FCFD7AD24A6626E65A1F6EECBB399F5CE73659F29041702150450A037413E9A711E601318AF21D32A498C0C501E \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/marsval.dat b/external/crypto++-5.6.3/TestData/marsval.dat new file mode 100644 index 000000000..661872fc3 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/marsval.dat @@ -0,0 +1,9 @@ +00000000000000000000000000000000 00000000000000000000000000000000 DCC07B8DFB0738D6E30A22DFCF27E886 +00000000000000000000000000000000 DCC07B8DFB0738D6E30A22DFCF27E886 33CAFFBDDC7F1DDA0F9C15FA2F30E2FF +CB14A1776ABBC1CDAFE7243DEF2CEA02 F94512A9B42D034EC4792204D708A69B 225DA2CB64B73F79069F21A5E3CB8522 +86EDF4DA31824CABEF6A4637C40B0BAB 4DF955AD5B398D66408D620A2B27E1A9 A4B737340AE6D2CAFD930BA97D86129F +000000000000000000000000000000000000000000000000 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 97778747D60E425C2B4202599DB856FB +D158860838874D9500000000000000000000000000000000 93A953A82C10411DD158860838874D95 4FA0E5F64893131712F01408D233E9F7 +791739A58B04581A93A953A82C10411DD158860838874D95 6761C42D3E6142D2A84FBFADB383158F F706BC0FD97E28B6F1AF4E17D8755FFF +0000000000000000000000000000000000000000000000000000000000000000 62E45B4CF3477F1DD65063729D9ABA8F 0F4B897EA014D21FBC20F1054A42F719 +FBA167983E7AEF22317CE28C02AAE1A3E8E5CC3CEDBEA82A99DBC39AD65E7227 1344ABA4D3C44708A8A72116D4F49384 458335D95EA42A9F4DCCD41AECC2390D diff --git a/external/crypto++-5.6.3/TestData/mqv1024.dat b/external/crypto++-5.6.3/TestData/mqv1024.dat new file mode 100644 index 000000000..415377ac6 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/mqv1024.dat @@ -0,0 +1 @@ +3082011E028181009A21FC66469293103CEF66960B17880F905C738DB692B7481922FC2D454D14067C6BFC158B93FCC1B8D128D4D86D893082F8A3592238EE8B693B6245F26F55968D7D13752D6BFBA271E8E36E11482815D887BB9F6B600E820E7E2AF2EE6ECDBC1CB35B12A4EF48A8907C090482DE7D49B751BB3A50F78BE29506114BC85D3A6102150C896422EC558A74B883BA85E2F10D4A58F28D2B09028180350C4BB19C0A9B224E5E1BACCC1B1952A97628021B4673831C851C3280F06D3EFA73DAE27E5D4E4A0499E0B2B9A369649E883A1F260EF250B5CCF3E3C922332B210EEA07D3BF92210BA7A7374A30DDDE3D1B3D575B77CD36B001EAE4A2A3BFAFF12FCE74F3330B30ACF6DCFF580ECBFB5B00FD5DD2B8EA9DB09C7E1C7100BD67 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/mqv2048.dat b/external/crypto++-5.6.3/TestData/mqv2048.dat new file mode 100644 index 000000000..ef3245669 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/mqv2048.dat @@ -0,0 +1 @@ +308202280282010100A5C07CE5BF0894C0BA8752F4D9A6D0BF6556D325B618A655CCFE3EEC85B56D47DBDF5A9A5C8588AE6F4C44BBCB339E869A21BE057A243DC797B912C547FBA359C4FC9965C72278370AB6C0DD246197A8D83A08C69425786482D1744C41FBB3C36BEA5963C05B0778AAEF9230C3E2E12072268038E5ADB6433542F94D8C25A6A1785E4D2D97AF119F2139E69AECA46F11B344785A0B1B280CF8D678AB9627780271A350A9B15B92E105F14733C5F15C1753F7C48A645FAAAC1BFA266B5AD6F7C46350465DA31150ABB10FF63FD6C01C849DFCD5645C5D1AF8B967372449DF90D02177E12439BD36A1EED1FAEDB8166927F755B71A5368CC27CD00AB5CF04601E7021D03134944D9AA15697107F48AC5621A1531649AD5EE8EEC1D1F282B5481028201003468652FBB1E3C7F2FBB99A89EA14FB9205F534943034CDE9D9CC57A790D9713EC7B21032EAA8ED2B24FFABD612EDADFC9265964C753AE276380294D4D16C63389A4C392A0058EF1549F6C0D13C4A09759C67650A51F7362B38C61AF2942A6004BB8C3CD4C489E66DE1567E2306821788A519727CD27945DBC5778AC6E8B1DFC05573D76DF9E9AA4F1CE657A2A07BEF833091614C0A6065507BD51099C54148327903626DE6D01FEC9A7F5F9A901C90E219D452C2E2A90AA2303A52776EF174CC85C1AA4F28924B1DFF3E3C5538D820A422374DCFB0D14D620AE282A72416C6506F02D3ED1E6208F66B9DB49294D8D605D7D146BB6A970211289B1BE7AB12531 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/nr1024.dat b/external/crypto++-5.6.3/TestData/nr1024.dat new file mode 100644 index 000000000..6778ccfb2 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/nr1024.dat @@ -0,0 +1 @@ +3082014C0201003082012C06072A8648CE3804013082011F02818100F89F4EBE58E222B517D218D615BDC00611501CD18417886BD3FCBD22578C4611B1E8C06EB0FE9D473A5589BC277AA58C1979DC2869B728D78EC38B4C044A790A60314E7BD3DFDC0BBD8B770A9271D7D048F3E13C73866D096C7304782125847C70EDD721B36F1C379CF7CCEE0A728DD66336ED5F93E8A1BD3EDB22C8761EB987021526A578AB11C3A0812A636D24D120BE544B7973E4D302818100BF927ACE4D175A44622494E37F9552E97B74303321FFEF9B76CDECB14F7D612608DDFEA77C04A8FCACCF7F16CB01AE05AD5EDB65C3B9A380D720F34C7D96C8817E2EFF7D0049EE149DF61C52D7C80271206155CDAEBC8A7F4A8DCE5196E3C18FD5EDF11A394C43A5D59BC65D976817438CA0A7F01713548F61355E976DE75E1E04170215247B2531CFF01D1B1665F0CFD2A836446798353330 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/nr2048.dat b/external/crypto++-5.6.3/TestData/nr2048.dat new file mode 100644 index 000000000..d9f11f169 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/nr2048.dat @@ -0,0 +1 @@ +3082025D0201003082023506072A8648CE38040130820228028201010083C69F32A1F3A67B201D7A92BA204281681DAAD29F50BD866D70A2E01438653B18602AFE606AA925389381682EC0E2CE5D5D366793917879860799ECEDDB4831ED4A4E76D9C34FFDD0BC786588F00E8A19705B997C4298F9CAF9AEE46E0A5677AA1240DC141BD78A8720A829F64C912FA3D961ADE698C5344F18FE4CE70CF7B94F45258C6A9553830FFB80B6BB7E1C510D4526C1904C1D6E2F1B8C1CA6499DBD291438717131804FA2F5F42E5C06293D6DA493C88A38EBC6A6DCF40B2BAB0BF7C7FA0F9C070F1C48FD12CA2B7337E9C58EB9AFDAC6FEEAB0BD62415B26D405D6BF47F11D70B1740BC398A76BE70723A829082EB548D35F4D78E4E015DAD12D5B021D083118E4DC11622CB53E7E4D7634BFBDE45A2D8F8B097A251803505315028201005BAC6CBFE089F75274A532564735786477478F19BE099AB38E0F843393D6D81964CBCFF4B68C5DA2614F06BB844672288F0A65216954990051BA691CA6796AFAAE91A79350F53D9DF3CC688387306EFFDCEF70A14A672E2103B8C861523703157D05DF6EB42DCD81506C88300ED8D8ED40D41AB6D669D309C976B84D82C8D18747578358CBA1EF4B00118B0DEEF11409DD8CB0D83399A33E10C18249574FA2242AE4241CD789C891FEC1C63771EE4517274493240EDAAC44AEDC42F318A5122B052244DFA9A282B8D94BC4BAB360D44E4D0204F8D28817B5B6F808047C92032AA94926D697CFA2FC211FAAE26A5F1FC2B1EB03DA68AD5E01EAC489FB64A66EA3041F021D042ADA16929DA18A7A3C8FDCDD8FC46A6D8AAB79FF33D60E2BF09DEF4F \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rabi1024.dat b/external/crypto++-5.6.3/TestData/rabi1024.dat new file mode 100644 index 000000000..ef8413750 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rabi1024.dat @@ -0,0 +1 @@ +3082015202818100D132EDB1360E31D7B8DD84BB03111FDE0243FFE4031ED12B440E7FF36A634E57772EC81FFDC065607494717C6E16A5AB642283553442CC22569535C7A20E3D1C3E2B3747B26E9856D4A13D0325DC116DAAF8554B000321A753E5CFA730CA60F3E3FE2CA9750C6734A2A113AD4A76B6DAC5E199AB55F34CE6984BF56F6DFAC51D020105020102024100F90CBF726FA70ACB5074BD8E79932B74E9949057B627ABB29F41E5057AE699A03BC240EBB9637E956ABC0B6A20F633F78168A908086E2011FC5D030B9B94B51B024100D7097ACACD8BF8ED641A7D8A17A23F8FB385B92B760EEEB9A1233E1D25892F742315DE23DA0751F24EAE4C0C5B696D0AA0D16EAE94194193DC89D479A9626A2702403B5475CD2A7F519EF08433407826D89983C104AF1E74B44B79B31770149D224089300F828E0DF4CBC864BDB394C0F32CCF055F7B2B8872BF0B5F148020637B9C \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rabi2048.dat b/external/crypto++-5.6.3/TestData/rabi2048.dat new file mode 100644 index 000000000..cb638ef7f --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rabi2048.dat @@ -0,0 +1 @@ +308202970282010100B8F2A74040753A7706CB98B80DD9EE33FB7969FCA65A2025E96853267AEF80ABB184FE463B9475F5166307FAFA988F6CA4BBC7122E9555755191AA408BAF4464221394342104ED2762EEA4FED8B5CDB4234442AB979A487446AB37C4A4FD67C259EB942E28B50DD54F3AA14447931821291D4C21BB8BD58C41302F3E1D2E6FF84F84AACEC02196282C492E0354985A66EBA50B1903EDF70D98BD9837E694876505760C58C186F0B5F6500711500297956C9825EBDCCF90633239484F9A3572271D3CD585BFC195BED0D5FFCABE785B25BFF6ACFF2B7C125D54B26CFEF60B1B077B2F953960DAEB57F102B6A1E30AA88B643090BC4D8971077C1B54EA61E4E45102011302010D02818100D02603BBFDB55F1063DFCEBB4CA32F551330E0F2901D87DF2A395EF6AF340F6352CE3514FCE85705652DC6BD401CD0D5D13855B124DA172D5183A7474B85B683AA03382775F3D8DC600F33E696246F9F2134E2DA061923F47B85A923EBB375B07DE3B43EE4FD71D3E24B4B416DAE6E4C2B6D32A9B45BF04296AECAD60C33DA0702818100E3773B5D8B828BEA922392100C54CDF41D0CD26B4C34A64F483B7975AB35920DA0E3F6AE238E72E26F8A498D9AD0C4A75C52F25421E1E2E3865ADD1A0FCEA4DE932DBE6EBEFA689494855B11714B960F57C5102C0E8876D253ABA8C2D6A511DBC0F30589A0FBE66AD6BCEFDFC4F67F8347726A52736274B7F744ECACFF6198E702818100BF84B25DB607930F80ED57C7AF89E7604B7E8E0D341C9C4A0C94FFE6D4B38810553B1E92F7BF9651D3D0149A9188E1FFD1FB86753A327ABC6169AF92271E7204A2C76488FBC781984BA99C3C48C8A799054DA34A201743C3064B4609831B35FBA2B8B1BC67FFD0C685DBA92FE688AD51D1F161C06EC0B9E0D0E187863BFBBEC0 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rc2val.dat b/external/crypto++-5.6.3/TestData/rc2val.dat new file mode 100644 index 000000000..b4f82a312 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rc2val.dat @@ -0,0 +1,48 @@ +08 +3F +00000000 00000000 +00000000 00000000 +ebb773f9 93278eff + +08 +40 +ffffffff ffffffff +ffffffff ffffffff +278b27e4 2e2f0d49 + +08 +40 +30000000 00000000 +10000000 00000001 +30649edf 9be7d2c2 + +01 +40 +88 +00000000 00000000 +61a8a244 adacccf0 + +07 +40 +88bca90e 90875a +00000000 00000000 +6ccf4308 974c267f + +10 +40 +88bca90e 90875a7f 0f79c384 627bafb2 +00000000 00000000 +1a807d27 2bbe5db1 + +10 +80 +88bca90e 90875a7f 0f79c384 627bafb2 +00000000 00000000 +2269552a b0f85ca6 + +21 +81 +88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 + c42fceb0 be255daf 1e +00000000 00000000 +5b78d3a4 3dfff1f1 diff --git a/external/crypto++-5.6.3/TestData/rc5val.dat b/external/crypto++-5.6.3/TestData/rc5val.dat new file mode 100644 index 000000000..ea2b617fa --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rc5val.dat @@ -0,0 +1,5 @@ +00000000000000000000000000000000 0000000000000000 21A5DBEE154B8F6D +915F4619BE41B2516355A50110A9CE91 21A5DBEE154B8F6D F7C013AC5B2B8952 +783348E75AEB0F2FD7B169BB8DC16787 F7C013AC5B2B8952 2F42B3B70369FC92 +DC49DB1375A5584F6485B413B5F12BAF 2F42B3B70369FC92 65C178B284D197CC +5269F149D41BA0152497574D7F153125 65C178B284D197CC EB44E415DA319824 diff --git a/external/crypto++-5.6.3/TestData/rc6val.dat b/external/crypto++-5.6.3/TestData/rc6val.dat new file mode 100644 index 000000000..3efa3c9f2 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rc6val.dat @@ -0,0 +1,17 @@ +00000000000000000000000000000000 + 00000000000000000000000000000000 8FC3A53656B1F778C129DF4E9848A41E + +0123456789ABCDEF0112233445566778 + 02132435465768798A9BACBDCEDFE0F1 524E192F4715C6231F51F6367EA43F18 + +000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 6cd61bcb190b30384e8a3f168690ae82 + +0123456789abcdef0112233445566778899aabbccddeeff0 + 02132435465768798a9bacbdcedfe0f1 688329d019e505041e52e92af95291d4 + +0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 8f5fbd0510d15fa893fa3fda6e857ec2 + +0123456789abcdef0112233445566778899aabbccddeeff01032547698badcfe + 02132435465768798a9bacbdcedfe0f1 c8241816f0d7e48920ad16a1674e5d48 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rijndael.dat b/external/crypto++-5.6.3/TestData/rijndael.dat new file mode 100644 index 000000000..c3e43f047 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rijndael.dat @@ -0,0 +1,9 @@ +000102030405060708090A0B0C0D0E0F 000102030405060708090A0B0C0D0E0F 0A940BB5416EF045F1C39458C653EA5A +00010203050607080A0B0C0D0F101112 506812A45F08C889B97F5980038B8359 D8F532538289EF7D06B506A4FD5BE9C9 +14151617191A1B1C1E1F202123242526 5C6D71CA30DE8B8B00549984D2EC7D4B 59AB30F4D4EE6E4FF9907EF65B1FB68C +28292A2B2D2E2F30323334353738393A 53F3F4C64F8616E4E7C56199F48F21F6 BF1ED2FCB2AF3FD41443B56D85025CB1 +00010203050607080A0B0C0D0F10111214151617191A1B1C 2D33EEF2C0430A8A9EBF45E809C40BB6 DFF4945E0336DF4C1C56BC700EFF837F +1E1F20212324252628292A2B2D2E2F30323334353738393A 6AA375D1FA155A61FB72353E0A5A8756 B6FDDEF4752765E347D5D2DC196D1252 +3C3D3E3F41424344464748494B4C4D4E5051525355565758 BC3736518B9490DCB8ED60EB26758ED4 D23684E3D963B3AFCF1A114ACA90CBD6 +00010203050607080A0B0C0D0F10111214151617191A1B1C1E1F202123242526 834EADFCCAC7E1B30664B1ABA44815AB 1946DABF6A03A2A2C3D0B05080AED6FC +28292A2B2D2E2F30323334353738393A3C3D3E3F41424344464748494B4C4D4E D9DC4DBA3021B05D67C0518F72B62BF1 5ED301D747D3CC715445EBDEC62F2FB4 diff --git a/external/crypto++-5.6.3/TestData/rsa1024.dat b/external/crypto++-5.6.3/TestData/rsa1024.dat new file mode 100644 index 000000000..70fb17246 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rsa1024.dat @@ -0,0 +1,32 @@ +30820274020100300D06092A864886F70D010101 +05000482025E3082025A02010002818100A39D4F +72D1BCFF65A47545C2897C0464CE9181E8703421 +2EC04407C4C24D569AA20C58B8138C85E17510BC +6B861CADA9034C3ECE3B050B546E97D2BDC07A07 +CF8A612F7D3646739633041893EF18C411264E45 +C9E033A1BD5EE5FA02D95E9A9ADA2D0C6DF480E3 +2FA3FCE02889798455CE53F084AAB4C5549266F7 +CE8C77DF1D0201110281800E6FC33ED64561D443 +378627C0D63C9F7BA36D584622B7A23E241ECD98 +AC78952C6A804C7A320BD020EAE372E62FB4F853 +1D50D5F6261796823A929845B06A19B35A5227CB +C819852A9CBE588CC2D1CEE07F426D13C2BF2FCA +1C99FDEEFDFE387859E2B3F654E85A71481A71E9 +D5256583B1200F29C1AA0F437CFDC2AEAF218102 +4100D5DDB104AD074F6C1B8192D9AC8AED4DE05C +F5C6509490DA8CCFC91FDF7B3A1323E03894DCAA +B2587716D652A56904F86244E10C1B8FA597C389 +2591C55DBD65024100C3D930B583B8AD9A349218 +795C988CF0004F09DA04FFEF6FDF7CB4FA654F74 +B262521FE185693CD6290A337589F62CDEECE24E +CCB5E79865275540F3B603FB59024064A48F89BA +D6437E2B0FCCA2AB8CABE86995285D5318BCA315 +167CC3B47639726B3C56DCA41417B128FBB026E4 +6DA7FC6A7AC441EEDA2FCEF29AE480D5594A1102 +40228FBD4D355CD35772B05EAC014818DF0F1D01 +BD0FF0EE04AEF7E3B3B7867E015CA514AF53C746 +F89DD49FAB5494DABDED9159332F28DEA8705A56 +C198974A79024100D1DCA40FBD19036F0E2A9438 +7D03C090DDF0A677CDE0B8634A81F247752A355E +C1CEA2482A4887767145C2BA703C9C10228FDA1E +BB2EBEA73D23AA9C34182179 diff --git a/external/crypto++-5.6.3/TestData/rsa2048.dat b/external/crypto++-5.6.3/TestData/rsa2048.dat new file mode 100644 index 000000000..83200c275 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rsa2048.dat @@ -0,0 +1,61 @@ +308204BB020100300D06092A864886F70D010101 +0500048204A5308204A10201000282010100BB25 +80EB6B368287A0A3BDDF6AAA9EDA2EEF15D92C5F +E0B1C21473175C39B685A6FB0B0DB611092C19B4 +FA3CA5BB20F311E35B2E1097F48B077DF7684BEB +9A34EB78C7B5F02ADFAEA3F3A66F1EF91B0C47DE +68F0501F80A7E9603F794E928949F152C049A011 +D7E58C72F9303781E4FE7129DD7B87B5448D440A +62CE8E9C801F245039E2724A9C37CB17457950B7 +B3C4C9BE4D17A29EFC1EA1EF464FBD21DABE9F10 +ED0EB132405D68E4304008083BB675DA97CB6219 +147A1EB93D38A9C4023540F871272A85B45447B3 +6DE9A708E412CD31B1CB6470E4A37CBEA6000F36 +632DF86FD3C34466C63BD80F1350E4DD5081597F +F34F94F07AE6430DCC0563B1F7CF020111028201 +00034D763A5DC03580E33616ED5ABABA855B2E62 +4495DD8D002009656B5473772C85F55F10CE81CE +77BE31E04657410B1F6535B4CF1E6914E152F4AB +84DA2FD409F81BBB3DF0A96A58EACC9501F60162 +5C1356BF97D139C78A7E18496708EA7DE7B47266 +C81363B3FF888085E7403A028901FF3BA04C2EDE +930EC0EFAC4DCF8FD054C1119562A1C7CA455D79 +36CB95A16CE611ABC97918961DE6720CE171CC69 +A590E9A041EC1DAC6FDCF2E04946C100E03DEFCA +29FF480C926CD48589EB832D4476CF38AB320754 +D97BE77FDB9E5F2DCA1A2ABBC33D0790FE8C22CF +694BB8E0265733A5A17CC5D07DB54515DC80216A +A23A43EB12783888FF424EDB26FAF7DCB9028181 +00EB4C87F67AEA3F2047BF9DF61947DF2BA7E1C1 +64A03A8E3ED5F3BC6CDEE99FC6251C6A28F9502F +0A4B5A0CFA8038A12A2270AAE2C9342EDBA207CE +0F170B6D07550670CFEAE730B9411E66CD2D485F +3FC3E9C5348D32C768F68A53C756E66BE0FAC7E8 +FDC9FBE22644961782DA5DDC19D75B64D2E8B660 +052DDC95AD186633E902818100CB9C7830223B78 +FC28A6D2B77C50C3D389F32FC4DEF33341741205 +5102F8D852663DB44E1EA5E5E58A71D30D33C168 +E94855D79CC19CC7DFBAFBDFF7710490064A1375 +1CD75466219956B9D4C0AF0CC13E7D075F54E6AF +8CD67FBE3F4AB90425B039410686A168421E2E24 +FF0319D9D3F1C685BB650BC7B5BD12090CBDC392 +F702818060E3470B238DA185C330C89282E15BE4 +CCA84092D89094ECB2736BB45BC99C2469A249D4 +A2E4C8134C34237634CC06206888BED5DA60C800 +158ABE4272E6964E502FD41960B98C888439B1DC +039645567DD8BA9D2B14E8B2BFDE9AF7BA5EE120 +674341D1E9C211D385A736DB871796DD76CB47A2 +239663C5E5B52E9291937EC902818053D704500E +187D1C8935A20F514E6EC08418D76F2EA060663E +DA3E6CA6DEEFA97564B3A7B2444F9AC08938C933 +6DC1C9782358C8137CCAC5893A8965E33E1D2FC4 +262129FE4FEDD1997E10488B935F9ADD7EC6CCE6 +B957581C167B83791F01B52A71ED99467EB27593 +F4E20EA6EC86DECCF7643E1A8C614AD561C77DB7 +8CC40B02818100AF950A287679E6C55020400E8A +AD0642DB1C11D9AD5AE85F1B6FD2829D869453C9 +F67C0210D0847A4BD47C57FAECD9BE540BD66989 +E6C43F62D725B3D841B4F1DB7C28A722337358C8 +D1CD55F5CA6E31FAD6F827756BA074944D345C8D +2FCE759F4244B948D06F5AC863DEAAEF279B2F69 +955ADAD1F39DEA9DA028B94EF22F11 diff --git a/external/crypto++-5.6.3/TestData/rsa400pb.dat b/external/crypto++-5.6.3/TestData/rsa400pb.dat new file mode 100644 index 000000000..ccbc6ae2c --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rsa400pb.dat @@ -0,0 +1,10 @@ +30 4c 30 0d 06 09 2a 86 +48 86 f7 0d 01 01 01 05 +00 03 3b 00 30 38 02 33 +00 a3 07 9a 90 df 0d fd +72 ac 09 0c cc 2a 78 b8 +74 13 13 3e 40 75 9c 98 +fa f8 20 4f 35 8a 0b 26 +3c 67 70 e7 83 a9 3b 69 +71 b7 37 79 d2 71 7b e8 +34 77 cf 02 01 03 diff --git a/external/crypto++-5.6.3/TestData/rsa400pv.dat b/external/crypto++-5.6.3/TestData/rsa400pv.dat new file mode 100644 index 000000000..2a7312341 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rsa400pv.dat @@ -0,0 +1,41 @@ + 30 81 fb + 02 01 00 + 02 + 33 00 a3 07 9a 90 df 0d + fd 72 ac 09 0c cc 2a 78 + b8 74 13 13 3e 40 75 9c + 98 fa f8 20 4f 35 8a 0b + 26 3c 67 70 e7 83 a9 3b + 69 71 b7 37 79 d2 71 7b + e8 34 77 cf + 02 01 03 + 02 + 32 6c af bc 60 94 b3 fe + 4c 72 b0 b3 32 c6 fb 25 + a2 b7 62 29 80 4e 68 65 + fc a4 5a 74 df 0f 8f b8 + 41 3b 52 c0 d0 e5 3d 9b + 59 0f f1 9b e7 9f 49 dd + 21 e5 eb + 02 1a 00 cf 20 + 35 02 8b 9d 86 98 40 b4 + 16 66 b4 2e 92 ea 0d a3 + b4 32 04 b5 cf ce 91 + 02 + 1a 00 c9 7f b1 f0 27 f4 + 53 f6 34 12 33 ea aa d1 + d9 35 3f 6c 42 d0 88 66 + b1 d0 5f + 02 1a 00 8a 15 + 78 ac 5d 13 af 10 2b 22 + b9 99 cd 74 61 f1 5e 6d + 22 cc 03 23 df df 0b + 02 + 1a 00 86 55 21 4a c5 4d + 8d 4e cd 61 77 f1 c7 36 + 90 ce 2a 48 2c 8b 05 99 + cb e0 3f + 02 1a 00 83 ef + ef b8 a9 a4 0d 1d b6 ed + 98 ad 84 ed 13 35 dc c1 + 08 f3 22 d0 57 cf 8d \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rsa512a.dat b/external/crypto++-5.6.3/TestData/rsa512a.dat new file mode 100644 index 000000000..e7edefae7 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rsa512a.dat @@ -0,0 +1,35 @@ +30 82 01 50 + 02 01 00 + 30 0d + 06 09 + 2a 86 48 86 f7 0d 01 01 01 + 05 00 + 04 82 01 3a + 30 82 01 36 + 02 01 00 + 02 40 + 0a 66 79 1d c6 98 81 68 de 7a b7 74 19 bb 7f b0 + c0 01 c6 27 10 27 00 75 14 29 42 e1 9a 8d 8c 51 + d0 53 b3 e3 78 2a 1d e5 dc 5a f4 eb e9 94 68 17 + 01 14 a1 df e6 7c dc 9a 9a f5 5d 65 56 20 bb ab + 02 03 01 00 01 + 02 40 + 01 23 c5 b6 1b a3 6e db 1d 36 79 90 41 99 a8 9e + a8 0c 09 b9 12 2e 14 00 c0 9a dc f7 78 46 76 d0 + 1d 23 35 6a 7d 44 d6 bd 8b d5 0e 94 bf c7 23 fa + 87 d8 86 2b 75 17 76 91 c1 1d 75 76 92 df 88 81 + 02 20 + 33 d4 84 45 c8 59 e5 23 40 de 70 4b cd da 06 5f + bb 40 58 d7 40 bd 1d 67 d2 9e 9c 14 6c 11 cf 61 + 02 20 + 33 5e 84 08 86 6b 0f d3 8d c7 00 2d 3f 97 2c 67 + 38 9a 65 d5 d8 30 65 66 d5 c4 f2 a5 aa 52 62 8b + 02 20 + 04 5e c9 00 71 52 53 25 d3 d4 6d b7 96 95 e9 af + ac c4 52 39 64 36 0e 02 b1 19 ba a3 66 31 62 41 + 02 20 + 15 eb 32 73 60 c7 b6 0d 12 e5 e2 d1 6b dc d9 79 + 81 d1 7f ba 6b 70 db 13 b2 0b 43 6e 24 ea da 59 + 02 20 + 2c a6 36 6d 72 78 1d fa 24 d3 4a 9a 24 cb c2 ae + 92 7a 99 58 af 42 65 63 ff 63 fb 11 65 8a 46 1d diff --git a/external/crypto++-5.6.3/TestData/rw1024.dat b/external/crypto++-5.6.3/TestData/rw1024.dat new file mode 100644 index 000000000..dcd0209bd --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rw1024.dat @@ -0,0 +1 @@ +3082014D02818100BECF1F40456801F6965E603BEBB61F530F0B17BBCB00E3A8866EB9BC84AE3892A4CB040280F568FC650B1734014CA78A200D5E4AB394CBB75C0034DCC47643E6F576A39F850C5F4528048165B084C82E9BA6BA4CFBCB3980F1EB47EC2C348EF52A6225A85AF743DFCEF5CD4583EB0B9C0DA77ABEBEB5BCC513D81BD768B579AD024100F06CA9C1FBE20EE2440F3AB2F9A9787D820943EAF59B6B8D103CFAB1C2F595DDC99D05DC73F9D1DB780B6F8B26CF87E58EB870DD983A2515600DF80C3EBB7B1B024100CB2B9BDEB0D508E21E646C86D836442FC16910D68C8D1D18BB1327899A506C16C1162E93EA7C2CB576B750AEAB152255D5AB22632025CFFAD927A070CBAEA2D7024100C90A853BEC7C25D773FDDB95C11CEF9BB3F487953773F07E42DB9D011325AE2725663478FB7F0EC1A5608280D9656BF3B9F463FF8B23F1CA1B543508D51826E2 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rw2048.dat b/external/crypto++-5.6.3/TestData/rw2048.dat new file mode 100644 index 000000000..5547c88b1 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/rw2048.dat @@ -0,0 +1 @@ +3082029002820101008F2975B4DA54179A6C81764DB9E6B50AD925C91568DFE2C245DF9103AF39370BD5F25CD26BF6E41B6FEB0E24473BBFAE89343BC20743057B056BD2189C01258650567A3EC24040EED7EEAF94B77BDD39529807D1FCF5FF4A90E6B42BA58FF1FDCDACF981C641B8F077ABBB41BEFD53CCABF06745CD009A7F9DFAA61ED03F11466E4B5370DFA18C7DFEA1689B60F98012CDE9131FE86F74BFC6B93AC449DA73A2366EA2AE2233AFFBFF0CDE1899B1F852C179639B31CEE11991AA8D46DB5067B0C5FFB3D913612668F0C43CA134B11875F271C0BC8722AF4AD6CC93A43CE165EF31C1EB542ECC7CA1A38BFDF66F3A2175E4EA7159E168FFE3A549535B90C7BBDD02818100C5CEBA84E8B7C20BAA6F450000803F15C1160EB7E0875EBBC15F11DC7E3CAFE55973234FF4C74589406D2950B0C236ABE1B5A5B70D55C035F45D87AF089847C0E2A2DEF23EA4CC19FB5419DF43577523248BEF80B94C59F7342C717F12DE68FEEADAD97BA2DD436834D8559D0A7A31D6F9D9480F852C285EFC75BCA8AF32590302818100B947440D272629155C2B3E0E62B76124281155F7A189650D36C8F7D742F7DBC571ADDCC582ED2ED283C2E8A1CD8C996D3D8A50F33C56581285C5016A16DEDA533715DF519CAB7777F3DCB9F5335552F315B44FF8126DFDDF60B66850AA8FD108ED3A248D18E7473D7967F0F15C740C67476A75273DA254AE5C7B94FB059DD19F0281801EE99173837363981E0988DE22B2E36BFC9713EDC8454BF1CB764D767DFDA985B9DBAA346C0C39B1A9F83D849502AFDD80AE33F588C114BC4DE5FA949125FF56908F8C66CDFF6BF601F1CBF463B0C807DEABB1290C358FC0433ED74EBA074CB211C4D75538ED017F497C9722D8C3D3E082BB4A8A92D5768B5D5963BBDB1DB24D \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/saferval.dat b/external/crypto++-5.6.3/TestData/saferval.dat new file mode 100644 index 000000000..cdcad06fd --- /dev/null +++ b/external/crypto++-5.6.3/TestData/saferval.dat @@ -0,0 +1,16 @@ +0000000000000000 0000000000000000 032808C90EE7AB7F +0000000000000000 0102030405060708 7D28038633B92EB4 +0102030405060708 1011121314151617 71E5CF7F083A59C5 +0102030405060708 18191A1B1C1D1E1F 356F702CC7FA8161 +08070605040302010807060504030201 5051525354555657 38E64DBF6E0F896E +08070605040302010807060504030201 58595A5B5C5D5E5F 7D8F014A902480FE +01020304050607080807060504030201 6061626364656667 113511C22E7936DF +01020304050607080807060504030201 68696A6B6C6D6E6F 9EEB2D17C0581437 +0000000000000001 7071727374757677 9ABE2C85BE2D7614 +0000000000000001 78797A7B7C7D7E7F EBC4A9C6C25CF215 +0102030405060708 8081828384858687 54E72BA2D744C566 +0102030405060708 88898A8B8C8D8E8F 57F55D0F7EB6F8FE +00000000000000010000000000000001 9091929394959697 9EAA4DF1E0EFF445 +00000000000000010000000000000001 98999A9B9C9D9E9F 4CC14838399E532D +01020304050607080000000000000000 A0A1A2A3A4A5A6A7 41246B65F1DC6AFA +00000000000000000102030405060708 A0A1A2A3A4A5A6A7 5CBD77B03626FE3B diff --git a/external/crypto++-5.6.3/TestData/serpentv.dat b/external/crypto++-5.6.3/TestData/serpentv.dat new file mode 100644 index 000000000..bccbf3734 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/serpentv.dat @@ -0,0 +1,12 @@ +00000000000000000000000000000000 d29d576fcea3a3a7ed9099f29273d78e b2288b968ae8b08648d1ce9606fd992d +00000000000000000000000000000000 d29d576fcea3a3a7ed9099f26d8c2871 563a8403ff5309d62370b1dcf5a11edd +ffeeddccbbaa99887766554433221100 1032547698badcfeefcdab8967452301 d5baa00a4bb9d8a7c981c8dc90d89d92 +ffeeddccbbaa99887766554433221100 145f0b8b663176b95dcab7e9dcd5cc24 1032547698badcfeefcdab8967452301 +80000000000000000000000000000000 00000000000000000000000000000000 264E5481EFF42A4606ABDA06C0BFDA3D +000000000000000000000000000000000000000000000000 d29d576fceaba3a7ed9899f2927bd78e 130e353e1037c22405e8faefb2c3c3e9 +8899aabbccddeeffffeeddccbbaa99887766554433221100 1032547698badcfeefcdab8967452301 da860842b720802bf404a4c71034879a +8899aabbccddeeffffeeddccbbaa99887766554433221100 b2696bd0d98c17953e4239225d27202c 1032547698badcfeefcdab8967452301 +000102030405060708090A0B0C0D0E0F1011121314151617 4528CACCB954D450655E8CFD71CBFAC7 00112233445566778899AABBCCDDEEFF +0000000000000000000000000000000000000000000000000000000000000000 92074732d84e1841a013a0034c52bf50 81c4eb7b8ad9a8d0f2aa5d7bd626b560 +00112233445566778899aabbccddeeffffeeddccbbaa99887766554433221100 1032547698badcfeefcdab8967452301 93df9a3cafe387bd999eebe393a17fca +000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F 3DA46FFA6F4D6F30CD258333E5A61369 00112233445566778899AABBCCDDEEFF \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/shacal2v.dat b/external/crypto++-5.6.3/TestData/shacal2v.dat new file mode 100644 index 000000000..169b55f0f --- /dev/null +++ b/external/crypto++-5.6.3/TestData/shacal2v.dat @@ -0,0 +1,14 @@ +80000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 361AB6322FA9E7A7BB23818D839E01BDDAFDF47305426EDD297AEDB9F6202BAE +00000000000000000000000000000001 0000000000000000000000000000000000000000000000000000000000000000 7308AEC23D25A231B26448AFE78D5047804C5011B9B5F95C16DF2670551F0001 +00000000000000000000000000000000 8000000000000000000000000000000000000000000000000000000000000000 2CAE7C0460EE2FC3200923A1B6C2ABEEA746C8B44F6C3FB941BD3AF02A3E6E3E +00000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000001 45D43E9288738C5AD1A683D8DE59CEDD22D666A2B7078EB1301B532A272D570B +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 7CA51614425C3BA8CE54DD2FC2020AE7B6E574D198136D0FAE7E26CCBF0BE7A6 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 0101010101010101010101010101010101010101010101010101010101010101 C4B7C6A9738C77EE28F7E685C8358E0AF88FB6D23955EE6DF49FE3F5DA16F826 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 0202020202020202020202020202020202020202020202020202020202020202 CD108DD9EC1000B79C75AA3DCC88F913E6F52773853035A5C44F3245B134CBFF +04040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404 0404040404040404040404040404040404040404040404040404040404040404 6AA777340200C1B65AB25193A8BB267C233DAC7E1B3C523D406FC5B567B7B586 +08080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808 0808080808080808080808080808080808080808080808080808080808080808 A23BE32D37FA4054EC45D6A9CC643AF9124EDAA4AD9ABC7FAAB449D39D11B128 +10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010 F64819DFBEBE0A6DB650E7072CE28EA606586418B317785FF0AD44212A84C82C +20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 2020202020202020202020202020202020202020202020202020202020202020 E267D6113C27170A3EE6DF496E801A6131BBD3444365D7C03791E25610F1A0E4 +40404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040 4040404040404040404040404040404040404040404040404040404040404040 C97909916EE86FFDCE8A92903046109B53F788A53039434DF1A394DAD6F697A2 +80808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 8080808080808080808080808080808080808080808080808080808080808080 C3C1CD5F3060B3EC4E6ABC0818B68449E1750FB482368C8F3305270E16F98735 +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 0598127BAF11706F77402000D730C54A0B84C868A98C6CA4D7F3C0FA06A78B7A diff --git a/external/crypto++-5.6.3/TestData/sharkval.dat b/external/crypto++-5.6.3/TestData/sharkval.dat new file mode 100644 index 000000000..637387a9f --- /dev/null +++ b/external/crypto++-5.6.3/TestData/sharkval.dat @@ -0,0 +1,7 @@ +00000000000000000000000000000000 0000000000000000 214BCF4E7716420A +000102030405060708090A0B0C0D0E0F 0000000000000000 C76C696289898137 +000102030405060708090A0B0C0D0E0F C76C696289898137 077A4A59FAEEEA4D +915F4619BE41B2516355A50110A9CE91 21A5DBEE154B8F6D 6FF33B98F448E95A +783348E75AEB0F2FD7B169BB8DC16787 F7C013AC5B2B8952 E5E554ABE9CED2D2 +DC49DB1375A5584F6485B413B5F12BAF 2F42B3B70369FC92 9AE068313F343A7A +5269F149D41BA0152497574D7F153125 65C178B284D197CC D3F111A282F17F29 diff --git a/external/crypto++-5.6.3/TestData/skipjack.dat b/external/crypto++-5.6.3/TestData/skipjack.dat new file mode 100644 index 000000000..6991a1e0d --- /dev/null +++ b/external/crypto++-5.6.3/TestData/skipjack.dat @@ -0,0 +1 @@ +11223344556677889900 aabbccdd00112233 00d3127ae2ca8725 diff --git a/external/crypto++-5.6.3/TestData/squareva.dat b/external/crypto++-5.6.3/TestData/squareva.dat new file mode 100644 index 000000000..4eddd1a0b --- /dev/null +++ b/external/crypto++-5.6.3/TestData/squareva.dat @@ -0,0 +1,8 @@ +00000000000000000000000000000000 00000000000000000000000000000000 3C00428F8ABBC0B84F057CC19C26F8CF +000102030405060708090A0B0C0D0E0F 00000000000000000000000000000000 FF596FA668BFC3014200AE01E2BBA0A0 +000102030405060708090A0B0C0D0E0F 000102030405060708090A0B0C0D0E0F 7C3491D94994E70F0EC2E7A5CCB5A14F +000102030405060708090A0B0C0D0E0F C76C696289898137077A4A59FAEEEA4D 88C6FF4B92604C6E66656B02DDAF9F40 +915F4619BE41B2516355A50110A9CE91 21A5DBEE154B8F6D6FF33B98F448E95A 3388801F66E7FCC0BCE522A23A4F0C7F +783348E75AEB0F2FD7B169BB8DC16787 F7C013AC5B2B8952E5E554ABE9CED2D2 A1C0E9215141343DEC2B556942C92BDE +DC49DB1375A5584F6485B413B5F12BAF 2F42B3B70369FC929AE068313F343A7A 3FBE6811B998CDF3E50ABDE2F3C075E3 +5269F149D41BA0152497574D7F153125 65C178B284D197CCD3F111A282F17F29 D7B7209E0879744C782809B6D2E0B1B0 diff --git a/external/crypto++-5.6.3/TestData/twofishv.dat b/external/crypto++-5.6.3/TestData/twofishv.dat new file mode 100644 index 000000000..54fbc379c --- /dev/null +++ b/external/crypto++-5.6.3/TestData/twofishv.dat @@ -0,0 +1,9 @@ +00000000000000000000000000000000 00000000000000000000000000000000 9F589F5CF6122C32B6BFEC2F2AE8C35A +00000000000000000000000000000000 9F589F5CF6122C32B6BFEC2F2AE8C35A D491DB16E7B1C39E86CB086B789F5419 +9F589F5CF6122C32B6BFEC2F2AE8C35A D491DB16E7B1C39E86CB086B789F5419 019F9809DE1711858FAAC3A3BA20FBC3 +D491DB16E7B1C39E86CB086B789F5419 019F9809DE1711858FAAC3A3BA20FBC3 6363977DE839486297E661C6C9D668EB +000000000000000000000000000000000000000000000000 00000000000000000000000000000000 EFA71F788965BD4453F860178FC19101 +EFA71F788965BD4453F860178FC191010000000000000000 88B2B2706B105E36B446BB6D731A1E88 39DA69D6BA4997D585B6DC073CA341B2 +88B2B2706B105E36B446BB6D731A1E88EFA71F788965BD44 39DA69D6BA4997D585B6DC073CA341B2 182B02D81497EA45F9DAACDC29193A65 +0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 57FF739D4DC92C1BD7FC01700CC8216F +D43BB7556EA32E46F2A282B7D45B4E0D57FF739D4DC92C1BD7FC01700CC8216F 90AFE91BB288544F2C32DC239B2635E6 6CB4561C40BF0A9705931CB6D408E7FA diff --git a/external/crypto++-5.6.3/TestData/usage.dat b/external/crypto++-5.6.3/TestData/usage.dat new file mode 100644 index 000000000..7830f0c35 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/usage.dat @@ -0,0 +1,81 @@ +Test Driver for Crypto++(R) Library, a C++ Class Library of Cryptographic Schemes + +- To generate an RSA key + cryptest g + +- To encrypt and decrypt a string using RSA + cryptest r + +- To sign a file using RSA + cryptest rs privatekeyfile messagefile signaturefile + +- To verify a signature of a file using RSA + cryptest rv publickeyfile messagefile signaturefile + +- To digest a file using several hash functions in parallel + cryptest m file + +- To encrypt and decrypt a string using DES-EDE in CBC mode + cryptest t + +- To encrypt or decrypt a file + cryptest e|d input output + +- To secret share a file (shares will be named file.000, file.001, etc) + cryptest ss threshold number-of-shares file + +- To reconstruct a secret-shared file + cryptest sr file share1 share2 [....] + (number of shares given must be equal to threshold) + +- To information disperse a file (shares will be named file.000, file.001, etc) + cryptest id threshold number-of-shares file + +- To reconstruct an information-dispersed file + cryptest ir file share1 share2 [....] + (number of shares given must be equal to threshold) + +- To gzip a file + cryptest z compression-level input output + +- To gunzip a file + cryptest u input output + +- To encrypt a file with AES in CTR mode + cryptest ae input output + +- To base64 encode a file + cryptest e64 input output + +- To base64 decode a file + cryptest d64 input output + +- To hex encode a file + cryptest e16 input output + +- To hex decode a file + cryptest d16 input output + +- To forward a TCP connection + cryptest ft source-port destination-host destination-port + +- To run the FIPS 140-2 sample application + cryptest fips + +- To generate 100000 random files using FIPS Approved X.917 RNG + cryptest fips-rand + +- To run Maurer's randomness test on a file + cryptest mt input + +- To run a test script (available in TestVectors subdirectory) + cryptest tv filename + +- To run validation tests + cryptest v + +- To display version number + cryptest V + +- To run benchmarks + cryptest b [time allocated for each benchmark in seconds] [frequency of CPU in gigahertz] diff --git a/external/crypto++-5.6.3/TestData/xtrdh171.dat b/external/crypto++-5.6.3/TestData/xtrdh171.dat new file mode 100644 index 000000000..c75ff48d8 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/xtrdh171.dat @@ -0,0 +1,3 @@ +305F02160559DCD66A95A57249A15BAD6B431BF2CD58615B901D02153365CFA0D3B1B6577B2DB243 +DDE45EDB91C18B0F5F0216032F4EBA0911B3D0B14F6F1292A74DFFD4A8FCF22C1802160211CB3EDA +809FA0FF8C3A8AE691EC4C95A06A3395CF diff --git a/external/crypto++-5.6.3/TestData/xtrdh342.dat b/external/crypto++-5.6.3/TestData/xtrdh342.dat new file mode 100644 index 000000000..ce67aaaf7 --- /dev/null +++ b/external/crypto++-5.6.3/TestData/xtrdh342.dat @@ -0,0 +1,5 @@ +3081A6022B28E3FED51D3D861D962B0A16A92ACDB380ADAFB478CA555004C3AF387F853F9DE9921C +7DCB40098D25C757021D03094844F135A3A50049A848C3FC02412FCBED6040FB1BDE99A4D93E3B02 +2B13F411960B85F9B031A247E072046892B1EE6C95A47242A839F8E24B96B88F37B4BDA2C6D253BC +0AAF29F1022B0D2AFE639D324E558B2B312E435E03957769D745C881D259DDFD2F48F9C08F82ECCF +F4E7ADD47C705896D0 diff --git a/external/crypto++-5.6.3/TestVectors/Readme.txt b/external/crypto++-5.6.3/TestVectors/Readme.txt new file mode 100644 index 000000000..b0b0aa1b1 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/Readme.txt @@ -0,0 +1,76 @@ +Test Data Format + +A test data file is an ASCII text file composed of sections separated by +blank lines. Each section is stand-alone and independent of other +sections that may be in the same file, and contains one or more tests. + +A section is composed of a sequence of fields. Each field is one or more +lines composed of a field name, followed by a colon (":"), followed by a +field body. All but the last line of a field must end with a backslash +("\"). If any line contains a hash mark ("#"), the hash mark and +everything after it on the same line is not considered part of the field +body. + +Each section must contain fields named AlgorithmType, Name, Source, and +Test. The presence and semantics of other fields depend on the algorithm +being tested and the tests to be run. + +Each section may contain more than one test and therefore more than one +field named Test. In that case the order of the fields is significant. A +test should always use the last field with any given name that occurs +before the Test field. + +Data Types + +int - small integer (less than 2^32) in decimal representation +string - human readable string +encoded string - can be one of the following + - quoted string: "message" means "message" without the quotes + or terminating '\0' + - hex encoded string: 0x74657374 or 74657374 means "test" + - repeated string: r100 "message" to repeat "message" 100 times, or + r256 0x0011 to repeat 0x0011 256 times + +Field Types + +AlgorithmType - string, for example "Signature", "AsymmetricCipher", +"SymmetricCipher", "MAC", "MessageDigest", or "KeyFactory" +Name - string, an algorithm name from SCAN +Test - string, identifies the test to run +Source - string, text explaining where the test data came from +Comment - string, other comments about the test data +KeyFormat - string, specifies the key format. "Component" here means +each component of the key or key pair is specified separately as a name, +value pair, with the names depending on the algorithm being tested. +Otherwise the value names "Key", or "PublicKey" and "PrivateKey" are +used. +Key - encoded string +PublicKey - encoded string +PrivateKey - encoded string +Message - encoded string, message to be signed or verified +Signature - encoded string, signature to be verified or compared +with +Plaintext - encoded string +Ciphertext - encoded string +Header - encoded string +Footer - encoded string +DerivedKey - encoded string +DerivedLength - encoded string +Digest - encoded string +TruncatedSize - int, size of truncated digest in bytes +Seek - int, seek location for random access ciphers +(more to come here) + +Possible Tests + +KeyPairValidAndConsistent - public and private keys are both valid and +consistent with each other +PublicKeyInvalid - public key validation should not pass +PrivateKeyInvalid - private key validation should not pass +Verify - signature/digest/MAC verification should pass +VerifyTruncated - truncated digest/MAC verification should pass +NotVerify - signature/digest/MAC verification should not pass +DeterministicSign - sign message using given seed, and the resulting +signature should be equal to the given signature +DecryptMatch - ciphertext decrypts to plaintext +(more to come here) diff --git a/external/crypto++-5.6.3/TestVectors/aes.txt b/external/crypto++-5.6.3/TestVectors/aes.txt new file mode 100644 index 000000000..5f967f426 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/aes.txt @@ -0,0 +1,241 @@ +AlgorithmType: SymmetricCipher +Name: AES/ECB +Source: NIST Special Publication 800-38A +Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 +Comment: F.1.1 ECB-AES128.Encrypt +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 3ad77bb40d7a3660a89ecaf32466ef97 f5d3d58503b9699de785895a96fdbaaf 43b1cd7f598ece23881b00e3ed030688 7b0c785e27e8ad3f8223207104725dd4 +Test: Encrypt +Comment: F.1.3 ECB-AES192.Encrypt +Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Ciphertext: bd334f1d6e45f25ff712a214571fa5cc 974104846d0ad3ad7734ecb3ecee4eef ef7afd2270e2e60adce0ba2face6444e 9a4b41ba738d6c72fb16691603c18e0e +Test: Encrypt +Comment: F.1.5 ECB-AES256.Encrypt +Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Ciphertext: f3eed1bdb5d2a03c064b5a7e3db181f8 591ccb10d410ed26dc5ba74a31362870 b6ed21b99ca6f4f9f153e7b1beafed1d 23304b7a39f9f3ff067d8d8f9e24ecc7 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/ECB +Source: Generated by Crypto++ 5.6.1 +Comment: long test vector +Plaintext: r8 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c371000 +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 84C6CBDC2B5A39985774B23BAB066A6AF8CB66C08E4F058E5D3E7C351EA845CEC7B209210EE7EFD38269628687F21CB9BCEA349DC0418ADBA2BF2364DF4DB1A11AD84CF6A422CE95C37B2CF81196245CD857D0B954B83985C1888230F3C301847AAF714253EF768C17E89E4F5513DBD5BEE1266A2B2D7063CE3D0BA8716252C5BCBB9922CD46F374B52FDFF1FEBF155FF4AFEE18788999BC74234A3FFBA7B2858BB2552F172E56EC47456878440ABB5ADAE49941C1E43616AC5D6E31A011611B829F6A77BE1F50754F81F35D24ED89FDE804B17363F9A81C3F12AE067FDD41A2984912CAE1926C5FB3AC18E541FA4AD1E171888E61428F2A8F2E981AE16D0D4E41D33E5E675F446DAE0F454FC4CA056F41F3CC4744A9E948428B2280F96663B7230C09692503C95B3E34F8DE8DF23157F45BDF689B258D994D9E6CE5D4DD6BDB96763CCC41DBBE57A4778D5A9E90226D614C335E44CA8AB41EFEA898BC170C65412F77194A43A1305EF23AC70B059E6E047796EF518D7696BC3DAD5E2634F92DD1C90D206A2B6D3A7CE88668BEAD64614E9000ACFBA79EB3601606214E21E08F14CE77E36BB66FE4A0FCD2A21BCAA2391A9C2016AC3BC7CDF1438EB6DD26696644583E2B0A0C68629D736F6723DF66859CF80B4E5B5C5BF03F334D65C48DB3B2660E2CE33B510FD60C912B85D16AEE7CDBFDF6285B0A77BAE07D987F9CE172A548E6BF0A30CF099AA82BE0A25E0E8919 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/CBC +Source: NIST Special Publication 800-38A +IV: 000102030405060708090a0b0c0d0e0f +Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 +Comment: F.2.1 CBC-AES128.Encrypt +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 7649abac8119b246cee98e9b12e9197d 5086cb9b507219ee95db113a917678b2 73bed6b8e3c1743b7116e69e22229516 3ff1caa1681fac09120eca307586e1a7 +Test: Encrypt +Comment: F.2.3 CBC-AES192.Encrypt +Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Ciphertext: 4f021db243bc633d7178183a9fa071e8 b4d9ada9ad7dedf4e5e738763f69145a 571b242012fb7ae07fa9baac3df102e0 08b0e27988598881d920a9e64f5615cd +Test: Encrypt +Comment: F.2.5 CBC-AES256.Encrypt +Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Ciphertext: f58c4c04d6e5f1ba779eabfb5f7bfbd6 9cfc4e967edb808d679f777bc6702c7d 39f23369a9d9bacfa530e26304231461 b2eb05e2c39be9fcda6c19078c6a9d1b +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/CBC +Source: RFC 3602 +Comment: Case 1: Encrypting 16 bytes (1 block) using AES-CBC with 128-bit key +Key : 0x06a9214036b8a15b512e03d534120006 +IV : 0x3dafba429d9eb430b422da802c9fac41 +Plaintext : "Single block msg" +Ciphertext: 0xe353779c1079aeb82708942dbe77181a +Test: Encrypt +Comment: Case 2: Encrypting 32 bytes (2 blocks) using AES-CBC with 128-bit key +Key : 0xc286696d887c9aa0611bbb3e2025a45a +IV : 0x562e17996d093d28ddb3ba695a2e6f58 +Plaintext : 0x000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f +Ciphertext: 0xd296cd94c2cccf8a3a863028b5e1dc0a 7586602d253cfff91b8266bea6d61ab1 +Test: Encrypt +Comment: Case 3: Encrypting 48 bytes (3 blocks) using AES-CBC with 128-bit key +Key : 0x6c3ea0477630ce21a2ce334aa746c2cd +IV : 0xc782dc4c098c66cbd9cd27d825682c81 +Plaintext : "This is a 48-byte message (exactly 3 AES blocks)" +Ciphertext: 0xd0a02b3836451753d493665d33f0e886 2dea54cdb293abc7506939276772f8d5 021c19216bad525c8579695d83ba2684 +Test: Encrypt +Comment: Case 4: Encrypting 64 bytes (4 blocks) using AES-CBC with 128-bit key +Key : 0x56e47a38c5598974bc46903dba290349 +IV : 0x8ce82eefbea0da3c44699ed7db51b7d9 +Plaintext : 0xa0a1a2a3a4a5a6a7a8a9aaabacadaeaf b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf +Ciphertext: 0xc30e32ffedc0774e6aff6af0869f71aa 0f3af07a9a31a9c684db207eb0ef8e4e 35907aa632c3ffdf868bb7b29d3d46ad 83ce9f9a102ee99d49a53e87f4c3da55 +Test: Encrypt + + +AlgorithmType: SymmetricCipher +Name: AES/CBC +Source: Generated by Crypto++ 5.6.1 +Comment: long test vector +IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: r8 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c371000 +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 6544CCA076C4D67C1A69DD7E504C6586FBD22912505E187D8628E19FA067D6C339D078E3032B8596DA74BB0E23434F83E153D5ACD5DEF7D264F58EC685317BF50C93430791718D6E09CCC4804FFE4EEB5C6AD8E9B5DFD456EDE81081627A97FC2FAE9F1955377D7774E68EAB541B20CE3C915185BCA208EE08428C400043F2DC90B0390756762C9271946FCE214B9576F74399E466DAC48C6DD10B420F302941DCC27D55CF1FB59D71954950CAD893FFFA70970D128C77BFA34F3C84B0B64A01194A086ACDD9847D6B91B7F870D0E7591CA07F0B407005F1473C37A648F6E18044336F30418BA43FD7AA5B5BAE01A0E33B1EDA4487730F043E202DE44CB901BD3AED13D790D05F325C414831EB601BD918678C1B8E116877CE1167F87204B49619D323713F95C04CA9621FDCF44BD21C5E36A299C486C8FC0D3043EDFF424B9A7AA5500DC3BD7BF6FAB256E6B45B458058DC933F1FF8C5E841BFC7F405761E14B12B48C1C108F33BF8D65BB8DBB9ED7E92398E779333730F4C68922AA76409E842E76B649B981B8269186220ACFF9DFA198D62CBF4CFA0FE05C1427CE63A345A61FE460D14EF25D7A89E2E228B415757B4E4110B6AFA7D85D48C3BCF184FDD7366F06D9E3D29896B0D3C0D83FCFA881E6EC5F29B0294628EDFF284E58B7BE19D37A6B28D70DC0F165A4B60CE5536D76D1A71849C36B0837E4E5082A05208CEEB320C57F0F5B86DC3CAAC8A32DEA9552D +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/CFB +Source: NIST Special Publication 800-38A +IV: 000102030405060708090a0b0c0d0e0f +Plaintext: 6bc1bee22e409f96e93d7e117393172aae2d8 +FeedbackSize: 1 +Comment: F.3.7 CFB8-AES128.Encrypt +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 3b79424c9c0dd436bace9e0ed4586a4f32b9 +Test: Encrypt +Comment: F.3.9 CFB8-AES192.Encrypt +Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Ciphertext: cda2521ef0a905ca44cd057cbf0d47a0678a +Test: Encrypt +Comment: F.3.11 CFB8-AES256.Encrypt +Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Ciphertext: dc1f1a8520a64db55fcc8ac554844e889700 +Test: Encrypt +Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 +FeedbackSize: 16 +Comment: F.3.13 CFB128-AES128.Encrypt +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 3b3fd92eb72dad20333449f8e83cfb4a c8a64537a0b3a93fcde3cdad9f1ce58b 26751f67a3cbb140b1808cf187a4f4df c04b05357c5d1c0eeac4c66f9ff7f2e6 +Test: Encrypt +Comment: F.3.15 CFB128-AES192.Encrypt +Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Ciphertext: cdc80d6fddf18cab34c25909c99a4174 67ce7f7f81173621961a2b70171d3d7a 2e1e8a1dd59b88b1c8e60fed1efac4c9 c05f9f9ca9834fa042ae8fba584b09ff +Test: Encrypt +Comment: F.3.17 CFB128-AES256.Encrypt +Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Ciphertext: dc7e84bfda79164b7ecd8486985d3860 39ffed143b28b1c832113c6331e5407b df10132415e54b92a13ed0a8267ae2f9 75a385741ab9cef82031623d55b1e471 +Test: Encrypt + + +AlgorithmType: SymmetricCipher +Name: AES/CFB +Source: Generated by Crypto++ 5.6.1 +Comment: long test vector with odd length +IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: ECE71ECD7A4E3C2F643B2B0BFBED32F365C96D626048D13C65962ED08445B5EE74B11203E24C0ACCD3CC13F39963632D8F4B8F8BB16B7901373C32FFD27472957A8448E414A26BB10CAE9BCFBF332BA677D59C0CCD4CCE5B34298E2B1F3250092CF602B5476922D9FA13D4AE9F54841D889FE71D67A79315A621BDAECB2FD3F1ECDAB0DC9FBDFB85AE1633038A44E15DEF1B6DDBC4AB47BB128E1C2DE8A17FD1107D8587CE96088709E17DA23DE6993973A43DFB59801A9691B7EBF5565C4FF842F5132E99288FA4CE3E6CE9333DEE052212E71EF08C5E2E385A787F1567C0CD05A4D11BF40CA19B8D49A231AA55CDE1B8C531C9FCD3B9C70AABD65372E582FCE7528B6BD8F89AA6489B1F085AE024D5A964CAEC4F3F5726CBACDB5D8429F6741FE102BC27E10724C30A64A7D3ED11F6FF41908920A1326793C7C7EDDDD2F79D8A3CE804AE53E59E43B2E0E69AF69A79D7A97A12C0A1AC7331369FCE4072879AA998CD1DC6296CB02D4B97803F1F3713F922796148E2263AFA6A72CF30C3C00297ABF2AD2D559AC4D0011A839FAAA261BB17966E80FF243B65B6209C2732F294F33936A3B8FE7C9BEBE50686BBE7F0FDCF9E24281242B10844037D9AB8A342B954B69E6456243CC13959E1B014A1389BA69B9C4E1C0869C7FE3292ED72FCF183B216F7F5EB5A7CD0A2493BCA160AE6142F4CF03110CA4782CA6C8ED558CA8AF4B14ADC4C368FF0C0CD014F7E117F56D797EF45294C8D3BCED9D5D4E3FA60592031E2925ABA72DFE5AC1D88081DB6CF68DCB256A822CE891AD12F5BB34F39CE974F7D23C0B7AB3BF12D854DA60617EB5E479A9740E00A1DCA267A3D1D212F25A06B83106CBD624CC745ACB31E0EA774F6E0D765D6134F74A3AF5B3846649C14539B7C01B484C54F71B2C5016C2EA57B16472145511130D79E23271151F370DB8A626DB218F73FF0ABFE066E2782696F6984923AA074AEA9E059AEC18F50D4E03F4B17BAD856E6C962604A02 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/OFB +Source: NIST Special Publication 800-38A +IV: 000102030405060708090a0b0c0d0e0f +Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 +Comment: F.4.1 OFB-AES128.Encrypt +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 3b3fd92eb72dad20333449f8e83cfb4a 7789508d16918f03f53c52dac54ed825 9740051e9c5fecf64344f7a82260edcc 304c6528f659c77866a510d9c1d6ae5e +Test: Encrypt +Comment: F.4.3 OFB-AES192.Encrypt +Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Ciphertext: cdc80d6fddf18cab34c25909c99a4174 fcc28b8d4c63837c09e81700c1100401 8d9a9aeac0f6596f559c6d4daf59a5f2 6d9f200857ca6c3e9cac524bd9acc92a +Test: Encrypt +Comment: F.4.5 OFB-AES256.Encrypt +Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Ciphertext: dc7e84bfda79164b7ecd8486985d3860 4febdc6740d20b3ac88f6ad82a4fb08d 71ab47a086e86eedf39d1c5bba97c408 0126141d67f37be8538f5a8be740e484 +Test: Encrypt + + +AlgorithmType: SymmetricCipher +Name: AES/OFB +Source: Generated by Crypto++ 5.6.1 +Comment: long test vector with odd length +IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: ECE71ECD7A4E3C2F643B2B0BFBED32F3B3D63D91F8B99D5EA9D0AA2D977A8675EDD972802EB60B3D8FA629EF94358D46861CF60D9F89F481632F937182C78E49D53D132260CFC3A80943E0FD169C6091FF4BBBBDEC35F4A31DDB61AFA087750D6CFCF86DAB13330125D60A2732E43A2AF3E47ABE4824C5B17DD747F267149A321ADA13409D51D4FC685ADA6789D5785FCA5EF199FD96A03879B4147C4936CC32DE864520C98DD55408CA8ED4AF1BE1F133ED53CA9FF58E6862D3E900AE66EEF75272B547BBC8919CE5503981684FEBA088F5E73BF272C820656CC9627FB4E4FC3A92A6B815CAC558B3257614AA9BB2CF2409D3633B6570EEF67A9343502D2B528078E561782917D977E6F76B13CD6526512D3D4C803BBB58E54EED5B4057EAF85DE83A7EC53FACBCA7E03EB7E027910C8DA25B75BE33B41C0C594DF6D781E821193963C9F658D380A460561B2F0C9C3D7639A4E4EE2DA87653DA86FAD6D5280857CEC28CC40D082C81C672D9B36CD169A6803ACA4C8DAAD77953B296FBAF480FA146F8B41DCBD487A368851A207C90228DBF7BAEEB38F23F98520E52145D809DB530D3E690C2A91B8367B815C4FFC0AE7171582169D6A7FD073A1F9DE1182FC98D1D5B3E39B44E054218B80091333D5B751C0530BADF4361C5A95CB26634AE788F7B6D2CCA543FDE48172A24E4D991F9262CFB8ED09FFE4E1506DA6478EF879847F8CE44569A9AC66E124CEE5944D2DC87742CA1B598B3C7D54662F8A5783A0C6689C949C54E148C2C88DFBA4F10F0234BA62E4DDEA30F5AD3D209829CCB73C22141D56050FB75E0E7D1B822F6FFC6AB92E8DB12A5C6B62064B692F8B118CC38F0436433B5370CE5A79D09A7081703EEA59F64B7361AA50476DD2F7074CA37C51935DCBC78A806F92C1186033070D5C3FABACAAE39CB7FBA0654D13413E94F6E9FDDB7D2D4EC1985CCF2E2011C186BD0C16AA95A0C7FDDF1B36490780EB646EEB7B0B377E970FD7D2E9A06 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/CTR +Source: NIST Special Publication 800-38A +IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 +Comment: F.5.1 CTR-AES128.Encrypt +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: 874d6191b620e3261bef6864990db6ce 9806f66b7970fdff8617187bb9fffdff 5ae4df3edbd5d35e5b4f09020db03eab 1e031dda2fbe03d1792170a0f3009cee +Test: Encrypt +Comment: F.5.3 CTR-AES192.Encrypt +Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Ciphertext: 1abc932417521ca24f2b0459fe7e6e0b 090339ec0aa6faefd5ccc2c6f4ce8e94 1e36b26bd1ebc670d1bd1d665620abf7 4f78a7f6d29809585a97daec58c6b050 +Test: Encrypt +Comment: F.5.5 CTR-AES256.Encrypt +Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Ciphertext: 601ec313775789a5b7a7f504bbf3d228 f443e3ca4d62b59aca84e990cacaf5c5 2b0930daa23de94ce87017ba2d84988d dfc9c58db67aada613c2dd08457941a6 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/CTR +Source: RFC 3686 +#Test Vector #1: Encrypting 16 octets using AES-CTR with 128-bit key +Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E +Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 +IV: 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 01 +Ciphertext : E4 09 5D 4F B7 A7 B3 79 2D 61 75 A3 26 13 11 B8 +Test: Encrypt +#Test Vector #2: Encrypting 32 octets using AES-CTR with 128-bit key +Key : 7E 24 06 78 17 FA E0 D7 43 D6 CE 1F 32 53 91 63 +Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +IV: 00 6C B6 DB C0 54 3B 59 DA 48 D9 0B 00 00 00 01 +Ciphertext : 51 04 A1 06 16 8A 72 D9 79 0D 41 EE 8E DA D3 88 EB 2E 1E FC 46 DA 57 C8 FC E6 30 DF 91 41 BE 28 +Test: Encrypt +#Test Vector #3: Encrypting 36 octets using AES-CTR with 128-bit key +Key : 76 91 BE 03 5E 50 20 A8 AC 6E 61 85 29 F9 A0 DC +Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 +IV: 00 E0 01 7B 27 77 7F 3F 4A 17 86 F0 00 00 00 01 +Ciphertext : C1 CF 48 A8 9F 2F FD D9 CF 46 52 E9 EF DB 72 D7 45 40 A4 2B DE 6D 78 36 D5 9A 5C EA AE F3 10 53 25 B2 07 2F +Test: Encrypt +#Test Vector #4: Encrypting 16 octets using AES-CTR with 192-bit key +Key : 16 AF 5B 14 5F C9 F5 79 C1 75 F9 3E 3B FB 0E ED 86 3D 06 CC FD B7 85 15 +Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 +IV: 00 00 00 48 36 73 3C 14 7D 6D 93 CB 00 00 00 01 +Ciphertext : 4B 55 38 4F E2 59 C9 C8 4E 79 35 A0 03 CB E9 28 +Test: Encrypt +#Test Vector #5: Encrypting 32 octets using AES-CTR with 192-bit key +Key : 7C 5C B2 40 1B 3D C3 3C 19 E7 34 08 19 E0 F6 9C 67 8C 3D B8 E6 F6 A9 1A +Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +IV: 00 96 B0 3B 02 0C 6E AD C2 CB 50 0D 00 00 00 01 +Ciphertext : 45 32 43 FC 60 9B 23 32 7E DF AA FA 71 31 CD 9F 84 90 70 1C 5A D4 A7 9C FC 1F E0 FF 42 F4 FB 00 +Test: Encrypt +#Test Vector #6: Encrypting 36 octets using AES-CTR with 192-bit key +Key : 02 BF 39 1E E8 EC B1 59 B9 59 61 7B 09 65 27 9B F5 9B 60 A7 86 D3 E0 FE +Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 +IV: 00 07 BD FD 5C BD 60 27 8D CC 09 12 00 00 00 01 +Ciphertext : 96 89 3F C5 5E 5C 72 2F 54 0B 7D D1 DD F7 E7 58 D2 88 BC 95 C6 91 65 88 45 36 C8 11 66 2F 21 88 AB EE 09 35 +Test: Encrypt +#Test Vector #7: Encrypting 16 octets using AES-CTR with 256-bit key +Key : 77 6B EF F2 85 1D B0 6F 4C 8A 05 42 C8 69 6F 6C 6A 81 AF 1E EC 96 B4 D3 7F C1 D6 89 E6 C1 C1 04 +Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 +IV: 00 00 00 60 DB 56 72 C9 7A A8 F0 B2 00 00 00 01 +Ciphertext : 14 5A D0 1D BF 82 4E C7 56 08 63 DC 71 E3 E0 C0 +Test: Encrypt +#Test Vector #8: Encrypting 32 octets using AES-CTR with 256-bit key +Key : F6 D6 6D 6B D5 2D 59 BB 07 96 36 58 79 EF F8 86 C6 6D D5 1A 5B 6A 99 74 4B 50 59 0C 87 A2 38 84 +Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +IV: 00 FA AC 24 C1 58 5E F1 5A 43 D8 75 00 00 00 01 +Ciphertext : F0 5E 23 1B 38 94 61 2C 49 EE 00 0B 80 4E B2 A9 B8 30 6B 50 8F 83 9D 6A 55 30 83 1D 93 44 AF 1C +Test: Encrypt +#Test Vector #9: Encrypting 36 octets using AES-CTR with 256-bit key +Key : FF 7A 61 7C E6 91 48 E4 F1 72 6E 2F 43 58 1D E2 AA 62 D9 F8 05 53 2E DF F1 EE D6 87 FB 54 15 3D +Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 +IV: 00 1C C5 B7 51 A5 1D 70 A1 C1 11 48 00 00 00 01 +Ciphertext : EB 6C 52 82 1D 0B BB F7 CE 75 94 46 2A CA 4F AA B4 07 DF 86 65 69 FD 07 F4 8C C0 B5 83 D6 07 1F 1E C0 E6 B8 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: AES/CTR +Source: Generated by Crypto++ 5.6.1 +Comment: long test vector with odd length +IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: ECE71ECD7A4E3C2F643B2B0BFBED32F31C8551B6306D52CF843EC0B85015DC203B1C0B643E2A6BABAF5133DA0EA06616076AA6BBB52ED75DC3A71A9A6E8AC7C9A00D2C39AA68BF4E6FFED9AAEE5AD6914FB3EA77C7B61FF6BF564F2F1225ACB4B5889CB1559888A5817849C382E168482F75381F63868C468E4D1583B1FE71DD808CB94D8150AAB9D530A0FC17CDE748E95545D8A033B2F61F1954D0C0226168022E1CD7E031C57D048AC560F152960F47705E174D956D4BB53AE80BFFCD1BD569ED8EFFA223C00558B702405F33E6E0EDB2D9B0C148A1441CC80D6ABBCE785AA1B9DAB7CB8832F1B12D2EE60EE2DFCA37942CA1724E5602B7B70525AC9662028A22DB234676615DB474538CBC8D197F38C88BCC4F9E8D207538CA18DE5F095420A2E4D5868CEBB8B34A9377DC52D119790B65210F1B346F5E00D9BD00A8847048913D80726B9B745D565E6284B986DBAEA997FFC5A0DE5051527D44B2C1266DBC9130A6EB15F37A0F00B6286D6678CA651C07743BD37F2E8F6A94F5ED8C63428AE4883A9695183807E104BC335C64FEAAC40A605913DF98FF44E0801B31A968CCE5DCAFADE1E017FA711E05FF5A54BFA1999C2C463F97A3A66B30211BD306C8911C98F8EE5EF47A54746A4D16B7C7424A6954B4FC3BCF1A41BDE8A19CE1027AE86A320D0E5E7D3C7E50CFD0C4665B811D86C313F09ADE5B4DBE017231859881E5873E9EDB2011CF5920D2F7277C4DE1AC430A1849F0B870A69ABE701B6D0B5123E5FF53395409177CF84BF41EC33C5E4BCC2CF29258DC7C260471AABDA49FDE62915758EE4E578D0F7698E6456BC144573739D5D508CC76B389359D2A0ECB5B7EE5FCB4C3151D5AF7C71819EA3DD5F36C7B27E551FD2373D07FFDC76A13FC4B10A6F29A83D6F465ACB6960671EACF21A3E1CB4411C4DAA0C2A87DAED28AEE60B7EC0258A9AF125F2DDC80B9877EFE0F372D9B832C786770A84EA1A07CB6E1A9907D651BBD0EFDEF2AFFC3 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/all.txt b/external/crypto++-5.6.3/TestVectors/all.txt new file mode 100644 index 000000000..e6e3d7bbf --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/all.txt @@ -0,0 +1,32 @@ +AlgorithmType: FileList +Name: all.txt collection +Test: TestVectors/tea.txt +Test: TestVectors/wake.txt +Test: TestVectors/camellia.txt +Test: TestVectors/shacal2.txt +Test: TestVectors/ttmac.txt +Test: TestVectors/whrlpool.txt +Test: TestVectors/dlies.txt +Test: TestVectors/dsa.txt +Test: TestVectors/dsa_1363.txt +Test: TestVectors/esign.txt +Test: TestVectors/hmac.txt +Test: TestVectors/nr.txt +Test: TestVectors/rsa_oaep.txt +Test: TestVectors/rsa_pkcs1_1_5.txt +Test: TestVectors/rsa_pss.txt +Test: TestVectors/rw.txt +Test: TestVectors/seal.txt +Test: TestVectors/sha.txt +Test: TestVectors/sha3.txt +Test: TestVectors/panama.txt +Test: TestVectors/aes.txt +Test: TestVectors/salsa.txt +Test: TestVectors/vmac.txt +Test: TestVectors/sosemanuk.txt +Test: TestVectors/ccm.txt +Test: TestVectors/gcm.txt +Test: TestVectors/cmac.txt +Test: TestVectors/eax.txt +Test: TestVectors/mars.txt +Test: TestVectors/hkdf.txt diff --git a/external/crypto++-5.6.3/TestVectors/camellia.txt b/external/crypto++-5.6.3/TestVectors/camellia.txt new file mode 100644 index 000000000..f88d05b7c --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/camellia.txt @@ -0,0 +1,8646 @@ +AlgorithmType: SymmetricCipher +Name: Camellia/ECB +Source: NESSIE submission +Comment: Tests with 128-bit keys +Comment: Set 1, vector 0 +Key: 80000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6C227F749319A3AA7DA235A9BBA05A2C +Test: Encrypt +Comment: Set 1, vector 1 +Key: 40000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F04D51E45E70FB6DEE0D16A204FBBA16 +Test: Encrypt +Comment: Set 1, vector 2 +Key: 20000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: ED44242E619F8C32EAA2D3641DA47EA4 +Test: Encrypt +Comment: Set 1, vector 3 +Key: 10000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AC640BBBF84CD3B8E8258BF66C210AE2 +Test: Encrypt +Comment: Set 1, vector 4 +Key: 08000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8A42BDA76C84B8960B23530100AFB748 +Test: Encrypt +Comment: Set 1, vector 5 +Key: 04000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1D20D15F3EE21EE6051803ADF83E31D7 +Test: Encrypt +Comment: Set 1, vector 6 +Key: 02000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6896B2FB85D26A243BB5697F6A764307 +Test: Encrypt +Comment: Set 1, vector 7 +Key: 01000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 43A865A61E1117008372932EA9CE8BB2 +Test: Encrypt +Comment: Set 1, vector 8 +Key: 00800000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CB5ECC200DDE8E9076A8AEA2250F49E4 +Test: Encrypt +Comment: Set 1, vector 9 +Key: 00400000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0B2A489718DC0B0E11F11C1D3913F4A8 +Test: Encrypt +Comment: Set 1, vector 10 +Key: 00200000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1D28A0A70B3C72ADC5B77487AD442873 +Test: Encrypt +Comment: Set 1, vector 11 +Key: 00100000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 26D344959095765A3DD6986B656F353D +Test: Encrypt +Comment: Set 1, vector 12 +Key: 00080000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 048248D32A74DB80DAF5642417F7832A +Test: Encrypt +Comment: Set 1, vector 13 +Key: 00040000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 44D400F8752F16B20DB95A959917B650 +Test: Encrypt +Comment: Set 1, vector 14 +Key: 00020000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E885DD9B2794459B2133BC84B59C2DED +Test: Encrypt +Comment: Set 1, vector 15 +Key: 00010000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 89D6E4182FD0DD7E4038710F597DD242 +Test: Encrypt +Comment: Set 1, vector 16 +Key: 00008000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7FE5BA5FF1D0EB81132A3DA0CD8E829D +Test: Encrypt +Comment: Set 1, vector 17 +Key: 00004000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 470FEDAAA6FFFCBC48AF8B3859B1E45F +Test: Encrypt +Comment: Set 1, vector 18 +Key: 00002000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B6FA2D9F41110E6914890AF888C36091 +Test: Encrypt +Comment: Set 1, vector 19 +Key: 00001000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 46D2C0FD0C3A4D2B5CA6BA5E14382DCA +Test: Encrypt +Comment: Set 1, vector 20 +Key: 00000800000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 730D700DCC5AB632DD9D92C6D1C18E5A +Test: Encrypt +Comment: Set 1, vector 21 +Key: 00000400000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 067D56D80AF5D2F24D84F518B8FC7920 +Test: Encrypt +Comment: Set 1, vector 22 +Key: 00000200000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 027F6EE9F54534E4C21F9263B68BAEA0 +Test: Encrypt +Comment: Set 1, vector 23 +Key: 00000100000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D115CB2324E8FDA3576DEE57E49CC315 +Test: Encrypt +Comment: Set 1, vector 24 +Key: 00000080000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0976DB57B27E4136743E58BCECFBC056 +Test: Encrypt +Comment: Set 1, vector 25 +Key: 00000040000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0C889DF89972EB42DB2BD2AAC335CCC8 +Test: Encrypt +Comment: Set 1, vector 26 +Key: 00000020000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CB6B80177047A3B2AC290A41B94174EF +Test: Encrypt +Comment: Set 1, vector 27 +Key: 00000010000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F816631F8FBC54ECDC1AB5323FF8424E +Test: Encrypt +Comment: Set 1, vector 28 +Key: 00000008000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 40CB64DF57D2A6BBCBD82DFCC749707D +Test: Encrypt +Comment: Set 1, vector 29 +Key: 00000004000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 885BD3C2DD560765B11F5A2D238E9F9A +Test: Encrypt +Comment: Set 1, vector 30 +Key: 00000002000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 877AAEF064555DE89C99B7C5A1326C62 +Test: Encrypt +Comment: Set 1, vector 31 +Key: 00000001000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AA4FBBE7A02020F5D81030E0EF7A460D +Test: Encrypt +Comment: Set 1, vector 32 +Key: 00000000800000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AA2759BC215E49F26008206F6F65B7AC +Test: Encrypt +Comment: Set 1, vector 33 +Key: 00000000400000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 419A8069C3D531475FF7F29AE049D57C +Test: Encrypt +Comment: Set 1, vector 34 +Key: 00000000200000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 455588067DB9088130C861F5BE9E15BF +Test: Encrypt +Comment: Set 1, vector 35 +Key: 00000000100000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FDD6967ADA65ED3E20718C451AE5AE34 +Test: Encrypt +Comment: Set 1, vector 36 +Key: 00000000080000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1C74228D2A82248CD29800B64BEFF97A +Test: Encrypt +Comment: Set 1, vector 37 +Key: 00000000040000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4B88B7FFB32B05840BE7B497377AFDAA +Test: Encrypt +Comment: Set 1, vector 38 +Key: 00000000020000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4D4EC4C728524DA2F366FC272AB2666A +Test: Encrypt +Comment: Set 1, vector 39 +Key: 00000000010000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4FA8A27ED16BF36FA296D8AB2B423C77 +Test: Encrypt +Comment: Set 1, vector 40 +Key: 00000000008000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 943B9D570D371A3D823B680BBDA9477D +Test: Encrypt +Comment: Set 1, vector 41 +Key: 00000000004000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DCC390F5E1CAADBE061D02929473D084 +Test: Encrypt +Comment: Set 1, vector 42 +Key: 00000000002000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9655F00C4A5C40DF401A3FF806575834 +Test: Encrypt +Comment: Set 1, vector 43 +Key: 00000000001000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FCC9F6B36DE6DD6AA578AD0B59DF5996 +Test: Encrypt +Comment: Set 1, vector 44 +Key: 00000000000800000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F573FF52ACAA16609E5B3C3C7353DA75 +Test: Encrypt +Comment: Set 1, vector 45 +Key: 00000000000400000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 203EF49006A7FC856FF7A7A3B953D999 +Test: Encrypt +Comment: Set 1, vector 46 +Key: 00000000000200000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 16659E823D942E99C83926C4055D896D +Test: Encrypt +Comment: Set 1, vector 47 +Key: 00000000000100000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 139D5DB9EF0119F4E5D11256C5ECB8B0 +Test: Encrypt +Comment: Set 1, vector 48 +Key: 00000000000080000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 63FB244962CCE915425EF1B31DE6AAE2 +Test: Encrypt +Comment: Set 1, vector 49 +Key: 00000000000040000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6F771C2DC848A106E907A990DABA0272 +Test: Encrypt +Comment: Set 1, vector 50 +Key: 00000000000020000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CFA1F114CF0D9C7DAD301B833962ABF2 +Test: Encrypt +Comment: Set 1, vector 51 +Key: 00000000000010000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 58A3BE61DA53D0AA8F33DE95E6F38A3F +Test: Encrypt +Comment: Set 1, vector 52 +Key: 00000000000008000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2FE96FCB3D845B568AE804B217F3498F +Test: Encrypt +Comment: Set 1, vector 53 +Key: 00000000000004000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FD74EB6621127D58FA44BA3E6EE7835D +Test: Encrypt +Comment: Set 1, vector 54 +Key: 00000000000002000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 834C0C5D8D88EE63C989AA1E66F4E18C +Test: Encrypt +Comment: Set 1, vector 55 +Key: 00000000000001000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FEF8E0097B9EB5CE6DE710F5742F7E4F +Test: Encrypt +Comment: Set 1, vector 56 +Key: 00000000000000800000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 75FCC55F284311B81D967618C2D35700 +Test: Encrypt +Comment: Set 1, vector 57 +Key: 00000000000000400000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 91AE4E35623A7F10383BF7448F1F74AD +Test: Encrypt +Comment: Set 1, vector 58 +Key: 00000000000000200000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8928B2B6967BA1B4230AA1EBA49D1A08 +Test: Encrypt +Comment: Set 1, vector 59 +Key: 00000000000000100000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 707EA08174ED5C0AD0A74363B403F02D +Test: Encrypt +Comment: Set 1, vector 60 +Key: 00000000000000080000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7C0C13410DDE30C0AD3565FFAA33E8AD +Test: Encrypt +Comment: Set 1, vector 61 +Key: 00000000000000040000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 56DA72C545C490A749C66BCC5D90AACD +Test: Encrypt +Comment: Set 1, vector 62 +Key: 00000000000000020000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2CC0CF6E2AAA7916AF636B1546BA1179 +Test: Encrypt +Comment: Set 1, vector 63 +Key: 00000000000000010000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A19FE617883D409B1F78882E0D5EF39C +Test: Encrypt +Comment: Set 1, vector 64 +Key: 00000000000000008000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2B8586BBB979CFFAC5A76C25D77C1E2C +Test: Encrypt +Comment: Set 1, vector 65 +Key: 00000000000000004000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5A08C9B5A2940E3ACD1086867E3E4733 +Test: Encrypt +Comment: Set 1, vector 66 +Key: 00000000000000002000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7443F1072833BFC8AA38CBF6963CF880 +Test: Encrypt +Comment: Set 1, vector 67 +Key: 00000000000000001000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6809A1F2D2B5367D5E8442E7972BD1D4 +Test: Encrypt +Comment: Set 1, vector 68 +Key: 00000000000000000800000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A61D4FE41D5DBB7A6BCE5984502CD767 +Test: Encrypt +Comment: Set 1, vector 69 +Key: 00000000000000000400000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 30D86F43B81F4D2098A4D43AB2637549 +Test: Encrypt +Comment: Set 1, vector 70 +Key: 00000000000000000200000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5B16E9033FA40BF141D3EE73FF7E2564 +Test: Encrypt +Comment: Set 1, vector 71 +Key: 00000000000000000100000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 15574EF70C880682DBFBD93FAE8023F6 +Test: Encrypt +Comment: Set 1, vector 72 +Key: 00000000000000000080000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0D8D220DB69B15FFE2001B3F42E910EA +Test: Encrypt +Comment: Set 1, vector 73 +Key: 00000000000000000040000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 030AB24DA9E4ADD4E350E692077A948C +Test: Encrypt +Comment: Set 1, vector 74 +Key: 00000000000000000020000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7F6509A9FD8525126BFB69AFE8624A96 +Test: Encrypt +Comment: Set 1, vector 75 +Key: 00000000000000000010000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9600EB0B7E38A5ABEBBDADD3DFC70298 +Test: Encrypt +Comment: Set 1, vector 76 +Key: 00000000000000000008000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3CF0F71B4687AAABEB9FA8CDE00B17D7 +Test: Encrypt +Comment: Set 1, vector 77 +Key: 00000000000000000004000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8B1C549A655C0041D866B7875A2736CB +Test: Encrypt +Comment: Set 1, vector 78 +Key: 00000000000000000002000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8F507233FBC9E1DBF716FB4C828DBF06 +Test: Encrypt +Comment: Set 1, vector 79 +Key: 00000000000000000001000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 14A45A121DC8996020C29A040FE8E52D +Test: Encrypt +Comment: Set 1, vector 80 +Key: 00000000000000000000800000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 32390FB6FC15BB4B37D1CD8817BAEB09 +Test: Encrypt +Comment: Set 1, vector 81 +Key: 00000000000000000000400000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9E61986F3F4C31132D436CCFCF751043 +Test: Encrypt +Comment: Set 1, vector 82 +Key: 00000000000000000000200000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 24E63FAD370974C60330F7C3071938F1 +Test: Encrypt +Comment: Set 1, vector 83 +Key: 00000000000000000000100000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3CE71D4E9F2F7EF9A6F9F2548C5489CC +Test: Encrypt +Comment: Set 1, vector 84 +Key: 00000000000000000000080000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E42436B8E076A00600DFD67B8C427DB1 +Test: Encrypt +Comment: Set 1, vector 85 +Key: 00000000000000000000040000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5C2577FA8104DCC58ACE852B4D11FE24 +Test: Encrypt +Comment: Set 1, vector 86 +Key: 00000000000000000000020000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 12FC9DD7132B3BB346C53FD193531638 +Test: Encrypt +Comment: Set 1, vector 87 +Key: 00000000000000000000010000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5D91F775E26599F26B21F9FB1F67DA38 +Test: Encrypt +Comment: Set 1, vector 88 +Key: 00000000000000000000008000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D4B3683AA62D2EF0331A960A0BF01A29 +Test: Encrypt +Comment: Set 1, vector 89 +Key: 00000000000000000000004000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EE32582D35DDF3A82142ED18FEE38014 +Test: Encrypt +Comment: Set 1, vector 90 +Key: 00000000000000000000002000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 148632AE69514D5776DA4AF38E1AE4FD +Test: Encrypt +Comment: Set 1, vector 91 +Key: 00000000000000000000001000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 30A3EE1AA1CA17B128DAAF06AF9025BD +Test: Encrypt +Comment: Set 1, vector 92 +Key: 00000000000000000000000800000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 88D82D9E508CBFB392E47E524BB33019 +Test: Encrypt +Comment: Set 1, vector 93 +Key: 00000000000000000000000400000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0C20870A9FC751F6E41F92305B7C4D92 +Test: Encrypt +Comment: Set 1, vector 94 +Key: 00000000000000000000000200000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6A4EDE5FD13F3676C1BCF8B73AB273CB +Test: Encrypt +Comment: Set 1, vector 95 +Key: 00000000000000000000000100000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5A62CE50EA837CA4FD0F7304D1572D22 +Test: Encrypt +Comment: Set 1, vector 96 +Key: 00000000000000000000000080000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 84DB8599B48ED4F39E872F13F7FCDF0B +Test: Encrypt +Comment: Set 1, vector 97 +Key: 00000000000000000000000040000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CDD25F8276411E892035C9703C7588EE +Test: Encrypt +Comment: Set 1, vector 98 +Key: 00000000000000000000000020000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 73BCFB16436B5C52CD4BC9629F75C5C8 +Test: Encrypt +Comment: Set 1, vector 99 +Key: 00000000000000000000000010000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 03752D935029B09699C29CA5C6E79553 +Test: Encrypt +Comment: Set 1, vector 100 +Key: 00000000000000000000000008000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EF439A1B86698409E91D992BDB3F54E5 +Test: Encrypt +Comment: Set 1, vector 101 +Key: 00000000000000000000000004000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2A34BDE7EC74221BFF58B251E54F089F +Test: Encrypt +Comment: Set 1, vector 102 +Key: 00000000000000000000000002000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 35FBB78716B78FB57F96BC8A5D869B72 +Test: Encrypt +Comment: Set 1, vector 103 +Key: 00000000000000000000000001000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AC3A7363DFB6C3F06CCCA1A46F44A5F8 +Test: Encrypt +Comment: Set 1, vector 104 +Key: 00000000000000000000000000800000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4895E1B7E54CA168CE42E3994D564B62 +Test: Encrypt +Comment: Set 1, vector 105 +Key: 00000000000000000000000000400000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E98956EFC457FE8AA103DB303A3B1DF1 +Test: Encrypt +Comment: Set 1, vector 106 +Key: 00000000000000000000000000200000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 276646992D6E752A649183DB05073422 +Test: Encrypt +Comment: Set 1, vector 107 +Key: 00000000000000000000000000100000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 82F36DE401E21D01A476A163A92F4B16 +Test: Encrypt +Comment: Set 1, vector 108 +Key: 00000000000000000000000000080000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E54DD90800B92153C314F8B1590B17E5 +Test: Encrypt +Comment: Set 1, vector 109 +Key: 00000000000000000000000000040000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F4A146DFB33405EC6B8F37AEB10F5198 +Test: Encrypt +Comment: Set 1, vector 110 +Key: 00000000000000000000000000020000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C332ADBC2D44FA1A1A4F7C8EAE2CED29 +Test: Encrypt +Comment: Set 1, vector 111 +Key: 00000000000000000000000000010000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 21AA542624DA9F2363404CE42BC2BAEF +Test: Encrypt +Comment: Set 1, vector 112 +Key: 00000000000000000000000000008000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E101DBEF627038AE819441D133AEE068 +Test: Encrypt +Comment: Set 1, vector 113 +Key: 00000000000000000000000000004000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7A9B635E6AA5D273DE697747FE6BB08E +Test: Encrypt +Comment: Set 1, vector 114 +Key: 00000000000000000000000000002000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0541AA347D36F03D9177FC91398874DB +Test: Encrypt +Comment: Set 1, vector 115 +Key: 00000000000000000000000000001000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BE27D6FE099AB98BF07A74A1ABF5C945 +Test: Encrypt +Comment: Set 1, vector 116 +Key: 00000000000000000000000000000800 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 472ACD81A6626822E220F431C4491704 +Test: Encrypt +Comment: Set 1, vector 117 +Key: 00000000000000000000000000000400 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2D5152F19E29AD7D5823CDCA188E0CD8 +Test: Encrypt +Comment: Set 1, vector 118 +Key: 00000000000000000000000000000200 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 875C90B3669DF8F4867B6769689656E7 +Test: Encrypt +Comment: Set 1, vector 119 +Key: 00000000000000000000000000000100 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 59641CA52EEBC2C229930CE42529277F +Test: Encrypt +Comment: Set 1, vector 120 +Key: 00000000000000000000000000000080 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A3B4D666AC56C284D40DC27FDB0F787C +Test: Encrypt +Comment: Set 1, vector 121 +Key: 00000000000000000000000000000040 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0511D526FC5F255F51F1914B4B12AD84 +Test: Encrypt +Comment: Set 1, vector 122 +Key: 00000000000000000000000000000020 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2D14332989F629DA4720ECC916B4DAF0 +Test: Encrypt +Comment: Set 1, vector 123 +Key: 00000000000000000000000000000010 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C44EAC8457E2F17E9BC86EB4C436E8DB +Test: Encrypt +Comment: Set 1, vector 124 +Key: 00000000000000000000000000000008 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 022F3EB45AAA39F785FF80B6A3006BF6 +Test: Encrypt +Comment: Set 1, vector 125 +Key: 00000000000000000000000000000004 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B8A714C8F8427767B384B0E2F6BAF619 +Test: Encrypt +Comment: Set 1, vector 126 +Key: 00000000000000000000000000000002 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 01F745A7C09FECD3497F087BD52A9A0F +Test: Encrypt +Comment: Set 1, vector 127 +Key: 00000000000000000000000000000001 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 41E0E6DC2DDEC65D8B8120E60977B82D +Test: Encrypt +Comment: Set 2, vector 0 +Key: 00000000000000000000000000000000 +Plaintext: 80000000000000000000000000000000 +Ciphertext: 07923A39EB0A817D1C4D87BDB82D1F1C +Test: Encrypt +Comment: Set 2, vector 1 +Key: 00000000000000000000000000000000 +Plaintext: 40000000000000000000000000000000 +Ciphertext: 48CD6419809672D2349260D89A08D3D3 +Test: Encrypt +Comment: Set 2, vector 2 +Key: 00000000000000000000000000000000 +Plaintext: 20000000000000000000000000000000 +Ciphertext: D07493CCB2E95CE0B4945A05ACC97D82 +Test: Encrypt +Comment: Set 2, vector 3 +Key: 00000000000000000000000000000000 +Plaintext: 10000000000000000000000000000000 +Ciphertext: 5DBE1EAC9F7080A88DBED7F6DA101448 +Test: Encrypt +Comment: Set 2, vector 4 +Key: 00000000000000000000000000000000 +Plaintext: 08000000000000000000000000000000 +Ciphertext: F01EE477D199DF2701027034B229622F +Test: Encrypt +Comment: Set 2, vector 5 +Key: 00000000000000000000000000000000 +Plaintext: 04000000000000000000000000000000 +Ciphertext: C841587ABD9A912E563774CB569D051E +Test: Encrypt +Comment: Set 2, vector 6 +Key: 00000000000000000000000000000000 +Plaintext: 02000000000000000000000000000000 +Ciphertext: 1D9BC0C04546F0915C8CCD11391A455C +Test: Encrypt +Comment: Set 2, vector 7 +Key: 00000000000000000000000000000000 +Plaintext: 01000000000000000000000000000000 +Ciphertext: 05E6EBB4BA167F5C479CEFF3152F943B +Test: Encrypt +Comment: Set 2, vector 8 +Key: 00000000000000000000000000000000 +Plaintext: 00800000000000000000000000000000 +Ciphertext: 93211E0F788845B9FC0E4551FFE92AC9 +Test: Encrypt +Comment: Set 2, vector 9 +Key: 00000000000000000000000000000000 +Plaintext: 00400000000000000000000000000000 +Ciphertext: B6D35701CD8FADDE383BBE8E6B70BAF7 +Test: Encrypt +Comment: Set 2, vector 10 +Key: 00000000000000000000000000000000 +Plaintext: 00200000000000000000000000000000 +Ciphertext: 8358F9F4EBCFEE348CB30551ACB151A0 +Test: Encrypt +Comment: Set 2, vector 11 +Key: 00000000000000000000000000000000 +Plaintext: 00100000000000000000000000000000 +Ciphertext: D57516EB5AD93C523E40521BF447AFCE +Test: Encrypt +Comment: Set 2, vector 12 +Key: 00000000000000000000000000000000 +Plaintext: 00080000000000000000000000000000 +Ciphertext: 66B2534C279C439133F52E5AD8B439A9 +Test: Encrypt +Comment: Set 2, vector 13 +Key: 00000000000000000000000000000000 +Plaintext: 00040000000000000000000000000000 +Ciphertext: A71C69184A9F63C2992A5F18F77C1FE9 +Test: Encrypt +Comment: Set 2, vector 14 +Key: 00000000000000000000000000000000 +Plaintext: 00020000000000000000000000000000 +Ciphertext: 1ADCBE49AEACB9ECEBBD492B10E82C7B +Test: Encrypt +Comment: Set 2, vector 15 +Key: 00000000000000000000000000000000 +Plaintext: 00010000000000000000000000000000 +Ciphertext: 27E3BCFB227C5561DB6CF7FC30387036 +Test: Encrypt +Comment: Set 2, vector 16 +Key: 00000000000000000000000000000000 +Plaintext: 00008000000000000000000000000000 +Ciphertext: F4AE20365CC9D06B0CAE6B695ED2CEC1 +Test: Encrypt +Comment: Set 2, vector 17 +Key: 00000000000000000000000000000000 +Plaintext: 00004000000000000000000000000000 +Ciphertext: 3DD682F0B641ED32AD3D43EA2A0456E4 +Test: Encrypt +Comment: Set 2, vector 18 +Key: 00000000000000000000000000000000 +Plaintext: 00002000000000000000000000000000 +Ciphertext: 6E5D14A95ECC290B509EA6B673652E3A +Test: Encrypt +Comment: Set 2, vector 19 +Key: 00000000000000000000000000000000 +Plaintext: 00001000000000000000000000000000 +Ciphertext: F1CDF0F8D7B3FFD95422D7CC0CF40B7B +Test: Encrypt +Comment: Set 2, vector 20 +Key: 00000000000000000000000000000000 +Plaintext: 00000800000000000000000000000000 +Ciphertext: A9253D459A34C385A1F1B2CFFA3935C5 +Test: Encrypt +Comment: Set 2, vector 21 +Key: 00000000000000000000000000000000 +Plaintext: 00000400000000000000000000000000 +Ciphertext: 291024D99FF09A47A1DEE45BA700AE52 +Test: Encrypt +Comment: Set 2, vector 22 +Key: 00000000000000000000000000000000 +Plaintext: 00000200000000000000000000000000 +Ciphertext: 49241D9459B277187BB10081C60361C0 +Test: Encrypt +Comment: Set 2, vector 23 +Key: 00000000000000000000000000000000 +Plaintext: 00000100000000000000000000000000 +Ciphertext: AD9BA365CC4DD5553D2D9FE303841D88 +Test: Encrypt +Comment: Set 2, vector 24 +Key: 00000000000000000000000000000000 +Plaintext: 00000080000000000000000000000000 +Ciphertext: C2ECA616664A249DC622CC11196B4AE1 +Test: Encrypt +Comment: Set 2, vector 25 +Key: 00000000000000000000000000000000 +Plaintext: 00000040000000000000000000000000 +Ciphertext: 6E1A2D4794BB0DC08777A0BC7523E70E +Test: Encrypt +Comment: Set 2, vector 26 +Key: 00000000000000000000000000000000 +Plaintext: 00000020000000000000000000000000 +Ciphertext: 6DB1F0CF59656BDD235E82B8CEF0BE8E +Test: Encrypt +Comment: Set 2, vector 27 +Key: 00000000000000000000000000000000 +Plaintext: 00000010000000000000000000000000 +Ciphertext: 52F239C5EAF401EBDC54D2F011FF4B6A +Test: Encrypt +Comment: Set 2, vector 28 +Key: 00000000000000000000000000000000 +Plaintext: 00000008000000000000000000000000 +Ciphertext: 6B58A08F648414B67FD6847D2AA51CBF +Test: Encrypt +Comment: Set 2, vector 29 +Key: 00000000000000000000000000000000 +Plaintext: 00000004000000000000000000000000 +Ciphertext: 2959DD5367885A75EB48053CF3251A36 +Test: Encrypt +Comment: Set 2, vector 30 +Key: 00000000000000000000000000000000 +Plaintext: 00000002000000000000000000000000 +Ciphertext: 630B292E3B88EF641CDFD531E206605E +Test: Encrypt +Comment: Set 2, vector 31 +Key: 00000000000000000000000000000000 +Plaintext: 00000001000000000000000000000000 +Ciphertext: 4BBB88EF82B70593FCC56AFD91540FDB +Test: Encrypt +Comment: Set 2, vector 32 +Key: 00000000000000000000000000000000 +Plaintext: 00000000800000000000000000000000 +Ciphertext: 0A13055B118A45C606999257BD191426 +Test: Encrypt +Comment: Set 2, vector 33 +Key: 00000000000000000000000000000000 +Plaintext: 00000000400000000000000000000000 +Ciphertext: 5CF8E5C9F15D7E4F865020224853EB77 +Test: Encrypt +Comment: Set 2, vector 34 +Key: 00000000000000000000000000000000 +Plaintext: 00000000200000000000000000000000 +Ciphertext: 3898805042C7A4315C5EE51AF2DE47E2 +Test: Encrypt +Comment: Set 2, vector 35 +Key: 00000000000000000000000000000000 +Plaintext: 00000000100000000000000000000000 +Ciphertext: 8D3F96372E87CBB0B375425B3A10B9E7 +Test: Encrypt +Comment: Set 2, vector 36 +Key: 00000000000000000000000000000000 +Plaintext: 00000000080000000000000000000000 +Ciphertext: 4D9510A378BD784A70A66BCC75B7D3C8 +Test: Encrypt +Comment: Set 2, vector 37 +Key: 00000000000000000000000000000000 +Plaintext: 00000000040000000000000000000000 +Ciphertext: 70DB1902D37CFBDFB98F7C516F79D416 +Test: Encrypt +Comment: Set 2, vector 38 +Key: 00000000000000000000000000000000 +Plaintext: 00000000020000000000000000000000 +Ciphertext: 383C6C2AABEF7FDE25CD470BF774A331 +Test: Encrypt +Comment: Set 2, vector 39 +Key: 00000000000000000000000000000000 +Plaintext: 00000000010000000000000000000000 +Ciphertext: 47CBCB5288349B1A15DC9F81FBEE6B8F +Test: Encrypt +Comment: Set 2, vector 40 +Key: 00000000000000000000000000000000 +Plaintext: 00000000008000000000000000000000 +Ciphertext: 21DA34D4468EEB13AED95DAE0FF48310 +Test: Encrypt +Comment: Set 2, vector 41 +Key: 00000000000000000000000000000000 +Plaintext: 00000000004000000000000000000000 +Ciphertext: 021C9A8E6BD36FBD036411E5D852A80F +Test: Encrypt +Comment: Set 2, vector 42 +Key: 00000000000000000000000000000000 +Plaintext: 00000000002000000000000000000000 +Ciphertext: 6A459E2F839AF60ACDE83774D0BB5574 +Test: Encrypt +Comment: Set 2, vector 43 +Key: 00000000000000000000000000000000 +Plaintext: 00000000001000000000000000000000 +Ciphertext: C19255121F1B933CAE09E58AEC0E9977 +Test: Encrypt +Comment: Set 2, vector 44 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000800000000000000000000 +Ciphertext: 7BA949E27B2BE148A6B801F9305F43D5 +Test: Encrypt +Comment: Set 2, vector 45 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000400000000000000000000 +Ciphertext: E8CEB1026BCF7BCEA32E8A380EA76DB7 +Test: Encrypt +Comment: Set 2, vector 46 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000200000000000000000000 +Ciphertext: 63F97747ED56A8F521B20CC65F6F9465 +Test: Encrypt +Comment: Set 2, vector 47 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000100000000000000000000 +Ciphertext: 2091CFDC629819106188424AC694F75B +Test: Encrypt +Comment: Set 2, vector 48 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000080000000000000000000 +Ciphertext: A91BDF8E8B88407942423CCE000527C4 +Test: Encrypt +Comment: Set 2, vector 49 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000040000000000000000000 +Ciphertext: 73F9B44B9635A3FD683DBF8D49E9825B +Test: Encrypt +Comment: Set 2, vector 50 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000020000000000000000000 +Ciphertext: 9DC64B2133FAD5069FD9A7CC2FFFD1CC +Test: Encrypt +Comment: Set 2, vector 51 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000010000000000000000000 +Ciphertext: 28240F81FEC36B71E13F1FEA7A7641E3 +Test: Encrypt +Comment: Set 2, vector 52 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000008000000000000000000 +Ciphertext: 20DD39FEE96CD2EFF972872A692B28FD +Test: Encrypt +Comment: Set 2, vector 53 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000004000000000000000000 +Ciphertext: 47A9E40483EC1925B635E47E964E8E93 +Test: Encrypt +Comment: Set 2, vector 54 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000002000000000000000000 +Ciphertext: 9C0EBD822C49FB3D853DF5B315A87BA0 +Test: Encrypt +Comment: Set 2, vector 55 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000001000000000000000000 +Ciphertext: C18D813FDB45A594C6DC24E5A1F6CE32 +Test: Encrypt +Comment: Set 2, vector 56 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000800000000000000000 +Ciphertext: 7E5467FF245ECF80CB55C2D8E91F0711 +Test: Encrypt +Comment: Set 2, vector 57 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000400000000000000000 +Ciphertext: 394D4365B77954FDEA4145FCF7A7A041 +Test: Encrypt +Comment: Set 2, vector 58 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000200000000000000000 +Ciphertext: B1D8311A492ED11F11E57B29221610C4 +Test: Encrypt +Comment: Set 2, vector 59 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000100000000000000000 +Ciphertext: E5FBB947A63AEA90163AF04AD6951EF8 +Test: Encrypt +Comment: Set 2, vector 60 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000080000000000000000 +Ciphertext: CA0627DDF580F0E7D59562825C9D0492 +Test: Encrypt +Comment: Set 2, vector 61 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000040000000000000000 +Ciphertext: EF98FFD1AED295AAE1860F0274C8F555 +Test: Encrypt +Comment: Set 2, vector 62 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000020000000000000000 +Ciphertext: 8C698E5CFFF08FACE10C2DC5FF1E2A81 +Test: Encrypt +Comment: Set 2, vector 63 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000010000000000000000 +Ciphertext: 35A7767E02032C35B5CE1A6F49C57C28 +Test: Encrypt +Comment: Set 2, vector 64 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000008000000000000000 +Ciphertext: AB36F8734E76EBA306CF00D6763D90B0 +Test: Encrypt +Comment: Set 2, vector 65 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000004000000000000000 +Ciphertext: E854EB66D4EC66889B5E6CD4F44A5806 +Test: Encrypt +Comment: Set 2, vector 66 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000002000000000000000 +Ciphertext: 15B66DF1455ACD640B8716BCF5DB2D69 +Test: Encrypt +Comment: Set 2, vector 67 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000001000000000000000 +Ciphertext: 4C57AB5333E5C2D4B7E30A007E449F48 +Test: Encrypt +Comment: Set 2, vector 68 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000800000000000000 +Ciphertext: BA3E7FF28EB38EA09D8DB1440A9A3552 +Test: Encrypt +Comment: Set 2, vector 69 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000400000000000000 +Ciphertext: 64E60227AFD80C40C70186CC94804C1A +Test: Encrypt +Comment: Set 2, vector 70 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000200000000000000 +Ciphertext: CEB4423C20B4C91C2551F6FC227C9514 +Test: Encrypt +Comment: Set 2, vector 71 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000100000000000000 +Ciphertext: F736894B843EF32DA28576DE500D448C +Test: Encrypt +Comment: Set 2, vector 72 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000080000000000000 +Ciphertext: 58FDA98B678D15053D4B6C060368108C +Test: Encrypt +Comment: Set 2, vector 73 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000040000000000000 +Ciphertext: E28CAE384E578F47657755EBCD97996C +Test: Encrypt +Comment: Set 2, vector 74 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000020000000000000 +Ciphertext: 0A64617BD4B5B166668240D105B7B6A2 +Test: Encrypt +Comment: Set 2, vector 75 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000010000000000000 +Ciphertext: 4BD090C7E3D365B5EA80F19B4798881E +Test: Encrypt +Comment: Set 2, vector 76 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000008000000000000 +Ciphertext: BC7B6CB9BFF4F72973BB2CD20A512C06 +Test: Encrypt +Comment: Set 2, vector 77 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000004000000000000 +Ciphertext: 4C7ADDC5C867594E9EE75F0AA6AB9C23 +Test: Encrypt +Comment: Set 2, vector 78 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000002000000000000 +Ciphertext: 1FBD05C71A36691AC6566A5298101D53 +Test: Encrypt +Comment: Set 2, vector 79 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000001000000000000 +Ciphertext: 42D7D6B1F499D412F8793972BD968DA2 +Test: Encrypt +Comment: Set 2, vector 80 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000800000000000 +Ciphertext: 260EC86E2786FC68824576B934F32814 +Test: Encrypt +Comment: Set 2, vector 81 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000400000000000 +Ciphertext: 576C26DFD7046F9357F34BEA7DFB26A0 +Test: Encrypt +Comment: Set 2, vector 82 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000200000000000 +Ciphertext: 6D55E54BFB6F927174A02294C95E0F8F +Test: Encrypt +Comment: Set 2, vector 83 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000100000000000 +Ciphertext: 1A6CE91DD458229C7675A34950D10E23 +Test: Encrypt +Comment: Set 2, vector 84 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000080000000000 +Ciphertext: DAD0D5E7E000652825AA34D228EA8D8F +Test: Encrypt +Comment: Set 2, vector 85 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000040000000000 +Ciphertext: E68013F48D75EAD2BBC0B0BDA5E690BF +Test: Encrypt +Comment: Set 2, vector 86 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000020000000000 +Ciphertext: A07D92312FBAE37BFE8A834210AE4F9C +Test: Encrypt +Comment: Set 2, vector 87 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000010000000000 +Ciphertext: 6EEE5F8544CD7D456366EB448813989A +Test: Encrypt +Comment: Set 2, vector 88 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000008000000000 +Ciphertext: F8E5C7FF4B79D7ABE8BFA2DD148820A8 +Test: Encrypt +Comment: Set 2, vector 89 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000004000000000 +Ciphertext: C6349D75C7472BBD66F95B3A07C79C91 +Test: Encrypt +Comment: Set 2, vector 90 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000002000000000 +Ciphertext: B85713C12D8658951CD1AD21C74D2CD2 +Test: Encrypt +Comment: Set 2, vector 91 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000001000000000 +Ciphertext: 907AA00B9F7D47A97623FB55BA911F29 +Test: Encrypt +Comment: Set 2, vector 92 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000800000000 +Ciphertext: DC3CD0ED23D11776FAB43A2A6A8F3557 +Test: Encrypt +Comment: Set 2, vector 93 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000400000000 +Ciphertext: 4BFE58A8FD69179C14765B09AB70B705 +Test: Encrypt +Comment: Set 2, vector 94 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000200000000 +Ciphertext: A23996E0EA67EC280356E5F77130A551 +Test: Encrypt +Comment: Set 2, vector 95 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000100000000 +Ciphertext: CDEADE859B3AACD273CCA85A3E2E45F2 +Test: Encrypt +Comment: Set 2, vector 96 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000080000000 +Ciphertext: E0FC78489857D84DA03F40CE97147174 +Test: Encrypt +Comment: Set 2, vector 97 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000040000000 +Ciphertext: 7615EA6351F6BB12855E8579C6995D8E +Test: Encrypt +Comment: Set 2, vector 98 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000020000000 +Ciphertext: 13E184344FE28C2E70ED0E4D0A8037F9 +Test: Encrypt +Comment: Set 2, vector 99 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000010000000 +Ciphertext: A5FE395F568482B87BC3EB208C81C942 +Test: Encrypt +Comment: Set 2, vector 100 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000008000000 +Ciphertext: B3103E11AF06C85565823F8CAA3159F6 +Test: Encrypt +Comment: Set 2, vector 101 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000004000000 +Ciphertext: 7EBC2234D271B89C519C396985300030 +Test: Encrypt +Comment: Set 2, vector 102 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000002000000 +Ciphertext: 0661D338F2E0C939BA1687820A768467 +Test: Encrypt +Comment: Set 2, vector 103 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000001000000 +Ciphertext: EC2B42667C0195A90715499617884DA5 +Test: Encrypt +Comment: Set 2, vector 104 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000800000 +Ciphertext: AE077BA19D24E7188DDD3682FF196892 +Test: Encrypt +Comment: Set 2, vector 105 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000400000 +Ciphertext: 98823C24B9C65A66073C7952DC2B4B5E +Test: Encrypt +Comment: Set 2, vector 106 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000200000 +Ciphertext: 6AB58432CBB3C2F503DA2D16796CC297 +Test: Encrypt +Comment: Set 2, vector 107 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000100000 +Ciphertext: EEB5EBB3A53E4196C2F22BC1A4DDF5E8 +Test: Encrypt +Comment: Set 2, vector 108 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000080000 +Ciphertext: 33DC40AC5FDC126D38878416AF6C0FA6 +Test: Encrypt +Comment: Set 2, vector 109 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000040000 +Ciphertext: 38EDDC08E18B4AD982CEA921D2765A9A +Test: Encrypt +Comment: Set 2, vector 110 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000020000 +Ciphertext: 7D6BEA038E9347C642E18631660A9558 +Test: Encrypt +Comment: Set 2, vector 111 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000010000 +Ciphertext: FDA57921A473B5EE3700AD5ADF035019 +Test: Encrypt +Comment: Set 2, vector 112 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000008000 +Ciphertext: 699B4812E200337E9C1D2C397F0DFE4E +Test: Encrypt +Comment: Set 2, vector 113 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000004000 +Ciphertext: 7A1EADF68B0807145D6C414852DECFC8 +Test: Encrypt +Comment: Set 2, vector 114 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000002000 +Ciphertext: 1645FFAA8AD76689C01DA8C40882781F +Test: Encrypt +Comment: Set 2, vector 115 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000001000 +Ciphertext: BA0C053BE702FA62FC66D8FEB12FC97E +Test: Encrypt +Comment: Set 2, vector 116 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000800 +Ciphertext: 841FD8AF69CF2C31F7D4D7B6959662B5 +Test: Encrypt +Comment: Set 2, vector 117 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000400 +Ciphertext: F675D59BDB33231861268F539829DA0B +Test: Encrypt +Comment: Set 2, vector 118 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000200 +Ciphertext: A4967F45ABB4E8C7DC5E3806680F35E0 +Test: Encrypt +Comment: Set 2, vector 119 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000100 +Ciphertext: 4D7E08081CC82F92ABA7C58C99F8343F +Test: Encrypt +Comment: Set 2, vector 120 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000080 +Ciphertext: 9AEFDB287C119B82353612B60ECCBFD8 +Test: Encrypt +Comment: Set 2, vector 121 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000040 +Ciphertext: 979BB6A1553A17592A86E78DF144A699 +Test: Encrypt +Comment: Set 2, vector 122 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000020 +Ciphertext: A6FA8CAB06FD2E5BF3A858983C01757A +Test: Encrypt +Comment: Set 2, vector 123 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000010 +Ciphertext: BE8511254C31E25420B91D6FEF1710ED +Test: Encrypt +Comment: Set 2, vector 124 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000008 +Ciphertext: F589A908D18A21894971C0433581E1A5 +Test: Encrypt +Comment: Set 2, vector 125 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000004 +Ciphertext: 4237585130E7C9F715235EB1D8C94DE7 +Test: Encrypt +Comment: Set 2, vector 126 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000002 +Ciphertext: DEFE3E0B5C54C94B4F2A0F5A46F6210D +Test: Encrypt +Comment: Set 2, vector 127 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000001 +Ciphertext: F5574ACC3148DFCB9015200631024DF9 +Test: Encrypt +Comment: Set 3, vector 0 +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3D028025B156327C17F762C1F2CBCA71 +Test: Encrypt +Comment: Set 3, vector 1 +Key: 01010101010101010101010101010101 +Plaintext: 01010101010101010101010101010101 +Ciphertext: 637084CB1120D6F25DB618893040AA27 +Test: Encrypt +Comment: Set 3, vector 2 +Key: 02020202020202020202020202020202 +Plaintext: 02020202020202020202020202020202 +Ciphertext: 612834AAC9EF906BAEAA076E1C75179D +Test: Encrypt +Comment: Set 3, vector 3 +Key: 03030303030303030303030303030303 +Plaintext: 03030303030303030303030303030303 +Ciphertext: AECEE4C59E91366360923654C17140A9 +Test: Encrypt +Comment: Set 3, vector 4 +Key: 04040404040404040404040404040404 +Plaintext: 04040404040404040404040404040404 +Ciphertext: B24FAF8A579E4EFE986571FB2F68B5B4 +Test: Encrypt +Comment: Set 3, vector 5 +Key: 05050505050505050505050505050505 +Plaintext: 05050505050505050505050505050505 +Ciphertext: C102E40B5E584CF6AA16108D93DA26E3 +Test: Encrypt +Comment: Set 3, vector 6 +Key: 06060606060606060606060606060606 +Plaintext: 06060606060606060606060606060606 +Ciphertext: 962F98098E6CEA968FA568C5A32ADA50 +Test: Encrypt +Comment: Set 3, vector 7 +Key: 07070707070707070707070707070707 +Plaintext: 07070707070707070707070707070707 +Ciphertext: 27E9AB0117A37D228B77B29B38B3836F +Test: Encrypt +Comment: Set 3, vector 8 +Key: 08080808080808080808080808080808 +Plaintext: 08080808080808080808080808080808 +Ciphertext: 3E5CAFBB70545AABB1109293A1C44C14 +Test: Encrypt +Comment: Set 3, vector 9 +Key: 09090909090909090909090909090909 +Plaintext: 09090909090909090909090909090909 +Ciphertext: E4AC7417ECB8B2871B0EF12CECD20F46 +Test: Encrypt +Comment: Set 3, vector 10 +Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Ciphertext: B29D18DD34C1CC00257838F1B8BD43DB +Test: Encrypt +Comment: Set 3, vector 11 +Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Ciphertext: FC1094A0A2850499D874B6DDC1EBA0B7 +Test: Encrypt +Comment: Set 3, vector 12 +Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Ciphertext: AD062A5D53BB0478F17DA5528839F9FF +Test: Encrypt +Comment: Set 3, vector 13 +Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Ciphertext: 2C9DFEC27363BD0E651CC91FC05FDADF +Test: Encrypt +Comment: Set 3, vector 14 +Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Ciphertext: 487C72BD251D4566AE6119A70A95B79F +Test: Encrypt +Comment: Set 3, vector 15 +Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Ciphertext: 18CE9F8E752F787051CB8E407EB16C12 +Test: Encrypt +Comment: Set 3, vector 16 +Key: 10101010101010101010101010101010 +Plaintext: 10101010101010101010101010101010 +Ciphertext: E1FA5FD3F40B766BBE3DF469AF41B420 +Test: Encrypt +Comment: Set 3, vector 17 +Key: 11111111111111111111111111111111 +Plaintext: 11111111111111111111111111111111 +Ciphertext: 09628EDC6CD69F4F85483DC37633F732 +Test: Encrypt +Comment: Set 3, vector 18 +Key: 12121212121212121212121212121212 +Plaintext: 12121212121212121212121212121212 +Ciphertext: 2E6C94A96F6744C4E8D4146B4ECCD815 +Test: Encrypt +Comment: Set 3, vector 19 +Key: 13131313131313131313131313131313 +Plaintext: 13131313131313131313131313131313 +Ciphertext: 800996B5B363ACAB3FB8982F9BBE767F +Test: Encrypt +Comment: Set 3, vector 20 +Key: 14141414141414141414141414141414 +Plaintext: 14141414141414141414141414141414 +Ciphertext: C254C27642167B8FF363EAAD41A165A8 +Test: Encrypt +Comment: Set 3, vector 21 +Key: 15151515151515151515151515151515 +Plaintext: 15151515151515151515151515151515 +Ciphertext: 0B43A548CFFE916BAD7AB58B5F51B1E2 +Test: Encrypt +Comment: Set 3, vector 22 +Key: 16161616161616161616161616161616 +Plaintext: 16161616161616161616161616161616 +Ciphertext: 6C753853277756B8E0578FDC371A8738 +Test: Encrypt +Comment: Set 3, vector 23 +Key: 17171717171717171717171717171717 +Plaintext: 17171717171717171717171717171717 +Ciphertext: A278A500B02D8B2C7E829F1816872B1A +Test: Encrypt +Comment: Set 3, vector 24 +Key: 18181818181818181818181818181818 +Plaintext: 18181818181818181818181818181818 +Ciphertext: 67DD5353E13CDD51FC52716BC6BAB258 +Test: Encrypt +Comment: Set 3, vector 25 +Key: 19191919191919191919191919191919 +Plaintext: 19191919191919191919191919191919 +Ciphertext: 1B2DF65083662590F49719D7721D7C61 +Test: Encrypt +Comment: Set 3, vector 26 +Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Ciphertext: B12E384030DE7B77866E758FB251CCFF +Test: Encrypt +Comment: Set 3, vector 27 +Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Ciphertext: C37B3145C36FE5B95AC1392BEB81C9D8 +Test: Encrypt +Comment: Set 3, vector 28 +Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Ciphertext: 5C25502EF79A5792DEE9359EDF7BA8BC +Test: Encrypt +Comment: Set 3, vector 29 +Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Ciphertext: F0D899AEF42F226605E6A61A650F00A1 +Test: Encrypt +Comment: Set 3, vector 30 +Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Ciphertext: 12096937A3474FE4D87C77581C09380B +Test: Encrypt +Comment: Set 3, vector 31 +Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Ciphertext: CFC3A30819A45111983ABBF16CC61E9A +Test: Encrypt +Comment: Set 3, vector 32 +Key: 20202020202020202020202020202020 +Plaintext: 20202020202020202020202020202020 +Ciphertext: 7E724027BB2F591C63254D936FCC4B43 +Test: Encrypt +Comment: Set 3, vector 33 +Key: 21212121212121212121212121212121 +Plaintext: 21212121212121212121212121212121 +Ciphertext: FC9893DACCE806419957685270D5BF13 +Test: Encrypt +Comment: Set 3, vector 34 +Key: 22222222222222222222222222222222 +Plaintext: 22222222222222222222222222222222 +Ciphertext: F6C372A2AE2C03D7A9E0597DBEDFE961 +Test: Encrypt +Comment: Set 3, vector 35 +Key: 23232323232323232323232323232323 +Plaintext: 23232323232323232323232323232323 +Ciphertext: 4EE3CD585BD7A498DE93DDE42FDCBE73 +Test: Encrypt +Comment: Set 3, vector 36 +Key: 24242424242424242424242424242424 +Plaintext: 24242424242424242424242424242424 +Ciphertext: 71D0FFA714D70B5A3CDCE26BC91D93EE +Test: Encrypt +Comment: Set 3, vector 37 +Key: 25252525252525252525252525252525 +Plaintext: 25252525252525252525252525252525 +Ciphertext: 918EB6A7FA54EE795DE68EB5C0011BFD +Test: Encrypt +Comment: Set 3, vector 38 +Key: 26262626262626262626262626262626 +Plaintext: 26262626262626262626262626262626 +Ciphertext: 3A3DBFD37FB057816485BA948034E25E +Test: Encrypt +Comment: Set 3, vector 39 +Key: 27272727272727272727272727272727 +Plaintext: 27272727272727272727272727272727 +Ciphertext: 1FAD9F63890CF5475F3557B83924427C +Test: Encrypt +Comment: Set 3, vector 40 +Key: 28282828282828282828282828282828 +Plaintext: 28282828282828282828282828282828 +Ciphertext: 63F70DD87B9D63FC79628DECC6F34605 +Test: Encrypt +Comment: Set 3, vector 41 +Key: 29292929292929292929292929292929 +Plaintext: 29292929292929292929292929292929 +Ciphertext: D8FE7DF75B51024B69BDAB4844233CBB +Test: Encrypt +Comment: Set 3, vector 42 +Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Ciphertext: D927B8DB454BEECFEE2F89ACD2D26F1A +Test: Encrypt +Comment: Set 3, vector 43 +Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Ciphertext: 958B7CFABED67123D21541083FA90EB8 +Test: Encrypt +Comment: Set 3, vector 44 +Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Ciphertext: 2F220AA3BB400736F3D0295E3C6D9052 +Test: Encrypt +Comment: Set 3, vector 45 +Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Ciphertext: A14F57CE4D9EA4C5E282108DF8FDE00E +Test: Encrypt +Comment: Set 3, vector 46 +Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Ciphertext: 23E437F93E0BE22B4C54BC187D70BCC1 +Test: Encrypt +Comment: Set 3, vector 47 +Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Ciphertext: 615B6706E39E4A55EA8BFA4EFB8EBAEA +Test: Encrypt +Comment: Set 3, vector 48 +Key: 30303030303030303030303030303030 +Plaintext: 30303030303030303030303030303030 +Ciphertext: 5354CC9F7CAA08298C9A8AD471B39235 +Test: Encrypt +Comment: Set 3, vector 49 +Key: 31313131313131313131313131313131 +Plaintext: 31313131313131313131313131313131 +Ciphertext: DA2512B115E748580B7D198BFF01A537 +Test: Encrypt +Comment: Set 3, vector 50 +Key: 32323232323232323232323232323232 +Plaintext: 32323232323232323232323232323232 +Ciphertext: AEF890FCDEC04BFB0C4724558688810B +Test: Encrypt +Comment: Set 3, vector 51 +Key: 33333333333333333333333333333333 +Plaintext: 33333333333333333333333333333333 +Ciphertext: AEC153899584F8B9FC9836B86A40BA4A +Test: Encrypt +Comment: Set 3, vector 52 +Key: 34343434343434343434343434343434 +Plaintext: 34343434343434343434343434343434 +Ciphertext: E86D0DBEBD69030C0654656E0D348A8E +Test: Encrypt +Comment: Set 3, vector 53 +Key: 35353535353535353535353535353535 +Plaintext: 35353535353535353535353535353535 +Ciphertext: 3EFFEE758220F7138D31564D5CDA82EF +Test: Encrypt +Comment: Set 3, vector 54 +Key: 36363636363636363636363636363636 +Plaintext: 36363636363636363636363636363636 +Ciphertext: A0A57A825008700B246CEE9821803321 +Test: Encrypt +Comment: Set 3, vector 55 +Key: 37373737373737373737373737373737 +Plaintext: 37373737373737373737373737373737 +Ciphertext: 318692397CD421D958D142299AE24E5E +Test: Encrypt +Comment: Set 3, vector 56 +Key: 38383838383838383838383838383838 +Plaintext: 38383838383838383838383838383838 +Ciphertext: 1B949505033DB5554BBBBBB9488970DE +Test: Encrypt +Comment: Set 3, vector 57 +Key: 39393939393939393939393939393939 +Plaintext: 39393939393939393939393939393939 +Ciphertext: 20600DB3471001F93837F8EB50F7EB2B +Test: Encrypt +Comment: Set 3, vector 58 +Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Ciphertext: 004C126190B7D20ADCA7331EA26AC487 +Test: Encrypt +Comment: Set 3, vector 59 +Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Ciphertext: 7F535656FE3113A61D21BE216365D9FD +Test: Encrypt +Comment: Set 3, vector 60 +Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Ciphertext: A7DA48E8AD71B1DC583A895A8CC85FF2 +Test: Encrypt +Comment: Set 3, vector 61 +Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Ciphertext: 02E8CB85E9DDEDFAB4D9DB7106C6C38F +Test: Encrypt +Comment: Set 3, vector 62 +Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Ciphertext: 44ACE8B20DF2DBA70C0287362D51ED5C +Test: Encrypt +Comment: Set 3, vector 63 +Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Ciphertext: 8ABDD80D977FAF208FDFC69AA70E9810 +Test: Encrypt +Comment: Set 3, vector 64 +Key: 40404040404040404040404040404040 +Plaintext: 40404040404040404040404040404040 +Ciphertext: 538ADCBE104A3483B3C2A3D8CE72FBD6 +Test: Encrypt +Comment: Set 3, vector 65 +Key: 41414141414141414141414141414141 +Plaintext: 41414141414141414141414141414141 +Ciphertext: 7F757894F1A04645BCB523E925A937C7 +Test: Encrypt +Comment: Set 3, vector 66 +Key: 42424242424242424242424242424242 +Plaintext: 42424242424242424242424242424242 +Ciphertext: FA4304C7D16E164E000461B2550207B1 +Test: Encrypt +Comment: Set 3, vector 67 +Key: 43434343434343434343434343434343 +Plaintext: 43434343434343434343434343434343 +Ciphertext: 5B8E43BF0CACBCB80933B4061F9702B2 +Test: Encrypt +Comment: Set 3, vector 68 +Key: 44444444444444444444444444444444 +Plaintext: 44444444444444444444444444444444 +Ciphertext: 4DB11630D8CD9390797EE30EE9A25CB3 +Test: Encrypt +Comment: Set 3, vector 69 +Key: 45454545454545454545454545454545 +Plaintext: 45454545454545454545454545454545 +Ciphertext: 61150375D22621E9DD7AB45227E4ADC1 +Test: Encrypt +Comment: Set 3, vector 70 +Key: 46464646464646464646464646464646 +Plaintext: 46464646464646464646464646464646 +Ciphertext: 825AA0A2275496EA00BE2C75982EC24E +Test: Encrypt +Comment: Set 3, vector 71 +Key: 47474747474747474747474747474747 +Plaintext: 47474747474747474747474747474747 +Ciphertext: 1EA3F70E26F079CE37801787B5F3655C +Test: Encrypt +Comment: Set 3, vector 72 +Key: 48484848484848484848484848484848 +Plaintext: 48484848484848484848484848484848 +Ciphertext: F46E712267A6CA8DA8AC044A4E3ADC69 +Test: Encrypt +Comment: Set 3, vector 73 +Key: 49494949494949494949494949494949 +Plaintext: 49494949494949494949494949494949 +Ciphertext: 00FCF96BD11DB90E045B948C2658FC07 +Test: Encrypt +Comment: Set 3, vector 74 +Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Ciphertext: 08E264CCDA07442DD6FB5BC8AF05A9C1 +Test: Encrypt +Comment: Set 3, vector 75 +Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Ciphertext: 35C189E86440D125B0CAF6C62CA0E4F9 +Test: Encrypt +Comment: Set 3, vector 76 +Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Ciphertext: 7FC2F545C0DE78664218F4F635CC8D10 +Test: Encrypt +Comment: Set 3, vector 77 +Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Ciphertext: 9DC067581AD80555C6E46C6594A626F5 +Test: Encrypt +Comment: Set 3, vector 78 +Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Ciphertext: D33A3E8035B42D76A483BE06B62054A6 +Test: Encrypt +Comment: Set 3, vector 79 +Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Ciphertext: 7CA26FD5D6DB7EAA785FCCA1E2854910 +Test: Encrypt +Comment: Set 3, vector 80 +Key: 50505050505050505050505050505050 +Plaintext: 50505050505050505050505050505050 +Ciphertext: E9A672BD5401539C1C8F2AB21A83B26B +Test: Encrypt +Comment: Set 3, vector 81 +Key: 51515151515151515151515151515151 +Plaintext: 51515151515151515151515151515151 +Ciphertext: 2948CB8989780E74BA525CC2FDDC42CF +Test: Encrypt +Comment: Set 3, vector 82 +Key: 52525252525252525252525252525252 +Plaintext: 52525252525252525252525252525252 +Ciphertext: A3A8308145C318D42F4E8310DF6D97E0 +Test: Encrypt +Comment: Set 3, vector 83 +Key: 53535353535353535353535353535353 +Plaintext: 53535353535353535353535353535353 +Ciphertext: 1757125D19851062D7782A2200A813E9 +Test: Encrypt +Comment: Set 3, vector 84 +Key: 54545454545454545454545454545454 +Plaintext: 54545454545454545454545454545454 +Ciphertext: 9BC4FC94FF7A09F9D4C23A3BDEAF498E +Test: Encrypt +Comment: Set 3, vector 85 +Key: 55555555555555555555555555555555 +Plaintext: 55555555555555555555555555555555 +Ciphertext: B36C8A8DC251A4D08B38160011498AB2 +Test: Encrypt +Comment: Set 3, vector 86 +Key: 56565656565656565656565656565656 +Plaintext: 56565656565656565656565656565656 +Ciphertext: 6C6058C8D5F2A32E31988239C4A657F1 +Test: Encrypt +Comment: Set 3, vector 87 +Key: 57575757575757575757575757575757 +Plaintext: 57575757575757575757575757575757 +Ciphertext: B8B914785FD465FB0F83FE4A676C3A6B +Test: Encrypt +Comment: Set 3, vector 88 +Key: 58585858585858585858585858585858 +Plaintext: 58585858585858585858585858585858 +Ciphertext: 00BBEEC24412F8A2C4291B5F1F32E662 +Test: Encrypt +Comment: Set 3, vector 89 +Key: 59595959595959595959595959595959 +Plaintext: 59595959595959595959595959595959 +Ciphertext: AF8353C84504526068884176D45CC8A0 +Test: Encrypt +Comment: Set 3, vector 90 +Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Ciphertext: F84DF1519736174F6F23B4CC3FC939F1 +Test: Encrypt +Comment: Set 3, vector 91 +Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Ciphertext: 320326E1024C9156B0E4C483065F0D94 +Test: Encrypt +Comment: Set 3, vector 92 +Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Ciphertext: 80AFE13AEC30894E8B772E73F367A148 +Test: Encrypt +Comment: Set 3, vector 93 +Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Ciphertext: 5F0D8BE9294D27DB7E6CD4D4F8A08D48 +Test: Encrypt +Comment: Set 3, vector 94 +Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Ciphertext: B6D8E7EF37171F6271AC274411E26867 +Test: Encrypt +Comment: Set 3, vector 95 +Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Ciphertext: 23DEBDDF60703AE0F8E9337C73C6FDC3 +Test: Encrypt +Comment: Set 3, vector 96 +Key: 60606060606060606060606060606060 +Plaintext: 60606060606060606060606060606060 +Ciphertext: D03B4696B0DCC56C37F7038747BEF222 +Test: Encrypt +Comment: Set 3, vector 97 +Key: 61616161616161616161616161616161 +Plaintext: 61616161616161616161616161616161 +Ciphertext: 201E6A1FA7898892DA1D3148766F7939 +Test: Encrypt +Comment: Set 3, vector 98 +Key: 62626262626262626262626262626262 +Plaintext: 62626262626262626262626262626262 +Ciphertext: D9643DBC3C373D300DB5AC3E699F7DDE +Test: Encrypt +Comment: Set 3, vector 99 +Key: 63636363636363636363636363636363 +Plaintext: 63636363636363636363636363636363 +Ciphertext: 1B04DAF08A764C09DFFE140403F4EC5D +Test: Encrypt +Comment: Set 3, vector 100 +Key: 64646464646464646464646464646464 +Plaintext: 64646464646464646464646464646464 +Ciphertext: 0510AA045E35862885AEEB1752328032 +Test: Encrypt +Comment: Set 3, vector 101 +Key: 65656565656565656565656565656565 +Plaintext: 65656565656565656565656565656565 +Ciphertext: 894E5FE4164A0B9CC2C50D95F18329E6 +Test: Encrypt +Comment: Set 3, vector 102 +Key: 66666666666666666666666666666666 +Plaintext: 66666666666666666666666666666666 +Ciphertext: 99D16D251893E474CD8A18C10798D418 +Test: Encrypt +Comment: Set 3, vector 103 +Key: 67676767676767676767676767676767 +Plaintext: 67676767676767676767676767676767 +Ciphertext: B41A0DEEA15FCB419E00318752503FA8 +Test: Encrypt +Comment: Set 3, vector 104 +Key: 68686868686868686868686868686868 +Plaintext: 68686868686868686868686868686868 +Ciphertext: 8BDDFBD29844F3EED1E02FB76628E877 +Test: Encrypt +Comment: Set 3, vector 105 +Key: 69696969696969696969696969696969 +Plaintext: 69696969696969696969696969696969 +Ciphertext: E71C41B95412E2ED6BC6B5693BC445E5 +Test: Encrypt +Comment: Set 3, vector 106 +Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Ciphertext: 566E5667E9BDDCE13F3B6DE0DEF06305 +Test: Encrypt +Comment: Set 3, vector 107 +Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Ciphertext: 49372FDCE8DC81E45A9E6FBFB8952F76 +Test: Encrypt +Comment: Set 3, vector 108 +Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Ciphertext: 034EAB9E0E881ABF0C4F9B7933E7F1B2 +Test: Encrypt +Comment: Set 3, vector 109 +Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Ciphertext: 56FFE171E45816C5808380530F3F9F23 +Test: Encrypt +Comment: Set 3, vector 110 +Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Ciphertext: 5FE59EE65A0321F3B09A1748CF18CC02 +Test: Encrypt +Comment: Set 3, vector 111 +Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Ciphertext: 8C13790203280B652614D224178C4289 +Test: Encrypt +Comment: Set 3, vector 112 +Key: 70707070707070707070707070707070 +Plaintext: 70707070707070707070707070707070 +Ciphertext: 52D7C5111B52E5356C8EF2B629BA6166 +Test: Encrypt +Comment: Set 3, vector 113 +Key: 71717171717171717171717171717171 +Plaintext: 71717171717171717171717171717171 +Ciphertext: 4FB997235548FB5C202A1514FF408068 +Test: Encrypt +Comment: Set 3, vector 114 +Key: 72727272727272727272727272727272 +Plaintext: 72727272727272727272727272727272 +Ciphertext: 8DDE9345FEDAB8D8D2DE5E2577756F16 +Test: Encrypt +Comment: Set 3, vector 115 +Key: 73737373737373737373737373737373 +Plaintext: 73737373737373737373737373737373 +Ciphertext: C1B39136F69B2044C30E38023EB6E7D2 +Test: Encrypt +Comment: Set 3, vector 116 +Key: 74747474747474747474747474747474 +Plaintext: 74747474747474747474747474747474 +Ciphertext: 6032D1B3844BEA4ACE81142A013C42BC +Test: Encrypt +Comment: Set 3, vector 117 +Key: 75757575757575757575757575757575 +Plaintext: 75757575757575757575757575757575 +Ciphertext: 985A9D8DDE048107368028AA24F5D70B +Test: Encrypt +Comment: Set 3, vector 118 +Key: 76767676767676767676767676767676 +Plaintext: 76767676767676767676767676767676 +Ciphertext: 5343E03D587A538475BB92F23E96FDF8 +Test: Encrypt +Comment: Set 3, vector 119 +Key: 77777777777777777777777777777777 +Plaintext: 77777777777777777777777777777777 +Ciphertext: 98253AF78B8DA7E5AE98E7B4E9FA74F9 +Test: Encrypt +Comment: Set 3, vector 120 +Key: 78787878787878787878787878787878 +Plaintext: 78787878787878787878787878787878 +Ciphertext: 8404DDA01CC702790B8B31408205E128 +Test: Encrypt +Comment: Set 3, vector 121 +Key: 79797979797979797979797979797979 +Plaintext: 79797979797979797979797979797979 +Ciphertext: C782C96911F30723AB90E3A0BA59B808 +Test: Encrypt +Comment: Set 3, vector 122 +Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Ciphertext: 471270191B1BB659804CEAE818793167 +Test: Encrypt +Comment: Set 3, vector 123 +Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Ciphertext: 2B27BBF7E47DA05F72EED52D038A3241 +Test: Encrypt +Comment: Set 3, vector 124 +Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Ciphertext: 0BD3B3F3F6F404B6B7C6D436605640B7 +Test: Encrypt +Comment: Set 3, vector 125 +Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Ciphertext: 74578268B9D9AD5D9819E51CA288F81D +Test: Encrypt +Comment: Set 3, vector 126 +Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Ciphertext: A77A67CC08111CE41B817176859675B5 +Test: Encrypt +Comment: Set 3, vector 127 +Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Ciphertext: 9BE99EFDAF9CCCB4D879173EA2197FEF +Test: Encrypt +Comment: Set 3, vector 128 +Key: 80808080808080808080808080808080 +Plaintext: 80808080808080808080808080808080 +Ciphertext: AA7627F70F6B54C217C3EF232D362459 +Test: Encrypt +Comment: Set 3, vector 129 +Key: 81818181818181818181818181818181 +Plaintext: 81818181818181818181818181818181 +Ciphertext: EE41F8DC661C2A8B95667CB1F908367A +Test: Encrypt +Comment: Set 3, vector 130 +Key: 82828282828282828282828282828282 +Plaintext: 82828282828282828282828282828282 +Ciphertext: AF2D71AC4D7E482E8134A65F2841101A +Test: Encrypt +Comment: Set 3, vector 131 +Key: 83838383838383838383838383838383 +Plaintext: 83838383838383838383838383838383 +Ciphertext: 98CFCAA37D3B1825C55FA94825BBC91A +Test: Encrypt +Comment: Set 3, vector 132 +Key: 84848484848484848484848484848484 +Plaintext: 84848484848484848484848484848484 +Ciphertext: 2ACFCBC772417EBD445F8B272857578C +Test: Encrypt +Comment: Set 3, vector 133 +Key: 85858585858585858585858585858585 +Plaintext: 85858585858585858585858585858585 +Ciphertext: 424DE49A69767A539E26581A19CD4F17 +Test: Encrypt +Comment: Set 3, vector 134 +Key: 86868686868686868686868686868686 +Plaintext: 86868686868686868686868686868686 +Ciphertext: F25ED7239B234E58AE40F7612E3CE6BA +Test: Encrypt +Comment: Set 3, vector 135 +Key: 87878787878787878787878787878787 +Plaintext: 87878787878787878787878787878787 +Ciphertext: 4BF44DBA1E6E80DE3554F7EEF0621EBF +Test: Encrypt +Comment: Set 3, vector 136 +Key: 88888888888888888888888888888888 +Plaintext: 88888888888888888888888888888888 +Ciphertext: 6B87409975816BC8480985D079B08594 +Test: Encrypt +Comment: Set 3, vector 137 +Key: 89898989898989898989898989898989 +Plaintext: 89898989898989898989898989898989 +Ciphertext: D026A866DD55C02EE77DF1E93405A751 +Test: Encrypt +Comment: Set 3, vector 138 +Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Ciphertext: A45F7212DD04352DEF319D58922C44CE +Test: Encrypt +Comment: Set 3, vector 139 +Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Ciphertext: 4600AD219EE97A7BFF629D8F6E337C79 +Test: Encrypt +Comment: Set 3, vector 140 +Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Ciphertext: A26CEFEC7612A89E8543503A678D921F +Test: Encrypt +Comment: Set 3, vector 141 +Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Ciphertext: 5CA126B9342723816C82AC1D41F97EFB +Test: Encrypt +Comment: Set 3, vector 142 +Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Ciphertext: 76DC82C091F5691C35E8735EB901B788 +Test: Encrypt +Comment: Set 3, vector 143 +Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Ciphertext: 2F8AA5E8D7D90B3E7FCC20128F462AAD +Test: Encrypt +Comment: Set 3, vector 144 +Key: 90909090909090909090909090909090 +Plaintext: 90909090909090909090909090909090 +Ciphertext: 67B8B189FCD886FD2160005C93D9F3B2 +Test: Encrypt +Comment: Set 3, vector 145 +Key: 91919191919191919191919191919191 +Plaintext: 91919191919191919191919191919191 +Ciphertext: 8DFBD0B7D8B614E15B56571A6A5B443D +Test: Encrypt +Comment: Set 3, vector 146 +Key: 92929292929292929292929292929292 +Plaintext: 92929292929292929292929292929292 +Ciphertext: F10DA9ABD28359461A3BB271C2037D1A +Test: Encrypt +Comment: Set 3, vector 147 +Key: 93939393939393939393939393939393 +Plaintext: 93939393939393939393939393939393 +Ciphertext: 5A53C6ADF38E807BC03CC53193133CDE +Test: Encrypt +Comment: Set 3, vector 148 +Key: 94949494949494949494949494949494 +Plaintext: 94949494949494949494949494949494 +Ciphertext: 298AF9909A89241F34DB6BF6ACC6A909 +Test: Encrypt +Comment: Set 3, vector 149 +Key: 95959595959595959595959595959595 +Plaintext: 95959595959595959595959595959595 +Ciphertext: DAA5C134BDD34A775DEC219F6DE219BE +Test: Encrypt +Comment: Set 3, vector 150 +Key: 96969696969696969696969696969696 +Plaintext: 96969696969696969696969696969696 +Ciphertext: 2514903F8ABA0F65CA22C8AD82FF2574 +Test: Encrypt +Comment: Set 3, vector 151 +Key: 97979797979797979797979797979797 +Plaintext: 97979797979797979797979797979797 +Ciphertext: 11696CB06D2F97B1A2CB380E2887AB7E +Test: Encrypt +Comment: Set 3, vector 152 +Key: 98989898989898989898989898989898 +Plaintext: 98989898989898989898989898989898 +Ciphertext: E70BAE913D953A66AC35DE9CAA6D205D +Test: Encrypt +Comment: Set 3, vector 153 +Key: 99999999999999999999999999999999 +Plaintext: 99999999999999999999999999999999 +Ciphertext: 20BC3C8F4E81EEA320189E6063017706 +Test: Encrypt +Comment: Set 3, vector 154 +Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Ciphertext: 53A956A32B4B532F5E9BE8C94278EC57 +Test: Encrypt +Comment: Set 3, vector 155 +Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Ciphertext: 2562236E541426B29A4232E592237CAD +Test: Encrypt +Comment: Set 3, vector 156 +Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Ciphertext: 0F8A9DEDA85B0A1CF7487C6ED823B869 +Test: Encrypt +Comment: Set 3, vector 157 +Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Ciphertext: 8917CF4F1A25A500440CF0665BB517A0 +Test: Encrypt +Comment: Set 3, vector 158 +Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Ciphertext: F5C065F3821FA664724BF6AFF1039430 +Test: Encrypt +Comment: Set 3, vector 159 +Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Ciphertext: F5D5131F0D2F4859EC38F8999A93E74D +Test: Encrypt +Comment: Set 3, vector 160 +Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Ciphertext: 9A02DF44F2194E94B7E34F1DCC234685 +Test: Encrypt +Comment: Set 3, vector 161 +Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Ciphertext: 59491E467432E6147EAFE37BCD93DA01 +Test: Encrypt +Comment: Set 3, vector 162 +Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Ciphertext: 4D0B317CE4AE577CF87B225C53DDF352 +Test: Encrypt +Comment: Set 3, vector 163 +Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Ciphertext: 73E082DC996995BDDD1F5544326D56D6 +Test: Encrypt +Comment: Set 3, vector 164 +Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Ciphertext: 46C5C6E23A72C9DF410EF979F93CF266 +Test: Encrypt +Comment: Set 3, vector 165 +Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Ciphertext: 1F55093C234648C5C9C781E8C9FD42C4 +Test: Encrypt +Comment: Set 3, vector 166 +Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Ciphertext: BFA2702CF3DAE25705D1DE1CCDBDC49E +Test: Encrypt +Comment: Set 3, vector 167 +Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Ciphertext: 3223365425C1ADE87FF766AB048D9ADB +Test: Encrypt +Comment: Set 3, vector 168 +Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Ciphertext: 5449889254C565DF3ADDFB7A86A93DA9 +Test: Encrypt +Comment: Set 3, vector 169 +Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Ciphertext: 7D21880CCA919B0CE3917A8C598025FA +Test: Encrypt +Comment: Set 3, vector 170 +Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Ciphertext: 5EE203A6739E822A54D9678B604EFD4F +Test: Encrypt +Comment: Set 3, vector 171 +Key: ABABABABABABABABABABABABABABABAB +Plaintext: ABABABABABABABABABABABABABABABAB +Ciphertext: 07038EFBEFDE2228F79A6B526306483A +Test: Encrypt +Comment: Set 3, vector 172 +Key: ACACACACACACACACACACACACACACACAC +Plaintext: ACACACACACACACACACACACACACACACAC +Ciphertext: 78447EBF959FFBD120283CE319FF6005 +Test: Encrypt +Comment: Set 3, vector 173 +Key: ADADADADADADADADADADADADADADADAD +Plaintext: ADADADADADADADADADADADADADADADAD +Ciphertext: 76769D40A286F0FD1C1C6F8895000DE8 +Test: Encrypt +Comment: Set 3, vector 174 +Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Ciphertext: 7E163343CA44FADFAFDE5386CC111437 +Test: Encrypt +Comment: Set 3, vector 175 +Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Ciphertext: 4B1E7FE684222BF783142B5DC396F61D +Test: Encrypt +Comment: Set 3, vector 176 +Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Ciphertext: 4ECF97472658AC941EC99B255CF95535 +Test: Encrypt +Comment: Set 3, vector 177 +Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Ciphertext: 23EE9DF24C8DC126A04586EFF27DBEAC +Test: Encrypt +Comment: Set 3, vector 178 +Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Ciphertext: 4B06EE28B7769C4318D509F91D691F39 +Test: Encrypt +Comment: Set 3, vector 179 +Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Ciphertext: 51994EF8283D1D29711F602A7ACDA3CA +Test: Encrypt +Comment: Set 3, vector 180 +Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Ciphertext: DCBFBE6BE3234BBB61EA68218C89D098 +Test: Encrypt +Comment: Set 3, vector 181 +Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Ciphertext: B84BFA0883546D912BD14807253F8892 +Test: Encrypt +Comment: Set 3, vector 182 +Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Ciphertext: 90C1745C0DB97E70BA362CF2C1D376DF +Test: Encrypt +Comment: Set 3, vector 183 +Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Ciphertext: 064743C2E8293C1B7619F6E6DEC13B04 +Test: Encrypt +Comment: Set 3, vector 184 +Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Ciphertext: 38D913C68ABEE287368CBA38D8FE9F0D +Test: Encrypt +Comment: Set 3, vector 185 +Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Ciphertext: B2279D520B33258B7DB221ECDD3C4EBB +Test: Encrypt +Comment: Set 3, vector 186 +Key: BABABABABABABABABABABABABABABABA +Plaintext: BABABABABABABABABABABABABABABABA +Ciphertext: 8AD710DDAE51BE6D4BE7ABC5443B7F9B +Test: Encrypt +Comment: Set 3, vector 187 +Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Ciphertext: 246BA7624BBF83702764CC1B214A0691 +Test: Encrypt +Comment: Set 3, vector 188 +Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Ciphertext: 80E0360B03FA048A892CD47BD7FE948A +Test: Encrypt +Comment: Set 3, vector 189 +Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Ciphertext: 09D5D35BB6DBAE0CC9982D6955EAA01C +Test: Encrypt +Comment: Set 3, vector 190 +Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Ciphertext: EEBDCE2BDE1F25A40184B9C57DD4E49D +Test: Encrypt +Comment: Set 3, vector 191 +Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Ciphertext: 22706CFCCD2B0BB15ED30E373FA4E945 +Test: Encrypt +Comment: Set 3, vector 192 +Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Ciphertext: D2A4EEACB5F41D12908DD1E069EC14DC +Test: Encrypt +Comment: Set 3, vector 193 +Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Ciphertext: E78F614BC7F53C9298098DFEE8ADFB09 +Test: Encrypt +Comment: Set 3, vector 194 +Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Ciphertext: B53E3865A8B28A36EF3A505102A6329D +Test: Encrypt +Comment: Set 3, vector 195 +Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Ciphertext: 9B32AA8673DFFC47CF8C9B35DDE08DD3 +Test: Encrypt +Comment: Set 3, vector 196 +Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Ciphertext: CE70E7257E6C8686C7407E22ACB3E94B +Test: Encrypt +Comment: Set 3, vector 197 +Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Ciphertext: 677DB939CA272D717DB4B03EFB70F988 +Test: Encrypt +Comment: Set 3, vector 198 +Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Ciphertext: 6582B069058FA86898A3B12B617C27FD +Test: Encrypt +Comment: Set 3, vector 199 +Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Ciphertext: 4DFB68486ECF9833FCE74BD663E20768 +Test: Encrypt +Comment: Set 3, vector 200 +Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Ciphertext: 6A3840D2780BABD68A73FAC89C4E8D91 +Test: Encrypt +Comment: Set 3, vector 201 +Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Ciphertext: 44C79926D7EAB9DE5A2B95472A79A7BC +Test: Encrypt +Comment: Set 3, vector 202 +Key: CACACACACACACACACACACACACACACACA +Plaintext: CACACACACACACACACACACACACACACACA +Ciphertext: 3813E774EE9EFA8FDB2646E607B2A434 +Test: Encrypt +Comment: Set 3, vector 203 +Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Ciphertext: FCA748E6AE5678A047E806F8FF103A65 +Test: Encrypt +Comment: Set 3, vector 204 +Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Ciphertext: 3E3CC9CBE6952AB968FBBEE0C08BF667 +Test: Encrypt +Comment: Set 3, vector 205 +Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Ciphertext: 4FFF3EDC7BCB70E7846DCC4688F9CB3A +Test: Encrypt +Comment: Set 3, vector 206 +Key: CECECECECECECECECECECECECECECECE +Plaintext: CECECECECECECECECECECECECECECECE +Ciphertext: 5728481E82E0DC1631EC611F63B9DD3C +Test: Encrypt +Comment: Set 3, vector 207 +Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Ciphertext: 182BB0D3C52E56248FDA1D343844891D +Test: Encrypt +Comment: Set 3, vector 208 +Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Ciphertext: 6B984FC45D0352F3336E7895ECB6DE0E +Test: Encrypt +Comment: Set 3, vector 209 +Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Ciphertext: 8DD24A1B23D845E7A6C6D416C7C5B595 +Test: Encrypt +Comment: Set 3, vector 210 +Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Ciphertext: 4F4D69B4563373962007945C3197806C +Test: Encrypt +Comment: Set 3, vector 211 +Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Ciphertext: DD333390213EB632A51EAE0334A5AEA2 +Test: Encrypt +Comment: Set 3, vector 212 +Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Ciphertext: D352ACE83BF6A3BC39EA10D751853009 +Test: Encrypt +Comment: Set 3, vector 213 +Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Ciphertext: F2E118276BFCCF6DCDD47E1EAB919BDC +Test: Encrypt +Comment: Set 3, vector 214 +Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Ciphertext: 688E877D8B69050F2736D0768571E9A0 +Test: Encrypt +Comment: Set 3, vector 215 +Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Ciphertext: DE6F098E56985B7DCFEC52C897F2E735 +Test: Encrypt +Comment: Set 3, vector 216 +Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Ciphertext: 398FA1FE47E3971DA3F9DFD479C9B1AA +Test: Encrypt +Comment: Set 3, vector 217 +Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Ciphertext: 6F17B7D7C899B48DAEAD1E90F22AB180 +Test: Encrypt +Comment: Set 3, vector 218 +Key: DADADADADADADADADADADADADADADADA +Plaintext: DADADADADADADADADADADADADADADADA +Ciphertext: D39EBBA5B742F15FCB75D6E656BBF2DA +Test: Encrypt +Comment: Set 3, vector 219 +Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Ciphertext: 1C6D82247D0BAB18B52CA5293A2C1050 +Test: Encrypt +Comment: Set 3, vector 220 +Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Ciphertext: B54F248DF57060E40A6A2FA4688C7082 +Test: Encrypt +Comment: Set 3, vector 221 +Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Ciphertext: 1BB5EB8732CBAB2E3FC334FAAB8BBFBC +Test: Encrypt +Comment: Set 3, vector 222 +Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Ciphertext: 3734B4B21B50C4740B90FD863EF8627B +Test: Encrypt +Comment: Set 3, vector 223 +Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Ciphertext: E22E22E60F981D64B7CB341F12F2B362 +Test: Encrypt +Comment: Set 3, vector 224 +Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Ciphertext: A2A40EB448D87E39B20460E8CB07515A +Test: Encrypt +Comment: Set 3, vector 225 +Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Ciphertext: 88E6AC929D4D7858015B35D509882C5C +Test: Encrypt +Comment: Set 3, vector 226 +Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Ciphertext: FFE4B3B5D0E8229F5428FA2945DBD5EE +Test: Encrypt +Comment: Set 3, vector 227 +Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Ciphertext: FCD5F897398A7796A0DAA1809CA7D870 +Test: Encrypt +Comment: Set 3, vector 228 +Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Ciphertext: 7F3556B18EC8F04D953DCD27549AF1FC +Test: Encrypt +Comment: Set 3, vector 229 +Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Ciphertext: 4433546A8E63AE841CD78B074ED0B91F +Test: Encrypt +Comment: Set 3, vector 230 +Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Ciphertext: 2E04671C718BD6C3D115DB2D827A6669 +Test: Encrypt +Comment: Set 3, vector 231 +Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Ciphertext: AAE7DA4B977F5EED28F9AF01F8FD47B4 +Test: Encrypt +Comment: Set 3, vector 232 +Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Ciphertext: 84AD8F52D51BD3D8E4D8318AF6DB9786 +Test: Encrypt +Comment: Set 3, vector 233 +Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Ciphertext: 95EFA65090BD603A1F65A21A43104F79 +Test: Encrypt +Comment: Set 3, vector 234 +Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Ciphertext: 1B83F51E157BBA004CC5BD05986017C8 +Test: Encrypt +Comment: Set 3, vector 235 +Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Ciphertext: A0C37A641126D5801C4259DFD38E8E8A +Test: Encrypt +Comment: Set 3, vector 236 +Key: ECECECECECECECECECECECECECECECEC +Plaintext: ECECECECECECECECECECECECECECECEC +Ciphertext: 3153A212C2E4727C1032223134342B31 +Test: Encrypt +Comment: Set 3, vector 237 +Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Ciphertext: C680D98CAF4409CF31BABCF67352E1D5 +Test: Encrypt +Comment: Set 3, vector 238 +Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Ciphertext: A7FC85C8459274B836B6F0CBED80AF49 +Test: Encrypt +Comment: Set 3, vector 239 +Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Ciphertext: 5CA8B8A4B8AF15A6184259831B18BBB5 +Test: Encrypt +Comment: Set 3, vector 240 +Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Ciphertext: F118089963B9AB37776B10B0D4CCEBA4 +Test: Encrypt +Comment: Set 3, vector 241 +Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Ciphertext: C233B864E78E9EC272112A34FF7AADBA +Test: Encrypt +Comment: Set 3, vector 242 +Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Ciphertext: 2B1C503E7F755A47CC4C57BEB4135B46 +Test: Encrypt +Comment: Set 3, vector 243 +Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Ciphertext: 60D8177BE1044FC5F46DA2B3CAA33102 +Test: Encrypt +Comment: Set 3, vector 244 +Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Ciphertext: BA1CBC06977ECE57C5CBC12D99324E00 +Test: Encrypt +Comment: Set 3, vector 245 +Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Ciphertext: 01C8561E24A32F53FBAF8864AEE803E3 +Test: Encrypt +Comment: Set 3, vector 246 +Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Ciphertext: 797ECFA429014F26B9E62D58B4C1B84E +Test: Encrypt +Comment: Set 3, vector 247 +Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Ciphertext: 6AD7FA698A7F3EA8AE13B1DF537BF6EA +Test: Encrypt +Comment: Set 3, vector 248 +Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Ciphertext: 49157343BE8B8ED4E59C1AEC3CAB1B94 +Test: Encrypt +Comment: Set 3, vector 249 +Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Ciphertext: D33C742DEA4A2C64983766E3068EC200 +Test: Encrypt +Comment: Set 3, vector 250 +Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Ciphertext: 66AE1EAFB45091982E40000BADE002C9 +Test: Encrypt +Comment: Set 3, vector 251 +Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Ciphertext: B6614B0FF5924D0C1EB2C461560BFC01 +Test: Encrypt +Comment: Set 3, vector 252 +Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Ciphertext: 5B4DFBE2BB7666425A858C4769D8DAD0 +Test: Encrypt +Comment: Set 3, vector 253 +Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Ciphertext: 2F142B9044DEC39915ED9347E7B0ED1E +Test: Encrypt +Comment: Set 3, vector 254 +Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Ciphertext: 17E02528D6655CEA7BE6B8548FC2DA65 +Test: Encrypt +Comment: Set 3, vector 255 +Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Ciphertext: 25DD9EB9DD67FBC6E8431F56F4FBE651 +Test: Encrypt +Comment: Tests with 192-bit keys +Comment: Set 1, vector 0 +Key: 800000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1B6220D365C2176C1D41A5826520FCA1 +Test: Encrypt +Comment: Set 1, vector 1 +Key: 400000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0F6DAEEA95CFC8925F23AFA932DF489B +Test: Encrypt +Comment: Set 1, vector 2 +Key: 200000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7330199225AD384F8DD39582D61389BB +Test: Encrypt +Comment: Set 1, vector 3 +Key: 100000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2CC5A47D5C62F70634E27BA332D37D53 +Test: Encrypt +Comment: Set 1, vector 4 +Key: 080000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CDF1D23AB15E20AE8E9A2FE380920897 +Test: Encrypt +Comment: Set 1, vector 5 +Key: 040000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CE995A8AF1FD7E0F5FA07ED654841EEE +Test: Encrypt +Comment: Set 1, vector 6 +Key: 020000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0678BA4335E44354363005F278AF83A4 +Test: Encrypt +Comment: Set 1, vector 7 +Key: 010000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6162ED593434D738B44D642254066FB4 +Test: Encrypt +Comment: Set 1, vector 8 +Key: 008000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F7F146E61396EC9AB9F7D04BFA6D37F5 +Test: Encrypt +Comment: Set 1, vector 9 +Key: 004000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8BF96FE41906AF2CC702726B963E56A6 +Test: Encrypt +Comment: Set 1, vector 10 +Key: 002000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B164168F7D6BADBCCBE19B2BCF4EAA91 +Test: Encrypt +Comment: Set 1, vector 11 +Key: 001000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5A81508260797F7BCFD4E0DB62F5E3A7 +Test: Encrypt +Comment: Set 1, vector 12 +Key: 000800000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 36641169D53E61CB32B97B98C37DF262 +Test: Encrypt +Comment: Set 1, vector 13 +Key: 000400000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EFFEC137ECEE5D439F8B21ACE1D863F8 +Test: Encrypt +Comment: Set 1, vector 14 +Key: 000200000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7462DEB8C153EECB6C78CE690E764B53 +Test: Encrypt +Comment: Set 1, vector 15 +Key: 000100000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 34F873BD3D6FF62B18C3778B123B15C5 +Test: Encrypt +Comment: Set 1, vector 16 +Key: 000080000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9850C8E08F952EE1D173B1A4A78686F5 +Test: Encrypt +Comment: Set 1, vector 17 +Key: 000040000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3285534795E8547B68580343DC5BF330 +Test: Encrypt +Comment: Set 1, vector 18 +Key: 000020000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E0495AA72CB3C27233850F3192254232 +Test: Encrypt +Comment: Set 1, vector 19 +Key: 000010000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 33ED350E83B7FE34E74C22A883EC6728 +Test: Encrypt +Comment: Set 1, vector 20 +Key: 000008000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 912D73428CBA7F631AE577854C111C91 +Test: Encrypt +Comment: Set 1, vector 21 +Key: 000004000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 76E747DC49B25D8E6EBE5DE83980AB57 +Test: Encrypt +Comment: Set 1, vector 22 +Key: 000002000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 82A2ED3BE0371C98C176AA7E7DF9FF8D +Test: Encrypt +Comment: Set 1, vector 23 +Key: 000001000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 96282A04DD3405294F9714B396D5219A +Test: Encrypt +Comment: Set 1, vector 24 +Key: 000000800000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 86ECD349003006A6DE29D4AAC1ACE296 +Test: Encrypt +Comment: Set 1, vector 25 +Key: 000000400000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7A9A9F2BBEA203ECE7C9F531B6D41B6A +Test: Encrypt +Comment: Set 1, vector 26 +Key: 000000200000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BA5FE8CD976DEA118728C2950D325042 +Test: Encrypt +Comment: Set 1, vector 27 +Key: 000000100000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 46F29ADE35C839AE69454CB0C9EEBF71 +Test: Encrypt +Comment: Set 1, vector 28 +Key: 000000080000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E5B83E23535FC32DD8153C46EC894FAD +Test: Encrypt +Comment: Set 1, vector 29 +Key: 000000040000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 877CC6280A8E7740F710AEA535DADFD4 +Test: Encrypt +Comment: Set 1, vector 30 +Key: 000000020000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 284D6EEC89721D40BDCFD260AF4FF052 +Test: Encrypt +Comment: Set 1, vector 31 +Key: 000000010000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6482ED6C71B60F1ED92B9913B5EAF6B3 +Test: Encrypt +Comment: Set 1, vector 32 +Key: 000000008000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 30135C97C9C23C8C64612D6BB813AD61 +Test: Encrypt +Comment: Set 1, vector 33 +Key: 000000004000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 336F70CF867920BBC00699CA8DBDF6DA +Test: Encrypt +Comment: Set 1, vector 34 +Key: 000000002000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3F4003C9600469670DE0B1B20ED5F33D +Test: Encrypt +Comment: Set 1, vector 35 +Key: 000000001000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9D5FFEDF7166F74DCAF2D643E2934ABE +Test: Encrypt +Comment: Set 1, vector 36 +Key: 000000000800000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9BFAC0EEB78A21F006DB6847CC7D7929 +Test: Encrypt +Comment: Set 1, vector 37 +Key: 000000000400000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B64332DC813BE982897C1E14DA808F5D +Test: Encrypt +Comment: Set 1, vector 38 +Key: 000000000200000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AB8FCEB76C37E5FE5737DA4382F14347 +Test: Encrypt +Comment: Set 1, vector 39 +Key: 000000000100000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C9C121859975147145AF6CAE313BA00D +Test: Encrypt +Comment: Set 1, vector 40 +Key: 000000000080000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9B1307BF36B6FF5BA4AD9C6574B63955 +Test: Encrypt +Comment: Set 1, vector 41 +Key: 000000000040000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8842C3EBB26C1863440D52DC3B26414B +Test: Encrypt +Comment: Set 1, vector 42 +Key: 000000000020000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: ADEADD3E035D591B2197D5B9C9B06ADA +Test: Encrypt +Comment: Set 1, vector 43 +Key: 000000000010000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4F36AD57F9BA5FB6624E504D0FC2DC93 +Test: Encrypt +Comment: Set 1, vector 44 +Key: 000000000008000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 92A364EEB2D964949210C7FF14BAE7B5 +Test: Encrypt +Comment: Set 1, vector 45 +Key: 000000000004000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EA027B9653456B8A41910FE19A90FD50 +Test: Encrypt +Comment: Set 1, vector 46 +Key: 000000000002000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 254A41CA04427C9E87F65BB52A0ACF74 +Test: Encrypt +Comment: Set 1, vector 47 +Key: 000000000001000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F935FD318C08AC6CD57A028384FA447B +Test: Encrypt +Comment: Set 1, vector 48 +Key: 000000000000800000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E5BA10850CBCFF8F42FEC0E658685096 +Test: Encrypt +Comment: Set 1, vector 49 +Key: 000000000000400000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6F145C7015923CE515D78CEF0157CCC6 +Test: Encrypt +Comment: Set 1, vector 50 +Key: 000000000000200000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3A6FCA03EA6DBF6996FD2CE99EC17C31 +Test: Encrypt +Comment: Set 1, vector 51 +Key: 000000000000100000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 21E2ED82498B110EAEAD90F1BBEA03A6 +Test: Encrypt +Comment: Set 1, vector 52 +Key: 000000000000080000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6B16ED3CBADC3151323891C373C43DFB +Test: Encrypt +Comment: Set 1, vector 53 +Key: 000000000000040000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B621A20E0CA41620C2A483154DB6102C +Test: Encrypt +Comment: Set 1, vector 54 +Key: 000000000000020000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8C754011BD3B87AA1EB3607B98E6CE86 +Test: Encrypt +Comment: Set 1, vector 55 +Key: 000000000000010000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FEEE2DFBA1DD3DBF4017B13833117816 +Test: Encrypt +Comment: Set 1, vector 56 +Key: 000000000000008000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 62A9C6CC76519FCF8FAD9EED0552CEB3 +Test: Encrypt +Comment: Set 1, vector 57 +Key: 000000000000004000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FF822FAFB79035AB813246BA5234D675 +Test: Encrypt +Comment: Set 1, vector 58 +Key: 000000000000002000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F3E17F2406DF31E7074DF97B062396B9 +Test: Encrypt +Comment: Set 1, vector 59 +Key: 000000000000001000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3F4F81B3573B6756ADD3005087EDE501 +Test: Encrypt +Comment: Set 1, vector 60 +Key: 000000000000000800000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 65A03A1A1C44191B73D576B7C75B5C32 +Test: Encrypt +Comment: Set 1, vector 61 +Key: 000000000000000400000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B08EBB2097DA76C34E2D8A869DCD3D7D +Test: Encrypt +Comment: Set 1, vector 62 +Key: 000000000000000200000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BA7B88E1B1FCFA03C3DBB2EDE047F5DC +Test: Encrypt +Comment: Set 1, vector 63 +Key: 000000000000000100000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1B3CB3884C12691CC66202EDB0838106 +Test: Encrypt +Comment: Set 1, vector 64 +Key: 000000000000000080000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4A85BE25546958B1E91801A35C7386E2 +Test: Encrypt +Comment: Set 1, vector 65 +Key: 000000000000000040000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F14CAACDD919872396DBCDCBEF9A384C +Test: Encrypt +Comment: Set 1, vector 66 +Key: 000000000000000020000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 23B0D4FC870309DFEF7AFC04C46AF26A +Test: Encrypt +Comment: Set 1, vector 67 +Key: 000000000000000010000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C93604723C3DBBC66AFF87AB1864C76C +Test: Encrypt +Comment: Set 1, vector 68 +Key: 000000000000000008000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6C14E822857BA0983AAC42995D973092 +Test: Encrypt +Comment: Set 1, vector 69 +Key: 000000000000000004000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 700AFEA175DBEAE688F90B8D32990560 +Test: Encrypt +Comment: Set 1, vector 70 +Key: 000000000000000002000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 54AE9EFA09FC70A852212752B83AF1F2 +Test: Encrypt +Comment: Set 1, vector 71 +Key: 000000000000000001000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2474EF8E660333FC9763E137DDB1AA1F +Test: Encrypt +Comment: Set 1, vector 72 +Key: 000000000000000000800000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E52ECE1281186644B6A2228A89BD2304 +Test: Encrypt +Comment: Set 1, vector 73 +Key: 000000000000000000400000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 610A02ECEC1B5BA0C6EC7CE8D6197722 +Test: Encrypt +Comment: Set 1, vector 74 +Key: 000000000000000000200000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8A8AB3DA5CE37E1D68B496F110E4F941 +Test: Encrypt +Comment: Set 1, vector 75 +Key: 000000000000000000100000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6961F3A7E6550753C55E4C03FA7869E9 +Test: Encrypt +Comment: Set 1, vector 76 +Key: 000000000000000000080000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D8F149C207FAD4480BA2FC609BEB4471 +Test: Encrypt +Comment: Set 1, vector 77 +Key: 000000000000000000040000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DE9DC95336F2088935881DD57C0A4B98 +Test: Encrypt +Comment: Set 1, vector 78 +Key: 000000000000000000020000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DC4EA3B0F76439DB8847FE61C1A64F7A +Test: Encrypt +Comment: Set 1, vector 79 +Key: 000000000000000000010000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 21D4802EB72232AD2B0B46C50C98445B +Test: Encrypt +Comment: Set 1, vector 80 +Key: 000000000000000000008000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D6C32522B546BAC316E5F3A07F83FFE6 +Test: Encrypt +Comment: Set 1, vector 81 +Key: 000000000000000000004000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4B07B02C86B579A0C68D916DF8A1EB76 +Test: Encrypt +Comment: Set 1, vector 82 +Key: 000000000000000000002000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 060B15735C978DF9F4F3ED503B95D6C3 +Test: Encrypt +Comment: Set 1, vector 83 +Key: 000000000000000000001000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3040B3C9C560C968FE14664E3496D5D1 +Test: Encrypt +Comment: Set 1, vector 84 +Key: 000000000000000000000800000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8971CFB236598BBD46E47E172B0690F7 +Test: Encrypt +Comment: Set 1, vector 85 +Key: 000000000000000000000400000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8D7FAB4985A0BAC4CAEE341972D49CF4 +Test: Encrypt +Comment: Set 1, vector 86 +Key: 000000000000000000000200000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: ED29003D83CB7D7747C17A8691323021 +Test: Encrypt +Comment: Set 1, vector 87 +Key: 000000000000000000000100000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 98EBFDA32C99438F0A549B7BFAAC0635 +Test: Encrypt +Comment: Set 1, vector 88 +Key: 000000000000000000000080000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A59AB8EAF03BCDFD7CB0A9650E59F27B +Test: Encrypt +Comment: Set 1, vector 89 +Key: 000000000000000000000040000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 71422297CE93952D46FFC27530D6255D +Test: Encrypt +Comment: Set 1, vector 90 +Key: 000000000000000000000020000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 519E2607543C3AFE49190EBCA12ADBBC +Test: Encrypt +Comment: Set 1, vector 91 +Key: 000000000000000000000010000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8989C908C50E008E70EA5B897DC3544C +Test: Encrypt +Comment: Set 1, vector 92 +Key: 000000000000000000000008000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 981C174277F29F8DD06E1D4C97D9816F +Test: Encrypt +Comment: Set 1, vector 93 +Key: 000000000000000000000004000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0279DEC16A532E160AA5B4FF7682F696 +Test: Encrypt +Comment: Set 1, vector 94 +Key: 000000000000000000000002000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C3BFFB31FCB0A61188DE9AA606CB286C +Test: Encrypt +Comment: Set 1, vector 95 +Key: 000000000000000000000001000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5C1C4966B387A41D52F83BBF322D25DF +Test: Encrypt +Comment: Set 1, vector 96 +Key: 000000000000000000000000800000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6602ECC6AF62EF1EB4D17E2487A64F7A +Test: Encrypt +Comment: Set 1, vector 97 +Key: 000000000000000000000000400000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2DA725366BD7774BA235183CC9B273B4 +Test: Encrypt +Comment: Set 1, vector 98 +Key: 000000000000000000000000200000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 71B29CF87C313F0B89B75251EFC4FF7F +Test: Encrypt +Comment: Set 1, vector 99 +Key: 000000000000000000000000100000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4D9BDBCBA04C54AEAA7F48470428ECA2 +Test: Encrypt +Comment: Set 1, vector 100 +Key: 000000000000000000000000080000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C6BC53A3C6D6C8A6F12B97B151BFBB3F +Test: Encrypt +Comment: Set 1, vector 101 +Key: 000000000000000000000000040000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FD3E8D6732BBC2AA13F03F9AB0BCEC14 +Test: Encrypt +Comment: Set 1, vector 102 +Key: 000000000000000000000000020000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7D5ED8FEF289FF7F8953278E0A0297A1 +Test: Encrypt +Comment: Set 1, vector 103 +Key: 000000000000000000000000010000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 84A20023EF5E31771802E8A2FFBA485B +Test: Encrypt +Comment: Set 1, vector 104 +Key: 000000000000000000000000008000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7BD6E573AE79F0FA9FE38ECF6011D756 +Test: Encrypt +Comment: Set 1, vector 105 +Key: 000000000000000000000000004000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EB58EA6B6DE1282A7BB9EA1A2254A542 +Test: Encrypt +Comment: Set 1, vector 106 +Key: 000000000000000000000000002000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 30A697E325C4D3BEC8E69A2DAD2AE5BB +Test: Encrypt +Comment: Set 1, vector 107 +Key: 000000000000000000000000001000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3205F6FEAA38500AC74BE66FEDF3231E +Test: Encrypt +Comment: Set 1, vector 108 +Key: 000000000000000000000000000800000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 83C007676041E81B836886ABED807A71 +Test: Encrypt +Comment: Set 1, vector 109 +Key: 000000000000000000000000000400000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 24B33B3138855437CC11D3792A1FD00F +Test: Encrypt +Comment: Set 1, vector 110 +Key: 000000000000000000000000000200000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 26324D7E2C055366910464699D73608A +Test: Encrypt +Comment: Set 1, vector 111 +Key: 000000000000000000000000000100000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F9A94A959AE7CD2A9D5FB7274703906B +Test: Encrypt +Comment: Set 1, vector 112 +Key: 000000000000000000000000000080000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AD13D85E47EFC76B67ED25791E119A5C +Test: Encrypt +Comment: Set 1, vector 113 +Key: 000000000000000000000000000040000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5FB689176B296F2E579FC69A18FA07EB +Test: Encrypt +Comment: Set 1, vector 114 +Key: 000000000000000000000000000020000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 936DFBA0A052A299C195F34A66C0CEDF +Test: Encrypt +Comment: Set 1, vector 115 +Key: 000000000000000000000000000010000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 486C03278BB30F26D25AE0D6348C9491 +Test: Encrypt +Comment: Set 1, vector 116 +Key: 000000000000000000000000000008000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FCE14E6CE2073B5E8D1572A1EC1BD502 +Test: Encrypt +Comment: Set 1, vector 117 +Key: 000000000000000000000000000004000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5F15B8A64EDBF0E55C3B8BB67BC9B2E1 +Test: Encrypt +Comment: Set 1, vector 118 +Key: 000000000000000000000000000002000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7BDC738A342891C7BE06E87E12F71418 +Test: Encrypt +Comment: Set 1, vector 119 +Key: 000000000000000000000000000001000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 31C6FEDABBC8C8AD64C27505F02BC7CC +Test: Encrypt +Comment: Set 1, vector 120 +Key: 000000000000000000000000000000800000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 33CCD97EB8C3C06B7BCD16659E1F9837 +Test: Encrypt +Comment: Set 1, vector 121 +Key: 000000000000000000000000000000400000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 12C3089895D4A1C1D03DB0071F88AB1B +Test: Encrypt +Comment: Set 1, vector 122 +Key: 000000000000000000000000000000200000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8EB4796C7F7C3B0858750EBE3BAA335C +Test: Encrypt +Comment: Set 1, vector 123 +Key: 000000000000000000000000000000100000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 67169AF324151E92C6B7C31687B83783 +Test: Encrypt +Comment: Set 1, vector 124 +Key: 000000000000000000000000000000080000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AB0E10564D41594B55CE3D5B088D93B4 +Test: Encrypt +Comment: Set 1, vector 125 +Key: 000000000000000000000000000000040000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 45228986B08E63728239ADC9C249E475 +Test: Encrypt +Comment: Set 1, vector 126 +Key: 000000000000000000000000000000020000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CA7E48D5A4CD15984CA9EF99EC789EFD +Test: Encrypt +Comment: Set 1, vector 127 +Key: 000000000000000000000000000000010000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B4DD56FF85F7ABBEB9E0F5AE6B0E491D +Test: Encrypt +Comment: Set 1, vector 128 +Key: 000000000000000000000000000000008000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 044BE36D2F5A3D0FEA74443538F55393 +Test: Encrypt +Comment: Set 1, vector 129 +Key: 000000000000000000000000000000004000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 531EC401FB7C3BFADF64BB08E0DD9992 +Test: Encrypt +Comment: Set 1, vector 130 +Key: 000000000000000000000000000000002000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EA8D6B6963EC2267050F8CF5D1D1D939 +Test: Encrypt +Comment: Set 1, vector 131 +Key: 000000000000000000000000000000001000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CF5D7F27462FF7415D4E5ECBAEE0797C +Test: Encrypt +Comment: Set 1, vector 132 +Key: 000000000000000000000000000000000800000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DF28B8322D4B8606FF3EFF09D39697B0 +Test: Encrypt +Comment: Set 1, vector 133 +Key: 000000000000000000000000000000000400000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 956EF889AAB218E21FAF8E9CC2AE41F9 +Test: Encrypt +Comment: Set 1, vector 134 +Key: 000000000000000000000000000000000200000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AD0CF3C46F420E96B876DD55515B4B80 +Test: Encrypt +Comment: Set 1, vector 135 +Key: 000000000000000000000000000000000100000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EC8620D3B9B456633AD174573CF82ABD +Test: Encrypt +Comment: Set 1, vector 136 +Key: 000000000000000000000000000000000080000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A7CC6C810C1433B8D130594A48A36F69 +Test: Encrypt +Comment: Set 1, vector 137 +Key: 000000000000000000000000000000000040000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B02C5AF13D523A2A62E9F3829F9E3364 +Test: Encrypt +Comment: Set 1, vector 138 +Key: 000000000000000000000000000000000020000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5AC8368EC6150F08CC2C44DBA8A9D84F +Test: Encrypt +Comment: Set 1, vector 139 +Key: 000000000000000000000000000000000010000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3BD51735D6087217EEF17B40750D701F +Test: Encrypt +Comment: Set 1, vector 140 +Key: 000000000000000000000000000000000008000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 330CC76A5529364B08F722C6206214E7 +Test: Encrypt +Comment: Set 1, vector 141 +Key: 000000000000000000000000000000000004000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 13CA2152CB81267D8429670A8D983592 +Test: Encrypt +Comment: Set 1, vector 142 +Key: 000000000000000000000000000000000002000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3943D67CE79CB8519EB9A5D1021988ED +Test: Encrypt +Comment: Set 1, vector 143 +Key: 000000000000000000000000000000000001000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 642858D825E8640718ABE6174BD04A32 +Test: Encrypt +Comment: Set 1, vector 144 +Key: 000000000000000000000000000000000000800000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F22616DE88A4CCBF97CF2DB709237EC7 +Test: Encrypt +Comment: Set 1, vector 145 +Key: 000000000000000000000000000000000000400000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B90D7F6BF0D9FC11A01F2B33194806DB +Test: Encrypt +Comment: Set 1, vector 146 +Key: 000000000000000000000000000000000000200000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C161D350DC897B210D0D0CE8CE78F4B4 +Test: Encrypt +Comment: Set 1, vector 147 +Key: 000000000000000000000000000000000000100000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 66E46482150E7CF9BCBE60AF7BCA6892 +Test: Encrypt +Comment: Set 1, vector 148 +Key: 000000000000000000000000000000000000080000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B17C912E085D8854F220555EB0FA89BD +Test: Encrypt +Comment: Set 1, vector 149 +Key: 000000000000000000000000000000000000040000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6FD6A99633FBD3A6D238CADF37824AD2 +Test: Encrypt +Comment: Set 1, vector 150 +Key: 000000000000000000000000000000000000020000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9DE6D76D9A7E4AAB7A58EECE0E153D73 +Test: Encrypt +Comment: Set 1, vector 151 +Key: 000000000000000000000000000000000000010000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B4716A7DB10E3B8D1475C7EFB929F93A +Test: Encrypt +Comment: Set 1, vector 152 +Key: 000000000000000000000000000000000000008000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3D0F65F16AD143FB2FABDF4DFE621398 +Test: Encrypt +Comment: Set 1, vector 153 +Key: 000000000000000000000000000000000000004000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 249F1415D963DE146F4141C200B81D1D +Test: Encrypt +Comment: Set 1, vector 154 +Key: 000000000000000000000000000000000000002000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 454CD7040ED3851C3894F6259CE0D3FE +Test: Encrypt +Comment: Set 1, vector 155 +Key: 000000000000000000000000000000000000001000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4D613EE6FA78A573ECBE989A64193E0C +Test: Encrypt +Comment: Set 1, vector 156 +Key: 000000000000000000000000000000000000000800000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B39384E429291B9C22005BC9B3FF2DEF +Test: Encrypt +Comment: Set 1, vector 157 +Key: 000000000000000000000000000000000000000400000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 957D0B27740C952E45DB97C8814F49C0 +Test: Encrypt +Comment: Set 1, vector 158 +Key: 000000000000000000000000000000000000000200000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2879F58F238865D877D8C276CA9E9102 +Test: Encrypt +Comment: Set 1, vector 159 +Key: 000000000000000000000000000000000000000100000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EA5B920037608FC9D51F39488D4666F7 +Test: Encrypt +Comment: Set 1, vector 160 +Key: 000000000000000000000000000000000000000080000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7659A705ABCA25205078541E713088BC +Test: Encrypt +Comment: Set 1, vector 161 +Key: 000000000000000000000000000000000000000040000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 47E340BB8BF2E8E1015BEFB68C7B1100 +Test: Encrypt +Comment: Set 1, vector 162 +Key: 000000000000000000000000000000000000000020000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 777E3E572CA33076B2CB34226CC70158 +Test: Encrypt +Comment: Set 1, vector 163 +Key: 000000000000000000000000000000000000000010000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1FEC7C6719C7CA2E9A981851C5CEE204 +Test: Encrypt +Comment: Set 1, vector 164 +Key: 000000000000000000000000000000000000000008000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9AF07DABE083EFDA75708A36AEB74CAF +Test: Encrypt +Comment: Set 1, vector 165 +Key: 000000000000000000000000000000000000000004000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5D1482F8EF9CB18911BB7F78BC3B89FC +Test: Encrypt +Comment: Set 1, vector 166 +Key: 000000000000000000000000000000000000000002000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5242753E01D470DD8C2B73A986BA009F +Test: Encrypt +Comment: Set 1, vector 167 +Key: 000000000000000000000000000000000000000001000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 83AE5BC112B73AB7978D13DD534B770B +Test: Encrypt +Comment: Set 1, vector 168 +Key: 000000000000000000000000000000000000000000800000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 848EB7330A82B91D36FBEFF6E6CE1347 +Test: Encrypt +Comment: Set 1, vector 169 +Key: 000000000000000000000000000000000000000000400000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F1B14465EFFD3E14DD1BAC6E0FA4E5BD +Test: Encrypt +Comment: Set 1, vector 170 +Key: 000000000000000000000000000000000000000000200000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5ACD25AA05AFD21F43F6A51709FD0B6A +Test: Encrypt +Comment: Set 1, vector 171 +Key: 000000000000000000000000000000000000000000100000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 12321AEFA53F1503E3A473F729388CBD +Test: Encrypt +Comment: Set 1, vector 172 +Key: 000000000000000000000000000000000000000000080000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1602DBA20E2ACFDDCC78390B473B322B +Test: Encrypt +Comment: Set 1, vector 173 +Key: 000000000000000000000000000000000000000000040000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 14C1853C3CF3CDFCE3799D5C130138EC +Test: Encrypt +Comment: Set 1, vector 174 +Key: 000000000000000000000000000000000000000000020000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DC17F9E8236350BDC285F9B2F88F670F +Test: Encrypt +Comment: Set 1, vector 175 +Key: 000000000000000000000000000000000000000000010000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: ABA03FEE8133DD4ED9B8194B643E20CE +Test: Encrypt +Comment: Set 1, vector 176 +Key: 000000000000000000000000000000000000000000008000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5822E80530C7CECCE4F56CF1691B386F +Test: Encrypt +Comment: Set 1, vector 177 +Key: 000000000000000000000000000000000000000000004000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 25CFA6F1B9BE5E14DFAF87A44B3B2E3D +Test: Encrypt +Comment: Set 1, vector 178 +Key: 000000000000000000000000000000000000000000002000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5ED866CBC298B4DEE46C1A02F958F1F5 +Test: Encrypt +Comment: Set 1, vector 179 +Key: 000000000000000000000000000000000000000000001000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BD2B63C026EB0E58D26ED16D2ED64A3E +Test: Encrypt +Comment: Set 1, vector 180 +Key: 000000000000000000000000000000000000000000000800 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9FFCFF9CF9E1483BC7971888246AF9FE +Test: Encrypt +Comment: Set 1, vector 181 +Key: 000000000000000000000000000000000000000000000400 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 367C409AEE218E02DEAC8751698BA1B8 +Test: Encrypt +Comment: Set 1, vector 182 +Key: 000000000000000000000000000000000000000000000200 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 248E3A3C0360B44C512A9AC3CAAEC21B +Test: Encrypt +Comment: Set 1, vector 183 +Key: 000000000000000000000000000000000000000000000100 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 49B47C542CA396260B53A34372985612 +Test: Encrypt +Comment: Set 1, vector 184 +Key: 000000000000000000000000000000000000000000000080 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CE35FDBDBE086EA8A501A4571925A95F +Test: Encrypt +Comment: Set 1, vector 185 +Key: 000000000000000000000000000000000000000000000040 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 873442FAE891B0767220742B84A32A4E +Test: Encrypt +Comment: Set 1, vector 186 +Key: 000000000000000000000000000000000000000000000020 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2C90E17AD13E4E84686BC5B369F0FA8F +Test: Encrypt +Comment: Set 1, vector 187 +Key: 000000000000000000000000000000000000000000000010 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0E7AAAA67D8593A9DFC55083B48B381A +Test: Encrypt +Comment: Set 1, vector 188 +Key: 000000000000000000000000000000000000000000000008 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1D8B58EE529AB17B10AC15D0E6E7ECB2 +Test: Encrypt +Comment: Set 1, vector 189 +Key: 000000000000000000000000000000000000000000000004 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1C10FAC725B905AD93B6F4B2430A8D18 +Test: Encrypt +Comment: Set 1, vector 190 +Key: 000000000000000000000000000000000000000000000002 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D36CF625EE94AB029CD23253C77C0E15 +Test: Encrypt +Comment: Set 1, vector 191 +Key: 000000000000000000000000000000000000000000000001 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E37577F71E0E643C4D3F55219ABA1394 +Test: Encrypt +Comment: Set 2, vector 0 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 80000000000000000000000000000000 +Ciphertext: 3EB6CC5618EFC98455B5992050D474E7 +Test: Encrypt +Comment: Set 2, vector 1 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 40000000000000000000000000000000 +Ciphertext: A2C645044CBC74DE5A4A161C6B2E98B9 +Test: Encrypt +Comment: Set 2, vector 2 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 20000000000000000000000000000000 +Ciphertext: 36A9A8C164BD90D4972AB1BE56C96A0B +Test: Encrypt +Comment: Set 2, vector 3 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 10000000000000000000000000000000 +Ciphertext: 38965592D728F9B765140C0A36A1BCCD +Test: Encrypt +Comment: Set 2, vector 4 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 08000000000000000000000000000000 +Ciphertext: 94CDECA78E10827914A49B5AE7F15643 +Test: Encrypt +Comment: Set 2, vector 5 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 04000000000000000000000000000000 +Ciphertext: 11C0DF672B45CDCD311EB86A7560EDA1 +Test: Encrypt +Comment: Set 2, vector 6 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 02000000000000000000000000000000 +Ciphertext: 030CAA9B8DE6F8AB88882F9596D9B1B4 +Test: Encrypt +Comment: Set 2, vector 7 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 01000000000000000000000000000000 +Ciphertext: FA02C8D1CDDD08B1FE3650DBD8E43C4F +Test: Encrypt +Comment: Set 2, vector 8 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00800000000000000000000000000000 +Ciphertext: 10ACEC25736340600D712338357C7FD4 +Test: Encrypt +Comment: Set 2, vector 9 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00400000000000000000000000000000 +Ciphertext: BBEF172E9E18679C6546EA2D9357BDD1 +Test: Encrypt +Comment: Set 2, vector 10 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00200000000000000000000000000000 +Ciphertext: 707CF6F582F5921765DBC6E1C79C45B6 +Test: Encrypt +Comment: Set 2, vector 11 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00100000000000000000000000000000 +Ciphertext: 3E9206A85F9FE99CD5538FA196E58147 +Test: Encrypt +Comment: Set 2, vector 12 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00080000000000000000000000000000 +Ciphertext: 6758B118659E9BB40BB7DC8C3D15ECEC +Test: Encrypt +Comment: Set 2, vector 13 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00040000000000000000000000000000 +Ciphertext: 9BCA6C88B928C1B0F57F99866583A9BC +Test: Encrypt +Comment: Set 2, vector 14 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00020000000000000000000000000000 +Ciphertext: 53D60CF8CA0B41B3991EF892917FA26F +Test: Encrypt +Comment: Set 2, vector 15 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00010000000000000000000000000000 +Ciphertext: 49E438685E189FB95791C655FBF40B3B +Test: Encrypt +Comment: Set 2, vector 16 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00008000000000000000000000000000 +Ciphertext: 6BFE6661C074077EF95DC499CA30A6B9 +Test: Encrypt +Comment: Set 2, vector 17 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00004000000000000000000000000000 +Ciphertext: FE82A6754DD56ACBD1895F8257597B74 +Test: Encrypt +Comment: Set 2, vector 18 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00002000000000000000000000000000 +Ciphertext: AF4551CFCEAEF2AEE1933C4AB5F036F5 +Test: Encrypt +Comment: Set 2, vector 19 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00001000000000000000000000000000 +Ciphertext: 5175E53EA4CA77E085363B2948B77B17 +Test: Encrypt +Comment: Set 2, vector 20 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000800000000000000000000000000 +Ciphertext: 19F544B2B2AAE4AF00DE2853F83349A5 +Test: Encrypt +Comment: Set 2, vector 21 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000400000000000000000000000000 +Ciphertext: 45A4379AC855738F6FEE3AFFBB2D839F +Test: Encrypt +Comment: Set 2, vector 22 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000200000000000000000000000000 +Ciphertext: 73A390407DD07D4ABEB299A5051A8DD1 +Test: Encrypt +Comment: Set 2, vector 23 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000100000000000000000000000000 +Ciphertext: 923B1E3525217E5C7A41CE3BCAE7C083 +Test: Encrypt +Comment: Set 2, vector 24 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000080000000000000000000000000 +Ciphertext: F58098D6E68E975C922B05354C0E2094 +Test: Encrypt +Comment: Set 2, vector 25 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000040000000000000000000000000 +Ciphertext: 371631601CE2BED9B7706FA4254BBAE5 +Test: Encrypt +Comment: Set 2, vector 26 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000020000000000000000000000000 +Ciphertext: 794F34CD64B44095BAB5C470B36E60BE +Test: Encrypt +Comment: Set 2, vector 27 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000010000000000000000000000000 +Ciphertext: 1A4CE8CBFEDB4F64B1A64D926B9BE3A1 +Test: Encrypt +Comment: Set 2, vector 28 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000008000000000000000000000000 +Ciphertext: 11C391C85F8FCF72EB03E1C4CC40B529 +Test: Encrypt +Comment: Set 2, vector 29 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000004000000000000000000000000 +Ciphertext: 9D8ADDC48EC36BB449234C7C06BEDC0F +Test: Encrypt +Comment: Set 2, vector 30 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000002000000000000000000000000 +Ciphertext: 952A1FAD7FAEA148FA31B50C244CF5C4 +Test: Encrypt +Comment: Set 2, vector 31 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000001000000000000000000000000 +Ciphertext: 613E5E9BBBF1B9943B3B5CBD3E69C98F +Test: Encrypt +Comment: Set 2, vector 32 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000800000000000000000000000 +Ciphertext: 5ABF9CB600BB50DB64211DE2DEAEEDBA +Test: Encrypt +Comment: Set 2, vector 33 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000400000000000000000000000 +Ciphertext: 14697658FDA5B1F14C3303F5951CAE70 +Test: Encrypt +Comment: Set 2, vector 34 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000200000000000000000000000 +Ciphertext: 2A29179C05F2F5F5909A34130B92BB25 +Test: Encrypt +Comment: Set 2, vector 35 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000100000000000000000000000 +Ciphertext: 60A9DAB8068CC085F3B9853D0C1FCF07 +Test: Encrypt +Comment: Set 2, vector 36 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000080000000000000000000000 +Ciphertext: D625356ACCE7B9F874754AE52FD1C7BF +Test: Encrypt +Comment: Set 2, vector 37 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000040000000000000000000000 +Ciphertext: 31196A29DAA0A41E982819C26AF0567A +Test: Encrypt +Comment: Set 2, vector 38 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000020000000000000000000000 +Ciphertext: D1763FC019D77CC930BFF2A56F7C9364 +Test: Encrypt +Comment: Set 2, vector 39 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000010000000000000000000000 +Ciphertext: BBC9D3C96666B01D0C33CC067ADDA228 +Test: Encrypt +Comment: Set 2, vector 40 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000008000000000000000000000 +Ciphertext: 4FC9284574F433DD6C5ADEAB6DC64A06 +Test: Encrypt +Comment: Set 2, vector 41 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000004000000000000000000000 +Ciphertext: 7176B9E3628380ADDCF02493DB254B01 +Test: Encrypt +Comment: Set 2, vector 42 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000002000000000000000000000 +Ciphertext: C6B124A17B3AB55A983DC2B6E8253FF1 +Test: Encrypt +Comment: Set 2, vector 43 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000001000000000000000000000 +Ciphertext: 5853A6B6AB0FC47DEBA33526B628DF6E +Test: Encrypt +Comment: Set 2, vector 44 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000800000000000000000000 +Ciphertext: 416945C1D1902238C42955CFF166D705 +Test: Encrypt +Comment: Set 2, vector 45 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000400000000000000000000 +Ciphertext: 2478F40DC7B7FA98E59DA21F1D2140F9 +Test: Encrypt +Comment: Set 2, vector 46 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000200000000000000000000 +Ciphertext: 6A912316499FBECA17D1683EAF79FDC9 +Test: Encrypt +Comment: Set 2, vector 47 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000100000000000000000000 +Ciphertext: 8A41DB2271FD345BC1DDE61A427E4E3E +Test: Encrypt +Comment: Set 2, vector 48 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000080000000000000000000 +Ciphertext: B6C62C6A14D2276C8FE8D1062C1E8080 +Test: Encrypt +Comment: Set 2, vector 49 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000040000000000000000000 +Ciphertext: D23F90169810210A45BD9B8681B24C34 +Test: Encrypt +Comment: Set 2, vector 50 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000020000000000000000000 +Ciphertext: EDB2A77815A074B50D88C6C2B15AF814 +Test: Encrypt +Comment: Set 2, vector 51 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000010000000000000000000 +Ciphertext: 2D6D81C8FDD2C7D5B98317488846969D +Test: Encrypt +Comment: Set 2, vector 52 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000008000000000000000000 +Ciphertext: 92F2805613A82EE25568B32ED7550DCC +Test: Encrypt +Comment: Set 2, vector 53 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000004000000000000000000 +Ciphertext: E321480A1DE5F36040F1FD170F24802B +Test: Encrypt +Comment: Set 2, vector 54 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000002000000000000000000 +Ciphertext: 3188FFADE35652067E6E2228130762D6 +Test: Encrypt +Comment: Set 2, vector 55 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000001000000000000000000 +Ciphertext: B3A3A43D68A82EC54B5D437346375584 +Test: Encrypt +Comment: Set 2, vector 56 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000800000000000000000 +Ciphertext: 023ECF3BD9FEB4891366ABE45EC1728B +Test: Encrypt +Comment: Set 2, vector 57 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000400000000000000000 +Ciphertext: 50D8160676748E1718A030F4F512C1C2 +Test: Encrypt +Comment: Set 2, vector 58 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000200000000000000000 +Ciphertext: 30DF20541978D9C96D43D609DEF39C00 +Test: Encrypt +Comment: Set 2, vector 59 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000100000000000000000 +Ciphertext: BA1AA1682750C0CEB2A87E1A46A7CE0E +Test: Encrypt +Comment: Set 2, vector 60 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000080000000000000000 +Ciphertext: 03AC8261D8F98C90B9CE9C9E47A39AA5 +Test: Encrypt +Comment: Set 2, vector 61 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000040000000000000000 +Ciphertext: 4C6C2FDC2693F2A43EAEB180AD8190F8 +Test: Encrypt +Comment: Set 2, vector 62 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000020000000000000000 +Ciphertext: B65D2C8CEE12BB4FA127356632CB0ECA +Test: Encrypt +Comment: Set 2, vector 63 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000010000000000000000 +Ciphertext: 6D785867F379BCE03580ED9DE83C0EFD +Test: Encrypt +Comment: Set 2, vector 64 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000008000000000000000 +Ciphertext: D2B25B3EECB454DCE070D11C408D73B2 +Test: Encrypt +Comment: Set 2, vector 65 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000004000000000000000 +Ciphertext: 8035FF5E625955D6328F570D53188C0C +Test: Encrypt +Comment: Set 2, vector 66 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000002000000000000000 +Ciphertext: A8BECF868B0D964E04012BE5F8121A9C +Test: Encrypt +Comment: Set 2, vector 67 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000001000000000000000 +Ciphertext: AA76DF2E83C0D31ECFE66A62E16A91D3 +Test: Encrypt +Comment: Set 2, vector 68 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000800000000000000 +Ciphertext: BAA324177EA5AF61ADBD27F594297278 +Test: Encrypt +Comment: Set 2, vector 69 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000400000000000000 +Ciphertext: 40BBEB33938AFA9BD566991B53B0FDA7 +Test: Encrypt +Comment: Set 2, vector 70 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000200000000000000 +Ciphertext: 6F58204780BEA9102506C477CBB3C8FE +Test: Encrypt +Comment: Set 2, vector 71 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000100000000000000 +Ciphertext: D296BCA9261A3410E47FA289BD70B955 +Test: Encrypt +Comment: Set 2, vector 72 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000080000000000000 +Ciphertext: 4C57FB4234A64462C6D441A782723777 +Test: Encrypt +Comment: Set 2, vector 73 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000040000000000000 +Ciphertext: 33478DE51DBDA949E17CB82373DAF866 +Test: Encrypt +Comment: Set 2, vector 74 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000020000000000000 +Ciphertext: 7CC11B9A6A9E2CE13D3596686C624AF0 +Test: Encrypt +Comment: Set 2, vector 75 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000010000000000000 +Ciphertext: 0C55ACA2BDA80E8F84A3879FF077802A +Test: Encrypt +Comment: Set 2, vector 76 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000008000000000000 +Ciphertext: 885B84843BADC6501CBDCBEA4386AB7F +Test: Encrypt +Comment: Set 2, vector 77 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000004000000000000 +Ciphertext: DCF23815FEF1697B0618E205B637648A +Test: Encrypt +Comment: Set 2, vector 78 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000002000000000000 +Ciphertext: BF5EBE09157E65743AAD033473B0DFED +Test: Encrypt +Comment: Set 2, vector 79 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000001000000000000 +Ciphertext: 1E9E5E1032307B75915E9BD48205FEB8 +Test: Encrypt +Comment: Set 2, vector 80 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000800000000000 +Ciphertext: 0EB8AC09A10303A7CE9762C1B029F0E0 +Test: Encrypt +Comment: Set 2, vector 81 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000400000000000 +Ciphertext: 2A42627713BFC603A88AD1D66292B80C +Test: Encrypt +Comment: Set 2, vector 82 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000200000000000 +Ciphertext: D7E9512485B9E5E409FB51E26D269795 +Test: Encrypt +Comment: Set 2, vector 83 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000100000000000 +Ciphertext: 57CC59F8B92D73E1B38EEE405A8EC12F +Test: Encrypt +Comment: Set 2, vector 84 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000080000000000 +Ciphertext: 161783F5FFC9A383E36B80A2032A71F1 +Test: Encrypt +Comment: Set 2, vector 85 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000040000000000 +Ciphertext: F5B24CE20FFD8702AC63F9C844BC5730 +Test: Encrypt +Comment: Set 2, vector 86 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000020000000000 +Ciphertext: 440930601D4013076587D882A1958280 +Test: Encrypt +Comment: Set 2, vector 87 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000010000000000 +Ciphertext: AEA4C3F9E520651C5FE38B915423843F +Test: Encrypt +Comment: Set 2, vector 88 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000008000000000 +Ciphertext: E300D7417C4F547DBCD5FC84E3833A7B +Test: Encrypt +Comment: Set 2, vector 89 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000004000000000 +Ciphertext: 5543860CE9247B38E8D0E7B216C0B5A5 +Test: Encrypt +Comment: Set 2, vector 90 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000002000000000 +Ciphertext: C20449053BF90C899899EE02794DB3C5 +Test: Encrypt +Comment: Set 2, vector 91 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000001000000000 +Ciphertext: AC0CB3B34AC32244CF196AE49E94D380 +Test: Encrypt +Comment: Set 2, vector 92 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000800000000 +Ciphertext: 0CDF3F25852287E3BAFAF490DE18D125 +Test: Encrypt +Comment: Set 2, vector 93 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000400000000 +Ciphertext: 583BB44512CE75268F72E6BC6682901B +Test: Encrypt +Comment: Set 2, vector 94 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000200000000 +Ciphertext: 217140522F0C505FDAC4BFDE6E9D9A81 +Test: Encrypt +Comment: Set 2, vector 95 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000100000000 +Ciphertext: CFA59EB13DDD780A2EAEF89E83737C9A +Test: Encrypt +Comment: Set 2, vector 96 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000080000000 +Ciphertext: 75E473CCD4D116426753B44900D919A6 +Test: Encrypt +Comment: Set 2, vector 97 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000040000000 +Ciphertext: E15E4627F7F8A3F09424D3D5CAC1C777 +Test: Encrypt +Comment: Set 2, vector 98 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000020000000 +Ciphertext: B83E20A23802D8755A2E850242B64EEF +Test: Encrypt +Comment: Set 2, vector 99 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000010000000 +Ciphertext: E6790AF3911360F28FD17886DD311F88 +Test: Encrypt +Comment: Set 2, vector 100 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000008000000 +Ciphertext: 0A6304DF33E409C8A21E1C19187183FF +Test: Encrypt +Comment: Set 2, vector 101 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000004000000 +Ciphertext: 51966561DA7ED5F30130B55CD108B5BE +Test: Encrypt +Comment: Set 2, vector 102 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000002000000 +Ciphertext: 0ECA40693BF4CB41FDD15BCFD8C9D9B9 +Test: Encrypt +Comment: Set 2, vector 103 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000001000000 +Ciphertext: 8731B42742ADBA2D89C9BA90EBD4E42A +Test: Encrypt +Comment: Set 2, vector 104 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000800000 +Ciphertext: BE4C6C18AA231E9BB13909242CC92EE3 +Test: Encrypt +Comment: Set 2, vector 105 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000400000 +Ciphertext: 39AC45537E9AFDC6C8BDD4204039A218 +Test: Encrypt +Comment: Set 2, vector 106 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000200000 +Ciphertext: AEA354F16E1E8EECEB5A98D88418B1A0 +Test: Encrypt +Comment: Set 2, vector 107 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000100000 +Ciphertext: 4F5D37D7D0DC7714E62BE4A0331DB07B +Test: Encrypt +Comment: Set 2, vector 108 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000080000 +Ciphertext: 9603F03C3CAA8C2F0ECFBA1374891007 +Test: Encrypt +Comment: Set 2, vector 109 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000040000 +Ciphertext: C58768944996884B46A8FFDDB9AB87EF +Test: Encrypt +Comment: Set 2, vector 110 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000020000 +Ciphertext: 3BCCF2396A97FC1C0CFFFB6ED41716DB +Test: Encrypt +Comment: Set 2, vector 111 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000010000 +Ciphertext: DC299278DCA45AC1B6B08ED4B62D9BC9 +Test: Encrypt +Comment: Set 2, vector 112 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000008000 +Ciphertext: E195AECA31E10241BD0EC4AC5418A25D +Test: Encrypt +Comment: Set 2, vector 113 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000004000 +Ciphertext: B397A4983ED647A0EB806ACDFE7BCB34 +Test: Encrypt +Comment: Set 2, vector 114 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000002000 +Ciphertext: BC8F7224B0447E8A1CF0F5506A060F3C +Test: Encrypt +Comment: Set 2, vector 115 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000001000 +Ciphertext: FFD3ED02E7F64A5D6B37A9DC5E531646 +Test: Encrypt +Comment: Set 2, vector 116 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000800 +Ciphertext: BC6019EB208B7AF8EFA6AE7B4CA0556B +Test: Encrypt +Comment: Set 2, vector 117 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000400 +Ciphertext: D2915AE2779F8F70E17CE953C6C1A380 +Test: Encrypt +Comment: Set 2, vector 118 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000200 +Ciphertext: B2AA4B1ED2285C9DA4088B6E9681C690 +Test: Encrypt +Comment: Set 2, vector 119 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000100 +Ciphertext: BE0D64EA88A3FF27C8DFCE13F13A4E1F +Test: Encrypt +Comment: Set 2, vector 120 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000080 +Ciphertext: D7629F1DD395A985AF9497F6ACB4EDA1 +Test: Encrypt +Comment: Set 2, vector 121 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000040 +Ciphertext: 33FDF72DA1D8815DE2DBE81D97DDC6F8 +Test: Encrypt +Comment: Set 2, vector 122 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000020 +Ciphertext: D35742045F3DF8D184D6CC58EB9DE323 +Test: Encrypt +Comment: Set 2, vector 123 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000010 +Ciphertext: DE6469D10C044ED53CFEB523C8DF34A2 +Test: Encrypt +Comment: Set 2, vector 124 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000008 +Ciphertext: 2FAEAC3A41CCEABA8140BDA9C7AC7740 +Test: Encrypt +Comment: Set 2, vector 125 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000004 +Ciphertext: 7BA6691787BF0C526F3697E2ED659B0D +Test: Encrypt +Comment: Set 2, vector 126 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000002 +Ciphertext: 8F9C0AA2549714C88BB2665E8AF86D41 +Test: Encrypt +Comment: Set 2, vector 127 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000001 +Ciphertext: BA9AE89FDDCE4B51131E17C4D65CE587 +Test: Encrypt +Comment: Set 3, vector 0 +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 56E1E129CA5C02C7F9AC6AFDEF86ADC3 +Test: Encrypt +Comment: Set 3, vector 1 +Key: 010101010101010101010101010101010101010101010101 +Plaintext: 01010101010101010101010101010101 +Ciphertext: 8F764397C10BE84BA876CEEFA4225BFF +Test: Encrypt +Comment: Set 3, vector 2 +Key: 020202020202020202020202020202020202020202020202 +Plaintext: 02020202020202020202020202020202 +Ciphertext: 60B00674BFD444D07B5A19851E6151CD +Test: Encrypt +Comment: Set 3, vector 3 +Key: 030303030303030303030303030303030303030303030303 +Plaintext: 03030303030303030303030303030303 +Ciphertext: CF431D70E25D5450B9979C52E4ECF590 +Test: Encrypt +Comment: Set 3, vector 4 +Key: 040404040404040404040404040404040404040404040404 +Plaintext: 04040404040404040404040404040404 +Ciphertext: 81B26FF4F6B4377CC555873504B3A38B +Test: Encrypt +Comment: Set 3, vector 5 +Key: 050505050505050505050505050505050505050505050505 +Plaintext: 05050505050505050505050505050505 +Ciphertext: 8C864C445E6B9312E6F3843C53BF7870 +Test: Encrypt +Comment: Set 3, vector 6 +Key: 060606060606060606060606060606060606060606060606 +Plaintext: 06060606060606060606060606060606 +Ciphertext: 28C1EABB23C2A04E7A37BB0EF42D45A2 +Test: Encrypt +Comment: Set 3, vector 7 +Key: 070707070707070707070707070707070707070707070707 +Plaintext: 07070707070707070707070707070707 +Ciphertext: 0068C08827CBD904A3C0AF89A35CD8E6 +Test: Encrypt +Comment: Set 3, vector 8 +Key: 080808080808080808080808080808080808080808080808 +Plaintext: 08080808080808080808080808080808 +Ciphertext: A2AA1C6693DC2B70D75C9B39B9B214D0 +Test: Encrypt +Comment: Set 3, vector 9 +Key: 090909090909090909090909090909090909090909090909 +Plaintext: 09090909090909090909090909090909 +Ciphertext: 0423A756A133734C66944536033B978C +Test: Encrypt +Comment: Set 3, vector 10 +Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Ciphertext: 279B7FA09352F4194B2C33089267BD2E +Test: Encrypt +Comment: Set 3, vector 11 +Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Ciphertext: 7788EEE46AC2927434A93D3B5D295DF3 +Test: Encrypt +Comment: Set 3, vector 12 +Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Ciphertext: 3A2D0C1F30AE1E50A61102D2DF5BEAE5 +Test: Encrypt +Comment: Set 3, vector 13 +Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Ciphertext: 320FB708B47319484538CD73F8773526 +Test: Encrypt +Comment: Set 3, vector 14 +Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Ciphertext: 6213EB688C8CDA5152A65BFC007BCAEA +Test: Encrypt +Comment: Set 3, vector 15 +Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Ciphertext: D1904ACDB021DDCCCBE436CA7B5A4264 +Test: Encrypt +Comment: Set 3, vector 16 +Key: 101010101010101010101010101010101010101010101010 +Plaintext: 10101010101010101010101010101010 +Ciphertext: A907BFDAEEF8C81D05855235E8D3BE08 +Test: Encrypt +Comment: Set 3, vector 17 +Key: 111111111111111111111111111111111111111111111111 +Plaintext: 11111111111111111111111111111111 +Ciphertext: DB23D9326A998A4CB06AE04A8C592217 +Test: Encrypt +Comment: Set 3, vector 18 +Key: 121212121212121212121212121212121212121212121212 +Plaintext: 12121212121212121212121212121212 +Ciphertext: 472427C234EAE3082E84F493C9559792 +Test: Encrypt +Comment: Set 3, vector 19 +Key: 131313131313131313131313131313131313131313131313 +Plaintext: 13131313131313131313131313131313 +Ciphertext: EE4E318D27820F691BD3BDA9617561A0 +Test: Encrypt +Comment: Set 3, vector 20 +Key: 141414141414141414141414141414141414141414141414 +Plaintext: 14141414141414141414141414141414 +Ciphertext: 221E909D7B259C098480DBDE71BCF9BF +Test: Encrypt +Comment: Set 3, vector 21 +Key: 151515151515151515151515151515151515151515151515 +Plaintext: 15151515151515151515151515151515 +Ciphertext: 8702C6A150F2DD2E1736F09518C1A267 +Test: Encrypt +Comment: Set 3, vector 22 +Key: 161616161616161616161616161616161616161616161616 +Plaintext: 16161616161616161616161616161616 +Ciphertext: 7E8DAEBBA15C7B9705B501998F61CC6E +Test: Encrypt +Comment: Set 3, vector 23 +Key: 171717171717171717171717171717171717171717171717 +Plaintext: 17171717171717171717171717171717 +Ciphertext: 3DD555C7277FA156330D05CD621394D5 +Test: Encrypt +Comment: Set 3, vector 24 +Key: 181818181818181818181818181818181818181818181818 +Plaintext: 18181818181818181818181818181818 +Ciphertext: E5575CDC315F1C244441E6D1DE25ED20 +Test: Encrypt +Comment: Set 3, vector 25 +Key: 191919191919191919191919191919191919191919191919 +Plaintext: 19191919191919191919191919191919 +Ciphertext: 434859EB42087F83B9849DC23ABB7C1D +Test: Encrypt +Comment: Set 3, vector 26 +Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Ciphertext: 1EA1A5CC662DCA0B56B2BBF560A1B032 +Test: Encrypt +Comment: Set 3, vector 27 +Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Ciphertext: A3AC0CD9342242A72005F8E6DBF50DE8 +Test: Encrypt +Comment: Set 3, vector 28 +Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Ciphertext: AF6251A285EBEA9408315822F2072D86 +Test: Encrypt +Comment: Set 3, vector 29 +Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Ciphertext: FA084220DB82A88E6D7B6E7849550183 +Test: Encrypt +Comment: Set 3, vector 30 +Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Ciphertext: E7AABEAA3F669E0D963A19C3BDE43676 +Test: Encrypt +Comment: Set 3, vector 31 +Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Ciphertext: ED7C11A689A72FF834A777013DBEC50A +Test: Encrypt +Comment: Set 3, vector 32 +Key: 202020202020202020202020202020202020202020202020 +Plaintext: 20202020202020202020202020202020 +Ciphertext: 87F8EA30332036F17CEAC0097CE33BC1 +Test: Encrypt +Comment: Set 3, vector 33 +Key: 212121212121212121212121212121212121212121212121 +Plaintext: 21212121212121212121212121212121 +Ciphertext: E83CC178B21703D1BDFA0A1350A587F3 +Test: Encrypt +Comment: Set 3, vector 34 +Key: 222222222222222222222222222222222222222222222222 +Plaintext: 22222222222222222222222222222222 +Ciphertext: 581CF260A93B67E27BBA6D6D68C645B6 +Test: Encrypt +Comment: Set 3, vector 35 +Key: 232323232323232323232323232323232323232323232323 +Plaintext: 23232323232323232323232323232323 +Ciphertext: D7155FD4BABA5DAA1E0576BAF4BB3BDE +Test: Encrypt +Comment: Set 3, vector 36 +Key: 242424242424242424242424242424242424242424242424 +Plaintext: 24242424242424242424242424242424 +Ciphertext: 0C2382377892DC0CA4B1C7753CDB2753 +Test: Encrypt +Comment: Set 3, vector 37 +Key: 252525252525252525252525252525252525252525252525 +Plaintext: 25252525252525252525252525252525 +Ciphertext: 9E568ACFE44E1926BE207D25107EBD90 +Test: Encrypt +Comment: Set 3, vector 38 +Key: 262626262626262626262626262626262626262626262626 +Plaintext: 26262626262626262626262626262626 +Ciphertext: 1F9C7FEF0BA7D4C38555B957FA9FDAC8 +Test: Encrypt +Comment: Set 3, vector 39 +Key: 272727272727272727272727272727272727272727272727 +Plaintext: 27272727272727272727272727272727 +Ciphertext: 2C00730AAB18247D4F79C8BA0107E759 +Test: Encrypt +Comment: Set 3, vector 40 +Key: 282828282828282828282828282828282828282828282828 +Plaintext: 28282828282828282828282828282828 +Ciphertext: 26150BB68C5529903D3624CB8F36D717 +Test: Encrypt +Comment: Set 3, vector 41 +Key: 292929292929292929292929292929292929292929292929 +Plaintext: 29292929292929292929292929292929 +Ciphertext: C6F9CD75F9DC3DF5C945E028038660AB +Test: Encrypt +Comment: Set 3, vector 42 +Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Ciphertext: 9D90F692A1149E3E7F19BE419038F42F +Test: Encrypt +Comment: Set 3, vector 43 +Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Ciphertext: 9981F6F8C071F4CAF3E25884B8749FD3 +Test: Encrypt +Comment: Set 3, vector 44 +Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Ciphertext: 62957FC449C78B7EABA9C41B335F731E +Test: Encrypt +Comment: Set 3, vector 45 +Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Ciphertext: 265E17BD08B2E34BC879D5BC801D1217 +Test: Encrypt +Comment: Set 3, vector 46 +Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Ciphertext: 55BBE8CE99907AC77D4F009EABA6B8D9 +Test: Encrypt +Comment: Set 3, vector 47 +Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Ciphertext: EECB495C2F81243857D0A1A8919F9C7E +Test: Encrypt +Comment: Set 3, vector 48 +Key: 303030303030303030303030303030303030303030303030 +Plaintext: 30303030303030303030303030303030 +Ciphertext: E3BA996DF81895C86E30500CE9F7ED01 +Test: Encrypt +Comment: Set 3, vector 49 +Key: 313131313131313131313131313131313131313131313131 +Plaintext: 31313131313131313131313131313131 +Ciphertext: E507914B7CDDB2A3A915EB5663CE43CE +Test: Encrypt +Comment: Set 3, vector 50 +Key: 323232323232323232323232323232323232323232323232 +Plaintext: 32323232323232323232323232323232 +Ciphertext: AA2E53FC2D073DE62554691F507B23FF +Test: Encrypt +Comment: Set 3, vector 51 +Key: 333333333333333333333333333333333333333333333333 +Plaintext: 33333333333333333333333333333333 +Ciphertext: 875707D7E4FA8028D878DFB8338160FF +Test: Encrypt +Comment: Set 3, vector 52 +Key: 343434343434343434343434343434343434343434343434 +Plaintext: 34343434343434343434343434343434 +Ciphertext: 1158285A6787F8B6500E9FB046D88FB7 +Test: Encrypt +Comment: Set 3, vector 53 +Key: 353535353535353535353535353535353535353535353535 +Plaintext: 35353535353535353535353535353535 +Ciphertext: 6BFF4FB554ADD3F4321E6BA6029CD48A +Test: Encrypt +Comment: Set 3, vector 54 +Key: 363636363636363636363636363636363636363636363636 +Plaintext: 36363636363636363636363636363636 +Ciphertext: 8F2077CE672419A3AE15CA8800D5ACF8 +Test: Encrypt +Comment: Set 3, vector 55 +Key: 373737373737373737373737373737373737373737373737 +Plaintext: 37373737373737373737373737373737 +Ciphertext: 80ECE69E3EEBD391FCAEA8B3B38578D9 +Test: Encrypt +Comment: Set 3, vector 56 +Key: 383838383838383838383838383838383838383838383838 +Plaintext: 38383838383838383838383838383838 +Ciphertext: A23A2ADDE21BDB44EF99072331FA8EAB +Test: Encrypt +Comment: Set 3, vector 57 +Key: 393939393939393939393939393939393939393939393939 +Plaintext: 39393939393939393939393939393939 +Ciphertext: 8E41065415264354D4DC276F6ED582B9 +Test: Encrypt +Comment: Set 3, vector 58 +Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Ciphertext: D591D51BA578836C7D3945991FD0184A +Test: Encrypt +Comment: Set 3, vector 59 +Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Ciphertext: B88105C11F9FFCA9037E1F90FAE1C61E +Test: Encrypt +Comment: Set 3, vector 60 +Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Ciphertext: F8A1A047994B4363028BC1B3B6339954 +Test: Encrypt +Comment: Set 3, vector 61 +Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Ciphertext: EFB57CEA359E1F9F68729B156BEBDCB8 +Test: Encrypt +Comment: Set 3, vector 62 +Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Ciphertext: 2323D15570873D4E5616CDDC466B1D34 +Test: Encrypt +Comment: Set 3, vector 63 +Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Ciphertext: 842C7B6C67BB38B508558058531B37FE +Test: Encrypt +Comment: Set 3, vector 64 +Key: 404040404040404040404040404040404040404040404040 +Plaintext: 40404040404040404040404040404040 +Ciphertext: A2C32EA499E41A248565253BACC11E3B +Test: Encrypt +Comment: Set 3, vector 65 +Key: 414141414141414141414141414141414141414141414141 +Plaintext: 41414141414141414141414141414141 +Ciphertext: CF72033A0BA3E03A8B1E336F85100489 +Test: Encrypt +Comment: Set 3, vector 66 +Key: 424242424242424242424242424242424242424242424242 +Plaintext: 42424242424242424242424242424242 +Ciphertext: 0A194208C1B722A5719C14231EE4C532 +Test: Encrypt +Comment: Set 3, vector 67 +Key: 434343434343434343434343434343434343434343434343 +Plaintext: 43434343434343434343434343434343 +Ciphertext: 7365018F7A2564165EC162F948C4824A +Test: Encrypt +Comment: Set 3, vector 68 +Key: 444444444444444444444444444444444444444444444444 +Plaintext: 44444444444444444444444444444444 +Ciphertext: 20AC87CE21C47D99D6D2202B0C62E52D +Test: Encrypt +Comment: Set 3, vector 69 +Key: 454545454545454545454545454545454545454545454545 +Plaintext: 45454545454545454545454545454545 +Ciphertext: 72D32F7C4D03529C7DBF6865E36E7C84 +Test: Encrypt +Comment: Set 3, vector 70 +Key: 464646464646464646464646464646464646464646464646 +Plaintext: 46464646464646464646464646464646 +Ciphertext: 18E88EF941A7D1793B8D545323CCBD7E +Test: Encrypt +Comment: Set 3, vector 71 +Key: 474747474747474747474747474747474747474747474747 +Plaintext: 47474747474747474747474747474747 +Ciphertext: C87B12CD28646842FCE0C8658EA8A6C9 +Test: Encrypt +Comment: Set 3, vector 72 +Key: 484848484848484848484848484848484848484848484848 +Plaintext: 48484848484848484848484848484848 +Ciphertext: 03347AC4B4D0AE9C208B1B12802E6562 +Test: Encrypt +Comment: Set 3, vector 73 +Key: 494949494949494949494949494949494949494949494949 +Plaintext: 49494949494949494949494949494949 +Ciphertext: A5F9E726E53A74C9CF59E7CBBCE507D1 +Test: Encrypt +Comment: Set 3, vector 74 +Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Ciphertext: 228C852461BBB0BB12B3F9192311DFDD +Test: Encrypt +Comment: Set 3, vector 75 +Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Ciphertext: DFD5B30B1401FBE49EA0C725E64B91A3 +Test: Encrypt +Comment: Set 3, vector 76 +Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Ciphertext: 38D59DD18C98488451070B28F91A15C0 +Test: Encrypt +Comment: Set 3, vector 77 +Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Ciphertext: E6A73709A37C7B00484BD54EED3A6128 +Test: Encrypt +Comment: Set 3, vector 78 +Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Ciphertext: 12A6AD3ED9A3BA4FBA285B64D4823706 +Test: Encrypt +Comment: Set 3, vector 79 +Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Ciphertext: CCB3FFAD253207DFB312A8B4FE0F390D +Test: Encrypt +Comment: Set 3, vector 80 +Key: 505050505050505050505050505050505050505050505050 +Plaintext: 50505050505050505050505050505050 +Ciphertext: A1C7DFA83502CE5558242F83CC12BF82 +Test: Encrypt +Comment: Set 3, vector 81 +Key: 515151515151515151515151515151515151515151515151 +Plaintext: 51515151515151515151515151515151 +Ciphertext: C9C8FCD1E4E482AF47555FEA823DE62A +Test: Encrypt +Comment: Set 3, vector 82 +Key: 525252525252525252525252525252525252525252525252 +Plaintext: 52525252525252525252525252525252 +Ciphertext: 5F9DD3265B6B043BF4CE8E11A3DAE4E1 +Test: Encrypt +Comment: Set 3, vector 83 +Key: 535353535353535353535353535353535353535353535353 +Plaintext: 53535353535353535353535353535353 +Ciphertext: 79D02BFAD35C67C8586694A068662F1D +Test: Encrypt +Comment: Set 3, vector 84 +Key: 545454545454545454545454545454545454545454545454 +Plaintext: 54545454545454545454545454545454 +Ciphertext: 361AC03A4827F590A5DDE28A5FFF723A +Test: Encrypt +Comment: Set 3, vector 85 +Key: 555555555555555555555555555555555555555555555555 +Plaintext: 55555555555555555555555555555555 +Ciphertext: 1758AC2E8DDE2126621AEB5759FC93D0 +Test: Encrypt +Comment: Set 3, vector 86 +Key: 565656565656565656565656565656565656565656565656 +Plaintext: 56565656565656565656565656565656 +Ciphertext: 14422A052A86DC0033B70F77D46A7E3C +Test: Encrypt +Comment: Set 3, vector 87 +Key: 575757575757575757575757575757575757575757575757 +Plaintext: 57575757575757575757575757575757 +Ciphertext: 154457A732BC11F0A4C43BEC607B9B91 +Test: Encrypt +Comment: Set 3, vector 88 +Key: 585858585858585858585858585858585858585858585858 +Plaintext: 58585858585858585858585858585858 +Ciphertext: 789BBC53CBE8A7D6119F61C8DC5DAEAB +Test: Encrypt +Comment: Set 3, vector 89 +Key: 595959595959595959595959595959595959595959595959 +Plaintext: 59595959595959595959595959595959 +Ciphertext: 6F8CDA92BF849BE59858544689DA2ACE +Test: Encrypt +Comment: Set 3, vector 90 +Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Ciphertext: CCA696D494AF8877C0753106D5AD07A6 +Test: Encrypt +Comment: Set 3, vector 91 +Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Ciphertext: E76884CA9F00DCF95BBB15C5FBB26D1C +Test: Encrypt +Comment: Set 3, vector 92 +Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Ciphertext: CD3FA7BC9EC9EC0B0CF4F5A82A98550E +Test: Encrypt +Comment: Set 3, vector 93 +Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Ciphertext: BC2FB535DC0D8C86682E32AC3761F299 +Test: Encrypt +Comment: Set 3, vector 94 +Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Ciphertext: AB19152E1788D8B2878357484832BB27 +Test: Encrypt +Comment: Set 3, vector 95 +Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Ciphertext: 87D1D7E297CED2C6606A171794FE1BB2 +Test: Encrypt +Comment: Set 3, vector 96 +Key: 606060606060606060606060606060606060606060606060 +Plaintext: 60606060606060606060606060606060 +Ciphertext: 6BF6F1728474F1050F712A0FF3F59319 +Test: Encrypt +Comment: Set 3, vector 97 +Key: 616161616161616161616161616161616161616161616161 +Plaintext: 61616161616161616161616161616161 +Ciphertext: 46646FF0ED8A8EDB395BA4B3DC97A35F +Test: Encrypt +Comment: Set 3, vector 98 +Key: 626262626262626262626262626262626262626262626262 +Plaintext: 62626262626262626262626262626262 +Ciphertext: F558C5F67CDF59374F5426D5846A622E +Test: Encrypt +Comment: Set 3, vector 99 +Key: 636363636363636363636363636363636363636363636363 +Plaintext: 63636363636363636363636363636363 +Ciphertext: E06CC0A3436C80F5F0271ACFC8F535D3 +Test: Encrypt +Comment: Set 3, vector 100 +Key: 646464646464646464646464646464646464646464646464 +Plaintext: 64646464646464646464646464646464 +Ciphertext: 903AA2EA9F99C3CCDD1EF1CD906FC800 +Test: Encrypt +Comment: Set 3, vector 101 +Key: 656565656565656565656565656565656565656565656565 +Plaintext: 65656565656565656565656565656565 +Ciphertext: EAE1010E86CF45476CEB180E78608841 +Test: Encrypt +Comment: Set 3, vector 102 +Key: 666666666666666666666666666666666666666666666666 +Plaintext: 66666666666666666666666666666666 +Ciphertext: 341F33B7FB7C5807BFB4C2C497565817 +Test: Encrypt +Comment: Set 3, vector 103 +Key: 676767676767676767676767676767676767676767676767 +Plaintext: 67676767676767676767676767676767 +Ciphertext: 4DA345AB1B3F7575F8D01BED5C17AF26 +Test: Encrypt +Comment: Set 3, vector 104 +Key: 686868686868686868686868686868686868686868686868 +Plaintext: 68686868686868686868686868686868 +Ciphertext: 1613C2DE21E7082312BF414C88310FAB +Test: Encrypt +Comment: Set 3, vector 105 +Key: 696969696969696969696969696969696969696969696969 +Plaintext: 69696969696969696969696969696969 +Ciphertext: 474D73001BD4BF9A9B79CFF79198E2F3 +Test: Encrypt +Comment: Set 3, vector 106 +Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Ciphertext: 9C487E0BFB6FE07C521C663D03F175CF +Test: Encrypt +Comment: Set 3, vector 107 +Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Ciphertext: 39F5672BEFCFCC072F292D47AD481DC7 +Test: Encrypt +Comment: Set 3, vector 108 +Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Ciphertext: D9B86F02C3CB07CEF53834924A01DF14 +Test: Encrypt +Comment: Set 3, vector 109 +Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Ciphertext: B42C9F4A33C5425FB20425889ECFFB9D +Test: Encrypt +Comment: Set 3, vector 110 +Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Ciphertext: 832D535E3B4C40113C82AE10A7E1B78A +Test: Encrypt +Comment: Set 3, vector 111 +Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Ciphertext: E9A8F63AAF1B1FFF05CFEB7E22E519DF +Test: Encrypt +Comment: Set 3, vector 112 +Key: 707070707070707070707070707070707070707070707070 +Plaintext: 70707070707070707070707070707070 +Ciphertext: C61B4EF13F07576701B1018AC9F01863 +Test: Encrypt +Comment: Set 3, vector 113 +Key: 717171717171717171717171717171717171717171717171 +Plaintext: 71717171717171717171717171717171 +Ciphertext: B098DBE07C3528931F14D40AC9F99ACC +Test: Encrypt +Comment: Set 3, vector 114 +Key: 727272727272727272727272727272727272727272727272 +Plaintext: 72727272727272727272727272727272 +Ciphertext: 3FCC0182E96BC01863EB161967D6482A +Test: Encrypt +Comment: Set 3, vector 115 +Key: 737373737373737373737373737373737373737373737373 +Plaintext: 73737373737373737373737373737373 +Ciphertext: D8F20E80F4AC4666066B0E3F1966C8DA +Test: Encrypt +Comment: Set 3, vector 116 +Key: 747474747474747474747474747474747474747474747474 +Plaintext: 74747474747474747474747474747474 +Ciphertext: 4E96D8CC1A34E3C38C37B5339CF26A5D +Test: Encrypt +Comment: Set 3, vector 117 +Key: 757575757575757575757575757575757575757575757575 +Plaintext: 75757575757575757575757575757575 +Ciphertext: 266EDB14B89857636C0F8E8C7D2FACD8 +Test: Encrypt +Comment: Set 3, vector 118 +Key: 767676767676767676767676767676767676767676767676 +Plaintext: 76767676767676767676767676767676 +Ciphertext: 1D060BD61CFA82764CE4DF283FCB2278 +Test: Encrypt +Comment: Set 3, vector 119 +Key: 777777777777777777777777777777777777777777777777 +Plaintext: 77777777777777777777777777777777 +Ciphertext: 4734355A933BFC1F2918CDF1A4E2BAAE +Test: Encrypt +Comment: Set 3, vector 120 +Key: 787878787878787878787878787878787878787878787878 +Plaintext: 78787878787878787878787878787878 +Ciphertext: DADBACBB42FEB35635A8DEBBFA93F5BA +Test: Encrypt +Comment: Set 3, vector 121 +Key: 797979797979797979797979797979797979797979797979 +Plaintext: 79797979797979797979797979797979 +Ciphertext: 8BB5C2E0B44B986EF523870C41721B7D +Test: Encrypt +Comment: Set 3, vector 122 +Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Ciphertext: F66844E5DC500F43FF95E05965BAFD63 +Test: Encrypt +Comment: Set 3, vector 123 +Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Ciphertext: ECC75A2BE7E27481907621A1796DC821 +Test: Encrypt +Comment: Set 3, vector 124 +Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Ciphertext: D195666137F49B67F80EBC8C3ED824BF +Test: Encrypt +Comment: Set 3, vector 125 +Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Ciphertext: 2F1ACC482BE5DEFD3EC1AD1F3A064A60 +Test: Encrypt +Comment: Set 3, vector 126 +Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Ciphertext: 5FDDFA05A7F72D294DC386260DC59009 +Test: Encrypt +Comment: Set 3, vector 127 +Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Ciphertext: FE94D733BABEB5A5382C2816311E515E +Test: Encrypt +Comment: Set 3, vector 128 +Key: 808080808080808080808080808080808080808080808080 +Plaintext: 80808080808080808080808080808080 +Ciphertext: F602BA7F515B082983B8F7A27F92408F +Test: Encrypt +Comment: Set 3, vector 129 +Key: 818181818181818181818181818181818181818181818181 +Plaintext: 81818181818181818181818181818181 +Ciphertext: 48E95062B889D83CC72767E303329710 +Test: Encrypt +Comment: Set 3, vector 130 +Key: 828282828282828282828282828282828282828282828282 +Plaintext: 82828282828282828282828282828282 +Ciphertext: 0D98319B8ED1E612F063591AAFA95962 +Test: Encrypt +Comment: Set 3, vector 131 +Key: 838383838383838383838383838383838383838383838383 +Plaintext: 83838383838383838383838383838383 +Ciphertext: 6D987B21F8072C09514C711819BDF42D +Test: Encrypt +Comment: Set 3, vector 132 +Key: 848484848484848484848484848484848484848484848484 +Plaintext: 84848484848484848484848484848484 +Ciphertext: 56C6CA23BC6A52C9967D70C6471A0788 +Test: Encrypt +Comment: Set 3, vector 133 +Key: 858585858585858585858585858585858585858585858585 +Plaintext: 85858585858585858585858585858585 +Ciphertext: 03C1004551B9B74D96CC3F9F7D11B04A +Test: Encrypt +Comment: Set 3, vector 134 +Key: 868686868686868686868686868686868686868686868686 +Plaintext: 86868686868686868686868686868686 +Ciphertext: 6356481250E8D52A0D922985BB2BED27 +Test: Encrypt +Comment: Set 3, vector 135 +Key: 878787878787878787878787878787878787878787878787 +Plaintext: 87878787878787878787878787878787 +Ciphertext: BC51A66892A956F44BF75168E935720E +Test: Encrypt +Comment: Set 3, vector 136 +Key: 888888888888888888888888888888888888888888888888 +Plaintext: 88888888888888888888888888888888 +Ciphertext: 73FAAAFB0517BD4D459A250E2CA4F017 +Test: Encrypt +Comment: Set 3, vector 137 +Key: 898989898989898989898989898989898989898989898989 +Plaintext: 89898989898989898989898989898989 +Ciphertext: 160C7D6510CCEB35318629FFFE1E8BA7 +Test: Encrypt +Comment: Set 3, vector 138 +Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Ciphertext: 785ECC6F1A9415EBB05A4990786865A5 +Test: Encrypt +Comment: Set 3, vector 139 +Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Ciphertext: 210498B4AC4D909CC7D6DAD6B8851C1A +Test: Encrypt +Comment: Set 3, vector 140 +Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Ciphertext: 7094C31A06ED2AA0B3B63C210DEB96E2 +Test: Encrypt +Comment: Set 3, vector 141 +Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Ciphertext: F8426DAE3B7C3FF568456EB4D4EB623B +Test: Encrypt +Comment: Set 3, vector 142 +Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Ciphertext: 090487421369DED8EAC9812B544A29BE +Test: Encrypt +Comment: Set 3, vector 143 +Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Ciphertext: 1AFA1FC5ECA8EAD74F9FE9B67993CB6F +Test: Encrypt +Comment: Set 3, vector 144 +Key: 909090909090909090909090909090909090909090909090 +Plaintext: 90909090909090909090909090909090 +Ciphertext: 38124FCE77189341DE7B225951CDE6E9 +Test: Encrypt +Comment: Set 3, vector 145 +Key: 919191919191919191919191919191919191919191919191 +Plaintext: 91919191919191919191919191919191 +Ciphertext: 059A775350A44BB880A750B32B19E179 +Test: Encrypt +Comment: Set 3, vector 146 +Key: 929292929292929292929292929292929292929292929292 +Plaintext: 92929292929292929292929292929292 +Ciphertext: 7CFA631E8BABF7DEE00DAB0754C385DD +Test: Encrypt +Comment: Set 3, vector 147 +Key: 939393939393939393939393939393939393939393939393 +Plaintext: 93939393939393939393939393939393 +Ciphertext: 0632ED71BA440232DECE4F1B38F94323 +Test: Encrypt +Comment: Set 3, vector 148 +Key: 949494949494949494949494949494949494949494949494 +Plaintext: 94949494949494949494949494949494 +Ciphertext: D049FF03ACF47C866A4209E7588E0CFA +Test: Encrypt +Comment: Set 3, vector 149 +Key: 959595959595959595959595959595959595959595959595 +Plaintext: 95959595959595959595959595959595 +Ciphertext: 910408E331C64A71D50A149DFD50C242 +Test: Encrypt +Comment: Set 3, vector 150 +Key: 969696969696969696969696969696969696969696969696 +Plaintext: 96969696969696969696969696969696 +Ciphertext: 0829C2DD4AF8F06C30978A0199A43C3C +Test: Encrypt +Comment: Set 3, vector 151 +Key: 979797979797979797979797979797979797979797979797 +Plaintext: 97979797979797979797979797979797 +Ciphertext: C70D286C18D2A0EA5D16FEB97F35DE6F +Test: Encrypt +Comment: Set 3, vector 152 +Key: 989898989898989898989898989898989898989898989898 +Plaintext: 98989898989898989898989898989898 +Ciphertext: A220CD3CD177BDD73D44B6D4A7A9ED0E +Test: Encrypt +Comment: Set 3, vector 153 +Key: 999999999999999999999999999999999999999999999999 +Plaintext: 99999999999999999999999999999999 +Ciphertext: 74EC1A68010A0D5FA9688F1552E70EF5 +Test: Encrypt +Comment: Set 3, vector 154 +Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Ciphertext: C1C0EE9EEA079CCE8544BA9940963720 +Test: Encrypt +Comment: Set 3, vector 155 +Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Ciphertext: 500418F7142C273CCADBDAD8831619D2 +Test: Encrypt +Comment: Set 3, vector 156 +Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Ciphertext: 703A0223D3ABA658C531F9BE03F6E842 +Test: Encrypt +Comment: Set 3, vector 157 +Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Ciphertext: EBC65558CD43197D87CFF645FDBA1661 +Test: Encrypt +Comment: Set 3, vector 158 +Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Ciphertext: 6F6E140E44934DA754F008EB5597BDA3 +Test: Encrypt +Comment: Set 3, vector 159 +Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Ciphertext: 3D533A98B85CDD624541956E348ACBD3 +Test: Encrypt +Comment: Set 3, vector 160 +Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Ciphertext: 13833D60F1D247019258C457E9F2292A +Test: Encrypt +Comment: Set 3, vector 161 +Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Ciphertext: FC13CECE4F5E2467427582595EDB6B87 +Test: Encrypt +Comment: Set 3, vector 162 +Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Ciphertext: 2772A4E636F01514949D47B037825AF9 +Test: Encrypt +Comment: Set 3, vector 163 +Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Ciphertext: F13DC1CCF105212AF8BC4F73F0AEF272 +Test: Encrypt +Comment: Set 3, vector 164 +Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Ciphertext: A6EB0CABBBA03DB1B2425E6FC559B06A +Test: Encrypt +Comment: Set 3, vector 165 +Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Ciphertext: 32222D875D9E73DE72848EA88AC9B259 +Test: Encrypt +Comment: Set 3, vector 166 +Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Ciphertext: 7DA6BC64D1E71FFE2D24C1A2FF7405BF +Test: Encrypt +Comment: Set 3, vector 167 +Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Ciphertext: AD5129092054880300AFCF09A2921DAF +Test: Encrypt +Comment: Set 3, vector 168 +Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Ciphertext: FCF2E0AA207754597C8C00A4615B5B5B +Test: Encrypt +Comment: Set 3, vector 169 +Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Ciphertext: 83D1475128C93C79BFE2AC9DA7E5D7BC +Test: Encrypt +Comment: Set 3, vector 170 +Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Ciphertext: 9BA09846E13568B746B7D6A43364915F +Test: Encrypt +Comment: Set 3, vector 171 +Key: ABABABABABABABABABABABABABABABABABABABABABABABAB +Plaintext: ABABABABABABABABABABABABABABABAB +Ciphertext: 387BDB77D285F9E59CB88CD830CB31E2 +Test: Encrypt +Comment: Set 3, vector 172 +Key: ACACACACACACACACACACACACACACACACACACACACACACACAC +Plaintext: ACACACACACACACACACACACACACACACAC +Ciphertext: 82BFCC439310DD5DC411CCD4451E789B +Test: Encrypt +Comment: Set 3, vector 173 +Key: ADADADADADADADADADADADADADADADADADADADADADADADAD +Plaintext: ADADADADADADADADADADADADADADADAD +Ciphertext: 34C4240853DA191DF1D63E83401CE0E2 +Test: Encrypt +Comment: Set 3, vector 174 +Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Ciphertext: B3CE3C38C10A667F5FD67BC8B7037283 +Test: Encrypt +Comment: Set 3, vector 175 +Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Ciphertext: BEF04E726DC1D5D1D4AB0A025CFDFD7D +Test: Encrypt +Comment: Set 3, vector 176 +Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Ciphertext: 725D70D564E78095739EA7980B481056 +Test: Encrypt +Comment: Set 3, vector 177 +Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Ciphertext: CAB9293C9E3A82D40E85558F9DA488C1 +Test: Encrypt +Comment: Set 3, vector 178 +Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Ciphertext: B433CACA5FF9F5AADB6BAFB7D4BE81FC +Test: Encrypt +Comment: Set 3, vector 179 +Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Ciphertext: 3910F153098B638696101E04022A7849 +Test: Encrypt +Comment: Set 3, vector 180 +Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Ciphertext: 1D7FF785CFC6AF98C5C81CDA2ABC9816 +Test: Encrypt +Comment: Set 3, vector 181 +Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Ciphertext: 4A30C5521BAC28E5942808CB536376C7 +Test: Encrypt +Comment: Set 3, vector 182 +Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Ciphertext: 17B908EF18EB7703DDB667C7A8DBA777 +Test: Encrypt +Comment: Set 3, vector 183 +Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Ciphertext: 3222E0228F29C9F27467CB7047838E39 +Test: Encrypt +Comment: Set 3, vector 184 +Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Ciphertext: E422497D1FD54DF8F9CEE11548D77303 +Test: Encrypt +Comment: Set 3, vector 185 +Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Ciphertext: B26A00606A375B1A64B7F0C333D81A50 +Test: Encrypt +Comment: Set 3, vector 186 +Key: BABABABABABABABABABABABABABABABABABABABABABABABA +Plaintext: BABABABABABABABABABABABABABABABA +Ciphertext: D5032B06E290F6B76327E47E519F8F6D +Test: Encrypt +Comment: Set 3, vector 187 +Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Ciphertext: 2CED7355B82DF3B88C4417149FFA1783 +Test: Encrypt +Comment: Set 3, vector 188 +Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Ciphertext: FC7B4D95C62CA6D33862D56768EA9A1A +Test: Encrypt +Comment: Set 3, vector 189 +Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Ciphertext: 375A9C1E1FCFA6F2369306D966F82156 +Test: Encrypt +Comment: Set 3, vector 190 +Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Ciphertext: BA4C218D8691D5D9CE15ECCC75C75D8B +Test: Encrypt +Comment: Set 3, vector 191 +Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Ciphertext: 4D5C53279B76A6F74195C65F09DF85D9 +Test: Encrypt +Comment: Set 3, vector 192 +Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Ciphertext: 75CF5E6B3B0BFFF2290A5E58A85CF994 +Test: Encrypt +Comment: Set 3, vector 193 +Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Ciphertext: 3482A5C83234E75CB443E09BA17EE3A0 +Test: Encrypt +Comment: Set 3, vector 194 +Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Ciphertext: DA592D849C1BFBBEF5C3D0D8DA0F4B9A +Test: Encrypt +Comment: Set 3, vector 195 +Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Ciphertext: 6656047376A76ED53FFF8C5DE1B6F886 +Test: Encrypt +Comment: Set 3, vector 196 +Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Ciphertext: F86FD06864804515B17B453F8A42A44D +Test: Encrypt +Comment: Set 3, vector 197 +Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Ciphertext: E57CD8E81BBF5B42446A7880B32A9A2F +Test: Encrypt +Comment: Set 3, vector 198 +Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Ciphertext: A17219F7DEFF2985BDFADD62A6854947 +Test: Encrypt +Comment: Set 3, vector 199 +Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Ciphertext: FF288A92FB408DA875531D163CE0105A +Test: Encrypt +Comment: Set 3, vector 200 +Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Ciphertext: 11828CD066FD12620DFA16358CF1A705 +Test: Encrypt +Comment: Set 3, vector 201 +Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Ciphertext: 6FA5DCBD14D2520E7F8147EDBEBBEAEE +Test: Encrypt +Comment: Set 3, vector 202 +Key: CACACACACACACACACACACACACACACACACACACACACACACACA +Plaintext: CACACACACACACACACACACACACACACACA +Ciphertext: F365CE3849AFB23AF3B62D7CFF80B19B +Test: Encrypt +Comment: Set 3, vector 203 +Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Ciphertext: 74BE047CAAE10D095B3BDA14016EA262 +Test: Encrypt +Comment: Set 3, vector 204 +Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Ciphertext: DC7A7D66AD1ABF1C7AA28891BE685AB5 +Test: Encrypt +Comment: Set 3, vector 205 +Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Ciphertext: 8BED9C5BAD5C4A4AFB41CDFD7E88BB97 +Test: Encrypt +Comment: Set 3, vector 206 +Key: CECECECECECECECECECECECECECECECECECECECECECECECE +Plaintext: CECECECECECECECECECECECECECECECE +Ciphertext: 915FF93DC6A3984F11AB60BD2AA3DC61 +Test: Encrypt +Comment: Set 3, vector 207 +Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Ciphertext: 43DFEEBBFB3692763752E6EA8931A9B8 +Test: Encrypt +Comment: Set 3, vector 208 +Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Ciphertext: 2BB966115263DF2296C5D23E02D9C335 +Test: Encrypt +Comment: Set 3, vector 209 +Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Ciphertext: FCCA1E3616236F0D5A1A9D035A35049D +Test: Encrypt +Comment: Set 3, vector 210 +Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Ciphertext: 2E7246518C923B2AE23C61C99D7E6CE7 +Test: Encrypt +Comment: Set 3, vector 211 +Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Ciphertext: 8D19232494905BAF83F4230395C8E09B +Test: Encrypt +Comment: Set 3, vector 212 +Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Ciphertext: 6BC0BBCC76A7F8DF2A03BAB1CDE47FB6 +Test: Encrypt +Comment: Set 3, vector 213 +Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Ciphertext: BD3D30B62DC0B0FEED0CC760879DB806 +Test: Encrypt +Comment: Set 3, vector 214 +Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Ciphertext: 647388D8E6A9C8D09828041F4E338D47 +Test: Encrypt +Comment: Set 3, vector 215 +Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Ciphertext: 4861CFC3FDDC434F2742E45B97FBB270 +Test: Encrypt +Comment: Set 3, vector 216 +Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Ciphertext: 4426BC1C3990A5DE10760D0C10A3BB9A +Test: Encrypt +Comment: Set 3, vector 217 +Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Ciphertext: 805211D0BD914F07AB1579EF9E3827EE +Test: Encrypt +Comment: Set 3, vector 218 +Key: DADADADADADADADADADADADADADADADADADADADADADADADA +Plaintext: DADADADADADADADADADADADADADADADA +Ciphertext: 519DB5AA8DA219224EDA77F77B96C135 +Test: Encrypt +Comment: Set 3, vector 219 +Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Ciphertext: 7A96F769BF260E6D91A070BA7766D3E3 +Test: Encrypt +Comment: Set 3, vector 220 +Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Ciphertext: 902222F1779476A44CEEDACEDA72B3EC +Test: Encrypt +Comment: Set 3, vector 221 +Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Ciphertext: 99859E56FE0DAB67CDE755E4790ED51D +Test: Encrypt +Comment: Set 3, vector 222 +Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Ciphertext: C2F4EE121941873763F302ECE6D8DF9E +Test: Encrypt +Comment: Set 3, vector 223 +Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Ciphertext: FE1E93DBF071E2280130E169C9E5254A +Test: Encrypt +Comment: Set 3, vector 224 +Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Ciphertext: 58F45B5E30D9DE7038EC405B601521AB +Test: Encrypt +Comment: Set 3, vector 225 +Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Ciphertext: 8783BD662F65899EF61E113B7CC6505D +Test: Encrypt +Comment: Set 3, vector 226 +Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Ciphertext: A3F6BBB2C3403F433203E0E18DB3E4C0 +Test: Encrypt +Comment: Set 3, vector 227 +Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Ciphertext: D3EE663795362A0D2E7A8DB784F95A33 +Test: Encrypt +Comment: Set 3, vector 228 +Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Ciphertext: 1B75895E7FCEEEA5ECA62E14F77ECF6A +Test: Encrypt +Comment: Set 3, vector 229 +Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Ciphertext: 5040525E4F3B78D2036539C1C463A48B +Test: Encrypt +Comment: Set 3, vector 230 +Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Ciphertext: A48E63494241AEACB0EF7B18A431E50D +Test: Encrypt +Comment: Set 3, vector 231 +Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Ciphertext: 9DAF4DBBBC81465BC4270129C522ABCB +Test: Encrypt +Comment: Set 3, vector 232 +Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Ciphertext: 20B118C870AF1A85C683C60A31ED24E4 +Test: Encrypt +Comment: Set 3, vector 233 +Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Ciphertext: 52FF30830000A72FA2CB030539550F06 +Test: Encrypt +Comment: Set 3, vector 234 +Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Ciphertext: 797ED3DB1B9A4BF4122EA0FF667BC36D +Test: Encrypt +Comment: Set 3, vector 235 +Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Ciphertext: 708CE40FC810F5E84B6EE8FC2E0A46FA +Test: Encrypt +Comment: Set 3, vector 236 +Key: ECECECECECECECECECECECECECECECECECECECECECECECEC +Plaintext: ECECECECECECECECECECECECECECECEC +Ciphertext: 0BA7446B1D3D803BB80CDE94E096E79C +Test: Encrypt +Comment: Set 3, vector 237 +Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Ciphertext: 6B0E95AED4DC9E923EDF3DDD5BAEEA0C +Test: Encrypt +Comment: Set 3, vector 238 +Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Ciphertext: DE45D435FD6F8A240AD8DCE5A4BD8CC3 +Test: Encrypt +Comment: Set 3, vector 239 +Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Ciphertext: 8823002161D635ADA686D85B087F3022 +Test: Encrypt +Comment: Set 3, vector 240 +Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Ciphertext: C00F367B98CC819F5F6ADADEA8513DD8 +Test: Encrypt +Comment: Set 3, vector 241 +Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Ciphertext: 9C25269FB7FA889FBD9E55AAD4C92DE0 +Test: Encrypt +Comment: Set 3, vector 242 +Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Ciphertext: 5DD1D60A62B551FFA18CFF8263C5FCE4 +Test: Encrypt +Comment: Set 3, vector 243 +Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Ciphertext: D183A9113393C1EEC7170331C65D2547 +Test: Encrypt +Comment: Set 3, vector 244 +Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Ciphertext: FADF9E4AF6C1D7A6965D5DBA03194F18 +Test: Encrypt +Comment: Set 3, vector 245 +Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Ciphertext: F2E9E5BE04D7B47B93D2B81DBCDA8BF3 +Test: Encrypt +Comment: Set 3, vector 246 +Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Ciphertext: 7A04D513A59636ECA8A8608F10F21910 +Test: Encrypt +Comment: Set 3, vector 247 +Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Ciphertext: 659552FCEF0E90F77050CF3902A22475 +Test: Encrypt +Comment: Set 3, vector 248 +Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Ciphertext: F81709C989061D4439BDD47E71DBB457 +Test: Encrypt +Comment: Set 3, vector 249 +Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Ciphertext: E05425C950E298F31FC6751375B48B66 +Test: Encrypt +Comment: Set 3, vector 250 +Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Ciphertext: 6E90B365BEBAFA5C49DC4D6AB1593F94 +Test: Encrypt +Comment: Set 3, vector 251 +Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Ciphertext: B2469C08D0F878579E162E8ACC5EF802 +Test: Encrypt +Comment: Set 3, vector 252 +Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Ciphertext: C1DCAB694C7FDBEC88C6FC2597EAC180 +Test: Encrypt +Comment: Set 3, vector 253 +Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Ciphertext: 6651FFBD3C30A496D072493A519D44D9 +Test: Encrypt +Comment: Set 3, vector 254 +Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Ciphertext: A2F5A98929658AF4A9700B9923DAF014 +Test: Encrypt +Comment: Set 3, vector 255 +Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Ciphertext: 3F8D5676F51CE23DC3BDB627F8B3883E +Test: Encrypt +Comment: Tests with 256-bit keys +Comment: Set 1, vector 0 +Key: 8000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2136FABDA091DFB5171B94B8EFBB5D08 +Test: Encrypt +Comment: Set 1, vector 1 +Key: 4000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6EBC4F33B3EADA5DBF25130F3D02CD34 +Test: Encrypt +Comment: Set 1, vector 2 +Key: 2000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3A7BCDC53A1F02EF20C79CFCE107D38B +Test: Encrypt +Comment: Set 1, vector 3 +Key: 1000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 88A96052B61C5A621EE9A6316A42ED4A +Test: Encrypt +Comment: Set 1, vector 4 +Key: 0800000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CBD7A2D8354B2DA972A0950BDFFF2CBD +Test: Encrypt +Comment: Set 1, vector 5 +Key: 0400000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 690BEB5FBEA12A4861E826F568E9F8F3 +Test: Encrypt +Comment: Set 1, vector 6 +Key: 0200000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 799A6FA3B78846E424F41370654ABD6F +Test: Encrypt +Comment: Set 1, vector 7 +Key: 0100000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DD7E24E12F391C5FEDE40136F8DE3731 +Test: Encrypt +Comment: Set 1, vector 8 +Key: 0080000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F7412D526E9244574F9933F602595385 +Test: Encrypt +Comment: Set 1, vector 9 +Key: 0040000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FD9D0174A83BEC3E7E1C3372CB5E7C9B +Test: Encrypt +Comment: Set 1, vector 10 +Key: 0020000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FCA62D360A7DFE54DB8D53819A407E71 +Test: Encrypt +Comment: Set 1, vector 11 +Key: 0010000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AC821C68913DCE3E74A20DB8E902CC4C +Test: Encrypt +Comment: Set 1, vector 12 +Key: 0008000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 80633F6CB8F10863E0A7FDE4C35D50E9 +Test: Encrypt +Comment: Set 1, vector 13 +Key: 0004000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D417D1D94869EE2364FCE869C0C1114E +Test: Encrypt +Comment: Set 1, vector 14 +Key: 0002000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0FA96DCEA2ACB849490CD5A1488A2FD9 +Test: Encrypt +Comment: Set 1, vector 15 +Key: 0001000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3E99BCB51CAEB9147DCF8643771D1C83 +Test: Encrypt +Comment: Set 1, vector 16 +Key: 0000800000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 25EA413BBC3C2579D3F7CBFD9E378091 +Test: Encrypt +Comment: Set 1, vector 17 +Key: 0000400000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C0433C1AD2E468FC679988CFBFCA5CD4 +Test: Encrypt +Comment: Set 1, vector 18 +Key: 0000200000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 05108B7D7C2871D9DE1F22232CF6966B +Test: Encrypt +Comment: Set 1, vector 19 +Key: 0000100000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8ABE085B75333946450F2D1D162E8650 +Test: Encrypt +Comment: Set 1, vector 20 +Key: 0000080000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 487A9C50152B44F5B009D8682EA1FD22 +Test: Encrypt +Comment: Set 1, vector 21 +Key: 0000040000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 739207A812F142B545798BA85170AF25 +Test: Encrypt +Comment: Set 1, vector 22 +Key: 0000020000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E40B90A5840591FEC98A24B23E73892B +Test: Encrypt +Comment: Set 1, vector 23 +Key: 0000010000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0258BFB0DC942F6A9139D3C00EBBEB35 +Test: Encrypt +Comment: Set 1, vector 24 +Key: 0000008000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 650CD6035752320B8252F44AEEBEC9E4 +Test: Encrypt +Comment: Set 1, vector 25 +Key: 0000004000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FABFFBB7028B53E0BB88E3E4462ACF0D +Test: Encrypt +Comment: Set 1, vector 26 +Key: 0000002000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C48D3416904896E2F2307EA26FB8CF1C +Test: Encrypt +Comment: Set 1, vector 27 +Key: 0000001000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2237452352F488F1DA3F1619FC6A7F85 +Test: Encrypt +Comment: Set 1, vector 28 +Key: 0000000800000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D3E6ECF4A3F70E672AABEE0C2ECA3960 +Test: Encrypt +Comment: Set 1, vector 29 +Key: 0000000400000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7A3EFC8AC6A82E8AEF377D8D96D8E830 +Test: Encrypt +Comment: Set 1, vector 30 +Key: 0000000200000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7278F0441F5AA34C0B7CDB076B453225 +Test: Encrypt +Comment: Set 1, vector 31 +Key: 0000000100000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 382E61EAC044E2151906F936CC9D33AE +Test: Encrypt +Comment: Set 1, vector 32 +Key: 0000000080000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C51147F4AD33C35647DF7E856C2965D4 +Test: Encrypt +Comment: Set 1, vector 33 +Key: 0000000040000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DAFE261154ADF63EA3F75B1253A9F77C +Test: Encrypt +Comment: Set 1, vector 34 +Key: 0000000020000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B1A0B0E765C1D0379CA538ED0EFB9649 +Test: Encrypt +Comment: Set 1, vector 35 +Key: 0000000010000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 78F7D01D7795ACA0846CCE835E71FBC2 +Test: Encrypt +Comment: Set 1, vector 36 +Key: 0000000008000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E001A545AC71F53D3AD99C84D7F5B062 +Test: Encrypt +Comment: Set 1, vector 37 +Key: 0000000004000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 58E3907C56BF5ADFDBAE61C172B8F488 +Test: Encrypt +Comment: Set 1, vector 38 +Key: 0000000002000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 16F77C9515B473167BD7ABA7C97B1CCA +Test: Encrypt +Comment: Set 1, vector 39 +Key: 0000000001000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4BC9F687C7757CDF5A5E94D69E5EA173 +Test: Encrypt +Comment: Set 1, vector 40 +Key: 0000000000800000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 804261A34F26A87694F70C35F338989D +Test: Encrypt +Comment: Set 1, vector 41 +Key: 0000000000400000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E8D8BF002738D7067CD06437C4459365 +Test: Encrypt +Comment: Set 1, vector 42 +Key: 0000000000200000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E131137F7EA2AEAB37F72AF3644FFCCE +Test: Encrypt +Comment: Set 1, vector 43 +Key: 0000000000100000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 542A1FD5CB4BE8485FA83AA14FAAD4A8 +Test: Encrypt +Comment: Set 1, vector 44 +Key: 0000000000080000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BEC6C8C1A9E5E7982A990B8F9BA0ADE3 +Test: Encrypt +Comment: Set 1, vector 45 +Key: 0000000000040000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DE55BE1AA823A9F7474C65BD50D55095 +Test: Encrypt +Comment: Set 1, vector 46 +Key: 0000000000020000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D67CC199AF361A07A0DBD8F6700A4744 +Test: Encrypt +Comment: Set 1, vector 47 +Key: 0000000000010000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DBAD180017184EF80D398D8D22AAC4A1 +Test: Encrypt +Comment: Set 1, vector 48 +Key: 0000000000008000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 27E68691F10EEFD1B594682DC3EF65A5 +Test: Encrypt +Comment: Set 1, vector 49 +Key: 0000000000004000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6D4EF0587B948AD62B703D3D7CCEA229 +Test: Encrypt +Comment: Set 1, vector 50 +Key: 0000000000002000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C0F443758F239E3A3E31E6F93AD4766B +Test: Encrypt +Comment: Set 1, vector 51 +Key: 0000000000001000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BEB5CB1D8EB3A9EA795A4B43CA1567A9 +Test: Encrypt +Comment: Set 1, vector 52 +Key: 0000000000000800000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D89A97957F1979C63459A385E21B4A84 +Test: Encrypt +Comment: Set 1, vector 53 +Key: 0000000000000400000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 39A6615147FF571F2FABAD5BE9800A10 +Test: Encrypt +Comment: Set 1, vector 54 +Key: 0000000000000200000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E18B0CB1980124504B46A46A6F4273F3 +Test: Encrypt +Comment: Set 1, vector 55 +Key: 0000000000000100000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1E13C8034ED53FD4E3F433E1CF4B5CE1 +Test: Encrypt +Comment: Set 1, vector 56 +Key: 0000000000000080000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 71FA53EAADBA0C9BCF86A3071408966D +Test: Encrypt +Comment: Set 1, vector 57 +Key: 0000000000000040000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E50502EC84BB024C7466FE225C7FD8BA +Test: Encrypt +Comment: Set 1, vector 58 +Key: 0000000000000020000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DEB33581D79C9D4294E315998377BCBF +Test: Encrypt +Comment: Set 1, vector 59 +Key: 0000000000000010000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A713C2503CE44A04C9108FA160659945 +Test: Encrypt +Comment: Set 1, vector 60 +Key: 0000000000000008000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 520E9E8DB8A67601B02E369916FAB8CC +Test: Encrypt +Comment: Set 1, vector 61 +Key: 0000000000000004000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8FDC11B74D17D79C6B2DFF2D6A561258 +Test: Encrypt +Comment: Set 1, vector 62 +Key: 0000000000000002000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3EA497AD2FC8F2587EFAA7D49121F26C +Test: Encrypt +Comment: Set 1, vector 63 +Key: 0000000000000001000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3340905F7413C979E5AED11D71B9294E +Test: Encrypt +Comment: Set 1, vector 64 +Key: 0000000000000000800000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 067FAC22E16205FF209B1760ABDE0565 +Test: Encrypt +Comment: Set 1, vector 65 +Key: 0000000000000000400000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BECA010BAB7BDD7E8A8084DA9853A0F4 +Test: Encrypt +Comment: Set 1, vector 66 +Key: 0000000000000000200000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 146F5A4A7B2880F5AF57333C7F129028 +Test: Encrypt +Comment: Set 1, vector 67 +Key: 0000000000000000100000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F773C1BD724955109A8B4EA3DA1C2197 +Test: Encrypt +Comment: Set 1, vector 68 +Key: 0000000000000000080000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B427EFAC8C656AB6F4DF7F420A177B8E +Test: Encrypt +Comment: Set 1, vector 69 +Key: 0000000000000000040000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B3D1BDB29010DB5FC81B66E2F7189D54 +Test: Encrypt +Comment: Set 1, vector 70 +Key: 0000000000000000020000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 676EEA415693F303ACF5CD84C50816AB +Test: Encrypt +Comment: Set 1, vector 71 +Key: 0000000000000000010000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BA21C564E52961DEB4B3A3CA9E0B70EF +Test: Encrypt +Comment: Set 1, vector 72 +Key: 0000000000000000008000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A60FB5DBD17EA92E303492E3F54D0BF2 +Test: Encrypt +Comment: Set 1, vector 73 +Key: 0000000000000000004000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F4F5A0540107D66F32FB289B14EF4299 +Test: Encrypt +Comment: Set 1, vector 74 +Key: 0000000000000000002000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8D9B4A19F391175CF7DA42FEF313EDD8 +Test: Encrypt +Comment: Set 1, vector 75 +Key: 0000000000000000001000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B0AFAB0183A9FC69DA8BBE9B8FAF653A +Test: Encrypt +Comment: Set 1, vector 76 +Key: 0000000000000000000800000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 68FFD91FD5AD1F1AC176D639694FEA29 +Test: Encrypt +Comment: Set 1, vector 77 +Key: 0000000000000000000400000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 97EC38070014494A2E97EFE354BA2865 +Test: Encrypt +Comment: Set 1, vector 78 +Key: 0000000000000000000200000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E3EC51F889C63AD2C708F22AFC42D18C +Test: Encrypt +Comment: Set 1, vector 79 +Key: 0000000000000000000100000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8CC5BDB49037DC1D3D8DADFA0B8ECD96 +Test: Encrypt +Comment: Set 1, vector 80 +Key: 0000000000000000000080000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 14F5C3D75BA0397D7436E1479F78435B +Test: Encrypt +Comment: Set 1, vector 81 +Key: 0000000000000000000040000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FF3B01851C8254967E4DFAA2A0F0C057 +Test: Encrypt +Comment: Set 1, vector 82 +Key: 0000000000000000000020000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B8C8E9AFF66FFEC9D0342FF297A543B1 +Test: Encrypt +Comment: Set 1, vector 83 +Key: 0000000000000000000010000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A95A113F088FFE17A79050C46377545E +Test: Encrypt +Comment: Set 1, vector 84 +Key: 0000000000000000000008000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EA4C3AFA65016D057EC1DFDD0411ED06 +Test: Encrypt +Comment: Set 1, vector 85 +Key: 0000000000000000000004000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7D535C84DFAD692D0F89AB73C1F42F60 +Test: Encrypt +Comment: Set 1, vector 86 +Key: 0000000000000000000002000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E857DF0CEBAB1E03CB9AF73CBF9C19D1 +Test: Encrypt +Comment: Set 1, vector 87 +Key: 0000000000000000000001000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7A59BCF6FAC80379EB7E8E2EFAB147D4 +Test: Encrypt +Comment: Set 1, vector 88 +Key: 0000000000000000000000800000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 43EF17F87BAF7536DDE734F885C4CE85 +Test: Encrypt +Comment: Set 1, vector 89 +Key: 0000000000000000000000400000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2B71CE14089741A1EF1E99DC9E22E739 +Test: Encrypt +Comment: Set 1, vector 90 +Key: 0000000000000000000000200000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9283885622781998186B7DACBFF68ED2 +Test: Encrypt +Comment: Set 1, vector 91 +Key: 0000000000000000000000100000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 756A184F392D8C821479EFF930338C0A +Test: Encrypt +Comment: Set 1, vector 92 +Key: 0000000000000000000000080000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CE848D49BB76CA30B607C9539793DA41 +Test: Encrypt +Comment: Set 1, vector 93 +Key: 0000000000000000000000040000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 50F2D5238991EEA9654C8895AFC0AC37 +Test: Encrypt +Comment: Set 1, vector 94 +Key: 0000000000000000000000020000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 561564103E13F4CBB58A9E096DB1958B +Test: Encrypt +Comment: Set 1, vector 95 +Key: 0000000000000000000000010000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EF2BB05AC6868C15D66D956BD580D467 +Test: Encrypt +Comment: Set 1, vector 96 +Key: 0000000000000000000000008000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C7B1A5A3A201DF25FD97A47B1FC3569E +Test: Encrypt +Comment: Set 1, vector 97 +Key: 0000000000000000000000004000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0A1873FF47B38095CF6A8BABF3901FF2 +Test: Encrypt +Comment: Set 1, vector 98 +Key: 0000000000000000000000002000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A96F8F977DC45ABF55518EA10C598E10 +Test: Encrypt +Comment: Set 1, vector 99 +Key: 0000000000000000000000001000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 778C644278689EC0577BDDB2154AE635 +Test: Encrypt +Comment: Set 1, vector 100 +Key: 0000000000000000000000000800000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DEF97DBCF02648E7BCE6A368F7F34C14 +Test: Encrypt +Comment: Set 1, vector 101 +Key: 0000000000000000000000000400000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 71B85362022D53AF03A17870D8F66614 +Test: Encrypt +Comment: Set 1, vector 102 +Key: 0000000000000000000000000200000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3593FC550A2950C2EF94F6E8F6E90BB3 +Test: Encrypt +Comment: Set 1, vector 103 +Key: 0000000000000000000000000100000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 29E64004DBF1E7833A7CD82EDACD932A +Test: Encrypt +Comment: Set 1, vector 104 +Key: 0000000000000000000000000080000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 715E700DF74A8680F04A48B18AEDB99C +Test: Encrypt +Comment: Set 1, vector 105 +Key: 0000000000000000000000000040000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 72E3288FFB02D1100F84FA605855D812 +Test: Encrypt +Comment: Set 1, vector 106 +Key: 0000000000000000000000000020000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9021082D3C4CB202936FD76F1392446B +Test: Encrypt +Comment: Set 1, vector 107 +Key: 0000000000000000000000000010000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1552BD181EE0FB914558053F2662F9AE +Test: Encrypt +Comment: Set 1, vector 108 +Key: 0000000000000000000000000008000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 599D87052322E19141057F0EF3C47508 +Test: Encrypt +Comment: Set 1, vector 109 +Key: 0000000000000000000000000004000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 505AC03CEB2ECA1C9D411B4A1CF2011C +Test: Encrypt +Comment: Set 1, vector 110 +Key: 0000000000000000000000000002000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DD639574D8FFCD24EA68B2243C5AA7D6 +Test: Encrypt +Comment: Set 1, vector 111 +Key: 0000000000000000000000000001000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 45F5371B714D2652BA4AD083EDB65BEE +Test: Encrypt +Comment: Set 1, vector 112 +Key: 0000000000000000000000000000800000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DEAB9C368B21FE41E709554340E87C0B +Test: Encrypt +Comment: Set 1, vector 113 +Key: 0000000000000000000000000000400000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3A981045526766BD13943F11CE917AF9 +Test: Encrypt +Comment: Set 1, vector 114 +Key: 0000000000000000000000000000200000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 35CDF30A485CE21F0D005EE0C2BCF315 +Test: Encrypt +Comment: Set 1, vector 115 +Key: 0000000000000000000000000000100000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F561A8C91820252580317385F8336305 +Test: Encrypt +Comment: Set 1, vector 116 +Key: 0000000000000000000000000000080000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0789680D27735220798079572BF4ECF6 +Test: Encrypt +Comment: Set 1, vector 117 +Key: 0000000000000000000000000000040000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B4F16729D7AB16C9AE44FB61291920DE +Test: Encrypt +Comment: Set 1, vector 118 +Key: 0000000000000000000000000000020000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FB83BF9B1D983CA7FB3718E22D9A2155 +Test: Encrypt +Comment: Set 1, vector 119 +Key: 0000000000000000000000000000010000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CEC5C5D13E59508D3DA431F1479730F3 +Test: Encrypt +Comment: Set 1, vector 120 +Key: 0000000000000000000000000000008000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 09BEA932E60A4AD34271FF11A2B2AA02 +Test: Encrypt +Comment: Set 1, vector 121 +Key: 0000000000000000000000000000004000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B102F72FD89452C0CD1C6897071F903E +Test: Encrypt +Comment: Set 1, vector 122 +Key: 0000000000000000000000000000002000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A469F9411F0A3A6E1A8076416C6B55CB +Test: Encrypt +Comment: Set 1, vector 123 +Key: 0000000000000000000000000000001000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6C3F88FCB538699547A1CF07A529993F +Test: Encrypt +Comment: Set 1, vector 124 +Key: 0000000000000000000000000000000800000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 493E8CC2A63534632A6456ED47BF233C +Test: Encrypt +Comment: Set 1, vector 125 +Key: 0000000000000000000000000000000400000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1FD81E905F7055C4B04DB1F9718A6861 +Test: Encrypt +Comment: Set 1, vector 126 +Key: 0000000000000000000000000000000200000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B22882E01D7A1BF2D7F0E3BFBFC87156 +Test: Encrypt +Comment: Set 1, vector 127 +Key: 0000000000000000000000000000000100000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 86C9822E849322FB00DF89233D33935D +Test: Encrypt +Comment: Set 1, vector 128 +Key: 0000000000000000000000000000000080000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 12012E8E028D0D3D8DC00847130D424C +Test: Encrypt +Comment: Set 1, vector 129 +Key: 0000000000000000000000000000000040000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 182A96CC3BF10035B9DB292D1399F993 +Test: Encrypt +Comment: Set 1, vector 130 +Key: 0000000000000000000000000000000020000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 91E0E6991989D1FC4CBD754E4E7D0590 +Test: Encrypt +Comment: Set 1, vector 131 +Key: 0000000000000000000000000000000010000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F3EFC4E6F207E370C8CAE39408C4BF1B +Test: Encrypt +Comment: Set 1, vector 132 +Key: 0000000000000000000000000000000008000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AA767AB2EC6FA2FA183DAF9C0F3BAE5E +Test: Encrypt +Comment: Set 1, vector 133 +Key: 0000000000000000000000000000000004000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: D1FF11F4D1AEEAAE01A115081AF886EF +Test: Encrypt +Comment: Set 1, vector 134 +Key: 0000000000000000000000000000000002000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5390139711090B56B28338FEA98FCC82 +Test: Encrypt +Comment: Set 1, vector 135 +Key: 0000000000000000000000000000000001000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 13E693CCF6EBF0E6061B92B7ED0B95B6 +Test: Encrypt +Comment: Set 1, vector 136 +Key: 0000000000000000000000000000000000800000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 588FB2F95861D3C427669C68D04ADB25 +Test: Encrypt +Comment: Set 1, vector 137 +Key: 0000000000000000000000000000000000400000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F472ECDF8DEBC416313AAF7C8AAFB43E +Test: Encrypt +Comment: Set 1, vector 138 +Key: 0000000000000000000000000000000000200000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EAA654BE38E857941A921C70AC7FC7CE +Test: Encrypt +Comment: Set 1, vector 139 +Key: 0000000000000000000000000000000000100000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F2A4E47AE80CDF506B9513C510EA0954 +Test: Encrypt +Comment: Set 1, vector 140 +Key: 0000000000000000000000000000000000080000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F08EC7ED8FBB99F175A990C3E4DECB6B +Test: Encrypt +Comment: Set 1, vector 141 +Key: 0000000000000000000000000000000000040000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5C767BC584CA3653EDE27CD8B209A0AD +Test: Encrypt +Comment: Set 1, vector 142 +Key: 0000000000000000000000000000000000020000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AFF9A8BA92A40B2BF42FDB4089B1F9CC +Test: Encrypt +Comment: Set 1, vector 143 +Key: 0000000000000000000000000000000000010000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BFC1E9198BBE22266712EB1ECB17D748 +Test: Encrypt +Comment: Set 1, vector 144 +Key: 0000000000000000000000000000000000008000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 235184136A29208BD041E60BCB9F7464 +Test: Encrypt +Comment: Set 1, vector 145 +Key: 0000000000000000000000000000000000004000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 83DC48F9177C5C94CBC22E83A2B76829 +Test: Encrypt +Comment: Set 1, vector 146 +Key: 0000000000000000000000000000000000002000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 72CD31ACB7A1A459E4D27C1F26039FA7 +Test: Encrypt +Comment: Set 1, vector 147 +Key: 0000000000000000000000000000000000001000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 139AC4734C3136FD9982FCC7A569B9D3 +Test: Encrypt +Comment: Set 1, vector 148 +Key: 0000000000000000000000000000000000000800000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 12FFA3EF4346F4C57A03A36F9938B251 +Test: Encrypt +Comment: Set 1, vector 149 +Key: 0000000000000000000000000000000000000400000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 43DDB100CE22E5553CF4DCF814BF3CAC +Test: Encrypt +Comment: Set 1, vector 150 +Key: 0000000000000000000000000000000000000200000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: ABDADF4C948BB61C0A917885ADE4C7C5 +Test: Encrypt +Comment: Set 1, vector 151 +Key: 0000000000000000000000000000000000000100000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 197391E089DE173B522DDD8CBEEC3118 +Test: Encrypt +Comment: Set 1, vector 152 +Key: 0000000000000000000000000000000000000080000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 43FBE8BF2728C55C9368D01E40C1CF96 +Test: Encrypt +Comment: Set 1, vector 153 +Key: 0000000000000000000000000000000000000040000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0F5DE5F67EC84F2CB253A0BC48991C71 +Test: Encrypt +Comment: Set 1, vector 154 +Key: 0000000000000000000000000000000000000020000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 52BA4666B972EAE3D2E960D7372D3C48 +Test: Encrypt +Comment: Set 1, vector 155 +Key: 0000000000000000000000000000000000000010000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0735AE765BC079A93B451D873FA93702 +Test: Encrypt +Comment: Set 1, vector 156 +Key: 0000000000000000000000000000000000000008000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 89D988508A4569E2232F72412AE50B65 +Test: Encrypt +Comment: Set 1, vector 157 +Key: 0000000000000000000000000000000000000004000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BCF0EE2403BC9344030C0FF065B6FD88 +Test: Encrypt +Comment: Set 1, vector 158 +Key: 0000000000000000000000000000000000000002000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 25D76D36F3376D6FD835BA012C7DD2E5 +Test: Encrypt +Comment: Set 1, vector 159 +Key: 0000000000000000000000000000000000000001000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EF364A31E8551732D4B2098281D4E2C9 +Test: Encrypt +Comment: Set 1, vector 160 +Key: 0000000000000000000000000000000000000000800000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 64B1F927C0A7315EA60BC5F2A0DCCFE2 +Test: Encrypt +Comment: Set 1, vector 161 +Key: 0000000000000000000000000000000000000000400000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CA99E0EDFA0E121F27659346BCDCC443 +Test: Encrypt +Comment: Set 1, vector 162 +Key: 0000000000000000000000000000000000000000200000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1816D9D23D1069BC6DEC195F60994C05 +Test: Encrypt +Comment: Set 1, vector 163 +Key: 0000000000000000000000000000000000000000100000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9819575F6890E093091378AED0612051 +Test: Encrypt +Comment: Set 1, vector 164 +Key: 0000000000000000000000000000000000000000080000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 41903DE72A486B823842FBA2840E265C +Test: Encrypt +Comment: Set 1, vector 165 +Key: 0000000000000000000000000000000000000000040000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 30651D416912A01EDEC4290D34B4A605 +Test: Encrypt +Comment: Set 1, vector 166 +Key: 0000000000000000000000000000000000000000020000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0949AD8AB2E85995686D6D495ABA1028 +Test: Encrypt +Comment: Set 1, vector 167 +Key: 0000000000000000000000000000000000000000010000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3789C2D08E122BE204662FE9A0FDF77A +Test: Encrypt +Comment: Set 1, vector 168 +Key: 0000000000000000000000000000000000000000008000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A0C66EE031FF045123475E6F5FA64F57 +Test: Encrypt +Comment: Set 1, vector 169 +Key: 0000000000000000000000000000000000000000004000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1BACCDD314AF39124709013C94CAD1AC +Test: Encrypt +Comment: Set 1, vector 170 +Key: 0000000000000000000000000000000000000000002000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2FB5DF5527A8E06AED03D683EDF14E9A +Test: Encrypt +Comment: Set 1, vector 171 +Key: 0000000000000000000000000000000000000000001000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FF2C61AD63CDA6207605C18C888B383D +Test: Encrypt +Comment: Set 1, vector 172 +Key: 0000000000000000000000000000000000000000000800000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 71CE4A5B48671AB9A6561B7109FB8345 +Test: Encrypt +Comment: Set 1, vector 173 +Key: 0000000000000000000000000000000000000000000400000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 37299C12377E9CB8DF5FE730DFFCB5CA +Test: Encrypt +Comment: Set 1, vector 174 +Key: 0000000000000000000000000000000000000000000200000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C5454350A7CB0EC5CA3932A3948F48BC +Test: Encrypt +Comment: Set 1, vector 175 +Key: 0000000000000000000000000000000000000000000100000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8AB40D09FFBD0C82E9091FC80D2A63C9 +Test: Encrypt +Comment: Set 1, vector 176 +Key: 0000000000000000000000000000000000000000000080000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9CB3FE43EAE3DC7AC4F97E609FDE9F10 +Test: Encrypt +Comment: Set 1, vector 177 +Key: 0000000000000000000000000000000000000000000040000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 51369DC689B25C3AC593B578BAEA046E +Test: Encrypt +Comment: Set 1, vector 178 +Key: 0000000000000000000000000000000000000000000020000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 13D9D885A24AE8B859F239890DF438C9 +Test: Encrypt +Comment: Set 1, vector 179 +Key: 0000000000000000000000000000000000000000000010000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CEACAE376290D5C62D2DAE422CA6E5C0 +Test: Encrypt +Comment: Set 1, vector 180 +Key: 0000000000000000000000000000000000000000000008000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6AE17D621F97B62F4571AB165CE0A11F +Test: Encrypt +Comment: Set 1, vector 181 +Key: 0000000000000000000000000000000000000000000004000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C91318F8FD17E9BC656E639A0D648B3A +Test: Encrypt +Comment: Set 1, vector 182 +Key: 0000000000000000000000000000000000000000000002000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BFF1BC1C935E40FB0C20DED5985F1910 +Test: Encrypt +Comment: Set 1, vector 183 +Key: 0000000000000000000000000000000000000000000001000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 96F0B387F487BBDD5227B595A506F963 +Test: Encrypt +Comment: Set 1, vector 184 +Key: 0000000000000000000000000000000000000000000000800000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 62265B7EFB73A77205ECBBFD166B3EAE +Test: Encrypt +Comment: Set 1, vector 185 +Key: 0000000000000000000000000000000000000000000000400000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 016E8F3087757E8F576B19A58D356FB6 +Test: Encrypt +Comment: Set 1, vector 186 +Key: 0000000000000000000000000000000000000000000000200000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 456FAF632EA07797CEC23DC6553988F9 +Test: Encrypt +Comment: Set 1, vector 187 +Key: 0000000000000000000000000000000000000000000000100000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 147694E2231FA00D6B62D3E51CC8201D +Test: Encrypt +Comment: Set 1, vector 188 +Key: 0000000000000000000000000000000000000000000000080000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2299D31F3D747838C65FE7C6C0C59214 +Test: Encrypt +Comment: Set 1, vector 189 +Key: 0000000000000000000000000000000000000000000000040000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: C5A669612A23E4F7551D79650071E040 +Test: Encrypt +Comment: Set 1, vector 190 +Key: 0000000000000000000000000000000000000000000000020000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F0A32D722EDFD2BA628C781DACD5FC50 +Test: Encrypt +Comment: Set 1, vector 191 +Key: 0000000000000000000000000000000000000000000000010000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 422C8E2A0DFF095E40654CB2B7176A9B +Test: Encrypt +Comment: Set 1, vector 192 +Key: 0000000000000000000000000000000000000000000000008000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 99DEF168961D4AB9E63157E60F76399C +Test: Encrypt +Comment: Set 1, vector 193 +Key: 0000000000000000000000000000000000000000000000004000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 49C92ACC622A00BCFF7DFDCABF33CB4C +Test: Encrypt +Comment: Set 1, vector 194 +Key: 0000000000000000000000000000000000000000000000002000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 517117A096B2EE66D4BEF2D1EE570CE7 +Test: Encrypt +Comment: Set 1, vector 195 +Key: 0000000000000000000000000000000000000000000000001000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9DAECC0E82559BC2CDB8A01AB30BA605 +Test: Encrypt +Comment: Set 1, vector 196 +Key: 0000000000000000000000000000000000000000000000000800000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 50B2882928DAB54488413ABA5743535E +Test: Encrypt +Comment: Set 1, vector 197 +Key: 0000000000000000000000000000000000000000000000000400000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E6725F73ED920F473E1442ABEC7DB722 +Test: Encrypt +Comment: Set 1, vector 198 +Key: 0000000000000000000000000000000000000000000000000200000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CB4F06002C5864E40C80F97157452575 +Test: Encrypt +Comment: Set 1, vector 199 +Key: 0000000000000000000000000000000000000000000000000100000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8DF72D7C8AE547F2AA3E9AFAAD1D62F0 +Test: Encrypt +Comment: Set 1, vector 200 +Key: 0000000000000000000000000000000000000000000000000080000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0DA429E486F5ED9460B7C54460B0A699 +Test: Encrypt +Comment: Set 1, vector 201 +Key: 0000000000000000000000000000000000000000000000000040000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 24832DB462328D93306C6714E100ADAB +Test: Encrypt +Comment: Set 1, vector 202 +Key: 0000000000000000000000000000000000000000000000000020000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3170D82FEC3D2A58C7D2F28BAC4C7809 +Test: Encrypt +Comment: Set 1, vector 203 +Key: 0000000000000000000000000000000000000000000000000010000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 638A46425AEA9C808AC752EE69F56822 +Test: Encrypt +Comment: Set 1, vector 204 +Key: 0000000000000000000000000000000000000000000000000008000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F98954D90C5E3DB2EEC8A86078D70763 +Test: Encrypt +Comment: Set 1, vector 205 +Key: 0000000000000000000000000000000000000000000000000004000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8D5868451617FB145B8F7F91712A7AA0 +Test: Encrypt +Comment: Set 1, vector 206 +Key: 0000000000000000000000000000000000000000000000000002000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2292BA337A4F465E0DFB85DAAC266AE6 +Test: Encrypt +Comment: Set 1, vector 207 +Key: 0000000000000000000000000000000000000000000000000001000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F2560D5063A2F928D699005012A0C839 +Test: Encrypt +Comment: Set 1, vector 208 +Key: 0000000000000000000000000000000000000000000000000000800000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 44968AEABB2852075F83FB942E05099D +Test: Encrypt +Comment: Set 1, vector 209 +Key: 0000000000000000000000000000000000000000000000000000400000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EB339742AB40B5627A7CB60D4F54DD2E +Test: Encrypt +Comment: Set 1, vector 210 +Key: 0000000000000000000000000000000000000000000000000000200000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9AAA6FC3BBDE523E9FCD9D5C0255F912 +Test: Encrypt +Comment: Set 1, vector 211 +Key: 0000000000000000000000000000000000000000000000000000100000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E6E25CBAFF57F4C6056706FD13E6A2E3 +Test: Encrypt +Comment: Set 1, vector 212 +Key: 0000000000000000000000000000000000000000000000000000080000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 8A9628166922E8EC6FC28F5E847B9C71 +Test: Encrypt +Comment: Set 1, vector 213 +Key: 0000000000000000000000000000000000000000000000000000040000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 97CF8FF5D1337DA8602F8AB6C0224AF7 +Test: Encrypt +Comment: Set 1, vector 214 +Key: 0000000000000000000000000000000000000000000000000000020000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DDBBE09A93364599E9233969ADBEBA63 +Test: Encrypt +Comment: Set 1, vector 215 +Key: 0000000000000000000000000000000000000000000000000000010000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: E772954B9DA3DA8A005582C4E9E5B6FA +Test: Encrypt +Comment: Set 1, vector 216 +Key: 0000000000000000000000000000000000000000000000000000008000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 507DFD30F7EEF807F994B298D487FDE6 +Test: Encrypt +Comment: Set 1, vector 217 +Key: 0000000000000000000000000000000000000000000000000000004000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6FF09F69AED61F091F92503547A19B68 +Test: Encrypt +Comment: Set 1, vector 218 +Key: 0000000000000000000000000000000000000000000000000000002000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 1141E6BB725E09640DD6971F4EF1A886 +Test: Encrypt +Comment: Set 1, vector 219 +Key: 0000000000000000000000000000000000000000000000000000001000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9C0E8061BA0361B730D24675EF128705 +Test: Encrypt +Comment: Set 1, vector 220 +Key: 0000000000000000000000000000000000000000000000000000000800000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7D0137240D0D3D086198E83BC0CF22D0 +Test: Encrypt +Comment: Set 1, vector 221 +Key: 0000000000000000000000000000000000000000000000000000000400000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: BC4460FF55EBFAA1171B0CE249830281 +Test: Encrypt +Comment: Set 1, vector 222 +Key: 0000000000000000000000000000000000000000000000000000000200000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CDBE93ADCF1867B952FB82C42DF60CFD +Test: Encrypt +Comment: Set 1, vector 223 +Key: 0000000000000000000000000000000000000000000000000000000100000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 007AA375E4402B8A5657C01259AF3D49 +Test: Encrypt +Comment: Set 1, vector 224 +Key: 0000000000000000000000000000000000000000000000000000000080000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: F5C2B13998E5687C773017C14EB01FE4 +Test: Encrypt +Comment: Set 1, vector 225 +Key: 0000000000000000000000000000000000000000000000000000000040000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0AE71BFDD72FBC4576305E4B0807E17C +Test: Encrypt +Comment: Set 1, vector 226 +Key: 0000000000000000000000000000000000000000000000000000000020000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 35FB1CE6CB7449DF115D3AC6BA656439 +Test: Encrypt +Comment: Set 1, vector 227 +Key: 0000000000000000000000000000000000000000000000000000000010000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6D64CEC5D9D74BD40FBC0BE69C70B777 +Test: Encrypt +Comment: Set 1, vector 228 +Key: 0000000000000000000000000000000000000000000000000000000008000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7257851ACD3E3E3AE50048973C3A2AE8 +Test: Encrypt +Comment: Set 1, vector 229 +Key: 0000000000000000000000000000000000000000000000000000000004000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 50852661D5BD7960412B29A86F549619 +Test: Encrypt +Comment: Set 1, vector 230 +Key: 0000000000000000000000000000000000000000000000000000000002000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CDF3561D971D40521CD46BAE98F5867A +Test: Encrypt +Comment: Set 1, vector 231 +Key: 0000000000000000000000000000000000000000000000000000000001000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FA3C84185B9ABF9887DD501B3B0F52D3 +Test: Encrypt +Comment: Set 1, vector 232 +Key: 0000000000000000000000000000000000000000000000000000000000800000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 40A5B434F81574733D00F25511109E08 +Test: Encrypt +Comment: Set 1, vector 233 +Key: 0000000000000000000000000000000000000000000000000000000000400000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DA0D248315C527572F1673BDE26A475E +Test: Encrypt +Comment: Set 1, vector 234 +Key: 0000000000000000000000000000000000000000000000000000000000200000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0F8366D8EFB9AB63B0299F278C55CFB4 +Test: Encrypt +Comment: Set 1, vector 235 +Key: 0000000000000000000000000000000000000000000000000000000000100000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 25A089C523CD153EC094862B5923F492 +Test: Encrypt +Comment: Set 1, vector 236 +Key: 0000000000000000000000000000000000000000000000000000000000080000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7268A4628C6A0BE6A8391ABE70986176 +Test: Encrypt +Comment: Set 1, vector 237 +Key: 0000000000000000000000000000000000000000000000000000000000040000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7C11E6478CC688FE707454DF4AB5B666 +Test: Encrypt +Comment: Set 1, vector 238 +Key: 0000000000000000000000000000000000000000000000000000000000020000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 7601B6EBD5CE578973E949C21BFA8CAA +Test: Encrypt +Comment: Set 1, vector 239 +Key: 0000000000000000000000000000000000000000000000000000000000010000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0FCE9CCDF89F2EB139DBEB09B55375D5 +Test: Encrypt +Comment: Set 1, vector 240 +Key: 0000000000000000000000000000000000000000000000000000000000008000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AAABFDD9E28A3ADCA1212F3D7F53A269 +Test: Encrypt +Comment: Set 1, vector 241 +Key: 0000000000000000000000000000000000000000000000000000000000004000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: FC6B4304423917E41677768BD7A8D402 +Test: Encrypt +Comment: Set 1, vector 242 +Key: 0000000000000000000000000000000000000000000000000000000000002000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2AA3239D19ADBA9A4190E3653875C589 +Test: Encrypt +Comment: Set 1, vector 243 +Key: 0000000000000000000000000000000000000000000000000000000000001000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 4F4AB0DB2F3D3EA1E5FCBF99651485DC +Test: Encrypt +Comment: Set 1, vector 244 +Key: 0000000000000000000000000000000000000000000000000000000000000800 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B542CEF08D13E300B282CE6A74C51C96 +Test: Encrypt +Comment: Set 1, vector 245 +Key: 0000000000000000000000000000000000000000000000000000000000000400 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 9955E16433B0D58BFC4B35EE9F44734C +Test: Encrypt +Comment: Set 1, vector 246 +Key: 0000000000000000000000000000000000000000000000000000000000000200 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 5027A7DDC6F99A112E45D3090C7C3465 +Test: Encrypt +Comment: Set 1, vector 247 +Key: 0000000000000000000000000000000000000000000000000000000000000100 +Plaintext: 00000000000000000000000000000000 +Ciphertext: CB14EBD24FC63194495FACFFB5C3A07B +Test: Encrypt +Comment: Set 1, vector 248 +Key: 0000000000000000000000000000000000000000000000000000000000000080 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 2BCBE64545A08F59178242452566B997 +Test: Encrypt +Comment: Set 1, vector 249 +Key: 0000000000000000000000000000000000000000000000000000000000000040 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DE428FF12360A0C8FAE73E9D8E6A0657 +Test: Encrypt +Comment: Set 1, vector 250 +Key: 0000000000000000000000000000000000000000000000000000000000000020 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 6425603FCB0F088D87D3AC7078C7014C +Test: Encrypt +Comment: Set 1, vector 251 +Key: 0000000000000000000000000000000000000000000000000000000000000010 +Plaintext: 00000000000000000000000000000000 +Ciphertext: A837813C9436F4C48C45B6C85A4EAF84 +Test: Encrypt +Comment: Set 1, vector 252 +Key: 0000000000000000000000000000000000000000000000000000000000000008 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B95F9010E694BA44B812D6A7A59E027A +Test: Encrypt +Comment: Set 1, vector 253 +Key: 0000000000000000000000000000000000000000000000000000000000000004 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DF2746A2D9ED707DCC686BB64B77C9DD +Test: Encrypt +Comment: Set 1, vector 254 +Key: 0000000000000000000000000000000000000000000000000000000000000002 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 40DD304C3FC8FEF5D7D08FD467E018F6 +Test: Encrypt +Comment: Set 1, vector 255 +Key: 0000000000000000000000000000000000000000000000000000000000000001 +Plaintext: 00000000000000000000000000000000 +Ciphertext: AFCD38B195E0A736304E89B9AE3019D3 +Test: Encrypt +Comment: Set 2, vector 0 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 80000000000000000000000000000000 +Ciphertext: B0C6B88AEA518AB09E847248E91B1B9D +Test: Encrypt +Comment: Set 2, vector 1 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 40000000000000000000000000000000 +Ciphertext: B8D7684E35FA1DB15BDCEE7A48659858 +Test: Encrypt +Comment: Set 2, vector 2 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 20000000000000000000000000000000 +Ciphertext: F0CAD59AF92FBB79F36951E697492750 +Test: Encrypt +Comment: Set 2, vector 3 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 10000000000000000000000000000000 +Ciphertext: 117100F6635389560DC4A2DA24EBA70F +Test: Encrypt +Comment: Set 2, vector 4 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 08000000000000000000000000000000 +Ciphertext: DBDD62355553019ED84C35886421E532 +Test: Encrypt +Comment: Set 2, vector 5 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 04000000000000000000000000000000 +Ciphertext: 9CB8D04FA506F19848F7B9110518BFC8 +Test: Encrypt +Comment: Set 2, vector 6 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 02000000000000000000000000000000 +Ciphertext: E4308E253BC3444D293500701BA82C6A +Test: Encrypt +Comment: Set 2, vector 7 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 01000000000000000000000000000000 +Ciphertext: EA2FAE53F7F30C0170A20E95A068503E +Test: Encrypt +Comment: Set 2, vector 8 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00800000000000000000000000000000 +Ciphertext: 14B14839EA221880B2C64D1FE000B93D +Test: Encrypt +Comment: Set 2, vector 9 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00400000000000000000000000000000 +Ciphertext: A5CFC075B342D5101AACC334E73058BB +Test: Encrypt +Comment: Set 2, vector 10 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00200000000000000000000000000000 +Ciphertext: 477EA56B2EBAD0F8AC5E1936866560FF +Test: Encrypt +Comment: Set 2, vector 11 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00100000000000000000000000000000 +Ciphertext: 107E8598418404196EC59F63E45B7F6D +Test: Encrypt +Comment: Set 2, vector 12 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00080000000000000000000000000000 +Ciphertext: FF6A891E7C1C074A68FEC291928FDD8D +Test: Encrypt +Comment: Set 2, vector 13 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00040000000000000000000000000000 +Ciphertext: F64C250A13F45D377ADB7545B2B157A9 +Test: Encrypt +Comment: Set 2, vector 14 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00020000000000000000000000000000 +Ciphertext: FAD0F252086F11C830C65B63197CBC38 +Test: Encrypt +Comment: Set 2, vector 15 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00010000000000000000000000000000 +Ciphertext: 9DCB89B209441F02AD0D25C6AB826629 +Test: Encrypt +Comment: Set 2, vector 16 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00008000000000000000000000000000 +Ciphertext: E62E4ED4E4F34EDC563710D960E09D4C +Test: Encrypt +Comment: Set 2, vector 17 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00004000000000000000000000000000 +Ciphertext: 98A1B926BA06895C3F2E84CCBACBC356 +Test: Encrypt +Comment: Set 2, vector 18 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00002000000000000000000000000000 +Ciphertext: 29BE0BE4DB7F4D196718AEA38F3B0BFD +Test: Encrypt +Comment: Set 2, vector 19 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00001000000000000000000000000000 +Ciphertext: F670C4EBECBA0B43E71F6D752BFD4854 +Test: Encrypt +Comment: Set 2, vector 20 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000800000000000000000000000000 +Ciphertext: 7D7666B4484CDB7E3605468E093A787C +Test: Encrypt +Comment: Set 2, vector 21 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000400000000000000000000000000 +Ciphertext: 562D06B181C091DA6C43642AE99460C6 +Test: Encrypt +Comment: Set 2, vector 22 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000200000000000000000000000000 +Ciphertext: AB0EFB5975E6186B7D76BC9672453488 +Test: Encrypt +Comment: Set 2, vector 23 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000100000000000000000000000000 +Ciphertext: 10C0756538E7BFF88D19AE2B1F7B859A +Test: Encrypt +Comment: Set 2, vector 24 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000080000000000000000000000000 +Ciphertext: AF7FCD5248F8C72F1695AA05DD1CADE0 +Test: Encrypt +Comment: Set 2, vector 25 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000040000000000000000000000000 +Ciphertext: 9841E555655609A75D7BE20B8A90EF1E +Test: Encrypt +Comment: Set 2, vector 26 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000020000000000000000000000000 +Ciphertext: 27F9546E6A1B7464780000561783569C +Test: Encrypt +Comment: Set 2, vector 27 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000010000000000000000000000000 +Ciphertext: 8671D935D7A8354EECB7288803D42D7A +Test: Encrypt +Comment: Set 2, vector 28 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000008000000000000000000000000 +Ciphertext: 0DA44F508DEBC6F044394624FCEB8EBE +Test: Encrypt +Comment: Set 2, vector 29 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000004000000000000000000000000 +Ciphertext: AB137369BE6D93FBB18006BDB236EC09 +Test: Encrypt +Comment: Set 2, vector 30 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000002000000000000000000000000 +Ciphertext: EB90C4E597A7E1779FFA260886E26F75 +Test: Encrypt +Comment: Set 2, vector 31 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000001000000000000000000000000 +Ciphertext: 618CF3588D5C128EAF252616230E08F7 +Test: Encrypt +Comment: Set 2, vector 32 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000800000000000000000000000 +Ciphertext: 98DC4DB49D197AB9152D12B9DE2D73CA +Test: Encrypt +Comment: Set 2, vector 33 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000400000000000000000000000 +Ciphertext: 5BDDE24B15702A35E1F140C57D206443 +Test: Encrypt +Comment: Set 2, vector 34 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000200000000000000000000000 +Ciphertext: CF755809882BED8BA2F9F1A4ED296A2B +Test: Encrypt +Comment: Set 2, vector 35 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000100000000000000000000000 +Ciphertext: F1A8DBB999538AE89D16F92A7F4D1DF1 +Test: Encrypt +Comment: Set 2, vector 36 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000080000000000000000000000 +Ciphertext: 775222FDDAAECB81CF675C4E0B98179E +Test: Encrypt +Comment: Set 2, vector 37 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000040000000000000000000000 +Ciphertext: 12A648CADCD153C760A965826683119A +Test: Encrypt +Comment: Set 2, vector 38 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000020000000000000000000000 +Ciphertext: 0503FB10AB241E7CF45D8CDEEE474335 +Test: Encrypt +Comment: Set 2, vector 39 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000010000000000000000000000 +Ciphertext: 3D299C0070CBBD831B802690B8E7CA24 +Test: Encrypt +Comment: Set 2, vector 40 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000008000000000000000000000 +Ciphertext: 33105BD4D11D66753DC34D128BEFE3F4 +Test: Encrypt +Comment: Set 2, vector 41 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000004000000000000000000000 +Ciphertext: 5EFCE2B4B987C0F77D27B44836881682 +Test: Encrypt +Comment: Set 2, vector 42 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000002000000000000000000000 +Ciphertext: 7835449454128035D7F0EA99E327577B +Test: Encrypt +Comment: Set 2, vector 43 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000001000000000000000000000 +Ciphertext: 27BEDDA0601BE35122FB1D272D73AB3E +Test: Encrypt +Comment: Set 2, vector 44 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000800000000000000000000 +Ciphertext: 54C3F99FF48E318CC515EDE75800C4B3 +Test: Encrypt +Comment: Set 2, vector 45 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000400000000000000000000 +Ciphertext: C627C329F8E48299F6FDB23B9DBEA0BB +Test: Encrypt +Comment: Set 2, vector 46 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000200000000000000000000 +Ciphertext: 1B6578F9E23BD8C1845A02431C5F9AA3 +Test: Encrypt +Comment: Set 2, vector 47 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000100000000000000000000 +Ciphertext: 6DB2FB8C0B9344D0547C0FF1292020C6 +Test: Encrypt +Comment: Set 2, vector 48 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000080000000000000000000 +Ciphertext: 4FAD9B2C37C131493FBEF53581FA4F83 +Test: Encrypt +Comment: Set 2, vector 49 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000040000000000000000000 +Ciphertext: 47502A01E93D2C87BD5584F6AFD3D99D +Test: Encrypt +Comment: Set 2, vector 50 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000020000000000000000000 +Ciphertext: 056E1C6F651BFE50271B3B7A18E76D84 +Test: Encrypt +Comment: Set 2, vector 51 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000010000000000000000000 +Ciphertext: 5632BAF6627B3D96AD4E06FA6A561F55 +Test: Encrypt +Comment: Set 2, vector 52 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000008000000000000000000 +Ciphertext: E29807CAACDFA2D41A7D9E91FA7FD8EB +Test: Encrypt +Comment: Set 2, vector 53 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000004000000000000000000 +Ciphertext: 81DD44BB5D1822DEE605F9E6FF01D7B3 +Test: Encrypt +Comment: Set 2, vector 54 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000002000000000000000000 +Ciphertext: 5C3649925E47D7FF96482A8FBD9666FD +Test: Encrypt +Comment: Set 2, vector 55 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000001000000000000000000 +Ciphertext: 695415A836E66E737887845EC08A1ADB +Test: Encrypt +Comment: Set 2, vector 56 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000800000000000000000 +Ciphertext: F5416BCE292D9E2CEA5D1CC70BBAEED1 +Test: Encrypt +Comment: Set 2, vector 57 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000400000000000000000 +Ciphertext: 7AEC4F1388FC29C47F7FED74ADDE8485 +Test: Encrypt +Comment: Set 2, vector 58 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000200000000000000000 +Ciphertext: 82A9F1A6CE08BC4876E649D8A8EA7EB6 +Test: Encrypt +Comment: Set 2, vector 59 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000100000000000000000 +Ciphertext: B6296C88ADF1A792908B065EEB04BFC2 +Test: Encrypt +Comment: Set 2, vector 60 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000080000000000000000 +Ciphertext: E766A39AECCA40BDBFBE6FF3FA292913 +Test: Encrypt +Comment: Set 2, vector 61 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000040000000000000000 +Ciphertext: C6D081454EA00D83C23B5A62C84359E1 +Test: Encrypt +Comment: Set 2, vector 62 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000020000000000000000 +Ciphertext: 85D259A79CCA80484504D1603F7A8F53 +Test: Encrypt +Comment: Set 2, vector 63 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000010000000000000000 +Ciphertext: D8291FA1C6DC250078824B2D0A20883F +Test: Encrypt +Comment: Set 2, vector 64 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000008000000000000000 +Ciphertext: 95387CB74C48FFBD1F8D64A6CC45E074 +Test: Encrypt +Comment: Set 2, vector 65 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000004000000000000000 +Ciphertext: A17F975F538F56CDF629B516011DE837 +Test: Encrypt +Comment: Set 2, vector 66 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000002000000000000000 +Ciphertext: B50B615A1654C6E1CB6AB33716C097FE +Test: Encrypt +Comment: Set 2, vector 67 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000001000000000000000 +Ciphertext: 7BBB2CBB874DF6C8B821DA7FB0F9011B +Test: Encrypt +Comment: Set 2, vector 68 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000800000000000000 +Ciphertext: E9EFE074D096A275E47CD2E6206DF6A1 +Test: Encrypt +Comment: Set 2, vector 69 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000400000000000000 +Ciphertext: 88F2F8D5A836406AE8BBB98C65BBDA55 +Test: Encrypt +Comment: Set 2, vector 70 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000200000000000000 +Ciphertext: F64620D8D87585A3EF038B9AD58F5EA0 +Test: Encrypt +Comment: Set 2, vector 71 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000100000000000000 +Ciphertext: 694438EC141C8ED5F2F898B4554A298F +Test: Encrypt +Comment: Set 2, vector 72 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000080000000000000 +Ciphertext: 3E6226EC7726A1EE5F5FA9B18CCE8C44 +Test: Encrypt +Comment: Set 2, vector 73 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000040000000000000 +Ciphertext: 8AB6949E79911647800B9E87362AB97A +Test: Encrypt +Comment: Set 2, vector 74 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000020000000000000 +Ciphertext: 093C5CF24EDAF7F9F1C8A80DE4FF50A9 +Test: Encrypt +Comment: Set 2, vector 75 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000010000000000000 +Ciphertext: 28A36E50061F19E240351ED0E378CBF4 +Test: Encrypt +Comment: Set 2, vector 76 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000008000000000000 +Ciphertext: B93BB36CB88BF26EA79198652AA51D3C +Test: Encrypt +Comment: Set 2, vector 77 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000004000000000000 +Ciphertext: DE4948083D044FAC9BCA6DA8CD67B8A6 +Test: Encrypt +Comment: Set 2, vector 78 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000002000000000000 +Ciphertext: 6E778B5BDA6CA118117E47470D080D3C +Test: Encrypt +Comment: Set 2, vector 79 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000001000000000000 +Ciphertext: 0A9107324DA32B4281D032A3487EF875 +Test: Encrypt +Comment: Set 2, vector 80 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000800000000000 +Ciphertext: 18ED5635312D71ABD123CCE779D4D68A +Test: Encrypt +Comment: Set 2, vector 81 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000400000000000 +Ciphertext: 2E3C63F95C4BC1F944BAB06DEDC9AA8E +Test: Encrypt +Comment: Set 2, vector 82 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000200000000000 +Ciphertext: ACCC869EF07004C8C3C709083BE7BA2F +Test: Encrypt +Comment: Set 2, vector 83 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000100000000000 +Ciphertext: DF60B34FB1A59147CC1FB049C1578206 +Test: Encrypt +Comment: Set 2, vector 84 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000080000000000 +Ciphertext: 4228DC636C08E41021054AA0E1E2227A +Test: Encrypt +Comment: Set 2, vector 85 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000040000000000 +Ciphertext: 7CE27F66EFD735FFD6B3E1738C50495B +Test: Encrypt +Comment: Set 2, vector 86 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000020000000000 +Ciphertext: F8E74B33A9CDE351DA0BBC06D69093D7 +Test: Encrypt +Comment: Set 2, vector 87 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000010000000000 +Ciphertext: AE0D22A5B37B8DC5D81CC641EED334D0 +Test: Encrypt +Comment: Set 2, vector 88 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000008000000000 +Ciphertext: C181C6CA5E163743458B9167A0B6A16A +Test: Encrypt +Comment: Set 2, vector 89 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000004000000000 +Ciphertext: 5171F4F6095E4B276CFBA1F07223FBE6 +Test: Encrypt +Comment: Set 2, vector 90 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000002000000000 +Ciphertext: 2732F4D3A8C9D1D8D493840D6E0B864F +Test: Encrypt +Comment: Set 2, vector 91 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000001000000000 +Ciphertext: 3EF04E0059A061D973532CA5C1DFBE7B +Test: Encrypt +Comment: Set 2, vector 92 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000800000000 +Ciphertext: 6D9A8F23579E4978EBAA87B5ADEB77E5 +Test: Encrypt +Comment: Set 2, vector 93 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000400000000 +Ciphertext: BBD08873CC44BA4253C0C41FEEB7F124 +Test: Encrypt +Comment: Set 2, vector 94 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000200000000 +Ciphertext: 72E4B2437CBD283F3809CE686F6A591E +Test: Encrypt +Comment: Set 2, vector 95 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000100000000 +Ciphertext: 6E5580514B92512B1BF4B1B987B9AA1B +Test: Encrypt +Comment: Set 2, vector 96 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000080000000 +Ciphertext: 5EF5D0C5BCBDCB604D3A083B68CE0FA3 +Test: Encrypt +Comment: Set 2, vector 97 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000040000000 +Ciphertext: 9D991FDD723AD2182777A15CA0E0F665 +Test: Encrypt +Comment: Set 2, vector 98 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000020000000 +Ciphertext: 24440626EFC8F86BEA7DE78085AB8A22 +Test: Encrypt +Comment: Set 2, vector 99 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000010000000 +Ciphertext: 17C3630D62D13C1E826C0FCCBD74A864 +Test: Encrypt +Comment: Set 2, vector 100 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000008000000 +Ciphertext: 4CF5AB86A56AB134A7FE46CCE3F9FCE9 +Test: Encrypt +Comment: Set 2, vector 101 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000004000000 +Ciphertext: 3E6B9C0388F6D9B8F458F30221907607 +Test: Encrypt +Comment: Set 2, vector 102 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000002000000 +Ciphertext: AD9C926B8A5CD98EEE88200617E59958 +Test: Encrypt +Comment: Set 2, vector 103 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000001000000 +Ciphertext: AFF8AED5E075E02AF720CA4BF0028B3B +Test: Encrypt +Comment: Set 2, vector 104 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000800000 +Ciphertext: D90EAFF909202BB209BB3BB8C7F9A954 +Test: Encrypt +Comment: Set 2, vector 105 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000400000 +Ciphertext: 2C709B00E6A22F00F64A7D8EE341853F +Test: Encrypt +Comment: Set 2, vector 106 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000200000 +Ciphertext: CCEC598F0D9F0BF201B2F487136D54A4 +Test: Encrypt +Comment: Set 2, vector 107 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000100000 +Ciphertext: 73B2883A0A166AAE1BF14E60A5195FA3 +Test: Encrypt +Comment: Set 2, vector 108 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000080000 +Ciphertext: E676867BD9AD5EF915143388496779D7 +Test: Encrypt +Comment: Set 2, vector 109 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000040000 +Ciphertext: CDCB73D1BFCFD4BE7F1DAA9B1C6A4055 +Test: Encrypt +Comment: Set 2, vector 110 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000020000 +Ciphertext: 02A3A5C89DAA24CD2C517F7A73286A89 +Test: Encrypt +Comment: Set 2, vector 111 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000010000 +Ciphertext: C0FA2AC9E92EE58C2DD12D6D43AB7035 +Test: Encrypt +Comment: Set 2, vector 112 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000008000 +Ciphertext: EDC2CB1F7291353BDBF2385519E6AE16 +Test: Encrypt +Comment: Set 2, vector 113 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000004000 +Ciphertext: B4B62D16D197A98CD3B978812B9D9884 +Test: Encrypt +Comment: Set 2, vector 114 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000002000 +Ciphertext: 5CDFC95A529A905101CEA26BC1B891ED +Test: Encrypt +Comment: Set 2, vector 115 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000001000 +Ciphertext: CC7150CD3650B98363296C7C4ED368D1 +Test: Encrypt +Comment: Set 2, vector 116 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000800 +Ciphertext: CC57706B0C6526B8E25A5DBD32EACBDB +Test: Encrypt +Comment: Set 2, vector 117 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000400 +Ciphertext: 30D30456AD98B182D64C649648F6AEC9 +Test: Encrypt +Comment: Set 2, vector 118 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000200 +Ciphertext: D7E9DA7F631938EB649A08AF82FBD75F +Test: Encrypt +Comment: Set 2, vector 119 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000100 +Ciphertext: B8DA2AF6600B07895B5D0FFAF4991469 +Test: Encrypt +Comment: Set 2, vector 120 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000080 +Ciphertext: 0F6F64F930BA6C178943322B98114599 +Test: Encrypt +Comment: Set 2, vector 121 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000040 +Ciphertext: 8B1F247802E47C91BEE2AA34ECFD7A01 +Test: Encrypt +Comment: Set 2, vector 122 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000020 +Ciphertext: 7A6985778D3A66E97F23E01F0D0E45E7 +Test: Encrypt +Comment: Set 2, vector 123 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000010 +Ciphertext: BA664AC39855518DFDEE10D1B3111FAE +Test: Encrypt +Comment: Set 2, vector 124 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000008 +Ciphertext: 7C92854D801A1648F65CA81813DDBF83 +Test: Encrypt +Comment: Set 2, vector 125 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000004 +Ciphertext: 6A3F25AAB7E92D9CF378E5D9C040F26B +Test: Encrypt +Comment: Set 2, vector 126 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000002 +Ciphertext: 3D4B2CDE666761BA5DFB305178E667FB +Test: Encrypt +Comment: Set 2, vector 127 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000001 +Ciphertext: 9CDB269B5D293BC5DB9C55B057D9B591 +Test: Encrypt +Comment: Set 3, vector 0 +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 396154111ADEFC500CF6E5C99038BC17 +Test: Encrypt +Comment: Set 3, vector 1 +Key: 0101010101010101010101010101010101010101010101010101010101010101 +Plaintext: 01010101010101010101010101010101 +Ciphertext: 438D0C2E7E86869B56EBA23B66086A01 +Test: Encrypt +Comment: Set 3, vector 2 +Key: 0202020202020202020202020202020202020202020202020202020202020202 +Plaintext: 02020202020202020202020202020202 +Ciphertext: D4F553BFA794F55EF3B7A578629F6DEA +Test: Encrypt +Comment: Set 3, vector 3 +Key: 0303030303030303030303030303030303030303030303030303030303030303 +Plaintext: 03030303030303030303030303030303 +Ciphertext: B1EB06630CF3E25AEF18FA34709232F7 +Test: Encrypt +Comment: Set 3, vector 4 +Key: 0404040404040404040404040404040404040404040404040404040404040404 +Plaintext: 04040404040404040404040404040404 +Ciphertext: 5E858730ABC9823A93CA4CAB67F0B423 +Test: Encrypt +Comment: Set 3, vector 5 +Key: 0505050505050505050505050505050505050505050505050505050505050505 +Plaintext: 05050505050505050505050505050505 +Ciphertext: 9FC988D43FE3712CF6D2DB552FE3C80F +Test: Encrypt +Comment: Set 3, vector 6 +Key: 0606060606060606060606060606060606060606060606060606060606060606 +Plaintext: 06060606060606060606060606060606 +Ciphertext: 6109500D59414C9974D15818A2BA6DD0 +Test: Encrypt +Comment: Set 3, vector 7 +Key: 0707070707070707070707070707070707070707070707070707070707070707 +Plaintext: 07070707070707070707070707070707 +Ciphertext: 5F6BF9AC53A680EACAE7583A8933DA8E +Test: Encrypt +Comment: Set 3, vector 8 +Key: 0808080808080808080808080808080808080808080808080808080808080808 +Plaintext: 08080808080808080808080808080808 +Ciphertext: F9A9C1540AE1B314DBEDF9A49054DC9D +Test: Encrypt +Comment: Set 3, vector 9 +Key: 0909090909090909090909090909090909090909090909090909090909090909 +Plaintext: 09090909090909090909090909090909 +Ciphertext: 6D66755ACDB9D90BEC599A0BC0C7BF48 +Test: Encrypt +Comment: Set 3, vector 10 +Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Ciphertext: 5527F328AF93C2D5CCC80AF7A3E8DF3D +Test: Encrypt +Comment: Set 3, vector 11 +Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Ciphertext: 27AA99F8E6EA08D8E8D5A528EE4774B6 +Test: Encrypt +Comment: Set 3, vector 12 +Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Ciphertext: 46F7D660A22232F5E3664EF355098CE4 +Test: Encrypt +Comment: Set 3, vector 13 +Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Ciphertext: BDC0AEC72B53B747AB5C7BD62062826A +Test: Encrypt +Comment: Set 3, vector 14 +Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Ciphertext: A0CAB391DC8BFF0281F3E1C70C1CE33B +Test: Encrypt +Comment: Set 3, vector 15 +Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Ciphertext: 5CBFB3E894AE1428549CCF777A9F0A73 +Test: Encrypt +Comment: Set 3, vector 16 +Key: 1010101010101010101010101010101010101010101010101010101010101010 +Plaintext: 10101010101010101010101010101010 +Ciphertext: 6693FC130669F194F81E8D175194DDA2 +Test: Encrypt +Comment: Set 3, vector 17 +Key: 1111111111111111111111111111111111111111111111111111111111111111 +Plaintext: 11111111111111111111111111111111 +Ciphertext: A6A72472F8C04329C0E2FB56982A33C7 +Test: Encrypt +Comment: Set 3, vector 18 +Key: 1212121212121212121212121212121212121212121212121212121212121212 +Plaintext: 12121212121212121212121212121212 +Ciphertext: 6321875C5F89CCE16C6FF5E85E759C9A +Test: Encrypt +Comment: Set 3, vector 19 +Key: 1313131313131313131313131313131313131313131313131313131313131313 +Plaintext: 13131313131313131313131313131313 +Ciphertext: 8819C97D05C91A23062E9851F07EF6F7 +Test: Encrypt +Comment: Set 3, vector 20 +Key: 1414141414141414141414141414141414141414141414141414141414141414 +Plaintext: 14141414141414141414141414141414 +Ciphertext: F894FEB12164BB32AC846DD9530604CE +Test: Encrypt +Comment: Set 3, vector 21 +Key: 1515151515151515151515151515151515151515151515151515151515151515 +Plaintext: 15151515151515151515151515151515 +Ciphertext: 61B02392CD3F571B35C862E703DB2053 +Test: Encrypt +Comment: Set 3, vector 22 +Key: 1616161616161616161616161616161616161616161616161616161616161616 +Plaintext: 16161616161616161616161616161616 +Ciphertext: 6269E137F8480D555D1B24F392162DBA +Test: Encrypt +Comment: Set 3, vector 23 +Key: 1717171717171717171717171717171717171717171717171717171717171717 +Plaintext: 17171717171717171717171717171717 +Ciphertext: B6662F56AA3D23DE1DFDE165B2D63FA0 +Test: Encrypt +Comment: Set 3, vector 24 +Key: 1818181818181818181818181818181818181818181818181818181818181818 +Plaintext: 18181818181818181818181818181818 +Ciphertext: C8271ACE969013EE2C9EF1512FFABAE5 +Test: Encrypt +Comment: Set 3, vector 25 +Key: 1919191919191919191919191919191919191919191919191919191919191919 +Plaintext: 19191919191919191919191919191919 +Ciphertext: 6982E764E750CDF3E5F9C4E40A5DFE28 +Test: Encrypt +Comment: Set 3, vector 26 +Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Ciphertext: 23172E86AF4A140A78CB1DC776270FFF +Test: Encrypt +Comment: Set 3, vector 27 +Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Ciphertext: BA0BD958FC1DE142EC40326B2C315AA5 +Test: Encrypt +Comment: Set 3, vector 28 +Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Ciphertext: 7FB2B8A4B95CBFB74BFD5F7A5641261C +Test: Encrypt +Comment: Set 3, vector 29 +Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Ciphertext: 56B261D89F8978041E2602DF97386BF7 +Test: Encrypt +Comment: Set 3, vector 30 +Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Ciphertext: A2D74F5148C84C1F990290E17DD3EDFA +Test: Encrypt +Comment: Set 3, vector 31 +Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Ciphertext: 7D8BC76F1D941FC3C7E4C6F17AC03FF4 +Test: Encrypt +Comment: Set 3, vector 32 +Key: 2020202020202020202020202020202020202020202020202020202020202020 +Plaintext: 20202020202020202020202020202020 +Ciphertext: F3E1FDA6B9C8314799F4654C29F1C690 +Test: Encrypt +Comment: Set 3, vector 33 +Key: 2121212121212121212121212121212121212121212121212121212121212121 +Plaintext: 21212121212121212121212121212121 +Ciphertext: 9BB8499B8631F6211D22DE555010E482 +Test: Encrypt +Comment: Set 3, vector 34 +Key: 2222222222222222222222222222222222222222222222222222222222222222 +Plaintext: 22222222222222222222222222222222 +Ciphertext: B098D857086ABC425B437BD63E8A53D2 +Test: Encrypt +Comment: Set 3, vector 35 +Key: 2323232323232323232323232323232323232323232323232323232323232323 +Plaintext: 23232323232323232323232323232323 +Ciphertext: F157E2B1298A205C7EF526F3E3196BF4 +Test: Encrypt +Comment: Set 3, vector 36 +Key: 2424242424242424242424242424242424242424242424242424242424242424 +Plaintext: 24242424242424242424242424242424 +Ciphertext: 91FE4F664ED2FE0097D8B95703694BBE +Test: Encrypt +Comment: Set 3, vector 37 +Key: 2525252525252525252525252525252525252525252525252525252525252525 +Plaintext: 25252525252525252525252525252525 +Ciphertext: 742EF3C2DC4490F7D1BDB3031137B6C1 +Test: Encrypt +Comment: Set 3, vector 38 +Key: 2626262626262626262626262626262626262626262626262626262626262626 +Plaintext: 26262626262626262626262626262626 +Ciphertext: 79302D9C8DBBBDAD7B8D8B9E7A60E42D +Test: Encrypt +Comment: Set 3, vector 39 +Key: 2727272727272727272727272727272727272727272727272727272727272727 +Plaintext: 27272727272727272727272727272727 +Ciphertext: 4F4DA48026B809452E7FFB1C3DAFBD99 +Test: Encrypt +Comment: Set 3, vector 40 +Key: 2828282828282828282828282828282828282828282828282828282828282828 +Plaintext: 28282828282828282828282828282828 +Ciphertext: 6D9DF175ED0DAFE550619CF8362B98E8 +Test: Encrypt +Comment: Set 3, vector 41 +Key: 2929292929292929292929292929292929292929292929292929292929292929 +Plaintext: 29292929292929292929292929292929 +Ciphertext: 5D4A406E3C89612AA89A9D38A80ECFEF +Test: Encrypt +Comment: Set 3, vector 42 +Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Ciphertext: 51CE933AD1EB3117A129788D3D0B815A +Test: Encrypt +Comment: Set 3, vector 43 +Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Ciphertext: DD39326230AC02767866ADE07AED1DAA +Test: Encrypt +Comment: Set 3, vector 44 +Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Ciphertext: DC493BAD40D435273B18026DE5412278 +Test: Encrypt +Comment: Set 3, vector 45 +Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Ciphertext: 8A61E9750E1DAC58C92F5E243CA7465B +Test: Encrypt +Comment: Set 3, vector 46 +Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Ciphertext: 57A7641E6A7B61A86AFD7A23578DFBC5 +Test: Encrypt +Comment: Set 3, vector 47 +Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Ciphertext: 019A8F9D38B4B92B077D08B025C15550 +Test: Encrypt +Comment: Set 3, vector 48 +Key: 3030303030303030303030303030303030303030303030303030303030303030 +Plaintext: 30303030303030303030303030303030 +Ciphertext: 9F6EEA9C215C273135C53A3F4208469E +Test: Encrypt +Comment: Set 3, vector 49 +Key: 3131313131313131313131313131313131313131313131313131313131313131 +Plaintext: 31313131313131313131313131313131 +Ciphertext: 7BF3D63D790CAB57EA8354B10FEBDE18 +Test: Encrypt +Comment: Set 3, vector 50 +Key: 3232323232323232323232323232323232323232323232323232323232323232 +Plaintext: 32323232323232323232323232323232 +Ciphertext: AB30751ED4052A1D916E50C4073DFCB5 +Test: Encrypt +Comment: Set 3, vector 51 +Key: 3333333333333333333333333333333333333333333333333333333333333333 +Plaintext: 33333333333333333333333333333333 +Ciphertext: C39180F205BBA8BEE9832BF56FCC75C0 +Test: Encrypt +Comment: Set 3, vector 52 +Key: 3434343434343434343434343434343434343434343434343434343434343434 +Plaintext: 34343434343434343434343434343434 +Ciphertext: 3BEDE5E09CB9CCFC8BE38F8378D49AE9 +Test: Encrypt +Comment: Set 3, vector 53 +Key: 3535353535353535353535353535353535353535353535353535353535353535 +Plaintext: 35353535353535353535353535353535 +Ciphertext: 448AE4ADF7070A8B8C4AB0FE7277E8D7 +Test: Encrypt +Comment: Set 3, vector 54 +Key: 3636363636363636363636363636363636363636363636363636363636363636 +Plaintext: 36363636363636363636363636363636 +Ciphertext: 095A361F2243FC39F4ECD94A5AC0F94A +Test: Encrypt +Comment: Set 3, vector 55 +Key: 3737373737373737373737373737373737373737373737373737373737373737 +Plaintext: 37373737373737373737373737373737 +Ciphertext: AD77D7D2A7F3AF5732CE5A51E83D7025 +Test: Encrypt +Comment: Set 3, vector 56 +Key: 3838383838383838383838383838383838383838383838383838383838383838 +Plaintext: 38383838383838383838383838383838 +Ciphertext: 930DA09C18DF5F6D072AA662CC8F7751 +Test: Encrypt +Comment: Set 3, vector 57 +Key: 3939393939393939393939393939393939393939393939393939393939393939 +Plaintext: 39393939393939393939393939393939 +Ciphertext: F3B3871B66FE8A1FA4AE2150EC8B7060 +Test: Encrypt +Comment: Set 3, vector 58 +Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Ciphertext: 62DD93CFA7EFC223A822A6F754B6298D +Test: Encrypt +Comment: Set 3, vector 59 +Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Ciphertext: C86A0377B3C45C2B1896829D7B0610F3 +Test: Encrypt +Comment: Set 3, vector 60 +Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Ciphertext: 8CCFC961EBAB55C0ECB1B10EDEDD9C61 +Test: Encrypt +Comment: Set 3, vector 61 +Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Ciphertext: D828E857BDBD6192300764A2084E0680 +Test: Encrypt +Comment: Set 3, vector 62 +Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Ciphertext: 24C0DC84D72EA678201534CE8DC22A45 +Test: Encrypt +Comment: Set 3, vector 63 +Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Ciphertext: D65F340A25D35E5D0B08C63FA44F9898 +Test: Encrypt +Comment: Set 3, vector 64 +Key: 4040404040404040404040404040404040404040404040404040404040404040 +Plaintext: 40404040404040404040404040404040 +Ciphertext: 4A30476F1141FBF303ED63FCD3CB0536 +Test: Encrypt +Comment: Set 3, vector 65 +Key: 4141414141414141414141414141414141414141414141414141414141414141 +Plaintext: 41414141414141414141414141414141 +Ciphertext: 78246080B38B5283960E0253E2FF6A5E +Test: Encrypt +Comment: Set 3, vector 66 +Key: 4242424242424242424242424242424242424242424242424242424242424242 +Plaintext: 42424242424242424242424242424242 +Ciphertext: 475E8388EE3D3EE111DD0E816B244DD2 +Test: Encrypt +Comment: Set 3, vector 67 +Key: 4343434343434343434343434343434343434343434343434343434343434343 +Plaintext: 43434343434343434343434343434343 +Ciphertext: D40D3FECE8B05875F2FCD23526CCD6B2 +Test: Encrypt +Comment: Set 3, vector 68 +Key: 4444444444444444444444444444444444444444444444444444444444444444 +Plaintext: 44444444444444444444444444444444 +Ciphertext: CD9846E1B120482E6B6D71C4F5D704FE +Test: Encrypt +Comment: Set 3, vector 69 +Key: 4545454545454545454545454545454545454545454545454545454545454545 +Plaintext: 45454545454545454545454545454545 +Ciphertext: E707C35474257CE52617B5889ECB974B +Test: Encrypt +Comment: Set 3, vector 70 +Key: 4646464646464646464646464646464646464646464646464646464646464646 +Plaintext: 46464646464646464646464646464646 +Ciphertext: 9A79D57FD89D938F4B4CACA52E8CB544 +Test: Encrypt +Comment: Set 3, vector 71 +Key: 4747474747474747474747474747474747474747474747474747474747474747 +Plaintext: 47474747474747474747474747474747 +Ciphertext: 34F9B98AC130F7E7B123ECBF8910735C +Test: Encrypt +Comment: Set 3, vector 72 +Key: 4848484848484848484848484848484848484848484848484848484848484848 +Plaintext: 48484848484848484848484848484848 +Ciphertext: BF75CC83FE76E8A15981DA738E5A8513 +Test: Encrypt +Comment: Set 3, vector 73 +Key: 4949494949494949494949494949494949494949494949494949494949494949 +Plaintext: 49494949494949494949494949494949 +Ciphertext: 4A452EFBE634441444FB50641CB2EFC1 +Test: Encrypt +Comment: Set 3, vector 74 +Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Ciphertext: 3D5ED11F0C81E81BAB97B7148D67BA55 +Test: Encrypt +Comment: Set 3, vector 75 +Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Ciphertext: DBBAE78B177C27954DEDBAD5D98E7BEE +Test: Encrypt +Comment: Set 3, vector 76 +Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Ciphertext: F52D16EFC5DE991430F6E7D13983DEB8 +Test: Encrypt +Comment: Set 3, vector 77 +Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Ciphertext: B6C98EBC320B3BDD927C2FE57F8180B5 +Test: Encrypt +Comment: Set 3, vector 78 +Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Ciphertext: D510C35680C9B958C81599F3665FBEC1 +Test: Encrypt +Comment: Set 3, vector 79 +Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Ciphertext: 72DAD08BF510CDFEEC76FEAB908829B4 +Test: Encrypt +Comment: Set 3, vector 80 +Key: 5050505050505050505050505050505050505050505050505050505050505050 +Plaintext: 50505050505050505050505050505050 +Ciphertext: AC7B447EDB38F935469309E766BCB1F6 +Test: Encrypt +Comment: Set 3, vector 81 +Key: 5151515151515151515151515151515151515151515151515151515151515151 +Plaintext: 51515151515151515151515151515151 +Ciphertext: 18B937F666BF580F9CDB60A935427459 +Test: Encrypt +Comment: Set 3, vector 82 +Key: 5252525252525252525252525252525252525252525252525252525252525252 +Plaintext: 52525252525252525252525252525252 +Ciphertext: 6A08B38202685E610CA9584725D6092A +Test: Encrypt +Comment: Set 3, vector 83 +Key: 5353535353535353535353535353535353535353535353535353535353535353 +Plaintext: 53535353535353535353535353535353 +Ciphertext: 1CA09E9C14C2A833A7B7ACB1C9C12AC1 +Test: Encrypt +Comment: Set 3, vector 84 +Key: 5454545454545454545454545454545454545454545454545454545454545454 +Plaintext: 54545454545454545454545454545454 +Ciphertext: 8AB7ED64FE477B7D9A6B5B5056EA1E02 +Test: Encrypt +Comment: Set 3, vector 85 +Key: 5555555555555555555555555555555555555555555555555555555555555555 +Plaintext: 55555555555555555555555555555555 +Ciphertext: D610D6199D4FE03ED09AD568664F709A +Test: Encrypt +Comment: Set 3, vector 86 +Key: 5656565656565656565656565656565656565656565656565656565656565656 +Plaintext: 56565656565656565656565656565656 +Ciphertext: D400C1E6109F04AE50C1C341BA4E3175 +Test: Encrypt +Comment: Set 3, vector 87 +Key: 5757575757575757575757575757575757575757575757575757575757575757 +Plaintext: 57575757575757575757575757575757 +Ciphertext: DF888CBB7DBD8DE3F0BE6C6EDC72060F +Test: Encrypt +Comment: Set 3, vector 88 +Key: 5858585858585858585858585858585858585858585858585858585858585858 +Plaintext: 58585858585858585858585858585858 +Ciphertext: 9C3B100466C63AA93D420EDF54381BF4 +Test: Encrypt +Comment: Set 3, vector 89 +Key: 5959595959595959595959595959595959595959595959595959595959595959 +Plaintext: 59595959595959595959595959595959 +Ciphertext: 0BE794F0233BE9A7DB7C41A1CA4BA7E3 +Test: Encrypt +Comment: Set 3, vector 90 +Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Ciphertext: 2C8D04D6B9DA81D07174729A07F25BB9 +Test: Encrypt +Comment: Set 3, vector 91 +Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Ciphertext: FFCEB69835E2E5EF4C867CE28540F91F +Test: Encrypt +Comment: Set 3, vector 92 +Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Ciphertext: A7F7F8437918BEFF5DCFCFB366CDFABD +Test: Encrypt +Comment: Set 3, vector 93 +Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Ciphertext: 14C9736F407AE78D7D3ED18B875B940D +Test: Encrypt +Comment: Set 3, vector 94 +Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Ciphertext: 1668A0C6A5734B98D9D641E0B6FAD80C +Test: Encrypt +Comment: Set 3, vector 95 +Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Ciphertext: DA8775267C9722BA743A085F8591F06D +Test: Encrypt +Comment: Set 3, vector 96 +Key: 6060606060606060606060606060606060606060606060606060606060606060 +Plaintext: 60606060606060606060606060606060 +Ciphertext: 5F8172C28603C80206C276E0979EA40E +Test: Encrypt +Comment: Set 3, vector 97 +Key: 6161616161616161616161616161616161616161616161616161616161616161 +Plaintext: 61616161616161616161616161616161 +Ciphertext: E4938D0078D29E0247BF2EA0C1FCB85F +Test: Encrypt +Comment: Set 3, vector 98 +Key: 6262626262626262626262626262626262626262626262626262626262626262 +Plaintext: 62626262626262626262626262626262 +Ciphertext: A48FEE4F9FA4597303C2CF92061304A1 +Test: Encrypt +Comment: Set 3, vector 99 +Key: 6363636363636363636363636363636363636363636363636363636363636363 +Plaintext: 63636363636363636363636363636363 +Ciphertext: 3C8F6CF66C73684DDB09D1AA57CD0950 +Test: Encrypt +Comment: Set 3, vector 100 +Key: 6464646464646464646464646464646464646464646464646464646464646464 +Plaintext: 64646464646464646464646464646464 +Ciphertext: B3D9EE0337253E9C4027FEA938AB399C +Test: Encrypt +Comment: Set 3, vector 101 +Key: 6565656565656565656565656565656565656565656565656565656565656565 +Plaintext: 65656565656565656565656565656565 +Ciphertext: 3BE933A85E5997573077903CEB481AFA +Test: Encrypt +Comment: Set 3, vector 102 +Key: 6666666666666666666666666666666666666666666666666666666666666666 +Plaintext: 66666666666666666666666666666666 +Ciphertext: 06AFED96C6E7130EB3311D81CCE69F9C +Test: Encrypt +Comment: Set 3, vector 103 +Key: 6767676767676767676767676767676767676767676767676767676767676767 +Plaintext: 67676767676767676767676767676767 +Ciphertext: 183C3606139211F90F4849E93DB7DDEE +Test: Encrypt +Comment: Set 3, vector 104 +Key: 6868686868686868686868686868686868686868686868686868686868686868 +Plaintext: 68686868686868686868686868686868 +Ciphertext: 217C34184950DE7B43E46EE4BE88A9BE +Test: Encrypt +Comment: Set 3, vector 105 +Key: 6969696969696969696969696969696969696969696969696969696969696969 +Plaintext: 69696969696969696969696969696969 +Ciphertext: CA447ED204F2A4B2ED6B82E3926967B1 +Test: Encrypt +Comment: Set 3, vector 106 +Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Ciphertext: B447F4BEBA7D88A5C62E5F9C316A4523 +Test: Encrypt +Comment: Set 3, vector 107 +Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Ciphertext: DEDF599C54D0009795303013CD933B49 +Test: Encrypt +Comment: Set 3, vector 108 +Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Ciphertext: B06280650C77C83AF3D71874AE00D3DA +Test: Encrypt +Comment: Set 3, vector 109 +Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Ciphertext: 1BB5B9E9C7DC8AD690F5FC217B7B53C1 +Test: Encrypt +Comment: Set 3, vector 110 +Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Ciphertext: FEECFCF0C172C6152F33E4DEE206EBCF +Test: Encrypt +Comment: Set 3, vector 111 +Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Ciphertext: FA4C7EA42C425F37588CD273320940C9 +Test: Encrypt +Comment: Set 3, vector 112 +Key: 7070707070707070707070707070707070707070707070707070707070707070 +Plaintext: 70707070707070707070707070707070 +Ciphertext: 563AE5884FC374C4E45B96A6431E51E3 +Test: Encrypt +Comment: Set 3, vector 113 +Key: 7171717171717171717171717171717171717171717171717171717171717171 +Plaintext: 71717171717171717171717171717171 +Ciphertext: 0669E609578A33DBE637C5B86C7F425D +Test: Encrypt +Comment: Set 3, vector 114 +Key: 7272727272727272727272727272727272727272727272727272727272727272 +Plaintext: 72727272727272727272727272727272 +Ciphertext: B2AD99D3941924DDD2A73C4725A08EC3 +Test: Encrypt +Comment: Set 3, vector 115 +Key: 7373737373737373737373737373737373737373737373737373737373737373 +Plaintext: 73737373737373737373737373737373 +Ciphertext: 72C8239B5F4E5319EE05B6E39C9BD336 +Test: Encrypt +Comment: Set 3, vector 116 +Key: 7474747474747474747474747474747474747474747474747474747474747474 +Plaintext: 74747474747474747474747474747474 +Ciphertext: BAD014C4B0A5734AA48E7E80A42E80AF +Test: Encrypt +Comment: Set 3, vector 117 +Key: 7575757575757575757575757575757575757575757575757575757575757575 +Plaintext: 75757575757575757575757575757575 +Ciphertext: BBE294CDB3582B3C1F61ACD43A0E5DB5 +Test: Encrypt +Comment: Set 3, vector 118 +Key: 7676767676767676767676767676767676767676767676767676767676767676 +Plaintext: 76767676767676767676767676767676 +Ciphertext: C231DC35D38F5857BD3449D3E0A1EF1F +Test: Encrypt +Comment: Set 3, vector 119 +Key: 7777777777777777777777777777777777777777777777777777777777777777 +Plaintext: 77777777777777777777777777777777 +Ciphertext: B19E0BACBF3EC295AA6F99B0817B99F3 +Test: Encrypt +Comment: Set 3, vector 120 +Key: 7878787878787878787878787878787878787878787878787878787878787878 +Plaintext: 78787878787878787878787878787878 +Ciphertext: 0E81D1133E74F1A9425237377890584C +Test: Encrypt +Comment: Set 3, vector 121 +Key: 7979797979797979797979797979797979797979797979797979797979797979 +Plaintext: 79797979797979797979797979797979 +Ciphertext: E1149AA17A8B6499E0FA5C45F05D6582 +Test: Encrypt +Comment: Set 3, vector 122 +Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Ciphertext: D9208954D8D28335E6F45FFB9D1B92D4 +Test: Encrypt +Comment: Set 3, vector 123 +Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Ciphertext: DFABDB0594208A2902703E85C4A657FF +Test: Encrypt +Comment: Set 3, vector 124 +Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Ciphertext: E05B6C6E90E852229BF0EFDC4FEB851E +Test: Encrypt +Comment: Set 3, vector 125 +Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Ciphertext: 6834CCFDC940452CF40A0866009E58CC +Test: Encrypt +Comment: Set 3, vector 126 +Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Ciphertext: 91449066A1966246636D9085E02002B0 +Test: Encrypt +Comment: Set 3, vector 127 +Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Ciphertext: 235C2D836B2025CCCDAE4B26264132E2 +Test: Encrypt +Comment: Set 3, vector 128 +Key: 8080808080808080808080808080808080808080808080808080808080808080 +Plaintext: 80808080808080808080808080808080 +Ciphertext: 0C765AA494E048FC8BB23139F2124CB6 +Test: Encrypt +Comment: Set 3, vector 129 +Key: 8181818181818181818181818181818181818181818181818181818181818181 +Plaintext: 81818181818181818181818181818181 +Ciphertext: ED970D660C84642D0EAFF188F55CC33C +Test: Encrypt +Comment: Set 3, vector 130 +Key: 8282828282828282828282828282828282828282828282828282828282828282 +Plaintext: 82828282828282828282828282828282 +Ciphertext: E124EB4A8BE05CA633238DD69E81E057 +Test: Encrypt +Comment: Set 3, vector 131 +Key: 8383838383838383838383838383838383838383838383838383838383838383 +Plaintext: 83838383838383838383838383838383 +Ciphertext: 4653FBDD6CA7C13CE2DF31B1279B3D5A +Test: Encrypt +Comment: Set 3, vector 132 +Key: 8484848484848484848484848484848484848484848484848484848484848484 +Plaintext: 84848484848484848484848484848484 +Ciphertext: 2D4D87CFB763C3974CEBF6AE1C6269D4 +Test: Encrypt +Comment: Set 3, vector 133 +Key: 8585858585858585858585858585858585858585858585858585858585858585 +Plaintext: 85858585858585858585858585858585 +Ciphertext: F153B13F57F1AE16186EF3B1E98549B8 +Test: Encrypt +Comment: Set 3, vector 134 +Key: 8686868686868686868686868686868686868686868686868686868686868686 +Plaintext: 86868686868686868686868686868686 +Ciphertext: 5451DB2B141B894B4892C7F12BE3F389 +Test: Encrypt +Comment: Set 3, vector 135 +Key: 8787878787878787878787878787878787878787878787878787878787878787 +Plaintext: 87878787878787878787878787878787 +Ciphertext: 61B2185653CFF14EE873DBD3CB663E79 +Test: Encrypt +Comment: Set 3, vector 136 +Key: 8888888888888888888888888888888888888888888888888888888888888888 +Plaintext: 88888888888888888888888888888888 +Ciphertext: C17ACB243808B86349D4176EECF602DF +Test: Encrypt +Comment: Set 3, vector 137 +Key: 8989898989898989898989898989898989898989898989898989898989898989 +Plaintext: 89898989898989898989898989898989 +Ciphertext: 6FCE3ED2207D58A5976FE8B20B247275 +Test: Encrypt +Comment: Set 3, vector 138 +Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Ciphertext: 403F73CC70C7F9A5E96CD77D61140961 +Test: Encrypt +Comment: Set 3, vector 139 +Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Ciphertext: DE2B34DECB33550C97D6C074032F3333 +Test: Encrypt +Comment: Set 3, vector 140 +Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Ciphertext: FB395AE4F537F8FB7C98BAD54BDB86A0 +Test: Encrypt +Comment: Set 3, vector 141 +Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Ciphertext: 258E83BB639D0BEDE648F3AF96CC8E75 +Test: Encrypt +Comment: Set 3, vector 142 +Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Ciphertext: A1B5E73720E43FA0871EAAE245B55A0E +Test: Encrypt +Comment: Set 3, vector 143 +Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Ciphertext: 774A9ABE1FAB9E3B85A91C0F86758B0E +Test: Encrypt +Comment: Set 3, vector 144 +Key: 9090909090909090909090909090909090909090909090909090909090909090 +Plaintext: 90909090909090909090909090909090 +Ciphertext: 0A6EC1CF2056076933259AE6A337B185 +Test: Encrypt +Comment: Set 3, vector 145 +Key: 9191919191919191919191919191919191919191919191919191919191919191 +Plaintext: 91919191919191919191919191919191 +Ciphertext: C96729F87D62104F941DC21448756F95 +Test: Encrypt +Comment: Set 3, vector 146 +Key: 9292929292929292929292929292929292929292929292929292929292929292 +Plaintext: 92929292929292929292929292929292 +Ciphertext: 1CB85A610C2250A78143A31BB1C19094 +Test: Encrypt +Comment: Set 3, vector 147 +Key: 9393939393939393939393939393939393939393939393939393939393939393 +Plaintext: 93939393939393939393939393939393 +Ciphertext: 16194ABEDEA340C6D57E4C4F50640FBE +Test: Encrypt +Comment: Set 3, vector 148 +Key: 9494949494949494949494949494949494949494949494949494949494949494 +Plaintext: 94949494949494949494949494949494 +Ciphertext: 379A5A54C198FB03178EE841D67F3502 +Test: Encrypt +Comment: Set 3, vector 149 +Key: 9595959595959595959595959595959595959595959595959595959595959595 +Plaintext: 95959595959595959595959595959595 +Ciphertext: A25119AD8A0F6654ECDB2696CF4F8225 +Test: Encrypt +Comment: Set 3, vector 150 +Key: 9696969696969696969696969696969696969696969696969696969696969696 +Plaintext: 96969696969696969696969696969696 +Ciphertext: 264B7FAAD26DEC203D0DE29CE4F0F45B +Test: Encrypt +Comment: Set 3, vector 151 +Key: 9797979797979797979797979797979797979797979797979797979797979797 +Plaintext: 97979797979797979797979797979797 +Ciphertext: 2EBD2A2CD16284D206D81ACF18122E2E +Test: Encrypt +Comment: Set 3, vector 152 +Key: 9898989898989898989898989898989898989898989898989898989898989898 +Plaintext: 98989898989898989898989898989898 +Ciphertext: 25FB2B75B6915C0543412DF9EBD20FC3 +Test: Encrypt +Comment: Set 3, vector 153 +Key: 9999999999999999999999999999999999999999999999999999999999999999 +Plaintext: 99999999999999999999999999999999 +Ciphertext: 21B89B53845A828E0A14F4AE45940284 +Test: Encrypt +Comment: Set 3, vector 154 +Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Ciphertext: 4CE809A241E8E59E231F2D00BE0EA285 +Test: Encrypt +Comment: Set 3, vector 155 +Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Ciphertext: F914E06D9F7889DC71974DFF104F94D4 +Test: Encrypt +Comment: Set 3, vector 156 +Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Ciphertext: AF08BADB48FF961FD5EB663FA3766FC6 +Test: Encrypt +Comment: Set 3, vector 157 +Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Ciphertext: 05DDDE95AE659D6BBBD2B4E394399B53 +Test: Encrypt +Comment: Set 3, vector 158 +Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Ciphertext: 25E6FE1C89F811D827BDF8D4E977071C +Test: Encrypt +Comment: Set 3, vector 159 +Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Ciphertext: 3D00A9143A1829D05F787A904C48C75B +Test: Encrypt +Comment: Set 3, vector 160 +Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Ciphertext: 391DF944B0E0BCB84483AF5C4F34D754 +Test: Encrypt +Comment: Set 3, vector 161 +Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Ciphertext: BB2D2E556210A7C0EBA3165F63A74967 +Test: Encrypt +Comment: Set 3, vector 162 +Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Ciphertext: A1B0BB24291B259AC4A1CDE9A3B817C9 +Test: Encrypt +Comment: Set 3, vector 163 +Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Ciphertext: 6F798763B6ED7F8BB234D2CA78D026DC +Test: Encrypt +Comment: Set 3, vector 164 +Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Ciphertext: 038443760056AB3D23BC70ECE6FB4397 +Test: Encrypt +Comment: Set 3, vector 165 +Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Ciphertext: C75ECE40A7AE9BB38F604615C873EF02 +Test: Encrypt +Comment: Set 3, vector 166 +Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Ciphertext: 2D308C2078842EDBBB35ABCA3F41E467 +Test: Encrypt +Comment: Set 3, vector 167 +Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Ciphertext: 393C0E3350B3219DD8FD851C48E28C63 +Test: Encrypt +Comment: Set 3, vector 168 +Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Ciphertext: 964BD4A28DB1434570E27FB3AD880398 +Test: Encrypt +Comment: Set 3, vector 169 +Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Ciphertext: B668D17C027B550C0C22BDE151EB6EB1 +Test: Encrypt +Comment: Set 3, vector 170 +Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Ciphertext: E14186F8205957B243CE522C16453621 +Test: Encrypt +Comment: Set 3, vector 171 +Key: ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB +Plaintext: ABABABABABABABABABABABABABABABAB +Ciphertext: 0E352BEB6B6BCAFDAE61BBE86F8F1D0E +Test: Encrypt +Comment: Set 3, vector 172 +Key: ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC +Plaintext: ACACACACACACACACACACACACACACACAC +Ciphertext: 4BCF038D9458EAAA3D279CCAC3F5D693 +Test: Encrypt +Comment: Set 3, vector 173 +Key: ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD +Plaintext: ADADADADADADADADADADADADADADADAD +Ciphertext: D5EF17646A481C3B79AAB3C08B4F1611 +Test: Encrypt +Comment: Set 3, vector 174 +Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Ciphertext: 37642DA589775C2FFA40A7274E9D56E2 +Test: Encrypt +Comment: Set 3, vector 175 +Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Ciphertext: F829FA6B756F1B1D16B49CB7C8AFFA22 +Test: Encrypt +Comment: Set 3, vector 176 +Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Ciphertext: 6FE1450D48D611031E81C70478DB5326 +Test: Encrypt +Comment: Set 3, vector 177 +Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Ciphertext: 68C5ECE7F525F69DABF63288533C5C60 +Test: Encrypt +Comment: Set 3, vector 178 +Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Ciphertext: 5DF627500627E59A5BAB5D30B6C93219 +Test: Encrypt +Comment: Set 3, vector 179 +Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Ciphertext: AD3A4AC8F666C0FCA5D7995783D0986D +Test: Encrypt +Comment: Set 3, vector 180 +Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Ciphertext: A3AEE54D09357B187622109296534F88 +Test: Encrypt +Comment: Set 3, vector 181 +Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Ciphertext: 7D1D9A73DB386A717862C4F5089970E1 +Test: Encrypt +Comment: Set 3, vector 182 +Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Ciphertext: 916347935FBD0D868A0127D602B91BD5 +Test: Encrypt +Comment: Set 3, vector 183 +Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Ciphertext: 4F167893651993D9150ED9E0B780BF82 +Test: Encrypt +Comment: Set 3, vector 184 +Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Ciphertext: 488352470ACF9361F22FAC1B3ED67003 +Test: Encrypt +Comment: Set 3, vector 185 +Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Ciphertext: 4BBD307FCDE0F89C9A663A0F9C9358C5 +Test: Encrypt +Comment: Set 3, vector 186 +Key: BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA +Plaintext: BABABABABABABABABABABABABABABABA +Ciphertext: E402E706D262078113D6626E7071589E +Test: Encrypt +Comment: Set 3, vector 187 +Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Ciphertext: 422D6FA4519F2E72420685CD4ED2CC8E +Test: Encrypt +Comment: Set 3, vector 188 +Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Ciphertext: 6D14CC5F618DF7E0B2210F6C5DD62C92 +Test: Encrypt +Comment: Set 3, vector 189 +Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Ciphertext: 5CC4A5E81F7D7EC528C150437AC2B027 +Test: Encrypt +Comment: Set 3, vector 190 +Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Ciphertext: B3BE0F996494323504946446EDE489FC +Test: Encrypt +Comment: Set 3, vector 191 +Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Ciphertext: ABC7DB10FE04BEE94F5887E539C1D235 +Test: Encrypt +Comment: Set 3, vector 192 +Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Ciphertext: B18BE6FB1D04E76F21C0678A4333D255 +Test: Encrypt +Comment: Set 3, vector 193 +Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Ciphertext: FC5802BAFEDC03088BBA0A5F22402968 +Test: Encrypt +Comment: Set 3, vector 194 +Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Ciphertext: 8EA96801643AE7BF649EAC22812214D5 +Test: Encrypt +Comment: Set 3, vector 195 +Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Ciphertext: F7683FCDDC2BB0BCFD1350F8E3D76602 +Test: Encrypt +Comment: Set 3, vector 196 +Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Ciphertext: 08D0345431AE120CAD6C6D4275E00CA8 +Test: Encrypt +Comment: Set 3, vector 197 +Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Ciphertext: 7CD50A623DA79EC84D61CD7FBDBA4153 +Test: Encrypt +Comment: Set 3, vector 198 +Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Ciphertext: 42ACA2B048E5C58D8F004F0E8A2C6DEF +Test: Encrypt +Comment: Set 3, vector 199 +Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Ciphertext: E03AD353225F76121D130740C75B839B +Test: Encrypt +Comment: Set 3, vector 200 +Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Ciphertext: 26807D0A6D6330A77804B4B1AE84432B +Test: Encrypt +Comment: Set 3, vector 201 +Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Ciphertext: 864CE880AE89660474F64B93AF4CE043 +Test: Encrypt +Comment: Set 3, vector 202 +Key: CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA +Plaintext: CACACACACACACACACACACACACACACACA +Ciphertext: 82EAD2C033986CAC1F4C3EEEEA1D1892 +Test: Encrypt +Comment: Set 3, vector 203 +Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Ciphertext: 53F1A5C39DD062DF8D133B3A0FB3DA02 +Test: Encrypt +Comment: Set 3, vector 204 +Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Ciphertext: E913208594B288125EEAE0EFEC764D39 +Test: Encrypt +Comment: Set 3, vector 205 +Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Ciphertext: 7DAE4BD638A36A794A73E9B945BEF4D4 +Test: Encrypt +Comment: Set 3, vector 206 +Key: CECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECE +Plaintext: CECECECECECECECECECECECECECECECE +Ciphertext: 04E8155E3E81C261D3A9D4A800182A62 +Test: Encrypt +Comment: Set 3, vector 207 +Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Ciphertext: F466172A8C4C7854F59388474098F441 +Test: Encrypt +Comment: Set 3, vector 208 +Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Ciphertext: E95DBB0B366E77D7BC1BF206B95DAEBA +Test: Encrypt +Comment: Set 3, vector 209 +Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Ciphertext: 76490E6DD8380855E26BCACF8746978F +Test: Encrypt +Comment: Set 3, vector 210 +Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Ciphertext: 3C3B73C8FBDA8CAE5E0D7D0070735DA1 +Test: Encrypt +Comment: Set 3, vector 211 +Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Ciphertext: B039EBC9C48828C3913A3BC346CAEAE3 +Test: Encrypt +Comment: Set 3, vector 212 +Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Ciphertext: 0AFCC6A58BD3ADB2C0B2A1586C9FA8DE +Test: Encrypt +Comment: Set 3, vector 213 +Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Ciphertext: C2187D0E74CE2307BC4DF249EA6E57F1 +Test: Encrypt +Comment: Set 3, vector 214 +Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Ciphertext: F3F4AEA2492106A45C12D0029F58ACE1 +Test: Encrypt +Comment: Set 3, vector 215 +Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Ciphertext: 3FFADF96B37B67D62D71387C52C41AE9 +Test: Encrypt +Comment: Set 3, vector 216 +Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Ciphertext: 4C1644AD69F7D0D3A1E2B4B0E7F0A592 +Test: Encrypt +Comment: Set 3, vector 217 +Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Ciphertext: 68FD6F6592AE5BD9245FA959FE1CA849 +Test: Encrypt +Comment: Set 3, vector 218 +Key: DADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADA +Plaintext: DADADADADADADADADADADADADADADADA +Ciphertext: 7AB97B70C2CCC7D0D1AA7A6D8B7C48CA +Test: Encrypt +Comment: Set 3, vector 219 +Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Ciphertext: 961BF9E037E303B9B494C2EE063FC4CC +Test: Encrypt +Comment: Set 3, vector 220 +Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Ciphertext: 0FBF042B227603DB4A1CC8EE62E93DF3 +Test: Encrypt +Comment: Set 3, vector 221 +Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Ciphertext: 71360ED44C9FAF8F1139D31252A35F49 +Test: Encrypt +Comment: Set 3, vector 222 +Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Ciphertext: 5E806BD29351AE456549E73B8DDC0026 +Test: Encrypt +Comment: Set 3, vector 223 +Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Ciphertext: C7908A288B86C1C4FCE5A8A59457EFD3 +Test: Encrypt +Comment: Set 3, vector 224 +Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Ciphertext: AAC45B53F6292082B93F949BD77E5776 +Test: Encrypt +Comment: Set 3, vector 225 +Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Ciphertext: 231150ED4D85B4217B3EFC3E71A522C6 +Test: Encrypt +Comment: Set 3, vector 226 +Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Ciphertext: 639D9C5EEC8D9569C6DF24630CA8257D +Test: Encrypt +Comment: Set 3, vector 227 +Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Ciphertext: 0E7F8C538946D87A01AD49A8CC981B58 +Test: Encrypt +Comment: Set 3, vector 228 +Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Ciphertext: 09A293907E499502D78569230D3F1A97 +Test: Encrypt +Comment: Set 3, vector 229 +Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Ciphertext: ACF67CC086E386DA064EDBF97F7E889A +Test: Encrypt +Comment: Set 3, vector 230 +Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Ciphertext: E7C44DB1A9FCAC410253A7E2674C54F6 +Test: Encrypt +Comment: Set 3, vector 231 +Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Ciphertext: B99BA33ECB86DA790FF0CC4F0D41A065 +Test: Encrypt +Comment: Set 3, vector 232 +Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Ciphertext: 73405114FDBDB81B1A54C4EFED1BB3FE +Test: Encrypt +Comment: Set 3, vector 233 +Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Ciphertext: 80152E139834B3CC01EBF7E6417C5537 +Test: Encrypt +Comment: Set 3, vector 234 +Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Ciphertext: 05CE579D4804FF3C7874571730D81CEC +Test: Encrypt +Comment: Set 3, vector 235 +Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Ciphertext: F984801E7A806A130325E152DF60012E +Test: Encrypt +Comment: Set 3, vector 236 +Key: ECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECEC +Plaintext: ECECECECECECECECECECECECECECECEC +Ciphertext: 92CBB121474A307505425B4DD1B7F803 +Test: Encrypt +Comment: Set 3, vector 237 +Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Ciphertext: 2DEB2F282D60EFCDB300EADB15C798D8 +Test: Encrypt +Comment: Set 3, vector 238 +Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Ciphertext: 0F4D7D59B535E29D315D2A5C7BFE4973 +Test: Encrypt +Comment: Set 3, vector 239 +Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Ciphertext: 61E391F7C29B5AD705121CF9559E5C04 +Test: Encrypt +Comment: Set 3, vector 240 +Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Ciphertext: 65BCBE179D19A5BCF12D141A21E0F7A8 +Test: Encrypt +Comment: Set 3, vector 241 +Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Ciphertext: FDB75C659B72AE81E51204CFCB86E631 +Test: Encrypt +Comment: Set 3, vector 242 +Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Ciphertext: 5643ED3A3679B9E33E21CD0F95580877 +Test: Encrypt +Comment: Set 3, vector 243 +Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Ciphertext: 618EFEB4C6E4270B81FF7DE786E68420 +Test: Encrypt +Comment: Set 3, vector 244 +Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Ciphertext: 75A2A9CC91F006059CA873E5D73C2CCC +Test: Encrypt +Comment: Set 3, vector 245 +Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Ciphertext: B55840B5001D1875C29A56EDFDE10E55 +Test: Encrypt +Comment: Set 3, vector 246 +Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Ciphertext: 6DD9BDEA7EC0E622DE8B83460BDEA719 +Test: Encrypt +Comment: Set 3, vector 247 +Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Ciphertext: D164075BD4CDC95288D896C7CC98285D +Test: Encrypt +Comment: Set 3, vector 248 +Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Ciphertext: 8420071C55241802D88FB7AF17EBE43F +Test: Encrypt +Comment: Set 3, vector 249 +Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Ciphertext: 03D1D5646E4B2B8A924AB242E485C5D1 +Test: Encrypt +Comment: Set 3, vector 250 +Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Ciphertext: 29106DFB63F4CD6EF5D82CF07C0DBB3A +Test: Encrypt +Comment: Set 3, vector 251 +Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Ciphertext: E9DC1CDD5011E00E0C5699201E1EA002 +Test: Encrypt +Comment: Set 3, vector 252 +Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Ciphertext: 8006C8BD5B210F2FC5B3538F66A6BE0B +Test: Encrypt +Comment: Set 3, vector 253 +Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Ciphertext: 2C6386229480E806D0CD21CDA0EA6B53 +Test: Encrypt +Comment: Set 3, vector 254 +Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Ciphertext: ACDBB0F5A00E3CF63A89D9C09B44A058 +Test: Encrypt +Comment: Set 3, vector 255 +Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Ciphertext: 4F05F28CA23EEAE205B67B1C95CD5280 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/ccm.txt b/external/crypto++-5.6.3/TestVectors/ccm.txt new file mode 100644 index 000000000..165350b95 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/ccm.txt @@ -0,0 +1,240 @@ +AlgorithmType: AuthenticatedSymmetricCipher +Name: AES/CCM +Source: aes-modes-src-07-10-08/Testvals/ccm.1, Basic Tests for CCM (compiled by B. R. Gladman) +Key: 404142434445464748494a4b4c4d4e4f +IV: 10111213141516 +Header: 0001020304050607 +Plaintext: 20212223 +Ciphertext: 7162015b +MAC: 4dac255d +Test: Encrypt +Key: 404142434445464748494a4b4c4d4e4f +IV: 1011121314151617 +Header: 000102030405060708090a0b0c0d0e0f +Plaintext: 202122232425262728292a2b2c2d2e2f +Ciphertext: d2a1f0e051ea5f62081a7792073d593d +MAC: 1fc64fbfaccd +Test: Encrypt +Key: 404142434445464748494a4b4c4d4e4f +IV: 101112131415161718191a1b +Header: 000102030405060708090a0b0c0d0e0f10111213 +Plaintext: 202122232425262728292a2b2c2d2e2f3031323334353637 +Ciphertext: e3b201a9f5b71a7a9b1ceaeccd97e70b6176aad9a4428aa5 +MAC: 484392fbc1b09951 +Test: Encrypt +Key: 404142434445464748494a4b4c4d4e4f +IV: 101112131415161718191a1b1c +Header: r256 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f +Ciphertext: 69915dad1e84c6376a68c2967e4dab615ae0fd1faec44cc484828529463ccf72 +MAC: b4ac6bec93e8598e7f0dadbcea5b +Test: Encrypt +Key: c97c1f67ce371185514a8a19f2bdd52f +IV: 005030f1844408b5039776e70c +Header: 08400fd2e128a57c5030f1844408abaea5b8fcba0000 +Plaintext: f8ba1a55d02f85ae967bb62fb6cda8eb7e78a050 +Ciphertext: f3d0a2fe9a3dbf2342a643e43246e80c3c04d019 +MAC: 7845ce0b16f97623 +Test: Encrypt +Key: 8f7a053fa577a5597529272097a603d5 +IV: 00eec1762c88de31f3cbba97ea +Header: 08c0ea100c846850eec1762c88deaf2ee9f46a070000 +Plaintext: 83a0634b5ed7627eb9df225e05740342de194117 +Ciphertext: 814b6965d05bf2b2ed38d4beb069fe82714a610b +MAC: 542fbf8da06aa4ae +Test: Encrypt +Key: 40cfb7a62e88013bd6d3affcc191041e +IV: 00b6a88adf36912fdca0f3a5ae +Header: 88c0d9577df763c8b6a88adf3691dc4a8bca94dd00000000 +Plaintext: 2c1bd036831c95496c5f4dbf3d559e72de802a18 +Ciphertext: 89d8580340b626a0b6d4d013bf18f291b89646c8 +MAC: fd1f1f61a9fb4bb3 +Test: Encrypt +Key: 8c89a2ebc96c7602707fcf24b32d3833 +IV: 078ef822734701f670a55a0fe3 +Header: 88c2712a9ddf11db8ef82273470159140dd646a200000700 +Plaintext: 4fad2b1c290fa5ebd872fbc3f3a074898f8b2fbb +Ciphertext: 9d59b15f371448c230f4d739052e13ab3b1a7b10 +MAC: 31fc88004f35ee3d +Test: Encrypt +Key: a574d5143bb25efddeff30122fdfd066 +IV: 0bf351946bc96ba7ffe03c0e37 +Header: 88c245dec69a7480f351946bc96be276fbe6c12700000b00 +Plaintext: 28969b954f263a8018a9ef70a8b051462481922e +Ciphertext: eb4ae4956a801da9624b7e0c18b23e615ec03af6 +MAC: ce0c3be197d305eb +Test: Encrypt +Key: f71eea4e1f58804b9717230ad0614641 +IV: 0dbff943b9f9a66b81eca48989 +Header: 88425af28430fdabbff943b9f9a6ab1d98c7fe7300000d00 +Plaintext: abfda22d3a0bfc9cc1fc079363c2fca143e6eb1d +Ciphertext: 9a709b60a39d40b1dfb612e18b5f114badb6cc86 +MAC: 309a8d5c466bbb71 +Test: Encrypt +Key: 1bdb34980e038124a1db1a892bec366a +IV: 00efec952016915eec4073e723 +Header: 08419b50f4fd56f6efec9520169183570c4ccdee0000 +Plaintext: 98beca86f4b38da20cfdf24724c58eb835665339 +Ciphertext: 12c537ebf3ab584ef1fef9a1f3547a8c13b3225a +MAC: 2d0957ecfabe95b9 +Test: Encrypt +Key: 6eac1bf54bd54edb2321754303024c71 +IV: 0aca3f3aae60c4cefd996eccdd +Header: 88c1552d5f72bb70ca3f3aae60c48ba9b5f82c2f00000a00 +Plaintext: 57cb5c0e5fcd885e9a4239e9b9cad60d64375979 +Ciphertext: 4bf281ef8ec7739f91591b97a87dc14b3fa17462 +MAC: 6dba8ef7f08087dd +Test: Encrypt +Key: 494b501e194675971a48d08c5bc353cb +IV: 0aa4ad6d319985ba82e93437b3 +Header: 88c19afb798b8a4ba4ad6d319985bc429e8f0afa00000a00 +Plaintext: 25a98f9c1bd9c93cf383ab9d98152d76cb4a32c6 +Ciphertext: 561a0d068eac2eadb0c57fe2d0a6cc7398b6ddbf +MAC: cfe438cbea61fa9a +Test: Encrypt +Key: 489e49bc3cfe3fce3895820e872ee1a3 +IV: 0053f869fe279acf1d3e75fea9 +Header: 084340ec29fa759b53f869fe279af0f9f8a65416000052bfd2703d24 +Plaintext: 7f91f2472d7a121c9cdd4b6c9080675a1020aa00 +Ciphertext: 25df5173835e4fba23bc05a253885ebed3ac4871 +MAC: c868a725552c5565 +Test: Encrypt +Key: 02be5c4545672a07e4e314d70f1f9e85 +IV: 0d347ceb9aabffd2d6596e55d4 +Header: 88c3298c0baa9190347ceb9aabffd83d4886e5c20000e29d524ae1960d00 +Plaintext: f9a812e4a28af7f3714d4bf6622e5932f2184509 +Ciphertext: 6315500f924295cd3eafbdc3e151b1df46465b71 +MAC: 681fdee8513c62dc +Test: Encrypt +Key: 77077ed79453e4a18d60438cc6484d6e +IV: 00d8ac5a7ec44450b01e77fd8e +Header: 0843aa288b8435bcd8ac5a7ec444e8b46250538b0000e81402c2ee11 +Plaintext: 431981a2336d02f8cb8448d5428916be95293537 +Ciphertext: cf71b2ccbd590b20800792f359ed1cfd74d800b4 +MAC: fd0f41f426bb8f30 +Test: Encrypt +Source: aes-modes-src-07-10-08/Testvals/ccm.2, Vectors for IEEE P1619.1 CCM Mode +Header: +Key: 0000000000000000000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: c1944044c8e7aa95d2de9513c7f3dd8c +MAC: 4b0a3e5e51f151eb0ffae7c43d010fdb +Test: Encrypt +Plaintext: +Ciphertext: +Key: 0000000000000000000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +Header: 00000000000000000000000000000000 +MAC: 904704e89fb216443cb9d584911fc3c2 +Test: Encrypt +Key: 0000000000000000000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +Header: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: c1944044c8e7aa95d2de9513c7f3dd8c +MAC: 87314e9c1fa01abe6a6415943dc38521 +Test: Encrypt +Header: +Key: fb7615b23d80891dd470980bc79584c8b2fb64ce60978f4d17fce45a49e830b7 +IV: dbd1a3636024b7b402da7d6f +Plaintext: a845348ec8c5b5f126f50e76fefd1b1e +Ciphertext: cc881261c6a7fa72b96a1739176b277f +MAC: 3472e1145f2c0cbe146349062cf0e423 +Test: Encrypt +Key: 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f +IV: 101112131415161718191a1b +Header: 000102030405060708090a0b0c0d0e0f10111213 +Plaintext: 202122232425262728292a2b2c2d2e2f3031323334353637 +Ciphertext: 04f883aeb3bd0730eaf50bb6de4fa2212034e4e41b0e75e5 +MAC: 9bba3f3a107f3239bd63902923f80371 +Test: Encrypt +Key: 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f +IV: 101112131415161718191a1b +Header: r256 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f +Ciphertext: 04f883aeb3bd0730eaf50bb6de4fa2212034e4e41b0e75e577f6bf2422c0f6d2 +MAC: 3376d2cf256ef613c56454cbb5265834 +Test: Encrypt +Key: 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f +IV: 101112131415161718191a1b +Header: 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f +Plaintext: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f 606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Ciphertext: 24d8a38e939d2710cad52b96fe6f82010014c4c43b2e55c557d69f0402e0d6f2 06c53d6cbd3f1c3c6de5dcdcad9fb74f25741dea741149fe4278a0cc24741e86 58cc0523b8d7838c60fb1de4b7c3941f5b26dea9322aa29656ec37ac18a9b108 a6f38b7917f5a9c398838b22afbd17252e96694a9e6237964a0eae21c0a6e152 15a0e82022926be97268249599e456e05029c3ebc07d78fc5b4a0862e04e68c2 9514c7bdafc4b52e04833bf30622e4eb42504a44a9dcbc774752de7bb82891ad 1eba9dc3281422a8aba8654268d3d9c81705f4c5a531ef856df5609a159af738 eb753423ed2001b8f20c23725f2bef18c409f7e52132341f27cb8f0e79894dd9 +MAC: ebb1fa9d28ccfe21bdfea7e6d91e0bab +Test: Encrypt +Key: fb7615b23d80891dd470980bc79584c8b2fb64ce6097878d17fce45a49e830b7 +IV: dbd1a3636024b7b402da7d6f +Header: 36 +Plaintext: a9 +Ciphertext: 9d +MAC: 3261b1cf931431e99a32806738ecbd2a +Test: Encrypt +Key: f8d476cfd646ea6c2384cb1c27d6195dfef1a9f37b9c8d21a79c21f8cb90d289 +IV: dbd1a3636024b7b402da7d6f +Header: 7bd859a247961a21823b380e9fe8b65082ba61d3 +Plaintext: 90ae61cf7baebd4cade494c54a29ae70269aec71 +Ciphertext: 6c05313e45dc8ec10bea6c670bd94f31569386a6 +MAC: 8f3829e8e76ee23c04f566189e63c686 +Test: Encrypt +Source: RFC 3610 +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 03 02 01 00 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 +Plaintext: 08 09 0A 0B 0C 0D 0E 0F\ + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E +Ciphertext: 58 8C 97 9A 61 C6 63 D2\ + F0 66 D0 C2 C0 F9 89 80 6D 5F 6B 61 DA C3 84 +MAC: 17 E8 D1 2C FD F9 26 E0 +Test: Encrypt +MAC: 17 E8 D1 2C FD F9 26 00 +Test: NotVerify +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 04 03 02 01 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 +Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +Ciphertext: 72 C9 1A 36 E1 35 F8 CF 29 1C A8 94 08 5C 87 E3 CC 15 C4 39 C9 E4 3A 3B +MAC: A0 91 D5 6E 10 40 09 16 +Test: Encrypt +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 05 04 03 02 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 +Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 +Ciphertext: 51 B1 E5 F4 4A 19 7D 1D A4 6B 0F 8E 2D 28 2A E8 71 E8 38 BB 64 DA 85 96 57 +MAC: 4A DA A7 6F BD 9F B0 C5 +Test: Encrypt +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 06 05 04 03 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 08 09 0A 0B +Plaintext: 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E +Ciphertext: A2 8C 68 65 93 9A 9A 79 FA AA 5C 4C 2A 9D 4A 91 CD AC 8C +MAC: 96 C8 61 B9 C9 E6 1E F1 +Test: Encrypt +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 07 06 05 04 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 08 09 0A 0B +Plaintext: 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +Ciphertext: DC F1 FB 7B 5D 9E 23 FB 9D 4E 13 12 53 65 8A D8 6E BD CA 3E +MAC: 51 E8 3F 07 7D 9C 2D 93 +Test: Encrypt +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 08 07 06 05 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 08 09 0A 0B +Plaintext: 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 +Ciphertext: 6F C1 B0 11 F0 06 56 8B 51 71 A4 2D 95 3D 46 9B 25 70 A4 BD 87 +MAC: 40 5A 04 43 AC 91 CB 94 +Test: Encrypt +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 09 08 07 06 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 +Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E +Ciphertext: 01 35 D1 B2 C9 5F 41 D5 D1 D4 FE C1 85 D1 66 B8 09 4E 99 9D FE D9 6C +MAC: 04 8C 56 60 2C 97 AC BB 74 90 +Test: Encrypt +Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +IV: 00 00 00 0A 09 08 07 A0 A1 A2 A3 A4 A5 +Header: 00 01 02 03 04 05 06 07 +Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +Ciphertext: 7B 75 39 9A C0 83 1D D2 F0 BB D7 58 79 A2 FD 8F 6C AE 6B 6C D9 B7 DB 24 +MAC: C1 7B 44 33 F4 34 96 3F 34 B4 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/cmac.txt b/external/crypto++-5.6.3/TestVectors/cmac.txt new file mode 100644 index 000000000..b00ba34e4 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/cmac.txt @@ -0,0 +1,38 @@ +AlgorithmType: MAC +Name: CMAC(AES) +Source: RFC 4493 +Key: 2b7e1516 28aed2a6 abf71588 09cf4f3c +Message: +MAC: bb1d6929 e9593728 7fa37d12 9b756746 +Test: Verify +Message: 6bc1bee2 2e409f96 e93d7e11 7393172a +MAC: 070a16b4 6b4d4144 f79bdd9d d04a287c +Test: Verify +Message: 6bc1bee2 2e409f96 e93d7e11 7393172a ae2d8a57 1e03ac9c 9eb76fac 45af8e51 30c81c46 a35ce411 +MAC: dfa66747 de9ae630 30ca3261 1497c827 +Test: Verify +Message: 6bc1bee2 2e409f96 e93d7e11 7393172a ae2d8a57 1e03ac9c 9eb76fac 45af8e51 30c81c46 a35ce411 e5fbc119 1a0a52ef f69f2445 df4f9b17 ad2b417b e66c3710 +MAC: 51f0bebf 7e3b9d92 fc497417 79363cfe +Test: Verify +MAC: 51f0bebf 7e3b9d92 fc497417 79363cff +Test: NotVerify + +AlgorithmType: MAC +Name: CMAC(DES-EDE3) +Source: http://csrc.nist.gov/groups/STM/cavp/documents/mac/cmactestvectors.zip +Key: f8fba7b9b3e9d68a 2f70bfd304d32a15 9e13453e0d16928a +Message: +MAC: eb61515b +Test: VerifyTruncated +Key: 344a6732dc5e5431 e98a4f7c323dc1c4 6b0275dc150e68e9 +Message: 25db0710fb165d316e7c32dd25648ed0 +MAC: 862f0e2b +Test: VerifyTruncated +Key: 20ae32c49bab3bf8 f86bb66173fb54d5 3e700868c46bc291 +Message: 582bd9c8c36ec815d0a9 +MAC: 0d62f14f +Test: VerifyTruncated +Key: 62232501b9e9c1b5 54209d7c075d2c31 73a2f289a84c49ce +Message: adaf4bfffab79ffb60b94647faac634929c56e694052881881e60b1149b6 +MAC: a05674f2c905d153 +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/dlies.txt b/external/crypto++-5.6.3/TestVectors/dlies.txt new file mode 100644 index 000000000..aa711552c --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/dlies.txt @@ -0,0 +1,542 @@ +AlgorithmType: AsymmetricCipher +Name: DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES) +Source: generated by Wei Dai using Crypto++ 5.1 +Comment: keys are encoded as DSA keys, with OID id-dsa +KeyFormat: DER +Comment: 1024-bit DLIES key +PrivateKey: \ + 308201370201003082011706072a8648ce3804013082010a02818100ba3ed941\ + 10332be99b77a345da72a33146ca960498a6fc2e0e207fdeaadf69c3e5650df7\ + 3255475854900b75af7f6aac021de687a1c166ecb2ab6ec6b9da82ad4fb0f48a\ + 966a2b968406e18ba50947d7ee3bb1f13511cb4dde191f0ade1933d089c5e82a\ + b8d283943d85ef0102e173abf2635aeac2f84cfc9ec6c4e8f3fbc4130281805d\ + 1f6ca0881995f4cdbbd1a2ed395198a3654b024c537e1707103fef556fb4e1f2\ + b286fb992aa3ac2a4805bad7bfb556010ef343d0e0b3765955b7635ced4156a7\ + d87a454b3515cb420370c5d284a3ebf71dd8f89a88e5a6ef0c8f856f0c99e844\ + e2f4155c6941ca1ec2f7808170b9d5f931ad75617c267e4f63627479fde20902\ + 01030417021501fdc788cd93f07dba3af2de42ae5aa3ede219919d +PublicKey: \ + 308201a23082011706072a8648ce3804013082010a02818100ba3ed94110332b\ + e99b77a345da72a33146ca960498a6fc2e0e207fdeaadf69c3e5650df7325547\ + 5854900b75af7f6aac021de687a1c166ecb2ab6ec6b9da82ad4fb0f48a966a2b\ + 968406e18ba50947d7ee3bb1f13511cb4dde191f0ade1933d089c5e82ab8d283\ + 943d85ef0102e173abf2635aeac2f84cfc9ec6c4e8f3fbc4130281805d1f6ca0\ + 881995f4cdbbd1a2ed395198a3654b024c537e1707103fef556fb4e1f2b286fb\ + 992aa3ac2a4805bad7bfb556010ef343d0e0b3765955b7635ced4156a7d87a45\ + 4b3515cb420370c5d284a3ebf71dd8f89a88e5a6ef0c8f856f0c99e844e2f415\ + 5c6941ca1ec2f7808170b9d5f931ad75617c267e4f63627479fde20902010303\ + 81840002818029eaa5b193357c200e0d42f374d4c003c633c77f4778fe40ad0b\ + d035b87ae5da4e74110ec2b15eefe1bd8b9357534c85328382946d314e15b79f\ + 7b854227012dfaac9bd862e73a5630e01327b36319765a3eb1434e108ef6421c\ + 659e3f9223966759611429b3c86ed9937563efbfad8bfedcfa92db3d7d2157fe\ + 2c8a33f08636 +Test: KeyPairValidAndConsistent +Plaintext: 76 +Ciphertext: B11D906CC5A8E71CA8962A8CC0AC4CAFF2DA00DC130C370F42D11FCF5C37DE046EBC07C7D457CA351CE456A043695D14ED055ADAD2B58BE0DF992685EF8B0D21597A43D7B3D9634A077CB70C4590CD73C20FAAACBC5649413EECA0C7B3CBF469E531299398F61496C51FE9FFE48AE9FE6034F104EFC562DE9529C776B86ADD4025AD6B0C3687B012F92C7B9E82F794E4FBE247D644 +Test: DecryptMatch +Plaintext: 89338CE80AFB62E9577A310E40311BB3F77F +Ciphertext: 8A33B0E212DB8155CA796B472F55CD77267C9106229B6055141EA3AAAE42AD27249D90E70F892B0CDC80D29D3D586A5CA6FE67D4BB44C58B03496708F80681125DCEF983B7453B1E4F927438BD2E3E506C1951E9F19BA70F9B687012440CD75C0BB78BDCFAB22AF535D3E2670ABD1F4D44ED95F3360536612B1A7DF35E2A88F66BD6E8C813EB9DC89D93A85C9A0BA13E4862B91171B681E64A0750197C6467B22566BC640E11 +Test: DecryptMatch +Plaintext: 0835455ABD53E6FB11ED9B0C00485D3C6845DB +Ciphertext: A81181517BD270B0D921AF735052898932008DF00D501EDE0D2D564871D61A6A837776E8D7C7F9B0E5F9181C1FC68BC430F30ABB1A64D62B444C0AC5AAE588B4481AEF08B38E466155F10CA04C8202F281186016AE35212A2C7815A22DB2750ABD526D285BDBC598672BFB52E95CE33A0D3E5DCF4CF5F46224CFBB85297F3AB170C8B9478994E32D9A21A452B095D3D902E92C7E444A3307FDD7256FE49341142E5FF7A616475A +Test: DecryptMatch +Plaintext: 1EBED48EC47B6987091C52BC +Ciphertext: 1DF446FF43AAAAAC8E3F7D70C912E2D45AB832BCA3D0FBD17AF864B9EA878C45B9E2902804171A739A0552BB7CE0CD46DC16343714CC9C2E71AE26304885EEEB242665814DD9E33C480ABA214755D5449F16CD8870D1AB3A8E64E45E463AB3F4D3031FA3ECD395B61B372602665FCF218D9C51E8C791FA1E5BCC2916EFBB482E1814632CDF0F1852EE4943D9652DAA4E1F3B22F17F57F51D52A0997BED5B04ED +Test: DecryptMatch +Plaintext: 65D8 +Ciphertext: 4385797FD38AD5DFBB4F613BC87637B0051501E57699A5880E235DB7A6994A04A1613D0C8E07E36AFD08F2E47D018951B22E7625DA647AA1A0791DB3B2FA794610892D9A3D3F173CF95277B4B1EB92579A229510B67E171CB5BBA8B3AA732047BA038816A30124AF1C4C57CA80E93AACCC8EC70BCF7867914E7DE2C403568F9778F8DBEAF08FDB9F48452054C9735DC84F012DF8FE17 +Test: DecryptMatch +Plaintext: F86D8ED91E9934125DA6E9B4E97545C83A +Ciphertext: 13B0AE03AB532D5E31C9384B4E726A9AC73583CFBB0643EC322E3D2D45D9358CAF745B0541C136E8AA2220C42CEC9E1ED174886475538732AA6D6417DA89FA411AEDEADCD9F15D25D27D0AE252F77E888470AE696D5805CE8CCCB40B45D4AA835E97C7BF2CD6A2B4FEC6FCF858606CE4695DCE998C518360068ED028FC882478BF96096D92C166899EB51778BC4B7DA1BA8C4B6CEBA1139F17CEE484EA104A0325420A3D56 +Test: DecryptMatch +Comment: 1025-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b028181015dd79808\ + 07a15e557e3a39466eb2987828c536a871d4fc7f3723d52f8145a0d10d996295\ + 64aca54fd567c0509ef3c428fac68d916551e77a5ca0ed6d9f12cc96262b1f11\ + 49f398ef9f0f17fc0ed92bb917f890d1e6a4f62b91a7978d0aa1bf53b89805c1\ + 06ebebd0924cb99a4168a38dad65238236d4d166d38a3dfd5359ec5f02818100\ + aeebcc0403d0af2abf1d1ca337594c3c14629b5438ea7e3f9b91ea97c0a2d068\ + 86ccb14ab25652a7eab3e0284f79e2147d6346c8b2a8f3bd2e5076b6cf89664b\ + 13158f88a4f9cc77cf878bfe076c95dc8bfc4868f3527b15c8d3cbc68550dfa9\ + dc4c02e08375f5e849265ccd20b451c6d6b291c11b6a68b369c51efea9acf62f\ + 020102041702150f514282f489098f1df0c7be02ccbb3f23bed00376 +PublicKey: \ + 308201a43082011806072a8648ce3804013082010b028181015dd7980807a15e\ + 557e3a39466eb2987828c536a871d4fc7f3723d52f8145a0d10d99629564aca5\ + 4fd567c0509ef3c428fac68d916551e77a5ca0ed6d9f12cc96262b1f1149f398\ + ef9f0f17fc0ed92bb917f890d1e6a4f62b91a7978d0aa1bf53b89805c106ebeb\ + d0924cb99a4168a38dad65238236d4d166d38a3dfd5359ec5f02818100aeebcc\ + 0403d0af2abf1d1ca337594c3c14629b5438ea7e3f9b91ea97c0a2d06886ccb1\ + 4ab25652a7eab3e0284f79e2147d6346c8b2a8f3bd2e5076b6cf89664b13158f\ + 88a4f9cc77cf878bfe076c95dc8bfc4868f3527b15c8d3cbc68550dfa9dc4c02\ + e08375f5e849265ccd20b451c6d6b291c11b6a68b369c51efea9acf62f020102\ + 038185000281810107143658b98a3725010d3631a3f4f7448cb967ac0118e4ca\ + 8fc8871eb4fb872d55c52d93a4f21eed98b6499db74315956a268f38a288958b\ + f7c4d548662c668669d69375e0cb710ff3a1a9f43e49add1f7ae58b836b6444e\ + 419e40474c27066cb03aae8132e65f3fead0109307ab1c7f0254eb14e9d76639\ + 1a66ca1ba442b425 +Test: KeyPairValidAndConsistent +Plaintext: 256F07E0D37D69BE542BD17FA98CE4CFC3DA849B +Ciphertext: 01269CE30DE12430904CEC9D8B91A6D8860B4F8D37FCE7DBDCE8FA18AC521684F4C1CD5C38BF3B42C259033CD36A53F0376A0CDD801979CF1B76ADD72AFDD27830BD85B373C4D451B84926ABA34012EB98331F0B81CCF8E801ACCDEE88A35DF60EFADABA1F395250A15463203FDCCEDAB7DD6CD1271B38A5E0946F8D189B225E8A307D198AC5E4EB33BCF26A02C0C602AA14592AEA01452E4F8AE46E7A032BABD1BA8ACB0919F2EA18 +Test: DecryptMatch +Plaintext: A992 +Ciphertext: 007822B0BDF45CC5B15102B5E21F7656C8896E98FAD6C2AF6CD55D0DB90B7A6B05E36D260C7A5C070526813290BCA722959B9B9BF00041B4B7F3E3EAFA9B5376A1E02944EDA55B99202601AE6D402D56617B56B28BAC1B405016053CDC78AB4D372B0D58E7380D50F1CD0E31B8CB77FD2F6BA3E7A436A5B35552B9974EA5AB30AC0C4989E34F5FD7D272417FF2094B97119BEB2C73C68B +Test: DecryptMatch +Plaintext: 1D20C118C894EFDC67DAC33E56179C5D262C83 +Ciphertext: 001587AFEC265C244875371B680521FF93F0B1196901A7D580785B62A257B1736C86D1D9E59A31E62F53B92B209B45A7952776C6AC839243B0BBF3A059E6CEE99B120BBD45922B4E813DDE0F5793A42B3AF2DDDAA357136A010519D884589A1F9912110020A8C16E9B91C753EB8842B3224FE9C9A22AE2B82251CFF7799E78885B0B67B27DAAC6A7B58013C31115C2B8C0C0176BC2A7B96A299CC75693B4F2138B2B4053CB5320D5 +Test: DecryptMatch +Plaintext: 83BC82A4F7A4DFC96CD7798BAC52254CD6E9 +Ciphertext: 0085E83465997BFED9CAE63B04B0419578D0BD85B1A65285E5537F4367E5E7E11DD8762BD3335916A13B8CF9D5BC651E762458E9879363B06748BEA0CA86D32CBC4F1B0C0BF67E616B872A64F7356241CD052944F6594A570522EF2BCC53D90E3326D2ECFA036C46256D9B678C93BE5877749AF8FF8FEDB6E1E17B67C7B6C6098D0C71D5B2AB503AFD7739ABCC8DE67DAC056AFE99D8A107230BA88C282FB8FD46E9E9E2C6874A +Test: DecryptMatch +Plaintext: 157597899A950A32 +Ciphertext: 013623199FFDD0D4689A4C50A9FEA3C2250D0C73F209F33BF3EF13E6035976D6F3EAFBA3D83A3862E4B6DFC7581EA43B62F49BC85392B7EAB854F92DA8DD5921A6A4C42777E89004EB7E6D479BD028F758171C324168DC0814369C6BCD8471D9620C4E9BED785A220EF9C0DCF1201311A16C51341E0551043C6EAB45E04A81C9280633F58621D8D3492864FFF6A39EDC48450ABFE0C7AABAEB9A86CFFD +Test: DecryptMatch +Plaintext: CDE651 +Ciphertext: 0040308CCDAB105426597D84A64665200A93208713004DB38594C490F7B85F08ADB67BBE47B7FB7BBDA435A6B6A2CA0B4CBE0FDCBD4FF078FD052213CBCAA4580D1C7962A3505DAA9BEA2957718AB36D061E61B9DEB3D7DD726975C6E7FD79AADBF649F5ABE51AC384E967D3CDAFD9EAA18EEB69774961E439F54844FA22DA1B6892E86471DAE6F7E74CACC944123234826621C7634AE34E +Test: DecryptMatch +Comment: 1026-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b028181031e7d8589\ + b9fa11e77204b8c1b27ad66b39863978d26912a65de306dcb32a0c7c96bb431d\ + c4a14204a8f01a65b0fe56a4d016716914c21576f10d63dac5f49287636519ac\ + f9be56c9f58eeb90ba3240d4cce26f647bfd86360cf0f6b8ff609ae2ef736558\ + 155a1498adf4e92dc90f34169123a5fcd8ddfc763c81658a4d08383702818101\ + 8f3ec2c4dcfd08f3b9025c60d93d6b359cc31cbc693489532ef1836e5995063e\ + 4b5da18ee250a10254780d32d87f2b52680b38b48a610abb7886b1ed62fa4943\ + b1b28cd67cdf2b64fac775c85d19206a667137b23dfec31b06787b5c7fb04d71\ + 77b9b2ac0aad0a4c56fa7496e4879a0b4891d2fe6c6efe3b1e40b2c526841c1b\ + 020102041702151fa3003b00efad22ecc26c5115e6d036d13d3b2f7e +PublicKey: \ + 308201a33082011806072a8648ce3804013082010b028181031e7d8589b9fa11\ + e77204b8c1b27ad66b39863978d26912a65de306dcb32a0c7c96bb431dc4a142\ + 04a8f01a65b0fe56a4d016716914c21576f10d63dac5f49287636519acf9be56\ + c9f58eeb90ba3240d4cce26f647bfd86360cf0f6b8ff609ae2ef736558155a14\ + 98adf4e92dc90f34169123a5fcd8ddfc763c81658a4d083837028181018f3ec2\ + c4dcfd08f3b9025c60d93d6b359cc31cbc693489532ef1836e5995063e4b5da1\ + 8ee250a10254780d32d87f2b52680b38b48a610abb7886b1ed62fa4943b1b28c\ + d67cdf2b64fac775c85d19206a667137b23dfec31b06787b5c7fb04d7177b9b2\ + ac0aad0a4c56fa7496e4879a0b4891d2fe6c6efe3b1e40b2c526841c1b020102\ + 038184000281802c6360e6e3eba6da6efb5bce8d07a99e42949b68b3c2900583\ + c2eb34498081c7212d8dc95a631d63edeafc625f8faf063e57b41d7b662ba9c1\ + a99b3f2506fdf5e59116a0e93e7e94aab55691abae75eaac9637a713949360a4\ + 5f6908f23ba5503d4760bcd6f7abceb8351a66bb14fae05f03b1494e7ef4154c\ + 99a9cb6a9bfe12 +Test: KeyPairValidAndConsistent +Plaintext: DEC85711F12C0D1D6C26797E91B0F39B37 +Ciphertext: 0215D75DD99B8A59DEA3FBA9B0F8A621EFFBFD831E9543749B04B495147CE9B56D519EE71BDF56D86FD1D9C1AE8BC1D7F29DC469A05221E4A31C726971731CF627E63FAB269FC92DEDDFF3319819373F299D55F4CABE08DADF29A7C60E9B4E2806899371B93A853F828EC4312D94CFDADFDEF2037D9C1FCE21A3E451006AC542E1BC36D3C33AEAC0D1666C26AA886F4C118836EDCA7C5A428E407C4ACD62A885C03202230FA6 +Test: DecryptMatch +Plaintext: 0E665CD2CF75C2E6E24908448F29E9A198EF +Ciphertext: 00A4583FF3A9451C6F8970E53D95EC74F41F709F5156B4FC9C698B1E43C7B5F3230D5417AED2C7447455009CE8381A30BE400EC15BBB1D7BCB9461E593D416421157541479FE1DCEAAE635728C68C58D260337A25D0CF9FA291D84E9E1DF4FF96822CA1F05CDD247AD14E5AFB231A0AF0F2E79FB9A0528CA2FE9431724C0AC9F0A2ABCED9A20EC1203DE2A835D90EA5FB1447EC722456B6F4C75D0645CEC5BECCE35B79FF3071A +Test: DecryptMatch +Plaintext: BE2A +Ciphertext: 02823CB4ABD598FC5D36300306460886BBECFAE6F56E02708A96EFB27EF7E3D8F08442FC819EAB1DC35CC70A074984A149F209EB285C6064DDDBC7781CEF7358F384D592BFC75D346A6D97D8524CB35060A35E3B3145199F4968677FA22BB468DBFF63E3E366D778B3042D5858699D9FE5D6F53D0CB084E107111B572AE9B933B94FF37F2681DC50CDED2714668375DA90787CF0144F1B +Test: DecryptMatch +Plaintext: 20D57B7E074BFFF8F54AF3E69C9B632253B3B5C0 +Ciphertext: 00D18C24BF39CD527455737B4B214BADDE99B070181C1E4729CC7B6EAC82298417FFAE7BDA1F41A7D74D6969BF9CAF3A7F9EC9397DB75F5E53D0282F793D601A28E8B3CA8730CD9D7A0ABA338E2DB3EB5314321EEBA2F16C8072DA6AD9A887AA5AED0EC5EF3DC7E5726626511F8F23B0BA4D83BA358DF0951B07399C7515349E3DE2938D2AA53AB11A4D1C07213E091CD3FB6453AF7DFB6799D45DA44B060F7BF5ACA5A25B3892BBB6 +Test: DecryptMatch +Plaintext: CC47935F7976 +Ciphertext: 02366250DE032B147BCEABCB576ED39F4993251D25010FAEEB41BDDA4301B890063247EEDC041539488E70B977091BF581033EE6EF75C224C8046EE3E7D2330383A30BA07FF33D10F07FF6E1EE20FA4D112CAB1BF457B50DC301DE5C6DBFACE227903379A41DC4D92517A547968D3F147D6435C3DF6A3D0D13635360716CBAC322EBD295593865C3A117050059FBEC83D112C5C3727377EBA7778A +Test: DecryptMatch +Plaintext: 3A370FAFD82869FEC40117 +Ciphertext: 026AE53843D3EFE36D8E52D9FD55DC6F0A0F51584BF81529914DAB6E380A6C9716828A7254307440B6A0CD16BF0D9D713939AE7F6C4D82D5AA70F33C9531E4071B9CB415C7622A23DBF4C81820BE04272874549F081B57D40B27BC1879BF134A2CF5D15203D326F9F97BCAC8606082A50A755CAE6FE2B72060EB1E0B72EF5AFAE8A823B3F0F91877C931CA64A06F3888DD4E2C823B3FCF529407255BE2AAD36A +Test: DecryptMatch +Comment: 1027-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b028181072c45d24e\ + de76df2a03270413d8ab37645c8d6301ea76bb6cedea97142df7aa422b83043f\ + 8cfd8874dd684f47138433f5832c83c8c811d3c6d477b088006381ffb066402c\ + 951670f1927b1b67883451202f456bdb975d8bb2cde9b43c178ecfe788a0a0ab\ + df2cbfc700fbb97ef71e52221bc054fbd3cf8c04175e4841a45b89cf02818103\ + 9622e9276f3b6f9501938209ec559bb22e46b180f53b5db676f54b8a16fbd521\ + 15c1821fc67ec43a6eb427a389c219fac19641e46408e9e36a3bd8440031c0ff\ + d83320164a8b3878c93d8db3c41a289017a2b5edcbaec5d966f4da1e0bc767f3\ + c4505055ef965fe3807ddcbf7b8f29110de02a7de9e7c6020baf2420d22dc4e7\ + 0201020417021506533f6f0886a8a44137598adb93aeee548c9af303 +PublicKey: \ + 308201a43082011806072a8648ce3804013082010b028181072c45d24ede76df\ + 2a03270413d8ab37645c8d6301ea76bb6cedea97142df7aa422b83043f8cfd88\ + 74dd684f47138433f5832c83c8c811d3c6d477b088006381ffb066402c951670\ + f1927b1b67883451202f456bdb975d8bb2cde9b43c178ecfe788a0a0abdf2cbf\ + c700fbb97ef71e52221bc054fbd3cf8c04175e4841a45b89cf028181039622e9\ + 276f3b6f9501938209ec559bb22e46b180f53b5db676f54b8a16fbd52115c182\ + 1fc67ec43a6eb427a389c219fac19641e46408e9e36a3bd8440031c0ffd83320\ + 164a8b3878c93d8db3c41a289017a2b5edcbaec5d966f4da1e0bc767f3c45050\ + 55ef965fe3807ddcbf7b8f29110de02a7de9e7c6020baf2420d22dc4e7020102\ + 03818500028181056bf5dcced97da0ddd23c1f1294f97431e323f9719fc9bed6\ + 352d08a88ceb13a06b559b8ef7dc04c5a04a761a9631aa1000f32f885fb0de56\ + 505524ae89462079631f438284c8e5225c021d7731087ec0aad11aba9bba95de\ + 03f5c99ac228861a3ee6a7b47617cec687a58255321694b923e63ed247e65ff1\ + 4c279bec5282bc1b +Test: KeyPairValidAndConsistent +Plaintext: D391B4F3B53EB9B035C3AB1E3C6E +Ciphertext: 05D90F9892F6DD3DC3654130CAA312D2287D9E57607C301BE58607BB19FC78D67F2082C907FACA819A0D946AD16B46FE1E7264BE7D25D4EAB4F80D136E89EE7BC53B65CC1692581E3ABFA3C15482A6FEEB607AD1765897E67BCEDAED0E03FDE18E05330A99BEBB8710C77E7735CBB747EB507FE1EC04F239E964B509A4FEE8463478E28BF5338AE016DED9FE6B2DDBD3FDE467C45F0FA619E039FEF085D2F1544EA3CD +Test: DecryptMatch +Plaintext: 28 +Ciphertext: 066BBCB2D9E474A2C6CD514663BDA7AECA1F79136A00C1F9BDBAEDE344872093E67102307C96BF824999D86543121CC3D99B5CC4B511153A42E8A1569D063C27788E105858AF8EEB0766FAD9E0EDEFAEFFC733BE6824644CEE03AEE5FF15860CB3CBF4A46F95988D5E010FB844F944628043C830E575964EC36E2C38326C771085D796F2C22C0969E58665626415463A3CA1F56C357B +Test: DecryptMatch +Plaintext: D2C349F40A24230689EA15736C3AEFB1588A +Ciphertext: 019A66A4ADFED556BBD1E58728A3B7A3631458DCF677BB155DA989827C2240A586783D8C5DB98E266C39FCDF6FB016BBB25D53A6B30F3BC9D1109CB908B54F1932335F3DFC2C80847D94D13C5933953EA1D212107AB42189536171069621403681CAAB2A13EEAEC847193FA6A0234FA8F107E2C1747425584EBB4F4D702E29A3A09580E25B34413208009F9643327A636DF622B7F0267D3169A64646F301C584F64066801383ED +Test: DecryptMatch +Plaintext: 85D75863811C6F574222B577 +Ciphertext: 02C6FFDB38965F3061C736E633B497192862677CB247A37C5FA1FEB4F2C021EA94C65AD9506C73C2E98ADF0F340DAFAD2BF6F6CC906C93655594D093D4B0F6867755013C25ED0AD75DC9A04DD0666E6340BDD6C1E748479F3D64129F76B5BAB37D26319287EC9D65CE9E2243D4CCC7BCEA4065623C4D388A7BD779941EE541DD29E070F7356ED1A1ADAE947D79F8421FA717F933F08CBB8B699B551F1EFF75B8F5 +Test: DecryptMatch +Plaintext: DD07A91D32C26D3258AA4ABBD82E81 +Ciphertext: 05669E0777B003CC2EBE9BF3981160806A8B416A2DEAB4058497C5AF6A5C8F8D1ADF1225CC6FF7D292320E9C98CEDA144862FB4E32EE11AD9CC76A5C85FAE56A2567E6C9D168586F288CF4D525C94FF9F0ED6C3DBD08787768B90F8CD776520EFB920E61FB0E4463BE8D5AAE2683D31F392229A9554E0977BF25BCBBAAC7BB4FCCB009630D0203451A7A2AF847BA60AA0CE8C4D656DBED02353B92025925E1A0A6DF490F +Test: DecryptMatch +Plaintext: 0AA6B9FB846D1230F521F2624127 +Ciphertext: 01A9D56F1547728782D4F80BB0EBC8890BAEFE994900F41D56094F4734ABA2BB371060B2A69C6B7BC8944358519D141FC277E1195B3A78F7068731C3AF3C604A062A0D551397CD804168B7F400F786BC5CC3F912457AEAD56873AEF1A2378F34E953E240C20FFD7DDA229D4C020BDC68684A53C0AB3ACF9B44581353C60CE9854E3451645A604BB7AB3EB44088A07F59CE0FEB6454CC5A83BE5E939B317D4D8537CAFA +Test: DecryptMatch +Comment: 1028-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b0281810cb31a78b6\ + 6dafe2dd020483aec0cad421e4a3df2a81b827009dd74f5ef0468fc508477190\ + f628033471ee2d56f913d45a94a8ad1582b29785a7ead06c88ce73812e653797\ + 921d3c4a8fba91c1423d6609e85625b2f41494546500237151958b13d1cc0f90\ + 586b0233290d052a18c2aa3ec2bdc32adb4676cbeb30309e330b823702818106\ + 598d3c5b36d7f16e810241d760656a10f251ef9540dc13804eeba7af782347e2\ + 8423b8c87b14019a38f716ab7c89ea2d4a54568ac1594bc2d3f56836446739c0\ + 97329bcbc90e9e2547dd48e0a11eb304f42b12d97a0a4a2a328011b8a8cac589\ + e8e607c82c358119948682950c61551f615ee1956da33b65f598184f1985c11b\ + 020102041702151c0cefd22a713385985cacb5fe84cd40e724ce9587 +PublicKey: \ + 308201a43082011806072a8648ce3804013082010b0281810cb31a78b66dafe2\ + dd020483aec0cad421e4a3df2a81b827009dd74f5ef0468fc508477190f62803\ + 3471ee2d56f913d45a94a8ad1582b29785a7ead06c88ce73812e653797921d3c\ + 4a8fba91c1423d6609e85625b2f41494546500237151958b13d1cc0f90586b02\ + 33290d052a18c2aa3ec2bdc32adb4676cbeb30309e330b823702818106598d3c\ + 5b36d7f16e810241d760656a10f251ef9540dc13804eeba7af782347e28423b8\ + c87b14019a38f716ab7c89ea2d4a54568ac1594bc2d3f56836446739c097329b\ + cbc90e9e2547dd48e0a11eb304f42b12d97a0a4a2a328011b8a8cac589e8e607\ + c82c358119948682950c61551f615ee1956da33b65f598184f1985c11b020102\ + 038185000281810aacd80676c540b97f74d2a94c2f389795c9f696d2a1fa934d\ + 20e93d49d0099d9312552e6e310da5d97cef87c9a5a4c47e7acd195293b09adf\ + db8e0cac95139446aba60fd625d17eaa102c7c26568b34891edb38226f949656\ + 44a9d52ff299cd007ab3dbc15779d4388431a66774ffaae5c6be04526b28c620\ + ac97e8618cb09d46 +Test: KeyPairValidAndConsistent +Plaintext: +Ciphertext: 0194C64DEB9CB401573730A29359456F4E9528347ED80F24E5AEC4441E896E38047EF95AAD9AD7A25AED6CC89FD95CAAEF27F3C814C26FE43F6D65288D87E372A204D1A66C3BCF0346CE89E9D2D7646E90BACB9A85022ACFEF8903C72A663BAED9A346E1A6B2B2FCF70E239EE70A34385F8C76CDD121F6B190085BAB3300E6B811906CE38AC740FE88A3DF8DCA1C6DF73A03236D51 +Test: DecryptMatch +Plaintext: 9498EB7300 +Ciphertext: 0A38C373F6A96D87528D2D55F6391A9E801252A65F622F36A130ABD140E1858024E31F247C3BC8C07D9500CBE7A8A3D6C0670AF0FA14D020DC54B201E657C233F8031DF990AE801077D4D3AD9B861F4C32D36FFB9E8BD5E2651169BC4560CC7FD02159929AA50882F8B4C8508BB98F6BE8A6A7C0E21A2A81AF781447ABEC85C170F3F6256C3B6C5E2D3A01BB5EA8B502D37561C06F1DA536BD59 +Test: DecryptMatch +Plaintext: F07FFAC9794BD8D528F750D50C05 +Ciphertext: 03DAF7F6C2BEBF8D0B380EB71BD8BEE9D649AD7647DF6DE4CBCE00D0363E31F11E0DC0331409863E3C069EE3F975E7F623B55D7F4690C7419C5AD97EB52BBC0212D3FF0A83A031591A31481116B2CD232A9C86A20EA40BD13A53BB73E644A6C7DC1E6C767756E7235538E9D5B155B3173416E99F121E96E02034C6DB9129489A050740F603DEFF96EF1D99E7EB4A32083D0D946670B1AEF30E1E38D3F076D6BCB57255 +Test: DecryptMatch +Plaintext: 85916A46E0965C69C4773C7DF9AF +Ciphertext: 053D29F0878C68FF55FFC8E6E0E03044AE23B79588034F0236A49A5B6D00EFE8C564D2D29ACB61FE49C0E984EFC3A48A96EAF22AF3032D8D0FD3B3BB16A0157C161F2B3D3DF802FDD6B61899212F44493383DDDEA8B2463BACD0C5E1F4F9E4063DE5E52032E7DA8B79E04C5F03144CD710ADA74506CEC2D448BEA0F2B59AB63FCC443BBE920748E122DDD6123BDDAE484DBD02088817D999FDF80D5ED4B308AF4C2DCC +Test: DecryptMatch +Plaintext: EB632C72F563174E680961BCF26EC7 +Ciphertext: 0BBE666C02191F668A2DB000646A14385A8E9199BD887913BA587DA4C683535801853186673AD7C43EFA5B65902559BA5345EFA111E0514D461C1B1EFFAE58708EE6C17F1758EBED31F0B3206B0EC1B4BEB2EF911C589E25CDC3B0020C47119B5F33EA2FB7C332CA6B1FDA2F350A4CB0D6844637F2CCA71EFB036C7400957AE093B21BE90E30A8672847C9BA5266EBBF9D62341F67A4D09FFA196A817DD2F5EE1A9654EC +Test: DecryptMatch +Plaintext: 42B5D2DB89374231 +Ciphertext: 0085B6894D887B59393F9D7365411DF239BE1104FD86CC63A52C990A84FC4660FF9B60CF0641E44A8224C169A9FD1B35EAF78008E34F14B5311CB5D725096D9DE92F35BE6E71E3AC3E3B3D68BDD5351A5AF93F0B3BCDB00B9B126D8DA07E5F42107181F9580CCD0D6F086C94177FD48ECFAE3FCF2F26D64940D749E8A964275290A247AF700210500517BEB2175326F4CD3016AB175B352F9BD3289079 +Test: DecryptMatch +Comment: 1029-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b0281811b02fc18f7\ + ba0ae7f84ebcaf319294fa2bad52e47e1926267ad38b2f1b2566145bbc190cb5\ + c39a8d6229eb238d3742bbd234b0f28eac92363a31ac96c5b08eaeb1963de59a\ + 3b2d0295c0266a7da4ca92b64f96c497f262e98df7f20ec55814b8441acfb639\ + 7abf9c4e42ab9bd6dda6ae180b12e12ead68672f9d56b98ee40e2b630281810d\ + 817e0c7bdd0573fc275e5798c94a7d15d6a9723f0c93133d69c5978d92b30a2d\ + de0c865ae1cd46b114f591c69ba15de91a58794756491b1d18d64b62d8475758\ + cb1ef2cd1d96814ae013353ed265495b27cb624bf93174c6fbf90762ac0a5c22\ + 0d67db1cbd5fce272155cdeb6ed3570c0589709756b43397ceab5cc7720715b1\ + 020103041702152c7c60166a1bfebb17831e65b8e1f61f3ef9ed9ff7 +PublicKey: \ + 308201a43082011806072a8648ce3804013082010b0281811b02fc18f7ba0ae7\ + f84ebcaf319294fa2bad52e47e1926267ad38b2f1b2566145bbc190cb5c39a8d\ + 6229eb238d3742bbd234b0f28eac92363a31ac96c5b08eaeb1963de59a3b2d02\ + 95c0266a7da4ca92b64f96c497f262e98df7f20ec55814b8441acfb6397abf9c\ + 4e42ab9bd6dda6ae180b12e12ead68672f9d56b98ee40e2b630281810d817e0c\ + 7bdd0573fc275e5798c94a7d15d6a9723f0c93133d69c5978d92b30a2dde0c86\ + 5ae1cd46b114f591c69ba15de91a58794756491b1d18d64b62d8475758cb1ef2\ + cd1d96814ae013353ed265495b27cb624bf93174c6fbf90762ac0a5c220d67db\ + 1cbd5fce272155cdeb6ed3570c0589709756b43397ceab5cc7720715b1020103\ + 038185000281810e6e9c7b74e33a1f4683ddfa35509c39a75b75c10f438efad0\ + 82caad08a7418990983150a9a5ffe3f8e340443dfbabf82fe060da487f94afdd\ + 1e713d491b983fc4fb69d4405a12e356808c5cf6a7bd397c1a5637ba8e168b7e\ + d3f549a9f39f343e8fe3992706e782a1dde5c5e9e6a950f7d980835c1bc1742d\ + c2840cb2e61086d7 +Test: KeyPairValidAndConsistent +Plaintext: 03C57B87 +Ciphertext: 1440C6776914314A1DA161EAA41D52B283E2C0B487C801CEC33DCDB639F579F69D12FD029C994A311913EB6869C7A5659EE8BD9F5D7225BBB2EB77CF6F3D24A5E9866BD2CC50E593EC5CEBA4A96C59FE8B98B5EE2121E5892F2436F98B5C4E4A12077A1A64F1FCEB783D05453A657BB91909637063813CC00754402DE24F4AD6C0D9D4C15B7F4E485AF3538D391CF5993A59F6D1FE6C76E2A7 +Test: DecryptMatch +Plaintext: C5598C0FE0D90B10E7125079E2EDA32E531C2EBF +Ciphertext: 129FC863B70BB82C1C59EE2DA37FF3909F1DAB4B55D9727EE0CA3311BE5797F93446ACA0409CBFA848A90756D2598B6ECA56F6341C6E9F716A62380CB5D47400CF392A5441DA5AD2C1D066F894942837EA7B6237D7BE2E94FFE0A106148C2B7B9AF624242A945BF3B217D89FDBB070FA5940C1C899AD83AF1F865DEADFF0F4E48A7E00BF7AC5625F6E32F8B01394AE90284AFA061AF6DD61ECA1B8FA77CBC172573A9938332D7AEE41 +Test: DecryptMatch +Plaintext: +Ciphertext: 068117F2BCF29C72CDA3F4560A2165B7DB7C29314EFEC8D110425D5AA02F35C0F9A2304A0554C097944EF3A615BD70F5461E6549C319AC1207B100FEF022410C46284CEA9CA103685A18EC944DEA0BAE8E06D2489A3E2D1D9B255F192677664CA6FF44130C28CDE1FD437E85396503DFF305BA2D64E8BF9C75B00CA1595A1AED2C60865C0DF03F408EF95517E70552B2D5A8C190DC +Test: DecryptMatch +Plaintext: 8DDB5FC737283E5B +Ciphertext: 0B3E0CE51E1D3AE240EB34787DB5D49D6786B3BCC29C37EF8B9155F342C4D226CE1D07F7BAE09DFF7E8CD89915E1312F43540A26F03D918BF56B07E6D07A96870362643092F24FBCC6A2DE62F637B5F5F807E430DAF9B7AFE1890143591BBA035538FB419BE4CBADFCED5EB8BE2471B39CFCFBB2BA854C9E0F52E67524ECB80F9FBB3173D2A18C9F4C43F4E20866428A9256AB8AD199BA0BAD55A18896 +Test: DecryptMatch +Plaintext: +Ciphertext: 197D4DC43B0716191F926DC806A1B707ABD6684735144AFE07E0EAEEDD9BB3C89B9D0076859DACE6FFF9E2685592ECB010909910DCA50D2FB1B15EB9B9CFF4F71250D807EDDC2EFB2033BDFD93FD10E117683E3E4E8A5D3308572D4852954BD51251279A79092E3DCB95F1FCEC8310931933F47998DDB61438478CD80864F08D3370C863BE6E7E1CD22E38BC512D9A160478814057 +Test: DecryptMatch +Plaintext: 53AC983CEE599A17261C53 +Ciphertext: 0E31EAACA9E8A86ACEFD1CB817869F48EAB342EAD0DAFE17B848CA9CB72B92567987B929F655B8D601EB1384BE380C8E4BA8B4E274F724F02FC5C00479C308813A3963E2D8AC88ACE92AEB00AB024A4EC5560857310E03009752B86793B356DA344B4AEF01F3ACCD9CBFBE399D0016260C006FCA5443359EA1E012D43921B8D2B8CFD31B94972ECE9C0031420238C76514635E9B40F17D9AF25A1009DB75E4C0 +Test: DecryptMatch +Comment: 1030-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b02818127b35992d0\ + 8edcc7aaa6ca70365afa8ffacb4a9bef0ea348e27414c2100b81827fbf1abd3f\ + 14150bb5d85ab13b2aca21304365f150511a68c90f4a4eac0bfef0c548e3076b\ + 30a24929c4482f42f2b03ce122b3a251e685a3fe3dbb539932bf8d2b117b1b08\ + dbceb78c84966270657164fe6f20c6d27dca270dd4417f843fdfb23302818113\ + d9acc968476e63d55365381b2d7d47fd65a54df78751a4713a0a610805c0c13f\ + df8d5e9f8a0a85daec2d589d9565109821b2f8a8288d346487a5275605ff7862\ + a47183b598512494e22417a179581e709159d128f342d1ff1edda9cc995fc695\ + 88bd8d846de75bc6424b313832b8b27f379063693ee51386ea20bfc21fefd919\ + 0201030417021513560b35fe90d01a106b1e6ccba4cec953421d48cb +PublicKey: \ + 308201a43082011806072a8648ce3804013082010b02818127b35992d08edcc7\ + aaa6ca70365afa8ffacb4a9bef0ea348e27414c2100b81827fbf1abd3f14150b\ + b5d85ab13b2aca21304365f150511a68c90f4a4eac0bfef0c548e3076b30a249\ + 29c4482f42f2b03ce122b3a251e685a3fe3dbb539932bf8d2b117b1b08dbceb7\ + 8c84966270657164fe6f20c6d27dca270dd4417f843fdfb23302818113d9acc9\ + 68476e63d55365381b2d7d47fd65a54df78751a4713a0a610805c0c13fdf8d5e\ + 9f8a0a85daec2d589d9565109821b2f8a8288d346487a5275605ff7862a47183\ + b598512494e22417a179581e709159d128f342d1ff1edda9cc995fc69588bd8d\ + 846de75bc6424b313832b8b27f379063693ee51386ea20bfc21fefd919020103\ + 0381850002818117f468e3d38f1198556447bc16fb6c6ffe98b31f9042e59602\ + c71286db3e0780601e47372e6eb4a570f2059a7a87ee4471eaf94bcf23e34017\ + 5a377333d39dc64b7eaefcc065bef4a92d0d10acbba71082852c2014d9d3eb2f\ + 8583947c2cbf52865730d2b9511ed8a68367e4d89eca4589b836889cd424485c\ + 9305bc0386b16619 +Test: KeyPairValidAndConsistent +Plaintext: 4424 +Ciphertext: 0C570D0317363DB43DEB295D49A3BC937116F2ECAC9226415952CE634679272B7041A4B806164F12E87A0050AC2D60D393F845965CB3A56FF0CF28D31CFA0285015452C59949E3D96C5C6D1DBE38F6EE98E2C93357E6C036053DF920C7CA5E2EA1617AE44434A347FCE426C55295172ADDE9CAC3AEF2C6D6AB2C8F0FAB1B146FF1A10D5EC2191C99D6418519443EEE2A198BFD159BCC63 +Test: DecryptMatch +Plaintext: 5092C5D9FA398EE31AE27C97 +Ciphertext: 196476CA0E6622569F233780EE0C449C2CAAD3819B348D01B4DE5425EBCDEAEA739C6D9CCACE4DDF06520E83C94D237AFD46A4EFED635112CC78534E2FA6046ED6C06806EA8F4B9F3FC3F87DC55F63B9E14F9ABD82E9CC80A298DB281C9F690391F5B064880CF35C5A0BC7537DE9F65DEB2467FAB5CE8F41529A5B06BFA6B587ED661849BC7388277AE7F7E5EFA3F2526E503ECB106B718275BF32C4F83278CA30 +Test: DecryptMatch +Plaintext: 89BB350DC43CB3 +Ciphertext: 13844D63B45821E8704A9C1F6E9166B5EB7FD98DE5369E5DBB9DECE506EE467294282B5B174EF2F81B6766A3616AC5A974F06D9C47163C69668F4C1C78F8A6716A4EC28A6AE25F615A838B9C747EE857AA2AC92DEDC575AC568A78E8A86EF78D55EDB88707F7B6D558E8A760095BE8BCD066FC57396E67C9D8654245676DAE9FC4BC9D578496CA450B35E179410A5DB443C2026FFF0E5F7E54821E39 +Test: DecryptMatch +Plaintext: +Ciphertext: 040E084ED4A1C135C8867BAFF219A0092855E1E9FC96F38277E16B96986FDEABDC22F3B02CC53B655369DDE3356EA6FE49B77C8EAA49815CD5B1DFDC6E7D0AF6AA985483345BBA8A251F1EC7658DF708C8EED8AB6B953393C03BA2EEDB8B6391D921C9EAD2AA61DBE724B15C9C664EC4EFF83A535E46BF768FD519B043DBF46A36FA03921224281A826F6F43DEA6DF38749D600317 +Test: DecryptMatch +Plaintext: BB296D4FF04AE0171F1F24AE +Ciphertext: 0AA9A85958D9F1BB06E3DB48DACC842534915A7E42715057BD33523EE756F62AD973E37128BB8031358A1DC583F40598B74F079AD667C037D4BE89938233BFE1C167EFE764724F97F2EA42479FB455B1166AAB26A43440867ACE77472CCB13643D5BC9532F68C5368825BF225DF49E2D3BD023447A795AFFE927A796C70E5D6359537A9CE2B4B9323D7FE208540CC32447940ACD91F4718FC7A7CAD45A524B6DA6 +Test: DecryptMatch +Plaintext: 87A2C6B33856C6A096EE +Ciphertext: 12D17080AD0E7FD426E02B6A90736AB4B566F31E937B2D3E642D663D6ABFEB903FC9C4763AE492191E0C15B264CEF321DC8747C590F751A9BA2825D9250F72BA85EEB45B1F1D7B2BA972455DCE7DAE6CBD7B5BFBFB88FCEF52910F9B28D3DCD6BB5D479BBFC73896C3D1C44AB387989DE4D77855F6B8C7A8C12969D51DC6B10BA15C2B19E91A55BD5542853EC6F8F13260E8774C706958B1C9866114FADA1D +Test: DecryptMatch +Comment: 1031-bit DLIES key +PrivateKey: \ + 308201380201003082011806072a8648ce3804013082010b0281814ff13b3664\ + f5c527c36120159d9b9a82054f9ade6866b379e13d03e76cb63b25731132d5f7\ + ec6e95186ed83c793b5d63189dac30c6e6a655605f885fe73d2ae5433c80e660\ + c5d985ad6d12783082861829355c25cd7a7ff84b3033cb7fb530a7baa4000830\ + 2c1eb24b866cf467f570e782bceee66e15585f70b0633965c870530302818127\ + f89d9b327ae293e1b0900acecdcd4102a7cd6f343359bcf09e81f3b65b1d92b9\ + 88996afbf6374a8c376c1e3c9daeb18c4ed6186373532ab02fc42ff39e9572a1\ + 9e40733062ecc2d6b6893c1841430c149aae12e6bd3ffc259819e5bfda9853dd\ + 52000418160f5925c3367a33fab873c15e7773370aac2fb858319cb2e4382981\ + 020103041702150910a291c216ca5f944c5f3eaaa1535c3b8a1f0b15 +PublicKey: \ + 308201a43082011806072a8648ce3804013082010b0281814ff13b3664f5c527\ + c36120159d9b9a82054f9ade6866b379e13d03e76cb63b25731132d5f7ec6e95\ + 186ed83c793b5d63189dac30c6e6a655605f885fe73d2ae5433c80e660c5d985\ + ad6d12783082861829355c25cd7a7ff84b3033cb7fb530a7baa40008302c1eb2\ + 4b866cf467f570e782bceee66e15585f70b0633965c870530302818127f89d9b\ + 327ae293e1b0900acecdcd4102a7cd6f343359bcf09e81f3b65b1d92b988996a\ + fbf6374a8c376c1e3c9daeb18c4ed6186373532ab02fc42ff39e9572a19e4073\ + 3062ecc2d6b6893c1841430c149aae12e6bd3ffc259819e5bfda9853dd520004\ + 18160f5925c3367a33fab873c15e7773370aac2fb858319cb2e4382981020103\ + 038185000281812e9a62ec280cf5ee7d09e5e5675b67a4c325c7565a1129c079\ + 095d0f078e7b8a5b3c947c21c022f01c0b9267a45fdd9f267e63c7f674a02d39\ + 6fc59a960d7991d2e3552d01deb2784f26ec4c9355c0df0497271cb583d157db\ + 90b0634180578ac85005143dda75a33a127df96639e275cee8fe9c02db62d2ed\ + 879f3caae11d6e00 +Test: KeyPairValidAndConsistent +Plaintext: 1FBE21CDBCEBA28625584CB1EA0D9627A919A6CA +Ciphertext: 2CFC251CB2A397880EFD0077D9CEF817A6D69EB6278CD82998C5988DD18D6ED15FC8CAFD1611DE58BB46BA8A87013C7BBD4A8DCFC454F13DB282BBBD4E1594E6AF17AB6219E91D7354EB88515007B58BF0D8FF4BD4C387FF6E02BF81455803E6A936F25245863F1580F00ADFA4BDE052BEC72739B88042CF99480AB6F4489F9C8B9319828A000FDDC4D1A6E49868E3B39DBF7DCDADD9B882B755E330C762FCC023EBBCBD0330D28DB6 +Test: DecryptMatch +Plaintext: DCF33FA5BEDFDD93DA +Ciphertext: 14BA927F10262B134AC43F6787EAEC3546C17EFE3F6D54AD2A245A0EE732B749B7312521372F21716E1DE29AF8FB329C25ADEDE2DADE3A455235DAC6C1F347C2A052893DBA6511C3760384935D68C7808D23CB194E6A19F579782B22C3D8880736BECE89FD75E7E69022E9B2500E5A044105B832C9BFC5F18A807889B401E61A9888276B31FD299D604AEA85091578D41E5B36D66C4510F4B147C5E59615 +Test: DecryptMatch +Plaintext: 217B0E +Ciphertext: 37B50EFF3A3FDA419988CA44CCA3AE95F465A18C89CE2DF025F565DAF0F833E198DAEEB46517FBDE47AA3D5DC5039B873A31D0DEE1EBC63F3E97C0A63CC05A8F877FE70EB7F6198C088FF35C1C369616D3EACB013F295F764146A5AAA2D21CD36B9DA4490CF1B37D379ED7713B955C3B0581650B5C7F4F5B8F45B89B94DC364D3340414B491C29AAF2E197AD6F59B0DD687F2E60F8826169 +Test: DecryptMatch +Plaintext: 36DA002D110CD632A9969DC42409B478A3AD3B +Ciphertext: 37126F749ACDF2B6BF667DE9635CC0BBD61753B30931C847B612936C1AE122D6F0E409B4E9454852540C5FD8DD3DA8BA4026FBE8CC8449CA0071409DB47165907202DC078E5A8F6B0E9C8D3497A2D02F53DC3A47389C1B3778EDDEE980055BC4B7EBAC0B95C0CC4783A4B202CE127FA0D7B65B252492A1847FAA9D1ABE893376917BCD46DB4FFADC06C880AD848683B874F7CDFBF0E4BD87AFC39303C512C44EF58B510702C1129C +Test: DecryptMatch +Plaintext: FAFD +Ciphertext: 0F63F22B7817F2449388E0422C6122200D76BA8D4CEDE63DE950ED26768E6779BA0A238C8C3F2CC5C87C7926F1247A7067E27245423EEEFABCDB606976BA2FD9977320F903733FB57D02620682820B1AEE165604410157C5ECFAB7090EE83638A99E4CA36CA0879D3C14856A3417690A52F14F33CC50FE44503FC47F2D90C096C03F62A85D88891E9568911AF61DF916C3677DCF152FD3 +Test: DecryptMatch +Plaintext: 9E9145E890FEEADC706AE1 +Ciphertext: 0B60A14F132D21E47E2FA20633DE43694EC0394115DB297C1B68D1A7EE7722B6AF5D149A2EF5D0EA05761C0FABCF8C0862AF320E9D273AE743717F78A46F15B640C87F4AD0C25865EA3453B0FB59D997E41A31B6C1669F14639E2F70F7D4324B8729A26C8869D97B432740F7CE28A74EFFC82AD7EF172A02AC678C13235BA2C6EF79143D189838E1F101385BD7098AE3B5B78A80964D5C0A3D7DBA7FD7328BE8 +Test: DecryptMatch +Comment: 1032-bit DLIES key +PrivateKey: \ + 308201390201003082011906072a8648ce3804013082010c02818200b98458f5\ + ada1f23f4ae8a3a519c27fde91efd1f201e386aa6119749aaf6ed389079ae49c\ + c76317f81f14164673e8f0be00edd4db4792d446e7bf84b30200626b442af3f7\ + c9a6ee6fb0f95807e62fa5b2d171a4b326cd60c82b20d63ef00b408ea337f50f\ + a51f07549dc4f9a660842724566b94d6e2a58980d2d20281ce6c327643028181\ + 5cc22c7ad6d0f91fa57451d28ce13fef48f7e8f900f1c355308cba4d57b769c4\ + 83cd724e63b18bfc0f8a0b2339f4785f0076ea6da3c96a2373dfc25981003135\ + a21579fbe4d37737d87cac03f317d2d968b8d2599366b06415906b1f7805a047\ + 519bfa87d28f83aa4ee27cd3304213922b35ca6b7152c4c069690140e736193b\ + 210201030417021534999c0e7b17cc3c110cff71571e8d4708c3122a1a +PublicKey: \ + 308201a53082011906072a8648ce3804013082010c02818200b98458f5ada1f2\ + 3f4ae8a3a519c27fde91efd1f201e386aa6119749aaf6ed389079ae49cc76317\ + f81f14164673e8f0be00edd4db4792d446e7bf84b30200626b442af3f7c9a6ee\ + 6fb0f95807e62fa5b2d171a4b326cd60c82b20d63ef00b408ea337f50fa51f07\ + 549dc4f9a660842724566b94d6e2a58980d2d20281ce6c3276430281815cc22c\ + 7ad6d0f91fa57451d28ce13fef48f7e8f900f1c355308cba4d57b769c483cd72\ + 4e63b18bfc0f8a0b2339f4785f0076ea6da3c96a2373dfc25981003135a21579\ + fbe4d37737d87cac03f317d2d968b8d2599366b06415906b1f7805a047519bfa\ + 87d28f83aa4ee27cd3304213922b35ca6b7152c4c069690140e736193b210201\ + 03038185000281813c42dc88e1e15b9a737bfd64b96a7448983da5242a6cf43e\ + 1cc72e8886db723b681c291f772bfe33de5ba735404581c839341969a691c199\ + 229c2849c1c8c80396837c71d711ce34129d3006aef9d16cac504543c6e570bc\ + 3d730d5cd35d8a375edacf591b2837f9a705d63dd62754365d13c103961161dd\ + 984d89792985ad688f +Test: KeyPairValidAndConsistent +Plaintext: 23 +Ciphertext: 0BE692E3384A784AD01D80A65D22B48449AFC0281B36085B0D8FA03574B4BAD05F754D6FFB8E3F4B4BFE60FC7EA2BC1F11253505C753BEFB1D3BDA0084E6CC1FD82454A601F1C0ADB52B3FFC4895D36542FE0139465B490102C7B6A75C9273B737536DD122CC8C3EA0F32900C82C45B0FEE97D995AC5B4345A8899DD6888D1E814BB5A1141A86E636D31FA05689ABA512DE869D12BB4 +Test: DecryptMatch +Plaintext: 4F571384FD52A9041C8F3094 +Ciphertext: AB7942750662F0FA422F4628B558938545FBF7C749995B4D5B32BBF392292FD1B4EF02E5A2EEF6874BCA9F0D4CBCB92D684CDA821829850BD4CAE110E78E42909CF069B54B4BC7D742E113E57C85BCF54AA5CAE1005516BADA834A857315DD6C3DEF4AEBBBF6CB4AE217107E16E83F884B2933EE618F22C45B78092B2EFF7D5C33DB7D89FED4E134921DFD9DA999FB8AFBFD094D77BD887D2C86AACC401A621905 +Test: DecryptMatch +Plaintext: E421A467654B3B88C93C8E5384FE2B85D4E340 +Ciphertext: 7485B8E5360BC1383FCE1C586E126D5DE89FF1CA7CC8146C37A1E6582A564C4588984915CCE9635EA6ED434C80CAE138FBC1EB15D16B294AC1E59CDE544E4DFBF276D30A7F51461C2B7E7F076222DE6AC534DC47E015BA85062694FD78DC37E9460C10FDAF2C61FC7EE0669E99793A657543B881B50B0D3916E395A959EF55B02DB8E7B4C5B5B653AE2D11CCE639342C8C77C667625116D9E6B6C6AE822CDDF2AA503EC3FAD53D80 +Test: DecryptMatch +Plaintext: 3D6C941B1F03E5C9A4 +Ciphertext: 684AA8D2AD35D2775BC30794A078CFC931096A37D472FE511F72B03B33E87AB1E7B958C3447AF6285AC379379E0D1F1BEC535E4032E186573742A75C1B42BDC52F679DCA13B2B9E67CC73461084DE1777FAAED93C7C1E4A6B19473EDF6A57CD88C076574A356748D501A05AF66A136E908993A0A70538FEB03109C62A41540EB4E166596887B4860E3AB0BF9C1AFD02C67D4BFF28BAECD31D1CEB207A245 +Test: DecryptMatch +Plaintext: +Ciphertext: 111C252A9E64FB777F09AF6AEF9C4210B9644C3A66D5528C631D5348E30B146A6225783DE1FB796DBAB3A901E37818B5AE49BF1F8CC0A6C8909D2DB06D651CB08009A25E13A89653DBBA5959674E37BD72039D4E7BFFB3A2395DF8C36164C3FA71334DBFF2FACA090F1C349BF68443838A0D893B9B498D3B6CC86646F935D5ADED81967A387506688B6478492129534F3A651C9985 +Test: DecryptMatch +Plaintext: DE5F0B92C45A0C1530 +Ciphertext: AE6BAEF52B43EE88AEA7796D667D044887407ED07E7618358243A0108514FE9793EB28EB42B4BA2F28F6687FE7973FB8DBF825541010F1BC1FC7350CBEC0B055C0C71FF2C4D2634582C966C1CFD3449AF8AC956BEC3EE797F7E81E589450EA13C1A8C99116E05E49F4BB87C9B95EFDBEB35B21C36711CEC8A1ECF3E4F194251563F88C056749B835FC19A7CD560FEC785207DD14D43C6104D83BB05F1DA1 +Test: DecryptMatch +Comment: 1536-bit DLIES key +PrivateKey: \ + 308201bb0201003082019706072a8648ce3804013082018a0281c100f9566c8d\ + 687a5ead7c780617d3ed37b4afc46582e9fc0d75ae217fb506f5c2024c2a0e6d\ + 7e042544235b4de63047a33940d772721e895f9d4e92790bef0d3668ec7f6cad\ + e7f9b18049b33efa773c83e97b35ef7ebf18934b48dd4700a48c1f76ffc20684\ + 521bad52834086ccdf1e3d5c9128fef52f6a9444d8e9944d49e5ab411f46b63b\ + 290b7fdc8f48fab24c2059510bb7247e0930d5043802522d67f2b69ac18b82bd\ + 0229e53bf6769fe83c469188d600e6afa6686bd9725afb9ce39bbd9f0281c07c\ + ab3646b43d2f56be3c030be9f69bda57e232c174fe06bad710bfda837ae10126\ + 150736bf0212a211ada6f31823d19ca06bb9390f44afcea7493c85f7869b3476\ + 3fb656f3fcd8c024d99f7d3b9e41f4bd9af7bf5f8c49a5a46ea38052460fbb7f\ + e10342290dd6a941a043666f8f1eae48947f7a97b54a226c74ca26a4f2d5a08f\ + a35b1d9485bfee47a47d5926102ca885db923f04986a821c012916b3f95b4d60\ + c5c15e8114f29dfb3b4ff41e2348c46b007357d33435ecb92d7dce71cddecf02\ + 0102041b02191d78b208d09b23e859be7e79ca76e612d8e5ac75a5ca02c506 +PublicKey: \ + 308202623082019706072a8648ce3804013082018a0281c100f9566c8d687a5e\ + ad7c780617d3ed37b4afc46582e9fc0d75ae217fb506f5c2024c2a0e6d7e0425\ + 44235b4de63047a33940d772721e895f9d4e92790bef0d3668ec7f6cade7f9b1\ + 8049b33efa773c83e97b35ef7ebf18934b48dd4700a48c1f76ffc20684521bad\ + 52834086ccdf1e3d5c9128fef52f6a9444d8e9944d49e5ab411f46b63b290b7f\ + dc8f48fab24c2059510bb7247e0930d5043802522d67f2b69ac18b82bd0229e5\ + 3bf6769fe83c469188d600e6afa6686bd9725afb9ce39bbd9f0281c07cab3646\ + b43d2f56be3c030be9f69bda57e232c174fe06bad710bfda837ae10126150736\ + bf0212a211ada6f31823d19ca06bb9390f44afcea7493c85f7869b34763fb656\ + f3fcd8c024d99f7d3b9e41f4bd9af7bf5f8c49a5a46ea38052460fbb7fe10342\ + 290dd6a941a043666f8f1eae48947f7a97b54a226c74ca26a4f2d5a08fa35b1d\ + 9485bfee47a47d5926102ca885db923f04986a821c012916b3f95b4d60c5c15e\ + 8114f29dfb3b4ff41e2348c46b007357d33435ecb92d7dce71cddecf02010203\ + 81c4000281c07a5b4ddf442b2cd7fd925be84f2ef4c4032d61c5a55c5949b30a\ + 765cd4d5d4566af37ffa7f814f51bdd71c3e5575c6fd0203f14d3ded4e14baa8\ + 2747a6437d35ebc81e2035bfb0e04087fb5fe449163377d47b045b680b394962\ + 20b3138e85f6d24e06f955ec7a1b785ce34c2926cda441bfc86ba2f44a489a41\ + ee1740ab5ec3daf6d2c598e1d143654c05ce61792b47ac92c8d6ba0711419e41\ + 221743b768eeec2601f66d277fba154a62dc996537a0caccfa313cc9fde0194c\ + 05493aab1f07 +Test: KeyPairValidAndConsistent +Plaintext: 9302C420D137C310 +Ciphertext: EEF64A81C754B2EF543A19549AC0FF3F44E4B548284ABAA1E5F1EB704B0D246749D7F1CEF7B20A5226384DBE8FB596101591BE2B53E9909EE3723CB70A385FC2DAF6CE15629EBA21E7F26223B0A2428D8931CBB4F1B281E318A540F38A809C8BAD92D10FDD63305DBBE972E6CB973FC4F2FDF0BB9CC37FC42C7AD76E8DE3FA91E5E79B09796652BFCD62A28A59D9A97759032A0A78E0E1B081DF212A15AA44E35DE9E291EDA499DDB631486C029D56052246C9E37FF24EE9E86465B3B55BC4BAD77B9AC873B6F36EA65892B202E320756540009C81B9C6747BDAF40E +Test: DecryptMatch +Plaintext: 9FD4F26B7317BBD1B235 +Ciphertext: 514DB5C63AD9707197B4F0B2A30CDA18369B963E62F7ABBA1E030E08D3DE4E6C17D4BD7CB8097C2E641FBB0AED6A9FE7FBEAAC1C6B85BB3570D0E86FF6105B9F8C9B562A4EFE4AE3AECA26978C514129006D22C108B1C8A0FA55864EED3D3F81643AAFE36DF1CBC3B4E1B1AD6D5E0612214938A55114589B97286A7EE5B04E39254696DA91453027F07346984423FE2784DEA9375C236E6640504B5BCAC32062836E5BE1695CE73285CD77CE9717FA38E080C28C2959D9E32A589C04ACE5E52970ED49BE34703AD6B9F024DDA176C631EF5EE76833B427E233A5DAEC4328 +Test: DecryptMatch +Plaintext: 337D8BDD32 +Ciphertext: A4EFBF2151DAC683F0C51D60A647151A1EA0C0DAA8CF3497D7116439E6AEEC62A36D06F89AB2F1886FB9F62403E3DA8D6F67F66DA2436EE20FFBADD698DF87EF40470749C0BE0414A7AE4D2755459F8A17F6C7D8920236400313D7846532C391A0A4D99C26C556772E2D3C74E0119C4CEC7EF224488BFEBA017A910E5FD167B4486E436F7481DC5A46F3FF0536193C75A857DC53C5242C11AB911BD21926462C5060BB89F71D99FDEAD3D16B1E21E0D0791B59ED0F49871F744B13F23EF5028C238B895532F90B0ABE9912644EC079604939A0CF519BA9D185 +Test: DecryptMatch +Plaintext: 25549A5AE844ABEAA694E3F6 +Ciphertext: E2B30DD7781DB7EE7B2EE3FEB77F7360A6069396D8BF1DFD85D5429DA5A156677679085D612D0FCCA0979C97E924E77C43D3702940DBB556A5BB6EA33D650E078B1CDF8E5F76DA6591D0AFF4389A3A982A9AC581BFF393B35D36894E407AA56B493C2F7C4CBB75AEC72394AC4F8A99089702F3AEDB2FC7486F5CD01691C3C8F8FF3E951CEC70A4E172B763124BE1D9F96DBBFBA8FA0EBD1A71067A20F68DA6AAAE849880DD7F88901DF051715E240BF0F5B49EEFE35B9B0ED2B69757111080DCE2E2A933CFBE8FB9E6E9A2C2C75E0A4228D06689796AB919EF80405CBF648137 +Test: DecryptMatch +Plaintext: 5E61EB24085019F4A76893517C0A13 +Ciphertext: B13E45F9288FD2C5C0FEE230D1A09DE376ADADB5A4330F33BEC04C6F14C4A1CF3789B976F402F11611AB8345B2EB1069CFEE1E2F482A02A0ED9A3B9D94EB78C7BD7222ECD48A598E34D1F0B6205331CB20E0B2C6C146FB29CC11BAD5CA06BCA3EE39DD536FF330663A817ADECCC284B92F6AE3EB75B00316992BEF8A955EBB4DDE2CEF504E9298AC243C00FDB64B6AE96FD7B2135E6BCEFA7CBFEE135A650AA3D8CD095D1C9156232DCFE1904BC4CCE58B455CEFDDEC1D201B07ED4F999D6281AE21C2008525DB24BEA2D9FDAC1BFEADC3E6E6B1181F1A55A75976C565BC28F177CF02 +Test: DecryptMatch +Plaintext: 87 +Ciphertext: 174E5CFE167D4F6FB9A8FCC0FBEFC12864745900F5A18EA92282C8B6689EF53BBB87B30FC21DB101D93E9FFCED05538EDAB59F9FA07FB176407651DD0C4CD8269B1DBB70F24C8177EC6E16294CF5E87A3070A077B1CE84B612C3E3B1D4FD60D732C4D2CAEF5AC442A358AD0F323E60F58FC8B29894F3EAD3AE0DB8FD08BEBCCD4220CEE6B7C43A5E769D1F890A6B6505EE7FCDC7E399FE5321C2792D7AE094D13EC493CC0911B3EDBA6DAA037E2EA0CD3642784FFF2CB1BE04E5B12AC9D2871F016D8BCCE6DF25C1C04D912CBE707FD4DB0F9E89C4 +Test: DecryptMatch +Comment: 2048-bit DLIES key +PrivateKey: \ + 308202400201003082021906072a8648ce3804013082020c028201010096411b\ + e93e733637e91b1d74f808f4c9c528293e3123ac1d3d2f94c462ff38d0cd2fde\ + c0eb03bc5e54b6df41e9bbe9127a1b3a7f47cfb513340664829ffae26f832b48\ + e2d660d10e4debc1bfb412f331ab7b2f88c0d31fb587ed5c5256e0ebf7da698a\ + fd3cfa0443af91bab8c539376fcbad72bfa6985b6e64250e6b546b07a4575b08\ + 449d383b5650083c637d2452e7d1b9227adfd328ce473bb4374fa31e0ad52e56\ + 7feff6a9c4842d24d069e7babb35313ad63ca5d33d572bb309689a571e9ffe25\ + 38816bd7bde7bb11c10752e6a842751f594f50cf4b8111f387134e30c6c03ba6\ + 40be7cd5b6574c0d0b571a98fcdc292070595dcf6e8d034cc0ef92e8ef028201\ + 004b208df49f399b1bf48d8eba7c047a64e294149f1891d60e9e97ca62317f9c\ + 686697ef607581de2f2a5b6fa0f4ddf4893d0d9d3fa3e7da899a0332414ffd71\ + 37c195a4716b30688726f5e0dfda097998d5bd97c460698fdac3f6ae292b7075\ + fbed34c57e9e7d0221d7c8dd5c629c9bb7e5d6b95fd34c2db732128735aa3583\ + d22bad84224e9c1dab28041e31be922973e8dc913d6fe99467239dda1ba7d18f\ + 056a972b3ff7fb54e24216926834f3dd5d9a989d6b1e52e99eab95d984b44d2b\ + 8f4fff129c40b5ebdef3dd88e083a97354213a8faca7a867a5c088f9c389a718\ + 63601dd3205f3e6adb2ba60685ab8d4c7e6e1490382caee7b74681a66077c974\ + 77020102041e021c614682228a4bea799d01008a4bca099e7cf7711d7914a81c\ + 39d2407f +PublicKey: \ + 308203263082021906072a8648ce3804013082020c028201010096411be93e73\ + 3637e91b1d74f808f4c9c528293e3123ac1d3d2f94c462ff38d0cd2fdec0eb03\ + bc5e54b6df41e9bbe9127a1b3a7f47cfb513340664829ffae26f832b48e2d660\ + d10e4debc1bfb412f331ab7b2f88c0d31fb587ed5c5256e0ebf7da698afd3cfa\ + 0443af91bab8c539376fcbad72bfa6985b6e64250e6b546b07a4575b08449d38\ + 3b5650083c637d2452e7d1b9227adfd328ce473bb4374fa31e0ad52e567feff6\ + a9c4842d24d069e7babb35313ad63ca5d33d572bb309689a571e9ffe2538816b\ + d7bde7bb11c10752e6a842751f594f50cf4b8111f387134e30c6c03ba640be7c\ + d5b6574c0d0b571a98fcdc292070595dcf6e8d034cc0ef92e8ef028201004b20\ + 8df49f399b1bf48d8eba7c047a64e294149f1891d60e9e97ca62317f9c686697\ + ef607581de2f2a5b6fa0f4ddf4893d0d9d3fa3e7da899a0332414ffd7137c195\ + a4716b30688726f5e0dfda097998d5bd97c460698fdac3f6ae292b7075fbed34\ + c57e9e7d0221d7c8dd5c629c9bb7e5d6b95fd34c2db732128735aa3583d22bad\ + 84224e9c1dab28041e31be922973e8dc913d6fe99467239dda1ba7d18f056a97\ + 2b3ff7fb54e24216926834f3dd5d9a989d6b1e52e99eab95d984b44d2b8f4fff\ + 129c40b5ebdef3dd88e083a97354213a8faca7a867a5c088f9c389a71863601d\ + d3205f3e6adb2ba60685ab8d4c7e6e1490382caee7b74681a66077c974770201\ + 020382010500028201001eb30132e415358b7d3f726b93e2eeb083fe7add7abb\ + 6ca352c9e09b365e5768ce032ee52d59f1c65311045c490c42c36ae08cd0264a\ + 26199aeec8c3a8882a363397b4d7e0b6c4abc407f27847be0e8477993069a1a3\ + a3fe68093e09ce55bbedf97c91e741ad2eceb7a0f4be6ff87f68deb03c5280d4\ + 8fdf4900485bf5ca20257b176f58fcee1f0451b3716862488b0642bcd76654ec\ + 4874512538976967a545cdc208a0050f26e541ca70343f653222e6df7aaa07cb\ + cf354a5ab910eb8447382d7f512c440982ab37a402c87d2888eecb35c636ba6c\ + 84a5cce917f234fc7f8d9167167e30f2840407e13751f1944f6aceae3f5a7025\ + 36723c1d88c8c04981e4 +Test: KeyPairValidAndConsistent +Plaintext: 5EE1 +Ciphertext: 73279829369404A1B68D5E86FF334259936133CB04C9186CFF733972054918C3285EE907C2863DEE872252BF03EC9FB088B8DCE6D69D78C6BCD6B3FF87E683C6CF3CA05FA6AF0C068D964BE01030A3AB4E19575811D141A59CFBC9D3558E48CB771D88CB1E0E6C7ABED041077D24005E337AFCFE8531569FE56E2CE97C40693C071409888AE46DAC8BD739AE0E1C392586917FE07A66F7D3AAF0DDC398117B594481D0D5CD19C8708DAED6338EAA552564C31F9548FFC7E5C641FDA95B252EF637C6CF708979948A3E6B4F37A9ADCD60BDD841F3B0945CFF55E2F13468EC71C550CC2AD48E7E1FB444F132AADB1EF2A7C5A22450D0E0CFE9E37D999B4794B5A594A4EB7ED406DB24ED541E575B9F2756545DDD34F6DB +Test: DecryptMatch +Plaintext: 0252EE2E1C603017 +Ciphertext: 0E742D794904D05C0F0B6F60E9655337F8C110F289C6E4A0D6FBA6A2A8EB0FBB566A7F9B9862175C7A00A8205E8C8012366023FD8DDB6EB713DEF86917233DC5D16C2822707230169C183FD3A714806220D7DBA735C4F747A23E4131CE12C5572BD5E659F967A8B7DAD0EB6138D1BB569C6F04EAD79F9A6301609697F73F6FD8CCE934FAC6FC138B4C552E211FB1CC242805C035815F462D0291537DE10632141ED0A7C22439C7270AF0A6244C073CE9E2654FED918C86697988B0B341C5EAD2CD6DE75EAFDB1DFFCC5FE465E8D8C9A34D5B7F0E9DDE62204FD12EE2F99435DD58F3254268F8E6CFFADEA9205DDFCC943004887C405859866A0A40456A6C50B57FCED319AE0EC92B9069F765013436FC9A0253481CBE12B707A2B20D +Test: DecryptMatch +Plaintext: 01AE +Ciphertext: 6AB2E26D99942CEEE4844632355BB3B7713DF000DA11099D4E1BF9EDD1781A9396032E9D96BA0DF21B309A9CABCE9AE3D022C33A931183DEC5A3721EA5CEB39C18935A43E3B0BC153E4469AEB604D031A0084BE5927478AF8EA652D0A4AF455BDC57EDF26E2C6F9A01C91F29984C11D3C60313A53D8AC65D9FA504742868AD3D313506EB4FDD0E9799B111F3041F4C0547BBB06BF7DB20D18B427BCA1BA5099821A5F0997EF08C319B851F0C88B4814CAC7BAA4290B3182738C37B6ABFC2C4770A633F70E6FA4FA53AB286384FFC2AF9B64DECBE12C8EEB97862F76296D13D889E864418056420DCCD0DF9B76FB32FA6BDEE149585F427F133972DB7281D91D6E78B6BC46151901179D186CAAC784D6271023FD6E84B +Test: DecryptMatch +Plaintext: D52A1E0E3253FE281A9471 +Ciphertext: 63F60818E399024073EAF02A7A419229EA4E2FA4126C910AE7D31DE7EB6C9502752F5B7241F2A133E9D71C1A75E23A6F5DBE36C1B661935B0F20123BF434153B1F81BBDE278611C9FAF9F56BE8C78116823AC5B5F355B88A82AD6A73D2B63BECFC7D3B39DB2A6B393E23826235AB76653EDF65DD7A94BD27E221E9D511041340FE83A27F7B26CCF3FA40B2BD786BB9D67D2BCED415F2F76D116E8F3EDC953B8A327D2846F247D91626F643F8DB800F5E1DF0CDAE2369AA8969A938E0BB5A44F0A9C0BBC7D15A34DAF4713531A7B6B59CCCA2282952B16A7E1A1D1CD47D8B2AC6A88BC6A85E692FED89BB3D1F16AC2A922836152059433A29F786F2386A74DD6F555CC8D06C890A4A93E9FE88CEB078333A631E9E3EED0610F0A17F2A4F8DAF +Test: DecryptMatch +Plaintext: 53 +Ciphertext: 7F820C0C9A5709C6026E58446623B5D4B323BACE54724F456684526BD1966A360944227D04824B3C9BAF19A602EBAD25B8047FB6BF9997EBDE6B854140C032481F1479E4B994FC5A2DE8128375099A7A0024AE1CB985D73BB2B806B20E0751EA154BE2A70ECBCA49335BA57694DF1E0EA4566304B8DF4BBFE5AA41D0B767AE1679BDDE70F95E1C0C7E06F4A635F987E2858407BCA2133C3EC5620D58F1AB7FE1426B615959009A4706797FE4060E1C690DA373E48D6BA684F69E981DEE5DB9A58C504DED4D4CA6CD9B776DA03E55DEBA97E541A300465FFC68C5417A10ACED061023ADE00FEED4099180948F26F10D2F9470978469F67AE1092100C16D8FC4104DD1E711CF67D5842DE4102869E96E817F9C9FF520 +Test: DecryptMatch +Plaintext: CEA6026338 +Ciphertext: 13D877F0F00D01125447982639AC82AACF30FA0573001DD809C72D0F811138088C6D6D0569E63AB001CEB0339BFB90F7B71F339CA2F75859920370C622C0C4930B79B99DAC0560C763A1162AB46F58D1409E25301AE6D70DD4FA64984FE894DAD2B6401F8864580132664DDC2A57D1AF8AAE43C2759780C8587475F21275D61765251DA8FE91921703DC8DD279DFF4260D8AFE69257BB43EC609DA30DC33526D66E46365F399AA04F34FA7BA6469CA964AD6F2299233424E7342F1BF493C0BBB31FA1C713543D758219AB0F73B9C24F4699415F96C32E2A700669FCAE7EA6921F96288723ECEDF9677EF35702C8C0B71AC27A57624A7667580A2FBFF72818B2BCBA3589DCB686486FDDB50E29E75EBC8AD3DEDC8B741AF80F7 +Test: DecryptMatch diff --git a/external/crypto++-5.6.3/TestVectors/dsa.txt b/external/crypto++-5.6.3/TestVectors/dsa.txt new file mode 100644 index 000000000..22d5e8fde --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/dsa.txt @@ -0,0 +1,397 @@ +AlgorithmType: Signature +Name: DSA/SHA-1 +ModulusSize: 1024 +Test: GenerateKey +Source: sent by CygnaCom during Crypto++ 5.0 FIPS 140-2 evaluation +KeyFormat: Component +Modulus: 8fbb9edf2fd2834b1a9fe97c25999fbc381ae165d932aa521592c2cdcb4318bfb99a2408f118ea874b73704e2cc557fc89a01ecfb5bc412951e86613b0b2fad2389e81ef42f79705fcdc87a9b9dcb1afb44c37d971aeffc1c859be367457ea19d71f22bcaa29752f15242f59b295125e9e01ab582887fa869e4b0f4a308167a7 +SubgroupOrder: cd6c675f1d22c771e7f59020ca0e94078950df9b +SubgroupGenerator: 7b473ffda9ed6e10f85177ac05f43ec666dc6d42310151053ae83369de9f9b331232cbc83bef31166e19b111e46e57703fc6666ac9a571ff053e18f3c2fbc4c2f32521750a941981a55379a2fe13bc78c6a3787f44dea397af63a7ce432704657feb57295ab9711ac7070ca5b7344bcaaedfd8bbddecd8de9c67e7cffa2fa20d +PublicElement: 64f31bc4d5b42622b41326361fb0d67f9feb364b34be67f6b2e4dc1f928fc70e6fe42cd9cd6ce3dc40113e7b4742d4af6fbe04d962adc5238d4d95b7bb67f0ec6592e966517d0a34137a45dc82ebe282c904750e1aa31b62c919b250d4d8ef922b0b0574cb2ccf1b451d7facd075e77fa532626602b32fee6fb334e1c2911388 +Test: PublicKeyValid +Message: 699c4211bcba049ac8d73c37fc3d02241f70b8ccbd6a1225d813664bcd043660847dfba3dca434cf5600afb60036171ea402bfdc3279ae2f6b7deb5fd0810a96ca7ff7ff1a36021d84a92b6db7d4b03f80b1d5d2306cf3af4be2c448725fedd09399cd5d4fe8853cabc84895fb91e4400c7591e691bafa5cd0398a3c8d18f8c5 +Signature: c0aa11b2571acf6fb78dd85148d97ae04877ea1a05d27ab73783ba4efa3a4b7f110cc44c7ba2c842 +Test: Verify +Message: f5373216e55156d66524e39dd8a345cc519edd8cee2b7cdb755222d42ef8f843000e8b69cffa4b0c154543c3bf871b804a904b5e1ed8a1ad2a29f63bc28b2ce5b5706c5fb2219e40dd682951ad7fed1709397d9ea36fa18894ad0c57391e5af74db54d8f479d4989f6e40de05b63b4a9c7f0ebe535c87485ea36dcbf4b897890 +Signature: 33e28ca5be57567a880c52451ec72f27d25b6e26c38216900ef17f0c307fd7614b399ff5febfd7e6 +Test: Verify +Message: 92fe48a60045104207970b674f800f67cabbba0dbc8d1d120b64a4ddc9b149800003f9efbd6446825ff84fae21d4ed00e61d1f5b4562b872d53b4788ba2247677091889fd75ddd017f52075b3610e275d025ce4c366c608eb2a64a567a5688287ae2cd3066e72db701dc0ce6a7eb46bf210c9f59aa646e5c3ddd86bc210665ba +Signature: 95616a85b6d9ff3c9af7264cbbf8b9cdb71404eec47fa7c91291fb93ddd8b0327df74cfae6698e0d +Test: Verify +Message: 18b8baa09b84cf8ec77a1d34d68b0971fa71016ad5b71838350ce9d114c8aa34d0bf8fd9a747615876845f58b2fb55bba757fb08f176901838b7b7042f87924fcf2a1c50d1c7cce36ab768514b0f277cd86b0a4fa7fe7c653cd729f803751b0d8f8f1cde121d47871caaf0f598deb70c0447e718f0671576ba04f68488ab80c5 +Signature: 23c6fde5fd9a2478d99c3abaa61363d90b2c161e847be181af07276e376ce4f76db56dfc3a1f2425 +Test: Verify +Message: 598660449d62f60b1e0581b0c493803d3ba5cb49a5c5d5917f2a41d6d1b6a8f69a2ea94e7bb8334fa29a0f5ffa32b1f291313fe9491ce32ac3044e8188848db77afd10f17a0ef84b5b56a1b5076d700df021de7ebaeec51827c0eab042ecccfacf6bace5f35add3820b04e6a443e55c632ecbec05032149182d52e1a57e4fef8 +Signature: 2c07790afcaf89768f1d1492345510d937e65bca5621811e1b705651a861be1f88f52090036cc1ce +Test: Verify +Message: e37395964c3c1f7b37c99c2f56070cf9672de2f7cf63bc6778ae6532e81f09baa23cb7e5c2af1c6ad32e7e5bf4aaf7f42cbbf4a20a4bed578182660d02f22799db04b8b2cfa31f41f727ddebd88326ddc6b361d77860e07cedd6e1d87e28c53244a28f14ad6fa099598cb1f73bec114ceded21ad53fa0d6d7482ccaa951a5b1e +Signature: 58697e6dad83ddfe43817e5534535ecd78a985d3928e271212165dec4e76c8025d531ee84ba8caf3 +Test: Verify +Message: 24976d350993351696b33cf2db5440303d5a722cc2d25eeb9ccf1e20f57ec060fa8bf4a22ab9fafbe0bdcb971f5b86fb9ec41e79142e42f4c6b58dd54e71ef4eadd95cce9458b3c5ef2df19ab38896e9e9e35801fb9e079e3fdec0e3c1a7559b5638fdb1dea738edd9bd06f12d144873366f76bc0f5a83621f030d42e857cac0 +Signature: 7488f2ca5fe2bec2c7a83e73407411c9e89bf8cd594d4a03a736423ebd913c2b98a21e445bdf70f6 +Test: NotVerify +Message: 430cde2feba0256295b6366211252174a29c9bd2b8e6db8fe97fb9ce35580a247be8364a37741b077e9f275d3b34b1f2ab3397c2171b1e04d177065972aced3c5201e6a648ef5900a3ab1e4f69f2d59bcf1488a0f84485b8f21e7508ef7ac1eac070269b97ac9726fef3539012f647450557a6c2d4fac685448d3e32235a3e06 +Signature: 7500d2fe4b2943b4da93490d3bac5c344bb18eb550975ead0e461ec33485e11714b4ceab478644b0 +Test: Verify +Message: 81bd412f4f9c8f8b7885d9fec9b013be8246d4284121dc9c2fbfe59a6987af1db141463855cf96ef6031325800b961f2378a6a46c65722bc565ab3c0e993ae15814354790fa8217a9efa9a98c0a6599c39c95638ebf077e0010f5be860bf63df4abc032a559e47e58bd8a9f6e3ee1173e0fb2d378762f4bf87d4764aa483e631 +Signature: 37cb9d9adb92a7e74365f9e4c4857a88a6fabd200d955dc76333b0ea9c1b2f05fee9117c79b10d09 +Test: Verify +Message: 84652beae6fec221ab800bf6303f17a47a84278a1274a2b11f40569bc58ff34ebe28c5a138e4b1c7eed4731989ae1728397db5038f8970c59e84b16353f8a1b411ede5c290de9e50f7de9fab3807f1b6ad238530f09e384900ac0c6591b6a530b30b03e2a8c47ed4fff80744f5219e650cce0eaaed8bf0547b0edf3a39a3f8d9 +Signature: 194a79f399087d977a29a3eab308670b7b133acf4e8b43068639e0e5e37d7ed305e32b85e30a0a22 +Test: Verify +Message: 9cdf6e966c37794c7b3dd6234e76d715099128caff3d03917a4a96a2c703b19386cab41830f5b8ffe9e9fd6b88759450e4714d2f6298e413bca267cc13a5ea6c38ae6fff379b0f8e253b6e562ca95f45d4e6d3b694b6076e99bdeed7d5d9dc7b4bc275c49ae0d5f2c86c015d51cb8eed702790d7ad50c59aa8d203392456dfba +Signature: 7b427233d9e49dbfd8ff2a7814dd99cbd4533d67155696b215d593d5ac3989c8927850601c0d453d +Test: Verify +Message: df577c9f2370b362f86a928e40106d7b0a511d5d8ec619776b82d57e1f195b4bc7f328c619d2490e9fa2b6ed3681ef7cc60fd51343f7cb74e5be0d37a3cb5078f6b89bc0ccd86532ca09f0f7c6bbe5eb85413088b1571e131ef5b6063e5355bfe23d8d6733993f24f036f682ead7871fbd7fe796d0ff4dae90be88c4e8c9a276 +Signature: 39a7efc692685eed0c3cea8838c026b39367c6f446a16258906787af9447329ab99e821eba53cb89 +Test: Verify +Message: 91042eb63d47c10f678bec836f98630e13e707b29c98b28d47b1443cf699e97018d4aecfd500440e7f11134c35c982b1d97b86473500691869fadc89974840f7d2ca319045565573a0fb630bc87576a8bff09460d1027a2500e3ab28b2eeb86d995dd1afe3418c76a4c0f5778094d72c9dc04ab4c8947eede6e3c6cf9d83e80c +Signature: a813d89e3de90f1ce1b77a7d6c629e8f83296aefb8bfe1194f914797d08b53fb59cb9186935dc10e +Test: Verify +Message: e644b9a45009da8248611de174b5613dfb4aafc0a772740c38f1ff480bb23e69ecabb5c2380dbfcf37b1093eb8bf4c3feea04a0d8b270cbd1bfb5a46a2487bd279a62e446649e80afb6b502431f6f97544765f4ad13f24282edb8bdb0ab635bc460d1c421314cdcc4c66eaad16b3e078b6a4e48eb21234e62b688c1d7a56e6be +Signature: 4e4fbbd84fc44f0ecd6c163fa292cd96051ca51764fb5626f8ecbd8470faf6ae5d79c731d9a3497e +Test: NotVerify +Message: d30ac577ac767ce6eee34ccfe09f0278f2faf8d28f657cb424ca7f53712b7f040f7eb63643c784ab02771af64405693a8eca4a21ba22ee1b09c189d96c533a0910583e53283e5693ffc076593d7eaf9e79de5ec9002296e2e4cacc15492cc26beb52b5c4f414ca17fd77b6ee6245ad1ccbec8ec2f89c4c81cc9ca0019deeeda3 +Signature: 4ee3704d4bff39aff0efded0930cf28ff7641f089280f1d0e38a186075e91d73a5b1e7d028340fe5 +Test: Verify +Message: 82bb8073af3e53b8ae158f342c4cae3c039dc830703bf0e893dacf5d280284948596bbd0d3a00cf8915f96464693dc328507df9e27607d43c426095b74102c90c494fc24fbaf5a628ef29146e1ce2c684020182f1e00fb338cc6d4f2fd5ed3b739ce7bc89e05f6cf9fe6b88b769558b72c01ab3accb22291e3d5667a3c8532e3 +Signature: 0b0b366b23090265e75752fdcde1a7d76113653246e0da762e25012cceb13859313e469f4dc31680 +Test: Verify +Message: 12da3a70153655976cba8144f67dc21719410fd136aa69ab4cc11df9eaa955005ba0e5140d3955f643d82a6cfc6e7a222376afc1f8309b4dbe1dbdc4a6bcd2f5fc839f9e9020fec967f12768a3c14130b0c529b3b0d682c129f1fd00eeeceac94b7a0046746269ca30fc1171c2ed30f9182416df371436bde63376e49ab2b635 +Signature: b43f325f82eb07dd2cb3a03a022e8c89216e820da743c216ec6eec5bf445f12b2d326d52e38b90ab +Test: Verify +Message: 45a2799fb193f3adbef66b8035318c5f7eb3610dfc64dbd1a84b87c0f082884ed257db1435c4cce38711b30b9dc8f4e5c7d936a7330ee36984b2e172b37d8ec925c401f80ede802305d93d4ae85e56dbf3e20c7b1c0f4216b17238253465893f773f63e3f4bb07846fa781d6cfcea858382658226e3eeff166e306702e1271c9 +Signature: 238f01011e1b3e7d027af353e06e2138f5a40ffd3d7a78d55c95ea3b94ad82b8ed58c308f7db5ef3 +Test: Verify +Message: 6cff32791fa0d15947fdedf67508fee334d1739512e15ce3ecdb5ac17f56c43e2cf51bbb0bc8b06d34e894164a4dc0ff48f3863a902d3716314916e278667de7bb914ea061279d3c36679b57ee56c6f4f7d84fbe830bcb80d6e71ee2cd15a565b00ca3a13972eebfe4b2da3279d966bad8b7a69a0533701873ed4a36951b94b0 +Signature: c9194d5ca3dbb424faae51f66377836a93bc55ab1d481e5eb9663c7033329d82c13af868f4a24efd +Test: Verify +Message: 37a363f2ebaa01fd1ed7902a4804c8fa46845b63d82b947e59a23073c0e97da2d72db113bbcc8d2095a6336197a744d83a923d5eb610134dc1f80d6f8de1e327fce615de26b88db10dea78599f79615aed9b906fabcaa236e8106a180e94077b1c65462c23863a07003b19e858935ad7d9360d6fae717a8f4480fd443c1a21f7 +Signature: 9ca210249d306006ecffd384f87c4dfcb1d466e005d877c2508475bf0074c4c6fffad6e123bd5dab +Test: Verify +Message: d3b14dfc79ab30cae8e40dcda6bafd6434741e6ab1b9e0d2cd4e8d80f10f176aac3126ef61b662772f31fe4d21bc85b99737e961f5c2c9e28a7d02aac27f7a19901529d8163c687997617e509f576890719ae9aab1c3d3e3524b9434c384036655d56d6ef035db06f7eaa68e78843e22981437fc3eb2950bff2e59d54a154b8a +Signature: 30cffe077d2330f111eaff346634237473feb83cc522a5d20c75db7b4c90c4e21583e1cec8e00f29 +Test: NotVerify +Message: 69d5980a58474652bf27388ea6041f9e0fe688ea95f59fa745682c69bcb1c7ea82e75f19a773eb669cff6e4d549b31219b323c1bb62d16a33c65bfdd344feb77706280b229cc51afdc571dfc6495c35f5953c8e1a83d0b1e73cec7cd2b7bca8beb20f4ec18abf2c437073cb20f4b4def00232255a27ff6b3a17b3b50d88fdcbd +Signature: 18eeda64cc75f18f58d43ce6b95eb3918a521bfb40c1745a38f985d294caf2d86879528678881191 +Test: NotVerify +Message: e0ac66b23eabe745886613c4698c79478f484a43f8dc444e7e7ee215a673c29ba56a56b4b41bcfc1962046ad66132d28a6eaf623858f028c71c3cc4bdd34567d54ddd4f0bf9f97dff31e3def7edd1769b39cdbbaf3f28b283e27a5d7fb548cfc04be365ff66f1717b7164e8148210f83cd1951ffda3db89a0062c5af980a3c8e +Signature: 6db33727b795d286a69ddebadd6e09c527bcb1ee596915b6fc950549beed350fda40a4c1f52c6a34 +Test: Verify +Message: f9cec4d6e1f2c2285dfb17d3ec5d16edec0da9b05ad12d62cbcd8f84ab4ba73eb6cad40ab44ad9a079d7f8221c544d89778a6d50df713f5f25bd1a3acdac1f6a8d0fd92c0a971459ce62fb958dc675bc995dc189a3515088b3e9e33f6b54e59978b60b9359712a2954b55883b54b475c4a9ddeb31c0a19b66f6922ebfcdbb0a1 +Signature: 947428406add226d1dd8db3245d00617b152921404ee5ab8d4e840c87d26073cc4d144a0b51e19a5 +Test: Verify +Message: 966d6fa1ea1ae8d344037a48420d6379278133fbc0c25450974fd9105bf988398f652ad373c511c830d2eb02470dc7c63b3865507d0fc3b0994ce4e4a0dae337d55839d99bd14bbf9eba37be412de0e348653815c77acdee4b5d97d646170062c03e35ec3cb8ac73e8b3f6b40ae5c78aa7014383757a8bc4037c881f2727f772 +Signature: 63137ff0730f28235e87cd5122d22a973035869332ec538d5be6e2c9c0db94f3c012ae4abf3af9fd +Test: Verify +Message: 43a8f0b5992db54d1d65acbf72780493d1af881fe95f9f14f61b834f201ac1df16e5f252eb46b845306efc2b5365655d38b71c63155dbf8193e9a48623f64fd19ecf36a4205fb4ad26594bd2e6a81e3cee19aea80147d4ea2fc700c23395b0e411bf3342f050a09c357f114be21925492e2cb58564f5d666010c0f9e09cedc31 +Signature: 1bf8e80c8183d00907ce80e74989d84815db85dd1654a6d49f74c020a83e8bc931a178ce18056f57 +Test: Verify +Message: c4aaf1632b1438752e9790c89cff4773932d3fab0ef710bcaf41794bcf5c0ccac49e1a3c7143dd2b1484e4e74cf6c4006925fd06f9702a8090276e2ad7e41b74d727a3378835c4ba9533efe5727efac4a14d073f4089b418d7ec8526605a8ed0987c65cc85a3471948dc893b254f41b7d0dd36cefafa057d1cc796b58374bfd7 +Signature: 5fa8964b471c76211e2743c4d993e793dfa7239dc84a19bb3fdad2162a8c98a2434c94213f3a163d +Test: Verify +Message: 739d44364282b7bc61c62188d07e0ef12b907960a740f1764ff8ed7981586c04a47ed0ef2b97fc7dcfa6adc508941762cd79c05f8d2aa15d6e037a06c5f676b7d6d40069cddbe4e0fc81aa18578030ed2d22860929cf0f1389d4d5159d762c2f82378b7a2067a73f62efd159b55a91e8c3248438714773f01704b57fffefc7c3 +Signature: 1b61d79c6b33e3c3394fff6efd641405652033690d7219da8475faaabce3e395bc720d70c60e12f0 +Test: Verify +Message: fc205229f11c877b617739d9ac191773c207ac714c5e2a061a917ad2cde4827ec628b5924eb8e19a06b4357a927d920e8171130580e8dfffc06f2ee5a4449a89af12a87faeed963b2291676cf0d72d984c7997f8e207ba96472924a5a0161f21915542a769b33e978b85e7681f20814bfb964d03ccb25404893674cb1954a87d +Signature: 283d55c038d4270e71ae39db618390f17675478b704764d1fe352550054076f4461eb6da6174dd17 +Test: Verify +Message: c343029ce5d70a70251b50cc5e784126dd65e35080940f450d5cf435d567c9ce8a9dd2cd5d5096c55ba95f2f0952f2b33f6490b642942d24259aef7f62e2ea29b4771bee372ca2d5c30c4428850421c1e0cfb2978323068acb1a3d6b5be34550f9a9d416acc3a637141ef8ce09e845e7787f400d7a99120eb5b4d611f8c051db +Signature: 0cdabb09213e0f09cf01e0329bba5661753950fc92e681173a6eb46c02d00224b50ebca62a248faa +Test: Verify +Message: 5e126ef683f3b61a39065574bece4ad82dbf4d34495f40cb899dd2b163717588ddb683795244ac758252a3adde0a0950126e9984d26a96a7e93b72c780ffbf60ac9d5b553cd8d831c1af2a9edef79426d13cd42942d48e204c45f611cadac252e3804f81d8e612c40dd5423e56cdc3d285e1561b31d400acc875b885d73854d5 +Signature: 01dde9613b9ce3c29b3503c19c13f863f27ab71bc0844476b3860ac891f9ce374aea6c24f517b8ab +Test: Verify +Message: f799a6b5a7bf7c32847fc243cbe0166f5244a377c43682c41b75530e6342174fade751e751885d10692e10858b11926ec626788fdfe925b2cd6d625272a13c899ce41e3c3ccc2f84e533ef6088840d9a6e448bf777e415a291c59ddb7b8d3cdcbca9450bde23ab67f0a6952c3bcf3fc944b6140502bc0a6d60983d00f69dcf1e +Signature: 0fc64023e095044c9d2d003a555e2da7aa5daf413896cd4e7ac774ecbaa0e4ece8e8ccfa053ab62e +Test: Verify +Message: ae0424ff8fb19e8842828a3cd51c93e1123e0c4ce9f9fbbc1b326979295be9ad7c6e6783d62b337ef8924e1b95a3f4aa77546a6af0d409e483ff8b89d422958fcdf0860912c47f45a819b36be047f0538a806ea6580bd83990bf99a6f6c2682cf98316c91df69796a80f50639082a093a5b9b139fb1580739a692b0769b47b3d +Signature: 6fbe751842e02a3fc3726a5d8298d1a7adb799a02d897597f4c459d28e9e25cf447b8cdf50001d21 +Test: Verify +Message: fc5837b228cd6c963b52cabd227cf61b5a1e6ccb4baff71ae4f971da7904bce5d94201efb3fc28912bfc9894b87c307a414f8653784e5fbe76056e3d989f51bf990fca68f0813aa36c00646a0e685fd5278fdce1b2af9a83f41726ed5212d82072180bb396339ce235b5a5dadb187b434335e50fb2aa9f829685108260354721 +Signature: 5bb80b35dad17648220dbe980a660effaddd7c43ad3584318e835c355dd7bf2f5510091389c42914 +Test: Verify +Message: 689eec3b665d72447abe64d4ddd79b7b73cd171bd22fa8689395e0a3d9793997205583d449fe912be240246ababb1859a5fdcdf48ce1d9ebb928ec58615503c073ced04ca0306948abf231ddf33e040b3e0ca7eac8816e218b872fa7d1ad67b9f841ab1c85ab52956d0c61a69f18b78ad5317a739dc6c102a2ea82084038bf7c +Signature: 3cb07367288036891a8861931e5b2104734a6e7e70ffaa32a49032b968805dd0bfc9f1989da22b12 +Test: Verify +Message: bc4828ec0810c7a43cbf028dced7a5890803681f86238a28f296aebeffc7f561a4fa5d6c9a595ab7193ab38eceb39fd220601f6ea5739efddffec8b93b7da7a74ba705014376fde4b375e33a844a57ea3583a43f56a55f9745723c4d287b34e82be7d584fb82e98183094b6be6b4052abd05ae6b92d0034d9d8cc550bdd8d27b +Signature: 67b214ed56ba44ced95d3d9e8c25c99331e3e973a3099e524473ccc8d4256f4ff7de9674a369cb57 +Test: Verify +PublicElement: 19b80e6f0132bd24dc0f26acc6a30445c4deb4fe7394440ce1ea0039d9c8137ec962e54b09d4383989baa288129e551e027477965ba1dbca0b6d586e482325f09a0fb16236d7b4ac3a3bb822a7a329aefeb91936f4b8cae38fd1e369db4f3f97421277533724d27e39248de3618a662c4b757cbbea2e3d805116d3e9d0ab3547 +Test: PublicKeyValid +Message: ceba9387e7ba8d55f8010aa2e8ed7de2c8310df67951e1c49c5fad18baf47dbbb571c2d26f779a79b8a564a07d9184252f097432728b0cda080212effcc3052612c8266e6f2bc88e85e6dafd42cab20679bd1b1d9038a27b6b001e0199237e4cbe37d81441ceaeca363d82728d8f9ebe7dc41d6c2b4f3ee19fcfea07e90c8364 +Signature: 84d8e940de14bfb65b8c0e0999e296a1d3c51f18b8bd79c57d826d9d200a6e38e52490722c6ee201 +Test: Verify +Message: 7b9058ef673b23e5b6a3d97784b898e0d912c990449be876b77b768da6443ba95b5fc1849db70e0482a4a1cf901aaf111b129e8dda38c3e2ccd758204a03c18b6d0500aea30b76a48c11dca21b0a82c9ea54c62bdd5bd71bfb8bacba897c3fbf68590f86b191d55c8ec285095ce2899fffb03983845a9eb9fe6f68749a082ddd +Signature: 7d07f3033c1c841466eeb641ad899ee247757ca067ab38f6f698ad0cce5f26517da7bc51b8e630fa +Test: Verify +Message: 2404a0e4c5ff8fa11c40f9932c8bfd3bac118eee53085c8e658cff857eb56b029ffa907876c65054f258a7fd07e01512bfd850df82a02820a65dbafb3a13d9380f01b9c3093ddd64a49044bcc994cf84d30cf602dd84accc4f2a8fc1a8eb55458ed173bc139c0f494aa028c80ade040a0166da50fdecc00a77aad8d16175b7a2 +Signature: 793e491940787f4e76495575616901c1c77d023342569cb8bc96efcfbc9746b3f51c31e29b221b02 +Test: Verify +Message: 5c311c167d2e3ebc19fbf7ab1c619d8ac1611152527a953d2137eaecc6fdaed79c13f4fa76f224bea7cf162531676a3a4c0a2ab81beba3f9aaa681222b122a8d724a5c77aef60aeb69df73eec3b384eceb157063dee88dce64dd72d4473b4fb2d6ee8de59bd3a61d5843465e48dea37894991aaa130a0b9246f3f659940ed61c +Signature: 7f76e9d084a9afd5c390271261b316cbd1095e710d1b7e4503188c99b8a8d851b130ad240e31f0c3 +Test: NotVerify +Message: 9dc221be2ab612b2ce6c7fc8b739af7fe740e9601f3201d3094a2444a488e076f52c7727ec7665e5949d2f307f0e6ed171e71c7a4cb21f9f3c661494239b5de7470e6d003a5553f80ae385b6aa3fef50a0803ca1f10d64264a93761e6f47a8e2e95e9c82ecc9f5a186361a930e434ab5cc05e10ce5b9e9218bc9e41b6203d81e +Signature: 332a2daa48681410763f13c3b127516c861bf1f187504d8b3bb1bd11ecbf9a9821f18466c10f1859 +Test: Verify +Message: e4354b9c9bd98d62fe629486b6856c96f34d2fa2460200c5c25746f454d32a065f8153049bdbe1b32ff4a8600de6aeeb8f7be7174f1f2f114c06893e3a9997492927596d5bc92a005f96f8417209c36316af59d9f41450e4eff0445b8a8e52ba7d7ed56e927b6060c59ffcc09bc5a313c33ffc80ecba5957e56deee2fc895471 +Signature: 65c2fd8a2635d6942b4b833682b29637eff64d80ac5ba18491bdc26d1c34d70a2c4b680900347d1d +Test: Verify +Message: a090ca3eecf8677a7699f42b16428445a3cbe74981efd6436d66620185469e959b9c8c0dbb464672fa136dff821ed7a2db6874b97bb5810691a9f1f30f22180df6d89abae633943ee56c08ee6fe88eb3bfd139c25df7c899e8e60e3d2647a3b3497cccbd8477a9d7cfdb9d71f657036ee83f0fdc3e6b01f60a559157e36e9781 +Signature: 19b4876e4043fe5f5a58e70b1560b0942ff4fdba842266a6653a6aa1550b91f4ba85a3b676a3659b +Test: Verify +Message: 8e2ecbfb35ae99dd004f2305cb2fe98c81edcccc13372e86b98f4e526d5dde4da43ae6fd4f7cdd8812fd0516c43107832767cf49e95faaaddb0e9f2a70ad0b1b790880ac1f05df022172b3a94f14d13f47ee2e5f70cf01d0341f19ef82ea805a832e51de9b61d7a3a346e89665f280175919a0e59f9e69463d5b757a9a2d7662 +Signature: 6d67367aa1caef2722c125a30e9e08ef7dad05a015893ec3c395c35d81944fe2db2a660e4e60913e +Test: Verify +Message: 6d3ba912c4bc10feb611e15965fe814bb2d5e5de67705a1ca46e8e6a8cb2e3243018f57abb7a698bdfe3f9c08012bd6aa033bc9f8bd9b351433f24b12ec0a3c3fe945c42e1cce9b6eb9153d4c099661686ea3a9b0ad3ff4131280800a2bd1b8ab125f7218fac27b8b092064d7d8a13863c73788a3c56d52344a051113ea1e3b1 +Signature: c56d1aa9f30790bec01fc07e5816fc6f44ab659898a959ecb061b4347e7f2be6f2df97ba33043a00 +Test: Verify +Message: cf2010dec81c60bbe408df2bf20f465d259a5a8d2f7920ce9c566318705c69950423f1281edf713f50ca8eda93cedbdc2378d6929d192081573efd7500520cc6799247edf3323e4849cd902aa013aa273daec49ea6741887fcd4657e987aa511e5450a467e6c3f7088ebdc3451342ad729141aca81e3807843f0944e712bab0c +Signature: a6640671721cb21d86265e30cabbc09ba20cf6081b4a5c7928ab3a53d4e291bf6049e8bf8418f6d6 +Test: Verify +Message: 4b00e4324ff7fbeb0fc48a6c83de82d52da1bcd1eb6669cffbe2bd824fc1d7971383f4b67d96d5bcd4b56e36c480d021e05d58e0788e197f9e93882773c267e1b725f38f919451289b143633316ed687fb131041b930d7064e0de47a10ac9a014f9e39b5232847a87b973c5b63e16d7f957d3aea43847cdd24092975bdb5496f +Signature: ab2f5b0d5237ec1b7e6297700a7c06647a526cb069c8162c513100008fe0dc37d4a8c9639ac94cb0 +Test: Verify +Message: 20f18b1eb4ccf98fa68c10d680f1536bd5c7c3307cb13ede0e3717afa213f74dc8b8f4fbc324ef020ce7335e03744baaf8a824495a9964d63ea00ace13a9467ca4ba9b264fc2337684a4822b81841f004c51dfdcf193333cfd77c4de3a184db0ad10b8f8ce3f7cc407da369470b88647c8d92d43b73864e942d37f388ff7c3c0 +Signature: ae23d943a56fc60ef381a2a5c056d24e472e9e906e4af1bcc91a27800b99b7cbbae8d4fc303ada82 +Test: Verify +Message: c9db3284c5b9a283f38da98655485939d5662045b325ccae3207df72838a1660f22634364f8814fe9f0eeeaa0483e9efea1ce25f74b37bca264268d6d3a3f6dcc986dc063cb347a7f08220db2b97a060dae317b302d8f86e6aec29e287518af0a8f2c32d62b153363ee0d650a2fe9744fdb3567a370e5a5458fdbbce770de953 +Signature: 06bd46f7ec091697c86e82497dc184139a988e3b9adee67ce3d87d739871fb1cdcef9dc6de421615 +Test: Verify +Message: e2e5fc81619b215141e12ea9544184e5ebabcb3834e96dbad2464fb5be7bd22c5dda0aade2be3d59e732a03147e04da33f3c8854c4f23330278e8fb0e76b356bd7de54e071a22c827987cb05d65708e8ac09bd43be2948d304874443881f84bd874852b1c421e6e52f3929bdb77eabcd6c68e29dda66a4bba189e807596fb93b +Signature: c86708f91828158b1c129e48ccc6adfdccf4997e8eb2214c24fd4bf4edd8ac1f3411d77ec65321c2 +Test: Verify +Message: b9a5127b9995a063f3422d3069a4b22ff9b7816e01ceeb3f933733f1fc11b3ca8f694d49b79c159a3ce93c59d555408befc452dabd54071181fd43d8196863b1cc0caa32568fee84335c841c298068b919cbb19e06233412662b7815a916da6408c501af8f2885196ed3dbf17cdf84af0c047632f5f4ca39dcfaa81fc5d370db +Signature: 0461b5dfdcfa1f9be6e7528478e2785903f0b8990f2354209554aeedd246d231567b06c5f81e0842 +Test: Verify +Message: 38da1e2a517a87304f85291a67e7a7ea0e637e797fa1a122707b58ac10845b7d44da2afe232eaf49b011171ad781edf4aab47992dc2358927eda5d5df9ffa75a4da2035389c484278aaa60b1f7630ef97d979e9a48935873c2929892904ee95dc9c7610279533c2256e7bcb9c1a4405100a5a367ba08d81db43bc322cb885adf +Signature: 3e7f697603dd770218ff55f027a8fc980763b6b9bbe84a766e0e55fc7c23e4f734d28f67fd73e14c +Test: Verify +Message: e431f4fc91ec6111098c5de4532c76bdd3ab9a42e92c6c10e7ccc69539a38f31cffdbe8dcedaaf3b78a3a68f592fa1bcb4f663332d94bd38b8811fc7c10f60a69da5cacb303a6af0e0159675bac3bf76e459782d43ebc7896c4dac0fd009f0f224a0306e0f06296a1858454ecee06722394bf4e88129223adda68528bf87d74c +Signature: 2b2111694dd96095c76bd18fbce8f720ddcffe6c8d9c194e880b0abfa44bcaee6b97addc84c519de +Test: NotVerify +Message: 2f3e3407e1c3e585d3f87ecdf8ee45321c8d46ed84410565c7e282c1ece573acc5c2bd688ba53416bb5894433070bfb782b7397b9edae229a653f2780b993a07e887996aa20bbd73be101bc203ad318fd18efbb7c0a3b4057c08cfc3e03535825167c0255d4ef73495f80c60a8fd1352c1ec85b822f6f59201da10baa310dbb2 +Signature: 88ed45212439c0cb86f513026b72002cdae6317544b95fcf4dd1eeaf460edb6f5891080272a3b31c +Test: Verify +Message: b3b7c629f3f5e85b35f7b95d9757a8dd980a2acc68fd9f1b74ee82af328cd5a62ad2ccce45a1b8625a9c3706f6499a066c6597cb1e88309f0afae3a298d4130ca25bb6a5c5994181e73dd00109b59a074e8a95794cfb65f993dd8be27cb2cb863409dea709155933f391dd4466d38058562f7ccd8c8f17a02850d267775fd58c +Signature: b2101fe80d5d71592eae972be0cb7f67e0fc2950bf60fb12b91a1a63d9f4747c1d92d2712cc33300 +Test: Verify +Message: cbf84e9aefa950d9c997dcb571a50e25c09c7ba40e730a1c28e112109621b4090b057b442c3e339a86ea07afc95fde5f4a37f765b99cc34e1fd5039d1b1122405d74d5336360f17273058c25da2b5807633f3c181a9d3483421d6ad294e09550bb5c93bf0ca6423b8affa46e1aa232f603cd8113a90e13958ad080057925c612 +Signature: bb80dfc840147d79654ed993f5266da74985e2225e7f5d61266fb1caa2deb06fa3bebd930122cfe4 +Test: Verify +Message: 3f1ba8edcc9ff1dfe2c25c860202f927af2188fe5bde071b8fef797c5f42f96c0d75001bfc94f37ed912f06a040adaec45b6a3ebac30d901c96974960d67de3f80c34456a5621cdaab73f788d5a9893b2bbaf68162185f7f09efad07f6609df7f0fb0cd59e8284a8b0dd08194c591dcbbb2519f7540fb04ca97bbc06f1a44d4d +Signature: 06c8b4f82b1e5429a07857ad5a1753f1d7cb43b345bd935a1f203ca2e69fcbd2321b295b1ed3c2a2 +Test: Verify +Message: d0b56cf1a2bf4845544090bc5440efaf864b8ba6205a03e5cbffac3af8d50d067f28988a7fe0ab7472b3c7aa8f8b0f5664350432b44c80168f65f0bfb07cd6e11b9f7e70f7d9ff2ca961766b33047f2bcbd0f458bf02e95a8932e8e22ebd69f6dc73953bc3823d8333a21597f8833546f374d1aefa5438c9f1be0b3c2970c05d +Signature: 035b9d105cbcce5d24fc186ff52ca07663ca774e057e6de4f5cba8df8b24cbd361df4878c6ebd3c8 +Test: Verify +Message: 82f8b357919acf5ac548e01bbe97782acc131a157d1b616364ff6dd32c5993d1dea9453a6f343e518e1ef301abc636554b632d368cdc7363f3ec8cb67e768e95e6260eb7354a491989ef9440274005b0c31b63ac0ef54c3081efa52d6939470433a8e745fa9346a94ff39b4e47ba3d31cb7495f11c1c44c2a54190b0055a1416 +Signature: a4e3cd2cbd2151d2033d0a56fa7d388af1e050efbc23bdd5fd17061234244d0a9511b84525e719bc +Test: Verify +Message: 5e5dc7a9fad7608fa377eee0d126a5377bfc0b9c11cd19b3b7f88f25c36c984f78fb9f2a05e3707bb99a933b88dae649c4ed794e143aaff1b911923d02b3764f0da5d244bf375b61064f62854e7b6fcc42371f85c57b3b562f891aaeccf5396c93f518cd23ea579b032f12941b2279186e71b4181aa7f63b91f7df51194718fd +Signature: a96a7dffb16216ec93857df38b10fc73c4792e61055a3d5c2aea3e5193113b7d0bfd81f6c3b0d01c +Test: NotVerify +Message: 9f8215298027d29e4128e75b86e6343bdebfd7f0f60bf417ff57c49a5ce1e14b9154d0be68c5cf6765ede1f56ca818eeb1af228be19217d68ef98202e01cad0b7a7f328eabf3bfebd6ca2999245ab4c968b4a13e52a6f96cd8ef99d0e1c17f8f347d5352a1aa39616e36d6fe04f1a104db476cc0a33e3210b4b022bab7c9ed0f +Signature: 7956b42cf6762bfa1d84425dbde83554a598caeb6e3298db6c225befa59a9840faab00f16b662ca5 +Test: Verify +Message: c196e14d01a2abd6dc046801d766e076cae2539afa2ab5597af92c35c4bbcd8f9378923503069f2dec6fb6c17ba1f7cc1355dd4363417607c881e2e9e5430ffe80b2b326a0258ad7e589d22f270c043a530cd480823f6bd35a23e357aaa804d2411c3d360f58e66c7f29b56314017e5942df2f698f7c0b56eab727964b4222a2 +Signature: caee28fd1cc548ceeb7141e3255c6043751425f2c344e1ddfe08ee2d42ae77391ed03f9baa195aef +Test: Verify +Message: 7d8df5288388272a7473d757c078a6de15994fe827c215d0bf2f6aa50701e1e2141c566cb5445bcd7b78e6b0098d399c9d0f12f5df541530eae276569803ebbc13a7d101997a9d488f4686b7c98b7130185c1c4f157c8fa42ebac032ee8a852891e5c0dec862c513c9950f659aa824129f39c5ee63735ba4a36f9e31a1cd889d +Signature: 75bb8dd4118b861c56c6a56bf00f194b9296bb677ea7ca4f5cda2855253f880473d5aaa8196c39b3 +Test: Verify +Message: fca73579a6d91eabb3401ed9b9145c2bc94a7066a85eba514a62046a95485bca536c2a5678659828970d253c9fce805fda30ab5527a0514a7783677b867b0325dbf979ae0303bc120947f3913a615a9717695ceb9ac1ef1cae1d2f29e9d33e6f8c655bd8bd4c41420307c22e0365a4aa790fbc80795849a0e84993cb36e8c482 +Signature: bb488822df803c1b8b424169ebc82e4638af6d567a7d2adfeaff0861631adc4c602a95a7ea8a0c00 +Test: Verify +Message: 2e5dd807911f65df6c7b71c9727137156df8fe02af3c1e19bb1d51cb35e43d4e07483eb5d5a1784ea46b1d41c6fefc66088c4b661f5bb5165044a710606dd893bb43179de8ba59472cc902617d20744eab2cd621ca4e26f8e2578299da47b24ca247faf8a0e41f815e8eb8617150b785acd1376a868c8878c94c799e7debe530 +Signature: 02bd342623b4f7cadbd88af72c8ccfb29f85042d4d2d6853d6a7769f2ed879fbed85cc6c7440fcd3 +Test: Verify +Message: fd149580b4d7b1e3799006d6c37974de79658e074d2d1cf4585ed124f7204986e569464099642cbde21cbaf5c16d0a01872dccde2f96bf81fef7711c599b37b0e6fa6fd3e71ff5c4d359e4ac36258e37cb5bbe53d7992d48c8ed42f90fc60e793a1d88d156e00510849ffb94da79f7987d49dcfffc0e5d60ef98bd52d07ac6f9 +Signature: 52c97e4fd456b9a2141afde95fc0ebf4ee2a509f274e31f5a6ee2730194eb09532d7c12583b2413f +Test: Verify +Message: d1197e08ba9f4654452e42783e664e3c7ad5cd9de2565149c0aa8d5a49547d576cb9d369da79a5da560856d33e91c2565b0cae7ae59e6ee7da31d891815469b93954b621879c168e5f4a8e84b313fd3d3a5989eb828b493039bc33dab88749e3d12200a9dac0f16afa2dc303b3a557e9b0f53668d1d5381b748477ad07a573ce +Signature: 41b31f1faac06a781ce424ab9ec6cff44f1e015bc7237a3019af5d73774a0b60345b6ed2293b7fa3 +Test: Verify +Message: 78cb9e8764eae88cc7bcfecb525617286955348da2e9c0958124677a7285334108c0ee2475d0b3404940d6806fb5f7c965c06166bbe3a9b7cfe18316c74be80acf4766af95a4c765011ce6b839e8cd90d58a139a60d675f60f42b421c570ae2647fac001bb7d5b5367e8e44da806d2d6324a03ff87db5ea9b9e0af75630dbfed +Signature: 62a367ef341b27a22c1ecb52dcfc34180902479129796872ce1b0cdbb678fcb0df10b1f37da5ac9f +Test: Verify +Message: f0e673b363e13da716f3288bf4b4993d6ff109e72a28529ce9453a2eb69b3d5256249ff7ebfdb3e3ea1d659040550e46c08d7979d03d3165552a0ee8db63ffa0097b19454508e148a35cd6ad14834226cc7d4371f3bc14f391e1a196b3b44be0e361f854c7fa5f0d18299399c635cd1469387e86eb9f947e74e20dee9785ba4a +Signature: bd8054b1502e66908555110fc569ac6ddccdea0285a04c81b9ed46ff160a26eedfeb4a8255147239 +Test: NotVerify +Message: dcbaca556bcbfcc70d2164b348b037467071dc423c11a549aad8d06716ddbee49668724899a84daebf96084efb29f246e7bb6ca967bba2ca82948bca7dde246039c4e8e8cfb593af694f197d6488e164a41f46c8364250b02d81af4cb6f2f9c67da6254d454c4860c3248e58bb277c395d7564bae2fe299263753405f972b7af +Signature: cc52d6498a412d0b801d243e37a0291644135294bb91fd182f3458c59e60725b21436a401d534497 +Test: Verify +Message: 901bc4215934ede2f6835d615c38953a95cd48bc09a249a30edcb412b37f5cd4c9ca75d433d383da706382886614579471a97647acaed5377f511241697fe0c90f42b735865abca8dd1beefcef86930267abe2fd143ef25c6f79e2b86a314a0e7b3ce23ee90271c35661f9b58ec721fc8f8ae2d6d88b768cf70c7e704dce721b +Signature: 69fe1c37cddc2db194719f80d9db24c60618f5e99cda4d645d1be7c3c4ba192c5d8606dc9c2cdc61 +Test: Verify +Message: e524024ea5f5ef7baaf30efbfadbffd9ca00ccd03d91c23a612e8d3c67ab933023239253c4417cb0d5cb934c7370c193d0d23a03e8d75417832da6766c1c605df090eb4a9966c1ea2cf68e45e0e28828e11f0bd305417ae4ce0b5283a0378fcf438243899cfb75ffa88e383cbacc0c6ef5fd7a970c68ea7839e1c8bb7c94d760 +Signature: 41bfc6a00915f9a7e24e0d4a7a1220aa0c0f3127b0286f8333c9b002a4acba9673717ffb09368caa +Test: Verify +PublicElement: 1dd203bc368c505fafbc02d560b4b9f003d93be0f78a11fe60e94c406890ce920be3fab9d9ffe84b80f3fdb9071dc602d7c8165fb62e346847b3918d450b3dcccb4bcff0ab98e3052ae36d1a65caa37c7187bb620c5147870ef676091f5199be871dce4fcda065da9f3568fa70edd637450acaa7e42f128b6a3a0519d86784d4 +Test: PublicKeyValid +Message: 691699d5c945a8508a41c3c83f768406a904e3bcad75c75e76becc40e67857f0435fd8d61f0b5f0b88ee6276718fcd2d60064b0b5ab7d48d0c5377f23b0c69936d174f80d968c95c8ca93f7bde7cef3914f2379e574c202fd5f12c1735af62774136970acfd2fefdf068f20e5cb403e31dc140ad7caac5fd298f84e6aeda5855 +Signature: 9c2687d271c475a3ca252997642f12c2494e6e1612ca7c28dcebefb178a72071de741a27699cbb58 +Test: Verify +Message: ad15c247a6d92417670bb015e2c56b2170d449feaea127d898600517e37d88639f43b0f80ecfd52cbf34e83deff0e860208fa308fb9eaf7463d2a87cdb79ab9c1a221341ed8973544dc5d405c0b530d9f5a72ff69a4b20af81d83b4bf47c151b560a65bbfbdff6a74915ec020fec3ba325746462458072a12ac8351de75dbef7 +Signature: 3edf3214d7492ead518c21641cdeeaf11955cf2c9fd41dd6990a3d93b5b996dc65b4480102910be6 +Test: Verify +Message: fe8aa91c3ff17c55cfeb6ca7d7934f00e1ea15bb63b4fb9d8a94f410486b559ea1eebfb131865289026c0f7e8d058e780e7be2ac0d9dca9929f91942283868ad3cbafa9c9872ef8a3303ade9dc1c8b9b7f11c0afb6ba8b5d9391a444ac07e4e2682730548a6eab50fbe91c60dc909d61cce2853b76c398e25f926e8def8f2136 +Signature: 454f59ad954b584350b19484ee93f3fac35e5a21025acec86b4d2cedb998a838f9c3d801acf7ff52 +Test: Verify +Message: 53bd313ad31f55de5bf21a35c1a6291bca8e6e0b206736489726884da107c1770fd273f10a707fe051af70d0b5521b5fd25d75280f9fb5f2d880aa1a1b0c5e3e0140ec2bee959f09bccb4cc633f7f2c0ccd08fb6a73645f0ca04aeae9c177ccea19f55c277a5eeb212dd66ed34aee5963080758bdf452099e34a4bdf1b405280 +Signature: 7408d817a92cce7b17409ca4a522ee8d2a05bc6ab21cfaa6c48819dde84f86090139f18c389ec906 +Test: Verify +Message: 8d67b965319d7ea31ecc8f7538b0042c8175e4de45b0eb7d869b9e3aaa918d1964cae8d5e05846f63261b131009ef5006f152a824c137f957c6c4a31a6f64d081e444b5c159fcc20004b2c5245f8ea982d862f1906fd9d9f98cd5beaca425e57954bf9b22a6ca8585f00199160b47c2c93410c5ccb69ded3b135ea1d706d573e +Signature: 3c2251163492bf6e777793020a5010959d84a258b28ebc211aeffb54f4f99500f88cf0b2eee180ca +Test: NotVerify +Message: 8fa0b50bd675f973a529cb90f5a7be4302794ed969f31dda80a16e0ef6efe2d1ac177399d350aec5463535a82a7374d6c4b7a3ae9ad7fd28cd3f3fe0b69e6363c0d29eba861297352d5bea7a031cddcd582561a29dcd4c60bc63d678b7d751a683a92d8727132c5c1172e11db8fb6fc2789b80cdaa2e841b03e52ced2ff12632 +Signature: 4d6e667824358fe066bf44377146bf2f5f2d92d2adc0aa673fc3912c3ae67bf8d0c529fb1c25776d +Test: Verify +Message: 17aeab19d1ee54e4aaaa66144a82f1a348dc53f8f1fa9d1b575c44389e580c5883f8315b2d14d83838b1b679009800f12b3a92c179c4638ad07e28f4836a475fe21900e908d0d6a0e0dc44097a339ed18d4c45d24c400f496e22f556789bffb54dca6dbbf95b2794bae667bb508aa4bb86cac22401a779d049ff035715250ad1 +Signature: 570867e6fd129769612e82d31a833ddfbb9a07833815df754b1db1c729e7a85fa4bee867dbcd42ce +Test: Verify +Message: cbdcecd18c9984a189ddd576261b6aebaf3030639731cd79ef7a3faa2af4b9420fa6bb84ff7f701d69624ccb8b73e6496ba1137f157444e81618224339ab687d81c300de67436173556028bd62eff59850f1896dc3611d9cc43c052476d28695174df4383a7f107c43f0a0a4232750af5539c98719900f6ef0fe20a65802cb60 +Signature: bed7f5866b9ec24dc7f0ec818262aa7a2197926c314a353cfdb5d11c7e57685ddc0c1863b7915521 +Test: Verify +Message: e8cac9ce0ef12933d72bb5ec654590ae24739b0b378f75d32293d3acb85902ef4791b9c603032484b0072f45944210c79ca21787cd9dba1feea5dcdf74ef5dabae66e81531eaf9bb86ce2de21390ce5347da9f760abae4ad641eb5f46c9385b6733feef2721cbf8eb27748fbbaa8e40b7d13c80fc55f0c35daf6f82078bd90c9 +Signature: 35dc7ce798a62cf86653c31306ee9dc5a8ffef2a8c086ebe25b001f990e5f511f780ad9d7eeed027 +Test: Verify +Message: 95f01262b79dfb8fc98a0217a661456a8b97042d6dd524499daae53a9a70e096377c44dcee8a528083671634dce0677820eb21640f14a2b4a22b8316e32c98b10f6f2af6e91073aa61a15b34660f722408d22e05d359666567b50e225c8434f655203c46620958279c914bb1fbc65e897ba4a2a96f7c697325a0fff6bb50ae7f +Signature: 9e75e572e76eca4859c954248a01d31921da32e371ecee37eb40aa9c13ca2e65961359e4466e9e72 +Test: Verify +Message: 64414cf10d118df7436add5cbd54ba23e8af55f7f79d44a22b1369ce64ba21fce90cb1c274acee4981062d07d9276ab859debca30814f90b5969a5f3bd1120176ced102775ed0d4604a58cc3f42e0e179540891fbf8d179a1760dde6a1763ef7861d4298288b41e66481d30a2620fd36330b94e333bff649fe2fea1e28a3d493 +Signature: 212c24985e37ee89e71cbe6d6012b89fa181db569227db91fc0b6f557f377e380cc56c271f7cb77f +Test: Verify +Message: 8dcf3f1d21a4d1e15238b6db0e89798e66cc62b60e7d0eee15a550a2e56b47387ddec07aee02cd471418a77a9733c21b22f82ec5e1b4365741a533dfe382b1c3e24cc6314659aecac89eab8ac93c1cfb8d4edc9abcf2de891b95067786844acd32b0091b21c2abc2e65f7be29bbdc1862066230e954c3edd1a0e8044c68a49af +Signature: 7add75db81ef8d210f6dad09da3d11381324430bc473f003495c0288a42fd93957dfa5321bdc3d82 +Test: Verify +Message: 0ee654428677f6fd59e6cdcd1406dae8f753dcbca966a88e1db8ab5abf9bbde6e47528287040f8dac93f865cfd023fca2f9dba5d4725fa07da6b004a57fc955a73595573d773007c096afddd9987309e8c78fdc10dca9de053aca00bcde3c3dc9508f5dc1409a41bf1e04c0a408d429ce85abe9d554f285260f3a4527b46e0a4 +Signature: ccfd740744131a05fbfebb26edf96572d3475d6441c042287c109e0aaa4e9db694d074889cb55dfc +Test: Verify +Message: 1a21fb1ded7d167c9a590c8bfc4abc10ab1aab159476b834d9d91e24ebb8aa84e5ee3ee72c6b87214519fbd2f70f1630a2fad519dec7735857966237e8db8d46f6d6cd6b0f36aa2bc4095337c4e7e03a3a60c6e268a29b2d846f0cf6d33e1cbf04b09fc1cf37f631ce010cd59b2b91c82b2376896b5ea94b193c1278e438ce87 +Signature: a07b8566ada6bbd54b5fc36b4a3b698cbf60c1ee912a5197ba6e98bd4777a884d6bc66022020de8f +Test: Verify +Message: ffc7c4abcca3dae4c21b311e6fb51da2262e53dd491ed515d6cd216d34549a1c40f836ea93c36aec17645380c949258bd0fbd9f2bfb9135727585115615a5a7e9a4ee6541f678a86eb60e72c6e8f14c4a04848af4675cce784732002a42f6c6c25812be108c8132956c74718f6c0c0c5adcff80a7689d93c05d5e62c960aa95e +Signature: 60b09ca0f393d3398635c5075d114429b6cdc8bcc7e66888f49148be9a9f96edc5014b106de6afe6 +Test: Verify +Message: 88fb1d5c4fe552db3d7213c906f74702fc102d41cfe636138ac123fbcbce5fe743319fd36e4eb8bc9355c0c7fe0c69b27de19a7c182f4e5016d0b2b82de57aff08e284e7ffdcb18c1217009826cbeba9843706ff8fe9d66ac64bf073fa7253cad02307f07927f625b1d10994f6cd87bd0b2aac23acab8638934a1485ab0ea11e +Signature: a4e8a3e21168f000ced52e3a35573fb6ba82eaa164813969ad388163d2cb861f472e7cbee985e0e1 +Test: Verify +Message: 4593c65d5e569a3d1369a916c8e6d4f541080dc192e7e51447745056d5b7bc1c404852c00e0d8b406d32f75ca06e4aecaf74a87f4fb7323a0f63d1efc598427c38e963670f15bcb7fa0451151f05a724c747141d49954caf37562916c8c4ba7a866c908a38e7445912d74d781b240055e078e8d457f9492b1646ef03b5b43ccd +Signature: 8c8e17b621fc67bbf36704f2356e7755d960fce3a52357c84b778376dcca9f92c91b9be575daf7b0 +Test: Verify +Message: 6180fb71de61a23cbe0d4383386e0170da515bbd67512b41ef03e0bc2d63fbdf257fc89ffe625fbb1d43da8c84efd80d6974322a1a0ffd4d1158c02753acf7bc0edbc8b2721304dacf0d6100f176f6efb9a0f8c8fd69b385a16cccc9f667b5ea52ed7141f14c8ab10cc1507638db532f012d232fc6384700d7977b39ce6c2f82 +Signature: 4156c005b5e099e4cae1d24a4ef35ae0749e4cdeade8929a74ef00f4f57e18c864ae6a376d8bdb55 +Test: Verify +Message: e52be63c5733b8e9860af61ee50f73e7f679522cd72f31af10ec93469c938e5b35d0b7a1e4f14b18c9039f442831caa9b659908b22ef92e4e617b4a54ffecf32ca7a981872e2d011d72fae3a11538a9306d9cbb7f8bf12de5291a710b3c625ab3b5f621816bea1ca48c4fb78b82f0b9b7e32d92a71560994ec9145ffe1a4e7c0 +Signature: b07e9d17a45cc2ceeb1fde1299ba0d6b3bcbe7dcc50e823d12ae5d86972fc6e21d499d38120d7638 +Test: Verify +Message: 1b223eeb3cebfc1575b37c5eba339ca55ab86c9300a64fcfe94d4f6467f1c06f9714190d5f060f84abb0f3b0e89d4db0c04abad218af03bd480d7fdd9afaab1405ab079e2a82334590d84ac71c0c7f85d4ccf76dd5a3e62992c4ec894f15b22edd7fc0789775a2b29dc33c7d5099697a0ed7db3b2f9b2f6c40084f3e7e590d15 +Signature: 199d5f32d2645a1d46ef1cb3ecb15a34eab59b9a8c3cbf5810966097bb9c280e812c22ac298e156a +Test: Verify +Message: 7296f7fd229c0893a84a5b7ee87a034416e5ae1edf1e7416d6c9df5f20213cf564aa2175ed32403f220e6aca2893e747d5d3f579d8999ed427a7bfd5aa2f55a1258f0be16b5102dcc163e0d790931baa504e87a3b1991ea00b501067089f0b498fbeccf8f4f1e7a55fbfd35d7a7239a55fcf7d55c0178eb2583eebcf936af626 +Signature: 5e2044f956599ab077c91e0f9f9408dfd3c458c61fe6edfab105b1f711919c0b43bbb7557252b193 +Test: Verify +Message: 7279097dcfe09b8615d3275b713dced645da08ef435fe783c5e888676fa3daad07bb933594886f78b6f4ab914530c28d2e9967f48ae5c398ff92f09d5c90b6c9702d850d2b42b355f89cf68d5aad25f4c5742ba5bfaa4c62372e9ca425b3bce164a8d81dcc67deb494a20066e60b6da3c4434b191a06f87c249482950362658e +Signature: c2b345d1c28a149215db60952dac2854103f0260bd4994a0b35394474ab82958d7ceb406f6285f4c +Test: Verify +Message: 7c9b50842db0de693441a2c13323de1369e251c07cd49c41877ff69b672d142642ce53805a0e28cd11b7ca313c491e8facd7e382fa241e9d93ffc8df05dcb67a89b4cac6d01e587f12aedb47558ed958fb5b14898f43f284d15c2f46ff47c1d866050b4c2a1947fa52df2dfc172ce9e86d273ccdd368f070584f82c8eea60bb7 +Signature: 363c61fe40b4c0a4f06908df5c46d8a9c98dee71cd1c56f8d7a16c081712cb1b8c92cfd00464a3e7 +Test: Verify +Message: 0bf43670b5fe01cb48e75a19b519f324451ccbb3d85d8ef15c41311b906aca6efb48ad5027e4cdbd23e951f538f47564ea1da4d133c6d4cbfba32151db0aadc1137db703c975faf58471481ae93f677fb48a2ceffaa5d6579d97ad7c1067dbdb4da98ae01349404c659777e04093804f9b7b9a63a5934e6e3a340df4a7180d96 +Signature: bbefc869907609019f4a85294aa854961e51c4884c235f4cdf85c4c3e0ff34069183ebf0ef50bb9f +Test: Verify +Message: 419ff761987d7257a0bc8817abb4077986972726e6ac93f311cab67ac91747fa7d021871b37f1bf8b082b55e6bbf4709b1a0fa099986cc7d2b44d82b4cd9ea5bec6e43f47490a9da6aafb38767d753e83bada47a5eacf6a59aa11758f665e4e6e7db1121b22a35b5253b19c7767542ce7bb7bcb10c972922b6da0b3aa1334e56 +Signature: 29becc5afb5ea31a71b4169b91f9594d0819de2d409e4c0c3bfe8e2ea53e98dc1ad4a72f3e3081b9 +Test: NotVerify +Message: 31c4c31942471dd6583810807472b62ce7cbbddbac7de47f08d7bb4b6024973f5adcd3f4380a4ea571fd227f9133a22a53829698fc88ba0dfa55746fbe58d6d0d687d43a4fd3c7ba4acb21afdd8f72542df89c8cc90553ee4989d8112713f619dd1e3d82407a7d2c1cfa87a8115f20c1ad84454ecbcca6382bc95dc6532eef31 +Signature: 3c999e56f7ba49e48cb72c76bb7848d4562aa96dbb8c5a3adc19533b00cb2a421fa107b0b956452d +Test: Verify +Message: 64a5d78514c2e26b011e7bca8ae480a2770cb50b03bb6fac29db817c30fb6bb87a68c225898ddb885288bb62c70e43f19f8198646850d15dd08ee5ad30d6d34b595e1395a4593dcb3493f8c98e4825055d454dc87f4249b1537e3067469c869e9cbda24d7cdf602d3f760876fa497fd5498facb15f492d9f4be23c238d05dbaa +Signature: c3a0e8c6df40bb4d672d2438f4f770c141054f1e0b6cd25a0f9d0de138d6c8eb028ae0b23dbd2720 +Test: Verify +Message: c4d9d647a62a699ce00ac9c55b2197a796fd1e8e2120f2d75a50cadf671a9c2c74a8f7db2ec5a549802e81058d1c95f6ee0e78c92ddce79e82f9a3f3cc088ad0d3a2f934bd6661c0ce4327a26402c2c432171036bca8f8da13df464ed36dc31f5a5f942b4a25d55741e07673d8ec556adaae9caec69f5ee387996dca72617e71 +Signature: 1145693d535af4e7b13ed5801c2539db279007dca94800d15c4f2d184c71cf793feab7e46c52121b +Test: Verify +Message: 9981198067ce9d394f53f1233ee06b86075ed7d61142c04f3e54fdcf1ea280f454bf5b76494113c6107a2ae89a76e78e1b356876bc2aeb0582f459257e5b145b368e022d539bdab38d2fae7cd490baa4c1d86b333c74b3b86edd8c25e995cbee1664275ddfd489399eea969746277b00d0c0f8c5e919b09eda88af89b7473ce2 +Signature: 57f2c2fd72f077ef67ceaf46d99753bf796a4712a018b08a786d4c40136256ac0a8618db7dd1eb28 +Test: Verify +Message: bfcbe3e18f4423b9f21b33fadb4763c2e4221126f11b6c79099e6bd9714008000a2fc249edda520144dcacf16c2e3929488e540ee82a03a65c92f723d2dcc6aff61967778bf8eefa46b98a94eb55bc45aaecd9c7bc6fc3d13a8ee4a53de46be03c61cb82a2f8703cae8bc4fa901362b1c2149a6aa440258f5b6a2a76ebae712c +Signature: 5c141ab2f4ee5a513c4ee7e9a5e770f294859b1f6551d44ed78029dbbebe181a73e2726f1b553022 +Test: Verify +Message: 839331e55e6928503c36c0530394dea50f46f78d7bd8fea1ae7894c02a136b4e91b3fbaff91869067196b42fd32e22fbcdf0eaab2b9023af6747ec9f73eddd7bc555ae1fa4e8260ab2844750ba97b8ddbc7773ec3705afc6b68310c09eb20d6f362fa22ef71038d316bad1ae500678c2f594e847386e7c60b6e157194499d4a4 +Signature: 0ad3d7f5ea209ad35ba4a0a17e16483c50f5e4953a692ea71730d7c5c4c13feed38ed90759aa2e86 +Test: Verify +Message: d4fdc830db8cef7540b6b3ab242cfe3bb59004a3f3c61b60a37cda1890fc7108093249ae98f9dcb7ffaad62b79e76dd72fa4fdfbf878e8355523aeadac5f4882c5ecc97583d638d5e309a8aa3a189925ab4a9348e7e601d129c14b6d7005381bff4383dd13bcbba6e4ec6081df583bfe229afee237aa1d0e156eecb05485f9a9 +Signature: 189c08e378bc9feb81891706f80a9fcd1f10725564e3814342937391e39f8830eaed6702b8579e3d +Test: NotVerify +Message: 3fb043ac04c26a1d06fa3f3638e0ab0a218b5a74c36243f4ce1278c606d02b44f1d1027ec6069c17931c6463adb495be5de08e2fc8de583e1f187513085bebd04d579130c4589a607e445f1e33d57110ee17df67f524c4b4fb1f150a896fa955aa3d8afbd6307bb12168c99fa4b957b72c29e45222aca00dba1eefe460827d8c +Signature: 65ab093718776e0b945e5fa24014468ee40422b3688c00beb21593dd4785c90b350e9471a5dff538 +Test: Verify +Message: 155f0682c1d481571fd2d93a6bd70e5e2a6fee3702270f03d7b40d9c2c65057eb8c6521448968747d5ebac49e5a4be9f270f616d49dce8061d4287b4ed6fd7c41c368bd6fef47163f9c3ac8fdce330317f657e209c19a2c1eeba6ace8858e86877072a609cc638c2c3b24fa3086c5d2d6cc7bde8b3b6344b80762c83b4f73082 +Signature: 90e0b86567a2b176a74a817d52009c2bb553eb9ac3694f997c5f70ca3936b6d57f1908868ffc7518 +Test: Verify +Message: 4b03e4a77dd910d51e6c170faa228f3d5c258c96bc44cc986a0d244629292ca62ff8277aab6d353e982bbc62c1e113c815e371812d0916c41ccdb83076a03043a38c651b6511796ba83933c18afdadf6abdc3ef6b6baaab230f6896280d0f50040f97801c37c3456e7cd54a31c2eb3bfb54bcc6c6e0de2583fc270536071d3d3 +Signature: 999adeab789df72dab3c86e115140d0dbb4905adbebe59a1995fbc73fc678a8ca89d7b6cb644569f +Test: Verify +Message: a59d6636f5dc1fbe82ec2df71a90657f5ccbbcf1af6e69157de03b45b42e3c227f53877942c96770d450b1f500fd64683e877e87aece219a56ace7e19d01823b07f9981733a1dea012aa7324697c7fc68a7e0c654fa524cb573b2c1a84f18074b52850eac17cbba7b4932a5e4d24eef1b84b1d62880ba9fff824c2ca63186f26 +Signature: 30f81281e18c995d53f02e6d04eb988bb0b8bd3f1af1a7c8447c704f06d7379dae2ccf95ec13edd9 +Test: NotVerify + +AlgorithmType: Signature +Name: DSA/SHA-224 +Source: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf +KeyFormat: Component +Modulus: C196BA05 AC29E1F9 C3C72D56 DFFC6154 A033F147 7AC88EC3 7F09BE6C 5BB95F51 C296DD20 D1A28A06 7CCC4D43 16A4BD1D CA55ED10 66D438C3 5AEBAABF 57E7DAE4 28782A95 ECA1C143 DB701FD4 8533A3C1 8F0FE235 57EA7AE6 19ECACC7 E0B51652 A8776D02 A425567D ED36EABD 90CA33A1 E8D988F0 BBB92D02 D1D20290 113BB562 CE1FC856 EEB7CDD9 2D33EEA6 F410859B 179E7E78 9A8F75F6 45FAE2E1 36D252BF FAFF8952 8945C1AB E705A38D BC2D364A ADE99BE0 D0AAD82E 53201214 96DC65B3 930E3804 7294FF87 7831A16D 5228418D E8AB275D 7D75651C EFED65F7 8AFC3EA7 FE4D79B3 5F62A040 2A111759 9ADAC7B2 69A59F35 3CF450E6 982D3B17 02D9CA83 +SubgroupOrder: 90EAF4D1 AF0708B1 B612FF35 E0A2997E B9E9D263 C9CE6595 28945C0D +SubgroupGenerator: A59A749A 11242C58 C894E9E5 A91804E8 FA0AC64B 56288F8D 47D51B1E DC4D6544 4FECA011 1D78F35F C9FDD4CB 1F1B79A3 BA9CBEE8 3A3F8110 12503C81 17F98E50 48B089E3 87AF6949 BF8784EB D9EF4587 6F2E6A5A 495BE64B 6E770409 494B7FEE 1DBB1E4B 2BC2A53D 4F893D41 8B715959 2E4FFFDF 6969E91D 770DAEBD 0B5CB14C 00AD68EC 7DC1E574 5EA55C70 6C4A1C5C 88964E34 D09DEB75 3AD418C1 AD0F4FDF D049A955 E5D78491 C0B7A2F1 575A008C CD727AB3 76DB6E69 5515B05B D412F5B8 C2F4C77E E10DA48A BD53F5DD 498927EE 7B692BBB CDA2FB23 A516C5B4 533D7398 0B2A3B60 E384ED20 0AE21B40 D273651A D6060C13 D97FD69A A13C5611 A51B9085 +PrivateExponent: 00D0F09E D3E2568F 6CADF922 4117DA2A EC5A4300 E009DE13 66023E17 +PublicElement: 70035C9A 3B225B25 8F16741F 3941FBF0 6F3D056C D7BD8646 04CBB5EE 9DD85304 EE8E8E4A BD5E9032 11DDF25C E1490755 10ACE166 970AFDC7 DF552B72 44F342FA 02F7A621 405B7549 09D757F9 7290E1FE 5036E904 CF593446 0C046D95 659821E1 597ED9F2 B1F0E208 63A6BBD0 CE74DACB A5D8C68A 90B29C21 57CDEDB8 2EC12B81 EE3068F9 BF5F7F34 6ECA41ED 174CCCD7 D154FA4F 42F80FFE 1BF46AE9 D8125DEB 5B4BA08A 72BDD865 96DBEDDC 9550FDD6 50C58F5A E5133509 A702F79A 31ECB490 F7A3C558 1631F7C5 BE4FF7F9 E9F27FA3 90E47347 AD118350 9FED6FCF 198BA9A7 1AB3335B 4F38BE8D 15496A00 B6DC2263 E20A5F6B 662320A3 A1EC033A A61E3B68 +Test: KeyPairValidAndConsistent +Message: "abc" +Signature: 4400138D 05F9639C AF54A583 CAAF25D2 B76D0C3E AD752CE1 7DBC85FE 874D4F12 CB13B617 32D39844 5698CFA9 D92381D9 38AA57EE 2C9327B3 +Test: Verify +Signature: 5400138D 05F9639C AF54A583 CAAF25D2 B76D0C3E AD752CE1 7DBC85FE 874D4F12 CB13B617 32D39844 5698CFA9 D92381D9 38AA57EE 2C9327B3 +Test: NotVerify +ModulusSize: 2048 +SlowTest: 1 +Test: GenerateKey + +AlgorithmType: Signature +Name: DSA/SHA-256 +Source: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf +KeyFormat: Component +Modulus: F56C2A7D 366E3EBD EAA1891F D2A0D099 436438A6 73FED4D7 5F594959 CFFEBCA7 BE0FC72E 4FE67D91 D801CBA0 693AC4ED 9E411B41 D19E2FD1 699C4390 AD27D94C 69C0B143 F1DC8893 2CFE2310 C8864120 47BD9B1C 7A67F8A2 59091326 27F51A0C 866877E6 72E55534 2BDF9355 347DBD43 B47156B2 C20BAD9D 2B071BC2 FDCF9757 F75C168C 5D9FC431 31BE162A 0756D1BD EC2CA0EB 0E3B018A 8B38D3EF 2487782A EB9FBF99 D8B30499 C55E4F61 E5C7DCEE 2A2BB55B D7F75FCD F00E48F2 E8356BDB 59D86114 028F67B8 E07B1277 44778AFF 1CF1399A 4D679D92 FDE7D941 C5C85C5D 7BFF91BA 69F9489D 531D1EBF A727CFDA 651390F8 021719FA 9F7216CE B177BD75 +SubgroupOrder: C24ED361 870B61E0 D367F008 F99F8A1F 75525889 C89DB1B6 73C45AF5 867CB467 +SubgroupGenerator: 8DC6CC81 4CAE4A1C 05A3E186 A6FE27EA BA8CDB13 3FDCE14A 963A92E8 09790CBA 096EAA26 140550C1 29FA2B98 C16E8423 6AA33BF9 19CD6F58 7E048C52 666576DB 6E925C6C BE9B9EC5 C16020F9 A44C9F1C 8F7A8E61 1C1F6EC2 513EA6AA 0B8D0F72 FED73CA3 7DF240DB 57BBB274 31D61869 7B9E771B 0B301D5D F0595542 5061A30D C6D33BB6 D2A32BD0 A75A0A71 D2184F50 6372ABF8 4A56AEEE A8EB693B F29A6403 45FA1298 A16E8542 1B2208D0 0068A5A4 2915F82C F0B858C8 FA39D43D 704B6927 E0B2F916 304E86FB 6A1B487F 07D8139E 428BB096 C6D67A76 EC0B8D4E F274B8A2 CF556D27 9AD267CC EF5AF477 AFED029F 485B5597 739F5D02 40F67C2D 948A6279 +PrivateExponent: 0CAF2EF5 47EC49C4 F3A6FE6D F4223A17 4D01F2C1 15D49A6F 73437C29 A2A8458C +PublicElement: 2828003D 7C747199 143C370F DD07A286 1524514A CC57F63F 80C38C20 87C6B795 B62DE1C2 24BF8D1D 1424E60C E3F5AE3F 76C754A2 464AF292 286D873A 7A30B7EA CBBC75AA FDE7191D 9157598C DB0B60E0 C5AA3F6E BE425500 C611957D BF5ED354 90714A42 811FDCDE B19AF2AB 30BEADFF 2907931C EE7F3B55 532CFFAE B371F84F 01347630 EB227A41 9B1F3F55 8BC8A509 D64A765D 8987D493 B007C441 2C297CAF 41566E26 FAEE4751 37EC781A 0DC088A2 6C8804A9 8C23140E 7C936281 864B9957 1EE95C41 6AA38CEE BB41FDBF F1EB1D1D C97B63CE 13552576 27C8B0FD 840DDB20 ED35BE92 F08C49AE A5613957 D7E5C7A6 D5A5834B 4CB069E0 831753EC F65BA02B +Test: KeyPairValidAndConsistent +Message: "abc" +Signature: 315C875D CD4850E9 48B8AC42 824E9483 A32D5BA5 ABE0681B 9B9448D4 44F2BE3C 89718D12 E54A8D9E D066E4A5 5F7ED5A2 229CD23B 9A3CEE78 F83ED6AA 61F6BCB9 +Test: Verify +Signature: 415C875D CD4850E9 48B8AC42 824E9483 A32D5BA5 ABE0681B 9B9448D4 44F2BE3C 89718D12 E54A8D9E D066E4A5 5F7ED5A2 229CD23B 9A3CEE78 F83ED6AA 61F6BCB9 +Test: NotVerify +ModulusSize: 2048 +SubgroupOrderSize: 256 +SlowTest: 1 +Test: GenerateKey + +AlgorithmType: Signature +Name: DSA/SHA-256 +Source: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf +KeyFormat: Component +Modulus: 90066455 B5CFC38F 9CAA4A48 B4281F29 2C260FEE F01FD610 37E56258 A7795A1C 7AD46076 982CE6BB 956936C6 AB4DCFE0 5E678458 6940CA54 4B9B2140 E1EB523F 009D20A7 E7880E4E 5BFA690F 1B9004A2 7811CD99 04AF7042 0EEFD6EA 11EF7DA1 29F58835 FF56B89F AA637BC9 AC2EFAAB 90340222 9F491D8D 3485261C D068699B 6BA58A1D DBBEF6DB 51E8FE34 E8A78E54 2D7BA351 C21EA8D8 F1D29F5D 5D159394 87E27F44 16B0CA63 2C59EFD1 B1EB6651 1A5A0FBF 615B766C 5862D0BD 8A3FE7A0 E0DA0FB2 FE1FCB19 E8F9996A 8EA0FCCD E5381752 38FC8B0E E6F29AF7 F642773E BE8CD540 2415A014 51A84047 6B2FCEB0 E388D30D 4B376C37 FE401C2A 2C2F941D AD179C54 0C1C8CE0 30D460C4 D983BE9A B0B20F69 144C1AE1 3F9383EA 1C08504F B0BF3215 03EFE434 88310DD8 DC77EC5B 8349B8BF E97C2C56 0EA878DE 87C11E3D 597F1FEA 742D73EE C7F37BE4 3949EF1A 0D15C3F3 E3FC0A83 35617055 AC91328E C22B50FC 15B941D3 D1624CD8 8BC25F3E 941FDDC6 20068958 1BFEC416 B4B2CB73 +SubgroupOrder: CFA0478A 54717B08 CE64805B 76E5B142 49A77A48 38469DF7 F7DC987E FCCFB11D +SubgroupGenerator: 5E5CBA99 2E0A680D 885EB903 AEA78E4A 45A46910 3D448EDE 3B7ACCC5 4D521E37 F84A4BDD 5B06B097 0CC2D2BB B715F7B8 2846F9A0 C393914C 792E6A92 3E2117AB 805276A9 75AADB52 61D91673 EA9AAFFE ECBFA618 3DFCB5D3 B7332AA1 9275AFA1 F8EC0B60 FB6F66CC 23AE4870 791D5982 AAD1AA94 85FD8F4A 60126FEB 2CF05DB8 A7F0F09B 3397F393 7F2E90B9 E5B9C9B6 EFEF642B C48351C4 6FB171B9 BFA9EF17 A961CE96 C7E7A7CC 3D3D03DF AD1078BA 21DA4251 98F07D24 81622BCE 45969D9C 4D6063D7 2AB7A0F0 8B2F49A7 CC6AF335 E08C4720 E31476B6 7299E231 F8BD90B3 9AC3AE3B E0C6B6CA CEF8289A 2E2873D5 8E51E029 CAFBD55E 6841489A B66B5B4B 9BA6E2F7 84660896 AFF387D9 2844CCB8 B6947549 6DE19DA2 E58259B0 90489AC8 E62363CD F82CFD8E F2A427AB CD65750B 506F56DD E3B98856 7A88126B 914D7828 E2B63A6D 7ED0747E C59E0E0A 23CE7D8A 74C1D2C2 A7AFB6A2 9799620F 00E11C33 787F7DED 3B30E1A2 2D09F1FB DA1ABBBF BF25CAE0 5A13F812 E34563F9 9410E73B +PrivateExponent: 3ABC1587 297CE7B9 EA1AD665 1CF2BC4D 7F92ED25 CABC8553 F567D1B4 0EBB8764 +PublicElement: 8B891C86 92D3DE87 5879390F 2698B26F BECCA6B0 75535DCE 6B0C8625 77F9FA0D EF6074E7 A7624121 224A5958 96ABD4CD A56B2CEF B942E025 D2A4282F FAA98A48 CDB47E1A 6FCB5CFB 393EF35A F9DF9131 02BB303C 2B5C36C3 F8FC04ED 7B8B69FE FE0CF3E1 FC05CFA7 13B3435B 2656E913 BA8874AE A9F93600 6AEB448B CD005D18 EC3562A3 3D04CF25 C8D3D698 44343442 FA3DB7DE 618C5E2D A064573E 61E6D558 1BFB694A 23AC87FD 5B52D62E 954E1376 DB8DDB52 4FFC0D46 9DF97879 2EE44173 8E5DB05A 7DC43E94 C11A2E7A 4FBE3830 71FA36D2 A7EC8A93 88FE1C4F 79888A99 D3B61056 97C2556B 79BB4D7E 781CEBB3 D4866AD8 25A5E830 84607228 9FDBC941 FA679CA8 2F5F78B7 461B2404 DB883D21 5F4E0676 CF549395 0AC55916 97BFEA8D 1EE6EC01 6B89BA51 CAFB5F9C 84C989FA 117375E9 4578F28B E0B34CE0 545DA462 66FD77F6 2D8F2CEE 92AB7701 2AFEBC11 008985A8 21CD2D97 8C7E6FE7 499D1AAF 8DE632C2 1BB48CA5 CBF9F310 98FD3FD3 854C49A6 5D920174 4AACE540 354974F9 +Test: KeyPairValidAndConsistent +Message: "abc" +Signature: 5F184E64 5A38BE8F B4A6871B 6503A9D1 2924C7AB E04B7141 0066C2EC A6E3BE3E 91EB0C7B A3D4B9B6 0B825C3D 9F2CADA8 A2C9D772 3267B033 CBCDCF88 03DB9C18 +Test: Verify +Signature: 5F184E64 5A38BE8F B4A6871B 6503A9D1 2924C7AB E04B7141 0066C2EC A6E3BE3E 91EB0C7B A3D4B9B6 0B825C3D 9F2CADA8 A2C9D772 3267B033 CBCDCF88 03DB9C19 +Test: NotVerify +ModulusSize: 3072 +SlowTest: 1 +Test: GenerateKey diff --git a/external/crypto++-5.6.3/TestVectors/dsa_1363.txt b/external/crypto++-5.6.3/TestVectors/dsa_1363.txt new file mode 100644 index 000000000..712e5ea69 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/dsa_1363.txt @@ -0,0 +1,553 @@ +AlgorithmType: Signature +Name: DSA-1363/EMSA1(SHA-1) +Source: generated by Wei Dai using Crypto++ 5.0 +KeyFormat: DER +Comment: 1024-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f02818100bd670f79\ + b0cde98a84fd97e54d5d5c81525a016d222a3986dd7af3f32cde8a9f6564e43a\ + 559a0c9f8bad36cc25330548b347ac158a345631fa90f7b873c36effae2f7823\ + 227a3f580b5dd18304d5932751e743e922eebfbb4289c389d9019c36f96c6b81\ + fffbf20be062182104e3c4b7d02b872d9a21e0fb5f10ded64420951b021509b2\ + 940496d6d9a43bb7ec642c57b302e59b3a515502818100a1c379ba91fe1f9d52\ + 83807b809c698bce4aee6f405f4de8c46becf33c08a63bc5f8088f75b5b6bcfb\ + 0847ccbdee700e4e698652317bbd7a3056404c541136d7332c2b835ef0d1508e\ + f57b437de60675f20f75df0483f242ddeb57efacd180418790f4dec0a8250593\ + ba36f17316580d50db1383ea93a21247650a2e04af904d041702150355dc8843\ + 45c08fb399b23b161831e94dbe61571e +PublicKey: \ + 308201b73082012c06072a8648ce3804013082011f02818100bd670f79b0cde9\ + 8a84fd97e54d5d5c81525a016d222a3986dd7af3f32cde8a9f6564e43a559a0c\ + 9f8bad36cc25330548b347ac158a345631fa90f7b873c36effae2f7823227a3f\ + 580b5dd18304d5932751e743e922eebfbb4289c389d9019c36f96c6b81fffbf2\ + 0be062182104e3c4b7d02b872d9a21e0fb5f10ded64420951b021509b2940496\ + d6d9a43bb7ec642c57b302e59b3a515502818100a1c379ba91fe1f9d5283807b\ + 809c698bce4aee6f405f4de8c46becf33c08a63bc5f8088f75b5b6bcfb0847cc\ + bdee700e4e698652317bbd7a3056404c541136d7332c2b835ef0d1508ef57b43\ + 7de60675f20f75df0483f242ddeb57efacd180418790f4dec0a8250593ba36f1\ + 7316580d50db1383ea93a21247650a2e04af904d03818400028180255cf6b0a3\ + 3f80cab614eafd5f7b2a6d83b3eafe27cd97b77ae70c7b966707d823f0e6aaaa\ + 41dc005aaefd3a0c269e60a665d2642f5d631ff1a3b8701bc06be9c44ab7367f\ + 77fefeec4c5959cd07e50d74a05af60b059ad3fc75249ecf44774b88b46860d9\ + c3fa35d033bcfc7b0b2d48dc180d192d4918cddff4f7ebcdaaa198 +Test: KeyPairValidAndConsistent +Message: 66B92E1E2C44B80F7BFA +Signature: 06418D4F24A8059553951CA062BBD6E0833ED1745608E1158CA4B8F8FE1CD2AF087B5EEE08FCA0D7A63C +Test: Verify +Message: 973266BB0A492248082A +Signature: 02BA236FE800EECABB85698A76B5485865454B3016010755F0E1BF7CE26FB62BE4FD01141F5CA4144811 +Test: Verify +Message: 9A6D079ED0CA9D8B40E8 +Signature: 045BA3DB16E6B910DC89A2D26096625F757D62077D049886B85EBC7500884B4DDD1898BC52746C54F68D +Test: Verify +Message: AA34DCE67BCDAC927DA6 +Signature: 0835C94121313842ABF04D4960E711D1F0904612BC09840989EEAFF2071522B75957DEAC801574BD22EB +Test: Verify +Message: 4EDAC08816AFDBF284DA +Signature: 08E1574E5299C910694D17075136F41EBD558D1B1805CAA3B6E98DCCC3702F286E76BBD29435CA2CEA5C +Test: Verify +Message: D82F2E903230962B8174 +Signature: 0366F1AE94FD2CDEBA4EE879BB8923F0E49CFB921008E6A5C7457E88811D46DC7F297D6A96E909268244 +Test: Verify +Comment: 1025-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f028181017310bf02\ + d70ef2cee45d1cc47ec8ce8cabdd6bf32a560975a42ef057bf9dfd553bc9368d\ + db154a55d855edaa755e69f511a4c69ba78571cc4b14ddbb0f32a4a9c56c2863\ + 05aa21ec4e35de7390747477b3bd574e7b87cbebde2f665703137a1172350ad2\ + f48a0884d076ada9db82f104e6b0ad86693cd4adbd0067639102fcf102150b39\ + 49dadf3196f08bca0606f06443afce2fb1d02f028181015f0f6d1729ef2af723\ + c00e36450a04c7e7681d65b74a6417a53b3eb6036989eff8e0ab11a7ec3ce234\ + 0b7c7a92e1a977aee52555c06c12c4cc28496ddc2598feeb7539ce90d3888e21\ + f61d7f14746cf67d9fed373afd97e2483700e300ed9da25e7200b363a4727ad2\ + 01194b36ea5f816cf83488c3e527d3a5515870d2da63d6041702150696b0f255\ + 468b7ac18e11632f208ca86383a46724 +PublicKey: \ + 308201b73082012c06072a8648ce3804013082011f028181017310bf02d70ef2\ + cee45d1cc47ec8ce8cabdd6bf32a560975a42ef057bf9dfd553bc9368ddb154a\ + 55d855edaa755e69f511a4c69ba78571cc4b14ddbb0f32a4a9c56c286305aa21\ + ec4e35de7390747477b3bd574e7b87cbebde2f665703137a1172350ad2f48a08\ + 84d076ada9db82f104e6b0ad86693cd4adbd0067639102fcf102150b3949dadf\ + 3196f08bca0606f06443afce2fb1d02f028181015f0f6d1729ef2af723c00e36\ + 450a04c7e7681d65b74a6417a53b3eb6036989eff8e0ab11a7ec3ce2340b7c7a\ + 92e1a977aee52555c06c12c4cc28496ddc2598feeb7539ce90d3888e21f61d7f\ + 14746cf67d9fed373afd97e2483700e300ed9da25e7200b363a4727ad201194b\ + 36ea5f816cf83488c3e527d3a5515870d2da63d60381840002818045bf83e62f\ + 50190374b23de5e4a1d0278e9e8e6c8335577d62e80662a380c206e326819c50\ + 82d321dfda1f905fa5a3ead9a2dc769885a27b1fd6a133185dc5a7876a76ab0a\ + 09fe02b7071a924169e4d2d2a67e67ed3628800134183b962c0b313463aa154e\ + 6437d644e025ab234e63d19c129842a61c5e5ea5a06466c858c81c +Test: KeyPairValidAndConsistent +Message: 2F585D0CE4FA1CD93880 +Signature: 0643ABF8D3C2F4BAB02CF79D698948A1A416BEC05D00F33CC3D41CA9117E6CD99E5DCBBD4425DA12E98E +Test: Verify +Message: 4F09A1F217B8393199EE +Signature: 052DE620B5628EECCF7C56410CAC2B72A5AD1B5A67072ABF369453BC28A386ACD5939C9985C09338FD03 +Test: Verify +Message: 03D7110A753B008A76A0 +Signature: 01D44D16B5FDFB8C39AACEA72391A889EECBFFB5E701EB8F46E4FAB96326F73E0CC698E1F66C32FE5C2E +Test: Verify +Message: 129F4781D417671F886D +Signature: 00CE142CE967BA951B9DE26DEFB5B341CB49247C1308515315449B5533ED469B6470C4E3A3751E35E7BB +Test: Verify +Message: 3E1594F559D1248D1112 +Signature: 07B192657E256B60567BF6EB399D8A2DE8FFF7AE8A031A655BEC911A82049155CDB4F2A76A8004AE646D +Test: Verify +Message: D6F0354F1B6B253B6997 +Signature: 07FE18E0C00F6AC3CBCB95874AB66A98E34DF74F37059178C920C5D13CE173B8D2832310B9587940F6D9 +Test: Verify +Comment: 1026-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f0281810250988282\ + 17d00108030801e5f135fc6fd3010be39e49060a96addc8a081198803402c4b4\ + 6e4ce0750fcbab8cf084c7ca8cae09f1b5482d336fa3af47b96791d02d8143e2\ + 74b1325f2213e17f9384c805f479e52a3117cf84869d395f1bc025c918484478\ + d2da1880d32bc519f4e6b2fd2d46958795550ce1765f725626f3fc17021536bb\ + 68cd95dab195f14c4534283e7ea50b00cc31a302818100e2782ad6992f4b7e88\ + 787b4d616744b60e095575a177569c4a069e311e38b7240c43343367e23574c3\ + 0e4d9f05afe1fbe61423bab715915c4ccf28aa0ed2f52b092b86c8ec1f9d4795\ + d6e91c88ba41297625c11a9e1f4f182da13cf51e541038a1266bf32b2dd81ecd\ + 84bb80be8fdf97689942e944b7fbb6981e00cd680ee25f041702152db270c284\ + 328353f979cad99f4133c53acaa6ee71 +PublicKey: \ + 308201b83082012c06072a8648ce3804013082011f028181025098828217d001\ + 08030801e5f135fc6fd3010be39e49060a96addc8a081198803402c4b46e4ce0\ + 750fcbab8cf084c7ca8cae09f1b5482d336fa3af47b96791d02d8143e274b132\ + 5f2213e17f9384c805f479e52a3117cf84869d395f1bc025c918484478d2da18\ + 80d32bc519f4e6b2fd2d46958795550ce1765f725626f3fc17021536bb68cd95\ + dab195f14c4534283e7ea50b00cc31a302818100e2782ad6992f4b7e88787b4d\ + 616744b60e095575a177569c4a069e311e38b7240c43343367e23574c30e4d9f\ + 05afe1fbe61423bab715915c4ccf28aa0ed2f52b092b86c8ec1f9d4795d6e91c\ + 88ba41297625c11a9e1f4f182da13cf51e541038a1266bf32b2dd81ecd84bb80\ + be8fdf97689942e944b7fbb6981e00cd680ee25f038185000281810179b283f6\ + 7868aeded3a0c5633d0e6c18fad77174e2c89c03452593d05e77a9fb029c0ccb\ + 2b6f2328e79c286ee392713f12d9d45578348383b81d11b0e0f7e89965a7785d\ + 5ab64ea25bb73e8acaa8e84cb9897985015757a48c0b1dac3a6a606fe671ea07\ + 3ec434a46f227b8d4b02a46fbba2f6c6216736d669f55778d81004d8 +Test: KeyPairValidAndConsistent +Message: 7E4F2ED4E79062778A2D +Signature: 03DF91D560884BAA90258F0F78A7AB61F9A4A5CF3D363E8DE2EAAB389B9492C2B80C44509BF2372BDEE0 +Test: Verify +Message: A0E35846B5CF1B5BF560 +Signature: 21DF9C60877B6D7F531AAF1C39122779436029685109B2D736A45F51A80099041AA5F118D7D6025AD30E +Test: Verify +Message: 3B138785EFC6F520EAE0 +Signature: 10A38520BAC07202DD1CB5A9C88B15B9579B9A1344025E4C4B9D1BC3AAA8C97AA90121D52E42E59A0A99 +Test: Verify +Message: 0F6BE2AA764B485145D4 +Signature: 0233267173F284737B68D15A500D23F3C86988E3DB28DD55AE3DFEAAA7251D354CB44315D6024CBE3E36 +Test: Verify +Message: 6CD9FBD23EA58826FB04 +Signature: 15A1B0DDA6BDB62D96AC557E3F1F24DCAD0C51EF3523B01EA2A8FD93761D0E4D070BA6352A81F31B776A +Test: Verify +Message: 473A82649565109E9E89 +Signature: 1FE31C3A3EF6F57DE2586A5F2EBD48A5C707092D230E1D217EE0A752EFD9ACA8BF0B9EE9424184B8F8F2 +Test: Verify +Comment: 1027-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f028181055402a8ab\ + e9cda3072ca8601d68032651feb0335856e57f8f8d4ec949098a6459151cefee\ + f91b7aa733668c8cf0e9b96c93c61f3528d4036daa6565646f65d74c4552817d\ + f7e5fb1cc421cfd885e27bb811ad227e81b3fa02f7a00bf01ee6e23fb5572a75\ + f8f29b58bd5f7db435e8a92a923f15d50f34213d29816921bf195b2d0215291d\ + 0ba731a4303070504d8b9615640a5e1345e00f028181051c9d0270b69ceef82a\ + f5aed5f91dc88d585096609d835d03d39cf3ce74f5a3402d4e8e192455493da6\ + 1cc58ee6f54dd941172be3d7642169cbc52273f4b725f1d6c820c3333336c64d\ + 32fb6238121b3ccb7c71b847764946bb0887a44ca9de802cda62efa9dda57375\ + 1084225353f11ed837f3dc25de8374b6fdbfb6e313e46d0417021513b27094d9\ + a5a3a9704cebdbe890da325fa26ad555 +PublicKey: \ + 308201b83082012c06072a8648ce3804013082011f028181055402a8abe9cda3\ + 072ca8601d68032651feb0335856e57f8f8d4ec949098a6459151cefeef91b7a\ + a733668c8cf0e9b96c93c61f3528d4036daa6565646f65d74c4552817df7e5fb\ + 1cc421cfd885e27bb811ad227e81b3fa02f7a00bf01ee6e23fb5572a75f8f29b\ + 58bd5f7db435e8a92a923f15d50f34213d29816921bf195b2d0215291d0ba731\ + a4303070504d8b9615640a5e1345e00f028181051c9d0270b69ceef82af5aed5\ + f91dc88d585096609d835d03d39cf3ce74f5a3402d4e8e192455493da61cc58e\ + e6f54dd941172be3d7642169cbc52273f4b725f1d6c820c3333336c64d32fb62\ + 38121b3ccb7c71b847764946bb0887a44ca9de802cda62efa9dda57375108422\ + 5353f11ed837f3dc25de8374b6fdbfb6e313e46d0381850002818103b06b9909\ + 7cd7145c7d7782b02e247a4741f3c7f39233627f17e13ebff89a18cad6a454c3\ + f32f7ef2910384030da71ae47e1c3fa79c2141dad107f8e715e47fb0bb626baa\ + fc35db769852ebbec2d339c3c3d5f2287cfdd20b3b78ea4607086c42558ae463\ + 7eddd6a74bc1072d0f34d9c0130cbc9e84f537e7ce50df502d17b5c3 +Test: KeyPairValidAndConsistent +Message: AE6DCD9535AEEE3ECC89 +Signature: 1BB090DC4573AA79F34181020C4D5B582BBA67062C23E5DD6913CE91482A05716784BA680F7F4AC1684B +Test: Verify +Message: C83A14EAC016D659F9FE +Signature: 182AC27BC4B77B145BF90E73A2CEEC5325941507F925279DF5B6280664CE82248348C3EDC59DCD428B64 +Test: Verify +Message: 745E02041EB487D16CE6 +Signature: 13C4F9AC03EA094CF7F60B96CAAA29053706E93DEC1024EAA1606E13B2C3062F2D6082846D29E6E60829 +Test: Verify +Message: 62F019655A83501FC4E7 +Signature: 077E19089B0BB32A7B21B0D27218C6E1F14AD432181BB76FF5E7EC35EC01CA47595F4C7ABB8ABD6064A9 +Test: Verify +Message: 351D37A4B5046E885EAA +Signature: 21962B09FF030A41251AD592F8D2AF24144B3AC713245AF18BE28F192FD29326D91F12A76A01477C8788 +Test: Verify +Message: 4073D33915F595F4FF9D +Signature: 1F4CF158E806AFE59139E2A9840BCEF79237800C521E49B7DBDF9830C86E7653FC716B43224EA00C883F +Test: Verify +Comment: 1028-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f0281810abdeff64b\ + 6f28256e4562109bffed29cb5aa95d89cc0ec95da0e773dbff3467c271bbb1e1\ + fbb6af058517fdacdf26b5919674c625eced6317d8631c063f43b3ade2cd633d\ + 554913339071d6ebed5fd665fc5dd7d47b80721a976c3b14fbd253f0f988c354\ + 725289f2897df0a15985c92b2d4da8d087870c251c72d979b8304d5102152368\ + e2b864b250ad45406391e7eeaa3d27cd053c2b02818107c325695dfe315a77ad\ + 7b42f0d18f9d4821b5c153fee7385877602fa54477bb8c0639d2438f34352b97\ + c22d02a7295d2b53d5286a01caa919d6283614690624240af922675ccd4a0534\ + ec336cb79cde31b02b5988cc5a53ca17790d67d803a27bb927b9c59bdc6ac794\ + 175e285cafdece6778ab19a0b444747fee20d5bf929e70041702150771305163\ + 506b2b83bd5279935df1b5fcf180b004 +PublicKey: \ + 308201b83082012c06072a8648ce3804013082011f0281810abdeff64b6f2825\ + 6e4562109bffed29cb5aa95d89cc0ec95da0e773dbff3467c271bbb1e1fbb6af\ + 058517fdacdf26b5919674c625eced6317d8631c063f43b3ade2cd633d554913\ + 339071d6ebed5fd665fc5dd7d47b80721a976c3b14fbd253f0f988c354725289\ + f2897df0a15985c92b2d4da8d087870c251c72d979b8304d5102152368e2b864\ + b250ad45406391e7eeaa3d27cd053c2b02818107c325695dfe315a77ad7b42f0\ + d18f9d4821b5c153fee7385877602fa54477bb8c0639d2438f34352b97c22d02\ + a7295d2b53d5286a01caa919d6283614690624240af922675ccd4a0534ec336c\ + b79cde31b02b5988cc5a53ca17790d67d803a27bb927b9c59bdc6ac794175e28\ + 5cafdece6778ab19a0b444747fee20d5bf929e7003818500028181043e4ae624\ + 4408879264fe6b859b578218705b9a45af22efded27141b7f090cbcbe42dcf48\ + 1df3e41b13920ae02b694eaa6bfd62f2d3c5d677b8c4ce783cbe2789e088b044\ + 89ef535ad4a517351c8835cf128f7ec677a1b1dbe3ae9cc4198ddb6e1cef8e97\ + 8c0725f5063797bc43eb9ae496286cccbad5d4e026e9edb997d2f918 +Test: KeyPairValidAndConsistent +Message: 4867852C83F181CDD010 +Signature: 1D0F4F49AFA0448163604847C9308A824ECE928E05066D47892256DB725FCB31F93F38B9E02C71E100EE +Test: Verify +Message: DA6493C86D6B62C5961C +Signature: 1BB4A8A1B8D81EEE9AB291C49F688F27D2191EA51B15A5DA66A6367D931DAB338E595C80E70CEE4BB644 +Test: Verify +Message: AE2C1136BFE966794A6C +Signature: 02AFAB91234D08FCEC22E57AB5718FBF41A86D2469012F8476BFCF4EA4E03D9F7A6E467ABDD0B5626784 +Test: Verify +Message: B20160E0442E726BE749 +Signature: 140A45F4933F05807A533628962E42A8BEFAF5977917F2A8D8706B8BE83EE6B6CEBCC951553B4E3203B5 +Test: Verify +Message: 3638935C4492F5CA42F2 +Signature: 234F78EF68343E77710E17285E47994AB599F3646315C37B8CC01CF6BE9C803D6B81B232DE9171DA7967 +Test: Verify +Message: DFB674CA6E0FDC0CBE99 +Signature: 1DF9B1B9F78F5FCCCCC5F698EDDBC8EB28C0F4D10002A052284AA4FBA601D3047E3AA97F8CF73731A44B +Test: Verify +Comment: 1029-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f0281811d0f176b67\ + 99b36724c92954c38d0288fa95400c2b14e064f76a6338fccaebca8d978b93bb\ + 76507bc150a50f9fe799fffe12ae2875b13ac1084ffcfde9f62b86185a72f04f\ + f80538d6eac177edc98d61a517b1275bcf4b57aa262e1702d623bc344db7e562\ + 1c949a9b12e9936e88fae9b200a1f8ad5b40ec8220aa301267f38dd702153357\ + 536531dec150be0ef8747f69ea30d987ff7df1028181067dd80dbc6b41f58d08\ + f077a9a3dcbfe12a62065fe6b4691c457f506b56dcab0433b3aad6ef96250163\ + 3d0f3947b491a1317e7e6b632f062c53104d609c9222b056f08a0c83662a7074\ + 4331fd09b2b42fb0768e52da27e92732106fbd41ec737373fd080b56b543d808\ + d49eeb6e1bb0a8619b1edee8fb8295dc042423f684af8a041702152dcdc00a86\ + ecc2a60ebfa6660a83af1d7c3e570b85 +PublicKey: \ + 308201b83082012c06072a8648ce3804013082011f0281811d0f176b6799b367\ + 24c92954c38d0288fa95400c2b14e064f76a6338fccaebca8d978b93bb76507b\ + c150a50f9fe799fffe12ae2875b13ac1084ffcfde9f62b86185a72f04ff80538\ + d6eac177edc98d61a517b1275bcf4b57aa262e1702d623bc344db7e5621c949a\ + 9b12e9936e88fae9b200a1f8ad5b40ec8220aa301267f38dd702153357536531\ + dec150be0ef8747f69ea30d987ff7df1028181067dd80dbc6b41f58d08f077a9\ + a3dcbfe12a62065fe6b4691c457f506b56dcab0433b3aad6ef962501633d0f39\ + 47b491a1317e7e6b632f062c53104d609c9222b056f08a0c83662a70744331fd\ + 09b2b42fb0768e52da27e92732106fbd41ec737373fd080b56b543d808d49eeb\ + 6e1bb0a8619b1edee8fb8295dc042423f684af8a0381850002818113834f0fa1\ + f42abf7dbd264cb7d2eb5798da8972df67f517c62d7ae5070fd588d61db62e49\ + 2f9654833e876ed5737df35069f5ee01a45de881d8f5e68ec52ad9ef32780e8c\ + 453a5f1e38cc17bc5cd061a3c122080f6e1b82d31877e8b08f634f497bd90b06\ + 824eaa0416c64104ce5622c272673d0dedb836ac7d47e0cea0673902 +Test: KeyPairValidAndConsistent +Message: 1E34034C47FE533F8FF5 +Signature: 04E171B845E602A871CD5DACA5738BC4585A452A86108D03D70C3D2D605FAE90DB8D339AADB692EB1ABE +Test: Verify +Message: 53D2CA23AF7DF95634F0 +Signature: 1327D4C32DFB874EA2104A9B30EAF288C7016146D1217C237E0201482E483EBC7F0A713748547F9B6B21 +Test: Verify +Message: 0F056E08AE77B3B30F33 +Signature: 1B4A688745F3D86B0D8A5D97FFA0E31C322EFAAD0A0FCD907B2D49EB8150539E81FF29341EC34440425C +Test: Verify +Message: F08C80E8FD38A3867B76 +Signature: 0972705B5E84A8BA57226C770CCB0ECDEBC816EA162FCB3BA5B3C235105EA75F379EE84187E27A86D21D +Test: Verify +Message: 6D392690B92B3E75020F +Signature: 185968475C67C936CB152F76E80EE22FB82A27ED120C5C0ADB2D750D2C38F0A9671EBFEC2815F675C24C +Test: Verify +Message: 10AE0E091A267641FACF +Signature: 1AC3C2010BFB10CA6889120A23F984FE0D4CF79D1B07578217E5A3C68EDF05006C1F3F1BFB3848E4ECE5 +Test: Verify +Comment: 1030-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f0281812a32d68d31\ + 248024053bf628a94404b9a49d91ade4d7a45b071e93292a7f8c2661d9165f0a\ + b85491d4b0dc67d335fa7d7dd172cb17193390a55eb000aa97e2b8ed3ee64b73\ + aa43ea9b8979132c2d966ab03c42cc14782c96e4284ee1136b8515007ed1b1a5\ + 708b5e8d81304fa651edc715918e2299cfe9016dfec5f454d907f59f021527c7\ + 996c1d3729c4cf1de06529e5619771e27ad9eb0281810d87a4b01385da7f43b6\ + 277933c5f0dc8072dcacd5252e1b29f588114a7ac56e377050aa8174b5dda400\ + f043234e4a746442792734dc80274a00a3676101be94759fc2630b9a85896648\ + 8b12611d03d0b31e7243e124497a754544cee1db10bb0a81cf0b2a68045b76fe\ + 935f641c666fdc788a2b968c6668c669115756b961d9fe04170215091155581e\ + cb7a0a792ba95c772d9382298bfdfa6f +PublicKey: \ + 308201b83082012c06072a8648ce3804013082011f0281812a32d68d31248024\ + 053bf628a94404b9a49d91ade4d7a45b071e93292a7f8c2661d9165f0ab85491\ + d4b0dc67d335fa7d7dd172cb17193390a55eb000aa97e2b8ed3ee64b73aa43ea\ + 9b8979132c2d966ab03c42cc14782c96e4284ee1136b8515007ed1b1a5708b5e\ + 8d81304fa651edc715918e2299cfe9016dfec5f454d907f59f021527c7996c1d\ + 3729c4cf1de06529e5619771e27ad9eb0281810d87a4b01385da7f43b6277933\ + c5f0dc8072dcacd5252e1b29f588114a7ac56e377050aa8174b5dda400f04323\ + 4e4a746442792734dc80274a00a3676101be94759fc2630b9a858966488b1261\ + 1d03d0b31e7243e124497a754544cee1db10bb0a81cf0b2a68045b76fe935f64\ + 1c666fdc788a2b968c6668c669115756b961d9fe038185000281810d7d22c931\ + 422fc46505887559a51490c2e367cdb40242cdbaeb23024693fd5c68f6a3307c\ + a34b224457d5aa610b90eca3b39905481daaba7151318f09f974ad664546d14c\ + 87f797e38139ee1e07adba9c775e07b7f7b3edba87d886920d6b2cef5f084359\ + 566b0a3b8b940a65b9ad93fd7ccd1354cdcee3c43c6bd315180498ad +Test: KeyPairValidAndConsistent +Message: 23EEE1D0EA8950B8F322 +Signature: 1800356929B316D1E4FA886CAE0CAD56E32506522D0B8440BB7695D522F31CD87079BEA4CA9F18ED4288 +Test: Verify +Message: 13FA6F2816FB83190A21 +Signature: 207830C2DE87296BC39CD21630F26228F00CF60BC3150CBC82CFA9006534A6C5E354AA281C434A8C2077 +Test: Verify +Message: D071CCC0C6E4CAE82E5A +Signature: 054C9C0C30C6B73AAB9E54C11D4EFC82BD6E8680932501D78A58EE305930E72ACD3BB2565023455DEAEA +Test: Verify +Message: 22CE83F4803BF3EA2C48 +Signature: 07065A6F5C9A086CB83F2F113895730C1B2FE0DCD90FD6AA887B066D685D3DD6C3C0D95CB8C8A48FBFF1 +Test: Verify +Message: 7A927EC7BB9CA16C1B0A +Signature: 24BF344DC7B25F831428078AC0D929A72A29160B6205A1BD4B1B2C5BD8BEFCB650DE23652701DDD4F4EF +Test: Verify +Message: 9591B069993E10BC0B84 +Signature: 0E6E6BF91BBC9FB91FCD3CE32907F5B6AB5E88928C1E3BC92649EDFDFE672AFB654C765F2758DE4BD78F +Test: Verify +Comment: 1031-bit DSA key +PrivateKey: \ + 3082014c0201003082012c06072a8648ce3804013082011f0281814d58515f7b\ + 41c4fc87e4fcefe5cf6d84b2d74a9d6f498ae9605fcbf1c59217422001a272ef\ + 91dbd09e7af5ee54126dd4fc44bb1ed624d0dd5dafb984d52781140bba40600c\ + bd4752d2c32b43253efee57af6964c339570edb24195502e6d424b84bed65ac9\ + 8c6fc52ec90e40a525f1863a53f2fbe2a0a133342eff4337f26ceb93021526f8\ + 6a81a6bb530c2f9b63e3690e95a0894575f4450281811e24828adb4ebf2becdb\ + dcadf6706631293ad6566803d12479f04a7bb20b6086fe81df164f8bd02c5f41\ + 8c1140d143f11a71170b42d0753c952bfff951b9ca4204868375efaa4afad50b\ + 75787e41c5ab9ce8adcbccecd3716f350bb8aaeca9b6098bd0002d789e1f7db9\ + c19d9045499877b93ecb4e7c64808b742063bbecf60e29041702150e61a054ee\ + 6510734a80f67a54d8c4151c957ef16f +PublicKey: \ + 308201b83082012c06072a8648ce3804013082011f0281814d58515f7b41c4fc\ + 87e4fcefe5cf6d84b2d74a9d6f498ae9605fcbf1c59217422001a272ef91dbd0\ + 9e7af5ee54126dd4fc44bb1ed624d0dd5dafb984d52781140bba40600cbd4752\ + d2c32b43253efee57af6964c339570edb24195502e6d424b84bed65ac98c6fc5\ + 2ec90e40a525f1863a53f2fbe2a0a133342eff4337f26ceb93021526f86a81a6\ + bb530c2f9b63e3690e95a0894575f4450281811e24828adb4ebf2becdbdcadf6\ + 706631293ad6566803d12479f04a7bb20b6086fe81df164f8bd02c5f418c1140\ + d143f11a71170b42d0753c952bfff951b9ca4204868375efaa4afad50b75787e\ + 41c5ab9ce8adcbccecd3716f350bb8aaeca9b6098bd0002d789e1f7db9c19d90\ + 45499877b93ecb4e7c64808b742063bbecf60e290381850002818119b50f1eea\ + 45bfaa22352a38f3c3b86d6f670747ac2fd94359608e25f2bb9f602506bc3572\ + 45deeb4c3c702d435c557da4f4a9fd37330a75547c91681fdbb51f286adb498d\ + 1e489e89b2e6a4eb9ff30222c51fefbeac7435f629f536ac2d6b87664d80e5c9\ + 7398cf489a1d1ca217f7f21ea8e409f938378875cf5f528162e3bc07 +Test: KeyPairValidAndConsistent +Message: B4B3C8FBE82013228A21 +Signature: 0E08FE696A4C70B16A127CAE8C61E5B38B7A1F34402584D1F21F71016054E820E3B1BB866309D93A7DA5 +Test: Verify +Message: 17D2D18302173E2CE992 +Signature: 0203C3869E15F8847B58BD158CB746433AA05F201317C0541908ACD5EA78A02D1FAB79380619199CC5B8 +Test: Verify +Message: 8032AE177D6DF38C7E27 +Signature: 1F436F5BC73A3402221B539F1D7CCBD4C3AE948418216122809E062ACF5D6086546FCBB293B4C7510CBD +Test: Verify +Message: 768640A60A3C62E02428 +Signature: 0A5D52C534A9BF1175247538638077489537025975254955F8A96B0CA2E7985D5D6E3DD54EE298C90100 +Test: Verify +Message: B0999CA45B77ED63639D +Signature: 144DDD0C1BE6D96FC3AFFA240FCD6D2AD0748C848F0C8A25AE8AC2E55A38DE9DBBAFF90CF464547365E2 +Test: Verify +Message: 587EDB968FA82C12C930 +Signature: 01FC4F6F98898F3639E8D93E7C2E6F3945120AD19D15EA13EDC96BED7E73A7D5D161217F1C67F3048BE3 +Test: Verify +Comment: 1032-bit DSA key +PrivateKey: \ + 3082014e0201003082012e06072a8648ce3804013082012102818200d551680a\ + 62ebf98f0ed8930cc5b12de86d0a0c29a0d7e5524c24672a25428833f4c19ac8\ + 83ead22efcc0c6823f2e942c17adb7ab763ff2c7cc2698fa8b6448e514d4628b\ + 197721bdaec780e126ac80ac83f24fef5c154f7690ceba903748be5212e3180e\ + a718ca7a71a49dee939bf9bc5b7845c9648d074587ccd3724493b91f0902152e\ + 802b5369c3f1ddfa789bf8f2ad2e048ced3bf35502818200a9aebee7d29f90b0\ + 81afc4d496a6a78210e918bb57a8a21c5995586c0bf20f7a56bb10a97e05a3a7\ + 23e7db64612b12bb591b1fe7d2e46be8c96a7b2ce7c66076aeded938775ae222\ + 3900adaf52a93f52d62173c82d4b67388c85d4c1127e1edf4643cf09f5375b60\ + c19316c4f8f8fd7daea1d8b44a2d03e97c2741537f63d86b4a041702150f66e0\ + 4c5a75d3eac03d744e5432f23e3aea066a63 +PublicKey: \ + 308201ba3082012e06072a8648ce3804013082012102818200d551680a62ebf9\ + 8f0ed8930cc5b12de86d0a0c29a0d7e5524c24672a25428833f4c19ac883ead2\ + 2efcc0c6823f2e942c17adb7ab763ff2c7cc2698fa8b6448e514d4628b197721\ + bdaec780e126ac80ac83f24fef5c154f7690ceba903748be5212e3180ea718ca\ + 7a71a49dee939bf9bc5b7845c9648d074587ccd3724493b91f0902152e802b53\ + 69c3f1ddfa789bf8f2ad2e048ced3bf35502818200a9aebee7d29f90b081afc4\ + d496a6a78210e918bb57a8a21c5995586c0bf20f7a56bb10a97e05a3a723e7db\ + 64612b12bb591b1fe7d2e46be8c96a7b2ce7c66076aeded938775ae2223900ad\ + af52a93f52d62173c82d4b67388c85d4c1127e1edf4643cf09f5375b60c19316\ + c4f8f8fd7daea1d8b44a2d03e97c2741537f63d86b4a038185000281812640c1\ + 88055329f0b44aaf80f82f7fc7f0e421031834dfbd1fb6d6af6ab3e1c173c901\ + 370a4ce2793c1b88d12f764c58ff064905da9c5001f679c7508972f237bccca5\ + 6524787466a7c9c2d6bb6392963008ed1a3e4cf3b13e66086bce3a4ca04d8cab\ + cf0cadb4c403c7d02a858460d04350e730289cb5adf200b5fdf1198168b5 +Test: KeyPairValidAndConsistent +Message: 909068BEFFA43331FDC7 +Signature: 2CCCFF8A67073E5DF643B61A5AE7A5BC216FE267E713B9005F69797B44ECD33BA5DD87461B5C72C50390 +Test: Verify +Message: AC8AFC7A1D9105539E10 +Signature: 0A2BEB58D806EECDDCBD590EBE4AE5AE7BDA326EA0072ADB9FA6A6FEBF40488C80690A2B1DF141BACF91 +Test: Verify +Message: 310E40311BB3F77F9483 +Signature: 28726153B52FE75F1FAA4C97124EE042065D2C90B50B43F885FC45C42C3ED9BDC4EC2D36A2799A041C67 +Test: Verify +Message: 35455ABD53E6FB11ED9B +Signature: 15B3D6ACA9EAD5AA1501ED201335AF9B46657A4CBF00D19328018D82624D4BD9B22D645429B385DADBCA +Test: Verify +Message: 95FFA73B52F0D06A0C1E +Signature: 2904FA8F78B6DF0D15A08714C8F86B97532A9D13B617EC03F329DA20E42816CCF45DBACB432B1F5011C8 +Test: Verify +Message: 1E9934125DA6E9B4E975 +Signature: 1666A3B9DBE26F2AE3F9BF7CBF47989D87AF82F580147BEC8350E21D4DB0691074F63B85A3A7D8E82A8D +Test: Verify +Comment: 1536-bit DSA key +PrivateKey: \ + 308201d4020100308201b006072a8648ce380401308201a30281c100fada6e4b\ + ecef964a85caf9e129639a5616ac000dbac59bd50b84bc8d464114079c34c5b5\ + 8d7d40027faaf037c6a649c527cb002d3a716bdef62b6c94d7a47a8b65c2ebac\ + 05da09e40cdc417024cccba267a98f4eb69701a276b4f117662b566605c36054\ + e7f015d2e5f81331e5666ec17ebf71907788b40cbcea0f24aaffb029ef5c25c5\ + 5ae998f28a2ddb091d262c32ad324f4e64c7b4b50a19e9d92f6d8024188627cf\ + 5ce68674e7ec7da38fd6cf4ec29a6ce2f17e3188d8ef6b0e50d77d5b0219232c\ + f9bee9d56c8bd8252d1edb59d99c40cf32d07d9e5a48930281c100f028143e3f\ + 9d1317aafb814215ffda9c584da8943e96212c90a082c3d2f335e8a6b64d1c89\ + 0aa2224ebf158bec2b6fe6bad236417acd517a4907331e0be0dd0b801218ac27\ + 0acdd45579290be1b94bc418b8f82c651d82a19d2f0e1cbb0fbc0f054d95150a\ + f96f9a7488010787a799c544883ff76a4e3092f2ca9aa9000cecb88dda343c97\ + 2c8192a83820727b1945c1a270cf913ab932457e8e6e207d06cd0efdf265b762\ + b9fa15c9a14633af17204ba2b755ed1b3b421ac596a2a04e64be43041b02191d\ + 4cedc87d55eea31bd702139b90be08d58692a1f97628a01b +PublicKey: \ + 3082027c308201b006072a8648ce380401308201a30281c100fada6e4becef96\ + 4a85caf9e129639a5616ac000dbac59bd50b84bc8d464114079c34c5b58d7d40\ + 027faaf037c6a649c527cb002d3a716bdef62b6c94d7a47a8b65c2ebac05da09\ + e40cdc417024cccba267a98f4eb69701a276b4f117662b566605c36054e7f015\ + d2e5f81331e5666ec17ebf71907788b40cbcea0f24aaffb029ef5c25c55ae998\ + f28a2ddb091d262c32ad324f4e64c7b4b50a19e9d92f6d8024188627cf5ce686\ + 74e7ec7da38fd6cf4ec29a6ce2f17e3188d8ef6b0e50d77d5b0219232cf9bee9\ + d56c8bd8252d1edb59d99c40cf32d07d9e5a48930281c100f028143e3f9d1317\ + aafb814215ffda9c584da8943e96212c90a082c3d2f335e8a6b64d1c890aa222\ + 4ebf158bec2b6fe6bad236417acd517a4907331e0be0dd0b801218ac270acdd4\ + 5579290be1b94bc418b8f82c651d82a19d2f0e1cbb0fbc0f054d95150af96f9a\ + 7488010787a799c544883ff76a4e3092f2ca9aa9000cecb88dda343c972c8192\ + a83820727b1945c1a270cf913ab932457e8e6e207d06cd0efdf265b762b9fa15\ + c9a14633af17204ba2b755ed1b3b421ac596a2a04e64be430381c5000281c100\ + 819c8cedb9c014aa577e9046b90795accbebe81bef68b1b5c37c68cb357e1a5f\ + f92761bc26cb0953956b6c0aec05acfc9d1a27c50789793b13d9eaf2361760c9\ + 7a7d86e7d922f4809a5d2d01448e938190bbc24c150e03ef8305365ddbf5ca19\ + 6857314e3b3023f8ddc9d209bd7dad1ee763e7003fd1b0c53057d2e9acadd23a\ + a18f83d20143bc41a2dfa4a164c82621fc0f800052ec01bec7c99c66fe20ec57\ + 67e6fbbe8810cd5aa75eff3d8a4cb53e1259ebcfebcc2fcf21ba7f3589cd525a +Test: KeyPairValidAndConsistent +Message: 9F6DC301DF53FE22CAC0 +Signature: 15B22111FEFA4AC1E53F2FEC346559E3613BB94F7BB3E2B7551D8B982FA10C38E7F182834DFC7391155FFA42AB945A29E118 +Test: Verify +Message: 2D7B5B9A27EAB468331E +Signature: 029EEA97097FE926DD09821284BCA3F45750B1F8102380D20100596D914DBF6BEFBE1B7A938E3AA5D656B6FD99E8EEE7C606 +Test: Verify +Message: F552FCBBA04FFCCC5CB6 +Signature: 115DE3CC1553CD5E4D40CCED80146DB1D76C10D992AACBCBCB05375C5FDA9F65B9A19DF7E51E6A36A3F2830AEA433AFD4F8B +Test: Verify +Message: 0D52B894153A4BB74068 +Signature: 0F6B8CC28D82E22B9B87D62CFF5C7B2289BB2F8008C42F105B2322CF95BC6D443A9D89A292F482490D94693A44DDF7AC4BD3 +Test: Verify +Message: 294442E103CC0CBA32A6 +Signature: 0FBD8768A18C2B28CE95775AD734157C34C1C3961C1DBBAFDD0A3E92A312A7925AFC9F7F4760FB0C56B42A2042C6B8B37C0E +Test: Verify +Message: E993D8FE1E6F6C3914ED +Signature: 0559D66BAC906C607BBA769AAFEB93E9AEC55FDD4597E432870CDC8A3DF9778301A0B218C886F6B08A414C51BD2F8214201A +Test: Verify +Comment: 2048-bit DSA key +PrivateKey: \ + 3082025d0201003082023506072a8648ce3804013082022802820101009a0886\ + 5d2bc9e0cf03d2500b2a08402bb9dc953d5fcd73f04be61236efc0998a8f012f\ + 00e52f7a6e91e81b88a4c9f985a2da523cbe7caff08cae44963d2035eda72e1f\ + 31f82c8d64c86e686899d53c0200282f407ceb1507db480f1db223606a57466c\ + f60fe9fc5f7ea7d5fd82ed3ab2cf5e35491dfaef0aa2e10fbfa3cdfeb5ebf65e\ + 4dfc2837e1f6399db06cc2e0420c7b14a4c0d483b742ca58b31fec9f26a64e9b\ + fcaa82334e644f4b954e2a9c7eeae096b8864ecd223ead3bcf9e8c1f68f6678f\ + accdb7f26d8f33d8a5fb0cb156cc7daf4a96ec2b730c0d7f666d699f7345a37d\ + dc1ccdea6d8f439ddb23de04a941b246bc257b0aef544a8e868bc8444f021d03\ + f35f80fcd896f03eda9ff07f2e35295384c4f3b8f8c4821369ab541702820100\ + 75c5d8c8f72302d92be3bf486b8648330ff86954de5e6e83efef624a277574c1\ + 6757684d3874ee303fa08343fe82dae484e5dda6781280b434c4090044cc7ff9\ + b6e962594d3ca069815c0f0b6bfd25215a419420d0ef8a1595c6eb1b44a719b4\ + 0131081f75cc15cb09a5d5a029c8546230c30b4af2d4a9f4374c93a095c83b59\ + 4b1774d635d4aee965f1d094469f7bbf8bdc93216a6b8a6c5753b48962335bf2\ + 092aa583c897878c8a7ce61186b592b05d2aea710b673d5994cedb5f117fdb6b\ + 8ad4d89f443c4eb662b428a34a7522c69794cc0274f3eba837e90da86acbc707\ + 4ee3a0b029d970efa48b3d582b740ae0e585d175a5f63a385f8b6b8878b44e1a\ + 041f021d0212c34d3d17b96a899548ebf43bb886676acebd2f040f5b33a4e88d\ + 2d +PublicKey: \ + 308203423082023506072a8648ce3804013082022802820101009a08865d2bc9\ + e0cf03d2500b2a08402bb9dc953d5fcd73f04be61236efc0998a8f012f00e52f\ + 7a6e91e81b88a4c9f985a2da523cbe7caff08cae44963d2035eda72e1f31f82c\ + 8d64c86e686899d53c0200282f407ceb1507db480f1db223606a57466cf60fe9\ + fc5f7ea7d5fd82ed3ab2cf5e35491dfaef0aa2e10fbfa3cdfeb5ebf65e4dfc28\ + 37e1f6399db06cc2e0420c7b14a4c0d483b742ca58b31fec9f26a64e9bfcaa82\ + 334e644f4b954e2a9c7eeae096b8864ecd223ead3bcf9e8c1f68f6678faccdb7\ + f26d8f33d8a5fb0cb156cc7daf4a96ec2b730c0d7f666d699f7345a37ddc1ccd\ + ea6d8f439ddb23de04a941b246bc257b0aef544a8e868bc8444f021d03f35f80\ + fcd896f03eda9ff07f2e35295384c4f3b8f8c4821369ab54170282010075c5d8\ + c8f72302d92be3bf486b8648330ff86954de5e6e83efef624a277574c1675768\ + 4d3874ee303fa08343fe82dae484e5dda6781280b434c4090044cc7ff9b6e962\ + 594d3ca069815c0f0b6bfd25215a419420d0ef8a1595c6eb1b44a719b4013108\ + 1f75cc15cb09a5d5a029c8546230c30b4af2d4a9f4374c93a095c83b594b1774\ + d635d4aee965f1d094469f7bbf8bdc93216a6b8a6c5753b48962335bf2092aa5\ + 83c897878c8a7ce61186b592b05d2aea710b673d5994cedb5f117fdb6b8ad4d8\ + 9f443c4eb662b428a34a7522c69794cc0274f3eba837e90da86acbc7074ee3a0\ + b029d970efa48b3d582b740ae0e585d175a5f63a385f8b6b8878b44e1a038201\ + 050002820100267f9c3ff3ee3cbc0f9e94dc7e6837e1ff65175e967987b90b9a\ + ea7eef1de6e4c342bebb5dbd0c4e2f6514f2d487857a146dda6cfdbc8b56ed25\ + 4cd65754d84dd21a271cd15fc656274725643728b41ce3f0e6872b6dfb4c289e\ + 03f9b903880ce3d7d745dfbb641c8c42ec0bfb6951ca2611fd877c32248c9725\ + 2bdb42d7bd65ebc50653dff389526c546d1e6ebaf6bd8b3298c01935901b7efb\ + 288b78730d89fba7f46f2a642aee0dbc93aa29c190b201acf89d4f8ba28f3e3f\ + 54a1c5a48294dda908f904afb7db398682c809ce13abd49279221d5b40ad7621\ + 6bad7ca256d718d3552344c481b20da5aac3e637fb7edeaf7960b532ef761376\ + 489f02fa8c10 +Test: KeyPairValidAndConsistent +Message: 5F3914F7AE0F6C76D152 +Signature: 03D30B7EAADDCB384CECDBB7541DFE57187242C836A6C72AF6C2525E1A01DB97DF3F41156089162FAFC87361F2F28E55616A50633637FB13EFE3 +Test: Verify +Message: 769583D4E7EAD14C137A +Signature: 01DC2815FD4918B8D314526066A03AD6593C8CED9E1ED04252B1BBA59D019F1C965028DA88BF4DB35AEDBA2C3C963B7933E5C07C590EF78BDFA1 +Test: Verify +Message: 6441D5239F50C71DE0F5 +Signature: 013F6D395DE56832F72F17F7F7572BB6DD1C48BADCBDEA91F0A634486E034B617DA8F5AB5E6F78C691313F822C599B6400A0A119A5DA330C6830 +Test: Verify +Message: F1C2D4F7C3ECDF2C17B7 +Signature: 006441A8B3517613F950BC1C84504082C0C3EA10CC08DCC1DA22E05480036D78345B17244F0DE41DA8342AF3441489CF9880BAA01BF2745CAB3A +Test: Verify +Message: 752A1F2B8D9A717A882F +Signature: 0127027984402F5B8C7DB1B7666FFA787548E4200D26B9D3B20EA9B4370298A9BDC901F324844613E8B5F34F2BFE40D9E6513D0E207B5105A9B1 +Test: Verify +Message: 666DC6B1E871026EDE56 +Signature: 03E87B55A7E81318B6B7057C901F8E3DC564053C1EA08B1F1FD965453803F21C20CE7FCCF606FB1328EC987666E87AF16ABE6B42DB854BFAA019 +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/eax.txt b/external/crypto++-5.6.3/TestVectors/eax.txt new file mode 100644 index 000000000..b6fe641fe --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/eax.txt @@ -0,0 +1,75 @@ +AlgorithmType: AuthenticatedSymmetricCipher +Name: AES/EAX +Source: http://www.cs.ucdavis.edu/~rogaway/papers/eax.pdf +Plaintext: +Key: 233952DEE4D5ED5F9B9C6D6FF80FF478 +IV: 62EC67F9C3A4A407FCB2A8C49031A8B3 +Header: 6BFB914FD07EAE6B +Ciphertext: E037830E8389F27B025A2D6527E79D01 +Test: Encrypt +Plaintext: F7FB +Key: 91945D3F4DCBEE0BF45EF52255F095A4 +IV: BECAF043B0A23D843194BA972C66DEBD +Header: FA3BFD4806EB53FA +Ciphertext: 19DD5C4C9331049D0BDAB0277408F67967E5 +Test: Encrypt +Plaintext: 1A47CB4933 +Key: 01F74AD64077F2E704C0F60ADA3DD523 +IV: 70C3DB4F0D26368400A10ED05D2BFF5E +Header: 234A3463C1264AC6 +Ciphertext: D851D5BAE03A59F238A23E39199DC9266626C40F80 +Test: Encrypt +Plaintext: 481C9E39B1 +Key: D07CF6CBB7F313BDDE66B727AFD3C5E8 +IV: 8408DFFF3C1A2B1292DC199E46B7D617 +Header: 33CCE2EABFF5A79D +Ciphertext: 632A9D131AD4C168A4225D8E1FF755939974A7BEDE +Test: Encrypt +Plaintext: 40D0C07DA5E4 +Key: 35B6D0580005BBC12B0587124557D2C2 +IV: FDB6B06676EEDC5C61D74276E1F8E816 +Header: AEB96EAEBE2970E9 +Ciphertext: 071DFE16C675CB0677E536F73AFE6A14B74EE49844DD +Test: Encrypt +Plaintext: 4DE3B35C3FC039245BD1FB7D +Key: BD8E6E11475E60B268784C38C62FEB22 +IV: 6EAC5C93072D8E8513F750935E46DA1B +Header: D4482D1CA78DCE0F +Ciphertext: 835BB4F15D743E350E728414ABB8644FD6CCB86947C5E10590210A4F +Test: Encrypt +Plaintext: 8B0A79306C9CE7ED99DAE4F87F8DD61636 +Key: 7C77D6E813BED5AC98BAA417477A2E7D +IV: 1A8C98DCD73D38393B2BF1569DEEFC19 +Header: 65D2017990D62528 +Ciphertext: 02083E3979DA014812F59F11D52630DA30137327D10649B0AA6E1C181DB617D7F2 +Test: Encrypt +Plaintext: 1BDA122BCE8A8DBAF1877D962B8592DD2D56 +Key: 5FFF20CAFAB119CA2FC73549E20F5B0D +IV: DDE59B97D722156D4D9AFF2BC7559826 +Header: 54B9F04E6A09189A +Ciphertext: 2EC47B2C4954A489AFC7BA4897EDCDAE8CC33B60450599BD02C96382902AEF7F832A +Test: Encrypt +Plaintext: 6CF36720872B8513F6EAB1A8A44438D5EF11 +Key: A4A4782BCFFD3EC5E7EF6D8C34A56123 +IV: B781FCF2F75FA5A8DE97A9CA48E522EC +Header: 899A175897561D7E +Ciphertext: 0DE18FD0FDD91E7AF19F1D8EE8733938B1E8E7F6D2231618102FDB7FE55FF1991700 +Test: Encrypt +Plaintext: CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7 +Key: 8395FCF1E95BEBD697BD010BC766AAC3 +IV: 22E7ADD93CFC6393C57EC0B3C17D6B44 +Header: 126735FCC320D25A +Ciphertext: CB8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E +Test: Encrypt +Plaintext: CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7 +Key: 8395FCF1E95BEBD697BD010BC766AAC3 +IV: 22E7ADD93CFC6393C57EC0B3C17D6B44 +Header: 126735FCC320D25A +Ciphertext: CB8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E +Test: Encrypt +Plaintext: CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7 +Key: 8395FCF1E95BEBD697BD010BC766AAC3 +IV: 22E7ADD93CFC6393C57EC0B3C17D6B44 +Header: 126735FCC320D25A +Ciphertext: 0B8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E +Test: NotVerify diff --git a/external/crypto++-5.6.3/TestVectors/esign.txt b/external/crypto++-5.6.3/TestVectors/esign.txt new file mode 100644 index 000000000..637067172 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/esign.txt @@ -0,0 +1,93 @@ +AlgorithmType: Signature +Name: ESIGN/EMSA5-MGF1(SHA-1) +Source: Crypto++ 5.0 test vectors, generated by Wei Dai +Comment: 1536-bit key +KeyFormat: DER +PrivateKey: \ + 3082014D0281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD\ + 52D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D\ + 64CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D411\ + 6CE5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1\ + F93193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB\ + 020120024100FAF0F292EE96D4F449024F86C0A104E0633C722586EC00AD33E0234629825D2081BA\ + 337597889CAC55DC6BEBDD8F13FE3AA2133D6371601A37D195DA7BC45EF3024100EBE16F88887A42\ + 5AA08E271467CC2220DC44012AB24ED4FF3512A96E8CB600C8BBCB771459FF0EE63D4B6786952A83\ + A7143A775073F0A1D69B6D0B5817755673 +PublicKey: \ + 3081C70281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD52\ + D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D64\ + CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D4116C\ + E5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1F9\ + 3193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB02\ + 0120 +Test: KeyPairValidAndConsistent +Message: "test" +Signature: \ + A3E32065DEDAE7EC05C1BFCD25797D99CDD5739D9DF3A4AA9AA45AC8233D0D37FEBC763FF184F659\ + 14914F0C341BAE9A5C2E2E38087877CBDC3C7EA034445B0F67D9352A79471A523771DB1267C1B6C6\ + 6673B3402ED6F21A840AB67B0FEB8B88AB33DDE4832190632D512AB16FABA75CFD7799F2E1EF671A\ + 7402370EED0A06ADF41565B8E1D145AE3919B4FF5DF1457BE0FE72ED11928F61414F0200F2766F7C\ + 79A2E552205D975EFE39AE2110FB35F480814113DDE85FCA1E4FF89BB268FB28 +Test: Verify +Message: "test1" +Test: NotVerify + +AlgorithmType: Signature +Name: ESIGN/EMSA5-MGF1(SHA-1) +Source: http://www.nttmcl.com/sec/Esign/esign_emsa5_data_ntt.txt, \ + ESIGN ( IFSSA-ESIGN-EMSA5 ) Test Vector No.1-3 ( 1152 bits ) +KeyFormat: Component +Prime1: ec8b4bdc9a56ae7b60619814ec45d617246063b5aac39c286f7c82ec2824c245001b678217a7cf178979c7270eb510db +Prime2: e7b1c3ae3494d0ac7b6868a53a5fe3ba19471437c54b25699e8c348a003e5e1d4c6d244d4f6a78f260c98fc54795a6a3 +Modulus: c5d0b8fac0cc6acc9d52c61200b541f7b4f8ff9f1bda97e0ebf78a3df768ba70ade59306d6ae65655bff7c6a94518c91e43dc0003b6f8730acc244799bdacb1e5070c6ea3089ea83bd5ef0a533adf3d9d63c0e88ce74545cfb21213fc33813fd913c6a6cf84b5adabc7d74751e9945521ac76a790bba95ad48d9d3fb2fbc4b0ed2ddee7d5ea6aa61633eccdac6381fab +PublicExponent: 0400 +Test: KeyPairValidAndConsistent +Message: 86f28c1cb5e640548309b85dc6e64c1a +Signature: 348dc9a0943b1e2ba7ef501cbe970a023b37ca4019b9a5cb35ffc3bcdb28dcbd4193d7817d418bbaf291d97a1eeb918a03ee65caa7ad26c24f9ef807c8798ade5b70d7328cd36ac0844bf63f511bb63067e8236d084cf8af68e88155ea94b978aab6bd0339c55d976434423fc779d549779e81f528d028c7343e060544410e528814fb0874417d1eedf38d6db4b97dd6 +Test: Verify +Message: 2fd87bfa6c8a965c9e1aaa8e3574202b +Signature: 561ad8bd11270c71f00af0e0cf256d858c757e8b55b9c4d6fb6bf71598ab59352992656348c1ff1ccda14fb7c5c3b53be49727c07422b78ffc380eeb03be7bdf07b279337af8a1eb7c5bdb725b33a82926b6afb7a1fff0750cc2532c6f96e28d7f1e621cf222b42bb850312f1a5fb7d99acd1c6f6d2347a121dd478374d6a40a7b0cd42e430f01b926135fc8d850366a +Test: Verify +Message: 888330ef1dc1588d578badde35c98d1e +Signature: 915d64d7b9b811fe8b58eaff4c2bf9ce2ad886eef95b28093f8c21f4ca950fdb2f6e77f97d0f2f8158445347f5b3ce33e082f3b5204522e15614d1891078d9557796726b5555cbd8d5489638ecf4738257dea70175fe27de54b1f45c0a96c229bd59260bebfb241e8eacb8a1a23b9a9a79b6d1f52cfed8cca2f1968e37d76c435ad1acd44131ef2c5f5e4ea8a33aee4e +Test: Verify + +AlgorithmType: Signature +Name: ESIGN/EMSA5-MGF1(SHA-1) +Source: http://www.nttmcl.com/sec/Esign/esign_emsa5_data_ntt.txt, \ + ESIGN ( IFSSA-ESIGN-EMSA5 ) Test Vector No.4-6 ( 1152 bits ) +KeyFormat: Component +Prime1: d64dac2fb3506111bbac11a04e138d2d6f32df119f2f259065cf5785a46aaf404ad887f0a310b36be4a3a1a33c8a054f +Prime2: d1158628ed1e0695c02a821ab8590f59fc1a3fb1e19ee192ab789e9d963766d78f55cfef9bf58c0c774a32d8a8943955 +Modulus: 92855120174c4a115bf525fa1f2ebf68d8328162149a5a6751b2512584eab7e5582d38d0e5029e01ece85a484030bb884a29121d8924f0195b22842b16436cd36c33bbe843e1cf7a585e89894b14595641d081a3077d667096df251bd93c86ebd94e0d555601794fa66fa2bcea920287c19922bed486a4f631390d1e36cc3635b509cb14c44d50313919a6cbb75eff35 +PublicExponent: 0400 +Test: KeyPairValidAndConsistent +Message: 16a3632339c463e243a4909f8a3810a8 +Signature: 7d8790ee852a4f3ba8bb3fa0f6fc30c29b6bc2bc538195826544138dcb92500122148ac2cf0dc77dd37182c2267a73317ce5b2ae26db79204abe0e10c7212ba8de99fdc5cf498f7ee689588541fb78291afb9b65242f725a4aa32b119957b4314a58b4239a0235b9b1a8a6efbaa3601961d4b0730a6d9e5659f20105931d473daf3d378b39b7f3f01516d72ade9ef68a +Test: Verify +Message: ef8bcad6c164a86b0e0a3c011d556744 +Signature: 6ce6024f64a7f04a0fe29b65cf2ec2ac49d9f90078a77db8bc260d3cfef233165a90b29d5787218b4d05a0e9321f2e802a8ed6d1a4201feb982a5d06bef051d60436d8c61a249432e662e625806526075f02b60d198142b96b67a4ac31d0071a1f971dae5a6a1b6db177591edfe80f7e51c7335441490f05f214b5a1aec94de572e3ec11ef4bebeb42f27037d38a186f +Test: Verify +Message: 29023889c79230c1c479820c5ff2e006 +Signature: 85f0b648ee0f6d30a18666e2da8bcda319ede91ca18e018548e2a1c21b0e0049b91528eba4da3be4551b26c4e59e6aba25312874f2320eaf7c94c541e17fb16fb0d9d9928ea526b0fc0c0fb2d12e425a5917e4039a5366585327bc3456107ff31c889c5e04259457dfe65952dc43cd35f4ca689272769096b9583bbffad4a057673f938fa7192bbca44598cf5600e3eb +Test: Verify + +AlgorithmType: Signature +Name: ESIGN/EMSA5-MGF1(SHA-1) +Source: http://www.nttmcl.com/sec/Esign/esign_emsa5_data_ntt.txt, \ + ESIGN ( IFSSA-ESIGN-EMSA5 ) Test Vector No.7-9 ( 1152 bits ) +KeyFormat: Component +Prime1: fd5708b30e8ee342bacaeb01c0d3baa91a833dacff2878c7df62e04a65afe770acdcefeaf8a72a5809387e5ed97756ef +Prime2: fa335563d5da151e3ab025f3b77d3f1eaf4a0d431012e79b12ca8ec433d347bd9a2b5179f2ed332a19ea2cad694c97dd +Modulus: f5072ba25e7df2c0e0a0abde031dda9534a493396ab895e6132abc90f993535ce55d6395e1fd548371228decc1cfefa9737344243ddb1eccbbc22d68571617afb23638c3f0222a84b0a8c9889ab934aa84cc92e14d972670db6d2105bbd0212c1843ff0ccbae19535ac01cf02ad98aa941fce32fac874cea7f1f83969fbaf025fb562a087efb4652210d45279312da7d +PublicExponent: 0400 +Test: KeyPairValidAndConsistent +Message: abbf5c71245af5d272e627ec845e9ed4 +Signature: b75e2869c052df20d6c008dd911a5bd752d5a23ee42ae47def37f76f6b2d5f04eb8d9b0783c502e0abd30bc567a6672292c3a6736fe8d4034fad857456cd599259d09f42f1d4c64d244fd149f6316f0b763be0de4f9da7f9649a76b984fe2ae99293d406904a9df59d28cc8a58b7ad0029657a47ac0e28d6353287df1ea8feef2fbb65d86425e80487420c1c9c1bda7e +Test: Verify +Message: cf2c943bc4c23175b43ba128c75339d1 +Signature: 64616eb627bf49c2a5a183479a66b7dae12cd1a0982baa0cc12329f594196b9de47909e6b5cf4653bfccdeeb5478fd88c31c197c9adc335a84ec58664ce5fc55c7b2f17b0f32ffac4ff3f3b4ddb3ce125ab7e43efc0be6ae8357895ab5f118a4ec71b57cc1b252373fecd4a1f404ed295f2d97868e3737fdd6fdf124bc2f1e083b57d5c237db775d429d08d5b5ced857 +Test: Verify +Message: 4d011f09f665d5f4a12595900e3827ec +Signature: 1911d3df18bdd9907b69ce6b655086c952c92d826bbef199fb1e0dcb7209a1b28d0a03beabc9e7d8df052febe26f691ff808caaac697c3005d524f3da8c700bf620aa37fd0793b3f22c6a488d733336d040642e0767755391951a754a1111345b912b4c0228ab154eb4baac0383a54023bd7c7ea2ed4bb894444b80d7e5f18407f51c3af858b9fa9198190b4b540fce8 +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/gcm.txt b/external/crypto++-5.6.3/TestVectors/gcm.txt new file mode 100644 index 000000000..bef02679f --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/gcm.txt @@ -0,0 +1,168 @@ +AlgorithmType: AuthenticatedSymmetricCipher +Name: AES/GCM +Source: aes-modes-src-07-10-08/Testvals/gcm.1, Basic Tests for GCM (compiled by B. R. Gladman) +Key: 00000000000000000000000000000000 +IV: 000000000000000000000000 +MAC: 00000000000000000000000000000000 +Test: NotVerify +Key: 00000000000000000000000000000000 +IV: 000000000000000000000000 +MAC: 58e2fccefa7e3061367f1d57a4e7455a +Test: Encrypt +Key: 00000000000000000000000000000000 +IV: 000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 0388dace60b6a392f328c2b971b2fe78 +MAC: ab6e47d42cec13bdf53a67b21257bddf +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308 +IV: cafebabefacedbaddecaf888 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 +Ciphertext: 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e 21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985 +MAC: 4d5c2af327cd64a62cf35abd2ba6fab4 +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308 +IV: cafebabefacedbaddecaf888 +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e 21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091 +MAC: 5bc94fbc3221a5db94fae95ae7121a47 +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308 +IV: cafebabefacedbad +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c7423 73806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598 +MAC: 3612d2e79e3b0785561be14aaca2fccb +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308 +IV: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728 c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca7 01e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5 +MAC: 619cc5aefffe0bfa462af43c1699d050 +Test: Encrypt +Header: +Plaintext: +Ciphertext: +Key: 000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +MAC: cd33b28ac773f74ba00ed1f312572435 +Test: Encrypt +Key: 000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 98e7247c07f0fe411c267e4384b0f600 +MAC: 2ff58d80033927ab8ef4d4587514f0fb +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c +IV: cafebabefacedbaddecaf888 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 +Ciphertext: 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c 7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256 +MAC: 9924a7c8587336bfb118024db8674a14 +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c +IV: cafebabefacedbaddecaf888 +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c 7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710 +MAC: 2519498e80f1478f37ba55bd6d27618c +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c +IV: cafebabefacedbad +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057 fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7 +MAC: 65dcc57fcf623a24094fcca40d3533f8 +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c +IV: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728 c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e45 81e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373b +MAC: dcf566ff291c25bbb8568fc3d376a6d9 +Test: Encrypt +Header: +Plaintext: +Ciphertext: +Key: 0000000000000000000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +MAC: 530f8afbc74536b9a963b4f1c4cb738b +Test: Encrypt +Key: 0000000000000000000000000000000000000000000000000000000000000000 +IV: 000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: cea7403d4d606b6e074ec5d3baf39d18 +MAC: d0d1c8a799996bf0265b98b5d48ab919 +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 +IV: cafebabefacedbaddecaf888 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 +Ciphertext: 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa 8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad +MAC: b094dac5d93471bdec1a502270e3cc6c +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 +IV: cafebabefacedbaddecaf888 +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa 8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662 +MAC: 76fc6ece0f4e1768cddf8853bb2d551b +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 +IV: cafebabefacedbad +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0 feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f +MAC: 3a337dbf46a792c45e454913fe2ea8f2 +Test: Encrypt +Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 +IV: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728 c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b +Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 +Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +Ciphertext: 5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf4 0fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3f +MAC: a44a8266ee1c8eb0c8b5d4cf5ae9f19a +Test: Encrypt +Header: +Plaintext: +Ciphertext: +Key: 00000000000000000000000000000000 +IV: 000000000000000000000000 +Plaintext: 000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f 505152535455565758595a5b5c5d5e5f 606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf +Ciphertext: 0389d8cd64b3a595fb21c8b27dbff077 e784b8b85d5e4f34efe493e48896dfff 002333026a56b2fd08a09c87fcbe85cf f97c902a25bb1f4a43478687f5feb6cd ca9f3fc6ecab732627386ee2996a4cde c5e91f48c293c6a87774b950aeb1d7bf 62321a0d76006297b2d06623cf6e4fb1 433494c3326b0ae914120085a195413f 5e3278e4107d7b08dd2107405610e67d 83ed5b5ba0b591e9e46b1029f5f6936f fdb0e788fc09f60d861a0b3e1ab6294a 76ebdf6663421ef7dd6c1bc448dfcdb7 a0c38bae72fa627ed327f2b46fcec25a 77ee5fd7e3354788643c0d7df15075d5 +MAC: 6b385f3012eafda4189da7ad3b6eafbf +Test: Encrypt +Key: 00000000000000000000000000000000 +IV: 000000000000000000000000 +Plaintext: 000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f 505152535455565758595a5b5c5d5e5f 606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf +Ciphertext: 0389d8cd64b3a595fb21c8b27dbff077 e784b8b85d5e4f34efe493e48896dfff 002333026a56b2fd08a09c87fcbe85cf f97c902a25bb1f4a43478687f5feb6cd ca9f3fc6ecab732627386ee2996a4cde c5e91f48c293c6a87774b950aeb1d7bf 62321a0d76006297b2d06623cf6e4fb1 433494c3326b0ae914120085a195413f 5e3278e4107d7b08dd2107405610e67d 83ed5b5ba0b591e9e46b1029f5f6936f fdb0e788fc09f60d861a0b3e1ab6294a 76ebdf6663421ef7dd6c1bc448dfcdb7 a0c38bae72fa627ed327f2b46fcec25a 77ee5fd7e3354788643c0d7df15075d5 +MAC: 6b385f3012eafda4189da7ad3b6eafbf +Test: Encrypt + +AlgorithmType: AuthenticatedSymmetricCipher +Name: AES/GCM +Source: Generated by Crypto++ 5.6.1 +Comment: long test vector with odd length +IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +Key: 2b7e151628aed2a6abf7158809cf4f3c +Ciphertext: BD70C168B0D4371B0A85B4B5D65D92569B17 \ +F9A3D0A25B9F608E2C34621CF4D37357845431E04E585CDAAD7527BF8A2426DEEF451320C78D5EF0 \ +9F5B11A8B8C700CD329A3D4CDED92C20F6BF28CB3627681C5B0AF2B5692CC7EC9049008ACBBD127A \ +9CD8DEF00425697E0BCF67E05AEE70EA1A5D7EE95E3B88FBAF3C196AAAECB73E09BDF057AF701A02 \ +42394BCC104FF4F75F15D287325FCFFDB7E7FF3A939A80A6A3A9D7570E6EF6AD0BBE6E291338938D \ +2FEBBC7D5EE95CD73E752ACD48915DCAE0A0807E6F4B2ADADBD945667318264EF7D8C2ECC0B8FB67 \ +A43614C5F5EA51CADD4AEE91DC371A7FC5A3B4581D1D9DD99608CD2BB0338F82933C19F5B8EBAD6B \ +BA583835FBD29136302BAC163F86CA9E3E6F3B5BFDEFAB3E4B019190AE2EBC0B71034EA9BF882879 \ +139FFE76DD997F6729425F3D5C5392762C245769D18CC963C92211B71F564203AFBF68626C083303 \ +1D449B02DFA5C0F09FAFCE951FE35F4AD8122AB682A4AF28931113F75615E12DB05DD9247973F1C6 \ +057666848C13EDE41192F38948366D468D84CAF896EFF724082D2BAB2376E2813B41A014999B0EE7 \ +377758715D9554926AB3514EEB96A0ABD501D94A05692D858190D5AD307CEB6E6C8A63841A8257BE \ +C2527C4B937840AA51292E15834AB801F0275A6A4B1B6E969B7A7FCE217D6F823CDE1760F847E8F4 \ +6CBDE152A24F2319EC2A7089D2954259D30332089FF928034391D1B0B8AFD7C8A5D4F8E0DAB5883C \ +A7D581F78E4848DC3B01E5F2A5C01BA8910D0F144BC494E29450271174B866868EE8DC6B0DD396ED \ +9D72F83DE3BB6DE6FEBC64178961E011D0D746C2CE3A0FBD05CDF8FA79AC03E94C88368BD903E142 \ +7FCFC30C9D100E220B4CB9B7BA242DA49D334E930B6C4EB877D1DF2C0F8CF4AF7813E2F295929707 \ +19846FC52A47FCE6E71DC5E58FC5F49C91BDE56B7A2A68CFA994D6BFA5357A8403A2B37C69A6A0A4 \ +35E4AB4C9E450473AF0CDFDBCC238A2DD7 +MAC: 4FEA89D75727E82B3A9F9EEB5E217A3E +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/hkdf.txt b/external/crypto++-5.6.3/TestVectors/hkdf.txt new file mode 100644 index 000000000..09af373ec --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/hkdf.txt @@ -0,0 +1,175 @@ +AlgorithmType: KDF +Name: HKDF(SHA-1) +Source: RFC 5689 +Comment: Test Case 4 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b +Salt: 0x000102030405060708090a0b0c +Info: 0xf0f1f2f3f4f5f6f7f8f9 +DerivedKeyLength: 42 +DerivedKey: 0x085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-1) +Source: RFC 5689 +Comment: Test Case 5 +Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f +Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf +Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +DerivedKeyLength: 82 +DerivedKey: 0x0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-1) +Source: RFC 5689 +Comment: Test Case 6 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: "" +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0x0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-1) +Source: RFC 5689 +Comment: Test Case 7 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Salt: "" +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0x2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-256) +Source: RFC 5689 +Comment: Test Case 1 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: 0x000102030405060708090a0b0c +Info: 0xf0f1f2f3f4f5f6f7f8f9 +DerivedKeyLength: 42 +DerivedKey: 0x3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-256) +Source: RFC 5689 +Comment: Test Case 2 +Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f +Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf +Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +DerivedKeyLength: 82 +DerivedKey: 0xb11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-256) +Source: RFC 5689 +Comment: Test Case 3 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: "" +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0x8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-512) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 8 (Mirror Tests 1 and 4) +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: 0x000102030405060708090a0b0c +Info: 0xf0f1f2f3f4f5f6f7f8f9 +DerivedKeyLength: 42 +DerivedKey: 0x832390086CDA71FB47625BB5CEB168E4C8E26A1A16ED34D9FC7FE92C1481579338DA362CB8D9F925D7CB +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-512) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 9 (Mirror Tests 2 and 5) +Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f +Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf +Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +DerivedKeyLength: 82 +DerivedKey: 0xCE6C97192805B346E6161E821ED165673B84F400A2B514B2FE23D84CD189DDF1B695B48CBD1C8388441137B3CE28F16AA64BA33BA466B24DF6CFCB021ECFF235F6A2056CE3AF1DE44D572097A8505D9E7A93 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-512) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 10 (Mirror Test 3 and 6) +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: "" +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0xF5FA02B18298A72A8C23898A8703472C6EB179DC204C03425C970E3B164BF90FFF22D04836D0E2343BAC +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-512) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 11 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Salt: "" +Info: +DerivedKeyLength: 42 +DerivedKey: 0x1407D46013D98BC6DECEFCFEE55F0F90B0C7F63D68EB1A80EAF07E953CFC0A3A5240A155D6E4DAA965BB +Test: Verify + +AlgorithmType: KDF +Name: HKDF(SHA-512) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 12 (Mirror Tests 3 and 6) +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: "" +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0xF5FA02B18298A72A8C23898A8703472C6EB179DC204C03425C970E3B164BF90FFF22D04836D0E2343BAC +Test: Verify + +AlgorithmType: KDF +Name: HKDF(Whirlpool) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 13 (Mirror Tests 1 and 4) +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: 0x000102030405060708090a0b0c +Info: 0xf0f1f2f3f4f5f6f7f8f9 +DerivedKeyLength: 42 +DerivedKey: 0x0D29F74CCD8640F44B0DD9638111C1B5766EFED752AF358109E2E7C9CD4A28EF2F90B2AD461FBA0744D4 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(Whirlpool) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 14 (Mirror Tests 2 and 5) +Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f +Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf +Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +DerivedKeyLength: 82 +DerivedKey: 0x4EBE4FE2DCCEC42661699500BE279A993FED90351E19373B3926FAA3A410700B2BBF77E254CF1451AE6068D64A0904D966F4FF25498445A501B88F50D21E3A68A890E09445DC5886DD00E7F4F7C58A512170 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(Whirlpool) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 15 (Mirror Tests 3 and 6) +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Salt: "" +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0x110632D0F7AEFAC31771FC66C22BB3462614B81E4B04BA7F2B662E0BD694F56458615F9A9CB56C57ECF2 +Test: Verify + +AlgorithmType: KDF +Name: HKDF(Whirlpool) +Source: Generated by Crypto++ 5.6.3 +Comment: Test Case 16 (Mirror Test 7) +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Salt: r64 0x00 +Info: "" +DerivedKeyLength: 42 +DerivedKey: 0x4089286EBFB23DD8A02F0C9DAA35D538EB09CD0A8CBAB203F39083AA3E0BD313E6F91E64F21A187510B0 +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/hmac.txt b/external/crypto++-5.6.3/TestVectors/hmac.txt new file mode 100644 index 000000000..2a604bba6 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/hmac.txt @@ -0,0 +1,281 @@ +AlgorithmType: MAC +Name: HMAC(MD5) +Source: RFC 2202 +Comment: Test Case 1 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: 0x9294727a3638bb1c13f48ef8158bfc9d +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: 0x750c783e6ab0b503eaa86e310a5db738 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: 0x56be34521d144c88dbb8c733f0e8b3f6 +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: 0x697eaf0aca3a3aea3a75164746ffaa79 +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: 0x56461ef2342edc00f9bab995690efd4c +Test: Verify +MAC: 0x56461ef2342edc00f9bab995 +#TruncatedSize: 12 +Test: VerifyTruncated +Comment: Test Case 6 +Key: r80 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 0x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd +Test: Verify +Comment: Test Case 7 +Key: r80 0xaa +Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" +MAC: 0x6f630fad67cda0ee1fb1f562db3aa53e +Test: Verify + +AlgorithmType: MAC +Name: HMAC(SHA-1) +Source: RFC 2202 +Comment: Test Case 1 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: 0xb617318655057264e28bc0b6fb378c8ef146be00 +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: 0x125d7342b9ac11cd91a39af48aa17b4f63f175d3 +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: 0x4c9007f4026250c6bc8414f9bf50c86c2d7235da +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: 0x4c1a03424b55e07fe7f27be1d58bb9324a9a5a04 +Test: Verify +MAC: 0x4c1a03424b55e07fe7f27be1 +#TruncatedSize: 12 +Test: VerifyTruncated +Comment: Test Case 6 +Key: r80 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 0xaa4ae5e15272d00e95705637ce8a3b55ed402112 +Test: Verify +Comment: Test Case 7 +Key: r80 0xaa +Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" +MAC: 0xe8e99d0f45237d786d6bbaa7965c7808bbff1a91 +Test: Verify + +AlgorithmType: MAC +Name: HMAC(RIPEMD-160) +Source: RFC 2286 +Comment: Test Case 1 +Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: 0x24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668 +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: 0xdda6c0213a485a9e24f4742064a7f033b43c4069 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: 0xb0b105360de759960ab4f35298e116e295d8e7c1 +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: 0xd5ca862f4d21d5e610e18b4cf1beb97a4365ecf4 +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: 0x7619693978f91d90539ae786500ff3d8e0518e39 +Test: Verify +MAC: 0x7619693978f91d90539ae786 +#TruncatedSize: 12 +Test: VerifyTruncated +Comment: Test Case 6 +Key: r80 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 0x6466ca07ac5eac29e1bd523e5ada7605b791fd8b +Test: Verify +Comment: Test Case 7 +Key: r80 0xaa +Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" +MAC: 0x69ea60798d71616cce5fd0871e23754cd75d5a0a +Test: Verify + +AlgorithmType: MAC +Name: HMAC(SHA-224) +Source: RFC 4231 +Comment: Test Case 1 +Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: 0x896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22 +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: 0xa30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: 0x7fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333ea +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: 0x6c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5a +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: 0x0e2aea68a90c8d37c988bcdb9fca6fa8 +Test: VerifyTruncated +Comment: Test Case 6 +Key: r131 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 0x95e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870e +Test: Verify +Comment: Test Case 7 +Key: r131 0xaa +Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") +MAC: 0x3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1 +Test: Verify + +AlgorithmType: MAC +Name: HMAC(SHA-256) +Source: RFC 4231 +Comment: Test Case 1 +Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7 +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: 773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: 82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: a3b6167473100ee06e0c796c2955552b +Test: VerifyTruncated +Comment: Test Case 6 +Key: r131 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54 +Test: Verify +Comment: Test Case 7 +Key: r131 0xaa +Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") +MAC: 9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2 +Test: Verify + +AlgorithmType: MAC +Name: HMAC(SHA-384) +Source: RFC 4231 +Comment: Test Case 1 +Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6 +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: 88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27 +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: 3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffb +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: 3abf34c3503b2a23a46efc619baef897 +Test: VerifyTruncated +Comment: Test Case 6 +Key: r131 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952 +Test: Verify +Comment: Test Case 7 +Key: r131 0xaa +Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") +MAC: 6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e +Test: Verify + +AlgorithmType: MAC +Name: HMAC(SHA-512) +Source: RFC 4231 +Comment: Test Case 1 +Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b +Message: "Hi There" +MAC: 87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854 +Test: Verify +Comment: Test Case 2 +Key: "Jefe" +Message: "what do ya want for nothing?" +MAC: 164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737 +Test: Verify +Comment: Test Case 3 +Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Message: r50 0xdd +MAC: fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb +Test: Verify +Comment: Test Case 4 +Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 +Message: r50 0xcd +MAC: b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd +Test: Verify +Comment: Test Case 5 +Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c +Message: "Test With Truncation" +MAC: 415fad6271580a531d4179bc891d87a6 +Test: VerifyTruncated +Comment: Test Case 6 +Key: r131 0xaa +Message: "Test Using Larger Than Block-Size Key - Hash Key First" +MAC: 80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598 +Test: Verify +Comment: Test Case 7 +Key: r131 0xaa +Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") +MAC: e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58 +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/mars.txt b/external/crypto++-5.6.3/TestVectors/mars.txt new file mode 100644 index 000000000..01530e073 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/mars.txt @@ -0,0 +1,66 @@ +AlgorithmType: SymmetricCipher +Name: MARS/ECB +Key: 80000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: B3E2AD5608AC1B6733A7CB4FDF8F9952 +Test: Encrypt +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: DCC07B8DFB0738D6E30A22DFCF27E886 +Test: Encrypt +Key: 00000000000000000000000000000000 +Plaintext: DCC07B8DFB0738D6E30A22DFCF27E886 +Ciphertext: 33CAFFBDDC7F1DDA0F9C15FA2F30E2FF +Test: Encrypt +Key: CB14A1776ABBC1CDAFE7243DEF2CEA02 +Plaintext: F94512A9B42D034EC4792204D708A69B +Ciphertext: 225DA2CB64B73F79069F21A5E3CB8522 +Test: Encrypt +Key: 86EDF4DA31824CABEF6A4637C40B0BAB +Plaintext: 4DF955AD5B398D66408D620A2B27E1A9 +Ciphertext: A4B737340AE6D2CAFD930BA97D86129F +Test: Encrypt +Key: 000000000000000000000000000000000000000000000000 +Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Ciphertext: 97778747D60E425C2B4202599DB856FB +Test: Encrypt +Key: D158860838874D9500000000000000000000000000000000 +Plaintext: 93A953A82C10411DD158860838874D95 +Ciphertext: 4FA0E5F64893131712F01408D233E9F7 +Test: Encrypt +Key: 791739A58B04581A93A953A82C10411DD158860838874D95 +Plaintext: 6761C42D3E6142D2A84FBFADB383158F +Ciphertext: F706BC0FD97E28B6F1AF4E17D8755FFF +Test: Encrypt +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 62E45B4CF3477F1DD65063729D9ABA8F +Ciphertext: 0F4B897EA014D21FBC20F1054A42F719 +Test: Encrypt +Key: FBA167983E7AEF22317CE28C02AAE1A3E8E5CC3CEDBEA82A99DBC39AD65E7227 +Plaintext: 1344ABA4D3C44708A8A72116D4F49384 +Ciphertext: 458335D95EA42A9F4DCCD41AECC2390D +Test: Encrypt +Key: 00000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 3FE24DC09173D15F4616A849D396F7E3 +Test: EncryptionMCT +Key: 00000000000000000000000000000000 +Plaintext: 24BD3D2FC6FEE152D1D64545E2230584 +Ciphertext: 00000000000000000000000000000000 +Test: DecryptionMCT +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: 34EC834E2F30741ECB476DA7E9662BBD +Test: EncryptionMCT +Key: 000000000000000000000000000000000000000000000000 +Plaintext: 7F27C3397A8CEEF1BDF859459690FEA8 +Ciphertext: 00000000000000000000000000000000 +Test: DecryptionMCT +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 00000000000000000000000000000000 +Ciphertext: EDE145C10E279501D921C5E3B04420A6 +Test: EncryptionMCT +Key: 0000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 95615ADB0DDF6613A5E84F849AC8C00D +Ciphertext: 00000000000000000000000000000000 +Test: DecryptionMCT diff --git a/external/crypto++-5.6.3/TestVectors/nr.txt b/external/crypto++-5.6.3/TestVectors/nr.txt new file mode 100644 index 000000000..f08bb6ac5 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/nr.txt @@ -0,0 +1,615 @@ +AlgorithmType: Signature +Name: NR(1363)/EMSA1(SHA-1) +Source: generated by Wei Dai using Crypto++ 5.0 +Comment: 1024-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 09b2940496d6d9a43bb7ec642c57b302e59b3a5155 +SubgroupGenerator: \ + a1c379ba91fe1f9d5283807b809c698bce4aee6f405f4de8c46becf33c08a63b\ + c5f8088f75b5b6bcfb0847ccbdee700e4e698652317bbd7a3056404c541136d7\ + 332c2b835ef0d1508ef57b437de60675f20f75df0483f242ddeb57efacd18041\ + 8790f4dec0a8250593ba36f17316580d50db1383ea93a21247650a2e04af904d +Modulus: \ + bd670f79b0cde98a84fd97e54d5d5c81525a016d222a3986dd7af3f32cde8a9f\ + 6564e43a559a0c9f8bad36cc25330548b347ac158a345631fa90f7b873c36eff\ + ae2f7823227a3f580b5dd18304d5932751e743e922eebfbb4289c389d9019c36\ + f96c6b81fffbf20be062182104e3c4b7d02b872d9a21e0fb5f10ded64420951b +PrivateExponent: \ + 0355dc884345c08fb399b23b161831e94dbe61571e +PublicElement: \ + 255cf6b0a33f80cab614eafd5f7b2a6d83b3eafe27cd97b77ae70c7b966707d8\ + 23f0e6aaaa41dc005aaefd3a0c269e60a665d2642f5d631ff1a3b8701bc06be9\ + c44ab7367f77fefeec4c5959cd07e50d74a05af60b059ad3fc75249ecf44774b\ + 88b46860d9c3fa35d033bcfc7b0b2d48dc180d192d4918cddff4f7ebcdaaa198 +Test: KeyPairValidAndConsistent +Message: 66B92E1E2C44B80F7BFA +Signature: \ + 06e7586b76d5a8270155cce2d3ff4495237eed29a101eb1341fce0b43d95397b\ + 053d93772b0a9cf3117b +Test: Verify +Message: 973266BB0A492248082A +Signature: \ + 02de44ed2233f0f11dcf567217d2089ec039a211bf000d42e04900a66ce45c58\ + 526a97d7f4cfba29e43d +Test: Verify +Message: 9A6D079ED0CA9D8B40E8 +Signature: \ + 04f59dbb2712926b3bc1d3c428f16203f3443f88db0669adda94dcb54e1fff71\ + fb51bb603e7adff13f84 +Test: Verify +Message: AA34DCE67BCDAC927DA6 +Signature: \ + 08ad21bf9d0cc598a214329d3544685d39487988bb01aced68ad0a4831affbff\ + 3b14df6c0f4ac4d2e967 +Test: Verify +Message: 4EDAC08816AFDBF284DA +Signature: \ + 09a9d5aa9bd1b6b61fe8825128c8e52a6213692b2504c8c6951299b5ca51b03d\ + ea0a5e56f9a7c4cd44f7 +Test: Verify +Message: D82F2E903230962B8174 +Signature: \ + 0441c8d089e690a7fab391de07073326d443a0d9d806a3997ac1641175310890\ + 1e55582a582541330539 +Test: Verify +Comment: 1025-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 0b3949dadf3196f08bca0606f06443afce2fb1d02f +SubgroupGenerator: \ + 015f0f6d1729ef2af723c00e36450a04c7e7681d65b74a6417a53b3eb6036989\ + eff8e0ab11a7ec3ce2340b7c7a92e1a977aee52555c06c12c4cc28496ddc2598\ + feeb7539ce90d3888e21f61d7f14746cf67d9fed373afd97e2483700e300ed9d\ + a25e7200b363a4727ad201194b36ea5f816cf83488c3e527d3a5515870d2da63\ + d6 +Modulus: \ + 017310bf02d70ef2cee45d1cc47ec8ce8cabdd6bf32a560975a42ef057bf9dfd\ + 553bc9368ddb154a55d855edaa755e69f511a4c69ba78571cc4b14ddbb0f32a4\ + a9c56c286305aa21ec4e35de7390747477b3bd574e7b87cbebde2f665703137a\ + 1172350ad2f48a0884d076ada9db82f104e6b0ad86693cd4adbd0067639102fc\ + f1 +PrivateExponent: \ + 0696b0f255468b7ac18e11632f208ca86383a46724 +PublicElement: \ + 45bf83e62f50190374b23de5e4a1d0278e9e8e6c8335577d62e80662a380c206\ + e326819c5082d321dfda1f905fa5a3ead9a2dc769885a27b1fd6a133185dc5a7\ + 876a76ab0a09fe02b7071a924169e4d2d2a67e67ed3628800134183b962c0b31\ + 3463aa154e6437d644e025ab234e63d19c129842a61c5e5ea5a06466c858c81c +Test: KeyPairValidAndConsistent +Message: 2F585D0CE4FA1CD93880 +Signature: \ + 06586d8a703cdc27200d5261853f50effa8ebbdfc905f5becb68b81eca506992\ + 50fb54e46d557c6095dd +Test: Verify +Message: 4F09A1F217B8393199EE +Signature: \ + 0622cd33b1d715829d8fae104759ed449f95becb5e03d36f5578fd6a2951d2e6\ + 26cfce85ba6563990d64 +Test: Verify +Message: 03D7110A753B008A76A0 +Signature: \ + 02925630b4c80e604fc1d8680bfd0e3d878e22b3a30ab8b10da7fc38816a8c5f\ + 1e06927c68f9d3db60d9 +Test: Verify +Message: 129F4781D417671F886D +Signature: \ + 016c2c4ce845b4d412828cbb8a396d080c7eb93bcb01f7010410198c8bac96df\ + 8ab8761cebdb7d87f3a2 +Test: Verify +Message: 3E1594F559D1248D1112 +Signature: \ + 080bab68c62be86ab2c1bfd0edf10387a7cd66b69f054e254218e01f650e4e8c\ + 6bfa10054e367893e59e +Test: Verify +Message: D6F0354F1B6B253B6997 +Signature: \ + 08755c7e8012e8160db75c6160686351e5c577207f01602b4dda2fa56b864374\ + 703c83bb323c7bb34f5f +Test: Verify +Comment: 1026-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 36bb68cd95dab195f14c4534283e7ea50b00cc31a3 +SubgroupGenerator: \ + e2782ad6992f4b7e88787b4d616744b60e095575a177569c4a069e311e38b724\ + 0c43343367e23574c30e4d9f05afe1fbe61423bab715915c4ccf28aa0ed2f52b\ + 092b86c8ec1f9d4795d6e91c88ba41297625c11a9e1f4f182da13cf51e541038\ + a1266bf32b2dd81ecd84bb80be8fdf97689942e944b7fbb6981e00cd680ee25f +Modulus: \ + 025098828217d00108030801e5f135fc6fd3010be39e49060a96addc8a081198\ + 803402c4b46e4ce0750fcbab8cf084c7ca8cae09f1b5482d336fa3af47b96791\ + d02d8143e274b1325f2213e17f9384c805f479e52a3117cf84869d395f1bc025\ + c918484478d2da1880d32bc519f4e6b2fd2d46958795550ce1765f725626f3fc\ + 17 +PrivateExponent: \ + 2db270c284328353f979cad99f4133c53acaa6ee71 +PublicElement: \ + 0179b283f67868aeded3a0c5633d0e6c18fad77174e2c89c03452593d05e77a9\ + fb029c0ccb2b6f2328e79c286ee392713f12d9d45578348383b81d11b0e0f7e8\ + 9965a7785d5ab64ea25bb73e8acaa8e84cb9897985015757a48c0b1dac3a6a60\ + 6fe671ea073ec434a46f227b8d4b02a46fbba2f6c6216736d669f55778d81004\ + d8 +Test: KeyPairValidAndConsistent +Message: 7E4F2ED4E79062778A2D +Signature: \ + 03f523873462ee1513833e2853c3b62e30c5c1cc3224f1a42dc154fa84ecce04\ + 487069530d76e0574a38 +Test: Verify +Message: A0E35846B5CF1B5BF560 +Signature: \ + 2264285d75a55c431a7adb9347bc07d58efbeb1dd9354d01b0b86f2875f8dec0\ + 294d20289d39369c5afa +Test: Verify +Message: 3B138785EFC6F520EAE0 +Signature: \ + 116e45961ca73f3ccf08b35f94877fef88772cf0fa2ab196c85a91104d8fbde6\ + 65b7032b2fb4011a88cc +Test: Verify +Message: 0F6BE2AA764B485145D4 +Signature: \ + 027ad753bde13c7f2fcd7571e5558f8af756cdb9463237fb0e285cb633cc86be\ + 1b410188d701f6ca83c6 +Test: Verify +Message: 6CD9FBD23EA58826FB04 +Signature: \ + 1651decd376899104e3fdbe40ab2d9bfd3c8577f3b092b66e3760678ecb3fc35\ + 23a59107e0bdccb76a73 +Test: Verify +Message: 473A82649565109E9E89 +Signature: \ + 2045ef56d92f89a214d76cca6b591068ac5f0d008c121ec4e5c4c1e8ca9b67cd\ + bb5ecc776a23b6d54ba5 +Test: Verify +Comment: 1027-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 291d0ba731a4303070504d8b9615640a5e1345e00f +SubgroupGenerator: \ + 051c9d0270b69ceef82af5aed5f91dc88d585096609d835d03d39cf3ce74f5a3\ + 402d4e8e192455493da61cc58ee6f54dd941172be3d7642169cbc52273f4b725\ + f1d6c820c3333336c64d32fb6238121b3ccb7c71b847764946bb0887a44ca9de\ + 802cda62efa9dda573751084225353f11ed837f3dc25de8374b6fdbfb6e313e4\ + 6d +Modulus: \ + 055402a8abe9cda3072ca8601d68032651feb0335856e57f8f8d4ec949098a64\ + 59151cefeef91b7aa733668c8cf0e9b96c93c61f3528d4036daa6565646f65d7\ + 4c4552817df7e5fb1cc421cfd885e27bb811ad227e81b3fa02f7a00bf01ee6e2\ + 3fb5572a75f8f29b58bd5f7db435e8a92a923f15d50f34213d29816921bf195b\ + 2d +PrivateExponent: \ + 13b27094d9a5a3a9704cebdbe890da325fa26ad555 +PublicElement: \ + 03b06b99097cd7145c7d7782b02e247a4741f3c7f39233627f17e13ebff89a18\ + cad6a454c3f32f7ef2910384030da71ae47e1c3fa79c2141dad107f8e715e47f\ + b0bb626baafc35db769852ebbec2d339c3c3d5f2287cfdd20b3b78ea4607086c\ + 42558ae4637eddd6a74bc1072d0f34d9c0130cbc9e84f537e7ce50df502d17b5\ + c3 +Test: KeyPairValidAndConsistent +Message: AE6DCD9535AEEE3ECC89 +Signature: \ + 1c6794878aabf07cf9f59b685d4a3a6e51c9135dc101a4a6a62c95a20902e2fa\ + 23db7d15293f595f86ab +Test: Verify +Message: C83A14EAC016D659F9FE +Signature: \ + 18ed4812925dca6a9c30e2e3566433e202be2d305414e1e6583905ad845cbc63\ + 2049804932aac79b858c +Test: Verify +Message: 745E02041EB487D16CE6 +Signature: \ + 13d4ef1de59ef0fe9bc4ecc6d382908642f6f5793e255b819e25ed124f7fa574\ + d91fc2e9b258f0514b15 +Test: Verify +Message: 62F019655A83501FC4E7 +Signature: \ + 07f797768984ecc792f366ece16f5102aec2aac6d31fdaf3972839cac2c99a2b\ + f5b347c887d37943383c +Test: Verify +Message: 351D37A4B5046E885EAA +Signature: \ + 22064cd5179ff1551dbf73c5220e17a9dfa1aa8f7f22f44a6c70f13c6d0a21f8\ + 7e53278251037a6cdc5e +Test: Verify +Message: 4073D33915F595F4FF9D +Signature: \ + 1f902ea2c9521b8c7f11619d35dd22a4667e2eb89a017194bb68ec0a9df762c9\ + 377c1c075b5f09566048 +Test: Verify +Comment: 1028-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 2368e2b864b250ad45406391e7eeaa3d27cd053c2b +SubgroupGenerator: \ + 07c325695dfe315a77ad7b42f0d18f9d4821b5c153fee7385877602fa54477bb\ + 8c0639d2438f34352b97c22d02a7295d2b53d5286a01caa919d6283614690624\ + 240af922675ccd4a0534ec336cb79cde31b02b5988cc5a53ca17790d67d803a2\ + 7bb927b9c59bdc6ac794175e285cafdece6778ab19a0b444747fee20d5bf929e\ + 70 +Modulus: \ + 0abdeff64b6f28256e4562109bffed29cb5aa95d89cc0ec95da0e773dbff3467\ + c271bbb1e1fbb6af058517fdacdf26b5919674c625eced6317d8631c063f43b3\ + ade2cd633d554913339071d6ebed5fd665fc5dd7d47b80721a976c3b14fbd253\ + f0f988c354725289f2897df0a15985c92b2d4da8d087870c251c72d979b8304d\ + 51 +PrivateExponent: \ + 0771305163506b2b83bd5279935df1b5fcf180b004 +PublicElement: \ + 043e4ae6244408879264fe6b859b578218705b9a45af22efded27141b7f090cb\ + cbe42dcf481df3e41b13920ae02b694eaa6bfd62f2d3c5d677b8c4ce783cbe27\ + 89e088b04489ef535ad4a517351c8835cf128f7ec677a1b1dbe3ae9cc4198ddb\ + 6e1cef8e978c0725f5063797bc43eb9ae496286cccbad5d4e026e9edb997d2f9\ + 18 +Test: KeyPairValidAndConsistent +Message: 4867852C83F181CDD010 +Signature: \ + 1db6a5661b20c9289428c3b9ebf65d5a8f757f3a3b1eb15dfaf0c8cefc891954\ + b48279eb45910a141ec3 +Test: Verify +Message: DA6493C86D6B62C5961C +Signature: \ + 1c05300a56319ba4a8ace1206f5f37b5bbefc9d80a171a57b6da3c02aa1f3079\ + 70583c008f073996d932 +Test: Verify +Message: AE2C1136BFE966794A6C +Signature: \ + 02dfd79eb18f3a862b11a5d199a7db1dc53580ade90517a7739cbd8ab1849c44\ + 54ba17a69b8d03ecc4f9 +Test: Verify +Message: B20160E0442E726BE749 +Signature: \ + 14c0cf809174d39f1324b7dd0d6d1fb3be5b5577c10048b12def39772fa60cd5\ + a9d2cca9075f12e5a3c1 +Test: Verify +Message: 3638935C4492F5CA42F2 +Signature: \ + 0081d7216636bc6fb9bc7a637a377ebf4f9048826e0360c8faf03dd28c4ee4a4\ + da82689259f140b3d918 +Test: Verify +Message: DFB674CA6E0FDC0CBE99 +Signature: \ + 1e3e21aa3dcccddb8cf3e360631fc36956263951ff18fec553531252b4dbe753\ + 6ed5fc62897d51500c38 +Test: Verify +Comment: 1029-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 3357536531dec150be0ef8747f69ea30d987ff7df1 +SubgroupGenerator: \ + 067dd80dbc6b41f58d08f077a9a3dcbfe12a62065fe6b4691c457f506b56dcab\ + 0433b3aad6ef962501633d0f3947b491a1317e7e6b632f062c53104d609c9222\ + b056f08a0c83662a70744331fd09b2b42fb0768e52da27e92732106fbd41ec73\ + 7373fd080b56b543d808d49eeb6e1bb0a8619b1edee8fb8295dc042423f684af\ + 8a +Modulus: \ + 1d0f176b6799b36724c92954c38d0288fa95400c2b14e064f76a6338fccaebca\ + 8d978b93bb76507bc150a50f9fe799fffe12ae2875b13ac1084ffcfde9f62b86\ + 185a72f04ff80538d6eac177edc98d61a517b1275bcf4b57aa262e1702d623bc\ + 344db7e5621c949a9b12e9936e88fae9b200a1f8ad5b40ec8220aa301267f38d\ + d7 +PrivateExponent: \ + 2dcdc00a86ecc2a60ebfa6660a83af1d7c3e570b85 +PublicElement: \ + 13834f0fa1f42abf7dbd264cb7d2eb5798da8972df67f517c62d7ae5070fd588\ + d61db62e492f9654833e876ed5737df35069f5ee01a45de881d8f5e68ec52ad9\ + ef32780e8c453a5f1e38cc17bc5cd061a3c122080f6e1b82d31877e8b08f634f\ + 497bd90b06824eaa0416c64104ce5622c272673d0dedb836ac7d47e0cea06739\ + 02 +Test: KeyPairValidAndConsistent +Message: 1E34034C47FE533F8FF5 +Signature: \ + 05c110848feacc9ac762ffa14943f9ce9a111777de0502d9f364ad9b2df4e1a8\ + 17bc15a602579b3a6a25 +Test: Verify +Message: 53D2CA23AF7DF95634F0 +Signature: \ + 14009997efeb3fd246956e44b5b0e48581ac5f414613b41fe5842c85b031ab8a\ + e68f66f8e1f1f9fc1d74 +Test: Verify +Message: 0F056E08AE77B3B30F33 +Signature: \ + 1beedf85b426d36a657f422ab9a9132986eaf415332816d33d70c726c3066158\ + c6481fd00503ffb65518 +Test: Verify +Message: F08C80E8FD38A3867B76 +Signature: \ + 0a23b8d8f920cfb0dec93725e4972080445647c54227fb987dd9f80fab446c75\ + 1c2594276168aa68f318 +Test: Verify +Message: 6D392690B92B3E75020F +Signature: \ + 18668f59c6974dad551a89bec5cacf0bf8617e8f43052eb97d7a1b12411b27b7\ + 4248b3d1f5070823e951 +Test: Verify +Message: 10AE0E091A267641FACF +Signature: \ + 1b3d10f74fdaed3d4d61fedfa3f6ad3a37c0cf6687166a312d5b280724c3545d\ + 225e1fe0639cfb1113d6 +Test: Verify +Comment: 1030-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 27c7996c1d3729c4cf1de06529e5619771e27ad9eb +SubgroupGenerator: \ + 0d87a4b01385da7f43b6277933c5f0dc8072dcacd5252e1b29f588114a7ac56e\ + 377050aa8174b5dda400f043234e4a746442792734dc80274a00a3676101be94\ + 759fc2630b9a858966488b12611d03d0b31e7243e124497a754544cee1db10bb\ + 0a81cf0b2a68045b76fe935f641c666fdc788a2b968c6668c669115756b961d9\ + fe +Modulus: \ + 2a32d68d31248024053bf628a94404b9a49d91ade4d7a45b071e93292a7f8c26\ + 61d9165f0ab85491d4b0dc67d335fa7d7dd172cb17193390a55eb000aa97e2b8\ + ed3ee64b73aa43ea9b8979132c2d966ab03c42cc14782c96e4284ee1136b8515\ + 007ed1b1a5708b5e8d81304fa651edc715918e2299cfe9016dfec5f454d907f5\ + 9f +PrivateExponent: \ + 091155581ecb7a0a792ba95c772d9382298bfdfa6f +PublicElement: \ + 0d7d22c931422fc46505887559a51490c2e367cdb40242cdbaeb23024693fd5c\ + 68f6a3307ca34b224457d5aa610b90eca3b39905481daaba7151318f09f974ad\ + 664546d14c87f797e38139ee1e07adba9c775e07b7f7b3edba87d886920d6b2c\ + ef5f084359566b0a3b8b940a65b9ad93fd7ccd1354cdcee3c43c6bd315180498\ + ad +Test: KeyPairValidAndConsistent +Message: 23EEE1D0EA8950B8F322 +Signature: \ + 18fe1a5f61c4946810e82a1e30fb6c87ce4ad9cebb1ae27eebfa8779fe292b2a\ + 451be3506bb65519dfd0 +Test: Verify +Message: 13FA6F2816FB83190A21 +Signature: \ + 2161a5be85f7ffe806df00f4bd50915e4b0674e7591f1c0902153823f881bc7b\ + 3f093d92bf86b74b5b3e +Test: Verify +Message: D071CCC0C6E4CAE82E5A +Signature: \ + 059158b2cf143f38eb8c51088dd79bf45990e596c8026fa3de5e668368b9d8d7\ + fe9ffdbdecf66aaf02bb +Test: Verify +Message: 22CE83F4803BF3EA2C48 +Signature: \ + 073b56d72a5b706455cfdcbf85b75ee45c40e96dd21a5460542ade665e51a85c\ + 510315a50307c2bbdb2d +Test: Verify +Message: 7A927EC7BB9CA16C1B0A +Signature: \ + 254c7525aad9b4b3807b3900a963fbf42f9ff2144820ea69abe5ba2c80613510\ + e1429ebc726fd0a87a4c +Test: Verify +Message: 9591B069993E10BC0B84 +Signature: \ + 0ed4210e5e4f2f9546ea181c4a61d062a1158810071905b180dbf070b480f436\ + 0b1f66065ecf111741cf +Test: Verify +Comment: 1031-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 26f86a81a6bb530c2f9b63e3690e95a0894575f445 +SubgroupGenerator: \ + 1e24828adb4ebf2becdbdcadf6706631293ad6566803d12479f04a7bb20b6086\ + fe81df164f8bd02c5f418c1140d143f11a71170b42d0753c952bfff951b9ca42\ + 04868375efaa4afad50b75787e41c5ab9ce8adcbccecd3716f350bb8aaeca9b6\ + 098bd0002d789e1f7db9c19d9045499877b93ecb4e7c64808b742063bbecf60e\ + 29 +Modulus: \ + 4d58515f7b41c4fc87e4fcefe5cf6d84b2d74a9d6f498ae9605fcbf1c5921742\ + 2001a272ef91dbd09e7af5ee54126dd4fc44bb1ed624d0dd5dafb984d5278114\ + 0bba40600cbd4752d2c32b43253efee57af6964c339570edb24195502e6d424b\ + 84bed65ac98c6fc52ec90e40a525f1863a53f2fbe2a0a133342eff4337f26ceb\ + 93 +PrivateExponent: \ + 0e61a054ee6510734a80f67a54d8c4151c957ef16f +PublicElement: \ + 19b50f1eea45bfaa22352a38f3c3b86d6f670747ac2fd94359608e25f2bb9f60\ + 2506bc357245deeb4c3c702d435c557da4f4a9fd37330a75547c91681fdbb51f\ + 286adb498d1e489e89b2e6a4eb9ff30222c51fefbeac7435f629f536ac2d6b87\ + 664d80e5c97398cf489a1d1ca217f7f21ea8e409f938378875cf5f528162e3bc\ + 07 +Test: KeyPairValidAndConsistent +Message: B4B3C8FBE82013228A21 +Signature: \ + 0e1003dd216194ded89f7d10b35a266ca7587d8cfb06a1fe3dd43f07dea4a6d6\ + acaa1477f2552c9b3114 +Test: Verify +Message: 17D2D18302173E2CE992 +Signature: \ + 027b40cd9a159257a57efae3a657399a3b6d8b06f707ba3a323abc383a93f919\ + 1246c38c03b028be05df +Test: Verify +Message: 8032AE177D6DF38C7E27 +Signature: \ + 1f5e3d759e3b832f5a6c57b055764ff5b8ad942dd819610ef94cfec296cd1b56\ + 4fd0b18bfa08c3645db3 +Test: Verify +Message: 768640A60A3C62E02428 +Signature: \ + 0abe2dfabc81ab677d2cbd781ef9768325a5d6d15a22f41b32972bd67058e617\ + e28c7e0dfbaae535d655 +Test: Verify +Message: B0999CA45B77ED63639D +Signature: \ + 1525539cd207d5f6f915eb2731b6451e38e11e0a031d7e420e0bb95d6616d8ef\ + 35d20eb43c111f8f9ca1 +Test: Verify +Message: 587EDB968FA82C12C930 +Signature: \ + 024ed20dc19a07e00158aa2fe9cb6353f0112b8fab0e6775667115e1c92e5eb4\ + 29876c12ed48e996f4f7 +Test: Verify +Comment: 1032-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 2e802b5369c3f1ddfa789bf8f2ad2e048ced3bf355 +SubgroupGenerator: \ + a9aebee7d29f90b081afc4d496a6a78210e918bb57a8a21c5995586c0bf20f7a\ + 56bb10a97e05a3a723e7db64612b12bb591b1fe7d2e46be8c96a7b2ce7c66076\ + aeded938775ae2223900adaf52a93f52d62173c82d4b67388c85d4c1127e1edf\ + 4643cf09f5375b60c19316c4f8f8fd7daea1d8b44a2d03e97c2741537f63d86b\ + 4a +Modulus: \ + d551680a62ebf98f0ed8930cc5b12de86d0a0c29a0d7e5524c24672a25428833\ + f4c19ac883ead22efcc0c6823f2e942c17adb7ab763ff2c7cc2698fa8b6448e5\ + 14d4628b197721bdaec780e126ac80ac83f24fef5c154f7690ceba903748be52\ + 12e3180ea718ca7a71a49dee939bf9bc5b7845c9648d074587ccd3724493b91f\ + 09 +PrivateExponent: \ + 0f66e04c5a75d3eac03d744e5432f23e3aea066a63 +PublicElement: \ + 2640c188055329f0b44aaf80f82f7fc7f0e421031834dfbd1fb6d6af6ab3e1c1\ + 73c901370a4ce2793c1b88d12f764c58ff064905da9c5001f679c7508972f237\ + bccca56524787466a7c9c2d6bb6392963008ed1a3e4cf3b13e66086bce3a4ca0\ + 4d8cabcf0cadb4c403c7d02a858460d04350e730289cb5adf200b5fdf1198168\ + b5 +Test: KeyPairValidAndConsistent +Message: 909068BEFFA43331FDC7 +Signature: \ + 2d557d8fae420880640dd9f60a524db48980c80d8b0179dd3c1892f02e87c9f6\ + a04a8aa731be05aaffef +Test: Verify +Message: AC8AFC7A1D9105539E10 +Signature: \ + 0ae7f23328453fdb03c090c09ee69d787ee7dfaccd047445b1026a9a7cacdd1f\ + 91455db7299538817894 +Test: Verify +Message: 310E40311BB3F77F9483 +Signature: \ + 28a8d8de06dc0011b044d19a163d350535d6ca91a023c9687557690ddf102d8c\ + 7558246ced311f2fc444 +Test: Verify +Message: 35455ABD53E6FB11ED9B +Signature: \ + 162156e476cba65e767b4db942bb35cdc6293cf4360f1801a215bb2c726c22af\ + f3a711d3c6473f1eb985 +Test: Verify +Message: 95FFA73B52F0D06A0C1E +Signature: \ + 29bf4f13e6aff528aa1b060c2baed865c442e0472422b4bd485aa5ba2a09ad0d\ + 732637bb3ee520f6bc0b +Test: Verify +Message: 1E9934125DA6E9B4E975 +Signature: \ + 1674975d0a97e799d113ff9cad06b7f70a33f5ca5f1916cee07b525270284fbb\ + 1c0428666987ad7e2116 +Test: Verify +Comment: 1536-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 232cf9bee9d56c8bd8252d1edb59d99c40cf32d07d9e5a4893 +SubgroupGenerator: \ + f028143e3f9d1317aafb814215ffda9c584da8943e96212c90a082c3d2f335e8\ + a6b64d1c890aa2224ebf158bec2b6fe6bad236417acd517a4907331e0be0dd0b\ + 801218ac270acdd45579290be1b94bc418b8f82c651d82a19d2f0e1cbb0fbc0f\ + 054d95150af96f9a7488010787a799c544883ff76a4e3092f2ca9aa9000cecb8\ + 8dda343c972c8192a83820727b1945c1a270cf913ab932457e8e6e207d06cd0e\ + fdf265b762b9fa15c9a14633af17204ba2b755ed1b3b421ac596a2a04e64be43 +Modulus: \ + fada6e4becef964a85caf9e129639a5616ac000dbac59bd50b84bc8d46411407\ + 9c34c5b58d7d40027faaf037c6a649c527cb002d3a716bdef62b6c94d7a47a8b\ + 65c2ebac05da09e40cdc417024cccba267a98f4eb69701a276b4f117662b5666\ + 05c36054e7f015d2e5f81331e5666ec17ebf71907788b40cbcea0f24aaffb029\ + ef5c25c55ae998f28a2ddb091d262c32ad324f4e64c7b4b50a19e9d92f6d8024\ + 188627cf5ce68674e7ec7da38fd6cf4ec29a6ce2f17e3188d8ef6b0e50d77d5b +PrivateExponent: \ + 1d4cedc87d55eea31bd702139b90be08d58692a1f97628a01b +PublicElement: \ + 819c8cedb9c014aa577e9046b90795accbebe81bef68b1b5c37c68cb357e1a5f\ + f92761bc26cb0953956b6c0aec05acfc9d1a27c50789793b13d9eaf2361760c9\ + 7a7d86e7d922f4809a5d2d01448e938190bbc24c150e03ef8305365ddbf5ca19\ + 6857314e3b3023f8ddc9d209bd7dad1ee763e7003fd1b0c53057d2e9acadd23a\ + a18f83d20143bc41a2dfa4a164c82621fc0f800052ec01bec7c99c66fe20ec57\ + 67e6fbbe8810cd5aa75eff3d8a4cb53e1259ebcfebcc2fcf21ba7f3589cd525a +Test: KeyPairValidAndConsistent +Message: 9F6DC301DF53FE22CAC0 +Signature: \ + 15b22111ffa1b733979cd9d8944b1291ce09468ccbd05040de0f83023c8fe083\ + 734ec39a542011643e448b01429c4bae06d1 +Test: Verify +Message: 2D7B5B9A27EAB468331E +Signature: \ + 029eea970a049ffcb4c6117c97d181bec7a27557ceb88d422b2212ca36238380\ + 87cd52d2445f539c9c03705ba4b485f56e19 +Test: Verify +Message: F552FCBBA04FFCCC5CB6 +Signature: \ + 115de3cc15d9a066c00fed43f583f6a9c984d4b8f4c93c3d72094a4b04dda506\ + 7d460c3d1ae33ba66ceaac676256c1e73001 +Test: Verify +Message: 0D52B894153A4BB74068 +Signature: \ + 0f6b8cc28e2068a3fe14d220177793daf3512ba6942e9d16ef1571fa34926c27\ + edd1bfa94723a663425f5c2d01eaddaa972e +Test: Verify +Message: 294442E103CC0CBA32A6 +Signature: \ + 0fbd8768a1b3025c0d0d309cc448320e086318772bb9485a5a0a2afa1eb2afb2\ + d1818aa7b1c55b9dc424e654524278f0ddbc +Test: Verify +Message: E993D8FE1E6F6C3914ED +Signature: \ + 0559d66bad3a51520bbb85827a257ab09dfa33938127c69bf40f08339b2f2251\ + c0e50b63d2a4d05225dea7f58f67de3071e9 +Test: Verify +Comment: 2048-bit NR key +KeyFormat: Component +SubgroupOrder: \ + 03f35f80fcd896f03eda9ff07f2e35295384c4f3b8f8c4821369ab5417 +SubgroupGenerator: \ + 75c5d8c8f72302d92be3bf486b8648330ff86954de5e6e83efef624a277574c1\ + 6757684d3874ee303fa08343fe82dae484e5dda6781280b434c4090044cc7ff9\ + b6e962594d3ca069815c0f0b6bfd25215a419420d0ef8a1595c6eb1b44a719b4\ + 0131081f75cc15cb09a5d5a029c8546230c30b4af2d4a9f4374c93a095c83b59\ + 4b1774d635d4aee965f1d094469f7bbf8bdc93216a6b8a6c5753b48962335bf2\ + 092aa583c897878c8a7ce61186b592b05d2aea710b673d5994cedb5f117fdb6b\ + 8ad4d89f443c4eb662b428a34a7522c69794cc0274f3eba837e90da86acbc707\ + 4ee3a0b029d970efa48b3d582b740ae0e585d175a5f63a385f8b6b8878b44e1a +Modulus: \ + 9a08865d2bc9e0cf03d2500b2a08402bb9dc953d5fcd73f04be61236efc0998a\ + 8f012f00e52f7a6e91e81b88a4c9f985a2da523cbe7caff08cae44963d2035ed\ + a72e1f31f82c8d64c86e686899d53c0200282f407ceb1507db480f1db223606a\ + 57466cf60fe9fc5f7ea7d5fd82ed3ab2cf5e35491dfaef0aa2e10fbfa3cdfeb5\ + ebf65e4dfc2837e1f6399db06cc2e0420c7b14a4c0d483b742ca58b31fec9f26\ + a64e9bfcaa82334e644f4b954e2a9c7eeae096b8864ecd223ead3bcf9e8c1f68\ + f6678faccdb7f26d8f33d8a5fb0cb156cc7daf4a96ec2b730c0d7f666d699f73\ + 45a37ddc1ccdea6d8f439ddb23de04a941b246bc257b0aef544a8e868bc8444f +PrivateExponent: \ + 0212c34d3d17b96a899548ebf43bb886676acebd2f040f5b33a4e88d2d +PublicElement: \ + 267f9c3ff3ee3cbc0f9e94dc7e6837e1ff65175e967987b90b9aea7eef1de6e4\ + c342bebb5dbd0c4e2f6514f2d487857a146dda6cfdbc8b56ed254cd65754d84d\ + d21a271cd15fc656274725643728b41ce3f0e6872b6dfb4c289e03f9b903880c\ + e3d7d745dfbb641c8c42ec0bfb6951ca2611fd877c32248c97252bdb42d7bd65\ + ebc50653dff389526c546d1e6ebaf6bd8b3298c01935901b7efb288b78730d89\ + fba7f46f2a642aee0dbc93aa29c190b201acf89d4f8ba28f3e3f54a1c5a48294\ + dda908f904afb7db398682c809ce13abd49279221d5b40ad76216bad7ca256d7\ + 18d3552344c481b20da5aac3e637fb7edeaf7960b532ef761376489f02fa8c10 +Test: KeyPairValidAndConsistent +Message: 5F3914F7AE0F6C76D152 +Signature: \ + 03d30b7eaaddcb384dce378f806e88d646419bbedbc2c0c5cae32f3c3b02e0e1\ + a3c3ab04b31e2c25db713db539a65c9419a846aea88aaa707cb4 +Test: Verify +Message: 769583D4E7EAD14C137A +Signature: \ + 01dc2815fd4918b8d3bd1743f5ab4546313b1fa8044b4737b2c485eeb0016bcc\ + cc084be064b6a8934a28011167eebbc33513ce609aa206810aa1 +Test: Verify +Message: 6441D5239F50C71DE0F5 +Signature: \ + 013f6d395de56832f82ee813b574002c36e551aaeffbb28ddebb84da7f01ff6f\ + 4c3d0f3519d548e2ec1a0b36f12ac1e4fedc83071bbbbce024a6 +Test: Verify +Message: F1C2D4F7C3ECDF2C17B7 +Signature: \ + 006441a8b3517613f9a8c2e7a89c492e7f49300d901ad01b92167c1fce02453d\ + 52b69dc1fc6532e792ad6366eae7fb14de3ad3f6f3132b0519fc +Test: Verify +Message: 752A1F2B8D9A717A882F +Signature: \ + 0127027984402f5b8cc069decc1bd611f0bb59c6eee86da7d334e3f8b903c5f3\ + 02c65aaf16a837963bf772931235f81e963e4d692699dfd4f7e1 +Test: Verify +Message: 666DC6B1E871026EDE56 +Signature: \ + 03e87b55a7e81318b7599da3fa8f18d46253b6546814fd1ae19318820100c297\ + 4de2624da0d54ca27e7fe3477913a6df35bf925de3f3d9a06849 +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/panama.txt b/external/crypto++-5.6.3/TestVectors/panama.txt new file mode 100644 index 000000000..bd4d4ee3d --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/panama.txt @@ -0,0 +1,76 @@ +AlgorithmType: MessageDigest +Name: Panama-LE +Source: Panama reference implementation +Message: "" +Digest: aa0cc954d757d7ac7779ca3342334ca471abd47d5952ac91ed837ecd5b16922b +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +Digest: 5f5ca355b90ac622b0aa7e654ef5f27e9e75111415b48b8afe3add1c6b89cba1 +Test: Verify +Source: generated by Crypto++ 5.2.1 +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: af9c66fb6058e2232a5dfba063ee14b0f86f0e334e165812559435464dd9bb60 +Test: Verify + +AlgorithmType: MessageDigest +Name: Panama-BE +Source: Panama reference implementation +Message: "" +Digest: e81aa04523532dd7267e5c5bc3ba0e289837a62ba032350351980e960a84b0af +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +Digest: 8fa7dadce0110f979a0b795e76b2c25628d8bda88747758149c42e3bc13f85bc +Test: Verify +Source: generated by Crypto++ 5.2.1 +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: cb34f0937e8d870d3bd7ff6311765f2c229a6c2154e4db119538db5159437cab +Test: Verify + +AlgorithmType: MAC +Name: Panama-LE +Source: modified from Panama hash test vectors +Key: "" +Message: "" +MAC: aa0cc954d757d7ac7779ca3342334ca471abd47d5952ac91ed837ecd5b16922b +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +MAC: 5f5ca355b90ac622b0aa7e654ef5f27e9e75111415b48b8afe3add1c6b89cba1 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +MAC: af9c66fb6058e2232a5dfba063ee14b0f86f0e334e165812559435464dd9bb60 +Test: Verify +Key: "The " +Message: "quick brown fox jumps over the lazy dog" +MAC: 5f5ca355b90ac622b0aa7e654ef5f27e9e75111415b48b8afe3add1c6b89cba1 +Test: Verify + +AlgorithmType: MAC +Name: Panama-BE +Source: modified from Panama hash test vectors +Key: "" +Message: "" +MAC: e81aa04523532dd7267e5c5bc3ba0e289837a62ba032350351980e960a84b0af +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +MAC: 8fa7dadce0110f979a0b795e76b2c25628d8bda88747758149c42e3bc13f85bc +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +MAC: cb34f0937e8d870d3bd7ff6311765f2c229a6c2154e4db119538db5159437cab +Test: Verify +Key: "The " +Message: "quick brown fox jumps over the lazy dog" +MAC: 8fa7dadce0110f979a0b795e76b2c25628d8bda88747758149c42e3bc13f85bc +Test: Verify + +AlgorithmType: SymmetricCipher +Source: generated by Crypto++ 5.2.1 +Key: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +IV: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +Name: Panama-LE +Plaintext: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +Ciphertext: F07F5FF2CCD01A0A7D44ACD6D239C2AF0DA1FF35275BAF5DFA6E09411B79D8B9 +Test: Encrypt +Name: Panama-BE +Plaintext: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +Ciphertext: E12E2F6BA41AE832D888DA9FA6863BC37C0E996F190A1711330322D37BD98CA4 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/rsa_oaep.txt b/external/crypto++-5.6.3/TestVectors/rsa_oaep.txt new file mode 100644 index 000000000..4e4cdd39b --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/rsa_oaep.txt @@ -0,0 +1,1765 @@ +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 1: A 1024-bit RSA Key Pair +Modulus: \ +a8 b3 b2 84 af 8e b5 0b 38 70 34 a8 60 f1 46 c4 \ +91 9f 31 87 63 cd 6c 55 98 c8 ae 48 11 a1 e0 ab \ +c4 c7 e0 b0 82 d6 93 a5 e7 fc ed 67 5c f4 66 85 \ +12 77 2c 0c bc 64 a7 42 c6 c6 30 f5 33 c8 cc 72 \ +f6 2a e8 33 c4 0b f2 58 42 e9 84 bb 78 bd bf 97 \ +c0 10 7d 55 bd b6 62 f5 c4 e0 fa b9 84 5c b5 14 \ +8e f7 39 2d d3 aa ff 93 ae 1e 6b 66 7b b3 d4 24 \ +76 16 d4 f5 ba 10 d4 cf d2 26 de 88 d3 9f 16 fb +PublicExponent: 01 00 01 +PrivateExponent: \ +53 33 9c fd b7 9f c8 46 6a 65 5c 73 16 ac a8 5c \ +55 fd 8f 6d d8 98 fd af 11 95 17 ef 4f 52 e8 fd \ +8e 25 8d f9 3f ee 18 0f a0 e4 ab 29 69 3c d8 3b \ +15 2a 55 3d 4a c4 d1 81 2b 8b 9f a5 af 0e 7f 55 \ +fe 73 04 df 41 57 09 26 f3 31 1f 15 c4 d6 5a 73 \ +2c 48 31 16 ee 3d 3d 2d 0a f3 54 9a d9 bf 7c bf \ +b7 8a d8 84 f8 4d 5b eb 04 72 4d c7 36 9b 31 de \ +f3 7d 0c f5 39 e9 cf cd d3 de 65 37 29 ea d5 d1 +Prime1: \ +d3 27 37 e7 26 7f fe 13 41 b2 d5 c0 d1 50 a8 1b \ +58 6f b3 13 2b ed 2f 8d 52 62 86 4a 9c b9 f3 0a \ +f3 8b e4 48 59 8d 41 3a 17 2e fb 80 2c 21 ac f1 \ +c1 1c 52 0c 2f 26 a4 71 dc ad 21 2e ac 7c a3 9d +Prime2: \ +cc 88 53 d1 d5 4d a6 30 fa c0 04 f4 71 f2 81 c7 \ +b8 98 2d 82 24 a4 90 ed be b3 3d 3e 3d 5c c9 3c \ +47 65 70 3d 1d d7 91 64 2f 1f 11 6a 0d d8 52 be \ +24 19 b2 af 72 bf e9 a0 30 e8 60 b0 28 8b 5d 77 +ModPrime1PrivateExponent: \ +0e 12 bf 17 18 e9 ce f5 59 9b a1 c3 88 2f e8 04 \ +6a 90 87 4e ef ce 8f 2c cc 20 e4 f2 74 1f b0 a3 \ +3a 38 48 ae c9 c9 30 5f be cb d2 d7 68 19 96 7d \ +46 71 ac c6 43 1e 40 37 96 8d b3 78 78 e6 95 c1 +ModPrime2PrivateExponent: \ +95 29 7b 0f 95 a2 fa 67 d0 07 07 d6 09 df d4 fc \ +05 c8 9d af c2 ef 6d 6e a5 5b ec 77 1e a3 33 73 \ +4d 92 51 e7 90 82 ec da 86 6e fe f1 3c 45 9e 1a \ +63 13 86 b7 e3 54 c8 99 f5 f1 12 ca 85 d7 15 83 +MultiplicativeInverseOfPrime2ModPrime1: \ +4f 45 6c 50 24 93 bd c0 ed 2a b7 56 a3 a6 ed 4d \ +67 35 2a 69 7d 42 16 e9 32 12 b1 27 a6 3d 54 11 \ +ce 6f a9 8d 5d be fd 73 26 3e 37 28 14 27 43 81 \ +81 66 ed 7d d6 36 87 dd 2a 8c a1 d2 f4 fb d8 e1 +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 1.1 +Plaintext: \ +66 28 19 4e 12 07 3d b0 3b a9 4c da 9e f9 53 23 \ +97 d5 0d ba 79 b9 87 00 4a fe fe 34 +Seed: # not used yet\ +18 b7 76 ea 21 06 9d 69 77 6a 33 e9 6b ad 48 e1 \ +dd a0 a5 ef +Ciphertext: \ +35 4f e6 7b 4a 12 6d 5d 35 fe 36 c7 77 79 1a 3f \ +7b a1 3d ef 48 4e 2d 39 08 af f7 22 fa d4 68 fb \ +21 69 6d e9 5d 0b e9 11 c2 d3 17 4f 8a fc c2 01 \ +03 5f 7b 6d 8e 69 40 2d e5 45 16 18 c2 1a 53 5f \ +a9 d7 bf c5 b8 dd 9f c2 43 f8 cf 92 7d b3 13 22 \ +d6 e8 81 ea a9 1a 99 61 70 e6 57 a0 5a 26 64 26 \ +d9 8c 88 00 3f 84 77 c1 22 70 94 a0 d9 fa 1e 8c \ +40 24 30 9c e1 ec cc b5 21 00 35 d4 7a c7 2e 8a +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 1.2 +Plaintext: \ +75 0c 40 47 f5 47 e8 e4 14 11 85 65 23 29 8a c9\ +ba e2 45 ef af 13 97 fb e5 6f 9d d5 +Seed: # not used yet\ +0c c7 42 ce 4a 9b 7f 32 f9 51 bc b2 51 ef d9 25\ +fe 4f e3 5f +Ciphertext: \ +64 0d b1 ac c5 8e 05 68 fe 54 07 e5 f9 b7 01 df\ +f8 c3 c9 1e 71 6c 53 6f c7 fc ec 6c b5 b7 1c 11\ +65 98 8d 4a 27 9e 15 77 d7 30 fc 7a 29 93 2e 3f\ +00 c8 15 15 23 6d 8d 8e 31 01 7a 7a 09 df 43 52\ +d9 04 cd eb 79 aa 58 3a dc c3 1e a6 98 a4 c0 52\ +83 da ba 90 89 be 54 91 f6 7c 1a 4e e4 8d c7 4b\ +bb e6 64 3a ef 84 66 79 b4 cb 39 5a 35 2d 5e d1\ +15 91 2d f6 96 ff e0 70 29 32 94 6d 71 49 2b 44 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 1.3 +Plaintext: \ +d9 4a e0 83 2e 64 45 ce 42 33 1c b0 6d 53 1a 82\ +b1 db 4b aa d3 0f 74 6d c9 16 df 24 d4 e3 c2 45\ +1f ff 59 a6 42 3e b0 e1 d0 2d 4f e6 46 cf 69 9d\ +fd 81 8c 6e 97 b0 51 +Seed: # not used yet\ +25 14 df 46 95 75 5a 67 b2 88 ea f4 90 5c 36 ee\ +c6 6f d2 fd +Ciphertext: \ +42 37 36 ed 03 5f 60 26 af 27 6c 35 c0 b3 74 1b\ +36 5e 5f 76 ca 09 1b 4e 8c 29 e2 f0 be fe e6 03\ +59 5a a8 32 2d 60 2d 2e 62 5e 95 eb 81 b2 f1 c9\ +72 4e 82 2e ca 76 db 86 18 cf 09 c5 34 35 03 a4\ +36 08 35 b5 90 3b c6 37 e3 87 9f b0 5e 0e f3 26\ +85 d5 ae c5 06 7c d7 cc 96 fe 4b 26 70 b6 ea c3\ +06 6b 1f cf 56 86 b6 85 89 aa fb 7d 62 9b 02 d8\ +f8 62 5c a3 83 36 24 d4 80 0f b0 81 b1 cf 94 eb +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 1.4 +Plaintext: \ +52 e6 50 d9 8e 7f 2a 04 8b 4f 86 85 21 53 b9 7e\ +01 dd 31 6f 34 6a 19 f6 7a 85 +Seed: # not used yet\ +c4 43 5a 3e 1a 18 a6 8b 68 20 43 62 90 a3 7c ef\ +b8 5d b3 fb +Ciphertext: \ +45 ea d4 ca 55 1e 66 2c 98 00 f1 ac a8 28 3b 05\ +25 e6 ab ae 30 be 4b 4a ba 76 2f a4 0f d3 d3 8e\ +22 ab ef c6 97 94 f6 eb bb c0 5d db b1 12 16 24\ +7d 2f 41 2f d0 fb a8 7c 6e 3a cd 88 88 13 64 6f\ +d0 e4 8e 78 52 04 f9 c3 f7 3d 6d 82 39 56 27 22\ +dd dd 87 71 fe c4 8b 83 a3 1e e6 f5 92 c4 cf d4\ +bc 88 17 4f 3b 13 a1 12 aa e3 b9 f7 b8 0e 0f c6\ +f7 25 5b a8 80 dc 7d 80 21 e2 2a d6 a8 5f 07 55 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 1.5 +Plaintext: \ +8d a8 9f d9 e5 f9 74 a2 9f ef fb 46 2b 49 18 0f\ +6c f9 e8 02 +Seed: # not used yet\ +b3 18 c4 2d f3 be 0f 83 fe a8 23 f5 a7 b4 7e d5\ +e4 25 a3 b5 +Ciphertext: \ +36 f6 e3 4d 94 a8 d3 4d aa cb a3 3a 21 39 d0 0a\ +d8 5a 93 45 a8 60 51 e7 30 71 62 00 56 b9 20 e2\ +19 00 58 55 a2 13 a0 f2 38 97 cd cd 73 1b 45 25\ +7c 77 7f e9 08 20 2b ef dd 0b 58 38 6b 12 44 ea\ +0c f5 39 a0 5d 5d 10 32 9d a4 4e 13 03 0f d7 60\ +dc d6 44 cf ef 20 94 d1 91 0d 3f 43 3e 1c 7c 6d\ +d1 8b c1 f2 df 7f 64 3d 66 2f b9 dd 37 ea d9 05\ +91 90 f4 fa 66 ca 39 e8 69 c4 eb 44 9c bd c4 39 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 1.6 +Plaintext: \ +26 52 10 50 84 42 71 +Seed: # not used yet\ +e4 ec 09 82 c2 33 6f 3a 67 7f 6a 35 61 74 eb 0c\ +e8 87 ab c2 +Ciphertext: \ +42 ce e2 61 7b 1e ce a4 db 3f 48 29 38 6f bd 61\ +da fb f0 38 e1 80 d8 37 c9 63 66 df 24 c0 97 b4\ +ab 0f ac 6b df 59 0d 82 1c 9f 10 64 2e 68 1a d0\ +5b 8d 78 b3 78 c0 f4 6c e2 fa d6 3f 74 e0 ad 3d\ +f0 6b 07 5d 7e b5 f5 63 6f 8d 40 3b 90 59 ca 76\ +1b 5c 62 bb 52 aa 45 00 2e a7 0b aa ce 08 de d2\ +43 b9 d8 cb d6 2a 68 ad e2 65 83 2b 56 56 4e 43\ +a6 fa 42 ed 19 9a 09 97 69 74 2d f1 53 9e 82 55 +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 2: A 1025-bit RSA Key Pair +Modulus: \ +01 94 7c 7f ce 90 42 5f 47 27 9e 70 85 1f 25 d5\ +e6 23 16 fe 8a 1d f1 93 71 e3 e6 28 e2 60 54 3e\ +49 01 ef 60 81 f6 8c 0b 81 41 19 0d 2a e8 da ba\ +7d 12 50 ec 6d b6 36 e9 44 ec 37 22 87 7c 7c 1d\ +0a 67 f1 4b 16 94 c5 f0 37 94 51 a4 3e 49 a3 2d\ +de 83 67 0b 73 da 91 a1 c9 9b c2 3b 43 6a 60 05\ +5c 61 0f 0b af 99 c1 a0 79 56 5b 95 a3 f1 52 66\ +32 d1 d4 da 60 f2 0e da 25 e6 53 c4 f0 02 76 6f\ +45 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +08 23 f2 0f ad b5 da 89 08 8a 9d 00 89 3e 21 fa\ +4a 1b 11 fb c9 3c 64 a3 be 0b aa ea 97 fb 3b 93\ +c3 ff 71 37 04 c1 9c 96 3c 1d 10 7a ae 99 05 47\ +39 f7 9e 02 e1 86 de 86 f8 7a 6d de fe a6 d8 cc\ +d1 d3 c8 1a 47 bf a7 25 5b e2 06 01 a4 a4 b2 f0\ +8a 16 7b 5e 27 9d 71 5b 1b 45 5b dd 7e ab 24 59\ +41 d9 76 8b 9a ce fb 3c cd a5 95 2d a3 ce e7 25\ +25 b4 50 16 63 a8 ee 15 c9 e9 92 d9 24 62 fe 39 +Prime1: \ +01 59 db de 04 a3 3e f0 6f b6 08 b8 0b 19 0f 4d\ +3e 22 bc c1 3a c8 e4 a0 81 03 3a bf a4 16 ed b0\ +b3 38 aa 08 b5 73 09 ea 5a 52 40 e7 dc 6e 54 37\ +8c 69 41 4c 31 d9 7d db 1f 40 6d b3 76 9c c4 1a\ +43 +Prime2: \ +01 2b 65 2f 30 40 3b 38 b4 09 95 fd 6f f4 1a 1a\ +cc 8a da 70 37 32 36 b7 20 2d 39 b2 ee 30 cf b4\ +6d b0 95 11 f6 f3 07 cc 61 cc 21 60 6c 18 a7 5b\ +8a 62 f8 22 df 03 1b a0 df 0d af d5 50 6f 56 8b\ +d7 +ModPrime1PrivateExponent: \ +43 6e f5 08 de 73 65 19 c2 da 4c 58 0d 98 c8 2c\ +b7 45 2a 3f b5 ef ad c3 b9 c7 78 9a 1b c6 58 4f\ +79 5a dd bb d3 24 39 c7 46 86 55 2e cb 6c 2c 30\ +7a 4d 3a f7 f5 39 ee c1 57 24 8c 7b 31 f1 a2 55 +ModPrime2PrivateExponent: \ +01 2b 15 a8 9f 3d fb 2b 39 07 3e 73 f0 2b dd 0c\ +1a 7b 37 9d d4 35 f0 5c dd e2 ef f9 e4 62 94 8b\ +7c ec 62 ee 90 50 d5 e0 81 6e 07 85 a8 56 b4 91\ +08 dc b7 5f 36 83 87 4d 1c a6 32 9a 19 01 30 66\ +ff +MultiplicativeInverseOfPrime2ModPrime1: \ +02 70 db 17 d5 91 4b 01 8d 76 11 8b 24 38 9a 73\ +50 ec 83 6b 00 63 a2 17 21 23 6f d8 ed b6 d8 9b\ +51 e7 ee b8 7b 61 1b 71 32 cb 7e a7 35 6c 23 15\ +1c 1e 77 51 50 7c 78 6d 9e e1 79 41 70 a8 c8 e8 +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 2.1 +Plaintext: \ +8f f0 0c aa 60 5c 70 28 30 63 4d 9a 6c 3d 42 c6\ +52 b5 8c f1 d9 2f ec 57 0b ee e7 +Seed: # not used yet\ +8c 40 7b 5e c2 89 9e 50 99 c5 3e 8c e7 93 bf 94\ +e7 1b 17 82 +Ciphertext: \ +01 81 af 89 22 b9 fc b4 d7 9d 92 eb e1 98 15 99\ +2f c0 c1 43 9d 8b cd 49 13 98 a0 f4 ad 3a 32 9a\ +5b d9 38 55 60 db 53 26 83 c8 b7 da 04 e4 b1 2a\ +ed 6a ac df 47 1c 34 c9 cd a8 91 ad dc c2 df 34\ +56 65 3a a6 38 2e 9a e5 9b 54 45 52 57 eb 09 9d\ +56 2b be 10 45 3f 2b 6d 13 c5 9c 02 e1 0f 1f 8a\ +bb 5d a0 d0 57 09 32 da cf 2d 09 01 db 72 9d 0f\ +ef cc 05 4e 70 96 8e a5 40 c8 1b 04 bc ae fe 72\ +0e +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 2.2 +Plaintext: \ +2d +Seed: # not used yet\ +b6 00 cf 3c 2e 50 6d 7f 16 77 8c 91 0d 3a 8b 00\ +3e ee 61 d5 +Ciphertext: \ +01 87 59 ff 1d f6 3b 27 92 41 05 62 31 44 16 a8\ +ae af 2a c6 34 b4 6f 94 0a b8 2d 64 db f1 65 ee\ +e3 30 11 da 74 9d 4b ab 6e 2f cd 18 12 9c 9e 49\ +27 7d 84 53 11 2b 42 9a 22 2a 84 71 b0 70 99 39\ +98 e7 58 86 1c 4d 3f 6d 74 9d 91 c4 29 0d 33 2c\ +7a 4a b3 f7 ea 35 ff 3a 07 d4 97 c9 55 ff 0f fc\ +95 00 6b 62 c6 d2 96 81 0d 9b fa b0 24 19 6c 79\ +34 01 2c 2d f9 78 ef 29 9a ba 23 99 40 cb a1 02\ +45 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 2.3 +Plaintext: \ +74 fc 88 c5 1b c9 0f 77 af 9d 5e 9a 4a 70 13 3d\ +4b 4e 0b 34 da 3c 37 c7 ef 8e +Seed: # not used yet\ +a7 37 68 ae ea a9 1f 9d 8c 1e d6 f9 d2 b6 34 67\ +f0 7c ca e3 +Ciphertext: \ +01 88 02 ba b0 4c 60 32 5e 81 c4 96 23 11 f2 be\ +7c 2a dc e9 30 41 a0 07 19 c8 8f 95 75 75 f2 c7\ +9f 1b 7b c8 ce d1 15 c7 06 b3 11 c0 8a 2d 98 6c\ +a3 b6 a9 33 6b 14 7c 29 c6 f2 29 40 9d de c6 51\ +bd 1f dd 5a 0b 7f 61 0c 99 37 fd b4 a3 a7 62 36\ +4b 8b 32 06 b4 ea 48 5f d0 98 d0 8f 63 d4 aa 8b\ +b2 69 7d 02 7b 75 0c 32 d7 f7 4e af 51 80 d2 e9\ +b6 6b 17 cb 2f a5 55 23 bc 28 0d a1 0d 14 be 20\ +53 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 2.4 +Plaintext: \ +a7 eb 2a 50 36 93 1d 27 d4 e8 91 32 6d 99 69 2f\ +fa dd a9 bf 7e fd 3e 34 e6 22 c4 ad c0 85 f7 21\ +df e8 85 07 2c 78 a2 03 b1 51 73 9b e5 40 fa 8c\ +15 3a 10 f0 0a +Seed: # not used yet\ +9a 7b 3b 0e 70 8b d9 6f 81 90 ec ab 4f b9 b2 b3\ +80 5a 81 56 +Ciphertext: \ +00 a4 57 8c bc 17 63 18 a6 38 fb a7 d0 1d f1 57\ +46 af 44 d4 f6 cd 96 d7 e7 c4 95 cb f4 25 b0 9c\ +64 9d 32 bf 88 6d a4 8f ba f9 89 a2 11 71 87 ca\ +fb 1f b5 80 31 76 90 e3 cc d4 46 92 0b 7a f8 2b\ +31 db 58 04 d8 7d 01 51 4a cb fa 91 56 e7 82 f8\ +67 f6 be d9 44 9e 0e 9a 2c 09 bc ec c6 aa 08 76\ +36 96 5e 34 b3 ec 76 6f 2f e2 e4 30 18 a2 fd de\ +b1 40 61 6a 0e 9d 82 e5 33 10 24 ee 06 52 fc 76\ +41 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 2.5 +Plaintext: \ +2e f2 b0 66 f8 54 c3 3f 3b dc bb 59 94 a4 35 e7\ +3d 6c 6c +Seed: # not used yet\ +eb 3c eb bc 4a dc 16 bb 48 e8 8c 8a ec 0e 34 af\ +7f 42 7f d3 +Ciphertext: \ +00 eb c5 f5 fd a7 7c fd ad 3c 83 64 1a 90 25 e7\ +7d 72 d8 a6 fb 33 a8 10 f5 95 0f 8d 74 c7 3e 8d\ +93 1e 86 34 d8 6a b1 24 62 56 ae 07 b6 00 5b 71\ +b7 f2 fb 98 35 12 18 33 1c e6 9b 8f fb dc 9d a0\ +8b bc 9c 70 4f 87 6d eb 9d f9 fc 2e c0 65 ca d8\ +7f 90 90 b0 7a cc 17 aa 7f 99 7b 27 ac a4 88 06\ +e8 97 f7 71 d9 51 41 fe 45 26 d8 a5 30 1b 67 86\ +27 ef ab 70 7f d4 0f be bd 6e 79 2a 25 61 3e 7a\ +ec +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 2.6 +Plaintext: \ +8a 7f b3 44 c8 b6 cb 2c f2 ef 1f 64 3f 9a 32 18\ +f6 e1 9b ba 89 c0 +Seed: # not used yet\ +4c 45 cf 4d 57 c9 8e 3d 6d 20 95 ad c5 1c 48 9e\ +b5 0d ff 84 +Ciphertext: \ +01 08 39 ec 20 c2 7b 90 52 e5 5b ef b9 b7 7e 6f\ +c2 6e 90 75 d7 a5 43 78 c6 46 ab df 51 e4 45 bd\ +57 15 de 81 78 9f 56 f1 80 3d 91 70 76 4a 9e 93\ +cb 78 79 86 94 02 3e e7 39 3c e0 4b c5 d8 f8 c5\ +a5 2c 17 1d 43 83 7e 3a ca 62 f6 09 eb 0a a5 ff\ +b0 96 0e f0 41 98 dd 75 4f 57 f7 fb e6 ab f7 65\ +cf 11 8b 4c a4 43 b2 3b 5a ab 26 6f 95 23 26 ac\ +45 81 10 06 44 32 5f 8b 72 1a cd 5d 04 ff 14 ef\ +3a +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 3: A 1026-bit RSA Key Pair +Modulus: \ +02 b5 8f ec 03 9a 86 07 00 a4 d7 b6 46 2f 93 e6\ +cd d4 91 16 1d dd 74 f4 e8 10 b4 0e 3c 16 52 00\ +6a 5c 27 7b 27 74 c1 13 05 a4 cb ab 5a 78 ef a5\ +7e 17 a8 6d f7 a3 fa 36 fc 4b 1d 22 49 f2 2e c7\ +c2 dd 6a 46 32 32 ac ce a9 06 d6 6e be 80 b5 70\ +4b 10 72 9d a6 f8 33 23 4a bb 5e fd d4 a2 92 cb\ +fa d3 3b 4d 33 fa 7a 14 b8 c3 97 b5 6e 3a cd 21\ +20 34 28 b7 7c df a3 3a 6d a7 06 b3 d8 b0 fc 43\ +e9 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +15 b4 8a 5b 56 83 a9 46 70 e2 3b 57 18 f8 14 fa\ +0e 13 f8 50 38 f5 07 11 18 2c ba 61 51 05 81 f3\ +d2 2c 7e 23 2e f9 37 e2 2e 55 1d 68 b8 6e 2f 8c\ +b1 aa d8 be 2e 48 8f 5d f7 ef d2 79 e3 f5 68 d4\ +ea f3 6f 80 cf 71 41 ac e6 0f cc 91 13 fb 6c 4a\ +84 1f d5 0b bc 7c 51 2f fc be ff 21 48 7a a8 11\ +eb 3c a8 c6 20 05 34 6a 86 de 86 bf a1 d8 a9 48\ +fd 3f 34 8c 22 ea ad f3 33 c3 ce 6c e1 32 08 fd +Prime1: \ +01 bf 01 d2 16 d7 35 95 cf 02 70 c2 be b7 8d 40\ +a0 d8 44 7d 31 da 91 9a 98 3f 7e ea 78 1b 77 d8\ +5f e3 71 b3 e9 37 3e 7b 69 21 7d 31 50 a0 2d 89\ +58 de 7f ad 9d 55 51 60 95 8b 44 54 12 7e 0e 7e\ +af +Prime2: \ +01 8d 33 99 65 81 66 db 38 29 81 6d 7b 29 54 16\ +75 9e 9c 91 98 7f 5b 2d 8a ec d6 3b 04 b4 8b d7\ +b2 fc f2 29 bb 7f 8a 6d c8 8b a1 3d d2 e3 9a d5\ +5b 6d 1a 06 16 07 08 f9 70 0b e8 0b 8f d3 74 4c\ +e7 +ModPrime1PrivateExponent: \ +06 c0 a2 49 d2 0a 6f 2e e7 5c 88 b4 94 d5 3f 6a\ +ae 99 aa 42 7c 88 c2 8b 16 3a 76 94 45 e5 f3 90\ +cf 40 c2 74 fd 6e a6 32 9a 5c e7 c7 ce 03 a2 15\ +83 96 ee 2a 78 45 78 6e 09 e2 88 5a 97 28 e4 e5 +ModPrime2PrivateExponent: \ +d1 d2 7c 29 fe dd 92 d8 6c 34 8e dd 0c cb fa c1\ +4f 74 6e 05 1c e1 d1 81 1d f3 5d 61 f2 ee 1c 97\ +d4 bf 28 04 80 2f 64 27 18 7b a8 e9 0a 8a f4 42\ +43 b4 07 9b 03 44 5e 60 2e 29 fa 51 93 e6 4f e9 +MultiplicativeInverseOfPrime2ModPrime1: \ +8c b2 f7 56 bd 89 41 b1 d3 b7 70 e5 ad 31 ee 37\ +3b 28 ac da 69 ff 9b 6f 40 fe 57 8b 9f 1a fb 85\ +83 6f 96 27 d3 7a cf f7 3c 27 79 e6 34 bb 26 01\ +1c 2c 8f 7f 33 61 ae 2a 9e a6 5e d6 89 e3 63 9a +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 3.1 +Plaintext: \ +08 78 20 b5 69 e8 fa 8d +Seed: # not used yet\ +8c ed 6b 19 62 90 80 57 90 e9 09 07 40 15 e6 a2\ +0b 0c 48 94 +Ciphertext: \ +02 6a 04 85 d9 6a eb d9 6b 43 82 08 50 99 b9 62\ +e6 a2 bd ec 3d 90 c8 db 62 5e 14 37 2d e8 5e 2d\ +5b 7b aa b6 5c 8f af 91 bb 55 04 fb 49 5a fc e5\ +c9 88 b3 f6 a5 2e 20 e1 d6 cb d3 56 6c 5c d1 f2\ +b8 31 8b b5 42 cc 0e a2 5c 4a ab 99 32 af a2 07\ +60 ea dd ec 78 43 96 a0 7e a0 ef 24 d4 e6 f4 d3\ +7e 50 52 a7 a3 1e 14 6a a4 80 a1 11 bb e9 26 40\ +13 07 e0 0f 41 00 33 84 2b 6d 82 fe 5c e4 df ae\ +80 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 3.2 +Plaintext: \ +46 53 ac af 17 19 60 b0 1f 52 a7 be 63 a3 ab 21\ +dc 36 8e c4 3b 50 d8 2e c3 78 1e 04 +Seed: # not used yet\ +b4 29 1d 65 67 55 08 48 cc 15 69 67 c8 09 ba ab\ +6c a5 07 f0 +Ciphertext: \ +02 4d b8 9c 78 02 98 9b e0 78 38 47 86 30 84 94\ +1b f2 09 d7 61 98 7e 38 f9 7c b5 f6 f1 bc 88 da\ +72 a5 0b 73 eb af 11 c8 79 c4 f9 5d f3 7b 85 0b\ +8f 65 d7 62 2e 25 b1 b8 89 e8 0f e8 0b ac a2 06\ +9d 6e 0e 1d 82 99 53 fc 45 90 69 de 98 ea 97 98\ +b4 51 e5 57 e9 9a bf 8f e3 d9 cc f9 09 6e bb f3\ +e5 25 5d 3b 4e 1c 6d 2e ca df 06 7a 35 9e ea 86\ +40 5a cd 47 d5 e1 65 51 7c ca fd 47 d6 db ee 4b\ +f5 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 3.3 +Plaintext: \ +d9 4c d0 e0 8f a4 04 ed 89 +Seed: # not used yet\ +ce 89 28 f6 05 95 58 25 40 08 ba dd 97 94 fa dc\ +d2 fd 1f 65 +Ciphertext: \ +02 39 bc e6 81 03 24 41 52 88 77 d6 d1 c8 bb 28\ +aa 3b c9 7f 1d f5 84 56 36 18 99 57 97 68 38 44\ +ca 86 66 47 32 f4 be d7 a0 aa b0 83 aa ab fb 72\ +38 f5 82 e3 09 58 c2 02 4e 44 e5 70 43 b9 79 50\ +fd 54 3d a9 77 c9 0c dd e5 33 7d 61 84 42 f9 9e\ +60 d7 78 3a b5 9c e6 dd 9d 69 c4 7a d1 e9 62 be\ +c2 2d 05 89 5c ff 8d 3f 64 ed 52 61 d9 2b 26 78\ +51 03 93 48 49 90 ba 3f 7f 06 81 8a e6 ff ce 8a\ +3a +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 3.4 +Plaintext: \ +6c c6 41 b6 b6 1e 6f 96 39 74 da d2 3a 90 13 28\ +4e f1 +Seed: # not used yet\ +6e 29 79 f5 2d 68 14 a5 7d 83 b0 90 05 48 88 f1\ +19 a5 b9 a3 +Ciphertext: \ +02 99 4c 62 af d7 6f 49 8b a1 fd 2c f6 42 85 7f\ +ca 81 f4 37 3c b0 8f 1c ba ee 6f 02 5c 3b 51 2b\ +42 c3 e8 77 91 13 47 66 48 03 9d be 04 93 f9 24\ +62 92 fa c2 89 50 60 0e 7c 0f 32 ed f9 c8 1b 9d\ +ec 45 c3 bd e0 cc 8d 88 47 59 01 69 90 7b 7d c5\ +99 1c eb 29 bb 07 14 d6 13 d9 6d f0 f1 2e c5 d8\ +d3 50 7c 8e e7 ae 78 dd 83 f2 16 fa 61 de 10 03\ +63 ac a4 8a 7e 91 4a e9 f4 2d df be 94 3b 09 d9\ +a0 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 3.5 +Plaintext: \ +df 51 51 83 2b 61 f4 f2 58 91 fb 41 72 f3 28 d2\ +ed df 83 71 ff cf db e9 97 93 92 95 f3 0e ca 69\ +18 01 7c fd a1 15 3b f7 a6 af 87 59 32 23 +Seed: # not used yet\ +2d 76 0b fe 38 c5 9d e3 4c dc 8b 8c 78 a3 8e 66\ +28 4a 2d 27 +Ciphertext: \ +01 62 04 2f f6 96 95 92 a6 16 70 31 81 1a 23 98\ +34 ce 63 8a bf 54 fe c8 b9 94 78 12 2a fe 2e e6\ +7f 8c 5b 18 b0 33 98 05 bf db c5 a4 e6 72 0b 37\ +c5 9c fb a9 42 46 4c 59 7f f5 32 a1 19 82 15 45\ +fd 2e 59 b1 14 e6 1d af 71 82 05 29 f5 02 9c f5\ +24 95 43 27 c3 4e c5 e6 f5 ba 7e fc c4 de 94 3a\ +b8 ad 4e d7 87 b1 45 43 29 f7 0d b7 98 a3 a8 f4\ +d9 2f 82 74 e2 b2 94 8a de 62 7c e8 ee 33 e4 3c\ +60 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 3.6 +Plaintext: \ +3c 3b ad 89 3c 54 4a 6d 52 0a b0 22 31 91 88 c8\ +d5 04 b7 a7 88 b8 50 90 3b 85 97 2e aa 18 55 2e\ +11 34 a7 ad 60 98 82 62 54 ff 7a b6 72 b3 d8 eb\ +31 58 fa c6 d4 cb ae f1 +Seed: # not used yet\ +f1 74 77 9c 5f d3 cf e0 07 ba dc b7 a3 6c 9b 55\ +bf cf bf 0e +Ciphertext: \ +00 11 20 51 e7 5d 06 49 43 bc 44 78 07 5e 43 48\ +2f d5 9c ee 06 79 de 68 93 ee c3 a9 43 da a4 90\ +b9 69 1c 93 df c0 46 4b 66 23 b9 f3 db d3 e7 00\ +83 26 4f 03 4b 37 4f 74 16 4e 1a 00 76 37 25 e5\ +74 74 4b a0 b9 db 83 43 4f 31 df 96 f6 e2 a2 6f\ +6d 8e ba 34 8b d4 68 6c 22 38 ac 07 c3 7a ac 37\ +85 d1 c7 ee a2 f8 19 fd 91 49 17 98 ed 8e 9c ef\ +5e 43 b7 81 b0 e0 27 6e 37 c4 3f f9 49 2d 00 57\ +30 +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 4: A 1027-bit RSA Key Pair +Modulus: \ +05 12 40 b6 cc 00 04 fa 48 d0 13 46 71 c0 78 c7\ +c8 de c3 b3 e2 f2 5b c2 56 44 67 33 9d b3 88 53\ +d0 6b 85 ee a5 b2 de 35 3b ff 42 ac 2e 46 bc 97\ +fa e6 ac 96 18 da 95 37 a5 c8 f5 53 c1 e3 57 62\ +59 91 d6 10 8d cd 78 85 fb 3a 25 41 3f 53 ef ca\ +d9 48 cb 35 cd 9b 9a e9 c1 c6 76 26 d1 13 d5 7d\ +de 4c 5b ea 76 bb 5b b7 de 96 c0 0d 07 37 2e 96\ +85 a6 d7 5c f9 d2 39 fa 14 8d 70 93 1b 5f 3f b0\ +39 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +04 11 ff ca 3b 7c a5 e9 e9 be 7f e3 8a 85 10 5e\ +35 38 96 db 05 c5 79 6a ec d2 a7 25 16 1e b3 65\ +1c 86 29 a9 b8 62 b9 04 d7 b0 c7 b3 7f 8c b5 a1\ +c2 b5 40 01 01 8a 00 a1 eb 2c af e4 ee 4e 94 92\ +c3 48 bc 2b ed ab 4b 9e bb f0 64 e8 ef f3 22 b9\ +00 9f 8e ec 65 39 05 f4 0d f8 8a 3c dc 49 d4 56\ +7f 75 62 7d 41 ac a6 24 12 9b 46 a0 b7 c6 98 e5\ +e6 5f 2b 7b a1 02 c7 49 a1 01 35 b6 54 0d 04 01 +Prime1: \ +02 74 58 c1 9e c1 63 69 19 e7 36 c9 af 25 d6 09\ +a5 1b 8f 56 1d 19 c6 bf 69 43 dd 1e e1 ab 8a 4a\ +3f 23 21 00 bd 40 b8 8d ec c6 ba 23 55 48 b6 ef\ +79 2a 11 c9 de 82 3d 0a 79 22 c7 09 5b 6e ba 57\ +01 +Prime2: \ +02 10 ee 9b 33 ab 61 71 6e 27 d2 51 bd 46 5f 4b\ +35 a1 a2 32 e2 da 00 90 1c 29 4b f2 23 50 ce 49\ +0d 09 9f 64 2b 53 75 61 2d b6 3b a1 f2 03 86 49\ +2b f0 4d 34 b3 c2 2b ce b9 09 d1 34 41 b5 3b 51\ +39 +ModPrime1PrivateExponent: \ +39 fa 02 8b 82 6e 88 c1 12 1b 75 0a 8b 24 2f a9\ +a3 5c 5b 66 bd fd 1f a6 37 d3 cc 48 a8 4a 4f 45\ +7a 19 4e 77 27 e4 9f 7b cc 6e 5a 5a 41 26 57 fc\ +47 0c 73 22 eb c3 74 16 ef 45 8c 30 7a 8c 09 01 +ModPrime2PrivateExponent: \ +01 5d 99 a8 41 95 94 39 79 fa 9e 1b e2 c3 c1 b6\ +9f 43 2f 46 fd 03 e4 7d 5b ef bb bf d6 b1 d1 37\ +1d 83 ef b3 30 a3 e0 20 94 2b 2f ed 11 5e 5d 02\ +be 24 fd 92 c9 01 9d 1c ec d6 dd 4c f1 e5 4c c8\ +99 +MultiplicativeInverseOfPrime2ModPrime1: \ +01 f0 b7 01 51 70 b3 f5 e4 22 23 ba 30 30 1c 41\ +a6 d8 7c bb 70 e3 0c b7 d3 c6 7d 25 47 3d b1 f6\ +cb f0 3e 3f 91 26 e3 e9 79 68 27 9a 86 5b 2c 2b\ +42 65 24 cf c5 2a 68 3d 31 ed 30 eb 98 4b e4 12\ +ba +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 4.1 +Plaintext: \ +4a 86 60 95 34 ee 43 4a 6c bc a3 f7 e9 62 e7 6d\ +45 5e 32 64 c1 9f 60 5f 6e 5f f6 13 7c 65 c5 6d\ +7f b3 44 cd 52 bc 93 37 4f 3d 16 6c 9f 0c 6f 9c\ +50 6b ad 19 33 09 72 d2 +Seed: # not used yet\ +1c ac 19 ce 99 3d ef 55 f9 82 03 f6 85 28 96 c9\ +5c cc a1 f3 +Ciphertext: \ +04 cc e1 96 14 84 5e 09 41 52 a3 fe 18 e5 4e 33\ +30 c4 4e 5e fb c6 4a e1 68 86 cb 18 69 01 4c c5\ +78 1b 1f 8f 9e 04 53 84 d0 11 2a 13 5c a0 d1 2e\ +9c 88 a8 e4 06 34 16 de aa e3 84 4f 60 d6 e9 6f\ +e1 55 14 5f 45 25 b9 a3 44 31 ca 37 66 18 0f 70\ +e1 5a 5e 5d 8e 8b 1a 51 6f f8 70 60 9f 13 f8 96\ +93 5c ed 18 82 79 a5 8e d1 3d 07 11 42 77 d7 5c\ +65 68 60 7e 0a b0 92 fd 80 3a 22 3e 4a 8e e0 b1\ +a8 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 4.2 +Plaintext: \ +b0 ad c4 f3 fe 11 da 59 ce 99 27 73 d9 05 99 43\ +c0 30 46 49 7e e9 d9 f9 a0 6d f1 16 6d b4 6d 98\ +f5 8d 27 ec 07 4c 02 ee e6 cb e2 44 9c 8b 9f c5\ +08 0c 5c 3f 44 33 09 25 12 ec 46 aa 79 37 43 c8 +Seed: # not used yet\ +f5 45 d5 89 75 85 e3 db 71 aa 0c b8 da 76 c5 1d\ +03 2a e9 63 +Ciphertext: \ +00 97 b6 98 c6 16 56 45 b3 03 48 6f bf 5a 2a 44\ +79 c0 ee 85 88 9b 54 1a 6f 0b 85 8d 6b 65 97 b1\ +3b 85 4e b4 f8 39 af 03 39 9a 80 d7 9b da 65 78\ +c8 41 f9 0d 64 57 15 b2 80 d3 71 43 99 2d d1 86\ +c8 0b 94 9b 77 5c ae 97 37 0e 4e c9 74 43 13 6c\ +6d a4 84 e9 70 ff db 13 23 a2 08 47 82 1d 3b 18\ +38 1d e1 3b b4 9a ae a6 65 30 c4 a4 b8 27 1f 3e\ +ae 17 2c d3 66 e0 7e 66 36 f1 01 9d 2a 28 ae d1\ +5e +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 4.3 +Plaintext: \ +bf 6d 42 e7 01 70 7b 1d 02 06 b0 c8 b4 5a 1c 72\ +64 1f f1 28 89 21 9a 82 bd ea 96 5b 5e 79 a9 6b\ +0d 01 63 ed 9d 57 8e c9 ad a2 0f 2f bc f1 ea 3c\ +40 89 d8 34 19 ba 81 b0 c6 0f 36 06 da 99 +Seed: # not used yet\ +ad 99 7f ee f7 30 d6 ea 7b e6 0d 0d c5 2e 72 ea\ +cb fd d2 75 +Ciphertext: \ +03 01 f9 35 e9 c4 7a bc b4 8a cb be 09 89 5d 9f\ +59 71 af 14 83 9d a4 ff 95 41 7e e4 53 d1 fd 77\ +31 90 72 bb 72 97 e1 b5 5d 75 61 cd 9d 1b b2 4c\ +1a 9a 37 c6 19 86 43 08 24 28 04 87 9d 86 eb d0\ +01 dc e5 18 39 75 e1 50 69 89 b7 0e 5a 83 43 41\ +54 d5 cb fd 6a 24 78 7e 60 eb 0c 65 8d 2a c1 93\ +30 2d 11 92 c6 e6 22 d4 a1 2a d4 b5 39 23 bc a2\ +46 df 31 c6 39 5e 37 70 2c 6a 78 ae 08 1f b9 d0\ +65 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 4.4 +Plaintext: \ +fb 2e f1 12 f5 e7 66 eb 94 01 92 97 93 47 94 f7\ +be 2f 6f c1 c5 8e +Seed: # not used yet\ +13 64 54 df 57 30 f7 3c 80 7a 7e 40 d8 c1 a3 12\ +ac 5b 9d d3 +Ciphertext: \ +02 d1 10 ad 30 af b7 27 be b6 91 dd 0c f1 7d 0a\ +f1 a1 e7 fa 0c c0 40 ec 1a 4b a2 6a 42 c5 9d 0a\ +79 6a 2e 22 c8 f3 57 cc c9 8b 65 19 ac eb 68 2e\ +94 5e 62 cb 73 46 14 a5 29 40 7c d4 52 be e3 e4\ +4f ec e8 42 3c c1 9e 55 54 8b 8b 99 4b 84 9c 7e\ +cd e4 93 3e 76 03 7e 1d 0c e4 42 75 b0 87 10 c6\ +8e 43 01 30 b9 29 73 0e d7 7e 09 b0 15 64 2c 55\ +93 f0 4e 4f fb 94 10 79 81 02 a8 e9 6f fd fe 11\ +e4 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 4.5 +Plaintext: \ +28 cc d4 47 bb 9e 85 16 6d ab b9 e5 b7 d1 ad ad\ +c4 b9 d3 9f 20 4e 96 d5 e4 40 ce 9a d9 28 bc 1c\ +22 84 +Seed: # not used yet\ +bc a8 05 7f 82 4b 2e a2 57 f2 86 14 07 ee f6 3d\ +33 20 86 81 +Ciphertext: \ +00 db b8 a7 43 9d 90 ef d9 19 a3 77 c5 4f ae 8f\ +e1 1e c5 8c 3b 85 83 62 e2 3a d1 b8 a4 43 10 79\ +90 66 b9 93 47 aa 52 56 91 d2 ad c5 8d 9b 06 e3\ +4f 28 8c 17 03 90 c5 f0 e1 1c 0a a3 64 59 59 f1\ +8e e7 9e 8f 2b e8 d7 ac 5c 23 d0 61 f1 8d d7 4b\ +8c 5f 2a 58 fc b5 eb 0c 54 f9 9f 01 a8 32 47 56\ +82 92 53 65 83 34 09 48 d7 a8 c9 7c 4a cd 1e 98\ +d1 e2 9d c3 20 e9 7a 26 05 32 a8 aa 7a 75 8a 1e\ +c2 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 4.6 +Plaintext: \ +f2 22 42 75 1e c6 b1 +Seed: # not used yet\ +2e 7e 1e 17 f6 47 b5 dd d0 33 e1 54 72 f9 0f 68\ +12 f3 ac 4e +Ciphertext: \ +00 a5 ff a4 76 8c 8b be ca ee 2d b7 7e 8f 2e ec\ +99 59 59 33 54 55 20 83 5e 5b a7 db 94 93 d3 e1\ +7c dd ef e6 a5 f5 67 62 44 71 90 8d b4 e2 d8 3a\ +0f be e6 06 08 fc 84 04 95 03 b2 23 4a 07 dc 83\ +b2 7b 22 84 7a d8 92 0f f4 2f 67 4e f7 9b 76 28\ +0b 00 23 3d 2b 51 b8 cb 27 03 a9 d4 2b fb c8 25\ +0c 96 ec 32 c0 51 e5 7f 1b 4b a5 28 db 89 c3 7e\ +4c 54 e2 7e 6e 64 ac 69 63 5a e8 87 d9 54 16 19\ +a9 +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 5: A 1028-bit RSA Key Pair +Modulus: \ +0a ad f3 f9 c1 25 e5 d8 91 f3 1a c4 48 e9 93 de\ +fe 58 0f 80 2b 45 f9 d7 f2 2b a5 02 1e 9c 47 57\ +6b 5a 1e 68 03 1b a9 db 4e 6d ab e4 d9 6a 1d 6f\ +3d 26 72 68 cf f4 08 00 5f 11 8e fc ad b9 98 88\ +d1 c2 34 46 71 66 b2 a2 b8 49 a0 5a 88 9c 06 0a\ +c0 da 0c 5f ae 8b 55 f3 09 ba 62 e7 03 74 2f a0\ +32 6f 2d 10 b0 11 02 14 89 ff 49 77 70 19 0d 89\ +5f d3 9f 52 29 3c 39 ef d7 3a 69 8b da b9 f1 0e\ +d9 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +02 56 eb 4c ba 70 67 f2 d2 be 54 0d cd ff 45 82\ +a3 6b 7d 31 d1 c9 09 9b b2 14 b7 98 48 46 6a 26\ +8f 80 f5 8a 49 ac 04 c0 e3 64 89 34 a0 20 6c 04\ +53 7c 19 b2 36 64 3a 60 82 73 21 44 df 75 fa 21\ +75 88 f7 94 68 2b e8 91 68 27 6d c7 26 c5 c0 cb\ +db 84 d3 1b bf 26 d0 a4 3a f4 95 71 7f 7d 52 8a\ +cf ee 34 15 61 f6 ff 3c ae 05 c5 78 f8 47 0d 96\ +82 f9 c0 d0 72 f9 f6 06 8b 56 d5 88 0f 68 2b e2\ +c5 +Prime1: \ +03 b0 d3 96 2f 6d 17 54 9c bf ca 11 29 43 48 dc\ +f0 e7 e3 9f 8c 2b c6 82 4f 21 64 b6 06 d6 87 86\ +0d ae 1e 63 23 93 cf ed f5 13 22 82 29 06 9e 2f\ +60 e4 ac d7 e6 33 a4 36 06 3f 82 38 5f 48 99 37\ +07 +Prime2: \ +02 e4 c3 2e 2f 51 72 69 b7 07 23 09 f0 0c 0e 31\ +36 5f 7c e2 8b 23 6b 82 91 2d f2 39 ab f3 95 72\ +cf 0e d6 04 b0 29 82 e5 35 64 c5 2d 6a 05 39 7d\ +e5 c0 52 a2 fd dc 14 1e f7 18 98 36 34 6a eb 33\ +1f +ModPrime1PrivateExponent: \ +01 e8 4b 11 9d 25 16 1f a6 7b 00 25 6a 5b d9 b6\ +45 d2 b2 32 ec b0 5b 01 51 80 02 9a 88 62 2a dc\ +3f 09 b3 ae ac de 61 61 ab 7c de 22 c2 ad 26 e7\ +79 7d f5 4e 07 2c bd 3b 26 73 80 0b 3e 43 38 db\ +d5 +ModPrime2PrivateExponent: \ +eb 90 aa 1a 40 13 5b 4c ea 07 19 7c ed c8 81 9b\ +e1 e7 cb ff 25 47 66 21 16 f4 65 a4 a9 f4 87 ab\ +12 f3 ba 4f ef 13 82 22 65 a6 52 97 d9 8b 7b de\ +d9 37 2e 3f fe 81 a3 8b 3e 96 00 fe d0 55 75 4f +MultiplicativeInverseOfPrime2ModPrime1: \ +01 2f 7f 81 38 f9 40 40 62 eb 85 a4 29 24 52 0b\ +38 f5 bb 88 6a 01 96 f4 8b b8 dc ea 60 fd 92 cc\ +02 7f 18 e7 81 58 a3 4a 5c 5d 5f 86 0a 0f 6c 04\ +07 1a 7d 01 31 2c 06 50 62 f1 eb 48 b7 9d 1c 83\ +cb +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 5.1 +Plaintext: \ +af 71 a9 01 e3 a6 1d 31 32 f0 fc 1f db 47 4f 9e\ +a6 57 92 57 ff c2 4d 16 41 70 14 5b 3d bd e8 +Seed: # not used yet\ +44 c9 2e 28 3f 77 b9 49 9c 60 3d 96 36 60 c8 7d\ +2f 93 94 61 +Ciphertext: \ +03 60 46 a4 a4 7d 9e d3 ba 9a 89 13 9c 10 50 38\ +eb 74 92 b0 5a 5d 68 bf d5 3a cc ff 45 97 f7 a6\ +86 51 b4 7b 4a 46 27 d9 27 e4 85 ee d7 b4 56 64\ +20 e8 b4 09 87 9e 5d 60 6e ae 25 1d 22 a5 df 79\ +9f 79 20 bf c1 17 b9 92 57 2a 53 b1 26 31 46 bc\ +ea 03 38 5c c5 e8 53 c9 a1 01 c8 c3 e1 bd a3 1a\ +51 98 07 49 6c 6c b5 e5 ef b4 08 82 3a 35 2b 8f\ +a0 66 1f b6 64 ef ad d5 93 de b9 9f ff 5e d0 00\ +e5 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 5.2 +Plaintext: \ +a3 b8 44 a0 82 39 a8 ac 41 60 5a f1 7a 6c fd a4\ +d3 50 13 65 85 90 3a 41 7a 79 26 87 60 51 9a 4b\ +4a c3 30 3e c7 3f 0f 87 cf b3 23 99 +Seed: # not used yet\ +cb 28 f5 86 06 59 fc ee e4 9c 3e ea fc e6 25 a7\ +08 03 bd 32 +Ciphertext: \ +03 d6 eb 65 4e dc e6 15 bc 59 f4 55 26 5e d4 e5\ +a1 82 23 cb b9 be 4e 40 69 b4 73 80 4d 5d e9 6f\ +54 dc aa a6 03 d0 49 c5 d9 4a a1 47 0d fc d2 25\ +40 66 b7 c7 b6 1f f1 f6 f6 77 0e 32 15 c5 13 99\ +fd 4e 34 ec 50 82 bc 48 f0 89 84 0a d0 43 54 ae\ +66 dc 0f 1b d1 8e 46 1a 33 cc 12 58 b4 43 a2 83\ +7a 6d f2 67 59 aa 23 02 33 49 86 f8 73 80 c9 cc\ +9d 53 be 9f 99 60 5d 2c 9a 97 da 7b 09 15 a4 a7\ +ad +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 5.3 +Plaintext: \ +30 8b 0e cb d2 c7 6c b7 7f c6 f7 0c 5e dd 23 3f\ +d2 f2 09 29 d6 29 f0 26 95 3b b6 2a 8f 4a 3a 31\ +4b de 19 5d e8 5b 5f 81 6d a2 aa b0 74 d2 6c b6\ +ac dd f3 23 ae 3b 9c 67 8a c3 cf 12 fb dd e7 +Seed: # not used yet\ +22 85 f4 0d 77 04 82 f9 a9 ef a2 c7 2c b3 ac 55\ +71 6d c0 ca +Ciphertext: \ +07 70 95 21 81 64 9f 9f 9f 07 ff 62 6f f3 a2 2c\ +35 c4 62 44 3d 90 5d 45 6a 9f d0 bf f4 3c ac 2c\ +a7 a9 f5 54 e9 47 8b 9a cc 3a c8 38 b0 20 40 ff\ +d3 e1 84 7d e2 e4 25 39 29 f9 dd 9e e4 04 43 25\ +a9 b0 5c ab b8 08 b2 ee 84 0d 34 e1 5d 10 5a 3f\ +1f 7b 27 69 5a 1a 07 a2 d7 3f e0 8e ca aa 3c 9c\ +9d 4d 5a 89 ff 89 0d 54 72 7d 7a e4 0c 0e c1 a8\ +dd 86 16 5d 8e e2 c6 36 81 41 01 6a 48 b5 5b 69\ +67 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 5.4 +Plaintext: \ +15 c5 b9 ee 11 85 +Seed: # not used yet\ +49 fa 45 d3 a7 8d d1 0d fd 57 73 99 d1 eb 00 af\ +7e ed 55 13 +Ciphertext: \ +08 12 b7 67 68 eb cb 64 2d 04 02 58 e5 f4 44 1a\ +01 85 21 bd 96 68 7e 6c 5e 89 9f cd 6c 17 58 8f\ +f5 9a 82 cc 8a e0 3a 4b 45 b3 12 99 af 17 88 c3\ +29 f7 dc d2 85 f8 cf 4c ed 82 60 6b 97 61 26 71\ +a4 5b ed ca 13 34 42 14 4d 16 17 d1 14 f8 02 85\ +7f 0f 9d 73 97 51 c5 7a 3f 9e e4 00 91 2c 61 e2\ +e6 99 2b e0 31 a4 3d d4 8f a6 ba 14 ee f7 c4 22\ +b5 ed c4 e7 af a0 4f dd 38 f4 02 d1 c8 bb 71 9a\ +bf +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 5.5 +Plaintext: \ +21 02 6e 68 00 c7 fa 72 8f ca ab a0 d1 96 ae 28\ +d7 a2 ac 4f fd 8a bc e7 94 f0 98 5f 60 c8 a6 73\ +72 77 36 5d 3f ea 11 db 89 23 a2 02 9a +Seed: # not used yet\ +f0 28 74 13 23 4c c5 03 47 24 a0 94 c4 58 6b 87\ +af f1 33 fc +Ciphertext: \ +07 b6 0e 14 ec 95 4b fd 29 e6 0d 00 47 e7 89 f5\ +1d 57 18 6c 63 58 99 03 30 67 93 ce d3 f6 82 41\ +c7 43 52 9a ba 6a 63 74 f9 2e 19 e0 16 3e fa 33\ +69 7e 19 6f 76 61 df aa a4 7a ac 6b de 5e 51 de\ +b5 07 c7 2c 58 9a 2c a1 69 3d 96 b1 46 03 81 24\ +9b 2c db 9e ac 44 76 9f 24 89 c5 d3 d2 f9 9f 0e\ +e3 c7 ee 5b f6 4a 5a c7 9c 42 bd 43 3f 14 9b e8\ +cb 59 54 83 61 64 05 95 51 3c 97 af 7b c2 50 97\ +23 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 5.6 +Plaintext: \ +54 1e 37 b6 8b 6c 88 72 b8 4c 02 +Seed: # not used yet\ +d9 fb a4 5c 96 f2 1e 6e 26 d2 9e b2 cd cb 65 85\ +be 9c b3 41 +Ciphertext: \ +08 c3 6d 4d da 33 42 3b 2e d6 83 0d 85 f6 41 1b\ +a1 dc f4 70 a1 fa e0 eb ef ee 7c 08 9f 25 6c ef\ +74 cb 96 ea 69 c3 8f 60 f3 9a be e4 41 29 bc b4\ +c9 2d e7 f7 97 62 3b 20 07 4e 3d 9c 28 99 70 1e\ +d9 07 1e 1e fa 0b dd 84 d4 c3 e5 13 03 02 d8 f0\ +24 0b ab a4 b8 4a 71 cc 03 2f 22 35 a5 ff 0f ae\ +27 7c 3e 8f 91 12 be f4 4c 9a e2 0d 17 5f c9 a4\ +05 8b fc 93 0b a3 1b 02 e2 e4 f4 44 48 37 10 f2\ +4a +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 6: A 1029-bit RSA Key Pair +Modulus: \ +12 b1 7f 6d ad 2e cd 19 ff 46 dc 13 f7 86 0f 09\ +e0 e0 cf b6 77 b3 8a 52 59 23 05 ce af 02 2c 16\ +6d b9 0d 04 ac 29 e3 3f 7d d1 2d 9f af 66 e0 81\ +6b b6 3e ad 26 7c c7 d4 6c 17 c3 7b e2 14 bc a2\ +a2 2d 72 3a 64 e4 44 07 43 6b 6f c9 65 72 9a ef\ +c2 55 4f 37 6c d5 dc ea 68 29 37 80 a6 2b f3 9d\ +00 29 48 5a 16 0b bb 9e 5d c0 97 2d 21 a5 04 f5\ +2e 5e e0 28 aa 41 63 32 f5 10 b2 e9 cf f5 f7 22\ +af +PublicExponent: \ +01 00 01 +PrivateExponent: \ +02 95 ec a3 56 06 18 36 95 59 ce cd 30 3a a9 cf\ +da fc 1d 9f 06 95 9d f7 5f fe f9 29 aa 89 69 61\ +bc d1 90 dc 69 97 ed a7 f5 96 3e 72 4d 07 b4 dc\ +11 f3 06 5e 5a e9 7d 96 83 51 12 28 0b 90 84 bb\ +14 f2 a2 1e bd 4e 88 9d 41 b9 c4 13 2e c1 95 6f\ +ca b8 bb 2f ed 05 75 88 49 36 52 2c 5f f7 d3 32\ +61 90 48 24 e7 ca de e4 e0 bb 37 2d 24 57 cf 78\ +e2 bd 12 86 22 8f f8 3f 10 73 1c e6 3c 90 cf f3\ +f9 +Prime1: \ +04 a6 ce 8b 73 58 df a6 9b dc f7 42 61 70 05 af\ +b5 38 5f 5f 3a 58 a2 4e f7 4a 22 a8 c0 5c b7 cc\ +38 eb d4 cc 9d 9a 9d 78 9a 62 cd 0f 60 f0 cb 94\ +1d 34 23 c9 69 2e fa 4f e3 ad ff 29 0c 47 49 a3\ +8b +Prime2: \ +04 04 c9 a8 03 37 1f ed b4 c5 be 39 f3 c0 0b 00\ +9e 5e 08 a6 3b e1 e4 00 35 cd ac a5 01 1c c7 01\ +cf 7e eb cb 99 f0 ff e1 7c fd 0a 4b f7 be fd 2d\ +d5 36 ac 94 6d b7 97 fd bc 4a be 8f 29 34 9b 91\ +ed +ModPrime1PrivateExponent: \ +03 96 1c 8f 76 0a a2 bd 51 54 c7 aa fd 77 22 5b\ +3b ac d0 13 9a e7 b5 94 8e a3 31 1f cc d8 6f b9\ +5c 75 af a7 67 28 4b 9b 2d e5 59 57 2f 15 d8 d0\ +44 c7 eb 83 a1 be 5f ad f2 cc 37 7c 0d 84 75 29\ +4b +ModPrime2PrivateExponent: \ +02 21 97 e0 66 74 21 96 aa bc 03 fa 2f ee b4 e7\ +0b 15 cb 78 7d 61 7a cd 31 bb 75 c7 bc 23 4a d7\ +06 f7 c4 8d 21 82 d1 f0 ff 9c 22 8d cf 41 96 7b\ +6c 0b a6 d2 c0 ad 11 0a 1b 85 78 31 ec 24 5e 2c\ +b1 +MultiplicativeInverseOfPrime2ModPrime1: \ +04 01 c4 c0 c5 3d 45 db db 5e 9d 96 d0 fe cf 42\ +75 df 09 74 bc 4a 07 36 b4 a7 4c 32 69 05 3e fb\ +68 6a ce 24 06 e2 2c 9e 05 8d db 4a e5 40 62 7a\ +e2 fd b0 82 61 e8 e7 e4 bc bc 99 4d aa fa 30 5c\ +45 +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 6.1 +Plaintext: \ +40 46 ca 8b aa 33 47 ca 27 f4 9e 0d 81 f9 cc 1d\ +71 be 9b a5 17 d4 +Seed: # not used yet\ +dd 0f 6c fe 41 5e 88 e5 a4 69 a5 1f bb a6 df d4\ +0a db 43 84 +Ciphertext: \ +06 30 ee bc d2 85 6c 24 f7 98 80 6e 41 f9 e6 73\ +45 ed a9 ce da 38 6a cc 9f ac ae a1 ee ed 06 ac\ +e5 83 70 97 18 d9 d1 69 fa df 41 4d 5c 76 f9 29\ +96 83 3e f3 05 b7 5b 1e 4b 95 f6 62 a2 0f ae dc\ +3b ae 0c 48 27 a8 bf 8a 88 ed bd 57 ec 20 3a 27\ +a8 41 f0 2e 43 a6 15 ba b1 a8 ca c0 70 1d e3 4d\ +eb de f6 2a 08 80 89 b5 5e c3 6e a7 52 2f d3 ec\ +8d 06 b6 a0 73 e6 df 83 31 53 bc 0a ef d9 3b d1\ +a3 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 6.2 +Plaintext: \ +5c c7 2c 60 23 1d f0 3b 3d 40 f9 b5 79 31 bc 31\ +10 9f 97 25 27 f2 8b 19 e7 48 0c 72 88 cb 3c 92\ +b2 25 12 21 4e 4b e6 c9 14 79 2d da bd f5 7f aa\ +8a a7 +Seed: # not used yet\ +8d 14 bd 94 6a 13 51 14 8f 5c ae 2e d9 a0 c6 53\ +e8 5e bd 85 +Ciphertext: \ +0e bc 37 37 61 73 a4 fd 2f 89 cc 55 c2 ca 62 b2\ +6b 11 d5 1c 3c 7c e4 9e 88 45 f7 4e 76 07 31 7c\ +43 6b c8 d2 3b 96 67 df eb 9d 08 72 34 b4 7b c6\ +83 71 75 ae 5c 05 59 f6 b8 1d 7d 22 41 6d 3e 50\ +f4 ac 53 3d 8f 08 12 f2 db 9e 79 1f e9 c7 75 ac\ +8b 6a d0 f5 35 ad 9c eb 23 a4 a0 20 14 c5 8a b3\ +f8 d3 16 14 99 a2 60 f3 93 48 e7 14 ae 2a 1d 34\ +43 20 8f d8 b7 22 cc fd fb 39 3e 98 01 1f 99 e6\ +3f +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 6.3 +Plaintext: \ +b2 0e 65 13 03 09 2f 4b cc b4 30 70 c0 f8 6d 23\ +04 93 62 ed 96 64 2f c5 63 2c 27 db 4a 52 e3 d8\ +31 f2 ab 06 8b 23 b1 49 87 9c 00 2f 6b f3 fe ee\ +97 59 11 12 56 2c +Seed: # not used yet\ +6c 07 5b c4 55 20 f1 65 c0 bf 5e a4 c5 df 19 1b\ +c9 ef 0e 44 +Ciphertext: \ +0a 98 bf 10 93 61 93 94 43 6c f6 8d 8f 38 e2 f1\ +58 fd e8 ea 54 f3 43 5f 23 9b 8d 06 b8 32 18 44\ +20 24 76 ae ed 96 00 94 92 48 0c e3 a8 d7 05 49\ +8c 4c 8c 68 f0 15 01 dc 81 db 60 8f 60 08 73 50\ +c8 c3 b0 bd 2e 9e f6 a8 14 58 b7 c8 01 b8 9f 2e\ +4f e9 9d 49 00 ba 6a 4b 5e 5a 96 d8 65 dc 67 6c\ +77 55 92 87 94 13 0d 62 80 a8 16 0a 19 0f 2d f3\ +ea 7c f9 aa 02 71 d8 8e 9e 69 05 ec f1 c5 15 2d\ +65 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 6.4 +Plaintext: \ +68 4e 30 38 c5 c0 41 f7 +Seed: # not used yet\ +3b bc 3b d6 63 7d fe 12 84 69 01 02 9b f5 b0 c0\ +71 03 43 9c +Ciphertext: \ +00 8e 7a 67 ca cf b5 c4 e2 4b ec 7d ee 14 91 17\ +f1 95 98 ce 8c 45 80 8f ef 88 c6 08 ff 9c d6 e6\ +95 26 3b 9a 3c 0a d4 b8 ba 4c 95 23 8e 96 a8 42\ +2b 85 35 62 9c 8d 53 82 37 44 79 ad 13 fa 39 97\ +4b 24 2f 9a 75 9e ea f9 c8 3a d5 a8 ca 18 94 0a\ +01 62 ba 75 58 76 df 26 3f 4b d5 0c 65 25 c5 60\ +90 26 7c 1f 0e 09 ce 08 99 a0 cf 35 9e 88 12 0a\ +bd 9b f8 93 44 5b 3c ae 77 d3 60 73 59 ae 9a 52\ +f8 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 6.5 +Plaintext: \ +32 48 8c b2 62 d0 41 d6 e4 dd 35 f9 87 bf 3c a6\ +96 db 1f 06 ac 29 a4 46 93 +Seed: # not used yet\ +b4 6b 41 89 3e 8b ef 32 6f 67 59 38 3a 83 07 1d\ +ae 7f ca bc +Ciphertext: \ +00 00 34 74 41 6c 7b 68 bd f9 61 c3 85 73 79 44\ +d7 f1 f4 0c b3 95 34 3c 69 3c c0 b4 fe 63 b3 1f\ +ed f1 ea ee ac 9c cc 06 78 b3 1d c3 2e 09 77 48\ +95 14 c4 f0 90 85 f6 29 8a 96 53 f0 1a ea 40 45\ +ff 58 2e e8 87 be 26 ae 57 5b 73 ee f7 f3 77 49\ +21 e3 75 a3 d1 9a dd a0 ca 31 aa 18 49 88 7c 1f\ +42 ca c9 67 7f 7a 2f 4e 92 3f 6e 5a 86 8b 38 c0\ +84 ef 18 75 94 dc 9f 7f 04 8f ea 2e 02 95 53 84\ +ab +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 6.6 +Plaintext: \ +50 ba 14 be 84 62 72 02 79 c3 06 ba +Seed: # not used yet\ +0a 24 03 31 2a 41 e3 d5 2f 06 0f bc 13 a6 7d e5\ +cf 76 09 a7 +Ciphertext: \ +0a 02 6d da 5f c8 78 5f 7b d9 bf 75 32 7b 63 e8\ +5e 2c 0f de e5 da db 65 eb dc ac 9a e1 de 95 c9\ +2c 67 2a b4 33 aa 7a 8e 69 ce 6a 6d 88 97 fa c4\ +ac 4a 54 de 84 1a e5 e5 bb ce 76 87 87 9d 79 63\ +4c ea 7a 30 68 40 65 c7 14 d5 24 09 b9 28 25 6b\ +bf 53 ea bc d5 23 1e b7 25 95 04 53 73 99 bd 29\ +16 4b 72 6d 33 a4 6d a7 01 36 0a 41 68 a0 91 cc\ +ab 72 d4 4a 62 fe d2 46 c0 ff ea 5b 13 48 ab 54\ +70 +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 7: A 1030-bit RSA Key Pair +Modulus: \ +31 11 79 f0 bc fc 9b 9d 3c a3 15 d0 0e f3 0d 7b\ +dd 3a 2c fa e9 91 1b fe dc b9 48 b3 a4 78 2d 07\ +32 b6 ab 44 aa 4b f0 37 41 a6 44 dc 01 be c3 e6\ +9b 01 a0 33 e6 75 d8 ac d7 c4 92 5c 6b 1a ec 31\ +19 05 1d fd 89 76 2d 21 5d 45 47 5f fc b5 9f 90\ +81 48 62 3f 37 17 71 56 f6 ae 86 dd 7a 7c 5f 43\ +dc 1e 1f 90 82 54 05 8a 28 4a 5f 06 c0 02 17 93\ +a8 7f 1a c5 fe ff 7d ca ee 69 c5 e5 1a 37 89 e3\ +73 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +07 0c fc ff 2f eb 82 76 e2 74 32 c4 5d fe e4 8f\ +49 b7 91 7d 65 30 e1 f0 ca 34 60 f3 2e 02 76 17\ +44 87 c5 6e 22 a4 5d 25 00 d7 77 54 95 21 9d 7d\ +16 5a 9c f3 bd 92 c3 2a f9 a9 8d 8d c9 cc 29 68\ +00 ad c9 4a 0a 54 fb 40 f3 42 91 bf 84 ee 8e a1\ +2b 6f 10 93 59 c6 d3 54 2a 50 f9 c7 67 f5 cf ff\ +05 a6 81 c2 e6 56 fb 77 ca aa db 4b e9 46 8d 8a\ +bc d4 df 98 f5 8e 86 d2 05 3f a1 34 9f 74 8e 21\ +b1 +Prime1: \ +07 49 26 2c 11 1c d4 70 ec 25 66 e6 b3 73 2f c0\ +93 29 46 9a a1 90 71 d3 b9 c0 19 06 51 4c 6f 1d\ +26 ba a1 4b ea b0 97 1c 8b 7e 61 1a 4f 79 00 9d\ +6f ea 77 69 28 ca 25 28 5b 0d e3 64 3d 1a 3f 8c\ +71 +Prime2: \ +06 bc 1e 50 e9 6c 02 bf 63 6e 9e ea 8b 89 9b be\ +bf 76 51 de 77 dd 47 4c 3e 9b c2 3b ad 81 82 b6\ +19 04 c7 d9 7d fb eb fb 1e 00 10 88 78 b6 e6 7e\ +41 53 91 d6 79 42 c2 b2 bf 9b 44 35 f8 8b 0c b0\ +23 +ModPrime1PrivateExponent: \ +03 bc 7e a7 f0 aa b1 43 ab c6 ce 8b 97 11 86 36\ +a3 01 72 e4 cf e0 2c 8f a0 dd a3 b7 ba af 90 f8\ +09 29 82 98 55 25 f4 88 bd fc b4 bd 72 6e 22 63\ +9a c6 4a 30 92 ab 7f fc bf 1d 53 34 cf a5 0b 5b\ +f1 +ModPrime2PrivateExponent: \ +02 62 a6 aa 29 c2 a3 c6 7d c5 34 6c 06 38 1a fd\ +98 7a a3 cc 93 cf bf ec f5 4f dd 9f 9d 78 7d 7f\ +59 a5 23 d3 98 97 9d a1 37 a2 f6 38 1f e9 48 01\ +f7 c9 4d a2 15 18 dc 34 cb 40 87 0c 46 97 99 4a\ +d9 +MultiplicativeInverseOfPrime2ModPrime1: \ +64 9d 4c 17 b6 ee 17 21 e7 72 d0 38 9a 55 9c 3d\ +3c df 95 50 d4 57 c4 6b 03 7b 74 64 1b 1d 52 16\ +6a f8 a2 13 c8 39 62 06 cd fb a4 42 2f 18 d6 f6\ +1d bc b5 d2 14 c9 71 bf 48 2a eb 97 6a 73 70 c2 +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 7.1 +Plaintext: \ +47 aa e9 09 +Seed: # not used yet\ +43 dd 09 a0 7f f4 ca c7 1c aa 46 32 ee 5e 1c 1d\ +ae e4 cd 8f +Ciphertext: \ +16 88 e4 ce 77 94 bb a6 cb 70 14 16 9e cd 55 9c\ +ed e2 a3 0b 56 a5 2b 68 d9 fe 18 cf 19 73 ef 97\ +b2 a0 31 53 95 1c 75 5f 62 94 aa 49 ad bd b5 58\ +45 ab 68 75 fb 39 86 c9 3e cf 92 79 62 84 0d 28\ +2f 9e 54 ce 8b 69 0f 7c 0c b8 bb d7 34 40 d9 57\ +1d 1b 16 cd 92 60 f9 ea b4 78 3c c4 82 e5 22 3d\ +c6 09 73 87 17 83 ec 27 b0 ae 0f d4 77 32 cb c2\ +86 a1 73 fc 92 b0 0f b4 ba 68 24 64 7c d9 3c 85\ +c1 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 7.2 +Plaintext: \ +1d 9b 2e 22 23 d9 bc 13 bf b9 f1 62 ce 73 5d b4\ +8b a7 c6 8f 68 22 a0 a1 a7 b6 ae 16 58 34 e7 +Seed: # not used yet\ +3a 9c 3c ec 7b 84 f9 bd 3a de cb c6 73 ec 99 d5\ +4b 22 bc 9b +Ciphertext: \ +10 52 ed 39 7b 2e 01 e1 d0 ee 1c 50 bf 24 36 3f\ +95 e5 04 f4 a0 34 34 a0 8f d8 22 57 4e d6 b9 73\ +6e db b5 f3 90 db 10 32 14 79 a8 a1 39 35 0e 2b\ +d4 97 7c 37 78 ef 33 1f 3e 78 ae 11 8b 26 84 51\ +f2 0a 2f 01 d4 71 f5 d5 3c 56 69 37 17 1b 2d bc\ +2d 4b de 45 9a 57 99 f0 37 2d 65 74 23 9b 23 23\ +d2 45 d0 bb 81 c2 86 b6 3c 89 a3 61 01 73 37 e4\ +90 2f 88 a4 67 f4 c7 f2 44 bf d5 ab 46 43 7f f3\ +b6 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 7.3 +Plaintext: \ +d9 76 fc +Seed: # not used yet\ +76 a7 5e 5b 61 57 a5 56 cf 88 84 bb 2e 45 c2 93\ +dd 54 5c f5 +Ciphertext: \ +21 55 cd 84 3f f2 4a 4e e8 ba db 76 94 26 00 28\ +a4 90 81 3b a8 b3 69 a4 cb f1 06 ec 14 8e 52 98\ +70 7f 59 65 be 7d 10 1c 10 49 ea 85 84 c2 4c d6\ +34 55 ad 9c 10 4d 68 62 82 d3 fb 80 3a 4c 11 c1\ +c2 e9 b9 1c 71 78 80 1d 1b 66 40 f0 03 f5 72 8d\ +f0 07 b8 a4 cc c9 2b ce 05 e4 1a 27 27 8d 7c 85\ +01 8c 52 41 43 13 a5 07 77 89 00 1d 4f 01 91 0b\ +72 aa d0 5d 22 0a a1 4a 58 73 3a 74 89 bc 54 55\ +6b +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 7.4 +Plaintext: \ +d4 73 86 23 df 22 3a a4 38 43 df 84 67 53 4c 41\ +d0 13 e0 c8 03 c6 24 e2 63 66 6b 23 9b de 40 a5\ +f2 9a eb 8d e7 9e 3d aa 61 dd 03 70 f4 9b d4 b0\ +13 83 4b 98 21 2a ef 6b 1c 5e e3 73 b3 cb +Seed: # not used yet\ +78 66 31 4a 6a d6 f2 b2 50 a3 59 41 db 28 f5 86\ +4b 58 58 59 +Ciphertext: \ +0a b1 4c 37 3a eb 7d 43 28 d0 aa ad 8c 09 4d 88\ +b9 eb 09 8b 95 f2 10 54 a2 90 82 52 2b e7 c2 7a\ +31 28 78 b6 37 91 7e 3d 81 9e 6c 3c 56 8d b5 d8\ +43 80 2b 06 d5 1d 9e 98 a2 be 0b f4 0c 03 14 23\ +b0 0e df bf f8 32 0e fb 91 71 bd 20 44 65 3a 4c\ +b9 c5 12 2f 6c 65 e8 3c da 2e c3 c1 26 02 7a 9c\ +1a 56 ba 87 4d 0f ea 23 f3 80 b8 2c f2 40 b8 cf\ +54 00 04 75 8c 4c 77 d9 34 15 7a 74 f3 fc 12 bf\ +ac +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 7.5 +Plaintext: \ +bb 47 23 1c a5 ea 1d 3a d4 6c 99 34 5d 9a 8a 61 +Seed: # not used yet\ +b2 16 6e d4 72 d5 8d b1 0c ab 2c 6b 00 0c cc f1\ +0a 7d c5 09 +Ciphertext: \ +02 83 87 a3 18 27 74 34 79 8b 4d 97 f4 60 06 8d\ +f5 29 8f ab a5 04 1b a1 17 61 a1 cb 73 16 b2 41\ +84 11 4e c5 00 25 7e 25 89 ed 3b 60 7a 1e bb e9\ +7a 6c c2 e0 2b f1 b6 81 f4 23 12 a3 3b 7a 77 d8\ +e7 85 5c 4a 6d e0 3e 3c 04 64 3f 78 6b 91 a2 64\ +a0 d6 80 5e 2c ea 91 e6 81 77 eb 7a 64 d9 25 5e\ +4f 27 e7 13 b7 cc ec 00 dc 20 0e bd 21 c2 ea 2b\ +b8 90 fe ae 49 42 df 94 1d c3 f9 78 90 ed 34 74\ +78 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 7.6 +Plaintext: \ +21 84 82 70 95 d3 5c 3f 86 f6 00 e8 e5 97 54 01\ +32 96 +Seed: # not used yet\ +52 67 3b de 2c a1 66 c2 aa 46 13 1a c1 dc 80 8d\ +67 d7 d3 b1 +Ciphertext: \ +14 c6 78 a9 4a d6 05 25 ef 39 e9 59 b2 f3 ba 5c\ +09 7a 94 ff 91 2b 67 db ac e8 05 35 c1 87 ab d4\ +7d 07 54 20 b1 87 21 52 bb a0 8f 7f c3 1f 31 3b\ +bf 92 73 c9 12 fc 4c 01 49 a9 b0 cf b7 98 07 e3\ +46 eb 33 20 69 61 1b ec 0f f9 bc d1 68 f1 f7 c3\ +3e 77 31 3c ea 45 4b 94 e2 54 9e ec f0 02 e2 ac\ +f7 f6 f2 d2 84 5d 4f e0 aa b2 e5 a9 2d df 68 c4\ +80 ae 11 24 79 35 d1 f6 25 74 84 22 16 ae 67 41\ +15 +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 8: A 1031-bit RSA Key Pair +Modulus: \ +5b df 0e 30 d3 21 dd a5 14 7f 88 24 08 fa 69 19\ +54 80 df 8f 80 d3 f6 e8 bf 58 18 50 4f 36 42 7c\ +a9 b1 f5 54 0b 9c 65 a8 f6 97 4c f8 44 7a 24 4d\ +92 80 20 1b b4 9f cb be 63 78 d1 94 4c d2 27 e2\ +30 f9 6e 3d 10 f8 19 dc ef 27 6c 64 a0 0b 2a 4b\ +67 01 e7 d0 1d e5 fa bd e3 b1 e9 a0 df 82 f4 63\ +13 59 cd 22 66 96 47 fb b1 71 72 46 13 4e d7 b4\ +97 cf ff bd c4 2b 59 c7 3a 96 ed 90 16 62 12 df\ +f7 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +0f 7d 1e 9e 5a aa 25 fd 13 e4 a0 66 3a e1 44 e0\ +d1 5f 5c d1 8b cd b0 9d f2 cc 7e 64 e3 c5 e9 15\ +ad 62 64 53 04 16 1d 09 8c 71 5b b7 ab 8b d0 1d\ +07 ea f3 fe d7 c7 ed 08 af 2a 8a 62 ef 44 ab 16\ +b3 20 e1 4a f7 2a 48 f9 6a fe 26 2a 0a e4 cf 65\ +e6 35 e9 10 79 0c d4 ee 5c ea 76 8a 4b 26 39 f7\ +e6 f6 77 b3 f0 bb 6b e3 2b 75 74 7d 89 09 03 6f\ +02 64 f5 8d 40 1c db a1 31 71 61 57 a7 5e cf 63\ +31 +Prime1: \ +0a 02 ef 84 48 d9 fa d8 bb d0 d0 04 c8 c2 aa 97\ +51 ef 97 21 c1 b0 d0 32 36 a5 4b 0d f9 47 cb ae\ +d5 a2 55 ee 9e 8e 20 d4 91 ea 17 23 fe 09 47 04\ +a9 76 2e 88 af d1 6e bb 59 94 41 2c a9 66 dc 4f\ +9f +Prime2: \ +09 2d 36 2e 7e d3 a0 bf d9 e9 fd 0e 6c 03 01 b6\ +df 29 15 9c f5 0c c8 3b 9b 0c f4 d6 ee a7 1a 61\ +e0 02 b4 6e 0a e9 f2 de 62 d2 5b 5d 74 52 d4 98\ +b8 1c 9a c6 fc 58 59 3d 4c 3f b4 f5 d7 2d fb b0\ +a9 +ModPrime1PrivateExponent: \ +07 c7 14 10 af 10 39 62 db 36 74 04 e3 7a e8 50\ +ba a4 e9 c2 9d d9 21 45 81 52 94 a6 7c 7d 1c 6d\ +ed 26 3a a0 30 a9 b6 33 ae 50 30 3e 14 03 5d 1a\ +f0 14 12 3e ba 68 78 20 30 8d 8e bc 85 b6 95 7d\ +7d +ModPrime2PrivateExponent: \ +ae 2c 75 38 0c 02 c0 16 ad 05 89 1b 33 01 de 88\ +1f 28 ae 11 71 18 2b 6b 2c 83 be a7 c5 15 ec a9\ +ca 29 8c 7b 1c ab 58 17 a5 97 06 8f c8 50 60 de\ +4d a8 a0 16 37 8a ae 43 c7 f9 67 bc c3 79 04 b9 +MultiplicativeInverseOfPrime2ModPrime1: \ +05 98 d1 05 9e 3a da 4f 63 20 75 2c 09 d8 05 ff\ +7d 1f 1a e0 d0 17 ae ee e9 ce fa 0d 7d d7 ff 77\ +5e 44 b5 78 32 2f 64 05 d6 21 1d a1 95 19 66 6a\ +a8 7f dc 4c d8 c8 8f 6b 6e 3d 67 e9 61 dc bb a3\ +d0 +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 8.1 +Plaintext: \ +05 0b 75 5e 5e 68 80 f7 b9 e9 d6 92 a7 4c 37 aa\ +e4 49 b3 1b fe a6 de ff 83 74 7a 89 7f 6c 2c 82\ +5b b1 ad bf 85 0a 3c 96 99 4b 5d e5 b3 3c bc 7d\ +4a 17 91 3a 79 67 +Seed: # not used yet\ +77 06 ff ca 1e cf b1 eb ee 2a 55 e5 c6 e2 4c d2\ +79 7a 41 25 +Ciphertext: \ +09 b3 68 3d 8a 2e b0 fb 29 5b 62 ed 1f b9 29 0b\ +71 44 57 b7 82 53 19 f4 64 78 72 af 88 9b 30 40\ +94 72 02 0a d1 29 12 bf 19 b1 1d 48 19 f4 96 14\ +82 4f fd 84 d0 9c 0a 17 e7 d1 73 09 d1 29 19 79\ +04 10 aa 29 95 69 9f 6a 86 db e3 24 2b 5a cc 23\ +af 45 69 10 80 d6 b1 ae 81 0f b3 e3 05 70 87 f0\ +97 00 92 ce 00 be 95 62 ff 40 53 b6 26 2c e0 ca\ +a9 3e 13 72 3d 2e 3a 5b a0 75 d4 5f 0d 61 b5 4b\ +61 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 8.2 +Plaintext: \ +4e b6 8d cd 93 ca 9b 19 df 11 1b d4 36 08 f5 57\ +02 6f e4 aa 1d 5c fa c2 27 a3 eb 5a b9 54 8c 18\ +a0 6d de d2 3f 81 82 59 86 b2 fc d7 11 09 ec ef\ +7e ff 88 87 3f 07 5c 2a a0 c4 69 f6 9c 92 bc +Seed: # not used yet\ +a3 71 7d a1 43 b4 dc ff bc 74 26 65 a8 fa 95 05\ +85 54 83 43 +Ciphertext: \ +2e cf 15 c9 7c 5a 15 b1 47 6a e9 86 b3 71 b5 7a\ +24 28 4f 4a 16 2a 8d 0c 81 82 e7 90 5e 79 22 56\ +f1 81 2b a5 f8 3f 1f 7a 13 0e 42 dc c0 22 32 84\ +4e dc 14 a3 1a 68 ee 97 ae 56 4a 38 3a 34 11 65\ +64 24 c5 f6 2d db 64 60 93 c3 67 be 1f cd a4 26\ +cf 00 a0 6d 8a cb 7e 57 77 6f bb d8 55 ac 3d f5\ +06 fc 16 b1 d7 c3 f2 11 0f 3d 80 68 e9 1e 18 63\ +63 83 1c 84 09 68 0d 8d a9 ec d8 cf 1f a2 0e e3\ +9d +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 8.3 +Plaintext: \ +86 04 ac 56 32 8c 1a b5 ad 91 78 61 +Seed: # not used yet\ +ee 06 20 90 73 cc a0 26 bb 26 4e 51 85 bf 8c 68\ +b7 73 9f 86 +Ciphertext: \ +4b c8 91 30 a5 b2 da bb 7c 2f cf 90 eb 5d 0e af\ +9e 68 1b 71 46 a3 8f 31 73 a3 d9 cf ec 52 ea 9e\ +0a 41 93 2e 64 8a 9d 69 34 4c 50 da 76 3f 51 a0\ +3c 95 76 21 31 e8 05 22 54 dc d2 24 8c ba 40 fd\ +31 66 77 86 ce 05 a2 b7 b5 31 ac 9d ac 9e d5 84\ +a5 9b 67 7c 1a 8a ed 8c 5d 15 d6 8c 05 56 9e 2b\ +e7 80 bf 7d b6 38 fd 2b fd 2a 85 ab 27 68 60 f3\ +77 73 38 fc a9 89 ff d7 43 d1 3e e0 8e 0c a9 89\ +3f +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 8.4 +Plaintext: \ +fd da 5f bf 6e c3 61 a9 d9 a4 ac 68 af 21 6a 06\ +86 f4 38 b1 e0 e5 c3 6b 95 5f 74 e1 07 f3 9c 0d\ +dd cc +Seed: # not used yet\ +99 0a d5 73 dc 48 a9 73 23 5b 6d 82 54 36 18 f2\ +e9 55 10 5d +Ciphertext: \ +2e 45 68 47 d8 fc 36 ff 01 47 d6 99 35 94 b9 39\ +72 27 d5 77 75 2c 79 d0 f9 04 fc b0 39 d4 d8 12\ +fe a6 05 a7 b5 74 dd 82 ca 78 6f 93 75 23 48 43\ +8e e9 f5 b5 45 49 85 d5 f0 e1 69 9e 3e 7a d1 75\ +a3 2e 15 f0 3d eb 04 2a b9 fe 1d d9 db 1b b8 6f\ +8c 08 9c cb 45 e7 ef 0c 5e e7 ca 9b 72 90 ca 6b\ +15 be d4 70 39 78 8a 8a 93 ff 83 e0 e8 d6 24 4c\ +71 00 63 62 de ef 69 b6 f4 16 fb 3c 68 43 83 fb\ +d0 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 8.5 +Plaintext: \ +4a 5f 49 14 be e2 5d e3 c6 93 41 de 07 +Seed: # not used yet\ +ec c6 3b 28 f0 75 6f 22 f5 2a c8 e6 ec 12 51 a6\ +ec 30 47 18 +Ciphertext: \ +1f b9 35 6f d5 c4 b1 79 6d b2 eb f7 d0 d3 93 cc\ +81 0a df 61 45 de fc 2f ce 71 4f 79 d9 38 00 d5\ +e2 ac 21 1e a8 bb ec ca 4b 65 4b 94 c3 b1 8b 30\ +dd 57 6c e3 4d c9 54 36 ef 57 a0 94 15 64 59 23\ +35 9a 5d 7b 41 71 ef 22 c2 46 70 f1 b2 29 d3 60\ +3e 91 f7 66 71 b7 df 97 e7 31 7c 97 73 44 76 d5\ +f3 d1 7d 21 cf 82 b5 ba 9f 83 df 2e 58 8d 36 98\ +4f d1 b5 84 46 8b d2 3b 2e 87 5f 32 f6 89 53 f7\ +b2 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 8.6 +Plaintext: \ +8e 07 d6 6f 7b 88 0a 72 56 3a bc d3 f3 50 92 bc\ +33 40 9f b7 f8 8f 24 72 be +Seed: # not used yet\ +39 25 c7 1b 36 2d 40 a0 a6 de 42 14 55 79 ba 1e\ +7d d4 59 fc +Ciphertext: \ +3a fd 9c 66 00 14 7b 21 79 8d 81 8c 65 5a 0f 4c\ +92 12 db 26 d0 b0 df dc 2a 75 94 cc b3 d2 2f 5b\ +f1 d7 c3 e1 12 cd 73 fc 7d 50 9c 7a 8b af dd 3c\ +27 4d 13 99 00 9f 96 09 ec 4b e6 47 7e 45 3f 07\ +5a a3 3d b3 82 87 0c 1c 34 09 ae f3 92 d7 38 6a\ +e3 a6 96 b9 9a 94 b4 da 05 89 44 7e 95 5d 16 c9\ +8b 17 60 2a 59 bd 73 62 79 fc d8 fb 28 0c 44 62\ +d5 90 bf a9 bf 13 fe d5 70 ea fd e9 73 30 a2 c2\ +10 +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 9: A 1536-bit RSA Key Pair +Modulus: \ +cf 2c d4 1e 34 ca 3a 72 8e a5 cb 8a ff 64 c3 6d\ +27 bd ef 53 64 e3 36 fd 68 d3 12 3c 5a 19 6a 8c\ +28 70 13 e8 53 d5 15 6d 58 d1 51 95 45 20 fb 4f\ +6d 7b 17 ab b6 81 77 65 90 9c 57 61 19 65 9d 90\ +2b 19 06 ed 8a 2b 10 c1 55 c2 4d 12 45 28 da b9\ +ee ae 37 9b ea c6 6e 4a 41 17 86 dc b8 fd 00 62\ +eb c0 30 de 12 19 a0 4c 2a 8c 1b 7d d3 13 1e 4d\ +6b 6c ae e2 e3 1a 5e d4 1a c1 50 9b 2e f1 ee 2a\ +b1 83 64 be 56 8c a9 41 c2 5e cc 84 ff 9d 64 3b\ +5e c1 aa ae 10 2a 20 d7 3f 47 9b 78 0f d6 da 91\ +07 52 12 d9 ea c0 3a 06 74 d8 99 eb a2 e4 31 f4\ +c4 4b 61 5b 6b a2 23 2b d4 b3 3b ae d7 3d 62 5d +PublicExponent: \ +01 00 01 +PrivateExponent: \ +19 8c 14 1e 23 71 5a 92 bc cf 6a 11 9a 5b c1 13\ +89 46 8d 28 11 f5 48 d7 27 e1 7b 4a b0 eb 98 6d\ +6f 21 1e fb 53 b7 1f 7c cb ea 87 ee 69 c7 5e e6\ +15 00 8c 53 32 de b5 2b f3 90 ab df bf e3 7d 72\ +05 36 81 59 b2 63 8c 1d e3 26 e2 1d 22 25 1f 0f\ +b5 84 8b 3b f1 50 05 d2 a7 43 30 f0 af e9 16 ee\ +62 cc c1 34 4d 1d 83 a7 09 e6 06 76 27 38 40 f7\ +f3 77 42 4a 5e 0a 4d a7 5f 01 b3 1f f7 68 19 cf\ +9c bf dd 21 52 43 c3 91 7c 03 ef 38 19 93 12 e5\ +67 b3 bf 7a ed 3a b4 57 f3 71 ef 8a 14 23 f4 5b\ +68 c6 e2 82 ec 11 1b ba 28 33 b9 87 fd 69 fa d8\ +3b c1 b8 c6 13 c5 e1 ea 16 c1 1e d1 25 ea 7e c1 +Prime1: \ +fc 8d 6c 04 be c4 eb 9a 81 92 ca 79 00 cb e5 36\ +e2 e8 b5 19 de cf 33 b2 45 97 98 c6 90 9d f4 f1\ +76 db 7d 23 19 0f c7 2b 88 65 a7 18 af 89 5f 1b\ +cd 91 45 29 80 27 42 3b 60 5e 70 a4 7c f5 83 90\ +a8 c3 e8 8f c8 c4 8e 8b 32 e3 da 21 0d fb e3 e8\ +81 ea 56 74 b6 a3 48 c2 1e 93 f9 e5 5e a6 5e fd +Prime2: \ +d2 00 d4 5e 78 8a ac ea 60 6a 40 1d 04 60 f8 7d\ +d5 c1 02 7e 12 dc 1a 0d 75 86 e8 93 9d 9c f7 89\ +b4 0f 51 ac 04 42 96 1d e7 d2 1c c2 1e 05 c8 31\ +55 c1 f2 aa 91 93 38 7c fd f9 56 cb 48 d1 53 ba\ +27 04 06 f9 bb ba 53 7d 49 87 d9 e2 f9 94 2d 7a\ +14 cb ff fe a7 4f ec dd a9 28 d2 3e 25 9f 5e e1 +ModPrime1PrivateExponent: \ +db 16 80 2f 79 a2 f0 d4 5f 35 8d 69 fd 33 e4 4b\ +81 fa e8 28 62 2e 93 a5 42 53 e9 97 d0 1b 07 43\ +75 9d a0 e8 12 b4 aa 4e 6c 8b ea b2 32 8d 54 31\ +95 5a 41 8a 67 ff 26 a8 c5 c8 07 a5 da 35 4e 05\ +ef 31 cc 8c f7 58 f4 63 73 29 50 b0 3e 26 57 26\ +fb 94 e3 9d 6a 57 2a 26 24 4a b0 8d b7 57 52 ad +ModPrime2PrivateExponent: \ +a0 a3 17 cf e7 df 14 23 f8 7a 6d ee 84 51 f4 e2\ +b4 a6 7e 54 97 f2 9b 4f 1e 4e 83 0b 9f ad d9 40\ +11 67 02 6f 55 96 e5 a3 9c 97 81 7e 0f 5f 16 e2\ +7e 19 ec 99 02 e0 1d 7e a6 fb 9a a3 c7 60 af ee\ +1e 38 1b 69 de 6a c9 c0 75 85 a0 6a d9 c4 ba 00\ +bf 75 c8 ad 2f a8 98 a4 79 e8 0a e2 94 fe d2 a1 +MultiplicativeInverseOfPrime2ModPrime1: \ +0b 21 f3 35 c3 53 34 2e b4 4c 3a a2 44 45 78 0c\ +2d 65 5b 94 01 74 ca e3 8c 7c 8a 4e 64 93 c0 ba\ +9f d3 03 74 82 67 b0 83 b9 a7 a6 cb 61 e4 2d b3\ +62 b8 c9 89 6d b7 06 4e 02 ad 5a e6 15 87 da 15\ +b4 64 9c 90 59 49 09 fe b3 7d bc b6 54 be b7 26\ +8e c8 01 e5 a8 b4 aa 39 11 be bd 88 54 2f 05 be +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 9.1 +Plaintext: \ +f7 35 fd 55 ba 92 59 2c 3b 52 b8 f9 c4 f6 9a aa\ +1c be f8 fe 88 ad d0 95 59 54 12 46 7f 9c f4 ec\ +0b 89 6c 59 ed a1 62 10 e7 54 9c 8a bb 10 cd bc\ +21 a1 2e c9 b6 b5 b8 fd 2f 10 39 9e b6 +Seed: # not used yet\ +8e c9 65 f1 34 a3 ec 99 31 e9 2a 1c a0 dc 81 69\ +d5 ea 70 5c +Ciphertext: \ +26 7b cd 11 8a ca b1 fc 8b a8 1c 85 d7 30 03 cb\ +86 10 fa 55 c1 d9 7d a8 d4 8a 7c 7f 06 89 6a 4d\ +b7 51 aa 28 42 55 b9 d3 6a d6 5f 37 65 3d 82 9f\ +1b 37 f9 7b 80 01 94 25 45 b2 fc 2c 55 a7 37 6c\ +a7 a1 be 4b 17 60 c8 e0 5a 33 e5 aa 25 26 b8 d9\ +8e 31 70 88 e7 83 4c 75 5b 2a 59 b1 26 31 a1 82\ +c0 5d 5d 43 ab 17 79 26 4f 84 56 f5 15 ce 57 df\ +df 51 2d 54 93 da b7 b7 33 8d c4 b7 d7 8d b9 c0\ +91 ac 3b af 53 7a 69 fc 7f 54 9d 97 9f 0e ff 9a\ +94 fd a4 16 9b d4 d1 d1 9a 69 c9 9e 33 c3 b5 54\ +90 d5 01 b3 9b 1e da e1 18 ff 67 93 a1 53 26 15\ +84 d3 a5 f3 9f 6e 68 2e 3d 17 c8 cd 12 61 fa 72 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 9.2 +Plaintext: \ +81 b9 06 60 50 15 a6 3a ab e4 2d df 11 e1 97 89\ +12 f5 40 4c 74 74 b2 6d ce 3e d4 82 bf 96 1e cc\ +81 8b f4 20 c5 46 59 +Seed: # not used yet\ +ec b1 b8 b2 5f a5 0c da b0 8e 56 04 28 67 f4 af\ +58 26 d1 6c +Ciphertext: \ +93 ac 9f 06 71 ec 29 ac bb 44 4e ff c1 a5 74 13\ +51 d6 0f db 0e 39 3f bf 75 4a cf 0d e4 97 61 a1\ +48 41 df 77 72 e9 bc 82 77 39 66 a1 58 4c 4d 72\ +ba ea 00 11 8f 83 f3 5c ca 6e 53 7c bd 4d 81 1f\ +55 83 b2 97 83 d8 a6 d9 4c d3 1b e7 0d 6f 52 6c\ +10 ff 09 c6 fa 7c e0 69 79 5a 3f cd 05 11 fd 5f\ +cb 56 4b cc 80 ea 9c 78 f3 8b 80 01 25 39 d8 a4\ +dd f6 fe 81 e9 cd db 7f 50 db bb bc c7 e5 d8 60\ +97 cc f4 ec 49 18 9f b8 bf 31 8b e6 d5 a0 71 5d\ +51 6b 49 af 19 12 58 cd 32 dc 83 3c e6 eb 46 73\ +c0 3a 19 bb ac e8 8c c5 48 95 f6 36 cc 0c 1e c8\ +90 96 d1 1c e2 35 a2 65 ca 17 64 23 2a 68 9a e8 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 9.3 +Plaintext: \ +fd 32 64 29 df 9b 89 0e 09 b5 4b 18 b8 f3 4f 1e\ +24 +Seed: # not used yet\ +e8 9b b0 32 c6 ce 62 2c bd b5 3b c9 46 60 14 ea\ +77 f7 77 c0 +Ciphertext: \ +81 eb dd 95 05 4b 0c 82 2e f9 ad 76 93 f5 a8 7a\ +df b4 b4 c4 ce 70 df 2d f8 4e d4 9c 04 da 58 ba\ +5f c2 0a 19 e1 a6 e8 b7 a3 90 0b 22 79 6d c4 e8\ +69 ee 6b 42 79 2d 15 a8 ec eb 56 c0 9c 69 91 4e\ +81 3c ea 8f 69 31 e4 b8 ed 6f 42 1a f2 98 d5 95\ +c9 7f 47 89 c7 ca a6 12 c7 ef 36 09 84 c2 1b 93\ +ed c5 40 10 68 b5 af 4c 78 a8 77 1b 98 4d 53 b8\ +ea 8a df 2f 6a 7d 4a 0b a7 6c 75 e1 dd 9f 65 8f\ +20 de d4 a4 60 71 d4 6d 77 91 b5 68 03 d8 fe a7\ +f0 b0 f8 e4 1a e3 f0 93 83 a6 f9 58 5f e7 75 3e\ +aa ff d2 bf 94 56 31 08 be ec c2 07 bb b5 35 f5\ +fc c7 05 f0 dd e9 f7 08 c6 2f 49 a9 c9 03 71 d3 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 9.4 +Plaintext: \ +f1 45 9b 5f 0c 92 f0 1a 0f 72 3a 2e 56 62 48 4d\ +8f 8c 0a 20 fc 29 da d6 ac d4 3b b5 f3 ef fd f4\ +e1 b6 3e 07 fd fe 66 28 d0 d7 4c a1 9b f2 d6 9e\ +4a 0a bf 86 d2 93 92 5a 79 67 72 f8 08 8e +Seed: # not used yet\ +60 6f 3b 99 c0 b9 cc d7 71 ea a2 9e a0 e4 c8 84\ +f3 18 9c cc +Ciphertext: \ +bc c3 5f 94 cd e6 6c b1 13 66 25 d6 25 b9 44 32\ +a3 5b 22 f3 d2 fa 11 a6 13 ff 0f ca 5b d5 7f 87\ +b9 02 cc dc 1c d0 ae bc b0 71 5e e8 69 d1 d1 fe\ +39 5f 67 93 00 3f 5e ca 46 50 59 c8 86 60 d4 46\ +ff 5f 08 18 55 20 22 55 7e 38 c0 8a 67 ea d9 91\ +26 22 54 f1 06 82 97 5e c5 63 97 76 85 37 f4 97\ +7a f6 d5 f6 aa ce b7 fb 25 de c5 93 72 30 23 1f\ +d8 97 8a f4 91 19 a2 9f 29 e4 24 ab 82 72 b4 75\ +62 79 2d 5c 94 f7 74 b8 82 9d 0b 0d 9f 1a 8c 9e\ +dd f3 75 74 d5 fa 24 8e ef a9 c5 27 1f c5 ec 25\ +79 c8 1b dd 61 b4 10 fa 61 fe 36 e4 24 22 1c 11\ +3a dd b2 75 66 4c 80 1d 34 ca 8c 63 51 e4 a8 58 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 9.5 +Plaintext: \ +53 e6 e8 c7 29 d6 f9 c3 19 dd 31 7e 74 b0 db 8e\ +4c cc a2 5f 3c 83 05 74 6e 13 7a c6 3a 63 ef 37\ +39 e7 b5 95 ab b9 6e 8d 55 e5 4f 7b d4 1a b4 33\ +37 8f fb 91 1d +Seed: # not used yet\ +fc bc 42 14 02 e9 ec ab c6 08 2a fa 40 ba 5f 26\ +52 2c 84 0e +Ciphertext: \ +23 2a fb c9 27 fa 08 c2 f6 a2 7b 87 d4 a5 cb 09\ +c0 7d c2 6f ae 73 d7 3a 90 55 88 39 f4 fd 66 d2\ +81 b8 7e c7 34 bc e2 37 ba 16 66 98 ed 82 91 06\ +a7 de 69 42 cd 6c dc e7 8f ed 8d 2e 4d 81 42 8e\ +66 49 0d 03 62 64 ce f9 2a f9 41 d3 e3 50 55 fe\ +39 81 e1 4d 29 cb b9 a4 f6 74 73 06 3b ae c7 9a\ +11 79 f5 a1 7c 9c 18 32 f2 83 8f d7 d5 e5 9b b9\ +65 9d 56 dc e8 a0 19 ed ef 1b b3 ac cc 69 7c c6\ +cc 7a 77 8f 60 a0 64 c7 f6 f5 d5 29 c6 21 02 62\ +e0 03 de 58 3e 81 e3 16 7b 89 97 1f b8 c0 e1 5d\ +44 ff fe f8 9b 53 d8 d6 4d d7 97 d1 59 b5 6d 2b\ +08 ea 53 07 ea 12 c2 41 bd 58 d4 ee 27 8a 1f 2e +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 9.6 +Plaintext: \ +b6 b2 8e a2 19 8d 0c 10 08 bc 64 +Seed: # not used yet\ +23 aa de 0e 1e 08 bb 9b 9a 78 d2 30 2a 52 f9 c2\ +1b 2e 1b a2 +Ciphertext: \ +43 8c c7 dc 08 a6 8d a2 49 e4 25 05 f8 57 3b a6\ +0e 2c 27 73 d5 b2 90 f4 cf 9d ff 71 8e 84 20 81\ +c3 83 e6 70 24 a0 f2 95 94 ea 98 7b 9d 25 e4 b7\ +38 f2 85 97 0d 19 5a bb 3a 8c 80 54 e3 d7 9d 6b\ +9c 9a 83 27 ba 59 6f 12 59 e2 71 26 67 47 66 90\ +7d 8d 58 2f f3 a8 47 61 54 92 9a db 1e 6d 12 35\ +b2 cc b4 ec 8f 66 3b a9 cc 67 0a 92 be bd 85 3c\ +8d bf 69 c6 43 6d 01 6f 61 ad d8 36 e9 47 32 45\ +04 34 20 7f 9f d4 c4 3d ec 2a 12 a9 58 ef a0 1e\ +fe 26 69 89 9b 5e 60 4c 25 5c 55 fb 71 66 de 55\ +89 e3 69 59 7b b0 91 68 c0 6d d5 db 17 7e 06 a1\ +74 0e b2 d5 c8 2f ae ca 6d 92 fc ee 99 31 ba 9f +Test: DecryptMatch + +AlgorithmType: AsymmetricCipher +Name: RSA/OAEP-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 10: A 2048-bit RSA Key Pair +Modulus: \ +ae 45 ed 56 01 ce c6 b8 cc 05 f8 03 93 5c 67 4d\ +db e0 d7 5c 4c 09 fd 79 51 fc 6b 0c ae c3 13 a8\ +df 39 97 0c 51 8b ff ba 5e d6 8f 3f 0d 7f 22 a4\ +02 9d 41 3f 1a e0 7e 4e be 9e 41 77 ce 23 e7 f5\ +40 4b 56 9e 4e e1 bd cf 3c 1f b0 3e f1 13 80 2d\ +4f 85 5e b9 b5 13 4b 5a 7c 80 85 ad ca e6 fa 2f\ +a1 41 7e c3 76 3b e1 71 b0 c6 2b 76 0e de 23 c1\ +2a d9 2b 98 08 84 c6 41 f5 a8 fa c2 6b da d4 a0\ +33 81 a2 2f e1 b7 54 88 50 94 c8 25 06 d4 01 9a\ +53 5a 28 6a fe b2 71 bb 9b a5 92 de 18 dc f6 00\ +c2 ae ea e5 6e 02 f7 cf 79 fc 14 cf 3b dc 7c d8\ +4f eb bb f9 50 ca 90 30 4b 22 19 a7 aa 06 3a ef\ +a2 c3 c1 98 0e 56 0c d6 4a fe 77 95 85 b6 10 76\ +57 b9 57 85 7e fd e6 01 09 88 ab 7d e4 17 fc 88\ +d8 f3 84 c4 e6 e7 2c 3f 94 3e 0c 31 c0 c4 a5 cc\ +36 f8 79 d8 a3 ac 9d 7d 59 86 0e aa da 6b 83 bb +PublicExponent: \ +01 00 01 +PrivateExponent: \ +05 6b 04 21 6f e5 f3 54 ac 77 25 0a 4b 6b 0c 85\ +25 a8 5c 59 b0 bd 80 c5 64 50 a2 2d 5f 43 8e 59\ +6a 33 3a a8 75 e2 91 dd 43 f4 8c b8 8b 9d 5f c0\ +d4 99 f9 fc d1 c3 97 f9 af c0 70 cd 9e 39 8c 8d\ +19 e6 1d b7 c7 41 0a 6b 26 75 df bf 5d 34 5b 80\ +4d 20 1a dd 50 2d 5c e2 df cb 09 1c e9 99 7b be\ +be 57 30 6f 38 3e 4d 58 81 03 f0 36 f7 e8 5d 19\ +34 d1 52 a3 23 e4 a8 db 45 1d 6f 4a 5b 1b 0f 10\ +2c c1 50 e0 2f ee e2 b8 8d ea 4a d4 c1 ba cc b2\ +4d 84 07 2d 14 e1 d2 4a 67 71 f7 40 8e e3 05 64\ +fb 86 d4 39 3a 34 bc f0 b7 88 50 1d 19 33 03 f1\ +3a 22 84 b0 01 f0 f6 49 ea f7 93 28 d4 ac 5c 43\ +0a b4 41 49 20 a9 46 0e d1 b7 bc 40 ec 65 3e 87\ +6d 09 ab c5 09 ae 45 b5 25 19 01 16 a0 c2 61 01\ +84 82 98 50 9c 1c 3b f3 a4 83 e7 27 40 54 e1 5e\ +97 07 50 36 e9 89 f6 09 32 80 7b 52 57 75 1e 79 +Prime1: \ +ec f5 ae cd 1e 55 15 ff fa cb d7 5a 28 16 c6 eb\ +f4 90 18 cd fb 46 38 e1 85 d6 6a 73 96 b6 f8 09\ +0f 80 18 c7 fd 95 cc 34 b8 57 dc 17 f0 cc 65 16\ +bb 13 46 ab 4d 58 2c ad ad 7b 41 03 35 23 87 b7\ +03 38 d0 84 04 7c 9d 95 39 b6 49 62 04 b3 dd 6e\ +a4 42 49 92 07 be c0 1f 96 42 87 ff 63 36 c3 98\ +46 58 33 68 46 f5 6e 46 86 18 81 c1 02 33 d2 17\ +6b f1 5a 5e 96 dd c7 80 bc 86 8a a7 7d 3c e7 69 +Prime2: \ +bc 46 c4 64 fc 6a c4 ca 78 3b 0e b0 8a 3c 84 1b\ +77 2f 7e 9b 2f 28 ba bd 58 8a e8 85 e1 a0 c6 1e\ +48 58 a0 fb 25 ac 29 99 90 f3 5b e8 51 64 c2 59\ +ba 11 75 cd d7 19 27 07 13 51 84 99 2b 6c 29 b7\ +46 dd 0d 2c ab e1 42 83 5f 7d 14 8c c1 61 52 4b\ +4a 09 94 6d 48 b8 28 47 3f 1c e7 6b 6c b6 88 6c\ +34 5c 03 e0 5f 41 d5 1b 5c 3a 90 a3 f2 40 73 c7\ +d7 4a 4f e2 5d 9c f2 1c 75 96 0f 3f c3 86 31 83 +ModPrime1PrivateExponent: \ +c7 35 64 57 1d 00 fb 15 d0 8a 3d e9 95 7a 50 91\ +5d 71 26 e9 44 2d ac f4 2b c8 2e 86 2e 56 73 ff\ +6a 00 8e d4 d2 e3 74 61 7d f8 9f 17 a1 60 b4 3b\ +7f da 9c b6 b6 b7 42 18 60 98 15 f7 d4 5c a2 63\ +c1 59 aa 32 d2 72 d1 27 fa f4 bc 8c a2 d7 73 78\ +e8 ae b1 9b 0a d7 da 3c b3 de 0a e7 31 49 80 f6\ +2b 6d 4b 0a 87 5d 1d f0 3c 1b ae 39 cc d8 33 ef\ +6c d7 e2 d9 52 8b f0 84 d1 f9 69 e7 94 e9 f6 c1 +ModPrime2PrivateExponent: \ +26 58 b3 7f 6d f9 c1 03 0b e1 db 68 11 7f a9 d8\ +7e 39 ea 2b 69 3b 7e 6d 3a 2f 70 94 74 13 ee c6\ +14 2e 18 fb 8d fc b6 ac 54 5d 7c 86 a0 ad 48 f8\ +45 71 70 f0 ef b2 6b c4 81 26 c5 3e fd 1d 16 92\ +01 98 dc 2a 11 07 dc 28 2d b6 a8 0c d3 06 23 60\ +ba 3f a1 3f 70 e4 31 2f f1 a6 cd 6b 8f c4 cd 9c\ +5c 3d b1 7c 6d 6a 57 21 2f 73 ae 29 f6 19 32 7b\ +ad 59 b1 53 85 85 85 ba 4e 28 b6 0a 62 a4 5e 49 +MultiplicativeInverseOfPrime2ModPrime1: \ +6f 38 52 6b 39 25 08 55 34 ef 3e 41 5a 83 6e de\ +8b 86 15 8a 2c 7c bf ec cb 0b d8 34 30 4f ec 68\ +3b a8 d4 f4 79 c4 33 d4 34 16 e6 32 69 62 3c ea\ +10 07 76 d8 5a ff 40 1d 3f ff 61 0e e6 54 11 ce\ +3b 13 63 d6 3a 97 09 ee de 42 64 7c ea 56 14 93\ +d5 45 70 a8 79 c1 86 82 cd 97 71 0b 96 20 5e c3\ +11 17 d7 3b 5f 36 22 3f ad d6 e8 ba 90 dd 7c 0e\ +e6 1d 44 e1 63 25 1e 20 c7 f6 6e b3 05 11 7c b8 +Test: KeyPairValidAndConsistent +Comment: RSAES-OAEP Encryption Example 10.1 +Plaintext: \ +8b ba 6b f8 2a 6c 0f 86 d5 f1 75 6e 97 95 68 70\ +b0 89 53 b0 6b 4e b2 05 bc 16 94 ee +Seed: # not used yet\ +47 e1 ab 71 19 fe e5 6c 95 ee 5e aa d8 6f 40 d0\ +aa 63 bd 33 +Ciphertext: \ +53 ea 5d c0 8c d2 60 fb 3b 85 85 67 28 7f a9 15\ +52 c3 0b 2f eb fb a2 13 f0 ae 87 70 2d 06 8d 19\ +ba b0 7f e5 74 52 3d fb 42 13 9d 68 c3 c5 af ee\ +e0 bf e4 cb 79 69 cb f3 82 b8 04 d6 e6 13 96 14\ +4e 2d 0e 60 74 1f 89 93 c3 01 4b 58 b9 b1 95 7a\ +8b ab cd 23 af 85 4f 4c 35 6f b1 66 2a a7 2b fc\ +c7 e5 86 55 9d c4 28 0d 16 0c 12 67 85 a7 23 eb\ +ee be ff 71 f1 15 94 44 0a ae f8 7d 10 79 3a 87\ +74 a2 39 d4 a0 4c 87 fe 14 67 b9 da f8 52 08 ec\ +6c 72 55 79 4a 96 cc 29 14 2f 9a 8b d4 18 e3 c1\ +fd 67 34 4b 0c d0 82 9d f3 b2 be c6 02 53 19 62\ +93 c6 b3 4d 3f 75 d3 2f 21 3d d4 5c 62 73 d5 05\ +ad f4 cc ed 10 57 cb 75 8f c2 6a ee fa 44 12 55\ +ed 4e 64 c1 99 ee 07 5e 7f 16 64 61 82 fd b4 64\ +73 9b 68 ab 5d af f0 e6 3e 95 52 01 68 24 f0 54\ +bf 4d 3c 8c 90 a9 7b b6 b6 55 32 84 eb 42 9f cc +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 10.2 +Plaintext: \ +e6 ad 18 1f 05 3b 58 a9 04 f2 45 75 10 37 3e 57 +Seed: # not used yet\ +6d 17 f5 b4 c1 ff ac 35 1d 19 5b f7 b0 9d 09 f0\ +9a 40 79 cf +Ciphertext: \ +a2 b1 a4 30 a9 d6 57 e2 fa 1c 2b b5 ed 43 ff b2\ +5c 05 a3 08 fe 90 93 c0 10 31 79 5f 58 74 40 01\ +10 82 8a e5 8f b9 b5 81 ce 9d dd d3 e5 49 ae 04\ +a0 98 54 59 bd e6 c6 26 59 4e 7b 05 dc 42 78 b2\ +a1 46 5c 13 68 40 88 23 c8 5e 96 dc 66 c3 a3 09\ +83 c6 39 66 4f c4 56 9a 37 fe 21 e5 a1 95 b5 77\ +6e ed 2d f8 d8 d3 61 af 68 6e 75 02 29 bb d6 63\ +f1 61 86 8a 50 61 5e 0c 33 7b ec 0c a3 5f ec 0b\ +b1 9c 36 eb 2e 0b bc c0 58 2f a1 d9 3a ac db 06\ +10 63 f5 9f 2c e1 ee 43 60 5e 5d 89 ec a1 83 d2\ +ac df e9 f8 10 11 02 2a d3 b4 3a 3d d4 17 da c9\ +4b 4e 11 ea 81 b1 92 96 6e 96 6b 18 20 82 e7 19\ +64 60 7b 4f 80 02 f3 62 99 84 4a 11 f2 ae 0f ae\ +ac 2e ae 70 f8 f4 f9 80 88 ac dc d0 ac 55 6e 9f\ +cc c5 11 52 19 08 fa d2 6f 04 c6 42 01 45 03 05\ +77 87 58 b0 53 8b f8 b5 bb 14 4a 82 8e 62 97 95 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 10.3 +Plaintext: \ +51 0a 2c f6 0e 86 6f a2 34 05 53 c9 4e a3 9f bc\ +25 63 11 e8 3e 94 45 4b 41 24 +Seed: # not used yet\ +38 53 87 51 4d ec cc 7c 74 0d d8 cd f9 da ee 49\ +a1 cb fd 54 +Ciphertext: \ +98 86 c3 e6 76 4a 8b 9a 84 e8 41 48 eb d8 c3 b1\ +aa 80 50 38 1a 78 f6 68 71 4c 16 d9 cf d2 a6 ed\ +c5 69 79 c5 35 d9 de e3 b4 4b 85 c1 8b e8 92 89\ +92 37 17 11 47 22 16 d9 5d da 98 d2 ee 83 47 c9\ +b1 4d ff df f8 4a a4 8d 25 ac 06 f7 d7 e6 53 98\ +ac 96 7b 1c e9 09 25 f6 7d ce 04 9b 7f 81 2d b0\ +74 29 97 a7 4d 44 fe 81 db e0 e7 a3 fe af 2e 5c\ +40 af 88 8d 55 0d db be 3b c2 06 57 a2 95 43 f8\ +fc 29 13 b9 bd 1a 61 b2 ab 22 56 ec 40 9b bd 7d\ +c0 d1 77 17 ea 25 c4 3f 42 ed 27 df 87 38 bf 4a\ +fc 67 66 ff 7a ff 08 59 55 5e e2 83 92 0f 4c 8a\ +63 c4 a7 34 0c ba fd dc 33 9e cd b4 b0 51 50 02\ +f9 6c 93 2b 5b 79 16 7a f6 99 c0 ad 3f cc fd f0\ +f4 4e 85 a7 02 62 bf 2e 18 fe 34 b8 50 58 99 75\ +e8 67 ff 96 9d 48 ea bf 21 22 71 54 6c dc 05 a6\ +9e cb 52 6e 52 87 0c 83 6f 30 7b d7 98 78 0e de +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 10.4 +Plaintext: \ +bc dd 19 0d a3 b7 d3 00 df 9a 06 e2 2c aa e2 a7\ +5f 10 c9 1f f6 67 b7 c1 6b de 8b 53 06 4a 26 49\ +a9 40 45 c9 +Seed: # not used yet\ +5c ac a6 a0 f7 64 16 1a 96 84 f8 5d 92 b6 e0 ef\ +37 ca 8b 65 +Ciphertext: \ +63 18 e9 fb 5c 0d 05 e5 30 7e 16 83 43 6e 90 32\ +93 ac 46 42 35 8a aa 22 3d 71 63 01 3a ba 87 e2\ +df da 8e 60 c6 86 0e 29 a1 e9 26 86 16 3e a0 b9\ +17 5f 32 9c a3 b1 31 a1 ed d3 a7 77 59 a8 b9 7b\ +ad 6a 4f 8f 43 96 f2 8c f6 f3 9c a5 81 12 e4 81\ +60 d6 e2 03 da a5 85 6f 3a ca 5f fe d5 77 af 49\ +94 08 e3 df d2 33 e3 e6 04 db e3 4a 9c 4c 90 82\ +de 65 52 7c ac 63 31 d2 9d c8 0e 05 08 a0 fa 71\ +22 e7 f3 29 f6 cc a5 cf a3 4d 4d 1d a4 17 80 54\ +57 e0 08 be c5 49 e4 78 ff 9e 12 a7 63 c4 77 d1\ +5b bb 78 f5 b6 9b d5 78 30 fc 2c 4e d6 86 d7 9b\ +c7 2a 95 d8 5f 88 13 4c 6b 0a fe 56 a8 cc fb c8\ +55 82 8b b3 39 bd 17 90 9c f1 d7 0d e3 33 5a e0\ +70 39 09 3e 60 6d 65 53 65 de 65 50 b8 72 cd 6d\ +e1 d4 40 ee 03 1b 61 94 5f 62 9a d8 a3 53 b0 d4\ +09 39 e9 6a 3c 45 0d 2a 8d 5e ee 9f 67 80 93 c8 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 10.5 +Plaintext: \ +a7 dd 6c 7d c2 4b 46 f9 dd 5f 1e 91 ad a4 c3 b3\ +df 94 7e 87 72 32 a9 +Seed: # not used yet\ +95 bc a9 e3 85 98 94 b3 dd 86 9f a7 ec d5 bb c6\ +40 1b f3 e4 +Ciphertext: \ +75 29 08 72 cc fd 4a 45 05 66 0d 65 1f 56 da 6d\ +aa 09 ca 13 01 d8 90 63 2f 6a 99 2f 3d 56 5c ee\ +46 4a fd ed 40 ed 3b 5b e9 35 67 14 ea 5a a7 65\ +5f 4a 13 66 c2 f1 7c 72 8f 6f 2c 5a 5d 1f 8e 28\ +42 9b c4 e6 f8 f2 cf f8 da 8d c0 e0 a9 80 8e 45\ +fd 09 ea 2f a4 0c b2 b6 ce 6f ff f5 c0 e1 59 d1\ +1b 68 d9 0a 85 f7 b8 4e 10 3b 09 e6 82 66 64 80\ +c6 57 50 5c 09 29 25 94 68 a3 14 78 6d 74 ea b1\ +31 57 3c f2 34 bf 57 db 7d 9e 66 cc 67 48 19 2e\ +00 2d c0 de ea 93 05 85 f0 83 1f dc d9 bc 33 d5\ +1f 79 ed 2f fc 16 bc f4 d5 98 12 fc eb ca a3 f9\ +06 9b 0e 44 56 86 d6 44 c2 5c cf 63 b4 56 ee 5f\ +a6 ff e9 6f 19 cd f7 51 fe d9 ea f3 59 57 75 4d\ +bf 4b fe a5 21 6a a1 84 4d c5 07 cb 2d 08 0e 72\ +2e ba 15 03 08 c2 b5 ff 11 93 62 0f 17 66 ec f4\ +48 1b af b9 43 bd 29 28 77 f2 13 6c a4 94 ab a0 +Test: DecryptMatch +Comment: RSAES-OAEP Encryption Example 10.6 +Plaintext: \ +ea f1 a7 3a 1b 0c 46 09 53 7d e6 9c d9 22 8b bc\ +fb 9a 8c a8 c6 c3 ef af 05 6f e4 a7 f4 63 4e d0\ +0b 7c 39 ec 69 22 d7 b8 ea 2c 04 eb ac +Seed: # not used yet\ +9f 47 dd f4 2e 97 ee a8 56 a9 bd bc 71 4e b3 ac\ +22 f6 eb 32 +Ciphertext: \ +2d 20 7a 73 43 2a 8f b4 c0 30 51 b3 f7 3b 28 a6\ +17 64 09 8d fa 34 c4 7a 20 99 5f 81 15 aa 68 16\ +67 9b 55 7e 82 db ee 58 49 08 c6 e6 97 82 d7 de\ +b3 4d bd 65 af 06 3d 57 fc a7 6a 5f d0 69 49 2f\ +d6 06 8d 99 84 d2 09 35 05 65 a6 2e 5c 77 f2 30\ +38 c1 2c b1 0c 66 34 70 9b 54 7c 46 f6 b4 a7 09\ +bd 85 ca 12 2d 74 46 5e f9 77 62 c2 97 63 e0 6d\ +bc 7a 9e 73 8c 78 bf ca 01 02 dc 5e 79 d6 5b 97\ +3f 28 24 0c aa b2 e1 61 a7 8b 57 d2 62 45 7e d8\ +19 5d 53 e3 c7 ae 9d a0 21 88 3c 6d b7 c2 4a fd\ +d2 32 2e ac 97 2a d3 c3 54 c5 fc ef 1e 14 6c 3a\ +02 90 fb 67 ad f0 07 06 6e 00 42 8d 2c ec 18 ce\ +58 f9 32 86 98 de fe f4 b2 eb 5e c7 69 18 fd e1\ +c1 98 cb b3 8b 7a fc 67 62 6a 9a ef ec 43 22 bf\ +d9 0d 25 63 48 1c 9a 22 1f 78 c8 27 2c 82 d1 b6\ +2a b9 14 e1 c6 9f 6a f6 ef 30 ca 52 60 db 4a 46 +Test: DecryptMatch diff --git a/external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt b/external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt new file mode 100644 index 000000000..2272b7c46 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt @@ -0,0 +1,89 @@ +AlgorithmType: Signature +Name: RSA/PKCS1-1.5(MD2) +KeyFormat: DER +Source: http://www.rsasecurity.com/rsalabs/pkcs/index.html, \ + Some Examples of the PKCS Standards +PrivateKey: \ + 30 82 01 50\ + 02 01 00 #version = 0\ + 30 0d #privateKeyAlgorithmIdentifier\ + 06 09 #algorithm = rsaEncryption\ + 2a 86 48 86 f7 0d 01 01 01\ + 05 00 #parameters = NULL\ + 04 82 01 3a #privateKey = RSAPrivateKey encoding\ + 30 82 01 36\ + 02 01 00 #version = 0\ + 02 40 #modulus = n\ + 0a 66 79 1d c6 98 81 68 de 7a b7 74 19 bb 7f b0\ + c0 01 c6 27 10 27 00 75 14 29 42 e1 9a 8d 8c 51\ + d0 53 b3 e3 78 2a 1d e5 dc 5a f4 eb e9 94 68 17\ + 01 14 a1 df e6 7c dc 9a 9a f5 5d 65 56 20 bb ab\ + 02 03 01 00 01 #publicExponent = e\ + 02 40 #privateExponent = d\ + 01 23 c5 b6 1b a3 6e db 1d 36 79 90 41 99 a8 9e\ + a8 0c 09 b9 12 2e 14 00 c0 9a dc f7 78 46 76 d0\ + 1d 23 35 6a 7d 44 d6 bd 8b d5 0e 94 bf c7 23 fa\ + 87 d8 86 2b 75 17 76 91 c1 1d 75 76 92 df 88 81\ + 02 20 #prime1 = p\ + 33 d4 84 45 c8 59 e5 23 40 de 70 4b cd da 06 5f\ + bb 40 58 d7 40 bd 1d 67 d2 9e 9c 14 6c 11 cf 61\ + 02 20 #prime2 = q\ + 33 5e 84 08 86 6b 0f d3 8d c7 00 2d 3f 97 2c 67\ + 38 9a 65 d5 d8 30 65 66 d5 c4 f2 a5 aa 52 62 8b\ + 02 20 #exponent1 = d mod p-1\ + 04 5e c9 00 71 52 53 25 d3 d4 6d b7 96 95 e9 af\ + ac c4 52 39 64 36 0e 02 b1 19 ba a3 66 31 62 41\ + 02 20 #exponent2 = d mod q-1\ + 15 eb 32 73 60 c7 b6 0d 12 e5 e2 d1 6b dc d9 79\ + 81 d1 7f ba 6b 70 db 13 b2 0b 43 6e 24 ea da 59\ + 02 20 #coefficient = q-1 mod p\ + 2c a6 36 6d 72 78 1d fa 24 d3 4a 9a 24 cb c2 ae\ + 92 7a 99 58 af 42 65 63 ff 63 fb 11 65 8a 46 1d +PublicKey: \ + 30 5b #subjectPublicKeyInfo\ + 30 0d #algorithm\ + 06 09 #algorithm = rsaEncryption\ + 2a 86 48 86 f7 0d 01 01 01\ + 05 00 #parameters = NULL\ + 03 4a #subjectPublicKey = RSAPublicKey encoding\ + 00\ + 30 47\ + 02 40 #modulus = n\ + 0a 66 79 1d c6 98 81 68 de 7a b7 74 19 bb 7f b0\ + c0 01 c6 27 10 27 00 75 14 29 42 e1 9a 8d 8c 51\ + d0 53 b3 e3 78 2a 1d e5 dc 5a f4 eb e9 94 68 17\ + 01 14 a1 df e6 7c dc 9a 9a f5 5d 65 56 20 bb ab\ + 02 03 01 00 01 #publicExponent = e +Test: KeyPairValidAndConsistent +Message: # "Everyone gets Friday off."\ + 45 76 65 72 79 6f 6e 65 20 67 65 74 73 20 46 72 69 64 61 79 20 6f 66 66 2e +Signature: \ + 05fa6a812fc7df8bf4f2542509e03e84\ + 6e11b9c620be2009efb440efbcc66921\ + 6994ac04f341b57d05202d428fb2a27b\ + 5c77dfd9b15bfc3d559353503410c1e1 +Test: Verify +Name: RSA/PKCS1-1.5(SHA-1) +Source: generated by Wei Dai using Crypto++ 5.0 +Signature: 0610761F95FFD1B8F29DA34212947EC2AA0E358866A722F03CC3C41487ADC604A48FF54F5C6BEDB9FB7BD59F82D6E55D8F3174BA361B2214B2D74E8825E04E81 +Test: Verify +Message: 00 +Test: NotVerify + +AlgorithmType: Signature +Name: RSA/PKCS1-1.5(SHA-1) +Source: http://islab.oregonstate.edu/emails/pkcs-tng-02/0152 +KeyFormat: Component +Modulus: A885B6F851A8079AB8A281DB0297148511EE0D8C07C0D4AE6D6FED461488E0D41E3FF8F281B06A3240B5007A5C2AB4FB6BE8AF88F119DB998368DDDC9710ABED +PublicExponent: 010001 +PrivateExponent: 2B259D2CA3DF851EE891F6F4678BDDFD9A131C95D3305C63D2723B4A5B9C960F5EC8BB7DCDDBEBD8B6A38767D64AD451E9383E0891E4EE7506100481F2B49323 +Prime1: D7103CD676E39824E2BE50B8E6533FE7CB7484348E283802AD2B8D00C80D19DF +Prime2: C89996DC169CEB3F227958275968804D4BE9FC4012C3219662F1A438C9950BB3 +ModPrime1PrivateExponent: 5D8EA4C8AF83A70634D5920C3DB66D908AC3AF57A597FD75BC9BBB856181C185 +ModPrime2PrivateExponent: C598E54DAEC8ABC1E907769A6C2BD01653ED0C9960E1EDB7E186FDA922883A99 +MultiplicativeInverseOfPrime2ModPrime1: 7C6F27B5B51B78AD80FB36E700990CF307866F2943124CBD93D97C137794C104 +Test: KeyPairValidAndConsistent +Source: generated by Wei Dai using Crypto++ 5.0 +Message: 74657374 # "test" +Signature: A7E00CE4391F914D82158D9B732759808E25A1C6383FE87A5199157650D4296CF612E9FF809E686A0AF328238306E79965F6D0138138829D9A1A22764306F6CE +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/rsa_pss.txt b/external/crypto++-5.6.3/TestVectors/rsa_pss.txt new file mode 100644 index 000000000..1b5fc9c82 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/rsa_pss.txt @@ -0,0 +1,2083 @@ +AlgorithmType: Signature +Name: RSA/PSS-MGF1(SHA-1) +Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors +KeyFormat: Component +Comment: Example 1: A 1024-bit RSA Key Pair +Modulus: \ +a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1\ +56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91\ +d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3\ +94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df\ +d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77\ +c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1\ +05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4\ +ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +33 a5 04 2a 90 b2 7d 4f 54 51 ca 9b bb d0 b4 47\ +71 a1 01 af 88 43 40 ae f9 88 5f 2a 4b be 92 e8\ +94 a7 24 ac 3c 56 8c 8f 97 85 3a d0 7c 02 66 c8\ +c6 a3 ca 09 29 f1 e8 f1 12 31 88 44 29 fc 4d 9a\ +e5 5f ee 89 6a 10 ce 70 7c 3e d7 e7 34 e4 47 27\ +a3 95 74 50 1a 53 26 83 10 9c 2a ba ca ba 28 3c\ +31 b4 bd 2f 53 c3 ee 37 e3 52 ce e3 4f 9e 50 3b\ +d8 0c 06 22 ad 79 c6 dc ee 88 35 47 c6 a3 b3 25 +Prime1: \ +e7 e8 94 27 20 a8 77 51 72 73 a3 56 05 3e a2 a1\ +bc 0c 94 aa 72 d5 5c 6e 86 29 6b 2d fc 96 79 48\ +c0 a7 2c bc cc a7 ea cb 35 70 6e 09 a1 df 55 a1\ +53 5b d9 b3 cc 34 16 0b 3b 6d cd 3e da 8e 64 43 +Prime2: \ +b6 9d ca 1c f7 d4 d7 ec 81 e7 5b 90 fc ca 87 4a\ +bc de 12 3f d2 70 01 80 aa 90 47 9b 6e 48 de 8d\ +67 ed 24 f9 f1 9d 85 ba 27 58 74 f5 42 cd 20 dc\ +72 3e 69 63 36 4a 1f 94 25 45 2b 26 9a 67 99 fd +ModPrime1PrivateExponent: \ +28 fa 13 93 86 55 be 1f 8a 15 9c ba ca 5a 72 ea\ +19 0c 30 08 9e 19 cd 27 4a 55 6f 36 c4 f6 e1 9f\ +55 4b 34 c0 77 79 04 27 bb dd 8d d3 ed e2 44 83\ +28 f3 85 d8 1b 30 e8 e4 3b 2f ff a0 27 86 19 79 +ModPrime2PrivateExponent: \ +1a 8b 38 f3 98 fa 71 20 49 89 8d 7f b7 9e e0 a7\ +76 68 79 12 99 cd fa 09 ef c0 e5 07 ac b2 1e d7\ +43 01 ef 5b fd 48 be 45 5e ae b6 e1 67 82 55 82\ +75 80 a8 e4 e8 e1 41 51 d1 51 0a 82 a3 f2 e7 29 +MultiplicativeInverseOfPrime2ModPrime1: \ +27 15 6a ba 41 26 d2 4a 81 f3 a5 28 cb fb 27 f5\ +68 86 f8 40 a9 f6 e8 6e 17 a4 4b 94 fe 93 19 58\ +4b 8e 22 fd de 1e 5a 2e 3b d8 aa 5b a8 d8 58 41\ +94 eb 21 90 ac f8 32 b8 47 f1 3a 3d 24 a7 9f 4d +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 1.1 +Message: \ +cd c8 7d a2 23 d7 86 df 3b 45 e0 bb bc 72 13 26\ +d1 ee 2a f8 06 cc 31 54 75 cc 6f 0d 9c 66 e1 b6\ +23 71 d4 5c e2 39 2e 1a c9 28 44 c3 10 10 2f 15\ +6a 0d 8d 52 c1 f4 c4 0b a3 aa 65 09 57 86 cb 76\ +97 57 a6 56 3b a9 58 fe d0 bc c9 84 e8 b5 17 a3\ +d5 f5 15 b2 3b 8a 41 e7 4a a8 67 69 3f 90 df b0\ +61 a6 e8 6d fa ae e6 44 72 c0 0e 5f 20 94 57 29\ +cb eb e7 7f 06 ce 78 e0 8f 40 98 fb a4 1f 9d 61\ +93 c0 31 7e 8b 60 d4 b6 08 4a cb 42 d2 9e 38 08\ +a3 bc 37 2d 85 e3 31 17 0f cb f7 cc 72 d0 b7 1c\ +29 66 48 b3 a4 d1 0f 41 62 95 d0 80 7a a6 25 ca\ +b2 74 4f d9 ea 8f d2 23 c4 25 37 02 98 28 bd 16\ +be 02 54 6f 13 0f d2 e3 3b 93 6d 26 76 e0 8a ed\ +1b 73 31 8b 75 0a 01 67 d0 +Salt: \ +de e9 59 c7 e0 64 11 36 14 20 ff 80 18 5e d5 7f\ +3e 67 76 af +Signature: \ +90 74 30 8f b5 98 e9 70 1b 22 94 38 8e 52 f9 71\ +fa ac 2b 60 a5 14 5a f1 85 df 52 87 b5 ed 28 87\ +e5 7c e7 fd 44 dc 86 34 e4 07 c8 e0 e4 36 0b c2\ +26 f3 ec 22 7f 9d 9e 54 63 8e 8d 31 f5 05 12 15\ +df 6e bb 9c 2f 95 79 aa 77 59 8a 38 f9 14 b5 b9\ +c1 bd 83 c4 e2 f9 f3 82 a0 d0 aa 35 42 ff ee 65\ +98 4a 60 1b c6 9e b2 8d eb 27 dc a1 2c 82 c2 d4\ +c3 f6 6c d5 00 f1 ff 2b 99 4d 8a 4e 30 cb b3 3c +Test: Verify +Comment: RSASSA-PSS Signature Example 1.2 +Message: \ +85 13 84 cd fe 81 9c 22 ed 6c 4c cb 30 da eb 5c\ +f0 59 bc 8e 11 66 b7 e3 53 0c 4c 23 3e 2b 5f 8f\ +71 a1 cc a5 82 d4 3e cc 72 b1 bc a1 6d fc 70 13\ +22 6b 9e +Salt: \ +ef 28 69 fa 40 c3 46 cb 18 3d ab 3d 7b ff c9 8f\ +d5 6d f4 2d +Signature: \ +3e f7 f4 6e 83 1b f9 2b 32 27 41 42 a5 85 ff ce\ +fb dc a7 b3 2a e9 0d 10 fb 0f 0c 72 99 84 f0 4e\ +f2 9a 9d f0 78 07 75 ce 43 73 9b 97 83 83 90 db\ +0a 55 05 e6 3d e9 27 02 8d 9d 29 b2 19 ca 2c 45\ +17 83 25 58 a5 5d 69 4a 6d 25 b9 da b6 60 03 c4\ +cc cd 90 78 02 19 3b e5 17 0d 26 14 7d 37 b9 35\ +90 24 1b e5 1c 25 05 5f 47 ef 62 75 2c fb e2 14\ +18 fa fe 98 c2 2c 4d 4d 47 72 4f db 56 69 e8 43 +Test: Verify +Comment: RSASSA-PSS Signature Example 1.3 +Message: \ +a4 b1 59 94 17 61 c4 0c 6a 82 f2 b8 0d 1b 94 f5\ +aa 26 54 fd 17 e1 2d 58 88 64 67 9b 54 cd 04 ef\ +8b d0 30 12 be 8d c3 7f 4b 83 af 79 63 fa ff 0d\ +fa 22 54 77 43 7c 48 01 7f f2 be 81 91 cf 39 55\ +fc 07 35 6e ab 3f 32 2f 7f 62 0e 21 d2 54 e5 db\ +43 24 27 9f e0 67 e0 91 0e 2e 81 ca 2c ab 31 c7\ +45 e6 7a 54 05 8e b5 0d 99 3c db 9e d0 b4 d0 29\ +c0 6d 21 a9 4c a6 61 c3 ce 27 fa e1 d6 cb 20 f4\ +56 4d 66 ce 47 67 58 3d 0e 5f 06 02 15 b5 90 17\ +be 85 ea 84 89 39 12 7b d8 c9 c4 d4 7b 51 05 6c\ +03 1c f3 36 f1 7c 99 80 f3 b8 f5 b9 b6 87 8e 8b\ +79 7a a4 3b 88 26 84 33 3e 17 89 3f e9 ca a6 aa\ +29 9f 7e d1 a1 8e e2 c5 48 64 b7 b2 b9 9b 72 61\ +8f b0 25 74 d1 39 ef 50 f0 19 c9 ee f4 16 97 13\ +38 e7 d4 70 +Salt: \ +71 0b 9c 47 47 d8 00 d4 de 87 f1 2a fd ce 6d f1\ +81 07 cc 77 +Signature: \ +66 60 26 fb a7 1b d3 e7 cf 13 15 7c c2 c5 1a 8e\ +4a a6 84 af 97 78 f9 18 49 f3 43 35 d1 41 c0 01\ +54 c4 19 76 21 f9 62 4a 67 5b 5a bc 22 ee 7d 5b\ +aa ff aa e1 c9 ba ca 2c c3 73 b3 f3 3e 78 e6 14\ +3c 39 5a 91 aa 7f ac a6 64 eb 73 3a fd 14 d8 82\ +72 59 d9 9a 75 50 fa ca 50 1e f2 b0 4e 33 c2 3a\ +a5 1f 4b 9e 82 82 ef db 72 8c c0 ab 09 40 5a 91\ +60 7c 63 69 96 1b c8 27 0d 2d 4f 39 fc e6 12 b1 +Test: Verify +Comment: RSASSA-PSS Signature Example 1.4 +Message: \ +bc 65 67 47 fa 9e af b3 f0 +Salt: \ +05 6f 00 98 5d e1 4d 8e f5 ce a9 e8 2f 8c 27 be\ +f7 20 33 5e +Signature: \ +46 09 79 3b 23 e9 d0 93 62 dc 21 bb 47 da 0b 4f\ +3a 76 22 64 9a 47 d4 64 01 9b 9a ea fe 53 35 9c\ +17 8c 91 cd 58 ba 6b cb 78 be 03 46 a7 bc 63 7f\ +4b 87 3d 4b ab 38 ee 66 1f 19 96 34 c5 47 a1 ad\ +84 42 e0 3d a0 15 b1 36 e5 43 f7 ab 07 c0 c1 3e\ +42 25 b8 de 8c ce 25 d4 f6 eb 84 00 f8 1f 7e 18\ +33 b7 ee 6e 33 4d 37 09 64 ca 79 fd b8 72 b4 d7\ +52 23 b5 ee b0 81 01 59 1f b5 32 d1 55 a6 de 87 +Test: Verify +Comment: RSASSA-PSS Signature Example 1.5 +Message: \ +b4 55 81 54 7e 54 27 77 0c 76 8e 8b 82 b7 55 64\ +e0 ea 4e 9c 32 59 4d 6b ff 70 65 44 de 0a 87 76\ +c7 a8 0b 45 76 55 0e ee 1b 2a ca bc 7e 8b 7d 3e\ +f7 bb 5b 03 e4 62 c1 10 47 ea dd 00 62 9a e5 75\ +48 0a c1 47 0f e0 46 f1 3a 2b f5 af 17 92 1d c4\ +b0 aa 8b 02 be e6 33 49 11 65 1d 7f 85 25 d1 0f\ +32 b5 1d 33 be 52 0d 3d df 5a 70 99 55 a3 df e7\ +82 83 b9 e0 ab 54 04 6d 15 0c 17 7f 03 7f dc cc\ +5b e4 ea 5f 68 b5 e5 a3 8c 9d 7e dc cc c4 97 5f\ +45 5a 69 09 b4 +Salt: \ +80 e7 0f f8 6a 08 de 3e c6 09 72 b3 9b 4f bf dc\ +ea 67 ae 8e +Signature: \ +1d 2a ad 22 1c a4 d3 1d df 13 50 92 39 01 93 98\ +e3 d1 4b 32 dc 34 dc 5a f4 ae ae a3 c0 95 af 73\ +47 9c f0 a4 5e 56 29 63 5a 53 a0 18 37 76 15 b1\ +6c b9 b1 3b 3e 09 d6 71 eb 71 e3 87 b8 54 5c 59\ +60 da 5a 64 77 6e 76 8e 82 b2 c9 35 83 bf 10 4c\ +3f db 23 51 2b 7b 4e 89 f6 33 dd 00 63 a5 30 db\ +45 24 b0 1c 3f 38 4c 09 31 0e 31 5a 79 dc d3 d6\ +84 02 2a 7f 31 c8 65 a6 64 e3 16 97 8b 75 9f ad +Test: Verify +Comment: RSASSA-PSS Signature Example 1.6 +Message: \ +10 aa e9 a0 ab 0b 59 5d 08 41 20 7b 70 0d 48 d7\ +5f ae dd e3 b7 75 cd 6b 4c c8 8a e0 6e 46 94 ec\ +74 ba 18 f8 52 0d 4f 5e a6 9c bb e7 cc 2b eb a4\ +3e fd c1 02 15 ac 4e b3 2d c3 02 a1 f5 3d c6 c4\ +35 22 67 e7 93 6c fe bf 7c 8d 67 03 57 84 a3 90\ +9f a8 59 c7 b7 b5 9b 8e 39 c5 c2 34 9f 18 86 b7\ +05 a3 02 67 d4 02 f7 48 6a b4 f5 8c ad 5d 69 ad\ +b1 7a b8 cd 0c e1 ca f5 02 5a f4 ae 24 b1 fb 87\ +94 c6 07 0c c0 9a 51 e2 f9 91 13 11 e3 87 7d 00\ +44 c7 1c 57 a9 93 39 50 08 80 6b 72 3a c3 83 73\ +d3 95 48 18 18 52 8c 1e 70 53 73 92 82 05 35 29\ +51 0e 93 5c d0 fa 77 b8 fa 53 cc 2d 47 4b d4 fb\ +3c c5 c6 72 d6 ff dc 90 a0 0f 98 48 71 2c 4b cf\ +e4 6c 60 57 36 59 b1 1e 64 57 e8 61 f0 f6 04 b6\ +13 8d 14 4f 8c e4 e2 da 73 +Salt: \ +a8 ab 69 dd 80 1f 00 74 c2 a1 fc 60 64 98 36 c6\ +16 d9 96 81 +Signature: \ +2a 34 f6 12 5e 1f 6b 0b f9 71 e8 4f bd 41 c6 32\ +be 8f 2c 2a ce 7d e8 b6 92 6e 31 ff 93 e9 af 98\ +7f bc 06 e5 1e 9b e1 4f 51 98 f9 1f 3f 95 3b d6\ +7d a6 0a 9d f5 97 64 c3 dc 0f e0 8e 1c be f0 b7\ +5f 86 8d 10 ad 3f ba 74 9f ef 59 fb 6d ac 46 a0\ +d6 e5 04 36 93 31 58 6f 58 e4 62 8f 39 aa 27 89\ +82 54 3b c0 ee b5 37 dc 61 95 80 19 b3 94 fb 27\ +3f 21 58 58 a0 a0 1a c4 d6 50 b9 55 c6 7f 4c 58 +Test: Verify +Comment: Example 2: A 1025-bit RSA Key Pair +Modulus: \ +01 d4 0c 1b cf 97 a6 8a e7 cd bd 8a 7b f3 e3 4f\ +a1 9d cc a4 ef 75 a4 74 54 37 5f 94 51 4d 88 fe\ +d0 06 fb 82 9f 84 19 ff 87 d6 31 5d a6 8a 1f f3\ +a0 93 8e 9a bb 34 64 01 1c 30 3a d9 91 99 cf 0c\ +7c 7a 8b 47 7d ce 82 9e 88 44 f6 25 b1 15 e5 e9\ +c4 a5 9c f8 f8 11 3b 68 34 33 6a 2f d2 68 9b 47\ +2c bb 5e 5c ab e6 74 35 0c 59 b6 c1 7e 17 68 74\ +fb 42 f8 fc 3d 17 6a 01 7e dc 61 fd 32 6c 4b 33\ +c9 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +02 7d 14 7e 46 73 05 73 77 fd 1e a2 01 56 57 72\ +17 6a 7d c3 83 58 d3 76 04 56 85 a2 e7 87 c2 3c\ +15 57 6b c1 6b 9f 44 44 02 d6 bf c5 d9 8a 3e 88\ +ea 13 ef 67 c3 53 ec a0 c0 dd ba 92 55 bd 7b 8b\ +b5 0a 64 4a fd fd 1d d5 16 95 b2 52 d2 2e 73 18\ +d1 b6 68 7a 1c 10 ff 75 54 5f 3d b0 fe 60 2d 5f\ +2b 7f 29 4e 36 01 ea b7 b9 d1 ce cd 76 7f 64 69\ +2e 3e 53 6c a2 84 6c b0 c2 dd 48 6a 39 fa 75 b1 +Prime1: \ +01 66 01 e9 26 a0 f8 c9 e2 6e ca b7 69 ea 65 a5\ +e7 c5 2c c9 e0 80 ef 51 94 57 c6 44 da 68 91 c5\ +a1 04 d3 ea 79 55 92 9a 22 e7 c6 8a 7a f9 fc ad\ +77 7c 3c cc 2b 9e 3d 36 50 bc e4 04 39 9b 7e 59\ +d1 +Prime2: \ +01 4e af a1 d4 d0 18 4d a7 e3 1f 87 7d 12 81 dd\ +da 62 56 64 86 9e 83 79 e6 7a d3 b7 5e ae 74 a5\ +80 e9 82 7a bd 6e b7 a0 02 cb 54 11 f5 26 67 97\ +76 8f b8 e9 5a e4 0e 3e 8a 01 f3 5f f8 9e 56 c0\ +79 +ModPrime1PrivateExponent: \ +e2 47 cc e5 04 93 9b 8f 0a 36 09 0d e2 00 93 87\ +55 e2 44 4b 29 53 9a 7d a7 a9 02 f6 05 68 35 c0\ +db 7b 52 55 94 97 cf e2 c6 1a 80 86 d0 21 3c 47\ +2c 78 85 18 00 b1 71 f6 40 1d e2 e9 c2 75 6f 31 +ModPrime2PrivateExponent: \ +b1 2f ba 75 78 55 e5 86 e4 6f 64 c3 8a 70 c6 8b\ +3f 54 8d 93 d7 87 b3 99 99 9d 4c 8f 0b bd 25 81\ +c2 1e 19 ed 00 18 a6 d5 d3 df 86 42 4b 3a bc ad\ +40 19 9d 31 49 5b 61 30 9f 27 c1 bf 55 d4 87 c1 +MultiplicativeInverseOfPrime2ModPrime1: \ +56 4b 1e 1f a0 03 bd a9 1e 89 09 04 25 aa c0 5b\ +91 da 9e e2 50 61 e7 62 8d 5f 51 30 4a 84 99 2f\ +dc 33 76 2b d3 78 a5 9f 03 0a 33 4d 53 2b d0 da\ +e8 f2 98 ea 9e d8 44 63 6a d5 fb 8c bd c0 3c ad +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 2.1 +Message: \ +da ba 03 20 66 26 3f ae db 65 98 48 11 52 78 a5\ +2c 44 fa a3 a7 6f 37 51 5e d3 36 32 10 72 c4 0a\ +9d 9b 53 bc 05 01 40 78 ad f5 20 87 51 46 aa e7\ +0f f0 60 22 6d cb 7b 1f 1f c2 7e 93 60 +Salt: \ +57 bf 16 0b cb 02 bb 1d c7 28 0c f0 45 85 30 b7\ +d2 83 2f f7 +Signature: \ +01 4c 5b a5 33 83 28 cc c6 e7 a9 0b f1 c0 ab 3f\ +d6 06 ff 47 96 d3 c1 2e 4b 63 9e d9 13 6a 5f ec\ +6c 16 d8 88 4b dd 99 cf dc 52 14 56 b0 74 2b 73\ +68 68 cf 90 de 09 9a db 8d 5f fd 1d ef f3 9b a4\ +00 7a b7 46 ce fd b2 2d 7d f0 e2 25 f5 46 27 dc\ +65 46 61 31 72 1b 90 af 44 53 63 a8 35 8b 9f 60\ +76 42 f7 8f ab 0a b0 f4 3b 71 68 d6 4b ae 70 d8\ +82 78 48 d8 ef 1e 42 1c 57 54 dd f4 2c 25 89 b5\ +b3 +Test: Verify +Comment: RSASSA-PSS Signature Example 2.2 +Message: \ +e4 f8 60 1a 8a 6d a1 be 34 44 7c 09 59 c0 58 57\ +0c 36 68 cf d5 1d d5 f9 cc d6 ad 44 11 fe 82 13\ +48 6d 78 a6 c4 9f 93 ef c2 ca 22 88 ce bc 2b 9b\ +60 bd 04 b1 e2 20 d8 6e 3d 48 48 d7 09 d0 32 d1\ +e8 c6 a0 70 c6 af 9a 49 9f cf 95 35 4b 14 ba 61\ +27 c7 39 de 1b b0 fd 16 43 1e 46 93 8a ec 0c f8\ +ad 9e b7 2e 83 2a 70 35 de 9b 78 07 bd c0 ed 8b\ +68 eb 0f 5a c2 21 6b e4 0c e9 20 c0 db 0e dd d3\ +86 0e d7 88 ef ac ca ca 50 2d 8f 2b d6 d1 a7 c1\ +f4 1f f4 6f 16 81 c8 f1 f8 18 e9 c4 f6 d9 1a 0c\ +78 03 cc c6 3d 76 a6 54 4d 84 3e 08 4e 36 3b 8a\ +cc 55 aa 53 17 33 ed b5 de e5 b5 19 6e 9f 03 e8\ +b7 31 b3 77 64 28 d9 e4 57 fe 3f bc b3 db 72 74\ +44 2d 78 58 90 e9 cb 08 54 b6 44 4d ac e7 91 d7\ +27 3d e1 88 97 19 33 8a 77 fe +Salt: \ +7f 6d d3 59 e6 04 e6 08 70 e8 98 e4 7b 19 bf 2e\ +5a 7b 2a 90 +Signature: \ +01 09 91 65 6c ca 18 2b 7f 29 d2 db c0 07 e7 ae\ +0f ec 15 8e b6 75 9c b9 c4 5c 5f f8 7c 76 35 dd\ +46 d1 50 88 2f 4d e1 e9 ae 65 e7 f7 d9 01 8f 68\ +36 95 4a 47 c0 a8 1a 8a 6b 6f 83 f2 94 4d 60 81\ +b1 aa 7c 75 9b 25 4b 2c 34 b6 91 da 67 cc 02 26\ +e2 0b 2f 18 b4 22 12 76 1d cd 4b 90 8a 62 b3 71\ +b5 91 8c 57 42 af 4b 53 7e 29 69 17 67 4f b9 14\ +19 47 61 62 1c c1 9a 41 f6 fb 95 3f bc bb 64 9d\ +ea +Test: Verify +Comment: RSASSA-PSS Signature Example 2.3 +Message: \ +52 a1 d9 6c 8a c3 9e 41 e4 55 80 98 01 b9 27 a5\ +b4 45 c1 0d 90 2a 0d cd 38 50 d2 2a 66 d2 bb 07\ +03 e6 7d 58 67 11 45 95 aa bf 5a 7a eb 5a 8f 87\ +03 4b bb 30 e1 3c fd 48 17 a9 be 76 23 00 23 60\ +6d 02 86 a3 fa f8 a4 d2 2b 72 8e c5 18 07 9f 9e\ +64 52 6e 3a 0c c7 94 1a a3 38 c4 37 99 7c 68 0c\ +ca c6 7c 66 bf a1 +Salt: \ +fc a8 62 06 8b ce 22 46 72 4b 70 8a 05 19 da 17\ +e6 48 68 8c +Signature: \ +00 7f 00 30 01 8f 53 cd c7 1f 23 d0 36 59 fd e5\ +4d 42 41 f7 58 a7 50 b4 2f 18 5f 87 57 85 20 c3\ +07 42 af d8 43 59 b6 e6 e8 d3 ed 95 9d c6 fe 48\ +6b ed c8 e2 cf 00 1f 63 a7 ab e1 62 56 a1 b8 4d\ +f0 d2 49 fc 05 d3 19 4c e5 f0 91 27 42 db bf 80\ +dd 17 4f 6c 51 f6 ba d7 f1 6c f3 36 4e ba 09 5a\ +06 26 7d c3 79 38 03 ac 75 26 ae be 0a 47 5d 38\ +b8 c2 24 7a b5 1c 48 98 df 70 47 dc 6a df 52 c6\ +c4 +Test: Verify +Comment: RSASSA-PSS Signature Example 2.4 +Message: \ +a7 18 2c 83 ac 18 be 65 70 a1 06 aa 9d 5c 4e 3d\ +bb d4 af ae b0 c6 0c 4a 23 e1 96 9d 79 ff +Salt: \ +80 70 ef 2d e9 45 c0 23 87 68 4b a0 d3 30 96 73\ +22 35 d4 40 +Signature: \ +00 9c d2 f4 ed be 23 e1 23 46 ae 8c 76 dd 9a d3\ +23 0a 62 07 61 41 f1 6c 15 2b a1 85 13 a4 8e f6\ +f0 10 e0 e3 7f d3 df 10 a1 ec 62 9a 0c b5 a3 b5\ +d2 89 30 07 29 8c 30 93 6a 95 90 3b 6b a8 55 55\ +d9 ec 36 73 a0 61 08 fd 62 a2 fd a5 6d 1c e2 e8\ +5c 4d b6 b2 4a 81 ca 3b 49 6c 36 d4 fd 06 eb 7c\ +91 66 d8 e9 48 77 c4 2b ea 62 2b 3b fe 92 51 fd\ +c2 1d 8d 53 71 ba da d7 8a 48 82 14 79 63 35 b4\ +0b +Test: Verify +Comment: RSASSA-PSS Signature Example 2.5 +Message: \ +86 a8 3d 4a 72 ee 93 2a 4f 56 30 af 65 79 a3 86\ +b7 8f e8 89 99 e0 ab d2 d4 90 34 a4 bf c8 54 dd\ +94 f1 09 4e 2e 8c d7 a1 79 d1 95 88 e4 ae fc 1b\ +1b d2 5e 95 e3 dd 46 1f +Salt: \ +17 63 9a 4e 88 d7 22 c4 fc a2 4d 07 9a 8b 29 c3\ +24 33 b0 c9 +Signature: \ +00 ec 43 08 24 93 1e bd 3b aa 43 03 4d ae 98 ba\ +64 6b 8c 36 01 3d 16 71 c3 cf 1c f8 26 0c 37 4b\ +19 f8 e1 cc 8d 96 50 12 40 5e 7e 9b f7 37 86 12\ +df cc 85 fc e1 2c da 11 f9 50 bd 0b a8 87 67 40\ +43 6c 1d 25 95 a6 4a 1b 32 ef cf b7 4a 21 c8 73\ +b3 cc 33 aa f4 e3 dc 39 53 de 67 f0 67 4c 04 53\ +b4 fd 9f 60 44 06 d4 41 b8 16 09 8c b1 06 fe 34\ +72 bc 25 1f 81 5f 59 db 2e 43 78 a3 ad dc 18 1e\ +cf +Test: Verify +Comment: RSASSA-PSS Signature Example 2.6 +Message: \ +04 9f 91 54 d8 71 ac 4a 7c 7a b4 53 25 ba 75 45\ +a1 ed 08 f7 05 25 b2 66 7c f1 +Salt: \ +37 81 0d ef 10 55 ed 92 2b 06 3d f7 98 de 5d 0a\ +ab f8 86 ee +Signature: \ +00 47 5b 16 48 f8 14 a8 dc 0a bd c3 7b 55 27 f5\ +43 b6 66 bb 6e 39 d3 0e 5b 49 d3 b8 76 dc cc 58\ +ea c1 4e 32 a2 d5 5c 26 16 01 44 56 ad 2f 24 6f\ +c8 e3 d5 60 da 3d df 37 9a 1c 0b d2 00 f1 02 21\ +df 07 8c 21 9a 15 1b c8 d4 ec 9d 2f c2 56 44 67\ +81 10 14 ef 15 d8 ea 01 c2 eb bf f8 c2 c8 ef ab\ +38 09 6e 55 fc be 32 85 c7 aa 55 88 51 25 4f af\ +fa 92 c1 c7 2b 78 75 86 63 ef 45 82 84 31 39 d7\ +a6 +Test: Verify +Comment: Example 3: A 1026-bit RSA Key Pair +Modulus: \ +02 f2 46 ef 45 1e d3 ee bb 9a 31 02 00 cc 25 85\ +9c 04 8e 4b e7 98 30 29 91 11 2e b6 8c e6 db 67\ +4e 28 0d a2 1f ed ed 1a e7 48 80 ca 52 2b 18 db\ +24 93 85 01 28 27 c5 15 f0 e4 66 a1 ff a6 91 d9\ +81 70 57 4e 9d 0e ad b0 87 58 6c a4 89 33 da 3c\ +c9 53 d9 5b d0 ed 50 de 10 dd cb 67 36 10 7d 6c\ +83 1c 7f 66 3e 83 3c a4 c0 97 e7 00 ce 0f b9 45\ +f8 8f b8 5f e8 e5 a7 73 17 25 65 b9 14 a4 71 a4\ +43 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +65 14 51 73 3b 56 de 5a c0 a6 89 a4 ae b6 e6 89\ +4a 69 01 4e 07 6c 88 dd 7a 66 7e ab 32 32 bb cc\ +d2 fc 44 ba 2f a9 c3 1d b4 6f 21 ed d1 fd b2 3c\ +5c 12 8a 5d a5 ba b9 1e 7f 95 2b 67 75 9c 7c ff\ +70 54 15 ac 9f a0 90 7c 7c a6 17 8f 66 8f b9 48\ +d8 69 da 4c c3 b7 35 6f 40 08 df d5 44 9d 32 ee\ +02 d9 a4 77 eb 69 fc 29 26 6e 5d 90 70 51 23 75\ +a5 0f bb cc 27 e2 38 ad 98 42 5f 6e bb f8 89 91 +Prime1: \ +01 bd 36 e1 8e ce 4b 0f db 2e 9c 9d 54 8b d1 a7\ +d6 e2 c2 1c 6f dc 35 07 4a 1d 05 b1 c6 c8 b3 d5\ +58 ea 26 39 c9 a9 a4 21 68 01 69 31 72 52 55 8b\ +d1 48 ad 21 5a ac 55 0e 2d cf 12 a8 2d 0e bf e8\ +53 +Prime2: \ +01 b1 b6 56 ad 86 d8 e1 9d 5d c8 62 92 b3 a1 92\ +fd f6 e0 dd 37 87 7b ad 14 82 2f a0 01 90 ca b2\ +65 f9 0d 3f 02 05 7b 6f 54 d6 ec b1 44 91 e5 ad\ +ea ce bc 48 bf 0e bd 2a 2a d2 6d 40 2e 54 f6 16\ +51 +ModPrime1PrivateExponent: \ +1f 27 79 fd 2e 3e 5e 6b ae 05 53 95 18 fb a0 cd\ +0e ad 1a a4 51 3a 7c ba 18 f1 cf 10 e3 f6 81 95\ +69 3d 27 8a 0f 0e e7 2f 89 f9 bc 76 0d 80 e2 f9\ +d0 26 1d 51 65 01 c6 ae 39 f1 4a 47 6c e2 cc f5 +ModPrime2PrivateExponent: \ +01 1a 0d 36 79 4b 04 a8 54 aa b4 b2 46 2d 43 9a\ +50 46 c9 1d 94 0b 2b c6 f7 5b 62 95 6f ef 35 a2\ +a6 e6 3c 53 09 81 7f 30 7b bf f9 d5 9e 7e 33 1b\ +d3 63 f6 d6 68 49 b1 83 46 ad ea 16 9f 0a e9 ae\ +c1 +MultiplicativeInverseOfPrime2ModPrime1: \ +0b 30 f0 ec f5 58 75 2f b3 a6 ce 4b a2 b8 c6 75\ +f6 59 eb a6 c3 76 58 5a 1b 39 71 2d 03 8a e3 d2\ +b4 6f cb 41 8a e1 5d 09 05 da 64 40 e1 51 3a 30\ +b9 b7 d6 66 8f bc 5e 88 e5 ab 7a 17 5e 73 ba 35 +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 3.1 +Message: \ +59 4b 37 33 3b bb 2c 84 52 4a 87 c1 a0 1f 75 fc\ +ec 0e 32 56 f1 08 e3 8d ca 36 d7 0d 00 57 +Salt: \ +f3 1a d6 c8 cf 89 df 78 ed 77 fe ac bc c2 f8 b0\ +a8 e4 cf aa +Signature: \ +00 88 b1 35 fb 17 94 b6 b9 6c 4a 3e 67 81 97 f8\ +ca c5 2b 64 b2 fe 90 7d 6f 27 de 76 11 24 96 4a\ +99 a0 1a 88 27 40 ec fa ed 6c 01 a4 74 64 bb 05\ +18 23 13 c0 13 38 a8 cd 09 72 14 cd 68 ca 10 3b\ +d5 7d 3b c9 e8 16 21 3e 61 d7 84 f1 82 46 7a bf\ +8a 01 cf 25 3e 99 a1 56 ea a8 e3 e1 f9 0e 3c 6e\ +4e 3a a2 d8 3e d0 34 5b 89 fa fc 9c 26 07 7c 14\ +b6 ac 51 45 4f a2 6e 44 6e 3a 2f 15 3b 2b 16 79\ +7f +Test: Verify +Comment: RSASSA-PSS Signature Example 3.2 +Message: \ +8b 76 95 28 88 4a 0d 1f fd 09 0c f1 02 99 3e 79\ +6d ad cf bd dd 38 e4 4f f6 32 4c a4 51 +Salt: \ +fc f9 f0 e1 f1 99 a3 d1 d0 da 68 1c 5b 86 06 fc\ +64 29 39 f7 +Signature: \ +02 a5 f0 a8 58 a0 86 4a 4f 65 01 7a 7d 69 45 4f\ +3f 97 3a 29 99 83 9b 7b bc 48 bf 78 64 11 69 17\ +95 56 f5 95 fa 41 f6 ff 18 e2 86 c2 78 30 79 bc\ +09 10 ee 9c c3 4f 49 ba 68 11 24 f9 23 df a8 8f\ +42 61 41 a3 68 a5 f5 a9 30 c6 28 c2 c3 c2 00 e1\ +8a 76 44 72 1a 0c be c6 dd 3f 62 79 bd e3 e8 f2\ +be 5e 2d 4e e5 6f 97 e7 ce af 33 05 4b e7 04 2b\ +d9 1a 63 bb 09 f8 97 bd 41 e8 11 97 de e9 9b 11\ +af +Test: Verify +Comment: RSASSA-PSS Signature Example 3.3 +Message: \ +1a bd ba 48 9c 5a da 2f 99 5e d1 6f 19 d5 a9 4d\ +9e 6e c3 4a 8d 84 f8 45 57 d2 6e 5e f9 b0 2b 22\ +88 7e 3f 9a 4b 69 0a d1 14 92 09 c2 0c 61 43 1f\ +0c 01 7c 36 c2 65 7b 35 d7 b0 7d 3f 5a d8 70 85\ +07 a9 c1 b8 31 df 83 5a 56 f8 31 07 18 14 ea 5d\ +3d 8d 8f 6a de 40 cb a3 8b 42 db 7a 2d 3d 7a 29\ +c8 f0 a7 9a 78 38 cf 58 a9 75 7f a2 fe 4c 40 df\ +9b aa 19 3b fc 6f 92 b1 23 ad 57 b0 7a ce 3e 6a\ +c0 68 c9 f1 06 af d9 ee b0 3b 4f 37 c2 5d bf bc\ +fb 30 71 f6 f9 77 17 66 d0 72 f3 bb 07 0a f6 60\ +55 32 97 3a e2 50 51 +Salt: \ +98 6e 7c 43 db b6 71 bd 41 b9 a7 f4 b6 af c8 0e\ +80 5f 24 23 +Signature: \ +02 44 bc d1 c8 c1 69 55 73 6c 80 3b e4 01 27 2e\ +18 cb 99 08 11 b1 4f 72 db 96 41 24 d5 fa 76 06\ +49 cb b5 7a fb 87 55 db b6 2b f5 1f 46 6c f2 3a\ +0a 16 07 57 6e 98 3d 77 8f ce ff a9 2d f7 54 8a\ +ea 8e a4 ec ad 2c 29 dd 9f 95 bc 07 fe 91 ec f8\ +be e2 55 bf e8 76 2f d7 69 0a a9 bf a4 fa 08 49\ +ef 72 8c 2c 42 c4 53 23 64 52 2d f2 ab 7f 9f 8a\ +03 b6 3f 7a 49 91 75 82 86 68 f5 ef 5a 29 e3 80\ +2c +Test: Verify +Comment: RSASSA-PSS Signature Example 3.4 +Message: \ +8f b4 31 f5 ee 79 2b 6c 2a c7 db 53 cc 42 86 55\ +ae b3 2d 03 f4 e8 89 c5 c2 5d e6 83 c4 61 b5 3a\ +cf 89 f9 f8 d3 aa bd f6 b9 f0 c2 a1 de 12 e1 5b\ +49 ed b3 91 9a 65 2f e9 49 1c 25 a7 fc e1 f7 22\ +c2 54 36 08 b6 9d c3 75 ec +Salt: \ +f8 31 2d 9c 8e ea 13 ec 0a 4c 7b 98 12 0c 87 50\ +90 87 c4 78 +Signature: \ +01 96 f1 2a 00 5b 98 12 9c 8d f1 3c 4c b1 6f 8a\ +a8 87 d3 c4 0d 96 df 3a 88 e7 53 2e f3 9c d9 92\ +f2 73 ab c3 70 bc 1b e6 f0 97 cf eb bf 01 18 fd\ +9e f4 b9 27 15 5f 3d f2 2b 90 4d 90 70 2d 1f 7b\ +a7 a5 2b ed 8b 89 42 f4 12 cd 7b d6 76 c9 d1 8e\ +17 03 91 dc d3 45 c0 6a 73 09 64 b3 f3 0b cc e0\ +bb 20 ba 10 6f 9a b0 ee b3 9c f8 a6 60 7f 75 c0\ +34 7f 0a f7 9f 16 af a0 81 d2 c9 2d 1e e6 f8 36\ +b8 +Test: Verify +Comment: RSASSA-PSS Signature Example 3.5 +Message: \ +fe f4 16 1d fa af 9c 52 95 05 1d fc 1f f3 81 0c\ +8c 9e c2 e8 66 f7 07 54 22 c8 ec 42 16 a9 c4 ff\ +49 42 7d 48 3c ae 10 c8 53 4a 41 b2 fd 15 fe e0\ +69 60 ec 6f b3 f7 a7 e9 4a 2f 8a 2e 3e 43 dc 4a\ +40 57 6c 30 97 ac 95 3b 1d e8 6f 0b 4e d3 6d 64\ +4f 23 ae 14 42 55 29 62 24 64 ca 0c bf 0b 17 41\ +34 72 38 15 7f ab 59 e4 de 55 24 09 6d 62 ba ec\ +63 ac 64 +Salt: \ +50 32 7e fe c6 29 2f 98 01 9f c6 7a 2a 66 38 56\ +3e 9b 6e 2d +Signature: \ +02 1e ca 3a b4 89 22 64 ec 22 41 1a 75 2d 92 22\ +10 76 d4 e0 1c 0e 6f 0d de 9a fd 26 ba 5a cf 6d\ +73 9e f9 87 54 5d 16 68 3e 56 74 c9 e7 0f 1d e6\ +49 d7 e6 1d 48 d0 ca eb 4f b4 d8 b2 4f ba 84 a6\ +e3 10 8f ee 7d 07 05 97 32 66 ac 52 4b 4a d2 80\ +f7 ae 17 dc 59 d9 6d 33 51 58 6b 5a 3b db 89 5d\ +1e 1f 78 20 ac 61 35 d8 75 34 80 99 83 82 ba 32\ +b7 34 95 59 60 8c 38 74 52 90 a8 5e f4 e9 f9 bd\ +83 +Test: Verify +Comment: RSASSA-PSS Signature Example 3.6 +Message: \ +ef d2 37 bb 09 8a 44 3a ee b2 bf 6c 3f 8c 81 b8\ +c0 1b 7f cb 3f eb +Salt: \ +b0 de 3f c2 5b 65 f5 af 96 b1 d5 cc 3b 27 d0 c6\ +05 30 87 b3 +Signature: \ +01 2f af ec 86 2f 56 e9 e9 2f 60 ab 0c 77 82 4f\ +42 99 a0 ca 73 4e d2 6e 06 44 d5 d2 22 c7 f0 bd\ +e0 39 64 f8 e7 0a 5c b6 5e d4 4e 44 d5 6a e0 ed\ +f1 ff 86 ca 03 2c c5 dd 44 04 db b7 6a b8 54 58\ +6c 44 ee d8 33 6d 08 d4 57 ce 6c 03 69 3b 45 c0\ +f1 ef ef 93 62 4b 95 b8 ec 16 9c 61 6d 20 e5 53\ +8e bc 0b 67 37 a6 f8 2b 4b c0 57 09 24 fc 6b 35\ +75 9a 33 48 42 62 79 f8 b3 d7 74 4e 2d 22 24 26\ +ce +Test: Verify +Comment: Example 4: A 1027-bit RSA Key Pair +Modulus: \ +05 4a db 78 86 44 7e fe 6f 57 e0 36 8f 06 cf 52\ +b0 a3 37 07 60 d1 61 ce f1 26 b9 1b e7 f8 9c 42\ +1b 62 a6 ec 1d a3 c3 11 d7 5e d5 0e 0a b5 ff f3\ +fd 33 8a cc 3a a8 a4 e7 7e e2 63 69 ac b8 1b a9\ +00 fa 83 f5 30 0c f9 bb 6c 53 ad 1d c8 a1 78 b8\ +15 db 42 35 a9 a9 da 0c 06 de 4e 61 5e a1 27 7c\ +e5 59 e9 c1 08 de 58 c1 4a 81 aa 77 f5 a6 f8 d1\ +33 54 94 49 88 48 c8 b9 59 40 74 0b e7 bf 7c 37\ +05 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +fa 04 1f 8c d9 69 7c ee d3 8e c8 ca a2 75 52 3b\ +4d d7 2b 09 a3 01 d3 54 1d 72 f5 d3 1c 05 cb ce\ +2d 69 83 b3 61 83 af 10 69 0b d4 6c 46 13 1e 35\ +78 94 31 a5 56 77 1d d0 04 9b 57 46 1b f0 60 c1\ +f6 84 72 e8 a6 7c 25 f3 57 e5 b6 b4 73 8f a5 41\ +a7 30 34 6b 4a 07 64 9a 2d fa 80 6a 69 c9 75 b6\ +ab a6 46 78 ac c7 f5 91 3e 89 c6 22 f2 d8 ab b1\ +e3 e3 25 54 e3 9d f9 4b a6 0c 00 2e 38 7d 90 11 +Prime1: \ +02 92 32 33 6d 28 38 94 5d ba 9d d7 72 3f 4e 62\ +4a 05 f7 37 5b 92 7a 87 ab e6 a8 93 a1 65 8f d4\ +9f 47 f6 c7 b0 fa 59 6c 65 fa 68 a2 3f 0a b4 32\ +96 2d 18 d4 34 3b d6 fd 67 1a 5e a8 d1 48 41 39\ +95 +Prime2: \ +02 0e f5 ef e7 c5 39 4a ed 22 72 f7 e8 1a 74 f4\ +c0 2d 14 58 94 cb 1b 3c ab 23 a9 a0 71 0a 2a fc\ +7e 33 29 ac bb 74 3d 01 f6 80 c4 d0 2a fb 4c 8f\ +de 7e 20 93 08 11 bb 2b 99 57 88 b5 e8 72 c2 0b\ +b1 +ModPrime1PrivateExponent: \ +02 6e 7e 28 01 0e cf 24 12 d9 52 3a d7 04 64 7f\ +b4 fe 9b 66 b1 a6 81 58 1b 0e 15 55 3a 89 b1 54\ +28 28 89 8f 27 24 3e ba b4 5f f5 e1 ac b9 d4 df\ +1b 05 1f bc 62 82 4d bc 6f 6c 93 26 1a 78 b9 a7\ +59 +ModPrime2PrivateExponent: \ +01 2d dc c8 6e f6 55 99 8c 39 dd ae 11 71 86 69\ +e5 e4 6c f1 49 5b 07 e1 3b 10 14 cd 69 b3 af 68\ +30 4a d2 a6 b6 43 21 e7 8b f3 bb ca 9b b4 94 e9\ +1d 45 17 17 e2 d9 75 64 c6 54 94 65 d0 20 5c f4\ +21 +MultiplicativeInverseOfPrime2ModPrime1: \ +01 06 00 c4 c2 18 47 45 9f e5 76 70 3e 2e be ca\ +e8 a5 09 4e e6 3f 53 6b f4 ac 68 d3 c1 3e 5e 4f\ +12 ac 5c c1 0a b6 a2 d0 5a 19 92 14 d1 82 47 47\ +d5 51 90 96 36 b7 74 c2 2c ac 0b 83 75 99 ab cc\ +75 +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 4.1 +Message: \ +9f b0 3b 82 7c 82 17 d9 +Salt: \ +ed 7c 98 c9 5f 30 97 4f be 4f bd dc f0 f2 8d 60\ +21 c0 e9 1d +Signature: \ +03 23 d5 b7 bf 20 ba 45 39 28 9a e4 52 ae 42 97\ +08 0f ef f4 51 84 23 ff 48 11 a8 17 83 7e 7d 82\ +f1 83 6c df ab 54 51 4f f0 88 7b dd ee bf 40 bf\ +99 b0 47 ab c3 ec fa 6a 37 a3 ef 00 f4 a0 c4 a8\ +8a ae 09 04 b7 45 c8 46 c4 10 7e 87 97 72 3e 8a\ +c8 10 d9 e3 d9 5d fa 30 ff 49 66 f4 d7 5d 13 76\ +8d 20 85 7f 2b 14 06 f2 64 cf e7 5e 27 d7 65 2f\ +4b 5e d3 57 5f 28 a7 02 f8 c4 ed 9c f9 b2 d4 49\ +48 +Test: Verify +Comment: RSASSA-PSS Signature Example 4.2 +Message: \ +0c a2 ad 77 79 7e ce 86 de 5b f7 68 75 0d db 5e\ +d6 a3 11 6a d9 9b bd 17 ed f7 f7 82 f0 db 1c d0\ +5b 0f 67 74 68 c5 ea 42 0d c1 16 b1 0e 80 d1 10\ +de 2b 04 61 ea 14 a3 8b e6 86 20 39 2e 7e 89 3c\ +b4 ea 93 93 fb 88 6c 20 ff 79 06 42 30 5b f3 02\ +00 38 92 e5 4d f9 f6 67 50 9d c5 39 20 df 58 3f\ +50 a3 dd 61 ab b6 fa b7 5d 60 03 77 e3 83 e6 ac\ +a6 71 0e ee a2 71 56 e0 67 52 c9 4c e2 5a e9 9f\ +cb f8 59 2d be 2d 7e 27 45 3c b4 4d e0 71 00 eb\ +b1 a2 a1 98 11 a4 78 ad be ab 27 0f 94 e8 fe 36\ +9d 90 b3 ca 61 2f 9f +Salt: \ +22 d7 1d 54 36 3a 42 17 aa 55 11 3f 05 9b 33 84\ +e3 e5 7e 44 +Signature: \ +04 9d 01 85 84 5a 26 4d 28 fe b1 e6 9e da ec 09\ +06 09 e8 e4 6d 93 ab b3 83 71 ce 51 f4 aa 65 a5\ +99 bd aa a8 1d 24 fb a6 6a 08 a1 16 cb 64 4f 3f\ +1e 65 3d 95 c8 9d b8 bb d5 da ac 27 09 c8 98 40\ +00 17 84 10 a7 c6 aa 86 67 dd c3 8c 74 1f 71 0e\ +c8 66 5a a9 05 2b e9 29 d4 e3 b1 67 82 c1 66 21\ +14 c5 41 4b b0 35 34 55 c3 92 fc 28 f3 db 59 05\ +4b 5f 36 5c 49 e1 d1 56 f8 76 ee 10 cb 4f d7 05\ +98 +Test: Verify +Comment: RSASSA-PSS Signature Example 4.3 +Message: \ +28 80 62 af c0 8f cd b7 c5 f8 65 0b 29 83 73 00\ +46 1d d5 67 6c 17 a2 0a 3c 8f b5 14 89 49 e3 f7\ +3d 66 b3 ae 82 c7 24 0e 27 c5 b3 ec 43 28 ee 7d\ +6d df 6a 6a 0c 9b 5b 15 bc da 19 6a 9d 0c 76 b1\ +19 d5 34 d8 5a bd 12 39 62 d5 83 b7 6c e9 d1 80\ +bc e1 ca +Salt: \ +4a f8 70 fb c6 51 60 12 ca 91 6c 70 ba 86 2a c7\ +e8 24 36 17 +Signature: \ +03 fb c4 10 a2 ce d5 95 00 fb 99 f9 e2 af 27 81\ +ad a7 4e 13 14 56 24 60 27 82 e2 99 48 13 ee fc\ +a0 51 9e cd 25 3b 85 5f b6 26 a9 0d 77 1e ae 02\ +8b 0c 47 a1 99 cb d9 f8 e3 26 97 34 af 41 63 59\ +90 90 71 3a 3f a9 10 fa 09 60 65 27 21 43 2b 97\ +10 36 a7 18 1a 2b c0 ca b4 3b 0b 59 8b c6 21 74\ +61 d7 db 30 5f f7 e9 54 c5 b5 bb 23 1c 39 e7 91\ +af 6b cf a7 6b 14 7b 08 13 21 f7 26 41 48 2a 2a\ +ad +Test: Verify +Comment: RSASSA-PSS Signature Example 4.4 +Message: \ +6f 4f 9a b9 50 11 99 ce f5 5c 6c f4 08 fe 7b 36\ +c5 57 c4 9d 42 0a 47 63 d2 46 3c 8a d4 4b 3c fc\ +5b e2 74 2c 0e 7d 9b 0f 66 08 f0 8c 7f 47 b6 93\ +ee +Salt: \ +40 d2 e1 80 fa e1 ea c4 39 c1 90 b5 6c 2c 0e 14\ +dd f9 a2 26 +Signature: \ +04 86 64 4b c6 6b f7 5d 28 33 5a 61 79 b1 08 51\ +f4 3f 09 bd ed 9f ac 1a f3 32 52 bb 99 53 ba 42\ +98 cd 64 66 b2 75 39 a7 0a da a3 f8 9b 3d b3 c7\ +4a b6 35 d1 22 f4 ee 7c e5 57 a6 1e 59 b8 2f fb\ +78 66 30 e5 f9 db 53 c7 7d 9a 0c 12 fa b5 95 8d\ +4c 2c e7 da a8 07 cd 89 ba 2c c7 fc d0 2f f4 70\ +ca 67 b2 29 fc ce 81 4c 85 2c 73 cc 93 be a3 5b\ +e6 84 59 ce 47 8e 9d 46 55 d1 21 c8 47 2f 37 1d\ +4f +Test: Verify +Comment: RSASSA-PSS Signature Example 4.5 +Message: \ +e1 7d 20 38 5d 50 19 55 82 3c 3f 66 62 54 c1 d3\ +dd 36 ad 51 68 b8 f1 8d 28 6f dc f6 7a 7d ad 94\ +09 70 85 fa b7 ed 86 fe 21 42 a2 87 71 71 79 97\ +ef 1a 7a 08 88 4e fc 39 35 6d 76 07 7a af 82 45\ +9a 7f ad 45 84 88 75 f2 81 9b 09 89 37 fe 92 3b\ +cc 9d c4 42 d7 2d 75 4d 81 20 25 09 0c 9b c0 3d\ +b3 08 0c 13 8d d6 3b 35 5d 0b 4b 85 d6 68 8a c1\ +9f 4d e1 50 84 a0 ba 4e 37 3b 93 ef 4a 55 50 96\ +69 19 15 dc 23 c0 0e 95 4c de b2 0a 47 cd 55 d1\ +6c 3d 86 81 d4 6e d7 f2 ed 5e a4 27 95 be 17 ba\ +ed 25 f0 f4 d1 13 b3 63 6a dd d5 85 f1 6a 8b 5a\ +ec 0c 8f a9 c5 f0 3c bf 3b 9b 73 +Salt: \ +24 97 dc 2b 46 15 df ae 5a 66 3d 49 ff d5 6b f7\ +ef c1 13 04 +Signature: \ +02 2a 80 04 53 53 90 4c b3 0c bb 54 2d 7d 49 90\ +42 1a 6e ec 16 a8 02 9a 84 22 ad fd 22 d6 af f8\ +c4 cc 02 94 af 11 0a 0c 06 7e c8 6a 7d 36 41 34\ +45 9b b1 ae 8f f8 36 d5 a8 a2 57 98 40 99 6b 32\ +0b 19 f1 3a 13 fa d3 78 d9 31 a6 56 25 da e2 73\ +9f 0c 53 67 0b 35 d9 d3 cb ac 08 e7 33 e4 ec 2b\ +83 af 4b 91 96 d6 3e 7c 4f f1 dd ea e2 a1 22 79\ +1a 12 5b fe a8 de b0 de 8c cf 1f 4f fa f6 e6 fb\ +0a +Test: Verify +Comment: RSASSA-PSS Signature Example 4.6 +Message: \ +af bc 19 d4 79 24 90 18 fd f4 e0 9f 61 87 26 44\ +04 95 de 11 dd ee e3 88 72 d7 75 fc ea 74 a2 38\ +96 b5 34 3c 9c 38 d4 6a f0 db a2 24 d0 47 58 0c\ +c6 0a 65 e9 39 1c f9 b5 9b 36 a8 60 59 8d 4e 82\ +16 72 2f 99 3b 91 cf ae 87 bc 25 5a f8 9a 6a 19\ +9b ca 4a 39 1e ad bc 3a 24 90 3c 0b d6 67 36 8f\ +6b e7 8e 3f ea bf b4 ff d4 63 12 27 63 74 0f fb\ +be fe ab 9a 25 56 4b c5 d1 c2 4c 93 e4 22 f7 50\ +73 e2 ad 72 bf 45 b1 0d f0 0b 52 a1 47 12 8e 73\ +fe e3 3f a3 f0 57 7d 77 f8 0f bc 2d f1 be d3 13\ +29 0c 12 77 7f 50 +Salt: \ +a3 34 db 6f ae bf 11 08 1a 04 f8 7c 2d 62 1c de\ +c7 93 0b 9b +Signature: \ +00 93 8d cb 6d 58 30 46 06 5f 69 c7 8d a7 a1 f1\ +75 70 66 a7 fa 75 12 5a 9d 29 29 f0 b7 9a 60 b6\ +27 b0 82 f1 1f 5b 19 6f 28 eb 9d aa 6f 21 c0 5e\ +51 40 f6 ae f1 73 7d 20 23 07 5c 05 ec f0 4a 02\ +8c 68 6a 2a b3 e7 d5 a0 66 4f 29 5c e1 29 95 e8\ +90 90 8b 6a d2 1f 08 39 eb 65 b7 03 93 a7 b5 af\ +d9 87 1d e0 ca a0 ce de c5 b8 19 62 67 56 20 9d\ +13 ab 1e 7b b9 54 6a 26 ff 37 e9 a5 1a f9 fd 56\ +2e +Test: Verify +Comment: Example 5: A 1028-bit RSA Key Pair +Modulus: \ +0d 10 f6 61 f2 99 40 f5 ed 39 aa 26 09 66 de b4\ +78 43 67 9d 2b 6f b2 5b 3d e3 70 f3 ac 7c 19 91\ +63 91 fd 25 fb 52 7e bf a6 a4 b4 df 45 a1 75 9d\ +99 6c 4b b4 eb d1 88 28 c4 4f c5 2d 01 91 87 17\ +40 52 5f 47 a4 b0 cc 8d a3 25 ed 8a a6 76 b0 d0\ +f6 26 e0 a7 7f 07 69 21 70 ac ac 80 82 f4 2f aa\ +7d c7 cd 12 3e 73 0e 31 a8 79 85 20 4c ab cb e6\ +67 0d 43 a2 dd 2b 2d de f5 e0 53 92 fc 21 3b c5\ +07 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +03 ce 08 b1 04 ff f3 96 a9 79 bd 3e 4e 46 92 5b\ +63 19 dd b6 3a cb cf d8 19 f1 7d 16 b8 07 7b 3a\ +87 10 1f f3 4b 77 fe 48 b8 b2 05 a9 6e 91 51 ba\ +8e ce a6 4d 0c ce 7b 23 c3 e6 a6 b8 30 58 bc 49\ +da e8 16 ae 73 6d b5 a4 70 8e 2a d4 35 23 2b 56\ +7f 90 96 ce 59 ff 28 06 1e 79 ab 1c 02 d7 17 e6\ +b2 3c ea 6d b8 eb 51 92 fa 7c 1e ab 22 7d ba 74\ +62 1c 45 60 18 96 ee f1 37 92 c8 44 0b eb 15 aa\ +c1 +Prime1: \ +03 f2 f3 31 f4 14 2d 4f 24 b4 3a a1 02 79 a8 96\ +52 d4 e7 53 72 21 a1 a7 b2 a2 5d eb 55 1e 5d e9\ +ac 49 74 11 c2 27 a9 4e 45 f9 1c 2d 1c 13 cc 04\ +6c f4 ce 14 e3 2d 05 87 34 21 0d 44 a8 7e e1 b7\ +3f +Prime2: \ +03 4f 09 0d 73 b5 58 03 03 0c f0 36 1a 5d 80 81\ +bf b7 9f 85 15 23 fe ac 0a 21 24 d0 8d 40 13 ff\ +08 48 77 71 a8 70 d0 47 9d c0 68 6c 62 f7 71 8d\ +fe cf 02 4b 17 c9 26 76 78 05 91 71 33 9c c0 08\ +39 +ModPrime1PrivateExponent: \ +02 aa 66 3a db f5 1a b8 87 a0 18 cb 42 6e 78 bc\ +2f e1 82 dc b2 f7 bc b5 04 41 d1 7f df 0f 06 79\ +8b 50 71 c6 e2 f5 fe b4 d5 4a d8 18 23 11 c1 ef\ +62 d4 c4 9f 18 d1 f5 1f 54 b2 d2 cf fb a4 da 1b\ +e5 +ModPrime2PrivateExponent: \ +02 bb e7 06 07 8b 5c 0b 39 15 12 d4 11 db 1b 19\ +9b 5a 56 64 b8 40 42 ea d3 7f e9 94 ae 72 b9 53\ +2d fb fb 3e 9e 69 81 a0 fb b8 06 51 31 41 b7 c2\ +16 3f e5 6c 39 5e 4b fa ee 57 e3 83 3f 9b 91 8d\ +f9 +MultiplicativeInverseOfPrime2ModPrime1: \ +02 42 b6 cd 00 d3 0a 76 7a ee 9a 89 8e ad 45 3c\ +8e ae a6 3d 50 0b 7d 1e 00 71 3e da e5 1c e3 6b\ +23 b6 64 df 26 e6 3e 26 6e c8 f7 6e 6e 63 ed 1b\ +a4 1e b0 33 b1 20 f7 ea 52 12 ae 21 a9 8f bc 16 +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 5.1 +Message: \ +30 c7 d5 57 45 8b 43 6d ec fd c1 4d 06 cb 7b 96\ +b0 67 18 c4 8d 7d e5 74 82 a8 68 ae 7f 06 58 70\ +a6 21 65 06 d1 1b 77 93 23 df df 04 6c f5 77 51\ +29 13 4b 4d 56 89 e4 d9 c0 ce 1e 12 d7 d4 b0 6c\ +b5 fc 58 20 de cf a4 1b af 59 bf 25 7b 32 f0 25\ +b7 67 9b 44 5b 94 99 c9 25 55 14 58 85 99 2f 1b\ +76 f8 48 91 ee 4d 3b e0 f5 15 0f d5 90 1e 3a 4c\ +8e d4 3f d3 6b 61 d0 22 e6 5a d5 00 8d bf 33 29\ +3c 22 bf bf d0 73 21 f0 f1 d5 fa 9f df 00 14 c2\ +fc b0 35 8a ad 0e 35 4b 0d 29 +Salt: \ +08 1b 23 3b 43 56 77 50 bd 6e 78 f3 96 a8 8b 9f\ +6a 44 51 51 +Signature: \ +0b a3 73 f7 6e 09 21 b7 0a 8f bf e6 22 f0 bf 77\ +b2 8a 3d b9 8e 36 10 51 c3 d7 cb 92 ad 04 52 91\ +5a 4d e9 c0 17 22 f6 82 3e eb 6a df 7e 0c a8 29\ +0f 5d e3 e5 49 89 0a c2 a3 c5 95 0a b2 17 ba 58\ +59 08 94 95 2d e9 6f 8d f1 11 b2 57 52 15 da 6c\ +16 15 90 c7 45 be 61 24 76 ee 57 8e d3 84 ab 33\ +e3 ec e9 74 81 a2 52 f5 c7 9a 98 b5 53 2a e0 0c\ +dd 62 f2 ec c0 cd 1b ae fe 80 d8 0b 96 21 93 ec\ +1d +Test: Verify +Comment: RSASSA-PSS Signature Example 5.2 +Message: \ +e7 b3 2e 15 56 ea 1b 27 95 04 6a c6 97 39 d2 2a\ +c8 96 6b f1 1c 11 6f 61 4b 16 67 40 e9 6b 90 65\ +3e 57 50 94 5f cf 77 21 86 c0 37 90 a0 7f da 32\ +3e 1a 61 91 6b 06 ee 21 57 db 3d ff 80 d6 7d 5e\ +39 a5 3a e2 68 c8 f0 9e d9 9a 73 20 05 b0 bc 6a\ +04 af 4e 08 d5 7a 00 e7 20 1b 30 60 ef aa db 73\ +11 3b fc 08 7f d8 37 09 3a a2 52 35 b8 c1 49 f5\ +62 15 f0 31 c2 4a d5 bd e7 f2 99 60 df 7d 52 40\ +70 f7 44 9c 6f 78 50 84 be 1a 0f 73 30 47 f3 36\ +f9 15 47 38 67 45 47 db 02 a9 f4 4d fc 6e 60 30\ +10 81 e1 ce 99 84 7f 3b 5b 60 1f f0 6b 4d 57 76\ +a9 74 0b 9a a0 d3 40 58 fd 3b 90 6e 4f 78 59 df\ +b0 7d 71 73 e5 e6 f6 35 0a da c2 1f 27 b2 30 74\ +69 +Salt: \ +bd 0c e1 95 49 d0 70 01 20 cb e5 10 77 db bb b0\ +0a 8d 8b 09 +Signature: \ +08 18 0d e8 25 e4 b8 b0 14 a3 2d a8 ba 76 15 55\ +92 12 04 f2 f9 0d 5f 24 b7 12 90 8f f8 4f 3e 22\ +0a d1 79 97 c0 dd 6e 70 66 30 ba 3e 84 ad d4 d5\ +e7 ab 00 4e 58 07 4b 54 97 09 56 5d 43 ad 9e 97\ +b5 a7 a1 a2 9e 85 b9 f9 0f 4a af cd f5 83 21 de\ +8c 59 74 ef 9a bf 2d 52 6f 33 c0 f2 f8 2e 95 d1\ +58 ea 6b 81 f1 73 6d b8 d1 af 3d 6a c6 a8 3b 32\ +d1 8b ae 0f f1 b2 fe 27 de 4c 76 ed 8c 79 80 a3\ +4e +Test: Verify +Comment: RSASSA-PSS Signature Example 5.3 +Message: \ +8d 83 96 e3 65 07 fe 1e f6 a1 90 17 54 8e 0c 71\ +66 74 c2 fe c2 33 ad b2 f7 75 66 5e c4 1f 2b d0\ +ba 39 6b 06 1a 9d aa 7e 86 6f 7c 23 fd 35 31 95\ +43 00 a3 42 f9 24 53 5e a1 49 8c 48 f6 c8 79 93\ +28 65 fc 02 00 0c 52 87 23 b7 ad 03 35 74 5b 51\ +20 9a 0a fe d9 32 af 8f 08 87 c2 19 00 4d 2a bd\ +89 4e a9 25 59 ee 31 98 af 3a 73 4f e9 b9 63 8c\ +26 3a 72 8a d9 5a 5a e8 ce 3e b1 58 39 f3 aa 78\ +52 bb 39 07 06 e7 76 0e 43 a7 12 91 a2 e3 f8 27\ +23 7d ed a8 51 87 4c 51 76 65 f5 45 f2 72 38 df\ +86 55 7f 37 5d 09 cc d8 bd 15 d8 cc f6 1f 5d 78\ +ca 5c 7f 5c de 78 2e 6b f5 d0 05 70 56 d4 ba d9\ +8b 3d 2f 95 75 e8 24 ab 7a 33 ff 57 b0 ac 10 0a\ +b0 d6 ea d7 aa 0b 50 f6 e4 d3 e5 ec 0b 96 6b +Salt: \ +81 57 79 a9 1b 3a 8b d0 49 bf 2a eb 92 01 42 77\ +22 22 c9 ca +Signature: \ +05 e0 fd bd f6 f7 56 ef 73 31 85 cc fa 8c ed 2e\ +b6 d0 29 d9 d5 6e 35 56 1b 5d b8 e7 02 57 ee 6f\ +d0 19 d2 f0 bb f6 69 fe 9b 98 21 e7 8d f6 d4 1e\ +31 60 8d 58 28 0f 31 8e e3 4f 55 99 41 c8 df 13\ +28 75 74 ba c0 00 b7 e5 8d c4 f4 14 ba 49 fb 12\ +7f 9d 0f 89 36 63 8c 76 e8 53 56 c9 94 f7 97 50\ +f7 fa 3c f4 fd 48 2d f7 5e 3f b9 97 8c d0 61 f7\ +ab b1 75 72 e6 e6 3e 0b de 12 cb dc f1 8c 68 b9\ +79 +Test: Verify +Comment: RSASSA-PSS Signature Example 5.4 +Message: \ +32 8c 65 9e 0a 64 37 43 3c ce b7 3c 14 +Salt: \ +9a ec 4a 74 80 d5 bb c4 29 20 d7 ca 23 5d b6 74\ +98 9c 9a ac +Signature: \ +0b c9 89 85 3b c2 ea 86 87 32 71 ce 18 3a 92 3a\ +b6 5e 8a 53 10 0e 6d f5 d8 7a 24 c4 19 4e b7 97\ +81 3e e2 a1 87 c0 97 dd 87 2d 59 1d a6 0c 56 86\ +05 dd 7e 74 2d 5a f4 e3 3b 11 67 8c cb 63 90 32\ +04 a3 d0 80 b0 90 2c 89 ab a8 86 8f 00 9c 0f 1c\ +0c b8 58 10 bb dd 29 12 1a bb 84 71 ff 2d 39 e4\ +9f d9 2d 56 c6 55 c8 e0 37 ad 18 fa fb dc 92 c9\ +58 63 f7 f6 1e a9 ef a2 8f ea 40 13 69 d1 9d ae\ +a1 +Test: Verify +Comment: RSASSA-PSS Signature Example 5.5 +Message: \ +f3 7b 96 23 79 a4 7d 41 5a 37 6e ec 89 73 15 0b\ +cb 34 ed d5 ab 65 40 41 b6 14 30 56 0c 21 44 58\ +2b a1 33 c8 67 d8 52 d6 b8 e2 33 21 90 13 02 ec\ +b4 5b 09 ec 88 b1 52 71 78 fa 04 32 63 f3 06 7d\ +9f fe 97 30 32 a9 9f 4c b0 8a d2 c7 e0 a2 45 6c\ +dd 57 a7 df 56 fe 60 53 52 7a 5a eb 67 d7 e5 52\ +06 3c 1c a9 7b 1b ef fa 7b 39 e9 97 ca f2 78 78\ +ea 0f 62 cb eb c8 c2 1d f4 c8 89 a2 02 85 1e 94\ +90 88 49 0c 24 9b 6e 9a cf 1d 80 63 f5 be 23 43\ +98 9b f9 5c 4d a0 1a 2b e7 8b 4a b6 b3 78 01 5b\ +c3 79 57 f7 69 48 b5 e5 8e 44 0c 28 45 3d 40 d7\ +cf d5 7e 7d 69 06 00 47 4a b5 e7 59 73 b1 ea 0c\ +5f 1e 45 d1 41 90 af e2 f4 eb 6d 3b df 71 f1 d2\ +f8 bb 15 6a 1c 29 5d 04 aa eb 9d 68 9d ce 79 ed\ +62 bc 44 3e +Salt: \ +e2 0c 1e 98 78 51 2c 39 97 0f 58 37 5e 15 49 a6\ +8b 64 f3 1d +Signature: \ +0a ef a9 43 b6 98 b9 60 9e df 89 8a d2 27 44 ac\ +28 dc 23 94 97 ce a3 69 cb bd 84 f6 5c 95 c0 ad\ +77 6b 59 47 40 16 4b 59 a7 39 c6 ff 7c 2f 07 c7\ +c0 77 a8 6d 95 23 8f e5 1e 1f cf 33 57 4a 4a e0\ +68 4b 42 a3 f6 bf 67 7d 91 82 0c a8 98 74 46 7b\ +2c 23 ad d7 79 69 c8 07 17 43 0d 0e fc 1d 36 95\ +89 2c e8 55 cb 7f 70 11 63 0f 4d f2 6d ef 8d df\ +36 fc 23 90 5f 57 fa 62 43 a4 85 c7 70 d5 68 1f\ +cd +Test: Verify +Comment: RSASSA-PSS Signature Example 5.6 +Message: \ +c6 10 3c 33 0c 1e f7 18 c1 41 e4 7b 8f a8 59 be\ +4d 5b 96 25 9e 7d 14 20 70 ec d4 85 83 9d ba 5a\ +83 69 c1 7c 11 14 03 5e 53 2d 19 5c 74 f4 4a 04\ +76 a2 d3 e8 a4 da 21 00 16 ca ce d0 e3 67 cb 86\ +77 10 a4 b5 aa 2d f2 b8 e5 da f5 fd c6 47 80 7d\ +4d 5e bb 6c 56 b9 76 3c cd ae 4d ea 33 08 eb 0a\ +c2 a8 95 01 cb 20 9d 26 39 fa 5b f8 7c e7 90 74\ +7d 3c b2 d2 95 e8 45 64 f2 f6 37 82 4f 0c 13 02\ +81 29 b0 aa 4a 42 2d 16 22 82 +Salt: \ +23 29 1e 4a 33 07 e8 bb b7 76 62 3a b3 4e 4a 5f\ +4c c8 a8 db +Signature: \ +02 80 2d cc fa 8d fa f5 27 9b f0 b4 a2 9b a1 b1\ +57 61 1f ae aa f4 19 b8 91 9d 15 94 19 00 c1 33\ +9e 7e 92 e6 fa e5 62 c5 3e 6c c8 e8 41 04 b1 10\ +bc e0 3a d1 85 25 e3 c4 9a 0e ad ad 5d 3f 28 f2\ +44 a8 ed 89 ed ba fb b6 86 27 7c fa 8a e9 09 71\ +4d 6b 28 f4 bf 8e 29 3a a0 4c 41 ef e7 c0 a8 12\ +66 d5 c0 61 e2 57 5b e0 32 aa 46 46 74 ff 71 62\ +62 19 bd 74 cc 45 f0 e7 ed 4e 3f f9 6e ee 75 8e\ +8f +Test: Verify +Comment: Example 6: A 1029-bit RSA Key Pair +Modulus: \ +16 4c a3 1c ff 60 9f 3a 0e 71 01 b0 39 f2 e4 fe\ +6d d3 75 19 ab 98 59 8d 17 9e 17 49 96 59 80 71\ +f4 7d 3a 04 55 91 58 d7 be 37 3c f1 aa 53 f0 aa\ +6e f0 90 39 e5 67 8c 2a 4c 63 90 05 14 c8 c4 f8\ +aa ed 5d e1 2a 5f 10 b0 9c 31 1a f8 c0 ff b5 b7\ +a2 97 f2 ef c6 3b 8d 6b 05 10 93 1f 0b 98 e4 8b\ +f5 fc 6e c4 e7 b8 db 1f fa eb 08 c3 8e 02 ad b8\ +f0 3a 48 22 9c 99 e9 69 43 1f 61 cb 8c 4d c6 98\ +d1 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +03 b6 64 ee 3b 75 66 72 3f c6 ea f2 8a bb 43 0a\ +39 80 f1 12 6c 81 de 8a d7 09 ea b3 9a c9 dc d0\ +b1 55 0b 37 29 d8 70 68 e9 52 00 9d f5 44 53 4c\ +1f 50 82 9a 78 f4 59 1e b8 fd 57 14 04 26 a6 bb\ +04 05 b6 a6 f5 1a 57 d9 26 7b 7b bc 65 33 91 a6\ +99 a2 a9 0d ac 8a e2 26 bc c6 0f a8 cd 93 4c 73\ +c7 b0 3b 1f 6b 81 81 58 63 18 38 a8 61 2e 6e 6e\ +a9 2b e2 4f 83 24 fa f5 b1 fd 85 87 22 52 67 ba\ +6f +Prime1: \ +04 f0 54 8c 96 26 ab 1e bf 12 44 93 47 41 d9 9a\ +06 22 0e fa 2a 58 56 aa 0e 75 73 0b 2e c9 6a dc\ +86 be 89 4f a2 80 3b 53 a5 e8 5d 27 6a cb d2 9a\ +b8 23 f8 0a 73 91 bb 54 a5 05 16 72 fb 04 ee b5\ +43 +Prime2: \ +04 83 e0 ae 47 91 55 87 74 3f f3 45 36 2b 55 5d\ +39 62 d9 8b b6 f1 5f 84 8b 4c 92 b1 77 1c a8 ed\ +10 7d 8d 3e e6 5e c4 45 17 dd 0f aa 48 1a 38 7e\ +90 2f 7a 2e 74 7c 26 9e 7e a4 44 80 bc 53 8b 8e\ +5b +ModPrime1PrivateExponent: \ +03 a8 e8 ae a9 92 0c 1a a3 b2 f0 d8 46 e4 b8 50\ +d8 1c a3 06 a5 1c 83 54 4f 94 9f 64 f9 0d cf 3f\ +8e 26 61 f0 7e 56 12 20 a1 80 38 8f be 27 3e 70\ +e2 e5 dc a8 3a 0e 13 48 dd 64 90 c7 31 d6 ec e1\ +ab +ModPrime2PrivateExponent: \ +01 35 bd cd b6 0b f2 19 7c 43 6e d3 4b 32 cd 8b\ +4f c7 77 78 83 2b a7 67 03 55 1f b2 42 b3 01 69\ +95 93 af 77 fd 8f c3 94 a8 52 6a d2 3c c4 1a 03\ +80 6b d8 97 fe 4b 0e a6 46 55 8a ad dc c9 9e 8a\ +25 +MultiplicativeInverseOfPrime2ModPrime1: \ +03 04 c0 3d 9c 73 65 03 a9 84 ab bd 9b a2 23 01\ +40 7c 4a 2a b1 dd 85 76 64 81 b6 0d 45 40 11 52\ +e6 92 be 14 f4 12 1d 9a a3 fd 6e 0b 4d 1d 3a 97\ +35 38 a3 1d 42 ee 6e 1e 5e f6 20 23 1a 2b ba f3\ +5f +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 6.1 +Message: \ +0a 20 b7 74 ad dc 2f a5 12 45 ed 7c b9 da 60 9e\ +50 ca c6 63 6a 52 54 3f 97 45 8e ed 73 40 f8 d5\ +3f fc 64 91 8f 94 90 78 ee 03 ef 60 d4 2b 5f ec\ +24 60 50 bd 55 05 cd 8c b5 97 ba d3 c4 e7 13 b0\ +ef 30 64 4e 76 ad ab b0 de 01 a1 56 1e fb 25 51\ +58 c7 4f c8 01 e6 e9 19 e5 81 b4 6f 0f 0d dd 08\ +e4 f3 4c 78 10 b5 ed 83 18 f9 1d 7c 8c +Salt: \ +5b 4e a2 ef 62 9c c2 2f 3b 53 8e 01 69 04 b4 7b\ +1e 40 bf d5 +Signature: \ +04 c0 cf ac ec 04 e5 ba db ec e1 59 a5 a1 10 3f\ +69 b3 f3 2b a5 93 cb 4c c4 b1 b7 ab 45 59 16 a9\ +6a 27 cd 26 78 ea 0f 46 ba 37 f7 fc 9c 86 32 5f\ +29 73 3b 38 9f 1d 97 f4 3e 72 01 c0 f3 48 fc 45\ +fe 42 89 23 35 36 2e ee 01 8b 5b 16 1f 2f 93 93\ +03 12 25 c7 13 01 2a 57 6b c8 8e 23 05 24 89 86\ +8d 90 10 cb f0 33 ec c5 68 e8 bc 15 2b dc 59 d5\ +60 e4 12 91 91 5d 28 56 52 08 e2 2a ee c9 ef 85\ +d1 +Test: Verify +Comment: RSASSA-PSS Signature Example 6.2 +Message: \ +2a af f6 63 1f 62 1c e6 15 76 0a 9e bc e9 4b b3\ +33 07 7a d8 64 88 c8 61 d4 b7 6d 29 c1 f4 87 46\ +c6 11 ae 1e 03 ce d4 44 5d 7c fa 1f e5 f6 2e 1b\ +3f 08 45 2b de 3b 6e f8 19 73 ba fb b5 7f 97 bc\ +ee f8 73 98 53 95 b8 26 05 89 aa 88 cb 7d b5 0a\ +b4 69 26 2e 55 1b dc d9 a5 6f 27 5a 0a c4 fe 48\ +47 00 c3 5f 3d bf 2b 46 9e de 86 47 41 b8 6f a5\ +91 72 a3 60 ba 95 a0 2e 13 9b e5 0d df b7 cf 0b\ +42 fa ea bb fb ba a8 6a 44 97 69 9c 4f 2d fd 5b\ +08 40 6a f7 e1 41 44 42 7c 25 3e c0 ef a2 0e af\ +9a 8b e8 cd 49 ce 1f 1b c4 e9 3e 61 9c f2 aa 8e\ +d4 fb 39 bc 85 90 d0 f7 b9 64 88 f7 31 7a c9 ab\ +f7 be e4 e3 a0 e7 15 +Salt: \ +83 14 6a 9e 78 27 22 c2 8b 01 4f 98 b4 26 7b da\ +2a c9 50 4f +Signature: \ +0a 23 14 25 0c f5 2b 6e 4e 90 8d e5 b3 56 46 bc\ +aa 24 36 1d a8 16 0f b0 f9 25 75 90 ab 3a ce 42\ +b0 dc 3e 77 ad 2d b7 c2 03 a2 0b d9 52 fb b5 6b\ +15 67 04 6e cf aa 93 3d 7b 10 00 c3 de 9f f0 5b\ +7d 98 9b a4 6f d4 3b c4 c2 d0 a3 98 6b 7f fa 13\ +47 1d 37 eb 5b 47 d6 47 07 bd 29 0c fd 6a 9f 39\ +3a d0 8e c1 e3 bd 71 bb 57 92 61 50 35 cd af 2d\ +89 29 ae d3 be 09 83 79 37 7e 77 7c e7 9a aa 47\ +73 +Test: Verify +Comment: RSASSA-PSS Signature Example 6.3 +Message: \ +0f 61 95 d0 4a 6e 6f c7 e2 c9 60 0d bf 84 0c 39\ +ea 8d 4d 62 4f d5 35 07 01 6b 0e 26 85 8a 5e 0a\ +ec d7 ad a5 43 ae 5c 0a b3 a6 25 99 cb a0 a5 4e\ +6b f4 46 e2 62 f9 89 97 8f 9d df 5e 9a 41 +Salt: \ +a8 7b 8a ed 07 d7 b8 e2 da f1 4d dc a4 ac 68 c4\ +d0 aa bf f8 +Signature: \ +08 6d f6 b5 00 09 8c 12 0f 24 ff 84 23 f7 27 d9\ +c6 1a 5c 90 07 d3 b6 a3 1c e7 cf 8f 3c be c1 a2\ +6b b2 0e 2b d4 a0 46 79 32 99 e0 3e 37 a2 1b 40\ +19 4f b0 45 f9 0b 18 bf 20 a4 79 92 cc d7 99 cf\ +9c 05 9c 29 9c 05 26 85 49 54 aa de 8a 6a d9 d9\ +7e c9 1a 11 45 38 3f 42 46 8b 23 1f 4d 72 f2 37\ +06 d9 85 3c 3f a4 3c e8 ac e8 bf e7 48 49 87 a1\ +ec 6a 16 c8 da f8 1f 7c 8b f4 27 74 70 7a 9d f4\ +56 +Test: Verify +Comment: RSASSA-PSS Signature Example 6.4 +Message: \ +33 7d 25 fe 98 10 eb ca 0d e4 d4 65 8d 3c eb 8e\ +0f e4 c0 66 ab a3 bc c4 8b 10 5d 3b f7 e0 25 7d\ +44 fe ce a6 59 6f 4d 0c 59 a0 84 02 83 36 78 f7\ +06 20 f9 13 8d fe b7 de d9 05 e4 a6 d5 f0 5c 47\ +3d 55 93 66 52 e2 a5 df 43 c0 cf da 7b ac af 30\ +87 f4 52 4b 06 cf 42 15 7d 01 53 97 39 f7 fd de\ +c9 d5 81 25 df 31 a3 2e ab 06 c1 9b 71 f1 d5 bf +Salt: \ +a3 79 32 f8 a7 49 4a 94 2d 6f 76 74 38 e7 24 d6\ +d0 c0 ef 18 +Signature: \ +0b 5b 11 ad 54 98 63 ff a9 c5 1a 14 a1 10 6c 2a\ +72 cc 8b 64 6e 5c 72 62 50 97 86 10 5a 98 47 76\ +53 4c a9 b5 4c 1c c6 4b f2 d5 a4 4f d7 e8 a6 9d\ +b6 99 d5 ea 52 08 7a 47 48 fd 2a bc 1a fe d1 e5\ +d6 f7 c8 90 25 53 0b da a2 21 3d 7e 03 0f a5 5d\ +f6 f3 4b cf 1c e4 6d 2e df 4e 3a e4 f3 b0 18 91\ +a0 68 c9 e3 a4 4b bc 43 13 3e da d6 ec b9 f3 54\ +00 c4 25 2a 57 62 d6 57 44 b9 9c b9 f4 c5 59 32\ +9f +Test: Verify +Comment: RSASSA-PSS Signature Example 6.5 +Message: \ +84 ec 50 2b 07 2e 82 87 78 9d 8f 92 35 82 9e a3\ +b1 87 af d4 d4 c7 85 61 1b da 5f 9e b3 cb 96 71\ +7e fa 70 07 22 7f 1c 08 cb cb 97 2e 66 72 35 e0\ +fb 7d 43 1a 65 70 32 6d 2e cc e3 5a db 37 3d c7\ +53 b3 be 5f 82 9b 89 17 54 93 19 3f ab 16 ba db\ +41 37 1b 3a ac 0a e6 70 07 6f 24 be f4 20 c1 35\ +ad d7 ce e8 d3 5f bc 94 4d 79 fa fb 9e 30 7a 13\ +b0 f5 56 cb 65 4a 06 f9 73 ed 22 67 23 30 19 7e\ +f5 a7 48 bf 82 6a 5d b2 38 3a 25 36 4b 68 6b 93\ +72 bb 23 39 ae b1 ac 9e 98 89 32 7d 01 6f 16 70\ +77 6d b0 62 01 ad bd ca f8 a5 e3 b7 4e 10 8b 73 +Salt: \ +7b 79 0c 1d 62 f7 b8 4e 94 df 6a f2 89 17 cf 57\ +10 18 11 0e +Signature: \ +02 d7 1f a9 b5 3e 46 54 fe fb 7f 08 38 5c f6 b0\ +ae 3a 81 79 42 eb f6 6c 35 ac 67 f0 b0 69 95 2a\ +3c e9 c7 e1 f1 b0 2e 48 0a 95 00 83 6d e5 d6 4c\ +db 7e cd e0 45 42 f7 a7 99 88 78 7e 24 c2 ba 05\ +f5 fd 48 2c 02 3e d5 c3 0e 04 83 9d c4 4b ed 2a\ +3a 3a 4f ee 01 11 3c 89 1a 47 d3 2e b8 02 5c 28\ +cb 05 0b 5c db 57 6c 70 fe 76 ef 52 34 05 c0 84\ +17 fa f3 50 b0 37 a4 3c 37 93 39 fc b1 8d 3a 35\ +6b +Test: Verify +Comment: RSASSA-PSS Signature Example 6.6 +Message: \ +99 06 d8 9f 97 a9 fd ed d3 cc d8 24 db 68 73 26\ +f3 0f 00 aa 25 a7 fc a2 af cb 3b 0f 86 cd 41 e7\ +3f 0e 8f f7 d2 d8 3f 59 e2 8e d3 1a 5a 0d 55 15\ +23 37 4d e2 2e 4c 7e 8f f5 68 b3 86 ee 3d c4 11\ +63 f1 0b f6 7b b0 06 26 1c 90 82 f9 af 90 bf 1d\ +90 49 a6 b9 fa e7 1c 7f 84 fb e6 e5 5f 02 78 9d\ +e7 74 f2 30 f1 15 02 6a 4b 4e 96 c5 5b 04 a9 5d\ +a3 aa cb b2 ce ce 8f 81 76 4a 1f 1c 99 51 54 11\ +08 7c f7 d3 4a ed ed 09 32 c1 83 +Salt: \ +fb be 05 90 25 b6 9b 89 fb 14 ae 22 89 e7 aa af\ +e6 0c 0f cd +Signature: \ +0a 40 a1 6e 2f e2 b3 8d 1d f9 05 46 16 7c f9 46\ +9c 9e 3c 36 81 a3 44 2b 4b 2c 2f 58 1d eb 38 5c\ +e9 9f c6 18 8b b0 2a 84 1d 56 e7 6d 30 18 91 e2\ +45 60 55 0f cc 2a 26 b5 5f 4c cb 26 d8 37 d3 50\ +a1 54 bc ac a8 39 2d 98 fa 67 95 9e 97 27 b7 8c\ +ad 03 26 9f 56 96 8f c5 6b 68 bd 67 99 26 d8 3c\ +c9 cb 21 55 50 64 5c cd a3 1c 76 0f f3 58 88 94\ +3d 2d 8a 1d 35 1e 81 e5 d0 7b 86 18 2e 75 10 81\ +ef +Test: Verify +Comment: Example 7: A 1030-bit RSA Key Pair +Modulus: \ +37 c9 da 4a 66 c8 c4 08 b8 da 27 d0 c9 d7 9f 8c\ +cb 1e af c1 d2 fe 48 74 6d 94 0b 7c 4e f5 de e1\ +8a d1 26 47 ce fa a0 c4 b3 18 8b 22 1c 51 53 86\ +75 9b 93 f0 20 24 b2 5a b9 24 2f 83 57 d8 f3 fd\ +49 64 0e e5 e6 43 ea f6 c6 4d ee fa 70 89 72 7c\ +8f f0 39 93 33 39 15 c6 ef 21 bf 59 75 b6 e5 0d\ +11 8b 51 00 8e c3 3e 9f 01 a0 a5 45 a1 0a 83 6a\ +43 dd bc a9 d8 b5 c5 d3 54 80 22 d7 06 4e a2 9a\ +b3 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +3b ed 99 90 52 d9 57 bc 06 d6 51 ee f6 e3 a9 80\ +94 b1 62 1b d3 8b 54 49 bd 6c 4a ea 3d e7 e0 84\ +67 9a 44 84 de d2 5b e0 f0 82 6c f3 37 78 25 41\ +4b 14 d4 d6 1d b1 4d e6 26 fb b8 0e 5f 4f ae c9\ +56 f9 a0 a2 d2 4f 99 57 63 80 f0 84 eb 62 e4 6a\ +57 d5 54 27 8b 53 56 26 19 3c e0 20 60 57 5e b6\ +6c 57 98 d3 6f 6c 5d 40 fb 00 d8 09 b4 2a 73 10\ +2c 1c 74 ee 95 bd 71 42 0f ff ef 63 18 b5 2c 29 +Prime1: \ +07 ee fb 42 4b 0e 3a 40 e4 20 8e e5 af b2 80 b2\ +23 17 30 81 14 dd e0 b4 b6 4f 73 01 84 ec 68 da\ +6c e2 86 7a 9f 48 ed 77 26 d5 e2 61 4e d0 4a 54\ +10 73 6c 8c 71 4e e7 02 47 42 98 c6 29 2a f0 75\ +35 +Prime2: \ +07 08 30 db f9 47 ea c0 22 8d e2 63 14 b5 9b 66\ +99 4c c6 0e 83 60 e7 5d 38 76 29 8f 8f 8a 7d 14\ +1d a0 64 e5 ca 02 6a 97 3e 28 f2 54 73 8c ee 66\ +9c 72 1b 03 4c b5 f8 e2 44 da dd 7c d1 e1 59 d5\ +47 +ModPrime1PrivateExponent: \ +05 24 d2 0c 3d 95 cf f7 5a f2 31 34 83 22 7d 87\ +02 71 7a a5 76 de 15 5f 96 05 15 50 1a db 1d 70\ +e1 c0 4d e9 1b 75 b1 61 db f0 39 83 56 12 7e de\ +da 7b bc 19 a3 2d c1 62 1c c9 f5 3c 26 5d 0c e3\ +31 +ModPrime2PrivateExponent: \ +05 f9 84 a1 f2 3c 93 8d 6a 0e 89 72 4b cf 3d d9\ +3f 99 46 92 60 37 fe 7c 6b 13 a2 9e 52 84 85 5f\ +89 08 95 91 d4 40 97 56 27 bf 5c 9e 3a 8b 5c a7\ +9c 77 2a d2 73 e4 0d 32 1a f4 a6 c9 7d fd ed 78\ +d3 +MultiplicativeInverseOfPrime2ModPrime1: \ +dd d9 18 ad ad a2 9d ca b9 81 ff 9a cb a4 25 70\ +23 c0 9a 38 01 cc ce 09 8c e2 68 f8 55 d0 df 57\ +0c d6 e7 b9 b1 4b d9 a5 a9 25 4c bc 31 5b e6 f8\ +ba 1e 25 46 dd d5 69 c5 ea 19 ee d8 35 3b de 5e +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 7.1 +Message: \ +9e ad 0e 01 94 56 40 67 4e b4 1c ad 43 5e 23 74\ +ea ef a8 ad 71 97 d9 79 13 c4 49 57 d8 d8 3f 40\ +d7 6e e6 0e 39 bf 9c 0f 9e af 30 21 42 1a 07 4d\ +1a de 96 2c 6e 9d 3d c3 bb 17 4f e4 df e6 52 b0\ +91 15 49 5b 8f d2 79 41 74 02 0a 06 02 b5 ca 51\ +84 8c fc 96 ce 5e b5 7f c0 a2 ad c1 dd a3 6a 7c\ +c4 52 64 1a 14 91 1b 37 e4 5b fa 11 da a5 c7 ec\ +db 74 f6 d0 10 0d 1d 3e 39 e7 52 80 0e 20 33 97\ +de 02 33 07 7b 9a 88 85 55 37 fa e9 27 f9 24 38\ +0d 78 0f 98 e1 8d cf f3 9c 5e a7 41 b1 7d 6f dd\ +18 85 bc 9d 58 14 82 d7 71 ce b5 62 d7 8a 8b f8\ +8f 0c 75 b1 13 63 e5 e3 6c d4 79 ce b0 54 5f 9d\ +a8 42 03 e0 e6 e5 08 37 5c c9 e8 44 b8 8b 7a c7\ +a0 a2 01 ea 0f 1b ee 9a 2c 57 79 20 ca 02 c0 1b\ +9d 83 20 e9 74 a5 6f 4e fb 57 63 b9 62 55 ab bf\ +80 37 bf 18 02 cf 01 8f 56 37 94 93 e5 69 a9 +Salt: \ +b7 86 7a 59 95 8c b5 43 28 f8 77 5e 65 46 ec 06\ +d2 7e aa 50 +Signature: \ +18 7f 39 07 23 c8 90 25 91 f0 15 4b ae 6d 4e cb\ +ff e0 67 f0 e8 b7 95 47 6e a4 f4 d5 1c cc 81 05\ +20 bb 3c a9 bc a7 d0 b1 f2 ea 8a 17 d8 73 fa 27\ +57 0a cd 64 2e 38 08 56 1c b9 e9 75 cc fd 80 b2\ +3d c5 77 1c db 33 06 a5 f2 31 59 da cb d3 aa 2d\ +b9 3d 46 d7 66 e0 9e d1 5d 90 0a d8 97 a8 d2 74\ +dc 26 b4 7e 99 4a 27 e9 7e 22 68 a7 66 53 3a e4\ +b5 e4 2a 2f ca f7 55 c1 c4 79 4b 29 4c 60 55 58\ +23 +Test: Verify +Comment: RSASSA-PSS Signature Example 7.2 +Message: \ +8d 80 d2 d0 8d bd 19 c1 54 df 3f 14 67 3a 14 bd\ +03 73 52 31 f2 4e 86 bf 15 3d 0e 69 e7 4c bf f7\ +b1 83 6e 66 4d e8 3f 68 01 24 37 0f c0 f9 6c 9b\ +65 c0 7a 36 6b 64 4c 4a b3 +Salt: \ +0c 09 58 22 66 df 08 63 10 82 1b a7 e1 8d f6 4d\ +fe e6 de 09 +Signature: \ +10 fd 89 76 8a 60 a6 77 88 ab b5 85 6a 78 7c 85\ +61 f3 ed cf 9a 83 e8 98 f7 dc 87 ab 8c ce 79 42\ +9b 43 e5 69 06 94 1a 88 61 94 f1 37 e5 91 fe 7c\ +33 95 55 36 1f bb e1 f2 4f eb 2d 4b cd b8 06 01\ +f3 09 6b c9 13 2d ee a6 0a e1 30 82 f4 4f 9a d4\ +1c d6 28 93 6a 4d 51 17 6e 42 fc 59 cb 76 db 81\ +5c e5 ab 4d b9 9a 10 4a af ea 68 f5 d3 30 32 9e\ +bf 25 8d 4e de 16 06 4b d1 d0 03 93 d5 e1 57 0e\ +b8 +Test: Verify +Comment: RSASSA-PSS Signature Example 7.3 +Message: \ +80 84 05 cd fc 1a 58 b9 bb 03 97 c7 20 72 2a 81\ +ff fb 76 27 8f 33 59 17 ef 9c 47 38 14 b3 e0 16\ +ba 29 73 cd 27 65 f8 f3 f8 2d 6c c3 8a a7 f8 55\ +18 27 fe 8d 1e 38 84 b7 e6 1c 94 68 3b 8f 82 f1\ +84 3b da e2 25 7e ee c9 81 2a d4 c2 cf 28 3c 34\ +e0 b0 ae 0f e3 cb 99 0c f8 8f 2e f9 +Salt: \ +28 03 9d cf e1 06 d3 b8 29 66 11 25 8c 4a 56 65\ +1c 9e 92 dd +Signature: \ +2b 31 fd e9 98 59 b9 77 aa 09 58 6d 8e 27 46 62\ +b2 5a 2a 64 06 40 b4 57 f5 94 05 1c b1 e7 f7 a9\ +11 86 54 55 24 29 26 cf 88 fe 80 df a3 a7 5b a9\ +68 98 44 a1 1e 63 4a 82 b0 75 af bd 69 c1 2a 0d\ +f9 d2 5f 84 ad 49 45 df 3d c8 fe 90 c3 ce fd f2\ +6e 95 f0 53 43 04 b5 bd ba 20 d3 e5 64 0a 2e bf\ +b8 98 aa c3 5a e4 0f 26 fc e5 56 3c 2f 9f 24 f3\ +04 2a f7 6f 3c 70 72 d6 87 bb fb 95 9a 88 46 0a\ +f1 +Test: Verify +Comment: RSASSA-PSS Signature Example 7.4 +Message: \ +f3 37 b9 ba d9 37 de 22 a1 a0 52 df f1 11 34 a8\ +ce 26 97 62 02 98 19 39 b9 1e 07 15 ae 5e 60 96\ +49 da 1a df ce f3 f4 cc a5 9b 23 83 60 e7 d1 e4\ +96 c7 bf 4b 20 4b 5a cf f9 bb d6 16 6a 1d 87 a3\ +6e f2 24 73 73 75 10 39 f8 a8 00 b8 39 98 07 b3\ +a8 5f 44 89 34 97 c0 d0 5f b7 01 7b 82 22 81 52\ +de 6f 25 e6 11 6d cc 75 03 c7 86 c8 75 c2 8f 3a\ +a6 07 e9 4a b0 f1 98 63 ab 1b 50 73 77 0b 0c d5\ +f5 33 ac de 30 c6 fb 95 3c f3 da 68 02 64 e3 0f\ +c1 1b ff 9a 19 bf fa b4 77 9b 62 23 c3 fb 3f e0\ +f7 1a ba de 4e b7 c0 9c 41 e2 4c 22 d2 3f a1 48\ +e6 a1 73 fe b6 39 84 d1 bc 6e e3 a0 2d 91 5b 75\ +2c ea f9 2a 30 15 ec eb 38 ca 58 6c 68 01 b3 7c\ +34 ce fb 2c ff 25 ea 23 c0 86 62 dc ab 26 a7 a9\ +3a 28 5d 05 d3 04 4c +Salt: \ +a7 78 21 eb bb ef 24 62 8e 4e 12 e1 d0 ea 96 de\ +39 8f 7b 0f +Signature: \ +32 c7 ca 38 ff 26 94 9a 15 00 0c 4b a0 4b 2b 13\ +b3 5a 38 10 e5 68 18 4d 7e ca ba a1 66 b7 ff ab\ +dd f2 b6 cf 4b a0 71 24 92 37 90 f2 e5 b1 a5 be\ +04 0a ea 36 fe 13 2e c1 30 e1 f1 05 67 98 2d 17\ +ac 3e 89 b8 d2 6c 30 94 03 4e 76 2d 2e 03 12 64\ +f0 11 70 be ec b3 d1 43 9e 05 84 6f 25 45 83 67\ +a7 d9 c0 20 60 44 46 72 67 1e 64 e8 77 86 45 59\ +ca 19 b2 07 4d 58 8a 28 1b 58 04 d2 37 72 fb be\ +19 +Test: Verify +Comment: RSASSA-PSS Signature Example 7.5 +Message: \ +45 01 3c eb af d9 60 b2 55 47 6a 8e 25 98 b9 aa\ +32 ef be 6d c1 f3 4f 4a 49 8d 8c f5 a2 b4 54 8d\ +08 c5 5d 5f 95 f7 bc c9 61 91 63 05 6f 2d 58 b5\ +2f a0 32 +Salt: \ +9d 5a d8 eb 45 21 34 b6 5d c3 a9 8b 6a 73 b5 f7\ +41 60 9c d6 +Signature: \ +07 eb 65 1d 75 f1 b5 2b c2 63 b2 e1 98 33 6e 99\ +fb eb c4 f3 32 04 9a 92 2a 10 81 56 07 ee 2d 98\ +9d b3 a4 49 5b 7d cc d3 8f 58 a2 11 fb 7e 19 31\ +71 a3 d8 91 13 24 37 eb ca 44 f3 18 b2 80 50 9e\ +52 b5 fa 98 fc ce 82 05 d9 69 7c 8e e4 b7 ff 59\ +d4 c5 9c 79 03 8a 19 70 bd 2a 0d 45 1e cd c5 ef\ +11 d9 97 9c 9d 35 f8 c7 0a 61 63 71 76 07 89 0d\ +58 6a 7c 6d c0 1c 79 f8 6a 8f 28 e8 52 35 f8 c2\ +f1 +Test: Verify +Comment: RSASSA-PSS Signature Example 7.6 +Message: \ +23 58 09 70 86 c8 99 32 3e 75 d9 c9 0d 0c 09 f1\ +2d 9d 54 ed fb df 70 a9 c2 eb 5a 04 d8 f3 6b 9b\ +2b df 2a ab e0 a5 bd a1 96 89 37 f9 d6 eb d3 b6\ +b2 57 ef b3 13 6d 41 31 f9 ac b5 9b 85 e2 60 2c\ +2a 3f cd c8 35 49 4a 1f 4e 5e c1 8b 22 6c 80 23\ +2b 36 a7 5a 45 fd f0 9a 7e a9 e9 8e fb de 14 50\ +d1 19 4b f1 2e 15 a4 c5 f9 eb 5c 0b ce 52 69 e0\ +c3 b2 8c fa b6 55 d8 1a 61 a2 0b 4b e2 f5 44 59\ +bb 25 a0 db 94 c5 22 18 be 10 9a 74 26 de 83 01\ +44 24 78 9a aa 90 e5 05 6e 63 2a 69 81 15 e2 82\ +c1 a5 64 10 f2 6c 20 72 f1 93 48 1a 9d cd 88 05\ +72 00 5e 64 f4 08 2e cf +Salt: \ +3f 2e fc 59 58 80 a7 d4 7f cf 3c ba 04 98 3e a5\ +4c 4b 73 fb +Signature: \ +18 da 3c dc fe 79 bf b7 7f d9 c3 2f 37 7a d3 99\ +14 6f 0a 8e 81 06 20 23 32 71 a6 e3 ed 32 48 90\ +3f 5c dc 92 dc 79 b5 5d 3e 11 61 5a a0 56 a7 95\ +85 37 92 a3 99 8c 34 9c a5 c4 57 e8 ca 7d 29 d7\ +96 aa 24 f8 34 91 70 9b ef cf b1 51 0e a5 13 c9\ +28 29 a3 f0 0b 10 4f 65 56 34 f3 20 75 2e 13 0e\ +c0 cc f6 75 4f f8 93 db 30 29 32 bb 02 5e b6 0e\ +87 82 25 98 fc 61 9e 0e 98 17 37 a9 a4 c4 15 2d\ +33 +Test: Verify +Comment: Example 8: A 1031-bit RSA Key Pair +Modulus: \ +49 53 70 a1 fb 18 54 3c 16 d3 63 1e 31 63 25 5d\ +f6 2b e6 ee e8 90 d5 f2 55 09 e4 f7 78 a8 ea 6f\ +bb bc df 85 df f6 4e 0d 97 20 03 ab 36 81 fb ba\ +6d d4 1f d5 41 82 9b 2e 58 2d e9 f2 a4 a4 e0 a2\ +d0 90 0b ef 47 53 db 3c ee 0e e0 6c 7d fa e8 b1\ +d5 3b 59 53 21 8f 9c ce ea 69 5b 08 66 8e de aa\ +dc ed 94 63 b1 d7 90 d5 eb f2 7e 91 15 b4 6c ad\ +4d 9a 2b 8e fa b0 56 1b 08 10 34 47 39 ad a0 73\ +3f +PublicExponent: \ +01 00 01 +PrivateExponent: \ +6c 66 ff e9 89 80 c3 8f cd ea b5 15 98 98 83 61\ +65 f4 b4 b8 17 c4 f6 a8 d4 86 ee 4e a9 13 0f e9\ +b9 09 2b d1 36 d1 84 f9 5f 50 4a 60 7e ac 56 58\ +46 d2 fd d6 59 7a 89 67 c7 39 6e f9 5a 6e ee bb\ +45 78 a6 43 96 6d ca 4d 8e e3 de 84 2d e6 32 79\ +c6 18 15 9c 1a b5 4a 89 43 7b 6a 61 20 e4 93 0a\ +fb 52 a4 ba 6c ed 8a 49 47 ac 64 b3 0a 34 97 cb\ +e7 01 c2 d6 26 6d 51 72 19 ad 0e c6 d3 47 db e9 +Prime1: \ +08 da d7 f1 13 63 fa a6 23 d5 d6 d5 e8 a3 19 32\ +8d 82 19 0d 71 27 d2 84 6c 43 9b 0a b7 26 19 b0\ +a4 3a 95 32 0e 4e c3 4f c3 a9 ce a8 76 42 23 05\ +bd 76 c5 ba 7b e9 e2 f4 10 c8 06 06 45 a1 d2 9e\ +db +Prime2: \ +08 47 e7 32 37 6f c7 90 0f 89 8e a8 2e b2 b0 fc\ +41 85 65 fd ae 62 f7 d9 ec 4c e2 21 7b 97 99 0d\ +d2 72 db 15 7f 99 f6 3c 0d cb b9 fb ac db d4 c4\ +da db 6d f6 77 56 35 8c a4 17 48 25 b4 8f 49 70\ +6d +ModPrime1PrivateExponent: \ +05 c2 a8 3c 12 4b 36 21 a2 aa 57 ea 2c 3e fe 03\ +5e ff 45 60 f3 3d de bb 7a da b8 1f ce 69 a0 c8\ +c2 ed c1 65 20 dd a8 3d 59 a2 3b e8 67 96 3a c6\ +5f 2c c7 10 bb cf b9 6e e1 03 de b7 71 d1 05 fd\ +85 +ModPrime2PrivateExponent: \ +04 ca e8 aa 0d 9f aa 16 5c 87 b6 82 ec 14 0b 8e\ +d3 b5 0b 24 59 4b 7a 3b 2c 22 0b 36 69 bb 81 9f\ +98 4f 55 31 0a 1a e7 82 36 51 d4 a0 2e 99 44 79\ +72 59 51 39 36 34 34 e5 e3 0a 7e 7d 24 15 51 e1\ +b9 +MultiplicativeInverseOfPrime2ModPrime1: \ +07 d3 e4 7b f6 86 60 0b 11 ac 28 3c e8 8d bb 3f\ +60 51 e8 ef d0 46 80 e4 4c 17 1e f5 31 b8 0b 2b\ +7c 39 fc 76 63 20 e2 cf 15 d8 d9 98 20 e9 6f f3\ +0d c6 96 91 83 9c 4b 40 d7 b0 6e 45 30 7d c9 1f\ +3f +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 8.1 +Message: \ +81 33 2f 4b e6 29 48 41 5e a1 d8 99 79 2e ea cf\ +6c 6e 1d b1 da 8b e1 3b 5c ea 41 db 2f ed 46 70\ +92 e1 ff 39 89 14 c7 14 25 97 75 f5 95 f8 54 7f\ +73 56 92 a5 75 e6 92 3a f7 8f 22 c6 99 7d db 90\ +fb 6f 72 d7 bb 0d d5 74 4a 31 de cd 3d c3 68 58\ +49 83 6e d3 4a ec 59 63 04 ad 11 84 3c 4f 88 48\ +9f 20 97 35 f5 fb 7f da f7 ce c8 ad dc 58 18 16\ +8f 88 0a cb f4 90 d5 10 05 b7 a8 e8 4e 43 e5 42\ +87 97 75 71 dd 99 ee a4 b1 61 eb 2d f1 f5 10 8f\ +12 a4 14 2a 83 32 2e db 05 a7 54 87 a3 43 5c 9a\ +78 ce 53 ed 93 bc 55 08 57 d7 a9 fb +Salt: \ +1d 65 49 1d 79 c8 64 b3 73 00 9b e6 f6 f2 46 7b\ +ac 4c 78 fa +Signature: \ +02 62 ac 25 4b fa 77 f3 c1 ac a2 2c 51 79 f8 f0\ +40 42 2b 3c 5b af d4 0a 8f 21 cf 0f a5 a6 67 cc\ +d5 99 3d 42 db af b4 09 c5 20 e2 5f ce 2b 1e e1\ +e7 16 57 7f 1e fa 17 f3 da 28 05 2f 40 f0 41 9b\ +23 10 6d 78 45 aa f0 11 25 b6 98 e7 a4 df e9 2d\ +39 67 bb 00 c4 d0 d3 5b a3 55 2a b9 a8 b3 ee f0\ +7c 7f ec db c5 42 4a c4 db 1e 20 cb 37 d0 b2 74\ +47 69 94 0e a9 07 e1 7f bb ca 67 3b 20 52 23 80\ +c5 +Test: Verify +Comment: RSASSA-PSS Signature Example 8.2 +Message: \ +e2 f9 6e af 0e 05 e7 ba 32 6e cc a0 ba 7f d2 f7\ +c0 23 56 f3 ce de 9d 0f aa bf 4f cc 8e 60 a9 73\ +e5 59 5f d9 ea 08 +Salt: \ +43 5c 09 8a a9 90 9e b2 37 7f 12 48 b0 91 b6 89\ +87 ff 18 38 +Signature: \ +27 07 b9 ad 51 15 c5 8c 94 e9 32 e8 ec 0a 28 0f\ +56 33 9e 44 a1 b5 8d 4d dc ff 2f 31 2e 5f 34 dc\ +fe 39 e8 9c 6a 94 dc ee 86 db bd ae 5b 79 ba 4e\ +08 19 a9 e7 bf d9 d9 82 e7 ee 6c 86 ee 68 39 6e\ +8b 3a 14 c9 c8 f3 4b 17 8e b7 41 f9 d3 f1 21 10\ +9b f5 c8 17 2f ad a2 e7 68 f9 ea 14 33 03 2c 00\ +4a 8a a0 7e b9 90 00 0a 48 dc 94 c8 ba c8 aa be\ +2b 09 b1 aa 46 c0 a2 aa 0e 12 f6 3f bb a7 75 ba\ +7e +Test: Verify +Comment: RSASSA-PSS Signature Example 8.3 +Message: \ +e3 5c 6e d9 8f 64 a6 d5 a6 48 fc ab 8a db 16 33\ +1d b3 2e 5d 15 c7 4a 40 ed f9 4c 3d c4 a4 de 79\ +2d 19 08 89 f2 0f 1e 24 ed 12 05 4a 6b 28 79 8f\ +cb 42 d1 c5 48 76 9b 73 4c 96 37 31 42 09 2a ed\ +27 76 03 f4 73 8d f4 dc 14 46 58 6d 0e c6 4d a4\ +fb 60 53 6d b2 ae 17 fc 7e 3c 04 bb fb bb d9 07\ +bf 11 7c 08 63 6f a1 6f 95 f5 1a 62 16 93 4d 3e\ +34 f8 50 30 f1 7b bb c5 ba 69 14 40 58 af f0 81\ +e0 b1 9c f0 3c 17 19 5c 5e 88 8b a5 8f 6f e0 a0\ +2e 5c 3b da 97 19 a7 +Salt: \ +c6 eb be 76 df 0c 4a ea 32 c4 74 17 5b 2f 13 68\ +62 d0 45 29 +Signature: \ +2a d2 05 09 d7 8c f2 6d 1b 6c 40 61 46 08 6e 4b\ +0c 91 a9 1c 2b d1 64 c8 7b 96 6b 8f aa 42 aa 0c\ +a4 46 02 23 23 ba 4b 1a 1b 89 70 6d 7f 4c 3b e5\ +7d 7b 69 70 2d 16 8a b5 95 5e e2 90 35 6b 8c 4a\ +29 ed 46 7d 54 7e c2 3c ba df 28 6c cb 58 63 c6\ +67 9d a4 67 fc 93 24 a1 51 c7 ec 55 aa c6 db 40\ +84 f8 27 26 82 5c fe 1a a4 21 bc 64 04 9f b4 2f\ +23 14 8f 9c 25 b2 dc 30 04 37 c3 8d 42 8a a7 5f\ +96 +Test: Verify +Comment: RSASSA-PSS Signature Example 8.4 +Message: \ +db c5 f7 50 a7 a1 4b e2 b9 3e 83 8d 18 d1 4a 86\ +95 e5 2e 8a dd 9c 0a c7 33 b8 f5 6d 27 47 e5 29\ +a0 cc a5 32 dd 49 b9 02 ae fe d5 14 44 7f 9e 81\ +d1 61 95 c2 85 38 68 cb 9b 30 f7 d0 d4 95 c6 9d\ +01 b5 c5 d5 0b 27 04 5d b3 86 6c 23 24 a4 4a 11\ +0b 17 17 74 6d e4 57 d1 c8 c4 5c 3c d2 a9 29 70\ +c3 d5 96 32 05 5d 4c 98 a4 1d 6e 99 e2 a3 dd d5\ +f7 f9 97 9a b3 cd 18 f3 75 05 d2 51 41 de 2a 1b\ +ff 17 b3 a7 dc e9 41 9e cc 38 5c f1 1d 72 84 0f\ +19 95 3f d0 50 92 51 f6 ca fd e2 89 3d 0e 75 c7\ +81 ba 7a 50 12 ca 40 1a 4f a9 9e 04 b3 c3 24 9f\ +92 6d 5a fe 82 cc 87 da b2 2c 3c 1b 10 5d e4 8e\ +34 ac e9 c9 12 4e 59 59 7a c7 eb f8 +Salt: \ +02 1f dc c6 eb b5 e1 9b 1c b1 6e 9c 67 f2 76 81\ +65 7f e2 0a +Signature: \ +1e 24 e6 e5 86 28 e5 17 50 44 a9 eb 6d 83 7d 48\ +af 12 60 b0 52 0e 87 32 7d e7 89 7e e4 d5 b9 f0\ +df 0b e3 e0 9e d4 de a8 c1 45 4f f3 42 3b b0 8e\ +17 93 24 5a 9d f8 bf 6a b3 96 8c 8e dd c3 b5 32\ +85 71 c7 7f 09 1c c5 78 57 69 12 df eb d1 64 b9\ +de 54 54 fe 0b e1 c1 f6 38 5b 32 83 60 ce 67 ec\ +7a 05 f6 e3 0e b4 5c 17 c4 8a c7 00 41 d2 ca b6\ +7f 0a 2a e7 aa fd cc 8d 24 5e a3 44 2a 63 00 cc\ +c7 +Test: Verify +Comment: RSASSA-PSS Signature Example 8.5 +Message: \ +04 dc 25 1b e7 2e 88 e5 72 34 85 b6 38 3a 63 7e\ +2f ef e0 76 60 c5 19 a5 60 b8 bc 18 bd ed b8 6e\ +ae 23 64 ea 53 ba 9d ca 6e b3 d2 e7 d6 b8 06 af\ +42 b3 e8 7f 29 1b 4a 88 81 d5 bf 57 2c c9 a8 5e\ +19 c8 6a cb 28 f0 98 f9 da 03 83 c5 66 d3 c0 f5\ +8c fd 8f 39 5d cf 60 2e 5c d4 0e 8c 71 83 f7 14\ +99 6e 22 97 ef +Salt: \ +c5 58 d7 16 7c bb 45 08 ad a0 42 97 1e 71 b1 37\ +7e ea 42 69 +Signature: \ +33 34 1b a3 57 6a 13 0a 50 e2 a5 cf 86 79 22 43\ +88 d5 69 3f 5a cc c2 35 ac 95 ad d6 8e 5e b1 ee\ +c3 16 66 d0 ca 7a 1c da 6f 70 a1 aa 76 2c 05 75\ +2a 51 95 0c db 8a f3 c5 37 9f 18 cf e6 b5 bc 55\ +a4 64 82 26 a1 5e 91 2e f1 9a d7 7a de ea 91 1d\ +67 cf ef d6 9b a4 3f a4 11 91 35 ff 64 21 17 ba\ +98 5a 7e 01 00 32 5e 95 19 f1 ca 6a 92 16 bd a0\ +55 b5 78 50 15 29 11 25 e9 0d cd 07 a2 ca 96 73\ +ee +Test: Verify +Comment: RSASSA-PSS Signature Example 8.6 +Message: \ +0e a3 7d f9 a6 fe a4 a8 b6 10 37 3c 24 cf 39 0c\ +20 fa 6e 21 35 c4 00 c8 a3 4f 5c 18 3a 7e 8e a4\ +c9 ae 09 0e d3 17 59 f4 2d c7 77 19 cc a4 00 ec\ +dc c5 17 ac fc 7a c6 90 26 75 b2 ef 30 c5 09 66\ +5f 33 21 48 2f c6 9a 9f b5 70 d1 5e 01 c8 45 d0\ +d8 e5 0d 2a 24 cb f1 cf 0e 71 49 75 a5 db 7b 18\ +d9 e9 e9 cb 91 b5 cb 16 86 90 60 ed 18 b7 b5 62\ +45 50 3f 0c af 90 35 2b 8d e8 1c b5 a1 d9 c6 33\ +60 92 f0 cd +Salt: \ +76 fd 4e 64 fd c9 8e b9 27 a0 40 3e 35 a0 84 e7\ +6b a9 f9 2a +Signature: \ +1e d1 d8 48 fb 1e db 44 12 9b d9 b3 54 79 5a f9\ +7a 06 9a 7a 00 d0 15 10 48 59 3e 0c 72 c3 51 7f\ +f9 ff 2a 41 d0 cb 5a 0a c8 60 d7 36 a1 99 70 4f\ +7c b6 a5 39 86 a8 8b bd 8a bc c0 07 6a 2c e8 47\ +88 00 31 52 5d 44 9d a2 ac 78 35 63 74 c5 36 e3\ +43 fa a7 cb a4 2a 5a aa 65 06 08 77 91 c0 6a 8e\ +98 93 35 ae d1 9b fa b2 d5 e6 7e 27 fb 0c 28 75\ +af 89 6c 21 b6 e8 e7 30 9d 04 e4 f6 72 7e 69 46\ +3e +Test: Verify +Comment: Example 9: A 1536-bit RSA Key Pair +Modulus: \ +e6 bd 69 2a c9 66 45 79 04 03 fd d0 f5 be b8 b9\ +bf 92 ed 10 00 7f c3 65 04 64 19 dd 06 c0 5c 5b\ +5b 2f 48 ec f9 89 e4 ce 26 91 09 97 9c bb 40 b4\ +a0 ad 24 d2 24 83 d1 ee 31 5a d4 cc b1 53 42 68\ +35 26 91 c5 24 f6 dd 8e 6c 29 d2 24 cf 24 69 73\ +ae c8 6c 5b f6 b1 40 1a 85 0d 1b 9a d1 bb 8c bc\ +ec 47 b0 6f 0f 8c 7f 45 d3 fc 8f 31 92 99 c5 43\ +3d db c2 b3 05 3b 47 de d2 ec d4 a4 ca ef d6 14\ +83 3d c8 bb 62 2f 31 7e d0 76 b8 05 7f e8 de 3f\ +84 48 0a d5 e8 3e 4a 61 90 4a 4f 24 8f b3 97 02\ +73 57 e1 d3 0e 46 31 39 81 5c 6f d4 fd 5a c5 b8\ +17 2a 45 23 0e cb 63 18 a0 4f 14 55 d8 4e 5a 8b +PublicExponent: \ +01 00 01 +PrivateExponent: \ +6a 7f d8 4f b8 5f ad 07 3b 34 40 6d b7 4f 8d 61\ +a6 ab c1 21 96 a9 61 dd 79 56 5e 9d a6 e5 18 7b\ +ce 2d 98 02 50 f7 35 95 75 35 92 70 d9 15 90 bb\ +0e 42 7c 71 46 0b 55 d5 14 10 b1 91 bc f3 09 fe\ +a1 31 a9 2c 8e 70 27 38 fa 71 9f 1e 00 41 f5 2e\ +40 e9 1f 22 9f 4d 96 a1 e6 f1 72 e1 55 96 b4 51\ +0a 6d ae c2 61 05 f2 be bc 53 31 6b 87 bd f2 13\ +11 66 60 70 e8 df ee 69 d5 2c 71 a9 76 ca ae 79\ +c7 2b 68 d2 85 80 dc 68 6d 9f 51 29 d2 25 f8 2b\ +3d 61 55 13 a8 82 b3 db 91 41 6b 48 ce 08 88 82\ +13 e3 7e eb 9a f8 00 d8 1c ab 32 8c e4 20 68 99\ +03 c0 0c 7b 5f d3 1b 75 50 3a 6d 41 96 84 d6 29 +Prime1: \ +f8 eb 97 e9 8d f1 26 64 ee fd b7 61 59 6a 69 dd\ +cd 0e 76 da ec e6 ed 4b f5 a1 b5 0a c0 86 f7 92\ +8a 4d 2f 87 26 a7 7e 51 5b 74 da 41 98 8f 22 0b\ +1c c8 7a a1 fc 81 0c e9 9a 82 f2 d1 ce 82 1e dc\ +ed 79 4c 69 41 f4 2c 7a 1a 0b 8c 4d 28 c7 5e c6\ +0b 65 22 79 f6 15 4a 76 2a ed 16 5d 47 de e3 67 +Prime2: \ +ed 4d 71 d0 a6 e2 4b 93 c2 e5 f6 b4 bb e0 5f 5f\ +b0 af a0 42 d2 04 fe 33 78 d3 65 c2 f2 88 b6 a8\ +da d7 ef e4 5d 15 3e ef 40 ca cc 7b 81 ff 93 40\ +02 d1 08 99 4b 94 a5 e4 72 8c d9 c9 63 37 5a e4\ +99 65 bd a5 5c bf 0e fe d8 d6 55 3b 40 27 f2 d8\ +62 08 a6 e6 b4 89 c1 76 12 80 92 d6 29 e4 9d 3d +ModPrime1PrivateExponent: \ +2b b6 8b dd fb 0c 4f 56 c8 55 8b ff af 89 2d 80\ +43 03 78 41 e7 fa 81 cf a6 1a 38 c5 e3 9b 90 1c\ +8e e7 11 22 a5 da 22 27 bd 6c de eb 48 14 52 c1\ +2a d3 d6 1d 5e 4f 77 6a 0a b5 56 59 1b ef e3 e5\ +9e 5a 7f dd b8 34 5e 1f 2f 35 b9 f4 ce e5 7c 32\ +41 4c 08 6a ec 99 3e 93 53 e4 80 d9 ee c6 28 9f +ModPrime2PrivateExponent: \ +4f f8 97 70 9f ad 07 97 46 49 45 78 e7 0f d8 54\ +61 30 ee ab 56 27 c4 9b 08 0f 05 ee 4a d9 f3 e4\ +b7 cb a9 d6 a5 df f1 13 a4 1c 34 09 33 68 33 f1\ +90 81 6d 8a 6b c4 2e 9b ec 56 b7 56 7d 0f 3c 9c\ +69 6d b6 19 b2 45 d9 01 dd 85 6d b7 c8 09 2e 77\ +e9 a1 cc cd 56 ee 4d ba 42 c5 fd b6 1a ec 26 69 +MultiplicativeInverseOfPrime2ModPrime1: \ +77 b9 d1 13 7b 50 40 4a 98 27 29 31 6e fa fc 7d\ +fe 66 d3 4e 5a 18 26 00 d5 f3 0a 0a 85 12 05 1c\ +56 0d 08 1d 4d 0a 18 35 ec 3d 25 a6 0f 4e 4d 6a\ +a9 48 b2 bf 3d bb 5b 12 4c bb c3 48 92 55 a3 a9\ +48 37 2f 69 78 49 67 45 f9 43 e1 db 4f 18 38 2c\ +ea a5 05 df c6 57 57 bb 3f 85 7a 58 dc e5 21 56 +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 9.1 +Message: \ +a8 8e 26 58 55 e9 d7 ca 36 c6 87 95 f0 b3 1b 59\ +1c d6 58 7c 71 d0 60 a0 b3 f7 f3 ea ef 43 79 59\ +22 02 8b c2 b6 ad 46 7c fc 2d 7f 65 9c 53 85 aa\ +70 ba 36 72 cd de 4c fe 49 70 cc 79 04 60 1b 27\ +88 72 bf 51 32 1c 4a 97 2f 3c 95 57 0f 34 45 d4\ +f5 79 80 e0 f2 0d f5 48 46 e6 a5 2c 66 8f 12 88\ +c0 3f 95 00 6e a3 2f 56 2d 40 d5 2a f9 fe b3 2f\ +0f a0 6d b6 5b 58 8a 23 7b 34 e5 92 d5 5c f9 79\ +f9 03 a6 42 ef 64 d2 ed 54 2a a8 c7 7d c1 dd 76\ +2f 45 a5 93 03 ed 75 e5 41 ca 27 1e 2b 60 ca 70\ +9e 44 fa 06 61 13 1e 8d 5d 41 63 fd 8d 39 85 66\ +ce 26 de 87 30 e7 2f 9c ca 73 76 41 c2 44 15 94\ +20 63 70 28 df 0a 18 07 9d 62 08 ea 8b 47 11 a2\ +c7 50 f5 +Salt: \ +c0 a4 25 31 3d f8 d7 56 4b d2 43 4d 31 15 23 d5\ +25 7e ed 80 +Signature: \ +58 61 07 22 6c 3c e0 13 a7 c8 f0 4d 1a 6a 29 59\ +bb 4b 8e 20 5b a4 3a 27 b5 0f 12 41 11 bc 35 ef\ +58 9b 03 9f 59 32 18 7c b6 96 d7 d9 a3 2c 0c 38\ +30 0a 5c dd a4 83 4b 62 d2 eb 24 0a f3 3f 79 d1\ +3d fb f0 95 bf 59 9e 0d 96 86 94 8c 19 64 74 7b\ +67 e8 9c 9a ba 5c d8 50 16 23 6f 56 6c c5 80 2c\ +b1 3e ad 51 bc 7c a6 be f3 b9 4d cb db b1 d5 70\ +46 97 71 df 0e 00 b1 a8 a0 67 77 47 2d 23 16 27\ +9e da e8 64 74 66 8d 4e 1e ff f9 5f 1d e6 1c 60\ +20 da 32 ae 92 bb f1 65 20 fe f3 cf 4d 88 f6 11\ +21 f2 4b bd 9f e9 1b 59 ca f1 23 5b 2a 93 ff 81\ +fc 40 3a dd f4 eb de a8 49 34 a9 cd af 8e 1a 9e +Test: Verify +Comment: RSASSA-PSS Signature Example 9.2 +Message: \ +c8 c9 c6 af 04 ac da 41 4d 22 7e f2 3e 08 20 c3\ +73 2c 50 0d c8 72 75 e9 5b 0d 09 54 13 99 3c 26\ +58 bc 1d 98 85 81 ba 87 9c 2d 20 1f 14 cb 88 ce\ +d1 53 a0 19 69 a7 bf 0a 7b e7 9c 84 c1 48 6b c1\ +2b 3f a6 c5 98 71 b6 82 7c 8c e2 53 ca 5f ef a8\ +a8 c6 90 bf 32 6e 8e 37 cd b9 6d 90 a8 2e ba b6\ +9f 86 35 0e 18 22 e8 bd 53 6a 2e +Salt: \ +b3 07 c4 3b 48 50 a8 da c2 f1 5f 32 e3 78 39 ef\ +8c 5c 0e 91 +Signature: \ +80 b6 d6 43 25 52 09 f0 a4 56 76 38 97 ac 9e d2\ +59 d4 59 b4 9c 28 87 e5 88 2e cb 44 34 cf d6 6d\ +d7 e1 69 93 75 38 1e 51 cd 7f 55 4f 2c 27 17 04\ +b3 99 d4 2b 4b e2 54 0a 0e ca 61 95 1f 55 26 7f\ +7c 28 78 c1 22 84 2d ad b2 8b 01 bd 5f 8c 02 5f\ +7e 22 84 18 a6 73 c0 3d 6b c0 c7 36 d0 a2 95 46\ +bd 67 f7 86 d9 d6 92 cc ea 77 8d 71 d9 8c 20 63\ +b7 a7 10 92 18 7a 4d 35 af 10 81 11 d8 3e 83 ea\ +e4 6c 46 aa 34 27 7e 06 04 45 89 90 37 88 f1 d5\ +e7 ce e2 5f b4 85 e9 29 49 11 88 14 d6 f2 c3 ee\ +36 14 89 01 6f 32 7f b5 bc 51 7e b5 04 70 bf fa\ +1a fa 5f 4c e9 aa 0c e5 b8 ee 19 bf 55 01 b9 58 +Test: Verify +Comment: RSASSA-PSS Signature Example 9.3 +Message: \ +0a fa d4 2c cd 4f c6 06 54 a5 50 02 d2 28 f5 2a\ +4a 5f e0 3b 8b bb 08 ca 82 da ca 55 8b 44 db e1\ +26 6e 50 c0 e7 45 a3 6d 9d 29 04 e3 40 8a bc d1\ +fd 56 99 94 06 3f 4a 75 cc 72 f2 fe e2 a0 cd 89\ +3a 43 af 1c 5b 8b 48 7d f0 a7 16 10 02 4e 4f 6d\ +df 9f 28 ad 08 13 c1 aa b9 1b cb 3c 90 64 d5 ff\ +74 2d ef fe a6 57 09 41 39 36 9e 5e a6 f4 a9 63\ +19 a5 cc 82 24 14 5b 54 50 62 75 8f ef d1 fe 34\ +09 ae 16 92 59 c6 cd fd 6b 5f 29 58 e3 14 fa ec\ +be 69 d2 ca ce 58 ee 55 17 9a b9 b3 e6 d1 ec c1\ +4a 55 7c 5f eb e9 88 59 52 64 fc 5d a1 c5 71 46\ +2e ca 79 8a 18 a1 a4 94 0c da b4 a3 e9 20 09 cc\ +d4 2e 1e 94 7b 13 14 e3 22 38 a2 de ce 7d 23 a8\ +9b 5b 30 c7 51 fd 0a 4a 43 0d 2c 54 85 94 +Salt: \ +9a 2b 00 7e 80 97 8b bb 19 2c 35 4e b7 da 9a ed\ +fc 74 db f5 +Signature: \ +48 44 08 f3 89 8c d5 f5 34 83 f8 08 19 ef bf 27\ +08 c3 4d 27 a8 b2 a6 fa e8 b3 22 f9 24 02 37 f9\ +81 81 7a ca 18 46 f1 08 4d aa 6d 7c 07 95 f6 e5\ +bf 1a f5 9c 38 e1 85 84 37 ce 1f 7e c4 19 b9 8c\ +87 36 ad f6 dd 9a 00 b1 80 6d 2b d3 ad 0a 73 77\ +5e 05 f5 2d fe f3 a5 9a b4 b0 81 43 f0 df 05 cd\ +1a d9 d0 4b ec ec a6 da a4 a2 12 98 03 e2 00 cb\ +c7 77 87 ca f4 c1 d0 66 3a 6c 59 87 b6 05 95 20\ +19 78 2c af 2e c1 42 6d 68 fb 94 ed 1d 4b e8 16\ +a7 ed 08 1b 77 e6 ab 33 0b 3f fc 07 38 20 fe cd\ +e3 72 7f cb e2 95 ee 61 a0 50 a3 43 65 86 37 c3\ +fd 65 9c fb 63 73 6d e3 2d 9f 90 d3 c2 f6 3e ca +Test: Verify +Comment: RSASSA-PSS Signature Example 9.4 +Message: \ +1d fd 43 b4 6c 93 db 82 62 9b da e2 bd 0a 12 b8\ +82 ea 04 c3 b4 65 f5 cf 93 02 3f 01 05 96 26 db\ +be 99 f2 6b b1 be 94 9d dd d1 6d c7 f3 de bb 19\ +a1 94 62 7f 0b 22 44 34 df 7d 87 00 e9 e9 8b 06\ +e3 60 c1 2f db e3 d1 9f 51 c9 68 4e b9 08 9e cb\ +b0 a2 f0 45 03 99 d3 f5 9e ac 72 94 08 5d 04 4f\ +53 93 c6 ce 73 74 23 d8 b8 6c 41 53 70 d3 89 e3\ +0b 9f 0a 3c 02 d2 5d 00 82 e8 ad 6f 3f 1e f2 4a\ +45 c3 cf 82 b3 83 36 70 63 a4 d4 61 3e 42 64 f0\ +1b 2d ac 2e 5a a4 20 43 f8 fb 5f 69 fa 87 1d 14\ +fb 27 3e 76 7a 53 1c 40 f0 2f 34 3b c2 fb 45 a0\ +c7 e0 f6 be 25 61 92 3a 77 21 1d 66 a6 e2 db b4\ +3c 36 63 50 be ae 22 da 3a c2 c1 f5 07 70 96 fc\ +b5 c4 bf 25 5f 75 74 35 1a e0 b1 e1 f0 36 32 81\ +7c 08 56 d4 a8 ba 97 af bd c8 b8 58 55 40 2b c5\ +69 26 fc ec 20 9f 9e a8 +Salt: \ +70 f3 82 bd df 4d 5d 2d d8 8b 3b c7 b7 30 8b e6\ +32 b8 40 45 +Signature: \ +84 eb eb 48 1b e5 98 45 b4 64 68 ba fb 47 1c 01\ +12 e0 2b 23 5d 84 b5 d9 11 cb d1 92 6e e5 07 4a\ +e0 42 44 95 cb 20 e8 23 08 b8 eb b6 5f 41 9a 03\ +fb 40 e7 2b 78 98 1d 88 aa d1 43 05 36 85 17 2c\ +97 b2 9c 8b 7b f0 ae 73 b5 b2 26 3c 40 3d a0 ed\ +2f 80 ff 74 50 af 78 28 eb 8b 86 f0 02 8b d2 a8\ +b1 76 a4 d2 28 cc ce a1 83 94 f2 38 b0 9f f7 58\ +cc 00 bc 04 30 11 52 35 57 42 f2 82 b5 4e 66 3a\ +91 9e 70 9d 8d a2 4a de 55 00 a7 b9 aa 50 22 6e\ +0c a5 29 23 e6 c2 d8 60 ec 50 ff 48 0f a5 74 77\ +e8 2b 05 65 f4 37 9f 79 c7 72 d5 c2 da 80 af 9f\ +bf 32 5e ce 6f c2 0b 00 96 16 14 be e8 9a 18 3e +Test: Verify +Comment: RSASSA-PSS Signature Example 9.5 +Message: \ +1b dc 6e 7c 98 fb 8c f5 4e 9b 09 7b 66 a8 31 e9\ +cf e5 2d 9d 48 88 44 8e e4 b0 97 80 93 ba 1d 7d\ +73 ae 78 b3 a6 2b a4 ad 95 cd 28 9c cb 9e 00 52\ +26 bb 3d 17 8b cc aa 82 1f b0 44 a4 e2 1e e9 76\ +96 c1 4d 06 78 c9 4c 2d ae 93 b0 ad 73 92 22 18\ +55 3d aa 7e 44 eb e5 77 25 a7 a4 5c c7 2b 9b 21\ +38 a6 b1 7c 8d b4 11 ce 82 79 ee 12 41 af f0 a8\ +be c6 f7 7f 87 ed b0 c6 9c b2 72 36 e3 43 5a 80\ +0b 19 2e 4f 11 e5 19 e3 fe 30 fc 30 ea cc ca 4f\ +bb 41 76 90 29 bf 70 8e 81 7a 9e 68 38 05 be 67\ +fa 10 09 84 68 3b 74 83 8e 3b cf fa 79 36 6e ed\ +1d 48 1c 76 72 91 18 83 8f 31 ba 8a 04 8a 93 c1\ +be 44 24 59 8e 8d f6 32 8b 7a 77 88 0a 3f 9c 7e\ +2e 8d fc a8 eb 5a 26 fb 86 bd c5 56 d4 2b be 01\ +d9 fa 6e d8 06 46 49 1c 93 41 +Salt: \ +d6 89 25 7a 86 ef fa 68 21 2c 5e 0c 61 9e ca 29\ +5f b9 1b 67 +Signature: \ +82 10 2d f8 cb 91 e7 17 99 19 a0 4d 26 d3 35 d6\ +4f bc 2f 87 2c 44 83 39 43 24 1d e8 45 48 10 27\ +4c df 3d b5 f4 2d 42 3d b1 52 af 71 35 f7 01 42\ +0e 39 b4 94 a6 7c bf d1 9f 91 19 da 23 3a 23 da\ +5c 64 39 b5 ba 0d 2b c3 73 ee e3 50 70 01 37 8d\ +4a 40 73 85 6b 7f e2 ab a0 b5 ee 93 b2 7f 4a fe\ +c7 d4 d1 20 92 1c 83 f6 06 76 5b 02 c1 9e 4d 6a\ +1a 3b 95 fa 4c 42 29 51 be 4f 52 13 10 77 ef 17\ +17 97 29 cd df bd b5 69 50 db ac ee fe 78 cb 16\ +64 0a 09 9e a5 6d 24 38 9e ef 10 f8 fe cb 31 ba\ +3e a3 b2 27 c0 a8 66 98 bb 89 e3 e9 36 39 05 bf\ +22 77 7b 2a 3a a5 21 b6 5b 4c ef 76 d8 3b de 4c +Test: Verify +Comment: RSASSA-PSS Signature Example 9.6 +Message: \ +88 c7 a9 f1 36 04 01 d9 0e 53 b1 01 b6 1c 53 25\ +c3 c7 5d b1 b4 11 fb eb 8e 83 0b 75 e9 6b 56 67\ +0a d2 45 40 4e 16 79 35 44 ee 35 4b c6 13 a9 0c\ +c9 84 87 15 a7 3d b5 89 3e 7f 6d 27 98 15 c0 c1\ +de 83 ef 8e 29 56 e3 a5 6e d2 6a 88 8d 7a 9c dc\ +d0 42 f4 b1 6b 7f a5 1e f1 a0 57 36 62 d1 6a 30\ +2d 0e c5 b2 85 d2 e0 3a d9 65 29 c8 7b 3d 37 4d\ +b3 72 d9 5b 24 43 d0 61 b6 b1 a3 50 ba 87 80 7e\ +d0 83 af d1 eb 05 c3 f5 2f 4e ba 5e d2 22 77 14\ +fd b5 0b 9d 9d 9d d6 81 4f 62 f6 27 2f cd 5c db\ +ce 7a 9e f7 97 +Salt: \ +c2 5f 13 bf 67 d0 81 67 1a 04 81 a1 f1 82 0d 61\ +3b ba 22 76 +Signature: \ +a7 fd b0 d2 59 16 5c a2 c8 8d 00 bb f1 02 8a 86\ +7d 33 76 99 d0 61 19 3b 17 a9 64 8e 14 cc bb aa\ +de ac aa cd ec 81 5e 75 71 29 4e bb 8a 11 7a f2\ +05 fa 07 8b 47 b0 71 2c 19 9e 3a d0 51 35 c5 04\ +c2 4b 81 70 51 15 74 08 02 48 79 92 ff d5 11 d4\ +af c6 b8 54 49 1e b3 f0 dd 52 31 39 54 2f f1 5c\ +31 01 ee 85 54 35 17 c6 a3 c7 94 17 c6 7e 2d d9\ +aa 74 1e 9a 29 b0 6d cb 59 3c 23 36 b3 67 0a e3\ +af ba c7 c3 e7 6e 21 54 73 e8 66 e3 38 ca 24 4d\ +e0 0b 62 62 4d 6b 94 26 82 2c ea e9 f8 cc 46 08\ +95 f4 12 50 07 3f d4 5c 5a 1e 7b 42 5c 20 4a 42\ +3a 69 91 59 f6 90 3e 71 0b 37 a7 bb 2b c8 04 9f +Test: Verify +Comment: Example 10: A 2048-bit RSA Key Pair +Modulus: \ +a5 dd 86 7a c4 cb 02 f9 0b 94 57 d4 8c 14 a7 70\ +ef 99 1c 56 c3 9c 0e c6 5f d1 1a fa 89 37 ce a5\ +7b 9b e7 ac 73 b4 5c 00 17 61 5b 82 d6 22 e3 18\ +75 3b 60 27 c0 fd 15 7b e1 2f 80 90 fe e2 a7 ad\ +cd 0e ef 75 9f 88 ba 49 97 c7 a4 2d 58 c9 aa 12\ +cb 99 ae 00 1f e5 21 c1 3b b5 43 14 45 a8 d5 ae\ +4f 5e 4c 7e 94 8a c2 27 d3 60 40 71 f2 0e 57 7e\ +90 5f be b1 5d fa f0 6d 1d e5 ae 62 53 d6 3a 6a\ +21 20 b3 1a 5d a5 da bc 95 50 60 0e 20 f2 7d 37\ +39 e2 62 79 25 fe a3 cc 50 9f 21 df f0 4e 6e ea\ +45 49 c5 40 d6 80 9f f9 30 7e ed e9 1f ff 58 73\ +3d 83 85 a2 37 d6 d3 70 5a 33 e3 91 90 09 92 07\ +0d f7 ad f1 35 7c f7 e3 70 0c e3 66 7d e8 3f 17\ +b8 df 17 78 db 38 1d ce 09 cb 4a d0 58 a5 11 00\ +1a 73 81 98 ee 27 cf 55 a1 3b 75 45 39 90 65 82\ +ec 8b 17 4b d5 8d 5d 1f 3d 76 7c 61 37 21 ae 05 +PublicExponent: \ +01 00 01 +PrivateExponent: \ +2d 2f f5 67 b3 fe 74 e0 61 91 b7 fd ed 6d e1 12\ +29 0c 67 06 92 43 0d 59 69 18 40 47 da 23 4c 96\ +93 de ed 16 73 ed 42 95 39 c9 69 d3 72 c0 4d 6b\ +47 e0 f5 b8 ce e0 84 3e 5c 22 83 5d bd 3b 05 a0\ +99 79 84 ae 60 58 b1 1b c4 90 7c bf 67 ed 84 fa\ +9a e2 52 df b0 d0 cd 49 e6 18 e3 5d fd fe 59 bc\ +a3 dd d6 6c 33 ce bb c7 7a d4 41 aa 69 5e 13 e3\ +24 b5 18 f0 1c 60 f5 a8 5c 99 4a d1 79 f2 a6 b5\ +fb e9 34 02 b1 17 67 be 01 bf 07 34 44 d6 ba 1d\ +d2 bc a5 bd 07 4d 4a 5f ae 35 31 ad 13 03 d8 4b\ +30 d8 97 31 8c bb ba 04 e0 3c 2e 66 de 6d 91 f8\ +2f 96 ea 1d 4b b5 4a 5a ae 10 2d 59 46 57 f5 c9\ +78 95 53 51 2b 29 6d ea 29 d8 02 31 96 35 7e 3e\ +3a 6e 95 8f 39 e3 c2 34 40 38 ea 60 4b 31 ed c6\ +f0 f7 ff 6e 71 81 a5 7c 92 82 6a 26 8f 86 76 8e\ +96 f8 78 56 2f c7 1d 85 d6 9e 44 86 12 f7 04 8f +Prime1: \ +cf d5 02 83 fe ee b9 7f 6f 08 d7 3c bc 7b 38 36\ +f8 2b bc d4 99 47 9f 5e 6f 76 fd fc b8 b3 8c 4f\ +71 dc 9e 88 bd 6a 6f 76 37 1a fd 65 d2 af 18 62\ +b3 2a fb 34 a9 5f 71 b8 b1 32 04 3f fe be 3a 95\ +2b af 75 92 44 81 48 c0 3f 9c 69 b1 d6 8e 4c e5\ +cf 32 c8 6b af 46 fe d3 01 ca 1a b4 03 06 9b 32\ +f4 56 b9 1f 71 89 8a b0 81 cd 8c 42 52 ef 52 71\ +91 5c 97 94 b8 f2 95 85 1d a7 51 0f 99 cb 73 eb +Prime2: \ +cc 4e 90 d2 a1 b3 a0 65 d3 b2 d1 f5 a8 fc e3 1b\ +54 44 75 66 4e ab 56 1d 29 71 b9 9f b7 be f8 44\ +e8 ec 1f 36 0b 8c 2a c8 35 96 92 97 1e a6 a3 8f\ +72 3f cc 21 1f 5d bc b1 77 a0 fd ac 51 64 a1 d4\ +ff 7f bb 4e 82 99 86 35 3c b9 83 65 9a 14 8c dd\ +42 0c 7d 31 ba 38 22 ea 90 a3 2b e4 6c 03 0e 8c\ +17 e1 fa 0a d3 78 59 e0 6b 0a a6 fa 3b 21 6d 9c\ +be 6c 0e 22 33 97 69 c0 a6 15 91 3e 5d a7 19 cf +ModPrime1PrivateExponent: \ +1c 2d 1f c3 2f 6b c4 00 4f d8 5d fd e0 fb bf 9a\ +4c 38 f9 c7 c4 e4 1d ea 1a a8 82 34 a2 01 cd 92\ +f3 b7 da 52 65 83 a9 8a d8 5b b3 60 fb 98 3b 71\ +1e 23 44 9d 56 1d 17 78 d7 a5 15 48 6b cb f4 7b\ +46 c9 e9 e1 a3 a1 f7 70 00 ef be b0 9a 8a fe 47\ +e5 b8 57 cd a9 9c b1 6d 7f ff 9b 71 2e 3b d6 0c\ +a9 6d 9c 79 73 d6 16 d4 69 34 a9 c0 50 28 1c 00\ +43 99 ce ff 1d b7 dd a7 87 66 a8 a9 b9 cb 08 73 +ModPrime2PrivateExponent: \ +cb 3b 3c 04 ca a5 8c 60 be 7d 9b 2d eb b3 e3 96\ +43 f4 f5 73 97 be 08 23 6a 1e 9e af aa 70 65 36\ +e7 1c 3a cf e0 1c c6 51 f2 3c 9e 05 85 8f ee 13\ +bb 6a 8a fc 47 df 4e dc 9a 4b a3 0b ce cb 73 d0\ +15 78 52 32 7e e7 89 01 5c 2e 8d ee 7b 9f 05 a0\ +f3 1a c9 4e b6 17 31 64 74 0c 5c 95 14 7c d5 f3\ +b5 ae 2c b4 a8 37 87 f0 1d 8a b3 1f 27 c2 d0 ee\ +a2 dd 8a 11 ab 90 6a ba 20 7c 43 c6 ee 12 53 31 +MultiplicativeInverseOfPrime2ModPrime1: \ +12 f6 b2 cf 13 74 a7 36 fa d0 56 16 05 0f 96 ab\ +4b 61 d1 17 7c 7f 9d 52 5a 29 f3 d1 80 e7 76 67\ +e9 9d 99 ab f0 52 5d 07 58 66 0f 37 52 65 5b 0f\ +25 b8 df 84 31 d9 a8 ff 77 c1 6c 12 a0 a5 12 2a\ +9f 0b f7 cf d5 a2 66 a3 5c 15 9f 99 12 08 b9 03\ +16 ff 44 4f 3e 0b 6b d0 e9 3b 8a 7a 24 48 e9 57\ +e3 dd a6 cf cf 22 66 b1 06 01 3a c4 68 08 d3 b3\ +88 7b 3b 00 34 4b aa c9 53 0b 4c e7 08 fc 32 b6 +Test: KeyPairValidAndConsistent +Comment: RSASSA-PSS Signature Example 10.1 +Message: \ +88 31 77 e5 12 6b 9b e2 d9 a9 68 03 27 d5 37 0c\ +6f 26 86 1f 58 20 c4 3d a6 7a 3a d6 09 +Salt: \ +04 e2 15 ee 6f f9 34 b9 da 70 d7 73 0c 87 34 ab\ +fc ec de 89 +Signature: \ +82 c2 b1 60 09 3b 8a a3 c0 f7 52 2b 19 f8 73 54\ +06 6c 77 84 7a bf 2a 9f ce 54 2d 0e 84 e9 20 c5\ +af b4 9f fd fd ac e1 65 60 ee 94 a1 36 96 01 14\ +8e ba d7 a0 e1 51 cf 16 33 17 91 a5 72 7d 05 f2\ +1e 74 e7 eb 81 14 40 20 69 35 d7 44 76 5a 15 e7\ +9f 01 5c b6 6c 53 2c 87 a6 a0 59 61 c8 bf ad 74\ +1a 9a 66 57 02 28 94 39 3e 72 23 73 97 96 c0 2a\ +77 45 5d 0f 55 5b 0e c0 1d df 25 9b 62 07 fd 0f\ +d5 76 14 ce f1 a5 57 3b aa ff 4e c0 00 69 95 16\ +59 b8 5f 24 30 0a 25 16 0c a8 52 2d c6 e6 72 7e\ +57 d0 19 d7 e6 36 29 b8 fe 5e 89 e2 5c c1 5b eb\ +3a 64 75 77 55 92 99 28 0b 9b 28 f7 9b 04 09 00\ +0b e2 5b bd 96 40 8b a3 b4 3c c4 86 18 4d d1 c8\ +e6 25 53 fa 1a f4 04 0f 60 66 3d e7 f5 e4 9c 04\ +38 8e 25 7f 1c e8 9c 95 da b4 8a 31 5d 9b 66 b1\ +b7 62 82 33 87 6f f2 38 52 30 d0 70 d0 7e 16 66 +Comment: RSASSA-PSS Signature Example 10.2 +Message: \ +dd 67 0a 01 46 58 68 ad c9 3f 26 13 19 57 a5 0c\ +52 fb 77 7c db aa 30 89 2c 9e 12 36 11 64 ec 13\ +97 9d 43 04 81 18 e4 44 5d b8 7b ee 58 dd 98 7b\ +34 25 d0 20 71 d8 db ae 80 70 8b 03 9d bb 64 db\ +d1 de 56 57 d9 fe d0 c1 18 a5 41 43 74 2e 0f f3\ +c8 7f 74 e4 58 57 64 7a f3 f7 9e b0 a1 4c 9d 75\ +ea 9a 1a 04 b7 cf 47 8a 89 7a 70 8f d9 88 f4 8e\ +80 1e db 0b 70 39 df 8c 23 bb 3c 56 f4 e8 21 ac +Salt: \ +8b 2b dd 4b 40 fa f5 45 c7 78 dd f9 bc 1a 49 cb\ +57 f9 b7 1b +Signature: \ +14 ae 35 d9 dd 06 ba 92 f7 f3 b8 97 97 8a ed 7c\ +d4 bf 5f f0 b5 85 a4 0b d4 6c e1 b4 2c d2 70 30\ +53 bb 90 44 d6 4e 81 3d 8f 96 db 2d d7 00 7d 10\ +11 8f 6f 8f 84 96 09 7a d7 5e 1f f6 92 34 1b 28\ +92 ad 55 a6 33 a1 c5 5e 7f 0a 0a d5 9a 0e 20 3a\ +5b 82 78 ae c5 4d d8 62 2e 28 31 d8 71 74 f8 ca\ +ff 43 ee 6c 46 44 53 45 d8 4a 59 65 9b fb 92 ec\ +d4 c8 18 66 86 95 f3 47 06 f6 68 28 a8 99 59 63\ +7f 2b f3 e3 25 1c 24 bd ba 4d 4b 76 49 da 00 22\ +21 8b 11 9c 84 e7 9a 65 27 ec 5b 8a 5f 86 1c 15\ +99 52 e2 3e c0 5e 1e 71 73 46 fa ef e8 b1 68 68\ +25 bd 2b 26 2f b2 53 10 66 c0 de 09 ac de 2e 42\ +31 69 07 28 b5 d8 5e 11 5a 2f 6b 92 b7 9c 25 ab\ +c9 bd 93 99 ff 8b cf 82 5a 52 ea 1f 56 ea 76 dd\ +26 f4 3b aa fa 18 bf a9 2a 50 4c bd 35 69 9e 26\ +d1 dc c5 a2 88 73 85 f3 c6 32 32 f0 6f 32 44 c3 +Comment: RSASSA-PSS Signature Example 10.3 +Message: \ +48 b2 b6 a5 7a 63 c8 4c ea 85 9d 65 c6 68 28 4b\ +08 d9 6b dc aa be 25 2d b0 e4 a9 6c b1 ba c6 01\ +93 41 db 6f be fb 8d 10 6b 0e 90 ed a6 bc c6 c6\ +26 2f 37 e7 ea 9c 7e 5d 22 6b d7 df 85 ec 5e 71\ +ef ff 2f 54 c5 db 57 7f f7 29 ff 91 b8 42 49 1d\ +e2 74 1d 0c 63 16 07 df 58 6b 90 5b 23 b9 1a f1\ +3d a1 23 04 bf 83 ec a8 a7 3e 87 1f f9 db +Salt: \ +4e 96 fc 1b 39 8f 92 b4 46 71 01 0c 0d c3 ef d6\ +e2 0c 2d 73 +Signature: \ +6e 3e 4d 7b 6b 15 d2 fb 46 01 3b 89 00 aa 5b bb\ +39 39 cf 2c 09 57 17 98 70 42 02 6e e6 2c 74 c5\ +4c ff d5 d7 d5 7e fb bf 95 0a 0f 5c 57 4f a0 9d\ +3f c1 c9 f5 13 b0 5b 4f f5 0d d8 df 7e df a2 01\ +02 85 4c 35 e5 92 18 01 19 a7 0c e5 b0 85 18 2a\ +a0 2d 9e a2 aa 90 d1 df 03 f2 da ae 88 5b a2 f5\ +d0 5a fd ac 97 47 6f 06 b9 3b 5b c9 4a 1a 80 aa\ +91 16 c4 d6 15 f3 33 b0 98 89 2b 25 ff ac e2 66\ +f5 db 5a 5a 3b cc 10 a8 24 ed 55 aa d3 5b 72 78\ +34 fb 8c 07 da 28 fc f4 16 a5 d9 b2 22 4f 1f 8b\ +44 2b 36 f9 1e 45 6f de a2 d7 cf e3 36 72 68 de\ +03 07 a4 c7 4e 92 41 59 ed 33 39 3d 5e 06 55 53\ +1c 77 32 7b 89 82 1b de df 88 01 61 c7 8c d4 19\ +6b 54 19 f7 ac c3 f1 3e 5e bf 16 1b 6e 7c 67 24\ +71 6c a3 3b 85 c2 e2 56 40 19 2a c2 85 96 51 d5\ +0b de 7e b9 76 e5 1c ec 82 8b 98 b6 56 3b 86 bb +Comment: RSASSA-PSS Signature Example 10.4 +Message: \ +0b 87 77 c7 f8 39 ba f0 a6 4b bb db c5 ce 79 75\ +5c 57 a2 05 b8 45 c1 74 e2 d2 e9 05 46 a0 89 c4\ +e6 ec 8a df fa 23 a7 ea 97 ba e6 b6 5d 78 2b 82\ +db 5d 2b 5a 56 d2 2a 29 a0 5e 7c 44 33 e2 b8 2a\ +62 1a bb a9 0a dd 05 ce 39 3f c4 8a 84 05 42 45\ +1a +Salt: \ +c7 cd 69 8d 84 b6 51 28 d8 83 5e 3a 8b 1e b0 e0\ +1c b5 41 ec +Signature: \ +34 04 7f f9 6c 4d c0 dc 90 b2 d4 ff 59 a1 a3 61\ +a4 75 4b 25 5d 2e e0 af 7d 8b f8 7c 9b c9 e7 dd\ +ee de 33 93 4c 63 ca 1c 0e 3d 26 2c b1 45 ef 93\ +2a 1f 2c 0a 99 7a a6 a3 4f 8e ae e7 47 7d 82 cc\ +f0 90 95 a6 b8 ac ad 38 d4 ee c9 fb 7e ab 7a d0\ +2d a1 d1 1d 8e 54 c1 82 5e 55 bf 58 c2 a2 32 34\ +b9 02 be 12 4f 9e 90 38 a8 f6 8f a4 5d ab 72 f6\ +6e 09 45 bf 1d 8b ac c9 04 4c 6f 07 09 8c 9f ce\ +c5 8a 3a ab 10 0c 80 51 78 15 5f 03 0a 12 4c 45\ +0e 5a cb da 47 d0 e4 f1 0b 80 a2 3f 80 3e 77 4d\ +02 3b 00 15 c2 0b 9f 9b be 7c 91 29 63 38 d5 ec\ +b4 71 ca fb 03 20 07 b6 7a 60 be 5f 69 50 4a 9f\ +01 ab b3 cb 46 7b 26 0e 2b ce 86 0b e8 d9 5b f9\ +2c 0c 8e 14 96 ed 1e 52 85 93 a4 ab b6 df 46 2d\ +de 8a 09 68 df fe 46 83 11 68 57 a2 32 f5 eb f6\ +c8 5b e2 38 74 5a d0 f3 8f 76 7a 5f db f4 86 fb +Comment: RSASSA-PSS Signature Example 10.5 +Message: \ +f1 03 6e 00 8e 71 e9 64 da dc 92 19 ed 30 e1 7f\ +06 b4 b6 8a 95 5c 16 b3 12 b1 ed df 02 8b 74 97\ +6b ed 6b 3f 6a 63 d4 e7 78 59 24 3c 9c cc dc 98\ +01 65 23 ab b0 24 83 b3 55 91 c3 3a ad 81 21 3b\ +b7 c7 bb 1a 47 0a ab c1 0d 44 25 6c 4d 45 59 d9\ +16 +Salt: \ +ef a8 bf f9 62 12 b2 f4 a3 f3 71 a1 0d 57 41 52\ +65 5f 5d fb +Signature: \ +7e 09 35 ea 18 f4 d6 c1 d1 7c e8 2e b2 b3 83 6c\ +55 b3 84 58 9c e1 9d fe 74 33 63 ac 99 48 d1 f3\ +46 b7 bf dd fe 92 ef d7 8a db 21 fa ef c8 9a de\ +42 b1 0f 37 40 03 fe 12 2e 67 42 9a 1c b8 cb d1\ +f8 d9 01 45 64 c4 4d 12 01 16 f4 99 0f 1a 6e 38\ +77 4c 19 4b d1 b8 21 32 86 b0 77 b0 49 9d 2e 7b\ +3f 43 4a b1 22 89 c5 56 68 4d ee d7 81 31 93 4b\ +b3 dd 65 37 23 6f 7c 6f 3d cb 09 d4 76 be 07 72\ +1e 37 e1 ce ed 9b 2f 7b 40 68 87 bd 53 15 73 05\ +e1 c8 b4 f8 4d 73 3b c1 e1 86 fe 06 cc 59 b6 ed\ +b8 f4 bd 7f fe fd f4 f7 ba 9c fb 9d 57 06 89 b5\ +a1 a4 10 9a 74 6a 69 08 93 db 37 99 25 5a 0c b9\ +21 5d 2d 1c d4 90 59 0e 95 2e 8c 87 86 aa 00 11\ +26 52 52 47 0c 04 1d fb c3 ee c7 c3 cb f7 1c 24\ +86 9d 11 5c 0c b4 a9 56 f5 6d 53 0b 80 ab 58 9a\ +cf ef c6 90 75 1d df 36 e8 d3 83 f8 3c ed d2 cc +Comment: RSASSA-PSS Signature Example 10.6 +Message: \ +25 f1 08 95 a8 77 16 c1 37 45 0b b9 51 9d fa a1\ +f2 07 fa a9 42 ea 88 ab f7 1e 9c 17 98 00 85 b5\ +55 ae ba b7 62 64 ae 2a 3a b9 3c 2d 12 98 11 91\ +dd ac 6f b5 94 9e b3 6a ee 3c 5d a9 40 f0 07 52\ +c9 16 d9 46 08 fa 7d 97 ba 6a 29 15 b6 88 f2 03\ +23 d4 e9 d9 68 01 d8 9a 72 ab 58 92 dc 21 17 c0\ +74 34 fc f9 72 e0 58 cf 8c 41 ca 4b 4f f5 54 f7\ +d5 06 8a d3 15 5f ce d0 f3 12 5b c0 4f 91 93 37\ +8a 8f 5c 4c 3b 8c b4 dd 6d 1c c6 9d 30 ec ca 6e\ +aa 51 e3 6a 05 73 0e 9e 34 2e 85 5b af 09 9d ef\ +b8 af d7 +Salt: \ +ad 8b 15 23 70 36 46 22 4b 66 0b 55 08 85 91 7c\ +a2 d1 df 28 +Signature: \ +6d 3b 5b 87 f6 7e a6 57 af 21 f7 54 41 97 7d 21\ +80 f9 1b 2c 5f 69 2d e8 29 55 69 6a 68 67 30 d9\ +b9 77 8d 97 07 58 cc b2 60 71 c2 20 9f fb d6 12\ +5b e2 e9 6e a8 1b 67 cb 9b 93 08 23 9f da 17 f7\ +b2 b6 4e cd a0 96 b6 b9 35 64 0a 5a 1c b4 2a 91\ +55 b1 c9 ef 7a 63 3a 02 c5 9f 0d 6e e5 9b 85 2c\ +43 b3 50 29 e7 3c 94 0f f0 41 0e 8f 11 4e ed 46\ +bb d0 fa e1 65 e4 2b e2 52 8a 40 1c 3b 28 fd 81\ +8e f3 23 2d ca 9f 4d 2a 0f 51 66 ec 59 c4 23 96\ +d6 c1 1d bc 12 15 a5 6f a1 71 69 db 95 75 34 3e\ +f3 4f 9d e3 2a 49 cd c3 17 49 22 f2 29 c2 3e 18\ +e4 5d f9 35 31 19 ec 43 19 ce dc e7 a1 7c 64 08\ +8c 1f 6f 52 be 29 63 41 00 b3 91 9d 38 f3 d1 ed\ +94 e6 89 1e 66 a7 3b 8f b8 49 f5 87 4d f5 94 59\ +e2 98 c7 bb ce 2e ee 78 2a 19 5a a6 6f e2 d0 73\ +2b 25 e5 95 f5 7d 3e 06 1b 1f c3 e4 06 3b f9 8f +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/rw.txt b/external/crypto++-5.6.3/TestVectors/rw.txt new file mode 100644 index 000000000..2d932d07d --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/rw.txt @@ -0,0 +1,166 @@ +AlgorithmType: Signature +Name: RW/EMSA2(SHA-1) +Source: generated by Wei Dai using Crypto++ 5.1 +Comment: 1024-bit RW key +KeyFormat: Component +Modulus: \ + e5eb47bc1f82db3001faaeabc5bbe71b7d307b431889ac10255262281ec5f5af\ + 8a790bd7bbec5efffa442cf2c3fd5ca4778763b9d15aeac0b9b71bdb13da8272\ + 7f4967ac685975f8ff05a763c864d100b7cc1142102aa2dd343ea1a0ab530255\ + 195c3a6400ecab7b27eff9b01ef6d37381fa6fb5401347f195354396772e8285 +Prime1: \ + ef86dd7af3f32cde8a9f6564e43a559a0c9f8bad36cc25330548b347ac158a34\ + 5631fa90f7b873c36effae2f7823227a3f580b5dd18304d5932751e743e9281b +Prime2: \ + f5bb4289c389d9019c36f96c6b81fffbf20be0620c6343e2b800aefb1b55a330\ + 8cc1402da7a2a558579a2a5146b30cb08e3f20b501081248f2f1de36cdfce9df +MultiplicativeInverseOfPrime2ModPrime1: \ + 88813a3d50b7c301948ee1985db19c9fd33a47c78c977024745e10483d9cc4f0\ + f573597ce564a91421d1d7457bc45a971f7d8b31403298da77799b57cf9a76de +PublicExponent: 02 +Test: KeyPairValidAndConsistent +Message: 2CA039854B55688740E3 +Signature: 1AF029CBEC9C692CE5096E73E4E9A52EC9A28D207A5511CCEC7681E5E3D867A4AE2E22DE4909D89196A272F1B50DE6FA3248BCA334D46E0D57171A790B6F4697E7BA7047DB79DECD47BD21995243DEBBF25915DDBC93C45875C14DE953792257C5C6825C905AFF40109C8CC7E793123D47AC1B5B6304A436CFA9BEEC8E0054E7 +Test: Verify +Message: 2A51DF4AF88613D91A37 +Signature: 6FF18F4471E1A8F850C910A181A9F28E69AACD8E8126969605E000A853197541AF9047E5D17315BF062B9CD8DF91196F0343285D9E31D5C72560C156782B6D0E5AF8F06D7DCDD8CABEC01B2438C168C40C21F6A8794648361BD2AEE13573A49ECA07A7EED97C0B9C5B1E508869E4CFD5FE1771924B1CF5A4BFF7D4379E5CD59F +Test: Verify +Message: 1CF8DDD95D780A89D7CF +Signature: 539C266B0313E0E256ED98EEF13E6AE64CED90C160A4999B3D47CBDA5285DAB0E0678C0E079CE9B8EB23E10EDFACFC19A80EEBB8F38ED5B5D6C8A988AB8CEC40A5A5BA102F75586167EAB6D5BF0CE8FF30C656895800F6F1B37D69FBBAF9055F7505DBEB537C0F986A1B5F0270DC12A640FFCB626F9763FDCFEFA1208C104003 +Test: Verify +Message: 2119A954F1AC0F3DCDB2 +Signature: 60C3CCF4F086B15B7F850B445F384333F7AE5A4B5EDE2820C7233239E1B86D6E4B4FCA4F50B087CE1DF17DA5D62672A17F2CF87A2875BBD9B138CAF6863821D6A4D553E9EB64C9254A8F9A6B960E57E39069D65E3F561AA1FA91643D42FEEFB9270D34AB0861DEA1E234EA587F580503D46A1989D413DAC2FFE0FC4CA663CE68 +Test: Verify +Message: F6959926E6D9D37D8BC0 +Signature: 249E1066542618CE0D236A7174708F801E7AB257931E9967A65C483ED66FB58598F99B6664AF0EAE221E2A6B271D7D17875ED02BF7FE35AA0786023858521CB79FEE0D134D9DDA609B0270FC9804BB6BF74AD90AE11EB339353533DC0D5A69E6B8758212B86024ED563767EA5D9B59655E0B8CC21244F720BA4ED663BF668E3A +Test: Verify +Message: 7A4C634DE6F16315BD5F +Signature: 308A5D65224201BED626CC83FB901EC84874EE03B2E7AB4E752EDBDE024C754E3CC9841CA062100A8843DE9183354B4E0596E8C68F1605828287884F0F9BA6968FC7A9F0CA09418A8485B90465E5D3F96CE4995A5FC7A6E5ABD9CC06BB8A2C3C8109F72EAE67FB4C108852C881CA645B3C5586F27F12FF3028ADE56E32AD9434 +Test: Verify +Comment: 1032-bit RW key +KeyFormat: Component +Modulus: \ + b660eb18786256c993ebc6dcb5892eac342f6d91229b73dc5d04f1afb9bb0dd4\ + eb0b48895f514b4c9afeaf86e91226f2299126d37528ce374e89cc312c06f47c\ + 81112bf5ca60ffc33b98318e04a17627269f1af461b6cb40f3be03b0113fb2d8\ + 404e154c7191306b36fd3efa73c784ad9189115d0bb1bd82b850d000e7cc8d20\ + 35 +Prime1: \ + 0bc31c063f43b3ade2cd633d554913339071d6ebed5fd665fc5dd7d47b80721a\ + 976c3b14fbd253f0f988c354725289f2897d7fb62c5c74af7d597a1e22aafba1\ + d3 +Prime2: \ + 0f816bf0add559afda38b008e4087f6a38b575c56fff453056eaaab3381c9552\ + 0969546f954d458d48e44850938b1db471cf4b40afc47e067fb5bce67ba98be8\ + d7 +MultiplicativeInverseOfPrime2ModPrime1: \ + 0b684eeec75b3e24e2d9947341b3f462258628af6f0b881396c887fe26a3408c\ + 40b13370710c82dd4a021a87bbaab5c0fc96cb1d015a783a764a8ab7b002903d\ + 21 +PublicExponent: 02 +Test: KeyPairValidAndConsistent +Message: EF0F1D56F4E5D587C212 +Signature: 3E544FEBB6623F5D392003B729FE2BFC20E2CB3ECAC22734DFCA55150254E616A41C5E54CE3B50FBC2FE2363EE9AF9B15C70615497B0A458F8AB6D850992EEEB56D65F87EA1BD6E2B4B7E40A0F5E1635C7DDB17110C61039CF712D3524C9C2C1F35D9163BE5C70276F46634514BE16EC09602782E88FE74EAEB2F50CBB0E3B5C4A +Test: Verify +Message: 2C9EA313EACF2C5DA43A +Signature: 1FEFF88814BB53E447E1E955AC8F1AF597C15C3866033E337AFBAB8627306F2EC1276621FF2176C89323CE32EA20F6AEC2CC271F1ED749408B2A3E43A23A44D6A3F38DCDDCAB696B239110AA7ECF12C6681B0E97E6FFF1B72F4F6D796BF82B9450AB8B3D28CA9D220BDF84ACCEA1DA5EDA0B470C3A82BBDD77B4C2723297608BD4 +Test: Verify +Message: EC5CC4228C3C70EE8F35 +Signature: 228BAA85062F10DCC9D99A23D340BC4B9E463D8AB86A6781A6D2143564303E2DC78772BF68449BE1E2711A68D5A15CF04A23573FB3870454308F583BBB5F2467069EF1395431E70F91BD56D846DC8DB2E88AB3D26A9770660B87A76D6C3575DE512BAFA8A0B901AD15B7D8E8BE2F176A182D16A9609F19A4298416245873175805 +Test: Verify +Message: D81F0C6F2D3D60EE19FE +Signature: 17EAA0C18178CD45A2B9100997F682E5F02BE09FBE4D8F345033951345CE98C8B3F13F2CA2A950CE7BDCBF83DBB700890E1F0B863D04C3ADB298F546A8F09F4DA4EF0DC6E7317207CB3CF691114E55D9EAA11C53BE55F7C214F62E6B0460DFA60C55B16EB55B29C9DBB908266C1BDBB03AD651EFB91905B142D852DCA0C4E3BBEE +Test: Verify +Message: FEF5EE07C74118DA30B9 +Signature: 2637E16E2599B6EC2F4728C73D3B29F483C2B881F1E1969C426027605EF080E9B17D258D5E1EBC6472A2501E04CF19C144537FCB38A1DA00D948EBD39FA11322D9230B62E2C12AEDB366BD85A2089588A8D52E941FD986D89828A342B83438A960B6FD87E9AD025AD75A692AA9DFEA873A9467B42D84879E85C5D11EFAB347FBED +Test: Verify +Message: 0B9554FFE4F6ADAB2C76 +Signature: 095952F24D9FBEF3A93A932865F4BDBB522CF24EBE153CE4BBB24CF301A1C7B51FE47B94F8F8B211CBC5A926FF6BAF9A6BBF7E15975D2DCCB95EF01AB7E641687870B0D01FC18B6B16FE17D3FC82931FBBCD4FD18C7F9588CEE8491876D72F98F2E7EEA90C12907210D6859053ADC7178B87BF8B4826954D6986FE761E71E1B7EA +Test: Verify +Comment: 1536-bit RW key +KeyFormat: Component +Modulus: \ + 9f8f8ab78ad635c71c9ef0fce9d4a958a9013ed69fcd67c385722668d4357c32\ + 3732c78179eaa17984531ba570aa0721a1e228957b1008010f1a2d6c42e09847\ + 9ffeaff9bbfeb3c8e101f968fc7ac74cfba210f76a6da160e65934d216368763\ + 8f59e414dc6f0448c0b4052c90f7dc565d32acae5da04e3e157dca184aba8362\ + bb28a2da6915d51d65f54fbeee69104a5a1b2304b87230c504b126dcf1c377cf\ + 1777b93be6903b50a44f054ae233b7cc24f950ded467cb8ffbdb17e7b6937605 +Prime1: \ + d0505c510a3b38a139d6d139818b04251d6ca46c2e717cfafbeebcd5fff8ae62\ + de4698e3241784f05e8c86f0f996db77259ebaac6983f092853639f619b75701\ + e562408cc1f5c543cada21fc26af36905b10a0df5b111efd754666bb3db4be63 +Prime2: \ + c41623ccb51e2474eb3dc5c2ef42cfd320a285ef7aefc1d1edcd5f566549cb79\ + 7285f01c89b9f749ca506b717c2a45b708fec2e7d611c5eee6af0a6d61219c7d\ + cab18961e98eea3b7797c61a75aed21d411de4fcf4a009a8238a832dd6e41277 +MultiplicativeInverseOfPrime2ModPrime1: \ + bc1ceeed917217387ead12254cfc183f82c79709499f510ce093d6d28bc1bf2b\ + fabc3d86d64a1c807605bd57f9ec533745d6e359270885c3eb7a36a02dff7137\ + 9bd453bf3fdc282afa2295d5e393f1c2c74edcbd2374c7740e8135ef0b8af258 +PublicExponent: 02 +Test: KeyPairValidAndConsistent +Message: 400AEF79EDBCEA796D71 +Signature: 15EB5A68CBCB0D6313BB2D14436237A716AC3159B059FBC29931933DB802D6925C01BDC6D90DD0DA25980F1C8199AB9CD3FD105A63D13B5C0101A0430455334492038FBE029BF4EE61F8A2F88D2A6D5424DE7C0CC314B5EA4F867B35224D574463BDE78B71904033C1455484865EB80AE1C2A7D1C229CD0A4D49C0F06A26E264AD42ACAA131F8C0C5EA4DC9EB5BD349D1EE12B3F91F4B9F2DABC3BCF0E216D4A34A3541169955BE45289CECE16DA6BC5352FF31D66538F64308D6FBB9C7DDE72 +Test: Verify +Message: 63F64BFAD5B830682F44 +Signature: 1003E58A73B018FF9F0F66D3BE9A8DD9D83097A0EB216AEEAA75B63C150AAE9E8BE2A5DE426D18FBC56865F4C9CA51A9BB6E99B70C59B7995246A1F4327C9E4A69517131DA66DDE98AE5D8355527D1C5E4D83CC7ED7B3B1F404F6FDF731DA615974F0777CD22C1E6FAA3569D1141900734C7F3262FE7B9ED291A934DE81A06EBF258F7159DE842737A32DAEC79EFE211C2739D3F5859CB9A633D2A16D78C347790241925C3E776F04B5D5F1900A7B48645DF16DC6F9E8C990AEFEE22FA1DA496 +Test: Verify +Message: B6AAE87E8D469A16A335 +Signature: 368EE32DDF9D5526E50B1645473DB79CE4B0EF3801F3DF050E8B6B10DFAA600A505FD1C91CAE1CD8CB8FA7BC2F81EDFEE7E74DCF7BDA9ED4FF87C39650E8A473672FD012A6A57C5DC44FFBBDA4A5DECD099A32791CEDC6170C8B367080792713041350D2483B27924822DD886A36EE575A3CD6C097162F758F5628D3EA301050AC848F0ACAEDAB8AD34D436E418AA53618AFAFC3168B7CFA641B1A88C86007FD1EDD8FE1D1A94FCE59B548DA3D8FE313A0A97719E19C857560763EFF1682CC14 +Test: Verify +Message: DB0F126516E3EDFF3D7C +Signature: 42076C3F6976EF4BBEAFEF0B4F7A8198CACE6F73436C59DF212474C94D00B0501C359CAB8950EB8937E8458964C817926A3181EED64EAB3A5274A9B3114406F62A62C51F4EDBEEF3BD948C21578996236D6D477B2701DD5A4818B08F5D4740CD23064798C3406133D0758D51717DB4575117DE887733D1E7170AA0845A81535444A962F2003A46361E8A8A1914DA6732C37334320F155E90E18D9E2A921034BEC81395AF69D61E22FEF90BC4F9127914B536BD2477552166C11F139519129864 +Test: Verify +Message: A58B1E5E98C44A8680BD +Signature: 100B8692C7A09EFB585A63B5D636EABFE9DDFE50D5235B11BDFD818D1810893B327ACC3B78942900C8F7498BDC1D2FB44330ADD3FEBC709046D8028F38AA7DCC768558E7D6469EDA306C0FCAE001C7B01544C80043864761355888C13960DD53BBD7854F2FBB7D9DE021BAD69769418712B6335A8C63143329363C65CB4170AA0C040559136EA9C19A6793024AF77BCF3EE793CAEDF07FD8A8E2C9C29B5F225F399BBA177D070314E319359394DB999D866A48D591EE8C662BA6394E396300FE +Test: Verify +Message: 7AF0498714B0D93AB959 +Signature: 35A959E3717468552590C26FA92009C3866955A1D14405AD33D3FA745D7591521A323BA031070B1FB60A1B6FE0C7198FC14EA41CE62EB6EB060FD073E816C9C85BB6251BF5235567E12951778A61D87F117137C347DE56337FBF9A3360D49330A98248233719FF862F83F772AC887F035820579F406D221191F4535ABA37401FF6E28216EC06AB8832D9AB3EAE4E1D3D780A1FA46883A79B657A7027597BCE4F21744CFC3704A449A204D3790F668E2EB710D5CF031BAA58359D35DDF92455D7 +Test: Verify +Comment: 2048-bit RW key +KeyFormat: Component +Modulus: \ + b6dee7375bf4385043b3cc2ac5cacbc14ad11a17574738dd2bd84d2d1e6c74e1\ + 6066c2a5c35bc3b87839858afb5ee5e8abfab408f38772866f6f833f39fab248\ + 3a2c34ed55ad7098f9f63d4ec70b7950f02daaaab10781a0008f993c4027e381\ + 6bfd45c52f59452a7b28873513dce415a84fc8bc06601567f91ec41647da2304\ + 5b6e01e24516724acc02947ad5aa2dba4d952bc4f49d18ada0b0f7cc5d488814\ + b921c0bc2b33d8828d80130df7d79b0992cec40d3bc7217d4a4dff3699345e44\ + dac968575194845aa7b60dcf3c712d9b0a384824c3579b40dba265457d50f69f\ + 02a140884d89b7fdee9f0a787e76a37c58c92cf2d3818c72097d41b3faa7aa95 +Prime1: \ + fa880a456f9c205a26e02c3357536531dec150be0ef8747f69ea30d987ff7dd8\ + 9e9a1075ebd39f04fa495bd26d8408a8de69113a9fbb52f20713d1d046a76b47\ + 8cf77c46454a7afda2ef418f63faf67c947d898bca109f3275999e8f2e60e2c0\ + eec133ff69e71a2d396632670b52d8ea03f7589d8144ab580b1d3e60efa1280b +Prime2: \ + badcc718dd2d761c4893c4831d56ada30fc5c7c148d473bedf7615b7e821b92f\ + 319676ce278349f1309fb3d264c1a22bde71b221354c7a4d31117b3ec3c9d480\ + 2e0a26bd8ec05d28b6502c65f35c687af7f8396b963ed029a2c5ae38dd7c5c96\ + 2a953c113c0f590957ab19a6e2afda6db84f22c0c31ae243debd2920fbe9fbdf +MultiplicativeInverseOfPrime2ModPrime1: \ + 48a56f93e044a8211861da6bde9ab61265c63e168e507b56cd6e6e5f4de57c2f\ + 5c0b626462d6c06790cf561fa12a350dc0c08767f2717914183fac90db36495a\ + 91c0e9c0fbcfef19c85075b3b744fc378a9f2045cd7fd144ecd39bd1a59f1483\ + 10f6982efb3ffe502b279c4c0cb2a7f9ef64ca8f38690c486afb5f659cf7f838 +PublicExponent: 02 +Test: KeyPairValidAndConsistent +Message: 00AA5515CDAE5CD0F0DC +Signature: 30EECA6B48D796552F5A6A3C11F28D730FA077422CAAB34FDEB879AE0F71DF21330E2F3BE5BF3A8CA372EBCD3DFA7C81B3398C31B0972D0B857926CB39732351AACEB8276D52B9D82F9C245FA0F1CF49E785A2BC00FF27FBCF777F84D05BEF17FCC0505820B029AC8F0CE17D2469372CE47E1428BB941004FE170EF87163E07298EFFCC1BFA7E7CB1F572C340CAA075A5962A15B69CE937BC7EFB492F501FC88CBF0119C351C8498782091EF6EFB19120195E5FF51DF86F90E90FAEB225AA2EE43AB4E8358101C0348C7E3859B9DEBA19464C74B74AC48A0B73FC8D2E7F8033E86208F0792B6E5B6DE36C99DEF604949811D1671EF6B0A4781B4E7A0A72AD855 +Test: Verify +Message: B8E2FB9EAE22FB2C0021 +Signature: 416D33F8C213CF81F805F54FC1D4E7C6A588A0965F1C9CAEEA1D41452E20935AAF2D30F957584B56621035430212A428E27A2F687CA9DBB596C19864AE692EF7BBA730F3D70CC2DDE15AB71E1E350C0C316EFA1A831ACD1441598B112482487DF72F58ED318182C7CD0906FE39C5655BF1313F29A15D60A6178CBF600C7FBFF8994840ED649C3C4026A463B3EA39C692B7D112B128BE49E1E32D4A7FF8D4513283D8DCD9CCB8FB7300BE0BDD4C44DAA2F7049B3AD83437093E623442AC69B48911CDA21E95E0775041F67F6E6AE01DCE646AEC20908E7C1B693600FE41ABA85AC0C778641E46C419083E41773C749DB3E1BD8FD764E271860D2D7F8E11BD6AB3 +Test: Verify +Message: 8C8C306A629373BAE647 +Signature: 0E9A00045FFD399D9DA9D0D7E543CF9FFD098BC23E72DD7763A64F22C7F0479CE866E31438B8F7DE31A18F35AF419BED6C67BE1540614D3310DD24F019E14FCC3AF73743F4C143D4B79CDF35C752A300F0A8251CCFF4AAF18785C533A7DF1A20AFE6770DEBD1B8BA2C83B2E345A04F833CD173E998FF9840C2F8A370FFDCFF5FD95CBD71B25FC9972192470FD145975344F64C2F6D68CB3513F48F9FC070021BEE8F6A4282D098C44DF655CE415E89B97994AE3ABE85986C7EE0AC348EF2A4F52D102EA80836E77E81AD3678803E53C83CF2F30D2D4950FB6B038CCB3F2690A9381EB34D6C09E88C090AB05E28047DC490EB8A1282FEB38E82FB0B18309284C4 +Test: Verify +Message: 15E7B7B7ED0F176B6799 +Signature: 39FF4B5FA50AE498F3C91A655E6865840D1FC401EE02DBC8460A59DEB8816E6680F712B7BAF8D4DC11A3B54BF906BE698306F0449BB43F3F223B944D930A1A3C718E8A9E2EEDEC5A07AB817C26A80CC2A2EE2846A597EAB8A999D38DB98490166F2574524038BBDF24B4E4622C843210C6B94987638C6976562EA9727385B152614C18349BD54AD95DE33D5354954B505E5259CCDA47E3CECEF3154F6E5481E536BAB568146A0BFCB66573714A7BA7ABE0385115720687F33D9C6EF6BB60272F1272CF349990E3A2FBCCE180B730792101089B164AE5A001F5263F7493AF148D6E0953E311AD12E4202D35F96DD30885663B5101F9B05675FCD2FCC4FCC4DDFF +Test: Verify +Message: B36724C92954C38D0288 +Signature: 3C8CD3614555568BBECA99174B7B203D0BC6FABE9E6FFE0C41EB4D9A2C601D2393CA1E01B7D7E99337758AC914C9F151311E5AE6708DAF1D8C825DA471652C6E13A8FE5802D7AE097BFC899A4EC8CA235B5982B9058C53AAD52823ACF692290EB8823C126635AB0BBF101C2B3149AB16183FA2DBB049DDB99C5E83723E4D4693CA3A08588AA868C677D42ABDAA6586EF192391D276C5E5AF0763ACCA6293F06250C51FDC2AD369CD44EB5F654E98761C881DDEC08E795FFB229B20522349B0714059E18B7B23A48875EAB12ED3F0A011D3A985DD7384B0046F39FA6C1A331F3D4C5125100BA58666935C68A7A10849D9C74850BAB82AE15EC950A283F3E7DAD8 +Test: Verify +Message: FA95400C2B14E064F76A +Signature: 3F67F9DBEB88E6AD057BEDC3D97030555A908867EC578A6CA572137CB61C21036AADE6DDC5592EC7CCB6B263E51B4C886A51904C858040E493D64B9ACE5BAA50C4A66D04ACCDFE0039D8541C4363DEFFCF93BDF5F5CC1FB64855D956B5EFD42D4C9B96B9CBAA97A32F02AAB307674E53404E6836DB5C96B59572ADBFD1113B87608ACE6D0898CB02E35575CC28D38A9FF8C1C4AD36BAA991DEFAB533F0A6C9C2F0F0815F1D659ED576E5DB18494A54B6817D9E34A134F3B9A0F1E8C77FC204B6EE087C0445A7036C935117E338D092F6E1FF4DF7605525C409456A5195233A176B29B2FD8FB2808D0412FCA0541B2BB6800BD8BB9DC9DC25230166071E8D961E +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/salsa.txt b/external/crypto++-5.6.3/TestVectors/salsa.txt new file mode 100644 index 000000000..b00ff9617 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/salsa.txt @@ -0,0 +1,463 @@ +AlgorithmType: SymmetricCipher +Name: Salsa20 +Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/verified.test-vectors?rev=161&view=markup +Comment: Set 1, vector# 0 +Key: 80000000000000000000000000000000 +IV: 0000000000000000 +Plaintext: r16 00000000 +Seek: 0 +Ciphertext: 4DFA5E481DA23EA09A31022050859936DA52FCEE218005164F267CB65F5CFD7F2B4F97E0FF16924A52DF269515110A07F9E460BC65EF95DA58F740B7D1DBB0AA +Test: Encrypt +Seek: 448 +Ciphertext: B375703739DACED4DD4059FD71C3C47FC2F9939670FAD4A46066ADCC6A5645783308B90FFB72BE04A6B147CBE38CC0C3B9267C296A92A7C69873F9F263BE9703 +Test: Encrypt +Seek: 192 +Plaintext: r32 00000000 +Ciphertext: DA9C1581F429E0A00F7D67E23B730676783B262E8EB43A25F55FB90B3E753AEF8C6713EC66C51881111593CCB3E8CB8F8DE124080501EEEB389C4BCB6977CF95\ +7D5789631EB4554400E1E025935DFA7B3E9039D61BDC58A8697D36815BF1985CEFDF7AE112E5BB81E37ECF0616CE7147FC08A93A367E08631F23C03B00A8DA2F +Test: Encrypt +Comment: Set 3, vector#243 +Key: F3F4F5F6F7F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F101112 +IV: 0000000000000000 +Plaintext: r16 00000000 +Seek: 0 +Ciphertext: B4C0AFA503BE7FC29A62058166D56F8F5D27DC246F75B9AD8760C8C39DFD87492D3B76D5D9637F009EADA14458A52DFB09815337E72672681DDDC24633750D83 +Test: Encrypt +Seek: 448 +Ciphertext: 5A5FB5C8F0AFEA471F0318A4A2792F7AA5C67B6D6E0F0DDB79961C34E3A564BA2EECE78D9AFF45E510FEAB1030B102D39DFCECB77F5798F7D2793C0AB09C7A04 +Test: Encrypt +Seek: 192 +Plaintext: r32 00000000 +Ciphertext: DBBA0683DF48C335A9802EEF0252256354C9F763C3FDE19131A6BB7B85040624B1D6CD4BF66D16F7482236C8602A6D58505EEDCCA0B77AED574AB583115124B9\ +F0C5F98BAE05E019764EF6B65E0694A904CB9EC9C10C297B1AB1A6052365BB78E55D3C6CB9F06184BA7D425A92E7E987757FC5D9AFD7082418DD64125CA6F2B6 +Test: Encrypt +Comment: Set 6, vector# 3 +Seek: 0 +Key: 0F62B5085BAE0154A7FA4DA0F34699EC3F92E5388BDE3184D72A7DD02376C91C +IV: 288FF65DC42B92F9 +Plaintext: r131072 00 +CiphertextXorDigest: E00EBCCD70D69152725F9987982178A2E2E139C7BCBE04CA8A0E99E318D9AB76F988C8549F75ADD790BA4F81C176DA653C1A043F11A958E169B6D2319F4EEC1A +Test: EncryptXorDigest +AlgorithmType: SymmetricCipher +Name: Salsa20 +Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/reduced/12-rounds/verified.test-vectors?rev=210&view=auto +Comment: Set 1, vector# 0 +Rounds: 12 +Key: 80000000000000000000000000000000 +IV: 0000000000000000 +Plaintext: r64 00 +Seek: 0 +Ciphertext: FC207DBFC76C5E1774961E7A5AAD09069B2225AC1CE0FE7A0CE77003E7E5BDF8B31AF821000813E6C56B8C1771D6EE7039B2FBD0A68E8AD70A3944B677937897 +Test: Encrypt +Seek: 192 +Ciphertext: 4B62A4881FA1AF9560586510D5527ED48A51ECAFA4DECEEBBDDC10E9918D44AB26B10C0A31ED242F146C72940C6E9C3753F641DA84E9F68B4F9E76B6C48CA5AC +Test: Encrypt +Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/reduced/8-rounds/verified.test-vectors?rev=210&view=auto +Comment: Set 1, vector# 0 +Rounds: 8 +Key: 80000000000000000000000000000000 +IV: 0000000000000000 +Plaintext: r64 00 +Seek: 0 +Ciphertext: A9C9F888AB552A2D1BBFF9F36BEBEB337A8B4B107C75B63BAE26CB9A235BBA9D784F38BEFC3ADF4CD3E266687EA7B9F09BA650AE81EAC6063AE31FF12218DDC5 +Test: Encrypt +Seek: 192 +Ciphertext: BB5B6BB2CC8B8A0222DCCC1753ED4AEB23377ACCBD5D4C0B69A8A03BB115EF71871BC10559080ACA7C68F0DEF32A80DDBAF497259BB76A3853A7183B51CC4B9F +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: XSalsa20 +Source: created by Wei Dai using naclcrypto-20090308 +Key: 1b27556473e985d462cd51197a9a46c76009549eac6474f206c4ee0844f68389 +IV: 69696ee955b62b73cd62bda875fc73d68219e0036b7a0b37 +Plaintext: r139 00 +Ciphertext: \ +eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880\ +309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e55855796\ +25337bd3ab619d615760d8c5b224a85b1d0efe0eb8a7ee163abb0376529fcc09\ +bab506c618e13ce777d82c3ae9d1a6f972d4160287cbfe60bf2130fc0a6ff604\ +9d0a5c8a82f429231f0080 +Key: a6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff88030 +IV: 9e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c +Plaintext: 093c5e5585579625337bd3ab619d615760d8c5b224a85b1d0efe0eb8a7ee163abb0376529fcc09bab506c618e13ce777d82c3ae9d1a6f972d4160287cbfe60bf2130fc0a6ff6049d0a5c8a82f429231f008082e845d7e189d37f9ed2b464e6b919e6523a8c1210bd52a02a4c3fe406d3085f5068d1909eeeca6369abc981a42e87fe665583f0ab85ae71f6f84f528e6b397af86f6917d9754b7320dbdc2fea81496f2732f532ac78c4e9c6cfb18f8e9bdf74622eb126141416776971a84f94d156beaf67aecbf2ad412e76e66e8fad7633f5b6d7f3d64b5c6c69ce29003c6024465ae3b89be78e915d88b4b5621d +Ciphertext: b2af688e7d8fc4b508c05cc39dd583d6714322c64d7f3e63147aede2d9534934b04ff6f337b031815cd094bdbc6d7a92077dce709412286822ef0737ee47f6b7ffa22f9d53f11dd2b0a3bb9fc01d9a88f9d53c26e9365c2c3c063bc4840bfc812e4b80463e69d179530b25c158f543191cff993106511aa036043bbc75866ab7e34afc57e2cce4934a5faae6eabe4f221770183dd060467827c27a354159a081275a291f69d946d6fe28ed0b9ce08206cf484925a51b9498dbde178ddd3ae91a8581b91682d860f840782f6eea49dbb9bd721501d2c67122dea3b7283848c5f13e0c0de876bd227a856e4de593a3 +Test: Encrypt +IV: b2af688e7d8fc4b508c05cc39dd583d6714322c64d7f3e63 +Ciphertext: 418078fe843f5984dd3c7975d1ff51af4dceda640999aaa3c28618ae286ca15051cb4d55f9da22a213ef14a2b905b52c99a557854c7f2a6d6ed6f69c1c6649f3fb67b8628468029b3367920c2e1148aa1f3b9c695cb1426f09ce84045842946e0454e41ab1edb32cae4b95669de4e2ccaf00ba86ffeae6a9c5fce4153baddb0d8998a600537a9649939cb7d7a9c4e8cbca0fab77963abd516699879de0b1971dc7328668111ff5b77c253b9e6346d1a2ce6e390cd736156ad7f44b339cfb141f00e7a766c06e130b0c31d88980d2ad8814a2d641599162ab8af25d93067f06a49637eaf6523806b8fa07d56628bb +Test: Resync +Key: 9e1da239d155f52ad37f75c7368a536668b051952923ad44f57e75ab588e475a +IV: af06f17859dffa799891c4288f6635b5c5a45eee9017fd72 +Plaintext: feac9d54fc8c115ae247d9a7e919dd76cfcbc72d32cae4944860817cbdfb8c04e6b1df76a16517cd33ccf1acda9206389e9e318f5966c093cfb3ec2d9ee2de856437ed581f552f26ac2907609df8c613b9e33d44bfc21ff79153e9ef81a9d66cc317857f752cc175fd8891fefebb7d041e6517c3162d197e2112837d3bc4104312ad35b75ea686e7c70d4ec04746b52ff09c421451459fb59f +Ciphertext: 2c261a2f4e61a62e1b27689916bf03453fcbc97bb2af6f329391ef063b5a219bf984d07d70f602d85f6db61474e9d9f5a2deecb4fcd90184d16f3b5b5e168ee03ea8c93f3933a22bc3d1a5ae8c2d8b02757c87c073409052a2a8a41e7f487e041f9a49a0997b540e18621cad3a24f0a56d9b19227929057ab3ba950f6274b121f193e32e06e5388781a1cb57317c0ba6305e910961d01002f0 +Test: Encrypt +IV: 2c261a2f4e61a62e1b27689916bf03453fcbc97bb2af6f32 +Ciphertext: 7030af4a9db8a6b95f55f962efefcc60d8ceb0d5d920e808cebd8cf6f31542d227a67c9db8888cfcb9410ae357f8a3da06a608a93b7fd5513978c6b8b837f6ecaafd3366495cdd3ab719d9d4c2ac74d6ea2eb117f30369ea62727fa6dc7982f668fa3bf44c9da8e70ff8c18b07d63aa01afe1311bdafc457d06c69aaea0dfbb1fc89d1574ad1e7be8b459d4cf36bdd88db0363219652089c50 +Test: Resync +Key: d5c7f6797b7e7e9c1d7fd2610b2abf2bc5a7885fb3ff78092fb3abe8986d35e2 +IV: 744e17312b27969d826444640e9c4a378ae334f185369c95 +Plaintext: 7758298c628eb3a4b6963c5445ef66971222be5d1a4ad839715d1188071739b77cc6e05d5410f963a64167629757 +Ciphertext: 27b8cfe81416a76301fd1eec6a4d99675069b2da2776c360db1bdfea7c0aa613913e10f7a60fec04d11e65f2d64e +Test: Encrypt +IV: 27b8cfe81416a76301fd1eec6a4d99675069b2da2776c360 +Ciphertext: ed158a1dd07f4316d403af3e6977afaac8205d678b38fa5928c61e366ff27003143d5d20482a2ea76a50756225a4 +Test: Resync +Key: 737d7811ce96472efed12258b78122f11deaec8759ccbd71eac6bbefa627785c +IV: 6fb2ee3dda6dbd12f1274f126701ec75c35c86607adb3edd +Plaintext: 501325fb2645264864df11faa17bbd58312b77cad3d94ac8fb8542f0eb653ad73d7fce932bb874cb89ac39fc47f8267cf0f0c209f204b2d8578a3bdf461cb6a271a468bebaccd9685014ccbc9a73618c6a5e778a21cc8416c60ad24ddc417a130d53eda6dfbfe47d09170a7be1a708b7b5f3ad464310be36d9a2a95dc39e83d38667e842eb6411e8a23712297b165f690c2d7ca1b1346e3c1fccf5cafd4f8be0 +Ciphertext: 6724c372d2e9074da5e27a6c54b2d703dc1d4c9b1f8d90f00c122e692ace7700eadca942544507f1375b6581d5a8fb39981c1c0e6e1ff2140b082e9ec016fce141d5199647d43b0b68bfd0fea5e00f468962c7384dd6129aea6a3fdfe75abb210ed5607cef8fa0e152833d5ac37d52e557b91098a322e76a45bbbcf4899e790618aa3f4c2e5e0fc3de93269a577d77a5502e8ea02f717b1dd2df1ec69d8b61ca +Test: Encrypt +IV: 6724c372d2e9074da5e27a6c54b2d703dc1d4c9b1f8d90f0 +Ciphertext: cfb653dd50a04a8580847d5bb98dc15e27c60f5a70da635718ba6d589f47935ed476fc960ffaf3b8750a59171b1434429a977ba878aea7ace8dd083a9238585112591165d0948a86e89e6118d572aa85667cceffd78a60baa5a152dc5e29bdd93f7389edde1541eec2f3aac38ea2bfc812f73de7e2e7b1322468f823a2c7c16e30fe9283894ac057da5c45a67f4988b4edafeb51c1b4a51a849d188b15838552 +Test: Resync +Key: 760158da09f89bbab2c99e6997f9523a95fcef10239bcca2573b7105f6898d34 +IV: 43636b2cc346fc8b7c85a19bf507bdc3dafe953b88c69dba +Plaintext: d30a6d42dff49f0ed039a306bae9dec8d9e88366cc19e8c3642fd58fa0794ebf8029d949730339b0823a51f0f49f0d2c71f1051c1e0e2c86941f172789cdb1b0107413e70f982ff9761877bb526ef1c3eb1106a948d60ef21bd35d32cfd64f89b79ed63ecc5cca56246af736766f285d8e6b0da9cb1cd21020223ffacc5a32 +Ciphertext: c815b6b79b64f9369aec8dce8c753df8a50f2bc97c70ce2f014db33a65ac5816bac9e30ac08bdded308c65cb87e28e2e71b677dc25c5a6499c1553555daf1f55270a56959dffa0c66f24e0af00951ec4bb59ccc3a6c5f52e0981647e53e439313a52c40fa7004c855b6e6eb25b212a138e843a9ba46edb2a039ee82a263abe +Test: Encrypt +IV: c815b6b79b64f9369aec8dce8c753df8a50f2bc97c70ce2f +Ciphertext: ab7204ab4f995c2d87376c3586f0261250907ab2c25e2d232f10f51f0f3a3f11ff704ba188a508301fb9d5f7e4d55070631ecd2e3be5d79d4fa67f4f4acb3879afc2dc18c09446489b79dd3043f74027e9a24a54d8babe757c9a3470a95cb7b7b093331e32534b337d697046f7349bcfa89036b3cf50ecfc6f1e61300a49b6 +Test: Resync +Key: 27ba7e81e7edd4e71be53c07ce8e633138f287e155c7fa9e84c4ad804b7fa1b9 +IV: ea05f4ebcd2fb6b000da0612861ba54ff5c176fb601391aa +Plaintext: e09ff5d2cb050d69b2d42494bde5825238c756d6991d99d7a20d1ef0b83c371c89872690b2fc11d5369f4fc4971b6d3d6c078aef9b0f05c0e61ab89c025168054defeb03fef633858700c58b1262ce011300012673e893e44901dc18eee3105699c44c805897bdaf776af1833162a21a +Ciphertext: a23e7ef93c5d0667c96d9e404dcbe6be62026fa98f7a3ff9ba5d458643a16a1cef7272dc6097a9b52f35983557c77a11b314b4f7d5dc2cca15ee47616f861873cbfed1d32372171a61e38e447f3cf362b3abbb2ed4170d89dcb28187b7bfd206a3e026f084a7e0ed63d319de6bc9afc0 +Test: Encrypt +IV: a23e7ef93c5d0667c96d9e404dcbe6be62026fa98f7a3ff9 +Ciphertext: 5c77efcb16097df824bd58cd3498e07af1c761740b5539929115e2caf3bc10eed2a16254a4306f4e20827247900276ce887362990c070c0f79e15987473b7ad240e7a9f8e6e3f020fb337438cc3c8b81c4cdbfbdd7b543b13a48a4959744f3efcb99a939c0599ce32f816d12c2b47a2f +Test: Resync +Key: 6799d76e5ffb5b4920bc2768bafd3f8c16554e65efcf9a16f4683a7a06927c11 +IV: 61ab951921e54ff06d9b77f313a4e49df7a057d5fd627989 +Plaintext: 472766 +Ciphertext: 8fd7df +Test: Encrypt +IV: 8fd7dfcb16097df824bd58cd3498e07af1c761740b553992 +Ciphertext: 85e098 +Test: Resync +Key: f68238c08365bb293d26980a606488d09c2f109edafa0bbae9937b5cc219a49c +IV: 5190b51e9b708624820b5abdf4e40fad1fb950ad1adc2d26 +Plaintext: 47ec6b1f73c4b7ff5274a0bfd7f45f864812c85a12fbcb3c2cf8a3e90cf66ccf2eacb521e748363c77f52eb426ae57a0c6c78f75af71284569e79d1a92f949a9d69c4efc0b69902f1e36d7562765543e2d3942d9f6ff5948d8a312cff72c1afd9ea3088aff7640bfd265f7a9946e606abc77bcedae6bddc75a0dba0bd917d73e3bd1268f727e0096345da1ed25cf553ea7a98fea6b6f285732de37431561ee1b3064887fbcbd71935e02 +Ciphertext: 36160e88d3500529ba4edba17bc24d8cfaca9a0680b3b1fc97cf03f3675b7ac301c883a68c071bc54acdd3b63af4a2d72f985e51f9d60a4c7fd481af10b2fc75e252fdee7ea6b6453190617dcc6e2fe1cd56585fc2f0b0e97c5c3f8ad7eb4f31bc4890c03882aac24cc53acc1982296526690a220271c2f6e326750d3fbda5d5b63512c831f67830f59ac49aae330b3e0e02c9ea0091d19841f1b0e13d69c9fbfe8a12d6f30bb734d9d2 +Test: Encrypt +IV: 36160e88d3500529ba4edba17bc24d8cfaca9a0680b3b1fc +Ciphertext: f003b213737415a81894a3d3d8fe4e4434d4df2b253d60c44609bdc0414cedf8bae297ecdb1d0b92393dd6dd7027b555388ac8a66308082fc6327ad94ad96223003de15c48a06e9cd99b5561e7fc5949c6ba8cf11d6ba1374ec32062caef541e7252d168781aab4c637793433b3998c5a5013fd35c336600a02765ddbf52b97ae80dbfbbe55e43c6bd5f746a1c2df4c80611c76a90308c47b2807876249d6d3c507a1a96c2bbb8242ccd +Test: Resync +Key: 45b2bd0de4ed9293ec3e26c4840faaf64b7d619d51e9d7a2c7e36c83d584c3df +IV: 546c8c5d6be8f90952cab3f36d7c1957baaa7a59abe3d7e5 +Plaintext: 5007c8cd5b3c40e17d7fe423a87ae0ced86bec1c39dc07a25772f3e96dabd56cd3fd7319f6c9654925f2d87087a700e1b130da796895d1c9b9acd62b266144067d373ed51e787498b03c52faad16bb3826fa511b0ed2a19a8663f5ba2d6ea7c38e7212e9697d91486c49d8a000b9a1935d6a7ff7ef23e720a45855481440463b4ac8c4f6e7062adc1f1e1e25d3d65a31812f58a71160 +Ciphertext: 8eacfba568898b10c0957a7d44100685e8763a71a69a8d16bc7b3f88085bb9a2f09642e4d09a9f0ad09d0aad66b22610c8bd02ff6679bb92c2c026a216bf425c6be35fb8dae7ff0c72b0efd6a18037c70eed0ca90062a49a3c97fdc90a8f9c2ea536bfdc41918a7582c9927fae47efaa3dc87967b7887dee1bf071734c7665901d9105dae2fdf66b4918e51d8f4a48c60d19fbfbbcba +Test: Encrypt +IV: 8eacfba568898b10c0957a7d44100685e8763a71a69a8d16 +Ciphertext: f17808cf21dba4762ced5fcc264f615a4619d8d5ee3278dbdacf14a799f8ee5f8a38a7fd9d262b336e51a8790c90fb8f0b63a49edae81f9a200ad73d9ed5ce6257524b506d7a219013e3e44a1f2a264b7f7f121e5d4765d0bdfe4a36fc51e48ee21e9dcbc3dc2541405bbdb90490fd786b942a07786094fc990be21e5b746d522cad26269a76c85134ee654f33485807fc28cf87ac37 +Test: Resync +Key: fe559c9a282beb40814d016d6bfcb2c0c0d8bf077b1110b8703a3ce39d70e0e1 +IV: b076200cc7011259805e18b304092754002723ebec5d6200 +Plaintext: 6db65b9ec8b114a944137c821fd606be75478d928366d5284096cdef782fcff7e8f59cb8ffcda979757902c5ffa6bc477ceaa4cb5d5ea76f94d91e833f823a6bc78f1055dfa6a97bea8965c1cde67a668e001257334a585727d9e0f7c1a06e88d3d25a4e6d9096c968bf138e116a3ebeffd4bb4808adb1fd698164ba0a35c709a47f16f1f4435a2345a9194a00b95abd51851d505809a6077da9baca5831afff31578c487ee68f2767974a98a7e803aac788da98319c4ea8eaa3d394855651f484cef543f537e35158ee29 +Ciphertext: 4dce9c8f97a028051b0727f34e1b9ef21f06f0760f36e71713204027902090ba2bb6b13436ee778d9f50530efbd7a32b0d41443f58ccaee781c7b716d3a96fdec0e3764ed7959f34c3941278591ea033b5cbadc0f1916032e9bebbd1a8395b83fb63b1454bd775bd20b3a2a96f951246ac14daf68166ba62f6cbff8bd121ac9498ff8852fd2be975df52b5daef3829d18eda42e715022dcbf930d0a789ee6a146c2c7088c35773c63c06b4af4559856ac199ced86863e4294707825337c5857970eb7fddeb263781309011 +Test: Encrypt +IV: 4dce9c8f97a028051b0727f34e1b9ef21f06f0760f36e717 +Ciphertext: 534f5151319c299d7356be2275ed2137fab66742797370b511e5150dcf7bc75c06d5249e8e8bd7c16e563cc7d99368a7a7f47f811a2ae2b632c73e9f49641bf9954d4df19c2778221d780f799806757738b327e6aeebab6bb22137f8b994c1e08baff75bb2774576bce2deb599817fc7a69860c538efffe91439f4714e4629b00a25b5b1a6be8aa7da2be33bad953481926e0067a70d4ff1a7bd0111e605ef6a2d66fa7af43d746c24a5d464dd6f75773aa9b65bbdfad9b82fe80f182b144cea9211d0b2472de873008509 +Test: Resync +Key: 0ae10012d7e56614b03dcc89b14bae9242ffe630f3d7e35ce8bbb97bbc2c92c3 +IV: f96b025d6cf46a8a12ac2af1e2aef1fb83590adadaa5c5ea +Plaintext: ea0f354e96f12bc72bbaa3d12b4a8ed879b042f0689878f46b651cc4116d6f78409b11430b3aaa30b2076891e8e1fa528f2fd169ed93dc9f84e24409eec2101daf4d057be2492d11de640cbd7b355ad29fb70400fffd7cd6d425abeeb732a0eaa4330af4c656252c4173deab653eb85c58462d7ab0f35fd12b613d29d473d330310dc323d3c66348bbdbb68a326324657cae7b77a9e34358f2cec50c85609e73056856796e3be8d62b6e2fe9f953 +Ciphertext: e8abd48924b54e5b80866be7d4ebe5cf4274cafff08b39cb2d40a8f0b472398aedc776e0793812fbf1f60078635d2ed86b15efcdba60411ee23b07233592a44ec31b1013ce8964236675f8f183aef885e864f2a72edf4215b5338fa2b54653dfa1a8c55ce5d95cc605b9b311527f2e3463ffbec78a9d1d65dabad2f338769c9f43f133a791a11c7eca9af0b771a4ac32963dc8f631a2c11217ac6e1b9430c1aae1ceebe22703f429998a8fb8c641 +Test: Encrypt +IV: e8abd48924b54e5b80866be7d4ebe5cf4274cafff08b39cb +Ciphertext: e8c59b616dd10474930c432422d23d8df8dee1c626def1278eb6c9828435c0c8a98aea9d350752a78cf0cf1de7973436605f22b0d40b9059d777c55c8fd02cd9dbab6888161ed28979c64b700d7ea48038edf36af21078713f844f5f23a4f271aad3562ed2cd773de622fff2f0b5785672760a7064e5415c76ffec522eb1225868345e89a9fcbb4f12c1176b01550fe7a74f750dc43d6fa4718c33ba99b0084c7a1a8e245c8566056296aabe13af +Test: Resync +Key: 082c539bc5b20f97d767cd3f229eda80b2adc4fe49c86329b5cd6250a9877450 +IV: 845543502e8b64912d8f2c8d9fffb3c69365686587c08d0c +Plaintext: a96bb7e910281a6dfad7c8a9c370674f0ceec1ad8d4f0de32f9ae4a23ed329e3d6bc708f876640a229153ac0e7281a8188dd77695138f01cda5f41d5215fd5c6bdd46d982cb73b1efe2997970a9fdbdb1e768d7e5db712068d8ba1af6067b5753495e23e6e1963af012f9c7ce450bf2de619d3d59542fb55f3 +Ciphertext: 835da74fc6de08cbda277a7966a07c8dcd627e7b17adde6d930b6581e3124b8baad096f693991fedb1572930601fc7709541839b8e3ffd5f033d2060d999c6c6e3048276613e648000acb5212cc632a916afce290e20ebdf612d08a6aa4c79a74b070d3f872a861f8dc6bb07614db515d363349d3a8e3336a3 +Test: Encrypt +IV: 835da74fc6de08cbda277a7966a07c8dcd627e7b17adde6d +Ciphertext: a91f3039c37f753857510f121cbbab8f942b41a4d04815729361268c84abed9fd3dd2c0a84ea5dc3cab46245f720d8f0fd81ce4c7837aae561186f66ae70db9e5c2238f1b417b0ab001eada16d1f9bcc2ed74d335fe8da60bebd8b1c4ae4c51d8c46eec7d1fd575a5824bced85b02bfcb1e11d5686471b2791 +Test: Resync +Key: 3d02bff3375d403027356b94f514203737ee9a85d2052db3e4e5a217c259d18a +IV: 74216c95031895f48c1dba651555ebfa3ca326a755237025 +Plaintext: 0d4b0f54fd09ae39baa5fa4baccf2e6682e61b257e01f42b8f +Ciphertext: 16c4006c28365190411eb1593814cf15e74c22238f210afc3d +Test: Encrypt +IV: 16c4006c28365190411eb1593814cf15e74c22238f210afc +Ciphertext: c86458ffa23d50437f3385ea7d3fbae5cdc1df7a14658b8316 +Test: Resync +Key: ad1a5c47688874e6663a0f3fa16fa7efb7ecadc175c468e5432914bdb480ffc6 +IV: e489eed440f1aae1fac8fb7a9825635454f8f8f1f52e2fcc +Plaintext: aa6c1e53580f03a9abb73bfdadedfecada4c6b0ebe020ef10db745e54ba861caf65f0e40dfc520203bb54d29e0a8f78f16b3f1aa525d6bfa33c54726e59988cfbec78056 +Ciphertext: 02fe84ce81e178e7aabdd3ba925a766c3c24756eefae33942af75e8b464556b5997e616f3f2dfc7fce91848afd79912d9fb55201b5813a5a074d2c0d4292c1fd441807c5 +Test: Encrypt +IV: 02fe84ce81e178e7aabdd3ba925a766c3c24756eefae3394 +Ciphertext: 5526b8ff95272e95ad298c30f9f165353ecf0f68aa2943476ec53c386cf07c465b677be13d01279779965dda94d23fe9452dc4934e344c2ee0f6f5e32efc2b3f79630492 +Test: Resync +Key: 053a02bedd6368c1fb8afc7a1b199f7f7ea2220c9a4b642a6850091c9d20ab9c +IV: c713eea5c26dad75ad3f52451e003a9cb0d649f917c89dde +Plaintext: 8f0a8a164760426567e388840276de3f95cb5e3fadc6ed3f3e4fe8bc169d9388804dcb94b6587dbb66cb0bd5f87b8e98b52af37ba290629b858e0e2aa7378047a26602 +Ciphertext: 516710e59843e6fbd4f25d0d8ca0ec0d47d39d125e9dad987e0518d49107014cb0ae405e30c2eb3794750bca142ce95e290cf95abe15e822823e2e7d3ab21bc8fbd445 +Test: Encrypt +IV: 516710e59843e6fbd4f25d0d8ca0ec0d47d39d125e9dad98 +Ciphertext: aadb7c36647ded09fca7587edfa9bbe81911925fa8996330c8e7b77601075e5f94404db9f82c67e2cd39d1649062d4c30cf23bc28f9ddd6d5b9ec586a7de7f8ef45560 +Test: Resync +Key: 5b14ab0fbed4c58952548a6cb1e0000cf4481421f41288ea0aa84add9f7deb96 +IV: 54bf52b911231b952ba1a6af8e45b1c5a29d97e2abad7c83 +Plaintext: 37fb44a675978b560ff9a4a87011d6f3ad2d37a2c3815b45a3c0e6d1b1d8b1784cd468927c2ee39e1dccd4765e1c3d676a335be1ccd6900a45f5d41a317648315d8a8c24adc64eb285f6aeba05b9029586353d303f17a807658b9ff790474e1737bd5fdc604aeff8dfcaf1427dcc3aacbb0256badcd183ed75a2dc52452f87d3c1ed2aa583472b0ab91cda20614e9b6fdbda3b49b098c95823cc72d8e5b717f2314b0324e9ce +Ciphertext: ae6deb5d6ce43d4b09d0e6b1c0e9f46157bcd8ab50eaa3197ff9fa2bf7af649eb52c68544fd3adfe6b1eb316f1f23538d470c30dbfec7e57b60cbcd096c782e7736b669199c8253e70214cf2a098fda8eac5da79a9496a3aae754d03b17c6d70d1027f42bf7f95ce3d1d9c338854e158fcc803e4d6262fb639521e47116ef78a7a437ca9427ba645cd646832feab822a208278e45e93e118d780b988d65397eddfd7a819526e +Test: Encrypt +IV: ae6deb5d6ce43d4b09d0e6b1c0e9f46157bcd8ab50eaa319 +Ciphertext: 89e9c51abd31d6156b96c4e82ef0dfe5c376bd6324750fdbc46e5ae63897323c816fb5bb8e6bf4335853e512cc334dbbfecccfe4e5c8fe8289963ee7127f3ac56bc26b7bd4f0d1e0afb06bde930e7587eedf07995d5052bbff5453147c1555a7c8534111295bb5ab9e89645cc330ae3e0d9294c9e7d6d841579e93aefeaed879f8e8299459a3c07e3c9dee497360510668c5246970ad39077e8d8935b0d885f11d2f06dee0d7 +Test: Resync +Key: d74636e3413a88d85f322ca80fb0bd650bd0bf0134e2329160b69609cd58a4b0 +IV: efb606aa1d9d9f0f465eaa7f8165f1ac09f5cb46fecf2a57 +Plaintext: f85471b75f6ec81abac2799ec09e98e280b2ffd64ca285e5a0109cfb31ffab2d617b2c2952a2a8a788fc0da2af7f530758f74f1ab56391ab5ff2adbcc5be2d6c7f49fbe8118104c6ff9a23c6dfe52f57954e6a69dcee5db06f514f4a0a572a9a8525d961dae72269b987189d465df6107119c7fa790853e063cba0fab7800ca932e258880fd74c33c784675bedad0e7c09e9cc4d63dd5e9713d5d4a0196e6b562226ac31b4f57c04f90a181973737ddc7e80f364112a9fbb435ebdbcabf7d490ce52 +Ciphertext: b2b795fe6c1d4c83c1327e015a67d4465fd8e32813575cbab263e20ef05864d2dc17e0e4eb81436adfe9f638dcc1c8d78f6b0306baf938e5d2ab0b3e05e735cc6fff2d6e02e3d60484bea7c7a8e13e23197fea7b04d47d48f4a4e5944174539492800d3ef51e2ee5e4c8a0bdf050c2dd3dd74fce5e7e5c37364f7547a11480a3063b9a0a157b15b10a5a954de2731ced055aa2e2767f0891d4329c426f3808ee867bed0dc75b5922b7cfb895700fda016105a4c7b7f0bb90f029f6bbcb04ac36ac16 +Test: Encrypt +IV: b2b795fe6c1d4c83c1327e015a67d4465fd8e32813575cba +Ciphertext: 0a8a907dc7f30f6f68eec465ead25768383956a304aa32e4ccea6e3756cbb19f2751e3b68339ade1499004a88170e44620529d3c568cb1e014c16548830dfbce1b47a2dcdd28e59bb0daf5908c5ff51817bd119fe33bda07d63e93a3522685eb101d912b02d093780d10884959ae4a49e2fb7fca51b81394f09314879a41f6dc2f4a7dc34e88da4747a5a1fc15dcb207d13222f08f91f079eafbded0d6036325f607ff29ff2fc7635e8c3767d61a3b7814227d6a2798d623bfdf674604e4e9e03529 +Test: Resync +Key: ea060c72f6e0080fd4a9a2131c9d684902415cab34fce4e52d62273e3c385f37 +IV: 5826043957a27509423fdd82f34935928a4b23a84ede72c8 +Plaintext: 20ae58dbf5c20225c35518711a86a19a61d5ba47ab17e8c5fa9658333d40ed31bffb79cde927c36baf61ed8df37acac330f64471bd91d90bfafa72dc8cdb6ed95ec6610cd6e8f2859255216a3eb4b573410d5644a40e4f0fa785d556304489c0023a1991eb0d01b5 +Ciphertext: 6025c4d5bcc769cc3e67b88340b4101690eb283654c761f8a0af360926313129f16d1c9358ecbaf66acd85787c7c1f52a953bc05e91d43bf3d94d341bffc5913435fb3a8e6264ccd1c355472929a140fe30a22689b055082c70395e0b070a3f0967ab36848cdf3d9 +Test: Encrypt +IV: 6025c4d5bcc769cc3e67b88340b4101690eb283654c761f8 +Ciphertext: a420fde6c359342819ed9c07853c594c0098fd2a3c8da24713dbd12261b528e43af7dd52ddf1a1b553d08c20b0ab399c38a067fb115368c990d9e839735c8427aa885eacb5c2900d1d04afdd3d35793f11c78dd826c5d09351f39823a13976eaa5a49b0bdb054043 +Test: Resync +Key: 115aaaa3a3827fb05175412dc6478747d7c128ce2637b6afdfe3213f7b0b6991 +IV: f8cbe32bdb4c8eac3a571f186ef683b9eb902302ff7ac746 +Plaintext: b09472fbdaa3e4bdb7b04c8819fb3257f764154d09cea22e9a67b40f7e601a97c469811773d2733eb4ab0da6249f237d4c063012fd06714a726b24a512daa7e287d39818980a6720abc45f10aab7d71da318244507b5a9d0aeae76ec5efd3b5ce167c38196744d13b07a14805ee49dc4421e0c59d559e8518a9911682ce1d2b307ccba48dd98c003103421ae6253c6a2476dda5d11cb3d5e7d6dc2c02499d5731095ee89f77c7d4ef27231fd6e9e854d1ed84b0b47bc4794e68e055e1d83d75ab527a53ebefa4d363f952562ac1aa47635296d55e2d5d1b8e214c95445bd586c7f82b31839ff78a60f0063 +Ciphertext: 50c5e2584d473a696c797ff1668137e331bcd9a1ecd5c146422a9140de87c10996d407c5eb8335b5bdb7a9b1613ccc198d5157c6f89d409e1ce7958605d68d442e1b10179c13e12ec33f98d676ae4be95ac7a82786402b1491918a6526e9676037d04fa7aebfd9afd39f6d10dc663877ebbb67aa82c6089529218db9622bd0af7e722e72265e25524d827da8eea6d7e0daf94c516ba24ecca2d820959c0dc939252158903d97139f6fcd81752deb3e9108fc62178bf54797c428e0887d1849fb5004c3b76f0d466afffd47f5066d6dfcbe4782319738e90fa19de6b99861bfc9e8112df4573bb38b1b9e35 +Test: Encrypt +IV: 50c5e2584d473a696c797ff1668137e331bcd9a1ecd5c146 +Ciphertext: 280303c6467f6badc300961c549c33f249c6d2df0596a459383b4c995b296854dea2072d04e46cd47c3380c4be6f6456e8759a5ab2025bd20ae6d116b0bba77b4f03aaa118c73e50f48755a89474c4380e8bbecffc4d6c84514711094ef67c2ed8b81a07c2afa41a19709e69d0bea22067eb3ce3618d80066f9c9f333eea1a624cc4d4dbfb0134004d1d6d295751c7a134cfd29cc85045734e2a4400c261cca16bca4c7e4622837eeed6ddc64c0999347248081aedd3f4d911ad5c92aa491b05510adcb0bcd7c0711a964f176775f11d8b00d9e4264afbb4d6b6a81760d964ca495485895ebba1dd1d2bf9 +Test: Resync +Key: da4147528d2e7862009aa772051e60e309721eeef4b4bcd7f98ae8d0561960b3 +IV: b625057bd07c1385fc08bdc14d735e5832dce5aa0045d9e4 +Plaintext: 6db3a848beb8a6e9670ed91427364c9b042d000a14eb2ac4c6097625e20b2e8eb367c156f927262d2251974d5953f17d00b4ed6b4d93513a19ee6b4f1a159bec8ff94151a7bdd6074d12d343fd852fa69a26302a11caf57417e950723c5a5e795de4cb6523fede7af6b6cb68f41931a1eebea6079e8018fe4116e7b03df7 +Ciphertext: 399c5bf3b894e3dcb5881fdcd927d8cf4ececa5140b2425df5cb2cb993b6901f736e94fb847de41b7c32ae990510402ce5e99a34b5acbb3b5aefbe55be4707025ffcfd6605b6ebeffca3c1ed3c42cba900eb5f14c195e5c574eae67e7355b780403e44ebc91f81fb04f95759f78999fe619d5b8f9fb2185c0e14cadfa8dd +Test: Encrypt +IV: 399c5bf3b894e3dcb5881fdcd927d8cf4ececa5140b2425d +Ciphertext: ebb1d4ebb394e185fddd72fad5efa8434465a9ce758fbdae25cdc6b1278b2e137f5afa706c5a8e95684fcf6645c6c2f67f698621c7d6c7f1899be12e2f6c9e480315c12f02405b8bcf45f4a715eeb72f12e0fef15740734747764e698ee88d05ab30028c9ee237a48b50c8fc453b7d370daad88e57a572a9cb8091526861 +Test: Resync +Key: d61f8e75dc9295dc029292764f3ed08dfb6fd725cae4b0e47aceecaefcf654d8 +IV: a6046a92ad15e9f9d8027ff39bfbf534d46fec35bc9cd94f +Plaintext: c11f014781804645ca22ca213a5558a038090341f3f70aa1df0bf135fb8d0184d77783b519c9c2b2b0b748880a85bab986de7a37a4a11bcbb5c0c87676d7808fd41abbfd0d7a11a7c545405a4ae42f60baa22ccee6de0272e79610c7b885b70ba9bf027657abae393cc8f56735faab9f6fbe36e7a4d99ce15cdac24223880bfb5865ac7acf01ea833098fb148406e6 +Ciphertext: f3b2a1188c33e96124f383b8b75dcacbf782f728eaf436db05551ae2be1a77f09c9ea009d8651329d0a812580d1e11d0f64c44e245bf30dd9c8033b72d0e5049131063c5fc2a3f219e6c1bd993c8961cc174eebb655574dd45b73d0d804f5190f92e385dfd7c2a4ff430ed6dabd41db040aca8ece7f11de796478026f48337f763cf69aef12609384f0ae72ee38c8c +Test: Encrypt +IV: f3b2a1188c33e96124f383b8b75dcacbf782f728eaf436db +Ciphertext: a9b213db6c8e161687e1b63f32a806f15aa8b3ee60cd37d7d437f90b446c3361d37893b702dfe774e5e5ce486399cd408fbf6ca1005768bf7825130c061e43f6077080438514f1a8ecdc6ff7cc264122b1a55c849c76328e833667326f23670590b77f2bfb9a666bcc4c44c16efd6c506c37ec62de8e5365ee894670ac4264b807a8455d8df05ba45af51ff1fee343 +Test: Resync +Key: 0f2850f98634181f49e53bf49d2f822fbf75e5f77c6cd7487541c514a4101ce7 +IV: d6defb4e74c327d89123bdc1d1c6d2fce6b745079bc2c9ef +Plaintext: a064bd9bdab0ee26530c2d26be556cd67295180bca445dfc87954bc51b28a21b606a229cf5a41fa104c51c3f32003a65064ff73e66691e4d2b1a22d236232be18677d54aba7ad49edcc9284897a7f88945513460166e5dfd7650959c05328abc0a7e95c352dbc227ca17 +Ciphertext: 51de41664070aec657612a57641c0c83ae14f5b3b25b25d916e0cdfae1c1bd21f7b47d9ab02b6841e115394cad58a568c1d7c2559a1d3fcd9cb4b25529d26e475ae313e6487538d16376a6b24e5cf27d2dbf4c83bd18996594f60549f34a8683b04d05198893a816adbb +Test: Encrypt +IV: 51de41664070aec657612a57641c0c83ae14f5b3b25b25d9 +Ciphertext: b5f57b5f00d2bf5f48828a4e793997e6d12b0f14953f5b1634cba91867776f75d2d2d247799a46080372046518416c60a07a65b2aa1318238597c320360a279e7633045bc43cf41bf9d366eafc7613b090a41fd8db3f684afc03d96c82a40b46e2994438febf268020c4 +Test: Resync +Key: 5cf680e8a11eb005d03fdc3d4ec0e129e6aceb47262dee6c452a5b8b0ef1b450 +IV: 6a6920ddba39b5a2640976ca10c97bf308a8cdd70ea98260 +Plaintext: 1f322b31f5f577a596b0fbe567864c7ce2973b41f924205defe08e2866b7fb5c1814d664d33957614e91668bb15d9848ffb93dc08c1f74c5f5e1f88148d1a1a7ad47395b75834de4988adfbf7e58a38157544c2be5b913152c1d00 +Ciphertext: 64d6c9ca4db201d95afc0dce28f6e47d51c2856ccbbc8f4c2e2bd2d834aca165dedd117b0be9a7dcd21eb22b508f4ecd0236075b064a0ced23e324b18b2bf2cda1c4416f78c740e51ce687cd37842be368fc4e6ba7cb312d89ea7a +Test: Encrypt +IV: 64d6c9ca4db201d95afc0dce28f6e47d51c2856ccbbc8f4c +Ciphertext: 9f4090fc504efc0f6bb5f76ac9881e1379da9f700737d86e9636714debc5c4eb3276fcff90bf71c32a71e06c199b3431475ab77410e83a7eba158723efb383a5437731a136758aaf7d39f0def719b0dd46798d9d53a30cd1b91eb3 +Test: Resync +Key: 9d27327495159927d0dd93e258908590343a57f6583e0d8aca07070ce41fd37a +IV: a01d1d7d1d43de5fcd60277f84dd8b93d08d480a77961f71 +Plaintext: e2ce8d1f9ee9329c3599e1880b9e6cb75d52e86f48ca89b829d4d7ca16d3e1b496b8b46097501793cdf6764ffd44b44013c7aadbf0ccfa4eab012529373a9022480f58877332b81f3c703ca80a77f429d944d5a877d89c6f64214c9ea6d3a098d9057d519354cfbb71a4bcddaee65de22e4d782ef0065952b891c9494d8a509e86d08ca31594015d3c31931d417cd048e59945d42ab74983434d14ef4e078f30ec2fe9ceb7e247d557b1d2593ab35896082c1c218dd73a868bc5cae74862b898395681234b20fa1ae9cab6a49b94bcc38a3a4a91cefc7745d094d9d8cab730cda4079705e4afd0f5e401 +Ciphertext: 94e0d546dbdcedd76e26629484ffd9b67b9c15f61b07df7ef0efce41270bdc9039ffad321c5b2d2847f6f4d5d105676fde08b8c47df248850dee1272d51feb42d503e58d67b61fff0a20abd999a5ad5942676aca3f31ce08614106fb692ae230c2a74339eb38c074bb59cf5ab42fcc428a0d629c12fbc3d845e84ed76c3f774e92c1109be12f00aa8ebd2a137a914e655081e6e60176cc98e849165d9d93235c605c8562f51bb407aeb8f330692d6245297817eebd32fa2ee96520b560e37019e9aadaea40f25ac4c5446fe93c5b39fc90152f088a5a936ba4efb10db7f246143f2cd151b1f1155e05a8 +Test: Encrypt +IV: 94e0d546dbdcedd76e26629484ffd9b67b9c15f61b07df7e +Ciphertext: 33203e910f56c5e1a63f3a801fdd772dfd1c3b0f3e012772bf0796337d95f4562c349f65557e76dc0aadb982d1aa3a3a865db36418bd1efcae36095fdb3ad68e1df72622d45d5336224caeb237adf9c19b02e23a1b9d4b32a5b6f39595a93d495a74cceeb4254e0b75f54277b80b153f62c8b5bdccae8d3ce24d8ee258f6d4ec6d631f6d1c8e8daa049d33076bea38acc5fda4a8822a16a693c936b340eb7951cd1ab0f7f58206252b0ebe46c77214dc86db136f8e170fc402f31e1c7ef9bc409b19260e4164c145aca28846ead4dc91783bcb1bd914a23d7bdf83745cb74c7ba66eca45457c53f42280 +Test: Resync +Key: b1a6c9bc9870d808a81612d0f4b335cbfd8b305150a6140627df06d9f8b24c0e +IV: 7313e9e505147d4a4c2023259ba01197169bac01af0d5bb0 +Plaintext: 479d7baf87a385c781f0dee6e51ee4f94eb2ee3e93bdbb3f402b0252496225d4118511ff893f4ddebcd31149920e259006cc7353ec5a95da4bc61ee6863282edc341afe9541d44958c2855b6714625ed2fde62db387e114fe837bbecee398351d187e0c93e0a0618f9d923504dd662c11e43af794e7ac7c99816c180ccfe1779bd2dd476ed68eb1736f421922fdc6696 +Ciphertext: 30a86c8b6a55670856e6d1b31d59602e05819022f12df1c67294fa138d65d5fd9f5e9192ad09604e08005537832d07ad5f4743bdbf137b7e18b8811066c7e411291fffc6e6ab55744789a225f15086173495279a4c628ffe4b1f8bb4d886bf74ada7d783b143edda1675ca9493ac1da04ae62584ce41c8a2c4f9fae79d94363bcf79c343e51ce5694c639bdbd8405781 +Test: Encrypt +IV: 30a86c8b6a55670856e6d1b31d59602e05819022f12df1c6 +Ciphertext: 33c313c0da87030169b7da6963644cdd257891b14fc1e4387d35faadc39279cca215e7079ec4272bc259e6499b0cb6dd52c6dff5965c7ddc9e951ac5c0056b4065a6f8eb5cc8e5373633a4aa3aa1736a67be11ef63c3418b1fe57730d6cce0f40e5bf02e61f6aae1404a813fd2a2a870960833be71dc73bff4a98718d64cb146a2ca5d41fcba85a56fa3d0413d0a807b +Test: Resync +Key: 4f9f97fd4ba7db6365f5fec9fde4e752c8bbde48a7ea986b878302e4cc8af9d5 +IV: 05788b5db4e3711eca900a2bfe6f78de44e98a70362504d7 +Plaintext: eb50b1e352f3fae6921fa7884c99365411928a2ffa33e3106768a773246c31cb0bca5cc166819b3b05819017f06c8b8932607db6d66d58d6a2f7356e4666ff7bec3a2223c12777fa54d9ed1dc139d9512c52e1e53762badc7e6f8da576afd940fb4a29d89e76fcdc93e515d69a6ca9efe5d053b7600b458b6719852ec4ad3c59d0b0a69971ac6ae53118c186f2d1a57e350ac3c8ad7d4e087c8f32816462f0506122fc01caa8c93aeebf0edf0c8e1cb726bfc861 +Ciphertext: c63f829e84c1c9709c49780a445bbf0dd441acc5304e0433ce0cd70af3fe98d36bd9e6fab17e6e8b50fda157e3ce9d2a928e8c234dd1700999047db4a28ea40a9657172a471f962d872a1d3342c12965aa1f1484e760979181ec8fde5472f509f76748fb4557b9b73fd517f70b20795caa1cd19e4dd5ac65e8f4cdb65a4ad60e0dd64407dc5232a5a893ace71acb35700fe059bb641497a2db63caf083942b7fe530092e90014bc5b6f889710ba3fc50d086fc32 +Test: Encrypt +IV: c63f829e84c1c9709c49780a445bbf0dd441acc5304e0433 +Ciphertext: 625aa1ac285ed59cb4b17da0ddb32a772eaf95181d0587fa92be22d1f5b65e403de9c0caa3301aa569ef9396c4cd06cffb602d5b5e6d2238712e74de51b0620733e1ba802038de3735b2a08951cbf17759f90cb0c4c4eb6a1acf147b54b7ac7372bafa4377fe7510d06a9c4ed6f972a669e270610a7084b61d4b52d2931803b805440b3d5e333ccdb0f3e7c0d013f068b2b402680a83210d71051da3529299343813150fb0f26ec053a8dac9993568e9b0c703ed +Test: Resync +Key: eee68b65fafe9a5bf2f9f92512a716e5af3740efea15e596f4ea0b5aef23550a +IV: 4d312f84330a107250b68c0b1df417ef713615b704d99b71 +Plaintext: 95ccd08ed2ab0fb87f55786f1f10d33c7713bef4435c3699b13982235ed040c9d9cb1b1f335cac0faf8654812f6874408bf20b129558a2c342c07c7f42a30700b374d18b91d881fc0f153f4ec1a55633a92d637212a11d122a9a1eb085439ea1226ea7124e8bd1c644a1996fa6369dedcacd5c766d7dc9a8c8682c5729ccf4d59433ba8e1569fe826089995414afd576ffb9686a30725fb9e5d7 +Ciphertext: 6c832a8147658a1741af29b0f558fa3773c81429f91a5cef270f7154988f97d4b28549604909f726a8a6e89d625089ea387b2725861963480424d9835d7e2fea93a5bd3bf86c7827fb22e7a68efea1a05c45f9606d4ab7add687d9418ba60517cecb3503287fbc5b2c9f0f9b5faa991337b394dfac7514dc38ffe019a1e7c74e5ad23f4e3bddb74ffc8a81f521d0b6044f98238f7c2a38ab14c0 +Test: Encrypt +IV: 6c832a8147658a1741af29b0f558fa3773c81429f91a5cef +Ciphertext: 7e1ef21dad49405e2fc86c50bf045eb14c65e58acb64e210af9ad8ebb5679021721312b96514d8681fa9d52c01c83f7d871401ec345a334648e0fc2ca294ced407ff98f1d1bc4afd83bb325072a5367d9a014092bc99699713bf84587fe2ee998bf8df35aacf61a96be157bddfd52e5b5a1d4a2e3bb109502e608f286aa8f0d5f67b4072ad9b60971ee8cf9fe966015260e61802f19f4bc8a29c +Test: Resync +Key: 188fbb5bea95b5101e056b93d8890c68e1328966089ebf424defa1bcb96e88ff +IV: b51304a0194bbb2490fced46fd0f39c3e87ea5196ca67ce3 +Plaintext: cd78c7c8f308addbd9acb6352d1b5b8a6ddee8a6f51401556e612d4c18960d152e6973381f45b19693e8ab6643424f01e9ab27de29f4ea16465d95674f7c939b +Ciphertext: 81a468948c618db0de96ad5cdd8b577c8253df097128cea4ffc7044f3eefa1b486b9159545fe135ea8a862fefa015f663febbd9b9527cba516551949013e9601 +Test: Encrypt +IV: 81a468948c618db0de96ad5cdd8b577c8253df097128cea4 +Ciphertext: 0510193beecfda67addf420e9c52130dbc8883cbe27d3e013207dc0ef3ff4e0b92e9ea2a2b644ffbab55c942acd63ddb7f1cff8d51d27b0a7d2853584dcc0bd5 +Test: Resync +Key: 2fb88c256a737eacf97ce4e1d13f1e20e8b2426f19076d7901bf6696f38a81b4 +IV: 12a82872b47b2c5b73cbb38904a08d283701eba289c057b0 +Plaintext: 3caae8a0c99f38cb7b2e45ea91dd5dc1331f0efff9f69a5dab0164693e986ba0da48a84321f618cc7e4b4e4d66acd8a71b69e23dbfbc6bca0c4ae279f3583b08705100adb7a4aecc0d72955a7305f4e7e2765b0a1bebea9d7e044e360d44b402f01357dc9a3e83fb46b48a683c1ad450a255bf45fe801db33414d985fd3a337c857d370ddd05c3313ae2eee0c8cb1d12a2fb650ea6e4851f2ca27badaf36dede18a9f8a62a502f6c2ff94d591cc27438e7215ce6e6abf76c22190b7201763cbc8d3a2be1f366f69eca6e5386883f56bd1c +Ciphertext: d446cbadf5afb1f21d7748a5973e8650d1dbdceaf5b837cdecf972bd091734a71ee1692fca675f4972d1e8db716873a03f9a5516f409982316cdc9f66ca0a8018dd055af0086397a86cf7574253d53fabd3aeefdc54dc2eae48b5b61a31dfb8db6531d2185034b81f745a3b88fa11453df073343de8bbd35a45f9cdff45b52e5352081f1f1a003a58200a4aefe27c87e930b77b8dc5b0882dc848437892e1902d126813e31ee27526d947bad5e8f9cf16a302da1a8f3883e3c9b257091e708ad58f4e716bb49e660cbf1f6fa709d64857f +Test: Encrypt +IV: d446cbadf5afb1f21d7748a5973e8650d1dbdceaf5b837cd +Ciphertext: 4125c6831bd2d39c1b1a2e12c505ca077fede7c553d486ae9a87ca3232d27974fb35c9a18a6315e5feafbffa943e52e9c46aa0eff6bce2f2dbf703c641ac570a92551f8a6e9aee14e8bc433b36e06bbefb0a292279f688e5d06dcdf317eded20f9dab8fab19298b146e1555b772d9f9c95e920356282ae691436a8505051190bd840b234fde486726dabec5e0755f4335b8ff4e30c30bd4f473a6af3fa3e7542f2b720784da760753938a682e86cf7ee18c5b5f7f515ff0380134d375e434934508f7cdd7602ffe2039a376d443c048103 +Test: Resync +Key: 7066fe1125429407b653fd090262bed2a3f7f3be2fa8f160f3344f327b1e53da +IV: beec3787c335739fa5d7ad15b85b7e3e7c9438367434872a +Plaintext: 9dad7f5ca1 +Ciphertext: 014a1f27cc +Test: Encrypt +IV: 014a1f27ccd2d39c1b1a2e12c505ca077fede7c553d486ae +Ciphertext: 20539f2d9f +Test: Resync +Key: 3154d3f5bb56b00b34a255425057e99ed9effd1cb0168d16157fd769ddc665ba +IV: f7f9f18f9648f6dc06ac643ea77f1493a9fea3390a98bb0c +Plaintext: 80a488703cf316be904ac8394437ea02ae2c027b7880ebec58416429ea060db543839d781d82a0fa209077e4b1 +Ciphertext: a07abc8ef3641cf33179296ca401bb291a9547d3e6d1b0886ac31d26d2f3281a6a568cc042593132a3cc1082be +Test: Encrypt +IV: a07abc8ef3641cf33179296ca401bb291a9547d3e6d1b088 +Ciphertext: 27ff7646fa8c6b98b1a732841e1596caba7b87eb40508ef0f8ef390aa5e36c0296ba84b686701d5e3d34b16508 +Test: Resync +Key: 81426f03ae1578d8ec1407827db18640d9d90d2bb773971f4ef14f859bc19e06 +IV: 479961f75954ed4f8024108cdb149ca3fd53e6a239a01e86 +Plaintext: 9cd08cf58e13e94e02c9a40269875392251353223f5329412e2a5e34328ea18c414d4c730b4e1c0bc140953f4ecf4ffc8aec963e59305d4d +Ciphertext: db3ea5b5fdc9671ec56b3f1cecbb2a552b0ea4ce9be508863f3dfb3238d4fb91b896727357fe454a08114200ea7226787fd2ab154d53eac8 +Test: Encrypt +IV: db3ea5b5fdc9671ec56b3f1cecbb2a552b0ea4ce9be50886 +Ciphertext: a887b52b3e97e6c899e1d68e57f283633ec9392438d17fb645702ae3b0ae0aad3a7c6eff0baff9f5357328307f628f470891884c264973fd +Test: Resync +Key: b3c260036b79cd3345e04cbee474dfea3a7c773db2ccb29d4c36a1b8c8b252e7 +IV: 1277840fe82046c024e6f4f53b4ff761c7c9bd1fea6c855a +Plaintext: 6a6dac1bc93b9b5c0dde0d1e6a534914dc2a6d51e6f8af3e9d42b88bedc2173782a2314b33f795cc2e4536829871d77186168f5461d18130581664586256 +Ciphertext: ff5e71022c6522998a2d10843fda170796a70d186e5fca2afcf529c6d075c5212c793fb322c1675d0bd3cc6b18f2715678812e81a8727a2d6ac1158eacf6 +Test: Encrypt +IV: ff5e71022c6522998a2d10843fda170796a70d186e5fca2a +Ciphertext: 7e8b5b4d250c13e38b5dcaa5532295e649ab3669fa594cf30eb81a54b25b3fed4f35be97afe4a2a37b7404acb41ad31d737fa9f272e1c57b3754830b4823 +Test: Resync +Key: 14fabd52e0fff9dae88d54815d82a56c4d4a660db5f214288cec1982e56fae81 +IV: 55b8328a312dff104c7f0720af0b7624f9281731b9f5f4b6 +Plaintext: 71bfc290baeeb0380732aa4312982c0dd0cc06cf2ee53adb0ae61c64228b80c073e7687ad3d3f888151b4066f415b62cf851d2987a3c816255ac40b62f453f350da8c4e1ec6dd0985e721b45a063381e997f629a7fbcd44fead19adc289f58f104fd37ec93a35305ba6fa44844d22e80a853e6db1d466ba2ad09ee2d30b3f47dd01b4d7b5d498cffd934cd3e005dc91e9e951951d5b937b319de0a7ba23c7918b1d74d3551b6500d39e6d626fa9cac8ec4e744713a93d5edc8413e2fba1d3b9b0f70509e38a66a2a2d70c510b57e15ac0c4b2aa7c5d6eb088fcdf6cbfef2c6dad19d7f17437cd261636c6d +Ciphertext: 7fc8bc27994031b3c35632590a15607ccaf1be15c542eea5b71ea1f7fa3abee79cb1281a00adb05e6fee4e65e8cba616a5789629d8fc617fae9bde9d92f6c8779374b1cd32a8e9277d0cb052c7658b3ab24ee1e55e5dd88a76266e9fb5661f576000968a9af71a3edb59ef3974e76aceb41c3de2fcb204a0022f302316eb01a0a8d74378599a7f72987e9abbd6f1a8af152ee89455840584010da73b01bbd7b01093a8c38049dc7a5ee0ee80daa98de46803ed75d0a97083ca328e7642a07e1c037346a280a856a64bba53b050272b7ba9742ef62aa89e34500f0efd7bce800bcac91981556a878d102ceb +Test: Encrypt +IV: 7fc8bc27994031b3c35632590a15607ccaf1be15c542eea5 +Ciphertext: bfd5908a43916afa5e2709b2e43ac62f406a4e677b855d70b216ae92cd444fa47f5568558c3cedece54e8b436e904e927175b455d96672a8cbdb4316b9e48a704216e30e9955ae7107f9f7770768bfd3ce71416bd337710bdf4e8789c8537a37f7c995c616a437ee406ca20c8f333a7c2f84ef87dac8c32f5b9678e344645bd356dbff32089fd195d982d3bb94b06b5b232580b492cb754659df62c9b5186b26bc2485409ff95bdc0c1c4c80bfaae878abebd373b159507b5894c5a9f8402447559b5aa7c3b491b97adf202847d0f74605a2502b193b6440a6b1765d538e38a2206630dfda4123fbbe4da6 +Test: Resync +Key: 75fe951556aae3d6ee93670241b7adac6907fd9285dbdf165834fa0cbf741b00 +IV: fff3e1ebb2e48520be552d2f0b617291c42a946f38804243 +Plaintext: 2b56b7dfaf5969d84a88aaa10dd12682f15d8a9a942deb6eba04a9a7ff38f2d0a947b414cbf7f1fca82d74b4ef98880368ba58ab7da98e8d6a6c46cc47cf0536961920e46095627b73737ea19e393c2f19d1f252ddd74b8fe050d95d21004b8997678eb565db0e369cb8bd326942e634a20845c61265da8a21448357f3eb +Ciphertext: 4b3bbef56b4400b130f8df0ab25bb28ece9160c430417060e48e691e6cc4ba119b0c34f5e76d4f1b7963785b4c6a9fb0b42c9f4eed92f8d0989710456c7f8d228fb26359f6e2549439ff5610dacaeb1df4f43a39cb3802ab1c87ce73f731ab1127ea9c2e82fb372be407a8c2b1af40398b33582e842ef0862f120a96c75b +Test: Encrypt +IV: 4b3bbef56b4400b130f8df0ab25bb28ece9160c430417060 +Ciphertext: 76c77925fc94b86624decfd2014fa505a6343054ae55c5be6d12c43018944b5d1c2aa08b9c11ae00d0c8779e70f220ffa59847969e54228d89b4351471fcdb9f0f76f18fcb896983d09dc5e8d9ee666f5abcb4d9e7bebbba824092c65646c3bee46d07609057e44b36dedfc02ce576506aa1274d550afc57d973fbd60294 +Test: Resync +Key: ea7bcb7f8712f9aa149a311d906dbcba443319f68a441a68a263c7bd0fe10fbc +IV: 620e57a9ce4b3d438c968e603f3c1518ab70be5b7bbecc62 +Plaintext: e40ef8606c72444fd3feeb1873f7ccdd3900760af66c269ad1ee6bf1e4546b1a556d4a90f6397527b270021c226dad5353a142c22963bb818548c3ed504965b2e6eb9744a15ca3c00fef2835d34592b90cc4bef8be904987dfc35e92f835ba15f054ceb760ad903d56c65854fd21f6a03ce9f8f16c04ef7ad9507b5cfa4b373eb544f2bc61bc16e371db087fb7bb749463c16f75 +Ciphertext: a31ae696ac9d66241bf9c826a381c4610de7f6416b153d7f8cc17484f1eeb63b2bc25d7c9b8a486e3e8eed6d34b4604ab5dbca373a80c29d50f416bb4ffb8485bfc6f7b61328f7c708360cf93370b7224b7cba075becafeb5cb62938b396dcc789900d8cb8315ceb460a753f20baabb4c6f61526a012e305c28bcb59fed20565ad1afce39f98b354b67a33daa8425479a07c0dd0 +Test: Encrypt +IV: a31ae696ac9d66241bf9c826a381c4610de7f6416b153d7f +Ciphertext: be217c97aca7ee0c1be18f1d93ccdd0f26d751bbbc36ca29f12bbf4afe83bbf7a749d325aad3b6af4913dbb83b09ade5ec79d88b755f7b2ba63df6ec458627c83e28e4742bd49396f19463bd597902de42ac46ba675d2f0c9db8d39dcc56a5e9233264be90cfed284302b965ab0f0748dcadcd02354c1f81d640a359b8ee5aa58a1908de1356031432b6f12e22ae9ee9f847f0a0 +Test: Resync +Key: 017f97c643425ef0ce5c0a6a0c6dd67aa6181e6aed360adcb103bba88773e1b1 +IV: 8189c8cd17a945196321cb6147cf483d785eacbea352fe3e +Plaintext: 145a3d3ac4c5b57d68d26a1ddabc71289929b6dbf317acbb3d83313c9e4861fa9d9679de974e4f7eea83129cb8f4221df16cdf545e000e087735cb37cb321d097b7b2f4874b74af6a6da9c429b1e62d418066bdff5ea0ed7c3 +Ciphertext: 90551d5f8ebaa8c1aeb52d893ddec3e9cb95f77b8bd5f6d0b3f8a3fae5fd8d9c1e42a96360e8e7e6cc9b7711ee1d61b4d67e6c2d682215c59a72778756dcc3fa93068889219579b2a1ddd85b0e69880913cd2e9be47b93ea70 +Test: Encrypt +IV: 90551d5f8ebaa8c1aeb52d893ddec3e9cb95f77b8bd5f6d0 +Ciphertext: ef58a8589c2996e1fd990d7ec412353edcef7dff079ae0ffbf430f3a479818352647fd8640a518575a3210fa45f7df5bd63532273d54c442ff02918aa79176c137cfea1a6ae167464183ae716a0f6057be891537059ac3322b +Test: Resync +Key: e9a7e6aba47b1d9c1df629c6920ded6894b85d3e7fd211bbcc7a9335e5cbf7bb +IV: af86ca3a196464931fd579bff601c9fe7fcc7a10d7778d22 +Plaintext: ee681bb5ecd15201f433a8f89871109aff85ed5a4a16a7ffe032fff60f1acca78cee6532f7740be05438da05933c8d29fc880533d589f6029291cd0a965113e042b27734968784f871f9e9e6c2a7342bc01fba3ef666aa0e018957169f2213f492acd0d2ab82dec47d8afe7a6bedee72d0c5c7ac0d86d0af5238da822ad4e6346cf2ac76faa64d34051a91659009976d140534a4f2a80f2758a912eed692b62bda4a46649fe58563707478746c77d658f481ebf90c2cd5ff3276fa8dc36739084640e319282d74479084a15838b9822056e900f2050d0f48ed52a3a3ffbdfe3a1831 +Ciphertext: b049fa161f19691f3bfa783327d2663eb8b7f188b301b17336f68630d8e001349f659428fd29359c15e95aa3f5a9f46a92d214e0085ab661b511831d00fb6f496e171b8c139def92be2ad8f6d94c2fde48f9d77ea338b920b2d8d6ad380ce761faf170bbc05128e65149b29d32aeec45e2882362dd2d0e3c7cf9634b9f52c578cb2e1d51b5aad6447f4d1860b1a1f1b7e45bcc002a5f4f03dd7116216414b0be23876b35ffb58f466a4087c992340437e89b12151a7d8f1af04aed585f5feee36f60c1b0e19251c7587e8590e7b6bae774f3ba5f3be2d726c8da4da3824debffedc3 +Test: Encrypt +IV: b049fa161f19691f3bfa783327d2663eb8b7f188b301b173 +Ciphertext: 7cc5bceb953ed1acf44c3a448a15f07c4e4db33f863bbc2368acfe699cd18f0580e3ff8545b946c15dd0f5c15e355fc4a10e340035e91c60b757cb69bbee8d2a22b20066b15929bf3506f2b271326509552b6430f4b82cf9b38ae83124f9b448dbbe049d7b3a98bf25678a72965f9656df149bc068e4cbea8573befef8c70b32d1dae7dc9b74601db95866dc7b5a3b307ac6ab9d09f3c55b6aaeb34c8b0e77c724666a4cea694ee90129568a46bb0f8380d8bac4f6151e84d357f32488ef8d62a08cb02255de04612bec676db471ea2199b9e86fb8ad89b259c0d1ac487cd95a5430 +Test: Resync +Key: af768581d5e401b02de76e6986de0bedbfb7130b9014727194c1d3f02c747fd0 +IV: c4568db83cf9eed0c05629951afa4fe5b72c055d89421efa +Plaintext: b34095f5b7660a03edb3e2277dcd3241270c9a7b890cd682214ff979b725148b1d836346ad84bd776ad748f6fb063c15fb763ca5005e9af95840f2677c1904090a19d83dcbf1011a48c23b620eda573b4a61bb8b86fbb7260090ff6f788a9dc27b5c95c3a3ebff1dc6f72446a23740179bf4dcb0169624d1ce2bf17c79dfaa35c7e12e313488919adf7e56f2d61cad070c164797b9d2dbaf5b954b56fd43e15b61f2cddde618bff31ad545ff163f2482024388ec470329835a8deb0f230760 +Ciphertext: 5b132bc08ec5bb09b5c92587a661c25ec54b8f65a581ab5f788c97c959e39cfb93032c6f63a489deac9eacb0b1a40b14ed152077fdc7b8b6dd5f94501d319d1f5cdfac56dbbedf8a5430843ca36507a363d5694e277ad8c0dcd0c0bd729bbe4b64823acff976f39973ae2d3eaa415f32db86a207f3220054306d99558e27ced2a683699a65d13eb67abb38230137de63c5c758a2149a773d403442cb826d70064c57aa4a778cb3e00a36cc4ebba6ec83dc178a7e4a3fb07c22b77a9c00e889 +Test: Encrypt +IV: 5b132bc08ec5bb09b5c92587a661c25ec54b8f65a581ab5f +Ciphertext: 907a2c78d9e0064b600c1d20985b6268b48cb8e7af87f615f8c298316b186ef64470b1c3c05f46096697d84ac390a3d2e37cb2306b718e7c48fb624bb1c5b3855951444f83e0433e26bbe2e05d8ad375633447a9f1c0856e35c6996c4fe4a477f503a47818ccd364b099b8d640ff2540f892e6a8e915a90b96b3ec13ec18e81a5c5e9f6054e6c90b49892e22ad1f0911a33740fe0719845f5428b0911b220ccec09a73cd8a790afe1ad4b76480c5e7718755fd2c29ea2f5f3cd7608ecb7bbb +Test: Resync +Key: 215f4b041d68a316d29cbea833a9d4170c32c5ea0aa34e90b4381e642f74231b +IV: 0b9e85d8e3d62b0c5b45ef1ead0b180348c0c82b2325beb2 +Plaintext: 68a7cfb070a3ffbb5a1456ff96703d56f84fbf74d92573368def92bde3b49dc9cf8ea87dd8a51d4c12cd9b4e1d20d5939a20b86bdb9fe5c76a10bef983c871c559741ac89155eb6d1a226c2a371c03f3bdf2b4bc +Ciphertext: 68d6236f9df3727c9a457609c0b59e393864855160b1e2074257f72d8b122c99fda40d6092cc96c8134823ab93545a6f8b43e8efca9502b5db2ecb86af5798b45639dc41b34df49782388cad7d1826d9d165b79f +Test: Encrypt +IV: 68d6236f9df3727c9a457609c0b59e393864855160b1e207 +Ciphertext: ab148bbc10bdb9a086c2c94c641225bdd8bca6f04d11a7cc5ba7eb728f1fd84522d3861a648ccae4e03f34162058f560028680d986c4a71e5369a312af02d135684b348b2cf42df1ab7ca841d474b3b51b8b52bf +Test: Resync +Key: 2ecbb5a282ee515b3226952d11d0579607f653a708d18920d18dc5106f76074f +IV: 53f67a3bada58382426b7d2142c327c7a9fa75a8634463c7 +Plaintext: 0878ed1298af132502bb5144066d26042e4a2990 +Ciphertext: f8ef2dc3ffca9dfa4d006bd9d3c00d7517fe0971 +Test: Encrypt +IV: f8ef2dc3ffca9dfa4d006bd9d3c00d7517fe09714d11a7cc +Ciphertext: 488bfbb9058907da6218b81138c26f306b3e214c +Test: Resync +Key: 473ee670e4b93e070c69e4c9f9d1a1808aca67c02dc9b8250034b9a19f0a306f +IV: c7bc3457a0d5b3384ff35ac10c8b09a114b09ad8e3d1ef6b +Plaintext: 09ba3c2aa122ee53878bf46711922fc946d67085ff68c3c5f07da6749194737b715bdfd4d052366fc6761c5aad4931808033b620f7e47d3c6bb65e355d66f4f577ee42a1881a853acfa6e710673b72ba15cc169333aef8fc63635ae5a7af8154d19409f57121d6580d10796585236812bdee04346084c9a831aea5d4be2ea248a90b9d71fb00823c2fdb522ff00e7482bd9d178766ad26807d963002104d3e42d2 +Ciphertext: 12fa7fe0fa0791d6a1ccb22f025563a9f61b1dbaf825bb59ae7523b531da1d720b816f42c12adeebe8171309aa65a5357d46e719e260af1ed2eb2096ab59a00f08671acf0e3a4ca67843641a5d9be4e2c00f8da7d37349f2560dabd133dab9dfe2ff6f3c087099ebcd2c4420b6485a8e810392310a8dfb61eb850ae70680882e98d8c97c1c922e6358c0ff3a6cb6df77f0ff86f4b2697c698c0440305d3ff03c1e +Test: Encrypt +IV: 12fa7fe0fa0791d6a1ccb22f025563a9f61b1dbaf825bb59 +Ciphertext: b069c6b32e99129d65d0e17dc92106edb3949710ea7f84638137073b706d790f4c57db477f4f40161c029f1663ca17fa6ffbe8f6d1e10d94718cc7cb75549307c2e3da305bd33263d7f80d8da26ddeeecb95a241f0d0dd636ca54f7129ee35bd49c707c52aff4a6fb5f520575d693949b8a1ece03cf093663c86b8cf97c89b87fc76cf76d9dce6791c499208fcf7a2b7e868f625a940b5721bee984bf3ba0925cd +Test: Resync +Key: 95d049394412ccaaa002264f391f2448837b9a9eaeeec49ae73f21c3bfb83016 +IV: deb9499a1b4043f0c116133700eae22ea61f45ffad305c03 +Plaintext: fba6e561dbb8d9d3dca1b6073d29103b758c463c5ad756920f66dcfe88fe0e4fc21b6aa382b6b96ef5785d51bf4c6b2375f7ca4494e711a34fef708ec09dd10311d312f7aaef6828f112ffa786263f1f9507ecd5fc3a80bc3fa75c17d272ef1c7cac66097a46df791d0d61a22a68dc4217f7ce54abbf7d4fd3fcedfb4d92c4a87657e15aa3417b62 +Ciphertext: a081927e375175dc84df664d824c351c9417614523e0c30d9fc5b6ab5aadcbd9d3a2fc28cfd7c11a807dfbcfdc7d28a54a5c44e52f6e9806a1c08a5fb06f322d22a91f5aa5097b9cb12ac29d5bdbbf8312fcde98b79c6cae3a26c9828874f9c8e2b072b6c1c70f15a1b6464c722fe183fb1367e03bb3991d8de30396aafe160b4669462ace11bf46 +Test: Encrypt +IV: a081927e375175dc84df664d824c351c9417614523e0c30d +Ciphertext: 2629e5e9e550bcb2d80ad3134a2ceaa80ebc96a68d4cb9b0bfc1e78b8b9b06b6ee34e242a174f65f2c74688b740aa9d52f14e900436c020c10b860f7cc8063dffa9b5baf2202a8ca05a3b52bea40bf7dc3c9444989f33e2ff0cc841742df284ea75c6dcfc9a2eee78dd9ce6b29255979b4abd333ed1ed92d19661850d42ca425a30d3aaf95a201d3 +Test: Resync +Key: 9a1831352b9bd922b41cde1ad94b40b3c2f622ffdd633d03f5638d2ca01b892a +IV: 4539205c887f099743e9ebd3aa4ef88ca7eb0a957a1cf8a2 +Plaintext: b4a37464a37b3691c7fe66a81572f535d780925b3b28dbc85b574edc2b6753278994fbcdac780c6f09e153fcd8a2ffb6e873c440dabcbd081e7bb35098c29dc97248dae7781dbc3b00d7c097c75a2f3cc88bf6dd1989 +Ciphertext: abc902e1dc5c4e5d858597347ebf523cfa233ffa1c38b7d8e8df8cb5dc75f08e74cc7077352efccdd18e39820bf03a39ae1aa56b3f07d92b148b26d6214d710167004b338c1f9868b6932b3d999e60f84ec839dc09cd +Test: Encrypt +IV: abc902e1dc5c4e5d858597347ebf523cfa233ffa1c38b7d8 +Ciphertext: 7b2d46034c39cf770b075dbf8eaaa19492e51e451d1ba97a0f4a71c466dea5dfa1d506ff3c7cb90fe276dfd73a6c0ce88e0df56ec0429872dbcae451dd19d2f3e58ac420e83c97909dce9673e7785cf3a11df9a0b062 +Test: Resync +Key: beed63202b4bb586cadbbb8b6893bc6ca2c07217a3b9275b499245aaace55383 +IV: d22603bfe4fe47187d969fce3aefe24beafb9337ef886980 +Plaintext: 375fe2819168ed3a1bfa7f46e037af06f202f1927b78606a46a35f41e23806817a4151872a5738ba76fc6bc736208124d2da5aaa952276125eb5ee95ab9668a7e773a2c429acf296979436ab21bf8bd77f31ab3023bd7fdbe28b93fe92ddabf0bdb1d990d628bf43942d728cddd330c8b79ab6a270877b789a714095074823637880bb380ad826c3a5ec6fd46c0e2b5887dbcfb101fd84 +Ciphertext: a9b65651c6b7b3a6322c21538d9732f2f31beabe4e94c288aff4cc0bd18dea04f15215343a07e16eda6eb535a04f0fa6100bbafd8fb7e89ed087e662cd5537ed321351d19b56a6dc4a8cf50078f7bc9bb9d2982a0ffc8d24e1814935a9ca38edc6b04105a8ac488437946af107e1bf0838db8ec4066646692fc61b9d94d09a83d63913838c1e88ef6845de6b32e261ae972a6b70e72d6e +Test: Encrypt +IV: a9b65651c6b7b3a6322c21538d9732f2f31beabe4e94c288 +Ciphertext: 685c9adf5239c2f521ac91e3a335267b34ce2aad1760f8771c51ac8c48ae1b93938ae2fa2f988b7c87a43c8cd4a97b5e65c2d11aa878c69349308922bf63dff3a5579d549d22c0028a336aac48bdba88cd9654e37746d2728ddf653c7eed0b0404df6f5a4342d0d7e1df8841da0a249313e105e2863d63fbed1ee621ef5e57f48753dbe3d2fc08d15b5244bdf0369c1741fe92fe3b677e +Test: Resync +Key: 8d4b9a4e7e3107c54a75a7c74b93ddf9c44adeffb07a503a05d6a5f287244808 +IV: 7abba4d58cf460f394f80bc9a080a355961c4a2511f50947 +Plaintext: ed3eccc8be0e5ae6d90eed3b15357050171716c7ae56bc9ef7224db5740257361b83aec0d8c7dc7a9e1df44e0f3fd1b8275bb6c5d6fb8d172df4918f39bab0323a5fa7c4a98aef3a482394882daf5403767f639c0d651f01b9b294d511876c4c3c471f7b684900c54cbbc1143d8aa690d7ab98a41fd9236c31692b7d2406beab5202e1b617ee43a6b9c8324404c4862e5fc0301ba8ac7d7b65df1eb36bf038c85e51a03f1b38a6fa74b0163657eebe640343b83a94ef09308ea3f98cc30ad9 +Ciphertext: 5cf10e20d44ba83ba4b201c7176846976b1a10a98d37f006a9b1ba01b4c81db6e97514d0dad76855d95483f3765b26ecb5f8403f8bd65a79cdc220bbc39a35538dfc757431c20b22cc825633a9af1be926f1072b38d2e89dcc903f2d257592ca97520c869abd4f2ec41b10adf0a2f7c56296975869dbc3a2e1465d32b7781991747ad3d141fb0c343419b76c5ce4facfc257f666c1dd020bdc8f189aea79d5c77e63f42da60510ba86ec2b1c934b90d77793b5951faf1c94b5e3ce38d869b0 +Test: Encrypt +IV: 5cf10e20d44ba83ba4b201c7176846976b1a10a98d37f006 +Ciphertext: e23e817a9c4c2740922734bbe3cc5fad938020ed34c0fe401d4da9cee010d4d1056b71d28856ea327d495c643d819d2d4ba6d97820909a7ac222b892aac4ab130610fbe29311f28432303af69d3dbd3a696fb35582aef9b7040a7e85f6c48d31a3d0c3f1cddb5251bc01a5ce0ace8c95882228ddf7c57aaf1890d70b899631a09af5f4130b436a69ab8623e0260cadebad595ba3d27da5df9e62544876d4daa3fe7af8ba8bdbb7246af0289903d69928c43a1c720b948e2d5a0e8b0d062fca +Test: Resync +Key: 39efc9016ceab203c0e172a335d7dc2916ff577f168904648dce170abf5d21ba +IV: e4e0a36fd930f726ff81007cc919ba0da8aacb5abab72394 +Plaintext: c1229356fb463b251270dae5bfe6772135af17b0624454edee3490ae95616c8b4efaab8a6b6f2a83b083d4ef19a86950c6b570d9000e94255087ecaeb56fead57eb8c51ef71fc802f9fd9d14f462fb5568d4206815e7f3473442b5f9ccc730fbf86a45a008f2b784d14791dcda532578e3ba17a0a3733bd518e15d2a65eb6c79a2130d988db4ee07f1f557a9a08aaa77f28744cf928829c940f70ec541a07b2646f4860fbda22f95cd20018deb68159aec40a889e534dd071a076b46d29a3445c8cebdf2ae0ea6ca7ecdfd203e5941581db5a84e66828f2c3e1b +Ciphertext: c885db1a0c9211392f2cf3cd655170409d53fa559acc66faf0f75766b4501ce80b739f51b985ab10ebcaae7adc2b58c1315ded28b77a2c1c1e3bb65b7d9866827a8b4a39f316222bf0522f3c4cd1ab367c6135cd1b104fcaf4cc746e12d3c72a5cf781d487e1a297d83822c6b68c1b5a9a9505a9b64963d64b2d50ef487057aec172cd070533c400fe0d83f79f4affb1be18fd9429d5dda1ed35c71d674fe98788e3b488bb3b5a781fb6689f8732aa8e4674a5df2643b03a332fdc3d5e10bee7014753a745b4e7bd2b579b8885955d8141fca840204da3eeceef +Test: Encrypt +IV: c885db1a0c9211392f2cf3cd655170409d53fa559acc66fa +Ciphertext: a65f1a87049667811331f8305128b6c06fc3becedae1661dcbac3a627d27cf80429687178b1ff1577cc99bee4b311c480dc3053a74fa523660e9af670d852a032e69b65bb2af61af8a2db4d3aad0a4b27ee74bc2203ac502d188975463f050e3369259d676881b1b318a1cd26094923d2c6fb15c0b522952c176c3cbc01252a4d64f875aea09a9295957be06209ae896410f5665422df60dc4038dc9ad1a45f16350bb433054b9a14061b5eed9cde905ea59f15bd1f58811dd4df49531138431e9d57a8a9adbd4d4fa472077ccf40a2a61affb82242db08f3d27 +Test: Resync +Key: 3070f0db09c523507d36404dac79038a393e9f0e3cf5f870b16d2a06da68dcd3 +IV: 4afe87bf79eb938d786ba54c26fd6d7e62261eeae8b62202 +Plaintext: f4ea120b47d15466ade07df0f2ff508759d9cb1035ceeab43920e9094fa50b868673b07173557d4b994b1e9d35078c1c7369df6b6adb2ec0e6bfd280fea8ac31db44beb0c2a4ddc6198957bd0592e3e587d304863b893ff8eee0efc70ced5d712651c3e9dd1a0de0480fd8cccbae4c50dccbacb83dcdc3e2cef7dbc645f0af468163fb0e015ef48ad74694dfbce2db8430a6e91645fd16adbb72e21a0fbaedf5ecff829cea9cbc22f82902748aa52da5ce903d9f2bde77efef5fa3970c720e89f25dd05157247bf0de2d2129c3f856238d4fad +Ciphertext: 46f396f0d2d54189968bf56b5b2f35588c3ad851e00fac6507598f3ea0193a586c00b18677811cc305b0261d9aebbb9c0485a5800c940aa4f09c4fbdede12553824c429c7954e0b8dad889203d292517b98a64e8d7a37c1364eb0934751323d9b9f8498f50d729e977fb742880222f22ac5d7bfebe6905a4c344d82027398a70c334635792deb0f20b83861b05e731f5627aee17df20413c79957556e66a970085e9ad40a73d9a964381584976c6f111619a916fbb5f5d305df862d5a56bac9ff9b436f31c85f34ff890b5ad3299eda2b8642d +Test: Encrypt +IV: 46f396f0d2d54189968bf56b5b2f35588c3ad851e00fac65 +Ciphertext: 358a8f5e5c6fe93c3d6d7d2f90f5973ba2c0cf7c4579c92a52d1ce6203ddd90188d3e36ff7cbe94e7adb4ec7596e89edcf3a94dba1fe64eeb24e8bec5fed2ef6faa4f0d16faf5853e8f69ee0ca0e048658507bd155bfa13d487c3b994f3a1b8871996eedc2d899d9d79ecd8ff968000b863337dc04d9ad8d05696659f8a1cae880e471621ea13ec42d163eecfdf9cd07bf0b10d6f4634ff16d26c700c88831efc82ac0abd0269b93e302422cfc2dc4088e28bc22ed6c06c9b51774bf3aa4088a6a18fa3d3608f9927837efc3382b25a7ab873c +Test: Resync diff --git a/external/crypto++-5.6.3/TestVectors/seal.txt b/external/crypto++-5.6.3/TestVectors/seal.txt new file mode 100644 index 000000000..a1ca35f41 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/seal.txt @@ -0,0 +1,137 @@ +AlgorithmType: SymmetricCipher +Name: SEAL-3.0-BE +Source: generated by Crypto++ 5.2 +Comment: verified against partial ciphertext from 1997 SEAL paper by Rogaway and Coppersmith +Key: 67452301efcdab8998badcfe10325476c3d2e1f0 +IV: 013577af +Plaintext: r1024 00000000 +Ciphertext: \ +37a005959b84c49ca4be1e050673530f5fb097fdf6a13fbd6c2cdecd81fdee7c\ +2abdc3e764209aff00a12283ef675085c1634b53289059e6a7ab5ed9480c01eb\ +4c64569a8dce2a23feed0ef58f6f5ac3f74145127dbcaec4bcb6b1a459bdc287\ +58ba0523f721c3e154433dc7353f02ef487b07ad309ef5e44e6cc19026f5fd57\ +07cc32ec12b9c01fe0c58beb2fe73ea79e24093f05911663a76b21beab18cede\ +17275c54d18fcd3e4cf32279347b22f8751119fb56d92f55d511e4ecc1334085\ +e74934455a2daec3f1821c54b4cb809053b8d837de4186600afedf8bd72dd56e\ +223745c19f76edba01e9b5346666d01f677fbd68fa5010fd7db8b06829a90da0\ +e81b84756a70946a6c05e16d225a2e11af586bb1c5b1d21f5349f8e5e3ee41f4\ +232d554954d1bc86064754b86c1dc92d7a9de30086d8eb4a7c86db9c380f13b9\ +52e11c5b89f1be0a6b52c6e7a053da7359c5fd7f50c70232d86aff08c5ff1746\ +d3bd074d79ad6fc657e0cbbe5d02c4fce55d3c31fef4642ed738f751430f2f1c\ +f6e453ef6edeb9540cec52c697d4864201e141e06c3ddf5aaa64a1a984247e96\ +d2cf1e7fb2bc239919369f4a0bf9d111d0d8be64afae86214d5f62e64f25e8f1\ +3e12680ec170ad6234cbbda938df53cc17a12afea1eb4005122a65cb42bedb76\ +edf029db910fc81b81f3dd28341fed4064ce37648548e5852d4aebb7923016f9\ +afcb07ae7bc11800e217a0062f0b53ffa8d471aa78ca6a13b7f5647189106773\ +0a311d6fe4ff57f05f9a58aa742696b6cbb3ec539da0c2aadd6a60d2a33c26d5\ +8a343448ed912aafb98568c6ae1cb1efaeafd81a6e3e7c450f8e2be4c6cc18f9\ +5e8a1c6c59190a2798e912a614c1e7d0f7e74b1baf8e5682f5442f998b24fa86\ +d1e5f673002e2c92db8ebf7abb1c9d267a9763f4bd54f7bbf07c4466dac0bf3f\ +faf5666a43a52f0812e76df5f9d4da8ed1bc6d4ab29b34718facb4bebc11e907\ +fe9b0e3937de7769fc5b0cc52b3e50d57e02b9b4022949aaf3698bc58f696073\ +ec972a425caee9700864d3d166130ee09d51320b9d51bc9b4aa575c789786242\ +0698d9e1f6426fd141a32c9f55c24e5149e274983035ac1c44833b0179aed63e\ +a2b2b61afa54700155e55c7c343412584f7b0fe73d63c5ad88718dde3000ac1d\ +b4050ae2610032e6b389eec48952a1a2ed0016e525ccd9616706caba89ed07d5\ +4f15ecfaabbc91b7c82c5904bc0f83d44888997faa11fe8fa7333cb8c5b16e31\ +52233c80fbc9f71d9ee8fefa50d67a7e45b93d3469ba4078bb1ed5859e7a8e62\ +b26bacf538507fa6bd43e18d67d7aaf27baaa68d233ca392ce33e257d5ddf3fa\ +ef6a951430d686f65ee9afaf6aee0677b41098922b41fba202ef05a27d614612\ +5daebeb147d617c8df42dba0b91dfbf8ab5805ee9877e495881035fbb7342c24\ +e24f3b85c88671184152ab0d395a9a81afab3bf93bea49cb23ee6bd1c9fb84e6\ +4ecd462f60119ceeae7f1d2150bd36fe7ef2782b0fd12b55df119a517103d489\ +0a739b715d3d33e2ae9fe659df4bc0136c0b243538eaa8f9b813043d66ae15c8\ +261c94c0072afc802668b3151ad1c0ab0f034eb3e8f2fce0c9fbc8f68404fb93\ +a1cd11f4eb9a5eeb9117462ea602ae41fbfe0074323e56e15deb04d41f3510cd\ +1df417f759f4c2bee72bab88833e7d3d9837801f16901ee12581588fa7037f74\ +073b2166405d79098098fb196cc4b1733e45796fa7fc977cbd23853e5943b2ad\ +e154856565a455189198f6ba50b9cc6fda0c309a413ccc746bc8261fd6b060f0\ +5cfcc82894125b3f1e0b0c47257fd838cf295aa13102724163a9fc2598fe8572\ +d0bf844518dccc1ee16eb8e4c9935b78fb969b7c3104091079079a7688f1e833\ +0335f63eabfdd3224a506bae4ea3022a8a4959f4fa410ad7111488a39e3c1cd7\ +a28ce83255de2c4477fe62f660af3b7ba049240aa5212e4e9fffd8b66fd51b17\ +0bdf6c7e7214361a7efdceae86878f49716c0859ce2e24979bae82d98025720e\ +06d7904c9646f1b1058b1a7c93ee4fd728c4f19051adf2ca30f4d54cf65be23a\ +7198e5be5765c018bbc1d2344fa8d1aa908cb8f789ea793c6c60d9a7ba9eebcf\ +7aee50a54810cbe3b632144956a157c220e33a232c169cc9ae64d6aa3560a185\ +fc2d94f15b389eebad8d07662c2be6d6349ece8ef88aea27d430ec9512ff1bc0\ +c5560862fa4a833af750d968e9fb545e3879571ec021735761da937e294820c6\ +585ae00e8023f48a4e1f392217df763a09e540ca615188345512179f8889902f\ +38c626ea3a333fc367818b058dbb8d6aa474ff3438b2de2b32822fdb93f77618\ +83b89223e0e616c885fa3414905d098d82a5359f629ed11589974393cfaf4695\ +da7ee36346d088a6ea6ef21ad6245da8de9956fcefc930c4e2759b596e3f98d9\ +2483b2bd82b74269caae2014f796ffcfe5db58759f0cd4e527b16f989d9cbab7\ +f20282ee2e666cc19ad64aa7a36193ff248002c762280a98f3ad2bf07b32f26b\ +eff5a5586d967d844aba69f7297bb1e28075273f39aa6e7c6c7308728da8ad30\ +31a2d20ebe99940732f93d0440b6e3b481774b69eb76179496350983031c2611\ +a27d885d91ac37debc02512edd06e1d10061325c5e04269c0c14942d10f03f83\ +06ef173d645478d79c74990a82df4b13f2754f273227f96988c25bedaf392534\ +69d73d642305f8058ce4713f65a36b822cd98da3fd805c4408d18dde4ee8e794\ +72e38f8683edbbfdce8d085e005407666eefba25d8c3368c6cb656a699b30736\ +31b8024eb6859019feb76bdb5a0d7f17c92a37fe6bcd14630c1a62bdde1e41b5\ +e9ab7306183a16c31554821ad44229ebce2e552f9a09fd1607dec8c92a1e893a\ +b80c331cdc7860093503cedfd44b3403b3501415916303baef0c68d12efa7c54\ +a11af3a7df5d23df98cfba907dafad0a8989c710d4602fc75f663fb16039d94e\ +f860f358bbf05ac9c34865141030513c4cda32e9b777d9fd9e4ebdc1ad0b24f6\ +799f815e29b8e2259f94b0215b94b349938556736d3ed578cdcea9024d71f174\ +376f05b3c203cc56476dd92d07ecf7e283cc181225a2b690eeaf3cffd35bbda9\ +c4ed0456661e2e39f6be537d2446f65cae13a6dea668b04f8f223601629cd3d1\ +1b75180dfea19435bae5e0622c5005371d4198b8dc1e0c40adbbe08d3651d345\ +4d68507f7f0b56d4bf2a328bb68854064699d0a38d7468ef64ddb4139644fabb\ +d21ad79b5f28a5612e445dc5673b2038e3f7dcf17a12ab32da214fb28500ea79\ +00491554da45661a03e2a878d1006d4fba8e22a7e5dded9b02fb8b5e6d166aad\ +43f8ef3eec4a7050a0304d46cc0be3ec97f0bdd137eea7c001bd8519101ff3af\ +76d1d7710c22c5b0a69c10df3493283254f5afa2ce4b3959d3be512e6ddb78da\ +30cc0a338d675c8fc3fcbbd313b696c660a85fa13ec9fa13ac8e8dbce8335575\ +608d5962ecb516b9ac186206e1ffb971924e9301e6fc220d0769ea1cd954e2fd\ +dc591ea026e369509d427ad062b81ca5e8873432a0d7a031b7f26702840fbb5e\ +5e9e6c8794dbec841822ca92aea2a22709182a3cda136b7b3569d85be6213817\ +06b2852b7de3e20907739958726334ad0c2c3b7327d0060b3f6cd319bf6666e0\ +9de3ee588abb948a6df37d5ac2b18c82d63ca0a0dcc6f1c1e2ae609999f60738\ +714df767fbf14b12b7a002ce0dad86f8adf777ff7ccc9b08180faa0d96b44023\ +3ca5398525eaaa9afba9e0ea4f2cfbf5a3e868f99ddc1a86ee36baf2ab56f9b0\ +b1ff1ff591033e579847267b9557217e0991d2c90e61f7e58321d9bdaba96c9c\ +63e9d3924f0a8c7ac6d4fc94d74d7bc1a96aafad76fca0fa4017d76f00f5cb5e\ +96058fafb57caf07cbcf665fea359cfa2cd4084796e3ea2ccf30bbe6e8f7efea\ +60190fcf2700d1d27b80ff53d8071aeee1ed8708617c92d821f83c9a7ea90c72\ +f19a58e9179cbed5f4f86a80c28e0fbc3fac50d5eea3117df747ab076044f1ef\ +61c7bb95ab31ca2f4f6e61d19e906230694158df40a72fb748dd79d0fd0617b7\ +24b23c6d0569d170731ee07dfd637820f10fbe860a179f2a24775b1f27a2e528\ +a5808d13cc3f995d2cf0c4a832915e19bd6293bfae8eeabcf85de223c4dea84f\ +0d095815cd34ab885d6c50816bf8fd07d4e58aa8c8fbf34344fc3279c1efa142\ +68471ff263f121bc501439c9fe1ae45c946b348a00535ae451d17f3edcecea67\ +5a7dde387813246bb8312147163f813159413fd550e00204c441b0eaf4d12c79\ +520a3d3bd75b00e20a5284457fc3999ac7ce1f1202e5bd651047c74eac7ff92d\ +7f214d6583304f6dda309a01230198b1e656c9707f2f27663c1855771af7f449\ +0e3f3f8da53f0492654a3c40d15620e2fd2a68658ecaa8fb5601775a393878a3\ +110d75e6b968db8eb81c2ecba5852b2eaf7f9b8967b60f92ee4af138a5e777b7\ +aad802e39d7237a17b4a79d9a467a4be1be5121de907400ee5586f0f94bed1db\ +35dcd7995ec93b49b0f6dc7a1e3e4cc0ad1945e60dbe0d24948eb94ddbc45e20\ +fe0bea593df4e6d38647fb623df65f6fbd1e36f318decf77824abd6bdf95eb8f\ +a5f29b650f36b77a305bf9c15b034a7ce1f482ccba079171a6476863a70bf49f\ +cc488177e461837c64d5f5419ae0a344010df2d6edb170b1461ef27024199b15\ +44144dc327eb225f1ee99ab4f07bf2f934042f2df86252c4058212b2e5cf35dd\ +14df206c1dba5445d41f211911e1053813a09e7fea3d5de5cac92acfe36b3ef6\ +8d4767c52a31c8ccba0eaa85874892d813ae601db1ffd5cd42ec1e98534056e2\ +753b5fa30f993016b787de9620a1242986370e005ff4495315c2b1aedb59a32e\ +47be953ea41f15fbe7a115d10328f67e59c538948ceef3f4a338a030ad198b2f\ +c89f067b336f28085a4ca061a38ae6190de48981de1c942ea83a9143b1faf94c\ +2f462a9de5d14b915bfc52e916d16f11cf59a28a3d933fedb48ac06b7cdd29a0\ +720ed851863bafe7a149f403881afe46b940ca37c29b7e49a730b28404179449\ +73274553b70fb11da65acc1c5420677288c624e67542f230da340d1e9b8dc5a1\ +90b69bf5e67e77929250a802f07cdf0716db567209774367aae32e0c1e90928f\ +61c43eaa372f1e9ec70aa0dd506734d23825213edaf184a24a1bb128811db664\ +783cb27cac1edd074d79d1259f84da9e0e5c75923a4dbfaa8a6283dd2279ba69\ +bcd1d78970d7a54a0d31c44071cbf05527010e2ff808cadefd74d906a8ad8c32\ +a01845d3ad78bc6ed96a688dfff171d80d931409d94c83da2bc54ad9790e9a6b\ +a5093384850090a961572f6fdb929a1a6baa98c015e95b0a6da10de04b8471c1\ +aeac19b6c887c1c81dad641d55ab1a29250d14dc41a042f83eb8a6bddcb662a9\ +3e00cf6adaed95cb52b36692f43a8e9b85ba7723d70e5ada851a16fe102ee1c6\ +d3bf8be1634ade9fa6b44626c734788b3aed0c287ab7e80ae5fc1451ddb037c0\ +f729309209226022f13e6f8aa592445db33bb1f29101e0df15db15df0bab6411\ +5bc12f0bbf430551473dbd274db2eea9905eab75f290ecbd903b675f1ad9ac2f\ +2196d00139e7671ac8b95a8cc8e244511d481863b509e5bb7573b6ce49cf0fc9\ +53de75523ca31a64012d11bb7f60f1f67b199a4f2013f6ea3808e2639eb5f263\ +1c19568bcf36071235de8ae7b2d5815e2e0a2e81098a6b4d6179e29ed0a92bdf\ +585a2905f0496ba58eb3d740efa54b664d1a6134fed9fede636504aa691e08e4 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/seed.txt b/external/crypto++-5.6.3/TestVectors/seed.txt new file mode 100644 index 000000000..983fc3da1 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/seed.txt @@ -0,0 +1,19 @@ +AlgorithmType: SymmetricCipher +Name: SEED/ECB +Source: RFC 4269 +Key: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +Plaintext: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +Ciphertext: 5E BA C6 E0 05 4E 16 68 19 AF F1 CC 6D 34 6C DB +Test: Encrypt +Key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +Plaintext: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +Ciphertext: C1 1F 22 F2 01 40 50 50 84 48 35 97 E4 37 0F 43 +Test: Encrypt +Key: 47 06 48 08 51 E6 1B E8 5D 74 BF B3 FD 95 61 85 +Plaintext: 83 A2 F8 A2 88 64 1F B9 A4 E9 A5 CC 2F 13 1C 7D +Ciphertext: EE 54 D1 3E BC AE 70 6D 22 6B C3 14 2C D4 0D 4A +Test: Encrypt +Key: 28 DB C3 BC 49 FF D8 7D CF A5 09 B1 1D 42 2B E7 +Plaintext: B4 1E 6B E2 EB A8 4A 14 8E 2E ED 84 59 3C 5E C7 +Ciphertext: 9B 9B 7B FC D1 81 3C B9 5D 0B 36 18 F4 0F 51 22 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/sha.txt b/external/crypto++-5.6.3/TestVectors/sha.txt new file mode 100644 index 000000000..7980daa40 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/sha.txt @@ -0,0 +1,59 @@ +AlgorithmType: MessageDigest +Name: SHA-1 +Message: "abc" +Digest: A9993E364706816ABA3E25717850C26C9CD0D89D +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: 84983E441C3BD26EBAAE4AA1F95129E5E54670F1 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: 34AA973CD4C4DAA4F61EEB2BDBAD27316534016F +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-224 +Message: "abc" +Digest: 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: 75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: 20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67 +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-256 +Message: "abc" +Digest: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-384 +Message: "abc" +Digest: cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7 +Test: Verify +Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +Digest: 09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: 9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b07b8b3dc38ecc4ebae97ddd87f3d8985 +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-512 +Message: "abc" +Digest: ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f +Test: Verify +Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +Digest: 8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/sha3.txt b/external/crypto++-5.6.3/TestVectors/sha3.txt new file mode 100644 index 000000000..4ee8dec06 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/sha3.txt @@ -0,0 +1,861 @@ +AlgorithmType: MessageDigest +Name: SHA-3-224 +Message: "" +Digest: f71837502ba8e108 37bdd8d365adb855 91895602fc552b48 b7390abd +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +Digest: 310aee6b30c47350576ac2873fa89fd190cdc488442f3ef654cf23fe +Test: Verify +Message: "The quick brown fox jumps over the lazy dog." +Digest: c59d4eaeac728671c635ff645014e2afa935bebffdb5fbd207ffdeab +Test: Verify +Message: "abc" +Digest: c30411768506ebe1c2871b1ee2e87d38df342317300a9b97a95ec6a8 +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: e51faa2b4655150b931ee8d700dc202f763ca5f962c529eae55012b6 +Test: Verify +Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +Digest: 344298994b1b06873eae2ce739c425c47291a2e24189e01b524f88dc +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: 19f9167be2a04c43 abd0ed554788101b 9c339031acc8e146 8531303f +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-3-256 +Message: "" +Digest: c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +Digest: 4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15 +Test: Verify +Message: "The quick brown fox jumps over the lazy dog." +Digest: 578951e24efd62a3d63a86f7cd19aaa53c898fe287d2552133220370240b572d +Test: Verify +Message: "abc" +Digest: 4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: 45d3b367a6904e6e8d502ee04999a7c27647f91fa845d456525fd352ae3d7371 +Test: Verify +Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +Digest: f519747ed599024f3882238e5ab43960132572b7345fbeb9a90769dafd21ad67 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: fadae6b49f129bbb 812be8407b7b2894 f34aecf6dbd1f9b0 f0c7e9853098fc96 +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-3-384 +Message: "" +Digest: 2c23146a63a29acf99e73b88f8c24eaa7dc60aa771780ccc006afbfa8fe2479b2dd2b21362337441ac12b515911957ff +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +Digest: 283990fa9d5fb731d786c5bbee94ea4db4910f18c62c03d173fc0a5e494422e8a0b3da7574dae7fa0baf005e504063b3 +Test: Verify +Message: "The quick brown fox jumps over the lazy dog." +Digest: 9ad8e17325408eddb6edee6147f13856ad819bb7532668b605a24a2d958f88bd5c169e56dc4b2f89ffd325f6006d820b +Test: Verify +Message: "abc" +Digest: f7df1165f033337be098e7d288ad6a2f74409d7a60b49c36642218de161b1f99f8c681e4afaf31a34db29fb763e3c28e +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: b41e8896428f1bcbb51e17abd6acc98052a3502e0d5bf7fa1af949b4d3c855e7c4dc2c390326b3f3e74c7b1e2b9a3657 +Test: Verify +Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +Digest: cc063f34685135368b34f7449108f6d10fa727b09d696ec5331771da46a923b6c34dbd1d4f77e595689c1f3800681c28 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: 0c8324e1ebc18282 2c5e2a086cac07c2 fe00e3bce61d01ba 8ad6b71780e2dec5 fb89e5ae90cb593e 57bc6258fdd94e17 +Test: Verify + +AlgorithmType: MessageDigest +Name: SHA-3-512 +Message: "" +Digest: 0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e +Test: Verify +Message: "The quick brown fox jumps over the lazy dog" +Digest: d135bb84d0439dbac432247ee573a23ea7d3c9deb2a968eb31d47c4fb45f1ef4422d6c531b5b9bd6f449ebcc449ea94d0a8f05f62130fda612da53c79659f609 +Test: Verify +Message: "The quick brown fox jumps over the lazy dog." +Digest: ab7192d2b11f51c7dd744e7b3441febf397ca07bf812cceae122ca4ded6387889064f8db9230f173f6d1ab6e24b6e50f065b039f799f5592360a6558eb52d760 +Test: Verify +Message: "abc" +Digest: 18587dc2ea106b9a 1563e32b3312421c a164c7f1f07bc922 a9c83d77cea3a1e5 d0c6991073902537 2dc14ac964262937 9540c17e2a65b19d 77aa511a9d00bb96 +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Digest: 6aa6d3669597df6d 5a007b00d09c2079 5b5c4218234e1698 a944757a488ecdc0 9965435d97ca32c3 cfed7201ff30e070 cd947f1fc12b9d92 14c467d342bcba5d +Test: Verify +Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +Digest: ac2fb35251825d3a a48468a9948c0a91 b8256f6d97d8fa41 60faff2dd9dfcc24 f3f1db7a983dad13 d53439ccac0b37e2 4037e7b95f80f59f 37a2f683c4ba4682 +Test: Verify +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +Digest: 5cf53f2e556be5a6 24425ede23d0e8b2 c7814b4ba0e4e09c bbf3c2fac7056f61 e048fc341262875e bc58a5183fea6514 47124370c1ebf4d6 c89bc9a7731063bb +Test: Verify +Source: ShortMsgKAT_512.txt from http://keccak.noekeon.org/KeccakKAT-3.zip +Message: CC +Digest: 8630C13CBD066EA74BBE7FE468FEC1DEE10EDC1254FB4C1B7C5FD69B646E44160B8CE01D05A0908CA790DFB080F4B513BC3B6225ECE7A810371441A5AC666EB9 +Test: Verify +Message: 41FB +Digest: 551DA6236F8B96FCE9F97F1190E901324F0B45E06DBBB5CDB8355D6ED1DC34B3F0EAE7DCB68622FF232FA3CECE0D4616CDEB3931F93803662A28DF1CD535B731 +Test: Verify +Message: 1F877C +Digest: EB7F2A98E00AF37D964F7D8C44C1FB6E114D8EE21A7B976AE736539EFDC1E3FE43BECEF5015171E6DA30168CAE99A82C53FA99042774EF982C01626A540F08C0 +Test: Verify +Message: C1ECFDFC +Digest: 952D4C0A6F0EF5CE438C52E3EDD345EA00F91CF5DA8097C1168A16069E958FC05BAD90A0C5FB4DD9EC28E84B226B94A847D6BB89235692EF4C9712F0C7030FAE +Test: Verify +Message: 21F134AC57 +Digest: 2E76D93AFFD62B92FC4F29CB83EFBE4BA21D88426AA7F075BFC20960EA258787898172E17045AF43AB1FE445532BE0185FBEA84D9BE788B05F14DBF4856A5254 +Test: Verify +Message: C6F50BB74E29 +Digest: 40FA8074E1E509B206448FBE757D9494B9B51E8D6E674A67F53C11EF92E96C3EA08B95EBD4172B020010CD6CF29539A34D6BFA002A2042787AA8D879A0F5B54C +Test: Verify +Message: 119713CC83EEEF +Digest: D1116786A3C1EA46A8F22D82ABB4C5D06DC0691B2E747AC9726D0B290E6959F7B23428519A656B237695E56403855EC4C98DB0CF87F31B6CEABF2B9B8589B713 +Test: Verify +Message: 4A4F202484512526 +Digest: F326C7C126DDC277922760FEEF77C9BAB6FB5D3430F652593703D7C5E30135CD0B0575257509A624184330D6AB1F508A666391B5D4690426B4E05301891DF897 +Test: Verify +Message: 1F66AB4185ED9B6375 +Digest: 1F5B8A6E8D94F5E2535D46842B9CED467C39C2DB323963D3F3D937E9DDA76FBC17072DDA2AB4771CD7A645145A2AEC1B5749BF9EFE0CDE006CC3EF8936438E0D +Test: Verify +Message: EED7422227613B6F53C9 +Digest: 2AEEE7A720C030A820CD7BAA8570D72CB90B7A238C38C358676358A7AE9A5CF26635B2320D61C1284899E654F0BFDD0A3A9C343FFBD11838B57465E6C3AD3A57 +Test: Verify +Message: EAEED5CDFFD89DECE455F1 +Digest: 7B1C1BEF3B4DEB4B4812C81A6E7B3F2C66FA95157FA3B9D2959DC56B8ADD100170D3C8D1745FD230A31F89FA17889C4C58946B5D746E47B71ED0394B66D1BDB2 +Test: Verify +Message: 5BE43C90F22902E4FE8ED2D3 +Digest: EE41401AF509D6FC0944CD4A0BB29D2DCE0DCC862606E669E31381E5D6CECB463143645D696D14E40169CDC71C75686D6E8732B432092626421CC6CC196F80BF +Test: Verify +Message: A746273228122F381C3B46E4F1 +Digest: 9B53B410B9F5DCE90A77244DB407A3D0F4898D112D0044A8F66AF933E26666DE63EBD2A4322D8FE525AB354CE9676B6A14D0CE6B3D24E6CD5832BEA0C5153CEF +Test: Verify +Message: 3C5871CD619C69A63B540EB5A625 +Digest: 2B53FE6583FC24EE8A63801067E4D3BD6E6934EF16BC822FC3A69F4EE13A404D9A3CE2BB4A12C77382BFDE4D843F87FD06ED8AECC234A3A24CEDFE60BFC06933 +Test: Verify +Message: FA22874BCC068879E8EF11A69F0722 +Digest: 80946CA68E8C16A9667CD8339D1C5B00F1E0D401D0ECC79458754794838F3AE2949A8CC5FE5584033BCA9C5BE62C7C08F402EF02F727CEFA43BBD374C2A67C52 +Test: Verify +Message: 52A608AB21CCDD8A4457A57EDE782176 +Digest: 4B39D3DA5BCDF4D9B769015995644311C14C435BF72B1009D6DD71B01A63B97CFB596418E8E42342D117E07471A8914314BA7B0E264DADF0CEA381868CBD43D1 +Test: Verify +Message: 82E192E4043DDCD12ECF52969D0F807EED +Digest: C37C9DC2E20D8E2F0AE588D7D45A807CCFA000FC948AC42A8ED63BB14F318FC3D4B963F7305980E6A0FD2316B55B63142373B1A29002264855C716C5C9F17F4C +Test: Verify +Message: 75683DCB556140C522543BB6E9098B21A21E +Digest: 9073C62555E6095F17DF71AD02BABB9100288633898489B21C906A3190875BAEACCC83BE80ABD11466FEC371BA2C4623D07F0131DEFAEC13A8C732A9F8417163 +Test: Verify +Message: 06E4EFE45035E61FAAF4287B4D8D1F12CA97E5 +Digest: 23E9352856718E1E2D68A21D56D93117CED7628E984FF04ED8C0CB9B10539E4EDE284F94FA71BF4B83BBB493435FD6BE26EDDB09DEAC39680E6B05ACC87B8C4E +Test: Verify +Message: E26193989D06568FE688E75540AEA06747D9F851 +Digest: 909D753426B1DEE09FC474F18CF810D5D5AADBF8A09AF495BF6C22ACA0C673021BFC5D2AD94F50B24E1569E956694B21CF2CC8B4F3C7EE4CF195E4424CC415DD +Test: Verify +Message: D8DC8FDEFBDCE9D44E4CBAFE78447BAE3B5436102A +Digest: 046C6019FC4D628AE0DA7092F9910F269B853D3B57052039AD1375C665405F9FD79D57579F42C4FFF249BB85AE65113A9F4276CEDE73E9CCB0C24753935A006E +Test: Verify +Message: 57085FD7E14216AB102D8317B0CB338A786D5FC32D8F +Digest: 51C909A6528949BADDAF1BA0B154EA9C33FDE5074359505B76D4B7ED54352DD893D40B142A5F802F378CBA7B8C3782ECF2A048542BE6C5936822214846A8D5E4 +Test: Verify +Message: A05404DF5DBB57697E2C16FA29DEFAC8AB3560D6126FA0 +Digest: EFC8917E1247742A2D4EC29AFEDDF1E6ECE377B3D8AC6E58C9851CE9C99BD599ADEBFED657BAACD1793FC91B04DF2957BF6F1888869286002DC4AD9AC7F76793 +Test: Verify +Message: AECBB02759F7433D6FCB06963C74061CD83B5B3FFA6F13C6 +Digest: FCEF88BCC7EF70D8C3973429AC5139155F9BA643B431013F1817ECD2FF3AB287880F9EA54DF7503CB3F73D7CF2B87D2E9BDBD203378FAE74CA4BD2667A4AA706 +Test: Verify +Message: AAFDC9243D3D4A096558A360CC27C8D862F0BE73DB5E88AA55 +Digest: 470BDD8D709875C8E6F88591B97D6486C5F03B54BFC905757483E013F63A6C56984D4518D45C2D2298EADB44AF3A0C35A76B573D452F5747844D3AD8F84A2E85 +Test: Verify +Message: 7BC84867F6F9E9FDC3E1046CAE3A52C77ED485860EE260E30B15 +Digest: 429FD438B390AD0224028975467EC228F9ADCDE71E1738005E3717C58F727AA2B7C61780BF0C5F8B766CC6D34551D87D22A130B8C215614204E607AA82FF8469 +Test: Verify +Message: FAC523575A99EC48279A7A459E98FF901918A475034327EFB55843 +Digest: 790A010AEB6F13E019A1DC35574B1219E74FF5DB6FBD8746733664FFDBCFE1CC6E8AB39117E3244C4FA3C0A962C9F50030AEF88E193E7E0D4C4747345F30CB54 +Test: Verify +Message: 0F8B2D8FCFD9D68CFFC17CCFB117709B53D26462A3F346FB7C79B85E +Digest: AAF7A391600270F7B5A2A3BBC7474AC4154EBEAC03A790A57FDAD96CEA2D043C9FA5F6916790B92F8032D668ED9A07112DC5B2373EC816AABCA6F577CE60415E +Test: Verify +Message: A963C3E895FF5A0BE4824400518D81412F875FA50521E26E85EAC90C04 +Digest: 3E2880A974E50F98BD6CC0F9D769AF348CE3B7E8FA38CF0CA2DA5FD704C9C0E57D5500BEA3CB7477927F9C394AA3F9BBC01824350291B9A0A0CBF094BB37DA55 +Test: Verify +Message: 03A18688B10CC0EDF83ADF0A84808A9718383C4070C6C4F295098699AC2C +Digest: 48E55E0340F20466881A732AA88459AD4BCDEF364C3BD045AE099F953D89F15957AEF204265C3915BA42FE4235196BE3D0F564676227C3C0DEACFBAF68F9E717 +Test: Verify +Message: 84FB51B517DF6C5ACCB5D022F8F28DA09B10232D42320FFC32DBECC3835B29 +Digest: 9D8098D8D6EDBBAA2BCFC6FB2F89C3EAC67FEC25CDFE75AA7BD570A648E8C8945FF2EC280F6DCF73386109155C5BBC444C707BB42EAB873F5F7476657B1BC1A8 +Test: Verify +Message: 9F2FCC7C90DE090D6B87CD7E9718C1EA6CB21118FC2D5DE9F97E5DB6AC1E9C10 +Digest: 1EAFEDCE7292BA73B80AE6151745F43AC95BFC9F31694D422473ABCA2E69D695CB6544DB65506078CB20DBE0762F84AA6AFD14A60AB597955BE73F3F5C50F7A8 +Test: Verify +Message: DE8F1B3FAA4B7040ED4563C3B8E598253178E87E4D0DF75E4FF2F2DEDD5A0BE046 +Digest: 9A7688E31AAF40C15575FC58C6B39267AAD3722E696E518A9945CF7F7C0FEA84CB3CB2E9F0384A6B5DC671ADE7FB4D2B27011173F3EEEAF17CB451CF26542031 +Test: Verify +Message: 62F154EC394D0BC757D045C798C8B87A00E0655D0481A7D2D9FB58D93AEDC676B5A0 +Digest: ADA5CA5630660003C4D16149F235FAEB78132F7F773A631F820CC5C654B08EAB4206BB4EA1389D1CF74D3B60B86E484C90C817CDB5DD5DBF327163B4646F7213 +Test: Verify +Message: B2DCFE9FF19E2B23CE7DA2A4207D3E5EC7C6112A8A22AEC9675A886378E14E5BFBAD4E +Digest: 71A0801D32587980B09963A0F547B8B6EE3BADE224671BF44F12E3DA4F21778BAC37FCC73EF45FEE1C96688BAF9020F487B1A16E3AC91B504845D6FBA879134F +Test: Verify +Message: 47F5697AC8C31409C0868827347A613A3562041C633CF1F1F86865A576E02835ED2C2492 +Digest: EBA678B7A0E5669DC7FA5ECA5D5F19FE625E113E5028DA5EFB138923CD444757B06078E0BA064B36C72CA2187AB9DD31DDA6F24668F46C32F8EC21AC59AAFA24 +Test: Verify +Message: 512A6D292E67ECB2FE486BFE92660953A75484FF4C4F2ECA2B0AF0EDCDD4339C6B2EE4E542 +Digest: 12DF92D889D7BA0DF05BCD02D9DE58C97F4813126967FF78BDF759C66C4CBE9DF68AB31A0256C776730BB25DEECF91F0997868AC8BB86DF7A0FC110CB0A4DE5D +Test: Verify +Message: 973CF2B4DCF0BFA872B41194CB05BB4E16760A1840D8343301802576197EC19E2A1493D8F4FB +Digest: B8C7CE2BE4CB32C140E75B75474248C1DD77D19B0CBCA31A3ECC2A35C532E4FA3ED4ABBCDA27AA68A9DDA06B245443E5903A65652A94ED3AF15065D3E7736E47 +Test: Verify +Message: 80BEEBCD2E3F8A9451D4499961C9731AE667CDC24EA020CE3B9AA4BBC0A7F79E30A934467DA4B0 +Digest: A0AE9DFB56831FE4A3223C501B697BD8243C471E8343ACFD37A6B587FEAC74571C23DEEBC9B94A540A02F1B1E2251E01229C9D58C4279F155D5566FB18E81295 +Test: Verify +Message: 7ABAA12EC2A7347674E444140AE0FB659D08E1C66DECD8D6EAE925FA451D65F3C0308E29446B8ED3 +Digest: 631E7847124A70FE6EB293A44A25C50600B5E7E975CA9FAB5AE64AB86C7E42C912DD6EC093F01A8DEBC6E1F5E487AF97DC3FD6C53002765050BE963FFCD4D989 +Test: Verify +Message: C88DEE9927679B8AF422ABCBACF283B904FF31E1CAC58C7819809F65D5807D46723B20F67BA610C2B7 +Digest: B989263BB4E0424F95FDC9A49C83A3769FBF31DCEDDA7E005AB5F22F43D2718DEBD39085971F7EB7822C9FA0F67F776CEC4E35A9A8B8C835EF4E9EBDA1922E4D +Test: Verify +Message: 01E43FE350FCEC450EC9B102053E6B5D56E09896E0DDD9074FE138E6038210270C834CE6EADC2BB86BF6 +Digest: FF6ADCB9E1546798D396DB78452DF1A375B65EE3D54FCC915A8CA3DA693E24931999B0FC8A4EB92F6FF85E42BB4CFD9CE7D7863EEE709C9EF37642B696174474 +Test: Verify +Message: 337023370A48B62EE43546F17C4EF2BF8D7ECD1D49F90BAB604B839C2E6E5BD21540D29BA27AB8E309A4B7 +Digest: 1051B7FF77274B784E7FB7823E756F0C4355047E489775BBEDAA7CE5A75EFAC331492C016CE02EB2BE8BA2FE6B735B9A1484E73AC06DE573C5D0B4A58822A36A +Test: Verify +Message: 6892540F964C8C74BD2DB02C0AD884510CB38AFD4438AF31FC912756F3EFEC6B32B58EBC38FC2A6B913596A8 +Digest: 5639A2824297CA099ECF2A81EEF1753F6314CB663D860F05A39E3E801FF82060BBA10628E2C0D9E0A84DD05ED637FC0B65BA03BB66E46FB256F2A5B28D3F41D2 +Test: Verify +Message: F5961DFD2B1FFFFDA4FFBF30560C165BFEDAB8CE0BE525845DEB8DC61004B7DB38467205F5DCFB34A2ACFE96C0 +Digest: 97F9D642507E6DD179D56F4B815E92D0D486826F273EC711B8F9CB76AFC79F900816FDBC13DD3A59FBECBA1F3B6953F879F27C8987B24C6FF8557A2C834076B9 +Test: Verify +Message: CA061A2EB6CEED8881CE2057172D869D73A1951E63D57261384B80CEB5451E77B06CF0F5A0EA15CA907EE1C27EBA +Digest: AFEF2AF5A01B89BE190A0E6E796AA51F1F8C356772C6FC7731F08AAB8BD81AEE1287C70D564F4F169E37B07F28202A85F468281B4CDC1273CF61EB30E3BDCEE1 +Test: Verify +Message: 1743A77251D69242750C4F1140532CD3C33F9B5CCDF7514E8584D4A5F9FBD730BCF84D0D4726364B9BF95AB251D9BB +Digest: F467CCA67C387FFC9F1B173A084C451095D01AD0BF3953AC103A76F0F1BC86167305A926A941A53417F1611A505AAA205BCFCCBFD343465DAD8A6C1E80609A9D +Test: Verify +Message: D8FABA1F5194C4DB5F176FABFFF856924EF627A37CD08CF55608BBA8F1E324D7C7F157298EABC4DCE7D89CE5162499F9 +Digest: 4B389A2A0DF5E295EA9444F2739B5492F290C4467B0B4CDC1CC9ED2CEFA7A9E527E0627CDAF0BDA58F17D13F94AF7D2DEFF6FC5D53DD9157674475527FBB4F86 +Test: Verify +Message: BE9684BE70340860373C9C482BA517E899FC81BAAA12E5C6D7727975D1D41BA8BEF788CDB5CF4606C9C1C7F61AED59F97D +Digest: 6590FFFB7311AB7DAB370FB518CCC19BAA9AF7C84179ADB002F8FACD3C44AF2830A84DF1E2C2402368CC36614A6EA22903063E57D00EC511A46A9A03FE3819F7 +Test: Verify +Message: 7E15D2B9EA74CA60F66C8DFAB377D9198B7B16DEB6A1BA0EA3C7EE2042F89D3786E779CF053C77785AA9E692F821F14A7F51 +Digest: 895796B2A0824C55F030D82E794925C38D8459F38CF848519F120FF6A9D5A03EBF006C3EA5021E8F3B3408FF12F01BCDDF7A085BA0A9A58944FEC1F554836DF8 +Test: Verify +Message: 9A219BE43713BD578015E9FDA66C0F2D83CAC563B776AB9F38F3E4F7EF229CB443304FBA401EFB2BDBD7ECE939102298651C86 +Digest: E4BBD54BFB99D345471F8AB94271B4B748F5CE70C21C28AE6559E03EE7890A2C814043E624A6BD2944350756B37FA8208FC7473A67B310CEEBC17D965ED688B2 +Test: Verify +Message: C8F2B693BD0D75EF99CAEBDC22ADF4088A95A3542F637203E283BBC3268780E787D68D28CC3897452F6A22AA8573CCEBF245972A +Digest: 80D862AD05428A299213E65B50310463FD22C505E693DD4719E0A120EEAA35C5FC1608A08D22E2CCDDECA49878BC26ABE55A3C9A546347439A942ED0C1A6A23E +Test: Verify +Message: EC0F99711016C6A2A07AD80D16427506CE6F441059FD269442BAAA28C6CA037B22EEAC49D5D894C0BF66219F2C08E9D0E8AB21DE52 +Digest: 021B3B392DECCB9075559F88C0C229026A2048CEF8EEB2D4F94803DCF2DA0A73E004D7F14E9FD662670B59229AB3883C340F4E3A8C42624CCB90BEC1156F95D4 +Test: Verify +Message: 0DC45181337CA32A8222FE7A3BF42FC9F89744259CFF653504D6051FE84B1A7FFD20CB47D4696CE212A686BB9BE9A8AB1C697B6D6A33 +Digest: 97BF33A5254C8ACA27486428440B1034AAAFAC8B498ECB830C2581DC68518079B65FB0C595997693DDB8D68D9564EA98DC43CD287E2E018DB7DFAAAA205C547A +Test: Verify +Message: DE286BA4206E8B005714F80FB1CDFAEBDE91D29F84603E4A3EBC04686F99A46C9E880B96C574825582E8812A26E5A857FFC6579F63742F +Digest: C05FD9C3FA73F80956FF1C3B89160EB520CA640E201B3FE5E6E296220E81B59D530476010D3784CA08692B8C716A3BE982B37450A96D30A401D3BA3C390D9DE3 +Test: Verify +Message: EEBCC18057252CBF3F9C070F1A73213356D5D4BC19AC2A411EC8CDEEE7A571E2E20EAF61FD0C33A0FFEB297DDB77A97F0A415347DB66BCAF +Digest: B980E657C13726DBADB6570EA3A9E633869CADB798EB35C482697A04CB712F1C1E8C5D0BD67E43E52DA294E82D5E80A695A74A3D27C0C672ADCFE2C928859A6D +Test: Verify +Message: 416B5CDC9FE951BD361BD7ABFC120A5054758EBA88FDD68FD84E39D3B09AC25497D36B43CBE7B85A6A3CEBDA8DB4E5549C3EE51BB6FCB6AC1E +Digest: 6ADFC561835FDDD70A9FEB57C513165D12AEB3283F0DD7774DD58852DA9E969ABDAF20DD44856FA60E11BDFA2DBB7E3347669FFF7A57A8D8D37431C2B309972D +Test: Verify +Message: 5C5FAF66F32E0F8311C32E8DA8284A4ED60891A5A7E50FB2956B3CBAA79FC66CA376460E100415401FC2B8518C64502F187EA14BFC9503759705 +Digest: 0E7459BDC857B949CC59A9C649B9625268BF9A11EA81EEEFA4ECDD410E2F6FD2C78289C01365F99034FF8FA8C115DDCEBEFA26A8D6468F5030E641745950061E +Test: Verify +Message: 7167E1E02BE1A7CA69D788666F823AE4EEF39271F3C26A5CF7CEE05BCA83161066DC2E217B330DF821103799DF6D74810EED363ADC4AB99F36046A +Digest: 2A8CE9DF40879B24DADF61C9131F694E5531ADE6B7AB071CA10ABDD3C2E4A22C868A52986A329F880137EE76109770927D2658E63EB486D880290AC0782CF5BF +Test: Verify +Message: 2FDA311DBBA27321C5329510FAE6948F03210B76D43E7448D1689A063877B6D14C4F6D0EAA96C150051371F7DD8A4119F7DA5C483CC3E6723C01FB7D +Digest: A83CE5A6A58376D57DB4C58DA1B46C131FF1BF8FF2DE5E8617FB37E5098398EDB53F9888B8752A8AFF19178F2F6BD7A33FD36C59E4A631906280907FC1C5AB07 +Test: Verify +Message: 95D1474A5AAB5D2422ACA6E481187833A6212BD2D0F91451A67DD786DFC91DFED51B35F47E1DEB8A8AB4B9CB67B70179CC26F553AE7B569969CE151B8D +Digest: 9EBFCEA2DB1676EEE6B103119543C6049DEBD8FB8F1E01A5AB5B348E2919E14C8CFE8E542F2AB747B0FD4A4C3EEE4019BB046E24BFE2091FB9C65DCA527B71AD +Test: Verify +Message: C71BD7941F41DF044A2927A8FF55B4B467C33D089F0988AA253D294ADDBDB32530C0D4208B10D9959823F0C0F0734684006DF79F7099870F6BF53211A88D +Digest: 97B08BE7653E9DF1B5AFA459EA750A3AC9BF3577BCC7E5344FC861184880926DEF354E4C65B20EC66C47B7AFFD3E7493958BAB0A90724D3D8DD9E1D561FA60C2 +Test: Verify +Message: F57C64006D9EA761892E145C99DF1B24640883DA79D9ED5262859DCDA8C3C32E05B03D984F1AB4A230242AB6B78D368DC5AAA1E6D3498D53371E84B0C1D4BA +Digest: EF8AAF08159BBCB88EFAC49A33A5248B7ED0544960D8DD54D748A91C0D84C69F308BB54CB5EC97D3F81CDF76E68E0320815B93F2A00942F2168CBC18E8377708 +Test: Verify +Message: E926AE8B0AF6E53176DBFFCC2A6B88C6BD765F939D3D178A9BDE9EF3AA131C61E31C1E42CDFAF4B4DCDE579A37E150EFBEF5555B4C1CB40439D835A724E2FAE7 +Digest: C0A4D8DCA967772DBF6E5508C913E7BEBA1B749A2B1AC963D0676E6F1DCD4EBAA3F909EF87DD849882DC8253347A5F6520B5B9F510973F443976455F923CFCB9 +Test: Verify +Message: 16E8B3D8F988E9BB04DE9C96F2627811C973CE4A5296B4772CA3EEFEB80A652BDF21F50DF79F32DB23F9F73D393B2D57D9A0297F7A2F2E79CFDA39FA393DF1AC00 +Digest: CF03C946EB7022F60FB5439462AC22684E47EAACBFFE19B797760B4A24A5238BE9D90E17D40EA6FE7B2885CEF7DFB8BB489401CAA94F2DD6E04592E33E76B9D1 +Test: Verify +Message: FC424EEB27C18A11C01F39C555D8B78A805B88DBA1DC2A42ED5E2C0EC737FF68B2456D80EB85E11714FA3F8EABFB906D3C17964CB4F5E76B29C1765DB03D91BE37FC +Digest: 2C35F1A57A17CB29403A2B40FC307BDE10BA8F7FEC7B94E1E42EB4EEB952AAD00EC46A26646CD51DB0C6B238189D7D470E21C29BF8710423CB5602CAB75E29E7 +Test: Verify +Message: ABE3472B54E72734BDBA7D9158736464251C4F21B33FBBC92D7FAC9A35C4E3322FF01D2380CBAA4EF8FB07D21A2128B7B9F5B6D9F34E13F39C7FFC2E72E47888599BA5 +Digest: 505E6E607C90C57BBE7CE52BB42DF3D90BC32DE554025730C84ED0F89A0132885D7A40FADFF7A4B01DE4D29735AEFE0E0469F4F172B62A0DABA889E152308FC4 +Test: Verify +Message: 36F9F0A65F2CA498D739B944D6EFF3DA5EBBA57E7D9C41598A2B0E4380F3CF4B479EC2348D015FFE6256273511154AFCF3B4B4BF09D6C4744FDD0F62D75079D440706B05 +Digest: 7BE2C95413C589EC5AD69F8D80BFE9F26540D5C1832C7A49A31A8F5655D9CE8B47D97C69CCCD693C211904142A5403DA7AD09FBDB825698FE201988FCCCD2BB2 +Test: Verify +Message: ABC87763CAE1CA98BD8C5B82CABA54AC83286F87E9610128AE4DE68AC95DF5E329C360717BD349F26B872528492CA7C94C2C1E1EF56B74DBB65C2AC351981FDB31D06C77A4 +Digest: 8AAC9201D76DF13424A32552F04390E499B6168711B70C875789DDAA9B115F8B8259A60D17835E2587F8901C3CA782DA9AFB28BA87B9FCBE05A47A42F48FCD48 +Test: Verify +Message: 94F7CA8E1A54234C6D53CC734BB3D3150C8BA8C5F880EAB8D25FED13793A9701EBE320509286FD8E422E931D99C98DA4DF7E70AE447BAB8CFFD92382D8A77760A259FC4FBD72 +Digest: AA52587D84586317028FB7D3C20892E0288BFE2FEABD76D7F89155FFE9CCBF1A09FA0FFB0553E83F79AE58BD30A35FA54892B6ABA0093A012427DDAB71CDF819 +Test: Verify +Message: 13BD2811F6ED2B6F04FF3895ACEED7BEF8DCD45EB121791BC194A0F806206BFFC3B9281C2B308B1A729CE008119DD3066E9378ACDCC50A98A82E20738800B6CDDBE5FE9694AD6D +Digest: 48FC282F37A3E1FB5DF4D2DA1F7197EC899AE573CA08DF550E61EE847EEB1D24C074FF46BCAEE224EC7D8CEA4256154F0C4D434E682834F6D827BFBDF75112F5 +Test: Verify +Message: 1EED9CBA179A009EC2EC5508773DD305477CA117E6D569E66B5F64C6BC64801CE25A8424CE4A26D575B8A6FB10EAD3FD1992EDDDEEC2EBE7150DC98F63ADC3237EF57B91397AA8A7 +Digest: 6B4B0F126863552A6F40F45E295DC79B9BA2A88EA7C3B2F607AC1A8431A97844C2A7B664443FB23C05739DF5494FE9824DB80B7F3E67872142F17E2C5544E1EF +Test: Verify +Message: BA5B67B5EC3A3FFAE2C19DD8176A2EF75C0CD903725D45C9CB7009A900C0B0CA7A2967A95AE68269A6DBF8466C7B6844A1D608AC661F7EFF00538E323DB5F2C644B78B2D48DE1A08AA +Digest: 7EEC7B730056B1BD4F6FFC186FB45591E50CD93CF6E4FC958889F82D3F32C5C74D03A4BCF7D2754298F134698AF4559B0E29BAAA365CC00DB0D51D407179C56D +Test: Verify +Message: 0EFA26AC5673167DCACAB860932ED612F65FF49B80FA9AE65465E5542CB62075DF1C5AE54FBA4DB807BE25B070033EFA223BDD5B1D3C94C6E1909C02B620D4B1B3A6C9FED24D70749604 +Digest: 79CB925ACA072EBB3B49A9D0E59BB07DD1C223C1F26C91768B929472C51B977F85C6CEEB54BCE89CF9FF6155D7FE8091540F1348CE9592A6403F92105477870E +Test: Verify +Message: BBFD933D1FD7BF594AC7F435277DC17D8D5A5B8E4D13D96D2F64E771ABBD51A5A8AEA741BECCBDDB177BCEA05243EBD003CFDEAE877CCA4DA94605B67691919D8B033F77D384CA01593C1B +Digest: B5D1ED8F039044BCFEF41E99B2F564F45991B329B503FC91FA29D2408512F8711E9DB66F8AE172164650545AE9E3DB32AA369EC47E81A77111276E6CA38E4D92 +Test: Verify +Message: 90078999FD3C35B8AFBF4066CBDE335891365F0FC75C1286CDD88FA51FAB94F9B8DEF7C9AC582A5DBCD95817AFB7D1B48F63704E19C2BAA4DF347F48D4A6D603013C23F1E9611D595EBAC37C +Digest: 782C008A9EE3DDA0A182267185C995A2AF737BA8CB2F6179F2CDF52505F8D933E712FC4E56D10E175EC8CDD62DE6529CE1F078BFA0DC7A5284F8C565182F85D9 +Test: Verify +Message: 64105ECA863515C20E7CFBAA0A0B8809046164F374D691CDBD6508AAABC1819F9AC84B52BAFC1B0FE7CDDBC554B608C01C8904C669D8DB316A0953A4C68ECE324EC5A49FFDB59A1BD6A292AA0E +Digest: 91A0241EDA8CA597CBB0F703AB7DBAAF859CFF77B20401AD46230CE3B2BEEF6685775DE37576014D8DA1BA672D47AAD95FB53C590B650634CEBB43A175738569 +Test: Verify +Message: D4654BE288B9F3B711C2D02015978A8CC57471D5680A092AA534F7372C71CEAAB725A383C4FCF4D8DEAA57FCA3CE056F312961ECCF9B86F14981BA5BED6AB5B4498E1F6C82C6CAE6FC14845B3C8A +Digest: 00B02DBCB7A3BC117701F2F159FC4492923C437D3369833A9BD09E78E260D48D37168D36C49777B2E68E6FE9846106A6AB8768C3971FAB31FD922AACB87D1CAC +Test: Verify +Message: 12D9394888305AC96E65F2BF0E1B18C29C90FE9D714DD59F651F52B88B3008C588435548066EA2FC4C101118C91F32556224A540DE6EFDDBCA296EF1FB00341F5B01FECFC146BDB251B3BDAD556CD2 +Digest: 3DEDF819B357DFAB1C7092ABD872A1554DD0962E9944EEF9F7F8BCE830F2D74F1D9BA2B748BBC6EE0B7600BE8CB0FFCB79924D9F51CDB9B06BD6FD37F3050229 +Test: Verify +Message: 871A0D7A5F36C3DA1DFCE57ACD8AB8487C274FAD336BC137EBD6FF4658B547C1DCFAB65F037AA58F35EF16AFF4ABE77BA61F65826F7BE681B5B6D5A1EA8085E2AE9CD5CF0991878A311B549A6D6AF230 +Digest: 5FBE194557B0426F96BA60712176DF073EAFE04F2A50515455412EA3D80C116758AD952598F48031612181D82A16EFE4668FFB3BCCE9563A772FE416FF6DB3B3 +Test: Verify +Message: E90B4FFEF4D457BC7711FF4AA72231CA25AF6B2E206F8BF859D8758B89A7CD36105DB2538D06DA83BAD5F663BA11A5F6F61F236FD5F8D53C5E89F183A3CEC615B50C7C681E773D109FF7491B5CC22296C5 +Digest: 2E8AB1619859C11473DC7C474CE8B0AE44B1C38417816FD95B9E0614F31E51EBB1DD16D1CBB584C4EBD28AA99F4A68E09DFE3AD462487F2608124B7528293045 +Test: Verify +Message: E728DE62D75856500C4C77A428612CD804F30C3F10D36FB219C5CA0AA30726AB190E5F3F279E0733D77E7267C17BE27D21650A9A4D1E32F649627638DBADA9702C7CA303269ED14014B2F3CF8B894EAC8554 +Digest: DB2D182BDBAC6AC866537E24712332CAE74DC3D36168982E4453DD6E009658345255013BC0A54FCA17AEEDCC4BEB79BDEE192CFAB516D24591C8699F7C758179 +Test: Verify +Message: 6348F229E7B1DF3B770C77544E5166E081850FA1C6C88169DB74C76E42EB983FACB276AD6A0D1FA7B50D3E3B6FCD799EC97470920A7ABED47D288FF883E24CA21C7F8016B93BB9B9E078BDB9703D2B781B616E +Digest: 90A2C05F7001D985B587A046B488BF4ED29D75CC03A745731B5B0CE51BB86387C4CE34018A6D906EB7BEB41A09AFE9FEDD99AACC41B4556F75229C8688C7FCA2 +Test: Verify +Message: 4B127FDE5DE733A1680C2790363627E63AC8A3F1B4707D982CAEA258655D9BF18F89AFE54127482BA01E08845594B671306A025C9A5C5B6F93B0A39522DC877437BE5C2436CBF300CE7AB6747934FCFC30AEAAF6 +Digest: EA3991C4A8A5F0146402DE4AE235054C78A48DCA340A7D4AD8753995F82347ECFC0054D64EB4F20ABC4F415C54701CBC61A7B239A7C221B833D9EA9F94B154E8 +Test: Verify +Message: 08461F006CFF4CC64B752C957287E5A0FAABC05C9BFF89D23FD902D324C79903B48FCB8F8F4B01F3E4DDB483593D25F000386698F5ADE7FAADE9615FDC50D32785EA51D49894E45BAA3DC707E224688C6408B68B11 +Digest: 1313023B753ED1727F13CC67A64B989A8BF6548324DF9854D8D5A963ED3D860257FE6522B9C6D6CB1BCADF322C985601BA36F7E67110192094AA8F9869A458A8 +Test: Verify +Message: 68C8F8849B120E6E0C9969A5866AF591A829B92F33CD9A4A3196957A148C49138E1E2F5C7619A6D5EDEBE995ACD81EC8BB9C7B9CFCA678D081EA9E25A75D39DB04E18D475920CE828B94E72241F24DB72546B352A0E4 +Digest: 9BCA2A1A5546A11275BF42F0B48492868359C78D94785A0EE12DC1C3D70A8E97EB462148FAED1FFA4DAB0E91519BD36C0C5C5FE7CFCFF3E180680318E1FCF75B +Test: Verify +Message: B8D56472954E31FB54E28FCA743F84D8DC34891CB564C64B08F7B71636DEBD64CA1EDBDBA7FC5C3E40049CE982BBA8C7E0703034E331384695E9DE76B5104F2FBC4535ECBEEBC33BC27F29F18F6F27E8023B0FBB6F563C +Digest: 8492F5E621E82FDBFF1976B1BEECFF7D137805B5736AB49216122A95396B863A0481212B6DABA8B05E29E287BB0E2F588F86407C84DBFB894E6ACFC6F6B2E571 +Test: Verify +Message: 0D58AC665FA84342E60CEFEE31B1A4EACDB092F122DFC68309077AED1F3E528F578859EE9E4CEFB4A728E946324927B675CD4F4AC84F64DB3DACFE850C1DD18744C74CECCD9FE4DC214085108F404EAB6D8F452B5442A47D +Digest: EEBE4EC0FE3E0266527F4D9F57A017637EAB92377D82B15856A55A22B008DF67F27AA5AC04E1DEEEB2C819CE41DB07DBF6DCAF17A192A4371A1E92BADF1E6389 +Test: Verify +Message: 1755E2D2E5D1C1B0156456B539753FF416651D44698E87002DCF61DCFA2B4E72F264D9AD591DF1FDEE7B41B2EB00283C5AEBB3411323B672EAA145C5125185104F20F335804B02325B6DEA65603F349F4D5D8B782DD3469CCD +Digest: 9E36E6291BC2296CB4BA71109CEDCC2A3F0B4F1AE5E5406DC4B3E594551D5C70E6F814D2C9B8413103EF07535886B4AC518AAF7AED64ABED7A5B0A26F7171425 +Test: Verify +Message: B180DE1A611111EE7584BA2C4B020598CD574AC77E404E853D15A101C6F5A2E5C801D7D85DC95286A1804C870BB9F00FD4DCB03AA8328275158819DCAD7253F3E3D237AEAA7979268A5DB1C6CE08A9EC7C2579783C8AFC1F91A7 +Digest: F1089483A00B2601BE9C16469A090EFC49FCB70E62AC0FFEA2D1E508083CD5D41DCF2DAAE1E0EAC217859E5FEADDCB782AC471C01D7266136185D37B568E9606 +Test: Verify +Message: CF3583CBDFD4CBC17063B1E7D90B02F0E6E2EE05F99D77E24E560392535E47E05077157F96813544A17046914F9EFB64762A23CF7A49FE52A0A4C01C630CFE8727B81FB99A89FF7CC11DCA5173057E0417B8FE7A9EFBA6D95C555F +Digest: D063EA794CFD2ED9248665A6084A7B99051C1051E41B7D9DCB1537A1C79CBA6DEB4D844C6A618E43C7CA020D16976999684FEB084616F707209F75C4BD584D86 +Test: Verify +Message: 072FC02340EF99115BAD72F92C01E4C093B9599F6CFC45CB380EE686CB5EB019E806AB9BD55E634AB10AA62A9510CC0672CD3EDDB589C7DF2B67FCD3329F61B1A4441ECA87A33C8F55DA4FBBAD5CF2B2527B8E983BB31A2FADEC7523 +Digest: 424A86D746C87C85DABD1DAE298A488E4CA2183DE692D1D01C4B7994EE5124F9004BEA84933C311CC38EA6F604A7769EE178E1EC160A9891C42C462A13A62286 +Test: Verify +Message: 76EECF956A52649F877528146DE33DF249CD800E21830F65E90F0F25CA9D6540FDE40603230ECA6760F1139C7F268DEBA2060631EEA92B1FFF05F93FD5572FBE29579ECD48BC3A8D6C2EB4A6B26E38D6C5FBF2C08044AEEA470A8F2F26 +Digest: A9403C26A96DE2C3D359EE29F3FD1C581154852D19AD12884B79E7082D2DA22EC83553BABA2BDFF2A2FA15947A8E6ACD5F5D113EC091BFD1962A0A10401D2C98 +Test: Verify +Message: 7ADC0B6693E61C269F278E6944A5A2D8300981E40022F839AC644387BFAC9086650085C2CDC585FEA47B9D2E52D65A2B29A7DC370401EF5D60DD0D21F9E2B90FAE919319B14B8C5565B0423CEFB827D5F1203302A9D01523498A4DB10374 +Digest: 3D23632EE4C2D4F4118A02A677B5A32427C72BA54899BA2E6CCD22EC3DEFE0FCB052E3F83D35786CEA2080EED148A0A94628E735202E6B2809994C5F5BDAFDD6 +Test: Verify +Message: E1FFFA9826CCE8B86BCCEFB8794E48C46CDF372013F782ECED1E378269B7BE2B7BF51374092261AE120E822BE685F2E7A83664BCFBE38FE8633F24E633FFE1988E1BC5ACF59A587079A57A910BDA60060E85B5F5B6F776F0529639D9CCE4BD +Digest: D8FA886884CE577A7282DECEACF4786E7C68FC69B141137FF5DC7CB3C5F8ABC845716DD27397E8BD5CE245107A984A3F8B21F19F99ED40118621DC85303A30B4 +Test: Verify +Message: 69F9ABBA65592EE01DB4DCE52DBAB90B08FC04193602792EE4DAA263033D59081587B09BBE49D0B49C9825D22840B2FF5D9C5155F975F8F2C2E7A90C75D2E4A8040FE39F63BBAFB403D9E28CC3B86E04E394A9C9E8065BD3C85FA9F0C7891600 +Digest: C768CD313602FABB2193F9EDBF667B4CDABD57D5FF60BDC22BA7BAD5319EA04E7CBEC5D4B4C4560AD52609FDD22750B618951796376ED41B2A8EAFFDD9927722 +Test: Verify +Message: 38A10A352CA5AEDFA8E19C64787D8E9C3A75DBF3B8674BFAB29B5DBFC15A63D10FAE66CD1A6E6D2452D557967EAAD89A4C98449787B0B3164CA5B717A93F24EB0B506CEB70CBBCB8D72B2A72993F909AAD92F044E0B5A2C9AC9CB16A0CA2F81F49 +Digest: 8562CE9399806623B2695712266AF3D4C14F77D2449143379246962C22398C813544A7DEE4C4847F09D3CBE437349B7FC6738AC97075B5DD9E2ADD6ECAA610F4 +Test: Verify +Message: 6D8C6E449BC13634F115749C248C17CD148B72157A2C37BF8969EA83B4D6BA8C0EE2711C28EE11495F43049596520CE436004B026B6C1F7292B9C436B055CBB72D530D860D1276A1502A5140E3C3F54A93663E4D20EDEC32D284E25564F624955B52 +Digest: 99ADE7B13E8E79AEA6ED01A25E10E401CD1D055884575EAB3E66B2294F03F8D5DBF72AB1AE39103189383EBFD2E43258510C124A894A793B206FAC752C035789 +Test: Verify +Message: 6EFCBCAF451C129DBE00B9CEF0C3749D3EE9D41C7BD500ADE40CDC65DEDBBBADB885A5B14B32A0C0D087825201E303288A733842FA7E599C0C514E078F05C821C7A4498B01C40032E9F1872A1C925FA17CE253E8935E4C3C71282242CB716B2089CCC1 +Digest: D12831BA39DBCD41F56BC7FC071BDAABFB6E7572D08B2FDA3BDDFC6FA5662F4BDBFA431CA2E38B18172709072E50120DB6BE93E86CB4ACE3C11DD0E1F3F5C712 +Test: Verify +Message: 433C5303131624C0021D868A30825475E8D0BD3052A022180398F4CA4423B98214B6BEAAC21C8807A2C33F8C93BD42B092CC1B06CEDF3224D5ED1EC29784444F22E08A55AA58542B524B02CD3D5D5F6907AFE71C5D7462224A3F9D9E53E7E0846DCBB4CE +Digest: 527D28E341E6B14F4684ADB4B824C496C6482E51149565D3D17226828884306B51D6148A72622C2B75F5D3510B799D8BDC03EAEDE453676A6EC8FE03A1AD0EAB +Test: Verify +Message: A873E0C67CA639026B6683008F7AA6324D4979550E9BCE064CA1E1FB97A30B147A24F3F666C0A72D71348EDE701CF2D17E2253C34D1EC3B647DBCEF2F879F4EB881C4830B791378C901EB725EA5C172316C6D606E0AF7DF4DF7F76E490CD30B2BADF45685F +Digest: CACDCF8BF855040E9795C422069D8E37B6286066A2197A320BD934061F66995227BE6B85FD928B834D3CA45E1AC3844D9DC66D61581E7799CCFDE008639AB3DD +Test: Verify +Message: 006917B64F9DCDF1D2D87C8A6173B64F6587168E80FAA80F82D84F60301E561E312D9FBCE62F39A6FB476E01E925F26BCC91DE621449BE6504C504830AAE394096C8FC7694651051365D4EE9070101EC9B68086F2EA8F8AB7B811EA8AD934D5C9B62C60A4771 +Digest: F454A953501E191A12A80C7A5398F081CEF738E25D48B076A52F77FB09EF0BC2325116020BB06C2C585DA9F115BD9D8F13B50E8E1FB1664450FAE690B7783400 +Test: Verify +Message: F13C972C52CB3CC4A4DF28C97F2DF11CE089B815466BE88863243EB318C2ADB1A417CB1041308598541720197B9B1CB5BA2318BD5574D1DF2174AF14884149BA9B2F446D609DF240CE335599957B8EC80876D9A085AE084907BC5961B20BF5F6CA58D5DAB38ADB +Digest: 5F968CC6ECF71C588A3C3BA68858BBFF96861F66C0733FD61FA91A479A49618DF22D9490219DF8008DC78840AE022C5D41AF2B890D0214E562DA8DF0CB3F8522 +Test: Verify +Message: E35780EB9799AD4C77535D4DDB683CF33EF367715327CF4C4A58ED9CBDCDD486F669F80189D549A9364FA82A51A52654EC721BB3AAB95DCEB4A86A6AFA93826DB923517E928F33E3FBA850D45660EF83B9876ACCAFA2A9987A254B137C6E140A21691E1069413848 +Digest: E7149461F9CD00B71C216C50041B3EDA9707D7360D4C21740C44C212256A31DA398FE09708E450EA4E2826B7EC20BEF76CD2FBD9D096AF6F77F84ABC2E4FB093 +Test: Verify +Message: 64EC021C9585E01FFE6D31BB50D44C79B6993D72678163DB474947A053674619D158016ADB243F5C8D50AA92F50AB36E579FF2DABB780A2B529370DAA299207CFBCDD3A9A25006D19C4F1FE33E4B1EAEC315D8C6EE1E730623FD1941875B924EB57D6D0C2EDC4E78D6 +Digest: 77097413CAA5A2D38259D47EC078871FA09EE5614D4C14FEB7A95C921C0AAE93B8737A6DC89E57693BE8A0710206664B80B657A1079605A0FF9664BBCB0722D6 +Test: Verify +Message: 5954BAB512CF327D66B5D9F296180080402624AD7628506B555EEA8382562324CF452FBA4A2130DE3E165D11831A270D9CB97CE8C2D32A96F50D71600BB4CA268CF98E90D6496B0A6619A5A8C63DB6D8A0634DFC6C7EC8EA9C006B6C456F1B20CD19E781AF20454AC880 +Digest: 55D8E5202360D7D5841419362F864CC900E11C582FD0CAB2FF5F1680F6CE927B5379E27A335EBAFE1286B9D4A172AB761A36EADE60F10468EAC4CEAFBF63C7CC +Test: Verify +Message: 03D9F92B2C565709A568724A0AFF90F8F347F43B02338F94A03ED32E6F33666FF5802DA4C81BDCE0D0E86C04AFD4EDC2FC8B4141C2975B6F07639B1994C973D9A9AFCE3D9D365862003498513BFA166D2629E314D97441667B007414E739D7FEBF0FE3C32C17AA188A8683 +Digest: EFFB03B497ADD6230A0ED99122EA868138644AB81E861491E526FAE37C39872CA731804A0004599849478A787BC7FCE21903ED551D7DB881D2A2C367B6168547 +Test: Verify +Message: F31E8B4F9E0621D531D22A380BE5D9ABD56FAEC53CBD39B1FAB230EA67184440E5B1D15457BD25F56204FA917FA48E669016CB48C1FFC1E1E45274B3B47379E00A43843CF8601A5551411EC12503E5AAC43D8676A1B2297EC7A0800DBFEE04292E937F21C005F17411473041 +Digest: A2269A6EF2EA8F1CF8BC3394D27657B0DB996C55E7C47784C0B451202FC5279679D79E06F8DBAA9A63665FD0E914D13C6E056EA006DAAF4CB61D2629468E3D25 +Test: Verify +Message: 758EA3FEA738973DB0B8BE7E599BBEF4519373D6E6DCD7195EA885FC991D896762992759C2A09002912FB08E0CB5B76F49162AEB8CF87B172CF3AD190253DF612F77B1F0C532E3B5FC99C2D31F8F65011695A087A35EE4EEE5E334C369D8EE5D29F695815D866DA99DF3F79403 +Digest: 5A2970D5EC346A8E4E1D5D1E57DC22F6875DDF1CE3626B49A91109E0DE991033E932F883B6A795016D5014E268304ABE2F7577505AAB00956911781F075D113A +Test: Verify +Message: 47C6E0C2B74948465921868804F0F7BD50DD323583DC784F998A93CD1CA4C6EF84D41DC81C2C40F34B5BEE6A93867B3BDBA0052C5F59E6F3657918C382E771D33109122CC8BB0E1E53C4E3D13B43CE44970F5E0C079D2AD7D7A3549CD75760C21BB15B447589E86E8D76B1E9CED2 +Digest: 2B4356A64DF31936B27F4530F076EE73E71E4E48ABDE04FF1F548E0727F4A5810B71874187FD96ED510D0D6886AF11960A0B3BAD1EE75DDA4CDC148E162EDAE9 +Test: Verify +Message: F690A132AB46B28EDFA6479283D6444E371C6459108AFD9C35DBD235E0B6B6FF4C4EA58E7554BD002460433B2164CA51E868F7947D7D7A0D792E4ABF0BE5F450853CC40D85485B2B8857EA31B5EA6E4CCFA2F3A7EF3380066D7D8979FDAC618AAD3D7E886DEA4F005AE4AD05E5065F +Digest: EDCB59984267BB00402A78F2CA345EF2494956172E10927EE63AFF23D0C834BCA50C47CDBFFD8995036307E9ED4B143E853450367D0E14AFC8490073653CD850 +Test: Verify +Message: 58D6A99BC6458824B256916770A8417040721CCCFD4B79EACD8B65A3767CE5BA7E74104C985AC56B8CC9AEBD16FEBD4CDA5ADB130B0FF2329CC8D611EB14DAC268A2F9E633C99DE33997FEA41C52A7C5E1317D5B5DAED35EBA7D5A60E45D1FA7EAABC35F5C2B0A0F2379231953322C4E +Digest: D0B453FBE709C69125DC8FE9E8AE9245211612970373B454F8656A755E8435B321DD3A980FA28719641747E254DC42C9BF012B4D6DBD7ED13020A83B44C504AA +Test: Verify +Message: BEFAB574396D7F8B6705E2D5B58B2C1C820BB24E3F4BAE3E8FBCD36DBF734EE14E5D6AB972AEDD3540235466E825850EE4C512EA9795ABFD33F330D9FD7F79E62BBB63A6EA85DE15BEAEEA6F8D204A28956059E2632D11861DFB0E65BC07AC8A159388D5C3277E227286F65FF5E5B5AEC1 +Digest: FE97C011E525110E03149FAC4179891AFCB6304E1CFD9D84CB7389755554EE723571D76B80B9333A695884192340B3FE022D4A233B7AA8E8C7686745CFE75E67 +Test: Verify +Message: 8E58144FA9179D686478622CE450C748260C95D1BA43B8F9B59ABECA8D93488DA73463EF40198B4D16FB0B0707201347E0506FF19D01BEA0F42B8AF9E71A1F1BD168781069D4D338FDEF00BF419FBB003031DF671F4A37979564F69282DE9C65407847DD0DA505AB1641C02DEA4F0D834986 +Digest: 1BC4AC8D979CA62A7FC81C710CEDF65AF56C9B652EEC356AA92DA924D370FDEBDF076F91BA4FE1EC5CD78FC4C8885EA4304BA2E8E64944AB4BF4D1B3D7DEE745 +Test: Verify +Message: B55C10EAE0EC684C16D13463F29291BF26C82E2FA0422A99C71DB4AF14DD9C7F33EDA52FD73D017CC0F2DBE734D831F0D820D06D5F89DACC485739144F8CFD4799223B1AFF9031A105CB6A029BA71E6E5867D85A554991C38DF3C9EF8C1E1E9A7630BE61CAABCA69280C399C1FB7A12D12AEFC +Digest: 76E970E9449D868067CD23B1A202CBDC99693FF6FA74BA644EC41CBF8FD139CB0F5D1106FCD6C871C315FF41C3EAF99C636288F0FCF6A40B480CB881D87E098F +Test: Verify +Message: 2EEEA693F585F4ED6F6F8865BBAE47A6908AECD7C429E4BEC4F0DE1D0CA0183FA201A0CB14A529B7D7AC0E6FF6607A3243EE9FB11BCF3E2304FE75FFCDDD6C5C2E2A4CD45F63C962D010645058D36571404A6D2B4F44755434D76998E83409C3205AA1615DB44057DB991231D2CB42624574F545 +Digest: 871666B230C5AD75B96D63BE22870621C68FD0899655BA7DC0E0E5299915AF252C226DD7217601D3A6880D55EE5A20B10820E21C74F730EEA9D47FE26DEBE006 +Test: Verify +Message: DAB11DC0B047DB0420A585F56C42D93175562852428499F66A0DB811FCDDDAB2F7CDFFED1543E5FB72110B64686BC7B6887A538AD44C050F1E42631BC4EC8A9F2A047163D822A38989EE4AAB01B4C1F161B062D873B1CFA388FD301514F62224157B9BEF423C7783B7AAC8D30D65CD1BBA8D689C2D +Digest: 7E3EF62552B28A2B18A71CEEF2DD8659C8BDF291385AD02FED353775E01594F27CC28CC78663E17CB8B39FD4EA48D494AD0BD7AEE9277EC9B21E46523812736E +Test: Verify +Message: 42E99A2F80AEE0E001279A2434F731E01D34A44B1A8101726921C0590C30F3120EB83059F325E894A5AC959DCA71CE2214799916424E859D27D789437B9D27240BF8C35ADBAFCECC322B48AA205B293962D858652ABACBD588BCF6CBC388D0993BD622F96ED54614C25B6A9AA527589EAAFFCF17DDF7 +Digest: 0B87F6EBAA293FF79C873820846C0FCC943E3A83BD8111931FF03FF3B0BF785C961CA84CF3FD40E0D831DBAEA595498FC12DA88CC507DE720A35C01D73FC9595 +Test: Verify +Message: 3C9B46450C0F2CAE8E3823F8BDB4277F31B744CE2EB17054BDDC6DFF36AF7F49FB8A2320CC3BDF8E0A2EA29AD3A55DE1165D219ADEDDB5175253E2D1489E9B6FDD02E2C3D3A4B54D60E3A47334C37913C5695378A669E9B72DEC32AF5434F93F46176EBF044C4784467C700470D0C0B40C8A088C815816 +Digest: 681BABBD2E351501C285812E06F20940FD865516CF028B4787D1FFCCD0D537705E8E9B73C608D5A8DC4F08EEE0902AC12936DDB8C7B29228C6AAF8D0B909C30D +Test: Verify +Message: D1E654B77CB155F5C77971A64DF9E5D34C26A3CAD6C7F6B300D39DEB1910094691ADAA095BE4BA5D86690A976428635D5526F3E946F7DC3BD4DBC78999E653441187A81F9ADCD5A3C5F254BC8256B0158F54673DCC1232F6E918EBFC6C51CE67EAEB042D9F57EEC4BFE910E169AF78B3DE48D137DF4F2840 +Digest: C46D2262F186421D07FD740F922306D99B1E3826F6A32486BE5A91DC298F177F50915E17EB4EA2E45494C501736CEFB0E22ACD989DA41AC7BB7BE56B04BFB5E1 +Test: Verify +Message: 626F68C18A69A6590159A9C46BE03D5965698F2DAC3DE779B878B3D9C421E0F21B955A16C715C1EC1E22CE3EB645B8B4F263F60660EA3028981EEBD6C8C3A367285B691C8EE56944A7CD1217997E1D9C21620B536BDBD5DE8925FF71DEC6FBC06624AB6B21E329813DE90D1E572DFB89A18120C3F606355D25 +Digest: 0B3DBC770332823E686470D842104D3B3C1452F64F1BCC71C5F3FAD1C0D93F21EFBD48D73C7D4909227B06B06D54057A74E03C36D9C106EBA79411F1E6E1CFFE +Test: Verify +Message: 651A6FB3C4B80C7C68C6011675E6094EB56ABF5FC3057324EBC6477825061F9F27E7A94633ABD1FA598A746E4A577CAF524C52EC1788471F92B8C37F23795CA19D559D446CAB16CBCDCE90B79FA1026CEE77BF4AB1B503C5B94C2256AD75B3EAC6FD5DCB96ACA4B03A834BFB4E9AF988CECBF2AE597CB9097940 +Digest: CA46276B0DC2EC4424BB7136EAE1AF207BD6E5CD833691C7D37B2CAEAF4F484B96A3476FC25FEB206AD37CF975383DD522CA0CC6200A3867FEE7F178D6953FEF +Test: Verify +Message: 8AAF072FCE8A2D96BC10B3C91C809EE93072FB205CA7F10ABD82ECD82CF040B1BC49EA13D1857815C0E99781DE3ADBB5443CE1C897E55188CEAF221AA9681638DE05AE1B322938F46BCE51543B57ECDB4C266272259D1798DE13BE90E10EFEC2D07484D9B21A3870E2AA9E06C21AA2D0C9CF420080A80A91DEE16F +Digest: 815B44668BF3751A3392940FCA54C1E3E4EF5227B052332AFE6EB7A10AC8AD6438CE8A0277AA14BCC41590F6D6A10B6B1BABE6BB4F8D777EA576D634B0BE41C0 +Test: Verify +Message: 53F918FD00B1701BD504F8CDEA803ACCA21AC18C564AB90C2A17DA592C7D69688F6580575395551E8CD33E0FEF08CA6ED4588D4D140B3E44C032355DF1C531564D7F4835753344345A6781E11CD5E095B73DF5F82C8AE3AD00877936896671E947CC52E2B29DCD463D90A0C9929128DA222B5A211450BBC0E02448E2 +Digest: F47799A8547FC9C07D0F808029E7335607D72224BE286E118657BD13A2C51D0374426D9EEB7693BDE5EC6181574C1404DF29BF96941862BA1A0A9A5903319498 +Test: Verify +Message: A64599B8A61B5CCEC9E67AED69447459C8DA3D1EC6C7C7C82A7428B9B584FA67E90F68E2C00FBBED4613666E5168DA4A16F395F7A3C3832B3B134BFC9CBAA95D2A0FE252F44AC6681EB6D40AB91C1D0282FED6701C57463D3C5F2BB8C6A7301FB4576AA3B5F15510DB8956FF77478C26A7C09BEA7B398CFC83503F538E +Digest: 8A0AE12A9E797FB7BD46CBB910076A32873BFFCB9AD98B4FC37316AED681EC49C65ABBB9586405FF96CC80DA4BB8FA73BE1BA9E737595B2307CF369D61BAF59C +Test: Verify +Message: 0E3AB0E054739B00CDB6A87BD12CAE024B54CB5E550E6C425360C2E87E59401F5EC24EF0314855F0F56C47695D56A7FB1417693AF2A1ED5291F2FEE95F75EED54A1B1C2E81226FBFF6F63ADE584911C71967A8EB70933BC3F5D15BC91B5C2644D9516D3C3A8C154EE48E118BD1442C043C7A0DBA5AC5B1D5360AAE5B9065 +Digest: A3C6D58872BAFDEDFDD50C0309089240D6977D4D3D59FB3F2BE133C57D2DFCFCC7C027296F74FE58B2A9A6CB7E5D70088934D051CBA57001FE27965CFA071A6F +Test: Verify +Message: A62FC595B4096E6336E53FCDFC8D1CC175D71DAC9D750A6133D23199EAAC288207944CEA6B16D27631915B4619F743DA2E30A0C00BBDB1BBB35AB852EF3B9AEC6B0A8DCC6E9E1ABAA3AD62AC0A6C5DE765DE2C3711B769E3FDE44A74016FFF82AC46FA8F1797D3B2A726B696E3DEA5530439ACEE3A45C2A51BC32DD055650B +Digest: 11E0E521B55F02BEFC7207C06444FCC0C16DCF6F34962921B709A322F35E2193477B0DFA21F213F209705FF3958531A75D94346075FEB29A288B62E2315AE270 +Test: Verify +Message: 2B6DB7CED8665EBE9DEB080295218426BDAA7C6DA9ADD2088932CDFFBAA1C14129BCCDD70F369EFB149285858D2B1D155D14DE2FDB680A8B027284055182A0CAE275234CC9C92863C1B4AB66F304CF0621CD54565F5BFF461D3B461BD40DF28198E3732501B4860EADD503D26D6E69338F4E0456E9E9BAF3D827AE685FB1D817 +Digest: AEBBA57C8ED5AF6EC93F4AA45772FF5167B7EA88DFA71364F37D8FC5FDB7DC3B2C8331A08023F21D110B7D821E2DC7E860826235E7E6291912AC521384747354 +Test: Verify +Message: 10DB509B2CDCABA6C062AE33BE48116A29EB18E390E1BBADA5CA0A2718AFBCD23431440106594893043CC7F2625281BF7DE2655880966A23705F0C5155C2F5CCA9F2C2142E96D0A2E763B70686CD421B5DB812DACED0C6D65035FDE558E94F26B3E6DDE5BD13980CC80292B723013BD033284584BFF27657871B0CF07A849F4AE2 +Digest: 2DF1E09540B53A17222DAB66275CEBECEB1F8A5DB26B0C41F955FA0549F3367E82299E0CD673958AF7DFA04D741AA63BA2C1AD351764DC9228D215F22C24CA58 +Test: Verify +Message: 9334DE60C997BDA6086101A6314F64E4458F5FF9450C509DF006E8C547983C651CA97879175AABA0C539E82D05C1E02C480975CBB30118121061B1EBAC4F8D9A3781E2DB6B18042E01ECF9017A64A0E57447EC7FCBE6A7F82585F7403EE2223D52D37B4BF426428613D6B4257980972A0ACAB508A7620C1CB28EB4E9D30FC41361EC +Digest: 8299CFCEA5F00C93A5EB8A84A13628A68B26796D53FB6A986C95B0B1C248920FB946D8AF98343D14EFC74A4611C53CCC27C5F14C7237AF28364346CA5CD70D1A +Test: Verify +Message: E88AB086891693AA535CEB20E64C7AB97C7DD3548F3786339897A5F0C39031549CA870166E477743CCFBE016B4428D89738E426F5FFE81626137F17AECFF61B72DBEE2DC20961880CFE281DFAB5EE38B1921881450E16032DE5E4D55AD8D4FCA609721B0692BAC79BE5A06E177FE8C80C0C83519FB3347DE9F43D5561CB8107B9B5EDC +Digest: AF57BEA357FCBA0579C4204C0F8DFF181BC8A473014BAE78DF76069DE478B2F2A390327A65BDD24BE926551C78F70B0D5F1C8F4B970997D557F06336A315A749 +Test: Verify +Message: FD19E01A83EB6EC810B94582CB8FBFA2FCB992B53684FB748D2264F020D3B960CB1D6B8C348C2B54A9FCEA72330C2AAA9A24ECDB00C436ABC702361A82BB8828B85369B8C72ECE0082FE06557163899C2A0EFA466C33C04343A839417057399A63A3929BE1EE4805D6CE3E5D0D0967FE9004696A5663F4CAC9179006A2CEB75542D75D68 +Digest: B299E421061EF26C32BB4F50EE669D05FEB2CCBA3297289C30E6434057B3EA7F617BBBF7A5555328FC291F794987577F458350DF99AF3A5778300BE0BD80164F +Test: Verify +Message: 59AE20B6F7E0B3C7A989AFB28324A40FCA25D8651CF1F46AE383EF6D8441587AA1C04C3E3BF88E8131CE6145CFB8973D961E8432B202FA5AF3E09D625FAAD825BC19DA9B5C6C20D02ABDA2FCC58B5BD3FE507BF201263F30543819510C12BC23E2DDB4F711D087A86EDB1B355313363A2DE996B891025E147036087401CCF3CA7815BF3C49 +Digest: CBDFB0D0E720F87259DD0D0B4E9C5319E7F88AAEF7F7AB2FA1CA639AFA0160822F96B3C357A4894CE53CD713FAB23AD052E8565FA3B3A523CB9CE39A6BD535CC +Test: Verify +Message: 77EE804B9F3295AB2362798B72B0A1B2D3291DCEB8139896355830F34B3B328561531F8079B79A6E9980705150866402FDC176C05897E359A6CB1A7AB067383EB497182A7E5AEF7038E4C96D133B2782917417E391535B5E1B51F47D8ED7E4D4025FE98DC87B9C1622614BFF3D1029E68E372DE719803857CA52067CDDAAD958951CB2068CC6 +Digest: 059A181C83A22BFF0AA9BAA22D872BDF23CBE341032CF0BF57997A4A1924D24FBAE9DCA14B6D290692B6A6B6344CBE531734F58AD0224C6E39BD1E87F870AAD6 +Test: Verify +Message: B771D5CEF5D1A41A93D15643D7181D2A2EF0A8E84D91812F20ED21F147BEF732BF3A60EF4067C3734B85BC8CD471780F10DC9E8291B58339A677B960218F71E793F2797AEA349406512829065D37BB55EA796FA4F56FD8896B49B2CD19B43215AD967C712B24E5032D065232E02C127409D2ED4146B9D75D763D52DB98D949D3B0FED6A8052FBB +Digest: 9EDEEB10EE1B7BB8F16A280D8CC3EDA5E909C554419DDC523B69ECEDF2ADF3B3C9BC66FEF365342471C458126F083A3B8E7C0C9D9D77E9F90196B71F9AADF492 +Test: Verify +Message: B32D95B0B9AAD2A8816DE6D06D1F86008505BD8C14124F6E9A163B5A2ADE55F835D0EC3880EF50700D3B25E42CC0AF050CCD1BE5E555B23087E04D7BF9813622780C7313A1954F8740B6EE2D3F71F768DD417F520482BD3A08D4F222B4EE9DBD015447B33507DD50F3AB4247C5DE9A8ABD62A8DECEA01E3B87C8B927F5B08BEB37674C6F8E380C04 +Digest: A6054FFC3D81591BE964C4B004A3A21142365B59EE98B2873D488293F93A8D7154BF72100012C60D3C9418F6AF8EA66372CB4703F5F6381DE6D4B9B98CFF1E90 +Test: Verify +Message: 04410E31082A47584B406F051398A6ABE74E4DA59BB6F85E6B49E8A1F7F2CA00DFBA5462C2CD2BFDE8B64FB21D70C083F11318B56A52D03B81CAC5EEC29EB31BD0078B6156786DA3D6D8C33098C5C47BB67AC64DB14165AF65B44544D806DDE5F487D5373C7F9792C299E9686B7E5821E7C8E2458315B996B5677D926DAC57B3F22DA873C601016A0D +Digest: B0E54A12FDBA0738898F1BBF0BA81F81DE77648D8D14C20BDD5D90F300D382E069F5DBA7EEC6B23168B008B9F39C2B93FD742A5902A5E02728F57712D6A61D4E +Test: Verify +Message: 8B81E9BADDE026F14D95C019977024C9E13DB7A5CD21F9E9FC491D716164BBACDC7060D882615D411438AEA056C340CDF977788F6E17D118DE55026855F93270472D1FD18B9E7E812BAE107E0DFDE7063301B71F6CFE4E225CAB3B232905A56E994F08EE2891BA922D49C3DAFEB75F7C69750CB67D822C96176C46BD8A29F1701373FB09A1A6E3C7158F +Digest: 3CE96077EB17C6A9C95A9A477748876C6451098DBEA2B3261E6D75B64A988E1C75D7EAC73BC2402AFC726543E2A5BDB76689C0931FF762818DD2D3FE57A50FA9 +Test: Verify +Message: FA6EED24DA6666A22208146B19A532C2EC9BA94F09F1DEF1E7FC13C399A48E41ACC2A589D099276296348F396253B57CB0E40291BD282773656B6E0D8BEA1CDA084A3738816A840485FCF3FB307F777FA5FEAC48695C2AF4769720258C77943FB4556C362D9CBA8BF103AEB9034BAA8EA8BFB9C4F8E6742CE0D52C49EA8E974F339612E830E9E7A9C29065 +Digest: C9ACD6D98A349512B952D151ED501562F04EA4BB4B8965812510B9B842531A2B41A0108AC129CF9C9517BE790921DF64AD1DFC0B93DDBA3415EEBAF0DA72F6A0 +Test: Verify +Message: 9BB4AF1B4F09C071CE3CAFA92E4EB73CE8A6F5D82A85733440368DEE4EB1CBC7B55AC150773B6FE47DBE036C45582ED67E23F4C74585DAB509DF1B83610564545642B2B1EC463E18048FC23477C6B2AA035594ECD33791AF6AF4CBC2A1166ABA8D628C57E707F0B0E8707CAF91CD44BDB915E0296E0190D56D33D8DDE10B5B60377838973C1D943C22ED335E +Digest: 26B4E5C4FA85CB33359450E7F7158FB6A0739984565E9D9EBE6AD65B118296E9C1098C11541C871EB1B89853F1FA73AD8702EBF4FC9BE4D0AB057E4391DF964E +Test: Verify +Message: 2167F02118CC62043E9091A647CADBED95611A521FE0D64E8518F16C808AB297725598AE296880A773607A798F7C3CFCE80D251EBEC6885015F9ABF7EAABAE46798F82CB5926DE5C23F44A3F9F9534B3C6F405B5364C2F8A8BDC5CA49C749BED8CE4BA48897062AE8424CA6DDE5F55C0E42A95D1E292CA54FB46A84FBC9CD87F2D0C9E7448DE3043AE22FDD229 +Digest: 913BBA5C0C13CC49D8310014CF5AF1B63BA3D5DB8A27699FCFC573688F0E826FB5A7B5D10D3A1DE693AA66E08C0915E7278F61B5FA30F1263B134F016F74841F +Test: Verify +Message: 94B7FA0BC1C44E949B1D7617D31B4720CBE7CA57C6FA4F4094D4761567E389ECC64F6968E4064DF70DF836A47D0C713336B5028B35930D29EB7A7F9A5AF9AD5CF441745BAEC9BB014CEEFF5A41BA5C1CE085FEB980BAB9CF79F2158E03EF7E63E29C38D7816A84D4F71E0F548B7FC316085AE38A060FF9B8DEC36F91AD9EBC0A5B6C338CBB8F6659D342A24368CF +Digest: E5D53E81866283179012D9239340B0CBFB8D7AEBCE0C824DC6653A652BB1B54E0883991BE2C3E39AD111A7B24E95DAF6F7D9A379D884D64F9C2AFD645E1DB5E2 +Test: Verify +Message: EA40E83CB18B3A242C1ECC6CCD0B7853A439DAB2C569CFC6DC38A19F5C90ACBF76AEF9EA3742FF3B54EF7D36EB7CE4FF1C9AB3BC119CFF6BE93C03E208783335C0AB8137BE5B10CDC66FF3F89A1BDDC6A1EED74F504CBE7290690BB295A872B9E3FE2CEE9E6C67C41DB8EFD7D863CF10F840FE618E7936DA3DCA5CA6DF933F24F6954BA0801A1294CD8D7E66DFAFEC +Digest: 5DA83B7E221933CD67FA2AF8C9934DB74CE822212C99E0EE01F5220B4FE1E9B0388E42E328A1D174E6368F5773853042543A9B493A94B625980B73DF3F3FCCBB +Test: Verify +Message: 157D5B7E4507F66D9A267476D33831E7BB768D4D04CC3438DA12F9010263EA5FCAFBDE2579DB2F6B58F911D593D5F79FB05FE3596E3FA80FF2F761D1B0E57080055C118C53E53CDB63055261D7C9B2B39BD90ACC32520CBBDBDA2C4FD8856DBCEE173132A2679198DAF83007A9B5C51511AE49766C792A29520388444EBEFE28256FB33D4260439CBA73A9479EE00C63 +Digest: 72DE9184BEB5C6A37EA2C395734D0D5412991A57CFFCC13FF9B5FA0F2046EE87C61811FE8EF2470239D5066C220173DE5EBE41885ED8ACAE397FB395E6CA9AEE +Test: Verify +Message: 836B34B515476F613FE447A4E0C3F3B8F20910AC89A3977055C960D2D5D2B72BD8ACC715A9035321B86703A411DDE0466D58A59769672AA60AD587B8481DE4BBA552A1645779789501EC53D540B904821F32B0BD1855B04E4848F9F8CFE9EBD8911BE95781A759D7AD9724A7102DBE576776B7C632BC39B9B5E19057E226552A5994C1DBB3B5C7871A11F5537011044C53 +Digest: B678FA7655584970DEDBBC73A16D7840935B104D06DCB468DDD9814D6CF443FA6F9245824DBFF3AB5FFFEF24B29CB2978796F37E7B49B1682D59F79E3C169E81 +Test: Verify +Message: CC7784A4912A7AB5AD3620AAB29BA87077CD3CB83636ADC9F3DC94F51EDF521B2161EF108F21A0A298557981C0E53CE6CED45BDF782C1EF200D29BAB81DD6460586964EDAB7CEBDBBEC75FD7925060F7DA2B853B2B089588FA0F8C16EC6498B14C55DCEE335CB3A91D698E4D393AB8E8EAC0825F8ADEBEEE196DF41205C011674E53426CAA453F8DE1CBB57932B0B741D4C6 +Digest: 66C64D5B0585DD8C40BECD456E4B0188061AE8059F03E79FE04C40925442BA93B052F52087B30BDBFD4816BBD148696D4FA6C61F216253D7AC178B39EC44C770 +Test: Verify +Message: 7639B461FFF270B2455AC1D1AFCE782944AEA5E9087EB4A39EB96BB5C3BAAF0E868C8526D3404F9405E79E77BFAC5FFB89BF1957B523E17D341D7323C302EA7083872DD5E8705694ACDDA36D5A1B895AAA16ECA6104C82688532C8BFE1790B5DC9F4EC5FE95BAED37E1D287BE710431F1E5E8EE105BC42ED37D74B1E55984BF1C09FE6A1FA13EF3B96FAEAED6A2A1950A12153 +Digest: A7BD506DB9C0509AD47413AF4B0E3948B47C18278F15F5B19FBB0B76E2C1C1F19DB9438528EB6D87B0B4A509567DB39F32641E2944365780914296CF3E48CECF +Test: Verify +Message: EB6513FC61B30CFBA58D4D7E80F94D14589090CF1D80B1DF2E68088DC6104959BA0D583D585E9578AB0AEC0CF36C48435EB52ED9AB4BBCE7A5ABE679C97AE2DBE35E8CC1D45B06DDA3CF418665C57CBEE4BBB47FA4CAF78F4EE656FEC237FE4EEBBAFA206E1EF2BD0EE4AE71BD0E9B2F54F91DAADF1FEBFD7032381D636B733DCB3BF76FB14E23AFF1F68ED3DBCF75C9B99C6F26 +Digest: 2E681F9DDBD7C77EAB0D225E2AD1F72256BE239DF25933BCD6CEDD757269B35E2A5352B3298A4CDA0542FF7D3ADD2B0CF42F10FBE05A67C8763D54A78A43AEA7 +Test: Verify +Message: 1594D74BF5DDE444265D4C04DAD9721FF3E34CBF622DAF341FE16B96431F6C4DF1F760D34F296EB97D98D560AD5286FEC4DCE1724F20B54FD7DF51D4BF137ADD656C80546FB1BF516D62EE82BAA992910EF4CC18B70F3F8698276FCFB44E0EC546C2C39CFD8EE91034FF9303058B4252462F86C823EB15BF481E6B79CC3A02218595B3658E8B37382BD5048EAED5FD02C37944E73B +Digest: FD9BE24763F682043243525E5E0780534A82AD5E83B65EB4ACAF5353313A4CC7C5EEA9DA141DE570232CB4126287E5C77657CA8D6A16B5BE53F470343E722FD6 +Test: Verify +Message: 4CFA1278903026F66FEDD41374558BE1B585D03C5C55DAC94361DF286D4BD39C7CB8037ED3B267B07C346626449D0CC5B0DD2CF221F7E4C3449A4BE99985D2D5E67BFF2923357DDEAB5ABCB4619F3A3A57B2CF928A022EB27676C6CF805689004FCA4D41EA6C2D0A4789C7605F7BB838DD883B3AD3E6027E775BCF262881428099C7FFF95B14C095EA130E0B9938A5E22FC52650F591 +Digest: 14EA33BB33FDF0426E0DFB12DE1C613BA97141454C8971BCCE25C6D87A6C2403CCFAD1E8A6C15754C3CC5AC1718B7F7F1EC003C1B98D70968C5DBB95540B4A17 +Test: Verify +Message: D3E65CB92CFA79662F6AF493D696A07CCF32AAADCCEFF06E73E8D9F6F909209E66715D6E978788C49EFB9087B170ECF3AA86D2D4D1A065AE0EFC8924F365D676B3CB9E2BEC918FD96D0B43DEE83727C9A93BF56CA2B2E59ADBA85696546A815067FC7A78039629D4948D157E7B0D826D1BF8E81237BAB7321312FDAA4D521744F988DB6FDF04549D0FDCA393D639C729AF716E9C8BBA48 +Digest: 3B4B395514E0CAB04FC9F9D6C358006CE06C93831E8948FB9BD2A863F3FA064E78EB57C76DD2D058D09AB3D105C28C2DACAEBD4A473F1FA023053CC15366082F +Test: Verify +Message: 842CC583504539622D7F71E7E31863A2B885C56A0BA62DB4C2A3F2FD12E79660DC7205CA29A0DC0A87DB4DC62EE47A41DB36B9DDB3293B9AC4BAAE7DF5C6E7201E17F717AB56E12CAD476BE49608AD2D50309E7D48D2D8DE4FA58AC3CFEAFEEE48C0A9EEC88498E3EFC51F54D300D828DDDCCB9D0B06DD021A29CF5CB5B2506915BEB8A11998B8B886E0F9B7A80E97D91A7D01270F9A7717 +Digest: 2D7D28C4311E0424D71E7F9D267A2E048AA175455FCB724CF0B13DEBF448B59B0F28265B0F010F4E4F4065004904A7C2687A5A1B30AB593BC44F698DFF5DDE33 +Test: Verify +Message: 6C4B0A0719573E57248661E98FEBE326571F9A1CA813D3638531AE28B4860F23C3A3A8AC1C250034A660E2D71E16D3ACC4BF9CE215C6F15B1C0FC7E77D3D27157E66DA9CEEC9258F8F2BF9E02B4AC93793DD6E29E307EDE3695A0DF63CBDC0FC66FB770813EB149CA2A916911BEE4902C47C7802E69E405FE3C04CEB5522792A5503FA829F707272226621F7C488A7698C0D69AA561BE9F378 +Digest: CB665EC69ABD75743C8713034E9E41736F8C1CE2C77A8518E50388C411E6284D9AADCD4D3BD5A9EB74672325E41E8A67ACF380D1E8A61684F0E501F5663A031D +Test: Verify +Message: 51B7DBB7CE2FFEB427A91CCFE5218FD40F9E0B7E24756D4C47CD55606008BDC27D16400933906FD9F30EFFDD4880022D081155342AF3FB6CD53672AB7FB5B3A3BCBE47BE1FD3A2278CAE8A5FD61C1433F7D350675DD21803746CADCA574130F01200024C6340AB0CC2CF74F2234669F34E9009EF2EB94823D62B31407F4BA46F1A1EEC41641E84D77727B59E746B8A671BEF936F05BE820759FA +Digest: 4515A104FC68094D244B234D9DC06A0243B71D419D29A95C46E3CBA6F51E121ABE049B34535DB3CCBF2AD68D83FC36331F615B3E33DEB39A3381DFBCB798FE4D +Test: Verify +Message: 83599D93F5561E821BD01A472386BC2FF4EFBD4AED60D5821E84AAE74D8071029810F5E286F8F17651CD27DA07B1EB4382F754CD1C95268783AD09220F5502840370D494BEB17124220F6AFCE91EC8A0F55231F9652433E5CE3489B727716CF4AEBA7DCDA20CD29AA9A859201253F948DD94395ABA9E3852BD1D60DDA7AE5DC045B283DA006E1CBAD83CC13292A315DB5553305C628DD091146597 +Digest: CEE3E60A49F7CAED9387F3EA699524C4CCAFD37C1A7E60D2F0AB037720649F108CCE8769F70B0C5D049359EEB821022F17C4B5F646B750E3070558EC127057F1 +Test: Verify +Message: 2BE9BF526C9D5A75D565DD11EF63B979D068659C7F026C08BEA4AF161D85A462D80E45040E91F4165C074C43AC661380311A8CBED59CC8E4C4518E80CD2C78AB1CABF66BFF83EAB3A80148550307310950D034A6286C93A1ECE8929E6385C5E3BB6EA8A7C0FB6D6332E320E71CC4EB462A2A62E2BFE08F0CCAD93E61BEDB5DD0B786A728AB666F07E0576D189C92BF9FB20DCA49AC2D3956D47385E2 +Digest: E6ED6F060906D1A772F47E83907507F88A151DE401ED79ACB56BE57C2596792DC0BC5A9DC1045E37C6A31DA1C36200214E4F5698AA2754EEB2CAECFC03BEC39D +Test: Verify +Message: CA76D3A12595A817682617006848675547D3E8F50C2210F9AF906C0E7CE50B4460186FE70457A9E879E79FD4D1A688C70A347361C847BA0DD6AA52936EAF8E58A1BE2F5C1C704E20146D366AEB3853BED9DE9BEFE9569AC8AAEA37A9FB7139A1A1A7D5C748605A8DEFB297869EBEDD71D615A5DA23496D11E11ABBB126B206FA0A7797EE7DE117986012D0362DCEF775C2FE145ADA6BDA1CCB326BF644 +Digest: 9ED4EEE87F56AE2741E8E4D65623E4D1FA3AA111F64A85F66E99093BAED990FE1D788D6A4BE1A72A6615281EB45E1B6FB60AFEFDD93987F794084BDA962FAC7F +Test: Verify +Message: F76B85DC67421025D64E93096D1D712B7BAF7FB001716F02D33B2160C2C882C310EF13A576B1C2D30EF8F78EF8D2F465007109AAD93F74CB9E7D7BEF7C9590E8AF3B267C89C15DB238138C45833C98CC4A471A7802723EF4C744A853CF80A0C2568DD4ED58A2C9644806F42104CEE53628E5BDF7B63B0B338E931E31B87C24B146C6D040605567CEEF5960DF9E022CB469D4C787F4CBA3C544A1AC91F95F +Digest: 23139BDD84E9F43A6CC615F0F036199328D39807BEC9E786D4251B83B30800F9DBE8EDC0B910FCD9D9F204C2DDD4D3B92BC26A0CFAABE764BFB90A1444733CD0 +Test: Verify +Message: 25B8C9C032EA6BCD733FFC8718FBB2A503A4EA8F71DEA1176189F694304F0FF68E862A8197B839957549EF243A5279FC2646BD4C009B6D1EDEBF24738197ABB4C992F6B1DC9BA891F570879ACCD5A6B18691A93C7D0A8D38F95B639C1DAEB48C4C2F15CCF5B9D508F8333C32DE78781B41850F261B855C4BEBCC125A380C54D501C5D3BD07E6B52102116088E53D76583B0161E2A58D0778F091206AABD5A1 +Digest: EC69397000AED63CB7E86B4FB0BFD3DCEE8A6F6A1CFE01A324DA13484B73599FCD37AD392662D4C41D90BACA66BE4D6E3424EFD35D7FF4CB07CBDFBEBDDB7B50 +Test: Verify +Message: 21CFDC2A7CCB7F331B3D2EEFFF37E48AD9FA9C788C3F3C200E0173D99963E1CBCA93623B264E920394AE48BB4C3A5BB96FFBC8F0E53F30E22956ADABC2765F57FB761E147ECBF8567533DB6E50C8A1F894310A94EDF806DD8CA6A0E141C0FA7C9FAE6C6AE65F18C93A8529E6E5B553BF55F25BE2E80A9882BD37F145FECBEB3D447A3C4E46C21524CC55CDD62F521AB92A8BA72B897996C49BB273198B7B1C9E +Digest: 2EA3EA00E6E9305CED0FC160E004265221306A2BE9613474126825AA3C3170AE07E5EA42F6B74F0B2C1BD2A6CD4D26EB1E04C67C9A4AFEFC1DD0CB57C2A9F4C7 +Test: Verify +Message: 4E452BA42127DCC956EF4F8F35DD68CB225FB73B5BC7E1EC5A898BBA2931563E74FAFF3B67314F241EC49F4A7061E3BD0213AE826BAB380F1F14FAAB8B0EFDDD5FD1BB49373853A08F30553D5A55CCBBB8153DE4704F29CA2BDEEF0419468E05DD51557CCC80C0A96190BBCC4D77ECFF21C66BDF486459D427F986410F883A80A5BCC32C20F0478BB9A97A126FC5F95451E40F292A4614930D054C851ACD019CCF +Digest: 6A7ADDB28F4F2C23CF0C264579FBA5F892E010689F837B84D006D91402FBFE9BA44B9126F8B5DE1EC6BBE194A3E3854235056A09901D18E8D6F1727DD430212A +Test: Verify +Message: FA85671DF7DADF99A6FFEE97A3AB9991671F5629195049880497487867A6C446B60087FAC9A0F2FCC8E3B24E97E42345B93B5F7D3691829D3F8CCD4BB36411B85FC2328EB0C51CB3151F70860AD3246CE0623A8DC8B3C49F958F8690F8E3860E71EB2B1479A5CEA0B3F8BEFD87ACAF5362435EAECCB52F38617BC6C5C2C6E269EAD1FBD69E941D4AD2012DA2C5B21BCFBF98E4A77AB2AF1F3FDA3233F046D38F1DC8 +Digest: 2C0EE8A165BF88C44C8601C6372E522DA9ECF42544DCDC098698F50DF8E70EB7440CAB2953BB490CD2A5E0887BEEAE3482192DA95E5098D3B318F16FC08D1E1E +Test: Verify +Message: E90847AE6797FBC0B6B36D6E588C0A743D725788CA50B6D792352EA8294F5BA654A15366B8E1B288D84F5178240827975A763BC45C7B0430E8A559DF4488505E009C63DA994F1403F407958203CEBB6E37D89C94A5EACF6039A327F6C4DBBC7A2A307D976AA39E41AF6537243FC218DFA6AB4DD817B6A397DF5CA69107A9198799ED248641B63B42CB4C29BFDD7975AC96EDFC274AC562D0474C60347A078CE4C25E88 +Digest: DDD4FF117231ECA0445EADA7C7F1D84686520DAA70E160C87DBBB3FB32BB9E2F4CC53DB5413D4E88DE18A0118570318BD6D0E5264D779339AC6F4F4A95546A53 +Test: Verify +Message: F6D5C2B6C93954FC627602C00C4CA9A7D3ED12B27173F0B2C9B0E4A5939398A665E67E69D0B12FB7E4CEB253E8083D1CEB724AC07F009F094E42F2D6F2129489E846EAFF0700A8D4453EF453A3EDDC18F408C77A83275617FABC4EA3A2833AA73406C0E966276079D38E8E38539A70E194CC5513AAA457C699383FD1900B1E72BDFB835D1FD321B37BA80549B078A49EA08152869A918CA57F5B54ED71E4FD3AC5C06729 +Digest: A9744EFA42887DF292FC09DFEB885F1E801855DED09DC2F97CBFCBD019751878619DA1BC9573201C7CC050E2AA1D453E951366D81C188D329B3CB861C1D78F92 +Test: Verify +Message: CF8562B1BED89892D67DDAAF3DEEB28246456E972326DBCDB5CF3FB289ACA01E68DA5D59896E3A6165358B071B304D6AB3D018944BE5049D5E0E2BB819ACF67A6006111089E6767132D72DD85BEDDCBB2D64496DB0CC92955AB4C6234F1EEA24F2D51483F2E209E4589BF9519FAC51B4D061E801125E605F8093BB6997BC163D551596FE4AB7CFAE8FB9A90F6980480CE0C229FD1675409BD788354DAF316240CFE0AF93EB +Digest: 89CAE46246EFEDAD1147EB1868C23A6BE54F6BAC75F0C98A9AEFC6BF3CCB89AE012F2E88A9C838B55E57B232CB3C80BC3C2E9FB3FC9768C6226E93284E208BF2 +Test: Verify +Message: 2ACE31ABB0A2E3267944D2F75E1559985DB7354C6E605F18DC8470423FCA30B7331D9B33C4A4326783D1CAAE1B4F07060EFF978E4746BF0C7E30CD61040BD5EC2746B29863EB7F103EBDA614C4291A805B6A4C8214230564A0557BC7102E0BD3ED23719252F7435D64D210EE2AAFC585BE903FA41E1968C50FD5D5367926DF7A05E3A42CF07E656FF92DE73B036CF8B19898C0CB34557C0C12C2D8B84E91181AF467BC75A9D1 +Digest: E80A63FAF248AE762D13887AFE8E1954F97327EDD9641CE563F4148F9796669827B3A12B06EBD710D4171B86E21BC13360A541845354E0F4934E6FBBD7ACBF2D +Test: Verify +Message: 0D8D09AED19F1013969CE5E7EB92F83A209AE76BE31C754844EA9116CEB39A22EBB6003017BBCF26555FA6624185187DB8F0CB3564B8B1C06BF685D47F3286EDA20B83358F599D2044BBF0583FAB8D78F854FE0A596183230C5EF8E54426750EAF2CC4E29D3BDD037E734D863C2BD9789B4C243096138F7672C232314EFFDFC6513427E2DA76916B5248933BE312EB5DDE4CF70804FB258AC5FB82D58D08177AC6F4756017FFF5 +Digest: 09C10C4818A6821C170D6780D006F7E853E30FE2D9A4E96545673704EC0A1A3E356375715994E1AC1D8CB0E56DBDB2F77DC558ED228FB56EE62217E63455FD0B +Test: Verify +Message: C3236B73DEB7662BF3F3DAA58F137B358BA610560EF7455785A9BEFDB035A066E90704F929BD9689CEF0CE3BDA5ACF4480BCEB8D09D10B098AD8500D9B6071DFC3A14AF6C77511D81E3AA8844986C3BEA6F469F9E02194C92868CD5F51646256798FF0424954C1434BDFED9FACB390B07D342E992936E0F88BFD0E884A0DDB679D0547CCDEC6384285A45429D115AC7D235A717242021D1DC35641F5F0A48E8445DBA58E6CB2C8EA +Digest: D1CAB5979EB7F53C97DCA5D725D8B33008906D7759FD3EBB8401EE2FFF01DB895495A0A062D47F251BC3FC13988607C6798969D213C941EFC152E7DB1DA68E72 +Test: Verify +Message: B39FEB8283EADC63E8184B51DF5AE3FD41AAC8A963BB0BE1CD08AA5867D8D910C669221E73243360646F6553D1CA05A84E8DC0DE05B6419EC349CA994480193D01C92525F3FB3DCEFB08AFC6D26947BDBBFD85193F53B50609C6140905C53A6686B58E53A319A57B962331EDE98149AF3DE3118A819DA4D76706A0424B4E1D2910B0ED26AF61D150EBCB46595D4266A0BD7F651BA47D0C7F179CA28545007D92E8419D48FDFBD744CE +Digest: 96AD163869AE2FFDB89B96F4DC700ECE27D1F4DAAFBC5FB81A8E9513C6EA5E2B6A8BCCF4E49A294AF326F872740661629AB780581155810E492424C24F8D1DD3 +Test: Verify +Message: A983D54F503803E8C7999F4EDBBE82E9084F422143A932DDDDC47A17B0B7564A7F37A99D0786E99476428D29E29D3C197A72BFAB1342C12A0FC4787FD7017D7A6174049EA43B5779169EF7472BDBBD941DCB82FC73AAC45A8A94C9F2BD3477F61FD3B796F02A1B8264A214C6FEA74B7051B226C722099EC7883A462B83B6AFDD4009248B8A237F605FE5A08FE7D8B45321421EBBA67BD70A0B00DDBF94BAAB7F359D5D1EEA105F28DCFB +Digest: FD2E7A6E11E5D00278099EAF403054D617ACAC5BD3D0A4908191782C89F9217A3F0118BC2B284FDBCE803F66B78DD795EB18DC16BA85E19CB6393DC56C06ECCA +Test: Verify +Message: E4D1C1897A0A866CE564635B74222F9696BF2C7F640DD78D7E2ACA66E1B61C642BB03EA7536AAE597811E9BF4A7B453EDE31F97B46A5F0EF51A071A2B3918DF16B152519AE3776F9F1EDAB4C2A377C3292E96408359D3613844D5EB393000283D5AD3401A318B12FD1474B8612F2BB50FB6A8B9E023A54D7DDE28C43D6D8854C8D9D1155935C199811DBFC87E9E0072E90EB88681CC7529714F8FB8A2C9D88567ADFB974EE205A9BF7B848 +Digest: AE53776D969A9B285641998A9F2C70CA71856C956A3C430A32A1E03A8E08D544F16511A27CFA59F6B8275A2357F8EFA6544B1CD0C00A9460F47954A146429E49 +Test: Verify +Message: B10C59723E3DCADD6D75DF87D0A1580E73133A9B7D00CB95EC19F5547027323BE75158B11F80B6E142C6A78531886D9047B08E551E75E6261E79785366D7024BD7CD9CF322D9BE7D57FB661069F2481C7BB759CD71B4B36CA2BC2DF6D3A328FAEBDB995A9794A8D72155ED551A1F87C80BF6059B43FC764900B18A1C2441F7487743CF84E565F61F8DD2ECE6B6CCC9444049197AAAF53E926FBEE3BFCA8BE588EC77F29D211BE89DE18B15F6 +Digest: D4748C8E17F4117BF2BF71557ABB559247552126C36192C5DF5C6C3E307D879B703C3FCD7099DDAB243E2F1D5AE5066990A7B38D3F2CD7FB115AA6D135E7261D +Test: Verify +Message: DB11F609BABA7B0CA634926B1DD539C8CBADA24967D7ADD4D9876F77C2D80C0F4DCEFBD7121548373582705CCA2495BD2A43716FE64ED26D059CFB566B3364BD49EE0717BDD9810DD14D8FAD80DBBDC4CAFB37CC60FB0FE2A80FB4541B8CA9D59DCE457738A9D3D8F641AF8C3FD6DA162DC16FC01AAC527A4A0255B4D231C0BE50F44F0DB0B713AF03D968FE7F0F61ED0824C55C4B5265548FEBD6AAD5C5EEDF63EFE793489C39B8FD29D104CE +Digest: D8FF0481A63890F0E5A536EBBA2F253FA2CFA19C0F353587AF4BDC3190E4F8F54D17D665E8B2011121D444BFADFFF3E192D97FA03B849D63F36DB20F4CF88A74 +Test: Verify +Message: BEBD4F1A84FC8B15E4452A54BD02D69E304B7F32616AADD90537937106AE4E28DE9D8AAB02D19BC3E2FDE1D651559E296453E4DBA94370A14DBBB2D1D4E2022302EE90E208321EFCD8528AD89E46DC839EA9DF618EA8394A6BFF308E7726BAE0C19BCD4BE52DA6258E2EF4E96AA21244429F49EF5CB486D7FF35CAC1BACB7E95711944BCCB2AB34700D42D1EB38B5D536B947348A458EDE3DC6BD6EC547B1B0CAE5B257BE36A7124E1060C170FFA +Digest: 52D771B5016C6B1B93D3BF6A13F718A7B4741D528798609308B54CEA6037862D923751FDDCE10580A7D6431BF208DF17C1B825F7C7401CCBD6D806B744241ACF +Test: Verify +Message: 5ACA56A03A13784BDC3289D9364F79E2A85C12276B49B92DB0ADAA4F206D5028F213F678C3510E111F9DC4C1C1F8B6ACB17A6413AA227607C515C62A733817BA5E762CC6748E7E0D6872C984D723C9BB3B117EB8963185300A80BFA65CDE495D70A46C44858605FCCBED086C2B45CEF963D33294DBE9706B13AF22F1B7C4CD5A001CFEC251FBA18E722C6E1C4B1166918B4F6F48A98B64B3C07FC86A6B17A6D0480AB79D4E6415B520F1C484D675B1 +Digest: 36D472A8AE13D1E70E1FD275117FFE34063BEFCCF6706FAB0816E1B81F7FE7F2DDB2A122F1F52C9950644659430F81BCEDAD5D833DF4814CF60AE6C542CC4478 +Test: Verify +Message: A5AAD0E4646A32C85CFCAC73F02FC5300F1982FABB2F2179E28303E447854094CDFC854310E5C0F60993CEFF54D84D6B46323D930ADB07C17599B35B505F09E784BCA5985E0172257797FB53649E2E9723EFD16865C31B5C3D5113B58BB0BFC8920FABDDA086D7537E66D709D050BD14D0C960873F156FAD5B3D3840CDFCDC9BE6AF519DB262A27F40896AB25CC39F96984D650611C0D5A3080D5B3A1BF186ABD42956588B3B58CD948970D298776060 +Digest: E504AD7F33D65B8D3487B28805D478778C901C0AFF5F889AE95E2919B4F431A80116A8993469E822895F3C21A41D67AFDA93A5B29B6250F76335A76FE8919274 +Test: Verify +Message: 06CBBE67E94A978203EAD6C057A1A5B098478B4B4CBEF5A97E93C8E42F5572713575FC2A884531D7622F8F879387A859A80F10EF02708CD8F7413AB385AFC357678B9578C0EBF641EF076A1A30F1F75379E9DCB2A885BDD295905EE80C0168A62A9597D10CF12DD2D8CEE46645C7E5A141F6E0E23AA482ABE5661C16E69EF1E28371E2E236C359BA4E92C25626A7B7FF13F6EA4AE906E1CFE163E91719B1F750A96CBDE5FBC953D9E576CD216AFC90323A +Digest: 1DCA53BE0A34114447D1C1443B92B69DFDED705956EAE60BBAB39178CCB11F526A302AAE83720652EF4C5DD450A3647DF7B77C4664717D935B4F5B20F206FEFE +Test: Verify +Message: F1C528CF7739874707D4D8AD5B98F7C77169DE0B57188DF233B2DC8A5B31EDA5DB4291DD9F68E6BAD37B8D7F6C9C0044B3BF74BBC3D7D1798E138709B0D75E7C593D3CCCDC1B20C7174B4E692ADD820ACE262D45CCFAE2077E878796347168060A162ECCA8C38C1A88350BD63BB539134F700FD4ADDD5959E255337DAA06BC86358FABCBEFDFB5BC889783D843C08AADC6C4F6C36F65F156E851C9A0F917E4A367B5AD93D874812A1DE6A7B93CD53AD97232 +Digest: CB1B03B180E04021E0099050EB6B7EB9092C5BD5C445E9D31EE39C724F038E9F619A96D3A2812CA7F208FEB2D074C3F817262F7504705623E635B9F273E37A59 +Test: Verify +Message: 9D9F3A7ECD51B41F6572FD0D0881E30390DFB780991DAE7DB3B47619134718E6F987810E542619DFAA7B505C76B7350C6432D8BF1CFEBDF1069B90A35F0D04CBDF130B0DFC7875F4A4E62CDB8E525AADD7CE842520A482AC18F09442D78305FE85A74E39E760A4837482ED2F437DD13B2EC1042AFCF9DECDC3E877E50FF4106AD10A525230D11920324A81094DA31DEAB6476AA42F20C84843CFC1C58545EE80352BDD3740DD6A16792AE2D86F11641BB717C2 +Digest: F0482F098B93624BCDE1AAB58097198649A8DC84421826D1C1011AD41B948384C8ED5A97C64C134B38A0075812A35F9CE3CB200972C2ECDFC408714139B9BFF0 +Test: Verify +Message: 5179888724819FBAD3AFA927D3577796660E6A81C52D98E9303261D5A4A83232F6F758934D50AA83FF9E20A5926DFEBAAC49529D006EB923C5AE5048ED544EC471ED7191EDF46363383824F915769B3E688094C682B02151E5EE01E510B431C8865AFF8B6B6F2F59CB6D129DA79E97C6D2B8FA6C6DA3F603199D2D1BCAB547682A81CD6CF65F6551121391D78BCC23B5BD0E922EC6D8BF97C952E84DD28AEF909ABA31EDB903B28FBFC33B7703CD996215A11238 +Digest: A3188426CEA0C18CB638BCC45C4337C40BE41F6E03CD2D7C4FEE26025C5CA281CFBB3AD1554D45EDC2EB03E2EBE3DE02F57D36D5B6A88A3C61A6AAEDE62180D0 +Test: Verify +Message: 576EF3520D30B7A4899B8C0D5E359E45C5189ADD100E43BE429A02FB3DE5FF4F8FD0E79D9663ACCA72CD29C94582B19292A557C5B1315297D168FBB54E9E2ECD13809C2B5FCE998EDC6570545E1499DBE7FB74D47CD7F35823B212B05BF3F5A79CAA34224FDD670D335FCB106F5D92C3946F44D3AFCBAE2E41AC554D8E6759F332B76BE89A0324AA12C5482D1EA3EE89DED4936F3E3C080436F539FA137E74C6D3389BDF5A45074C47BC7B20B0948407A66D855E2F +Digest: 0B14693E6320668D64EBB3BF6EEB81AAFCDB7320ECDE80A245786D1B0A808A15C717DC8E8813BF64BF4AA57C29C33E913D6CE1879E52E1919FB83E4A208EDAA4 +Test: Verify +Message: 0DF2152FA4F4357C8741529DD77E783925D3D76E95BAFA2B542A2C33F3D1D117D159CF473F82310356FEE4C90A9E505E70F8F24859656368BA09381FA245EB6C3D763F3093F0C89B972E66B53D59406D9F01AEA07F8B3B615CAC4EE4D05F542E7D0DAB45D67CCCCD3A606CCBEB31EA1FA7005BA07176E60DAB7D78F6810EF086F42F08E595F0EC217372B98970CC6321576D92CE38F7C397A403BADA1548D205C343AC09DECA86325373C3B76D9F32028FEA8EB32515 +Digest: A9ABC3F554C1E717935D28C28E7C26AA9DC5BD6D7B02ED7DC6AFE21A0EA027A8801AE076F2872D08635EE81420711862EDC4E448C85513289438B3C8BE456B5B +Test: Verify +Message: 3E15350D87D6EBB5C8AD99D42515CFE17980933C7A8F6B8BBBF0A63728CEFAAD2052623C0BD5931839112A48633FB3C2004E0749C87A41B26A8B48945539D1FF41A4B269462FD199BFECD45374756F55A9116E92093AC99451AEFB2AF9FD32D6D7F5FBC7F7A540D5097C096EBC3B3A721541DE073A1CC02F7FB0FB1B9327FB0B1218CA49C9487AB5396622A13AE546C97ABDEF6B56380DDA7012A8384091B6656D0AB272D363CEA78163FF765CDD13AB1738B940D16CAE +Digest: 04DD83D20F58E854D857F24720C50A4B5F83DBC8CABD460D379417CD4813772AA85591B90462F34DB3FAA4DCAE335FB1252BF41162E24975A0DBD308C41A4A6B +Test: Verify +Message: C38D6B0B757CB552BE40940ECE0009EF3B0B59307C1451686F1A22702922800D58BCE7A636C1727EE547C01B214779E898FC0E560F8AE7F61BEF4D75EAA696B921FD6B735D171535E9EDD267C192B99880C87997711002009095D8A7A437E258104A41A505E5EF71E5613DDD2008195F0C574E6BA3FE40099CFA116E5F1A2FA8A6DA04BADCB4E2D5D0DE31FDC4800891C45781A0AAC7C907B56D631FCA5CE8B2CDE620D11D1777ED9FA603541DE794DDC5758FCD5FAD78C0 +Digest: CE76B25C928CB75C09C0674E8FCD22089654182CD3D84B85CC44B186A8B1A7CC1BB66F389DA6D744A24A7B02BF5C85542D1BA8EF0DB4A86D2FC394471B396519 +Test: Verify +Message: 8D2DE3F0B37A6385C90739805B170057F091CD0C7A0BC951540F26A5A75B3E694631BB64C7635EED316F51318E9D8DE13C70A2ABA04A14836855F35E480528B776D0A1E8A23B547C8B8D6A0D09B241D3BE9377160CCA4E6793D00A515DC2992CB7FC741DACA171431DA99CCE6F7789F129E2AC5CF65B40D703035CD2185BB936C82002DAF8CBC27A7A9E554B06196630446A6F0A14BA155ED26D95BD627B7205C072D02B60DB0FD7E49EA058C2E0BA202DAFF0DE91E845CF79 +Digest: 02D1671981C2E85D0455EE85F41B8E9C32B1C80221DD432B8BCB5FCEFE0996F32FE9FC3EEB3F1F557AE1632750B92D05239AF857C42D59A3DAEB9629E1158BEC +Test: Verify +Message: C464BBDAD275C50DCD983B65AD1019B9FF85A1E71C807F3204BB2C921DC31FBCD8C5FC45868AE9EF85B6C9B83BBA2A5A822201ED68586EC5EC27FB2857A5D1A2D09D09115F22DCC39FE61F5E1BA0FF6E8B4ACB4C6DA748BE7F3F0839739394FF7FA8E39F7F7E84A33C3866875C01BCB1263C9405D91908E9E0B50E7459FABB63D8C6BBB73D8E3483C099B55BC30FF092FF68B6ADEDFD477D63570C9F5515847F36E24BA0B705557130CEC57EBAD1D0B31A378E91894EE26E3A04 +Digest: 6B8BC6211FE5001E07B7D20E0C49D314211E3893A39DA241B8839BB3A494F9A2FD8561009D22CCA1330A69362B386E715F1DBE6291DBEECFADF196DA47E53198 +Test: Verify +Message: 8B8D68BB8A75732FE272815A68A1C9C5AA31B41DEDC8493E76525D1D013D33CEBD9E21A5BB95DB2616976A8C07FCF411F5F6BC6F7E0B57ACA78CC2790A6F9B898858AC9C79B165FF24E66677531E39F572BE5D81EB3264524181115F32780257BFB9AEEC6AF12AF28E587CAC068A1A2953B59AD680F4C245B2E3EC36F59940D37E1D3DB38E13EDB29B5C0F404F6FF87F80FC8BE7A225FF22FBB9C8B6B1D7330C57840D24BC75B06B80D30DAD6806544D510AF6C4785E823AC3E0B8 +Digest: D00E919DAFFF3D5E51AD3A3046F5E59D64B69CBCDA223CB28BC370201D2C722BAE74DFE0086B0EB47BDCB62FABEE870C3340D46E55D8CFEDF2DD3CED8A8DB3F2 +Test: Verify +Message: 6B018710446F368E7421F1BC0CCF562D9C1843846BC8D98D1C9BF7D9D6FCB48BFC3BF83B36D44C4FA93430AF75CD190BDE36A7F92F867F58A803900DF8018150384D85D82132F123006AC2AEBA58E02A037FE6AFBD65ECA7C44977DD3DC74F48B6E7A1BFD5CC4DCF24E4D52E92BD4455848E4928B0EAC8B7476FE3CC03E862AA4DFF4470DBFED6DE48E410F25096487ECFC32A27277F3F5023B2725ADE461B1355889554A8836C9CF53BD767F5737D55184EEA1AB3F53EDD0976C485 +Digest: CF63F28F107A509A416F9A92C4E4DB4DBF00FB52C2E16D8BB9694E09F9142A904C34E1E960BD97B8CFB2C53E7660C79B841D1565CDAB83293234026A23A56D12 +Test: Verify +Message: C9534A24714BD4BE37C88A3DA1082EDA7CABD154C309D7BD670DCCD95AA535594463058A29F79031D6ECAA9F675D1211E9359BE82669A79C855EA8D89DD38C2C761DDD0EC0CE9E97597432E9A1BEAE062CDD71EDFDFD464119BE9E69D18A7A7FD7CE0E2106F0C8B0ABF4715E2CA48EF9F454DC203C96656653B727083513F8EFB86E49C513BB758B3B052FE21F1C05BB33C37129D6CC81F1AEF6ADC45B0E8827A830FE545CF57D0955802C117D23CCB55EA28F95C0D8C2F9C5A242B33F +Digest: F21B8D45B6A857CE663C074C18CC54D914CDD5EB0D968E6153A5F70069345D205DDF4370EC473FC80B05F937D014C0A464582CB4A73B1B72041C5C99F576A41E +Test: Verify +Message: 07906C87297B867ABF4576E9F3CC7F82F22B154AFCBF293B9319F1B0584DA6A40C27B32E0B1B7F412C4F1B82480E70A9235B12EC27090A5A33175A2BB28D8ADC475CEFE33F7803F8CE27967217381F02E67A3B4F84A71F1C5228E0C2AD971373F6F672624FCEA8D1A9F85170FAD30FA0BBD25035C3B41A6175D467998BD1215F6F3866F53847F9CF68EF3E2FBB54BC994DE2302B829C5EEA68EC441FCBAFD7D16AE4FE9FFF98BF00E5BC2AD54DD91FF9FDA4DD77B6C754A91955D1FBAAD0 +Digest: 92287F42AB1A2123669C4D35F18257D3A536445F0E4D2C801E99F8529CD9E2A79205982C280C7A6CDDDEF24CE960EC6CA9A35F590AEEBC40448C389E915FC4E0 +Test: Verify +Message: 588E94B9054ABC2189DF69B8BA34341B77CDD528E7860E5DEFCAA79B0C9A452AD4B82AA306BE84536EB7CEDCBE058D7B84A6AEF826B028B8A0271B69AC3605A9635EA9F5EA0AA700F3EB7835BC54611B922964300C953EFE7491E3677C2CEBE0822E956CD16433B02C68C4A23252C3F9E151A416B4963257B783E038F6B4D5C9F110F871652C7A649A7BCEDCBCCC6F2D0725BB903CC196BA76C76AA9F10A190B1D1168993BAA9FFC96A1655216773458BEC72B0E39C9F2C121378FEAB4E76A +Digest: 74A9D8F9F72908C7502D1C41212CD86CF4344721A6F02D390346F2BAEC6E6137421E6516C3235443BC2337B3A77630712A12F11B7BA24B2D7085499BA74BCB90 +Test: Verify +Message: 08959A7E4BAAE874928813364071194E2939772F20DB7C3157078987C557C2A6D5ABE68D520EEF3DC491692E1E21BCD880ADEBF63BB4213B50897FA005256ED41B5690F78F52855C8D9168A4B666FCE2DA2B456D7A7E7C17AB5F2FB1EE90B79E698712E963715983FD07641AE4B4E9DC73203FAC1AE11FA1F8C7941FCC82EAB247ADDB56E2638447E9D609E610B60CE086656AAEBF1DA3C8A231D7D94E2FD0AFE46B391FF14A72EAEB3F44AD4DF85866DEF43D4781A0B3578BC996C87970B132 +Digest: 7432861132E6894BB6AE5115398198317E12CC73C0C5DFC61CB189FF5AA9FB0D62224CBB1BFA8B105784405718E6F8E15E041DAD80D11AE507B33C15C6CAC824 +Test: Verify +Message: CB2A234F45E2ECD5863895A451D389A369AAB99CFEF0D5C9FFCA1E6E63F763B5C14FB9B478313C8E8C0EFEB3AC9500CF5FD93791B789E67EAC12FD038E2547CC8E0FC9DB591F33A1E4907C64A922DDA23EC9827310B306098554A4A78F050262DB5B545B159E1FF1DCA6EB734B872343B842C57EAFCFDA8405EEDBB48EF32E99696D135979235C3A05364E371C2D76F1902F1D83146DF9495C0A6C57D7BF9EE77E80F9787AEE27BE1FE126CDC9EF893A4A7DCBBC367E40FE4E1EE90B42EA25AF01 +Digest: 6AF4FF4C423051E3306ACE812E5CFA85532B73DEEF0DFE601D2630632389D0FAB2A109214D32508D2391775665B87A94D1DF29DB1214CB48DEC10DBD3D8CF591 +Test: Verify +Message: D16BEADF02AB1D4DC6F88B8C4554C51E866DF830B89C06E786A5F8757E8909310AF51C840EFE8D20B35331F4355D80F73295974653DDD620CDDE4730FB6C8D0D2DCB2B45D92D4FBDB567C0A3E86BD1A8A795AF26FBF29FC6C65941CDDB090FF7CD230AC5268AB4606FCCBA9EDED0A2B5D014EE0C34F0B2881AC036E24E151BE89EEB6CD9A7A790AFCCFF234D7CB11B99EBF58CD0C589F20BDAC4F9F0E28F75E3E04E5B3DEBCE607A496D848D67FA7B49132C71B878FD5557E082A18ECA1FBDA94D4B +Digest: 4648D263B608CF28CA65B28A361EBB00E0784C65AB1D55C46A785737B6C8D83DD52E3367D898921EA36DADA42D893800D0BFCF86554CDF5E7630D60A2E8EE29F +Test: Verify +Message: 8F65F6BC59A85705016E2BAE7FE57980DE3127E5AB275F573D334F73F8603106EC3553016608EF2DD6E69B24BE0B7113BF6A760BA6E9CE1C48F9E186012CF96A1D4849D75DF5BB8315387FD78E9E153E76F8BA7EC6C8849810F59FB4BB9B004318210B37F1299526866F44059E017E22E96CBE418699D014C6EA01C9F0038B10299884DBEC3199BB05ADC94E955A1533219C1115FED0E5F21228B071F40DD57C4240D98D37B73E412FE0FA4703120D7C0C67972ED233E5DEB300A22605472FA3A3BA86 +Digest: DBD3732440010595AB26F84EFEB07732227A7B7B52D6FF339C7FF1B6442249202AE33A0AEF5167F5B0474D74A5B50CDB033D6C5C72894A3686FE6ECB36E357F3 +Test: Verify +Message: 84891E52E0D451813210C3FD635B39A03A6B7A7317B221A7ABC270DFA946C42669AACBBBDF801E1584F330E28C729847EA14152BD637B3D0F2B38B4BD5BF9C791C58806281103A3EABBAEDE5E711E539E6A8B2CF297CF351C078B4FA8F7F35CF61BEBF8814BF248A01D41E86C5715EA40C63F7375379A7EB1D78F27622FB468AB784AAABA4E534A6DFD1DF6FA15511341E725ED2E87F98737CCB7B6A6DFAE416477472B046BF1811187D151BFA9F7B2BF9ACDB23A3BE507CDF14CFDF517D2CB5FB9E4AB6 +Digest: C24D4054110889290CBC40B82AD8599229D8E86E4CE76BDDBBB6F5386223512C9D7E00973C706442B2C80EDD20904067AF8E4E681AECBFADC6AA15A2EBFE7DDD +Test: Verify +Message: FDD7A9433A3B4AFABD7A3A5E3457E56DEBF78E84B7A0B0CA0E8C6D53BD0C2DAE31B2700C6128334F43981BE3B213B1D7A118D59C7E6B6493A86F866A1635C12859CFB9AD17460A77B4522A5C1883C3D6ACC86E6162667EC414E9A104AA892053A2B1D72165A855BACD8FAF8034A5DD9B716F47A0818C09BB6BAF22AA503C06B4CA261F557761989D2AFBD88B6A678AD128AF68672107D0F1FC73C5CA740459297B3292B281E93BCEB761BDE7221C3A55708E5EC84472CDDCAA84ECF23723CC0991355C6280 +Digest: 4A6404D278A0BA70488C18D7D1861CDE26FD57D66A9AFFE74F1E646E616003A52FE42520504AC4ACE5CA6665CF9155F44ECAA05D55F80FE9794ADE17871C5728 +Test: Verify +Message: 70A40BFBEF92277A1AAD72F6B79D0177197C4EBD432668CFEC05D099ACCB651062B5DFF156C0B27336687A94B26679CFDD9DAF7AD204338DD9C4D14114033A5C225BD11F217B5F4732DA167EE3F939262D4043FC9CBA92303B7B5E96AEA12ADDA64859DF4B86E9EE0B58E39091E6B188B408AC94E1294A8911245EE361E60E601EFF58D1D37639F3753BEC80EBB4EFDE25817436076623FC65415FE51D1B0280366D12C554D86743F3C3B6572E400361A60726131441BA493A83FBE9AFDA90F7AF1AE717238D +Digest: FFFD1B1E31377DFF00B492295BCCC735733B021F47BB4AFBA6549EA6C1BA3832E8587099AD0CC216AF5899AC683EB7C246871E21C30FEEF9BCEEDFC78D0C966C +Test: Verify +Message: 74356E449F4BF8644F77B14F4D67CB6BD9C1F5AE357621D5B8147E562B65C66585CAF2E491B48529A01A34D226D436959153815380D5689E30B35357CDAC6E08D3F2B0E88E200600D62BD9F5EAF488DF86A4470EA227006182E44809009868C4C280C43D7D64A5268FA719074960087B3A6ABC837882F882C837834535929389A12B2C78187E2EA07EF8B8EEF27DC85002C3AE35F1A50BEE6A1C48BA7E175F3316670B27983472AA6A61EED0A683A39EE323080620EA44A9F74411AE5CE99030528F9AB49C79F2 +Digest: 33C8F40E1BD1EB1A3A70D2071D27460EF0F6B2D3ECE373743842D6B928F3771E4B7446A9ECFBBF552C064F6B26095401097581C38B95E9551119A1FDCB3D58E7 +Test: Verify +Message: 8C3798E51BC68482D7337D3ABB75DC9FFE860714A9AD73551E120059860DDE24AB87327222B64CF774415A70F724CDF270DE3FE47DDA07B61C9EF2A3551F45A5584860248FABDE676E1CD75F6355AA3EAEABE3B51DC813D9FB2EAA4F0F1D9F834D7CAD9C7C695AE84B329385BC0BEF895B9F1EDF44A03D4B410CC23A79A6B62E4F346A5E8DD851C2857995DDBF5B2D717AEB847310E1F6A46AC3D26A7F9B44985AF656D2B7C9406E8A9E8F47DCB4EF6B83CAACF9AEFB6118BFCFF7E44BEF6937EBDDC89186839B77 +Digest: 2A11CB6921EA662A39DDEE7982E3CF5B317195661D5505AD04D11EE23E178ED65F3E06A7F096F4EAF1FF6A09239CF5A0A39DC9F4C92AF63FDF7211E1CF467653 +Test: Verify +Message: FA56BF730C4F8395875189C10C4FB251605757A8FECC31F9737E3C2503B02608E6731E85D7A38393C67DE516B85304824BFB135E33BF22B3A23B913BF6ACD2B7AB85198B8187B2BCD454D5E3318CACB32FD6261C31AE7F6C54EF6A7A2A4C9F3ECB81CE3555D4F0AD466DD4C108A90399D70041997C3B25345A9653F3C9A6711AB1B91D6A9D2216442DA2C973CBD685EE7643BFD77327A2F7AE9CB283620A08716DFB462E5C1D65432CA9D56A90E811443CD1ECB8F0DE179C9CB48BA4F6FEC360C66F252F6E64EDC96B +Digest: 9196BBBD194541FFEE7EDBAB970738BDD3AADBD6B73D1C85B580AFAC1232AE8077F743CE8B5B6F2B418B5134CCCD4F83645E8631885B14FBBCB909A9836C374C +Test: Verify +Message: B6134F9C3E91DD8000740D009DD806240811D51AB1546A974BCB18D344642BAA5CD5903AF84D58EC5BA17301D5EC0F10CCD0509CBB3FD3FFF9172D193AF0F782252FD1338C7244D40E0E42362275B22D01C4C3389F19DD69BDF958EBE28E31A4FFE2B5F18A87831CFB7095F58A87C9FA21DB72BA269379B2DC2384B3DA953C7925761FED324620ACEA435E52B424A7723F6A2357374157A34CD8252351C25A1B232826CEFE1BD3E70FFC15A31E7C0598219D7F00436294D11891B82497BC78AA5363892A2495DF8C1EEF +Digest: 1959CAE3600F128F72E1821C337D841B14CBBFEF3A6D22286F18BDFC3EF63528C11BFFA841A6D2208AFEB5664D524DE83090AB0DB07CD47EF52F4D2EAA8454CE +Test: Verify +Message: C941CDB9C28AB0A791F2E5C8E8BB52850626AA89205BEC3A7E22682313D198B1FA33FC7295381354858758AE6C8EC6FAC3245C6E454D16FA2F51C4166FAB51DF272858F2D603770C40987F64442D487AF49CD5C3991CE858EA2A60DAB6A65A34414965933973AC2457089E359160B7CDEDC42F29E10A91921785F6B7224EE0B349393CDCFF6151B50B377D609559923D0984CDA6000829B916AB6896693EF6A2199B3C22F7DC5500A15B8258420E314C222BC000BC4E5413E6DD82C993F8330F5C6D1BE4BC79F08A1A0A46 +Digest: A913DDC5BB089C121FF093BE529225148DF787D48F4F61699EFF9FC2910282A898A81A38D66BE9B06428D6466A614CA822A872C1C2C4D503D434D3B1D6942102 +Test: Verify +Message: 4499EFFFAC4BCEA52747EFD1E4F20B73E48758BE915C88A1FFE5299B0B005837A46B2F20A9CB3C6E64A9E3C564A27C0F1C6AD1960373036EC5BFE1A8FC6A435C2185ED0F114C50E8B3E4C7ED96B06A036819C9463E864A58D6286F785E32A804443A56AF0B4DF6ABC57ED5C2B185DDEE8489EA080DEEEE66AA33C2E6DAB36251C402682B6824821F998C32163164298E1FAFD31BABBCFFB594C91888C6219079D907FDB438ED89529D6D96212FD55ABE20399DBEFD342248507436931CDEAD496EB6E4A80358ACC78647D043 +Digest: F10B91564AD93D734743281949BACEF065A6432A455236F1BF798DE9AEC6CCAC9B8D373B07C5ACFBD676EF21E4A3A9E0F7C38E8756D177D0A5C283D520844B4D +Test: Verify +Message: EECBB8FDFA4DA62170FD06727F697D81F83F601FF61E478105D3CB7502F2C89BF3E8F56EDD469D049807A38882A7EEFBC85FC9A950952E9FA84B8AFEBD3CE782D4DA598002827B1EB98882EA1F0A8F7AA9CE013A6E9BC462FB66C8D4A18DA21401E1B93356EB12F3725B6DB1684F2300A98B9A119E5D27FF704AFFB618E12708E77E6E5F34139A5A41131FD1D6336C272A8FC37080F041C71341BEE6AB550CB4A20A6DDB6A8E0299F2B14BC730C54B8B1C1C487B494BDCCFD3A53535AB2F231590BF2C4062FD2AD58F906A2D0D +Digest: EF26A1BAF33D4DE047BDD2CE34736E042ECD33AA569FFC0CB81ECFA66E9F87DA8D025ECBA24BCB187E4201046FB99A02DFA6F1BF88EC2B88DE216CF759FAC41D +Test: Verify +Message: E64F3E4ACE5C8418D65FEC2BC5D2A303DD458034736E3B0DF719098BE7A206DEAF52D6BA82316CAF330EF852375188CDE2B39CC94AA449578A7E2A8E3F5A9D68E816B8D16889FBC0EBF0939D04F63033AE9AE2BDAB73B88C26D6BD25EE460EE1EF58FB0AFA92CC539F8C76D3D097E7A6A63EBB9B5887EDF3CF076028C5BBD5B9DB3211371AD3FE121D4E9BF44229F4E1ECF5A0F9F0EBA4D5CEB72878AB22C3F0EB5A625323AC66F7061F4A81FAC834471E0C59553F108475FE290D43E6A055AE3EE46FB67422F814A68C4BE3E8C9 +Digest: F8E079A6DC5A6A7E7F32FF7E8015D1B26D43B54F166F2111CFB2B1EB238CABEE58630EF845E0DB00DDF1D800AD67CE7B2B658B42118CC15C8EF3BC9FB252DB64 +Test: Verify +Message: D2CB2D733033F9E91395312808383CC4F0CA974E87EC68400D52E96B3FA6984AC58D9AD0938DDE5A973008D818C49607D9DE2284E7618F1B8AED8372FBD52ED54557AF4220FAC09DFA8443011699B97D743F8F2B1AEF3537EBB45DCC9E13DFB438428EE190A4EFDB3CAEB7F3933117BF63ABDC7E57BEB4171C7E1AD260AB0587806C4D137B6316B50ABC9CCE0DFF3ACADA47BBB86BE777E617BBE578FF4519844DB360E0A96C6701290E76BB95D26F0F804C8A4F2717EAC4E7DE9F2CFF3BBC55A17E776C0D02856032A6CD10AD2838 +Digest: A5BFAA52499A688D9C8D3DDC0BA06DECDF3829BE5D444ACFA412F4C6E863F4786BE9935805310734E4F0AFFE05558999807408E97E100FADD0C93FF160F8B11B +Test: Verify +Message: F2998955613DD414CC111DF5CE30A995BB792E260B0E37A5B1D942FE90171A4AC2F66D4928D7AD377F4D0554CBF4C523D21F6E5F379D6F4B028CDCB9B1758D3B39663242FF3CB6EDE6A36A6F05DB3BC41E0D861B384B6DEC58BB096D0A422FD542DF175E1BE1571FB52AE66F2D86A2F6824A8CFAACBAC4A7492AD0433EEB15454AF8F312B3B2A577750E3EFBD370E8A8CAC1582581971FBA3BA4BD0D76E718DACF8433D33A59D287F8CC92234E7A271041B526E389EFB0E40B6A18B3AAF658E82ED1C78631FD23B4C3EB27C3FAEC8685 +Digest: CCEA9FCF1AD93270AC4690E96B875122C5B5EC20D2CC27079CBF893126C44E0208A8BFA139057D72BD2638059EC8DA8A720499AF9D4C117F86799D7515DFC6E0 +Test: Verify +Message: 447797E2899B72A356BA55BF4DF3ACCA6CDB1041EB477BD1834A9F9ACBC340A294D729F2F97DF3A610BE0FF15EDB9C6D5DB41644B9874360140FC64F52AA03F0286C8A640670067A84E017926A70438DB1BB361DEFEE7317021425F8821DEF26D1EFD77FC853B818545D055ADC9284796E583C76E6FE74C9AC2587AA46AA8F8804F2FEB5836CC4B3ABABAB8429A5783E17D5999F32242EB59EF30CD7ADABC16D72DBDB097623047C98989F88D14EAF02A7212BE16EC2D07981AAA99949DDF89ECD90333A77BC4E1988A82ABF7C7CAF3291 +Digest: 2EFC5DFE028A35503A25BDF8B2164D86CA7496B7C5DED09C5D414B6977ADBB4A6988AB9939D1EC65F46BCC99C1DCD5F19E035D8D3DC387361200E4DA80C80671 +Test: Verify +Message: 9F2C18ADE9B380C784E170FB763E9AA205F64303067EB1BCEA93DF5DAC4BF5A2E00B78195F808DF24FC76E26CB7BE31DC35F0844CDED1567BBA29858CFFC97FB29010331B01D6A3FB3159CC1B973D255DA9843E34A0A4061CABDB9ED37F241BFABB3C20D32743F4026B59A4CCC385A2301F83C0B0A190B0F2D01ACB8F0D41111E10F2F4E149379275599A52DC089B35FDD5234B0CFB7B6D8AEBD563CA1FA653C5C021DFD6F5920E6F18BFAFDBECBF0AB00281333ED50B9A999549C1C8F8C63D7626C48322E9791D5FF72294049BDE91E73F8 +Digest: E80D7A934FDAF17DB8DBB1DC6C42E90E139211C2F599890C06B15D6248FDBE682D77D4E05F26D72852F7492BCE118CE7C36950BD2C50F9699BB47D89C3115377 +Test: Verify +Message: AE159F3FA33619002AE6BCCE8CBBDD7D28E5ED9D61534595C4C9F43C402A9BB31F3B301CBFD4A43CE4C24CD5C9849CC6259ECA90E2A79E01FFBAC07BA0E147FA42676A1D668570E0396387B5BCD599E8E66AAED1B8A191C5A47547F61373021FA6DEADCB55363D233C24440F2C73DBB519F7C9FA5A8962EFD5F6252C0407F190DFEFAD707F3C7007D69FF36B8489A5B6B7C557E79DD4F50C06511F599F56C896B35C917B63BA35C6FF8092BAF7D1658E77FC95D8A6A43EEB4C01F33F03877F92774BE89C1114DD531C011E53A34DC248A2F0E6 +Digest: C414B29FD07720F46C351F5C80BE2094E95D13AD97BDD1F7C5207B695693CD5E1E0169B1AA2E271115BD5171FEC51D04B71E3E7CE1618FBFEB382F56F65F7EFF +Test: Verify +Message: 3B8E97C5FFC2D6A40FA7DE7FCEFC90F3B12C940E7AB415321E29EE692DFAC799B009C99DCDDB708FCE5A178C5C35EE2B8617143EDC4C40B4D313661F49ABDD93CEA79D117518805496FE6ACF292C4C2A1F76B403A97D7C399DAF85B46AD84E16246C67D6836757BDE336C290D5D401E6C1386AB32797AF6BB251E9B2D8FE754C47482B72E0B394EAB76916126FD68EA7D65EB93D59F5B4C5AC40F7C3B37E7F3694F29424C24AF8C8F0EF59CD9DBF1D28E0E10F799A6F78CAD1D45B9DB3D7DEE4A7059ABE99182714983B9C9D44D7F5643596D4F3 +Digest: A4679A4CBEE6292203BAFBA8913245F30E046ABA6C0937B407C00B73D17D8D696690EE25BA1B39DEB3DB93525A8FBCFD88173BA9C7A65B4406D0550BA9B6CC07 +Test: Verify +Message: 3434EC31B10FAFDBFEEC0DD6BD94E80F7BA9DCA19EF075F7EB017512AF66D6A4BCF7D16BA0819A1892A6372F9B35BCC7CA8155EE19E8428BC22D214856ED5FA9374C3C09BDE169602CC219679F65A1566FC7316F4CC3B631A18FB4449FA6AFA16A3DB2BC4212EFF539C67CF184680826535589C7111D73BFFCE431B4C40492E763D9279560AAA38EB2DC14A212D723F994A1FE656FF4DD14551CE4E7C621B2AA5604A10001B2878A897A28A08095C325E10A26D2FB1A75BFD64C250309BB55A44F23BBAC0D5516A1C687D3B41EF2FBBF9CC56D4739 +Digest: 5F49D6594DA939987D1906294B33A037F63C79E078531DFA7E6CE67279D4D5DBEB650FF8690F23B63B7E9C48EA8791B80FDB34EF66DCF0CEFE45842ECFF4AD1D +Test: Verify +Message: 7C7953D81C8D208FD1C97681D48F49DD003456DE60475B84070EF4847C333B74575B1FC8D2A186964485A3B8634FEAA3595AAA1A2F4595A7D6B6153563DEE31BBAC443C8A33EED6D5D956A980A68366C2527B550EE950250DFB691EACBD5D56AE14B970668BE174C89DF2FEA43AE52F13142639C884FD62A3683C0C3792F0F24AB1318BCB27E21F4737FAB62C77EA38BC8FD1CF41F7DAB64C13FEBE7152BF5BB7AB5A78F5346D43CC741CB6F72B7B8980F268B68BF62ABDFB1577A52438FE14B591498CC95F071228460C7C5D5CEB4A7BDE588E7F21C +Digest: B77FB79669EA52C738E58A9EF3ED1501BBE7974478AFB5A8BED44549D6232FF8D7AA9EEEAF02F6755327951093243110D7BCFC0E51299DB793856B57A77E8420 +Test: Verify +Message: 7A6A4F4FDC59A1D223381AE5AF498D74B7252ECF59E389E49130C7EAEE626E7BD9897EFFD92017F4CCDE66B0440462CDEDFD352D8153E6A4C8D7A0812F701CC737B5178C2556F07111200EB627DBC299CAA792DFA58F35935299FA3A3519E9B03166DFFA159103FFA35E8577F7C0A86C6B46FE13DB8E2CDD9DCFBA85BDDDCCE0A7A8E155F81F712D8E9FE646153D3D22C811BD39F830433B2213DD46301941B59293FD0A33E2B63ADBD95239BC01315C46FDB678875B3C81E053A40F581CFBEC24A1404B1671A1B88A6D06120229518FB13A74CA0AC5AE +Digest: CACA0FF43107F730A7FBE6869FBA5AF1E626C96303BE3BC95155164199C88922194511B24C48911186F647CA246427F2CE7BA747271CD8D7C5E1D127C21F1EAA +Test: Verify +Message: D9FAA14CEBE9B7DE551B6C0765409A33938562013B5E8E0E1E0A6418DF7399D0A6A771FB81C3CA9BD3BB8E2951B0BC792525A294EBD1083688806FE5E7F1E17FD4E3A41D00C89E8FCF4A363CAEDB1ACB558E3D562F1302B3D83BB886ED27B76033798131DAB05B4217381EAAA7BA15EC820BB5C13B516DD640EAEC5A27D05FDFCA0F35B3A5312146806B4C0275BCD0AAA3B2017F346975DB566F9B4D137F4EE10644C2A2DA66DEECA5342E236495C3C6280528BFD32E90AF4CD9BB908F34012B52B4BC56D48CC8A6B59BAB014988EABD12E1A0A1C2E170E7 +Digest: E5106B2A0D49D6D1E13E3323232101CEA5DA71CAA24E70EFCAC57E0CCF156CDF4C2492B03CE0E13437018DAB76B9C989883BEA69E849F33BB937A397B84ADA6A +Test: Verify +Message: 2D8427433D0C61F2D96CFE80CF1E932265A191365C3B61AAA3D6DCC039F6BA2AD52A6A8CC30FC10F705E6B7705105977FA496C1C708A277A124304F1FC40911E7441D1B5E77B951AAD7B01FD5DB1B377D165B05BBF898042E39660CAF8B279FE5229D1A8DB86C0999ED65E53D01CCBC4B43173CCF992B3A14586F6BA42F5FE30AFA8AE40C5DF29966F9346DA5F8B35F16A1DE3AB6DE0F477D8D8660918060E88B9B9E9CA6A4207033B87A812DBF5544D39E4882010F82B6CE005F8E8FF6FE3C3806BC2B73C2B83AFB704345629304F9F86358712E9FAE3CA3E +Digest: FAEE462E4BCED12AD54D3757D644396ED9203037741661AEA32BCCADAE568C4BDC925EDA76610E964FBE3FB26B33BC0BC123DDF9B528715317CE5C92E00AC96F +Test: Verify +Message: 5E19D97887FCAAC0387E22C6F803C34A3DACD2604172433F7A8A7A526CA4A2A1271ECFC5D5D7BE5AC0D85D921095350DFC65997D443C21C8094E0A3FEFD2961BCB94AED03291AE310CCDA75D8ACE4BC7D89E7D3E5D1650BDA5D668B8B50BFC8E608E184F4D3A9A2BADC4FF5F07E0C0BC8A9F2E0B2A26FD6D8C550008FAAAB75FD71AF2A424BEC9A7CD9D83FAD4C8E9319115656A8717D3B523A68FF8004258B9990ED362308461804BA3E3A7E92D8F2FFAE5C2FBA55BA5A3C27C0A2F71BD711D2FE1799C2ADB31B200035481E9EE5C4ADF2AB9C0FA50B23975CF +Digest: FBE25B43E540104A3AADE897838C63511928AF5ADD4F952F1E6D4C39E70C923DF191FAA36F46B21F827D9B437996FF7206F73337CF20C6B0DB748A707455B420 +Test: Verify +Message: C8E976AB4638909387CE3B8D4E510C3230E5690E02C45093B1D297910ABC481E56EEA0F296F98379DFC9080AF69E73B2399D1C143BEE80AE1328162CE1BA7F6A8374679B20AACD380EB4E61382C99998704D62701AFA914F9A2705CDB065885F50D086C3EB5753700C387118BB142F3E6DA1E988DFB31AC75D7368931E45D1391A274B22F83CEB072F9BCABC0B216685BFD789F5023971024B1878A205442522F9EA7D8797A4102A3DF41703768251FD5E017C85D1200A464118AA35654E7CA39F3C375B8EF8CBE7534DBC64BC20BEFB417CF60EC92F63D9EE7397 +Digest: 0A41A004573E0A983FE9C93BD57439A20C8F99B800A60D4A07117E8D9B25C0EE38BAB3CDB6FC9216B8E07F0CCDD028C418EF97B6D7E15DECDE7425497644E2E4 +Test: Verify +Message: 7145FA124B7429A1FC2231237A949BA7201BCC1822D3272DE005B682398196C25F7E5CC2F289FBF44415F699CB7FE6757791B1443410234AE061EDF623359E2B4E32C19BF88450432DD01CAA5EB16A1DC378F391CA5E3C4E5F356728BDDD4975DB7C890DA8BBC84CC73FF244394D0D48954978765E4A00B593F70F2CA082673A261ED88DBCEF1127728D8CD89BC2C597E9102CED6010F65FA75A14EBE467FA57CE3BD4948B6867D74A9DF5C0EC6F530CBF2EE61CE6F06BC8F2864DFF5583776B31DF8C7FFCB61428A56BF7BD37188B4A5123BBF338393AF46EDA85E6 +Digest: FF081507F979F69C6743E42EE758858713B570CB48FF85EF0D728C4E1BB5456D035E498C05EA4CEBD820E134BB252AC76BA4949A4FAD76871A9972AE2FCCCEEA +Test: Verify +Message: 7FDFADCC9D29BAD23AE038C6C65CDA1AEF757221B8872ED3D75FF8DF7DA0627D266E224E812C39F7983E4558BFD0A1F2BEF3FEB56BA09120EF762917B9C093867948547AEE98600D10D87B20106878A8D22C64378BF634F7F75900C03986B077B0BF8B740A82447B61B99FEE5376C5EB6680EC9E3088F0BDD0C56883413D60C1357D3C811950E5890E7600103C916341B80C743C6A852B7B4FB60C3BA21F3BC15B8382437A68454779CF3CD7F9F90CCC8EF28D0B706535B1E4108EB5627BB45D719CB046839AEE311CA1ABDC8319E050D67972CB35A6B1601B25DBF487 +Digest: 03444AE8319EBD121E7707B9CDFD1FDFD52F3D6B3D4BCB2748AF421A3C8666C22D8C0D8A096767B1CD16A8D54738C5F67A6F9D48C90827BE71691A42BE87108B +Test: Verify +Message: 988638219FD3095421F826F56E4F09E356296B628C3CE6930C9F2E758FD1A80C8273F2F61E4DAAE65C4F110D3E7CA0965AC7D24E34C0DC4BA2D6FF0BF5BBE93B3585F354D7543CB542A1AA54674D375077F2D360A8F4D42F3DB131C3B7AB7306267BA107659864A90C8C909460A73621D1F5D9D3FD95BEB19B23DB1CB6C0D0FBA91D36891529B8BD8263CAA1BAB56A4AFFAED44962DF096D8D5B1EB845EF31188B3E10F1AF811A13F156BEB7A288AAE593EBD1471B624AA1A7C6ADF01E2200B3D72D88A3AED3100C88231E41EFC376906F0B580DC895F080FDA5741DB1CB +Digest: 5EE0A4459724037B7318815A80147C172D6C8F8874C9A0057706FB3E300FE936815F07672E6447B771DE699DFADF345C3BB5974CF019315FADD5534DFF6A079C +Test: Verify +Message: 5AAB62756D307A669D146ABA988D9074C5A159B3DE85151A819B117CA1FF6597F6156E80FDD28C9C3176835164D37DA7DA11D94E09ADD770B68A6E081CD22CA0C004BFE7CD283BF43A588DA91F509B27A6584C474A4A2F3EE0F1F56447379240A5AB1FB77FDCA49B305F07BA86B62756FB9EFB4FC225C86845F026EA542076B91A0BC2CDD136E122C659BE259D98E5841DF4C2F60330D4D8CDEE7BF1A0A244524EECC68FF2AEF5BF0069C9E87A11C6E519DE1A4062A10C83837388F7EF58598A3846F49D499682B683C4A062B421594FAFBC1383C943BA83BDEF515EFCF10D +Digest: 54085A2F9C327E5D8EE225EFF5BD2C2837E44E8057CF1691E6202050079D26851061C4DA8D88FC19237E5B658950E66866E92019D9E425E2416240A59D25A6CF +Test: Verify +Message: 47B8216AA0FBB5D67966F2E82C17C07AA2D6327E96FCD83E3DE7333689F3EE79994A1BF45082C4D725ED8D41205CB5BCDF5C341F77FACB1DA46A5B9B2CBC49EADF786BCD881F371A95FA17DF73F606519AEA0FF79D5A11427B98EE7F13A5C00637E2854134691059839121FEA9ABE2CD1BCBBBF27C74CAF3678E05BFB1C949897EA01F56FFA4DAFBE8644611685C617A3206C7A7036E4AC816799F693DAFE7F19F303CE4EBA09D21E03610201BFC665B72400A547A1E00FA9B7AD8D84F84B34AEF118515E74DEF11B9188BD1E1F97D9A12C30132EC2806339BDADACDA2FD8B78 +Digest: 3EA49B6ABD39CDF04BCCD648FB7E1F8AE3DAE9D3E3A5EAB9CE29BE356DEFBBBEB1BB93AE40D31CC1F011DCC6C6AC85B102F2654E2DBBAC47333BCDB4758A1A28 +Test: Verify +Message: 8CFF1F67FE53C098896D9136389BD8881816CCAB34862BB67A656E3D98896F3CE6FFD4DA73975809FCDF9666760D6E561C55238B205D8049C1CEDEEF374D1735DAA533147BFA960B2CCE4A4F254176BB4D1BD1E89654432B8DBE1A135C42115B394B024856A2A83DC85D6782BE4B444239567CCEC4B184D4548EAE3FF6A192F343292BA2E32A0F267F31CC26719EB85245D415FB897AC2DA433EE91A99424C9D7F1766A44171D1651001C38FC79294ACCC68CEB5665D36218454D3BA169AE058A831338C17743603F81EE173BFC0927464F9BD728DEE94C6AEAB7AAE6EE3A627E8 +Digest: B3851790CA47575DBF988F82C3B501DC8390A8E8598698166167567A0332913CCC8868584DB4ACFB2C9DC0F0A6833292F4DCEDC47CF003217689BC2422B53B93 +Test: Verify +Message: EACD07971CFF9B9939903F8C1D8CBB5D4DB1B548A85D04E037514A583604E787F32992BF2111B97AC5E8A938233552731321522AB5E8583561260B7D13EBEEF785B23A41FD8576A6DA764A8ED6D822D4957A545D5244756C18AA80E1AAD4D1F9C20D259DEE1711E2CC8FD013169FB7CC4CE38B362F8E0936AE9198B7E838DCEA4F7A5B9429BB3F6BBCF2DC92565E3676C1C5E6EB3DD2A0F86AA23EDD3D0891F197447692794B3DFA269611AD97F72B795602B4FDB198F3FD3EB41B415064256E345E8D8C51C555DC8A21904A9B0F1AD0EFFAB7786AAC2DA3B196507E9F33CA356427 +Digest: A710CB26C632F289504CD0039BA6AB9B4D3524C52B286D466E2F8939F8684E3F18DCA298A2BA67EB710997B7BB10AE279438B9B4868D0ADB248F282BB440A130 +Test: Verify +Message: 23AC4E9A42C6EF45C3336CE6DFC2FF7DE8884CD23DC912FEF0F7756C09D335C189F3AD3A23697ABDA851A81881A0C8CCAFC980AB2C702564C2BE15FE4C4B9F10DFB2248D0D0CB2E2887FD4598A1D4ACDA897944A2FFC580FF92719C95CF2AA42DC584674CB5A9BC5765B9D6DDF5789791D15F8DD925AA12BFFAFBCE60827B490BB7DF3DDA6F2A143C8BF96ABC903D83D59A791E2D62814A89B8080A28060568CF24A80AE61179FE84E0FFAD00388178CB6A617D37EFD54CC01970A4A41D1A8D3DDCE46EDBBA4AB7C90AD565398D376F431189CE8C1C33E132FEAE6A8CD17A61C630012 +Digest: 8F677A8089052B47BE60C0BB7666E403A5DAA5E28A2B632F2E496C587F1FDCA0EE33D9E78DAA4EF575B13389748B8C24110053B0B96A082C06C3F80EBE8DE976 +Test: Verify +Message: 0172DF732282C9D488669C358E3492260CBE91C95CFBC1E3FEA6C4B0EC129B45F242ACE09F152FC6234E1BEE8AAB8CD56E8B486E1DCBA9C05407C2F95DA8D8F1C0AF78EE2ED82A3A79EC0CB0709396EE62AADB84F8A4EE8A7CCCA3C1EE84E302A09EA802204AFECF04097E67D0F8E8A9D2651126C0A598A37081E42D168B0AE8A71951C524259E4E2054E535B779679BDADE566FE55700858618E626B4A0FAF895BCCE9011504A49E05FD56127EAE3D1F8917AFB548ECADABDA1020111FEC9314C413498A360B08640549A22CB23C731ACE743252A8227A0D2689D4C6001606678DFB921 +Digest: CE631E6F2C2DC5738C0FA958571773B58AF130B94824331419EE57E2691CE5F29DB3D8FE456CD1E7CDC07F6105FA1B6FD729C2B419008CCD889169C3385DB1B9 +Test: Verify +Message: 3875B9240CF3E0A8B59C658540F26A701CF188496E2C2174788B126FD29402D6A75453BA0635284D08835F40051A2A9683DC92AFB9383719191231170379BA6F4ADC816FECBB0F9C446B785BF520796841E58878B73C58D3EBB097CE4761FDEABE15DE2F319DFBAF1742CDEB389559C788131A6793E193856661376C81CE9568DA19AA6925B47FFD77A43C7A0E758C37D69254909FF0FBD415EF8EB937BCD49F91468B49974C07DC819ABD67395DB0E05874FF83DDDAB895344ABD0E7111B2DF9E58D76D85AD98106B36295826BE04D435615595605E4B4BB824B33C4AFEB5E7BB0D19F909 +Digest: FFF677BB58909C158EA677BE704253505B106AF934F639ABFEC63BD0C63097AA4BF032FE924149DD991D335E1C44C0220E4D13CBC41B6A98FB5A05FAA3FE15B3 +Test: Verify +Message: 747CC1A59FEFBA94A9C75BA866C30DC5C1CB0C0F8E9361D98484956DD5D1A40F6184AFBE3DAC9F76028D1CAECCFBF69199C6CE2B4C092A3F4D2A56FE5A33A00757F4D7DEE5DFB0524311A97AE0668A47971B95766E2F6DD48C3F57841F91F04A00AD5EA70F2D479A2620DC5CD78EAAB3A3B011719B7E78D19DDF70D9423798AF77517EBC55392FCD01FC600D8D466B9E7A7A85BF33F9CC5419E9BD874DDFD60981150DDAF8D7FEBAA4374F0872A5628D318000311E2F5655365AD4D407C20E5C04DF17A222E7DEEC79C5AB1116D8572F91CD06E1CCC7CED53736FC867FD49ECEBE6BF8082E8A +Digest: 451EE587226C99989F5EC10050983B1FD661228A4AB48618F1D1173C94FAC39ECFD3C26C16653633B26097E31A0F2213B4F1153A57CB48A70D2AF1ADEB1BBC06 +Test: Verify +Message: 57AF971FCCAEC97435DC2EC9EF0429BCEDC6B647729EA168858A6E49AC1071E706F4A5A645CA14E8C7746D65511620682C906C8B86EC901F3DDED4167B3F00B06CBFAC6AEE3728051B3E5FF10B4F9ED8BD0B8DA94303C833755B3CA3AEDDF0B54BC8D6632138B5D25BAB03D17B3458A9D782108006F5BB7DE75B5C0BA854B423D8BB801E701E99DC4FEAAD59BC1C7112453B04D33EA3635639FB802C73C2B71D58A56BBD671B18FE34ED2E3DCA38827D63FDB1D4FB3285405004B2B3E26081A8FF08CD6D2B08F8E7B7E90A2AB1ED7A41B1D0128522C2F8BFF56A7FE67969422CE839A9D4608F03 +Digest: F9D6AD8686125E71FE0856E806D68BA97EF123443938D28283387F33E3AC6E2A7DE042A3EE5F7994C1EECC5B6F22CBAE1349CAB2FB7A0A0125EC2320320858D4 +Test: Verify +Message: 04E16DEDC1227902BAAF332D3D08923601BDD64F573FAA1BB7201918CFE16B1E10151DAE875DA0C0D63C59C3DD050C4C6A874011B018421AFC4623AB0381831B2DA2A8BA42C96E4F70864AC44E106F94311051E74C77C1291BF5DB9539E69567BF6A11CF6932BBBAD33F8946BF5814C066D851633D1A513510039B349939BFD42B858C21827C8FF05F1D09B1B0765DC78A135B5CA4DFBA0801BCADDFA175623C8B647EACFB4444B85A44F73890607D06D507A4F8393658788669F6EF4DEB58D08C50CA0756D5E2F49D1A7AD73E0F0B3D3B5F090ACF622B1878C59133E4A848E05153592EA81C6FBF +Digest: F26F3268FD620FC476A49AAC3ED1580864934A2F6BA881ED8C8FB757AAAA64BCDF501E1913DE600BBEF6F12C949FEA8FD68C645086D5E30C9253588FFBD19BE5 +Test: Verify +Message: 7C815C384EEE0F288ECE27CCED52A01603127B079C007378BC5D1E6C5E9E6D1C735723ACBBD5801AC49854B2B569D4472D33F40BBB8882956245C366DC3582D71696A97A4E19557E41E54DEE482A14229005F93AFD2C4A7D8614D10A97A9DFA07F7CD946FA45263063DDD29DB8F9E34DB60DAA32684F0072EA2A9426ECEBFA5239FB67F29C18CBAA2AF6ED4BF4283936823AC1790164FEC5457A9CBA7C767CA59392D94CAB7448F50EB34E9A93A80027471CE59736F099C886DEA1AB4CBA4D89F5FC7AE2F21CCD27F611ECA4626B2D08DC22382E92C1EFB2F6AFDC8FDC3D2172604F5035C46B8197D3 +Digest: 080845D6FD22A00B30FA01A4B4F81FDC7B46CA4C6A676AD5863A9DBF6611BA97F24FB59BB5BAC4E376B3B8B3357166782876B701273FF351BC8C5805532767D4 +Test: Verify +Message: E29D505158DBDD937D9E3D2145658EE6F5992A2FC790F4F608D9CDB44A091D5B94B88E81FAC4FDF5C49442F13B911C55886469629551189EAFF62488F1A479B7DB11A1560E198DDCCCCF50159093425FF7F1CB8D1D1246D0978764087D6BAC257026B090EFAE8CEC5F22B6F21C59ACE1AC7386F5B8837CA6A12B6FBF5534DD0560EF05CA78104D3B943DDB220FEAEC89AA5E692A00F822A2AB9A2FE60350D75E7BE16FF2526DC643872502D01F42F188ABED0A6E9A6F5FD0D1CE7D5755C9FFA66B0AF0B20BD806F08E06156690D81AC811778CA3DAC2C249B96002017FCE93E507E3B953ACF99964B847 +Digest: 2678A8715FC7E538522DD7608D769508B63017D9EB6CC48F1CB07D14E741066936C8316BF3211E09F62611E140DDD14A07F97F9F372E99C084FFE289EB302BD8 +Test: Verify +Message: D85588696F576E65ECA0155F395F0CFACD83F36A99111ED5768DF2D116D2121E32357BA4F54EDE927F189F297D3A97FAD4E9A0F5B41D8D89DD7FE20156799C2B7B6BF9C957BA0D6763F5C3BC5129747BBB53652B49290CFF1C87E2CDF2C4B95D8AAEE09BC8FBFA6883E62D237885810491BFC101F1D8C636E3D0EDE838AD05C207A3DF4FAD76452979EB99F29AFAECEDD1C63B8D36CF378454A1BB67A741C77AC6B6B3F95F4F02B64DABC15438613EA49750DF42EE90101F115AA9ABB9FF64324DDE9DABBB01054E1BD6B4BCDC7930A44C2300D87CA78C06924D0323AD7887E46C90E8C4D100ACD9EED21E +Digest: AA03EB09417435DA9E6E7803F3B6EAB66FAA3D59CC622950D61F9B962B69145AC2255CD752CB9607742092697B1A79D124817AE26421E61D1176764832ED354C +Test: Verify +Message: 3A12F8508B40C32C74492B66323375DCFE49184C78F73179F3314B79E63376B8AC683F5A51F1534BD729B02B04D002F55CBD8E8FC9B5EC1EA6BBE6A0D0E7431518E6BA45D124035F9D3DCE0A8BB7BF1430A9F657E0B4EA9F20EB20C786A58181A1E20A96F1628F8728A13BDF7A4B4B32FC8AA7054CC4881AE7FA19AFA65C6C3EE1B3ADE3192AF42054A8A911B8EC1826865D46D93F1E7C5E2B7813C92A506E53886F3D4701BB93D2A681AD109C845904BB861AF8AF0646B6E399B38B614051D34F6842563A0F37EC00CB3D865FC5D746C4987DE2A65071100883A2A9C7A2BFE1E2DD603D9EA24DC7C5FD06BE +Digest: D3012F2FB56845B258D7598C0BBB2C97D53B602DEAE9326DC3678B2228454A1E29F28848ED140C70BE85CDEA9F99A8DC347DEABD46D362ED1AFB231146A0255D +Test: Verify +Message: 1861EDCE46FA5AD17E1FF1DEAE084DEC580F97D0A67885DFE834B9DFAC1AE076742CE9E267512CA51F6DF5A455AF0C5FD6ABF94ACEA103A3370C354485A7846FB84F3AC7C2904B5B2FBF227002CE512133BB7E1C4E50057BFD1E44DB33C7CDB969A99E284B184F50A14B068A1FC5009D9B298DBE92239572A7627AAC02ABE8F3E3B473417F36D4D2505D16B7577F4526C9D94A270A2DFE450D06DA8F6FA956879A0A55CFE99E742EA555EA477BA3E9B44CCD508C375423611AF92E55345DC215779B2D5119EBA49C71D49B9FE3F1569FA24E5CA3E332D042422A8B8158D3EC66A80012976F31FFDF305F0C9C5E +Digest: B50C896F2CDF7F105DE751FF6CF664E592FAB752D652B06898B9B288052DF22F721AD87E702AF043E6B1E88929850CBD5698A9172C3932400B2538E401A6F081 +Test: Verify +Message: 08D0FFDE3A6E4EF65608EA672E4830C12943D7187CCFF08F4941CFC13E545F3B9C7AD5EEBBE2B01642B486CAF855C2C73F58C1E4E3391DA8E2D63D96E15FD84953AE5C231911B00AD6050CD7AAFDAAC9B0F663AE6AAB45519D0F5391A541707D479034E73A6AD805AE3598096AF078F1393301493D663DD71F83869CA27BA508B7E91E81E128C1716DC3ACFE3084B2201E04CF8006617EECF1B640474A5D45CFDE9F4D3EF92D6D055B909892194D8A8218DB6D8203A84261D200D71473D7488F3427416B6896C137D455F231071CACBC86E0415AB88AEC841D96B7B8AF41E05BB461A40645BF176601F1E760DE5F +Digest: A34A2F27C32F993A7E7007867733547481293C391255FFD0E5CCBE91E1CC749B13525AF6ADFA0C2D1D64BF87DD65B996ADA9111C5DF55BFF8A5742E54B8444F6 +Test: Verify +Message: D782ABB72A5BE3392757BE02D3E45BE6E2099D6F000D042C8A543F50ED6EBC055A7F133B0DD8E9BC348536EDCAAE2E12EC18E8837DF7A1B3C87EC46D50C241DEE820FD586197552DC20BEEA50F445A07A38F1768A39E2B2FF05DDDEDF751F1DEF612D2E4D810DAA3A0CC904516F9A43AF660315385178A529E51F8AAE141808C8BC5D7B60CAC26BB984AC1890D0436EF780426C547E94A7B08F01ACBFC4A3825EAE04F520A9016F2FB8BF5165ED12736FC71E36A49A73614739EAA3EC834069B1B40F1350C2B3AB885C02C640B9F7686ED5F99527E41CFCD796FE4C256C9173186C226169FF257954EBDA81C0E5F99 +Digest: DD5F4B167175D9566DCA6C5B1B54A33D02EFD02E25E23BB6FB02D878A4415E5E8682C209BEAC04E9882A272D01E8EB435CAA5BCD74FC825C6B9082D041DFF333 +Test: Verify +Message: 5FCE8109A358570E40983E1184E541833BB9091E280F258CFB144387B05D190E431CB19BAA67273BA0C58ABE91308E1844DCD0B3678BAA42F335F2FA05267A0240B3C718A5942B3B3E3BFA98A55C25A1466E8D7A603722CB2BBF03AFA54CD769A99F310735EE5A05DAE2C22D397BD95635F58C48A67F90E1B73AAFCD3F82117F0166657838691005B18DA6F341D6E90FC1CDB352B30FAE45D348294E501B63252DE14740F2B85AE5299DDEC3172DE8B6D0BA219A20A23BB5E10FF434D39DB3F583305E9F5C039D98569E377B75A70AB837D1DF269B8A4B566F40BB91B577455FD3C356C914FA06B9A7CE24C7317A172D +Digest: A43AE5DAD936697564AE1BD9B8624C5C31CC36607322AF40E253F10C285467AFD0D08252D2BAD76EFA52E4775C9C26761ABE38212855A80112FE02623FBF0A13 +Test: Verify +Message: 6172F1971A6E1E4E6170AFBAD95D5FEC99BF69B24B674BC17DD78011615E502DE6F56B86B1A71D3F4348087218AC7B7D09302993BE272E4A591968AEF18A1262D665610D1070EE91CC8DA36E1F841A69A7A682C580E836941D21D909A3AFC1F0B963E1CA5AB193E124A1A53DF1C587470E5881FB54DAE1B0D840F0C8F9D1B04C645BA1041C7D8DBF22030A623AA15638B3D99A2C400FF76F3252079AF88D2B37F35EE66C1AD7801A28D3D388AC450B97D5F0F79E4541755356B3B1A5696B023F39AB7AB5F28DF4202936BC97393B93BC915CB159EA1BD7A0A414CB4B7A1AC3AF68F50D79F0C9C7314E750F7D02FAA58BFA +Digest: A5AC23D4A0D533CB9D8A68873F5CB749228458D43CE6BD0536C8733777B5E6E3F28FD36BFFE69002A0777BA74FEF22DE3FAC4C818B4842816C6094496F968555 +Test: Verify +Message: 5668ECD99DFBE215C4118398AC9C9EAF1A1433FAB4CCDD3968064752B625EA944731F75D48A27D047D67547F14DD0FFAA55FA5E29F7AF0D161D85EAFC4F2029B717C918EAB9D304543290BDBA7158B68020C0BA4E079BC95B5BC0FC044A992B94B4CCD3BD66D0EABB5DBBAB904D62E00752C4E3B0091D773BCF4C14B4377DA3EFFF824B1CB2FA01B32D1E46C909E626ED2DAE920F4C7DBEB635BC754FACBD8D49BEBA3F23C1C41CCBFCD0EE0C114E69737F5597C0BF1D859F0C767E18002AE8E39C26261FFDE2920D3D0BAF0E906138696CFE5B7E32B600F45DF3AAA39932F3A7DF95B60FA8712A2271FCAF3911CE7B511B1 +Digest: 07F3BCACF5F78816D515CEDF1CBBA4FFC58D83AA8687B0E7252FAAB43E7F59A7FF7415727ADDF9A22560ADB5755A2C6DF8C7E6DCACEB53106A714D807AAADBF3 +Test: Verify +Message: 03D625488354DF30E3F875A68EDFCF340E8366A8E1AB67F9D5C5486A96829DFAC0578289082B2A62117E1CF418B43B90E0ADC881FC6AE8105C888E9ECD21AEA1C9AE1A4038DFD17378FED71D02AE492087D7CDCD98F746855227967CB1AB4714261EE3BEAD3F4DB118329D3EBEF4BC48A875C19BA763966DA0EBEA800E01B2F50B00E9DD4CACA6DCB314D00184EF71EA2391D760C950710DB4A70F9212FFC54861F9DC752CE18867B8AD0C48DF8466EF7231E7AC567F0EB55099E622EBB86CB237520190A61C66AD34F1F4E289CB3282AE3EAAC6152ED24D2C92BAE5A7658252A53C49B7B02DFE54FDB2E90074B6CF310AC661 +Digest: 13A592B73EDE487036C8816BD6FC6CDC04DC6133409A6EE990584160518F9EF573264CF04D38A3BA75D150F4F026F6DF8936E13C8F4F3ECC9ECBC43FDFC488A4 +Test: Verify +Message: 2EDC282FFB90B97118DD03AAA03B145F363905E3CBD2D50ECD692B37BF000185C651D3E9726C690D3773EC1E48510E42B17742B0B0377E7DE6B8F55E00A8A4DB4740CEE6DB0830529DD19617501DC1E9359AA3BCF147E0A76B3AB70C4984C13E339E6806BB35E683AF8527093670859F3D8A0FC7D493BCBA6BB12B5F65E71E705CA5D6C948D66ED3D730B26DB395B3447737C26FAD089AA0AD0E306CB28BF0ACF106F89AF3745F0EC72D534968CCA543CD2CA50C94B1456743254E358C1317C07A07BF2B0ECA438A709367FAFC89A57239028FC5FECFD53B8EF958EF10EE0608B7F5CB9923AD97058EC067700CC746C127A61EE3 +Digest: C2FB590AB74E230B8FE159892F94DE04EF7ADAA02B918D4994F996538D257F5A80C9B3BE8F410170B0C5CAC3F507401220881C5E08D8BF0A13247170D39085BC +Test: Verify +Message: 90B28A6AA1FE533915BCB8E81ED6CACDC10962B7FF82474F845EEB86977600CF70B07BA8E3796141EE340E3FCE842A38A50AFBE90301A3BDCC591F2E7D9DE53E495525560B908C892439990A2CA2679C5539FFDF636777AD9C1CDEF809CDA9E8DCDB451ABB9E9C17EFA4379ABD24B182BD981CAFC792640A183B61694301D04C5B3EAAD694A6BD4CC06EF5DA8FA23B4FA2A64559C5A68397930079D250C51BCF00E2B16A6C49171433B0AADFD80231276560B80458DD77089B7A1BBCC9E7E4B9F881EACD6C92C4318348A13F4914EB27115A1CFC5D16D7FD94954C3532EFACA2CAB025103B2D02C6FD71DA3A77F417D7932685888A +Digest: 02951596A13A1A41188A4A1D6346F7EAFB60A2051EA67C63237D1A9B79EC4733F33ECEC223DEDD946B78387B6F2DF5E9AB6AF7DFBABAF80F4FCC94FA087275E8 +Test: Verify +Message: 2969447D175490F2AA9BB055014DBEF2E6854C95F8D60950BFE8C0BE8DE254C26B2D31B9E4DE9C68C9ADF49E4EE9B1C2850967F29F5D08738483B417BB96B2A56F0C8ACA632B552059C59AAC3F61F7B45C966B75F1D9931FF4E596406378CEE91AAA726A3A84C33F37E9CDBE626B5745A0B06064A8A8D56E53AAF102D23DD9DF0A3FDF7A638509A6761A33FA42FA8DDBD8E16159C93008B53765019C3F0E9F10B144CE2AC57F5D7297F9C9949E4FF68B70D339F87501CE8550B772F32C6DA8AD2CE2100A895D8B08FA1EEAD7C376B407709703C510B50F87E73E43F8E7348F87C3832A547EF2BBE5799ABEDCF5E1F372EA809233F006 +Digest: 5AA4E32F0EA3E853929BF64ACC9565A01300BC007063B939F6DBBE9CAE0545EA95FBCAC32575AA0727EE4D937071E6B3BE74E23FE76FD63EC05C7F7D8A407AF0 +Test: Verify +Message: 721645633A44A2C78B19024EAECF58575AB23C27190833C26875DC0F0D50B46AEA9C343D82EA7D5B3E50EC700545C615DAEAEA64726A0F05607576DCD396D812B03FB6551C641087856D050B10E6A4D5577B82A98AFB89CEE8594C9DC19E79FEFF0382FCFD127F1B803A4B9946F4AC9A4378E1E6E041B1389A53E3450CD32D9D2941B0CBABDB50DA8EA2513145164C3AB6BCBD251C448D2D4B087AC57A59C2285D564F16DA4ED5E607ED979592146FFB0EF3F3DB308FB342DF5EB5924A48256FC763141A278814C82D6D6348577545870AE3A83C7230AC02A1540FE1798F7EF09E335A865A2AE0949B21E4F748FB8A51F44750E213A8FB +Digest: 495B2AA2103159D9A937E9DD56B059ACA98A5E3CB7B59BB690DEDC00C692E9D7A18614A73D12E07634B209CC630D1818B09F1076A941FF80474493E3D42B9812 +Test: Verify +Message: 6B860D39725A14B498BB714574B4D37CA787404768F64C648B1751B353AC92BAC2C3A28EA909FDF0423336401A02E63EC24325300D823B6864BB701F9D7C7A1F8EC9D0AE3584AA6DD62EA1997CD831B4BABD9A4DA50932D4EFDA745C61E4130890E156AEE6113716DAF95764222A91187DB2EFFEA49D5D0596102D619BD26A616BBFDA8335505FBB0D90B4C180D1A2335B91538E1668F9F9642790B4E55F9CAB0FE2BDD2935D001EE6419ABAB5457880D0DBFF20ED8758F4C20FE759EFB33141CF0E892587FE8187E5FBC57786B7E8B089612C936DFC03D27EFBBE7C8673F1606BD51D5FF386F4A7AB68EDF59F385EB1291F117BFE717399 +Digest: 217B5A985BED80008274470E254443238C5AEACBC7EE2289F0E63B7AFE6D0F395E2361FD6D9DC33B4F54F03FF56F6B264976161D80091788EE9D262F147A35FC +Test: Verify +Message: 6A01830AF3889A25183244DECB508BD01253D5B508AB490D3124AFBF42626B2E70894E9B562B288D0A2450CFACF14A0DDAE5C04716E5A0082C33981F6037D23D5E045EE1EF2283FB8B6378A914C5D9441627A722C282FF452E25A7EA608D69CEE4393A0725D17963D0342684F255496D8A18C2961145315130549311FC07F0312FB78E6077334F87EAA873BEE8AA95698996EB21375EB2B4EF53C14401207DEB4568398E5DD9A7CF97E8C9663E23334B46912F8344C19EFCF8C2BA6F04325F1A27E062B62A58D0766FC6DB4D2C6A1928604B0175D872D16B7908EBC041761187CC785526C2A3873FEAC3A642BB39F5351550AF9770C328AF7B +Digest: 293C551E753BBA7F314DCB93A0FAD94F3F5DEE6ED45D765A708E6FD277601F03F6C905D7E1EAEAEC513CBBBD672B817F6D60FBF02C20167D7F4B7B84AFEEB3F6 +Test: Verify +Message: B3C5E74B69933C2533106C563B4CA20238F2B6E675E8681E34A389894785BDADE59652D4A73D80A5C85BD454FD1E9FFDAD1C3815F5038E9EF432AAC5C3C4FE840CC370CF86580A6011778BBEDAF511A51B56D1A2EB68394AA299E26DA9ADA6A2F39B9FAFF7FBA457689B9C1A577B2A1E505FDF75C7A0A64B1DF81B3A356001BF0DF4E02A1FC59F651C9D585EC6224BB279C6BEBA2966E8882D68376081B987468E7AED1EF90EBD090AE825795CDCA1B4F09A979C8DFC21A48D8A53CDBB26C4DB547FC06EFE2F9850EDD2685A4661CB4911F165D4B63EF25B87D0A96D3DFF6AB0758999AAD214D07BD4F133A6734FDE445FE474711B69A98F7E2B +Digest: 89FE6314A0246EFF3BFD07A95FE239BD5071467F53799175B226DAF6C3DB618CAD4CA1C1AF64BF5793F03254F560E6335BEAAA86BCB9E961F214B2AE97B47AF0 +Test: Verify +Message: 83AF34279CCB5430FEBEC07A81950D30F4B66F484826AFEE7456F0071A51E1BBC55570B5CC7EC6F9309C17BF5BEFDD7C6BA6E968CF218A2B34BD5CF927AB846E38A40BBD81759E9E33381016A755F699DF35D660007B5EADF292FEEFB735207EBF70B5BD17834F7BFA0E16CB219AD4AF524AB1EA37334AA66435E5D397FC0A065C411EBBCE32C240B90476D307CE802EC82C1C49BC1BEC48C0675EC2A6C6F3ED3E5B741D13437095707C565E10D8A20B8C20468FF9514FCF31B4249CD82DCEE58C0A2AF538B291A87E3390D737191A07484A5D3F3FB8C8F15CE056E5E5F8FEBE5E1FB59D6740980AA06CA8A0C20F5712B4CDE5D032E92AB89F0AE1 +Digest: 7690F703E894EE22D4DFF55A7F8D5021D5F17B729F95A59C4D55CFB225C67BE105F2E7CDF56D140E566648E9E9C39BBED96F985A6DAE1F21D8BA500F7FD40EDF +Test: Verify +Message: A7ED84749CCC56BB1DFBA57119D279D412B8A986886D810F067AF349E8749E9EA746A60B03742636C464FC1EE233ACC52C1983914692B64309EDFDF29F1AB912EC3E8DA074D3F1D231511F5756F0B6EEAD3E89A6A88FE330A10FACE267BFFBFC3E3090C7FD9A850561F363AD75EA881E7244F80FF55802D5EF7A1A4E7B89FCFA80F16DF54D1B056EE637E6964B9E0FFD15B6196BDD7DB270C56B47251485348E49813B4EB9ED122A01B3EA45AD5E1A929DF61D5C0F3E77E1FDC356B63883A60E9CBB9FC3E00C2F32DBD469659883F690C6772E335F617BC33F161D6F6984252EE12E62B6000AC5231E0C9BC65BE223D8DFD94C5004A101AF9FD6C0FB +Digest: 65E415C7958A47FCA9EED3846FD1283AFEB38E5130F57ECD99DCB21BEDDA856E3B5FB9F839E579C5EA386EACA8CDC0A9549EAAF6EC452DD6CB5212B709BF5C59 +Test: Verify +Message: A6FE30DCFCDA1A329E82AB50E32B5F50EB25C873C5D2305860A835AECEE6264AA36A47429922C4B8B3AFD00DA16035830EDB897831C4E7B00F2C23FC0B15FDC30D85FB70C30C431C638E1A25B51CAF1D7E8B050B7F89BFB30F59F0F20FECFF3D639ABC4255B3868FC45DD81E47EB12AB40F2AAC735DF5D1DC1AD997CEFC4D836B854CEE9AC02900036F3867FE0D84AFFF37BDE3308C2206C62C4743375094108877C73B87B2546FE05EA137BEDFC06A2796274099A0D554DA8F7D7223A48CBF31B7DECAA1EBC8B145763E3673168C1B1B715C1CD99ECD3DDB238B06049885ECAD9347C2436DFF32C771F34A38587A44A82C5D3D137A03CAA27E66C8FF6 +Digest: D6542A2F0654B9B874A627D3D53764A65B1DF2C0CEC3BCD0B4B088FAA1095E54F1799757C4371F8D544E298D600E21E11B2F90D295712621231A09C58B05A704 +Test: Verify +Message: 83167FF53704C3AA19E9FB3303539759C46DD4091A52DDAE9AD86408B69335989E61414BC20AB4D01220E35241EFF5C9522B079FBA597674C8D716FE441E566110B6211531CECCF8FD06BC8E511D00785E57788ED9A1C5C73524F01830D2E1148C92D0EDC97113E3B7B5CD3049627ABDB8B39DD4D6890E0EE91993F92B03354A88F52251C546E64434D9C3D74544F23FB93E5A2D2F1FB15545B4E1367C97335B0291944C8B730AD3D4789273FA44FB98D78A36C3C3764ABEEAC7C569C1E43A352E5B770C3504F87090DEE075A1C4C85C0C39CF421BDCC615F9EFF6CB4FE6468004AECE5F30E1ECC6DB22AD9939BB2B0CCC96521DFBF4AE008B5B46BC006E +Digest: EC983E787628B94C87FFF8D57D2D058667D12F5AF458BCE79BB7844FB41D9C55920F593C8D8730EB8D54FF1D51CD8AD2F1C2A0F7D6B299A21266744E47D142B2 +Test: Verify +Message: 3A3A819C48EFDE2AD914FBF00E18AB6BC4F14513AB27D0C178A188B61431E7F5623CB66B23346775D386B50E982C493ADBBFC54B9A3CD383382336A1A0B2150A15358F336D03AE18F666C7573D55C4FD181C29E6CCFDE63EA35F0ADF5885CFC0A3D84A2B2E4DD24496DB789E663170CEF74798AA1BBCD4574EA0BBA40489D764B2F83AADC66B148B4A0CD95246C127D5871C4F11418690A5DDF01246A0C80A43C70088B6183639DCFDA4125BD113A8F49EE23ED306FAAC576C3FB0C1E256671D817FC2534A52F5B439F72E424DE376F4C565CCA82307DD9EF76DA5B7C4EB7E085172E328807C02D011FFBF33785378D79DC266F6A5BE6BB0E4A92ECEEBAEB1 +Digest: 81950E7096D31D4F22E3DB71CAC725BF59E81AF54C7CA9E6AEEE71C010FC5467466312A01AA5C137CFB140646941556796F612C9351268737C7E9A2B9631D1FA +Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/shacal2.txt b/external/crypto++-5.6.3/TestVectors/shacal2.txt new file mode 100644 index 000000000..19a3d86ed --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/shacal2.txt @@ -0,0 +1,5123 @@ +AlgorithmType: SymmetricCipher +Name: SHACAL-2/ECB +Source: NESSIE submission +Comment: Set 1, vector 0 +Key: 80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 361AB6322FA9E7A7BB23818D839E01BDDAFDF47305426EDD297AEDB9F6202BAE +Test: Encrypt +Comment: Set 1, vector 1 +Key: 40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F3BAF53E5301E08813F8BE6F651BB19E9722151FF15063BA42A6FEF7CF3BF3D7 +Test: Encrypt +Comment: Set 1, vector 2 +Key: 20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E485005217441B60EE5B48EE8AF924B268B6B952D7F593E6102AC83D7DA72838 +Test: Encrypt +Comment: Set 1, vector 3 +Key: 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AE70E355CB7E26FF12421F46CDAD5CB98367FE0E86CC234EDF97481765CD1AD9 +Test: Encrypt +Comment: Set 1, vector 4 +Key: 08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 00CECD0B01311F881018E7A20BCE169766C089D91FF161346C4E1BD122EA199F +Test: Encrypt +Comment: Set 1, vector 5 +Key: 04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 47A879CB6785AD37119C450CD50E9A36FE318FA8E7B6C6E0FA963430122F33CD +Test: Encrypt +Comment: Set 1, vector 6 +Key: 02000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CF3D53B9F9F7CA2C66738A4C09CEA9212C056F525BDC26F263FBA1B482EDF503 +Test: Encrypt +Comment: Set 1, vector 7 +Key: 01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A274D404E83E82817389A2CB7B528C792A0E80DE879A5A67DE633B0B7DD57B7B +Test: Encrypt +Comment: Set 1, vector 8 +Key: 00800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 09B3AB9332301D4E3C239D192A4221AFD43F6829A705D396FA96BDE1E716BC38 +Test: Encrypt +Comment: Set 1, vector 9 +Key: 00400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D3B9AB867A6868C4400D200979055C8F9E3A6BFB40D1F9E376B9EC89223D7050 +Test: Encrypt +Comment: Set 1, vector 10 +Key: 00200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4F27041481DCF574586CD6D5B72F2E806B0DBC351FEEA624112897A8A64CDBA9 +Test: Encrypt +Comment: Set 1, vector 11 +Key: 00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 77CEC8EA64BB7FAE966D030FE4CF318C318DBEBAEB896F31FAA3C9CBA0AE125D +Test: Encrypt +Comment: Set 1, vector 12 +Key: 00080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E6F96E0217B8BDC6BBF30CB91C05325F493EB076E505FC6469AAA2BBB3A8A60B +Test: Encrypt +Comment: Set 1, vector 13 +Key: 00040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: ED949C1CFC555EC7192464AE86EC0334AD1198C2DBA36DB38CDF7160C950D474 +Test: Encrypt +Comment: Set 1, vector 14 +Key: 00020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 41EB01CC3875F31A6C8D7008C958BBB164813C59435B01879199979FC4762B26 +Test: Encrypt +Comment: Set 1, vector 15 +Key: 00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CCE7C4F96A665DDD23F39A78A3C7898E5F945FE908F1707DBED08BA6BCA3A58E +Test: Encrypt +Comment: Set 1, vector 16 +Key: 00008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5FDBD5741AB5BC53E8C75F4497E37D5BE92B89D2424A11BBF189449AE005E2E8 +Test: Encrypt +Comment: Set 1, vector 17 +Key: 00004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E6C00B21A5B89F4FE9251E53E7AFE30D6C8721678BF842575EEE185E85632778 +Test: Encrypt +Comment: Set 1, vector 18 +Key: 00002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FC19871F6E933014D92721D77BDF4E0EF528A325D5DC979536D6C46457CA066F +Test: Encrypt +Comment: Set 1, vector 19 +Key: 00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A195202A93364212B989EB2C667EE05881657AD95FB6B3EE62DD21EB73347E56 +Test: Encrypt +Comment: Set 1, vector 20 +Key: 00000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A25B4FB9B4F8418514A1A04078DFBDF73B83B936A887AD6B1B672F1C2AF128CF +Test: Encrypt +Comment: Set 1, vector 21 +Key: 00000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: ACB2AB0F22068D36C160D668ED300DCF32C66FB8447594878DE1B1A83B414E13 +Test: Encrypt +Comment: Set 1, vector 22 +Key: 00000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A5AD217E39C9B40A921B4E52B1B47649C72631E7A99FE4897A92CD1A65BF8BFF +Test: Encrypt +Comment: Set 1, vector 23 +Key: 00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1185C198ABA5AD97F5DF7850284CD5E34BBE5E0EEC3CE4ACC4FC0A3CE3FA3BEE +Test: Encrypt +Comment: Set 1, vector 24 +Key: 00000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7AC85AA2C5A9A219B8E437C65913738628EE442F56BD57292C8A1B36026B6664 +Test: Encrypt +Comment: Set 1, vector 25 +Key: 00000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6140F926FA90F091603D23A4876A3A5598890CB1F2FDE64E43C50630BE4101D2 +Test: Encrypt +Comment: Set 1, vector 26 +Key: 00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 365135682290CB40D83228B3F26FD63266EED9C72DAC991510FEFA9B56466E8F +Test: Encrypt +Comment: Set 1, vector 27 +Key: 00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 928EED2E262D9E398ADA06151ADFB35F34018114E97414C75E390C8EDA8D2440 +Test: Encrypt +Comment: Set 1, vector 28 +Key: 00000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E362280E66204F47E8FB782D18522AA3E1D527C15EBA88E76DB5AF44E156BB45 +Test: Encrypt +Comment: Set 1, vector 29 +Key: 00000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 807E3938AF9C9F0233FDA70B0E26028B390101F238ECFBD53EAE8E2D86552DBF +Test: Encrypt +Comment: Set 1, vector 30 +Key: 00000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E7D3FA388C4E07ADD32E188BD09264A2BD19F0F7EC5712AC05C47B49C7FD6651 +Test: Encrypt +Comment: Set 1, vector 31 +Key: 00000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 891CFD4A18F35239FD4463DE95FE9CAF4569AC82766E457315C123FB5FE6A397 +Test: Encrypt +Comment: Set 1, vector 32 +Key: 00000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5C8E12B2572ED949494B324383806FD61B7CF0479DEB5D62028E83B7091BB039 +Test: Encrypt +Comment: Set 1, vector 33 +Key: 00000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6F071D68C107B19B9949A6B7AF2C79EDC40FBA9BD07674AB3B1DB8CDE0A9637D +Test: Encrypt +Comment: Set 1, vector 34 +Key: 00000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FD720D4ECFB7B68BA48C52E2F69FE268773D73B41723AA51127895B14C516F34 +Test: Encrypt +Comment: Set 1, vector 35 +Key: 00000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0D3D7DEB1F8742BB22C4A3FB88C7C07CDCC8165ECF624C95FD8838D90D465B0D +Test: Encrypt +Comment: Set 1, vector 36 +Key: 00000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 06A524998D1FEA6AF6E4015B9A16B7A447F50AE0A8902E6E3308D3B47E98C4F1 +Test: Encrypt +Comment: Set 1, vector 37 +Key: 00000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9FBDF43AB1294164BC968E113673BB11195AE39267BF2537F0E429E3C10B5D2F +Test: Encrypt +Comment: Set 1, vector 38 +Key: 00000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 81C4C7F2144555C888D876787EE62BC03EBB57093DB3DDE806918707684C8C52 +Test: Encrypt +Comment: Set 1, vector 39 +Key: 00000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F62E7B237C98C5727D4F267AE17932AAC4DAEF0CAF4C02176B4CBB902ED164D1 +Test: Encrypt +Comment: Set 1, vector 40 +Key: 00000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 99CAD86B7E78D9B2ED9DA56F27C9AECB49CBFFC287930CEBC1BF06EA94541E9B +Test: Encrypt +Comment: Set 1, vector 41 +Key: 00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: ED1F4429D5C36B2C16D598A2CE52D9C84E9DE7CD0B4899E47ADCB999CAEDB0CA +Test: Encrypt +Comment: Set 1, vector 42 +Key: 00000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3FEF41084D9CFF6111C40F9656C46D3892323465630B0C1D082255222847D9D0 +Test: Encrypt +Comment: Set 1, vector 43 +Key: 00000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AB7D2B41135ED54EC7AB11C67D20BC35F0C8652D209D675AAB3A33FA264C9380 +Test: Encrypt +Comment: Set 1, vector 44 +Key: 00000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1208F63F213F1A55127900FFBFEB0569B693376D9310C9A9E36EA1DE22CB5A59 +Test: Encrypt +Comment: Set 1, vector 45 +Key: 00000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 10C38678BC2465923063E41B4339D96F3DC5A64CA77A9C9C132D75BC4EC517F1 +Test: Encrypt +Comment: Set 1, vector 46 +Key: 00000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5342519F1181700EDC380133226AE072971AC1AC6DF72440FD817C9ACB862E68 +Test: Encrypt +Comment: Set 1, vector 47 +Key: 00000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 09D02729C71C6E5E852272B853E87C1BAB5E522875E5D8063501ECE10315B4D6 +Test: Encrypt +Comment: Set 1, vector 48 +Key: 00000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 33D7D4F58BDD14244621A960A076573892ABDDBEF36109289A3E8A4EC536E95F +Test: Encrypt +Comment: Set 1, vector 49 +Key: 00000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 81A4590D64E2140414B913AC73BECEC19CAC798C313196007E39EF4F75C7DDB5 +Test: Encrypt +Comment: Set 1, vector 50 +Key: 00000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 942ED16EC4A9D72D74ABFB7E79CDE840997DD2AD83C9DDFAD02528A9A7E0AAC3 +Test: Encrypt +Comment: Set 1, vector 51 +Key: 00000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8376BF03EAE71EF035E18903AC0CC2CCC93610C48050DB096BE758743234CD63 +Test: Encrypt +Comment: Set 1, vector 52 +Key: 00000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B5613234B5F9D1201A9A581D59BD744B8E59728E5E330B74CBF03B9E81C950E0 +Test: Encrypt +Comment: Set 1, vector 53 +Key: 00000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4750E864B881A2764EC508D0DD4AF06B7B1B123FDCCCA141A74DEAF28070B408 +Test: Encrypt +Comment: Set 1, vector 54 +Key: 00000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B3F29EE6BDF09A16C4EA8C1539CD033B17706436FC40DEBD95DA70BF05BF1856 +Test: Encrypt +Comment: Set 1, vector 55 +Key: 00000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3A91B7730E3FE044B75E75B9BB09BC1550AD5AC9F495AFFB524FAD90A51112D5 +Test: Encrypt +Comment: Set 1, vector 56 +Key: 00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D262DF12E3D8DA99A9F7F011D607905DCBE9AB03C317E81E4BCD076F3C55EBB2 +Test: Encrypt +Comment: Set 1, vector 57 +Key: 00000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 827BD4A79FD82594F645A02F9546906ADCBFF47E2F2D0D0DAF89A200389A5E00 +Test: Encrypt +Comment: Set 1, vector 58 +Key: 00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E83B866B294780E36058CBCB62BC3C509604F9EB9A44F1CFAFD50F248359A106 +Test: Encrypt +Comment: Set 1, vector 59 +Key: 00000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8695B4BC5DC6528183B94D5257DC668DCAA0E5A855B76555B65FCCF941A8CCAC +Test: Encrypt +Comment: Set 1, vector 60 +Key: 00000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3B5D549F736D15CFD0F39A42CB1ACBEA370ADAA9EBC7C012AF2E30463DF98E03 +Test: Encrypt +Comment: Set 1, vector 61 +Key: 00000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1C29F7919784BDF30E566B75DBA4C911FC48C1CD7F845406B86DA540B71C572E +Test: Encrypt +Comment: Set 1, vector 62 +Key: 00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D530E5B30338589A6AE67E0C1E2C57AF02CCEFF84705BC4AAD0D93375E7F2DAB +Test: Encrypt +Comment: Set 1, vector 63 +Key: 00000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AE92CD3DA2022DC9C91E381DA62D8FFA646FD02A1A5A3249AEAD35B729C48329 +Test: Encrypt +Comment: Set 1, vector 64 +Key: 00000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 111318C5C6DAE45DF4FAFF404AE2140300DBBF9361E926900F3ED7F731385A52 +Test: Encrypt +Comment: Set 1, vector 65 +Key: 00000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AA0DAA9A0025B5B3243367C7FC22F56F65A52B3CEEA060825C1FD2813953BEF8 +Test: Encrypt +Comment: Set 1, vector 66 +Key: 00000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 11EA951B966D0B3DF0D6AA00059281E6944CBB9921F84209265938CCE91F4910 +Test: Encrypt +Comment: Set 1, vector 67 +Key: 00000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DFDE0D41A657B700DADED5F9CB341481A0183AC1BB51291E8719F77251B478F6 +Test: Encrypt +Comment: Set 1, vector 68 +Key: 00000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A8A42F8E3C2BD71D415EF9FBDBB9DA86B32CFC24EBDADC656B7BFF17FC8BE365 +Test: Encrypt +Comment: Set 1, vector 69 +Key: 00000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1755CB48D8057669C488DF3A2296651F3FB64AA173DC6FCBD2C1113A084679C1 +Test: Encrypt +Comment: Set 1, vector 70 +Key: 00000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CEFD04E10B318145993C0AF4B4A64F623BCE0E04CE04E6D3DDE14EC6DFC0CDEE +Test: Encrypt +Comment: Set 1, vector 71 +Key: 00000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D9C83924493AE365C6369317A4393F904D530C1D30B2FD1A2E4126D0A532A743 +Test: Encrypt +Comment: Set 1, vector 72 +Key: 00000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9B8FC0A924382EBD28AA3F6871B17E1BA9C94418FC3533B446C2DE8C188EABB6 +Test: Encrypt +Comment: Set 1, vector 73 +Key: 00000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F91346BFBC0E05A4076B8CD5640E9DD278D4A7755A6D870565AC2A7E60A7F5AE +Test: Encrypt +Comment: Set 1, vector 74 +Key: 00000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 58D205808D4A580FF8111B9EF06BEE613D51E3B2E026B296F5E9F8520C7319FE +Test: Encrypt +Comment: Set 1, vector 75 +Key: 00000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 15D0C54FC35621B206A4A50EC3DADCEDFE4CCA17C9C5396A18901099A3389086 +Test: Encrypt +Comment: Set 1, vector 76 +Key: 00000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 48DE43EC8F644BCCFF61A52D93BEDEEBA38C71C196203A4A5AD9145416EFF31E +Test: Encrypt +Comment: Set 1, vector 77 +Key: 00000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 253057DA247A8D7A1B4A23E87B67D49669ADE1FE5EF32E08058F2DA6E82D1C25 +Test: Encrypt +Comment: Set 1, vector 78 +Key: 00000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6494B08A0B0CE628E34EC6D7EFBC436687D242131974789ECF20911C0CF16839 +Test: Encrypt +Comment: Set 1, vector 79 +Key: 00000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5088AC91D68173FE292A64D04D9A8083535649D44D7F00F23F389810F5F2528E +Test: Encrypt +Comment: Set 1, vector 80 +Key: 00000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FFF5D0D5296B0C3553DD43C429F51AF844EB6100E373A6A7A16B79A73392AC58 +Test: Encrypt +Comment: Set 1, vector 81 +Key: 00000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4A805BF70CBBAC2FACF405789FE96C4EF097D36F6982B843246C353E77539863 +Test: Encrypt +Comment: Set 1, vector 82 +Key: 00000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5F5F6828D3D2FDF24B4AC2F1F4080F40E9564CD8F9BAFC34E5567F96E2F057BA +Test: Encrypt +Comment: Set 1, vector 83 +Key: 00000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5BFAD855773EF036BAE365C18B6C5784E8BD4673514B0499E7ACFA38F7832927 +Test: Encrypt +Comment: Set 1, vector 84 +Key: 00000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B38604950FA73165F940D4DB527D09CD0B233276CD3808B5CADCCB9FA859AEEB +Test: Encrypt +Comment: Set 1, vector 85 +Key: 00000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B96570996489A74726A70C02CD55FB9D4C3ADE0B69FAE7C37899E3D560A5132F +Test: Encrypt +Comment: Set 1, vector 86 +Key: 00000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0B8612F83912A9EF1082E9D08C772738908BCCD20DE47D64ACA1500633163479 +Test: Encrypt +Comment: Set 1, vector 87 +Key: 00000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CCC75B4A84D08B14495AA8349B0AF79480FF6D0695561710AA16739A54504E58 +Test: Encrypt +Comment: Set 1, vector 88 +Key: 00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BC3F95A0CB0DCAEDB78E3D6E855267E34F3168C436774E28035D144406E803DA +Test: Encrypt +Comment: Set 1, vector 89 +Key: 00000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BD0A34B0509EFA39D9D091577FC4296F563AF5F3AF9E030FCC3661C0BD82738E +Test: Encrypt +Comment: Set 1, vector 90 +Key: 00000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: EC82DA0C15A50EB98E97532C509DBAC9C392DB79ADDC139F9ADC6091708CD726 +Test: Encrypt +Comment: Set 1, vector 91 +Key: 00000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7F164D165F7585E8306E38D44211325D0C6C177C523F13F69DB39DFEDF5BFD3F +Test: Encrypt +Comment: Set 1, vector 92 +Key: 00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 73F36AF678E74D413BE851E77F5E55DE1DD92D5237DBAE75E3AB6364D1F181DF +Test: Encrypt +Comment: Set 1, vector 93 +Key: 00000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BE25140C4E7804B22390822501718BE09E7F494594EBD2BCB35A36AC2F0CA095 +Test: Encrypt +Comment: Set 1, vector 94 +Key: 00000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 33171A271100D5CC5CF651ABF60977CD15B718863213DC243CAFA6CA86041094 +Test: Encrypt +Comment: Set 1, vector 95 +Key: 00000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 323FF7A80198298E438C833032CE609D4E6C5C107C9069E8B216080DE5C0880D +Test: Encrypt +Comment: Set 1, vector 96 +Key: 00000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D8FB3E266B96E48524159A3BE04CC85B3DB70F2FE649A01259E4FCCBCD3E7BAF +Test: Encrypt +Comment: Set 1, vector 97 +Key: 00000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 88B2171E37F3E861B6A69397BCC46044EABBC424E3359D11C96A62CB33F6C56C +Test: Encrypt +Comment: Set 1, vector 98 +Key: 00000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 96168ED95200986AFF506D3C2F043DFE03356345C52AD205BDC91423C6079824 +Test: Encrypt +Comment: Set 1, vector 99 +Key: 00000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4FDE2AD110847B5F4F2BD20CE5047913B12A682D119D9A8C8395B9958771FC22 +Test: Encrypt +Comment: Set 1, vector 100 +Key: 00000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F703282E54592A5617E10618027BB67F639E43A90767150D8B7F5E83054B3CBD +Test: Encrypt +Comment: Set 1, vector 101 +Key: 00000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6673138D1A64DD26CDD2F62CAB0BAB2318DE17507BAA307A189EC4997F9C3F89 +Test: Encrypt +Comment: Set 1, vector 102 +Key: 00000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 328B2F4069F398422D78E359F19938B8BFBC9E073C2162A0829265CFD48B89CA +Test: Encrypt +Comment: Set 1, vector 103 +Key: 00000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 02B14A28344C4164DDF0EDB594D581AE847FC0090EE6B933B8B8B91EAE90F5B3 +Test: Encrypt +Comment: Set 1, vector 104 +Key: 00000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 506221E93DBCBA6787757CCBBB0D5CDE9D06CFE3A23A8942A13C5B3849B2D2B9 +Test: Encrypt +Comment: Set 1, vector 105 +Key: 00000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 53A01AD91AE1C7F0DCBE19CF701A895E03FD866F77ABC7B174B327A0576D7719 +Test: Encrypt +Comment: Set 1, vector 106 +Key: 00000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B27AB67ACB784CB231A76D05B2539F0146F5C2F330987DE2C91AEAF8511DB9D1 +Test: Encrypt +Comment: Set 1, vector 107 +Key: 00000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 682263AAD3FF0B227983D20CB8A8B572427A2EE1B85A7FBB0961C722A7DE70CE +Test: Encrypt +Comment: Set 1, vector 108 +Key: 00000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E8AA0C754FBFB2BAF1025C8C13101552FA32E4031843E3DC56D2D819476CBFA6 +Test: Encrypt +Comment: Set 1, vector 109 +Key: 00000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7952391AEB6094458B28B543B9A5AC1DDB0CB18AEB431BE7CC7A4D45CCBEBEB0 +Test: Encrypt +Comment: Set 1, vector 110 +Key: 00000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 138599B1B9406E932D6229A4FFD959EE02E626022342FF233269A00DA1F58384 +Test: Encrypt +Comment: Set 1, vector 111 +Key: 00000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 87FA25FEBEFB539BFA46F9FAF8D62DB8E3C126D7409813A3B2FFC760FF19D390 +Test: Encrypt +Comment: Set 1, vector 112 +Key: 00000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 943B778E6053E3CBC59E9423A6D8AE678D369D5E27AB56D668DAD944D0A238F4 +Test: Encrypt +Comment: Set 1, vector 113 +Key: 00000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 00D31AA7620BEE29169C62966C53058F05709CD7C6A6584AFA80D7B2B7D9414C +Test: Encrypt +Comment: Set 1, vector 114 +Key: 00000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9A6DD9EAE3286D48A7548C0A8A4CE8FFFB61B362C95C897DCD1CB1D8BBF76DEB +Test: Encrypt +Comment: Set 1, vector 115 +Key: 00000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8231E89C8C74641DA6CD862B98B5DE749D6751B44361B763DF888F3D2312FAD5 +Test: Encrypt +Comment: Set 1, vector 116 +Key: 00000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AEE13BA9322E1089262CEB199FD96E8A3C1E29142C6542961CA0B70782A4FD65 +Test: Encrypt +Comment: Set 1, vector 117 +Key: 00000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 89EEFABFFF030B563CAA5965CFF0372E0518BA1BF9A6E07D279C20AF3D52B9E5 +Test: Encrypt +Comment: Set 1, vector 118 +Key: 00000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9EB46332AE8F271D9613A5FD1D6E1B06ED7A553C874A44A6F3A0615D46AA079D +Test: Encrypt +Comment: Set 1, vector 119 +Key: 00000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FDB79EB3D755AC9338093917F84742BB1D62197D9730AEFCBAA9B3A4CEEC0B5E +Test: Encrypt +Comment: Set 1, vector 120 +Key: 00000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 64D439442C3FB4B580E0C7BC212F5589B395F6D100AA8165E4599A34F288D31D +Test: Encrypt +Comment: Set 1, vector 121 +Key: 00000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 09F8A382936078076F496A14B7BFD77CF4E549171FBDD8106AD0C2F87FD9C151 +Test: Encrypt +Comment: Set 1, vector 122 +Key: 00000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AEB59849B6291FC1B8917642088608C4B9EE364C8C1FAE502F1ECD5BFACBC96A +Test: Encrypt +Comment: Set 1, vector 123 +Key: 00000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 006136B68224BF8BF47C0298FE7E2A4B72964A6C9F36EB709C452F0319B6A104 +Test: Encrypt +Comment: Set 1, vector 124 +Key: 00000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 55912F44A9A3493CF0A4DEF2F77978ECE0868ABF30BBAB15A96AFE15575AA90A +Test: Encrypt +Comment: Set 1, vector 125 +Key: 00000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 81BA612B664481588AB16246226CC1B59A08A7FE0FD64B0111C67C4BF344D2C7 +Test: Encrypt +Comment: Set 1, vector 126 +Key: 00000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6B7930B1609C35095BE581F8F73709A65781DC1D49381411F6474CEBE6D16182 +Test: Encrypt +Comment: Set 1, vector 127 +Key: 00000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7308AEC23D25A231B26448AFE78D5047804C5011B9B5F95C16DF2670551F0001 +Test: Encrypt +Comment: Set 1, vector 128 +Key: 00000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FBE855BD6540594E2D90566E7A30F57516EE170817B66C2468615D5D3D5DF03B +Test: Encrypt +Comment: Set 1, vector 129 +Key: 00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B072D598869D6EFCC8856A2B4686EF05A37DDB3F26DFEDA2F9C406B7250801F5 +Test: Encrypt +Comment: Set 1, vector 130 +Key: 00000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0CF58B2665B889C06836E699DC2B4C615106541987229D686D43614D3BFC290B +Test: Encrypt +Comment: Set 1, vector 131 +Key: 00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F591E78CE6A8A375CBF821D222A49C862A461DC52C74065BA6349598CC7CB6EC +Test: Encrypt +Comment: Set 1, vector 132 +Key: 00000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A32B883113DE96B7AFD4ABE8E1703C8D724397542527E27F0CA32C89332980D9 +Test: Encrypt +Comment: Set 1, vector 133 +Key: 00000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9B2C992F4CA0E70E0DDB03400AD24C4F20AD5F32940537B33F375C7979968537 +Test: Encrypt +Comment: Set 1, vector 134 +Key: 00000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0DDEEEBC428F117B094FD27B614F6BDFEC0D71D61F8F93F9A09E0443F2FEB659 +Test: Encrypt +Comment: Set 1, vector 135 +Key: 00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D58740E259B1C9A5DADD2FA5FFB768ACECD0DA6FE40D7D59F3CF6FCD4838FEDA +Test: Encrypt +Comment: Set 1, vector 136 +Key: 00000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E6F318C17501C28164BE9CA692E92D4CF4835E2778B126E9841CA0F132CCAA61 +Test: Encrypt +Comment: Set 1, vector 137 +Key: 00000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3776A0BB5880EB65386F20D11BCF308C2DA3B010F7E2DAF3FB8B55B523E7CBC3 +Test: Encrypt +Comment: Set 1, vector 138 +Key: 00000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3926539CFD76BB79E50A571D75AA51B94864A79CA5DCAF6CE451FC068E487625 +Test: Encrypt +Comment: Set 1, vector 139 +Key: 00000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A8D9B6254BCD0BC32CA3ECF7A7A80882DDC178F47D8E91F760883D589D94F45C +Test: Encrypt +Comment: Set 1, vector 140 +Key: 00000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A2C3810606AD6AAAA571C8A783A686E9F713D0A1238C3E621347622C569C7BB6 +Test: Encrypt +Comment: Set 1, vector 141 +Key: 00000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 902FF7C8DA5B1D171603F48C02E72B611C40E4B15F06BF4A7DB914AAA7E63036 +Test: Encrypt +Comment: Set 1, vector 142 +Key: 00000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 55AAAB17A700544B1384EA512146F65A2F871C30F8EF7AB84DD96E004E924403 +Test: Encrypt +Comment: Set 1, vector 143 +Key: 00000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E9F049D8DD032202BC5E16F061B0449AEFD91845A4786A045E35739826E283AE +Test: Encrypt +Comment: Set 1, vector 144 +Key: 00000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6347929B2B5B6634C2674CC4AD3B04B321F7404101E79259A35053E552369548 +Test: Encrypt +Comment: Set 1, vector 145 +Key: 00000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3C8D318014177555818122F69A95BED7A175464310A9B53DD4AF3C5887970D39 +Test: Encrypt +Comment: Set 1, vector 146 +Key: 00000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A3CE794DEA39A03EB4337395E3713ACA02E15148CC9302083E9F2FD55A921BF5 +Test: Encrypt +Comment: Set 1, vector 147 +Key: 00000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2EE444D85842D41D9AEFBB7ECE34EEB71720AFB04498F9B4CFB87C10AC842D3A +Test: Encrypt +Comment: Set 1, vector 148 +Key: 00000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0050EF8A2E0EAC79CD1BCC82F52F04410DA08263A320DA47B500DD72FBAA3487 +Test: Encrypt +Comment: Set 1, vector 149 +Key: 00000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 51721D61A2032DB004C8B83F7509B045A5190892FBC5AEB9BAA4B27D7969C791 +Test: Encrypt +Comment: Set 1, vector 150 +Key: 00000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 016D3D0A0C9B1EA97A12AB7BFA23BD4A973D5F10C06581A6DA92668BF3B4026E +Test: Encrypt +Comment: Set 1, vector 151 +Key: 00000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 687DAF7B782EB92EE2F8812ABA81A1F8EC353797544602A8EF2D2D6C1AC7EB48 +Test: Encrypt +Comment: Set 1, vector 152 +Key: 00000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 538008D0A4465A705313E0A03DE02BDFF7D9F0F0226F630DAFEA5434D9ADD7EE +Test: Encrypt +Comment: Set 1, vector 153 +Key: 00000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2F65E608EF3E4C202C347ADDB9733132350A7AC9E544C5D7D76F9527DB3640AE +Test: Encrypt +Comment: Set 1, vector 154 +Key: 00000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1EF33EF878790A6E16E18377C474700E6AF64C0C56F5FE8E7A1A83D990BB7B9B +Test: Encrypt +Comment: Set 1, vector 155 +Key: 00000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3369751D8735C5B82164E9FDFAA8B224AA4BD3FC2CD3DC48C60A1C290AE189BD +Test: Encrypt +Comment: Set 1, vector 156 +Key: 00000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 428F02228A58756A94871F5DCB37F54AD21345ABEDECB6D12630E51ADF4D6128 +Test: Encrypt +Comment: Set 1, vector 157 +Key: 00000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 521221AE0F51055948753BAC7A30394DA0F3DCB485364AB512E62D9CDC24FE48 +Test: Encrypt +Comment: Set 1, vector 158 +Key: 00000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7E44783F40C4A3EBB40E5D4E22A9BECAD3008D8B1AE64929B666664D8D8680D9 +Test: Encrypt +Comment: Set 1, vector 159 +Key: 00000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 48F54AE18072D2E58922EB0B14E4C32CD72807BF436A01164B0B5027ADCE6121 +Test: Encrypt +Comment: Set 1, vector 160 +Key: 00000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 671E9014ABC8FBBA21A307FAFF3FC7C89231ACA932F58C2D79DA323F80B3F87B +Test: Encrypt +Comment: Set 1, vector 161 +Key: 00000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4473A8EF3585DDC8AB5858DB58FD87FA42E724D2374D7888FCFA66D82B30145A +Test: Encrypt +Comment: Set 1, vector 162 +Key: 00000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A4AD8D6A847FF420E96E1E592852FC7B362F1E0DBBE417B0CFC80C1200C5BB97 +Test: Encrypt +Comment: Set 1, vector 163 +Key: 00000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B10D378FB56687BDDE7462A91FD0C42C773097765AC4C332B5007D1D47670EE0 +Test: Encrypt +Comment: Set 1, vector 164 +Key: 00000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 788D00A54C0A6FB10067E08B8F2C60B4DBA05B58D3C8CEEABE49C2FD2FD7D6C2 +Test: Encrypt +Comment: Set 1, vector 165 +Key: 00000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CC54D8465F9529077237703DF4DC136FCD7A9D2FF3B89FF0D226EA3B234B6113 +Test: Encrypt +Comment: Set 1, vector 166 +Key: 00000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A0DAF3D3568FA9134C9C1B6EC5137B72715271DEC644F1268FDFA88A89989371 +Test: Encrypt +Comment: Set 1, vector 167 +Key: 00000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0BBCCB3D83D7B6D3AA96AD5687C4895CD990146E293733A649B4D7EC48E9A93C +Test: Encrypt +Comment: Set 1, vector 168 +Key: 00000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DDF8388BA3EA8FDC869D54D38D6BFE47FB7C5B6D81B3D80AE8B7DE00F4581EC1 +Test: Encrypt +Comment: Set 1, vector 169 +Key: 00000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FF4F175CADFA435B31D5766FE6FE73B88B33BF5A87D79A2B47FCEB6BFE6E39AF +Test: Encrypt +Comment: Set 1, vector 170 +Key: 00000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9B28804310814CF3C9782CB23FAB7FE19D5BDA5E9553F23E7876A6426316365C +Test: Encrypt +Comment: Set 1, vector 171 +Key: 00000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 94831F56AC794746628AF8A0684ABFE6A1113EB5B95939A8223D5C0C08BF52FD +Test: Encrypt +Comment: Set 1, vector 172 +Key: 00000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 689C2CAC1FC6999B8BA48B767A995871D80AB561FADF20D8613274CFFD00BF32 +Test: Encrypt +Comment: Set 1, vector 173 +Key: 00000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4CC4412727B69CE43E6B85D89F03DAC6982CF867FB98801DA1F0E8720123699E +Test: Encrypt +Comment: Set 1, vector 174 +Key: 00000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8160A24A68E81E4A839E1C16086983BE98652856CC621B3F7612A8B1324FA33E +Test: Encrypt +Comment: Set 1, vector 175 +Key: 00000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 024B19F8BE7203D9E5589AB96B86BD68A488D7994813D0231C835637B9E59A64 +Test: Encrypt +Comment: Set 1, vector 176 +Key: 00000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 954714BFD736CB391604E77367C2875EF291C02EED35B6DD6A20D58FBADAFB84 +Test: Encrypt +Comment: Set 1, vector 177 +Key: 00000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6E95756FEA083B4AB4E624B5CFB00E31CAEA9C03CE4A1F51104BF6E7A86495F3 +Test: Encrypt +Comment: Set 1, vector 178 +Key: 00000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 93176B234B0A25F30649FD3172F75F181CD47C75D795FCFD5A537F18B101B24D +Test: Encrypt +Comment: Set 1, vector 179 +Key: 00000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 51637CD02F79DA935C5A317C1F8AC79E47E255E4A83F3F04DBA2998DF5118D39 +Test: Encrypt +Comment: Set 1, vector 180 +Key: 00000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 15C15F38B0CDEC62A426CF4AED25096DCCF1B2C7CF49A223F4D3ED7E06CAD2D7 +Test: Encrypt +Comment: Set 1, vector 181 +Key: 00000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 14520B3D7B8734A8D4E07CAB93744560D60FE7C9122C97F2ADB97D811074D225 +Test: Encrypt +Comment: Set 1, vector 182 +Key: 00000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F16ED0E9813C694563BF3557D73085C8761642B6B003291B31C681D3A9421E73 +Test: Encrypt +Comment: Set 1, vector 183 +Key: 00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BD3B03B8DF1994DDD3BE4509BB2B4AED0F7D0F7638102C58B15ED9DC9FAD5261 +Test: Encrypt +Comment: Set 1, vector 184 +Key: 00000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 45813D3ABF443D14B8519A10BA667F16C2EC757B309B978E26FFE56EE0BA00B1 +Test: Encrypt +Comment: Set 1, vector 185 +Key: 00000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A13D32CA09C34BBA16813BE8F4D56AF772B67327C7CDE0756B3D5CECEF2BCD2D +Test: Encrypt +Comment: Set 1, vector 186 +Key: 00000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: EC7D07D6F3AD0351131F15816F8044CBB1592324F62903B9DD6180D88E09EF07 +Test: Encrypt +Comment: Set 1, vector 187 +Key: 00000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 873F46936C8CC3A23CCA3EA3288CA070CC41F128296FCE6E7AAD2B7381BBAEBB +Test: Encrypt +Comment: Set 1, vector 188 +Key: 00000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0AF0BB23EFCF86B273A27D84435F53F9984183E4C0D2F69945E79BAC8674C3A5 +Test: Encrypt +Comment: Set 1, vector 189 +Key: 00000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7B9A8CD1942564414FE5C1237B680970A306CCB0CF73F1123D2E823D084F3126 +Test: Encrypt +Comment: Set 1, vector 190 +Key: 00000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C21A4ABA37069F7173A704B16C2DB945301BD4B08D3202BCBCA4AF8E5BA8A963 +Test: Encrypt +Comment: Set 1, vector 191 +Key: 00000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5B2F725ECF531E569AC6B69408259547B9B054CAAA20B6727FE7654FAE4386D2 +Test: Encrypt +Comment: Set 1, vector 192 +Key: 00000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 58E6E58AD73C9DA9A19CBCBCB6E89B44951781A027D5C5CBEAABD95D55BE1CDF +Test: Encrypt +Comment: Set 1, vector 193 +Key: 00000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8F076E12AB23D9CABFD006D16E1D554AB367CE88B3FDD44717824387DC9D4B43 +Test: Encrypt +Comment: Set 1, vector 194 +Key: 00000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C5A351191F18886099542CE6B3025D6F0F4EF8A9A1C804803166BC2699D4B3C2 +Test: Encrypt +Comment: Set 1, vector 195 +Key: 00000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 39BF10576DBE0BA332EF36C38CD96F4F0043B8A0C6CCCCD3521F169821CC4C0E +Test: Encrypt +Comment: Set 1, vector 196 +Key: 00000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 12EC53C9420154F7D5334D4BF94BE3B4CCB044FDF56B4A92E245F016BBE9C057 +Test: Encrypt +Comment: Set 1, vector 197 +Key: 00000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 569D436AFFBB65451ECFDDDC7BABD5608BC183E9437F30B5058C505158BCE7EE +Test: Encrypt +Comment: Set 1, vector 198 +Key: 00000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4E53AA49C4A8E0A00FA51E3DBE4D6BD6ABC1505C2E3FDADAC282BBDF5987E075 +Test: Encrypt +Comment: Set 1, vector 199 +Key: 00000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E0BF45509232C9F66517F057FB01C2E0E08906842B59DA4980413F629388C088 +Test: Encrypt +Comment: Set 1, vector 200 +Key: 00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CC5A42F9BBCD1A5BE0D8EAC69A184E1693AE5F1C9FDAA05B8CB5330D5D63A2C0 +Test: Encrypt +Comment: Set 1, vector 201 +Key: 00000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4247A5AA925AEAF29EA9FCC3C942DC47FB1A13213B302FE0C6F33243C631D2A0 +Test: Encrypt +Comment: Set 1, vector 202 +Key: 00000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DAC043890BB61728CFC30E3A860BFF9474DE05CA104C242BAF498344470319B5 +Test: Encrypt +Comment: Set 1, vector 203 +Key: 00000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 214703F986092730BDF01020A825628FD06CD22C9F385CE14BBB2738A38A1E94 +Test: Encrypt +Comment: Set 1, vector 204 +Key: 00000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AD3EED667396E27E4EF749BE1BC2D222380AA5C070B7246EB3A8249D9003BE1E +Test: Encrypt +Comment: Set 1, vector 205 +Key: 00000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 57B33C626E776BAAB8D655DD93125D49BFE92177BB63AA9902A44E4CC6F90666 +Test: Encrypt +Comment: Set 1, vector 206 +Key: 00000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3ABEB777D6240D198677B50B14545714D71D2F46885513688406B201F689C3BD +Test: Encrypt +Comment: Set 1, vector 207 +Key: 00000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0B9E5A4358BCD0CA1AF306274CA676B515499878D2ACA0AD7865139D36910018 +Test: Encrypt +Comment: Set 1, vector 208 +Key: 00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9EAB0FE92E1B83FAE87EF6369BD0EED91D10DCFC5810FA0188D06929CF927422 +Test: Encrypt +Comment: Set 1, vector 209 +Key: 00000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BC205D90F13A69AA6C45979861B1E5737A69C61F726D252F773E528276B9F1B7 +Test: Encrypt +Comment: Set 1, vector 210 +Key: 00000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CEB885427DF7C988804E7C2401BD703CBB8F3D3D50AFD6CE9F56D32F802F8219 +Test: Encrypt +Comment: Set 1, vector 211 +Key: 00000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C61CE53D0A5E771E6AC98830D496079A34ECE8967D737D0EBE393E7549679BA3 +Test: Encrypt +Comment: Set 1, vector 212 +Key: 00000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 842F934F9C3E9690F3AABC753B6C27F7F3EF7B199ABFDA287686F35E2884A2F5 +Test: Encrypt +Comment: Set 1, vector 213 +Key: 00000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: EE357FEC92355A11FDCE30B089E4F5918A90025832DB3562C762A8421F3B6625 +Test: Encrypt +Comment: Set 1, vector 214 +Key: 00000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C9CC50B7CB29557DCDC64C995B24D2E0E8AD8FBB4906A8DF06D67A69B1AAB8A6 +Test: Encrypt +Comment: Set 1, vector 215 +Key: 00000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D6DE0F6B51BCBDA8D44D7EEA5F91C85B78F42B6612A35662CE3AB3043E87701D +Test: Encrypt +Comment: Set 1, vector 216 +Key: 00000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E3F3E3A5317DCBE044E1A97CAD714449DF0F8E9C319F5C12C19917B2F47F1FD7 +Test: Encrypt +Comment: Set 1, vector 217 +Key: 00000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3A1A26993055B3B30BA84236212646D2622680117D2813316223EDFFA1BBB22B +Test: Encrypt +Comment: Set 1, vector 218 +Key: 00000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 192EE13F6909D98437E8F424DE7DC873D82330DE64B379F3F8985658B00033DA +Test: Encrypt +Comment: Set 1, vector 219 +Key: 00000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DEB92C0159D40548317AEAF996819352F43CB1E487885A0851234A43E4C5CB2F +Test: Encrypt +Comment: Set 1, vector 220 +Key: 00000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C671DF68881157258EF58E7C7E712351FC9D743A2C4ECAAC9D3ABE98F9701B3C +Test: Encrypt +Comment: Set 1, vector 221 +Key: 00000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7A8BA935035DFE8F1DE34EA373FB60E147E6D5572686212BF95B6E0C115D15B8 +Test: Encrypt +Comment: Set 1, vector 222 +Key: 00000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AA95483043360A3CCD5E98C8D5088F9F7154DA3E36F517C459F03B94EA8B5DCF +Test: Encrypt +Comment: Set 1, vector 223 +Key: 00000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F716EF1B45585282C50AD6EB1EAD2D19AFBF57235E5D56A015882C55EECC2044 +Test: Encrypt +Comment: Set 1, vector 224 +Key: 00000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CECA215484E90CE7AF49BED4B5F84543D05CE120973EE8510E0A410FA391BE3F +Test: Encrypt +Comment: Set 1, vector 225 +Key: 00000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5AF45DB110A67D0CC49D1A1BB5765ACDDD6482BD88664A4A511BEB8DCDDC08B3 +Test: Encrypt +Comment: Set 1, vector 226 +Key: 00000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E0AFCA91B3CCF0A0C4E332C4F75BC17E5956B0F3A438F0B0ACA0E9B08DA9A1C0 +Test: Encrypt +Comment: Set 1, vector 227 +Key: 00000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C559C00EB5C49F2321975A264F855C291DB8FF942FC4617193236318D55DA27A +Test: Encrypt +Comment: Set 1, vector 228 +Key: 00000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 88BCDD04989FE085F888A57176463662C57DC70DD3888F427B68BD5A36C3297A +Test: Encrypt +Comment: Set 1, vector 229 +Key: 00000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3C6302F9C2C8997C41FA0F0187B9E19D14FC2196A001D39F56BF5200E76D4F66 +Test: Encrypt +Comment: Set 1, vector 230 +Key: 00000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 641DA3FF9CC2C5AD625FD131D91E1AE5AD3088DF404384BD885917FD1AFDB9AB +Test: Encrypt +Comment: Set 1, vector 231 +Key: 00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1A05DEF28E631857C796D665FA66F8A4743F9A340904EC1C084AB022E63E3A0A +Test: Encrypt +Comment: Set 1, vector 232 +Key: 00000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 04DF8F3469AFEA2F63ECA1FA64FC18F1E42B42F7666BDCBFE6CC1C68614D85A7 +Test: Encrypt +Comment: Set 1, vector 233 +Key: 00000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 21AA974CF45CF84383024A8E7D3427BCD9A0A4F4B2AA83FA44911615B2D9A27E +Test: Encrypt +Comment: Set 1, vector 234 +Key: 00000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 74533E9973B565E0B7F9DB65A63B70BC5840EE4E1B6D927033CC1F733BD78AD1 +Test: Encrypt +Comment: Set 1, vector 235 +Key: 00000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E818E22E590974A00FBF40C1A1DD100F5C2E3A76C594D129DDE0C9119CC1A836 +Test: Encrypt +Comment: Set 1, vector 236 +Key: 00000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 00BEF3BB9263863455A8736A114E7DF13C903D6D9FE065FED48E6634EE9B9156 +Test: Encrypt +Comment: Set 1, vector 237 +Key: 00000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A0D418EAA61D8B6234D8B07D4652F61EDA48B00764E124DE5D7545973E4BFB0D +Test: Encrypt +Comment: Set 1, vector 238 +Key: 00000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 21472EDC58EB9D2EDE5D8A24DE18784500420820C388408E2D09C8935D3208CA +Test: Encrypt +Comment: Set 1, vector 239 +Key: 00000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 278849105940CFDF61AB8DF9A37427A24BD452C244988E7CE85B8FF94A913F71 +Test: Encrypt +Comment: Set 1, vector 240 +Key: 00000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7B35DC73EBA6408C2486D59ADA0A17B89ADC10E405E029E51B8FA7096704DF23 +Test: Encrypt +Comment: Set 1, vector 241 +Key: 00000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D81FC2305382B4110925F4EEEE6C93C3356B30F4E083B47C0FFB429DC8A317A5 +Test: Encrypt +Comment: Set 1, vector 242 +Key: 00000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B1CC26F822DAA8B4EF2DC5C08792C21A985D285697C9BC49E038331996F2DE35 +Test: Encrypt +Comment: Set 1, vector 243 +Key: 00000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 565635B8CF39652AD3F94F9658FBF2310A08DC25975102D9E0A658574E5437C6 +Test: Encrypt +Comment: Set 1, vector 244 +Key: 00000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3A9E77725182484E375528415C99C9BB2795A0841FD9F7E7D2DDE20A6CD71C04 +Test: Encrypt +Comment: Set 1, vector 245 +Key: 00000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BD3F45893A96EF8C218B3C22079E64BF847F3C41D87F1AC68E62B32E5A59D350 +Test: Encrypt +Comment: Set 1, vector 246 +Key: 00000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 44BBB67723B8FC5778D18FFA60F1A7DF16F2A4583BA07E3B2A9A4286765AF743 +Test: Encrypt +Comment: Set 1, vector 247 +Key: 00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 06198963CE32DC41A3869CB3893E1602D21EA64DD206C2DEA9FA79F756260BF8 +Test: Encrypt +Comment: Set 1, vector 248 +Key: 00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 82EA3EC56648E3152D541EA5EA76F9C1D12A373D5183CFFDBC49C0FCE25AC9BA +Test: Encrypt +Comment: Set 1, vector 249 +Key: 00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2D6F44E5104C9A6B28DA5731FE95AD5ED73051B4D405FCB77D2845A3306CD9EA +Test: Encrypt +Comment: Set 1, vector 250 +Key: 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 360DF8BA5BA3F245E4751C6B1D81CCCC7160D6DE8CB12B496DEF04A78B0D3DD6 +Test: Encrypt +Comment: Set 1, vector 251 +Key: 00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BE0B2DE97E0528C5A135A81F2DA7431C8BF01A456411CB826F1205A9E57A44D2 +Test: Encrypt +Comment: Set 1, vector 252 +Key: 00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4CC729EFC23033F244182FBAE629ABF4386CDB279C6394C7CC914724604D8736 +Test: Encrypt +Comment: Set 1, vector 253 +Key: 00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BA44E9372A4EDC847FE6601F0DDBCF40864B2BB5C4EFF9B3038F7EAD6672907B +Test: Encrypt +Comment: Set 1, vector 254 +Key: 00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DF3109ACA9E8546F5140E6705EDD69EB5512F0C5B3567D6EE132700820839B77 +Test: Encrypt +Comment: Set 1, vector 255 +Key: 00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D909866F49103120A46CD4F2A98B2A2169E3E9AE7BB5AD36CEBD675F62B73018 +Test: Encrypt +Comment: Set 1, vector 256 +Key: 00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 63081A9DE55FA28CFF0089A3D4A52568BFC0D3A172B1750180A91BA12EC3E38A +Test: Encrypt +Comment: Set 1, vector 257 +Key: 00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7FBD9ADE476739C69CF906B611639D554ECF25BA26AC87A11EF30856DE890D28 +Test: Encrypt +Comment: Set 1, vector 258 +Key: 00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 495FB031327D3AE9CCA3F449E73571539EF9FD88589B5C3142F5A4461CAFF9F1 +Test: Encrypt +Comment: Set 1, vector 259 +Key: 00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1E958BF17F89DD463B49BDE9B05D01DC2557DC4CE072C24D0527E45BA1C8026C +Test: Encrypt +Comment: Set 1, vector 260 +Key: 00000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 92093F21E7CFDCD81765E71ED960121F84C6FE1CDA50B00592ED0DB9A8808FFA +Test: Encrypt +Comment: Set 1, vector 261 +Key: 00000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 122E0C5E19B0636ADE10F1A14FF4CA69EC426B4F311C109F6B137BEE274B1912 +Test: Encrypt +Comment: Set 1, vector 262 +Key: 00000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2CE82AD1BF9BDA86355188CF5605CEAB73E98BC617CDC3D5C8598F11BA96F6A5 +Test: Encrypt +Comment: Set 1, vector 263 +Key: 00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B14A656DB71E54DF9D443E899417FF4F79E033106AA34D8669EEF0E9918FF4C7 +Test: Encrypt +Comment: Set 1, vector 264 +Key: 00000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 47ECD5C02C3D702FC36817981781B1A4593E240773121F763EB788D46E990C5C +Test: Encrypt +Comment: Set 1, vector 265 +Key: 00000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 91B74FC5E6FC8C6C30F33CE83BC0055190373FC589C0516F248227531C6B853F +Test: Encrypt +Comment: Set 1, vector 266 +Key: 00000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AC8F0393E6D8881EFF753E7CE47EC441106AFE1315E712BB439F2F2DD4318670 +Test: Encrypt +Comment: Set 1, vector 267 +Key: 00000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5765316B484E3091FB5135ECD4A5356293BD87512688EF14C719B61857767E1C +Test: Encrypt +Comment: Set 1, vector 268 +Key: 00000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FAD76A9798E8DD194095DACF92F83779DEDA70C413033DADEE55B4C94B98B426 +Test: Encrypt +Comment: Set 1, vector 269 +Key: 00000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 87F337C9D5763F38C679C5EB9A67F72B4581487ABC5ADCD5BABF4C71B5EB6F7C +Test: Encrypt +Comment: Set 1, vector 270 +Key: 00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 526B4C3E3FE096F47D32A403A7D20EE269A42F68939B2FA8254A1812D9EC6069 +Test: Encrypt +Comment: Set 1, vector 271 +Key: 00000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 342C0D2D0A5048DC98F2E8CDBB84CC610E30BEBC12F7572CB416CBFCFA24039D +Test: Encrypt +Comment: Set 1, vector 272 +Key: 00000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 47D03635744E2D917F799F77A7E09E6F064CE224A4A1D507090DBE200DBD022A +Test: Encrypt +Comment: Set 1, vector 273 +Key: 00000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0DCE2CCCD9628DD4F6552A020B9447D35DEEFCFE5D8CDD8223AB3BA9090D8141 +Test: Encrypt +Comment: Set 1, vector 274 +Key: 00000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AC5622C3DDECDB0A46F796596ED595926B2783E6A884D18517F7344CCAB3A2C0 +Test: Encrypt +Comment: Set 1, vector 275 +Key: 00000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 80E59C358DC6F0B5749FEAF45A9BE7F884842839EE6B47024083F52A8636C2A6 +Test: Encrypt +Comment: Set 1, vector 276 +Key: 00000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8E57504AD8F6DA6D8633D413362E961A6D69B18FA1B501DB846080A5A9C9C700 +Test: Encrypt +Comment: Set 1, vector 277 +Key: 00000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4956C679E9B58DDE2185BB018A7D6C61C918FA0AA9D6102E7DEF1183DB768FB1 +Test: Encrypt +Comment: Set 1, vector 278 +Key: 00000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2C25F9CD0DB2444EE43D0AD2C3AF0303D1487528F45AFD346617D164F80635B9 +Test: Encrypt +Comment: Set 1, vector 279 +Key: 00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5292E96CB2110AD3FD231C5B2BCD1A8986333787664D1A551B9B750B2AA39A11 +Test: Encrypt +Comment: Set 1, vector 280 +Key: 00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D189129077C79106AEACA4E3463FD0650AC493ED981DC252531C072F18E1E292 +Test: Encrypt +Comment: Set 1, vector 281 +Key: 00000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F9490DB8BAE36E28E73419D1D57869D760D772DC8752D1DE948262755B4ED503 +Test: Encrypt +Comment: Set 1, vector 282 +Key: 00000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 994EB2D9BE7C9FD547426F295F15DE3BC8F4A2B3955C7028ED890B1DE0FBE21C +Test: Encrypt +Comment: Set 1, vector 283 +Key: 00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 464BFD1EB42B595AEF9700C7C4C184A2132B5F1E85625592E48A233FA7840EC3 +Test: Encrypt +Comment: Set 1, vector 284 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A097C32D58D5A932AC9DBEE942DCCE547222E37E97DC3B29A63AAF118D5B01CF +Test: Encrypt +Comment: Set 1, vector 285 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D3D13CC4379D2817B8CF8E06312FC727A3BA3C58F96E478E4EC5BC7BAEDDCDE4 +Test: Encrypt +Comment: Set 1, vector 286 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 577C709C26BD52547BD7C0D3F9CDEBEC0F266178905C4C067B75A01D799EF910 +Test: Encrypt +Comment: Set 1, vector 287 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 08FCEF6A263916C53AEBB6CCD2623E7BA3C38C871C5A8B64106308B74A7AE1B6 +Test: Encrypt +Comment: Set 1, vector 288 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A22F794F4913B2B1CD930FA26EC219081F297DE4EC808771C9B375782F891D67 +Test: Encrypt +Comment: Set 1, vector 289 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 52F2C9714DAD06FCF5FD8962131D33952A6D68C2A90B8C08C3AB86B09A2C77C5 +Test: Encrypt +Comment: Set 1, vector 290 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 60BDED5533E692A9F073AAED43A5D5A81378E73A953514ACD5B0997B61848E3E +Test: Encrypt +Comment: Set 1, vector 291 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 38921BE2443A8101FBB44BCB4C5B87AB5026AA34C78B7FCDE07E102E142B6162 +Test: Encrypt +Comment: Set 1, vector 292 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D49C075CC20268EE889A10E27F2D4EAA99A1764F765621FE97687ECB6067E5AA +Test: Encrypt +Comment: Set 1, vector 293 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 50FC6782B3285D35117C0FA81039A7F264FC4EB492F3B86A233D45F2834F153A +Test: Encrypt +Comment: Set 1, vector 294 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1CC0B39D670A88D424F5D40B2F9256AF3736689BD82F0EB315AC9056F7EC63A0 +Test: Encrypt +Comment: Set 1, vector 295 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CF66C3CD4B08CB0E4D25186BF84BE3AAAB1C435F07D12593AD001F70894030FE +Test: Encrypt +Comment: Set 1, vector 296 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 352572656D0EB6E0CE604C1A913ED733D465A480504B61B0F9BBA77122FD20D3 +Test: Encrypt +Comment: Set 1, vector 297 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 096E9F34E6E277EDB994954C3705F6904452001D3A3E799A1D0230D430E207D7 +Test: Encrypt +Comment: Set 1, vector 298 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 277BC612F90A6D0735B86168C021098F134D1627D0FEF38607038415D1BADF84 +Test: Encrypt +Comment: Set 1, vector 299 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2376E2CE884AEC093E22A3C119D573609225FD5DC9B3EB7602C340D1AB51BDF2 +Test: Encrypt +Comment: Set 1, vector 300 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3EE2E39ADB49F92D09D55ACC817B5B2F22FB202951AEFB6DE8998D2932145669 +Test: Encrypt +Comment: Set 1, vector 301 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E508313113570BBB5A1E63F46AB52B57ED0676A061936F093961D34409F1B962 +Test: Encrypt +Comment: Set 1, vector 302 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 198A9A0A5B04AE936CB19E02A5B2A254A2DD5A4D71F6C676C0A826CD261CE8C0 +Test: Encrypt +Comment: Set 1, vector 303 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: EFEB9C3D34865B89275EFB9DCE1929697FC9E68ED9E9E32E2CF267DE57388E77 +Test: Encrypt +Comment: Set 1, vector 304 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 61016E27DF83D9DE642AE01D7D56C4BFE881C8BDEDD15C503BDC28D3F7107754 +Test: Encrypt +Comment: Set 1, vector 305 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2FB5FDEC05BD94EF5A7F0DEA7A368F7C2B26ABC5789FEAE7B7B6A5E6C364041C +Test: Encrypt +Comment: Set 1, vector 306 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F765AE08A03CF705D4BE6A6AF8A34CDE7A14F599B2CB7E2FCF2770F0CFD4F7AC +Test: Encrypt +Comment: Set 1, vector 307 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D38105C4DE4742F16E6AE7C1C3C85A515DA8BC758456E4B5D64C0539B76D473B +Test: Encrypt +Comment: Set 1, vector 308 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BFE3A705729C82DDE1297DF492A8F8ABAFBF2F436830B3716FC206D6931BBFEF +Test: Encrypt +Comment: Set 1, vector 309 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B81E7CB312AC5FF0A1795FCD4AD8B3D84FE6C8B796584DE794B7E230823E6AF0 +Test: Encrypt +Comment: Set 1, vector 310 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 605C8D477420CF7D8218CB8A6B3624700BADE8D1384B04995F3C942DE38ABA6D +Test: Encrypt +Comment: Set 1, vector 311 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 87A3F6DC69A7675F27CD00D7A84251366CCCA92775D680EBEBB48B92A5781D7E +Test: Encrypt +Comment: Set 1, vector 312 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 71625BD75BF6A89C643553D382B325EDACCFB4BF5F1617DED0C44BAB96A9F72D +Test: Encrypt +Comment: Set 1, vector 313 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: ADF64E64C1A8D854C421F5AA8CCBE789F3643B0D769A2CDC68D7C3AC85FDB634 +Test: Encrypt +Comment: Set 1, vector 314 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3C1AB3A3A85B1EEAA057557DBB59FC28479B38BEE67F4CDA0CD49880DC15ED0F +Test: Encrypt +Comment: Set 1, vector 315 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 026071B93A8B85F000539539626BBF664273EA701B63D487208962F8CC14F1DA +Test: Encrypt +Comment: Set 1, vector 316 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 61EC580BC31488BD8993C9B9D6B430BEBAE04F9807F199808CF05B0B4F083F9A +Test: Encrypt +Comment: Set 1, vector 317 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DF9093A33937B0B3ACAEAC1840C8E1358CC90FB0B6C0834D4CE4F442830127B7 +Test: Encrypt +Comment: Set 1, vector 318 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5683A2E768F9E105E9ABF7B71DE48833367D19E961D9D95577D2C4E48716EE9E +Test: Encrypt +Comment: Set 1, vector 319 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1D33978B4B75C10ACB850BBD98BB2CCB31F7D6F561E34AABAEB929C2F7762219 +Test: Encrypt +Comment: Set 1, vector 320 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6197C557619E4B791888DFD695B4BF55B7F72258968E26B9B74A6A3814267DD2 +Test: Encrypt +Comment: Set 1, vector 321 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9AD5C65433732C4ABF08BAE9015692F509775FC0450677CB1E76A060974B8807 +Test: Encrypt +Comment: Set 1, vector 322 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 44AA2FB88757EA695083CE00105D5B77C2DCE04EE1315D99040A1495E97EEB42 +Test: Encrypt +Comment: Set 1, vector 323 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9C637BA9B011A62B15BE522D6C514092358222CDB01A2A35B895B1E57DF1303B +Test: Encrypt +Comment: Set 1, vector 324 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 21774A71C07FC295C4BF477A512445B2AC9AFD6619DCF0124CBD735BC823F945 +Test: Encrypt +Comment: Set 1, vector 325 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3D74A1E781FEE340DD9D912F6A681F85C0EF78BAE81D3E50A5DB8A311057DCB3 +Test: Encrypt +Comment: Set 1, vector 326 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5B851E24E32EEB5BFAB09D26E86BBE4DA23C43C8E88635413516825D1F56DC43 +Test: Encrypt +Comment: Set 1, vector 327 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E79FAFD3076C0F879222F86A0671104F350B115A6AC107F5C66BB673CB047948 +Test: Encrypt +Comment: Set 1, vector 328 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5E8EBDFCEF4F70640695CF76FE7912F5E77F55095F0A3EC15CE692AED2C7312E +Test: Encrypt +Comment: Set 1, vector 329 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 99EC9D6724631EBC582C22B1B002C8F63B386EF1A96A9E4D162F698F3EC13944 +Test: Encrypt +Comment: Set 1, vector 330 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9DCF4937F7E089B09AF8F441538E2577E315212AA56EB20209F040BE602509C3 +Test: Encrypt +Comment: Set 1, vector 331 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 063CE595D4EEC463726FDB74E5254B5AFB965D2729D02F1890E70E33C4C7AE49 +Test: Encrypt +Comment: Set 1, vector 332 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 18F5B3F2F2B54FF37C354F3181228FBAA7D337791671988801C19333165EAD35 +Test: Encrypt +Comment: Set 1, vector 333 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 912671C8099032B1C0AE139D8F029B153B22B999DC30170DAAE3904CBDEFF083 +Test: Encrypt +Comment: Set 1, vector 334 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CAE46BA93F81E1AD26A8FACE45566E162B8F4CAE831B4B80F93D2A809D3C557D +Test: Encrypt +Comment: Set 1, vector 335 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 31708CCF07D82433A61053273FBC5543BAA1A73B836624FF092361E55631531D +Test: Encrypt +Comment: Set 1, vector 336 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B5F46BFA7B367DCE7998428525483F775D8F5F1A8DB9F7E3EB848F887283028A +Test: Encrypt +Comment: Set 1, vector 337 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1D1B9489F66B8FDC1902C02CE15E94727352C2F6A302C12A6F9672BC44014F6F +Test: Encrypt +Comment: Set 1, vector 338 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8EDD86FA2225D954B3F9F57A0433ED692E99F7ED55EF0A8D112468AEA58717A2 +Test: Encrypt +Comment: Set 1, vector 339 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6F1414CBA350BB5DF73F7B23FCC0859BC2F081374BD4FBA7571DEC9343BD939A +Test: Encrypt +Comment: Set 1, vector 340 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 84535A21BFDE843B9E70AEEC9E5EB915FCEFF57449B7872142AA0669EFF250BF +Test: Encrypt +Comment: Set 1, vector 341 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C4CC653F5CFA6C13C4693967D4CD1398B8808982F0C1D6D9B4CC9A6FCAF41E8B +Test: Encrypt +Comment: Set 1, vector 342 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0949688EEF8CFBB88589CAB3EF58912A2C413E413EF122BB7F4C0E17BF723E71 +Test: Encrypt +Comment: Set 1, vector 343 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AFF2976C45A69940BB88C71381DAEDD767BAF454331FCC5666624EB052CE05CD +Test: Encrypt +Comment: Set 1, vector 344 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A7D73428AA840EFCBFF0C856409C9B19CBDC19BE376EBC75DFC008A6BC9EAB37 +Test: Encrypt +Comment: Set 1, vector 345 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3C59AA18035D96933FB938DE0331DBE42DA57B539A77D660DBFA12B62611760A +Test: Encrypt +Comment: Set 1, vector 346 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1F982024A86CEBEF27F0D19765907131C5EA1385761E92C7432D55A118AF2FD0 +Test: Encrypt +Comment: Set 1, vector 347 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5D5CE5B2BCEC679BEE0B894E4E0FD2E5ABD345D8F8061A02BD4B1873C3A9B612 +Test: Encrypt +Comment: Set 1, vector 348 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 54C62940FC9BD4D96A0D19CE92F6880B5F45A422DF0400E868020ED5B42BC287 +Test: Encrypt +Comment: Set 1, vector 349 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6A7B7E894CB7FE3A0153B5CC6E78351A07AEC726CCAF93A2C426C83760974035 +Test: Encrypt +Comment: Set 1, vector 350 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D2DAC7485B1818A7A2976F164C80AB5FE47B7CBDA4048000D09DAC65857A8387 +Test: Encrypt +Comment: Set 1, vector 351 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7C545CC73456F1C1B06C5B5A05A9659F5D30A4D78E9D85C29A38735BEF098E0E +Test: Encrypt +Comment: Set 1, vector 352 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7E3FA28ABB96C7CFAC0DFAFA5BF2E469D75ECF690FA876F3307D851D3CF0AAC4 +Test: Encrypt +Comment: Set 1, vector 353 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 46FFBA6995D7D6A2B58AB5F995AE3A305CB0385242428FD092FE777556AB05B5 +Test: Encrypt +Comment: Set 1, vector 354 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 052E5126AEDA420CC39EEF255B816BD475DBD36635B090D04C43410F40236BE2 +Test: Encrypt +Comment: Set 1, vector 355 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 80BBBFF3EB0CE3976503A85240226D7FE177B4F30C753F081D7E1F3F8F0FC176 +Test: Encrypt +Comment: Set 1, vector 356 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4A748837D0A7950876ABC89127A6D6FE5B646C7FE9DF8005CBBC3832DFE488EF +Test: Encrypt +Comment: Set 1, vector 357 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 84F35DFA249674C24E6DFB3947E3F3475817DF9548B301D4741B79EF9D26629A +Test: Encrypt +Comment: Set 1, vector 358 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BEC48DE878DD3533F3614B3A0A4BDF5FB34DBA96AE94508FC0D3927032CC6E61 +Test: Encrypt +Comment: Set 1, vector 359 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 80DDDED6AF53DB0459359FE311F32C5DFE85F281C45365BEA7A2D6BA8A2D5EA9 +Test: Encrypt +Comment: Set 1, vector 360 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 43BA1E833A673FB760B13DA40C509EBB7170CA05E7BD2728A7FDA0EB8E3020B8 +Test: Encrypt +Comment: Set 1, vector 361 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 917FDDD2206E751DBAD9BD2EAA3E1FDD7C6CFC7782367B563DE6E116D0E4A3B9 +Test: Encrypt +Comment: Set 1, vector 362 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3AD03FD2841A7C8E8BA49100FCA794DAAF29995A9CDCC6D4F868914C890C3BFC +Test: Encrypt +Comment: Set 1, vector 363 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 79A9305A48A10F739B06EBD24DAACBF5289ED6A83415021DB1CAAB542E417DDB +Test: Encrypt +Comment: Set 1, vector 364 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 195DA96825A0F6B94A71E2EDD934FB184F375EEF66411567815A4A6E966CAC0C +Test: Encrypt +Comment: Set 1, vector 365 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 513239A738978DE007138E83F5CD13A0A9BE374CF61B09021767CAE284D5510E +Test: Encrypt +Comment: Set 1, vector 366 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6BC70608C85D884873CDE727CF2B8A4E9563DA58242C907A3E87C2608AC0F1F7 +Test: Encrypt +Comment: Set 1, vector 367 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F47D47E5D0013BF10141C7BF92642E4CCCF8020347B59F1FAB145849EEF0A2E1 +Test: Encrypt +Comment: Set 1, vector 368 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 879D4097A300F6575BC2021F218E9AE9FED113AF9B4FC9179C621244A9E2A090 +Test: Encrypt +Comment: Set 1, vector 369 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 91EF2BE82D9080A366AC7C4344E457E5F46DA5BD54DD50C97D2910D1478BFA21 +Test: Encrypt +Comment: Set 1, vector 370 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0EED2315EF9B9278CCAD8EE2E33493F5A4FDAE31EC1DA863C017E8AEB77C2867 +Test: Encrypt +Comment: Set 1, vector 371 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FE80FF0F839BE1F911A21C97B36D439ED66F9965293890D98D8A3A98F2CFAE1D +Test: Encrypt +Comment: Set 1, vector 372 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4E241C22B26385E268F868E37873C36B173625048DAAE4ADE3C2E09D856A8AE9 +Test: Encrypt +Comment: Set 1, vector 373 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 71DA83DEC321D3160433BD8E2C2345921A6505444C9B1949B4D6CE400F1FBDBB +Test: Encrypt +Comment: Set 1, vector 374 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 21FF7AA748E96269211F129671E4F7A25BC55D92A144B7BEEB75F445FDCCDDB3 +Test: Encrypt +Comment: Set 1, vector 375 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 070290F0A10324414DCFD323822ABD2256ADDA0913FEDC70EA53F3F88EEB7AB2 +Test: Encrypt +Comment: Set 1, vector 376 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A112192AEDC7824247A9239BE92E45928416D086FEA09D4370DDFE862493AF4E +Test: Encrypt +Comment: Set 1, vector 377 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B0CD1E1BF87C1C63C455C8A285DF739A85706A587CDF0726C4615590DD25BDDE +Test: Encrypt +Comment: Set 1, vector 378 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F5EBFED2EF7706C5DEF09E94641FDA500100F500E431C601C879CC65CE260DF6 +Test: Encrypt +Comment: Set 1, vector 379 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 02CA5B7EAA7F906B706DD5B13A6C121927EAE22FB51C7259A781A916C5906E7D +Test: Encrypt +Comment: Set 1, vector 380 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 10569B20052606FEEB9956C2882702477F1D48F82B09C0BE1C97C3150F5F7D1F +Test: Encrypt +Comment: Set 1, vector 381 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 95C649C5B1ADCE59BE93F701C01D815D7A32D151179FC1B6610B3A2A98EE1295 +Test: Encrypt +Comment: Set 1, vector 382 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7E1DD644C151A0C1055E0AEB7A9DBE80BE09CCDE6C69797D00E7B391A6311D1D +Test: Encrypt +Comment: Set 1, vector 383 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6A82511AEBE5A82B6392CCA180B10F77FF0C14A7CF8CED894E1C8EDF9BAB29DA +Test: Encrypt +Comment: Set 1, vector 384 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AD05B4B2F644469BCCD1BE1D028B1FB26F270088E56D8B73364F958730B0C9D7 +Test: Encrypt +Comment: Set 1, vector 385 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8B4110E53906CBD07EC61AC8DC8C97C475085AE6AE6418C45CAD7495B2C2F4A9 +Test: Encrypt +Comment: Set 1, vector 386 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FC44F97B9B3791B98D941B460C585BC7A485024F2B15370605FA64BEB36F10F6 +Test: Encrypt +Comment: Set 1, vector 387 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 95E1B79F255E9E477D756B0123F22397C723D63F3D6AC710A1647E5D6229AC25 +Test: Encrypt +Comment: Set 1, vector 388 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 523D59EEA567CAE613403BE8C8769E9E375F290D7FA2DFF64C9B41120E96F0C0 +Test: Encrypt +Comment: Set 1, vector 389 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DCD843BF9123A86C9938CB833C815217E37325B4ECF9A43E8E878ED2CDB257E3 +Test: Encrypt +Comment: Set 1, vector 390 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4D737BB7B6B2EA155FA64CAA9124588594AD9D3239B03A0B5F1A1670EF37C309 +Test: Encrypt +Comment: Set 1, vector 391 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D884858B07B3ADC2AB0067E24CEF443AF6D3CB691C7D3EDDFAF672763DF6991F +Test: Encrypt +Comment: Set 1, vector 392 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 24923E668BA92F02D0545738A1F3A81AD3EACC6F3E65A3C6879FEB3D55C3BEF5 +Test: Encrypt +Comment: Set 1, vector 393 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 98006EC6FFEE6DC3FE9D53FC632D1D82E8DC5BCB0BE0BBF1782701F858934432 +Test: Encrypt +Comment: Set 1, vector 394 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1C7CD45E2FDF746F2F6B7FCE3510DD14CAC7420FDA6BC9C6D3287E894D2B9EF5 +Test: Encrypt +Comment: Set 1, vector 395 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DF1B2CD5A9A7ADC85A257882E53150F9B3BAD4B5EFEEE8B4B212F8FB08F11194 +Test: Encrypt +Comment: Set 1, vector 396 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5DF3202330B96E2C8D45284BC1D8CC34C076B18600495EC43F847D09B9AB08C2 +Test: Encrypt +Comment: Set 1, vector 397 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CEE878EA6317D3B4E2CC695FCCC5EE04B7415B735F2D11B9A8891293D5D5E818 +Test: Encrypt +Comment: Set 1, vector 398 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3753BC3550155B6880CF1AAE6365FA5EA4F277B4E01FD26133A5C69F5620AC9F +Test: Encrypt +Comment: Set 1, vector 399 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8FF623E4246D8B7D14904BFB478256CA55EBD9E383B672A91D512AFD606BA629 +Test: Encrypt +Comment: Set 1, vector 400 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C823B856B5E462FAD71A1D9C8F02CE1FE48650BD53BD620D021ADB1C53C21B84 +Test: Encrypt +Comment: Set 1, vector 401 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 22D0CD94534D8DCC359095D77008069E57851298103A13ACB50BF6FA778CB9A3 +Test: Encrypt +Comment: Set 1, vector 402 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 413F7657C9E46D928AE307FE794D1B10FEEB433D7F829C66118E155227F811BD +Test: Encrypt +Comment: Set 1, vector 403 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 12A9E9ABCC1916594307C982852A6750FFD5D9DCFDA261EC54C2D465BBB0FB64 +Test: Encrypt +Comment: Set 1, vector 404 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: EEB4897AEABADA871D368A00748CB437801933D78A14687EDDB3D526BBC2BFF7 +Test: Encrypt +Comment: Set 1, vector 405 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2444A95492348F7AB5C8EFE89839C6491833EF227637640F8199262DA70E5406 +Test: Encrypt +Comment: Set 1, vector 406 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CD0F1C806CE40D9901A04A23B52BBCFF51D20E964BA2ADCFE9AEE7CC8FE4A3B5 +Test: Encrypt +Comment: Set 1, vector 407 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 30E58CD115B75139A5D2ECC5253F6467FDEF4DFA307D11132570F90E657BC254 +Test: Encrypt +Comment: Set 1, vector 408 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 563FF22D971BDFACD7A90EDE80F076126CB16A759FDE6DB83E0DEE71CA48F33F +Test: Encrypt +Comment: Set 1, vector 409 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D235A2277B7D3A772C3D092D2E3D92248865EFED8C2577D3D087C5BE84891667 +Test: Encrypt +Comment: Set 1, vector 410 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3CD74A025D1C2044875FE1D97351608E0203CE65F2EB283633505AFDC3C6393B +Test: Encrypt +Comment: Set 1, vector 411 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FDAAE4CA8FD698D4330AD8217D40C8368AE9A825BE3359CB881FA74315ADA4DD +Test: Encrypt +Comment: Set 1, vector 412 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A9BBBED3051D1EB40AA806CF6505EBB4A0D3BAE671AFA03BD2586B01ECC6B9AD +Test: Encrypt +Comment: Set 1, vector 413 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 468AC86525069F4A9F1F7036BB2FC3D042296707B9FE8328C9514DA52FCBBCC2 +Test: Encrypt +Comment: Set 1, vector 414 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 96498A45E45E26AA2A1DD58E7374BCDA71420627B332F94FE98E045251B432C0 +Test: Encrypt +Comment: Set 1, vector 415 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 36FB6B4DAE5EDE9971BC2F5A353A3D5954961D9C8F7D38063A9F8556881F1E1B +Test: Encrypt +Comment: Set 1, vector 416 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4206BEA972707980637FCD2B990F2B8EAE3243C9178487047B1A9BE2C7F6225C +Test: Encrypt +Comment: Set 1, vector 417 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BF2763F46F4EF8CF40E42B6E4F161785D3478BDD1EA0BFAB30763B98BBC64720 +Test: Encrypt +Comment: Set 1, vector 418 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E7B97A297B534B1842528055982B7C382CFFDD161D69725789BF0CC35339D0A8 +Test: Encrypt +Comment: Set 1, vector 419 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F8E68E206729EDF06C9379DC6F87891FFB6D5DD75A040D4F0E17BDF28308E6E0 +Test: Encrypt +Comment: Set 1, vector 420 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DA69958998715C7517B9864E3A81F5960A48E9071FEB047084683D95A8532751 +Test: Encrypt +Comment: Set 1, vector 421 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 99456A498166535817F3DD3B47696CC74777ADE25DFA5CB5A3DF1A47DBCF0F17 +Test: Encrypt +Comment: Set 1, vector 422 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: D2D061B7FEDCA0663FE8F738042D1CE7D0EFB3BCED73977087FAB06192A361C1 +Test: Encrypt +Comment: Set 1, vector 423 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: ABF4E053FD99A777A5C95F057A1D8D3BC433D212220FE2BD5074C7E7B4AAA636 +Test: Encrypt +Comment: Set 1, vector 424 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 335F971AF070B59191F61547DC555F2AD86B263B23AAD53A80D6DA0C8A73C6BB +Test: Encrypt +Comment: Set 1, vector 425 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C2EE398458AD869FCFB5DBAD16CB66F2CDEBE8D9D2C0FC4B258553D7D648E281 +Test: Encrypt +Comment: Set 1, vector 426 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 659BDB67C3BB43D43CF53EF14411F9B5B2B3C8C9B961087622BF1F0412596D81 +Test: Encrypt +Comment: Set 1, vector 427 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 21E2DA7422F753B1B625D95BFE5FD1C52CB5DFEDF0F2662EF17416E44F671525 +Test: Encrypt +Comment: Set 1, vector 428 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C14725058665DCF8D701BB4A3DD5490DDA85E2754D9B233C008B5FC3559837B0 +Test: Encrypt +Comment: Set 1, vector 429 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BF0D7F94DF1C7CA59CAF588BEDB316CB4E31A578B76C1E5213EB663C0E850F97 +Test: Encrypt +Comment: Set 1, vector 430 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C81ABCB56C58DB2D5A329C6777091857DA4A5CBCB9D05AD6B0D4A2D4E915A7F4 +Test: Encrypt +Comment: Set 1, vector 431 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F9D7611F502D0CED242909E032173BAF5A43DAF7009F53E25E109D7F4FEF9981 +Test: Encrypt +Comment: Set 1, vector 432 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4EC0E7F808A10BFD4676E5CCA67E1D48806F346B702B2827810487EE56907C71 +Test: Encrypt +Comment: Set 1, vector 433 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 34C183C96FE5D9D2B4ED564EE9726551B27E1AF24848B5D711503E88BECBE458 +Test: Encrypt +Comment: Set 1, vector 434 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3E5EA6B326751B501C91C4A575B0ED6AEA9D60A14908187ACB3FC145B5468131 +Test: Encrypt +Comment: Set 1, vector 435 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DA3904568BC8844CB594F44FE13F5D663B55EE6995D2232A999D591F2FCE7812 +Test: Encrypt +Comment: Set 1, vector 436 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9293ED1C3C5B1A91B54A43BC63603F2EAD345EF9A7D3E69BD955EF1B8D36FD13 +Test: Encrypt +Comment: Set 1, vector 437 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 65C5CE0CC96FA6085A23EF00299B6D8518673DC9B8BF764DB595A8A7F8E940C7 +Test: Encrypt +Comment: Set 1, vector 438 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: EF95E25669CF4079F8BA728F41BD115F2913D8CFE0116C86032CD133E4787011 +Test: Encrypt +Comment: Set 1, vector 439 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7860315B44671B93718FEAB94BBCEE6B1006354914A90C3BF2DA1B6FA62F48AB +Test: Encrypt +Comment: Set 1, vector 440 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2AA9968D7011FB1F33B97DAD01C2708A6826C030AFCCA35B222B2E47C89F14E1 +Test: Encrypt +Comment: Set 1, vector 441 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CA9DD4F0771447B9AD0664DDA2921192568C2012246CCF5E95CD6CF3FBC44DCA +Test: Encrypt +Comment: Set 1, vector 442 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 38D51B18372FD7E7A617D7BCBCC658CB16014B05ECA242AF52B40AEDF6952DE4 +Test: Encrypt +Comment: Set 1, vector 443 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 640D035CFD65FE70D089866A53F21D00F86FDB1CEE2880F9FA7D382D424978A1 +Test: Encrypt +Comment: Set 1, vector 444 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B41B62EC90FA9CC037F1BC74AEED25226917DD3B2B2E5C11EC6AE7601CF3F0E2 +Test: Encrypt +Comment: Set 1, vector 445 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A4340A36C7E640C83D2401AAE6F9F103BC9B568EF5B7F67663E64B820974B235 +Test: Encrypt +Comment: Set 1, vector 446 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CAEF6FE59B0C05DDFE4F233412A185038077B7138EE9BA5FF4815C63C2BE84D2 +Test: Encrypt +Comment: Set 1, vector 447 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F5D76FAAF12F566711DAAAC0E1F71260354FBA7BC0DBC34D7A2B6FE8E19DC672 +Test: Encrypt +Comment: Set 1, vector 448 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DB1B22D80BD5BEA8D3F5F445E296FF3506C98C6FAE617D6C8DD943BC535AF864 +Test: Encrypt +Comment: Set 1, vector 449 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DA02BA2C706095D3EB008EFFEB5E501FFF78B59EC34CBCAF0D7CE82268CCAFBA +Test: Encrypt +Comment: Set 1, vector 450 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F878759262E5C2BA6CBC2091406D4045F876767C475582965B185DC9437ADD1E +Test: Encrypt +Comment: Set 1, vector 451 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: CA268715277F1CABC2062D4EDFD667759829782F793715199EE172917DA35C5D +Test: Encrypt +Comment: Set 1, vector 452 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 01BACD8388BF42064C8E927B3629C0DA82A0FEC4883EC068DC48483C43512BC5 +Test: Encrypt +Comment: Set 1, vector 453 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3D782388FD4ECBFEBBD49F2FBCF80A687E4CC0B8FEF51F097DEB679F49CB8B06 +Test: Encrypt +Comment: Set 1, vector 454 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 392E11AF1FD4A97ED260B680930C95DF26679260EAE0C025C405CDCDBC8E810D +Test: Encrypt +Comment: Set 1, vector 455 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 10E6AA6CAA90220E6D8963837D9EC3D46F8E9679379345282573753F2093E0F2 +Test: Encrypt +Comment: Set 1, vector 456 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E3EF5E9644294206A5707EF83C54E5EF5F4DB9841383C3EB767DEA722E9B7D0E +Test: Encrypt +Comment: Set 1, vector 457 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0EDD01B5FE46475139F14371B548B58C5E33830D6EA6864BFBAB36D25345F8F3 +Test: Encrypt +Comment: Set 1, vector 458 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7DB72BFBC00A04E38DD4B9F2EA5C0114D19B2956EB959BEAD3E29DFB9BFC9A2A +Test: Encrypt +Comment: Set 1, vector 459 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7DB561AF481CC8B010BFD18A0216E2554888BBDD4E90B00476809B48601C9306 +Test: Encrypt +Comment: Set 1, vector 460 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 4EAB74E6D12574BCDEF95BC0CAD67C7E04B24472431607EBAD5F915F1116C9CB +Test: Encrypt +Comment: Set 1, vector 461 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5A48DE560FA1ABF0F85BFF9A0A1928020A6C51AD3FE7C1392C2A875401DE62F0 +Test: Encrypt +Comment: Set 1, vector 462 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 074956F37AF065DBEDB2D68C602A4B65B7D614F8A0B284539E234B307CFDC495 +Test: Encrypt +Comment: Set 1, vector 463 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9BB4837A582A5CB30579DABEEC41ACCB3786AA9BE52DDC88065BE0FFD33917EC +Test: Encrypt +Comment: Set 1, vector 464 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E1E690D74FC254D1D2A8238096285CC100013E8A8BB55FE92F6DF69DB217773E +Test: Encrypt +Comment: Set 1, vector 465 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: DFE35C2BC6ADFEBE4D9E8F84160AD6315CA43F0F022DDC629106E008F29C81AE +Test: Encrypt +Comment: Set 1, vector 466 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 8106B2FE206F9F8738BEC324B531E6943F00B20EC35DEADCB508197EEEBA5473 +Test: Encrypt +Comment: Set 1, vector 467 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E46E36293B659E73FAA1722AF29651621598FF2E92694C99F7BB0C792B93BAB2 +Test: Encrypt +Comment: Set 1, vector 468 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F3CAB9F84AF81A06F9F350C345B44E053C8F1EE36D62159B4993950BB76D0948 +Test: Encrypt +Comment: Set 1, vector 469 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E3381C1644BBBB29290D30F15C96956BF4AEFE443FBDA0DB3EF2CEE7081D1DB3 +Test: Encrypt +Comment: Set 1, vector 470 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A4DD97D2710285907527C4FAE5676774D937FEC609F8489A16384568FAAA699F +Test: Encrypt +Comment: Set 1, vector 471 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 43C608E43584C631E620672EB0A92707C396ACC12CBCE0810A28F7EA3491E0A3 +Test: Encrypt +Comment: Set 1, vector 472 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A1DC3C2AE54BB2FA291913562F05E021AF361E422D39C89D8CFDBE4B672B63ED +Test: Encrypt +Comment: Set 1, vector 473 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 890CB43DA15A1D69A10EA9322B8C14D61AD537462439A735472CEF9428C8A2D9 +Test: Encrypt +Comment: Set 1, vector 474 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9119548582EB7EA7F4AA1B224A6825B786F316EAA7AAA18B61B56D64AA4CBA29 +Test: Encrypt +Comment: Set 1, vector 475 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 574DD7CA20662ECBC730FA7CE314094E427FB8250E0F636894B650DA35A7F0CE +Test: Encrypt +Comment: Set 1, vector 476 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 3575DEA861D0F97DA32438DB834020996820BE85EAE5ED15A7983A31C7669C70 +Test: Encrypt +Comment: Set 1, vector 477 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 27EA06CBD196073357F1F790191D14796FE2BEFBE18B8C48D7566528B3DDA4C6 +Test: Encrypt +Comment: Set 1, vector 478 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 11B190730F6EDE90C8B3FEE01E722ADDD21BEB4324A358F86F524E4B7F7AF975 +Test: Encrypt +Comment: Set 1, vector 479 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 07E3CDB5130D8FF7A2A31335AD478FEF10805E266C00646CFBBEE81F2B3C1711 +Test: Encrypt +Comment: Set 1, vector 480 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A0ED0FFEEBCBF4066EE550E63065B08569B92BCC938002A5469ABD1C397233A0 +Test: Encrypt +Comment: Set 1, vector 481 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2C9CDE299A4C507EC03C617EACE2358E76BC1AD338FE5A66A9105F18788A8836 +Test: Encrypt +Comment: Set 1, vector 482 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5163F9C4ECECD047E83BDF1D6EE233487646A96FE43B4B08C41324FD8ECB271B +Test: Encrypt +Comment: Set 1, vector 483 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: AA2AE4BF506AB3D7607A29C3EF90B4C7933EE58ED3AB3720817FE3C611A850AC +Test: Encrypt +Comment: Set 1, vector 484 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B04B4C802D91D9ADE76EBAFCDBA0A96A8A83DAEB7069370D6E901A42291EB8C6 +Test: Encrypt +Comment: Set 1, vector 485 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 91A99BC40CF38388B4AA77798D720653492CCED5230382ED587A305A2A1A6BCF +Test: Encrypt +Comment: Set 1, vector 486 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 91FB386F3B9AF82F93836005CBD9ED6727B9BBF1F669EAE6D06DA6D04D1AC082 +Test: Encrypt +Comment: Set 1, vector 487 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 01F8956120BF068AE7241BB96FF086C2D67547B549A8743FC0569978F201678E +Test: Encrypt +Comment: Set 1, vector 488 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A8C562A616F918A669A29C0724B76E3D04B125E0AB5A09E8CE60F54E4816EC90 +Test: Encrypt +Comment: Set 1, vector 489 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B41D3BC188419DC929D611197D17FB4D29B78CD7FBC03B904219DD8A2FEE210C +Test: Encrypt +Comment: Set 1, vector 490 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B119861B67AFE45C0134E2336CAC90BAFD1EB94C557EBA6DFDCBE69367B37981 +Test: Encrypt +Comment: Set 1, vector 491 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A2317FD4C041AF4D87C46FC684FBEE8DB65E4D43E5EA74237988A7EB67404656 +Test: Encrypt +Comment: Set 1, vector 492 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 641794C292A1A590F909D01F175E012671AEBF1E432295AED662E74C1EEA5DD4 +Test: Encrypt +Comment: Set 1, vector 493 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7984AC47362281DF446BE46AEC5D9A94B842F6F5BCCB01FD564318A49F94042C +Test: Encrypt +Comment: Set 1, vector 494 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 74F84174C9E2EBBEE396727DBB1C9CFAE2809D802F7E7CF8F7515FA3A629ED98 +Test: Encrypt +Comment: Set 1, vector 495 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7A9E862E27444A492C91CA2EE5E93369FEB74BB881AAC74F895D97E61500FA99 +Test: Encrypt +Comment: Set 1, vector 496 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 638E347CEC7121A668AF985E56F7F3934D852FCF53283B767BAC213337AAE99A +Test: Encrypt +Comment: Set 1, vector 497 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 45DC398895DA1B415708B4BC8B7EF133849E0E8E99945AE4D9C894FDF6D2815D +Test: Encrypt +Comment: Set 1, vector 498 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 1ACF1203B698FE2E3375E251EBBC05D387FECABDE6A9194DF5195F3FBF1E3502 +Test: Encrypt +Comment: Set 1, vector 499 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F6A064BDC6EE0777B09CC1A0154F28AD282D4D6E48F9DE11CA083B8A9F454891 +Test: Encrypt +Comment: Set 1, vector 500 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: FE68FB721E181EA8A62CDD3CA0278C6EB1344DF07E73676D3F0DC501D99721C3 +Test: Encrypt +Comment: Set 1, vector 501 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 72923AD92EF01BDB90B9639DD411E4540CE0F531A0AE401547FBA03CB850B63A +Test: Encrypt +Comment: Set 1, vector 502 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0B1D0F485A4DE59658FE61F1F0010D9EF5A2BA97624CC3687D94EE4335777138 +Test: Encrypt +Comment: Set 1, vector 503 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7423264FBF5EA94BA461BD80B2518B1CAF3757CF5BAB4511144637F5DC917168 +Test: Encrypt +Comment: Set 1, vector 504 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 589FADA29BEA438C12CA96241AA492FCFED48C1C1C05C16C88CD7A8B46E16A0D +Test: Encrypt +Comment: Set 1, vector 505 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 319B5D23945A98C9480E6460CBCB86A8B36038A28500A36182B228060713F58B +Test: Encrypt +Comment: Set 1, vector 506 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: B81B723D3E18A074078B7D041E55B9B130953ECF70BF773273A28E11238651A5 +Test: Encrypt +Comment: Set 1, vector 507 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E660AC40BC4700D4CE85AA43A2A39A24D0F255E64A9251D7442AEFB6EDFD43A8 +Test: Encrypt +Comment: Set 1, vector 508 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: C27914CB70EA29C06B321E4F61730CE6679A342733738BE72C97EED40802EC17 +Test: Encrypt +Comment: Set 1, vector 509 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 764B78FA0EC12E017D9F7C69FF53FA8FA00E7185888F36DBC3CA9A10A6122FBA +Test: Encrypt +Comment: Set 1, vector 510 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E2F9F554823B38D2099DD27E0AD6AD69BE137626840B41B7CF081D7881C47CC7 +Test: Encrypt +Comment: Set 1, vector 511 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 403E453BBAF997A75C4517B588431C75BCF01208B378A4F4FBB138217A9CA4A2 +Test: Encrypt +Comment: Set 2, vector 0 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 8000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2CAE7C0460EE2FC3200923A1B6C2ABEEA746C8B44F6C3FB941BD3AF02A3E6E3E +Test: Encrypt +Comment: Set 2, vector 1 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 4000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 45FAAFBEE792EA704EE3D08CFA9D9F5CF93FEB3443E0049DE5898A48F5A3D92B +Test: Encrypt +Comment: Set 2, vector 2 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 2000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 720F072E7796310AC1BDDD3714581EB95896723DA3E61E0892B43F65A4153965 +Test: Encrypt +Comment: Set 2, vector 3 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 1000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5E6671D1F792673D63940E69D78A3471B3C150707DA72E6C25CBD2C4DA2B9778 +Test: Encrypt +Comment: Set 2, vector 4 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0800000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 2E96F027C2B62ED2D2EE692A992ACAB827D16FDA71DD98109A645E4094923D3B +Test: Encrypt +Comment: Set 2, vector 5 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0400000000000000000000000000000000000000000000000000000000000000 +Ciphertext: A38D7F334B21394B28A29FC9CBC68AD9F2AE85E7434D1C2F57AAA4C1A49DB759 +Test: Encrypt +Comment: Set 2, vector 6 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0200000000000000000000000000000000000000000000000000000000000000 +Ciphertext: F67B5037CE9193023095D43DE312523F99E6CBCDF43EC00A947284496E311DD6 +Test: Encrypt +Comment: Set 2, vector 7 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0100000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7DC030A91C39EC8558AC10044AF79D4CCA92BBC8093B3A2456E26350E35EEBDA +Test: Encrypt +Comment: Set 2, vector 8 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0080000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 99260425AA126953E04A3D959F9153404521EC64C3B35E61EEBA67AAD2C1295A +Test: Encrypt +Comment: Set 2, vector 9 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0040000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 65C380354899581B2B40EDDF40A0695FB608DCDD11C6B0C2CA6BB427DB1D2A9D +Test: Encrypt +Comment: Set 2, vector 10 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0020000000000000000000000000000000000000000000000000000000000000 +Ciphertext: BBD1C4488D41FB1B096E835AD29FC3DC5B97496BA638625D78B99C5ABBDFA13A +Test: Encrypt +Comment: Set 2, vector 11 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0010000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7AFDEE496D690233ED0717E2D92DE3A102FDF902E51E69FFCE244B84A69CA826 +Test: Encrypt +Comment: Set 2, vector 12 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0008000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 06D8C3E7AAC698D143013B364BD7ABC4E4EB6BA82BBAB2A4A0B486E70E24592C +Test: Encrypt +Comment: Set 2, vector 13 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0004000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 727A8BF64932039C3409ED31CFC0171651BA69D551E8073A4BD1D35F31F52336 +Test: Encrypt +Comment: Set 2, vector 14 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0002000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 9EE7CA05C4161860014BEA89FB2DED90B4F0B362AD67789C6045C9C71310A8AA +Test: Encrypt +Comment: Set 2, vector 15 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0001000000000000000000000000000000000000000000000000000000000000 +Ciphertext: E924224559E43960EC44165CAD471CFED381B279B3EA4AF96BDB071BE987DA0D +Test: Encrypt +Comment: Set 2, vector 16 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000800000000000000000000000000000000000000000000000000000000000 +Ciphertext: FF189222046B5F4FB491CDC9A98130D772629F3EF44A06894268C507C25061AF +Test: Encrypt +Comment: Set 2, vector 17 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000400000000000000000000000000000000000000000000000000000000000 +Ciphertext: 6B053BA7765F2A62595A1E83444B52FCF16C8BBBEB21B437E6FC8C5F03B3673F +Test: Encrypt +Comment: Set 2, vector 18 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000200000000000000000000000000000000000000000000000000000000000 +Ciphertext: 0FB836DC6BCDA1C2955CC7A6F25E72C5FFFDE1075D820217157051FB5BD3D3EF +Test: Encrypt +Comment: Set 2, vector 19 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000100000000000000000000000000000000000000000000000000000000000 +Ciphertext: 200EBC8B8217D9A6895253F9366543027E5F493DBA1A5AD4FC7AB66FB806308E +Test: Encrypt +Comment: Set 2, vector 20 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000080000000000000000000000000000000000000000000000000000000000 +Ciphertext: 45B33F2465C674941B7E26C5986E42F6814A71323B420E401DCC8DA200FC3C08 +Test: Encrypt +Comment: Set 2, vector 21 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000040000000000000000000000000000000000000000000000000000000000 +Ciphertext: D2BF0A074053A01A227DC439311BF8BD696203995285A3A2CD3674A0CC6A65B2 +Test: Encrypt +Comment: Set 2, vector 22 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000020000000000000000000000000000000000000000000000000000000000 +Ciphertext: 5FFFAB58BA2CB27AE92E10F36F99A8EFEDF9DE2446A9C2E82E48F22FB1ED8C5D +Test: Encrypt +Comment: Set 2, vector 23 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000010000000000000000000000000000000000000000000000000000000000 +Ciphertext: 835A1BD7A3688BA0F7C572417A06FCCBCE0A69C7FCDF10C8BCF4469AE80DF11E +Test: Encrypt +Comment: Set 2, vector 24 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000008000000000000000000000000000000000000000000000000000000000 +Ciphertext: 559D1BECB3DBBE40A7E31C66D97D292821B934818172553FC1CE68AD8E6A741F +Test: Encrypt +Comment: Set 2, vector 25 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000004000000000000000000000000000000000000000000000000000000000 +Ciphertext: D962BE9A9C4F8DDA6F0EC42DB8B48FA14A1E91E639BD85FF26A2543D9FDFA9A9 +Test: Encrypt +Comment: Set 2, vector 26 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000002000000000000000000000000000000000000000000000000000000000 +Ciphertext: 588B2319C62ED25ECEAB7C327B212F5FCD5D89DE8A85AA3713BF332CF5F715DF +Test: Encrypt +Comment: Set 2, vector 27 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000001000000000000000000000000000000000000000000000000000000000 +Ciphertext: 67EDE571C64AFF87D7AE5294E64F1709F920A10D278E1629FC8B2BE7EF5ABE0D +Test: Encrypt +Comment: Set 2, vector 28 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000800000000000000000000000000000000000000000000000000000000 +Ciphertext: 60D9E58A6828847F9644DC165EB508B5A2BC67219B969B605B3CFAE109C9CE47 +Test: Encrypt +Comment: Set 2, vector 29 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000400000000000000000000000000000000000000000000000000000000 +Ciphertext: 5A0C538CB78F13404BF8D8AF5C43A17F04AD0D35DAD45F88E26B9D1C204B5AFB +Test: Encrypt +Comment: Set 2, vector 30 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000200000000000000000000000000000000000000000000000000000000 +Ciphertext: 724EE8B7D7BCAC2587C42D92FFCDF7EDFF91F06AD43ED353F332E1FAC3B70F5F +Test: Encrypt +Comment: Set 2, vector 31 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000100000000000000000000000000000000000000000000000000000000 +Ciphertext: D50F11DACBF340C1315419D1983028DCED83F8350FE50DA4F9554DFA641E99E1 +Test: Encrypt +Comment: Set 2, vector 32 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000080000000000000000000000000000000000000000000000000000000 +Ciphertext: 9460ACD1B739015ED197B2659353AAC465339FAD9D1AFB845A337630332C1C55 +Test: Encrypt +Comment: Set 2, vector 33 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000040000000000000000000000000000000000000000000000000000000 +Ciphertext: 7D7A56F8A89463C4CE519B96854200C6E05703651CE3ACD5549B59D0B9788B93 +Test: Encrypt +Comment: Set 2, vector 34 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000020000000000000000000000000000000000000000000000000000000 +Ciphertext: D07E4F830ADF1DE4886C614CDB6B3D988884293AE65A63B3E9886A8727C022B2 +Test: Encrypt +Comment: Set 2, vector 35 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000010000000000000000000000000000000000000000000000000000000 +Ciphertext: 56CCEC1812B3B83086208DBF0C98119DC1CAE316E91B09F4F6F36BDCF73F8873 +Test: Encrypt +Comment: Set 2, vector 36 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000008000000000000000000000000000000000000000000000000000000 +Ciphertext: E8C3012B0EEB2D18DEA4C06BAC2906DF858BFB8A4D86D6841C02A9E45B2D0455 +Test: Encrypt +Comment: Set 2, vector 37 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000004000000000000000000000000000000000000000000000000000000 +Ciphertext: E10FB90CB2F5F830763FCEFA386A8E70052AB8994A55DC95FEDF8B71E11D2636 +Test: Encrypt +Comment: Set 2, vector 38 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000002000000000000000000000000000000000000000000000000000000 +Ciphertext: 848DFB81A0D4D13A40F9119AB77A3B6D2B96E76396B39984739FDF31ADBC376F +Test: Encrypt +Comment: Set 2, vector 39 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000001000000000000000000000000000000000000000000000000000000 +Ciphertext: 61068A490E20E07686D8A77B81718A3214508E3FE3DA6A6BBAA8ABD67B98623F +Test: Encrypt +Comment: Set 2, vector 40 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000800000000000000000000000000000000000000000000000000000 +Ciphertext: 9197E2A5212260324CA6E6FA0BBA56B4E5D9934C8B9E42D9F43E901C0994082C +Test: Encrypt +Comment: Set 2, vector 41 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000400000000000000000000000000000000000000000000000000000 +Ciphertext: E9DC3C1445CBFF1B863CF3FB6B338B4EC29F2C083E65A4BBCC2F1FAC22CCA8DD +Test: Encrypt +Comment: Set 2, vector 42 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000200000000000000000000000000000000000000000000000000000 +Ciphertext: 80039358C99E64A255D5E4E334C830FFEC8E0CBF2EB6030DE7DCE1A938821938 +Test: Encrypt +Comment: Set 2, vector 43 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000100000000000000000000000000000000000000000000000000000 +Ciphertext: E508D93429BBE95EE38672A2F653841701F391C68235391367F16415C2C84ADC +Test: Encrypt +Comment: Set 2, vector 44 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000080000000000000000000000000000000000000000000000000000 +Ciphertext: 710463874DF68B8930CC5CD6A00ABA2BCE27352997F2582EF472ED5F5AFE75A8 +Test: Encrypt +Comment: Set 2, vector 45 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000040000000000000000000000000000000000000000000000000000 +Ciphertext: E90AD04D26F4FF6D25D193CD2C34A2E1C6A1E570CCC705B873CACC94E61F79A7 +Test: Encrypt +Comment: Set 2, vector 46 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000020000000000000000000000000000000000000000000000000000 +Ciphertext: 8E19B69D55C9A2B2CCEACB50EC8007F39C81A0F261A8568D1298967C132BB790 +Test: Encrypt +Comment: Set 2, vector 47 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000010000000000000000000000000000000000000000000000000000 +Ciphertext: 4051E2FA9032676DC6E11CE947C64C9A0C0FC262AA41F40FA0C4093D1E4FA924 +Test: Encrypt +Comment: Set 2, vector 48 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000008000000000000000000000000000000000000000000000000000 +Ciphertext: 5DA6F415CCDF1A2D3335A0BEBB879D88CB9C871744111004C0E5AA6D27EB0311 +Test: Encrypt +Comment: Set 2, vector 49 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000004000000000000000000000000000000000000000000000000000 +Ciphertext: 684C24EC1DD06F6B565890190BE1F8BC7F4537CF5F9CF038ECB6D1D86164503A +Test: Encrypt +Comment: Set 2, vector 50 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000002000000000000000000000000000000000000000000000000000 +Ciphertext: 6D259C132726524987D4FD96C1ECD943D6B87BB98C61C4FFE41E282EC82F246A +Test: Encrypt +Comment: Set 2, vector 51 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000001000000000000000000000000000000000000000000000000000 +Ciphertext: 14707F80CC43E4E6321362B0ACFF84FE57E9D477B56637D01CAA09B232D726C5 +Test: Encrypt +Comment: Set 2, vector 52 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000800000000000000000000000000000000000000000000000000 +Ciphertext: FE98609B71F9CD65CD377C98BC4117EC8708E58D15361F9CAC02C64F0452B80D +Test: Encrypt +Comment: Set 2, vector 53 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000400000000000000000000000000000000000000000000000000 +Ciphertext: 1B78E77F935EBA86B28C9B37818245E2865AF84A73C9DAA735E42E6009AA07F3 +Test: Encrypt +Comment: Set 2, vector 54 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000200000000000000000000000000000000000000000000000000 +Ciphertext: F354ADD75ED9E121B1BFAD9483C6825AEF57BAA2DF08B519640E022E196B313F +Test: Encrypt +Comment: Set 2, vector 55 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000100000000000000000000000000000000000000000000000000 +Ciphertext: 7E0D7DCC0642CD5BF0C39460C4C183E5F321BCAB5EEA0AC7021E1AECE423E2A9 +Test: Encrypt +Comment: Set 2, vector 56 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000080000000000000000000000000000000000000000000000000 +Ciphertext: D1CCBD3EEA6ACF918569BEC2C900723B4359CA19C58E32ED65FDCBAA30A41C98 +Test: Encrypt +Comment: Set 2, vector 57 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000040000000000000000000000000000000000000000000000000 +Ciphertext: 361246D37645483C6D13C6500326694A0D577604CDF7CD36586B6C7F96FBE077 +Test: Encrypt +Comment: Set 2, vector 58 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000020000000000000000000000000000000000000000000000000 +Ciphertext: 0BC890CF369C233EDB99A51CEC75BFF60FB36BFB3EC15F253054F8865CB16DFF +Test: Encrypt +Comment: Set 2, vector 59 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000010000000000000000000000000000000000000000000000000 +Ciphertext: B5ED5183A00C882F8D213AFCE35C14E940407B7C2A8C9A5A19F289AED42DFAD7 +Test: Encrypt +Comment: Set 2, vector 60 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000008000000000000000000000000000000000000000000000000 +Ciphertext: 22B4EA3A5718D6CEE4EA78725F5BAC735C539C343D7B45121EDDA22CA39D9413 +Test: Encrypt +Comment: Set 2, vector 61 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000004000000000000000000000000000000000000000000000000 +Ciphertext: 94ECEC21BC3426C7214F266B6442F85B6AE765BD6206A951B2AA14505D19FBCA +Test: Encrypt +Comment: Set 2, vector 62 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000002000000000000000000000000000000000000000000000000 +Ciphertext: EF77932A5749126D65BD88330C18D91EDBB7FB53D7B3B675EE148EFC893559B9 +Test: Encrypt +Comment: Set 2, vector 63 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000001000000000000000000000000000000000000000000000000 +Ciphertext: BB9E132DC5DE8035433FBEAC46395E861BDA17A4892FFE6BD1B10D6B4D6AE0F3 +Test: Encrypt +Comment: Set 2, vector 64 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000800000000000000000000000000000000000000000000000 +Ciphertext: 7B536CF871F7FF406AD640683F405F0E14D72E77CDD2AB091D9A8E169155CE24 +Test: Encrypt +Comment: Set 2, vector 65 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000400000000000000000000000000000000000000000000000 +Ciphertext: 2417835AB4BD0A1D3439310480224C52796F3DB3536419F51A09551DFD4A6799 +Test: Encrypt +Comment: Set 2, vector 66 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000200000000000000000000000000000000000000000000000 +Ciphertext: 8E49C9819DFF2DEFCD8DF3E9EA910F79A9A932F43E4B763D6988CC0924C20544 +Test: Encrypt +Comment: Set 2, vector 67 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000100000000000000000000000000000000000000000000000 +Ciphertext: 1D364FDEFCB51560E4408CF25FC05E7698235D271E725590533CE24E3F3EC1EE +Test: Encrypt +Comment: Set 2, vector 68 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000080000000000000000000000000000000000000000000000 +Ciphertext: F1C0422AC64E4D566E799ADA6CE33B59C31051C55ED2212841460CE330F2763E +Test: Encrypt +Comment: Set 2, vector 69 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000040000000000000000000000000000000000000000000000 +Ciphertext: FA90883588183011F2748ADBC5217BA38CF6787FFD8BFCBEA06ADE193B1313C5 +Test: Encrypt +Comment: Set 2, vector 70 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000020000000000000000000000000000000000000000000000 +Ciphertext: 84EE69F947AEAAA0F1F2DA8C1508733D31F62FEBCF7085C68DEA5A602A566EBF +Test: Encrypt +Comment: Set 2, vector 71 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000010000000000000000000000000000000000000000000000 +Ciphertext: 260C06AB73B581E29C34FEE05363F532D4C693B5E8025291FC99C48F9CFCEFF8 +Test: Encrypt +Comment: Set 2, vector 72 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000008000000000000000000000000000000000000000000000 +Ciphertext: 98184C744C6A24B329A7827CE0F5B30AE709493A22F9064D1C3F7FED046D1C2A +Test: Encrypt +Comment: Set 2, vector 73 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000004000000000000000000000000000000000000000000000 +Ciphertext: 3CCDF1C3103B356E7A460410D91F1F00F749EB96F3E89F91248FB5E0949806EF +Test: Encrypt +Comment: Set 2, vector 74 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000002000000000000000000000000000000000000000000000 +Ciphertext: 49AB6245E93A6CF84BF66A7451D134535362CB8A8CE2E47012BF8B4EF02894D4 +Test: Encrypt +Comment: Set 2, vector 75 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000001000000000000000000000000000000000000000000000 +Ciphertext: 7A92C7BB97CB99AD15EA9DA3A629031901840D23EA4227C699944882E2E8F3CC +Test: Encrypt +Comment: Set 2, vector 76 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000800000000000000000000000000000000000000000000 +Ciphertext: 00FC7EBE56FCB696D9606FBBEEA6955871B7A03CDCAAE25DFC47D06145371AD3 +Test: Encrypt +Comment: Set 2, vector 77 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000400000000000000000000000000000000000000000000 +Ciphertext: FFF7327A979B527486052C1B99DECCFCC5E680D39613DE4107E8A04980DDFD70 +Test: Encrypt +Comment: Set 2, vector 78 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000200000000000000000000000000000000000000000000 +Ciphertext: 1E950B49D7D446867ED48272D220BCCC35B104A76A107880FB37D8AE55E69F58 +Test: Encrypt +Comment: Set 2, vector 79 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000100000000000000000000000000000000000000000000 +Ciphertext: 3B97EDED4E70497DAE02FD51E10AB26888096D2D182A7BC7EE55B6F3243E0144 +Test: Encrypt +Comment: Set 2, vector 80 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000080000000000000000000000000000000000000000000 +Ciphertext: 94414A0116665FFD8D1589B050A1663DBA15463206DA4E6A735B58FA7B4AA7ED +Test: Encrypt +Comment: Set 2, vector 81 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000040000000000000000000000000000000000000000000 +Ciphertext: D586FFCBBF32561B9659306068DD31C2A1FBC8DDF99CF0BDAB3DCC0664B403C7 +Test: Encrypt +Comment: Set 2, vector 82 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000020000000000000000000000000000000000000000000 +Ciphertext: 061E17DB1EAF9884C940B8C72E884C8D9D46819FDDF6724239168DDBEE170B9B +Test: Encrypt +Comment: Set 2, vector 83 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000010000000000000000000000000000000000000000000 +Ciphertext: D70F322E45E1D64B3D91249E9DE766DB7EF9084120C13D0215F31A6DE2E791C6 +Test: Encrypt +Comment: Set 2, vector 84 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000008000000000000000000000000000000000000000000 +Ciphertext: 5018967FCA5E67F24DCCE2190D24CD3E24A0B709B70DC38F1A4B4FE39CDCD2E5 +Test: Encrypt +Comment: Set 2, vector 85 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000004000000000000000000000000000000000000000000 +Ciphertext: 9108A0540D8D02658268185F06DFF6F2248681D0D9F9F4C6658942FC27C68246 +Test: Encrypt +Comment: Set 2, vector 86 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000002000000000000000000000000000000000000000000 +Ciphertext: 6595E74A5943DFE1A3FC19ADEBF190CDEC4C2EA0B7CCC6364E0AF7222CCEAA46 +Test: Encrypt +Comment: Set 2, vector 87 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000001000000000000000000000000000000000000000000 +Ciphertext: 5F156FB20AFD4BC0E4E4B2BA7700A38FFCAF9229E3CBA8C99915B692A76ACDEA +Test: Encrypt +Comment: Set 2, vector 88 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000800000000000000000000000000000000000000000 +Ciphertext: F0584D66033584791BED0EB67D2A73AA918E0F88F08683DC1F67DB7DD3375326 +Test: Encrypt +Comment: Set 2, vector 89 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000400000000000000000000000000000000000000000 +Ciphertext: 5EB0956E3DA8ECFC571D5BD1C4EF430FBB10117C6684B8530B6552B812780EBF +Test: Encrypt +Comment: Set 2, vector 90 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000200000000000000000000000000000000000000000 +Ciphertext: E8C8CB56ED63B5BA16DD833CC9C7AC77E425C284FFD547E8F9FE10410CA02FF3 +Test: Encrypt +Comment: Set 2, vector 91 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000100000000000000000000000000000000000000000 +Ciphertext: 68704A278A231ED468C1F0CFF43A4FC61253EACBE2BDCE1ED86D89F43263016D +Test: Encrypt +Comment: Set 2, vector 92 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000080000000000000000000000000000000000000000 +Ciphertext: CA16F899842EE79CBAC4D7CD67172C7DD537E6EA21D48C15B0B34B29BF87E79B +Test: Encrypt +Comment: Set 2, vector 93 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000040000000000000000000000000000000000000000 +Ciphertext: 9E6E7B31FF5D4D5C7D1C264273A27DA542BFCC6116B7DFDEF6332690B7304BDD +Test: Encrypt +Comment: Set 2, vector 94 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000020000000000000000000000000000000000000000 +Ciphertext: FE466983DED41AFB1908DF12A5532054C6DB320F0ECBDCE7610BBE2A07AA7F68 +Test: Encrypt +Comment: Set 2, vector 95 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000010000000000000000000000000000000000000000 +Ciphertext: D2D93C1B66FD710F8B72564A44ACA93995938FEE7C38DE482C9586E3413EB40C +Test: Encrypt +Comment: Set 2, vector 96 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000008000000000000000000000000000000000000000 +Ciphertext: 6623F853780833A60B60E6467CFA3D3D000228F2C8334F8B00CFE119133D41C7 +Test: Encrypt +Comment: Set 2, vector 97 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000004000000000000000000000000000000000000000 +Ciphertext: 1CED4727527E1C3107A89E77645241D240F3F113AC2BF8319E5D8EFF68997595 +Test: Encrypt +Comment: Set 2, vector 98 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000002000000000000000000000000000000000000000 +Ciphertext: FA450B3D8A7C03B643DF6EC70867D0502AE20235335AF5932A7016D71A6059A4 +Test: Encrypt +Comment: Set 2, vector 99 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000001000000000000000000000000000000000000000 +Ciphertext: A6F76AB74CE44538579369F5367B826C4EA72EB6EE08A0CFE1272EB435FDFEFC +Test: Encrypt +Comment: Set 2, vector 100 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000800000000000000000000000000000000000000 +Ciphertext: 8108B48A62A0E0CD58B066C10613E2B589CFB0BCEF4EB58BBF8C88E84A2CD258 +Test: Encrypt +Comment: Set 2, vector 101 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000400000000000000000000000000000000000000 +Ciphertext: F335D10835B018414786D30923663B77B2E0CA65423B96BFA885B9797138CF4F +Test: Encrypt +Comment: Set 2, vector 102 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000200000000000000000000000000000000000000 +Ciphertext: 87D8E75FEDA12025B9517BBF8421E837872E8978E48DA51BB8B8574C04731091 +Test: Encrypt +Comment: Set 2, vector 103 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000100000000000000000000000000000000000000 +Ciphertext: B8A50E6EDFF9711C6064812423F5DC5D77970BE65B545C042A02BACB30A4CD6F +Test: Encrypt +Comment: Set 2, vector 104 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000080000000000000000000000000000000000000 +Ciphertext: EB98815E5A9337DF35F98D7CF27183EC8423D5F9D145326638B864E0F994DD7D +Test: Encrypt +Comment: Set 2, vector 105 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000040000000000000000000000000000000000000 +Ciphertext: 3E5DDB36ABD739986483DE7A9EEF2468461A02B55CAA24100394442F0946F337 +Test: Encrypt +Comment: Set 2, vector 106 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000020000000000000000000000000000000000000 +Ciphertext: 809F726C3BB19BD09D4412B64777085D968ED4E612286008C4BAC69F671E7E31 +Test: Encrypt +Comment: Set 2, vector 107 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000010000000000000000000000000000000000000 +Ciphertext: 28F2EE8D382DF1AB0CF82B93C7A09B87180E8D19C35657302EFE1B1C4CA11ED4 +Test: Encrypt +Comment: Set 2, vector 108 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000008000000000000000000000000000000000000 +Ciphertext: 76E6887FC464215C9576BB233F5A3A7D98CA73F9B2D06E3BB81BC34AF02C8CE9 +Test: Encrypt +Comment: Set 2, vector 109 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000004000000000000000000000000000000000000 +Ciphertext: E8CEF712D7AF841C4FE7800CB04C27E25BDB41BECFA894588F73776CAAE2A0FA +Test: Encrypt +Comment: Set 2, vector 110 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000002000000000000000000000000000000000000 +Ciphertext: 868D3A678A216D01A765046E2991A21F9626493063AFE771E3369E5DA2BA7E9B +Test: Encrypt +Comment: Set 2, vector 111 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000001000000000000000000000000000000000000 +Ciphertext: D6465061FA1B143E1F6A3FCC1601D2D9FAEEF995C457E9EE301A27E8139D1AFE +Test: Encrypt +Comment: Set 2, vector 112 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000800000000000000000000000000000000000 +Ciphertext: B42BB57D2F25612AAB33EF3213D6D210D9831502A1C4D51C4E72148CBB9893D1 +Test: Encrypt +Comment: Set 2, vector 113 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000400000000000000000000000000000000000 +Ciphertext: CE0EC3C44BFAABE6E18B3506E01199B0F2E0BCA4EA6C29D367EDDD0E83A1C65F +Test: Encrypt +Comment: Set 2, vector 114 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000200000000000000000000000000000000000 +Ciphertext: 627101F50E134D6F33EF70AF0E32A3AF7C3237E3A5D99319719F175DD0392383 +Test: Encrypt +Comment: Set 2, vector 115 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000100000000000000000000000000000000000 +Ciphertext: CBCC83BE624059BD8B950BCF486AFBC342CF3575EBA6950FB39C03DB4822EDD9 +Test: Encrypt +Comment: Set 2, vector 116 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000080000000000000000000000000000000000 +Ciphertext: 5EAD7961798903C315DD89BE57105FEA164CA06A4ECDBB5CB10B76711C3E49A0 +Test: Encrypt +Comment: Set 2, vector 117 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000040000000000000000000000000000000000 +Ciphertext: 69169E6E11EAC935E12E6E30EFCEDD7236EAED9C5E1E3B215CD7167AB88B199D +Test: Encrypt +Comment: Set 2, vector 118 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000020000000000000000000000000000000000 +Ciphertext: 5B08F07728399920CA30DC57CE94CAE85A44530033B2AE6BB7F8E29D7934C437 +Test: Encrypt +Comment: Set 2, vector 119 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000010000000000000000000000000000000000 +Ciphertext: 8FAD35B4FBC3BBAB2F4BF00D8A1651BE3FD77085AC5E6C7F6E2EDF5048F86068 +Test: Encrypt +Comment: Set 2, vector 120 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000008000000000000000000000000000000000 +Ciphertext: 71B22D911D9E754A76EC052CD7DC503CDE9A16E9043A04CFA244D8EB19FC21AA +Test: Encrypt +Comment: Set 2, vector 121 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000004000000000000000000000000000000000 +Ciphertext: 062A10B7F5E3E8D7F3FC2C14E10EC9CA947A8FDC0EBC01E3A127BAFE689D6577 +Test: Encrypt +Comment: Set 2, vector 122 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000002000000000000000000000000000000000 +Ciphertext: 0FC375F0F68567F1827C7218132B434E84DA6377DB50AB330E8D9BD2754BD1B8 +Test: Encrypt +Comment: Set 2, vector 123 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000001000000000000000000000000000000000 +Ciphertext: 0E4C1117D462EEBCF5FCD7AC9807AF40C403910421CD19A4634B1C86113EB387 +Test: Encrypt +Comment: Set 2, vector 124 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000800000000000000000000000000000000 +Ciphertext: A9DB2CD2A23780D8BC5A2567961BCA24A41531157D4A229046B47DE48CAE0FDD +Test: Encrypt +Comment: Set 2, vector 125 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000400000000000000000000000000000000 +Ciphertext: 7195678F00F98B00706E7C497E5FA2BC648EDA00B4B7DFAC6234C8232DF8E071 +Test: Encrypt +Comment: Set 2, vector 126 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000200000000000000000000000000000000 +Ciphertext: E5C1970C7C0B8E7E1BF871219486359C2E5037BE6E8E637BDB9F11051FB36A16 +Test: Encrypt +Comment: Set 2, vector 127 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000100000000000000000000000000000000 +Ciphertext: 2426496DC3B09404B609157E2273D526C3E6909B82F65527B42ABDD6348CF602 +Test: Encrypt +Comment: Set 2, vector 128 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000080000000000000000000000000000000 +Ciphertext: F9870238947E1575AF11D14D12E593163B98BA12E79F05563CBFFBCFB23FDC38 +Test: Encrypt +Comment: Set 2, vector 129 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000040000000000000000000000000000000 +Ciphertext: 2B1E410ACE9E8875F965A29D90773B68CAC452AE98CEB5922B7BAD936ACC421B +Test: Encrypt +Comment: Set 2, vector 130 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000020000000000000000000000000000000 +Ciphertext: 180285A7AD7DD8FFD619970804F0FDB9706D5F5C467F815D0B1A455DED9D9300 +Test: Encrypt +Comment: Set 2, vector 131 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000010000000000000000000000000000000 +Ciphertext: BAEB5C1C68D72F1AE4735F6B75CDF9265E4F6F55DA934C4F118A3728AA2BC0D5 +Test: Encrypt +Comment: Set 2, vector 132 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000008000000000000000000000000000000 +Ciphertext: 9DEBFCC984F55E97C0064335C8A4B7489B7BDD75560EA51982114FCE4D481032 +Test: Encrypt +Comment: Set 2, vector 133 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000004000000000000000000000000000000 +Ciphertext: DF3B0B54DF4D1814A6F46B8F8B37E27AE8B9EC54B97BF9C523F1EC713EDDFFEE +Test: Encrypt +Comment: Set 2, vector 134 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000002000000000000000000000000000000 +Ciphertext: 37AA04C74A1E8ED165BC1B4C97265A32B5579D9B2A7B7C883A98B616D5C24FAE +Test: Encrypt +Comment: Set 2, vector 135 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000001000000000000000000000000000000 +Ciphertext: 83815356746186AE4CC327AB3A8CE04EF66ABD32D44D7089F1D7E301BFE006D6 +Test: Encrypt +Comment: Set 2, vector 136 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000800000000000000000000000000000 +Ciphertext: 2C6C7878E099F55653CA784A0BE4C9EC6201AFDCF99CDDC1ED862D4FE88CFDC8 +Test: Encrypt +Comment: Set 2, vector 137 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000400000000000000000000000000000 +Ciphertext: 424804513D38537C024955F2CCB29BECFD801FC06CD8EC5DE353872F0B50616F +Test: Encrypt +Comment: Set 2, vector 138 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000200000000000000000000000000000 +Ciphertext: 48C31A55ED4716825D43FF671C01A86CDD792AABF78703ADC58F5FD65B3C0DE1 +Test: Encrypt +Comment: Set 2, vector 139 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000100000000000000000000000000000 +Ciphertext: BF99E4263F2C512CDE33A91E04FACA55052444E40FF79F09716FC06D24FDDE1D +Test: Encrypt +Comment: Set 2, vector 140 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000080000000000000000000000000000 +Ciphertext: 1A40488BA16A5D0AE6381018F15ABF95C78FB05867E3D7E213CAD7BA3DC9EA3B +Test: Encrypt +Comment: Set 2, vector 141 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000040000000000000000000000000000 +Ciphertext: BEAD8979A1A485959C3E9C8BF9CCF7CF850EB205296E1E8FF8BCAFBB011FF21D +Test: Encrypt +Comment: Set 2, vector 142 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000020000000000000000000000000000 +Ciphertext: A8EDCC85F5A941B4434BD4DAD5E39EEAD102DA25BBB2C3D143572AC7425ED819 +Test: Encrypt +Comment: Set 2, vector 143 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000010000000000000000000000000000 +Ciphertext: 631126B3A837AA4C999EFE6A687BBA58751464A6395670213C8445CC8409C33F +Test: Encrypt +Comment: Set 2, vector 144 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000008000000000000000000000000000 +Ciphertext: CA4A5FD3A3D2DA973E16C0A849E374C5A293351A66415B45107BD228CB842B19 +Test: Encrypt +Comment: Set 2, vector 145 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000004000000000000000000000000000 +Ciphertext: A61FDF733DDEC4C3AE51BE778BDD6E34BED64449ABCA7A718EAA513A2A5A9014 +Test: Encrypt +Comment: Set 2, vector 146 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000002000000000000000000000000000 +Ciphertext: 2C632530E7FCD550B5F9D14E21409AFD07C7E1FBF04B3B3FEC8C61AC8A1591ED +Test: Encrypt +Comment: Set 2, vector 147 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000001000000000000000000000000000 +Ciphertext: B2D97A1D343D3D5E1A7E444BA6E57D2E5ED42E02F719ECA22BA47E796AB37B18 +Test: Encrypt +Comment: Set 2, vector 148 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000800000000000000000000000000 +Ciphertext: AC515AAC675C2C3E46A8F77578189149327413CF40B48E16BF83D3500C2B1355 +Test: Encrypt +Comment: Set 2, vector 149 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000400000000000000000000000000 +Ciphertext: C8ADC6079B92459A8E975FFFE2352A90629CF9E8D53630536D9EBC7DAC4C467E +Test: Encrypt +Comment: Set 2, vector 150 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000200000000000000000000000000 +Ciphertext: 97B2C40964B25AE5CBD092E36B37A3BB4520570A9920034C584C66600D3857D9 +Test: Encrypt +Comment: Set 2, vector 151 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000100000000000000000000000000 +Ciphertext: 99A017D3829CEFE10DDD33D33F53EA470A2A74A35ED3BED8B7E9D6EF3B790153 +Test: Encrypt +Comment: Set 2, vector 152 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000080000000000000000000000000 +Ciphertext: 6141854199F9E01CFE4A35DF918B805985ACC8F8A7456FFBF91D27D4E85E4C49 +Test: Encrypt +Comment: Set 2, vector 153 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000040000000000000000000000000 +Ciphertext: 28BC7571E7C921B31BC2D7BF55853C2CC5B815B39471907DAE152F685791378B +Test: Encrypt +Comment: Set 2, vector 154 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000020000000000000000000000000 +Ciphertext: AD751D4D9D635900C22B6166328ECD85FB4A1610D055793BF04A83CB6F5F02DB +Test: Encrypt +Comment: Set 2, vector 155 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000010000000000000000000000000 +Ciphertext: 8670009356A0A3BD402CF218664826C05BE1651C6E606C011967F8F9C3835017 +Test: Encrypt +Comment: Set 2, vector 156 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000008000000000000000000000000 +Ciphertext: 6CE35F565BC4F38D73116267C49D345B7B19D57D5C90136CAF512F76AF47FAAD +Test: Encrypt +Comment: Set 2, vector 157 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000004000000000000000000000000 +Ciphertext: FD0DF28AFE47414F99219AD120F33DCA6F8756B2264349911041B0AEC9D77A43 +Test: Encrypt +Comment: Set 2, vector 158 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000002000000000000000000000000 +Ciphertext: 49CE284D7A18A0608E5E3768286E919DE97DD81B369AB0A012AD7BDC491DED1A +Test: Encrypt +Comment: Set 2, vector 159 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000001000000000000000000000000 +Ciphertext: 12B27FEC757A809C68F670698E5CB40E762855022FC12DE2332DB9814FC6E5E2 +Test: Encrypt +Comment: Set 2, vector 160 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000800000000000000000000000 +Ciphertext: 53074884476D09C729F35C3906046C2DCBA7F12BF59CDD3CE73ABF91847C6369 +Test: Encrypt +Comment: Set 2, vector 161 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000400000000000000000000000 +Ciphertext: D29E3C55DD3D867D7263D2C961FDB6A97B8D827AB73A20479ACB06DF992AEC24 +Test: Encrypt +Comment: Set 2, vector 162 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000200000000000000000000000 +Ciphertext: 4BE421463C6F2CC8118A50684EB5FC98323EA27F03D4B98EC05727BA0FFA40E8 +Test: Encrypt +Comment: Set 2, vector 163 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000100000000000000000000000 +Ciphertext: A96EC7F07298F9D86A811D0110D60E65C80F3E913B575831A5E8533932196B24 +Test: Encrypt +Comment: Set 2, vector 164 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000080000000000000000000000 +Ciphertext: F12B579997BA4203D8A0FF36181E4C1B50C703FE32CF18D9BF84355BC404D135 +Test: Encrypt +Comment: Set 2, vector 165 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000040000000000000000000000 +Ciphertext: 35EBB3FE5FACC9B9D321E82A73C344CA05D0E73372579349A1F365DEA0105292 +Test: Encrypt +Comment: Set 2, vector 166 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000020000000000000000000000 +Ciphertext: 0F1F0518D57ADC91D810B5899EB7EE7900D05AD8AD2960FE07893F30859B636F +Test: Encrypt +Comment: Set 2, vector 167 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000010000000000000000000000 +Ciphertext: A6CAF97EF17BEFDCF3412D7F45F72C1F1726198ED3B5CD905DF9078DCD70F882 +Test: Encrypt +Comment: Set 2, vector 168 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000008000000000000000000000 +Ciphertext: E287019353E8C71C62178B3AF7A3ECA210D79F803F43C09B6C08F295367A30CA +Test: Encrypt +Comment: Set 2, vector 169 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000004000000000000000000000 +Ciphertext: CF7A7ECEA347875A7B9191BF9FFDC3FB53512052FA42370E39BF5D906EE82D4E +Test: Encrypt +Comment: Set 2, vector 170 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000002000000000000000000000 +Ciphertext: 7E362B5B5ED5CAB9A518320E498FDB915BFD72BB5C588495AC49FC2D5CEC2134 +Test: Encrypt +Comment: Set 2, vector 171 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000001000000000000000000000 +Ciphertext: 69254195C6A9A4D334F8F0558A6C9635EB8A397E5AB672E81DC194AFA5C3A8B7 +Test: Encrypt +Comment: Set 2, vector 172 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000800000000000000000000 +Ciphertext: 3934A6BA3DE9885771111CBA59D50EC684F8F612AAAE3E511C0A211D972723C4 +Test: Encrypt +Comment: Set 2, vector 173 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000400000000000000000000 +Ciphertext: BCEE40ADD3CFDE924F58786640A56A68FE83615EDD82873DF6908057AF39F74A +Test: Encrypt +Comment: Set 2, vector 174 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000200000000000000000000 +Ciphertext: 70F4E0381A989C486A45FAE5B108373E950843EE48DC2A43E7AA625BF3AC9838 +Test: Encrypt +Comment: Set 2, vector 175 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000100000000000000000000 +Ciphertext: FAED24C44DE7F447CD1169F4D8D734E55154B73F79B31AD1CD310C7F5529433A +Test: Encrypt +Comment: Set 2, vector 176 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000080000000000000000000 +Ciphertext: 887BA60DED98C75DADDC1CD0824E7E6C76D947617A919A3B870B489CD1B7F6B2 +Test: Encrypt +Comment: Set 2, vector 177 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000040000000000000000000 +Ciphertext: 33D833FFDB7BEB6BBAB4DDACA6784B88C4B76A49641AA01BC980AB31084F4351 +Test: Encrypt +Comment: Set 2, vector 178 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000020000000000000000000 +Ciphertext: 8CDEF08AB44C2CB2AB5EC94437E501A96999B30C045A79DE99E220595B95DA2F +Test: Encrypt +Comment: Set 2, vector 179 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000010000000000000000000 +Ciphertext: 029247C8EC0610E7F5B49FA4191E99CDECBC1E44DF123270901A57DE8ED64850 +Test: Encrypt +Comment: Set 2, vector 180 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000008000000000000000000 +Ciphertext: 08487E1E53C677CA34640459BDBF7C53247DD54624B9C2156A59F24A818A258E +Test: Encrypt +Comment: Set 2, vector 181 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000004000000000000000000 +Ciphertext: 2C7C0444738DB202D9236CF00E1B75F579E18CAD4341093675F66732746F8060 +Test: Encrypt +Comment: Set 2, vector 182 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000002000000000000000000 +Ciphertext: F493AF90C19A9EA6460AE35418D4857236D678B570352665092854CFF9FB684E +Test: Encrypt +Comment: Set 2, vector 183 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000001000000000000000000 +Ciphertext: 4575CF8865954F9FDCC9C2F7A41BFD52B1C770E2C7609151E41D9B1D0489500C +Test: Encrypt +Comment: Set 2, vector 184 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000800000000000000000 +Ciphertext: BA0606FA831D4EF759CF457F88B0EEDFDF13BD3ABF72547456052C877B9E3A3B +Test: Encrypt +Comment: Set 2, vector 185 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000400000000000000000 +Ciphertext: 10E979D310CAD332AA3DC860EF69B2BBD96E817BFB93393AD4D8B141C0A301E4 +Test: Encrypt +Comment: Set 2, vector 186 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000200000000000000000 +Ciphertext: B46DE2A7729FAF7CEE978353D4392EA23FE1BB36732D101377C603125125FE62 +Test: Encrypt +Comment: Set 2, vector 187 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000100000000000000000 +Ciphertext: F03E1B911C1EDD769CAD59A744FAD47CB5E19502C1E7F4F0B3197101F3B673C1 +Test: Encrypt +Comment: Set 2, vector 188 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000080000000000000000 +Ciphertext: A9128F8B0C1809095597110471DD7F10040AE71626E8C694BA529B4C9E1353A2 +Test: Encrypt +Comment: Set 2, vector 189 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000040000000000000000 +Ciphertext: B9EDCD81B2CFB461C1FC554ED71CCC958AF4B2B726C011173F4058C40211C496 +Test: Encrypt +Comment: Set 2, vector 190 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000020000000000000000 +Ciphertext: 400F0635E34B796116E3752A0EDA47C3ABC19641DDD60427B4CE3AA8700CEA8E +Test: Encrypt +Comment: Set 2, vector 191 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000010000000000000000 +Ciphertext: 0E526F1012B80F22F946FD51D776187DEFD554B1F5806102E7DD9277FE06B826 +Test: Encrypt +Comment: Set 2, vector 192 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000008000000000000000 +Ciphertext: 1FC0DA71F72D08CDD0F59120C4A88E793869A2C598BAB97C92D6C63C0FAEADA9 +Test: Encrypt +Comment: Set 2, vector 193 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000004000000000000000 +Ciphertext: C493FDECD4D49D5FC6D8590C70BEAAD97EB7694244201CA4CF1732E03D7A4251 +Test: Encrypt +Comment: Set 2, vector 194 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000002000000000000000 +Ciphertext: C532BFE04C6CA7E8B4ABFF9E8BD9C676CBC9AA78FEF4A2DC5CC907742B3ED64F +Test: Encrypt +Comment: Set 2, vector 195 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000001000000000000000 +Ciphertext: 5C8F3ECB07F0264162A9C01A6BB2BC5CF3C7B9ED315803BF86A72406C2655242 +Test: Encrypt +Comment: Set 2, vector 196 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000800000000000000 +Ciphertext: 8C13C039C13DF9C8D821D33E85AFE93EEAFCFC2A2F06D85B3BDE2743FC37AD3F +Test: Encrypt +Comment: Set 2, vector 197 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000400000000000000 +Ciphertext: 3D990835001730714D0880420F57041E37A7FAF1FCA991AA38C409C80F2DC61F +Test: Encrypt +Comment: Set 2, vector 198 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000200000000000000 +Ciphertext: EC44357D4F18EBE148B47AB546D6A5F3E08F8F6C9E2B8B6B99FF303814BF43BA +Test: Encrypt +Comment: Set 2, vector 199 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000100000000000000 +Ciphertext: 00C3B30C81FBC65B9E12C8D6429104FDF40D322D47A59E637FC8CE749725BDCC +Test: Encrypt +Comment: Set 2, vector 200 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000080000000000000 +Ciphertext: 6136C065D96E7F18AB296F86AF04BB264A6DA61DEA7C5413C9131B7EBE551B88 +Test: Encrypt +Comment: Set 2, vector 201 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000040000000000000 +Ciphertext: 2A363A08CAD79DF6A3F2DF5D842B14935C5D09C9D6C78C4989ADCB018A735A5D +Test: Encrypt +Comment: Set 2, vector 202 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000020000000000000 +Ciphertext: B25955B31CC449A42502D1AB61D699DE558BA2C7825BA06B17B239851E575880 +Test: Encrypt +Comment: Set 2, vector 203 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000010000000000000 +Ciphertext: CBE2FD81D74436E167D6A5CF8F7DC07338885146351483E4474CD213D853A6FE +Test: Encrypt +Comment: Set 2, vector 204 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000008000000000000 +Ciphertext: 66DE9DCBF2B85FF944EDD40B3D81F5F8699DB1982C045667FDE9A499A7777DD6 +Test: Encrypt +Comment: Set 2, vector 205 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000004000000000000 +Ciphertext: D940E3F69C42E847312E473E362FD609BE7780D99DAC30F8F095D58EFDC58D59 +Test: Encrypt +Comment: Set 2, vector 206 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000002000000000000 +Ciphertext: 60FBA04239A8C312E10C7773673E94678CB1E13B069759AF304C56CCA6F490DD +Test: Encrypt +Comment: Set 2, vector 207 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000001000000000000 +Ciphertext: D67E081F763F322BA82FA01E184C355A65DE8028E47BF0DB5FCAEDA8C2593F02 +Test: Encrypt +Comment: Set 2, vector 208 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000800000000000 +Ciphertext: 434868F9A6086D0F9218E02CB9534E9EEE88B90C6174A4306B0D0843A35CFDFD +Test: Encrypt +Comment: Set 2, vector 209 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000400000000000 +Ciphertext: B6CCB5899745E29FEE7870B22C2F989D84C98C4510DEA892666E187CDEF77E1A +Test: Encrypt +Comment: Set 2, vector 210 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000200000000000 +Ciphertext: E798F9255A21E0ECDC4BA638F0BF03BAA0AD7810844837582193D7FB3E11B5DF +Test: Encrypt +Comment: Set 2, vector 211 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000100000000000 +Ciphertext: 9BAE51C5C4DF9E55570EF0FE5F2C6AC0CF9FD953E65CD07ED12378BD5A0F2911 +Test: Encrypt +Comment: Set 2, vector 212 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000080000000000 +Ciphertext: 95ECC45EEDD4537D6A7D54D60A64CBFB6728982441C7EE10B7A84A80B51EE171 +Test: Encrypt +Comment: Set 2, vector 213 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000040000000000 +Ciphertext: D8D77750B38E522216DA0A1A9DB7C56788E504708A2048B66946FB83C1981FCB +Test: Encrypt +Comment: Set 2, vector 214 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000020000000000 +Ciphertext: 0CAA8435D051798DB289708EC6CC4C98F0018AB7F068FA0E40443A1F227002CD +Test: Encrypt +Comment: Set 2, vector 215 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000010000000000 +Ciphertext: 5410408C0306460E6033543669A26A63F7C7BBDFEF4273C9BAD8AC472EDAFB67 +Test: Encrypt +Comment: Set 2, vector 216 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000008000000000 +Ciphertext: DD3A0F7B61D056015B54A329882E942ECA3C5C3F64ACFE71E3255A8F53E1AD73 +Test: Encrypt +Comment: Set 2, vector 217 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000004000000000 +Ciphertext: 80A70BE4CC4C61C0F7F501E8068C75CEA78DC11A224D0C47C09D20361C99CF00 +Test: Encrypt +Comment: Set 2, vector 218 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000002000000000 +Ciphertext: BEF3417464A46BBD2B7E9FB967F4FBF406C2B5B9C8B076B770C199C003786A40 +Test: Encrypt +Comment: Set 2, vector 219 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000001000000000 +Ciphertext: C1756ADF6EEF9837B43C4B032B17A79C3A583EE37981CC495CA95893F34218A6 +Test: Encrypt +Comment: Set 2, vector 220 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000800000000 +Ciphertext: 90273FCA31968871BE3D5C76AFCB47D9ECC31A48B87988FD359E93AFF6815F4D +Test: Encrypt +Comment: Set 2, vector 221 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000400000000 +Ciphertext: D0A5F666F7A819EF8BA114C1872158179731F6989997E13AFD73DB252E5CD2A2 +Test: Encrypt +Comment: Set 2, vector 222 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000200000000 +Ciphertext: D4E3DA34C47E5A86A723ED5B9F615B283E4CD54E9F2ED9EAA98A7AB8DE41B14C +Test: Encrypt +Comment: Set 2, vector 223 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000100000000 +Ciphertext: 547227D086EBB538F5836B8E1E65601209AEB6DFD1C450C014C559D879D71862 +Test: Encrypt +Comment: Set 2, vector 224 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000080000000 +Ciphertext: 9E52F033EFE0762ED108095BDF6CD8A89F8E1028F0D3D9B39B601C1084F95F74 +Test: Encrypt +Comment: Set 2, vector 225 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000040000000 +Ciphertext: A049C5B9BD63EBEB23B34EA2F27813D29EDC044E2486D709AC7D2C731557066B +Test: Encrypt +Comment: Set 2, vector 226 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000020000000 +Ciphertext: 1A9CDD2A99C5ED7FB2A6A1870230B0BD6890567E0E4439E248548DF25CB6126E +Test: Encrypt +Comment: Set 2, vector 227 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000010000000 +Ciphertext: 41F2CDA0EFE97BCE8689CF33201B4E57E0600BBB1F274DF3D589915F8EA5C372 +Test: Encrypt +Comment: Set 2, vector 228 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000008000000 +Ciphertext: 1F4712D7AB6D127ABDA90DA977CFC60B44F84859AE4B705851CF687E01E1E250 +Test: Encrypt +Comment: Set 2, vector 229 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000004000000 +Ciphertext: DC93D915CBBC140EDB08B34406F71B4CD38274E92DE8FAF355D274AE7929BC28 +Test: Encrypt +Comment: Set 2, vector 230 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000002000000 +Ciphertext: D2D9A648EDAF9339D7EE52419CC33C42E4CA91AA670D14B78952F41F889122E5 +Test: Encrypt +Comment: Set 2, vector 231 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000001000000 +Ciphertext: F34BA77405D00CAFC3E6786CDB26263C10CDC4D6AFAEDF4C26566A51DB82F5F9 +Test: Encrypt +Comment: Set 2, vector 232 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000800000 +Ciphertext: 21A7EAD6D95FC7AB788206CEA15A25CC4AEB69BAA96C78D5E2851DDBA25523F0 +Test: Encrypt +Comment: Set 2, vector 233 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000400000 +Ciphertext: 822BC3900195E6F224805E77B2460A65FA1A11CFD473F1DFA65351CBB4EFDFEB +Test: Encrypt +Comment: Set 2, vector 234 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000200000 +Ciphertext: 648A71BE1E77866181F980B37690D5C8A37DF29BB2EBC3A41665CD0CCC2E8EF8 +Test: Encrypt +Comment: Set 2, vector 235 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000100000 +Ciphertext: 808E32C933955FF7C8D6F1A4C6754CB3B7311612CFF846D02C81B712C78EB63E +Test: Encrypt +Comment: Set 2, vector 236 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000080000 +Ciphertext: E074251CC7C5BFFCE2CA45933206B2EE8864156A4626C03EA030B71F8BD454BE +Test: Encrypt +Comment: Set 2, vector 237 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000040000 +Ciphertext: 72EBE213A06F63603B49A750808F348FF7C9E4EC72884FDA7C58968EC5A25EED +Test: Encrypt +Comment: Set 2, vector 238 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000020000 +Ciphertext: 20618612C2AF418DE3E185AF7973D508DC31DE1E9D9FB4FDF9E95FD592F567EF +Test: Encrypt +Comment: Set 2, vector 239 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000010000 +Ciphertext: F94C66D4884A657BF0A6A6EA31A90A07F193F55465575FF1BF8DE68F3441BF4E +Test: Encrypt +Comment: Set 2, vector 240 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000008000 +Ciphertext: 9636DCAB40FB991FC330D8EFD671FF83BAA0C9E33D7A146D5E7ADC53592B605F +Test: Encrypt +Comment: Set 2, vector 241 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000004000 +Ciphertext: FC21689B5F46A011ECFE1E314E03ED7105BAC620193714B2290087C17FB763B6 +Test: Encrypt +Comment: Set 2, vector 242 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000002000 +Ciphertext: ABD2583E0FCC95122FDC700AF9B1FDA50D91E752E19BE9D2EE4F5E22033D53C6 +Test: Encrypt +Comment: Set 2, vector 243 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000001000 +Ciphertext: 3501CD56EE5EA39AB32F38371E5C2CF6EEEB9DA82D210A8D88AE8F29917AE9F4 +Test: Encrypt +Comment: Set 2, vector 244 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000800 +Ciphertext: 7559A2AA6CBFA8A181565EDDDE323DB80CE740545FFEE13B4851980AD2451E24 +Test: Encrypt +Comment: Set 2, vector 245 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000400 +Ciphertext: CEF6DBFD1FBCCBB587BD748D6CC992F8EF671A829E2D6AD73D1DC1C1B2A9E8DD +Test: Encrypt +Comment: Set 2, vector 246 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000200 +Ciphertext: 46FBBCD26A1F879746BDF4FF7804A5C105F621837ABCF94F17123B700A58A08A +Test: Encrypt +Comment: Set 2, vector 247 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000100 +Ciphertext: 0B10D2DA0E0FB6F067D641FF7F8C9C8FF4E2D689450787B7136ADF38DC1F2948 +Test: Encrypt +Comment: Set 2, vector 248 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000080 +Ciphertext: 4492E09E73459BF74417FC0D7190DA719A891C9CAE14801944FFB24912E377A8 +Test: Encrypt +Comment: Set 2, vector 249 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000040 +Ciphertext: 76D72C3D3AF6F2FF6AFBC0C1A553E6F8171D81D6BB1CB3C3A6C43ED826A88FAA +Test: Encrypt +Comment: Set 2, vector 250 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000020 +Ciphertext: D912041134584B69AC01938EC88913DBCFF7CDBE93CDF7443BD465F1B2E3F7F5 +Test: Encrypt +Comment: Set 2, vector 251 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000010 +Ciphertext: F0883EB64A5345CC9A0055D4E882D199EFFC334C05B53BC4132AC1A51BA39A9F +Test: Encrypt +Comment: Set 2, vector 252 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000008 +Ciphertext: 276246B0D93A4E6FF05832F51D2BF60641B63594EB90A1E08A7D98C6DDAE1461 +Test: Encrypt +Comment: Set 2, vector 253 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000004 +Ciphertext: 6AA2B04BF65F4213583CED5347537123DC3BE0703209170D1D34B0B8A66C1C58 +Test: Encrypt +Comment: Set 2, vector 254 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000002 +Ciphertext: DC438414927E453DBFD91DC60C635EE4273A9921A134DB513AB2BBDBAE64A9AD +Test: Encrypt +Comment: Set 2, vector 255 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000001 +Ciphertext: 45D43E9288738C5AD1A683D8DE59CEDD22D666A2B7078EB1301B532A272D570B +Test: Encrypt +Comment: Set 3, vector 0 +Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 +Ciphertext: 7CA51614425C3BA8CE54DD2FC2020AE7B6E574D198136D0FAE7E26CCBF0BE7A6 +Test: Encrypt +Comment: Set 3, vector 1 +Key: 01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +Plaintext: 0101010101010101010101010101010101010101010101010101010101010101 +Ciphertext: C4B7C6A9738C77EE28F7E685C8358E0AF88FB6D23955EE6DF49FE3F5DA16F826 +Test: Encrypt +Comment: Set 3, vector 2 +Key: 02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +Plaintext: 0202020202020202020202020202020202020202020202020202020202020202 +Ciphertext: CD108DD9EC1000B79C75AA3DCC88F913E6F52773853035A5C44F3245B134CBFF +Test: Encrypt +Comment: Set 3, vector 3 +Key: 03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303 +Plaintext: 0303030303030303030303030303030303030303030303030303030303030303 +Ciphertext: E8F9DE8F066B675AE90C919FC4981603485BBB92382D8C844CAF707973D5276D +Test: Encrypt +Comment: Set 3, vector 4 +Key: 04040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404 +Plaintext: 0404040404040404040404040404040404040404040404040404040404040404 +Ciphertext: 6AA777340200C1B65AB25193A8BB267C233DAC7E1B3C523D406FC5B567B7B586 +Test: Encrypt +Comment: Set 3, vector 5 +Key: 05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +Plaintext: 0505050505050505050505050505050505050505050505050505050505050505 +Ciphertext: 6B14A9C454143376DBDC3C93FB8096B09C01456B0B55412FD9692CD7CB587069 +Test: Encrypt +Comment: Set 3, vector 6 +Key: 06060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606 +Plaintext: 0606060606060606060606060606060606060606060606060606060606060606 +Ciphertext: 3FED53DEF4FBC1D012B36562132AB40049818DA4E62E86716DE5EF70790B0D6A +Test: Encrypt +Comment: Set 3, vector 7 +Key: 07070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707 +Plaintext: 0707070707070707070707070707070707070707070707070707070707070707 +Ciphertext: 7A428F7A6841BC8F0E99335C5021C413D2639321DC8D9F280A2F0EF4B420A212 +Test: Encrypt +Comment: Set 3, vector 8 +Key: 08080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808 +Plaintext: 0808080808080808080808080808080808080808080808080808080808080808 +Ciphertext: A23BE32D37FA4054EC45D6A9CC643AF9124EDAA4AD9ABC7FAAB449D39D11B128 +Test: Encrypt +Comment: Set 3, vector 9 +Key: 09090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909 +Plaintext: 0909090909090909090909090909090909090909090909090909090909090909 +Ciphertext: 972195D6756F7D3A4D13BF49BFBCE7D164460355150C297A41CCC6AA9F31C5D6 +Test: Encrypt +Comment: Set 3, vector 10 +Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A +Ciphertext: 2AA722C58EBDB7701225BA9C3B1F7C946D57DEDC74FEDDB637EB14E27A0F0CC9 +Test: Encrypt +Comment: Set 3, vector 11 +Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B +Ciphertext: 1C9A0420B9F6EF013FB3ADB4F20C862B61702BA479276E3187322B33D4B128C2 +Test: Encrypt +Comment: Set 3, vector 12 +Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C +Ciphertext: 666CC3862BAACADA4D35A9079D52438FB3B4416C9938397E61D48066B6476068 +Test: Encrypt +Comment: Set 3, vector 13 +Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D +Ciphertext: DB94504EF884901FAA5778199329A2DCC9AA50A4453172CE8ADE11BFE54234E9 +Test: Encrypt +Comment: Set 3, vector 14 +Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E +Ciphertext: DF0B4204DB7E0924BD2931C131E6DFEB013A5844F717DF7A2DEF86FBC2125DA6 +Test: Encrypt +Comment: Set 3, vector 15 +Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +Ciphertext: D7C2D4257254E7A05657047B43B65AB778C9E6ACDE53F14000FDFC346CEE4BA6 +Test: Encrypt +Comment: Set 3, vector 16 +Key: 10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 +Plaintext: 1010101010101010101010101010101010101010101010101010101010101010 +Ciphertext: F64819DFBEBE0A6DB650E7072CE28EA606586418B317785FF0AD44212A84C82C +Test: Encrypt +Comment: Set 3, vector 17 +Key: 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +Plaintext: 1111111111111111111111111111111111111111111111111111111111111111 +Ciphertext: 155B7E6FFCC0AA874E22494545374E97C08A3D1B1045A0F35FFC54B2842D02A4 +Test: Encrypt +Comment: Set 3, vector 18 +Key: 12121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212 +Plaintext: 1212121212121212121212121212121212121212121212121212121212121212 +Ciphertext: FEE12FD9E87DCB4FE5C5249E3EAEDA0514F6A4826C1A5ABC87E22B95D4A84851 +Test: Encrypt +Comment: Set 3, vector 19 +Key: 13131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313 +Plaintext: 1313131313131313131313131313131313131313131313131313131313131313 +Ciphertext: 1DA785C2A2CEFED459474EE5401F5B795F6ED468DBB924CFFCF65EF465DE9534 +Test: Encrypt +Comment: Set 3, vector 20 +Key: 14141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414 +Plaintext: 1414141414141414141414141414141414141414141414141414141414141414 +Ciphertext: 4434A4D83273B06B64AF4ED1D70EEAD50DBFC44C5931A7B7B98FF9F514B229E9 +Test: Encrypt +Comment: Set 3, vector 21 +Key: 15151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515 +Plaintext: 1515151515151515151515151515151515151515151515151515151515151515 +Ciphertext: 1AB982A6C64C2C42D05F9FB8ED9BE0EEB5B48CEE8EAB0250D98D43157E999EDC +Test: Encrypt +Comment: Set 3, vector 22 +Key: 16161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616 +Plaintext: 1616161616161616161616161616161616161616161616161616161616161616 +Ciphertext: 83291A3265ACAB71E5CCCF0281A433579F39AE6C2FB7CB7528D7F820158177FF +Test: Encrypt +Comment: Set 3, vector 23 +Key: 17171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717 +Plaintext: 1717171717171717171717171717171717171717171717171717171717171717 +Ciphertext: 90F1FF9F69854321CFC6D0A4541CCDF73C1A1DC737D96FB76F0DDD0BB0097BBA +Test: Encrypt +Comment: Set 3, vector 24 +Key: 18181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818 +Plaintext: 1818181818181818181818181818181818181818181818181818181818181818 +Ciphertext: ABF9813765AFBEA9BF26026716294D5C5B309243339ECC9F21CEADE6E7083266 +Test: Encrypt +Comment: Set 3, vector 25 +Key: 19191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919 +Plaintext: 1919191919191919191919191919191919191919191919191919191919191919 +Ciphertext: 7B5C8222D85392E82E703ADFB0FF02DBD2297791B84E26A3A1ED12309247D064 +Test: Encrypt +Comment: Set 3, vector 26 +Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A +Ciphertext: 227355246FCC9106FA5572475E8C466F1140CD75A8A84DFCD2B0908392914FD7 +Test: Encrypt +Comment: Set 3, vector 27 +Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B +Ciphertext: E5E5A887FA888691FF93014C2E368DC10775A447A5EF4B632A089DA82D245BE3 +Test: Encrypt +Comment: Set 3, vector 28 +Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Ciphertext: BA417FC94107761C0969EF6EA7DDC74E5F85CAB61E2271CEB6D9C98B139F4576 +Test: Encrypt +Comment: Set 3, vector 29 +Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D +Ciphertext: F3B85912DF6950B9AE28CE08E456D494E0C949A36FA102540C51827AEC9168AB +Test: Encrypt +Comment: Set 3, vector 30 +Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E +Ciphertext: 1AC0ED993D24366380522B05F97B6FC64B199241A1D556B992632AEE400F0494 +Test: Encrypt +Comment: Set 3, vector 31 +Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F +Ciphertext: 3550CD591130231B0F01F6860B699715B98B9497B4035C7323000D67C5F0B1B7 +Test: Encrypt +Comment: Set 3, vector 32 +Key: 20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 +Plaintext: 2020202020202020202020202020202020202020202020202020202020202020 +Ciphertext: E267D6113C27170A3EE6DF496E801A6131BBD3444365D7C03791E25610F1A0E4 +Test: Encrypt +Comment: Set 3, vector 33 +Key: 21212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121 +Plaintext: 2121212121212121212121212121212121212121212121212121212121212121 +Ciphertext: 3D71B778381E70BCC1A7B8411208225FC922857E862FC17312E3782CEA289B15 +Test: Encrypt +Comment: Set 3, vector 34 +Key: 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 +Plaintext: 2222222222222222222222222222222222222222222222222222222222222222 +Ciphertext: 16B41DE00DBF29B96CC59E246DE3188B786E097394E9EEE2250169AE00306FD8 +Test: Encrypt +Comment: Set 3, vector 35 +Key: 23232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323 +Plaintext: 2323232323232323232323232323232323232323232323232323232323232323 +Ciphertext: 99DDE88C9F26D270B3C507A25FE49955A0FEA6C8FEBAD133842DA1CE730EEB7F +Test: Encrypt +Comment: Set 3, vector 36 +Key: 24242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424 +Plaintext: 2424242424242424242424242424242424242424242424242424242424242424 +Ciphertext: 9766D3F9E73987EE10A20605C8338C0759A7024CF2DF549DE5084EC4902C550A +Test: Encrypt +Comment: Set 3, vector 37 +Key: 25252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525 +Plaintext: 2525252525252525252525252525252525252525252525252525252525252525 +Ciphertext: 0FFD89849C8EC5A46B8F43C799ED305AF602C73E810FC729A8C9BB0F5C55CD54 +Test: Encrypt +Comment: Set 3, vector 38 +Key: 26262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626 +Plaintext: 2626262626262626262626262626262626262626262626262626262626262626 +Ciphertext: 91956E101CE4546623A5BE49811F167476CB568972CEBF7A59EB27DA524A0C6B +Test: Encrypt +Comment: Set 3, vector 39 +Key: 27272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 +Plaintext: 2727272727272727272727272727272727272727272727272727272727272727 +Ciphertext: 7DEC5ECE0D590EE3E099C07F2DD6A6A9C71632D277803FD007275B93369ABED0 +Test: Encrypt +Comment: Set 3, vector 40 +Key: 28282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828 +Plaintext: 2828282828282828282828282828282828282828282828282828282828282828 +Ciphertext: 039C192AFC54EFDE1ED3610B0E9F95AA08D7CDC6AE71A66B5C508E4D14C038CF +Test: Encrypt +Comment: Set 3, vector 41 +Key: 29292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929 +Plaintext: 2929292929292929292929292929292929292929292929292929292929292929 +Ciphertext: D558F8F4562BD8FE816FABF621556C8416C6FD00209028DF978F8915CC093E16 +Test: Encrypt +Comment: Set 3, vector 42 +Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A +Ciphertext: 1AE21791ED4B610DD693012518759D6E9C1BBF206482EEA43470F02B493CFFB8 +Test: Encrypt +Comment: Set 3, vector 43 +Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B +Ciphertext: 34F2112E8FBD1B373BA8400B05321F658FDFE0DC87C1304C36766DE71840A4DF +Test: Encrypt +Comment: Set 3, vector 44 +Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C +Ciphertext: DBF9B56BBF2E50DF321CA687F8BE0E6222E7DF52B4A142174058CC119D9EC0DA +Test: Encrypt +Comment: Set 3, vector 45 +Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D +Ciphertext: 8B2757374F778FE0B30D11AD7116CE37E2AB858A4E1C50D1115B6E328F3635F5 +Test: Encrypt +Comment: Set 3, vector 46 +Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E +Ciphertext: 06588A873366FAA47323C9A098A759718DFB0E310C91A4E38B42CC56A0757811 +Test: Encrypt +Comment: Set 3, vector 47 +Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F +Ciphertext: 7B861B18E3F322D8000BDDCBCE3B50405AA923375568F16AE84411E91DB879C3 +Test: Encrypt +Comment: Set 3, vector 48 +Key: 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030 +Plaintext: 3030303030303030303030303030303030303030303030303030303030303030 +Ciphertext: 170F74A4D692C302551EE17CD544D65185112D2A5E812D203B36FC39BF1DA9C7 +Test: Encrypt +Comment: Set 3, vector 49 +Key: 31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 +Plaintext: 3131313131313131313131313131313131313131313131313131313131313131 +Ciphertext: 0178F59DDAB05A4DFAF66FD406170E08227096EF9712CB481A26EBD82F470D7A +Test: Encrypt +Comment: Set 3, vector 50 +Key: 32323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232 +Plaintext: 3232323232323232323232323232323232323232323232323232323232323232 +Ciphertext: 8BAC479F3A92DF71F973AA457E19D75FB0F1A0FE68FF440A86154721BCC345D4 +Test: Encrypt +Comment: Set 3, vector 51 +Key: 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 +Plaintext: 3333333333333333333333333333333333333333333333333333333333333333 +Ciphertext: EB50A10C7A0ED9960CDE0C3EDB899A6B67324B1EE23DE4BB13F60D187C3CBA35 +Test: Encrypt +Comment: Set 3, vector 52 +Key: 34343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434 +Plaintext: 3434343434343434343434343434343434343434343434343434343434343434 +Ciphertext: 00AA782AC61FD06DC781E3C5662C65BD1043EC28D056C98F07074DA7C11C1E1F +Test: Encrypt +Comment: Set 3, vector 53 +Key: 35353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535 +Plaintext: 3535353535353535353535353535353535353535353535353535353535353535 +Ciphertext: 23B9F2F26CFC51ECC6DD1AFE614C2DAE8348DA033F9B67AEAA87B71F5377D95D +Test: Encrypt +Comment: Set 3, vector 54 +Key: 36363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636 +Plaintext: 3636363636363636363636363636363636363636363636363636363636363636 +Ciphertext: 9655D4B1CBEF855401274C3339C16DB9B5A9651F60579CFE8554B6EE25DCCA0E +Test: Encrypt +Comment: Set 3, vector 55 +Key: 37373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737 +Plaintext: 3737373737373737373737373737373737373737373737373737373737373737 +Ciphertext: E072ED2DAD79B07C48B50ED31E02FD9705562525D49DBF45DACCFDF35D5A6965 +Test: Encrypt +Comment: Set 3, vector 56 +Key: 38383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838 +Plaintext: 3838383838383838383838383838383838383838383838383838383838383838 +Ciphertext: 287638BAE945B88A95029155BC47D033B5C5C4C191F079C234C6E97683FFABA0 +Test: Encrypt +Comment: Set 3, vector 57 +Key: 39393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939 +Plaintext: 3939393939393939393939393939393939393939393939393939393939393939 +Ciphertext: 500CD3B02BF6FA8C66D1ADE0CE43B325A759CD3426096084A261F054D798F885 +Test: Encrypt +Comment: Set 3, vector 58 +Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Ciphertext: 17614BAB583F2DCF809A2AEE973A4875251B571525521B3A8C47303450B6301F +Test: Encrypt +Comment: Set 3, vector 59 +Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B +Ciphertext: 978C8DFD9AC74FF670CC8B31EDC8EC15DDBC2854375ED9BA07BB0F7B96C70BB3 +Test: Encrypt +Comment: Set 3, vector 60 +Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C +Ciphertext: 994CA36F6230C7DB63CAD61342FAB3F155C361DAD458FC457AD09ACCAB2EB43F +Test: Encrypt +Comment: Set 3, vector 61 +Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D +Ciphertext: AC06659932208AC1DD5F07448A7407232F1410CDAC92F7C5305C4043C559345F +Test: Encrypt +Comment: Set 3, vector 62 +Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E +Ciphertext: B55616F0743A29655FEC468CD30C8C65F7925327665670BA9E41A2E09C05C63B +Test: Encrypt +Comment: Set 3, vector 63 +Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F +Ciphertext: 78F4852712C3547547A114E73F52C6128EDD3F29E0B2C938D6F9F69AF2303FD2 +Test: Encrypt +Comment: Set 3, vector 64 +Key: 40404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040 +Plaintext: 4040404040404040404040404040404040404040404040404040404040404040 +Ciphertext: C97909916EE86FFDCE8A92903046109B53F788A53039434DF1A394DAD6F697A2 +Test: Encrypt +Comment: Set 3, vector 65 +Key: 41414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141 +Plaintext: 4141414141414141414141414141414141414141414141414141414141414141 +Ciphertext: C3FD3C59D37D44AF9EE6B87AC0939A4A4B2FBAAC23E80E72B1CAC352FE30A8E2 +Test: Encrypt +Comment: Set 3, vector 66 +Key: 42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 +Plaintext: 4242424242424242424242424242424242424242424242424242424242424242 +Ciphertext: 94C70F7654479BC9DA9854129F57F3E69C31B63900A404F577AF1C83CD96E5D6 +Test: Encrypt +Comment: Set 3, vector 67 +Key: 43434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343 +Plaintext: 4343434343434343434343434343434343434343434343434343434343434343 +Ciphertext: 71DD024E9CE700B373A275AA870A68B5DAD9E47D38BC18F34073319041A1CADF +Test: Encrypt +Comment: Set 3, vector 68 +Key: 44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 +Plaintext: 4444444444444444444444444444444444444444444444444444444444444444 +Ciphertext: 274D101B2BD0E7CAFC9E5559DC68567DC8975056B84573C4294D78513B7406D8 +Test: Encrypt +Comment: Set 3, vector 69 +Key: 45454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545 +Plaintext: 4545454545454545454545454545454545454545454545454545454545454545 +Ciphertext: 8DCE5B5C376E42F11A322D8CBCEB8C0AE1EC24F3C65D72B326708FEAF13E3B51 +Test: Encrypt +Comment: Set 3, vector 70 +Key: 46464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646 +Plaintext: 4646464646464646464646464646464646464646464646464646464646464646 +Ciphertext: D62D3BA9BBD23F4424EB929AE7A4CD83A70FA7EFD2E6CCFED23E1176AFDB69CD +Test: Encrypt +Comment: Set 3, vector 71 +Key: 47474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747 +Plaintext: 4747474747474747474747474747474747474747474747474747474747474747 +Ciphertext: FE7670925FEA3AAE1F039590EA230C094C3E434BF1350B12D4EA26E48A6EF7F0 +Test: Encrypt +Comment: Set 3, vector 72 +Key: 48484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848 +Plaintext: 4848484848484848484848484848484848484848484848484848484848484848 +Ciphertext: 3A57E728BFA31AA36C8E4ED38A34B465BA233AD066225F31651C93B870AAFE6D +Test: Encrypt +Comment: Set 3, vector 73 +Key: 49494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949 +Plaintext: 4949494949494949494949494949494949494949494949494949494949494949 +Ciphertext: 3B56014035A28EA6F2F2B09429FED7FC0F5B76D5458F1EB4F3AAA7E7F6610C65 +Test: Encrypt +Comment: Set 3, vector 74 +Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A +Ciphertext: 2D28A28ECABAC61B540CD933BE43AF16F11429EDE8E7B62121CD853054363730 +Test: Encrypt +Comment: Set 3, vector 75 +Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B +Ciphertext: D8A892E3C24C6A2EB8446B3737A0E3AA1478811B819FFD3440B5307185906518 +Test: Encrypt +Comment: Set 3, vector 76 +Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C +Ciphertext: 798AD5E43127299B61247059F508268CDBA78B46D4FD28C200AE1052C52294E7 +Test: Encrypt +Comment: Set 3, vector 77 +Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D +Ciphertext: 63F43065BA1F262D950219D71B9CD5FA78D6798BCAA981FE3391FF8EA735E4C7 +Test: Encrypt +Comment: Set 3, vector 78 +Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E +Ciphertext: E8E461EB5FD98011A37765ECA336B080D58B35C636AD6F423893EE768913255C +Test: Encrypt +Comment: Set 3, vector 79 +Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F +Ciphertext: 7348E30FFC0C4F5569B6490622A34FB015C364944553582355887BC472279E8D +Test: Encrypt +Comment: Set 3, vector 80 +Key: 50505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050 +Plaintext: 5050505050505050505050505050505050505050505050505050505050505050 +Ciphertext: BE28CB05EEEEDA8FD8971E9970ECBCA25856F66E95AC8B987C69F04BE3276CD7 +Test: Encrypt +Comment: Set 3, vector 81 +Key: 51515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151 +Plaintext: 5151515151515151515151515151515151515151515151515151515151515151 +Ciphertext: 5D336C5E34D4EB95CFAB87C542C72A748AA45E7F77D841A738017927C7908804 +Test: Encrypt +Comment: Set 3, vector 82 +Key: 52525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252 +Plaintext: 5252525252525252525252525252525252525252525252525252525252525252 +Ciphertext: 2942A594A7964F41460EB6037DDE2C28FFBFFB3C21F7EFF43F06632DA980ED8B +Test: Encrypt +Comment: Set 3, vector 83 +Key: 53535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353 +Plaintext: 5353535353535353535353535353535353535353535353535353535353535353 +Ciphertext: 1C0F7A4E3147BC7F8150D8144ED31D0054FF15414E5DBF289BFEC160D22684AC +Test: Encrypt +Comment: Set 3, vector 84 +Key: 54545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454 +Plaintext: 5454545454545454545454545454545454545454545454545454545454545454 +Ciphertext: 7931C7B9D78CB50610B1BEF596268B94446FCDA44C3EE7CEE53121AC519C4001 +Test: Encrypt +Comment: Set 3, vector 85 +Key: 55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 +Plaintext: 5555555555555555555555555555555555555555555555555555555555555555 +Ciphertext: F4E331C357C603EE5ED5547D75B54631A68D7CD74C5075198D0FC38E5661F556 +Test: Encrypt +Comment: Set 3, vector 86 +Key: 56565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656 +Plaintext: 5656565656565656565656565656565656565656565656565656565656565656 +Ciphertext: 378C2887958E31971E8F59C882730E48407E4DA9C26D4C76B672CD53202AB1B8 +Test: Encrypt +Comment: Set 3, vector 87 +Key: 57575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757 +Plaintext: 5757575757575757575757575757575757575757575757575757575757575757 +Ciphertext: DBE68FE249F4A8D36E1CB49DBE20ED58649CCC502F85895875C1FE82269219DA +Test: Encrypt +Comment: Set 3, vector 88 +Key: 58585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858 +Plaintext: 5858585858585858585858585858585858585858585858585858585858585858 +Ciphertext: 103BD780F3B382C4B28E6E1CB41CBEE22CC1BB64E4A0147D658EDA96A6E7FEAB +Test: Encrypt +Comment: Set 3, vector 89 +Key: 59595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959 +Plaintext: 5959595959595959595959595959595959595959595959595959595959595959 +Ciphertext: 382EF838282E0F4BA729083542BB8CB48AB874FF568DFDA56AFC4ED266DD3243 +Test: Encrypt +Comment: Set 3, vector 90 +Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A +Ciphertext: 088665DE8F9DC9298DEF4164C12526597F56859AAC2C96A95645A06014BA689A +Test: Encrypt +Comment: Set 3, vector 91 +Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B +Ciphertext: EC988946646A1B2DCC7EDEC4FCAB11BF29055A226F4C75D28F9DFB8D2EB5C9B6 +Test: Encrypt +Comment: Set 3, vector 92 +Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C +Ciphertext: B77221CE7F68292BD4E3A55E8EC7BD1FC68B1B6B02F1008586248833C1089F5C +Test: Encrypt +Comment: Set 3, vector 93 +Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D +Ciphertext: B3E4AA5DE6D25A6237FDD97540191D669C64E54A7D3C544E949489355AFC82B5 +Test: Encrypt +Comment: Set 3, vector 94 +Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E +Ciphertext: AAA6FA046AC4270B22A742C4C29445EB38511E5048414886EBF39523B7EAF76A +Test: Encrypt +Comment: Set 3, vector 95 +Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F +Ciphertext: 4D23440171778573BE7B515C68FA99D0426A32111CA493337E7C55280A90F697 +Test: Encrypt +Comment: Set 3, vector 96 +Key: 60606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060 +Plaintext: 6060606060606060606060606060606060606060606060606060606060606060 +Ciphertext: 8EE711FB281CBAA99917C85F0623B68E2EDAFEFCC3B1B841883D71BA6683568A +Test: Encrypt +Comment: Set 3, vector 97 +Key: 61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 +Plaintext: 6161616161616161616161616161616161616161616161616161616161616161 +Ciphertext: EC29DAE53DB4475F8900311F425FE60CB834A82F2A6A2DB4810F95F4D6991B84 +Test: Encrypt +Comment: Set 3, vector 98 +Key: 62626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 +Plaintext: 6262626262626262626262626262626262626262626262626262626262626262 +Ciphertext: 91E58DDE741553572B5D6F3DAD25953906424FF217497226746A25C0CE1C7D0F +Test: Encrypt +Comment: Set 3, vector 99 +Key: 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 +Plaintext: 6363636363636363636363636363636363636363636363636363636363636363 +Ciphertext: B6EC4D9421AB011D4EEDBC32B289E45AC44CAEB1DC5FAEA752DFFA0137325067 +Test: Encrypt +Comment: Set 3, vector 100 +Key: 64646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464 +Plaintext: 6464646464646464646464646464646464646464646464646464646464646464 +Ciphertext: D9CB13EA06CADF09AC446F9B09553FFE3BF4F1152997B171C03E609D4BD60ADB +Test: Encrypt +Comment: Set 3, vector 101 +Key: 65656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 +Plaintext: 6565656565656565656565656565656565656565656565656565656565656565 +Ciphertext: 2D07CA161326ED154D9E3FF650963557EC369A91ABB0D49FC1F32AEF39A3B12E +Test: Encrypt +Comment: Set 3, vector 102 +Key: 66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 +Plaintext: 6666666666666666666666666666666666666666666666666666666666666666 +Ciphertext: 28E8B606EE621D2C5B865B8208C7BD40C3596931CE3FF8FA5AD7EB8EE4480E95 +Test: Encrypt +Comment: Set 3, vector 103 +Key: 67676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767 +Plaintext: 6767676767676767676767676767676767676767676767676767676767676767 +Ciphertext: 9B9B3A23DA29539DA1E9BAA20449750EC192CE14A5063E1A2FFAF5039A665754 +Test: Encrypt +Comment: Set 3, vector 104 +Key: 68686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868 +Plaintext: 6868686868686868686868686868686868686868686868686868686868686868 +Ciphertext: D770E305A9C2D257759D8AE9E70C408D1CB090F976BBAFF3A56730A78BA8BF4F +Test: Encrypt +Comment: Set 3, vector 105 +Key: 69696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969 +Plaintext: 6969696969696969696969696969696969696969696969696969696969696969 +Ciphertext: 453988B10DFD852D1AFD11E96C50024571CCB0F19E7C3C4981F8B8BDCD11F720 +Test: Encrypt +Comment: Set 3, vector 106 +Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A +Ciphertext: 17DFD98CB5C24610DD631C4E2749A679D68F854F21AABE8BF67605A256452AD8 +Test: Encrypt +Comment: Set 3, vector 107 +Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B +Ciphertext: DA260145EC80E19C18685540AC71FA460DD4427168E37BC6E0F967D90C306FBB +Test: Encrypt +Comment: Set 3, vector 108 +Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C +Ciphertext: 2AC246E2E384ECCC4BC69CE82EDB51C05DD864642F1E9A572DA6043DD1D56DF0 +Test: Encrypt +Comment: Set 3, vector 109 +Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D +Ciphertext: D1A06B820071CC4122F0B0797A294F31922E26703CDEF15A6D8F511CDBD8BD3F +Test: Encrypt +Comment: Set 3, vector 110 +Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E +Ciphertext: C8D23274A1FF6AEBDF0BA70FBA7A895277B1CC8040F8FB2814195E3A7E85BD01 +Test: Encrypt +Comment: Set 3, vector 111 +Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F +Ciphertext: E0133DC7960953BABC7BFBA52E88DCF86EBD979D6D63EB19466EEADEDEDEEBB3 +Test: Encrypt +Comment: Set 3, vector 112 +Key: 70707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070 +Plaintext: 7070707070707070707070707070707070707070707070707070707070707070 +Ciphertext: A1A9527766EE54D566D97E7A0763A5AECE86F2816411AC2066439D6BDF02FEA7 +Test: Encrypt +Comment: Set 3, vector 113 +Key: 71717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171 +Plaintext: 7171717171717171717171717171717171717171717171717171717171717171 +Ciphertext: E1833EF5C2BA2EF192642164F0F2C02A7334EF5AEA37E9DD56D17AE6CB031004 +Test: Encrypt +Comment: Set 3, vector 114 +Key: 72727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272 +Plaintext: 7272727272727272727272727272727272727272727272727272727272727272 +Ciphertext: DD2CC0EECAA7E5364376FA73E12C64A0C42FB9FC7E94EFF0B22A051D6EDFE905 +Test: Encrypt +Comment: Set 3, vector 115 +Key: 73737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373 +Plaintext: 7373737373737373737373737373737373737373737373737373737373737373 +Ciphertext: 9A72F15B911E6A50A32EEEDF83B62B628E37ED403085180571DEBEA2F37CF49F +Test: Encrypt +Comment: Set 3, vector 116 +Key: 74747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474 +Plaintext: 7474747474747474747474747474747474747474747474747474747474747474 +Ciphertext: CD83CE7861EE8259A9C29BC3870EA1BF629ECD31F2E18F0BC12221F239207457 +Test: Encrypt +Comment: Set 3, vector 117 +Key: 75757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575 +Plaintext: 7575757575757575757575757575757575757575757575757575757575757575 +Ciphertext: 7B4218C5AEA4EEFE17E2AB110D8B63A947F21D5210162F6283EDDF00900CEE27 +Test: Encrypt +Comment: Set 3, vector 118 +Key: 76767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676 +Plaintext: 7676767676767676767676767676767676767676767676767676767676767676 +Ciphertext: 935DE2010B112937A233E7CB1023FB9D3C46D7C688A478A94F86AD3919FD2728 +Test: Encrypt +Comment: Set 3, vector 119 +Key: 77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 +Plaintext: 7777777777777777777777777777777777777777777777777777777777777777 +Ciphertext: 416A91A68A520732E672ACB5A36599D9A99901F013CC460D9C2FB16AAB45996E +Test: Encrypt +Comment: Set 3, vector 120 +Key: 78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +Plaintext: 7878787878787878787878787878787878787878787878787878787878787878 +Ciphertext: FD066F9C65CD3D61B43F5DA44F7B94C85541DC5E09D52B044DA963699C39FDA0 +Test: Encrypt +Comment: Set 3, vector 121 +Key: 79797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979 +Plaintext: 7979797979797979797979797979797979797979797979797979797979797979 +Ciphertext: 63937A7953E453B6E48539FACBD1BC489E03D209DB188837C5A09BA458FFFB92 +Test: Encrypt +Comment: Set 3, vector 122 +Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A +Ciphertext: 68F9EA0F87112633611052A45BBF32B7069079EDB16A928CD2AA16BE464178E3 +Test: Encrypt +Comment: Set 3, vector 123 +Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B +Ciphertext: 874D5ED6C8052C3B4AB830626A195F508DDA15388BA75B3D957B26BC134C9B30 +Test: Encrypt +Comment: Set 3, vector 124 +Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C +Ciphertext: EC3EA8DC433E39B85E4C4D68AC6A854A1B943D99EB2E9A018EA27DC1874CA867 +Test: Encrypt +Comment: Set 3, vector 125 +Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D +Ciphertext: 9CE2298362F1F234A73BECA011EC31B4BC7E143D87B4F118CDADE6AB8D1ED783 +Test: Encrypt +Comment: Set 3, vector 126 +Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E +Ciphertext: 27973D9B510ED9C612CC770FC1AE25EE21B1A9616CB64617EDA477939BE98D04 +Test: Encrypt +Comment: Set 3, vector 127 +Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F +Ciphertext: 82A0EB8C058E727EBD6032F0F77EE693342C97BD44E9538032652B1CA10403DE +Test: Encrypt +Comment: Set 3, vector 128 +Key: 80808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 +Plaintext: 8080808080808080808080808080808080808080808080808080808080808080 +Ciphertext: C3C1CD5F3060B3EC4E6ABC0818B68449E1750FB482368C8F3305270E16F98735 +Test: Encrypt +Comment: Set 3, vector 129 +Key: 81818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181 +Plaintext: 8181818181818181818181818181818181818181818181818181818181818181 +Ciphertext: 26381852C68B646D80E53C958855293BDC6FAAA85C5F9CAAACABE7B8077E4F7A +Test: Encrypt +Comment: Set 3, vector 130 +Key: 82828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282 +Plaintext: 8282828282828282828282828282828282828282828282828282828282828282 +Ciphertext: E2EA924898ED40FBD8C633706AD7D698392DF1EF33A10FDFCBE51B58C3AE0668 +Test: Encrypt +Comment: Set 3, vector 131 +Key: 83838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383 +Plaintext: 8383838383838383838383838383838383838383838383838383838383838383 +Ciphertext: 15CBDDA36707819D0C7694AAD46B2345BDEFC9D4F26F03A4BF860CE46F7BB53A +Test: Encrypt +Comment: Set 3, vector 132 +Key: 84848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484 +Plaintext: 8484848484848484848484848484848484848484848484848484848484848484 +Ciphertext: F96318A42737AB884FAA82BBB7025063E9A25C5957F52A7342E0C03A1A64273C +Test: Encrypt +Comment: Set 3, vector 133 +Key: 85858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585 +Plaintext: 8585858585858585858585858585858585858585858585858585858585858585 +Ciphertext: 7813FEB148D103075C80ACDFC95E2437A560D9B2E6C910E3A59805338E498907 +Test: Encrypt +Comment: Set 3, vector 134 +Key: 86868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686 +Plaintext: 8686868686868686868686868686868686868686868686868686868686868686 +Ciphertext: C7E9D5FE3BA11096AB77E715DFF0D2EB67E9136F0393CD004A7E994B3F994FA4 +Test: Encrypt +Comment: Set 3, vector 135 +Key: 87878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787 +Plaintext: 8787878787878787878787878787878787878787878787878787878787878787 +Ciphertext: F7D2DD8DF86A0E985CF6E83AA5922A548C83856D88C2C9D49EA962C9E6497949 +Test: Encrypt +Comment: Set 3, vector 136 +Key: 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 +Plaintext: 8888888888888888888888888888888888888888888888888888888888888888 +Ciphertext: C64887C6573E3D7F286C0353188FC93F05321C0C949ACDCB0237725576BCF77B +Test: Encrypt +Comment: Set 3, vector 137 +Key: 89898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989 +Plaintext: 8989898989898989898989898989898989898989898989898989898989898989 +Ciphertext: 77FB97C9C953BE6BD58044FB1E095BB5E3F4B3A51DAFE6F2F7ADED0FB707921F +Test: Encrypt +Comment: Set 3, vector 138 +Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A +Ciphertext: 22DE5F20955357BA1BF70E4D6DA436CCDE28C228031E4A413882C918EF8082D1 +Test: Encrypt +Comment: Set 3, vector 139 +Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B +Ciphertext: 146FF5907A3C58593C3FD3EB7498C4426CCE04DD0DA9138954BB97AAC821D87F +Test: Encrypt +Comment: Set 3, vector 140 +Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C +Ciphertext: 474ADC5855C87504A7C859409E25154D94B05A925F1D9989AE653B5511710BD7 +Test: Encrypt +Comment: Set 3, vector 141 +Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D +Ciphertext: 959B1090C1FF59998C100814E95E40EF94C6F2B7ED0425C78391192CFFFFA465 +Test: Encrypt +Comment: Set 3, vector 142 +Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E +Ciphertext: 9DA473108FFCECB228F8809860CDA316F4E1FAC5ADC39BB0373F01DCEBCBF271 +Test: Encrypt +Comment: Set 3, vector 143 +Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F +Ciphertext: 905FD0302F9F3C4296E15F94EDD72A8F9F4E9E4068F068099CAAE7247235847E +Test: Encrypt +Comment: Set 3, vector 144 +Key: 90909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090 +Plaintext: 9090909090909090909090909090909090909090909090909090909090909090 +Ciphertext: B63B82FB4B4961E4800FD13CAF145BEBF3625822AF7F5D3ACF2A4506471C636D +Test: Encrypt +Comment: Set 3, vector 145 +Key: 91919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191 +Plaintext: 9191919191919191919191919191919191919191919191919191919191919191 +Ciphertext: 63AA9822C7A5A6777D03F901E3BAF91FD566553C88835EF06DB9A983212288BF +Test: Encrypt +Comment: Set 3, vector 146 +Key: 92929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292 +Plaintext: 9292929292929292929292929292929292929292929292929292929292929292 +Ciphertext: 5417F10E4028BDE0F741114632E2090A1E6C83ACB1D03EA98D18D003838B4F0A +Test: Encrypt +Comment: Set 3, vector 147 +Key: 93939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393 +Plaintext: 9393939393939393939393939393939393939393939393939393939393939393 +Ciphertext: FD2C478FB17EE8520149E8A242BB07E0B32929536B191AC6DBCE05891C5E4BFC +Test: Encrypt +Comment: Set 3, vector 148 +Key: 94949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494 +Plaintext: 9494949494949494949494949494949494949494949494949494949494949494 +Ciphertext: 6A36A092BC0F029B60D40440F141EF0DC21A241547359FB618E9243C39AE3D7C +Test: Encrypt +Comment: Set 3, vector 149 +Key: 95959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595 +Plaintext: 9595959595959595959595959595959595959595959595959595959595959595 +Ciphertext: 605BC400A0FEE12092D369142E4D20C3A4F3D7623254BF9E242766946FC47ED1 +Test: Encrypt +Comment: Set 3, vector 150 +Key: 96969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696 +Plaintext: 9696969696969696969696969696969696969696969696969696969696969696 +Ciphertext: 6A5FA33652F946D7C93A56D15B5D3807401C667A9757495341F78526D58659D2 +Test: Encrypt +Comment: Set 3, vector 151 +Key: 97979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797 +Plaintext: 9797979797979797979797979797979797979797979797979797979797979797 +Ciphertext: 5C6AC175B74B9F7F7D6371A90B1F35E1276628DF6A82B0ECE38590C88B7B8DCA +Test: Encrypt +Comment: Set 3, vector 152 +Key: 98989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898 +Plaintext: 9898989898989898989898989898989898989898989898989898989898989898 +Ciphertext: 67BB4E7818FBE6CFAB113C1B2EC797E3164432BFF708450312422D5AEC70A8A8 +Test: Encrypt +Comment: Set 3, vector 153 +Key: 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +Plaintext: 9999999999999999999999999999999999999999999999999999999999999999 +Ciphertext: BFDA13CA82E73FBF62B6F1BB7181916CE7FD7DC7608EB958A8246346DFBB04E9 +Test: Encrypt +Comment: Set 3, vector 154 +Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A +Ciphertext: C30F3EF137BF7718F76C7E4D2366A48E7C3CE53735BBF8B56CD51609A23AC06C +Test: Encrypt +Comment: Set 3, vector 155 +Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B +Ciphertext: D73795A681B4FBE858703C15D60299682F64C800E691D223C4BE51012DA4D3DA +Test: Encrypt +Comment: Set 3, vector 156 +Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C +Ciphertext: 885A096C820E01E48E1A5F75DB0A007C2A96B66FCAB38AE80CF92DD8B6A35F6F +Test: Encrypt +Comment: Set 3, vector 157 +Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D +Ciphertext: 8FBDD4939C31026305C575F1FDCED3DBAE320C56CF064E9F19B44A43898BFD5C +Test: Encrypt +Comment: Set 3, vector 158 +Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E +Ciphertext: 2D9EC00B081BC1512EC11A0B8B898639415AEEA3270C4B49E4B47C601AB85875 +Test: Encrypt +Comment: Set 3, vector 159 +Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F +Ciphertext: 59565FB9888519C77E9C4E86D72AD86205AB55488D5ED0B9A388FB2D301C4400 +Test: Encrypt +Comment: Set 3, vector 160 +Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 +Ciphertext: 32D6CAA3D5E0A5D3CCD0FD8F2105CFF662FC4052FE348C2DFD0BC3EEFF3AB700 +Test: Encrypt +Comment: Set 3, vector 161 +Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 +Ciphertext: 7C3276EA6BB6FDDDEC8B901C45978B7D4D34AACE9F2D02F7D7F5826A89809DE9 +Test: Encrypt +Comment: Set 3, vector 162 +Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 +Ciphertext: C5ABC33559D828DD1464264F94D46A8519B4CE47EAA0EC9BF0504C876AC85451 +Test: Encrypt +Comment: Set 3, vector 163 +Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 +Ciphertext: E63050ADB9F2789F91A192E089883D7346DD42DE4C654E1D4B72C77D6C09FDB0 +Test: Encrypt +Comment: Set 3, vector 164 +Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 +Ciphertext: E7C58AF118E1DFD2A279DE640EDEF02FB4F3C78D778D145ECC6B2C4CCD065229 +Test: Encrypt +Comment: Set 3, vector 165 +Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 +Ciphertext: 278D8C11ACFDB851131432B3E19C409F940F93E0F6CB49D076C62E70B9C27095 +Test: Encrypt +Comment: Set 3, vector 166 +Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 +Ciphertext: D4839B5679FCA83189BB8C3681E83BAC871A02F297578855034E915F4EF04C12 +Test: Encrypt +Comment: Set 3, vector 167 +Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 +Ciphertext: 91AFF6474168F1D113E3DC66E620CF2F7283CE84F5FDDECC7E79CC005859C1BA +Test: Encrypt +Comment: Set 3, vector 168 +Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 +Ciphertext: 1374026DD442B1C1E0BA34570240F6A9E99781C8307A1544A9D3C91857C7E6E1 +Test: Encrypt +Comment: Set 3, vector 169 +Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 +Ciphertext: C95E8163D47755E25E8A4BA1FDFF46E016F080F13A794FD21251CE238F28C52E +Test: Encrypt +Comment: Set 3, vector 170 +Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +Ciphertext: 5DA751854BEEDB19D767A09E2BD9C12D15E51A4409A1F70574496D0A0DA767F9 +Test: Encrypt +Comment: Set 3, vector 171 +Key: ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB +Plaintext: ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB +Ciphertext: C1A0ADDB98DA358D8F40CDB8FA427770D6BD5705D81A804A9BA27FFAE8790BD1 +Test: Encrypt +Comment: Set 3, vector 172 +Key: ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC +Plaintext: ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC +Ciphertext: 604830D513CB29E0E89A36EAB97FFDFC0855AE212F9DDAB62ABE7572CBCEBFC5 +Test: Encrypt +Comment: Set 3, vector 173 +Key: ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD +Plaintext: ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD +Ciphertext: 0DB5075E0B9727D439ED88030D31B532B61556D206220CAE70A7B42EE4C5F72E +Test: Encrypt +Comment: Set 3, vector 174 +Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE +Ciphertext: A5167DC20ED3B1894B10C6AA754FDCF9FC1418439D9CA80C40974E9CB7630A12 +Test: Encrypt +Comment: Set 3, vector 175 +Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF +Ciphertext: 1A90CCEA061A2FB58E4D1F363B6CEEC26BFB55F4F140A18991C8EF50E8DFB306 +Test: Encrypt +Comment: Set 3, vector 176 +Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 +Ciphertext: 5CED17D75543C21AA1E020D4B084DB86A77BC445C7E77DA54DC6D786A0976A09 +Test: Encrypt +Comment: Set 3, vector 177 +Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 +Ciphertext: BB28F1F9496ED578276F99F3A2D4657566DC2CDDDCF00AE44555DA614C64E54E +Test: Encrypt +Comment: Set 3, vector 178 +Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 +Ciphertext: 30C28BF86BEAEBB25F4A667FB2B9C183B85B456527EB49B44AA4EA825A44E026 +Test: Encrypt +Comment: Set 3, vector 179 +Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 +Ciphertext: C2B0DEB4BC6C28869675FB75D2C2081396601B1FA823185D2D9EDE0730BBEAEA +Test: Encrypt +Comment: Set 3, vector 180 +Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 +Ciphertext: B3EDC667C3FD03CE50D05877C8A78C330F809DF5F8F7FB11968A3664C77CA78B +Test: Encrypt +Comment: Set 3, vector 181 +Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +Ciphertext: BC2FCF90C52B883CAC3F0A673FA093EEB48952F4DE50A9288464B84A920A1316 +Test: Encrypt +Comment: Set 3, vector 182 +Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 +Ciphertext: 30BCF4063A59823CE94B14B6B65F1B4DBEED8FB30832765B5186F4B834DBEA89 +Test: Encrypt +Comment: Set 3, vector 183 +Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 +Ciphertext: 51B4C7E8F697FACC24294A2CEB404C4BEC0CA41C76A6B50A824800EA4464C796 +Test: Encrypt +Comment: Set 3, vector 184 +Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 +Ciphertext: 2CCFF61604C0881CCC6A69B885878D6D07CEA7DAB31719D89DC4ECB0063DF5D2 +Test: Encrypt +Comment: Set 3, vector 185 +Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 +Ciphertext: 87998D9F16DC018B5DBD42A2E0C26D3774C2A41986E2D0A1504CE37B6EE71688 +Test: Encrypt +Comment: Set 3, vector 186 +Key: BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA +Plaintext: BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA +Ciphertext: D774451BB82A62A4C7708D0194F6C129C483CEFD182BAADF5A35EB77892F317A +Test: Encrypt +Comment: Set 3, vector 187 +Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +Ciphertext: B88CE3DF52572A1A1C8253E05D789BBF204E2CFC7A00389429F4C6B428EF8CD6 +Test: Encrypt +Comment: Set 3, vector 188 +Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC +Ciphertext: B854E538E6674A1831F635AA6650A0A4D0730A9A4B12511509EFD49E34D57D62 +Test: Encrypt +Comment: Set 3, vector 189 +Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD +Ciphertext: A69EF2348FEEF1EA09A2B29A6D977092ECD522A62EE906FA47624C92A872EB17 +Test: Encrypt +Comment: Set 3, vector 190 +Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE +Ciphertext: A1AE0CBC3B5200F1D8AE165EE42D45F6CE8C4FF448F8127B6D9AB4936FC76CA8 +Test: Encrypt +Comment: Set 3, vector 191 +Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF +Ciphertext: 91948E36B83E21FF8A5EEDAA48E50E3A292A3B68D20657FA7E11F50BC7A12205 +Test: Encrypt +Comment: Set 3, vector 192 +Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 +Ciphertext: 56CD17219224C3103E3E3E5CABAB6C1E78DEA9AD27613E8D62901FFA31500BFF +Test: Encrypt +Comment: Set 3, vector 193 +Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 +Ciphertext: 2E8FE5CAB2448B194387B160E9141E7D1B879BA1580B3D393B55436608EA2735 +Test: Encrypt +Comment: Set 3, vector 194 +Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 +Ciphertext: 5DD74E1155DD90840C702145DF6912754FB74B47625EA4C5382326681DB3390E +Test: Encrypt +Comment: Set 3, vector 195 +Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 +Ciphertext: 3A9F5962554037DCB1FA2AD04BFC0BF79699941500D5F9841320C6D8601310A2 +Test: Encrypt +Comment: Set 3, vector 196 +Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 +Ciphertext: BB0F5B68087BBA51DBB700BA1860CC3D0A587E54D57F4014DE4E48E58E529F87 +Test: Encrypt +Comment: Set 3, vector 197 +Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 +Ciphertext: 8384025D801AB8EC4D4416F5B7E862B6D9AC9E4AEE334C35FD0296B1402E4975 +Test: Encrypt +Comment: Set 3, vector 198 +Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 +Ciphertext: BE3057511C5D0E51315D89671BB4E57E7B590EC3ECE8A14D728248ED8F5107BB +Test: Encrypt +Comment: Set 3, vector 199 +Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 +Ciphertext: 18882618837D15B0B6BD77E1F37470EC58155A2788BDD9D91AEBD16B29A92A1B +Test: Encrypt +Comment: Set 3, vector 200 +Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 +Ciphertext: 8FAFDDC7E04C1AF3BBE8428222DCA59D2EF8C9E0213430492ECAB7B414987FEF +Test: Encrypt +Comment: Set 3, vector 201 +Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 +Ciphertext: 4D687992D4F9F515FE451AC967CBF75F906D637C3C261758E263A0DA0DEF69C2 +Test: Encrypt +Comment: Set 3, vector 202 +Key: CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA +Plaintext: CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA +Ciphertext: 9DDC94BFF87FDBAFDB0AB9DC17D3649231300E5E6270600856722324DC9CA39A +Test: Encrypt +Comment: Set 3, vector 203 +Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB +Ciphertext: 86E9CCD90D7B902D23D82C085B1F886402DBD2D19C5A81A32F318C98C6E2A98A +Test: Encrypt +Comment: Set 3, vector 204 +Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +Ciphertext: 164FCD7D1FFE12FF1FDEE6384145EF546A5CD98C22817A5205FF2C2E18339779 +Test: Encrypt +Comment: Set 3, vector 205 +Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD +Ciphertext: 4579935A483BAC6B4CCD8C25BCC9E6DEAF46EA8B53F8B5E37CC436EAB85A1330 +Test: Encrypt +Comment: Set 3, vector 206 +Key: CECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECE +Plaintext: CECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECE +Ciphertext: E5F810DF5B215F559E76EF925F2B795915A7B03A6F7019FAC8E9127A7CE93F09 +Test: Encrypt +Comment: Set 3, vector 207 +Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF +Ciphertext: 2EA0892E2B2F29A63526B37DECD18E31DC970A60E60A4D8414A5BD0D2D5491EF +Test: Encrypt +Comment: Set 3, vector 208 +Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 +Ciphertext: 900F155E80A716199EB062827CDDDC4DA857550BA1C265A46D47BE4024706F40 +Test: Encrypt +Comment: Set 3, vector 209 +Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 +Ciphertext: 5B495546838A97D8DF4B9CA95EF8350210A3ECAB81469678EBDE1E5846C1F42D +Test: Encrypt +Comment: Set 3, vector 210 +Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 +Ciphertext: 60E7E367347BC3F4091CE34CCA288C8AFC6375ED8F4394D904FD8489280D50F1 +Test: Encrypt +Comment: Set 3, vector 211 +Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 +Ciphertext: F215EED91D35B7BA649F05C3D1E2B254CB1215588AB78DF54F3CA221AB4A3F1B +Test: Encrypt +Comment: Set 3, vector 212 +Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 +Ciphertext: 6441A445D808842C6185B81ACBC5AF86386C54C79026BFC21C1DB5111362AA15 +Test: Encrypt +Comment: Set 3, vector 213 +Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 +Ciphertext: 4EE459EDAC1FE0CB08E80C8C13FCE8C44CBFECF7A7F9F14C15B5A92BB7F34E71 +Test: Encrypt +Comment: Set 3, vector 214 +Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 +Ciphertext: 78826499B0F2F402E6DA3CACA36EA35492B7BD2A4D84575D0432E16368E78808 +Test: Encrypt +Comment: Set 3, vector 215 +Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 +Ciphertext: BDFBCAE2761BEF6A411156AE01A63F9321EE969C56043F2A44C5D3D4BB017BC0 +Test: Encrypt +Comment: Set 3, vector 216 +Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 +Ciphertext: 926F2CD84035F9070C3506E6D7245FEA9A845F2D355785BB17E1D3C34FA81228 +Test: Encrypt +Comment: Set 3, vector 217 +Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 +Ciphertext: 6C5F6B1C746967142D55FA3769A9417D5A44875D364DB4412B4F9EB254D9BB89 +Test: Encrypt +Comment: Set 3, vector 218 +Key: DADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADA +Plaintext: DADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADA +Ciphertext: 8329A1E54D9F45DB4E8CE6F1B481C3EE00D5511B52B3CDADCBD562A9F1B35770 +Test: Encrypt +Comment: Set 3, vector 219 +Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB +Ciphertext: 7A7FEEDEF1950F1A60529743163406CAF167097358377E0650CF0BB35CD783F6 +Test: Encrypt +Comment: Set 3, vector 220 +Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC +Ciphertext: C52CFB15D2F53156701AE4951AA46BCFC872252447BB14E1CE19CAC074926984 +Test: Encrypt +Comment: Set 3, vector 221 +Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD +Ciphertext: 79DFF8DC12ABCEC71E7FAE55ABC8C374135ECE2D52834BC77B860252B756D54A +Test: Encrypt +Comment: Set 3, vector 222 +Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE +Ciphertext: 62963B66E680BD5602EC86DB7267E15CB1FF6EA698B54EBA661D125400C7F2DD +Test: Encrypt +Comment: Set 3, vector 223 +Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF +Ciphertext: 0C2E76743ACC9CC0525D6E2C519D12C369CFA9E27F13068F98D2F32FAD7220CB +Test: Encrypt +Comment: Set 3, vector 224 +Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 +Ciphertext: B464640E72C30DF092A5BB00F34568A7C04B8620265EDA53F19F3A06164AF980 +Test: Encrypt +Comment: Set 3, vector 225 +Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 +Ciphertext: 3725215E79F1FE3DC64B4316449FF98EB52D03330BFC848CD83A407475AADA3A +Test: Encrypt +Comment: Set 3, vector 226 +Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 +Ciphertext: BA273F544C5076D523CC75F90E315A39E465D2B25434E6577FE629F27061BBA4 +Test: Encrypt +Comment: Set 3, vector 227 +Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 +Ciphertext: 472161A0F42E64BD0FE6D448996C370E2C3A56BDE16B378EAA31740551121B4E +Test: Encrypt +Comment: Set 3, vector 228 +Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 +Ciphertext: EA089A10A597504D057E1F03064C9465C1A707C9472A7C0DBAD6978F5BB83A46 +Test: Encrypt +Comment: Set 3, vector 229 +Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 +Ciphertext: E91B3433426F88FA31A05E17906E55EA1D803ADFE080C51FBD98290CBF427BEF +Test: Encrypt +Comment: Set 3, vector 230 +Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 +Ciphertext: 747C4999D0256384349A5FB132DE1AAD4D7FC48507FEC206B80ED429AF7FDBDB +Test: Encrypt +Comment: Set 3, vector 231 +Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 +Ciphertext: 3F8058A1A9B7B0A9C31B4670EEAA6988BF2D41E9B3417EF899EF12CBBC9C77DE +Test: Encrypt +Comment: Set 3, vector 232 +Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 +Ciphertext: 9DA431EC0DADDEC4A76B3830B20AA03D346AD09691FB98FC0E9A8987F7B70EDF +Test: Encrypt +Comment: Set 3, vector 233 +Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 +Ciphertext: 63BF528E184A43EF807DC9169BDB9CD7B63EE144478A4735EC2EE3A5A7EE460A +Test: Encrypt +Comment: Set 3, vector 234 +Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA +Ciphertext: 73DC5F8AFA9493AD7767D15A36E7741044EFC225136B4972DC5294E80071A64D +Test: Encrypt +Comment: Set 3, vector 235 +Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB +Ciphertext: 7EEE75D690458A604D20CD21ED64B228F0C3563DB8FB925341FC02845B6E06BA +Test: Encrypt +Comment: Set 3, vector 236 +Key: ECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECEC +Plaintext: ECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECEC +Ciphertext: AA4D9E1A0157AC347DC7A1997718944427BD579DC18B94F181390E8C36A1305C +Test: Encrypt +Comment: Set 3, vector 237 +Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED +Ciphertext: 1695BC5C3D63F4B0E0BC3225F00BB0B8E8D29F3DC09584353E11510002E2BE53 +Test: Encrypt +Comment: Set 3, vector 238 +Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +Ciphertext: C68C7A2FBDA419A515AE816480490BFB2A72A4B6534A19A8D8C6C85FAA949567 +Test: Encrypt +Comment: Set 3, vector 239 +Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF +Ciphertext: 5F45E7F72A64C66269F83714A88A0701561C3E7AF33BB48887D4439F5DE4A82D +Test: Encrypt +Comment: Set 3, vector 240 +Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +Ciphertext: AD49A5C8EB06256147F02301FB47710E915B5A8FC3219C0D56A19382977119FC +Test: Encrypt +Comment: Set 3, vector 241 +Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 +Ciphertext: 2387AF70EE04E7F25277E81081B044EA24090D503CE8F64997BB610C762D8F6F +Test: Encrypt +Comment: Set 3, vector 242 +Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 +Ciphertext: B5D496DD36BA0B47832C170A53760CE5E47B1FF5C28848F5F7A1827E94BC73CB +Test: Encrypt +Comment: Set 3, vector 243 +Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 +Ciphertext: 77978F2EAB7E8B6B32C9293B83F51419785A0CD276276CB417ACA806A456A6AE +Test: Encrypt +Comment: Set 3, vector 244 +Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 +Ciphertext: E3CBD41F80B27C9A684D7C7C27BBCA9FD59E5E81E93B7BC5BFDF66722EF68EEE +Test: Encrypt +Comment: Set 3, vector 245 +Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 +Ciphertext: 4482F0C362CB423104CAA26E1415B0B7519E1189624D313E65D324C6DC95F516 +Test: Encrypt +Comment: Set 3, vector 246 +Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 +Ciphertext: CD72EE9A6919348595286348C7E488DB3648458688F72BAD994B26FE6999E676 +Test: Encrypt +Comment: Set 3, vector 247 +Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 +Ciphertext: 03EF38F91710AE8BCC8B9193F6A55A7C90C66300D20EDCF5B4946F3B38BEF6C5 +Test: Encrypt +Comment: Set 3, vector 248 +Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 +Ciphertext: B67638D30578AB2319FE275D0B833B50D7ABF01E8760F566D0D441D8EAFDF8AA +Test: Encrypt +Comment: Set 3, vector 249 +Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 +Ciphertext: 98B05FF6042436505C7163415E187E09F10C3B1A86FA4B458CE1EF31022F5D16 +Test: Encrypt +Comment: Set 3, vector 250 +Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA +Ciphertext: B670A350A2CF0478412307EF00F97F8B30175CDB7593FF4686BD614B41444342 +Test: Encrypt +Comment: Set 3, vector 251 +Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB +Ciphertext: D7FD492E6302265C24FAB910AA1335C29D53406147E853F7604F4AF1A9407E83 +Test: Encrypt +Comment: Set 3, vector 252 +Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC +Ciphertext: 28926789363A4306E2C75FD1D8FDF0FE6B62FDB2AFAEDDA6F47A565C2781968B +Test: Encrypt +Comment: Set 3, vector 253 +Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD +Ciphertext: 813C816CD4B18F20BD06E2E93CFAA717EBB6554B556CC33D67530608A9BF100F +Test: Encrypt +Comment: Set 3, vector 254 +Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE +Ciphertext: 5DC15C83E7C4F5AAF8D8482ED1E443271B28B59288783DBCDDEC3544E3368A6E +Test: Encrypt +Comment: Set 3, vector 255 +Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Ciphertext: 0598127BAF11706F77402000D730C54A0B84C868A98C6CA4D7F3C0FA06A78B7A +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/sosemanuk.txt b/external/crypto++-5.6.3/TestVectors/sosemanuk.txt new file mode 100644 index 000000000..435d89bec --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/sosemanuk.txt @@ -0,0 +1,25 @@ +AlgorithmType: SymmetricCipher +Source: Sosemanuk reference implementation, compiled with -DSOSEMANUK_VECTOR +Key: A7C083FEB7 +IV: 00112233445566778899AABBCCDDEEFF +Name: Sosemanuk +Plaintext: r160 00 +Ciphertext: \ + FE 81 D2 16 2C 9A 10 0D 04 89 5C 45 4A 77 51 5B\ + BE 6A 43 1A 93 5C B9 0E 22 21 EB B7 EF 50 23 28\ + 94 35 39 49 2E FF 63 10 C8 71 05 4C 28 89 CC 72\ + 8F 82 E8 6B 1A FF F4 33 4B 61 27 A1 3A 15 5C 75\ + 15 16 30 BD 48 2E B6 73 FF 5D B4 77 FA 6C 53 EB\ + E1 A4 EC 38 C2 3C 54 00 C3 15 45 5D 93 A2 AC ED\ + 95 98 60 47 27 FA 34 0D 5F 2A 8B D7 57 B7 78 33\ + F7 4B D2 BC 04 93 13 C8 06 16 B4 A0 62 68 AE 35\ + 0D B9 2E EC 4F A5 6C 17 13 74 A6 7A 80 C0 06 D0\ + EA D0 48 CE 7B 64 0F 17 D3 D5 A6 2D 1F 25 1C 21 +Test: Encrypt +Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/sosemanuk/unverified.test-vectors?rev=189&view=auto +Comment: Set 6, vector# 3 +Key: 0F62B5085BAE0154A7FA4DA0F34699EC3F92E5388BDE3184D72A7DD02376C91C +IV: 288FF65DC42B92F960C72E95FC63CA31 +Plaintext: r131072 00 +CiphertextXorDigest: CC09FB7405DD54BBF09407B1D2033FBBAC53F388DD387A46F2B8FCFF692A7838353523A621A55D08DA0CA5348AE96D8B0D6A028F309982EF6628054D01B9A368 +Test: EncryptXorDigest diff --git a/external/crypto++-5.6.3/TestVectors/tea.txt b/external/crypto++-5.6.3/TestVectors/tea.txt new file mode 100644 index 000000000..dc46d3fc4 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/tea.txt @@ -0,0 +1,711 @@ +AlgorithmType: SymmetricCipher +Name: TEA/ECB +Source: http://www.cix.co.uk/~klockstone/teavect.htm +Comment: test 1 +Plaintext: 00000000 00000000 +Key: 00000000 00000000 00000000 00000000 +Ciphertext: 41ea3a0a 94baa940 +Test: Encrypt +Comment: test 2 +Plaintext: 94baa940 00000000 +Key: 00000000 00000000 00000000 41ea3a0a +Ciphertext: 4e8e7829 7d8236d8 +Test: Encrypt +Comment: test 3 +Plaintext: 7d8236d8 00000000 +Key: 00000000 00000000 41ea3a0a 4e8e7829 +Ciphertext: c88ba95e e7edac02 +Test: Encrypt +Comment: test 4 +Plaintext: e7edac02 00000000 +Key: 00000000 41ea3a0a 4e8e7829 c88ba95e +Ciphertext: b84e28af b6b62088 +Test: Encrypt +Comment: test 5 +Plaintext: b6b62088 00000000 +Key: 41ea3a0a 4e8e7829 c88ba95e b84e28af +Ciphertext: a0a47295 8fadf3b3 +Test: Encrypt +Comment: test 6 +Plaintext: 8fadf3b3 41ea3a0a +Key: 4e8e7829 c88ba95e b84e28af a0a47295 +Ciphertext: ed650698 cf9f2b79 +Test: Encrypt +Comment: test 7 +Plaintext: cf9f2b79 4e8e7829 +Key: c88ba95e b84e28af a0a47295 ed650698 +Ciphertext: 1024eea0 6220ae1c +Test: Encrypt +Comment: test 8 +Plaintext: 6220ae1c c88ba95e +Key: b84e28af a0a47295 ed650698 1024eea0 +Ciphertext: 5ddf75d9 7a4ce68f +Test: Encrypt +Comment: test 9 +Plaintext: 7a4ce68f b84e28af +Key: a0a47295 ed650698 1024eea0 5ddf75d9 +Ciphertext: f1be9d1e 8dd4a984 +Test: Encrypt +Comment: test 10 +Plaintext: 8dd4a984 a0a47295 +Key: ed650698 1024eea0 5ddf75d9 f1be9d1e +Ciphertext: d32c758c 092dabad +Test: Encrypt +Comment: test 11 +Plaintext: 092dabad ed650698 +Key: 1024eea0 5ddf75d9 f1be9d1e d32c758c +Ciphertext: bdb43728 f7183fc0 +Test: Encrypt +Comment: test 12 +Plaintext: f7183fc0 1024eea0 +Key: 5ddf75d9 f1be9d1e d32c758c bdb43728 +Ciphertext: a9c3801a d9dcfb4e +Test: Encrypt +Comment: test 13 +Plaintext: d9dcfb4e 5ddf75d9 +Key: f1be9d1e d32c758c bdb43728 a9c3801a +Ciphertext: 32a1e654 a9df917c +Test: Encrypt +Comment: test 14 +Plaintext: a9df917c f1be9d1e +Key: d32c758c bdb43728 a9c3801a 32a1e654 +Ciphertext: 08b63bb9 b20bd3e8 +Test: Encrypt +Comment: test 15 +Plaintext: b20bd3e8 d32c758c +Key: bdb43728 a9c3801a 32a1e654 08b63bb9 +Ciphertext: 21410574 cc4264c6 +Test: Encrypt +Comment: test 16 +Plaintext: cc4264c6 bdb43728 +Key: a9c3801a 32a1e654 08b63bb9 21410574 +Ciphertext: 4ec5d2e2 5ada1d89 +Test: Encrypt +Comment: test 17 +Plaintext: 5ada1d89 a9c3801a +Key: 32a1e654 08b63bb9 21410574 4ec5d2e2 +Ciphertext: dd46249e 28aa0b4b +Test: Encrypt +Comment: test 18 +Plaintext: 28aa0b4b 32a1e654 +Key: 08b63bb9 21410574 4ec5d2e2 dd46249e +Ciphertext: 2486dcba a713df03 +Test: Encrypt +Comment: test 19 +Plaintext: a713df03 08b63bb9 +Key: 21410574 4ec5d2e2 dd46249e 2486dcba +Ciphertext: b7c7af9d 1acb6cab +Test: Encrypt +Comment: test 20 +Plaintext: 1acb6cab 21410574 +Key: 4ec5d2e2 dd46249e 2486dcba b7c7af9d +Ciphertext: 8cc0400a 9aa49fbb +Test: Encrypt +Comment: test 21 +Plaintext: 9aa49fbb 4ec5d2e2 +Key: dd46249e 2486dcba b7c7af9d 8cc0400a +Ciphertext: 9c241876 6cbc8c66 +Test: Encrypt +Comment: test 22 +Plaintext: 6cbc8c66 dd46249e +Key: 2486dcba b7c7af9d 8cc0400a 9c241876 +Ciphertext: b59c5d45 a90066f9 +Test: Encrypt +Comment: test 23 +Plaintext: a90066f9 2486dcba +Key: b7c7af9d 8cc0400a 9c241876 b59c5d45 +Ciphertext: b765a1b3 64b37eb0 +Test: Encrypt +Comment: test 24 +Plaintext: 64b37eb0 b7c7af9d +Key: 8cc0400a 9c241876 b59c5d45 b765a1b3 +Ciphertext: 7b172fac f5ab4933 +Test: Encrypt +Comment: test 25 +Plaintext: f5ab4933 8cc0400a +Key: 9c241876 b59c5d45 b765a1b3 7b172fac +Ciphertext: fe48f4fb ada404b1 +Test: Encrypt +Comment: test 26 +Plaintext: ada404b1 9c241876 +Key: b59c5d45 b765a1b3 7b172fac fe48f4fb +Ciphertext: c5294093 c1d53e3d +Test: Encrypt +Comment: test 27 +Plaintext: c1d53e3d b59c5d45 +Key: b765a1b3 7b172fac fe48f4fb c5294093 +Ciphertext: 759ca8e2 77a96649 +Test: Encrypt +Comment: test 28 +Plaintext: 77a96649 b765a1b3 +Key: 7b172fac fe48f4fb c5294093 759ca8e2 +Ciphertext: 69c53e0f 3e979807 +Test: Encrypt +Comment: test 29 +Plaintext: 3e979807 7b172fac +Key: fe48f4fb c5294093 759ca8e2 69c53e0f +Ciphertext: 60388ada a21fa8e8 +Test: Encrypt +Comment: test 30 +Plaintext: a21fa8e8 fe48f4fb +Key: c5294093 759ca8e2 69c53e0f 60388ada +Ciphertext: df70a1f5 ac4aa407 +Test: Encrypt +Comment: test 31 +Plaintext: ac4aa407 c5294093 +Key: 759ca8e2 69c53e0f 60388ada df70a1f5 +Ciphertext: d9cb4e09 92636233 +Test: Encrypt +Comment: test 32 +Plaintext: 92636233 759ca8e2 +Key: 69c53e0f 60388ada df70a1f5 d9cb4e09 +Ciphertext: 7d2c6c57 7a6adb4d +Test: Encrypt +Comment: test 33 +Plaintext: 7a6adb4d 69c53e0f +Key: 60388ada df70a1f5 d9cb4e09 7d2c6c57 +Ciphertext: 44b71215 cf25368a +Test: Encrypt +Comment: test 34 +Plaintext: cf25368a 60388ada +Key: df70a1f5 d9cb4e09 7d2c6c57 44b71215 +Ciphertext: c10105a1 ef781a18 +Test: Encrypt +Comment: test 35 +Plaintext: ef781a18 df70a1f5 +Key: d9cb4e09 7d2c6c57 44b71215 c10105a1 +Ciphertext: bfdb29fa 9ece39b6 +Test: Encrypt +Comment: test 36 +Plaintext: 9ece39b6 d9cb4e09 +Key: 7d2c6c57 44b71215 c10105a1 bfdb29fa +Ciphertext: 9b0b256d dc04574c +Test: Encrypt +Comment: test 37 +Plaintext: dc04574c 7d2c6c57 +Key: 44b71215 c10105a1 bfdb29fa 9b0b256d +Ciphertext: f8295142 8c022711 +Test: Encrypt +Comment: test 38 +Plaintext: 8c022711 44b71215 +Key: c10105a1 bfdb29fa 9b0b256d f8295142 +Ciphertext: 61341d1c 3a85f2f0 +Test: Encrypt +Comment: test 39 +Plaintext: 3a85f2f0 c10105a1 +Key: bfdb29fa 9b0b256d f8295142 61341d1c +Ciphertext: f6a0d30c ad230209 +Test: Encrypt +Comment: test 40 +Plaintext: ad230209 bfdb29fa +Key: 9b0b256d f8295142 61341d1c f6a0d30c +Ciphertext: 3de21a3f aa0cf5c9 +Test: Encrypt +Comment: test 41 +Plaintext: aa0cf5c9 9b0b256d +Key: f8295142 61341d1c f6a0d30c 3de21a3f +Ciphertext: a7e307c6 bd52d939 +Test: Encrypt +Comment: test 42 +Plaintext: bd52d939 f8295142 +Key: 61341d1c f6a0d30c 3de21a3f a7e307c6 +Ciphertext: 017bc3a7 66fd8c77 +Test: Encrypt +Comment: test 43 +Plaintext: 66fd8c77 61341d1c +Key: f6a0d30c 3de21a3f a7e307c6 017bc3a7 +Ciphertext: d8f8fc86 d01b5761 +Test: Encrypt +Comment: test 44 +Plaintext: d01b5761 f6a0d30c +Key: 3de21a3f a7e307c6 017bc3a7 d8f8fc86 +Ciphertext: e186c41a 5e6e5a4d +Test: Encrypt +Comment: test 45 +Plaintext: 5e6e5a4d 3de21a3f +Key: a7e307c6 017bc3a7 d8f8fc86 e186c41a +Ciphertext: 4368d224 dbb4e677 +Test: Encrypt +Comment: test 46 +Plaintext: dbb4e677 a7e307c6 +Key: 017bc3a7 d8f8fc86 e186c41a 4368d224 +Ciphertext: 9bd0321e 84096523 +Test: Encrypt +Comment: test 47 +Plaintext: 84096523 017bc3a7 +Key: d8f8fc86 e186c41a 4368d224 9bd0321e +Ciphertext: b7c56d5b 97c65866 +Test: Encrypt +Comment: test 48 +Plaintext: 97c65866 d8f8fc86 +Key: e186c41a 4368d224 9bd0321e b7c56d5b +Ciphertext: 63a1bfac 5a5d7ca2 +Test: Encrypt +Comment: test 49 +Plaintext: 5a5d7ca2 e186c41a +Key: 4368d224 9bd0321e b7c56d5b 63a1bfac +Ciphertext: 91f56dff 7281794f +Test: Encrypt +Comment: test 50 +Plaintext: 7281794f 4368d224 +Key: 9bd0321e b7c56d5b 63a1bfac 91f56dff +Ciphertext: e4c63780 019aedf7 +Test: Encrypt +Comment: test 51 +Plaintext: 019aedf7 9bd0321e +Key: b7c56d5b 63a1bfac 91f56dff e4c63780 +Ciphertext: a9fb56e7 35f4aeca +Test: Encrypt +Comment: test 52 +Plaintext: 35f4aeca b7c56d5b +Key: 63a1bfac 91f56dff e4c63780 a9fb56e7 +Ciphertext: a6537187 f0f1ba93 +Test: Encrypt +Comment: test 53 +Plaintext: f0f1ba93 63a1bfac +Key: 91f56dff e4c63780 a9fb56e7 a6537187 +Ciphertext: cc960eda e44c6b8f +Test: Encrypt +Comment: test 54 +Plaintext: e44c6b8f 91f56dff +Key: e4c63780 a9fb56e7 a6537187 cc960eda +Ciphertext: e12f106d 4f1152d0 +Test: Encrypt +Comment: test 55 +Plaintext: 4f1152d0 e4c63780 +Key: a9fb56e7 a6537187 cc960eda e12f106d +Ciphertext: 556ad853 f79992fd +Test: Encrypt +Comment: test 56 +Plaintext: f79992fd a9fb56e7 +Key: a6537187 cc960eda e12f106d 556ad853 +Ciphertext: 78e8e265 128df6ad +Test: Encrypt +Comment: test 57 +Plaintext: 128df6ad a6537187 +Key: cc960eda e12f106d 556ad853 78e8e265 +Ciphertext: f23892aa 288cb926 +Test: Encrypt +Comment: test 58 +Plaintext: 288cb926 cc960eda +Key: e12f106d 556ad853 78e8e265 f23892aa +Ciphertext: 1d115839 6a117fca +Test: Encrypt +Comment: test 59 +Plaintext: 6a117fca e12f106d +Key: 556ad853 78e8e265 f23892aa 1d115839 +Ciphertext: cf899635 5b087e34 +Test: Encrypt +Comment: test 60 +Plaintext: 5b087e34 556ad853 +Key: 78e8e265 f23892aa 1d115839 cf899635 +Ciphertext: 5c60bff2 e68d88c2 +Test: Encrypt +Comment: test 61 +Plaintext: e68d88c2 78e8e265 +Key: f23892aa 1d115839 cf899635 5c60bff2 +Ciphertext: 7072d01c bffeb50a +Test: Encrypt +Comment: test 62 +Plaintext: bffeb50a f23892aa +Key: 1d115839 cf899635 5c60bff2 7072d01c +Ciphertext: 4513c5eb 9c99ae9e +Test: Encrypt +Comment: test 63 +Plaintext: 9c99ae9e 1d115839 +Key: cf899635 5c60bff2 7072d01c 4513c5eb +Ciphertext: 8f3a38ab 80d9c4ad +Test: Encrypt +Comment: test 64 +Plaintext: 80d9c4ad cf899635 +Key: 5c60bff2 7072d01c 4513c5eb 8f3a38ab +Ciphertext: 2bb0f1b3 c023ed11 +Test: Encrypt + +AlgorithmType: SymmetricCipher +Name: XTEA/ECB +Source: http://www.cix.co.uk/~klockstone/teavect.htm +Comment: test 1 +Plaintext: 00000000 00000000 +Key: 00000000 00000000 00000000 00000000 +Rounds: 1 +Ciphertext: 00000000 9e3779b9 +Test: Encrypt +Comment: test 2 +Plaintext: 9e3779b9 00000000 +Key: 00000000 00000000 00000000 00000000 +Rounds: 2 +Ciphertext: ec01a1de aaa0256d +Test: Encrypt +Comment: test 3 +Plaintext: aaa0256d 00000000 +Key: 00000000 00000000 00000000 ec01a1de +Rounds: 3 +Ciphertext: 114f6d74 a39e590c +Test: Encrypt +Comment: test 4 +Plaintext: a39e590c 00000000 +Key: 00000000 00000000 ec01a1de 114f6d74 +Rounds: 4 +Ciphertext: bc3a7de2 4e238eb9 +Test: Encrypt +Comment: test 5 +Plaintext: 4e238eb9 00000000 +Key: 00000000 ec01a1de 114f6d74 bc3a7de2 +Rounds: 5 +Ciphertext: 845846cf 2f36d07f +Test: Encrypt +Comment: test 6 +Plaintext: 2f36d07f 00000000 +Key: ec01a1de 114f6d74 bc3a7de2 845846cf +Rounds: 6 +Ciphertext: 2794a127 4f3e4b6a +Test: Encrypt +Comment: test 7 +Plaintext: 4f3e4b6a ec01a1de +Key: 114f6d74 bc3a7de2 845846cf 2794a127 +Rounds: 7 +Ciphertext: 6b8ea8b8 d99e66c3 +Test: Encrypt +Comment: test 8 +Plaintext: d99e66c3 114f6d74 +Key: bc3a7de2 845846cf 2794a127 6b8ea8b8 +Rounds: 8 +Ciphertext: 31c5fa6c 241756d6 +Test: Encrypt +Comment: test 9 +Plaintext: 241756d6 bc3a7de2 +Key: 845846cf 2794a127 6b8ea8b8 31c5fa6c +Rounds: 9 +Ciphertext: 4a581696 1fd58a6b +Test: Encrypt +Comment: test 10 +Plaintext: 1fd58a6b 845846cf +Key: 2794a127 6b8ea8b8 31c5fa6c 4a581696 +Rounds: 10 +Ciphertext: dfcd0451 df8822cd +Test: Encrypt +Comment: test 11 +Plaintext: df8822cd 2794a127 +Key: 6b8ea8b8 31c5fa6c 4a581696 dfcd0451 +Rounds: 11 +Ciphertext: 3ad1ff17 f465776c +Test: Encrypt +Comment: test 12 +Plaintext: f465776c 6b8ea8b8 +Key: 31c5fa6c 4a581696 dfcd0451 3ad1ff17 +Rounds: 12 +Ciphertext: 6a1d78c8 4d30bdb9 +Test: Encrypt +Comment: test 13 +Plaintext: 4d30bdb9 31c5fa6c +Key: 4a581696 dfcd0451 3ad1ff17 6a1d78c8 +Rounds: 13 +Ciphertext: 08c86d67 f6ef939b +Test: Encrypt +Comment: test 14 +Plaintext: f6ef939b 4a581696 +Key: dfcd0451 3ad1ff17 6a1d78c8 08c86d67 +Rounds: 14 +Ciphertext: 2a65bfbe f733428c +Test: Encrypt +Comment: test 15 +Plaintext: f733428c dfcd0451 +Key: 3ad1ff17 6a1d78c8 08c86d67 2a65bfbe +Rounds: 15 +Ciphertext: b4bd6e46 40672bcc +Test: Encrypt +Comment: test 16 +Plaintext: 40672bcc 3ad1ff17 +Key: 6a1d78c8 08c86d67 2a65bfbe b4bd6e46 +Rounds: 16 +Ciphertext: 1d8e6992 9a478905 +Test: Encrypt +Comment: test 17 +Plaintext: 9a478905 6a1d78c8 +Key: 08c86d67 2a65bfbe b4bd6e46 1d8e6992 +Rounds: 17 +Ciphertext: f8994ada 80dee76a +Test: Encrypt +Comment: test 18 +Plaintext: 80dee76a 08c86d67 +Key: 2a65bfbe b4bd6e46 1d8e6992 f8994ada +Rounds: 18 +Ciphertext: 0997e6ed cdfef370 +Test: Encrypt +Comment: test 19 +Plaintext: cdfef370 2a65bfbe +Key: b4bd6e46 1d8e6992 f8994ada 0997e6ed +Rounds: 19 +Ciphertext: ece50553 10b76c66 +Test: Encrypt +Comment: test 20 +Plaintext: 10b76c66 b4bd6e46 +Key: 1d8e6992 f8994ada 0997e6ed ece50553 +Rounds: 20 +Ciphertext: a6d39c7b dce1a473 +Test: Encrypt +Comment: test 21 +Plaintext: dce1a473 1d8e6992 +Key: f8994ada 0997e6ed ece50553 a6d39c7b +Rounds: 21 +Ciphertext: 21d06fb7 fbb98544 +Test: Encrypt +Comment: test 22 +Plaintext: fbb98544 f8994ada +Key: 0997e6ed ece50553 a6d39c7b 21d06fb7 +Rounds: 22 +Ciphertext: 72cdd36c e1115fb6 +Test: Encrypt +Comment: test 23 +Plaintext: e1115fb6 0997e6ed +Key: ece50553 a6d39c7b 21d06fb7 72cdd36c +Rounds: 23 +Ciphertext: 25bc6eb3 e4c28ab7 +Test: Encrypt +Comment: test 24 +Plaintext: e4c28ab7 ece50553 +Key: a6d39c7b 21d06fb7 72cdd36c 25bc6eb3 +Rounds: 24 +Ciphertext: 4932a288 78020b9e +Test: Encrypt +Comment: test 25 +Plaintext: 78020b9e a6d39c7b +Key: 21d06fb7 72cdd36c 25bc6eb3 4932a288 +Rounds: 25 +Ciphertext: 25285da1 b66c4459 +Test: Encrypt +Comment: test 26 +Plaintext: b66c4459 21d06fb7 +Key: 72cdd36c 25bc6eb3 4932a288 25285da1 +Rounds: 26 +Ciphertext: 39b0155c f227ab20 +Test: Encrypt +Comment: test 27 +Plaintext: f227ab20 72cdd36c +Key: 25bc6eb3 4932a288 25285da1 39b0155c +Rounds: 27 +Ciphertext: 547571aa f38f1e39 +Test: Encrypt +Comment: test 28 +Plaintext: f38f1e39 25bc6eb3 +Key: 4932a288 25285da1 39b0155c 547571aa +Rounds: 28 +Ciphertext: 27f917b1 e5796aee +Test: Encrypt +Comment: test 29 +Plaintext: e5796aee 4932a288 +Key: 25285da1 39b0155c 547571aa 27f917b1 +Rounds: 29 +Ciphertext: c1da8993 670f9fd2 +Test: Encrypt +Comment: test 30 +Plaintext: 670f9fd2 25285da1 +Key: 39b0155c 547571aa 27f917b1 c1da8993 +Rounds: 30 +Ciphertext: 60e2acaa d0a60db4 +Test: Encrypt +Comment: test 31 +Plaintext: d0a60db4 39b0155c +Key: 547571aa 27f917b1 c1da8993 60e2acaa +Rounds: 31 +Ciphertext: a6eb923d af20a390 +Test: Encrypt +Comment: test 32 +Plaintext: af20a390 547571aa +Key: 27f917b1 c1da8993 60e2acaa a6eb923d +Rounds: 32 +Ciphertext: d26428af 0a202283 +Test: Encrypt +Comment: test 33 +Plaintext: 0a202283 27f917b1 +Key: c1da8993 60e2acaa a6eb923d d26428af +Rounds: 33 +Ciphertext: 1c03ceb9 96e9f2d3 +Test: Encrypt +Comment: test 34 +Plaintext: 96e9f2d3 c1da8993 +Key: 60e2acaa a6eb923d d26428af 1c03ceb9 +Rounds: 34 +Ciphertext: e260b3c1 bbd7dff0 +Test: Encrypt +Comment: test 35 +Plaintext: bbd7dff0 60e2acaa +Key: a6eb923d d26428af 1c03ceb9 e260b3c1 +Rounds: 35 +Ciphertext: d33073f9 12841b97 +Test: Encrypt +Comment: test 36 +Plaintext: 12841b97 a6eb923d +Key: d26428af 1c03ceb9 e260b3c1 d33073f9 +Rounds: 36 +Ciphertext: 17b7ea05 1d723f18 +Test: Encrypt +Comment: test 37 +Plaintext: 1d723f18 d26428af +Key: 1c03ceb9 e260b3c1 d33073f9 17b7ea05 +Rounds: 37 +Ciphertext: 9f571045 31e849b9 +Test: Encrypt +Comment: test 38 +Plaintext: 31e849b9 1c03ceb9 +Key: e260b3c1 d33073f9 17b7ea05 9f571045 +Rounds: 38 +Ciphertext: 288351d2 bd0a0054 +Test: Encrypt +Comment: test 39 +Plaintext: bd0a0054 e260b3c1 +Key: d33073f9 17b7ea05 9f571045 288351d2 +Rounds: 39 +Ciphertext: 9236883a 2bd13143 +Test: Encrypt +Comment: test 40 +Plaintext: 2bd13143 d33073f9 +Key: 17b7ea05 9f571045 288351d2 9236883a +Rounds: 40 +Ciphertext: e91dcf23 7c3fd716 +Test: Encrypt +Comment: test 41 +Plaintext: 7c3fd716 17b7ea05 +Key: 9f571045 288351d2 9236883a e91dcf23 +Rounds: 41 +Ciphertext: 5c8ff51e c3abe43d +Test: Encrypt +Comment: test 42 +Plaintext: c3abe43d 9f571045 +Key: 288351d2 9236883a e91dcf23 5c8ff51e +Rounds: 42 +Ciphertext: 446e9f7c ecb0eb4d +Test: Encrypt +Comment: test 43 +Plaintext: ecb0eb4d 288351d2 +Key: 9236883a e91dcf23 5c8ff51e 446e9f7c +Rounds: 43 +Ciphertext: 86455f77 ffc74050 +Test: Encrypt +Comment: test 44 +Plaintext: ffc74050 9236883a +Key: e91dcf23 5c8ff51e 446e9f7c 86455f77 +Rounds: 44 +Ciphertext: ae85d873 e21ef8d3 +Test: Encrypt +Comment: test 45 +Plaintext: e21ef8d3 e91dcf23 +Key: 5c8ff51e 446e9f7c 86455f77 ae85d873 +Rounds: 45 +Ciphertext: cf411a68 18dce768 +Test: Encrypt +Comment: test 46 +Plaintext: 18dce768 5c8ff51e +Key: 446e9f7c 86455f77 ae85d873 cf411a68 +Rounds: 46 +Ciphertext: 4ef68794 07d2b1b3 +Test: Encrypt +Comment: test 47 +Plaintext: 07d2b1b3 446e9f7c +Key: 86455f77 ae85d873 cf411a68 4ef68794 +Rounds: 47 +Ciphertext: d75a1925 07476976 +Test: Encrypt +Comment: test 48 +Plaintext: 07476976 86455f77 +Key: ae85d873 cf411a68 4ef68794 d75a1925 +Rounds: 48 +Ciphertext: 909d29cb 16b37e1b +Test: Encrypt +Comment: test 49 +Plaintext: 16b37e1b ae85d873 +Key: cf411a68 4ef68794 d75a1925 909d29cb +Rounds: 49 +Ciphertext: e05578cd bd40cd0c +Test: Encrypt +Comment: test 50 +Plaintext: bd40cd0c cf411a68 +Key: 4ef68794 d75a1925 909d29cb e05578cd +Rounds: 50 +Ciphertext: 988b50e5 adf1b74c +Test: Encrypt +Comment: test 51 +Plaintext: adf1b74c 4ef68794 +Key: d75a1925 909d29cb e05578cd 988b50e5 +Rounds: 51 +Ciphertext: 90699d3d d2333c19 +Test: Encrypt +Comment: test 52 +Plaintext: d2333c19 d75a1925 +Key: 909d29cb e05578cd 988b50e5 90699d3d +Rounds: 52 +Ciphertext: a119eb2e 3488c65b +Test: Encrypt +Comment: test 53 +Plaintext: 3488c65b 909d29cb +Key: e05578cd 988b50e5 90699d3d a119eb2e +Rounds: 53 +Ciphertext: e4c43e62 e9c4894b +Test: Encrypt +Comment: test 54 +Plaintext: e9c4894b e05578cd +Key: 988b50e5 90699d3d a119eb2e e4c43e62 +Rounds: 54 +Ciphertext: e1aec3f2 1976c384 +Test: Encrypt +Comment: test 55 +Plaintext: 1976c384 988b50e5 +Key: 90699d3d a119eb2e e4c43e62 e1aec3f2 +Rounds: 55 +Ciphertext: 1b7b0e2b 0b392b46 +Test: Encrypt +Comment: test 56 +Plaintext: 0b392b46 90699d3d +Key: a119eb2e e4c43e62 e1aec3f2 1b7b0e2b +Rounds: 56 +Ciphertext: 1a6ffc0c 600f2ee0 +Test: Encrypt +Comment: test 57 +Plaintext: 600f2ee0 a119eb2e +Key: e4c43e62 e1aec3f2 1b7b0e2b 1a6ffc0c +Rounds: 57 +Ciphertext: 82ccc9d3 94ba3d77 +Test: Encrypt +Comment: test 58 +Plaintext: 94ba3d77 e4c43e62 +Key: e1aec3f2 1b7b0e2b 1a6ffc0c 82ccc9d3 +Rounds: 58 +Ciphertext: 38b5ebd1 c56af77e +Test: Encrypt +Comment: test 59 +Plaintext: c56af77e e1aec3f2 +Key: 1b7b0e2b 1a6ffc0c 82ccc9d3 38b5ebd1 +Rounds: 59 +Ciphertext: f5571f9d fe136a04 +Test: Encrypt +Comment: test 60 +Plaintext: fe136a04 1b7b0e2b +Key: 1a6ffc0c 82ccc9d3 38b5ebd1 f5571f9d +Rounds: 60 +Ciphertext: 62ee209f 08550367 +Test: Encrypt +Comment: test 61 +Plaintext: 08550367 1a6ffc0c +Key: 82ccc9d3 38b5ebd1 f5571f9d 62ee209f +Rounds: 61 +Ciphertext: 069b7afc b0fcde91 +Test: Encrypt +Comment: test 62 +Plaintext: b0fcde91 82ccc9d3 +Key: 38b5ebd1 f5571f9d 62ee209f 069b7afc +Rounds: 62 +Ciphertext: 376a8936 11b9c087 +Test: Encrypt +Comment: test 63 +Plaintext: 11b9c087 38b5ebd1 +Key: f5571f9d 62ee209f 069b7afc 376a8936 +Rounds: 63 +Ciphertext: cdc9e923 2e6c1fe7 +Test: Encrypt +Comment: test 64 +Plaintext: 2e6c1fe7 f5571f9d +Key: 62ee209f 069b7afc 376a8936 cdc9e923 +Rounds: 64 +Ciphertext: 7a01cbc9 b03d6068 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/ttmac.txt b/external/crypto++-5.6.3/TestVectors/ttmac.txt new file mode 100644 index 000000000..ec2e683f0 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/ttmac.txt @@ -0,0 +1,40 @@ +AlgorithmType: MAC +Name: Two-Track-MAC +Source: NESSIE submission +Comment: Key for all test cases +Key: 00112233445566778899aabbccddeeff01234567 +Comment: Test Case 1 +Message: "" +MAC: 2dec8ed4a0fd712ed9fbf2ab466ec2df21215e4a +Test: Verify +Comment: Test Case 2 +Message: "a" +MAC: 5893e3e6e306704dd77ad6e6ed432cde321a7756 +Test: Verify +Comment: Test Case 3 +Message: "abc" +MAC: 70bfd1029797a5c16da5b557a1f0b2779b78497e +Test: Verify +Comment: Test Case 4 +Message: "message digest" +MAC: 8289f4f19ffe4f2af737de4bd71c829d93a972fa +Test: Verify +Comment: Test Case 5 +Message: "abcdefghijklmnopqrstuvwxyz" +MAC: 2186ca09c5533198b7371f245273504ca92bae60 +Test: Verify +Comment: Test Case 6 +Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +MAC: 8a7bf77aef62a2578497a27c0d6518a429e7c14d +Test: Verify +Comment: Test Case 7 +Message: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" +MAC: 54bac392a886806d169556fcbb6789b54fb364fb +Test: Verify +Comment: Test Case 8 +Message: r8 "1234567890" +MAC: 0ced2c9f8f0d9d03981ab5c8184bac43dd54c484 +Test: Verify +Comment: Test Case 9 +Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +MAC: 27b3aedb5df8b629f0142194daa3846e1895f3d2 diff --git a/external/crypto++-5.6.3/TestVectors/vmac.txt b/external/crypto++-5.6.3/TestVectors/vmac.txt new file mode 100644 index 000000000..1d983cd95 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/vmac.txt @@ -0,0 +1,77 @@ +AlgorithmType: MAC +Name: VMAC(AES)-64 +Source: http://www.fastcrypto.org/vmac/draft-krovetz-vmac-01.txt +Key: "abcdefghijklmnop" +IV: "bcdefghi" +Message: "" +MAC: 2576BE1C56D8B81B +Test: Verify +Message: "abc" +MAC: 2D376CF5B1813CE5 +Test: Verify +Message: r16 "abc" +MAC: E8421F61D573D298 +Test: Verify +Message: r100 "abc" +MAC: 4492DF6C5CAC1BBE +Test: Verify +Message: r1000000 "abc" +MAC: 09BA597DD7601113 +Test: Verify +Message: r42 "abc" "ab" +MAC: D638B73921F184DE +Test: Verify +Message: r170 "abc" "ab" +MAC: 9DA310281E6FD0A0 +Test: Verify +Message: r65 "a" +MAC: 90 ea 57 cb 51 bc 92 a3 +Test: Verify +Message: r129 "a" +MAC: 86 34 83 87 d1 3d 82 33 +Test: Verify +Message: r65 "abc" +MAC: E86A86EC77A8BF61 +Test: Verify +Message: "abc" +MAC: 2D376CF5B1813CE0 +Test: NotVerify + +AlgorithmType: MAC +Name: VMAC(AES)-128 +Source: http://www.fastcrypto.org/vmac/draft-krovetz-vmac-01.txt +Key: "abcdefghijklmnop" +IV: "bcdefghi" +Message: "" +MAC: 472766C70F74ED23481D6D7DE4E80DAC +Test: Verify +Message: "abc" +MAC: 4EE815A06A1D71EDD36FC75D51188A42 +Test: Verify +Message: r16 "abc" +MAC: 09F2C80C8E1007A0C12FAE19FE4504AE +Test: Verify +Message: r100 "abc" +MAC: 66438817154850C61D8A412164803BCB +Test: Verify +Message: r1000000 "abc" +MAC: 2B6B02288FFC461B75485DE893C629DC +Test: Verify +Message: r42 "abc" "ab" +MAC: F7E95FE3DA8DB9E6BB973E65D0B4CEA5 +Test: Verify +Message: r170 "abc" "ab" +MAC: BF53B8D2D70C05A85880C2E21CAF1299 +Test: Verify +Message: r65 "a" +MAC: b2 9b 00 76 0a 58 c7 ab 92 d6 60 24 d6 9c 1b 92 +Test: Verify +Message: r129 "a" +MAC: a7 e5 2c 32 89 d9 b7 3b 53 57 6f 05 95 85 ee 79 +Test: Verify +Message: r65 "abc" +MAC: 0A1B2F973044F469F405917E45010334 +Test: Verify +Message: "abc" +MAC: 4EE815A06A1D71EDD36FC75D51188A40 +Test: NotVerify diff --git a/external/crypto++-5.6.3/TestVectors/wake.txt b/external/crypto++-5.6.3/TestVectors/wake.txt new file mode 100644 index 000000000..2dd80a2a1 --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/wake.txt @@ -0,0 +1,10 @@ +AlgorithmType: SymmetricCipher +Source: Generated by Crypto++ 5.6.1 +Key: r2 00112233445566778899AABBCCDDEEFF +Plaintext: r80 00 r80 01 +Name: WAKE-OFB-LE +Ciphertext: FFEEDDCCDF42B9D4939C351568AB4888BD9264CA66CF7F7885141F6934F3F390F1987B8609B733919DC5F73F7BED93ECDCD4F35FF32828553B8AFAD113DDA6565932553D9143AA886AE859167327F3C260434E6C90A0895FD33E6B6412526521FA0B12F4ECEE3E8F4F96DCF70907AAFB5E29C40FC10EB70A4970736E98DF98C615AC844A46FB8E4AEBBBF599DF7B73930B94776C6C8757BE51B34E71E9B514AE +Test: Encrypt +Name: WAKE-OFB-BE +Ciphertext: CCDDEEFFD4B942DF15359C938848AB68CA6492BD787FCF66691F148590F3F334867B98F19133B7093FF7C59DEC93ED7B5FF3D4DC552828F3D1FA8A3B56A6DD133D55325988AA43911659E86AC2F327736C4E43605F89A090646B3ED321655212F4120BFA8F3EEEECF7DC964FFBAA07090FC4295E0AB70EC16E737049C698DF984A84AC154A8EFB4699F5BBEB93737BDF6C77940BBE57876C714EB351AE14B5E9 +Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/whrlpool.txt b/external/crypto++-5.6.3/TestVectors/whrlpool.txt new file mode 100644 index 000000000..9a4df8bbe --- /dev/null +++ b/external/crypto++-5.6.3/TestVectors/whrlpool.txt @@ -0,0 +1,39 @@ +AlgorithmType: MessageDigest +Name: Whirlpool +Source: ISO test vectors in http://planeta.terra.com.br/informatica/paulobarreto/whirlpool.zip +Message: "" +Digest: 19FA61D75522A466 9B44E39C1D2E1726 C530232130D407F8 9AFEE0964997F7A7\ + 3E83BE698B288FEB CF88E3E03C4F0757 EA8964E59B63D937 08B138CC42A66EB3 +Test: Verify +Message: "a" +Digest: 8ACA2602792AEC6F 11A67206531FB7D7 F0DFF59413145E69 73C45001D0087B42\ + D11BC645413AEFF6 3A42391A39145A59 1A92200D560195E5 3B478584FDAE231A +Test: Verify +Message: "abc" +Digest: 4E2448A4C6F486BB 16B6562C73B4020B F3043E3A731BCE72 1AE1B303D97E6D4C\ + 7181EEBDB6C57E27 7D0E34957114CBD6 C797FC9D95D8B582 D225292076D4EEF5 +Test: Verify +Message: "message digest" +Digest: 378C84A4126E2DC6 E56DCC7458377AAC 838D00032230F53C E1F5700C0FFB4D3B\ + 8421557659EF55C1 06B4B52AC5A4AAA6 92ED920052838F33 62E86DBD37A8903E +Test: Verify +Message: "abcdefghijklmnopqrstuvwxyz" +Digest: F1D754662636FFE9 2C82EBB9212A484A 8D38631EAD4238F5 442EE13B8054E41B\ + 08BF2A9251C30B6A 0B8AAE86177AB4A6 F68F673E7207865D 5D9819A3DBA4EB3B +Test: Verify +Message: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" +Digest: DC37E008CF9EE69B F11F00ED9ABA2690 1DD7C28CDEC066CC 6AF42E40F82F3A1E\ + 08EBA26629129D8F B7CB57211B9281A6 5517CC879D7B9621 42C65F5A7AF01467 +Test: Verify +Message: r8 "1234567890" +Digest: 466EF18BABB0154D 25B9D38A6414F5C0 8784372BCCB204D6 549C4AFADB601429\ + 4D5BD8DF2A6C44E5 38CD047B2681A51A 2C60481E88C5A20B 2C2A80CF3A9A083B +Test: Verify +Message: "abcdbcdecdefdefgefghfghighijhijk" +Digest: 2A987EA40F917061 F5D6F0A0E4644F48 8A7A5A52DEEE6562 07C562F988E95C69\ + 16BDC8031BC5BE1B 7B947639FE050B56 939BAAA0ADFF9AE6 745B7B181C3BE3FD +Test: Verify +Message: r1000000 "a" +Digest: 0C99005BEB57EFF5 0A7CF005560DDF5D 29057FD86B20BFD6 2DECA0F1CCEA4AF5\ + 1FC15490EDDC47AF 32BB2B66C34FF9AD 8C6008AD677F7712 6953B226E4ED8B01 +Test: Verify diff --git a/external/crypto++-5.6.3/adhoc.cpp.proto b/external/crypto++-5.6.3/adhoc.cpp.proto new file mode 100644 index 000000000..f2502259d --- /dev/null +++ b/external/crypto++-5.6.3/adhoc.cpp.proto @@ -0,0 +1,23 @@ +#include "config.h" +#include + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100 4189 4996) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +extern int (*AdhocTest)(int argc, char *argv[]); + +int MyAdhocTest(int argc, char *argv[]) +{ + CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv); + return 0; +} + +static int s_i = (AdhocTest = &MyAdhocTest, 0); diff --git a/external/crypto++-5.6.3/adler32.cpp b/external/crypto++-5.6.3/adler32.cpp new file mode 100644 index 000000000..4b3cdb630 --- /dev/null +++ b/external/crypto++-5.6.3/adler32.cpp @@ -0,0 +1,82 @@ +// adler32.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "adler32.h" + +NAMESPACE_BEGIN(CryptoPP) + +void Adler32::Update(const byte *input, size_t length) +{ + const unsigned long BASE = 65521; + + unsigned long s1 = m_s1; + unsigned long s2 = m_s2; + + if (length % 8 != 0) + { + do + { + s1 += *input++; + s2 += s1; + length--; + } while (length % 8 != 0); + + if (s1 >= BASE) + s1 -= BASE; + s2 %= BASE; + } + + while (length > 0) + { + s1 += input[0]; s2 += s1; + s1 += input[1]; s2 += s1; + s1 += input[2]; s2 += s1; + s1 += input[3]; s2 += s1; + s1 += input[4]; s2 += s1; + s1 += input[5]; s2 += s1; + s1 += input[6]; s2 += s1; + s1 += input[7]; s2 += s1; + + length -= 8; + input += 8; + + if (s1 >= BASE) + s1 -= BASE; + if (length % 0x8000 == 0) + s2 %= BASE; + } + + assert(s1 < BASE); + assert(s2 < BASE); + + m_s1 = (word16)s1; + m_s2 = (word16)s2; +} + +void Adler32::TruncatedFinal(byte *hash, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + switch (size) + { + default: + hash[3] = byte(m_s1); + // fall through + case 3: + hash[2] = byte(m_s1 >> 8); + // fall through + case 2: + hash[1] = byte(m_s2); + // fall through + case 1: + hash[0] = byte(m_s2 >> 8); + // fall through + case 0: + ;; + // fall through + } + + Reset(); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/adler32.h b/external/crypto++-5.6.3/adler32.h new file mode 100644 index 000000000..e538b5a1e --- /dev/null +++ b/external/crypto++-5.6.3/adler32.h @@ -0,0 +1,34 @@ +// adler32.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile adler32.h +//! \brief Class file for ADLER-32 checksum calculations + +#ifndef CRYPTOPP_ADLER32_H +#define CRYPTOPP_ADLER32_H + +#include "cryptlib.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! ADLER-32 checksum calculations +class Adler32 : public HashTransformation +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 4) + Adler32() {Reset();} + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *hash, size_t size); + unsigned int DigestSize() const {return DIGESTSIZE;} + static const char * StaticAlgorithmName() {return "Adler32";} + std::string AlgorithmName() const {return StaticAlgorithmName();} + +private: + void Reset() {m_s1 = 1; m_s2 = 0;} + + word16 m_s1, m_s2; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/aes.h b/external/crypto++-5.6.3/aes.h new file mode 100644 index 000000000..6a5355348 --- /dev/null +++ b/external/crypto++-5.6.3/aes.h @@ -0,0 +1,21 @@ +// aes.h - written and placed in the public domain by Wei Dai + +//! \file +//! \brief Class file for the AES cipher (Rijndael) + +#ifndef CRYPTOPP_AES_H +#define CRYPTOPP_AES_H + +#include "rijndael.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! AES winner, announced on 10/2/2000 +DOCUMENTED_TYPEDEF(Rijndael, AES); + +typedef RijndaelEncryption AESEncryption; +typedef RijndaelDecryption AESDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/algebra.cpp b/external/crypto++-5.6.3/algebra.cpp new file mode 100644 index 000000000..d577af550 --- /dev/null +++ b/external/crypto++-5.6.3/algebra.cpp @@ -0,0 +1,341 @@ +// algebra.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_ALGEBRA_CPP // SunCC workaround: compiler could cause this file to be included twice +#define CRYPTOPP_ALGEBRA_CPP + +#include "algebra.h" +#include "integer.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +template const T& AbstractGroup::Double(const Element &a) const +{ + return this->Add(a, a); +} + +template const T& AbstractGroup::Subtract(const Element &a, const Element &b) const +{ + // make copy of a in case Inverse() overwrites it + Element a1(a); + return this->Add(a1, Inverse(b)); +} + +template T& AbstractGroup::Accumulate(Element &a, const Element &b) const +{ + return a = this->Add(a, b); +} + +template T& AbstractGroup::Reduce(Element &a, const Element &b) const +{ + return a = this->Subtract(a, b); +} + +template const T& AbstractRing::Square(const Element &a) const +{ + return this->Multiply(a, a); +} + +template const T& AbstractRing::Divide(const Element &a, const Element &b) const +{ + // make copy of a in case MultiplicativeInverse() overwrites it + Element a1(a); + return this->Multiply(a1, this->MultiplicativeInverse(b)); +} + +template const T& AbstractEuclideanDomain::Mod(const Element &a, const Element &b) const +{ + Element q; + this->DivisionAlgorithm(result, q, a, b); + return result; +} + +template const T& AbstractEuclideanDomain::Gcd(const Element &a, const Element &b) const +{ + Element g[3]={b, a}; + unsigned int i0=0, i1=1, i2=2; + + while (!this->Equal(g[i1], this->Identity())) + { + g[i2] = this->Mod(g[i0], g[i1]); + unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; + } + + return result = g[i0]; +} + +template const typename QuotientRing::Element& QuotientRing::MultiplicativeInverse(const Element &a) const +{ + Element g[3]={m_modulus, a}; + Element v[3]={m_domain.Identity(), m_domain.MultiplicativeIdentity()}; + Element y; + unsigned int i0=0, i1=1, i2=2; + + while (!this->Equal(g[i1], this->Identity())) + { + // y = g[i0] / g[i1]; + // g[i2] = g[i0] % g[i1]; + m_domain.DivisionAlgorithm(g[i2], y, g[i0], g[i1]); + // v[i2] = v[i0] - (v[i1] * y); + v[i2] = m_domain.Subtract(v[i0], m_domain.Multiply(v[i1], y)); + unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; + } + + return m_domain.IsUnit(g[i0]) ? m_domain.Divide(v[i0], g[i0]) : m_domain.Identity(); +} + +template T AbstractGroup::ScalarMultiply(const Element &base, const Integer &exponent) const +{ + Element result; + this->SimultaneousMultiply(&result, base, &exponent, 1); + return result; +} + +template T AbstractGroup::CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const +{ + const unsigned expLen = STDMAX(e1.BitCount(), e2.BitCount()); + if (expLen==0) + return this->Identity(); + + const unsigned w = (expLen <= 46 ? 1 : (expLen <= 260 ? 2 : 3)); + const unsigned tableSize = 1< powerTable(tableSize << w); + + powerTable[1] = x; + powerTable[tableSize] = y; + if (w==1) + powerTable[3] = this->Add(x,y); + else + { + powerTable[2] = this->Double(x); + powerTable[2*tableSize] = this->Double(y); + + unsigned i, j; + + for (i=3; i=0; i--) + { + power1 = 2*power1 + e1.GetBit(i); + power2 = 2*power2 + e2.GetBit(i); + + if (i==0 || 2*power1 >= tableSize || 2*power2 >= tableSize) + { + unsigned squaresBefore = prevPosition-i; + unsigned squaresAfter = 0; + prevPosition = i; + while ((power1 || power2) && power1%2 == 0 && power2%2==0) + { + power1 /= 2; + power2 /= 2; + squaresBefore--; + squaresAfter++; + } + if (firstTime) + { + result = powerTable[(power2<Double(result); + if (power1 || power2) + Accumulate(result, powerTable[(power2<Double(result); + power1 = power2 = 0; + } + } + return result; +} + +template Element GeneralCascadeMultiplication(const AbstractGroup &group, Iterator begin, Iterator end) +{ + if (end-begin == 1) + return group.ScalarMultiply(begin->base, begin->exponent); + else if (end-begin == 2) + return group.CascadeScalarMultiply(begin->base, begin->exponent, (begin+1)->base, (begin+1)->exponent); + else + { + Integer q, t; + Iterator last = end; + --last; + + std::make_heap(begin, end); + std::pop_heap(begin, end); + + while (!!begin->exponent) + { + // last->exponent is largest exponent, begin->exponent is next largest + t = last->exponent; + Integer::Divide(last->exponent, q, t, begin->exponent); + + if (q == Integer::One()) + group.Accumulate(begin->base, last->base); // avoid overhead of ScalarMultiply() + else + group.Accumulate(begin->base, group.ScalarMultiply(last->base, q)); + + std::push_heap(begin, end); + std::pop_heap(begin, end); + } + + return group.ScalarMultiply(last->base, last->exponent); + } +} + +struct WindowSlider +{ + WindowSlider(const Integer &expIn, bool fastNegate, unsigned int windowSizeIn=0) + : exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn), windowBegin(0), expWindow(0) + , fastNegate(fastNegate), negateNext(false), firstTime(true), finished(false) + { + if (windowSize == 0) + { + unsigned int expLen = exp.BitCount(); + windowSize = expLen <= 17 ? 1 : (expLen <= 24 ? 2 : (expLen <= 70 ? 3 : (expLen <= 197 ? 4 : (expLen <= 539 ? 5 : (expLen <= 1434 ? 6 : 7))))); + } + windowModulus <<= windowSize; + } + + void FindNextWindow() + { + unsigned int expLen = exp.WordCount() * WORD_BITS; + unsigned int skipCount = firstTime ? 0 : windowSize; + firstTime = false; + while (!exp.GetBit(skipCount)) + { + if (skipCount >= expLen) + { + finished = true; + return; + } + skipCount++; + } + + exp >>= skipCount; + windowBegin += skipCount; + expWindow = word32(exp % (word(1) << windowSize)); + + if (fastNegate && exp.GetBit(windowSize)) + { + negateNext = true; + expWindow = (word32(1) << windowSize) - expWindow; + exp += windowModulus; + } + else + negateNext = false; + } + + Integer exp, windowModulus; + unsigned int windowSize, windowBegin; + word32 expWindow; + bool fastNegate, negateNext, firstTime, finished; +}; + +template +void AbstractGroup::SimultaneousMultiply(T *results, const T &base, const Integer *expBegin, unsigned int expCount) const +{ + std::vector > buckets(expCount); + std::vector exponents; + exponents.reserve(expCount); + unsigned int i; + + for (i=0; iNotNegative()); + exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0)); + exponents[i].FindNextWindow(); + buckets[i].resize(1<<(exponents[i].windowSize-1), Identity()); + } + + unsigned int expBitPosition = 0; + Element g = base; + bool notDone = true; + + while (notDone) + { + notDone = false; + for (i=0; i 1) + { + for (int j = (int)buckets[i].size()-2; j >= 1; j--) + { + Accumulate(buckets[i][j], buckets[i][j+1]); + Accumulate(r, buckets[i][j]); + } + Accumulate(buckets[i][0], buckets[i][1]); + r = Add(Double(r), buckets[i][0]); + } + } +} + +template T AbstractRing::Exponentiate(const Element &base, const Integer &exponent) const +{ + Element result; + SimultaneousExponentiate(&result, base, &exponent, 1); + return result; +} + +template T AbstractRing::CascadeExponentiate(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const +{ + return MultiplicativeGroup().AbstractGroup::CascadeScalarMultiply(x, e1, y, e2); +} + +template Element GeneralCascadeExponentiation(const AbstractRing &ring, Iterator begin, Iterator end) +{ + return GeneralCascadeMultiplication(ring.MultiplicativeGroup(), begin, end); +} + +template +void AbstractRing::SimultaneousExponentiate(T *results, const T &base, const Integer *exponents, unsigned int expCount) const +{ + MultiplicativeGroup().AbstractGroup::SimultaneousMultiply(results, base, exponents, expCount); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/algebra.h b/external/crypto++-5.6.3/algebra.h new file mode 100644 index 000000000..d21941618 --- /dev/null +++ b/external/crypto++-5.6.3/algebra.h @@ -0,0 +1,295 @@ +// algebra.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile algebra.h +//! \brief Classes for performing mathematics over different fields + +#ifndef CRYPTOPP_ALGEBRA_H +#define CRYPTOPP_ALGEBRA_H + +#include "config.h" +#include "misc.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +class Integer; + +// "const Element&" returned by member functions are references +// to internal data members. Since each object may have only +// one such data member for holding results, the following code +// will produce incorrect results: +// abcd = group.Add(group.Add(a,b), group.Add(c,d)); +// But this should be fine: +// abcd = group.Add(a, group.Add(b, group.Add(c,d)); + +//! Abstract Group +template class CRYPTOPP_NO_VTABLE AbstractGroup +{ +public: + typedef T Element; + + virtual ~AbstractGroup() {} + + virtual bool Equal(const Element &a, const Element &b) const =0; + virtual const Element& Identity() const =0; + virtual const Element& Add(const Element &a, const Element &b) const =0; + virtual const Element& Inverse(const Element &a) const =0; + virtual bool InversionIsFast() const {return false;} + + virtual const Element& Double(const Element &a) const; + virtual const Element& Subtract(const Element &a, const Element &b) const; + virtual Element& Accumulate(Element &a, const Element &b) const; + virtual Element& Reduce(Element &a, const Element &b) const; + + virtual Element ScalarMultiply(const Element &a, const Integer &e) const; + virtual Element CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const; + + virtual void SimultaneousMultiply(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; +}; + +//! Abstract Ring +template class CRYPTOPP_NO_VTABLE AbstractRing : public AbstractGroup +{ +public: + typedef T Element; + + AbstractRing() {m_mg.m_pRing = this;} + AbstractRing(const AbstractRing &source) + {CRYPTOPP_UNUSED(source); m_mg.m_pRing = this;} + AbstractRing& operator=(const AbstractRing &source) + {CRYPTOPP_UNUSED(source); return *this;} + + virtual bool IsUnit(const Element &a) const =0; + virtual const Element& MultiplicativeIdentity() const =0; + virtual const Element& Multiply(const Element &a, const Element &b) const =0; + virtual const Element& MultiplicativeInverse(const Element &a) const =0; + + virtual const Element& Square(const Element &a) const; + virtual const Element& Divide(const Element &a, const Element &b) const; + + virtual Element Exponentiate(const Element &a, const Integer &e) const; + virtual Element CascadeExponentiate(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const; + + virtual void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; + + virtual const AbstractGroup& MultiplicativeGroup() const + {return m_mg;} + +private: + class MultiplicativeGroupT : public AbstractGroup + { + public: + const AbstractRing& GetRing() const + {return *m_pRing;} + + bool Equal(const Element &a, const Element &b) const + {return GetRing().Equal(a, b);} + + const Element& Identity() const + {return GetRing().MultiplicativeIdentity();} + + const Element& Add(const Element &a, const Element &b) const + {return GetRing().Multiply(a, b);} + + Element& Accumulate(Element &a, const Element &b) const + {return a = GetRing().Multiply(a, b);} + + const Element& Inverse(const Element &a) const + {return GetRing().MultiplicativeInverse(a);} + + const Element& Subtract(const Element &a, const Element &b) const + {return GetRing().Divide(a, b);} + + Element& Reduce(Element &a, const Element &b) const + {return a = GetRing().Divide(a, b);} + + const Element& Double(const Element &a) const + {return GetRing().Square(a);} + + Element ScalarMultiply(const Element &a, const Integer &e) const + {return GetRing().Exponentiate(a, e);} + + Element CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const + {return GetRing().CascadeExponentiate(x, e1, y, e2);} + + void SimultaneousMultiply(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const + {GetRing().SimultaneousExponentiate(results, base, exponents, exponentsCount);} + + const AbstractRing *m_pRing; + }; + + MultiplicativeGroupT m_mg; +}; + +// ******************************************************** + +//! Base and Exponent +template +struct BaseAndExponent +{ +public: + BaseAndExponent() {} + BaseAndExponent(const T &base, const E &exponent) : base(base), exponent(exponent) {} + bool operator<(const BaseAndExponent &rhs) const {return exponent < rhs.exponent;} + T base; + E exponent; +}; + +// VC60 workaround: incomplete member template support +template + Element GeneralCascadeMultiplication(const AbstractGroup &group, Iterator begin, Iterator end); +template + Element GeneralCascadeExponentiation(const AbstractRing &ring, Iterator begin, Iterator end); + +// ******************************************************** + +//! Abstract Euclidean Domain +template class CRYPTOPP_NO_VTABLE AbstractEuclideanDomain : public AbstractRing +{ +public: + typedef T Element; + + virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a, const Element &d) const =0; + + virtual const Element& Mod(const Element &a, const Element &b) const =0; + virtual const Element& Gcd(const Element &a, const Element &b) const; + +protected: + mutable Element result; +}; + +// ******************************************************** + +//! EuclideanDomainOf +template class EuclideanDomainOf : public AbstractEuclideanDomain +{ +public: + typedef T Element; + + EuclideanDomainOf() {} + + bool Equal(const Element &a, const Element &b) const + {return a==b;} + + const Element& Identity() const + {return Element::Zero();} + + const Element& Add(const Element &a, const Element &b) const + {return result = a+b;} + + Element& Accumulate(Element &a, const Element &b) const + {return a+=b;} + + const Element& Inverse(const Element &a) const + {return result = -a;} + + const Element& Subtract(const Element &a, const Element &b) const + {return result = a-b;} + + Element& Reduce(Element &a, const Element &b) const + {return a-=b;} + + const Element& Double(const Element &a) const + {return result = a.Doubled();} + + const Element& MultiplicativeIdentity() const + {return Element::One();} + + const Element& Multiply(const Element &a, const Element &b) const + {return result = a*b;} + + const Element& Square(const Element &a) const + {return result = a.Squared();} + + bool IsUnit(const Element &a) const + {return a.IsUnit();} + + const Element& MultiplicativeInverse(const Element &a) const + {return result = a.MultiplicativeInverse();} + + const Element& Divide(const Element &a, const Element &b) const + {return result = a/b;} + + const Element& Mod(const Element &a, const Element &b) const + {return result = a%b;} + + void DivisionAlgorithm(Element &r, Element &q, const Element &a, const Element &d) const + {Element::Divide(r, q, a, d);} + + bool operator==(const EuclideanDomainOf &rhs) const + {CRYPTOPP_UNUSED(rhs); return true;} + +private: + mutable Element result; +}; + +//! Quotient Ring +template class QuotientRing : public AbstractRing +{ +public: + typedef T EuclideanDomain; + typedef typename T::Element Element; + + QuotientRing(const EuclideanDomain &domain, const Element &modulus) + : m_domain(domain), m_modulus(modulus) {} + + const EuclideanDomain & GetDomain() const + {return m_domain;} + + const Element& GetModulus() const + {return m_modulus;} + + bool Equal(const Element &a, const Element &b) const + {return m_domain.Equal(m_domain.Mod(m_domain.Subtract(a, b), m_modulus), m_domain.Identity());} + + const Element& Identity() const + {return m_domain.Identity();} + + const Element& Add(const Element &a, const Element &b) const + {return m_domain.Add(a, b);} + + Element& Accumulate(Element &a, const Element &b) const + {return m_domain.Accumulate(a, b);} + + const Element& Inverse(const Element &a) const + {return m_domain.Inverse(a);} + + const Element& Subtract(const Element &a, const Element &b) const + {return m_domain.Subtract(a, b);} + + Element& Reduce(Element &a, const Element &b) const + {return m_domain.Reduce(a, b);} + + const Element& Double(const Element &a) const + {return m_domain.Double(a);} + + bool IsUnit(const Element &a) const + {return m_domain.IsUnit(m_domain.Gcd(a, m_modulus));} + + const Element& MultiplicativeIdentity() const + {return m_domain.MultiplicativeIdentity();} + + const Element& Multiply(const Element &a, const Element &b) const + {return m_domain.Mod(m_domain.Multiply(a, b), m_modulus);} + + const Element& Square(const Element &a) const + {return m_domain.Mod(m_domain.Square(a), m_modulus);} + + const Element& MultiplicativeInverse(const Element &a) const; + + bool operator==(const QuotientRing &rhs) const + {return m_domain == rhs.m_domain && m_modulus == rhs.m_modulus;} + +protected: + EuclideanDomain m_domain; + Element m_modulus; +}; + +NAMESPACE_END + +#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#include "algebra.cpp" +#endif + +#endif diff --git a/external/crypto++-5.6.3/algparam.cpp b/external/crypto++-5.6.3/algparam.cpp new file mode 100644 index 000000000..1acee1dd7 --- /dev/null +++ b/external/crypto++-5.6.3/algparam.cpp @@ -0,0 +1,77 @@ +// algparam.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "algparam.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +PAssignIntToInteger g_pAssignIntToInteger = NULL; + +bool CombinedNameValuePairs::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + if (strcmp(name, "ValueNames") == 0) + return m_pairs1.GetVoidValue(name, valueType, pValue) && m_pairs2.GetVoidValue(name, valueType, pValue); + else + return m_pairs1.GetVoidValue(name, valueType, pValue) || m_pairs2.GetVoidValue(name, valueType, pValue); +} + +void AlgorithmParametersBase::operator=(const AlgorithmParametersBase &rhs) +{ + CRYPTOPP_UNUSED(rhs); + assert(false); +} + +bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + if (strcmp(name, "ValueNames") == 0) + { + NameValuePairs::ThrowIfTypeMismatch(name, typeid(std::string), valueType); + if (m_next.get()) + m_next->GetVoidValue(name, valueType, pValue); + (*reinterpret_cast(pValue) += m_name) += ";"; + return true; + } + else if (strcmp(name, m_name) == 0) + { + AssignValue(name, valueType, pValue); + m_used = true; + return true; + } + else if (m_next.get()) + return m_next->GetVoidValue(name, valueType, pValue); + else + return false; +} + +AlgorithmParameters::AlgorithmParameters() + : m_defaultThrowIfNotUsed(true) +{ +} + +AlgorithmParameters::AlgorithmParameters(const AlgorithmParameters &x) + : m_defaultThrowIfNotUsed(x.m_defaultThrowIfNotUsed) +{ + m_next.reset(const_cast(x).m_next.release()); +} + +AlgorithmParameters & AlgorithmParameters::operator=(const AlgorithmParameters &x) +{ + m_next.reset(const_cast(x).m_next.release()); + return *this; +} + +bool AlgorithmParameters::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + if (m_next.get()) + return m_next->GetVoidValue(name, valueType, pValue); + else + return false; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/algparam.h b/external/crypto++-5.6.3/algparam.h new file mode 100644 index 000000000..d821551d0 --- /dev/null +++ b/external/crypto++-5.6.3/algparam.h @@ -0,0 +1,511 @@ +// algparam.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile algparam.h +//! \brief Classes for working with NameValuePairs + + +#ifndef CRYPTOPP_ALGPARAM_H +#define CRYPTOPP_ALGPARAM_H + +#include "cryptlib.h" +#include "config.h" + +// TODO: fix 6011 when the API/ABI can change +#if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(push) +# pragma warning(disable: 6011 28193) +#endif + +#include "smartptr.h" +#include "secblock.h" +#include "integer.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! used to pass byte array input as part of a NameValuePairs object +/*! the deepCopy option is used when the NameValuePairs object can't + keep a copy of the data available */ +class ConstByteArrayParameter +{ +public: + ConstByteArrayParameter(const char *data = NULL, bool deepCopy = false) + : m_deepCopy(false), m_data(NULL), m_size(0) + { + Assign((const byte *)data, data ? strlen(data) : 0, deepCopy); + } + ConstByteArrayParameter(const byte *data, size_t size, bool deepCopy = false) + : m_deepCopy(false), m_data(NULL), m_size(0) + { + Assign(data, size, deepCopy); + } + template ConstByteArrayParameter(const T &string, bool deepCopy = false) + : m_deepCopy(false), m_data(NULL), m_size(0) + { + CRYPTOPP_COMPILE_ASSERT(sizeof(CPP_TYPENAME T::value_type) == 1); + Assign((const byte *)string.data(), string.size(), deepCopy); + } + + void Assign(const byte *data, size_t size, bool deepCopy) + { + // This fires, which means: no data with a size, or data with no size. + // assert((data && size) || !(data || size)); + if (deepCopy) + m_block.Assign(data, size); + else + { + m_data = data; + m_size = size; + } + m_deepCopy = deepCopy; + } + + const byte *begin() const {return m_deepCopy ? m_block.begin() : m_data;} + const byte *end() const {return m_deepCopy ? m_block.end() : m_data + m_size;} + size_t size() const {return m_deepCopy ? m_block.size() : m_size;} + +private: + bool m_deepCopy; + const byte *m_data; + size_t m_size; + SecByteBlock m_block; +}; + +class ByteArrayParameter +{ +public: + ByteArrayParameter(byte *data = NULL, unsigned int size = 0) + : m_data(data), m_size(size) {} + ByteArrayParameter(SecByteBlock &block) + : m_data(block.begin()), m_size(block.size()) {} + + byte *begin() const {return m_data;} + byte *end() const {return m_data + m_size;} + size_t size() const {return m_size;} + +private: + byte *m_data; + size_t m_size; +}; + +class CRYPTOPP_DLL CombinedNameValuePairs : public NameValuePairs +{ +public: + CombinedNameValuePairs(const NameValuePairs &pairs1, const NameValuePairs &pairs2) + : m_pairs1(pairs1), m_pairs2(pairs2) {} + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + +private: + const NameValuePairs &m_pairs1, &m_pairs2; +}; + +template +class GetValueHelperClass +{ +public: + GetValueHelperClass(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst) + : m_pObject(pObject), m_name(name), m_valueType(&valueType), m_pValue(pValue), m_found(false), m_getValueNames(false) + { + if (strcmp(m_name, "ValueNames") == 0) + { + m_found = m_getValueNames = true; + NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(std::string), *m_valueType); + if (searchFirst) + searchFirst->GetVoidValue(m_name, valueType, pValue); + if (typeid(T) != typeid(BASE)) + pObject->BASE::GetVoidValue(m_name, valueType, pValue); + ((*reinterpret_cast(m_pValue) += "ThisPointer:") += typeid(T).name()) += ';'; + } + + if (!m_found && strncmp(m_name, "ThisPointer:", 12) == 0 && strcmp(m_name+12, typeid(T).name()) == 0) + { + NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T *), *m_valueType); + *reinterpret_cast(pValue) = pObject; + m_found = true; + return; + } + + if (!m_found && searchFirst) + m_found = searchFirst->GetVoidValue(m_name, valueType, pValue); + + if (!m_found && typeid(T) != typeid(BASE)) + m_found = pObject->BASE::GetVoidValue(m_name, valueType, pValue); + } + + operator bool() const {return m_found;} + + template + GetValueHelperClass & operator()(const char *name, const R & (T::*pm)() const) + { + if (m_getValueNames) + (*reinterpret_cast(m_pValue) += name) += ";"; + if (!m_found && strcmp(name, m_name) == 0) + { + NameValuePairs::ThrowIfTypeMismatch(name, typeid(R), *m_valueType); + *reinterpret_cast(m_pValue) = (m_pObject->*pm)(); + m_found = true; + } + return *this; + } + + GetValueHelperClass &Assignable() + { +#ifndef __INTEL_COMPILER // ICL 9.1 workaround: Intel compiler copies the vTable pointer for some reason + if (m_getValueNames) + ((*reinterpret_cast(m_pValue) += "ThisObject:") += typeid(T).name()) += ';'; + if (!m_found && strncmp(m_name, "ThisObject:", 11) == 0 && strcmp(m_name+11, typeid(T).name()) == 0) + { + NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T), *m_valueType); + *reinterpret_cast(m_pValue) = *m_pObject; + m_found = true; + } +#endif + return *this; + } + +private: + const T *m_pObject; + const char *m_name; + const std::type_info *m_valueType; + void *m_pValue; + bool m_found, m_getValueNames; +}; + +template +GetValueHelperClass GetValueHelper(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst=NULL, BASE *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + return GetValueHelperClass(pObject, name, valueType, pValue, searchFirst); +} + +template +GetValueHelperClass GetValueHelper(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst=NULL) +{ + return GetValueHelperClass(pObject, name, valueType, pValue, searchFirst); +} + +// ******************************************************** + +// VC60 workaround +#if defined(_MSC_VER) && (_MSC_VER < 1300) +template +R Hack_DefaultValueFromConstReferenceType(const R &) +{ + return R(); +} + +template +bool Hack_GetValueIntoConstReference(const NameValuePairs &source, const char *name, const R &value) +{ + return source.GetValue(name, const_cast(value)); +} + +template +class AssignFromHelperClass +{ +public: + AssignFromHelperClass(T *pObject, const NameValuePairs &source) + : m_pObject(pObject), m_source(source), m_done(false) + { + if (source.GetThisObject(*pObject)) + m_done = true; + else if (typeid(BASE) != typeid(T)) + pObject->BASE::AssignFrom(source); + } + + template + AssignFromHelperClass & operator()(const char *name, void (T::*pm)(R)) // VC60 workaround: "const R &" here causes compiler error + { + if (!m_done) + { + R value = Hack_DefaultValueFromConstReferenceType(reinterpret_cast(*(int *)NULL)); + if (!Hack_GetValueIntoConstReference(m_source, name, value)) + throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name + "'"); + (m_pObject->*pm)(value); + } + return *this; + } + + template + AssignFromHelperClass & operator()(const char *name1, const char *name2, void (T::*pm)(R, S)) // VC60 workaround: "const R &" here causes compiler error + { + if (!m_done) + { + R value1 = Hack_DefaultValueFromConstReferenceType(reinterpret_cast(*(int *)NULL)); + if (!Hack_GetValueIntoConstReference(m_source, name1, value1)) + throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name1 + "'"); + S value2 = Hack_DefaultValueFromConstReferenceType(reinterpret_cast(*(int *)NULL)); + if (!Hack_GetValueIntoConstReference(m_source, name2, value2)) + throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name2 + "'"); + (m_pObject->*pm)(value1, value2); + } + return *this; + } + +private: + T *m_pObject; + const NameValuePairs &m_source; + bool m_done; +}; +#else +template +class AssignFromHelperClass +{ +public: + AssignFromHelperClass(T *pObject, const NameValuePairs &source) + : m_pObject(pObject), m_source(source), m_done(false) + { + if (source.GetThisObject(*pObject)) + m_done = true; + else if (typeid(BASE) != typeid(T)) + pObject->BASE::AssignFrom(source); + } + + template + AssignFromHelperClass & operator()(const char *name, void (T::*pm)(const R&)) + { + if (!m_done) + { + R value; + if (!m_source.GetValue(name, value)) + throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name + "'"); + (m_pObject->*pm)(value); + } + return *this; + } + + template + AssignFromHelperClass & operator()(const char *name1, const char *name2, void (T::*pm)(const R&, const S&)) + { + if (!m_done) + { + R value1; + if (!m_source.GetValue(name1, value1)) + throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name1 + "'"); + S value2; + if (!m_source.GetValue(name2, value2)) + throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name2 + "'"); + (m_pObject->*pm)(value1, value2); + } + return *this; + } + +private: + T *m_pObject; + const NameValuePairs &m_source; + bool m_done; +}; +#endif + +template +AssignFromHelperClass AssignFromHelper(T *pObject, const NameValuePairs &source, BASE *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + return AssignFromHelperClass(pObject, source); +} + +template +AssignFromHelperClass AssignFromHelper(T *pObject, const NameValuePairs &source) +{ + return AssignFromHelperClass(pObject, source); +} + +// ******************************************************** + +// to allow the linker to discard Integer code if not needed. +typedef bool (CRYPTOPP_API * PAssignIntToInteger)(const std::type_info &valueType, void *pInteger, const void *pInt); +CRYPTOPP_DLL extern PAssignIntToInteger g_pAssignIntToInteger; + +CRYPTOPP_DLL const std::type_info & CRYPTOPP_API IntegerTypeId(); + +class CRYPTOPP_DLL AlgorithmParametersBase +{ +public: + class ParameterNotUsed : public Exception + { + public: + ParameterNotUsed(const char *name) : Exception(OTHER_ERROR, std::string("AlgorithmParametersBase: parameter \"") + name + "\" not used") {} + }; + + // this is actually a move, not a copy + AlgorithmParametersBase(const AlgorithmParametersBase &x) + : m_name(x.m_name), m_throwIfNotUsed(x.m_throwIfNotUsed), m_used(x.m_used) + { + m_next.reset(const_cast(x).m_next.release()); + x.m_used = true; + } + + AlgorithmParametersBase(const char *name, bool throwIfNotUsed) + : m_name(name), m_throwIfNotUsed(throwIfNotUsed), m_used(false) {} + + virtual ~AlgorithmParametersBase() CRYPTOPP_THROW + { +#if defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) + if (!std::uncaught_exception()) +#elif defined(CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE) + if (!std::uncaught_exceptions()) +#else + try +#endif + { + if (m_throwIfNotUsed && !m_used) + throw ParameterNotUsed(m_name); + } +#if !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE) + catch(const Exception&) + { + } +#endif + } + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + +protected: + friend class AlgorithmParameters; + void operator=(const AlgorithmParametersBase& rhs); // assignment not allowed, declare this for VC60 + + virtual void AssignValue(const char *name, const std::type_info &valueType, void *pValue) const =0; + + //VALVE: Our debug allocator doesn't implement placement new, and this function is never + // actually called. + //virtual void MoveInto(void *p) const =0; // not really const + + const char *m_name; + bool m_throwIfNotUsed; + mutable bool m_used; + member_ptr m_next; +}; + +template +class AlgorithmParametersTemplate : public AlgorithmParametersBase +{ +public: + AlgorithmParametersTemplate(const char *name, const T &value, bool throwIfNotUsed) + : AlgorithmParametersBase(name, throwIfNotUsed), m_value(value) + { + } + + void AssignValue(const char *name, const std::type_info &valueType, void *pValue) const + { + // special case for retrieving an Integer parameter when an int was passed in + if (!(g_pAssignIntToInteger != NULL && typeid(T) == typeid(int) && g_pAssignIntToInteger(valueType, pValue, &m_value))) + { + NameValuePairs::ThrowIfTypeMismatch(name, typeid(T), valueType); + *reinterpret_cast(pValue) = m_value; + } + } + + //VALVE: Our debug allocator doesn't implement placement new, and this function is never + // actually called. + //void MoveInto(void *buffer) const + //{ + // AlgorithmParametersTemplate* p = new(buffer) AlgorithmParametersTemplate(*this); + // CRYPTOPP_UNUSED(p); // silence warning + //} + +protected: + T m_value; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate; +CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate; +CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate; + +//! \class AlgorithmParameters +//! \brief An object that implements NameValuePairs +//! \tparam T the class or type +//! \param name the name of the object or value to retrieve +//! \param value reference to a variable that receives the value +//! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed +//! \note throwIfNotUsed is ignored if using a compiler that does not support std::uncaught_exception(), +//! such as MSVC 7.0 and earlier. +//! \note A NameValuePairs object containing an arbitrary number of name value pairs may be constructed by +//! repeatedly using operator() on the object returned by MakeParameters, for example: +//!
+//!     AlgorithmParameters parameters = MakeParameters(name1, value1)(name2, value2)(name3, value3);
+//!   
+class CRYPTOPP_DLL AlgorithmParameters : public NameValuePairs +{ +public: + AlgorithmParameters(); + +#ifdef __BORLANDC__ + template + AlgorithmParameters(const char *name, const T &value, bool throwIfNotUsed=true) + : m_next(new AlgorithmParametersTemplate(name, value, throwIfNotUsed)) + , m_defaultThrowIfNotUsed(throwIfNotUsed) + { + } +#endif + + AlgorithmParameters(const AlgorithmParameters &x); + + AlgorithmParameters & operator=(const AlgorithmParameters &x); + + //! \tparam T the class or type + //! \param name the name of the object or value to retrieve + //! \param value reference to a variable that receives the value + //! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed + template + AlgorithmParameters & operator()(const char *name, const T &value, bool throwIfNotUsed) + { + member_ptr p(new AlgorithmParametersTemplate(name, value, throwIfNotUsed)); + p->m_next.reset(m_next.release()); + m_next.reset(p.release()); + m_defaultThrowIfNotUsed = throwIfNotUsed; + return *this; + } + + //! \brief Appends a NameValuePair to a collection of NameValuePairs + //! \tparam T the class or type + //! \param name the name of the object or value to retrieve + //! \param value reference to a variable that receives the value + template + AlgorithmParameters & operator()(const char *name, const T &value) + { + return operator()(name, value, m_defaultThrowIfNotUsed); + } + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + +protected: + member_ptr m_next; + bool m_defaultThrowIfNotUsed; +}; + +//! \brief Create an object that implements NameValuePairs +//! \tparam T the class or type +//! \param name the name of the object or value to retrieve +//! \param value reference to a variable that receives the value +//! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed +//! \note throwIfNotUsed is ignored if using a compiler that does not support std::uncaught_exception(), +//! such as MSVC 7.0 and earlier. +//! \note A NameValuePairs object containing an arbitrary number of name value pairs may be constructed by +//! repeatedly using \p operator() on the object returned by \p MakeParameters, for example: +//!
+//!     AlgorithmParameters parameters = MakeParameters(name1, value1)(name2, value2)(name3, value3);
+//!   
+#ifdef __BORLANDC__ +typedef AlgorithmParameters MakeParameters; +#else +template +AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed = true) +{ + return AlgorithmParameters()(name, value, throwIfNotUsed); +} +#endif + +#define CRYPTOPP_GET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Get##name) +#define CRYPTOPP_SET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Set##name) +#define CRYPTOPP_SET_FUNCTION_ENTRY2(name1, name2) (Name::name1(), Name::name2(), &ThisClass::Set##name1##And##name2) + +// TODO: fix 6011 when the API/ABI can change +#if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(pop) +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/arc4.cpp b/external/crypto++-5.6.3/arc4.cpp new file mode 100644 index 000000000..ae41ad0e3 --- /dev/null +++ b/external/crypto++-5.6.3/arc4.cpp @@ -0,0 +1,122 @@ +// arc4.cpp - written and placed in the public domain by Wei Dai + +// The ARC4 algorithm was first revealed in an anonymous email to the +// cypherpunks mailing list. This file originally contained some +// code copied from this email. The code has since been rewritten in order +// to clarify the copyright status of this file. It should now be +// completely in the public domain. + +#include "pch.h" +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +#include "arc4.h" + +NAMESPACE_BEGIN(CryptoPP) +namespace Weak1 { + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void ARC4_TestInstantiations() +{ + ARC4 x; +} +#endif + +ARC4_Base::~ARC4_Base() +{ + m_x = m_y = 0; +} + +void ARC4_Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(keyLen); + + m_x = 1; + m_y = 0; + + unsigned int i; + for (i=0; i<256; i++) + m_state[i] = byte(i); + + unsigned int keyIndex = 0, stateIndex = 0; + for (i=0; i<256; i++) + { + unsigned int a = m_state[i]; + stateIndex += key[keyIndex] + a; + stateIndex &= 0xff; + m_state[i] = m_state[stateIndex]; + m_state[stateIndex] = byte(a); + if (++keyIndex >= keyLen) + keyIndex = 0; + } + + int discardBytes = params.GetIntValueWithDefault("DiscardBytes", GetDefaultDiscardBytes()); + DiscardBytes(discardBytes); +} + +template +static inline unsigned int MakeByte(T &x, T &y, byte *s) +{ + unsigned int a = s[x]; + y = byte((y+a) & 0xff); + unsigned int b = s[y]; + s[x] = byte(b); + s[y] = byte(a); + x = byte((x+1) & 0xff); + return s[(a+b) & 0xff]; +} + +void ARC4_Base::GenerateBlock(byte *output, size_t size) +{ + while (size--) + *output++ = static_cast(MakeByte(m_x, m_y, m_state)); +} + +void ARC4_Base::ProcessData(byte *outString, const byte *inString, size_t length) +{ + if (length == 0) + return; + + byte *const s = m_state; + unsigned int x = m_x; + unsigned int y = m_y; + + if (inString == outString) + { + do + { + *outString++ ^= MakeByte(x, y, s); + } while (--length); + } + else + { + do + { + *outString++ = *inString++ ^ byte(MakeByte(x, y, s)); + } + while(--length); + } + + m_x = byte(x); + m_y = byte(y); +} + +void ARC4_Base::DiscardBytes(size_t length) +{ + if (length == 0) + return; + + byte *const s = m_state; + unsigned int x = m_x; + unsigned int y = m_y; + + do + { + MakeByte(x, y, s); + } + while(--length); + + m_x = byte(x); + m_y = byte(y); +} + +} +NAMESPACE_END diff --git a/external/crypto++-5.6.3/arc4.h b/external/crypto++-5.6.3/arc4.h new file mode 100644 index 000000000..4e0d1c87c --- /dev/null +++ b/external/crypto++-5.6.3/arc4.h @@ -0,0 +1,83 @@ +// arc4.h - written and placed in the public domain by Wei Dai + +//! \file arc4.h +//! \brief Classes for ARC4 cipher + +#ifndef CRYPTOPP_ARC4_H +#define CRYPTOPP_ARC4_H + +#include "cryptlib.h" +#include "strciphr.h" +#include "secblock.h" +#include "smartptr.h" + +NAMESPACE_BEGIN(CryptoPP) + +namespace Weak1 { + +//! \class ARC4_Base +//! \brief Class specific methods used to operate the cipher. +//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions +class CRYPTOPP_NO_VTABLE ARC4_Base : public VariableKeyLength<16, 1, 256>, public RandomNumberGenerator, public SymmetricCipher, public SymmetricCipherDocumentation +{ +public: + ~ARC4_Base(); + + static const char *StaticAlgorithmName() {return "ARC4";} + + void GenerateBlock(byte *output, size_t size); + void DiscardBytes(size_t n); + + void ProcessData(byte *outString, const byte *inString, size_t length); + + bool IsRandomAccess() const {return false;} + bool IsSelfInverting() const {return true;} + bool IsForwardTransformation() const {return true;} + + typedef SymmetricCipherFinal Encryption; + typedef SymmetricCipherFinal Decryption; + +protected: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + virtual unsigned int GetDefaultDiscardBytes() const {return 0;} + + FixedSizeSecBlock m_state; + byte m_x, m_y; +}; + +//! Alleged RC4 +DOCUMENTED_TYPEDEF(SymmetricCipherFinal, ARC4) + +//! \class MARC4_Base +//! \brief Class specific methods used to operate the cipher. +//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions +//! \details MARC4 discards the first 256 bytes of keystream, which may be weaker than the rest +class CRYPTOPP_NO_VTABLE MARC4_Base : public ARC4_Base +{ +public: + static const char *StaticAlgorithmName() {return "MARC4";} + + typedef SymmetricCipherFinal Encryption; + typedef SymmetricCipherFinal Decryption; + +protected: + unsigned int GetDefaultDiscardBytes() const {return 256;} +}; + +DOCUMENTED_TYPEDEF(SymmetricCipherFinal, MARC4) + +} +#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 +namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak +#else +using namespace Weak1; // import Weak1 into CryptoPP with warning +#ifdef __GNUC__ +#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." +#else +#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") +#endif +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/argnames.h b/external/crypto++-5.6.3/argnames.h new file mode 100644 index 000000000..4c4dc2d0c --- /dev/null +++ b/external/crypto++-5.6.3/argnames.h @@ -0,0 +1,88 @@ +// argnames.h - written and placed in the public domain by Wei Dai + +//! \file argnames.h +//! \brief Standard names for retrieving values by name when working with \p NameValuePairs + +#ifndef CRYPTOPP_ARGNAMES_H +#define CRYPTOPP_ARGNAMES_H + +#include "cryptlib.h" + +NAMESPACE_BEGIN(CryptoPP) + +DOCUMENTED_NAMESPACE_BEGIN(Name) + +#define CRYPTOPP_DEFINE_NAME_STRING(name) inline const char *name() {return #name;} + +CRYPTOPP_DEFINE_NAME_STRING(ValueNames) //!< string, a list of value names with a semicolon (';') after each name +CRYPTOPP_DEFINE_NAME_STRING(Version) //!< int +CRYPTOPP_DEFINE_NAME_STRING(Seed) //!< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(Key) //!< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(IV) //!< ConstByteArrayParameter, also accepts const byte * for backwards compatibility +CRYPTOPP_DEFINE_NAME_STRING(StolenIV) //!< byte * +CRYPTOPP_DEFINE_NAME_STRING(Rounds) //!< int +CRYPTOPP_DEFINE_NAME_STRING(FeedbackSize) //!< int +CRYPTOPP_DEFINE_NAME_STRING(WordSize) //!< int, in bytes +CRYPTOPP_DEFINE_NAME_STRING(BlockSize) //!< int, in bytes +CRYPTOPP_DEFINE_NAME_STRING(EffectiveKeyLength) //!< int, in bits +CRYPTOPP_DEFINE_NAME_STRING(KeySize) //!< int, in bits +CRYPTOPP_DEFINE_NAME_STRING(ModulusSize) //!< int, in bits +CRYPTOPP_DEFINE_NAME_STRING(SubgroupOrderSize) //!< int, in bits +CRYPTOPP_DEFINE_NAME_STRING(PrivateExponentSize)//!< int, in bits +CRYPTOPP_DEFINE_NAME_STRING(Modulus) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(PublicExponent) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(PrivateExponent) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(PublicElement) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(SubgroupOrder) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(Cofactor) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(SubgroupGenerator) //!< Integer, ECP::Point, or EC2N::Point +CRYPTOPP_DEFINE_NAME_STRING(Curve) //!< ECP or EC2N +CRYPTOPP_DEFINE_NAME_STRING(GroupOID) //!< OID +CRYPTOPP_DEFINE_NAME_STRING(PointerToPrimeSelector) //!< const PrimeSelector * +CRYPTOPP_DEFINE_NAME_STRING(Prime1) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(Prime2) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(ModPrime1PrivateExponent) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(ModPrime2PrivateExponent) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(MultiplicativeInverseOfPrime2ModPrime1) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(QuadraticResidueModPrime1) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(QuadraticResidueModPrime2) //!< Integer +CRYPTOPP_DEFINE_NAME_STRING(PutMessage) //!< bool +CRYPTOPP_DEFINE_NAME_STRING(TruncatedDigestSize) //!< int +CRYPTOPP_DEFINE_NAME_STRING(BlockPaddingScheme) //!< StreamTransformationFilter::BlockPaddingScheme +CRYPTOPP_DEFINE_NAME_STRING(HashVerificationFilterFlags) //!< word32 +CRYPTOPP_DEFINE_NAME_STRING(AuthenticatedDecryptionFilterFlags) //!< word32 +CRYPTOPP_DEFINE_NAME_STRING(SignatureVerificationFilterFlags) //!< word32 +CRYPTOPP_DEFINE_NAME_STRING(InputBuffer) //!< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(OutputBuffer) //!< ByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(InputFileName) //!< const char * +CRYPTOPP_DEFINE_NAME_STRING(InputFileNameWide) //!< const wchar_t * +CRYPTOPP_DEFINE_NAME_STRING(InputStreamPointer) //!< std::istream * +CRYPTOPP_DEFINE_NAME_STRING(InputBinaryMode) //!< bool +CRYPTOPP_DEFINE_NAME_STRING(OutputFileName) //!< const char * +CRYPTOPP_DEFINE_NAME_STRING(OutputFileNameWide) //!< const wchar_t * +CRYPTOPP_DEFINE_NAME_STRING(OutputStreamPointer) //!< std::ostream * +CRYPTOPP_DEFINE_NAME_STRING(OutputBinaryMode) //!< bool +CRYPTOPP_DEFINE_NAME_STRING(EncodingParameters) //!< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(KeyDerivationParameters) //!< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(Separator) //< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(Terminator) //< ConstByteArrayParameter +CRYPTOPP_DEFINE_NAME_STRING(Uppercase) //< bool +CRYPTOPP_DEFINE_NAME_STRING(GroupSize) //< int +CRYPTOPP_DEFINE_NAME_STRING(Pad) //< bool +CRYPTOPP_DEFINE_NAME_STRING(PaddingByte) //< byte +CRYPTOPP_DEFINE_NAME_STRING(Log2Base) //< int +CRYPTOPP_DEFINE_NAME_STRING(EncodingLookupArray) //< const byte * +CRYPTOPP_DEFINE_NAME_STRING(DecodingLookupArray) //< const byte * +CRYPTOPP_DEFINE_NAME_STRING(InsertLineBreaks) //< bool +CRYPTOPP_DEFINE_NAME_STRING(MaxLineLength) //< int +CRYPTOPP_DEFINE_NAME_STRING(DigestSize) //!< int, in bytes +CRYPTOPP_DEFINE_NAME_STRING(L1KeyLength) //!< int, in bytes +CRYPTOPP_DEFINE_NAME_STRING(TableSize) //!< int, in bytes +CRYPTOPP_DEFINE_NAME_STRING(Blinding) //!< bool, timing attack mitigations, ON by default +CRYPTOPP_DEFINE_NAME_STRING(DerivedKey) //!< ByteArrayParameter, key derivation, derived key +CRYPTOPP_DEFINE_NAME_STRING(DerivedKeyLength) //!< int, key derivation, derived key length in bytes +DOCUMENTED_NAMESPACE_END + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/asn.cpp b/external/crypto++-5.6.3/asn.cpp new file mode 100644 index 000000000..736040683 --- /dev/null +++ b/external/crypto++-5.6.3/asn.cpp @@ -0,0 +1,606 @@ +// asn.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "asn.h" + +#include +#include + +NAMESPACE_BEGIN(CryptoPP) +USING_NAMESPACE(std) + +/// DER Length +size_t DERLengthEncode(BufferedTransformation &bt, lword length) +{ + size_t i=0; + if (length <= 0x7f) + { + bt.Put(byte(length)); + i++; + } + else + { + bt.Put(byte(BytePrecision(length) | 0x80)); + i++; + for (int j=BytePrecision(length); j; --j) + { + bt.Put(byte(length >> (j-1)*8)); + i++; + } + } + return i; +} + +bool BERLengthDecode(BufferedTransformation &bt, lword &length, bool &definiteLength) +{ + byte b; + + if (!bt.Get(b)) + return false; + + if (!(b & 0x80)) + { + definiteLength = true; + length = b; + } + else + { + unsigned int lengthBytes = b & 0x7f; + + if (lengthBytes == 0) + { + definiteLength = false; + return true; + } + + definiteLength = true; + length = 0; + while (lengthBytes--) + { + if (length >> (8*(sizeof(length)-1))) + BERDecodeError(); // length about to overflow + + if (!bt.Get(b)) + return false; + + length = (length << 8) | b; + } + } + return true; +} + +bool BERLengthDecode(BufferedTransformation &bt, size_t &length) +{ + lword lw = 0; + bool definiteLength; + if (!BERLengthDecode(bt, lw, definiteLength)) + BERDecodeError(); + if (!SafeConvert(lw, length)) + BERDecodeError(); + return definiteLength; +} + +void DEREncodeNull(BufferedTransformation &out) +{ + out.Put(TAG_NULL); + out.Put(0); +} + +void BERDecodeNull(BufferedTransformation &in) +{ + byte b; + if (!in.Get(b) || b != TAG_NULL) + BERDecodeError(); + size_t length; + if (!BERLengthDecode(in, length) || length != 0) + BERDecodeError(); +} + +/// ASN Strings +size_t DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t strLen) +{ + bt.Put(OCTET_STRING); + size_t lengthBytes = DERLengthEncode(bt, strLen); + bt.Put(str, strLen); + return 1+lengthBytes+strLen; +} + +size_t DEREncodeOctetString(BufferedTransformation &bt, const SecByteBlock &str) +{ + return DEREncodeOctetString(bt, str.begin(), str.size()); +} + +size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str) +{ + byte b; + if (!bt.Get(b) || b != OCTET_STRING) + BERDecodeError(); + + size_t bc; + if (!BERLengthDecode(bt, bc)) + BERDecodeError(); + + str.New(bc); + if (bc != bt.Get(str, bc)) + BERDecodeError(); + return bc; +} + +size_t BERDecodeOctetString(BufferedTransformation &bt, BufferedTransformation &str) +{ + byte b; + if (!bt.Get(b) || b != OCTET_STRING) + BERDecodeError(); + + size_t bc; + if (!BERLengthDecode(bt, bc)) + BERDecodeError(); + + bt.TransferTo(str, bc); + return bc; +} + +size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag) +{ + bt.Put(asnTag); + size_t lengthBytes = DERLengthEncode(bt, str.size()); + bt.Put((const byte *)str.data(), str.size()); + return 1+lengthBytes+str.size(); +} + +size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag) +{ + byte b; + if (!bt.Get(b) || b != asnTag) + BERDecodeError(); + + size_t bc; + if (!BERLengthDecode(bt, bc)) + BERDecodeError(); + + SecByteBlock temp(bc); + if (bc != bt.Get(temp, bc)) + BERDecodeError(); + str.assign((char *)temp.begin(), bc); + return bc; +} + +/// ASN BitString +size_t DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits) +{ + bt.Put(BIT_STRING); + size_t lengthBytes = DERLengthEncode(bt, strLen+1); + bt.Put((byte)unusedBits); + bt.Put(str, strLen); + return 2+lengthBytes+strLen; +} + +size_t BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigned int &unusedBits) +{ + byte b; + if (!bt.Get(b) || b != BIT_STRING) + BERDecodeError(); + + size_t bc; + if (!BERLengthDecode(bt, bc)) + BERDecodeError(); + + byte unused; + if (!bt.Get(unused)) + BERDecodeError(); + unusedBits = unused; + str.resize(bc-1); + if ((bc-1) != bt.Get(str, bc-1)) + BERDecodeError(); + return bc-1; +} + +void DERReencode(BufferedTransformation &source, BufferedTransformation &dest) +{ + byte tag; + source.Peek(tag); + BERGeneralDecoder decoder(source, tag); + DERGeneralEncoder encoder(dest, tag); + if (decoder.IsDefiniteLength()) + decoder.TransferTo(encoder, decoder.RemainingLength()); + else + { + while (!decoder.EndReached()) + DERReencode(decoder, encoder); + } + decoder.MessageEnd(); + encoder.MessageEnd(); +} + +void OID::EncodeValue(BufferedTransformation &bt, word32 v) +{ + for (unsigned int i=RoundUpToMultipleOf(STDMAX(7U,BitPrecision(v)), 7U)-7; i != 0; i-=7) + bt.Put((byte)(0x80 | ((v >> i) & 0x7f))); + bt.Put((byte)(v & 0x7f)); +} + +size_t OID::DecodeValue(BufferedTransformation &bt, word32 &v) +{ + byte b; + size_t i=0; + v = 0; + while (true) + { + if (!bt.Get(b)) + BERDecodeError(); + i++; + if (v >> (8*sizeof(v)-7)) // v about to overflow + BERDecodeError(); + v <<= 7; + v += b & 0x7f; + if (!(b & 0x80)) + return i; + } +} + +void OID::DEREncode(BufferedTransformation &bt) const +{ + assert(m_values.size() >= 2); + ByteQueue temp; + temp.Put(byte(m_values[0] * 40 + m_values[1])); + for (size_t i=2; i 0) + { + word32 v; + size_t valueLen = DecodeValue(bt, v); + if (valueLen > length) + BERDecodeError(); + m_values.push_back(v); + length -= valueLen; + } +} + +void OID::BERDecodeAndCheck(BufferedTransformation &bt) const +{ + OID oid(bt); + if (*this != oid) + BERDecodeError(); +} + +inline BufferedTransformation & EncodedObjectFilter::CurrentTarget() +{ + if (m_flags & PUT_OBJECTS) + return *AttachedTransformation(); + else + return TheBitBucket(); +} + +void EncodedObjectFilter::Put(const byte *inString, size_t length) +{ + if (m_nCurrentObject == m_nObjects) + { + AttachedTransformation()->Put(inString, length); + return; + } + + LazyPutter lazyPutter(m_queue, inString, length); + + while (m_queue.AnyRetrievable()) + { + switch (m_state) + { + case IDENTIFIER: + if (!m_queue.Get(m_id)) + return; + m_queue.TransferTo(CurrentTarget(), 1); + m_state = LENGTH; // fall through + case LENGTH: + { + byte b; + if (m_level > 0 && m_id == 0 && m_queue.Peek(b) && b == 0) + { + m_queue.TransferTo(CurrentTarget(), 1); + m_level--; + m_state = IDENTIFIER; + break; + } + ByteQueue::Walker walker(m_queue); + bool definiteLength; + if (!BERLengthDecode(walker, m_lengthRemaining, definiteLength)) + return; + m_queue.TransferTo(CurrentTarget(), walker.GetCurrentPosition()); + if (!((m_id & CONSTRUCTED) || definiteLength)) + BERDecodeError(); + if (!definiteLength) + { + if (!(m_id & CONSTRUCTED)) + BERDecodeError(); + m_level++; + m_state = IDENTIFIER; + break; + } + m_state = BODY; // fall through + } + case BODY: + m_lengthRemaining -= m_queue.TransferTo(CurrentTarget(), m_lengthRemaining); + + if (m_lengthRemaining == 0) + m_state = IDENTIFIER; + + case TAIL: // silence warnings + case ALL_DONE: + default: ;; + } + + if (m_state == IDENTIFIER && m_level == 0) + { + // just finished processing a level 0 object + ++m_nCurrentObject; + + if (m_flags & PUT_MESSANGE_END_AFTER_EACH_OBJECT) + AttachedTransformation()->MessageEnd(); + + if (m_nCurrentObject == m_nObjects) + { + if (m_flags & PUT_MESSANGE_END_AFTER_ALL_OBJECTS) + AttachedTransformation()->MessageEnd(); + + if (m_flags & PUT_MESSANGE_SERIES_END_AFTER_ALL_OBJECTS) + AttachedTransformation()->MessageSeriesEnd(); + + m_queue.TransferAllTo(*AttachedTransformation()); + return; + } + } + } +} + +BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag) + : m_inQueue(inQueue), m_finished(false) +{ + Init(asnTag); +} + +BERGeneralDecoder::BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag) + : m_inQueue(inQueue), m_finished(false) +{ + Init(asnTag); +} + +void BERGeneralDecoder::Init(byte asnTag) +{ + byte b; + if (!m_inQueue.Get(b) || b != asnTag) + BERDecodeError(); + + if (!BERLengthDecode(m_inQueue, m_length, m_definiteLength)) + BERDecodeError(); + + if (!m_definiteLength && !(asnTag & CONSTRUCTED)) + BERDecodeError(); // cannot be primitive and have indefinite length +} + +BERGeneralDecoder::~BERGeneralDecoder() +{ + try // avoid throwing in constructor + { + if (!m_finished) + MessageEnd(); + } + catch (const Exception&) + { + assert(0); + } +} + +bool BERGeneralDecoder::EndReached() const +{ + if (m_definiteLength) + return m_length == 0; + else + { // check end-of-content octets + word16 i; + return (m_inQueue.PeekWord16(i)==2 && i==0); + } +} + +byte BERGeneralDecoder::PeekByte() const +{ + byte b; + if (!Peek(b)) + BERDecodeError(); + return b; +} + +void BERGeneralDecoder::CheckByte(byte check) +{ + byte b; + if (!Get(b) || b != check) + BERDecodeError(); +} + +void BERGeneralDecoder::MessageEnd() +{ + m_finished = true; + if (m_definiteLength) + { + if (m_length != 0) + BERDecodeError(); + } + else + { // remove end-of-content octets + word16 i; + if (m_inQueue.GetWord16(i) != 2 || i != 0) + BERDecodeError(); + } +} + +size_t BERGeneralDecoder::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + if (m_definiteLength && transferBytes > m_length) + transferBytes = m_length; + size_t blockedBytes = m_inQueue.TransferTo2(target, transferBytes, channel, blocking); + ReduceLength(transferBytes); + return blockedBytes; +} + +size_t BERGeneralDecoder::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + if (m_definiteLength) + end = STDMIN(m_length, end); + return m_inQueue.CopyRangeTo2(target, begin, end, channel, blocking); +} + +lword BERGeneralDecoder::ReduceLength(lword delta) +{ + if (m_definiteLength) + { + if (m_length < delta) + BERDecodeError(); + m_length -= delta; + } + return delta; +} + +DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag) + : ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag) +{ +} + +// TODO: GCC (and likely other compilers) identify this as a copy constructor; and not a constructor. +// We have to wait until Crypto++ 6.0 to fix it becuase the signature change breaks versioning. +DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag) + : ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag) +{ +} + +DERGeneralEncoder::~DERGeneralEncoder() +{ + try // avoid throwing in constructor + { + if (!m_finished) + MessageEnd(); + } + catch (const Exception&) + { + assert(0); + } +} + +void DERGeneralEncoder::MessageEnd() +{ + m_finished = true; + lword length = CurrentSize(); + m_outQueue.Put(m_asnTag); + DERLengthEncode(m_outQueue, length); + TransferTo(m_outQueue); +} + +// ************************************************************* + +void X509PublicKey::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder subjectPublicKeyInfo(bt); + BERSequenceDecoder algorithm(subjectPublicKeyInfo); + GetAlgorithmID().BERDecodeAndCheck(algorithm); + bool parametersPresent = algorithm.EndReached() ? false : BERDecodeAlgorithmParameters(algorithm); + algorithm.MessageEnd(); + + BERGeneralDecoder subjectPublicKey(subjectPublicKeyInfo, BIT_STRING); + subjectPublicKey.CheckByte(0); // unused bits + BERDecodePublicKey(subjectPublicKey, parametersPresent, (size_t)subjectPublicKey.RemainingLength()); + subjectPublicKey.MessageEnd(); + subjectPublicKeyInfo.MessageEnd(); +} + +void X509PublicKey::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder subjectPublicKeyInfo(bt); + + DERSequenceEncoder algorithm(subjectPublicKeyInfo); + GetAlgorithmID().DEREncode(algorithm); + DEREncodeAlgorithmParameters(algorithm); + algorithm.MessageEnd(); + + DERGeneralEncoder subjectPublicKey(subjectPublicKeyInfo, BIT_STRING); + subjectPublicKey.Put(0); // unused bits + DEREncodePublicKey(subjectPublicKey); + subjectPublicKey.MessageEnd(); + + subjectPublicKeyInfo.MessageEnd(); +} + +void PKCS8PrivateKey::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder privateKeyInfo(bt); + word32 version; + BERDecodeUnsigned(privateKeyInfo, version, INTEGER, 0, 0); // check version + + BERSequenceDecoder algorithm(privateKeyInfo); + GetAlgorithmID().BERDecodeAndCheck(algorithm); + bool parametersPresent = algorithm.EndReached() ? false : BERDecodeAlgorithmParameters(algorithm); + algorithm.MessageEnd(); + + BERGeneralDecoder octetString(privateKeyInfo, OCTET_STRING); + BERDecodePrivateKey(octetString, parametersPresent, (size_t)privateKeyInfo.RemainingLength()); + octetString.MessageEnd(); + + if (!privateKeyInfo.EndReached()) + BERDecodeOptionalAttributes(privateKeyInfo); + privateKeyInfo.MessageEnd(); +} + +void PKCS8PrivateKey::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder privateKeyInfo(bt); + DEREncodeUnsigned(privateKeyInfo, 0); // version + + DERSequenceEncoder algorithm(privateKeyInfo); + GetAlgorithmID().DEREncode(algorithm); + DEREncodeAlgorithmParameters(algorithm); + algorithm.MessageEnd(); + + DERGeneralEncoder octetString(privateKeyInfo, OCTET_STRING); + DEREncodePrivateKey(octetString); + octetString.MessageEnd(); + + DEREncodeOptionalAttributes(privateKeyInfo); + privateKeyInfo.MessageEnd(); +} + +void PKCS8PrivateKey::BERDecodeOptionalAttributes(BufferedTransformation &bt) +{ + DERReencode(bt, m_optionalAttributes); +} + +void PKCS8PrivateKey::DEREncodeOptionalAttributes(BufferedTransformation &bt) const +{ + m_optionalAttributes.CopyTo(bt); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/asn.h b/external/crypto++-5.6.3/asn.h new file mode 100644 index 000000000..cb440100f --- /dev/null +++ b/external/crypto++-5.6.3/asn.h @@ -0,0 +1,389 @@ +// asn.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile asn.h +//! \brief Classes and functions for working with ANS.1 objects + +#ifndef CRYPTOPP_ASN_H +#define CRYPTOPP_ASN_H + +#include "cryptlib.h" +#include "filters.h" +#include "smartptr.h" +#include "stdcpp.h" +#include "queue.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +// these tags and flags are not complete +enum ASNTag +{ + BOOLEAN = 0x01, + INTEGER = 0x02, + BIT_STRING = 0x03, + OCTET_STRING = 0x04, + TAG_NULL = 0x05, + OBJECT_IDENTIFIER = 0x06, + OBJECT_DESCRIPTOR = 0x07, + EXTERNAL = 0x08, + REAL = 0x09, + ENUMERATED = 0x0a, + UTF8_STRING = 0x0c, + SEQUENCE = 0x10, + SET = 0x11, + NUMERIC_STRING = 0x12, + PRINTABLE_STRING = 0x13, + T61_STRING = 0x14, + VIDEOTEXT_STRING = 0x15, + IA5_STRING = 0x16, + UTC_TIME = 0x17, + GENERALIZED_TIME = 0x18, + GRAPHIC_STRING = 0x19, + VISIBLE_STRING = 0x1a, + GENERAL_STRING = 0x1b +}; + +enum ASNIdFlag +{ + UNIVERSAL = 0x00, +// DATA = 0x01, +// HEADER = 0x02, + CONSTRUCTED = 0x20, + APPLICATION = 0x40, + CONTEXT_SPECIFIC = 0x80, + PRIVATE = 0xc0 +}; + +inline void BERDecodeError() {throw BERDecodeErr();} + +class CRYPTOPP_DLL UnknownOID : public BERDecodeErr +{ +public: + UnknownOID() : BERDecodeErr("BER decode error: unknown object identifier") {} + UnknownOID(const char *err) : BERDecodeErr(err) {} +}; + +// unsigned int DERLengthEncode(unsigned int length, byte *output=0); +CRYPTOPP_DLL size_t CRYPTOPP_API DERLengthEncode(BufferedTransformation &out, lword length); +// returns false if indefinite length +CRYPTOPP_DLL bool CRYPTOPP_API BERLengthDecode(BufferedTransformation &in, size_t &length); + +CRYPTOPP_DLL void CRYPTOPP_API DEREncodeNull(BufferedTransformation &out); +CRYPTOPP_DLL void CRYPTOPP_API BERDecodeNull(BufferedTransformation &in); + +CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &out, const byte *str, size_t strLen); +CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &out, const SecByteBlock &str); +CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &in, SecByteBlock &str); +CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &in, BufferedTransformation &str); + +// for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING +CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &out, const std::string &str, byte asnTag); +CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeTextString(BufferedTransformation &in, std::string &str, byte asnTag); + +CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeBitString(BufferedTransformation &out, const byte *str, size_t strLen, unsigned int unusedBits=0); +CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeBitString(BufferedTransformation &in, SecByteBlock &str, unsigned int &unusedBits); + +// BER decode from source and DER reencode into dest +CRYPTOPP_DLL void CRYPTOPP_API DERReencode(BufferedTransformation &source, BufferedTransformation &dest); + +//! Object Identifier +class CRYPTOPP_DLL OID +{ +public: + OID() {} + OID(word32 v) : m_values(1, v) {} + OID(BufferedTransformation &bt) {BERDecode(bt);} + + inline OID & operator+=(word32 rhs) {m_values.push_back(rhs); return *this;} + + void DEREncode(BufferedTransformation &bt) const; + void BERDecode(BufferedTransformation &bt); + + // throw BERDecodeErr() if decoded value doesn't equal this OID + void BERDecodeAndCheck(BufferedTransformation &bt) const; + + std::vector m_values; + +private: + static void EncodeValue(BufferedTransformation &bt, word32 v); + static size_t DecodeValue(BufferedTransformation &bt, word32 &v); +}; + +class EncodedObjectFilter : public Filter +{ +public: + enum Flag {PUT_OBJECTS=1, PUT_MESSANGE_END_AFTER_EACH_OBJECT=2, PUT_MESSANGE_END_AFTER_ALL_OBJECTS=4, PUT_MESSANGE_SERIES_END_AFTER_ALL_OBJECTS=8}; + EncodedObjectFilter(BufferedTransformation *attachment = NULL, unsigned int nObjects = 1, word32 flags = 0); + + void Put(const byte *inString, size_t length); + + unsigned int GetNumberOfCompletedObjects() const {return m_nCurrentObject;} + unsigned long GetPositionOfObject(unsigned int i) const {return m_positions[i];} + +private: + BufferedTransformation & CurrentTarget(); + + word32 m_flags; + unsigned int m_nObjects, m_nCurrentObject, m_level; + std::vector m_positions; + ByteQueue m_queue; + enum State {IDENTIFIER, LENGTH, BODY, TAIL, ALL_DONE} m_state; + byte m_id; + lword m_lengthRemaining; +}; + +//! BER General Decoder +class CRYPTOPP_DLL BERGeneralDecoder : public Store +{ +public: + explicit BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag); + explicit BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag); + ~BERGeneralDecoder(); + + bool IsDefiniteLength() const {return m_definiteLength;} + lword RemainingLength() const {assert(m_definiteLength); return m_length;} + bool EndReached() const; + byte PeekByte() const; + void CheckByte(byte b); + + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + + // call this to denote end of sequence + void MessageEnd(); + +protected: + BufferedTransformation &m_inQueue; + bool m_finished, m_definiteLength; + lword m_length; + +private: + void Init(byte asnTag); + void StoreInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters); assert(false);} + lword ReduceLength(lword delta); +}; + +// GCC (and likely other compilers) identify the explicit DERGeneralEncoder as a copy constructor; +// and not a constructor. We had to remove the default asnTag value to point the compiler in the +// proper direction. We did not break the library or versioning based on the output of +// `nm --demangle libcryptopp.a | grep DERGeneralEncoder::DERGeneralEncoder | grep -v " U "`. + +//! DER General Encoder +class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue +{ +public: +#if defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) + explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED); + explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED); +#else + explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/); + explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/); +#endif + ~DERGeneralEncoder(); + + // call this to denote end of sequence + void MessageEnd(); + +private: + BufferedTransformation &m_outQueue; + bool m_finished; + + byte m_asnTag; +}; + +//! BER Sequence Decoder +class CRYPTOPP_DLL BERSequenceDecoder : public BERGeneralDecoder +{ +public: + explicit BERSequenceDecoder(BufferedTransformation &inQueue, byte asnTag = SEQUENCE | CONSTRUCTED) + : BERGeneralDecoder(inQueue, asnTag) {} + explicit BERSequenceDecoder(BERSequenceDecoder &inQueue, byte asnTag = SEQUENCE | CONSTRUCTED) + : BERGeneralDecoder(inQueue, asnTag) {} +}; + +//! DER Sequence Encoder +class CRYPTOPP_DLL DERSequenceEncoder : public DERGeneralEncoder +{ +public: + explicit DERSequenceEncoder(BufferedTransformation &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED) + : DERGeneralEncoder(outQueue, asnTag) {} + explicit DERSequenceEncoder(DERSequenceEncoder &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED) + : DERGeneralEncoder(outQueue, asnTag) {} +}; + +//! BER Set Decoder +class CRYPTOPP_DLL BERSetDecoder : public BERGeneralDecoder +{ +public: + explicit BERSetDecoder(BufferedTransformation &inQueue, byte asnTag = SET | CONSTRUCTED) + : BERGeneralDecoder(inQueue, asnTag) {} + explicit BERSetDecoder(BERSetDecoder &inQueue, byte asnTag = SET | CONSTRUCTED) + : BERGeneralDecoder(inQueue, asnTag) {} +}; + +//! DER Set Encoder +class CRYPTOPP_DLL DERSetEncoder : public DERGeneralEncoder +{ +public: + explicit DERSetEncoder(BufferedTransformation &outQueue, byte asnTag = SET | CONSTRUCTED) + : DERGeneralEncoder(outQueue, asnTag) {} + explicit DERSetEncoder(DERSetEncoder &outQueue, byte asnTag = SET | CONSTRUCTED) + : DERGeneralEncoder(outQueue, asnTag) {} +}; + +template +class ASNOptional : public member_ptr +{ +public: + void BERDecode(BERSequenceDecoder &seqDecoder, byte tag, byte mask = ~CONSTRUCTED) + { + byte b; + if (seqDecoder.Peek(b) && (b & mask) == tag) + reset(new T(seqDecoder)); + } + void DEREncode(BufferedTransformation &out) + { + if (this->get() != NULL) + this->get()->DEREncode(out); + } +}; + +//! _ +template +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ASN1CryptoMaterial : public ASN1Object, public BASE +{ +public: + void Save(BufferedTransformation &bt) const + {BEREncode(bt);} + void Load(BufferedTransformation &bt) + {BERDecode(bt);} +}; + +//! encodes/decodes subjectPublicKeyInfo +class CRYPTOPP_DLL X509PublicKey : public ASN1CryptoMaterial +{ +public: + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + virtual OID GetAlgorithmID() const =0; + virtual bool BERDecodeAlgorithmParameters(BufferedTransformation &bt) + {BERDecodeNull(bt); return false;} + virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const + {DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1 + + //! decode subjectPublicKey part of subjectPublicKeyInfo, without the BIT STRING header + virtual void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size) =0; + //! encode subjectPublicKey part of subjectPublicKeyInfo, without the BIT STRING header + virtual void DEREncodePublicKey(BufferedTransformation &bt) const =0; +}; + +//! encodes/decodes privateKeyInfo +class CRYPTOPP_DLL PKCS8PrivateKey : public ASN1CryptoMaterial +{ +public: + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + virtual OID GetAlgorithmID() const =0; + virtual bool BERDecodeAlgorithmParameters(BufferedTransformation &bt) + {BERDecodeNull(bt); return false;} + virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const + {DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1 + + //! decode privateKey part of privateKeyInfo, without the OCTET STRING header + virtual void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size) =0; + //! encode privateKey part of privateKeyInfo, without the OCTET STRING header + virtual void DEREncodePrivateKey(BufferedTransformation &bt) const =0; + + //! decode optional attributes including context-specific tag + /*! /note default implementation stores attributes to be output in DEREncodeOptionalAttributes */ + virtual void BERDecodeOptionalAttributes(BufferedTransformation &bt); + //! encode optional attributes including context-specific tag + virtual void DEREncodeOptionalAttributes(BufferedTransformation &bt) const; + +protected: + ByteQueue m_optionalAttributes; +}; + +// ******************************************************** + +//! DER Encode Unsigned +/*! for INTEGER, BOOLEAN, and ENUM */ +template +size_t DEREncodeUnsigned(BufferedTransformation &out, T w, byte asnTag = INTEGER) +{ + byte buf[sizeof(w)+1]; + unsigned int bc; + if (asnTag == BOOLEAN) + { + buf[sizeof(w)] = w ? 0xff : 0; + bc = 1; + } + else + { + buf[0] = 0; + for (unsigned int i=0; i> (sizeof(w)-1-i)*8); + bc = sizeof(w); + while (bc > 1 && buf[sizeof(w)+1-bc] == 0) + --bc; + if (buf[sizeof(w)+1-bc] & 0x80) + ++bc; + } + out.Put(asnTag); + size_t lengthBytes = DERLengthEncode(out, bc); + out.Put(buf+sizeof(w)+1-bc, bc); + return 1+lengthBytes+bc; +} + +//! BER Decode Unsigned +template +void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER, + T minValue = 0, T maxValue = ((std::numeric_limits::max)())) +{ + byte b; + if (!in.Get(b) || b != asnTag) + BERDecodeError(); + + size_t bc; + bool definite = BERLengthDecode(in, bc); + if (!definite) + BERDecodeError(); + + SecByteBlock buf(bc); + + if (bc != in.Get(buf, bc)) + BERDecodeError(); + + const byte *ptr = buf; + while (bc > sizeof(w) && *ptr == 0) + { + bc--; + ptr++; + } + if (bc > sizeof(w)) + BERDecodeError(); + + w = 0; + for (unsigned int i=0; i maxValue) + BERDecodeError(); +} + +inline bool operator==(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs) + {return lhs.m_values == rhs.m_values;} +inline bool operator!=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs) + {return lhs.m_values != rhs.m_values;} +inline bool operator<(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs) + {return std::lexicographical_compare(lhs.m_values.begin(), lhs.m_values.end(), rhs.m_values.begin(), rhs.m_values.end());} +inline ::CryptoPP::OID operator+(const ::CryptoPP::OID &lhs, unsigned long rhs) + {return ::CryptoPP::OID(lhs)+=rhs;} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/authenc.cpp b/external/crypto++-5.6.3/authenc.cpp new file mode 100644 index 000000000..f93662efb --- /dev/null +++ b/external/crypto++-5.6.3/authenc.cpp @@ -0,0 +1,180 @@ +// authenc.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "authenc.h" + +NAMESPACE_BEGIN(CryptoPP) + +void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_t len) +{ + unsigned int blockSize = AuthenticationBlockSize(); + unsigned int &num = m_bufferedDataLength; + byte* data = m_buffer.begin(); + + if (num != 0) // process left over data + { + if (num+len >= blockSize) + { + memcpy(data+num, input, blockSize-num); + AuthenticateBlocks(data, blockSize); + input += (blockSize-num); + len -= (blockSize-num); + num = 0; + // drop through and do the rest + } + else + { + memcpy(data+num, input, len); + num += (unsigned int)len; + return; + } + } + + // now process the input data in blocks of blockSize bytes and save the leftovers to m_data + if (len >= blockSize) + { + size_t leftOver = AuthenticateBlocks(input, len); + input += (len - leftOver); + len = leftOver; + } + + memcpy(data, input, len); + num = (unsigned int)len; +} + +void AuthenticatedSymmetricCipherBase::SetKey(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) +{ + m_bufferedDataLength = 0; + m_state = State_Start; + + SetKeyWithoutResync(userKey, keylength, params); + m_state = State_KeySet; + + size_t length; + const byte *iv = GetIVAndThrowIfInvalid(params, length); + if (iv) + Resynchronize(iv, (int)length); +} + +void AuthenticatedSymmetricCipherBase::Resynchronize(const byte *iv, int length) +{ + if (m_state < State_KeySet) + throw BadState(AlgorithmName(), "Resynchronize", "key is set"); + + m_bufferedDataLength = 0; + m_totalHeaderLength = m_totalMessageLength = m_totalFooterLength = 0; + m_state = State_KeySet; + + Resync(iv, this->ThrowIfInvalidIVLength(length)); + m_state = State_IVSet; +} + +void AuthenticatedSymmetricCipherBase::Update(const byte *input, size_t length) +{ + if (length == 0) + return; + + switch (m_state) + { + case State_Start: + case State_KeySet: + throw BadState(AlgorithmName(), "Update", "setting key and IV"); + case State_IVSet: + AuthenticateData(input, length); + m_totalHeaderLength += length; + break; + case State_AuthUntransformed: + case State_AuthTransformed: + AuthenticateLastConfidentialBlock(); + m_bufferedDataLength = 0; + m_state = State_AuthFooter; + // fall through + case State_AuthFooter: + AuthenticateData(input, length); + m_totalFooterLength += length; + break; + default: + assert(false); + } +} + +void AuthenticatedSymmetricCipherBase::ProcessData(byte *outString, const byte *inString, size_t length) +{ + m_totalMessageLength += length; + if (m_state >= State_IVSet && m_totalMessageLength > MaxMessageLength()) + throw InvalidArgument(AlgorithmName() + ": message length exceeds maximum"); + +reswitch: + switch (m_state) + { + case State_Start: + case State_KeySet: + throw BadState(AlgorithmName(), "ProcessData", "setting key and IV"); + case State_AuthFooter: + throw BadState(AlgorithmName(), "ProcessData was called after footer input has started"); + case State_IVSet: + AuthenticateLastHeaderBlock(); + m_bufferedDataLength = 0; + m_state = AuthenticationIsOnPlaintext()==IsForwardTransformation() ? State_AuthUntransformed : State_AuthTransformed; + goto reswitch; + case State_AuthUntransformed: + AuthenticateData(inString, length); + AccessSymmetricCipher().ProcessData(outString, inString, length); + break; + case State_AuthTransformed: + AccessSymmetricCipher().ProcessData(outString, inString, length); + AuthenticateData(outString, length); + break; + default: + assert(false); + } +} + +void AuthenticatedSymmetricCipherBase::TruncatedFinal(byte *mac, size_t macSize) +{ + if (m_totalHeaderLength > MaxHeaderLength()) + throw InvalidArgument(AlgorithmName() + ": header length of " + IntToString(m_totalHeaderLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength())); + + if (m_totalFooterLength > MaxFooterLength()) + { + if (MaxFooterLength() == 0) + throw InvalidArgument(AlgorithmName() + ": additional authenticated data (AAD) cannot be input after data to be encrypted or decrypted"); + else + throw InvalidArgument(AlgorithmName() + ": footer length of " + IntToString(m_totalFooterLength) + " exceeds the maximum of " + IntToString(MaxFooterLength())); + } + + switch (m_state) + { + case State_Start: + case State_KeySet: + throw BadState(AlgorithmName(), "TruncatedFinal", "setting key and IV"); + + case State_IVSet: + AuthenticateLastHeaderBlock(); + m_bufferedDataLength = 0; + // fall through + + case State_AuthUntransformed: + case State_AuthTransformed: + AuthenticateLastConfidentialBlock(); + m_bufferedDataLength = 0; + // fall through + + case State_AuthFooter: + AuthenticateLastFooterBlock(mac, macSize); + m_bufferedDataLength = 0; + break; + + default: + assert(false); + } + + m_state = State_KeySet; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/authenc.h b/external/crypto++-5.6.3/authenc.h new file mode 100644 index 000000000..116892203 --- /dev/null +++ b/external/crypto++-5.6.3/authenc.h @@ -0,0 +1,57 @@ +// authenc.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile authenc.h +//! \brief Base classes for working with authenticated encryption modes of encryption + +#ifndef CRYPTOPP_AUTHENC_H +#define CRYPTOPP_AUTHENC_H + +#include "cryptlib.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class AuthenticatedSymmetricCipherBase +//! \brief +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipherBase : public AuthenticatedSymmetricCipher +{ +public: + AuthenticatedSymmetricCipherBase() : m_state(State_Start), m_bufferedDataLength(0), + m_totalHeaderLength(0), m_totalMessageLength(0), m_totalFooterLength(0) {} + + bool IsRandomAccess() const {return false;} + bool IsSelfInverting() const {return true;} + void UncheckedSetKey(const byte *,unsigned int,const CryptoPP::NameValuePairs &) {assert(false);} + + void SetKey(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); + void Restart() {if (m_state > State_KeySet) m_state = State_KeySet;} + void Resynchronize(const byte *iv, int length=-1); + void Update(const byte *input, size_t length); + void ProcessData(byte *outString, const byte *inString, size_t length); + void TruncatedFinal(byte *mac, size_t macSize); + +protected: + void AuthenticateData(const byte *data, size_t len); + const SymmetricCipher & GetSymmetricCipher() const {return const_cast(this)->AccessSymmetricCipher();}; + + virtual SymmetricCipher & AccessSymmetricCipher() =0; + virtual bool AuthenticationIsOnPlaintext() const =0; + virtual unsigned int AuthenticationBlockSize() const =0; + virtual void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) =0; + virtual void Resync(const byte *iv, size_t len) =0; + virtual size_t AuthenticateBlocks(const byte *data, size_t len) =0; + virtual void AuthenticateLastHeaderBlock() =0; + virtual void AuthenticateLastConfidentialBlock() {} + virtual void AuthenticateLastFooterBlock(byte *mac, size_t macSize) =0; + + enum State {State_Start, State_KeySet, State_IVSet, State_AuthUntransformed, State_AuthTransformed, State_AuthFooter}; + State m_state; + unsigned int m_bufferedDataLength; + lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength; + AlignedSecByteBlock m_buffer; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/base32.cpp b/external/crypto++-5.6.3/base32.cpp new file mode 100644 index 000000000..0568f0729 --- /dev/null +++ b/external/crypto++-5.6.3/base32.cpp @@ -0,0 +1,39 @@ +// base32.cpp - written and placed in the public domain by Frank Palazzolo, based on hex.cpp by Wei Dai + +#include "pch.h" +#include "base32.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const byte s_vecUpper[] = "ABCDEFGHIJKMNPQRSTUVWXYZ23456789"; +static const byte s_vecLower[] = "abcdefghijkmnpqrstuvwxyz23456789"; + +void Base32Encoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true); + m_filter->Initialize(CombinedNameValuePairs( + parameters, + MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 5, true))); +} + +void Base32Decoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + BaseN_Decoder::Initialize(CombinedNameValuePairs( + parameters, + MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 5, true))); +} + +const int *Base32Decoder::GetDefaultDecodingLookupArray() +{ + static volatile bool s_initialized = false; + static int s_array[256]; + + if (!s_initialized) + { + InitializeDecodingLookupArray(s_array, s_vecUpper, 32, true); + s_initialized = true; + } + return s_array; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/base32.h b/external/crypto++-5.6.3/base32.h new file mode 100644 index 000000000..dc7d384ca --- /dev/null +++ b/external/crypto++-5.6.3/base32.h @@ -0,0 +1,70 @@ +// base32.h - written and placed in the public domain by Wei Dai + +//! \file +//! \brief Classes for Base32Encoder and Base32Decoder + +#ifndef CRYPTOPP_BASE32_H +#define CRYPTOPP_BASE32_H + +#include "cryptlib.h" +#include "basecode.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class Base32Encoder +//! \brief Base32 encodes data +//! \details Converts data to base32. The default code is based on draft-ietf-idn-dude-02.txt. +//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. +class Base32Encoder : public SimpleProxyFilter +{ +public: + //! \brief Construct a Base32Encoder + //! \param attachment a BufferedTrasformation to attach to this object + //! \param uppercase a flag indicating uppercase output + //! \param groupSize the size of the grouping + //! \param separator the separator to use between groups + //! \param terminator the terminator appeand after processing + //! \details Base32Encoder() constructs a default encoder. The constructor lacks fields for padding and + //! line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it. + //! \sa IsolatedInitialize() for an example of modifying a Base32Encoder after construction. + Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "") + : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) + { + IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator))); + } + + //! \brief Initialize or reinitialize this object, without signal propagation + //! \param parameters a set of NameValuePairs used to initialize this object + //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable + //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached + //! transformations. If initialization should be propagated, then use the Initialize() function. + //! \details The following code modifies the padding and line break parameters for an encoder: + //!
+	//!     Base32Encoder encoder;
+	//!     AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
+	//!     encoder.IsolatedInitialize(params);
+	//!   
+ void IsolatedInitialize(const NameValuePairs ¶meters); +}; + +//! \class Base32Decoder +//! \brief Base32 decodes data +//! \details Decode base32 data. The default code is based on draft-ietf-idn-dude-02.txt +//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. +class Base32Decoder : public BaseN_Decoder +{ +public: + //! \brief Construct a Base32Decoder + //! \param attachment a BufferedTrasformation to attach to this object + Base32Decoder(BufferedTransformation *attachment = NULL) + : BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {} + + void IsolatedInitialize(const NameValuePairs ¶meters); + +private: + static const int * CRYPTOPP_API GetDefaultDecodingLookupArray(); +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/base64.cpp b/external/crypto++-5.6.3/base64.cpp new file mode 100644 index 000000000..49c11f910 --- /dev/null +++ b/external/crypto++-5.6.3/base64.cpp @@ -0,0 +1,76 @@ +// base64.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "base64.h" + +NAMESPACE_BEGIN(CryptoPP) + +// Base64 +static const byte s_stdVec[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +// Base64URL +static const byte s_urlVec[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; +static const byte s_padding = '='; + +void Base64Encoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + bool insertLineBreaks = parameters.GetValueWithDefault(Name::InsertLineBreaks(), true); + int maxLineLength = parameters.GetIntValueWithDefault(Name::MaxLineLength(), 72); + + const char *lineBreak = insertLineBreaks ? "\n" : ""; + + m_filter->Initialize(CombinedNameValuePairs( + parameters, + MakeParameters(Name::EncodingLookupArray(), &s_stdVec[0], false) + (Name::PaddingByte(), s_padding) + (Name::GroupSize(), insertLineBreaks ? maxLineLength : 0) + (Name::Separator(), ConstByteArrayParameter(lineBreak)) + (Name::Terminator(), ConstByteArrayParameter(lineBreak)) + (Name::Log2Base(), 6, true))); +} + +void Base64URLEncoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + bool insertLineBreaks = parameters.GetValueWithDefault(Name::InsertLineBreaks(), true); + int maxLineLength = parameters.GetIntValueWithDefault(Name::MaxLineLength(), 72); + + const char *lineBreak = insertLineBreaks ? "\n" : ""; + + m_filter->Initialize(CombinedNameValuePairs( + parameters, + MakeParameters(Name::EncodingLookupArray(), &s_urlVec[0], false) + (Name::PaddingByte(), s_padding) + (Name::GroupSize(), insertLineBreaks ? maxLineLength : 0) + (Name::Separator(), ConstByteArrayParameter(lineBreak)) + (Name::Terminator(), ConstByteArrayParameter(lineBreak)) + (Name::Log2Base(), 6, true))); +} + +const int *Base64Decoder::GetDecodingLookupArray() +{ + static volatile bool s_initialized = false; + static int s_array[256]; + + if (!s_initialized) + { + InitializeDecodingLookupArray(s_array, s_stdVec, 64, false); + s_initialized = true; + } + return s_array; +} + +const int *Base64URLDecoder::GetDecodingLookupArray() +{ + static volatile bool s_initialized = false; + static int s_array[256]; + + if (!s_initialized) + { + InitializeDecodingLookupArray(s_array, s_urlVec, 64, false); + s_initialized = true; + } + return s_array; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/base64.h b/external/crypto++-5.6.3/base64.h new file mode 100644 index 000000000..8376353e8 --- /dev/null +++ b/external/crypto++-5.6.3/base64.h @@ -0,0 +1,135 @@ +// base64.h - written and placed in the public domain by Wei Dai + +//! \file base64.h +//! \brief Classes for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder + +#ifndef CRYPTOPP_BASE64_H +#define CRYPTOPP_BASE64_H + +#include "cryptlib.h" +#include "basecode.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class Base64Encoder +//! \brief Base64 encodes data +//! \details Base64 encodes data per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-4) +//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. +class Base64Encoder : public SimpleProxyFilter +{ +public: + //! \brief Construct a Base64Encoder + //! \param attachment a BufferedTrasformation to attach to this object + //! \param insertLineBreaks a BufferedTrasformation to attach to this object + //! \param maxLineLength the lenght of a line if line breaks are used + //! \details Base64Encoder() constructs a default encoder. The constructor lacks parameters for padding. + //! You must use IsolatedInitialize() to modify the Base64Encoder after construction. + //! \sa IsolatedInitialize() for an example of modifying a Base64Encoder after construction. + Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72) + : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) + { + IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength)); + } + + //! \brief Initialize or reinitialize this object, without signal propagation + //! \param parameters a set of NameValuePairs used to initialize this object + //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable + //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached + //! transformations. If initialization should be propagated, then use the Initialize() function. + //! \details The following code modifies the padding and line break parameters for an encoder: + //!
+	//!     Base64Encoder encoder;
+	//!     AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
+	//!     encoder.IsolatedInitialize(params);
+	//!   
+ void IsolatedInitialize(const NameValuePairs ¶meters); +}; + +//! \class Base64Decoder +//! \brief Base64 decodes data +//! \details Base64 decodes data per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-4) +//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. +class Base64Decoder : public BaseN_Decoder +{ +public: + //! \brief Construct a Base64Decoder + //! \param attachment a BufferedTrasformation to attach to this object + Base64Decoder(BufferedTransformation *attachment = NULL) + : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {} + + //! \brief Initialize or reinitialize this object, without signal propagation + //! \param parameters a set of NameValuePairs used to initialize this object + //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable + //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on + //! attached transformations. If initialization should be propagated, then use the Initialize() function. + void IsolatedInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters);} + +private: + static const int * CRYPTOPP_API GetDecodingLookupArray(); +}; + +//! \class Base64URLEncoder +//! \brief Base64 encodes data using a web safe alphabet +//! \details Base64 encodes data using a web safe alphabet per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-5) +//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. +class Base64URLEncoder : public SimpleProxyFilter +{ +public: + //! \brief Construct a Base64URLEncoder + //! \param attachment a BufferedTrasformation to attach to this object + //! \param insertLineBreaks a BufferedTrasformation to attach to this object + //! \param maxLineLength the lenght of a line if line breaks are used + //! \details Base64URLEncoder() constructs a default encoder. The constructor ignores insertLineBreaks + //! and maxLineLength because the web and URL safe specifications don't use them. They are present + //! in the constructor for API compatibility with Base64Encoder (drop-in replacement). The + //! constructor also disables padding on the encoder for the same reason. + //! \details If you need line breaks or padding, then you must use IsolatedInitialize() to set them + //! after constructing a Base64URLEncoder. + //! \sa IsolatedInitialize() for an example of modifying a Base64URLEncoder after construction. + Base64URLEncoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = false, int maxLineLength = -1) + : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) + { + CRYPTOPP_UNUSED(insertLineBreaks), CRYPTOPP_UNUSED(maxLineLength); + IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false)); + } + + //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable + //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached + //! transformations. If initialization should be propagated, then use the Initialize() function. + //! \details The following code modifies the padding and line break parameters for an encoder: + //!
+	//!     Base64URLEncoder encoder;
+	//!     AlgorithmParameters params = MakeParameters(Name::Pad(), true)(Name::InsertLineBreaks(), true);
+	//!     encoder.IsolatedInitialize(params);
+	//!   
+ void IsolatedInitialize(const NameValuePairs ¶meters); +}; + +//! \class Base64URLDecoder +//! \brief Base64 decodes data using a web safe alphabet +//! \details Base64 decodes data using a web safe alphabet per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-5) +//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. +class Base64URLDecoder : public BaseN_Decoder +{ +public: + //! \brief Construct a Base64URLDecoder + //! \param attachment a BufferedTrasformation to attach to this object + Base64URLDecoder(BufferedTransformation *attachment = NULL) + : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {} + + //! \brief Initialize or reinitialize this object, without signal propagation + //! \param parameters a set of NameValuePairs used to initialize this object + //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable + //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on + //! attached transformations. If initialization should be propagated, then use the Initialize() function. + void IsolatedInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters);} + +private: + static const int * CRYPTOPP_API GetDecodingLookupArray(); +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/basecode.cpp b/external/crypto++-5.6.3/basecode.cpp new file mode 100644 index 000000000..14c4ef014 --- /dev/null +++ b/external/crypto++-5.6.3/basecode.cpp @@ -0,0 +1,247 @@ +// basecode.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunused-value" +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "basecode.h" +#include "fltrimpl.h" +#include + +NAMESPACE_BEGIN(CryptoPP) + +void BaseN_Encoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + parameters.GetRequiredParameter("BaseN_Encoder", Name::EncodingLookupArray(), m_alphabet); + + parameters.GetRequiredIntParameter("BaseN_Encoder", Name::Log2Base(), m_bitsPerChar); + if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8) + throw InvalidArgument("BaseN_Encoder: Log2Base must be between 1 and 7 inclusive"); + + byte padding; + bool pad; + if (parameters.GetValue(Name::PaddingByte(), padding)) + pad = parameters.GetValueWithDefault(Name::Pad(), true); + else + pad = false; + m_padding = pad ? padding : -1; + + m_bytePos = m_bitPos = 0; + + int i = 8; + while (i%m_bitsPerChar != 0) + i += 8; + m_outputBlockSize = i/m_bitsPerChar; + + m_outBuf.New(m_outputBlockSize); +} + +size_t BaseN_Encoder::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + FILTER_BEGIN; + while (m_inputPosition < length) + { + if (m_bytePos == 0) + memset(m_outBuf, 0, m_outputBlockSize); + + { + unsigned int b = begin[m_inputPosition++], bitsLeftInSource = 8; + while (true) + { + assert(m_bitPos < m_bitsPerChar); + unsigned int bitsLeftInTarget = m_bitsPerChar-m_bitPos; + m_outBuf[m_bytePos] |= b >> (8-bitsLeftInTarget); + if (bitsLeftInSource >= bitsLeftInTarget) + { + m_bitPos = 0; + ++m_bytePos; + bitsLeftInSource -= bitsLeftInTarget; + if (bitsLeftInSource == 0) + break; + b <<= bitsLeftInTarget; + b &= 0xff; + } + else + { + m_bitPos += bitsLeftInSource; + break; + } + } + } + + assert(m_bytePos <= m_outputBlockSize); + if (m_bytePos == m_outputBlockSize) + { + int i; + for (i=0; i 0) + ++m_bytePos; + + int i; + for (i=0; i 0) + { + memset(m_outBuf+m_bytePos, m_padding, m_outputBlockSize-m_bytePos); + m_bytePos = m_outputBlockSize; + } + FILTER_OUTPUT(2, m_outBuf, m_bytePos, messageEnd); + m_bytePos = m_bitPos = 0; + } + FILTER_END_NO_MESSAGE_END; +} + +void BaseN_Decoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + parameters.GetRequiredParameter("BaseN_Decoder", Name::DecodingLookupArray(), m_lookup); + + parameters.GetRequiredIntParameter("BaseN_Decoder", Name::Log2Base(), m_bitsPerChar); + if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8) + throw InvalidArgument("BaseN_Decoder: Log2Base must be between 1 and 7 inclusive"); + + m_bytePos = m_bitPos = 0; + + int i = m_bitsPerChar; + while (i%8 != 0) + i += m_bitsPerChar; + m_outputBlockSize = i/8; + + m_outBuf.New(m_outputBlockSize); +} + +size_t BaseN_Decoder::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + FILTER_BEGIN; + while (m_inputPosition < length) + { + unsigned int value; + value = m_lookup[begin[m_inputPosition++]]; + if (value >= 256) + continue; + + if (m_bytePos == 0 && m_bitPos == 0) + memset(m_outBuf, 0, m_outputBlockSize); + + { + int newBitPos = m_bitPos + m_bitsPerChar; + if (newBitPos <= 8) + m_outBuf[m_bytePos] |= value << (8-newBitPos); + else + { + m_outBuf[m_bytePos] |= value >> (newBitPos-8); + m_outBuf[m_bytePos+1] |= value << (16-newBitPos); + } + + m_bitPos = newBitPos; + while (m_bitPos >= 8) + { + m_bitPos -= 8; + ++m_bytePos; + } + } + + if (m_bytePos == m_outputBlockSize) + { + FILTER_OUTPUT(1, m_outBuf, m_outputBlockSize, 0); + m_bytePos = m_bitPos = 0; + } + } + if (messageEnd) + { + FILTER_OUTPUT(2, m_outBuf, m_bytePos, messageEnd); + m_bytePos = m_bitPos = 0; + } + FILTER_END_NO_MESSAGE_END; +} + +void BaseN_Decoder::InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive) +{ + std::fill(lookup, lookup+256, -1); + + for (unsigned int i=0; i +{ +public: + //! \brief Construct a BaseN_Encoder + //! \param attachment a BufferedTransformation to attach to this object + BaseN_Encoder(BufferedTransformation *attachment=NULL) + : m_alphabet(NULL), m_padding(0), m_bitsPerChar(0) + , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) + {Detach(attachment);} + + //! \brief Construct a BaseN_Encoder + //! \param alphabet table of ASCII characters to use as the alphabet + //! \param log2base the log2base + //! \param attachment a BufferedTransformation to attach to this object + //! \param padding the character to use as padding + //! \pre log2base must be between 1 and 7 inclusive + //! \throws InvalidArgument if log2base is not between 1 and 7 + BaseN_Encoder(const byte *alphabet, int log2base, BufferedTransformation *attachment=NULL, int padding=-1) + : m_alphabet(NULL), m_padding(0), m_bitsPerChar(0) + , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) + { + Detach(attachment); + IsolatedInitialize(MakeParameters(Name::EncodingLookupArray(), alphabet) + (Name::Log2Base(), log2base) + (Name::Pad(), padding != -1) + (Name::PaddingByte(), byte(padding))); + } + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); + +private: + const byte *m_alphabet; + int m_padding, m_bitsPerChar, m_outputBlockSize; + int m_bytePos, m_bitPos; + SecByteBlock m_outBuf; +}; + +//! \class BaseN_Decoder +//! \brief Decoder for bases that are a power of 2 +class CRYPTOPP_DLL BaseN_Decoder : public Unflushable +{ +public: + //! \brief Construct a BaseN_Decoder + //! \param attachment a BufferedTransformation to attach to this object + //! \details padding is set to -1, which means use default padding. If not + //! required, then the value must be set via IsolatedInitialize(). + BaseN_Decoder(BufferedTransformation *attachment=NULL) + : m_lookup(0), m_padding(0), m_bitsPerChar(0) + , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) + {Detach(attachment);} + + //! \brief Construct a BaseN_Decoder + //! \param lookup table of values + //! \param log2base the log2base + //! \param attachment a BufferedTransformation to attach to this object + //! \details log2base is the exponent (like 5 in 25), and not + //! the number of elements (like 32). + //! \details padding is set to -1, which means use default padding. If not + //! required, then the value must be set via IsolatedInitialize(). + BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULL) + : m_lookup(0), m_padding(0), m_bitsPerChar(0) + , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) + { + Detach(attachment); + IsolatedInitialize(MakeParameters(Name::DecodingLookupArray(), lookup)(Name::Log2Base(), log2base)); + } + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); + + //! \brief Intializes BaseN lookup array + //! \param lookup table of values + //! \param alphabet table of ASCII characters + //! \param base the base for the encoder + //! \param caseInsensitive flag indicating whether the alpabet is case sensitivie + //! \pre COUNTOF(lookup) == 256 + //! \pre COUNTOF(alphabet) == base + //! \details Internally, the function sets the first 256 elements in the lookup table to + // their value from the alphabet array or -1. base is the number of element (like 32), + //! and not an exponent (like 5 in 25) + static void CRYPTOPP_API InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive); + +private: + const int *m_lookup; + int m_padding, m_bitsPerChar, m_outputBlockSize; + int m_bytePos, m_bitPos; + SecByteBlock m_outBuf; +}; + +//! \class Grouper +//! \brief Filter that breaks input stream into groups of fixed size +class CRYPTOPP_DLL Grouper : public Bufferless +{ +public: + //! \brief Construct a Grouper + //! \param attachment a BufferedTransformation to attach to this object + Grouper(BufferedTransformation *attachment=NULL) + : m_groupSize(0), m_counter(0) {Detach(attachment);} + + //! \brief Construct a Grouper + //! \param groupSize the size of the grouping + //! \param separator the separator to use between groups + //! \param terminator the terminator appeand after processing + //! \param attachment a BufferedTransformation to attach to this object + Grouper(int groupSize, const std::string &separator, const std::string &terminator, BufferedTransformation *attachment=NULL) + : m_groupSize(0), m_counter(0) + { + Detach(attachment); + IsolatedInitialize(MakeParameters(Name::GroupSize(), groupSize) + (Name::Separator(), ConstByteArrayParameter(separator)) + (Name::Terminator(), ConstByteArrayParameter(terminator))); + } + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); + +private: + SecByteBlock m_separator, m_terminator; + size_t m_groupSize, m_counter; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/bench.cpp b/external/crypto++-5.6.3/bench.cpp new file mode 100644 index 000000000..c038f3213 --- /dev/null +++ b/external/crypto++-5.6.3/bench.cpp @@ -0,0 +1,399 @@ +// bench.cpp - written and placed in the public domain by Wei Dai + +#include "cryptlib.h" +#include "bench.h" +#include "validate.h" + +#include "aes.h" +#include "blumshub.h" +#include "files.h" +#include "filters.h" +#include "hex.h" +#include "modes.h" +#include "factory.h" +#include "smartptr.h" +#include "cpu.h" + +#include +#include +#include +#include +#include + +// These are noisy enoguh due to test.cpp. Turn them off here. +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +#ifdef CLOCKS_PER_SEC +const double CLOCK_TICKS_PER_SECOND = (double)CLOCKS_PER_SEC; +#elif defined(CLK_TCK) +const double CLOCK_TICKS_PER_SECOND = (double)CLK_TCK; +#else +const double CLOCK_TICKS_PER_SECOND = 1000000.0; +#endif + +double logtotal = 0.0, g_allocatedTime = 0, g_hertz = 0; +unsigned int logcount = 0; + +static const byte defaultKey[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + +void OutputResultBytes(const char *name, double length, double timeTaken) +{ + // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) + std::ostringstream out; + out.copyfmt(cout); + + // Coverity finding + if (length < 0.0000000001f) length = 0.000001f; + if (timeTaken < 0.0000000001f) timeTaken = 0.000001f; + + double mbs = length / timeTaken / (1024*1024); + out << "\n" << name; +// out << "" << setprecision(3) << length / (1024*1024); + out << setiosflags(ios::fixed); +// out << "" << setprecision(3) << timeTaken; + out << "" << setprecision(0) << setiosflags(ios::fixed) << mbs; + if (g_hertz) + out << "" << setprecision(1) << setiosflags(ios::fixed) << timeTaken * g_hertz / length; + logtotal += log(mbs); + logcount++; + + cout << out.str(); +} + +void OutputResultKeying(double iterations, double timeTaken) +{ + // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) + std::ostringstream out; + out.copyfmt(cout); + + // Coverity finding + if (iterations < 0.0000000001f) iterations = 0.000001f; + if (timeTaken < 0.0000000001f) timeTaken = 0.000001f; + + out << "" << setprecision(3) << setiosflags(ios::fixed) << (1000*1000*timeTaken/iterations); + if (g_hertz) + out << "" << setprecision(0) << setiosflags(ios::fixed) << timeTaken * g_hertz / iterations; + + cout << out.str(); +} + +void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken) +{ + // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) + std::ostringstream out; + out.copyfmt(cout); + + // Coverity finding + if (!iterations) iterations++; + if (timeTaken < 0.0000000001f) timeTaken = 0.000001f; + + out << "\n" << name << " " << operation << (pc ? " with precomputation" : ""); + out << "" << setprecision(2) << setiosflags(ios::fixed) << (1000*timeTaken/iterations); + if (g_hertz) + out << "" << setprecision(2) << setiosflags(ios::fixed) << timeTaken * g_hertz / iterations / 1000000; + + logtotal += log(iterations/timeTaken); + logcount++; + + cout << out.str(); +} + +/* +void BenchMark(const char *name, BlockTransformation &cipher, double timeTotal) +{ + const int BUF_SIZE = RoundUpToMultipleOf(2048U, cipher.OptimalNumberOfParallelBlocks() * cipher.BlockSize()); + AlignedSecByteBlock buf(BUF_SIZE); + const int nBlocks = BUF_SIZE / cipher.BlockSize(); + clock_t start = clock(); + + unsigned long i=0, blocks=1; + double timeTaken; + do + { + blocks *= 2; + for (; i(cipher), timeTotal); +} + +void BenchMark(const char *name, HashTransformation &ht, double timeTotal) +{ + const int BUF_SIZE=2048U; + AlignedSecByteBlock buf(BUF_SIZE); + GlobalRNG().GenerateBlock(buf, BUF_SIZE); + clock_t start = clock(); + + unsigned long i=0, blocks=1; + double timeTaken; + do + { + blocks *= 2; + for (; i +void BenchMarkByName2(const char *factoryName, size_t keyLength = 0, const char *displayName=NULL, const NameValuePairs ¶ms = g_nullNameValuePairs, T_FactoryOutput *x=NULL, T_Interface *y=NULL) +{ + CRYPTOPP_UNUSED(x), CRYPTOPP_UNUSED(y), CRYPTOPP_UNUSED(params); + + std::string name(factoryName ? factoryName : ""); + member_ptr obj(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + + if (!keyLength) + keyLength = obj->DefaultKeyLength(); + + if (displayName) + name = displayName; + else if (keyLength) + name += " (" + IntToString(keyLength * 8) + "-bit key)"; + + obj->SetKey(defaultKey, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false))); + BenchMark(name.c_str(), *static_cast(obj.get()), g_allocatedTime); + BenchMarkKeying(*obj, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false))); +} + +//VC60 workaround: compiler bug triggered without the extra dummy parameters +template +void BenchMarkByName(const char *factoryName, size_t keyLength = 0, const char *displayName=NULL, const NameValuePairs ¶ms = g_nullNameValuePairs, T_FactoryOutput *x=NULL) +{ + CRYPTOPP_UNUSED(x), CRYPTOPP_UNUSED(params); + + BenchMarkByName2(factoryName, keyLength, displayName, params, x, x); +} + +template +void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NULL, const NameValuePairs ¶ms = g_nullNameValuePairs, T *x=NULL) +{ + CRYPTOPP_UNUSED(x), CRYPTOPP_UNUSED(params); + + std::string name = factoryName; + if (displayName) + name = displayName; + + member_ptr obj(ObjectFactoryRegistry::Registry().CreateObject(factoryName)); + BenchMark(name.c_str(), *obj, g_allocatedTime); +} + +void BenchmarkAll(double t, double hertz) +{ +#if 1 + logtotal = 0; + logcount = 0; + g_allocatedTime = t; + g_hertz = hertz; + + const char *cpb, *cpk; + if (g_hertz) + { + cpb = "Cycles Per Byte"; + cpk = "Cycles to
Setup Key and IV"; + cout << "CPU frequency of the test platform is " << g_hertz << " Hz.\n"; + } + else + { + cpb = cpk = ""; + cout << "CPU frequency of the test platform was not provided.\n"; + } + + cout << "" << endl; + cout << ""; +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasCLMUL()) + BenchMarkByName2("AES/GCM", 0, "AES/GCM"); + else +#endif + { + BenchMarkByName2("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048)); + BenchMarkByName2("AES/GCM", 0, "AES/GCM (64K tables)", MakeParameters(Name::TableSize(), 64*1024)); + } + BenchMarkByName2("AES/CCM"); + BenchMarkByName2("AES/EAX"); + + cout << "\n"; +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasCLMUL()) + BenchMarkByName2("AES/GCM", 0, "GMAC(AES)"); + else +#endif + { + BenchMarkByName2("AES/GCM", 0, "GMAC(AES) (2K tables)", MakeParameters(Name::TableSize(), 2048)); + BenchMarkByName2("AES/GCM", 0, "GMAC(AES) (64K tables)", MakeParameters(Name::TableSize(), 64*1024)); + } + BenchMarkByName("VMAC(AES)-64"); + BenchMarkByName("VMAC(AES)-128"); + BenchMarkByName("HMAC(SHA-1)"); + BenchMarkByName("Two-Track-MAC"); + BenchMarkByName("CMAC(AES)"); + BenchMarkByName("DMAC(AES)"); + + cout << "\n"; + BenchMarkByNameKeyLess("CRC32"); + BenchMarkByNameKeyLess("Adler32"); + BenchMarkByNameKeyLess("MD5"); + BenchMarkByNameKeyLess("SHA-1"); + BenchMarkByNameKeyLess("SHA-256"); + BenchMarkByNameKeyLess("SHA-512"); + BenchMarkByNameKeyLess("SHA-3-224"); + BenchMarkByNameKeyLess("SHA-3-256"); + BenchMarkByNameKeyLess("SHA-3-384"); + BenchMarkByNameKeyLess("SHA-3-512"); + BenchMarkByNameKeyLess("Tiger"); + BenchMarkByNameKeyLess("Whirlpool"); + BenchMarkByNameKeyLess("RIPEMD-160"); + BenchMarkByNameKeyLess("RIPEMD-320"); + BenchMarkByNameKeyLess("RIPEMD-128"); + BenchMarkByNameKeyLess("RIPEMD-256"); + + cout << "\n"; + BenchMarkByName("Panama-LE"); + BenchMarkByName("Panama-BE"); + BenchMarkByName("Salsa20"); + BenchMarkByName("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12)); + BenchMarkByName("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8)); + BenchMarkByName("Sosemanuk"); + BenchMarkByName("MARC4"); + BenchMarkByName("SEAL-3.0-LE"); + BenchMarkByName("WAKE-OFB-LE"); + + cout << "\n"; + BenchMarkByName("AES/CTR", 16); + BenchMarkByName("AES/CTR", 24); + BenchMarkByName("AES/CTR", 32); + BenchMarkByName("AES/CBC", 16); + BenchMarkByName("AES/CBC", 24); + BenchMarkByName("AES/CBC", 32); + BenchMarkByName("AES/OFB", 16); + BenchMarkByName("AES/CFB", 16); + BenchMarkByName("AES/ECB", 16); + BenchMarkByName("Camellia/CTR", 16); + BenchMarkByName("Camellia/CTR", 32); + BenchMarkByName("Twofish/CTR"); + BenchMarkByName("Serpent/CTR"); + BenchMarkByName("CAST-256/CTR"); + BenchMarkByName("RC6/CTR"); + BenchMarkByName("MARS/CTR"); + BenchMarkByName("SHACAL-2/CTR", 16); + BenchMarkByName("SHACAL-2/CTR", 64); + BenchMarkByName("DES/CTR"); + BenchMarkByName("DES-XEX3/CTR"); + BenchMarkByName("DES-EDE3/CTR"); + BenchMarkByName("IDEA/CTR"); + BenchMarkByName("RC5/CTR", 0, "RC5 (r=16)"); + BenchMarkByName("Blowfish/CTR"); + BenchMarkByName("TEA/CTR"); + BenchMarkByName("XTEA/CTR"); + BenchMarkByName("CAST-128/CTR"); + BenchMarkByName("SKIPJACK/CTR"); + BenchMarkByName("SEED/CTR", 0, "SEED/CTR (1/2 K table)"); + cout << "
AlgorithmMiB/Second" << cpb << "Microseconds to
Setup Key and IV" << cpk << endl; + + cout << "\n
" << endl; + + BenchmarkAll2(t, hertz); + cout << "Throughput Geometric Average: " << setiosflags(ios::fixed) << exp(logtotal/(logcount ? logcount : 1)) << endl; + +// Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55 +#if (CRYPTOPP_MSC_VERSION >= 1400) + tm localTime = {}; + char timeBuf[64]; + errno_t err; + + const time_t endTime = time(NULL); + err = localtime_s(&localTime, &endTime); + assert(err == 0); + err = asctime_s(timeBuf, sizeof(timeBuf), &localTime); + assert(err == 0); + + cout << "\nTest ended at " << timeBuf; +#else + const time_t endTime = time(NULL); + cout << "\nTest ended at " << asctime(localtime(&endTime)); +#endif +#endif +} diff --git a/external/crypto++-5.6.3/bench.h b/external/crypto++-5.6.3/bench.h new file mode 100644 index 000000000..5dfb6d4b3 --- /dev/null +++ b/external/crypto++-5.6.3/bench.h @@ -0,0 +1,13 @@ +// bench.h - written and placed in the public domain by Wei Dai + +#ifndef CRYPTOPP_BENCH_H +#define CRYPTOPP_BENCH_H + +#include "cryptlib.h" + +extern const double CLOCK_TICKS_PER_SECOND; + +void BenchmarkAll(double t, double hertz); +void BenchmarkAll2(double t, double hertz); + +#endif diff --git a/external/crypto++-5.6.3/bench2.cpp b/external/crypto++-5.6.3/bench2.cpp new file mode 100644 index 000000000..b40d42ff6 --- /dev/null +++ b/external/crypto++-5.6.3/bench2.cpp @@ -0,0 +1,337 @@ +// bench2.cpp - written and placed in the public domain by Wei Dai + +#include "cryptlib.h" +#include "pubkey.h" +#include "gfpcrypt.h" +#include "eccrypto.h" +#include "bench.h" +#include "validate.h" + +#include "files.h" +#include "filters.h" +#include "hex.h" +#include "rsa.h" +#include "nr.h" +#include "dsa.h" +#include "luc.h" +#include "rw.h" +#include "eccrypto.h" +#include "ecp.h" +#include "ec2n.h" +#include "asn.h" +#include "dh.h" +#include "mqv.h" +#include "xtrcrypt.h" +#include "esign.h" +#include "pssr.h" +#include "oids.h" +#include "randpool.h" + +#include +#include +#include +#include + +// These are noisy enoguh due to test.cpp. Turn them off here. +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken); + +void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc=false) +{ + unsigned int len = 16; + SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len)); + GlobalRNG().GenerateBlock(plaintext, len); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) + key.Encrypt(GlobalRNG(), plaintext, len, ciphertext); + + OutputResultOperations(name, "Encryption", pc, i, timeTaken); + + if (!pc && key.GetMaterial().SupportsPrecomputation()) + { + key.AccessMaterial().Precompute(16); + BenchMarkEncryption(name, key, timeTotal, true); + } +} + +void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal) +{ + unsigned int len = 16; + SecByteBlock ciphertext(pub.CiphertextLength(len)); + SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size())); + GlobalRNG().GenerateBlock(plaintext, len); + pub.Encrypt(GlobalRNG(), plaintext, len, ciphertext); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) + priv.Decrypt(GlobalRNG(), ciphertext, ciphertext.size(), plaintext); + + OutputResultOperations(name, "Decryption", false, i, timeTaken); +} + +void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false) +{ + unsigned int len = 16; + AlignedSecByteBlock message(len), signature(key.SignatureLength()); + GlobalRNG().GenerateBlock(message, len); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) + key.SignMessage(GlobalRNG(), message, len, signature); + + OutputResultOperations(name, "Signature", pc, i, timeTaken); + + if (!pc && key.GetMaterial().SupportsPrecomputation()) + { + key.AccessMaterial().Precompute(16); + BenchMarkSigning(name, key, timeTotal, true); + } +} + +void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false) +{ + unsigned int len = 16; + AlignedSecByteBlock message(len), signature(pub.SignatureLength()); + GlobalRNG().GenerateBlock(message, len); + priv.SignMessage(GlobalRNG(), message, len, signature); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) + { + // The return value is ignored because we are interested in throughput + bool unused = pub.VerifyMessage(message, len, signature, signature.size()); + CRYPTOPP_UNUSED(unused); + } + + OutputResultOperations(name, "Verification", pc, i, timeTaken); + + if (!pc && pub.GetMaterial().SupportsPrecomputation()) + { + pub.AccessMaterial().Precompute(16); + BenchMarkVerification(name, priv, pub, timeTotal, true); + } +} + +void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false) +{ + SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength()); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) + d.GenerateKeyPair(GlobalRNG(), priv, pub); + + OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken); + + if (!pc && d.GetMaterial().SupportsPrecomputation()) + { + d.AccessMaterial().Precompute(16); + BenchMarkKeyGen(name, d, timeTotal, true); + } +} + +void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false) +{ + SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength()); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) + d.GenerateEphemeralKeyPair(GlobalRNG(), priv, pub); + + OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken); + + if (!pc && d.GetMaterial().SupportsPrecomputation()) + { + d.AccessMaterial().Precompute(16); + BenchMarkKeyGen(name, d, timeTotal, true); + } +} + +void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false) +{ + SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength()); + SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength()); + d.GenerateKeyPair(GlobalRNG(), priv1, pub1); + d.GenerateKeyPair(GlobalRNG(), priv2, pub2); + SecByteBlock val(d.AgreedValueLength()); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2) + { + d.Agree(val, priv1, pub2); + d.Agree(val, priv2, pub1); + } + + OutputResultOperations(name, "Key Agreement", pc, i, timeTaken); +} + +void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false) +{ + SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength()); + SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength()); + SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength()); + SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength()); + d.GenerateStaticKeyPair(GlobalRNG(), spriv1, spub1); + d.GenerateStaticKeyPair(GlobalRNG(), spriv2, spub2); + d.GenerateEphemeralKeyPair(GlobalRNG(), epriv1, epub1); + d.GenerateEphemeralKeyPair(GlobalRNG(), epriv2, epub2); + SecByteBlock val(d.AgreedValueLength()); + + const clock_t start = clock(); + unsigned int i; + double timeTaken; + for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2) + { + d.Agree(val, spriv1, epriv1, spub2, epub2); + d.Agree(val, spriv2, epriv2, spub1, epub1); + } + + OutputResultOperations(name, "Key Agreement", pc, i, timeTaken); +} + +//VC60 workaround: compiler bug triggered without the extra dummy parameters +template +void BenchMarkCrypto(const char *filename, const char *name, double timeTotal, SCHEME *x=NULL) +{ + CRYPTOPP_UNUSED(x); + + FileSource f(filename, true, new HexDecoder()); + typename SCHEME::Decryptor priv(f); + typename SCHEME::Encryptor pub(priv); + BenchMarkEncryption(name, pub, timeTotal); + BenchMarkDecryption(name, priv, pub, timeTotal); +} + +//VC60 workaround: compiler bug triggered without the extra dummy parameters +template +void BenchMarkSignature(const char *filename, const char *name, double timeTotal, SCHEME *x=NULL) +{ + CRYPTOPP_UNUSED(x); + + FileSource f(filename, true, new HexDecoder()); + typename SCHEME::Signer priv(f); + typename SCHEME::Verifier pub(priv); + BenchMarkSigning(name, priv, timeTotal); + BenchMarkVerification(name, priv, pub, timeTotal); +} + +//VC60 workaround: compiler bug triggered without the extra dummy parameters +template +void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal, D *x=NULL) +{ + CRYPTOPP_UNUSED(x); + + FileSource f(filename, true, new HexDecoder()); + D d(f); + BenchMarkKeyGen(name, d, timeTotal); + BenchMarkAgreement(name, d, timeTotal); +} + +extern double g_hertz; + +void BenchmarkAll2(double t, double hertz) +{ + g_hertz = hertz; + + cout << "" << endl; + cout << ""; + BenchMarkCrypto > >("TestData/rsa1024.dat", "RSA 1024", t); + BenchMarkCrypto > >("TestData/luc1024.dat", "LUC 1024", t); + BenchMarkCrypto >("TestData/dlie1024.dat", "DLIES 1024", t); + BenchMarkCrypto >("TestData/lucc512.dat", "LUCELG 512", t); + + cout << "\n"; + BenchMarkCrypto > >("TestData/rsa2048.dat", "RSA 2048", t); + BenchMarkCrypto > >("TestData/luc2048.dat", "LUC 2048", t); + BenchMarkCrypto >("TestData/dlie2048.dat", "DLIES 2048", t); + BenchMarkCrypto >("TestData/lucc1024.dat", "LUCELG 1024", t); + + cout << "\n"; + BenchMarkSignature >("TestData/rsa1024.dat", "RSA 1024", t); + BenchMarkSignature >("TestData/rw1024.dat", "RW 1024", t); + BenchMarkSignature >("TestData/luc1024.dat", "LUC 1024", t); + BenchMarkSignature >("TestData/nr1024.dat", "NR 1024", t); + BenchMarkSignature("TestData/dsa1024.dat", "DSA 1024", t); + BenchMarkSignature >("TestData/lucs512.dat", "LUC-HMP 512", t); + BenchMarkSignature >("TestData/esig1023.dat", "ESIGN 1023", t); + BenchMarkSignature >("TestData/esig1536.dat", "ESIGN 1536", t); + + cout << "\n"; + BenchMarkSignature >("TestData/rsa2048.dat", "RSA 2048", t); + BenchMarkSignature >("TestData/rw2048.dat", "RW 2048", t); + BenchMarkSignature >("TestData/luc2048.dat", "LUC 2048", t); + BenchMarkSignature >("TestData/nr2048.dat", "NR 2048", t); + BenchMarkSignature >("TestData/lucs1024.dat", "LUC-HMP 1024", t); + BenchMarkSignature >("TestData/esig2046.dat", "ESIGN 2046", t); + + cout << "\n"; + BenchMarkKeyAgreement("TestData/xtrdh171.dat", "XTR-DH 171", t); + BenchMarkKeyAgreement("TestData/xtrdh342.dat", "XTR-DH 342", t); + BenchMarkKeyAgreement("TestData/dh1024.dat", "DH 1024", t); + BenchMarkKeyAgreement("TestData/dh2048.dat", "DH 2048", t); + BenchMarkKeyAgreement("TestData/lucd512.dat", "LUCDIF 512", t); + BenchMarkKeyAgreement("TestData/lucd1024.dat", "LUCDIF 1024", t); + BenchMarkKeyAgreement("TestData/mqv1024.dat", "MQV 1024", t); + BenchMarkKeyAgreement("TestData/mqv2048.dat", "MQV 2048", t); + + cout << "\n"; + { + ECIES::Decryptor cpriv(GlobalRNG(), ASN1::secp256k1()); + ECIES::Encryptor cpub(cpriv); + ECDSA::Signer spriv(cpriv); + ECDSA::Verifier spub(spriv); + ECDH::Domain ecdhc(ASN1::secp256k1()); + ECMQV::Domain ecmqvc(ASN1::secp256k1()); + + BenchMarkEncryption("ECIES over GF(p) 256", cpub, t); + BenchMarkDecryption("ECIES over GF(p) 256", cpriv, cpub, t); + BenchMarkSigning("ECDSA over GF(p) 256", spriv, t); + BenchMarkVerification("ECDSA over GF(p) 256", spriv, spub, t); + BenchMarkKeyGen("ECDHC over GF(p) 256", ecdhc, t); + BenchMarkAgreement("ECDHC over GF(p) 256", ecdhc, t); + BenchMarkKeyGen("ECMQVC over GF(p) 256", ecmqvc, t); + BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t); + } + + cout << "" << endl; + { + ECIES::Decryptor cpriv(GlobalRNG(), ASN1::sect233r1()); + ECIES::Encryptor cpub(cpriv); + ECDSA::Signer spriv(cpriv); + ECDSA::Verifier spub(spriv); + ECDH::Domain ecdhc(ASN1::sect233r1()); + ECMQV::Domain ecmqvc(ASN1::sect233r1()); + + BenchMarkEncryption("ECIES over GF(2^n) 233", cpub, t); + BenchMarkDecryption("ECIES over GF(2^n) 233", cpriv, cpub, t); + BenchMarkSigning("ECDSA over GF(2^n) 233", spriv, t); + BenchMarkVerification("ECDSA over GF(2^n) 233", spriv, spub, t); + BenchMarkKeyGen("ECDHC over GF(2^n) 233", ecdhc, t); + BenchMarkAgreement("ECDHC over GF(2^n) 233", ecdhc, t); + BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t); + BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t); + } + cout << "
OperationMilliseconds/Operation" << (g_hertz ? "Megacycles/Operation" : "") << endl; + + cout << "\n
" << endl; +} diff --git a/external/crypto++-5.6.3/bfinit.cpp b/external/crypto++-5.6.3/bfinit.cpp new file mode 100644 index 000000000..714570aaa --- /dev/null +++ b/external/crypto++-5.6.3/bfinit.cpp @@ -0,0 +1,277 @@ +#include "pch.h" +#include "blowfish.h" + +NAMESPACE_BEGIN(CryptoPP) + +const word32 Blowfish::Base::p_init[Blowfish::ROUNDS+2] = +{ + 608135816U, 2242054355U, 320440878U, 57701188U, + 2752067618U, 698298832U, 137296536U, 3964562569U, + 1160258022U, 953160567U, 3193202383U, 887688300U, + 3232508343U, 3380367581U, 1065670069U, 3041331479U, + 2450970073U, 2306472731U +} ; + +const word32 Blowfish::Base::s_init[4*256] = { + 3509652390U, 2564797868U, 805139163U, 3491422135U, + 3101798381U, 1780907670U, 3128725573U, 4046225305U, + 614570311U, 3012652279U, 134345442U, 2240740374U, + 1667834072U, 1901547113U, 2757295779U, 4103290238U, + 227898511U, 1921955416U, 1904987480U, 2182433518U, + 2069144605U, 3260701109U, 2620446009U, 720527379U, + 3318853667U, 677414384U, 3393288472U, 3101374703U, + 2390351024U, 1614419982U, 1822297739U, 2954791486U, + 3608508353U, 3174124327U, 2024746970U, 1432378464U, + 3864339955U, 2857741204U, 1464375394U, 1676153920U, + 1439316330U, 715854006U, 3033291828U, 289532110U, + 2706671279U, 2087905683U, 3018724369U, 1668267050U, + 732546397U, 1947742710U, 3462151702U, 2609353502U, + 2950085171U, 1814351708U, 2050118529U, 680887927U, + 999245976U, 1800124847U, 3300911131U, 1713906067U, + 1641548236U, 4213287313U, 1216130144U, 1575780402U, + 4018429277U, 3917837745U, 3693486850U, 3949271944U, + 596196993U, 3549867205U, 258830323U, 2213823033U, + 772490370U, 2760122372U, 1774776394U, 2652871518U, + 566650946U, 4142492826U, 1728879713U, 2882767088U, + 1783734482U, 3629395816U, 2517608232U, 2874225571U, + 1861159788U, 326777828U, 3124490320U, 2130389656U, + 2716951837U, 967770486U, 1724537150U, 2185432712U, + 2364442137U, 1164943284U, 2105845187U, 998989502U, + 3765401048U, 2244026483U, 1075463327U, 1455516326U, + 1322494562U, 910128902U, 469688178U, 1117454909U, + 936433444U, 3490320968U, 3675253459U, 1240580251U, + 122909385U, 2157517691U, 634681816U, 4142456567U, + 3825094682U, 3061402683U, 2540495037U, 79693498U, + 3249098678U, 1084186820U, 1583128258U, 426386531U, + 1761308591U, 1047286709U, 322548459U, 995290223U, + 1845252383U, 2603652396U, 3431023940U, 2942221577U, + 3202600964U, 3727903485U, 1712269319U, 422464435U, + 3234572375U, 1170764815U, 3523960633U, 3117677531U, + 1434042557U, 442511882U, 3600875718U, 1076654713U, + 1738483198U, 4213154764U, 2393238008U, 3677496056U, + 1014306527U, 4251020053U, 793779912U, 2902807211U, + 842905082U, 4246964064U, 1395751752U, 1040244610U, + 2656851899U, 3396308128U, 445077038U, 3742853595U, + 3577915638U, 679411651U, 2892444358U, 2354009459U, + 1767581616U, 3150600392U, 3791627101U, 3102740896U, + 284835224U, 4246832056U, 1258075500U, 768725851U, + 2589189241U, 3069724005U, 3532540348U, 1274779536U, + 3789419226U, 2764799539U, 1660621633U, 3471099624U, + 4011903706U, 913787905U, 3497959166U, 737222580U, + 2514213453U, 2928710040U, 3937242737U, 1804850592U, + 3499020752U, 2949064160U, 2386320175U, 2390070455U, + 2415321851U, 4061277028U, 2290661394U, 2416832540U, + 1336762016U, 1754252060U, 3520065937U, 3014181293U, + 791618072U, 3188594551U, 3933548030U, 2332172193U, + 3852520463U, 3043980520U, 413987798U, 3465142937U, + 3030929376U, 4245938359U, 2093235073U, 3534596313U, + 375366246U, 2157278981U, 2479649556U, 555357303U, + 3870105701U, 2008414854U, 3344188149U, 4221384143U, + 3956125452U, 2067696032U, 3594591187U, 2921233993U, + 2428461U, 544322398U, 577241275U, 1471733935U, + 610547355U, 4027169054U, 1432588573U, 1507829418U, + 2025931657U, 3646575487U, 545086370U, 48609733U, + 2200306550U, 1653985193U, 298326376U, 1316178497U, + 3007786442U, 2064951626U, 458293330U, 2589141269U, + 3591329599U, 3164325604U, 727753846U, 2179363840U, + 146436021U, 1461446943U, 4069977195U, 705550613U, + 3059967265U, 3887724982U, 4281599278U, 3313849956U, + 1404054877U, 2845806497U, 146425753U, 1854211946U, + + 1266315497U, 3048417604U, 3681880366U, 3289982499U, + 2909710000U, 1235738493U, 2632868024U, 2414719590U, + 3970600049U, 1771706367U, 1449415276U, 3266420449U, + 422970021U, 1963543593U, 2690192192U, 3826793022U, + 1062508698U, 1531092325U, 1804592342U, 2583117782U, + 2714934279U, 4024971509U, 1294809318U, 4028980673U, + 1289560198U, 2221992742U, 1669523910U, 35572830U, + 157838143U, 1052438473U, 1016535060U, 1802137761U, + 1753167236U, 1386275462U, 3080475397U, 2857371447U, + 1040679964U, 2145300060U, 2390574316U, 1461121720U, + 2956646967U, 4031777805U, 4028374788U, 33600511U, + 2920084762U, 1018524850U, 629373528U, 3691585981U, + 3515945977U, 2091462646U, 2486323059U, 586499841U, + 988145025U, 935516892U, 3367335476U, 2599673255U, + 2839830854U, 265290510U, 3972581182U, 2759138881U, + 3795373465U, 1005194799U, 847297441U, 406762289U, + 1314163512U, 1332590856U, 1866599683U, 4127851711U, + 750260880U, 613907577U, 1450815602U, 3165620655U, + 3734664991U, 3650291728U, 3012275730U, 3704569646U, + 1427272223U, 778793252U, 1343938022U, 2676280711U, + 2052605720U, 1946737175U, 3164576444U, 3914038668U, + 3967478842U, 3682934266U, 1661551462U, 3294938066U, + 4011595847U, 840292616U, 3712170807U, 616741398U, + 312560963U, 711312465U, 1351876610U, 322626781U, + 1910503582U, 271666773U, 2175563734U, 1594956187U, + 70604529U, 3617834859U, 1007753275U, 1495573769U, + 4069517037U, 2549218298U, 2663038764U, 504708206U, + 2263041392U, 3941167025U, 2249088522U, 1514023603U, + 1998579484U, 1312622330U, 694541497U, 2582060303U, + 2151582166U, 1382467621U, 776784248U, 2618340202U, + 3323268794U, 2497899128U, 2784771155U, 503983604U, + 4076293799U, 907881277U, 423175695U, 432175456U, + 1378068232U, 4145222326U, 3954048622U, 3938656102U, + 3820766613U, 2793130115U, 2977904593U, 26017576U, + 3274890735U, 3194772133U, 1700274565U, 1756076034U, + 4006520079U, 3677328699U, 720338349U, 1533947780U, + 354530856U, 688349552U, 3973924725U, 1637815568U, + 332179504U, 3949051286U, 53804574U, 2852348879U, + 3044236432U, 1282449977U, 3583942155U, 3416972820U, + 4006381244U, 1617046695U, 2628476075U, 3002303598U, + 1686838959U, 431878346U, 2686675385U, 1700445008U, + 1080580658U, 1009431731U, 832498133U, 3223435511U, + 2605976345U, 2271191193U, 2516031870U, 1648197032U, + 4164389018U, 2548247927U, 300782431U, 375919233U, + 238389289U, 3353747414U, 2531188641U, 2019080857U, + 1475708069U, 455242339U, 2609103871U, 448939670U, + 3451063019U, 1395535956U, 2413381860U, 1841049896U, + 1491858159U, 885456874U, 4264095073U, 4001119347U, + 1565136089U, 3898914787U, 1108368660U, 540939232U, + 1173283510U, 2745871338U, 3681308437U, 4207628240U, + 3343053890U, 4016749493U, 1699691293U, 1103962373U, + 3625875870U, 2256883143U, 3830138730U, 1031889488U, + 3479347698U, 1535977030U, 4236805024U, 3251091107U, + 2132092099U, 1774941330U, 1199868427U, 1452454533U, + 157007616U, 2904115357U, 342012276U, 595725824U, + 1480756522U, 206960106U, 497939518U, 591360097U, + 863170706U, 2375253569U, 3596610801U, 1814182875U, + 2094937945U, 3421402208U, 1082520231U, 3463918190U, + 2785509508U, 435703966U, 3908032597U, 1641649973U, + 2842273706U, 3305899714U, 1510255612U, 2148256476U, + 2655287854U, 3276092548U, 4258621189U, 236887753U, + 3681803219U, 274041037U, 1734335097U, 3815195456U, + 3317970021U, 1899903192U, 1026095262U, 4050517792U, + 356393447U, 2410691914U, 3873677099U, 3682840055U, + + 3913112168U, 2491498743U, 4132185628U, 2489919796U, + 1091903735U, 1979897079U, 3170134830U, 3567386728U, + 3557303409U, 857797738U, 1136121015U, 1342202287U, + 507115054U, 2535736646U, 337727348U, 3213592640U, + 1301675037U, 2528481711U, 1895095763U, 1721773893U, + 3216771564U, 62756741U, 2142006736U, 835421444U, + 2531993523U, 1442658625U, 3659876326U, 2882144922U, + 676362277U, 1392781812U, 170690266U, 3921047035U, + 1759253602U, 3611846912U, 1745797284U, 664899054U, + 1329594018U, 3901205900U, 3045908486U, 2062866102U, + 2865634940U, 3543621612U, 3464012697U, 1080764994U, + 553557557U, 3656615353U, 3996768171U, 991055499U, + 499776247U, 1265440854U, 648242737U, 3940784050U, + 980351604U, 3713745714U, 1749149687U, 3396870395U, + 4211799374U, 3640570775U, 1161844396U, 3125318951U, + 1431517754U, 545492359U, 4268468663U, 3499529547U, + 1437099964U, 2702547544U, 3433638243U, 2581715763U, + 2787789398U, 1060185593U, 1593081372U, 2418618748U, + 4260947970U, 69676912U, 2159744348U, 86519011U, + 2512459080U, 3838209314U, 1220612927U, 3339683548U, + 133810670U, 1090789135U, 1078426020U, 1569222167U, + 845107691U, 3583754449U, 4072456591U, 1091646820U, + 628848692U, 1613405280U, 3757631651U, 526609435U, + 236106946U, 48312990U, 2942717905U, 3402727701U, + 1797494240U, 859738849U, 992217954U, 4005476642U, + 2243076622U, 3870952857U, 3732016268U, 765654824U, + 3490871365U, 2511836413U, 1685915746U, 3888969200U, + 1414112111U, 2273134842U, 3281911079U, 4080962846U, + 172450625U, 2569994100U, 980381355U, 4109958455U, + 2819808352U, 2716589560U, 2568741196U, 3681446669U, + 3329971472U, 1835478071U, 660984891U, 3704678404U, + 4045999559U, 3422617507U, 3040415634U, 1762651403U, + 1719377915U, 3470491036U, 2693910283U, 3642056355U, + 3138596744U, 1364962596U, 2073328063U, 1983633131U, + 926494387U, 3423689081U, 2150032023U, 4096667949U, + 1749200295U, 3328846651U, 309677260U, 2016342300U, + 1779581495U, 3079819751U, 111262694U, 1274766160U, + 443224088U, 298511866U, 1025883608U, 3806446537U, + 1145181785U, 168956806U, 3641502830U, 3584813610U, + 1689216846U, 3666258015U, 3200248200U, 1692713982U, + 2646376535U, 4042768518U, 1618508792U, 1610833997U, + 3523052358U, 4130873264U, 2001055236U, 3610705100U, + 2202168115U, 4028541809U, 2961195399U, 1006657119U, + 2006996926U, 3186142756U, 1430667929U, 3210227297U, + 1314452623U, 4074634658U, 4101304120U, 2273951170U, + 1399257539U, 3367210612U, 3027628629U, 1190975929U, + 2062231137U, 2333990788U, 2221543033U, 2438960610U, + 1181637006U, 548689776U, 2362791313U, 3372408396U, + 3104550113U, 3145860560U, 296247880U, 1970579870U, + 3078560182U, 3769228297U, 1714227617U, 3291629107U, + 3898220290U, 166772364U, 1251581989U, 493813264U, + 448347421U, 195405023U, 2709975567U, 677966185U, + 3703036547U, 1463355134U, 2715995803U, 1338867538U, + 1343315457U, 2802222074U, 2684532164U, 233230375U, + 2599980071U, 2000651841U, 3277868038U, 1638401717U, + 4028070440U, 3237316320U, 6314154U, 819756386U, + 300326615U, 590932579U, 1405279636U, 3267499572U, + 3150704214U, 2428286686U, 3959192993U, 3461946742U, + 1862657033U, 1266418056U, 963775037U, 2089974820U, + 2263052895U, 1917689273U, 448879540U, 3550394620U, + 3981727096U, 150775221U, 3627908307U, 1303187396U, + 508620638U, 2975983352U, 2726630617U, 1817252668U, + 1876281319U, 1457606340U, 908771278U, 3720792119U, + 3617206836U, 2455994898U, 1729034894U, 1080033504U, + + 976866871U, 3556439503U, 2881648439U, 1522871579U, + 1555064734U, 1336096578U, 3548522304U, 2579274686U, + 3574697629U, 3205460757U, 3593280638U, 3338716283U, + 3079412587U, 564236357U, 2993598910U, 1781952180U, + 1464380207U, 3163844217U, 3332601554U, 1699332808U, + 1393555694U, 1183702653U, 3581086237U, 1288719814U, + 691649499U, 2847557200U, 2895455976U, 3193889540U, + 2717570544U, 1781354906U, 1676643554U, 2592534050U, + 3230253752U, 1126444790U, 2770207658U, 2633158820U, + 2210423226U, 2615765581U, 2414155088U, 3127139286U, + 673620729U, 2805611233U, 1269405062U, 4015350505U, + 3341807571U, 4149409754U, 1057255273U, 2012875353U, + 2162469141U, 2276492801U, 2601117357U, 993977747U, + 3918593370U, 2654263191U, 753973209U, 36408145U, + 2530585658U, 25011837U, 3520020182U, 2088578344U, + 530523599U, 2918365339U, 1524020338U, 1518925132U, + 3760827505U, 3759777254U, 1202760957U, 3985898139U, + 3906192525U, 674977740U, 4174734889U, 2031300136U, + 2019492241U, 3983892565U, 4153806404U, 3822280332U, + 352677332U, 2297720250U, 60907813U, 90501309U, + 3286998549U, 1016092578U, 2535922412U, 2839152426U, + 457141659U, 509813237U, 4120667899U, 652014361U, + 1966332200U, 2975202805U, 55981186U, 2327461051U, + 676427537U, 3255491064U, 2882294119U, 3433927263U, + 1307055953U, 942726286U, 933058658U, 2468411793U, + 3933900994U, 4215176142U, 1361170020U, 2001714738U, + 2830558078U, 3274259782U, 1222529897U, 1679025792U, + 2729314320U, 3714953764U, 1770335741U, 151462246U, + 3013232138U, 1682292957U, 1483529935U, 471910574U, + 1539241949U, 458788160U, 3436315007U, 1807016891U, + 3718408830U, 978976581U, 1043663428U, 3165965781U, + 1927990952U, 4200891579U, 2372276910U, 3208408903U, + 3533431907U, 1412390302U, 2931980059U, 4132332400U, + 1947078029U, 3881505623U, 4168226417U, 2941484381U, + 1077988104U, 1320477388U, 886195818U, 18198404U, + 3786409000U, 2509781533U, 112762804U, 3463356488U, + 1866414978U, 891333506U, 18488651U, 661792760U, + 1628790961U, 3885187036U, 3141171499U, 876946877U, + 2693282273U, 1372485963U, 791857591U, 2686433993U, + 3759982718U, 3167212022U, 3472953795U, 2716379847U, + 445679433U, 3561995674U, 3504004811U, 3574258232U, + 54117162U, 3331405415U, 2381918588U, 3769707343U, + 4154350007U, 1140177722U, 4074052095U, 668550556U, + 3214352940U, 367459370U, 261225585U, 2610173221U, + 4209349473U, 3468074219U, 3265815641U, 314222801U, + 3066103646U, 3808782860U, 282218597U, 3406013506U, + 3773591054U, 379116347U, 1285071038U, 846784868U, + 2669647154U, 3771962079U, 3550491691U, 2305946142U, + 453669953U, 1268987020U, 3317592352U, 3279303384U, + 3744833421U, 2610507566U, 3859509063U, 266596637U, + 3847019092U, 517658769U, 3462560207U, 3443424879U, + 370717030U, 4247526661U, 2224018117U, 4143653529U, + 4112773975U, 2788324899U, 2477274417U, 1456262402U, + 2901442914U, 1517677493U, 1846949527U, 2295493580U, + 3734397586U, 2176403920U, 1280348187U, 1908823572U, + 3871786941U, 846861322U, 1172426758U, 3287448474U, + 3383383037U, 1655181056U, 3139813346U, 901632758U, + 1897031941U, 2986607138U, 3066810236U, 3447102507U, + 1393639104U, 373351379U, 950779232U, 625454576U, + 3124240540U, 4148612726U, 2007998917U, 544563296U, + 2244738638U, 2330496472U, 2058025392U, 1291430526U, + 424198748U, 50039436U, 29584100U, 3605783033U, + 2429876329U, 2791104160U, 1057563949U, 3255363231U, + 3075367218U, 3463963227U, 1469046755U, 985887462U +}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/blowfish.cpp b/external/crypto++-5.6.3/blowfish.cpp new file mode 100644 index 000000000..aaa637cca --- /dev/null +++ b/external/crypto++-5.6.3/blowfish.cpp @@ -0,0 +1,99 @@ +// blowfish.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "blowfish.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &) +{ + AssertValidKeyLength(keylength); + + unsigned i, j=0, k; + word32 data, dspace[2] = {0, 0}; + + memcpy(pbox, p_init, sizeof(p_init)); + memcpy(sbox, s_init, sizeof(s_init)); + + // Xor key string into encryption key vector + for (i=0 ; i Block; + + word32 left, right; + Block::Get(inBlock)(left)(right); + + const word32 *const s=sbox; + const word32 *p=pbox; + + left ^= p[0]; + + for (unsigned i=0; i, public VariableKeyLength<16, 4, 56>, public FixedRounds<16> +{ + static const char *StaticAlgorithmName() {return "Blowfish";} +}; + +// Blowfish + +//! \class Blowfish +//! \brief Provides Blowfish encryption and decryption +class Blowfish : public Blowfish_Info, public BlockCipherDocumentation +{ + //! \class Base + //! \brief Class specific implementation and overrides used to operate the cipher. + //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + void UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs ¶ms); + + private: + void crypt_block(const word32 in[2], word32 out[2]) const; + + static const word32 p_init[ROUNDS+2]; + static const word32 s_init[4*256]; + + FixedSizeSecBlock pbox; + FixedSizeSecBlock sbox; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef Blowfish::Encryption BlowfishEncryption; +typedef Blowfish::Decryption BlowfishDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/blumshub.cpp b/external/crypto++-5.6.3/blumshub.cpp new file mode 100644 index 000000000..ce63a67a7 --- /dev/null +++ b/external/crypto++-5.6.3/blumshub.cpp @@ -0,0 +1,64 @@ +// blumshub.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "blumshub.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +PublicBlumBlumShub::PublicBlumBlumShub(const Integer &n, const Integer &seed) + : modn(n), + current(modn.Square(modn.Square(seed))), + maxBits(BitPrecision(n.BitCount())-1), + bitsLeft(maxBits) +{ +} + +unsigned int PublicBlumBlumShub::GenerateBit() +{ + if (bitsLeft==0) + { + current = modn.Square(current); + bitsLeft = maxBits; + } + + return current.GetBit(--bitsLeft); +} + +byte PublicBlumBlumShub::GenerateByte() +{ + byte b=0; + for (int i=0; i<8; i++) + b = byte((b << 1) | PublicBlumBlumShub::GenerateBit()); + return b; +} + +void PublicBlumBlumShub::GenerateBlock(byte *output, size_t size) +{ + while (size--) + *output++ = PublicBlumBlumShub::GenerateByte(); +} + +void PublicBlumBlumShub::ProcessData(byte *outString, const byte *inString, size_t length) +{ + while (length--) + *outString++ = *inString++ ^ PublicBlumBlumShub::GenerateByte(); +} + +BlumBlumShub::BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed) + : PublicBlumBlumShub(p*q, seed), + p(p), q(q), + x0(modn.Square(seed)) +{ +} + +void BlumBlumShub::Seek(lword index) +{ + Integer i(Integer::POSITIVE, index); + i *= 8; + Integer e = a_exp_b_mod_c (2, i / maxBits + 1, (p-1)*(q-1)); + current = modn.Exponentiate(x0, e); + bitsLeft = maxBits - i % maxBits; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/blumshub.h b/external/crypto++-5.6.3/blumshub.h new file mode 100644 index 000000000..b82c5bbe0 --- /dev/null +++ b/external/crypto++-5.6.3/blumshub.h @@ -0,0 +1,63 @@ +// blumshub.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile blumshub.h +//! \brief Classes for Blum Blum Shub generator + +#ifndef CRYPTOPP_BLUMSHUB_H +#define CRYPTOPP_BLUMSHUB_H + +#include "cryptlib.h" +#include "modarith.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! BlumBlumShub without factorization of the modulus +class PublicBlumBlumShub : public RandomNumberGenerator, + public StreamTransformation +{ +public: + PublicBlumBlumShub(const Integer &n, const Integer &seed); + + unsigned int GenerateBit(); + byte GenerateByte(); + void GenerateBlock(byte *output, size_t size); + void ProcessData(byte *outString, const byte *inString, size_t length); + + bool IsSelfInverting() const {return true;} + bool IsForwardTransformation() const {return true;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PublicBlumBlumShub() {} +#endif + +protected: + ModularArithmetic modn; + Integer current; + word maxBits, bitsLeft; +}; + +//! BlumBlumShub with factorization of the modulus +class BlumBlumShub : public PublicBlumBlumShub +{ +public: + // Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long, + // seed is the secret key and should be about as big as p*q + BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed); + + bool IsRandomAccess() const {return true;} + void Seek(lword index); + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~BlumBlumShub() {} +#endif + +protected: + const Integer p, q; + const Integer x0; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/build.sh b/external/crypto++-5.6.3/build.sh new file mode 100644 index 000000000..56124431b --- /dev/null +++ b/external/crypto++-5.6.3/build.sh @@ -0,0 +1,10 @@ +# Make the 32-bit and 64-bit versions of crypto++ +ISX86=1 ISX64=0 make clean +ISX86=1 ISX64=0 make -j12 +ISX86=1 ISX64=1 make clean +ISX86=1 ISX64=1 make -j12 + +# Make the steamcmd version of crypto++ +STEAMCMD=1 ISX86=1 ISX64=0 make clean +STEAMCMD=1 ISX86=1 ISX64=0 make -j12 + diff --git a/external/crypto++-5.6.3/camellia.cpp b/external/crypto++-5.6.3/camellia.cpp new file mode 100644 index 000000000..84473b872 --- /dev/null +++ b/external/crypto++-5.6.3/camellia.cpp @@ -0,0 +1,532 @@ +// camellia.cpp - by Kevin Springle, 2003 +// This code is hereby placed in the public domain. + +/* +Optimisations and defense against timing attacks added in Jan 2007 by Wei Dai. + +The first 2 rounds and the last round seem especially vulnerable to timing +attacks. The protection is similar to what was implemented for Rijndael. +See comments at top of rijndael.cpp for more details. +*/ + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4456) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6246) +# endif +#endif + +#include "camellia.h" +#include "misc.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +// round implementation that uses a small table for protection against timing attacks +#define SLOW_ROUND(lh, ll, rh, rl, kh, kl) { \ + word32 zr = ll ^ kl; \ + word32 zl = lh ^ kh; \ + zr= rotlFixed(s1[GETBYTE(zr, 3)], 1) | \ + (rotrFixed(s1[GETBYTE(zr, 2)], 1) << 24) | \ + (s1[rotlFixed(CRYPTOPP_GET_BYTE_AS_BYTE(zr, 1),1)] << 16) | \ + (s1[GETBYTE(zr, 0)] << 8); \ + zl= (s1[GETBYTE(zl, 3)] << 24) | \ + (rotlFixed(s1[GETBYTE(zl, 2)], 1) << 16) | \ + (rotrFixed(s1[GETBYTE(zl, 1)], 1) << 8) | \ + s1[rotlFixed(CRYPTOPP_GET_BYTE_AS_BYTE(zl, 0), 1)]; \ + zl ^= zr; \ + zr = zl ^ rotlFixed(zr, 8); \ + zl = zr ^ rotrFixed(zl, 8); \ + rh ^= rotlFixed(zr, 16); \ + rh ^= zl; \ + rl ^= rotlFixed(zl, 8); \ + } + +// normal round - same output as above but using larger tables for faster speed +#define ROUND(lh, ll, rh, rl, kh, kl) { \ + word32 th = lh ^ kh; \ + word32 tl = ll ^ kl; \ + word32 d = SP[0][GETBYTE(tl,0)] ^ SP[1][GETBYTE(tl,3)] ^ SP[2][GETBYTE(tl,2)] ^ SP[3][GETBYTE(tl,1)]; \ + word32 u = SP[0][GETBYTE(th,3)] ^ SP[1][GETBYTE(th,2)] ^ SP[2][GETBYTE(th,1)] ^ SP[3][GETBYTE(th,0)]; \ + d ^= u; \ + rh ^= d; \ + rl ^= d; \ + rl ^= rotrFixed(u, 8);} + +#define DOUBLE_ROUND(lh, ll, rh, rl, k0, k1, k2, k3) \ + ROUND(lh, ll, rh, rl, k0, k1) \ + ROUND(rh, rl, lh, ll, k2, k3) + +#ifdef IS_LITTLE_ENDIAN +#define EFI(i) (1-(i)) +#else +#define EFI(i) (i) +#endif + +void Camellia::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs &) +{ + m_rounds = (keylen >= 24) ? 4 : 3; + unsigned int kslen = (8 * m_rounds + 2); + m_key.New(kslen*2); + word32 *ks32 = m_key.data(); + int m=0, a=0; + if (!IsForwardTransformation()) + m = -1, a = kslen-1; + + word32 kl0, kl1, kl2, kl3; + GetBlock getBlock(key); + getBlock(kl0)(kl1)(kl2)(kl3); + word32 k0=kl0, k1=kl1, k2=kl2, k3=kl3; + +#define CALC_ADDR2(base, i, j) ((byte *)(base)+8*(i)+4*(j)+((-16*(i))&m)) +#define CALC_ADDR(base, i) CALC_ADDR2(base, i, 0) + +#if 1 + word64 kwl, kwr; + ks32 += 2*a; +#define PREPARE_KS_ROUNDS \ + kwl = (word64(k0) << 32) | k1; \ + kwr = (word64(k2) << 32) | k3 +#define KS_ROUND_0(i) \ + *(word64*)CALC_ADDR(ks32, i+EFI(0)) = kwl; \ + *(word64*)CALC_ADDR(ks32, i+EFI(1)) = kwr +#define KS_ROUND(i, r, which) \ + if (which & (1<> (64 - (r%64))); \ + if (which & (1<64))) *(word64*)CALC_ADDR(ks32, i+EFI(r>64)) = (kwl << (r%64)) | (kwr >> (64 - (r%64))) +#else + // SSE2 version is 30% faster on Intel Core 2. Doesn't seem worth the hassle of maintenance, but left here + // #if'd out in case someone needs it. + __m128i kw, kw2; + __m128i *ks128 = (__m128i *)ks32+a/2; + ks32 += 2*a; +#define PREPARE_KS_ROUNDS \ + kw = _mm_set_epi32(k0, k1, k2, k3); \ + if (m) kw2 = kw, kw = _mm_shuffle_epi32(kw, _MM_SHUFFLE(1, 0, 3, 2)); \ + else kw2 = _mm_shuffle_epi32(kw, _MM_SHUFFLE(1, 0, 3, 2)) +#define KS_ROUND_0(i) \ + _mm_store_si128((__m128i *)CALC_ADDR(ks128, i), kw) +#define KS_ROUND(i, r, which) { \ + __m128i temp; \ + if (r<64 && (which!=1 || m)) temp = _mm_or_si128(_mm_slli_epi64(kw, r%64), _mm_srli_epi64(kw2, 64-r%64)); \ + else temp = _mm_or_si128(_mm_slli_epi64(kw2, r%64), _mm_srli_epi64(kw, 64-r%64)); \ + if (which & 2) _mm_store_si128((__m128i *)CALC_ADDR(ks128, i), temp); \ + else _mm_storel_epi64((__m128i*)CALC_ADDR(ks32, i+EFI(0)), temp); \ + } +#endif + + if (keylen == 16) + { + // KL + PREPARE_KS_ROUNDS; + KS_ROUND_0(0); + KS_ROUND(4, 15, 3); + KS_ROUND(10, 45, 3); + KS_ROUND(12, 60, 2); + KS_ROUND(16, 77, 3); + KS_ROUND(18, 94, 3); + KS_ROUND(22, 111, 3); + + // KA + k0=kl0, k1=kl1, k2=kl2, k3=kl3; + DOUBLE_ROUND(k0, k1, k2, k3, 0xA09E667Ful, 0x3BCC908Bul, 0xB67AE858ul, 0x4CAA73B2ul); + k0^=kl0, k1^=kl1, k2^=kl2, k3^=kl3; + DOUBLE_ROUND(k0, k1, k2, k3, 0xC6EF372Ful, 0xE94F82BEul, 0x54FF53A5ul, 0xF1D36F1Cul); + + PREPARE_KS_ROUNDS; + KS_ROUND_0(2); + KS_ROUND(6, 15, 3); + KS_ROUND(8, 30, 3); + KS_ROUND(12, 45, 1); + KS_ROUND(14, 60, 3); + KS_ROUND(20, 94, 3); + KS_ROUND(24, 47, 3); + } + else + { + // KL + PREPARE_KS_ROUNDS; + KS_ROUND_0(0); + KS_ROUND(12, 45, 3); + KS_ROUND(16, 60, 3); + KS_ROUND(22, 77, 3); + KS_ROUND(30, 111, 3); + + // KR + word32 kr0, kr1, kr2, kr3; + GetBlock(key+16)(kr0)(kr1); + if (keylen == 24) + kr2 = ~kr0, kr3 = ~kr1; + else + GetBlock(key+24)(kr2)(kr3); + k0=kr0, k1=kr1, k2=kr2, k3=kr3; + + PREPARE_KS_ROUNDS; + KS_ROUND(4, 15, 3); + KS_ROUND(8, 30, 3); + KS_ROUND(18, 60, 3); + KS_ROUND(26, 94, 3); + + // KA + k0^=kl0, k1^=kl1, k2^=kl2, k3^=kl3; + DOUBLE_ROUND(k0, k1, k2, k3, 0xA09E667Ful, 0x3BCC908Bul, 0xB67AE858ul, 0x4CAA73B2ul); + k0^=kl0, k1^=kl1, k2^=kl2, k3^=kl3; + DOUBLE_ROUND(k0, k1, k2, k3, 0xC6EF372Ful, 0xE94F82BEul, 0x54FF53A5ul, 0xF1D36F1Cul); + + PREPARE_KS_ROUNDS; + KS_ROUND(6, 15, 3); + KS_ROUND(14, 45, 3); + KS_ROUND(24, 77, 3); + KS_ROUND(28, 94, 3); + + // KB + k0^=kr0, k1^=kr1, k2^=kr2, k3^=kr3; + DOUBLE_ROUND(k0, k1, k2, k3, 0x10E527FAul, 0xDE682D1Dul, 0xB05688C2ul, 0xB3E6C1FDul); + + PREPARE_KS_ROUNDS; + KS_ROUND_0(2); + KS_ROUND(10, 30, 3); + KS_ROUND(20, 60, 3); + KS_ROUND(32, 47, 3); + } +} + +void Camellia::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ +#define KS(i, j) ks[i*4 + EFI(j/2)*2 + EFI(j%2)] + +#define FL(klh, kll, krh, krl) \ + ll ^= rotlFixed(lh & klh, 1); \ + lh ^= (ll | kll); \ + rh ^= (rl | krl); \ + rl ^= rotlFixed(rh & krh, 1); + + word32 lh, ll, rh, rl; + typedef BlockGetAndPut Block; + Block::Get(inBlock)(lh)(ll)(rh)(rl); + const word32 *ks = m_key.data(); + lh ^= KS(0,0); + ll ^= KS(0,1); + rh ^= KS(0,2); + rl ^= KS(0,3); + + // timing attack countermeasure. see comments at top for more details + const int cacheLineSize = GetCacheLineSize(); + unsigned int i; + word32 u = 0; + for (i=0; i<256; i+=cacheLineSize) + u &= *(const word32 *)(s1+i); + u &= *(const word32 *)(s1+252); + lh |= u; ll |= u; + + SLOW_ROUND(lh, ll, rh, rl, KS(1,0), KS(1,1)) + SLOW_ROUND(rh, rl, lh, ll, KS(1,2), KS(1,3)) + for (i = m_rounds-1; i > 0; --i) + { + DOUBLE_ROUND(lh, ll, rh, rl, KS(2,0), KS(2,1), KS(2,2), KS(2,3)) + DOUBLE_ROUND(lh, ll, rh, rl, KS(3,0), KS(3,1), KS(3,2), KS(3,3)) + FL(KS(4,0), KS(4,1), KS(4,2), KS(4,3)); + DOUBLE_ROUND(lh, ll, rh, rl, KS(5,0), KS(5,1), KS(5,2), KS(5,3)) + ks += 16; + } + DOUBLE_ROUND(lh, ll, rh, rl, KS(2,0), KS(2,1), KS(2,2), KS(2,3)) + ROUND(lh, ll, rh, rl, KS(3,0), KS(3,1)) + SLOW_ROUND(rh, rl, lh, ll, KS(3,2), KS(3,3)) + lh ^= KS(4,0); + ll ^= KS(4,1); + rh ^= KS(4,2); + rl ^= KS(4,3); + Block::Put(xorBlock, outBlock)(rh)(rl)(lh)(ll); +} + +// The Camellia s-boxes + +const byte Camellia::Base::s1[256] = +{ + 112,130,44,236,179,39,192,229,228,133,87,53,234,12,174,65, + 35,239,107,147,69,25,165,33,237,14,79,78,29,101,146,189, + 134,184,175,143,124,235,31,206,62,48,220,95,94,197,11,26, + 166,225,57,202,213,71,93,61,217,1,90,214,81,86,108,77, + 139,13,154,102,251,204,176,45,116,18,43,32,240,177,132,153, + 223,76,203,194,52,126,118,5,109,183,169,49,209,23,4,215, + 20,88,58,97,222,27,17,28,50,15,156,22,83,24,242,34, + 254,68,207,178,195,181,122,145,36,8,232,168,96,252,105,80, + 170,208,160,125,161,137,98,151,84,91,30,149,224,255,100,210, + 16,196,0,72,163,247,117,219,138,3,230,218,9,63,221,148, + 135,92,131,2,205,74,144,51,115,103,246,243,157,127,191,226, + 82,155,216,38,200,55,198,59,129,150,111,75,19,190,99,46, + 233,121,167,140,159,110,188,142,41,245,249,182,47,253,180,89, + 120,152,6,106,231,70,113,186,212,37,171,66,136,162,141,250, + 114,7,185,85,248,238,172,10,54,73,42,104,60,56,241,164, + 64,40,211,123,187,201,67,193,21,227,173,244,119,199,128,158 +}; + +const word32 Camellia::Base::SP[4][256] = { + { + 0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, + 0xb3b3b300, 0x27272700, 0xc0c0c000, 0xe5e5e500, + 0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, + 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, + 0x23232300, 0xefefef00, 0x6b6b6b00, 0x93939300, + 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100, + 0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, + 0x1d1d1d00, 0x65656500, 0x92929200, 0xbdbdbd00, + 0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, + 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00, + 0x3e3e3e00, 0x30303000, 0xdcdcdc00, 0x5f5f5f00, + 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00, + 0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, + 0xd5d5d500, 0x47474700, 0x5d5d5d00, 0x3d3d3d00, + 0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, + 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00, + 0x8b8b8b00, 0x0d0d0d00, 0x9a9a9a00, 0x66666600, + 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00, + 0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, + 0xf0f0f000, 0xb1b1b100, 0x84848400, 0x99999900, + 0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, + 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500, + 0x6d6d6d00, 0xb7b7b700, 0xa9a9a900, 0x31313100, + 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700, + 0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, + 0xdedede00, 0x1b1b1b00, 0x11111100, 0x1c1c1c00, + 0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, + 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200, + 0xfefefe00, 0x44444400, 0xcfcfcf00, 0xb2b2b200, + 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100, + 0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, + 0x60606000, 0xfcfcfc00, 0x69696900, 0x50505000, + 0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, + 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700, + 0x54545400, 0x5b5b5b00, 0x1e1e1e00, 0x95959500, + 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200, + 0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, + 0xa3a3a300, 0xf7f7f700, 0x75757500, 0xdbdbdb00, + 0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, + 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400, + 0x87878700, 0x5c5c5c00, 0x83838300, 0x02020200, + 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300, + 0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, + 0x9d9d9d00, 0x7f7f7f00, 0xbfbfbf00, 0xe2e2e200, + 0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, + 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00, + 0x81818100, 0x96969600, 0x6f6f6f00, 0x4b4b4b00, + 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00, + 0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, + 0x9f9f9f00, 0x6e6e6e00, 0xbcbcbc00, 0x8e8e8e00, + 0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, + 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900, + 0x78787800, 0x98989800, 0x06060600, 0x6a6a6a00, + 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00, + 0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, + 0x88888800, 0xa2a2a200, 0x8d8d8d00, 0xfafafa00, + 0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, + 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00, + 0x36363600, 0x49494900, 0x2a2a2a00, 0x68686800, + 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400, + 0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, + 0xbbbbbb00, 0xc9c9c900, 0x43434300, 0xc1c1c100, + 0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, + 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00 + }, + { + 0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, + 0x00676767, 0x004e4e4e, 0x00818181, 0x00cbcbcb, + 0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, + 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282, + 0x00464646, 0x00dfdfdf, 0x00d6d6d6, 0x00272727, + 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242, + 0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, + 0x003a3a3a, 0x00cacaca, 0x00252525, 0x007b7b7b, + 0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, + 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d, + 0x007c7c7c, 0x00606060, 0x00b9b9b9, 0x00bebebe, + 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434, + 0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, + 0x00ababab, 0x008e8e8e, 0x00bababa, 0x007a7a7a, + 0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, + 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a, + 0x00171717, 0x001a1a1a, 0x00353535, 0x00cccccc, + 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a, + 0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, + 0x00e1e1e1, 0x00636363, 0x00090909, 0x00333333, + 0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, + 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a, + 0x00dadada, 0x006f6f6f, 0x00535353, 0x00626262, + 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf, + 0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, + 0x00bdbdbd, 0x00363636, 0x00222222, 0x00383838, + 0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, + 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444, + 0x00fdfdfd, 0x00888888, 0x009f9f9f, 0x00656565, + 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323, + 0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, + 0x00c0c0c0, 0x00f9f9f9, 0x00d2d2d2, 0x00a0a0a0, + 0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, + 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f, + 0x00a8a8a8, 0x00b6b6b6, 0x003c3c3c, 0x002b2b2b, + 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5, + 0x00202020, 0x00898989, 0x00000000, 0x00909090, + 0x00474747, 0x00efefef, 0x00eaeaea, 0x00b7b7b7, + 0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, + 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929, + 0x000f0f0f, 0x00b8b8b8, 0x00070707, 0x00040404, + 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666, + 0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, + 0x003b3b3b, 0x00fefefe, 0x007f7f7f, 0x00c5c5c5, + 0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, + 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676, + 0x00030303, 0x002d2d2d, 0x00dedede, 0x00969696, + 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c, + 0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, + 0x003f3f3f, 0x00dcdcdc, 0x00797979, 0x001d1d1d, + 0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, + 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2, + 0x00f0f0f0, 0x00313131, 0x000c0c0c, 0x00d4d4d4, + 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575, + 0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, + 0x00111111, 0x00454545, 0x001b1b1b, 0x00f5f5f5, + 0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, + 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414, + 0x006c6c6c, 0x00929292, 0x00545454, 0x00d0d0d0, + 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949, + 0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, + 0x00777777, 0x00939393, 0x00868686, 0x00838383, + 0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, + 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d + }, + { + 0x38003838, 0x41004141, 0x16001616, 0x76007676, + 0xd900d9d9, 0x93009393, 0x60006060, 0xf200f2f2, + 0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, + 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0, + 0x91009191, 0xf700f7f7, 0xb500b5b5, 0xc900c9c9, + 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090, + 0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, + 0x8e008e8e, 0xb200b2b2, 0x49004949, 0xde00dede, + 0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, + 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767, + 0x1f001f1f, 0x18001818, 0x6e006e6e, 0xaf00afaf, + 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d, + 0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, + 0xea00eaea, 0xa300a3a3, 0xae00aeae, 0x9e009e9e, + 0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, + 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6, + 0xc500c5c5, 0x86008686, 0x4d004d4d, 0x33003333, + 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696, + 0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, + 0x78007878, 0xd800d8d8, 0x42004242, 0xcc00cccc, + 0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, + 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282, + 0xb600b6b6, 0xdb00dbdb, 0xd400d4d4, 0x98009898, + 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb, + 0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, + 0x6f006f6f, 0x8d008d8d, 0x88008888, 0x0e000e0e, + 0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, + 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111, + 0x7f007f7f, 0x22002222, 0xe700e7e7, 0x59005959, + 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8, + 0x12001212, 0x04000404, 0x74007474, 0x54005454, + 0x30003030, 0x7e007e7e, 0xb400b4b4, 0x28002828, + 0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, + 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb, + 0x2a002a2a, 0xad00adad, 0x0f000f0f, 0xca00caca, + 0x70007070, 0xff00ffff, 0x32003232, 0x69006969, + 0x08000808, 0x62006262, 0x00000000, 0x24002424, + 0xd100d1d1, 0xfb00fbfb, 0xba00baba, 0xed00eded, + 0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, + 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a, + 0xc300c3c3, 0x2e002e2e, 0xc100c1c1, 0x01000101, + 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999, + 0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, + 0xce00cece, 0xbf00bfbf, 0xdf00dfdf, 0x71007171, + 0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, + 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d, + 0xc000c0c0, 0x4b004b4b, 0xb700b7b7, 0xa500a5a5, + 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717, + 0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, + 0xcf00cfcf, 0x37003737, 0x5e005e5e, 0x47004747, + 0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, + 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac, + 0x3c003c3c, 0x4c004c4c, 0x03000303, 0x35003535, + 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d, + 0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, + 0x44004444, 0x51005151, 0xc600c6c6, 0x7d007d7d, + 0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, + 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505, + 0x1b001b1b, 0xa400a4a4, 0x15001515, 0x34003434, + 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252, + 0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, + 0xdd00dddd, 0xe400e4e4, 0xa100a1a1, 0xe000e0e0, + 0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, + 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f + }, + { + 0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, + 0xe4e400e4, 0x57570057, 0xeaea00ea, 0xaeae00ae, + 0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, + 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092, + 0x86860086, 0xafaf00af, 0x7c7c007c, 0x1f1f001f, + 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b, + 0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, + 0xd9d900d9, 0x5a5a005a, 0x51510051, 0x6c6c006c, + 0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, + 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084, + 0xdfdf00df, 0xcbcb00cb, 0x34340034, 0x76760076, + 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004, + 0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, + 0x32320032, 0x9c9c009c, 0x53530053, 0xf2f200f2, + 0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, + 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069, + 0xaaaa00aa, 0xa0a000a0, 0xa1a100a1, 0x62620062, + 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064, + 0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, + 0x8a8a008a, 0xe6e600e6, 0x09090009, 0xdddd00dd, + 0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, + 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf, + 0x52520052, 0xd8d800d8, 0xc8c800c8, 0xc6c600c6, + 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063, + 0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, + 0x29290029, 0xf9f900f9, 0x2f2f002f, 0xb4b400b4, + 0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, + 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d, + 0x72720072, 0xb9b900b9, 0xf8f800f8, 0xacac00ac, + 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1, + 0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, + 0x15150015, 0xadad00ad, 0x77770077, 0x80800080, + 0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, + 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041, + 0xefef00ef, 0x93930093, 0x19190019, 0x21210021, + 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd, + 0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, + 0x30300030, 0x5f5f005f, 0xc5c500c5, 0x1a1a001a, + 0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, + 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d, + 0x0d0d000d, 0x66660066, 0xcccc00cc, 0x2d2d002d, + 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099, + 0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, + 0xb7b700b7, 0x31310031, 0x17170017, 0xd7d700d7, + 0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, + 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022, + 0x44440044, 0xb2b200b2, 0xb5b500b5, 0x91910091, + 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050, + 0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, + 0x5b5b005b, 0x95950095, 0xffff00ff, 0xd2d200d2, + 0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, + 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094, + 0x5c5c005c, 0x02020002, 0x4a4a004a, 0x33330033, + 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2, + 0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, + 0x96960096, 0x4b4b004b, 0xbebe00be, 0x2e2e002e, + 0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, + 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059, + 0x98980098, 0x6a6a006a, 0x46460046, 0xbaba00ba, + 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa, + 0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, + 0x49490049, 0x68680068, 0x38380038, 0xa4a400a4, + 0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, + 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e + }}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/camellia.h b/external/crypto++-5.6.3/camellia.h new file mode 100644 index 000000000..69b2651c6 --- /dev/null +++ b/external/crypto++-5.6.3/camellia.h @@ -0,0 +1,48 @@ +// camellia.h - written and placed in the public domain by Wei Dai + +//! \file camellia.h +//! \brief Classes for the Cameliia block cipher + +#ifndef CRYPTOPP_CAMELLIA_H +#define CRYPTOPP_CAMELLIA_H + +#include "config.h" +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8> +{ + static const char *StaticAlgorithmName() {return "Camellia";} +}; + +/// Camellia +class Camellia : public Camellia_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + protected: + static const byte s1[256]; + static const word32 SP[4][256]; + + unsigned int m_rounds; + SecBlock m_key; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef Camellia::Encryption CamelliaEncryption; +typedef Camellia::Decryption CamelliaDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/cast.cpp b/external/crypto++-5.6.3/cast.cpp new file mode 100644 index 000000000..ef0a5efdb --- /dev/null +++ b/external/crypto++-5.6.3/cast.cpp @@ -0,0 +1,296 @@ +// cast.cpp - written and placed in the public domain by Wei Dai and Leonard Janke +// based on Steve Reid's public domain cast.c + +#include "pch.h" +#include "cast.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +/* Macros to access 8-bit bytes out of a 32-bit word */ +#define U8a(x) GETBYTE(x,3) +#define U8b(x) GETBYTE(x,2) +#define U8c(x) GETBYTE(x,1) +#define U8d(x) GETBYTE(x,0) + +/* CAST uses three different round functions */ +#define f1(l, r, km, kr) \ + t = rotlVariable(km + r, kr); \ + l ^= ((S[0][U8a(t)] ^ S[1][U8b(t)]) - \ + S[2][U8c(t)]) + S[3][U8d(t)]; +#define f2(l, r, km, kr) \ + t = rotlVariable(km ^ r, kr); \ + l ^= ((S[0][U8a(t)] - S[1][U8b(t)]) + \ + S[2][U8c(t)]) ^ S[3][U8d(t)]; +#define f3(l, r, km, kr) \ + t = rotlVariable(km - r, kr); \ + l ^= ((S[0][U8a(t)] + S[1][U8b(t)]) ^ \ + S[2][U8c(t)]) - S[3][U8d(t)]; + +#define F1(l, r, i, j) f1(l, r, K[i], K[i+j]) +#define F2(l, r, i, j) f2(l, r, K[i], K[i+j]) +#define F3(l, r, i, j) f3(l, r, K[i], K[i+j]) + +typedef BlockGetAndPut Block; + +void CAST128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 t, l, r; + + /* Get inblock into l,r */ + Block::Get(inBlock)(l)(r); + /* Do the work */ + F1(l, r, 0, 16); + F2(r, l, 1, 16); + F3(l, r, 2, 16); + F1(r, l, 3, 16); + F2(l, r, 4, 16); + F3(r, l, 5, 16); + F1(l, r, 6, 16); + F2(r, l, 7, 16); + F3(l, r, 8, 16); + F1(r, l, 9, 16); + F2(l, r, 10, 16); + F3(r, l, 11, 16); + /* Only do full 16 rounds if key length > 80 bits */ + if (!reduced) { + F1(l, r, 12, 16); + F2(r, l, 13, 16); + F3(l, r, 14, 16); + F1(r, l, 15, 16); + } + /* Put l,r into outblock */ + Block::Put(xorBlock, outBlock)(r)(l); +} + +void CAST128::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 t, l, r; + + /* Get inblock into l,r */ + Block::Get(inBlock)(r)(l); + /* Only do full 16 rounds if key length > 80 bits */ + if (!reduced) { + F1(r, l, 15, 16); + F3(l, r, 14, 16); + F2(r, l, 13, 16); + F1(l, r, 12, 16); + } + F3(r, l, 11, 16); + F2(l, r, 10, 16); + F1(r, l, 9, 16); + F3(l, r, 8, 16); + F2(r, l, 7, 16); + F1(l, r, 6, 16); + F3(r, l, 5, 16); + F2(l, r, 4, 16); + F1(r, l, 3, 16); + F3(l, r, 2, 16); + F2(r, l, 1, 16); + F1(l, r, 0, 16); + /* Put l,r into outblock */ + Block::Put(xorBlock, outBlock)(l)(r); + /* Wipe clean */ + t = l = r = 0; +} + +void CAST128::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) +{ + AssertValidKeyLength(keylength); + + reduced = (keylength <= 10); + + word32 X[4], Z[4]; + GetUserKey(BIG_ENDIAN_ORDER, X, 4, userKey, keylength); + +#define x(i) GETBYTE(X[i/4], 3-i%4) +#define z(i) GETBYTE(Z[i/4], 3-i%4) + + unsigned int i; + for (i=0; i<=16; i+=16) + { + // this part is copied directly from RFC 2144 (with some search and replace) by Wei Dai + Z[0] = X[0] ^ S[4][x(0xD)] ^ S[5][x(0xF)] ^ S[6][x(0xC)] ^ S[7][x(0xE)] ^ S[6][x(0x8)]; + Z[1] = X[2] ^ S[4][z(0x0)] ^ S[5][z(0x2)] ^ S[6][z(0x1)] ^ S[7][z(0x3)] ^ S[7][x(0xA)]; + Z[2] = X[3] ^ S[4][z(0x7)] ^ S[5][z(0x6)] ^ S[6][z(0x5)] ^ S[7][z(0x4)] ^ S[4][x(0x9)]; + Z[3] = X[1] ^ S[4][z(0xA)] ^ S[5][z(0x9)] ^ S[6][z(0xB)] ^ S[7][z(0x8)] ^ S[5][x(0xB)]; + K[i+0] = S[4][z(0x8)] ^ S[5][z(0x9)] ^ S[6][z(0x7)] ^ S[7][z(0x6)] ^ S[4][z(0x2)]; + K[i+1] = S[4][z(0xA)] ^ S[5][z(0xB)] ^ S[6][z(0x5)] ^ S[7][z(0x4)] ^ S[5][z(0x6)]; + K[i+2] = S[4][z(0xC)] ^ S[5][z(0xD)] ^ S[6][z(0x3)] ^ S[7][z(0x2)] ^ S[6][z(0x9)]; + K[i+3] = S[4][z(0xE)] ^ S[5][z(0xF)] ^ S[6][z(0x1)] ^ S[7][z(0x0)] ^ S[7][z(0xC)]; + X[0] = Z[2] ^ S[4][z(0x5)] ^ S[5][z(0x7)] ^ S[6][z(0x4)] ^ S[7][z(0x6)] ^ S[6][z(0x0)]; + X[1] = Z[0] ^ S[4][x(0x0)] ^ S[5][x(0x2)] ^ S[6][x(0x1)] ^ S[7][x(0x3)] ^ S[7][z(0x2)]; + X[2] = Z[1] ^ S[4][x(0x7)] ^ S[5][x(0x6)] ^ S[6][x(0x5)] ^ S[7][x(0x4)] ^ S[4][z(0x1)]; + X[3] = Z[3] ^ S[4][x(0xA)] ^ S[5][x(0x9)] ^ S[6][x(0xB)] ^ S[7][x(0x8)] ^ S[5][z(0x3)]; + K[i+4] = S[4][x(0x3)] ^ S[5][x(0x2)] ^ S[6][x(0xC)] ^ S[7][x(0xD)] ^ S[4][x(0x8)]; + K[i+5] = S[4][x(0x1)] ^ S[5][x(0x0)] ^ S[6][x(0xE)] ^ S[7][x(0xF)] ^ S[5][x(0xD)]; + K[i+6] = S[4][x(0x7)] ^ S[5][x(0x6)] ^ S[6][x(0x8)] ^ S[7][x(0x9)] ^ S[6][x(0x3)]; + K[i+7] = S[4][x(0x5)] ^ S[5][x(0x4)] ^ S[6][x(0xA)] ^ S[7][x(0xB)] ^ S[7][x(0x7)]; + Z[0] = X[0] ^ S[4][x(0xD)] ^ S[5][x(0xF)] ^ S[6][x(0xC)] ^ S[7][x(0xE)] ^ S[6][x(0x8)]; + Z[1] = X[2] ^ S[4][z(0x0)] ^ S[5][z(0x2)] ^ S[6][z(0x1)] ^ S[7][z(0x3)] ^ S[7][x(0xA)]; + Z[2] = X[3] ^ S[4][z(0x7)] ^ S[5][z(0x6)] ^ S[6][z(0x5)] ^ S[7][z(0x4)] ^ S[4][x(0x9)]; + Z[3] = X[1] ^ S[4][z(0xA)] ^ S[5][z(0x9)] ^ S[6][z(0xB)] ^ S[7][z(0x8)] ^ S[5][x(0xB)]; + K[i+8] = S[4][z(0x3)] ^ S[5][z(0x2)] ^ S[6][z(0xC)] ^ S[7][z(0xD)] ^ S[4][z(0x9)]; + K[i+9] = S[4][z(0x1)] ^ S[5][z(0x0)] ^ S[6][z(0xE)] ^ S[7][z(0xF)] ^ S[5][z(0xC)]; + K[i+10] = S[4][z(0x7)] ^ S[5][z(0x6)] ^ S[6][z(0x8)] ^ S[7][z(0x9)] ^ S[6][z(0x2)]; + K[i+11] = S[4][z(0x5)] ^ S[5][z(0x4)] ^ S[6][z(0xA)] ^ S[7][z(0xB)] ^ S[7][z(0x6)]; + X[0] = Z[2] ^ S[4][z(0x5)] ^ S[5][z(0x7)] ^ S[6][z(0x4)] ^ S[7][z(0x6)] ^ S[6][z(0x0)]; + X[1] = Z[0] ^ S[4][x(0x0)] ^ S[5][x(0x2)] ^ S[6][x(0x1)] ^ S[7][x(0x3)] ^ S[7][z(0x2)]; + X[2] = Z[1] ^ S[4][x(0x7)] ^ S[5][x(0x6)] ^ S[6][x(0x5)] ^ S[7][x(0x4)] ^ S[4][z(0x1)]; + X[3] = Z[3] ^ S[4][x(0xA)] ^ S[5][x(0x9)] ^ S[6][x(0xB)] ^ S[7][x(0x8)] ^ S[5][z(0x3)]; + K[i+12] = S[4][x(0x8)] ^ S[5][x(0x9)] ^ S[6][x(0x7)] ^ S[7][x(0x6)] ^ S[4][x(0x3)]; + K[i+13] = S[4][x(0xA)] ^ S[5][x(0xB)] ^ S[6][x(0x5)] ^ S[7][x(0x4)] ^ S[5][x(0x7)]; + K[i+14] = S[4][x(0xC)] ^ S[5][x(0xD)] ^ S[6][x(0x3)] ^ S[7][x(0x2)] ^ S[6][x(0x8)]; + K[i+15] = S[4][x(0xE)] ^ S[5][x(0xF)] ^ S[6][x(0x1)] ^ S[7][x(0x0)] ^ S[7][x(0xD)]; + } + + for (i=16; i<32; i++) + K[i] &= 0x1f; +} + +// The following CAST-256 implementation was contributed by Leonard Janke + +const word32 CAST256::Base::t_m[8][24]={ +{ 0x5a827999, 0xd151d6a1, 0x482133a9, 0xbef090b1, 0x35bfedb9, 0xac8f4ac1, + 0x235ea7c9, 0x9a2e04d1, 0x10fd61d9, 0x87ccbee1, 0xfe9c1be9, 0x756b78f1, + 0xec3ad5f9, 0x630a3301, 0xd9d99009, 0x50a8ed11, 0xc7784a19, 0x3e47a721, + 0xb5170429, 0x2be66131, 0xa2b5be39, 0x19851b41, 0x90547849, 0x0723d551}, +{ 0xc95c653a, 0x402bc242, 0xb6fb1f4a, 0x2dca7c52, 0xa499d95a, 0x1b693662, + 0x9238936a, 0x0907f072, 0x7fd74d7a, 0xf6a6aa82, 0x6d76078a, 0xe4456492, + 0x5b14c19a, 0xd1e41ea2, 0x48b37baa, 0xbf82d8b2, 0x365235ba, 0xad2192c2, + 0x23f0efca, 0x9ac04cd2, 0x118fa9da, 0x885f06e2, 0xff2e63ea, 0x75fdc0f2}, +{ 0x383650db, 0xaf05ade3, 0x25d50aeb, 0x9ca467f3, 0x1373c4fb, 0x8a432203, + 0x01127f0b, 0x77e1dc13, 0xeeb1391b, 0x65809623, 0xdc4ff32b, 0x531f5033, + 0xc9eead3b, 0x40be0a43, 0xb78d674b, 0x2e5cc453, 0xa52c215b, 0x1bfb7e63, + 0x92cadb6b, 0x099a3873, 0x8069957b, 0xf738f283, 0x6e084f8b, 0xe4d7ac93}, +{ 0xa7103c7c, 0x1ddf9984, 0x94aef68c, 0x0b7e5394, 0x824db09c, 0xf91d0da4, + 0x6fec6aac, 0xe6bbc7b4, 0x5d8b24bc, 0xd45a81c4, 0x4b29decc, 0xc1f93bd4, + 0x38c898dc, 0xaf97f5e4, 0x266752ec, 0x9d36aff4, 0x14060cfc, 0x8ad56a04, + 0x01a4c70c, 0x78742414, 0xef43811c, 0x6612de24, 0xdce23b2c, 0x53b19834}, +{ 0x15ea281d, 0x8cb98525, 0x0388e22d, 0x7a583f35, 0xf1279c3d, 0x67f6f945, + 0xdec6564d, 0x5595b355, 0xcc65105d, 0x43346d65, 0xba03ca6d, 0x30d32775, + 0xa7a2847d, 0x1e71e185, 0x95413e8d, 0x0c109b95, 0x82dff89d, 0xf9af55a5, + 0x707eb2ad, 0xe74e0fb5, 0x5e1d6cbd, 0xd4ecc9c5, 0x4bbc26cd, 0xc28b83d5}, +{ 0x84c413be, 0xfb9370c6, 0x7262cdce, 0xe9322ad6, 0x600187de, 0xd6d0e4e6, + 0x4da041ee, 0xc46f9ef6, 0x3b3efbfe, 0xb20e5906, 0x28ddb60e, 0x9fad1316, + 0x167c701e, 0x8d4bcd26, 0x041b2a2e, 0x7aea8736, 0xf1b9e43e, 0x68894146, + 0xdf589e4e, 0x5627fb56, 0xccf7585e, 0x43c6b566, 0xba96126e, 0x31656f76}, +{ 0xf39dff5f, 0x6a6d5c67, 0xe13cb96f, 0x580c1677, 0xcedb737f, 0x45aad087, + 0xbc7a2d8f, 0x33498a97, 0xaa18e79f, 0x20e844a7, 0x97b7a1af, 0x0e86feb7, + 0x85565bbf, 0xfc25b8c7, 0x72f515cf, 0xe9c472d7, 0x6093cfdf, 0xd7632ce7, + 0x4e3289ef, 0xc501e6f7, 0x3bd143ff, 0xb2a0a107, 0x296ffe0f, 0xa03f5b17}, +{ 0x6277eb00, 0xd9474808, 0x5016a510, 0xc6e60218, 0x3db55f20, 0xb484bc28, + 0x2b541930, 0xa2237638, 0x18f2d340, 0x8fc23048, 0x06918d50, 0x7d60ea58, + 0xf4304760, 0x6affa468, 0xe1cf0170, 0x589e5e78, 0xcf6dbb80, 0x463d1888, + 0xbd0c7590, 0x33dbd298, 0xaaab2fa0, 0x217a8ca8, 0x9849e9b0, 0x0f1946b8} +}; + +const unsigned int CAST256::Base::t_r[8][24]={ + {19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11}, + {4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28}, + {21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13}, + {6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30}, + {23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15}, + {8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0}, + {25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17}, + {10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2} +}; + +#define Q(i) \ + F1(block[2],block[3],8*i+4,-4); \ + F2(block[1],block[2],8*i+5,-4); \ + F3(block[0],block[1],8*i+6,-4); \ + F1(block[3],block[0],8*i+7,-4); + +#define QBar(i) \ + F1(block[3],block[0],8*i+7,-4); \ + F3(block[0],block[1],8*i+6,-4); \ + F2(block[1],block[2],8*i+5,-4); \ + F1(block[2],block[3],8*i+4,-4); + +/* CAST256's encrypt/decrypt functions are identical except for the order that +the keys are used */ + +void CAST256::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 t, block[4]; + Block::Get(inBlock)(block[0])(block[1])(block[2])(block[3]); + + // Perform 6 forward quad rounds + Q(0); + Q(1); + Q(2); + Q(3); + Q(4); + Q(5); + + // Perform 6 reverse quad rounds + QBar(6); + QBar(7); + QBar(8); + QBar(9); + QBar(10); + QBar(11); + + Block::Put(xorBlock, outBlock)(block[0])(block[1])(block[2])(block[3]); +} + +/* Set up a CAST-256 key */ + +void CAST256::Base::Omega(int i, word32 kappa[8]) +{ + word32 t; + + f1(kappa[6],kappa[7],t_m[0][i],t_r[0][i]); + f2(kappa[5],kappa[6],t_m[1][i],t_r[1][i]); + f3(kappa[4],kappa[5],t_m[2][i],t_r[2][i]); + f1(kappa[3],kappa[4],t_m[3][i],t_r[3][i]); + f2(kappa[2],kappa[3],t_m[4][i],t_r[4][i]); + f3(kappa[1],kappa[2],t_m[5][i],t_r[5][i]); + f1(kappa[0],kappa[1],t_m[6][i],t_r[6][i]); + f2(kappa[7],kappa[0],t_m[7][i],t_r[7][i]); +} + +void CAST256::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) +{ + AssertValidKeyLength(keylength); + + word32 kappa[8]; + GetUserKey(BIG_ENDIAN_ORDER, kappa, 8, userKey, keylength); + + for(int i=0; i<12; ++i) + { + Omega(2*i,kappa); + Omega(2*i+1,kappa); + + K[8*i]=kappa[0] & 31; + K[8*i+1]=kappa[2] & 31; + K[8*i+2]=kappa[4] & 31; + K[8*i+3]=kappa[6] & 31; + K[8*i+4]=kappa[7]; + K[8*i+5]=kappa[5]; + K[8*i+6]=kappa[3]; + K[8*i+7]=kappa[1]; + } + + if (!IsForwardTransformation()) + { + for(int j=0; j<6; ++j) + { + for(int i=0; i<4; ++i) + { + int i1=8*j+i; + int i2=8*(11-j)+i; + + assert(i1, public VariableKeyLength<16, 5, 16> +{ + static const char *StaticAlgorithmName() {return "CAST-128";} +}; + +/// CAST-128 +class CAST128 : public CAST128_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + bool reduced; + FixedSizeSecBlock K; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +//! algorithm info +struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32> +{ + static const char *StaticAlgorithmName() {return "CAST-256";} +}; + +//! CAST-256 +class CAST256 : public CAST256_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + protected: + static const word32 t_m[8][24]; + static const unsigned int t_r[8][24]; + + static void Omega(int i, word32 kappa[8]); + + FixedSizeSecBlock K; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef CAST128::Encryption CAST128Encryption; +typedef CAST128::Decryption CAST128Decryption; + +typedef CAST256::Encryption CAST256Encryption; +typedef CAST256::Decryption CAST256Decryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/casts.cpp b/external/crypto++-5.6.3/casts.cpp new file mode 100644 index 000000000..16fa2b13f --- /dev/null +++ b/external/crypto++-5.6.3/casts.cpp @@ -0,0 +1,545 @@ +#include "pch.h" +#include "cast.h" + +NAMESPACE_BEGIN(CryptoPP) + +// CAST S-boxes + +const word32 CAST::S[8][256] = { +{ + 0x30FB40D4UL, 0x9FA0FF0BUL, 0x6BECCD2FUL, 0x3F258C7AUL, + 0x1E213F2FUL, 0x9C004DD3UL, 0x6003E540UL, 0xCF9FC949UL, + 0xBFD4AF27UL, 0x88BBBDB5UL, 0xE2034090UL, 0x98D09675UL, + 0x6E63A0E0UL, 0x15C361D2UL, 0xC2E7661DUL, 0x22D4FF8EUL, + 0x28683B6FUL, 0xC07FD059UL, 0xFF2379C8UL, 0x775F50E2UL, + 0x43C340D3UL, 0xDF2F8656UL, 0x887CA41AUL, 0xA2D2BD2DUL, + 0xA1C9E0D6UL, 0x346C4819UL, 0x61B76D87UL, 0x22540F2FUL, + 0x2ABE32E1UL, 0xAA54166BUL, 0x22568E3AUL, 0xA2D341D0UL, + 0x66DB40C8UL, 0xA784392FUL, 0x004DFF2FUL, 0x2DB9D2DEUL, + 0x97943FACUL, 0x4A97C1D8UL, 0x527644B7UL, 0xB5F437A7UL, + 0xB82CBAEFUL, 0xD751D159UL, 0x6FF7F0EDUL, 0x5A097A1FUL, + 0x827B68D0UL, 0x90ECF52EUL, 0x22B0C054UL, 0xBC8E5935UL, + 0x4B6D2F7FUL, 0x50BB64A2UL, 0xD2664910UL, 0xBEE5812DUL, + 0xB7332290UL, 0xE93B159FUL, 0xB48EE411UL, 0x4BFF345DUL, + 0xFD45C240UL, 0xAD31973FUL, 0xC4F6D02EUL, 0x55FC8165UL, + 0xD5B1CAADUL, 0xA1AC2DAEUL, 0xA2D4B76DUL, 0xC19B0C50UL, + 0x882240F2UL, 0x0C6E4F38UL, 0xA4E4BFD7UL, 0x4F5BA272UL, + 0x564C1D2FUL, 0xC59C5319UL, 0xB949E354UL, 0xB04669FEUL, + 0xB1B6AB8AUL, 0xC71358DDUL, 0x6385C545UL, 0x110F935DUL, + 0x57538AD5UL, 0x6A390493UL, 0xE63D37E0UL, 0x2A54F6B3UL, + 0x3A787D5FUL, 0x6276A0B5UL, 0x19A6FCDFUL, 0x7A42206AUL, + 0x29F9D4D5UL, 0xF61B1891UL, 0xBB72275EUL, 0xAA508167UL, + 0x38901091UL, 0xC6B505EBUL, 0x84C7CB8CUL, 0x2AD75A0FUL, + 0x874A1427UL, 0xA2D1936BUL, 0x2AD286AFUL, 0xAA56D291UL, + 0xD7894360UL, 0x425C750DUL, 0x93B39E26UL, 0x187184C9UL, + 0x6C00B32DUL, 0x73E2BB14UL, 0xA0BEBC3CUL, 0x54623779UL, + 0x64459EABUL, 0x3F328B82UL, 0x7718CF82UL, 0x59A2CEA6UL, + 0x04EE002EUL, 0x89FE78E6UL, 0x3FAB0950UL, 0x325FF6C2UL, + 0x81383F05UL, 0x6963C5C8UL, 0x76CB5AD6UL, 0xD49974C9UL, + 0xCA180DCFUL, 0x380782D5UL, 0xC7FA5CF6UL, 0x8AC31511UL, + 0x35E79E13UL, 0x47DA91D0UL, 0xF40F9086UL, 0xA7E2419EUL, + 0x31366241UL, 0x051EF495UL, 0xAA573B04UL, 0x4A805D8DUL, + 0x548300D0UL, 0x00322A3CUL, 0xBF64CDDFUL, 0xBA57A68EUL, + 0x75C6372BUL, 0x50AFD341UL, 0xA7C13275UL, 0x915A0BF5UL, + 0x6B54BFABUL, 0x2B0B1426UL, 0xAB4CC9D7UL, 0x449CCD82UL, + 0xF7FBF265UL, 0xAB85C5F3UL, 0x1B55DB94UL, 0xAAD4E324UL, + 0xCFA4BD3FUL, 0x2DEAA3E2UL, 0x9E204D02UL, 0xC8BD25ACUL, + 0xEADF55B3UL, 0xD5BD9E98UL, 0xE31231B2UL, 0x2AD5AD6CUL, + 0x954329DEUL, 0xADBE4528UL, 0xD8710F69UL, 0xAA51C90FUL, + 0xAA786BF6UL, 0x22513F1EUL, 0xAA51A79BUL, 0x2AD344CCUL, + 0x7B5A41F0UL, 0xD37CFBADUL, 0x1B069505UL, 0x41ECE491UL, + 0xB4C332E6UL, 0x032268D4UL, 0xC9600ACCUL, 0xCE387E6DUL, + 0xBF6BB16CUL, 0x6A70FB78UL, 0x0D03D9C9UL, 0xD4DF39DEUL, + 0xE01063DAUL, 0x4736F464UL, 0x5AD328D8UL, 0xB347CC96UL, + 0x75BB0FC3UL, 0x98511BFBUL, 0x4FFBCC35UL, 0xB58BCF6AUL, + 0xE11F0ABCUL, 0xBFC5FE4AUL, 0xA70AEC10UL, 0xAC39570AUL, + 0x3F04442FUL, 0x6188B153UL, 0xE0397A2EUL, 0x5727CB79UL, + 0x9CEB418FUL, 0x1CACD68DUL, 0x2AD37C96UL, 0x0175CB9DUL, + 0xC69DFF09UL, 0xC75B65F0UL, 0xD9DB40D8UL, 0xEC0E7779UL, + 0x4744EAD4UL, 0xB11C3274UL, 0xDD24CB9EUL, 0x7E1C54BDUL, + 0xF01144F9UL, 0xD2240EB1UL, 0x9675B3FDUL, 0xA3AC3755UL, + 0xD47C27AFUL, 0x51C85F4DUL, 0x56907596UL, 0xA5BB15E6UL, + 0x580304F0UL, 0xCA042CF1UL, 0x011A37EAUL, 0x8DBFAADBUL, + 0x35BA3E4AUL, 0x3526FFA0UL, 0xC37B4D09UL, 0xBC306ED9UL, + 0x98A52666UL, 0x5648F725UL, 0xFF5E569DUL, 0x0CED63D0UL, + 0x7C63B2CFUL, 0x700B45E1UL, 0xD5EA50F1UL, 0x85A92872UL, + 0xAF1FBDA7UL, 0xD4234870UL, 0xA7870BF3UL, 0x2D3B4D79UL, + 0x42E04198UL, 0x0CD0EDE7UL, 0x26470DB8UL, 0xF881814CUL, + 0x474D6AD7UL, 0x7C0C5E5CUL, 0xD1231959UL, 0x381B7298UL, + 0xF5D2F4DBUL, 0xAB838653UL, 0x6E2F1E23UL, 0x83719C9EUL, + 0xBD91E046UL, 0x9A56456EUL, 0xDC39200CUL, 0x20C8C571UL, + 0x962BDA1CUL, 0xE1E696FFUL, 0xB141AB08UL, 0x7CCA89B9UL, + 0x1A69E783UL, 0x02CC4843UL, 0xA2F7C579UL, 0x429EF47DUL, + 0x427B169CUL, 0x5AC9F049UL, 0xDD8F0F00UL, 0x5C8165BFUL +}, + +{ + 0x1F201094UL, 0xEF0BA75BUL, 0x69E3CF7EUL, 0x393F4380UL, + 0xFE61CF7AUL, 0xEEC5207AUL, 0x55889C94UL, 0x72FC0651UL, + 0xADA7EF79UL, 0x4E1D7235UL, 0xD55A63CEUL, 0xDE0436BAUL, + 0x99C430EFUL, 0x5F0C0794UL, 0x18DCDB7DUL, 0xA1D6EFF3UL, + 0xA0B52F7BUL, 0x59E83605UL, 0xEE15B094UL, 0xE9FFD909UL, + 0xDC440086UL, 0xEF944459UL, 0xBA83CCB3UL, 0xE0C3CDFBUL, + 0xD1DA4181UL, 0x3B092AB1UL, 0xF997F1C1UL, 0xA5E6CF7BUL, + 0x01420DDBUL, 0xE4E7EF5BUL, 0x25A1FF41UL, 0xE180F806UL, + 0x1FC41080UL, 0x179BEE7AUL, 0xD37AC6A9UL, 0xFE5830A4UL, + 0x98DE8B7FUL, 0x77E83F4EUL, 0x79929269UL, 0x24FA9F7BUL, + 0xE113C85BUL, 0xACC40083UL, 0xD7503525UL, 0xF7EA615FUL, + 0x62143154UL, 0x0D554B63UL, 0x5D681121UL, 0xC866C359UL, + 0x3D63CF73UL, 0xCEE234C0UL, 0xD4D87E87UL, 0x5C672B21UL, + 0x071F6181UL, 0x39F7627FUL, 0x361E3084UL, 0xE4EB573BUL, + 0x602F64A4UL, 0xD63ACD9CUL, 0x1BBC4635UL, 0x9E81032DUL, + 0x2701F50CUL, 0x99847AB4UL, 0xA0E3DF79UL, 0xBA6CF38CUL, + 0x10843094UL, 0x2537A95EUL, 0xF46F6FFEUL, 0xA1FF3B1FUL, + 0x208CFB6AUL, 0x8F458C74UL, 0xD9E0A227UL, 0x4EC73A34UL, + 0xFC884F69UL, 0x3E4DE8DFUL, 0xEF0E0088UL, 0x3559648DUL, + 0x8A45388CUL, 0x1D804366UL, 0x721D9BFDUL, 0xA58684BBUL, + 0xE8256333UL, 0x844E8212UL, 0x128D8098UL, 0xFED33FB4UL, + 0xCE280AE1UL, 0x27E19BA5UL, 0xD5A6C252UL, 0xE49754BDUL, + 0xC5D655DDUL, 0xEB667064UL, 0x77840B4DUL, 0xA1B6A801UL, + 0x84DB26A9UL, 0xE0B56714UL, 0x21F043B7UL, 0xE5D05860UL, + 0x54F03084UL, 0x066FF472UL, 0xA31AA153UL, 0xDADC4755UL, + 0xB5625DBFUL, 0x68561BE6UL, 0x83CA6B94UL, 0x2D6ED23BUL, + 0xECCF01DBUL, 0xA6D3D0BAUL, 0xB6803D5CUL, 0xAF77A709UL, + 0x33B4A34CUL, 0x397BC8D6UL, 0x5EE22B95UL, 0x5F0E5304UL, + 0x81ED6F61UL, 0x20E74364UL, 0xB45E1378UL, 0xDE18639BUL, + 0x881CA122UL, 0xB96726D1UL, 0x8049A7E8UL, 0x22B7DA7BUL, + 0x5E552D25UL, 0x5272D237UL, 0x79D2951CUL, 0xC60D894CUL, + 0x488CB402UL, 0x1BA4FE5BUL, 0xA4B09F6BUL, 0x1CA815CFUL, + 0xA20C3005UL, 0x8871DF63UL, 0xB9DE2FCBUL, 0x0CC6C9E9UL, + 0x0BEEFF53UL, 0xE3214517UL, 0xB4542835UL, 0x9F63293CUL, + 0xEE41E729UL, 0x6E1D2D7CUL, 0x50045286UL, 0x1E6685F3UL, + 0xF33401C6UL, 0x30A22C95UL, 0x31A70850UL, 0x60930F13UL, + 0x73F98417UL, 0xA1269859UL, 0xEC645C44UL, 0x52C877A9UL, + 0xCDFF33A6UL, 0xA02B1741UL, 0x7CBAD9A2UL, 0x2180036FUL, + 0x50D99C08UL, 0xCB3F4861UL, 0xC26BD765UL, 0x64A3F6ABUL, + 0x80342676UL, 0x25A75E7BUL, 0xE4E6D1FCUL, 0x20C710E6UL, + 0xCDF0B680UL, 0x17844D3BUL, 0x31EEF84DUL, 0x7E0824E4UL, + 0x2CCB49EBUL, 0x846A3BAEUL, 0x8FF77888UL, 0xEE5D60F6UL, + 0x7AF75673UL, 0x2FDD5CDBUL, 0xA11631C1UL, 0x30F66F43UL, + 0xB3FAEC54UL, 0x157FD7FAUL, 0xEF8579CCUL, 0xD152DE58UL, + 0xDB2FFD5EUL, 0x8F32CE19UL, 0x306AF97AUL, 0x02F03EF8UL, + 0x99319AD5UL, 0xC242FA0FUL, 0xA7E3EBB0UL, 0xC68E4906UL, + 0xB8DA230CUL, 0x80823028UL, 0xDCDEF3C8UL, 0xD35FB171UL, + 0x088A1BC8UL, 0xBEC0C560UL, 0x61A3C9E8UL, 0xBCA8F54DUL, + 0xC72FEFFAUL, 0x22822E99UL, 0x82C570B4UL, 0xD8D94E89UL, + 0x8B1C34BCUL, 0x301E16E6UL, 0x273BE979UL, 0xB0FFEAA6UL, + 0x61D9B8C6UL, 0x00B24869UL, 0xB7FFCE3FUL, 0x08DC283BUL, + 0x43DAF65AUL, 0xF7E19798UL, 0x7619B72FUL, 0x8F1C9BA4UL, + 0xDC8637A0UL, 0x16A7D3B1UL, 0x9FC393B7UL, 0xA7136EEBUL, + 0xC6BCC63EUL, 0x1A513742UL, 0xEF6828BCUL, 0x520365D6UL, + 0x2D6A77ABUL, 0x3527ED4BUL, 0x821FD216UL, 0x095C6E2EUL, + 0xDB92F2FBUL, 0x5EEA29CBUL, 0x145892F5UL, 0x91584F7FUL, + 0x5483697BUL, 0x2667A8CCUL, 0x85196048UL, 0x8C4BACEAUL, + 0x833860D4UL, 0x0D23E0F9UL, 0x6C387E8AUL, 0x0AE6D249UL, + 0xB284600CUL, 0xD835731DUL, 0xDCB1C647UL, 0xAC4C56EAUL, + 0x3EBD81B3UL, 0x230EABB0UL, 0x6438BC87UL, 0xF0B5B1FAUL, + 0x8F5EA2B3UL, 0xFC184642UL, 0x0A036B7AUL, 0x4FB089BDUL, + 0x649DA589UL, 0xA345415EUL, 0x5C038323UL, 0x3E5D3BB9UL, + 0x43D79572UL, 0x7E6DD07CUL, 0x06DFDF1EUL, 0x6C6CC4EFUL, + 0x7160A539UL, 0x73BFBE70UL, 0x83877605UL, 0x4523ECF1UL +}, + +{ + 0x8DEFC240UL, 0x25FA5D9FUL, 0xEB903DBFUL, 0xE810C907UL, + 0x47607FFFUL, 0x369FE44BUL, 0x8C1FC644UL, 0xAECECA90UL, + 0xBEB1F9BFUL, 0xEEFBCAEAUL, 0xE8CF1950UL, 0x51DF07AEUL, + 0x920E8806UL, 0xF0AD0548UL, 0xE13C8D83UL, 0x927010D5UL, + 0x11107D9FUL, 0x07647DB9UL, 0xB2E3E4D4UL, 0x3D4F285EUL, + 0xB9AFA820UL, 0xFADE82E0UL, 0xA067268BUL, 0x8272792EUL, + 0x553FB2C0UL, 0x489AE22BUL, 0xD4EF9794UL, 0x125E3FBCUL, + 0x21FFFCEEUL, 0x825B1BFDUL, 0x9255C5EDUL, 0x1257A240UL, + 0x4E1A8302UL, 0xBAE07FFFUL, 0x528246E7UL, 0x8E57140EUL, + 0x3373F7BFUL, 0x8C9F8188UL, 0xA6FC4EE8UL, 0xC982B5A5UL, + 0xA8C01DB7UL, 0x579FC264UL, 0x67094F31UL, 0xF2BD3F5FUL, + 0x40FFF7C1UL, 0x1FB78DFCUL, 0x8E6BD2C1UL, 0x437BE59BUL, + 0x99B03DBFUL, 0xB5DBC64BUL, 0x638DC0E6UL, 0x55819D99UL, + 0xA197C81CUL, 0x4A012D6EUL, 0xC5884A28UL, 0xCCC36F71UL, + 0xB843C213UL, 0x6C0743F1UL, 0x8309893CUL, 0x0FEDDD5FUL, + 0x2F7FE850UL, 0xD7C07F7EUL, 0x02507FBFUL, 0x5AFB9A04UL, + 0xA747D2D0UL, 0x1651192EUL, 0xAF70BF3EUL, 0x58C31380UL, + 0x5F98302EUL, 0x727CC3C4UL, 0x0A0FB402UL, 0x0F7FEF82UL, + 0x8C96FDADUL, 0x5D2C2AAEUL, 0x8EE99A49UL, 0x50DA88B8UL, + 0x8427F4A0UL, 0x1EAC5790UL, 0x796FB449UL, 0x8252DC15UL, + 0xEFBD7D9BUL, 0xA672597DUL, 0xADA840D8UL, 0x45F54504UL, + 0xFA5D7403UL, 0xE83EC305UL, 0x4F91751AUL, 0x925669C2UL, + 0x23EFE941UL, 0xA903F12EUL, 0x60270DF2UL, 0x0276E4B6UL, + 0x94FD6574UL, 0x927985B2UL, 0x8276DBCBUL, 0x02778176UL, + 0xF8AF918DUL, 0x4E48F79EUL, 0x8F616DDFUL, 0xE29D840EUL, + 0x842F7D83UL, 0x340CE5C8UL, 0x96BBB682UL, 0x93B4B148UL, + 0xEF303CABUL, 0x984FAF28UL, 0x779FAF9BUL, 0x92DC560DUL, + 0x224D1E20UL, 0x8437AA88UL, 0x7D29DC96UL, 0x2756D3DCUL, + 0x8B907CEEUL, 0xB51FD240UL, 0xE7C07CE3UL, 0xE566B4A1UL, + 0xC3E9615EUL, 0x3CF8209DUL, 0x6094D1E3UL, 0xCD9CA341UL, + 0x5C76460EUL, 0x00EA983BUL, 0xD4D67881UL, 0xFD47572CUL, + 0xF76CEDD9UL, 0xBDA8229CUL, 0x127DADAAUL, 0x438A074EUL, + 0x1F97C090UL, 0x081BDB8AUL, 0x93A07EBEUL, 0xB938CA15UL, + 0x97B03CFFUL, 0x3DC2C0F8UL, 0x8D1AB2ECUL, 0x64380E51UL, + 0x68CC7BFBUL, 0xD90F2788UL, 0x12490181UL, 0x5DE5FFD4UL, + 0xDD7EF86AUL, 0x76A2E214UL, 0xB9A40368UL, 0x925D958FUL, + 0x4B39FFFAUL, 0xBA39AEE9UL, 0xA4FFD30BUL, 0xFAF7933BUL, + 0x6D498623UL, 0x193CBCFAUL, 0x27627545UL, 0x825CF47AUL, + 0x61BD8BA0UL, 0xD11E42D1UL, 0xCEAD04F4UL, 0x127EA392UL, + 0x10428DB7UL, 0x8272A972UL, 0x9270C4A8UL, 0x127DE50BUL, + 0x285BA1C8UL, 0x3C62F44FUL, 0x35C0EAA5UL, 0xE805D231UL, + 0x428929FBUL, 0xB4FCDF82UL, 0x4FB66A53UL, 0x0E7DC15BUL, + 0x1F081FABUL, 0x108618AEUL, 0xFCFD086DUL, 0xF9FF2889UL, + 0x694BCC11UL, 0x236A5CAEUL, 0x12DECA4DUL, 0x2C3F8CC5UL, + 0xD2D02DFEUL, 0xF8EF5896UL, 0xE4CF52DAUL, 0x95155B67UL, + 0x494A488CUL, 0xB9B6A80CUL, 0x5C8F82BCUL, 0x89D36B45UL, + 0x3A609437UL, 0xEC00C9A9UL, 0x44715253UL, 0x0A874B49UL, + 0xD773BC40UL, 0x7C34671CUL, 0x02717EF6UL, 0x4FEB5536UL, + 0xA2D02FFFUL, 0xD2BF60C4UL, 0xD43F03C0UL, 0x50B4EF6DUL, + 0x07478CD1UL, 0x006E1888UL, 0xA2E53F55UL, 0xB9E6D4BCUL, + 0xA2048016UL, 0x97573833UL, 0xD7207D67UL, 0xDE0F8F3DUL, + 0x72F87B33UL, 0xABCC4F33UL, 0x7688C55DUL, 0x7B00A6B0UL, + 0x947B0001UL, 0x570075D2UL, 0xF9BB88F8UL, 0x8942019EUL, + 0x4264A5FFUL, 0x856302E0UL, 0x72DBD92BUL, 0xEE971B69UL, + 0x6EA22FDEUL, 0x5F08AE2BUL, 0xAF7A616DUL, 0xE5C98767UL, + 0xCF1FEBD2UL, 0x61EFC8C2UL, 0xF1AC2571UL, 0xCC8239C2UL, + 0x67214CB8UL, 0xB1E583D1UL, 0xB7DC3E62UL, 0x7F10BDCEUL, + 0xF90A5C38UL, 0x0FF0443DUL, 0x606E6DC6UL, 0x60543A49UL, + 0x5727C148UL, 0x2BE98A1DUL, 0x8AB41738UL, 0x20E1BE24UL, + 0xAF96DA0FUL, 0x68458425UL, 0x99833BE5UL, 0x600D457DUL, + 0x282F9350UL, 0x8334B362UL, 0xD91D1120UL, 0x2B6D8DA0UL, + 0x642B1E31UL, 0x9C305A00UL, 0x52BCE688UL, 0x1B03588AUL, + 0xF7BAEFD5UL, 0x4142ED9CUL, 0xA4315C11UL, 0x83323EC5UL, + 0xDFEF4636UL, 0xA133C501UL, 0xE9D3531CUL, 0xEE353783UL +}, + +{ + 0x9DB30420UL, 0x1FB6E9DEUL, 0xA7BE7BEFUL, 0xD273A298UL, + 0x4A4F7BDBUL, 0x64AD8C57UL, 0x85510443UL, 0xFA020ED1UL, + 0x7E287AFFUL, 0xE60FB663UL, 0x095F35A1UL, 0x79EBF120UL, + 0xFD059D43UL, 0x6497B7B1UL, 0xF3641F63UL, 0x241E4ADFUL, + 0x28147F5FUL, 0x4FA2B8CDUL, 0xC9430040UL, 0x0CC32220UL, + 0xFDD30B30UL, 0xC0A5374FUL, 0x1D2D00D9UL, 0x24147B15UL, + 0xEE4D111AUL, 0x0FCA5167UL, 0x71FF904CUL, 0x2D195FFEUL, + 0x1A05645FUL, 0x0C13FEFEUL, 0x081B08CAUL, 0x05170121UL, + 0x80530100UL, 0xE83E5EFEUL, 0xAC9AF4F8UL, 0x7FE72701UL, + 0xD2B8EE5FUL, 0x06DF4261UL, 0xBB9E9B8AUL, 0x7293EA25UL, + 0xCE84FFDFUL, 0xF5718801UL, 0x3DD64B04UL, 0xA26F263BUL, + 0x7ED48400UL, 0x547EEBE6UL, 0x446D4CA0UL, 0x6CF3D6F5UL, + 0x2649ABDFUL, 0xAEA0C7F5UL, 0x36338CC1UL, 0x503F7E93UL, + 0xD3772061UL, 0x11B638E1UL, 0x72500E03UL, 0xF80EB2BBUL, + 0xABE0502EUL, 0xEC8D77DEUL, 0x57971E81UL, 0xE14F6746UL, + 0xC9335400UL, 0x6920318FUL, 0x081DBB99UL, 0xFFC304A5UL, + 0x4D351805UL, 0x7F3D5CE3UL, 0xA6C866C6UL, 0x5D5BCCA9UL, + 0xDAEC6FEAUL, 0x9F926F91UL, 0x9F46222FUL, 0x3991467DUL, + 0xA5BF6D8EUL, 0x1143C44FUL, 0x43958302UL, 0xD0214EEBUL, + 0x022083B8UL, 0x3FB6180CUL, 0x18F8931EUL, 0x281658E6UL, + 0x26486E3EUL, 0x8BD78A70UL, 0x7477E4C1UL, 0xB506E07CUL, + 0xF32D0A25UL, 0x79098B02UL, 0xE4EABB81UL, 0x28123B23UL, + 0x69DEAD38UL, 0x1574CA16UL, 0xDF871B62UL, 0x211C40B7UL, + 0xA51A9EF9UL, 0x0014377BUL, 0x041E8AC8UL, 0x09114003UL, + 0xBD59E4D2UL, 0xE3D156D5UL, 0x4FE876D5UL, 0x2F91A340UL, + 0x557BE8DEUL, 0x00EAE4A7UL, 0x0CE5C2ECUL, 0x4DB4BBA6UL, + 0xE756BDFFUL, 0xDD3369ACUL, 0xEC17B035UL, 0x06572327UL, + 0x99AFC8B0UL, 0x56C8C391UL, 0x6B65811CUL, 0x5E146119UL, + 0x6E85CB75UL, 0xBE07C002UL, 0xC2325577UL, 0x893FF4ECUL, + 0x5BBFC92DUL, 0xD0EC3B25UL, 0xB7801AB7UL, 0x8D6D3B24UL, + 0x20C763EFUL, 0xC366A5FCUL, 0x9C382880UL, 0x0ACE3205UL, + 0xAAC9548AUL, 0xECA1D7C7UL, 0x041AFA32UL, 0x1D16625AUL, + 0x6701902CUL, 0x9B757A54UL, 0x31D477F7UL, 0x9126B031UL, + 0x36CC6FDBUL, 0xC70B8B46UL, 0xD9E66A48UL, 0x56E55A79UL, + 0x026A4CEBUL, 0x52437EFFUL, 0x2F8F76B4UL, 0x0DF980A5UL, + 0x8674CDE3UL, 0xEDDA04EBUL, 0x17A9BE04UL, 0x2C18F4DFUL, + 0xB7747F9DUL, 0xAB2AF7B4UL, 0xEFC34D20UL, 0x2E096B7CUL, + 0x1741A254UL, 0xE5B6A035UL, 0x213D42F6UL, 0x2C1C7C26UL, + 0x61C2F50FUL, 0x6552DAF9UL, 0xD2C231F8UL, 0x25130F69UL, + 0xD8167FA2UL, 0x0418F2C8UL, 0x001A96A6UL, 0x0D1526ABUL, + 0x63315C21UL, 0x5E0A72ECUL, 0x49BAFEFDUL, 0x187908D9UL, + 0x8D0DBD86UL, 0x311170A7UL, 0x3E9B640CUL, 0xCC3E10D7UL, + 0xD5CAD3B6UL, 0x0CAEC388UL, 0xF73001E1UL, 0x6C728AFFUL, + 0x71EAE2A1UL, 0x1F9AF36EUL, 0xCFCBD12FUL, 0xC1DE8417UL, + 0xAC07BE6BUL, 0xCB44A1D8UL, 0x8B9B0F56UL, 0x013988C3UL, + 0xB1C52FCAUL, 0xB4BE31CDUL, 0xD8782806UL, 0x12A3A4E2UL, + 0x6F7DE532UL, 0x58FD7EB6UL, 0xD01EE900UL, 0x24ADFFC2UL, + 0xF4990FC5UL, 0x9711AAC5UL, 0x001D7B95UL, 0x82E5E7D2UL, + 0x109873F6UL, 0x00613096UL, 0xC32D9521UL, 0xADA121FFUL, + 0x29908415UL, 0x7FBB977FUL, 0xAF9EB3DBUL, 0x29C9ED2AUL, + 0x5CE2A465UL, 0xA730F32CUL, 0xD0AA3FE8UL, 0x8A5CC091UL, + 0xD49E2CE7UL, 0x0CE454A9UL, 0xD60ACD86UL, 0x015F1919UL, + 0x77079103UL, 0xDEA03AF6UL, 0x78A8565EUL, 0xDEE356DFUL, + 0x21F05CBEUL, 0x8B75E387UL, 0xB3C50651UL, 0xB8A5C3EFUL, + 0xD8EEB6D2UL, 0xE523BE77UL, 0xC2154529UL, 0x2F69EFDFUL, + 0xAFE67AFBUL, 0xF470C4B2UL, 0xF3E0EB5BUL, 0xD6CC9876UL, + 0x39E4460CUL, 0x1FDA8538UL, 0x1987832FUL, 0xCA007367UL, + 0xA99144F8UL, 0x296B299EUL, 0x492FC295UL, 0x9266BEABUL, + 0xB5676E69UL, 0x9BD3DDDAUL, 0xDF7E052FUL, 0xDB25701CUL, + 0x1B5E51EEUL, 0xF65324E6UL, 0x6AFCE36CUL, 0x0316CC04UL, + 0x8644213EUL, 0xB7DC59D0UL, 0x7965291FUL, 0xCCD6FD43UL, + 0x41823979UL, 0x932BCDF6UL, 0xB657C34DUL, 0x4EDFD282UL, + 0x7AE5290CUL, 0x3CB9536BUL, 0x851E20FEUL, 0x9833557EUL, + 0x13ECF0B0UL, 0xD3FFB372UL, 0x3F85C5C1UL, 0x0AEF7ED2UL +}, + +{ + 0x7EC90C04UL, 0x2C6E74B9UL, 0x9B0E66DFUL, 0xA6337911UL, + 0xB86A7FFFUL, 0x1DD358F5UL, 0x44DD9D44UL, 0x1731167FUL, + 0x08FBF1FAUL, 0xE7F511CCUL, 0xD2051B00UL, 0x735ABA00UL, + 0x2AB722D8UL, 0x386381CBUL, 0xACF6243AUL, 0x69BEFD7AUL, + 0xE6A2E77FUL, 0xF0C720CDUL, 0xC4494816UL, 0xCCF5C180UL, + 0x38851640UL, 0x15B0A848UL, 0xE68B18CBUL, 0x4CAADEFFUL, + 0x5F480A01UL, 0x0412B2AAUL, 0x259814FCUL, 0x41D0EFE2UL, + 0x4E40B48DUL, 0x248EB6FBUL, 0x8DBA1CFEUL, 0x41A99B02UL, + 0x1A550A04UL, 0xBA8F65CBUL, 0x7251F4E7UL, 0x95A51725UL, + 0xC106ECD7UL, 0x97A5980AUL, 0xC539B9AAUL, 0x4D79FE6AUL, + 0xF2F3F763UL, 0x68AF8040UL, 0xED0C9E56UL, 0x11B4958BUL, + 0xE1EB5A88UL, 0x8709E6B0UL, 0xD7E07156UL, 0x4E29FEA7UL, + 0x6366E52DUL, 0x02D1C000UL, 0xC4AC8E05UL, 0x9377F571UL, + 0x0C05372AUL, 0x578535F2UL, 0x2261BE02UL, 0xD642A0C9UL, + 0xDF13A280UL, 0x74B55BD2UL, 0x682199C0UL, 0xD421E5ECUL, + 0x53FB3CE8UL, 0xC8ADEDB3UL, 0x28A87FC9UL, 0x3D959981UL, + 0x5C1FF900UL, 0xFE38D399UL, 0x0C4EFF0BUL, 0x062407EAUL, + 0xAA2F4FB1UL, 0x4FB96976UL, 0x90C79505UL, 0xB0A8A774UL, + 0xEF55A1FFUL, 0xE59CA2C2UL, 0xA6B62D27UL, 0xE66A4263UL, + 0xDF65001FUL, 0x0EC50966UL, 0xDFDD55BCUL, 0x29DE0655UL, + 0x911E739AUL, 0x17AF8975UL, 0x32C7911CUL, 0x89F89468UL, + 0x0D01E980UL, 0x524755F4UL, 0x03B63CC9UL, 0x0CC844B2UL, + 0xBCF3F0AAUL, 0x87AC36E9UL, 0xE53A7426UL, 0x01B3D82BUL, + 0x1A9E7449UL, 0x64EE2D7EUL, 0xCDDBB1DAUL, 0x01C94910UL, + 0xB868BF80UL, 0x0D26F3FDUL, 0x9342EDE7UL, 0x04A5C284UL, + 0x636737B6UL, 0x50F5B616UL, 0xF24766E3UL, 0x8ECA36C1UL, + 0x136E05DBUL, 0xFEF18391UL, 0xFB887A37UL, 0xD6E7F7D4UL, + 0xC7FB7DC9UL, 0x3063FCDFUL, 0xB6F589DEUL, 0xEC2941DAUL, + 0x26E46695UL, 0xB7566419UL, 0xF654EFC5UL, 0xD08D58B7UL, + 0x48925401UL, 0xC1BACB7FUL, 0xE5FF550FUL, 0xB6083049UL, + 0x5BB5D0E8UL, 0x87D72E5AUL, 0xAB6A6EE1UL, 0x223A66CEUL, + 0xC62BF3CDUL, 0x9E0885F9UL, 0x68CB3E47UL, 0x086C010FUL, + 0xA21DE820UL, 0xD18B69DEUL, 0xF3F65777UL, 0xFA02C3F6UL, + 0x407EDAC3UL, 0xCBB3D550UL, 0x1793084DUL, 0xB0D70EBAUL, + 0x0AB378D5UL, 0xD951FB0CUL, 0xDED7DA56UL, 0x4124BBE4UL, + 0x94CA0B56UL, 0x0F5755D1UL, 0xE0E1E56EUL, 0x6184B5BEUL, + 0x580A249FUL, 0x94F74BC0UL, 0xE327888EUL, 0x9F7B5561UL, + 0xC3DC0280UL, 0x05687715UL, 0x646C6BD7UL, 0x44904DB3UL, + 0x66B4F0A3UL, 0xC0F1648AUL, 0x697ED5AFUL, 0x49E92FF6UL, + 0x309E374FUL, 0x2CB6356AUL, 0x85808573UL, 0x4991F840UL, + 0x76F0AE02UL, 0x083BE84DUL, 0x28421C9AUL, 0x44489406UL, + 0x736E4CB8UL, 0xC1092910UL, 0x8BC95FC6UL, 0x7D869CF4UL, + 0x134F616FUL, 0x2E77118DUL, 0xB31B2BE1UL, 0xAA90B472UL, + 0x3CA5D717UL, 0x7D161BBAUL, 0x9CAD9010UL, 0xAF462BA2UL, + 0x9FE459D2UL, 0x45D34559UL, 0xD9F2DA13UL, 0xDBC65487UL, + 0xF3E4F94EUL, 0x176D486FUL, 0x097C13EAUL, 0x631DA5C7UL, + 0x445F7382UL, 0x175683F4UL, 0xCDC66A97UL, 0x70BE0288UL, + 0xB3CDCF72UL, 0x6E5DD2F3UL, 0x20936079UL, 0x459B80A5UL, + 0xBE60E2DBUL, 0xA9C23101UL, 0xEBA5315CUL, 0x224E42F2UL, + 0x1C5C1572UL, 0xF6721B2CUL, 0x1AD2FFF3UL, 0x8C25404EUL, + 0x324ED72FUL, 0x4067B7FDUL, 0x0523138EUL, 0x5CA3BC78UL, + 0xDC0FD66EUL, 0x75922283UL, 0x784D6B17UL, 0x58EBB16EUL, + 0x44094F85UL, 0x3F481D87UL, 0xFCFEAE7BUL, 0x77B5FF76UL, + 0x8C2302BFUL, 0xAAF47556UL, 0x5F46B02AUL, 0x2B092801UL, + 0x3D38F5F7UL, 0x0CA81F36UL, 0x52AF4A8AUL, 0x66D5E7C0UL, + 0xDF3B0874UL, 0x95055110UL, 0x1B5AD7A8UL, 0xF61ED5ADUL, + 0x6CF6E479UL, 0x20758184UL, 0xD0CEFA65UL, 0x88F7BE58UL, + 0x4A046826UL, 0x0FF6F8F3UL, 0xA09C7F70UL, 0x5346ABA0UL, + 0x5CE96C28UL, 0xE176EDA3UL, 0x6BAC307FUL, 0x376829D2UL, + 0x85360FA9UL, 0x17E3FE2AUL, 0x24B79767UL, 0xF5A96B20UL, + 0xD6CD2595UL, 0x68FF1EBFUL, 0x7555442CUL, 0xF19F06BEUL, + 0xF9E0659AUL, 0xEEB9491DUL, 0x34010718UL, 0xBB30CAB8UL, + 0xE822FE15UL, 0x88570983UL, 0x750E6249UL, 0xDA627E55UL, + 0x5E76FFA8UL, 0xB1534546UL, 0x6D47DE08UL, 0xEFE9E7D4UL +}, + +{ + 0xF6FA8F9DUL, 0x2CAC6CE1UL, 0x4CA34867UL, 0xE2337F7CUL, + 0x95DB08E7UL, 0x016843B4UL, 0xECED5CBCUL, 0x325553ACUL, + 0xBF9F0960UL, 0xDFA1E2EDUL, 0x83F0579DUL, 0x63ED86B9UL, + 0x1AB6A6B8UL, 0xDE5EBE39UL, 0xF38FF732UL, 0x8989B138UL, + 0x33F14961UL, 0xC01937BDUL, 0xF506C6DAUL, 0xE4625E7EUL, + 0xA308EA99UL, 0x4E23E33CUL, 0x79CBD7CCUL, 0x48A14367UL, + 0xA3149619UL, 0xFEC94BD5UL, 0xA114174AUL, 0xEAA01866UL, + 0xA084DB2DUL, 0x09A8486FUL, 0xA888614AUL, 0x2900AF98UL, + 0x01665991UL, 0xE1992863UL, 0xC8F30C60UL, 0x2E78EF3CUL, + 0xD0D51932UL, 0xCF0FEC14UL, 0xF7CA07D2UL, 0xD0A82072UL, + 0xFD41197EUL, 0x9305A6B0UL, 0xE86BE3DAUL, 0x74BED3CDUL, + 0x372DA53CUL, 0x4C7F4448UL, 0xDAB5D440UL, 0x6DBA0EC3UL, + 0x083919A7UL, 0x9FBAEED9UL, 0x49DBCFB0UL, 0x4E670C53UL, + 0x5C3D9C01UL, 0x64BDB941UL, 0x2C0E636AUL, 0xBA7DD9CDUL, + 0xEA6F7388UL, 0xE70BC762UL, 0x35F29ADBUL, 0x5C4CDD8DUL, + 0xF0D48D8CUL, 0xB88153E2UL, 0x08A19866UL, 0x1AE2EAC8UL, + 0x284CAF89UL, 0xAA928223UL, 0x9334BE53UL, 0x3B3A21BFUL, + 0x16434BE3UL, 0x9AEA3906UL, 0xEFE8C36EUL, 0xF890CDD9UL, + 0x80226DAEUL, 0xC340A4A3UL, 0xDF7E9C09UL, 0xA694A807UL, + 0x5B7C5ECCUL, 0x221DB3A6UL, 0x9A69A02FUL, 0x68818A54UL, + 0xCEB2296FUL, 0x53C0843AUL, 0xFE893655UL, 0x25BFE68AUL, + 0xB4628ABCUL, 0xCF222EBFUL, 0x25AC6F48UL, 0xA9A99387UL, + 0x53BDDB65UL, 0xE76FFBE7UL, 0xE967FD78UL, 0x0BA93563UL, + 0x8E342BC1UL, 0xE8A11BE9UL, 0x4980740DUL, 0xC8087DFCUL, + 0x8DE4BF99UL, 0xA11101A0UL, 0x7FD37975UL, 0xDA5A26C0UL, + 0xE81F994FUL, 0x9528CD89UL, 0xFD339FEDUL, 0xB87834BFUL, + 0x5F04456DUL, 0x22258698UL, 0xC9C4C83BUL, 0x2DC156BEUL, + 0x4F628DAAUL, 0x57F55EC5UL, 0xE2220ABEUL, 0xD2916EBFUL, + 0x4EC75B95UL, 0x24F2C3C0UL, 0x42D15D99UL, 0xCD0D7FA0UL, + 0x7B6E27FFUL, 0xA8DC8AF0UL, 0x7345C106UL, 0xF41E232FUL, + 0x35162386UL, 0xE6EA8926UL, 0x3333B094UL, 0x157EC6F2UL, + 0x372B74AFUL, 0x692573E4UL, 0xE9A9D848UL, 0xF3160289UL, + 0x3A62EF1DUL, 0xA787E238UL, 0xF3A5F676UL, 0x74364853UL, + 0x20951063UL, 0x4576698DUL, 0xB6FAD407UL, 0x592AF950UL, + 0x36F73523UL, 0x4CFB6E87UL, 0x7DA4CEC0UL, 0x6C152DAAUL, + 0xCB0396A8UL, 0xC50DFE5DUL, 0xFCD707ABUL, 0x0921C42FUL, + 0x89DFF0BBUL, 0x5FE2BE78UL, 0x448F4F33UL, 0x754613C9UL, + 0x2B05D08DUL, 0x48B9D585UL, 0xDC049441UL, 0xC8098F9BUL, + 0x7DEDE786UL, 0xC39A3373UL, 0x42410005UL, 0x6A091751UL, + 0x0EF3C8A6UL, 0x890072D6UL, 0x28207682UL, 0xA9A9F7BEUL, + 0xBF32679DUL, 0xD45B5B75UL, 0xB353FD00UL, 0xCBB0E358UL, + 0x830F220AUL, 0x1F8FB214UL, 0xD372CF08UL, 0xCC3C4A13UL, + 0x8CF63166UL, 0x061C87BEUL, 0x88C98F88UL, 0x6062E397UL, + 0x47CF8E7AUL, 0xB6C85283UL, 0x3CC2ACFBUL, 0x3FC06976UL, + 0x4E8F0252UL, 0x64D8314DUL, 0xDA3870E3UL, 0x1E665459UL, + 0xC10908F0UL, 0x513021A5UL, 0x6C5B68B7UL, 0x822F8AA0UL, + 0x3007CD3EUL, 0x74719EEFUL, 0xDC872681UL, 0x073340D4UL, + 0x7E432FD9UL, 0x0C5EC241UL, 0x8809286CUL, 0xF592D891UL, + 0x08A930F6UL, 0x957EF305UL, 0xB7FBFFBDUL, 0xC266E96FUL, + 0x6FE4AC98UL, 0xB173ECC0UL, 0xBC60B42AUL, 0x953498DAUL, + 0xFBA1AE12UL, 0x2D4BD736UL, 0x0F25FAABUL, 0xA4F3FCEBUL, + 0xE2969123UL, 0x257F0C3DUL, 0x9348AF49UL, 0x361400BCUL, + 0xE8816F4AUL, 0x3814F200UL, 0xA3F94043UL, 0x9C7A54C2UL, + 0xBC704F57UL, 0xDA41E7F9UL, 0xC25AD33AUL, 0x54F4A084UL, + 0xB17F5505UL, 0x59357CBEUL, 0xEDBD15C8UL, 0x7F97C5ABUL, + 0xBA5AC7B5UL, 0xB6F6DEAFUL, 0x3A479C3AUL, 0x5302DA25UL, + 0x653D7E6AUL, 0x54268D49UL, 0x51A477EAUL, 0x5017D55BUL, + 0xD7D25D88UL, 0x44136C76UL, 0x0404A8C8UL, 0xB8E5A121UL, + 0xB81A928AUL, 0x60ED5869UL, 0x97C55B96UL, 0xEAEC991BUL, + 0x29935913UL, 0x01FDB7F1UL, 0x088E8DFAUL, 0x9AB6F6F5UL, + 0x3B4CBF9FUL, 0x4A5DE3ABUL, 0xE6051D35UL, 0xA0E1D855UL, + 0xD36B4CF1UL, 0xF544EDEBUL, 0xB0E93524UL, 0xBEBB8FBDUL, + 0xA2D762CFUL, 0x49C92F54UL, 0x38B5F331UL, 0x7128A454UL, + 0x48392905UL, 0xA65B1DB8UL, 0x851C97BDUL, 0xD675CF2FUL +}, + +{ + 0x85E04019UL, 0x332BF567UL, 0x662DBFFFUL, 0xCFC65693UL, + 0x2A8D7F6FUL, 0xAB9BC912UL, 0xDE6008A1UL, 0x2028DA1FUL, + 0x0227BCE7UL, 0x4D642916UL, 0x18FAC300UL, 0x50F18B82UL, + 0x2CB2CB11UL, 0xB232E75CUL, 0x4B3695F2UL, 0xB28707DEUL, + 0xA05FBCF6UL, 0xCD4181E9UL, 0xE150210CUL, 0xE24EF1BDUL, + 0xB168C381UL, 0xFDE4E789UL, 0x5C79B0D8UL, 0x1E8BFD43UL, + 0x4D495001UL, 0x38BE4341UL, 0x913CEE1DUL, 0x92A79C3FUL, + 0x089766BEUL, 0xBAEEADF4UL, 0x1286BECFUL, 0xB6EACB19UL, + 0x2660C200UL, 0x7565BDE4UL, 0x64241F7AUL, 0x8248DCA9UL, + 0xC3B3AD66UL, 0x28136086UL, 0x0BD8DFA8UL, 0x356D1CF2UL, + 0x107789BEUL, 0xB3B2E9CEUL, 0x0502AA8FUL, 0x0BC0351EUL, + 0x166BF52AUL, 0xEB12FF82UL, 0xE3486911UL, 0xD34D7516UL, + 0x4E7B3AFFUL, 0x5F43671BUL, 0x9CF6E037UL, 0x4981AC83UL, + 0x334266CEUL, 0x8C9341B7UL, 0xD0D854C0UL, 0xCB3A6C88UL, + 0x47BC2829UL, 0x4725BA37UL, 0xA66AD22BUL, 0x7AD61F1EUL, + 0x0C5CBAFAUL, 0x4437F107UL, 0xB6E79962UL, 0x42D2D816UL, + 0x0A961288UL, 0xE1A5C06EUL, 0x13749E67UL, 0x72FC081AUL, + 0xB1D139F7UL, 0xF9583745UL, 0xCF19DF58UL, 0xBEC3F756UL, + 0xC06EBA30UL, 0x07211B24UL, 0x45C28829UL, 0xC95E317FUL, + 0xBC8EC511UL, 0x38BC46E9UL, 0xC6E6FA14UL, 0xBAE8584AUL, + 0xAD4EBC46UL, 0x468F508BUL, 0x7829435FUL, 0xF124183BUL, + 0x821DBA9FUL, 0xAFF60FF4UL, 0xEA2C4E6DUL, 0x16E39264UL, + 0x92544A8BUL, 0x009B4FC3UL, 0xABA68CEDUL, 0x9AC96F78UL, + 0x06A5B79AUL, 0xB2856E6EUL, 0x1AEC3CA9UL, 0xBE838688UL, + 0x0E0804E9UL, 0x55F1BE56UL, 0xE7E5363BUL, 0xB3A1F25DUL, + 0xF7DEBB85UL, 0x61FE033CUL, 0x16746233UL, 0x3C034C28UL, + 0xDA6D0C74UL, 0x79AAC56CUL, 0x3CE4E1ADUL, 0x51F0C802UL, + 0x98F8F35AUL, 0x1626A49FUL, 0xEED82B29UL, 0x1D382FE3UL, + 0x0C4FB99AUL, 0xBB325778UL, 0x3EC6D97BUL, 0x6E77A6A9UL, + 0xCB658B5CUL, 0xD45230C7UL, 0x2BD1408BUL, 0x60C03EB7UL, + 0xB9068D78UL, 0xA33754F4UL, 0xF430C87DUL, 0xC8A71302UL, + 0xB96D8C32UL, 0xEBD4E7BEUL, 0xBE8B9D2DUL, 0x7979FB06UL, + 0xE7225308UL, 0x8B75CF77UL, 0x11EF8DA4UL, 0xE083C858UL, + 0x8D6B786FUL, 0x5A6317A6UL, 0xFA5CF7A0UL, 0x5DDA0033UL, + 0xF28EBFB0UL, 0xF5B9C310UL, 0xA0EAC280UL, 0x08B9767AUL, + 0xA3D9D2B0UL, 0x79D34217UL, 0x021A718DUL, 0x9AC6336AUL, + 0x2711FD60UL, 0x438050E3UL, 0x069908A8UL, 0x3D7FEDC4UL, + 0x826D2BEFUL, 0x4EEB8476UL, 0x488DCF25UL, 0x36C9D566UL, + 0x28E74E41UL, 0xC2610ACAUL, 0x3D49A9CFUL, 0xBAE3B9DFUL, + 0xB65F8DE6UL, 0x92AEAF64UL, 0x3AC7D5E6UL, 0x9EA80509UL, + 0xF22B017DUL, 0xA4173F70UL, 0xDD1E16C3UL, 0x15E0D7F9UL, + 0x50B1B887UL, 0x2B9F4FD5UL, 0x625ABA82UL, 0x6A017962UL, + 0x2EC01B9CUL, 0x15488AA9UL, 0xD716E740UL, 0x40055A2CUL, + 0x93D29A22UL, 0xE32DBF9AUL, 0x058745B9UL, 0x3453DC1EUL, + 0xD699296EUL, 0x496CFF6FUL, 0x1C9F4986UL, 0xDFE2ED07UL, + 0xB87242D1UL, 0x19DE7EAEUL, 0x053E561AUL, 0x15AD6F8CUL, + 0x66626C1CUL, 0x7154C24CUL, 0xEA082B2AUL, 0x93EB2939UL, + 0x17DCB0F0UL, 0x58D4F2AEUL, 0x9EA294FBUL, 0x52CF564CUL, + 0x9883FE66UL, 0x2EC40581UL, 0x763953C3UL, 0x01D6692EUL, + 0xD3A0C108UL, 0xA1E7160EUL, 0xE4F2DFA6UL, 0x693ED285UL, + 0x74904698UL, 0x4C2B0EDDUL, 0x4F757656UL, 0x5D393378UL, + 0xA132234FUL, 0x3D321C5DUL, 0xC3F5E194UL, 0x4B269301UL, + 0xC79F022FUL, 0x3C997E7EUL, 0x5E4F9504UL, 0x3FFAFBBDUL, + 0x76F7AD0EUL, 0x296693F4UL, 0x3D1FCE6FUL, 0xC61E45BEUL, + 0xD3B5AB34UL, 0xF72BF9B7UL, 0x1B0434C0UL, 0x4E72B567UL, + 0x5592A33DUL, 0xB5229301UL, 0xCFD2A87FUL, 0x60AEB767UL, + 0x1814386BUL, 0x30BCC33DUL, 0x38A0C07DUL, 0xFD1606F2UL, + 0xC363519BUL, 0x589DD390UL, 0x5479F8E6UL, 0x1CB8D647UL, + 0x97FD61A9UL, 0xEA7759F4UL, 0x2D57539DUL, 0x569A58CFUL, + 0xE84E63ADUL, 0x462E1B78UL, 0x6580F87EUL, 0xF3817914UL, + 0x91DA55F4UL, 0x40A230F3UL, 0xD1988F35UL, 0xB6E318D2UL, + 0x3FFA50BCUL, 0x3D40F021UL, 0xC3C0BDAEUL, 0x4958C24CUL, + 0x518F36B2UL, 0x84B1D370UL, 0x0FEDCE83UL, 0x878DDADAUL, + 0xF2A279C7UL, 0x94E01BE8UL, 0x90716F4BUL, 0x954B8AA3UL +}, + +{ + 0xE216300DUL, 0xBBDDFFFCUL, 0xA7EBDABDUL, 0x35648095UL, + 0x7789F8B7UL, 0xE6C1121BUL, 0x0E241600UL, 0x052CE8B5UL, + 0x11A9CFB0UL, 0xE5952F11UL, 0xECE7990AUL, 0x9386D174UL, + 0x2A42931CUL, 0x76E38111UL, 0xB12DEF3AUL, 0x37DDDDFCUL, + 0xDE9ADEB1UL, 0x0A0CC32CUL, 0xBE197029UL, 0x84A00940UL, + 0xBB243A0FUL, 0xB4D137CFUL, 0xB44E79F0UL, 0x049EEDFDUL, + 0x0B15A15DUL, 0x480D3168UL, 0x8BBBDE5AUL, 0x669DED42UL, + 0xC7ECE831UL, 0x3F8F95E7UL, 0x72DF191BUL, 0x7580330DUL, + 0x94074251UL, 0x5C7DCDFAUL, 0xABBE6D63UL, 0xAA402164UL, + 0xB301D40AUL, 0x02E7D1CAUL, 0x53571DAEUL, 0x7A3182A2UL, + 0x12A8DDECUL, 0xFDAA335DUL, 0x176F43E8UL, 0x71FB46D4UL, + 0x38129022UL, 0xCE949AD4UL, 0xB84769ADUL, 0x965BD862UL, + 0x82F3D055UL, 0x66FB9767UL, 0x15B80B4EUL, 0x1D5B47A0UL, + 0x4CFDE06FUL, 0xC28EC4B8UL, 0x57E8726EUL, 0x647A78FCUL, + 0x99865D44UL, 0x608BD593UL, 0x6C200E03UL, 0x39DC5FF6UL, + 0x5D0B00A3UL, 0xAE63AFF2UL, 0x7E8BD632UL, 0x70108C0CUL, + 0xBBD35049UL, 0x2998DF04UL, 0x980CF42AUL, 0x9B6DF491UL, + 0x9E7EDD53UL, 0x06918548UL, 0x58CB7E07UL, 0x3B74EF2EUL, + 0x522FFFB1UL, 0xD24708CCUL, 0x1C7E27CDUL, 0xA4EB215BUL, + 0x3CF1D2E2UL, 0x19B47A38UL, 0x424F7618UL, 0x35856039UL, + 0x9D17DEE7UL, 0x27EB35E6UL, 0xC9AFF67BUL, 0x36BAF5B8UL, + 0x09C467CDUL, 0xC18910B1UL, 0xE11DBF7BUL, 0x06CD1AF8UL, + 0x7170C608UL, 0x2D5E3354UL, 0xD4DE495AUL, 0x64C6D006UL, + 0xBCC0C62CUL, 0x3DD00DB3UL, 0x708F8F34UL, 0x77D51B42UL, + 0x264F620FUL, 0x24B8D2BFUL, 0x15C1B79EUL, 0x46A52564UL, + 0xF8D7E54EUL, 0x3E378160UL, 0x7895CDA5UL, 0x859C15A5UL, + 0xE6459788UL, 0xC37BC75FUL, 0xDB07BA0CUL, 0x0676A3ABUL, + 0x7F229B1EUL, 0x31842E7BUL, 0x24259FD7UL, 0xF8BEF472UL, + 0x835FFCB8UL, 0x6DF4C1F2UL, 0x96F5B195UL, 0xFD0AF0FCUL, + 0xB0FE134CUL, 0xE2506D3DUL, 0x4F9B12EAUL, 0xF215F225UL, + 0xA223736FUL, 0x9FB4C428UL, 0x25D04979UL, 0x34C713F8UL, + 0xC4618187UL, 0xEA7A6E98UL, 0x7CD16EFCUL, 0x1436876CUL, + 0xF1544107UL, 0xBEDEEE14UL, 0x56E9AF27UL, 0xA04AA441UL, + 0x3CF7C899UL, 0x92ECBAE6UL, 0xDD67016DUL, 0x151682EBUL, + 0xA842EEDFUL, 0xFDBA60B4UL, 0xF1907B75UL, 0x20E3030FUL, + 0x24D8C29EUL, 0xE139673BUL, 0xEFA63FB8UL, 0x71873054UL, + 0xB6F2CF3BUL, 0x9F326442UL, 0xCB15A4CCUL, 0xB01A4504UL, + 0xF1E47D8DUL, 0x844A1BE5UL, 0xBAE7DFDCUL, 0x42CBDA70UL, + 0xCD7DAE0AUL, 0x57E85B7AUL, 0xD53F5AF6UL, 0x20CF4D8CUL, + 0xCEA4D428UL, 0x79D130A4UL, 0x3486EBFBUL, 0x33D3CDDCUL, + 0x77853B53UL, 0x37EFFCB5UL, 0xC5068778UL, 0xE580B3E6UL, + 0x4E68B8F4UL, 0xC5C8B37EUL, 0x0D809EA2UL, 0x398FEB7CUL, + 0x132A4F94UL, 0x43B7950EUL, 0x2FEE7D1CUL, 0x223613BDUL, + 0xDD06CAA2UL, 0x37DF932BUL, 0xC4248289UL, 0xACF3EBC3UL, + 0x5715F6B7UL, 0xEF3478DDUL, 0xF267616FUL, 0xC148CBE4UL, + 0x9052815EUL, 0x5E410FABUL, 0xB48A2465UL, 0x2EDA7FA4UL, + 0xE87B40E4UL, 0xE98EA084UL, 0x5889E9E1UL, 0xEFD390FCUL, + 0xDD07D35BUL, 0xDB485694UL, 0x38D7E5B2UL, 0x57720101UL, + 0x730EDEBCUL, 0x5B643113UL, 0x94917E4FUL, 0x503C2FBAUL, + 0x646F1282UL, 0x7523D24AUL, 0xE0779695UL, 0xF9C17A8FUL, + 0x7A5B2121UL, 0xD187B896UL, 0x29263A4DUL, 0xBA510CDFUL, + 0x81F47C9FUL, 0xAD1163EDUL, 0xEA7B5965UL, 0x1A00726EUL, + 0x11403092UL, 0x00DA6D77UL, 0x4A0CDD61UL, 0xAD1F4603UL, + 0x605BDFB0UL, 0x9EEDC364UL, 0x22EBE6A8UL, 0xCEE7D28AUL, + 0xA0E736A0UL, 0x5564A6B9UL, 0x10853209UL, 0xC7EB8F37UL, + 0x2DE705CAUL, 0x8951570FUL, 0xDF09822BUL, 0xBD691A6CUL, + 0xAA12E4F2UL, 0x87451C0FUL, 0xE0F6A27AUL, 0x3ADA4819UL, + 0x4CF1764FUL, 0x0D771C2BUL, 0x67CDB156UL, 0x350D8384UL, + 0x5938FA0FUL, 0x42399EF3UL, 0x36997B07UL, 0x0E84093DUL, + 0x4AA93E61UL, 0x8360D87BUL, 0x1FA98B0CUL, 0x1149382CUL, + 0xE97625A5UL, 0x0614D1B7UL, 0x0E25244BUL, 0x0C768347UL, + 0x589E8D82UL, 0x0D2059D1UL, 0xA466BB1EUL, 0xF8DA0A82UL, + 0x04F19130UL, 0xBA6E4EC0UL, 0x99265164UL, 0x1EE7230DUL, + 0x50B2AD80UL, 0xEAEE6801UL, 0x8DB2A283UL, 0xEA8BF59EUL +}}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/cbcmac.cpp b/external/crypto++-5.6.3/cbcmac.cpp new file mode 100644 index 000000000..6b0e8858e --- /dev/null +++ b/external/crypto++-5.6.3/cbcmac.cpp @@ -0,0 +1,62 @@ +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "cbcmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +void CBC_MAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + AccessCipher().SetKey(key, length, params); + m_reg.CleanNew(AccessCipher().BlockSize()); + m_counter = 0; +} + +void CBC_MAC_Base::Update(const byte *input, size_t length) +{ + unsigned int blockSize = AccessCipher().BlockSize(); + + while (m_counter && length) + { + m_reg[m_counter++] ^= *input++; + if (m_counter == blockSize) + ProcessBuf(); + length--; + } + + if (length >= blockSize) + { + size_t leftOver = AccessCipher().AdvancedProcessBlocks(m_reg, input, m_reg, length, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); + input += (length - leftOver); + length = leftOver; + } + + while (length--) + { + m_reg[m_counter++] ^= *input++; + if (m_counter == blockSize) + ProcessBuf(); + } +} + +void CBC_MAC_Base::TruncatedFinal(byte *mac, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + if (m_counter) + ProcessBuf(); + + memcpy(mac, m_reg, size); + memset(m_reg, 0, AccessCipher().BlockSize()); +} + +void CBC_MAC_Base::ProcessBuf() +{ + AccessCipher().ProcessBlock(m_reg); + m_counter = 0; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/cbcmac.h b/external/crypto++-5.6.3/cbcmac.h new file mode 100644 index 000000000..38c75b727 --- /dev/null +++ b/external/crypto++-5.6.3/cbcmac.h @@ -0,0 +1,56 @@ +// cbcmac.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile cbcmac.h +//! \brief Classes for CBC MAC + +#ifndef CRYPTOPP_CBCMAC_H +#define CRYPTOPP_CBCMAC_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_MAC_Base : public MessageAuthenticationCode +{ +public: + CBC_MAC_Base() : m_counter(0) {} + + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *mac, size_t size); + unsigned int DigestSize() const {return const_cast(this)->AccessCipher().BlockSize();} + +protected: + virtual BlockCipher & AccessCipher() =0; + +private: + void ProcessBuf(); + SecByteBlock m_reg; + unsigned int m_counter; +}; + +//! CBC-MAC +/*! Compatible with FIPS 113. T should be a class derived from BlockCipherDocumentation. + Secure only for fixed length messages. For variable length messages use CMAC or DMAC. +*/ +template +class CBC_MAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs +{ +public: + CBC_MAC() {} + CBC_MAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH) + {this->SetKey(key, length);} + + static std::string StaticAlgorithmName() {return std::string("CBC-MAC(") + T::StaticAlgorithmName() + ")";} + +private: + BlockCipher & AccessCipher() {return m_cipher;} + typename T::Encryption m_cipher; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ccm.cpp b/external/crypto++-5.6.3/ccm.cpp new file mode 100644 index 000000000..b3d3b7c5d --- /dev/null +++ b/external/crypto++-5.6.3/ccm.cpp @@ -0,0 +1,140 @@ +// ccm.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "ccm.h" + +NAMESPACE_BEGIN(CryptoPP) + +void CCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) +{ + BlockCipher &blockCipher = AccessBlockCipher(); + + blockCipher.SetKey(userKey, keylength, params); + + if (blockCipher.BlockSize() != REQUIRED_BLOCKSIZE) + throw InvalidArgument(AlgorithmName() + ": block size of underlying block cipher is not 16"); + + m_digestSize = params.GetIntValueWithDefault(Name::DigestSize(), DefaultDigestSize()); + if (m_digestSize % 2 > 0 || m_digestSize < 4 || m_digestSize > 16) + throw InvalidArgument(AlgorithmName() + ": DigestSize must be 4, 6, 8, 10, 12, 14, or 16"); + + m_buffer.Grow(2*REQUIRED_BLOCKSIZE); + m_L = 8; +} + +void CCM_Base::Resync(const byte *iv, size_t len) +{ + BlockCipher &cipher = AccessBlockCipher(); + + m_L = REQUIRED_BLOCKSIZE-1-(int)len; + assert(m_L >= 2); + if (m_L > 8) + m_L = 8; + + m_buffer[0] = byte(m_L-1); // flag + memcpy(m_buffer+1, iv, len); + memset(m_buffer+1+len, 0, REQUIRED_BLOCKSIZE-1-len); + + if (m_state >= State_IVSet) + m_ctr.Resynchronize(m_buffer, REQUIRED_BLOCKSIZE); + else + m_ctr.SetCipherWithIV(cipher, m_buffer); + + m_ctr.Seek(REQUIRED_BLOCKSIZE); + m_aadLength = 0; + m_messageLength = 0; +} + +void CCM_Base::UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword /*footerLength*/) +{ + if (m_state != State_IVSet) + throw BadState(AlgorithmName(), "SpecifyDataLengths", "or after State_IVSet"); + + m_aadLength = headerLength; + m_messageLength = messageLength; + + byte *cbcBuffer = CBC_Buffer(); + const BlockCipher &cipher = GetBlockCipher(); + + cbcBuffer[0] = byte(64*(headerLength>0) + 8*((m_digestSize-2)/2) + (m_L-1)); // flag + PutWord(true, BIG_ENDIAN_ORDER, cbcBuffer+REQUIRED_BLOCKSIZE-8, m_messageLength); + memcpy(cbcBuffer+1, m_buffer+1, REQUIRED_BLOCKSIZE-1-m_L); + cipher.ProcessBlock(cbcBuffer); + + if (headerLength>0) + { + assert(m_bufferedDataLength == 0); + + if (headerLength < ((1<<16) - (1<<8))) + { + PutWord(true, BIG_ENDIAN_ORDER, m_buffer, (word16)headerLength); + m_bufferedDataLength = 2; + } + else if (headerLength < (W64LIT(1)<<32)) + { + m_buffer[0] = 0xff; + m_buffer[1] = 0xfe; + PutWord(false, BIG_ENDIAN_ORDER, m_buffer+2, (word32)headerLength); + m_bufferedDataLength = 6; + } + else + { + m_buffer[0] = 0xff; + m_buffer[1] = 0xff; + PutWord(false, BIG_ENDIAN_ORDER, m_buffer+2, headerLength); + m_bufferedDataLength = 10; + } + } +} + +size_t CCM_Base::AuthenticateBlocks(const byte *data, size_t len) +{ + byte *cbcBuffer = CBC_Buffer(); + const BlockCipher &cipher = GetBlockCipher(); + return cipher.AdvancedProcessBlocks(cbcBuffer, data, cbcBuffer, len, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); +} + +void CCM_Base::AuthenticateLastHeaderBlock() +{ + byte *cbcBuffer = CBC_Buffer(); + const BlockCipher &cipher = GetBlockCipher(); + + if (m_aadLength != m_totalHeaderLength) + throw InvalidArgument(AlgorithmName() + ": header length doesn't match that given in SpecifyDataLengths"); + + if (m_bufferedDataLength > 0) + { + xorbuf(cbcBuffer, m_buffer, m_bufferedDataLength); + cipher.ProcessBlock(cbcBuffer); + m_bufferedDataLength = 0; + } +} + +void CCM_Base::AuthenticateLastConfidentialBlock() +{ + byte *cbcBuffer = CBC_Buffer(); + const BlockCipher &cipher = GetBlockCipher(); + + if (m_messageLength != m_totalMessageLength) + throw InvalidArgument(AlgorithmName() + ": message length doesn't match that given in SpecifyDataLengths"); + + if (m_bufferedDataLength > 0) + { + xorbuf(cbcBuffer, m_buffer, m_bufferedDataLength); + cipher.ProcessBlock(cbcBuffer); + m_bufferedDataLength = 0; + } +} + +void CCM_Base::AuthenticateLastFooterBlock(byte *mac, size_t macSize) +{ + m_ctr.Seek(0); + m_ctr.ProcessData(mac, CBC_Buffer(), macSize); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ccm.h b/external/crypto++-5.6.3/ccm.h new file mode 100644 index 000000000..d90c3b02f --- /dev/null +++ b/external/crypto++-5.6.3/ccm.h @@ -0,0 +1,106 @@ +// ccm.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile ccm.h +//! \brief CCM block cipher mode of operation + +#ifndef CRYPTOPP_CCM_H +#define CRYPTOPP_CCM_H + +#include "authenc.h" +#include "modes.h" + +NAMESPACE_BEGIN(CryptoPP) + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CCM_Base : public AuthenticatedSymmetricCipherBase +{ +public: + CCM_Base() + : m_digestSize(0), m_L(0), m_messageLength(0), m_aadLength(0) {} + + // AuthenticatedSymmetricCipher + std::string AlgorithmName() const + {return GetBlockCipher().AlgorithmName() + std::string("/CCM");} + size_t MinKeyLength() const + {return GetBlockCipher().MinKeyLength();} + size_t MaxKeyLength() const + {return GetBlockCipher().MaxKeyLength();} + size_t DefaultKeyLength() const + {return GetBlockCipher().DefaultKeyLength();} + size_t GetValidKeyLength(size_t n) const + {return GetBlockCipher().GetValidKeyLength(n);} + bool IsValidKeyLength(size_t n) const + {return GetBlockCipher().IsValidKeyLength(n);} + unsigned int OptimalDataAlignment() const + {return GetBlockCipher().OptimalDataAlignment();} + IV_Requirement IVRequirement() const + {return UNIQUE_IV;} + unsigned int IVSize() const + {return 8;} + unsigned int MinIVLength() const + {return 7;} + unsigned int MaxIVLength() const + {return 13;} + unsigned int DigestSize() const + {return m_digestSize;} + lword MaxHeaderLength() const + {return W64LIT(0)-1;} + lword MaxMessageLength() const + {return m_L<8 ? (W64LIT(1)<<(8*m_L))-1 : W64LIT(0)-1;} + bool NeedsPrespecifiedDataLengths() const + {return true;} + void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength); + +protected: + // AuthenticatedSymmetricCipherBase + bool AuthenticationIsOnPlaintext() const + {return true;} + unsigned int AuthenticationBlockSize() const + {return GetBlockCipher().BlockSize();} + void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); + void Resync(const byte *iv, size_t len); + size_t AuthenticateBlocks(const byte *data, size_t len); + void AuthenticateLastHeaderBlock(); + void AuthenticateLastConfidentialBlock(); + void AuthenticateLastFooterBlock(byte *mac, size_t macSize); + SymmetricCipher & AccessSymmetricCipher() {return m_ctr;} + + virtual BlockCipher & AccessBlockCipher() =0; + virtual int DefaultDigestSize() const =0; + + const BlockCipher & GetBlockCipher() const {return const_cast(this)->AccessBlockCipher();}; + byte *CBC_Buffer() {return m_buffer+REQUIRED_BLOCKSIZE;} + + enum {REQUIRED_BLOCKSIZE = 16}; + int m_digestSize, m_L; + word64 m_messageLength, m_aadLength; + CTR_Mode_ExternalCipher::Encryption m_ctr; +}; + +template +class CCM_Final : public CCM_Base +{ +public: + static std::string StaticAlgorithmName() + {return T_BlockCipher::StaticAlgorithmName() + std::string("/CCM");} + bool IsForwardTransformation() const + {return T_IsEncryption;} + +private: + BlockCipher & AccessBlockCipher() {return m_cipher;} + int DefaultDigestSize() const {return T_DefaultDigestSize;} + typename T_BlockCipher::Encryption m_cipher; +}; + +/// CCM +//! \brief CCM mode of operation +template +struct CCM : public AuthenticatedSymmetricCipherDocumentation +{ + typedef CCM_Final Encryption; + typedef CCM_Final Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/channels.cpp b/external/crypto++-5.6.3/channels.cpp new file mode 100644 index 000000000..a17068d97 --- /dev/null +++ b/external/crypto++-5.6.3/channels.cpp @@ -0,0 +1,312 @@ +// channels.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "cryptlib.h" +#include "channels.h" + +NAMESPACE_BEGIN(CryptoPP) +USING_NAMESPACE(std) + +#if 0 +void MessageSwitch::AddDefaultRoute(BufferedTransformation &destination, const std::string &channel) +{ + m_defaultRoutes.push_back(Route(&destination, channel)); +} + +void MessageSwitch::AddRoute(unsigned int begin, unsigned int end, BufferedTransformation &destination, const std::string &channel) +{ + RangeRoute route(begin, end, Route(&destination, channel)); + RouteList::iterator it = upper_bound(m_routes.begin(), m_routes.end(), route); + m_routes.insert(it, route); +} + +/* +class MessageRouteIterator +{ +public: + typedef MessageSwitch::RouteList::const_iterator RouteIterator; + typedef MessageSwitch::DefaultRouteList::const_iterator DefaultIterator; + + bool m_useDefault; + RouteIterator m_itRouteCurrent, m_itRouteEnd; + DefaultIterator m_itDefaultCurrent, m_itDefaultEnd; + + MessageRouteIterator(MessageSwitch &ms, const std::string &channel) + : m_channel(channel) + { + pair range = cs.m_routeMap.equal_range(channel); + if (range.first == range.second) + { + m_useDefault = true; + m_itListCurrent = cs.m_defaultRoutes.begin(); + m_itListEnd = cs.m_defaultRoutes.end(); + } + else + { + m_useDefault = false; + m_itMapCurrent = range.first; + m_itMapEnd = range.second; + } + } + + bool End() const + { + return m_useDefault ? m_itListCurrent == m_itListEnd : m_itMapCurrent == m_itMapEnd; + } + + void Next() + { + if (m_useDefault) + ++m_itListCurrent; + else + ++m_itMapCurrent; + } + + BufferedTransformation & Destination() + { + return m_useDefault ? *m_itListCurrent->first : *m_itMapCurrent->second.first; + } + + const std::string & Message() + { + if (m_useDefault) + return m_itListCurrent->second.get() ? *m_itListCurrent->second.get() : m_channel; + else + return m_itMapCurrent->second.second; + } +}; + +void MessageSwitch::Put(byte inByte); +void MessageSwitch::Put(const byte *inString, unsigned int length); + +void MessageSwitch::Flush(bool completeFlush, int propagation=-1); +void MessageSwitch::MessageEnd(int propagation=-1); +void MessageSwitch::PutMessageEnd(const byte *inString, unsigned int length, int propagation=-1); +void MessageSwitch::MessageSeriesEnd(int propagation=-1); +*/ +#endif + + +// +// ChannelRouteIterator +////////////////////////// + +void ChannelRouteIterator::Reset(const std::string &channel) +{ + m_channel = channel; + pair range = m_cs.m_routeMap.equal_range(channel); + if (range.first == range.second) + { + m_useDefault = true; + m_itListCurrent = m_cs.m_defaultRoutes.begin(); + m_itListEnd = m_cs.m_defaultRoutes.end(); + } + else + { + m_useDefault = false; + m_itMapCurrent = range.first; + m_itMapEnd = range.second; + } +} + +bool ChannelRouteIterator::End() const +{ + return m_useDefault ? m_itListCurrent == m_itListEnd : m_itMapCurrent == m_itMapEnd; +} + +void ChannelRouteIterator::Next() +{ + if (m_useDefault) + ++m_itListCurrent; + else + ++m_itMapCurrent; +} + +BufferedTransformation & ChannelRouteIterator::Destination() +{ + return m_useDefault ? *m_itListCurrent->first : *m_itMapCurrent->second.first; +} + +const std::string & ChannelRouteIterator::Channel() +{ + if (m_useDefault) + return m_itListCurrent->second.get() ? *m_itListCurrent->second.get() : m_channel; + else + return m_itMapCurrent->second.second; +} + + +// +// ChannelSwitch +/////////////////// + +size_t ChannelSwitch::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (m_blocked) + { + m_blocked = false; + goto WasBlocked; + } + + m_it.Reset(channel); + + while (!m_it.End()) + { +WasBlocked: + if (m_it.Destination().ChannelPut2(m_it.Channel(), begin, length, messageEnd, blocking)) + { + m_blocked = true; + return 1; + } + + m_it.Next(); + } + + return 0; +} + +void ChannelSwitch::IsolatedInitialize(const NameValuePairs& parameters) +{ + CRYPTOPP_UNUSED(parameters); + m_routeMap.clear(); + m_defaultRoutes.clear(); + m_blocked = false; +} + +bool ChannelSwitch::ChannelFlush(const std::string &channel, bool completeFlush, int propagation, bool blocking) +{ + if (m_blocked) + { + m_blocked = false; + goto WasBlocked; + } + + m_it.Reset(channel); + + while (!m_it.End()) + { + WasBlocked: + if (m_it.Destination().ChannelFlush(m_it.Channel(), completeFlush, propagation, blocking)) + { + m_blocked = true; + return true; + } + + m_it.Next(); + } + + return false; +} + +bool ChannelSwitch::ChannelMessageSeriesEnd(const std::string &channel, int propagation, bool blocking) +{ + CRYPTOPP_UNUSED(blocking); + if (m_blocked) + { + m_blocked = false; + goto WasBlocked; + } + + m_it.Reset(channel); + + while (!m_it.End()) + { + WasBlocked: + if (m_it.Destination().ChannelMessageSeriesEnd(m_it.Channel(), propagation)) + { + m_blocked = true; + return true; + } + + m_it.Next(); + } + + return false; +} + +byte * ChannelSwitch::ChannelCreatePutSpace(const std::string &channel, size_t &size) +{ + m_it.Reset(channel); + if (!m_it.End()) + { + BufferedTransformation &target = m_it.Destination(); + const std::string &ch = m_it.Channel(); + m_it.Next(); + if (m_it.End()) // there is only one target channel + return target.ChannelCreatePutSpace(ch, size); + } + size = 0; + return NULL; +} + +size_t ChannelSwitch::ChannelPutModifiable2(const std::string &channel, byte *inString, size_t length, int messageEnd, bool blocking) +{ + ChannelRouteIterator it(*this); + it.Reset(channel); + + if (!it.End()) + { + BufferedTransformation &target = it.Destination(); + const std::string &targetChannel = it.Channel(); + it.Next(); + if (it.End()) // there is only one target channel + return target.ChannelPutModifiable2(targetChannel, inString, length, messageEnd, blocking); + } + + return ChannelPut2(channel, inString, length, messageEnd, blocking); +} + +void ChannelSwitch::AddDefaultRoute(BufferedTransformation &destination) +{ + m_defaultRoutes.push_back(DefaultRoute(&destination, value_ptr(NULL))); +} + +void ChannelSwitch::RemoveDefaultRoute(BufferedTransformation &destination) +{ + for (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it) + if (it->first == &destination && !it->second.get()) + { + m_defaultRoutes.erase(it); + break; + } +} + +void ChannelSwitch::AddDefaultRoute(BufferedTransformation &destination, const std::string &outChannel) +{ + m_defaultRoutes.push_back(DefaultRoute(&destination, outChannel)); +} + +void ChannelSwitch::RemoveDefaultRoute(BufferedTransformation &destination, const std::string &outChannel) +{ + for (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it) + if (it->first == &destination && (it->second.get() && *it->second == outChannel)) + { + m_defaultRoutes.erase(it); + break; + } +} + +void ChannelSwitch::AddRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel) +{ + m_routeMap.insert(RouteMap::value_type(inChannel, Route(&destination, outChannel))); +} + +void ChannelSwitch::RemoveRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel) +{ + typedef ChannelSwitch::RouteMap::iterator MapIterator; + pair range = m_routeMap.equal_range(inChannel); + + for (MapIterator it = range.first; it != range.second; ++it) + if (it->second.first == &destination && it->second.second == outChannel) + { + m_routeMap.erase(it); + break; + } +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/channels.h b/external/crypto++-5.6.3/channels.h new file mode 100644 index 000000000..00a8354b1 --- /dev/null +++ b/external/crypto++-5.6.3/channels.h @@ -0,0 +1,134 @@ +// channels.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile channels.h +//! \brief Classes for multiple named channels + +#ifndef CRYPTOPP_CHANNELS_H +#define CRYPTOPP_CHANNELS_H + +#include "cryptlib.h" +#include "simple.h" +#include "smartptr.h" +#include "stdcpp.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if 0 +//! Route input on default channel to different and/or multiple channels based on message sequence number +class MessageSwitch : public Sink +{ +public: + void AddDefaultRoute(BufferedTransformation &destination, const std::string &channel); + void AddRoute(unsigned int begin, unsigned int end, BufferedTransformation &destination, const std::string &channel); + + void Put(byte inByte); + void Put(const byte *inString, unsigned int length); + + void Flush(bool completeFlush, int propagation=-1); + void MessageEnd(int propagation=-1); + void PutMessageEnd(const byte *inString, unsigned int length, int propagation=-1); + void MessageSeriesEnd(int propagation=-1); + +private: + typedef std::pair Route; + struct RangeRoute + { + RangeRoute(unsigned int begin, unsigned int end, const Route &route) + : begin(begin), end(end), route(route) {} + bool operator<(const RangeRoute &rhs) const {return begin < rhs.begin;} + unsigned int begin, end; + Route route; + }; + + typedef std::list RouteList; + typedef std::list DefaultRouteList; + + RouteList m_routes; + DefaultRouteList m_defaultRoutes; + unsigned int m_nCurrentMessage; +}; +#endif + +class ChannelSwitchTypedefs +{ +public: + typedef std::pair Route; + typedef std::multimap RouteMap; + + typedef std::pair > DefaultRoute; + typedef std::list DefaultRouteList; + + // SunCC workaround: can't use const_iterator here + typedef RouteMap::iterator MapIterator; + typedef DefaultRouteList::iterator ListIterator; +}; + +class ChannelSwitch; + +class ChannelRouteIterator : public ChannelSwitchTypedefs +{ +public: + ChannelRouteIterator(ChannelSwitch &cs) : m_cs(cs), m_useDefault(false) {} + + void Reset(const std::string &channel); + bool End() const; + void Next(); + BufferedTransformation & Destination(); + const std::string & Channel(); + + ChannelSwitch& m_cs; + std::string m_channel; + bool m_useDefault; + MapIterator m_itMapCurrent, m_itMapEnd; + ListIterator m_itListCurrent, m_itListEnd; + +protected: + // Hide this to see if we break something... + ChannelRouteIterator(); +}; + +//! Route input to different and/or multiple channels based on channel ID +class CRYPTOPP_DLL ChannelSwitch : public Multichannel, public ChannelSwitchTypedefs +{ +public: + ChannelSwitch() : m_it(*this), m_blocked(false) {} + ChannelSwitch(BufferedTransformation &destination) : m_it(*this), m_blocked(false) + { + AddDefaultRoute(destination); + } + ChannelSwitch(BufferedTransformation &destination, const std::string &outChannel) : m_it(*this), m_blocked(false) + { + AddDefaultRoute(destination, outChannel); + } + + void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); + + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); + size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking); + + bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true); + bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); + + byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); + + void AddDefaultRoute(BufferedTransformation &destination); + void RemoveDefaultRoute(BufferedTransformation &destination); + void AddDefaultRoute(BufferedTransformation &destination, const std::string &outChannel); + void RemoveDefaultRoute(BufferedTransformation &destination, const std::string &outChannel); + void AddRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel); + void RemoveRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel); + +private: + RouteMap m_routeMap; + DefaultRouteList m_defaultRoutes; + + ChannelRouteIterator m_it; + bool m_blocked; + + friend class ChannelRouteIterator; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/clean-vs.cmd b/external/crypto++-5.6.3/clean-vs.cmd new file mode 100644 index 000000000..0bc90de81 --- /dev/null +++ b/external/crypto++-5.6.3/clean-vs.cmd @@ -0,0 +1,48 @@ +@echo OFF +REM set THIS_DIR=%~dp0 +set THIS_DIR=. + +attrib -R -A -S -H "%THIS_DIR%\*.aps" +attrib -R -A -S -H "%THIS_DIR%\*.ncb" +attrib -R -A -S -H "%THIS_DIR%\*.suo" +attrib -R -A -S -H "%THIS_DIR%\*.sdf" +attrib -R -A -S -H "%THIS_DIR%\*.user" + +del "%THIS_DIR%\*.aps" /q +del "%THIS_DIR%\*.ncb" /q +del "%THIS_DIR%\*.suo" /q +del "%THIS_DIR%\*.sdf" /q +del "%THIS_DIR%\cryptlib.user" /q +del "%THIS_DIR%\cryptdll.user" /q +del "%THIS_DIR%\dlltest.user" /q +del "%THIS_DIR%\adhoc.cpp" /q +del "%THIS_DIR%\cryptopp.mac.done" /q +del "%THIS_DIR%\adhoc.cpp.copied" /q + +REM New Visual Studio 2005 and VC 6.0 +del "%THIS_DIR%\cryptlib.vcproj" /q +del "%THIS_DIR%\cryptest.vcproj" /q +del "%THIS_DIR%\cryptdll.vcproj" /q +del "%THIS_DIR%\dlltest.vcproj" /q +del "%THIS_DIR%\cryptopp.vcproj" /q +del "%THIS_DIR%\cryptlib.dsp" /q +del "%THIS_DIR%\cryptest.dsp" /q +del "%THIS_DIR%\cryptdll.dsp" /q +del "%THIS_DIR%\dlltest.dsp" /q +del "%THIS_DIR%\cryptest.dsw" /q + +REM Visual Studio build artifacts +rmdir /Q /S "%THIS_DIR%\Debug\" +rmdir /Q /S "%THIS_DIR%\Release\" +rmdir /Q /S "%THIS_DIR%\Win32\" +rmdir /Q /S "%THIS_DIR%\x64\" +rmdir /Q /S "%THIS_DIR%\ipch\" +rmdir /Q /S "%THIS_DIR%\.vs\" + +REM Visual Studio VCUpgrade artifacts +del "%THIS_DIR%\*.old" /q +del "%THIS_DIR%\UpgradeLog.htm" /q +del "%THIS_DIR%\UpgradeLog.XML" /q +rmdir /Q /S "%THIS_DIR%\_UpgradeReport_Files\" +rmdir /Q /S "%THIS_DIR%\Backup\" + diff --git a/external/crypto++-5.6.3/cmac.cpp b/external/crypto++-5.6.3/cmac.cpp new file mode 100644 index 000000000..62ae6c91b --- /dev/null +++ b/external/crypto++-5.6.3/cmac.cpp @@ -0,0 +1,126 @@ +// cmac.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "cmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +static void MulU(byte *k, unsigned int length) +{ + byte carry = 0; + + for (int i=length-1; i>=1; i-=2) + { + byte carry2 = k[i] >> 7; + k[i] += k[i] + carry; + carry = k[i-1] >> 7; + k[i-1] += k[i-1] + carry2; + } + + if (carry) + { + switch (length) + { + case 8: + k[7] ^= 0x1b; + break; + case 16: + k[15] ^= 0x87; + break; + case 32: + k[30] ^= 4; + k[31] ^= 0x23; + break; + default: + throw InvalidArgument("CMAC: " + IntToString(length) + " is not a supported cipher block size"); + } + } +} + +void CMAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + BlockCipher &cipher = AccessCipher(); + unsigned int blockSize = cipher.BlockSize(); + + cipher.SetKey(key, length, params); + m_reg.CleanNew(3*blockSize); + m_counter = 0; + + cipher.ProcessBlock(m_reg, m_reg+blockSize); + MulU(m_reg+blockSize, blockSize); + memcpy(m_reg+2*blockSize, m_reg+blockSize, blockSize); + MulU(m_reg+2*blockSize, blockSize); +} + +void CMAC_Base::Update(const byte *input, size_t length) +{ + assert((input && length) || !(input || length)); + if (!length) + return; + + BlockCipher &cipher = AccessCipher(); + unsigned int blockSize = cipher.BlockSize(); + + if (m_counter > 0) + { + const unsigned int len = UnsignedMin(blockSize - m_counter, length); + if (len) + { + xorbuf(m_reg+m_counter, input, len); + length -= len; + input += len; + m_counter += len; + } + + if (m_counter == blockSize && length > 0) + { + cipher.ProcessBlock(m_reg); + m_counter = 0; + } + } + + if (length > blockSize) + { + assert(m_counter == 0); + size_t leftOver = 1 + cipher.AdvancedProcessBlocks(m_reg, input, m_reg, length-1, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); + input += (length - leftOver); + length = leftOver; + } + + if (length > 0) + { + assert(m_counter + length <= blockSize); + xorbuf(m_reg+m_counter, input, length); + m_counter += (unsigned int)length; + } + + assert(m_counter > 0); +} + +void CMAC_Base::TruncatedFinal(byte *mac, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + BlockCipher &cipher = AccessCipher(); + unsigned int blockSize = cipher.BlockSize(); + + if (m_counter < blockSize) + { + m_reg[m_counter] ^= 0x80; + cipher.AdvancedProcessBlocks(m_reg, m_reg+2*blockSize, m_reg, blockSize, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); + } + else + cipher.AdvancedProcessBlocks(m_reg, m_reg+blockSize, m_reg, blockSize, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); + + memcpy(mac, m_reg, size); + + m_counter = 0; + memset(m_reg, 0, blockSize); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/cmac.h b/external/crypto++-5.6.3/cmac.h new file mode 100644 index 000000000..b7027a60d --- /dev/null +++ b/external/crypto++-5.6.3/cmac.h @@ -0,0 +1,58 @@ +// cmac.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile cmac.h +//! \brief Classes for CMAC message authentication code + +#ifndef CRYPTOPP_CMAC_H +#define CRYPTOPP_CMAC_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode +{ +public: + CMAC_Base() : m_counter(0) {} + + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *mac, size_t size); + unsigned int DigestSize() const {return GetCipher().BlockSize();} + unsigned int OptimalBlockSize() const {return GetCipher().BlockSize();} + unsigned int OptimalDataAlignment() const {return GetCipher().OptimalDataAlignment();} + +protected: + friend class EAX_Base; + + const BlockCipher & GetCipher() const {return const_cast(this)->AccessCipher();} + virtual BlockCipher & AccessCipher() =0; + + void ProcessBuf(); + SecByteBlock m_reg; + unsigned int m_counter; +}; + +/// CMAC +/*! Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32 */ +template +class CMAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs +{ +public: + CMAC() {} + CMAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH) + {this->SetKey(key, length);} + + static std::string StaticAlgorithmName() {return std::string("CMAC(") + T::StaticAlgorithmName() + ")";} + +private: + BlockCipher & AccessCipher() {return m_cipher;} + typename T::Encryption m_cipher; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/config.h b/external/crypto++-5.6.3/config.h new file mode 100644 index 000000000..8ddd11220 --- /dev/null +++ b/external/crypto++-5.6.3/config.h @@ -0,0 +1,715 @@ +// config.h - written and placed in the public domain by Wei Dai + +//! \file config.h +//! \brief Library configuration file + +#ifndef CRYPTOPP_CONFIG_H +#define CRYPTOPP_CONFIG_H + +// ***************** Important Settings ******************** + +// define this if running on a big-endian CPU +#if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__))) +# define IS_BIG_ENDIAN +#endif + +// define this if running on a little-endian CPU +// big endian will be assumed if IS_LITTLE_ENDIAN is not defined +#ifndef IS_BIG_ENDIAN +# define IS_LITTLE_ENDIAN +#endif + +// Sanity checks. Some processors have more than big-, little- and bi-endian modes. PDP mode, where order results in "4312", should +// raise red flags immediately. Additionally, mis-classified machines, like (previosuly) S/390, should raise red flags immediately. +#if defined(IS_BIG_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) +# error "IS_BIG_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_BIG_ENDIAN__" +#endif +#if defined(IS_LITTLE_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) +# error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__" +#endif + +// define this if you want to disable all OS-dependent features, +// such as sockets and OS-provided random number generators +// #define NO_OS_DEPENDENCE + +// Define this to use features provided by Microsoft's CryptoAPI. +// Currently the only feature used is random number generation. +// This macro will be ignored if NO_OS_DEPENDENCE is defined. +#define USE_MS_CRYPTOAPI + +// Define this to ensure C/C++ standard compliance and respect for GCC aliasing rules and other alignment fodder. If you +// experience a break with GCC at -O3, you should try this first. Guard it in case its set on the command line (and it differs). +#ifndef CRYPTOPP_NO_UNALIGNED_DATA_ACCESS +// # define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS +#endif + +// ***************** Less Important Settings *************** + +// Library version +#define CRYPTOPP_VERSION 563 + +// define this to retain (as much as possible) old deprecated function and class names +// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + +// define this to retain (as much as possible) ABI and binary compatibility with Crypto++ 5.6.2. +// Also see https://cryptopp.com/wiki/Config.h#Avoid_MAINTAIN_BACKWARDS_COMPATIBILITY +#if (CRYPTOPP_VERSION <= 600) +# if !defined(CRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562) && !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) +# define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +# endif +#endif + +// Define this if you want or need the library's memcpy_s and memmove_s. +// See http://github.com/weidai11/cryptopp/issues/28. +// #if !defined(CRYPTOPP_WANT_SECURE_LIB) +// # define CRYPTOPP_WANT_SECURE_LIB +// #endif + +// File system code to write to GZIP archive. +#if !defined(GZIP_OS_CODE) +# define GZIP_OS_CODE 0 +#endif + +// Try this if your CPU has 256K internal cache or a slow multiply instruction +// and you want a (possibly) faster IDEA implementation using log tables +// #define IDEA_LARGECACHE + +// Define this if, for the linear congruential RNG, you want to use +// the original constants as specified in S.K. Park and K.W. Miller's +// CACM paper. +// #define LCRNG_ORIGINAL_NUMBERS + +// choose which style of sockets to wrap (mostly useful for MinGW which has both) +#if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) +# define PREFER_BERKELEY_STYLE_SOCKETS +#endif + +// #if !defined(NO_WINDOWS_STYLE_SOCKETS) && !defined(PREFER_WINDOWS_STYLE_SOCKETS) +// # define PREFER_WINDOWS_STYLE_SOCKETS +// #endif + +// set the name of Rijndael cipher, was "Rijndael" before version 5.3 +#define CRYPTOPP_RIJNDAEL_NAME "AES" + +// CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects. +// Under GCC, the library uses init_priority attribute in the range +// [CRYPTOPP_INIT_PRIORITY, CRYPTOPP_INIT_PRIORITY+100]. Under Windows, +// CRYPTOPP_INIT_PRIORITY enlists "#pragma init_seg(lib)". +// #define CRYPTOPP_INIT_PRIORITY 250 + +// CRYPTOPP_USER_PRIORITY is for other libraries and user code that is using Crypto++ +// and managing C++ static object creation. It is guaranteed not to conflict with +// values used by (or would be used by) the Crypto++ library. +#if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) +# define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) +#else +# define CRYPTOPP_USER_PRIORITY 250 +#endif + +// ***************** Important Settings Again ******************** +// But the defaults should be ok. + +// namespace support is now required +#ifdef NO_NAMESPACE +# error namespace support is now required +#endif + +// Define this to workaround a Microsoft CryptoAPI bug where +// each call to CryptAcquireContext causes a 100 KB memory leak. +// Defining this will cause Crypto++ to make only one call to CryptAcquireContext. +// VALVE: This only applies to Windows 95 and older, we don't need it. +//#define WORKAROUND_MS_BUG_Q258000 + +#ifdef CRYPTOPP_DOXYGEN_PROCESSING +// Document the namespce exists. Put it here before CryptoPP is undefined below. +//! \namespace CryptoPP +//! \brief Crypto++ library namespace +//! \details Nearly all classes are located in the CryptoPP namespace. Within +//! the namespace, there are two additional namespaces. +//!
    +//!
  • Name - namespace for names used with \p NameValuePairs and documented in argnames.h +//!
  • Weak - namespace for weak and wounded algorithms, like ARC4, MD5 and Pananma +//!
+namespace CryptoPP { } +// Bring in the symbols fund in the weak namespace; and fold Weak1 into Weak +# define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +# define Weak1 Weak +// Avoid putting "CryptoPP::" in front of everything in Doxygen output +# define CryptoPP +# define NAMESPACE_BEGIN(x) +# define NAMESPACE_END +// Get Doxygen to generate better documentation for these typedefs +# define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; +// Make "protected" "private" so the functions and members are not documented +# define protected private +#else +# define NAMESPACE_BEGIN(x) namespace x { +# define NAMESPACE_END } +# define DOCUMENTED_TYPEDEF(x, y) typedef x y; +#endif +#define ANONYMOUS_NAMESPACE_BEGIN namespace { +#define ANONYMOUS_NAMESPACE_END } +#define USING_NAMESPACE(x) using namespace x; +#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { +#define DOCUMENTED_NAMESPACE_END } + +// What is the type of the third parameter to bind? +// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int. +// Unfortunately there is no way to tell whether or not socklen_t is defined. +// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile. +#ifndef TYPE_OF_SOCKLEN_T +# if defined(_WIN32) || defined(__CYGWIN__) +# define TYPE_OF_SOCKLEN_T int +# else +# define TYPE_OF_SOCKLEN_T ::socklen_t +# endif +#endif + +#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) +# define __USE_W32_SOCKETS +#endif + +typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs + +NAMESPACE_BEGIN(CryptoPP) + +typedef unsigned short word16; +typedef unsigned int word32; + +#if defined(_MSC_VER) || defined(__BORLANDC__) + typedef unsigned __int64 word64; + #define W64LIT(x) x##ui64 +#else + typedef unsigned long long word64; + #define W64LIT(x) x##ULL +#endif + +// define large word type, used for file offsets and such +typedef word64 lword; +const lword LWORD_MAX = W64LIT(0xffffffffffffffff); + +#ifdef __GNUC__ + #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif + +// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7 +#if defined(__clang__ ) && !defined(__apple_build_version__) + #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#elif defined(__clang__ ) && defined(__apple_build_version__) + #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#endif + +#ifdef _MSC_VER + #define CRYPTOPP_MSC_VERSION (_MSC_VER) +#endif + +// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}" +#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) + #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 +#endif + +// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 +// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes. +#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) + #define CRYPTOPP_DISABLE_INTEL_ASM 1 +#endif + +// define hword, word, and dword. these are used for multiprecision integer arithmetic +// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx +#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1000) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__)) + typedef word32 hword; + typedef word64 word; +#else + #define CRYPTOPP_NATIVE_DWORD_AVAILABLE + #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) + #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && (CRYPTOPP_GCC_VERSION >= 30400) + // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3 + // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4 + #define CRYPTOPP_WORD128_AVAILABLE + typedef word32 hword; + typedef word64 word; + typedef __uint128_t dword; + typedef __uint128_t word128; + #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) + // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. + #define CRYPTOPP_WORD128_AVAILABLE + typedef word32 hword; + typedef word64 word; + typedef __uint128_t dword; + typedef __uint128_t word128; + #else + // if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results + typedef word16 hword; + typedef word32 word; + typedef word64 dword; + #endif + #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) + // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. + #define CRYPTOPP_WORD128_AVAILABLE + typedef word32 hword; + typedef word64 word; + typedef __uint128_t dword; + typedef __uint128_t word128; + #else + // being here means the native register size is probably 32 bits or less + #define CRYPTOPP_BOOL_SLOW_WORD64 1 + typedef word16 hword; + typedef word32 word; + typedef word64 dword; + #endif +#endif +#ifndef CRYPTOPP_BOOL_SLOW_WORD64 + #define CRYPTOPP_BOOL_SLOW_WORD64 0 +#endif + +// Produce a compiler error. It can be commented out, but you may not get the benefit of the fastest integers. +#if (__SIZEOF_INT128__ >= 16) && !defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(__aarch64__) +# error "An int128_t and uint128_t are available, but CRYPTOPP_WORD128_AVAILABLE is not defined" +#endif + +const unsigned int WORD_SIZE = sizeof(word); +const unsigned int WORD_BITS = WORD_SIZE * 8; + +NAMESPACE_END + +#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE + // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks. + // Also see http://stackoverflow.com/questions/794632/programmatically-get-the-cache-line-size. + #if defined(_M_X64) || defined(__x86_64__) || (__ILP32__ >= 1) + #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 + #else + // L1 cache line size is 32 on Pentium III and earlier + #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 + #endif +#endif + +#if defined(_MSC_VER) + #if _MSC_VER == 1200 + #include + #endif + #if _MSC_VER > 1200 || defined(_mm_free) + #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later + #else + #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack + #endif +#endif + +#ifndef CRYPTOPP_ALIGN_DATA + #if defined(CRYPTOPP_MSVC6PP_OR_LATER) + #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) + #elif defined(__GNUC__) + #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) + #else + #define CRYPTOPP_ALIGN_DATA(x) + #endif +#endif + +#ifndef CRYPTOPP_SECTION_ALIGN16 +#if defined(__GNUC__) && !defined(__APPLE__) + // the alignment attribute doesn't seem to work without this section attribute when -fdata-sections is turned on + #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16"))) + #else + #define CRYPTOPP_SECTION_ALIGN16 + #endif +#endif + +#if defined(_MSC_VER) || defined(__fastcall) + #define CRYPTOPP_FASTCALL __fastcall +#else + #define CRYPTOPP_FASTCALL +#endif + +// VC60 workaround: it doesn't allow typename in some places +#if defined(_MSC_VER) && (_MSC_VER < 1300) +#define CPP_TYPENAME +#else +#define CPP_TYPENAME typename +#endif + +// VC60 workaround: can't cast unsigned __int64 to float or double +#if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER) +#define CRYPTOPP_VC6_INT64 (__int64) +#else +#define CRYPTOPP_VC6_INT64 +#endif + +#ifdef _MSC_VER +#define CRYPTOPP_NO_VTABLE __declspec(novtable) +#else +#define CRYPTOPP_NO_VTABLE +#endif + +#ifdef _MSC_VER + // 4127: conditional expression is constant + // 4231: nonstandard extension used : 'extern' before template explicit instantiation + // 4250: dominance + // 4251: member needs to have dll-interface + // 4275: base needs to have dll-interface + // 4505: unreferenced local function + // 4512: assignment operator not generated + // 4660: explicitly instantiating a class that's already implicitly instantiated + // 4661: no suitable definition provided for explicit template instantiation request + // 4786: identifer was truncated in debug information + // 4355: 'this' : used in base member initializer list + // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation +# pragma warning(disable: 4127 4231 4250 4251 4275 4505 4512 4660 4661 4786 4355 4910) + // Security related, possible defects + // http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx +# pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) +#endif + +#ifdef __BORLANDC__ +// 8037: non-const function called for const object. needed to work around BCB2006 bug +# pragma warn -8037 +#endif + +// [GCC Bug 53431] "C++ preprocessor ignores #pragma GCC diagnostic". Clang honors it. +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunknown-pragmas" +# pragma GCC diagnostic ignored "-Wunused-function" +#endif + +#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) +#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION +#endif + +#if !defined(CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION) && (defined(_MSC_VER) && _MSC_VER >= 1900) +#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION +#define CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE +#endif + +#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION +#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE +#endif + +#ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings +#define CRYPTOPP_DISABLE_ASM +#define CRYPTOPP_DISABLE_SSE2 +#endif + +// Apple's Clang prior to 5.0 cannot handle SSE2 (and Apple does not use LLVM Clang numbering...) +#if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) +# define CRYPTOPP_DISABLE_ASM +#endif + +#if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) + // C++Builder 2010 does not allow "call label" where label is defined within inline assembly + #define CRYPTOPP_X86_ASM_AVAILABLE + + #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) + #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 + #else + #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 + #endif + + // SSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed. + // GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version. Also see the output of + // `gcc -dM -E -march=native - < /dev/null | grep -i SSE` for preprocessor defines available. + #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__) || defined(__SSE3__)) + #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1 + #else + #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 + #endif +#endif + +#if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) + #define CRYPTOPP_X64_MASM_AVAILABLE +#endif + +#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) + #define CRYPTOPP_X64_ASM_AVAILABLE +#endif + +#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__)) + #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1 +#else + #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 +#endif + +#if !defined(CRYPTOPP_DISABLE_SSSE3) && !defined(CRYPTOPP_DISABLE_AESNI) && CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && (CRYPTOPP_GCC_VERSION >= 40400 || _MSC_FULL_VER >= 150030729 || __INTEL_COMPILER >= 1110 || defined(__AES__)) + #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1 +#else + #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0 +#endif + +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) + #define CRYPTOPP_BOOL_ALIGN16 1 +#else + #define CRYPTOPP_BOOL_ALIGN16 0 +#endif + +// how to allocate 16-byte aligned memory (for SSE2) +#if defined(CRYPTOPP_MSVC6PP_OR_LATER) + #define CRYPTOPP_MM_MALLOC_AVAILABLE +#elif defined(__APPLE__) + #define CRYPTOPP_APPLE_MALLOC_AVAILABLE +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 +#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) + #define CRYPTOPP_MEMALIGN_AVAILABLE +#else + #define CRYPTOPP_NO_ALIGNED_ALLOC +#endif + +// Apple always provides 16-byte aligned, and tells us to use calloc +// http://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html + +// how to disable inlining +#if defined(_MSC_VER) && _MSC_VER >= 1300 +# define CRYPTOPP_NOINLINE_DOTDOTDOT +# define CRYPTOPP_NOINLINE __declspec(noinline) +#elif defined(__GNUC__) +# define CRYPTOPP_NOINLINE_DOTDOTDOT +# define CRYPTOPP_NOINLINE __attribute__((noinline)) +#else +# define CRYPTOPP_NOINLINE_DOTDOTDOT ... +# define CRYPTOPP_NOINLINE +#endif + +// how to declare class constants +#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) +# define CRYPTOPP_CONSTANT(x) enum {x}; +#else +# define CRYPTOPP_CONSTANT(x) static const int x; +#endif + +// Linux provides X32, which is 32-bit integers, longs and pointers on x86_64 using the full x86_64 register set. +// Detect via __ILP32__ (http://wiki.debian.org/X32Port). Both GCC and Clang provide the preprocessor macro. +#if ((__ILP32__ >= 1) || (_ILP32 >= 1)) && !__i386__ + #define CRYPTOPP_BOOL_X32 1 +#else + #define CRYPTOPP_BOOL_X32 0 +#endif + +// see http://predef.sourceforge.net/prearch.html +// VALVE: Added !defined(_M_X64) because our build helpfully defines both _M_X64 and __i386__. +#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !defined(_M_X64) && !CRYPTOPP_BOOL_X32 + #define CRYPTOPP_BOOL_X86 1 +#else + #define CRYPTOPP_BOOL_X86 0 +#endif + +#if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 + #define CRYPTOPP_BOOL_X64 1 +#else + #define CRYPTOPP_BOOL_X64 0 +#endif + +// Undo the ASM and Intrinsic related defines due to X32. +#if CRYPTOPP_BOOL_X32 +# undef CRYPTOPP_BOOL_X64 +# undef CRYPTOPP_X64_ASM_AVAILABLE +# undef CRYPTOPP_X64_MASM_AVAILABLE +#endif + +#if !defined(CRYPTOPP_NO_UNALIGNED_DATA_ACCESS) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) +#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || defined(__powerpc__) || (__ARM_FEATURE_UNALIGNED >= 1)) + #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS +#endif +#endif + +// ***************** determine availability of OS features ******************** + +#ifndef NO_OS_DEPENDENCE + +#if defined(_WIN32) || defined(__CYGWIN__) +#define CRYPTOPP_WIN32_AVAILABLE +#endif + +#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) +#define CRYPTOPP_UNIX_AVAILABLE +#endif + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#define CRYPTOPP_BSD_AVAILABLE +#endif + +#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) +# define HIGHRES_TIMER_AVAILABLE +#endif + +#ifdef CRYPTOPP_UNIX_AVAILABLE +# define HAS_BERKELEY_STYLE_SOCKETS +#endif + +#ifdef CRYPTOPP_WIN32_AVAILABLE +# define HAS_WINDOWS_STYLE_SOCKETS +#endif + +#if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS)) +# define SOCKETS_AVAILABLE +#endif + +#if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) +# define USE_WINDOWS_STYLE_SOCKETS +#else +# define USE_BERKELEY_STYLE_SOCKETS +#endif + +#if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) +# define WINDOWS_PIPES_AVAILABLE +#endif + +#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI) +# define NONBLOCKING_RNG_AVAILABLE +# define OS_RNG_AVAILABLE +#endif + +#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) +# define NONBLOCKING_RNG_AVAILABLE +# define BLOCKING_RNG_AVAILABLE +# define OS_RNG_AVAILABLE +# define HAS_PTHREADS +# define THREADS_AVAILABLE +#endif + +#ifdef CRYPTOPP_WIN32_AVAILABLE +# define HAS_WINTHREADS +# define THREADS_AVAILABLE +#endif + +#endif // NO_OS_DEPENDENCE + +// ***************** DLL related ******************** + +#if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) + +#ifdef CRYPTOPP_EXPORTS +#define CRYPTOPP_IS_DLL +#define CRYPTOPP_DLL __declspec(dllexport) +#elif defined(CRYPTOPP_IMPORTS) +#define CRYPTOPP_IS_DLL +#define CRYPTOPP_DLL __declspec(dllimport) +#else +#define CRYPTOPP_DLL +#endif + +#define CRYPTOPP_API __cdecl + +#else // not CRYPTOPP_WIN32_AVAILABLE + +#define CRYPTOPP_DLL +#define CRYPTOPP_API + +#endif // CRYPTOPP_WIN32_AVAILABLE + +#if defined(__MWERKS__) +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL +#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL +#else +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL +#endif + +#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) +#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL +#else +#define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS +#endif + +#if defined(__MWERKS__) +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class +#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class +#else +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class +#endif + +#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) +#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class +#else +#define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS +#endif + +// ************** Unused variable *************** + +// Portable way to suppress warnings. +// Moved from misc.h due to circular depenedencies. +#define CRYPTOPP_UNUSED(x) ((void)x) + +// ***************** C++11 related ******************** + +// Visual Studio began at VS2010, http://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx. +// Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler +// GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html +// Clang and C++11 language features, http://clang.llvm.org/cxx_status.html +#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) +# define CRYPTOPP_CXX11 1 +#endif + +// Hack ahead. Apple's standard library does not have C++'s unique_ptr in C++11. We can't +// test for unique_ptr directly because some of the non-Apple Clangs on OS X fail the same +// way. However, modern standard libraries have , so we test for it instead. +// Thanks to Jonathan Wakely for devising the clever test for modern/ancient versions. +// TODO: test under Xcode 3, where g++ is really g++. +#if defined(__APPLE__) && defined(__clang__) +# if !(defined(__has_include) && __has_include()) +# undef CRYPTOPP_CXX11 +# endif +#endif + +// C++11 or C++14 is available +#if defined(CRYPTOPP_CXX11) + +// alignof/alignas: MS at VS2013 (19.00); GCC at 4.8; Clang at 3.3; and Intel 15.0. +#if (CRYPTOPP_MSC_VERSION >= 1900) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +#elif defined(__clang__) +# if __has_feature(cxx_alignof) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +# endif +#elif (CRYPTOPP_GCC_VERSION >= 40800) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +#endif // alignof/alignas + +// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; and Intel 14.0. +#if (CRYPTOPP_MSC_VERSION >= 1900) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +#elif defined(__clang__) +# if __has_feature(cxx_noexcept) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +# endif +#elif (CRYPTOPP_GCC_VERSION >= 40600) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +#endif // noexcept compilers + +// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; and Intel 12.1. +#if (CRYPTOPP_MSC_VERSION >= 1800) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1210) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +#elif defined(__clang__) +# if __has_feature(cxx_variadic_templates) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +# endif +#elif (CRYPTOPP_GCC_VERSION >= 40300) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +#endif // variadic templates + +// TODO: Emplacement, R-values and Move semantics +// Needed because we are catching warnings with GCC and MSC + +#endif // CRYPTOPP_CXX11 + +#if defined(CRYPTOPP_CXX11_NOEXCEPT) +# define CRYPTOPP_THROW noexcept(false) +# define CRYPTOPP_NO_THROW noexcept(true) +#else +# define CRYPTOPP_THROW +# define CRYPTOPP_NO_THROW +#endif // CRYPTOPP_CXX11_NOEXCEPT + +// OK to comment the following out, but please report it so we can fix it. +#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE) +# error "std::uncaught_exception is not available. This is likely a configuration error." +#endif + +#endif diff --git a/external/crypto++-5.6.3/config.recommend b/external/crypto++-5.6.3/config.recommend new file mode 100644 index 000000000..f30f9a26c --- /dev/null +++ b/external/crypto++-5.6.3/config.recommend @@ -0,0 +1,708 @@ +// config.h - written and placed in the public domain by Wei Dai + +//! \file config.h +//! \brief Library configuration file + +#ifndef CRYPTOPP_CONFIG_H +#define CRYPTOPP_CONFIG_H + +// ***************** Important Settings ******************** + +// define this if running on a big-endian CPU +#if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__))) +# define IS_BIG_ENDIAN +#endif + +// define this if running on a little-endian CPU +// big endian will be assumed if IS_LITTLE_ENDIAN is not defined +#ifndef IS_BIG_ENDIAN +# define IS_LITTLE_ENDIAN +#endif + +// Sanity checks. Some processors have more than big-, little- and bi-endian modes. PDP mode, where order results in "4312", should +// raise red flags immediately. Additionally, mis-classified machines, like (previosuly) S/390, should raise red flags immediately. +#if defined(IS_BIG_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) +# error "IS_BIG_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_BIG_ENDIAN__" +#endif +#if defined(IS_LITTLE_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) +# error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__" +#endif + +// define this if you want to disable all OS-dependent features, +// such as sockets and OS-provided random number generators +// #define NO_OS_DEPENDENCE + +// Define this to use features provided by Microsoft's CryptoAPI. +// Currently the only feature used is random number generation. +// This macro will be ignored if NO_OS_DEPENDENCE is defined. +#define USE_MS_CRYPTOAPI + +// Define this to ensure C/C++ standard compliance and respect for GCC aliasing rules and other alignment fodder. If you +// experience a break with GCC at -O3, you should try this first. Guard it in case its set on the command line (and it differs). +#ifndef CRYPTOPP_NO_UNALIGNED_DATA_ACCESS +# define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS +#endif + +// ***************** Less Important Settings *************** + +// Library version +#define CRYPTOPP_VERSION 563 + +// define this to retain (as much as possible) old deprecated function and class names +// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + +// define this to retain (as much as possible) ABI and binary compatibility with Crypto++ 5.6.2. +// Also see https://cryptopp.com/wiki/Config.h#Avoid_MAINTAIN_BACKWARDS_COMPATIBILITY +#if (CRYPTOPP_VERSION <= 600) +# if !defined(CRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562) && !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) +// # define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +# endif +#endif + +// Define this if you want or need the library's memcpy_s and memmove_s. +// See http://github.com/weidai11/cryptopp/issues/28. +// #if !defined(CRYPTOPP_WANT_SECURE_LIB) +// # define CRYPTOPP_WANT_SECURE_LIB +// #endif + +// File system code to write to GZIP archive. +#if !defined(GZIP_OS_CODE) +# define GZIP_OS_CODE 0 +#endif + +// Try this if your CPU has 256K internal cache or a slow multiply instruction +// and you want a (possibly) faster IDEA implementation using log tables +// #define IDEA_LARGECACHE + +// Define this if, for the linear congruential RNG, you want to use +// the original constants as specified in S.K. Park and K.W. Miller's +// CACM paper. +// #define LCRNG_ORIGINAL_NUMBERS + +// choose which style of sockets to wrap (mostly useful for MinGW which has both) +#if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) +# define PREFER_BERKELEY_STYLE_SOCKETS +#endif + +// #if !defined(NO_WINDOWS_STYLE_SOCKETS) && !defined(PREFER_WINDOWS_STYLE_SOCKETS) +// # define PREFER_WINDOWS_STYLE_SOCKETS +// #endif + +// set the name of Rijndael cipher, was "Rijndael" before version 5.3 +#define CRYPTOPP_RIJNDAEL_NAME "AES" + +// CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects. +// Under GCC, the library uses init_priority attribute in the range +// [CRYPTOPP_INIT_PRIORITY, CRYPTOPP_INIT_PRIORITY+100]. Under Windows, +// CRYPTOPP_INIT_PRIORITY enlists "#pragma init_seg(lib)". +#define CRYPTOPP_INIT_PRIORITY 250 + +// CRYPTOPP_USER_PRIORITY is for other libraries and user code that is using Crypto++ +// and managing C++ static object creation. It is guaranteed not to conflict with +// values used by (or would be used by) the Crypto++ library. +#if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) +# define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) +#else +# define CRYPTOPP_USER_PRIORITY 250 +#endif + +// ***************** Important Settings Again ******************** +// But the defaults should be ok. + +// namespace support is now required +#ifdef NO_NAMESPACE +# error namespace support is now required +#endif + +// Define this to workaround a Microsoft CryptoAPI bug where +// each call to CryptAcquireContext causes a 100 KB memory leak. +// Defining this will cause Crypto++ to make only one call to CryptAcquireContext. +#define WORKAROUND_MS_BUG_Q258000 + +#ifdef CRYPTOPP_DOXYGEN_PROCESSING +// Document the namespce exists. Put it here before CryptoPP is undefined below. +//! \namespace CryptoPP +//! \brief Crypto++ library namespace +//! \details Nearly all classes are located in the CryptoPP namespace. Within +//! the namespace, there are two additional namespaces. +//!
    +//!
  • Name - namespace for names used with \p NameValuePairs and documented in argnames.h +//!
  • Weak - namespace for weak and wounded algorithms, like ARC4, MD5 and Pananma +//!
+namespace CryptoPP { } +// Bring in the symbols fund in the weak namespace; and fold Weak1 into Weak +# define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +# define Weak1 Weak +// Avoid putting "CryptoPP::" in front of everything in Doxygen output +# define CryptoPP +# define NAMESPACE_BEGIN(x) +# define NAMESPACE_END +// Get Doxygen to generate better documentation for these typedefs +# define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; +// Make "protected" "private" so the functions and members are not documented +# define protected private +#else +# define NAMESPACE_BEGIN(x) namespace x { +# define NAMESPACE_END } +# define DOCUMENTED_TYPEDEF(x, y) typedef x y; +#endif +#define ANONYMOUS_NAMESPACE_BEGIN namespace { +#define ANONYMOUS_NAMESPACE_END } +#define USING_NAMESPACE(x) using namespace x; +#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { +#define DOCUMENTED_NAMESPACE_END } + +// What is the type of the third parameter to bind? +// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int. +// Unfortunately there is no way to tell whether or not socklen_t is defined. +// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile. +#ifndef TYPE_OF_SOCKLEN_T +# if defined(_WIN32) || defined(__CYGWIN__) +# define TYPE_OF_SOCKLEN_T int +# else +# define TYPE_OF_SOCKLEN_T ::socklen_t +# endif +#endif + +#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) +# define __USE_W32_SOCKETS +#endif + +typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs + +NAMESPACE_BEGIN(CryptoPP) + +typedef unsigned short word16; +typedef unsigned int word32; + +#if defined(_MSC_VER) || defined(__BORLANDC__) + typedef unsigned __int64 word64; + #define W64LIT(x) x##ui64 +#else + typedef unsigned long long word64; + #define W64LIT(x) x##ULL +#endif + +// define large word type, used for file offsets and such +typedef word64 lword; +const lword LWORD_MAX = W64LIT(0xffffffffffffffff); + +#ifdef __GNUC__ + #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif + +// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7 +#if defined(__clang__ ) && !defined(__apple_build_version__) + #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#elif defined(__clang__ ) && defined(__apple_build_version__) + #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#endif + +#ifdef _MSC_VER + #define CRYPTOPP_MSC_VERSION (_MSC_VER) +#endif + +// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}" +#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) + #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 +#endif + +// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 +// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes. +#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) + #define CRYPTOPP_DISABLE_INTEL_ASM 1 +#endif + +// define hword, word, and dword. these are used for multiprecision integer arithmetic +// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx +#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1000) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__)) + typedef word32 hword; + typedef word64 word; +#else + #define CRYPTOPP_NATIVE_DWORD_AVAILABLE + #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) + #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && (CRYPTOPP_GCC_VERSION >= 30400) + // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3 + // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4 + #define CRYPTOPP_WORD128_AVAILABLE + typedef word32 hword; + typedef word64 word; + typedef __uint128_t dword; + typedef __uint128_t word128; + #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) + // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. + #define CRYPTOPP_WORD128_AVAILABLE + typedef word32 hword; + typedef word64 word; + typedef __uint128_t dword; + typedef __uint128_t word128; + #else + // if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results + typedef word16 hword; + typedef word32 word; + typedef word64 dword; + #endif + #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) + // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. + #define CRYPTOPP_WORD128_AVAILABLE + typedef word32 hword; + typedef word64 word; + typedef __uint128_t dword; + typedef __uint128_t word128; + #else + // being here means the native register size is probably 32 bits or less + #define CRYPTOPP_BOOL_SLOW_WORD64 1 + typedef word16 hword; + typedef word32 word; + typedef word64 dword; + #endif +#endif +#ifndef CRYPTOPP_BOOL_SLOW_WORD64 + #define CRYPTOPP_BOOL_SLOW_WORD64 0 +#endif + +// Produce a compiler error. It can be commented out, but you may not get the benefit of the fastest integers. +#if (__SIZEOF_INT128__ >= 16) && !defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(__aarch64__) +# error "An int128_t and uint128_t are available, but CRYPTOPP_WORD128_AVAILABLE is not defined" +#endif + +const unsigned int WORD_SIZE = sizeof(word); +const unsigned int WORD_BITS = WORD_SIZE * 8; + +NAMESPACE_END + +#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE + // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks. + // Also see http://stackoverflow.com/questions/794632/programmatically-get-the-cache-line-size. + #if defined(_M_X64) || defined(__x86_64__) || (__ILP32__ >= 1) + #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 + #else + // L1 cache line size is 32 on Pentium III and earlier + #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 + #endif +#endif + +#if defined(_MSC_VER) + #if _MSC_VER == 1200 + #include + #endif + #if _MSC_VER > 1200 || defined(_mm_free) + #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later + #else + #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack + #endif +#endif + +#ifndef CRYPTOPP_ALIGN_DATA + #if defined(CRYPTOPP_MSVC6PP_OR_LATER) + #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) + #elif defined(__GNUC__) + #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) + #else + #define CRYPTOPP_ALIGN_DATA(x) + #endif +#endif + +#ifndef CRYPTOPP_SECTION_ALIGN16 +#if defined(__GNUC__) && !defined(__APPLE__) + // the alignment attribute doesn't seem to work without this section attribute when -fdata-sections is turned on + #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16"))) + #else + #define CRYPTOPP_SECTION_ALIGN16 + #endif +#endif + +#if defined(_MSC_VER) || defined(__fastcall) + #define CRYPTOPP_FASTCALL __fastcall +#else + #define CRYPTOPP_FASTCALL +#endif + +// VC60 workaround: it doesn't allow typename in some places +#if defined(_MSC_VER) && (_MSC_VER < 1300) +#define CPP_TYPENAME +#else +#define CPP_TYPENAME typename +#endif + +// VC60 workaround: can't cast unsigned __int64 to float or double +#if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER) +#define CRYPTOPP_VC6_INT64 (__int64) +#else +#define CRYPTOPP_VC6_INT64 +#endif + +#ifdef _MSC_VER +#define CRYPTOPP_NO_VTABLE __declspec(novtable) +#else +#define CRYPTOPP_NO_VTABLE +#endif + +#ifdef _MSC_VER + // 4127: conditional expression is constant + // 4231: nonstandard extension used : 'extern' before template explicit instantiation + // 4250: dominance + // 4251: member needs to have dll-interface + // 4275: base needs to have dll-interface + // 4505: unreferenced local function + // 4512: assignment operator not generated + // 4660: explicitly instantiating a class that's already implicitly instantiated + // 4661: no suitable definition provided for explicit template instantiation request + // 4786: identifer was truncated in debug information + // 4355: 'this' : used in base member initializer list + // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation +# pragma warning(disable: 4127 4231 4250 4251 4275 4505 4512 4660 4661 4786 4355 4910) + // Security related, possible defects + // http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx +# pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) +#endif + +#ifdef __BORLANDC__ +// 8037: non-const function called for const object. needed to work around BCB2006 bug +# pragma warn -8037 +#endif + +// [GCC Bug 53431] "C++ preprocessor ignores #pragma GCC diagnostic". Clang honors it. +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunknown-pragmas" +# pragma GCC diagnostic ignored "-Wunused-function" +#endif + +#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) +#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION +#endif + +#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION +#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE +#endif + +#ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings +#define CRYPTOPP_DISABLE_ASM +#define CRYPTOPP_DISABLE_SSE2 +#endif + +// Apple's Clang prior to 5.0 cannot handle SSE2 (and Apple does not use LLVM Clang numbering...) +#if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) +# define CRYPTOPP_DISABLE_ASM +#endif + +#if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) + // C++Builder 2010 does not allow "call label" where label is defined within inline assembly + #define CRYPTOPP_X86_ASM_AVAILABLE + + #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) + #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 + #else + #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 + #endif + + // SSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed. + // GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version. Also see the output of + // `gcc -dM -E -march=native - < /dev/null | grep -i SSE` for preprocessor defines available. + #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__) || defined(__SSE3__)) + #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1 + #else + #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 + #endif +#endif + +#if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) + #define CRYPTOPP_X64_MASM_AVAILABLE +#endif + +#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) + #define CRYPTOPP_X64_ASM_AVAILABLE +#endif + +#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__)) + #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1 +#else + #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 +#endif + +#if !defined(CRYPTOPP_DISABLE_SSSE3) && !defined(CRYPTOPP_DISABLE_AESNI) && CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && (CRYPTOPP_GCC_VERSION >= 40400 || _MSC_FULL_VER >= 150030729 || __INTEL_COMPILER >= 1110 || defined(__AES__)) + #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1 +#else + #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0 +#endif + +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) + #define CRYPTOPP_BOOL_ALIGN16 1 +#else + #define CRYPTOPP_BOOL_ALIGN16 0 +#endif + +// how to allocate 16-byte aligned memory (for SSE2) +#if defined(CRYPTOPP_MSVC6PP_OR_LATER) + #define CRYPTOPP_MM_MALLOC_AVAILABLE +#elif defined(__APPLE__) + #define CRYPTOPP_APPLE_MALLOC_AVAILABLE +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 +#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) + #define CRYPTOPP_MEMALIGN_AVAILABLE +#else + #define CRYPTOPP_NO_ALIGNED_ALLOC +#endif + +// Apple always provides 16-byte aligned, and tells us to use calloc +// http://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html + +// how to disable inlining +#if defined(_MSC_VER) && _MSC_VER >= 1300 +# define CRYPTOPP_NOINLINE_DOTDOTDOT +# define CRYPTOPP_NOINLINE __declspec(noinline) +#elif defined(__GNUC__) +# define CRYPTOPP_NOINLINE_DOTDOTDOT +# define CRYPTOPP_NOINLINE __attribute__((noinline)) +#else +# define CRYPTOPP_NOINLINE_DOTDOTDOT ... +# define CRYPTOPP_NOINLINE +#endif + +// how to declare class constants +#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) +# define CRYPTOPP_CONSTANT(x) enum {x}; +#else +# define CRYPTOPP_CONSTANT(x) static const int x; +#endif + +// Linux provides X32, which is 32-bit integers, longs and pointers on x86_64 using the full x86_64 register set. +// Detect via __ILP32__ (http://wiki.debian.org/X32Port). Both GCC and Clang provide the preprocessor macro. +#if ((__ILP32__ >= 1) || (_ILP32 >= 1)) + #define CRYPTOPP_BOOL_X32 1 +#else + #define CRYPTOPP_BOOL_X32 0 +#endif + +// see http://predef.sourceforge.net/prearch.html +#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !CRYPTOPP_BOOL_X32 + #define CRYPTOPP_BOOL_X86 1 +#else + #define CRYPTOPP_BOOL_X86 0 +#endif + +#if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 + #define CRYPTOPP_BOOL_X64 1 +#else + #define CRYPTOPP_BOOL_X64 0 +#endif + +// Undo the ASM and Intrinsic related defines due to X32. +#if CRYPTOPP_BOOL_X32 +# undef CRYPTOPP_BOOL_X64 +# undef CRYPTOPP_X64_ASM_AVAILABLE +# undef CRYPTOPP_X64_MASM_AVAILABLE +#endif + +#if !defined(CRYPTOPP_NO_UNALIGNED_DATA_ACCESS) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) +#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || defined(__powerpc__) || (__ARM_FEATURE_UNALIGNED >= 1)) + #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS +#endif +#endif + +// ***************** determine availability of OS features ******************** + +#ifndef NO_OS_DEPENDENCE + +#if defined(_WIN32) || defined(__CYGWIN__) +#define CRYPTOPP_WIN32_AVAILABLE +#endif + +#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) +#define CRYPTOPP_UNIX_AVAILABLE +#endif + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#define CRYPTOPP_BSD_AVAILABLE +#endif + +#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) +# define HIGHRES_TIMER_AVAILABLE +#endif + +#ifdef CRYPTOPP_UNIX_AVAILABLE +# define HAS_BERKELEY_STYLE_SOCKETS +#endif + +#ifdef CRYPTOPP_WIN32_AVAILABLE +# define HAS_WINDOWS_STYLE_SOCKETS +#endif + +#if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS)) +# define SOCKETS_AVAILABLE +#endif + +#if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) +# define USE_WINDOWS_STYLE_SOCKETS +#else +# define USE_BERKELEY_STYLE_SOCKETS +#endif + +#if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) +# define WINDOWS_PIPES_AVAILABLE +#endif + +#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI) +# define NONBLOCKING_RNG_AVAILABLE +# define OS_RNG_AVAILABLE +#endif + +#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) +# define NONBLOCKING_RNG_AVAILABLE +# define BLOCKING_RNG_AVAILABLE +# define OS_RNG_AVAILABLE +# define HAS_PTHREADS +# define THREADS_AVAILABLE +#endif + +#ifdef CRYPTOPP_WIN32_AVAILABLE +# define HAS_WINTHREADS +# define THREADS_AVAILABLE +#endif + +#endif // NO_OS_DEPENDENCE + +// ***************** DLL related ******************** + +#if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) + +#ifdef CRYPTOPP_EXPORTS +#define CRYPTOPP_IS_DLL +#define CRYPTOPP_DLL __declspec(dllexport) +#elif defined(CRYPTOPP_IMPORTS) +#define CRYPTOPP_IS_DLL +#define CRYPTOPP_DLL __declspec(dllimport) +#else +#define CRYPTOPP_DLL +#endif + +#define CRYPTOPP_API __cdecl + +#else // not CRYPTOPP_WIN32_AVAILABLE + +#define CRYPTOPP_DLL +#define CRYPTOPP_API + +#endif // CRYPTOPP_WIN32_AVAILABLE + +#if defined(__MWERKS__) +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL +#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL +#else +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL +#endif + +#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) +#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL +#else +#define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS +#endif + +#if defined(__MWERKS__) +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class +#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class +#else +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class +#endif + +#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) +#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class +#else +#define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS +#endif + +// ************** Unused variable *************** + +// Portable way to suppress warnings. +// Moved from misc.h due to circular depenedencies. +#define CRYPTOPP_UNUSED(x) ((void)x) + +// ***************** C++11 related ******************** + +// Visual Studio began at VS2010, http://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx. +// Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler +// GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html +// Clang and C++11 language features, http://clang.llvm.org/cxx_status.html +#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) +# define CRYPTOPP_CXX11 1 +#endif + +// Hack ahead. Apple's standard library does not have C++'s unique_ptr in C++11. We can't +// test for unique_ptr directly because some of the non-Apple Clangs on OS X fail the same +// way. However, modern standard libraries have , so we test for it instead. +// Thanks to Jonathan Wakely for devising the clever test for modern/ancient versions. +// TODO: test under Xcode 3, where g++ is really g++. +#if defined(__APPLE__) && defined(__clang__) +# if !(defined(__has_include) && __has_include()) +# undef CRYPTOPP_CXX11 +# endif +#endif + +// C++11 or C++14 is available +#if defined(CRYPTOPP_CXX11) + +// alignof/alignas: MS at VS2013 (19.00); GCC at 4.8; Clang at 3.3; and Intel 15.0. +#if (CRYPTOPP_MSC_VERSION >= 1900) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +#elif defined(__clang__) +# if __has_feature(cxx_alignof) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +# endif +#elif (CRYPTOPP_GCC_VERSION >= 40800) +# define CRYPTOPP_CXX11_ALIGNAS 1 +# define CRYPTOPP_CXX11_ALIGNOF 1 +#endif // alignof/alignas + +// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; and Intel 14.0. +#if (CRYPTOPP_MSC_VERSION >= 1900) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +#elif defined(__clang__) +# if __has_feature(cxx_noexcept) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +# endif +#elif (CRYPTOPP_GCC_VERSION >= 40600) +# define CRYPTOPP_CXX11_NOEXCEPT 1 +#endif // noexcept compilers + +// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; and Intel 12.1. +#if (CRYPTOPP_MSC_VERSION >= 1800) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1210) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +#elif defined(__clang__) +# if __has_feature(cxx_variadic_templates) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +# endif +#elif (CRYPTOPP_GCC_VERSION >= 40300) +# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 +#endif // variadic templates + +// TODO: Emplacement, R-values and Move semantics +// Needed because we are catching warnings with GCC and MSC + +#endif // CRYPTOPP_CXX11 + +#if defined(CRYPTOPP_CXX11_NOEXCEPT) +# define CRYPTOPP_THROW noexcept(false) +# define CRYPTOPP_NO_THROW noexcept(true) +#else +# define CRYPTOPP_THROW +# define CRYPTOPP_NO_THROW +#endif // CRYPTOPP_CXX11_NOEXCEPT + +// OK to comment the following out, but please report it so we can fix it. +#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) +# error "std::uncaught_exception is not available. This is likely a configuration error." +#endif + +#endif diff --git a/external/crypto++-5.6.3/cpu.cpp b/external/crypto++-5.6.3/cpu.cpp new file mode 100644 index 000000000..9219e44ad --- /dev/null +++ b/external/crypto++-5.6.3/cpu.cpp @@ -0,0 +1,268 @@ +// cpu.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#ifndef EXCEPTION_EXECUTE_HANDLER +# define EXCEPTION_EXECUTE_HANDLER 1 +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "cpu.h" +#include "misc.h" +#include + +#ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY +#include +#include +#endif + +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE +#include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#ifdef CRYPTOPP_CPUID_AVAILABLE + +#if _MSC_VER >= 1400 && CRYPTOPP_BOOL_X64 + +bool CpuId(word32 input, word32 output[4]) +{ + __cpuid((int *)output, input); + return true; +} + +#elif defined(__APPLE__) // VALVE edit for cpuid intrinsic on OSX + +#include +bool CpuId(word32 input, word32 output[4]) +{ + __cpuid( input, output[0], output[1], output[2], output[3] ); + return true; +} + +#else + +#ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY +extern "C" { +typedef void (*SigHandler)(int); + +static jmp_buf s_jmpNoCPUID; +static void SigIllHandlerCPUID(int) +{ + longjmp(s_jmpNoCPUID, 1); +} + +static jmp_buf s_jmpNoSSE2; +static void SigIllHandlerSSE2(int) +{ + longjmp(s_jmpNoSSE2, 1); +} +} +#endif + +bool CpuId(word32 input, word32 output[4]) +{ +#if defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) + __try + { + __asm + { + mov eax, input + mov ecx, 0 + cpuid + mov edi, output + mov [edi], eax + mov [edi+4], ebx + mov [edi+8], ecx + mov [edi+12], edx + } + } + // GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION + __except (EXCEPTION_EXECUTE_HANDLER) + { + return false; + } + + // function 0 returns the highest basic function understood in EAX + if(input == 0) + return !!output[0]; + + return true; +#else + // longjmp and clobber warnings. Volatile is required. + // http://github.com/weidai11/cryptopp/issues/24 + // http://stackoverflow.com/q/7721854 + volatile bool result = true; + + SigHandler oldHandler = signal(SIGILL, SigIllHandlerCPUID); + if (oldHandler == SIG_ERR) + result = false; + + if (setjmp(s_jmpNoCPUID)) + result = false; + else + { + asm volatile + ( + // save ebx in case -fPIC is being used + // TODO: this might need an early clobber on EDI. +# if CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 + "pushq %%rbx; cpuid; mov %%ebx, %%edi; popq %%rbx" +# else + "push %%ebx; cpuid; mov %%ebx, %%edi; pop %%ebx" +# endif + : "=a" (output[0]), "=D" (output[1]), "=c" (output[2]), "=d" (output[3]) + : "a" (input), "c" (0) + ); + } + + signal(SIGILL, oldHandler); + return result; +#endif +} + +#endif + +static bool TrySSE2() +{ +#if CRYPTOPP_BOOL_X64 + return true; +#elif defined(__APPLE__) // VALVE edit - assume SSE2 on Mac targets + return true; +#elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) + __try + { +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + AS2(por xmm0, xmm0) // executing SSE2 instruction +#elif CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE + __m128i x = _mm_setzero_si128(); + return _mm_cvtsi128_si32(x) == 0; +#endif + } + // GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION + __except (EXCEPTION_EXECUTE_HANDLER) + { + return false; + } + return true; +#else + // longjmp and clobber warnings. Volatile is required. + // http://github.com/weidai11/cryptopp/issues/24 + // http://stackoverflow.com/q/7721854 + volatile bool result = true; + + SigHandler oldHandler = signal(SIGILL, SigIllHandlerSSE2); + if (oldHandler == SIG_ERR) + return false; + + if (setjmp(s_jmpNoSSE2)) + result = true; + else + { +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + __asm __volatile ("por %xmm0, %xmm0"); +#elif CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE + __m128i x = _mm_setzero_si128(); + result = _mm_cvtsi128_si32(x) == 0; +#endif + } + + signal(SIGILL, oldHandler); + return result; +#endif +} + +bool g_x86DetectionDone = false; +bool g_hasMMX = false, g_hasISSE = false, g_hasSSE2 = false, g_hasSSSE3 = false, g_hasAESNI = false, g_hasCLMUL = false, g_isP4 = false, g_hasRDRAND = false, g_hasRDSEED = false; +word32 g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE; + +// MacPorts/GCC does not provide constructor(priority). Apple/GCC and Fink/GCC do provide it. +#define HAVE_GCC_CONSTRUCTOR1 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && ((CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 300)) && !(MACPORTS_GCC_COMPILER > 0)) +#define HAVE_GCC_CONSTRUCTOR0 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0)) + +static inline bool IsIntel(const word32 output[4]) +{ + // This is the "GenuineIntel" string + return (output[1] /*EBX*/ == 0x756e6547) && + (output[2] /*ECX*/ == 0x6c65746e) && + (output[3] /*EDX*/ == 0x49656e69); +} + +static inline bool IsAMD(const word32 output[4]) +{ + // This is the "AuthenticAMD" string + return (output[1] /*EBX*/ == 0x68747541) && + (output[2] /*ECX*/ == 0x69746E65) && + (output[3] /*EDX*/ == 0x444D4163); +} + +#if HAVE_GCC_CONSTRUCTOR1 +void __attribute__ ((constructor (CRYPTOPP_INIT_PRIORITY + 50))) DetectX86Features() +#elif HAVE_GCC_CONSTRUCTOR0 +void __attribute__ ((constructor)) DetectX86Features() +#else +void DetectX86Features() +#endif +{ + word32 cpuid[4], cpuid1[4]; + if (!CpuId(0, cpuid)) + return; + if (!CpuId(1, cpuid1)) + return; + + g_hasMMX = (cpuid1[3] & (1 << 23)) != 0; + if ((cpuid1[3] & (1 << 26)) != 0) + g_hasSSE2 = TrySSE2(); + g_hasSSSE3 = g_hasSSE2 && (cpuid1[2] & (1<<9)); + g_hasAESNI = g_hasSSE2 && (cpuid1[2] & (1<<25)); + g_hasCLMUL = g_hasSSE2 && (cpuid1[2] & (1<<1)); + + if ((cpuid1[3] & (1 << 25)) != 0) + g_hasISSE = true; + else + { + word32 cpuid2[4]; + CpuId(0x080000000, cpuid2); + if (cpuid2[0] >= 0x080000001) + { + CpuId(0x080000001, cpuid2); + g_hasISSE = (cpuid2[3] & (1 << 22)) != 0; + } + } + + static const unsigned int RDRAND_FLAG = (1 << 30); + static const unsigned int RDSEED_FLAG = (1 << 18); + if (IsIntel(cpuid)) + { + g_isP4 = ((cpuid1[0] >> 8) & 0xf) == 0xf; + g_cacheLineSize = 8 * GETBYTE(cpuid1[1], 1); + g_hasRDRAND = !!(cpuid1[2] /*ECX*/ & RDRAND_FLAG); + + if (cpuid[0] /*EAX*/ >= 7) + { + word32 cpuid3[4]; + if (CpuId(7, cpuid3)) + g_hasRDSEED = !!(cpuid3[1] /*EBX*/ & RDSEED_FLAG); + } + } + else if (IsAMD(cpuid)) + { + CpuId(0x80000005, cpuid); + g_cacheLineSize = GETBYTE(cpuid[2], 0); + g_hasRDRAND = !!(cpuid[2] /*ECX*/ & RDRAND_FLAG); + } + + if (!g_cacheLineSize) + g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE; + + *((volatile bool*)&g_x86DetectionDone) = true; +} + +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/cpu.h b/external/crypto++-5.6.3/cpu.h new file mode 100644 index 000000000..a9c0139dc --- /dev/null +++ b/external/crypto++-5.6.3/cpu.h @@ -0,0 +1,413 @@ +// cpu.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile cpu.h +//! \brief Classes, functions, intrinsics and features for X86, X32 nd X64 assembly + +#ifndef CRYPTOPP_CPU_H +#define CRYPTOPP_CPU_H + +#include "config.h" + +#ifdef CRYPTOPP_GENERATE_X64_MASM + +#define CRYPTOPP_X86_ASM_AVAILABLE +#define CRYPTOPP_BOOL_X64 1 +#define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 +#define NAMESPACE_END + +#else + +# if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE +# include +# endif + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE +#if !defined(__GNUC__) || defined(__SSSE3__) || defined(__INTEL_COMPILER) +#include +#else +NAMESPACE_BEGIN(CryptoPP) +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_epi8 (__m128i a, __m128i b) +{ + asm ("pshufb %1, %0" : "+x"(a) : "xm"(b)); + return a; +} +NAMESPACE_END +#endif // tmmintrin.h +#if !defined(__GNUC__) || defined(__SSE4_1__) || defined(__INTEL_COMPILER) +#include +#else +NAMESPACE_BEGIN(CryptoPP) +__inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_epi32 (__m128i a, const int i) +{ + int r; + asm ("pextrd %2, %1, %0" : "=rm"(r) : "x"(a), "i"(i)); + return r; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_epi32 (__m128i a, int b, const int i) +{ + asm ("pinsrd %2, %1, %0" : "+x"(a) : "rm"(b), "i"(i)); + return a; +} +NAMESPACE_END +#endif // smmintrin.h +#if !defined(__GNUC__) || (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) +#include +#else +NAMESPACE_BEGIN(CryptoPP) +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_clmulepi64_si128 (__m128i a, __m128i b, const int i) +{ + asm ("pclmulqdq %2, %1, %0" : "+x"(a) : "xm"(b), "i"(i)); + return a; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_aeskeygenassist_si128 (__m128i a, const int i) +{ + __m128i r; + asm ("aeskeygenassist %2, %1, %0" : "=x"(r) : "xm"(a), "i"(i)); + return r; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_aesimc_si128 (__m128i a) +{ + __m128i r; + asm ("aesimc %1, %0" : "=x"(r) : "xm"(a)); + return r; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_aesenc_si128 (__m128i a, __m128i b) +{ + asm ("aesenc %1, %0" : "+x"(a) : "xm"(b)); + return a; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_aesenclast_si128 (__m128i a, __m128i b) +{ + asm ("aesenclast %1, %0" : "+x"(a) : "xm"(b)); + return a; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_aesdec_si128 (__m128i a, __m128i b) +{ + asm ("aesdec %1, %0" : "+x"(a) : "xm"(b)); + return a; +} +__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_aesdeclast_si128 (__m128i a, __m128i b) +{ + asm ("aesdeclast %1, %0" : "+x"(a) : "xm"(b)); + return a; +} +NAMESPACE_END +#endif // wmmintrin.h +#endif // CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + +NAMESPACE_BEGIN(CryptoPP) + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 + +#define CRYPTOPP_CPUID_AVAILABLE + +// these should not be used directly +extern CRYPTOPP_DLL bool g_x86DetectionDone; +extern CRYPTOPP_DLL bool g_hasMMX; +extern CRYPTOPP_DLL bool g_hasISSE; +extern CRYPTOPP_DLL bool g_hasSSE2; +extern CRYPTOPP_DLL bool g_hasSSSE3; +extern CRYPTOPP_DLL bool g_hasAESNI; +extern CRYPTOPP_DLL bool g_hasCLMUL; +extern CRYPTOPP_DLL bool g_isP4; +extern CRYPTOPP_DLL bool g_hasRDRAND; +extern CRYPTOPP_DLL bool g_hasRDSEED; +extern CRYPTOPP_DLL word32 g_cacheLineSize; + +CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features(); +CRYPTOPP_DLL bool CRYPTOPP_API CpuId(word32 input, word32 output[4]); + +inline bool HasMMX() +{ +#if CRYPTOPP_BOOL_X64 + return true; +#else + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasMMX; +#endif +} + +inline bool HasISSE() +{ +#if CRYPTOPP_BOOL_X64 + return true; +#else + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasISSE; +#endif +} + +inline bool HasSSE2() +{ +#if CRYPTOPP_BOOL_X64 + return true; +#else + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasSSE2; +#endif +} + +inline bool HasSSSE3() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasSSSE3; +} + +inline bool HasAESNI() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasAESNI; +} + +inline bool HasCLMUL() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasCLMUL; +} + +inline bool IsP4() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_isP4; +} + +inline bool HasRDRAND() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasRDRAND; +} + +inline bool HasRDSEED() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_hasRDSEED; +} + +inline int GetCacheLineSize() +{ + if (!g_x86DetectionDone) + DetectX86Features(); + return g_cacheLineSize; +} + +#else + +inline int GetCacheLineSize() +{ + return CRYPTOPP_L1_CACHE_LINE_SIZE; +} + +#endif + +#endif + +#ifdef CRYPTOPP_GENERATE_X64_MASM + #define AS1(x) x*newline* + #define AS2(x, y) x, y*newline* + #define AS3(x, y, z) x, y, z*newline* + #define ASS(x, y, a, b, c, d) x, y, a*64+b*16+c*4+d*newline* + #define ASL(x) label##x:*newline* + #define ASJ(x, y, z) x label##y*newline* + #define ASC(x, y) x label##y*newline* + #define AS_HEX(y) 0##y##h +#elif defined(_MSC_VER) || defined(__BORLANDC__) + #define CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY + #define AS1(x) __asm {x} + #define AS2(x, y) __asm {x, y} + #define AS3(x, y, z) __asm {x, y, z} + #define ASS(x, y, a, b, c, d) __asm {x, y, (a)*64+(b)*16+(c)*4+(d)} + #define ASL(x) __asm {label##x:} + #define ASJ(x, y, z) __asm {x label##y} + #define ASC(x, y) __asm {x label##y} + #define CRYPTOPP_NAKED __declspec(naked) + #define AS_HEX(y) 0x##y +#else + #define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY + +#if defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) + #define NEW_LINE "\n" + #define INTEL_PREFIX ".intel_syntax;" + #define INTEL_NOPREFIX ".intel_syntax;" + #define ATT_PREFIX ".att_syntax;" + #define ATT_NOPREFIX ".att_syntax;" +#else + #define NEW_LINE + #define INTEL_PREFIX ".intel_syntax prefix;" + #define INTEL_NOPREFIX ".intel_syntax noprefix;" + #define ATT_PREFIX ".att_syntax prefix;" + #define ATT_NOPREFIX ".att_syntax noprefix;" +#endif + + // define these in two steps to allow arguments to be expanded + #define GNU_AS1(x) #x ";" NEW_LINE + #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE + #define GNU_AS3(x, y, z) #x ", " #y ", " #z ";" NEW_LINE + #define GNU_ASL(x) "\n" #x ":" NEW_LINE + #define GNU_ASJ(x, y, z) #x " " #y #z ";" NEW_LINE + #define AS1(x) GNU_AS1(x) + #define AS2(x, y) GNU_AS2(x, y) + #define AS3(x, y, z) GNU_AS3(x, y, z) + #define ASS(x, y, a, b, c, d) #x ", " #y ", " #a "*64+" #b "*16+" #c "*4+" #d ";" + #define ASL(x) GNU_ASL(x) + #define ASJ(x, y, z) GNU_ASJ(x, y, z) + #define ASC(x, y) #x " " #y ";" + #define CRYPTOPP_NAKED + #define AS_HEX(y) 0x##y +#endif + +#define IF0(y) +#define IF1(y) y + +#ifdef CRYPTOPP_GENERATE_X64_MASM +#define ASM_MOD(x, y) ((x) MOD (y)) +#define XMMWORD_PTR XMMWORD PTR +#else +// GNU assembler doesn't seem to have mod operator +#define ASM_MOD(x, y) ((x)-((x)/(y))*(y)) +// GAS 2.15 doesn't support XMMWORD PTR. it seems necessary only for MASM +#define XMMWORD_PTR +#endif + +#if CRYPTOPP_BOOL_X86 + #define AS_REG_1 ecx + #define AS_REG_2 edx + #define AS_REG_3 esi + #define AS_REG_4 edi + #define AS_REG_5 eax + #define AS_REG_6 ebx + #define AS_REG_7 ebp + #define AS_REG_1d ecx + #define AS_REG_2d edx + #define AS_REG_3d esi + #define AS_REG_4d edi + #define AS_REG_5d eax + #define AS_REG_6d ebx + #define AS_REG_7d ebp + #define WORD_SZ 4 + #define WORD_REG(x) e##x + #define WORD_PTR DWORD PTR + #define AS_PUSH_IF86(x) AS1(push e##x) + #define AS_POP_IF86(x) AS1(pop e##x) + #define AS_JCXZ jecxz +#elif CRYPTOPP_BOOL_X32 + #define AS_REG_1 ecx + #define AS_REG_2 edx + #define AS_REG_3 r8d + #define AS_REG_4 r9d + #define AS_REG_5 eax + #define AS_REG_6 r10d + #define AS_REG_7 r11d + #define AS_REG_1d ecx + #define AS_REG_2d edx + #define AS_REG_3d r8d + #define AS_REG_4d r9d + #define AS_REG_5d eax + #define AS_REG_6d r10d + #define AS_REG_7d r11d + #define WORD_SZ 4 + #define WORD_REG(x) e##x + #define WORD_PTR DWORD PTR + #define AS_PUSH_IF86(x) AS1(push r##x) + #define AS_POP_IF86(x) AS1(pop r##x) + #define AS_JCXZ jecxz +#elif CRYPTOPP_BOOL_X64 + #ifdef CRYPTOPP_GENERATE_X64_MASM + #define AS_REG_1 rcx + #define AS_REG_2 rdx + #define AS_REG_3 r8 + #define AS_REG_4 r9 + #define AS_REG_5 rax + #define AS_REG_6 r10 + #define AS_REG_7 r11 + #define AS_REG_1d ecx + #define AS_REG_2d edx + #define AS_REG_3d r8d + #define AS_REG_4d r9d + #define AS_REG_5d eax + #define AS_REG_6d r10d + #define AS_REG_7d r11d + #else + #define AS_REG_1 rdi + #define AS_REG_2 rsi + #define AS_REG_3 rdx + #define AS_REG_4 rcx + #define AS_REG_5 r8 + #define AS_REG_6 r9 + #define AS_REG_7 r10 + #define AS_REG_1d edi + #define AS_REG_2d esi + #define AS_REG_3d edx + #define AS_REG_4d ecx + #define AS_REG_5d r8d + #define AS_REG_6d r9d + #define AS_REG_7d r10d + #endif + #define WORD_SZ 8 + #define WORD_REG(x) r##x + #define WORD_PTR QWORD PTR + #define AS_PUSH_IF86(x) + #define AS_POP_IF86(x) + #define AS_JCXZ jrcxz +#endif + +// helper macro for stream cipher output +#define AS_XMM_OUTPUT4(labelPrefix, inputPtr, outputPtr, x0, x1, x2, x3, t, p0, p1, p2, p3, increment)\ + AS2( test inputPtr, inputPtr)\ + ASC( jz, labelPrefix##3)\ + AS2( test inputPtr, 15)\ + ASC( jnz, labelPrefix##7)\ + AS2( pxor xmm##x0, [inputPtr+p0*16])\ + AS2( pxor xmm##x1, [inputPtr+p1*16])\ + AS2( pxor xmm##x2, [inputPtr+p2*16])\ + AS2( pxor xmm##x3, [inputPtr+p3*16])\ + AS2( add inputPtr, increment*16)\ + ASC( jmp, labelPrefix##3)\ + ASL(labelPrefix##7)\ + AS2( movdqu xmm##t, [inputPtr+p0*16])\ + AS2( pxor xmm##x0, xmm##t)\ + AS2( movdqu xmm##t, [inputPtr+p1*16])\ + AS2( pxor xmm##x1, xmm##t)\ + AS2( movdqu xmm##t, [inputPtr+p2*16])\ + AS2( pxor xmm##x2, xmm##t)\ + AS2( movdqu xmm##t, [inputPtr+p3*16])\ + AS2( pxor xmm##x3, xmm##t)\ + AS2( add inputPtr, increment*16)\ + ASL(labelPrefix##3)\ + AS2( test outputPtr, 15)\ + ASC( jnz, labelPrefix##8)\ + AS2( movdqa [outputPtr+p0*16], xmm##x0)\ + AS2( movdqa [outputPtr+p1*16], xmm##x1)\ + AS2( movdqa [outputPtr+p2*16], xmm##x2)\ + AS2( movdqa [outputPtr+p3*16], xmm##x3)\ + ASC( jmp, labelPrefix##9)\ + ASL(labelPrefix##8)\ + AS2( movdqu [outputPtr+p0*16], xmm##x0)\ + AS2( movdqu [outputPtr+p1*16], xmm##x1)\ + AS2( movdqu [outputPtr+p2*16], xmm##x2)\ + AS2( movdqu [outputPtr+p3*16], xmm##x3)\ + ASL(labelPrefix##9)\ + AS2( add outputPtr, increment*16) + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/crc.cpp b/external/crypto++-5.6.3/crc.cpp new file mode 100644 index 000000000..10c25c257 --- /dev/null +++ b/external/crypto++-5.6.3/crc.cpp @@ -0,0 +1,160 @@ +// crc.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "crc.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +/* Table of CRC-32's of all single byte values (made by makecrc.c) */ +const word32 CRC32::m_tab[] = { +#ifdef IS_LITTLE_ENDIAN + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +#else + 0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L, + 0x8ff46a70L, 0x35a563e9L, 0xa395649eL, 0x3288db0eL, 0xa4b8dc79L, + 0x1ee9d5e0L, 0x88d9d297L, 0x2b4cb609L, 0xbd7cb17eL, 0x072db8e7L, + 0x911dbf90L, 0x6410b71dL, 0xf220b06aL, 0x4871b9f3L, 0xde41be84L, + 0x7dd4da1aL, 0xebe4dd6dL, 0x51b5d4f4L, 0xc785d383L, 0x56986c13L, + 0xc0a86b64L, 0x7af962fdL, 0xecc9658aL, 0x4f5c0114L, 0xd96c0663L, + 0x633d0ffaL, 0xf50d088dL, 0xc8206e3bL, 0x5e10694cL, 0xe44160d5L, + 0x727167a2L, 0xd1e4033cL, 0x47d4044bL, 0xfd850dd2L, 0x6bb50aa5L, + 0xfaa8b535L, 0x6c98b242L, 0xd6c9bbdbL, 0x40f9bcacL, 0xe36cd832L, + 0x755cdf45L, 0xcf0dd6dcL, 0x593dd1abL, 0xac30d926L, 0x3a00de51L, + 0x8051d7c8L, 0x1661d0bfL, 0xb5f4b421L, 0x23c4b356L, 0x9995bacfL, + 0x0fa5bdb8L, 0x9eb80228L, 0x0888055fL, 0xb2d90cc6L, 0x24e90bb1L, + 0x877c6f2fL, 0x114c6858L, 0xab1d61c1L, 0x3d2d66b6L, 0x9041dc76L, + 0x0671db01L, 0xbc20d298L, 0x2a10d5efL, 0x8985b171L, 0x1fb5b606L, + 0xa5e4bf9fL, 0x33d4b8e8L, 0xa2c90778L, 0x34f9000fL, 0x8ea80996L, + 0x18980ee1L, 0xbb0d6a7fL, 0x2d3d6d08L, 0x976c6491L, 0x015c63e6L, + 0xf4516b6bL, 0x62616c1cL, 0xd8306585L, 0x4e0062f2L, 0xed95066cL, + 0x7ba5011bL, 0xc1f40882L, 0x57c40ff5L, 0xc6d9b065L, 0x50e9b712L, + 0xeab8be8bL, 0x7c88b9fcL, 0xdf1ddd62L, 0x492dda15L, 0xf37cd38cL, + 0x654cd4fbL, 0x5861b24dL, 0xce51b53aL, 0x7400bca3L, 0xe230bbd4L, + 0x41a5df4aL, 0xd795d83dL, 0x6dc4d1a4L, 0xfbf4d6d3L, 0x6ae96943L, + 0xfcd96e34L, 0x468867adL, 0xd0b860daL, 0x732d0444L, 0xe51d0333L, + 0x5f4c0aaaL, 0xc97c0dddL, 0x3c710550L, 0xaa410227L, 0x10100bbeL, + 0x86200cc9L, 0x25b56857L, 0xb3856f20L, 0x09d466b9L, 0x9fe461ceL, + 0x0ef9de5eL, 0x98c9d929L, 0x2298d0b0L, 0xb4a8d7c7L, 0x173db359L, + 0x810db42eL, 0x3b5cbdb7L, 0xad6cbac0L, 0x2083b8edL, 0xb6b3bf9aL, + 0x0ce2b603L, 0x9ad2b174L, 0x3947d5eaL, 0xaf77d29dL, 0x1526db04L, + 0x8316dc73L, 0x120b63e3L, 0x843b6494L, 0x3e6a6d0dL, 0xa85a6a7aL, + 0x0bcf0ee4L, 0x9dff0993L, 0x27ae000aL, 0xb19e077dL, 0x44930ff0L, + 0xd2a30887L, 0x68f2011eL, 0xfec20669L, 0x5d5762f7L, 0xcb676580L, + 0x71366c19L, 0xe7066b6eL, 0x761bd4feL, 0xe02bd389L, 0x5a7ada10L, + 0xcc4add67L, 0x6fdfb9f9L, 0xf9efbe8eL, 0x43beb717L, 0xd58eb060L, + 0xe8a3d6d6L, 0x7e93d1a1L, 0xc4c2d838L, 0x52f2df4fL, 0xf167bbd1L, + 0x6757bca6L, 0xdd06b53fL, 0x4b36b248L, 0xda2b0dd8L, 0x4c1b0aafL, + 0xf64a0336L, 0x607a0441L, 0xc3ef60dfL, 0x55df67a8L, 0xef8e6e31L, + 0x79be6946L, 0x8cb361cbL, 0x1a8366bcL, 0xa0d26f25L, 0x36e26852L, + 0x95770cccL, 0x03470bbbL, 0xb9160222L, 0x2f260555L, 0xbe3bbac5L, + 0x280bbdb2L, 0x925ab42bL, 0x046ab35cL, 0xa7ffd7c2L, 0x31cfd0b5L, + 0x8b9ed92cL, 0x1daede5bL, 0xb0c2649bL, 0x26f263ecL, 0x9ca36a75L, + 0x0a936d02L, 0xa906099cL, 0x3f360eebL, 0x85670772L, 0x13570005L, + 0x824abf95L, 0x147ab8e2L, 0xae2bb17bL, 0x381bb60cL, 0x9b8ed292L, + 0x0dbed5e5L, 0xb7efdc7cL, 0x21dfdb0bL, 0xd4d2d386L, 0x42e2d4f1L, + 0xf8b3dd68L, 0x6e83da1fL, 0xcd16be81L, 0x5b26b9f6L, 0xe177b06fL, + 0x7747b718L, 0xe65a0888L, 0x706a0fffL, 0xca3b0666L, 0x5c0b0111L, + 0xff9e658fL, 0x69ae62f8L, 0xd3ff6b61L, 0x45cf6c16L, 0x78e20aa0L, + 0xeed20dd7L, 0x5483044eL, 0xc2b30339L, 0x612667a7L, 0xf71660d0L, + 0x4d476949L, 0xdb776e3eL, 0x4a6ad1aeL, 0xdc5ad6d9L, 0x660bdf40L, + 0xf03bd837L, 0x53aebca9L, 0xc59ebbdeL, 0x7fcfb247L, 0xe9ffb530L, + 0x1cf2bdbdL, 0x8ac2bacaL, 0x3093b353L, 0xa6a3b424L, 0x0536d0baL, + 0x9306d7cdL, 0x2957de54L, 0xbf67d923L, 0x2e7a66b3L, 0xb84a61c4L, + 0x021b685dL, 0x942b6f2aL, 0x37be0bb4L, 0xa18e0cc3L, 0x1bdf055aL, + 0x8def022dL +#endif +}; + +CRC32::CRC32() +{ + Reset(); +} + +void CRC32::Update(const byte *s, size_t n) +{ + word32 crc = m_crc; + + for(; !IsAligned(s) && n > 0; n--) + crc = m_tab[CRC32_INDEX(crc) ^ *s++] ^ CRC32_SHIFTED(crc); + + while (n >= 4) + { + crc ^= *(const word32 *)s; + crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); + crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); + crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); + crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); + n -= 4; + s += 4; + } + + while (n--) + crc = m_tab[CRC32_INDEX(crc) ^ *s++] ^ CRC32_SHIFTED(crc); + + m_crc = crc; +} + +void CRC32::TruncatedFinal(byte *hash, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + m_crc ^= CRC32_NEGL; + for (size_t i=0; i> 8) +#else +#define CRC32_INDEX(c) (c >> 24) +#define CRC32_SHIFTED(c) (c << 8) +#endif + +//! CRC Checksum Calculation +class CRC32 : public HashTransformation +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 4) + CRC32(); + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *hash, size_t size); + unsigned int DigestSize() const {return DIGESTSIZE;} + static const char * StaticAlgorithmName() {return "CRC32";} + std::string AlgorithmName() const {return StaticAlgorithmName();} + + void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);} + byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];} + +private: + void Reset() {m_crc = CRC32_NEGL;} + + static const word32 m_tab[256]; + word32 m_crc; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/cryptdll.dsp b/external/crypto++-5.6.3/cryptdll.dsp new file mode 100644 index 000000000..868241421 --- /dev/null +++ b/external/crypto++-5.6.3/cryptdll.dsp @@ -0,0 +1,606 @@ +# Microsoft Developer Studio Project File - Name="cryptdll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=cryptdll - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "cryptdll.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "cryptdll.mak" CFG="cryptdll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "cryptdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "cryptdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "cryptdll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "cryptdll___Win32_Release" +# PROP BASE Intermediate_Dir "cryptdll___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "DLL_Release" +# PROP Intermediate_Dir "DLL_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTDLL_EXPORTS" /YX /FD /c +# ADD CPP /nologo /G5 /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTOPP_EXPORTS" /D CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1 /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /Zm200 /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /dll /machine:I386 +# ADD LINK32 advapi32.lib /nologo /base:"0x42900000" /dll /map /debug /machine:I386 /out:"DLL_Release/cryptopp.dll" /opt:ref +# SUBTRACT LINK32 /pdb:none +# Begin Custom Build +OutDir=.\DLL_Release +TargetPath=.\DLL_Release\cryptopp.dll +InputPath=.\DLL_Release\cryptopp.dll +SOURCE="$(InputPath)" + +"$(OutDir)\cryptopp.mac.done" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + CTRelease\cryptest mac_dll $(TargetPath) + echo mac done > $(OutDir)\cryptopp.mac.done + +# End Custom Build + +!ELSEIF "$(CFG)" == "cryptdll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "cryptdll___Win32_Debug" +# PROP BASE Intermediate_Dir "cryptdll___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DLL_Debug" +# PROP Intermediate_Dir "DLL_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTDLL_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /G5 /MTd /W3 /Gm /GR /GX /Zi /Oi /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTOPP_EXPORTS" /D CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1 /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /GZ /Zm200 /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 advapi32.lib /nologo /base:"0x42900000" /dll /incremental:no /debug /machine:I386 /out:"DLL_Debug/cryptopp.dll" /opt:ref +# SUBTRACT LINK32 /pdb:none +# Begin Custom Build +OutDir=.\DLL_Debug +TargetPath=.\DLL_Debug\cryptopp.dll +InputPath=.\DLL_Debug\cryptopp.dll +SOURCE="$(InputPath)" + +"$(OutDir)\cryptopp.mac.done" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + CTDebug\cryptest mac_dll $(TargetPath) + echo mac done > $(OutDir)\cryptopp.mac.done + +# End Custom Build + +!ENDIF + +# Begin Target + +# Name "cryptdll - Win32 Release" +# Name "cryptdll - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\algebra.cpp +# End Source File +# Begin Source File + +SOURCE=.\algparam.cpp +# End Source File +# Begin Source File + +SOURCE=.\asn.cpp +# End Source File +# Begin Source File + +SOURCE=.\authenc.cpp +# End Source File +# Begin Source File + +SOURCE=.\basecode.cpp +# End Source File +# Begin Source File + +SOURCE=.\cbcmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\ccm.cpp +# End Source File +# Begin Source File + +SOURCE=.\channels.cpp +# End Source File +# Begin Source File + +SOURCE=.\cmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\cpu.cpp +# End Source File +# Begin Source File + +SOURCE=.\cryptlib.cpp +# End Source File +# Begin Source File + +SOURCE=.\des.cpp +# End Source File +# Begin Source File + +SOURCE=.\dessp.cpp +# End Source File +# Begin Source File + +SOURCE=.\dh.cpp +# End Source File +# Begin Source File + +SOURCE=.\dll.cpp +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=.\dsa.cpp +# End Source File +# Begin Source File + +SOURCE=.\ec2n.cpp +# End Source File +# Begin Source File + +SOURCE=.\eccrypto.cpp +# End Source File +# Begin Source File + +SOURCE=.\ecp.cpp +# End Source File +# Begin Source File + +SOURCE=.\emsa2.cpp +# End Source File +# Begin Source File + +SOURCE=.\eprecomp.cpp +# End Source File +# Begin Source File + +SOURCE=.\files.cpp +# End Source File +# Begin Source File + +SOURCE=.\filters.cpp +# End Source File +# Begin Source File + +SOURCE=.\fips140.cpp +# End Source File +# Begin Source File + +SOURCE=.\fipstest.cpp +# End Source File +# Begin Source File + +SOURCE=.\gcm.cpp +# End Source File +# Begin Source File + +SOURCE=.\gf2n.cpp +# End Source File +# Begin Source File + +SOURCE=.\gfpcrypt.cpp +# End Source File +# Begin Source File + +SOURCE=.\hex.cpp +# End Source File +# Begin Source File + +SOURCE=.\hmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\hrtimer.cpp +# End Source File +# Begin Source File + +SOURCE=.\integer.cpp +# End Source File +# Begin Source File + +SOURCE=.\iterhash.cpp +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=.\misc.cpp +# End Source File +# Begin Source File + +SOURCE=.\modes.cpp +# End Source File +# Begin Source File + +SOURCE=.\mqueue.cpp +# End Source File +# Begin Source File + +SOURCE=.\nbtheory.cpp +# End Source File +# Begin Source File + +SOURCE=.\oaep.cpp +# End Source File +# Begin Source File + +SOURCE=.\osrng.cpp +# End Source File +# Begin Source File + +SOURCE=.\pch.cpp +# ADD CPP /Yc"pch.h" +# End Source File +# Begin Source File + +SOURCE=.\pkcspad.cpp +# End Source File +# Begin Source File + +SOURCE=.\pssr.cpp +# End Source File +# Begin Source File + +SOURCE=.\pubkey.cpp +# End Source File +# Begin Source File + +SOURCE=.\queue.cpp +# End Source File +# Begin Source File + +SOURCE=.\randpool.cpp +# End Source File +# Begin Source File + +SOURCE=.\rdtables.cpp +# End Source File +# Begin Source File + +SOURCE=.\rijndael.cpp +# End Source File +# Begin Source File + +SOURCE=.\rng.cpp +# End Source File +# Begin Source File + +SOURCE=.\rsa.cpp +# End Source File +# Begin Source File + +SOURCE=.\rw.cpp +# End Source File +# Begin Source File + +SOURCE=.\sha.cpp +# End Source File +# Begin Source File + +SOURCE=.\sha3.cpp +# End Source File +# Begin Source File + +SOURCE=.\simple.cpp +# End Source File +# Begin Source File + +SOURCE=.\skipjack.cpp +# End Source File +# Begin Source File + +SOURCE=.\strciphr.cpp +# End Source File +# Begin Source File + +SOURCE=.\trdlocal.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=.\aes.h +# End Source File +# Begin Source File + +SOURCE=.\algebra.h +# End Source File +# Begin Source File + +SOURCE=.\algparam.h +# End Source File +# Begin Source File + +SOURCE=.\argnames.h +# End Source File +# Begin Source File + +SOURCE=.\asn.h +# End Source File +# Begin Source File + +SOURCE=.\authenc.h +# End Source File +# Begin Source File + +SOURCE=.\basecode.h +# End Source File +# Begin Source File + +SOURCE=.\cbcmac.h +# End Source File +# Begin Source File + +SOURCE=.\ccm.h +# End Source File +# Begin Source File + +SOURCE=.\channels.h +# End Source File +# Begin Source File + +SOURCE=.\cmac.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=.\cryptlib.h +# End Source File +# Begin Source File + +SOURCE=.\des.h +# End Source File +# Begin Source File + +SOURCE=.\dh.h +# End Source File +# Begin Source File + +SOURCE=.\dll.h +# End Source File +# Begin Source File + +SOURCE=.\dsa.h +# End Source File +# Begin Source File + +SOURCE=.\ec2n.h +# End Source File +# Begin Source File + +SOURCE=.\eccrypto.h +# End Source File +# Begin Source File + +SOURCE=.\ecp.h +# End Source File +# Begin Source File + +SOURCE=.\eprecomp.h +# End Source File +# Begin Source File + +SOURCE=.\files.h +# End Source File +# Begin Source File + +SOURCE=.\filters.h +# End Source File +# Begin Source File + +SOURCE=.\fips140.h +# End Source File +# Begin Source File + +SOURCE=.\fltrimpl.h +# End Source File +# Begin Source File + +SOURCE=.\gcm.h +# End Source File +# Begin Source File + +SOURCE=.\gf2n.h +# End Source File +# Begin Source File + +SOURCE=.\gfpcrypt.h +# End Source File +# Begin Source File + +SOURCE=.\hex.h +# End Source File +# Begin Source File + +SOURCE=.\hkdf.h +# End Source File +# Begin Source File + +SOURCE=.\hmac.h +# End Source File +# Begin Source File + +SOURCE=.\integer.h +# End Source File +# Begin Source File + +SOURCE=.\iterhash.h +# End Source File +# Begin Source File + +SOURCE=.\mdc.h +# End Source File +# Begin Source File + +SOURCE=.\misc.h +# End Source File +# Begin Source File + +SOURCE=.\modarith.h +# End Source File +# Begin Source File + +SOURCE=.\modes.h +# End Source File +# Begin Source File + +SOURCE=.\modexppc.h +# End Source File +# Begin Source File + +SOURCE=.\mqueue.h +# End Source File +# Begin Source File + +SOURCE=.\mqv.h +# End Source File +# Begin Source File + +SOURCE=.\nbtheory.h +# End Source File +# Begin Source File + +SOURCE=.\oaep.h +# End Source File +# Begin Source File + +SOURCE=.\oids.h +# End Source File +# Begin Source File + +SOURCE=.\osrng.h +# End Source File +# Begin Source File + +SOURCE=.\pch.h +# End Source File +# Begin Source File + +SOURCE=.\pkcspad.h +# End Source File +# Begin Source File + +SOURCE=.\pubkey.h +# End Source File +# Begin Source File + +SOURCE=.\queue.h +# End Source File +# Begin Source File + +SOURCE=.\randpool.h +# End Source File +# Begin Source File + +SOURCE=.\rijndael.h +# End Source File +# Begin Source File + +SOURCE=.\rng.h +# End Source File +# Begin Source File + +SOURCE=.\rsa.h +# End Source File +# Begin Source File + +SOURCE=.\secblock.h +# End Source File +# Begin Source File + +SOURCE=.\seckey.h +# End Source File +# Begin Source File + +SOURCE=.\sha.h +# End Source File +# Begin Source File + +SOURCE=.\sha3.h +# End Source File +# Begin Source File + +SOURCE=.\simple.h +# End Source File +# Begin Source File + +SOURCE=.\skipjack.h +# End Source File +# Begin Source File + +SOURCE=.\smartptr.h +# End Source File +# Begin Source File + +SOURCE=.\stdcpp.h +# End Source File +# Begin Source File + +SOURCE=.\strciphr.h +# End Source File +# Begin Source File + +SOURCE=.\trdlocal.h +# End Source File +# Begin Source File + +SOURCE=.\words.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\cryptopp.rc +# End Source File +# End Target +# End Project diff --git a/external/crypto++-5.6.3/cryptdll.vcproj b/external/crypto++-5.6.3/cryptdll.vcproj new file mode 100644 index 000000000..18744face --- /dev/null +++ b/external/crypto++-5.6.3/cryptdll.vcproj @@ -0,0 +1,2639 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/crypto++-5.6.3/cryptest.dsp b/external/crypto++-5.6.3/cryptest.dsp new file mode 100644 index 000000000..4e3f2721e --- /dev/null +++ b/external/crypto++-5.6.3/cryptest.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="cryptest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=cryptest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "cryptest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "cryptest.mak" CFG="cryptest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "cryptest - Win32 DLL-Import Release" (based on "Win32 (x86) Console Application") +!MESSAGE "cryptest - Win32 DLL-Import Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "cryptest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "cryptest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "cryptest - Win32 DLL-Import Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "cryptest___Win32_FIPS_140_Release" +# PROP BASE Intermediate_Dir "cryptest___Win32_FIPS_140_Release" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "CT_DLL_Import_Release" +# PROP Intermediate_Dir "CT_DLL_Import_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c +# ADD CPP /nologo /G5 /Gz /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "CRYPTOPP_IMPORTS" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm400 /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /OPT:NOWIN98 +# ADD LINK32 Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"DLL_Release/cryptest.exe" /libpath:"DLL_Release" /OPT:NOWIN98 /OPT:REF /OPT:ICF +# SUBTRACT LINK32 /pdb:none /incremental:yes +# Begin Special Build Tool +SOURCE="$(InputPath)" +PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build it yourself using the cryptdll project, or echo obtain a pre-built, FIPS 140-2 validated DLL. If you build it yourself echo the resulting DLL will not be considered FIPS validated echo unless it undergoes FIPS validation. +# End Special Build Tool + +!ELSEIF "$(CFG)" == "cryptest - Win32 DLL-Import Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "cryptest___Win32_FIPS_140_Debug" +# PROP BASE Intermediate_Dir "cryptest___Win32_FIPS_140_Debug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "CT_DLL_Import_Debug" +# PROP Intermediate_Dir "CT_DLL_Import_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c +# ADD CPP /nologo /G5 /Gz /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "CRYPTOPP_IMPORTS" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm400 /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /OPT:NOWIN98 +# ADD LINK32 Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"DLL_Debug/cryptest.exe" /pdbtype:sept /libpath:"DLL_Debug" /OPT:NOWIN98 +# Begin Special Build Tool +SOURCE="$(InputPath)" +PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build it yourself using the cryptdll project, or echo obtain a pre-built, FIPS 140-2 validated DLL. If you build it yourself echo the resulting DLL will not be considered FIPS validated echo unless it undergoes FIPS validation. +# End Special Build Tool + +!ELSEIF "$(CFG)" == "cryptest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "cryptes0" +# PROP BASE Intermediate_Dir "cryptes0" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "CTRelease" +# PROP Intermediate_Dir "CTRelease" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /YX /FD /Zm400 /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 advapi32.lib Ws2_32.lib /nologo /subsystem:console /map /debug /machine:I386 /OPT:NOWIN98 /OPT:REF /OPT:ICF +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "cryptest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "cryptes1" +# PROP BASE Intermediate_Dir "cryptes1" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "CTDebug" +# PROP Intermediate_Dir "CTDebug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /YX /FD /Zm400 /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 advapi32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /OPT:NOWIN98 +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "cryptest - Win32 DLL-Import Release" +# Name "cryptest - Win32 DLL-Import Debug" +# Name "cryptest - Win32 Release" +# Name "cryptest - Win32 Debug" +# Begin Group "Source Code" + +# PROP Default_Filter ".cpp;.h" +# Begin Source File + +SOURCE=.\adhoc.cpp +# End Source File +# Begin Source File + +SOURCE=.\bench.cpp +# End Source File +# Begin Source File + +SOURCE=.\bench.h +# End Source File +# Begin Source File + +SOURCE=.\bench2.cpp +# End Source File +# Begin Source File + +SOURCE=.\datatest.cpp +# End Source File +# Begin Source File + +SOURCE=.\dlltest.cpp +# End Source File +# Begin Source File + +SOURCE=.\fipsalgt.cpp +# End Source File +# Begin Source File + +SOURCE=.\regtest.cpp +# End Source File +# Begin Source File + +SOURCE=.\test.cpp +# End Source File +# Begin Source File + +SOURCE=.\validat1.cpp +# End Source File +# Begin Source File + +SOURCE=.\validat2.cpp +# End Source File +# Begin Source File + +SOURCE=.\validat3.cpp +# End Source File +# Begin Source File + +SOURCE=.\validate.h +# End Source File +# End Group +# End Target +# End Project diff --git a/external/crypto++-5.6.3/cryptest.dsw b/external/crypto++-5.6.3/cryptest.dsw new file mode 100644 index 000000000..40c0adc80 --- /dev/null +++ b/external/crypto++-5.6.3/cryptest.dsw @@ -0,0 +1,74 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "cryptdll"=.\cryptdll.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name cryptest + End Project Dependency +}}} + +############################################################################### + +Project: "cryptest"=.\cryptest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name cryptlib + End Project Dependency +}}} + +############################################################################### + +Project: "cryptlib"=.\cryptlib.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "dlltest"=.\dlltest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name cryptdll + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/external/crypto++-5.6.3/cryptest.sh b/external/crypto++-5.6.3/cryptest.sh new file mode 100644 index 000000000..b4321601f --- /dev/null +++ b/external/crypto++-5.6.3/cryptest.sh @@ -0,0 +1,839 @@ +#!/bin/bash + +# cryptest.sh - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. +# Copyright assigned to Crypto++ project. + +# This is a test script that can be used on some Linux/Unix/Apple machines +# to automate building the library and running the self test with various +# combinations of flags, options, and conditions. + +# Everything is tee'd into cryptest-result.txt. Change it to suite your taste. You +# should be able to use `egrep -a "(Error|error|FAILED|Illegal)" cryptest-result.txt` +# to quickly find errors and failures. + +# Set to suite your taste +TEST_RESULTS=cryptest-result.txt +BENCHMARK_RESULTS=cryptest-bench.txt +WARN_TEST_RESULTS=cryptest-warn-result.txt + +# Respect user's preferred flags, but filter the stuff we expliclty test +#if [ ! -z "CXXFLAGS" ]; then +# ADD_CXXFLAGS=$(echo "$CXXFLAGS" | sed 's/\(-DDEBUG\|-DNDEBUG\|-O[0-9]\|-Os\|-Og\|-fsanitize=address\|-fsanitize=undefined\|-DDCRYPTOPP_NO_UNALIGNED_DATA_ACCESS\|-DDCRYPTOPP_NO_UNALIGNED_DATA_ACCESS\|-DDCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562\)//g') +#else\ +# ADD_CXXFLAGS="" +#fi + +# I can't seem to get the expression to work in sed on Apple. It returns the original CXXFLAGS. +# If you want to test with additional flags, then put them in ADD_CXXFLAGS below. +# ADD_CXXFLAGS="-mrdrnd -mrdseed" +ADD_CXXFLAGS="" + +IS_DARWIN=$(uname -s | grep -i -c darwin) +IS_LINUX=$(uname -s | grep -i -c linux) +IS_CYGWIN=$(uname -s | grep -i -c cygwin) +IS_MINGW=$(uname -s | grep -i -c mingw) +IS_OPENBSD=$(uname -s | grep -i -c openbsd) + +# We need to use the C++ compiler to determine if c++11 is available. Otherwise +# a mis-detection occurs on Mac OS X 10.9 and above. Below, we use the same +# Implicit Variables as make. Also see +# https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html +if [ -z "$CXX" ]; then + if [ "$IS_DARWIN" -ne "0" ]; then + CXX=c++ + else + # Linux, MinGW, Cygwin and fallback ... + CXX=g++ + fi +fi + +# Fixup +if [ "$CXX" == "gcc" ]; then + CXX=g++ +fi + +# Fixup +if [ "$IS_OPENBSD" -ne "0" ]; then + MAKE=gmake +else + MAKE=make +fi + +if [ -z "$TMP" ]; then + TMP=/tmp +fi + +# Use the compiler driver, and not cpp, to tell us if the flag is consumed. +$CXX -x c++ -dM -E -std=c++11 - < /dev/null > /dev/null 2>&1 +if [ "$?" -eq "0" ]; then + HAVE_CXX11=1 +else + HAVE_CXX11=0 +fi + +# OpenBSD 5.7 and OS X 10.5 cannot consume -std=c++03 +$CXX -x c++ -dM -E -std=c++03 - < /dev/null > /dev/null 2>&1 +if [ "$?" -eq "0" ]; then + HAVE_CXX03=1 +else + HAVE_CXX03=0 +fi + +# Set to 0 if you don't have UBsan +$CXX -x c++ -fsanitize=undefined adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1 +if [ "$?" -eq "0" ]; then + HAVE_UBSAN=1 +else + HAVE_UBSAN=0 +fi + +# Fixup... +if [ "$IS_CYGWIN" -ne "0" ] || [ "$IS_MINGW" -ne "0" ]; then + HAVE_UBSAN=0 +fi + +# Set to 0 if you don't have Asan +$CXX -x c++ -fsanitize=undefined adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1 +if [ "$?" -eq "0" ]; then + HAVE_ASAN=1 +else + HAVE_ASAN=0 +fi + +# Fixup... +if [ "$IS_CYGWIN" -ne "0" ] || [ "$IS_MINGW" -ne "0" ]; then + HAVE_ASAN=0 +fi + +#Final fixups for compilers liek GCC on ARM64 +if [ "$HAVE_UBSAN" -eq "0" ] || [ "$HAVE_ASAN" -eq "0" ]; then + HAVE_UBAN=0 + HAVE_ASAN=0 +fi + +# Set to 0 if you don't have Valgrind. Valgrind tests take a long time... +HAVE_VALGRIND=$(which valgrind 2>&1 | grep -v "no valgrind" | grep -i -c valgrind) + +# Echo back to ensure something is not missed. +echo +echo "HAVE_CXX03: $HAVE_CXX03" +echo "HAVE_CXX11: $HAVE_CXX11" +echo "HAVE_ASAN: $HAVE_ASAN" +echo "HAVE_UBSAN: $HAVE_UBSAN" + +if [ "$HAVE_VALGRIND" -ne "0" ]; then + echo "HAVE_VALGRIND: $HAVE_VALGRIND" +fi +if [ "$IS_DARWIN" -ne "0" ]; then + echo "IS_DARWIN: $IS_DARWIN" + unset MallocScribble MallocPreScribble MallocGuardEdges +fi +if [ "$IS_LINUX" -ne "0" ]; then + echo "IS_LINUX: $IS_LINUX" +fi +if [ "$IS_CYGWIN" -ne "0" ]; then + echo "IS_CYGWIN: $IS_CYGWIN" +fi +if [ "$IS_MINGW" -ne "0" ]; then + echo "IS_MINGW: $IS_MINGW" +fi + +echo "User CXXFLAGS: $CXXFLAGS" +echo "Retained CXXFLAGS: $ADD_CXXFLAGS" +echo "Compiler:" $($CXX --version | head -1) + +TEST_BEGIN=$(date) +echo +echo "Start time: $TEST_BEGIN" + +############################################ +############################################ + +# Remove previous test results +rm -f "$TEST_RESULTS" > /dev/null 2>&1 +touch "$TEST_RESULTS" + +rm -f "$BENCHMARK_RESULTS" > /dev/null 2>&1 +touch "$BENCHMARK_RESULTS" + +rm -f "$WARN_RESULTS" > /dev/null 2>&1 +touch "$WARN_RESULTS" + +############################################ +# Basic debug build +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, default CXXFLAGS" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -O2" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Basic release build +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, default CXXFLAGS" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Basic debug build, DISABLE_ASM +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, default CXXFLAGS, DISABLE_ASM" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -O2 -DCRYPTOPP_DISABLE_ASM" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Basic release build, DISABLE_ASM +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, default CXXFLAGS, DISABLE_ASM" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_DISABLE_ASM" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# c++03 debug build +if [ "$HAVE_CXX03" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: debug, c++03" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# c++03 release build +if [ "$HAVE_CXX03" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: release, c++03" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# c++11 debug build +if [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: debug, c++11" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# c++11 release build +if [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: release, c++11" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Debug build, all backwards compatibility. +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, MAINTAIN_BACKWARDS_COMPATIBILITY" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -O2 -DCRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build, all backwards compatibility. +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, MAINTAIN_BACKWARDS_COMPATIBILITY" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Debug build, init_priority +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, INIT_PRIORITY" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -O1 -DCRYPTOPP_INIT_PRIORITY=250 $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build, init_priority +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, INIT_PRIORITY" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_INIT_PRIORITY=250 $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build, no unaligned data access +# This test will not be needed in Crypto++ 5.7 and above +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, NO_UNALIGNED_DATA_ACCESS" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build, no backwards compatibility with Crypto++ 5.6.2. +# This test will not be needed in Crypto++ 5.7 and above +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, NO_BACKWARDS_COMPATIBILITY_562" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Debug build, OS Independence +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, NO_OS_DEPENDENCE" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -O1 -DNO_OS_DEPENDENCE $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build, OS Independence +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, NO_OS_DEPENDENCE" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O2 -DNO_OS_DEPENDENCE $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Debug build at -O3 +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, -O3 optimizations" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -O3 $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build at -O3 +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, -O3 optimizations" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -O3 $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Debug build at -Os +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, -Os optimizations" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DDEBUG -g2 -Os $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Release build at -Os +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, -Os optimizations" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +export CXXFLAGS="-DNDEBUG -g2 -Os $ADD_CXXFLAGS" +"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" +./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + +############################################ +# Debug build, UBSan, c++03 +if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_UBSAN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: debug, c++03, UBsan" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DDEBUG -g2 -O1 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" ubsan | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Release build, UBSan, c++03 +if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_UBSAN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: release, c++03, UBsan" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" ubsan | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Debug build, Asan, c++03 +if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_ASAN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: debug, c++03, Asan" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DDEBUG -g2 -O1 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" asan | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Release build, Asan, c++03 +if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_ASAN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: release, c++03, Asan" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" asan | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Release build, UBSan, c++11 +if [ "$HAVE_CXX11" -ne "0" ] && [ "$HAVE_UBSAN" -ne "0" ]; then + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: c++11, UBsan" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" ubsan | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Release build, Asan, c++11 +if [ "$HAVE_CXX11" -ne "0" ] && [ "$HAVE_ASAN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: c++11, Asan" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" asan | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +# For Darwin, we need to test both -stdlib=libstdc++ (GNU) and +# -stdlib=libc++ (LLVM) crossed with -std=c++03 and -std=c++11. + +############################################ +# Darwin, c++03, libc++ +if [ "$HAVE_CXX03" -ne "0" ] && [ "$IS_DARWIN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Darwin, c++03, libc++ (LLVM)" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 -stdlib=libc++ $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Darwin, c++03, libstdc++ +if [ "$HAVE_CXX03" -ne "0" ] && [ "$IS_DARWIN" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Darwin, c++03, libstdc++ (GNU)" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 -stdlib=libstdc++ $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Darwin, c++11, libc++ +if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Darwin, c++11, libc++ (LLVM)" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -stdlib=libc++ $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Darwin, c++11, libstdc++ +if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Darwin, c++11, libstdc++ (GNU)" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -stdlib=libstdc++ $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Darwin, c++03, Malloc Guards +if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX03" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Darwin, c++03, Malloc Guards" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + + export MallocScribble=1 + export MallocPreScribble=1 + export MallocGuardEdges=1 + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + unset MallocScribble MallocPreScribble MallocGuardEdges +fi + +############################################ +# Darwin, c++11, Malloc Guards +if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Darwin, c++11, Malloc Guards" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + + export MallocScribble=1 + export MallocPreScribble=1 + export MallocGuardEdges=1 + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + unset MallocScribble MallocPreScribble MallocGuardEdges +fi + +# Try to locate a Xcode compiler for testing under Darwin +XCODE_COMPILER=$(find /Applications/Xcode*.app/Contents/Developer -name clang++ | head -1) + +############################################ +# Xcode compiler +if [ "$IS_DARWIN" -ne "0" ] && [ -z "$XCODE_COMPILER" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Xcode Clang compiler" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + expot CXX="$XCODE_COMPILER" + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Benchmarks, c++03 +if [ "$HAVE_CXX03" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Benchmarks, c++03" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -O3 -std=c++03 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe b 3 2.4+1e9 2>&1 | tee -a "$BENCHMARK_RESULTS" +fi + +############################################ +# Benchmarks, c++11 +if [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Benchmarks, c++11" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -O3 -std=c++11 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe b 3 2.4+1e9 2>&1 | tee -a "$BENCHMARK_RESULTS" +fi + +# For Cygwin, we need to test both PREFER_BERKELEY_STYLE_SOCKETS +# and PREFER_WINDOWS_STYLE_SOCKETS + +############################################ +# MinGW and PREFER_BERKELEY_STYLE_SOCKETS +if [ "$IS_MINGW" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: MinGW, PREFER_BERKELEY_STYLE_SOCKETS" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -DPREFER_BERKELEY_STYLE_SOCKETS -DNO_WINDOWS_STYLE_SOCKETS $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# MinGW and PREFER_WINDOWS_STYLE_SOCKETS +if [ "$IS_MINGW" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: MinGW, PREFER_WINDOWS_STYLE_SOCKETS" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -DPREFER_WINDOWS_STYLE_SOCKETS -DNO_BERKELEY_STYLE_SOCKETS $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Valgrind, c++03. Requires -O1 for accurate results +if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_VALGRIND" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Valgrind, c++03" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -std=c++03 -g3 -O1 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + valgrind --track-origins=yes ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + valgrind --track-origins=yes ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +# Valgrind, c++11. Requires -O1 for accurate results +if [ "$HAVE_VALGRIND" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Valgrind, c++11" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -std=c++11 -g3 -O1 $ADD_CXXFLAGS" + "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + valgrind --track-origins=yes ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + valgrind --track-origins=yes ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" +fi + +############################################ +############################################ + +if [ "$CXX" == "g++" ] && [ "$HAVE_CXX11" -ne "0" ]; then + + ############################################ + # Basic debug build + echo + echo "************************************" | tee -a "$WARN_TEST_RESULTS" + echo "Testing: debug, c++11, elevated warnings" | tee -a "$WARN_TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas" + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_TEST_RESULTS" + + ############################################ + # Basic release build + echo + echo "************************************" | tee -a "$WARN_TEST_RESULTS" + echo "Testing: release, c++11, elevated warnings" | tee -a "$WARN_TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas" + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_TEST_RESULTS" +fi + +############################################ +############################################ + +TEST_END=$(date) + +echo "************************************************" | tee -a "$TEST_RESULTS" +echo "************************************************" | tee -a "$TEST_RESULTS" +echo | tee -a "$TEST_RESULTS" + +echo "Testing started: $TEST_BEGIN" | tee -a "$TEST_RESULTS" +echo "Testing finished: $TEST_END" | tee -a "$TEST_RESULTS" +echo | tee -a "$TEST_RESULTS" + +COUNT=$(grep -a "Testing: " cryptest-result.txt | wc -l) +if [ "$COUNT" -eq "0" ]; then + echo "No configurations tested" | tee -a "$TEST_RESULTS" +else + echo "$COUNT configurations tested" | tee -a "$TEST_RESULTS" +fi +echo | tee -a "$TEST_RESULTS" + +# "FAILED" is from Crypto++ +# "Error" is from the GNU assembler +# "error" is from the sanitizers +# "Illegal", "0 errors" and "suppressed errors" are from Valgrind. +COUNT=$(egrep -a '(Error|error|FAILED|Illegal)' cryptest-result.txt | egrep -v "( 0 errors|suppressed errors|memory error detector)" | wc -l) +if [ "$COUNT" -eq "0" ]; then + echo "No failures detected" | tee -a "$TEST_RESULTS" +else + echo "$COUNT errors detected" | tee -a "$TEST_RESULTS" + echo + egrep -an "(Error|error|FAILED|Illegal)" cryptest-result.txt +fi +echo | tee -a "$TEST_RESULTS" + +echo "************************************************" | tee -a "$TEST_RESULTS" +echo "************************************************" | tee -a "$TEST_RESULTS" diff --git a/external/crypto++-5.6.3/cryptest.vcproj b/external/crypto++-5.6.3/cryptest.vcproj new file mode 100644 index 000000000..c688284c6 --- /dev/null +++ b/external/crypto++-5.6.3/cryptest.vcproj @@ -0,0 +1,1711 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/crypto++-5.6.3/cryptest_bds.bdsgroup b/external/crypto++-5.6.3/cryptest_bds.bdsgroup new file mode 100644 index 000000000..32d85c637 --- /dev/null +++ b/external/crypto++-5.6.3/cryptest_bds.bdsgroup @@ -0,0 +1,22 @@ + + + + + + + + + + + cryptest_bds.bdsproj + cryptlib_bds.bdsproj + cryptest_bds.exe cryptlib_bds.lib + + + + + + + + diff --git a/external/crypto++-5.6.3/cryptest_bds.bdsproj b/external/crypto++-5.6.3/cryptest_bds.bdsproj new file mode 100644 index 000000000..39751de01 --- /dev/null +++ b/external/crypto++-5.6.3/cryptest_bds.bdsproj @@ -0,0 +1,267 @@ + + + + + + + + + + + + cryptest_bds.bpf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + v + + True + . + D:\cvs\c5\Debug_Build\cryptest_bds.exe + + + + + False + + False + + True + False + + + Delphi 1.0 Compatibility Components + Borland C++Builder Internet Explorer 5 Components Package + + + + + + + + + + + diff --git a/external/crypto++-5.6.3/cryptest_bds.bpf b/external/crypto++-5.6.3/cryptest_bds.bpf new file mode 100644 index 000000000..fa1ed3b86 --- /dev/null +++ b/external/crypto++-5.6.3/cryptest_bds.bpf @@ -0,0 +1,5 @@ +This file is used by the project manager only and should be treated like the project file + +To add a file to this project use the Project menu 'Add to Project' + +main \ No newline at end of file diff --git a/external/crypto++-5.6.3/cryptlib.cpp b/external/crypto++-5.6.3/cryptlib.cpp new file mode 100644 index 000000000..77ed314d4 --- /dev/null +++ b/external/crypto++-5.6.3/cryptlib.cpp @@ -0,0 +1,949 @@ +// cryptlib.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4127 4189 4459) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunused-value" +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "cryptlib.h" +#include "misc.h" +#include "filters.h" +#include "algparam.h" +#include "fips140.h" +#include "argnames.h" +#include "fltrimpl.h" +#include "trdlocal.h" +#include "osrng.h" +#include "secblock.h" +#include "smartptr.h" + +// http://www.cygwin.com/faq.html#faq.api.winsock +#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && defined(PREFER_WINDOWS_STYLE_SOCKETS) +# error Cygwin does not support Windows style sockets. See http://www.cygwin.com/faq.html#faq.api.winsock +#endif + +// MacPorts/GCC does not provide init_priority(priority). Apple/GCC and Fink/GCC do provide it. +#define HAVE_GCC_INIT_PRIORITY (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0)) +#define HAVE_MSC_INIT_PRIORITY (_MSC_VER && (CRYPTOPP_INIT_PRIORITY > 0)) + +NAMESPACE_BEGIN(CryptoPP) + +CRYPTOPP_COMPILE_ASSERT(sizeof(byte) == 1); +CRYPTOPP_COMPILE_ASSERT(sizeof(word16) == 2); +CRYPTOPP_COMPILE_ASSERT(sizeof(word32) == 4); +CRYPTOPP_COMPILE_ASSERT(sizeof(word64) == 8); +#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE +CRYPTOPP_COMPILE_ASSERT(sizeof(dword) == 2*sizeof(word)); +#endif + +#if HAVE_GCC_INIT_PRIORITY +CRYPTOPP_COMPILE_ASSERT(CRYPTOPP_INIT_PRIORITY >= 101); +const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))); +const std::string AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 26))) = "AAD"; +const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; +#elif HAVE_MSC_INIT_PRIORITY +#pragma warning(disable: 4073) +#pragma init_seg(lib) +const std::string DEFAULT_CHANNEL; +const std::string AAD_CHANNEL = "AAD"; +const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; +#pragma warning(default: 4073) +#else +// VALVE, changed DEFAULT_CHANNEL to a basic type from std::string +//const std::string DEFAULT_CHANNEL; +const char * DEFAULT_CHANNEL = ""; +const std::string AAD_CHANNEL = "AAD"; +const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; +#endif + +class NullNameValuePairs : public NameValuePairs +{ +public: + NullNameValuePairs() {} + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + {CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue); return false;} +}; + +// VALVE: Our debug allocator doesn't much care for global objects like this, it registers them +// as a memory leak during validation. So make them const. +//#if HAVE_GCC_INIT_PRIORITY +//const simple_ptr s_pNullNameValuePairs __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 30))) = new NullNameValuePairs; +//const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p; +//#else +//const simple_ptr s_pNullNameValuePairs(new NullNameValuePairs); +//const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p; +//#endif + +const NullNameValuePairs s_NullNameValuePairs; +const NameValuePairs &g_nullNameValuePairs = s_NullNameValuePairs; + +BufferedTransformation & TheBitBucket() +{ + static BitBucket bitBucket; + return bitBucket; +} + +Algorithm::Algorithm(bool checkSelfTestStatus) +{ + if (checkSelfTestStatus && FIPS_140_2_ComplianceEnabled()) + { + if (GetPowerUpSelfTestStatus() == POWER_UP_SELF_TEST_NOT_DONE && !PowerUpSelfTestInProgressOnThisThread()) + throw SelfTestFailure("Cryptographic algorithms are disabled before the power-up self tests are performed."); + + if (GetPowerUpSelfTestStatus() == POWER_UP_SELF_TEST_FAILED) + throw SelfTestFailure("Cryptographic algorithms are disabled after a power-up self test failed."); + } +} + +void SimpleKeyingInterface::SetKey(const byte *key, size_t length, const NameValuePairs ¶ms) +{ + this->ThrowIfInvalidKeyLength(length); + this->UncheckedSetKey(key, (unsigned int)length, params); +} + +void SimpleKeyingInterface::SetKeyWithRounds(const byte *key, size_t length, int rounds) +{ + SetKey(key, length, MakeParameters(Name::Rounds(), rounds)); +} + +void SimpleKeyingInterface::SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength) +{ + SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, ivLength))); +} + +void SimpleKeyingInterface::ThrowIfInvalidKeyLength(size_t length) +{ + if (!IsValidKeyLength(length)) + throw InvalidKeyLength(GetAlgorithm().AlgorithmName(), length); +} + +void SimpleKeyingInterface::ThrowIfResynchronizable() +{ + if (IsResynchronizable()) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": this object requires an IV"); +} + +void SimpleKeyingInterface::ThrowIfInvalidIV(const byte *iv) +{ + if (!iv && IVRequirement() == UNPREDICTABLE_RANDOM_IV) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": this object cannot use a null IV"); +} + +size_t SimpleKeyingInterface::ThrowIfInvalidIVLength(int size) +{ + if (size < 0) + return IVSize(); + else if ((size_t)size < MinIVLength()) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": IV length " + IntToString(size) + " is less than the minimum of " + IntToString(MinIVLength())); + else if ((size_t)size > MaxIVLength()) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": IV length " + IntToString(size) + " exceeds the maximum of " + IntToString(MaxIVLength())); + else + return size; +} + +const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size) +{ + ConstByteArrayParameter ivWithLength; + const byte *iv; + bool found = false; + + try {found = params.GetValue(Name::IV(), ivWithLength);} + catch (const NameValuePairs::ValueTypeMismatch &) {} + + if (found) + { + iv = ivWithLength.begin(); + ThrowIfInvalidIV(iv); + size = ThrowIfInvalidIVLength((int)ivWithLength.size()); + return iv; + } + else if (params.GetValue(Name::IV(), iv)) + { + ThrowIfInvalidIV(iv); + size = IVSize(); + return iv; + } + else + { + ThrowIfResynchronizable(); + size = 0; + return NULL; + } +} + +void SimpleKeyingInterface::GetNextIV(RandomNumberGenerator &rng, byte *IV) +{ + rng.GenerateBlock(IV, IVSize()); +} + +size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const +{ + assert(inBlocks); + assert(outBlocks); + assert(length); + + size_t blockSize = BlockSize(); + size_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncrementInOutPointers)) ? 0 : blockSize; + size_t xorIncrement = xorBlocks ? blockSize : 0; + size_t outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : blockSize; + + if (flags & BT_ReverseDirection) + { + assert(length % blockSize == 0); + inBlocks += length - blockSize; + xorBlocks += length - blockSize; + outBlocks += length - blockSize; + inIncrement = 0-inIncrement; + xorIncrement = 0-xorIncrement; + outIncrement = 0-outIncrement; + } + + while (length >= blockSize) + { + if (flags & BT_XorInput) + { + // Coverity finding. However, xorBlocks is never NULL if BT_XorInput. + assert(xorBlocks); +#if defined(__COVERITY__) + if (xorBlocks) +#endif + xorbuf(outBlocks, xorBlocks, inBlocks, blockSize); + ProcessBlock(outBlocks); + } + else + { + // xorBlocks can be NULL. See, for example, ECB_OneWay::ProcessData. + ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks); + } + + if (flags & BT_InBlockIsCounter) + const_cast(inBlocks)[blockSize-1]++; + inBlocks += inIncrement; + outBlocks += outIncrement; + xorBlocks += xorIncrement; + length -= blockSize; + } + + return length; +} + +unsigned int BlockTransformation::OptimalDataAlignment() const +{ + return GetAlignmentOf(); +} + +unsigned int StreamTransformation::OptimalDataAlignment() const +{ + return GetAlignmentOf(); +} + +unsigned int HashTransformation::OptimalDataAlignment() const +{ + return GetAlignmentOf(); +} + +void StreamTransformation::ProcessLastBlock(byte *outString, const byte *inString, size_t length) +{ + assert(MinLastBlockSize() == 0); // this function should be overriden otherwise + + if (length == MandatoryBlockSize()) + ProcessData(outString, inString, length); + else if (length != 0) + throw NotImplemented(AlgorithmName() + ": this object does't support a special last block"); +} + +void AuthenticatedSymmetricCipher::SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength) +{ + if (headerLength > MaxHeaderLength()) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": header length " + IntToString(headerLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength())); + + if (messageLength > MaxMessageLength()) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": message length " + IntToString(messageLength) + " exceeds the maximum of " + IntToString(MaxMessageLength())); + + if (footerLength > MaxFooterLength()) + throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": footer length " + IntToString(footerLength) + " exceeds the maximum of " + IntToString(MaxFooterLength())); + + UncheckedSpecifyDataLengths(headerLength, messageLength, footerLength); +} + +void AuthenticatedSymmetricCipher::EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength) +{ + Resynchronize(iv, ivLength); + SpecifyDataLengths(headerLength, messageLength); + Update(header, headerLength); + ProcessString(ciphertext, message, messageLength); + TruncatedFinal(mac, macSize); +} + +bool AuthenticatedSymmetricCipher::DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *ciphertext, size_t ciphertextLength) +{ + Resynchronize(iv, ivLength); + SpecifyDataLengths(headerLength, ciphertextLength); + Update(header, headerLength); + ProcessString(message, ciphertext, ciphertextLength); + return TruncatedVerify(mac, macLength); +} + +unsigned int RandomNumberGenerator::GenerateBit() +{ + return GenerateByte() & 1; +} + +byte RandomNumberGenerator::GenerateByte() +{ + byte b; + GenerateBlock(&b, 1); + return b; +} + +word32 RandomNumberGenerator::GenerateWord32(word32 min, word32 max) +{ + const word32 range = max-min; + const int maxBits = BitPrecision(range); + + word32 value; + + do + { + GenerateBlock((byte *)&value, sizeof(value)); + value = Crop(value, maxBits); + } while (value > range); + + return value+min; +} + +// Stack recursion below... GenerateIntoBufferedTransformation calls GenerateBlock, +// and GenerateBlock calls GenerateIntoBufferedTransformation. Ad infinitum. Also +// see https://github.com/weidai11/cryptopp/issues/38. +// +// According to Wei, RandomNumberGenerator is an interface, and it should not +// be instantiable. Its now spilt milk, and we are going to assert it in Debug +// builds to alert the programmer and throw in Release builds. Developers have +// a reference implementation in case its needed. If a programmer +// unintentionally lands here, then they should ensure use of a +// RandomNumberGenerator pointer or reference so polymorphism can provide the +// proper runtime dispatching. + +void RandomNumberGenerator::GenerateBlock(byte *output, size_t size) +{ + CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); + +#if 0 + // This breaks AutoSeededX917RNG generators. + throw NotImplemented("RandomNumberGenerator: GenerateBlock not implemented"); +#endif + + ArraySink s(output, size); + GenerateIntoBufferedTransformation(s, DEFAULT_CHANNEL, size); +} + +void RandomNumberGenerator::DiscardBytes(size_t n) +{ + GenerateIntoBufferedTransformation(TheBitBucket(), DEFAULT_CHANNEL, n); +} + +void RandomNumberGenerator::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length) +{ + FixedSizeSecBlock buffer; + while (length) + { + size_t len = UnsignedMin(buffer.size(), length); + GenerateBlock(buffer, len); + size_t rem = target.ChannelPut(channel, buffer, len); + CRYPTOPP_UNUSED(rem); assert(rem == 0); + length -= len; + } +} + +//! \class ClassNullRNG +//! \brief Random Number Generator that does not produce random numbers +//! \details ClassNullRNG can be used for functions that require a RandomNumberGenerator +//! but don't actually use it. The class throws NotImplemented when a generation function is called. +//! \sa NullRNG() +class ClassNullRNG : public RandomNumberGenerator +{ +public: + //! \brief The name of the generator + //! \returns the string \a NullRNGs + std::string AlgorithmName() const {return "NullRNG";} + +#if defined(CRYPTOPP_DOXYGEN_PROCESSING) + //! \brief An implementation that throws NotImplemented + byte GenerateByte () {} + //! \brief An implementation that throws NotImplemented + unsigned int GenerateBit () {} + //! \brief An implementation that throws NotImplemented + word32 GenerateWord32 (word32 min, word32 max) {} +#endif + + //! \brief An implementation that throws NotImplemented + void GenerateBlock(byte *output, size_t size) + { + CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(size); + throw NotImplemented("NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes"); + } + +#if defined(CRYPTOPP_DOXYGEN_PROCESSING) + //! \brief An implementation that throws NotImplemented + void GenerateIntoBufferedTransformation (BufferedTransformation &target, const std::string &channel, lword length) {} + //! \brief An implementation that throws NotImplemented + void IncorporateEntropy (const byte *input, size_t length) {} + //! \brief An implementation that returns \p false + bool CanIncorporateEntropy () const {} + //! \brief An implementation that does nothing + void DiscardBytes (size_t n) {} + //! \brief An implementation that does nothing + void Shuffle (IT begin, IT end) {} + +private: + Clonable* Clone () const { return NULL; } +#endif +}; + +RandomNumberGenerator & NullRNG() +{ + static ClassNullRNG s_nullRNG; + return s_nullRNG; +} + +bool HashTransformation::TruncatedVerify(const byte *digestIn, size_t digestLength) +{ + ThrowIfInvalidTruncatedSize(digestLength); + SecByteBlock digest(digestLength); + TruncatedFinal(digest, digestLength); + return VerifyBufsEqual(digest, digestIn, digestLength); +} + +void HashTransformation::ThrowIfInvalidTruncatedSize(size_t size) const +{ + if (size > DigestSize()) + throw InvalidArgument("HashTransformation: can't truncate a " + IntToString(DigestSize()) + " byte digest to " + IntToString(size) + " bytes"); +} + +unsigned int BufferedTransformation::GetMaxWaitObjectCount() const +{ + const BufferedTransformation *t = AttachedTransformation(); + return t ? t->GetMaxWaitObjectCount() : 0; +} + +void BufferedTransformation::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + BufferedTransformation *t = AttachedTransformation(); + if (t) + t->GetWaitObjects(container, callStack); // reduce clutter by not adding to stack here +} + +void BufferedTransformation::Initialize(const NameValuePairs ¶meters, int propagation) +{ + CRYPTOPP_UNUSED(propagation); + assert(!AttachedTransformation()); + IsolatedInitialize(parameters); +} + +bool BufferedTransformation::Flush(bool hardFlush, int propagation, bool blocking) +{ + CRYPTOPP_UNUSED(propagation); + assert(!AttachedTransformation()); + return IsolatedFlush(hardFlush, blocking); +} + +bool BufferedTransformation::MessageSeriesEnd(int propagation, bool blocking) +{ + CRYPTOPP_UNUSED(propagation); + assert(!AttachedTransformation()); + return IsolatedMessageSeriesEnd(blocking); +} + +byte * BufferedTransformation::ChannelCreatePutSpace(const std::string &channel, size_t &size) +{ + if (channel.empty()) + return CreatePutSpace(size); + else + throw NoChannelSupport(AlgorithmName()); +} + +size_t BufferedTransformation::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (channel.empty()) + return Put2(begin, length, messageEnd, blocking); + else + throw NoChannelSupport(AlgorithmName()); +} + +size_t BufferedTransformation::ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (channel.empty()) + return PutModifiable2(begin, length, messageEnd, blocking); + else + return ChannelPut2(channel, begin, length, messageEnd, blocking); +} + +bool BufferedTransformation::ChannelFlush(const std::string &channel, bool completeFlush, int propagation, bool blocking) +{ + if (channel.empty()) + return Flush(completeFlush, propagation, blocking); + else + throw NoChannelSupport(AlgorithmName()); +} + +bool BufferedTransformation::ChannelMessageSeriesEnd(const std::string &channel, int propagation, bool blocking) +{ + if (channel.empty()) + return MessageSeriesEnd(propagation, blocking); + else + throw NoChannelSupport(AlgorithmName()); +} + +lword BufferedTransformation::MaxRetrievable() const +{ + if (AttachedTransformation()) + return AttachedTransformation()->MaxRetrievable(); + else + return CopyTo(TheBitBucket()); +} + +bool BufferedTransformation::AnyRetrievable() const +{ + if (AttachedTransformation()) + return AttachedTransformation()->AnyRetrievable(); + else + { + byte b; + return Peek(b) != 0; + } +} + +size_t BufferedTransformation::Get(byte &outByte) +{ + if (AttachedTransformation()) + return AttachedTransformation()->Get(outByte); + else + return Get(&outByte, 1); +} + +size_t BufferedTransformation::Get(byte *outString, size_t getMax) +{ + if (AttachedTransformation()) + return AttachedTransformation()->Get(outString, getMax); + else + { + ArraySink arraySink(outString, getMax); + return (size_t)TransferTo(arraySink, getMax); + } +} + +size_t BufferedTransformation::Peek(byte &outByte) const +{ + if (AttachedTransformation()) + return AttachedTransformation()->Peek(outByte); + else + return Peek(&outByte, 1); +} + +size_t BufferedTransformation::Peek(byte *outString, size_t peekMax) const +{ + if (AttachedTransformation()) + return AttachedTransformation()->Peek(outString, peekMax); + else + { + ArraySink arraySink(outString, peekMax); + return (size_t)CopyTo(arraySink, peekMax); + } +} + +lword BufferedTransformation::Skip(lword skipMax) +{ + if (AttachedTransformation()) + return AttachedTransformation()->Skip(skipMax); + else + return TransferTo(TheBitBucket(), skipMax); +} + +lword BufferedTransformation::TotalBytesRetrievable() const +{ + if (AttachedTransformation()) + return AttachedTransformation()->TotalBytesRetrievable(); + else + return MaxRetrievable(); +} + +unsigned int BufferedTransformation::NumberOfMessages() const +{ + if (AttachedTransformation()) + return AttachedTransformation()->NumberOfMessages(); + else + return CopyMessagesTo(TheBitBucket()); +} + +bool BufferedTransformation::AnyMessages() const +{ + if (AttachedTransformation()) + return AttachedTransformation()->AnyMessages(); + else + return NumberOfMessages() != 0; +} + +bool BufferedTransformation::GetNextMessage() +{ + if (AttachedTransformation()) + return AttachedTransformation()->GetNextMessage(); + else + { + assert(!AnyMessages()); + return false; + } +} + +unsigned int BufferedTransformation::SkipMessages(unsigned int count) +{ + if (AttachedTransformation()) + return AttachedTransformation()->SkipMessages(count); + else + return TransferMessagesTo(TheBitBucket(), count); +} + +size_t BufferedTransformation::TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel, bool blocking) +{ + if (AttachedTransformation()) + return AttachedTransformation()->TransferMessagesTo2(target, messageCount, channel, blocking); + else + { + unsigned int maxMessages = messageCount; + for (messageCount=0; messageCount < maxMessages && AnyMessages(); messageCount++) + { + size_t blockedBytes; + lword transferredBytes; + + while (AnyRetrievable()) + { + transferredBytes = LWORD_MAX; + blockedBytes = TransferTo2(target, transferredBytes, channel, blocking); + if (blockedBytes > 0) + return blockedBytes; + } + + if (target.ChannelMessageEnd(channel, GetAutoSignalPropagation(), blocking)) + return 1; + + bool result = GetNextMessage(); + CRYPTOPP_UNUSED(result); assert(result); + } + return 0; + } +} + +unsigned int BufferedTransformation::CopyMessagesTo(BufferedTransformation &target, unsigned int count, const std::string &channel) const +{ + if (AttachedTransformation()) + return AttachedTransformation()->CopyMessagesTo(target, count, channel); + else + return 0; +} + +void BufferedTransformation::SkipAll() +{ + if (AttachedTransformation()) + AttachedTransformation()->SkipAll(); + else + { + while (SkipMessages()) {} + while (Skip()) {} + } +} + +size_t BufferedTransformation::TransferAllTo2(BufferedTransformation &target, const std::string &channel, bool blocking) +{ + if (AttachedTransformation()) + return AttachedTransformation()->TransferAllTo2(target, channel, blocking); + else + { + assert(!NumberOfMessageSeries()); + + unsigned int messageCount; + do + { + messageCount = UINT_MAX; + size_t blockedBytes = TransferMessagesTo2(target, messageCount, channel, blocking); + if (blockedBytes) + return blockedBytes; + } + while (messageCount != 0); + + lword byteCount; + do + { + byteCount = ULONG_MAX; + size_t blockedBytes = TransferTo2(target, byteCount, channel, blocking); + if (blockedBytes) + return blockedBytes; + } + while (byteCount != 0); + + return 0; + } +} + +void BufferedTransformation::CopyAllTo(BufferedTransformation &target, const std::string &channel) const +{ + if (AttachedTransformation()) + AttachedTransformation()->CopyAllTo(target, channel); + else + { + assert(!NumberOfMessageSeries()); + while (CopyMessagesTo(target, UINT_MAX, channel)) {} + } +} + +void BufferedTransformation::SetRetrievalChannel(const std::string &channel) +{ + if (AttachedTransformation()) + AttachedTransformation()->SetRetrievalChannel(channel); +} + +size_t BufferedTransformation::ChannelPutWord16(const std::string &channel, word16 value, ByteOrder order, bool blocking) +{ + PutWord(false, order, m_buf, value); + return ChannelPut(channel, m_buf, 2, blocking); +} + +size_t BufferedTransformation::ChannelPutWord32(const std::string &channel, word32 value, ByteOrder order, bool blocking) +{ + PutWord(false, order, m_buf, value); + return ChannelPut(channel, m_buf, 4, blocking); +} + +size_t BufferedTransformation::PutWord16(word16 value, ByteOrder order, bool blocking) +{ + return ChannelPutWord16(DEFAULT_CHANNEL, value, order, blocking); +} + +size_t BufferedTransformation::PutWord32(word32 value, ByteOrder order, bool blocking) +{ + return ChannelPutWord32(DEFAULT_CHANNEL, value, order, blocking); +} + +size_t BufferedTransformation::PeekWord16(word16 &value, ByteOrder order) const +{ + byte buf[2] = {0, 0}; + size_t len = Peek(buf, 2); + + if (order) + value = (buf[0] << 8) | buf[1]; + else + value = (buf[1] << 8) | buf[0]; + + return len; +} + +size_t BufferedTransformation::PeekWord32(word32 &value, ByteOrder order) const +{ + byte buf[4] = {0, 0, 0, 0}; + size_t len = Peek(buf, 4); + + if (order) + value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf [3]; + else + value = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf [0]; + + return len; +} + +size_t BufferedTransformation::GetWord16(word16 &value, ByteOrder order) +{ + return (size_t)Skip(PeekWord16(value, order)); +} + +size_t BufferedTransformation::GetWord32(word32 &value, ByteOrder order) +{ + return (size_t)Skip(PeekWord32(value, order)); +} + +void BufferedTransformation::Attach(BufferedTransformation *newOut) +{ + if (AttachedTransformation() && AttachedTransformation()->Attachable()) + AttachedTransformation()->Attach(newOut); + else + Detach(newOut); +} + +void GeneratableCryptoMaterial::GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize) +{ + GenerateRandom(rng, MakeParameters("KeySize", (int)keySize)); +} + +class PK_DefaultEncryptionFilter : public Unflushable +{ +public: + PK_DefaultEncryptionFilter(RandomNumberGenerator &rng, const PK_Encryptor &encryptor, BufferedTransformation *attachment, const NameValuePairs ¶meters) + : m_rng(rng), m_encryptor(encryptor), m_parameters(parameters) + { + Detach(attachment); + } + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + { + FILTER_BEGIN; + m_plaintextQueue.Put(inString, length); + + if (messageEnd) + { + { + size_t plaintextLength; + if (!SafeConvert(m_plaintextQueue.CurrentSize(), plaintextLength)) + throw InvalidArgument("PK_DefaultEncryptionFilter: plaintext too long"); + size_t ciphertextLength = m_encryptor.CiphertextLength(plaintextLength); + + SecByteBlock plaintext(plaintextLength); + m_plaintextQueue.Get(plaintext, plaintextLength); + m_ciphertext.resize(ciphertextLength); + m_encryptor.Encrypt(m_rng, plaintext, plaintextLength, m_ciphertext, m_parameters); + } + + FILTER_OUTPUT(1, m_ciphertext, m_ciphertext.size(), messageEnd); + } + FILTER_END_NO_MESSAGE_END; + } + + RandomNumberGenerator &m_rng; + const PK_Encryptor &m_encryptor; + const NameValuePairs &m_parameters; + ByteQueue m_plaintextQueue; + SecByteBlock m_ciphertext; +}; + +BufferedTransformation * PK_Encryptor::CreateEncryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment, const NameValuePairs ¶meters) const +{ + return new PK_DefaultEncryptionFilter(rng, *this, attachment, parameters); +} + +class PK_DefaultDecryptionFilter : public Unflushable +{ +public: + PK_DefaultDecryptionFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment, const NameValuePairs ¶meters) + : m_rng(rng), m_decryptor(decryptor), m_parameters(parameters) + { + Detach(attachment); + } + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + { + FILTER_BEGIN; + m_ciphertextQueue.Put(inString, length); + + if (messageEnd) + { + { + size_t ciphertextLength; + if (!SafeConvert(m_ciphertextQueue.CurrentSize(), ciphertextLength)) + throw InvalidArgument("PK_DefaultDecryptionFilter: ciphertext too long"); + size_t maxPlaintextLength = m_decryptor.MaxPlaintextLength(ciphertextLength); + + SecByteBlock ciphertext(ciphertextLength); + m_ciphertextQueue.Get(ciphertext, ciphertextLength); + m_plaintext.resize(maxPlaintextLength); + m_result = m_decryptor.Decrypt(m_rng, ciphertext, ciphertextLength, m_plaintext, m_parameters); + if (!m_result.isValidCoding) + throw InvalidCiphertext(m_decryptor.AlgorithmName() + ": invalid ciphertext"); + } + + FILTER_OUTPUT(1, m_plaintext, m_result.messageLength, messageEnd); + } + FILTER_END_NO_MESSAGE_END; + } + + RandomNumberGenerator &m_rng; + const PK_Decryptor &m_decryptor; + const NameValuePairs &m_parameters; + ByteQueue m_ciphertextQueue; + SecByteBlock m_plaintext; + DecodingResult m_result; +}; + +BufferedTransformation * PK_Decryptor::CreateDecryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment, const NameValuePairs ¶meters) const +{ + return new PK_DefaultDecryptionFilter(rng, *this, attachment, parameters); +} + +size_t PK_Signer::Sign(RandomNumberGenerator &rng, PK_MessageAccumulator *messageAccumulator, byte *signature) const +{ + member_ptr m(messageAccumulator); + return SignAndRestart(rng, *m, signature, false); +} + +size_t PK_Signer::SignMessage(RandomNumberGenerator &rng, const byte *message, size_t messageLen, byte *signature) const +{ + member_ptr m(NewSignatureAccumulator(rng)); + m->Update(message, messageLen); + return SignAndRestart(rng, *m, signature, false); +} + +size_t PK_Signer::SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, + const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const +{ + member_ptr m(NewSignatureAccumulator(rng)); + InputRecoverableMessage(*m, recoverableMessage, recoverableMessageLength); + m->Update(nonrecoverableMessage, nonrecoverableMessageLength); + return SignAndRestart(rng, *m, signature, false); +} + +bool PK_Verifier::Verify(PK_MessageAccumulator *messageAccumulator) const +{ + member_ptr m(messageAccumulator); + return VerifyAndRestart(*m); +} + +bool PK_Verifier::VerifyMessage(const byte *message, size_t messageLen, const byte *signature, size_t signatureLength) const +{ + member_ptr m(NewVerificationAccumulator()); + InputSignature(*m, signature, signatureLength); + m->Update(message, messageLen); + return VerifyAndRestart(*m); +} + +DecodingResult PK_Verifier::Recover(byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const +{ + member_ptr m(messageAccumulator); + return RecoverAndRestart(recoveredMessage, *m); +} + +DecodingResult PK_Verifier::RecoverMessage(byte *recoveredMessage, + const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, + const byte *signature, size_t signatureLength) const +{ + member_ptr m(NewVerificationAccumulator()); + InputSignature(*m, signature, signatureLength); + m->Update(nonrecoverableMessage, nonrecoverableMessageLength); + return RecoverAndRestart(recoveredMessage, *m); +} + +void SimpleKeyAgreementDomain::GenerateKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const +{ + GeneratePrivateKey(rng, privateKey); + GeneratePublicKey(rng, privateKey, publicKey); +} + +void AuthenticatedKeyAgreementDomain::GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const +{ + GenerateStaticPrivateKey(rng, privateKey); + GenerateStaticPublicKey(rng, privateKey, publicKey); +} + +void AuthenticatedKeyAgreementDomain::GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const +{ + GenerateEphemeralPrivateKey(rng, privateKey); + GenerateEphemeralPublicKey(rng, privateKey, publicKey); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/cryptlib.dsp b/external/crypto++-5.6.3/cryptlib.dsp new file mode 100644 index 000000000..6c5f4ea93 --- /dev/null +++ b/external/crypto++-5.6.3/cryptlib.dsp @@ -0,0 +1,1216 @@ +# Microsoft Developer Studio Project File - Name="cryptlib" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=cryptlib - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "cryptlib.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "cryptlib.mak" CFG="cryptlib - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "cryptlib - Win32 DLL-Import Release" (based on "Win32 (x86) Static Library") +!MESSAGE "cryptlib - Win32 DLL-Import Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "cryptlib - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "cryptlib - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "cryptlib___Win32_FIPS_140_Release" +# PROP BASE Intermediate_Dir "cryptlib___Win32_FIPS_140_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "DLL_Import_Release" +# PROP Intermediate_Dir "DLL_Import_Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c +# ADD CPP /nologo /G5 /Gz /MT /W3 /GR /GX /Zi /O2 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /Zm400 /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "cryptlib - Win32 DLL-Import Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "cryptlib___Win32_FIPS_140_Debug" +# PROP BASE Intermediate_Dir "cryptlib___Win32_FIPS_140_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DLL_Import_Debug" +# PROP Intermediate_Dir "DLL_Import_Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c +# ADD CPP /nologo /G5 /Gz /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /Zm400 /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "cryptlib - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "cryptlib" +# PROP BASE Intermediate_Dir "cryptlib" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GR /GX /Zi /O2 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /Zm400 /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "cryptlib - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "cryptli0" +# PROP BASE Intermediate_Dir "cryptli0" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /Zm400 /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "cryptlib - Win32 DLL-Import Release" +# Name "cryptlib - Win32 DLL-Import Debug" +# Name "cryptlib - Win32 Release" +# Name "cryptlib - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter ".cpp" +# Begin Source File + +SOURCE=.\3way.cpp +# End Source File +# Begin Source File + +SOURCE=.\adhoc.cpp.proto + +!IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release" + +# Begin Custom Build +InputPath=.\adhoc.cpp.proto + +"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp + echo: >> adhoc.cpp.copied + +# End Custom Build + +!ELSEIF "$(CFG)" == "cryptlib - Win32 DLL-Import Debug" + +# Begin Custom Build +InputPath=.\adhoc.cpp.proto + +"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp + echo: >> adhoc.cpp.copied + +# End Custom Build + +!ELSEIF "$(CFG)" == "cryptlib - Win32 Release" + +# Begin Custom Build +InputPath=.\adhoc.cpp.proto + +"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp + echo: >> adhoc.cpp.copied + +# End Custom Build + +!ELSEIF "$(CFG)" == "cryptlib - Win32 Debug" + +# Begin Custom Build +InputPath=.\adhoc.cpp.proto + +"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp + echo: >> adhoc.cpp.copied + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\adler32.cpp +# End Source File +# Begin Source File + +SOURCE=.\algebra.cpp +# End Source File +# Begin Source File + +SOURCE=.\algparam.cpp +# End Source File +# Begin Source File + +SOURCE=.\arc4.cpp +# End Source File +# Begin Source File + +SOURCE=.\asn.cpp +# End Source File +# Begin Source File + +SOURCE=.\authenc.cpp +# End Source File +# Begin Source File + +SOURCE=.\base32.cpp +# End Source File +# Begin Source File + +SOURCE=.\base64.cpp +# End Source File +# Begin Source File + +SOURCE=.\basecode.cpp +# End Source File +# Begin Source File + +SOURCE=.\bfinit.cpp +# End Source File +# Begin Source File + +SOURCE=.\blowfish.cpp +# End Source File +# Begin Source File + +SOURCE=.\blumshub.cpp +# End Source File +# Begin Source File + +SOURCE=.\camellia.cpp +# End Source File +# Begin Source File + +SOURCE=.\cast.cpp +# End Source File +# Begin Source File + +SOURCE=.\casts.cpp +# End Source File +# Begin Source File + +SOURCE=.\cbcmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\ccm.cpp +# End Source File +# Begin Source File + +SOURCE=.\channels.cpp +# End Source File +# Begin Source File + +SOURCE=.\cmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\cpu.cpp +# End Source File +# Begin Source File + +SOURCE=.\crc.cpp +# End Source File +# Begin Source File + +SOURCE=.\cryptlib.cpp +# End Source File +# Begin Source File + +SOURCE=.\default.cpp +# End Source File +# Begin Source File + +SOURCE=.\des.cpp +# End Source File +# Begin Source File + +SOURCE=.\dessp.cpp +# End Source File +# Begin Source File + +SOURCE=.\dh.cpp +# End Source File +# Begin Source File + +SOURCE=.\dh2.cpp +# End Source File +# Begin Source File + +SOURCE=.\dll.cpp +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=.\dsa.cpp +# End Source File +# Begin Source File + +SOURCE=.\eax.cpp +# End Source File +# Begin Source File + +SOURCE=.\ec2n.cpp +# End Source File +# Begin Source File + +SOURCE=.\eccrypto.cpp +# End Source File +# Begin Source File + +SOURCE=.\ecp.cpp +# End Source File +# Begin Source File + +SOURCE=.\elgamal.cpp +# End Source File +# Begin Source File + +SOURCE=.\emsa2.cpp +# End Source File +# Begin Source File + +SOURCE=.\eprecomp.cpp +# End Source File +# Begin Source File + +SOURCE=.\esign.cpp +# End Source File +# Begin Source File + +SOURCE=.\files.cpp +# End Source File +# Begin Source File + +SOURCE=.\filters.cpp +# End Source File +# Begin Source File + +SOURCE=.\fips140.cpp +# End Source File +# Begin Source File + +SOURCE=.\fipstest.cpp +# End Source File +# Begin Source File + +SOURCE=.\gcm.cpp +# End Source File +# Begin Source File + +SOURCE=.\gf256.cpp +# End Source File +# Begin Source File + +SOURCE=.\gf2_32.cpp +# End Source File +# Begin Source File + +SOURCE=.\gf2n.cpp +# End Source File +# Begin Source File + +SOURCE=.\gfpcrypt.cpp +# End Source File +# Begin Source File + +SOURCE=.\gost.cpp +# End Source File +# Begin Source File + +SOURCE=.\gzip.cpp +# End Source File +# Begin Source File + +SOURCE=.\hex.cpp +# End Source File +# Begin Source File + +SOURCE=.\hmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\hrtimer.cpp +# End Source File +# Begin Source File + +SOURCE=.\ida.cpp +# End Source File +# Begin Source File + +SOURCE=.\idea.cpp +# End Source File +# Begin Source File + +SOURCE=.\integer.cpp +# End Source File +# Begin Source File + +SOURCE=.\iterhash.cpp +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=.\luc.cpp +# End Source File +# Begin Source File + +SOURCE=.\mars.cpp +# End Source File +# Begin Source File + +SOURCE=.\marss.cpp +# End Source File +# Begin Source File + +SOURCE=.\md2.cpp +# End Source File +# Begin Source File + +SOURCE=.\md4.cpp +# End Source File +# Begin Source File + +SOURCE=.\md5.cpp +# End Source File +# Begin Source File + +SOURCE=.\misc.cpp +# End Source File +# Begin Source File + +SOURCE=.\modes.cpp +# End Source File +# Begin Source File + +SOURCE=.\mqueue.cpp +# End Source File +# Begin Source File + +SOURCE=.\mqv.cpp +# End Source File +# Begin Source File + +SOURCE=.\nbtheory.cpp +# End Source File +# Begin Source File + +SOURCE=.\network.cpp +# End Source File +# Begin Source File + +SOURCE=.\oaep.cpp +# End Source File +# Begin Source File + +SOURCE=.\osrng.cpp +# End Source File +# Begin Source File + +SOURCE=.\panama.cpp +# End Source File +# Begin Source File + +SOURCE=.\pch.cpp +# ADD CPP /Yc"pch.h" +# End Source File +# Begin Source File + +SOURCE=.\pkcspad.cpp +# End Source File +# Begin Source File + +SOURCE=.\polynomi.cpp +# End Source File +# Begin Source File + +SOURCE=.\pssr.cpp +# End Source File +# Begin Source File + +SOURCE=.\pubkey.cpp +# End Source File +# Begin Source File + +SOURCE=.\queue.cpp +# End Source File +# Begin Source File + +SOURCE=.\rabin.cpp +# End Source File +# Begin Source File + +SOURCE=.\randpool.cpp +# End Source File +# Begin Source File + +SOURCE=.\rc2.cpp +# End Source File +# Begin Source File + +SOURCE=.\rc5.cpp +# End Source File +# Begin Source File + +SOURCE=.\rc6.cpp +# End Source File +# Begin Source File + +SOURCE=.\rdtables.cpp +# End Source File +# Begin Source File + +SOURCE=.\rijndael.cpp +# End Source File +# Begin Source File + +SOURCE=.\ripemd.cpp +# End Source File +# Begin Source File + +SOURCE=.\rng.cpp +# End Source File +# Begin Source File + +SOURCE=.\rsa.cpp +# End Source File +# Begin Source File + +SOURCE=.\rw.cpp +# End Source File +# Begin Source File + +SOURCE=.\safer.cpp +# End Source File +# Begin Source File + +SOURCE=.\salsa.cpp +# End Source File +# Begin Source File + +SOURCE=.\seal.cpp +# End Source File +# Begin Source File + +SOURCE=.\seed.cpp +# End Source File +# Begin Source File + +SOURCE=.\serpent.cpp +# End Source File +# Begin Source File + +SOURCE=.\sha.cpp +# End Source File +# Begin Source File + +SOURCE=.\sha3.cpp +# End Source File +# Begin Source File + +SOURCE=.\shacal2.cpp +# End Source File +# Begin Source File + +SOURCE=.\shark.cpp +# End Source File +# Begin Source File + +SOURCE=.\sharkbox.cpp +# End Source File +# Begin Source File + +SOURCE=.\simple.cpp +# End Source File +# Begin Source File + +SOURCE=.\skipjack.cpp +# End Source File +# Begin Source File + +SOURCE=.\socketft.cpp +# End Source File +# Begin Source File + +SOURCE=.\sosemanuk.cpp +# End Source File +# Begin Source File + +SOURCE=.\square.cpp +# End Source File +# Begin Source File + +SOURCE=.\squaretb.cpp +# End Source File +# Begin Source File + +SOURCE=.\strciphr.cpp +# End Source File +# Begin Source File + +SOURCE=.\tea.cpp +# End Source File +# Begin Source File + +SOURCE=.\tftables.cpp +# End Source File +# Begin Source File + +SOURCE=.\tiger.cpp +# End Source File +# Begin Source File + +SOURCE=.\tigertab.cpp +# End Source File +# Begin Source File + +SOURCE=.\trdlocal.cpp +# End Source File +# Begin Source File + +SOURCE=.\ttmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\twofish.cpp +# End Source File +# Begin Source File + +SOURCE=.\vmac.cpp +# End Source File +# Begin Source File + +SOURCE=.\wait.cpp +# End Source File +# Begin Source File + +SOURCE=.\wake.cpp +# End Source File +# Begin Source File + +SOURCE=.\whrlpool.cpp +# End Source File +# Begin Source File + +SOURCE=.\winpipes.cpp +# End Source File +# Begin Source File + +SOURCE=.\xtr.cpp +# End Source File +# Begin Source File + +SOURCE=.\xtrcrypt.cpp +# End Source File +# Begin Source File + +SOURCE=.\zdeflate.cpp +# End Source File +# Begin Source File + +SOURCE=.\zinflate.cpp +# End Source File +# Begin Source File + +SOURCE=.\zlib.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter ".;.h" +# Begin Source File + +SOURCE=.\3way.h +# End Source File +# Begin Source File + +SOURCE=.\adler32.h +# End Source File +# Begin Source File + +SOURCE=.\aes.h +# End Source File +# Begin Source File + +SOURCE=.\algebra.h +# End Source File +# Begin Source File + +SOURCE=.\algparam.h +# End Source File +# Begin Source File + +SOURCE=.\arc4.h +# End Source File +# Begin Source File + +SOURCE=.\argnames.h +# End Source File +# Begin Source File + +SOURCE=.\asn.h +# End Source File +# Begin Source File + +SOURCE=.\authenc.h +# End Source File +# Begin Source File + +SOURCE=.\base32.h +# End Source File +# Begin Source File + +SOURCE=.\base64.h +# End Source File +# Begin Source File + +SOURCE=.\basecode.h +# End Source File +# Begin Source File + +SOURCE=.\blowfish.h +# End Source File +# Begin Source File + +SOURCE=.\blumshub.h +# End Source File +# Begin Source File + +SOURCE=.\camellia.h +# End Source File +# Begin Source File + +SOURCE=.\cast.h +# End Source File +# Begin Source File + +SOURCE=.\cbcmac.h +# End Source File +# Begin Source File + +SOURCE=.\ccm.h +# End Source File +# Begin Source File + +SOURCE=.\channels.h +# End Source File +# Begin Source File + +SOURCE=.\cmac.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=.\crc.h +# End Source File +# Begin Source File + +SOURCE=.\cryptlib.h +# End Source File +# Begin Source File + +SOURCE=.\default.h +# End Source File +# Begin Source File + +SOURCE=.\des.h +# End Source File +# Begin Source File + +SOURCE=.\dh.h +# End Source File +# Begin Source File + +SOURCE=.\dh2.h +# End Source File +# Begin Source File + +SOURCE=.\dmac.h +# End Source File +# Begin Source File + +SOURCE=.\dsa.h +# End Source File +# Begin Source File + +SOURCE=.\dword.h +# End Source File +# Begin Source File + +SOURCE=.\eax.h +# End Source File +# Begin Source File + +SOURCE=.\ec2n.h +# End Source File +# Begin Source File + +SOURCE=.\eccrypto.h +# End Source File +# Begin Source File + +SOURCE=.\ecp.h +# End Source File +# Begin Source File + +SOURCE=.\elgamal.h +# End Source File +# Begin Source File + +SOURCE=.\emsa2.h +# End Source File +# Begin Source File + +SOURCE=.\eprecomp.h +# End Source File +# Begin Source File + +SOURCE=.\esign.h +# End Source File +# Begin Source File + +SOURCE=.\factory.h +# End Source File +# Begin Source File + +SOURCE=.\files.h +# End Source File +# Begin Source File + +SOURCE=.\filters.h +# End Source File +# Begin Source File + +SOURCE=.\fips140.h +# End Source File +# Begin Source File + +SOURCE=.\fltrimpl.h +# End Source File +# Begin Source File + +SOURCE=.\gcm.h +# End Source File +# Begin Source File + +SOURCE=.\gf256.h +# End Source File +# Begin Source File + +SOURCE=.\gf2_32.h +# End Source File +# Begin Source File + +SOURCE=.\gf2n.h +# End Source File +# Begin Source File + +SOURCE=.\gfpcrypt.h +# End Source File +# Begin Source File + +SOURCE=.\gost.h +# End Source File +# Begin Source File + +SOURCE=.\gzip.h +# End Source File +# Begin Source File + +SOURCE=.\hex.h +# End Source File +# Begin Source File + +SOURCE=.\hkdf.h +# End Source File +# Begin Source File + +SOURCE=.\hmac.h +# End Source File +# Begin Source File + +SOURCE=.\hrtimer.h +# End Source File +# Begin Source File + +SOURCE=.\ida.h +# End Source File +# Begin Source File + +SOURCE=.\idea.h +# End Source File +# Begin Source File + +SOURCE=.\integer.h +# End Source File +# Begin Source File + +SOURCE=.\iterhash.h +# End Source File +# Begin Source File + +SOURCE=.\lubyrack.h +# End Source File +# Begin Source File + +SOURCE=.\luc.h +# End Source File +# Begin Source File + +SOURCE=.\mars.h +# End Source File +# Begin Source File + +SOURCE=.\md2.h +# End Source File +# Begin Source File + +SOURCE=.\md4.h +# End Source File +# Begin Source File + +SOURCE=.\md5.h +# End Source File +# Begin Source File + +SOURCE=.\mdc.h +# End Source File +# Begin Source File + +SOURCE=.\misc.h +# End Source File +# Begin Source File + +SOURCE=.\modarith.h +# End Source File +# Begin Source File + +SOURCE=.\modes.h +# End Source File +# Begin Source File + +SOURCE=.\modexppc.h +# End Source File +# Begin Source File + +SOURCE=.\mqueue.h +# End Source File +# Begin Source File + +SOURCE=.\mqv.h +# End Source File +# Begin Source File + +SOURCE=.\nbtheory.h +# End Source File +# Begin Source File + +SOURCE=.\network.h +# End Source File +# Begin Source File + +SOURCE=.\nr.h +# End Source File +# Begin Source File + +SOURCE=.\oaep.h +# End Source File +# Begin Source File + +SOURCE=.\oids.h +# End Source File +# Begin Source File + +SOURCE=.\osrng.h +# End Source File +# Begin Source File + +SOURCE=.\panama.h +# End Source File +# Begin Source File + +SOURCE=.\pch.h +# End Source File +# Begin Source File + +SOURCE=.\pkcspad.h +# End Source File +# Begin Source File + +SOURCE=.\polynomi.h +# End Source File +# Begin Source File + +SOURCE=.\pssr.h +# End Source File +# Begin Source File + +SOURCE=.\pubkey.h +# End Source File +# Begin Source File + +SOURCE=.\pwdbased.h +# End Source File +# Begin Source File + +SOURCE=.\queue.h +# End Source File +# Begin Source File + +SOURCE=.\rabin.h +# End Source File +# Begin Source File + +SOURCE=.\randpool.h +# End Source File +# Begin Source File + +SOURCE=.\rc2.h +# End Source File +# Begin Source File + +SOURCE=.\rc5.h +# End Source File +# Begin Source File + +SOURCE=.\rc6.h +# End Source File +# Begin Source File + +SOURCE=.\rijndael.h +# End Source File +# Begin Source File + +SOURCE=.\ripemd.h +# End Source File +# Begin Source File + +SOURCE=.\rng.h +# End Source File +# Begin Source File + +SOURCE=.\rsa.h +# End Source File +# Begin Source File + +SOURCE=.\rw.h +# End Source File +# Begin Source File + +SOURCE=.\safer.h +# End Source File +# Begin Source File + +SOURCE=.\salsa.h +# End Source File +# Begin Source File + +SOURCE=.\seal.h +# End Source File +# Begin Source File + +SOURCE=.\secblock.h +# End Source File +# Begin Source File + +SOURCE=.\seckey.h +# End Source File +# Begin Source File + +SOURCE=.\seed.h +# End Source File +# Begin Source File + +SOURCE=.\serpent.h +# End Source File +# Begin Source File + +SOURCE=.\sha.h +# End Source File +# Begin Source File + +SOURCE=.\sha3.h +# End Source File +# Begin Source File + +SOURCE=.\shacal2.h +# End Source File +# Begin Source File + +SOURCE=.\shark.h +# End Source File +# Begin Source File + +SOURCE=.\simple.h +# End Source File +# Begin Source File + +SOURCE=.\skipjack.h +# End Source File +# Begin Source File + +SOURCE=.\smartptr.h +# End Source File +# Begin Source File + +SOURCE=.\socketft.h +# End Source File +# Begin Source File + +SOURCE=.\square.h +# End Source File +# Begin Source File + +SOURCE=.\strciphr.h +# End Source File +# Begin Source File + +SOURCE=.\tea.h +# End Source File +# Begin Source File + +SOURCE=.\tiger.h +# End Source File +# Begin Source File + +SOURCE=.\trdlocal.h +# End Source File +# Begin Source File + +SOURCE=.\trunhash.h +# End Source File +# Begin Source File + +SOURCE=.\ttmac.h +# End Source File +# Begin Source File + +SOURCE=.\twofish.h +# End Source File +# Begin Source File + +SOURCE=.\wait.h +# End Source File +# Begin Source File + +SOURCE=.\wake.h +# End Source File +# Begin Source File + +SOURCE=.\whrlpool.h +# End Source File +# Begin Source File + +SOURCE=.\winpipes.h +# End Source File +# Begin Source File + +SOURCE=.\words.h +# End Source File +# Begin Source File + +SOURCE=.\xtr.h +# End Source File +# Begin Source File + +SOURCE=.\xtrcrypt.h +# End Source File +# Begin Source File + +SOURCE=.\zdeflate.h +# End Source File +# Begin Source File + +SOURCE=.\zinflate.h +# End Source File +# Begin Source File + +SOURCE=.\zlib.h +# End Source File +# End Group +# Begin Group "Miscellaneous" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Doxyfile +# End Source File +# Begin Source File + +SOURCE=.\GNUmakefile +# End Source File +# Begin Source File + +SOURCE=.\license.txt +# End Source File +# Begin Source File + +SOURCE=.\readme.txt +# End Source File +# End Group +# End Target +# End Project diff --git a/external/crypto++-5.6.3/cryptlib.h b/external/crypto++-5.6.3/cryptlib.h new file mode 100644 index 000000000..633cc640d --- /dev/null +++ b/external/crypto++-5.6.3/cryptlib.h @@ -0,0 +1,2667 @@ +// cryptlib.h - written and placed in the public domain by Wei Dai + +//! \file cryptlib.h +//! \brief Abstract base classes that provide a uniform interface to this library. + +/*! \mainpage Crypto++ Library 5.6.3 API Reference +
+
Abstract Base Classes
+ cryptlib.h +
Authenticated Encryption Modes
+ CCM, EAX, \ref GCM "GCM (2K tables)", \ref GCM "GCM (64K tables)" +
Block Ciphers
+ \ref Rijndael "AES", Weak::ARC4, Blowfish, BTEA, Camellia, CAST128, CAST256, DES, \ref DES_EDE2 "2-key Triple-DES", \ref DES_EDE3 "3-key Triple-DES", + \ref DES_XEX3 "DESX", GOST, IDEA, \ref LR "Luby-Rackoff", MARS, RC2, RC5, RC6, \ref SAFER_K "SAFER-K", \ref SAFER_SK "SAFER-SK", SEED, Serpent, + \ref SHACAL2 "SHACAL-2", SHARK, SKIPJACK, +Square, TEA, \ref ThreeWay "3-Way", Twofish, XTEA +
Stream Ciphers
+ \ref Panama "Panama-LE", \ref Panama "Panama-BE", Salsa20, \ref SEAL "SEAL-LE", \ref SEAL "SEAL-BE", WAKE, XSalsa20 +
Hash Functions
+ SHA1, SHA224, SHA256, SHA384, SHA512, \ref SHA3 "SHA-3", Tiger, Whirlpool, RIPEMD160, RIPEMD320, RIPEMD128, RIPEMD256, Weak::MD2, Weak::MD4, Weak::MD5 +
Non-Cryptographic Checksums
+ CRC32, Adler32 +
Message Authentication Codes
+ VMAC, HMAC, CBC_MAC, CMAC, DMAC, TTMAC, \ref GCM "GCM (GMAC)" +
Random Number Generators
+ NullRNG(), LC_RNG, RandomPool, BlockingRng, NonblockingRng, AutoSeededRandomPool, AutoSeededX917RNG, + \ref MersenneTwister "MersenneTwister (MT19937 and MT19937-AR)", RDRAND, RDSEED +
Key Derivation and Password-based Cryptography
+ HKDF, \ref PKCS12_PBKDF "PBKDF (PKCS #12)", \ref PKCS5_PBKDF1 "PBKDF-1 (PKCS #5)", \ref PKCS5_PBKDF2_HMAC "PBKDF-2/HMAC (PKCS #5)" +
Public Key Cryptosystems
+ DLIES, ECIES, LUCES, RSAES, RabinES, LUC_IES +
Public Key Signature Schemes
+ DSA2, GDSA, ECDSA, NR, ECNR, LUCSS, RSASS, RSASS_ISO, RabinSS, RWSS, ESIGN +
Key Agreement
+ DH, DH2, MQV, ECDH, ECMQV, XTR_DH +
Algebraic Structures
+ Integer, PolynomialMod2, PolynomialOver, RingOfPolynomialsOver, + ModularArithmetic, MontgomeryRepresentation, GFP2_ONB, GF2NP, GF256, GF2_32, EC2N, ECP +
Secret Sharing and Information Dispersal
+ SecretSharing, SecretRecovery, InformationDispersal, InformationRecovery +
Compression
+ Deflator, Inflator, Gzip, Gunzip, ZlibCompressor, ZlibDecompressor +
Input Source Classes
+ StringSource, ArraySource, FileSource, SocketSource, WindowsPipeSource, RandomNumberSource +
Output Sink Classes
+ StringSinkTemplate, StringSink, ArraySink, FileSink, SocketSink, WindowsPipeSink, RandomNumberSink +
Filter Wrappers
+ StreamTransformationFilter, HashFilter, HashVerificationFilter, SignerFilter, SignatureVerificationFilter +
Binary to Text Encoders and Decoders
+ HexEncoder, HexDecoder, Base64Encoder, Base64Decoder, Base64URLEncoder, Base64URLDecoder, Base32Encoder, Base32Decoder +
Wrappers for OS features
+ Timer, Socket, WindowsHandle, ThreadLocalStorage, ThreadUserTimer +
FIPS 140 validated cryptography
+ fips140.h +
+ +In the DLL version of Crypto++, only the following implementation class are available. +
+
Block Ciphers
+ AES, \ref DES_EDE2 "2-key Triple-DES", \ref DES_EDE3 "3-key Triple-DES", SKIPJACK +
Cipher Modes (replace template parameter BC with one of the block ciphers above)
+ \ref ECB_Mode "ECB_Mode", \ref CTR_Mode "CTR_Mode", \ref CBC_Mode "CBC_Mode", \ref CFB_FIPS_Mode "CFB_FIPS_Mode", \ref OFB_Mode "OFB_Mode", \ref GCM "GCM" +
Hash Functions
+ SHA1, SHA224, SHA256, SHA384, SHA512 +
Public Key Signature Schemes (replace template parameter H with one of the hash functions above)
+ RSASS\, RSASS\, RSASS_ISO\, RWSS\, DSA, ECDSA\, ECDSA\ +
Message Authentication Codes (replace template parameter H with one of the hash functions above)
+ HMAC\, CBC_MAC\, CBC_MAC\, GCM\ +
Random Number Generators
+ DefaultAutoSeededRNG (AutoSeededX917RNG\) +
Key Agreement
+ DH, DH2 +
Public Key Cryptosystems
+ RSAES\ \> +
+ +

This reference manual is a work in progress. Some classes are lack detailed descriptions. +

Click here to download a zip archive containing this manual. +

Thanks to Ryan Phillips for providing the Doxygen configuration file +and getting us started on the manual. +*/ + +#ifndef CRYPTOPP_CRYPTLIB_H +#define CRYPTOPP_CRYPTLIB_H + +#include "config.h" +#include "stdcpp.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4127 4189 4702) +#endif + +NAMESPACE_BEGIN(CryptoPP) + +// forward declarations +class Integer; +class RandomNumberGenerator; +class BufferedTransformation; + +//! \brief Specifies a direction for a cipher to operate +enum CipherDir {ENCRYPTION, DECRYPTION}; + +//! \brief Represents infinite time +const unsigned long INFINITE_TIME = ULONG_MAX; + +// VC60 workaround: using enums as template parameters causes problems +//! \brief Converts a typename to an enumerated value +template +struct EnumToType +{ + static ENUM_TYPE ToEnum() {return (ENUM_TYPE)VALUE;} +}; + +//! \brief Provides the byte ordering +enum ByteOrder {LITTLE_ENDIAN_ORDER = 0, BIG_ENDIAN_ORDER = 1}; +//! \typedef Provides a constant for LittleEndian +typedef EnumToType LittleEndian; +//! \typedef Provides a constant for BigEndian +typedef EnumToType BigEndian; + +//! \class Exception +//! \brief Base class for all exceptions thrown by Crypto++ +class CRYPTOPP_DLL Exception : public std::exception +{ +public: + //! error types + enum ErrorType { + //! \brief A method was called which was not implemented + NOT_IMPLEMENTED, + //! \brief An invalid argument was detected + INVALID_ARGUMENT, + //! \brief BufferedTransformation received a Flush(true) signal but can't flush buffers + CANNOT_FLUSH, + //! \brief Data integerity check, such as CRC or MAC, failed + DATA_INTEGRITY_CHECK_FAILED, + //! \brief Input data was received that did not conform to expected format + INVALID_DATA_FORMAT, + //! \brief Error reading from input device or writing to output device + IO_ERROR, + //! \brief Some other error occurred not belong to any of the above categories + OTHER_ERROR + }; + + //! \brief Construct a new Exception + explicit Exception(ErrorType errorType, const std::string &s) : m_errorType(errorType), m_what(s) {} + virtual ~Exception() throw() {} + + //! \brief Retrieves a C-string describing the exception + const char *what() const throw() {return (m_what.c_str());} + //! \brief Retrieves a string describing the exception + const std::string &GetWhat() const {return m_what;} + //! \brief Sets the error string for the exception + void SetWhat(const std::string &s) {m_what = s;} + //! \brief Retrieves the error type for the exception + ErrorType GetErrorType() const {return m_errorType;} + //! \brief Sets the error type for the exceptions + void SetErrorType(ErrorType errorType) {m_errorType = errorType;} + +private: + ErrorType m_errorType; + std::string m_what; +}; + +//! \brief An invalid argument was detected +class CRYPTOPP_DLL InvalidArgument : public Exception +{ +public: + explicit InvalidArgument(const std::string &s) : Exception(INVALID_ARGUMENT, s) {} +}; + +//! \brief Input data was received that did not conform to expected format +class CRYPTOPP_DLL InvalidDataFormat : public Exception +{ +public: + explicit InvalidDataFormat(const std::string &s) : Exception(INVALID_DATA_FORMAT, s) {} +}; + +//! \brief A decryption filter encountered invalid ciphertext +class CRYPTOPP_DLL InvalidCiphertext : public InvalidDataFormat +{ +public: + explicit InvalidCiphertext(const std::string &s) : InvalidDataFormat(s) {} +}; + +//! \brief A method was called which was not implemented +class CRYPTOPP_DLL NotImplemented : public Exception +{ +public: + explicit NotImplemented(const std::string &s) : Exception(NOT_IMPLEMENTED, s) {} +}; + +//! \brief Flush(true) was called but it can't completely flush its buffers +class CRYPTOPP_DLL CannotFlush : public Exception +{ +public: + explicit CannotFlush(const std::string &s) : Exception(CANNOT_FLUSH, s) {} +}; + +//! \brief The operating system reported an error +class CRYPTOPP_DLL OS_Error : public Exception +{ +public: + OS_Error(ErrorType errorType, const std::string &s, const std::string& operation, int errorCode) + : Exception(errorType, s), m_operation(operation), m_errorCode(errorCode) {} + ~OS_Error() throw() {} + + //! \brief Retrieve the operating system API that reported the error + const std::string & GetOperation() const {return m_operation;} + //! \brief Retrieve the error code returned by the operating system + int GetErrorCode() const {return m_errorCode;} + +protected: + std::string m_operation; + int m_errorCode; +}; + +//! \class DecodingResult +//! \brief Returns a decoding results +struct CRYPTOPP_DLL DecodingResult +{ + //! \brief Constructs a DecodingResult + //! \details isValidCoding is initialized to false and messageLength is initialized to 0. + explicit DecodingResult() : isValidCoding(false), messageLength(0) {} + //! \brief Constructs a DecodingResult + //! \param len the message length + //! \details isValidCoding is initialized to true. + explicit DecodingResult(size_t len) : isValidCoding(true), messageLength(len) {} + + //! \brief Compare two DecodingResult + //! \param rhs the other DecodingResult + //! \returns true if both isValidCoding and messageLength are equal, false otherwise + bool operator==(const DecodingResult &rhs) const {return isValidCoding == rhs.isValidCoding && messageLength == rhs.messageLength;} + //! \brief Compare two DecodingResult + //! \param rhs the other DecodingResult + //! \returns true if either isValidCoding or messageLength is \a not equal, false otherwise + //! \details Returns !operator==(rhs). + bool operator!=(const DecodingResult &rhs) const {return !operator==(rhs);} + + //! \brief Flag to indicate the decoding is valid + bool isValidCoding; + //! \brief Recovered message length if isValidCoding is true, undefined otherwise + size_t messageLength; + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + operator size_t() const {return isValidCoding ? messageLength : 0;} +#endif +}; + +//! \class NameValuePairs +//! \brief Interface for retrieving values given their names +//! \details This class is used to safely pass a variable number of arbitrarily typed arguments to functions +//! and to read values from keys and crypto parameters. +//! \details To obtain an object that implements NameValuePairs for the purpose of parameter +//! passing, use the MakeParameters() function. +//! \details To get a value from NameValuePairs, you need to know the name and the type of the value. +//! Call GetValueNames() on a NameValuePairs object to obtain a list of value names that it supports. +//! then look at the Name namespace documentation to see what the type of each value is, or +//! alternatively, call GetIntValue() with the value name, and if the type is not int, a +//! ValueTypeMismatch exception will be thrown and you can get the actual type from the exception object. +class CRYPTOPP_NO_VTABLE NameValuePairs +{ +public: + virtual ~NameValuePairs() {} + + //! \class ValueTypeMismatch + //! \brief Thrown when an unexpected type is encountered + //! \details Exception thrown when trying to retrieve a value using a different type than expected + class CRYPTOPP_DLL ValueTypeMismatch : public InvalidArgument + { + public: + //! \brief Construct a ValueTypeMismatch + //! \param name the name of the value + //! \param stored the \a actual type of the value stored + //! \param retrieving the \a presumed type of the value retrieved + ValueTypeMismatch(const std::string &name, const std::type_info &stored, const std::type_info &retrieving) + : InvalidArgument("NameValuePairs: type mismatch for '" + name + "', stored '" + stored.name() + "', trying to retrieve '" + retrieving.name() + "'") + , m_stored(stored), m_retrieving(retrieving) {} + + //! \brief Provides the stored type + //! \returns the C++ mangled name of the type + const std::type_info & GetStoredTypeInfo() const {return m_stored;} + + //! \brief Provides the retrieveing type + //! \returns the C++ mangled name of the type + const std::type_info & GetRetrievingTypeInfo() const {return m_retrieving;} + + private: + const std::type_info &m_stored; + const std::type_info &m_retrieving; + }; + + //! \brief Get a copy of this object or subobject + //! \tparam T class or type + //! \param object reference to a variable that receives the value + template + bool GetThisObject(T &object) const + { + return GetValue((std::string("ThisObject:")+typeid(T).name()).c_str(), object); + } + + //! \brief Get a pointer to this object + //! \tparam T class or type + //! \param ptr reference to a pointer to a variable that receives the value + template + bool GetThisPointer(T *&ptr) const + { + return GetValue((std::string("ThisPointer:")+typeid(T).name()).c_str(), ptr); + } + + //! \brief Get a named value + //! \tparam T class or type + //! \param name the name of the object or value to retrieve + //! \param value reference to a variable that receives the value + //! \returns true if the value was retrieved, false otherwise + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + template + bool GetValue(const char *name, T &value) const + { + return GetVoidValue(name, typeid(T), &value); + } + + //! \brief Get a named value + //! \tparam T class or type + //! \param name the name of the object or value to retrieve + //! \param defaultValue the default value of the class or type if it does not exist + //! \returns the object or value + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + template + T GetValueWithDefault(const char *name, T defaultValue) const + { + T value; + bool result = GetValue(name, value); + // No assert... this recovers from failure + if (result) {return value;} + return defaultValue; + } + + //! \brief Get a list of value names that can be retrieved + //! \returns a list of names available to retrieve + //! \details the items in the list are delimited with a colon. + CRYPTOPP_DLL std::string GetValueNames() const + {std::string result; GetValue("ValueNames", result); return result;} + + //! \brief Get a named value with type int + //! \param name the name of the value to retrieve + //! \param value the value retrieved upon success + //! \returns true if an int value was retrieved, false otherwise + //! \details GetIntValue() is used to ensure we don't accidentally try to get an + //! unsigned int or some other type when we mean int (which is the most common case) + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + CRYPTOPP_DLL bool GetIntValue(const char *name, int &value) const + {return GetValue(name, value);} + + //! \brief Get a named value with type int, with default + //! \param name the name of the value to retrieve + //! \param defaultValue the default value if the name does not exist + //! \returns the value retrieved on success or the default value + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const + {return GetValueWithDefault(name, defaultValue);} + + //! \brief Ensures an expected name and type is present + //! \param name the name of the value + //! \param stored the type that was stored for the name + //! \param retrieving the type that is being retrieved for the name + //! \throws ValueTypeMismatch + //! \details ThrowIfTypeMismatch() effectively performs a type safety check. + //! stored and retrieving are C++ mangled names for the type. + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + CRYPTOPP_DLL static void CRYPTOPP_API ThrowIfTypeMismatch(const char *name, const std::type_info &stored, const std::type_info &retrieving) + {if (stored != retrieving) throw ValueTypeMismatch(name, stored, retrieving);} + + //! \brief Retrieves a required name/value pair + //! \tparam T class or type + //! \param className the name of the class + //! \param name the name of the value + //! \param value reference to a variable to receive the value + //! \throws InvalidArgument + //! \details GetRequiredParameter() throws InvalidArgument if the name + //! is not present or not of the expected type T. + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + template + void GetRequiredParameter(const char *className, const char *name, T &value) const + { + if (!GetValue(name, value)) + throw InvalidArgument(std::string(className) + ": missing required parameter '" + name + "'"); + } + + //! \brief Retrieves a required name/value pair + //! \param className the name of the class + //! \param name the name of the value + //! \param value reference to a variable to receive the value + //! \throws InvalidArgument + //! \details GetRequiredParameter() throws InvalidArgument if the name + //! is not present or not of the expected type T. + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + CRYPTOPP_DLL void GetRequiredIntParameter(const char *className, const char *name, int &value) const + { + if (!GetIntValue(name, value)) + throw InvalidArgument(std::string(className) + ": missing required parameter '" + name + "'"); + } + + //! \brief Get a named value + //! \param name the name of the object or value to retrieve + //! \param valueType reference to a variable that receives the value + //! \param pValue void pointer to a variable that receives the value + //! \returns true if the value was retrieved, false otherwise + //! \details GetVoidValue() retrives the value of name if it exists. + //! \note GetVoidValue() is an internal function and should be implemented + //! by derived classes. Users should use one of the other functions instead. + //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), + //! GetRequiredParameter() and GetRequiredIntParameter() + CRYPTOPP_DLL virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0; +}; + +#if CRYPTOPP_DOXYGEN_PROCESSING + +//! \brief Namespace containing value name definitions. +//! \details Name is part of the CryptoPP namespace. +//! \details The semantics of value names, types are: +//!

+//!     ThisObject:ClassName (ClassName, copy of this object or a subobject)
+//!     ThisPointer:ClassName (const ClassName *, pointer to this object or a subobject)
+//! 
+DOCUMENTED_NAMESPACE_BEGIN(Name) +// more names defined in argnames.h +DOCUMENTED_NAMESPACE_END + +//! \brief Namespace containing weak and wounded algorithms. +//! \details Weak is part of the CryptoPP namespace. Schemes and algorithms are moved into Weak +//! when their security level is reduced to an unacceptable value by contemporary standards. +DOCUMENTED_NAMESPACE_BEGIN(Weak) +// weak and wounded algorithms +DOCUMENTED_NAMESPACE_END +#endif + +//! \brief An empty set of name-value pairs +extern CRYPTOPP_DLL const NameValuePairs &g_nullNameValuePairs; + +// ******************************************************** + +//! \class Clonable +//! \brief Interface for cloning objects +//! \note this is \a not implemented by most classes +//! \sa ClonableImpl, NotCopyable +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Clonable +{ +public: + virtual ~Clonable() {} + + //! \brief Copies this object + //! \returns a copy of this object + //! \throws NotImplemented + //! \note this is \a not implemented by most classes + //! \sa NotCopyable + virtual Clonable* Clone() const {throw NotImplemented("Clone() is not implemented yet.");} // TODO: make this =0 +}; + +//! \class Algorithm +//! \brief Interface for all crypto algorithms +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Algorithm : public Clonable +{ +public: + //! \brief Interface for all crypto algorithms + //! \param checkSelfTestStatus determines whether the object can proceed if the self + //! tests have not been run or failed. + //! \details When FIPS 140-2 compliance is enabled and checkSelfTestStatus == true, + //! this constructor throws SelfTestFailure if the self test hasn't been run or fails. + //! \details FIPS 140-2 compliance is disabled by default. It is only used by certain + //! versions of the library when the library is built as a DLL on Windows. Also see + //! CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 in config.h. + Algorithm(bool checkSelfTestStatus = true); + + //! \brief Provides the name of this algorithm + //! \returns the standard algorithm name + //! \details The standard algorithm name can be a name like \a AES or \a AES/GCM. Some algorithms + //! do not have standard names yet. For example, there is no standard algorithm name for + //! Shoup's ECIES. + //! \note AlgorithmName is not universally implemented yet + virtual std::string AlgorithmName() const {return "unknown";} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~Algorithm() {} +#endif +}; + +//! \class SimpleKeyingInterface +//! Interface for algorithms that take byte strings as keys +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyingInterface +{ +public: + virtual ~SimpleKeyingInterface() {} + + //! \brief Returns smallest valid key length in bytes + virtual size_t MinKeyLength() const =0; + //! \brief Returns largest valid key length in bytes + virtual size_t MaxKeyLength() const =0; + //! \brief Returns default (recommended) key length in bytes + virtual size_t DefaultKeyLength() const =0; + + //! \brief + //! \returns the smallest valid key length in bytes that is greater than or equal to min(n, GetMaxKeyLength()) + virtual size_t GetValidKeyLength(size_t n) const =0; + + //! \brief Returns whether keylength is a valid key length + //! \details Internally the function calls GetValidKeyLength() + virtual bool IsValidKeyLength(size_t keylength) const + {return keylength == GetValidKeyLength(keylength);} + + //! \brief Sets or reset the key of this object + //! \param key the key to use when keying the object + //! \param length the size of the key, in bytes + //! \param params additional initialization parameters that cannot be passed + //! directly through the constructor + virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms = g_nullNameValuePairs); + + //! \brief Sets or reset the key of this object + //! \param key the key to use when keying the object + //! \param length the size of the key, in bytes + //! \param rounds the number of rounds to apply the transformation function, + //! if applicable + //! \details SetKeyWithRounds calls SetKey with an NameValuePairs + //! object that just specifies rounds. rounds is an integer parameter, + //! and -1 means use the default number of rounds. + void SetKeyWithRounds(const byte *key, size_t length, int rounds); + + //! \brief Sets or reset the key of this object + //! \param key the key to use when keying the object + //! \param length the size of the key, in bytes + //! \param iv the intiialization vector to use when keying the object + //! \param ivLength the size of the iv, in bytes + //! \details SetKeyWithIV calls SetKey with an NameValuePairs object + //! that just specifies iv. iv is a byte buffer with size ivLength. + void SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength); + + //! \brief Sets or reset the key of this object + //! \param key the key to use when keying the object + //! \param length the size of the key, in bytes + //! \param iv the intiialization vector to use when keying the object + //! \details SetKeyWithIV calls SetKey with an NameValuePairs object + //! that just specifies iv. iv is a byte buffer, and it must have + //! a size IVSize. + void SetKeyWithIV(const byte *key, size_t length, const byte *iv) + {SetKeyWithIV(key, length, iv, IVSize());} + + //! \brief Provides IV requirements as an enumerated value. + enum IV_Requirement { + //! \brief The IV must be unique + UNIQUE_IV = 0, + //! \brief The IV must be random + RANDOM_IV, + //! \brief The IV must be unpredictable + UNPREDICTABLE_RANDOM_IV, + //! \brief The IV is set by the object + INTERNALLY_GENERATED_IV, + //! \brief The object does not use an IV + NOT_RESYNCHRONIZABLE + }; + + //! returns the minimal requirement for secure IVs + virtual IV_Requirement IVRequirement() const =0; + + //! returns whether the object can be resynchronized (i.e. supports initialization vectors) + /*! If this function returns true, and no IV is passed to SetKey() and CanUseStructuredIVs()==true, an IV of all 0's will be assumed. */ + bool IsResynchronizable() const {return IVRequirement() < NOT_RESYNCHRONIZABLE;} + //! returns whether the object can use random IVs (in addition to ones returned by GetNextIV) + bool CanUseRandomIVs() const {return IVRequirement() <= UNPREDICTABLE_RANDOM_IV;} + //! returns whether the object can use random but possibly predictable IVs (in addition to ones returned by GetNextIV) + bool CanUsePredictableIVs() const {return IVRequirement() <= RANDOM_IV;} + //! returns whether the object can use structured IVs, for example a counter (in addition to ones returned by GetNextIV) + bool CanUseStructuredIVs() const {return IVRequirement() <= UNIQUE_IV;} + + //! \brief Returns length of the IV accepted by this object + //! \details The default implementation throws NotImplemented + virtual unsigned int IVSize() const + {throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");} + //! returns default length of IVs accepted by this object + unsigned int DefaultIVLength() const {return IVSize();} + //! returns minimal length of IVs accepted by this object + virtual unsigned int MinIVLength() const {return IVSize();} + //! returns maximal length of IVs accepted by this object + virtual unsigned int MaxIVLength() const {return IVSize();} + //! resynchronize with an IV. ivLength=-1 means use IVSize() + virtual void Resynchronize(const byte *iv, int ivLength=-1) { + CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(ivLength); + throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization"); + } + + //! \brief Gets a secure IV for the next message + //! \param rng a RandomNumberGenerator to produce keying material + //! \param iv a block of bytes to receive the IV + //! \details This method should be called after you finish encrypting one message and are ready + //! to start the next one. After calling it, you must call SetKey() or Resynchronize() + //! before using this object again. + //! \details key must be at least IVSize() in length. + //! \note This method is not implemented on decryption objects. + virtual void GetNextIV(RandomNumberGenerator &rng, byte *iv); + +protected: + //! \brief Returns the base class Algorithm + //! \returns the base class Algorithm + virtual const Algorithm & GetAlgorithm() const =0; + + //! \brief Sets the key for this object without performing parameter validation + //! \param key a byte buffer used to key the cipher + //! \param length the length of the byte buffer + //! \param params additional parameters passed as NameValuePairs + //! \details key must be at least DEFAULT_KEYLENGTH in length. + virtual void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) =0; + + //! \brief Validates the key length + //! \param length the size of the keying material, in bytes + //! \throws InvalidKeyLength if the key length is invalid + void ThrowIfInvalidKeyLength(size_t length); + + //! \brief Validates the object + //! \throws InvalidArgument if the IV is present + //! \details Internally, the default implementation calls IsResynchronizable() and throws + //! InvalidArgument if the function returns true. + //! \note called when no IV is passed + void ThrowIfResynchronizable(); + + //! \brief Validates the IV + //! \param iv the IV with a length of IVSize, in bytes + //! \throws InvalidArgument on failure + //! \details Internally, the default implementation checks the iv. If iv is not NULL, + //! then the function succeeds. If iv is NULL, then IVRequirement is checked against + //! UNPREDICTABLE_RANDOM_IV. If IVRequirement is UNPREDICTABLE_RANDOM_IV, then + //! then the function succeeds. Otherwise, an exception is thrown. + void ThrowIfInvalidIV(const byte *iv); + + //! \brief Validates the IV length + //! \param length the size of the IV, in bytes + //! \throws InvalidArgument if the number of rounds are invalid + size_t ThrowIfInvalidIVLength(int length); + + //! \brief retrieves and validates the IV + //! \param params NameValuePairs with the IV supplied as a ConstByteArrayParameter + //! \param size the length of the IV, in bytes + //! \returns a pointer to the first byte of the IV + //! \throws InvalidArgument if the number of rounds are invalid + const byte * GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size); + + //! \brief Validates the key length + //! \param length the size of the keying material, in bytes + inline void AssertValidKeyLength(size_t length) const + {CRYPTOPP_UNUSED(length); assert(IsValidKeyLength(length));} +}; + +//! \brief Interface for the data processing part of block ciphers +//! \details Classes derived from BlockTransformation are block ciphers +//! in ECB mode (for example the DES::Encryption class), which are stateless. +//! These classes should not be used directly, but only in combination with +//! a mode class (see CipherModeDocumentation in modes.h). +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockTransformation : public Algorithm +{ +public: + //! \brief Encrypt or decrypt a block + //! \param inBlock the input message before processing + //! \param outBlock the output message after processing + //! \param xorBlock an optional XOR mask + //! \details ProcessAndXorBlock encrypts or decrypts inBlock, xor with xorBlock, and write to outBlock. + //! \details The size of the block is determined by the block cipher and its documentation. Use + //! BLOCKSIZE at compile time, or BlockSize() at runtime. + //! \note The message can be transformed in-place, or the buffers must \a not overlap + //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize() + virtual void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0; + + //! \brief Encrypt or decrypt a block + //! \param inBlock the input message before processing + //! \param outBlock the output message after processing + //! \details ProcessBlock encrypts or decrypts inBlock and write to outBlock. + //! \details The size of the block is determined by the block cipher and its documentation. + //! Use BLOCKSIZE at compile time, or BlockSize() at runtime. + //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize() + //! \note The message can be transformed in-place, or the buffers must \a not overlap + void ProcessBlock(const byte *inBlock, byte *outBlock) const + {ProcessAndXorBlock(inBlock, NULL, outBlock);} + + //! \brief Encrypt or decrypt a block in place + //! \param inoutBlock the input message before processing + //! \details ProcessBlock encrypts or decrypts inoutBlock in-place. + //! \details The size of the block is determined by the block cipher and its documentation. + //! Use BLOCKSIZE at compile time, or BlockSize() at runtime. + //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize() + void ProcessBlock(byte *inoutBlock) const + {ProcessAndXorBlock(inoutBlock, NULL, inoutBlock);} + + //! Provides the block size of the cipher + //! \returns the block size of the cipher, in bytes + virtual unsigned int BlockSize() const =0; + + //! \brief Provides input and output data alignment for optimal performance. + //! \returns the input data alignment that provides optimal performance + virtual unsigned int OptimalDataAlignment() const; + + //! returns true if this is a permutation (i.e. there is an inverse transformation) + virtual bool IsPermutation() const {return true;} + + //! \brief Determines if the cipher is being operated in its forward direction + //! \returns true if DIR is ENCRYPTION, false otherwise + //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() + virtual bool IsForwardTransformation() const =0; + + //! \brief Determines the number of blocks that can be processed in parallel + //! \return the number of blocks that can be processed in parallel, for bit-slicing implementations + //! \details Bit-slicing is often used to improve throughput and minimize timing attacks. + virtual unsigned int OptimalNumberOfParallelBlocks() const {return 1;} + + //! \brief Bit flags that control AdvancedProcessBlocks() behavior + enum FlagsForAdvancedProcessBlocks { + //! \brief inBlock is a counter + BT_InBlockIsCounter=1, + //! \brief should not modify block pointers + BT_DontIncrementInOutPointers=2, + //! \brief + BT_XorInput=4, + //! \brief perform the transformation in reverse + BT_ReverseDirection=8, + //! \brief + BT_AllowParallel=16}; + + //! \brief Encrypt and xor multiple blocks using additional flags + //! \param inBlocks the input message before processing + //! \param xorBlocks an optional XOR mask + //! \param outBlocks the output message after processing + //! \param length the size of the blocks, in bytes + //! \param flags additional flags to control processing + //! \details Encrypt and xor multiple blocks according to FlagsForAdvancedProcessBlocks flags. + //! \note If BT_InBlockIsCounter is set, then the last byte of inBlocks may be modified. + virtual size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const; + + //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() + inline CipherDir GetCipherDirection() const {return IsForwardTransformation() ? ENCRYPTION : DECRYPTION;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~BlockTransformation() {} +#endif +}; + +//! \class StreamTransformation +//! \brief Interface for the data processing portion of stream ciphers +//! \sa StreamTransformationFilter() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE StreamTransformation : public Algorithm +{ +public: + //! \brief Provides a reference to this object + //! \returns A reference to this object + //! \details Useful for passing a temporary object to a function that takes a non-const reference + StreamTransformation& Ref() {return *this;} + + //! \brief Provides the mandatory block size of the cipher + //! \returns The block size of the cipher if input must be processed in blocks, 1 otherwise + virtual unsigned int MandatoryBlockSize() const {return 1;} + + //! \brief Provides the input block size most efficient for this cipher. + //! \returns The input block size that is most efficient for the cipher + //! \details The base class implemnetation returns MandatoryBlockSize(). + //! \note Optimal input length is + //! n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0. + virtual unsigned int OptimalBlockSize() const {return MandatoryBlockSize();} + + //! \brief Provides the number of bytes used in the current block when processing at optimal block size. + //! \returns the number of bytes used in the current block when processing at the optimal block size + virtual unsigned int GetOptimalBlockSizeUsed() const {return 0;} + + //! \brief Provides input and output data alignment for optimal performance. + //! \returns the input data alignment that provides optimal performance + virtual unsigned int OptimalDataAlignment() const; + + //! \brief Encrypt or decrypt an array of bytes + //! \param outString the output byte buffer + //! \param inString the input byte buffer + //! \param length the size of the input and output byte buffers, in bytes + //! \details Either inString == outString, or they must not overlap. + virtual void ProcessData(byte *outString, const byte *inString, size_t length) =0; + + //! \brief Encrypt or decrypt the last block of data + //! \param outString the output byte buffer + //! \param inString the input byte buffer + //! \param length the size of the input and output byte buffers, in bytes + //! ProcessLastBlock is used when the last block of data is special. + //! Currently the only use of this function is CBC-CTS mode. + virtual void ProcessLastBlock(byte *outString, const byte *inString, size_t length); + + //! returns the minimum size of the last block, 0 indicating the last block is not special + virtual unsigned int MinLastBlockSize() const {return 0;} + + //! \brief Encrypt or decrypt a string of bytes + //! \param inoutString the string to process + //! \param length the size of the inoutString, in bytes + //! \details Internally, the base class implementation calls ProcessData(). + inline void ProcessString(byte *inoutString, size_t length) + {ProcessData(inoutString, inoutString, length);} + + //! \brief Encrypt or decrypt a string of bytes + //! \param outString the output string to process + //! \param inString the input string to process + //! \param length the size of the input and output strings, in bytes + //! \details Internally, the base class implementation calls ProcessData(). + inline void ProcessString(byte *outString, const byte *inString, size_t length) + {ProcessData(outString, inString, length);} + + //! \brief Encrypt or decrypt a byte + //! \param input the input byte to process + //! \details Internally, the base class implementation calls ProcessData() with a size of 1. + inline byte ProcessByte(byte input) + {ProcessData(&input, &input, 1); return input;} + + //! \brief Determines whether the cipher supports random access + //! \returns true if the cipher supports random access, false otherwise + virtual bool IsRandomAccess() const =0; + + //! \brief Seek to an absolute position + //! \param pos position to seek + //! \throws NotImplemented + //! \details The base class implementation throws NotImplemented. The function + //! asserts IsRandomAccess() in debug builds. + virtual void Seek(lword pos) + { + CRYPTOPP_UNUSED(pos); + assert(!IsRandomAccess()); + throw NotImplemented("StreamTransformation: this object doesn't support random access"); + } + + //! \brief Determines whether the cipher is self-inverting + //! \returns true if the cipher is self-inverting, false otherwise + //! \details IsSelfInverting determines whether this transformation is + //! self-inverting (e.g. xor with a keystream). + virtual bool IsSelfInverting() const =0; + + //! \brief Determines if the cipher is being operated in its forward direction + //! \returns true if DIR is ENCRYPTION, false otherwise + //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() + virtual bool IsForwardTransformation() const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~StreamTransformation() {} +#endif +}; + +//! \class HashTransformation +//! \brief Interface for hash functions and data processing part of MACs +//! \details HashTransformation objects are stateful. They are created in an initial state, +//! change state as Update() is called, and return to the initial +//! state when Final() is called. This interface allows a large message to +//! be hashed in pieces by calling Update() on each piece followed by +//! calling Final(). +//! \sa HashFilter(), HashVerificationFilter() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HashTransformation : public Algorithm +{ +public: + //! \brief Provides a reference to this object + //! \returns A reference to this object + //! \details Useful for passing a temporary object to a function that takes a non-const reference + HashTransformation& Ref() {return *this;} + + //! \brief Updates a hash with additional input + //! \param input the additional input as a buffer + //! \param length the size of the buffer, in bytes + virtual void Update(const byte *input, size_t length) =0; + + //! \brief Request space which can be written into by the caller + //! \param size the requested size of the buffer + //! \details The purpose of this method is to help avoid extra memory allocations. + //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made, + //! size is the requested size of the buffer. When the call returns, size is the size of + //! the array returned to the caller. + //! \details The base class implementation sets size to 0 and returns NULL. + //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of + virtual byte * CreateUpdateSpace(size_t &size) {size=0; return NULL;} + + //! \brief Computes the hash of the current message + //! \param digest a pointer to the buffer to receive the hash + //! \details digest must be equal to (or greater than) DigestSize(). Final() restarts the + //! hash for a new message. + virtual void Final(byte *digest) + {TruncatedFinal(digest, DigestSize());} + + //! \brief Restart the hash + //! \details Discards the current state, and restart for a new message + virtual void Restart() + {TruncatedFinal(NULL, 0);} + + //! Provides the digest size of the hash + //! \returns the digest size of the hash. + //! \details Calls to Final() require a buffer that is equal to (or greater than) DigestSize(). + virtual unsigned int DigestSize() const =0; + + //! Provides the tag size of the hash + //! \returns the tag size of the hash. + //! \details Same as DigestSize(). + unsigned int TagSize() const {return DigestSize();} + + //! \brief Provides the block size of the compression function + //! \returns the block size of the compression function, in bytes + //! \details BlockSize() will return 0 if the hash is not block based. For example, + //! SHA3 is a recursive hash (not an iterative hash), and it does not have a block size. + virtual unsigned int BlockSize() const {return 0;} + + //! \brief Provides the input block size most efficient for this hash. + //! \returns The input block size that is most efficient for the cipher + //! \details The base class implemnetation returns MandatoryBlockSize(). + //! \note Optimal input length is + //! n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0. + virtual unsigned int OptimalBlockSize() const {return 1;} + + //! \brief Provides input and output data alignment for optimal performance + //! \returns the input data alignment that provides optimal performance + virtual unsigned int OptimalDataAlignment() const; + + //! \brief Updates the hash with additional input and computes the hash of the current message + //! \param digest a pointer to the buffer to receive the hash + //! \param input the additional input as a buffer + //! \param length the size of the buffer, in bytes + //! \details Use this if your input is in one piece and you don't want to call Update() + //! and Final() separately + //! \details CalculateDigest() restarts the hash for the next nmessage. + virtual void CalculateDigest(byte *digest, const byte *input, size_t length) + {Update(input, length); Final(digest);} + + //! \brief Verifies the hash of the current message + //! \param digest a pointer to the buffer of an \a existing hash + //! \returns \p true if the existing hash matches the computed hash, \p false otherwise + //! \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize() + //! \details Calls to Verify() require a buffer that is equal to (or greater than) DigestSize(). + //! \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is + //! a constant time comparison function. digestLength cannot exceed DigestSize(). + //! \details Verify() restarts the hash for the next nmessage. + virtual bool Verify(const byte *digest) + {return TruncatedVerify(digest, DigestSize());} + + //! \brief Updates the hash with additional input and verifies the hash of the current message + //! \param digest a pointer to the buffer of an \a existing hash + //! \param input the additional input as a buffer + //! \param length the size of the buffer, in bytes + //! \returns \p true if the existing hash matches the computed hash, \p false otherwise + //! \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize() + //! \details Use this if your input is in one piece and you don't want to call Update() + //! and Verify() separately + //! \details VerifyDigest() performs a bitwise compare on the buffers using VerifyBufsEqual(), + //! which is a constant time comparison function. digestLength cannot exceed DigestSize(). + //! \details VerifyDigest() restarts the hash for the next nmessage. + virtual bool VerifyDigest(const byte *digest, const byte *input, size_t length) + {Update(input, length); return Verify(digest);} + + //! \brief Computes the hash of the current message + //! \param digest a pointer to the buffer to receive the hash + //! \param digestSize the size of the truncated digest, in bytes + //! \details TruncatedFinal() call Final() and then copies digestSize bytes to digest + //! \details TruncatedFinal() restarts the hash for the next nmessage. + virtual void TruncatedFinal(byte *digest, size_t digestSize) =0; + + //! \brief Updates the hash with additional input and computes the hash of the current message + //! \param digest a pointer to the buffer to receive the hash + //! \param digestSize the length of the truncated hash, in bytes + //! \param input the additional input as a buffer + //! \param length the size of the buffer, in bytes + //! \details Use this if your input is in one piece and you don't want to call Update() + //! and CalculateDigest() separately. + //! \details CalculateTruncatedDigest() restarts the hash for the next nmessage. + virtual void CalculateTruncatedDigest(byte *digest, size_t digestSize, const byte *input, size_t length) + {Update(input, length); TruncatedFinal(digest, digestSize);} + + //! \brief Verifies the hash of the current message + //! \param digest a pointer to the buffer of an \a existing hash + //! \param digestLength the size of the truncated hash, in bytes + //! \returns \p true if the existing hash matches the computed hash, \p false otherwise + //! \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize() + //! \details TruncatedVerify() is a truncated version of Verify(). It can operate on a + //! buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize(). + //! \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is + //! a constant time comparison function. digestLength cannot exceed DigestSize(). + //! \details TruncatedVerify() restarts the hash for the next nmessage. + virtual bool TruncatedVerify(const byte *digest, size_t digestLength); + + //! \brief Updates the hash with additional input and verifies the hash of the current message + //! \param digest a pointer to the buffer of an \a existing hash + //! \param digestLength the size of the truncated hash, in bytes + //! \param input the additional input as a buffer + //! \param length the size of the buffer, in bytes + //! \returns \p true if the existing hash matches the computed hash, \p false otherwise + //! \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize() + //! \details Use this if your input is in one piece and you don't want to call Update() + //! and TruncatedVerify() separately. + //! \details VerifyTruncatedDigest() is a truncated version of VerifyDigest(). It can operate + //! on a buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize(). + //! \details VerifyTruncatedDigest() restarts the hash for the next nmessage. + virtual bool VerifyTruncatedDigest(const byte *digest, size_t digestLength, const byte *input, size_t length) + {Update(input, length); return TruncatedVerify(digest, digestLength);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~HashTransformation() {} +#endif + +protected: + //! \brief Exception thrown when the truncated digest size is greater than DigestSize() + void ThrowIfInvalidTruncatedSize(size_t size) const; +}; + +typedef HashTransformation HashFunction; + +//! \brief Interface for one direction (encryption or decryption) of a block cipher +/*! \note These objects usually should not be used directly. See BlockTransformation for more details. */ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockCipher : public SimpleKeyingInterface, public BlockTransformation +{ +protected: + const Algorithm & GetAlgorithm() const {return *this;} +}; + +//! \brief Interface for one direction (encryption or decryption) of a stream cipher or cipher mode +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SymmetricCipher : public SimpleKeyingInterface, public StreamTransformation +{ +protected: + const Algorithm & GetAlgorithm() const {return *this;} +}; + +//! \brief Interface for message authentication codes +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE MessageAuthenticationCode : public SimpleKeyingInterface, public HashTransformation +{ +protected: + const Algorithm & GetAlgorithm() const {return *this;} +}; + +//! \brief Interface for one direction (encryption or decryption) of a stream cipher or block cipher mode with authentication +/*! The StreamTransformation part of this interface is used to encrypt/decrypt the data, and the MessageAuthenticationCode part of this + interface is used to input additional authenticated data (AAD, which is MAC'ed but not encrypted), and to generate/verify the MAC. */ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipher : public MessageAuthenticationCode, public StreamTransformation +{ +public: + //! this indicates that a member function was called in the wrong state, for example trying to encrypt a message before having set the key or IV + class BadState : public Exception + { + public: + explicit BadState(const std::string &name, const char *message) : Exception(OTHER_ERROR, name + ": " + message) {} + explicit BadState(const std::string &name, const char *function, const char *state) : Exception(OTHER_ERROR, name + ": " + function + " was called before " + state) {} + }; + + //! the maximum length of AAD that can be input before the encrypted data + virtual lword MaxHeaderLength() const =0; + //! the maximum length of encrypted data + virtual lword MaxMessageLength() const =0; + //! the maximum length of AAD that can be input after the encrypted data + virtual lword MaxFooterLength() const {return 0;} + //! if this function returns true, SpecifyDataLengths() must be called before attempting to input data + /*! This is the case for some schemes, such as CCM. */ + virtual bool NeedsPrespecifiedDataLengths() const {return false;} + //! this function only needs to be called if NeedsPrespecifiedDataLengths() returns true + void SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength=0); + //! encrypt and generate MAC in one call. will truncate MAC if macSize < TagSize() + virtual void EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength); + //! decrypt and verify MAC in one call, returning true iff MAC is valid. will assume MAC is truncated if macLength < TagSize() + virtual bool DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *ciphertext, size_t ciphertextLength); + + // redeclare this to avoid compiler ambiguity errors + virtual std::string AlgorithmName() const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~AuthenticatedSymmetricCipher() {} +#endif + +protected: + const Algorithm & GetAlgorithm() const + {return *static_cast(this);} + virtual void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength) + {CRYPTOPP_UNUSED(headerLength); CRYPTOPP_UNUSED(messageLength); CRYPTOPP_UNUSED(footerLength);} +}; + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY +typedef SymmetricCipher StreamCipher; +#endif + +//! \class RandomNumberGenerator +//! \brief Interface for random number generators +//! \details The library provides a number of random number generators, from software based to hardware based generators. +//! \details All generated values are uniformly distributed over the range specified. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomNumberGenerator : public Algorithm +{ +public: + //! \brief Update RNG state with additional unpredictable values + //! \param input the entropy to add to the generator + //! \param length the size of the input buffer + //! \throws NotImplemented + //! \details A generator may or may not accept additional entropy. Call CanIncorporateEntropy() to test for the + //! ability to use additional entropy. + //! \details If a derived class does not override IncorporateEntropy(), then the base class throws + //! NotImplemented. + virtual void IncorporateEntropy(const byte *input, size_t length) + { + CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length); + throw NotImplemented("RandomNumberGenerator: IncorporateEntropy not implemented"); + } + + //! \brief Determines if a generator can accept additional entropy + //! \returns true if IncorporateEntropy() is implemented + virtual bool CanIncorporateEntropy() const {return false;} + + //! \brief Generate new random byte and return it + //! \returns a random 8-bit byte + //! \details Default implementation calls GenerateBlock() with one byte. + //! \details All generated values are uniformly distributed over the range specified within the + //! the contraints of a particular generator. + virtual byte GenerateByte(); + + //! \brief Generate new random bit and return it + //! \returns a random bit + //! \details The default implementation calls GenerateByte() and return its lowest bit. + //! \details All generated values are uniformly distributed over the range specified within the + //! the contraints of a particular generator. + virtual unsigned int GenerateBit(); + + //! \brief Generate a random 32 bit word in the range min to max, inclusive + //! \param min the lower bound of the range + //! \param max the upper bound of the range + //! \returns a random 32-bit word + //! \details The default implementation calls Crop() on the difference between max and + //! min, and then returns the result added to min. + //! \details All generated values are uniformly distributed over the range specified within the + //! the contraints of a particular generator. + virtual word32 GenerateWord32(word32 min=0, word32 max=0xffffffffUL); + + //! \brief Generate random array of bytes + //! \param output the byte buffer + //! \param size the length of the buffer, in bytes + //! \details All generated values are uniformly distributed over the range specified within the + //! the contraints of a particular generator. + //! \note A derived generator \a must override either GenerateBlock() or + //! GenerateIntoBufferedTransformation(). They can override both, or have one call the other. + virtual void GenerateBlock(byte *output, size_t size); + + //! \brief Generate random bytes into a BufferedTransformation + //! \param target the BufferedTransformation object which receives the bytes + //! \param channel the channel on which the bytes should be pumped + //! \param length the number of bytes to generate + //! \details The default implementation calls GenerateBlock() and pumps the result into + //! the DEFAULT_CHANNEL of the target. + //! \details All generated values are uniformly distributed over the range specified within the + //! the contraints of a particular generator. + //! \note A derived generator \a must override either GenerateBlock() or + //! GenerateIntoBufferedTransformation(). They can override both, or have one call the other. + virtual void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length); + + //! \brief Generate and discard n bytes + //! \param n the number of bytes to generate and discard + virtual void DiscardBytes(size_t n); + + //! \brief Randomly shuffle the specified array + //! \param begin an iterator to the first element in the array + //! \param end an iterator beyond the last element in the array + //! \details The resulting permutation is uniformly distributed. + template void Shuffle(IT begin, IT end) + { + // TODO: What happens if there are more than 2^32 elements? + for (; begin != end; ++begin) + std::iter_swap(begin, begin + GenerateWord32(0, end-begin-1)); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~RandomNumberGenerator() {} +#endif + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + byte GetByte() {return GenerateByte();} + unsigned int GetBit() {return GenerateBit();} + word32 GetLong(word32 a=0, word32 b=0xffffffffL) {return GenerateWord32(a, b);} + word16 GetShort(word16 a=0, word16 b=0xffff) {return (word16)GenerateWord32(a, b);} + void GetBlock(byte *output, size_t size) {GenerateBlock(output, size);} +#endif + +}; + +//! \brief Random Number Generator that does not produce random numbers +//! \returns reference that can be passed to functions that require a RandomNumberGenerator +//! \details NullRNG() returns a reference that can be passed to functions that require a +//! RandomNumberGenerator but don't actually use it. The NullRNG() throws NotImplemented +//! when a generation function is called. +//! \sa ClassNullRNG +CRYPTOPP_DLL RandomNumberGenerator & CRYPTOPP_API NullRNG(); + +//! \class WaitObjectContainer +class WaitObjectContainer; +//! \class CallStack +class CallStack; + +//! \brief Interface for objects that can be waited on. +class CRYPTOPP_NO_VTABLE Waitable +{ +public: + virtual ~Waitable() {} + + //! \brief Maximum number of wait objects that this object can return + virtual unsigned int GetMaxWaitObjectCount() const =0; + + //! \brief Retrieves waitable objects + //! \param container the wait container to receive the references to the objects. + //! \param callStack CallStack object used to select waitable objects + //! \details GetWaitObjects is usually called in one of two ways. First, it can + //! be called like something.GetWaitObjects(c, CallStack("my func after X", 0));. + //! Second, if in an outer GetWaitObjects() method that itself takes a callStack + //! parameter, it can be called like + //! innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));. + virtual void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) =0; + + //! wait on this object + /*! same as creating an empty container, calling GetWaitObjects(), and calling Wait() on the container */ + bool Wait(unsigned long milliseconds, CallStack const& callStack); +}; + +//! \brief Default channel for BufferedTransformation +//! \details DEFAULT_CHANNEL is equal to an empty string +// VALVE, don't use a real object here as a global, make it a basic type so construction +// order doesn't screw us (Alfred) +//extern CRYPTOPP_DLL const std::string DEFAULT_CHANNEL; +extern CRYPTOPP_DLL const char *DEFAULT_CHANNEL; + +//! \brief Channel for additional authenticated data +//! \details AAD_CHANNEL is equal to "AAD" +extern CRYPTOPP_DLL const std::string AAD_CHANNEL; + +//! \brief Interface for buffered transformations +//! \details BufferedTransformation is a generalization of BlockTransformation, +//! StreamTransformation and HashTransformation. +//! \details A buffered transformation is an object that takes a stream of bytes as input (this may +//! be done in stages), does some computation on them, and then places the result into an internal +//! buffer for later retrieval. Any partial result already in the output buffer is not modified +//! by further input. +//! \details If a method takes a "blocking" parameter, and you pass false for it, then the method +//! will return before all input has been processed if the input cannot be processed without waiting +//! (for network buffers to become available, for example). In this case the method will return true +//! or a non-zero integer value. When this happens you must continue to call the method with the same +//! parameters until it returns false or zero, before calling any other method on it or attached +//! /p BufferedTransformation. The integer return value in this case is approximately +//! the number of bytes left to be processed, and can be used to implement a progress bar. +//! \details For functions that take a "propagation" parameter, propagation != 0 means pass on +//! the signal to attached BufferedTransformation objects, with propagation decremented at each +//! step until it reaches 0. -1 means unlimited propagation. +//! \details \a All of the retrieval functions, like Get() and GetWord32(), return the actual +//! number of bytes retrieved, which is the lesser of the request number and MaxRetrievable(). +//! \details \a Most of the input functions, like Put() and PutWord32(), return the number of +//! bytes remaining to be processed. A 0 value means all bytes were processed, and a non-0 value +//! means bytes remain to be processed. +//! \nosubgrouping +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm, public Waitable +{ +public: + // placed up here for CW8 + static const std::string &NULL_CHANNEL; // same as DEFAULT_CHANNEL, for backwards compatibility + + BufferedTransformation() : Algorithm(false) {} + + //! \brief Provides a reference to this object + //! \returns A reference to this object + //! \details Useful for passing a temporary object to a function that takes a non-const reference + BufferedTransformation& Ref() {return *this;} + + //! \name INPUT + //@{ + + //! \brief Input a byte for processing + //! \param inByte the 8-bit byte (octet) to be processed. + //! \param blocking specifies whether the object should block when processing input. + //! \returns the number of bytes that remain in the block (i.e., bytes not processed) + //! \details Put(byte) calls Put(byte*, size_t). + size_t Put(byte inByte, bool blocking=true) + {return Put(&inByte, 1, blocking);} + + //! \brief Input a byte buffer for processing + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param blocking specifies whether the object should block when processing input + //! \returns the number of bytes that remain in the block (i.e., bytes not processed) + //! \details Internally, Put() calls Put2(). + size_t Put(const byte *inString, size_t length, bool blocking=true) + {return Put2(inString, length, 0, blocking);} + + //! Input a 16-bit word for processing. + //! \param value the 16-bit value to be processed + //! \param order the ByteOrder in which the word should be processed + //! \param blocking specifies whether the object should block when processing input + //! \returns the number of bytes that remain in the block (i.e., bytes not processed) + size_t PutWord16(word16 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); + + //! Input a 32-bit word for processing. + //! \param value the 32-bit value to be processed. + //! \param order the ByteOrder in which the word should be processed. + //! \param blocking specifies whether the object should block when processing input. + //! \returns the number of bytes that remain in the block (i.e., bytes not processed) + size_t PutWord32(word32 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); + + //! \brief Request space which can be written into by the caller + //! \param size the requested size of the buffer + //! \details The purpose of this method is to help avoid extra memory allocations. + //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made, + //! size is the requested size of the buffer. When the call returns, size is the size of + //! the array returned to the caller. + //! \details The base class implementation sets size to 0 and returns NULL. + //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of + //! an ArraySink, the pointer to the array is returned and the size is remaining size. + virtual byte * CreatePutSpace(size_t &size) + {size=0; return NULL;} + + //! \brief Determines whether input can be modifed by the callee + //! \returns true if input can be modified, false otherwise + //! \details The base class implementation returns false. + virtual bool CanModifyInput() const + {return false;} + + //! \brief Input multiple bytes that may be modified by callee. + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param blocking specifies whether the object should block when processing input + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed + size_t PutModifiable(byte *inString, size_t length, bool blocking=true) + {return PutModifiable2(inString, length, 0, blocking);} + + //! \brief Signals the end of messages to the object + //! \param propagation the number of attached transformations the MessageEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + bool MessageEnd(int propagation=-1, bool blocking=true) + {return !!Put2(NULL, 0, propagation < 0 ? -1 : propagation+1, blocking);} + + //! \brief Input multiple bytes for processing and signal the end of a message + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param propagation the number of attached transformations the MessageEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \details Internally, PutMessageEnd() calls Put2() with a modified propagation to + //! ensure all attached transformations finish processing the message. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + size_t PutMessageEnd(const byte *inString, size_t length, int propagation=-1, bool blocking=true) + {return Put2(inString, length, propagation < 0 ? -1 : propagation+1, blocking);} + + //! \brief Input multiple bytes for processing + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one + //! \param blocking specifies whether the object should block when processing input + //! \details Derived classes must implement Put2(). + virtual size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) =0; + + //! \brief Input multiple bytes that may be modified by callee. + //! \param inString the byte buffer to process. + //! \param length the size of the string, in bytes. + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one. + //! \param blocking specifies whether the object should block when processing input. + //! \details Internally, PutModifiable2() calls Put2(). + virtual size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking) + {return Put2(inString, length, messageEnd, blocking);} + + //! \brief thrown by objects that have not implemented nonblocking input processing + struct BlockingInputOnly : public NotImplemented + {BlockingInputOnly(const std::string &s) : NotImplemented(s + ": Nonblocking input is not implemented by this object.") {}}; + //@} + + //! \name WAITING + //@{ + //! \brief Retrieves the maximum number of waitable objects + unsigned int GetMaxWaitObjectCount() const; + + //! \brief Retrieves waitable objects + //! \param container the wait container to receive the references to the objects + //! \param callStack CallStack object used to select waitable objects + //! \details GetWaitObjects is usually called in one of two ways. First, it can + //! be called like something.GetWaitObjects(c, CallStack("my func after X", 0));. + //! Second, if in an outer GetWaitObjects() method that itself takes a callStack + //! parameter, it can be called like + //! innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));. + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + //@} // WAITING + + //! \name SIGNALS + //@{ + + //! \brief Initialize or reinitialize this object, without signal propagation + //! \param parameters a set of NameValuePairs used to initialize this object + //! \throws NotImplemented + //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable + //! number of arbitrarily typed arguments. The function avoids the need for multiple constuctors providing + //! all possible combintations of configurable parameters. + //! \details IsolatedInitialize() does not call Initialize() on attached transformations. If initialization + //! should be propagated, then use the Initialize() function. + //! \details Setting propagation to -1 means unlimited propagation. + //! \details If a derived class does not override IsolatedInitialize(), then the base class throws + //! NotImplemented. + virtual void IsolatedInitialize(const NameValuePairs ¶meters) { + CRYPTOPP_UNUSED(parameters); + throw NotImplemented("BufferedTransformation: this object can't be reinitialized"); + } + + //! \brief Flushes data buffered by this object, without signal propagation + //! \param hardFlush indicates whether all data should be flushed + //! \param blocking specifies whether the object should block when processing input + //! \note hardFlush must be used with care + virtual bool IsolatedFlush(bool hardFlush, bool blocking) =0; + + //! \brief Marks the end of a series of messages, without signal propagation + //! \param blocking specifies whether the object should block when completing the processing on + //! the current series of messages + virtual bool IsolatedMessageSeriesEnd(bool blocking) + {CRYPTOPP_UNUSED(blocking); return false;} + + //! \brief Initialize or reinitialize this object, with signal propagation + //! \param parameters a set of NameValuePairs used to initialize or reinitialize this object + //! and attached transformations + //! \param propagation the number of attached transformations the Initialize() signal should be passed + //! \details Initialize() is used to initialize or reinitialize an object using a variable number of + //! arbitrarily typed arguments. The function avoids the need for multiple constuctors providing + //! all possible combintations of configurable parameters. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1); + + //! \brief Flush buffered input and/or output, with signal propagation + //! \param hardFlush is used to indicate whether all data should be flushed + //! \param propagation the number of attached transformations the Flush() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + //! \note Hard flushes must be used with care. It means try to process and output everything, even if + //! there may not be enough data to complete the action. For example, hard flushing a HexDecoder + //! would cause an error if you do it after inputing an odd number of hex encoded characters. + //! \note For some types of filters, like ZlibDecompressor, hard flushes can only + //! be done at "synchronization points". These synchronization points are positions in the data + //! stream that are created by hard flushes on the corresponding reverse filters, in this + //! example ZlibCompressor. This is useful when zlib compressed data is moved across a + //! network in packets and compression state is preserved across packets, as in the SSH2 protocol. + virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true); + + //! \brief Marks the end of a series of messages, with signal propagation + //! \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \details Each object that receives the signal will perform its processing, decrement + //! propagation, and then pass the signal on to attached transformations if the value is not 0. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + //! \note There should be a MessageEnd() immediately before MessageSeriesEnd(). + virtual bool MessageSeriesEnd(int propagation=-1, bool blocking=true); + + //! \brief Set propagation of automatically generated and transferred signals + //! \param propagation then new value + //! \details Setting propagation to 0 means do not automaticly generate signals. Setting + //! propagation to -1 means unlimited propagation. + virtual void SetAutoSignalPropagation(int propagation) + {CRYPTOPP_UNUSED(propagation);} + + //! \brief Retrieve automatic signal propagation value + virtual int GetAutoSignalPropagation() const {return 0;} +public: + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + void Close() {MessageEnd();} +#endif + //@} + + //! \name RETRIEVAL OF ONE MESSAGE + //@{ + + //! \brief Provides the number of bytes ready for retrieval + //! \returns the number of bytes ready for retrieval + //! \details All retrieval functions return the actual number of bytes retrieved, which is + //! the lesser of the request number and MaxRetrievable() + virtual lword MaxRetrievable() const; + + //! \brief Determines whether bytes are ready for retrieval + //! \returns true if bytes are available for retrieval, false otherwise + virtual bool AnyRetrievable() const; + + //! \brief Retrieve a 8-bit byte + //! \param outByte the 8-bit value to be retrieved + //! \returns the number of bytes consumed during the call. + //! \details Use the return value of Get to detect short reads. + virtual size_t Get(byte &outByte); + + //! \brief Retrieve a block of bytes + //! \param outString a block of bytes + //! \param getMax the number of bytes to Get + //! \returns the number of bytes consumed during the call. + //! \details Use the return value of Get to detect short reads. + virtual size_t Get(byte *outString, size_t getMax); + + //! \brief Peek a 8-bit byte + //! \param outByte the 8-bit value to be retrieved + //! \returns the number of bytes read during the call. + //! \details Peek does not remove bytes from the object. Use the return value of + //! Get to detect short reads. + virtual size_t Peek(byte &outByte) const; + + //! \brief Peek a block of bytes + //! \param outString a block of bytes + //! \param peekMax the number of bytes to Peek + //! \returns the number of bytes read during the call. + //! \details Peek does not remove bytes from the object. Use the return value of + //! Get to detect short reads. + virtual size_t Peek(byte *outString, size_t peekMax) const; + + //! \brief Retrieve a 16-bit word + //! \param value the 16-bit value to be retrieved + //! \param order the ByteOrder in which the word should be retrieved + //! \returns the number of bytes consumed during the call. + //! \details Use the return value of GetWord16 to detect short reads. + size_t GetWord16(word16 &value, ByteOrder order=BIG_ENDIAN_ORDER); + + //! \brief Retrieve a 32-bit word + //! \param value the 32-bit value to be retrieved + //! \param order the ByteOrder in which the word should be retrieved + //! \returns the number of bytes consumed during the call. + //! \details Use the return value of GetWord16 to detect short reads. + size_t GetWord32(word32 &value, ByteOrder order=BIG_ENDIAN_ORDER); + + //! \brief Peek a 16-bit word + //! \param value the 16-bit value to be retrieved + //! \param order the ByteOrder in which the word should be retrieved + //! \returns the number of bytes consumed during the call. + //! \details Peek does not consume bytes in the stream. Use the return value + //! of GetWord16 to detect short reads. + size_t PeekWord16(word16 &value, ByteOrder order=BIG_ENDIAN_ORDER) const; + + //! \brief Peek a 32-bit word + //! \param value the 32-bit value to be retrieved + //! \param order the ByteOrder in which the word should be retrieved + //! \returns the number of bytes consumed during the call. + //! \details Peek does not consume bytes in the stream. Use the return value + //! of GetWord16 to detect short reads. + size_t PeekWord32(word32 &value, ByteOrder order=BIG_ENDIAN_ORDER) const; + + //! move transferMax bytes of the buffered output to target as input + + //! \brief Transfer bytes from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param transferMax the number of bytes to transfer + //! \param channel the channel on which the transfer should occur + //! \returns the number of bytes transferred during the call. + //! \details TransferTo removes bytes from this object and moves them to the destination. + //! \details The function always returns transferMax. If an accurate count is needed, then use TransferTo2. + lword TransferTo(BufferedTransformation &target, lword transferMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) + {TransferTo2(target, transferMax, channel); return transferMax;} + + //! \brief Discard skipMax bytes from the output buffer + //! \param skipMax the number of bytes to discard + //! \details Skip always returns skipMax. + virtual lword Skip(lword skipMax=LWORD_MAX); + + //! copy copyMax bytes of the buffered output to target as input + + //! \brief Copy bytes from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param copyMax the number of bytes to copy + //! \param channel the channel on which the transfer should occur + //! \returns the number of bytes copied during the call. + //! \details CopyTo copies bytes from this object to the destination. The bytes are not removed from this object. + //! \details The function always returns copyMax. If an accurate count is needed, then use CopyRangeTo2. + lword CopyTo(BufferedTransformation &target, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const + {return CopyRangeTo(target, 0, copyMax, channel);} + + //! \brief Copy bytes from this object using an index to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param position the 0-based index of the byte stream to begin the copying + //! \param copyMax the number of bytes to copy + //! \param channel the channel on which the transfer should occur + //! \returns the number of bytes copied during the call. + //! \details CopyTo copies bytes from this object to the destination. The bytes remain in this + //! object. Copying begins at the index position in the current stream, and not from an absolute + //! position in the stream. + //! \details The function returns the new position in the stream after transferring the bytes starting at the index. + lword CopyRangeTo(BufferedTransformation &target, lword position, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const + {lword i = position; CopyRangeTo2(target, i, i+copyMax, channel); return i-position;} + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + unsigned long MaxRetrieveable() const {return MaxRetrievable();} +#endif + //@} + + //! \name RETRIEVAL OF MULTIPLE MESSAGES + //@{ + + //! \brief Provides the number of bytes ready for retrieval + //! \returns the number of bytes ready for retrieval + virtual lword TotalBytesRetrievable() const; + + //! \brief Provides the number of meesages processed by this object + //! \returns the number of meesages processed by this object + //! \details NumberOfMessages returns number of times MessageEnd() has been + //! received minus messages retrieved or skipped + virtual unsigned int NumberOfMessages() const; + + //! \brief Determines if any messages are available for retrieval + //! \returns true if NumberOfMessages() > 0, false otherwise + //! \details AnyMessages returns true if NumberOfMessages() > 0 + virtual bool AnyMessages() const; + + //! \brief Start retrieving the next message + //! \returns true if a message is ready for retrieval + //! \details GetNextMessage() returns true if a message is ready for retrieval; false + //! if no more messages exist or this message is not completely retrieved. + virtual bool GetNextMessage(); + + //! \brief Skip a number of meessages + //! \returns 0 if the requested number of messages was skipped, non-0 otherwise + //! \details SkipMessages() skips count number of messages. If there is an AttachedTransformation() + //! then SkipMessages() is called on the attached transformation. If there is no attached + //! transformation, then count number of messages are sent to TheBitBucket() using TransferMessagesTo(). + virtual unsigned int SkipMessages(unsigned int count=UINT_MAX); + + //! \brief Transfer messages from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param count the number of messages to transfer + //! \param channel the channel on which the transfer should occur + //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) + //! \details TransferMessagesTo2 removes messages from this object and moves them to the destination. + //! If all bytes are not transferred for a message, then processing stops and the number of remaining + //! bytes is returned. TransferMessagesTo() does not proceed to the next message. + //! \details A return value of 0 indicates all messages were successfully transferred. + unsigned int TransferMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) + {TransferMessagesTo2(target, count, channel); return count;} + + //! \brief Copies messages from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param count the number of messages to transfer + //! \param channel the channel on which the transfer should occur + //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) + //! \details CopyMessagesTo copies messages from this object and copies them to the destination. + //! If all bytes are not transferred for a message, then processing stops and the number of remaining + //! bytes is returned. CopyMessagesTo() does not proceed to the next message. + //! \details A return value of 0 indicates all messages were successfully copied. + unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const; + + //! + virtual void SkipAll(); + //! + void TransferAllTo(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL) + {TransferAllTo2(target, channel);} + //! + void CopyAllTo(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL) const; + + virtual bool GetNextMessageSeries() {return false;} + virtual unsigned int NumberOfMessagesInThisSeries() const {return NumberOfMessages();} + virtual unsigned int NumberOfMessageSeries() const {return 0;} + //@} + + //! \name NON-BLOCKING TRANSFER OF OUTPUT + //@{ + + // upon return, byteCount contains number of bytes that have finished being transfered, + // and returns the number of bytes left in the current transfer block + + //! \brief Transfer bytes from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param byteCount the number of bytes to transfer + //! \param channel the channel on which the transfer should occur + //! \param blocking specifies whether the object should block when processing input + //! \returns the number of bytes that remain in the transfer block (i.e., bytes not transferred) + //! \details TransferTo removes bytes from this object and moves them to the destination. + //! Transfer begins at the index position in the current stream, and not from an absolute + //! position in the stream. + //! \details byteCount is an \a IN and \a OUT parameter. When the call is made, + //! byteCount is the requested size of the transfer. When the call returns, byteCount is + //! the number of bytes that were transferred. + virtual size_t TransferTo2(BufferedTransformation &target, lword &byteCount, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) =0; + + // upon return, begin contains the start position of data yet to be finished copying, + // and returns the number of bytes left in the current transfer block + + //! \brief Copy bytes from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param begin the 0-based index of the first byte to copy in the stream + //! \param end the 0-based index of the last byte to copy in the stream + //! \param channel the channel on which the transfer should occur + //! \param blocking specifies whether the object should block when processing input + //! \returns the number of bytes that remain in the copy block (i.e., bytes not copied) + //! \details CopyRangeTo2 copies bytes from this object to the destination. The bytes are not + //! removed from this object. Copying begins at the index position in the current stream, and + //! not from an absolute position in the stream. + //! \details begin is an \a IN and \a OUT parameter. When the call is made, begin is the + //! starting position of the copy. When the call returns, begin is the position of the first + //! byte that was \a not copied (which may be different tahn end). begin can be used for + //! subsequent calls to CopyRangeTo2. + virtual size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const =0; + + // upon return, messageCount contains number of messages that have finished being transfered, + // and returns the number of bytes left in the current transfer block + + //! \brief Transfer messages from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param messageCount the number of messages to transfer + //! \param channel the channel on which the transfer should occur + //! \param blocking specifies whether the object should block when processing input + //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) + //! \details TransferMessagesTo2 removes messages from this object and moves them to the destination. + size_t TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + + // returns the number of bytes left in the current transfer block + + //! \brief Transfer all bytes from this object to another BufferedTransformation + //! \param target the destination BufferedTransformation + //! \param channel the channel on which the transfer should occur + //! \param blocking specifies whether the object should block when processing input + //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) + //! \details TransferMessagesTo2 removes messages from this object and moves them to the destination. + size_t TransferAllTo2(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + //@} + + //! \name CHANNELS + //@{ + //! \brief Exception thrown when a filter does not support named channels + struct NoChannelSupport : public NotImplemented + {NoChannelSupport(const std::string &name) : NotImplemented(name + ": this object doesn't support multiple channels") {}}; + //! \brief Exception thrown when a filter does not recognize a named channel + struct InvalidChannelName : public InvalidArgument + {InvalidChannelName(const std::string &name, const std::string &channel) : InvalidArgument(name + ": unexpected channel name \"" + channel + "\"") {}}; + + //! \brief Input a byte for processing on a channel + //! \param channel the channel to process the data. + //! \param inByte the 8-bit byte (octet) to be processed. + //! \param blocking specifies whether the object should block when processing input. + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + size_t ChannelPut(const std::string &channel, byte inByte, bool blocking=true) + {return ChannelPut(channel, &inByte, 1, blocking);} + + //! \brief Input a byte buffer for processing on a channel + //! \param channel the channel to process the data + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param blocking specifies whether the object should block when processing input + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + size_t ChannelPut(const std::string &channel, const byte *inString, size_t length, bool blocking=true) + {return ChannelPut2(channel, inString, length, 0, blocking);} + + //! \brief Input multiple bytes that may be modified by callee on a channel + //! \param channel the channel to process the data. + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param blocking specifies whether the object should block when processing input + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + size_t ChannelPutModifiable(const std::string &channel, byte *inString, size_t length, bool blocking=true) + {return ChannelPutModifiable2(channel, inString, length, 0, blocking);} + + //! \brief Input a 16-bit word for processing on a channel. + //! \param channel the channel to process the data. + //! \param value the 16-bit value to be processed. + //! \param order the ByteOrder in which the word should be processed. + //! \param blocking specifies whether the object should block when processing input. + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + size_t ChannelPutWord16(const std::string &channel, word16 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); + + //! \brief Input a 32-bit word for processing on a channel. + //! \param channel the channel to process the data. + //! \param value the 32-bit value to be processed. + //! \param order the ByteOrder in which the word should be processed. + //! \param blocking specifies whether the object should block when processing input. + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + size_t ChannelPutWord32(const std::string &channel, word32 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); + + //! \brief Signal the end of a message + //! \param channel the channel to process the data. + //! \param propagation the number of attached transformations the ChannelMessageEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + bool ChannelMessageEnd(const std::string &channel, int propagation=-1, bool blocking=true) + {return !!ChannelPut2(channel, NULL, 0, propagation < 0 ? -1 : propagation+1, blocking);} + + //! \brief Input multiple bytes for processing and signal the end of a message + //! \param channel the channel to process the data. + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param propagation the number of attached transformations the ChannelPutMessageEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + size_t ChannelPutMessageEnd(const std::string &channel, const byte *inString, size_t length, int propagation=-1, bool blocking=true) + {return ChannelPut2(channel, inString, length, propagation < 0 ? -1 : propagation+1, blocking);} + + //! \brief Request space which can be written into by the caller + //! \param channel the channel to process the data + //! \param size the requested size of the buffer + //! \details The purpose of this method is to help avoid extra memory allocations. + //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made, + //! size is the requested size of the buffer. When the call returns, size is the size of + //! the array returned to the caller. + //! \details The base class implementation sets size to 0 and returns NULL. + //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of + //! an ArraySink, the pointer to the array is returned and the size is remaining size. + virtual byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); + + //! \brief Input multiple bytes for processing on a channel. + //! \param channel the channel to process the data. + //! \param inString the byte buffer to process. + //! \param length the size of the string, in bytes. + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one. + //! \param blocking specifies whether the object should block when processing input. + virtual size_t ChannelPut2(const std::string &channel, const byte *inString, size_t length, int messageEnd, bool blocking); + + //! \brief Input multiple bytes that may be modified by callee on a channel + //! \param channel the channel to process the data + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one + //! \param blocking specifies whether the object should block when processing input + virtual size_t ChannelPutModifiable2(const std::string &channel, byte *inString, size_t length, int messageEnd, bool blocking); + + //! \brief Flush buffered input and/or output on a channel + //! \param channel the channel to flush the data + //! \param hardFlush is used to indicate whether all data should be flushed + //! \param propagation the number of attached transformations the ChannelFlush() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true); + + //! \brief Marks the end of a series of messages on a channel + //! \param channel the channel to signal the end of a series of messages + //! \param propagation the number of attached transformations the ChannelMessageSeriesEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \details Each object that receives the signal will perform its processing, decrement + //! propagation, and then pass the signal on to attached transformations if the value is not 0. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + //! \note There should be a MessageEnd() immediately before MessageSeriesEnd(). + virtual bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); + + //! \brief Sets the default retrieval channel + //! \param channel the channel to signal the end of a series of messages + //! \note this function may not be implemented in all objects that should support it. + virtual void SetRetrievalChannel(const std::string &channel); + //@} + + //! \name ATTACHMENT + /*! Some BufferedTransformation objects (e.g. Filter objects) + allow other BufferedTransformation objects to be attached. When + this is done, the first object instead of buffering its output, + sends that output to the attached object as input. The entire + attachment chain is deleted when the anchor object is destructed. + */ + //@{ + //! \brief Determines whether the object allows attachment + //! \returns true if the object allows an attachment, false otherwise + //! \details Sources and Filters will return true, while Sinks and other objects will return false. + virtual bool Attachable() {return false;} + + //! \brief Returns the object immediately attached to this object + //! \details AttachedTransformation returns NULL if there is no attachment + virtual BufferedTransformation *AttachedTransformation() {assert(!Attachable()); return 0;} + + //! \brief Returns the object immediately attached to this object + //! \details AttachedTransformation returns NULL if there is no attachment + virtual const BufferedTransformation *AttachedTransformation() const + {return const_cast(this)->AttachedTransformation();} + + //! \brief Delete the current attachment chain and attach a new one + //! \param newAttachment the new BufferedTransformation to attach + //! \throws NotImplemented + //! \details Detach delete the current attachment chain and replace it with an optional newAttachment + //! \details If a derived class does not override Detach, then the base class throws + //! NotImplemented. + virtual void Detach(BufferedTransformation *newAttachment = 0) { + CRYPTOPP_UNUSED(newAttachment); assert(!Attachable()); + throw NotImplemented("BufferedTransformation: this object is not attachable"); + } + + //! \brief Add newAttachment to the end of attachment chain + //! \param newAttachment the attachment to add to the end of the chain + + virtual void Attach(BufferedTransformation *newAttachment); + //@} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~BufferedTransformation() {} +#endif + +protected: + //! \brief Decrements the propagation count while clamping at 0 + //! \returns the decremented propagation or 0 + static int DecrementPropagation(int propagation) + {return propagation != 0 ? propagation - 1 : 0;} + +private: + byte m_buf[4]; // for ChannelPutWord16 and ChannelPutWord32, to ensure buffer isn't deallocated before non-blocking operation completes +}; + +//! \brief An input discarding BufferedTransformation +//! \returns a reference to a BufferedTransformation object that discards all input +CRYPTOPP_DLL BufferedTransformation & TheBitBucket(); + +//! \class CryptoMaterial +//! \brief Interface for crypto material, such as public and private keys, and crypto parameters +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoMaterial : public NameValuePairs +{ +public: + //! exception thrown when invalid crypto material is detected + class CRYPTOPP_DLL InvalidMaterial : public InvalidDataFormat + { + public: + explicit InvalidMaterial(const std::string &s) : InvalidDataFormat(s) {} + }; + + //! \brief Assign values to this object + /*! \details This function can be used to create a public key from a private key. */ + virtual void AssignFrom(const NameValuePairs &source) =0; + + //! \brief Check this object for errors + //! \param rng a RandomNumberGenerator for objects which use randomized testing + //! \param level the level of thoroughness + //! \returns true if the tests succeed, false otherwise + //! \details There are four levels of thoroughness: + //!
    + //!
  • 0 - using this object won't cause a crash or exception + //!
  • 1 - this object will probably function, and encrypt, sign, other operations correctly + //!
  • 2 - ensure this object will function correctly, and perform reasonable security checks + //!
  • 3 - perform reasonable security checks, and do checks that may take a long time + //!
+ //! \details Level 0 does not require a RandomNumberGenerator. A NullRNG() can be used for level 0. + //! \details Level 1 may not check for weak keys and such. + //! \details Levels 2 and 3 are recommended. + virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0; + + //! \brief Check this object for errors + //! \param rng a RandomNumberGenerator for objects which use randomized testing + //! \param level the level of thoroughness + //! \throws InvalidMaterial + //! \details Internally, ThrowIfInvalid() calls Validate() and throws InvalidMaterial if validation fails. + virtual void ThrowIfInvalid(RandomNumberGenerator &rng, unsigned int level) const + {if (!Validate(rng, level)) throw InvalidMaterial("CryptoMaterial: this object contains invalid values");} + + //! \brief Saves a key to a BufferedTransformation + //! \param bt the destination BufferedTransformation + //! \throws NotImplemented + //! \details Save writes the material to a BufferedTransformation. + //! \details If the material is a key, then the key is written with ASN.1 DER encoding. The key + //! includes an object identifier with an algorthm id, like a subjectPublicKeyInfo. + //! \details A "raw" key without the "key info" can be saved using a key's DEREncode method. + //! \details If a derived class does not override Save, then the base class throws + //! NotImplemented. + virtual void Save(BufferedTransformation &bt) const + {CRYPTOPP_UNUSED(bt); throw NotImplemented("CryptoMaterial: this object does not support saving");} + + //! \brief Loads a key from a BufferedTransformation + //! \param bt the source BufferedTransformation + //! \throws KeyingErr + //! \details Load attempts to read material from a BufferedTransformation. If the + //! material is a key that was generated outside the library, then the following + //! usually applies: + //!
    + //!
  • the key should be ASN.1 BER encoded + //!
  • the key should be a "key info" + //!
+ //! \details "key info" means the key should have an object identifier with an algorthm id, + //! like a subjectPublicKeyInfo. + //! \details To read a "raw" key without the "key info", then call the key's BERDecode method. + //! \note Load generally does not check that the key is valid. Call Validate(), if needed. + virtual void Load(BufferedTransformation &bt) + {CRYPTOPP_UNUSED(bt); throw NotImplemented("CryptoMaterial: this object does not support loading");} + + //! \brief Determines whether the object supports precomputation + //! \returns true if the object supports precomputation, false otherwise + virtual bool SupportsPrecomputation() const {return false;} + + //! \brief Perform precomputation + //! \param precomputationStorage the suggested number of objects for the precompute table + //! \throws NotImplemented + //! \details The exact semantics of Precompute() varies, but it typically means calculate + //! a table of n objects that can be used later to speed up computation. + //! \details If a derived class does not override Precompute, then the base class throws + //! NotImplemented. + virtual void Precompute(unsigned int precomputationStorage) { + CRYPTOPP_UNUSED(precomputationStorage); assert(!SupportsPrecomputation()); + throw NotImplemented("CryptoMaterial: this object does not support precomputation"); + } + + //! retrieve previously saved precomputation + virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation) + {CRYPTOPP_UNUSED(storedPrecomputation); assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");} + //! save precomputation for later use + virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const + {CRYPTOPP_UNUSED(storedPrecomputation); assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");} + + // for internal library use + void DoQuickSanityCheck() const {ThrowIfInvalid(NullRNG(), 0);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~CryptoMaterial() {} +#endif + +#if (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) + // Sun Studio 11/CC 5.8 workaround: it generates incorrect code when casting to an empty virtual base class + char m_sunCCworkaround; +#endif +}; + +//! \class GeneratableCryptoMaterial +//! \brief Interface for generatable crypto material, such as private keys and crypto parameters +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE GeneratableCryptoMaterial : virtual public CryptoMaterial +{ +public: + + //! \brief Generate a random key or crypto parameters + //! \param rng a RandomNumberGenerator to produce keying material + //! \param params additional initialization parameters + //! \throws KeyingErr if a key can't be generated or algorithm parameters are invalid + //! \details If a derived class does not override GenerateRandom, then the base class throws + //! NotImplemented. + virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs) { + CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(params); + throw NotImplemented("GeneratableCryptoMaterial: this object does not support key/parameter generation"); + } + + //! \brief Generate a random key or crypto parameters + //! \param rng a RandomNumberGenerator to produce keying material + //! \param keySize the size of the key, in bits + //! \throws KeyingErr if a key can't be generated or algorithm parameters are invalid + //! \details GenerateRandomWithKeySize calls GenerateRandom with a NameValuePairs + //! object with only "KeySize" + void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize); + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~GeneratableCryptoMaterial() {} +#endif +}; + +//! \brief Interface for public keys + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKey : virtual public CryptoMaterial +{ +}; + +//! \brief Interface for private keys + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKey : public GeneratableCryptoMaterial +{ +}; + +//! \brief Interface for crypto prameters + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoParameters : public GeneratableCryptoMaterial +{ +}; + +//! \brief Interface for asymmetric algorithms + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AsymmetricAlgorithm : public Algorithm +{ +public: + //! returns a reference to the crypto material used by this object + virtual CryptoMaterial & AccessMaterial() =0; + //! returns a const reference to the crypto material used by this object + virtual const CryptoMaterial & GetMaterial() const =0; + + //! for backwards compatibility, calls AccessMaterial().Load(bt) + void BERDecode(BufferedTransformation &bt) + {AccessMaterial().Load(bt);} + //! for backwards compatibility, calls GetMaterial().Save(bt) + void DEREncode(BufferedTransformation &bt) const + {GetMaterial().Save(bt);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~AsymmetricAlgorithm() {} +#endif +}; + +//! \brief Interface for asymmetric algorithms using public keys + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKeyAlgorithm : public AsymmetricAlgorithm +{ +public: + // VC60 workaround: no co-variant return type + CryptoMaterial & AccessMaterial() {return AccessPublicKey();} + const CryptoMaterial & GetMaterial() const {return GetPublicKey();} + + virtual PublicKey & AccessPublicKey() =0; + virtual const PublicKey & GetPublicKey() const {return const_cast(this)->AccessPublicKey();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PublicKeyAlgorithm() {} +#endif +}; + +//! \brief Interface for asymmetric algorithms using private keys + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKeyAlgorithm : public AsymmetricAlgorithm +{ +public: + CryptoMaterial & AccessMaterial() {return AccessPrivateKey();} + const CryptoMaterial & GetMaterial() const {return GetPrivateKey();} + + virtual PrivateKey & AccessPrivateKey() =0; + virtual const PrivateKey & GetPrivateKey() const {return const_cast(this)->AccessPrivateKey();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PrivateKeyAlgorithm() {} +#endif +}; + +//! \brief Interface for key agreement algorithms + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE KeyAgreementAlgorithm : public AsymmetricAlgorithm +{ +public: + CryptoMaterial & AccessMaterial() {return AccessCryptoParameters();} + const CryptoMaterial & GetMaterial() const {return GetCryptoParameters();} + + virtual CryptoParameters & AccessCryptoParameters() =0; + virtual const CryptoParameters & GetCryptoParameters() const {return const_cast(this)->AccessCryptoParameters();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~KeyAgreementAlgorithm() {} +#endif +}; + +//! \brief Interface for public-key encryptors and decryptors + +/*! This class provides an interface common to encryptors and decryptors + for querying their plaintext and ciphertext lengths. +*/ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_CryptoSystem +{ +public: + virtual ~PK_CryptoSystem() {} + + //! maximum length of plaintext for a given ciphertext length + /*! \note This function returns 0 if ciphertextLength is not valid (too long or too short). */ + virtual size_t MaxPlaintextLength(size_t ciphertextLength) const =0; + + //! calculate length of ciphertext given length of plaintext + /*! \note This function returns 0 if plaintextLength is not valid (too long). */ + virtual size_t CiphertextLength(size_t plaintextLength) const =0; + + //! this object supports the use of the parameter with the given name + /*! some possible parameter names: EncodingParameters, KeyDerivationParameters */ + virtual bool ParameterSupported(const char *name) const =0; + + //! return fixed ciphertext length, if one exists, otherwise return 0 + /*! \note "Fixed" here means length of ciphertext does not depend on length of plaintext. + It usually does depend on the key length. */ + virtual size_t FixedCiphertextLength() const {return 0;} + + //! return maximum plaintext length given the fixed ciphertext length, if one exists, otherwise return 0 + virtual size_t FixedMaxPlaintextLength() const {return 0;} + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + size_t MaxPlainTextLength(size_t cipherTextLength) const {return MaxPlaintextLength(cipherTextLength);} + size_t CipherTextLength(size_t plainTextLength) const {return CiphertextLength(plainTextLength);} +#endif +}; + +//! \class PK_Encryptor +//! \brief Interface for public-key encryptors +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Encryptor : public PK_CryptoSystem, public PublicKeyAlgorithm +{ +public: + //! \brief Exception thrown when trying to encrypt plaintext of invalid length + class CRYPTOPP_DLL InvalidPlaintextLength : public Exception + { + public: + InvalidPlaintextLength() : Exception(OTHER_ERROR, "PK_Encryptor: invalid plaintext length") {} + }; + + //! \brief Encrypt a byte string + //! \param rng a RandomNumberGenerator derived class + //! \param plaintext the plaintext byte buffer + //! \param plaintextLength the size of the plaintext byte buffer + //! \param ciphertext a byte buffer to hold the encrypted string + //! \param parameters additional configuration options + //! \pre CiphertextLength(plaintextLength) != 0 ensures the plaintext isn't too large + //! \pre COUNTOF(ciphertext) == CiphertextLength(plaintextLength) ensures the output + //! byte buffer is large enough. + //! \sa PK_Decryptor + virtual void Encrypt(RandomNumberGenerator &rng, + const byte *plaintext, size_t plaintextLength, + byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const =0; + + //! \brief Create a new encryption filter + //! \note The caller is responsible for deleting the returned pointer. + //! \note Encoding parameters should be passed in the "EP" channel. + virtual BufferedTransformation * CreateEncryptionFilter(RandomNumberGenerator &rng, + BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters = g_nullNameValuePairs) const; +}; + +//! \class PK_Decryptor +//! \brief Interface for public-key decryptors +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Decryptor : public PK_CryptoSystem, public PrivateKeyAlgorithm +{ +public: + //! \brief Decrypt a byte string + //! \param rng a RandomNumberGenerator derived class + //! \param ciphertext the encrypted byte buffer + //! \param ciphertextLength the size of the encrypted byte buffer + //! \param plaintext a byte buffer to hold the decrypted string + //! \param parameters additional configuration options + //! \returns the result of the decryption operation + //! \pre COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output + //! byte buffer is large enough + //! \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength + //! is valid and holds the the actual length of the plaintext recovered. + //! on success. The result is undefined if decryption failed. If DecodingResult::isValidCoding + //! is false, then DecodingResult::messageLength is undefined. + //! \sa PK_Encryptor + virtual DecodingResult Decrypt(RandomNumberGenerator &rng, + const byte *ciphertext, size_t ciphertextLength, + byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const =0; + + //! create a new decryption filter + /*! \note caller is responsible for deleting the returned pointer + */ + virtual BufferedTransformation * CreateDecryptionFilter(RandomNumberGenerator &rng, + BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters = g_nullNameValuePairs) const; + + //! decrypt a fixed size ciphertext + DecodingResult FixedLengthDecrypt(RandomNumberGenerator &rng, const byte *ciphertext, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const + {return Decrypt(rng, ciphertext, FixedCiphertextLength(), plaintext, parameters);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PK_Decryptor() {} +#endif +}; + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY +typedef PK_CryptoSystem PK_FixedLengthCryptoSystem; +typedef PK_Encryptor PK_FixedLengthEncryptor; +typedef PK_Decryptor PK_FixedLengthDecryptor; +#endif + +//! \brief Interface for public-key signers and verifiers + +/*! This class provides an interface common to signers and verifiers + for querying scheme properties. +*/ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_SignatureScheme +{ +public: + //! invalid key exception, may be thrown by any function in this class if the private or public key has a length that can't be used + class CRYPTOPP_DLL InvalidKeyLength : public Exception + { + public: + InvalidKeyLength(const std::string &message) : Exception(OTHER_ERROR, message) {} + }; + + //! key too short exception, may be thrown by any function in this class if the private or public key is too short to sign or verify anything + class CRYPTOPP_DLL KeyTooShort : public InvalidKeyLength + { + public: + KeyTooShort() : InvalidKeyLength("PK_Signer: key too short for this signature scheme") {} + }; + + virtual ~PK_SignatureScheme() {} + + //! signature length if it only depends on the key, otherwise 0 + virtual size_t SignatureLength() const =0; + + //! maximum signature length produced for a given length of recoverable message part + virtual size_t MaxSignatureLength(size_t recoverablePartLength = 0) const + {CRYPTOPP_UNUSED(recoverablePartLength); return SignatureLength();} + + //! length of longest message that can be recovered, or 0 if this signature scheme does not support message recovery + virtual size_t MaxRecoverableLength() const =0; + + //! length of longest message that can be recovered from a signature of given length, or 0 if this signature scheme does not support message recovery + virtual size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const =0; + + //! requires a random number generator to sign + /*! if this returns false, NullRNG() can be passed to functions that take RandomNumberGenerator & */ + virtual bool IsProbabilistic() const =0; + + //! whether or not a non-recoverable message part can be signed + virtual bool AllowNonrecoverablePart() const =0; + + //! if this function returns true, during verification you must input the signature before the message, otherwise you can input it at anytime */ + virtual bool SignatureUpfront() const {return false;} + + //! whether you must input the recoverable part before the non-recoverable part during signing + virtual bool RecoverablePartFirst() const =0; +}; + +//! \brief Interface for accumulating messages to be signed or verified +/*! Only Update() should be called + on this class. No other functions inherited from HashTransformation should be called. +*/ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulator : public HashTransformation +{ +public: + //! should not be called on PK_MessageAccumulator + unsigned int DigestSize() const + {throw NotImplemented("PK_MessageAccumulator: DigestSize() should not be called");} + + //! should not be called on PK_MessageAccumulator + void TruncatedFinal(byte *digest, size_t digestSize) + { + CRYPTOPP_UNUSED(digest); CRYPTOPP_UNUSED(digestSize); + throw NotImplemented("PK_MessageAccumulator: TruncatedFinal() should not be called"); + } +}; + +//! \brief Interface for public-key signers + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Signer : public PK_SignatureScheme, public PrivateKeyAlgorithm +{ +public: + //! create a new HashTransformation to accumulate the message to be signed + virtual PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const =0; + + virtual void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const =0; + + //! sign and delete messageAccumulator (even in case of exception thrown) + /*! \pre size of signature == MaxSignatureLength() + \returns actual signature length + */ + virtual size_t Sign(RandomNumberGenerator &rng, PK_MessageAccumulator *messageAccumulator, byte *signature) const; + + //! sign and restart messageAccumulator + /*! \pre size of signature == MaxSignatureLength() + \returns actual signature length + */ + virtual size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const =0; + + //! sign a message + /*! \pre size of signature == MaxSignatureLength() + \returns actual signature length + */ + virtual size_t SignMessage(RandomNumberGenerator &rng, const byte *message, size_t messageLen, byte *signature) const; + + //! sign a recoverable message + /*! \pre size of signature == MaxSignatureLength(recoverableMessageLength) + \returns actual signature length + */ + virtual size_t SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, + const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PK_Signer() {} +#endif +}; + +//! \brief Interface for public-key signature verifiers +/*! The Recover* functions throw NotImplemented if the signature scheme does not support + message recovery. + The Verify* functions throw InvalidDataFormat if the scheme does support message + recovery and the signature contains a non-empty recoverable message part. The + Recovery* functions should be used in that case. +*/ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Verifier : public PK_SignatureScheme, public PublicKeyAlgorithm +{ +public: + //! create a new HashTransformation to accumulate the message to be verified + virtual PK_MessageAccumulator * NewVerificationAccumulator() const =0; + + //! input signature into a message accumulator + virtual void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const =0; + + //! check whether messageAccumulator contains a valid signature and message, and delete messageAccumulator (even in case of exception thrown) + virtual bool Verify(PK_MessageAccumulator *messageAccumulator) const; + + //! check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator + virtual bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const =0; + + //! check whether input signature is a valid signature for input message + virtual bool VerifyMessage(const byte *message, size_t messageLen, + const byte *signature, size_t signatureLength) const; + + //! recover a message from its signature + /*! \pre size of recoveredMessage == MaxRecoverableLengthFromSignatureLength(signatureLength) + */ + virtual DecodingResult Recover(byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const; + + //! recover a message from its signature + /*! \pre size of recoveredMessage == MaxRecoverableLengthFromSignatureLength(signatureLength) + */ + virtual DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const =0; + + //! recover a message from its signature + /*! \pre size of recoveredMessage == MaxRecoverableLengthFromSignatureLength(signatureLength) + */ + virtual DecodingResult RecoverMessage(byte *recoveredMessage, + const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, + const byte *signature, size_t signatureLength) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PK_Verifier() {} +#endif +}; + +//! \brief Interface for domains of simple key agreement protocols + +/*! A key agreement domain is a set of parameters that must be shared + by two parties in a key agreement protocol, along with the algorithms + for generating key pairs and deriving agreed values. +*/ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyAgreementDomain : public KeyAgreementAlgorithm +{ +public: + //! return length of agreed value produced + virtual unsigned int AgreedValueLength() const =0; + //! return length of private keys in this domain + virtual unsigned int PrivateKeyLength() const =0; + //! return length of public keys in this domain + virtual unsigned int PublicKeyLength() const =0; + //! generate private key + /*! \pre size of privateKey == PrivateKeyLength() */ + virtual void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0; + //! generate public key + /*! re size of publicKey == PublicKeyLength() */ + virtual void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0; + //! generate private/public key pair + /*! \note equivalent to calling GeneratePrivateKey() and then GeneratePublicKey() */ + virtual void GenerateKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const; + //! derive agreed value from your private key and couterparty's public key, return false in case of failure + /*! \note If you have previously validated the public key, use validateOtherPublicKey=false to save time. + re size of agreedValue == AgreedValueLength() + \pre length of privateKey == PrivateKeyLength() + \pre length of otherPublicKey == PublicKeyLength() + */ + virtual bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~SimpleKeyAgreementDomain() {} +#endif + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + bool ValidateDomainParameters(RandomNumberGenerator &rng) const + {return GetCryptoParameters().Validate(rng, 2);} +#endif +}; + +//! \brief Interface for domains of authenticated key agreement protocols + +/*! In an authenticated key agreement protocol, each party has two + key pairs. The long-lived key pair is called the static key pair, + and the short-lived key pair is called the ephemeral key pair. +*/ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedKeyAgreementDomain : public KeyAgreementAlgorithm +{ +public: + //! return length of agreed value produced + virtual unsigned int AgreedValueLength() const =0; + + //! return length of static private keys in this domain + virtual unsigned int StaticPrivateKeyLength() const =0; + //! return length of static public keys in this domain + virtual unsigned int StaticPublicKeyLength() const =0; + //! generate static private key + /*! \pre size of privateKey == PrivateStaticKeyLength() */ + virtual void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0; + //! generate static public key + /*! re size of publicKey == PublicStaticKeyLength() */ + virtual void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0; + //! generate private/public key pair + /*! \note equivalent to calling GenerateStaticPrivateKey() and then GenerateStaticPublicKey() */ + virtual void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const; + + //! return length of ephemeral private keys in this domain + virtual unsigned int EphemeralPrivateKeyLength() const =0; + //! return length of ephemeral public keys in this domain + virtual unsigned int EphemeralPublicKeyLength() const =0; + //! \brief Generate ephemeral private key + //! \pre size of privateKey == PrivateEphemeralKeyLength() + virtual void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0; + //! \brief Generate ephemeral public key + //! \pre size of publicKey == PublicEphemeralKeyLength() + virtual void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0; + //! \brief Generate private/public key pair + /*! \note equivalent to calling GenerateEphemeralPrivateKey() and then GenerateEphemeralPublicKey() */ + virtual void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const; + + //! \brief Derive agreed value + //! \returns true upon success, false in case of failure + //! \details Agree() derives an agreed value from your private keys and couterparty's public keys + //! \details The ephemeral public key will always be validated. If you have previously validated the + //! static public key, use validateStaticOtherPublicKey=false to save time. + //! \pre size of agreedValue == AgreedValueLength() + //! \pre length of staticPrivateKey == StaticPrivateKeyLength() + //! \pre length of ephemeralPrivateKey == EphemeralPrivateKeyLength() + //! \pre length of staticOtherPublicKey == StaticPublicKeyLength() + //! \pre length of ephemeralOtherPublicKey == EphemeralPublicKeyLength() + virtual bool Agree(byte *agreedValue, + const byte *staticPrivateKey, const byte *ephemeralPrivateKey, + const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, + bool validateStaticOtherPublicKey=true) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~AuthenticatedKeyAgreementDomain() {} +#endif + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + bool ValidateDomainParameters(RandomNumberGenerator &rng) const + {return GetCryptoParameters().Validate(rng, 2);} +#endif +}; + +// interface for password authenticated key agreement protocols, not implemented yet +#if 0 +//! \brief Interface for protocol sessions +/*! The methods should be called in the following order: + + InitializeSession(rng, parameters); // or call initialize method in derived class + while (true) + { + if (OutgoingMessageAvailable()) + { + length = GetOutgoingMessageLength(); + GetOutgoingMessage(message); + ; // send outgoing message + } + + if (LastMessageProcessed()) + break; + + ; // receive incoming message + ProcessIncomingMessage(message); + } + ; // call methods in derived class to obtain result of protocol session +*/ +class ProtocolSession +{ +public: + //! exception thrown when an invalid protocol message is processed + class ProtocolError : public Exception + { + public: + ProtocolError(ErrorType errorType, const std::string &s) : Exception(errorType, s) {} + }; + + //! exception thrown when a function is called unexpectedly + /*! for example calling ProcessIncomingMessage() when ProcessedLastMessage() == true */ + class UnexpectedMethodCall : public Exception + { + public: + UnexpectedMethodCall(const std::string &s) : Exception(OTHER_ERROR, s) {} + }; + + ProtocolSession() : m_rng(NULL), m_throwOnProtocolError(true), m_validState(false) {} + virtual ~ProtocolSession() {} + + virtual void InitializeSession(RandomNumberGenerator &rng, const NameValuePairs ¶meters) =0; + + bool GetThrowOnProtocolError() const {return m_throwOnProtocolError;} + void SetThrowOnProtocolError(bool throwOnProtocolError) {m_throwOnProtocolError = throwOnProtocolError;} + + bool HasValidState() const {return m_validState;} + + virtual bool OutgoingMessageAvailable() const =0; + virtual unsigned int GetOutgoingMessageLength() const =0; + virtual void GetOutgoingMessage(byte *message) =0; + + virtual bool LastMessageProcessed() const =0; + virtual void ProcessIncomingMessage(const byte *message, unsigned int messageLength) =0; + +protected: + void HandleProtocolError(Exception::ErrorType errorType, const std::string &s) const; + void CheckAndHandleInvalidState() const; + void SetValidState(bool valid) {m_validState = valid;} + + RandomNumberGenerator *m_rng; + +private: + bool m_throwOnProtocolError, m_validState; +}; + +class KeyAgreementSession : public ProtocolSession +{ +public: + virtual unsigned int GetAgreedValueLength() const =0; + virtual void GetAgreedValue(byte *agreedValue) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~KeyAgreementSession() {} +#endif +}; + +class PasswordAuthenticatedKeyAgreementSession : public KeyAgreementSession +{ +public: + void InitializePasswordAuthenticatedKeyAgreementSession(RandomNumberGenerator &rng, + const byte *myId, unsigned int myIdLength, + const byte *counterPartyId, unsigned int counterPartyIdLength, + const byte *passwordOrVerifier, unsigned int passwordOrVerifierLength); + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PasswordAuthenticatedKeyAgreementSession() {} +#endif +}; + +class PasswordAuthenticatedKeyAgreementDomain : public KeyAgreementAlgorithm +{ +public: + //! return whether the domain parameters stored in this object are valid + virtual bool ValidateDomainParameters(RandomNumberGenerator &rng) const + {return GetCryptoParameters().Validate(rng, 2);} + + virtual unsigned int GetPasswordVerifierLength(const byte *password, unsigned int passwordLength) const =0; + virtual void GeneratePasswordVerifier(RandomNumberGenerator &rng, const byte *userId, unsigned int userIdLength, const byte *password, unsigned int passwordLength, byte *verifier) const =0; + + enum RoleFlags {CLIENT=1, SERVER=2, INITIATOR=4, RESPONDER=8}; + + virtual bool IsValidRole(unsigned int role) =0; + virtual PasswordAuthenticatedKeyAgreementSession * CreateProtocolSession(unsigned int role) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PasswordAuthenticatedKeyAgreementDomain() {} +#endif +}; +#endif + +//! \brief Exception thrown when an ASN1 BER decoing error is encountered +class CRYPTOPP_DLL BERDecodeErr : public InvalidArgument +{ +public: + BERDecodeErr() : InvalidArgument("BER decode error") {} + BERDecodeErr(const std::string &s) : InvalidArgument(s) {} +}; + +//! \brief Interface for encoding and decoding ASN1 objects +//! \details Each class that derives from ASN1Object should provide a serialization format +//! that controls subobject layout. Most of the time the serialization format is +//! taken from a standard, like P1363 or an RFC. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ASN1Object +{ +public: + virtual ~ASN1Object() {} + + //! \brief Decode this object from a BufferedTransformation + //! \param bt BufferedTransformation object + //! \details Uses Basic Encoding Rules (BER) + virtual void BERDecode(BufferedTransformation &bt) =0; + + //! \brief Encode this object into a BufferedTransformation + //! \param bt BufferedTransformation object + //! \details Uses Distinguished Encoding Rules (DER) + virtual void DEREncode(BufferedTransformation &bt) const =0; + + //! \brief Encode this object into a BufferedTransformation + //! \param bt BufferedTransformation object + //! \details Uses Basic Encoding Rules (BER). + //! \details This may be useful if DEREncode() would be too inefficient. + virtual void BEREncode(BufferedTransformation &bt) const {DEREncode(bt);} +}; + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY +typedef PK_SignatureScheme PK_SignatureSystem; +typedef SimpleKeyAgreementDomain PK_SimpleKeyAgreementDomain; +typedef AuthenticatedKeyAgreementDomain PK_AuthenticatedKeyAgreementDomain; +#endif + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/cryptlib.vcproj b/external/crypto++-5.6.3/cryptlib.vcproj new file mode 100644 index 000000000..6750bb23e --- /dev/null +++ b/external/crypto++-5.6.3/cryptlib.vcproj @@ -0,0 +1,9653 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/crypto++-5.6.3/cryptlib_bds.bdsproj b/external/crypto++-5.6.3/cryptlib_bds.bdsproj new file mode 100644 index 000000000..fd2e8886f --- /dev/null +++ b/external/crypto++-5.6.3/cryptlib_bds.bdsproj @@ -0,0 +1,378 @@ + + + + + + + + + + + + cryptlib_bds.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + False + + + + + + + False + + False + + True + False + + + + + + + + + + + diff --git a/external/crypto++-5.6.3/cryptlib_bds.cpp b/external/crypto++-5.6.3/cryptlib_bds.cpp new file mode 100644 index 000000000..7724a9f17 --- /dev/null +++ b/external/crypto++-5.6.3/cryptlib_bds.cpp @@ -0,0 +1,10 @@ +//--------------------------------------------------------------------------- + +/* +#include +#pragma hdrstop +*/ +#define Library + +// To add a file to the library use the Project menu 'Add to Project'. + diff --git a/external/crypto++-5.6.3/cryptodisablewarnings.h b/external/crypto++-5.6.3/cryptodisablewarnings.h new file mode 100644 index 000000000..9c16ffc50 --- /dev/null +++ b/external/crypto++-5.6.3/cryptodisablewarnings.h @@ -0,0 +1,30 @@ +// turn off warnings that get generated when building Crypto++ in our environment + +#ifdef _WIN32 +#pragma warning( disable : 4100 ) // Warning C4100: unreferenced formal parameter +#pragma warning( disable : 4127 ) // Warning C4127: conditional expression is constant +#pragma warning( disable : 4189 ) // Warning C4189: local variable is initialized but not referenced +#pragma warning( disable : 4231 ) // Warning C4231: nonstandard extension used +#pragma warning( disable : 4244 ) // Warning C4244: conversion from 'unsigned int' to 'byte', possible loss of data +#pragma warning( disable : 4245 ) // Warning C4245: conversion from 'int' to 'DWORD', signed/unsigned mismatch +#pragma warning( disable : 4250 ) // Warning C4250: inherits via dominance +#pragma warning( disable : 4267 ) // Warning C4267: 'argument' : conversion, possible loss of data +#pragma warning( disable : 4297 ) // Warning C4267: function assumed not to throw an exception but does +#pragma warning( disable : 4355 ) // Warning C4355: 'this' : used in base member initializer list +#pragma warning( disable : 4389 ) // Warning C4389: signed/unsigned mismatch +#pragma warning( disable : 4505 ) // Warning C4505: unreferenced local function has been removed +#pragma warning( disable : 4511 ) // Warning C4511: copy constructor could not be generated +#pragma warning( disable : 4512 ) // Warning C4512: assignment operator could not be generated +#pragma warning( disable : 4516 ) // Warning C4516: access-declarations are deprecated; member using-declarations provide a better alternative +#pragma warning( disable : 4661 ) // Warning C4661: no suitable definition provided for explicit template instantiation request +#pragma warning( disable : 4701 ) // Warning C4701: local variable may be used without having been initialized +#pragma warning( disable : 4702 ) // Warning C4702: unreachable code +#pragma warning( disable : 4706 ) // Warning C4706: assignment within conditional expression +#endif // _WIN32 + +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wtype-limits" +#endif diff --git a/external/crypto++-5.6.3/cryptopopdisablewarnings.h b/external/crypto++-5.6.3/cryptopopdisablewarnings.h new file mode 100644 index 000000000..ce0edbcc3 --- /dev/null +++ b/external/crypto++-5.6.3/cryptopopdisablewarnings.h @@ -0,0 +1,9 @@ +#ifdef _WIN32 +#pragma warning( pop ) +#endif + +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) +#pragma GCC diagnostic pop +#endif + +//#include "tier0/memdbgon.h" diff --git a/external/crypto++-5.6.3/cryptopp.rc b/external/crypto++-5.6.3/cryptopp.rc new file mode 100644 index 000000000..808b66435 --- /dev/null +++ b/external/crypto++-5.6.3/cryptopp.rc @@ -0,0 +1,104 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "windows.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 5,6,3,0 + PRODUCTVERSION 5,6,3,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "free crypto library, more information available at www.cryptopp.com" + VALUE "CompanyName", "Wei Dai" + VALUE "FileDescription", "Crypto++® Library DLL" + VALUE "FileVersion", "5, 6, 3, 0" + VALUE "InternalName", "cryptopp" + VALUE "LegalCopyright", "Copyright © 1995-2015 by Wei Dai" + VALUE "LegalTrademarks", "Crypto++®" + VALUE "OriginalFilename", "cryptopp.dll" + VALUE "ProductName", "Crypto++® Library" + VALUE "ProductVersion", "5, 6, 3, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""windows.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/external/crypto++-5.6.3/cryptopp563.diff b/external/crypto++-5.6.3/cryptopp563.diff new file mode 100644 index 000000000..e69de29bb diff --git a/external/crypto++-5.6.3/cryptopushdisablewarnings.h b/external/crypto++-5.6.3/cryptopushdisablewarnings.h new file mode 100644 index 000000000..6e9728461 --- /dev/null +++ b/external/crypto++-5.6.3/cryptopushdisablewarnings.h @@ -0,0 +1,11 @@ +#ifdef _WIN32 +#pragma warning( push ) +#endif // _WIN32 + +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) +#pragma GCC diagnostic push +#endif + +#include "cryptodisablewarnings.h" +//#include "tier0/memdbgoff.h" + diff --git a/external/crypto++-5.6.3/datatest.cpp b/external/crypto++-5.6.3/datatest.cpp new file mode 100644 index 000000000..851444b91 --- /dev/null +++ b/external/crypto++-5.6.3/datatest.cpp @@ -0,0 +1,813 @@ +// datatest.cpp - written and placed in the public domain by Wei Dai + +#define CRYPTOPP_DEFAULT_NO_DLL +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 + +#include "cryptlib.h" +#include "factory.h" +#include "integer.h" +#include "filters.h" +#include "hex.h" +#include "randpool.h" +#include "files.h" +#include "trunhash.h" +#include "queue.h" +#include "smartptr.h" +#include "validate.h" +#include "hkdf.h" +#include "stdcpp.h" +#include + +// Aggressive stack checking with VS2005 SP1 and above. +#if (CRYPTOPP_MSC_VERSION >= 1410) +# pragma strict_gs_check (on) +#endif + +#if defined(__COVERITY__) +extern "C" void __coverity_tainted_data_sanitize__(void *); +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +typedef std::map TestData; +static bool s_thorough = false; + +class TestFailure : public Exception +{ +public: + TestFailure() : Exception(OTHER_ERROR, "Validation test failed") {} +}; + +static const TestData *s_currentTestData = NULL; + +static void OutputTestData(const TestData &v) +{ + for (TestData::const_iterator i = v.begin(); i != v.end(); ++i) + { + cerr << i->first << ": " << i->second << endl; + } +} + +static void SignalTestFailure() +{ + OutputTestData(*s_currentTestData); + throw TestFailure(); +} + +static void SignalTestError() +{ + OutputTestData(*s_currentTestData); + throw Exception(Exception::OTHER_ERROR, "Unexpected error during validation test"); +} + +bool DataExists(const TestData &data, const char *name) +{ + TestData::const_iterator i = data.find(name); + return (i != data.end()); +} + +const std::string & GetRequiredDatum(const TestData &data, const char *name) +{ + TestData::const_iterator i = data.find(name); + if (i == data.end()) + SignalTestError(); + return i->second; +} + +void RandomizedTransfer(BufferedTransformation &source, BufferedTransformation &target, bool finish, const std::string &channel=DEFAULT_CHANNEL) +{ + while (source.MaxRetrievable() > (finish ? 0 : 4096)) + { + byte buf[4096+64]; + size_t start = GlobalRNG().GenerateWord32(0, 63); + size_t len = GlobalRNG().GenerateWord32(1, UnsignedMin(4096U, 3*source.MaxRetrievable()/2)); + len = source.Get(buf+start, len); + target.ChannelPut(channel, buf+start, len); + } +} + +void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransformation &target) +{ + std::string s1 = GetRequiredDatum(data, name), s2; + ByteQueue q; + + while (!s1.empty()) + { + while (s1[0] == ' ') + { + s1 = s1.substr(1); + if (s1.empty()) + goto end; // avoid invalid read if s1 is empty + } + + int repeat = 1; + if (s1[0] == 'r') + { + repeat = atoi(s1.c_str()+1); + s1 = s1.substr(s1.find(' ')+1); + } + + s2 = ""; // MSVC 6 doesn't have clear(); + + if (s1[0] == '\"') + { + s2 = s1.substr(1, s1.find('\"', 1)-1); + s1 = s1.substr(s2.length() + 2); + } + else if (s1.substr(0, 2) == "0x") + { + StringSource(s1.substr(2, s1.find(' ')), true, new HexDecoder(new StringSink(s2))); + s1 = s1.substr(STDMIN(s1.find(' '), s1.length())); + } + else + { + StringSource(s1.substr(0, s1.find(' ')), true, new HexDecoder(new StringSink(s2))); + s1 = s1.substr(STDMIN(s1.find(' '), s1.length())); + } + + while (repeat--) + { + q.Put((const byte *)s2.data(), s2.size()); + RandomizedTransfer(q, target, false); + } + } + +end: + RandomizedTransfer(q, target, true); +} + +std::string GetDecodedDatum(const TestData &data, const char *name) +{ + std::string s; + PutDecodedDatumInto(data, name, StringSink(s).Ref()); + return s; +} + +std::string GetOptionalDecodedDatum(const TestData &data, const char *name) +{ + std::string s; + if (DataExists(data, name)) + PutDecodedDatumInto(data, name, StringSink(s).Ref()); + return s; +} + +class TestDataNameValuePairs : public NameValuePairs +{ +public: + TestDataNameValuePairs(const TestData &data) : m_data(data) {} + + virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + TestData::const_iterator i = m_data.find(name); + if (i == m_data.end()) + { + if (std::string(name) == Name::DigestSize() && valueType == typeid(int)) + { + i = m_data.find("MAC"); + if (i == m_data.end()) + i = m_data.find("Digest"); + if (i == m_data.end()) + return false; + + m_temp.resize(0); + PutDecodedDatumInto(m_data, i->first.c_str(), StringSink(m_temp).Ref()); + *reinterpret_cast(pValue) = (int)m_temp.size(); + return true; + } + else + return false; + } + + const std::string &value = i->second; + + if (valueType == typeid(int)) + *reinterpret_cast(pValue) = atoi(value.c_str()); + else if (valueType == typeid(Integer)) + *reinterpret_cast(pValue) = Integer((std::string(value) + "h").c_str()); + else if (valueType == typeid(ConstByteArrayParameter)) + { + m_temp.resize(0); + PutDecodedDatumInto(m_data, name, StringSink(m_temp).Ref()); + reinterpret_cast(pValue)->Assign((const byte *)m_temp.data(), m_temp.size(), false); + } + else + throw ValueTypeMismatch(name, typeid(std::string), valueType); + + return true; + } + +private: + const TestData &m_data; + mutable std::string m_temp; +}; + +void TestKeyPairValidAndConsistent(CryptoMaterial &pub, const CryptoMaterial &priv) +{ + // "!!" converts between bool <-> integral. + if (!pub.Validate(GlobalRNG(), 2U+!!s_thorough)) + SignalTestFailure(); + if (!priv.Validate(GlobalRNG(), 2U+!!s_thorough)) + SignalTestFailure(); + + ByteQueue bq1, bq2; + pub.Save(bq1); + pub.AssignFrom(priv); + pub.Save(bq2); + if (bq1 != bq2) + SignalTestFailure(); +} + +void TestSignatureScheme(TestData &v) +{ + std::string name = GetRequiredDatum(v, "Name"); + std::string test = GetRequiredDatum(v, "Test"); + + member_ptr signer(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + member_ptr verifier(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + + TestDataNameValuePairs pairs(v); + + if (test == "GenerateKey") + { + signer->AccessPrivateKey().GenerateRandom(GlobalRNG(), pairs); + verifier->AccessPublicKey().AssignFrom(signer->AccessPrivateKey()); + } + else + { + std::string keyFormat = GetRequiredDatum(v, "KeyFormat"); + + if (keyFormat == "DER") + verifier->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PublicKey")).Ref()); + else if (keyFormat == "Component") + verifier->AccessMaterial().AssignFrom(pairs); + + if (test == "Verify" || test == "NotVerify") + { + VerifierFilter verifierFilter(*verifier, NULL, VerifierFilter::SIGNATURE_AT_BEGIN); + PutDecodedDatumInto(v, "Signature", verifierFilter); + PutDecodedDatumInto(v, "Message", verifierFilter); + verifierFilter.MessageEnd(); + if (verifierFilter.GetLastResult() == (test == "NotVerify")) + SignalTestFailure(); + return; + } + else if (test == "PublicKeyValid") + { + if (!verifier->GetMaterial().Validate(GlobalRNG(), 3)) + SignalTestFailure(); + return; + } + + if (keyFormat == "DER") + signer->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PrivateKey")).Ref()); + else if (keyFormat == "Component") + signer->AccessMaterial().AssignFrom(pairs); + } + + if (test == "GenerateKey" || test == "KeyPairValidAndConsistent") + { + TestKeyPairValidAndConsistent(verifier->AccessMaterial(), signer->GetMaterial()); + VerifierFilter verifierFilter(*verifier, NULL, VerifierFilter::THROW_EXCEPTION); + verifierFilter.Put((const byte *)"abc", 3); + StringSource ss("abc", true, new SignerFilter(GlobalRNG(), *signer, new Redirector(verifierFilter))); + } + else if (test == "Sign") + { + SignerFilter f(GlobalRNG(), *signer, new HexEncoder(new FileSink(cout))); + StringSource ss(GetDecodedDatum(v, "Message"), true, new Redirector(f)); + SignalTestFailure(); + } + else if (test == "DeterministicSign") + { + SignalTestError(); + assert(false); // TODO: implement + } + else if (test == "RandomSign") + { + SignalTestError(); + assert(false); // TODO: implement + } + else + { + SignalTestError(); + assert(false); + } +} + +void TestAsymmetricCipher(TestData &v) +{ + std::string name = GetRequiredDatum(v, "Name"); + std::string test = GetRequiredDatum(v, "Test"); + + member_ptr encryptor(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + member_ptr decryptor(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + + std::string keyFormat = GetRequiredDatum(v, "KeyFormat"); + + if (keyFormat == "DER") + { + decryptor->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PrivateKey")).Ref()); + encryptor->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PublicKey")).Ref()); + } + else if (keyFormat == "Component") + { + TestDataNameValuePairs pairs(v); + decryptor->AccessMaterial().AssignFrom(pairs); + encryptor->AccessMaterial().AssignFrom(pairs); + } + + if (test == "DecryptMatch") + { + std::string decrypted, expected = GetDecodedDatum(v, "Plaintext"); + StringSource ss(GetDecodedDatum(v, "Ciphertext"), true, new PK_DecryptorFilter(GlobalRNG(), *decryptor, new StringSink(decrypted))); + if (decrypted != expected) + SignalTestFailure(); + } + else if (test == "KeyPairValidAndConsistent") + { + TestKeyPairValidAndConsistent(encryptor->AccessMaterial(), decryptor->GetMaterial()); + } + else + { + SignalTestError(); + assert(false); + } +} + +void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters) +{ + std::string name = GetRequiredDatum(v, "Name"); + std::string test = GetRequiredDatum(v, "Test"); + + std::string key = GetDecodedDatum(v, "Key"); + std::string plaintext = GetDecodedDatum(v, "Plaintext"); + + TestDataNameValuePairs testDataPairs(v); + CombinedNameValuePairs pairs(overrideParameters, testDataPairs); + + if (test == "Encrypt" || test == "EncryptXorDigest" || test == "Resync" || test == "EncryptionMCT" || test == "DecryptionMCT") + { + static member_ptr encryptor, decryptor; + static std::string lastName; + + if (name != lastName) + { + encryptor.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + decryptor.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + lastName = name; + } + + ConstByteArrayParameter iv; + if (pairs.GetValue(Name::IV(), iv) && iv.size() != encryptor->IVSize()) + SignalTestFailure(); + + if (test == "Resync") + { + encryptor->Resynchronize(iv.begin(), (int)iv.size()); + decryptor->Resynchronize(iv.begin(), (int)iv.size()); + } + else + { + encryptor->SetKey((const byte *)key.data(), key.size(), pairs); + decryptor->SetKey((const byte *)key.data(), key.size(), pairs); + } + + int seek = pairs.GetIntValueWithDefault("Seek", 0); + if (seek) + { + encryptor->Seek(seek); + decryptor->Seek(seek); + } + + std::string encrypted, xorDigest, ciphertext, ciphertextXorDigest; + if (test == "EncryptionMCT" || test == "DecryptionMCT") + { + SymmetricCipher *cipher = encryptor.get(); + SecByteBlock buf((byte *)plaintext.data(), plaintext.size()), keybuf((byte *)key.data(), key.size()); + + if (test == "DecryptionMCT") + { + cipher = decryptor.get(); + ciphertext = GetDecodedDatum(v, "Ciphertext"); + buf.Assign((byte *)ciphertext.data(), ciphertext.size()); + } + + for (int i=0; i<400; i++) + { + encrypted.reserve(10000 * plaintext.size()); + for (int j=0; j<10000; j++) + { + cipher->ProcessString(buf.begin(), buf.size()); + encrypted.append((char *)buf.begin(), buf.size()); + } + + encrypted.erase(0, encrypted.size() - keybuf.size()); + xorbuf(keybuf.begin(), (const byte *)encrypted.data(), keybuf.size()); + cipher->SetKey(keybuf, keybuf.size()); + } + encrypted.assign((char *)buf.begin(), buf.size()); + ciphertext = GetDecodedDatum(v, test == "EncryptionMCT" ? "Ciphertext" : "Plaintext"); + if (encrypted != ciphertext) + { + std::cout << "incorrectly encrypted: "; + StringSource xx(encrypted, false, new HexEncoder(new FileSink(std::cout))); + xx.Pump(256); xx.Flush(false); + std::cout << "\n"; + SignalTestFailure(); + } + return; + } + + StreamTransformationFilter encFilter(*encryptor, new StringSink(encrypted), StreamTransformationFilter::NO_PADDING); + RandomizedTransfer(StringStore(plaintext).Ref(), encFilter, true); + encFilter.MessageEnd(); + /*{ + std::string z; + encryptor->Seek(seek); + StringSource ss(plaintext, false, new StreamTransformationFilter(*encryptor, new StringSink(z), StreamTransformationFilter::NO_PADDING)); + while (ss.Pump(64)) {} + ss.PumpAll(); + for (int i=0; i asc1, asc2; + asc1.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + asc2.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + asc1->SetKey((const byte *)key.data(), key.size(), pairs); + asc2->SetKey((const byte *)key.data(), key.size(), pairs); + + std::string encrypted, decrypted; + AuthenticatedEncryptionFilter ef(*asc1, new StringSink(encrypted)); + bool macAtBegin = !mac.empty() && !GlobalRNG().GenerateBit(); // test both ways randomly + AuthenticatedDecryptionFilter df(*asc2, new StringSink(decrypted), macAtBegin ? AuthenticatedDecryptionFilter::MAC_AT_BEGIN : 0); + + if (asc1->NeedsPrespecifiedDataLengths()) + { + asc1->SpecifyDataLengths(header.size(), plaintext.size(), footer.size()); + asc2->SpecifyDataLengths(header.size(), plaintext.size(), footer.size()); + } + + StringStore sh(header), sp(plaintext), sc(ciphertext), sf(footer), sm(mac); + + if (macAtBegin) + RandomizedTransfer(sm, df, true); + sh.CopyTo(df, LWORD_MAX, AAD_CHANNEL); + RandomizedTransfer(sc, df, true); + sf.CopyTo(df, LWORD_MAX, AAD_CHANNEL); + if (!macAtBegin) + RandomizedTransfer(sm, df, true); + df.MessageEnd(); + + RandomizedTransfer(sh, ef, true, AAD_CHANNEL); + RandomizedTransfer(sp, ef, true); + RandomizedTransfer(sf, ef, true, AAD_CHANNEL); + ef.MessageEnd(); + + if (test == "Encrypt" && encrypted != ciphertext+mac) + { + std::cout << "incorrectly encrypted: "; + StringSource xx(encrypted, false, new HexEncoder(new FileSink(std::cout))); + xx.Pump(2048); xx.Flush(false); + std::cout << "\n"; + SignalTestFailure(); + } + if (test == "Encrypt" && decrypted != plaintext) + { + std::cout << "incorrectly decrypted: "; + StringSource xx(decrypted, false, new HexEncoder(new FileSink(std::cout))); + xx.Pump(256); xx.Flush(false); + std::cout << "\n"; + SignalTestFailure(); + } + + if (ciphertext.size()+mac.size()-plaintext.size() != asc1->DigestSize()) + { + std::cout << "bad MAC size\n"; + SignalTestFailure(); + } + if (df.GetLastResult() != (test == "Encrypt")) + { + std::cout << "MAC incorrectly verified\n"; + SignalTestFailure(); + } + } + else + { + std::cout << "unexpected test name\n"; + SignalTestError(); + } +} + +void TestDigestOrMAC(TestData &v, bool testDigest) +{ + std::string name = GetRequiredDatum(v, "Name"); + std::string test = GetRequiredDatum(v, "Test"); + const char *digestName = testDigest ? "Digest" : "MAC"; + + member_ptr mac; + member_ptr hash; + HashTransformation *pHash = NULL; + + TestDataNameValuePairs pairs(v); + + if (testDigest) + { + hash.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + pHash = hash.get(); + } + else + { + mac.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + pHash = mac.get(); + std::string key = GetDecodedDatum(v, "Key"); + mac->SetKey((const byte *)key.c_str(), key.size(), pairs); + } + + if (test == "Verify" || test == "VerifyTruncated" || test == "NotVerify") + { + int digestSize = -1; + if (test == "VerifyTruncated") + digestSize = pairs.GetIntValueWithDefault(Name::DigestSize(), digestSize); + HashVerificationFilter verifierFilter(*pHash, NULL, HashVerificationFilter::HASH_AT_BEGIN, digestSize); + PutDecodedDatumInto(v, digestName, verifierFilter); + PutDecodedDatumInto(v, "Message", verifierFilter); + verifierFilter.MessageEnd(); + if (verifierFilter.GetLastResult() == (test == "NotVerify")) + SignalTestFailure(); + } + else + { + SignalTestError(); + assert(false); + } +} + +void TestKeyDerivationFunction(TestData &v) +{ + std::string name = GetRequiredDatum(v, "Name"); + std::string test = GetRequiredDatum(v, "Test"); + + if(test == "Skip") return; + assert(test == "Verify"); + + std::string key = GetDecodedDatum(v, "Key"); + std::string salt = GetDecodedDatum(v, "Salt"); + std::string info = GetDecodedDatum(v, "Info"); + std::string derived = GetDecodedDatum(v, "DerivedKey"); + std::string t = GetDecodedDatum(v, "DerivedKeyLength"); + + TestDataNameValuePairs pairs(v); + unsigned int length = pairs.GetIntValueWithDefault(Name::DerivedKeyLength(), (int)derived.size()); + + member_ptr kdf; + kdf.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); + + std::string calc; calc.resize(length); + unsigned int ret = kdf->DeriveKey(reinterpret_cast(&calc[0]), calc.size(), + reinterpret_cast(key.data()), key.size(), + reinterpret_cast(salt.data()), salt.size(), + reinterpret_cast(info.data()), info.size()); + + if(calc != derived || ret != length) + SignalTestFailure(); +} + +bool GetField(std::istream &is, std::string &name, std::string &value) +{ + name.resize(0); // GCC workaround: 2.95.3 doesn't have clear() + is >> name; + +#if defined(__COVERITY__) + // The datafile being read is in /usr/share, and it protected by filesystem ACLs + // __coverity_tainted_data_sanitize__(reinterpret_cast(&name)); +#endif + + if (name.empty()) + return false; + + if (name[name.size()-1] != ':') + { + char c; + is >> skipws >> c; + if (c != ':') + SignalTestError(); + } + else + name.erase(name.size()-1); + + while (is.peek() == ' ') + is.ignore(1); + + // VC60 workaround: getline bug + char buffer[128]; + value.resize(0); // GCC workaround: 2.95.3 doesn't have clear() + bool continueLine; + + do + { + do + { + is.get(buffer, sizeof(buffer)); + value += buffer; + } + while (buffer[0] != 0); + is.clear(); + is.ignore(); + + if (!value.empty() && value[value.size()-1] == '\r') + value.resize(value.size()-1); + + if (!value.empty() && value[value.size()-1] == '\\') + { + value.resize(value.size()-1); + continueLine = true; + } + else + continueLine = false; + + std::string::size_type i = value.find('#'); + if (i != std::string::npos) + value.erase(i); + } + while (continueLine); + + return true; +} + +void OutputPair(const NameValuePairs &v, const char *name) +{ + Integer x; + bool b = v.GetValue(name, x); + CRYPTOPP_UNUSED(b); assert(b); + cout << name << ": \\\n "; + x.Encode(HexEncoder(new FileSink(cout), false, 64, "\\\n ").Ref(), x.MinEncodedSize()); + cout << endl; +} + +void OutputNameValuePairs(const NameValuePairs &v) +{ + std::string names = v.GetValueNames(); + string::size_type i = 0; + while (i < names.size()) + { + string::size_type j = names.find_first_of (';', i); + + if (j == string::npos) + return; + else + { + std::string name = names.substr(i, j-i); + if (name.find(':') == string::npos) + OutputPair(v, name.c_str()); + } + + i = j + 1; + } +} + +void TestDataFile(const std::string &filename, const NameValuePairs &overrideParameters, unsigned int &totalTests, unsigned int &failedTests) +{ + std::ifstream file(filename.c_str()); + if (!file.good()) + throw Exception(Exception::OTHER_ERROR, "Can not open file " + filename + " for reading"); + TestData v; + s_currentTestData = &v; + std::string name, value, lastAlgName; + + while (file) + { + while (file.peek() == '#') + file.ignore(std::numeric_limits::max(), '\n'); + + if (file.peek() == '\n' || file.peek() == '\r') + v.clear(); + + if (!GetField(file, name, value)) + break; + v[name] = value; + + if (name == "Test" && (s_thorough || v["SlowTest"] != "1")) + { + bool failed = true; + std::string algType = GetRequiredDatum(v, "AlgorithmType"); + + if (lastAlgName != GetRequiredDatum(v, "Name")) + { + lastAlgName = GetRequiredDatum(v, "Name"); + cout << "\nTesting " << algType.c_str() << " algorithm " << lastAlgName.c_str() << ".\n"; + } + + try + { + if (algType == "Signature") + TestSignatureScheme(v); + else if (algType == "SymmetricCipher") + TestSymmetricCipher(v, overrideParameters); + else if (algType == "AuthenticatedSymmetricCipher") + TestAuthenticatedSymmetricCipher(v, overrideParameters); + else if (algType == "AsymmetricCipher") + TestAsymmetricCipher(v); + else if (algType == "MessageDigest") + TestDigestOrMAC(v, true); + else if (algType == "MAC") + TestDigestOrMAC(v, false); + else if (algType == "KDF") + TestKeyDerivationFunction(v); + else if (algType == "FileList") + TestDataFile(GetRequiredDatum(v, "Test"), g_nullNameValuePairs, totalTests, failedTests); + else + SignalTestError(); + failed = false; + } + catch (TestFailure &) + { + cout << "\nTest failed.\n"; + } + catch (CryptoPP::Exception &e) + { + cout << "\nCryptoPP::Exception caught: " << e.what() << endl; + } + catch (std::exception &e) + { + cout << "\nstd::exception caught: " << e.what() << endl; + } + + if (failed) + { + cout << "Skipping to next test.\n"; + failedTests++; + } + else + cout << "." << flush; + + totalTests++; + } + } +} + +bool RunTestDataFile(const char *filename, const NameValuePairs &overrideParameters, bool thorough) +{ + s_thorough = thorough; + unsigned int totalTests = 0, failedTests = 0; + TestDataFile(filename, overrideParameters, totalTests, failedTests); + cout << dec << "\nTests complete. Total tests = " << totalTests << ". Failed tests = " << failedTests << ".\n"; + if (failedTests != 0) + cout << "SOME TESTS FAILED!\n"; + return failedTests == 0; +} diff --git a/external/crypto++-5.6.3/default.cpp b/external/crypto++-5.6.3/default.cpp new file mode 100644 index 000000000..4b667a30e --- /dev/null +++ b/external/crypto++-5.6.3/default.cpp @@ -0,0 +1,273 @@ +// default.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4127 4189) +#endif + +#include "cryptlib.h" +#include "filters.h" +#include "smartptr.h" +#include "default.h" +#include "queue.h" + +#include +#include + +NAMESPACE_BEGIN(CryptoPP) + +static const unsigned int MASH_ITERATIONS = 200; +static const unsigned int SALTLENGTH = 8; +static const unsigned int BLOCKSIZE = DefaultBlockCipher::Encryption::BLOCKSIZE; +static const unsigned int KEYLENGTH = DefaultBlockCipher::Encryption::DEFAULT_KEYLENGTH; + +// The purpose of this function Mash() is to take an arbitrary length input +// string and *deterministicly* produce an arbitrary length output string such +// that (1) it looks random, (2) no information about the input is +// deducible from it, and (3) it contains as much entropy as it can hold, or +// the amount of entropy in the input string, whichever is smaller. + +static void Mash(const byte *in, size_t inLen, byte *out, size_t outLen, int iterations) +{ + if (BytePrecision(outLen) > 2) + throw InvalidArgument("Mash: output legnth too large"); + + size_t bufSize = RoundUpToMultipleOf(outLen, (size_t)DefaultHashModule::DIGESTSIZE); + byte b[2]; + SecByteBlock buf(bufSize); + SecByteBlock outBuf(bufSize); + DefaultHashModule hash; + + unsigned int i; + for(i=0; i> 8); + b[1] = (byte) i; + hash.Update(b, 2); + hash.Update(in, inLen); + hash.Final(outBuf+i); + } + + while (iterations-- > 1) + { + memcpy(buf, outBuf, bufSize); + for (i=0; i> 8); + b[1] = (byte) i; + hash.Update(b, 2); + hash.Update(buf, bufSize); + hash.Final(outBuf+i); + } + } + + memcpy(out, outBuf, outLen); +} + +static void GenerateKeyIV(const byte *passphrase, size_t passphraseLength, const byte *salt, size_t saltLength, byte *key, byte *IV) +{ + SecByteBlock temp(passphraseLength+saltLength); + memcpy(temp, passphrase, passphraseLength); + memcpy(temp+passphraseLength, salt, saltLength); + SecByteBlock keyIV(KEYLENGTH+BLOCKSIZE); + Mash(temp, passphraseLength + saltLength, keyIV, KEYLENGTH+BLOCKSIZE, MASH_ITERATIONS); + memcpy(key, keyIV, KEYLENGTH); + memcpy(IV, keyIV+KEYLENGTH, BLOCKSIZE); +} + +// ******************************************************** + +DefaultEncryptor::DefaultEncryptor(const char *passphrase, BufferedTransformation *attachment) + : ProxyFilter(NULL, 0, 0, attachment), m_passphrase((const byte *)passphrase, strlen(passphrase)) +{ +} + +DefaultEncryptor::DefaultEncryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment) + : ProxyFilter(NULL, 0, 0, attachment), m_passphrase(passphrase, passphraseLength) +{ +} + + +void DefaultEncryptor::FirstPut(const byte *) +{ + // VC60 workaround: __LINE__ expansion bug + CRYPTOPP_COMPILE_ASSERT_INSTANCE(SALTLENGTH <= DefaultHashModule::DIGESTSIZE, 1); + CRYPTOPP_COMPILE_ASSERT_INSTANCE(BLOCKSIZE <= DefaultHashModule::DIGESTSIZE, 2); + + SecByteBlock salt(DefaultHashModule::DIGESTSIZE), keyCheck(DefaultHashModule::DIGESTSIZE); + DefaultHashModule hash; + + // use hash(passphrase | time | clock) as salt + hash.Update(m_passphrase, m_passphrase.size()); + time_t t=time(0); + hash.Update((byte *)&t, sizeof(t)); + clock_t c=clock(); + hash.Update((byte *)&c, sizeof(c)); + hash.Final(salt); + + // use hash(passphrase | salt) as key check + hash.Update(m_passphrase, m_passphrase.size()); + hash.Update(salt, SALTLENGTH); + hash.Final(keyCheck); + + AttachedTransformation()->Put(salt, SALTLENGTH); + + // mash passphrase and salt together into key and IV + SecByteBlock key(KEYLENGTH); + SecByteBlock IV(BLOCKSIZE); + GenerateKeyIV(m_passphrase, m_passphrase.size(), salt, SALTLENGTH, key, IV); + + m_cipher.SetKeyWithIV(key, key.size(), IV); + SetFilter(new StreamTransformationFilter(m_cipher)); + + m_filter->Put(keyCheck, BLOCKSIZE); +} + +void DefaultEncryptor::LastPut(const byte *inString, size_t length) +{ + CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); + m_filter->MessageEnd(); +} + +// ******************************************************** + +DefaultDecryptor::DefaultDecryptor(const char *p, BufferedTransformation *attachment, bool throwException) + : ProxyFilter(NULL, SALTLENGTH+BLOCKSIZE, 0, attachment) + , m_state(WAITING_FOR_KEYCHECK) + , m_passphrase((const byte *)p, strlen(p)) + , m_throwException(throwException) +{ +} + +DefaultDecryptor::DefaultDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment, bool throwException) + : ProxyFilter(NULL, SALTLENGTH+BLOCKSIZE, 0, attachment) + , m_state(WAITING_FOR_KEYCHECK) + , m_passphrase(passphrase, passphraseLength) + , m_throwException(throwException) +{ +} + +void DefaultDecryptor::FirstPut(const byte *inString) +{ + CheckKey(inString, inString+SALTLENGTH); +} + +void DefaultDecryptor::LastPut(const byte *inString, size_t length) +{ + CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); + if (m_filter.get() == NULL) + { + m_state = KEY_BAD; + if (m_throwException) + throw KeyBadErr(); + } + else + { + m_filter->MessageEnd(); + m_state = WAITING_FOR_KEYCHECK; + } +} + +void DefaultDecryptor::CheckKey(const byte *salt, const byte *keyCheck) +{ + SecByteBlock check(STDMAX((unsigned int)2*BLOCKSIZE, (unsigned int)DefaultHashModule::DIGESTSIZE)); + + DefaultHashModule hash; + hash.Update(m_passphrase, m_passphrase.size()); + hash.Update(salt, SALTLENGTH); + hash.Final(check); + + SecByteBlock key(KEYLENGTH); + SecByteBlock IV(BLOCKSIZE); + GenerateKeyIV(m_passphrase, m_passphrase.size(), salt, SALTLENGTH, key, IV); + + m_cipher.SetKeyWithIV(key, key.size(), IV); + member_ptr decryptor(new StreamTransformationFilter(m_cipher)); + + decryptor->Put(keyCheck, BLOCKSIZE); + decryptor->ForceNextPut(); + decryptor->Get(check+BLOCKSIZE, BLOCKSIZE); + + SetFilter(decryptor.release()); + + if (!VerifyBufsEqual(check, check+BLOCKSIZE, BLOCKSIZE)) + { + m_state = KEY_BAD; + if (m_throwException) + throw KeyBadErr(); + } + else + m_state = KEY_GOOD; +} + +// ******************************************************** + +static DefaultMAC * NewDefaultEncryptorMAC(const byte *passphrase, size_t passphraseLength) +{ + size_t macKeyLength = DefaultMAC::StaticGetValidKeyLength(16); + SecByteBlock macKey(macKeyLength); + // since the MAC is encrypted there is no reason to mash the passphrase for many iterations + Mash(passphrase, passphraseLength, macKey, macKeyLength, 1); + return new DefaultMAC(macKey, macKeyLength); +} + +DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment) + : ProxyFilter(NULL, 0, 0, attachment) + , m_mac(NewDefaultEncryptorMAC((const byte *)passphrase, strlen(passphrase))) +{ + SetFilter(new HashFilter(*m_mac, new DefaultEncryptor(passphrase), true)); +} + +DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment) + : ProxyFilter(NULL, 0, 0, attachment) + , m_mac(NewDefaultEncryptorMAC(passphrase, passphraseLength)) +{ + SetFilter(new HashFilter(*m_mac, new DefaultEncryptor(passphrase, passphraseLength), true)); +} + +void DefaultEncryptorWithMAC::LastPut(const byte *inString, size_t length) +{ + CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); + m_filter->MessageEnd(); +} + +// ******************************************************** + +DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment, bool throwException) + : ProxyFilter(NULL, 0, 0, attachment) + , m_mac(NewDefaultEncryptorMAC((const byte *)passphrase, strlen(passphrase))) + , m_throwException(throwException) +{ + SetFilter(new DefaultDecryptor(passphrase, m_hashVerifier=new HashVerifier(*m_mac, NULL, HashVerifier::PUT_MESSAGE), throwException)); +} + +DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment, bool throwException) + : ProxyFilter(NULL, 0, 0, attachment) + , m_mac(NewDefaultEncryptorMAC(passphrase, passphraseLength)) + , m_throwException(throwException) +{ + SetFilter(new DefaultDecryptor(passphrase, passphraseLength, m_hashVerifier=new HashVerifier(*m_mac, NULL, HashVerifier::PUT_MESSAGE), throwException)); +} + +DefaultDecryptor::State DefaultDecryptorWithMAC::CurrentState() const +{ + return static_cast(m_filter.get())->CurrentState(); +} + +bool DefaultDecryptorWithMAC::CheckLastMAC() const +{ + return m_hashVerifier->GetLastResult(); +} + +void DefaultDecryptorWithMAC::LastPut(const byte *inString, size_t length) +{ + CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); + m_filter->MessageEnd(); + if (m_throwException && !CheckLastMAC()) + throw MACBadErr(); +} + +NAMESPACE_END + diff --git a/external/crypto++-5.6.3/default.h b/external/crypto++-5.6.3/default.h new file mode 100644 index 000000000..6829fb03b --- /dev/null +++ b/external/crypto++-5.6.3/default.h @@ -0,0 +1,201 @@ +// default.h - written and placed in the public domain by Wei Dai + +//! \file default.h +//! \brief Classes for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC + +#ifndef CRYPTOPP_DEFAULT_H +#define CRYPTOPP_DEFAULT_H + +#include "sha.h" +#include "hmac.h" +#include "des.h" +#include "modes.h" +#include "filters.h" +#include "smartptr.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \brief Default block cipher for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC +typedef DES_EDE2 DefaultBlockCipher; +//! \brief Default hash for use with DefaultEncryptorWithMAC and DefaultDecryptorWithMAC +typedef SHA DefaultHashModule; +//! \brief Default HMAC for use withDefaultEncryptorWithMAC and DefaultDecryptorWithMAC +typedef HMAC DefaultMAC; + +//! \class DefaultEncryptor +//! \brief Password-Based Encryptor using TripleDES +//! \details The class uses 2-key TripleDES (DES_EDE2) for encryption, which only +//! provides about 80-bits of security. +class DefaultEncryptor : public ProxyFilter +{ +public: + //! \brief Construct a DefaultEncryptor + //! \param passphrase a C-String password + //! \param attachment a BufferedTransformation to attach to this object + DefaultEncryptor(const char *passphrase, BufferedTransformation *attachment = NULL); + + //! \brief Construct a DefaultEncryptor + //! \param passphrase a byte string password + //! \param passphraseLength the length of the byte string password + //! \param attachment a BufferedTransformation to attach to this object + DefaultEncryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL); + +protected: + void FirstPut(const byte *); + void LastPut(const byte *inString, size_t length); + +private: + SecByteBlock m_passphrase; + CBC_Mode::Encryption m_cipher; + +#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) +} __attribute__((deprecated ("DefaultEncryptor will be changing in the near future because the algorithms are no longer secure"))); +#elif (CRYPTOPP_GCC_VERSION) +} __attribute__((deprecated)); +#else +}; +#endif + +//! \class DefaultDecryptor +//! \brief Password-Based Decryptor using TripleDES +//! \details The class uses 2-key TripleDES (DES_EDE2) for encryption, which only +//! provides about 80-bits of security. +class DefaultDecryptor : public ProxyFilter +{ +public: + //! \brief Constructs a DefaultDecryptor + //! \param passphrase a C-String password + //! \param attachment a BufferedTransformation to attach to this object + //! \param throwException a flag specifiying whether an Exception should be thrown on error + DefaultDecryptor(const char *passphrase, BufferedTransformation *attachment = NULL, bool throwException=true); + + //! \brief Constructs a DefaultDecryptor + //! \param passphrase a byte string password + //! \param passphraseLength the length of the byte string password + //! \param attachment a BufferedTransformation to attach to this object + //! \param throwException a flag specifiying whether an Exception should be thrown on error + DefaultDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL, bool throwException=true); + + class Err : public Exception + { + public: + Err(const std::string &s) + : Exception(DATA_INTEGRITY_CHECK_FAILED, s) {} + }; + class KeyBadErr : public Err {public: KeyBadErr() : Err("DefaultDecryptor: cannot decrypt message with this passphrase") {}}; + + enum State {WAITING_FOR_KEYCHECK, KEY_GOOD, KEY_BAD}; + State CurrentState() const {return m_state;} + +protected: + void FirstPut(const byte *inString); + void LastPut(const byte *inString, size_t length); + + State m_state; + +private: + void CheckKey(const byte *salt, const byte *keyCheck); + + SecByteBlock m_passphrase; + CBC_Mode::Decryption m_cipher; + member_ptr m_decryptor; + bool m_throwException; + +#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) +} __attribute__((deprecated ("DefaultDecryptor will be changing in the near future because the algorithms are no longer secure"))); +#elif (CRYPTOPP_GCC_VERSION) +} __attribute__((deprecated)); +#else +}; +#endif + +//! \class DefaultEncryptorWithMAC +//! \brief Password-Based encryptor using TripleDES and HMAC/SHA-1 +//! \details DefaultEncryptorWithMAC uses a non-standard mashup function called Mash() to derive key +//! bits from the password. The class also uses 2-key TripleDES (DES_EDE2) for encryption, which only +//! provides about 80-bits of security. +//! \details The purpose of the function Mash() is to take an arbitrary length input string and +//! *deterministicly* produce an arbitrary length output string such that (1) it looks random, +//! (2) no information about the input is deducible from it, and (3) it contains as much entropy +//! as it can hold, or the amount of entropy in the input string, whichever is smaller. +class DefaultEncryptorWithMAC : public ProxyFilter +{ +public: + //! \brief Constructs a DefaultEncryptorWithMAC + //! \param passphrase a C-String password + //! \param attachment a BufferedTransformation to attach to this object + DefaultEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULL); + + //! \brief Constructs a DefaultEncryptorWithMAC + //! \param passphrase a byte string password + //! \param passphraseLength the length of the byte string password + //! \param attachment a BufferedTransformation to attach to this object + DefaultEncryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL); + +protected: + void FirstPut(const byte *inString) {CRYPTOPP_UNUSED(inString);} + void LastPut(const byte *inString, size_t length); + +private: + member_ptr m_mac; + +#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) +} __attribute__((deprecated ("DefaultEncryptorWithMAC will be changing in the near future because the algorithms are no longer secure"))); +#elif (CRYPTOPP_GCC_VERSION) +} __attribute__((deprecated)); +#else +}; +#endif + +//! \class DefaultDecryptorWithMAC +//! \brief Password-Based decryptor using TripleDES and HMAC/SHA-1 +//! \details DefaultDecryptorWithMAC uses a non-standard mashup function called Mash() to derive key +//! bits from the password. The class also uses 2-key TripleDES (DES_EDE2) for encryption, which only +//! provides about 80-bits of security. +//! \details The purpose of the function Mash() is to take an arbitrary length input string and +//! *deterministicly* produce an arbitrary length output string such that (1) it looks random, +//! (2) no information about the input is deducible from it, and (3) it contains as much entropy +//! as it can hold, or the amount of entropy in the input string, whichever is smaller. +class DefaultDecryptorWithMAC : public ProxyFilter +{ +public: + //! \class MACBadErr + //! \brief Excpetion thrown when an incorrect MAC is encountered + class MACBadErr : public DefaultDecryptor::Err {public: MACBadErr() : DefaultDecryptor::Err("DefaultDecryptorWithMAC: MAC check failed") {}}; + + //! \brief Constructs a DefaultDecryptor + //! \param passphrase a C-String password + //! \param attachment a BufferedTransformation to attach to this object + //! \param throwException a flag specifiying whether an Exception should be thrown on error + DefaultDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULL, bool throwException=true); + + //! \brief Constructs a DefaultDecryptor + //! \param passphrase a byte string password + //! \param passphraseLength the length of the byte string password + //! \param attachment a BufferedTransformation to attach to this object + //! \param throwException a flag specifiying whether an Exception should be thrown on error + DefaultDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL, bool throwException=true); + + DefaultDecryptor::State CurrentState() const; + bool CheckLastMAC() const; + +protected: + void FirstPut(const byte *inString) {CRYPTOPP_UNUSED(inString);} + void LastPut(const byte *inString, size_t length); + +private: + member_ptr m_mac; + HashVerifier *m_hashVerifier; + bool m_throwException; + +#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) +} __attribute__((deprecated ("DefaultDecryptorWithMAC will be changing in the near future because the algorithms are no longer secure"))); +#elif (CRYPTOPP_GCC_VERSION) +} __attribute__((deprecated)); +#else +}; +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/des.cpp b/external/crypto++-5.6.3/des.cpp new file mode 100644 index 000000000..d563327a3 --- /dev/null +++ b/external/crypto++-5.6.3/des.cpp @@ -0,0 +1,453 @@ +// des.cpp - modified by Wei Dai from Phil Karn's des.c +// The original code and all modifications are in the public domain. + +/* + * This is a major rewrite of my old public domain DES code written + * circa 1987, which in turn borrowed heavily from Jim Gillogly's 1977 + * public domain code. I pretty much kept my key scheduling code, but + * the actual encrypt/decrypt routines are taken from from Richard + * Outerbridge's DES code as printed in Schneier's "Applied Cryptography." + * + * This code is in the public domain. I would appreciate bug reports and + * enhancements. + * + * Phil Karn KA9Q, karn@unix.ka9q.ampr.org, August 1994. + */ + +#include "pch.h" +#include "misc.h" +#include "des.h" + +NAMESPACE_BEGIN(CryptoPP) + +typedef BlockGetAndPut Block; + +// Richard Outerbridge's initial permutation algorithm +/* +inline void IPERM(word32 &left, word32 &right) +{ + word32 work; + + work = ((left >> 4) ^ right) & 0x0f0f0f0f; + right ^= work; + left ^= work << 4; + work = ((left >> 16) ^ right) & 0xffff; + right ^= work; + left ^= work << 16; + work = ((right >> 2) ^ left) & 0x33333333; + left ^= work; + right ^= (work << 2); + work = ((right >> 8) ^ left) & 0xff00ff; + left ^= work; + right ^= (work << 8); + right = rotl(right, 1); + work = (left ^ right) & 0xaaaaaaaa; + left ^= work; + right ^= work; + left = rotl(left, 1); +} +inline void FPERM(word32 &left, word32 &right) +{ + word32 work; + + right = rotr(right, 1); + work = (left ^ right) & 0xaaaaaaaa; + left ^= work; + right ^= work; + left = rotr(left, 1); + work = ((left >> 8) ^ right) & 0xff00ff; + right ^= work; + left ^= work << 8; + work = ((left >> 2) ^ right) & 0x33333333; + right ^= work; + left ^= work << 2; + work = ((right >> 16) ^ left) & 0xffff; + left ^= work; + right ^= work << 16; + work = ((right >> 4) ^ left) & 0x0f0f0f0f; + left ^= work; + right ^= work << 4; +} +*/ + +// Wei Dai's modification to Richard Outerbridge's initial permutation +// algorithm, this one is faster if you have access to rotate instructions +// (like in MSVC) +static inline void IPERM(word32 &left, word32 &right) +{ + word32 work; + + right = rotlFixed(right, 4U); + work = (left ^ right) & 0xf0f0f0f0; + left ^= work; + right = rotrFixed(right^work, 20U); + work = (left ^ right) & 0xffff0000; + left ^= work; + right = rotrFixed(right^work, 18U); + work = (left ^ right) & 0x33333333; + left ^= work; + right = rotrFixed(right^work, 6U); + work = (left ^ right) & 0x00ff00ff; + left ^= work; + right = rotlFixed(right^work, 9U); + work = (left ^ right) & 0xaaaaaaaa; + left = rotlFixed(left^work, 1U); + right ^= work; +} + +static inline void FPERM(word32 &left, word32 &right) +{ + word32 work; + + right = rotrFixed(right, 1U); + work = (left ^ right) & 0xaaaaaaaa; + right ^= work; + left = rotrFixed(left^work, 9U); + work = (left ^ right) & 0x00ff00ff; + right ^= work; + left = rotlFixed(left^work, 6U); + work = (left ^ right) & 0x33333333; + right ^= work; + left = rotlFixed(left^work, 18U); + work = (left ^ right) & 0xffff0000; + right ^= work; + left = rotlFixed(left^work, 20U); + work = (left ^ right) & 0xf0f0f0f0; + right ^= work; + left = rotrFixed(left^work, 4U); +} + +void DES::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + RawSetKey(GetCipherDirection(), userKey); +} + +#ifndef CRYPTOPP_IMPORTS + +/* Tables defined in the Data Encryption Standard documents + * Three of these tables, the initial permutation, the final + * permutation and the expansion operator, are regular enough that + * for speed, we hard-code them. They're here for reference only. + * Also, the S and P boxes are used by a separate program, gensp.c, + * to build the combined SP box, Spbox[]. They're also here just + * for reference. + */ +#ifdef notdef +/* initial permutation IP */ +static byte ip[] = { + 58, 50, 42, 34, 26, 18, 10, 2, + 60, 52, 44, 36, 28, 20, 12, 4, + 62, 54, 46, 38, 30, 22, 14, 6, + 64, 56, 48, 40, 32, 24, 16, 8, + 57, 49, 41, 33, 25, 17, 9, 1, + 59, 51, 43, 35, 27, 19, 11, 3, + 61, 53, 45, 37, 29, 21, 13, 5, + 63, 55, 47, 39, 31, 23, 15, 7 +}; + +/* final permutation IP^-1 */ +static byte fp[] = { + 40, 8, 48, 16, 56, 24, 64, 32, + 39, 7, 47, 15, 55, 23, 63, 31, + 38, 6, 46, 14, 54, 22, 62, 30, + 37, 5, 45, 13, 53, 21, 61, 29, + 36, 4, 44, 12, 52, 20, 60, 28, + 35, 3, 43, 11, 51, 19, 59, 27, + 34, 2, 42, 10, 50, 18, 58, 26, + 33, 1, 41, 9, 49, 17, 57, 25 +}; +/* expansion operation matrix */ +static byte ei[] = { + 32, 1, 2, 3, 4, 5, + 4, 5, 6, 7, 8, 9, + 8, 9, 10, 11, 12, 13, + 12, 13, 14, 15, 16, 17, + 16, 17, 18, 19, 20, 21, + 20, 21, 22, 23, 24, 25, + 24, 25, 26, 27, 28, 29, + 28, 29, 30, 31, 32, 1 +}; +/* The (in)famous S-boxes */ +static byte sbox[8][64] = { + /* S1 */ + 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, + 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, + 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, + 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13, + + /* S2 */ + 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, + 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, + 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, + 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9, + + /* S3 */ + 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, + 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, + 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, + 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12, + + /* S4 */ + 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, + 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, + 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, + 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14, + + /* S5 */ + 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, + 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, + 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, + 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3, + + /* S6 */ + 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, + 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, + 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, + 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13, + + /* S7 */ + 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, + 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, + 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, + 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12, + + /* S8 */ + 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, + 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, + 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, + 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 +}; + +/* 32-bit permutation function P used on the output of the S-boxes */ +static byte p32i[] = { + 16, 7, 20, 21, + 29, 12, 28, 17, + 1, 15, 23, 26, + 5, 18, 31, 10, + 2, 8, 24, 14, + 32, 27, 3, 9, + 19, 13, 30, 6, + 22, 11, 4, 25 +}; +#endif + +/* permuted choice table (key) */ +static const byte pc1[] = { + 57, 49, 41, 33, 25, 17, 9, + 1, 58, 50, 42, 34, 26, 18, + 10, 2, 59, 51, 43, 35, 27, + 19, 11, 3, 60, 52, 44, 36, + + 63, 55, 47, 39, 31, 23, 15, + 7, 62, 54, 46, 38, 30, 22, + 14, 6, 61, 53, 45, 37, 29, + 21, 13, 5, 28, 20, 12, 4 +}; + +/* number left rotations of pc1 */ +static const byte totrot[] = { + 1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 +}; + +/* permuted choice key (table) */ +static const byte pc2[] = { + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 +}; + +/* End of DES-defined tables */ + +/* bit 0 is left-most in byte */ +static const int bytebit[] = { + 0200,0100,040,020,010,04,02,01 +}; + +/* Set key (initialize key schedule array) */ +void RawDES::RawSetKey(CipherDir dir, const byte *key) +{ +#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) +# define register /* Define to nothing for C++11 and above */ +#endif + + SecByteBlock buffer(56+56+8); + byte *const pc1m=buffer; /* place to modify pc1 into */ + byte *const pcr=pc1m+56; /* place to rotate pc1 into */ + byte *const ks=pcr+56; + register int i,j,l; + int m; + + for (j=0; j<56; j++) { /* convert pc1 to bits of key */ + l=pc1[j]-1; /* integer bit location */ + m = l & 07; /* find bit */ + pc1m[j]=(key[l>>3] & /* find which key byte l is in */ + bytebit[m]) /* and which bit of that byte */ + ? 1 : 0; /* and store 1-bit result */ + } + for (i=0; i<16; i++) { /* key chunk for each iteration */ + memset(ks,0,8); /* Clear key schedule */ + for (j=0; j<56; j++) /* rotate pc1 the right amount */ + pcr[j] = pc1m[(l=j+totrot[i])<(j<28? 28 : 56) ? l: l-28]; + /* rotate left and right halves independently */ + for (j=0; j<48; j++){ /* select bits individually */ + /* check bit that goes to ks[j] */ + if (pcr[pc2[j]-1]){ + /* mask it in if it's there */ + l= j % 6; + ks[j/6] |= bytebit[l] >> 2; + } + } + /* Now convert to odd/even interleaved form for use in F */ + k[2*i] = ((word32)ks[0] << 24) + | ((word32)ks[2] << 16) + | ((word32)ks[4] << 8) + | ((word32)ks[6]); + k[2*i+1] = ((word32)ks[1] << 24) + | ((word32)ks[3] << 16) + | ((word32)ks[5] << 8) + | ((word32)ks[7]); + } + + if (dir==DECRYPTION) // reverse key schedule order + for (i=0; i<16; i+=2) + { + std::swap(k[i], k[32-2-i]); + std::swap(k[i+1], k[32-1-i]); + } +} + +void RawDES::RawProcessBlock(word32 &l_, word32 &r_) const +{ + word32 l = l_, r = r_; + const word32 *kptr=k; + + for (unsigned i=0; i<8; i++) + { + word32 work = rotrFixed(r, 4U) ^ kptr[4*i+0]; + l ^= Spbox[6][(work) & 0x3f] + ^ Spbox[4][(work >> 8) & 0x3f] + ^ Spbox[2][(work >> 16) & 0x3f] + ^ Spbox[0][(work >> 24) & 0x3f]; + work = r ^ kptr[4*i+1]; + l ^= Spbox[7][(work) & 0x3f] + ^ Spbox[5][(work >> 8) & 0x3f] + ^ Spbox[3][(work >> 16) & 0x3f] + ^ Spbox[1][(work >> 24) & 0x3f]; + + work = rotrFixed(l, 4U) ^ kptr[4*i+2]; + r ^= Spbox[6][(work) & 0x3f] + ^ Spbox[4][(work >> 8) & 0x3f] + ^ Spbox[2][(work >> 16) & 0x3f] + ^ Spbox[0][(work >> 24) & 0x3f]; + work = l ^ kptr[4*i+3]; + r ^= Spbox[7][(work) & 0x3f] + ^ Spbox[5][(work >> 8) & 0x3f] + ^ Spbox[3][(work >> 16) & 0x3f] + ^ Spbox[1][(work >> 24) & 0x3f]; + } + + l_ = l; r_ = r; +} + +void DES_EDE2::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + m_des1.RawSetKey(GetCipherDirection(), userKey); + m_des2.RawSetKey(ReverseCipherDir(GetCipherDirection()), userKey+8); +} + +void DES_EDE2::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 l,r; + Block::Get(inBlock)(l)(r); + IPERM(l,r); + m_des1.RawProcessBlock(l, r); + m_des2.RawProcessBlock(r, l); + m_des1.RawProcessBlock(l, r); + FPERM(l,r); + Block::Put(xorBlock, outBlock)(r)(l); +} + +void DES_EDE3::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + m_des1.RawSetKey(GetCipherDirection(), userKey + (IsForwardTransformation() ? 0 : 16)); + m_des2.RawSetKey(ReverseCipherDir(GetCipherDirection()), userKey + 8); + m_des3.RawSetKey(GetCipherDirection(), userKey + (IsForwardTransformation() ? 16 : 0)); +} + +void DES_EDE3::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 l,r; + Block::Get(inBlock)(l)(r); + IPERM(l,r); + m_des1.RawProcessBlock(l, r); + m_des2.RawProcessBlock(r, l); + m_des3.RawProcessBlock(l, r); + FPERM(l,r); + Block::Put(xorBlock, outBlock)(r)(l); +} + +#endif // #ifndef CRYPTOPP_IMPORTS + +static inline bool CheckParity(byte b) +{ + unsigned int a = b ^ (b >> 4); + return ((a ^ (a>>1) ^ (a>>2) ^ (a>>3)) & 1) == 1; +} + +bool DES::CheckKeyParityBits(const byte *key) +{ + for (unsigned int i=0; i<8; i++) + if (!CheckParity(key[i])) + return false; + return true; +} + +void DES::CorrectKeyParityBits(byte *key) +{ + for (unsigned int i=0; i<8; i++) + if (!CheckParity(key[i])) + key[i] ^= 1; +} + +// Encrypt or decrypt a block of data in ECB mode +void DES::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 l,r; + Block::Get(inBlock)(l)(r); + IPERM(l,r); + RawProcessBlock(l, r); + FPERM(l,r); + Block::Put(xorBlock, outBlock)(r)(l); +} + +void DES_XEX3::Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + if (!m_des.get()) + m_des.reset(new DES::Encryption); + + memcpy(m_x1, key + (IsForwardTransformation() ? 0 : 16), BLOCKSIZE); + m_des->RawSetKey(GetCipherDirection(), key + 8); + memcpy(m_x3, key + (IsForwardTransformation() ? 16 : 0), BLOCKSIZE); +} + +void DES_XEX3::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + xorbuf(outBlock, inBlock, m_x1, BLOCKSIZE); + m_des->ProcessAndXorBlock(outBlock, xorBlock, outBlock); + xorbuf(outBlock, m_x3, BLOCKSIZE); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/des.h b/external/crypto++-5.6.3/des.h new file mode 100644 index 000000000..55971e064 --- /dev/null +++ b/external/crypto++-5.6.3/des.h @@ -0,0 +1,146 @@ +// des.h - written and placed in the public domain by Wei Dai + +//! \file des.h +//! \brief Classes for DES, 2-key Triple-DES, 3-key Triple-DES and DESX + +#ifndef CRYPTOPP_DES_H +#define CRYPTOPP_DES_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +class CRYPTOPP_DLL RawDES +{ +public: + void RawSetKey(CipherDir direction, const byte *userKey); + void RawProcessBlock(word32 &l, word32 &r) const; + +protected: + static const word32 Spbox[8][64]; + + FixedSizeSecBlock k; +}; + +//! _ +struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8> +{ + // disable DES in DLL version by not exporting this function + static const char * StaticAlgorithmName() {return "DES";} +}; + +/// DES +/*! The DES implementation in Crypto++ ignores the parity bits + (the least significant bits of each byte) in the key. However + you can use CheckKeyParityBits() and CorrectKeyParityBits() to + check or correct the parity bits if you wish. */ +class DES : public DES_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl, public RawDES + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + //! check DES key parity bits + static bool CheckKeyParityBits(const byte *key); + //! correct DES key parity bits + static void CorrectKeyParityBits(byte *key); + + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +//! _ +struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16> +{ + CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE2";} +}; + +/// DES-EDE2 +class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + protected: + RawDES m_des1, m_des2; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +//! _ +struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> +{ + CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE3";} +}; + +/// DES-EDE3 +class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + protected: + RawDES m_des1, m_des2, m_des3; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +//! _ +struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> +{ + static const char *StaticAlgorithmName() {return "DES-XEX3";} +}; + +/// DES-XEX3, AKA DESX +class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + protected: + FixedSizeSecBlock m_x1, m_x3; + // VS2005 workaround: calling modules compiled with /clr gets unresolved external symbol DES::Base::ProcessAndXorBlock + // if we use DES::Encryption here directly without value_ptr. + value_ptr m_des; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef DES::Encryption DESEncryption; +typedef DES::Decryption DESDecryption; + +typedef DES_EDE2::Encryption DES_EDE2_Encryption; +typedef DES_EDE2::Decryption DES_EDE2_Decryption; + +typedef DES_EDE3::Encryption DES_EDE3_Encryption; +typedef DES_EDE3::Decryption DES_EDE3_Decryption; + +typedef DES_XEX3::Encryption DES_XEX3_Encryption; +typedef DES_XEX3::Decryption DES_XEX3_Decryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dessp.cpp b/external/crypto++-5.6.3/dessp.cpp new file mode 100644 index 000000000..49ed1d26d --- /dev/null +++ b/external/crypto++-5.6.3/dessp.cpp @@ -0,0 +1,95 @@ +// This file is mostly generated by Phil Karn's gensp.c + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "des.h" + +NAMESPACE_BEGIN(CryptoPP) + +// VC60 workaround: gives a C4786 warning without this function +// when runtime lib is set to multithread debug DLL +// even though warning 4786 is disabled! +void DES_VC60Workaround() +{ +} + +const word32 RawDES::Spbox[8][64] = { +{ +0x01010400,0x00000000,0x00010000,0x01010404, 0x01010004,0x00010404,0x00000004,0x00010000, +0x00000400,0x01010400,0x01010404,0x00000400, 0x01000404,0x01010004,0x01000000,0x00000004, +0x00000404,0x01000400,0x01000400,0x00010400, 0x00010400,0x01010000,0x01010000,0x01000404, +0x00010004,0x01000004,0x01000004,0x00010004, 0x00000000,0x00000404,0x00010404,0x01000000, +0x00010000,0x01010404,0x00000004,0x01010000, 0x01010400,0x01000000,0x01000000,0x00000400, +0x01010004,0x00010000,0x00010400,0x01000004, 0x00000400,0x00000004,0x01000404,0x00010404, +0x01010404,0x00010004,0x01010000,0x01000404, 0x01000004,0x00000404,0x00010404,0x01010400, +0x00000404,0x01000400,0x01000400,0x00000000, 0x00010004,0x00010400,0x00000000,0x01010004}, +{ +0x80108020,0x80008000,0x00008000,0x00108020, 0x00100000,0x00000020,0x80100020,0x80008020, +0x80000020,0x80108020,0x80108000,0x80000000, 0x80008000,0x00100000,0x00000020,0x80100020, +0x00108000,0x00100020,0x80008020,0x00000000, 0x80000000,0x00008000,0x00108020,0x80100000, +0x00100020,0x80000020,0x00000000,0x00108000, 0x00008020,0x80108000,0x80100000,0x00008020, +0x00000000,0x00108020,0x80100020,0x00100000, 0x80008020,0x80100000,0x80108000,0x00008000, +0x80100000,0x80008000,0x00000020,0x80108020, 0x00108020,0x00000020,0x00008000,0x80000000, +0x00008020,0x80108000,0x00100000,0x80000020, 0x00100020,0x80008020,0x80000020,0x00100020, +0x00108000,0x00000000,0x80008000,0x00008020, 0x80000000,0x80100020,0x80108020,0x00108000}, +{ +0x00000208,0x08020200,0x00000000,0x08020008, 0x08000200,0x00000000,0x00020208,0x08000200, +0x00020008,0x08000008,0x08000008,0x00020000, 0x08020208,0x00020008,0x08020000,0x00000208, +0x08000000,0x00000008,0x08020200,0x00000200, 0x00020200,0x08020000,0x08020008,0x00020208, +0x08000208,0x00020200,0x00020000,0x08000208, 0x00000008,0x08020208,0x00000200,0x08000000, +0x08020200,0x08000000,0x00020008,0x00000208, 0x00020000,0x08020200,0x08000200,0x00000000, +0x00000200,0x00020008,0x08020208,0x08000200, 0x08000008,0x00000200,0x00000000,0x08020008, +0x08000208,0x00020000,0x08000000,0x08020208, 0x00000008,0x00020208,0x00020200,0x08000008, +0x08020000,0x08000208,0x00000208,0x08020000, 0x00020208,0x00000008,0x08020008,0x00020200}, +{ +0x00802001,0x00002081,0x00002081,0x00000080, 0x00802080,0x00800081,0x00800001,0x00002001, +0x00000000,0x00802000,0x00802000,0x00802081, 0x00000081,0x00000000,0x00800080,0x00800001, +0x00000001,0x00002000,0x00800000,0x00802001, 0x00000080,0x00800000,0x00002001,0x00002080, +0x00800081,0x00000001,0x00002080,0x00800080, 0x00002000,0x00802080,0x00802081,0x00000081, +0x00800080,0x00800001,0x00802000,0x00802081, 0x00000081,0x00000000,0x00000000,0x00802000, +0x00002080,0x00800080,0x00800081,0x00000001, 0x00802001,0x00002081,0x00002081,0x00000080, +0x00802081,0x00000081,0x00000001,0x00002000, 0x00800001,0x00002001,0x00802080,0x00800081, +0x00002001,0x00002080,0x00800000,0x00802001, 0x00000080,0x00800000,0x00002000,0x00802080}, +{ +0x00000100,0x02080100,0x02080000,0x42000100, 0x00080000,0x00000100,0x40000000,0x02080000, +0x40080100,0x00080000,0x02000100,0x40080100, 0x42000100,0x42080000,0x00080100,0x40000000, +0x02000000,0x40080000,0x40080000,0x00000000, 0x40000100,0x42080100,0x42080100,0x02000100, +0x42080000,0x40000100,0x00000000,0x42000000, 0x02080100,0x02000000,0x42000000,0x00080100, +0x00080000,0x42000100,0x00000100,0x02000000, 0x40000000,0x02080000,0x42000100,0x40080100, +0x02000100,0x40000000,0x42080000,0x02080100, 0x40080100,0x00000100,0x02000000,0x42080000, +0x42080100,0x00080100,0x42000000,0x42080100, 0x02080000,0x00000000,0x40080000,0x42000000, +0x00080100,0x02000100,0x40000100,0x00080000, 0x00000000,0x40080000,0x02080100,0x40000100}, +{ +0x20000010,0x20400000,0x00004000,0x20404010, 0x20400000,0x00000010,0x20404010,0x00400000, +0x20004000,0x00404010,0x00400000,0x20000010, 0x00400010,0x20004000,0x20000000,0x00004010, +0x00000000,0x00400010,0x20004010,0x00004000, 0x00404000,0x20004010,0x00000010,0x20400010, +0x20400010,0x00000000,0x00404010,0x20404000, 0x00004010,0x00404000,0x20404000,0x20000000, +0x20004000,0x00000010,0x20400010,0x00404000, 0x20404010,0x00400000,0x00004010,0x20000010, +0x00400000,0x20004000,0x20000000,0x00004010, 0x20000010,0x20404010,0x00404000,0x20400000, +0x00404010,0x20404000,0x00000000,0x20400010, 0x00000010,0x00004000,0x20400000,0x00404010, +0x00004000,0x00400010,0x20004010,0x00000000, 0x20404000,0x20000000,0x00400010,0x20004010}, +{ +0x00200000,0x04200002,0x04000802,0x00000000, 0x00000800,0x04000802,0x00200802,0x04200800, +0x04200802,0x00200000,0x00000000,0x04000002, 0x00000002,0x04000000,0x04200002,0x00000802, +0x04000800,0x00200802,0x00200002,0x04000800, 0x04000002,0x04200000,0x04200800,0x00200002, +0x04200000,0x00000800,0x00000802,0x04200802, 0x00200800,0x00000002,0x04000000,0x00200800, +0x04000000,0x00200800,0x00200000,0x04000802, 0x04000802,0x04200002,0x04200002,0x00000002, +0x00200002,0x04000000,0x04000800,0x00200000, 0x04200800,0x00000802,0x00200802,0x04200800, +0x00000802,0x04000002,0x04200802,0x04200000, 0x00200800,0x00000000,0x00000002,0x04200802, +0x00000000,0x00200802,0x04200000,0x00000800, 0x04000002,0x04000800,0x00000800,0x00200002}, +{ +0x10001040,0x00001000,0x00040000,0x10041040, 0x10000000,0x10001040,0x00000040,0x10000000, +0x00040040,0x10040000,0x10041040,0x00041000, 0x10041000,0x00041040,0x00001000,0x00000040, +0x10040000,0x10000040,0x10001000,0x00001040, 0x00041000,0x00040040,0x10040040,0x10041000, +0x00001040,0x00000000,0x00000000,0x10040040, 0x10000040,0x10001000,0x00041040,0x00040000, +0x00041040,0x00040000,0x10041000,0x00001000, 0x00000040,0x10040040,0x00001000,0x00041040, +0x10001000,0x00000040,0x10000040,0x10040000, 0x10040040,0x10000000,0x00040000,0x10001040, +0x00000000,0x10041040,0x00040040,0x10000040, 0x10040000,0x10001000,0x10001040,0x00000000, +0x10041040,0x00041000,0x00041000,0x00001040, 0x00001040,0x00040040,0x10000000,0x10041000} +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dh.cpp b/external/crypto++-5.6.3/dh.cpp new file mode 100644 index 000000000..8f55ffa68 --- /dev/null +++ b/external/crypto++-5.6.3/dh.cpp @@ -0,0 +1,21 @@ +// dh.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "dh.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void DH_TestInstantiations() +{ + DH dh1; + DH dh2(NullRNG(), 10); +} +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dh.h b/external/crypto++-5.6.3/dh.h new file mode 100644 index 000000000..d0f9f3397 --- /dev/null +++ b/external/crypto++-5.6.3/dh.h @@ -0,0 +1,107 @@ +// dh.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile dh.h +//! \brief Classes for Diffie-Hellman key exchange + +#ifndef CRYPTOPP_DH_H +#define CRYPTOPP_DH_H + +#include "cryptlib.h" +#include "gfpcrypt.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! , +template +class DH_Domain : public DL_SimpleKeyAgreementDomainBase +{ + typedef DL_SimpleKeyAgreementDomainBase Base; + +public: + typedef GROUP_PARAMETERS GroupParameters; + typedef typename GroupParameters::Element Element; + typedef DL_KeyAgreementAlgorithm_DH DH_Algorithm; + typedef DH_Domain Domain; + + DH_Domain() {} + + DH_Domain(const GroupParameters ¶ms) + : m_groupParameters(params) {} + + DH_Domain(BufferedTransformation &bt) + {m_groupParameters.BERDecode(bt);} + + template + DH_Domain(RandomNumberGenerator &v1, const T2 &v2) + {m_groupParameters.Initialize(v1, v2);} + + template + DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3) + {m_groupParameters.Initialize(v1, v2, v3);} + + template + DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3, const T4 &v4) + {m_groupParameters.Initialize(v1, v2, v3, v4);} + + template + DH_Domain(const T1 &v1, const T2 &v2) + {m_groupParameters.Initialize(v1, v2);} + + template + DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3) + {m_groupParameters.Initialize(v1, v2, v3);} + + template + DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) + {m_groupParameters.Initialize(v1, v2, v3, v4);} + + const GroupParameters & GetGroupParameters() const {return m_groupParameters;} + GroupParameters & AccessGroupParameters() {return m_groupParameters;} + + void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const + { + Base::GeneratePublicKey(rng, privateKey, publicKey); + + if (FIPS_140_2_ComplianceEnabled()) + { + SecByteBlock privateKey2(this->PrivateKeyLength()); + this->GeneratePrivateKey(rng, privateKey2); + + SecByteBlock publicKey2(this->PublicKeyLength()); + Base::GeneratePublicKey(rng, privateKey2, publicKey2); + + SecByteBlock agreedValue(this->AgreedValueLength()), agreedValue2(this->AgreedValueLength()); + bool agreed1 = this->Agree(agreedValue, privateKey, publicKey2); + bool agreed2 = this->Agree(agreedValue2, privateKey2, publicKey); + + if (!agreed1 || !agreed2 || agreedValue != agreedValue2) + throw SelfTestFailure(this->AlgorithmName() + ": pairwise consistency test failed"); + } + } + + static std::string CRYPTOPP_API StaticAlgorithmName() + {return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();} + std::string AlgorithmName() const {return StaticAlgorithmName();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DH_Domain() {} +#endif + +private: + const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const + {return Singleton().Ref();} + DL_GroupParameters & AccessAbstractGroupParameters() + {return m_groupParameters;} + + GroupParameters m_groupParameters; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS DH_Domain; + +//! Diffie-Hellman in GF(p) with key validation +typedef DH_Domain DH; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dh2.cpp b/external/crypto++-5.6.3/dh2.cpp new file mode 100644 index 000000000..e1a8afd70 --- /dev/null +++ b/external/crypto++-5.6.3/dh2.cpp @@ -0,0 +1,24 @@ +// dh2.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "dh2.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void DH2_TestInstantiations() +{ + DH2 dh(*(SimpleKeyAgreementDomain*)NULL); +} +#endif + +bool DH2::Agree(byte *agreedValue, + const byte *staticSecretKey, const byte *ephemeralSecretKey, + const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, + bool validateStaticOtherPublicKey) const +{ + return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey) + && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/dh2.h b/external/crypto++-5.6.3/dh2.h new file mode 100644 index 000000000..28d48ab73 --- /dev/null +++ b/external/crypto++-5.6.3/dh2.h @@ -0,0 +1,65 @@ +// dh2.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile dh2.h +//! \brief Classes for Diffie-Hellman authenticated key exchange + +#ifndef CRYPTOPP_DH2_H +#define CRYPTOPP_DH2_H + +#include "cryptlib.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// Unified Diffie-Hellman +class DH2 : public AuthenticatedKeyAgreementDomain +{ +public: + DH2(SimpleKeyAgreementDomain &domain) + : d1(domain), d2(domain) {} + DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain) + : d1(staticDomain), d2(ephemeralDomain) {} + + CryptoParameters & AccessCryptoParameters() {return d1.AccessCryptoParameters();} + + unsigned int AgreedValueLength() const + {return d1.AgreedValueLength() + d2.AgreedValueLength();} + + unsigned int StaticPrivateKeyLength() const + {return d1.PrivateKeyLength();} + unsigned int StaticPublicKeyLength() const + {return d1.PublicKeyLength();} + void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const + {d1.GeneratePrivateKey(rng, privateKey);} + void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const + {d1.GeneratePublicKey(rng, privateKey, publicKey);} + void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const + {d1.GenerateKeyPair(rng, privateKey, publicKey);} + + unsigned int EphemeralPrivateKeyLength() const + {return d2.PrivateKeyLength();} + unsigned int EphemeralPublicKeyLength() const + {return d2.PublicKeyLength();} + void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const + {d2.GeneratePrivateKey(rng, privateKey);} + void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const + {d2.GeneratePublicKey(rng, privateKey, publicKey);} + void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const + {d2.GenerateKeyPair(rng, privateKey, publicKey);} + + bool Agree(byte *agreedValue, + const byte *staticPrivateKey, const byte *ephemeralPrivateKey, + const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, + bool validateStaticOtherPublicKey=true) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DH2() {} +#endif + +protected: + SimpleKeyAgreementDomain &d1, &d2; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dll.cpp b/external/crypto++-5.6.3/dll.cpp new file mode 100644 index 000000000..1b16d2aed --- /dev/null +++ b/external/crypto++-5.6.3/dll.cpp @@ -0,0 +1,160 @@ +// dll.cpp - written and placed in the public domain by Wei Dai + +#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#define CRYPTOPP_DEFAULT_NO_DLL + +#include "dll.h" +#include "config.h" + +// TODO: fix the C4589 warnings +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4589) +#endif + +#if CRYPTOPP_MSC_VERSION +# pragma warning(default: 4660) +#endif + +#if defined(CRYPTOPP_EXPORTS) && defined(CRYPTOPP_WIN32_AVAILABLE) +#include +#endif + +#ifndef CRYPTOPP_IMPORTS + +NAMESPACE_BEGIN(CryptoPP) + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x2d,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x04,0x05,0x00,0x04,0x1c}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0x04,0x20}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x41,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,0x05,0x00,0x04,0x30}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,0x05,0x00,0x04,0x40}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte EMSA2HashId::id = 0x33; +template<> const byte EMSA2HashId::id = 0x38; +template<> const byte EMSA2HashId::id = 0x34; +template<> const byte EMSA2HashId::id = 0x36; +template<> const byte EMSA2HashId::id = 0x35; + +NAMESPACE_END + +#endif + +#ifdef CRYPTOPP_EXPORTS + +USING_NAMESPACE(CryptoPP) + +#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) +using std::set_new_handler; +#endif + +static PNew s_pNew = NULL; +static PDelete s_pDelete = NULL; + +static void * New (size_t size) +{ + void *p; + while ((p = malloc(size)) == NULL) + CallNewHandler(); + + return p; +} + +// Cast from FARPROC to funcptr with args, http://stackoverflow.com/q/4192058/608639 +#pragma warning(disable: 4191) + +static void SetNewAndDeleteFunctionPointers() +{ + void *p = NULL; + HMODULE hModule = NULL; + MEMORY_BASIC_INFORMATION mbi; + + while (true) + { + VirtualQuery(p, &mbi, sizeof(mbi)); + + if (p >= (char *)mbi.BaseAddress + mbi.RegionSize) + break; + + p = (char *)mbi.BaseAddress + mbi.RegionSize; + + if (!mbi.AllocationBase || mbi.AllocationBase == hModule) + continue; + + hModule = HMODULE(mbi.AllocationBase); + PGetNewAndDelete pGetNewAndDelete = (PGetNewAndDelete)GetProcAddress(hModule, "GetNewAndDeleteForCryptoPP"); + if (pGetNewAndDelete) + { + pGetNewAndDelete(s_pNew, s_pDelete); + return; + } + + PSetNewAndDelete pSetNewAndDelete = (PSetNewAndDelete)GetProcAddress(hModule, "SetNewAndDeleteFromCryptoPP"); + if (pSetNewAndDelete) + { + s_pNew = &New; + s_pDelete = &free; + pSetNewAndDelete(s_pNew, s_pDelete, &set_new_handler); + return; + } + } + + // try getting these directly using mangled names of new and delete operators + + hModule = GetModuleHandle("msvcrtd"); + if (!hModule) + hModule = GetModuleHandle("msvcrt"); + if (hModule) + { + // 32-bit versions + s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPAXI@Z"); + s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPAX@Z"); + if (s_pNew && s_pDelete) + return; + + // 64-bit versions + s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPEAX_K@Z"); + s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPEAX@Z"); + if (s_pNew && s_pDelete) + return; + } + + OutputDebugString("Crypto++ was not able to obtain new and delete function pointers.\n"); + throw 0; +} + +// Cast from FARPROC to funcptr with args +#pragma warning(default: 4191) + +void * operator new (size_t size) +{ + if (!s_pNew) + SetNewAndDeleteFunctionPointers(); + + return s_pNew(size); +} + +void operator delete (void * p) +{ + s_pDelete(p); +} + +void * operator new [] (size_t size) +{ + return operator new (size); +} + +void operator delete [] (void * p) +{ + operator delete (p); +} + +#endif // #ifdef CRYPTOPP_EXPORTS diff --git a/external/crypto++-5.6.3/dll.h b/external/crypto++-5.6.3/dll.h new file mode 100644 index 000000000..09aa48a8f --- /dev/null +++ b/external/crypto++-5.6.3/dll.h @@ -0,0 +1,77 @@ +// dll.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile dll.h +//! \brief Functions and definitions required for building the FIPS-140 DLL on Windows + +#ifndef CRYPTOPP_DLL_H +#define CRYPTOPP_DLL_H + +#if !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) && !defined(CRYPTOPP_DEFAULT_NO_DLL) +#ifdef CRYPTOPP_CONFIG_H +#error To use the DLL version of Crypto++, this file must be included before any other Crypto++ header files. +#endif +#define CRYPTOPP_IMPORTS +#endif + +#include "aes.h" +#include "cbcmac.h" +#include "ccm.h" +#include "cmac.h" +#include "channels.h" +#include "des.h" +#include "dh.h" +#include "dsa.h" +#include "ec2n.h" +#include "eccrypto.h" +#include "ecp.h" +#include "files.h" +#include "fips140.h" +#include "gcm.h" +#include "hex.h" +#include "hmac.h" +#include "modes.h" +#include "mqueue.h" +#include "nbtheory.h" +#include "osrng.h" +#include "pkcspad.h" +#include "pssr.h" +#include "randpool.h" +#include "rsa.h" +#include "rw.h" +#include "sha.h" +#include "skipjack.h" +#include "trdlocal.h" + +#ifdef CRYPTOPP_IMPORTS + +#ifdef _DLL +// cause CRT DLL to be initialized before Crypto++ so that we can use malloc and free during DllMain() +#ifdef NDEBUG +#pragma comment(lib, "msvcrt") +#else +#pragma comment(lib, "msvcrtd") +#endif +#endif + +#pragma comment(lib, "cryptopp") + +#endif // #ifdef CRYPTOPP_IMPORTS + +#include // for new_handler + +NAMESPACE_BEGIN(CryptoPP) + +#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) +using std::new_handler; +#endif + +typedef void * (CRYPTOPP_API * PNew)(size_t); +typedef void (CRYPTOPP_API * PDelete)(void *); +typedef void (CRYPTOPP_API * PGetNewAndDelete)(PNew &, PDelete &); +typedef new_handler (CRYPTOPP_API * PSetNewHandler)(new_handler); +typedef void (CRYPTOPP_API * PSetNewAndDelete)(PNew, PDelete, PSetNewHandler); + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dlltest.cpp b/external/crypto++-5.6.3/dlltest.cpp new file mode 100644 index 000000000..7469d2752 --- /dev/null +++ b/external/crypto++-5.6.3/dlltest.cpp @@ -0,0 +1,207 @@ +#ifndef CRYPTOPP_DLL_ONLY +# define CRYPTOPP_DEFAULT_NO_DLL +#endif + +#include "dll.h" +#include "cryptlib.h" +#include "filters.h" + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +void FIPS140_SampleApplication() +{ + if (!FIPS_140_2_ComplianceEnabled()) + { + cerr << "FIPS 140-2 compliance was turned off at compile time.\n"; + abort(); + } + + // check self test status + if (GetPowerUpSelfTestStatus() != POWER_UP_SELF_TEST_PASSED) + { + cerr << "Automatic power-up self test failed.\n"; + abort(); + } + cout << "0. Automatic power-up self test passed.\n"; + + // simulate a power-up self test error + SimulatePowerUpSelfTestFailure(); + try + { + // trying to use a crypto algorithm after power-up self test error will result in an exception + AES::Encryption aes; + + // should not be here + cerr << "Use of AES failed to cause an exception after power-up self test error.\n"; + abort(); + } + catch (SelfTestFailure &e) + { + cout << "1. Caught expected exception when simulating self test failure. Exception message follows: "; + cout << e.what() << endl; + } + + // clear the self test error state and redo power-up self test + DoDllPowerUpSelfTest(); + if (GetPowerUpSelfTestStatus() != POWER_UP_SELF_TEST_PASSED) + { + cerr << "Re-do power-up self test failed.\n"; + abort(); + } + cout << "2. Re-do power-up self test passed.\n"; + + // encrypt and decrypt + const byte key[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; + const byte iv[] = {0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}; + const byte plaintext[] = { // "Now is the time for all " without tailing 0 + 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, + 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, + 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20}; + byte ciphertext[24]; + byte decrypted[24]; + + CFB_FIPS_Mode::Encryption encryption_DES_EDE3_CFB; + encryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv); + encryption_DES_EDE3_CFB.ProcessString(ciphertext, plaintext, 24); + + CFB_FIPS_Mode::Decryption decryption_DES_EDE3_CFB; + decryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv); + decryption_DES_EDE3_CFB.ProcessString(decrypted, ciphertext, 24); + + if (memcmp(plaintext, decrypted, 24) != 0) + { + cerr << "DES-EDE3-CFB Encryption/decryption failed.\n"; + abort(); + } + cout << "3. DES-EDE3-CFB Encryption/decryption succeeded.\n"; + + // hash + const byte message[] = {'a', 'b', 'c'}; + const byte expectedDigest[] = {0xA9,0x99,0x3E,0x36,0x47,0x06,0x81,0x6A,0xBA,0x3E,0x25,0x71,0x78,0x50,0xC2,0x6C,0x9C,0xD0,0xD8,0x9D}; + byte digest[20]; + + SHA1 sha; + sha.Update(message, 3); + sha.Final(digest); + + if (memcmp(digest, expectedDigest, 20) != 0) + { + cerr << "SHA-1 hash failed.\n"; + abort(); + } + cout << "4. SHA-1 hash succeeded.\n"; + + // create auto-seeded X9.17 RNG object, if available +#ifdef OS_RNG_AVAILABLE + AutoSeededX917RNG rng; +#else + // this is used to allow this function to compile on platforms that don't have auto-seeded RNGs + RandomNumberGenerator &rng(NullRNG()); +#endif + + // generate DSA key + DSA::PrivateKey dsaPrivateKey; + dsaPrivateKey.GenerateRandomWithKeySize(rng, 1024); + DSA::PublicKey dsaPublicKey; + dsaPublicKey.AssignFrom(dsaPrivateKey); + if (!dsaPrivateKey.Validate(rng, 3) || !dsaPublicKey.Validate(rng, 3)) + { + cerr << "DSA key generation failed.\n"; + abort(); + } + cout << "5. DSA key generation succeeded.\n"; + + // encode DSA key + std::string encodedDsaPublicKey, encodedDsaPrivateKey; + dsaPublicKey.DEREncode(StringSink(encodedDsaPublicKey).Ref()); + dsaPrivateKey.DEREncode(StringSink(encodedDsaPrivateKey).Ref()); + + // decode DSA key + DSA::PrivateKey decodedDsaPrivateKey; + decodedDsaPrivateKey.BERDecode(StringStore(encodedDsaPrivateKey).Ref()); + DSA::PublicKey decodedDsaPublicKey; + decodedDsaPublicKey.BERDecode(StringStore(encodedDsaPublicKey).Ref()); + + if (!decodedDsaPrivateKey.Validate(rng, 3) || !decodedDsaPublicKey.Validate(rng, 3)) + { + cerr << "DSA key encode/decode failed.\n"; + abort(); + } + cout << "6. DSA key encode/decode succeeded.\n"; + + // sign and verify + byte signature[40]; + DSA::Signer signer(dsaPrivateKey); + assert(signer.SignatureLength() == 40); + signer.SignMessage(rng, message, 3, signature); + + DSA::Verifier verifier(dsaPublicKey); + if (!verifier.VerifyMessage(message, 3, signature, sizeof(signature))) + { + cerr << "DSA signature and verification failed.\n"; + abort(); + } + cout << "7. DSA signature and verification succeeded.\n"; + + + // try to verify an invalid signature + signature[0] ^= 1; + if (verifier.VerifyMessage(message, 3, signature, sizeof(signature))) + { + cerr << "DSA signature verification failed to detect bad signature.\n"; + abort(); + } + cout << "8. DSA signature verification successfully detected bad signature.\n"; + + // try to use an invalid key length + try + { + ECB_Mode::Encryption encryption_DES_EDE3_ECB; + encryption_DES_EDE3_ECB.SetKey(key, 5); + + // should not be here + cerr << "DES-EDE3 implementation did not detect use of invalid key length.\n"; + abort(); + } + catch (InvalidArgument &e) + { + cout << "9. Caught expected exception when using invalid key length. Exception message follows: "; + cout << e.what() << endl; + } + + cout << "\nFIPS 140-2 Sample Application completed normally.\n"; +} + +#ifdef CRYPTOPP_IMPORTS + +static PNew s_pNew = NULL; +static PDelete s_pDelete = NULL; + +extern "C" __declspec(dllexport) void __cdecl SetNewAndDeleteFromCryptoPP(PNew pNew, PDelete pDelete, PSetNewHandler pSetNewHandler) +{ + s_pNew = pNew; + s_pDelete = pDelete; +} + +void * __cdecl operator new (size_t size) +{ + return s_pNew(size); +} + +void __cdecl operator delete (void * p) +{ + s_pDelete(p); +} + +#endif + +#ifdef CRYPTOPP_DLL_ONLY + +int __cdecl main() +{ + FIPS140_SampleApplication(); + return 0; +} + +#endif diff --git a/external/crypto++-5.6.3/dlltest.dsp b/external/crypto++-5.6.3/dlltest.dsp new file mode 100644 index 000000000..b8d08ea6b --- /dev/null +++ b/external/crypto++-5.6.3/dlltest.dsp @@ -0,0 +1,90 @@ +# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=dlltest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "dlltest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "dlltest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "dlltest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "dlltest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "dlltest___Win32_Release" +# PROP BASE Intermediate_Dir "dlltest___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "dlltest___Win32_Release" +# PROP Intermediate_Dir "dlltest___Win32_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /Gz /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "CRYPTOPP_DLL_ONLY" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 /nologo /subsystem:console /map /debug /machine:I386 /out:"DLL_Release/dlltest.exe" /libpath:"DLL_Release" + +!ELSEIF "$(CFG)" == "dlltest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "dlltest___Win32_Debug" +# PROP BASE Intermediate_Dir "dlltest___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "dlltest___Win32_Debug" +# PROP Intermediate_Dir "dlltest___Win32_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /Gz /MTd /W3 /Gm /GR /GX /Zi /Oi /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "CRYPTOPP_DLL_ONLY" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"DLL_Debug/dlltest.exe" /pdbtype:sept /libpath:"DLL_Debug" + +!ENDIF + +# Begin Target + +# Name "dlltest - Win32 Release" +# Name "dlltest - Win32 Debug" +# Begin Source File + +SOURCE=.\dlltest.cpp +# End Source File +# End Target +# End Project diff --git a/external/crypto++-5.6.3/dlltest.vcproj b/external/crypto++-5.6.3/dlltest.vcproj new file mode 100644 index 000000000..353aa1519 --- /dev/null +++ b/external/crypto++-5.6.3/dlltest.vcproj @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/crypto++-5.6.3/dmac.h b/external/crypto++-5.6.3/dmac.h new file mode 100644 index 000000000..f0d88023c --- /dev/null +++ b/external/crypto++-5.6.3/dmac.h @@ -0,0 +1,99 @@ +// dmac.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile dmac.h +//! \brief Classes for DMAC message authentication code + +#ifndef CRYPTOPP_DMAC_H +#define CRYPTOPP_DMAC_H + +#include "cbcmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +template +class CRYPTOPP_NO_VTABLE DMAC_Base : public SameKeyLengthAs, public MessageAuthenticationCode +{ +public: + static std::string StaticAlgorithmName() {return std::string("DMAC(") + T::StaticAlgorithmName() + ")";} + + CRYPTOPP_CONSTANT(DIGESTSIZE=T::BLOCKSIZE) + + DMAC_Base() : m_subkeylength(0), m_counter(0) {} + + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *mac, size_t size); + unsigned int DigestSize() const {return DIGESTSIZE;} + +private: + byte *GenerateSubKeys(const byte *key, size_t keylength); + + size_t m_subkeylength; + SecByteBlock m_subkeys; + CBC_MAC m_mac1; + typename T::Encryption m_f2; + unsigned int m_counter; +}; + +//! DMAC +/*! Based on "CBC MAC for Real-Time Data Sources" by Erez Petrank + and Charles Rackoff. T should be a class derived from BlockCipherDocumentation. +*/ +template +class DMAC : public MessageAuthenticationCodeFinal > +{ +public: + DMAC() {} + DMAC(const byte *key, size_t length=DMAC_Base::DEFAULT_KEYLENGTH) + {this->SetKey(key, length);} +}; + +template +void DMAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + m_subkeylength = T::StaticGetValidKeyLength(T::BLOCKSIZE); + m_subkeys.resize(2*UnsignedMin((unsigned int)T::BLOCKSIZE, m_subkeylength)); + m_mac1.SetKey(GenerateSubKeys(key, length), m_subkeylength, params); + m_f2.SetKey(m_subkeys+m_subkeys.size()/2, m_subkeylength, params); + m_counter = 0; + m_subkeys.resize(0); +} + +template +void DMAC_Base::Update(const byte *input, size_t length) +{ + m_mac1.Update(input, length); + m_counter = (unsigned int)((m_counter + length) % T::BLOCKSIZE); +} + +template +void DMAC_Base::TruncatedFinal(byte *mac, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + byte pad[T::BLOCKSIZE]; + byte padByte = byte(T::BLOCKSIZE-m_counter); + memset(pad, padByte, padByte); + m_mac1.Update(pad, padByte); + m_mac1.TruncatedFinal(mac, size); + m_f2.ProcessBlock(mac); + + m_counter = 0; // reset for next message +} + +template +byte *DMAC_Base::GenerateSubKeys(const byte *key, size_t keylength) +{ + typename T::Encryption cipher(key, keylength); + memset(m_subkeys, 0, m_subkeys.size()); + cipher.ProcessBlock(m_subkeys); + m_subkeys[m_subkeys.size()/2 + T::BLOCKSIZE - 1] = 1; + cipher.ProcessBlock(m_subkeys+m_subkeys.size()/2); + return m_subkeys; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dsa.cpp b/external/crypto++-5.6.3/dsa.cpp new file mode 100644 index 000000000..87cc7da2b --- /dev/null +++ b/external/crypto++-5.6.3/dsa.cpp @@ -0,0 +1,66 @@ +// dsa.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "dsa.h" +#include "asn.h" +#include "integer.h" +#include "filters.h" +#include "nbtheory.h" + +NAMESPACE_BEGIN(CryptoPP) + +size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat) +{ + Integer r, s; + StringStore store(signature, signatureLen); + ArraySink sink(buffer, bufferSize); + + switch (fromFormat) + { + case DSA_P1363: + r.Decode(store, signatureLen/2); + s.Decode(store, signatureLen/2); + break; + case DSA_DER: + { + BERSequenceDecoder seq(store); + r.BERDecode(seq); + s.BERDecode(seq); + seq.MessageEnd(); + break; + } + case DSA_OPENPGP: + r.OpenPGPDecode(store); + s.OpenPGPDecode(store); + break; + } + + switch (toFormat) + { + case DSA_P1363: + r.Encode(sink, bufferSize/2); + s.Encode(sink, bufferSize/2); + break; + case DSA_DER: + { + DERSequenceEncoder seq(sink); + r.DEREncode(seq); + s.DEREncode(seq); + seq.MessageEnd(); + break; + } + case DSA_OPENPGP: + r.OpenPGPEncode(sink); + s.OpenPGPEncode(sink); + break; + } + + return (size_t)sink.TotalPutLength(); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/dsa.h b/external/crypto++-5.6.3/dsa.h new file mode 100644 index 000000000..5e6ef305c --- /dev/null +++ b/external/crypto++-5.6.3/dsa.h @@ -0,0 +1,41 @@ +// dsa.h - written and placed in the public domain by Wei Dai + +//! \file dsa.h +//! \brief Classes for the DSA signature algorithm + +#ifndef CRYPTOPP_DSA_H +#define CRYPTOPP_DSA_H + +#include "cryptlib.h" +#include "gfpcrypt.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \brief DSA Signature Format +//! \details The DSA signature format used by Crypto++ is as defined by IEEE P1363. +//! Java nad .Net use the DER format, and OpenPGP uses the OpenPGP format. +enum DSASignatureFormat { + //! \brief Crypto++ native signature encoding format + DSA_P1363, + //! \brief signature encoding format used by Java and .Net + DSA_DER, + //! \brief OpenPGP signature encoding format + DSA_OPENPGP +}; + +//! \brief Converts between signature encoding formats +//! \param buffer byte buffer for the converted signature encoding +//! \param bufferSize the length of the converted signature encoding buffer +//! \param toFormat the source signature format +//! \param signature byte buffer for the existing signature encoding +//! \param signatureLen the length of the existing signature encoding buffer +//! \param fromFormat the source signature format +//! \details This function converts between these formats, and returns length +//! of signature in the target format. If toFormat == DSA_P1363, then +//! bufferSize must equal publicKey.SignatureLength() +size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, + const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat); + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/eax.cpp b/external/crypto++-5.6.3/eax.cpp new file mode 100644 index 000000000..2728c9bcd --- /dev/null +++ b/external/crypto++-5.6.3/eax.cpp @@ -0,0 +1,59 @@ +// eax.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "eax.h" + +NAMESPACE_BEGIN(CryptoPP) + +void EAX_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) +{ + AccessMAC().SetKey(userKey, keylength, params); + m_buffer.New(2*AccessMAC().TagSize()); +} + +void EAX_Base::Resync(const byte *iv, size_t len) +{ + MessageAuthenticationCode &mac = AccessMAC(); + unsigned int blockSize = mac.TagSize(); + + memset(m_buffer, 0, blockSize); + mac.Update(m_buffer, blockSize); + mac.CalculateDigest(m_buffer+blockSize, iv, len); + + m_buffer[blockSize-1] = 1; + mac.Update(m_buffer, blockSize); + + m_ctr.SetCipherWithIV(AccessMAC().AccessCipher(), m_buffer+blockSize, blockSize); +} + +size_t EAX_Base::AuthenticateBlocks(const byte *data, size_t len) +{ + AccessMAC().Update(data, len); + return 0; +} + +void EAX_Base::AuthenticateLastHeaderBlock() +{ + assert(m_bufferedDataLength == 0); + MessageAuthenticationCode &mac = AccessMAC(); + unsigned int blockSize = mac.TagSize(); + + mac.Final(m_buffer); + xorbuf(m_buffer+blockSize, m_buffer, blockSize); + + memset(m_buffer, 0, blockSize); + m_buffer[blockSize-1] = 2; + mac.Update(m_buffer, blockSize); +} + +void EAX_Base::AuthenticateLastFooterBlock(byte *tag, size_t macSize) +{ + assert(m_bufferedDataLength == 0); + MessageAuthenticationCode &mac = AccessMAC(); + unsigned int blockSize = mac.TagSize(); + + mac.TruncatedFinal(m_buffer, macSize); + xorbuf(tag, m_buffer, m_buffer+blockSize, macSize); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/eax.h b/external/crypto++-5.6.3/eax.h new file mode 100644 index 000000000..a5d707a1a --- /dev/null +++ b/external/crypto++-5.6.3/eax.h @@ -0,0 +1,112 @@ +// eax.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile eax.h +//! \brief EAX block cipher mode of operation + +#ifndef CRYPTOPP_EAX_H +#define CRYPTOPP_EAX_H + +#include "authenc.h" +#include "modes.h" +#include "cmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class EAX_Base +//! \brief EAX block cipher mode of operation +//! \details Implementations and overrides in \p EAX_Base apply to both \p ENCRYPTION and \p DECRYPTION directions +class CRYPTOPP_NO_VTABLE EAX_Base : public AuthenticatedSymmetricCipherBase +{ +public: + // AuthenticatedSymmetricCipher + std::string AlgorithmName() const + {return GetMAC().GetCipher().AlgorithmName() + std::string("/EAX");} + size_t MinKeyLength() const + {return GetMAC().MinKeyLength();} + size_t MaxKeyLength() const + {return GetMAC().MaxKeyLength();} + size_t DefaultKeyLength() const + {return GetMAC().DefaultKeyLength();} + size_t GetValidKeyLength(size_t n) const + {return GetMAC().GetValidKeyLength(n);} + bool IsValidKeyLength(size_t n) const + {return GetMAC().IsValidKeyLength(n);} + unsigned int OptimalDataAlignment() const + {return GetMAC().OptimalDataAlignment();} + IV_Requirement IVRequirement() const + {return UNIQUE_IV;} + unsigned int IVSize() const + {return GetMAC().TagSize();} + unsigned int MinIVLength() const + {return 0;} + unsigned int MaxIVLength() const + {return UINT_MAX;} + unsigned int DigestSize() const + {return GetMAC().TagSize();} + lword MaxHeaderLength() const + {return LWORD_MAX;} + lword MaxMessageLength() const + {return LWORD_MAX;} + +protected: + // AuthenticatedSymmetricCipherBase + bool AuthenticationIsOnPlaintext() const + {return false;} + unsigned int AuthenticationBlockSize() const + {return 1;} + void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); + void Resync(const byte *iv, size_t len); + size_t AuthenticateBlocks(const byte *data, size_t len); + void AuthenticateLastHeaderBlock(); + void AuthenticateLastFooterBlock(byte *mac, size_t macSize); + SymmetricCipher & AccessSymmetricCipher() {return m_ctr;} + const CMAC_Base & GetMAC() const {return const_cast(this)->AccessMAC();} + virtual CMAC_Base & AccessMAC() =0; + + CTR_Mode_ExternalCipher::Encryption m_ctr; +}; + +//! \class EAX_Final +//! \brief Class specific methods used to operate the cipher. +//! \tparam T_BlockCipher block cipher +//! \tparam T_IsEncryption direction in which to operate the cipher +//! \details Implementations and overrides in \p GCM_Final apply to either +//! \p ENCRYPTION or \p DECRYPTION, depending on the template parameter \p T_IsEncryption. +//! \details \p EAX_Final does not use inner classes \p Enc and \p Dec. +template +class EAX_Final : public EAX_Base +{ +public: + static std::string StaticAlgorithmName() + {return T_BlockCipher::StaticAlgorithmName() + std::string("/EAX");} + bool IsForwardTransformation() const + {return T_IsEncryption;} + +private: + CMAC_Base & AccessMAC() {return m_cmac;} + CMAC m_cmac; +}; + +#ifdef EAX // EAX is defined to 11 on GCC 3.4.3, OpenSolaris 8.11 +#undef EAX +#endif + +//! \class EAX +//! \brief The EAX block cipher mode of operation +//! \details EAX is an Authenticated Encryption with Associated Data (AEAD) block +//! cipher mode of operation designed to simultaneously provide both authentication +//! and privacy of the message. +//! \tparam T_BlockCipher block cipher +//! \details \p EAX provides the \p Encryption and \p Decryption typedef. +//! \sa EAX at the Crypto Lounge +template +struct EAX : public AuthenticatedSymmetricCipherDocumentation +{ + typedef EAX_Final Encryption; + typedef EAX_Final Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ec2n.cpp b/external/crypto++-5.6.3/ec2n.cpp new file mode 100644 index 000000000..a0096d722 --- /dev/null +++ b/external/crypto++-5.6.3/ec2n.cpp @@ -0,0 +1,294 @@ +// ec2n.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "ec2n.h" +#include "asn.h" +#include "integer.h" +#include "filters.h" +#include "algebra.cpp" +#include "eprecomp.cpp" + +NAMESPACE_BEGIN(CryptoPP) + +EC2N::EC2N(BufferedTransformation &bt) + : m_field(BERDecodeGF2NP(bt)) +{ + BERSequenceDecoder seq(bt); + m_field->BERDecodeElement(seq, m_a); + m_field->BERDecodeElement(seq, m_b); + // skip optional seed + if (!seq.EndReached()) + { + SecByteBlock seed; + unsigned int unused; + BERDecodeBitString(seq, seed, unused); + } + seq.MessageEnd(); +} + +void EC2N::DEREncode(BufferedTransformation &bt) const +{ + m_field->DEREncode(bt); + DERSequenceEncoder seq(bt); + m_field->DEREncodeElement(seq, m_a); + m_field->DEREncodeElement(seq, m_b); + seq.MessageEnd(); +} + +bool EC2N::DecodePoint(EC2N::Point &P, const byte *encodedPoint, size_t encodedPointLen) const +{ + StringStore store(encodedPoint, encodedPointLen); + return DecodePoint(P, store, encodedPointLen); +} + +bool EC2N::DecodePoint(EC2N::Point &P, BufferedTransformation &bt, size_t encodedPointLen) const +{ + byte type; + if (encodedPointLen < 1 || !bt.Get(type)) + return false; + + switch (type) + { + case 0: + P.identity = true; + return true; + case 2: + case 3: + { + if (encodedPointLen != EncodedPointSize(true)) + return false; + + P.identity = false; + P.x.Decode(bt, m_field->MaxElementByteLength()); + + if (P.x.IsZero()) + { + P.y = m_field->SquareRoot(m_b); + return true; + } + + FieldElement z = m_field->Square(P.x); + assert(P.x == m_field->SquareRoot(z)); + P.y = m_field->Divide(m_field->Add(m_field->Multiply(z, m_field->Add(P.x, m_a)), m_b), z); + assert(P.x == m_field->Subtract(m_field->Divide(m_field->Subtract(m_field->Multiply(P.y, z), m_b), z), m_a)); + z = m_field->SolveQuadraticEquation(P.y); + assert(m_field->Add(m_field->Square(z), z) == P.y); + z.SetCoefficient(0, type & 1); + + P.y = m_field->Multiply(z, P.x); + return true; + } + case 4: + { + if (encodedPointLen != EncodedPointSize(false)) + return false; + + unsigned int len = m_field->MaxElementByteLength(); + P.identity = false; + P.x.Decode(bt, len); + P.y.Decode(bt, len); + return true; + } + default: + return false; + } +} + +void EC2N::EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const +{ + if (P.identity) + NullStore().TransferTo(bt, EncodedPointSize(compressed)); + else if (compressed) + { + bt.Put(2 + (!P.x ? 0 : m_field->Divide(P.y, P.x).GetBit(0))); + P.x.Encode(bt, m_field->MaxElementByteLength()); + } + else + { + unsigned int len = m_field->MaxElementByteLength(); + bt.Put(4); // uncompressed + P.x.Encode(bt, len); + P.y.Encode(bt, len); + } +} + +void EC2N::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const +{ + ArraySink sink(encodedPoint, EncodedPointSize(compressed)); + EncodePoint(sink, P, compressed); + assert(sink.TotalPutLength() == EncodedPointSize(compressed)); +} + +EC2N::Point EC2N::BERDecodePoint(BufferedTransformation &bt) const +{ + SecByteBlock str; + BERDecodeOctetString(bt, str); + Point P; + if (!DecodePoint(P, str, str.size())) + BERDecodeError(); + return P; +} + +void EC2N::DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const +{ + SecByteBlock str(EncodedPointSize(compressed)); + EncodePoint(str, P, compressed); + DEREncodeOctetString(bt, str); +} + +bool EC2N::ValidateParameters(RandomNumberGenerator &rng, unsigned int level) const +{ + CRYPTOPP_UNUSED(rng); + bool pass = !!m_b; + pass = pass && m_a.CoefficientCount() <= m_field->MaxElementBitLength(); + pass = pass && m_b.CoefficientCount() <= m_field->MaxElementBitLength(); + + if (level >= 1) + pass = pass && m_field->GetModulus().IsIrreducible(); + + return pass; +} + +bool EC2N::VerifyPoint(const Point &P) const +{ + const FieldElement &x = P.x, &y = P.y; + return P.identity || + (x.CoefficientCount() <= m_field->MaxElementBitLength() + && y.CoefficientCount() <= m_field->MaxElementBitLength() + && !(((x+m_a)*x*x+m_b-(x+y)*y)%m_field->GetModulus())); +} + +bool EC2N::Equal(const Point &P, const Point &Q) const +{ + if (P.identity && Q.identity) + return true; + + if (P.identity && !Q.identity) + return false; + + if (!P.identity && Q.identity) + return false; + + return (m_field->Equal(P.x,Q.x) && m_field->Equal(P.y,Q.y)); +} + +const EC2N::Point& EC2N::Identity() const +{ + return Singleton().Ref(); +} + +const EC2N::Point& EC2N::Inverse(const Point &P) const +{ + if (P.identity) + return P; + else + { + m_R.identity = false; + m_R.y = m_field->Add(P.x, P.y); + m_R.x = P.x; + return m_R; + } +} + +const EC2N::Point& EC2N::Add(const Point &P, const Point &Q) const +{ + if (P.identity) return Q; + if (Q.identity) return P; + if (Equal(P, Q)) return Double(P); + if (m_field->Equal(P.x, Q.x) && m_field->Equal(P.y, m_field->Add(Q.x, Q.y))) return Identity(); + + FieldElement t = m_field->Add(P.y, Q.y); + t = m_field->Divide(t, m_field->Add(P.x, Q.x)); + FieldElement x = m_field->Square(t); + m_field->Accumulate(x, t); + m_field->Accumulate(x, Q.x); + m_field->Accumulate(x, m_a); + m_R.y = m_field->Add(P.y, m_field->Multiply(t, x)); + m_field->Accumulate(x, P.x); + m_field->Accumulate(m_R.y, x); + + m_R.x.swap(x); + m_R.identity = false; + return m_R; +} + +const EC2N::Point& EC2N::Double(const Point &P) const +{ + if (P.identity) return P; + if (!m_field->IsUnit(P.x)) return Identity(); + + FieldElement t = m_field->Divide(P.y, P.x); + m_field->Accumulate(t, P.x); + m_R.y = m_field->Square(P.x); + m_R.x = m_field->Square(t); + m_field->Accumulate(m_R.x, t); + m_field->Accumulate(m_R.x, m_a); + m_field->Accumulate(m_R.y, m_field->Multiply(t, m_R.x)); + m_field->Accumulate(m_R.y, m_R.x); + + m_R.identity = false; + return m_R; +} + +// ******************************************************** + +/* +EcPrecomputation& EcPrecomputation::operator=(const EcPrecomputation &rhs) +{ + m_ec = rhs.m_ec; + m_ep = rhs.m_ep; + m_ep.m_group = m_ec.get(); + return *this; +} + +void EcPrecomputation::SetCurveAndBase(const EC2N &ec, const EC2N::Point &base) +{ + m_ec.reset(new EC2N(ec)); + m_ep.SetGroupAndBase(*m_ec, base); +} + +void EcPrecomputation::Precompute(unsigned int maxExpBits, unsigned int storage) +{ + m_ep.Precompute(maxExpBits, storage); +} + +void EcPrecomputation::Load(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + word32 version; + BERDecodeUnsigned(seq, version, INTEGER, 1, 1); + m_ep.m_exponentBase.BERDecode(seq); + m_ep.m_windowSize = m_ep.m_exponentBase.BitCount() - 1; + m_ep.m_bases.clear(); + while (!seq.EndReached()) + m_ep.m_bases.push_back(m_ec->BERDecodePoint(seq)); + seq.MessageEnd(); +} + +void EcPrecomputation::Save(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + DEREncodeUnsigned(seq, 1); // version + m_ep.m_exponentBase.DEREncode(seq); + for (unsigned i=0; iDEREncodePoint(seq, m_ep.m_bases[i]); + seq.MessageEnd(); +} + +EC2N::Point EcPrecomputation::Exponentiate(const Integer &exponent) const +{ + return m_ep.Exponentiate(exponent); +} + +EC2N::Point EcPrecomputation::CascadeExponentiate(const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const +{ + return m_ep.CascadeExponentiate(exponent, static_cast &>(pc2).m_ep, exponent2); +} +*/ + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ec2n.h b/external/crypto++-5.6.3/ec2n.h new file mode 100644 index 000000000..a49f4dbb3 --- /dev/null +++ b/external/crypto++-5.6.3/ec2n.h @@ -0,0 +1,134 @@ +// ec2n.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile ec2n.h +//! \brief Classes for Elliptic Curves over binary fields + + +#ifndef CRYPTOPP_EC2N_H +#define CRYPTOPP_EC2N_H + +#include "cryptlib.h" +#include "gf2n.h" +#include "integer.h" +#include "eprecomp.h" +#include "smartptr.h" +#include "pubkey.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Elliptic Curve Point +struct CRYPTOPP_DLL EC2NPoint +{ + EC2NPoint() : identity(true) {} + EC2NPoint(const PolynomialMod2 &x, const PolynomialMod2 &y) + : identity(false), x(x), y(y) {} + + bool operator==(const EC2NPoint &t) const + {return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);} + bool operator< (const EC2NPoint &t) const + {return identity ? !t.identity : (!t.identity && (x; + +//! Elliptic Curve over GF(2^n) +class CRYPTOPP_DLL EC2N : public AbstractGroup +{ +public: + typedef GF2NP Field; + typedef Field::Element FieldElement; + typedef EC2NPoint Point; + + EC2N() {} + EC2N(const Field &field, const Field::Element &a, const Field::Element &b) + : m_field(field), m_a(a), m_b(b) {} + // construct from BER encoded parameters + // this constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters + EC2N(BufferedTransformation &bt); + + // encode the fields fieldID and curve of the sequence ECParameters + void DEREncode(BufferedTransformation &bt) const; + + bool Equal(const Point &P, const Point &Q) const; + const Point& Identity() const; + const Point& Inverse(const Point &P) const; + bool InversionIsFast() const {return true;} + const Point& Add(const Point &P, const Point &Q) const; + const Point& Double(const Point &P) const; + + Point Multiply(const Integer &k, const Point &P) const + {return ScalarMultiply(P, k);} + Point CascadeMultiply(const Integer &k1, const Point &P, const Integer &k2, const Point &Q) const + {return CascadeScalarMultiply(P, k1, Q, k2);} + + bool ValidateParameters(RandomNumberGenerator &rng, unsigned int level=3) const; + bool VerifyPoint(const Point &P) const; + + unsigned int EncodedPointSize(bool compressed = false) const + {return 1 + (compressed?1:2)*m_field->MaxElementByteLength();} + // returns false if point is compressed and not valid (doesn't check if uncompressed) + bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const; + bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const; + void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const; + void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; + + Point BERDecodePoint(BufferedTransformation &bt) const; + void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; + + Integer FieldSize() const {return Integer::Power2(m_field->MaxElementBitLength());} + const Field & GetField() const {return *m_field;} + const FieldElement & GetA() const {return m_a;} + const FieldElement & GetB() const {return m_b;} + + bool operator==(const EC2N &rhs) const + {return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~EC2N() {} +#endif + +private: + clonable_ptr m_field; + FieldElement m_a, m_b; + mutable Point m_R; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation; + +template class EcPrecomputation; + +//! EC2N precomputation +template<> class EcPrecomputation : public DL_GroupPrecomputation +{ +public: + typedef EC2N EllipticCurve; + + // DL_GroupPrecomputation + const AbstractGroup & GetGroup() const {return m_ec;} + Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec.BERDecodePoint(bt);} + void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {m_ec.DEREncodePoint(bt, v, false);} + + // non-inherited + void SetCurve(const EC2N &ec) {m_ec = ec;} + const EC2N & GetCurve() const {return m_ec;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~EcPrecomputation() {} +#endif + +private: + EC2N m_ec; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/eccrypto.cpp b/external/crypto++-5.6.3/eccrypto.cpp new file mode 100644 index 000000000..eab711d27 --- /dev/null +++ b/external/crypto++-5.6.3/eccrypto.cpp @@ -0,0 +1,719 @@ +// eccrypto.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4127 4189) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-function" +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "eccrypto.h" +#include "integer.h" +#include "nbtheory.h" +#include "filters.h" +#include "argnames.h" +#include "smartptr.h" +#include "oids.h" +#include "asn.h" +#include "hex.h" +#include "ec2n.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if 0 +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +static void ECDSA_TestInstantiations() +{ + ECDSA::Signer t1; + ECDSA::Verifier t2(t1); + ECNR::Signer t3; + ECNR::Verifier t4(t3); + ECIES::Encryptor t5; + ECIES::Decryptor t6; + ECDH::Domain t7; + ECMQV::Domain t8; +} +#endif +#endif + +// VC60 workaround: complains when these functions are put into an anonymous namespace +static Integer ConvertToInteger(const PolynomialMod2 &x) +{ + unsigned int l = x.ByteCount(); + SecByteBlock temp(l); + x.Encode(temp, l); + return Integer(temp, l); +} + +static inline Integer ConvertToInteger(const Integer &x) +{ + return x; +} + +static bool CheckMOVCondition(const Integer &q, const Integer &r) +{ + // see "Updated standards for validating elliptic curves", http://eprint.iacr.org/2007/343 + Integer t = 1; + unsigned int n = q.IsEven() ? 1 : q.BitCount(), m = r.BitCount(); + + for (unsigned int i=n; DiscreteLogWorkFactor(i) struct EcRecommendedParameters; + +template<> struct EcRecommendedParameters +{ + EcRecommendedParameters(const OID &oid, unsigned int t2, unsigned int t3, unsigned int t4, const char *a, const char *b, const char *g, const char *n, unsigned int h) + : oid(oid), t0(0), t1(0), t2(t2), t3(t3), t4(t4), a(a), b(b), g(g), n(n), h(h) {} + EcRecommendedParameters(const OID &oid, unsigned int t0, unsigned int t1, unsigned int t2, unsigned int t3, unsigned int t4, const char *a, const char *b, const char *g, const char *n, unsigned int h) + : oid(oid), t0(t0), t1(t1), t2(t2), t3(t3), t4(t4), a(a), b(b), g(g), n(n), h(h) {} + EC2N *NewEC() const + { + StringSource ssA(a, true, new HexDecoder); + StringSource ssB(b, true, new HexDecoder); + if (t0 == 0) + return new EC2N(GF2NT(t2, t3, t4), EC2N::FieldElement(ssA, (size_t)ssA.MaxRetrievable()), EC2N::FieldElement(ssB, (size_t)ssB.MaxRetrievable())); + else + return new EC2N(GF2NPP(t0, t1, t2, t3, t4), EC2N::FieldElement(ssA, (size_t)ssA.MaxRetrievable()), EC2N::FieldElement(ssB, (size_t)ssB.MaxRetrievable())); + }; + + OID oid; + unsigned int t0, t1, t2, t3, t4; + const char *a, *b, *g, *n; + unsigned int h; +}; + +template<> struct EcRecommendedParameters +{ + EcRecommendedParameters(const OID &oid, const char *p, const char *a, const char *b, const char *g, const char *n, unsigned int h) + : oid(oid), p(p), a(a), b(b), g(g), n(n), h(h) {} + ECP *NewEC() const + { + StringSource ssP(p, true, new HexDecoder); + StringSource ssA(a, true, new HexDecoder); + StringSource ssB(b, true, new HexDecoder); + return new ECP(Integer(ssP, (size_t)ssP.MaxRetrievable()), ECP::FieldElement(ssA, (size_t)ssA.MaxRetrievable()), ECP::FieldElement(ssB, (size_t)ssB.MaxRetrievable())); + }; + + OID oid; + const char *p; + const char *a, *b, *g, *n; + unsigned int h; +}; + +struct OIDLessThan +{ + template + inline bool operator()(const EcRecommendedParameters& a, const OID& b) {return a.oid < b;} + template + inline bool operator()(const OID& a, const EcRecommendedParameters& b) {return a < b.oid;} + template + inline bool operator()(const EcRecommendedParameters& a, const EcRecommendedParameters& b) {return a.oid < b.oid;} +}; + +static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) +{ + // this array must be sorted by OID + static const EcRecommendedParameters rec[] = { + EcRecommendedParameters(ASN1::sect163k1(), + 163, 7, 6, 3, 0, + "000000000000000000000000000000000000000001", + "000000000000000000000000000000000000000001", + "0402FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE80289070FB05D38FF58321F2E800536D538CCDAA3D9", + "04000000000000000000020108A2E0CC0D99F8A5EF", + 2), + EcRecommendedParameters(ASN1::sect163r1(), + 163, 7, 6, 3, 0, + "07B6882CAAEFA84F9554FF8428BD88E246D2782AE2", + "0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9", + "040369979697AB43897789566789567F787A7876A65400435EDB42EFAFB2989D51FEFCE3C80988F41FF883", + "03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B", + 2), + EcRecommendedParameters(ASN1::sect239k1(), + 239, 158, 0, + "000000000000000000000000000000000000000000000000000000000000", + "000000000000000000000000000000000000000000000000000000000001", + "0429A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA", + "2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5", + 4), + EcRecommendedParameters(ASN1::sect113r1(), + 113, 9, 0, + "003088250CA6E7C7FE649CE85820F7", + "00E8BEE4D3E2260744188BE0E9C723", + "04009D73616F35F4AB1407D73562C10F00A52830277958EE84D1315ED31886", + "0100000000000000D9CCEC8A39E56F", + 2), + EcRecommendedParameters(ASN1::sect113r2(), + 113, 9, 0, + "00689918DBEC7E5A0DD6DFC0AA55C7", + "0095E9A9EC9B297BD4BF36E059184F", + "0401A57A6A7B26CA5EF52FCDB816479700B3ADC94ED1FE674C06E695BABA1D", + "010000000000000108789B2496AF93", + 2), + EcRecommendedParameters(ASN1::sect163r2(), + 163, 7, 6, 3, 0, + "000000000000000000000000000000000000000001", + "020A601907B8C953CA1481EB10512F78744A3205FD", + "0403F0EBA16286A2D57EA0991168D4994637E8343E3600D51FBC6C71A0094FA2CDD545B11C5C0C797324F1", + "040000000000000000000292FE77E70C12A4234C33", + 2), + EcRecommendedParameters(ASN1::sect283k1(), + 283, 12, 7, 5, 0, + "000000000000000000000000000000000000000000000000000000000000000000000000", + "000000000000000000000000000000000000000000000000000000000000000000000001", + "040503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC245849283601CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259", + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", + 4), + EcRecommendedParameters(ASN1::sect283r1(), + 283, 12, 7, 5, 0, + "000000000000000000000000000000000000000000000000000000000000000000000001", + "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5", + "0405F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B1205303676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4", + "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", + 2), + EcRecommendedParameters(ASN1::sect131r1(), + 131, 8, 3, 2, 0, + "07A11B09A76B562144418FF3FF8C2570B8", + "0217C05610884B63B9C6C7291678F9D341", + "040081BAF91FDF9833C40F9C181343638399078C6E7EA38C001F73C8134B1B4EF9E150", + "0400000000000000023123953A9464B54D", + 2), + EcRecommendedParameters(ASN1::sect131r2(), + 131, 8, 3, 2, 0, + "03E5A88919D7CAFCBF415F07C2176573B2", + "04B8266A46C55657AC734CE38F018F2192", + "040356DCD8F2F95031AD652D23951BB366A80648F06D867940A5366D9E265DE9EB240F", + "0400000000000000016954A233049BA98F", + 2), + EcRecommendedParameters(ASN1::sect193r1(), + 193, 15, 0, + "0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01", + "00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814", + "0401F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E10025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05", + "01000000000000000000000000C7F34A778F443ACC920EBA49", + 2), + EcRecommendedParameters(ASN1::sect193r2(), + 193, 15, 0, + "0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B", + "00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE", + "0400D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C", + "010000000000000000000000015AAB561B005413CCD4EE99D5", + 2), + EcRecommendedParameters(ASN1::sect233k1(), + 233, 74, 0, + "000000000000000000000000000000000000000000000000000000000000", + "000000000000000000000000000000000000000000000000000000000001", + "04017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD612601DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3", + "8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", + 4), + EcRecommendedParameters(ASN1::sect233r1(), + 233, 74, 0, + "000000000000000000000000000000000000000000000000000000000001", + "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD", + "0400FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052", + "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", + 2), + EcRecommendedParameters(ASN1::sect409k1(), + 409, 87, 0, + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "040060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE902374601E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B", + "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", + 4), + EcRecommendedParameters(ASN1::sect409r1(), + 409, 87, 0, + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F", + "04015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A70061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706", + "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", + 2), + EcRecommendedParameters(ASN1::sect571k1(), + 571, 10, 5, 2, 0, + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "04026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C89720349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3", + "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", + 4), + EcRecommendedParameters(ASN1::sect571r1(), + 571, 10, 5, 2, 0, + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A", + "040303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B", + "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", + 2), + }; + begin = rec; + end = rec + sizeof(rec)/sizeof(rec[0]); +} + +static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) +{ + // this array must be sorted by OID + static const EcRecommendedParameters rec[] = { + EcRecommendedParameters(ASN1::secp192r1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", + "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1", + "04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811", + "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", + 1), + EcRecommendedParameters(ASN1::secp256r1(), + "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", + "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", + "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B", + "046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", + "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", + 1), + EcRecommendedParameters(ASN1::brainpoolP160r1(), + "E95E4A5F737059DC60DFC7AD95B3D8139515620F", + "340E7BE2A280EB74E2BE61BADA745D97E8F7C300", + "1E589A8595423412134FAA2DBDEC95C8D8675E58", + "04BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC31667CB477A1A8EC338F94741669C976316DA6321", + "E95E4A5F737059DC60DF5991D45029409E60FC09", + 1), + EcRecommendedParameters(ASN1::brainpoolP192r1(), + "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297", + "6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF", + "469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9", + "04C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD614B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F", + "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1", + 1), + EcRecommendedParameters(ASN1::brainpoolP224r1(), + "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF", + "68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43", + "2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B", + "040D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD", + "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F", + 1), + EcRecommendedParameters(ASN1::brainpoolP256r1(), + "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", + "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", + "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", + "048BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", + "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", + 1), + EcRecommendedParameters(ASN1::brainpoolP320r1(), + "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27", + "3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4", + "520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6", + "0443BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E2061114FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1", + "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311", + 1), + EcRecommendedParameters(ASN1::brainpoolP384r1(), + "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", + "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", + "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", + "041D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", + "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", + 1), + EcRecommendedParameters(ASN1::brainpoolP512r1(), + "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", + "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", + "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", + "0481AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F8227DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", + "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", + 1), + EcRecommendedParameters(ASN1::secp112r1(), + "DB7C2ABF62E35E668076BEAD208B", + "DB7C2ABF62E35E668076BEAD2088", + "659EF8BA043916EEDE8911702B22", + "0409487239995A5EE76B55F9C2F098A89CE5AF8724C0A23E0E0FF77500", + "DB7C2ABF62E35E7628DFAC6561C5", + 1), + EcRecommendedParameters(ASN1::secp112r2(), + "DB7C2ABF62E35E668076BEAD208B", + "6127C24C05F38A0AAAF65C0EF02C", + "51DEF1815DB5ED74FCC34C85D709", + "044BA30AB5E892B4E1649DD0928643ADCD46F5882E3747DEF36E956E97", + "36DF0AAFD8B8D7597CA10520D04B", + 4), + EcRecommendedParameters(ASN1::secp160r1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC", + "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45", + "044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32", + "0100000000000000000001F4C8F927AED3CA752257", + 1), + EcRecommendedParameters(ASN1::secp160k1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", + "0000000000000000000000000000000000000000", + "0000000000000000000000000000000000000007", + "043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE", + "0100000000000000000001B8FA16DFAB9ACA16B6B3", + 1), + EcRecommendedParameters(ASN1::secp256k1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000007", + "0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", + 1), + EcRecommendedParameters(ASN1::secp128r1(), + "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", + "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC", + "E87579C11079F43DD824993C2CEE5ED3", + "04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83", + "FFFFFFFE0000000075A30D1B9038A115", + 1), + EcRecommendedParameters(ASN1::secp128r2(), + "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", + "D6031998D1B3BBFEBF59CC9BBFF9AEE1", + "5EEEFCA380D02919DC2C6558BB6D8A5D", + "047B6AA5D85E572983E6FB32A7CDEBC14027B6916A894D3AEE7106FE805FC34B44", + "3FFFFFFF7FFFFFFFBE0024720613B5A3", + 4), + EcRecommendedParameters(ASN1::secp160r2(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70", + "B4E134D3FB59EB8BAB57274904664D5AF50388BA", + "0452DCB034293A117E1F4FF11B30F7199D3144CE6DFEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E", + "0100000000000000000000351EE786A818F3A1A16B", + 1), + EcRecommendedParameters(ASN1::secp192k1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", + "000000000000000000000000000000000000000000000000", + "000000000000000000000000000000000000000000000003", + "04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", + "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", + 1), + EcRecommendedParameters(ASN1::secp224k1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", + "00000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000005", + "04A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", + "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", + 1), + EcRecommendedParameters(ASN1::secp224r1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", + "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", + "04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", + 1), + EcRecommendedParameters(ASN1::secp384r1(), + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", + "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF", + "04AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", + 1), + EcRecommendedParameters(ASN1::secp521r1(), + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", + "0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00", + "0400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650", + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", + 1), + }; + begin = rec; + end = rec + sizeof(rec)/sizeof(rec[0]); +} + +template OID DL_GroupParameters_EC::GetNextRecommendedParametersOID(const OID &oid) +{ + const EcRecommendedParameters *begin, *end; + GetRecommendedParameters(begin, end); + const EcRecommendedParameters *it = std::upper_bound(begin, end, oid, OIDLessThan()); + return (it == end ? OID() : it->oid); +} + +template void DL_GroupParameters_EC::Initialize(const OID &oid) +{ + const EcRecommendedParameters *begin, *end; + GetRecommendedParameters(begin, end); + const EcRecommendedParameters *it = std::lower_bound(begin, end, oid, OIDLessThan()); + if (it == end || it->oid != oid) + throw UnknownOID(); + + const EcRecommendedParameters ¶m = *it; + m_oid = oid; + member_ptr ec(param.NewEC()); + this->m_groupPrecomputation.SetCurve(*ec); + + StringSource ssG(param.g, true, new HexDecoder); + Element G; + bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable()); + this->SetSubgroupGenerator(G); + + // TODO: this fails in practice. Should it throw? + CRYPTOPP_UNUSED(result); assert(result); + + StringSource ssN(param.n, true, new HexDecoder); + m_n.Decode(ssN, (size_t)ssN.MaxRetrievable()); + m_k = param.h; +} + +template +bool DL_GroupParameters_EC::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + if (strcmp(name, Name::GroupOID()) == 0) + { + if (m_oid.m_values.empty()) + return false; + + this->ThrowIfTypeMismatch(name, typeid(OID), valueType); + *reinterpret_cast(pValue) = m_oid; + return true; + } + else + return GetValueHelper >(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Curve); +} + +template +void DL_GroupParameters_EC::AssignFrom(const NameValuePairs &source) +{ + OID oid; + if (source.GetValue(Name::GroupOID(), oid)) + Initialize(oid); + else + { + EllipticCurve ec; + Point G; + Integer n; + + source.GetRequiredParameter("DL_GroupParameters_EC", Name::Curve(), ec); + source.GetRequiredParameter("DL_GroupParameters_EC", Name::SubgroupGenerator(), G); + source.GetRequiredParameter("DL_GroupParameters_EC", Name::SubgroupOrder(), n); + Integer k = source.GetValueWithDefault(Name::Cofactor(), Integer::Zero()); + + Initialize(ec, G, n, k); + } +} + +template +void DL_GroupParameters_EC::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + try + { + CRYPTOPP_UNUSED(rng); + AssignFrom(alg); + } + catch (InvalidArgument &) + { + throw NotImplemented("DL_GroupParameters_EC: curve generation is not implemented yet"); + } +} + +template +void DL_GroupParameters_EC::BERDecode(BufferedTransformation &bt) +{ + byte b; + if (!bt.Peek(b)) + BERDecodeError(); + if (b == OBJECT_IDENTIFIER) + Initialize(OID(bt)); + else + { + BERSequenceDecoder seq(bt); + word32 version; + BERDecodeUnsigned(seq, version, INTEGER, 1, 1); // check version + EllipticCurve ec(seq); + Point G = ec.BERDecodePoint(seq); + Integer n(seq); + Integer k; + bool cofactorPresent = !seq.EndReached(); + if (cofactorPresent) + k.BERDecode(seq); + else + k = Integer::Zero(); + seq.MessageEnd(); + + Initialize(ec, G, n, k); + } +} + +template +void DL_GroupParameters_EC::DEREncode(BufferedTransformation &bt) const +{ + if (m_encodeAsOID && !m_oid.m_values.empty()) + m_oid.DEREncode(bt); + else + { + DERSequenceEncoder seq(bt); + DEREncodeUnsigned(seq, 1); // version + GetCurve().DEREncode(seq); + GetCurve().DEREncodePoint(seq, this->GetSubgroupGenerator(), m_compress); + m_n.DEREncode(seq); + if (m_k.NotZero()) + m_k.DEREncode(seq); + seq.MessageEnd(); + } +} + +template +Integer DL_GroupParameters_EC::GetCofactor() const +{ + if (!m_k) + { + Integer q = GetCurve().FieldSize(); + Integer qSqrt = q.SquareRoot(); + m_k = (q+2*qSqrt+1)/m_n; + } + + return m_k; +} + +template +Integer DL_GroupParameters_EC::ConvertElementToInteger(const Element &element) const +{ + return ConvertToInteger(element.x); +}; + +template +bool DL_GroupParameters_EC::ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = GetCurve().ValidateParameters(rng, level); + + Integer q = GetCurve().FieldSize(); + pass = pass && m_n!=q; + + if (level >= 2) + { + Integer qSqrt = q.SquareRoot(); + pass = pass && m_n>4*qSqrt; + pass = pass && VerifyPrime(rng, m_n, level-2); + pass = pass && (m_k.IsZero() || m_k == (q+2*qSqrt+1)/m_n); + pass = pass && CheckMOVCondition(q, m_n); + } + + return pass; +} + +template +bool DL_GroupParameters_EC::ValidateElement(unsigned int level, const Element &g, const DL_FixedBasePrecomputation *gpc) const +{ + bool pass = !IsIdentity(g) && GetCurve().VerifyPoint(g); + if (level >= 1) + { + if (gpc) + pass = pass && gpc->Exponentiate(this->GetGroupPrecomputation(), Integer::One()) == g; + } + if (level >= 2 && pass) + { + const Integer &q = GetSubgroupOrder(); + Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : this->ExponentiateElement(g, q); + pass = pass && IsIdentity(gq); + } + return pass; +} + +template +void DL_GroupParameters_EC::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const +{ + GetCurve().SimultaneousMultiply(results, base, exponents, exponentsCount); +} + +template +CPP_TYPENAME DL_GroupParameters_EC::Element DL_GroupParameters_EC::MultiplyElements(const Element &a, const Element &b) const +{ + return GetCurve().Add(a, b); +} + +template +CPP_TYPENAME DL_GroupParameters_EC::Element DL_GroupParameters_EC::CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const +{ + return GetCurve().CascadeMultiply(exponent1, element1, exponent2, element2); +} + +template +OID DL_GroupParameters_EC::GetAlgorithmID() const +{ + return ASN1::id_ecPublicKey(); +} + +// ****************************************************************** + +template +void DL_PublicKey_EC::BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size) +{ + CRYPTOPP_UNUSED(parametersPresent); + + typename EC::Point P; + if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size)) + BERDecodeError(); + this->SetPublicElement(P); +} + +template +void DL_PublicKey_EC::DEREncodePublicKey(BufferedTransformation &bt) const +{ + this->GetGroupParameters().GetCurve().EncodePoint(bt, this->GetPublicElement(), this->GetGroupParameters().GetPointCompression()); +} + +// ****************************************************************** + +template +void DL_PrivateKey_EC::BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size) +{ + CRYPTOPP_UNUSED(size); + BERSequenceDecoder seq(bt); + word32 version; + BERDecodeUnsigned(seq, version, INTEGER, 1, 1); // check version + + BERGeneralDecoder dec(seq, OCTET_STRING); + if (!dec.IsDefiniteLength()) + BERDecodeError(); + Integer x; + x.Decode(dec, (size_t)dec.RemainingLength()); + dec.MessageEnd(); + if (!parametersPresent && seq.PeekByte() != (CONTEXT_SPECIFIC | CONSTRUCTED | 0)) + BERDecodeError(); + if (!seq.EndReached() && seq.PeekByte() == (CONTEXT_SPECIFIC | CONSTRUCTED | 0)) + { + BERGeneralDecoder parameters(seq, CONTEXT_SPECIFIC | CONSTRUCTED | 0); + this->AccessGroupParameters().BERDecode(parameters); + parameters.MessageEnd(); + } + if (!seq.EndReached()) + { + // skip over the public element + SecByteBlock subjectPublicKey; + unsigned int unusedBits; + BERGeneralDecoder publicKey(seq, CONTEXT_SPECIFIC | CONSTRUCTED | 1); + BERDecodeBitString(publicKey, subjectPublicKey, unusedBits); + publicKey.MessageEnd(); + Element Q; + if (!(unusedBits == 0 && this->GetGroupParameters().GetCurve().DecodePoint(Q, subjectPublicKey, subjectPublicKey.size()))) + BERDecodeError(); + } + seq.MessageEnd(); + + this->SetPrivateExponent(x); +} + +template +void DL_PrivateKey_EC::DEREncodePrivateKey(BufferedTransformation &bt) const +{ + DERSequenceEncoder privateKey(bt); + DEREncodeUnsigned(privateKey, 1); // version + // SEC 1 ver 1.0 says privateKey (m_d) has the same length as order of the curve + // this will be changed to order of base point in a future version + this->GetPrivateExponent().DEREncodeAsOctetString(privateKey, this->GetGroupParameters().GetSubgroupOrder().ByteCount()); + privateKey.MessageEnd(); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/eccrypto.h b/external/crypto++-5.6.3/eccrypto.h new file mode 100644 index 000000000..981f1cd9c --- /dev/null +++ b/external/crypto++-5.6.3/eccrypto.h @@ -0,0 +1,671 @@ +// eccrypto.h - written and placed in the public domain by Wei Dai + +//! \file eccrypto.h +//! \brief Classes and functions for Elliptic Curves over prime and binary fields + +#ifndef CRYPTOPP_ECCRYPTO_H +#define CRYPTOPP_ECCRYPTO_H + +#include "config.h" +#include "cryptlib.h" +#include "pubkey.h" +#include "integer.h" +#include "asn.h" +#include "hmac.h" +#include "sha.h" +#include "gfpcrypt.h" +#include "dh.h" +#include "mqv.h" +#include "ecp.h" +#include "ec2n.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Elliptic Curve Parameters +/*! This class corresponds to the ASN.1 sequence of the same name + in ANSI X9.62 (also SEC 1). +*/ +template +class DL_GroupParameters_EC : public DL_GroupParametersImpl > +{ + typedef DL_GroupParameters_EC ThisClass; + +public: + typedef EC EllipticCurve; + typedef typename EllipticCurve::Point Point; + typedef Point Element; + typedef IncompatibleCofactorMultiplication DefaultCofactorOption; + + DL_GroupParameters_EC() : m_compress(false), m_encodeAsOID(false) {} + DL_GroupParameters_EC(const OID &oid) + : m_compress(false), m_encodeAsOID(false) {Initialize(oid);} + DL_GroupParameters_EC(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) + : m_compress(false), m_encodeAsOID(false) {Initialize(ec, G, n, k);} + DL_GroupParameters_EC(BufferedTransformation &bt) + : m_compress(false), m_encodeAsOID(false) {BERDecode(bt);} + + void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) + { + this->m_groupPrecomputation.SetCurve(ec); + this->SetSubgroupGenerator(G); + m_n = n; + m_k = k; + } + void Initialize(const OID &oid); + + // NameValuePairs + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // GeneratibleCryptoMaterial interface + //! this implementation doesn't actually generate a curve, it just initializes the parameters with existing values + /*! parameters: (Curve, SubgroupGenerator, SubgroupOrder, Cofactor (optional)), or (GroupOID) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + // DL_GroupParameters + const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return this->m_gpc;} + DL_FixedBasePrecomputation & AccessBasePrecomputation() {return this->m_gpc;} + const Integer & GetSubgroupOrder() const {return m_n;} + Integer GetCofactor() const; + bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; + bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation *precomp) const; + bool FastSubgroupCheckAvailable() const {return false;} + void EncodeElement(bool reversible, const Element &element, byte *encoded) const + { + if (reversible) + GetCurve().EncodePoint(encoded, element, m_compress); + else + element.x.Encode(encoded, GetEncodedElementSize(false)); + } + virtual unsigned int GetEncodedElementSize(bool reversible) const + { + if (reversible) + return GetCurve().EncodedPointSize(m_compress); + else + return GetCurve().GetField().MaxElementByteLength(); + } + Element DecodeElement(const byte *encoded, bool checkForGroupMembership) const + { + Point result; + if (!GetCurve().DecodePoint(result, encoded, GetEncodedElementSize(true))) + throw DL_BadElement(); + if (checkForGroupMembership && !ValidateElement(1, result, NULL)) + throw DL_BadElement(); + return result; + } + Integer ConvertElementToInteger(const Element &element) const; + Integer GetMaxExponent() const {return GetSubgroupOrder()-1;} + bool IsIdentity(const Element &element) const {return element.identity;} + void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; + static std::string CRYPTOPP_API StaticAlgorithmNamePrefix() {return "EC";} + + // ASN1Key + OID GetAlgorithmID() const; + + // used by MQV + Element MultiplyElements(const Element &a, const Element &b) const; + Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const; + + // non-inherited + + // enumerate OIDs for recommended parameters, use OID() to get first one + static OID CRYPTOPP_API GetNextRecommendedParametersOID(const OID &oid); + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + void SetPointCompression(bool compress) {m_compress = compress;} + bool GetPointCompression() const {return m_compress;} + + void SetEncodeAsOID(bool encodeAsOID) {m_encodeAsOID = encodeAsOID;} + bool GetEncodeAsOID() const {return m_encodeAsOID;} + + const EllipticCurve& GetCurve() const {return this->m_groupPrecomputation.GetCurve();} + + bool operator==(const ThisClass &rhs) const + {return this->m_groupPrecomputation.GetCurve() == rhs.m_groupPrecomputation.GetCurve() && this->m_gpc.GetBase(this->m_groupPrecomputation) == rhs.m_gpc.GetBase(rhs.m_groupPrecomputation);} + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + const Point& GetBasePoint() const {return this->GetSubgroupGenerator();} + const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();} + void LoadRecommendedParameters(const OID &oid) {Initialize(oid);} +#endif + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_EC() {} +#endif + +protected: + unsigned int FieldElementLength() const {return GetCurve().GetField().MaxElementByteLength();} + unsigned int ExponentLength() const {return m_n.ByteCount();} + + OID m_oid; // set if parameters loaded from a recommended curve + Integer m_n; // order of base point + mutable Integer m_k; // cofactor + mutable bool m_compress, m_encodeAsOID; // presentation details +}; + +//! EC public key +template +class DL_PublicKey_EC : public DL_PublicKeyImpl > +{ +public: + typedef typename EC::Point Element; + + void Initialize(const DL_GroupParameters_EC ¶ms, const Element &Q) + {this->AccessGroupParameters() = params; this->SetPublicElement(Q);} + void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q) + {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);} + + // X509PublicKey + void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size); + void DEREncodePublicKey(BufferedTransformation &bt) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PublicKey_EC() {} +#endif +}; + +//! EC private key +template +class DL_PrivateKey_EC : public DL_PrivateKeyImpl > +{ +public: + typedef typename EC::Point Element; + + void Initialize(const DL_GroupParameters_EC ¶ms, const Integer &x) + {this->AccessGroupParameters() = params; this->SetPrivateExponent(x);} + void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x) + {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);} + void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC ¶ms) + {this->GenerateRandom(rng, params);} + void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n) + {this->GenerateRandom(rng, DL_GroupParameters_EC(ec, G, n));} + + // PKCS8PrivateKey + void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size); + void DEREncodePrivateKey(BufferedTransformation &bt) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PrivateKey_EC() {} +#endif +}; + +//! Elliptic Curve Diffie-Hellman, AKA ECDH +template ::DefaultCofactorOption> +struct ECDH +{ + typedef DH_Domain, COFACTOR_OPTION> Domain; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECDH() {} +#endif +}; + +/// Elliptic Curve Menezes-Qu-Vanstone, AKA ECMQV +template ::DefaultCofactorOption> +struct ECMQV +{ + typedef MQV_Domain, COFACTOR_OPTION> Domain; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECMQV() {} +#endif +}; + +//! EC keys +template +struct DL_Keys_EC +{ + typedef DL_PublicKey_EC PublicKey; + typedef DL_PrivateKey_EC PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Keys_EC() {} +#endif +}; + +template +struct ECDSA; + +//! ECDSA keys +template +struct DL_Keys_ECDSA +{ + typedef DL_PublicKey_EC PublicKey; + typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA > PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Keys_ECDSA() {} +#endif +}; + +//! ECDSA algorithm +template +class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_ECDSA() {} +#endif +}; + +//! ECNR algorithm +template +class DL_Algorithm_ECNR : public DL_Algorithm_NR +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_ECNR() {} +#endif +}; + +//! ECDSA +template +struct ECDSA : public DL_SS, DL_Algorithm_ECDSA, DL_SignatureMessageEncodingMethod_DSA, H> +{ +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECDSA() {} +#endif +}; + +//! ECNR +template +struct ECNR : public DL_SS, DL_Algorithm_ECNR, DL_SignatureMessageEncodingMethod_NR, H> +{ +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECNR() {} +#endif +}; + +//! Elliptic Curve Integrated Encryption Scheme, AKA ECIES +/*! Default to (NoCofactorMultiplication and DHAES_MODE = false) for compatibilty with SEC1 and Crypto++ 4.2. + The combination of (IncompatibleCofactorMultiplication and DHAES_MODE = true) is recommended for best + efficiency and security. */ +template +struct ECIES + : public DL_ES< + DL_Keys_EC, + DL_KeyAgreementAlgorithm_DH, + DL_KeyDerivationAlgorithm_P1363 >, + DL_EncryptionAlgorithm_Xor, DHAES_MODE>, + ECIES > +{ + static std::string CRYPTOPP_API StaticAlgorithmName() {return "ECIES";} // TODO: fix this after name is standardized + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECIES() {} +#endif + +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 30000) +} __attribute__((deprecated ("ECIES will be changing in the near future due to (1) an implementation bug and (2) an interop issue."))); +#elif (CRYPTOPP_GCC_VERSION ) +} __attribute__((deprecated)); +#else +}; +#endif + +NAMESPACE_END + +#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#include "eccrypto.cpp" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; + +NAMESPACE_END + +#endif +#ifndef CRYPTOPP_ECCRYPTO_H +#define CRYPTOPP_ECCRYPTO_H + +/*! \file +*/ + +#include "cryptlib.h" +#include "pubkey.h" +#include "integer.h" +#include "asn.h" +#include "hmac.h" +#include "sha.h" +#include "gfpcrypt.h" +#include "dh.h" +#include "mqv.h" +#include "ecp.h" +#include "ec2n.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Elliptic Curve Parameters +/*! This class corresponds to the ASN.1 sequence of the same name + in ANSI X9.62 (also SEC 1). +*/ +template +class DL_GroupParameters_EC : public DL_GroupParametersImpl > +{ + typedef DL_GroupParameters_EC ThisClass; + +public: + typedef EC EllipticCurve; + typedef typename EllipticCurve::Point Point; + typedef Point Element; + typedef IncompatibleCofactorMultiplication DefaultCofactorOption; + + DL_GroupParameters_EC() : m_compress(false), m_encodeAsOID(false) {} + DL_GroupParameters_EC(const OID &oid) + : m_compress(false), m_encodeAsOID(false) {Initialize(oid);} + DL_GroupParameters_EC(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) + : m_compress(false), m_encodeAsOID(false) {Initialize(ec, G, n, k);} + DL_GroupParameters_EC(BufferedTransformation &bt) + : m_compress(false), m_encodeAsOID(false) {BERDecode(bt);} + + void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) + { + this->m_groupPrecomputation.SetCurve(ec); + this->SetSubgroupGenerator(G); + m_n = n; + m_k = k; + } + void Initialize(const OID &oid); + + // NameValuePairs + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // GeneratibleCryptoMaterial interface + //! this implementation doesn't actually generate a curve, it just initializes the parameters with existing values + /*! parameters: (Curve, SubgroupGenerator, SubgroupOrder, Cofactor (optional)), or (GroupOID) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + // DL_GroupParameters + const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return this->m_gpc;} + DL_FixedBasePrecomputation & AccessBasePrecomputation() {return this->m_gpc;} + const Integer & GetSubgroupOrder() const {return m_n;} + Integer GetCofactor() const; + bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; + bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation *precomp) const; + bool FastSubgroupCheckAvailable() const {return false;} + void EncodeElement(bool reversible, const Element &element, byte *encoded) const + { + if (reversible) + GetCurve().EncodePoint(encoded, element, m_compress); + else + element.x.Encode(encoded, GetEncodedElementSize(false)); + } + virtual unsigned int GetEncodedElementSize(bool reversible) const + { + if (reversible) + return GetCurve().EncodedPointSize(m_compress); + else + return GetCurve().GetField().MaxElementByteLength(); + } + Element DecodeElement(const byte *encoded, bool checkForGroupMembership) const + { + Point result; + if (!GetCurve().DecodePoint(result, encoded, GetEncodedElementSize(true))) + throw DL_BadElement(); + if (checkForGroupMembership && !ValidateElement(1, result, NULL)) + throw DL_BadElement(); + return result; + } + Integer ConvertElementToInteger(const Element &element) const; + Integer GetMaxExponent() const {return GetSubgroupOrder()-1;} + bool IsIdentity(const Element &element) const {return element.identity;} + void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; + static std::string CRYPTOPP_API StaticAlgorithmNamePrefix() {return "EC";} + + // ASN1Key + OID GetAlgorithmID() const; + + // used by MQV + Element MultiplyElements(const Element &a, const Element &b) const; + Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const; + + // non-inherited + + // enumerate OIDs for recommended parameters, use OID() to get first one + static OID CRYPTOPP_API GetNextRecommendedParametersOID(const OID &oid); + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + void SetPointCompression(bool compress) {m_compress = compress;} + bool GetPointCompression() const {return m_compress;} + + void SetEncodeAsOID(bool encodeAsOID) {m_encodeAsOID = encodeAsOID;} + bool GetEncodeAsOID() const {return m_encodeAsOID;} + + const EllipticCurve& GetCurve() const {return this->m_groupPrecomputation.GetCurve();} + + bool operator==(const ThisClass &rhs) const + {return this->m_groupPrecomputation.GetCurve() == rhs.m_groupPrecomputation.GetCurve() && this->m_gpc.GetBase(this->m_groupPrecomputation) == rhs.m_gpc.GetBase(rhs.m_groupPrecomputation);} + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + const Point& GetBasePoint() const {return this->GetSubgroupGenerator();} + const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();} + void LoadRecommendedParameters(const OID &oid) {Initialize(oid);} +#endif + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_EC() {} +#endif + +protected: + unsigned int FieldElementLength() const {return GetCurve().GetField().MaxElementByteLength();} + unsigned int ExponentLength() const {return m_n.ByteCount();} + + OID m_oid; // set if parameters loaded from a recommended curve + Integer m_n; // order of base point + mutable Integer m_k; // cofactor + mutable bool m_compress, m_encodeAsOID; // presentation details +}; + +//! EC public key +template +class DL_PublicKey_EC : public DL_PublicKeyImpl > +{ +public: + typedef typename EC::Point Element; + + void Initialize(const DL_GroupParameters_EC ¶ms, const Element &Q) + {this->AccessGroupParameters() = params; this->SetPublicElement(Q);} + void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q) + {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);} + + // X509PublicKey + void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size); + void DEREncodePublicKey(BufferedTransformation &bt) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PublicKey_EC() {} +#endif +}; + +//! EC private key +template +class DL_PrivateKey_EC : public DL_PrivateKeyImpl > +{ +public: + typedef typename EC::Point Element; + + void Initialize(const DL_GroupParameters_EC ¶ms, const Integer &x) + {this->AccessGroupParameters() = params; this->SetPrivateExponent(x);} + void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x) + {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);} + void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC ¶ms) + {this->GenerateRandom(rng, params);} + void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n) + {this->GenerateRandom(rng, DL_GroupParameters_EC(ec, G, n));} + + // PKCS8PrivateKey + void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size); + void DEREncodePrivateKey(BufferedTransformation &bt) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PrivateKey_EC() {} +#endif +}; + +//! Elliptic Curve Diffie-Hellman, AKA ECDH +template ::DefaultCofactorOption> +struct ECDH +{ + typedef DH_Domain, COFACTOR_OPTION> Domain; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECDH() {} +#endif +}; + +/// Elliptic Curve Menezes-Qu-Vanstone, AKA ECMQV +template ::DefaultCofactorOption> +struct ECMQV +{ + typedef MQV_Domain, COFACTOR_OPTION> Domain; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECMQV() {} +#endif +}; + +//! EC keys +template +struct DL_Keys_EC +{ + typedef DL_PublicKey_EC PublicKey; + typedef DL_PrivateKey_EC PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Keys_EC() {} +#endif +}; + +template +struct ECDSA; + +//! ECDSA keys +template +struct DL_Keys_ECDSA +{ + typedef DL_PublicKey_EC PublicKey; + typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA > PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Keys_ECDSA() {} +#endif +}; + +//! ECDSA algorithm +template +class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_ECDSA() {} +#endif +}; + +//! ECNR algorithm +template +class DL_Algorithm_ECNR : public DL_Algorithm_NR +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_ECNR() {} +#endif +}; + +//! ECDSA +template +struct ECDSA : public DL_SS, DL_Algorithm_ECDSA, DL_SignatureMessageEncodingMethod_DSA, H> +{ +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECDSA() {} +#endif +}; + +//! ECNR +template +struct ECNR : public DL_SS, DL_Algorithm_ECNR, DL_SignatureMessageEncodingMethod_NR, H> +{ +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECNR() {} +#endif +}; + +//! Elliptic Curve Integrated Encryption Scheme, AKA ECIES +/*! Default to (NoCofactorMultiplication and DHAES_MODE = false) for compatibilty with SEC1 and Crypto++ 4.2. + The combination of (IncompatibleCofactorMultiplication and DHAES_MODE = true) is recommended for best + efficiency and security. */ +template +struct ECIES + : public DL_ES< + DL_Keys_EC, + DL_KeyAgreementAlgorithm_DH, + DL_KeyDerivationAlgorithm_P1363 >, + DL_EncryptionAlgorithm_Xor, DHAES_MODE>, + ECIES > +{ + static std::string CRYPTOPP_API StaticAlgorithmName() {return "ECIES";} // TODO: fix this after name is standardized + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECIES() {} +#endif + +#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) +} __attribute__((deprecated ("ECIES will be changing in the near future due to (1) an implementation bug and (2) an interop issue"))); +#elif (CRYPTOPP_GCC_VERSION) +} __attribute__((deprecated)); +#else +}; +#endif + +NAMESPACE_END + +#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#include "eccrypto.cpp" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ecp.cpp b/external/crypto++-5.6.3/ecp.cpp new file mode 100644 index 000000000..1df43a4ae --- /dev/null +++ b/external/crypto++-5.6.3/ecp.cpp @@ -0,0 +1,476 @@ +// ecp.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "ecp.h" +#include "asn.h" +#include "integer.h" +#include "nbtheory.h" +#include "modarith.h" +#include "filters.h" +#include "algebra.cpp" + +NAMESPACE_BEGIN(CryptoPP) + +ANONYMOUS_NAMESPACE_BEGIN +static inline ECP::Point ToMontgomery(const ModularArithmetic &mr, const ECP::Point &P) +{ + return P.identity ? P : ECP::Point(mr.ConvertIn(P.x), mr.ConvertIn(P.y)); +} + +static inline ECP::Point FromMontgomery(const ModularArithmetic &mr, const ECP::Point &P) +{ + return P.identity ? P : ECP::Point(mr.ConvertOut(P.x), mr.ConvertOut(P.y)); +} +NAMESPACE_END + +ECP::ECP(const ECP &ecp, bool convertToMontgomeryRepresentation) +{ + if (convertToMontgomeryRepresentation && !ecp.GetField().IsMontgomeryRepresentation()) + { + m_fieldPtr.reset(new MontgomeryRepresentation(ecp.GetField().GetModulus())); + m_a = GetField().ConvertIn(ecp.m_a); + m_b = GetField().ConvertIn(ecp.m_b); + } + else + operator=(ecp); +} + +ECP::ECP(BufferedTransformation &bt) + : m_fieldPtr(new Field(bt)) +{ + BERSequenceDecoder seq(bt); + GetField().BERDecodeElement(seq, m_a); + GetField().BERDecodeElement(seq, m_b); + // skip optional seed + if (!seq.EndReached()) + { + SecByteBlock seed; + unsigned int unused; + BERDecodeBitString(seq, seed, unused); + } + seq.MessageEnd(); +} + +void ECP::DEREncode(BufferedTransformation &bt) const +{ + GetField().DEREncode(bt); + DERSequenceEncoder seq(bt); + GetField().DEREncodeElement(seq, m_a); + GetField().DEREncodeElement(seq, m_b); + seq.MessageEnd(); +} + +bool ECP::DecodePoint(ECP::Point &P, const byte *encodedPoint, size_t encodedPointLen) const +{ + StringStore store(encodedPoint, encodedPointLen); + return DecodePoint(P, store, encodedPointLen); +} + +bool ECP::DecodePoint(ECP::Point &P, BufferedTransformation &bt, size_t encodedPointLen) const +{ + byte type; + if (encodedPointLen < 1 || !bt.Get(type)) + return false; + + switch (type) + { + case 0: + P.identity = true; + return true; + case 2: + case 3: + { + if (encodedPointLen != EncodedPointSize(true)) + return false; + + Integer p = FieldSize(); + + P.identity = false; + P.x.Decode(bt, GetField().MaxElementByteLength()); + P.y = ((P.x*P.x+m_a)*P.x+m_b) % p; + + if (Jacobi(P.y, p) !=1) + return false; + + P.y = ModularSquareRoot(P.y, p); + + if ((type & 1) != P.y.GetBit(0)) + P.y = p-P.y; + + return true; + } + case 4: + { + if (encodedPointLen != EncodedPointSize(false)) + return false; + + unsigned int len = GetField().MaxElementByteLength(); + P.identity = false; + P.x.Decode(bt, len); + P.y.Decode(bt, len); + return true; + } + default: + return false; + } +} + +void ECP::EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const +{ + if (P.identity) + NullStore().TransferTo(bt, EncodedPointSize(compressed)); + else if (compressed) + { + bt.Put(2 + P.y.GetBit(0)); + P.x.Encode(bt, GetField().MaxElementByteLength()); + } + else + { + unsigned int len = GetField().MaxElementByteLength(); + bt.Put(4); // uncompressed + P.x.Encode(bt, len); + P.y.Encode(bt, len); + } +} + +void ECP::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const +{ + ArraySink sink(encodedPoint, EncodedPointSize(compressed)); + EncodePoint(sink, P, compressed); + assert(sink.TotalPutLength() == EncodedPointSize(compressed)); +} + +ECP::Point ECP::BERDecodePoint(BufferedTransformation &bt) const +{ + SecByteBlock str; + BERDecodeOctetString(bt, str); + Point P; + if (!DecodePoint(P, str, str.size())) + BERDecodeError(); + return P; +} + +void ECP::DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const +{ + SecByteBlock str(EncodedPointSize(compressed)); + EncodePoint(str, P, compressed); + DEREncodeOctetString(bt, str); +} + +bool ECP::ValidateParameters(RandomNumberGenerator &rng, unsigned int level) const +{ + Integer p = FieldSize(); + + bool pass = p.IsOdd(); + pass = pass && !m_a.IsNegative() && m_a

= 1) + pass = pass && ((4*m_a*m_a*m_a+27*m_b*m_b)%p).IsPositive(); + + if (level >= 2) + pass = pass && VerifyPrime(rng, p); + + return pass; +} + +bool ECP::VerifyPoint(const Point &P) const +{ + const FieldElement &x = P.x, &y = P.y; + Integer p = FieldSize(); + return P.identity || + (!x.IsNegative() && x

().Ref(); +} + +const ECP::Point& ECP::Inverse(const Point &P) const +{ + if (P.identity) + return P; + else + { + m_R.identity = false; + m_R.x = P.x; + m_R.y = GetField().Inverse(P.y); + return m_R; + } +} + +const ECP::Point& ECP::Add(const Point &P, const Point &Q) const +{ + if (P.identity) return Q; + if (Q.identity) return P; + if (GetField().Equal(P.x, Q.x)) + return GetField().Equal(P.y, Q.y) ? Double(P) : Identity(); + + FieldElement t = GetField().Subtract(Q.y, P.y); + t = GetField().Divide(t, GetField().Subtract(Q.x, P.x)); + FieldElement x = GetField().Subtract(GetField().Subtract(GetField().Square(t), P.x), Q.x); + m_R.y = GetField().Subtract(GetField().Multiply(t, GetField().Subtract(P.x, x)), P.y); + + m_R.x.swap(x); + m_R.identity = false; + return m_R; +} + +const ECP::Point& ECP::Double(const Point &P) const +{ + if (P.identity || P.y==GetField().Identity()) return Identity(); + + FieldElement t = GetField().Square(P.x); + t = GetField().Add(GetField().Add(GetField().Double(t), t), m_a); + t = GetField().Divide(t, GetField().Double(P.y)); + FieldElement x = GetField().Subtract(GetField().Subtract(GetField().Square(t), P.x), P.x); + m_R.y = GetField().Subtract(GetField().Multiply(t, GetField().Subtract(P.x, x)), P.y); + + m_R.x.swap(x); + m_R.identity = false; + return m_R; +} + +template void ParallelInvert(const AbstractRing &ring, Iterator begin, Iterator end) +{ + size_t n = end-begin; + if (n == 1) + *begin = ring.MultiplicativeInverse(*begin); + else if (n > 1) + { + std::vector vec((n+1)/2); + unsigned int i; + Iterator it; + + for (i=0, it=begin; i::iterator it) : it(it) {} + Integer& operator*() {return it->z;} + int operator-(ZIterator it2) {return int(it-it2.it);} + ZIterator operator+(int i) {return ZIterator(it+i);} + ZIterator& operator+=(int i) {it+=i; return *this;} + std::vector::iterator it; +}; + +ECP::Point ECP::ScalarMultiply(const Point &P, const Integer &k) const +{ + Element result; + if (k.BitCount() <= 5) + AbstractGroup::SimultaneousMultiply(&result, P, &k, 1); + else + ECP::SimultaneousMultiply(&result, P, &k, 1); + return result; +} + +void ECP::SimultaneousMultiply(ECP::Point *results, const ECP::Point &P, const Integer *expBegin, unsigned int expCount) const +{ + if (!GetField().IsMontgomeryRepresentation()) + { + ECP ecpmr(*this, true); + const ModularArithmetic &mr = ecpmr.GetField(); + ecpmr.SimultaneousMultiply(results, ToMontgomery(mr, P), expBegin, expCount); + for (unsigned int i=0; i bases; + std::vector exponents; + exponents.reserve(expCount); + std::vector > baseIndices(expCount); + std::vector > negateBase(expCount); + std::vector > exponentWindows(expCount); + unsigned int i; + + for (i=0; iNotNegative()); + exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 5)); + exponents[i].FindNextWindow(); + } + + unsigned int expBitPosition = 0; + bool notDone = true; + + while (notDone) + { + notDone = false; + bool baseAdded = false; + for (i=0; i > finalCascade; + for (i=0; i::CascadeScalarMultiply(P, k1, Q, k2); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ecp.h b/external/crypto++-5.6.3/ecp.h new file mode 100644 index 000000000..ef15c6b03 --- /dev/null +++ b/external/crypto++-5.6.3/ecp.h @@ -0,0 +1,145 @@ +// ecp.h - written and placed in the public domain by Wei Dai + +//! \file ecp.h +//! \brief Classes for Elliptic Curves over prime fields + +#ifndef CRYPTOPP_ECP_H +#define CRYPTOPP_ECP_H + +#include "cryptlib.h" +#include "integer.h" +#include "modarith.h" +#include "eprecomp.h" +#include "smartptr.h" +#include "pubkey.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Elliptical Curve Point +struct CRYPTOPP_DLL ECPPoint +{ + ECPPoint() : identity(true) {} + ECPPoint(const Integer &x, const Integer &y) + : identity(false), x(x), y(y) {} + + bool operator==(const ECPPoint &t) const + {return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);} + bool operator< (const ECPPoint &t) const + {return identity ? !t.identity : (!t.identity && (x; + +//! Elliptic Curve over GF(p), where p is prime +class CRYPTOPP_DLL ECP : public AbstractGroup +{ +public: + typedef ModularArithmetic Field; + typedef Integer FieldElement; + typedef ECPPoint Point; + + ECP() {} + ECP(const ECP &ecp, bool convertToMontgomeryRepresentation = false); + ECP(const Integer &modulus, const FieldElement &a, const FieldElement &b) + : m_fieldPtr(new Field(modulus)), m_a(a.IsNegative() ? modulus+a : a), m_b(b) {} + // construct from BER encoded parameters + // this constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters + ECP(BufferedTransformation &bt); + + // encode the fields fieldID and curve of the sequence ECParameters + void DEREncode(BufferedTransformation &bt) const; + + bool Equal(const Point &P, const Point &Q) const; + const Point& Identity() const; + const Point& Inverse(const Point &P) const; + bool InversionIsFast() const {return true;} + const Point& Add(const Point &P, const Point &Q) const; + const Point& Double(const Point &P) const; + Point ScalarMultiply(const Point &P, const Integer &k) const; + Point CascadeScalarMultiply(const Point &P, const Integer &k1, const Point &Q, const Integer &k2) const; + void SimultaneousMultiply(Point *results, const Point &base, const Integer *exponents, unsigned int exponentsCount) const; + + Point Multiply(const Integer &k, const Point &P) const + {return ScalarMultiply(P, k);} + Point CascadeMultiply(const Integer &k1, const Point &P, const Integer &k2, const Point &Q) const + {return CascadeScalarMultiply(P, k1, Q, k2);} + + bool ValidateParameters(RandomNumberGenerator &rng, unsigned int level=3) const; + bool VerifyPoint(const Point &P) const; + + unsigned int EncodedPointSize(bool compressed = false) const + {return 1 + (compressed?1:2)*GetField().MaxElementByteLength();} + // returns false if point is compressed and not valid (doesn't check if uncompressed) + bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const; + bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const; + void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const; + void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; + + Point BERDecodePoint(BufferedTransformation &bt) const; + void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; + + Integer FieldSize() const {return GetField().GetModulus();} + const Field & GetField() const {return *m_fieldPtr;} + const FieldElement & GetA() const {return m_a;} + const FieldElement & GetB() const {return m_b;} + + bool operator==(const ECP &rhs) const + {return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ECP() {} +#endif + +private: + clonable_ptr m_fieldPtr; + FieldElement m_a, m_b; + mutable Point m_R; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation; + +template class EcPrecomputation; + +//! ECP precomputation +template<> class EcPrecomputation : public DL_GroupPrecomputation +{ +public: + typedef ECP EllipticCurve; + + // DL_GroupPrecomputation + bool NeedConversions() const {return true;} + Element ConvertIn(const Element &P) const + {return P.identity ? P : ECP::Point(m_ec->GetField().ConvertIn(P.x), m_ec->GetField().ConvertIn(P.y));}; + Element ConvertOut(const Element &P) const + {return P.identity ? P : ECP::Point(m_ec->GetField().ConvertOut(P.x), m_ec->GetField().ConvertOut(P.y));} + const AbstractGroup & GetGroup() const {return *m_ec;} + Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec->BERDecodePoint(bt);} + void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {m_ec->DEREncodePoint(bt, v, false);} + + // non-inherited + void SetCurve(const ECP &ec) + { + m_ec.reset(new ECP(ec, true)); + m_ecOriginal = ec; + } + const ECP & GetCurve() const {return *m_ecOriginal;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~EcPrecomputation() {} +#endif + +private: + value_ptr m_ec, m_ecOriginal; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/elgamal.cpp b/external/crypto++-5.6.3/elgamal.cpp new file mode 100644 index 000000000..c56f593de --- /dev/null +++ b/external/crypto++-5.6.3/elgamal.cpp @@ -0,0 +1,19 @@ +// elgamal.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "elgamal.h" +#include "asn.h" +#include "nbtheory.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void ElGamal_TestInstantiations() +{ + ElGamalEncryptor test1(1, 1, 1); + ElGamalDecryptor test2(NullRNG(), 123); + ElGamalEncryptor test3(test2); +} +#endif + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/elgamal.h b/external/crypto++-5.6.3/elgamal.h new file mode 100644 index 000000000..7152e0979 --- /dev/null +++ b/external/crypto++-5.6.3/elgamal.h @@ -0,0 +1,144 @@ +// elgamal.h - written and placed in the public domain by Wei Dai + +//! \file elgamal.h +//! \brief Classes and functions for ElGamal key agreement and encryption schemes + +#ifndef CRYPTOPP_ELGAMAL_H +#define CRYPTOPP_ELGAMAL_H + +#include "cryptlib.h" +#include "modexppc.h" +#include "integer.h" +#include "gfpcrypt.h" +#include "pubkey.h" +#include "dsa.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH, + public DL_KeyDerivationAlgorithm, + public DL_SymmetricEncryptionAlgorithm +{ +public: + void Derive(const DL_GroupParameters &groupParams, byte *derivedKey, size_t derivedLength, const Integer &agreedElement, const Integer &ephemeralPublicKey, const NameValuePairs &derivationParams) const + { + CRYPTOPP_UNUSED(groupParams), CRYPTOPP_UNUSED(ephemeralPublicKey), CRYPTOPP_UNUSED(derivationParams); + agreedElement.Encode(derivedKey, derivedLength); + } + + size_t GetSymmetricKeyLength(size_t plainTextLength) const + { + CRYPTOPP_UNUSED(plainTextLength); + return GetGroupParameters().GetModulus().ByteCount(); + } + + size_t GetSymmetricCiphertextLength(size_t plainTextLength) const + { + unsigned int len = GetGroupParameters().GetModulus().ByteCount(); + if (plainTextLength <= GetMaxSymmetricPlaintextLength(len)) + return len; + else + return 0; + } + + size_t GetMaxSymmetricPlaintextLength(size_t cipherTextLength) const + { + unsigned int len = GetGroupParameters().GetModulus().ByteCount(); + if (cipherTextLength == len) + return STDMIN(255U, len-3); + else + return 0; + } + + void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plainText, size_t plainTextLength, byte *cipherText, const NameValuePairs ¶meters) const + { + CRYPTOPP_UNUSED(parameters); + const Integer &p = GetGroupParameters().GetModulus(); + unsigned int modulusLen = p.ByteCount(); + + SecByteBlock block(modulusLen-1); + rng.GenerateBlock(block, modulusLen-2-plainTextLength); + memcpy(block+modulusLen-2-plainTextLength, plainText, plainTextLength); + block[modulusLen-2] = (byte)plainTextLength; + + a_times_b_mod_c(Integer(key, modulusLen), Integer(block, modulusLen-1), p).Encode(cipherText, modulusLen); + } + + DecodingResult SymmetricDecrypt(const byte *key, const byte *cipherText, size_t cipherTextLength, byte *plainText, const NameValuePairs ¶meters) const + { + CRYPTOPP_UNUSED(parameters); + const Integer &p = GetGroupParameters().GetModulus(); + unsigned int modulusLen = p.ByteCount(); + + if (cipherTextLength != modulusLen) + return DecodingResult(); + + Integer m = a_times_b_mod_c(Integer(cipherText, modulusLen), Integer(key, modulusLen).InverseMod(p), p); + + m.Encode(plainText, 1); + unsigned int plainTextLength = plainText[0]; + if (plainTextLength > GetMaxSymmetricPlaintextLength(modulusLen)) + return DecodingResult(); + m >>= 8; + m.Encode(plainText, plainTextLength); + return DecodingResult(plainTextLength); + } + + virtual const DL_GroupParameters_GFP & GetGroupParameters() const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ElGamalBase() {} +#endif +}; + +template +class ElGamalObjectImpl : public DL_ObjectImplBase, public ElGamalBase +{ +public: + size_t FixedMaxPlaintextLength() const {return this->MaxPlaintextLength(FixedCiphertextLength());} + size_t FixedCiphertextLength() const {return this->CiphertextLength(0);} + + const DL_GroupParameters_GFP & GetGroupParameters() const {return this->GetKey().GetGroupParameters();} + + DecodingResult FixedLengthDecrypt(RandomNumberGenerator &rng, const byte *cipherText, byte *plainText) const + {return Decrypt(rng, cipherText, FixedCiphertextLength(), plainText);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ElGamalObjectImpl() {} +#endif + +protected: + const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const {return *this;} + const DL_KeyDerivationAlgorithm & GetKeyDerivationAlgorithm() const {return *this;} + const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const {return *this;} +}; + +struct ElGamalKeys +{ + typedef DL_CryptoKeys_GFP::GroupParameters GroupParameters; + typedef DL_PrivateKey_GFP_OldFormat PrivateKey; + typedef DL_PublicKey_GFP_OldFormat PublicKey; +}; + +//! \class ElGamal +//! \brief ElGamal encryption scheme with non-standard padding +struct ElGamal +{ + typedef DL_CryptoSchemeOptions SchemeOptions; + + static const char * StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";} + + typedef SchemeOptions::GroupParameters GroupParameters; + //! implements PK_Encryptor interface + typedef PK_FinalTemplate, SchemeOptions, SchemeOptions::PublicKey> > Encryptor; + //! implements PK_Decryptor interface + typedef PK_FinalTemplate, SchemeOptions, SchemeOptions::PrivateKey> > Decryptor; +}; + +typedef ElGamal::Encryptor ElGamalEncryptor; +typedef ElGamal::Decryptor ElGamalDecryptor; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/emsa2.cpp b/external/crypto++-5.6.3/emsa2.cpp new file mode 100644 index 000000000..43263f25b --- /dev/null +++ b/external/crypto++-5.6.3/emsa2.cpp @@ -0,0 +1,35 @@ +// emsa2.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "emsa2.h" + +#ifndef CRYPTOPP_IMPORTS + +NAMESPACE_BEGIN(CryptoPP) + +void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator& /*rng*/, + const byte* recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength), CRYPTOPP_UNUSED(representativeBitLength); + assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); + + if (representativeBitLength % 8 != 7) + throw PK_SignatureScheme::InvalidKeyLength("EMSA2: EMSA2 requires a key length that is a multiple of 8"); + + size_t digestSize = hash.DigestSize(); + size_t representativeByteLength = BitsToBytes(representativeBitLength); + + representative[0] = messageEmpty ? 0x4b : 0x6b; + memset(representative+1, 0xbb, representativeByteLength-digestSize-4); // pad with 0xbb + byte *afterP2 = representative+representativeByteLength-digestSize-3; + afterP2[0] = 0xba; + hash.Final(afterP2+1); + representative[representativeByteLength-2] = *hashIdentifier.first; + representative[representativeByteLength-1] = 0xcc; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/emsa2.h b/external/crypto++-5.6.3/emsa2.h new file mode 100644 index 000000000..d111bf1cb --- /dev/null +++ b/external/crypto++-5.6.3/emsa2.h @@ -0,0 +1,88 @@ +// emsa2.h - written and placed in the public domain by Wei Dai + +//! \file emsa2.h +//! \brief Classes and functions for various padding schemes used in public key algorithms + +#ifndef CRYPTOPP_EMSA2_H +#define CRYPTOPP_EMSA2_H + +#include "cryptlib.h" +#include "pubkey.h" +#include "misc.h" + +#ifdef CRYPTOPP_IS_DLL +#include "sha.h" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +template class EMSA2HashId +{ +public: + static const byte id; +}; + +template +class EMSA2HashIdLookup : public BASE +{ +public: + struct HashIdentifierLookup + { + template struct HashIdentifierLookup2 + { + static HashIdentifier Lookup() + { + return HashIdentifier(&EMSA2HashId::id, 1); + } + }; + }; +}; + +// EMSA2HashId can be instantiated with the following classes. +class SHA1; +class RIPEMD160; +class RIPEMD128; +class SHA256; +class SHA384; +class SHA512; +class Whirlpool; +class SHA224; +// end of list + +#ifdef CRYPTOPP_IS_DLL +CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; +CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; +CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; +CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; +CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; +#endif + +//! _ +class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "EMSA2";} + + size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const + {CRYPTOPP_UNUSED(hashIdentifierLength); return 8*digestLength + 31;} + + void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; +}; + +//! EMSA2, for use with RWSS and RSA_ISO +/*! Only the following hash functions are supported by this signature standard: + \dontinclude emsa2.h + \skip EMSA2HashId can be instantiated + \until end of list +*/ +struct P1363_EMSA2 : public SignatureStandard +{ + typedef EMSA2Pad SignatureMessageEncodingMethod; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/eprecomp.cpp b/external/crypto++-5.6.3/eprecomp.cpp new file mode 100644 index 000000000..c0d0c228f --- /dev/null +++ b/external/crypto++-5.6.3/eprecomp.cpp @@ -0,0 +1,113 @@ +// eprecomp.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "eprecomp.h" +#include "integer.h" +#include "asn.h" + +NAMESPACE_BEGIN(CryptoPP) + +template void DL_FixedBasePrecomputationImpl::SetBase(const DL_GroupPrecomputation &group, const Element &i_base) +{ + m_base = group.NeedConversions() ? group.ConvertIn(i_base) : i_base; + + if (m_bases.empty() || !(m_base == m_bases[0])) + { + m_bases.resize(1); + m_bases[0] = m_base; + } + + if (group.NeedConversions()) + m_base = i_base; +} + +template void DL_FixedBasePrecomputationImpl::Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage) +{ + assert(m_bases.size() > 0); + assert(storage <= maxExpBits); + + if (storage > 1) + { + m_windowSize = (maxExpBits+storage-1)/storage; + m_exponentBase = Integer::Power2(m_windowSize); + } + + m_bases.resize(storage); + for (unsigned i=1; i void DL_FixedBasePrecomputationImpl::Load(const DL_GroupPrecomputation &group, BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + word32 version; + BERDecodeUnsigned(seq, version, INTEGER, 1, 1); + m_exponentBase.BERDecode(seq); + m_windowSize = m_exponentBase.BitCount() - 1; + m_bases.clear(); + while (!seq.EndReached()) + m_bases.push_back(group.BERDecodeElement(seq)); + if (!m_bases.empty() && group.NeedConversions()) + m_base = group.ConvertOut(m_bases[0]); + seq.MessageEnd(); +} + +template void DL_FixedBasePrecomputationImpl::Save(const DL_GroupPrecomputation &group, BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + DEREncodeUnsigned(seq, 1); // version + m_exponentBase.DEREncode(seq); + for (unsigned i=0; i void DL_FixedBasePrecomputationImpl::PrepareCascade(const DL_GroupPrecomputation &i_group, std::vector > &eb, const Integer &exponent) const +{ + const AbstractGroup &group = i_group.GetGroup(); + + Integer r, q, e = exponent; + bool fastNegate = group.InversionIsFast() && m_windowSize > 1; + unsigned int i; + + for (i=0; i+1(group.Inverse(m_bases[i]), m_exponentBase - r)); + } + else + eb.push_back(BaseAndExponent(m_bases[i], r)); + } + eb.push_back(BaseAndExponent(m_bases[i], e)); +} + +template T DL_FixedBasePrecomputationImpl::Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const +{ + std::vector > eb; // array of segments of the exponent and precalculated bases + eb.reserve(m_bases.size()); + PrepareCascade(group, eb, exponent); + return group.ConvertOut(GeneralCascadeMultiplication(group.GetGroup(), eb.begin(), eb.end())); +} + +template T + DL_FixedBasePrecomputationImpl::CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, + const DL_FixedBasePrecomputation &i_pc2, const Integer &exponent2) const +{ + std::vector > eb; // array of segments of the exponent and precalculated bases + const DL_FixedBasePrecomputationImpl &pc2 = static_cast &>(i_pc2); + eb.reserve(m_bases.size() + pc2.m_bases.size()); + PrepareCascade(group, eb, exponent); + pc2.PrepareCascade(group, eb, exponent2); + return group.ConvertOut(GeneralCascadeMultiplication(group.GetGroup(), eb.begin(), eb.end())); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/eprecomp.h b/external/crypto++-5.6.3/eprecomp.h new file mode 100644 index 000000000..9de2a5369 --- /dev/null +++ b/external/crypto++-5.6.3/eprecomp.h @@ -0,0 +1,93 @@ +// eprecomp.h - written and placed in the public domain by Wei Dai + +//! \file eprecomp.h +//! \brief Classes for precomputation in a group + +#ifndef CRYPTOPP_EPRECOMP_H +#define CRYPTOPP_EPRECOMP_H + +#include "cryptlib.h" +#include "integer.h" +#include "algebra.h" +#include "stdcpp.h" + +NAMESPACE_BEGIN(CryptoPP) + +template +class DL_GroupPrecomputation +{ +public: + typedef T Element; + + virtual bool NeedConversions() const {return false;} + virtual Element ConvertIn(const Element &v) const {return v;} + virtual Element ConvertOut(const Element &v) const {return v;} + virtual const AbstractGroup & GetGroup() const =0; + virtual Element BERDecodeElement(BufferedTransformation &bt) const =0; + virtual void DEREncodeElement(BufferedTransformation &bt, const Element &P) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupPrecomputation() {} +#endif +}; + +template +class DL_FixedBasePrecomputation +{ +public: + typedef T Element; + + virtual bool IsInitialized() const =0; + virtual void SetBase(const DL_GroupPrecomputation &group, const Element &base) =0; + virtual const Element & GetBase(const DL_GroupPrecomputation &group) const =0; + virtual void Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage) =0; + virtual void Load(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) =0; + virtual void Save(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) const =0; + virtual Element Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const =0; + virtual Element CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_FixedBasePrecomputation() {} +#endif +}; + +template +class DL_FixedBasePrecomputationImpl : public DL_FixedBasePrecomputation +{ +public: + typedef T Element; + + DL_FixedBasePrecomputationImpl() : m_windowSize(0) {} + + // DL_FixedBasePrecomputation + bool IsInitialized() const + {return !m_bases.empty();} + void SetBase(const DL_GroupPrecomputation &group, const Element &base); + const Element & GetBase(const DL_GroupPrecomputation &group) const + {return group.NeedConversions() ? m_base : m_bases[0];} + void Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage); + void Load(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation); + void Save(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) const; + Element Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const; + Element CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_FixedBasePrecomputationImpl() {} +#endif + +private: + void PrepareCascade(const DL_GroupPrecomputation &group, std::vector > &eb, const Integer &exponent) const; + + Element m_base; + unsigned int m_windowSize; + Integer m_exponentBase; // what base to represent the exponent in + std::vector m_bases; // precalculated bases +}; + +NAMESPACE_END + +#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#include "eprecomp.cpp" +#endif + +#endif diff --git a/external/crypto++-5.6.3/esign.cpp b/external/crypto++-5.6.3/esign.cpp new file mode 100644 index 000000000..74afe5770 --- /dev/null +++ b/external/crypto++-5.6.3/esign.cpp @@ -0,0 +1,221 @@ +// esign.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +// TODO: fix the C4589 warnings +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4589) +#endif + +#include "esign.h" +#include "modarith.h" +#include "integer.h" +#include "nbtheory.h" +#include "algparam.h" +#include "sha.h" +#include "asn.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void ESIGN_TestInstantiations() +{ + ESIGN::Verifier x1(1, 1); + ESIGN::Signer x2(NullRNG(), 1); + ESIGN::Verifier x3(x2); + ESIGN::Verifier x4(x2.GetKey()); + ESIGN::Verifier x5(x3); + ESIGN::Signer x6 = x2; + + x6 = x2; + x3 = ESIGN::Verifier(x2); + x4 = x2.GetKey(); +} +#endif + +void ESIGNFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + m_n.BERDecode(seq); + m_e.BERDecode(seq); + seq.MessageEnd(); +} + +void ESIGNFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_n.DEREncode(seq); + m_e.DEREncode(seq); + seq.MessageEnd(); +} + +Integer ESIGNFunction::ApplyFunction(const Integer &x) const +{ + DoQuickSanityCheck(); + return STDMIN(a_exp_b_mod_c(x, m_e, m_n) >> (2*GetK()+2), MaxImage()); +} + +bool ESIGNFunction::Validate(RandomNumberGenerator& rng, unsigned int level) const +{ + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level); + bool pass = true; + pass = pass && m_n > Integer::One() && m_n.IsOdd(); + pass = pass && m_e >= 8 && m_e < m_n; + return pass; +} + +bool ESIGNFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_GET_FUNCTION_ENTRY(PublicExponent) + ; +} + +void ESIGNFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_SET_FUNCTION_ENTRY(PublicExponent) + ; +} + +// ***************************************************************************** + +void InvertibleESIGNFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶m) +{ + int modulusSize = 1023*2; + param.GetIntValue("ModulusSize", modulusSize) || param.GetIntValue("KeySize", modulusSize); + + if (modulusSize < 24) + throw InvalidArgument("InvertibleESIGNFunction: specified modulus size is too small"); + + if (modulusSize % 3 != 0) + throw InvalidArgument("InvertibleESIGNFunction: modulus size must be divisible by 3"); + + m_e = param.GetValueWithDefault("PublicExponent", Integer(32)); + + if (m_e < 8) + throw InvalidArgument("InvertibleESIGNFunction: public exponents less than 8 may not be secure"); + + // VC70 workaround: putting these after primeParam causes overlapped stack allocation + ConstByteArrayParameter seedParam; + SecByteBlock seed; + + const Integer minP = Integer(204) << (modulusSize/3-8); + const Integer maxP = Integer::Power2(modulusSize/3)-1; + AlgorithmParameters primeParam = MakeParameters("Min", minP)("Max", maxP)("RandomNumberType", Integer::PRIME); + + if (param.GetValue("Seed", seedParam)) + { + seed.resize(seedParam.size() + 4); + memcpy(seed + 4, seedParam.begin(), seedParam.size()); + + PutWord(false, BIG_ENDIAN_ORDER, seed, (word32)0); + m_p.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("Seed", ConstByteArrayParameter(seed)))); + PutWord(false, BIG_ENDIAN_ORDER, seed, (word32)1); + m_q.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("Seed", ConstByteArrayParameter(seed)))); + } + else + { + m_p.GenerateRandom(rng, primeParam); + m_q.GenerateRandom(rng, primeParam); + } + + m_n = m_p * m_p * m_q; + + assert(m_n.BitCount() == (unsigned int)modulusSize); +} + +void InvertibleESIGNFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder privateKey(bt); + m_n.BERDecode(privateKey); + m_e.BERDecode(privateKey); + m_p.BERDecode(privateKey); + m_q.BERDecode(privateKey); + privateKey.MessageEnd(); +} + +void InvertibleESIGNFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder privateKey(bt); + m_n.DEREncode(privateKey); + m_e.DEREncode(privateKey); + m_p.DEREncode(privateKey); + m_q.DEREncode(privateKey); + privateKey.MessageEnd(); +} + +Integer InvertibleESIGNFunction::CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const +{ + DoQuickSanityCheck(); + + Integer pq = m_p * m_q; + Integer p2 = m_p * m_p; + Integer r, z, re, a, w0, w1; + + do + { + r.Randomize(rng, Integer::Zero(), pq); + z = x << (2*GetK()+2); + re = a_exp_b_mod_c(r, m_e, m_n); + a = (z - re) % m_n; + Integer::Divide(w1, w0, a, pq); + if (w1.NotZero()) + { + ++w0; + w1 = pq - w1; + } + } + while ((w1 >> (2*GetK()+1)).IsPositive()); + + ModularArithmetic modp(m_p); + Integer t = modp.Divide(w0 * r % m_p, m_e * re % m_p); + Integer s = r + t*pq; + assert(s < m_n); +#if 0 + using namespace std; + cout << "f = " << x << endl; + cout << "r = " << r << endl; + cout << "z = " << z << endl; + cout << "a = " << a << endl; + cout << "w0 = " << w0 << endl; + cout << "w1 = " << w1 << endl; + cout << "t = " << t << endl; + cout << "s = " << s << endl; +#endif + return s; +} + +bool InvertibleESIGNFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = ESIGNFunction::Validate(rng, level); + pass = pass && m_p > Integer::One() && m_p.IsOdd() && m_p < m_n; + pass = pass && m_q > Integer::One() && m_q.IsOdd() && m_q < m_n; + pass = pass && m_p.BitCount() == m_q.BitCount(); + if (level >= 1) + pass = pass && m_p * m_p * m_q == m_n; + if (level >= 2) + pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); + return pass; +} + +bool InvertibleESIGNFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) + ; +} + +void InvertibleESIGNFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) + ; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/esign.h b/external/crypto++-5.6.3/esign.h new file mode 100644 index 000000000..7ddbc8bb2 --- /dev/null +++ b/external/crypto++-5.6.3/esign.h @@ -0,0 +1,133 @@ +#ifndef CRYPTOPP_ESIGN_H +#define CRYPTOPP_ESIGN_H + +/** \file + This file contains classes that implement the + ESIGN signature schemes as defined in IEEE P1363a. +*/ + +#include "cryptlib.h" +#include "pubkey.h" +#include "integer.h" +#include "asn.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class ESIGNFunction : public TrapdoorFunction, public ASN1CryptoMaterial +{ + typedef ESIGNFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &e) + {m_n = n; m_e = e;} + + // PublicKey + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + // CryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // TrapdoorFunction + Integer ApplyFunction(const Integer &x) const; + Integer PreimageBound() const {return m_n;} + Integer ImageBound() const {return Integer::Power2(GetK());} + + // non-derived + const Integer & GetModulus() const {return m_n;} + const Integer & GetPublicExponent() const {return m_e;} + + void SetModulus(const Integer &n) {m_n = n;} + void SetPublicExponent(const Integer &e) {m_e = e;} + +protected: + // Covertiy finding on overflow. The library allows small values for research purposes. + unsigned int GetK() const {return SaturatingSubtract(m_n.BitCount()/3, 1U);} + + Integer m_n, m_e; +}; + +//! _ +class InvertibleESIGNFunction : public ESIGNFunction, public RandomizedTrapdoorFunctionInverse, public PrivateKey +{ + typedef InvertibleESIGNFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q) + {m_n = n; m_e = e; m_p = p; m_q = q;} + // generate a random private key + void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits) + {GenerateRandomWithKeySize(rng, modulusBits);} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const; + + // GeneratibleCryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + /*! parameters: (ModulusSize) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + const Integer& GetPrime1() const {return m_p;} + const Integer& GetPrime2() const {return m_q;} + + void SetPrime1(const Integer &p) {m_p = p;} + void SetPrime2(const Integer &q) {m_q = q;} + +protected: + Integer m_p, m_q; +}; + +//! _ +template +class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod +{ +public: + static const char *StaticAlgorithmName() {return "EMSA5";} + + void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const + { + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); + CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); + SecByteBlock digest(hash.DigestSize()); + hash.Final(digest); + size_t representativeByteLength = BitsToBytes(representativeBitLength); + T mgf; + mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.size(), false); + if (representativeBitLength % 8 != 0) + representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); + } +}; + +//! EMSA5, for use with ESIGN +struct P1363_EMSA5 : public SignatureStandard +{ + typedef EMSA5Pad SignatureMessageEncodingMethod; +}; + +struct ESIGN_Keys +{ + static std::string StaticAlgorithmName() {return "ESIGN";} + typedef ESIGNFunction PublicKey; + typedef InvertibleESIGNFunction PrivateKey; +}; + +//! ESIGN, as defined in IEEE P1363a +template +struct ESIGN : public TF_SS +{ +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/factory.h b/external/crypto++-5.6.3/factory.h new file mode 100644 index 000000000..cc2dd908a --- /dev/null +++ b/external/crypto++-5.6.3/factory.h @@ -0,0 +1,139 @@ +#ifndef CRYPTOPP_OBJFACT_H +#define CRYPTOPP_OBJFACT_H + +#include "cryptlib.h" +#include "misc.h" +#include "stdcpp.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +template +class ObjectFactory +{ +public: + virtual ~ObjectFactory () {} + virtual AbstractClass * CreateObject() const =0; +}; + +//! _ +template +class DefaultObjectFactory : public ObjectFactory +{ +public: + AbstractClass * CreateObject() const + { + return new ConcreteClass; + } +}; + +//! _ +template +class ObjectFactoryRegistry +{ +public: + class FactoryNotFound : public Exception + { + public: + FactoryNotFound(const char *name) : Exception(OTHER_ERROR, std::string("ObjectFactoryRegistry: could not find factory for algorithm ") + name) {} + }; + + ~ObjectFactoryRegistry() + { + for (CPP_TYPENAME Map::iterator i = m_map.begin(); i != m_map.end(); ++i) + { + delete (ObjectFactory *)i->second; + i->second = NULL; + } + } + + void RegisterFactory(const std::string &name, ObjectFactory *factory) + { + m_map[name] = factory; + } + + const ObjectFactory * GetFactory(const char *name) const + { + CPP_TYPENAME Map::const_iterator i = m_map.find(name); + return i == m_map.end() ? NULL : (ObjectFactory *)i->second; + } + + AbstractClass *CreateObject(const char *name) const + { + const ObjectFactory *factory = GetFactory(name); + if (!factory) + throw FactoryNotFound(name); + return factory->CreateObject(); + } + + // Return a vector containing the factory names. This is easier than returning an iterator. + // from Andrew Pitonyak + std::vector GetFactoryNames() const + { + std::vector names; + CPP_TYPENAME Map::const_iterator iter; + for (iter = m_map.begin(); iter != m_map.end(); ++iter) + names.push_back(iter->first); + return names; + } + + CRYPTOPP_NOINLINE static ObjectFactoryRegistry & Registry(CRYPTOPP_NOINLINE_DOTDOTDOT); + +private: + // use void * instead of ObjectFactory * to save code size + typedef std::map Map; + Map m_map; +}; + +template +ObjectFactoryRegistry & ObjectFactoryRegistry::Registry(CRYPTOPP_NOINLINE_DOTDOTDOT) +{ + static ObjectFactoryRegistry s_registry; + return s_registry; +} + +template +struct RegisterDefaultFactoryFor { +RegisterDefaultFactoryFor(const char *name=NULL) +{ + // BCB2006 workaround + std::string n = name ? std::string(name) : std::string(ConcreteClass::StaticAlgorithmName()); + ObjectFactoryRegistry::Registry(). + RegisterFactory(n, new DefaultObjectFactory); +}}; + +template +void RegisterAsymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + RegisterDefaultFactoryFor((const char *)name); + RegisterDefaultFactoryFor((const char *)name); +} + +template +void RegisterSignatureSchemeDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + RegisterDefaultFactoryFor((const char *)name); + RegisterDefaultFactoryFor((const char *)name); +} + +template +void RegisterSymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + RegisterDefaultFactoryFor((const char *)name); + RegisterDefaultFactoryFor((const char *)name); +} + +template +void RegisterAuthenticatedSymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + RegisterDefaultFactoryFor((const char *)name); + RegisterDefaultFactoryFor((const char *)name); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/files.cpp b/external/crypto++-5.6.3/files.cpp new file mode 100644 index 000000000..5818ea872 --- /dev/null +++ b/external/crypto++-5.6.3/files.cpp @@ -0,0 +1,258 @@ +// files.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "files.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void Files_TestInstantiations() +{ + FileStore f0; + FileSource f1; + FileSink f2; +} +#endif + +void FileStore::StoreInitialize(const NameValuePairs ¶meters) +{ + m_waiting = false; + m_stream = NULL; + m_file.release(); + + const char *fileName = NULL; +#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 + const wchar_t *fileNameWide = NULL; + if (!parameters.GetValue(Name::InputFileNameWide(), fileNameWide)) +#endif + if (!parameters.GetValue(Name::InputFileName(), fileName)) + { + parameters.GetValue(Name::InputStreamPointer(), m_stream); + return; + } + + std::ios::openmode binary = parameters.GetValueWithDefault(Name::InputBinaryMode(), true) ? std::ios::binary : std::ios::openmode(0); + m_file.reset(new std::ifstream); +#ifdef CRYPTOPP_UNIX_AVAILABLE + std::string narrowed; + if (fileNameWide) + fileName = (narrowed = StringNarrow(fileNameWide)).c_str(); +#endif +#if _MSC_VER >= 1400 + if (fileNameWide) + { + m_file->open(fileNameWide, std::ios::in | binary); + if (!*m_file) + throw OpenErr(StringNarrow(fileNameWide, false)); + } +#endif + if (fileName) + { + m_file->open(fileName, std::ios::in | binary); + if (!*m_file) + throw OpenErr(fileName); + } + m_stream = m_file.get(); +} + +lword FileStore::MaxRetrievable() const +{ + if (!m_stream) + return 0; + + std::streampos current = m_stream->tellg(); + std::streampos end = m_stream->seekg(0, std::ios::end).tellg(); + m_stream->seekg(current); + return end-current; +} + +size_t FileStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + if (!m_stream) + { + transferBytes = 0; + return 0; + } + + lword size=transferBytes; + transferBytes = 0; + + if (m_waiting) + goto output; + + while (size && m_stream->good()) + { + { + size_t spaceSize = 1024; + m_space = HelpCreatePutSpace(target, channel, 1, UnsignedMin(size_t(SIZE_MAX), size), spaceSize); + + m_stream->read((char *)m_space, (unsigned int)STDMIN(size, (lword)spaceSize)); + } + m_len = (size_t)m_stream->gcount(); + size_t blockedBytes; +output: + blockedBytes = target.ChannelPutModifiable2(channel, m_space, m_len, 0, blocking); + m_waiting = blockedBytes > 0; + if (m_waiting) + return blockedBytes; + size -= m_len; + transferBytes += m_len; + } + + if (!m_stream->good() && !m_stream->eof()) + throw ReadErr(); + + return 0; +} + +size_t FileStore::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + if (!m_stream) + return 0; + + if (begin == 0 && end == 1) + { + int result = m_stream->peek(); + if (result == std::char_traits::eof()) + return 0; + else + { + size_t blockedBytes = target.ChannelPut(channel, byte(result), blocking); + begin += 1-blockedBytes; + return blockedBytes; + } + } + + // TODO: figure out what happens on cin + std::streampos current = m_stream->tellg(); + std::streampos endPosition = m_stream->seekg(0, std::ios::end).tellg(); + std::streampos newPosition = current + static_cast(begin); + + if (newPosition >= endPosition) + { + m_stream->seekg(current); + return 0; // don't try to seek beyond the end of file + } + m_stream->seekg(newPosition); + try + { + assert(!m_waiting); + lword copyMax = end-begin; + size_t blockedBytes = const_cast(this)->TransferTo2(target, copyMax, channel, blocking); + begin += copyMax; + if (blockedBytes) + { + const_cast(this)->m_waiting = false; + return blockedBytes; + } + } + catch(...) + { + m_stream->clear(); + m_stream->seekg(current); + throw; + } + m_stream->clear(); + m_stream->seekg(current); + + return 0; +} + +lword FileStore::Skip(lword skipMax) +{ + if (!m_stream) + return 0; + + lword oldPos = m_stream->tellg(); + std::istream::off_type offset; + if (!SafeConvert(skipMax, offset)) + throw InvalidArgument("FileStore: maximum seek offset exceeded"); + m_stream->seekg(offset, std::ios::cur); + return (lword)m_stream->tellg() - oldPos; +} + +void FileSink::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_stream = NULL; + m_file.release(); + + const char *fileName = NULL; +#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 + const wchar_t *fileNameWide = NULL; + if (!parameters.GetValue(Name::OutputFileNameWide(), fileNameWide)) +#endif + if (!parameters.GetValue(Name::OutputFileName(), fileName)) + { + parameters.GetValue(Name::OutputStreamPointer(), m_stream); + return; + } + + std::ios::openmode binary = parameters.GetValueWithDefault(Name::OutputBinaryMode(), true) ? std::ios::binary : std::ios::openmode(0); + m_file.reset(new std::ofstream); +#ifdef CRYPTOPP_UNIX_AVAILABLE + std::string narrowed; + if (fileNameWide) + fileName = (narrowed = StringNarrow(fileNameWide)).c_str(); +#elif (CRYPTOPP_MSC_VERSION >= 1400) + if (fileNameWide) + { + m_file->open(fileNameWide, std::ios::out | std::ios::trunc | binary); + if (!*m_file) + throw OpenErr(StringNarrow(fileNameWide, false)); + } +#endif + if (fileName) + { + m_file->open(fileName, std::ios::out | std::ios::trunc | binary); + if (!*m_file) + throw OpenErr(fileName); + } + m_stream = m_file.get(); +} + +bool FileSink::IsolatedFlush(bool hardFlush, bool blocking) +{ + CRYPTOPP_UNUSED(hardFlush), CRYPTOPP_UNUSED(blocking); + if (!m_stream) + throw Err("FileSink: output stream not opened"); + + m_stream->flush(); + if (!m_stream->good()) + throw WriteErr(); + + return false; +} + +size_t FileSink::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) +{ + CRYPTOPP_UNUSED(blocking); + if (!m_stream) + throw Err("FileSink: output stream not opened"); + + while (length > 0) + { + std::streamsize size; + if (!SafeConvert(length, size)) + size = ((std::numeric_limits::max)()); + m_stream->write((const char *)inString, size); + inString += size; + length -= (size_t)size; + } + + if (messageEnd) + m_stream->flush(); + + if (!m_stream->good()) + throw WriteErr(); + + return 0; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/files.h b/external/crypto++-5.6.3/files.h new file mode 100644 index 000000000..d0c45746b --- /dev/null +++ b/external/crypto++-5.6.3/files.h @@ -0,0 +1,113 @@ +#ifndef CRYPTOPP_FILES_H +#define CRYPTOPP_FILES_H + +#include "cryptlib.h" +#include "filters.h" +#include "argnames.h" +#include "smartptr.h" + +#include +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! file-based implementation of Store interface +class CRYPTOPP_DLL FileStore : public Store, private FilterPutSpaceHelper, public NotCopyable +{ +public: + class Err : public Exception + { + public: + Err(const std::string &s) : Exception(IO_ERROR, s) {} + }; + class OpenErr : public Err {public: OpenErr(const std::string &filename) : Err("FileStore: error opening file for reading: " + filename) {}}; + class ReadErr : public Err {public: ReadErr() : Err("FileStore: error reading file") {}}; + + FileStore() : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) {} + FileStore(std::istream &in) : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) + {StoreInitialize(MakeParameters(Name::InputStreamPointer(), &in));} + FileStore(const char *filename) : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) + {StoreInitialize(MakeParameters(Name::InputFileName(), filename ? filename : ""));} +#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 + //! specify file with Unicode name. On non-Windows OS, this function assumes that setlocale() has been called. + FileStore(const wchar_t *filename) + {StoreInitialize(MakeParameters(Name::InputFileNameWide(), filename));} +#endif + + std::istream* GetStream() {return m_stream;} + + lword MaxRetrievable() const; + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + lword Skip(lword skipMax=ULONG_MAX); + +private: + void StoreInitialize(const NameValuePairs ¶meters); + + member_ptr m_file; + std::istream *m_stream; + byte *m_space; + size_t m_len; + bool m_waiting; +}; + +//! file-based implementation of Source interface +class CRYPTOPP_DLL FileSource : public SourceTemplate +{ +public: + typedef FileStore::Err Err; + typedef FileStore::OpenErr OpenErr; + typedef FileStore::ReadErr ReadErr; + + FileSource(BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) {} + FileSource(std::istream &in, bool pumpAll, BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters(Name::InputStreamPointer(), &in));} + FileSource(const char *filename, bool pumpAll, BufferedTransformation *attachment = NULL, bool binary=true) + : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters(Name::InputFileName(), filename)(Name::InputBinaryMode(), binary));} +#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 + //! specify file with Unicode name. On non-Windows OS, this function assumes that setlocale() has been called. + FileSource(const wchar_t *filename, bool pumpAll, BufferedTransformation *attachment = NULL, bool binary=true) + : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters(Name::InputFileNameWide(), filename)(Name::InputBinaryMode(), binary));} +#endif + + std::istream* GetStream() {return m_store.GetStream();} +}; + +//! file-based implementation of Sink interface +class CRYPTOPP_DLL FileSink : public Sink, public NotCopyable +{ +public: + class Err : public Exception + { + public: + Err(const std::string &s) : Exception(IO_ERROR, s) {} + }; + class OpenErr : public Err {public: OpenErr(const std::string &filename) : Err("FileSink: error opening file for writing: " + filename) {}}; + class WriteErr : public Err {public: WriteErr() : Err("FileSink: error writing file") {}}; + + FileSink() : m_stream(NULL) {} + FileSink(std::ostream &out) + {IsolatedInitialize(MakeParameters(Name::OutputStreamPointer(), &out));} + FileSink(const char *filename, bool binary=true) + {IsolatedInitialize(MakeParameters(Name::OutputFileName(), filename)(Name::OutputBinaryMode(), binary));} +#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 + //! specify file with Unicode name. On non-Windows OS, this function assumes that setlocale() has been called. + FileSink(const wchar_t *filename, bool binary=true) + {IsolatedInitialize(MakeParameters(Name::OutputFileNameWide(), filename)(Name::OutputBinaryMode(), binary));} +#endif + + std::ostream* GetStream() {return m_stream;} + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + bool IsolatedFlush(bool hardFlush, bool blocking); + +private: + member_ptr m_file; + std::ostream *m_stream; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/filters.cpp b/external/crypto++-5.6.3/filters.cpp new file mode 100644 index 000000000..280831521 --- /dev/null +++ b/external/crypto++-5.6.3/filters.cpp @@ -0,0 +1,1168 @@ +// filters.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100 4189) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunused-value" +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "filters.h" +#include "mqueue.h" +#include "fltrimpl.h" +#include "argnames.h" +#include "smartptr.h" +#include "stdcpp.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +Filter::Filter(BufferedTransformation *attachment) + : m_attachment(attachment), m_inputPosition(0), m_continueAt(0) +{ +} + +BufferedTransformation * Filter::NewDefaultAttachment() const +{ + return new MessageQueue; +} + +BufferedTransformation * Filter::AttachedTransformation() +{ + if (m_attachment.get() == NULL) + m_attachment.reset(NewDefaultAttachment()); + return m_attachment.get(); +} + +const BufferedTransformation *Filter::AttachedTransformation() const +{ + if (m_attachment.get() == NULL) + const_cast(this)->m_attachment.reset(NewDefaultAttachment()); + return m_attachment.get(); +} + +void Filter::Detach(BufferedTransformation *newOut) +{ + m_attachment.reset(newOut); +} + +void Filter::Insert(Filter *filter) +{ + filter->m_attachment.reset(m_attachment.release()); + m_attachment.reset(filter); +} + +size_t Filter::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + return AttachedTransformation()->CopyRangeTo2(target, begin, end, channel, blocking); +} + +size_t Filter::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + return AttachedTransformation()->TransferTo2(target, transferBytes, channel, blocking); +} + +void Filter::Initialize(const NameValuePairs ¶meters, int propagation) +{ + m_inputPosition = m_continueAt = 0; + IsolatedInitialize(parameters); + PropagateInitialize(parameters, propagation); +} + +bool Filter::Flush(bool hardFlush, int propagation, bool blocking) +{ + switch (m_continueAt) + { + case 0: + if (IsolatedFlush(hardFlush, blocking)) + return true; + // fall through + case 1: + if (OutputFlush(1, hardFlush, propagation, blocking)) + return true; + // fall through + default: ;; + } + return false; +} + +bool Filter::MessageSeriesEnd(int propagation, bool blocking) +{ + switch (m_continueAt) + { + case 0: + if (IsolatedMessageSeriesEnd(blocking)) + return true; + // fall through + case 1: + if (ShouldPropagateMessageSeriesEnd() && OutputMessageSeriesEnd(1, propagation, blocking)) + return true; + // fall through + default: ;; + } + return false; +} + +void Filter::PropagateInitialize(const NameValuePairs ¶meters, int propagation) +{ + if (propagation) + AttachedTransformation()->Initialize(parameters, propagation-1); +} + +size_t Filter::OutputModifiable(int outputSite, byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel) +{ + if (messageEnd) + messageEnd--; + size_t result = AttachedTransformation()->ChannelPutModifiable2(channel, inString, length, messageEnd, blocking); + m_continueAt = result ? outputSite : 0; + return result; +} + +size_t Filter::Output(int outputSite, const byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel) +{ + if (messageEnd) + messageEnd--; + size_t result = AttachedTransformation()->ChannelPut2(channel, inString, length, messageEnd, blocking); + m_continueAt = result ? outputSite : 0; + return result; +} + +bool Filter::OutputFlush(int outputSite, bool hardFlush, int propagation, bool blocking, const std::string &channel) +{ + if (propagation && AttachedTransformation()->ChannelFlush(channel, hardFlush, propagation-1, blocking)) + { + m_continueAt = outputSite; + return true; + } + m_continueAt = 0; + return false; +} + +bool Filter::OutputMessageSeriesEnd(int outputSite, int propagation, bool blocking, const std::string &channel) +{ + if (propagation && AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation-1, blocking)) + { + m_continueAt = outputSite; + return true; + } + m_continueAt = 0; + return false; +} + +// ************************************************************* + +void MeterFilter::ResetMeter() +{ + m_currentMessageBytes = m_totalBytes = m_currentSeriesMessages = m_totalMessages = m_totalMessageSeries = 0; + m_rangesToSkip.clear(); +} + +void MeterFilter::AddRangeToSkip(unsigned int message, lword position, lword size, bool sortNow) +{ + MessageRange r = {message, position, size}; + m_rangesToSkip.push_back(r); + if (sortNow) + std::sort(m_rangesToSkip.begin(), m_rangesToSkip.end()); +} + +size_t MeterFilter::PutMaybeModifiable(byte *begin, size_t length, int messageEnd, bool blocking, bool modifiable) +{ + if (!m_transparent) + return 0; + + size_t t; + FILTER_BEGIN; + + m_begin = begin; + m_length = length; + + while (m_length > 0 || messageEnd) + { + if (m_length > 0 && !m_rangesToSkip.empty() && m_rangesToSkip.front().message == m_totalMessages && m_currentMessageBytes + m_length > m_rangesToSkip.front().position) + { + FILTER_OUTPUT_MAYBE_MODIFIABLE(1, m_begin, t = (size_t)SaturatingSubtract(m_rangesToSkip.front().position, m_currentMessageBytes), false, modifiable); + + assert(t < m_length); + m_begin += t; + m_length -= t; + m_currentMessageBytes += t; + m_totalBytes += t; + + if (m_currentMessageBytes + m_length < m_rangesToSkip.front().position + m_rangesToSkip.front().size) + t = m_length; + else + { + t = (size_t)SaturatingSubtract(m_rangesToSkip.front().position + m_rangesToSkip.front().size, m_currentMessageBytes); + assert(t <= m_length); + m_rangesToSkip.pop_front(); + } + + m_begin += t; + m_length -= t; + m_currentMessageBytes += t; + m_totalBytes += t; + } + else + { + FILTER_OUTPUT_MAYBE_MODIFIABLE(2, m_begin, m_length, messageEnd, modifiable); + + m_currentMessageBytes += m_length; + m_totalBytes += m_length; + m_length = 0; + + if (messageEnd) + { + m_currentMessageBytes = 0; + m_currentSeriesMessages++; + m_totalMessages++; + messageEnd = false; + } + } + } + + FILTER_END_NO_MESSAGE_END; +} + +size_t MeterFilter::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + return PutMaybeModifiable(const_cast(begin), length, messageEnd, blocking, false); +} + +size_t MeterFilter::PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking) +{ + return PutMaybeModifiable(begin, length, messageEnd, blocking, true); +} + +bool MeterFilter::IsolatedMessageSeriesEnd(bool blocking) +{ + CRYPTOPP_UNUSED(blocking); + m_currentMessageBytes = 0; + m_currentSeriesMessages = 0; + m_totalMessageSeries++; + return false; +} + +// ************************************************************* + +void FilterWithBufferedInput::BlockQueue::ResetQueue(size_t blockSize, size_t maxBlocks) +{ + m_buffer.New(blockSize * maxBlocks); + m_blockSize = blockSize; + m_maxBlocks = maxBlocks; + m_size = 0; + m_begin = m_buffer; +} + +byte *FilterWithBufferedInput::BlockQueue::GetBlock() +{ + if (m_size >= m_blockSize) + { + byte *ptr = m_begin; + if ((m_begin+=m_blockSize) == m_buffer.end()) + m_begin = m_buffer; + m_size -= m_blockSize; + return ptr; + } + else + return NULL; +} + +byte *FilterWithBufferedInput::BlockQueue::GetContigousBlocks(size_t &numberOfBytes) +{ + numberOfBytes = STDMIN(numberOfBytes, STDMIN(size_t(m_buffer.end()-m_begin), m_size)); + byte *ptr = m_begin; + m_begin += numberOfBytes; + m_size -= numberOfBytes; + if (m_size == 0 || m_begin == m_buffer.end()) + m_begin = m_buffer; + return ptr; +} + +size_t FilterWithBufferedInput::BlockQueue::GetAll(byte *outString) +{ + // Avoid passing NULL pointer to memcpy + if (!outString) return 0; + + size_t size = m_size; + size_t numberOfBytes = m_maxBlocks*m_blockSize; + const byte *ptr = GetContigousBlocks(numberOfBytes); + memcpy(outString, ptr, numberOfBytes); + memcpy(outString+numberOfBytes, m_begin, m_size); + m_size = 0; + return size; +} + +void FilterWithBufferedInput::BlockQueue::Put(const byte *inString, size_t length) +{ + // Avoid passing NULL pointer to memcpy + if (!inString || !length) return; + + assert(m_size + length <= m_buffer.size()); + byte *end = (m_size < size_t(m_buffer.end()-m_begin)) ? m_begin + m_size : m_begin + m_size - m_buffer.size(); + size_t len = STDMIN(length, size_t(m_buffer.end()-end)); + memcpy(end, inString, len); + if (len < length) + memcpy(m_buffer, inString+len, length-len); + m_size += length; +} + +#if !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) +FilterWithBufferedInput::FilterWithBufferedInput() + : Filter(), m_firstSize(SIZE_MAX), m_blockSize(0), m_lastSize(SIZE_MAX), m_firstInputDone(false) +{ +} +#endif + +FilterWithBufferedInput::FilterWithBufferedInput(BufferedTransformation *attachment) + : Filter(attachment), m_firstSize(SIZE_MAX), m_blockSize(0), m_lastSize(SIZE_MAX), m_firstInputDone(false) +{ +} + +FilterWithBufferedInput::FilterWithBufferedInput(size_t firstSize, size_t blockSize, size_t lastSize, BufferedTransformation *attachment) + : Filter(attachment), m_firstSize(firstSize), m_blockSize(blockSize), m_lastSize(lastSize), m_firstInputDone(false) +{ + if (m_firstSize == SIZE_MAX || m_blockSize < 1 || m_lastSize == SIZE_MAX) + throw InvalidArgument("FilterWithBufferedInput: invalid buffer size"); + + m_queue.ResetQueue(1, m_firstSize); +} + +void FilterWithBufferedInput::IsolatedInitialize(const NameValuePairs ¶meters) +{ + InitializeDerivedAndReturnNewSizes(parameters, m_firstSize, m_blockSize, m_lastSize); + if (m_firstSize == SIZE_MAX || m_blockSize < 1 || m_lastSize == SIZE_MAX) + throw InvalidArgument("FilterWithBufferedInput: invalid buffer size"); + m_queue.ResetQueue(1, m_firstSize); + m_firstInputDone = false; +} + +bool FilterWithBufferedInput::IsolatedFlush(bool hardFlush, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("FilterWithBufferedInput"); + + if (hardFlush) + ForceNextPut(); + FlushDerived(); + + return false; +} + +size_t FilterWithBufferedInput::PutMaybeModifiable(byte *inString, size_t length, int messageEnd, bool blocking, bool modifiable) +{ + if (!blocking) + throw BlockingInputOnly("FilterWithBufferedInput"); + + if (length != 0) + { + size_t newLength = m_queue.CurrentSize() + length; + + if (!m_firstInputDone && newLength >= m_firstSize) + { + size_t len = m_firstSize - m_queue.CurrentSize(); + m_queue.Put(inString, len); + FirstPut(m_queue.GetContigousBlocks(m_firstSize)); + assert(m_queue.CurrentSize() == 0); + m_queue.ResetQueue(m_blockSize, (2*m_blockSize+m_lastSize-2)/m_blockSize); + + inString += len; + newLength -= m_firstSize; + m_firstInputDone = true; + } + + if (m_firstInputDone) + { + if (m_blockSize == 1) + { + while (newLength > m_lastSize && m_queue.CurrentSize() > 0) + { + size_t len = newLength - m_lastSize; + byte *ptr = m_queue.GetContigousBlocks(len); + NextPutModifiable(ptr, len); + newLength -= len; + } + + if (newLength > m_lastSize) + { + size_t len = newLength - m_lastSize; + NextPutMaybeModifiable(inString, len, modifiable); + inString += len; + newLength -= len; + } + } + else + { + while (newLength >= m_blockSize + m_lastSize && m_queue.CurrentSize() >= m_blockSize) + { + NextPutModifiable(m_queue.GetBlock(), m_blockSize); + newLength -= m_blockSize; + } + + if (newLength >= m_blockSize + m_lastSize && m_queue.CurrentSize() > 0) + { + assert(m_queue.CurrentSize() < m_blockSize); + size_t len = m_blockSize - m_queue.CurrentSize(); + m_queue.Put(inString, len); + inString += len; + NextPutModifiable(m_queue.GetBlock(), m_blockSize); + newLength -= m_blockSize; + } + + if (newLength >= m_blockSize + m_lastSize) + { + size_t len = RoundDownToMultipleOf(newLength - m_lastSize, m_blockSize); + NextPutMaybeModifiable(inString, len, modifiable); + inString += len; + newLength -= len; + } + } + } + + m_queue.Put(inString, newLength - m_queue.CurrentSize()); + } + + if (messageEnd) + { + if (!m_firstInputDone && m_firstSize==0) + FirstPut(NULL); + + SecByteBlock temp(m_queue.CurrentSize()); + m_queue.GetAll(temp); + LastPut(temp, temp.size()); + + m_firstInputDone = false; + m_queue.ResetQueue(1, m_firstSize); + + // Cast to void to supress Coverity finding + (void)Output(1, NULL, 0, messageEnd, blocking); + } + return 0; +} + +void FilterWithBufferedInput::ForceNextPut() +{ + if (!m_firstInputDone) + return; + + if (m_blockSize > 1) + { + while (m_queue.CurrentSize() >= m_blockSize) + NextPutModifiable(m_queue.GetBlock(), m_blockSize); + } + else + { + size_t len; + while ((len = m_queue.CurrentSize()) > 0) + NextPutModifiable(m_queue.GetContigousBlocks(len), len); + } +} + +void FilterWithBufferedInput::NextPutMultiple(const byte *inString, size_t length) +{ + assert(m_blockSize > 1); // m_blockSize = 1 should always override this function + while (length > 0) + { + assert(length >= m_blockSize); + NextPutSingle(inString); + inString += m_blockSize; + length -= m_blockSize; + } +} + +// ************************************************************* + +void Redirector::Initialize(const NameValuePairs ¶meters, int propagation) +{ + m_target = parameters.GetValueWithDefault("RedirectionTargetPointer", (BufferedTransformation*)NULL); + m_behavior = parameters.GetIntValueWithDefault("RedirectionBehavior", PASS_EVERYTHING); + + if (m_target && GetPassSignals()) + m_target->Initialize(parameters, propagation); +} + +// ************************************************************* + +ProxyFilter::ProxyFilter(BufferedTransformation *filter, size_t firstSize, size_t lastSize, BufferedTransformation *attachment) + : FilterWithBufferedInput(firstSize, 1, lastSize, attachment), m_filter(filter) +{ + if (m_filter.get()) + m_filter->Attach(new OutputProxy(*this, false)); +} + +bool ProxyFilter::IsolatedFlush(bool hardFlush, bool blocking) +{ + return m_filter.get() ? m_filter->Flush(hardFlush, -1, blocking) : false; +} + +void ProxyFilter::SetFilter(Filter *filter) +{ + m_filter.reset(filter); + if (filter) + { + OutputProxy *proxy; + member_ptr temp(proxy = new OutputProxy(*this, false)); + m_filter->TransferAllTo(*proxy); + m_filter->Attach(temp.release()); + } +} + +void ProxyFilter::NextPutMultiple(const byte *s, size_t len) +{ + if (m_filter.get()) + m_filter->Put(s, len); +} + +void ProxyFilter::NextPutModifiable(byte *s, size_t len) +{ + if (m_filter.get()) + m_filter->PutModifiable(s, len); +} + +// ************************************************************* + +void RandomNumberSink::IsolatedInitialize(const NameValuePairs ¶meters) +{ + parameters.GetRequiredParameter("RandomNumberSink", "RandomNumberGeneratorPointer", m_rng); +} + +size_t RandomNumberSink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); + m_rng->IncorporateEntropy(begin, length); + return 0; +} + +size_t ArraySink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); + + // Avoid passing NULL pointer to memcpy. Using memmove due to + // Valgrind finding on overlapping buffers. + size_t copied = 0; + if (m_buf && begin) + { + copied = STDMIN(length, SaturatingSubtract(m_size, m_total)); + memmove(m_buf+m_total, begin, copied); + } + m_total += copied; + return length - copied; +} + +byte * ArraySink::CreatePutSpace(size_t &size) +{ + size = SaturatingSubtract(m_size, m_total); + return m_buf + m_total; +} + +void ArraySink::IsolatedInitialize(const NameValuePairs ¶meters) +{ + ByteArrayParameter array; + if (!parameters.GetValue(Name::OutputBuffer(), array)) + throw InvalidArgument("ArraySink: missing OutputBuffer argument"); + m_buf = array.begin(); + m_size = array.size(); +} + +size_t ArrayXorSink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); + + // Avoid passing NULL pointer to xorbuf + size_t copied = 0; + if (m_buf && begin) + { + copied = STDMIN(length, SaturatingSubtract(m_size, m_total)); + xorbuf(m_buf+m_total, begin, copied); + } + m_total += copied; + return length - copied; +} + +// ************************************************************* + +StreamTransformationFilter::StreamTransformationFilter(StreamTransformation &c, BufferedTransformation *attachment, BlockPaddingScheme padding, bool allowAuthenticatedSymmetricCipher) + : FilterWithBufferedInput(attachment) + , m_cipher(c), m_padding(DEFAULT_PADDING), m_optimalBufferSize(0) +{ + assert(c.MinLastBlockSize() == 0 || c.MinLastBlockSize() > c.MandatoryBlockSize()); + + if (!allowAuthenticatedSymmetricCipher && dynamic_cast(&c) != 0) + throw InvalidArgument("StreamTransformationFilter: please use AuthenticatedEncryptionFilter and AuthenticatedDecryptionFilter for AuthenticatedSymmetricCipher"); + + IsolatedInitialize(MakeParameters(Name::BlockPaddingScheme(), padding)); +} + +size_t StreamTransformationFilter::LastBlockSize(StreamTransformation &c, BlockPaddingScheme padding) +{ + if (c.MinLastBlockSize() > 0) + return c.MinLastBlockSize(); + else if (c.MandatoryBlockSize() > 1 && !c.IsForwardTransformation() && padding != NO_PADDING && padding != ZEROS_PADDING) + return c.MandatoryBlockSize(); + else + return 0; +} + +void StreamTransformationFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) +{ + BlockPaddingScheme padding = parameters.GetValueWithDefault(Name::BlockPaddingScheme(), DEFAULT_PADDING); + bool isBlockCipher = (m_cipher.MandatoryBlockSize() > 1 && m_cipher.MinLastBlockSize() == 0); + + if (padding == DEFAULT_PADDING) + m_padding = isBlockCipher ? PKCS_PADDING : NO_PADDING; + else + m_padding = padding; + + if (!isBlockCipher && (m_padding == PKCS_PADDING || m_padding == ONE_AND_ZEROS_PADDING)) + throw InvalidArgument("StreamTransformationFilter: PKCS_PADDING and ONE_AND_ZEROS_PADDING cannot be used with " + m_cipher.AlgorithmName()); + + firstSize = 0; + blockSize = m_cipher.MandatoryBlockSize(); + lastSize = LastBlockSize(m_cipher, m_padding); +} + +void StreamTransformationFilter::FirstPut(const byte* inString) +{ + CRYPTOPP_UNUSED(inString); + m_optimalBufferSize = m_cipher.OptimalBlockSize(); + m_optimalBufferSize = (unsigned int)STDMAX(m_optimalBufferSize, RoundDownToMultipleOf(4096U, m_optimalBufferSize)); +} + +void StreamTransformationFilter::NextPutMultiple(const byte *inString, size_t length) +{ + if (!length) + return; + + size_t s = m_cipher.MandatoryBlockSize(); + + do + { + size_t len = m_optimalBufferSize; + byte *space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, s, length, len); + if (len < length) + { + if (len == m_optimalBufferSize) + len -= m_cipher.GetOptimalBlockSizeUsed(); + len = RoundDownToMultipleOf(len, s); + } + else + len = length; + m_cipher.ProcessString(space, inString, len); + AttachedTransformation()->PutModifiable(space, len); + inString += len; + length -= len; + } + while (length > 0); +} + +void StreamTransformationFilter::NextPutModifiable(byte *inString, size_t length) +{ + m_cipher.ProcessString(inString, length); + AttachedTransformation()->PutModifiable(inString, length); +} + +void StreamTransformationFilter::LastPut(const byte *inString, size_t length) +{ + byte *space = NULL; + + switch (m_padding) + { + case NO_PADDING: + case ZEROS_PADDING: + if (length > 0) + { + size_t minLastBlockSize = m_cipher.MinLastBlockSize(); + bool isForwardTransformation = m_cipher.IsForwardTransformation(); + + if (isForwardTransformation && m_padding == ZEROS_PADDING && (minLastBlockSize == 0 || length < minLastBlockSize)) + { + // do padding + size_t blockSize = STDMAX(minLastBlockSize, (size_t)m_cipher.MandatoryBlockSize()); + space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, blockSize); + if (inString) {memcpy(space, inString, length);} + memset(space + length, 0, blockSize - length); + m_cipher.ProcessLastBlock(space, space, blockSize); + AttachedTransformation()->Put(space, blockSize); + } + else + { + if (minLastBlockSize == 0) + { + if (isForwardTransformation) + throw InvalidDataFormat("StreamTransformationFilter: plaintext length is not a multiple of block size and NO_PADDING is specified"); + else + throw InvalidCiphertext("StreamTransformationFilter: ciphertext length is not a multiple of block size"); + } + + space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length, m_optimalBufferSize); + m_cipher.ProcessLastBlock(space, inString, length); + AttachedTransformation()->Put(space, length); + } + } + break; + + case PKCS_PADDING: + case ONE_AND_ZEROS_PADDING: + unsigned int s; + s = m_cipher.MandatoryBlockSize(); + assert(s > 1); + space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, s, m_optimalBufferSize); + if (m_cipher.IsForwardTransformation()) + { + assert(length < s); + if (inString) {memcpy(space, inString, length);} + if (m_padding == PKCS_PADDING) + { + assert(s < 256); + byte pad = byte(s-length); + memset(space+length, pad, s-length); + } + else + { + space[length] = 0x80; + memset(space+length+1, 0, s-length-1); + } + m_cipher.ProcessData(space, space, s); + AttachedTransformation()->Put(space, s); + } + else + { + if (length != s) + throw InvalidCiphertext("StreamTransformationFilter: ciphertext length is not a multiple of block size"); + m_cipher.ProcessData(space, inString, s); + if (m_padding == PKCS_PADDING) + { + byte pad = space[s-1]; + if (pad < 1 || pad > s || std::find_if(space+s-pad, space+s, std::bind2nd(std::not_equal_to(), pad)) != space+s) + throw InvalidCiphertext("StreamTransformationFilter: invalid PKCS #7 block padding found"); + length = s-pad; + } + else + { + while (length > 1 && space[length-1] == 0) + --length; + if (space[--length] != 0x80) + throw InvalidCiphertext("StreamTransformationFilter: invalid ones-and-zeros padding found"); + } + AttachedTransformation()->Put(space, length); + } + break; + + default: + assert(false); + } +} + +// ************************************************************* + +HashFilter::HashFilter(HashTransformation &hm, BufferedTransformation *attachment, bool putMessage, int truncatedDigestSize, const std::string &messagePutChannel, const std::string &hashPutChannel) + : m_hashModule(hm), m_putMessage(putMessage), m_digestSize(0), m_space(NULL) + , m_messagePutChannel(messagePutChannel), m_hashPutChannel(hashPutChannel) +{ + m_digestSize = truncatedDigestSize < 0 ? m_hashModule.DigestSize() : truncatedDigestSize; + Detach(attachment); +} + +void HashFilter::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_putMessage = parameters.GetValueWithDefault(Name::PutMessage(), false); + int s = parameters.GetIntValueWithDefault(Name::TruncatedDigestSize(), -1); + m_digestSize = s < 0 ? m_hashModule.DigestSize() : s; +} + +size_t HashFilter::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) +{ + FILTER_BEGIN; + if (m_putMessage) + FILTER_OUTPUT3(1, 0, inString, length, 0, m_messagePutChannel); + m_hashModule.Update(inString, length); + if (messageEnd) + { + { + size_t size; + m_space = HelpCreatePutSpace(*AttachedTransformation(), m_hashPutChannel, m_digestSize, m_digestSize, size = m_digestSize); + m_hashModule.TruncatedFinal(m_space, m_digestSize); + } + FILTER_OUTPUT3(2, 0, m_space, m_digestSize, messageEnd, m_hashPutChannel); + } + FILTER_END_NO_MESSAGE_END; +} + +// ************************************************************* + +HashVerificationFilter::HashVerificationFilter(HashTransformation &hm, BufferedTransformation *attachment, word32 flags, int truncatedDigestSize) + : FilterWithBufferedInput(attachment) + , m_hashModule(hm), m_flags(0), m_digestSize(0), m_verified(false) +{ + IsolatedInitialize(MakeParameters(Name::HashVerificationFilterFlags(), flags)(Name::TruncatedDigestSize(), truncatedDigestSize)); +} + +void HashVerificationFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) +{ + m_flags = parameters.GetValueWithDefault(Name::HashVerificationFilterFlags(), (word32)DEFAULT_FLAGS); + int s = parameters.GetIntValueWithDefault(Name::TruncatedDigestSize(), -1); + m_digestSize = s < 0 ? m_hashModule.DigestSize() : s; + m_verified = false; + firstSize = m_flags & HASH_AT_BEGIN ? m_digestSize : 0; + blockSize = 1; + lastSize = m_flags & HASH_AT_BEGIN ? 0 : m_digestSize; +} + +void HashVerificationFilter::FirstPut(const byte *inString) +{ + if (m_flags & HASH_AT_BEGIN) + { + m_expectedHash.New(m_digestSize); + if (inString) {memcpy(m_expectedHash, inString, m_expectedHash.size());} + if (m_flags & PUT_HASH) + AttachedTransformation()->Put(inString, m_expectedHash.size()); + } +} + +void HashVerificationFilter::NextPutMultiple(const byte *inString, size_t length) +{ + m_hashModule.Update(inString, length); + if (m_flags & PUT_MESSAGE) + AttachedTransformation()->Put(inString, length); +} + +void HashVerificationFilter::LastPut(const byte *inString, size_t length) +{ + if (m_flags & HASH_AT_BEGIN) + { + assert(length == 0); + m_verified = m_hashModule.TruncatedVerify(m_expectedHash, m_digestSize); + } + else + { + m_verified = (length==m_digestSize && m_hashModule.TruncatedVerify(inString, length)); + if (m_flags & PUT_HASH) + AttachedTransformation()->Put(inString, length); + } + + if (m_flags & PUT_RESULT) + AttachedTransformation()->Put(m_verified); + + if ((m_flags & THROW_EXCEPTION) && !m_verified) + throw HashVerificationFailed(); +} + +// ************************************************************* + +AuthenticatedEncryptionFilter::AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment, + bool putAAD, int truncatedDigestSize, const std::string &macChannel, BlockPaddingScheme padding) + : StreamTransformationFilter(c, attachment, padding, true) + , m_hf(c, new OutputProxy(*this, false), putAAD, truncatedDigestSize, AAD_CHANNEL, macChannel) +{ + assert(c.IsForwardTransformation()); +} + +void AuthenticatedEncryptionFilter::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_hf.IsolatedInitialize(parameters); + StreamTransformationFilter::IsolatedInitialize(parameters); +} + +byte * AuthenticatedEncryptionFilter::ChannelCreatePutSpace(const std::string &channel, size_t &size) +{ + if (channel.empty()) + return StreamTransformationFilter::CreatePutSpace(size); + + if (channel == AAD_CHANNEL) + return m_hf.CreatePutSpace(size); + + throw InvalidChannelName("AuthenticatedEncryptionFilter", channel); +} + +size_t AuthenticatedEncryptionFilter::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (channel.empty()) + return StreamTransformationFilter::Put2(begin, length, messageEnd, blocking); + + if (channel == AAD_CHANNEL) + return m_hf.Put2(begin, length, 0, blocking); + + throw InvalidChannelName("AuthenticatedEncryptionFilter", channel); +} + +void AuthenticatedEncryptionFilter::LastPut(const byte *inString, size_t length) +{ + StreamTransformationFilter::LastPut(inString, length); + m_hf.MessageEnd(); +} + +// ************************************************************* + +AuthenticatedDecryptionFilter::AuthenticatedDecryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment, word32 flags, int truncatedDigestSize, BlockPaddingScheme padding) + : FilterWithBufferedInput(attachment) + , m_hashVerifier(c, new OutputProxy(*this, false)) + , m_streamFilter(c, new OutputProxy(*this, false), padding, true) +{ + assert(!c.IsForwardTransformation() || c.IsSelfInverting()); + IsolatedInitialize(MakeParameters(Name::BlockPaddingScheme(), padding)(Name::AuthenticatedDecryptionFilterFlags(), flags)(Name::TruncatedDigestSize(), truncatedDigestSize)); +} + +void AuthenticatedDecryptionFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) +{ + word32 flags = parameters.GetValueWithDefault(Name::AuthenticatedDecryptionFilterFlags(), (word32)DEFAULT_FLAGS); + + m_hashVerifier.Initialize(CombinedNameValuePairs(parameters, MakeParameters(Name::HashVerificationFilterFlags(), flags))); + m_streamFilter.Initialize(parameters); + + firstSize = m_hashVerifier.m_firstSize; + blockSize = 1; + lastSize = m_hashVerifier.m_lastSize; +} + +byte * AuthenticatedDecryptionFilter::ChannelCreatePutSpace(const std::string &channel, size_t &size) +{ + if (channel.empty()) + return m_streamFilter.CreatePutSpace(size); + + if (channel == AAD_CHANNEL) + return m_hashVerifier.CreatePutSpace(size); + + throw InvalidChannelName("AuthenticatedDecryptionFilter", channel); +} + +size_t AuthenticatedDecryptionFilter::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (channel.empty()) + { + if (m_lastSize > 0) + m_hashVerifier.ForceNextPut(); + return FilterWithBufferedInput::Put2(begin, length, messageEnd, blocking); + } + + if (channel == AAD_CHANNEL) + return m_hashVerifier.Put2(begin, length, 0, blocking); + + throw InvalidChannelName("AuthenticatedDecryptionFilter", channel); +} + +void AuthenticatedDecryptionFilter::FirstPut(const byte *inString) +{ + m_hashVerifier.Put(inString, m_firstSize); +} + +void AuthenticatedDecryptionFilter::NextPutMultiple(const byte *inString, size_t length) +{ + m_streamFilter.Put(inString, length); +} + +void AuthenticatedDecryptionFilter::LastPut(const byte *inString, size_t length) +{ + m_streamFilter.MessageEnd(); + m_hashVerifier.PutMessageEnd(inString, length); +} + +// ************************************************************* + +void SignerFilter::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_putMessage = parameters.GetValueWithDefault(Name::PutMessage(), false); + m_messageAccumulator.reset(m_signer.NewSignatureAccumulator(m_rng)); +} + +size_t SignerFilter::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) +{ + FILTER_BEGIN; + m_messageAccumulator->Update(inString, length); + if (m_putMessage) + FILTER_OUTPUT(1, inString, length, 0); + if (messageEnd) + { + m_buf.New(m_signer.SignatureLength()); + m_signer.Sign(m_rng, m_messageAccumulator.release(), m_buf); + FILTER_OUTPUT(2, m_buf, m_buf.size(), messageEnd); + m_messageAccumulator.reset(m_signer.NewSignatureAccumulator(m_rng)); + } + FILTER_END_NO_MESSAGE_END; +} + +SignatureVerificationFilter::SignatureVerificationFilter(const PK_Verifier &verifier, BufferedTransformation *attachment, word32 flags) + : FilterWithBufferedInput(attachment) + , m_verifier(verifier), m_flags(0), m_verified(0) +{ + IsolatedInitialize(MakeParameters(Name::SignatureVerificationFilterFlags(), flags)); +} + +void SignatureVerificationFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) +{ + m_flags = parameters.GetValueWithDefault(Name::SignatureVerificationFilterFlags(), (word32)DEFAULT_FLAGS); + m_messageAccumulator.reset(m_verifier.NewVerificationAccumulator()); + size_t size = m_verifier.SignatureLength(); + assert(size != 0); // TODO: handle recoverable signature scheme + m_verified = false; + firstSize = m_flags & SIGNATURE_AT_BEGIN ? size : 0; + blockSize = 1; + lastSize = m_flags & SIGNATURE_AT_BEGIN ? 0 : size; +} + +void SignatureVerificationFilter::FirstPut(const byte *inString) +{ + if (m_flags & SIGNATURE_AT_BEGIN) + { + if (m_verifier.SignatureUpfront()) + m_verifier.InputSignature(*m_messageAccumulator, inString, m_verifier.SignatureLength()); + else + { + m_signature.New(m_verifier.SignatureLength()); + if (inString) {memcpy(m_signature, inString, m_signature.size());} + } + + if (m_flags & PUT_SIGNATURE) + AttachedTransformation()->Put(inString, m_signature.size()); + } + else + { + assert(!m_verifier.SignatureUpfront()); + } +} + +void SignatureVerificationFilter::NextPutMultiple(const byte *inString, size_t length) +{ + m_messageAccumulator->Update(inString, length); + if (m_flags & PUT_MESSAGE) + AttachedTransformation()->Put(inString, length); +} + +void SignatureVerificationFilter::LastPut(const byte *inString, size_t length) +{ + if (m_flags & SIGNATURE_AT_BEGIN) + { + assert(length == 0); + m_verifier.InputSignature(*m_messageAccumulator, m_signature, m_signature.size()); + m_verified = m_verifier.VerifyAndRestart(*m_messageAccumulator); + } + else + { + m_verifier.InputSignature(*m_messageAccumulator, inString, length); + m_verified = m_verifier.VerifyAndRestart(*m_messageAccumulator); + if (m_flags & PUT_SIGNATURE) + AttachedTransformation()->Put(inString, length); + } + + if (m_flags & PUT_RESULT) + AttachedTransformation()->Put(m_verified); + + if ((m_flags & THROW_EXCEPTION) && !m_verified) + throw SignatureVerificationFailed(); +} + +// ************************************************************* + +size_t Source::PumpAll2(bool blocking) +{ + unsigned int messageCount = UINT_MAX; + do { + RETURN_IF_NONZERO(PumpMessages2(messageCount, blocking)); + } while(messageCount == UINT_MAX); + + return 0; +} + +bool Store::GetNextMessage() +{ + if (!m_messageEnd && !AnyRetrievable()) + { + m_messageEnd=true; + return true; + } + else + return false; +} + +unsigned int Store::CopyMessagesTo(BufferedTransformation &target, unsigned int count, const std::string &channel) const +{ + if (m_messageEnd || count == 0) + return 0; + else + { + CopyTo(target, ULONG_MAX, channel); + if (GetAutoSignalPropagation()) + target.ChannelMessageEnd(channel, GetAutoSignalPropagation()-1); + return 1; + } +} + +void StringStore::StoreInitialize(const NameValuePairs ¶meters) +{ + ConstByteArrayParameter array; + if (!parameters.GetValue(Name::InputBuffer(), array)) + throw InvalidArgument("StringStore: missing InputBuffer argument"); + m_store = array.begin(); + m_length = array.size(); + m_count = 0; +} + +size_t StringStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + lword position = 0; + size_t blockedBytes = CopyRangeTo2(target, position, transferBytes, channel, blocking); + m_count += (size_t)position; + transferBytes = position; + return blockedBytes; +} + +size_t StringStore::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + size_t i = UnsignedMin(m_length, m_count+begin); + size_t len = UnsignedMin(m_length-i, end-begin); + size_t blockedBytes = target.ChannelPut2(channel, m_store+i, len, 0, blocking); + if (!blockedBytes) + begin += len; + return blockedBytes; +} + +void RandomNumberStore::StoreInitialize(const NameValuePairs ¶meters) +{ + parameters.GetRequiredParameter("RandomNumberStore", "RandomNumberGeneratorPointer", m_rng); + int length; + parameters.GetRequiredIntParameter("RandomNumberStore", "RandomNumberStoreSize", length); + m_length = length; +} + +size_t RandomNumberStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + if (!blocking) + throw NotImplemented("RandomNumberStore: nonblocking transfer is not implemented by this object"); + + transferBytes = UnsignedMin(transferBytes, m_length - m_count); + m_rng->GenerateIntoBufferedTransformation(target, channel, transferBytes); + m_count += transferBytes; + + return 0; +} + +size_t NullStore::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + static const byte nullBytes[128] = {0}; + while (begin < end) + { + size_t len = (size_t)STDMIN(end-begin, lword(128)); + size_t blockedBytes = target.ChannelPut2(channel, nullBytes, len, 0, blocking); + if (blockedBytes) + return blockedBytes; + begin += len; + } + return 0; +} + +size_t NullStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + lword begin = 0; + size_t blockedBytes = NullStore::CopyRangeTo2(target, begin, transferBytes, channel, blocking); + transferBytes = begin; + m_size -= begin; + return blockedBytes; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/filters.h b/external/crypto++-5.6.3/filters.h new file mode 100644 index 000000000..be9686697 --- /dev/null +++ b/external/crypto++-5.6.3/filters.h @@ -0,0 +1,979 @@ +// filters.h - written and placed in the public domain by Wei Dai + +//! \file filters.h +//! \brief Implementation of BufferedTransformation's attachment interface in cryptlib.h. +//! \nosubgrouping + +#ifndef CRYPTOPP_FILTERS_H +#define CRYPTOPP_FILTERS_H + +//! \file + +#include "cryptlib.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4127 4189) +#endif + +#include "cryptlib.h" +#include "simple.h" +#include "secblock.h" +#include "misc.h" +#include "smartptr.h" +#include "queue.h" +#include "algparam.h" +#include "stdcpp.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class Filter +//! \brief Implementation of BufferedTransformation's attachment interface +//! \details Filter is a cornerstone of the Pipeline trinitiy. Data flows from +//! Sources, through Filters, and then terminates in Sinks. The difference +//! between a Source and Filter is a Source \a pumps data, while a Filter does +//! not. The difference between a Filter and a Sink is a Filter allows an +//! attached transformation, while a Sink does not. +//! \details See the discussion of BufferedTransformation in cryptlib.h for +//! more details. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Filter : public BufferedTransformation, public NotCopyable +{ +public: + //! \brief Construct a Filter + //! \param attachment the filter's attached transformation + //! \details attachment can be \p NULL. + Filter(BufferedTransformation *attachment = NULL); + + //! \brief Determine if attachable + //! \returns \p true if the object allows attached transformations, \p false otherwise. + //! \note Source and Filter offer attached transformations; while Sink does not. + bool Attachable() {return true;} + + //! \brief Retrieve attached transformation + //! \returns pointer to a BufferedTransformation if there is an attached transformation, \p NULL otherwise. + BufferedTransformation *AttachedTransformation(); + + //! \brief Retrieve attached transformation + //! \returns pointer to a BufferedTransformation if there is an attached transformation, \p NULL otherwise. + const BufferedTransformation *AttachedTransformation() const; + + //! \brief Replace an attached transformation + //! \param newAttachment pointer to a new BufferedTransformation + //! \details newAttachment cab ne a single filter, a chain of filters or \p NULL. + //! Pass \p NULL to remove an existing BufferedTransformation or chain of filters + void Detach(BufferedTransformation *newAttachment = NULL); + + // See the documentation for BufferedTransformation in cryptlib.h + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + + // See the documentation for BufferedTransformation in cryptlib.h + void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1); + bool Flush(bool hardFlush, int propagation=-1, bool blocking=true); + bool MessageSeriesEnd(int propagation=-1, bool blocking=true); + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~Filter() {} +#endif + +protected: + virtual BufferedTransformation * NewDefaultAttachment() const; + void Insert(Filter *nextFilter); // insert filter after this one + + virtual bool ShouldPropagateMessageEnd() const {return true;} + virtual bool ShouldPropagateMessageSeriesEnd() const {return true;} + + void PropagateInitialize(const NameValuePairs ¶meters, int propagation); + + //! \brief Forward processed data on to attached transformation + //! \param outputSite unknown, system crash between keyboard and chair... + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one + //! \param blocking specifies whether the object should block when processing input + //! \param channel the channel to process the data + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed. + size_t Output(int outputSite, const byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL); + + //! \brief Output multiple bytes that may be modified by callee. + //! \param outputSite unknown, system crash between keyboard and chair... + //! \param inString the byte buffer to process + //! \param length the size of the string, in bytes + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one + //! \param blocking specifies whether the object should block when processing input + //! \param channel the channel to process the data + //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the + //! number of bytes that were \a not processed + size_t OutputModifiable(int outputSite, byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL); + + //! \brief Signals the end of messages to the object + //! \param outputSite unknown, system crash between keyboard and chair... + //! \param propagation the number of attached transformations the MessageEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \param channel the channel to process the data + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + bool OutputMessageEnd(int outputSite, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL); + + //! \brief Flush buffered input and/or output, with signal propagation + //! \param outputSite unknown, system crash between keyboard and chair... + //! \param hardFlush is used to indicate whether all data should be flushed + //! \param propagation the number of attached transformations the Flush() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \param channel the channel to process the data + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + //! \note Hard flushes must be used with care. It means try to process and output everything, even if + //! there may not be enough data to complete the action. For example, hard flushing a HexDecoder + //! would cause an error if you do it after inputing an odd number of hex encoded characters. + //! \note For some types of filters, like ZlibDecompressor, hard flushes can only + //! be done at "synchronization points". These synchronization points are positions in the data + //! stream that are created by hard flushes on the corresponding reverse filters, in this + //! example ZlibCompressor. This is useful when zlib compressed data is moved across a + //! network in packets and compression state is preserved across packets, as in the SSH2 protocol. + bool OutputFlush(int outputSite, bool hardFlush, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL); + + //! \brief Marks the end of a series of messages, with signal propagation + //! \param outputSite unknown, system crash between keyboard and chair... + //! \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed + //! \param blocking specifies whether the object should block when processing input + //! \param channel the channel to process the data + //! \details Each object that receives the signal will perform its processing, decrement + //! propagation, and then pass the signal on to attached transformations if the value is not 0. + //! \details propagation count includes this object. Setting propagation to 1 means this + //! object only. Setting propagation to -1 means unlimited propagation. + //! \note There should be a MessageEnd() immediately before MessageSeriesEnd(). + bool OutputMessageSeriesEnd(int outputSite, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL); + +private: + member_ptr m_attachment; + +protected: + size_t m_inputPosition; + int m_continueAt; +}; + +//! \struct FilterPutSpaceHelper + +struct CRYPTOPP_DLL FilterPutSpaceHelper +{ + // desiredSize is how much to ask target, bufferSize is how much to allocate in m_tempSpace + byte *HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t desiredSize, size_t &bufferSize) + { + assert(desiredSize >= minSize && bufferSize >= minSize); + if (m_tempSpace.size() < minSize) + { + byte *result = target.ChannelCreatePutSpace(channel, desiredSize); + if (desiredSize >= minSize) + { + bufferSize = desiredSize; + return result; + } + m_tempSpace.New(bufferSize); + } + + bufferSize = m_tempSpace.size(); + return m_tempSpace.begin(); + } + byte *HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize) + {return HelpCreatePutSpace(target, channel, minSize, minSize, minSize);} + byte *HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t bufferSize) + {return HelpCreatePutSpace(target, channel, minSize, minSize, bufferSize);} + SecByteBlock m_tempSpace; +}; + +//! measure how many byte and messages pass through, also serves as valve +class CRYPTOPP_DLL MeterFilter : public Bufferless +{ +public: + MeterFilter(BufferedTransformation *attachment=NULL, bool transparent=true) + : m_transparent(transparent), m_currentMessageBytes(0), m_totalBytes(0) + , m_currentSeriesMessages(0), m_totalMessages(0), m_totalMessageSeries(0) + , m_begin(NULL), m_length(0) {Detach(attachment); ResetMeter();} + + void SetTransparent(bool transparent) {m_transparent = transparent;} + void AddRangeToSkip(unsigned int message, lword position, lword size, bool sortNow = true); + void ResetMeter(); + void IsolatedInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters); ResetMeter();} + + lword GetCurrentMessageBytes() const {return m_currentMessageBytes;} + lword GetTotalBytes() {return m_totalBytes;} + unsigned int GetCurrentSeriesMessages() {return m_currentSeriesMessages;} + unsigned int GetTotalMessages() {return m_totalMessages;} + unsigned int GetTotalMessageSeries() {return m_totalMessageSeries;} + + byte * CreatePutSpace(size_t &size) + {return AttachedTransformation()->CreatePutSpace(size);} + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking); + bool IsolatedMessageSeriesEnd(bool blocking); + +private: + size_t PutMaybeModifiable(byte *inString, size_t length, int messageEnd, bool blocking, bool modifiable); + bool ShouldPropagateMessageEnd() const {return m_transparent;} + bool ShouldPropagateMessageSeriesEnd() const {return m_transparent;} + + struct MessageRange + { + inline bool operator<(const MessageRange &b) const // BCB2006 workaround: this has to be a member function + {return message < b.message || (message == b.message && position < b.position);} + unsigned int message; lword position; lword size; + }; + + bool m_transparent; + lword m_currentMessageBytes, m_totalBytes; + unsigned int m_currentSeriesMessages, m_totalMessages, m_totalMessageSeries; + std::deque m_rangesToSkip; + byte *m_begin; + size_t m_length; +}; + +//! _ +class CRYPTOPP_DLL TransparentFilter : public MeterFilter +{ +public: + TransparentFilter(BufferedTransformation *attachment=NULL) : MeterFilter(attachment, true) {} +}; + +//! _ +class CRYPTOPP_DLL OpaqueFilter : public MeterFilter +{ +public: + OpaqueFilter(BufferedTransformation *attachment=NULL) : MeterFilter(attachment, false) {} +}; + +/*! FilterWithBufferedInput divides up the input stream into + a first block, a number of middle blocks, and a last block. + First and last blocks are optional, and middle blocks may + be a stream instead (i.e. blockSize == 1). +*/ +class CRYPTOPP_DLL FilterWithBufferedInput : public Filter +{ +public: + +#if !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) + //! default FilterWithBufferedInput for temporaries + FilterWithBufferedInput(); +#endif + + //! construct a FilterWithBufferedInput with an attached transformation + FilterWithBufferedInput(BufferedTransformation *attachment); + //! firstSize and lastSize may be 0, blockSize must be at least 1 + FilterWithBufferedInput(size_t firstSize, size_t blockSize, size_t lastSize, BufferedTransformation *attachment); + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + { + return PutMaybeModifiable(const_cast(inString), length, messageEnd, blocking, false); + } + size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking) + { + return PutMaybeModifiable(inString, length, messageEnd, blocking, true); + } + /*! calls ForceNextPut() if hardFlush is true */ + bool IsolatedFlush(bool hardFlush, bool blocking); + + /*! The input buffer may contain more than blockSize bytes if lastSize != 0. + ForceNextPut() forces a call to NextPut() if this is the case. + */ + void ForceNextPut(); + +protected: + bool DidFirstPut() {return m_firstInputDone;} + + virtual void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) + {CRYPTOPP_UNUSED(parameters); CRYPTOPP_UNUSED(firstSize); CRYPTOPP_UNUSED(blockSize); CRYPTOPP_UNUSED(lastSize); InitializeDerived(parameters);} + virtual void InitializeDerived(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters);} + // FirstPut() is called if (firstSize != 0 and totalLength >= firstSize) + // or (firstSize == 0 and (totalLength > 0 or a MessageEnd() is received)) + virtual void FirstPut(const byte *inString) =0; + // NextPut() is called if totalLength >= firstSize+blockSize+lastSize + virtual void NextPutSingle(const byte *inString) + {CRYPTOPP_UNUSED(inString); assert(false);} + // Same as NextPut() except length can be a multiple of blockSize + // Either NextPut() or NextPutMultiple() must be overriden + virtual void NextPutMultiple(const byte *inString, size_t length); + // Same as NextPutMultiple(), but inString can be modified + virtual void NextPutModifiable(byte *inString, size_t length) + {NextPutMultiple(inString, length);} + // LastPut() is always called + // if totalLength < firstSize then length == totalLength + // else if totalLength <= firstSize+lastSize then length == totalLength-firstSize + // else lastSize <= length < lastSize+blockSize + virtual void LastPut(const byte *inString, size_t length) =0; + virtual void FlushDerived() {} + +protected: + size_t PutMaybeModifiable(byte *begin, size_t length, int messageEnd, bool blocking, bool modifiable); + void NextPutMaybeModifiable(byte *inString, size_t length, bool modifiable) + { + if (modifiable) NextPutModifiable(inString, length); + else NextPutMultiple(inString, length); + } + + // This function should no longer be used, put this here to cause a compiler error + // if someone tries to override NextPut(). + virtual int NextPut(const byte *inString, size_t length) + {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); assert(false); return 0;} + + class BlockQueue + { + public: + void ResetQueue(size_t blockSize, size_t maxBlocks); + byte *GetBlock(); + byte *GetContigousBlocks(size_t &numberOfBytes); + size_t GetAll(byte *outString); + void Put(const byte *inString, size_t length); + size_t CurrentSize() const {return m_size;} + size_t MaxSize() const {return m_buffer.size();} + + private: + SecByteBlock m_buffer; + size_t m_blockSize, m_maxBlocks, m_size; + byte *m_begin; + }; + + size_t m_firstSize, m_blockSize, m_lastSize; + bool m_firstInputDone; + BlockQueue m_queue; +}; + +//! _ +class CRYPTOPP_DLL FilterWithInputQueue : public Filter +{ +public: + FilterWithInputQueue(BufferedTransformation *attachment=NULL) : Filter(attachment) {} + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + { + if (!blocking) + throw BlockingInputOnly("FilterWithInputQueue"); + + m_inQueue.Put(inString, length); + if (messageEnd) + { + IsolatedMessageEnd(blocking); + Output(0, NULL, 0, messageEnd, blocking); + } + return 0; + } + +protected: + virtual bool IsolatedMessageEnd(bool blocking) =0; + void IsolatedInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters); m_inQueue.Clear();} + + ByteQueue m_inQueue; +}; + +//! \struct BlockPaddingSchemeDef +//! \details Padding schemes used for block ciphers. +struct BlockPaddingSchemeDef +{ + //! \enum BlockPaddingScheme + //! \details Padding schemes used for block ciphers. + //! \details DEFAULT_PADDING means PKCS_PADDING if cipher.MandatoryBlockSize() > 1 && + //! cipher.MinLastBlockSize() == 0, which holds for ECB or CBC mode. Otherwise, + //! NO_PADDING for modes like OFB, CFB, CTR, CBC-CTS. + //! \sa Block Cipher Padding for + //! additional details. + enum BlockPaddingScheme { + //! \brief No padding added to a block + NO_PADDING, + //! \brief 0's padding added to a block + ZEROS_PADDING, + //! \brief PKCS #5 padding added to a block + PKCS_PADDING, + //! \brief 1 and 0's padding added to a block + ONE_AND_ZEROS_PADDING, + //! \brief Default padding acheme + DEFAULT_PADDING + }; +}; + +//! Filter Wrapper for StreamTransformation, optionally handling padding/unpadding when needed +class CRYPTOPP_DLL StreamTransformationFilter : public FilterWithBufferedInput, public BlockPaddingSchemeDef, private FilterPutSpaceHelper +{ +public: + StreamTransformationFilter(StreamTransformation &c, BufferedTransformation *attachment = NULL, BlockPaddingScheme padding = DEFAULT_PADDING, bool allowAuthenticatedSymmetricCipher = false); + + std::string AlgorithmName() const {return m_cipher.AlgorithmName();} + +protected: + void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); + void FirstPut(const byte *inString); + void NextPutMultiple(const byte *inString, size_t length); + void NextPutModifiable(byte *inString, size_t length); + void LastPut(const byte *inString, size_t length); + + static size_t LastBlockSize(StreamTransformation &c, BlockPaddingScheme padding); + + StreamTransformation &m_cipher; + BlockPaddingScheme m_padding; + unsigned int m_optimalBufferSize; +}; + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY +typedef StreamTransformationFilter StreamCipherFilter; +#endif + +//! Filter Wrapper for HashTransformation +class CRYPTOPP_DLL HashFilter : public Bufferless, private FilterPutSpaceHelper +{ +public: + HashFilter(HashTransformation &hm, BufferedTransformation *attachment = NULL, bool putMessage=false, int truncatedDigestSize=-1, const std::string &messagePutChannel=DEFAULT_CHANNEL, const std::string &hashPutChannel=DEFAULT_CHANNEL); + + std::string AlgorithmName() const {return m_hashModule.AlgorithmName();} + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + byte * CreatePutSpace(size_t &size) {return m_hashModule.CreateUpdateSpace(size);} + +private: + HashTransformation &m_hashModule; + bool m_putMessage; + unsigned int m_digestSize; + byte *m_space; + std::string m_messagePutChannel, m_hashPutChannel; +}; + +//! Filter Wrapper for HashTransformation +class CRYPTOPP_DLL HashVerificationFilter : public FilterWithBufferedInput +{ +public: + class HashVerificationFailed : public Exception + { + public: + HashVerificationFailed() + : Exception(DATA_INTEGRITY_CHECK_FAILED, "HashVerificationFilter: message hash or MAC not valid") {} + }; + + enum Flags {HASH_AT_END=0, HASH_AT_BEGIN=1, PUT_MESSAGE=2, PUT_HASH=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = HASH_AT_BEGIN | PUT_RESULT}; + HashVerificationFilter(HashTransformation &hm, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS, int truncatedDigestSize=-1); + + std::string AlgorithmName() const {return m_hashModule.AlgorithmName();} + bool GetLastResult() const {return m_verified;} + +protected: + void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); + void FirstPut(const byte *inString); + void NextPutMultiple(const byte *inString, size_t length); + void LastPut(const byte *inString, size_t length); + +private: + friend class AuthenticatedDecryptionFilter; + + HashTransformation &m_hashModule; + word32 m_flags; + unsigned int m_digestSize; + bool m_verified; + SecByteBlock m_expectedHash; +}; + +typedef HashVerificationFilter HashVerifier; // for backwards compatibility + +//! Filter wrapper for encrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpadding when needed +/*! Additional authenticated data should be given in channel "AAD". If putAAD is true, AAD will be Put() to the attached BufferedTransformation in channel "AAD". */ +class CRYPTOPP_DLL AuthenticatedEncryptionFilter : public StreamTransformationFilter +{ +public: + /*! See StreamTransformationFilter for documentation on BlockPaddingScheme */ + AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, bool putAAD=false, int truncatedDigestSize=-1, const std::string &macChannel=DEFAULT_CHANNEL, BlockPaddingScheme padding = DEFAULT_PADDING); + + void IsolatedInitialize(const NameValuePairs ¶meters); + byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); + void LastPut(const byte *inString, size_t length); + +protected: + HashFilter m_hf; +}; + +//! Filter wrapper for decrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpadding when needed +/*! Additional authenticated data should be given in channel "AAD". */ +class CRYPTOPP_DLL AuthenticatedDecryptionFilter : public FilterWithBufferedInput, public BlockPaddingSchemeDef +{ +public: + enum Flags {MAC_AT_END=0, MAC_AT_BEGIN=1, THROW_EXCEPTION=16, DEFAULT_FLAGS = THROW_EXCEPTION}; + + /*! See StreamTransformationFilter for documentation on BlockPaddingScheme */ + AuthenticatedDecryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS, int truncatedDigestSize=-1, BlockPaddingScheme padding = DEFAULT_PADDING); + + std::string AlgorithmName() const {return m_hashVerifier.AlgorithmName();} + byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); + bool GetLastResult() const {return m_hashVerifier.GetLastResult();} + +protected: + void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); + void FirstPut(const byte *inString); + void NextPutMultiple(const byte *inString, size_t length); + void LastPut(const byte *inString, size_t length); + + HashVerificationFilter m_hashVerifier; + StreamTransformationFilter m_streamFilter; +}; + +//! Filter Wrapper for PK_Signer +class CRYPTOPP_DLL SignerFilter : public Unflushable +{ +public: + SignerFilter(RandomNumberGenerator &rng, const PK_Signer &signer, BufferedTransformation *attachment = NULL, bool putMessage=false) + : m_rng(rng), m_signer(signer), m_messageAccumulator(signer.NewSignatureAccumulator(rng)), m_putMessage(putMessage) {Detach(attachment);} + + std::string AlgorithmName() const {return m_signer.AlgorithmName();} + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + +private: + RandomNumberGenerator &m_rng; + const PK_Signer &m_signer; + member_ptr m_messageAccumulator; + bool m_putMessage; + SecByteBlock m_buf; +}; + +//! Filter Wrapper for PK_Verifier +class CRYPTOPP_DLL SignatureVerificationFilter : public FilterWithBufferedInput +{ +public: + class SignatureVerificationFailed : public Exception + { + public: + SignatureVerificationFailed() + : Exception(DATA_INTEGRITY_CHECK_FAILED, "VerifierFilter: digital signature not valid") {} + }; + + enum Flags {SIGNATURE_AT_END=0, SIGNATURE_AT_BEGIN=1, PUT_MESSAGE=2, PUT_SIGNATURE=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = SIGNATURE_AT_BEGIN | PUT_RESULT}; + SignatureVerificationFilter(const PK_Verifier &verifier, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS); + + std::string AlgorithmName() const {return m_verifier.AlgorithmName();} + + bool GetLastResult() const {return m_verified;} + +protected: + void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); + void FirstPut(const byte *inString); + void NextPutMultiple(const byte *inString, size_t length); + void LastPut(const byte *inString, size_t length); + +private: + const PK_Verifier &m_verifier; + member_ptr m_messageAccumulator; + word32 m_flags; + SecByteBlock m_signature; + bool m_verified; +}; + +typedef SignatureVerificationFilter VerifierFilter; // for backwards compatibility + +//! Redirect input to another BufferedTransformation without owning it +class CRYPTOPP_DLL Redirector : public CustomSignalPropagation +{ +public: + //! \brief Controls signal propagation behavior + enum Behavior + { + //! \brief Pass data only + DATA_ONLY = 0x00, + //! \brief Pass signals + PASS_SIGNALS = 0x01, + //! \brief Pass wait events + PASS_WAIT_OBJECTS = 0x02, + //! \brief Pass everything + //! \details PASS_EVERYTHING is default + PASS_EVERYTHING = PASS_SIGNALS | PASS_WAIT_OBJECTS + }; + + Redirector() : m_target(NULL), m_behavior(PASS_EVERYTHING) {} + Redirector(BufferedTransformation &target, Behavior behavior=PASS_EVERYTHING) + : m_target(&target), m_behavior(behavior) {} + + void Redirect(BufferedTransformation &target) {m_target = ⌖} + void StopRedirection() {m_target = NULL;} + + Behavior GetBehavior() {return (Behavior) m_behavior;} + void SetBehavior(Behavior behavior) {m_behavior=behavior;} + bool GetPassSignals() const {return (m_behavior & PASS_SIGNALS) != 0;} + void SetPassSignals(bool pass) { if (pass) m_behavior |= PASS_SIGNALS; else m_behavior &= ~(word32) PASS_SIGNALS; } + bool GetPassWaitObjects() const {return (m_behavior & PASS_WAIT_OBJECTS) != 0;} + void SetPassWaitObjects(bool pass) { if (pass) m_behavior |= PASS_WAIT_OBJECTS; else m_behavior &= ~(word32) PASS_WAIT_OBJECTS; } + + bool CanModifyInput() const + {return m_target ? m_target->CanModifyInput() : false;} + + void Initialize(const NameValuePairs ¶meters, int propagation); + byte * CreatePutSpace(size_t &size) + {return m_target ? m_target->CreatePutSpace(size) : (byte *)(size=0, NULL);} + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + {return m_target ? m_target->Put2(inString, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;} + bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) + {return m_target && GetPassSignals() ? m_target->Flush(hardFlush, propagation, blocking) : false;} + bool MessageSeriesEnd(int propagation=-1, bool blocking=true) + {return m_target && GetPassSignals() ? m_target->MessageSeriesEnd(propagation, blocking) : false;} + + byte * ChannelCreatePutSpace(const std::string &channel, size_t &size) + {return m_target ? m_target->ChannelCreatePutSpace(channel, size) : (byte *)(size=0, NULL);} + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) + {return m_target ? m_target->ChannelPut2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;} + size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) + {return m_target ? m_target->ChannelPutModifiable2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;} + bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true) + {return m_target && GetPassSignals() ? m_target->ChannelFlush(channel, completeFlush, propagation, blocking) : false;} + bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true) + {return m_target && GetPassSignals() ? m_target->ChannelMessageSeriesEnd(channel, propagation, blocking) : false;} + + unsigned int GetMaxWaitObjectCount() const + { return m_target && GetPassWaitObjects() ? m_target->GetMaxWaitObjectCount() : 0; } + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) + { if (m_target && GetPassWaitObjects()) m_target->GetWaitObjects(container, callStack); } + +private: + BufferedTransformation *m_target; + word32 m_behavior; +}; + +// Used By ProxyFilter +class CRYPTOPP_DLL OutputProxy : public CustomSignalPropagation +{ +public: + OutputProxy(BufferedTransformation &owner, bool passSignal) : m_owner(owner), m_passSignal(passSignal) {} + + bool GetPassSignal() const {return m_passSignal;} + void SetPassSignal(bool passSignal) {m_passSignal = passSignal;} + + byte * CreatePutSpace(size_t &size) + {return m_owner.AttachedTransformation()->CreatePutSpace(size);} + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + {return m_owner.AttachedTransformation()->Put2(inString, length, m_passSignal ? messageEnd : 0, blocking);} + size_t PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking) + {return m_owner.AttachedTransformation()->PutModifiable2(begin, length, m_passSignal ? messageEnd : 0, blocking);} + void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1) + {if (m_passSignal) m_owner.AttachedTransformation()->Initialize(parameters, propagation);} + bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) + {return m_passSignal ? m_owner.AttachedTransformation()->Flush(hardFlush, propagation, blocking) : false;} + bool MessageSeriesEnd(int propagation=-1, bool blocking=true) + {return m_passSignal ? m_owner.AttachedTransformation()->MessageSeriesEnd(propagation, blocking) : false;} + + byte * ChannelCreatePutSpace(const std::string &channel, size_t &size) + {return m_owner.AttachedTransformation()->ChannelCreatePutSpace(channel, size);} + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) + {return m_owner.AttachedTransformation()->ChannelPut2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);} + size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) + {return m_owner.AttachedTransformation()->ChannelPutModifiable2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);} + bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true) + {return m_passSignal ? m_owner.AttachedTransformation()->ChannelFlush(channel, completeFlush, propagation, blocking) : false;} + bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true) + {return m_passSignal ? m_owner.AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation, blocking) : false;} + +private: + BufferedTransformation &m_owner; + bool m_passSignal; +}; + +//! Base class for Filter classes that are proxies for a chain of other filters. +class CRYPTOPP_DLL ProxyFilter : public FilterWithBufferedInput +{ +public: + ProxyFilter(BufferedTransformation *filter, size_t firstSize, size_t lastSize, BufferedTransformation *attachment); + + bool IsolatedFlush(bool hardFlush, bool blocking); + + void SetFilter(Filter *filter); + void NextPutMultiple(const byte *s, size_t len); + void NextPutModifiable(byte *inString, size_t length); + +protected: + member_ptr m_filter; +}; + +//! simple proxy filter that doesn't modify the underlying filter's input or output +class CRYPTOPP_DLL SimpleProxyFilter : public ProxyFilter +{ +public: + SimpleProxyFilter(BufferedTransformation *filter, BufferedTransformation *attachment) + : ProxyFilter(filter, 0, 0, attachment) {} + + void FirstPut(const byte *) {} + void LastPut(const byte *, size_t) {m_filter->MessageEnd();} +}; + +//! proxy for the filter created by PK_Encryptor::CreateEncryptionFilter +/*! This class is here just to provide symmetry with VerifierFilter. */ +class CRYPTOPP_DLL PK_EncryptorFilter : public SimpleProxyFilter +{ +public: + PK_EncryptorFilter(RandomNumberGenerator &rng, const PK_Encryptor &encryptor, BufferedTransformation *attachment = NULL) + : SimpleProxyFilter(encryptor.CreateEncryptionFilter(rng), attachment) {} +}; + +//! proxy for the filter created by PK_Decryptor::CreateDecryptionFilter +/*! This class is here just to provide symmetry with SignerFilter. */ +class CRYPTOPP_DLL PK_DecryptorFilter : public SimpleProxyFilter +{ +public: + PK_DecryptorFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment = NULL) + : SimpleProxyFilter(decryptor.CreateDecryptionFilter(rng), attachment) {} +}; + +//! Append input to a string object +template +class StringSinkTemplate : public Bufferless +{ +public: + // VC60 workaround: no T::char_type + typedef typename T::traits_type::char_type char_type; + + StringSinkTemplate(T &output) + : m_output(&output) {assert(sizeof(output[0])==1);} + + void IsolatedInitialize(const NameValuePairs ¶meters) + {if (!parameters.GetValue("OutputStringPointer", m_output)) throw InvalidArgument("StringSink: OutputStringPointer not specified");} + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + { + CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); + if (length > 0) + { + typename T::size_type size = m_output->size(); + if (length < size && size + length > m_output->capacity()) + m_output->reserve(2*size); + m_output->append((const char_type *)inString, (const char_type *)inString+length); + } + return 0; + } + +private: + T *m_output; +}; + +//! Append input to an std::string +CRYPTOPP_DLL_TEMPLATE_CLASS StringSinkTemplate; +typedef StringSinkTemplate StringSink; + +//! incorporates input into RNG as additional entropy +class RandomNumberSink : public Bufferless +{ +public: + RandomNumberSink() + : m_rng(NULL) {} + + RandomNumberSink(RandomNumberGenerator &rng) + : m_rng(&rng) {} + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + +private: + RandomNumberGenerator *m_rng; +}; + +//! Copy input to a memory buffer +class CRYPTOPP_DLL ArraySink : public Bufferless +{ +public: + ArraySink(const NameValuePairs ¶meters = g_nullNameValuePairs) + : m_buf(NULL), m_size(0), m_total(0) {IsolatedInitialize(parameters);} + ArraySink(byte *buf, size_t size) + : m_buf(buf), m_size(size), m_total(0) {} + + size_t AvailableSize() {return SaturatingSubtract(m_size, m_total);} + lword TotalPutLength() {return m_total;} + + void IsolatedInitialize(const NameValuePairs ¶meters); + byte * CreatePutSpace(size_t &size); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + +protected: + byte *m_buf; + size_t m_size; + lword m_total; +}; + +//! Xor input to a memory buffer +class CRYPTOPP_DLL ArrayXorSink : public ArraySink +{ +public: + ArrayXorSink(byte *buf, size_t size) + : ArraySink(buf, size) {} + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + byte * CreatePutSpace(size_t &size) {return BufferedTransformation::CreatePutSpace(size);} +}; + +//! string-based implementation of Store interface +class StringStore : public Store +{ +public: + StringStore(const char *string = NULL) + {StoreInitialize(MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} + StringStore(const byte *string, size_t length) + {StoreInitialize(MakeParameters("InputBuffer", ConstByteArrayParameter(string, length)));} + template StringStore(const T &string) + {StoreInitialize(MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} + + CRYPTOPP_DLL size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + CRYPTOPP_DLL size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + +private: + CRYPTOPP_DLL void StoreInitialize(const NameValuePairs ¶meters); + + const byte *m_store; + size_t m_length, m_count; +}; + +//! RNG-based implementation of Source interface +class CRYPTOPP_DLL RandomNumberStore : public Store +{ +public: + RandomNumberStore() + : m_rng(NULL), m_length(0), m_count(0) {} + + RandomNumberStore(RandomNumberGenerator &rng, lword length) + : m_rng(&rng), m_length(length), m_count(0) {} + + bool AnyRetrievable() const {return MaxRetrievable() != 0;} + lword MaxRetrievable() const {return m_length-m_count;} + + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const + { + CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking); + throw NotImplemented("RandomNumberStore: CopyRangeTo2() is not supported by this store"); + } + +private: + void StoreInitialize(const NameValuePairs ¶meters); + + RandomNumberGenerator *m_rng; + lword m_length, m_count; +}; + +//! empty store +class CRYPTOPP_DLL NullStore : public Store +{ +public: + NullStore(lword size = ULONG_MAX) : m_size(size) {} + void StoreInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters);} + lword MaxRetrievable() const {return m_size;} + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + +private: + lword m_size; +}; + +//! \class Source +//! \brief Implementation of BufferedTransformation's attachment interface +//! \details Source is a cornerstone of the Pipeline trinitiy. Data flows from +//! Sources, through Filters, and then terminates in Sinks. The difference +//! between a Source and Filter is a Source \a pumps data, while a Filter does +//! not. The difference between a Filter and a Sink is a Filter allows an +//! attached transformation, while a Sink does not. +//! \details See the discussion of BufferedTransformation in cryptlib.h for +//! more details. +//! \sa Store and SourceTemplate +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Source : public InputRejecting +{ +public: + Source(BufferedTransformation *attachment = NULL) + {Source::Detach(attachment);} + + //! \name PIPELINE + //@{ + + lword Pump(lword pumpMax=size_t(SIZE_MAX)) + {Pump2(pumpMax); return pumpMax;} + unsigned int PumpMessages(unsigned int count=UINT_MAX) + {PumpMessages2(count); return count;} + void PumpAll() + {PumpAll2();} + virtual size_t Pump2(lword &byteCount, bool blocking=true) =0; + virtual size_t PumpMessages2(unsigned int &messageCount, bool blocking=true) =0; + virtual size_t PumpAll2(bool blocking=true); + virtual bool SourceExhausted() const =0; + + //@} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~Source() {} +#endif + +protected: + void SourceInitialize(bool pumpAll, const NameValuePairs ¶meters) + { + IsolatedInitialize(parameters); + if (pumpAll) + PumpAll(); + } +}; + +//! \class SourceTemplate +//! \brief Transform a Store into a Source +//! \tparam T the class or type +template +class SourceTemplate : public Source +{ +public: + SourceTemplate(BufferedTransformation *attachment) + : Source(attachment) {} + void IsolatedInitialize(const NameValuePairs ¶meters) + {m_store.IsolatedInitialize(parameters);} + size_t Pump2(lword &byteCount, bool blocking=true) + {return m_store.TransferTo2(*AttachedTransformation(), byteCount, DEFAULT_CHANNEL, blocking);} + size_t PumpMessages2(unsigned int &messageCount, bool blocking=true) + {return m_store.TransferMessagesTo2(*AttachedTransformation(), messageCount, DEFAULT_CHANNEL, blocking);} + size_t PumpAll2(bool blocking=true) + {return m_store.TransferAllTo2(*AttachedTransformation(), DEFAULT_CHANNEL, blocking);} + bool SourceExhausted() const + {return !m_store.AnyRetrievable() && !m_store.AnyMessages();} + void SetAutoSignalPropagation(int propagation) + {m_store.SetAutoSignalPropagation(propagation);} + int GetAutoSignalPropagation() const + {return m_store.GetAutoSignalPropagation();} + +protected: + T m_store; +}; + +//! \class SourceTemplate +//! \brief String-based implementation of the Source interface +class CRYPTOPP_DLL StringSource : public SourceTemplate +{ +public: + StringSource(BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) {} + //! zero terminated string as source + StringSource(const char *string, bool pumpAll, BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} + //! binary byte array as source + StringSource(const byte *string, size_t length, bool pumpAll, BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string, length)));} + //! std::string as source + StringSource(const std::string &string, bool pumpAll, BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} +}; + +//! use the third constructor for an array source +typedef StringSource ArraySource; + +//! RNG-based implementation of Source interface +class CRYPTOPP_DLL RandomNumberSource : public SourceTemplate +{ +public: + RandomNumberSource(RandomNumberGenerator &rng, int length, bool pumpAll, BufferedTransformation *attachment = NULL) + : SourceTemplate(attachment) + {SourceInitialize(pumpAll, MakeParameters("RandomNumberGeneratorPointer", &rng)("RandomNumberStoreSize", length));} +}; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/fips140.cpp b/external/crypto++-5.6.3/fips140.cpp new file mode 100644 index 000000000..53151295a --- /dev/null +++ b/external/crypto++-5.6.3/fips140.cpp @@ -0,0 +1,88 @@ +// fips140.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "fips140.h" +#include "misc.h" +#include "trdlocal.h" // needs to be included last for cygwin + +NAMESPACE_BEGIN(CryptoPP) + +// Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during +// startup, random number generation, and key generation. These tests may affect performance. +#ifndef CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 +#define CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 0 +#endif + +#if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(THREADS_AVAILABLE)) +#error FIPS 140-2 compliance requires the availability of thread local storage. +#endif + +#if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(OS_RNG_AVAILABLE)) +#error FIPS 140-2 compliance requires the availability of OS provided RNG. +#endif + +PowerUpSelfTestStatus g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE; + +bool FIPS_140_2_ComplianceEnabled() +{ + return CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2; +} + +void SimulatePowerUpSelfTestFailure() +{ + g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED; +} + +PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus() +{ + return g_powerUpSelfTestStatus; +} + +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 +ThreadLocalStorage & AccessPowerUpSelfTestInProgress() +{ + static ThreadLocalStorage selfTestInProgress; + return selfTestInProgress; +} +#endif + +bool PowerUpSelfTestInProgressOnThisThread() +{ +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 + return AccessPowerUpSelfTestInProgress().GetValue() != NULL; +#else + assert(false); // should not be called + return false; +#endif +} + +void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress) +{ + CRYPTOPP_UNUSED(inProgress); +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 + AccessPowerUpSelfTestInProgress().SetValue((void *)inProgress); +#endif +} + +void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor) +{ + CRYPTOPP_UNUSED(encryptor), CRYPTOPP_UNUSED(decryptor); +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 + EncryptionPairwiseConsistencyTest(encryptor, decryptor); +#endif +} + +void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier) +{ + CRYPTOPP_UNUSED(signer), CRYPTOPP_UNUSED(verifier); +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 + SignaturePairwiseConsistencyTest(signer, verifier); +#endif +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/fips140.h b/external/crypto++-5.6.3/fips140.h new file mode 100644 index 000000000..3a152627f --- /dev/null +++ b/external/crypto++-5.6.3/fips140.h @@ -0,0 +1,113 @@ +// fips140.h - written and placed in the public domain by Wei Dai + +//! \file fips140.h +//! \brief Classes and functions for the FIPS 140-2 validated library +//! \details The FIPS validated library is only available on Windows as a DLL. Once compiled, +//! the library is always in FIPS mode contingent upon successful execution of +//! DoPowerUpSelfTest() or DoDllPowerUpSelfTest(). +//! \sa Visual Studio and +//! config.h on the Crypto++ wiki. + +#ifndef CRYPTOPP_FIPS140_H +#define CRYPTOPP_FIPS140_H + +#include "cryptlib.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class SelfTestFailure +//! Exception thrown when a crypto algorithm is used after a self test fails +//! \details The self tests for an algorithm are performed by Algortihm class +//! when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined. +class CRYPTOPP_DLL SelfTestFailure : public Exception +{ +public: + explicit SelfTestFailure(const std::string &s) : Exception(OTHER_ERROR, s) {} +}; + +//! \brief Determines whether the library provides FIPS validated cryptography +//! \returns true if FIPS 140-2 validated features were enabled at compile time. +//! \details true if FIPS 140-2 validated features were enabled at compile time, +//! false otherwise. +//! \note FIPS mode is enabled at compile time. A program or other module cannot +//! arbitrarily enter or exit the mode. +CRYPTOPP_DLL bool CRYPTOPP_API FIPS_140_2_ComplianceEnabled(); + +//! \brief Status of the power-up self test +enum PowerUpSelfTestStatus { + + //! \brief The self tests have not been performed. + POWER_UP_SELF_TEST_NOT_DONE, + //! \brief The self tests were executed via DoPowerUpSelfTest() or + //! DoDllPowerUpSelfTest(), but the result was failure. + POWER_UP_SELF_TEST_FAILED, + //! \brief The self tests were executed via DoPowerUpSelfTest() or + //! DoDllPowerUpSelfTest(), and the result was success. + POWER_UP_SELF_TEST_PASSED +}; + +//! \brief Performs the power-up self test +//! \param moduleFilename the fully qualified name of the module +//! \param expectedModuleMac the expected MAC of the components protected by the integrity check +//! \details Performs the power-up self test, and sets the self test status to +//! POWER_UP_SELF_TEST_PASSED or POWER_UP_SELF_TEST_FAILED. +//! \details The self tests for an algorithm are performed by the Algortihm class +//! when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined. +CRYPTOPP_DLL void CRYPTOPP_API DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac); + +//! \brief Performs the power-up self test on the DLL +//! \details Performs the power-up self test using the filename of this DLL and the +//! embedded module MAC, and sets the self test status to POWER_UP_SELF_TEST_PASSED or +//! POWER_UP_SELF_TEST_FAILED. +//! \details The self tests for an algorithm are performed by the Algortihm class +//! when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined. +CRYPTOPP_DLL void CRYPTOPP_API DoDllPowerUpSelfTest(); + +//! \brief Sets the power-up self test status to POWER_UP_SELF_TEST_FAILED +//! \details Sets the power-up self test status to POWER_UP_SELF_TEST_FAILED to simulate failure. +CRYPTOPP_DLL void CRYPTOPP_API SimulatePowerUpSelfTestFailure(); + +//! \brief Provides the current power-up self test status +//! \returns the current power-up self test status +CRYPTOPP_DLL PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus(); + +#ifndef CRYPTOPP_DOXYGEN_PROCESSING +typedef PowerUpSelfTestStatus (CRYPTOPP_API * PGetPowerUpSelfTestStatus)(); +#endif + +//! \brief Class object that calculates the MAC on the module +//! \returns the MAC for the module +CRYPTOPP_DLL MessageAuthenticationCode * CRYPTOPP_API NewIntegrityCheckingMAC(); + +//! \brief Verifies the MAC on the module +//! \param moduleFilename the fully qualified name of the module +//! \param expectedModuleMac the expected MAC of the components protected by the integrity check +//! \param pActualMac the actual MAC of the components calculated by the integrity check +//! \param pMacFileLocation the offest of the MAC in the PE/PE+ module +//! \returns true if the MAC is valid, false otherwise +CRYPTOPP_DLL bool CRYPTOPP_API IntegrityCheckModule(const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac = NULL, unsigned long *pMacFileLocation = NULL); + +#ifndef CRYPTOPP_DOXYGEN_PROCESSING +// this is used by Algorithm constructor to allow Algorithm objects to be constructed for the self test +bool PowerUpSelfTestInProgressOnThisThread(); + +void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress); + +void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier); +void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor); + +void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier); +void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor); +#endif + +//! \brief The placeholder used prior to embedding the actual MAC in the module. +//! \details After the DLL is built but before it is MAC'd, the string CRYPTOPP_DUMMY_DLL_MAC +//! is used as a placeholder for the actual MAC. A post-build step is performed which calculates +//! the MAC of the DLL and embeds it in the module. The actual MAC is written by the +//! cryptest.exe program using the mac_dll subcommand. +#define CRYPTOPP_DUMMY_DLL_MAC "MAC_51f34b8db820ae8" + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/fipsalgt.cpp b/external/crypto++-5.6.3/fipsalgt.cpp new file mode 100644 index 000000000..c9a0cebcb --- /dev/null +++ b/external/crypto++-5.6.3/fipsalgt.cpp @@ -0,0 +1,1294 @@ +// fipsalgt.cpp - written and placed in the public domain by Wei Dai + +// This file implements the various algorithm tests needed to pass FIPS 140 validation. +// They're preserved here (commented out) in case Crypto++ needs to be revalidated. + +#if 0 +#ifndef CRYPTOPP_IMPORTS +#define CRYPTOPP_DEFAULT_NO_DLL +#endif + +#include "dll.h" +#include "cryptlib.h" +#include "smartptr.h" +#include "filters.h" +#include "oids.h" + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +class LineBreakParser : public AutoSignaling > +{ +public: + LineBreakParser(BufferedTransformation *attachment=NULL, byte lineEnd='\n') + : m_lineEnd(lineEnd) {Detach(attachment);} + + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking) + { + if (!blocking) + throw BlockingInputOnly("LineBreakParser"); + + unsigned int i, last = 0; + for (i=0; iPut2(begin+last, i-last, GetAutoSignalPropagation(), blocking); + last = i+1; + } + } + if (last != i) + AttachedTransformation()->Put2(begin+last, i-last, 0, blocking); + + if (messageEnd && GetAutoSignalPropagation()) + { + AttachedTransformation()->MessageEnd(GetAutoSignalPropagation()-1, blocking); + AttachedTransformation()->MessageSeriesEnd(GetAutoSignalPropagation()-1, blocking); + } + + return 0; + } + +private: + byte m_lineEnd; +}; + +class TestDataParser : public Unflushable +{ +public: + enum DataType {OTHER, COUNT, KEY_T, IV, INPUT, OUTPUT}; + + TestDataParser(std::string algorithm, std::string test, std::string mode, unsigned int feedbackSize, bool encrypt, BufferedTransformation *attachment) + : m_algorithm(algorithm), m_test(test), m_mode(mode), m_feedbackSize(feedbackSize) + , m_firstLine(true), m_blankLineTransition(0) + { + Detach(attachment); + + m_typeToName[COUNT] = "COUNT"; + + m_nameToType["COUNT"] = COUNT; + m_nameToType["KEY"] = KEY_T; + m_nameToType["KEYs"] = KEY_T; + m_nameToType["key"] = KEY_T; + m_nameToType["Key"] = KEY_T; + m_nameToType["IV"] = IV; + m_nameToType["IV1"] = IV; + m_nameToType["CV"] = IV; + m_nameToType["CV1"] = IV; + m_nameToType["IB"] = IV; + m_nameToType["TEXT"] = INPUT; + m_nameToType["RESULT"] = OUTPUT; + m_nameToType["Msg"] = INPUT; + m_nameToType["Seed"] = INPUT; + m_nameToType["V"] = INPUT; + m_nameToType["DT"] = IV; + SetEncrypt(encrypt); + + if (m_algorithm == "DSA" || m_algorithm == "ECDSA") + { + if (m_test == "PKV") + m_trigger = "Qy"; + else if (m_test == "KeyPair") + m_trigger = "N"; + else if (m_test == "SigGen") + m_trigger = "Msg"; + else if (m_test == "SigVer") + m_trigger = "S"; + else if (m_test == "PQGGen") + m_trigger = "N"; + else if (m_test == "PQGVer") + m_trigger = "H"; + } + else if (m_algorithm == "HMAC") + m_trigger = "Msg"; + else if (m_algorithm == "SHA") + m_trigger = (m_test == "MONTE") ? "Seed" : "Msg"; + else if (m_algorithm == "RNG") + m_trigger = "V"; + else if (m_algorithm == "RSA") + m_trigger = (m_test == "Ver") ? "S" : "Msg"; + } + + void SetEncrypt(bool encrypt) + { + m_encrypt = encrypt; + if (encrypt) + { + m_nameToType["PLAINTEXT"] = INPUT; + m_nameToType["CIPHERTEXT"] = OUTPUT; + m_nameToType["PT"] = INPUT; + m_nameToType["CT"] = OUTPUT; + } + else + { + m_nameToType["PLAINTEXT"] = OUTPUT; + m_nameToType["CIPHERTEXT"] = INPUT; + m_nameToType["PT"] = OUTPUT; + m_nameToType["CT"] = INPUT; + } + + if (m_algorithm == "AES" || m_algorithm == "TDES") + { + if (encrypt) + { + m_trigger = "PLAINTEXT"; + m_typeToName[OUTPUT] = "CIPHERTEXT"; + } + else + { + m_trigger = "CIPHERTEXT"; + m_typeToName[OUTPUT] = "PLAINTEXT"; + } + m_count = 0; + } + } + +protected: + void OutputData(std::string &output, const std::string &key, const std::string &data) + { + output += key; + output += "= "; + output += data; + output += "\n"; + } + + void OutputData(std::string &output, const std::string &key, int data) + { + OutputData(output, key, IntToString(data)); + } + + void OutputData(std::string &output, const std::string &key, const SecByteBlock &data) + { + output += key; + output += "= "; + HexEncoder(new StringSink(output), false).Put(data, data.size()); + output += "\n"; + } + + void OutputData(std::string &output, const std::string &key, const Integer &data, int size=-1) + { + SecByteBlock s(size < 0 ? data.MinEncodedSize() : size); + data.Encode(s, s.size()); + OutputData(output, key, s); + } + + void OutputData(std::string &output, const std::string &key, const PolynomialMod2 &data, int size=-1) + { + SecByteBlock s(size < 0 ? data.MinEncodedSize() : size); + data.Encode(s, s.size()); + OutputData(output, key, s); + } + + void OutputData(std::string &output, DataType t, const std::string &data) + { + if (m_algorithm == "SKIPJACK") + { + if (m_test == "KAT") + { + if (t == OUTPUT) + output = m_line + data + "\n"; + } + else + { + if (t != COUNT) + { + output += m_typeToName[t]; + output += "="; + } + output += data; + output += t == OUTPUT ? "\n" : " "; + } + } + else if (m_algorithm == "TDES" && t == KEY_T && m_typeToName[KEY_T].empty()) + { + output += "KEY1 = "; + output += data.substr(0, 16); + output += "\nKEY2 = "; + output += data.size() > 16 ? data.substr(16, 16) : data.substr(0, 16); + output += "\nKEY3 = "; + output += data.size() > 32 ? data.substr(32, 16) : data.substr(0, 16); + output += "\n"; + } + else + { + output += m_typeToName[t]; + output += " = "; + output += data; + output += "\n"; + } + } + + void OutputData(std::string &output, DataType t, int i) + { + OutputData(output, t, IntToString(i)); + } + + void OutputData(std::string &output, DataType t, const SecByteBlock &data) + { + std::string hexData; + StringSource(data.begin(), data.size(), true, new HexEncoder(new StringSink(hexData), false)); + OutputData(output, t, hexData); + } + + void OutputGivenData(std::string &output, DataType t, bool optional = false) + { + if (m_data.find(m_typeToName[t]) == m_data.end()) + { + if (optional) + return; + throw Exception(Exception::OTHER_ERROR, "TestDataParser: key not found: " + m_typeToName[t]); + } + + OutputData(output, t, m_data[m_typeToName[t]]); + } + + template + BlockCipher * NewBT(T *) + { + if (!m_encrypt && (m_mode == "ECB" || m_mode == "CBC")) + return new typename T::Decryption; + else + return new typename T::Encryption; + } + + template + SymmetricCipher * NewMode(T *, BlockCipher &bt, const byte *iv) + { + if (!m_encrypt) + return new typename T::Decryption(bt, iv, m_feedbackSize/8); + else + return new typename T::Encryption(bt, iv, m_feedbackSize/8); + } + + static inline void Xor(SecByteBlock &z, const SecByteBlock &x, const SecByteBlock &y) + { + assert(x.size() == y.size()); + z.resize(x.size()); + xorbuf(z, x, y, x.size()); + } + + SecByteBlock UpdateKey(SecByteBlock key, const SecByteBlock *text) + { + unsigned int innerCount = (m_algorithm == "AES") ? 1000 : 10000; + int keySize = key.size(), blockSize = text[0].size(); + SecByteBlock x(keySize); + for (int k=0; k + void EC_KeyPair(string &output, int n, const OID &oid) + { + DL_GroupParameters_EC params(oid); + for (int i=0; i priv; + DL_PublicKey_EC pub; + priv.Initialize(m_rng, params); + priv.MakePublicKey(pub); + + OutputData(output, "d ", priv.GetPrivateExponent()); + OutputData(output, "Qx ", pub.GetPublicElement().x, params.GetCurve().GetField().MaxElementByteLength()); + OutputData(output, "Qy ", pub.GetPublicElement().y, params.GetCurve().GetField().MaxElementByteLength()); + } + } + + template + void EC_SigGen(string &output, const OID &oid) + { + DL_GroupParameters_EC params(oid); + typename ECDSA::PrivateKey priv; + typename ECDSA::PublicKey pub; + priv.Initialize(m_rng, params); + priv.MakePublicKey(pub); + + typename ECDSA::Signer signer(priv); + SecByteBlock sig(signer.SignatureLength()); + StringSource(m_data["Msg"], true, new HexDecoder(new SignerFilter(m_rng, signer, new ArraySink(sig, sig.size())))); + SecByteBlock R(sig, sig.size()/2), S(sig+sig.size()/2, sig.size()/2); + + OutputData(output, "Qx ", pub.GetPublicElement().x, params.GetCurve().GetField().MaxElementByteLength()); + OutputData(output, "Qy ", pub.GetPublicElement().y, params.GetCurve().GetField().MaxElementByteLength()); + OutputData(output, "R ", R); + OutputData(output, "S ", S); + } + + template + void EC_SigVer(string &output, const OID &oid) + { + SecByteBlock x(DecodeHex(m_data["Qx"])); + SecByteBlock y(DecodeHex(m_data["Qy"])); + Integer r((m_data["R"]+"h").c_str()); + Integer s((m_data["S"]+"h").c_str()); + + typename EC::FieldElement Qx(x, x.size()); + typename EC::FieldElement Qy(y, y.size()); + typename EC::Element Q(Qx, Qy); + + DL_GroupParameters_EC params(oid); + typename ECDSA::PublicKey pub; + pub.Initialize(params, Q); + typename ECDSA::Verifier verifier(pub); + + SecByteBlock sig(verifier.SignatureLength()); + r.Encode(sig, sig.size()/2); + s.Encode(sig+sig.size()/2, sig.size()/2); + + SignatureVerificationFilter filter(verifier); + filter.Put(sig, sig.size()); + StringSource(m_data["Msg"], true, new HexDecoder(new Redirector(filter, Redirector::DATA_ONLY))); + filter.MessageEnd(); + byte b; + filter.Get(b); + OutputData(output, "Result ", b ? "P" : "F"); + } + + template + static bool EC_PKV(RandomNumberGenerator &rng, const SecByteBlock &x, const SecByteBlock &y, const OID &oid) + { + typename EC::FieldElement Qx(x, x.size()); + typename EC::FieldElement Qy(y, y.size()); + typename EC::Element Q(Qx, Qy); + + DL_GroupParameters_EC params(oid); + typename ECDSA::PublicKey pub; + pub.Initialize(params, Q); + return pub.Validate(rng, 3); + } + + template + Result * CreateRSA2(const std::string &standard) + { + if (typeid(Result) == typeid(PK_Verifier)) + { + if (standard == "R") + return (Result *) new typename RSASS_ISO::Verifier; + else if (standard == "P") + return (Result *) new typename RSASS::Verifier; + else if (standard == "1") + return (Result *) new typename RSASS::Verifier; + } + else if (typeid(Result) == typeid(PK_Signer)) + { + if (standard == "R") + return (Result *) new typename RSASS_ISO::Signer; + else if (standard == "P") + return (Result *) new typename RSASS::Signer; + else if (standard == "1") + return (Result *) new typename RSASS::Signer; + } + + return NULL; + } + + template + Result * CreateRSA(const std::string &standard, const std::string &hash) + { + if (hash == "1") + return CreateRSA2(standard); + else if (hash == "224") + return CreateRSA2(standard); + else if (hash == "256") + return CreateRSA2(standard); + else if (hash == "384") + return CreateRSA2(standard); + else if (hash == "512") + return CreateRSA2(standard); + else + return NULL; + } + + virtual void DoTest() + { + std::string output; + + if (m_algorithm == "DSA") + { + if (m_test == "KeyPair") + { + DL_GroupParameters_DSA pqg; + int modLen = atol(m_bracketString.substr(6).c_str()); + pqg.GenerateRandomWithKeySize(m_rng, modLen); + + OutputData(output, "P ", pqg.GetModulus()); + OutputData(output, "Q ", pqg.GetSubgroupOrder()); + OutputData(output, "G ", pqg.GetSubgroupGenerator()); + + int n = atol(m_data["N"].c_str()); + for (int i=0; iPut((byte *)output.data(), output.size()); + output.resize(0); + } + } + else if (m_test == "PQGGen") + { + int n = atol(m_data["N"].c_str()); + for (int i=0; iPut((byte *)output.data(), output.size()); + output.resize(0); + } + } + else if (m_test == "SigGen") + { + std::string &encodedKey = m_data["PrivKey"]; + int modLen = atol(m_bracketString.substr(6).c_str()); + DSA::PrivateKey priv; + + if (!encodedKey.empty()) + { + StringStore s(encodedKey); + priv.BERDecode(s); + if (priv.GetGroupParameters().GetModulus().BitCount() != modLen) + encodedKey.clear(); + } + + if (encodedKey.empty()) + { + priv.Initialize(m_rng, modLen); + StringSink s(encodedKey); + priv.DEREncode(s); + OutputData(output, "P ", priv.GetGroupParameters().GetModulus()); + OutputData(output, "Q ", priv.GetGroupParameters().GetSubgroupOrder()); + OutputData(output, "G ", priv.GetGroupParameters().GetSubgroupGenerator()); + } + + DSA::Signer signer(priv); + DSA::Verifier pub(signer); + OutputData(output, "Msg ", m_data["Msg"]); + OutputData(output, "Y ", pub.GetKey().GetPublicElement()); + + SecByteBlock sig(signer.SignatureLength()); + StringSource(m_data["Msg"], true, new HexDecoder(new SignerFilter(m_rng, signer, new ArraySink(sig, sig.size())))); + SecByteBlock R(sig, sig.size()/2), S(sig+sig.size()/2, sig.size()/2); + OutputData(output, "R ", R); + OutputData(output, "S ", S); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + } + else if (m_test == "SigVer") + { + Integer p((m_data["P"] + "h").c_str()); + Integer q((m_data["Q"] + "h").c_str()); + Integer g((m_data["G"] + "h").c_str()); + Integer y((m_data["Y"] + "h").c_str()); + DSA::Verifier verifier(p, q, g, y); + + HexDecoder filter(new SignatureVerificationFilter(verifier)); + StringSource(m_data["R"], true, new Redirector(filter, Redirector::DATA_ONLY)); + StringSource(m_data["S"], true, new Redirector(filter, Redirector::DATA_ONLY)); + StringSource(m_data["Msg"], true, new Redirector(filter, Redirector::DATA_ONLY)); + filter.MessageEnd(); + byte b; + filter.Get(b); + OutputData(output, "Result ", b ? "P" : "F"); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + } + else if (m_test == "PQGVer") + { + Integer p((m_data["P"] + "h").c_str()); + Integer q((m_data["Q"] + "h").c_str()); + Integer g((m_data["G"] + "h").c_str()); + Integer h((m_data["H"] + "h").c_str()); + int c = atol(m_data["c"].c_str()); + SecByteBlock seed(m_data["Seed"].size()/2); + StringSource(m_data["Seed"], true, new HexDecoder(new ArraySink(seed, seed.size()))); + + Integer p1, q1; + bool result = DSA::GeneratePrimes(seed, seed.size()*8, c, p1, 1024, q1, true); + result = result && (p1 == p && q1 == q); + result = result && g == a_exp_b_mod_c(h, (p-1)/q, p); + + OutputData(output, "Result ", result ? "P" : "F"); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + } + + return; + } + + if (m_algorithm == "ECDSA") + { + std::map name2oid; + name2oid["P-192"] = ASN1::secp192r1(); + name2oid["P-224"] = ASN1::secp224r1(); + name2oid["P-256"] = ASN1::secp256r1(); + name2oid["P-384"] = ASN1::secp384r1(); + name2oid["P-521"] = ASN1::secp521r1(); + name2oid["K-163"] = ASN1::sect163k1(); + name2oid["K-233"] = ASN1::sect233k1(); + name2oid["K-283"] = ASN1::sect283k1(); + name2oid["K-409"] = ASN1::sect409k1(); + name2oid["K-571"] = ASN1::sect571k1(); + name2oid["B-163"] = ASN1::sect163r2(); + name2oid["B-233"] = ASN1::sect233r1(); + name2oid["B-283"] = ASN1::sect283r1(); + name2oid["B-409"] = ASN1::sect409r1(); + name2oid["B-571"] = ASN1::sect571r1(); + + if (m_test == "PKV") + { + bool pass; + if (m_bracketString[0] == 'P') + pass = EC_PKV(m_rng, DecodeHex(m_data["Qx"]), DecodeHex(m_data["Qy"]), name2oid[m_bracketString]); + else + pass = EC_PKV(m_rng, DecodeHex(m_data["Qx"]), DecodeHex(m_data["Qy"]), name2oid[m_bracketString]); + + OutputData(output, "Result ", pass ? "P" : "F"); + } + else if (m_test == "KeyPair") + { + if (m_bracketString[0] == 'P') + EC_KeyPair(output, atol(m_data["N"].c_str()), name2oid[m_bracketString]); + else + EC_KeyPair(output, atol(m_data["N"].c_str()), name2oid[m_bracketString]); + } + else if (m_test == "SigGen") + { + if (m_bracketString[0] == 'P') + EC_SigGen(output, name2oid[m_bracketString]); + else + EC_SigGen(output, name2oid[m_bracketString]); + } + else if (m_test == "SigVer") + { + if (m_bracketString[0] == 'P') + EC_SigVer(output, name2oid[m_bracketString]); + else + EC_SigVer(output, name2oid[m_bracketString]); + } + + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + return; + } + + if (m_algorithm == "RSA") + { + std::string shaAlg = m_data["SHAAlg"].substr(3); + + if (m_test == "Ver") + { + Integer n((m_data["n"] + "h").c_str()); + Integer e((m_data["e"] + "h").c_str()); + RSA::PublicKey pub; + pub.Initialize(n, e); + + member_ptr pV(CreateRSA(m_mode, shaAlg)); + pV->AccessMaterial().AssignFrom(pub); + + HexDecoder filter(new SignatureVerificationFilter(*pV)); + for (unsigned int i=m_data["S"].size(); iSignatureLength()*2; i++) + filter.Put('0'); + StringSource(m_data["S"], true, new Redirector(filter, Redirector::DATA_ONLY)); + StringSource(m_data["Msg"], true, new Redirector(filter, Redirector::DATA_ONLY)); + filter.MessageEnd(); + byte b; + filter.Get(b); + OutputData(output, "Result ", b ? "P" : "F"); + } + else + { + assert(m_test == "Gen"); + int modLen = atol(m_bracketString.substr(6).c_str()); + std::string &encodedKey = m_data["PrivKey"]; + RSA::PrivateKey priv; + + if (!encodedKey.empty()) + { + StringStore s(encodedKey); + priv.BERDecode(s); + if (priv.GetModulus().BitCount() != modLen) + encodedKey.clear(); + } + + if (encodedKey.empty()) + { + priv.Initialize(m_rng, modLen); + StringSink s(encodedKey); + priv.DEREncode(s); + OutputData(output, "n ", priv.GetModulus()); + OutputData(output, "e ", priv.GetPublicExponent(), modLen/8); + } + + member_ptr pS(CreateRSA(m_mode, shaAlg)); + pS->AccessMaterial().AssignFrom(priv); + + SecByteBlock sig(pS->SignatureLength()); + StringSource(m_data["Msg"], true, new HexDecoder(new SignerFilter(m_rng, *pS, new ArraySink(sig, sig.size())))); + OutputData(output, "SHAAlg ", m_data["SHAAlg"]); + OutputData(output, "Msg ", m_data["Msg"]); + OutputData(output, "S ", sig); + } + + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + return; + } + + if (m_algorithm == "SHA") + { + member_ptr pHF; + + if (m_mode == "1") + pHF.reset(new SHA1); + else if (m_mode == "224") + pHF.reset(new SHA224); + else if (m_mode == "256") + pHF.reset(new SHA256); + else if (m_mode == "384") + pHF.reset(new SHA384); + else if (m_mode == "512") + pHF.reset(new SHA512); + + if (m_test == "MONTE") + { + SecByteBlock seed = m_data2[INPUT]; + SecByteBlock MD[1003]; + int i,j; + + for (j=0; j<100; j++) + { + MD[0] = MD[1] = MD[2] = seed; + for (i=3; i<1003; i++) + { + SecByteBlock Mi = MD[i-3] + MD[i-2] + MD[i-1]; + MD[i].resize(pHF->DigestSize()); + pHF->CalculateDigest(MD[i], Mi, Mi.size()); + } + seed = MD[1002]; + OutputData(output, "COUNT ", j); + OutputData(output, "MD ", seed); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + } + } + else + { + SecByteBlock tag(pHF->DigestSize()); + SecByteBlock &msg(m_data2[INPUT]); + int len = atol(m_data["Len"].c_str()); + StringSource(msg.begin(), len/8, true, new HashFilter(*pHF, new ArraySink(tag, tag.size()))); + OutputData(output, "MD ", tag); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + } + return; + } + + SecByteBlock &key = m_data2[KEY_T]; + + if (m_algorithm == "TDES") + { + if (!m_data["KEY1"].empty()) + { + const std::string keys[3] = {m_data["KEY1"], m_data["KEY2"], m_data["KEY3"]}; + key.resize(24); + HexDecoder hexDec(new ArraySink(key, key.size())); + for (int i=0; i<3; i++) + hexDec.Put((byte *)keys[i].data(), keys[i].size()); + + if (keys[0] == keys[2]) + { + if (keys[0] == keys[1]) + key.resize(8); + else + key.resize(16); + } + else + key.resize(24); + } + } + + if (m_algorithm == "RNG") + { + key.resize(24); + StringSource(m_data["Key1"] + m_data["Key2"] + m_data["Key3"], true, new HexDecoder(new ArraySink(key, key.size()))); + + SecByteBlock seed(m_data2[INPUT]), dt(m_data2[IV]), r(8); + X917RNG rng(new DES_EDE3::Encryption(key, key.size()), seed, dt); + + if (m_test == "MCT") + { + for (int i=0; i<10000; i++) + rng.GenerateBlock(r, r.size()); + } + else + { + rng.GenerateBlock(r, r.size()); + } + + OutputData(output, "R ", r); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + return; + } + + if (m_algorithm == "HMAC") + { + member_ptr pMAC; + + if (m_bracketString == "L=20") + pMAC.reset(new HMAC); + else if (m_bracketString == "L=28") + pMAC.reset(new HMAC); + else if (m_bracketString == "L=32") + pMAC.reset(new HMAC); + else if (m_bracketString == "L=48") + pMAC.reset(new HMAC); + else if (m_bracketString == "L=64") + pMAC.reset(new HMAC); + else + throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected HMAC bracket string: " + m_bracketString); + + pMAC->SetKey(key, key.size()); + int Tlen = atol(m_data["Tlen"].c_str()); + SecByteBlock tag(Tlen); + StringSource(m_data["Msg"], true, new HexDecoder(new HashFilter(*pMAC, new ArraySink(tag, Tlen), false, Tlen))); + OutputData(output, "Mac ", tag); + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + return; + } + + member_ptr pBT; + if (m_algorithm == "DES") + pBT.reset(NewBT((DES*)0)); + else if (m_algorithm == "TDES") + { + if (key.size() == 8) + pBT.reset(NewBT((DES*)0)); + else if (key.size() == 16) + pBT.reset(NewBT((DES_EDE2*)0)); + else + pBT.reset(NewBT((DES_EDE3*)0)); + } + else if (m_algorithm == "SKIPJACK") + pBT.reset(NewBT((SKIPJACK*)0)); + else if (m_algorithm == "AES") + pBT.reset(NewBT((AES*)0)); + else + throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected algorithm: " + m_algorithm); + + if (!pBT->IsValidKeyLength(key.size())) + key.CleanNew(pBT->DefaultKeyLength()); // for Scbcvrct + pBT->SetKey(key.data(), key.size()); + + SecByteBlock &iv = m_data2[IV]; + if (iv.empty()) + iv.CleanNew(pBT->BlockSize()); + + member_ptr pCipher; + unsigned int K = m_feedbackSize; + + if (m_mode == "ECB") + pCipher.reset(NewMode((ECB_Mode_ExternalCipher*)0, *pBT, iv)); + else if (m_mode == "CBC") + pCipher.reset(NewMode((CBC_Mode_ExternalCipher*)0, *pBT, iv)); + else if (m_mode == "CFB") + pCipher.reset(NewMode((CFB_Mode_ExternalCipher*)0, *pBT, iv)); + else if (m_mode == "OFB") + pCipher.reset(NewMode((OFB_Mode_ExternalCipher*)0, *pBT, iv)); + else + throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected mode: " + m_mode); + + bool encrypt = m_encrypt; + + if (m_test == "MONTE") + { + SecByteBlock KEY[401]; + KEY[0] = key; + int keySize = key.size(); + int blockSize = pBT->BlockSize(); + + std::vector IB(10001), OB(10001), PT(10001), CT(10001), RESULT(10001), TXT(10001), CV(10001); + PT[0] = GetData("PLAINTEXT"); + CT[0] = GetData("CIPHERTEXT"); + CV[0] = IB[0] = iv; + TXT[0] = GetData("TEXT"); + + int outerCount = (m_algorithm == "AES") ? 100 : 400; + int innerCount = (m_algorithm == "AES") ? 1000 : 10000; + + for (int i=0; iSetKey(KEY[i], keySize); + + for (int j=0; jProcessBlock(IB[j], CT[j]); + PT[j+1] = CT[j]; + } + else + { + IB[j] = CT[j]; + PT[j].resize(blockSize); + pBT->ProcessBlock(IB[j], PT[j]); + CT[j+1] = PT[j]; + } + } + else if (m_mode == "OFB") + { + OB[j].resize(blockSize); + pBT->ProcessBlock(IB[j], OB[j]); + Xor(RESULT[j], OB[j], TXT[j]); + TXT[j+1] = IB[j]; + IB[j+1] = OB[j]; + } + else if (m_mode == "CBC") + { + if (encrypt) + { + Xor(IB[j], PT[j], CV[j]); + CT[j].resize(blockSize); + pBT->ProcessBlock(IB[j], CT[j]); + PT[j+1] = CV[j]; + CV[j+1] = CT[j]; + } + else + { + IB[j] = CT[j]; + OB[j].resize(blockSize); + pBT->ProcessBlock(IB[j], OB[j]); + Xor(PT[j], OB[j], CV[j]); + CV[j+1] = CT[j]; + CT[j+1] = PT[j]; + } + } + else if (m_mode == "CFB") + { + if (encrypt) + { + OB[j].resize(blockSize); + pBT->ProcessBlock(IB[j], OB[j]); + AssignLeftMostBits(CT[j], OB[j], K); + Xor(CT[j], CT[j], PT[j]); + AssignLeftMostBits(PT[j+1], IB[j], K); + IB[j+1].resize(blockSize); + memcpy(IB[j+1], IB[j]+K/8, blockSize-K/8); + memcpy(IB[j+1]+blockSize-K/8, CT[j], K/8); + } + else + { + OB[j].resize(blockSize); + pBT->ProcessBlock(IB[j], OB[j]); + AssignLeftMostBits(PT[j], OB[j], K); + Xor(PT[j], PT[j], CT[j]); + IB[j+1].resize(blockSize); + memcpy(IB[j+1], IB[j]+K/8, blockSize-K/8); + memcpy(IB[j+1]+blockSize-K/8, CT[j], K/8); + AssignLeftMostBits(CT[j+1], OB[j], K); + } + } + else + throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected mode: " + m_mode); + } + + OutputData(output, COUNT, IntToString(i)); + OutputData(output, KEY_T, KEY[i]); + if (m_mode == "CBC") + OutputData(output, IV, CV[0]); + if (m_mode == "OFB" || m_mode == "CFB") + OutputData(output, IV, IB[0]); + if (m_mode == "ECB" || m_mode == "CBC" || m_mode == "CFB") + { + if (encrypt) + { + OutputData(output, INPUT, PT[0]); + OutputData(output, OUTPUT, CT[innerCount-1]); + KEY[i+1] = UpdateKey(KEY[i], &CT[0]); + } + else + { + OutputData(output, INPUT, CT[0]); + OutputData(output, OUTPUT, PT[innerCount-1]); + KEY[i+1] = UpdateKey(KEY[i], &PT[0]); + } + PT[0] = PT[innerCount]; + IB[0] = IB[innerCount]; + CV[0] = CV[innerCount]; + CT[0] = CT[innerCount]; + } + else if (m_mode == "OFB") + { + OutputData(output, INPUT, TXT[0]); + OutputData(output, OUTPUT, RESULT[innerCount-1]); + KEY[i+1] = UpdateKey(KEY[i], &RESULT[0]); + Xor(TXT[0], TXT[0], IB[innerCount-1]); + IB[0] = OB[innerCount-1]; + } + output += "\n"; + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + } + } + else if (m_test == "MCT") + { + SecByteBlock KEY[101]; + KEY[0] = key; + int keySize = key.size(); + int blockSize = pBT->BlockSize(); + + SecByteBlock ivs[101], inputs[1001], outputs[1001]; + ivs[0] = iv; + inputs[0] = m_data2[INPUT]; + + for (int i=0; i<100; i++) + { + pCipher->SetKey(KEY[i], keySize, MakeParameters(Name::IV(), (const byte *)ivs[i])(Name::FeedbackSize(), (int)K/8, false)); + + for (int j=0; j<1000; j++) + { + outputs[j] = inputs[j]; + pCipher->ProcessString(outputs[j], outputs[j].size()); + if (K==8 && m_mode == "CFB") + { + if (j<16) + inputs[j+1].Assign(ivs[i]+j, 1); + else + inputs[j+1] = outputs[j-16]; + } + else if (m_mode == "ECB") + inputs[j+1] = outputs[j]; + else if (j == 0) + inputs[j+1] = ivs[i]; + else + inputs[j+1] = outputs[j-1]; + } + + if (m_algorithm == "AES") + OutputData(output, COUNT, m_count++); + OutputData(output, KEY_T, KEY[i]); + if (m_mode != "ECB") + OutputData(output, IV, ivs[i]); + OutputData(output, INPUT, inputs[0]); + OutputData(output, OUTPUT, outputs[999]); + output += "\n"; + AttachedTransformation()->Put((byte *)output.data(), output.size()); + output.resize(0); + + KEY[i+1] = UpdateKey(KEY[i], outputs); + ivs[i+1].CleanNew(pCipher->IVSize()); + ivs[i+1] = UpdateKey(ivs[i+1], outputs); + if (K==8 && m_mode == "CFB") + inputs[0] = outputs[999-16]; + else if (m_mode == "ECB") + inputs[0] = outputs[999]; + else + inputs[0] = outputs[998]; + } + } + else + { + assert(m_test == "KAT"); + + SecByteBlock &input = m_data2[INPUT]; + SecByteBlock result(input.size()); + member_ptr pFilter(new StreamTransformationFilter(*pCipher, new ArraySink(result, result.size()), StreamTransformationFilter::NO_PADDING)); + StringSource(input.data(), input.size(), true, pFilter.release()); + + OutputGivenData(output, COUNT, true); + OutputData(output, KEY_T, key); + OutputGivenData(output, IV, true); + OutputGivenData(output, INPUT); + OutputData(output, OUTPUT, result); + output += "\n"; + AttachedTransformation()->Put((byte *)output.data(), output.size()); + } + } + + std::vector Tokenize(const std::string &line) + { + std::vector result; + std::string s; + for (unsigned int i=0; i") + { + assert(m_test == "sha"); + m_bracketString = m_line.substr(2, m_line.size()-4); + m_line = m_line.substr(0, 13) + "Hashes") + copyLine = true; + + if (m_line == "Put((byte *)m_line.data(), m_line.size(), blocking); + return false; + } + + std::vector tokens = Tokenize(m_line); + + if (m_algorithm == "DSA" && m_test == "sha") + { + for (unsigned int i = 0; i < tokens.size(); i++) + { + if (tokens[i] == "^") + DoTest(); + else if (tokens[i] != "") + m_compactString.push_back(atol(tokens[i].c_str())); + } + } + else + { + if (!m_line.empty() && ((m_algorithm == "RSA" && m_test != "Gen") || m_algorithm == "RNG" || m_algorithm == "HMAC" || m_algorithm == "SHA" || (m_algorithm == "ECDSA" && m_test != "KeyPair") || (m_algorithm == "DSA" && (m_test == "PQGVer" || m_test == "SigVer")))) + { + // copy input to output + std::string output = m_line + '\n'; + AttachedTransformation()->Put((byte *)output.data(), output.size()); + } + + for (unsigned int i = 0; i < tokens.size(); i++) + { + if (m_firstLine && m_algorithm != "DSA") + { + if (tokens[i] == "Encrypt" || tokens[i] == "OFB") + SetEncrypt(true); + else if (tokens[i] == "Decrypt") + SetEncrypt(false); + else if (tokens[i] == "Modes") + m_test = "MONTE"; + } + else + { + if (tokens[i] != "=") + continue; + + if (i == 0) + throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected data: " + m_line); + + const std::string &key = tokens[i-1]; + std::string &data = m_data[key]; + data = (tokens.size() > i+1) ? tokens[i+1] : ""; + DataType t = m_nameToType[key]; + m_typeToName[t] = key; + m_data2[t] = DecodeHex(data); + + if (key == m_trigger || (t == OUTPUT && !m_data2[INPUT].empty() && !isspace(m_line[0]))) + DoTest(); + } + } + } + + m_firstLine = false; + + return false; + } + + inline const SecByteBlock & GetData(const std::string &key) + { + return m_data2[m_nameToType[key]]; + } + + static SecByteBlock DecodeHex(const std::string &data) + { + SecByteBlock data2(data.size() / 2); + StringSource(data, true, new HexDecoder(new ArraySink(data2, data2.size()))); + return data2; + } + + std::string m_algorithm, m_test, m_mode, m_line, m_bracketString, m_trigger; + unsigned int m_feedbackSize, m_blankLineTransition; + bool m_encrypt, m_firstLine; + + typedef std::map NameToTypeMap; + NameToTypeMap m_nameToType; + typedef std::map TypeToNameMap; + TypeToNameMap m_typeToName; + + typedef std::map Map; + Map m_data; // raw data + typedef std::map Map2; + Map2 m_data2; + int m_count; + + AutoSeededX917RNG m_rng; + std::vector m_compactString; +}; + +int FIPS_140_AlgorithmTest(int argc, char **argv) +{ + argc--; + argv++; + + std::string algorithm = argv[1]; + std::string pathname = argv[2]; + unsigned int i = pathname.find_last_of("\\/"); + std::string filename = pathname.substr(i == std::string::npos ? 0 : i+1); + std::string dirname = pathname.substr(0, i); + + if (algorithm == "auto") + { + string algTable[] = {"AES", "ECDSA", "DSA", "HMAC", "RNG", "RSA", "TDES", "SKIPJACK", "SHA"}; // order is important here + for (i=0; i 3) + { + std::string outDir = argv[3]; + + if (outDir == "auto") + { + if (dirname.substr(dirname.size()-3) == "req") + outDir = dirname.substr(0, dirname.size()-3) + "resp"; + } + + if (*outDir.rbegin() != '\\' && *outDir.rbegin() != '/') + outDir += '/'; + std::string outPathname = outDir + filename.substr(0, filename.size() - 3) + "rsp"; + pSink = new FileSink(outPathname.c_str(), false); + } + else + pSink = new FileSink(cout); + + FileSource(pathname.c_str(), true, new LineBreakParser(new TestDataParser(algorithm, test, mode, feedbackSize, encrypt, pSink)), false); + } + catch (...) + { + cout << "file: " << filename << endl; + throw; + } + return 0; +} + +extern int (*AdhocTest)(int argc, char *argv[]); +static int s_i = (AdhocTest = &FIPS_140_AlgorithmTest, 0); +#endif diff --git a/external/crypto++-5.6.3/fipstest.cpp b/external/crypto++-5.6.3/fipstest.cpp new file mode 100644 index 000000000..ead310fe9 --- /dev/null +++ b/external/crypto++-5.6.3/fipstest.cpp @@ -0,0 +1,615 @@ +// fipstest.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#define CRYPTOPP_DEFAULT_NO_DLL +#include "dll.h" +#include "cryptlib.h" +#include "filters.h" +#include "smartptr.h" +#include "misc.h" + +#ifdef CRYPTOPP_WIN32_AVAILABLE +#define _WIN32_WINNT 0x0400 +#include + +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#ifdef _M_IX86 +#define _CRT_DEBUGGER_HOOK _crt_debugger_hook +#else +#define _CRT_DEBUGGER_HOOK __crt_debugger_hook +#endif +extern "C" {_CRTIMP void __cdecl _CRT_DEBUGGER_HOOK(int);} +#endif +#endif + +#include + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100) +#endif + +NAMESPACE_BEGIN(CryptoPP) + +extern PowerUpSelfTestStatus g_powerUpSelfTestStatus; +SecByteBlock g_actualMac; +unsigned long g_macFileLocation = 0; + +// use a random dummy string here, to be searched/replaced later with the real MAC +static const byte s_moduleMac[CryptoPP::HMAC::DIGESTSIZE] = CRYPTOPP_DUMMY_DLL_MAC; +CRYPTOPP_COMPILE_ASSERT(sizeof(s_moduleMac) == CryptoPP::SHA1::DIGESTSIZE); + +#ifdef CRYPTOPP_WIN32_AVAILABLE +static HMODULE s_hModule = NULL; +#endif + +const byte * CRYPTOPP_API GetActualMacAndLocation(unsigned int &macSize, unsigned int &fileLocation) +{ + macSize = (unsigned int)g_actualMac.size(); + fileLocation = g_macFileLocation; + return g_actualMac; +} + +void KnownAnswerTest(RandomNumberGenerator &rng, const char *output) +{ + EqualityComparisonFilter comparison; + + RandomNumberStore(rng, strlen(output)/2).TransferAllTo(comparison, "0"); + StringSource(output, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); + + comparison.ChannelMessageSeriesEnd("0"); + comparison.ChannelMessageSeriesEnd("1"); +} + +template +void X917RNG_KnownAnswerTest( + const char *key, + const char *seed, + const char *deterministicTimeVector, + const char *output, + CIPHER *dummy = NULL) +{ + CRYPTOPP_UNUSED(dummy); +#ifdef OS_RNG_AVAILABLE + std::string decodedKey, decodedSeed, decodedDeterministicTimeVector; + StringSource(key, true, new HexDecoder(new StringSink(decodedKey))); + StringSource(seed, true, new HexDecoder(new StringSink(decodedSeed))); + StringSource(deterministicTimeVector, true, new HexDecoder(new StringSink(decodedDeterministicTimeVector))); + + AutoSeededX917RNG rng(false, false); + rng.Reseed((const byte *)decodedKey.data(), decodedKey.size(), (const byte *)decodedSeed.data(), (const byte *)decodedDeterministicTimeVector.data()); + KnownAnswerTest(rng, output); +#else + throw 0; +#endif +} + +void KnownAnswerTest(StreamTransformation &encryption, StreamTransformation &decryption, const char *plaintext, const char *ciphertext) +{ + EqualityComparisonFilter comparison; + + StringSource(plaintext, true, new HexDecoder(new StreamTransformationFilter(encryption, new ChannelSwitch(comparison, "0"), StreamTransformationFilter::NO_PADDING))); + StringSource(ciphertext, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); + + StringSource(ciphertext, true, new HexDecoder(new StreamTransformationFilter(decryption, new ChannelSwitch(comparison, "0"), StreamTransformationFilter::NO_PADDING))); + StringSource(plaintext, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); + + comparison.ChannelMessageSeriesEnd("0"); + comparison.ChannelMessageSeriesEnd("1"); +} + +template +void SymmetricEncryptionKnownAnswerTest( + const char *key, + const char *hexIV, + const char *plaintext, + const char *ecb, + const char *cbc, + const char *cfb, + const char *ofb, + const char *ctr, + CIPHER *dummy = NULL) +{ + CRYPTOPP_UNUSED(dummy); + std::string decodedKey; + StringSource(key, true, new HexDecoder(new StringSink(decodedKey))); + + typename CIPHER::Encryption encryption((const byte *)decodedKey.data(), decodedKey.size()); + typename CIPHER::Decryption decryption((const byte *)decodedKey.data(), decodedKey.size()); + + SecByteBlock iv(encryption.BlockSize()); + StringSource(hexIV, true, new HexDecoder(new ArraySink(iv, iv.size()))); + + if (ecb) + KnownAnswerTest(ECB_Mode_ExternalCipher::Encryption(encryption).Ref(), ECB_Mode_ExternalCipher::Decryption(decryption).Ref(), plaintext, ecb); + if (cbc) + KnownAnswerTest(CBC_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CBC_Mode_ExternalCipher::Decryption(decryption, iv).Ref(), plaintext, cbc); + if (cfb) + KnownAnswerTest(CFB_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CFB_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, cfb); + if (ofb) + KnownAnswerTest(OFB_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), OFB_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, ofb); + if (ctr) + KnownAnswerTest(CTR_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CTR_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, ctr); +} + +void KnownAnswerTest(HashTransformation &hash, const char *message, const char *digest) +{ + EqualityComparisonFilter comparison; + StringSource(digest, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); + StringSource(message, true, new HashFilter(hash, new ChannelSwitch(comparison, "0"))); + + comparison.ChannelMessageSeriesEnd("0"); + comparison.ChannelMessageSeriesEnd("1"); +} + +template +void SecureHashKnownAnswerTest(const char *message, const char *digest, HASH *dummy = NULL) +{ + CRYPTOPP_UNUSED(dummy); + HASH hash; + KnownAnswerTest(hash, message, digest); +} + +template +void MAC_KnownAnswerTest(const char *key, const char *message, const char *digest, MAC *dummy = NULL) +{ + CRYPTOPP_UNUSED(dummy); + std::string decodedKey; + StringSource(key, true, new HexDecoder(new StringSink(decodedKey))); + + MAC mac((const byte *)decodedKey.data(), decodedKey.size()); + KnownAnswerTest(mac, message, digest); +} + +template +void SignatureKnownAnswerTest(const char *key, const char *message, const char *signature, SCHEME *dummy = NULL) +{ + typename SCHEME::Signer signer(StringSource(key, true, new HexDecoder).Ref()); + typename SCHEME::Verifier verifier(signer); + + CRYPTOPP_UNUSED(dummy); + RandomPool rng; + EqualityComparisonFilter comparison; + + StringSource(message, true, new SignerFilter(rng, signer, new ChannelSwitch(comparison, "0"))); + StringSource(signature, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); + + comparison.ChannelMessageSeriesEnd("0"); + comparison.ChannelMessageSeriesEnd("1"); + + VerifierFilter verifierFilter(verifier, NULL, VerifierFilter::SIGNATURE_AT_BEGIN | VerifierFilter::THROW_EXCEPTION); + StringSource(signature, true, new HexDecoder(new Redirector(verifierFilter, Redirector::DATA_ONLY))); + StringSource(message, true, new Redirector(verifierFilter)); +} + +void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor) +{ + try + { + RandomPool rng; + const char *testMessage ="test message"; + std::string ciphertext, decrypted; + + StringSource( + testMessage, + true, + new PK_EncryptorFilter( + rng, + encryptor, + new StringSink(ciphertext))); + + if (ciphertext == testMessage) + throw 0; + + StringSource( + ciphertext, + true, + new PK_DecryptorFilter( + rng, + decryptor, + new StringSink(decrypted))); + + if (decrypted != testMessage) + throw 0; + } + catch (...) + { + throw SelfTestFailure(encryptor.AlgorithmName() + ": pairwise consistency test failed"); + } +} + +void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier) +{ + try + { + RandomPool rng; + + StringSource( + "test message", + true, + new SignerFilter( + rng, + signer, + new VerifierFilter(verifier, NULL, VerifierFilter::THROW_EXCEPTION), + true)); + } + catch (...) + { + throw SelfTestFailure(signer.AlgorithmName() + ": pairwise consistency test failed"); + } +} + +template +void SignaturePairwiseConsistencyTest(const char *key, SCHEME *dummy = NULL) +{ + typename SCHEME::Signer signer(StringSource(key, true, new HexDecoder).Ref()); + typename SCHEME::Verifier verifier(signer); + + CRYPTOPP_UNUSED(dummy); + SignaturePairwiseConsistencyTest(signer, verifier); +} + +MessageAuthenticationCode * NewIntegrityCheckingMAC() +{ + byte key[] = {0x47, 0x1E, 0x33, 0x96, 0x65, 0xB1, 0x6A, 0xED, 0x0B, 0xF8, 0x6B, 0xFD, 0x01, 0x65, 0x05, 0xCC}; + return new HMAC(key, sizeof(key)); +} + +bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac, unsigned long *pMacFileLocation) +{ + member_ptr mac(NewIntegrityCheckingMAC()); + unsigned int macSize = mac->DigestSize(); + + SecByteBlock tempMac; + SecByteBlock &actualMac = pActualMac ? *pActualMac : tempMac; + actualMac.resize(macSize); + + unsigned long tempLocation = 0; + unsigned long &macFileLocation = pMacFileLocation ? *pMacFileLocation : tempLocation; + macFileLocation = 0; + + MeterFilter verifier(new HashFilter(*mac, new ArraySink(actualMac, actualMac.size()))); +// MeterFilter verifier(new FileSink("c:\\dt.tmp")); + std::ifstream moduleStream; + +#ifdef CRYPTOPP_WIN32_AVAILABLE + HMODULE h = NULL; + { + char moduleFilenameBuf[MAX_PATH] = ""; + if (moduleFilename == NULL) + { +#if (_MSC_VER >= 1400 && !defined(_STLPORT_VERSION)) // ifstream doesn't support wide filename on other compilers + wchar_t wideModuleFilename[MAX_PATH]; + if (GetModuleFileNameW(s_hModule, wideModuleFilename, MAX_PATH) > 0) + { + moduleStream.open(wideModuleFilename, std::ios::in | std::ios::binary); + h = GetModuleHandleW(wideModuleFilename); + } + else +#endif + { + GetModuleFileNameA(s_hModule, moduleFilenameBuf, MAX_PATH); + moduleFilename = moduleFilenameBuf; + } + } +#endif + if (moduleFilename != NULL) + { + moduleStream.open(moduleFilename, std::ios::in | std::ios::binary); +#ifdef CRYPTOPP_WIN32_AVAILABLE + h = GetModuleHandleA(moduleFilename); + moduleFilename = NULL; + } +#endif + } + + if (!moduleStream) + { +#ifdef CRYPTOPP_WIN32_AVAILABLE + OutputDebugString("Crypto++ DLL integrity check failed. Cannot open file for reading."); +#endif + return false; + } + FileStore file(moduleStream); + +#ifdef CRYPTOPP_WIN32_AVAILABLE + // try to hash from memory first + const byte *memBase = (const byte *)h; + const IMAGE_DOS_HEADER *ph = (IMAGE_DOS_HEADER *)memBase; + const IMAGE_NT_HEADERS *phnt = (IMAGE_NT_HEADERS *)(memBase + ph->e_lfanew); + const IMAGE_SECTION_HEADER *phs = IMAGE_FIRST_SECTION(phnt); + DWORD nSections = phnt->FileHeader.NumberOfSections; + size_t currentFilePos = 0; + + size_t checksumPos = (byte *)&phnt->OptionalHeader.CheckSum - memBase; + size_t checksumSize = sizeof(phnt->OptionalHeader.CheckSum); + size_t certificateTableDirectoryPos = (byte *)&phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] - memBase; + size_t certificateTableDirectorySize = sizeof(phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]); + size_t certificateTablePos = phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].VirtualAddress; + size_t certificateTableSize = phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size; + + verifier.AddRangeToSkip(0, checksumPos, checksumSize); + verifier.AddRangeToSkip(0, certificateTableDirectoryPos, certificateTableDirectorySize); + verifier.AddRangeToSkip(0, certificateTablePos, certificateTableSize); + + while (nSections--) + { + switch (phs->Characteristics) + { + default: + break; + case IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ: + case IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ: + unsigned int sectionSize = STDMIN(phs->SizeOfRawData, phs->Misc.VirtualSize); + const byte *sectionMemStart = memBase + phs->VirtualAddress; + unsigned int sectionFileStart = phs->PointerToRawData; + size_t subSectionStart = 0, nextSubSectionStart; + + do + { + const byte *subSectionMemStart = sectionMemStart + subSectionStart; + size_t subSectionFileStart = sectionFileStart + subSectionStart; + size_t subSectionSize = sectionSize - subSectionStart; + nextSubSectionStart = 0; + + unsigned int entriesToReadFromDisk[] = {IMAGE_DIRECTORY_ENTRY_IMPORT, IMAGE_DIRECTORY_ENTRY_IAT}; + for (unsigned int i=0; iOptionalHeader.DataDirectory[entriesToReadFromDisk[i]]; + const byte *entryMemStart = memBase + entry.VirtualAddress; + if (subSectionMemStart <= entryMemStart && entryMemStart < subSectionMemStart + subSectionSize) + { + subSectionSize = entryMemStart - subSectionMemStart; + nextSubSectionStart = entryMemStart - sectionMemStart + entry.Size; + } + } + +#if defined(_MSC_VER) && _MSC_VER >= 1400 + // first byte of _CRT_DEBUGGER_HOOK gets modified in memory by the debugger invisibly, so read it from file + if (IsDebuggerPresent()) + { + if (subSectionMemStart <= (byte *)&_CRT_DEBUGGER_HOOK && (byte *)&_CRT_DEBUGGER_HOOK < subSectionMemStart + subSectionSize) + { + subSectionSize = (byte *)&_CRT_DEBUGGER_HOOK - subSectionMemStart; + nextSubSectionStart = (byte *)&_CRT_DEBUGGER_HOOK - sectionMemStart + 1; + } + } +#endif + + if (subSectionMemStart <= expectedModuleMac && expectedModuleMac < subSectionMemStart + subSectionSize) + { + // found stored MAC + macFileLocation = (unsigned long)(subSectionFileStart + (expectedModuleMac - subSectionMemStart)); + verifier.AddRangeToSkip(0, macFileLocation, macSize); + } + + file.TransferTo(verifier, subSectionFileStart - currentFilePos); + verifier.Put(subSectionMemStart, subSectionSize); + file.Skip(subSectionSize); + currentFilePos = subSectionFileStart + subSectionSize; + subSectionStart = nextSubSectionStart; + } while (nextSubSectionStart != 0); + } + phs++; + } +#endif + file.TransferAllTo(verifier); + +#ifdef CRYPTOPP_WIN32_AVAILABLE + // if that fails (could be caused by debug breakpoints or DLL base relocation modifying image in memory), + // hash from disk instead + if (!VerifyBufsEqual(expectedModuleMac, actualMac, macSize)) + { + OutputDebugString("In memory integrity check failed. This may be caused by debug breakpoints or DLL relocation.\n"); + moduleStream.clear(); + moduleStream.seekg(0); + verifier.Initialize(MakeParameters(Name::OutputBuffer(), ByteArrayParameter(actualMac, (unsigned int)actualMac.size()))); +// verifier.Initialize(MakeParameters(Name::OutputFileName(), (const char *)"c:\\dt2.tmp")); + verifier.AddRangeToSkip(0, checksumPos, checksumSize); + verifier.AddRangeToSkip(0, certificateTableDirectoryPos, certificateTableDirectorySize); + verifier.AddRangeToSkip(0, certificateTablePos, certificateTableSize); + verifier.AddRangeToSkip(0, macFileLocation, macSize); + FileStore(moduleStream).TransferAllTo(verifier); + } +#endif + + if (VerifyBufsEqual(expectedModuleMac, actualMac, macSize)) + return true; + +#ifdef CRYPTOPP_WIN32_AVAILABLE + std::string hexMac; + HexEncoder(new StringSink(hexMac)).PutMessageEnd(actualMac, actualMac.size()); + OutputDebugString((("Crypto++ DLL integrity check failed. Actual MAC is: " + hexMac) + "\n").c_str()); +#endif + return false; +} + +void DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac) +{ + g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE; + SetPowerUpSelfTestInProgressOnThisThread(true); + + try + { + if (FIPS_140_2_ComplianceEnabled() || expectedModuleMac != NULL) + { + if (!IntegrityCheckModule(moduleFilename, expectedModuleMac, &g_actualMac, &g_macFileLocation)) + throw 0; // throw here so we break in the debugger, this will be caught right away + } + + // algorithm tests + + X917RNG_KnownAnswerTest( + "2b7e151628aed2a6abf7158809cf4f3c", // key + "000102030405060708090a0b0c0d0e0f", // seed + "00000000000000000000000000000001", // time vector + "D176EDD27493B0395F4D10546232B0693DC7061C03C3A554F09CECF6F6B46D945A"); // output + + SymmetricEncryptionKnownAnswerTest( + "385D7189A5C3D485E1370AA5D408082B5CCCCB5E19F2D90E", + "C141B5FCCD28DC8A", + "6E1BD7C6120947A464A6AAB293A0F89A563D8D40D3461B68", + "64EAAD4ACBB9CEAD6C7615E7C7E4792FE587D91F20C7D2F4", + "6235A461AFD312973E3B4F7AA7D23E34E03371F8E8C376C9", + "E26BA806A59B0330DE40CA38E77A3E494BE2B212F6DD624B", + "E26BA806A59B03307DE2BCC25A08BA40A8BA335F5D604C62", + "E26BA806A59B03303C62C2EFF32D3ACDD5D5F35EBCC53371"); + + SymmetricEncryptionKnownAnswerTest( + "1555E5531C3A169B2D65", + "6EC9795701F49864", + "00AFA48E9621E52E8CBDA312660184EDDB1F33D9DACDA8DA", + "DBEC73562EFCAEB56204EB8AE9557EBF77473FBB52D17CD1", + "0C7B0B74E21F99B8F2C8DF37879F6C044967F42A796DCA8B", + "79FDDA9724E36CC2E023E9A5C717A8A8A7FDA465CADCBF63", + "79FDDA9724E36CC26CACBD83C1ABC06EAF5B249BE5B1E040", + "79FDDA9724E36CC211B0AEC607B95A96BCDA318440B82F49"); + + SymmetricEncryptionKnownAnswerTest( + "2b7e151628aed2a6abf7158809cf4f3c", + "000102030405060708090a0b0c0d0e0f", + "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710", // plaintext + "3ad77bb40d7a3660a89ecaf32466ef97f5d3d58503b9699de785895a96fdbaaf43b1cd7f598ece23881b00e3ed0306887b0c785e27e8ad3f8223207104725dd4", // ecb + "7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a7", // cbc + "3b3fd92eb72dad20333449f8e83cfb4ac8a64537a0b3a93fcde3cdad9f1ce58b26751f67a3cbb140b1808cf187a4f4dfc04b05357c5d1c0eeac4c66f9ff7f2e6", // cfb + "3b3fd92eb72dad20333449f8e83cfb4a7789508d16918f03f53c52dac54ed8259740051e9c5fecf64344f7a82260edcc304c6528f659c77866a510d9c1d6ae5e", // ofb + NULL); + + SymmetricEncryptionKnownAnswerTest( + "2b7e151628aed2a6abf7158809cf4f3c", + "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", + "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710", + NULL, + NULL, + NULL, + NULL, + "874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f3009cee"); // ctr + + + SecureHashKnownAnswerTest( + "abc", + "A9993E364706816ABA3E25717850C26C9CD0D89D"); + + SecureHashKnownAnswerTest( + "abc", + "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7"); + + SecureHashKnownAnswerTest( + "abc", + "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); + + SecureHashKnownAnswerTest( + "abc", + "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7"); + + SecureHashKnownAnswerTest( + "abc", + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); + + MAC_KnownAnswerTest >( + "303132333435363738393a3b3c3d3e3f40414243", + "Sample #2", + "0922d3405faa3d194f82a45830737d5cc6c75d24"); + + const char *keyRSA1 = + "30820150020100300d06092a864886f70d01010105000482013a3082013602010002400a66791dc6988168de7ab77419bb7fb0" + "c001c62710270075142942e19a8d8c51d053b3e3782a1de5dc5af4ebe99468170114a1dfe67cdc9a9af55d655620bbab0203010001" + "02400123c5b61ba36edb1d3679904199a89ea80c09b9122e1400c09adcf7784676d01d23356a7d44d6bd8bd50e94bfc723fa" + "87d8862b75177691c11d757692df8881022033d48445c859e52340de704bcdda065fbb4058d740bd1d67d29e9c146c11cf61" + "0220335e8408866b0fd38dc7002d3f972c67389a65d5d8306566d5c4f2a5aa52628b0220045ec90071525325d3d46db79695e9af" + "acc4523964360e02b119baa366316241022015eb327360c7b60d12e5e2d16bdcd97981d17fba6b70db13b20b436e24eada590220" + "2ca6366d72781dfa24d34a9a24cbc2ae927a9958af426563ff63fb11658a461d"; + + const char *keyRSA2 = + "30820273020100300D06092A864886F70D01010105000482025D3082025902010002818100D40AF9" + "A2B713034249E5780056D70FC7DE75D76E44565AA6A6B8ED9646F3C19F9E254D72D7DE6E49DB2264" + "0C1D05AB9E2A5F901D8F3FE1F7AE02CEE2ECCE54A40ABAE55A004692752E70725AEEE7CDEA67628A" + "82A9239B4AB660C2BC56D9F01E90CBAAB9BF0FC8E17173CEFC5709A29391A7DDF3E0B758691AAF30" + "725B292F4F020111027F18C0BA087D082C45D75D3594E0767E4820818EB35612B80CEAB8C880ACA5" + "44B6876DFFEF85A576C0D45B551AFAA1FD63209CD745DF75C5A0F0B580296EA466CD0338207E4752" + "FF4E7DB724D8AE18CE5CF4153BB94C27869FBB50E64F02546E4B02997A0B8623E64017CC770759C6" + "695DB649EEFD829D688D441BCC4E7348F1024100EF86DD7AF3F32CDE8A9F6564E43A559A0C9F8BAD" + "36CC25330548B347AC158A345631FA90F7B873C36EFFAE2F7823227A3F580B5DD18304D5932751E7" + "43E9234F024100E2A039854B55688740E32A51DF4AF88613D91A371CF8DDD95D780A89D7CF2119A9" + "54F1AC0F3DCDB2F6959926E6D9D37D8BC07A4C634DE6F16315BD5F0DAC340102407ECEEDB9903572" + "1B76909F174BA6698DCA72953D957B22C0A871C8531EDE3A1BB52984A719BC010D1CA57A555DB83F" + "6DE54CBAB932AEC652F38D497A6F3F30CF024100854F30E4FF232E6DADB2CD99926855F484255AB7" + "01FBCDCB27EC426F33A7046972AA700ADBCA008763DF87440F52F4E070531AC385B55AAC1C2AE7DD" + "8F9278F1024100C313F4AF9E4A9DE1253C21080CE524251560C111550772FD08690F13FBE658342E" + "BD2D41C9DCB12374E871B1839E26CAE252E1AE3DAAD5F1EE1F42B4D0EE7581"; + + SignatureKnownAnswerTest >( + keyRSA1, + "Everyone gets Friday off.", + "0610761F95FFD1B8F29DA34212947EC2AA0E358866A722F03CC3C41487ADC604A48FF54F5C6BEDB9FB7BD59F82D6E55D8F3174BA361B2214B2D74E8825E04E81"); + + SignatureKnownAnswerTest >( + keyRSA2, + "test", + "32F6BA41C8930DE71EE67F2627172CC539EDE04267FDE03AC295E3C50311F26C3B275D3AF513AC96" + "8EE493BAB7DA3A754661D1A7C4A0D1A2B7EE8B313AACD8CB8BFBC5C15EFB0EF15C86A9334A1E87AD" + "291EB961B5CA0E84930429B28780816AA94F96FC2367B71E2D2E4866FA966795B147F00600E5207E" + "2F189C883B37477C"); + + SignaturePairwiseConsistencyTest( + "3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF"); + + SignaturePairwiseConsistencyTest >( + "302D020100301006072A8648CE3D020106052B8104000404163014020101040F0070337065E1E196980A9D00E37211"); + + SignaturePairwiseConsistencyTest >( + "3039020100301306072A8648CE3D020106082A8648CE3D030101041F301D02010104182BB8A13C8B867010BD9471D9E81FDB01ABD0538C64D6249A"); + + SignaturePairwiseConsistencyTest >(keyRSA1); + } + catch (...) + { + g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED; + goto done; + } + + g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_PASSED; + +done: + SetPowerUpSelfTestInProgressOnThisThread(false); + return; +} + +#ifdef CRYPTOPP_WIN32_AVAILABLE + +void DoDllPowerUpSelfTest() +{ + CryptoPP::DoPowerUpSelfTest(NULL, s_moduleMac); +} + +#else + +void DoDllPowerUpSelfTest() +{ + throw NotImplemented("DoDllPowerUpSelfTest() only available on Windows"); +} + +#endif // #ifdef CRYPTOPP_WIN32_AVAILABLE + +NAMESPACE_END + +#ifdef CRYPTOPP_WIN32_AVAILABLE + +// DllMain needs to be in the global namespace +BOOL APIENTRY DllMain(HANDLE hModule, + DWORD dwReason, + LPVOID /*lpReserved*/) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + CryptoPP::s_hModule = (HMODULE)hModule; + CryptoPP::DoDllPowerUpSelfTest(); + } + return TRUE; +} + +#endif // #ifdef CRYPTOPP_WIN32_AVAILABLE + +#endif // #ifndef CRYPTOPP_IMPORTS diff --git a/external/crypto++-5.6.3/fltrimpl.h b/external/crypto++-5.6.3/fltrimpl.h new file mode 100644 index 000000000..8b204d84b --- /dev/null +++ b/external/crypto++-5.6.3/fltrimpl.h @@ -0,0 +1,85 @@ +#ifndef CRYPTOPP_FLTRIMPL_H +#define CRYPTOPP_FLTRIMPL_H + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4100) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-value" +#endif + +#define FILTER_BEGIN \ + switch (m_continueAt) \ + { \ + case 0: \ + m_inputPosition = 0; + +#define FILTER_END_NO_MESSAGE_END_NO_RETURN \ + break; \ + default: \ + assert(false); \ + } + +#define FILTER_END_NO_MESSAGE_END \ + FILTER_END_NO_MESSAGE_END_NO_RETURN \ + return 0; + +/* +#define FILTER_END \ + case -1: \ + if (messageEnd && Output(-1, NULL, 0, messageEnd, blocking)) \ + return 1; \ + FILTER_END_NO_MESSAGE_END +*/ + +#define FILTER_OUTPUT3(site, statement, output, length, messageEnd, channel) \ + {\ + case site: \ + statement; \ + if (Output(site, output, length, messageEnd, blocking, channel)) \ + return STDMAX(size_t(1), length-m_inputPosition);\ + } + +#define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \ + FILTER_OUTPUT3(site, statement, output, length, messageEnd, DEFAULT_CHANNEL) + +#define FILTER_OUTPUT(site, output, length, messageEnd) \ + FILTER_OUTPUT2(site, 0, output, length, messageEnd) + +#define FILTER_OUTPUT_BYTE(site, output) \ + FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0) + +#define FILTER_OUTPUT2_MODIFIABLE(site, statement, output, length, messageEnd) \ + {\ + case site: \ + statement; \ + if (OutputModifiable(site, output, length, messageEnd, blocking)) \ + return STDMAX(size_t(1), length-m_inputPosition);\ + } + +#define FILTER_OUTPUT_MODIFIABLE(site, output, length, messageEnd) \ + FILTER_OUTPUT2_MODIFIABLE(site, 0, output, length, messageEnd) + +#define FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, statement, output, length, messageEnd, modifiable) \ + {\ + case site: \ + statement; \ + if (modifiable ? OutputModifiable(site, output, length, messageEnd, blocking) : Output(site, output, length, messageEnd, blocking)) \ + return STDMAX(size_t(1), length-m_inputPosition);\ + } + +#define FILTER_OUTPUT_MAYBE_MODIFIABLE(site, output, length, messageEnd, modifiable) \ + FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, 0, output, length, messageEnd, modifiable) + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic pop +#endif + +#endif diff --git a/external/crypto++-5.6.3/gcm.cpp b/external/crypto++-5.6.3/gcm.cpp new file mode 100644 index 000000000..59faecab7 --- /dev/null +++ b/external/crypto++-5.6.3/gcm.cpp @@ -0,0 +1,864 @@ +// gcm.cpp - written and placed in the public domain by Wei Dai + +// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM gcm.cpp" to generate MASM code + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4189) +#endif + +#ifndef CRYPTOPP_IMPORTS +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#include "gcm.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +word16 GCM_Base::s_reductionTable[256]; +volatile bool GCM_Base::s_reductionTableInitialized = false; + +void GCM_Base::GCTR::IncrementCounterBy256() +{ + IncrementCounterByOne(m_counterArray+BlockSize()-4, 3); +} + +#if 0 +// preserved for testing +void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c) +{ + word64 Z0=0, Z1=0, V0, V1; + + typedef BlockGetAndPut Block; + Block::Get(a)(V0)(V1); + + for (int i=0; i<16; i++) + { + for (int j=0x80; j!=0; j>>=1) + { + int x = b[i] & j; + Z0 ^= x ? V0 : 0; + Z1 ^= x ? V1 : 0; + x = (int)V1 & 1; + V1 = (V1>>1) | (V0<<63); + V0 = (V0>>1) ^ (x ? W64LIT(0xe1) << 56 : 0); + } + } + Block::Put(NULL, c)(Z0)(Z1); +} + +__m128i _mm_clmulepi64_si128(const __m128i &a, const __m128i &b, int i) +{ + word64 A[1] = {ByteReverse(((word64*)&a)[i&1])}; + word64 B[1] = {ByteReverse(((word64*)&b)[i>>4])}; + + PolynomialMod2 pa((byte *)A, 8); + PolynomialMod2 pb((byte *)B, 8); + PolynomialMod2 c = pa*pb; + + __m128i output; + for (int i=0; i<16; i++) + ((byte *)&output)[i] = c.GetByte(i); + return output; +} +#endif + +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +inline static void SSE2_Xor16(byte *a, const byte *b, const byte *c) +{ +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE + *(__m128i *)a = _mm_xor_si128(*(__m128i *)b, *(__m128i *)c); +#else + asm ("movdqa %1, %%xmm0; pxor %2, %%xmm0; movdqa %%xmm0, %0;" : "=m" (a[0]) : "m"(b[0]), "m"(c[0])); +#endif +} +#endif + +inline static void Xor16(byte *a, const byte *b, const byte *c) +{ + ((word64 *)a)[0] = ((word64 *)b)[0] ^ ((word64 *)c)[0]; + ((word64 *)a)[1] = ((word64 *)b)[1] ^ ((word64 *)c)[1]; +} + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE +static CRYPTOPP_ALIGN_DATA(16) const word64 s_clmulConstants64[] = { + W64LIT(0xe100000000000000), W64LIT(0xc200000000000000), + W64LIT(0x08090a0b0c0d0e0f), W64LIT(0x0001020304050607), + W64LIT(0x0001020304050607), W64LIT(0x08090a0b0c0d0e0f)}; +static const __m128i *s_clmulConstants = (const __m128i *)s_clmulConstants64; +static const unsigned int s_clmulTableSizeInBlocks = 8; + +inline __m128i CLMUL_Reduce(__m128i c0, __m128i c1, __m128i c2, const __m128i &r) +{ + /* + The polynomial to be reduced is c0 * x^128 + c1 * x^64 + c2. c0t below refers to the most + significant half of c0 as a polynomial, which, due to GCM's bit reflection, are in the + rightmost bit positions, and the lowest byte addresses. + + c1 ^= c0t * 0xc200000000000000 + c2t ^= c0t + t = shift (c1t ^ c0b) left 1 bit + c2 ^= t * 0xe100000000000000 + c2t ^= c1b + shift c2 left 1 bit and xor in lowest bit of c1t + */ +#if 0 // MSVC 2010 workaround: see http://connect.microsoft.com/VisualStudio/feedback/details/575301 + c2 = _mm_xor_si128(c2, _mm_move_epi64(c0)); +#else + c1 = _mm_xor_si128(c1, _mm_slli_si128(c0, 8)); +#endif + c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(c0, r, 0x10)); + c0 = _mm_srli_si128(c0, 8); + c0 = _mm_xor_si128(c0, c1); + c0 = _mm_slli_epi64(c0, 1); + c0 = _mm_clmulepi64_si128(c0, r, 0); + c2 = _mm_xor_si128(c2, c0); + c2 = _mm_xor_si128(c2, _mm_srli_si128(c1, 8)); + c1 = _mm_unpacklo_epi64(c1, c2); + c1 = _mm_srli_epi64(c1, 63); + c2 = _mm_slli_epi64(c2, 1); + return _mm_xor_si128(c2, c1); +} + +inline __m128i CLMUL_GF_Mul(const __m128i &x, const __m128i &h, const __m128i &r) +{ + __m128i c0 = _mm_clmulepi64_si128(x,h,0); + __m128i c1 = _mm_xor_si128(_mm_clmulepi64_si128(x,h,1), _mm_clmulepi64_si128(x,h,0x10)); + __m128i c2 = _mm_clmulepi64_si128(x,h,0x11); + + return CLMUL_Reduce(c0, c1, c2, r); +} +#endif + +void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) +{ + BlockCipher &blockCipher = AccessBlockCipher(); + blockCipher.SetKey(userKey, keylength, params); + + if (blockCipher.BlockSize() != REQUIRED_BLOCKSIZE) + throw InvalidArgument(AlgorithmName() + ": block size of underlying block cipher is not 16"); + + int tableSize, i, j, k; + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasCLMUL()) + { + // Avoid "parameter not used" error and suppress Coverity finding + (void)params.GetIntValue(Name::TableSize(), tableSize); + tableSize = s_clmulTableSizeInBlocks * REQUIRED_BLOCKSIZE; + } + else +#endif + { + if (params.GetIntValue(Name::TableSize(), tableSize)) + tableSize = (tableSize >= 64*1024) ? 64*1024 : 2*1024; + else + tableSize = (GetTablesOption() == GCM_64K_Tables) ? 64*1024 : 2*1024; + +#if defined(_MSC_VER) && (_MSC_VER >= 1300 && _MSC_VER < 1400) + // VC 2003 workaround: compiler generates bad code for 64K tables + tableSize = 2*1024; +#endif + } + + m_buffer.resize(3*REQUIRED_BLOCKSIZE + tableSize); + byte *table = MulTable(); + byte *hashKey = HashKey(); + memset(hashKey, 0, REQUIRED_BLOCKSIZE); + blockCipher.ProcessBlock(hashKey); + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasCLMUL()) + { + const __m128i r = s_clmulConstants[0]; + __m128i h0 = _mm_shuffle_epi8(_mm_load_si128((__m128i *)hashKey), s_clmulConstants[1]); + __m128i h = h0; + + for (i=0; i Block; + Block::Get(hashKey)(V0)(V1); + + if (tableSize == 64*1024) + { + for (i=0; i<128; i++) + { + k = i%8; + Block::Put(NULL, table+(i/8)*256*16+(size_t(1)<<(11-k)))(V0)(V1); + + int x = (int)V1 & 1; + V1 = (V1>>1) | (V0<<63); + V0 = (V0>>1) ^ (x ? W64LIT(0xe1) << 56 : 0); + } + + for (i=0; i<16; i++) + { + memset(table+i*256*16, 0, 16); +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + if (HasSSE2()) + for (j=2; j<=0x80; j*=2) + for (k=1; k>1) | (V0<<63); + V0 = (V0>>1) ^ (x ? W64LIT(0xe1) << 56 : 0); + } + + for (i=0; i<4; i++) + { + memset(table+i*256, 0, 16); + memset(table+1024+i*256, 0, 16); +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + if (HasSSE2()) + for (j=2; j<=8; j*=2) + for (k=1; k= HASH_BLOCKSIZE) + { + len = GCM_Base::AuthenticateBlocks(iv, len); + iv += (origLen - len); + } + + if (len > 0) + { + memcpy(m_buffer, iv, len); + memset(m_buffer+len, 0, HASH_BLOCKSIZE-len); + GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); + } + + PutBlock(NULL, m_buffer)(0)(origLen*8); + GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); + + ReverseHashBufferIfNeeded(); + } + + if (m_state >= State_IVSet) + m_ctr.Resynchronize(hashBuffer, REQUIRED_BLOCKSIZE); + else + m_ctr.SetCipherWithIV(cipher, hashBuffer); + + m_ctr.Seek(HASH_BLOCKSIZE); + + memset(hashBuffer, 0, HASH_BLOCKSIZE); +} + +unsigned int GCM_Base::OptimalDataAlignment() const +{ + return +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) + HasSSE2() ? 16 : +#endif + GetBlockCipher().OptimalDataAlignment(); +} + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code +#endif + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +void GCM_AuthenticateBlocks_2K(const byte *data, size_t blocks, word64 *hashBuffer, const word16 *reductionTable); +void GCM_AuthenticateBlocks_64K(const byte *data, size_t blocks, word64 *hashBuffer); +} +#endif + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) +{ +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasCLMUL()) + { + const __m128i *table = (const __m128i *)MulTable(); + __m128i x = _mm_load_si128((__m128i *)HashBuffer()); + const __m128i r = s_clmulConstants[0], bswapMask = s_clmulConstants[1], bswapMask2 = s_clmulConstants[2]; + + while (len >= 16) + { + size_t s = UnsignedMin(len/16, s_clmulTableSizeInBlocks), i=0; + __m128i d, d2 = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(data+(s-1)*16)), bswapMask2);; + __m128i c0 = _mm_setzero_si128(); + __m128i c1 = _mm_setzero_si128(); + __m128i c2 = _mm_setzero_si128(); + + while (true) + { + __m128i h0 = _mm_load_si128(table+i); + __m128i h1 = _mm_load_si128(table+i+1); + __m128i h01 = _mm_xor_si128(h0, h1); + + if (++i == s) + { + d = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)data), bswapMask); + d = _mm_xor_si128(d, x); + c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d, h0, 0)); + c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d, h1, 1)); + d = _mm_xor_si128(d, _mm_shuffle_epi32(d, _MM_SHUFFLE(1, 0, 3, 2))); + c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d, h01, 0)); + break; + } + + d = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(data+(s-i)*16-8)), bswapMask2); + c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d2, h0, 1)); + c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d, h1, 1)); + d2 = _mm_xor_si128(d2, d); + c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d2, h01, 1)); + + if (++i == s) + { + d = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)data), bswapMask); + d = _mm_xor_si128(d, x); + c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d, h0, 0x10)); + c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d, h1, 0x11)); + d = _mm_xor_si128(d, _mm_shuffle_epi32(d, _MM_SHUFFLE(1, 0, 3, 2))); + c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d, h01, 0x10)); + break; + } + + d2 = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(data+(s-i)*16-8)), bswapMask); + c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d, h0, 0x10)); + c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d2, h1, 0x10)); + d = _mm_xor_si128(d, d2); + c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d, h01, 0x10)); + } + data += s*16; + len -= s*16; + + c1 = _mm_xor_si128(_mm_xor_si128(c1, c0), c2); + x = CLMUL_Reduce(c0, c1, c2, r); + } + + _mm_store_si128((__m128i *)HashBuffer(), x); + return len; + } +#endif + + typedef BlockGetAndPut Block; + word64 *hashBuffer = (word64 *)HashBuffer(); + + switch (2*(m_buffer.size()>=64*1024) +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) + + HasSSE2() +#endif + ) + { + case 0: // non-SSE2 and 2K tables + { + byte *table = MulTable(); + word64 x0 = hashBuffer[0], x1 = hashBuffer[1]; + + do + { + word64 y0, y1, a0, a1, b0, b1, c0, c1, d0, d1; + Block::Get(data)(y0)(y1); + x0 ^= y0; + x1 ^= y1; + + data += HASH_BLOCKSIZE; + len -= HASH_BLOCKSIZE; + + #define READ_TABLE_WORD64_COMMON(a, b, c, d) *(word64 *)(table+(a*1024)+(b*256)+c+d*8) + + #ifdef IS_LITTLE_ENDIAN + #if CRYPTOPP_BOOL_SLOW_WORD64 + word32 z0 = (word32)x0; + word32 z1 = (word32)(x0>>32); + word32 z2 = (word32)x1; + word32 z3 = (word32)(x1>>32); + #define READ_TABLE_WORD64(a, b, c, d, e) READ_TABLE_WORD64_COMMON((d%2), c, (d?(z##c>>((d?d-1:0)*4))&0xf0:(z##c&0xf)<<4), e) + #else + #define READ_TABLE_WORD64(a, b, c, d, e) READ_TABLE_WORD64_COMMON((d%2), c, ((d+8*b)?(x##a>>(((d+8*b)?(d+8*b)-1:1)*4))&0xf0:(x##a&0xf)<<4), e) + #endif + #define GF_MOST_SIG_8BITS(a) (a##1 >> 7*8) + #define GF_SHIFT_8(a) a##1 = (a##1 << 8) ^ (a##0 >> 7*8); a##0 <<= 8; + #else + #define READ_TABLE_WORD64(a, b, c, d, e) READ_TABLE_WORD64_COMMON((1-d%2), c, ((15-d-8*b)?(x##a>>(((15-d-8*b)?(15-d-8*b)-1:0)*4))&0xf0:(x##a&0xf)<<4), e) + #define GF_MOST_SIG_8BITS(a) (a##1 & 0xff) + #define GF_SHIFT_8(a) a##1 = (a##1 >> 8) ^ (a##0 << 7*8); a##0 >>= 8; + #endif + + #define GF_MUL_32BY128(op, a, b, c) \ + a0 op READ_TABLE_WORD64(a, b, c, 0, 0) ^ READ_TABLE_WORD64(a, b, c, 1, 0);\ + a1 op READ_TABLE_WORD64(a, b, c, 0, 1) ^ READ_TABLE_WORD64(a, b, c, 1, 1);\ + b0 op READ_TABLE_WORD64(a, b, c, 2, 0) ^ READ_TABLE_WORD64(a, b, c, 3, 0);\ + b1 op READ_TABLE_WORD64(a, b, c, 2, 1) ^ READ_TABLE_WORD64(a, b, c, 3, 1);\ + c0 op READ_TABLE_WORD64(a, b, c, 4, 0) ^ READ_TABLE_WORD64(a, b, c, 5, 0);\ + c1 op READ_TABLE_WORD64(a, b, c, 4, 1) ^ READ_TABLE_WORD64(a, b, c, 5, 1);\ + d0 op READ_TABLE_WORD64(a, b, c, 6, 0) ^ READ_TABLE_WORD64(a, b, c, 7, 0);\ + d1 op READ_TABLE_WORD64(a, b, c, 6, 1) ^ READ_TABLE_WORD64(a, b, c, 7, 1);\ + + GF_MUL_32BY128(=, 0, 0, 0) + GF_MUL_32BY128(^=, 0, 1, 1) + GF_MUL_32BY128(^=, 1, 0, 2) + GF_MUL_32BY128(^=, 1, 1, 3) + + word32 r = (word32)s_reductionTable[GF_MOST_SIG_8BITS(d)] << 16; + GF_SHIFT_8(d) + c0 ^= d0; c1 ^= d1; + r ^= (word32)s_reductionTable[GF_MOST_SIG_8BITS(c)] << 8; + GF_SHIFT_8(c) + b0 ^= c0; b1 ^= c1; + r ^= s_reductionTable[GF_MOST_SIG_8BITS(b)]; + GF_SHIFT_8(b) + a0 ^= b0; a1 ^= b1; + a0 ^= ConditionalByteReverse(LITTLE_ENDIAN_ORDER, r); + x0 = a0; x1 = a1; + } + while (len >= HASH_BLOCKSIZE); + + hashBuffer[0] = x0; hashBuffer[1] = x1; + return len; + } + + case 2: // non-SSE2 and 64K tables + { + byte *table = MulTable(); + word64 x0 = hashBuffer[0], x1 = hashBuffer[1]; + + do + { + word64 y0, y1, a0, a1; + Block::Get(data)(y0)(y1); + x0 ^= y0; + x1 ^= y1; + + data += HASH_BLOCKSIZE; + len -= HASH_BLOCKSIZE; + + #undef READ_TABLE_WORD64_COMMON + #undef READ_TABLE_WORD64 + + #define READ_TABLE_WORD64_COMMON(a, c, d) *(word64 *)(table+(a)*256*16+(c)+(d)*8) + + #ifdef IS_LITTLE_ENDIAN + #if CRYPTOPP_BOOL_SLOW_WORD64 + word32 z0 = (word32)x0; + word32 z1 = (word32)(x0>>32); + word32 z2 = (word32)x1; + word32 z3 = (word32)(x1>>32); + #define READ_TABLE_WORD64(b, c, d, e) READ_TABLE_WORD64_COMMON(c*4+d, (d?(z##c>>((d?d:1)*8-4))&0xff0:(z##c&0xff)<<4), e) + #else + #define READ_TABLE_WORD64(b, c, d, e) READ_TABLE_WORD64_COMMON(c*4+d, ((d+4*(c%2))?(x##b>>(((d+4*(c%2))?(d+4*(c%2)):1)*8-4))&0xff0:(x##b&0xff)<<4), e) + #endif + #else + #define READ_TABLE_WORD64(b, c, d, e) READ_TABLE_WORD64_COMMON(c*4+d, ((7-d-4*(c%2))?(x##b>>(((7-d-4*(c%2))?(7-d-4*(c%2)):1)*8-4))&0xff0:(x##b&0xff)<<4), e) + #endif + + #define GF_MUL_8BY128(op, b, c, d) \ + a0 op READ_TABLE_WORD64(b, c, d, 0);\ + a1 op READ_TABLE_WORD64(b, c, d, 1);\ + + GF_MUL_8BY128(=, 0, 0, 0) + GF_MUL_8BY128(^=, 0, 0, 1) + GF_MUL_8BY128(^=, 0, 0, 2) + GF_MUL_8BY128(^=, 0, 0, 3) + GF_MUL_8BY128(^=, 0, 1, 0) + GF_MUL_8BY128(^=, 0, 1, 1) + GF_MUL_8BY128(^=, 0, 1, 2) + GF_MUL_8BY128(^=, 0, 1, 3) + GF_MUL_8BY128(^=, 1, 2, 0) + GF_MUL_8BY128(^=, 1, 2, 1) + GF_MUL_8BY128(^=, 1, 2, 2) + GF_MUL_8BY128(^=, 1, 2, 3) + GF_MUL_8BY128(^=, 1, 3, 0) + GF_MUL_8BY128(^=, 1, 3, 1) + GF_MUL_8BY128(^=, 1, 3, 2) + GF_MUL_8BY128(^=, 1, 3, 3) + + x0 = a0; x1 = a1; + } + while (len >= HASH_BLOCKSIZE); + + hashBuffer[0] = x0; hashBuffer[1] = x1; + return len; + } +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE + case 1: // SSE2 and 2K tables + GCM_AuthenticateBlocks_2K(data, len/16, hashBuffer, s_reductionTable); + return len % 16; + case 3: // SSE2 and 64K tables + GCM_AuthenticateBlocks_64K(data, len/16, hashBuffer); + return len % 16; +#endif + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + case 1: // SSE2 and 2K tables + { + #ifdef __GNUC__ + __asm__ __volatile__ + ( + INTEL_NOPREFIX + #elif defined(CRYPTOPP_GENERATE_X64_MASM) + ALIGN 8 + GCM_AuthenticateBlocks_2K PROC FRAME + rex_push_reg rsi + push_reg rdi + push_reg rbx + .endprolog + mov rsi, r8 + mov r11, r9 + #else + AS2( mov WORD_REG(cx), data ) + AS2( mov WORD_REG(dx), len ) + AS2( mov WORD_REG(si), hashBuffer ) + AS2( shr WORD_REG(dx), 4 ) + #endif + + #if CRYPTOPP_BOOL_X32 + AS1(push rbx) + AS1(push rbp) + #else + AS_PUSH_IF86( bx) + AS_PUSH_IF86( bp) + #endif + + #ifdef __GNUC__ + AS2( mov AS_REG_7, WORD_REG(di)) + #elif CRYPTOPP_BOOL_X86 + AS2( lea AS_REG_7, s_reductionTable) + #endif + + AS2( movdqa xmm0, [WORD_REG(si)] ) + + #define MUL_TABLE_0 WORD_REG(si) + 32 + #define MUL_TABLE_1 WORD_REG(si) + 32 + 1024 + #define RED_TABLE AS_REG_7 + + ASL(0) + AS2( movdqu xmm4, [WORD_REG(cx)] ) + AS2( pxor xmm0, xmm4 ) + + AS2( movd ebx, xmm0 ) + AS2( mov eax, AS_HEX(f0f0f0f0) ) + AS2( and eax, ebx ) + AS2( shl ebx, 4 ) + AS2( and ebx, AS_HEX(f0f0f0f0) ) + AS2( movzx edi, ah ) + AS2( movdqa xmm5, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) + AS2( movzx edi, al ) + AS2( movdqa xmm4, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) + AS2( shr eax, 16 ) + AS2( movzx edi, ah ) + AS2( movdqa xmm3, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) + AS2( movzx edi, al ) + AS2( movdqa xmm2, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) + + #define SSE2_MUL_32BITS(i) \ + AS2( psrldq xmm0, 4 )\ + AS2( movd eax, xmm0 )\ + AS2( and eax, AS_HEX(f0f0f0f0) )\ + AS2( movzx edi, bh )\ + AS2( pxor xmm5, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ + AS2( movzx edi, bl )\ + AS2( pxor xmm4, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ + AS2( shr ebx, 16 )\ + AS2( movzx edi, bh )\ + AS2( pxor xmm3, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ + AS2( movzx edi, bl )\ + AS2( pxor xmm2, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ + AS2( movd ebx, xmm0 )\ + AS2( shl ebx, 4 )\ + AS2( and ebx, AS_HEX(f0f0f0f0) )\ + AS2( movzx edi, ah )\ + AS2( pxor xmm5, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ + AS2( movzx edi, al )\ + AS2( pxor xmm4, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ + AS2( shr eax, 16 )\ + AS2( movzx edi, ah )\ + AS2( pxor xmm3, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ + AS2( movzx edi, al )\ + AS2( pxor xmm2, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ + + SSE2_MUL_32BITS(1) + SSE2_MUL_32BITS(2) + SSE2_MUL_32BITS(3) + + AS2( movzx edi, bh ) + AS2( pxor xmm5, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) + AS2( movzx edi, bl ) + AS2( pxor xmm4, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) + AS2( shr ebx, 16 ) + AS2( movzx edi, bh ) + AS2( pxor xmm3, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) + AS2( movzx edi, bl ) + AS2( pxor xmm2, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) + + AS2( movdqa xmm0, xmm3 ) + AS2( pslldq xmm3, 1 ) + AS2( pxor xmm2, xmm3 ) + AS2( movdqa xmm1, xmm2 ) + AS2( pslldq xmm2, 1 ) + AS2( pxor xmm5, xmm2 ) + + AS2( psrldq xmm0, 15 ) +#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) + AS2( movd edi, xmm0 ) +#elif defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) + AS2( mov WORD_REG(di), xmm0 ) +#else // GNU Assembler + AS2( movd WORD_REG(di), xmm0 ) +#endif + AS2( movzx eax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) + AS2( shl eax, 8 ) + + AS2( movdqa xmm0, xmm5 ) + AS2( pslldq xmm5, 1 ) + AS2( pxor xmm4, xmm5 ) + + AS2( psrldq xmm1, 15 ) +#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) + AS2( movd edi, xmm1 ) +#elif defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) + AS2( mov WORD_REG(di), xmm1 ) +#else + AS2( movd WORD_REG(di), xmm1 ) +#endif + AS2( xor ax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) + AS2( shl eax, 8 ) + + AS2( psrldq xmm0, 15 ) +#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) + AS2( movd edi, xmm0 ) +#elif defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) + AS2( mov WORD_REG(di), xmm0 ) +#else + AS2( movd WORD_REG(di), xmm0 ) +#endif + AS2( xor ax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) + + AS2( movd xmm0, eax ) + AS2( pxor xmm0, xmm4 ) + + AS2( add WORD_REG(cx), 16 ) + AS2( sub WORD_REG(dx), 1 ) + ASJ( jnz, 0, b ) + AS2( movdqa [WORD_REG(si)], xmm0 ) + + #if CRYPTOPP_BOOL_X32 + AS1(pop rbp) + AS1(pop rbx) + #else + AS_POP_IF86( bp) + AS_POP_IF86( bx) + #endif + + #ifdef __GNUC__ + ATT_PREFIX + : + : "c" (data), "d" (len/16), "S" (hashBuffer), "D" (s_reductionTable) + : "memory", "cc", "%eax" + #if CRYPTOPP_BOOL_X64 + , "%ebx", "%r11" + #endif + ); + #elif defined(CRYPTOPP_GENERATE_X64_MASM) + pop rbx + pop rdi + pop rsi + ret + GCM_AuthenticateBlocks_2K ENDP + #endif + + return len%16; + } + case 3: // SSE2 and 64K tables + { + #ifdef __GNUC__ + __asm__ __volatile__ + ( + INTEL_NOPREFIX + #elif defined(CRYPTOPP_GENERATE_X64_MASM) + ALIGN 8 + GCM_AuthenticateBlocks_64K PROC FRAME + rex_push_reg rsi + push_reg rdi + .endprolog + mov rsi, r8 + #else + AS2( mov WORD_REG(cx), data ) + AS2( mov WORD_REG(dx), len ) + AS2( mov WORD_REG(si), hashBuffer ) + AS2( shr WORD_REG(dx), 4 ) + #endif + + AS2( movdqa xmm0, [WORD_REG(si)] ) + + #undef MUL_TABLE + #define MUL_TABLE(i,j) WORD_REG(si) + 32 + (i*4+j)*256*16 + + ASL(1) + AS2( movdqu xmm1, [WORD_REG(cx)] ) + AS2( pxor xmm1, xmm0 ) + AS2( pxor xmm0, xmm0 ) + + #undef SSE2_MUL_32BITS + #define SSE2_MUL_32BITS(i) \ + AS2( movd eax, xmm1 )\ + AS2( psrldq xmm1, 4 )\ + AS2( movzx edi, al )\ + AS2( add WORD_REG(di), WORD_REG(di) )\ + AS2( pxor xmm0, [MUL_TABLE(i,0) + WORD_REG(di)*8] )\ + AS2( movzx edi, ah )\ + AS2( add WORD_REG(di), WORD_REG(di) )\ + AS2( pxor xmm0, [MUL_TABLE(i,1) + WORD_REG(di)*8] )\ + AS2( shr eax, 16 )\ + AS2( movzx edi, al )\ + AS2( add WORD_REG(di), WORD_REG(di) )\ + AS2( pxor xmm0, [MUL_TABLE(i,2) + WORD_REG(di)*8] )\ + AS2( movzx edi, ah )\ + AS2( add WORD_REG(di), WORD_REG(di) )\ + AS2( pxor xmm0, [MUL_TABLE(i,3) + WORD_REG(di)*8] )\ + + SSE2_MUL_32BITS(0) + SSE2_MUL_32BITS(1) + SSE2_MUL_32BITS(2) + SSE2_MUL_32BITS(3) + + AS2( add WORD_REG(cx), 16 ) + AS2( sub WORD_REG(dx), 1 ) + ASJ( jnz, 1, b ) + AS2( movdqa [WORD_REG(si)], xmm0 ) + + #ifdef __GNUC__ + ATT_PREFIX + : + : "c" (data), "d" (len/16), "S" (hashBuffer) + : "memory", "cc", "%edi", "%eax" + ); + #elif defined(CRYPTOPP_GENERATE_X64_MASM) + pop rdi + pop rsi + ret + GCM_AuthenticateBlocks_64K ENDP + #endif + + return len%16; + } +#endif +#ifndef CRYPTOPP_GENERATE_X64_MASM + } + + return len%16; +} + +void GCM_Base::AuthenticateLastHeaderBlock() +{ + if (m_bufferedDataLength > 0) + { + memset(m_buffer+m_bufferedDataLength, 0, HASH_BLOCKSIZE-m_bufferedDataLength); + m_bufferedDataLength = 0; + GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); + } +} + +void GCM_Base::AuthenticateLastConfidentialBlock() +{ + GCM_Base::AuthenticateLastHeaderBlock(); + PutBlock(NULL, m_buffer)(m_totalHeaderLength*8)(m_totalMessageLength*8); + GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); +} + +void GCM_Base::AuthenticateLastFooterBlock(byte *mac, size_t macSize) +{ + m_ctr.Seek(0); + ReverseHashBufferIfNeeded(); + m_ctr.ProcessData(mac, HashBuffer(), macSize); +} + +NAMESPACE_END + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM +#endif diff --git a/external/crypto++-5.6.3/gcm.h b/external/crypto++-5.6.3/gcm.h new file mode 100644 index 000000000..2dd91c4d4 --- /dev/null +++ b/external/crypto++-5.6.3/gcm.h @@ -0,0 +1,127 @@ +// gcm.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile gcm.h +//! \brief GCM block cipher mode of operation + +#ifndef CRYPTOPP_GCM_H +#define CRYPTOPP_GCM_H + +#include "authenc.h" +#include "modes.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \enum GCM_TablesOption +//! \brief Use either 2K or 64K size tables. +enum GCM_TablesOption {GCM_2K_Tables, GCM_64K_Tables}; + +//! \class GCM_Base +//! \brief CCM block cipher mode of operation. +//! \details Implementations and overrides in \p GCM_Base apply to both \p ENCRYPTION and \p DECRYPTION directions +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE GCM_Base : public AuthenticatedSymmetricCipherBase +{ +public: + // AuthenticatedSymmetricCipher + std::string AlgorithmName() const + {return GetBlockCipher().AlgorithmName() + std::string("/GCM");} + size_t MinKeyLength() const + {return GetBlockCipher().MinKeyLength();} + size_t MaxKeyLength() const + {return GetBlockCipher().MaxKeyLength();} + size_t DefaultKeyLength() const + {return GetBlockCipher().DefaultKeyLength();} + size_t GetValidKeyLength(size_t n) const + {return GetBlockCipher().GetValidKeyLength(n);} + bool IsValidKeyLength(size_t n) const + {return GetBlockCipher().IsValidKeyLength(n);} + unsigned int OptimalDataAlignment() const; + IV_Requirement IVRequirement() const + {return UNIQUE_IV;} + unsigned int IVSize() const + {return 12;} + unsigned int MinIVLength() const + {return 1;} + unsigned int MaxIVLength() const + {return UINT_MAX;} // (W64LIT(1)<<61)-1 in the standard + unsigned int DigestSize() const + {return 16;} + lword MaxHeaderLength() const + {return (W64LIT(1)<<61)-1;} + lword MaxMessageLength() const + {return ((W64LIT(1)<<39)-256)/8;} + +protected: + // AuthenticatedSymmetricCipherBase + bool AuthenticationIsOnPlaintext() const + {return false;} + unsigned int AuthenticationBlockSize() const + {return HASH_BLOCKSIZE;} + void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); + void Resync(const byte *iv, size_t len); + size_t AuthenticateBlocks(const byte *data, size_t len); + void AuthenticateLastHeaderBlock(); + void AuthenticateLastConfidentialBlock(); + void AuthenticateLastFooterBlock(byte *mac, size_t macSize); + SymmetricCipher & AccessSymmetricCipher() {return m_ctr;} + + virtual BlockCipher & AccessBlockCipher() =0; + virtual GCM_TablesOption GetTablesOption() const =0; + + const BlockCipher & GetBlockCipher() const {return const_cast(this)->AccessBlockCipher();}; + byte *HashBuffer() {return m_buffer+REQUIRED_BLOCKSIZE;} + byte *HashKey() {return m_buffer+2*REQUIRED_BLOCKSIZE;} + byte *MulTable() {return m_buffer+3*REQUIRED_BLOCKSIZE;} + inline void ReverseHashBufferIfNeeded(); + + class CRYPTOPP_DLL GCTR : public CTR_Mode_ExternalCipher::Encryption + { + protected: + void IncrementCounterBy256(); + }; + + GCTR m_ctr; + static word16 s_reductionTable[256]; + static volatile bool s_reductionTableInitialized; + enum {REQUIRED_BLOCKSIZE = 16, HASH_BLOCKSIZE = 16}; +}; + +//! \class GCM_Final +//! \brief Class specific methods used to operate the cipher. +//! \tparam T_BlockCipher block cipher +//! \tparam T_TablesOption table size, either \p GCM_2K_Tables or \p GCM_64K_Tables +//! \tparam T_IsEncryption direction in which to operate the cipher +//! \details Implementations and overrides in \p GCM_Final apply to either +//! \p ENCRYPTION or \p DECRYPTION, depending on the template parameter \p T_IsEncryption. +//! \details \p GCM_Final does not use inner classes \p Enc and \p Dec. +template +class GCM_Final : public GCM_Base +{ +public: + static std::string StaticAlgorithmName() + {return T_BlockCipher::StaticAlgorithmName() + std::string("/GCM");} + bool IsForwardTransformation() const + {return T_IsEncryption;} + +private: + GCM_TablesOption GetTablesOption() const {return T_TablesOption;} + BlockCipher & AccessBlockCipher() {return m_cipher;} + typename T_BlockCipher::Encryption m_cipher; +}; + +//! \class GCM +//! \brief The GCM mode of operation +//! \tparam T_BlockCipher block cipher +//! \tparam T_TablesOption table size, either \p GCM_2K_Tables or \p GCM_64K_Tables +//! \details \p GCM provides the \p Encryption and \p Decryption typedef. +//! \sa GCM at the Crypto Lounge +template +struct GCM : public AuthenticatedSymmetricCipherDocumentation +{ + typedef GCM_Final Encryption; + typedef GCM_Final Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/gf256.cpp b/external/crypto++-5.6.3/gf256.cpp new file mode 100644 index 000000000..72026d1e1 --- /dev/null +++ b/external/crypto++-5.6.3/gf256.cpp @@ -0,0 +1,34 @@ +// gf256.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "gf256.h" + +NAMESPACE_BEGIN(CryptoPP) + +GF256::Element GF256::Multiply(Element a, Element b) const +{ + word result = 0, t = b; + + for (unsigned int i=0; i<8; i++) + { + result <<= 1; + if (result & 0x100) + result ^= m_modulus; + + t <<= 1; + if (t & 0x100) + result ^= a; + } + + return (GF256::Element) result; +} + +GF256::Element GF256::MultiplicativeInverse(Element a) const +{ + Element result = a; + for (int i=1; i<7; i++) + result = Multiply(Square(result), a); + return Square(result); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/gf256.h b/external/crypto++-5.6.3/gf256.h new file mode 100644 index 000000000..007fb00b2 --- /dev/null +++ b/external/crypto++-5.6.3/gf256.h @@ -0,0 +1,67 @@ +#ifndef CRYPTOPP_GF256_H +#define CRYPTOPP_GF256_H + +#include "cryptlib.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! GF(256) with polynomial basis +class GF256 +{ +public: + typedef byte Element; + typedef int RandomizationParameter; + + GF256(byte modulus) : m_modulus(modulus) {} + + Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const + {CRYPTOPP_UNUSED(ignored); return rng.GenerateByte();} + + bool Equal(Element a, Element b) const + {return a==b;} + + Element Zero() const + {return 0;} + + Element Add(Element a, Element b) const + {return a^b;} + + Element& Accumulate(Element &a, Element b) const + {return a^=b;} + + Element Inverse(Element a) const + {return a;} + + Element Subtract(Element a, Element b) const + {return a^b;} + + Element& Reduce(Element &a, Element b) const + {return a^=b;} + + Element Double(Element a) const + {CRYPTOPP_UNUSED(a); return 0;} + + Element One() const + {return 1;} + + Element Multiply(Element a, Element b) const; + + Element Square(Element a) const + {return Multiply(a, a);} + + bool IsUnit(Element a) const + {return a != 0;} + + Element MultiplicativeInverse(Element a) const; + + Element Divide(Element a, Element b) const + {return Multiply(a, MultiplicativeInverse(b));} + +private: + word m_modulus; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/gf2_32.cpp b/external/crypto++-5.6.3/gf2_32.cpp new file mode 100644 index 000000000..ae4874a40 --- /dev/null +++ b/external/crypto++-5.6.3/gf2_32.cpp @@ -0,0 +1,99 @@ +// gf2_32.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "misc.h" +#include "gf2_32.h" + +NAMESPACE_BEGIN(CryptoPP) + +GF2_32::Element GF2_32::Multiply(Element a, Element b) const +{ + word32 table[4]; + table[0] = 0; + table[1] = m_modulus; + if (a & 0x80000000) + { + table[2] = m_modulus ^ (a<<1); + table[3] = a<<1; + } + else + { + table[2] = a<<1; + table[3] = m_modulus ^ (a<<1); + } + +#if CRYPTOPP_FAST_ROTATE(32) + b = rotrFixed(b, 30U); + word32 result = table[b&2]; + + for (int i=29; i>=0; --i) + { + b = rotlFixed(b, 1U); + result = (result<<1) ^ table[(b&2) + (result>>31)]; + } + + return (b&1) ? result ^ a : result; +#else + word32 result = table[(b>>30) & 2]; + + for (int i=29; i>=0; --i) + result = (result<<1) ^ table[((b>>i)&2) + (result>>31)]; + + return (b&1) ? result ^ a : result; +#endif +} + +GF2_32::Element GF2_32::MultiplicativeInverse(Element a) const +{ + if (a <= 1) // 1 is a special case + return a; + + // warning - don't try to adapt this algorithm for another situation + word32 g0=m_modulus, g1=a, g2=a; + word32 v0=0, v1=1, v2=1; + + assert(g1); + + while (!(g2 & 0x80000000)) + { + g2 <<= 1; + v2 <<= 1; + } + + g2 <<= 1; + v2 <<= 1; + + g0 ^= g2; + v0 ^= v2; + + while (g0 != 1) + { + if (g1 < g0 || ((g0^g1) < g0 && (g0^g1) < g1)) + { + assert(BitPrecision(g1) <= BitPrecision(g0)); + g2 = g1; + v2 = v1; + } + else + { + assert(BitPrecision(g1) > BitPrecision(g0)); + g2 = g0; g0 = g1; g1 = g2; + v2 = v0; v0 = v1; v1 = v2; + } + + while ((g0^g2) >= g2) + { + assert(BitPrecision(g0) > BitPrecision(g2)); + g2 <<= 1; + v2 <<= 1; + } + + assert(BitPrecision(g0) == BitPrecision(g2)); + g0 ^= g2; + v0 ^= v2; + } + + return v0; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/gf2_32.h b/external/crypto++-5.6.3/gf2_32.h new file mode 100644 index 000000000..32499b5be --- /dev/null +++ b/external/crypto++-5.6.3/gf2_32.h @@ -0,0 +1,68 @@ +#ifndef CRYPTOPP_GF2_32_H +#define CRYPTOPP_GF2_32_H + +#include "cryptlib.h" +#include "secblock.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! GF(2^32) with polynomial basis +class GF2_32 +{ +public: + typedef word32 Element; + typedef int RandomizationParameter; + + GF2_32(word32 modulus=0x0000008D) : m_modulus(modulus) {} + + Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const + {CRYPTOPP_UNUSED(ignored); return rng.GenerateWord32();} + + bool Equal(Element a, Element b) const + {return a==b;} + + Element Identity() const + {return 0;} + + Element Add(Element a, Element b) const + {return a^b;} + + Element& Accumulate(Element &a, Element b) const + {return a^=b;} + + Element Inverse(Element a) const + {return a;} + + Element Subtract(Element a, Element b) const + {return a^b;} + + Element& Reduce(Element &a, Element b) const + {return a^=b;} + + Element Double(Element a) const + {CRYPTOPP_UNUSED(a); return 0;} + + Element MultiplicativeIdentity() const + {return 1;} + + Element Multiply(Element a, Element b) const; + + Element Square(Element a) const + {return Multiply(a, a);} + + bool IsUnit(Element a) const + {return a != 0;} + + Element MultiplicativeInverse(Element a) const; + + Element Divide(Element a, Element b) const + {return Multiply(a, MultiplicativeInverse(b));} + +private: + word32 m_modulus; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/gf2n.cpp b/external/crypto++-5.6.3/gf2n.cpp new file mode 100644 index 000000000..044bf2fb1 --- /dev/null +++ b/external/crypto++-5.6.3/gf2n.cpp @@ -0,0 +1,903 @@ +// gf2n.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "cryptlib.h" +#include "algebra.h" +#include "randpool.h" +#include "filters.h" +#include "smartptr.h" +#include "words.h" +#include "misc.h" +#include "gf2n.h" +#include "asn.h" +#include "oids.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +PolynomialMod2::PolynomialMod2() +{ +} + +PolynomialMod2::PolynomialMod2(word value, size_t bitLength) + : reg(BitsToWords(bitLength)) +{ + assert(value==0 || reg.size()>0); + + if (reg.size() > 0) + { + reg[0] = value; + SetWords(reg+1, 0, reg.size()-1); + } +} + +PolynomialMod2::PolynomialMod2(const PolynomialMod2& t) + : reg(t.reg.size()) +{ + CopyWords(reg, t.reg, reg.size()); +} + +void PolynomialMod2::Randomize(RandomNumberGenerator &rng, size_t nbits) +{ + const size_t nbytes = nbits/8 + 1; + SecByteBlock buf(nbytes); + rng.GenerateBlock(buf, nbytes); + buf[0] = (byte)Crop(buf[0], nbits % 8); + Decode(buf, nbytes); +} + +PolynomialMod2 PolynomialMod2::AllOnes(size_t bitLength) +{ + PolynomialMod2 result((word)0, bitLength); + SetWords(result.reg, word(SIZE_MAX), result.reg.size()); + if (bitLength%WORD_BITS) + result.reg[result.reg.size()-1] = (word)Crop(result.reg[result.reg.size()-1], bitLength%WORD_BITS); + return result; +} + +void PolynomialMod2::SetBit(size_t n, int value) +{ + if (value) + { + reg.CleanGrow(n/WORD_BITS + 1); + reg[n/WORD_BITS] |= (word(1) << (n%WORD_BITS)); + } + else + { + if (n/WORD_BITS < reg.size()) + reg[n/WORD_BITS] &= ~(word(1) << (n%WORD_BITS)); + } +} + +byte PolynomialMod2::GetByte(size_t n) const +{ + if (n/WORD_SIZE >= reg.size()) + return 0; + else + return byte(reg[n/WORD_SIZE] >> ((n%WORD_SIZE)*8)); +} + +void PolynomialMod2::SetByte(size_t n, byte value) +{ + reg.CleanGrow(BytesToWords(n+1)); + reg[n/WORD_SIZE] &= ~(word(0xff) << 8*(n%WORD_SIZE)); + reg[n/WORD_SIZE] |= (word(value) << 8*(n%WORD_SIZE)); +} + +PolynomialMod2 PolynomialMod2::Monomial(size_t i) +{ + PolynomialMod2 r((word)0, i+1); + r.SetBit(i); + return r; +} + +PolynomialMod2 PolynomialMod2::Trinomial(size_t t0, size_t t1, size_t t2) +{ + PolynomialMod2 r((word)0, t0+1); + r.SetBit(t0); + r.SetBit(t1); + r.SetBit(t2); + return r; +} + +PolynomialMod2 PolynomialMod2::Pentanomial(size_t t0, size_t t1, size_t t2, size_t t3, size_t t4) +{ + PolynomialMod2 r((word)0, t0+1); + r.SetBit(t0); + r.SetBit(t1); + r.SetBit(t2); + r.SetBit(t3); + r.SetBit(t4); + return r; +} + +template +struct NewPolynomialMod2 +{ + PolynomialMod2 * operator()() const + { + return new PolynomialMod2(i); + } +}; + +const PolynomialMod2 &PolynomialMod2::Zero() +{ + return Singleton().Ref(); +} + +const PolynomialMod2 &PolynomialMod2::One() +{ + return Singleton >().Ref(); +} + +void PolynomialMod2::Decode(const byte *input, size_t inputLen) +{ + StringStore store(input, inputLen); + Decode(store, inputLen); +} + +void PolynomialMod2::Encode(byte *output, size_t outputLen) const +{ + ArraySink sink(output, outputLen); + Encode(sink, outputLen); +} + +void PolynomialMod2::Decode(BufferedTransformation &bt, size_t inputLen) +{ + reg.CleanNew(BytesToWords(inputLen)); + + for (size_t i=inputLen; i > 0; i--) + { + byte b; + bt.Get(b); + reg[(i-1)/WORD_SIZE] |= word(b) << ((i-1)%WORD_SIZE)*8; + } +} + +void PolynomialMod2::Encode(BufferedTransformation &bt, size_t outputLen) const +{ + for (size_t i=outputLen; i > 0; i--) + bt.Put(GetByte(i-1)); +} + +void PolynomialMod2::DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const +{ + DERGeneralEncoder enc(bt, OCTET_STRING); + Encode(enc, length); + enc.MessageEnd(); +} + +void PolynomialMod2::BERDecodeAsOctetString(BufferedTransformation &bt, size_t length) +{ + BERGeneralDecoder dec(bt, OCTET_STRING); + if (!dec.IsDefiniteLength() || dec.RemainingLength() != length) + BERDecodeError(); + Decode(dec, length); + dec.MessageEnd(); +} + +unsigned int PolynomialMod2::WordCount() const +{ + return (unsigned int)CountWords(reg, reg.size()); +} + +unsigned int PolynomialMod2::ByteCount() const +{ + unsigned wordCount = WordCount(); + if (wordCount) + return (wordCount-1)*WORD_SIZE + BytePrecision(reg[wordCount-1]); + else + return 0; +} + +unsigned int PolynomialMod2::BitCount() const +{ + unsigned wordCount = WordCount(); + if (wordCount) + return (wordCount-1)*WORD_BITS + BitPrecision(reg[wordCount-1]); + else + return 0; +} + +unsigned int PolynomialMod2::Parity() const +{ + unsigned i; + word temp=0; + for (i=0; i= reg.size()) + { + PolynomialMod2 result((word)0, b.reg.size()*WORD_BITS); + XorWords(result.reg, reg, b.reg, reg.size()); + CopyWords(result.reg+reg.size(), b.reg+reg.size(), b.reg.size()-reg.size()); + return result; + } + else + { + PolynomialMod2 result((word)0, reg.size()*WORD_BITS); + XorWords(result.reg, reg, b.reg, b.reg.size()); + CopyWords(result.reg+b.reg.size(), reg+b.reg.size(), reg.size()-b.reg.size()); + return result; + } +} + +PolynomialMod2 PolynomialMod2::And(const PolynomialMod2 &b) const +{ + PolynomialMod2 result((word)0, WORD_BITS*STDMIN(reg.size(), b.reg.size())); + AndWords(result.reg, reg, b.reg, result.reg.size()); + return result; +} + +PolynomialMod2 PolynomialMod2::Times(const PolynomialMod2 &b) const +{ + PolynomialMod2 result((word)0, BitCount() + b.BitCount()); + + for (int i=b.Degree(); i>=0; i--) + { + result <<= 1; + if (b[i]) + XorWords(result.reg, reg, reg.size()); + } + return result; +} + +PolynomialMod2 PolynomialMod2::Squared() const +{ + static const word map[16] = {0, 1, 4, 5, 16, 17, 20, 21, 64, 65, 68, 69, 80, 81, 84, 85}; + + PolynomialMod2 result((word)0, 2*reg.size()*WORD_BITS); + + for (unsigned i=0; i> (j/2)) % 16] << j; + + for (j=0; j> (j/2 + WORD_BITS/2)) % 16] << j; + } + + return result; +} + +void PolynomialMod2::Divide(PolynomialMod2 &remainder, PolynomialMod2 "ient, + const PolynomialMod2 ÷nd, const PolynomialMod2 &divisor) +{ + if (!divisor) + throw PolynomialMod2::DivideByZero(); + + int degree = divisor.Degree(); + remainder.reg.CleanNew(BitsToWords(degree+1)); + if (dividend.BitCount() >= divisor.BitCount()) + quotient.reg.CleanNew(BitsToWords(dividend.BitCount() - divisor.BitCount() + 1)); + else + quotient.reg.CleanNew(0); + + for (int i=dividend.Degree(); i>=0; i--) + { + remainder <<= 1; + remainder.reg[0] |= dividend[i]; + if (remainder[degree]) + { + remainder -= divisor; + quotient.SetBit(i); + } + } +} + +PolynomialMod2 PolynomialMod2::DividedBy(const PolynomialMod2 &b) const +{ + PolynomialMod2 remainder, quotient; + PolynomialMod2::Divide(remainder, quotient, *this, b); + return quotient; +} + +PolynomialMod2 PolynomialMod2::Modulo(const PolynomialMod2 &b) const +{ + PolynomialMod2 remainder, quotient; + PolynomialMod2::Divide(remainder, quotient, *this, b); + return remainder; +} + +PolynomialMod2& PolynomialMod2::operator<<=(unsigned int n) +{ +#if !defined(NDEBUG) + int x; CRYPTOPP_UNUSED(x); + assert(SafeConvert(n,x)); +#endif + + if (!reg.size()) + return *this; + + int i; + word u; + word carry=0; + word *r=reg; + + if (n==1) // special case code for most frequent case + { + i = (int)reg.size(); + while (i--) + { + u = *r; + *r = (u << 1) | carry; + carry = u >> (WORD_BITS-1); + r++; + } + + if (carry) + { + reg.Grow(reg.size()+1); + reg[reg.size()-1] = carry; + } + + return *this; + } + + const int shiftWords = n / WORD_BITS; + const int shiftBits = n % WORD_BITS; + + if (shiftBits) + { + i = (int)reg.size(); + while (i--) + { + u = *r; + *r = (u << shiftBits) | carry; + carry = u >> (WORD_BITS-shiftBits); + r++; + } + } + + if (carry) + { + // Thanks to Apatryda, http://github.com/weidai11/cryptopp/issues/64 + const size_t carryIndex = reg.size(); + reg.Grow(reg.size()+shiftWords+!!shiftBits); + reg[carryIndex] = carry; + } + else + reg.Grow(reg.size()+shiftWords); + + if (shiftWords) + { + for (i = (int)reg.size()-1; i>=shiftWords; i--) + reg[i] = reg[i-shiftWords]; + for (; i>=0; i--) + reg[i] = 0; + } + + return *this; +} + +PolynomialMod2& PolynomialMod2::operator>>=(unsigned int n) +{ + if (!reg.size()) + return *this; + + int shiftWords = n / WORD_BITS; + int shiftBits = n % WORD_BITS; + + size_t i; + word u; + word carry=0; + word *r=reg+reg.size()-1; + + if (shiftBits) + { + i = reg.size(); + while (i--) + { + u = *r; + *r = (u >> shiftBits) | carry; + carry = u << (WORD_BITS-shiftBits); + r--; + } + } + + if (shiftWords) + { + for (i=0; i>(unsigned int n) const +{ + PolynomialMod2 result(*this); + return result>>=n; +} + +bool PolynomialMod2::operator!() const +{ + for (unsigned i=0; i s(a.BitCount()/bits+1); + unsigned i; + + static const char upper[]="0123456789ABCDEF"; + static const char lower[]="0123456789abcdef"; + const char* vec = (out.flags() & std::ios::uppercase) ? upper : lower; + + for (i=0; i*bits < a.BitCount(); i++) + { + int digit=0; + for (int j=0; j().Gcd(a, b); +} + +PolynomialMod2 PolynomialMod2::InverseMod(const PolynomialMod2 &modulus) const +{ + typedef EuclideanDomainOf Domain; + return QuotientRing(Domain(), modulus).MultiplicativeInverse(*this); +} + +bool PolynomialMod2::IsIrreducible() const +{ + signed int d = Degree(); + if (d <= 0) + return false; + + PolynomialMod2 t(2), u(t); + for (int i=1; i<=d/2; i++) + { + u = u.Squared()%(*this); + if (!Gcd(u+t, *this).IsUnit()) + return false; + } + return true; +} + +// ******************************************************** + +GF2NP::GF2NP(const PolynomialMod2 &modulus) + : QuotientRing >(EuclideanDomainOf(), modulus), m(modulus.Degree()) +{ +} + +GF2NP::Element GF2NP::SquareRoot(const Element &a) const +{ + Element r = a; + for (unsigned int i=1; i t1 && t1 > t2 && t2==0); +} + +const GF2NT::Element& GF2NT::MultiplicativeInverse(const Element &a) const +{ + if (t0-t1 < WORD_BITS) + return GF2NP::MultiplicativeInverse(a); + + SecWordBlock T(m_modulus.reg.size() * 4); + word *b = T; + word *c = T+m_modulus.reg.size(); + word *f = T+2*m_modulus.reg.size(); + word *g = T+3*m_modulus.reg.size(); + size_t bcLen=1, fgLen=m_modulus.reg.size(); + unsigned int k=0; + + SetWords(T, 0, 3*m_modulus.reg.size()); + b[0]=1; + assert(a.reg.size() <= m_modulus.reg.size()); + CopyWords(f, a.reg, a.reg.size()); + CopyWords(g, m_modulus.reg, m_modulus.reg.size()); + + while (1) + { + word t=f[0]; + while (!t) + { + ShiftWordsRightByWords(f, fgLen, 1); + if (c[bcLen-1]) + bcLen++; + assert(bcLen <= m_modulus.reg.size()); + ShiftWordsLeftByWords(c, bcLen, 1); + k+=WORD_BITS; + t=f[0]; + } + + unsigned int i=0; + while (t%2 == 0) + { + t>>=1; + i++; + } + k+=i; + + if (t==1 && CountWords(f, fgLen)==1) + break; + + if (i==1) + { + ShiftWordsRightByBits(f, fgLen, 1); + t=ShiftWordsLeftByBits(c, bcLen, 1); + } + else + { + ShiftWordsRightByBits(f, fgLen, i); + t=ShiftWordsLeftByBits(c, bcLen, i); + } + if (t) + { + c[bcLen] = t; + bcLen++; + assert(bcLen <= m_modulus.reg.size()); + } + + if (f[fgLen-1]==0 && g[fgLen-1]==0) + fgLen--; + + if (f[fgLen-1] < g[fgLen-1]) + { + std::swap(f, g); + std::swap(b, c); + } + + XorWords(f, g, fgLen); + XorWords(b, c, bcLen); + } + + while (k >= WORD_BITS) + { + word temp = b[0]; + // right shift b + for (unsigned i=0; i+1> j) & 1) << ((t1 + j) & (sizeof(temp)*8-1)); + if (t1 < WORD_BITS) + for (unsigned int j=0; j> j) & 1) << (t1 + j); + else + b[t1/WORD_BITS-1] ^= temp << t1%WORD_BITS; + + if (t1 % WORD_BITS) + b[t1/WORD_BITS] ^= temp >> (WORD_BITS - t1%WORD_BITS); + + if (t0%WORD_BITS) + { + b[t0/WORD_BITS-1] ^= temp << t0%WORD_BITS; + b[t0/WORD_BITS] ^= temp >> (WORD_BITS - t0%WORD_BITS); + } + else + b[t0/WORD_BITS-1] ^= temp; + + k -= WORD_BITS; + } + + if (k) + { + word temp = b[0] << (WORD_BITS - k); + ShiftWordsRightByBits(b, BitsToWords(m), k); + + if (t1 < WORD_BITS) + { + for (unsigned int j=0; j> j) & 1) << (t1 + j); + } + } + else + { + b[t1/WORD_BITS-1] ^= temp << t1%WORD_BITS; + } + + if (t1 % WORD_BITS) + b[t1/WORD_BITS] ^= temp >> (WORD_BITS - t1%WORD_BITS); + + if (t0%WORD_BITS) + { + b[t0/WORD_BITS-1] ^= temp << t0%WORD_BITS; + b[t0/WORD_BITS] ^= temp >> (WORD_BITS - t0%WORD_BITS); + } + else + b[t0/WORD_BITS-1] ^= temp; + } + + CopyWords(result.reg.begin(), b, result.reg.size()); + return result; +} + +const GF2NT::Element& GF2NT::Multiply(const Element &a, const Element &b) const +{ + size_t aSize = STDMIN(a.reg.size(), result.reg.size()); + Element r((word)0, m); + + for (int i=m-1; i>=0; i--) + { + if (r[m-1]) + { + ShiftWordsLeftByBits(r.reg.begin(), r.reg.size(), 1); + XorWords(r.reg.begin(), m_modulus.reg, r.reg.size()); + } + else + ShiftWordsLeftByBits(r.reg.begin(), r.reg.size(), 1); + + if (b[i]) + XorWords(r.reg.begin(), a.reg, aSize); + } + + if (m%WORD_BITS) + r.reg.begin()[r.reg.size()-1] = (word)Crop(r.reg[r.reg.size()-1], m%WORD_BITS); + + CopyWords(result.reg.begin(), r.reg.begin(), result.reg.size()); + return result; +} + +const GF2NT::Element& GF2NT::Reduced(const Element &a) const +{ + if (t0-t1 < WORD_BITS) + return m_domain.Mod(a, m_modulus); + + SecWordBlock b(a.reg); + + size_t i; + for (i=b.size()-1; i>=BitsToWords(t0); i--) + { + word temp = b[i]; + + if (t0%WORD_BITS) + { + b[i-t0/WORD_BITS] ^= temp >> t0%WORD_BITS; + b[i-t0/WORD_BITS-1] ^= temp << (WORD_BITS - t0%WORD_BITS); + } + else + b[i-t0/WORD_BITS] ^= temp; + + if ((t0-t1)%WORD_BITS) + { + b[i-(t0-t1)/WORD_BITS] ^= temp >> (t0-t1)%WORD_BITS; + b[i-(t0-t1)/WORD_BITS-1] ^= temp << (WORD_BITS - (t0-t1)%WORD_BITS); + } + else + b[i-(t0-t1)/WORD_BITS] ^= temp; + } + + if (i==BitsToWords(t0)-1 && t0%WORD_BITS) + { + word mask = ((word)1<<(t0%WORD_BITS))-1; + word temp = b[i] & ~mask; + b[i] &= mask; + + b[i-t0/WORD_BITS] ^= temp >> t0%WORD_BITS; + + if ((t0-t1)%WORD_BITS) + { + b[i-(t0-t1)/WORD_BITS] ^= temp >> (t0-t1)%WORD_BITS; + if ((t0-t1)%WORD_BITS > t0%WORD_BITS) + b[i-(t0-t1)/WORD_BITS-1] ^= temp << (WORD_BITS - (t0-t1)%WORD_BITS); + else + assert(temp << (WORD_BITS - (t0-t1)%WORD_BITS) == 0); + } + else + b[i-(t0-t1)/WORD_BITS] ^= temp; + } + + SetWords(result.reg.begin(), 0, result.reg.size()); + CopyWords(result.reg.begin(), b, STDMIN(b.size(), result.reg.size())); + return result; +} + +void GF2NP::DEREncodeElement(BufferedTransformation &out, const Element &a) const +{ + a.DEREncodeAsOctetString(out, MaxElementByteLength()); +} + +void GF2NP::BERDecodeElement(BufferedTransformation &in, Element &a) const +{ + a.BERDecodeAsOctetString(in, MaxElementByteLength()); +} + +void GF2NT::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + ASN1::characteristic_two_field().DEREncode(seq); + DERSequenceEncoder parameters(seq); + DEREncodeUnsigned(parameters, m); + ASN1::tpBasis().DEREncode(parameters); + DEREncodeUnsigned(parameters, t1); + parameters.MessageEnd(); + seq.MessageEnd(); +} + +void GF2NPP::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + ASN1::characteristic_two_field().DEREncode(seq); + DERSequenceEncoder parameters(seq); + DEREncodeUnsigned(parameters, m); + ASN1::ppBasis().DEREncode(parameters); + DERSequenceEncoder pentanomial(parameters); + DEREncodeUnsigned(pentanomial, t3); + DEREncodeUnsigned(pentanomial, t2); + DEREncodeUnsigned(pentanomial, t1); + pentanomial.MessageEnd(); + parameters.MessageEnd(); + seq.MessageEnd(); +} + +GF2NP * BERDecodeGF2NP(BufferedTransformation &bt) +{ + member_ptr result; + + BERSequenceDecoder seq(bt); + if (OID(seq) != ASN1::characteristic_two_field()) + BERDecodeError(); + BERSequenceDecoder parameters(seq); + unsigned int m; + BERDecodeUnsigned(parameters, m); + OID oid(parameters); + if (oid == ASN1::tpBasis()) + { + unsigned int t1; + BERDecodeUnsigned(parameters, t1); + result.reset(new GF2NT(m, t1, 0)); + } + else if (oid == ASN1::ppBasis()) + { + unsigned int t1, t2, t3; + BERSequenceDecoder pentanomial(parameters); + BERDecodeUnsigned(pentanomial, t3); + BERDecodeUnsigned(pentanomial, t2); + BERDecodeUnsigned(pentanomial, t1); + pentanomial.MessageEnd(); + result.reset(new GF2NPP(m, t3, t2, t1, 0)); + } + else + { + BERDecodeError(); + return NULL; + } + parameters.MessageEnd(); + seq.MessageEnd(); + + return result.release(); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/gf2n.h b/external/crypto++-5.6.3/gf2n.h new file mode 100644 index 000000000..9616b9790 --- /dev/null +++ b/external/crypto++-5.6.3/gf2n.h @@ -0,0 +1,370 @@ +#ifndef CRYPTOPP_GF2N_H +#define CRYPTOPP_GF2N_H + +/*! \file */ + +#include "cryptlib.h" +#include "secblock.h" +#include "algebra.h" +#include "misc.h" +#include "asn.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! Polynomial with Coefficients in GF(2) +/*! \nosubgrouping */ +class CRYPTOPP_DLL PolynomialMod2 +{ +public: + //! \name ENUMS, EXCEPTIONS, and TYPEDEFS + //@{ + //! divide by zero exception + class DivideByZero : public Exception + { + public: + DivideByZero() : Exception(OTHER_ERROR, "PolynomialMod2: division by zero") {} + }; + + typedef unsigned int RandomizationParameter; + //@} + + //! \name CREATORS + //@{ + //! creates the zero polynomial + PolynomialMod2(); + //! copy constructor + PolynomialMod2(const PolynomialMod2& t); + + //! convert from word + /*! value should be encoded with the least significant bit as coefficient to x^0 + and most significant bit as coefficient to x^(WORD_BITS-1) + bitLength denotes how much memory to allocate initially + */ + PolynomialMod2(word value, size_t bitLength=WORD_BITS); + + //! convert from big-endian byte array + PolynomialMod2(const byte *encodedPoly, size_t byteCount) + {Decode(encodedPoly, byteCount);} + + //! convert from big-endian form stored in a BufferedTransformation + PolynomialMod2(BufferedTransformation &encodedPoly, size_t byteCount) + {Decode(encodedPoly, byteCount);} + + //! create a random polynomial uniformly distributed over all polynomials with degree less than bitcount + PolynomialMod2(RandomNumberGenerator &rng, size_t bitcount) + {Randomize(rng, bitcount);} + + //! return x^i + static PolynomialMod2 CRYPTOPP_API Monomial(size_t i); + //! return x^t0 + x^t1 + x^t2 + static PolynomialMod2 CRYPTOPP_API Trinomial(size_t t0, size_t t1, size_t t2); + //! return x^t0 + x^t1 + x^t2 + x^t3 + x^t4 + static PolynomialMod2 CRYPTOPP_API Pentanomial(size_t t0, size_t t1, size_t t2, size_t t3, size_t t4); + //! return x^(n-1) + ... + x + 1 + static PolynomialMod2 CRYPTOPP_API AllOnes(size_t n); + + //! + static const PolynomialMod2 & CRYPTOPP_API Zero(); + //! + static const PolynomialMod2 & CRYPTOPP_API One(); + //@} + + //! \name ENCODE/DECODE + //@{ + //! minimum number of bytes to encode this polynomial + /*! MinEncodedSize of 0 is 1 */ + unsigned int MinEncodedSize() const {return STDMAX(1U, ByteCount());} + + //! encode in big-endian format + /*! if outputLen < MinEncodedSize, the most significant bytes will be dropped + if outputLen > MinEncodedSize, the most significant bytes will be padded + */ + void Encode(byte *output, size_t outputLen) const; + //! + void Encode(BufferedTransformation &bt, size_t outputLen) const; + + //! + void Decode(const byte *input, size_t inputLen); + //! + //* Precondition: bt.MaxRetrievable() >= inputLen + void Decode(BufferedTransformation &bt, size_t inputLen); + + //! encode value as big-endian octet string + void DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const; + //! decode value as big-endian octet string + void BERDecodeAsOctetString(BufferedTransformation &bt, size_t length); + //@} + + //! \name ACCESSORS + //@{ + //! number of significant bits = Degree() + 1 + unsigned int BitCount() const; + //! number of significant bytes = ceiling(BitCount()/8) + unsigned int ByteCount() const; + //! number of significant words = ceiling(ByteCount()/sizeof(word)) + unsigned int WordCount() const; + + //! return the n-th bit, n=0 being the least significant bit + bool GetBit(size_t n) const {return GetCoefficient(n)!=0;} + //! return the n-th byte + byte GetByte(size_t n) const; + + //! the zero polynomial will return a degree of -1 + signed int Degree() const {return (signed int)(BitCount()-1U);} + //! degree + 1 + unsigned int CoefficientCount() const {return BitCount();} + //! return coefficient for x^i + int GetCoefficient(size_t i) const + {return (i/WORD_BITS < reg.size()) ? int(reg[i/WORD_BITS] >> (i % WORD_BITS)) & 1 : 0;} + //! return coefficient for x^i + int operator[](unsigned int i) const {return GetCoefficient(i);} + + //! + bool IsZero() const {return !*this;} + //! + bool Equals(const PolynomialMod2 &rhs) const; + //@} + + //! \name MANIPULATORS + //@{ + //! + PolynomialMod2& operator=(const PolynomialMod2& t); + //! + PolynomialMod2& operator&=(const PolynomialMod2& t); + //! + PolynomialMod2& operator^=(const PolynomialMod2& t); + //! + PolynomialMod2& operator+=(const PolynomialMod2& t) {return *this ^= t;} + //! + PolynomialMod2& operator-=(const PolynomialMod2& t) {return *this ^= t;} + //! + PolynomialMod2& operator*=(const PolynomialMod2& t); + //! + PolynomialMod2& operator/=(const PolynomialMod2& t); + //! + PolynomialMod2& operator%=(const PolynomialMod2& t); + //! + PolynomialMod2& operator<<=(unsigned int); + //! + PolynomialMod2& operator>>=(unsigned int); + + //! + void Randomize(RandomNumberGenerator &rng, size_t bitcount); + + //! + void SetBit(size_t i, int value = 1); + //! set the n-th byte to value + void SetByte(size_t n, byte value); + + //! + void SetCoefficient(size_t i, int value) {SetBit(i, value);} + + //! + void swap(PolynomialMod2 &a) {reg.swap(a.reg);} + //@} + + //! \name UNARY OPERATORS + //@{ + //! + bool operator!() const; + //! + PolynomialMod2 operator+() const {return *this;} + //! + PolynomialMod2 operator-() const {return *this;} + //@} + + //! \name BINARY OPERATORS + //@{ + //! + PolynomialMod2 And(const PolynomialMod2 &b) const; + //! + PolynomialMod2 Xor(const PolynomialMod2 &b) const; + //! + PolynomialMod2 Plus(const PolynomialMod2 &b) const {return Xor(b);} + //! + PolynomialMod2 Minus(const PolynomialMod2 &b) const {return Xor(b);} + //! + PolynomialMod2 Times(const PolynomialMod2 &b) const; + //! + PolynomialMod2 DividedBy(const PolynomialMod2 &b) const; + //! + PolynomialMod2 Modulo(const PolynomialMod2 &b) const; + + //! + PolynomialMod2 operator>>(unsigned int n) const; + //! + PolynomialMod2 operator<<(unsigned int n) const; + //@} + + //! \name OTHER ARITHMETIC FUNCTIONS + //@{ + //! sum modulo 2 of all coefficients + unsigned int Parity() const; + + //! check for irreducibility + bool IsIrreducible() const; + + //! is always zero since we're working modulo 2 + PolynomialMod2 Doubled() const {return Zero();} + //! + PolynomialMod2 Squared() const; + + //! only 1 is a unit + bool IsUnit() const {return Equals(One());} + //! return inverse if *this is a unit, otherwise return 0 + PolynomialMod2 MultiplicativeInverse() const {return IsUnit() ? One() : Zero();} + + //! greatest common divisor + static PolynomialMod2 CRYPTOPP_API Gcd(const PolynomialMod2 &a, const PolynomialMod2 &n); + //! calculate multiplicative inverse of *this mod n + PolynomialMod2 InverseMod(const PolynomialMod2 &) const; + + //! calculate r and q such that (a == d*q + r) && (deg(r) < deg(d)) + static void CRYPTOPP_API Divide(PolynomialMod2 &r, PolynomialMod2 &q, const PolynomialMod2 &a, const PolynomialMod2 &d); + //@} + + //! \name INPUT/OUTPUT + //@{ + //! + friend std::ostream& operator<<(std::ostream& out, const PolynomialMod2 &a); + //@} + +private: + friend class GF2NT; + + SecWordBlock reg; +}; + +//! +inline bool operator==(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) +{return a.Equals(b);} +//! +inline bool operator!=(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) +{return !(a==b);} +//! compares degree +inline bool operator> (const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) +{return a.Degree() > b.Degree();} +//! compares degree +inline bool operator>=(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) +{return a.Degree() >= b.Degree();} +//! compares degree +inline bool operator< (const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) +{return a.Degree() < b.Degree();} +//! compares degree +inline bool operator<=(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) +{return a.Degree() <= b.Degree();} +//! +inline CryptoPP::PolynomialMod2 operator&(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.And(b);} +//! +inline CryptoPP::PolynomialMod2 operator^(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Xor(b);} +//! +inline CryptoPP::PolynomialMod2 operator+(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Plus(b);} +//! +inline CryptoPP::PolynomialMod2 operator-(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Minus(b);} +//! +inline CryptoPP::PolynomialMod2 operator*(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Times(b);} +//! +inline CryptoPP::PolynomialMod2 operator/(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.DividedBy(b);} +//! +inline CryptoPP::PolynomialMod2 operator%(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Modulo(b);} + +// CodeWarrior 8 workaround: put these template instantiations after overloaded operator declarations, +// but before the use of QuotientRing > for VC .NET 2003 +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup; +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing; +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain; +CRYPTOPP_DLL_TEMPLATE_CLASS EuclideanDomainOf; +CRYPTOPP_DLL_TEMPLATE_CLASS QuotientRing >; + +//! GF(2^n) with Polynomial Basis +class CRYPTOPP_DLL GF2NP : public QuotientRing > +{ +public: + GF2NP(const PolynomialMod2 &modulus); + + virtual GF2NP * Clone() const {return new GF2NP(*this);} + virtual void DEREncode(BufferedTransformation &bt) const + {CRYPTOPP_UNUSED(bt); assert(false);} // no ASN.1 syntax yet for general polynomial basis + + void DEREncodeElement(BufferedTransformation &out, const Element &a) const; + void BERDecodeElement(BufferedTransformation &in, Element &a) const; + + bool Equal(const Element &a, const Element &b) const + {assert(a.Degree() < m_modulus.Degree() && b.Degree() < m_modulus.Degree()); return a.Equals(b);} + + bool IsUnit(const Element &a) const + {assert(a.Degree() < m_modulus.Degree()); return !!a;} + + unsigned int MaxElementBitLength() const + {return m;} + + unsigned int MaxElementByteLength() const + {return (unsigned int)BitsToBytes(MaxElementBitLength());} + + Element SquareRoot(const Element &a) const; + + Element HalfTrace(const Element &a) const; + + // returns z such that z^2 + z == a + Element SolveQuadraticEquation(const Element &a) const; + +protected: + unsigned int m; +}; + +//! GF(2^n) with Trinomial Basis +class CRYPTOPP_DLL GF2NT : public GF2NP +{ +public: + // polynomial modulus = x^t0 + x^t1 + x^t2, t0 > t1 > t2 + GF2NT(unsigned int t0, unsigned int t1, unsigned int t2); + + GF2NP * Clone() const {return new GF2NT(*this);} + void DEREncode(BufferedTransformation &bt) const; + + const Element& Multiply(const Element &a, const Element &b) const; + + const Element& Square(const Element &a) const + {return Reduced(a.Squared());} + + const Element& MultiplicativeInverse(const Element &a) const; + +private: + const Element& Reduced(const Element &a) const; + + unsigned int t0, t1; + mutable PolynomialMod2 result; +}; + +//! GF(2^n) with Pentanomial Basis +class CRYPTOPP_DLL GF2NPP : public GF2NP +{ +public: + // polynomial modulus = x^t0 + x^t1 + x^t2 + x^t3 + x^t4, t0 > t1 > t2 > t3 > t4 + GF2NPP(unsigned int t0, unsigned int t1, unsigned int t2, unsigned int t3, unsigned int t4) + : GF2NP(PolynomialMod2::Pentanomial(t0, t1, t2, t3, t4)), t0(t0), t1(t1), t2(t2), t3(t3) {} + + GF2NP * Clone() const {return new GF2NPP(*this);} + void DEREncode(BufferedTransformation &bt) const; + +private: + unsigned int t0, t1, t2, t3; +}; + +// construct new GF2NP from the ASN.1 sequence Characteristic-two +CRYPTOPP_DLL GF2NP * CRYPTOPP_API BERDecodeGF2NP(BufferedTransformation &bt); + +NAMESPACE_END + +#ifndef __BORLANDC__ +NAMESPACE_BEGIN(std) +template<> inline void swap(CryptoPP::PolynomialMod2 &a, CryptoPP::PolynomialMod2 &b) +{ + a.swap(b); +} +NAMESPACE_END +#endif + +#endif diff --git a/external/crypto++-5.6.3/gfpcrypt.cpp b/external/crypto++-5.6.3/gfpcrypt.cpp new file mode 100644 index 000000000..127091bfd --- /dev/null +++ b/external/crypto++-5.6.3/gfpcrypt.cpp @@ -0,0 +1,306 @@ +// dsa.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +// TODO: fix the C4589 warnings +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4189 4589) +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "gfpcrypt.h" +#include "nbtheory.h" +#include "modarith.h" +#include "integer.h" +#include "asn.h" +#include "oids.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void TestInstantiations_gfpcrypt() +{ + GDSA::Signer test; + GDSA::Verifier test1; + DSA::Signer test5(NullRNG(), 100); + DSA::Signer test2(test5); + NR::Signer test3; + NR::Verifier test4; + DLIES<>::Encryptor test6; + DLIES<>::Decryptor test7; +} +#endif + +void DL_GroupParameters_DSA::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + Integer p, q, g; + + if (alg.GetValue("Modulus", p) && alg.GetValue("SubgroupGenerator", g)) + { + q = alg.GetValueWithDefault("SubgroupOrder", ComputeGroupOrder(p)/2); + Initialize(p, q, g); + } + else + { + int modulusSize = 1024, defaultSubgroupOrderSize; + alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); + + switch (modulusSize) + { + case 1024: + defaultSubgroupOrderSize = 160; + break; + case 2048: + defaultSubgroupOrderSize = 224; + break; + case 3072: + defaultSubgroupOrderSize = 256; + break; + default: + throw InvalidArgument("DSA: not a valid prime length"); + } + + DL_GroupParameters_GFP::GenerateRandom(rng, CombinedNameValuePairs(alg, MakeParameters(Name::SubgroupOrderSize(), defaultSubgroupOrderSize, false))); + } +} + +bool DL_GroupParameters_DSA::ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = DL_GroupParameters_GFP::ValidateGroup(rng, level); + int pSize = GetModulus().BitCount(), qSize = GetSubgroupOrder().BitCount(); + pass = pass && ((pSize==1024 && qSize==160) || (pSize==2048 && qSize==224) || (pSize==2048 && qSize==256) || (pSize==3072 && qSize==256)); + return pass; +} + +void DL_SignatureMessageEncodingMethod_DSA::ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); + CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); + assert(recoverableMessageLength == 0); + assert(hashIdentifier.second == 0); + + const size_t representativeByteLength = BitsToBytes(representativeBitLength); + const size_t digestSize = hash.DigestSize(); + const size_t paddingLength = SaturatingSubtract(representativeByteLength, digestSize); + + memset(representative, 0, paddingLength); + hash.TruncatedFinal(representative+paddingLength, STDMIN(representativeByteLength, digestSize)); + + if (digestSize*8 > representativeBitLength) + { + Integer h(representative, representativeByteLength); + h >>= representativeByteLength*8 - representativeBitLength; + h.Encode(representative, representativeByteLength); + } +} + +void DL_SignatureMessageEncodingMethod_NR::ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + CRYPTOPP_UNUSED(rng);CRYPTOPP_UNUSED(recoverableMessage); CRYPTOPP_UNUSED(recoverableMessageLength); + CRYPTOPP_UNUSED(hash); CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(messageEmpty); + CRYPTOPP_UNUSED(representative); CRYPTOPP_UNUSED(representativeBitLength); + + assert(recoverableMessageLength == 0); + assert(hashIdentifier.second == 0); + const size_t representativeByteLength = BitsToBytes(representativeBitLength); + const size_t digestSize = hash.DigestSize(); + const size_t paddingLength = SaturatingSubtract(representativeByteLength, digestSize); + + memset(representative, 0, paddingLength); + hash.TruncatedFinal(representative+paddingLength, STDMIN(representativeByteLength, digestSize)); + + if (digestSize*8 >= representativeBitLength) + { + Integer h(representative, representativeByteLength); + h >>= representativeByteLength*8 - representativeBitLength + 1; + h.Encode(representative, representativeByteLength); + } +} + +bool DL_GroupParameters_IntegerBased::ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const +{ + const Integer &p = GetModulus(), &q = GetSubgroupOrder(); + + bool pass = true; + pass = pass && p > Integer::One() && p.IsOdd(); + pass = pass && q > Integer::One() && q.IsOdd(); + + if (level >= 1) + pass = pass && GetCofactor() > Integer::One() && GetGroupOrder() % q == Integer::Zero(); + if (level >= 2) + pass = pass && VerifyPrime(rng, q, level-2) && VerifyPrime(rng, p, level-2); + + return pass; +} + +bool DL_GroupParameters_IntegerBased::ValidateElement(unsigned int level, const Integer &g, const DL_FixedBasePrecomputation *gpc) const +{ + const Integer &p = GetModulus(), &q = GetSubgroupOrder(); + + bool pass = true; + pass = pass && GetFieldType() == 1 ? g.IsPositive() : g.NotNegative(); + pass = pass && g < p && !IsIdentity(g); + + if (level >= 1) + { + if (gpc) + pass = pass && gpc->Exponentiate(GetGroupPrecomputation(), Integer::One()) == g; + } + if (level >= 2) + { + if (GetFieldType() == 2) + pass = pass && Jacobi(g*g-4, p)==-1; + + // verifying that Lucas((p+1)/2, w, p)==2 is omitted because it's too costly + // and at most 1 bit is leaked if it's false + bool fullValidate = (GetFieldType() == 2 && level >= 3) || !FastSubgroupCheckAvailable(); + + if (fullValidate && pass) + { + Integer gp = gpc ? gpc->Exponentiate(GetGroupPrecomputation(), q) : ExponentiateElement(g, q); + pass = pass && IsIdentity(gp); + } + else if (GetFieldType() == 1) + pass = pass && Jacobi(g, p) == 1; + } + + return pass; +} + +void DL_GroupParameters_IntegerBased::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + Integer p, q, g; + + if (alg.GetValue("Modulus", p) && alg.GetValue("SubgroupGenerator", g)) + { + q = alg.GetValueWithDefault("SubgroupOrder", ComputeGroupOrder(p)/2); + } + else + { + int modulusSize, subgroupOrderSize; + + if (!alg.GetIntValue("ModulusSize", modulusSize)) + modulusSize = alg.GetIntValueWithDefault("KeySize", 2048); + + if (!alg.GetIntValue("SubgroupOrderSize", subgroupOrderSize)) + subgroupOrderSize = GetDefaultSubgroupOrderSize(modulusSize); + + PrimeAndGenerator pg; + pg.Generate(GetFieldType() == 1 ? 1 : -1, rng, modulusSize, subgroupOrderSize); + p = pg.Prime(); + q = pg.SubPrime(); + g = pg.Generator(); + } + + Initialize(p, q, g); +} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +void DL_GroupParameters_IntegerBased::EncodeElement(bool reversible, const Element &element, byte *encoded) const +{ + CRYPTOPP_UNUSED(reversible); + element.Encode(encoded, GetModulus().ByteCount()); +} + +unsigned int DL_GroupParameters_IntegerBased::GetEncodedElementSize(bool reversible) const +{ + CRYPTOPP_UNUSED(reversible); + return GetModulus().ByteCount(); +} +#endif + +Integer DL_GroupParameters_IntegerBased::DecodeElement(const byte *encoded, bool checkForGroupMembership) const +{ + CRYPTOPP_UNUSED(checkForGroupMembership); + Integer g(encoded, GetModulus().ByteCount()); + if (!ValidateElement(1, g, NULL)) + throw DL_BadElement(); + return g; +} + +void DL_GroupParameters_IntegerBased::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder parameters(bt); + Integer p(parameters); + Integer q(parameters); + Integer g; + if (parameters.EndReached()) + { + g = q; + q = ComputeGroupOrder(p) / 2; + } + else + g.BERDecode(parameters); + parameters.MessageEnd(); + + SetModulusAndSubgroupGenerator(p, g); + SetSubgroupOrder(q); +} + +void DL_GroupParameters_IntegerBased::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder parameters(bt); + GetModulus().DEREncode(parameters); + m_q.DEREncode(parameters); + GetSubgroupGenerator().DEREncode(parameters); + parameters.MessageEnd(); +} + +bool DL_GroupParameters_IntegerBased::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper >(this, name, valueType, pValue) + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus); +} + +void DL_GroupParameters_IntegerBased::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY2(Modulus, SubgroupGenerator) + CRYPTOPP_SET_FUNCTION_ENTRY(SubgroupOrder) + ; +} + +OID DL_GroupParameters_IntegerBased::GetAlgorithmID() const +{ + return ASN1::id_dsa(); +} + +void DL_GroupParameters_GFP::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const +{ + ModularArithmetic ma(GetModulus()); + ma.SimultaneousExponentiate(results, base, exponents, exponentsCount); +} + +DL_GroupParameters_GFP::Element DL_GroupParameters_GFP::MultiplyElements(const Element &a, const Element &b) const +{ + return a_times_b_mod_c(a, b, GetModulus()); +} + +DL_GroupParameters_GFP::Element DL_GroupParameters_GFP::CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const +{ + ModularArithmetic ma(GetModulus()); + return ma.CascadeExponentiate(element1, exponent1, element2, exponent2); +} + +Integer DL_GroupParameters_IntegerBased::GetMaxExponent() const +{ + return STDMIN(GetSubgroupOrder()-1, Integer::Power2(2*DiscreteLogWorkFactor(GetFieldType()*GetModulus().BitCount()))); +} + +unsigned int DL_GroupParameters_IntegerBased::GetDefaultSubgroupOrderSize(unsigned int modulusSize) const +{ + return 2*DiscreteLogWorkFactor(GetFieldType()*modulusSize); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/gfpcrypt.h b/external/crypto++-5.6.3/gfpcrypt.h new file mode 100644 index 000000000..574813015 --- /dev/null +++ b/external/crypto++-5.6.3/gfpcrypt.h @@ -0,0 +1,636 @@ +#ifndef CRYPTOPP_GFPCRYPT_H +#define CRYPTOPP_GFPCRYPT_H + +/** \file + Implementation of schemes based on DL over GF(p) +*/ + +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4189) +#endif + +#include "cryptlib.h" +#include "pubkey.h" +#include "integer.h" +#include "modexppc.h" +#include "algparam.h" +#include "smartptr.h" +#include "sha.h" +#include "asn.h" +#include "hmac.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters; + +//! _ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBased : public ASN1CryptoMaterial > +{ + typedef DL_GroupParameters_IntegerBased ThisClass; + +public: + void Initialize(const DL_GroupParameters_IntegerBased ¶ms) + {Initialize(params.GetModulus(), params.GetSubgroupOrder(), params.GetSubgroupGenerator());} + void Initialize(RandomNumberGenerator &rng, unsigned int pbits) + {GenerateRandom(rng, MakeParameters("ModulusSize", (int)pbits));} + void Initialize(const Integer &p, const Integer &g) + {SetModulusAndSubgroupGenerator(p, g); SetSubgroupOrder(ComputeGroupOrder(p)/2);} + void Initialize(const Integer &p, const Integer &q, const Integer &g) + {SetModulusAndSubgroupGenerator(p, g); SetSubgroupOrder(q);} + + // ASN1Object interface + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + // GeneratibleCryptoMaterial interface + /*! parameters: (ModulusSize, SubgroupOrderSize (optional)) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // DL_GroupParameters + const Integer & GetSubgroupOrder() const {return m_q;} + Integer GetGroupOrder() const {return GetFieldType() == 1 ? GetModulus()-Integer::One() : GetModulus()+Integer::One();} + bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; + bool ValidateElement(unsigned int level, const Integer &element, const DL_FixedBasePrecomputation *precomp) const; + bool FastSubgroupCheckAvailable() const {return GetCofactor() == 2;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + // Cygwin i386 crash at -O3; see . + void EncodeElement(bool reversible, const Element &element, byte *encoded) const; + unsigned int GetEncodedElementSize(bool reversible) const; +#else + void EncodeElement(bool reversible, const Element &element, byte *encoded) const + {CRYPTOPP_UNUSED(reversible); element.Encode(encoded, GetModulus().ByteCount());} + unsigned int GetEncodedElementSize(bool reversible) const + {CRYPTOPP_UNUSED(reversible); return GetModulus().ByteCount();} +#endif + + Integer DecodeElement(const byte *encoded, bool checkForGroupMembership) const; + Integer ConvertElementToInteger(const Element &element) const + {return element;} + Integer GetMaxExponent() const; + static std::string CRYPTOPP_API StaticAlgorithmNamePrefix() {return "";} + + OID GetAlgorithmID() const; + + virtual const Integer & GetModulus() const =0; + virtual void SetModulusAndSubgroupGenerator(const Integer &p, const Integer &g) =0; + + void SetSubgroupOrder(const Integer &q) + {m_q = q; ParametersChanged();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_IntegerBased() {} +#endif + +protected: + Integer ComputeGroupOrder(const Integer &modulus) const + {return modulus-(GetFieldType() == 1 ? 1 : -1);} + + // GF(p) = 1, GF(p^2) = 2 + virtual int GetFieldType() const =0; + virtual unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const; + +private: + Integer m_q; +}; + +//! _ +template > +class CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBasedImpl : public DL_GroupParametersImpl +{ + typedef DL_GroupParameters_IntegerBasedImpl ThisClass; + +public: + typedef typename GROUP_PRECOMP::Element Element; + + // GeneratibleCryptoMaterial interface + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + {return GetValueHelper(this, name, valueType, pValue).Assignable();} + + void AssignFrom(const NameValuePairs &source) + {AssignFromHelper(this, source);} + + // DL_GroupParameters + const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return this->m_gpc;} + DL_FixedBasePrecomputation & AccessBasePrecomputation() {return this->m_gpc;} + + // IntegerGroupParameters + const Integer & GetModulus() const {return this->m_groupPrecomputation.GetModulus();} + const Integer & GetGenerator() const {return this->m_gpc.GetBase(this->GetGroupPrecomputation());} + + void SetModulusAndSubgroupGenerator(const Integer &p, const Integer &g) // these have to be set together + {this->m_groupPrecomputation.SetModulus(p); this->m_gpc.SetBase(this->GetGroupPrecomputation(), g); this->ParametersChanged();} + + // non-inherited + bool operator==(const DL_GroupParameters_IntegerBasedImpl &rhs) const + {return GetModulus() == rhs.GetModulus() && GetGenerator() == rhs.GetGenerator() && this->GetSubgroupOrder() == rhs.GetSubgroupOrder();} + bool operator!=(const DL_GroupParameters_IntegerBasedImpl &rhs) const + {return !operator==(rhs);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_IntegerBasedImpl() {} +#endif +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_IntegerBasedImpl; + +//! GF(p) group parameters +class CRYPTOPP_DLL DL_GroupParameters_GFP : public DL_GroupParameters_IntegerBasedImpl +{ +public: + // DL_GroupParameters + bool IsIdentity(const Integer &element) const {return element == Integer::One();} + void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; + + // NameValuePairs interface + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper(this, name, valueType, pValue).Assignable(); + } + + // used by MQV + Element MultiplyElements(const Element &a, const Element &b) const; + Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_GFP() {} +#endif + +protected: + int GetFieldType() const {return 1;} +}; + +//! GF(p) group parameters that default to same primes +class CRYPTOPP_DLL DL_GroupParameters_GFP_DefaultSafePrime : public DL_GroupParameters_GFP +{ +public: + typedef NoCofactorMultiplication DefaultCofactorOption; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_GFP_DefaultSafePrime() {} +#endif + +protected: + unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;} +}; + +//! GDSA algorithm +template +class DL_Algorithm_GDSA : public DL_ElgamalLikeSignatureAlgorithm +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "DSA-1363";} + + void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const + { + const Integer &q = params.GetSubgroupOrder(); + r %= q; + Integer kInv = k.InverseMod(q); + s = (kInv * (x*r + e)) % q; + assert(!!r && !!s); + } + + bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const + { + const Integer &q = params.GetSubgroupOrder(); + if (r>=q || r<1 || s>=q || s<1) + return false; + + Integer w = s.InverseMod(q); + Integer u1 = (e * w) % q; + Integer u2 = (r * w) % q; + // verify r == (g^u1 * y^u2 mod p) mod q + return r == params.ConvertElementToInteger(publicKey.CascadeExponentiateBaseAndPublicElement(u1, u2)) % q; + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_GDSA() {} +#endif +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; + +//! NR algorithm +template +class DL_Algorithm_NR : public DL_ElgamalLikeSignatureAlgorithm +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "NR";} + + void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const + { + const Integer &q = params.GetSubgroupOrder(); + r = (r + e) % q; + s = (k - x*r) % q; + assert(!!r); + } + + bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const + { + const Integer &q = params.GetSubgroupOrder(); + if (r>=q || r<1 || s>=q) + return false; + + // check r == (m_g^s * m_y^r + m) mod m_q + return r == (params.ConvertElementToInteger(publicKey.CascadeExponentiateBaseAndPublicElement(s, r)) + e) % q; + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_NR() {} +#endif +}; + +/*! DSA public key format is defined in 7.3.3 of RFC 2459. The + private key format is defined in 12.9 of PKCS #11 v2.10. */ +template +class DL_PublicKey_GFP : public DL_PublicKeyImpl +{ +public: + void Initialize(const DL_GroupParameters_IntegerBased ¶ms, const Integer &y) + {this->AccessGroupParameters().Initialize(params); this->SetPublicElement(y);} + void Initialize(const Integer &p, const Integer &g, const Integer &y) + {this->AccessGroupParameters().Initialize(p, g); this->SetPublicElement(y);} + void Initialize(const Integer &p, const Integer &q, const Integer &g, const Integer &y) + {this->AccessGroupParameters().Initialize(p, q, g); this->SetPublicElement(y);} + + // X509PublicKey + void BERDecodePublicKey(BufferedTransformation &bt, bool, size_t) + {this->SetPublicElement(Integer(bt));} + void DEREncodePublicKey(BufferedTransformation &bt) const + {this->GetPublicElement().DEREncode(bt);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PublicKey_GFP() {} +#endif +}; + +//! DL private key (in GF(p) groups) +template +class DL_PrivateKey_GFP : public DL_PrivateKeyImpl +{ +public: + void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits) + {this->GenerateRandomWithKeySize(rng, modulusBits);} + void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &g) + {this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupGenerator", g));} + void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &q, const Integer &g) + {this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupOrder", q)("SubgroupGenerator", g));} + void Initialize(const DL_GroupParameters_IntegerBased ¶ms, const Integer &x) + {this->AccessGroupParameters().Initialize(params); this->SetPrivateExponent(x);} + void Initialize(const Integer &p, const Integer &g, const Integer &x) + {this->AccessGroupParameters().Initialize(p, g); this->SetPrivateExponent(x);} + void Initialize(const Integer &p, const Integer &q, const Integer &g, const Integer &x) + {this->AccessGroupParameters().Initialize(p, q, g); this->SetPrivateExponent(x);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PrivateKey_GFP() {} +#endif +}; + +//! DL signing/verification keys (in GF(p) groups) +struct DL_SignatureKeys_GFP +{ + typedef DL_GroupParameters_GFP GroupParameters; + typedef DL_PublicKey_GFP PublicKey; + typedef DL_PrivateKey_GFP PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_SignatureKeys_GFP() {} +#endif +}; + +//! DL encryption/decryption keys (in GF(p) groups) +struct DL_CryptoKeys_GFP +{ + typedef DL_GroupParameters_GFP_DefaultSafePrime GroupParameters; + typedef DL_PublicKey_GFP PublicKey; + typedef DL_PrivateKey_GFP PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_CryptoKeys_GFP() {} +#endif +}; + +//! provided for backwards compatibility, this class uses the old non-standard Crypto++ key format +template +class DL_PublicKey_GFP_OldFormat : public BASE +{ +public: + void BERDecode(BufferedTransformation &bt) + { + BERSequenceDecoder seq(bt); + Integer v1(seq); + Integer v2(seq); + Integer v3(seq); + + if (seq.EndReached()) + { + this->AccessGroupParameters().Initialize(v1, v1/2, v2); + this->SetPublicElement(v3); + } + else + { + Integer v4(seq); + this->AccessGroupParameters().Initialize(v1, v2, v3); + this->SetPublicElement(v4); + } + + seq.MessageEnd(); + } + + void DEREncode(BufferedTransformation &bt) const + { + DERSequenceEncoder seq(bt); + this->GetGroupParameters().GetModulus().DEREncode(seq); + if (this->GetGroupParameters().GetCofactor() != 2) + this->GetGroupParameters().GetSubgroupOrder().DEREncode(seq); + this->GetGroupParameters().GetGenerator().DEREncode(seq); + this->GetPublicElement().DEREncode(seq); + seq.MessageEnd(); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PublicKey_GFP_OldFormat() {} +#endif +}; + +//! provided for backwards compatibility, this class uses the old non-standard Crypto++ key format +template +class DL_PrivateKey_GFP_OldFormat : public BASE +{ +public: + void BERDecode(BufferedTransformation &bt) + { + BERSequenceDecoder seq(bt); + Integer v1(seq); + Integer v2(seq); + Integer v3(seq); + Integer v4(seq); + + if (seq.EndReached()) + { + this->AccessGroupParameters().Initialize(v1, v1/2, v2); + this->SetPrivateExponent(v4 % (v1/2)); // some old keys may have x >= q + } + else + { + Integer v5(seq); + this->AccessGroupParameters().Initialize(v1, v2, v3); + this->SetPrivateExponent(v5); + } + + seq.MessageEnd(); + } + + void DEREncode(BufferedTransformation &bt) const + { + DERSequenceEncoder seq(bt); + this->GetGroupParameters().GetModulus().DEREncode(seq); + if (this->GetGroupParameters().GetCofactor() != 2) + this->GetGroupParameters().GetSubgroupOrder().DEREncode(seq); + this->GetGroupParameters().GetGenerator().DEREncode(seq); + this->GetGroupParameters().ExponentiateBase(this->GetPrivateExponent()).DEREncode(seq); + this->GetPrivateExponent().DEREncode(seq); + seq.MessageEnd(); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PrivateKey_GFP_OldFormat() {} +#endif +}; + +//! DSA-1363 +template +struct GDSA : public DL_SS< + DL_SignatureKeys_GFP, + DL_Algorithm_GDSA, + DL_SignatureMessageEncodingMethod_DSA, + H> +{ +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~GDSA() {} +#endif +}; + +//! NR +template +struct NR : public DL_SS< + DL_SignatureKeys_GFP, + DL_Algorithm_NR, + DL_SignatureMessageEncodingMethod_NR, + H> +{ +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~NR() {} +#endif +}; + +//! DSA group parameters, these are GF(p) group parameters that are allowed by the DSA standard +class CRYPTOPP_DLL DL_GroupParameters_DSA : public DL_GroupParameters_GFP +{ +public: + /*! also checks that the lengths of p and q are allowed by the DSA standard */ + bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; + /*! parameters: (ModulusSize), or (Modulus, SubgroupOrder, SubgroupGenerator) */ + /*! ModulusSize must be between DSA::MIN_PRIME_LENGTH and DSA::MAX_PRIME_LENGTH, and divisible by DSA::PRIME_LENGTH_MULTIPLE */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + static bool CRYPTOPP_API IsValidPrimeLength(unsigned int pbits) + {return pbits >= MIN_PRIME_LENGTH && pbits <= MAX_PRIME_LENGTH && pbits % PRIME_LENGTH_MULTIPLE == 0;} + + enum {MIN_PRIME_LENGTH = 1024, MAX_PRIME_LENGTH = 3072, PRIME_LENGTH_MULTIPLE = 1024}; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_DSA() {} +#endif +}; + +template +class DSA2; + +//! DSA keys +struct DL_Keys_DSA +{ + typedef DL_PublicKey_GFP PublicKey; + typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, DSA2 > PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Keys_DSA() {} +#endif +}; + +//! DSA, as specified in FIPS 186-3 +// class named DSA2 instead of DSA for backwards compatibility (DSA was a non-template class) +template +class DSA2 : public DL_SS< + DL_Keys_DSA, + DL_Algorithm_GDSA, + DL_SignatureMessageEncodingMethod_DSA, + H, + DSA2 > +{ +public: + static std::string CRYPTOPP_API StaticAlgorithmName() {return "DSA/" + (std::string)H::StaticAlgorithmName();} + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY + enum {MIN_PRIME_LENGTH = 1024, MAX_PRIME_LENGTH = 3072, PRIME_LENGTH_MULTIPLE = 1024}; +#endif + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DSA2() {} +#endif +}; + +//! DSA with SHA-1, typedef'd for backwards compatibility +typedef DSA2 DSA; + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_GFP; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_GFP; +CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, DSA2 >; + +//! the XOR encryption method, for use with DL-based cryptosystems +template +class DL_EncryptionAlgorithm_Xor : public DL_SymmetricEncryptionAlgorithm +{ +public: + bool ParameterSupported(const char *name) const {return strcmp(name, Name::EncodingParameters()) == 0;} + size_t GetSymmetricKeyLength(size_t plaintextLength) const + {return plaintextLength + MAC::DEFAULT_KEYLENGTH;} + size_t GetSymmetricCiphertextLength(size_t plaintextLength) const + {return plaintextLength + MAC::DIGESTSIZE;} + size_t GetMaxSymmetricPlaintextLength(size_t ciphertextLength) const + {return (unsigned int)SaturatingSubtract(ciphertextLength, (unsigned int)MAC::DIGESTSIZE);} + void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const + { + CRYPTOPP_UNUSED(rng); + const byte *cipherKey = NULL, *macKey = NULL; + if (DHAES_MODE) + { + macKey = key; + cipherKey = key + MAC::DEFAULT_KEYLENGTH; + } + else + { + cipherKey = key; + macKey = key + plaintextLength; + } + + ConstByteArrayParameter encodingParameters; + parameters.GetValue(Name::EncodingParameters(), encodingParameters); + + if (plaintextLength) // Coverity finding + xorbuf(ciphertext, plaintext, cipherKey, plaintextLength); + + MAC mac(macKey); + mac.Update(ciphertext, plaintextLength); + mac.Update(encodingParameters.begin(), encodingParameters.size()); + if (DHAES_MODE) + { + byte L[8] = {0,0,0,0}; + PutWord(false, BIG_ENDIAN_ORDER, L+4, word32(encodingParameters.size())); + mac.Update(L, 8); + } + mac.Final(ciphertext + plaintextLength); + } + DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const + { + size_t plaintextLength = GetMaxSymmetricPlaintextLength(ciphertextLength); + const byte *cipherKey, *macKey; + if (DHAES_MODE) + { + macKey = key; + cipherKey = key + MAC::DEFAULT_KEYLENGTH; + } + else + { + cipherKey = key; + macKey = key + plaintextLength; + } + + ConstByteArrayParameter encodingParameters; + parameters.GetValue(Name::EncodingParameters(), encodingParameters); + + MAC mac(macKey); + mac.Update(ciphertext, plaintextLength); + mac.Update(encodingParameters.begin(), encodingParameters.size()); + if (DHAES_MODE) + { + byte L[8] = {0,0,0,0}; + PutWord(false, BIG_ENDIAN_ORDER, L+4, word32(encodingParameters.size())); + mac.Update(L, 8); + } + if (!mac.Verify(ciphertext + plaintextLength)) + return DecodingResult(); + + if (plaintextLength) // Coverity finding + xorbuf(plaintext, ciphertext, cipherKey, plaintextLength); + + return DecodingResult(plaintextLength); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_EncryptionAlgorithm_Xor() {} +#endif +}; + +//! _ +template +class DL_KeyDerivationAlgorithm_P1363 : public DL_KeyDerivationAlgorithm +{ +public: + bool ParameterSupported(const char *name) const {return strcmp(name, Name::KeyDerivationParameters()) == 0;} + void Derive(const DL_GroupParameters ¶ms, byte *derivedKey, size_t derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs ¶meters) const + { + SecByteBlock agreedSecret; + if (DHAES_MODE) + { + agreedSecret.New(params.GetEncodedElementSize(true) + params.GetEncodedElementSize(false)); + params.EncodeElement(true, ephemeralPublicKey, agreedSecret); + params.EncodeElement(false, agreedElement, agreedSecret + params.GetEncodedElementSize(true)); + } + else + { + agreedSecret.New(params.GetEncodedElementSize(false)); + params.EncodeElement(false, agreedElement, agreedSecret); + } + + ConstByteArrayParameter derivationParameters; + parameters.GetValue(Name::KeyDerivationParameters(), derivationParameters); + KDF::DeriveKey(derivedKey, derivedLength, agreedSecret, agreedSecret.size(), derivationParameters.begin(), derivationParameters.size()); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_KeyDerivationAlgorithm_P1363() {} +#endif +}; + +//! Discrete Log Integrated Encryption Scheme, AKA DLIES +template +struct DLIES + : public DL_ES< + DL_CryptoKeys_GFP, + DL_KeyAgreementAlgorithm_DH, + DL_KeyDerivationAlgorithm_P1363 >, + DL_EncryptionAlgorithm_Xor, DHAES_MODE>, + DLIES<> > +{ + static std::string CRYPTOPP_API StaticAlgorithmName() {return "DLIES";} // TODO: fix this after name is standardized + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DLIES() {} +#endif +}; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/gost.cpp b/external/crypto++-5.6.3/gost.cpp new file mode 100644 index 000000000..bbd829752 --- /dev/null +++ b/external/crypto++-5.6.3/gost.cpp @@ -0,0 +1,123 @@ +#include "pch.h" +#include "gost.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +// these are the S-boxes given in Applied Cryptography 2nd Ed., p. 333 +const byte GOST::Base::sBox[8][16]={ + {4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3}, + {14, 11, 4, 12, 6, 13, 15, 10, 2, 3, 8, 1, 0, 7, 5, 9}, + {5, 8, 1, 13, 10, 3, 4, 2, 14, 15, 12, 7, 6, 0, 9, 11}, + {7, 13, 10, 1, 0, 8, 9, 15, 14, 4, 6, 12, 11, 2, 5, 3}, + {6, 12, 7, 1, 5, 15, 13, 8, 4, 10, 9, 14, 0, 3, 11, 2}, + {4, 11, 10, 0, 7, 2, 1, 13, 3, 6, 8, 5, 9, 12, 15, 14}, + {13, 11, 4, 1, 3, 15, 5, 9, 0, 10, 14, 7, 6, 8, 2, 12}, + {1, 15, 13, 0, 5, 7, 10, 4, 9, 2, 3, 14, 6, 11, 8, 12}}; + +/* // these are the S-boxes given in the GOST source code listing in Applied + // Cryptography 2nd Ed., p. 644. they appear to be from the DES S-boxes + {13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 }, + { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 }, + {12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 }, + { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 }, + { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 }, + {10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 }, + {15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 }, + {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }}; +*/ + +volatile bool GOST::Base::sTableCalculated = false; +word32 GOST::Base::sTable[4][256]; + +void GOST::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + PrecalculateSTable(); + + GetUserKey(LITTLE_ENDIAN_ORDER, key.begin(), 8, userKey, KEYLENGTH); +} + +void GOST::Base::PrecalculateSTable() +{ + if (!sTableCalculated) + { + for (unsigned i = 0; i < 4; i++) + for (unsigned j = 0; j < 256; j++) + { + word32 temp = sBox[2*i][j%16] | (sBox[2*i+1][j/16] << 4); + sTable[i][j] = rotlMod(temp, 11+8*i); + } + + sTableCalculated=true; + } +} + +#define f(x) ( t=x, \ + sTable[3][GETBYTE(t, 3)] ^ sTable[2][GETBYTE(t, 2)] \ + ^ sTable[1][GETBYTE(t, 1)] ^ sTable[0][GETBYTE(t, 0)] ) + +typedef BlockGetAndPut Block; + +void GOST::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 n1, n2, t; + + Block::Get(inBlock)(n1)(n2); + + for (unsigned int i=0; i<3; i++) + { + n2 ^= f(n1+key[0]); + n1 ^= f(n2+key[1]); + n2 ^= f(n1+key[2]); + n1 ^= f(n2+key[3]); + n2 ^= f(n1+key[4]); + n1 ^= f(n2+key[5]); + n2 ^= f(n1+key[6]); + n1 ^= f(n2+key[7]); + } + + n2 ^= f(n1+key[7]); + n1 ^= f(n2+key[6]); + n2 ^= f(n1+key[5]); + n1 ^= f(n2+key[4]); + n2 ^= f(n1+key[3]); + n1 ^= f(n2+key[2]); + n2 ^= f(n1+key[1]); + n1 ^= f(n2+key[0]); + + Block::Put(xorBlock, outBlock)(n2)(n1); +} + +void GOST::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 n1, n2, t; + + Block::Get(inBlock)(n1)(n2); + + n2 ^= f(n1+key[0]); + n1 ^= f(n2+key[1]); + n2 ^= f(n1+key[2]); + n1 ^= f(n2+key[3]); + n2 ^= f(n1+key[4]); + n1 ^= f(n2+key[5]); + n2 ^= f(n1+key[6]); + n1 ^= f(n2+key[7]); + + for (unsigned int i=0; i<3; i++) + { + n2 ^= f(n1+key[7]); + n1 ^= f(n2+key[6]); + n2 ^= f(n1+key[5]); + n1 ^= f(n2+key[4]); + n2 ^= f(n1+key[3]); + n1 ^= f(n2+key[2]); + n2 ^= f(n1+key[1]); + n1 ^= f(n2+key[0]); + } + + Block::Put(xorBlock, outBlock)(n2)(n1); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/gost.h b/external/crypto++-5.6.3/gost.h new file mode 100644 index 000000000..f11f51ec5 --- /dev/null +++ b/external/crypto++-5.6.3/gost.h @@ -0,0 +1,60 @@ +// gost.h - written and placed in the public domain by Wei Dai + +//! \file gost.h +//! \brief Classes for the GIST block cipher + +#ifndef CRYPTOPP_GOST_H +#define CRYPTOPP_GOST_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32> +{ + static const char *StaticAlgorithmName() {return "GOST";} +}; + +/// GOST +class GOST : public GOST_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + static void PrecalculateSTable(); + + static const byte sBox[8][16]; + static volatile bool sTableCalculated; + static word32 sTable[4][256]; + + FixedSizeSecBlock key; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef GOST::Encryption GOSTEncryption; +typedef GOST::Decryption GOSTDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/gzip.cpp b/external/crypto++-5.6.3/gzip.cpp new file mode 100644 index 000000000..27ffd3c33 --- /dev/null +++ b/external/crypto++-5.6.3/gzip.cpp @@ -0,0 +1,99 @@ +// gzip.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "gzip.h" + +NAMESPACE_BEGIN(CryptoPP) + +void Gzip::WritePrestreamHeader() +{ + m_totalLen = 0; + m_crc.Restart(); + + AttachedTransformation()->Put(MAGIC1); + AttachedTransformation()->Put(MAGIC2); + AttachedTransformation()->Put(DEFLATED); + AttachedTransformation()->Put(0); // general flag + AttachedTransformation()->PutWord32(0); // time stamp + byte extra = byte((GetDeflateLevel() == 1) ? FAST : ((GetDeflateLevel() == 9) ? SLOW : 0)); + AttachedTransformation()->Put(extra); + AttachedTransformation()->Put(GZIP_OS_CODE); +} + +void Gzip::ProcessUncompressedData(const byte *inString, size_t length) +{ + m_crc.Update(inString, length); + m_totalLen += (word32)length; +} + +void Gzip::WritePoststreamTail() +{ + SecByteBlock crc(4); + m_crc.Final(crc); + AttachedTransformation()->Put(crc, 4); + AttachedTransformation()->PutWord32(m_totalLen, LITTLE_ENDIAN_ORDER); +} + +// ************************************************************* + +Gunzip::Gunzip(BufferedTransformation *attachment, bool repeat, int propagation) + : Inflator(attachment, repeat, propagation), m_length(0) +{ +} + +void Gunzip::ProcessPrestreamHeader() +{ + m_length = 0; + m_crc.Restart(); + + byte buf[6]; + byte b, flags; + + if (m_inQueue.Get(buf, 2)!=2) throw HeaderErr(); + if (buf[0] != MAGIC1 || buf[1] != MAGIC2) throw HeaderErr(); + if (!m_inQueue.Skip(1)) throw HeaderErr(); // skip extra flags + if (!m_inQueue.Get(flags)) throw HeaderErr(); + if (flags & (ENCRYPTED | CONTINUED)) throw HeaderErr(); + if (m_inQueue.Skip(6)!=6) throw HeaderErr(); // Skip file time, extra flags and OS type + + if (flags & EXTRA_FIELDS) // skip extra fields + { + word16 length; + if (m_inQueue.GetWord16(length, LITTLE_ENDIAN_ORDER) != 2) throw HeaderErr(); + if (m_inQueue.Skip(length)!=length) throw HeaderErr(); + } + + if (flags & FILENAME) // skip filename + do + if(!m_inQueue.Get(b)) throw HeaderErr(); + while (b); + + if (flags & COMMENTS) // skip comments + do + if(!m_inQueue.Get(b)) throw HeaderErr(); + while (b); +} + +void Gunzip::ProcessDecompressedData(const byte *inString, size_t length) +{ + AttachedTransformation()->Put(inString, length); + m_crc.Update(inString, length); + m_length += (word32)length; +} + +void Gunzip::ProcessPoststreamTail() +{ + SecByteBlock crc(4); + if (m_inQueue.Get(crc, 4) != 4) + throw TailErr(); + if (!m_crc.Verify(crc)) + throw CrcErr(); + + word32 lengthCheck; + if (m_inQueue.GetWord32(lengthCheck, LITTLE_ENDIAN_ORDER) != 4) + throw TailErr(); + if (lengthCheck != m_length) + throw LengthErr(); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/gzip.h b/external/crypto++-5.6.3/gzip.h new file mode 100644 index 000000000..84a799000 --- /dev/null +++ b/external/crypto++-5.6.3/gzip.h @@ -0,0 +1,74 @@ +#ifndef CRYPTOPP_GZIP_H +#define CRYPTOPP_GZIP_H + +#include "cryptlib.h" +#include "zdeflate.h" +#include "zinflate.h" +#include "crc.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// GZIP Compression (RFC 1952) +class Gzip : public Deflator +{ +public: + Gzip(BufferedTransformation *attachment=NULL, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true) + : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible), m_totalLen(0) {} + Gzip(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL) + : Deflator(parameters, attachment), m_totalLen(0) {} + +protected: + enum {MAGIC1=0x1f, MAGIC2=0x8b, // flags for the header + DEFLATED=8, FAST=4, SLOW=2}; + + void WritePrestreamHeader(); + void ProcessUncompressedData(const byte *string, size_t length); + void WritePoststreamTail(); + + word32 m_totalLen; + CRC32 m_crc; +}; + +//! \class Gunzip +//! \brief GZIP Decompression (RFC 1952) +class Gunzip : public Inflator +{ +public: + typedef Inflator::Err Err; + class HeaderErr : public Err {public: HeaderErr() : Err(INVALID_DATA_FORMAT, "Gunzip: header decoding error") {}}; + class TailErr : public Err {public: TailErr() : Err(INVALID_DATA_FORMAT, "Gunzip: tail too short") {}}; + class CrcErr : public Err {public: CrcErr() : Err(DATA_INTEGRITY_CHECK_FAILED, "Gunzip: CRC check error") {}}; + class LengthErr : public Err {public: LengthErr() : Err(DATA_INTEGRITY_CHECK_FAILED, "Gunzip: length check error") {}}; + + //! \brief Construct a Gunzip + //! \param attachment a \ BufferedTransformation to attach to this object + //! \param repeat decompress multiple compressed streams in series + //! \param autoSignalPropagation 0 to turn off MessageEnd signal + Gunzip(BufferedTransformation *attachment = NULL, bool repeat = false, int autoSignalPropagation = -1); + +protected: + enum { + //! \brief First header magic value + MAGIC1=0x1f, + //! \brief Second header magic value + MAGIC2=0x8b, + //! \brief Deflated flag + DEFLATED=8 + }; + + enum FLAG_MASKS { + CONTINUED=2, EXTRA_FIELDS=4, FILENAME=8, COMMENTS=16, ENCRYPTED=32}; + + unsigned int MaxPrestreamHeaderSize() const {return 1024;} + void ProcessPrestreamHeader(); + void ProcessDecompressedData(const byte *string, size_t length); + unsigned int MaxPoststreamTailSize() const {return 8;} + void ProcessPoststreamTail(); + + word32 m_length; + CRC32 m_crc; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/hex.cpp b/external/crypto++-5.6.3/hex.cpp new file mode 100644 index 000000000..5731df550 --- /dev/null +++ b/external/crypto++-5.6.3/hex.cpp @@ -0,0 +1,44 @@ +// hex.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "hex.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const byte s_vecUpper[] = "0123456789ABCDEF"; +static const byte s_vecLower[] = "0123456789abcdef"; + +void HexEncoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true); + m_filter->Initialize(CombinedNameValuePairs( + parameters, + MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 4, true))); +} + +void HexDecoder::IsolatedInitialize(const NameValuePairs ¶meters) +{ + BaseN_Decoder::IsolatedInitialize(CombinedNameValuePairs( + parameters, + MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 4, true))); +} + +const int *HexDecoder::GetDefaultDecodingLookupArray() +{ + static volatile bool s_initialized = false; + static int s_array[256]; + + if (!s_initialized) + { + InitializeDecodingLookupArray(s_array, s_vecUpper, 16, true); + s_initialized = true; + } + return s_array; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/hex.h b/external/crypto++-5.6.3/hex.h new file mode 100644 index 000000000..a9700648e --- /dev/null +++ b/external/crypto++-5.6.3/hex.h @@ -0,0 +1,42 @@ +// hex.h - written and placed in the public domain by Wei Dai + +//! \file +//! \brief Classes for HexEncoder and HexDecoder + +#ifndef CRYPTOPP_HEX_H +#define CRYPTOPP_HEX_H + +#include "cryptlib.h" +#include "basecode.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Converts given data to base 16 +class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter +{ +public: + HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "") + : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) + { + IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator))); + } + + void IsolatedInitialize(const NameValuePairs ¶meters); +}; + +//! Decode base 16 data back to bytes +class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder +{ +public: + HexDecoder(BufferedTransformation *attachment = NULL) + : BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {} + + void IsolatedInitialize(const NameValuePairs ¶meters); + +private: + static const int * CRYPTOPP_API GetDefaultDecodingLookupArray(); +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/hkdf.h b/external/crypto++-5.6.3/hkdf.h new file mode 100644 index 000000000..3222bade3 --- /dev/null +++ b/external/crypto++-5.6.3/hkdf.h @@ -0,0 +1,100 @@ +// hkdf.h - written and placed in public domain by Jeffrey Walton. Copyright assigned to Crypto++ project. + +#ifndef CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H +#define CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H + +#include "cryptlib.h" +#include "hrtimer.h" +#include "secblock.h" +#include "hmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! abstract base class for key derivation function +class KeyDerivationFunction +{ +public: + //! maximum number of bytes which can be produced under a secuirty context + virtual size_t MaxDerivedKeyLength() const =0; + virtual bool Usesinfo() const =0; + //! derive a key from secret + virtual unsigned int DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte* info=NULL, size_t infoLen=0) const =0; + + virtual ~KeyDerivationFunction() {} +}; + +//! General, multipurpose KDF from RFC 5869. T should be a HashTransformation class +//! https://eprint.iacr.org/2010/264 and https://tools.ietf.org/html/rfc5869 +template +class HKDF : public KeyDerivationFunction +{ +public: + static const char* StaticAlgorithmName () { + static const std::string name(std::string("HKDF(") + std::string(T::StaticAlgorithmName()) + std::string(")")); + return name.c_str(); + } + size_t MaxDerivedKeyLength() const {return static_cast(T::DIGESTSIZE) * 255;} + bool Usesinfo() const {return true;} + unsigned int DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte* info, size_t infoLen) const; + +protected: + // If salt is missing (NULL), then use the NULL vector. Missing is different than EMPTY (0 length). The length + // of s_NullVector used depends on the Hash function. SHA-256 will use 32 bytes of s_NullVector. + typedef byte NullVectorType[T::DIGESTSIZE]; + static const NullVectorType& GetNullVector() { + static const NullVectorType s_NullVector = {0}; + return s_NullVector; + } +}; + +template +unsigned int HKDF::DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte* info, size_t infoLen) const +{ + static const size_t DIGEST_SIZE = static_cast(T::DIGESTSIZE); + const unsigned int req = static_cast(derivedLen); + + assert(secret && secretLen); + assert(derived && derivedLen); + assert(derivedLen <= MaxDerivedKeyLength()); + + if (derivedLen > MaxDerivedKeyLength()) + throw InvalidArgument("HKDF: derivedLen must be less than or equal to MaxDerivedKeyLength"); + + HMAC hmac; + FixedSizeSecBlock prk, buffer; + + // Extract + const byte* key = (salt ? salt : GetNullVector()); + const size_t klen = (salt ? saltLen : DIGEST_SIZE); + + hmac.SetKey(key, klen); + hmac.CalculateDigest(prk, secret, secretLen); + + // Expand + hmac.SetKey(prk.data(), prk.size()); + byte block = 0; + + while (derivedLen > 0) + { + if (block++) {hmac.Update(buffer, buffer.size());} + if (info && infoLen) {hmac.Update(info, infoLen);} + hmac.CalculateDigest(buffer, &block, 1); + +#if CRYPTOPP_MSC_VERSION + const size_t segmentLen = STDMIN(derivedLen, DIGEST_SIZE); + memcpy_s(derived, segmentLen, buffer, segmentLen); +#else + const size_t segmentLen = STDMIN(derivedLen, DIGEST_SIZE); + std::memcpy(derived, buffer, segmentLen); +#endif + + derived += segmentLen; + derivedLen -= segmentLen; + } + + return req; +} + +NAMESPACE_END + +#endif // CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H diff --git a/external/crypto++-5.6.3/hmac.cpp b/external/crypto++-5.6.3/hmac.cpp new file mode 100644 index 000000000..d4a649c08 --- /dev/null +++ b/external/crypto++-5.6.3/hmac.cpp @@ -0,0 +1,86 @@ +// hmac.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "hmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +void HMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) +{ + AssertValidKeyLength(keylength); + + Restart(); + + HashTransformation &hash = AccessHash(); + unsigned int blockSize = hash.BlockSize(); + + if (!blockSize) + throw InvalidArgument("HMAC: can only be used with a block-based hash function"); + + m_buf.resize(2*AccessHash().BlockSize() + AccessHash().DigestSize()); + + if (keylength <= blockSize) + memcpy(AccessIpad(), userKey, keylength); + else + { + AccessHash().CalculateDigest(AccessIpad(), userKey, keylength); + keylength = hash.DigestSize(); + } + + assert(keylength <= blockSize); + memset(AccessIpad()+keylength, 0, blockSize-keylength); + + for (unsigned int i=0; i, public MessageAuthenticationCode +{ +public: + HMAC_Base() : m_innerHashKeyed(false) {} + void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); + + void Restart(); + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *mac, size_t size); + unsigned int OptimalBlockSize() const {return const_cast(this)->AccessHash().OptimalBlockSize();} + unsigned int DigestSize() const {return const_cast(this)->AccessHash().DigestSize();} + +protected: + virtual HashTransformation & AccessHash() =0; + byte * AccessIpad() {return m_buf;} + byte * AccessOpad() {return m_buf + AccessHash().BlockSize();} + byte * AccessInnerHash() {return m_buf + 2*AccessHash().BlockSize();} + +private: + void KeyInnerHash(); + + SecByteBlock m_buf; + bool m_innerHashKeyed; +}; + +//! HMAC +/*! HMAC(K, text) = H(K XOR opad, H(K XOR ipad, text)) */ +template +class HMAC : public MessageAuthenticationCodeImpl > +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE=T::DIGESTSIZE) + CRYPTOPP_CONSTANT(BLOCKSIZE=T::BLOCKSIZE) + + HMAC() {} + HMAC(const byte *key, size_t length=HMAC_Base::DEFAULT_KEYLENGTH) + {this->SetKey(key, length);} + + static std::string StaticAlgorithmName() {return std::string("HMAC(") + T::StaticAlgorithmName() + ")";} + std::string AlgorithmName() const {return std::string("HMAC(") + m_hash.AlgorithmName() + ")";} + +private: + HashTransformation & AccessHash() {return m_hash;} + + T m_hash; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/hrtimer.cpp b/external/crypto++-5.6.3/hrtimer.cpp new file mode 100644 index 000000000..7d4beee7d --- /dev/null +++ b/external/crypto++-5.6.3/hrtimer.cpp @@ -0,0 +1,142 @@ +// hrtimer.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "hrtimer.h" +#include "misc.h" +#include // for NULL +#include + +#if defined(CRYPTOPP_WIN32_AVAILABLE) +#include +#elif defined(CRYPTOPP_UNIX_AVAILABLE) +#include +#include +#include +#endif + +#include + +NAMESPACE_BEGIN(CryptoPP) + +#ifndef CRYPTOPP_IMPORTS + +double TimerBase::ConvertTo(TimerWord t, Unit unit) +{ + static unsigned long unitsPerSecondTable[] = {1, 1000, 1000*1000, 1000*1000*1000}; + + // When 'unit' is an enum 'Unit', a Clang warning is generated. + assert(static_cast(unit) < COUNTOF(unitsPerSecondTable)); + return (double)CRYPTOPP_VC6_INT64 t * unitsPerSecondTable[unit] / CRYPTOPP_VC6_INT64 TicksPerSecond(); +} + +void TimerBase::StartTimer() +{ + m_last = m_start = GetCurrentTimerValue(); + m_started = true; +} + +double TimerBase::ElapsedTimeAsDouble() +{ + if (m_stuckAtZero) + return 0; + + if (m_started) + { + TimerWord now = GetCurrentTimerValue(); + if (m_last < now) // protect against OS bugs where time goes backwards + m_last = now; + return ConvertTo(m_last - m_start, m_timerUnit); + } + + StartTimer(); + return 0; +} + +unsigned long TimerBase::ElapsedTime() +{ + double elapsed = ElapsedTimeAsDouble(); + assert(elapsed <= ULONG_MAX); + return (unsigned long)elapsed; +} + +TimerWord Timer::GetCurrentTimerValue() +{ +#if defined(CRYPTOPP_WIN32_AVAILABLE) + // Use the first union member to avoid an uninitialized warning + LARGE_INTEGER now = {0,0}; + if (!QueryPerformanceCounter(&now)) + throw Exception(Exception::OTHER_ERROR, "Timer: QueryPerformanceCounter failed with error " + IntToString(GetLastError())); + return now.QuadPart; +#elif defined(CRYPTOPP_UNIX_AVAILABLE) + timeval now; + gettimeofday(&now, NULL); + return (TimerWord)now.tv_sec * 1000000 + now.tv_usec; +#else + // clock_t now; + return clock(); +#endif +} + +TimerWord Timer::TicksPerSecond() +{ +#if defined(CRYPTOPP_WIN32_AVAILABLE) + // Use the second union member to avoid an uninitialized warning + static LARGE_INTEGER freq = {0,0}; + if (freq.QuadPart == 0) + { + if (!QueryPerformanceFrequency(&freq)) + throw Exception(Exception::OTHER_ERROR, "Timer: QueryPerformanceFrequency failed with error " + IntToString(GetLastError())); + } + return freq.QuadPart; +#elif defined(CRYPTOPP_UNIX_AVAILABLE) + return 1000000; +#else + return CLOCKS_PER_SEC; +#endif +} + +#endif // #ifndef CRYPTOPP_IMPORTS + +TimerWord ThreadUserTimer::GetCurrentTimerValue() +{ +#if defined(CRYPTOPP_WIN32_AVAILABLE) + static bool getCurrentThreadImplemented = true; + if (getCurrentThreadImplemented) + { + FILETIME now, ignored; + if (!GetThreadTimes(GetCurrentThread(), &ignored, &ignored, &ignored, &now)) + { + DWORD lastError = GetLastError(); + if (lastError == ERROR_CALL_NOT_IMPLEMENTED) + { + getCurrentThreadImplemented = false; + goto GetCurrentThreadNotImplemented; + } + throw Exception(Exception::OTHER_ERROR, "ThreadUserTimer: GetThreadTimes failed with error " + IntToString(lastError)); + } + return now.dwLowDateTime + ((TimerWord)now.dwHighDateTime << 32); + } +GetCurrentThreadNotImplemented: + return (TimerWord)clock() * (10*1000*1000 / CLOCKS_PER_SEC); +#elif defined(CRYPTOPP_UNIX_AVAILABLE) + tms now; + times(&now); + return now.tms_utime; +#else + return clock(); +#endif +} + +TimerWord ThreadUserTimer::TicksPerSecond() +{ +#if defined(CRYPTOPP_WIN32_AVAILABLE) + return 10*1000*1000; +#elif defined(CRYPTOPP_UNIX_AVAILABLE) + static const long ticksPerSecond = sysconf(_SC_CLK_TCK); + return ticksPerSecond; +#else + return CLOCKS_PER_SEC; +#endif +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/hrtimer.h b/external/crypto++-5.6.3/hrtimer.h new file mode 100644 index 000000000..b44221c1d --- /dev/null +++ b/external/crypto++-5.6.3/hrtimer.h @@ -0,0 +1,63 @@ +#ifndef CRYPTOPP_HRTIMER_H +#define CRYPTOPP_HRTIMER_H + +#include "config.h" +#ifndef HIGHRES_TIMER_AVAILABLE +#include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#ifdef HIGHRES_TIMER_AVAILABLE + typedef word64 TimerWord; +#else + typedef clock_t TimerWord; +#endif + +//! _ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TimerBase +{ +public: + enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS}; + TimerBase(Unit unit, bool stuckAtZero) + : m_timerUnit(unit), m_stuckAtZero(stuckAtZero), m_started(false) + , m_start(0), m_last(0) {} + + virtual TimerWord GetCurrentTimerValue() =0; // GetCurrentTime is a macro in MSVC 6.0 + virtual TimerWord TicksPerSecond() =0; // this is not the resolution, just a conversion factor into seconds + + void StartTimer(); + double ElapsedTimeAsDouble(); + unsigned long ElapsedTime(); + +private: + double ConvertTo(TimerWord t, Unit unit); + + Unit m_timerUnit; // HPUX workaround: m_unit is a system macro on HPUX + bool m_stuckAtZero, m_started; + TimerWord m_start, m_last; +}; + +//! measure CPU time spent executing instructions of this thread (if supported by OS) +/*! /note This only works correctly on Windows NT or later. On Unix it reports process time, and others wall clock time. +*/ +class ThreadUserTimer : public TimerBase +{ +public: + ThreadUserTimer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} + TimerWord GetCurrentTimerValue(); + TimerWord TicksPerSecond(); +}; + +//! high resolution timer +class CRYPTOPP_DLL Timer : public TimerBase +{ +public: + Timer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} + TimerWord GetCurrentTimerValue(); + TimerWord TicksPerSecond(); +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ida.cpp b/external/crypto++-5.6.3/ida.cpp new file mode 100644 index 000000000..d031c8157 --- /dev/null +++ b/external/crypto++-5.6.3/ida.cpp @@ -0,0 +1,423 @@ +// ida.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#include "ida.h" +#include "algebra.h" +#include "gf2_32.h" +#include "polynomi.h" +#include "polynomi.cpp" + +#include + +ANONYMOUS_NAMESPACE_BEGIN +static const CryptoPP::GF2_32 field; +NAMESPACE_END + +NAMESPACE_BEGIN(CryptoPP) + +void RawIDA::IsolatedInitialize(const NameValuePairs ¶meters) +{ + if (!parameters.GetIntValue("RecoveryThreshold", m_threshold)) + throw InvalidArgument("RawIDA: missing RecoveryThreshold argument"); + + assert(m_threshold > 0); + if (m_threshold <= 0) + throw InvalidArgument("RawIDA: RecoveryThreshold must be greater than 0"); + + m_lastMapPosition = m_inputChannelMap.end(); + m_channelsReady = 0; + m_channelsFinished = 0; + m_w.New(m_threshold); + m_y.New(m_threshold); + m_inputQueues.reserve(m_threshold); + + m_outputChannelIds.clear(); + m_outputChannelIdStrings.clear(); + m_outputQueues.clear(); + + word32 outputChannelID; + if (parameters.GetValue("OutputChannelID", outputChannelID)) + AddOutputChannel(outputChannelID); + else + { + int nShares = parameters.GetIntValueWithDefault("NumberOfShares", m_threshold); + assert(nShares > 0); + if (nShares <= 0) {nShares = m_threshold;} + for (unsigned int i=0; i< (unsigned int)(nShares); i++) + AddOutputChannel(i); + } +} + +unsigned int RawIDA::InsertInputChannel(word32 channelId) +{ + if (m_lastMapPosition != m_inputChannelMap.end()) + { + if (m_lastMapPosition->first == channelId) + goto skipFind; + ++m_lastMapPosition; + if (m_lastMapPosition != m_inputChannelMap.end() && m_lastMapPosition->first == channelId) + goto skipFind; + } + m_lastMapPosition = m_inputChannelMap.find(channelId); + +skipFind: + if (m_lastMapPosition == m_inputChannelMap.end()) + { + if (m_inputChannelIds.size() == size_t(m_threshold)) + return m_threshold; + + m_lastMapPosition = m_inputChannelMap.insert(InputChannelMap::value_type(channelId, (unsigned int)m_inputChannelIds.size())).first; + m_inputQueues.push_back(MessageQueue()); + m_inputChannelIds.push_back(channelId); + + if (m_inputChannelIds.size() == size_t(m_threshold)) + PrepareInterpolation(); + } + return m_lastMapPosition->second; +} + +unsigned int RawIDA::LookupInputChannel(word32 channelId) const +{ + std::map::const_iterator it = m_inputChannelMap.find(channelId); + if (it == m_inputChannelMap.end()) + return m_threshold; + else + return it->second; +} + +void RawIDA::ChannelData(word32 channelId, const byte *inString, size_t length, bool messageEnd) +{ + int i = InsertInputChannel(channelId); + if (i < m_threshold) + { + lword size = m_inputQueues[i].MaxRetrievable(); + m_inputQueues[i].Put(inString, length); + if (size < 4 && size + length >= 4) + { + m_channelsReady++; + if (m_channelsReady == size_t(m_threshold)) + ProcessInputQueues(); + } + + if (messageEnd) + { + m_inputQueues[i].MessageEnd(); + if (m_inputQueues[i].NumberOfMessages() == 1) + { + m_channelsFinished++; + if (m_channelsFinished == size_t(m_threshold)) + { + m_channelsReady = 0; + for (i=0; i= m_v.size()) + { + m_v.resize(i+1); + m_outputToInput.resize(i+1); + } + + m_outputToInput[i] = LookupInputChannel(m_outputChannelIds[i]); + if (m_outputToInput[i] == size_t(m_threshold) && i * size_t(m_threshold) <= 1000*1000) + { + m_v[i].resize(m_threshold); + PrepareBulkPolynomialInterpolationAt(field, m_v[i].begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold); + } +} + +void RawIDA::AddOutputChannel(word32 channelId) +{ + m_outputChannelIds.push_back(channelId); + m_outputChannelIdStrings.push_back(WordToString(channelId)); + m_outputQueues.push_back(ByteQueue()); + if (m_inputChannelIds.size() == size_t(m_threshold)) + ComputeV((unsigned int)m_outputChannelIds.size() - 1); +} + +void RawIDA::PrepareInterpolation() +{ + assert(m_inputChannelIds.size() == size_t(m_threshold)); + PrepareBulkPolynomialInterpolation(field, m_w.begin(), &(m_inputChannelIds[0]), (unsigned int)(m_threshold)); + for (unsigned int i=0; i 0 : m_channelsReady == size_t(m_threshold)) + { + m_channelsReady = 0; + for (i=0; i 0 || queue.MaxRetrievable() >= 4; + } + + for (i=0; (unsigned int)i 0 && m_outputQueues[0].AnyRetrievable()) + FlushOutputQueues(); + + if (finished) + { + OutputMessageEnds(); + + m_channelsReady = 0; + m_channelsFinished = 0; + m_v.clear(); + + std::vector inputQueues; + std::vector inputChannelIds; + + inputQueues.swap(m_inputQueues); + inputChannelIds.swap(m_inputChannelIds); + m_inputChannelMap.clear(); + m_lastMapPosition = m_inputChannelMap.end(); + + for (i=0; iChannelMessageEnd(m_outputChannelIdStrings[i], GetAutoSignalPropagation()-1); + } +} + +// **************************************************************** + +void SecretSharing::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_pad = parameters.GetValueWithDefault("AddPadding", true); + m_ida.IsolatedInitialize(parameters); +} + +size_t SecretSharing::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("SecretSharing"); + + SecByteBlock buf(UnsignedMin(256, length)); + unsigned int threshold = m_ida.GetThreshold(); + while (length > 0) + { + size_t len = STDMIN(length, buf.size()); + m_ida.ChannelData(0xffffffff, begin, len, false); + for (unsigned int i=0; i 0) + SecretSharing::Put(0); + } + m_ida.ChannelData(0xffffffff, NULL, 0, true); + for (unsigned int i=0; iMessageEnd(GetAutoSignalPropagation()-1); +} + +// **************************************************************** + +void InformationDispersal::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_nextChannel = 0; + m_pad = parameters.GetValueWithDefault("AddPadding", true); + m_ida.IsolatedInitialize(parameters); +} + +size_t InformationDispersal::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("InformationDispersal"); + + while (length--) + { + m_ida.ChannelData(m_nextChannel, begin, 1, false); + begin++; + m_nextChannel++; + if (m_nextChannel == m_ida.GetThreshold()) + m_nextChannel = 0; + } + + if (messageEnd) + { + m_ida.SetAutoSignalPropagation(messageEnd-1); + if (m_pad) + InformationDispersal::Put(1); + for (word32 i=0; iMessageEnd(GetAutoSignalPropagation()-1); +} + +size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("PaddingRemover"); + + const byte *const end = begin + length; + + if (m_possiblePadding) + { + size_t len = std::find_if(begin, end, std::bind2nd(std::not_equal_to(), byte(0))) - begin; + m_zeroCount += len; + begin += len; + if (begin == end) + return 0; + + AttachedTransformation()->Put(1); + while (m_zeroCount--) + AttachedTransformation()->Put(0); + AttachedTransformation()->Put(*begin++); + m_possiblePadding = false; + } + +#if defined(_MSC_VER) && !defined(__MWERKS__) && (_MSC_VER <= 1300) + // VC60 and VC7 workaround: built-in reverse_iterator has two template parameters, Dinkumware only has one + typedef std::reverse_bidirectional_iterator RevIt; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator RevIt; +#else + typedef std::reverse_iterator RevIt; +#endif + const byte *x = std::find_if(RevIt(end), RevIt(begin), bind2nd(std::not_equal_to(), byte(0))).base(); + if (x != begin && *(x-1) == 1) + { + AttachedTransformation()->Put(begin, x-begin-1); + m_possiblePadding = true; + m_zeroCount = end - x; + } + else + AttachedTransformation()->Put(begin, end-begin); + + if (messageEnd) + { + m_possiblePadding = false; + Output(0, begin, length, messageEnd, blocking); + } + return 0; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/ida.h b/external/crypto++-5.6.3/ida.h new file mode 100644 index 000000000..3fd51e3dc --- /dev/null +++ b/external/crypto++-5.6.3/ida.h @@ -0,0 +1,161 @@ +// ida.h - written and placed in the public domain by Wei Dai + +//! \file ida.h +//! \brief Classes for Information Dispersal Algorithm (IDA) + +#ifndef CRYPTOPP_IDA_H +#define CRYPTOPP_IDA_H + +#include "cryptlib.h" +#include "mqueue.h" +#include "filters.h" +#include "channels.h" +#include "secblock.h" +#include "stdcpp.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// base class for secret sharing and information dispersal +class RawIDA : public AutoSignaling > > +{ +public: + RawIDA(BufferedTransformation *attachment=NULL) + : m_threshold (0), m_channelsReady(0), m_channelsFinished(0) + {Detach(attachment);} + + unsigned int GetThreshold() const {return m_threshold;} + void AddOutputChannel(word32 channelId); + void ChannelData(word32 channelId, const byte *inString, size_t length, bool messageEnd); + lword InputBuffered(word32 channelId) const; + + void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) + { + if (!blocking) + throw BlockingInputOnly("RawIDA"); + ChannelData(StringToWord(channel), begin, length, messageEnd != 0); + return 0; + } + +protected: + virtual void FlushOutputQueues(); + virtual void OutputMessageEnds(); + + unsigned int InsertInputChannel(word32 channelId); + unsigned int LookupInputChannel(word32 channelId) const; + void ComputeV(unsigned int); + void PrepareInterpolation(); + void ProcessInputQueues(); + + typedef std::map InputChannelMap; + InputChannelMap m_inputChannelMap; + InputChannelMap::iterator m_lastMapPosition; + std::vector m_inputQueues; + std::vector m_inputChannelIds, m_outputChannelIds, m_outputToInput; + std::vector m_outputChannelIdStrings; + std::vector m_outputQueues; + int m_threshold; + unsigned int m_channelsReady, m_channelsFinished; + std::vector > m_v; + SecBlock m_u, m_w, m_y; +}; + +/// a variant of Shamir's Secret Sharing Algorithm +class SecretSharing : public CustomFlushPropagation +{ +public: + SecretSharing(RandomNumberGenerator &rng, int threshold, int nShares, BufferedTransformation *attachment=NULL, bool addPadding=true) + : m_rng(rng), m_ida(new OutputProxy(*this, true)) + { + Detach(attachment); + IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("NumberOfShares", nShares)("AddPadding", addPadding)); + } + + void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); + bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) {return m_ida.Flush(hardFlush, propagation, blocking);} + +protected: + RandomNumberGenerator &m_rng; + RawIDA m_ida; + bool m_pad; +}; + +/// a variant of Shamir's Secret Sharing Algorithm +class SecretRecovery : public RawIDA +{ +public: + SecretRecovery(int threshold, BufferedTransformation *attachment=NULL, bool removePadding=true) + : RawIDA(attachment) + {IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("RemovePadding", removePadding));} + + void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); + +protected: + void FlushOutputQueues(); + void OutputMessageEnds(); + + bool m_pad; +}; + +/// a variant of Rabin's Information Dispersal Algorithm +class InformationDispersal : public CustomFlushPropagation +{ +public: + InformationDispersal(int threshold, int nShares, BufferedTransformation *attachment=NULL, bool addPadding=true) + : m_ida(new OutputProxy(*this, true)), m_pad(false), m_nextChannel(0) + { + Detach(attachment); + IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("NumberOfShares", nShares)("AddPadding", addPadding)); + } + + void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); + bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) {return m_ida.Flush(hardFlush, propagation, blocking);} + +protected: + RawIDA m_ida; + bool m_pad; + unsigned int m_nextChannel; +}; + +/// a variant of Rabin's Information Dispersal Algorithm +class InformationRecovery : public RawIDA +{ +public: + InformationRecovery(int threshold, BufferedTransformation *attachment=NULL, bool removePadding=true) + : RawIDA(attachment), m_pad(false) + {IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("RemovePadding", removePadding));} + + void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); + +protected: + void FlushOutputQueues(); + void OutputMessageEnds(); + + bool m_pad; + ByteQueue m_queue; +}; + +class PaddingRemover : public Unflushable +{ +public: + PaddingRemover(BufferedTransformation *attachment=NULL) + : m_possiblePadding(false), m_zeroCount(0) {Detach(attachment);} + + void IsolatedInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters); m_possiblePadding = false;} + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); + + // GetPossiblePadding() == false at the end of a message indicates incorrect padding + bool GetPossiblePadding() const {return m_possiblePadding;} + +private: + bool m_possiblePadding; + lword m_zeroCount; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/idea.cpp b/external/crypto++-5.6.3/idea.cpp new file mode 100644 index 000000000..bf5a2dde8 --- /dev/null +++ b/external/crypto++-5.6.3/idea.cpp @@ -0,0 +1,193 @@ +// idea.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "idea.h" +#include "misc.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const int IDEA_KEYLEN=(6*IDEA::ROUNDS+4); // key schedule length in # of word16s + +#define low16(x) ((x)&0xffff) // compiler should be able to optimize this away if word is 16 bits +#define high16(x) ((x)>>16) + +CRYPTOPP_COMPILE_ASSERT(sizeof(IDEA::Word) >= 2); + +// should use an inline function but macros are still faster in MSVC 4.0 +#define DirectMUL(a,b) \ +{ \ + assert(b <= 0xffff); \ + \ + word32 p=(word32)low16(a)*b; \ + \ + if (p) \ + { \ + p = low16(p) - high16(p); \ + a = (IDEA::Word)p - (IDEA::Word)high16(p); \ + } \ + else \ + a = 1-a-b; \ +} + +#ifdef IDEA_LARGECACHE +volatile bool IDEA::Base::tablesBuilt = false; +word16 IDEA::Base::log[0x10000]; +word16 IDEA::Base::antilog[0x10000]; + +void IDEA::Base::BuildLogTables() +{ + if (tablesBuilt) + return; + else + { + tablesBuilt = true; + + IDEA::Word x=1; + word32 i; + + for (i=0; i<0x10000; i++) + { + antilog[i] = (word16)x; + DirectMUL(x, 3); + } + + for (i=0; i<0x10000; i++) + log[antilog[i]] = (word16)i; + } +} + +void IDEA::Base::LookupKeyLogs() +{ + IDEA::Word* Z=key; + int r=ROUNDS; + do + { + Z[0] = log[Z[0]]; + Z[3] = log[Z[3]]; + Z[4] = log[Z[4]]; + Z[5] = log[Z[5]]; + Z+=6; + } while (--r); + Z[0] = log[Z[0]]; + Z[3] = log[Z[3]]; +} + +inline void IDEA::Base::LookupMUL(IDEA::Word &a, IDEA::Word b) +{ + a = antilog[low16(log[low16(a)]+b)]; +} +#endif // IDEA_LARGECACHE + +void IDEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + +#ifdef IDEA_LARGECACHE + BuildLogTables(); +#endif + + EnKey(userKey); + + if (!IsForwardTransformation()) + DeKey(); + +#ifdef IDEA_LARGECACHE + LookupKeyLogs(); +#endif +} + +void IDEA::Base::EnKey (const byte *userKey) +{ + unsigned int i; + + for (i=0; i<8; i++) + m_key[i] = ((IDEA::Word)userKey[2*i]<<8) | userKey[2*i+1]; + + for (; i> 7)); + } +} + +static IDEA::Word MulInv(IDEA::Word x) +{ + IDEA::Word y=x; + for (unsigned i=0; i<15; i++) + { + DirectMUL(y,low16(y)); + DirectMUL(y,x); + } + return low16(y); +} + +static inline IDEA::Word AddInv(IDEA::Word x) +{ + return low16(0-x); +} + +void IDEA::Base::DeKey() +{ + FixedSizeSecBlock tempkey; + size_t i; + + for (i=0; i0)]); + tempkey[i*6+2] = AddInv(m_key[(ROUNDS-i)*6+2-(i>0)]); + tempkey[i*6+3] = MulInv(m_key[(ROUNDS-i)*6+3]); + tempkey[i*6+4] = m_key[(ROUNDS-1-i)*6+4]; + tempkey[i*6+5] = m_key[(ROUNDS-1-i)*6+5]; + } + + tempkey[i*6+0] = MulInv(m_key[(ROUNDS-i)*6+0]); + tempkey[i*6+1] = AddInv(m_key[(ROUNDS-i)*6+1]); + tempkey[i*6+2] = AddInv(m_key[(ROUNDS-i)*6+2]); + tempkey[i*6+3] = MulInv(m_key[(ROUNDS-i)*6+3]); + + m_key = tempkey; +} + +#ifdef IDEA_LARGECACHE +#define MUL(a,b) LookupMUL(a,b) +#else +#define MUL(a,b) DirectMUL(a,b) +#endif + +void IDEA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + typedef BlockGetAndPut Block; + + const IDEA::Word *key = m_key; + IDEA::Word x0,x1,x2,x3,t0,t1; + Block::Get(inBlock)(x0)(x1)(x2)(x3); + + for (unsigned int i=0; i, public FixedKeyLength<16>, public FixedRounds<8> +{ + static const char *StaticAlgorithmName() {return "IDEA";} +}; + +/// IDEA +class IDEA : public IDEA_Info, public BlockCipherDocumentation +{ +public: // made public for internal purposes +#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + typedef word Word; +#else + typedef hword Word; +#endif + +private: + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + unsigned int OptimalDataAlignment() const {return 2;} + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + private: + void EnKey(const byte *); + void DeKey(); + FixedSizeSecBlock m_key; + + #ifdef IDEA_LARGECACHE + static inline void LookupMUL(word &a, word b); + void LookupKeyLogs(); + static void BuildLogTables(); + static volatile bool tablesBuilt; + static word16 log[0x10000], antilog[0x10000]; + #endif + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef IDEA::Encryption IDEAEncryption; +typedef IDEA::Decryption IDEADecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/integer.cpp b/external/crypto++-5.6.3/integer.cpp new file mode 100644 index 000000000..679a94eb5 --- /dev/null +++ b/external/crypto++-5.6.3/integer.cpp @@ -0,0 +1,4404 @@ +// integer.cpp - written and placed in the public domain by Wei Dai +// contains public domain code contributed by Alister Lee and Leonard Janke + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wunused" +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "integer.h" +#include "secblock.h" +#include "modarith.h" +#include "nbtheory.h" +#include "smartptr.h" +#include "algparam.h" +#include "filters.h" +#include "asn.h" +#include "oids.h" +#include "words.h" +#include "pubkey.h" // for P1363_KDF2 +#include "sha.h" +#include "cpu.h" +#include "misc.h" + +#include + +#if _MSC_VER >= 1400 + #include +#endif + +#ifdef __DECCXX + #include +#endif + +#ifdef CRYPTOPP_MSVC6_NO_PP + #pragma message("You do not seem to have the Visual C++ Processor Pack installed, so use of SSE2 instructions will be disabled.") +#endif + +// "Inline assembly operands don't work with .intel_syntax", +// http://llvm.org/bugs/show_bug.cgi?id=24232 +#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) +# undef CRYPTOPP_X86_ASM_AVAILABLE +# undef CRYPTOPP_X32_ASM_AVAILABLE +# undef CRYPTOPP_X64_ASM_AVAILABLE +# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE +# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 +# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 +#else +# define CRYPTOPP_INTEGER_SSE2 (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && CRYPTOPP_BOOL_X86) +#endif + +NAMESPACE_BEGIN(CryptoPP) + +// Debian QEMU/ARMEL issue in MultiplyTop; see http://github.com/weidai11/cryptopp/issues/31. +#if __ARMEL__ && (CRYPTOPP_GCC_VERSION >= 50200) && (CRYPTOPP_GCC_VERSION < 50300) && __OPTIMIZE__ +# define WORKAROUND_ARMEL_BUG 1 +#endif + +// Debian QEMU/ARM64 issue in Integer or ModularArithmetic; see http://github.com/weidai11/cryptopp/issues/61. +#if (__aarch64__ || __AARCH64EL__) && (CRYPTOPP_GCC_VERSION >= 50200) && (CRYPTOPP_GCC_VERSION < 50300) +# define WORKAROUND_ARM64_BUG 1 +#endif + +#if WORKAROUND_ARMEL_BUG +# pragma GCC push_options +# pragma GCC optimize("O1") +#endif + +#if WORKAROUND_ARM64_BUG +# pragma GCC push_options +# pragma GCC optimize("no-devirtualize") +#endif + +bool AssignIntToInteger(const std::type_info &valueType, void *pInteger, const void *pInt) +{ + if (valueType != typeid(Integer)) + return false; + *reinterpret_cast(pInteger) = *reinterpret_cast(pInt); + return true; +} + +inline static int Compare(const word *A, const word *B, size_t N) +{ + while (N--) + if (A[N] > B[N]) + return 1; + else if (A[N] < B[N]) + return -1; + + return 0; +} + +inline static int Increment(word *A, size_t N, word B=1) +{ + assert(N); + word t = A[0]; + A[0] = t+B; + if (A[0] >= t) + return 0; + for (unsigned i=1; i>(WORD_BITS-1)); d##0 = 2*d##0 + (c>>(WORD_BITS-1)); c *= 2; + #endif + #ifndef Acc2WordsBy2 + #define Acc2WordsBy2(a, b) a##0 += b##0; a##1 += a##0 < b##0; a##1 += b##1; + #endif + #define AddWithCarry(u, a, b) {word t = a+b; u##0 = t + u##1; u##1 = (ta) + (u##0>t);} + #define GetCarry(u) u##1 + #define GetBorrow(u) u##1 +#else + #define Declare2Words(x) dword x; + #if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) + #define MultiplyWords(p, a, b) p = __emulu(a, b); + #else + #define MultiplyWords(p, a, b) p = (dword)a*b; + #endif + #define AssignWord(a, b) a = b; + #define Add2WordsBy1(a, b, c) a = b + c; + #define Acc2WordsBy2(a, b) a += b; + #define LowWord(a) word(a) + #define HighWord(a) word(a>>WORD_BITS) + #define Double3Words(c, d) d = 2*d + (c>>(WORD_BITS-1)); c *= 2; + #define AddWithCarry(u, a, b) u = dword(a) + b + GetCarry(u); + #define SubtractWithBorrow(u, a, b) u = dword(a) - b - GetBorrow(u); + #define GetCarry(u) HighWord(u) + #define GetBorrow(u) word(u>>(WORD_BITS*2-1)) +#endif +#ifndef MulAcc + #define MulAcc(c, d, a, b) MultiplyWords(p, a, b); Acc2WordsBy1(p, c); c = LowWord(p); Acc2WordsBy1(d, HighWord(p)); +#endif +#ifndef Acc2WordsBy1 + #define Acc2WordsBy1(a, b) Add2WordsBy1(a, a, b) +#endif +#ifndef Acc3WordsBy2 + #define Acc3WordsBy2(c, d, e) Acc2WordsBy1(e, c); c = LowWord(e); Add2WordsBy1(e, d, HighWord(e)); +#endif + +class DWord +{ +public: + // Converity finding on default ctor. We've isntrumented the code, + // and cannot uncover a case where it affects a result. +#if (defined(__COVERITY__) || !defined(NDEBUG)) && defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE) + // Repeating pattern of 1010 for debug builds to break things... + DWord() : m_whole(0) {memset(&m_whole, 0xa, sizeof(m_whole));} +#elif (defined(__COVERITY__) || !defined(NDEBUG)) && !defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE) + // Repeating pattern of 1010 for debug builds to break things... + DWord() : m_halfs() {memset(&m_halfs, 0xa, sizeof(m_halfs));} +#else + DWord() {} +#endif + +#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + explicit DWord(word low) : m_whole(low) {} +#else + explicit DWord(word low) + { + m_halfs.low = low; + m_halfs.high = 0; + } +#endif + + DWord(word low, word high) + { + m_halfs.low = low; + m_halfs.high = high; + } + + static DWord Multiply(word a, word b) + { + DWord r; + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + r.m_whole = (dword)a * b; + #elif defined(MultiplyWordsLoHi) + MultiplyWordsLoHi(r.m_halfs.low, r.m_halfs.high, a, b); + #else + assert(0); + #endif + return r; + } + + static DWord MultiplyAndAdd(word a, word b, word c) + { + DWord r = Multiply(a, b); + return r += c; + } + + DWord & operator+=(word a) + { + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + m_whole = m_whole + a; + #else + m_halfs.low += a; + m_halfs.high += (m_halfs.low < a); + #endif + return *this; + } + + DWord operator+(word a) + { + DWord r; + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + r.m_whole = m_whole + a; + #else + r.m_halfs.low = m_halfs.low + a; + r.m_halfs.high = m_halfs.high + (r.m_halfs.low < a); + #endif + return r; + } + + DWord operator-(DWord a) + { + DWord r; + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + r.m_whole = m_whole - a.m_whole; + #else + r.m_halfs.low = m_halfs.low - a.m_halfs.low; + r.m_halfs.high = m_halfs.high - a.m_halfs.high - (r.m_halfs.low > m_halfs.low); + #endif + return r; + } + + DWord operator-(word a) + { + DWord r; + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + r.m_whole = m_whole - a; + #else + r.m_halfs.low = m_halfs.low - a; + r.m_halfs.high = m_halfs.high - (r.m_halfs.low > m_halfs.low); + #endif + return r; + } + + // returns quotient, which must fit in a word + word operator/(word divisor); + + word operator%(word a); + + bool operator!() const + { + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + return !m_whole; + #else + return !m_halfs.high && !m_halfs.low; + #endif + } + + word GetLowHalf() const {return m_halfs.low;} + word GetHighHalf() const {return m_halfs.high;} + word GetHighHalfAsBorrow() const {return 0-m_halfs.high;} + +private: + union + { + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + dword m_whole; + #endif + struct + { + #ifdef IS_LITTLE_ENDIAN + word low; + word high; + #else + word high; + word low; + #endif + } m_halfs; + }; +}; + +class Word +{ +public: + // Converity finding on default ctor. We've isntrumented the code, + // and cannot uncover a case where it affects a result. +#if defined(__COVERITY__) + Word() : m_whole(0) {} +#elif !defined(NDEBUG) + // Repeating pattern of 1010 for debug builds to break things... + Word() : m_whole(0) {memset(&m_whole, 0xa, sizeof(m_whole));} +#else + Word() {} +#endif + + Word(word value) : m_whole(value) {} + Word(hword low, hword high) : m_whole(low | (word(high) << (WORD_BITS/2))) {} + + static Word Multiply(hword a, hword b) + { + Word r; + r.m_whole = (word)a * b; + return r; + } + + Word operator-(Word a) + { + Word r; + r.m_whole = m_whole - a.m_whole; + return r; + } + + Word operator-(hword a) + { + Word r; + r.m_whole = m_whole - a; + return r; + } + + // returns quotient, which must fit in a word + hword operator/(hword divisor) + { + return hword(m_whole / divisor); + } + + bool operator!() const + { + return !m_whole; + } + + word GetWhole() const {return m_whole;} + hword GetLowHalf() const {return hword(m_whole);} + hword GetHighHalf() const {return hword(m_whole>>(WORD_BITS/2));} + hword GetHighHalfAsBorrow() const {return 0-hword(m_whole>>(WORD_BITS/2));} + +private: + word m_whole; +}; + +// do a 3 word by 2 word divide, returns quotient and leaves remainder in A +template +S DivideThreeWordsByTwo(S *A, S B0, S B1, D *dummy=NULL) +{ + CRYPTOPP_UNUSED(dummy); + + // assert {A[2],A[1]} < {B1,B0}, so quotient can fit in a S + assert(A[2] < B1 || (A[2]==B1 && A[1] < B0)); + + // estimate the quotient: do a 2 S by 1 S divide + S Q; + if (S(B1+1) == 0) + Q = A[2]; + else if (B1 > 0) + Q = D(A[1], A[2]) / S(B1+1); + else + Q = D(A[0], A[1]) / B0; + + // now subtract Q*B from A + D p = D::Multiply(B0, Q); + D u = (D) A[0] - p.GetLowHalf(); + A[0] = u.GetLowHalf(); + u = (D) A[1] - p.GetHighHalf() - u.GetHighHalfAsBorrow() - D::Multiply(B1, Q); + A[1] = u.GetLowHalf(); + A[2] += u.GetHighHalf(); + + // Q <= actual quotient, so fix it + while (A[2] || A[1] > B1 || (A[1]==B1 && A[0]>=B0)) + { + u = (D) A[0] - B0; + A[0] = u.GetLowHalf(); + u = (D) A[1] - B1 - u.GetHighHalfAsBorrow(); + A[1] = u.GetLowHalf(); + A[2] += u.GetHighHalf(); + Q++; + assert(Q); // shouldn't overflow + } + + return Q; +} + +// do a 4 word by 2 word divide, returns 2 word quotient in Q0 and Q1 +template +inline D DivideFourWordsByTwo(S *T, const D &Al, const D &Ah, const D &B) +{ + if (!B) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) + return D(Ah.GetLowHalf(), Ah.GetHighHalf()); + else + { + S Q[2]; + T[0] = Al.GetLowHalf(); + T[1] = Al.GetHighHalf(); + T[2] = Ah.GetLowHalf(); + T[3] = Ah.GetHighHalf(); + Q[1] = DivideThreeWordsByTwo(T+1, B.GetLowHalf(), B.GetHighHalf()); + Q[0] = DivideThreeWordsByTwo(T, B.GetLowHalf(), B.GetHighHalf()); + return D(Q[0], Q[1]); + } +} + +// returns quotient, which must fit in a word +inline word DWord::operator/(word a) +{ + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + return word(m_whole / a); + #else + hword r[4]; + return DivideFourWordsByTwo(r, m_halfs.low, m_halfs.high, a).GetWhole(); + #endif +} + +inline word DWord::operator%(word a) +{ + #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + return word(m_whole % a); + #else + if (a < (word(1) << (WORD_BITS/2))) + { + hword h = hword(a); + word r = m_halfs.high % h; + r = ((m_halfs.low >> (WORD_BITS/2)) + (r << (WORD_BITS/2))) % h; + return hword((hword(m_halfs.low) + (r << (WORD_BITS/2))) % h); + } + else + { + hword r[4]; + DivideFourWordsByTwo(r, m_halfs.low, m_halfs.high, a); + return Word(r[0], r[1]).GetWhole(); + } + #endif +} + +// ******************************************************** + +// Use some tricks to share assembly code between MSVC and GCC +#if defined(__GNUC__) + #define AddPrologue \ + int result; \ + __asm__ __volatile__ \ + ( \ + INTEL_NOPREFIX + #define AddEpilogue \ + ".att_syntax prefix;" \ + : "=a" (result)\ + : "d" (C), "a" (A), "D" (B), "c" (N) \ + : "%esi", "memory", "cc" \ + );\ + return result; + #define MulPrologue \ + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + AS1( push ebx) \ + AS2( mov ebx, edx) + #define MulEpilogue \ + AS1( pop ebx) \ + ".att_syntax prefix;" \ + : \ + : "d" (s_maskLow16), "c" (C), "a" (A), "D" (B) \ + : "%esi", "memory", "cc" \ + ); + #define SquPrologue MulPrologue + #define SquEpilogue \ + AS1( pop ebx) \ + ".att_syntax prefix;" \ + : \ + : "d" (s_maskLow16), "c" (C), "a" (A) \ + : "%esi", "%edi", "memory", "cc" \ + ); + #define TopPrologue MulPrologue + #define TopEpilogue \ + AS1( pop ebx) \ + ".att_syntax prefix;" \ + : \ + : "d" (s_maskLow16), "c" (C), "a" (A), "D" (B), "S" (L) \ + : "memory", "cc" \ + ); +#else + #define AddPrologue \ + __asm push edi \ + __asm push esi \ + __asm mov eax, [esp+12] \ + __asm mov edi, [esp+16] + #define AddEpilogue \ + __asm pop esi \ + __asm pop edi \ + __asm ret 8 +#if _MSC_VER < 1300 + #define SaveEBX __asm push ebx + #define RestoreEBX __asm pop ebx +#else + #define SaveEBX + #define RestoreEBX +#endif + #define SquPrologue \ + AS2( mov eax, A) \ + AS2( mov ecx, C) \ + SaveEBX \ + AS2( lea ebx, s_maskLow16) + #define MulPrologue \ + AS2( mov eax, A) \ + AS2( mov edi, B) \ + AS2( mov ecx, C) \ + SaveEBX \ + AS2( lea ebx, s_maskLow16) + #define TopPrologue \ + AS2( mov eax, A) \ + AS2( mov edi, B) \ + AS2( mov ecx, C) \ + AS2( mov esi, L) \ + SaveEBX \ + AS2( lea ebx, s_maskLow16) + #define SquEpilogue RestoreEBX + #define MulEpilogue RestoreEBX + #define TopEpilogue RestoreEBX +#endif + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +int Baseline_Add(size_t N, word *C, const word *A, const word *B); +int Baseline_Sub(size_t N, word *C, const word *A, const word *B); +} +#elif defined(CRYPTOPP_X64_ASM_AVAILABLE) && defined(__GNUC__) && defined(CRYPTOPP_WORD128_AVAILABLE) +int Baseline_Add(size_t N, word *C, const word *A, const word *B) +{ + word result; + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS1( neg %1) + ASJ( jz, 1, f) + AS2( mov %0,[%3+8*%1]) + AS2( add %0,[%4+8*%1]) + AS2( mov [%2+8*%1],%0) + ASL(0) + AS2( mov %0,[%3+8*%1+8]) + AS2( adc %0,[%4+8*%1+8]) + AS2( mov [%2+8*%1+8],%0) + AS2( lea %1,[%1+2]) + ASJ( jrcxz, 1, f) + AS2( mov %0,[%3+8*%1]) + AS2( adc %0,[%4+8*%1]) + AS2( mov [%2+8*%1],%0) + ASJ( jmp, 0, b) + ASL(1) + AS2( mov %0, 0) + AS2( adc %0, %0) + ATT_NOPREFIX + : "=&r" (result), "+c" (N) + : "r" (C+N), "r" (A+N), "r" (B+N) + : "memory", "cc" + ); + return (int)result; +} + +int Baseline_Sub(size_t N, word *C, const word *A, const word *B) +{ + word result; + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS1( neg %1) + ASJ( jz, 1, f) + AS2( mov %0,[%3+8*%1]) + AS2( sub %0,[%4+8*%1]) + AS2( mov [%2+8*%1],%0) + ASL(0) + AS2( mov %0,[%3+8*%1+8]) + AS2( sbb %0,[%4+8*%1+8]) + AS2( mov [%2+8*%1+8],%0) + AS2( lea %1,[%1+2]) + ASJ( jrcxz, 1, f) + AS2( mov %0,[%3+8*%1]) + AS2( sbb %0,[%4+8*%1]) + AS2( mov [%2+8*%1],%0) + ASJ( jmp, 0, b) + ASL(1) + AS2( mov %0, 0) + AS2( adc %0, %0) + ATT_NOPREFIX + : "=&r" (result), "+c" (N) + : "r" (C+N), "r" (A+N), "r" (B+N) + : "memory", "cc" + ); + return (int)result; +} +#elif defined(CRYPTOPP_X86_ASM_AVAILABLE) && CRYPTOPP_BOOL_X86 +CRYPTOPP_NAKED int CRYPTOPP_FASTCALL Baseline_Add(size_t N, word *C, const word *A, const word *B) +{ + AddPrologue + + // now: eax = A, edi = B, edx = C, ecx = N + AS2( lea eax, [eax+4*ecx]) + AS2( lea edi, [edi+4*ecx]) + AS2( lea edx, [edx+4*ecx]) + + AS1( neg ecx) // ecx is negative index + AS2( test ecx, 2) // this clears carry flag + ASJ( jz, 0, f) + AS2( sub ecx, 2) + ASJ( jmp, 1, f) + + ASL(0) + ASJ( jecxz, 2, f) // loop until ecx overflows and becomes zero + AS2( mov esi,[eax+4*ecx]) + AS2( adc esi,[edi+4*ecx]) + AS2( mov [edx+4*ecx],esi) + AS2( mov esi,[eax+4*ecx+4]) + AS2( adc esi,[edi+4*ecx+4]) + AS2( mov [edx+4*ecx+4],esi) + ASL(1) + AS2( mov esi,[eax+4*ecx+8]) + AS2( adc esi,[edi+4*ecx+8]) + AS2( mov [edx+4*ecx+8],esi) + AS2( mov esi,[eax+4*ecx+12]) + AS2( adc esi,[edi+4*ecx+12]) + AS2( mov [edx+4*ecx+12],esi) + + AS2( lea ecx,[ecx+4]) // advance index, avoid inc which causes slowdown on Intel Core 2 + ASJ( jmp, 0, b) + + ASL(2) + AS2( mov eax, 0) + AS1( setc al) // store carry into eax (return result register) + + AddEpilogue +} + +CRYPTOPP_NAKED int CRYPTOPP_FASTCALL Baseline_Sub(size_t N, word *C, const word *A, const word *B) +{ + AddPrologue + + // now: eax = A, edi = B, edx = C, ecx = N + AS2( lea eax, [eax+4*ecx]) + AS2( lea edi, [edi+4*ecx]) + AS2( lea edx, [edx+4*ecx]) + + AS1( neg ecx) // ecx is negative index + AS2( test ecx, 2) // this clears carry flag + ASJ( jz, 0, f) + AS2( sub ecx, 2) + ASJ( jmp, 1, f) + + ASL(0) + ASJ( jecxz, 2, f) // loop until ecx overflows and becomes zero + AS2( mov esi,[eax+4*ecx]) + AS2( sbb esi,[edi+4*ecx]) + AS2( mov [edx+4*ecx],esi) + AS2( mov esi,[eax+4*ecx+4]) + AS2( sbb esi,[edi+4*ecx+4]) + AS2( mov [edx+4*ecx+4],esi) + ASL(1) + AS2( mov esi,[eax+4*ecx+8]) + AS2( sbb esi,[edi+4*ecx+8]) + AS2( mov [edx+4*ecx+8],esi) + AS2( mov esi,[eax+4*ecx+12]) + AS2( sbb esi,[edi+4*ecx+12]) + AS2( mov [edx+4*ecx+12],esi) + + AS2( lea ecx,[ecx+4]) // advance index, avoid inc which causes slowdown on Intel Core 2 + ASJ( jmp, 0, b) + + ASL(2) + AS2( mov eax, 0) + AS1( setc al) // store carry into eax (return result register) + + AddEpilogue +} + +#if CRYPTOPP_INTEGER_SSE2 +CRYPTOPP_NAKED int CRYPTOPP_FASTCALL SSE2_Add(size_t N, word *C, const word *A, const word *B) +{ + AddPrologue + + // now: eax = A, edi = B, edx = C, ecx = N + AS2( lea eax, [eax+4*ecx]) + AS2( lea edi, [edi+4*ecx]) + AS2( lea edx, [edx+4*ecx]) + + AS1( neg ecx) // ecx is negative index + AS2( pxor mm2, mm2) + ASJ( jz, 2, f) + AS2( test ecx, 2) // this clears carry flag + ASJ( jz, 0, f) + AS2( sub ecx, 2) + ASJ( jmp, 1, f) + + ASL(0) + AS2( movd mm0, DWORD PTR [eax+4*ecx]) + AS2( movd mm1, DWORD PTR [edi+4*ecx]) + AS2( paddq mm0, mm1) + AS2( paddq mm2, mm0) + AS2( movd DWORD PTR [edx+4*ecx], mm2) + AS2( psrlq mm2, 32) + + AS2( movd mm0, DWORD PTR [eax+4*ecx+4]) + AS2( movd mm1, DWORD PTR [edi+4*ecx+4]) + AS2( paddq mm0, mm1) + AS2( paddq mm2, mm0) + AS2( movd DWORD PTR [edx+4*ecx+4], mm2) + AS2( psrlq mm2, 32) + + ASL(1) + AS2( movd mm0, DWORD PTR [eax+4*ecx+8]) + AS2( movd mm1, DWORD PTR [edi+4*ecx+8]) + AS2( paddq mm0, mm1) + AS2( paddq mm2, mm0) + AS2( movd DWORD PTR [edx+4*ecx+8], mm2) + AS2( psrlq mm2, 32) + + AS2( movd mm0, DWORD PTR [eax+4*ecx+12]) + AS2( movd mm1, DWORD PTR [edi+4*ecx+12]) + AS2( paddq mm0, mm1) + AS2( paddq mm2, mm0) + AS2( movd DWORD PTR [edx+4*ecx+12], mm2) + AS2( psrlq mm2, 32) + + AS2( add ecx, 4) + ASJ( jnz, 0, b) + + ASL(2) + AS2( movd eax, mm2) + AS1( emms) + + AddEpilogue +} +CRYPTOPP_NAKED int CRYPTOPP_FASTCALL SSE2_Sub(size_t N, word *C, const word *A, const word *B) +{ + AddPrologue + + // now: eax = A, edi = B, edx = C, ecx = N + AS2( lea eax, [eax+4*ecx]) + AS2( lea edi, [edi+4*ecx]) + AS2( lea edx, [edx+4*ecx]) + + AS1( neg ecx) // ecx is negative index + AS2( pxor mm2, mm2) + ASJ( jz, 2, f) + AS2( test ecx, 2) // this clears carry flag + ASJ( jz, 0, f) + AS2( sub ecx, 2) + ASJ( jmp, 1, f) + + ASL(0) + AS2( movd mm0, DWORD PTR [eax+4*ecx]) + AS2( movd mm1, DWORD PTR [edi+4*ecx]) + AS2( psubq mm0, mm1) + AS2( psubq mm0, mm2) + AS2( movd DWORD PTR [edx+4*ecx], mm0) + AS2( psrlq mm0, 63) + + AS2( movd mm2, DWORD PTR [eax+4*ecx+4]) + AS2( movd mm1, DWORD PTR [edi+4*ecx+4]) + AS2( psubq mm2, mm1) + AS2( psubq mm2, mm0) + AS2( movd DWORD PTR [edx+4*ecx+4], mm2) + AS2( psrlq mm2, 63) + + ASL(1) + AS2( movd mm0, DWORD PTR [eax+4*ecx+8]) + AS2( movd mm1, DWORD PTR [edi+4*ecx+8]) + AS2( psubq mm0, mm1) + AS2( psubq mm0, mm2) + AS2( movd DWORD PTR [edx+4*ecx+8], mm0) + AS2( psrlq mm0, 63) + + AS2( movd mm2, DWORD PTR [eax+4*ecx+12]) + AS2( movd mm1, DWORD PTR [edi+4*ecx+12]) + AS2( psubq mm2, mm1) + AS2( psubq mm2, mm0) + AS2( movd DWORD PTR [edx+4*ecx+12], mm2) + AS2( psrlq mm2, 63) + + AS2( add ecx, 4) + ASJ( jnz, 0, b) + + ASL(2) + AS2( movd eax, mm2) + AS1( emms) + + AddEpilogue +} +#endif // #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#else +int CRYPTOPP_FASTCALL Baseline_Add(size_t N, word *C, const word *A, const word *B) +{ + assert (N%2 == 0); + + Declare2Words(u); + AssignWord(u, 0); + for (size_t i=0; i=2 && N%2==0); + + if (N <= s_recursionLimit) + s_pMul[N/4](R, A, B); + else + { + const size_t N2 = N/2; + + size_t AN2 = Compare(A0, A1, N2) > 0 ? 0 : N2; + Subtract(R0, A + AN2, A + (N2 ^ AN2), N2); + + size_t BN2 = Compare(B0, B1, N2) > 0 ? 0 : N2; + Subtract(R1, B + BN2, B + (N2 ^ BN2), N2); + + RecursiveMultiply(R2, T2, A1, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + RecursiveMultiply(R0, T2, A0, B0, N2); + + // now T[01] holds (A1-A0)*(B0-B1), R[01] holds A0*B0, R[23] holds A1*B1 + + int c2 = Add(R2, R2, R1, N2); + int c3 = c2; + c2 += Add(R1, R2, R0, N2); + c3 += Add(R2, R2, R3, N2); + + if (AN2 == BN2) + c3 -= Subtract(R1, R1, T0, N); + else + c3 += Add(R1, R1, T0, N); + + c3 += Increment(R2, N2, c2); + assert (c3 >= 0 && c3 <= 2); + Increment(R3, N2, c3); + } +} + +// R[2*N] - result = A*A +// T[2*N] - temporary work space +// A[N] --- number to be squared + +void RecursiveSquare(word *R, word *T, const word *A, size_t N) +{ + assert(N && N%2==0); + + if (N <= s_recursionLimit) + s_pSqu[N/4](R, A); + else + { + const size_t N2 = N/2; + + RecursiveSquare(R0, T2, A0, N2); + RecursiveSquare(R2, T2, A1, N2); + RecursiveMultiply(T0, T2, A0, A1, N2); + + int carry = Add(R1, R1, T0, N); + carry += Add(R1, R1, T0, N); + Increment(R3, N2, carry); + } +} + +// R[N] - bottom half of A*B +// T[3*N/2] - temporary work space +// A[N] - multiplier +// B[N] - multiplicant + +void RecursiveMultiplyBottom(word *R, word *T, const word *A, const word *B, size_t N) +{ + assert(N>=2 && N%2==0); + + if (N <= s_recursionLimit) + s_pBot[N/4](R, A, B); + else + { + const size_t N2 = N/2; + + RecursiveMultiply(R, T, A0, B0, N2); + RecursiveMultiplyBottom(T0, T1, A1, B0, N2); + Add(R1, R1, T0, N2); + RecursiveMultiplyBottom(T0, T1, A0, B1, N2); + Add(R1, R1, T0, N2); + } +} + +// R[N] --- upper half of A*B +// T[2*N] - temporary work space +// L[N] --- lower half of A*B +// A[N] --- multiplier +// B[N] --- multiplicant + +void MultiplyTop(word *R, word *T, const word *L, const word *A, const word *B, size_t N) +{ + assert(N>=2 && N%2==0); + + if (N <= s_recursionLimit) + s_pTop[N/4](R, A, B, L[N-1]); + else + { + const size_t N2 = N/2; + + size_t AN2 = Compare(A0, A1, N2) > 0 ? 0 : N2; + Subtract(R0, A + AN2, A + (N2 ^ AN2), N2); + + size_t BN2 = Compare(B0, B1, N2) > 0 ? 0 : N2; + Subtract(R1, B + BN2, B + (N2 ^ BN2), N2); + + RecursiveMultiply(T0, T2, R0, R1, N2); + RecursiveMultiply(R0, T2, A1, B1, N2); + + // now T[01] holds (A1-A0)*(B0-B1) = A1*B0+A0*B1-A1*B1-A0*B0, R[01] holds A1*B1 + + int t, c3; + int c2 = Subtract(T2, L+N2, L, N2); + + if (AN2 == BN2) + { + c2 -= Add(T2, T2, T0, N2); + t = (Compare(T2, R0, N2) == -1); + c3 = t - Subtract(T2, T2, T1, N2); + } + else + { + c2 += Subtract(T2, T2, T0, N2); + t = (Compare(T2, R0, N2) == -1); + c3 = t + Add(T2, T2, T1, N2); + } + + c2 += t; + if (c2 >= 0) + c3 += Increment(T2, N2, c2); + else + c3 -= Decrement(T2, N2, -c2); + c3 += Add(R0, T2, R1, N2); + + assert (c3 >= 0 && c3 <= 2); + Increment(R1, N2, c3); + } +} + +inline void Multiply(word *R, word *T, const word *A, const word *B, size_t N) +{ + RecursiveMultiply(R, T, A, B, N); +} + +inline void Square(word *R, word *T, const word *A, size_t N) +{ + RecursiveSquare(R, T, A, N); +} + +inline void MultiplyBottom(word *R, word *T, const word *A, const word *B, size_t N) +{ + RecursiveMultiplyBottom(R, T, A, B, N); +} + +// R[NA+NB] - result = A*B +// T[NA+NB] - temporary work space +// A[NA] ---- multiplier +// B[NB] ---- multiplicant + +void AsymmetricMultiply(word *R, word *T, const word *A, size_t NA, const word *B, size_t NB) +{ + if (NA == NB) + { + if (A == B) + Square(R, T, A, NA); + else + Multiply(R, T, A, B, NA); + + return; + } + + if (NA > NB) + { + std::swap(A, B); + std::swap(NA, NB); + } + + assert(NB % NA == 0); + + if (NA==2 && !A[1]) + { + switch (A[0]) + { + case 0: + SetWords(R, 0, NB+2); + return; + case 1: + CopyWords(R, B, NB); + R[NB] = R[NB+1] = 0; + return; + default: + R[NB] = LinearMultiply(R, B, A[0], NB); + R[NB+1] = 0; + return; + } + } + + size_t i; + if ((NB/NA)%2 == 0) + { + Multiply(R, T, A, B, NA); + CopyWords(T+2*NA, R+NA, NA); + + for (i=2*NA; i=4); + +#define M0 M +#define M1 (M+N2) +#define V0 V +#define V1 (V+N2) + +#define X0 X +#define X1 (X+N2) +#define X2 (X+N) +#define X3 (X+N+N2) + + const size_t N2 = N/2; + Multiply(T0, T2, V0, X3, N2); + int c2 = Add(T0, T0, X0, N); + MultiplyBottom(T3, T2, T0, U, N2); + MultiplyTop(T2, R, T0, T3, M0, N2); + c2 -= Subtract(T2, T1, T2, N2); + Multiply(T0, R, T3, M1, N2); + c2 -= Subtract(T0, T2, T0, N2); + int c3 = -(int)Subtract(T1, X2, T1, N2); + Multiply(R0, T2, V1, X3, N2); + c3 += Add(R, R, T, N); + + if (c2>0) + c3 += Increment(R1, N2); + else if (c2<0) + c3 -= Decrement(R1, N2, -c2); + + assert(c3>=-1 && c3<=1); + if (c3>0) + Subtract(R, R, M, N); + else if (c3<0) + Add(R, R, M, N); + +#undef M0 +#undef M1 +#undef V0 +#undef V1 + +#undef X0 +#undef X1 +#undef X2 +#undef X3 +} + +#undef A0 +#undef A1 +#undef B0 +#undef B1 + +#undef T0 +#undef T1 +#undef T2 +#undef T3 + +#undef R0 +#undef R1 +#undef R2 +#undef R3 + +/* +// do a 3 word by 2 word divide, returns quotient and leaves remainder in A +static word SubatomicDivide(word *A, word B0, word B1) +{ + // assert {A[2],A[1]} < {B1,B0}, so quotient can fit in a word + assert(A[2] < B1 || (A[2]==B1 && A[1] < B0)); + + // estimate the quotient: do a 2 word by 1 word divide + word Q; + if (B1+1 == 0) + Q = A[2]; + else + Q = DWord(A[1], A[2]).DividedBy(B1+1); + + // now subtract Q*B from A + DWord p = DWord::Multiply(B0, Q); + DWord u = (DWord) A[0] - p.GetLowHalf(); + A[0] = u.GetLowHalf(); + u = (DWord) A[1] - p.GetHighHalf() - u.GetHighHalfAsBorrow() - DWord::Multiply(B1, Q); + A[1] = u.GetLowHalf(); + A[2] += u.GetHighHalf(); + + // Q <= actual quotient, so fix it + while (A[2] || A[1] > B1 || (A[1]==B1 && A[0]>=B0)) + { + u = (DWord) A[0] - B0; + A[0] = u.GetLowHalf(); + u = (DWord) A[1] - B1 - u.GetHighHalfAsBorrow(); + A[1] = u.GetLowHalf(); + A[2] += u.GetHighHalf(); + Q++; + assert(Q); // shouldn't overflow + } + + return Q; +} + +// do a 4 word by 2 word divide, returns 2 word quotient in Q0 and Q1 +static inline void AtomicDivide(word *Q, const word *A, const word *B) +{ + if (!B[0] && !B[1]) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) + { + Q[0] = A[2]; + Q[1] = A[3]; + } + else + { + word T[4]; + T[0] = A[0]; T[1] = A[1]; T[2] = A[2]; T[3] = A[3]; + Q[1] = SubatomicDivide(T+1, B[0], B[1]); + Q[0] = SubatomicDivide(T, B[0], B[1]); + +#ifndef NDEBUG + // multiply quotient and divisor and add remainder, make sure it equals dividend + assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0](T, DWord(A[0], A[1]), DWord(A[2], A[3]), DWord(B[0], B[1])); + Q[0] = q.GetLowHalf(); + Q[1] = q.GetHighHalf(); + +#ifndef NDEBUG + if (B[0] || B[1]) + { + // multiply quotient and divisor and add remainder, make sure it equals dividend + assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0]= 0) + { + R[N] -= Subtract(R, R, B, N); + Q[1] += (++Q[0]==0); + assert(Q[0] || Q[1]); // no overflow + } +} + +// R[NB] -------- remainder = A%B +// Q[NA-NB+2] --- quotient = A/B +// T[NA+3*(NB+2)] - temp work space +// A[NA] -------- dividend +// B[NB] -------- divisor + +void Divide(word *R, word *Q, word *T, const word *A, size_t NA, const word *B, size_t NB) +{ + assert(NA && NB && NA%2==0 && NB%2==0); + assert(B[NB-1] || B[NB-2]); + assert(NB <= NA); + + // set up temporary work space + word *const TA=T; + word *const TB=T+NA+2; + word *const TP=T+NA+2+NB; + + // copy B into TB and normalize it so that TB has highest bit set to 1 + unsigned shiftWords = (B[NB-1]==0); + TB[0] = TB[NB-1] = 0; + CopyWords(TB+shiftWords, B, NB-shiftWords); + unsigned shiftBits = WORD_BITS - BitPrecision(TB[NB-1]); + assert(shiftBits < WORD_BITS); + ShiftWordsLeftByBits(TB, NB, shiftBits); + + // copy A into TA and normalize it + TA[0] = TA[NA] = TA[NA+1] = 0; + CopyWords(TA+shiftWords, A, NA); + ShiftWordsLeftByBits(TA, NA+2, shiftBits); + + if (TA[NA+1]==0 && TA[NA] <= 1) + { + Q[NA-NB+1] = Q[NA-NB] = 0; + while (TA[NA] || Compare(TA+NA-NB, TB, NB) >= 0) + { + TA[NA] -= Subtract(TA+NA-NB, TA+NA-NB, TB, NB); + ++Q[NA-NB]; + } + } + else + { + NA+=2; + assert(Compare(TA+NA-NB, TB, NB) < 0); + } + + word BT[2]; + BT[0] = TB[NB-2] + 1; + BT[1] = TB[NB-1] + (BT[0]==0); + + // start reducing TA mod TB, 2 words at a time + for (size_t i=NA-2; i>=NB; i-=2) + { + AtomicDivide(Q+i-NB, TA+i-2, BT); + CorrectQuotientEstimate(TA+i-NB, TP, Q+i-NB, TB, NB); + } + + // copy TA into R, and denormalize it + CopyWords(R, TA+shiftWords, NB); + ShiftWordsRightByBits(R, NB, shiftBits); +} + +static inline size_t EvenWordCount(const word *X, size_t N) +{ + while (N && X[N-2]==0 && X[N-1]==0) + N-=2; + return N; +} + +// return k +// R[N] --- result = A^(-1) * 2^k mod M +// T[4*N] - temporary work space +// A[NA] -- number to take inverse of +// M[N] --- modulus + +unsigned int AlmostInverse(word *R, word *T, const word *A, size_t NA, const word *M, size_t N) +{ + assert(NA<=N && N && N%2==0); + + word *b = T; + word *c = T+N; + word *f = T+2*N; + word *g = T+3*N; + size_t bcLen=2, fgLen=EvenWordCount(M, N); + unsigned int k=0; + bool s=false; + + SetWords(T, 0, 3*N); + b[0]=1; + CopyWords(f, A, NA); + CopyWords(g, M, N); + + while (1) + { + word t=f[0]; + while (!t) + { + if (EvenWordCount(f, fgLen)==0) + { + SetWords(R, 0, N); + return 0; + } + + ShiftWordsRightByWords(f, fgLen, 1); + bcLen += 2 * (c[bcLen-1] != 0); + assert(bcLen <= N); + ShiftWordsLeftByWords(c, bcLen, 1); + k+=WORD_BITS; + t=f[0]; + } + + // t must be non-0; otherwise undefined. + unsigned int i = TrailingZeros(t); + t >>= i; + k += i; + + if (t==1 && f[1]==0 && EvenWordCount(f+2, fgLen-2)==0) + { + if (s) + Subtract(R, M, b, N); + else + CopyWords(R, b, N); + return k; + } + + ShiftWordsRightByBits(f, fgLen, i); + t = ShiftWordsLeftByBits(c, bcLen, i); + c[bcLen] += t; + bcLen += 2 * (t!=0); + assert(bcLen <= N); + + bool swap = Compare(f, g, fgLen)==-1; + ConditionalSwapPointers(swap, f, g); + ConditionalSwapPointers(swap, b, c); + s ^= swap; + + fgLen -= 2 * !(f[fgLen-2] | f[fgLen-1]); + + Subtract(f, f, g, fgLen); + t = Add(b, b, c, bcLen); + b[bcLen] += t; + bcLen += 2*t; + assert(bcLen <= N); + } +} + +// R[N] - result = A/(2^k) mod M +// A[N] - input +// M[N] - modulus + +void DivideByPower2Mod(word *R, const word *A, size_t k, const word *M, size_t N) +{ + CopyWords(R, A, N); + + while (k--) + { + if (R[0]%2==0) + ShiftWordsRightByBits(R, N, 1); + else + { + word carry = Add(R, R, M, N); + ShiftWordsRightByBits(R, N, 1); + R[N-1] += carry<<(WORD_BITS-1); + } + } +} + +// R[N] - result = A*(2^k) mod M +// A[N] - input +// M[N] - modulus + +void MultiplyByPower2Mod(word *R, const word *A, size_t k, const word *M, size_t N) +{ + CopyWords(R, A, N); + + while (k--) + if (ShiftWordsLeftByBits(R, N, 1) || Compare(R, M, N)>=0) + Subtract(R, R, M, N); +} + +// ****************************************************************** + +InitializeInteger::InitializeInteger() +{ + if (!g_pAssignIntToInteger) + { + SetFunctionPointers(); + g_pAssignIntToInteger = AssignIntToInteger; + } +} + +static const unsigned int RoundupSizeTable[] = {2, 2, 2, 4, 4, 8, 8, 8, 8}; + +static inline size_t RoundupSize(size_t n) +{ + if (n<=8) + return RoundupSizeTable[n]; + else if (n<=16) + return 16; + else if (n<=32) + return 32; + else if (n<=64) + return 64; + else return size_t(1) << BitPrecision(n-1); +} + +Integer::Integer() + : reg(2), sign(POSITIVE) +{ + reg[0] = reg[1] = 0; +} + +Integer::Integer(const Integer& t) + : reg(RoundupSize(t.WordCount())), sign(t.sign) +{ + CopyWords(reg, t.reg, reg.size()); +} + +Integer::Integer(Sign s, lword value) + : reg(2), sign(s) +{ + reg[0] = word(value); + reg[1] = word(SafeRightShift(value)); +} + +Integer::Integer(signed long value) + : reg(2) +{ + if (value >= 0) + sign = POSITIVE; + else + { + sign = NEGATIVE; + value = -value; + } + reg[0] = word(value); + reg[1] = word(SafeRightShift((unsigned long)value)); +} + +Integer::Integer(Sign s, word high, word low) + : reg(2), sign(s) +{ + reg[0] = low; + reg[1] = high; +} + +bool Integer::IsConvertableToLong() const +{ + if (ByteCount() > sizeof(long)) + return false; + + unsigned long value = (unsigned long)reg[0]; + value += SafeLeftShift((unsigned long)reg[1]); + + if (sign==POSITIVE) + return (signed long)value >= 0; + else + return -(signed long)value < 0; +} + +signed long Integer::ConvertToLong() const +{ + assert(IsConvertableToLong()); + + unsigned long value = (unsigned long)reg[0]; + value += SafeLeftShift((unsigned long)reg[1]); + return sign==POSITIVE ? value : -(signed long)value; +} + +Integer::Integer(BufferedTransformation &encodedInteger, size_t byteCount, Signedness s) +{ + Decode(encodedInteger, byteCount, s); +} + +Integer::Integer(const byte *encodedInteger, size_t byteCount, Signedness s) +{ + Decode(encodedInteger, byteCount, s); +} + +Integer::Integer(BufferedTransformation &bt) +{ + BERDecode(bt); +} + +Integer::Integer(RandomNumberGenerator &rng, size_t bitcount) +{ + Randomize(rng, bitcount); +} + +Integer::Integer(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType, const Integer &equiv, const Integer &mod) +{ + if (!Randomize(rng, min, max, rnType, equiv, mod)) + throw Integer::RandomNumberNotFound(); +} + +Integer Integer::Power2(size_t e) +{ + Integer r((word)0, BitsToWords(e+1)); + r.SetBit(e); + return r; +} + +template +struct NewInteger +{ + Integer * operator()() const + { + return new Integer(i); + } +}; + +const Integer &Integer::Zero() +{ + return Singleton().Ref(); +} + +const Integer &Integer::One() +{ + return Singleton >().Ref(); +} + +const Integer &Integer::Two() +{ + return Singleton >().Ref(); +} + +bool Integer::operator!() const +{ + return IsNegative() ? false : (reg[0]==0 && WordCount()==0); +} + +Integer& Integer::operator=(const Integer& t) +{ + if (this != &t) + { + if (reg.size() != t.reg.size() || t.reg[t.reg.size()/2] == 0) + reg.New(RoundupSize(t.WordCount())); + CopyWords(reg, t.reg, reg.size()); + sign = t.sign; + } + return *this; +} + +bool Integer::GetBit(size_t n) const +{ + if (n/WORD_BITS >= reg.size()) + return 0; + else + return bool((reg[n/WORD_BITS] >> (n % WORD_BITS)) & 1); +} + +void Integer::SetBit(size_t n, bool value) +{ + if (value) + { + reg.CleanGrow(RoundupSize(BitsToWords(n+1))); + reg[n/WORD_BITS] |= (word(1) << (n%WORD_BITS)); + } + else + { + if (n/WORD_BITS < reg.size()) + reg[n/WORD_BITS] &= ~(word(1) << (n%WORD_BITS)); + } +} + +byte Integer::GetByte(size_t n) const +{ + if (n/WORD_SIZE >= reg.size()) + return 0; + else + return byte(reg[n/WORD_SIZE] >> ((n%WORD_SIZE)*8)); +} + +void Integer::SetByte(size_t n, byte value) +{ + reg.CleanGrow(RoundupSize(BytesToWords(n+1))); + reg[n/WORD_SIZE] &= ~(word(0xff) << 8*(n%WORD_SIZE)); + reg[n/WORD_SIZE] |= (word(value) << 8*(n%WORD_SIZE)); +} + +lword Integer::GetBits(size_t i, size_t n) const +{ + lword v = 0; + assert(n <= sizeof(v)*8); + for (unsigned int j=0; j +static Integer StringToInteger(const T *str) +{ + int radix; + // GCC workaround + // std::char_traits::length() not defined in GCC 3.2 and STLport 4.5.3 + unsigned int length; + for (length = 0; str[length] != 0; length++) {} + + Integer v; + + if (length == 0) + return v; + + switch (str[length-1]) + { + case 'h': + case 'H': + radix=16; + break; + case 'o': + case 'O': + radix=8; + break; + case 'b': + case 'B': + radix=2; + break; + default: + radix=10; + } + + if (length > 2 && str[0] == '0' && str[1] == 'x') + radix = 16; + + for (unsigned i=0; i= '0' && str[i] <= '9') + digit = str[i] - '0'; + else if (str[i] >= 'A' && str[i] <= 'F') + digit = str[i] - 'A' + 10; + else if (str[i] >= 'a' && str[i] <= 'f') + digit = str[i] - 'a' + 10; + else + digit = radix; + + if (digit < radix) + { + v *= radix; + v += digit; + } + } + + if (str[0] == '-') + v.Negate(); + + return v; +} + +Integer::Integer(const char *str) + : reg(2), sign(POSITIVE) +{ + *this = StringToInteger(str); +} + +Integer::Integer(const wchar_t *str) + : reg(2), sign(POSITIVE) +{ + *this = StringToInteger(str); +} + +unsigned int Integer::WordCount() const +{ + return (unsigned int)CountWords(reg, reg.size()); +} + +unsigned int Integer::ByteCount() const +{ + unsigned wordCount = WordCount(); + if (wordCount) + return (wordCount-1)*WORD_SIZE + BytePrecision(reg[wordCount-1]); + else + return 0; +} + +unsigned int Integer::BitCount() const +{ + unsigned wordCount = WordCount(); + if (wordCount) + return (wordCount-1)*WORD_BITS + BitPrecision(reg[wordCount-1]); + else + return 0; +} + +void Integer::Decode(const byte *input, size_t inputLen, Signedness s) +{ + StringStore store(input, inputLen); + Decode(store, inputLen, s); +} + +void Integer::Decode(BufferedTransformation &bt, size_t inputLen, Signedness s) +{ + assert(bt.MaxRetrievable() >= inputLen); + + byte b; + bt.Peek(b); + sign = ((s==SIGNED) && (b & 0x80)) ? NEGATIVE : POSITIVE; + + while (inputLen>0 && (sign==POSITIVE ? b==0 : b==0xff)) + { + bt.Skip(1); + inputLen--; + bt.Peek(b); + } + + // The call to CleanNew is optimized away above -O0/-Og. + const size_t size = RoundupSize(BytesToWords(inputLen)); + reg.CleanNew(size); + + assert(reg.SizeInBytes() >= inputLen); + for (size_t i=inputLen; i > 0; i--) + { + bt.Get(b); + reg[(i-1)/WORD_SIZE] |= word(b) << ((i-1)%WORD_SIZE)*8; + } + + if (sign == NEGATIVE) + { + for (size_t i=inputLen; i 0; i--) + bt.Put(GetByte(i-1)); + } + else + { + // take two's complement of *this + Integer temp = Integer::Power2(8*STDMAX((size_t)ByteCount(), outputLen)) + *this; + temp.Encode(bt, outputLen, UNSIGNED); + } +} + +void Integer::DEREncode(BufferedTransformation &bt) const +{ + DERGeneralEncoder enc(bt, INTEGER); + Encode(enc, MinEncodedSize(SIGNED), SIGNED); + enc.MessageEnd(); +} + +void Integer::BERDecode(const byte *input, size_t len) +{ + StringStore store(input, len); + BERDecode(store); +} + +void Integer::BERDecode(BufferedTransformation &bt) +{ + BERGeneralDecoder dec(bt, INTEGER); + if (!dec.IsDefiniteLength() || dec.MaxRetrievable() < dec.RemainingLength()) + BERDecodeError(); + Decode(dec, (size_t)dec.RemainingLength(), SIGNED); + dec.MessageEnd(); +} + +void Integer::DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const +{ + DERGeneralEncoder enc(bt, OCTET_STRING); + Encode(enc, length); + enc.MessageEnd(); +} + +void Integer::BERDecodeAsOctetString(BufferedTransformation &bt, size_t length) +{ + BERGeneralDecoder dec(bt, OCTET_STRING); + if (!dec.IsDefiniteLength() || dec.RemainingLength() != length) + BERDecodeError(); + Decode(dec, length); + dec.MessageEnd(); +} + +size_t Integer::OpenPGPEncode(byte *output, size_t len) const +{ + ArraySink sink(output, len); + return OpenPGPEncode(sink); +} + +size_t Integer::OpenPGPEncode(BufferedTransformation &bt) const +{ + word16 bitCount = word16(BitCount()); + bt.PutWord16(bitCount); + size_t byteCount = BitsToBytes(bitCount); + Encode(bt, byteCount); + return 2 + byteCount; +} + +void Integer::OpenPGPDecode(const byte *input, size_t len) +{ + StringStore store(input, len); + OpenPGPDecode(store); +} + +void Integer::OpenPGPDecode(BufferedTransformation &bt) +{ + word16 bitCount; + if (bt.GetWord16(bitCount) != 2 || bt.MaxRetrievable() < BitsToBytes(bitCount)) + throw OpenPGPDecodeErr(); + Decode(bt, BitsToBytes(bitCount)); +} + +void Integer::Randomize(RandomNumberGenerator &rng, size_t nbits) +{ + const size_t nbytes = nbits/8 + 1; + SecByteBlock buf(nbytes); + rng.GenerateBlock(buf, nbytes); + if (nbytes) + buf[0] = (byte)Crop(buf[0], nbits % 8); + Decode(buf, nbytes, UNSIGNED); +} + +void Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max) +{ + if (min > max) + throw InvalidArgument("Integer: Min must be no greater than Max"); + + Integer range = max - min; + const unsigned int nbits = range.BitCount(); + + do + { + Randomize(rng, nbits); + } + while (*this > range); + + *this += min; +} + +bool Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType, const Integer &equiv, const Integer &mod) +{ + return GenerateRandomNoThrow(rng, MakeParameters("Min", min)("Max", max)("RandomNumberType", rnType)("EquivalentTo", equiv)("Mod", mod)); +} + +class KDF2_RNG : public RandomNumberGenerator +{ +public: + KDF2_RNG(const byte *seed, size_t seedSize) + : m_counter(0), m_counterAndSeed(seedSize + 4) + { + memcpy(m_counterAndSeed + 4, seed, seedSize); + } + + void GenerateBlock(byte *output, size_t size) + { + PutWord(false, BIG_ENDIAN_ORDER, m_counterAndSeed, m_counter); + ++m_counter; + P1363_KDF2::DeriveKey(output, size, m_counterAndSeed, m_counterAndSeed.size(), NULL, 0); + } + +private: + word32 m_counter; + SecByteBlock m_counterAndSeed; +}; + +bool Integer::GenerateRandomNoThrow(RandomNumberGenerator &i_rng, const NameValuePairs ¶ms) +{ + Integer min = params.GetValueWithDefault("Min", Integer::Zero()); + Integer max; + if (!params.GetValue("Max", max)) + { + int bitLength; + if (params.GetIntValue("BitLength", bitLength)) + max = Integer::Power2(bitLength); + else + throw InvalidArgument("Integer: missing Max argument"); + } + if (min > max) + throw InvalidArgument("Integer: Min must be no greater than Max"); + + Integer equiv = params.GetValueWithDefault("EquivalentTo", Integer::Zero()); + Integer mod = params.GetValueWithDefault("Mod", Integer::One()); + + if (equiv.IsNegative() || equiv >= mod) + throw InvalidArgument("Integer: invalid EquivalentTo and/or Mod argument"); + + Integer::RandomNumberType rnType = params.GetValueWithDefault("RandomNumberType", Integer::ANY); + + member_ptr kdf2Rng; + ConstByteArrayParameter seed; + if (params.GetValue(Name::Seed(), seed)) + { + ByteQueue bq; + DERSequenceEncoder seq(bq); + min.DEREncode(seq); + max.DEREncode(seq); + equiv.DEREncode(seq); + mod.DEREncode(seq); + DEREncodeUnsigned(seq, rnType); + DEREncodeOctetString(seq, seed.begin(), seed.size()); + seq.MessageEnd(); + + SecByteBlock finalSeed((size_t)bq.MaxRetrievable()); + bq.Get(finalSeed, finalSeed.size()); + kdf2Rng.reset(new KDF2_RNG(finalSeed.begin(), finalSeed.size())); + } + RandomNumberGenerator &rng = kdf2Rng.get() ? (RandomNumberGenerator &)*kdf2Rng : i_rng; + + switch (rnType) + { + case ANY: + if (mod == One()) + Randomize(rng, min, max); + else + { + Integer min1 = min + (equiv-min)%mod; + if (max < min1) + return false; + Randomize(rng, Zero(), (max - min1) / mod); + *this *= mod; + *this += min1; + } + return true; + + case PRIME: + { + const PrimeSelector *pSelector = params.GetValueWithDefault(Name::PointerToPrimeSelector(), (const PrimeSelector *)NULL); + + int i; + i = 0; + while (1) + { + if (++i==16) + { + // check if there are any suitable primes in [min, max] + Integer first = min; + if (FirstPrime(first, max, equiv, mod, pSelector)) + { + // if there is only one suitable prime, we're done + *this = first; + if (!FirstPrime(first, max, equiv, mod, pSelector)) + return true; + } + else + return false; + } + + Randomize(rng, min, max); + if (FirstPrime(*this, STDMIN(*this+mod*PrimeSearchInterval(max), max), equiv, mod, pSelector)) + return true; + } + } + + default: + throw InvalidArgument("Integer: invalid RandomNumberType argument"); + } +} + +std::istream& operator>>(std::istream& in, Integer &a) +{ + char c; + unsigned int length = 0; + SecBlock str(length + 16); + + std::ws(in); + + do + { + in.read(&c, 1); + str[length++] = c; + if (length >= str.size()) + str.Grow(length + 16); + } + while (in && (c=='-' || c=='x' || (c>='0' && c<='9') || (c>='a' && c<='f') || (c>='A' && c<='F') || c=='h' || c=='H' || c=='o' || c=='O' || c==',' || c=='.')); + + if (in.gcount()) + in.putback(c); + str[length-1] = '\0'; + a = Integer(str); + + return in; +} + +std::ostream& operator<<(std::ostream& out, const Integer &a) +{ + // Get relevant conversion specifications from ostream. + const long f = out.flags() & std::ios::basefield; // Get base digits. + int base, block; + char suffix; + switch(f) + { + case std::ios::oct : + base = 8; + block = 8; + suffix = 'o'; + break; + case std::ios::hex : + base = 16; + block = 4; + suffix = 'h'; + break; + default : + base = 10; + block = 3; + suffix = '.'; + } + + Integer temp1=a, temp2; + + if (a.IsNegative()) + { + out << '-'; + temp1.Negate(); + } + + if (!a) + out << '0'; + + static const char upper[]="0123456789ABCDEF"; + static const char lower[]="0123456789abcdef"; + + const char* vec = (out.flags() & std::ios::uppercase) ? upper : lower; + unsigned int i=0; + SecBlock s(a.BitCount() / (SaturatingSubtract1(BitPrecision(base),1U)) + 1); + + while (!!temp1) + { + word digit; + Integer::Divide(digit, temp2, temp1, base); + s[i++]=vec[digit]; + temp1.swap(temp2); + } + + while (i--) + { + out << s[i]; +// if (i && !(i%block)) +// out << ","; + } + + return out << suffix; +} + +Integer& Integer::operator++() +{ + if (NotNegative()) + { + if (Increment(reg, reg.size())) + { + reg.CleanGrow(2*reg.size()); + reg[reg.size()/2]=1; + } + } + else + { + word borrow = Decrement(reg, reg.size()); + assert(!borrow); + CRYPTOPP_UNUSED(borrow); + + if (WordCount()==0) + *this = Zero(); + } + return *this; +} + +Integer& Integer::operator--() +{ + if (IsNegative()) + { + if (Increment(reg, reg.size())) + { + reg.CleanGrow(2*reg.size()); + reg[reg.size()/2]=1; + } + } + else + { + if (Decrement(reg, reg.size())) + *this = -One(); + } + return *this; +} + +void PositiveAdd(Integer &sum, const Integer &a, const Integer& b) +{ + int carry; + if (a.reg.size() == b.reg.size()) + carry = Add(sum.reg, a.reg, b.reg, a.reg.size()); + else if (a.reg.size() > b.reg.size()) + { + carry = Add(sum.reg, a.reg, b.reg, b.reg.size()); + CopyWords(sum.reg+b.reg.size(), a.reg+b.reg.size(), a.reg.size()-b.reg.size()); + carry = Increment(sum.reg+b.reg.size(), a.reg.size()-b.reg.size(), carry); + } + else + { + carry = Add(sum.reg, a.reg, b.reg, a.reg.size()); + CopyWords(sum.reg+a.reg.size(), b.reg+a.reg.size(), b.reg.size()-a.reg.size()); + carry = Increment(sum.reg+a.reg.size(), b.reg.size()-a.reg.size(), carry); + } + + if (carry) + { + sum.reg.CleanGrow(2*sum.reg.size()); + sum.reg[sum.reg.size()/2] = 1; + } + sum.sign = Integer::POSITIVE; +} + +void PositiveSubtract(Integer &diff, const Integer &a, const Integer& b) +{ + unsigned aSize = a.WordCount(); + aSize += aSize%2; + unsigned bSize = b.WordCount(); + bSize += bSize%2; + + if (aSize == bSize) + { + if (Compare(a.reg, b.reg, aSize) >= 0) + { + Subtract(diff.reg, a.reg, b.reg, aSize); + diff.sign = Integer::POSITIVE; + } + else + { + Subtract(diff.reg, b.reg, a.reg, aSize); + diff.sign = Integer::NEGATIVE; + } + } + else if (aSize > bSize) + { + word borrow = Subtract(diff.reg, a.reg, b.reg, bSize); + CopyWords(diff.reg+bSize, a.reg+bSize, aSize-bSize); + borrow = Decrement(diff.reg+bSize, aSize-bSize, borrow); + assert(!borrow); + diff.sign = Integer::POSITIVE; + } + else + { + word borrow = Subtract(diff.reg, b.reg, a.reg, aSize); + CopyWords(diff.reg+aSize, b.reg+aSize, bSize-aSize); + borrow = Decrement(diff.reg+aSize, bSize-aSize, borrow); + assert(!borrow); + diff.sign = Integer::NEGATIVE; + } +} + +// MSVC .NET 2003 workaround +template inline const T& STDMAX2(const T& a, const T& b) +{ + return a < b ? b : a; +} + +Integer Integer::Plus(const Integer& b) const +{ + Integer sum((word)0, STDMAX2(reg.size(), b.reg.size())); + if (NotNegative()) + { + if (b.NotNegative()) + PositiveAdd(sum, *this, b); + else + PositiveSubtract(sum, *this, b); + } + else + { + if (b.NotNegative()) + PositiveSubtract(sum, b, *this); + else + { + PositiveAdd(sum, *this, b); + sum.sign = Integer::NEGATIVE; + } + } + return sum; +} + +Integer& Integer::operator+=(const Integer& t) +{ + reg.CleanGrow(t.reg.size()); + if (NotNegative()) + { + if (t.NotNegative()) + PositiveAdd(*this, *this, t); + else + PositiveSubtract(*this, *this, t); + } + else + { + if (t.NotNegative()) + PositiveSubtract(*this, t, *this); + else + { + PositiveAdd(*this, *this, t); + sign = Integer::NEGATIVE; + } + } + return *this; +} + +Integer Integer::Minus(const Integer& b) const +{ + Integer diff((word)0, STDMAX2(reg.size(), b.reg.size())); + if (NotNegative()) + { + if (b.NotNegative()) + PositiveSubtract(diff, *this, b); + else + PositiveAdd(diff, *this, b); + } + else + { + if (b.NotNegative()) + { + PositiveAdd(diff, *this, b); + diff.sign = Integer::NEGATIVE; + } + else + PositiveSubtract(diff, b, *this); + } + return diff; +} + +Integer& Integer::operator-=(const Integer& t) +{ + reg.CleanGrow(t.reg.size()); + if (NotNegative()) + { + if (t.NotNegative()) + PositiveSubtract(*this, *this, t); + else + PositiveAdd(*this, *this, t); + } + else + { + if (t.NotNegative()) + { + PositiveAdd(*this, *this, t); + sign = Integer::NEGATIVE; + } + else + PositiveSubtract(*this, t, *this); + } + return *this; +} + +Integer& Integer::operator<<=(size_t n) +{ + const size_t wordCount = WordCount(); + const size_t shiftWords = n / WORD_BITS; + const unsigned int shiftBits = (unsigned int)(n % WORD_BITS); + + reg.CleanGrow(RoundupSize(wordCount+BitsToWords(n))); + ShiftWordsLeftByWords(reg, wordCount + shiftWords, shiftWords); + ShiftWordsLeftByBits(reg+shiftWords, wordCount+BitsToWords(shiftBits), shiftBits); + return *this; +} + +Integer& Integer::operator>>=(size_t n) +{ + const size_t wordCount = WordCount(); + const size_t shiftWords = n / WORD_BITS; + const unsigned int shiftBits = (unsigned int)(n % WORD_BITS); + + ShiftWordsRightByWords(reg, wordCount, shiftWords); + if (wordCount > shiftWords) + ShiftWordsRightByBits(reg, wordCount-shiftWords, shiftBits); + if (IsNegative() && WordCount()==0) // avoid -0 + *this = Zero(); + return *this; +} + +void PositiveMultiply(Integer &product, const Integer &a, const Integer &b) +{ + size_t aSize = RoundupSize(a.WordCount()); + size_t bSize = RoundupSize(b.WordCount()); + + product.reg.CleanNew(RoundupSize(aSize+bSize)); + product.sign = Integer::POSITIVE; + + IntegerSecBlock workspace(aSize + bSize); + AsymmetricMultiply(product.reg, workspace, a.reg, aSize, b.reg, bSize); +} + +void Multiply(Integer &product, const Integer &a, const Integer &b) +{ + PositiveMultiply(product, a, b); + + if (a.NotNegative() != b.NotNegative()) + product.Negate(); +} + +Integer Integer::Times(const Integer &b) const +{ + Integer product; + Multiply(product, *this, b); + return product; +} + +/* +void PositiveDivide(Integer &remainder, Integer "ient, + const Integer ÷nd, const Integer &divisor) +{ + remainder.reg.CleanNew(divisor.reg.size()); + remainder.sign = Integer::POSITIVE; + quotient.reg.New(0); + quotient.sign = Integer::POSITIVE; + unsigned i=dividend.BitCount(); + while (i--) + { + word overflow = ShiftWordsLeftByBits(remainder.reg, remainder.reg.size(), 1); + remainder.reg[0] |= dividend[i]; + if (overflow || remainder >= divisor) + { + Subtract(remainder.reg, remainder.reg, divisor.reg, remainder.reg.size()); + quotient.SetBit(i); + } + } +} +*/ + +void PositiveDivide(Integer &remainder, Integer "ient, + const Integer &a, const Integer &b) +{ + unsigned aSize = a.WordCount(); + unsigned bSize = b.WordCount(); + + if (!bSize) + throw Integer::DivideByZero(); + + if (aSize < bSize) + { + remainder = a; + remainder.sign = Integer::POSITIVE; + quotient = Integer::Zero(); + return; + } + + aSize += aSize%2; // round up to next even number + bSize += bSize%2; + + remainder.reg.CleanNew(RoundupSize(bSize)); + remainder.sign = Integer::POSITIVE; + quotient.reg.CleanNew(RoundupSize(aSize-bSize+2)); + quotient.sign = Integer::POSITIVE; + + IntegerSecBlock T(aSize+3*(bSize+2)); + Divide(remainder.reg, quotient.reg, T, a.reg, aSize, b.reg, bSize); +} + +void Integer::Divide(Integer &remainder, Integer "ient, const Integer ÷nd, const Integer &divisor) +{ + PositiveDivide(remainder, quotient, dividend, divisor); + + if (dividend.IsNegative()) + { + quotient.Negate(); + if (remainder.NotZero()) + { + --quotient; + remainder = divisor.AbsoluteValue() - remainder; + } + } + + if (divisor.IsNegative()) + quotient.Negate(); +} + +void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, unsigned int n) +{ + q = a; + q >>= n; + + const size_t wordCount = BitsToWords(n); + if (wordCount <= a.WordCount()) + { + r.reg.resize(RoundupSize(wordCount)); + CopyWords(r.reg, a.reg, wordCount); + SetWords(r.reg+wordCount, 0, r.reg.size()-wordCount); + if (n % WORD_BITS != 0) + r.reg[wordCount-1] %= (word(1) << (n % WORD_BITS)); + } + else + { + r.reg.resize(RoundupSize(a.WordCount())); + CopyWords(r.reg, a.reg, r.reg.size()); + } + r.sign = POSITIVE; + + if (a.IsNegative() && r.NotZero()) + { + --q; + r = Power2(n) - r; + } +} + +Integer Integer::DividedBy(const Integer &b) const +{ + Integer remainder, quotient; + Integer::Divide(remainder, quotient, *this, b); + return quotient; +} + +Integer Integer::Modulo(const Integer &b) const +{ + Integer remainder, quotient; + Integer::Divide(remainder, quotient, *this, b); + return remainder; +} + +void Integer::Divide(word &remainder, Integer "ient, const Integer ÷nd, word divisor) +{ + if (!divisor) + throw Integer::DivideByZero(); + + assert(divisor); + + if ((divisor & (divisor-1)) == 0) // divisor is a power of 2 + { + quotient = dividend >> (BitPrecision(divisor)-1); + remainder = dividend.reg[0] & (divisor-1); + return; + } + + unsigned int i = dividend.WordCount(); + quotient.reg.CleanNew(RoundupSize(i)); + remainder = 0; + while (i--) + { + quotient.reg[i] = DWord(dividend.reg[i], remainder) / divisor; + remainder = DWord(dividend.reg[i], remainder) % divisor; + } + + if (dividend.NotNegative()) + quotient.sign = POSITIVE; + else + { + quotient.sign = NEGATIVE; + if (remainder) + { + --quotient; + remainder = divisor - remainder; + } + } +} + +Integer Integer::DividedBy(word b) const +{ + word remainder; + Integer quotient; + Integer::Divide(remainder, quotient, *this, b); + return quotient; +} + +word Integer::Modulo(word divisor) const +{ + if (!divisor) + throw Integer::DivideByZero(); + + assert(divisor); + + word remainder; + + if ((divisor & (divisor-1)) == 0) // divisor is a power of 2 + remainder = reg[0] & (divisor-1); + else + { + unsigned int i = WordCount(); + + if (divisor <= 5) + { + DWord sum(0, 0); + while (i--) + sum += reg[i]; + remainder = sum % divisor; + } + else + { + remainder = 0; + while (i--) + remainder = DWord(reg[i], remainder) % divisor; + } + } + + if (IsNegative() && remainder) + remainder = divisor - remainder; + + return remainder; +} + +void Integer::Negate() +{ + if (!!(*this)) // don't flip sign if *this==0 + sign = Sign(1-sign); +} + +int Integer::PositiveCompare(const Integer& t) const +{ + unsigned size = WordCount(), tSize = t.WordCount(); + + if (size == tSize) + return CryptoPP::Compare(reg, t.reg, size); + else + return size > tSize ? 1 : -1; +} + +int Integer::Compare(const Integer& t) const +{ + if (NotNegative()) + { + if (t.NotNegative()) + return PositiveCompare(t); + else + return 1; + } + else + { + if (t.NotNegative()) + return -1; + else + return -PositiveCompare(t); + } +} + +Integer Integer::SquareRoot() const +{ + if (!IsPositive()) + return Zero(); + + // overestimate square root + Integer x, y = Power2((BitCount()+1)/2); + assert(y*y >= *this); + + do + { + x = y; + y = (x + *this/x) >> 1; + } while (y().Gcd(a, b); +} + +Integer Integer::InverseMod(const Integer &m) const +{ + assert(m.NotNegative()); + + if (IsNegative()) + return Modulo(m).InverseMod(m); + + if (m.IsEven()) + { + if (!m || IsEven()) + return Zero(); // no inverse + if (*this == One()) + return One(); + + Integer u = m.Modulo(*this).InverseMod(*this); + return !u ? Zero() : (m*(*this-u)+1)/(*this); + } + + SecBlock T(m.reg.size() * 4); + Integer r((word)0, m.reg.size()); + unsigned k = AlmostInverse(r.reg, T, reg, reg.size(), m.reg, m.reg.size()); + DivideByPower2Mod(r.reg, r.reg, k, m.reg, m.reg.size()); + return r; +} + +word Integer::InverseMod(word mod) const +{ + word g0 = mod, g1 = *this % mod; + word v0 = 0, v1 = 1; + word y; + + while (g1) + { + if (g1 == 1) + return v1; + y = g0 / g1; + g0 = g0 % g1; + v0 += y * v1; + + if (!g0) + break; + if (g0 == 1) + return mod-v0; + y = g1 / g0; + g1 = g1 % g0; + v1 += y * v0; + } + return 0; +} + +// ******************************************************** + +ModularArithmetic::ModularArithmetic(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + OID oid(seq); + if (oid != ASN1::prime_field()) + BERDecodeError(); + m_modulus.BERDecode(seq); + seq.MessageEnd(); + m_result.reg.resize(m_modulus.reg.size()); +} + +void ModularArithmetic::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + ASN1::prime_field().DEREncode(seq); + m_modulus.DEREncode(seq); + seq.MessageEnd(); +} + +void ModularArithmetic::DEREncodeElement(BufferedTransformation &out, const Element &a) const +{ + a.DEREncodeAsOctetString(out, MaxElementByteLength()); +} + +void ModularArithmetic::BERDecodeElement(BufferedTransformation &in, Element &a) const +{ + a.BERDecodeAsOctetString(in, MaxElementByteLength()); +} + +const Integer& ModularArithmetic::Half(const Integer &a) const +{ + if (a.reg.size()==m_modulus.reg.size()) + { + CryptoPP::DivideByPower2Mod(m_result.reg.begin(), a.reg, 1, m_modulus.reg, a.reg.size()); + return m_result; + } + else + return m_result1 = (a.IsEven() ? (a >> 1) : ((a+m_modulus) >> 1)); +} + +const Integer& ModularArithmetic::Add(const Integer &a, const Integer &b) const +{ + if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) + { + if (CryptoPP::Add(m_result.reg.begin(), a.reg, b.reg, a.reg.size()) + || Compare(m_result.reg, m_modulus.reg, a.reg.size()) >= 0) + { + CryptoPP::Subtract(m_result.reg.begin(), m_result.reg, m_modulus.reg, a.reg.size()); + } + return m_result; + } + else + { + m_result1 = a+b; + if (m_result1 >= m_modulus) + m_result1 -= m_modulus; + return m_result1; + } +} + +Integer& ModularArithmetic::Accumulate(Integer &a, const Integer &b) const +{ + if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) + { + if (CryptoPP::Add(a.reg, a.reg, b.reg, a.reg.size()) + || Compare(a.reg, m_modulus.reg, a.reg.size()) >= 0) + { + CryptoPP::Subtract(a.reg, a.reg, m_modulus.reg, a.reg.size()); + } + } + else + { + a+=b; + if (a>=m_modulus) + a-=m_modulus; + } + + return a; +} + +const Integer& ModularArithmetic::Subtract(const Integer &a, const Integer &b) const +{ + if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) + { + if (CryptoPP::Subtract(m_result.reg.begin(), a.reg, b.reg, a.reg.size())) + CryptoPP::Add(m_result.reg.begin(), m_result.reg, m_modulus.reg, a.reg.size()); + return m_result; + } + else + { + m_result1 = a-b; + if (m_result1.IsNegative()) + m_result1 += m_modulus; + return m_result1; + } +} + +Integer& ModularArithmetic::Reduce(Integer &a, const Integer &b) const +{ + if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) + { + if (CryptoPP::Subtract(a.reg, a.reg, b.reg, a.reg.size())) + CryptoPP::Add(a.reg, a.reg, m_modulus.reg, a.reg.size()); + } + else + { + a-=b; + if (a.IsNegative()) + a+=m_modulus; + } + + return a; +} + +const Integer& ModularArithmetic::Inverse(const Integer &a) const +{ + if (!a) + return a; + + CopyWords(m_result.reg.begin(), m_modulus.reg, m_modulus.reg.size()); + if (CryptoPP::Subtract(m_result.reg.begin(), m_result.reg, a.reg, a.reg.size())) + Decrement(m_result.reg.begin()+a.reg.size(), m_modulus.reg.size()-a.reg.size()); + + return m_result; +} + +Integer ModularArithmetic::CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const +{ + if (m_modulus.IsOdd()) + { + MontgomeryRepresentation dr(m_modulus); + return dr.ConvertOut(dr.CascadeExponentiate(dr.ConvertIn(x), e1, dr.ConvertIn(y), e2)); + } + else + return AbstractRing::CascadeExponentiate(x, e1, y, e2); +} + +void ModularArithmetic::SimultaneousExponentiate(Integer *results, const Integer &base, const Integer *exponents, unsigned int exponentsCount) const +{ + if (m_modulus.IsOdd()) + { + MontgomeryRepresentation dr(m_modulus); + dr.SimultaneousExponentiate(results, dr.ConvertIn(base), exponents, exponentsCount); + for (unsigned int i=0; i::SimultaneousExponentiate(results, base, exponents, exponentsCount); +} + +MontgomeryRepresentation::MontgomeryRepresentation(const Integer &m) // modulus must be odd + : ModularArithmetic(m), + m_u((word)0, m_modulus.reg.size()), + m_workspace(5*m_modulus.reg.size()) +{ + if (!m_modulus.IsOdd()) + throw InvalidArgument("MontgomeryRepresentation: Montgomery representation requires an odd modulus"); + + RecursiveInverseModPower2(m_u.reg, m_workspace, m_modulus.reg, m_modulus.reg.size()); +} + +const Integer& MontgomeryRepresentation::Multiply(const Integer &a, const Integer &b) const +{ + word *const T = m_workspace.begin(); + word *const R = m_result.reg.begin(); + const size_t N = m_modulus.reg.size(); + assert(a.reg.size()<=N && b.reg.size()<=N); + + AsymmetricMultiply(T, T+2*N, a.reg, a.reg.size(), b.reg, b.reg.size()); + SetWords(T+a.reg.size()+b.reg.size(), 0, 2*N-a.reg.size()-b.reg.size()); + MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); + return m_result; +} + +const Integer& MontgomeryRepresentation::Square(const Integer &a) const +{ + word *const T = m_workspace.begin(); + word *const R = m_result.reg.begin(); + const size_t N = m_modulus.reg.size(); + assert(a.reg.size()<=N); + + CryptoPP::Square(T, T+2*N, a.reg, a.reg.size()); + SetWords(T+2*a.reg.size(), 0, 2*N-2*a.reg.size()); + MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); + return m_result; +} + +Integer MontgomeryRepresentation::ConvertOut(const Integer &a) const +{ + word *const T = m_workspace.begin(); + word *const R = m_result.reg.begin(); + const size_t N = m_modulus.reg.size(); + assert(a.reg.size()<=N); + + CopyWords(T, a.reg, a.reg.size()); + SetWords(T+a.reg.size(), 0, 2*N-a.reg.size()); + MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); + return m_result; +} + +const Integer& MontgomeryRepresentation::MultiplicativeInverse(const Integer &a) const +{ +// return (EuclideanMultiplicativeInverse(a, modulus)<<(2*WORD_BITS*modulus.reg.size()))%modulus; + word *const T = m_workspace.begin(); + word *const R = m_result.reg.begin(); + const size_t N = m_modulus.reg.size(); + assert(a.reg.size()<=N); + + CopyWords(T, a.reg, a.reg.size()); + SetWords(T+a.reg.size(), 0, 2*N-a.reg.size()); + MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); + unsigned k = AlmostInverse(R, T, R, N, m_modulus.reg, N); + +// cout << "k=" << k << " N*32=" << 32*N << endl; + + if (k>N*WORD_BITS) + DivideByPower2Mod(R, R, k-N*WORD_BITS, m_modulus.reg, N); + else + MultiplyByPower2Mod(R, R, N*WORD_BITS-k, m_modulus.reg, N); + + return m_result; +} + +// Specialization declared in misc.h to allow us to print integers +// with additional control options, like arbirary bases and uppercase. +template <> CRYPTOPP_DLL +std::string IntToString(Integer value, unsigned int base) +{ + // Hack... set the high bit for uppercase. Set the next bit fo a suffix. + static const unsigned int BIT_32 = (1U << 31); + const bool UPPER = !!(base & BIT_32); + static const unsigned int BIT_31 = (1U << 30); + const bool BASE = !!(base & BIT_31); + + const char CH = UPPER ? 'A' : 'a'; + base &= ~(BIT_32|BIT_31); + assert(base >= 2 && base <= 32); + + if (value == 0) + return "0"; + + bool negative = false, zero = false; + if (value.IsNegative()) + { + negative = true; + value.Negate(); + } + + if (!value) + zero = true; + + SecBlock s(value.BitCount() / (SaturatingSubtract1(BitPrecision(base),1U)) + 1); + Integer temp; + + unsigned int i=0; + while (!!value) + { + word digit; + Integer::Divide(digit, temp, value, word(base)); + s[i++]=char((digit < 10 ? '0' : (CH - 10)) + digit); + value.swap(temp); + } + + std::string result; + result.reserve(i+2); + + if (negative) + result += '-'; + + if (zero) + result += '0'; + + while (i--) + result += s[i]; + + if (BASE) + { + if (base == 10) + result += '.'; + else if (base == 16) + result += 'h'; + else if (base == 8) + result += 'o'; + else if (base == 2) + result += 'b'; + } + + return result; +} + +// Specialization declared in misc.h to avoid Coverity findings. +template <> CRYPTOPP_DLL +std::string IntToString(unsigned long long value, unsigned int base) +{ + // Hack... set the high bit for uppercase. + static const unsigned int HIGH_BIT = (1U << 31); + const char CH = !!(base & HIGH_BIT) ? 'A' : 'a'; + base &= ~HIGH_BIT; + + assert(base >= 2); + if (value == 0) + return "0"; + + std::string result; + while (value > 0) + { + unsigned long long digit = value % base; + result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result; + value /= base; + } + return result; +} + +NAMESPACE_END + +#if WORKAROUND_ARMEL_BUG +# pragma GCC pop_options +#endif + +#if WORKAROUND_ARM64_BUG +# pragma GCC pop_options +#endif + +#endif diff --git a/external/crypto++-5.6.3/integer.h b/external/crypto++-5.6.3/integer.h new file mode 100644 index 000000000..afb7ff7d4 --- /dev/null +++ b/external/crypto++-5.6.3/integer.h @@ -0,0 +1,570 @@ +#ifndef CRYPTOPP_INTEGER_H +#define CRYPTOPP_INTEGER_H + +/** \file */ + +#include "cryptlib.h" +#include "secblock.h" +#include "stdcpp.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! \struct InitializeInteger +//! Performs static intialization of the Integer class +struct InitializeInteger +{ + InitializeInteger(); +}; + +typedef SecBlock > IntegerSecBlock; + +//! \brief Multiple precision integer with arithmetic operations +//! \details The Integer class can represent positive and negative integers +//! with absolute value less than (256**sizeof(word))(256**sizeof(int)). +//! \details Internally, the library uses a sign magnitude representation, and the class +//! has two data members. The first is a IntegerSecBlock (a SecBlock) and it i +//! used to hold the representation. The second is a Sign, and its is used to track +//! the sign of the Integer. +//! \nosubgrouping +class CRYPTOPP_DLL Integer : private InitializeInteger, public ASN1Object +{ +public: + //! \name ENUMS, EXCEPTIONS, and TYPEDEFS + //@{ + //! \brief Exception thrown when division by 0 is encountered + class DivideByZero : public Exception + { + public: + DivideByZero() : Exception(OTHER_ERROR, "Integer: division by zero") {} + }; + + //! \brief Exception thrown when a random number cannot be found that + //! satisfies the condition + class RandomNumberNotFound : public Exception + { + public: + RandomNumberNotFound() : Exception(OTHER_ERROR, "Integer: no integer satisfies the given parameters") {} + }; + + //! \enum Sign + //! \brief Used internally to represent the integer + //! \details Sign is used internally to represent the integer. It is also used in a few API functions. + //! \sa Signedness + enum Sign { + //! \brief the value is positive or 0 + POSITIVE=0, + //! \brief the value is negative + NEGATIVE=1}; + + //! \enum Signedness + //! \brief Used when importing and exporting integers + //! \details Signedness is usually used in API functions. + //! \sa Sign + enum Signedness { + //! \brief an unsigned value + UNSIGNED, + //! \brief a signed value + SIGNED}; + + //! \enum RandomNumberType + //! \brief Properties of a random integer + enum RandomNumberType { + //! \brief a number with no special properties + ANY, + //! \brief a number which is probabilistically prime + PRIME}; + //@} + + //! \name CREATORS + //@{ + //! \brief Creates the zero integer + Integer(); + + //! copy constructor + Integer(const Integer& t); + + //! \brief Convert from signed long + Integer(signed long value); + + //! \brief Convert from lword + //! \param sign enumeration indicating Sign + //! \param value the long word + Integer(Sign sign, lword value); + + //! \brief Convert from two words + //! \param sign enumeration indicating Sign + //! \param highWord the high word + //! \param lowWord the low word + Integer(Sign sign, word highWord, word lowWord); + + //! \brief Convert from a C-string + //! \param str C-string value + //! \details \p str can be in base 2, 8, 10, or 16. Base is determined by a case + //! insensitive suffix of 'h', 'o', or 'b'. No suffix means base 10. + explicit Integer(const char *str); + + //! \brief Convert from a wide C-string + //! \param str wide C-string value + //! \details \p str can be in base 2, 8, 10, or 16. Base is determined by a case + //! insensitive suffix of 'h', 'o', or 'b'. No suffix means base 10. + explicit Integer(const wchar_t *str); + + //! \brief Convert from a big-endian byte array + //! \param encodedInteger big-endian byte array + //! \param byteCount length of the byte array + //! \param sign enumeration indicating Signedness + Integer(const byte *encodedInteger, size_t byteCount, Signedness sign=UNSIGNED); + + //! \brief Convert from a big-endian array + //! \param bt BufferedTransformation object with big-endian byte array + //! \param byteCount length of the byte array + //! \param sign enumeration indicating Signedness + Integer(BufferedTransformation &bt, size_t byteCount, Signedness sign=UNSIGNED); + + //! \brief Convert from a BER encoded byte array + //! \param bt BufferedTransformation object with BER encoded byte array + explicit Integer(BufferedTransformation &bt); + + //! \brief Create a random integer + //! \param rng RandomNumberGenerator used to generate material + //! \param bitCount the number of bits in the resulting integer + //! \details The random integer created is uniformly distributed over [0, 2bitCount]. + Integer(RandomNumberGenerator &rng, size_t bitCount); + + //! \brief Integer representing 0 + //! \returns an Integer representing 0 + //! \details Zero() avoids calling constructors for frequently used integers + static const Integer & CRYPTOPP_API Zero(); + //! \brief Integer representing 1 + //! \returns an Integer representing 1 + //! \details One() avoids calling constructors for frequently used integers + static const Integer & CRYPTOPP_API One(); + //! \brief Integer representing 2 + //! \returns an Integer representing 2 + //! \details Two() avoids calling constructors for frequently used integers + static const Integer & CRYPTOPP_API Two(); + + //! \brief Create a random integer of special form + //! \param rng RandomNumberGenerator used to generate material + //! \param min the minimum value + //! \param max the maximum value + //! \param rnType RandomNumberType to specify the type + //! \param equiv the equivalence class based on the parameter \p mod + //! \param mod the modulus used to reduce the equivalence class + //! \throw RandomNumberNotFound if the set is empty. + //! \details Ideally, the random integer created should be uniformly distributed + //! over {x | min \<= x \<= max and \p x is of rnType and x \% mod == equiv}. + //! However the actual distribution may not be uniform because sequential + //! search is used to find an appropriate number from a random starting + //! point. + //! \details May return (with very small probability) a pseudoprime when a prime + //! is requested and max \> lastSmallPrime*lastSmallPrime. \p lastSmallPrime + //! is declared in nbtheory.h. + Integer(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType=ANY, const Integer &equiv=Zero(), const Integer &mod=One()); + + //! \brief Exponentiates to a power of 2 + //! \returns the Integer 2e + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + static Integer CRYPTOPP_API Power2(size_t e); + //@} + + //! \name ENCODE/DECODE + //@{ + //! \brief The minimum number of bytes to encode this integer + //! \param sign enumeration indicating Signedness + //! \note The MinEncodedSize() of 0 is 1. + size_t MinEncodedSize(Signedness sign=UNSIGNED) const; + + //! \brief Encode in big-endian format + //! \param output big-endian byte array + //! \param outputLen length of the byte array + //! \param sign enumeration indicating Signedness + //! \details Unsigned means encode absolute value, signed means encode two's complement if negative. + //! \details outputLen can be used to ensure an Integer is encoded to an exact size (rather than a + //! minimum size). An exact size is useful, for example, when encoding to a field element size. + void Encode(byte *output, size_t outputLen, Signedness sign=UNSIGNED) const; + + //! \brief Encode in big-endian format + //! \param bt BufferedTransformation object + //! \param outputLen length of the encoding + //! \param sign enumeration indicating Signedness + //! \details Unsigned means encode absolute value, signed means encode two's complement if negative. + //! \details outputLen can be used to ensure an Integer is encoded to an exact size (rather than a + //! minimum size). An exact size is useful, for example, when encoding to a field element size. + void Encode(BufferedTransformation &bt, size_t outputLen, Signedness sign=UNSIGNED) const; + + //! \brief Encode in DER format + //! \param bt BufferedTransformation object + //! \details Encodes the Integer using Distinguished Encoding Rules + //! The result is placed into a BufferedTransformation object + void DEREncode(BufferedTransformation &bt) const; + + //! encode absolute value as big-endian octet string + //! \param bt BufferedTransformation object + //! \param length the number of mytes to decode + void DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const; + + //! \brief Encode absolute value in OpenPGP format + //! \param output big-endian byte array + //! \param bufferSize length of the byte array + //! \returns length of the output + //! \details OpenPGPEncode places result into a BufferedTransformation object and returns the + //! number of bytes used for the encoding + size_t OpenPGPEncode(byte *output, size_t bufferSize) const; + + //! \brief Encode absolute value in OpenPGP format + //! \param bt BufferedTransformation object + //! \returns length of the output + //! \details OpenPGPEncode places result into a BufferedTransformation object and returns the + //! number of bytes used for the encoding + size_t OpenPGPEncode(BufferedTransformation &bt) const; + + //! \brief Decode from big-endian byte array + //! \param input big-endian byte array + //! \param inputLen length of the byte array + //! \param sign enumeration indicating Signedness + void Decode(const byte *input, size_t inputLen, Signedness sign=UNSIGNED); + + //! \brief Decode nonnegative value from big-endian byte array + //! \param bt BufferedTransformation object + //! \param inputLen length of the byte array + //! \param sign enumeration indicating Signedness + //! \note bt.MaxRetrievable() \>= inputLen. + void Decode(BufferedTransformation &bt, size_t inputLen, Signedness sign=UNSIGNED); + + //! \brief Decode from BER format + //! \param input big-endian byte array + //! \param inputLen length of the byte array + void BERDecode(const byte *input, size_t inputLen); + + //! \brief Decode from BER format + //! \param bt BufferedTransformation object + void BERDecode(BufferedTransformation &bt); + + //! \brief Decode nonnegative value from big-endian octet string + //! \param bt BufferedTransformation object + //! \param length length of the byte array + void BERDecodeAsOctetString(BufferedTransformation &bt, size_t length); + + //! \brief Exception thrown when an error is encountered decoding an OpenPGP integer + class OpenPGPDecodeErr : public Exception + { + public: + OpenPGPDecodeErr() : Exception(INVALID_DATA_FORMAT, "OpenPGP decode error") {} + }; + + //! \brief Decode from OpenPGP format + //! \param input big-endian byte array + //! \param inputLen length of the byte array + void OpenPGPDecode(const byte *input, size_t inputLen); + //! \brief Decode from OpenPGP format + //! \param bt BufferedTransformation object + void OpenPGPDecode(BufferedTransformation &bt); + //@} + + //! \name ACCESSORS + //@{ + //! return true if *this can be represented as a signed long + bool IsConvertableToLong() const; + //! return equivalent signed long if possible, otherwise undefined + signed long ConvertToLong() const; + + //! number of significant bits = floor(log2(abs(*this))) + 1 + unsigned int BitCount() const; + //! number of significant bytes = ceiling(BitCount()/8) + unsigned int ByteCount() const; + //! number of significant words = ceiling(ByteCount()/sizeof(word)) + unsigned int WordCount() const; + + //! return the i-th bit, i=0 being the least significant bit + bool GetBit(size_t i) const; + //! return the i-th byte + byte GetByte(size_t i) const; + //! return n lowest bits of *this >> i + lword GetBits(size_t i, size_t n) const; + + //! + bool IsZero() const {return !*this;} + //! + bool NotZero() const {return !IsZero();} + //! + bool IsNegative() const {return sign == NEGATIVE;} + //! + bool NotNegative() const {return !IsNegative();} + //! + bool IsPositive() const {return NotNegative() && NotZero();} + //! + bool NotPositive() const {return !IsPositive();} + //! + bool IsEven() const {return GetBit(0) == 0;} + //! + bool IsOdd() const {return GetBit(0) == 1;} + //@} + + //! \name MANIPULATORS + //@{ + //! + Integer& operator=(const Integer& t); + + //! + Integer& operator+=(const Integer& t); + //! + Integer& operator-=(const Integer& t); + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer& operator*=(const Integer& t) {return *this = Times(t);} + //! + Integer& operator/=(const Integer& t) {return *this = DividedBy(t);} + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer& operator%=(const Integer& t) {return *this = Modulo(t);} + //! + Integer& operator/=(word t) {return *this = DividedBy(t);} + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer& operator%=(word t) {return *this = Integer(POSITIVE, 0, Modulo(t));} + + //! + Integer& operator<<=(size_t); + //! + Integer& operator>>=(size_t); + + //! \brief Set this Integer to random integer + //! \param rng RandomNumberGenerator used to generate material + //! \param bitCount the number of bits in the resulting integer + //! \details The random integer created is uniformly distributed over [0, 2bitCount]. + void Randomize(RandomNumberGenerator &rng, size_t bitCount); + + //! \brief Set this Integer to random integer + //! \param rng RandomNumberGenerator used to generate material + //! \param min the minimum value + //! \param max the maximum value + //! \details The random integer created is uniformly distributed over [min, max]. + void Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max); + + //! \brief Set this Integer to random integer of special form + //! \param rng RandomNumberGenerator used to generate material + //! \param min the minimum value + //! \param max the maximum value + //! \param rnType RandomNumberType to specify the type + //! \param equiv the equivalence class based on the parameter \p mod + //! \param mod the modulus used to reduce the equivalence class + //! \throw RandomNumberNotFound if the set is empty. + //! \details Ideally, the random integer created should be uniformly distributed + //! over {x | min \<= x \<= max and \p x is of rnType and x \% mod == equiv}. + //! However the actual distribution may not be uniform because sequential + //! search is used to find an appropriate number from a random starting + //! point. + //! \details May return (with very small probability) a pseudoprime when a prime + //! is requested and max \> lastSmallPrime*lastSmallPrime. \p lastSmallPrime + //! is declared in nbtheory.h. + bool Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType, const Integer &equiv=Zero(), const Integer &mod=One()); + + bool GenerateRandomNoThrow(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs); + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs) + { + if (!GenerateRandomNoThrow(rng, params)) + throw RandomNumberNotFound(); + } + + //! \brief Set the n-th bit to value + //! \details 0-based numbering. + void SetBit(size_t n, bool value=1); + + //! \brief Set the n-th byte to value + //! \details 0-based numbering. + void SetByte(size_t n, byte value); + + //! \brief Reverse the Sign of the Integer + void Negate(); + + //! \brief Sets the Integer to positive + void SetPositive() {sign = POSITIVE;} + + //! \brief Sets the Integer to negative + void SetNegative() {if (!!(*this)) sign = NEGATIVE;} + + //! \brief Swaps this Integer with another Integer + void swap(Integer &a); + //@} + + //! \name UNARY OPERATORS + //@{ + //! + bool operator!() const; + //! + Integer operator+() const {return *this;} + //! + Integer operator-() const; + //! + Integer& operator++(); + //! + Integer& operator--(); + //! + Integer operator++(int) {Integer temp = *this; ++*this; return temp;} + //! + Integer operator--(int) {Integer temp = *this; --*this; return temp;} + //@} + + //! \name BINARY OPERATORS + //@{ + //! \brief Perform signed comparison + //! \param a the Integer to comapre + //! \retval -1 if *this < a + //! \retval 0 if *this = a + //! \retval 1 if *this > a + int Compare(const Integer& a) const; + + //! + Integer Plus(const Integer &b) const; + //! + Integer Minus(const Integer &b) const; + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer Times(const Integer &b) const; + //! + Integer DividedBy(const Integer &b) const; + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer Modulo(const Integer &b) const; + //! + Integer DividedBy(word b) const; + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + word Modulo(word b) const; + + //! + Integer operator>>(size_t n) const {return Integer(*this)>>=n;} + //! + Integer operator<<(size_t n) const {return Integer(*this)<<=n;} + //@} + + //! \name OTHER ARITHMETIC FUNCTIONS + //@{ + //! + Integer AbsoluteValue() const; + //! + Integer Doubled() const {return Plus(*this);} + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer Squared() const {return Times(*this);} + //! extract square root, if negative return 0, else return floor of square root + Integer SquareRoot() const; + //! return whether this integer is a perfect square + bool IsSquare() const; + + //! is 1 or -1 + bool IsUnit() const; + //! return inverse if 1 or -1, otherwise return 0 + Integer MultiplicativeInverse() const; + + //! calculate r and q such that (a == d*q + r) && (0 <= r < abs(d)) + static void CRYPTOPP_API Divide(Integer &r, Integer &q, const Integer &a, const Integer &d); + //! use a faster division algorithm when divisor is short + static void CRYPTOPP_API Divide(word &r, Integer &q, const Integer &a, word d); + + //! returns same result as Divide(r, q, a, Power2(n)), but faster + static void CRYPTOPP_API DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, unsigned int n); + + //! greatest common divisor + static Integer CRYPTOPP_API Gcd(const Integer &a, const Integer &n); + //! calculate multiplicative inverse of *this mod n + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + Integer InverseMod(const Integer &n) const; + //! + //! \sa a_times_b_mod_c() and a_exp_b_mod_c() + word InverseMod(word n) const; + //@} + + //! \name INPUT/OUTPUT + //@{ + //! \brief Extraction operator + //! \param in a reference to a std::istream + //! \param a a reference to an Integer + //! \returns a reference to a std::istream reference + friend CRYPTOPP_DLL std::istream& CRYPTOPP_API operator>>(std::istream& in, Integer &a); + //! + //! \brief Insertion operator + //! \param out a reference to a std::ostream + //! \param a a constant reference to an Integer + //! \returns a reference to a std::ostream reference + //! \details The output integer responds to std::hex, std::oct, std::hex, std::upper and + //! std::lower. The output includes the suffix \a \b h (for hex), \a \b . (\a \b dot, for dec) + //! and \a \b o (for octal). There is currently no way to supress the suffix. + //! \details If you want to print an Integer without the suffix or using an arbitrary base, then + //! use IntToString(). + //! \sa IntToString + friend CRYPTOPP_DLL std::ostream& CRYPTOPP_API operator<<(std::ostream& out, const Integer &a); + //@} + +#ifndef CRYPTOPP_DOXYGEN_PROCESSING + //! modular multiplication + CRYPTOPP_DLL friend Integer CRYPTOPP_API a_times_b_mod_c(const Integer &x, const Integer& y, const Integer& m); + //! modular exponentiation + CRYPTOPP_DLL friend Integer CRYPTOPP_API a_exp_b_mod_c(const Integer &x, const Integer& e, const Integer& m); +#endif + +private: + + Integer(word value, size_t length); + int PositiveCompare(const Integer &t) const; + + IntegerSecBlock reg; + Sign sign; + +#ifndef CRYPTOPP_DOXYGEN_PROCESSING + friend class ModularArithmetic; + friend class MontgomeryRepresentation; + friend class HalfMontgomeryRepresentation; + + friend void PositiveAdd(Integer &sum, const Integer &a, const Integer &b); + friend void PositiveSubtract(Integer &diff, const Integer &a, const Integer &b); + friend void PositiveMultiply(Integer &product, const Integer &a, const Integer &b); + friend void PositiveDivide(Integer &remainder, Integer "ient, const Integer ÷nd, const Integer &divisor); +#endif +}; + +//! +inline bool operator==(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)==0;} +//! +inline bool operator!=(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)!=0;} +//! +inline bool operator> (const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)> 0;} +//! +inline bool operator>=(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)>=0;} +//! +inline bool operator< (const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)< 0;} +//! +inline bool operator<=(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)<=0;} +//! +inline CryptoPP::Integer operator+(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Plus(b);} +//! +inline CryptoPP::Integer operator-(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Minus(b);} +//! +//! \sa a_times_b_mod_c() and a_exp_b_mod_c() +inline CryptoPP::Integer operator*(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Times(b);} +//! +inline CryptoPP::Integer operator/(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.DividedBy(b);} +//! +//! \sa a_times_b_mod_c() and a_exp_b_mod_c() +inline CryptoPP::Integer operator%(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Modulo(b);} +//! +inline CryptoPP::Integer operator/(const CryptoPP::Integer &a, CryptoPP::word b) {return a.DividedBy(b);} +//! +//! \sa a_times_b_mod_c() and a_exp_b_mod_c() +inline CryptoPP::word operator%(const CryptoPP::Integer &a, CryptoPP::word b) {return a.Modulo(b);} + +NAMESPACE_END + +#ifndef __BORLANDC__ +NAMESPACE_BEGIN(std) +inline void swap(CryptoPP::Integer &a, CryptoPP::Integer &b) +{ + a.swap(b); +} +NAMESPACE_END +#endif + +#endif diff --git a/external/crypto++-5.6.3/iterhash.cpp b/external/crypto++-5.6.3/iterhash.cpp new file mode 100644 index 000000000..9116bc515 --- /dev/null +++ b/external/crypto++-5.6.3/iterhash.cpp @@ -0,0 +1,162 @@ +// iterhash.cpp - written and placed in the public domain by Wei Dai + +#ifndef __GNUC__ +#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#endif + +#include "iterhash.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +template void IteratedHashBase::Update(const byte *input, size_t len) +{ + HashWordType oldCountLo = m_countLo, oldCountHi = m_countHi; + if ((m_countLo = oldCountLo + HashWordType(len)) < oldCountLo) + m_countHi++; // carry from low to high + m_countHi += (HashWordType)SafeRightShift<8*sizeof(HashWordType)>(len); + if (m_countHi < oldCountHi || SafeRightShift<2*8*sizeof(HashWordType)>(len) != 0) + throw HashInputTooLong(this->AlgorithmName()); + + const unsigned int blockSize = this->BlockSize(); + unsigned int num = ModPowerOf2(oldCountLo, blockSize); + + T* dataBuf = this->DataBuf(); + byte* data = (byte *)dataBuf; + assert(dataBuf && data); + + if (num != 0) // process left over data + { + if (num+len >= blockSize) + { + if (data && input) {memcpy(data+num, input, blockSize-num);} + HashBlock(dataBuf); + input += (blockSize-num); + len -= (blockSize-num); + num = 0; + // drop through and do the rest + } + else + { + if (data && input && len) {memcpy(data+num, input, len);} + return; + } + } + + // now process the input data in blocks of blockSize bytes and save the leftovers to m_data + if (len >= blockSize) + { + if (input == data) + { + assert(len == blockSize); + HashBlock(dataBuf); + return; + } + else if (IsAligned(input)) + { + size_t leftOver = HashMultipleBlocks((T *)input, len); + input += (len - leftOver); + len = leftOver; + } + else + do + { // copy input first if it's not aligned correctly + if (data && input) memcpy(data, input, blockSize); + HashBlock(dataBuf); + input+=blockSize; + len-=blockSize; + } while (len >= blockSize); + } + + if (data && input && len && data != input) + memcpy(data, input, len); +} + +template byte * IteratedHashBase::CreateUpdateSpace(size_t &size) +{ + unsigned int blockSize = this->BlockSize(); + unsigned int num = ModPowerOf2(m_countLo, blockSize); + size = blockSize - num; + return (byte *)DataBuf() + num; +} + +template size_t IteratedHashBase::HashMultipleBlocks(const T *input, size_t length) +{ + unsigned int blockSize = this->BlockSize(); + bool noReverse = NativeByteOrderIs(this->GetByteOrder()); + T* dataBuf = this->DataBuf(); + do + { + if (noReverse) + this->HashEndianCorrectedBlock(input); + else + { + ByteReverse(dataBuf, input, this->BlockSize()); + this->HashEndianCorrectedBlock(dataBuf); + } + + input += blockSize/sizeof(T); + length -= blockSize; + } + while (length >= blockSize); + return length; +} + +template void IteratedHashBase::PadLastBlock(unsigned int lastBlockSize, byte padFirst) +{ + unsigned int blockSize = this->BlockSize(); + unsigned int num = ModPowerOf2(m_countLo, blockSize); + T* dataBuf = this->DataBuf(); + byte* data = (byte *)dataBuf; + data[num++] = padFirst; + if (num <= lastBlockSize) + memset(data+num, 0, lastBlockSize-num); + else + { + memset(data+num, 0, blockSize-num); + HashBlock(dataBuf); + memset(data, 0, lastBlockSize); + } +} + +template void IteratedHashBase::Restart() +{ + m_countLo = m_countHi = 0; + Init(); +} + +template void IteratedHashBase::TruncatedFinal(byte *digest, size_t size) +{ + this->ThrowIfInvalidTruncatedSize(size); + + T* dataBuf = this->DataBuf(); + T* stateBuf = this->StateBuf(); + unsigned int blockSize = this->BlockSize(); + ByteOrder order = this->GetByteOrder(); + + PadLastBlock(blockSize - 2*sizeof(HashWordType)); + dataBuf[blockSize/sizeof(T)-2+order] = ConditionalByteReverse(order, this->GetBitCountLo()); + dataBuf[blockSize/sizeof(T)-1-order] = ConditionalByteReverse(order, this->GetBitCountHi()); + + HashBlock(dataBuf); + + if (IsAligned(digest) && size%sizeof(HashWordType)==0) + ConditionalByteReverse(order, (HashWordType *)digest, stateBuf, size); + else + { + ConditionalByteReverse(order, stateBuf, stateBuf, this->DigestSize()); + memcpy(digest, stateBuf, size); + } + + this->Restart(); // reinit for next use +} + +#ifdef __GNUC__ + template class IteratedHashBase; + template class IteratedHashBase; + + template class IteratedHashBase; + template class IteratedHashBase; +#endif + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/iterhash.h b/external/crypto++-5.6.3/iterhash.h new file mode 100644 index 000000000..cce9e8211 --- /dev/null +++ b/external/crypto++-5.6.3/iterhash.h @@ -0,0 +1,106 @@ +#ifndef CRYPTOPP_ITERHASH_H +#define CRYPTOPP_ITERHASH_H + +#include "cryptlib.h" +#include "secblock.h" +#include "misc.h" +#include "simple.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! exception thrown when trying to hash more data than is allowed by a hash function +class CRYPTOPP_DLL HashInputTooLong : public InvalidDataFormat +{ +public: + explicit HashInputTooLong(const std::string &alg) + : InvalidDataFormat("IteratedHashBase: input data exceeds maximum allowed by hash function " + alg) {} +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE IteratedHashBase : public BASE +{ +public: + typedef T HashWordType; + + IteratedHashBase() : m_countLo(0), m_countHi(0) {} + unsigned int OptimalBlockSize() const {return this->BlockSize();} + unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} + void Update(const byte *input, size_t length); + byte * CreateUpdateSpace(size_t &size); + void Restart(); + void TruncatedFinal(byte *digest, size_t size); + +protected: + inline T GetBitCountHi() const {return (m_countLo >> (8*sizeof(T)-3)) + (m_countHi << 3);} + inline T GetBitCountLo() const {return m_countLo << 3;} + + void PadLastBlock(unsigned int lastBlockSize, byte padFirst=0x80); + virtual void Init() =0; + + virtual ByteOrder GetByteOrder() const =0; + virtual void HashEndianCorrectedBlock(const HashWordType *data) =0; + virtual size_t HashMultipleBlocks(const T *input, size_t length); + void HashBlock(const HashWordType *input) {HashMultipleBlocks(input, this->BlockSize());} + + virtual T* DataBuf() =0; + virtual T* StateBuf() =0; + +private: + T m_countLo, m_countHi; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE IteratedHash : public IteratedHashBase +{ +public: + typedef T_Endianness ByteOrderClass; + typedef T_HashWordType HashWordType; + + CRYPTOPP_CONSTANT(BLOCKSIZE = T_BlockSize) + // BCB2006 workaround: can't use BLOCKSIZE here + CRYPTOPP_COMPILE_ASSERT((T_BlockSize & (T_BlockSize - 1)) == 0); // blockSize is a power of 2 + unsigned int BlockSize() const {return T_BlockSize;} + + ByteOrder GetByteOrder() const {return T_Endianness::ToEnum();} + + inline static void CorrectEndianess(HashWordType *out, const HashWordType *in, size_t byteCount) + { + ConditionalByteReverse(T_Endianness::ToEnum(), out, in, byteCount); + } + +protected: + T_HashWordType* DataBuf() {return this->m_data;} + FixedSizeSecBlock m_data; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE IteratedHashWithStaticTransform + : public ClonableImpl, T_Transform> > +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = T_DigestSize ? T_DigestSize : T_StateSize) + unsigned int DigestSize() const {return DIGESTSIZE;}; + +protected: + IteratedHashWithStaticTransform() {this->Init();} + void HashEndianCorrectedBlock(const T_HashWordType *data) {T_Transform::Transform(this->m_state, data);} + void Init() {T_Transform::InitState(this->m_state);} + + T_HashWordType* StateBuf() {return this->m_state;} + FixedSizeAlignedSecBlock m_state; +}; + +#ifndef __GNUC__ + CRYPTOPP_DLL_TEMPLATE_CLASS IteratedHashBase; + CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase; + + CRYPTOPP_DLL_TEMPLATE_CLASS IteratedHashBase; + CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase; +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/lubyrack.h b/external/crypto++-5.6.3/lubyrack.h new file mode 100644 index 000000000..d69587a3c --- /dev/null +++ b/external/crypto++-5.6.3/lubyrack.h @@ -0,0 +1,142 @@ +// lubyrack.h - written and placed in the public domain by Wei Dai + +//! \file lubyrack.h +//! \brief Classes for the Luby-Rackoff block cipher + +#ifndef CRYPTOPP_LUBYRACK_H +#define CRYPTOPP_LUBYRACK_H + +#include "simple.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +template struct DigestSizeDoubleWorkaround // VC60 workaround +{ + CRYPTOPP_CONSTANT(RESULT = 2*T::DIGESTSIZE) +}; + +//! algorithm info +template +struct LR_Info : public VariableKeyLength<16, 0, 2*(INT_MAX/2), 2>, public FixedBlockSize::RESULT> +{ + static std::string StaticAlgorithmName() {return std::string("LR/")+T::StaticAlgorithmName();} +}; + +//! Luby-Rackoff +template +class LR : public LR_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl > + { + public: + // VC60 workaround: have to define these functions within class definition + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) + { + this->AssertValidKeyLength(length); + + L = length/2; + buffer.New(2*S); + digest.New(S); + key.Assign(userKey, 2*L); + } + + protected: + CRYPTOPP_CONSTANT(S=T::DIGESTSIZE) + unsigned int L; // key length / 2 + SecByteBlock key; + + mutable T hm; + mutable SecByteBlock buffer, digest; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + +#define KL this->key +#define KR this->key+this->L +#define BL this->buffer +#define BR this->buffer+this->S +#define IL inBlock +#define IR inBlock+this->S +#define OL outBlock +#define OR outBlock+this->S + + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const + { + this->hm.Update(KL, this->L); + this->hm.Update(IL, this->S); + this->hm.Final(BR); + xorbuf(BR, IR, this->S); + + this->hm.Update(KR, this->L); + this->hm.Update(BR, this->S); + this->hm.Final(BL); + xorbuf(BL, IL, this->S); + + this->hm.Update(KL, this->L); + this->hm.Update(BL, this->S); + this->hm.Final(this->digest); + xorbuf(BR, this->digest, this->S); + + this->hm.Update(KR, this->L); + this->hm.Update(OR, this->S); + this->hm.Final(this->digest); + xorbuf(BL, this->digest, this->S); + + if (xorBlock) + xorbuf(outBlock, xorBlock, this->buffer, 2*this->S); + else + memcpy_s(outBlock, 2*this->S, this->buffer, 2*this->S); + } + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const + { + this->hm.Update(KR, this->L); + this->hm.Update(IR, this->S); + this->hm.Final(BL); + xorbuf(BL, IL, this->S); + + this->hm.Update(KL, this->L); + this->hm.Update(BL, this->S); + this->hm.Final(BR); + xorbuf(BR, IR, this->S); + + this->hm.Update(KR, this->L); + this->hm.Update(BR, this->S); + this->hm.Final(this->digest); + xorbuf(BL, this->digest, this->S); + + this->hm.Update(KL, this->L); + this->hm.Update(OL, this->S); + this->hm.Final(this->digest); + xorbuf(BR, this->digest, this->S); + + if (xorBlock) + xorbuf(outBlock, xorBlock, this->buffer, 2*this->S); + else + memcpy(outBlock, this->buffer, 2*this->S); + } +#undef KL +#undef KR +#undef BL +#undef BR +#undef IL +#undef IR +#undef OL +#undef OR + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/luc.cpp b/external/crypto++-5.6.3/luc.cpp new file mode 100644 index 000000000..27001be0b --- /dev/null +++ b/external/crypto++-5.6.3/luc.cpp @@ -0,0 +1,215 @@ +// luc.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "luc.h" +#include "asn.h" +#include "sha.h" +#include "integer.h" +#include "nbtheory.h" +#include "algparam.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void LUC_TestInstantiations() +{ + LUC_HMP::Signer t1; + LUCFunction t2; + InvertibleLUCFunction t3; +} +#endif + +void DL_Algorithm_LUC_HMP::Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const +{ + const Integer &q = params.GetSubgroupOrder(); + r = params.ExponentiateBase(k); + s = (k + x*(r+e)) % q; +} + +bool DL_Algorithm_LUC_HMP::Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const +{ + const Integer p = params.GetGroupOrder()-1; + const Integer &q = params.GetSubgroupOrder(); + + Integer Vsg = params.ExponentiateBase(s); + Integer Vry = publicKey.ExponentiatePublicElement((r+e)%q); + return (Vsg*Vsg + Vry*Vry + r*r) % p == (Vsg * Vry * r + 4) % p; +} + +Integer DL_BasePrecomputation_LUC::Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const +{ + return Lucas(exponent, m_g, static_cast(group).GetModulus()); +} + +void DL_GroupParameters_LUC::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const +{ + for (unsigned int i=0; i Integer::One() && m_n.IsOdd(); + pass = pass && m_e > Integer::One() && m_e.IsOdd() && m_e < m_n; + return pass; +} + +bool LUCFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_GET_FUNCTION_ENTRY(PublicExponent) + ; +} + +void LUCFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_SET_FUNCTION_ENTRY(PublicExponent) + ; +} + +// ***************************************************************************** +// private key operations: + +class LUCPrimeSelector : public PrimeSelector +{ +public: + LUCPrimeSelector(const Integer &e) : m_e(e) {} + bool IsAcceptable(const Integer &candidate) const + { + return RelativelyPrime(m_e, candidate+1) && RelativelyPrime(m_e, candidate-1); + } + Integer m_e; +}; + +void InvertibleLUCFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + int modulusSize = 2048; + alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); + + if (modulusSize < 16) + throw InvalidArgument("InvertibleLUCFunction: specified modulus size is too small"); + + m_e = alg.GetValueWithDefault("PublicExponent", Integer(17)); + + if (m_e < 5 || m_e.IsEven()) + throw InvalidArgument("InvertibleLUCFunction: invalid public exponent"); + + LUCPrimeSelector selector(m_e); + AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) + ("PointerToPrimeSelector", selector.GetSelectorPointer()); + m_p.GenerateRandom(rng, primeParam); + m_q.GenerateRandom(rng, primeParam); + + m_n = m_p * m_q; + m_u = m_q.InverseMod(m_p); +} + +void InvertibleLUCFunction::Initialize(RandomNumberGenerator &rng, unsigned int keybits, const Integer &e) +{ + GenerateRandom(rng, MakeParameters("ModulusSize", (int)keybits)("PublicExponent", e)); +} + +void InvertibleLUCFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + + Integer version(seq); + if (!!version) // make sure version is 0 + BERDecodeError(); + + m_n.BERDecode(seq); + m_e.BERDecode(seq); + m_p.BERDecode(seq); + m_q.BERDecode(seq); + m_u.BERDecode(seq); + seq.MessageEnd(); +} + +void InvertibleLUCFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + + const byte version[] = {INTEGER, 1, 0}; + seq.Put(version, sizeof(version)); + m_n.DEREncode(seq); + m_e.DEREncode(seq); + m_p.DEREncode(seq); + m_q.DEREncode(seq); + m_u.DEREncode(seq); + seq.MessageEnd(); +} + +Integer InvertibleLUCFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const +{ + // not clear how to do blinding with LUC + CRYPTOPP_UNUSED(rng); + DoQuickSanityCheck(); + return InverseLucas(m_e, x, m_q, m_p, m_u); +} + +bool InvertibleLUCFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = LUCFunction::Validate(rng, level); + pass = pass && m_p > Integer::One() && m_p.IsOdd() && m_p < m_n; + pass = pass && m_q > Integer::One() && m_q.IsOdd() && m_q < m_n; + pass = pass && m_u.IsPositive() && m_u < m_p; + if (level >= 1) + { + pass = pass && m_p * m_q == m_n; + pass = pass && RelativelyPrime(m_e, m_p+1); + pass = pass && RelativelyPrime(m_e, m_p-1); + pass = pass && RelativelyPrime(m_e, m_q+1); + pass = pass && RelativelyPrime(m_e, m_q-1); + pass = pass && m_u * m_q % m_p == 1; + } + if (level >= 2) + pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); + return pass; +} + +bool InvertibleLUCFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +void InvertibleLUCFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/luc.h b/external/crypto++-5.6.3/luc.h new file mode 100644 index 000000000..c2a6893c3 --- /dev/null +++ b/external/crypto++-5.6.3/luc.h @@ -0,0 +1,305 @@ +#ifndef CRYPTOPP_LUC_H +#define CRYPTOPP_LUC_H + +/** \file +*/ + +#include "cryptlib.h" +#include "gfpcrypt.h" +#include "integer.h" +#include "secblock.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4127 4189) +#endif + +#include "pkcspad.h" +#include "integer.h" +#include "oaep.h" +#include "dh.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! The LUC function. +/*! This class is here for historical and pedagogical interest. It has no + practical advantages over other trapdoor functions and probably shouldn't + be used in production software. The discrete log based LUC schemes + defined later in this .h file may be of more practical interest. +*/ +class LUCFunction : public TrapdoorFunction, public PublicKey +{ + typedef LUCFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &e) + {m_n = n; m_e = e;} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + Integer ApplyFunction(const Integer &x) const; + Integer PreimageBound() const {return m_n;} + Integer ImageBound() const {return m_n;} + + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // non-derived interface + const Integer & GetModulus() const {return m_n;} + const Integer & GetPublicExponent() const {return m_e;} + + void SetModulus(const Integer &n) {m_n = n;} + void SetPublicExponent(const Integer &e) {m_e = e;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~LUCFunction() {} +#endif + +protected: + Integer m_n, m_e; +}; + +//! _ +class InvertibleLUCFunction : public LUCFunction, public TrapdoorFunctionInverse, public PrivateKey +{ + typedef InvertibleLUCFunction ThisClass; + +public: + void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits, const Integer &eStart=17); + void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q, const Integer &u) + {m_n = n; m_e = e; m_p = p; m_q = q; m_u = u;} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; + + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + /*! parameters: (ModulusSize, PublicExponent (default 17)) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + // non-derived interface + const Integer& GetPrime1() const {return m_p;} + const Integer& GetPrime2() const {return m_q;} + const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} + + void SetPrime1(const Integer &p) {m_p = p;} + void SetPrime2(const Integer &q) {m_q = q;} + void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~InvertibleLUCFunction() {} +#endif + +protected: + Integer m_p, m_q, m_u; +}; + +struct LUC +{ + static std::string StaticAlgorithmName() {return "LUC";} + typedef LUCFunction PublicKey; + typedef InvertibleLUCFunction PrivateKey; +}; + +//! LUC cryptosystem +template +struct LUCES : public TF_ES +{ +}; + +//! LUC signature scheme with appendix +template +struct LUCSS : public TF_SS +{ +}; + +// analagous to the RSA schemes defined in PKCS #1 v2.0 +typedef LUCES >::Decryptor LUCES_OAEP_SHA_Decryptor; +typedef LUCES >::Encryptor LUCES_OAEP_SHA_Encryptor; + +typedef LUCSS::Signer LUCSSA_PKCS1v15_SHA_Signer; +typedef LUCSS::Verifier LUCSSA_PKCS1v15_SHA_Verifier; + +// ******************************************************** + +// no actual precomputation +class DL_GroupPrecomputation_LUC : public DL_GroupPrecomputation +{ +public: + const AbstractGroup & GetGroup() const {assert(false); throw 0;} + Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} + void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} + + // non-inherited + void SetModulus(const Integer &v) {m_p = v;} + const Integer & GetModulus() const {return m_p;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupPrecomputation_LUC() {} +#endif + +private: + Integer m_p; +}; + +//! _ +class DL_BasePrecomputation_LUC : public DL_FixedBasePrecomputation +{ +public: + // DL_FixedBasePrecomputation + bool IsInitialized() const {return m_g.NotZero();} + void SetBase(const DL_GroupPrecomputation &group, const Integer &base) + {CRYPTOPP_UNUSED(group); m_g = base;} + const Integer & GetBase(const DL_GroupPrecomputation &group) const + {CRYPTOPP_UNUSED(group); return m_g;} + void Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage) + {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(maxExpBits); CRYPTOPP_UNUSED(storage);} + void Load(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) + {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);} + void Save(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) const + {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);} + Integer Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const; + Integer CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const + { + CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(exponent); CRYPTOPP_UNUSED(pc2); CRYPTOPP_UNUSED(exponent2); + // shouldn't be called + throw NotImplemented("DL_BasePrecomputation_LUC: CascadeExponentiate not implemented"); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_BasePrecomputation_LUC() {} +#endif + +private: + Integer m_g; +}; + +//! _ +class DL_GroupParameters_LUC : public DL_GroupParameters_IntegerBasedImpl +{ +public: + // DL_GroupParameters + bool IsIdentity(const Integer &element) const {return element == Integer::Two();} + void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; + Element MultiplyElements(const Element &a, const Element &b) const + { + CRYPTOPP_UNUSED(a); CRYPTOPP_UNUSED(b); + throw NotImplemented("LUC_GroupParameters: MultiplyElements can not be implemented"); + } + Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const + { + CRYPTOPP_UNUSED(element1); CRYPTOPP_UNUSED(exponent1); CRYPTOPP_UNUSED(element2); CRYPTOPP_UNUSED(exponent2); + throw NotImplemented("LUC_GroupParameters: MultiplyElements can not be implemented"); + } + + // NameValuePairs interface + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper(this, name, valueType, pValue).Assignable(); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_LUC() {} +#endif + +private: + int GetFieldType() const {return 2;} +}; + +//! _ +class DL_GroupParameters_LUC_DefaultSafePrime : public DL_GroupParameters_LUC +{ +public: + typedef NoCofactorMultiplication DefaultCofactorOption; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters_LUC_DefaultSafePrime() {} +#endif + +protected: + unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;} +}; + +//! _ +class DL_Algorithm_LUC_HMP : public DL_ElgamalLikeSignatureAlgorithm +{ +public: + static const char * StaticAlgorithmName() {return "LUC-HMP";} + + void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const; + bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const; + + size_t RLen(const DL_GroupParameters ¶ms) const + {return params.GetGroupOrder().ByteCount();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Algorithm_LUC_HMP() {} +#endif +}; + +//! _ +struct DL_SignatureKeys_LUC +{ + typedef DL_GroupParameters_LUC GroupParameters; + typedef DL_PublicKey_GFP PublicKey; + typedef DL_PrivateKey_GFP PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_SignatureKeys_LUC() {} +#endif +}; + +//! LUC-HMP, based on "Digital signature schemes based on Lucas functions" by Patrick Horster, Markus Michels, Holger Petersen +template +struct LUC_HMP : public DL_SS +{ +}; + +//! _ +struct DL_CryptoKeys_LUC +{ + typedef DL_GroupParameters_LUC_DefaultSafePrime GroupParameters; + typedef DL_PublicKey_GFP PublicKey; + typedef DL_PrivateKey_GFP PrivateKey; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_CryptoKeys_LUC() {} +#endif +}; + +//! LUC-IES +template +struct LUC_IES + : public DL_ES< + DL_CryptoKeys_LUC, + DL_KeyAgreementAlgorithm_DH, + DL_KeyDerivationAlgorithm_P1363 >, + DL_EncryptionAlgorithm_Xor, DHAES_MODE>, + LUC_IES<> > +{ + static std::string StaticAlgorithmName() {return "LUC-IES";} // non-standard name + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~LUC_IES() {} +#endif +}; + +// ******************************************************** + +//! LUC-DH +typedef DH_Domain LUC_DH; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/mars.cpp b/external/crypto++-5.6.3/mars.cpp new file mode 100644 index 000000000..fe9b1186a --- /dev/null +++ b/external/crypto++-5.6.3/mars.cpp @@ -0,0 +1,154 @@ +// mars.cpp - written and placed in the public domain by Wei Dai + +// includes IBM's key setup "tweak" proposed in August 1999 (http://www.research.ibm.com/security/key-setup.txt) + +#include "pch.h" +#include "mars.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +void MARS::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + // Initialize T[] with the key data + FixedSizeSecBlock T; + GetUserKey(LITTLE_ENDIAN_ORDER, T.begin(), 15, userKey, length); + T[length/4] = length/4; + + for (unsigned int j=0; j<4; j++) // compute 10 words of K[] in each iteration + { + unsigned int i; + // Do linear transformation + for (i=0; i<15; i++) + T[i] = T[i] ^ rotlFixed(T[(i+8)%15] ^ T[(i+13)%15], 3) ^ (4*i+j); + + // Do four rounds of stirring + for (unsigned int k=0; k<4; k++) + for (i=0; i<15; i++) + T[i] = rotlFixed(T[i] + Sbox[T[(i+14)%15]%512], 9); + + // Store next 10 key words into K[] + for (i=0; i<10; i++) + m_k[10*j+i] = T[4*i%15]; + } + + // Modify multiplication key-words + for(unsigned int i = 5; i < 37; i += 2) + { + word32 m, w = m_k[i] | 3; + m = (~w ^ (w<<1)) & (~w ^ (w>>1)) & 0x7ffffffe; + m &= m>>1; m &= m>>2; m &= m>>4; + m |= m<<1; m |= m<<2; m |= m<<4; + m &= 0x7ffffffc; + w ^= rotlMod(Sbox[265 + (m_k[i] & 3)], m_k[i-1]) & m; + m_k[i] = w; + } +} + +#define S(a) Sbox[(a)&0x1ff] +#define S0(a) Sbox[(a)&0xff] +#define S1(a) Sbox[((a)&0xff) + 256] + +typedef BlockGetAndPut Block; + +void MARS::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + unsigned int i; + word32 a, b, c, d, l, m, r, t; + const word32 *k = m_k; + + Block::Get(inBlock)(a)(b)(c)(d); + + a += k[0]; b += k[1]; c += k[2]; d += k[3]; + + for (i=0; i<8; i++) + { + b = (b ^ S0(a)) + S1(a>>8); + c += S0(a>>16); + a = rotrFixed(a, 24); + d ^= S1(a); + a += (i%4==0) ? d : 0; + a += (i%4==1) ? b : 0; + t = a; a = b; b = c; c = d; d = t; + } + + for (i=0; i<16; i++) + { + t = rotlFixed(a, 13); + r = rotlFixed(t * k[2*i+5], 10); + m = a + k[2*i+4]; + l = rotlMod((S(m) ^ rotrFixed(r, 5) ^ r), r); + c += rotlMod(m, rotrFixed(r, 5)); + (i<8 ? b : d) += l; + (i<8 ? d : b) ^= r; + a = b; b = c; c = d; d = t; + } + + for (i=0; i<8; i++) + { + a -= (i%4==2) ? d : 0; + a -= (i%4==3) ? b : 0; + b ^= S1(a); + c -= S0(a>>24); + t = rotlFixed(a, 24); + d = (d - S1(a>>16)) ^ S0(t); + a = b; b = c; c = d; d = t; + } + + a -= k[36]; b -= k[37]; c -= k[38]; d -= k[39]; + + Block::Put(xorBlock, outBlock)(a)(b)(c)(d); +} + +void MARS::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + unsigned int i; + word32 a, b, c, d, l, m, r, t; + const word32 *k = m_k; + + Block::Get(inBlock)(d)(c)(b)(a); + + d += k[36]; c += k[37]; b += k[38]; a += k[39]; + + for (i=0; i<8; i++) + { + b = (b ^ S0(a)) + S1(a>>8); + c += S0(a>>16); + a = rotrFixed(a, 24); + d ^= S1(a); + a += (i%4==0) ? d : 0; + a += (i%4==1) ? b : 0; + t = a; a = b; b = c; c = d; d = t; + } + + for (i=0; i<16; i++) + { + t = rotrFixed(a, 13); + r = rotlFixed(a * k[35-2*i], 10); + m = t + k[34-2*i]; + l = rotlMod((S(m) ^ rotrFixed(r, 5) ^ r), r); + c -= rotlMod(m, rotrFixed(r, 5)); + (i<8 ? b : d) -= l; + (i<8 ? d : b) ^= r; + a = b; b = c; c = d; d = t; + } + + for (i=0; i<8; i++) + { + a -= (i%4==2) ? d : 0; + a -= (i%4==3) ? b : 0; + b ^= S1(a); + c -= S0(a>>24); + t = rotlFixed(a, 24); + d = (d - S1(a>>16)) ^ S0(t); + a = b; b = c; c = d; d = t; + } + + d -= k[0]; c -= k[1]; b -= k[2]; a -= k[3]; + + Block::Put(xorBlock, outBlock)(d)(c)(b)(a); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/mars.h b/external/crypto++-5.6.3/mars.h new file mode 100644 index 000000000..97fe893b9 --- /dev/null +++ b/external/crypto++-5.6.3/mars.h @@ -0,0 +1,56 @@ +// mars.h - written and placed in the public domain by Wei Dai + +//! \file mars.h +//! \brief Classes for the MARS block cipher (IBM AES submission) + +#ifndef CRYPTOPP_MARS_H +#define CRYPTOPP_MARS_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4> +{ + static const char *StaticAlgorithmName() {return "MARS";} +}; + +/// MARS +class MARS : public MARS_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + static const word32 Sbox[512]; + + FixedSizeSecBlock m_k; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef MARS::Encryption MARSEncryption; +typedef MARS::Decryption MARSDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/marss.cpp b/external/crypto++-5.6.3/marss.cpp new file mode 100644 index 000000000..db1d51bf8 --- /dev/null +++ b/external/crypto++-5.6.3/marss.cpp @@ -0,0 +1,140 @@ +// MARS S-Box + +#include "pch.h" +#include "mars.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +const word32 MARS::Base::Sbox[512] = { + 0x09d0c479, 0x28c8ffe0, 0x84aa6c39, 0x9dad7287, + 0x7dff9be3, 0xd4268361, 0xc96da1d4, 0x7974cc93, + 0x85d0582e, 0x2a4b5705, 0x1ca16a62, 0xc3bd279d, + 0x0f1f25e5, 0x5160372f, 0xc695c1fb, 0x4d7ff1e4, + 0xae5f6bf4, 0x0d72ee46, 0xff23de8a, 0xb1cf8e83, + 0xf14902e2, 0x3e981e42, 0x8bf53eb6, 0x7f4bf8ac, + 0x83631f83, 0x25970205, 0x76afe784, 0x3a7931d4, + 0x4f846450, 0x5c64c3f6, 0x210a5f18, 0xc6986a26, + 0x28f4e826, 0x3a60a81c, 0xd340a664, 0x7ea820c4, + 0x526687c5, 0x7eddd12b, 0x32a11d1d, 0x9c9ef086, + 0x80f6e831, 0xab6f04ad, 0x56fb9b53, 0x8b2e095c, + 0xb68556ae, 0xd2250b0d, 0x294a7721, 0xe21fb253, + 0xae136749, 0xe82aae86, 0x93365104, 0x99404a66, + 0x78a784dc, 0xb69ba84b, 0x04046793, 0x23db5c1e, + 0x46cae1d6, 0x2fe28134, 0x5a223942, 0x1863cd5b, + 0xc190c6e3, 0x07dfb846, 0x6eb88816, 0x2d0dcc4a, + 0xa4ccae59, 0x3798670d, 0xcbfa9493, 0x4f481d45, + 0xeafc8ca8, 0xdb1129d6, 0xb0449e20, 0x0f5407fb, + 0x6167d9a8, 0xd1f45763, 0x4daa96c3, 0x3bec5958, + 0xababa014, 0xb6ccd201, 0x38d6279f, 0x02682215, + 0x8f376cd5, 0x092c237e, 0xbfc56593, 0x32889d2c, + 0x854b3e95, 0x05bb9b43, 0x7dcd5dcd, 0xa02e926c, + 0xfae527e5, 0x36a1c330, 0x3412e1ae, 0xf257f462, + 0x3c4f1d71, 0x30a2e809, 0x68e5f551, 0x9c61ba44, + 0x5ded0ab8, 0x75ce09c8, 0x9654f93e, 0x698c0cca, + 0x243cb3e4, 0x2b062b97, 0x0f3b8d9e, 0x00e050df, + 0xfc5d6166, 0xe35f9288, 0xc079550d, 0x0591aee8, + 0x8e531e74, 0x75fe3578, 0x2f6d829a, 0xf60b21ae, + 0x95e8eb8d, 0x6699486b, 0x901d7d9b, 0xfd6d6e31, + 0x1090acef, 0xe0670dd8, 0xdab2e692, 0xcd6d4365, + 0xe5393514, 0x3af345f0, 0x6241fc4d, 0x460da3a3, + 0x7bcf3729, 0x8bf1d1e0, 0x14aac070, 0x1587ed55, + 0x3afd7d3e, 0xd2f29e01, 0x29a9d1f6, 0xefb10c53, + 0xcf3b870f, 0xb414935c, 0x664465ed, 0x024acac7, + 0x59a744c1, 0x1d2936a7, 0xdc580aa6, 0xcf574ca8, + 0x040a7a10, 0x6cd81807, 0x8a98be4c, 0xaccea063, + 0xc33e92b5, 0xd1e0e03d, 0xb322517e, 0x2092bd13, + 0x386b2c4a, 0x52e8dd58, 0x58656dfb, 0x50820371, + 0x41811896, 0xe337ef7e, 0xd39fb119, 0xc97f0df6, + 0x68fea01b, 0xa150a6e5, 0x55258962, 0xeb6ff41b, + 0xd7c9cd7a, 0xa619cd9e, 0xbcf09576, 0x2672c073, + 0xf003fb3c, 0x4ab7a50b, 0x1484126a, 0x487ba9b1, + 0xa64fc9c6, 0xf6957d49, 0x38b06a75, 0xdd805fcd, + 0x63d094cf, 0xf51c999e, 0x1aa4d343, 0xb8495294, + 0xce9f8e99, 0xbffcd770, 0xc7c275cc, 0x378453a7, + 0x7b21be33, 0x397f41bd, 0x4e94d131, 0x92cc1f98, + 0x5915ea51, 0x99f861b7, 0xc9980a88, 0x1d74fd5f, + 0xb0a495f8, 0x614deed0, 0xb5778eea, 0x5941792d, + 0xfa90c1f8, 0x33f824b4, 0xc4965372, 0x3ff6d550, + 0x4ca5fec0, 0x8630e964, 0x5b3fbbd6, 0x7da26a48, + 0xb203231a, 0x04297514, 0x2d639306, 0x2eb13149, + 0x16a45272, 0x532459a0, 0x8e5f4872, 0xf966c7d9, + 0x07128dc0, 0x0d44db62, 0xafc8d52d, 0x06316131, + 0xd838e7ce, 0x1bc41d00, 0x3a2e8c0f, 0xea83837e, + 0xb984737d, 0x13ba4891, 0xc4f8b949, 0xa6d6acb3, + 0xa215cdce, 0x8359838b, 0x6bd1aa31, 0xf579dd52, + 0x21b93f93, 0xf5176781, 0x187dfdde, 0xe94aeb76, + 0x2b38fd54, 0x431de1da, 0xab394825, 0x9ad3048f, + 0xdfea32aa, 0x659473e3, 0x623f7863, 0xf3346c59, + 0xab3ab685, 0x3346a90b, 0x6b56443e, 0xc6de01f8, + 0x8d421fc0, 0x9b0ed10c, 0x88f1a1e9, 0x54c1f029, + 0x7dead57b, 0x8d7ba426, 0x4cf5178a, 0x551a7cca, + 0x1a9a5f08, 0xfcd651b9, 0x25605182, 0xe11fc6c3, + 0xb6fd9676, 0x337b3027, 0xb7c8eb14, 0x9e5fd030, + 0x6b57e354, 0xad913cf7, 0x7e16688d, 0x58872a69, + 0x2c2fc7df, 0xe389ccc6, 0x30738df1, 0x0824a734, + 0xe1797a8b, 0xa4a8d57b, 0x5b5d193b, 0xc8a8309b, + 0x73f9a978, 0x73398d32, 0x0f59573e, 0xe9df2b03, + 0xe8a5b6c8, 0x848d0704, 0x98df93c2, 0x720a1dc3, + 0x684f259a, 0x943ba848, 0xa6370152, 0x863b5ea3, + 0xd17b978b, 0x6d9b58ef, 0x0a700dd4, 0xa73d36bf, + 0x8e6a0829, 0x8695bc14, 0xe35b3447, 0x933ac568, + 0x8894b022, 0x2f511c27, 0xddfbcc3c, 0x006662b6, + 0x117c83fe, 0x4e12b414, 0xc2bca766, 0x3a2fec10, + 0xf4562420, 0x55792e2a, 0x46f5d857, 0xceda25ce, + 0xc3601d3b, 0x6c00ab46, 0xefac9c28, 0xb3c35047, + 0x611dfee3, 0x257c3207, 0xfdd58482, 0x3b14d84f, + 0x23becb64, 0xa075f3a3, 0x088f8ead, 0x07adf158, + 0x7796943c, 0xfacabf3d, 0xc09730cd, 0xf7679969, + 0xda44e9ed, 0x2c854c12, 0x35935fa3, 0x2f057d9f, + 0x690624f8, 0x1cb0bafd, 0x7b0dbdc6, 0x810f23bb, + 0xfa929a1a, 0x6d969a17, 0x6742979b, 0x74ac7d05, + 0x010e65c4, 0x86a3d963, 0xf907b5a0, 0xd0042bd3, + 0x158d7d03, 0x287a8255, 0xbba8366f, 0x096edc33, + 0x21916a7b, 0x77b56b86, 0x951622f9, 0xa6c5e650, + 0x8cea17d1, 0xcd8c62bc, 0xa3d63433, 0x358a68fd, + 0x0f9b9d3c, 0xd6aa295b, 0xfe33384a, 0xc000738e, + 0xcd67eb2f, 0xe2eb6dc2, 0x97338b02, 0x06c9f246, + 0x419cf1ad, 0x2b83c045, 0x3723f18a, 0xcb5b3089, + 0x160bead7, 0x5d494656, 0x35f8a74b, 0x1e4e6c9e, + 0x000399bd, 0x67466880, 0xb4174831, 0xacf423b2, + 0xca815ab3, 0x5a6395e7, 0x302a67c5, 0x8bdb446b, + 0x108f8fa4, 0x10223eda, 0x92b8b48b, 0x7f38d0ee, + 0xab2701d4, 0x0262d415, 0xaf224a30, 0xb3d88aba, + 0xf8b2c3af, 0xdaf7ef70, 0xcc97d3b7, 0xe9614b6c, + 0x2baebff4, 0x70f687cf, 0x386c9156, 0xce092ee5, + 0x01e87da6, 0x6ce91e6a, 0xbb7bcc84, 0xc7922c20, + 0x9d3b71fd, 0x060e41c6, 0xd7590f15, 0x4e03bb47, + 0x183c198e, 0x63eeb240, 0x2ddbf49a, 0x6d5cba54, + 0x923750af, 0xf9e14236, 0x7838162b, 0x59726c72, + 0x81b66760, 0xbb2926c1, 0x48a0ce0d, 0xa6c0496d, + 0xad43507b, 0x718d496a, 0x9df057af, 0x44b1bde6, + 0x054356dc, 0xde7ced35, 0xd51a138b, 0x62088cc9, + 0x35830311, 0xc96efca2, 0x686f86ec, 0x8e77cb68, + 0x63e1d6b8, 0xc80f9778, 0x79c491fd, 0x1b4c67f2, + 0x72698d7d, 0x5e368c31, 0xf7d95e2e, 0xa1d3493f, + 0xdcd9433e, 0x896f1552, 0x4bc4ca7a, 0xa6d1baf4, + 0xa5a96dcc, 0x0bef8b46, 0xa169fda7, 0x74df40b7, + 0x4e208804, 0x9a756607, 0x038e87c8, 0x20211e44, + 0x8b7ad4bf, 0xc6403f35, 0x1848e36d, 0x80bdb038, + 0x1e62891c, 0x643d2107, 0xbf04d6f8, 0x21092c8c, + 0xf644f389, 0x0778404e, 0x7b78adb8, 0xa2c52d53, + 0x42157abe, 0xa2253e2e, 0x7bf3f4ae, 0x80f594f9, + 0x953194e7, 0x77eb92ed, 0xb3816930, 0xda8d9336, + 0xbf447469, 0xf26d9483, 0xee6faed5, 0x71371235, + 0xde425f73, 0xb4e59f43, 0x7dbe2d4e, 0x2d37b185, + 0x49dc9a63, 0x98c39d98, 0x1301c9a2, 0x389b1bbf, + 0x0c18588d, 0xa421c1ba, 0x7aa3865c, 0x71e08558, + 0x3c5cfcaa, 0x7d239ca4, 0x0297d9dd, 0xd7dc2830, + 0x4b37802b, 0x7428ab54, 0xaeee0347, 0x4b3fbb85, + 0x692f2f08, 0x134e578e, 0x36d9e0bf, 0xae8b5fcf, + 0xedb93ecf, 0x2b27248e, 0x170eb1ef, 0x7dc57fd6, + 0x1e760f16, 0xb1136601, 0x864e1b9b, 0xd7ea7319, + 0x3ab871bd, 0xcfa4d76f, 0xe31bd782, 0x0dbeb469, + 0xabb96061, 0x5370f85d, 0xffb07e37, 0xda30d0fb, + 0xebc977b6, 0x0b98b40f, 0x3a4d0fe6, 0xdf4fc26b, + 0x159cf22a, 0xc298d6e2, 0x2b78ef6a, 0x61a94ac0, + 0xab561187, 0x14eea0f0, 0xdf0d4164, 0x19af70ee +}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/md2.cpp b/external/crypto++-5.6.3/md2.cpp new file mode 100644 index 000000000..e7b0a6bf8 --- /dev/null +++ b/external/crypto++-5.6.3/md2.cpp @@ -0,0 +1,120 @@ +// md2.cpp - modified by Wei Dai from Andrew M. Kuchling's md2.c +// The original code and all modifications are in the public domain. + +// This is the original introductory comment: + +/* + * md2.c : MD2 hash algorithm. + * + * Part of the Python Cryptography Toolkit, version 1.1 + * + * Distribute and use freely; there are no restrictions on further + * dissemination and usage except those imposed by the laws of your + * country of residence. + * + */ + +#include "pch.h" +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +#include "md2.h" + +NAMESPACE_BEGIN(CryptoPP) +namespace Weak1 { + +MD2::MD2() + : m_X(48), m_C(16), m_buf(16) +{ + Init(); +} + +void MD2::Init() +{ + memset(m_X, 0, 48); + memset(m_C, 0, 16); + memset(m_buf, 0, 16); + m_count = 0; +} + +void MD2::Update(const byte *buf, size_t len) +{ + static const byte S[256] = { + 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, + 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, + 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, + 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, + 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, + 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, + 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, + 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, + 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, + 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, + 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, + 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, + 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, + 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, + 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, + 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, + 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, + 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 + }; + + while (len) + { + unsigned int L = UnsignedMin(16U-m_count, len); + memcpy(m_buf+m_count, buf, L); + m_count+=L; + buf+=L; + len-=L; + if (m_count==16) + { + byte t; + int i,j; + + m_count=0; + memcpy(m_X+16, m_buf, 16); + t=m_C[15]; + for(i=0; i<16; i++) + { + m_X[32+i]=m_X[16+i]^m_X[i]; + t=m_C[i]^=S[m_buf[i]^t]; + } + + t=0; + for(i=0; i<18; i++) + { + for(j=0; j<48; j+=8) + { + t=m_X[j+0]^=S[t]; + t=m_X[j+1]^=S[t]; + t=m_X[j+2]^=S[t]; + t=m_X[j+3]^=S[t]; + t=m_X[j+4]^=S[t]; + t=m_X[j+5]^=S[t]; + t=m_X[j+6]^=S[t]; + t=m_X[j+7]^=S[t]; + } + t = byte((t+i) & 0xFF); + } + } + } +} + +void MD2::TruncatedFinal(byte *hash, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + byte padding[16]; + word32 padlen; + unsigned int i; + + padlen= 16-m_count; + for(i=0; iMD2 +class MD2 : public HashTransformation +{ +public: + MD2(); + void Update(const byte *input, size_t length); + void TruncatedFinal(byte *hash, size_t size); + unsigned int DigestSize() const {return DIGESTSIZE;} + unsigned int BlockSize() const {return BLOCKSIZE;} + static const char * StaticAlgorithmName() {return "MD2";} + + CRYPTOPP_CONSTANT(DIGESTSIZE = 16) + CRYPTOPP_CONSTANT(BLOCKSIZE = 16) + +private: + void Transform(); + void Init(); + SecByteBlock m_X, m_C, m_buf; + unsigned int m_count; +}; + +} +#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 +namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak +#else +using namespace Weak1; // import Weak1 into CryptoPP with warning +#ifdef __GNUC__ +#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." +#else +#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") +#endif +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/md4.cpp b/external/crypto++-5.6.3/md4.cpp new file mode 100644 index 000000000..9ed639cb9 --- /dev/null +++ b/external/crypto++-5.6.3/md4.cpp @@ -0,0 +1,110 @@ +// md4.cpp - modified by Wei Dai from Andrew M. Kuchling's md4.c +// The original code and all modifications are in the public domain. + +// This is the original introductory comment: + +/* + * md4.c : MD4 hash algorithm. + * + * Part of the Python Cryptography Toolkit, version 1.1 + * + * Distribute and use freely; there are no restrictions on further + * dissemination and usage except those imposed by the laws of your + * country of residence. + * + */ + +#include "pch.h" +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +#include "md4.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) +namespace Weak1 { + +void MD4::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xefcdab89L; + state[2] = 0x98badcfeL; + state[3] = 0x10325476L; +} + +void MD4::Transform (word32 *digest, const word32 *in) +{ +// #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) + + word32 A, B, C, D; + + A=digest[0]; + B=digest[1]; + C=digest[2]; + D=digest[3]; + +#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+in[k],s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 1, 7); + function(C,D,A,B, 2,11); + function(B,C,D,A, 3,19); + function(A,B,C,D, 4, 3); + function(D,A,B,C, 5, 7); + function(C,D,A,B, 6,11); + function(B,C,D,A, 7,19); + function(A,B,C,D, 8, 3); + function(D,A,B,C, 9, 7); + function(C,D,A,B,10,11); + function(B,C,D,A,11,19); + function(A,B,C,D,12, 3); + function(D,A,B,C,13, 7); + function(C,D,A,B,14,11); + function(B,C,D,A,15,19); + +#undef function +#define function(a,b,c,d,k,s) a=rotlFixed(a+G(b,c,d)+in[k]+0x5a827999,s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 4, 5); + function(C,D,A,B, 8, 9); + function(B,C,D,A,12,13); + function(A,B,C,D, 1, 3); + function(D,A,B,C, 5, 5); + function(C,D,A,B, 9, 9); + function(B,C,D,A,13,13); + function(A,B,C,D, 2, 3); + function(D,A,B,C, 6, 5); + function(C,D,A,B,10, 9); + function(B,C,D,A,14,13); + function(A,B,C,D, 3, 3); + function(D,A,B,C, 7, 5); + function(C,D,A,B,11, 9); + function(B,C,D,A,15,13); + +#undef function +#define function(a,b,c,d,k,s) a=rotlFixed(a+H(b,c,d)+in[k]+0x6ed9eba1,s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 8, 9); + function(C,D,A,B, 4,11); + function(B,C,D,A,12,15); + function(A,B,C,D, 2, 3); + function(D,A,B,C,10, 9); + function(C,D,A,B, 6,11); + function(B,C,D,A,14,15); + function(A,B,C,D, 1, 3); + function(D,A,B,C, 9, 9); + function(C,D,A,B, 5,11); + function(B,C,D,A,13,15); + function(A,B,C,D, 3, 3); + function(D,A,B,C,11, 9); + function(C,D,A,B, 7,11); + function(B,C,D,A,15,15); + + digest[0]+=A; + digest[1]+=B; + digest[2]+=C; + digest[3]+=D; +} + +} +NAMESPACE_END diff --git a/external/crypto++-5.6.3/md4.h b/external/crypto++-5.6.3/md4.h new file mode 100644 index 000000000..53387003c --- /dev/null +++ b/external/crypto++-5.6.3/md4.h @@ -0,0 +1,35 @@ +#ifndef CRYPTOPP_MD4_H +#define CRYPTOPP_MD4_H + +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +namespace Weak1 { + +//! MD4 +/*! \warning MD4 is considered insecure, and should not be used + unless you absolutely need it for compatibility. */ +class MD4 : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word32 *digest, const word32 *data); + static const char *StaticAlgorithmName() {return "MD4";} +}; + +} +#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 +namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak +#else +using namespace Weak1; // import Weak1 into CryptoPP with warning +#ifdef __GNUC__ +#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." +#else +#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") +#endif +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/md5.cpp b/external/crypto++-5.6.3/md5.cpp new file mode 100644 index 000000000..e7c7ac871 --- /dev/null +++ b/external/crypto++-5.6.3/md5.cpp @@ -0,0 +1,120 @@ +// md5.cpp - modified by Wei Dai from Colin Plumb's public domain md5.c +// any modifications are placed in the public domain + +#include "pch.h" +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 +#include "md5.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) +namespace Weak1 { + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void MD5_TestInstantiations() +{ + MD5 x; +} +#endif + +void MD5::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xefcdab89L; + state[2] = 0x98badcfeL; + state[3] = 0x10325476L; +} + +void MD5::Transform (word32 *digest, const word32 *in) +{ +// #define F1(x, y, z) (x & y | ~x & z) +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) + +#define MD5STEP(f, w, x, y, z, data, s) \ + w = rotlFixed(w + f(x, y, z) + data, s) + x + + word32 a, b, c, d; + + a=digest[0]; + b=digest[1]; + c=digest[2]; + d=digest[3]; + + MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); + MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); + MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); + MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); + MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); + MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); + MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); + MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); + MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); + MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); + MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); + MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); + MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); + MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); + MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); + MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); + + MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); + MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); + MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); + MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); + MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); + MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); + MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); + MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); + MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); + MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); + MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); + MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); + MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); + MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); + MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); + MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); + + MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); + MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); + MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); + MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); + MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); + MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); + MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); + MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); + MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); + MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); + MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); + MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); + MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); + MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); + MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); + MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); + + MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); + MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); + MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); + MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); + MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); + MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); + MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); + MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); + MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); + MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); + MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); + MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); + MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); + MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); + MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); + MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); + + digest[0]+=a; + digest[1]+=b; + digest[2]+=c; + digest[3]+=d; +} + +} +NAMESPACE_END diff --git a/external/crypto++-5.6.3/md5.h b/external/crypto++-5.6.3/md5.h new file mode 100644 index 000000000..73ec5326c --- /dev/null +++ b/external/crypto++-5.6.3/md5.h @@ -0,0 +1,33 @@ +#ifndef CRYPTOPP_MD5_H +#define CRYPTOPP_MD5_H + +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +namespace Weak1 { + +//! MD5 +class MD5 : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word32 *digest, const word32 *data); + static const char * StaticAlgorithmName() {return "MD5";} +}; + +} +#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 +namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak +#else +using namespace Weak1; // import Weak1 into CryptoPP with warning +#ifdef __GNUC__ +#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." +#else +#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") +#endif +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/mdc.h b/external/crypto++-5.6.3/mdc.h new file mode 100644 index 000000000..e814cccca --- /dev/null +++ b/external/crypto++-5.6.3/mdc.h @@ -0,0 +1,73 @@ + // mdc.h - written and placed in the public domain by Wei Dai + +#ifndef CRYPTOPP_MDC_H +#define CRYPTOPP_MDC_H + +/** \file +*/ + +#include "seckey.h" +#include "secblock.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +template +struct MDC_Info : public FixedBlockSize, public FixedKeyLength +{ + static std::string StaticAlgorithmName() {return std::string("MDC/")+T::StaticAlgorithmName();} +}; + +//! MDC +/*! a construction by Peter Gutmann to turn an iterated hash function into a PRF */ +template +class MDC : public MDC_Info +{ + class CRYPTOPP_NO_VTABLE Enc : public BlockCipherImpl > + { + typedef typename T::HashWordType HashWordType; + + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) + { + this->AssertValidKeyLength(length); + memcpy_s(m_key, m_key.size(), userKey, this->KEYLENGTH); + T::CorrectEndianess(Key(), Key(), this->KEYLENGTH); + } + + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const + { + T::CorrectEndianess(Buffer(), (HashWordType *)inBlock, this->BLOCKSIZE); + T::Transform(Buffer(), Key()); + if (xorBlock) + { + T::CorrectEndianess(Buffer(), Buffer(), this->BLOCKSIZE); + xorbuf(outBlock, xorBlock, m_buffer, this->BLOCKSIZE); + } + else + T::CorrectEndianess((HashWordType *)outBlock, Buffer(), this->BLOCKSIZE); + } + + bool IsPermutation() const {return false;} + + unsigned int OptimalDataAlignment() const {return sizeof(HashWordType);} + + private: + HashWordType *Key() {return (HashWordType *)m_key.data();} + const HashWordType *Key() const {return (const HashWordType *)m_key.data();} + HashWordType *Buffer() const {return (HashWordType *)m_buffer.data();} + + // VC60 workaround: bug triggered if using FixedSizeAllocatorWithCleanup + FixedSizeSecBlock::KEYLENGTH, AllocatorWithCleanup > m_key; + mutable FixedSizeSecBlock::BLOCKSIZE, AllocatorWithCleanup > m_buffer; + }; + +public: + //! use BlockCipher interface + typedef BlockCipherFinal Encryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/mersenne.h b/external/crypto++-5.6.3/mersenne.h new file mode 100644 index 000000000..1148e8bb8 --- /dev/null +++ b/external/crypto++-5.6.3/mersenne.h @@ -0,0 +1,193 @@ +// mersenne.h - written and placed in public domain by Jeffrey Walton. +// Copyright assigned to Crypto++ project. + +//! \file +//! \brief Class file for Mersenne Twister +//! \note Suitable for Monte Carlo simulations, and not cryptographic use + +#ifndef CRYPTOPP_MERSENNE_TWISTER_H +#define CRYPTOPP_MERSENNE_TWISTER_H + +#include "cryptlib.h" +#include "secblock.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class MersenneTwister +//! \brief Mersenne Twister class for Monte-Carlo simulations +//! \tparam K Magic constant +//! \tparam M Period parameter +//! \tparam N Size of the state vector +//! \tparam F Multiplier constant +//! \tparam S Sefault seed +//! \details Provides the MersenneTwister implementation. The class is a header-only implementation. +//! \warning MersenneTwister is suitable for simulations, where uniformaly distrubuted numbers are +//! required quickly. It should not be used for cryptographic purposes. +template +class MersenneTwister : public RandomNumberGenerator +{ +public: + //! \brief Construct a Mersenne Twister + //! \param seed 32-bit seed + //! \details Defaults to template parameter S due to changing algorithm + //! parameters over time + MersenneTwister(unsigned long seed = S) : m_seed(seed), m_idx(N) + { + m_state[0] = seed; + for (unsigned int i = 1; i < N+1; i++) + m_state[i] = word32(F * (m_state[i-1] ^ (m_state[i-1] >> 30)) + i); + } + + //! \brief Generate random array of bytes + //! \param output byte buffer + //! \param size length of the buffer, in bytes + //! \details Bytes are written to output in big endian order. If output length + //! is not a multiple of word32, then unused bytes are not accumulated for subsequent + //! calls to GenerateBlock. Rather, the unused tail bytes are discarded, and the + //! stream is continued at the next word32 boundary from the state array. + void GenerateBlock(byte *output, size_t size) + { + // Handle word32 size blocks + word32 temp; + for (size_t i=0; i < size/4; i++, output += 4) + { +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && defined(IS_LITTLE_ENDIAN) + *((word32*)output) = ByteReverse(NextMersenneWord()); +#elif defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) + *((word32*)output) = NextMersenneWord(); +#else + temp = NextMersenneWord(); + output[3] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 0); + output[2] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 1); + output[1] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 2); + output[0] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 3); +#endif + } + + // No tail bytes + if (size%4 == 0) + { + // Wipe temp + *((volatile word32*)&temp) = 0; + return; + } + + // Handle tail bytes + temp = NextMersenneWord(); + switch (size%4) + { + case 3: output[2] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 1); /* fall through */ + case 2: output[1] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 2); /* fall through */ + case 1: output[0] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 3); break; + + default: assert(0); ;; + } + + // Wipe temp + *((volatile word32*)&temp) = 0; + } + + //! \brief Generate a random 32-bit word in the range min to max, inclusive + //! \returns random 32-bit word in the range min to max, inclusive + //! \details If the 32-bit candidate is not within the range, then it is discarded + //! and a new candidate is used. + word32 GenerateWord32(word32 min=0, word32 max=0xffffffffL) + { + const word32 range = max-min; + if (range == 0xffffffffL) + return NextMersenneWord(); + + const int maxBits = BitPrecision(range); + word32 value; + + do{ + value = Crop(NextMersenneWord(), maxBits); + } while (value > range); + + return value+min; + } + + //! \brief Generate and discard n bytes + //! \param n the number of bytes to discard, rounded up to a word32 size + //! \details If n is not a multiple of word32, then unused bytes are + //! not accumulated for subsequent calls to GenerateBlock. Rather, the unused + //! tail bytes are discarded, and the stream is continued at the next + //! word32 boundary from the state array. + void DiscardBytes(size_t n) + { + for(size_t i=0; i < RoundUpToMultipleOf(n, 4U); i++) + NextMersenneWord(); + } + +protected: + + //! \brief Returns the next 32-bit word from the state array + //! \returns the next 32-bit word from the state array + //! \details fetches the next word frm the state array, performs bit operations on + //! it, and then returns the value to the caller. + word32 NextMersenneWord() + { + if (m_idx >= N) { Twist(); } + + word32 temp = m_state[m_idx++]; + + temp ^= (temp >> 11); + temp ^= (temp << 7) & 0x9D2C5680; // 0x9D2C5680 (2636928640) + temp ^= (temp << 15) & 0xEFC60000; // 0xEFC60000 (4022730752) + + return temp ^ (temp >> 18); + } + + //! \brief Performs the twist operaton on the state array + void Twist() + { + static const unsigned long magic[2]={0x0UL, K}; + word32 kk, temp; + + assert(N >= M); + for (kk=0;kk> 1) ^ magic[temp & 0x1UL]; + } + + for (;kk> 1) ^ magic[temp & 0x1UL]; + } + + temp = (m_state[N-1] & 0x80000000)|(m_state[0] & 0x7FFFFFFF); + m_state[N-1] = m_state[M-1] ^ (temp >> 1) ^ magic[temp & 0x1UL]; + + // Reset index + m_idx = 0; + + // Wipe temp + *((volatile word32*)&temp) = 0; + } + +private: + + //! \brief 32-bit word state array of size N + FixedSizeSecBlock m_state; + //! \brief the value used to seed the generator + unsigned int m_seed; + //! \brief the current index into the state array + unsigned int m_idx; +}; + +//! \brief Original MT19937 generator provided in the ACM paper. +//! \details Also see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf; uses 4537 as default initial seed. +typedef MersenneTwister<0x9908B0DF /*2567483615*/, 397, 624, 0x10DCD /*69069*/, 4537> MT19937; + +//! \brief Updated MT19937 generator adapted to provide an array for initialization. +//! \details Also see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html; uses 5489 as default initial seed. +//! \note Use this generator when interoperating with C++11's mt19937 class. +typedef MersenneTwister<0x9908B0DF /*2567483615*/, 397, 624, 0x6C078965 /*1812433253*/, 5489> MT19937ar; + +NAMESPACE_END + +#endif // CRYPTOPP_MERSENNE_TWISTER_H + \ No newline at end of file diff --git a/external/crypto++-5.6.3/misc.cpp b/external/crypto++-5.6.3/misc.cpp new file mode 100644 index 000000000..0289e9af6 --- /dev/null +++ b/external/crypto++-5.6.3/misc.cpp @@ -0,0 +1,210 @@ +// misc.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4189) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6237) +# endif +#endif + +#ifndef CRYPTOPP_IMPORTS + +#include "misc.h" +#include "words.h" +#include "words.h" +#include "stdcpp.h" +#include "integer.h" + +// for memalign +#if defined(CRYPTOPP_MEMALIGN_AVAILABLE) || defined(CRYPTOPP_MM_MALLOC_AVAILABLE) || defined(QNX) +# include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +void xorbuf(byte *buf, const byte *mask, size_t count) +{ + assert(buf != NULL); + assert(mask != NULL); + assert(count > 0); + + size_t i=0; + if (IsAligned(buf) && IsAligned(mask)) + { + if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) + { + for (i=0; i 0); + + size_t i=0; + if (IsAligned(output) && IsAligned(input) && IsAligned(mask)) + { + if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(output) && IsAligned(input) && IsAligned(mask)) + { + for (i=0; i 0); + + size_t i=0; + byte acc8 = 0; + + if (IsAligned(buf) && IsAligned(mask)) + { + word32 acc32 = 0; + if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) + { + word64 acc64 = 0; + for (i=0; i>32); + } + + for (i=0; i>8) | byte(acc32>>16) | byte(acc32>>24); + } + + for (i=0; i= 1400) +# pragma warning(disable: 6326) +# endif +#endif + +#include "cryptlib.h" +#include "stdcpp.h" +#include "smartptr.h" + +#ifdef _MSC_VER + #if _MSC_VER >= 1400 + // VC2005 workaround: disable declarations that conflict with winnt.h + #define _interlockedbittestandset CRYPTOPP_DISABLED_INTRINSIC_1 + #define _interlockedbittestandreset CRYPTOPP_DISABLED_INTRINSIC_2 + #define _interlockedbittestandset64 CRYPTOPP_DISABLED_INTRINSIC_3 + #define _interlockedbittestandreset64 CRYPTOPP_DISABLED_INTRINSIC_4 + #include + #undef _interlockedbittestandset + #undef _interlockedbittestandreset + #undef _interlockedbittestandset64 + #undef _interlockedbittestandreset64 + #define CRYPTOPP_FAST_ROTATE(x) 1 + #elif _MSC_VER >= 1300 + #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64) + #else + #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) + #endif +#elif (defined(__MWERKS__) && TARGET_CPU_PPC) || \ + (defined(__GNUC__) && (defined(_ARCH_PWR2) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_ARCH_COM))) + #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) +#elif defined(__GNUC__) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86) // depend on GCC's peephole optimization to generate rotate instructions + #define CRYPTOPP_FAST_ROTATE(x) 1 +#else + #define CRYPTOPP_FAST_ROTATE(x) 0 +#endif + +#ifdef __BORLANDC__ +#include +#endif + +// !KLUDGE! @FD This gets confused and tries to include +// tier1/byteswap.h. We'll just fall back on the slower +// routines.//#if defined(__GNUC__) && defined(__linux__) +//#define CRYPTOPP_BYTESWAP_AVAILABLE +//#include +//#endif + +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +#if CRYPTOPP_DOXYGEN_PROCESSING +//! \brief The maximum value of a machine word +//! \details SIZE_MAX provides the maximum value of a machine word. The value is +//! \p 0xffffffff on 32-bit machines, and \p 0xffffffffffffffff on 64-bit machines. +//! Internally, SIZE_MAX is defined as __SIZE_MAX__ if __SIZE_MAX__ is defined. If not +//! defined, then SIZE_T_MAX is tried. If neither __SIZE_MAX__ nor SIZE_T_MAX is +//! is defined, the library uses std::numeric_limits::max(). The library +//! prefers __SIZE_MAX__ because its a constexpr that is optimized well +//! by all compilers. std::numeric_limits::max() is \a not a constexpr, +//! and it is \a not always optimized well. +# define SIZE_MAX ... +#else +// Its amazing portability problems still plague this simple concept in 2015. +// http://stackoverflow.com/questions/30472731/which-c-standard-header-defines-size-max +// Avoid NOMINMAX macro on Windows. http://support.microsoft.com/en-us/kb/143208 +#ifndef SIZE_MAX +# if defined(__SIZE_MAX__) +# define SIZE_MAX __SIZE_MAX__ +# elif defined(SIZE_T_MAX) +# define SIZE_MAX SIZE_T_MAX +# else +# define SIZE_MAX ((std::numeric_limits::max)()) +# endif +#endif + +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +NAMESPACE_BEGIN(CryptoPP) + +// Forward declaration for IntToString specialization +class Integer; + +// ************** compile-time assertion *************** + +#if CRYPTOPP_DOXYGEN_PROCESSING +//! \brief Compile time assertion +//! \param expr the expression to evaluate +//! \details Asserts the expression expr though a dummy struct. +#define CRYPTOPP_COMPILE_ASSERT(expr) ... +#else // CRYPTOPP_DOXYGEN_PROCESSING +template +struct CompileAssert +{ + static char dummy[2*b-1]; +}; +//! \endif + +#define CRYPTOPP_COMPILE_ASSERT(assertion) CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, __LINE__) +#if defined(CRYPTOPP_EXPORTS) || defined(CRYPTOPP_IMPORTS) +#define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) +#else +# if defined(__GNUC__) +# define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) \ + static CompileAssert<(assertion)> \ + CRYPTOPP_ASSERT_JOIN(cryptopp_assert_, instance) __attribute__ ((unused)) +# else +# define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) \ + static CompileAssert<(assertion)> \ + CRYPTOPP_ASSERT_JOIN(cryptopp_assert_, instance) +# endif // __GNUC__ +#endif +#define CRYPTOPP_ASSERT_JOIN(X, Y) CRYPTOPP_DO_ASSERT_JOIN(X, Y) +#define CRYPTOPP_DO_ASSERT_JOIN(X, Y) X##Y + +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +// ************** count elements in an array *************** + +#if CRYPTOPP_DOXYGEN_PROCESSING +//! \brief Counts elements in an array +//! \param arr an array of elements +//! \details COUNTOF counts elements in an array. On Windows COUNTOF(x) is deinfed +//! to _countof(x) to ensure correct results for pointers. Since the library code +//! is cross-platform, Windows will ensure the safety on non-Windows platforms. +//! \note COUNTOF does not produce correct results with pointers, and an array must be used. +//! The library ensures correct application of COUNTOF by enlisting _countof on Windows +//! platforms. Microsoft's _countof fails to compile using pointers. +# define COUNTOF(arr) +#else +// VS2005 added _countof +#ifndef COUNTOF +# if defined(_MSC_VER) && (_MSC_VER >= 1400) +# define COUNTOF(x) _countof(x) +# else +# define COUNTOF(x) (sizeof(x)/sizeof(x[0])) +# endif +#endif // COUNTOF +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +// ************** misc classes *************** + +#if !CRYPTOPP_DOXYGEN_PROCESSING +class CRYPTOPP_DLL Empty +{ +}; + +template +class CRYPTOPP_NO_VTABLE TwoBases : public BASE1, public BASE2 +{ +}; + +template +class CRYPTOPP_NO_VTABLE ThreeBases : public BASE1, public BASE2, public BASE3 +{ +}; +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +//! \class ObjectHolder +//! \tparam the class or type +//! \brief Uses encapsulation to hide an object in derived classes +//! \details The object T is declared as protected. +template +class ObjectHolder +{ +protected: + T m_object; +}; + +//! \class NotCopyable +//! \brief Ensures an object is not copyable +//! \details NotCopyable ensures an object is not copyable by making the +//! copy constructor and assignment operator private. Deleters are not +//! used under C++11. +//! \sa Clonable class +class NotCopyable +{ +public: + NotCopyable() {} +private: + NotCopyable(const NotCopyable &); + void operator=(const NotCopyable &); +}; + +//! \class NewObject +//! \brief An object factory function +//! \details NewObject overloads operator()(). +template +struct NewObject +{ + T* operator()() const {return new T;} +}; + +#if CRYPTOPP_DOXYGEN_PROCESSING +//! \brief A memory barrier +//! \details MEMORY_BARRIER attempts to ensure reads and writes are completed +//! in the absence of a language synchronization point. It is used by the +//! Singleton class if the compiler supports it. The use is provided at the +//! customary check points in a double-checked initialization. +//! \details Internally, MEMORY_BARRIER uses intrinsic(_ReadWriteBarrier), +//! _ReadWriteBarrier() or __asm__("" ::: "memory"). +#define MEMORY_BARRIER ... +#else +#if (_MSC_VER >= 1400) +# pragma intrinsic(_ReadWriteBarrier) +# define MEMORY_BARRIER() _ReadWriteBarrier() +#elif defined(__INTEL_COMPILER) +# define MEMORY_BARRIER() __memory_barrier() +#elif defined(__GNUC__) || defined(__clang__) +# define MEMORY_BARRIER() __asm__ __volatile__ ("" ::: "memory") +#else +# define MEMORY_BARRIER() +#endif +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +//! \brief Restricts the instantiation of a class to one static object without locks +//! \tparam T the class or type +//! \tparam F the object factory for T +//! \tparam instance the initiali instance count +//! \details This class safely initializes a static object in a multithreaded environment +//! without using locks (for portability). Note that if two threads call Ref() at the same +//! time, they may get back different references, and one object may end up being memory +//! leaked. This is by design. +template , int instance=0> +class Singleton +{ +public: + Singleton(F objectFactory = F()) : m_objectFactory(objectFactory) {} + + // prevent this function from being inlined + CRYPTOPP_NOINLINE const T & Ref(CRYPTOPP_NOINLINE_DOTDOTDOT) const; + +private: + F m_objectFactory; +}; + +//! \brief Return a reference to the inner Singleton object +//! \details Ref() is used to create the object using the object factory. The +//! object is only created once with the limitations discussed in the class documentation. +template +const T & Singleton::Ref(CRYPTOPP_NOINLINE_DOTDOTDOT) const +{ + static volatile simple_ptr s_pObject; + T *p = s_pObject.m_p; + MEMORY_BARRIER(); + + if (p) + return *p; + + T *newObject = m_objectFactory(); + p = s_pObject.m_p; + MEMORY_BARRIER(); + + if (p) + { + delete newObject; + return *p; + } + + s_pObject.m_p = newObject; + MEMORY_BARRIER(); + + return *newObject; +} + +// ************** misc functions *************** + +#if (!__STDC_WANT_SECURE_LIB__ && !defined(_MEMORY_S_DEFINED)) || defined(CRYPTOPP_WANT_SECURE_LIB) + +//! \brief Bounds checking replacement for memcpy() +//! \param dest pointer to the desination memory block +//! \param sizeInBytes the size of the desination memory block, in bytes +//! \param src pointer to the source memory block +//! \param count the size of the source memory block, in bytes +//! \throws InvalidArgument +//! \details ISO/IEC TR-24772 provides bounds checking interfaces for potentially +//! unsafe functions like memcpy(), strcpy() and memmove(). However, +//! not all standard libraries provides them, like Glibc. The library's +//! memcpy_s() is a near-drop in replacement. Its only a near-replacement +//! because the library's version throws an InvalidArgument on a bounds violation. +//! \details memcpy_s() and memmove_s() are guarded by __STDC_WANT_SECURE_LIB__. +//! If __STDC_WANT_SECURE_LIB__ is \a not defined or defined to 0, then the library +//! makes memcpy_s() and memmove_s() available. The library will also optionally +//! make the symbols available if CRYPTOPP_WANT_SECURE_LIB is defined. +//! CRYPTOPP_WANT_SECURE_LIB is in config.h, but it is disabled by default. +//! \details memcpy_s() will assert the pointers src and dest are not NULL +//! in debug builds. Passing NULL for either pointer is undefined behavior. +inline void memcpy_s(void *dest, size_t sizeInBytes, const void *src, size_t count) +{ + // Safer functions on Windows for C&A, http://github.com/weidai11/cryptopp/issues/55 + + // Pointers must be valid; otherwise undefined behavior + assert(dest != NULL); assert(src != NULL); + // Destination buffer must be large enough to satsify request + assert(sizeInBytes >= count); + if (count > sizeInBytes) + throw InvalidArgument("memcpy_s: buffer overflow"); + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4996) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6386) +# endif +#endif + memcpy(dest, src, count); +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif +} + +//! \brief Bounds checking replacement for memmove() +//! \param dest pointer to the desination memory block +//! \param sizeInBytes the size of the desination memory block, in bytes +//! \param src pointer to the source memory block +//! \param count the size of the source memory block, in bytes +//! \throws InvalidArgument +//! \details ISO/IEC TR-24772 provides bounds checking interfaces for potentially +//! unsafe functions like memcpy(), strcpy() and memmove(). However, +//! not all standard libraries provides them, like Glibc. The library's +//! memmove_s() is a near-drop in replacement. Its only a near-replacement +//! because the library's version throws an InvalidArgument on a bounds violation. +//! \details memcpy_s() and memmove_s() are guarded by __STDC_WANT_SECURE_LIB__. +//! If __STDC_WANT_SECURE_LIB__ is \a not defined or defined to 0, then the library +//! makes memcpy_s() and memmove_s() available. The library will also optionally +//! make the symbols available if CRYPTOPP_WANT_SECURE_LIB is defined. +//! CRYPTOPP_WANT_SECURE_LIB is in config.h, but it is disabled by default. +//! \details memmove_s() will assert the pointers src and dest are not NULL +//! in debug builds. Passing NULL for either pointer is undefined behavior. +inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t count) +{ + // Safer functions on Windows for C&A, http://github.com/weidai11/cryptopp/issues/55 + + // Pointers must be valid; otherwise undefined behavior + assert(dest != NULL); assert(src != NULL); + // Destination buffer must be large enough to satsify request + assert(sizeInBytes >= count); + if (count > sizeInBytes) + throw InvalidArgument("memmove_s: buffer overflow"); + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4996) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6386) +# endif +#endif + memmove(dest, src, count); +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif +} + +#if __BORLANDC__ >= 0x620 +// C++Builder 2010 workaround: can't use std::memcpy_s because it doesn't allow 0 lengths +# define memcpy_s CryptoPP::memcpy_s +# define memmove_s CryptoPP::memmove_s +#endif + +#endif // __STDC_WANT_SECURE_LIB__ + +//! \brief Memory block initializer and eraser that attempts to survive optimizations +//! \param ptr pointer to the memory block being written +//! \param value the integer value to write for each byte +//! \param num the size of the source memory block, in bytes +//! \details Internally the function calls memset with the value value, and receives the +//! return value from memset as a volatile pointer. +inline void * memset_z(void *ptr, int value, size_t num) +{ +// avoid extranous warning on GCC 4.3.2 Ubuntu 8.10 +#if CRYPTOPP_GCC_VERSION >= 30001 + if (__builtin_constant_p(num) && num==0) + return ptr; +#endif + volatile void* x = memset(ptr, value, num); + return const_cast(x); +} + +//! \brief Replacement function for std::min +//! \param a the first value +//! \param b the second value +//! \returns the minimum value based on a comparison of b \< a using operator\< +//! \details STDMIN was provided because the library could not use std::min or std::max in MSVC60 or Cygwin 1.1.0 +template inline const T& STDMIN(const T& a, const T& b) +{ + return b < a ? b : a; +} + +//! \brief Replacement function for std::max +//! \param a the first value +//! \param b the second value +//! \returns the minimum value based on a comparison of a \< b using operator\< +//! \details STDMAX was provided because the library could not use std::min or std::max in MSVC60 or Cygwin 1.1.0 +template inline const T& STDMAX(const T& a, const T& b) +{ + // can't use std::min or std::max in MSVC60 or Cygwin 1.1.0 + return a < b ? b : a; +} + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4389) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsign-compare" +# if (CRYPTOPP_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 30000) +# pragma GCC diagnostic ignored "-Wtautological-compare" +# elif (CRYPTOPP_GCC_VERSION >= 40300) +# pragma GCC diagnostic ignored "-Wtype-limits" +# endif +#endif + +//! \brief Safe comparison of values that could be neagtive and incorrectly promoted +//! \param a the first value +//! \param b the second value +//! \returns the minimum value based on a comparison a and b using operator<. +//! \details The comparison b \< a is performed and the value returned is a's type T1. +template inline const T1 UnsignedMin(const T1& a, const T2& b) +{ + CRYPTOPP_COMPILE_ASSERT((sizeof(T1)<=sizeof(T2) && T2(-1)>0) || (sizeof(T1)>sizeof(T2) && T1(-1)>0)); + if (sizeof(T1)<=sizeof(T2)) + return b < (T2)a ? (T1)b : a; + else + return (T1)b < a ? (T1)b : a; +} + +//! \brief Tests whether a conversion from → to is safe to perform +//! \param from the first value +//! \param to the second value +//! \returns true if its safe to convert from into to, false otherwise. +template +inline bool SafeConvert(T1 from, T2 &to) +{ + to = (T2)from; + if (from != to || (from > 0) != (to > 0)) + return false; + return true; +} + +//! \brief Converts a value to a string +//! \param value the value to convert +//! \param base the base to use during the conversion +//! \returns the string representation of value in base. +template +std::string IntToString(T value, unsigned int base = 10) +{ + // Hack... set the high bit for uppercase. + static const unsigned int HIGH_BIT = (1U << 31); + const char CH = !!(base & HIGH_BIT) ? 'A' : 'a'; + base &= ~HIGH_BIT; + + assert(base >= 2); + if (value == 0) + return "0"; + + bool negate = false; + if (value < 0) + { + negate = true; + value = 0-value; // VC .NET does not like -a + } + std::string result; + while (value > 0) + { + T digit = value % base; + result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result; + value /= base; + } + if (negate) + result = "-" + result; + return result; +} + +//! \brief Converts an unsigned value to a string +//! \param value the value to convert +//! \param base the base to use during the conversion +//! \returns the string representation of value in base. +//! \details this template function specialization was added to suppress +//! Coverity findings on IntToString() with unsigned types. +template <> CRYPTOPP_DLL +std::string IntToString(unsigned long long value, unsigned int base); + +//! \brief Converts an Integer to a string +//! \param value the Integer to convert +//! \param base the base to use during the conversion +//! \returns the string representation of value in base. +//! \details This is a template specialization of IntToString(). Use it +//! like IntToString(): +//!

+//!   // Print integer in base 10
+//!   Integer n...
+//!   std::string s = IntToString(n, 10);
+//! 
+//! \details The string is presented with lowercase letters by default. A +//! hack is available to switch to uppercase letters without modifying +//! the function signature.sha +//!
+//!   // Print integer in base 10, uppercase letters
+//!   Integer n...
+//!   const unsigned int UPPER = (1 << 31);
+//!   std::string s = IntToString(n, (UPPER | 10));
+//! 
+template <> CRYPTOPP_DLL +std::string IntToString(Integer value, unsigned int base); + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic pop +#endif + +#define RETURN_IF_NONZERO(x) size_t returnedValue = x; if (returnedValue) return returnedValue + +// this version of the macro is fastest on Pentium 3 and Pentium 4 with MSVC 6 SP5 w/ Processor Pack +#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y))) +// these may be faster on other CPUs/compilers +// #define GETBYTE(x, y) (unsigned int)(((x)>>(8*(y)))&255) +// #define GETBYTE(x, y) (((byte *)&(x))[y]) + +#define CRYPTOPP_GET_BYTE_AS_BYTE(x, y) byte((x)>>(8*(y))) + +//! \brief Returns the parity of a value +//! \param value the value to provide the parity +//! \returns 1 if the number 1-bits in the value is odd, 0 otherwise +template +unsigned int Parity(T value) +{ + for (unsigned int i=8*sizeof(value)/2; i>0; i/=2) + value ^= value >> i; + return (unsigned int)value&1; +} + +//! \brief Returns the number of 8-bit bytes or octets required for a value +//! \param value the value to test +//! \returns the minimum number of 8-bit bytes or octets required to represent a value +template +unsigned int BytePrecision(const T &value) +{ + if (!value) + return 0; + + unsigned int l=0, h=8*sizeof(value); + while (h-l > 8) + { + unsigned int t = (l+h)/2; + if (value >> t) + l = t; + else + h = t; + } + + return h/8; +} + +//! \brief Returns the number of bits required for a value +//! \param value the value to test +//! \returns the maximum number of bits required to represent a value. +template +unsigned int BitPrecision(const T &value) +{ + if (!value) + return 0; + + unsigned int l=0, h=8*sizeof(value); + + while (h-l > 1) + { + unsigned int t = (l+h)/2; + if (value >> t) + l = t; + else + h = t; + } + + return h; +} + +//! Determines the number of trailing 0-bits in a value +//! \param v the 32-bit value to test +//! \returns the number of trailing 0-bits in v, starting at the least significant bit position +//! \details TrailingZeros returns the number of trailing 0-bits in v, starting at the least +//! significant bit position. The return value is undefined if there are no 1-bits set in the value v. +//! \note The function does \a not return 0 if no 1-bits are set because 0 collides with a 1-bit at the 0-th position. +inline unsigned int TrailingZeros(word32 v) +{ + assert(v != 0); +#if defined(__GNUC__) && CRYPTOPP_GCC_VERSION >= 30400 + return __builtin_ctz(v); +#elif defined(_MSC_VER) && _MSC_VER >= 1400 + unsigned long result; + _BitScanForward(&result, v); + return result; +#else + // from http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightMultLookup + static const int MultiplyDeBruijnBitPosition[32] = + { + 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 + }; + return MultiplyDeBruijnBitPosition[((word32)((v & -v) * 0x077CB531U)) >> 27]; +#endif +} + +//! Determines the number of trailing 0-bits in a value +//! \param v the 64-bit value to test +//! \returns the number of trailing 0-bits in v, starting at the least significant bit position +//! \details TrailingZeros returns the number of trailing 0-bits in v, starting at the least +//! significant bit position. The return value is undefined if there are no 1-bits set in the value v. +//! \note The function does \a not return 0 if no 1-bits are set because 0 collides with a 1-bit at the 0-th position. +inline unsigned int TrailingZeros(word64 v) +{ + assert(v != 0); +#if defined(__GNUC__) && CRYPTOPP_GCC_VERSION >= 30400 + return __builtin_ctzll(v); +#elif defined(_MSC_VER) && _MSC_VER >= 1400 && (defined(_M_X64) || defined(_M_IA64)) + unsigned long result; + _BitScanForward64(&result, v); + return result; +#else + return word32(v) ? TrailingZeros(word32(v)) : 32 + TrailingZeros(word32(v>>32)); +#endif +} + +//! \brief Truncates the value to the specified number of bits. +//! \param value the value to truncate or mask +//! \param bits the number of bits to truncate or mask +//! \returns the value truncated to the specified number of bits, starting at the least +//! significant bit position +//! \details This function masks the low-order bits of value and returns the result. The +//! mask is created with (1 << bits) - 1. +template +inline T Crop(T value, size_t bits) +{ + if (bits < 8*sizeof(value)) + return T(value & ((T(1) << bits) - 1)); + else + return value; +} + +//! \brief Returns the number of 8-bit bytes or octets required for the specified number of bits +//! \param bitCount the number of bits +//! \returns the minimum number of 8-bit bytes or octets required by bitCount +//! \details BitsToBytes is effectively a ceiling function based on 8-bit bytes. +inline size_t BitsToBytes(size_t bitCount) +{ + return ((bitCount+7)/(8)); +} + +//! \brief Returns the number of words required for the specified number of bytes +//! \param byteCount the number of bytes +//! \returns the minimum number of words required by byteCount +//! \details BytesToWords is effectively a ceiling function based on WORD_SIZE. +//! WORD_SIZE is defined in config.h +inline size_t BytesToWords(size_t byteCount) +{ + return ((byteCount+WORD_SIZE-1)/WORD_SIZE); +} + +//! \brief Returns the number of words required for the specified number of bits +//! \param bitCount the number of bits +//! \returns the minimum number of words required by bitCount +//! \details BitsToWords is effectively a ceiling function based on WORD_BITS. +//! WORD_BITS is defined in config.h +inline size_t BitsToWords(size_t bitCount) +{ + return ((bitCount+WORD_BITS-1)/(WORD_BITS)); +} + +//! \brief Returns the number of double words required for the specified number of bits +//! \param bitCount the number of bits +//! \returns the minimum number of double words required by bitCount +//! \details BitsToDwords is effectively a ceiling function based on 2*WORD_BITS. +//! WORD_BITS is defined in config.h +inline size_t BitsToDwords(size_t bitCount) +{ + return ((bitCount+2*WORD_BITS-1)/(2*WORD_BITS)); +} + +//! Performs an XOR of a buffer with a mask +//! \param buf the buffer to XOR with the mask +//! \param mask the mask to XOR with the buffer +//! \param count the size of the buffers, in bytes +//! \details The function effectively visits each element in the buffers and performs +//! buf[i] ^= mask[i]. buf and mask must be of equal size. +CRYPTOPP_DLL void CRYPTOPP_API xorbuf(byte *buf, const byte *mask, size_t count); + +//! Performs an XOR of an input buffer with a mask and stores the result in an output buffer +//! \param output the destination buffer +//! \param input the source buffer to XOR with the mask +//! \param mask the mask buffer to XOR with the input buffer +//! \param count the size of the buffers, in bytes +//! \details The function effectively visits each element in the buffers and performs +//! output[i] = input[i] ^ mask[i]. output, input and mask must be of equal size. +CRYPTOPP_DLL void CRYPTOPP_API xorbuf(byte *output, const byte *input, const byte *mask, size_t count); + +//! \brief Performs a near constant-time comparison of two equally sized buffers +//! \param buf1 the first buffer +//! \param buf2 the second buffer +//! \param count the size of the buffers, in bytes +//! \details The function effectively performs an XOR of the elements in two equally sized buffers +//! and retruns a result based on the XOR operation. The function is near constant-time because +//! CPU micro-code timings could affect the "constant-ness". Calling code is responsible for +//! mitigating timing attacks if the buffers are \a not equally sized. +CRYPTOPP_DLL bool CRYPTOPP_API VerifyBufsEqual(const byte *buf1, const byte *buf2, size_t count); + +//! \brief Tests whether a value is a power of 2 +//! \param value the value to test +//! \returns true if value is a power of 2, false otherwise +//! \details The function creates a mask of value - 1 and returns the result of +//! an AND operation compared to 0. If value is 0 or less than 0, then the function returns false. +template +inline bool IsPowerOf2(const T &value) +{ + return value > 0 && (value & (value-1)) == 0; +} + +//! \brief Tests whether the residue of a value is a power of 2 +//! \param a the value to test +//! \param b the value to use to reduce \a to its residue +//! \returns true if a\%b is a power of 2, false otherwise +//! \details The function effectively creates a mask of b - 1 and returns the result of an +//! AND operation compared to 0. b must be a power of 2 or the result is undefined. +template +inline T2 ModPowerOf2(const T1 &a, const T2 &b) +{ + assert(IsPowerOf2(b)); + return T2(a) & (b-1); +} + +//! \brief Rounds a value down to a multiple of a second value +//! \param n the value to reduce +//! \param m the value to reduce \n to to a multiple +//! \returns the possibly unmodified value \n +//! \details RoundDownToMultipleOf is effectively a floor function based on m. The function returns +//! the value n - n\%m. If n is a multiple of m, then the original value is returned. +template +inline T1 RoundDownToMultipleOf(const T1 &n, const T2 &m) +{ + if (IsPowerOf2(m)) + return n - ModPowerOf2(n, m); + else + return n - n%m; +} + +//! \brief Rounds a value up to a multiple of a second value +//! \param n the value to reduce +//! \param m the value to reduce \n to to a multiple +//! \returns the possibly unmodified value \n +//! \details RoundUpToMultipleOf is effectively a ceiling function based on m. The function +//! returns the value n + n\%m. If n is a multiple of m, then the original value is +//! returned. If the value n would overflow, then an InvalidArgument exception is thrown. +template +inline T1 RoundUpToMultipleOf(const T1 &n, const T2 &m) +{ + if (n > (SIZE_MAX/sizeof(T1))-m-1) + throw InvalidArgument("RoundUpToMultipleOf: integer overflow"); + return RoundDownToMultipleOf(T1(n+m-1), m); +} + +//! \brief Returns the minimum alignment requirements of a type +//! \param dummy an unused Visual C++ 6.0 workaround +//! \returns the minimum alignment requirements of a type, in bytes +//! \details Internally the function calls C++11's alignof if available. If not available, the +//! function uses compiler specific extensions such as __alignof and _alignof_. sizeof(T) +//! is used if the others are not available. In all cases, if CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS +//! is defined, then the function returns 1. +template +inline unsigned int GetAlignmentOf(T *dummy=NULL) // VC60 workaround +{ +// GCC 4.6 (circa 2008) and above aggressively uses vectorization. +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) + if (sizeof(T) < 16) + return 1; +#endif + CRYPTOPP_UNUSED(dummy); +#if defined(CRYPTOPP_CXX11_ALIGNOF) + return alignof(T); +#elif (_MSC_VER >= 1300) + return __alignof(T); +#elif defined(__GNUC__) + return __alignof__(T); +#elif CRYPTOPP_BOOL_SLOW_WORD64 + return UnsignedMin(4U, sizeof(T)); +#else + return sizeof(T); +#endif +} + +//! \brief Determines whether ptr is aligned to a minimum value +//! \param ptr the pointer being checked for alignment +//! \param alignment the alignment value to test the pointer against +//! \returns true if ptr is aligned on at least align boundary +//! \details Internally the function tests whether alignment is 1. If so, the function returns true. +//! If not, then the function effectively performs a modular reduction and returns true if the residue is 0 +inline bool IsAlignedOn(const void *ptr, unsigned int alignment) +{ + return alignment==1 || (IsPowerOf2(alignment) ? ModPowerOf2((size_t)ptr, alignment) == 0 : (size_t)ptr % alignment == 0); +} + +//! \brief Determines whether ptr is minimally aligned +//! \param ptr the pointer to check for alignment +//! \param dummy an unused Visual C++ 6.0 workaround +//! \returns true if ptr follows native byte ordering, false otherwise +//! \details Internally the function calls IsAlignedOn with a second parameter of GetAlignmentOf +template +inline bool IsAligned(const void *ptr, T *dummy=NULL) // VC60 workaround +{ + CRYPTOPP_UNUSED(dummy); + return IsAlignedOn(ptr, GetAlignmentOf()); +} + +#if defined(IS_LITTLE_ENDIAN) + typedef LittleEndian NativeByteOrder; +#elif defined(IS_BIG_ENDIAN) + typedef BigEndian NativeByteOrder; +#else +# error "Unable to determine endian-ness" +#endif + +//! \brief Returns NativeByteOrder as an enumerated ByteOrder value +//! \returns LittleEndian if the native byte order is little-endian, and BigEndian if the + //! native byte order is big-endian +//! \details NativeByteOrder is a typedef depending on the platform. If IS_LITTLE_ENDIAN is + //! set in \headerfile config.h, then GetNativeByteOrder returns LittleEndian. If + //! IS_BIG_ENDIAN is set, then GetNativeByteOrder returns BigEndian. +//! \note There are other byte orders besides little- and big-endian, and they include bi-endian + //! and PDP-endian. If a system is neither little-endian nor big-endian, then a compile time error occurs. +inline ByteOrder GetNativeByteOrder() +{ + return NativeByteOrder::ToEnum(); +} + +//! \brief Determines whether order follows native byte ordering +//! \param order the ordering being tested against native byte ordering +//! \returns true if order follows native byte ordering, false otherwise +inline bool NativeByteOrderIs(ByteOrder order) +{ + return order == GetNativeByteOrder(); +} + +//! \brief Performs a saturating subtract clamped at 0 +//! \param a the minuend +//! \param b the subtrahend +//! \returns the difference produced by the saturating subtract +//! \details Saturating arithmetic restricts results to a fixed range. Results that are less than 0 are clamped at 0. +//! \details Use of saturating arithmetic in places can be advantageous because it can +//! avoid a branch by using an instruction like a conditional move (CMOVE). +template +inline T1 SaturatingSubtract(const T1 &a, const T2 &b) +{ + // Generated ASM of a typical clamp, http://gcc.gnu.org/ml/gcc-help/2014-10/msg00112.html + return T1((a > b) ? (a - b) : 0); +} + +//! \brief Performs a saturating subtract clamped at 1 +//! \param a the minuend +//! \param b the subtrahend +//! \returns the difference produced by the saturating subtract +//! \details Saturating arithmetic restricts results to a fixed range. Results that are less than 1 are clamped at 1. +//! \details Use of saturating arithmetic in places can be advantageous because it can +//! avoid a branch by using an instruction like a conditional move (CMOVE). +template +inline T1 SaturatingSubtract1(const T1 &a, const T2 &b) +{ + // Generated ASM of a typical clamp, http://gcc.gnu.org/ml/gcc-help/2014-10/msg00112.html + return T1((a > b) ? (a - b) : 1); +} + +//! \brief Returns the direction the cipher is being operated +//! \param obj the cipher object being queried +//! \returns /p ENCRYPTION if the cipher obj is being operated in its forward direction, +//! DECRYPTION otherwise +//! \details ciphers can be operated in a "forward" direction (encryption) and a "reverse" +//! direction (decryption). The operations do not have to be symmetric, meaning a second application +//! of the transformation does not necessariy return the original message. That is, E(D(m)) +//! may not equal E(E(m)); and D(E(m)) may not equal D(D(m)). +template +inline CipherDir GetCipherDir(const T &obj) +{ + return obj.IsForwardTransformation() ? ENCRYPTION : DECRYPTION; +} + +//! \brief Attempts to reclaim unused memory +//! \throws bad_alloc +//! \details In the normal course of running a program, a request for memory normally succeeds. If a +//! call to AlignedAllocate or UnalignedAllocate fails, then CallNewHandler is called in +//! an effort to recover. Internally, CallNewHandler calls set_new_handler(NULL) in an effort +//! to free memory. There is no guarantee CallNewHandler will be able to procure more memory so +//! an allocation succeeds. If the call to set_new_handler fails, then CallNewHandler throws +//! a bad_alloc exception. +CRYPTOPP_DLL void CRYPTOPP_API CallNewHandler(); + +//! \brief Performs an addition with carry on a block of bytes +//! \param inout the byte block +//! \param size the size of the block, in bytes +//! \details Performs an addition with carry by adding 1 on a block of bytes starting at the least +//! significant byte. Once carry is 0, the function terminates and returns to the caller. +//! \note The function is not constant time because it stops processing when the carry is 0. +inline void IncrementCounterByOne(byte *inout, unsigned int size) +{ + assert(inout != NULL); assert(size < INT_MAX); + for (int i=int(size-1), carry=1; i>=0 && carry; i--) + carry = !++inout[i]; +} + +//! \brief Performs an addition with carry on a block of bytes +//! \param output the destination block of bytes +//! \param input the source block of bytes +//! \param size the size of the block +//! \details Performs an addition with carry on a block of bytes starting at the least significant +//! byte. Once carry is 0, the remaining bytes from input are copied to output using memcpy. +//! \details The function is \a close to near-constant time because it operates on all the bytes in the blocks. +inline void IncrementCounterByOne(byte *output, const byte *input, unsigned int size) +{ + assert(output != NULL); assert(input != NULL); assert(size < INT_MAX); + + int i, carry; + for (i=int(size-1), carry=1; i>=0 && carry; i--) + carry = ((output[i] = input[i]+1) == 0); + memcpy_s(output, size, input, i+1); +} + +//! \brief Performs a branchless swap of values a and b if condition c is true +//! \param c the condition to perform the swap +//! \param a the first value +//! \param b the second value +template +inline void ConditionalSwap(bool c, T &a, T &b) +{ + T t = c * (a ^ b); + a ^= t; + b ^= t; +} + +//! \brief Performs a branchless swap of pointers a and b if condition c is true +//! \param c the condition to perform the swap +//! \param a the first pointer +//! \param b the second pointer +template +inline void ConditionalSwapPointers(bool c, T &a, T &b) +{ + ptrdiff_t t = size_t(c) * (a - b); + a -= t; + b += t; +} + +// see http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/protect-secrets.html +// and https://www.securecoding.cert.org/confluence/display/cplusplus/MSC06-CPP.+Be+aware+of+compiler+optimization+when+dealing+with+sensitive+data + +//! \brief Sets each element of an array to 0 +//! \param buf an array of elements +//! \param n the number of elements in the array +//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal +template +void SecureWipeBuffer(T *buf, size_t n) +{ + // GCC 4.3.2 on Cygwin optimizes away the first store if this loop is done in the forward direction + volatile T *p = buf+n; + while (n--) + *((volatile T*)(--p)) = 0; +} + +#if (_MSC_VER >= 1400 || defined(__GNUC__)) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86) + +//! \brief Sets each byte of an array to 0 +//! \param buf an array of bytes +//! \param n the number of elements in the array +//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal +template<> inline void SecureWipeBuffer(byte *buf, size_t n) +{ + volatile byte *p = buf; +#ifdef __GNUC__ + asm volatile("rep stosb" : "+c"(n), "+D"(p) : "a"(0) : "memory"); +#else + __stosb((byte *)(size_t)p, 0, n); +#endif +} + +//! \brief Sets each 16-bit element of an array to 0 +//! \param buf an array of 16-bit words +//! \param n the number of elements in the array +//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal +template<> inline void SecureWipeBuffer(word16 *buf, size_t n) +{ + volatile word16 *p = buf; +#ifdef __GNUC__ + asm volatile("rep stosw" : "+c"(n), "+D"(p) : "a"(0) : "memory"); +#else + __stosw((word16 *)(size_t)p, 0, n); +#endif +} + +//! \brief Sets each 32-bit element of an array to 0 +//! \param buf an array of 32-bit words +//! \param n the number of elements in the array +//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal +template<> inline void SecureWipeBuffer(word32 *buf, size_t n) +{ + volatile word32 *p = buf; +#ifdef __GNUC__ + asm volatile("rep stosl" : "+c"(n), "+D"(p) : "a"(0) : "memory"); +#else + __stosd((unsigned long *)(size_t)p, 0, n); +#endif +} + +//! \brief Sets each 64-bit element of an array to 0 +//! \param buf an array of 64-bit words +//! \param n the number of elements in the array +//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal +template<> inline void SecureWipeBuffer(word64 *buf, size_t n) +{ +#if CRYPTOPP_BOOL_X64 + volatile word64 *p = buf; +#ifdef __GNUC__ + asm volatile("rep stosq" : "+c"(n), "+D"(p) : "a"(0) : "memory"); +#else + __stosq((word64 *)(size_t)p, 0, n); +#endif +#else + SecureWipeBuffer((word32 *)buf, 2*n); +#endif +} + +#endif // #if (_MSC_VER >= 1400 || defined(__GNUC__)) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86) + +//! \brief Sets each element of an array to 0 +//! \param buf an array of elements +//! \param n the number of elements in the array +//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal +template +inline void SecureWipeArray(T *buf, size_t n) +{ + if (sizeof(T) % 8 == 0 && GetAlignmentOf() % GetAlignmentOf() == 0) + SecureWipeBuffer((word64 *)buf, n * (sizeof(T)/8)); + else if (sizeof(T) % 4 == 0 && GetAlignmentOf() % GetAlignmentOf() == 0) + SecureWipeBuffer((word32 *)buf, n * (sizeof(T)/4)); + else if (sizeof(T) % 2 == 0 && GetAlignmentOf() % GetAlignmentOf() == 0) + SecureWipeBuffer((word16 *)buf, n * (sizeof(T)/2)); + else + SecureWipeBuffer((byte *)buf, n * sizeof(T)); +} + +//! \brief Converts a wide character C-string to a multibyte string +//! \param str a C-string consiting of wide characters +//! \param throwOnError specifies the function should throw an InvalidArgument exception on error +//! \returns str converted to a multibyte string or an empty string. +//! \details This function converts a wide string to a string using C++ wcstombs under the executing +//! thread's locale. A locale must be set before using this function, and it can be set with setlocale. +//! Upon success, the converted string is returned. Upon failure with throwOnError as false, the +//! function returns an empty string. Upon failure with throwOnError as true, the function throws +//! InvalidArgument exception. +//! \note If you try to convert, say, the Chinese character for "bone" from UTF-16 (0x9AA8) to UTF-8 +//! (0xE9 0xAA 0xA8), then you should ensure the locales are available. If the locales are not available, +//! then a 0x21 error is returned which eventually results in an InvalidArgument exception +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +static inline std::string StringNarrow(const wchar_t *str, bool throwOnError = true) +#else +static std::string StringNarrow(const wchar_t *str, bool throwOnError = true) +#endif +{ + assert(str); + std::string result; + + // Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55 +#if (CRYPTOPP_MSC_VERSION >= 1400) + size_t len=0, size = 0; + errno_t err = 0; + + //const wchar_t* ptr = str; + //while (*ptr++) len++; + len = wcslen(str)+1; + + err = wcstombs_s(&size, NULL, 0, str, len*sizeof(wchar_t)); + assert(err == 0); + if (err != 0) {goto CONVERSION_ERROR;} + + result.resize(size); + err = wcstombs_s(&size, &result[0], size, str, len*sizeof(wchar_t)); + assert(err == 0); + + if (err != 0) + { +CONVERSION_ERROR: + if (throwOnError) + throw InvalidArgument("StringNarrow: wcstombs_s() call failed with error " + IntToString(err)); + else + return std::string(); + } + + // The safe routine's size includes the NULL. + if (!result.empty() && result[size - 1] == '\0') + result.erase(size - 1); +#else + size_t size = wcstombs(NULL, str, 0); + assert(size != (size_t)-1); + if (size == (size_t)-1) {goto CONVERSION_ERROR;} + + result.resize(size); + size = wcstombs(&result[0], str, size); + assert(size != (size_t)-1); + + if (size == (size_t)-1) + { +CONVERSION_ERROR: + if (throwOnError) + throw InvalidArgument("StringNarrow: wcstombs() call failed"); + else + return std::string(); + } +#endif + + return result; +} + +#ifdef CRYPTOPP_DOXYGEN_PROCESSING + +//! \brief Allocates a buffer on 16-byte boundary +//! \param size the size of the buffer +//! \details AlignedAllocate is primarily used when the data will be proccessed by MMX and SSE2 +//! instructions. The assembly language routines rely on the alignment. If the alignment is not +//! respected, then a SIGBUS is generated under Unix and an EXCEPTION_DATATYPE_MISALIGNMENT +//! is generated under Windows. +//! \note AlignedAllocate and AlignedDeallocate are available when CRYPTOPP_BOOL_ALIGN16 is +//! defined. CRYPTOPP_BOOL_ALIGN16 is defined in config.h +CRYPTOPP_DLL void* CRYPTOPP_API AlignedAllocate(size_t size); + +//! \brief Frees a buffer allocated with AlignedAllocate +//! \param ptr the buffer to free +//! \note AlignedAllocate and AlignedDeallocate are available when CRYPTOPP_BOOL_ALIGN16 is +//! defined. CRYPTOPP_BOOL_ALIGN16 is defined in config.h +CRYPTOPP_DLL void CRYPTOPP_API AlignedDeallocate(void *ptr); + +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +#if CRYPTOPP_BOOL_ALIGN16 +CRYPTOPP_DLL void* CRYPTOPP_API AlignedAllocate(size_t size); +CRYPTOPP_DLL void CRYPTOPP_API AlignedDeallocate(void *ptr); +#endif // CRYPTOPP_BOOL_ALIGN16 + +//! \brief Allocates a buffer +//! \param size the size of the buffer +CRYPTOPP_DLL void * CRYPTOPP_API UnalignedAllocate(size_t size); + +//! \brief Frees a buffer allocated with UnalignedAllocate +//! \param ptr the buffer to free +CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(void *ptr); + +// ************** rotate functions *************** + +//! \brief Performs a left rotate +//! \param x the value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. +//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! Use rotlMod if the rotate amount y is outside the range. +//! \note rotlFixed attempts to enlist a rotate IMM instruction because its often faster +//! than a rotate REG. Immediate rotates can be up to three times faster than their register +//! counterparts. +template inline T rotlFixed(T x, unsigned int y) +{ + // Portable rotate that reduces to single instruction... + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157, + // https://software.intel.com/en-us/forums/topic/580884 + // and https://llvm.org/bugs/show_bug.cgi?id=24226 + + static const unsigned int THIS_SIZE = sizeof(T)*8; + static const unsigned int MASK = THIS_SIZE-1; + + assert(y < THIS_SIZE); + return T((x<>(-y&MASK))); +} + +//! \brief Performs a right rotate +//! \param x the value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. +//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! Use rotrMod if the rotate amount y is outside the range. +//! \note rotrFixed attempts to enlist a rotate IMM instruction because its often faster +//! than a rotate REG. Immediate rotates can be up to three times faster than their register +//! counterparts. +template inline T rotrFixed(T x, unsigned int y) +{ + // Portable rotate that reduces to single instruction... + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157, + // https://software.intel.com/en-us/forums/topic/580884 + // and https://llvm.org/bugs/show_bug.cgi?id=24226 + static const unsigned int THIS_SIZE = sizeof(T)*8; + static const unsigned int MASK = THIS_SIZE-1; + assert(y < THIS_SIZE); + return T((x >> y)|(x<<(-y&MASK))); +} + +//! \brief Performs a left rotate +//! \param x the value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. +//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! Use rotlMod if the rotate amount y is outside the range. +//! \note rotlVariable attempts to enlist a rotate IMM instruction because its often faster +//! than a rotate REG. Immediate rotates can be up to three times faster than their register +//! counterparts. +template inline T rotlVariable(T x, unsigned int y) +{ + static const unsigned int THIS_SIZE = sizeof(T)*8; + static const unsigned int MASK = THIS_SIZE-1; + assert(y < THIS_SIZE); + return T((x<>(-y&MASK))); +} + +//! \brief Performs a right rotate +//! \param x the value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. +//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! Use rotrMod if the rotate amount y is outside the range. +//! \note rotrVariable attempts to enlist a rotate IMM instruction because its often faster +//! than a rotate REG. Immediate rotates can be up to three times faster than their register +//! counterparts. +template inline T rotrVariable(T x, unsigned int y) +{ + static const unsigned int THIS_SIZE = sizeof(T)*8; + static const unsigned int MASK = THIS_SIZE-1; + assert(y < THIS_SIZE); + return T((x>>y)|(x<<(-y&MASK))); +} + +//! \brief Performs a left rotate +//! \param x the value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. +//! \details y is reduced to the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrVariable will use either rotate IMM or rotate REG. +template inline T rotlMod(T x, unsigned int y) +{ + static const unsigned int THIS_SIZE = sizeof(T)*8; + static const unsigned int MASK = THIS_SIZE-1; + return T((x<<(y&MASK))|(x>>(-y&MASK))); +} + +//! \brief Performs a right rotate +//! \param x the value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. +//! \details y is reduced to the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrVariable will use either rotate IMM or rotate REG. +template inline T rotrMod(T x, unsigned int y) +{ + static const unsigned int THIS_SIZE = sizeof(T)*8; + static const unsigned int MASK = THIS_SIZE-1; + return T((x>>(y&MASK))|(x<<(-y&MASK))); +} + +#ifdef _MSC_VER + +//! \brief Performs a left rotate +//! \param x the 32-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile +//! . The value x to be rotated is 32-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotlFixed will assert in Debug builds if is outside the allowed range. +template<> inline word32 rotlFixed(word32 x, unsigned int y) +{ + // Uses Microsoft call, bound to C/C++ language rules. + assert(y < 8*sizeof(x)); + return y ? _lrotl(x, static_cast(y)) : x; +} + +//! \brief Performs a right rotate +//! \param x the 32-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile +//! . The value x to be rotated is 32-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrFixed will assert in Debug builds if is outside the allowed range. +template<> inline word32 rotrFixed(word32 x, unsigned int y) +{ + // Uses Microsoft call, bound to C/C++ language rules. + assert(y < 8*sizeof(x)); + return y ? _lrotr(x, static_cast(y)) : x; +} + +//! \brief Performs a left rotate +//! \param x the 32-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile +//! . The value x to be rotated is 32-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotlVariable will assert in Debug builds if is outside the allowed range. +template<> inline word32 rotlVariable(word32 x, unsigned int y) +{ + assert(y < 8*sizeof(x)); + return _lrotl(x, static_cast(y)); +} + +//! \brief Performs a right rotate +//! \param x the 32-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile +//! . The value x to be rotated is 32-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrVariable will assert in Debug builds if is outside the allowed range. +template<> inline word32 rotrVariable(word32 x, unsigned int y) +{ + assert(y < 8*sizeof(x)); + return _lrotr(x, static_cast(y)); +} + +//! \brief Performs a left rotate +//! \param x the 32-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile +//! . The value x to be rotated is 32-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +template<> inline word32 rotlMod(word32 x, unsigned int y) +{ + y %= 8*sizeof(x); + return _lrotl(x, static_cast(y)); +} + +//! \brief Performs a right rotate +//! \param x the 32-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile +//! . The value x to be rotated is 32-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +template<> inline word32 rotrMod(word32 x, unsigned int y) +{ + y %= 8*sizeof(x); + return _lrotr(x, static_cast(y)); +} + +#endif // #ifdef _MSC_VER + +#if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER) +// Intel C++ Compiler 10.0 calls a function instead of using the rotate instruction when using these instructions + +//! \brief Performs a left rotate +//! \param x the 64-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile +//! . The value x to be rotated is 64-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrFixed will assert in Debug builds if is outside the allowed range. +template<> inline word64 rotlFixed(word64 x, unsigned int y) +{ + // Uses Microsoft call, bound to C/C++ language rules. + assert(y < 8*sizeof(x)); + return y ? _rotl64(x, static_cast(y)) : x; +} + +//! \brief Performs a right rotate +//! \param x the 64-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile +//! . The value x to be rotated is 64-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrFixed will assert in Debug builds if is outside the allowed range. +template<> inline word64 rotrFixed(word64 x, unsigned int y) +{ + // Uses Microsoft call, bound to C/C++ language rules. + assert(y < 8*sizeof(x)); + return y ? _rotr64(x, static_cast(y)) : x; +} + +//! \brief Performs a left rotate +//! \param x the 64-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile +//! . The value x to be rotated is 64-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotlVariable will assert in Debug builds if is outside the allowed range. +template<> inline word64 rotlVariable(word64 x, unsigned int y) +{ + assert(y < 8*sizeof(x)); + return _rotl64(x, static_cast(y)); +} + +//! \brief Performs a right rotate +//! \param x the 64-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile +//! . The value x to be rotated is 64-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +//! \note rotrVariable will assert in Debug builds if is outside the allowed range. +template<> inline word64 rotrVariable(word64 x, unsigned int y) +{ + assert(y < 8*sizeof(x)); + return y ? _rotr64(x, static_cast(y)) : x; +} + +//! \brief Performs a left rotate +//! \param x the 64-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile +//! . The value x to be rotated is 64-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +template<> inline word64 rotlMod(word64 x, unsigned int y) +{ + assert(y < 8*sizeof(x)); + return y ? _rotl64(x, static_cast(y)) : x; +} + +//! \brief Performs a right rotate +//! \param x the 64-bit value to rotate +//! \param y the number of bit positions to rotate the value +//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile +//! . The value x to be rotated is 64-bits. y must be in the range +//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. +template<> inline word64 rotrMod(word64 x, unsigned int y) +{ + assert(y < 8*sizeof(x)); + return y ? _rotr64(x, static_cast(y)) : x; +} + +#endif // #if _MSC_VER >= 1310 + +#if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) +// Intel C++ Compiler 10.0 gives undefined externals with these + +template<> inline word16 rotlFixed(word16 x, unsigned int y) +{ + // Intrinsic, not bound to C/C++ language rules. + return _rotl16(x, static_cast(y)); +} + +template<> inline word16 rotrFixed(word16 x, unsigned int y) +{ + // Intrinsic, not bound to C/C++ language rules. + return _rotr16(x, static_cast(y)); +} + +template<> inline word16 rotlVariable(word16 x, unsigned int y) +{ + return _rotl16(x, static_cast(y)); +} + +template<> inline word16 rotrVariable(word16 x, unsigned int y) +{ + return _rotr16(x, static_cast(y)); +} + +template<> inline word16 rotlMod(word16 x, unsigned int y) +{ + return _rotl16(x, static_cast(y)); +} + +template<> inline word16 rotrMod(word16 x, unsigned int y) +{ + return _rotr16(x, static_cast(y)); +} + +template<> inline byte rotlFixed(byte x, unsigned int y) +{ + // Intrinsic, not bound to C/C++ language rules. + return _rotl8(x, static_cast(y)); +} + +template<> inline byte rotrFixed(byte x, unsigned int y) +{ + // Intrinsic, not bound to C/C++ language rules. + return _rotr8(x, static_cast(y)); +} + +template<> inline byte rotlVariable(byte x, unsigned int y) +{ + return _rotl8(x, static_cast(y)); +} + +template<> inline byte rotrVariable(byte x, unsigned int y) +{ + return _rotr8(x, static_cast(y)); +} + +template<> inline byte rotlMod(byte x, unsigned int y) +{ + return _rotl8(x, static_cast(y)); +} + +template<> inline byte rotrMod(byte x, unsigned int y) +{ + return _rotr8(x, static_cast(y)); +} + +#endif // #if _MSC_VER >= 1400 + +#if (defined(__MWERKS__) && TARGET_CPU_PPC) + +template<> inline word32 rotlFixed(word32 x, unsigned int y) +{ + assert(y < 32); + return y ? __rlwinm(x,y,0,31) : x; +} + +template<> inline word32 rotrFixed(word32 x, unsigned int y) +{ + assert(y < 32); + return y ? __rlwinm(x,32-y,0,31) : x; +} + +template<> inline word32 rotlVariable(word32 x, unsigned int y) +{ + assert(y < 32); + return (__rlwnm(x,y,0,31)); +} + +template<> inline word32 rotrVariable(word32 x, unsigned int y) +{ + assert(y < 32); + return (__rlwnm(x,32-y,0,31)); +} + +template<> inline word32 rotlMod(word32 x, unsigned int y) +{ + return (__rlwnm(x,y,0,31)); +} + +template<> inline word32 rotrMod(word32 x, unsigned int y) +{ + return (__rlwnm(x,32-y,0,31)); +} + +#endif // #if (defined(__MWERKS__) && TARGET_CPU_PPC) + +// ************** endian reversal *************** + +//! \brief Gets a byte from a value +//! \param order the ByteOrder of the value +//! \param value the value to retrieve the byte +//! \param index the location of the byte to retrieve +template +inline unsigned int GetByte(ByteOrder order, T value, unsigned int index) +{ + if (order == LITTLE_ENDIAN_ORDER) + return GETBYTE(value, index); + else + return GETBYTE(value, sizeof(T)-index-1); +} + +//! \brief Reverses bytes in a 8-bit value +//! \param value the 8-bit value to reverse +//! \note ByteReverse returns the value passed to it since there is nothing to reverse +inline byte ByteReverse(byte value) +{ + return value; +} + +//! \brief Reverses bytes in a 16-bit value +//! \brief Performs an endian reversal +//! \param value the 16-bit value to reverse +//! \details ByteReverse calls bswap if available. Otherwise the function performs a 8-bit rotate on the word16 +inline word16 ByteReverse(word16 value) +{ +#ifdef CRYPTOPP_BYTESWAP_AVAILABLE + return bswap_16(value); +#elif defined(_MSC_VER) && _MSC_VER >= 1300 + return _byteswap_ushort(value); +#else + return rotlFixed(value, 8U); +#endif +} + +//! \brief Reverses bytes in a 32-bit value +//! \brief Performs an endian reversal +//! \param value the 32-bit value to reverse +//! \details ByteReverse calls bswap if available. Otherwise the function uses a combination of rotates on the word32 +inline word32 ByteReverse(word32 value) +{ +#if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE) + __asm__ ("bswap %0" : "=r" (value) : "0" (value)); + return value; +#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE) + return bswap_32(value); +#elif defined(__MWERKS__) && TARGET_CPU_PPC + return (word32)__lwbrx(&value,0); +#elif _MSC_VER >= 1400 || (_MSC_VER >= 1300 && !defined(_DLL)) + return _byteswap_ulong(value); +#elif CRYPTOPP_FAST_ROTATE(32) + // 5 instructions with rotate instruction, 9 without + return (rotrFixed(value, 8U) & 0xff00ff00) | (rotlFixed(value, 8U) & 0x00ff00ff); +#else + // 6 instructions with rotate instruction, 8 without + value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); + return rotlFixed(value, 16U); +#endif +} + +//! \brief Reverses bytes in a 64-bit value +//! \brief Performs an endian reversal +//! \param value the 64-bit value to reverse +//! \details ByteReverse calls bswap if available. Otherwise the function uses a combination of rotates on the word64 +inline word64 ByteReverse(word64 value) +{ +#if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE) && defined(__x86_64__) + __asm__ ("bswap %0" : "=r" (value) : "0" (value)); + return value; +#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE) + return bswap_64(value); +#elif defined(_MSC_VER) && _MSC_VER >= 1300 + return _byteswap_uint64(value); +#elif CRYPTOPP_BOOL_SLOW_WORD64 + return (word64(ByteReverse(word32(value))) << 32) | ByteReverse(word32(value>>32)); +#else + value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | ((value & W64LIT(0x00FF00FF00FF00FF)) << 8); + value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | ((value & W64LIT(0x0000FFFF0000FFFF)) << 16); + return rotlFixed(value, 32U); +#endif +} + +//! \brief Reverses bits in a 8-bit value +//! \param value the 8-bit value to reverse +//! \details BitReverse performs a combination of shifts on the byte +inline byte BitReverse(byte value) +{ + value = ((value & 0xAA) >> 1) | ((value & 0x55) << 1); + value = ((value & 0xCC) >> 2) | ((value & 0x33) << 2); + return rotlFixed(value, 4U); +} + +//! \brief Reverses bits in a 16-bit value +//! \param value the 16-bit value to reverse +//! \details BitReverse performs a combination of shifts on the word16 +inline word16 BitReverse(word16 value) +{ + value = ((value & 0xAAAA) >> 1) | ((value & 0x5555) << 1); + value = ((value & 0xCCCC) >> 2) | ((value & 0x3333) << 2); + value = ((value & 0xF0F0) >> 4) | ((value & 0x0F0F) << 4); + return ByteReverse(value); +} + +//! \brief Reverses bits in a 32-bit value +//! \param value the 32-bit value to reverse +//! \details BitReverse performs a combination of shifts on the word32 +inline word32 BitReverse(word32 value) +{ + value = ((value & 0xAAAAAAAA) >> 1) | ((value & 0x55555555) << 1); + value = ((value & 0xCCCCCCCC) >> 2) | ((value & 0x33333333) << 2); + value = ((value & 0xF0F0F0F0) >> 4) | ((value & 0x0F0F0F0F) << 4); + return ByteReverse(value); +} + +//! \brief Reverses bits in a 64-bit value +//! \param value the 64-bit value to reverse +//! \details BitReverse performs a combination of shifts on the word64 +inline word64 BitReverse(word64 value) +{ +#if CRYPTOPP_BOOL_SLOW_WORD64 + return (word64(BitReverse(word32(value))) << 32) | BitReverse(word32(value>>32)); +#else + value = ((value & W64LIT(0xAAAAAAAAAAAAAAAA)) >> 1) | ((value & W64LIT(0x5555555555555555)) << 1); + value = ((value & W64LIT(0xCCCCCCCCCCCCCCCC)) >> 2) | ((value & W64LIT(0x3333333333333333)) << 2); + value = ((value & W64LIT(0xF0F0F0F0F0F0F0F0)) >> 4) | ((value & W64LIT(0x0F0F0F0F0F0F0F0F)) << 4); + return ByteReverse(value); +#endif +} + +//! \brief Reverses bits in a value +//! \param value the value to reverse +//! \details The template overload of BitReverse operates on signed and unsigned values. +//! Internally the size of T is checked, and then value is cast to a byte, +//! word16, word32 or word64. After the cast, the appropriate BitReverse +//! overload is called. +template +inline T BitReverse(T value) +{ + if (sizeof(T) == 1) + return (T)BitReverse((byte)value); + else if (sizeof(T) == 2) + return (T)BitReverse((word16)value); + else if (sizeof(T) == 4) + return (T)BitReverse((word32)value); + else + { + assert(sizeof(T) == 8); + return (T)BitReverse((word64)value); + } +} + +//! \brief Reverses bytes in a value depending upon endianess +//! \tparam T the class or type +//! \param order the ByteOrder the data is represented +//! \param value the value to conditionally reverse +//! \details Internally, the ConditionalByteReverse calls NativeByteOrderIs. +//! If order matches native byte order, then the original value is returned. +//! If not, then ByteReverse is called on the value before returning to the caller. +template +inline T ConditionalByteReverse(ByteOrder order, T value) +{ + return NativeByteOrderIs(order) ? value : ByteReverse(value); +} + +//! \brief Reverses bytes in an element among an array of elements +//! \tparam T the class or type +//! \param out the output array of elements +//! \param in the input array of elements +//! \param byteCount the byte count of the arrays +//! \details Internally, ByteReverse visits each element in the in array +//! calls ByteReverse on it, and writes the result to out. +//! \details ByteReverse does not process tail byes, or bytes that are +//! \a not part of a full element. If T is int (and int is 4 bytes), then +//! byteCount = 10 means only the first 8 bytes are reversed. +//! \note ByteReverse uses the number of bytes in the arrays, and not the count +//! of elements in the arrays. +template +void ByteReverse(T *out, const T *in, size_t byteCount) +{ + assert(byteCount % sizeof(T) == 0); + size_t count = byteCount/sizeof(T); + for (size_t i=0; ibyteCount = 10 means only the first 8 bytes are reversed. +//! \note ByteReverse uses the number of bytes in the arrays, and not the count +//! of elements in the arrays. +template +inline void ConditionalByteReverse(ByteOrder order, T *out, const T *in, size_t byteCount) +{ + if (!NativeByteOrderIs(order)) + ByteReverse(out, in, byteCount); + else if (in != out) + memcpy_s(out, byteCount, in, byteCount); +} + +template +inline void GetUserKey(ByteOrder order, T *out, size_t outlen, const byte *in, size_t inlen) +{ + const size_t U = sizeof(T); + assert(inlen <= outlen*U); + memcpy_s(out, outlen*U, in, inlen); + memset_z((byte *)out+inlen, 0, outlen*U-inlen); + ConditionalByteReverse(order, out, out, RoundUpToMultipleOf(inlen, U)); +} + +#ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS +inline byte UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const byte *) +{ + CRYPTOPP_UNUSED(order); + return block[0]; +} + +inline word16 UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const word16 *) +{ + return (order == BIG_ENDIAN_ORDER) + ? block[1] | (block[0] << 8) + : block[0] | (block[1] << 8); +} + +inline word32 UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const word32 *) +{ + return (order == BIG_ENDIAN_ORDER) + ? word32(block[3]) | (word32(block[2]) << 8) | (word32(block[1]) << 16) | (word32(block[0]) << 24) + : word32(block[0]) | (word32(block[1]) << 8) | (word32(block[2]) << 16) | (word32(block[3]) << 24); +} + +inline word64 UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const word64 *) +{ + return (order == BIG_ENDIAN_ORDER) + ? + (word64(block[7]) | + (word64(block[6]) << 8) | + (word64(block[5]) << 16) | + (word64(block[4]) << 24) | + (word64(block[3]) << 32) | + (word64(block[2]) << 40) | + (word64(block[1]) << 48) | + (word64(block[0]) << 56)) + : + (word64(block[0]) | + (word64(block[1]) << 8) | + (word64(block[2]) << 16) | + (word64(block[3]) << 24) | + (word64(block[4]) << 32) | + (word64(block[5]) << 40) | + (word64(block[6]) << 48) | + (word64(block[7]) << 56)); +} + +inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, byte value, const byte *xorBlock) +{ + CRYPTOPP_UNUSED(order); + block[0] = xorBlock ? (value ^ xorBlock[0]) : value; +} + +inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, word16 value, const byte *xorBlock) +{ + if (order == BIG_ENDIAN_ORDER) + { + if (xorBlock) + { + block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + } + else + { + block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + } + } + else + { + if (xorBlock) + { + block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + } + else + { + block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + } + } +} + +inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, word32 value, const byte *xorBlock) +{ + if (order == BIG_ENDIAN_ORDER) + { + if (xorBlock) + { + block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + } + else + { + block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + } + } + else + { + if (xorBlock) + { + block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + } + else + { + block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + } + } +} + +inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, word64 value, const byte *xorBlock) +{ + if (order == BIG_ENDIAN_ORDER) + { + if (xorBlock) + { + block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); + block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); + block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); + block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); + block[4] = xorBlock[4] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + block[5] = xorBlock[5] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[6] = xorBlock[6] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[7] = xorBlock[7] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + } + else + { + block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); + block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); + block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); + block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); + block[4] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + block[5] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[6] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[7] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + } + } + else + { + if (xorBlock) + { + block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + block[4] = xorBlock[4] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); + block[5] = xorBlock[5] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); + block[6] = xorBlock[6] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); + block[7] = xorBlock[7] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); + } + else + { + block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); + block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); + block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); + block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); + block[4] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); + block[5] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); + block[6] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); + block[7] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); + } + } +} +#endif // #ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS + +template +inline T GetWord(bool assumeAligned, ByteOrder order, const byte *block) +{ +//#ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS +// if (!assumeAligned) +// return UnalignedGetWordNonTemplate(order, block, (T*)NULL); +// assert(IsAligned(block)); +//#endif +// return ConditionalByteReverse(order, *reinterpret_cast(block)); + CRYPTOPP_UNUSED(assumeAligned); +#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS + return ConditionalByteReverse(order, *reinterpret_cast(block)); +#else + T temp; + memcpy(&temp, block, sizeof(T)); + return ConditionalByteReverse(order, temp); +#endif +} + +template +inline void GetWord(bool assumeAligned, ByteOrder order, T &result, const byte *block) +{ + result = GetWord(assumeAligned, order, block); +} + +template +inline void PutWord(bool assumeAligned, ByteOrder order, byte *block, T value, const byte *xorBlock = NULL) +{ +//#ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS +// if (!assumeAligned) +// return UnalignedbyteNonTemplate(order, block, value, xorBlock); +// assert(IsAligned(block)); +// assert(IsAligned(xorBlock)); +//#endif +// *reinterpret_cast(block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast(xorBlock) : 0); + CRYPTOPP_UNUSED(assumeAligned); +#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS + *reinterpret_cast(block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast(xorBlock) : 0); +#else + T t1, t2 = 0; + t1 = ConditionalByteReverse(order, value); + if (xorBlock) memcpy(&t2, xorBlock, sizeof(T)); + memmove(block, &(t1 ^= t2), sizeof(T)); +#endif +} + +template +class GetBlock +{ +public: + GetBlock(const void *block) + : m_block((const byte *)block) {} + + template + inline GetBlock & operator()(U &x) + { + CRYPTOPP_COMPILE_ASSERT(sizeof(U) >= sizeof(T)); + x = GetWord(A, B::ToEnum(), m_block); + m_block += sizeof(T); + return *this; + } + +private: + const byte *m_block; +}; + +template +class PutBlock +{ +public: + PutBlock(const void *xorBlock, void *block) + : m_xorBlock((const byte *)xorBlock), m_block((byte *)block) {} + + template + inline PutBlock & operator()(U x) + { + PutWord(A, B::ToEnum(), m_block, (T)x, m_xorBlock); + m_block += sizeof(T); + if (m_xorBlock) + m_xorBlock += sizeof(T); + return *this; + } + +private: + const byte *m_xorBlock; + byte *m_block; +}; + +template +struct BlockGetAndPut +{ + // function needed because of C++ grammatical ambiguity between expression-statements and declarations + static inline GetBlock Get(const void *block) {return GetBlock(block);} + typedef PutBlock Put; +}; + +template +std::string WordToString(T value, ByteOrder order = BIG_ENDIAN_ORDER) +{ + if (!NativeByteOrderIs(order)) + value = ByteReverse(value); + + return std::string((char *)&value, sizeof(value)); +} + +template +T StringToWord(const std::string &str, ByteOrder order = BIG_ENDIAN_ORDER) +{ + T value = 0; + memcpy_s(&value, sizeof(value), str.data(), UnsignedMin(str.size(), sizeof(value))); + return NativeByteOrderIs(order) ? value : ByteReverse(value); +} + +// ************** help remove warning on g++ *************** + +template struct SafeShifter; + +template<> struct SafeShifter +{ + template + static inline T RightShift(T value, unsigned int bits) + { + CRYPTOPP_UNUSED(value); CRYPTOPP_UNUSED(bits); + return 0; + } + + template + static inline T LeftShift(T value, unsigned int bits) + { + CRYPTOPP_UNUSED(value); CRYPTOPP_UNUSED(bits); + return 0; + } +}; + +template<> struct SafeShifter +{ + template + static inline T RightShift(T value, unsigned int bits) + { + return value >> bits; + } + + template + static inline T LeftShift(T value, unsigned int bits) + { + return value << bits; + } +}; + +template +inline T SafeRightShift(T value) +{ + return SafeShifter<(bits>=(8*sizeof(T)))>::RightShift(value, bits); +} + +template +inline T SafeLeftShift(T value) +{ + return SafeShifter<(bits>=(8*sizeof(T)))>::LeftShift(value, bits); +} + +// ************** use one buffer for multiple data members *************** + +#define CRYPTOPP_BLOCK_1(n, t, s) t* m_##n() {return (t *)(m_aggregate+0);} size_t SS1() {return sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_2(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS1());} size_t SS2() {return SS1()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_3(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS2());} size_t SS3() {return SS2()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_4(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS3());} size_t SS4() {return SS3()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_5(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS4());} size_t SS5() {return SS4()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_6(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS5());} size_t SS6() {return SS5()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_7(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS6());} size_t SS7() {return SS6()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCK_8(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS7());} size_t SS8() {return SS7()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} +#define CRYPTOPP_BLOCKS_END(i) size_t SST() {return SS##i();} void AllocateBlocks() {m_aggregate.New(SST());} AlignedSecByteBlock m_aggregate; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/modarith.h b/external/crypto++-5.6.3/modarith.h new file mode 100644 index 000000000..01ee37c97 --- /dev/null +++ b/external/crypto++-5.6.3/modarith.h @@ -0,0 +1,177 @@ +// modarith.h - written and placed in the public domain by Wei Dai + +//! \file modarith.h +//! \brief Class file for performing modular arithmetic. + +#ifndef CRYPTOPP_MODARITH_H +#define CRYPTOPP_MODARITH_H + +// implementations are in integer.cpp + +#include "cryptlib.h" +#include "integer.h" +#include "algebra.h" +#include "secblock.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup; +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing; +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain; + +//! \class ModularArithmetic +//! \brief Ring of congruence classes modulo n +//! \note this implementation represents each congruence class as the smallest +//! non-negative integer in that class +class CRYPTOPP_DLL ModularArithmetic : public AbstractRing +{ +public: + + typedef int RandomizationParameter; + typedef Integer Element; + + ModularArithmetic(const Integer &modulus = Integer::One()) + : AbstractRing(), m_modulus(modulus), m_result((word)0, modulus.reg.size()) {} + ModularArithmetic(const ModularArithmetic &ma) + : AbstractRing(), m_modulus(ma.m_modulus), m_result((word)0, ma.m_modulus.reg.size()) {} + + ModularArithmetic(BufferedTransformation &bt); // construct from BER encoded parameters + + virtual ModularArithmetic * Clone() const {return new ModularArithmetic(*this);} + + void DEREncode(BufferedTransformation &bt) const; + + void DEREncodeElement(BufferedTransformation &out, const Element &a) const; + void BERDecodeElement(BufferedTransformation &in, Element &a) const; + + const Integer& GetModulus() const {return m_modulus;} + void SetModulus(const Integer &newModulus) + {m_modulus = newModulus; m_result.reg.resize(m_modulus.reg.size());} + + virtual bool IsMontgomeryRepresentation() const {return false;} + + virtual Integer ConvertIn(const Integer &a) const + {return a%m_modulus;} + + virtual Integer ConvertOut(const Integer &a) const + {return a;} + + const Integer& Half(const Integer &a) const; + + bool Equal(const Integer &a, const Integer &b) const + {return a==b;} + + const Integer& Identity() const + {return Integer::Zero();} + + const Integer& Add(const Integer &a, const Integer &b) const; + + Integer& Accumulate(Integer &a, const Integer &b) const; + + const Integer& Inverse(const Integer &a) const; + + const Integer& Subtract(const Integer &a, const Integer &b) const; + + Integer& Reduce(Integer &a, const Integer &b) const; + + const Integer& Double(const Integer &a) const + {return Add(a, a);} + + const Integer& MultiplicativeIdentity() const + {return Integer::One();} + + const Integer& Multiply(const Integer &a, const Integer &b) const + {return m_result1 = a*b%m_modulus;} + + const Integer& Square(const Integer &a) const + {return m_result1 = a.Squared()%m_modulus;} + + bool IsUnit(const Integer &a) const + {return Integer::Gcd(a, m_modulus).IsUnit();} + + const Integer& MultiplicativeInverse(const Integer &a) const + {return m_result1 = a.InverseMod(m_modulus);} + + const Integer& Divide(const Integer &a, const Integer &b) const + {return Multiply(a, MultiplicativeInverse(b));} + + Integer CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const; + + void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; + + unsigned int MaxElementBitLength() const + {return (m_modulus-1).BitCount();} + + unsigned int MaxElementByteLength() const + {return (m_modulus-1).ByteCount();} + + Element RandomElement( RandomNumberGenerator &rng , const RandomizationParameter &ignore_for_now = 0 ) const + // left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct + { + CRYPTOPP_UNUSED(ignore_for_now); + return Element(rng, Integer::Zero(), m_modulus - Integer::One()) ; + } + + bool operator==(const ModularArithmetic &rhs) const + {return m_modulus == rhs.m_modulus;} + + static const RandomizationParameter DefaultRandomizationParameter ; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~ModularArithmetic() {} +#endif + +protected: + Integer m_modulus; + mutable Integer m_result, m_result1; + +}; + +// const ModularArithmetic::RandomizationParameter ModularArithmetic::DefaultRandomizationParameter = 0 ; + +//! \class MontgomeryRepresentation +//! \brief Performs modular arithmetic in Montgomery representation for increased speed +//! \details The Montgomery representation represents each congruence class [a] as +//! a*r%n, where r is a convenient power of 2. +class CRYPTOPP_DLL MontgomeryRepresentation : public ModularArithmetic +{ +public: + MontgomeryRepresentation(const Integer &modulus); // modulus must be odd + + virtual ModularArithmetic * Clone() const {return new MontgomeryRepresentation(*this);} + + bool IsMontgomeryRepresentation() const {return true;} + + Integer ConvertIn(const Integer &a) const + {return (a<<(WORD_BITS*m_modulus.reg.size()))%m_modulus;} + + Integer ConvertOut(const Integer &a) const; + + const Integer& MultiplicativeIdentity() const + {return m_result1 = Integer::Power2(WORD_BITS*m_modulus.reg.size())%m_modulus;} + + const Integer& Multiply(const Integer &a, const Integer &b) const; + + const Integer& Square(const Integer &a) const; + + const Integer& MultiplicativeInverse(const Integer &a) const; + + Integer CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const + {return AbstractRing::CascadeExponentiate(x, e1, y, e2);} + + void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const + {AbstractRing::SimultaneousExponentiate(results, base, exponents, exponentsCount);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~MontgomeryRepresentation() {} +#endif + +private: + Integer m_u; + mutable IntegerSecBlock m_workspace; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/modes.cpp b/external/crypto++-5.6.3/modes.cpp new file mode 100644 index 000000000..60fef0e6e --- /dev/null +++ b/external/crypto++-5.6.3/modes.cpp @@ -0,0 +1,280 @@ +// modes.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "modes.h" +#include "misc.h" + +#ifndef NDEBUG +#include "des.h" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void Modes_TestInstantiations() +{ + CFB_Mode::Encryption m0; + CFB_Mode::Decryption m1; + OFB_Mode::Encryption m2; + CTR_Mode::Encryption m3; + ECB_Mode::Encryption m4; + CBC_Mode::Encryption m5; +} +#endif + +// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +void CipherModeBase::ResizeBuffers() +{ + m_register.New(m_cipher->BlockSize()); +} +#endif + +void CFB_ModePolicy::Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount) +{ + assert(input); + assert(output); + assert(m_cipher->IsForwardTransformation()); // CFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt + assert(m_feedbackSize == BlockSize()); + + const unsigned int s = BlockSize(); + if (dir == ENCRYPTION) + { + m_cipher->ProcessAndXorBlock(m_register, input, output); + if (iterationCount > 1) + m_cipher->AdvancedProcessBlocks(output, input+s, output+s, (iterationCount-1)*s, 0); + memcpy(m_register, output+(iterationCount-1)*s, s); + } + else + { + memcpy(m_temp, input+(iterationCount-1)*s, s); // make copy first in case of in-place decryption + if (iterationCount > 1) + m_cipher->AdvancedProcessBlocks(input, input+s, output+s, (iterationCount-1)*s, BlockTransformation::BT_ReverseDirection); + m_cipher->ProcessAndXorBlock(m_register, input, output); + memcpy(m_register, m_temp, s); + } +} + +void CFB_ModePolicy::TransformRegister() +{ + assert(m_cipher->IsForwardTransformation()); // CFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt + m_cipher->ProcessBlock(m_register, m_temp); + unsigned int updateSize = BlockSize()-m_feedbackSize; + memmove_s(m_register, m_register.size(), m_register+m_feedbackSize, updateSize); + memcpy_s(m_register+updateSize, m_register.size()-updateSize, m_temp, m_feedbackSize); +} + +void CFB_ModePolicy::CipherResynchronize(const byte *iv, size_t length) +{ + assert(length == BlockSize()); + CopyOrZero(m_register, iv, length); + TransformRegister(); +} + +void CFB_ModePolicy::SetFeedbackSize(unsigned int feedbackSize) +{ + if (feedbackSize > BlockSize()) + throw InvalidArgument("CFB_Mode: invalid feedback size"); + m_feedbackSize = feedbackSize ? feedbackSize : BlockSize(); +} + +void CFB_ModePolicy::ResizeBuffers() +{ + CipherModeBase::ResizeBuffers(); + m_temp.New(BlockSize()); +} + +void OFB_ModePolicy::WriteKeystream(byte *keystreamBuffer, size_t iterationCount) +{ + assert(m_cipher->IsForwardTransformation()); // OFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt + unsigned int s = BlockSize(); + m_cipher->ProcessBlock(m_register, keystreamBuffer); + if (iterationCount > 1) + m_cipher->AdvancedProcessBlocks(keystreamBuffer, NULL, keystreamBuffer+s, s*(iterationCount-1), 0); + memcpy(m_register, keystreamBuffer+s*(iterationCount-1), s); +} + +void OFB_ModePolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); + assert(length == BlockSize()); + + CopyOrZero(m_register, iv, length); +} + +void CTR_ModePolicy::SeekToIteration(lword iterationCount) +{ + int carry=0; + for (int i=BlockSize()-1; i>=0; i--) + { + unsigned int sum = m_register[i] + byte(iterationCount) + carry; + m_counterArray[i] = (byte) sum; + carry = sum >> 8; + iterationCount >>= 8; + } +} + +void CTR_ModePolicy::IncrementCounterBy256() +{ + IncrementCounterByOne(m_counterArray, BlockSize()-1); +} + +void CTR_ModePolicy::OperateKeystream(KeystreamOperation /*operation*/, byte *output, const byte *input, size_t iterationCount) +{ + assert(m_cipher->IsForwardTransformation()); // CTR mode needs the "encrypt" direction of the underlying block cipher, even to decrypt + unsigned int s = BlockSize(); + unsigned int inputIncrement = input ? s : 0; + + while (iterationCount) + { + byte lsb = m_counterArray[s-1]; + size_t blocks = UnsignedMin(iterationCount, 256U-lsb); + m_cipher->AdvancedProcessBlocks(m_counterArray, input, output, blocks*s, BlockTransformation::BT_InBlockIsCounter|BlockTransformation::BT_AllowParallel); + if ((m_counterArray[s-1] = lsb + (byte)blocks) == 0) + IncrementCounterBy256(); + + output += blocks*s; + input += blocks*inputIncrement; + iterationCount -= blocks; + } +} + +void CTR_ModePolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); + assert(length == BlockSize()); + + CopyOrZero(m_register, iv, length); + m_counterArray = m_register; +} + +void BlockOrientedCipherModeBase::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + m_cipher->SetKey(key, length, params); + ResizeBuffers(); + if (IsResynchronizable()) + { + size_t ivLength; + const byte *iv = GetIVAndThrowIfInvalid(params, ivLength); + Resynchronize(iv, (int)ivLength); + } +} + +// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +void BlockOrientedCipherModeBase::ResizeBuffers() +{ + CipherModeBase::ResizeBuffers(); + m_buffer.New(BlockSize()); +} +#endif + +void ECB_OneWay::ProcessData(byte *outString, const byte *inString, size_t length) +{ + assert(length%BlockSize()==0); + m_cipher->AdvancedProcessBlocks(inString, NULL, outString, length, BlockTransformation::BT_AllowParallel); +} + +void CBC_Encryption::ProcessData(byte *outString, const byte *inString, size_t length) +{ + if (!length) + return; + assert(length%BlockSize()==0); + + unsigned int blockSize = BlockSize(); + m_cipher->AdvancedProcessBlocks(inString, m_register, outString, blockSize, BlockTransformation::BT_XorInput); + if (length > blockSize) + m_cipher->AdvancedProcessBlocks(inString+blockSize, outString, outString+blockSize, length-blockSize, BlockTransformation::BT_XorInput); + memcpy(m_register, outString + length - blockSize, blockSize); +} + +void CBC_CTS_Encryption::ProcessLastBlock(byte *outString, const byte *inString, size_t length) +{ + if (length <= BlockSize()) + { + if (!m_stolenIV) + throw InvalidArgument("CBC_Encryption: message is too short for ciphertext stealing"); + + // steal from IV + memcpy(outString, m_register, length); + outString = m_stolenIV; + } + else + { + // steal from next to last block + xorbuf(m_register, inString, BlockSize()); + m_cipher->ProcessBlock(m_register); + inString += BlockSize(); + length -= BlockSize(); + memcpy(outString+BlockSize(), m_register, length); + } + + // output last full ciphertext block + xorbuf(m_register, inString, length); + m_cipher->ProcessBlock(m_register); + memcpy(outString, m_register, BlockSize()); +} + +// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 +void CBC_Decryption::ResizeBuffers() +{ + BlockOrientedCipherModeBase::ResizeBuffers(); + m_temp.New(BlockSize()); +} +#endif + +void CBC_Decryption::ProcessData(byte *outString, const byte *inString, size_t length) +{ + if (!length) + return; + assert(length%BlockSize()==0); + + unsigned int blockSize = BlockSize(); + memcpy(m_temp, inString+length-blockSize, blockSize); // save copy now in case of in-place decryption + if (length > blockSize) + m_cipher->AdvancedProcessBlocks(inString+blockSize, inString, outString+blockSize, length-blockSize, BlockTransformation::BT_ReverseDirection|BlockTransformation::BT_AllowParallel); + m_cipher->ProcessAndXorBlock(inString, m_register, outString); + m_register.swap(m_temp); +} + +void CBC_CTS_Decryption::ProcessLastBlock(byte *outString, const byte *inString, size_t length) +{ + const byte *pn, *pn1; + bool stealIV = length <= BlockSize(); + + if (stealIV) + { + pn = inString; + pn1 = m_register; + } + else + { + pn = inString + BlockSize(); + pn1 = inString; + length -= BlockSize(); + } + + // decrypt last partial plaintext block + memcpy(m_temp, pn1, BlockSize()); + m_cipher->ProcessBlock(m_temp); + xorbuf(m_temp, pn, length); + + if (stealIV) + memcpy(outString, m_temp, length); + else + { + memcpy(outString+BlockSize(), m_temp, length); + // decrypt next to last plaintext block + memcpy(m_temp, pn, length); + m_cipher->ProcessBlock(m_temp); + xorbuf(outString, m_temp, m_register, BlockSize()); + } +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/modes.h b/external/crypto++-5.6.3/modes.h new file mode 100644 index 000000000..24c0e02e3 --- /dev/null +++ b/external/crypto++-5.6.3/modes.h @@ -0,0 +1,459 @@ +// modes.h - written and placed in the public domain by Wei Dai + +//! \file modes.h +//! \brief Class file for modes of operation. + +#ifndef CRYPTOPP_MODES_H +#define CRYPTOPP_MODES_H + +#include "cryptlib.h" +#include "secblock.h" +#include "misc.h" +#include "strciphr.h" +#include "argnames.h" +#include "algparam.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class CipherModeDocumentation +//! \brief Classes for operating block cipher modes of operation +//! \details Each class derived from this one defines two types, Encryption and Decryption, +//! both of which implement the SymmetricCipher interface. +//! For each mode there are two classes, one of which is a template class, +//! and the other one has a name that ends in "_ExternalCipher". +//! The "external cipher" mode objects hold a reference to the underlying block cipher, +//! instead of holding an instance of it. The reference must be passed in to the constructor. +//! For the "cipher holder" classes, the CIPHER template parameter should be a class +//! derived from BlockCipherDocumentation, for example DES or AES. +//! \details See NIST SP 800-38A for definitions of these modes. See +//! AuthenticatedSymmetricCipherDocumentation for authenticated encryption modes. +struct CipherModeDocumentation : public SymmetricCipherDocumentation +{ +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CipherModeBase : public SymmetricCipher +{ +public: + size_t MinKeyLength() const {return m_cipher->MinKeyLength();} + size_t MaxKeyLength() const {return m_cipher->MaxKeyLength();} + size_t DefaultKeyLength() const {return m_cipher->DefaultKeyLength();} + size_t GetValidKeyLength(size_t n) const {return m_cipher->GetValidKeyLength(n);} + bool IsValidKeyLength(size_t n) const {return m_cipher->IsValidKeyLength(n);} + + unsigned int OptimalDataAlignment() const {return m_cipher->OptimalDataAlignment();} + + unsigned int IVSize() const {return BlockSize();} + virtual IV_Requirement IVRequirement() const =0; + + void SetCipher(BlockCipher &cipher) + { + this->ThrowIfResynchronizable(); + this->m_cipher = &cipher; + this->ResizeBuffers(); + } + + void SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize = 0) + { + this->ThrowIfInvalidIV(iv); + this->m_cipher = &cipher; + this->ResizeBuffers(); + this->SetFeedbackSize(feedbackSize); + if (this->IsResynchronizable()) + this->Resynchronize(iv); + } + +protected: + CipherModeBase() : m_cipher(NULL) {} + inline unsigned int BlockSize() const {assert(m_register.size() > 0); return (unsigned int)m_register.size();} + virtual void SetFeedbackSize(unsigned int feedbackSize) + { + if (!(feedbackSize == 0 || feedbackSize == BlockSize())) + throw InvalidArgument("CipherModeBase: feedback size cannot be specified for this cipher mode"); + } + +// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual void ResizeBuffers(); +#else + virtual void ResizeBuffers() + { + m_register.New(m_cipher->BlockSize()); + } +#endif + + BlockCipher *m_cipher; + AlignedSecByteBlock m_register; +}; + +template +class CRYPTOPP_NO_VTABLE ModePolicyCommonTemplate : public CipherModeBase, public POLICY_INTERFACE +{ + unsigned int GetAlignment() const {return m_cipher->OptimalDataAlignment();} + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); +}; + +template +void ModePolicyCommonTemplate::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) +{ + m_cipher->SetKey(key, length, params); + ResizeBuffers(); + int feedbackSize = params.GetIntValueWithDefault(Name::FeedbackSize(), 0); + SetFeedbackSize(feedbackSize); +} + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_ModePolicy : public ModePolicyCommonTemplate +{ +public: + IV_Requirement IVRequirement() const {return RANDOM_IV;} + static const char * CRYPTOPP_API StaticAlgorithmName() {return "CFB";} + +protected: + unsigned int GetBytesPerIteration() const {return m_feedbackSize;} + byte * GetRegisterBegin() {return m_register + BlockSize() - m_feedbackSize;} + bool CanIterate() const {return m_feedbackSize == BlockSize();} + void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount); + void TransformRegister(); + void CipherResynchronize(const byte *iv, size_t length); + void SetFeedbackSize(unsigned int feedbackSize); + void ResizeBuffers(); + + SecByteBlock m_temp; + unsigned int m_feedbackSize; +}; + +inline void CopyOrZero(void *dest, const void *src, size_t s) +{ + if (src) + memcpy_s(dest, s, src, s); + else + memset(dest, 0, s); +} + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTemplate +{ +public: + bool CipherIsRandomAccess() const {return false;} + IV_Requirement IVRequirement() const {return UNIQUE_IV;} + static const char * CRYPTOPP_API StaticAlgorithmName() {return "OFB";} + +private: + unsigned int GetBytesPerIteration() const {return BlockSize();} + unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();} + void WriteKeystream(byte *keystreamBuffer, size_t iterationCount); + void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTemplate +{ +public: + bool CipherIsRandomAccess() const {return true;} + IV_Requirement IVRequirement() const {return RANDOM_IV;} + static const char * CRYPTOPP_API StaticAlgorithmName() {return "CTR";} + +protected: + virtual void IncrementCounterBy256(); + + unsigned int GetAlignment() const {return m_cipher->OptimalDataAlignment();} + unsigned int GetBytesPerIteration() const {return BlockSize();} + unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();} + void WriteKeystream(byte *buffer, size_t iterationCount) + {OperateKeystream(WRITE_KEYSTREAM, buffer, NULL, iterationCount);} + bool CanOperateKeystream() const {return true;} + void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); + void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); + void SeekToIteration(lword iterationCount); + + AlignedSecByteBlock m_counterArray; +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public CipherModeBase +{ +public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + unsigned int MandatoryBlockSize() const {return BlockSize();} + bool IsRandomAccess() const {return false;} + bool IsSelfInverting() const {return false;} + bool IsForwardTransformation() const {return m_cipher->IsForwardTransformation();} + void Resynchronize(const byte *iv, int length=-1) {memcpy_s(m_register, m_register.size(), iv, ThrowIfInvalidIVLength(length));} + +protected: + bool RequireAlignedInput() const {return true;} + + // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + void ResizeBuffers(); +#else + void ResizeBuffers() + { + CipherModeBase::ResizeBuffers(); + m_buffer.New(BlockSize()); + } +#endif + + SecByteBlock m_buffer; +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ECB_OneWay : public BlockOrientedCipherModeBase +{ +public: + void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms = g_nullNameValuePairs) + {m_cipher->SetKey(key, length, params); BlockOrientedCipherModeBase::ResizeBuffers();} + IV_Requirement IVRequirement() const {return NOT_RESYNCHRONIZABLE;} + unsigned int OptimalBlockSize() const {return BlockSize() * m_cipher->OptimalNumberOfParallelBlocks();} + void ProcessData(byte *outString, const byte *inString, size_t length); + static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECB";} +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherModeBase +{ +public: + IV_Requirement IVRequirement() const {return UNPREDICTABLE_RANDOM_IV;} + bool RequireAlignedInput() const {return false;} + unsigned int MinLastBlockSize() const {return 0;} + static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC";} +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : public CBC_ModeBase +{ +public: + void ProcessData(byte *outString, const byte *inString, size_t length); +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Encryption : public CBC_Encryption +{ +public: + void SetStolenIV(byte *iv) {m_stolenIV = iv;} + unsigned int MinLastBlockSize() const {return BlockSize()+1;} + void ProcessLastBlock(byte *outString, const byte *inString, size_t length); + static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC/CTS";} + +protected: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) + { + CBC_Encryption::UncheckedSetKey(key, length, params); + m_stolenIV = params.GetValueWithDefault(Name::StolenIV(), (byte *)NULL); + } + + byte *m_stolenIV; +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Decryption : public CBC_ModeBase +{ +public: + void ProcessData(byte *outString, const byte *inString, size_t length); + +protected: + + // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + void ResizeBuffers(); +#else + void ResizeBuffers() + { + BlockOrientedCipherModeBase::ResizeBuffers(); + m_temp.New(BlockSize()); + } +#endif + + AlignedSecByteBlock m_temp; +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Decryption : public CBC_Decryption +{ +public: + unsigned int MinLastBlockSize() const {return BlockSize()+1;} + void ProcessLastBlock(byte *outString, const byte *inString, size_t length); +}; + +//! _ +template +class CipherModeFinalTemplate_CipherHolder : protected ObjectHolder, public AlgorithmImpl > +{ +public: + CipherModeFinalTemplate_CipherHolder() + { + this->m_cipher = &this->m_object; + this->ResizeBuffers(); + } + CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length) + { + this->m_cipher = &this->m_object; + this->SetKey(key, length); + } + CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length, const byte *iv) + { + this->m_cipher = &this->m_object; + this->SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, this->m_cipher->BlockSize()))); + } + CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length, const byte *iv, int feedbackSize) + { + this->m_cipher = &this->m_object; + this->SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, this->m_cipher->BlockSize()))(Name::FeedbackSize(), feedbackSize)); + } + + static std::string CRYPTOPP_API StaticAlgorithmName() + {return CIPHER::StaticAlgorithmName() + "/" + BASE::StaticAlgorithmName();} +}; + +//! \class CipherModeFinalTemplate_ExternalCipher +//! \tparam BASE CipherModeFinalTemplate_CipherHolder class +//! \brief OFB block cipher mode of operation. +template +class CipherModeFinalTemplate_ExternalCipher : public BASE +{ +public: + CipherModeFinalTemplate_ExternalCipher() {} + CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher) + {this->SetCipher(cipher);} + CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize = 0) + {this->SetCipherWithIV(cipher, iv, feedbackSize);} + + std::string AlgorithmName() const + {return (this->m_cipher ? this->m_cipher->AlgorithmName() + "/" : std::string("")) + BASE::StaticAlgorithmName();} +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS CFB_CipherTemplate >; +CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate >; +CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate >; + +//! \class CFB_Mode +//! \brief CFB block cipher mode of operation. +template +struct CFB_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder > > > Encryption; + typedef CipherModeFinalTemplate_CipherHolder > > > Decryption; +}; + +//! \class CFB_Mode_ExternalCipher +//! \brief CFB mode, external cipher. +struct CFB_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher > > > Encryption; + typedef CipherModeFinalTemplate_ExternalCipher > > > Decryption; +}; + +//! \class CFB_FIPS_Mode +//! \brief CFB block cipher mode of operation providing FIPS validated cryptography. +//! \details Requires full block plaintext according to FIPS 800-38A +template +struct CFB_FIPS_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder > > > > Encryption; + typedef CipherModeFinalTemplate_CipherHolder > > > > Decryption; +}; + +//! \class CFB_FIPS_Mode_ExternalCipher +//! \brief CFB mode, external cipher, providing FIPS validated cryptography. +//! \details Requires full block plaintext according to FIPS 800-38A +struct CFB_FIPS_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher > > > > Encryption; + typedef CipherModeFinalTemplate_ExternalCipher > > > > Decryption; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate >; + +//! \class OFB_Mode +//! \brief OFB block cipher mode of operation. +template +struct OFB_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder > > > Encryption; + typedef Encryption Decryption; +}; + +//! \class OFB_Mode_ExternalCipher +//! \brief OFB mode, external cipher. +struct OFB_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher > > > Encryption; + typedef Encryption Decryption; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate >; +CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher > > >; + +//! \class CTR_Mode +//! \brief CTR block cipher mode of operation. +template +struct CTR_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder > > > Encryption; + typedef Encryption Decryption; +}; + +//! \class CTR_Mode_ExternalCipher +//! \brief CTR mode, external cipher. +struct CTR_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher > > > Encryption; + typedef Encryption Decryption; +}; + +//! \class ECB_Mode +//! \brief ECB block cipher mode of operation. +template +struct ECB_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder Encryption; + typedef CipherModeFinalTemplate_CipherHolder Decryption; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; + +//! \class ECB_Mode_ExternalCipher +//! \brief ECB mode, external cipher. +struct ECB_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher Encryption; + typedef Encryption Decryption; +}; + +//! CBC mode +template +struct CBC_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder Encryption; + typedef CipherModeFinalTemplate_CipherHolder Decryption; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; +CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; + +//! CBC mode, external cipher +struct CBC_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher Encryption; + typedef CipherModeFinalTemplate_ExternalCipher Decryption; +}; + +//! CBC mode with ciphertext stealing +template +struct CBC_CTS_Mode : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_CipherHolder Encryption; + typedef CipherModeFinalTemplate_CipherHolder Decryption; +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; +CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; + +//! \class CBC_CTS_Mode_ExternalCipher +//! \brief CBC mode with ciphertext stealing, external cipher +struct CBC_CTS_Mode_ExternalCipher : public CipherModeDocumentation +{ + typedef CipherModeFinalTemplate_ExternalCipher Encryption; + typedef CipherModeFinalTemplate_ExternalCipher Decryption; +}; + +#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY +typedef CFB_Mode_ExternalCipher::Encryption CFBEncryption; +typedef CFB_Mode_ExternalCipher::Decryption CFBDecryption; +typedef OFB_Mode_ExternalCipher::Encryption OFB; +typedef CTR_Mode_ExternalCipher::Encryption CounterMode; +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/modexppc.h b/external/crypto++-5.6.3/modexppc.h new file mode 100644 index 000000000..74f3352a3 --- /dev/null +++ b/external/crypto++-5.6.3/modexppc.h @@ -0,0 +1,36 @@ +#ifndef CRYPTOPP_MODEXPPC_H +#define CRYPTOPP_MODEXPPC_H + +#include "cryptlib.h" +#include "modarith.h" +#include "integer.h" +#include "eprecomp.h" +#include "smartptr.h" +#include "pubkey.h" + +NAMESPACE_BEGIN(CryptoPP) + +CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; + +class ModExpPrecomputation : public DL_GroupPrecomputation +{ +public: + // DL_GroupPrecomputation + bool NeedConversions() const {return true;} + Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);} + virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);} + const AbstractGroup & GetGroup() const {return m_mr->MultiplicativeGroup();} + Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} + void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} + + // non-inherited + void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));} + const Integer & GetModulus() const {return m_mr->GetModulus();} + +private: + value_ptr m_mr; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/mqueue.cpp b/external/crypto++-5.6.3/mqueue.cpp new file mode 100644 index 000000000..1d645d83d --- /dev/null +++ b/external/crypto++-5.6.3/mqueue.cpp @@ -0,0 +1,174 @@ +// mqueue.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "mqueue.h" + +NAMESPACE_BEGIN(CryptoPP) + +MessageQueue::MessageQueue(unsigned int nodeSize) + : m_queue(nodeSize), m_lengths(1, 0U), m_messageCounts(1, 0U) +{ +} + +size_t MessageQueue::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + if (begin >= MaxRetrievable()) + return 0; + + return m_queue.CopyRangeTo2(target, begin, STDMIN(MaxRetrievable(), end), channel, blocking); +} + +size_t MessageQueue::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + transferBytes = STDMIN(MaxRetrievable(), transferBytes); + size_t blockedBytes = m_queue.TransferTo2(target, transferBytes, channel, blocking); + m_lengths.front() -= transferBytes; + return blockedBytes; +} + +bool MessageQueue::GetNextMessage() +{ + if (NumberOfMessages() > 0 && !AnyRetrievable()) + { + m_lengths.pop_front(); + if (m_messageCounts[0] == 0 && m_messageCounts.size() > 1) + m_messageCounts.pop_front(); + return true; + } + else + return false; +} + +unsigned int MessageQueue::CopyMessagesTo(BufferedTransformation &target, unsigned int count, const std::string &channel) const +{ + ByteQueue::Walker walker(m_queue); + std::deque::const_iterator it = m_lengths.begin(); + unsigned int i; + for (i=0; i 0 && q2.AnyRetrievable()) + { + size_t len = length; + const byte *data = q2.Spy(len); + len = STDMIN(len, length); + if (memcmp(inString, data, len) != 0) + goto mismatch; + inString += len; + length -= len; + q2.Skip(len); + } + + q1.Put(inString, length); + + if (messageEnd) + { + if (q2.AnyRetrievable()) + goto mismatch; + else if (q2.AnyMessages()) + q2.GetNextMessage(); + else if (q2.NumberOfMessageSeries() > 0) + goto mismatch; + else + q1.MessageEnd(); + } + + return 0; + +mismatch: + return HandleMismatchDetected(blocking); + } +} + +bool EqualityComparisonFilter::ChannelMessageSeriesEnd(const std::string &channel, int propagation, bool blocking) +{ + unsigned int i = MapChannel(channel); + + if (i == 2) + { + OutputMessageSeriesEnd(4, propagation, blocking, channel); + return false; + } + else if (m_mismatchDetected) + return false; + else + { + MessageQueue &q1 = m_q[i], &q2 = m_q[1-i]; + + if (q2.AnyRetrievable() || q2.AnyMessages()) + goto mismatch; + else if (q2.NumberOfMessageSeries() > 0) + return Output(2, (const byte *)"\1", 1, 0, blocking) != 0; + else + q1.MessageSeriesEnd(); + + return false; + +mismatch: + return HandleMismatchDetected(blocking); + } +} + +bool EqualityComparisonFilter::HandleMismatchDetected(bool blocking) +{ + m_mismatchDetected = true; + if (m_throwIfNotEqual) + throw MismatchDetected(); + return Output(1, (const byte *)"\0", 1, 0, blocking) != 0; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/mqueue.h b/external/crypto++-5.6.3/mqueue.h new file mode 100644 index 000000000..702cb2d58 --- /dev/null +++ b/external/crypto++-5.6.3/mqueue.h @@ -0,0 +1,105 @@ +#ifndef CRYPTOPP_MQUEUE_H +#define CRYPTOPP_MQUEUE_H + +#include "cryptlib.h" +#include "queue.h" +#include "filters.h" +#include "misc.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! Message Queue +class CRYPTOPP_DLL MessageQueue : public AutoSignaling +{ +public: + MessageQueue(unsigned int nodeSize=256); + + void IsolatedInitialize(const NameValuePairs ¶meters) + {m_queue.IsolatedInitialize(parameters); m_lengths.assign(1, 0U); m_messageCounts.assign(1, 0U);} + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking) + { + CRYPTOPP_UNUSED(blocking); + m_queue.Put(begin, length); + m_lengths.back() += length; + if (messageEnd) + { + m_lengths.push_back(0); + m_messageCounts.back()++; + } + return 0; + } + bool IsolatedFlush(bool hardFlush, bool blocking) + {CRYPTOPP_UNUSED(hardFlush), CRYPTOPP_UNUSED(blocking); return false;} + bool IsolatedMessageSeriesEnd(bool blocking) + {CRYPTOPP_UNUSED(blocking); m_messageCounts.push_back(0); return false;} + + lword MaxRetrievable() const + {return m_lengths.front();} + bool AnyRetrievable() const + {return m_lengths.front() > 0;} + + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + + lword TotalBytesRetrievable() const + {return m_queue.MaxRetrievable();} + unsigned int NumberOfMessages() const + {return (unsigned int)m_lengths.size()-1;} + bool GetNextMessage(); + + unsigned int NumberOfMessagesInThisSeries() const + {return m_messageCounts[0];} + unsigned int NumberOfMessageSeries() const + {return (unsigned int)m_messageCounts.size()-1;} + + unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const; + + const byte * Spy(size_t &contiguousSize) const; + + void swap(MessageQueue &rhs); + +private: + ByteQueue m_queue; + std::deque m_lengths; + std::deque m_messageCounts; +}; + + +//! A filter that checks messages on two channels for equality +class CRYPTOPP_DLL EqualityComparisonFilter : public Unflushable > +{ +public: + struct MismatchDetected : public Exception {MismatchDetected() : Exception(DATA_INTEGRITY_CHECK_FAILED, "EqualityComparisonFilter: did not receive the same data on two channels") {}}; + + /*! if throwIfNotEqual is false, this filter will output a '\\0' byte when it detects a mismatch, '\\1' otherwise */ + EqualityComparisonFilter(BufferedTransformation *attachment=NULL, bool throwIfNotEqual=true, const std::string &firstChannel="0", const std::string &secondChannel="1") + : m_throwIfNotEqual(throwIfNotEqual), m_mismatchDetected(false) + , m_firstChannel(firstChannel), m_secondChannel(secondChannel) + {Detach(attachment);} + + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); + bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); + +private: + unsigned int MapChannel(const std::string &channel) const; + bool HandleMismatchDetected(bool blocking); + + bool m_throwIfNotEqual, m_mismatchDetected; + std::string m_firstChannel, m_secondChannel; + MessageQueue m_q[2]; +}; + +NAMESPACE_END + +#ifndef __BORLANDC__ +NAMESPACE_BEGIN(std) +template<> inline void swap(CryptoPP::MessageQueue &a, CryptoPP::MessageQueue &b) +{ + a.swap(b); +} +NAMESPACE_END +#endif + +#endif diff --git a/external/crypto++-5.6.3/mqv.cpp b/external/crypto++-5.6.3/mqv.cpp new file mode 100644 index 000000000..247a3ef6e --- /dev/null +++ b/external/crypto++-5.6.3/mqv.cpp @@ -0,0 +1,15 @@ +// mqv.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "mqv.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void TestInstantiations_MQV() +{ + MQV mqv; +} +#endif + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/mqv.h b/external/crypto++-5.6.3/mqv.h new file mode 100644 index 000000000..c42426033 --- /dev/null +++ b/external/crypto++-5.6.3/mqv.h @@ -0,0 +1,155 @@ +// mqv.h - written and placed in the public domain by Wei Dai + +//! \file mqv.h +//! \brief Classes for Menezes–Qu–Vanstone (MQV) key agreement + +#ifndef CRYPTOPP_MQV_H +#define CRYPTOPP_MQV_H + +#include "cryptlib.h" +#include "gfpcrypt.h" +#include "modarith.h" +#include "integer.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class MQV_Domain +//! \brief MQV domain for performing authenticated key agreement +//! \tparam GROUP_PARAMETERS doamin parameters +//! \tparam COFACTOR_OPTION cofactor option +//! \details GROUP_PARAMETERS paramters include the curve coefcients and the base point. +//! Binary curves use a polynomial to represent its characteristic, while prime curves +//! use a prime number. +template +class MQV_Domain : public AuthenticatedKeyAgreementDomain +{ +public: + typedef GROUP_PARAMETERS GroupParameters; + typedef typename GroupParameters::Element Element; + typedef MQV_Domain Domain; + + MQV_Domain() {} + + MQV_Domain(const GroupParameters ¶ms) + : m_groupParameters(params) {} + + MQV_Domain(BufferedTransformation &bt) + {m_groupParameters.BERDecode(bt);} + + template + MQV_Domain(T1 v1, T2 v2) + {m_groupParameters.Initialize(v1, v2);} + + template + MQV_Domain(T1 v1, T2 v2, T3 v3) + {m_groupParameters.Initialize(v1, v2, v3);} + + template + MQV_Domain(T1 v1, T2 v2, T3 v3, T4 v4) + {m_groupParameters.Initialize(v1, v2, v3, v4);} + + const GroupParameters & GetGroupParameters() const {return m_groupParameters;} + GroupParameters & AccessGroupParameters() {return m_groupParameters;} + + CryptoParameters & AccessCryptoParameters() {return AccessAbstractGroupParameters();} + + unsigned int AgreedValueLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(false);} + unsigned int StaticPrivateKeyLength() const {return GetAbstractGroupParameters().GetSubgroupOrder().ByteCount();} + unsigned int StaticPublicKeyLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(true);} + + void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const + { + Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent()); + x.Encode(privateKey, StaticPrivateKeyLength()); + } + + void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const + { + CRYPTOPP_UNUSED(rng); + const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); + Integer x(privateKey, StaticPrivateKeyLength()); + Element y = params.ExponentiateBase(x); + params.EncodeElement(true, y, publicKey); + } + + unsigned int EphemeralPrivateKeyLength() const {return StaticPrivateKeyLength() + StaticPublicKeyLength();} + unsigned int EphemeralPublicKeyLength() const {return StaticPublicKeyLength();} + + void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const + { + const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); + Integer x(rng, Integer::One(), params.GetMaxExponent()); + x.Encode(privateKey, StaticPrivateKeyLength()); + Element y = params.ExponentiateBase(x); + params.EncodeElement(true, y, privateKey+StaticPrivateKeyLength()); + } + + void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const + { + CRYPTOPP_UNUSED(rng); + memcpy(publicKey, privateKey+StaticPrivateKeyLength(), EphemeralPublicKeyLength()); + } + + bool Agree(byte *agreedValue, + const byte *staticPrivateKey, const byte *ephemeralPrivateKey, + const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, + bool validateStaticOtherPublicKey=true) const + { + try + { + const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); + Element WW = params.DecodeElement(staticOtherPublicKey, validateStaticOtherPublicKey); + Element VV = params.DecodeElement(ephemeralOtherPublicKey, true); + + Integer s(staticPrivateKey, StaticPrivateKeyLength()); + Integer u(ephemeralPrivateKey, StaticPrivateKeyLength()); + Element V = params.DecodeElement(ephemeralPrivateKey+StaticPrivateKeyLength(), false); + + const Integer &r = params.GetSubgroupOrder(); + Integer h2 = Integer::Power2((r.BitCount()+1)/2); + Integer e = ((h2+params.ConvertElementToInteger(V)%h2)*s+u) % r; + Integer tt = h2 + params.ConvertElementToInteger(VV) % h2; + + if (COFACTOR_OPTION::ToEnum() == NO_COFACTOR_MULTIPLICTION) + { + Element P = params.ExponentiateElement(WW, tt); + P = m_groupParameters.MultiplyElements(P, VV); + Element R[2]; + const Integer e2[2] = {r, e}; + params.SimultaneousExponentiate(R, P, e2, 2); + if (!params.IsIdentity(R[0]) || params.IsIdentity(R[1])) + return false; + params.EncodeElement(false, R[1], agreedValue); + } + else + { + const Integer &k = params.GetCofactor(); + if (COFACTOR_OPTION::ToEnum() == COMPATIBLE_COFACTOR_MULTIPLICTION) + e = ModularArithmetic(r).Divide(e, k); + Element P = m_groupParameters.CascadeExponentiate(VV, k*e, WW, k*(e*tt%r)); + if (params.IsIdentity(P)) + return false; + params.EncodeElement(false, P, agreedValue); + } + } + catch (DL_BadElement &) + { + return false; + } + return true; + } + +private: + DL_GroupParameters & AccessAbstractGroupParameters() {return m_groupParameters;} + const DL_GroupParameters & GetAbstractGroupParameters() const {return m_groupParameters;} + + GroupParameters m_groupParameters; +}; + +//! Menezes-Qu-Vanstone in GF(p) with key validation, AKA MQV +typedef MQV_Domain MQV; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/nbtheory.cpp b/external/crypto++-5.6.3/nbtheory.cpp new file mode 100644 index 000000000..2fa275a33 --- /dev/null +++ b/external/crypto++-5.6.3/nbtheory.cpp @@ -0,0 +1,1125 @@ +// nbtheory.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "nbtheory.h" +#include "integer.h" +#include "modarith.h" +#include "algparam.h" +#include "smartptr.h" +#include "misc.h" + +#include +#include + +#ifdef _OPENMP +# include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +const word s_lastSmallPrime = 32719; + +struct NewPrimeTable +{ + std::vector * operator()() const + { + const unsigned int maxPrimeTableSize = 3511; + + member_ptr > pPrimeTable(new std::vector); + std::vector &primeTable = *pPrimeTable; + primeTable.reserve(maxPrimeTableSize); + + primeTable.push_back(2); + unsigned int testEntriesEnd = 1; + + for (unsigned int p=3; p<=s_lastSmallPrime; p+=2) + { + unsigned int j; + for (j=1; j &primeTable = Singleton, NewPrimeTable>().Ref(); + size = (unsigned int)primeTable.size(); + return &primeTable[0]; +} + +bool IsSmallPrime(const Integer &p) +{ + unsigned int primeTableSize; + const word16 * primeTable = GetPrimeTable(primeTableSize); + + if (p.IsPositive() && p <= primeTable[primeTableSize-1]) + return std::binary_search(primeTable, primeTable+primeTableSize, (word16)p.ConvertToLong()); + else + return false; +} + +bool TrialDivision(const Integer &p, unsigned bound) +{ + unsigned int primeTableSize; + const word16 * primeTable = GetPrimeTable(primeTableSize); + + assert(primeTable[primeTableSize-1] >= bound); + + unsigned int i; + for (i = 0; primeTable[i]3 && b>1 && b3 && b>1 && b>a; + + Integer z = a_exp_b_mod_c(b, m, n); + if (z==1 || z==nminus1) + return true; + for (unsigned j=1; j3); + + Integer b; + for (unsigned int i=0; i2); + + Integer b=3; + unsigned int i=0; + int j; + + while ((j=Jacobi(b.Squared()-4, n)) == 1) + { + if (++i==64 && n.IsSquare()) // avoid infinite loop if n is a square + return false; + ++b; ++b; + } + + if (j==0) + return false; + else + return Lucas(n+1, b, n)==2; +} + +bool IsStrongLucasProbablePrime(const Integer &n) +{ + if (n <= 1) + return false; + + if (n.IsEven()) + return n==2; + + assert(n>2); + + Integer b=3; + unsigned int i=0; + int j; + + while ((j=Jacobi(b.Squared()-4, n)) == 1) + { + if (++i==64 && n.IsSquare()) // avoid infinite loop if n is a square + return false; + ++b; ++b; + } + + if (j==0) + return false; + + Integer n1 = n+1; + unsigned int a; + + // calculate a = largest power of 2 that divides n1 + for (a=0; ; a++) + if (n1.GetBit(a)) + break; + Integer m = n1>>a; + + Integer z = Lucas(m, b, n); + if (z==2 || z==n-2) + return true; + for (i=1; i().Ref()) + return SmallDivisorsTest(p); + else + return SmallDivisorsTest(p) && IsStrongProbablePrime(p, 3) && IsStrongLucasProbablePrime(p); +} + +bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level) +{ + bool pass = IsPrime(p) && RabinMillerTest(rng, p, 1); + if (level >= 1) + pass = pass && RabinMillerTest(rng, p, 10); + return pass; +} + +unsigned int PrimeSearchInterval(const Integer &max) +{ + return max.BitCount(); +} + +static inline bool FastProbablePrimeTest(const Integer &n) +{ + return IsStrongProbablePrime(n,2); +} + +AlgorithmParameters MakeParametersForTwoPrimesOfEqualSize(unsigned int productBitLength) +{ + if (productBitLength < 16) + throw InvalidArgument("invalid bit length"); + + Integer minP, maxP; + + if (productBitLength%2==0) + { + minP = Integer(182) << (productBitLength/2-8); + maxP = Integer::Power2(productBitLength/2)-1; + } + else + { + minP = Integer::Power2((productBitLength-1)/2); + maxP = Integer(181) << ((productBitLength+1)/2-8); + } + + return MakeParameters("RandomNumberType", Integer::PRIME)("Min", minP)("Max", maxP); +} + +class PrimeSieve +{ +public: + // delta == 1 or -1 means double sieve with p = 2*q + delta + PrimeSieve(const Integer &first, const Integer &last, const Integer &step, signed int delta=0); + bool NextCandidate(Integer &c); + + void DoSieve(); + static void SieveSingle(std::vector &sieve, word16 p, const Integer &first, const Integer &step, word16 stepInv); + + Integer m_first, m_last, m_step; + signed int m_delta; + word m_next; + std::vector m_sieve; +}; + +PrimeSieve::PrimeSieve(const Integer &first, const Integer &last, const Integer &step, signed int delta) + : m_first(first), m_last(last), m_step(step), m_delta(delta), m_next(0) +{ + DoSieve(); +} + +bool PrimeSieve::NextCandidate(Integer &c) +{ + bool safe = SafeConvert(std::find(m_sieve.begin()+m_next, m_sieve.end(), false) - m_sieve.begin(), m_next); + CRYPTOPP_UNUSED(safe); assert(safe); + if (m_next == m_sieve.size()) + { + m_first += long(m_sieve.size())*m_step; + if (m_first > m_last) + return false; + else + { + m_next = 0; + DoSieve(); + return NextCandidate(c); + } + } + else + { + c = m_first + long(m_next)*m_step; + ++m_next; + return true; + } +} + +void PrimeSieve::SieveSingle(std::vector &sieve, word16 p, const Integer &first, const Integer &step, word16 stepInv) +{ + if (stepInv) + { + size_t sieveSize = sieve.size(); + size_t j = (word32(p-(first%p))*stepInv) % p; + // if the first multiple of p is p, skip it + if (first.WordCount() <= 1 && first + step*long(j) == p) + j += p; + for (; j < sieveSize; j += p) + sieve[j] = true; + } +} + +void PrimeSieve::DoSieve() +{ + unsigned int primeTableSize; + const word16 * primeTable = GetPrimeTable(primeTableSize); + + const unsigned int maxSieveSize = 32768; + unsigned int sieveSize = STDMIN(Integer(maxSieveSize), (m_last-m_first)/m_step+1).ConvertToLong(); + + m_sieve.clear(); + m_sieve.resize(sieveSize, false); + + if (m_delta == 0) + { + for (unsigned int i = 0; i < primeTableSize; ++i) + SieveSingle(m_sieve, primeTable[i], m_first, m_step, (word16)m_step.InverseMod(primeTable[i])); + } + else + { + assert(m_step%2==0); + Integer qFirst = (m_first-m_delta) >> 1; + Integer halfStep = m_step >> 1; + for (unsigned int i = 0; i < primeTableSize; ++i) + { + word16 p = primeTable[i]; + word16 stepInv = (word16)m_step.InverseMod(p); + SieveSingle(m_sieve, p, m_first, m_step, stepInv); + + word16 halfStepInv = 2*stepInv < p ? 2*stepInv : 2*stepInv-p; + SieveSingle(m_sieve, p, qFirst, halfStep, halfStepInv); + } + } +} + +bool FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector) +{ + assert(!equiv.IsNegative() && equiv < mod); + + Integer gcd = GCD(equiv, mod); + if (gcd != Integer::One()) + { + // the only possible prime p such that p%mod==equiv where GCD(mod,equiv)!=1 is GCD(mod,equiv) + if (p <= gcd && gcd <= max && IsPrime(gcd) && (!pSelector || pSelector->IsAcceptable(gcd))) + { + p = gcd; + return true; + } + else + return false; + } + + unsigned int primeTableSize; + const word16 * primeTable = GetPrimeTable(primeTableSize); + + if (p <= primeTable[primeTableSize-1]) + { + const word16 *pItr; + + --p; + if (p.IsPositive()) + pItr = std::upper_bound(primeTable, primeTable+primeTableSize, (word)p.ConvertToLong()); + else + pItr = primeTable; + + while (pItr < primeTable+primeTableSize && !(*pItr%mod == equiv && (!pSelector || pSelector->IsAcceptable(*pItr)))) + ++pItr; + + if (pItr < primeTable+primeTableSize) + { + p = *pItr; + return p <= max; + } + + p = primeTable[primeTableSize-1]+1; + } + + assert(p > primeTable[primeTableSize-1]); + + if (mod.IsOdd()) + return FirstPrime(p, max, CRT(equiv, mod, 1, 2, 1), mod<<1, pSelector); + + p += (equiv-p)%mod; + + if (p>max) + return false; + + PrimeSieve sieve(p, max, mod); + + while (sieve.NextCandidate(p)) + { + if ((!pSelector || pSelector->IsAcceptable(p)) && FastProbablePrimeTest(p) && IsPrime(p)) + return true; + } + + return false; +} + +// the following two functions are based on code and comments provided by Preda Mihailescu +static bool ProvePrime(const Integer &p, const Integer &q) +{ + assert(p < q*q*q); + assert(p % q == 1); + +// this is the Quisquater test. Numbers p having passed the Lucas - Lehmer test +// for q and verifying p < q^3 can only be built up of two factors, both = 1 mod q, +// or be prime. The next two lines build the discriminant of a quadratic equation +// which holds iff p is built up of two factors (excercise ... ) + + Integer r = (p-1)/q; + if (((r%q).Squared()-4*(r/q)).IsSquare()) + return false; + + unsigned int primeTableSize; + const word16 * primeTable = GetPrimeTable(primeTableSize); + + assert(primeTableSize >= 50); + for (int i=0; i<50; i++) + { + Integer b = a_exp_b_mod_c(primeTable[i], r, p); + if (b != 1) + return a_exp_b_mod_c(b, q, p) == 1; + } + return false; +} + +Integer MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int pbits) +{ + Integer p; + Integer minP = Integer::Power2(pbits-1); + Integer maxP = Integer::Power2(pbits) - 1; + + if (maxP <= Integer(s_lastSmallPrime).Squared()) + { + // Randomize() will generate a prime provable by trial division + p.Randomize(rng, minP, maxP, Integer::PRIME); + return p; + } + + unsigned int qbits = (pbits+2)/3 + 1 + rng.GenerateWord32(0, pbits/36); + Integer q = MihailescuProvablePrime(rng, qbits); + Integer q2 = q<<1; + + while (true) + { + // this initializes the sieve to search in the arithmetic + // progression p = p_0 + \lambda * q2 = p_0 + 2 * \lambda * q, + // with q the recursively generated prime above. We will be able + // to use Lucas tets for proving primality. A trick of Quisquater + // allows taking q > cubic_root(p) rather then square_root: this + // decreases the recursion. + + p.Randomize(rng, minP, maxP, Integer::ANY, 1, q2); + PrimeSieve sieve(p, STDMIN(p+PrimeSearchInterval(maxP)*q2, maxP), q2); + + while (sieve.NextCandidate(p)) + { + if (FastProbablePrimeTest(p) && ProvePrime(p, q)) + return p; + } + } + + // not reached + return p; +} + +Integer MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits) +{ + const unsigned smallPrimeBound = 29, c_opt=10; + Integer p; + + unsigned int primeTableSize; + const word16 * primeTable = GetPrimeTable(primeTableSize); + + if (bits < smallPrimeBound) + { + do + p.Randomize(rng, Integer::Power2(bits-1), Integer::Power2(bits)-1, Integer::ANY, 1, 2); + while (TrialDivision(p, 1 << ((bits+1)/2))); + } + else + { + const unsigned margin = bits > 50 ? 20 : (bits-10)/2; + double relativeSize; + do + relativeSize = pow(2.0, double(rng.GenerateWord32())/0xffffffff - 1); + while (bits * relativeSize >= bits - margin); + + Integer a,b; + Integer q = MaurerProvablePrime(rng, unsigned(bits*relativeSize)); + Integer I = Integer::Power2(bits-2)/q; + Integer I2 = I << 1; + unsigned int trialDivisorBound = (unsigned int)STDMIN((unsigned long)primeTable[primeTableSize-1], (unsigned long)bits*bits/c_opt); + bool success = false; + while (!success) + { + p.Randomize(rng, I, I2, Integer::ANY); + p *= q; p <<= 1; ++p; + if (!TrialDivision(p, trialDivisorBound)) + { + a.Randomize(rng, 2, p-1, Integer::ANY); + b = a_exp_b_mod_c(a, (p-1)/q, p); + success = (GCD(b-1, p) == 1) && (a_exp_b_mod_c(b, q, p) == 1); + } + } + } + return p; +} + +Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u) +{ + // isn't operator overloading great? + return p * (u * (xq-xp) % q) + xp; +/* + Integer t1 = xq-xp; + cout << hex << t1 << endl; + Integer t2 = u * t1; + cout << hex << t2 << endl; + Integer t3 = t2 % q; + cout << hex << t3 << endl; + Integer t4 = p * t3; + cout << hex << t4 << endl; + Integer t5 = t4 + xp; + cout << hex << t5 << endl; + return t5; +*/ +} + +Integer ModularSquareRoot(const Integer &a, const Integer &p) +{ + if (p%4 == 3) + return a_exp_b_mod_c(a, (p+1)/4, p); + + Integer q=p-1; + unsigned int r=0; + while (q.IsEven()) + { + r++; + q >>= 1; + } + + Integer n=2; + while (Jacobi(n, p) != -1) + ++n; + + Integer y = a_exp_b_mod_c(n, q, p); + Integer x = a_exp_b_mod_c(a, (q-1)/2, p); + Integer b = (x.Squared()%p)*a%p; + x = a*x%p; + Integer tempb, t; + + while (b != 1) + { + unsigned m=0; + tempb = b; + do + { + m++; + b = b.Squared()%p; + if (m==r) + return Integer::Zero(); + } + while (b != 1); + + t = y; + for (unsigned i=0; i>= 1; + b >>= 1; + k++; + } + + while (a[0]==0) + a >>= 1; + + while (b[0]==0) + b >>= 1; + + while (1) + { + switch (a.Compare(b)) + { + case -1: + b -= a; + while (b[0]==0) + b >>= 1; + break; + + case 0: + return (a <<= k); + + case 1: + a -= b; + while (a[0]==0) + a >>= 1; + break; + + default: + assert(false); + } + } +} + +Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b) +{ + assert(b.Positive()); + + if (a.Negative()) + return EuclideanMultiplicativeInverse(a%b, b); + + if (b[0]==0) + { + if (!b || a[0]==0) + return Integer::Zero(); // no inverse + if (a==1) + return 1; + Integer u = EuclideanMultiplicativeInverse(b, a); + if (!u) + return Integer::Zero(); // no inverse + else + return (b*(a-u)+1)/a; + } + + Integer u=1, d=a, v1=b, v3=b, t1, t3, b2=(b+1)>>1; + + if (a[0]) + { + t1 = Integer::Zero(); + t3 = -b; + } + else + { + t1 = b2; + t3 = a>>1; + } + + while (!!t3) + { + while (t3[0]==0) + { + t3 >>= 1; + if (t1[0]==0) + t1 >>= 1; + else + { + t1 >>= 1; + t1 += b2; + } + } + if (t3.Positive()) + { + u = t1; + d = t3; + } + else + { + v1 = b-t1; + v3 = -t3; + } + t1 = u-v1; + t3 = d-v3; + if (t1.Negative()) + t1 += b; + } + if (d==1) + return u; + else + return Integer::Zero(); // no inverse +} +*/ + +int Jacobi(const Integer &aIn, const Integer &bIn) +{ + assert(bIn.IsOdd()); + + Integer b = bIn, a = aIn%bIn; + int result = 1; + + while (!!a) + { + unsigned i=0; + while (a.GetBit(i)==0) + i++; + a>>=i; + + if (i%2==1 && (b%8==3 || b%8==5)) + result = -result; + + if (a%4==3 && b%4==3) + result = -result; + + std::swap(a, b); + a %= b; + } + + return (b==1) ? result : 0; +} + +Integer Lucas(const Integer &e, const Integer &pIn, const Integer &n) +{ + unsigned i = e.BitCount(); + if (i==0) + return Integer::Two(); + + MontgomeryRepresentation m(n); + Integer p=m.ConvertIn(pIn%n), two=m.ConvertIn(Integer::Two()); + Integer v=p, v1=m.Subtract(m.Square(p), two); + + i--; + while (i--) + { + if (e.GetBit(i)) + { + // v = (v*v1 - p) % m; + v = m.Subtract(m.Multiply(v,v1), p); + // v1 = (v1*v1 - 2) % m; + v1 = m.Subtract(m.Square(v1), two); + } + else + { + // v1 = (v*v1 - p) % m; + v1 = m.Subtract(m.Multiply(v,v1), p); + // v = (v*v - 2) % m; + v = m.Subtract(m.Square(v), two); + } + } + return m.ConvertOut(v); +} + +// This is Peter Montgomery's unpublished Lucas sequence evalutation algorithm. +// The total number of multiplies and squares used is less than the binary +// algorithm (see above). Unfortunately I can't get it to run as fast as +// the binary algorithm because of the extra overhead. +/* +Integer Lucas(const Integer &n, const Integer &P, const Integer &modulus) +{ + if (!n) + return 2; + +#define f(A, B, C) m.Subtract(m.Multiply(A, B), C) +#define X2(A) m.Subtract(m.Square(A), two) +#define X3(A) m.Multiply(A, m.Subtract(m.Square(A), three)) + + MontgomeryRepresentation m(modulus); + Integer two=m.ConvertIn(2), three=m.ConvertIn(3); + Integer A=m.ConvertIn(P), B, C, p, d=n, e, r, t, T, U; + + while (d!=1) + { + p = d; + unsigned int b = WORD_BITS * p.WordCount(); + Integer alpha = (Integer(5)<<(2*b-2)).SquareRoot() - Integer::Power2(b-1); + r = (p*alpha)>>b; + e = d-r; + B = A; + C = two; + d = r; + + while (d!=e) + { + if (d>2)) + if ((dm3+em3==0 || dm3+em3==3) && (t = e, t >>= 2, t += e, d <= t)) + { + // #1 +// t = (d+d-e)/3; +// t = d; t += d; t -= e; t /= 3; +// e = (e+e-d)/3; +// e += e; e -= d; e /= 3; +// d = t; + +// t = (d+e)/3 + t = d; t += e; t /= 3; + e -= t; + d -= t; + + T = f(A, B, C); + U = f(T, A, B); + B = f(T, B, A); + A = U; + continue; + } + +// if (dm6 == em6 && d <= e + (e>>2)) + if (dm3 == em3 && dm2 == em2 && (t = e, t >>= 2, t += e, d <= t)) + { + // #2 +// d = (d-e)>>1; + d -= e; d >>= 1; + B = f(A, B, C); + A = X2(A); + continue; + } + +// if (d <= (e<<2)) + if (d <= (t = e, t <<= 2)) + { + // #3 + d -= e; + C = f(A, B, C); + swap(B, C); + continue; + } + + if (dm2 == em2) + { + // #4 +// d = (d-e)>>1; + d -= e; d >>= 1; + B = f(A, B, C); + A = X2(A); + continue; + } + + if (dm2 == 0) + { + // #5 + d >>= 1; + C = f(A, C, B); + A = X2(A); + continue; + } + + if (dm3 == 0) + { + // #6 +// d = d/3 - e; + d /= 3; d -= e; + T = X2(A); + C = f(T, f(A, B, C), C); + swap(B, C); + A = f(T, A, A); + continue; + } + + if (dm3+em3==0 || dm3+em3==3) + { + // #7 +// d = (d-e-e)/3; + d -= e; d -= e; d /= 3; + T = f(A, B, C); + B = f(T, A, B); + A = X3(A); + continue; + } + + if (dm3 == em3) + { + // #8 +// d = (d-e)/3; + d -= e; d /= 3; + T = f(A, B, C); + C = f(A, C, B); + B = T; + A = X3(A); + continue; + } + + assert(em2 == 0); + // #9 + e >>= 1; + C = f(C, B, A); + B = X2(B); + } + + A = f(A, B, C); + } + +#undef f +#undef X2 +#undef X3 + + return m.ConvertOut(A); +} +*/ + +Integer InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u) +{ + Integer d = (m*m-4); + Integer p2, q2; + #pragma omp parallel + #pragma omp sections + { + #pragma omp section + { + p2 = p-Jacobi(d,p); + p2 = Lucas(EuclideanMultiplicativeInverse(e,p2), m, p); + } + #pragma omp section + { + q2 = q-Jacobi(d,q); + q2 = Lucas(EuclideanMultiplicativeInverse(e,q2), m, q); + } + } + return CRT(p2, p, q2, q, u); +} + +unsigned int FactoringWorkFactor(unsigned int n) +{ + // extrapolated from the table in Odlyzko's "The Future of Integer Factorization" + // updated to reflect the factoring of RSA-130 + if (n<5) return 0; + else return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * pow(log(double(n)), 2.0/3.0) - 5); +} + +unsigned int DiscreteLogWorkFactor(unsigned int n) +{ + // assuming discrete log takes about the same time as factoring + if (n<5) return 0; + else return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * pow(log(double(n)), 2.0/3.0) - 5); +} + +// ******************************************************** + +void PrimeAndGenerator::Generate(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits) +{ + // no prime exists for delta = -1, qbits = 4, and pbits = 5 + assert(qbits > 4); + assert(pbits > qbits); + + if (qbits+1 == pbits) + { + Integer minP = Integer::Power2(pbits-1); + Integer maxP = Integer::Power2(pbits) - 1; + bool success = false; + + while (!success) + { + p.Randomize(rng, minP, maxP, Integer::ANY, 6+5*delta, 12); + PrimeSieve sieve(p, STDMIN(p+PrimeSearchInterval(maxP)*12, maxP), 12, delta); + + while (sieve.NextCandidate(p)) + { + assert(IsSmallPrime(p) || SmallDivisorsTest(p)); + q = (p-delta) >> 1; + assert(IsSmallPrime(q) || SmallDivisorsTest(q)); + if (FastProbablePrimeTest(q) && FastProbablePrimeTest(p) && IsPrime(q) && IsPrime(p)) + { + success = true; + break; + } + } + } + + if (delta == 1) + { + // find g such that g is a quadratic residue mod p, then g has order q + // g=4 always works, but this way we get the smallest quadratic residue (other than 1) + for (g=2; Jacobi(g, p) != 1; ++g) {} + // contributed by Walt Tuvell: g should be the following according to the Law of Quadratic Reciprocity + assert((p%8==1 || p%8==7) ? g==2 : (p%12==1 || p%12==11) ? g==3 : g==4); + } + else + { + assert(delta == -1); + // find g such that g*g-4 is a quadratic non-residue, + // and such that g has order q + for (g=3; ; ++g) + if (Jacobi(g*g-4, p)==-1 && Lucas(q, g, p)==2) + break; + } + } + else + { + Integer minQ = Integer::Power2(qbits-1); + Integer maxQ = Integer::Power2(qbits) - 1; + Integer minP = Integer::Power2(pbits-1); + Integer maxP = Integer::Power2(pbits) - 1; + + do + { + q.Randomize(rng, minQ, maxQ, Integer::PRIME); + } while (!p.Randomize(rng, minP, maxP, Integer::PRIME, delta%q, q)); + + // find a random g of order q + if (delta==1) + { + do + { + Integer h(rng, 2, p-2, Integer::ANY); + g = a_exp_b_mod_c(h, (p-1)/q, p); + } while (g <= 1); + assert(a_exp_b_mod_c(g, q, p)==1); + } + else + { + assert(delta==-1); + do + { + Integer h(rng, 3, p-1, Integer::ANY); + if (Jacobi(h*h-4, p)==1) + continue; + g = Lucas((p+1)/q, h, p); + } while (g <= 2); + assert(Lucas(q, g, p) == 2); + } + } +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/nbtheory.h b/external/crypto++-5.6.3/nbtheory.h new file mode 100644 index 000000000..2c8249341 --- /dev/null +++ b/external/crypto++-5.6.3/nbtheory.h @@ -0,0 +1,173 @@ +// nbtheory.h - written and placed in the public domain by Wei Dai + +//! \file nbtheory.h +//! \brief Classes and functions for number theoretic operations + +#ifndef CRYPTOPP_NBTHEORY_H +#define CRYPTOPP_NBTHEORY_H + +#include "cryptlib.h" +#include "integer.h" +#include "algparam.h" + +NAMESPACE_BEGIN(CryptoPP) + +// obtain pointer to small prime table and get its size +CRYPTOPP_DLL const word16 * CRYPTOPP_API GetPrimeTable(unsigned int &size); + +// ************ primality testing **************** + +//! \brief Generates a provable prime +//! \param rng a RandomNumberGenerator to produce keying material +//! \param bits the number of bits in the prime number +//! \returns Integer() meeting Maurer's tests for primality +CRYPTOPP_DLL Integer CRYPTOPP_API MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits); + +//! \brief Generates a provable prime +//! \param rng a RandomNumberGenerator to produce keying material +//! \param bits the number of bits in the prime number +//! \returns Integer() meeting Mihailescu's tests for primality +//! \details Mihailescu's methods performs a search using algorithmic progressions. +CRYPTOPP_DLL Integer CRYPTOPP_API MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int bits); + +//! \brief Tests whether a number is a small prime +//! \param p a candidate prime to test +//! \returns true if p is a small prime, false otherwise +//! \details Internally, the library maintains a table fo the first 32719 prime numbers +//! in sorted order. IsSmallPrime() searches the table and returns true if p is +//! in the table. +CRYPTOPP_DLL bool CRYPTOPP_API IsSmallPrime(const Integer &p); + +//! +//! \returns true if p is divisible by some prime less than bound. +//! \details TrialDivision() true if p is divisible by some prime less than bound. bound not be +//! greater than the largest entry in the prime table, which is 32719. +CRYPTOPP_DLL bool CRYPTOPP_API TrialDivision(const Integer &p, unsigned bound); + +// returns true if p is NOT divisible by small primes +CRYPTOPP_DLL bool CRYPTOPP_API SmallDivisorsTest(const Integer &p); + +// These is no reason to use these two, use the ones below instead +CRYPTOPP_DLL bool CRYPTOPP_API IsFermatProbablePrime(const Integer &n, const Integer &b); +CRYPTOPP_DLL bool CRYPTOPP_API IsLucasProbablePrime(const Integer &n); + +CRYPTOPP_DLL bool CRYPTOPP_API IsStrongProbablePrime(const Integer &n, const Integer &b); +CRYPTOPP_DLL bool CRYPTOPP_API IsStrongLucasProbablePrime(const Integer &n); + +// Rabin-Miller primality test, i.e. repeating the strong probable prime test +// for several rounds with random bases +CRYPTOPP_DLL bool CRYPTOPP_API RabinMillerTest(RandomNumberGenerator &rng, const Integer &w, unsigned int rounds); + +//! \brief Verifies a prime number +//! \param p a candidate prime to test +//! \returns true if p is a probable prime, false otherwise +//! \details IsPrime() is suitable for testing candidate primes when creating them. Internally, +//! IsPrime() utilizes SmallDivisorsTest(), IsStrongProbablePrime() and IsStrongLucasProbablePrime(). +CRYPTOPP_DLL bool CRYPTOPP_API IsPrime(const Integer &p); + +//! \brief Verifies a prime number +//! \param rng a RandomNumberGenerator for randomized testing +//! \param p a candidate prime to test +//! \param level the level of thoroughness of testing +//! \returns true if p is a strong probable prime, false otherwise +//! \details VerifyPrime() is suitable for testing candidate primes created by others. Internally, +//! VerifyPrime() utilizes IsPrime() and one-round RabinMillerTest(). If the candiate passes and +//! level is greater than 1, then 10 round RabinMillerTest() primality testing is performed. +CRYPTOPP_DLL bool CRYPTOPP_API VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level = 1); + +//! \class PrimeSelector +//! \brief Application callback to signal suitability of a cabdidate prime +class CRYPTOPP_DLL PrimeSelector +{ +public: + const PrimeSelector *GetSelectorPointer() const {return this;} + virtual bool IsAcceptable(const Integer &candidate) const =0; +}; + +//! \brief Finds a random prime of special form +//! \param p an Integer reference to receive the prime +//! \param max the maximum value +//! \param equiv the equivalence class based on the parameter mod +//! \param mod the modulus used to reduce the equivalence class +//! \param pSelector pointer to a PrimeSelector function for the application to signal suitability +//! \returns true if and only if FirstPrime() finds a prime and returns the prime through p. If FirstPrime() +//! returns false, then no such prime exists and the value of p is undefined +//! \details FirstPrime() uses a fast sieve to find the first probable prime +//! in {x | p<=x<=max and x%mod==equiv} +CRYPTOPP_DLL bool CRYPTOPP_API FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector); + +CRYPTOPP_DLL unsigned int CRYPTOPP_API PrimeSearchInterval(const Integer &max); + +CRYPTOPP_DLL AlgorithmParameters CRYPTOPP_API MakeParametersForTwoPrimesOfEqualSize(unsigned int productBitLength); + +// ********** other number theoretic functions ************ + +inline Integer GCD(const Integer &a, const Integer &b) + {return Integer::Gcd(a,b);} +inline bool RelativelyPrime(const Integer &a, const Integer &b) + {return Integer::Gcd(a,b) == Integer::One();} +inline Integer LCM(const Integer &a, const Integer &b) + {return a/Integer::Gcd(a,b)*b;} +inline Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b) + {return a.InverseMod(b);} + +// use Chinese Remainder Theorem to calculate x given x mod p and x mod q, and u = inverse of p mod q +CRYPTOPP_DLL Integer CRYPTOPP_API CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u); + +// if b is prime, then Jacobi(a, b) returns 0 if a%b==0, 1 if a is quadratic residue mod b, -1 otherwise +// check a number theory book for what Jacobi symbol means when b is not prime +CRYPTOPP_DLL int CRYPTOPP_API Jacobi(const Integer &a, const Integer &b); + +// calculates the Lucas function V_e(p, 1) mod n +CRYPTOPP_DLL Integer CRYPTOPP_API Lucas(const Integer &e, const Integer &p, const Integer &n); +// calculates x such that m==Lucas(e, x, p*q), p q primes, u=inverse of p mod q +CRYPTOPP_DLL Integer CRYPTOPP_API InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u); + +inline Integer ModularExponentiation(const Integer &a, const Integer &e, const Integer &m) + {return a_exp_b_mod_c(a, e, m);} +// returns x such that x*x%p == a, p prime +CRYPTOPP_DLL Integer CRYPTOPP_API ModularSquareRoot(const Integer &a, const Integer &p); +// returns x such that a==ModularExponentiation(x, e, p*q), p q primes, +// and e relatively prime to (p-1)*(q-1) +// dp=d%(p-1), dq=d%(q-1), (d is inverse of e mod (p-1)*(q-1)) +// and u=inverse of p mod q +CRYPTOPP_DLL Integer CRYPTOPP_API ModularRoot(const Integer &a, const Integer &dp, const Integer &dq, const Integer &p, const Integer &q, const Integer &u); + +// find r1 and r2 such that ax^2 + bx + c == 0 (mod p) for x in {r1, r2}, p prime +// returns true if solutions exist +CRYPTOPP_DLL bool CRYPTOPP_API SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, const Integer &b, const Integer &c, const Integer &p); + +// returns log base 2 of estimated number of operations to calculate discrete log or factor a number +CRYPTOPP_DLL unsigned int CRYPTOPP_API DiscreteLogWorkFactor(unsigned int bitlength); +CRYPTOPP_DLL unsigned int CRYPTOPP_API FactoringWorkFactor(unsigned int bitlength); + +// ******************************************************** + +//! generator of prime numbers of special forms +class CRYPTOPP_DLL PrimeAndGenerator +{ +public: + PrimeAndGenerator() {} + // generate a random prime p of the form 2*q+delta, where delta is 1 or -1 and q is also prime + // Precondition: pbits > 5 + // warning: this is slow, because primes of this form are harder to find + PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits) + {Generate(delta, rng, pbits, pbits-1);} + // generate a random prime p of the form 2*r*q+delta, where q is also prime + // Precondition: qbits > 4 && pbits > qbits + PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits) + {Generate(delta, rng, pbits, qbits);} + + void Generate(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits); + + const Integer& Prime() const {return p;} + const Integer& SubPrime() const {return q;} + const Integer& Generator() const {return g;} + +private: + Integer p, q, g; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/network.cpp b/external/crypto++-5.6.3/network.cpp new file mode 100644 index 000000000..448837a75 --- /dev/null +++ b/external/crypto++-5.6.3/network.cpp @@ -0,0 +1,553 @@ +// network.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "network.h" +#include "wait.h" + +#define CRYPTOPP_TRACE_NETWORK 0 + +NAMESPACE_BEGIN(CryptoPP) + +#ifdef HIGHRES_TIMER_AVAILABLE + +lword LimitedBandwidth::ComputeCurrentTransceiveLimit() +{ + if (!m_maxBytesPerSecond) + return ULONG_MAX; + + const double curTime = GetCurTimeAndCleanUp(); + CRYPTOPP_UNUSED(curTime); + + lword total = 0; + for (OpQueue::size_type i=0; i!=m_ops.size(); ++i) + total += m_ops[i].second; + return SaturatingSubtract(m_maxBytesPerSecond, total); +} + +double LimitedBandwidth::TimeToNextTransceive() +{ + if (!m_maxBytesPerSecond) + return 0; + + if (!m_nextTransceiveTime) + ComputeNextTransceiveTime(); + + return SaturatingSubtract(m_nextTransceiveTime, m_timer.ElapsedTimeAsDouble()); +} + +void LimitedBandwidth::NoteTransceive(lword size) +{ + if (m_maxBytesPerSecond) + { + double curTime = GetCurTimeAndCleanUp(); + m_ops.push_back(std::make_pair(curTime, size)); + m_nextTransceiveTime = 0; + } +} + +void LimitedBandwidth::ComputeNextTransceiveTime() +{ + double curTime = GetCurTimeAndCleanUp(); + lword total = 0; + for (unsigned int i=0; i!=m_ops.size(); ++i) + total += m_ops[i].second; + m_nextTransceiveTime = + (total < m_maxBytesPerSecond) ? curTime : m_ops.front().first + 1000; +} + +double LimitedBandwidth::GetCurTimeAndCleanUp() +{ + if (!m_maxBytesPerSecond) + return 0; + + double curTime = m_timer.ElapsedTimeAsDouble(); + while (m_ops.size() && (m_ops.front().first + 1000 < curTime)) + m_ops.pop_front(); + return curTime; +} + +void LimitedBandwidth::GetWaitObjects(WaitObjectContainer &container, const CallStack &callStack) +{ + double nextTransceiveTime = TimeToNextTransceive(); + if (nextTransceiveTime) + container.ScheduleEvent(nextTransceiveTime, CallStack("LimitedBandwidth::GetWaitObjects()", &callStack)); +} + +// ************************************************************* + +size_t NonblockingSource::GeneralPump2( + lword& byteCount, bool blockingOutput, + unsigned long maxTime, bool checkDelimiter, byte delimiter) +{ + m_blockedBySpeedLimit = false; + + if (!GetMaxBytesPerSecond()) + { + size_t ret = DoPump(byteCount, blockingOutput, maxTime, checkDelimiter, delimiter); + m_doPumpBlocked = (ret != 0); + return ret; + } + + bool forever = (maxTime == INFINITE_TIME); + unsigned long timeToGo = maxTime; + Timer timer(Timer::MILLISECONDS, forever); + lword maxSize = byteCount; + byteCount = 0; + + timer.StartTimer(); + + while (true) + { + lword curMaxSize = UnsignedMin(ComputeCurrentTransceiveLimit(), maxSize - byteCount); + + if (curMaxSize || m_doPumpBlocked) + { + if (!forever) timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); + size_t ret = DoPump(curMaxSize, blockingOutput, timeToGo, checkDelimiter, delimiter); + m_doPumpBlocked = (ret != 0); + if (curMaxSize) + { + NoteTransceive(curMaxSize); + byteCount += curMaxSize; + } + if (ret) + return ret; + } + + if (maxSize != ULONG_MAX && byteCount >= maxSize) + break; + + if (!forever) + { + timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); + if (!timeToGo) + break; + } + + double waitTime = TimeToNextTransceive(); + if (!forever && waitTime > timeToGo) + { + m_blockedBySpeedLimit = true; + break; + } + + WaitObjectContainer container; + LimitedBandwidth::GetWaitObjects(container, CallStack("NonblockingSource::GeneralPump2() - speed limit", 0)); + container.Wait((unsigned long)waitTime); + } + + return 0; +} + +size_t NonblockingSource::PumpMessages2(unsigned int &messageCount, bool blocking) +{ + if (messageCount == 0) + return 0; + + messageCount = 0; + + lword byteCount; + do { + byteCount = LWORD_MAX; + RETURN_IF_NONZERO(Pump2(byteCount, blocking)); + } while(byteCount == LWORD_MAX); + + if (!m_messageEndSent && SourceExhausted()) + { + RETURN_IF_NONZERO(AttachedTransformation()->Put2(NULL, 0, GetAutoSignalPropagation(), true)); + m_messageEndSent = true; + messageCount = 1; + } + return 0; +} + +lword NonblockingSink::TimedFlush(unsigned long maxTime, size_t targetSize) +{ + m_blockedBySpeedLimit = false; + + size_t curBufSize = GetCurrentBufferSize(); + if (curBufSize <= targetSize && (targetSize || !EofPending())) + return 0; + + if (!GetMaxBytesPerSecond()) + return DoFlush(maxTime, targetSize); + + bool forever = (maxTime == INFINITE_TIME); + unsigned long timeToGo = maxTime; + Timer timer(Timer::MILLISECONDS, forever); + lword totalFlushed = 0; + + timer.StartTimer(); + + while (true) + { + size_t flushSize = UnsignedMin(curBufSize - targetSize, ComputeCurrentTransceiveLimit()); + if (flushSize || EofPending()) + { + if (!forever) timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); + size_t ret = (size_t)DoFlush(timeToGo, curBufSize - flushSize); + if (ret) + { + NoteTransceive(ret); + curBufSize -= ret; + totalFlushed += ret; + } + } + + if (curBufSize <= targetSize && (targetSize || !EofPending())) + break; + + if (!forever) + { + timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); + if (!timeToGo) + break; + } + + double waitTime = TimeToNextTransceive(); + if (!forever && waitTime > timeToGo) + { + m_blockedBySpeedLimit = true; + break; + } + + WaitObjectContainer container; + LimitedBandwidth::GetWaitObjects(container, CallStack("NonblockingSink::TimedFlush() - speed limit", 0)); + container.Wait((unsigned long)waitTime); + } + + return totalFlushed; +} + +bool NonblockingSink::IsolatedFlush(bool hardFlush, bool blocking) +{ + TimedFlush(blocking ? INFINITE_TIME : 0); + return hardFlush && (!!GetCurrentBufferSize() || EofPending()); +} + +// ************************************************************* + +NetworkSource::NetworkSource(BufferedTransformation *attachment) + : NonblockingSource(attachment), m_buf(1024*16) + , m_putSize(0), m_dataBegin(0), m_dataEnd(0) + , m_waitingForResult(false), m_outputBlocked(false) +{ +} + +unsigned int NetworkSource::GetMaxWaitObjectCount() const +{ + return LimitedBandwidth::GetMaxWaitObjectCount() + + GetReceiver().GetMaxWaitObjectCount() + + AttachedTransformation()->GetMaxWaitObjectCount(); +} + +void NetworkSource::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (BlockedBySpeedLimit()) + LimitedBandwidth::GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - speed limit", &callStack)); + else if (!m_outputBlocked) + { + if (m_dataBegin == m_dataEnd) + AccessReceiver().GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - no data", &callStack)); + else + container.SetNoWait(CallStack("NetworkSource::GetWaitObjects() - have data", &callStack)); + } + + AttachedTransformation()->GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - attachment", &callStack)); +} + +size_t NetworkSource::DoPump(lword &byteCount, bool blockingOutput, unsigned long maxTime, bool checkDelimiter, byte delimiter) +{ + NetworkReceiver &receiver = AccessReceiver(); + + lword maxSize = byteCount; + byteCount = 0; + bool forever = maxTime == INFINITE_TIME; + Timer timer(Timer::MILLISECONDS, forever); + BufferedTransformation *t = AttachedTransformation(); + + if (m_outputBlocked) + goto DoOutput; + + while (true) + { + if (m_dataBegin == m_dataEnd) + { + if (receiver.EofReceived()) + break; + + if (m_waitingForResult) + { + if (receiver.MustWaitForResult() && + !receiver.Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), + CallStack("NetworkSource::DoPump() - wait receive result", 0))) + break; + + unsigned int recvResult = receiver.GetReceiveResult(); +#if CRYPTOPP_TRACE_NETWORK + OutputDebugString((IntToString((unsigned int)this) + ": Received " + IntToString(recvResult) + " bytes\n").c_str()); +#endif + m_dataEnd += recvResult; + m_waitingForResult = false; + + if (!receiver.MustWaitToReceive() && !receiver.EofReceived() && m_dataEnd != m_buf.size()) + goto ReceiveNoWait; + } + else + { + m_dataEnd = m_dataBegin = 0; + + if (receiver.MustWaitToReceive()) + { + if (!receiver.Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), + CallStack("NetworkSource::DoPump() - wait receive", 0))) + break; + + receiver.Receive(m_buf+m_dataEnd, m_buf.size()-m_dataEnd); + m_waitingForResult = true; + } + else + { +ReceiveNoWait: + m_waitingForResult = true; + // call Receive repeatedly as long as data is immediately available, + // because some receivers tend to return data in small pieces +#if CRYPTOPP_TRACE_NETWORK + OutputDebugString((IntToString((unsigned int)this) + ": Receiving " + IntToString(m_buf.size()-m_dataEnd) + " bytes\n").c_str()); +#endif + while (receiver.Receive(m_buf+m_dataEnd, m_buf.size()-m_dataEnd)) + { + unsigned int recvResult = receiver.GetReceiveResult(); +#if CRYPTOPP_TRACE_NETWORK + OutputDebugString((IntToString((unsigned int)this) + ": Received " + IntToString(recvResult) + " bytes\n").c_str()); +#endif + m_dataEnd += recvResult; + if (receiver.EofReceived() || m_dataEnd > m_buf.size() /2) + { + m_waitingForResult = false; + break; + } + } + } + } + } + else + { + m_putSize = UnsignedMin(m_dataEnd - m_dataBegin, maxSize - byteCount); + + if (checkDelimiter) + m_putSize = std::find(m_buf+m_dataBegin, m_buf+m_dataBegin+m_putSize, delimiter) - (m_buf+m_dataBegin); + +DoOutput: + size_t result = t->PutModifiable2(m_buf+m_dataBegin, m_putSize, 0, forever || blockingOutput); + if (result) + { + if (t->Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), + CallStack("NetworkSource::DoPump() - wait attachment", 0))) + goto DoOutput; + else + { + m_outputBlocked = true; + return result; + } + } + m_outputBlocked = false; + + byteCount += m_putSize; + m_dataBegin += m_putSize; + if (checkDelimiter && m_dataBegin < m_dataEnd && m_buf[m_dataBegin] == delimiter) + break; + if (maxSize != ULONG_MAX && byteCount == maxSize) + break; + // once time limit is reached, return even if there is more data waiting + // but make 0 a special case so caller can request a large amount of data to be + // pumped as long as it is immediately available + if (maxTime > 0 && timer.ElapsedTime() > maxTime) + break; + } + } + + return 0; +} + +// ************************************************************* + +NetworkSink::NetworkSink(unsigned int maxBufferSize, unsigned int autoFlushBound) + : m_maxBufferSize(maxBufferSize), m_autoFlushBound(autoFlushBound) + , m_needSendResult(false), m_wasBlocked(false), m_eofState(EOF_NONE) + , m_buffer(STDMIN(16U*1024U+256, maxBufferSize)), m_skipBytes(0) + , m_speedTimer(Timer::MILLISECONDS), m_byteCountSinceLastTimerReset(0) + , m_currentSpeed(0), m_maxObservedSpeed(0) +{ +} + +float NetworkSink::ComputeCurrentSpeed() +{ + if (m_speedTimer.ElapsedTime() > 1000) + { + m_currentSpeed = m_byteCountSinceLastTimerReset * 1000 / m_speedTimer.ElapsedTime(); + m_maxObservedSpeed = STDMAX(m_currentSpeed, m_maxObservedSpeed * 0.98f); + m_byteCountSinceLastTimerReset = 0; + m_speedTimer.StartTimer(); +// OutputDebugString(("max speed: " + IntToString((int)m_maxObservedSpeed) + " current speed: " + IntToString((int)m_currentSpeed) + "\n").c_str()); + } + return m_currentSpeed; +} + +float NetworkSink::GetMaxObservedSpeed() const +{ + lword m = GetMaxBytesPerSecond(); + return m ? STDMIN(m_maxObservedSpeed, float(CRYPTOPP_VC6_INT64 m)) : m_maxObservedSpeed; +} + +unsigned int NetworkSink::GetMaxWaitObjectCount() const +{ + return LimitedBandwidth::GetMaxWaitObjectCount() + GetSender().GetMaxWaitObjectCount(); +} + +void NetworkSink::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (BlockedBySpeedLimit()) + LimitedBandwidth::GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - speed limit", &callStack)); + else if (m_wasBlocked) + AccessSender().GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - was blocked", &callStack)); + else if (!m_buffer.IsEmpty()) + AccessSender().GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - buffer not empty", &callStack)); + else if (EofPending()) + AccessSender().GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - EOF pending", &callStack)); +} + +size_t NetworkSink::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) +{ + if (m_eofState == EOF_DONE) + { + if (length || messageEnd) + throw Exception(Exception::OTHER_ERROR, "NetworkSink::Put2() being called after EOF had been sent"); + + return 0; + } + + if (m_eofState > EOF_NONE) + goto EofSite; + + { + if (m_skipBytes) + { + assert(length >= m_skipBytes); + inString += m_skipBytes; + length -= m_skipBytes; + } + + m_buffer.Put(inString, length); + + if (!blocking || m_buffer.CurrentSize() > m_autoFlushBound) + TimedFlush(0, 0); + + size_t targetSize = messageEnd ? 0 : m_maxBufferSize; + if (blocking) + TimedFlush(INFINITE_TIME, targetSize); + + if (m_buffer.CurrentSize() > targetSize) + { + assert(!blocking); + m_wasBlocked = true; + m_skipBytes += length; + size_t blockedBytes = UnsignedMin(length, m_buffer.CurrentSize() - targetSize); + return STDMAX(blockedBytes, 1); + } + + m_wasBlocked = false; + m_skipBytes = 0; + } + + if (messageEnd) + { + m_eofState = EOF_PENDING_SEND; + + EofSite: + TimedFlush(blocking ? INFINITE_TIME : 0, 0); + if (m_eofState != EOF_DONE) + return 1; + } + + return 0; +} + +lword NetworkSink::DoFlush(unsigned long maxTime, size_t targetSize) +{ + NetworkSender &sender = AccessSender(); + + bool forever = maxTime == INFINITE_TIME; + Timer timer(Timer::MILLISECONDS, forever); + unsigned int totalFlushSize = 0; + + while (true) + { + if (m_buffer.CurrentSize() <= targetSize) + break; + + if (m_needSendResult) + { + if (sender.MustWaitForResult() && + !sender.Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), + CallStack("NetworkSink::DoFlush() - wait send result", 0))) + break; + + unsigned int sendResult = sender.GetSendResult(); +#if CRYPTOPP_TRACE_NETWORK + OutputDebugString((IntToString((unsigned int)this) + ": Sent " + IntToString(sendResult) + " bytes\n").c_str()); +#endif + m_buffer.Skip(sendResult); + totalFlushSize += sendResult; + m_needSendResult = false; + + if (!m_buffer.AnyRetrievable()) + break; + } + + unsigned long timeOut = maxTime ? SaturatingSubtract(maxTime, timer.ElapsedTime()) : 0; + if (sender.MustWaitToSend() && !sender.Wait(timeOut, CallStack("NetworkSink::DoFlush() - wait send", 0))) + break; + + size_t contiguousSize = 0; + const byte *block = m_buffer.Spy(contiguousSize); + +#if CRYPTOPP_TRACE_NETWORK + OutputDebugString((IntToString((unsigned int)this) + ": Sending " + IntToString(contiguousSize) + " bytes\n").c_str()); +#endif + sender.Send(block, contiguousSize); + m_needSendResult = true; + + if (maxTime > 0 && timeOut == 0) + break; // once time limit is reached, return even if there is more data waiting + } + + m_byteCountSinceLastTimerReset += totalFlushSize; + ComputeCurrentSpeed(); + + if (m_buffer.IsEmpty() && !m_needSendResult) + { + if (m_eofState == EOF_PENDING_SEND) + { + sender.SendEof(); + m_eofState = sender.MustWaitForEof() ? EOF_PENDING_DELIVERY : EOF_DONE; + } + + while (m_eofState == EOF_PENDING_DELIVERY) + { + unsigned long timeOut = maxTime ? SaturatingSubtract(maxTime, timer.ElapsedTime()) : 0; + if (!sender.Wait(timeOut, CallStack("NetworkSink::DoFlush() - wait EOF", 0))) + break; + + if (sender.EofSent()) + m_eofState = EOF_DONE; + } + } + + return totalFlushSize; +} + +#endif // #ifdef HIGHRES_TIMER_AVAILABLE + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/network.h b/external/crypto++-5.6.3/network.h new file mode 100644 index 000000000..96cd4567e --- /dev/null +++ b/external/crypto++-5.6.3/network.h @@ -0,0 +1,235 @@ +#ifndef CRYPTOPP_NETWORK_H +#define CRYPTOPP_NETWORK_H + +#include "config.h" + +#ifdef HIGHRES_TIMER_AVAILABLE + +#include "filters.h" +#include "hrtimer.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +class LimitedBandwidth +{ +public: + LimitedBandwidth(lword maxBytesPerSecond = 0) + : m_maxBytesPerSecond(maxBytesPerSecond), m_timer(Timer::MILLISECONDS) + , m_nextTransceiveTime(0) + { m_timer.StartTimer(); } + + lword GetMaxBytesPerSecond() const + { return m_maxBytesPerSecond; } + + void SetMaxBytesPerSecond(lword v) + { m_maxBytesPerSecond = v; } + + lword ComputeCurrentTransceiveLimit(); + + double TimeToNextTransceive(); + + void NoteTransceive(lword size); + +public: + /*! GetWaitObjects() must be called despite the 0 return from GetMaxWaitObjectCount(); + the 0 is because the ScheduleEvent() method is used instead of adding a wait object */ + unsigned int GetMaxWaitObjectCount() const { return 0; } + void GetWaitObjects(WaitObjectContainer &container, const CallStack &callStack); + +private: + lword m_maxBytesPerSecond; + + typedef std::deque > OpQueue; + OpQueue m_ops; + + Timer m_timer; + double m_nextTransceiveTime; + + void ComputeNextTransceiveTime(); + double GetCurTimeAndCleanUp(); +}; + +//! a Source class that can pump from a device for a specified amount of time. +class CRYPTOPP_NO_VTABLE NonblockingSource : public AutoSignaling, public LimitedBandwidth +{ +public: + NonblockingSource(BufferedTransformation *attachment) + : m_messageEndSent(false) , m_doPumpBlocked(false), m_blockedBySpeedLimit(false) {Detach(attachment);} + + //! \name NONBLOCKING SOURCE + //@{ + + //! pump up to maxSize bytes using at most maxTime milliseconds + /*! If checkDelimiter is true, pump up to delimiter, which itself is not extracted or pumped. */ + size_t GeneralPump2(lword &byteCount, bool blockingOutput=true, unsigned long maxTime=INFINITE_TIME, bool checkDelimiter=false, byte delimiter='\n'); + + lword GeneralPump(lword maxSize=LWORD_MAX, unsigned long maxTime=INFINITE_TIME, bool checkDelimiter=false, byte delimiter='\n') + { + GeneralPump2(maxSize, true, maxTime, checkDelimiter, delimiter); + return maxSize; + } + lword TimedPump(unsigned long maxTime) + {return GeneralPump(LWORD_MAX, maxTime);} + lword PumpLine(byte delimiter='\n', lword maxSize=1024) + {return GeneralPump(maxSize, INFINITE_TIME, true, delimiter);} + + size_t Pump2(lword &byteCount, bool blocking=true) + {return GeneralPump2(byteCount, blocking, blocking ? INFINITE_TIME : 0);} + size_t PumpMessages2(unsigned int &messageCount, bool blocking=true); + //@} + +protected: + virtual size_t DoPump(lword &byteCount, bool blockingOutput, + unsigned long maxTime, bool checkDelimiter, byte delimiter) =0; + + bool BlockedBySpeedLimit() const { return m_blockedBySpeedLimit; } + +private: + bool m_messageEndSent, m_doPumpBlocked, m_blockedBySpeedLimit; +}; + +//! Network Receiver +class CRYPTOPP_NO_VTABLE NetworkReceiver : public Waitable +{ +public: + virtual bool MustWaitToReceive() {return false;} + virtual bool MustWaitForResult() {return false;} + //! receive data from network source, returns whether result is immediately available + virtual bool Receive(byte* buf, size_t bufLen) =0; + virtual unsigned int GetReceiveResult() =0; + virtual bool EofReceived() const =0; +}; + +class CRYPTOPP_NO_VTABLE NonblockingSinkInfo +{ +public: + virtual ~NonblockingSinkInfo() {} + virtual size_t GetMaxBufferSize() const =0; + virtual size_t GetCurrentBufferSize() const =0; + virtual bool EofPending() const =0; + //! compute the current speed of this sink in bytes per second + virtual float ComputeCurrentSpeed() =0; + //! get the maximum observed speed of this sink in bytes per second + virtual float GetMaxObservedSpeed() const =0; +}; + +//! a Sink class that queues input and can flush to a device for a specified amount of time. +class CRYPTOPP_NO_VTABLE NonblockingSink : public Sink, public NonblockingSinkInfo, public LimitedBandwidth +{ +public: + NonblockingSink() : m_blockedBySpeedLimit(false) {} + + bool IsolatedFlush(bool hardFlush, bool blocking); + + //! flush to device for no more than maxTime milliseconds + /*! This function will repeatedly attempt to flush data to some device, until + the queue is empty, or a total of maxTime milliseconds have elapsed. + If maxTime == 0, at least one attempt will be made to flush some data, but + it is likely that not all queued data will be flushed, even if the device + is ready to receive more data without waiting. If you want to flush as much data + as possible without waiting for the device, call this function in a loop. + For example: while (sink.TimedFlush(0) > 0) {} + \return number of bytes flushed + */ + lword TimedFlush(unsigned long maxTime, size_t targetSize = 0); + + virtual void SetMaxBufferSize(size_t maxBufferSize) =0; + //! set a bound which will cause sink to flush if exceeded by GetCurrentBufferSize() + virtual void SetAutoFlushBound(size_t bound) =0; + +protected: + virtual lword DoFlush(unsigned long maxTime, size_t targetSize) = 0; + + bool BlockedBySpeedLimit() const { return m_blockedBySpeedLimit; } + +private: + bool m_blockedBySpeedLimit; +}; + +//! Network Sender +class CRYPTOPP_NO_VTABLE NetworkSender : public Waitable +{ +public: + virtual bool MustWaitToSend() {return false;} + virtual bool MustWaitForResult() {return false;} + virtual void Send(const byte* buf, size_t bufLen) =0; + virtual unsigned int GetSendResult() =0; + virtual bool MustWaitForEof() {return false;} + virtual void SendEof() =0; + virtual bool EofSent() {return false;} // implement if MustWaitForEof() == true +}; + +//! Network Source +class CRYPTOPP_NO_VTABLE NetworkSource : public NonblockingSource +{ +public: + NetworkSource(BufferedTransformation *attachment); + + unsigned int GetMaxWaitObjectCount() const; + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + + bool SourceExhausted() const {return m_dataBegin == m_dataEnd && GetReceiver().EofReceived();} + +protected: + size_t DoPump(lword &byteCount, bool blockingOutput, unsigned long maxTime, bool checkDelimiter, byte delimiter); + + virtual NetworkReceiver & AccessReceiver() =0; + const NetworkReceiver & GetReceiver() const {return const_cast(this)->AccessReceiver();} + +private: + SecByteBlock m_buf; + size_t m_putSize, m_dataBegin, m_dataEnd; + bool m_waitingForResult, m_outputBlocked; +}; + +//! Network Sink +class CRYPTOPP_NO_VTABLE NetworkSink : public NonblockingSink +{ +public: + NetworkSink(unsigned int maxBufferSize, unsigned int autoFlushBound); + + unsigned int GetMaxWaitObjectCount() const; + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + + void SetMaxBufferSize(size_t maxBufferSize) {m_maxBufferSize = maxBufferSize; m_buffer.SetNodeSize(UnsignedMin(maxBufferSize, 16U*1024U+256U));} + void SetAutoFlushBound(size_t bound) {m_autoFlushBound = bound;} + + size_t GetMaxBufferSize() const {return m_maxBufferSize;} + size_t GetCurrentBufferSize() const {return (size_t)m_buffer.CurrentSize();} + + void ClearBuffer() { m_buffer.Clear(); } + + bool EofPending() const { return m_eofState > EOF_NONE && m_eofState < EOF_DONE; } + + //! compute the current speed of this sink in bytes per second + float ComputeCurrentSpeed(); + //! get the maximum observed speed of this sink in bytes per second + float GetMaxObservedSpeed() const; + +protected: + lword DoFlush(unsigned long maxTime, size_t targetSize); + + virtual NetworkSender & AccessSender() =0; + const NetworkSender & GetSender() const {return const_cast(this)->AccessSender();} + +private: + enum EofState { EOF_NONE, EOF_PENDING_SEND, EOF_PENDING_DELIVERY, EOF_DONE }; + + size_t m_maxBufferSize, m_autoFlushBound; + bool m_needSendResult, m_wasBlocked; + EofState m_eofState; + ByteQueue m_buffer; + size_t m_skipBytes; + Timer m_speedTimer; + float m_byteCountSinceLastTimerReset, m_currentSpeed, m_maxObservedSpeed; +}; + +NAMESPACE_END + +#endif // #ifdef HIGHRES_TIMER_AVAILABLE + +#endif diff --git a/external/crypto++-5.6.3/nr.h b/external/crypto++-5.6.3/nr.h new file mode 100644 index 000000000..c398e3550 --- /dev/null +++ b/external/crypto++-5.6.3/nr.h @@ -0,0 +1,6 @@ +#ifndef CRYPTOPP_NR_H +#define CRYPTOPP_NR_H + +#include "gfpcrypt.h" + +#endif diff --git a/external/crypto++-5.6.3/oaep.cpp b/external/crypto++-5.6.3/oaep.cpp new file mode 100644 index 000000000..55625cbdd --- /dev/null +++ b/external/crypto++-5.6.3/oaep.cpp @@ -0,0 +1,98 @@ +// oaep.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "oaep.h" +#include "stdcpp.h" +#include "smartptr.h" + +NAMESPACE_BEGIN(CryptoPP) + +// ******************************************************** + +size_t OAEP_Base::MaxUnpaddedLength(size_t paddedLength) const +{ + return SaturatingSubtract(paddedLength/8, 1+2*DigestSize()); +} + +void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputLength, byte *oaepBlock, size_t oaepBlockLen, const NameValuePairs ¶meters) const +{ + assert (inputLength <= MaxUnpaddedLength(oaepBlockLen)); + + // convert from bit length to byte length + if (oaepBlockLen % 8 != 0) + { + oaepBlock[0] = 0; + oaepBlock++; + } + oaepBlockLen /= 8; + + member_ptr pHash(NewHash()); + const size_t hLen = pHash->DigestSize(); + const size_t seedLen = hLen, dbLen = oaepBlockLen-seedLen; + byte *const maskedSeed = oaepBlock; + byte *const maskedDB = oaepBlock+seedLen; + + ConstByteArrayParameter encodingParameters; + parameters.GetValue(Name::EncodingParameters(), encodingParameters); + + // DB = pHash || 00 ... || 01 || M + pHash->CalculateDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()); + memset(maskedDB+hLen, 0, dbLen-hLen-inputLength-1); + maskedDB[dbLen-inputLength-1] = 0x01; + memcpy(maskedDB+dbLen-inputLength, input, inputLength); + + rng.GenerateBlock(maskedSeed, seedLen); + member_ptr pMGF(NewMGF()); + pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen); + pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen); +} + +DecodingResult OAEP_Base::Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte *output, const NameValuePairs ¶meters) const +{ + bool invalid = false; + + // convert from bit length to byte length + if (oaepBlockLen % 8 != 0) + { + invalid = (oaepBlock[0] != 0) || invalid; + oaepBlock++; + } + oaepBlockLen /= 8; + + member_ptr pHash(NewHash()); + const size_t hLen = pHash->DigestSize(); + const size_t seedLen = hLen, dbLen = oaepBlockLen-seedLen; + + invalid = (oaepBlockLen < 2*hLen+1) || invalid; + + SecByteBlock t(oaepBlock, oaepBlockLen); + byte *const maskedSeed = t; + byte *const maskedDB = t+seedLen; + + member_ptr pMGF(NewMGF()); + pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen); + pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen); + + ConstByteArrayParameter encodingParameters; + parameters.GetValue(Name::EncodingParameters(), encodingParameters); + + // DB = pHash' || 00 ... || 01 || M + byte *M = std::find(maskedDB+hLen, maskedDB+dbLen, 0x01); + invalid = (M == maskedDB+dbLen) || invalid; + invalid = (std::find_if(maskedDB+hLen, M, std::bind2nd(std::not_equal_to(), byte(0))) != M) || invalid; + invalid = !pHash->VerifyDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()) || invalid; + + if (invalid) + return DecodingResult(); + + M++; + memcpy(output, M, maskedDB+dbLen-M); + return DecodingResult(maskedDB+dbLen-M); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/oaep.h b/external/crypto++-5.6.3/oaep.h new file mode 100644 index 000000000..a1c2d74a3 --- /dev/null +++ b/external/crypto++-5.6.3/oaep.h @@ -0,0 +1,43 @@ +#ifndef CRYPTOPP_OAEP_H +#define CRYPTOPP_OAEP_H + +#include "cryptlib.h" +#include "pubkey.h" +#include "sha.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class CRYPTOPP_DLL OAEP_Base : public PK_EncryptionMessageEncodingMethod +{ +public: + bool ParameterSupported(const char *name) const {return strcmp(name, Name::EncodingParameters()) == 0;} + size_t MaxUnpaddedLength(size_t paddedLength) const; + void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedLength, const NameValuePairs ¶meters) const; + DecodingResult Unpad(const byte *padded, size_t paddedLength, byte *raw, const NameValuePairs ¶meters) const; + +protected: + virtual unsigned int DigestSize() const =0; + virtual HashTransformation * NewHash() const =0; + virtual MaskGeneratingFunction * NewMGF() const =0; +}; + +//! EME-OAEP, for use with classes derived from TF_ES +template +class OAEP : public OAEP_Base, public EncryptionStandard +{ +public: + static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string("OAEP-") + MGF::StaticAlgorithmName() + "(" + H::StaticAlgorithmName() + ")";} + typedef OAEP EncryptionMessageEncodingMethod; + +protected: + unsigned int DigestSize() const {return H::DIGESTSIZE;} + HashTransformation * NewHash() const {return new H;} + MaskGeneratingFunction * NewMGF() const {return new MGF;} +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS OAEP; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/oids.h b/external/crypto++-5.6.3/oids.h new file mode 100644 index 000000000..961fb82e0 --- /dev/null +++ b/external/crypto++-5.6.3/oids.h @@ -0,0 +1,129 @@ +// oids.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile oids.h +//! \brief Object identifiers for algorthms and schemes + +#ifndef CRYPTOPP_OIDS_H +#define CRYPTOPP_OIDS_H + +// crypto-related ASN.1 object identifiers + +#include "asn.h" + +NAMESPACE_BEGIN(CryptoPP) + +NAMESPACE_BEGIN(ASN1) + +#define DEFINE_OID(value, name) inline OID name() {return value;} + +DEFINE_OID(1, iso) + DEFINE_OID(iso()+2, member_body) + DEFINE_OID(member_body()+840, iso_us) + DEFINE_OID(iso_us()+10040, ansi_x9_57) + DEFINE_OID(ansi_x9_57()+4+1, id_dsa) + DEFINE_OID(iso_us()+10045, ansi_x9_62) + DEFINE_OID(ansi_x9_62()+1, id_fieldType) + DEFINE_OID(id_fieldType()+1, prime_field) + DEFINE_OID(id_fieldType()+2, characteristic_two_field) + DEFINE_OID(characteristic_two_field()+3, id_characteristic_two_basis) + DEFINE_OID(id_characteristic_two_basis()+1, gnBasis) + DEFINE_OID(id_characteristic_two_basis()+2, tpBasis) + DEFINE_OID(id_characteristic_two_basis()+3, ppBasis) + DEFINE_OID(ansi_x9_62()+2, id_publicKeyType) + DEFINE_OID(id_publicKeyType()+1, id_ecPublicKey) + DEFINE_OID(ansi_x9_62()+3, ansi_x9_62_curves) + DEFINE_OID(ansi_x9_62_curves()+1, ansi_x9_62_curves_prime) + DEFINE_OID(ansi_x9_62_curves_prime()+1, secp192r1) + DEFINE_OID(ansi_x9_62_curves_prime()+7, secp256r1) + DEFINE_OID(iso_us()+113549, rsadsi) + DEFINE_OID(rsadsi()+1, pkcs) + DEFINE_OID(pkcs()+1, pkcs_1) + DEFINE_OID(pkcs_1()+1, rsaEncryption); + DEFINE_OID(rsadsi()+2, rsadsi_digestAlgorithm) + DEFINE_OID(rsadsi_digestAlgorithm()+2, id_md2) + DEFINE_OID(rsadsi_digestAlgorithm()+5, id_md5) + DEFINE_OID(iso()+3, identified_organization); + DEFINE_OID(identified_organization()+14, oiw); + DEFINE_OID(oiw()+3, oiw_secsig); + DEFINE_OID(oiw_secsig()+2, oiw_secsig_algorithms); + DEFINE_OID(oiw_secsig_algorithms()+26, id_sha1); + + DEFINE_OID(identified_organization()+36, teletrust); + DEFINE_OID(teletrust()+3, teletrust_algorithm) + DEFINE_OID(teletrust_algorithm()+2+1, id_ripemd160) + DEFINE_OID(teletrust_algorithm()+3+2+8+1, teletrust_ellipticCurve) + DEFINE_OID(teletrust_ellipticCurve()+1+1, brainpoolP160r1) + DEFINE_OID(teletrust_ellipticCurve()+1+3, brainpoolP192r1) + DEFINE_OID(teletrust_ellipticCurve()+1+5, brainpoolP224r1) + DEFINE_OID(teletrust_ellipticCurve()+1+7, brainpoolP256r1) + DEFINE_OID(teletrust_ellipticCurve()+1+9, brainpoolP320r1) + DEFINE_OID(teletrust_ellipticCurve()+1+11, brainpoolP384r1) + DEFINE_OID(teletrust_ellipticCurve()+1+13, brainpoolP512r1) + + DEFINE_OID(identified_organization()+132, certicom); + DEFINE_OID(certicom()+0, certicom_ellipticCurve); + // these are sorted by curve type and then by OID + // first curves based on GF(p) + DEFINE_OID(certicom_ellipticCurve()+6, secp112r1); + DEFINE_OID(certicom_ellipticCurve()+7, secp112r2); + DEFINE_OID(certicom_ellipticCurve()+8, secp160r1); + DEFINE_OID(certicom_ellipticCurve()+9, secp160k1); + DEFINE_OID(certicom_ellipticCurve()+10, secp256k1); + DEFINE_OID(certicom_ellipticCurve()+28, secp128r1); + DEFINE_OID(certicom_ellipticCurve()+29, secp128r2); + DEFINE_OID(certicom_ellipticCurve()+30, secp160r2); + DEFINE_OID(certicom_ellipticCurve()+31, secp192k1); + DEFINE_OID(certicom_ellipticCurve()+32, secp224k1); + DEFINE_OID(certicom_ellipticCurve()+33, secp224r1); + DEFINE_OID(certicom_ellipticCurve()+34, secp384r1); + DEFINE_OID(certicom_ellipticCurve()+35, secp521r1); + // then curves based on GF(2^n) + DEFINE_OID(certicom_ellipticCurve()+1, sect163k1); + DEFINE_OID(certicom_ellipticCurve()+2, sect163r1); + DEFINE_OID(certicom_ellipticCurve()+3, sect239k1); + DEFINE_OID(certicom_ellipticCurve()+4, sect113r1); + DEFINE_OID(certicom_ellipticCurve()+5, sect113r2); + DEFINE_OID(certicom_ellipticCurve()+15, sect163r2); + DEFINE_OID(certicom_ellipticCurve()+16, sect283k1); + DEFINE_OID(certicom_ellipticCurve()+17, sect283r1); + DEFINE_OID(certicom_ellipticCurve()+22, sect131r1); + DEFINE_OID(certicom_ellipticCurve()+23, sect131r2); + DEFINE_OID(certicom_ellipticCurve()+24, sect193r1); + DEFINE_OID(certicom_ellipticCurve()+25, sect193r2); + DEFINE_OID(certicom_ellipticCurve()+26, sect233k1); + DEFINE_OID(certicom_ellipticCurve()+27, sect233r1); + DEFINE_OID(certicom_ellipticCurve()+36, sect409k1); + DEFINE_OID(certicom_ellipticCurve()+37, sect409r1); + DEFINE_OID(certicom_ellipticCurve()+38, sect571k1); + DEFINE_OID(certicom_ellipticCurve()+39, sect571r1); +DEFINE_OID(2, joint_iso_ccitt) + DEFINE_OID(joint_iso_ccitt()+16, country) + DEFINE_OID(country()+840, joint_iso_ccitt_us) + DEFINE_OID(joint_iso_ccitt_us()+1, us_organization) + DEFINE_OID(us_organization()+101, us_gov) + DEFINE_OID(us_gov()+3, csor) + DEFINE_OID(csor()+4, nistalgorithms) + DEFINE_OID(nistalgorithms()+1, aes) + DEFINE_OID(aes()+1, id_aes128_ECB) + DEFINE_OID(aes()+2, id_aes128_cbc) + DEFINE_OID(aes()+3, id_aes128_ofb) + DEFINE_OID(aes()+4, id_aes128_cfb) + DEFINE_OID(aes()+21, id_aes192_ECB) + DEFINE_OID(aes()+22, id_aes192_cbc) + DEFINE_OID(aes()+23, id_aes192_ofb) + DEFINE_OID(aes()+24, id_aes192_cfb) + DEFINE_OID(aes()+41, id_aes256_ECB) + DEFINE_OID(aes()+42, id_aes256_cbc) + DEFINE_OID(aes()+43, id_aes256_ofb) + DEFINE_OID(aes()+44, id_aes256_cfb) + DEFINE_OID(nistalgorithms()+2, nist_hashalgs) + DEFINE_OID(nist_hashalgs()+1, id_sha256) + DEFINE_OID(nist_hashalgs()+2, id_sha384) + DEFINE_OID(nist_hashalgs()+3, id_sha512) + +NAMESPACE_END + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/osrng.cpp b/external/crypto++-5.6.3/osrng.cpp new file mode 100644 index 000000000..f0cd6c49c --- /dev/null +++ b/external/crypto++-5.6.3/osrng.cpp @@ -0,0 +1,202 @@ +// osrng.cpp - written and placed in the public domain by Wei Dai + +// Thanks to Leonard Janke for the suggestion for AutoSeededRandomPool. + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "osrng.h" + +#ifdef OS_RNG_AVAILABLE + +#include "rng.h" + +#ifdef CRYPTOPP_WIN32_AVAILABLE +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0400 +#endif +#include +#include +#endif + +#ifdef CRYPTOPP_UNIX_AVAILABLE +#include +#include +#include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#if defined(NONBLOCKING_RNG_AVAILABLE) || defined(BLOCKING_RNG_AVAILABLE) +OS_RNG_Err::OS_RNG_Err(const std::string &operation) + : Exception(OTHER_ERROR, "OS_Rng: " + operation + " operation failed with error " + +#ifdef CRYPTOPP_WIN32_AVAILABLE + "0x" + IntToString(GetLastError(), 16) +#else + IntToString(errno) +#endif + ) +{ +} +#endif + +#ifdef NONBLOCKING_RNG_AVAILABLE + +#ifdef CRYPTOPP_WIN32_AVAILABLE + +MicrosoftCryptoProvider::MicrosoftCryptoProvider() +{ + //if(!CryptAcquireContext(&m_hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) + // throw OS_RNG_Err("CryptAcquireContext"); +} + +MicrosoftCryptoProvider::~MicrosoftCryptoProvider() +{ + //CryptReleaseContext(m_hProvider, 0); +} + +#endif + +NonblockingRng::NonblockingRng() +{ +#ifndef CRYPTOPP_WIN32_AVAILABLE + m_fd = open("/dev/urandom",O_RDONLY); + if (m_fd == -1) + throw OS_RNG_Err("open /dev/urandom"); +#endif +} + +NonblockingRng::~NonblockingRng() +{ +#ifndef CRYPTOPP_WIN32_AVAILABLE + close(m_fd); +#endif +} + +void NonblockingRng::GenerateBlock(byte *output, size_t size) +{ +#ifdef CRYPTOPP_WIN32_AVAILABLE +//# ifdef WORKAROUND_MS_BUG_Q258000 +// const MicrosoftCryptoProvider &m_Provider = Singleton().Ref(); +//# endif +// if (!CryptGenRandom(m_Provider.GetProviderHandle(), (DWORD)size, output)) +// throw OS_RNG_Err("CryptGenRandom"); + static BOOL (__stdcall * s_pfnRtlGenRandom)( PVOID, ULONG ) = 0; + if ( !s_pfnRtlGenRandom ) + { + HMODULE hModAdvApi = ::LoadLibraryA( "advapi32.dll" ); + if ( hModAdvApi ) + s_pfnRtlGenRandom = (BOOL(__stdcall*)(PVOID,ULONG)) GetProcAddress( hModAdvApi, "SystemFunction036" ); + } + _ReadWriteBarrier(); + if ( !s_pfnRtlGenRandom || s_pfnRtlGenRandom( output, size ) == 0 ) + throw OS_RNG_Err("RtlGenRandom"); +#else + while (size) + { + ssize_t len = read(m_fd, output, size); + + if (len < 0) + { + // /dev/urandom reads CAN give EAGAIN errors! (maybe EINTR as well) + if (errno != EINTR && errno != EAGAIN) + throw OS_RNG_Err("read /dev/urandom"); + + continue; + } + + output += len; + size -= len; + } +#endif +} + +#endif + +// ************************************************************* + +#ifdef BLOCKING_RNG_AVAILABLE + +#ifndef CRYPTOPP_BLOCKING_RNG_FILENAME +#ifdef __OpenBSD__ +#define CRYPTOPP_BLOCKING_RNG_FILENAME "/dev/srandom" +#else +#define CRYPTOPP_BLOCKING_RNG_FILENAME "/dev/random" +#endif +#endif + +BlockingRng::BlockingRng() +{ + m_fd = open(CRYPTOPP_BLOCKING_RNG_FILENAME,O_RDONLY); + if (m_fd == -1) + throw OS_RNG_Err("open " CRYPTOPP_BLOCKING_RNG_FILENAME); +} + +BlockingRng::~BlockingRng() +{ + close(m_fd); +} + +void BlockingRng::GenerateBlock(byte *output, size_t size) +{ + while (size) + { + // on some systems /dev/random will block until all bytes + // are available, on others it returns immediately + ssize_t len = read(m_fd, output, size); + if (len < 0) + { + // /dev/random reads CAN give EAGAIN errors! (maybe EINTR as well) + if (errno != EINTR && errno != EAGAIN) + throw OS_RNG_Err("read " CRYPTOPP_BLOCKING_RNG_FILENAME); + + continue; + } + + size -= len; + output += len; + if (size) + sleep(1); + } +} + +#endif + +// ************************************************************* + +void OS_GenerateRandomBlock(bool blocking, byte *output, size_t size) +{ +#ifdef NONBLOCKING_RNG_AVAILABLE + if (blocking) +#endif + { +#ifdef BLOCKING_RNG_AVAILABLE + BlockingRng rng; + rng.GenerateBlock(output, size); +#endif + } + +#ifdef BLOCKING_RNG_AVAILABLE + if (!blocking) +#endif + { +#ifdef NONBLOCKING_RNG_AVAILABLE + NonblockingRng rng; + rng.GenerateBlock(output, size); +#endif + } +} + +void AutoSeededRandomPool::Reseed(bool blocking, unsigned int seedSize) +{ + SecByteBlock seed(seedSize); + OS_GenerateRandomBlock(blocking, seed, seedSize); + IncorporateEntropy(seed, seedSize); +} + +NAMESPACE_END + +#endif + +#endif diff --git a/external/crypto++-5.6.3/osrng.h b/external/crypto++-5.6.3/osrng.h new file mode 100644 index 000000000..cb712ddb4 --- /dev/null +++ b/external/crypto++-5.6.3/osrng.h @@ -0,0 +1,256 @@ +// osrng.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile osrng.h +//! \brief Classes for access to the operating system's random number generators + +#ifndef CRYPTOPP_OSRNG_H +#define CRYPTOPP_OSRNG_H + +#include "config.h" + +#ifdef OS_RNG_AVAILABLE + +#include "cryptlib.h" +#include "randpool.h" +#include "smartptr.h" +#include "fips140.h" +#include "rng.h" +#include "aes.h" +#include "sha.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class OS_RNG_Err +//! \brief Exception thrown when an operating system error is encountered +class CRYPTOPP_DLL OS_RNG_Err : public Exception +{ +public: + //! \brief Constructs an OS_RNG_Err + //! \param operation the operation or API call when the error occurs + OS_RNG_Err(const std::string &operation); +}; + +#ifdef NONBLOCKING_RNG_AVAILABLE + +#ifdef CRYPTOPP_WIN32_AVAILABLE +//! \class MicrosoftCryptoProvider +//! \brief Wrapper for Microsoft crypto service provider +//! \sa \def USE_MS_CRYPTOAPI, \def WORKAROUND_MS_BUG_Q258000 +class CRYPTOPP_DLL MicrosoftCryptoProvider +{ +public: + //! \brief Construct a MicrosoftCryptoProvider + MicrosoftCryptoProvider(); + ~MicrosoftCryptoProvider(); + +// type HCRYPTPROV, avoid #include +#if defined(__CYGWIN__) && defined(__x86_64__) + typedef unsigned long long ProviderHandle; +#elif defined(WIN64) || defined(_WIN64) + typedef unsigned __int64 ProviderHandle; +#else + typedef unsigned long ProviderHandle; +#endif + + //! \brief Retrieves the CryptoAPI provider handle + //! \returns CryptoAPI provider handle + //! \details The handle is acquired by a call to CryptAcquireContext(). + //! CryptReleaseContext() is called upon destruction. + ProviderHandle GetProviderHandle() const {return m_hProvider;} + +private: + ProviderHandle m_hProvider; +}; + +#if defined(_MSC_VER) +# pragma comment(lib, "advapi32.lib") +#endif + +#endif //CRYPTOPP_WIN32_AVAILABLE + +//! \class NonblockingRng +//! \brief Wrapper class for /dev/random and /dev/srandom +//! \details Encapsulates CryptoAPI's CryptGenRandom() on Windows, or /dev/urandom on Unix and compatibles. +class CRYPTOPP_DLL NonblockingRng : public RandomNumberGenerator +{ +public: + //! \brief Construct a NonblockingRng + NonblockingRng(); + ~NonblockingRng(); + + //! \brief Generate random array of bytes + //! \param output the byte buffer + //! \param size the length of the buffer, in bytes + //! \details GenerateIntoBufferedTransformation() calls are routed to GenerateBlock(). + void GenerateBlock(byte *output, size_t size); + +protected: +#ifdef CRYPTOPP_WIN32_AVAILABLE +//# ifndef WORKAROUND_MS_BUG_Q258000 +// MicrosoftCryptoProvider m_Provider; +//# endif +#else + int m_fd; +#endif +}; + +#endif + +#if defined(BLOCKING_RNG_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) + +//! \class BlockingRng +//! \brief Wrapper class for /dev/random and /dev/srandom +//! \details Encapsulates /dev/random on Linux, OS X and Unix; and /dev/srandom on the BSDs. +class CRYPTOPP_DLL BlockingRng : public RandomNumberGenerator +{ +public: + //! \brief Construct a BlockingRng + BlockingRng(); + ~BlockingRng(); + + //! \brief Generate random array of bytes + //! \param output the byte buffer + //! \param size the length of the buffer, in bytes + //! \details GenerateIntoBufferedTransformation() calls are routed to GenerateBlock(). + void GenerateBlock(byte *output, size_t size); + +protected: + int m_fd; +}; + +#endif + +//! OS_GenerateRandomBlock +//! \brief Generate random array of bytes +//! \param blocking specifies whther a bobcking or non-blocking generator should be used +//! \param output the byte buffer +//! \param size the length of the buffer, in bytes +//! \details OS_GenerateRandomBlock() uses the underlying operating system's +//! random number generator. On Windows, CryptGenRandom() is called using NonblockingRng. +//! \details On Unix and compatibles, /dev/urandom is called if blocking is false using +//! NonblockingRng. If blocking is true, then either /dev/randomd or /dev/srandom is used +//! by way of BlockingRng, if available. +CRYPTOPP_DLL void CRYPTOPP_API OS_GenerateRandomBlock(bool blocking, byte *output, size_t size); + + +//! \class AutoSeededRandomPool +//! \brief Automatically Seeded Randomness Pool +//! \details This class seeds itself using an operating system provided RNG. +class CRYPTOPP_DLL AutoSeededRandomPool : public RandomPool +{ +public: + //! \brief Construct an AutoSeededRandomPool + //! \param blocking controls seeding with BlockingRng or NonblockingRng + //! \param seedSize the size of the seed, in bytes + //! \details Use blocking to choose seeding with BlockingRng or NonblockingRng. + //! The parameter is ignored if only one of these is available. + explicit AutoSeededRandomPool(bool blocking = false, unsigned int seedSize = 32) + {Reseed(blocking, seedSize);} + + //! \brief Reseed an AutoSeededRandomPool + //! \param blocking controls seeding with BlockingRng or NonblockingRng + //! \param seedSize the size of the seed, in bytes + void Reseed(bool blocking = false, unsigned int seedSize = 32); +}; + +//! \class AutoSeededX917RNG +//! \tparam BLOCK_CIPHER a block cipher +//! \brief Automatically Seeded X9.17 RNG +//! \details AutoSeededX917RNG is from ANSI X9.17 Appendix C, seeded using an OS provided RNG. +//! If 3-key TripleDES (DES_EDE3) is used, then its a X9.17 conforming generator. If AES is +//! used, then its a X9.31 conforming generator. +//! \details Though ANSI X9 prescribes 3-key TripleDES, the template parameter BLOCK_CIPHER can be any +//! BlockTransformation derived class. +//! \sa X917RNG, DefaultAutoSeededRNG +template +class AutoSeededX917RNG : public RandomNumberGenerator, public NotCopyable +{ +public: + //! \brief Construct an AutoSeededX917RNG + //! \param blocking controls seeding with BlockingRng or NonblockingRng + //! \param autoSeed controls auto seeding of the generator + //! \details Use blocking to choose seeding with BlockingRng or NonblockingRng. + //! The parameter is ignored if only one of these is available. + //! \sa X917RNG + explicit AutoSeededX917RNG(bool blocking = false, bool autoSeed = true) + {if (autoSeed) Reseed(blocking);} + + //! \brief Reseed an AutoSeededX917RNG + //! \param blocking controls seeding with BlockingRng or NonblockingRng + //! \param additionalEntropy additional entropy to add to the generator + //! \param length the size of the additional entropy, in bytes + //! \details Internally, the generator uses SHA256 to extract the entropy from + //! from the seed and then stretch the material for the block cipher's key + //! and initialization vector. + void Reseed(bool blocking = false, const byte *additionalEntropy = NULL, size_t length = 0); + + //! \brief Deterministically reseed an AutoSeededX917RNG for testing + //! \param key the key to use for the deterministic reseeding + //! \param keylength the size of the key, in bytes + //! \param seed the seed to use for the deterministic reseeding + //! \param timeVector a time vector to use for deterministic reseeding + //! \details This is a testing interface for testing purposes, and should \a NOT + //! be used in production. + void Reseed(const byte *key, size_t keylength, const byte *seed, const byte *timeVector); + + bool CanIncorporateEntropy() const {return true;} + void IncorporateEntropy(const byte *input, size_t length) {Reseed(false, input, length);} + void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length) + {m_rng->GenerateIntoBufferedTransformation(target, channel, length);} + +private: + member_ptr m_rng; +}; + +template +void AutoSeededX917RNG::Reseed(const byte *key, size_t keylength, const byte *seed, const byte *timeVector) +{ + m_rng.reset(new X917RNG(new typename BLOCK_CIPHER::Encryption(key, keylength), seed, timeVector)); +} + +template +void AutoSeededX917RNG::Reseed(bool blocking, const byte *input, size_t length) +{ + SecByteBlock seed(BLOCK_CIPHER::BLOCKSIZE + BLOCK_CIPHER::DEFAULT_KEYLENGTH); + const byte *key; + do + { + OS_GenerateRandomBlock(blocking, seed, seed.size()); + if (length > 0) + { + SHA256 hash; + hash.Update(seed, seed.size()); + hash.Update(input, length); + hash.TruncatedFinal(seed, UnsignedMin(hash.DigestSize(), seed.size())); + } + key = seed + BLOCK_CIPHER::BLOCKSIZE; + } // check that seed and key don't have same value + while (memcmp(key, seed, STDMIN((unsigned int)BLOCK_CIPHER::BLOCKSIZE, (unsigned int)BLOCK_CIPHER::DEFAULT_KEYLENGTH)) == 0); + + Reseed(key, BLOCK_CIPHER::DEFAULT_KEYLENGTH, seed, NULL); +} + +CRYPTOPP_DLL_TEMPLATE_CLASS AutoSeededX917RNG; + +#if defined(CRYPTOPP_DOXYGEN_PROCESSING) +//! \class DefaultAutoSeededRNG +//! \brief A typedef providing a default generator +//! \details DefaultAutoSeededRNG is a typedef of either AutoSeededX917RNG or AutoSeededRandomPool. +//! If CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined, then DefaultAutoSeededRNG is +//! AutoSeededX917RNG. Otherwise, DefaultAutoSeededRNG is AutoSeededRandomPool. +class DefaultAutoSeededRNG {} +#else +// AutoSeededX917RNG in FIPS mode, otherwise it's AutoSeededRandomPool +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 +typedef AutoSeededX917RNG DefaultAutoSeededRNG; +#else +typedef AutoSeededRandomPool DefaultAutoSeededRNG; +#endif +#endif // CRYPTOPP_DOXYGEN_PROCESSING + +NAMESPACE_END + +#endif + +#endif diff --git a/external/crypto++-5.6.3/panama.cpp b/external/crypto++-5.6.3/panama.cpp new file mode 100644 index 000000000..a4a53266a --- /dev/null +++ b/external/crypto++-5.6.3/panama.cpp @@ -0,0 +1,518 @@ +// panama.cpp - written and placed in the public domain by Wei Dai + +// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM panama.cpp" to generate MASM code + +#include "pch.h" + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#include "panama.h" +#include "secblock.h" +#include "misc.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4731) +#endif + +template +void Panama::Reset() +{ + memset(m_state, 0, m_state.SizeInBytes()); +#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) + m_state[17] = HasSSSE3(); +#endif +} + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +void Panama_SSE2_Pull(size_t count, word32 *state, word32 *z, const word32 *y); +} +#elif CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) + +#ifdef CRYPTOPP_GENERATE_X64_MASM + Panama_SSE2_Pull PROC FRAME + rex_push_reg rdi + alloc_stack(2*16) + save_xmm128 xmm6, 0h + save_xmm128 xmm7, 10h + .endprolog +#else +void CRYPTOPP_NOINLINE Panama_SSE2_Pull(size_t count, word32 *state, word32 *z, const word32 *y) +{ +#if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) + asm __volatile__ + ( + INTEL_NOPREFIX + AS_PUSH_IF86( bx) +#else + AS2( mov AS_REG_1, count) + AS2( mov AS_REG_2, state) + AS2( mov AS_REG_3, z) + AS2( mov AS_REG_4, y) +#endif +#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM + +#if CRYPTOPP_BOOL_X32 + #define REG_loopEnd r8d +#elif CRYPTOPP_BOOL_X86 + #define REG_loopEnd [esp] +#elif defined(CRYPTOPP_GENERATE_X64_MASM) + #define REG_loopEnd rdi +#else + #define REG_loopEnd r8 +#endif + + AS2( shl AS_REG_1, 5) + ASJ( jz, 5, f) + AS2( mov AS_REG_6d, [AS_REG_2+4*17]) + AS2( add AS_REG_1, AS_REG_6) + + #if CRYPTOPP_BOOL_X64 + AS2( mov REG_loopEnd, AS_REG_1) + #else + AS_PUSH_IF86( bp) + // AS1( push AS_REG_1) // AS_REG_1 is defined as ecx uner X86 and X32 (see cpu.h) + AS_PUSH_IF86( cx) + #endif + + AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_2+0*16]) + AS2( movdqa xmm1, XMMWORD_PTR [AS_REG_2+1*16]) + AS2( movdqa xmm2, XMMWORD_PTR [AS_REG_2+2*16]) + AS2( movdqa xmm3, XMMWORD_PTR [AS_REG_2+3*16]) + AS2( mov eax, dword ptr [AS_REG_2+4*16]) + + ASL(4) + // gamma and pi +#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE + AS2( test AS_REG_6, 1) + ASJ( jnz, 6, f) +#endif + AS2( movdqa xmm6, xmm2) + AS2( movss xmm6, xmm3) + ASS( pshufd xmm5, xmm6, 0, 3, 2, 1) + AS2( movd xmm6, eax) + AS2( movdqa xmm7, xmm3) + AS2( movss xmm7, xmm6) + ASS( pshufd xmm6, xmm7, 0, 3, 2, 1) +#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE + ASJ( jmp, 7, f) + ASL(6) + AS2( movdqa xmm5, xmm3) + AS3( palignr xmm5, xmm2, 4) + AS2( movd xmm6, eax) + AS3( palignr xmm6, xmm3, 4) + ASL(7) +#endif + + AS2( movd AS_REG_1d, xmm2) + AS1( not AS_REG_1d) + AS2( movd AS_REG_7d, xmm3) + AS2( or AS_REG_1d, AS_REG_7d) + AS2( xor eax, AS_REG_1d) + +#define SSE2_Index(i) ASM_MOD(((i)*13+16), 17) + +#define pi(i) \ + AS2( movd AS_REG_1d, xmm7)\ + AS2( rol AS_REG_1d, ASM_MOD((ASM_MOD(5*i,17)*(ASM_MOD(5*i,17)+1)/2), 32))\ + AS2( mov [AS_REG_2+SSE2_Index(ASM_MOD(5*(i), 17))*4], AS_REG_1d) + +#define pi4(x, y, z, a, b, c, d) \ + AS2( pcmpeqb xmm7, xmm7)\ + AS2( pxor xmm7, x)\ + AS2( por xmm7, y)\ + AS2( pxor xmm7, z)\ + pi(a)\ + ASS( pshuflw xmm7, xmm7, 1, 0, 3, 2)\ + pi(b)\ + AS2( punpckhqdq xmm7, xmm7)\ + pi(c)\ + ASS( pshuflw xmm7, xmm7, 1, 0, 3, 2)\ + pi(d) + + pi4(xmm1, xmm2, xmm3, 1, 5, 9, 13) + pi4(xmm0, xmm1, xmm2, 2, 6, 10, 14) + pi4(xmm6, xmm0, xmm1, 3, 7, 11, 15) + pi4(xmm5, xmm6, xmm0, 4, 8, 12, 16) + + // output keystream and update buffer here to hide partial memory stalls between pi and theta + AS2( movdqa xmm4, xmm3) + AS2( punpcklqdq xmm3, xmm2) // 1 5 2 6 + AS2( punpckhdq xmm4, xmm2) // 9 10 13 14 + AS2( movdqa xmm2, xmm1) + AS2( punpcklqdq xmm1, xmm0) // 3 7 4 8 + AS2( punpckhdq xmm2, xmm0) // 11 12 15 16 + + // keystream + AS2( test AS_REG_3, AS_REG_3) + ASJ( jz, 0, f) + AS2( movdqa xmm6, xmm4) + AS2( punpcklqdq xmm4, xmm2) + AS2( punpckhqdq xmm6, xmm2) + AS2( test AS_REG_4, 15) + ASJ( jnz, 2, f) + AS2( test AS_REG_4, AS_REG_4) + ASJ( jz, 1, f) + AS2( pxor xmm4, [AS_REG_4]) + AS2( pxor xmm6, [AS_REG_4+16]) + AS2( add AS_REG_4, 32) + ASJ( jmp, 1, f) + ASL(2) + AS2( movdqu xmm0, [AS_REG_4]) + AS2( movdqu xmm2, [AS_REG_4+16]) + AS2( pxor xmm4, xmm0) + AS2( pxor xmm6, xmm2) + AS2( add AS_REG_4, 32) + ASL(1) + AS2( test AS_REG_3, 15) + ASJ( jnz, 3, f) + AS2( movdqa XMMWORD_PTR [AS_REG_3], xmm4) + AS2( movdqa XMMWORD_PTR [AS_REG_3+16], xmm6) + AS2( add AS_REG_3, 32) + ASJ( jmp, 0, f) + ASL(3) + AS2( movdqu XMMWORD_PTR [AS_REG_3], xmm4) + AS2( movdqu XMMWORD_PTR [AS_REG_3+16], xmm6) + AS2( add AS_REG_3, 32) + ASL(0) + + // buffer update + AS2( lea AS_REG_1, [AS_REG_6 + 32]) + AS2( and AS_REG_1, 31*32) + AS2( lea AS_REG_7, [AS_REG_6 + (32-24)*32]) + AS2( and AS_REG_7, 31*32) + + AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+0*8]) + AS2( pxor xmm3, xmm0) + ASS( pshufd xmm0, xmm0, 2, 3, 0, 1) + AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+0*8], xmm3) + AS2( pxor xmm0, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+2*8]) + AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+2*8], xmm0) + + AS2( movdqa xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+2*8]) + AS2( pxor xmm1, xmm4) + AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+2*8], xmm1) + AS2( pxor xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+0*8]) + AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+0*8], xmm4) + + // theta + AS2( movdqa xmm3, XMMWORD_PTR [AS_REG_2+3*16]) + AS2( movdqa xmm2, XMMWORD_PTR [AS_REG_2+2*16]) + AS2( movdqa xmm1, XMMWORD_PTR [AS_REG_2+1*16]) + AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_2+0*16]) + +#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE + AS2( test AS_REG_6, 1) + ASJ( jnz, 8, f) +#endif + AS2( movd xmm6, eax) + AS2( movdqa xmm7, xmm3) + AS2( movss xmm7, xmm6) + AS2( movdqa xmm6, xmm2) + AS2( movss xmm6, xmm3) + AS2( movdqa xmm5, xmm1) + AS2( movss xmm5, xmm2) + AS2( movdqa xmm4, xmm0) + AS2( movss xmm4, xmm1) + ASS( pshufd xmm7, xmm7, 0, 3, 2, 1) + ASS( pshufd xmm6, xmm6, 0, 3, 2, 1) + ASS( pshufd xmm5, xmm5, 0, 3, 2, 1) + ASS( pshufd xmm4, xmm4, 0, 3, 2, 1) +#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE + ASJ( jmp, 9, f) + ASL(8) + AS2( movd xmm7, eax) + AS3( palignr xmm7, xmm3, 4) + AS2( movq xmm6, xmm3) + AS3( palignr xmm6, xmm2, 4) + AS2( movq xmm5, xmm2) + AS3( palignr xmm5, xmm1, 4) + AS2( movq xmm4, xmm1) + AS3( palignr xmm4, xmm0, 4) + ASL(9) +#endif + + AS2( xor eax, 1) + AS2( movd AS_REG_1d, xmm0) + AS2( xor eax, AS_REG_1d) + AS2( movd AS_REG_1d, xmm3) + AS2( xor eax, AS_REG_1d) + + AS2( pxor xmm3, xmm2) + AS2( pxor xmm2, xmm1) + AS2( pxor xmm1, xmm0) + AS2( pxor xmm0, xmm7) + AS2( pxor xmm3, xmm7) + AS2( pxor xmm2, xmm6) + AS2( pxor xmm1, xmm5) + AS2( pxor xmm0, xmm4) + + // sigma + AS2( lea AS_REG_1, [AS_REG_6 + (32-4)*32]) + AS2( and AS_REG_1, 31*32) + AS2( lea AS_REG_7, [AS_REG_6 + 16*32]) + AS2( and AS_REG_7, 31*32) + + AS2( movdqa xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+0*16]) + AS2( movdqa xmm5, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+0*16]) + AS2( movdqa xmm6, xmm4) + AS2( punpcklqdq xmm4, xmm5) + AS2( punpckhqdq xmm6, xmm5) + AS2( pxor xmm3, xmm4) + AS2( pxor xmm2, xmm6) + + AS2( movdqa xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+1*16]) + AS2( movdqa xmm5, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+1*16]) + AS2( movdqa xmm6, xmm4) + AS2( punpcklqdq xmm4, xmm5) + AS2( punpckhqdq xmm6, xmm5) + AS2( pxor xmm1, xmm4) + AS2( pxor xmm0, xmm6) + + // loop + AS2( add AS_REG_6, 32) + AS2( cmp AS_REG_6, REG_loopEnd) + ASJ( jne, 4, b) + + // save state + AS2( mov [AS_REG_2+4*16], eax) + AS2( movdqa XMMWORD_PTR [AS_REG_2+3*16], xmm3) + AS2( movdqa XMMWORD_PTR [AS_REG_2+2*16], xmm2) + AS2( movdqa XMMWORD_PTR [AS_REG_2+1*16], xmm1) + AS2( movdqa XMMWORD_PTR [AS_REG_2+0*16], xmm0) + + #if CRYPTOPP_BOOL_X32 + AS2( add esp, 8) + AS_POP_IF86( bp) + #elif CRYPTOPP_BOOL_X86 + AS2( add esp, 4) + AS_POP_IF86( bp) + #endif + ASL(5) + +#if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) + AS_POP_IF86( bx) + ATT_PREFIX + : + #if CRYPTOPP_BOOL_X64 + : "D" (count), "S" (state), "d" (z), "c" (y) + : "%r8", "%r9", "r10", "%eax", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7" + #else + : "c" (count), "d" (state), "S" (z), "D" (y) + : "%eax", "memory", "cc" + #endif + ); +#endif + +#ifdef CRYPTOPP_GENERATE_X64_MASM + movdqa xmm6, [rsp + 0h] + movdqa xmm7, [rsp + 10h] + add rsp, 2*16 + pop rdi + ret + Panama_SSE2_Pull ENDP +#else +} +#endif +#endif // #ifdef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +template +void Panama::Iterate(size_t count, const word32 *p, byte *output, const byte *input, KeystreamOperation operation) +{ + word32 bstart = m_state[17]; + word32 *const aPtr = m_state; + word32 cPtr[17]; + +#define bPtr ((byte *)(aPtr+20)) + +// reorder the state for SSE2 +// a and c: 4 8 12 16 | 3 7 11 15 | 2 6 10 14 | 1 5 9 13 | 0 +// xmm0 xmm1 xmm2 xmm3 eax +#define a(i) aPtr[((i)*13+16) % 17] // 13 is inverse of 4 mod 17 +#define c(i) cPtr[((i)*13+16) % 17] +// b: 0 4 | 1 5 | 2 6 | 3 7 +#define b(i, j) b##i[(j)*2%8 + (j)/4] + +// buffer update +#define US(i) {word32 t=b(0,i); b(0,i)=ConditionalByteReverse(B::ToEnum(), p[i])^t; b(25,(i+6)%8)^=t;} +#define UL(i) {word32 t=b(0,i); b(0,i)=a(i+1)^t; b(25,(i+6)%8)^=t;} +// gamma and pi +#define GP(i) c(5*i%17) = rotlFixed(a(i) ^ (a((i+1)%17) | ~a((i+2)%17)), ((5*i%17)*((5*i%17)+1)/2)%32) +// theta and sigma +#define T(i,x) a(i) = c(i) ^ c((i+1)%17) ^ c((i+4)%17) ^ x +#define TS1S(i) T(i+1, ConditionalByteReverse(B::ToEnum(), p[i])) +#define TS1L(i) T(i+1, b(4,i)) +#define TS2(i) T(i+9, b(16,i)) + + while (count--) + { + if (output) + { +#define PANAMA_OUTPUT(x) \ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, a(0+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, a(1+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, a(2+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a(3+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 4, a(4+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 5, a(5+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 6, a(6+9));\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 7, a(7+9)); + + typedef word32 WordType; + CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(PANAMA_OUTPUT, 4*8); + } + + word32 *const b16 = (word32 *)(bPtr+((bstart+16*32) & 31*32)); + word32 *const b4 = (word32 *)(bPtr+((bstart+(32-4)*32) & 31*32)); + bstart += 32; + word32 *const b0 = (word32 *)(bPtr+((bstart) & 31*32)); + word32 *const b25 = (word32 *)(bPtr+((bstart+(32-25)*32) & 31*32)); + + if (p) + { + US(0); US(1); US(2); US(3); US(4); US(5); US(6); US(7); + } + else + { + UL(0); UL(1); UL(2); UL(3); UL(4); UL(5); UL(6); UL(7); + } + + GP(0); + GP(1); + GP(2); + GP(3); + GP(4); + GP(5); + GP(6); + GP(7); + GP(8); + GP(9); + GP(10); + GP(11); + GP(12); + GP(13); + GP(14); + GP(15); + GP(16); + + T(0,1); + + if (p) + { + TS1S(0); TS1S(1); TS1S(2); TS1S(3); TS1S(4); TS1S(5); TS1S(6); TS1S(7); + p += 8; + } + else + { + TS1L(0); TS1L(1); TS1L(2); TS1L(3); TS1L(4); TS1L(5); TS1L(6); TS1L(7); + } + + TS2(0); TS2(1); TS2(2); TS2(3); TS2(4); TS2(5); TS2(6); TS2(7); + } + m_state[17] = bstart; +} + +namespace Weak { +template +size_t PanamaHash::HashMultipleBlocks(const word32 *input, size_t length) +{ + this->Iterate(length / this->BLOCKSIZE, input); + return length % this->BLOCKSIZE; +} + +template +void PanamaHash::TruncatedFinal(byte *hash, size_t size) +{ + this->ThrowIfInvalidTruncatedSize(size); + + this->PadLastBlock(this->BLOCKSIZE, 0x01); + + HashEndianCorrectedBlock(this->m_data); + + this->Iterate(32); // pull + + FixedSizeSecBlock buf; + this->Iterate(1, NULL, buf.BytePtr(), NULL); + + memcpy(hash, buf, size); + + this->Restart(); // reinit for next use +} +} + +template +void PanamaCipherPolicy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) +{ + CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(length); + assert(length==32); + memcpy(m_key, key, 32); +} + +template +void PanamaCipherPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer); CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(length); + assert(length==32); + this->Reset(); + this->Iterate(1, m_key); + if (iv && IsAligned(iv)) + this->Iterate(1, (const word32 *)iv); + else + { + FixedSizeSecBlock buf; + if (iv) + memcpy(buf, iv, 32); + else + memset(buf, 0, 32); + this->Iterate(1, buf); + } + +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) + if (B::ToEnum() == LITTLE_ENDIAN_ORDER && HasSSE2() && !IsP4()) // SSE2 code is slower on P4 Prescott + Panama_SSE2_Pull(32, this->m_state, NULL, NULL); + else +#endif + this->Iterate(32); +} + +template +unsigned int PanamaCipherPolicy::GetAlignment() const +{ +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) + if (B::ToEnum() == LITTLE_ENDIAN_ORDER && HasSSE2()) + return 16; + else +#endif + return 1; +} + +template +void PanamaCipherPolicy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) +{ +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) + if (B::ToEnum() == LITTLE_ENDIAN_ORDER && HasSSE2()) + Panama_SSE2_Pull(iterationCount, this->m_state, (word32 *)output, (const word32 *)input); + else +#endif + this->Iterate(iterationCount, NULL, output, input, operation); +} + +template class Panama; +template class Panama; + +template class Weak::PanamaHash; +template class Weak::PanamaHash; + +template class PanamaCipherPolicy; +template class PanamaCipherPolicy; + +NAMESPACE_END + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM diff --git a/external/crypto++-5.6.3/panama.h b/external/crypto++-5.6.3/panama.h new file mode 100644 index 000000000..976467a6c --- /dev/null +++ b/external/crypto++-5.6.3/panama.h @@ -0,0 +1,154 @@ +// panama.h - written and placed in the public domain by Wei Dai + +//! \file panama.h +//! \brief Classes for Panama stream cipher + +#ifndef CRYPTOPP_PANAMA_H +#define CRYPTOPP_PANAMA_H + +#include "strciphr.h" +#include "iterhash.h" +#include "secblock.h" + +#if CRYPTOPP_BOOL_X32 +# define CRYPTOPP_DISABLE_PANAMA_ASM +#endif + +NAMESPACE_BEGIN(CryptoPP) + +/// base class, do not use directly +template +class CRYPTOPP_NO_VTABLE Panama +{ +public: + void Reset(); + void Iterate(size_t count, const word32 *p=NULL, byte *output=NULL, const byte *input=NULL, KeystreamOperation operation=WRITE_KEYSTREAM); + +protected: + typedef word32 Stage[8]; + CRYPTOPP_CONSTANT(STAGES = 32) + + FixedSizeAlignedSecBlock m_state; +}; + +namespace Weak { +/// Panama Hash +template +class PanamaHash : protected Panama, public AlgorithmImpl, PanamaHash > +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 32) + PanamaHash() {Panama::Reset();} + unsigned int DigestSize() const {return DIGESTSIZE;} + void TruncatedFinal(byte *hash, size_t size); + static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} + +protected: + void Init() {Panama::Reset();} + void HashEndianCorrectedBlock(const word32 *data) {this->Iterate(1, data);} // push + size_t HashMultipleBlocks(const word32 *input, size_t length); + word32* StateBuf() {return NULL;} +}; +} + +//! MAC construction using a hermetic hash function +template +class HermeticHashFunctionMAC : public AlgorithmImpl > >, T_Info> +{ +public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) + { + CRYPTOPP_UNUSED(params); + + m_key.Assign(key, length); + Restart(); + } + + void Restart() + { + m_hash.Restart(); + m_keyed = false; + } + + void Update(const byte *input, size_t length) + { + if (!m_keyed) + KeyHash(); + m_hash.Update(input, length); + } + + void TruncatedFinal(byte *digest, size_t digestSize) + { + if (!m_keyed) + KeyHash(); + m_hash.TruncatedFinal(digest, digestSize); + m_keyed = false; + } + + unsigned int DigestSize() const + {return m_hash.DigestSize();} + unsigned int BlockSize() const + {return m_hash.BlockSize();} + unsigned int OptimalBlockSize() const + {return m_hash.OptimalBlockSize();} + unsigned int OptimalDataAlignment() const + {return m_hash.OptimalDataAlignment();} + +protected: + void KeyHash() + { + m_hash.Update(m_key, m_key.size()); + m_keyed = true; + } + + T_Hash m_hash; + bool m_keyed; + SecByteBlock m_key; +}; + +namespace Weak { +/// Panama MAC +template +class PanamaMAC : public HermeticHashFunctionMAC > +{ +public: + PanamaMAC() {} + PanamaMAC(const byte *key, unsigned int length) + {this->SetKey(key, length);} +}; +} + +//! algorithm info +template +struct PanamaCipherInfo : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 32> +{ + static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} +}; + +//! _ +template +class PanamaCipherPolicy : public AdditiveCipherConcretePolicy, + public PanamaCipherInfo, + protected Panama +{ +protected: + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); + void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); + bool CipherIsRandomAccess() const {return false;} + void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); + unsigned int GetAlignment() const; + + FixedSizeSecBlock m_key; +}; + +//! Panama Stream Cipher +template +struct PanamaCipher : public PanamaCipherInfo, public SymmetricCipherDocumentation +{ + typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, PanamaCipherInfo > Encryption; + typedef Encryption Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/pch.cpp b/external/crypto++-5.6.3/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/external/crypto++-5.6.3/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/external/crypto++-5.6.3/pch.h b/external/crypto++-5.6.3/pch.h new file mode 100644 index 000000000..1c14f5aa0 --- /dev/null +++ b/external/crypto++-5.6.3/pch.h @@ -0,0 +1,24 @@ +// pch.h - written and placed in the public domain by Wei Dai + +//! \headerfile pch.h +//! \brief Precompiled header file + +#ifndef CRYPTOPP_PCH_H +#define CRYPTOPP_PCH_H + +# ifdef CRYPTOPP_GENERATE_X64_MASM + #include "cpu.h" + +# else + #include "config.h" + + #ifdef USE_PRECOMPILED_HEADERS + #include "simple.h" + #include "secblock.h" + #include "misc.h" + #include "smartptr.h" + #include "stdcpp.h" + #endif +# endif + +#endif // CRYPTOPP_PCH_H diff --git a/external/crypto++-5.6.3/pkcspad.cpp b/external/crypto++-5.6.3/pkcspad.cpp new file mode 100644 index 000000000..6bacee3cd --- /dev/null +++ b/external/crypto++-5.6.3/pkcspad.cpp @@ -0,0 +1,129 @@ +// pkcspad.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_PKCSPAD_CPP // SunCC workaround: compiler could cause this file to be included twice +#define CRYPTOPP_PKCSPAD_CPP + +#include "pkcspad.h" +#include "misc.h" +#include + +NAMESPACE_BEGIN(CryptoPP) + +// more in dll.cpp +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x02,0x05,0x00,0x04,0x10}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x04,0x10}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2b,0x24,0x03,0x02,0x01,0x05,0x00,0x04,0x14}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x29,0x30,0x0D,0x06,0x09,0x2B,0x06,0x01,0x04,0x01,0xDA,0x47,0x0C,0x02,0x05,0x00,0x04,0x18}; +template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); + +size_t PKCS_EncryptionPaddingScheme::MaxUnpaddedLength(size_t paddedLength) const +{ + return SaturatingSubtract(paddedLength/8, 10U); +} + +void PKCS_EncryptionPaddingScheme::Pad(RandomNumberGenerator& rng, const byte *input, size_t inputLen, byte *pkcsBlock, size_t pkcsBlockLen, const NameValuePairs& parameters) const +{ + CRYPTOPP_UNUSED(parameters); + assert (inputLen <= MaxUnpaddedLength(pkcsBlockLen)); // this should be checked by caller + + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + pkcsBlock[0] = 0; + pkcsBlock++; + } + pkcsBlockLen /= 8; + + pkcsBlock[0] = 2; // block type 2 + + // pad with non-zero random bytes + for (unsigned i = 1; i < pkcsBlockLen-inputLen-1; i++) + pkcsBlock[i] = (byte)rng.GenerateWord32(1, 0xff); + + pkcsBlock[pkcsBlockLen-inputLen-1] = 0; // separator + memcpy(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen); +} + +DecodingResult PKCS_EncryptionPaddingScheme::Unpad(const byte *pkcsBlock, size_t pkcsBlockLen, byte *output, const NameValuePairs& parameters) const +{ + CRYPTOPP_UNUSED(parameters); + bool invalid = false; + size_t maxOutputLen = MaxUnpaddedLength(pkcsBlockLen); + + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + invalid = (pkcsBlock[0] != 0) || invalid; + pkcsBlock++; + } + pkcsBlockLen /= 8; + + // Require block type 2. + invalid = (pkcsBlock[0] != 2) || invalid; + + // skip past the padding until we find the separator + size_t i=1; + while (i maxOutputLen) || invalid; + + if (invalid) + return DecodingResult(); + + memcpy (output, pkcsBlock+i, outputLen); + return DecodingResult(outputLen); +} + +// ******************************************************** + +#ifndef CRYPTOPP_IMPORTS + +void PKCS1v15_SignatureMessageEncodingMethod::ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); + CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); + assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); + + size_t pkcsBlockLen = representativeBitLength; + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + representative[0] = 0; + representative++; + } + pkcsBlockLen /= 8; + + representative[0] = 1; // block type 1 + + unsigned int digestSize = hash.DigestSize(); + byte *pPadding = representative + 1; + byte *pDigest = representative + pkcsBlockLen - digestSize; + byte *pHashId = pDigest - hashIdentifier.second; + byte *pSeparator = pHashId - 1; + + // pad with 0xff + memset(pPadding, 0xff, pSeparator-pPadding); + *pSeparator = 0; + memcpy(pHashId, hashIdentifier.first, hashIdentifier.second); + hash.Final(pDigest); +} + +#endif + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/pkcspad.h b/external/crypto++-5.6.3/pkcspad.h new file mode 100644 index 000000000..99b752021 --- /dev/null +++ b/external/crypto++-5.6.3/pkcspad.h @@ -0,0 +1,99 @@ +// pkcspad.h - written and placed in the public domain by Wei Dai + +//! \headerfile pkcspad.h +//! \brief Classes for PKCS padding schemes + +#ifndef CRYPTOPP_PKCSPAD_H +#define CRYPTOPP_PKCSPAD_H + +#include "cryptlib.h" +#include "pubkey.h" + +#ifdef CRYPTOPP_IS_DLL +#include "sha.h" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +//! EME-PKCS1-v1_5 +class PKCS_EncryptionPaddingScheme : public PK_EncryptionMessageEncodingMethod +{ +public: + static const char * StaticAlgorithmName() {return "EME-PKCS1-v1_5";} + + size_t MaxUnpaddedLength(size_t paddedLength) const; + void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedLength, const NameValuePairs ¶meters) const; + DecodingResult Unpad(const byte *padded, size_t paddedLength, byte *raw, const NameValuePairs ¶meters) const; +}; + +template class PKCS_DigestDecoration +{ +public: + static const byte decoration[]; + static const unsigned int length; +}; + +// PKCS_DigestDecoration can be instantiated with the following +// classes as specified in PKCS#1 v2.0 and P1363a +class SHA1; +class RIPEMD160; +class Tiger; +class SHA224; +class SHA256; +class SHA384; +class SHA512; +namespace Weak1 { +class MD2; +class MD5; +} +// end of list + +#ifdef CRYPTOPP_IS_DLL +CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; +CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; +CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; +CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; +CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; +#endif + +//! EMSA-PKCS1-v1_5 +class CRYPTOPP_DLL PKCS1v15_SignatureMessageEncodingMethod : public PK_DeterministicSignatureMessageEncodingMethod +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "EMSA-PKCS1-v1_5";} + + size_t MinRepresentativeBitLength(size_t hashIdentifierSize, size_t digestSize) const + {return 8 * (digestSize + hashIdentifierSize + 10);} + + void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; + + struct HashIdentifierLookup + { + template struct HashIdentifierLookup2 + { + static HashIdentifier Lookup() + { + return HashIdentifier(PKCS_DigestDecoration::decoration, PKCS_DigestDecoration::length); + } + }; + }; +}; + +//! PKCS #1 version 1.5, for use with RSAES and RSASS +/*! Only the following hash functions are supported by this signature standard: + \dontinclude pkcspad.h + \skip can be instantiated + \until end of list +*/ +struct PKCS1v15 : public SignatureStandard, public EncryptionStandard +{ + typedef PKCS_EncryptionPaddingScheme EncryptionMessageEncodingMethod; + typedef PKCS1v15_SignatureMessageEncodingMethod SignatureMessageEncodingMethod; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/polynomi.cpp b/external/crypto++-5.6.3/polynomi.cpp new file mode 100644 index 000000000..734cae926 --- /dev/null +++ b/external/crypto++-5.6.3/polynomi.cpp @@ -0,0 +1,577 @@ +// polynomi.cpp - written and placed in the public domain by Wei Dai + +// Part of the code for polynomial evaluation and interpolation +// originally came from Hal Finney's public domain secsplit.c. + +#include "pch.h" +#include "polynomi.h" +#include "secblock.h" + +#include +#include + +NAMESPACE_BEGIN(CryptoPP) + +template +void PolynomialOver::Randomize(RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) +{ + m_coefficients.resize(parameter.m_coefficientCount); + for (unsigned int i=0; i +void PolynomialOver::FromStr(const char *str, const Ring &ring) +{ + std::istringstream in((char *)str); + bool positive = true; + CoefficientType coef; + unsigned int power; + + while (in) + { + std::ws(in); + if (in.peek() == 'x') + coef = ring.MultiplicativeIdentity(); + else + in >> coef; + + std::ws(in); + if (in.peek() == 'x') + { + in.get(); + std::ws(in); + if (in.peek() == '^') + { + in.get(); + in >> power; + } + else + power = 1; + } + else + power = 0; + + if (!positive) + coef = ring.Inverse(coef); + + SetCoefficient(power, coef, ring); + + std::ws(in); + switch (in.get()) + { + case '+': + positive = true; + break; + case '-': + positive = false; + break; + default: + return; // something's wrong with the input string + } + } +} + +template +unsigned int PolynomialOver::CoefficientCount(const Ring &ring) const +{ + unsigned count = m_coefficients.size(); + while (count && ring.Equal(m_coefficients[count-1], ring.Identity())) + count--; + const_cast &>(m_coefficients).resize(count); + return count; +} + +template +typename PolynomialOver::CoefficientType PolynomialOver::GetCoefficient(unsigned int i, const Ring &ring) const +{ + return (i < m_coefficients.size()) ? m_coefficients[i] : ring.Identity(); +} + +template +PolynomialOver& PolynomialOver::operator=(const PolynomialOver& t) +{ + if (this != &t) + { + m_coefficients.resize(t.m_coefficients.size()); + for (unsigned int i=0; i +PolynomialOver& PolynomialOver::Accumulate(const PolynomialOver& t, const Ring &ring) +{ + unsigned int count = t.CoefficientCount(ring); + + if (count > CoefficientCount(ring)) + m_coefficients.resize(count, ring.Identity()); + + for (unsigned int i=0; i +PolynomialOver& PolynomialOver::Reduce(const PolynomialOver& t, const Ring &ring) +{ + unsigned int count = t.CoefficientCount(ring); + + if (count > CoefficientCount(ring)) + m_coefficients.resize(count, ring.Identity()); + + for (unsigned int i=0; i +typename PolynomialOver::CoefficientType PolynomialOver::EvaluateAt(const CoefficientType &x, const Ring &ring) const +{ + int degree = Degree(ring); + + if (degree < 0) + return ring.Identity(); + + CoefficientType result = m_coefficients[degree]; + for (int j=degree-1; j>=0; j--) + { + result = ring.Multiply(result, x); + ring.Accumulate(result, m_coefficients[j]); + } + return result; +} + +template +PolynomialOver& PolynomialOver::ShiftLeft(unsigned int n, const Ring &ring) +{ + unsigned int i = CoefficientCount(ring) + n; + m_coefficients.resize(i, ring.Identity()); + while (i > n) + { + i--; + m_coefficients[i] = m_coefficients[i-n]; + } + while (i) + { + i--; + m_coefficients[i] = ring.Identity(); + } + return *this; +} + +template +PolynomialOver& PolynomialOver::ShiftRight(unsigned int n, const Ring &ring) +{ + unsigned int count = CoefficientCount(ring); + if (count > n) + { + for (unsigned int i=0; i +void PolynomialOver::SetCoefficient(unsigned int i, const CoefficientType &value, const Ring &ring) +{ + if (i >= m_coefficients.size()) + m_coefficients.resize(i+1, ring.Identity()); + m_coefficients[i] = value; +} + +template +void PolynomialOver::Negate(const Ring &ring) +{ + unsigned int count = CoefficientCount(ring); + for (unsigned int i=0; i +void PolynomialOver::swap(PolynomialOver &t) +{ + m_coefficients.swap(t.m_coefficients); +} + +template +bool PolynomialOver::Equals(const PolynomialOver& t, const Ring &ring) const +{ + unsigned int count = CoefficientCount(ring); + + if (count != t.CoefficientCount(ring)) + return false; + + for (unsigned int i=0; i +PolynomialOver PolynomialOver::Plus(const PolynomialOver& t, const Ring &ring) const +{ + unsigned int i; + unsigned int count = CoefficientCount(ring); + unsigned int tCount = t.CoefficientCount(ring); + + if (count > tCount) + { + PolynomialOver result(ring, count); + + for (i=0; i result(ring, tCount); + + for (i=0; i +PolynomialOver PolynomialOver::Minus(const PolynomialOver& t, const Ring &ring) const +{ + unsigned int i; + unsigned int count = CoefficientCount(ring); + unsigned int tCount = t.CoefficientCount(ring); + + if (count > tCount) + { + PolynomialOver result(ring, count); + + for (i=0; i result(ring, tCount); + + for (i=0; i +PolynomialOver PolynomialOver::Inverse(const Ring &ring) const +{ + unsigned int count = CoefficientCount(ring); + PolynomialOver result(ring, count); + + for (unsigned int i=0; i +PolynomialOver PolynomialOver::Times(const PolynomialOver& t, const Ring &ring) const +{ + if (IsZero(ring) || t.IsZero(ring)) + return PolynomialOver(); + + unsigned int count1 = CoefficientCount(ring), count2 = t.CoefficientCount(ring); + PolynomialOver result(ring, count1 + count2 - 1); + + for (unsigned int i=0; i +PolynomialOver PolynomialOver::DividedBy(const PolynomialOver& t, const Ring &ring) const +{ + PolynomialOver remainder, quotient; + Divide(remainder, quotient, *this, t, ring); + return quotient; +} + +template +PolynomialOver PolynomialOver::Modulo(const PolynomialOver& t, const Ring &ring) const +{ + PolynomialOver remainder, quotient; + Divide(remainder, quotient, *this, t, ring); + return remainder; +} + +template +PolynomialOver PolynomialOver::MultiplicativeInverse(const Ring &ring) const +{ + return Degree(ring)==0 ? ring.MultiplicativeInverse(m_coefficients[0]) : ring.Identity(); +} + +template +bool PolynomialOver::IsUnit(const Ring &ring) const +{ + return Degree(ring)==0 && ring.IsUnit(m_coefficients[0]); +} + +template +std::istream& PolynomialOver::Input(std::istream &in, const Ring &ring) +{ + char c; + unsigned int length = 0; + SecBlock str(length + 16); + bool paren = false; + + std::ws(in); + + if (in.peek() == '(') + { + paren = true; + in.get(); + } + + do + { + in.read(&c, 1); + str[length++] = c; + if (length >= str.size()) + str.Grow(length + 16); + } + // if we started with a left paren, then read until we find a right paren, + // otherwise read until the end of the line + while (in && ((paren && c != ')') || (!paren && c != '\n'))); + + str[length-1] = '\0'; + *this = PolynomialOver(str, ring); + + return in; +} + +template +std::ostream& PolynomialOver::Output(std::ostream &out, const Ring &ring) const +{ + unsigned int i = CoefficientCount(ring); + if (i) + { + bool firstTerm = true; + + while (i--) + { + if (m_coefficients[i] != ring.Identity()) + { + if (firstTerm) + { + firstTerm = false; + if (!i || !ring.Equal(m_coefficients[i], ring.MultiplicativeIdentity())) + out << m_coefficients[i]; + } + else + { + CoefficientType inverse = ring.Inverse(m_coefficients[i]); + std::ostringstream pstr, nstr; + + pstr << m_coefficients[i]; + nstr << inverse; + + if (pstr.str().size() <= nstr.str().size()) + { + out << " + "; + if (!i || !ring.Equal(m_coefficients[i], ring.MultiplicativeIdentity())) + out << m_coefficients[i]; + } + else + { + out << " - "; + if (!i || !ring.Equal(inverse, ring.MultiplicativeIdentity())) + out << inverse; + } + } + + switch (i) + { + case 0: + break; + case 1: + out << "x"; + break; + default: + out << "x^" << i; + } + } + } + } + else + { + out << ring.Identity(); + } + return out; +} + +template +void PolynomialOver::Divide(PolynomialOver &r, PolynomialOver &q, const PolynomialOver &a, const PolynomialOver &d, const Ring &ring) +{ + unsigned int i = a.CoefficientCount(ring); + const int dDegree = d.Degree(ring); + + if (dDegree < 0) + throw DivideByZero(); + + r = a; + q.m_coefficients.resize(STDMAX(0, int(i - dDegree))); + + while (i > (unsigned int)dDegree) + { + --i; + q.m_coefficients[i-dDegree] = ring.Divide(r.m_coefficients[i], d.m_coefficients[dDegree]); + for (int j=0; j<=dDegree; j++) + ring.Reduce(r.m_coefficients[i-dDegree+j], ring.Multiply(q.m_coefficients[i-dDegree], d.m_coefficients[j])); + } + + r.CoefficientCount(ring); // resize r.m_coefficients +} + +// ******************************************************** + +// helper function for Interpolate() and InterpolateAt() +template +void RingOfPolynomialsOver::CalculateAlpha(std::vector &alpha, const CoefficientType x[], const CoefficientType y[], unsigned int n) const +{ + for (unsigned int j=0; j=k; --j) + { + m_ring.Reduce(alpha[j], alpha[j-1]); + + CoefficientType d = m_ring.Subtract(x[j], x[j-k]); + if (!m_ring.IsUnit(d)) + throw InterpolationFailed(); + alpha[j] = m_ring.Divide(alpha[j], d); + } + } +} + +template +typename RingOfPolynomialsOver::Element RingOfPolynomialsOver::Interpolate(const CoefficientType x[], const CoefficientType y[], unsigned int n) const +{ + assert(n > 0); + + std::vector alpha(n); + CalculateAlpha(alpha, x, y, n); + + std::vector coefficients((size_t)n, m_ring.Identity()); + coefficients[0] = alpha[n-1]; + + for (int j=n-2; j>=0; --j) + { + for (unsigned int i=n-j-1; i>0; i--) + coefficients[i] = m_ring.Subtract(coefficients[i-1], m_ring.Multiply(coefficients[i], x[j])); + + coefficients[0] = m_ring.Subtract(alpha[j], m_ring.Multiply(coefficients[0], x[j])); + } + + return PolynomialOver(coefficients.begin(), coefficients.end()); +} + +template +typename RingOfPolynomialsOver::CoefficientType RingOfPolynomialsOver::InterpolateAt(const CoefficientType &position, const CoefficientType x[], const CoefficientType y[], unsigned int n) const +{ + assert(n > 0); + + std::vector alpha(n); + CalculateAlpha(alpha, x, y, n); + + CoefficientType result = alpha[n-1]; + for (int j=n-2; j>=0; --j) + { + result = m_ring.Multiply(result, m_ring.Subtract(position, x[j])); + m_ring.Accumulate(result, alpha[j]); + } + return result; +} + +template +void PrepareBulkPolynomialInterpolation(const Ring &ring, Element *w, const Element x[], unsigned int n) +{ + for (unsigned int i=0; i +void PrepareBulkPolynomialInterpolationAt(const Ring &ring, Element *v, const Element &position, const Element x[], const Element w[], unsigned int n) +{ + assert(n > 0); + + std::vector a(2*n-1); + unsigned int i; + + for (i=0; i1; i--) + a[i-1] = ring.Multiply(a[2*i], a[2*i-1]); + + a[0] = ring.MultiplicativeIdentity(); + + for (i=0; i +Element BulkPolynomialInterpolateAt(const Ring &ring, const Element y[], const Element v[], unsigned int n) +{ + Element result = ring.Identity(); + for (unsigned int i=0; i +const PolynomialOverFixedRing &PolynomialOverFixedRing::Zero() +{ + return Singleton().Ref(); +} + +template +const PolynomialOverFixedRing &PolynomialOverFixedRing::One() +{ + return Singleton().Ref(); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/polynomi.h b/external/crypto++-5.6.3/polynomi.h new file mode 100644 index 000000000..de043e6d8 --- /dev/null +++ b/external/crypto++-5.6.3/polynomi.h @@ -0,0 +1,467 @@ +// polynomi.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile polynomi.h +//! \brief Classes for polynomial basis and operations + + +#ifndef CRYPTOPP_POLYNOMI_H +#define CRYPTOPP_POLYNOMI_H + +/*! \file */ + +#include "cryptlib.h" +#include "secblock.h" +#include "algebra.h" +#include "misc.h" + +#include +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! represents single-variable polynomials over arbitrary rings +/*! \nosubgrouping */ +template class PolynomialOver +{ +public: + //! \name ENUMS, EXCEPTIONS, and TYPEDEFS + //@{ + //! division by zero exception + class DivideByZero : public Exception + { + public: + DivideByZero() : Exception(OTHER_ERROR, "PolynomialOver: division by zero") {} + }; + + //! specify the distribution for randomization functions + class RandomizationParameter + { + public: + RandomizationParameter(unsigned int coefficientCount, const typename T::RandomizationParameter &coefficientParameter ) + : m_coefficientCount(coefficientCount), m_coefficientParameter(coefficientParameter) {} + + private: + unsigned int m_coefficientCount; + typename T::RandomizationParameter m_coefficientParameter; + friend class PolynomialOver; + }; + + typedef T Ring; + typedef typename T::Element CoefficientType; + //@} + + //! \name CREATORS + //@{ + //! creates the zero polynomial + PolynomialOver() {} + + //! + PolynomialOver(const Ring &ring, unsigned int count) + : m_coefficients((size_t)count, ring.Identity()) {} + + //! copy constructor + PolynomialOver(const PolynomialOver &t) + : m_coefficients(t.m_coefficients.size()) {*this = t;} + + //! construct constant polynomial + PolynomialOver(const CoefficientType &element) + : m_coefficients(1, element) {} + + //! construct polynomial with specified coefficients, starting from coefficient of x^0 + template PolynomialOver(Iterator begin, Iterator end) + : m_coefficients(begin, end) {} + + //! convert from string + PolynomialOver(const char *str, const Ring &ring) {FromStr(str, ring);} + + //! convert from big-endian byte array + PolynomialOver(const byte *encodedPolynomialOver, unsigned int byteCount); + + //! convert from Basic Encoding Rules encoded byte array + explicit PolynomialOver(const byte *BEREncodedPolynomialOver); + + //! convert from BER encoded byte array stored in a BufferedTransformation object + explicit PolynomialOver(BufferedTransformation &bt); + + //! create a random PolynomialOver + PolynomialOver(RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) + {Randomize(rng, parameter, ring);} + //@} + + //! \name ACCESSORS + //@{ + //! the zero polynomial will return a degree of -1 + int Degree(const Ring &ring) const {return int(CoefficientCount(ring))-1;} + //! + unsigned int CoefficientCount(const Ring &ring) const; + //! return coefficient for x^i + CoefficientType GetCoefficient(unsigned int i, const Ring &ring) const; + //@} + + //! \name MANIPULATORS + //@{ + //! + PolynomialOver& operator=(const PolynomialOver& t); + + //! + void Randomize(RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring); + + //! set the coefficient for x^i to value + void SetCoefficient(unsigned int i, const CoefficientType &value, const Ring &ring); + + //! + void Negate(const Ring &ring); + + //! + void swap(PolynomialOver &t); + //@} + + + //! \name BASIC ARITHMETIC ON POLYNOMIALS + //@{ + bool Equals(const PolynomialOver &t, const Ring &ring) const; + bool IsZero(const Ring &ring) const {return CoefficientCount(ring)==0;} + + PolynomialOver Plus(const PolynomialOver& t, const Ring &ring) const; + PolynomialOver Minus(const PolynomialOver& t, const Ring &ring) const; + PolynomialOver Inverse(const Ring &ring) const; + + PolynomialOver Times(const PolynomialOver& t, const Ring &ring) const; + PolynomialOver DividedBy(const PolynomialOver& t, const Ring &ring) const; + PolynomialOver Modulo(const PolynomialOver& t, const Ring &ring) const; + PolynomialOver MultiplicativeInverse(const Ring &ring) const; + bool IsUnit(const Ring &ring) const; + + PolynomialOver& Accumulate(const PolynomialOver& t, const Ring &ring); + PolynomialOver& Reduce(const PolynomialOver& t, const Ring &ring); + + //! + PolynomialOver Doubled(const Ring &ring) const {return Plus(*this, ring);} + //! + PolynomialOver Squared(const Ring &ring) const {return Times(*this, ring);} + + CoefficientType EvaluateAt(const CoefficientType &x, const Ring &ring) const; + + PolynomialOver& ShiftLeft(unsigned int n, const Ring &ring); + PolynomialOver& ShiftRight(unsigned int n, const Ring &ring); + + //! calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d) + static void Divide(PolynomialOver &r, PolynomialOver &q, const PolynomialOver &a, const PolynomialOver &d, const Ring &ring); + //@} + + //! \name INPUT/OUTPUT + //@{ + std::istream& Input(std::istream &in, const Ring &ring); + std::ostream& Output(std::ostream &out, const Ring &ring) const; + //@} + +private: + void FromStr(const char *str, const Ring &ring); + + std::vector m_coefficients; +}; + +//! Polynomials over a fixed ring +/*! Having a fixed ring allows overloaded operators */ +template class PolynomialOverFixedRing : private PolynomialOver +{ + typedef PolynomialOver B; + typedef PolynomialOverFixedRing ThisType; + +public: + typedef T Ring; + typedef typename T::Element CoefficientType; + typedef typename B::DivideByZero DivideByZero; + typedef typename B::RandomizationParameter RandomizationParameter; + + //! \name CREATORS + //@{ + //! creates the zero polynomial + PolynomialOverFixedRing(unsigned int count = 0) : B(ms_fixedRing, count) {} + + //! copy constructor + PolynomialOverFixedRing(const ThisType &t) : B(t) {} + + explicit PolynomialOverFixedRing(const B &t) : B(t) {} + + //! construct constant polynomial + PolynomialOverFixedRing(const CoefficientType &element) : B(element) {} + + //! construct polynomial with specified coefficients, starting from coefficient of x^0 + template PolynomialOverFixedRing(Iterator first, Iterator last) + : B(first, last) {} + + //! convert from string + explicit PolynomialOverFixedRing(const char *str) : B(str, ms_fixedRing) {} + + //! convert from big-endian byte array + PolynomialOverFixedRing(const byte *encodedPoly, unsigned int byteCount) : B(encodedPoly, byteCount) {} + + //! convert from Basic Encoding Rules encoded byte array + explicit PolynomialOverFixedRing(const byte *BEREncodedPoly) : B(BEREncodedPoly) {} + + //! convert from BER encoded byte array stored in a BufferedTransformation object + explicit PolynomialOverFixedRing(BufferedTransformation &bt) : B(bt) {} + + //! create a random PolynomialOverFixedRing + PolynomialOverFixedRing(RandomNumberGenerator &rng, const RandomizationParameter ¶meter) : B(rng, parameter, ms_fixedRing) {} + + static const ThisType &Zero(); + static const ThisType &One(); + //@} + + //! \name ACCESSORS + //@{ + //! the zero polynomial will return a degree of -1 + int Degree() const {return B::Degree(ms_fixedRing);} + //! degree + 1 + unsigned int CoefficientCount() const {return B::CoefficientCount(ms_fixedRing);} + //! return coefficient for x^i + CoefficientType GetCoefficient(unsigned int i) const {return B::GetCoefficient(i, ms_fixedRing);} + //! return coefficient for x^i + CoefficientType operator[](unsigned int i) const {return B::GetCoefficient(i, ms_fixedRing);} + //@} + + //! \name MANIPULATORS + //@{ + //! + ThisType& operator=(const ThisType& t) {B::operator=(t); return *this;} + //! + ThisType& operator+=(const ThisType& t) {Accumulate(t, ms_fixedRing); return *this;} + //! + ThisType& operator-=(const ThisType& t) {Reduce(t, ms_fixedRing); return *this;} + //! + ThisType& operator*=(const ThisType& t) {return *this = *this*t;} + //! + ThisType& operator/=(const ThisType& t) {return *this = *this/t;} + //! + ThisType& operator%=(const ThisType& t) {return *this = *this%t;} + + //! + ThisType& operator<<=(unsigned int n) {ShiftLeft(n, ms_fixedRing); return *this;} + //! + ThisType& operator>>=(unsigned int n) {ShiftRight(n, ms_fixedRing); return *this;} + + //! set the coefficient for x^i to value + void SetCoefficient(unsigned int i, const CoefficientType &value) {B::SetCoefficient(i, value, ms_fixedRing);} + + //! + void Randomize(RandomNumberGenerator &rng, const RandomizationParameter ¶meter) {B::Randomize(rng, parameter, ms_fixedRing);} + + //! + void Negate() {B::Negate(ms_fixedRing);} + + void swap(ThisType &t) {B::swap(t);} + //@} + + //! \name UNARY OPERATORS + //@{ + //! + bool operator!() const {return CoefficientCount()==0;} + //! + ThisType operator+() const {return *this;} + //! + ThisType operator-() const {return ThisType(Inverse(ms_fixedRing));} + //@} + + //! \name BINARY OPERATORS + //@{ + //! + friend ThisType operator>>(ThisType a, unsigned int n) {return ThisType(a>>=n);} + //! + friend ThisType operator<<(ThisType a, unsigned int n) {return ThisType(a<<=n);} + //@} + + //! \name OTHER ARITHMETIC FUNCTIONS + //@{ + //! + ThisType MultiplicativeInverse() const {return ThisType(B::MultiplicativeInverse(ms_fixedRing));} + //! + bool IsUnit() const {return B::IsUnit(ms_fixedRing);} + + //! + ThisType Doubled() const {return ThisType(B::Doubled(ms_fixedRing));} + //! + ThisType Squared() const {return ThisType(B::Squared(ms_fixedRing));} + + CoefficientType EvaluateAt(const CoefficientType &x) const {return B::EvaluateAt(x, ms_fixedRing);} + + //! calculate r and q such that (a == d*q + r) && (0 <= r < abs(d)) + static void Divide(ThisType &r, ThisType &q, const ThisType &a, const ThisType &d) + {B::Divide(r, q, a, d, ms_fixedRing);} + //@} + + //! \name INPUT/OUTPUT + //@{ + //! + friend std::istream& operator>>(std::istream& in, ThisType &a) + {return a.Input(in, ms_fixedRing);} + //! + friend std::ostream& operator<<(std::ostream& out, const ThisType &a) + {return a.Output(out, ms_fixedRing);} + //@} + +private: + struct NewOnePolynomial + { + ThisType * operator()() const + { + return new ThisType(ms_fixedRing.MultiplicativeIdentity()); + } + }; + + static const Ring ms_fixedRing; +}; + +//! Ring of polynomials over another ring +template class RingOfPolynomialsOver : public AbstractEuclideanDomain > +{ +public: + typedef T CoefficientRing; + typedef PolynomialOver Element; + typedef typename Element::CoefficientType CoefficientType; + typedef typename Element::RandomizationParameter RandomizationParameter; + + RingOfPolynomialsOver(const CoefficientRing &ring) : m_ring(ring) {} + + Element RandomElement(RandomNumberGenerator &rng, const RandomizationParameter ¶meter) + {return Element(rng, parameter, m_ring);} + + bool Equal(const Element &a, const Element &b) const + {return a.Equals(b, m_ring);} + + const Element& Identity() const + {return this->result = m_ring.Identity();} + + const Element& Add(const Element &a, const Element &b) const + {return this->result = a.Plus(b, m_ring);} + + Element& Accumulate(Element &a, const Element &b) const + {a.Accumulate(b, m_ring); return a;} + + const Element& Inverse(const Element &a) const + {return this->result = a.Inverse(m_ring);} + + const Element& Subtract(const Element &a, const Element &b) const + {return this->result = a.Minus(b, m_ring);} + + Element& Reduce(Element &a, const Element &b) const + {return a.Reduce(b, m_ring);} + + const Element& Double(const Element &a) const + {return this->result = a.Doubled(m_ring);} + + const Element& MultiplicativeIdentity() const + {return this->result = m_ring.MultiplicativeIdentity();} + + const Element& Multiply(const Element &a, const Element &b) const + {return this->result = a.Times(b, m_ring);} + + const Element& Square(const Element &a) const + {return this->result = a.Squared(m_ring);} + + bool IsUnit(const Element &a) const + {return a.IsUnit(m_ring);} + + const Element& MultiplicativeInverse(const Element &a) const + {return this->result = a.MultiplicativeInverse(m_ring);} + + const Element& Divide(const Element &a, const Element &b) const + {return this->result = a.DividedBy(b, m_ring);} + + const Element& Mod(const Element &a, const Element &b) const + {return this->result = a.Modulo(b, m_ring);} + + void DivisionAlgorithm(Element &r, Element &q, const Element &a, const Element &d) const + {Element::Divide(r, q, a, d, m_ring);} + + class InterpolationFailed : public Exception + { + public: + InterpolationFailed() : Exception(OTHER_ERROR, "RingOfPolynomialsOver: interpolation failed") {} + }; + + Element Interpolate(const CoefficientType x[], const CoefficientType y[], unsigned int n) const; + + // a faster version of Interpolate(x, y, n).EvaluateAt(position) + CoefficientType InterpolateAt(const CoefficientType &position, const CoefficientType x[], const CoefficientType y[], unsigned int n) const; +/* + void PrepareBulkInterpolation(CoefficientType *w, const CoefficientType x[], unsigned int n) const; + void PrepareBulkInterpolationAt(CoefficientType *v, const CoefficientType &position, const CoefficientType x[], const CoefficientType w[], unsigned int n) const; + CoefficientType BulkInterpolateAt(const CoefficientType y[], const CoefficientType v[], unsigned int n) const; +*/ +protected: + void CalculateAlpha(std::vector &alpha, const CoefficientType x[], const CoefficientType y[], unsigned int n) const; + + CoefficientRing m_ring; +}; + +template +void PrepareBulkPolynomialInterpolation(const Ring &ring, Element *w, const Element x[], unsigned int n); +template +void PrepareBulkPolynomialInterpolationAt(const Ring &ring, Element *v, const Element &position, const Element x[], const Element w[], unsigned int n); +template +Element BulkPolynomialInterpolateAt(const Ring &ring, const Element y[], const Element v[], unsigned int n); + +//! +template +inline bool operator==(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return a.Equals(b, a.ms_fixedRing);} +//! +template +inline bool operator!=(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return !(a==b);} + +//! +template +inline bool operator> (const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return a.Degree() > b.Degree();} +//! +template +inline bool operator>=(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return a.Degree() >= b.Degree();} +//! +template +inline bool operator< (const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return a.Degree() < b.Degree();} +//! +template +inline bool operator<=(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return a.Degree() <= b.Degree();} + +//! +template +inline CryptoPP::PolynomialOverFixedRing operator+(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return CryptoPP::PolynomialOverFixedRing(a.Plus(b, a.ms_fixedRing));} +//! +template +inline CryptoPP::PolynomialOverFixedRing operator-(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return CryptoPP::PolynomialOverFixedRing(a.Minus(b, a.ms_fixedRing));} +//! +template +inline CryptoPP::PolynomialOverFixedRing operator*(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return CryptoPP::PolynomialOverFixedRing(a.Times(b, a.ms_fixedRing));} +//! +template +inline CryptoPP::PolynomialOverFixedRing operator/(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return CryptoPP::PolynomialOverFixedRing(a.DividedBy(b, a.ms_fixedRing));} +//! +template +inline CryptoPP::PolynomialOverFixedRing operator%(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) + {return CryptoPP::PolynomialOverFixedRing(a.Modulo(b, a.ms_fixedRing));} + +NAMESPACE_END + +NAMESPACE_BEGIN(std) +template inline void swap(CryptoPP::PolynomialOver &a, CryptoPP::PolynomialOver &b) +{ + a.swap(b); +} +template inline void swap(CryptoPP::PolynomialOverFixedRing &a, CryptoPP::PolynomialOverFixedRing &b) +{ + a.swap(b); +} +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/pssr.cpp b/external/crypto++-5.6.3/pssr.cpp new file mode 100644 index 000000000..fd873bb61 --- /dev/null +++ b/external/crypto++-5.6.3/pssr.cpp @@ -0,0 +1,161 @@ +// pssr.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "pssr.h" +#include "misc.h" + +#include + +NAMESPACE_BEGIN(CryptoPP) + +// more in dll.cpp +template<> const byte EMSA2HashId::id = 0x31; +template<> const byte EMSA2HashId::id = 0x32; +template<> const byte EMSA2HashId::id = 0x37; + +#ifndef CRYPTOPP_IMPORTS + +size_t PSSR_MEM_Base::MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const +{ + size_t saltLen = SaltLen(digestLength); + size_t minPadLen = MinPadLen(digestLength); + return 9 + 8*(minPadLen + saltLen + digestLength + hashIdentifierLength); +} + +size_t PSSR_MEM_Base::MaxRecoverableLength(size_t representativeBitLength, size_t hashIdentifierLength, size_t digestLength) const +{ + if (AllowRecovery()) + return SaturatingSubtract(representativeBitLength, MinRepresentativeBitLength(hashIdentifierLength, digestLength)) / 8; + return 0; +} + +bool PSSR_MEM_Base::IsProbabilistic() const +{ + return SaltLen(1) > 0; +} + +bool PSSR_MEM_Base::AllowNonrecoverablePart() const +{ + return true; +} + +bool PSSR_MEM_Base::RecoverablePartFirst() const +{ + return false; +} + +void PSSR_MEM_Base::ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); + CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); + assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); + + const size_t u = hashIdentifier.second + 1; + const size_t representativeByteLength = BitsToBytes(representativeBitLength); + const size_t digestSize = hash.DigestSize(); + const size_t saltSize = SaltLen(digestSize); + byte *const h = representative + representativeByteLength - u - digestSize; + + SecByteBlock digest(digestSize), salt(saltSize); + hash.Final(digest); + rng.GenerateBlock(salt, saltSize); + + // compute H = hash of M' + byte c[8]; + PutWord(false, BIG_ENDIAN_ORDER, c, (word32)SafeRightShift<29>(recoverableMessageLength)); + PutWord(false, BIG_ENDIAN_ORDER, c+4, word32(recoverableMessageLength << 3)); + hash.Update(c, 8); + hash.Update(recoverableMessage, recoverableMessageLength); + hash.Update(digest, digestSize); + hash.Update(salt, saltSize); + hash.Final(h); + + // compute representative + GetMGF().GenerateAndMask(hash, representative, representativeByteLength - u - digestSize, h, digestSize, false); + byte *xorStart = representative + representativeByteLength - u - digestSize - salt.size() - recoverableMessageLength - 1; + xorStart[0] ^= 1; + if (recoverableMessage && recoverableMessageLength) + xorbuf(xorStart + 1, recoverableMessage, recoverableMessageLength); + xorbuf(xorStart + 1 + recoverableMessageLength, salt, salt.size()); + if (hashIdentifier.first && hashIdentifier.second) + { + memcpy(representative + representativeByteLength - u, hashIdentifier.first, hashIdentifier.second); + representative[representativeByteLength - 1] = 0xcc; + } + else + { + representative[representativeByteLength - 1] = 0xbc; + } + if (representativeBitLength % 8 != 0) + representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); +} + +DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength, + byte *recoverableMessage) const +{ + CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); + assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); + + const size_t u = hashIdentifier.second + 1; + const size_t representativeByteLength = BitsToBytes(representativeBitLength); + const size_t digestSize = hash.DigestSize(); + const size_t saltSize = SaltLen(digestSize); + const byte *const h = representative + representativeByteLength - u - digestSize; + + SecByteBlock digest(digestSize); + hash.Final(digest); + + DecodingResult result(0); + bool &valid = result.isValidCoding; + size_t &recoverableMessageLength = result.messageLength; + + valid = (representative[representativeByteLength - 1] == (hashIdentifier.second ? 0xcc : 0xbc)) && valid; + + if (hashIdentifier.first && hashIdentifier.second) + valid = VerifyBufsEqual(representative + representativeByteLength - u, hashIdentifier.first, hashIdentifier.second) && valid; + + GetMGF().GenerateAndMask(hash, representative, representativeByteLength - u - digestSize, h, digestSize); + if (representativeBitLength % 8 != 0) + representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); + + // extract salt and recoverableMessage from DB = 00 ... || 01 || M || salt + byte *salt = representative + representativeByteLength - u - digestSize - saltSize; + byte *M = std::find_if(representative, salt-1, std::bind2nd(std::not_equal_to(), byte(0))); + recoverableMessageLength = salt-M-1; + if (*M == 0x01 && + (size_t)(M - representative - (representativeBitLength % 8 != 0)) >= MinPadLen(digestSize) && + recoverableMessageLength <= MaxRecoverableLength(representativeBitLength, hashIdentifier.second, digestSize)) + { + if (recoverableMessage) + memcpy(recoverableMessage, M+1, recoverableMessageLength); + } + else + { + recoverableMessageLength = 0; + valid = false; + } + + // verify H = hash of M' + byte c[8]; + PutWord(false, BIG_ENDIAN_ORDER, c, (word32)SafeRightShift<29>(recoverableMessageLength)); + PutWord(false, BIG_ENDIAN_ORDER, c+4, word32(recoverableMessageLength << 3)); + hash.Update(c, 8); + hash.Update(recoverableMessage, recoverableMessageLength); + hash.Update(digest, digestSize); + hash.Update(salt, saltSize); + valid = hash.Verify(h) && valid; + + if (!AllowRecovery() && valid && recoverableMessageLength != 0) + {throw NotImplemented("PSSR_MEM: message recovery disabled");} + + return result; +} + +#endif + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/pssr.h b/external/crypto++-5.6.3/pssr.h new file mode 100644 index 000000000..99e2bc1d8 --- /dev/null +++ b/external/crypto++-5.6.3/pssr.h @@ -0,0 +1,73 @@ +// pssr.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile pssr.h +//! \brief Classes for probablistic signature schemes + +#ifndef CRYPTOPP_PSSR_H +#define CRYPTOPP_PSSR_H + +#include "cryptlib.h" +#include "pubkey.h" +#include "emsa2.h" + +#ifdef CRYPTOPP_IS_DLL +#include "sha.h" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +class CRYPTOPP_DLL PSSR_MEM_Base : public PK_RecoverableSignatureMessageEncodingMethod +{ + virtual bool AllowRecovery() const =0; + virtual size_t SaltLen(size_t hashLen) const =0; + virtual size_t MinPadLen(size_t hashLen) const =0; + virtual const MaskGeneratingFunction & GetMGF() const =0; + +public: + size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const; + size_t MaxRecoverableLength(size_t representativeBitLength, size_t hashIdentifierLength, size_t digestLength) const; + bool IsProbabilistic() const; + bool AllowNonrecoverablePart() const; + bool RecoverablePartFirst() const; + void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; + DecodingResult RecoverMessageFromRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength, + byte *recoverableMessage) const; +}; + +template class PSSR_MEM_BaseWithHashId; +template<> class PSSR_MEM_BaseWithHashId : public EMSA2HashIdLookup {}; +template<> class PSSR_MEM_BaseWithHashId : public PSSR_MEM_Base {}; + +template +class PSSR_MEM : public PSSR_MEM_BaseWithHashId +{ + virtual bool AllowRecovery() const {return ALLOW_RECOVERY;} + virtual size_t SaltLen(size_t hashLen) const {return SALT_LEN < 0 ? hashLen : SALT_LEN;} + virtual size_t MinPadLen(size_t hashLen) const {return MIN_PAD_LEN < 0 ? hashLen : MIN_PAD_LEN;} + virtual const MaskGeneratingFunction & GetMGF() const {static MGF mgf; return mgf;} + +public: + static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(ALLOW_RECOVERY ? "PSSR-" : "PSS-") + MGF::StaticAlgorithmName();} +}; + +//! PSSR-MGF1 +struct PSSR : public SignatureStandard +{ + typedef PSSR_MEM SignatureMessageEncodingMethod; +}; + +//! PSS-MGF1 +struct PSS : public SignatureStandard +{ + typedef PSSR_MEM SignatureMessageEncodingMethod; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/pubkey.cpp b/external/crypto++-5.6.3/pubkey.cpp new file mode 100644 index 000000000..9260b5474 --- /dev/null +++ b/external/crypto++-5.6.3/pubkey.cpp @@ -0,0 +1,170 @@ +// pubkey.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "pubkey.h" +#include "integer.h" +#include "filters.h" + +NAMESPACE_BEGIN(CryptoPP) + +void P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, const byte *derivationParams, size_t derivationParamsLength, bool mask, unsigned int counterStart) +{ + ArraySink *sink; + HashFilter filter(hash, sink = mask ? new ArrayXorSink(output, outputLength) : new ArraySink(output, outputLength)); + word32 counter = counterStart; + while (sink->AvailableSize() > 0) + { + filter.Put(input, inputLength); + filter.PutWord32(counter++); + filter.Put(derivationParams, derivationParamsLength); + filter.MessageEnd(); + } +} + +bool PK_DeterministicSignatureMessageEncodingMethod::VerifyMessageRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + SecByteBlock computedRepresentative(BitsToBytes(representativeBitLength)); + ComputeMessageRepresentative(NullRNG(), NULL, 0, hash, hashIdentifier, messageEmpty, computedRepresentative, representativeBitLength); + return VerifyBufsEqual(representative, computedRepresentative, computedRepresentative.size()); +} + +bool PK_RecoverableSignatureMessageEncodingMethod::VerifyMessageRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const +{ + SecByteBlock recoveredMessage(MaxRecoverableLength(representativeBitLength, hashIdentifier.second, hash.DigestSize())); + DecodingResult result = RecoverMessageFromRepresentative( + hash, hashIdentifier, messageEmpty, representative, representativeBitLength, recoveredMessage); + return result.isValidCoding && result.messageLength == 0; +} + +void TF_SignerBase::InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const +{ + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + HashIdentifier id = GetHashIdentifier(); + const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); + + if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) + throw PK_SignatureScheme::KeyTooShort(); + + size_t maxRecoverableLength = encoding.MaxRecoverableLength(MessageRepresentativeBitLength(), GetHashIdentifier().second, ma.AccessHash().DigestSize()); + + if (maxRecoverableLength == 0) + {throw NotImplemented("TF_SignerBase: this algorithm does not support messsage recovery or the key is too short");} + if (recoverableMessageLength > maxRecoverableLength) + throw InvalidArgument("TF_SignerBase: the recoverable message part is too long for the given key and algorithm"); + + ma.m_recoverableMessage.Assign(recoverableMessage, recoverableMessageLength); + encoding.ProcessRecoverableMessage( + ma.AccessHash(), + recoverableMessage, recoverableMessageLength, + NULL, 0, ma.m_semisignature); +} + +size_t TF_SignerBase::SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart) const +{ + CRYPTOPP_UNUSED(restart); + + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + HashIdentifier id = GetHashIdentifier(); + const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); + + if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) + throw PK_SignatureScheme::KeyTooShort(); + + SecByteBlock representative(MessageRepresentativeLength()); + encoding.ComputeMessageRepresentative(rng, + ma.m_recoverableMessage, ma.m_recoverableMessage.size(), + ma.AccessHash(), id, ma.m_empty, + representative, MessageRepresentativeBitLength()); + ma.m_empty = true; + + Integer r(representative, representative.size()); + size_t signatureLength = SignatureLength(); + GetTrapdoorFunctionInterface().CalculateRandomizedInverse(rng, r).Encode(signature, signatureLength); + return signatureLength; +} + +void TF_VerifierBase::InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const +{ + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + HashIdentifier id = GetHashIdentifier(); + const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); + + if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) + throw PK_SignatureScheme::KeyTooShort(); + + ma.m_representative.New(MessageRepresentativeLength()); + Integer x = GetTrapdoorFunctionInterface().ApplyFunction(Integer(signature, signatureLength)); + if (x.BitCount() > MessageRepresentativeBitLength()) + x = Integer::Zero(); // don't return false here to prevent timing attack + x.Encode(ma.m_representative, ma.m_representative.size()); +} + +bool TF_VerifierBase::VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const +{ + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + HashIdentifier id = GetHashIdentifier(); + const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); + + if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) + throw PK_SignatureScheme::KeyTooShort(); + + bool result = encoding.VerifyMessageRepresentative( + ma.AccessHash(), id, ma.m_empty, ma.m_representative, MessageRepresentativeBitLength()); + ma.m_empty = true; + return result; +} + +DecodingResult TF_VerifierBase::RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const +{ + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + HashIdentifier id = GetHashIdentifier(); + const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); + + if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) + throw PK_SignatureScheme::KeyTooShort(); + + DecodingResult result = encoding.RecoverMessageFromRepresentative( + ma.AccessHash(), id, ma.m_empty, ma.m_representative, MessageRepresentativeBitLength(), recoveredMessage); + ma.m_empty = true; + return result; +} + +DecodingResult TF_DecryptorBase::Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const +{ + if (ciphertextLength != FixedCiphertextLength()) + throw InvalidArgument(AlgorithmName() + ": ciphertext length of " + IntToString(ciphertextLength) + " doesn't match the required length of " + IntToString(FixedCiphertextLength()) + " for this key"); + + SecByteBlock paddedBlock(PaddedBlockByteLength()); + Integer x = GetTrapdoorFunctionInterface().CalculateInverse(rng, Integer(ciphertext, ciphertextLength)); + if (x.ByteCount() > paddedBlock.size()) + x = Integer::Zero(); // don't return false here to prevent timing attack + x.Encode(paddedBlock, paddedBlock.size()); + return GetMessageEncodingInterface().Unpad(paddedBlock, PaddedBlockBitLength(), plaintext, parameters); +} + +void TF_EncryptorBase::Encrypt(RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const +{ + if (plaintextLength > FixedMaxPlaintextLength()) + { + if (FixedMaxPlaintextLength() < 1) + throw InvalidArgument(AlgorithmName() + ": this key is too short to encrypt any messages"); + else + throw InvalidArgument(AlgorithmName() + ": message length of " + IntToString(plaintextLength) + " exceeds the maximum of " + IntToString(FixedMaxPlaintextLength()) + " for this public key"); + } + + SecByteBlock paddedBlock(PaddedBlockByteLength()); + GetMessageEncodingInterface().Pad(rng, plaintext, plaintextLength, paddedBlock, PaddedBlockBitLength(), parameters); + GetTrapdoorFunctionInterface().ApplyRandomizedFunction(rng, Integer(paddedBlock, paddedBlock.size())).Encode(ciphertext, FixedCiphertextLength()); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/pubkey.h b/external/crypto++-5.6.3/pubkey.h new file mode 100644 index 000000000..198f1f909 --- /dev/null +++ b/external/crypto++-5.6.3/pubkey.h @@ -0,0 +1,1968 @@ +// pubkey.h - written and placed in the public domain by Wei Dai + +#ifndef CRYPTOPP_PUBKEY_H +#define CRYPTOPP_PUBKEY_H + +//! \file +//! \brief This file contains helper classes/functions for implementing public key algorithms. +//! \details the class hierachies in this header file tend to look like this: +//! +//!
+//!                   x1
+//!                  +--+
+//!                  |  |
+//!                 y1  z1
+//!                  |  |
+//!             x2  x2
+//!                  |  |
+//!                 y2  z2
+//!                  |  |
+//!             x3  x3
+//!                  |  |
+//!                 y3  z3
+//! 
+//! +//!
    +//!
  • x1, y1, z1 are abstract interface classes defined in cryptlib.h +//!
  • x2, y2, z2 are implementations of the interfaces using "abstract policies", which +//! are pure virtual functions that should return interfaces to interchangeable algorithms. +//! These classes have \p Base suffixes. +//!
  • x3, y3, z3 hold actual algorithms and implement those virtual functions. +//! These classes have \p Impl suffixes. +//!
+//! +//! \details The \p TF_ prefix means an implementation using trapdoor functions on integers. +//! \details The \p DL_ prefix means an implementation using group operations (in groups where discrete log is hard). + +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4702) +#endif + +#include "cryptlib.h" +#include "integer.h" +#include "modarith.h" +#include "filters.h" +#include "eprecomp.h" +#include "fips140.h" +#include "argnames.h" +#include "smartptr.h" +#include "stdcpp.h" + +// VC60 workaround: this macro is defined in shlobj.h and conflicts with a template parameter used in this file +#undef INTERFACE + +NAMESPACE_BEGIN(CryptoPP) + +//! \class TrapdoorFunctionBounds +//! \brief Provides range for plaintext and ciphertext lengths +//! \details A trapdoor function is a function that is easy to compute in one direction, +//! but difficult to compute in the opposite direction without special knowledge. +//! The special knowledge is usually the private key. +//! \details Trapdoor functions only handle messages of a limited length or size. +//! \p MaxPreimage is the plaintext's maximum length, and \p MaxImage is the +//! ciphertext's maximum length. +//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), +//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionBounds +{ +public: + virtual ~TrapdoorFunctionBounds() {} + + //! \brief Returns the maximum size of a message before the trapdoor function is applied + //! \returns the maximum size of a message before the trapdoor function is applied + //! \details Derived classes must implement \p PreimageBound(). + virtual Integer PreimageBound() const =0; + //! \brief Returns the maximum size of a message after the trapdoor function is applied + //! \returns the maximum size of a message after the trapdoor function is applied + //! \details Derived classes must implement \p ImageBound(). + virtual Integer ImageBound() const =0; + //! \brief Returns the maximum size of a message before the trapdoor function is applied bound to a public key + //! \returns the maximum size of a message before the trapdoor function is applied bound to a public key + //! \details The default implementation returns PreimageBound() - 1. + virtual Integer MaxPreimage() const {return --PreimageBound();} + //! \brief Returns the maximum size of a message after the trapdoor function is applied bound to a public key + //! \returns the the maximum size of a message after the trapdoor function is applied bound to a public key + //! \details The default implementation returns ImageBound() - 1. + virtual Integer MaxImage() const {return --ImageBound();} +}; + +//! \class RandomizedTrapdoorFunction +//! \brief Applies the trapdoor function, using random data if required +//! \details \p ApplyFunction() is the foundation for encrypting a message under a public key. +//! Derived classes will override it at some point. +//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), +//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunction : public TrapdoorFunctionBounds +{ +public: + + //! \brief Applies the trapdoor function, using random data if required + //! \param rng a \p RandomNumberGenerator derived class + //! \param x the message on which the encryption function is applied + //! \returns the message \p x encrypted under the public key + //! \details \p ApplyRandomizedFunction is a generalization of encryption under a public key + //! cryptosystem. The \p RandomNumberGenerator may (or may not) be required. + //! Derived classes must implement it. + virtual Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const =0; + + //! \brief Determines if the encryption algorithm is randomized + //! \returns \p true if the encryption algorithm is randomized, \p false otherwise + //! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used. + virtual bool IsRandomized() const {return true;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~RandomizedTrapdoorFunction() { } +#endif +}; + +//! \class TrapdoorFunction +//! \brief Applies the trapdoor function +//! \details \p ApplyFunction() is the foundation for encrypting a message under a public key. +//! Derived classes will override it at some point. +//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), +//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunction : public RandomizedTrapdoorFunction +{ +public: +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TrapdoorFunction() { } +#endif + + //! \brief Applies the trapdoor function + //! \param rng a \p RandomNumberGenerator derived class + //! \param x the message on which the encryption function is applied + //! \details \p ApplyRandomizedFunction is a generalization of encryption under a public key + //! cryptosystem. The \p RandomNumberGenerator may (or may not) be required. + //! \details Internally, \p ApplyRandomizedFunction() calls \p ApplyFunction() \a + //! without the \p RandomNumberGenerator. + Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const + {CRYPTOPP_UNUSED(rng); return ApplyFunction(x);} + bool IsRandomized() const {return false;} + + //! \brief Applies the trapdoor + //! \param x the message on which the encryption function is applied + //! \returns the message \p x encrypted under the public key + //! \details \p ApplyFunction is a generalization of encryption under a public key + //! cryptosystem. Derived classes must implement it. + virtual Integer ApplyFunction(const Integer &x) const =0; +}; + +//! \class RandomizedTrapdoorFunctionInverse +//! \brief Applies the inverse of the trapdoor function, using random data if required +//! \details \p CalculateInverse() is the foundation for decrypting a message under a private key +//! in a public key cryptosystem. Derived classes will override it at some point. +//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), +//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunctionInverse +{ +public: + virtual ~RandomizedTrapdoorFunctionInverse() {} + + //! \brief Applies the inverse of the trapdoor function, using random data if required + //! \param rng a \p RandomNumberGenerator derived class + //! \param x the message on which the decryption function is applied + //! \returns the message \p x decrypted under the private key + //! \details \p CalculateRandomizedInverse is a generalization of decryption using the private key + //! The \p RandomNumberGenerator may (or may not) be required. Derived classes must implement it. + virtual Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const =0; + + //! \brief Determines if the decryption algorithm is randomized + //! \returns \p true if the decryption algorithm is randomized, \p false otherwise + //! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used. + virtual bool IsRandomized() const {return true;} +}; + +//! \class TrapdoorFunctionInverse +//! \brief Applies the inverse of the trapdoor function +//! \details \p CalculateInverse() is the foundation for decrypting a message under a private key +//! in a public key cryptosystem. Derived classes will override it at some point. +//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), +//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionInverse : public RandomizedTrapdoorFunctionInverse +{ +public: + virtual ~TrapdoorFunctionInverse() {} + + //! \brief Applies the inverse of the trapdoor function + //! \param rng a \p RandomNumberGenerator derived class + //! \param x the message on which the decryption function is applied + //! \returns the message \p x decrypted under the private key + //! \details \p CalculateRandomizedInverse is a generalization of decryption using the private key + //! \details Internally, \p CalculateRandomizedInverse() calls \p CalculateInverse() \a + //! without the \p RandomNumberGenerator. + Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const + {return CalculateInverse(rng, x);} + + //! \brief Determines if the decryption algorithm is randomized + //! \returns \p true if the decryption algorithm is randomized, \p false otherwise + //! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used. + bool IsRandomized() const {return false;} + + virtual Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const =0; +}; + +// ******************************************************** + +//! \class PK_EncryptionMessageEncodingMethod +//! \brief Message encoding method for public key encryption +class CRYPTOPP_NO_VTABLE PK_EncryptionMessageEncodingMethod +{ +public: + virtual ~PK_EncryptionMessageEncodingMethod() {} + + virtual bool ParameterSupported(const char *name) const + {CRYPTOPP_UNUSED(name); return false;} + + //! max size of unpadded message in bytes, given max size of padded message in bits (1 less than size of modulus) + virtual size_t MaxUnpaddedLength(size_t paddedLength) const =0; + + virtual void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedBitLength, const NameValuePairs ¶meters) const =0; + + virtual DecodingResult Unpad(const byte *padded, size_t paddedBitLength, byte *raw, const NameValuePairs ¶meters) const =0; +}; + +// ******************************************************** + +//! \class TF_Base +//! \brief The base for trapdoor based cryptosystems +//! \tparam TFI trapdoor function interface derived class +//! \tparam MEI message encoding interface derived class +template +class CRYPTOPP_NO_VTABLE TF_Base +{ +protected: + virtual const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const =0; + + typedef TFI TrapdoorFunctionInterface; + virtual const TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const =0; + + typedef MEI MessageEncodingInterface; + virtual const MessageEncodingInterface & GetMessageEncodingInterface() const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_Base() { } +#endif +}; + +// ******************************************************** + +//! \class PK_FixedLengthCryptoSystemImpl +//! \brief Public key trapdoor function base class +//! \tparam BASE public key cryptosystem with a fixed length +template +class CRYPTOPP_NO_VTABLE PK_FixedLengthCryptoSystemImpl : public BASE +{ +public: + size_t MaxPlaintextLength(size_t ciphertextLength) const + {return ciphertextLength == FixedCiphertextLength() ? FixedMaxPlaintextLength() : 0;} + size_t CiphertextLength(size_t plaintextLength) const + {return plaintextLength <= FixedMaxPlaintextLength() ? FixedCiphertextLength() : 0;} + + virtual size_t FixedMaxPlaintextLength() const =0; + virtual size_t FixedCiphertextLength() const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PK_FixedLengthCryptoSystemImpl() { } +#endif +}; + +//! \class TF_CryptoSystemBase +//! \brief Trapdoor function cryptosystem base class +//! \tparam INTERFACE public key cryptosystem base interface +//! \tparam BASE public key cryptosystem implementation base +template +class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl, protected BASE +{ +public: + bool ParameterSupported(const char *name) const {return this->GetMessageEncodingInterface().ParameterSupported(name);} + size_t FixedMaxPlaintextLength() const {return this->GetMessageEncodingInterface().MaxUnpaddedLength(PaddedBlockBitLength());} + size_t FixedCiphertextLength() const {return this->GetTrapdoorFunctionBounds().MaxImage().ByteCount();} + +protected: + size_t PaddedBlockByteLength() const {return BitsToBytes(PaddedBlockBitLength());} + // Coverity finding on potential overflow/underflow. + size_t PaddedBlockBitLength() const {return SaturatingSubtract(this->GetTrapdoorFunctionBounds().PreimageBound().BitCount(),1U);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_CryptoSystemBase() { } +#endif +}; + +//! \class TF_DecryptorBase +//! \brief Trapdoor function cryptosystems decryption base class +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_DecryptorBase : public TF_CryptoSystemBase > +{ +public: + DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_DecryptorBase() { } +#endif +}; + +//! \class TF_DecryptorBase +//! \brief Trapdoor function cryptosystems encryption base class +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_EncryptorBase : public TF_CryptoSystemBase > +{ +public: + void Encrypt(RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_EncryptorBase() { } +#endif +}; + +// ******************************************************** + +typedef std::pair HashIdentifier; + +//! \class PK_SignatureMessageEncodingMethod +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p PK_SignatureMessageEncodingMethod provides interfaces for message +//! encoding method for public key signature schemes. The methods support both +//! trapdoor functions (TF_*) and discrete logarithm (DL_*) +//! based schemes. +class CRYPTOPP_NO_VTABLE PK_SignatureMessageEncodingMethod +{ +public: + virtual ~PK_SignatureMessageEncodingMethod() {} + + virtual size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const + {CRYPTOPP_UNUSED(hashIdentifierLength); CRYPTOPP_UNUSED(digestLength); return 0;} + virtual size_t MaxRecoverableLength(size_t representativeBitLength, size_t hashIdentifierLength, size_t digestLength) const + {CRYPTOPP_UNUSED(representativeBitLength); CRYPTOPP_UNUSED(representativeBitLength); CRYPTOPP_UNUSED(hashIdentifierLength); CRYPTOPP_UNUSED(digestLength); return 0;} + + bool IsProbabilistic() const + {return true;} + bool AllowNonrecoverablePart() const + {throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} + virtual bool RecoverablePartFirst() const + {throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} + + // for verification, DL + virtual void ProcessSemisignature(HashTransformation &hash, const byte *semisignature, size_t semisignatureLength) const + {CRYPTOPP_UNUSED(hash); CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength);} + + // for signature + virtual void ProcessRecoverableMessage(HashTransformation &hash, + const byte *recoverableMessage, size_t recoverableMessageLength, + const byte *presignature, size_t presignatureLength, + SecByteBlock &semisignature) const + { + CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(recoverableMessage); CRYPTOPP_UNUSED(recoverableMessageLength); + CRYPTOPP_UNUSED(presignature); CRYPTOPP_UNUSED(presignatureLength); CRYPTOPP_UNUSED(semisignature); + if (RecoverablePartFirst()) + assert(!"ProcessRecoverableMessage() not implemented"); + } + + virtual void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const =0; + + virtual bool VerifyMessageRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const =0; + + virtual DecodingResult RecoverMessageFromRepresentative( // for TF + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength, + byte *recoveredMessage) const + {CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(messageEmpty); + CRYPTOPP_UNUSED(representative); CRYPTOPP_UNUSED(representativeBitLength); CRYPTOPP_UNUSED(recoveredMessage); + throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} + + virtual DecodingResult RecoverMessageFromSemisignature( // for DL + HashTransformation &hash, HashIdentifier hashIdentifier, + const byte *presignature, size_t presignatureLength, + const byte *semisignature, size_t semisignatureLength, + byte *recoveredMessage) const + {CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(presignature); CRYPTOPP_UNUSED(presignatureLength); + CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength); CRYPTOPP_UNUSED(recoveredMessage); + throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} + + // VC60 workaround + struct HashIdentifierLookup + { + template struct HashIdentifierLookup2 + { + static HashIdentifier CRYPTOPP_API Lookup() + { + return HashIdentifier((const byte *)NULL, 0); + } + }; + }; +}; + +//! \class PK_DeterministicSignatureMessageEncodingMethod +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p PK_DeterministicSignatureMessageEncodingMethod provides interfaces +//! for message encoding method for public key signature schemes. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_DeterministicSignatureMessageEncodingMethod : public PK_SignatureMessageEncodingMethod +{ +public: + bool VerifyMessageRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; +}; + +//! \class PK_RecoverableSignatureMessageEncodingMethod +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p PK_RecoverableSignatureMessageEncodingMethod provides interfaces +//! for message encoding method for public key signature schemes. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_RecoverableSignatureMessageEncodingMethod : public PK_SignatureMessageEncodingMethod +{ +public: + bool VerifyMessageRepresentative( + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; +}; + +//! \class DL_SignatureMessageEncodingMethod_DSA +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p DL_SignatureMessageEncodingMethod_DSA provides interfaces +//! for message encoding method for DSA. +class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_DSA : public PK_DeterministicSignatureMessageEncodingMethod +{ +public: + void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; +}; + +//! \class DL_SignatureMessageEncodingMethod_NR +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p DL_SignatureMessageEncodingMethod_NR provides interfaces +//! for message encoding method for Nyberg-Rueppel. +class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_NR : public PK_DeterministicSignatureMessageEncodingMethod +{ +public: + void ComputeMessageRepresentative(RandomNumberGenerator &rng, + const byte *recoverableMessage, size_t recoverableMessageLength, + HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, + byte *representative, size_t representativeBitLength) const; +}; + +//! \class PK_MessageAccumulatorBase +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p PK_MessageAccumulatorBase provides interfaces +//! for message encoding method. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulatorBase : public PK_MessageAccumulator +{ +public: + PK_MessageAccumulatorBase() : m_empty(true) {} + + virtual HashTransformation & AccessHash() =0; + + void Update(const byte *input, size_t length) + { + AccessHash().Update(input, length); + m_empty = m_empty && length == 0; + } + + SecByteBlock m_recoverableMessage, m_representative, m_presignature, m_semisignature; + Integer m_k, m_s; + bool m_empty; +}; + +//! \class PK_MessageAccumulatorImpl +//! \brief Interface for message encoding method for public key signature schemes. +//! \details \p PK_MessageAccumulatorBase provides interfaces +//! for message encoding method. +template +class PK_MessageAccumulatorImpl : public PK_MessageAccumulatorBase, protected ObjectHolder +{ +public: + HashTransformation & AccessHash() {return this->m_object;} +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE +{ +public: + size_t SignatureLength() const + {return this->GetTrapdoorFunctionBounds().MaxPreimage().ByteCount();} + size_t MaxRecoverableLength() const + {return this->GetMessageEncodingInterface().MaxRecoverableLength(MessageRepresentativeBitLength(), GetHashIdentifier().second, GetDigestSize());} + size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const + {CRYPTOPP_UNUSED(signatureLength); return this->MaxRecoverableLength();} + + bool IsProbabilistic() const + {return this->GetTrapdoorFunctionInterface().IsRandomized() || this->GetMessageEncodingInterface().IsProbabilistic();} + bool AllowNonrecoverablePart() const + {return this->GetMessageEncodingInterface().AllowNonrecoverablePart();} + bool RecoverablePartFirst() const + {return this->GetMessageEncodingInterface().RecoverablePartFirst();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_SignatureSchemeBase() { } +#endif + +protected: + size_t MessageRepresentativeLength() const {return BitsToBytes(MessageRepresentativeBitLength());} + // Coverity finding on potential overflow/underflow. + size_t MessageRepresentativeBitLength() const {return SaturatingSubtract(this->GetTrapdoorFunctionBounds().ImageBound().BitCount(),1U);} + virtual HashIdentifier GetHashIdentifier() const =0; + virtual size_t GetDigestSize() const =0; +}; + +//! _ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_SignerBase : public TF_SignatureSchemeBase > +{ +public: + void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const; + size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_SignerBase() { } +#endif +}; + +//! _ +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_VerifierBase : public TF_SignatureSchemeBase > +{ +public: + void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const; + bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const; + DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &recoveryAccumulator) const; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_VerifierBase() { } +#endif +}; + +// ******************************************************** + +//! _ +template +struct TF_CryptoSchemeOptions +{ + typedef T1 AlgorithmInfo; + typedef T2 Keys; + typedef typename Keys::PrivateKey PrivateKey; + typedef typename Keys::PublicKey PublicKey; + typedef T3 MessageEncodingMethod; +}; + +//! _ +template +struct TF_SignatureSchemeOptions : public TF_CryptoSchemeOptions +{ + typedef T4 HashFunction; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE TF_ObjectImplBase : public AlgorithmImpl +{ +public: + typedef SCHEME_OPTIONS SchemeOptions; + typedef KEY_CLASS KeyClass; + + PublicKey & AccessPublicKey() {return AccessKey();} + const PublicKey & GetPublicKey() const {return GetKey();} + + PrivateKey & AccessPrivateKey() {return AccessKey();} + const PrivateKey & GetPrivateKey() const {return GetKey();} + + virtual const KeyClass & GetKey() const =0; + virtual KeyClass & AccessKey() =0; + + const KeyClass & GetTrapdoorFunction() const {return GetKey();} + + PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const + { + CRYPTOPP_UNUSED(rng); + return new PK_MessageAccumulatorImpl; + } + PK_MessageAccumulator * NewVerificationAccumulator() const + { + return new PK_MessageAccumulatorImpl; + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_ObjectImplBase() { } +#endif + +protected: + const typename BASE::MessageEncodingInterface & GetMessageEncodingInterface() const + {return Singleton().Ref();} + const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const + {return GetKey();} + const typename BASE::TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const + {return GetKey();} + + // for signature scheme + HashIdentifier GetHashIdentifier() const + { + typedef CPP_TYPENAME SchemeOptions::MessageEncodingMethod::HashIdentifierLookup::template HashIdentifierLookup2 L; + return L::Lookup(); + } + size_t GetDigestSize() const + { + typedef CPP_TYPENAME SchemeOptions::HashFunction H; + return H::DIGESTSIZE; + } +}; + +//! _ +template +class TF_ObjectImplExtRef : public TF_ObjectImplBase +{ +public: + TF_ObjectImplExtRef(const KEY *pKey = NULL) : m_pKey(pKey) {} + void SetKeyPtr(const KEY *pKey) {m_pKey = pKey;} + + const KEY & GetKey() const {return *m_pKey;} + KEY & AccessKey() {throw NotImplemented("TF_ObjectImplExtRef: cannot modify refererenced key");} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_ObjectImplExtRef() { } +#endif + +private: + const KEY * m_pKey; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE TF_ObjectImpl : public TF_ObjectImplBase +{ +public: + typedef KEY_CLASS KeyClass; + + const KeyClass & GetKey() const {return m_trapdoorFunction;} + KeyClass & AccessKey() {return m_trapdoorFunction;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~TF_ObjectImpl() { } +#endif + +private: + KeyClass m_trapdoorFunction; +}; + +//! _ +template +class TF_DecryptorImpl : public TF_ObjectImpl +{ +}; + +//! _ +template +class TF_EncryptorImpl : public TF_ObjectImpl +{ +}; + +//! _ +template +class TF_SignerImpl : public TF_ObjectImpl +{ +}; + +//! _ +template +class TF_VerifierImpl : public TF_ObjectImpl +{ +}; + +// ******************************************************** + +//! _ +class CRYPTOPP_NO_VTABLE MaskGeneratingFunction +{ +public: + virtual ~MaskGeneratingFunction() {} + virtual void GenerateAndMask(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, bool mask = true) const =0; +}; + +CRYPTOPP_DLL void CRYPTOPP_API P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, const byte *derivationParams, size_t derivationParamsLength, bool mask, unsigned int counterStart); + +//! _ +class P1363_MGF1 : public MaskGeneratingFunction +{ +public: + static const char * CRYPTOPP_API StaticAlgorithmName() {return "MGF1";} + void GenerateAndMask(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, bool mask = true) const + { + P1363_MGF1KDF2_Common(hash, output, outputLength, input, inputLength, NULL, 0, mask, 0); + } +}; + +// ******************************************************** + +//! _ +template +class P1363_KDF2 +{ +public: + static void CRYPTOPP_API DeriveKey(byte *output, size_t outputLength, const byte *input, size_t inputLength, const byte *derivationParams, size_t derivationParamsLength) + { + H h; + P1363_MGF1KDF2_Common(h, output, outputLength, input, inputLength, derivationParams, derivationParamsLength, false, 1); + } +}; + +// ******************************************************** + +//! to be thrown by DecodeElement and AgreeWithStaticPrivateKey +class DL_BadElement : public InvalidDataFormat +{ +public: + DL_BadElement() : InvalidDataFormat("CryptoPP: invalid group element") {} +}; + +//! interface for DL group parameters +template +class CRYPTOPP_NO_VTABLE DL_GroupParameters : public CryptoParameters +{ + typedef DL_GroupParameters ThisClass; + +public: + typedef T Element; + + DL_GroupParameters() : m_validationLevel(0) {} + + // CryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const + { + if (!GetBasePrecomputation().IsInitialized()) + return false; + + if (m_validationLevel > level) + return true; + + bool pass = ValidateGroup(rng, level); + pass = pass && ValidateElement(level, GetSubgroupGenerator(), &GetBasePrecomputation()); + + m_validationLevel = pass ? level+1 : 0; + + return pass; + } + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper(this, name, valueType, pValue) + CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupOrder) + CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupGenerator) + ; + } + + bool SupportsPrecomputation() const {return true;} + + void Precompute(unsigned int precomputationStorage=16) + { + AccessBasePrecomputation().Precompute(GetGroupPrecomputation(), GetSubgroupOrder().BitCount(), precomputationStorage); + } + + void LoadPrecomputation(BufferedTransformation &storedPrecomputation) + { + AccessBasePrecomputation().Load(GetGroupPrecomputation(), storedPrecomputation); + m_validationLevel = 0; + } + + void SavePrecomputation(BufferedTransformation &storedPrecomputation) const + { + GetBasePrecomputation().Save(GetGroupPrecomputation(), storedPrecomputation); + } + + // non-inherited + virtual const Element & GetSubgroupGenerator() const {return GetBasePrecomputation().GetBase(GetGroupPrecomputation());} + virtual void SetSubgroupGenerator(const Element &base) {AccessBasePrecomputation().SetBase(GetGroupPrecomputation(), base);} + virtual Element ExponentiateBase(const Integer &exponent) const + { + return GetBasePrecomputation().Exponentiate(GetGroupPrecomputation(), exponent); + } + virtual Element ExponentiateElement(const Element &base, const Integer &exponent) const + { + Element result; + SimultaneousExponentiate(&result, base, &exponent, 1); + return result; + } + + virtual const DL_GroupPrecomputation & GetGroupPrecomputation() const =0; + virtual const DL_FixedBasePrecomputation & GetBasePrecomputation() const =0; + virtual DL_FixedBasePrecomputation & AccessBasePrecomputation() =0; + virtual const Integer & GetSubgroupOrder() const =0; // order of subgroup generated by base element + virtual Integer GetMaxExponent() const =0; + virtual Integer GetGroupOrder() const {return GetSubgroupOrder()*GetCofactor();} // one of these two needs to be overriden + virtual Integer GetCofactor() const {return GetGroupOrder()/GetSubgroupOrder();} + virtual unsigned int GetEncodedElementSize(bool reversible) const =0; + virtual void EncodeElement(bool reversible, const Element &element, byte *encoded) const =0; + virtual Element DecodeElement(const byte *encoded, bool checkForGroupMembership) const =0; + virtual Integer ConvertElementToInteger(const Element &element) const =0; + virtual bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const =0; + virtual bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation *precomp) const =0; + virtual bool FastSubgroupCheckAvailable() const =0; + virtual bool IsIdentity(const Element &element) const =0; + virtual void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParameters() { } +#endif + +protected: + void ParametersChanged() {m_validationLevel = 0;} + +private: + mutable unsigned int m_validationLevel; +}; + +//! _ +template , class BASE = DL_GroupParameters > +class DL_GroupParametersImpl : public BASE +{ +public: + typedef GROUP_PRECOMP GroupPrecomputation; + typedef typename GROUP_PRECOMP::Element Element; + typedef BASE_PRECOMP BasePrecomputation; + + const DL_GroupPrecomputation & GetGroupPrecomputation() const {return m_groupPrecomputation;} + const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return m_gpc;} + DL_FixedBasePrecomputation & AccessBasePrecomputation() {return m_gpc;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_GroupParametersImpl() { } +#endif + +protected: + GROUP_PRECOMP m_groupPrecomputation; + BASE_PRECOMP m_gpc; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_Key +{ +public: + virtual const DL_GroupParameters & GetAbstractGroupParameters() const =0; + virtual DL_GroupParameters & AccessAbstractGroupParameters() =0; +}; + +//! interface for DL public keys +template +class CRYPTOPP_NO_VTABLE DL_PublicKey : public DL_Key +{ + typedef DL_PublicKey ThisClass; + +public: + typedef T Element; + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper(this, name, valueType, pValue, &this->GetAbstractGroupParameters()) + CRYPTOPP_GET_FUNCTION_ENTRY(PublicElement); + } + + void AssignFrom(const NameValuePairs &source); + + // non-inherited + virtual const Element & GetPublicElement() const {return GetPublicPrecomputation().GetBase(this->GetAbstractGroupParameters().GetGroupPrecomputation());} + virtual void SetPublicElement(const Element &y) {AccessPublicPrecomputation().SetBase(this->GetAbstractGroupParameters().GetGroupPrecomputation(), y);} + virtual Element ExponentiatePublicElement(const Integer &exponent) const + { + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + return GetPublicPrecomputation().Exponentiate(params.GetGroupPrecomputation(), exponent); + } + virtual Element CascadeExponentiateBaseAndPublicElement(const Integer &baseExp, const Integer &publicExp) const + { + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + return params.GetBasePrecomputation().CascadeExponentiate(params.GetGroupPrecomputation(), baseExp, GetPublicPrecomputation(), publicExp); + } + + virtual const DL_FixedBasePrecomputation & GetPublicPrecomputation() const =0; + virtual DL_FixedBasePrecomputation & AccessPublicPrecomputation() =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PublicKey() { } +#endif +}; + +//! interface for DL private keys +template +class CRYPTOPP_NO_VTABLE DL_PrivateKey : public DL_Key +{ + typedef DL_PrivateKey ThisClass; + +public: + typedef T Element; + + void MakePublicKey(DL_PublicKey &pub) const + { + pub.AccessAbstractGroupParameters().AssignFrom(this->GetAbstractGroupParameters()); + pub.SetPublicElement(this->GetAbstractGroupParameters().ExponentiateBase(GetPrivateExponent())); + } + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper(this, name, valueType, pValue, &this->GetAbstractGroupParameters()) + CRYPTOPP_GET_FUNCTION_ENTRY(PrivateExponent); + } + + void AssignFrom(const NameValuePairs &source) + { + this->AccessAbstractGroupParameters().AssignFrom(source); + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(PrivateExponent); + } + + virtual const Integer & GetPrivateExponent() const =0; + virtual void SetPrivateExponent(const Integer &x) =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_PrivateKey() { } +#endif +}; + +template +void DL_PublicKey::AssignFrom(const NameValuePairs &source) +{ + DL_PrivateKey *pPrivateKey = NULL; + if (source.GetThisPointer(pPrivateKey)) + pPrivateKey->MakePublicKey(*this); + else + { + this->AccessAbstractGroupParameters().AssignFrom(source); + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(PublicElement); + } +} + +class OID; + +//! _ +template +class DL_KeyImpl : public PK +{ +public: + typedef GP GroupParameters; + + O GetAlgorithmID() const {return GetGroupParameters().GetAlgorithmID();} +// void BERDecode(BufferedTransformation &bt) +// {PK::BERDecode(bt);} +// void DEREncode(BufferedTransformation &bt) const +// {PK::DEREncode(bt);} + bool BERDecodeAlgorithmParameters(BufferedTransformation &bt) + {AccessGroupParameters().BERDecode(bt); return true;} + bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const + {GetGroupParameters().DEREncode(bt); return true;} + + const GP & GetGroupParameters() const {return m_groupParameters;} + GP & AccessGroupParameters() {return m_groupParameters;} + +private: + GP m_groupParameters; +}; + +class X509PublicKey; +class PKCS8PrivateKey; + +//! _ +template +class DL_PrivateKeyImpl : public DL_PrivateKey, public DL_KeyImpl +{ +public: + typedef typename GP::Element Element; + + // GeneratableCryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const + { + bool pass = GetAbstractGroupParameters().Validate(rng, level); + + const Integer &q = GetAbstractGroupParameters().GetSubgroupOrder(); + const Integer &x = GetPrivateExponent(); + + pass = pass && x.IsPositive() && x < q; + if (level >= 1) + pass = pass && Integer::Gcd(x, q) == Integer::One(); + return pass; + } + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper >(this, name, valueType, pValue).Assignable(); + } + + void AssignFrom(const NameValuePairs &source) + { + AssignFromHelper >(this, source); + } + + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms) + { + if (!params.GetThisObject(this->AccessGroupParameters())) + this->AccessGroupParameters().GenerateRandom(rng, params); +// std::pair seed; + Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent()); +// Integer::ANY, Integer::Zero(), Integer::One(), +// params.GetValue("DeterministicKeyGenerationSeed", seed) ? &seed : NULL); + SetPrivateExponent(x); + } + + bool SupportsPrecomputation() const {return true;} + + void Precompute(unsigned int precomputationStorage=16) + {AccessAbstractGroupParameters().Precompute(precomputationStorage);} + + void LoadPrecomputation(BufferedTransformation &storedPrecomputation) + {AccessAbstractGroupParameters().LoadPrecomputation(storedPrecomputation);} + + void SavePrecomputation(BufferedTransformation &storedPrecomputation) const + {GetAbstractGroupParameters().SavePrecomputation(storedPrecomputation);} + + // DL_Key + const DL_GroupParameters & GetAbstractGroupParameters() const {return this->GetGroupParameters();} + DL_GroupParameters & AccessAbstractGroupParameters() {return this->AccessGroupParameters();} + + // DL_PrivateKey + const Integer & GetPrivateExponent() const {return m_x;} + void SetPrivateExponent(const Integer &x) {m_x = x;} + + // PKCS8PrivateKey + void BERDecodePrivateKey(BufferedTransformation &bt, bool, size_t) + {m_x.BERDecode(bt);} + void DEREncodePrivateKey(BufferedTransformation &bt) const + {m_x.DEREncode(bt);} + +private: + Integer m_x; +}; + +//! _ +template +class DL_PrivateKey_WithSignaturePairwiseConsistencyTest : public BASE +{ +public: + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms) + { + BASE::GenerateRandom(rng, params); + + if (FIPS_140_2_ComplianceEnabled()) + { + typename SIGNATURE_SCHEME::Signer signer(*this); + typename SIGNATURE_SCHEME::Verifier verifier(signer); + SignaturePairwiseConsistencyTest_FIPS_140_Only(signer, verifier); + } + } +}; + +//! _ +template +class DL_PublicKeyImpl : public DL_PublicKey, public DL_KeyImpl +{ +public: + typedef typename GP::Element Element; + + // CryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const + { + bool pass = GetAbstractGroupParameters().Validate(rng, level); + pass = pass && GetAbstractGroupParameters().ValidateElement(level, this->GetPublicElement(), &GetPublicPrecomputation()); + return pass; + } + + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const + { + return GetValueHelper >(this, name, valueType, pValue).Assignable(); + } + + void AssignFrom(const NameValuePairs &source) + { + AssignFromHelper >(this, source); + } + + bool SupportsPrecomputation() const {return true;} + + void Precompute(unsigned int precomputationStorage=16) + { + AccessAbstractGroupParameters().Precompute(precomputationStorage); + AccessPublicPrecomputation().Precompute(GetAbstractGroupParameters().GetGroupPrecomputation(), GetAbstractGroupParameters().GetSubgroupOrder().BitCount(), precomputationStorage); + } + + void LoadPrecomputation(BufferedTransformation &storedPrecomputation) + { + AccessAbstractGroupParameters().LoadPrecomputation(storedPrecomputation); + AccessPublicPrecomputation().Load(GetAbstractGroupParameters().GetGroupPrecomputation(), storedPrecomputation); + } + + void SavePrecomputation(BufferedTransformation &storedPrecomputation) const + { + GetAbstractGroupParameters().SavePrecomputation(storedPrecomputation); + GetPublicPrecomputation().Save(GetAbstractGroupParameters().GetGroupPrecomputation(), storedPrecomputation); + } + + // DL_Key + const DL_GroupParameters & GetAbstractGroupParameters() const {return this->GetGroupParameters();} + DL_GroupParameters & AccessAbstractGroupParameters() {return this->AccessGroupParameters();} + + // DL_PublicKey + const DL_FixedBasePrecomputation & GetPublicPrecomputation() const {return m_ypc;} + DL_FixedBasePrecomputation & AccessPublicPrecomputation() {return m_ypc;} + + // non-inherited + bool operator==(const DL_PublicKeyImpl &rhs) const + {return this->GetGroupParameters() == rhs.GetGroupParameters() && this->GetPublicElement() == rhs.GetPublicElement();} + +private: + typename GP::BasePrecomputation m_ypc; +}; + +//! interface for Elgamal-like signature algorithms +template +class CRYPTOPP_NO_VTABLE DL_ElgamalLikeSignatureAlgorithm +{ +public: + virtual void Sign(const DL_GroupParameters ¶ms, const Integer &privateKey, const Integer &k, const Integer &e, Integer &r, Integer &s) const =0; + virtual bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const =0; + virtual Integer RecoverPresignature(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &r, const Integer &s) const + { + CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(publicKey); CRYPTOPP_UNUSED(r); CRYPTOPP_UNUSED(s); + throw NotImplemented("DL_ElgamalLikeSignatureAlgorithm: this signature scheme does not support message recovery"); + } + virtual size_t RLen(const DL_GroupParameters ¶ms) const + {return params.GetSubgroupOrder().ByteCount();} + virtual size_t SLen(const DL_GroupParameters ¶ms) const + {return params.GetSubgroupOrder().ByteCount();} +}; + +//! interface for DL key agreement algorithms +template +class CRYPTOPP_NO_VTABLE DL_KeyAgreementAlgorithm +{ +public: + typedef T Element; + + virtual Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters ¶ms, const DL_FixedBasePrecomputation &publicPrecomputation, const Integer &privateExponent) const =0; + virtual Element AgreeWithStaticPrivateKey(const DL_GroupParameters ¶ms, const Element &publicElement, bool validateOtherPublicKey, const Integer &privateExponent) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_KeyAgreementAlgorithm() { } +#endif +}; + +//! interface for key derivation algorithms used in DL cryptosystems +template +class CRYPTOPP_NO_VTABLE DL_KeyDerivationAlgorithm +{ +public: + virtual bool ParameterSupported(const char *name) const + {CRYPTOPP_UNUSED(name); return false;} + virtual void Derive(const DL_GroupParameters &groupParams, byte *derivedKey, size_t derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs &derivationParams) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_KeyDerivationAlgorithm() { } +#endif +}; + +//! interface for symmetric encryption algorithms used in DL cryptosystems +class CRYPTOPP_NO_VTABLE DL_SymmetricEncryptionAlgorithm +{ +public: + virtual bool ParameterSupported(const char *name) const + {CRYPTOPP_UNUSED(name); return false;} + virtual size_t GetSymmetricKeyLength(size_t plaintextLength) const =0; + virtual size_t GetSymmetricCiphertextLength(size_t plaintextLength) const =0; + virtual size_t GetMaxSymmetricPlaintextLength(size_t ciphertextLength) const =0; + virtual void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const =0; + virtual DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_SymmetricEncryptionAlgorithm() { } +#endif +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_Base +{ +protected: + typedef KI KeyInterface; + typedef typename KI::Element Element; + + const DL_GroupParameters & GetAbstractGroupParameters() const {return GetKeyInterface().GetAbstractGroupParameters();} + DL_GroupParameters & AccessAbstractGroupParameters() {return AccessKeyInterface().AccessAbstractGroupParameters();} + + virtual KeyInterface & AccessKeyInterface() =0; + virtual const KeyInterface & GetKeyInterface() const =0; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_Base() { } +#endif +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_SignatureSchemeBase : public INTERFACE, public DL_Base +{ +public: + size_t SignatureLength() const + { + return GetSignatureAlgorithm().RLen(this->GetAbstractGroupParameters()) + + GetSignatureAlgorithm().SLen(this->GetAbstractGroupParameters()); + } + size_t MaxRecoverableLength() const + {return GetMessageEncodingInterface().MaxRecoverableLength(0, GetHashIdentifier().second, GetDigestSize());} + size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const + {CRYPTOPP_UNUSED(signatureLength); assert(false); return 0;} // TODO + + bool IsProbabilistic() const + {return true;} + bool AllowNonrecoverablePart() const + {return GetMessageEncodingInterface().AllowNonrecoverablePart();} + bool RecoverablePartFirst() const + {return GetMessageEncodingInterface().RecoverablePartFirst();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_SignatureSchemeBase() { } +#endif + +protected: + size_t MessageRepresentativeLength() const {return BitsToBytes(MessageRepresentativeBitLength());} + size_t MessageRepresentativeBitLength() const {return this->GetAbstractGroupParameters().GetSubgroupOrder().BitCount();} + + virtual const DL_ElgamalLikeSignatureAlgorithm & GetSignatureAlgorithm() const =0; + virtual const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const =0; + virtual HashIdentifier GetHashIdentifier() const =0; + virtual size_t GetDigestSize() const =0; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_SignerBase : public DL_SignatureSchemeBase > +{ +public: + // for validation testing + void RawSign(const Integer &k, const Integer &e, Integer &r, Integer &s) const + { + const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + const DL_PrivateKey &key = this->GetKeyInterface(); + + r = params.ConvertElementToInteger(params.ExponentiateBase(k)); + alg.Sign(params, key.GetPrivateExponent(), k, e, r, s); + } + + void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const + { + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + ma.m_recoverableMessage.Assign(recoverableMessage, recoverableMessageLength); + this->GetMessageEncodingInterface().ProcessRecoverableMessage(ma.AccessHash(), + recoverableMessage, recoverableMessageLength, + ma.m_presignature, ma.m_presignature.size(), + ma.m_semisignature); + } + + size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart) const + { + this->GetMaterial().DoQuickSanityCheck(); + + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + const DL_PrivateKey &key = this->GetKeyInterface(); + + SecByteBlock representative(this->MessageRepresentativeLength()); + this->GetMessageEncodingInterface().ComputeMessageRepresentative( + rng, + ma.m_recoverableMessage, ma.m_recoverableMessage.size(), + ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty, + representative, this->MessageRepresentativeBitLength()); + ma.m_empty = true; + Integer e(representative, representative.size()); + + // hash message digest into random number k to prevent reusing the same k on a different messages + // after virtual machine rollback + if (rng.CanIncorporateEntropy()) + rng.IncorporateEntropy(representative, representative.size()); + Integer k(rng, 1, params.GetSubgroupOrder()-1); + Integer r, s; + r = params.ConvertElementToInteger(params.ExponentiateBase(k)); + alg.Sign(params, key.GetPrivateExponent(), k, e, r, s); + + /* + Integer r, s; + if (this->MaxRecoverableLength() > 0) + r.Decode(ma.m_semisignature, ma.m_semisignature.size()); + else + r.Decode(ma.m_presignature, ma.m_presignature.size()); + alg.Sign(params, key.GetPrivateExponent(), ma.m_k, e, r, s); + */ + + size_t rLen = alg.RLen(params); + r.Encode(signature, rLen); + s.Encode(signature+rLen, alg.SLen(params)); + + if (restart) + RestartMessageAccumulator(rng, ma); + + return this->SignatureLength(); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_SignerBase() { } +#endif + +protected: + void RestartMessageAccumulator(RandomNumberGenerator &rng, PK_MessageAccumulatorBase &ma) const + { + // k needs to be generated before hashing for signature schemes with recovery + // but to defend against VM rollbacks we need to generate k after hashing. + // so this code is commented out, since no DL-based signature scheme with recovery + // has been implemented in Crypto++ anyway + /* + const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + ma.m_k.Randomize(rng, 1, params.GetSubgroupOrder()-1); + ma.m_presignature.New(params.GetEncodedElementSize(false)); + params.ConvertElementToInteger(params.ExponentiateBase(ma.m_k)).Encode(ma.m_presignature, ma.m_presignature.size()); + */ + CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(ma); + } +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_VerifierBase : public DL_SignatureSchemeBase > +{ +public: + void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const + { + CRYPTOPP_UNUSED(signature); CRYPTOPP_UNUSED(signatureLength); + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + + size_t rLen = alg.RLen(params); + ma.m_semisignature.Assign(signature, rLen); + ma.m_s.Decode(signature+rLen, alg.SLen(params)); + + this->GetMessageEncodingInterface().ProcessSemisignature(ma.AccessHash(), ma.m_semisignature, ma.m_semisignature.size()); + } + + bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const + { + this->GetMaterial().DoQuickSanityCheck(); + + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + const DL_PublicKey &key = this->GetKeyInterface(); + + SecByteBlock representative(this->MessageRepresentativeLength()); + this->GetMessageEncodingInterface().ComputeMessageRepresentative(NullRNG(), ma.m_recoverableMessage, ma.m_recoverableMessage.size(), + ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty, + representative, this->MessageRepresentativeBitLength()); + ma.m_empty = true; + Integer e(representative, representative.size()); + + Integer r(ma.m_semisignature, ma.m_semisignature.size()); + return alg.Verify(params, key, e, r, ma.m_s); + } + + DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const + { + this->GetMaterial().DoQuickSanityCheck(); + + PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); + const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + const DL_PublicKey &key = this->GetKeyInterface(); + + SecByteBlock representative(this->MessageRepresentativeLength()); + this->GetMessageEncodingInterface().ComputeMessageRepresentative( + NullRNG(), + ma.m_recoverableMessage, ma.m_recoverableMessage.size(), + ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty, + representative, this->MessageRepresentativeBitLength()); + ma.m_empty = true; + Integer e(representative, representative.size()); + + ma.m_presignature.New(params.GetEncodedElementSize(false)); + Integer r(ma.m_semisignature, ma.m_semisignature.size()); + alg.RecoverPresignature(params, key, r, ma.m_s).Encode(ma.m_presignature, ma.m_presignature.size()); + + return this->GetMessageEncodingInterface().RecoverMessageFromSemisignature( + ma.AccessHash(), this->GetHashIdentifier(), + ma.m_presignature, ma.m_presignature.size(), + ma.m_semisignature, ma.m_semisignature.size(), + recoveredMessage); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_VerifierBase() { } +#endif +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_CryptoSystemBase : public PK, public DL_Base +{ +public: + typedef typename DL_Base::Element Element; + + size_t MaxPlaintextLength(size_t ciphertextLength) const + { + unsigned int minLen = this->GetAbstractGroupParameters().GetEncodedElementSize(true); + return ciphertextLength < minLen ? 0 : GetSymmetricEncryptionAlgorithm().GetMaxSymmetricPlaintextLength(ciphertextLength - minLen); + } + + size_t CiphertextLength(size_t plaintextLength) const + { + size_t len = GetSymmetricEncryptionAlgorithm().GetSymmetricCiphertextLength(plaintextLength); + return len == 0 ? 0 : this->GetAbstractGroupParameters().GetEncodedElementSize(true) + len; + } + + bool ParameterSupported(const char *name) const + {return GetKeyDerivationAlgorithm().ParameterSupported(name) || GetSymmetricEncryptionAlgorithm().ParameterSupported(name);} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_CryptoSystemBase() { } +#endif + +protected: + virtual const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const =0; + virtual const DL_KeyDerivationAlgorithm & GetKeyDerivationAlgorithm() const =0; + virtual const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const =0; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_DecryptorBase : public DL_CryptoSystemBase > +{ +public: + typedef T Element; + + DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const + { + try + { + CRYPTOPP_UNUSED(rng); + const DL_KeyAgreementAlgorithm &agreeAlg = this->GetKeyAgreementAlgorithm(); + const DL_KeyDerivationAlgorithm &derivAlg = this->GetKeyDerivationAlgorithm(); + const DL_SymmetricEncryptionAlgorithm &encAlg = this->GetSymmetricEncryptionAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + const DL_PrivateKey &key = this->GetKeyInterface(); + + Element q = params.DecodeElement(ciphertext, true); + size_t elementSize = params.GetEncodedElementSize(true); + ciphertext += elementSize; + ciphertextLength -= elementSize; + + Element z = agreeAlg.AgreeWithStaticPrivateKey(params, q, true, key.GetPrivateExponent()); + + SecByteBlock derivedKey(encAlg.GetSymmetricKeyLength(encAlg.GetMaxSymmetricPlaintextLength(ciphertextLength))); + derivAlg.Derive(params, derivedKey, derivedKey.size(), z, q, parameters); + + return encAlg.SymmetricDecrypt(derivedKey, ciphertext, ciphertextLength, plaintext, parameters); + } + catch (DL_BadElement &) + { + return DecodingResult(); + } + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_DecryptorBase() { } +#endif +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_EncryptorBase : public DL_CryptoSystemBase > +{ +public: + typedef T Element; + + void Encrypt(RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const + { + const DL_KeyAgreementAlgorithm &agreeAlg = this->GetKeyAgreementAlgorithm(); + const DL_KeyDerivationAlgorithm &derivAlg = this->GetKeyDerivationAlgorithm(); + const DL_SymmetricEncryptionAlgorithm &encAlg = this->GetSymmetricEncryptionAlgorithm(); + const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); + const DL_PublicKey &key = this->GetKeyInterface(); + + Integer x(rng, Integer::One(), params.GetMaxExponent()); + Element q = params.ExponentiateBase(x); + params.EncodeElement(true, q, ciphertext); + unsigned int elementSize = params.GetEncodedElementSize(true); + ciphertext += elementSize; + + Element z = agreeAlg.AgreeWithEphemeralPrivateKey(params, key.GetPublicPrecomputation(), x); + + SecByteBlock derivedKey(encAlg.GetSymmetricKeyLength(plaintextLength)); + derivAlg.Derive(params, derivedKey, derivedKey.size(), z, q, parameters); + + encAlg.SymmetricEncrypt(rng, derivedKey, plaintext, plaintextLength, ciphertext, parameters); + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_EncryptorBase() { } +#endif +}; + +//! _ +template +struct DL_SchemeOptionsBase +{ + typedef T1 AlgorithmInfo; + typedef T2 GroupParameters; + typedef typename GroupParameters::Element Element; +}; + +//! _ +template +struct DL_KeyedSchemeOptions : public DL_SchemeOptionsBase +{ + typedef T2 Keys; + typedef typename Keys::PrivateKey PrivateKey; + typedef typename Keys::PublicKey PublicKey; +}; + +//! _ +template +struct DL_SignatureSchemeOptions : public DL_KeyedSchemeOptions +{ + typedef T3 SignatureAlgorithm; + typedef T4 MessageEncodingMethod; + typedef T5 HashFunction; +}; + +//! _ +template +struct DL_CryptoSchemeOptions : public DL_KeyedSchemeOptions +{ + typedef T3 KeyAgreementAlgorithm; + typedef T4 KeyDerivationAlgorithm; + typedef T5 SymmetricEncryptionAlgorithm; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_ObjectImplBase : public AlgorithmImpl +{ +public: + typedef SCHEME_OPTIONS SchemeOptions; + typedef typename KEY::Element Element; + + PrivateKey & AccessPrivateKey() {return m_key;} + PublicKey & AccessPublicKey() {return m_key;} + + // KeyAccessor + const KEY & GetKey() const {return m_key;} + KEY & AccessKey() {return m_key;} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_ObjectImplBase() { } +#endif + +protected: + typename BASE::KeyInterface & AccessKeyInterface() {return m_key;} + const typename BASE::KeyInterface & GetKeyInterface() const {return m_key;} + + // for signature scheme + HashIdentifier GetHashIdentifier() const + { + typedef typename SchemeOptions::MessageEncodingMethod::HashIdentifierLookup HashLookup; + return HashLookup::template HashIdentifierLookup2::Lookup(); + } + size_t GetDigestSize() const + { + typedef CPP_TYPENAME SchemeOptions::HashFunction H; + return H::DIGESTSIZE; + } + +private: + KEY m_key; +}; + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_ObjectImpl : public DL_ObjectImplBase +{ +public: + typedef typename KEY::Element Element; + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_ObjectImpl() { } +#endif + +protected: + const DL_ElgamalLikeSignatureAlgorithm & GetSignatureAlgorithm() const + {return Singleton().Ref();} + const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const + {return Singleton().Ref();} + const DL_KeyDerivationAlgorithm & GetKeyDerivationAlgorithm() const + {return Singleton().Ref();} + const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const + {return Singleton().Ref();} + HashIdentifier GetHashIdentifier() const + {return HashIdentifier();} + const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const + {return Singleton().Ref();} +}; + +//! _ +template +class DL_SignerImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PrivateKey> +{ +public: + PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const + { + member_ptr p(new PK_MessageAccumulatorImpl); + this->RestartMessageAccumulator(rng, *p); + return p.release(); + } +}; + +//! _ +template +class DL_VerifierImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PublicKey> +{ +public: + PK_MessageAccumulator * NewVerificationAccumulator() const + { + return new PK_MessageAccumulatorImpl; + } +}; + +//! _ +template +class DL_EncryptorImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PublicKey> +{ +}; + +//! _ +template +class DL_DecryptorImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PrivateKey> +{ +}; + +// ******************************************************** + +//! _ +template +class CRYPTOPP_NO_VTABLE DL_SimpleKeyAgreementDomainBase : public SimpleKeyAgreementDomain +{ +public: + typedef T Element; + + CryptoParameters & AccessCryptoParameters() {return AccessAbstractGroupParameters();} + unsigned int AgreedValueLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(false);} + unsigned int PrivateKeyLength() const {return GetAbstractGroupParameters().GetSubgroupOrder().ByteCount();} + unsigned int PublicKeyLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(true);} + + void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const + { + Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent()); + x.Encode(privateKey, PrivateKeyLength()); + } + + void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const + { + CRYPTOPP_UNUSED(rng); + const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); + Integer x(privateKey, PrivateKeyLength()); + Element y = params.ExponentiateBase(x); + params.EncodeElement(true, y, publicKey); + } + + bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const + { + try + { + const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); + Integer x(privateKey, PrivateKeyLength()); + Element w = params.DecodeElement(otherPublicKey, validateOtherPublicKey); + + Element z = GetKeyAgreementAlgorithm().AgreeWithStaticPrivateKey( + GetAbstractGroupParameters(), w, validateOtherPublicKey, x); + params.EncodeElement(false, z, agreedValue); + } + catch (DL_BadElement &) + { + return false; + } + return true; + } + + const Element &GetGenerator() const {return GetAbstractGroupParameters().GetSubgroupGenerator();} + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_SimpleKeyAgreementDomainBase() { } +#endif + +protected: + virtual const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const =0; + virtual DL_GroupParameters & AccessAbstractGroupParameters() =0; + const DL_GroupParameters & GetAbstractGroupParameters() const {return const_cast *>(this)->AccessAbstractGroupParameters();} +}; + +enum CofactorMultiplicationOption {NO_COFACTOR_MULTIPLICTION, COMPATIBLE_COFACTOR_MULTIPLICTION, INCOMPATIBLE_COFACTOR_MULTIPLICTION}; +typedef EnumToType NoCofactorMultiplication; +typedef EnumToType CompatibleCofactorMultiplication; +typedef EnumToType IncompatibleCofactorMultiplication; + +//! DH key agreement algorithm +template +class DL_KeyAgreementAlgorithm_DH : public DL_KeyAgreementAlgorithm +{ +public: + typedef ELEMENT Element; + + static const char * CRYPTOPP_API StaticAlgorithmName() + {return COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? "DHC" : "DH";} + + Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters ¶ms, const DL_FixedBasePrecomputation &publicPrecomputation, const Integer &privateExponent) const + { + return publicPrecomputation.Exponentiate(params.GetGroupPrecomputation(), + COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? privateExponent*params.GetCofactor() : privateExponent); + } + + Element AgreeWithStaticPrivateKey(const DL_GroupParameters ¶ms, const Element &publicElement, bool validateOtherPublicKey, const Integer &privateExponent) const + { + if (COFACTOR_OPTION::ToEnum() == COMPATIBLE_COFACTOR_MULTIPLICTION) + { + const Integer &k = params.GetCofactor(); + return params.ExponentiateElement(publicElement, + ModularArithmetic(params.GetSubgroupOrder()).Divide(privateExponent, k)*k); + } + else if (COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION) + return params.ExponentiateElement(publicElement, privateExponent*params.GetCofactor()); + else + { + assert(COFACTOR_OPTION::ToEnum() == NO_COFACTOR_MULTIPLICTION); + + if (!validateOtherPublicKey) + return params.ExponentiateElement(publicElement, privateExponent); + + if (params.FastSubgroupCheckAvailable()) + { + if (!params.ValidateElement(2, publicElement, NULL)) + throw DL_BadElement(); + return params.ExponentiateElement(publicElement, privateExponent); + } + else + { + const Integer e[2] = {params.GetSubgroupOrder(), privateExponent}; + Element r[2]; + params.SimultaneousExponentiate(r, publicElement, e, 2); + if (!params.IsIdentity(r[0])) + throw DL_BadElement(); + return r[1]; + } + } + } + +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~DL_KeyAgreementAlgorithm_DH() {} +#endif +}; + +// ******************************************************** + +//! A template implementing constructors for public key algorithm classes +template +class CRYPTOPP_NO_VTABLE PK_FinalTemplate : public BASE +{ +public: + PK_FinalTemplate() {} + + PK_FinalTemplate(const CryptoMaterial &key) + {this->AccessKey().AssignFrom(key);} + + PK_FinalTemplate(BufferedTransformation &bt) + {this->AccessKey().BERDecode(bt);} + + PK_FinalTemplate(const AsymmetricAlgorithm &algorithm) + {this->AccessKey().AssignFrom(algorithm.GetMaterial());} + + PK_FinalTemplate(const Integer &v1) + {this->AccessKey().Initialize(v1);} + +#if (defined(_MSC_VER) && _MSC_VER < 1300) + + template + PK_FinalTemplate(T1 &v1, T2 &v2) + {this->AccessKey().Initialize(v1, v2);} + + template + PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3) + {this->AccessKey().Initialize(v1, v2, v3);} + + template + PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4) + {this->AccessKey().Initialize(v1, v2, v3, v4);} + + template + PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5);} + + template + PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5, T6 &v6) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6);} + + template + PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5, T6 &v6, T7 &v7) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7);} + + template + PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5, T6 &v6, T7 &v7, T8 &v8) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7, v8);} + +#else + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2) + {this->AccessKey().Initialize(v1, v2);} + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3) + {this->AccessKey().Initialize(v1, v2, v3);} + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) + {this->AccessKey().Initialize(v1, v2, v3, v4);} + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5);} + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6);} + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7);} + + template + PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7, const T8 &v8) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7, v8);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2) + {this->AccessKey().Initialize(v1, v2);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3) + {this->AccessKey().Initialize(v1, v2, v3);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) + {this->AccessKey().Initialize(v1, v2, v3, v4);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7);} + + template + PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7, const T8 &v8) + {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7, v8);} + +#endif +}; + +//! \brief Base class for public key encryption standard classes. +//! \details These classes are used to select from variants of algorithms. +//! \note Not all standards apply to all algorithms. +struct EncryptionStandard {}; + +//! \brief Base class for public key signature standard classes. +//! \details These classes are used to select from variants of algorithms. +//! \note Not all standards apply to all algorithms. +struct SignatureStandard {}; + +template +class TF_ES; + +//! Trapdoor Function Based Encryption Scheme +template > +class TF_ES : public KEYS +{ + typedef typename STANDARD::EncryptionMessageEncodingMethod MessageEncodingMethod; + +public: + //! see EncryptionStandard for a list of standards + typedef STANDARD Standard; + typedef TF_CryptoSchemeOptions SchemeOptions; + + static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(KEYS::StaticAlgorithmName()) + "/" + MessageEncodingMethod::StaticAlgorithmName();} + + //! implements PK_Decryptor interface + typedef PK_FinalTemplate > Decryptor; + //! implements PK_Encryptor interface + typedef PK_FinalTemplate > Encryptor; +}; + +template // VC60 workaround: doesn't work if KEYS is first parameter +class TF_SS; + +//! Trapdoor Function Based Signature Scheme +template > // VC60 workaround: doesn't work if KEYS is first parameter +class TF_SS : public KEYS +{ +public: + //! see SignatureStandard for a list of standards + typedef STANDARD Standard; + typedef typename Standard::SignatureMessageEncodingMethod MessageEncodingMethod; + typedef TF_SignatureSchemeOptions SchemeOptions; + + static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(KEYS::StaticAlgorithmName()) + "/" + MessageEncodingMethod::StaticAlgorithmName() + "(" + H::StaticAlgorithmName() + ")";} + + //! implements PK_Signer interface + typedef PK_FinalTemplate > Signer; + //! implements PK_Verifier interface + typedef PK_FinalTemplate > Verifier; +}; + +template +class DL_SS; + +//! Discrete Log Based Signature Scheme +template > +class DL_SS : public KEYS +{ + typedef DL_SignatureSchemeOptions SchemeOptions; + +public: + static std::string StaticAlgorithmName() {return SA::StaticAlgorithmName() + std::string("/EMSA1(") + H::StaticAlgorithmName() + ")";} + + //! implements PK_Signer interface + typedef PK_FinalTemplate > Signer; + //! implements PK_Verifier interface + typedef PK_FinalTemplate > Verifier; +}; + +//! Discrete Log Based Encryption Scheme +template +class DL_ES : public KEYS +{ + typedef DL_CryptoSchemeOptions SchemeOptions; + +public: + //! implements PK_Decryptor interface + typedef PK_FinalTemplate > Decryptor; + //! implements PK_Encryptor interface + typedef PK_FinalTemplate > Encryptor; +}; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/pwdbased.h b/external/crypto++-5.6.3/pwdbased.h new file mode 100644 index 000000000..e4c686246 --- /dev/null +++ b/external/crypto++-5.6.3/pwdbased.h @@ -0,0 +1,227 @@ +// pwdbased.h - written and placed in the public domain by Wei Dai + +#ifndef CRYPTOPP_PWDBASED_H +#define CRYPTOPP_PWDBASED_H + +#include "cryptlib.h" +#include "hrtimer.h" +#include "integer.h" +#include "hmac.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! abstract base class for password based key derivation function +class PasswordBasedKeyDerivationFunction +{ +public: + virtual size_t MaxDerivedKeyLength() const =0; + virtual bool UsesPurposeByte() const =0; + //! derive key from password + /*! If timeInSeconds != 0, will iterate until time elapsed, as measured by ThreadUserTimer + Returns actual iteration count, which is equal to iterations if timeInSeconds == 0, and not less than iterations otherwise. */ + virtual unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const =0; +}; + +//! PBKDF1 from PKCS #5, T should be a HashTransformation class +template +class PKCS5_PBKDF1 : public PasswordBasedKeyDerivationFunction +{ +public: + size_t MaxDerivedKeyLength() const {return T::DIGESTSIZE;} + bool UsesPurposeByte() const {return false;} + // PKCS #5 says PBKDF1 should only take 8-byte salts. This implementation allows salts of any length. + unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const; +}; + +//! PBKDF2 from PKCS #5, T should be a HashTransformation class +template +class PKCS5_PBKDF2_HMAC : public PasswordBasedKeyDerivationFunction +{ +public: + size_t MaxDerivedKeyLength() const {return 0xffffffffU;} // should multiply by T::DIGESTSIZE, but gets overflow that way + bool UsesPurposeByte() const {return false;} + unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const; +}; + +/* +class PBKDF2Params +{ +public: + SecByteBlock m_salt; + unsigned int m_interationCount; + ASNOptional > m_keyLength; +}; +*/ + +template +unsigned int PKCS5_PBKDF1::DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const +{ + CRYPTOPP_UNUSED(purpose); + assert(derivedLen <= MaxDerivedKeyLength()); + assert(iterations > 0 || timeInSeconds > 0); + + if (!iterations) + iterations = 1; + + T hash; + hash.Update(password, passwordLen); + hash.Update(salt, saltLen); + + SecByteBlock buffer(hash.DigestSize()); + hash.Final(buffer); + + unsigned int i; + ThreadUserTimer timer; + + if (timeInSeconds) + timer.StartTimer(); + + for (i=1; i +unsigned int PKCS5_PBKDF2_HMAC::DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const +{ + CRYPTOPP_UNUSED(purpose); + assert(derivedLen <= MaxDerivedKeyLength()); + assert(iterations > 0 || timeInSeconds > 0); + + if (!iterations) + iterations = 1; + + HMAC hmac(password, passwordLen); + SecByteBlock buffer(hmac.DigestSize()); + ThreadUserTimer timer; + + unsigned int i=1; + while (derivedLen > 0) + { + hmac.Update(salt, saltLen); + unsigned int j; + for (j=0; j<4; j++) + { + byte b = byte(i >> ((3-j)*8)); + hmac.Update(&b, 1); + } + hmac.Final(buffer); + +#if CRYPTOPP_MSC_VERSION + const size_t segmentLen = STDMIN(derivedLen, buffer.size()); + memcpy_s(derived, segmentLen, buffer, segmentLen); +#else + const size_t segmentLen = STDMIN(derivedLen, buffer.size()); + memcpy(derived, buffer, segmentLen); +#endif + + if (timeInSeconds) + { + timeInSeconds = timeInSeconds / ((derivedLen + buffer.size() - 1) / buffer.size()); + timer.StartTimer(); + } + + for (j=1; j +class PKCS12_PBKDF : public PasswordBasedKeyDerivationFunction +{ +public: + size_t MaxDerivedKeyLength() const {return size_t(0)-1;} + bool UsesPurposeByte() const {return true;} + unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const; +}; + +template +unsigned int PKCS12_PBKDF::DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const +{ + assert(derivedLen <= MaxDerivedKeyLength()); + assert(iterations > 0 || timeInSeconds > 0); + + if (!iterations) + iterations = 1; + + const size_t v = T::BLOCKSIZE; // v is in bytes rather than bits as in PKCS #12 + const size_t DLen = v, SLen = RoundUpToMultipleOf(saltLen, v); + const size_t PLen = RoundUpToMultipleOf(passwordLen, v), ILen = SLen + PLen; + SecByteBlock buffer(DLen + SLen + PLen); + byte *D = buffer, *S = buffer+DLen, *P = buffer+DLen+SLen, *I = S; + + memset(D, purpose, DLen); + size_t i; + for (i=0; i 0) + { + hash.CalculateDigest(Ai, buffer, buffer.size()); + + if (timeInSeconds) + { + timeInSeconds = timeInSeconds / ((derivedLen + Ai.size() - 1) / Ai.size()); + timer.StartTimer(); + } + + for (i=1; i(), m_autoNodeSize(!nodeSize), m_nodeSize(nodeSize) + , m_head(NULL), m_tail(NULL), m_lazyString(NULL), m_lazyLength(0), m_lazyStringModifiable(false) +{ + SetNodeSize(nodeSize); + m_head = m_tail = new ByteQueueNode(m_nodeSize); +} + +void ByteQueue::SetNodeSize(size_t nodeSize) +{ + m_autoNodeSize = !nodeSize; + m_nodeSize = m_autoNodeSize ? 256 : nodeSize; +} + +ByteQueue::ByteQueue(const ByteQueue ©) + : Bufferless(copy), m_lazyString(NULL), m_lazyLength(0) +{ + CopyFrom(copy); +} + +void ByteQueue::CopyFrom(const ByteQueue ©) +{ + m_lazyLength = 0; + m_autoNodeSize = copy.m_autoNodeSize; + m_nodeSize = copy.m_nodeSize; + m_head = m_tail = new ByteQueueNode(*copy.m_head); + + for (ByteQueueNode *current=copy.m_head->next; current; current=current->next) + { + m_tail->next = new ByteQueueNode(*current); + m_tail = m_tail->next; + } + + m_tail->next = NULL; + + Put(copy.m_lazyString, copy.m_lazyLength); +} + +ByteQueue::~ByteQueue() +{ + Destroy(); +} + +void ByteQueue::Destroy() +{ + for (ByteQueueNode *next, *current=m_head; current; current=next) + { + next=current->next; + delete current; + } +} + +void ByteQueue::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_nodeSize = parameters.GetIntValueWithDefault("NodeSize", 256); + Clear(); +} + +lword ByteQueue::CurrentSize() const +{ + lword size=0; + + for (ByteQueueNode *current=m_head; current; current=current->next) + size += current->CurrentSize(); + + return size + m_lazyLength; +} + +bool ByteQueue::IsEmpty() const +{ + return m_head==m_tail && m_head->CurrentSize()==0 && m_lazyLength==0; +} + +void ByteQueue::Clear() +{ + for (ByteQueueNode *next, *current=m_head->next; current; current=next) + { + next=current->next; + delete current; + } + + m_tail = m_head; + m_head->Clear(); + m_head->next = NULL; + m_lazyLength = 0; +} + +size_t ByteQueue::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) +{ + CRYPTOPP_UNUSED(messageEnd), CRYPTOPP_UNUSED(blocking); + + if (m_lazyLength > 0) + FinalizeLazyPut(); + + size_t len; + while ((len=m_tail->Put(inString, length)) < length) + { + inString += len; + length -= len; + if (m_autoNodeSize && m_nodeSize < s_maxAutoNodeSize) + do + { + m_nodeSize *= 2; + } + while (m_nodeSize < length && m_nodeSize < s_maxAutoNodeSize); + m_tail->next = new ByteQueueNode(STDMAX(m_nodeSize, length)); + m_tail = m_tail->next; + } + + return 0; +} + +void ByteQueue::CleanupUsedNodes() +{ + // Test for m_head due to Enterprise Anlysis finding + while (m_head && m_head != m_tail && m_head->UsedUp()) + { + ByteQueueNode *temp=m_head; + m_head=m_head->next; + delete temp; + } + + // Test for m_head due to Enterprise Anlysis finding + if (m_head && m_head->CurrentSize() == 0) + m_head->Clear(); +} + +void ByteQueue::LazyPut(const byte *inString, size_t size) +{ + if (m_lazyLength > 0) + FinalizeLazyPut(); + + if (inString == m_tail->buf+m_tail->m_tail) + Put(inString, size); + else + { + m_lazyString = const_cast(inString); + m_lazyLength = size; + m_lazyStringModifiable = false; + } +} + +void ByteQueue::LazyPutModifiable(byte *inString, size_t size) +{ + if (m_lazyLength > 0) + FinalizeLazyPut(); + m_lazyString = inString; + m_lazyLength = size; + m_lazyStringModifiable = true; +} + +void ByteQueue::UndoLazyPut(size_t size) +{ + if (m_lazyLength < size) + throw InvalidArgument("ByteQueue: size specified for UndoLazyPut is too large"); + + m_lazyLength -= size; +} + +void ByteQueue::FinalizeLazyPut() +{ + size_t len = m_lazyLength; + m_lazyLength = 0; + if (len) + Put(m_lazyString, len); +} + +size_t ByteQueue::Get(byte &outByte) +{ + if (m_head->Get(outByte)) + { + if (m_head->UsedUp()) + CleanupUsedNodes(); + return 1; + } + else if (m_lazyLength > 0) + { + outByte = *m_lazyString++; + m_lazyLength--; + return 1; + } + else + return 0; +} + +size_t ByteQueue::Get(byte *outString, size_t getMax) +{ + ArraySink sink(outString, getMax); + return (size_t)TransferTo(sink, getMax); +} + +size_t ByteQueue::Peek(byte &outByte) const +{ + if (m_head->Peek(outByte)) + return 1; + else if (m_lazyLength > 0) + { + outByte = *m_lazyString; + return 1; + } + else + return 0; +} + +size_t ByteQueue::Peek(byte *outString, size_t peekMax) const +{ + ArraySink sink(outString, peekMax); + return (size_t)CopyTo(sink, peekMax); +} + +size_t ByteQueue::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + if (blocking) + { + lword bytesLeft = transferBytes; + for (ByteQueueNode *current=m_head; bytesLeft && current; current=current->next) + bytesLeft -= current->TransferTo(target, bytesLeft, channel); + CleanupUsedNodes(); + + size_t len = (size_t)STDMIN(bytesLeft, (lword)m_lazyLength); + if (len) + { + if (m_lazyStringModifiable) + target.ChannelPutModifiable(channel, m_lazyString, len); + else + target.ChannelPut(channel, m_lazyString, len); + m_lazyString += len; + m_lazyLength -= len; + bytesLeft -= len; + } + transferBytes -= bytesLeft; + return 0; + } + else + { + Walker walker(*this); + size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking); + Skip(transferBytes); + return blockedBytes; + } +} + +size_t ByteQueue::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + Walker walker(*this); + walker.Skip(begin); + lword transferBytes = end-begin; + size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking); + begin += transferBytes; + return blockedBytes; +} + +void ByteQueue::Unget(byte inByte) +{ + Unget(&inByte, 1); +} + +void ByteQueue::Unget(const byte *inString, size_t length) +{ + size_t len = STDMIN(length, m_head->m_head); + length -= len; + m_head->m_head -= len; + memcpy(m_head->buf + m_head->m_head, inString + length, len); + + if (length > 0) + { + ByteQueueNode *newHead = new ByteQueueNode(length); + newHead->next = m_head; + m_head = newHead; + m_head->Put(inString, length); + } +} + +const byte * ByteQueue::Spy(size_t &contiguousSize) const +{ + contiguousSize = m_head->m_tail - m_head->m_head; + if (contiguousSize == 0 && m_lazyLength > 0) + { + contiguousSize = m_lazyLength; + return m_lazyString; + } + else + return m_head->buf + m_head->m_head; +} + +byte * ByteQueue::CreatePutSpace(size_t &size) +{ + if (m_lazyLength > 0) + FinalizeLazyPut(); + + if (m_tail->m_tail == m_tail->MaxSize()) + { + m_tail->next = new ByteQueueNode(STDMAX(m_nodeSize, size)); + m_tail = m_tail->next; + } + + size = m_tail->MaxSize() - m_tail->m_tail; + return m_tail->buf + m_tail->m_tail; +} + +ByteQueue & ByteQueue::operator=(const ByteQueue &rhs) +{ + Destroy(); + CopyFrom(rhs); + return *this; +} + +bool ByteQueue::operator==(const ByteQueue &rhs) const +{ + const lword currentSize = CurrentSize(); + + if (currentSize != rhs.CurrentSize()) + return false; + + Walker walker1(*this), walker2(rhs); + byte b1, b2; + + while (walker1.Get(b1) && walker2.Get(b2)) + if (b1 != b2) + return false; + + return true; +} + +byte ByteQueue::operator[](lword i) const +{ + for (ByteQueueNode *current=m_head; current; current=current->next) + { + if (i < current->CurrentSize()) + return (*current)[(size_t)i]; + + i -= current->CurrentSize(); + } + + assert(i < m_lazyLength); + return m_lazyString[i]; +} + +void ByteQueue::swap(ByteQueue &rhs) +{ + std::swap(m_autoNodeSize, rhs.m_autoNodeSize); + std::swap(m_nodeSize, rhs.m_nodeSize); + std::swap(m_head, rhs.m_head); + std::swap(m_tail, rhs.m_tail); + std::swap(m_lazyString, rhs.m_lazyString); + std::swap(m_lazyLength, rhs.m_lazyLength); + std::swap(m_lazyStringModifiable, rhs.m_lazyStringModifiable); +} + +// ******************************************************** + +void ByteQueue::Walker::IsolatedInitialize(const NameValuePairs ¶meters) +{ + CRYPTOPP_UNUSED(parameters); + + m_node = m_queue.m_head; + m_position = 0; + m_offset = 0; + m_lazyString = m_queue.m_lazyString; + m_lazyLength = m_queue.m_lazyLength; +} + +size_t ByteQueue::Walker::Get(byte &outByte) +{ + ArraySink sink(&outByte, 1); + return (size_t)TransferTo(sink, 1); +} + +size_t ByteQueue::Walker::Get(byte *outString, size_t getMax) +{ + ArraySink sink(outString, getMax); + return (size_t)TransferTo(sink, getMax); +} + +size_t ByteQueue::Walker::Peek(byte &outByte) const +{ + ArraySink sink(&outByte, 1); + return (size_t)CopyTo(sink, 1); +} + +size_t ByteQueue::Walker::Peek(byte *outString, size_t peekMax) const +{ + ArraySink sink(outString, peekMax); + return (size_t)CopyTo(sink, peekMax); +} + +size_t ByteQueue::Walker::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) +{ + lword bytesLeft = transferBytes; + size_t blockedBytes = 0; + + while (m_node) + { + size_t len = (size_t)STDMIN(bytesLeft, (lword)m_node->CurrentSize()-m_offset); + blockedBytes = target.ChannelPut2(channel, m_node->buf+m_node->m_head+m_offset, len, 0, blocking); + + if (blockedBytes) + goto done; + + m_position += len; + bytesLeft -= len; + + if (!bytesLeft) + { + m_offset += len; + goto done; + } + + m_node = m_node->next; + m_offset = 0; + } + + if (bytesLeft && m_lazyLength) + { + size_t len = (size_t)STDMIN(bytesLeft, (lword)m_lazyLength); + blockedBytes = target.ChannelPut2(channel, m_lazyString, len, 0, blocking); + if (blockedBytes) + goto done; + + m_lazyString += len; + m_lazyLength -= len; + bytesLeft -= len; + } + +done: + transferBytes -= bytesLeft; + return blockedBytes; +} + +size_t ByteQueue::Walker::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const +{ + Walker walker(*this); + walker.Skip(begin); + lword transferBytes = end-begin; + size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking); + begin += transferBytes; + return blockedBytes; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/queue.h b/external/crypto++-5.6.3/queue.h new file mode 100644 index 000000000..bc1b2aac3 --- /dev/null +++ b/external/crypto++-5.6.3/queue.h @@ -0,0 +1,149 @@ +// queue.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile queue.h +//! \brief Classes for an unlimited queue to store bytes + +#ifndef CRYPTOPP_QUEUE_H +#define CRYPTOPP_QUEUE_H + +#include "cryptlib.h" +#include "simple.h" + +NAMESPACE_BEGIN(CryptoPP) + +/** The queue is implemented as a linked list of byte arrays, but you don't need to + know about that. So just ignore this next line. :) */ +class ByteQueueNode; + +//! Byte Queue +class CRYPTOPP_DLL ByteQueue : public Bufferless +{ +public: + ByteQueue(size_t nodeSize=0); + ByteQueue(const ByteQueue ©); + ~ByteQueue(); + + lword MaxRetrievable() const + {return CurrentSize();} + bool AnyRetrievable() const + {return !IsEmpty();} + + void IsolatedInitialize(const NameValuePairs ¶meters); + byte * CreatePutSpace(size_t &size); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + + size_t Get(byte &outByte); + size_t Get(byte *outString, size_t getMax); + + size_t Peek(byte &outByte) const; + size_t Peek(byte *outString, size_t peekMax) const; + + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + + // these member functions are not inherited + void SetNodeSize(size_t nodeSize); + + lword CurrentSize() const; + bool IsEmpty() const; + + void Clear(); + + void Unget(byte inByte); + void Unget(const byte *inString, size_t length); + + const byte * Spy(size_t &contiguousSize) const; + + void LazyPut(const byte *inString, size_t size); + void LazyPutModifiable(byte *inString, size_t size); + void UndoLazyPut(size_t size); + void FinalizeLazyPut(); + + ByteQueue & operator=(const ByteQueue &rhs); + bool operator==(const ByteQueue &rhs) const; + bool operator!=(const ByteQueue &rhs) const {return !operator==(rhs);} + byte operator[](lword i) const; + void swap(ByteQueue &rhs); + + class Walker : public InputRejecting + { + public: + Walker(const ByteQueue &queue) + : m_queue(queue), m_node(NULL), m_position(0), m_offset(0), m_lazyString(NULL), m_lazyLength(0) + {Initialize();} + + lword GetCurrentPosition() {return m_position;} + + lword MaxRetrievable() const + {return m_queue.CurrentSize() - m_position;} + + void IsolatedInitialize(const NameValuePairs ¶meters); + + size_t Get(byte &outByte); + size_t Get(byte *outString, size_t getMax); + + size_t Peek(byte &outByte) const; + size_t Peek(byte *outString, size_t peekMax) const; + + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; + + private: + const ByteQueue &m_queue; + const ByteQueueNode *m_node; + lword m_position; + size_t m_offset; + const byte *m_lazyString; + size_t m_lazyLength; + }; + + friend class Walker; + +private: + void CleanupUsedNodes(); + void CopyFrom(const ByteQueue ©); + void Destroy(); + + bool m_autoNodeSize; + size_t m_nodeSize; + ByteQueueNode *m_head, *m_tail; + byte *m_lazyString; + size_t m_lazyLength; + bool m_lazyStringModifiable; +}; + +//! use this to make sure LazyPut is finalized in event of exception +class CRYPTOPP_DLL LazyPutter +{ +public: + LazyPutter(ByteQueue &bq, const byte *inString, size_t size) + : m_bq(bq) {bq.LazyPut(inString, size);} + ~LazyPutter() + {try {m_bq.FinalizeLazyPut();} catch(const Exception&) {assert(0);}} +protected: + LazyPutter(ByteQueue &bq) : m_bq(bq) {} +private: + ByteQueue &m_bq; +}; + +//! like LazyPutter, but does a LazyPutModifiable instead +class LazyPutterModifiable : public LazyPutter +{ +public: + LazyPutterModifiable(ByteQueue &bq, byte *inString, size_t size) + : LazyPutter(bq) {bq.LazyPutModifiable(inString, size);} +}; + +NAMESPACE_END + +#ifndef __BORLANDC__ +NAMESPACE_BEGIN(std) +template<> inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b) +{ + a.swap(b); +} +NAMESPACE_END +#endif + +#endif diff --git a/external/crypto++-5.6.3/rabin.cpp b/external/crypto++-5.6.3/rabin.cpp new file mode 100644 index 000000000..a1bd7d88d --- /dev/null +++ b/external/crypto++-5.6.3/rabin.cpp @@ -0,0 +1,222 @@ +// rabin.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "rabin.h" +#include "integer.h" +#include "nbtheory.h" +#include "modarith.h" +#include "asn.h" +#include "sha.h" + +NAMESPACE_BEGIN(CryptoPP) + +void RabinFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + m_n.BERDecode(seq); + m_r.BERDecode(seq); + m_s.BERDecode(seq); + seq.MessageEnd(); +} + +void RabinFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_n.DEREncode(seq); + m_r.DEREncode(seq); + m_s.DEREncode(seq); + seq.MessageEnd(); +} + +Integer RabinFunction::ApplyFunction(const Integer &in) const +{ + DoQuickSanityCheck(); + + Integer out = in.Squared()%m_n; + if (in.IsOdd()) + out = out*m_r%m_n; + if (Jacobi(in, m_n)==-1) + out = out*m_s%m_n; + return out; +} + +bool RabinFunction::Validate(RandomNumberGenerator& /*rng*/, unsigned int level) const +{ + bool pass = true; + pass = pass && m_n > Integer::One() && m_n%4 == 1; + pass = pass && m_r > Integer::One() && m_r < m_n; + pass = pass && m_s > Integer::One() && m_s < m_n; + if (level >= 1) + pass = pass && Jacobi(m_r, m_n) == -1 && Jacobi(m_s, m_n) == -1; + return pass; +} + +bool RabinFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_GET_FUNCTION_ENTRY(QuadraticResidueModPrime1) + CRYPTOPP_GET_FUNCTION_ENTRY(QuadraticResidueModPrime2) + ; +} + +void RabinFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_SET_FUNCTION_ENTRY(QuadraticResidueModPrime1) + CRYPTOPP_SET_FUNCTION_ENTRY(QuadraticResidueModPrime2) + ; +} + +// ***************************************************************************** +// private key operations: + +// generate a random private key +void InvertibleRabinFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + int modulusSize = 2048; + alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); + + if (modulusSize < 16) + throw InvalidArgument("InvertibleRabinFunction: specified modulus size is too small"); + + // VC70 workaround: putting these after primeParam causes overlapped stack allocation + bool rFound=false, sFound=false; + Integer t=2; + + AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) + ("EquivalentTo", 3)("Mod", 4); + m_p.GenerateRandom(rng, primeParam); + m_q.GenerateRandom(rng, primeParam); + + while (!(rFound && sFound)) + { + int jp = Jacobi(t, m_p); + int jq = Jacobi(t, m_q); + + if (!rFound && jp==1 && jq==-1) + { + m_r = t; + rFound = true; + } + + if (!sFound && jp==-1 && jq==1) + { + m_s = t; + sFound = true; + } + + ++t; + } + + m_n = m_p * m_q; + m_u = m_q.InverseMod(m_p); +} + +void InvertibleRabinFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + m_n.BERDecode(seq); + m_r.BERDecode(seq); + m_s.BERDecode(seq); + m_p.BERDecode(seq); + m_q.BERDecode(seq); + m_u.BERDecode(seq); + seq.MessageEnd(); +} + +void InvertibleRabinFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_n.DEREncode(seq); + m_r.DEREncode(seq); + m_s.DEREncode(seq); + m_p.DEREncode(seq); + m_q.DEREncode(seq); + m_u.DEREncode(seq); + seq.MessageEnd(); +} + +Integer InvertibleRabinFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &in) const +{ + DoQuickSanityCheck(); + + ModularArithmetic modn(m_n); + Integer r(rng, Integer::One(), m_n - Integer::One()); + r = modn.Square(r); + Integer r2 = modn.Square(r); + Integer c = modn.Multiply(in, r2); // blind + + Integer cp=c%m_p, cq=c%m_q; + + int jp = Jacobi(cp, m_p); + int jq = Jacobi(cq, m_q); + + if (jq==-1) + { + cp = cp*EuclideanMultiplicativeInverse(m_r, m_p)%m_p; + cq = cq*EuclideanMultiplicativeInverse(m_r, m_q)%m_q; + } + + if (jp==-1) + { + cp = cp*EuclideanMultiplicativeInverse(m_s, m_p)%m_p; + cq = cq*EuclideanMultiplicativeInverse(m_s, m_q)%m_q; + } + + cp = ModularSquareRoot(cp, m_p); + cq = ModularSquareRoot(cq, m_q); + + if (jp==-1) + cp = m_p-cp; + + Integer out = CRT(cq, m_q, cp, m_p, m_u); + + out = modn.Divide(out, r); // unblind + + if ((jq==-1 && out.IsEven()) || (jq==1 && out.IsOdd())) + out = m_n-out; + + return out; +} + +bool InvertibleRabinFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = RabinFunction::Validate(rng, level); + pass = pass && m_p > Integer::One() && m_p%4 == 3 && m_p < m_n; + pass = pass && m_q > Integer::One() && m_q%4 == 3 && m_q < m_n; + pass = pass && m_u.IsPositive() && m_u < m_p; + if (level >= 1) + { + pass = pass && m_p * m_q == m_n; + pass = pass && m_u * m_q % m_p == 1; + pass = pass && Jacobi(m_r, m_p) == 1; + pass = pass && Jacobi(m_r, m_q) == -1; + pass = pass && Jacobi(m_s, m_p) == -1; + pass = pass && Jacobi(m_s, m_q) == 1; + } + if (level >= 2) + pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); + return pass; +} + +bool InvertibleRabinFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +void InvertibleRabinFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/rabin.h b/external/crypto++-5.6.3/rabin.h new file mode 100644 index 000000000..615104cff --- /dev/null +++ b/external/crypto++-5.6.3/rabin.h @@ -0,0 +1,111 @@ +// rabin.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile rabin.h +//! \brief Classes for Rabin encryption and signature schemes + +#ifndef CRYPTOPP_RABIN_H +#define CRYPTOPP_RABIN_H + +#include "cryptlib.h" +#include "oaep.h" +#include "pssr.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class RabinFunction : public TrapdoorFunction, public PublicKey +{ + typedef RabinFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &r, const Integer &s) + {m_n = n; m_r = r; m_s = s;} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + Integer ApplyFunction(const Integer &x) const; + Integer PreimageBound() const {return m_n;} + Integer ImageBound() const {return m_n;} + + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + const Integer& GetModulus() const {return m_n;} + const Integer& GetQuadraticResidueModPrime1() const {return m_r;} + const Integer& GetQuadraticResidueModPrime2() const {return m_s;} + + void SetModulus(const Integer &n) {m_n = n;} + void SetQuadraticResidueModPrime1(const Integer &r) {m_r = r;} + void SetQuadraticResidueModPrime2(const Integer &s) {m_s = s;} + +protected: + Integer m_n, m_r, m_s; +}; + +//! _ +class InvertibleRabinFunction : public RabinFunction, public TrapdoorFunctionInverse, public PrivateKey +{ + typedef InvertibleRabinFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &r, const Integer &s, + const Integer &p, const Integer &q, const Integer &u) + {m_n = n; m_r = r; m_s = s; m_p = p; m_q = q; m_u = u;} + void Initialize(RandomNumberGenerator &rng, unsigned int keybits) + {GenerateRandomWithKeySize(rng, keybits);} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; + + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + /*! parameters: (ModulusSize) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + const Integer& GetPrime1() const {return m_p;} + const Integer& GetPrime2() const {return m_q;} + const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} + + void SetPrime1(const Integer &p) {m_p = p;} + void SetPrime2(const Integer &q) {m_q = q;} + void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} + +protected: + Integer m_p, m_q, m_u; +}; + +//! Rabin +struct Rabin +{ + static std::string StaticAlgorithmName() {return "Rabin-Crypto++Variant";} + typedef RabinFunction PublicKey; + typedef InvertibleRabinFunction PrivateKey; +}; + +//! Rabin encryption +template +struct RabinES : public TF_ES +{ +}; + +//! Rabin signature +template +struct RabinSS : public TF_SS +{ +}; + +// More typedefs for backwards compatibility +class SHA1; +typedef RabinES >::Decryptor RabinDecryptor; +typedef RabinES >::Encryptor RabinEncryptor; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/randpool.cpp b/external/crypto++-5.6.3/randpool.cpp new file mode 100644 index 000000000..f1a9596e5 --- /dev/null +++ b/external/crypto++-5.6.3/randpool.cpp @@ -0,0 +1,74 @@ +// randpool.cpp - written and placed in the public domain by Wei Dai +// RandomPool used to follow the design of randpool in PGP 2.6.x, +// but as of version 5.5 it has been redesigned to reduce the risk +// of reusing random numbers after state rollback (which may occur +// when running in a virtual machine like VMware). + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "randpool.h" +#include "aes.h" +#include "sha.h" +#include "hrtimer.h" +#include + +NAMESPACE_BEGIN(CryptoPP) + +RandomPool::RandomPool() + : m_pCipher(new AES::Encryption), m_keySet(false) +{ + memset(m_key, 0, m_key.SizeInBytes()); + memset(m_seed, 0, m_seed.SizeInBytes()); +} + +void RandomPool::IncorporateEntropy(const byte *input, size_t length) +{ + SHA256 hash; + hash.Update(m_key, 32); + hash.Update(input, length); + hash.Final(m_key); + m_keySet = false; +} + +void RandomPool::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size) +{ + if (size > 0) + { + if (!m_keySet) + m_pCipher->SetKey(m_key, 32); + + Timer timer; + TimerWord tw = timer.GetCurrentTimerValue(); + CRYPTOPP_COMPILE_ASSERT(sizeof(tw) <= 16); + *(TimerWord *)m_seed.data() += tw; + + time_t t = time(NULL); + CRYPTOPP_COMPILE_ASSERT(sizeof(t) <= 8); + + // UBsan finding: signed integer overflow: 1876017710 + 1446085457 cannot be represented in type 'long int' + // *(time_t *)(m_seed.data()+8) += t; + assert(m_seed.size() >= 16); + word64 tt1, tt2 = (word64)t; + memcpy(&tt1, m_seed.data()+8, 8); + memcpy(m_seed.data()+8, &(tt2 += tt1), 8); + + // Wipe the intermediates + *((volatile TimerWord*)&tw) = 0; + *((volatile word64*)&tt1) = 0; + *((volatile word64*)&tt2) = 0; + + do + { + m_pCipher->ProcessBlock(m_seed); + size_t len = UnsignedMin(16, size); + target.ChannelPut(channel, m_seed, len); + size -= len; + } while (size > 0); + } +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/randpool.h b/external/crypto++-5.6.3/randpool.h new file mode 100644 index 000000000..8921e7a43 --- /dev/null +++ b/external/crypto++-5.6.3/randpool.h @@ -0,0 +1,36 @@ +#ifndef CRYPTOPP_RANDPOOL_H +#define CRYPTOPP_RANDPOOL_H + +#include "cryptlib.h" +#include "filters.h" +#include "secblock.h" +#include "smartptr.h" +#include "aes.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Randomness Pool +/*! This class can be used to generate cryptographic quality + pseudorandom bytes after seeding the pool with IncorporateEntropy() */ +class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator, public NotCopyable +{ +public: + RandomPool(); + + bool CanIncorporateEntropy() const {return true;} + void IncorporateEntropy(const byte *input, size_t length); + void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size); + + // for backwards compatibility. use RandomNumberSource, RandomNumberStore, and RandomNumberSink for other BufferTransformation functionality + void Put(const byte *input, size_t length) {IncorporateEntropy(input, length);} + +private: + FixedSizeSecBlock m_key; + FixedSizeSecBlock m_seed; + member_ptr m_pCipher; + bool m_keySet; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rc2.cpp b/external/crypto++-5.6.3/rc2.cpp new file mode 100644 index 000000000..b8710f0d6 --- /dev/null +++ b/external/crypto++-5.6.3/rc2.cpp @@ -0,0 +1,118 @@ +// rc2.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "rc2.h" +#include "misc.h" +#include "argnames.h" + +NAMESPACE_BEGIN(CryptoPP) + +void RC2::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(keyLen); + + int effectiveLen = params.GetIntValueWithDefault(Name::EffectiveKeyLength(), DEFAULT_EFFECTIVE_KEYLENGTH); + if (effectiveLen > MAX_EFFECTIVE_KEYLENGTH) + throw InvalidArgument("RC2: effective key length parameter exceeds maximum"); + + static const unsigned char PITABLE[256] = { + 217,120,249,196, 25,221,181,237, 40,233,253,121, 74,160,216,157, + 198,126, 55,131, 43,118, 83,142, 98, 76,100,136, 68,139,251,162, + 23,154, 89,245,135,179, 79, 19, 97, 69,109,141, 9,129,125, 50, + 189,143, 64,235,134,183,123, 11,240,149, 33, 34, 92,107, 78,130, + 84,214,101,147,206, 96,178, 28,115, 86,192, 20,167,140,241,220, + 18,117,202, 31, 59,190,228,209, 66, 61,212, 48,163, 60,182, 38, + 111,191, 14,218, 70,105, 7, 87, 39,242, 29,155,188,148, 67, 3, + 248, 17,199,246,144,239, 62,231, 6,195,213, 47,200,102, 30,215, + 8,232,234,222,128, 82,238,247,132,170,114,172, 53, 77,106, 42, + 150, 26,210,113, 90, 21, 73,116, 75,159,208, 94, 4, 24,164,236, + 194,224, 65,110, 15, 81,203,204, 36,145,175, 80,161,244,112, 57, + 153,124, 58,133, 35,184,180,122,252, 2, 54, 91, 37, 85,151, 49, + 45, 93,250,152,227,138,146,174, 5,223, 41, 16,103,108,186,201, + 211, 0,230,207,225,158,168, 44, 99, 22, 1, 63, 88,226,137,169, + 13, 56, 52, 27,171, 51,255,176,187, 72, 12, 95,185,177,205, 46, + 197,243,219, 71,229,165,156,119, 10,166, 32,104,254,127,193,173}; + + SecByteBlock L(128); + memcpy(L, key, keyLen); + + int i; + for (i=keyLen; i<128; i++) + L[i] = PITABLE[(L[i-1] + L[i-keyLen]) & 255]; + + unsigned int T8 = (effectiveLen+7) / 8; + byte TM = byte((int)255 >> ((8-(effectiveLen%8))%8)); + L[128-T8] = PITABLE[L[128-T8] & TM]; + + for (i=127-T8; i>=0; i--) + L[i] = PITABLE[L[i+1] ^ L[i+T8]]; + + for (i=0; i<64; i++) + K[i] = L[2*i] + (L[2*i+1] << 8); +} + +typedef BlockGetAndPut Block; + +void RC2::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word16 R0, R1, R2, R3; + Block::Get(inBlock)(R0)(R1)(R2)(R3); + + for (int i = 0; i < 16; i++) + { + R0 += (R1 & ~R3) + (R2 & R3) + K[4*i+0]; + R0 = rotlFixed(R0, 1); + + R1 += (R2 & ~R0) + (R3 & R0) + K[4*i+1]; + R1 = rotlFixed(R1, 2); + + R2 += (R3 & ~R1) + (R0 & R1) + K[4*i+2]; + R2 = rotlFixed(R2, 3); + + R3 += (R0 & ~R2) + (R1 & R2) + K[4*i+3]; + R3 = rotlFixed(R3, 5); + + if (i == 4 || i == 10) + { + R0 = word16(R0 + K[R3 & 63]); + R1 = word16(R1 + K[R0 & 63]); + R2 = word16(R2 + K[R1 & 63]); + R3 = word16(R3 + K[R2 & 63]); + } + } + + Block::Put(xorBlock, outBlock)(R0)(R1)(R2)(R3); +} + +void RC2::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word16 R0, R1, R2, R3; + Block::Get(inBlock)(R0)(R1)(R2)(R3); + + for (int i = 15; i >= 0; i--) + { + if (i == 4 || i == 10) + { + R3 = word16(R3 - K[R2 & 63]); + R2 = word16(R2 - K[R1 & 63]); + R1 = word16(R1 - K[R0 & 63]); + R0 = word16(R0 - K[R3 & 63]); + } + + R3 = rotrFixed(R3, 5); + R3 = word16(R3 - ((R0 & ~R2) + (R1 & R2) + K[4*i+3])); + + R2 = rotrFixed(R2, 3); + R2 = word16(R2 - ((R3 & ~R1) + (R0 & R1) + K[4*i+2])); + + R1 = rotrFixed(R1, 2); + R1 = word16(R1 - ((R2 & ~R0) + (R3 & R0) + K[4*i+1])); + + R0 = rotrFixed(R0, 1); + R0 = word16(R0 - ((R1 & ~R3) + (R2 & R3) + K[4*i+0])); + } + + Block::Put(xorBlock, outBlock)(R0)(R1)(R2)(R3); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/rc2.h b/external/crypto++-5.6.3/rc2.h new file mode 100644 index 000000000..406bd0cb4 --- /dev/null +++ b/external/crypto++-5.6.3/rc2.h @@ -0,0 +1,95 @@ +// rc2.h - written and placed in the public domain by Wei Dai + +//! \file rc2.h +//! \brief Classes for the RC2 block cipher + +#ifndef CRYPTOPP_RC2_H +#define CRYPTOPP_RC2_H + +#include "seckey.h" +#include "secblock.h" +#include "algparam.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class RC2_Info +//! \brief The RC2 cipher's key, iv, block size and name information. +struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128> +{ + CRYPTOPP_CONSTANT(DEFAULT_EFFECTIVE_KEYLENGTH = 1024) + CRYPTOPP_CONSTANT(MAX_EFFECTIVE_KEYLENGTH = 1024) + static const char *StaticAlgorithmName() {return "RC2";} +}; + +//! \class RC2 +//! \brief The RC2 stream cipher +//! \sa RC2 on the Crypto Lounge. +class RC2 : public RC2_Info, public BlockCipherDocumentation +{ + //! \class Base + //! \brief Class specific methods used to operate the cipher. + //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} + + protected: + FixedSizeSecBlock K; // expanded key table + }; + + //! \class Enc + //! \brief Class specific methods used to operate the cipher in the forward direction. + //! \details Implementations and overrides in \p Enc apply to \p ENCRYPTION. + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + //! \class Dec + //! \brief Class specific methods used to operate the cipher in the reverse direction. + //! \details Implementations and overrides in \p Dec apply to \p DECRYPTION. + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + + //! \class Encryption + //! \brief Class specific methods used to operate the cipher in the forward direction. + //! \details Implementations and overrides in \p Encryption apply to \p ENCRYPTION. + class Encryption : public BlockCipherFinal + { + public: + Encryption() {} + Encryption(const byte *key, size_t keyLen=DEFAULT_KEYLENGTH) + {SetKey(key, keyLen);} + Encryption(const byte *key, size_t keyLen, int effectiveKeyLen) + {SetKey(key, keyLen, MakeParameters("EffectiveKeyLength", effectiveKeyLen));} + }; + + //! \class Decryption + //! \brief Class specific methods used to operate the cipher in the reverse direction. + //! \details Implementations and overrides in \p Decryption apply to \p DECRYPTION. + class Decryption : public BlockCipherFinal + { + public: + Decryption() {} + Decryption(const byte *key, size_t keyLen=DEFAULT_KEYLENGTH) + {SetKey(key, keyLen);} + Decryption(const byte *key, size_t keyLen, int effectiveKeyLen) + {SetKey(key, keyLen, MakeParameters("EffectiveKeyLength", effectiveKeyLen));} + }; +}; + +typedef RC2::Encryption RC2Encryption; +typedef RC2::Decryption RC2Decryption; + +NAMESPACE_END + +#endif + diff --git a/external/crypto++-5.6.3/rc5.cpp b/external/crypto++-5.6.3/rc5.cpp new file mode 100644 index 000000000..66deeec18 --- /dev/null +++ b/external/crypto++-5.6.3/rc5.cpp @@ -0,0 +1,80 @@ +// rc5.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "rc5.h" +#include "misc.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +void RC5::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(keylen); + + r = GetRoundsAndThrowIfInvalid(params, this); + sTable.New(2*(r+1)); + + static const RC5_WORD MAGIC_P = 0xb7e15163L; // magic constant P for wordsize + static const RC5_WORD MAGIC_Q = 0x9e3779b9L; // magic constant Q for wordsize + static const int U=sizeof(RC5_WORD); + + const unsigned int c = STDMAX((keylen+U-1)/U, 1U); // RC6 paper says c=1 if keylen==0 + SecBlock l(c); + + GetUserKey(LITTLE_ENDIAN_ORDER, l.begin(), c, k, keylen); + + sTable[0] = MAGIC_P; + for (unsigned j=1; j Block; + +void RC5::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + const RC5_WORD *sptr = sTable; + RC5_WORD a, b; + + Block::Get(inBlock)(a)(b); + a += sptr[0]; + b += sptr[1]; + sptr += 2; + + for(unsigned i=0; i, public VariableKeyLength<16, 0, 255>, public VariableRounds<16> +{ + static const char *StaticAlgorithmName() {return "RC5";} + typedef word32 RC5_WORD; +}; + +/// RC5 +class RC5 : public RC5_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + unsigned int r; // number of rounds + SecBlock sTable; // expanded key table + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef RC5::Encryption RC5Encryption; +typedef RC5::Decryption RC5Decryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rc6.cpp b/external/crypto++-5.6.3/rc6.cpp new file mode 100644 index 000000000..c6ddd09cc --- /dev/null +++ b/external/crypto++-5.6.3/rc6.cpp @@ -0,0 +1,97 @@ +// rc6.cpp - written and placed in the public domain by Sean Woods +// based on Wei Dai's RC5 code. + +#include "pch.h" +#include "rc6.h" +#include "misc.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +void RC6::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(keylen); + + r = GetRoundsAndThrowIfInvalid(params, this); + sTable.New(2*(r+2)); + + static const RC6_WORD MAGIC_P = 0xb7e15163L; // magic constant P for wordsize + static const RC6_WORD MAGIC_Q = 0x9e3779b9L; // magic constant Q for wordsize + static const int U=sizeof(RC6_WORD); + + const unsigned int c = STDMAX((keylen+U-1)/U, 1U); // RC6 paper says c=1 if keylen==0 + SecBlock l(c); + + GetUserKey(LITTLE_ENDIAN_ORDER, l.begin(), c, k, keylen); + + sTable[0] = MAGIC_P; + for (unsigned j=1; j Block; + +void RC6::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + const RC6_WORD *sptr = sTable; + RC6_WORD a, b, c, d, t, u; + + Block::Get(inBlock)(a)(b)(c)(d); + b += sptr[0]; + d += sptr[1]; + sptr += 2; + + for(unsigned i=0; i, public VariableKeyLength<16, 0, 255>, public VariableRounds<20> +{ + static const char *StaticAlgorithmName() {return "RC6";} + typedef word32 RC6_WORD; +}; + +/// RC6 +class RC6 : public RC6_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + unsigned int r; // number of rounds + SecBlock sTable; // expanded key table + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef RC6::Encryption RC6Encryption; +typedef RC6::Decryption RC6Decryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rdrand-masm.cmd b/external/crypto++-5.6.3/rdrand-masm.cmd new file mode 100644 index 000000000..7a5e5ae98 --- /dev/null +++ b/external/crypto++-5.6.3/rdrand-masm.cmd @@ -0,0 +1,117 @@ +REM make-rdrand +@echo OFF + +@cls + +@del rdrand.obj rdrand-x86.obj rdrand-x64.obj rdrand-x86.lib rdrand-x64.lib /Q > nul + +REM Visual Studio 2005 +REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin +REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\amd64 + +REM Visual Studio 2010 +REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 10\VC\bin +REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 10\VC\bin\amd64 + +REM Visual Studio 2012 +REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin +REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64 + +REM Visual Studio 2013 +@set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x86 +@set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64 + +@set MASM="%TOOLS32%\ml.exe" +@set MASM64="%TOOLS64%\ml64.exe" +@set DUMPBIN="%TOOLS32%\dumpbin.exe" +@set LIBTOOL="%TOOLS32%\lib.exe" + +REM /W3 - Warning level +REM /Cx - Preserve case in external symbols +REM /Zi - Porgram Database information +@set ASFLAGS=/nologo /D_M_X86 /W3 /Cx /Zi /safeseh +@set ASFLAGS64=/nologo /D_M_X64 /W3 /Cx /Zi +@set LIBFLAGS=/nologo /SUBSYSTEM:CONSOLE + +REM Use _M_X86 and _M_X64 becuase cl.exe uses them. It keeps preprocessor defines consistent. +echo **************************************** +echo Assembling rdrand.asm into rdrand-x86.obj +call %MASM% %ASFLAGS% /Fo rdrand-x86.obj /c rdrand.asm > nul +@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to assemble rdrand.asm with X86 && goto SCRIPT_FAILED) +echo Done... + +echo **************************************** +echo Assembling rdrand.asm into rdrand-x64.obj +call %MASM64% %ASFLAGS64% /Fo rdrand-x64.obj /c rdrand.asm > nul +@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to assemble rdrand.asm with X64 && goto SCRIPT_FAILED) +echo Done... + +echo **************************************** +echo Creating static library rdrand-x86.lib +call %LIBTOOL% %LIBFLAGS% /MACHINE:X86 /OUT:rdrand-x86.lib rdrand-x86.obj > nul +@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to create rdrand-x86.lib && goto SCRIPT_FAILED) +echo Done... + +echo **************************************** +echo Creating static library rdrand-x64.lib +call %LIBTOOL% %LIBFLAGS% /MACHINE:X64 /OUT:rdrand-x64.lib rdrand-x64.obj > nul +@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to create rdrand-x64.lib && goto SCRIPT_FAILED) +echo Done... + +goto SKIP_SYMBOL_DUMP_OBJ + +echo **************************************** +echo Dumping symbols for rdrand-x86.obj +echo. +call %DUMPBIN% /SYMBOLS rdrand-x86.obj + +echo **************************************** +echo Dumping symbols for rdrand-x64.obj +echo. +call %DUMPBIN% /SYMBOLS rdrand-x64.obj + +:SKIP_SYMBOL_DUMP_OBJ + +goto SKIP_SYMBOL_DUMP_LIB + +echo **************************************** +echo Dumping symbols for rdrand-x86.lib +echo. +call %DUMPBIN% /SYMBOLS rdrand-x86.lib + +echo **************************************** +echo Dumping symbols for rdrand-x64.lib +echo. +call %DUMPBIN% /SYMBOLS rdrand-x64.lib + +:SKIP_SYMBOL_DUMP_LIB + +goto SKIP_EXPORT_DUMP + +echo **************************************** +echo Dumping exports for rdrand-x86.lib +echo. +call %DUMPBIN% /EXPORTS rdrand-x86.lib + +echo **************************************** +echo Dumping exports for rdrand-x64.lib +echo. +call %DUMPBIN% /EXPORTS rdrand-x64.lib + +:SKIP_EXPORT_DUMP + +REM goto SKIP_DISASSEMBLY + +echo **************************************** +echo Disassembling rdrand-x64.obj +echo. +call %DUMPBIN% /DISASM:NOBYTES rdrand-x64.obj + +echo **************************************** +echo Disassembling rdrand-x86.obj +echo. +call %DUMPBIN% /DISASM:NOBYTES rdrand-x86.obj + +:SKIP_DISASSEMBLY + +:SCRIPT_FAILED diff --git a/external/crypto++-5.6.3/rdrand-nasm.sh b/external/crypto++-5.6.3/rdrand-nasm.sh new file mode 100644 index 000000000..bc135c16a --- /dev/null +++ b/external/crypto++-5.6.3/rdrand-nasm.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +reset + +nasm -f elf32 rdrand.S -DX86 -g -o rdrand-x86.o +nasm -f elfx32 rdrand.S -DX32 -g -o rdrand-x32.o +nasm -f elf64 rdrand.S -DX64 -g -o rdrand-x64.o + +echo "**************************************" +echo "**************************************" + +objdump --disassemble rdrand-x86.o + +echo +echo "**************************************" +echo "**************************************" + +objdump --disassemble rdrand-x32.o + +echo +echo "**************************************" +echo "**************************************" + +objdump --disassemble rdrand-x64.o diff --git a/external/crypto++-5.6.3/rdrand.S b/external/crypto++-5.6.3/rdrand.S new file mode 100644 index 000000000..9a1c4f1ea --- /dev/null +++ b/external/crypto++-5.6.3/rdrand.S @@ -0,0 +1,596 @@ +;; rdrand.asm - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. +;; Copyright assigned to the Crypto++ project. + +;; This ASM file provides RDRAND and RDSEED to downlevel Unix and Linux tool chains. +;; Additionally, the inline assembly code produced by GCC and Clang is not that +;; impressive. However, using this code requires NASM and an edit to the GNUmakefile. + +;; nasm -f elf32 rdrand.S -DX86 -g -o rdrand-x86.o +;; nasm -f elfx32 rdrand.S -DX32 -g -o rdrand-x32.o +;; nasm -f elf64 rdrand.S -DX64 -g -o rdrand-x64.o + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Naming convention used in rdrand.{h|cpp|asm|S} +;; MSC = Microsoft Compiler (and compatibles) +;; GCC = GNU Compiler (and compatibles) +;; ALL = MSC and GCC (and compatibles) +;; RRA = RDRAND, Assembly +;; RSA = RDSEED, Assembly +;; RRI = RDRAND, Intrinsic +;; RSA = RDSEED, Intrinsic + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; C/C++ Function prototypes +;; X86, X32 and X64: +;; extern "C" int NASM_RRA_GenerateBlock(byte* ptr, size_t size, unsigned int safety); + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Return values +%define RDRAND_SUCCESS 1 +%define RDRAND_FAILURE 0 + +%define RDSEED_SUCCESS 1 +%define RDSEED_FAILURE 0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%ifdef X86 or X32 ;; Set via the command line + +;; Arg1, byte* buffer +;; Arg2, size_t bsize +;; Arg3, unsigned int safety +;; EAX (out): success (1), failure (0) + +global NASM_RRA_GenerateBlock +section .text + +%ifdef X86 +align 8 +cpu 486 +%else +align 16 +%endif + +NASM_RRA_GenerateBlock: + +%ifdef X86 +%define arg1 [ebp+04h] +%define arg2 [ebp+08h] +%define arg3 [ebp+0ch] +%define MWSIZE 04h ;; machine word size +%else +%define MWSIZE 08h ;; machine word size +%endif + + %define buffer edi + %define bsize esi + %define safety edx + +%ifdef X86 +.Load_Arguments: + + mov buffer, arg1 + mov bsize, arg2 + mov safety, arg3 +%endif + +.Validate_Pointer: + + cmp buffer, 0 + je .GenerateBlock_PreRet + + ;; Top of While loop +.GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je .GenerateBlock_Success + +%ifdef X86 +.Call_RDRAND_EAX: +%else +.Call_RDRAND_RAX: + DB 48h ;; X32 can use the full register, issue the REX.w prefix +%endif + ;; RDRAND is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdrand eax`. + DB 0Fh, 07h, F0h + + ;; If CF=1, the number returned by RDRAND is valid. + ;; If CF=0, a random number was not available. + jc .RDRAND_succeeded + +.RDRAND_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je .GenerateBlock_Failure + + dec safety + jmp .GenerateBlock_Top + +.RDRAND_succeeded: + + cmp bsize, MWSIZE + jb .Partial_Machine_Word + +.Full_Machine_Word: + +%ifdef X32 + mov [buffer+4], eax ;; We can only move 4 at a time + DB 048h ;; Combined, these result in + shr eax, 32 ;; `shr rax, 32` +%endif + + mov [buffer], eax + add buffer, MWSIZE ;; No need for Intel Core 2 slow word workarounds, + sub bsize, MWSIZE ;; like `lea buffer,[buffer+MWSIZE]` for faster adds + + ;; Continue + jmp .GenerateBlock_Top + + ;; 1,2,3 bytes remain for X86 + ;; 1,2,3,4,5,6,7 remain for X32 +.Partial_Machine_Word: + +%ifdef X32 + ;; Test bit 2 to see if size is at least 4 + test bsize, 4 + jz .Bit_2_Not_Set + + mov [buffer], eax + add buffer, 4 + + DB 048h ;; Combined, these result in + shr eax, 32 ;; `shr rax, 32` + +.Bit_2_Not_Set: +%endif + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz .Bit_1_Not_Set + + mov [buffer], ax + shr eax, 16 + add buffer, 2 + +.Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz .GenerateBlock_Success + + mov [buffer], al + +.Bit_0_Not_Set: + + ;; We've hit all the bits + jmp .GenerateBlock_Success + +.GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je .GenerateBlock_Success + +.GenerateBlock_Failure: + + xor eax, eax + mov al, RDRAND_FAILURE + ret + +.GenerateBlock_Success: + + xor eax, eax + mov al, RDRAND_SUCCESS + ret + +%endif ;; X86 and X32 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%ifdef X64 ;; Set via the command line + +global NASM_RRA_GenerateBlock +section .text +align 16 + +;; Arg1, byte* buffer +;; Arg2, size_t bsize +;; Arg3, unsigned int safety +;; RAX (out): success (1), failure (0) + +NASM_RRA_GenerateBlock: + +%define MWSIZE 08h ;; machine word size +%define buffer rdi +%define bsize rsi +%define safety edx + + ;; No need for Load_Arguments due to fastcall + +.Validate_Pointer: + + ;; Validate pointer + cmp buffer, 0 + je .GenerateBlock_PreRet + + ;; Top of While loop +.GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je .GenerateBlock_Success + +.Call_RDRAND_RAX: + ;; RDRAND is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdrand rax`. + DB 048h, 0Fh, 0C7h, 0F0h + + ;; If CF=1, the number returned by RDRAND is valid. + ;; If CF=0, a random number was not available. + jc .RDRAND_succeeded + +.RDRAND_failed: + + ;; Exit if we've reached the limit + cmp safety, 0h + je .GenerateBlock_Failure + + dec safety + jmp .GenerateBlock_Top + +.RDRAND_succeeded: + + cmp bsize, MWSIZE + jb .Partial_Machine_Word + +.Full_Machine_Word: + + mov [buffer], rax + add buffer, MWSIZE + sub bsize, MWSIZE + + ;; Continue + jmp .GenerateBlock_Top + + ;; 1,2,3,4,5,6,7 bytes remain +.Partial_Machine_Word: + + ;; Test bit 2 to see if size is at least 4 + test bsize, 4 + jz .Bit_2_Not_Set + + mov [buffer], eax + shr rax, 32 + add buffer, 4 + +.Bit_2_Not_Set: + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz .Bit_1_Not_Set + + mov [buffer], ax + shr eax, 16 + add buffer, 2 + +.Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz .GenerateBlock_Success + + mov [buffer], al + +.Bit_0_Not_Set: + + ;; We've hit all the bits + jmp .GenerateBlock_Success + +.GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je .GenerateBlock_Success + +.GenerateBlock_Failure: + + xor rax, rax + mov al, RDRAND_FAILURE + ret + +.GenerateBlock_Success: + + xor rax, rax + mov al, RDRAND_SUCCESS + ret + +%endif ;; X64 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%ifdef X86 or X32 ;; Set via the command line + +;; Arg1, byte* buffer +;; Arg2, size_t bsize +;; Arg3, unsigned int safety +;; EAX (out): success (1), failure (0) + +global NASM_RSA_GenerateBlock +section .text +align 8 + +%ifdef X86 +align 8 +cpu 486 +%else +align 16 +%endif + +NASM_RSA_GenerateBlock: + +%ifdef X86 +%define arg1 [ebp+04h] +%define arg2 [ebp+08h] +%define arg3 [ebp+0ch] +%define MWSIZE 04h ;; machine word size +%else +%define MWSIZE 08h ;; machine word size +%endif + + %define buffer edi + %define bsize esi + %define safety edx + +%ifdef X86 +.Load_Arguments: + + mov buffer, arg1 + mov bsize, arg2 + mov safety, arg3 +%endif + +.Validate_Pointer: + + cmp buffer, 0 + je .GenerateBlock_PreRet + + ;; Top of While loop +.GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je .GenerateBlock_Success + +%ifdef X86 +.Call_RDSEED_EAX: +%else +.Call_RDSEED_RAX: + DB 48h ;; X32 can use the full register, issue the REX.w prefix +%endif + ;; RDSEED is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdseed eax`. + DB 0Fh, 0C7h, 0F8h + + ;; If CF=1, the number returned by RDSEED is valid. + ;; If CF=0, a random number was not available. + jc .RDSEED_succeeded + +.RDSEED_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je .GenerateBlock_Failure + + dec safety + jmp .GenerateBlock_Top + +.RDSEED_succeeded: + + cmp bsize, MWSIZE + jb .Partial_Machine_Word + +.Full_Machine_Word: + + mov [buffer], eax + add buffer, MWSIZE ;; No need for Intel Core 2 slow word workarounds, + sub bsize, MWSIZE ;; like `lea buffer,[buffer+MWSIZE]` for faster adds + + ;; Continue + jmp .GenerateBlock_Top + + ;; 1,2,3 bytes remain for X86 + ;; 1,2,3,4,5,6,7 remain for X32 +.Partial_Machine_Word: + +%ifdef X32 + ;; Test bit 2 to see if size is at least 4 + test bsize, 4 + jz .Bit_2_Not_Set + + mov [buffer], eax + add buffer, 4 + + DB 048h ;; Combined, these result in + shr eax, 32 ;; `shr rax, 32` + +.Bit_2_Not_Set: +%endif + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz .Bit_1_Not_Set + + mov [buffer], ax + shr eax, 16 + add buffer, 2 + +.Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz .GenerateBlock_Success + + mov [buffer], al + +.Bit_0_Not_Set: + + ;; We've hit all the bits + jmp .GenerateBlock_Success + +.GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je .GenerateBlock_Success + +.GenerateBlock_Failure: + + xor eax, eax + mov al, RDSEED_FAILURE + ret + +.GenerateBlock_Success: + + xor eax, eax + mov al, RDSEED_SUCCESS + ret + +%endif ;; X86 and X32 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%ifdef X64 ;; Set via the command line + +global NASM_RSA_GenerateBlock +section .text +align 16 + +;; Arg1, byte* buffer +;; Arg2, size_t bsize +;; Arg3, unsigned int safety +;; RAX (out): success (1), failure (0) + +NASM_RSA_GenerateBlock: + +%define MWSIZE 08h ;; machine word size +%define buffer rdi +%define bsize rsi +%define safety edx + + ;; No need for Load_Arguments due to fastcall + +.Validate_Pointer: + + ;; Validate pointer + cmp buffer, 0 + je .GenerateBlock_PreRet + + ;; Top of While loop +.GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je .GenerateBlock_Success + +.Call_RDSEED_RAX: + ;; RDSEED is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdseed rax`. + DB 048h, 0Fh, 0C7h, 0F8h + + ;; If CF=1, the number returned by RDSEED is valid. + ;; If CF=0, a random number was not available. + jc .RDSEED_succeeded + +.RDSEED_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je .GenerateBlock_Failure + + dec safety + jmp .GenerateBlock_Top + +.RDSEED_succeeded: + + cmp bsize, MWSIZE + jb .Partial_Machine_Word + +.Full_Machine_Word: + + mov [buffer], rax + add buffer, MWSIZE + sub bsize, MWSIZE + + ;; Continue + jmp .GenerateBlock_Top + + ;; 1,2,3,4,5,6,7 bytes remain +.Partial_Machine_Word: + + ;; Test bit 2 to see if size is at least 4 + test bsize, 4 + jz .Bit_2_Not_Set + + mov [buffer], eax + shr rax, 32 + add buffer, 4 + +.Bit_2_Not_Set: + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz .Bit_1_Not_Set + + mov [buffer], ax + shr eax, 16 + add buffer, 2 + +.Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz .GenerateBlock_Success + + mov [buffer], al + +.Bit_0_Not_Set: + + ;; We've hit all the bits + jmp .GenerateBlock_Success + +.GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je .GenerateBlock_Success + +.GenerateBlock_Failure: + + xor rax, rax + mov al, RDSEED_FAILURE + ret + +.GenerateBlock_Success: + + xor rax, rax + mov al, RDSEED_SUCCESS + ret + +%endif ;; _M_X64 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + diff --git a/external/crypto++-5.6.3/rdrand.asm b/external/crypto++-5.6.3/rdrand.asm new file mode 100644 index 000000000..725b65ebb --- /dev/null +++ b/external/crypto++-5.6.3/rdrand.asm @@ -0,0 +1,557 @@ +;; rdrand.asm - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. +;; Copyright assigned to the Crypto++ project. + +;; This ASM file provides RDRAND and RDSEED to downlevel Microsoft tool chains. +;; Everything "just works" under Visual Studio. Other platforms will have to +;; run MASM/MASM-64 and then link to the object files. + +;; set ASFLAGS=/nologo /D_M_X86 /W3 /Cx /Zi /safeseh +;; set ASFLAGS64=/nologo /D_M_X64 /W3 /Cx /Zi +;; "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\ml.exe" %ASFLAGS% /Fo rdrand-x86.obj /c rdrand.asm +;; "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\ml64.exe" %ASFLAGS64% /Fo rdrand-x64.obj /c rdrand.asm + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +TITLE MASM_RRA_GenerateBlock and MASM_RSA_GenerateBlock +SUBTITLE Microsoft specific ASM code to utilize RDRAND and RDSEED for down level Microsoft toolchains + +PUBLIC MASM_RRA_GenerateBlock +PUBLIC MASM_RSA_GenerateBlock + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Naming convention used in rdrand.{h|cpp|asm} +;; MSC = Microsoft Compiler (and compatibles) +;; GCC = GNU Compiler (and compatibles) +;; ALL = MSC and GCC (and compatibles) +;; RRA = RDRAND, Assembly +;; RSA = RDSEED, Assembly +;; RRI = RDRAND, Intrinsic +;; RSA = RDSEED, Intrinsic + +;; Caller/Callee Saved Registers +;; https://msdn.microsoft.com/en-us/library/6t169e9c.aspx + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; C/C++ Function prototypes +;; X86: +;; extern "C" int MASM_RRA_GenerateBlock(byte* ptr, size_t size, unsigned int safety); +;; X64: +;; extern "C" int __fastcall MASM_RRA_GenerateBlock(byte* ptr, size_t size, unsigned int safety); + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Return values +RDRAND_SUCCESS EQU 1 +RDRAND_FAILURE EQU 0 + +RDSEED_SUCCESS EQU 1 +RDSEED_FAILURE EQU 0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IFDEF _M_X86 ;; Set via the command line + +.486 +.MODEL FLAT + +ENDIF + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IFDEF _M_X86 ;; Set via the command line + +.CODE +ALIGN 8 +OPTION LANGUAGE:C +OPTION PROLOGUE:NONE +OPTION EPILOGUE:NONE + +;; Base relative (in): arg1, byte* buffer +;; Base relative (in): arg2, size_t bsize +;; Base relative (in): arg3, unsigned int safety +;; EAX (out): success (1), failure (0) + +MASM_RRA_GenerateBlock PROC arg1:DWORD,arg2:DWORD,arg3:DWORD + + MWSIZE EQU 04h ;; machine word size + buffer EQU edi + bsize EQU edx + safety EQU ecx + +Load_Arguments: + + mov buffer, arg1 + mov bsize, arg2 + mov safety, arg3 + +Validate_Pointer: + + cmp buffer, 0 + je GenerateBlock_PreRet + + ;; Top of While loop +GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je GenerateBlock_Success + +Call_RDRAND_EAX: + ;; RDRAND is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdrand eax`. + DB 0Fh, 0C7h, 0F0h + + ;; If CF=1, the number returned by RDRAND is valid. + ;; If CF=0, a random number was not available. + jc RDRAND_succeeded + +RDRAND_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je GenerateBlock_Failure + + dec safety + jmp GenerateBlock_Top + +RDRAND_succeeded: + + cmp bsize, MWSIZE + jb Partial_Machine_Word + +Full_Machine_Word: + + mov DWORD PTR [buffer], eax + add buffer, MWSIZE ;; No need for Intel Core 2 slow workarounds, like + sub bsize, MWSIZE ;; `lea buffer,[buffer+MWSIZE]` for faster adds + + ;; Continue + jmp GenerateBlock_Top + + ;; 1,2,3 bytes remain +Partial_Machine_Word: + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz Bit_1_Not_Set + + mov WORD PTR [buffer], ax + shr eax, 16 + add buffer, 2 + +Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz GenerateBlock_Success + + mov BYTE PTR [buffer], al + +Bit_0_Not_Set: + + ;; We've hit all the bits + jmp GenerateBlock_Success + +GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je GenerateBlock_Success + +GenerateBlock_Failure: + + xor eax, eax + mov al, RDRAND_FAILURE + ret + +GenerateBlock_Success: + + xor eax, eax + mov al, RDRAND_SUCCESS + ret + +MASM_RRA_GenerateBlock ENDP + +ENDIF ;; _M_X86 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IFDEF _M_X64 ;; Set via the command line + +.CODE +ALIGN 16 +OPTION PROLOGUE:NONE +OPTION EPILOGUE:NONE + +;; RCX (in): arg1, byte* buffer +;; RDX (in): arg2, size_t bsize +;; R8d (in): arg3, unsigned int safety +;; RAX (out): success (1), failure (0) + +MASM_RRA_GenerateBlock PROC + + MWSIZE EQU 08h ;; machine word size + buffer EQU rcx + bsize EQU rdx + safety EQU r8d + + ;; No need for Load_Arguments due to fastcall + +Validate_Pointer: + + ;; Validate pointer + cmp buffer, 0 + je GenerateBlock_PreRet + + ;; Top of While loop +GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je GenerateBlock_Success + +Call_RDRAND_RAX: + ;; RDRAND is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdrand rax`. + DB 048h, 0Fh, 0C7h, 0F0h + + ;; If CF=1, the number returned by RDRAND is valid. + ;; If CF=0, a random number was not available. + jc RDRAND_succeeded + +RDRAND_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je GenerateBlock_Failure + + dec safety + jmp GenerateBlock_Top + +RDRAND_succeeded: + + cmp bsize, MWSIZE + jb Partial_Machine_Word + +Full_Machine_Word: + + mov QWORD PTR [buffer], rax + add buffer, MWSIZE + sub bsize, MWSIZE + + ;; Continue + jmp GenerateBlock_Top + + ;; 1,2,3,4,5,6,7 bytes remain +Partial_Machine_Word: + + ;; Test bit 2 to see if size is at least 4 + test bsize, 4 + jz Bit_2_Not_Set + + mov DWORD PTR [buffer], eax + shr rax, 32 + add buffer, 4 + +Bit_2_Not_Set: + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz Bit_1_Not_Set + + mov WORD PTR [buffer], ax + shr eax, 16 + add buffer, 2 + +Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz GenerateBlock_Success + + mov BYTE PTR [buffer], al + +Bit_0_Not_Set: + + ;; We've hit all the bits + jmp GenerateBlock_Success + +GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je GenerateBlock_Success + +GenerateBlock_Failure: + + xor rax, rax + mov al, RDRAND_FAILURE + ret + +GenerateBlock_Success: + + xor rax, rax + mov al, RDRAND_SUCCESS + ret + +MASM_RRA_GenerateBlock ENDP + +ENDIF ;; _M_X64 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IFDEF _M_X86 ;; Set via the command line + +.CODE +ALIGN 8 +OPTION LANGUAGE:C +OPTION PROLOGUE:NONE +OPTION EPILOGUE:NONE + +;; Base relative (in): arg1, byte* buffer +;; Base relative (in): arg2, size_t bsize +;; Base relative (in): arg3, unsigned int safety +;; EAX (out): success (1), failure (0) + +MASM_RSA_GenerateBlock PROC arg1:DWORD,arg2:DWORD,arg3:DWORD + + MWSIZE EQU 04h ;; machine word size + buffer EQU edi + bsize EQU edx + safety EQU ecx + +Load_Arguments: + + mov buffer, arg1 + mov bsize, arg2 + mov safety, arg3 + +Validate_Pointer: + + cmp buffer, 0 + je GenerateBlock_PreRet + + ;; Top of While loop +GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je GenerateBlock_Success + +Call_RDSEED_EAX: + ;; RDSEED is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdseed eax`. + DB 0Fh, 0C7h, 0F8h + + ;; If CF=1, the number returned by RDSEED is valid. + ;; If CF=0, a random number was not available. + jc RDSEED_succeeded + +RDSEED_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je GenerateBlock_Failure + + dec safety + jmp GenerateBlock_Top + +RDSEED_succeeded: + + cmp bsize, MWSIZE + jb Partial_Machine_Word + +Full_Machine_Word: + + mov DWORD PTR [buffer], eax + add buffer, MWSIZE ;; No need for Intel Core 2 slow workarounds, like + sub bsize, MWSIZE ;; `lea buffer,[buffer+MWSIZE]` for faster adds + + ;; Continue + jmp GenerateBlock_Top + + ;; 1,2,3 bytes remain +Partial_Machine_Word: + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz Bit_1_Not_Set + + mov WORD PTR [buffer], ax + shr eax, 16 + add buffer, 2 + +Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz GenerateBlock_Success + + mov BYTE PTR [buffer], al + +Bit_0_Not_Set: + + ;; We've hit all the bits + jmp GenerateBlock_Success + +GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je GenerateBlock_Success + +GenerateBlock_Failure: + + xor eax, eax + mov al, RDSEED_FAILURE + ret + +GenerateBlock_Success: + + xor eax, eax + mov al, RDSEED_SUCCESS + ret + +MASM_RSA_GenerateBlock ENDP + +ENDIF ;; _M_X86 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IFDEF _M_X64 ;; Set via the command line + +.CODE +ALIGN 16 +OPTION PROLOGUE:NONE +OPTION EPILOGUE:NONE + +;; RCX (in): arg1, byte* buffer +;; RDX (in): arg2, size_t bsize +;; R8d (in): arg3, unsigned int safety +;; RAX (out): success (1), failure (0) + +MASM_RSA_GenerateBlock PROC ;; arg1:QWORD,arg2:QWORD,arg3:DWORD + + MWSIZE EQU 08h ;; machine word size + buffer EQU rcx + bsize EQU rdx + safety EQU r8d + + ;; No need for Load_Arguments due to fastcall + +Validate_Pointer: + + ;; Validate pointer + cmp buffer, 0 + je GenerateBlock_PreRet + + ;; Top of While loop +GenerateBlock_Top: + + ;; Check remaining size + cmp bsize, 0 + je GenerateBlock_Success + +Call_RDSEED_RAX: + ;; RDSEED is not available prior to VS2012. Just emit + ;; the byte codes using DB. This is `rdseed rax`. + DB 048h, 0Fh, 0C7h, 0F8h + + ;; If CF=1, the number returned by RDSEED is valid. + ;; If CF=0, a random number was not available. + jc RDSEED_succeeded + +RDSEED_failed: + + ;; Exit if we've reached the limit + cmp safety, 0 + je GenerateBlock_Failure + + dec safety + jmp GenerateBlock_Top + +RDSEED_succeeded: + + cmp bsize, MWSIZE + jb Partial_Machine_Word + +Full_Machine_Word: + + mov QWORD PTR [buffer], rax + add buffer, MWSIZE + sub bsize, MWSIZE + + ;; Continue + jmp GenerateBlock_Top + + ;; 1,2,3,4,5,6,7 bytes remain +Partial_Machine_Word: + + ;; Test bit 2 to see if size is at least 4 + test bsize, 4 + jz Bit_2_Not_Set + + mov DWORD PTR [buffer], eax + shr rax, 32 + add buffer, 4 + +Bit_2_Not_Set: + + ;; Test bit 1 to see if size is at least 2 + test bsize, 2 + jz Bit_1_Not_Set + + mov WORD PTR [buffer], ax + shr eax, 16 + add buffer, 2 + +Bit_1_Not_Set: + + ;; Test bit 0 to see if size is at least 1 + test bsize, 1 + jz GenerateBlock_Success + + mov BYTE PTR [buffer], al + +Bit_0_Not_Set: + + ;; We've hit all the bits + jmp GenerateBlock_Success + +GenerateBlock_PreRet: + + ;; Test for success (was the request completely fulfilled?) + cmp bsize, 0 + je GenerateBlock_Success + +GenerateBlock_Failure: + + xor rax, rax + mov al, RDSEED_FAILURE + ret + +GenerateBlock_Success: + + xor rax, rax + mov al, RDSEED_SUCCESS + ret + +MASM_RSA_GenerateBlock ENDP + +ENDIF ;; _M_X64 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +END diff --git a/external/crypto++-5.6.3/rdrand.cpp b/external/crypto++-5.6.3/rdrand.cpp new file mode 100644 index 000000000..fb4f47724 --- /dev/null +++ b/external/crypto++-5.6.3/rdrand.cpp @@ -0,0 +1,515 @@ +// rdrand.cpp - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. +// Copyright assigned to Crypto++ project. + +#include "pch.h" +#include "config.h" +#include "cryptlib.h" +#include "secblock.h" +#include "rdrand.h" +#include "cpu.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100) +#endif + +// This file (and friends) provides both RDRAND and RDSEED, but its somewhat +// experimental. They were added at Crypto++ 5.6.3. At compile time, it +// indirectly uses CRYPTOPP_BOOL_{X86|X32|X64} (via CRYPTOPP_CPUID_AVAILABLE) +// to select an implementation or "throw NotImplemented". At runtime, the +// class uses the result of CPUID to determine if RDRAND or RDSEED are +// available. A lazy throw strategy is used in case the CPU does not support +// the instruction. I.e., the throw is deferred until GenerateBlock is called. + +// Here's the naming convention for the functions.... +// MSC = Microsoft Compiler (and compatibles) +// GCC = GNU Compiler (and compatibles) +// ALL = MSC and GCC (and compatibles) +// RRA = RDRAND, Assembly +// RSA = RDSEED, Assembly +// RRI = RDRAND, Intrinsic +// RSA = RDSEED, Intrinsic + +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// + +// For Linux, install NASM, run rdrand-nasm.asm, add the apppropriate +// object file to the Makefile's LIBOBJS (rdrand-x{86|32|64}.o). After +// that, define these. They are not enabled by default because they +// are not easy to cut-in in the Makefile. + +#if 0 +#define NASM_RDRAND_ASM_AVAILABLE 1 +#define NASM_RDSEED_ASM_AVAILABLE 1 +#endif + +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// + +// According to Wei, CRYPTOPP_DISABLE_ASM is a failsafe due to the assembler. +// We sidestep it because it does not limit us. The assembler does not limit +// us because we emit out own byte codes as needed. To diasble RDRAND or +// RDSEED, set CRYPTOPP_BOOL_RDRAND_ASM or CRYPTOPP_BOOL_RDSEED_ASM to 0. +#ifndef CRYPTOPP_CPUID_AVAILABLE +# if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) +# define CRYPTOPP_CPUID_AVAILABLE +# endif +#endif + +#if defined(CRYPTOPP_CPUID_AVAILABLE) && !defined(CRYPTOPP_BOOL_RDRAND_ASM) +# define CRYPTOPP_BOOL_RDRAND_ASM 1 +#else +# define CRYPTOPP_BOOL_RDRAND_ASM 0 +#endif +#if defined(CRYPTOPP_CPUID_AVAILABLE) && !defined(CRYPTOPP_BOOL_RDSEED_ASM) +# define CRYPTOPP_BOOL_RDSEED_ASM 1 +#else +# define CRYPTOPP_BOOL_RDSEED_ASM 0 +#endif + +#if defined(CRYPTOPP_CPUID_AVAILABLE) +# define MSC_INTRIN_COMPILER ((CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) +# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) +#else +# define MSC_INTRIN_COMPILER 0 +# define GCC_INTRIN_COMPILER 0 +#endif + +// In general, the library's ASM code is best on Windows, and Intrinsics is +// the best code under GCC and compatibles. We favor them accordingly. +// The NASM code is optimized well on Linux, but its not easy to cut-in. +#if defined(CRYPTOPP_CPUID_AVAILABLE) && (CRYPTOPP_MSC_VERSION >= 1200) +# if CRYPTOPP_BOOL_RDRAND_ASM +# define MASM_RDRAND_ASM_AVAILABLE 1 +# elif MSC_INTRIN_COMPILER +# define ALL_RDRAND_INTRIN_AVAILABLE 1 +# endif +# if CRYPTOPP_BOOL_RDSEED_ASM +# define MASM_RDSEED_ASM_AVAILABLE 1 +# elif MSC_INTRIN_COMPILER +# define ALL_RDSEED_INTRIN_AVAILABLE 1 +# endif +#elif defined(CRYPTOPP_CPUID_AVAILABLE) && (CRYPTOPP_GCC_VERSION >= 30200) +# if GCC_INTRIN_COMPILER && defined(__RDRND__) +# define ALL_RDRAND_INTRIN_AVAILABLE 1 +# elif CRYPTOPP_BOOL_RDRAND_ASM +# define GCC_RDRAND_ASM_AVAILABLE 1 +# endif +# if GCC_INTRIN_COMPILER && defined(__RDSEED__) +# define ALL_RDSEED_INTRIN_AVAILABLE 1 +# elif CRYPTOPP_BOOL_RDSEED_ASM +# define GCC_RDSEED_ASM_AVAILABLE 1 +# endif +#endif + +// Debug diagnostics +#if 0 +# if MASM_RDRAND_ASM_AVAILABLE +# pragma message ("MASM_RDRAND_ASM_AVAILABLE is 1") +# elif NASM_RDRAND_ASM_AVAILABLE +# pragma message ("NASM_RDRAND_ASM_AVAILABLE is 1") +# elif GCC_RDRAND_ASM_AVAILABLE +# pragma message ("GCC_RDRAND_ASM_AVAILABLE is 1") +# elif ALL_RDRAND_INTRIN_AVAILABLE +# pragma message ("ALL_RDRAND_INTRIN_AVAILABLE is 1") +# else +# pragma message ("RDRAND is not available") +# endif +# if MASM_RDSEED_ASM_AVAILABLE +# pragma message ("MASM_RDSEED_ASM_AVAILABLE is 1") +# elif NASM_RDSEED_ASM_AVAILABLE +# pragma message ("NASM_RDSEED_ASM_AVAILABLE is 1") +# elif GCC_RDSEED_ASM_AVAILABLE +# pragma message ("GCC_RDSEED_ASM_AVAILABLE is 1") +# elif ALL_RDSEED_INTRIN_AVAILABLE +# pragma message ("ALL_RDSEED_INTRIN_AVAILABLE is 1") +# else +# pragma message ("RDSEED is not available") +# endif +#endif + +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// + +#if (ALL_RDRAND_INTRIN_AVAILABLE || ALL_RDSEED_INTRIN_AVAILABLE) +# include // rdrand, MSC, ICC, and GCC +# if defined(__has_include) +# if __has_include() +# include // rdseed for some compilers, like GCC +# endif +# endif +#endif + +#if MASM_RDRAND_ASM_AVAILABLE +# ifdef _M_X64 +extern "C" int CRYPTOPP_FASTCALL MASM_RRA_GenerateBlock(byte*, size_t, unsigned int); +// # pragma comment(lib, "rdrand-x64.lib") +# else +extern "C" int MASM_RRA_GenerateBlock(byte*, size_t, unsigned int); +// # pragma comment(lib, "rdrand-x86.lib") +# endif +#endif + +#if MASM_RDSEED_ASM_AVAILABLE +# ifdef _M_X64 +extern "C" int CRYPTOPP_FASTCALL MASM_RSA_GenerateBlock(byte*, size_t, unsigned int); +// # pragma comment(lib, "rdrand-x64.lib") +# else +extern "C" int MASM_RSA_GenerateBlock(byte*, size_t, unsigned int); +// # pragma comment(lib, "rdrand-x86.lib") +# endif +#endif + +#if NASM_RDRAND_ASM_AVAILABLE +extern "C" int NASM_RRA_GenerateBlock(byte*, size_t, unsigned int); +#endif + +#if NASM_RDSEED_ASM_AVAILABLE +extern "C" int NASM_RSA_GenerateBlock(byte*, size_t, unsigned int); +#endif + +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// + +NAMESPACE_BEGIN(CryptoPP) + +#if ALL_RDRAND_INTRIN_AVAILABLE +static int ALL_RRI_GenerateBlock(byte *output, size_t size, unsigned int safety) +{ + assert((output && size) || !(output || size)); +#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 + word64 val; +#else + word32 val; +#endif + + while (size >= sizeof(val)) + { +#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 + if (_rdrand64_step((word64*)output)) +#else + if (_rdrand32_step((word32*)output)) +#endif + { + output += sizeof(val); + size -= sizeof(val); + } + else + { + if (!safety--) + return 0; + } + } + + if (size) + { +#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 + if (_rdrand64_step(&val)) +#else + if (_rdrand32_step(&val)) +#endif + { + memcpy(output, &val, size); + size = 0; + } + else + { + if (!safety--) + return 0; + } + } + +#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 + *((volatile word64*)&val) = 0; +#else + *((volatile word32*)&val) = 0; +#endif + + return int(size == 0); +} +#endif // ALL_RDRAND_INTRINSIC_AVAILABLE + +#if GCC_RDRAND_ASM_AVAILABLE +static int GCC_RRA_GenerateBlock(byte *output, size_t size, unsigned int safety) +{ + assert((output && size) || !(output || size)); +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + word64 val; +#else + word32 val; +#endif + char rc; + while (size) + { + __asm__ volatile( +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + ".byte 0x48, 0x0f, 0xc7, 0xf0;\n" // rdrand rax +#else + ".byte 0x0f, 0xc7, 0xf0;\n" // rdrand eax +#endif + "setc %1; " + : "=a" (val), "=qm" (rc) + : + : "cc" + ); + + if (rc) + { + if (size >= sizeof(val)) + { +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32) + *((word64*)output) = val; +#elif defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X86) + *((word32*)output) = val; +#else + memcpy(output, &val, sizeof(val)); +#endif + output += sizeof(val); + size -= sizeof(val); + } + else + { + memcpy(output, &val, size); + size = 0; + } + } + else + { + if (!safety--) + break; + } + } + +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + *((volatile word64*)&val) = 0; +#else + *((volatile word32*)&val) = 0; +#endif + + return int(size == 0); +} + +#endif // GCC_RDRAND_ASM_AVAILABLE + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) +void RDRAND::GenerateBlock(byte *output, size_t size) +{ + CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); + assert((output && size) || !(output || size)); + + if(!HasRDRAND()) + throw NotImplemented("RDRAND: rdrand is not available on this platform"); + + int rc; CRYPTOPP_UNUSED(rc); +#if MASM_RDRAND_ASM_AVAILABLE + rc = MASM_RRA_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDRAND_Err("MASM_RRA_GenerateBlock"); } +#elif NASM_RDRAND_ASM_AVAILABLE + rc = NASM_RRA_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDRAND_Err("NASM_RRA_GenerateBlock"); } +#elif ALL_RDRAND_INTRIN_AVAILABLE + rc = ALL_RRI_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDRAND_Err("ALL_RRI_GenerateBlock"); } +#elif GCC_RDRAND_ASM_AVAILABLE + rc = GCC_RRA_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDRAND_Err("GCC_RRA_GenerateBlock"); } +#else + // RDRAND not detected at compile time, and no suitable compiler found + throw NotImplemented("RDRAND: failed to find a suitable implementation???"); +#endif // CRYPTOPP_CPUID_AVAILABLE +} + +void RDRAND::DiscardBytes(size_t n) +{ + // RoundUpToMultipleOf is used because a full word is read, and its cheaper + // to discard full words. There's no sense in dealing with tail bytes. + assert(HasRDRAND()); +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + FixedSizeSecBlock discard; + n = RoundUpToMultipleOf(n, sizeof(word64)); +#else + FixedSizeSecBlock discard; + n = RoundUpToMultipleOf(n, sizeof(word32)); +#endif + + size_t count = STDMIN(n, discard.SizeInBytes()); + while (count) + { + GenerateBlock(discard.BytePtr(), count); + n -= count; + count = STDMIN(n, discard.SizeInBytes()); + } +} +#endif // CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 + +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// + +#if ALL_RDSEED_INTRIN_AVAILABLE +static int ALL_RSI_GenerateBlock(byte *output, size_t size, unsigned int safety) +{ + assert((output && size) || !(output || size)); +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + word64 val; +#else + word32 val; +#endif + + while (size >= sizeof(val)) + { +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + if (_rdseed64_step((word64*)output)) +#else + if (_rdseed32_step((word32*)output)) +#endif + { + output += sizeof(val); + size -= sizeof(val); + } + else + { + if (!safety--) + return 0; + } + } + + if (size) + { +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + if (_rdseed64_step(&val)) +#else + if (_rdseed32_step(&val)) +#endif + { + memcpy(output, &val, size); + size = 0; + } + else + { + if (!safety--) + return 0; + } + } + +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + *((volatile word64*)&val) = 0; +#else + *((volatile word32*)&val) = 0; +#endif + + return int(size == 0); +} +#endif // ALL_RDSEED_INTRIN_AVAILABLE + +#if GCC_RDSEED_ASM_AVAILABLE +static int GCC_RSA_GenerateBlock(byte *output, size_t size, unsigned int safety) +{ + assert((output && size) || !(output || size)); +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + word64 val; +#else + word32 val; +#endif + char rc; + while (size) + { + __asm__ volatile( +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + ".byte 0x48, 0x0f, 0xc7, 0xf8;\n" // rdseed rax +#else + ".byte 0x0f, 0xc7, 0xf8;\n" // rdseed eax +#endif + "setc %1; " + : "=a" (val), "=qm" (rc) + : + : "cc" + ); + + if (rc) + { + if (size >= sizeof(val)) + { +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32) + *((word64*)output) = val; +#elif defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X86) + *((word32*)output) = val; +#else + memcpy(output, &val, sizeof(val)); +#endif + output += sizeof(val); + size -= sizeof(val); + } + else + { + memcpy(output, &val, size); + size = 0; + } + } + else + { + if (!safety--) + break; + } + } + +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + *((volatile word64*)&val) = 0; +#else + *((volatile word32*)&val) = 0; +#endif + + return int(size == 0); +} +#endif // GCC_RDSEED_ASM_AVAILABLE + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) +void RDSEED::GenerateBlock(byte *output, size_t size) +{ + CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); + assert((output && size) || !(output || size)); + + if(!HasRDSEED()) + throw NotImplemented("RDSEED: rdseed is not available on this platform"); + + int rc; CRYPTOPP_UNUSED(rc); +#if MASM_RDSEED_ASM_AVAILABLE + rc = MASM_RSA_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDSEED_Err("MASM_RSA_GenerateBlock"); } +#elif NASM_RDSEED_ASM_AVAILABLE + rc = NASM_RSA_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDRAND_Err("NASM_RSA_GenerateBlock"); } +#elif ALL_RDSEED_INTRIN_AVAILABLE + rc = ALL_RSI_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDSEED_Err("ALL_RSI_GenerateBlock"); } +#elif GCC_RDSEED_ASM_AVAILABLE + rc = GCC_RSA_GenerateBlock(output, size, m_retries); + if (!rc) { throw RDSEED_Err("GCC_RSA_GenerateBlock"); } +#else + // RDSEED not detected at compile time, and no suitable compiler found + throw NotImplemented("RDSEED: failed to find a suitable implementation???"); +#endif +} + +void RDSEED::DiscardBytes(size_t n) +{ + // RoundUpToMultipleOf is used because a full word is read, and its cheaper + // to discard full words. There's no sense in dealing with tail bytes. + assert(HasRDSEED()); +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 + FixedSizeSecBlock discard; + n = RoundUpToMultipleOf(n, sizeof(word64)); +#else + FixedSizeSecBlock discard; + n = RoundUpToMultipleOf(n, sizeof(word32)); +#endif + + size_t count = STDMIN(n, discard.SizeInBytes()); + while (count) + { + GenerateBlock(discard.BytePtr(), count); + n -= count; + count = STDMIN(n, discard.SizeInBytes()); + } +} +#endif // CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/rdrand.h b/external/crypto++-5.6.3/rdrand.h new file mode 100644 index 000000000..81c62152c --- /dev/null +++ b/external/crypto++-5.6.3/rdrand.h @@ -0,0 +1,186 @@ +// rdrand.h - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. +// Copyright assigned to Crypto++ project. + +//! \file +//! \headerfile rdrand.h +//! \brief Classes for RDRAND and RDSEED + +#ifndef CRYPTOPP_RDRAND_H +#define CRYPTOPP_RDRAND_H + +#include "cryptlib.h" + +// This file (and friends) provides both RDRAND and RDSEED, but its somewhat +// experimental. They were added at Crypto++ 5.6.3. At compile time, it +// indirectly uses CRYPTOPP_BOOL_{X86|X32|X64} (via CRYPTOPP_CPUID_AVAILABLE) +// to select an implementation or "throw NotImplemented". At runtime, the +// class uses the result of CPUID to determine if RDRAND or RDSEED are +// available. A lazy throw strategy is used in case the CPU does not support +// the instruction. I.e., the throw is deferred until GenerateBlock() is called. + +// Microsoft added RDRAND in August 2012, VS2012. GCC added RDRAND in December 2010, GCC 4.6. +// Clang added RDRAND in July 2012, Clang 3.2. Intel added RDRAND in September 2011, ICC 12.1. + +NAMESPACE_BEGIN(CryptoPP) + +//! \brief Exception thrown when a RDRAND generator encounters +//! a generator related error. +class RDRAND_Err : public Exception +{ +public: + RDRAND_Err(const std::string &operation) + : Exception(OTHER_ERROR, "RDRAND: " + operation + " operation failed") {} +}; + +//! \brief Hardware generated random numbers using RDRAND instruction +//! \sa MaurerRandomnessTest() for random bit generators +class RDRAND : public RandomNumberGenerator +{ +public: + std::string AlgorithmName() const {return "RDRAND";} + + //! \brief Construct a RDRAND generator + //! \param retries the number of retries for failed calls to the hardware + //! \details RDRAND() constructs a generator with a maximum number of retires + //! for failed generation attempts. + RDRAND(unsigned int retries = 8) : m_retries(retries) {} + + virtual ~RDRAND() {} + + //! \brief Retrieve the number of retries used by the generator + //! \returns the number of times GenerateBlock() will attempt to recover from a failed generation + unsigned int GetRetries() const + { + return m_retries; + } + + //! \brief Set the number of retries used by the generator + //! \param retries number of times GenerateBlock() will attempt to recover from a failed generation + void SetRetries(unsigned int retries) + { + m_retries = retries; + } + + //! \brief Generate random array of bytes + //! \param output the byte buffer + //! \param size the length of the buffer, in bytes +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) + virtual void GenerateBlock(byte *output, size_t size); +#else + virtual void GenerateBlock(byte *output, size_t size) { + CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); + throw NotImplemented("RDRAND: rdrand is not available on this platform"); + } +#endif + + //! \brief Generate and discard n bytes + //! \param n the number of bytes to generate and discard + //! \details the RDSEED generator discards words, not bytes. If n is + //! not a multiple of a machine word, then it is rounded up to + //! that size. +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) + virtual void DiscardBytes(size_t n); +#else + virtual void DiscardBytes(size_t n) { + CRYPTOPP_UNUSED(n); + throw NotImplemented("RDRAND: rdrand is not available on this platform"); + } +#endif + + //! Update RNG state with additional unpredictable values + //! \param input unused + //! \param length unused + //! \details The operation is a nop for this generator. + virtual void IncorporateEntropy(const byte *input, size_t length) + { + // Override to avoid the base class' throw. + CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length); + assert(0); // warn in debug builds + } + +private: + unsigned int m_retries; +}; + +//! \brief Exception thrown when a RDSEED generator encounters +//! a generator related error. +class RDSEED_Err : public Exception +{ +public: + RDSEED_Err(const std::string &operation) + : Exception(OTHER_ERROR, "RDSEED: " + operation + " operation failed") {} +}; + +//! \brief Hardware generated random numbers using RDSEED instruction +//! \sa MaurerRandomnessTest() for random bit generators +class RDSEED : public RandomNumberGenerator +{ +public: + std::string AlgorithmName() const {return "RDSEED";} + + //! \brief Construct a RDSEED generator + //! \param retries the number of retries for failed calls to the hardware + //! \details RDSEED() constructs a generator with a maximum number of retires + //! for failed generation attempts. + RDSEED(unsigned int retries = 8) : m_retries(retries) {} + + virtual ~RDSEED() {} + + //! \brief Retrieve the number of retries used by the generator + //! \returns the number of times GenerateBlock() will attempt to recover from a failed generation + unsigned int GetRetries() const + { + return m_retries; + } + + //! \brief Set the number of retries used by the generator + //! \param retries number of times GenerateBlock() will attempt to recover from a failed generation + void SetRetries(unsigned int retries) + { + m_retries = retries; + } + + //! \brief Generate random array of bytes + //! \param output the byte buffer + //! \param size the length of the buffer, in bytes +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) + virtual void GenerateBlock(byte *output, size_t size); +#else + virtual void GenerateBlock(byte *output, size_t size) { + CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); + throw NotImplemented("RDSEED: rdseed is not available on this platform"); + } +#endif + + //! \brief Generate and discard n bytes + //! \param n the number of bytes to generate and discard + //! \details the RDSEED generator discards words, not bytes. If n is + //! not a multiple of a machine word, then it is rounded up to + //! that size. +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) + virtual void DiscardBytes(size_t n); +#else + virtual void DiscardBytes(size_t n) { + CRYPTOPP_UNUSED(n); + throw NotImplemented("RDSEED: rdseed is not available on this platform"); + } +#endif + + //! Update RNG state with additional unpredictable values + //! \param input unused + //! \param length unused + //! \details The operation is a nop for this generator. + virtual void IncorporateEntropy(const byte *input, size_t length) + { + // Override to avoid the base class' throw. + CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length); + assert(0); // warn in debug builds + } + +private: + unsigned int m_retries; +}; + +NAMESPACE_END + +#endif // CRYPTOPP_RDRAND_H diff --git a/external/crypto++-5.6.3/rdtables.cpp b/external/crypto++-5.6.3/rdtables.cpp new file mode 100644 index 000000000..493793252 --- /dev/null +++ b/external/crypto++-5.6.3/rdtables.cpp @@ -0,0 +1,172 @@ +// Rijndael tables + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "rijndael.h" + +// VC60 workaround: gives a C4786 warning without this function +// when runtime lib is set to multithread debug DLL +// even though warning 4786 is disabled! +void Rijndael_VC60Workaround() +{ +} + +NAMESPACE_BEGIN(CryptoPP) + +/* +Te0[x] = S [x].[02, 01, 01, 03]; +Te1[x] = S [x].[03, 02, 01, 01]; +Te2[x] = S [x].[01, 03, 02, 01]; +Te3[x] = S [x].[01, 01, 03, 02]; + +Td0[x] = Si[x].[0e, 09, 0d, 0b]; +Td1[x] = Si[x].[0b, 0e, 09, 0d]; +Td2[x] = Si[x].[0d, 0b, 0e, 09]; +Td3[x] = Si[x].[09, 0d, 0b, 0e]; +*/ + +const byte Rijndael::Base::Se[256] = { + 0x63, 0x7c, 0x77, 0x7b, + 0xf2, 0x6b, 0x6f, 0xc5, + 0x30, 0x01, 0x67, 0x2b, + 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, + 0xfa, 0x59, 0x47, 0xf0, + 0xad, 0xd4, 0xa2, 0xaf, + 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, + 0x36, 0x3f, 0xf7, 0xcc, + 0x34, 0xa5, 0xe5, 0xf1, + 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, + 0x18, 0x96, 0x05, 0x9a, + 0x07, 0x12, 0x80, 0xe2, + 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, + 0x1b, 0x6e, 0x5a, 0xa0, + 0x52, 0x3b, 0xd6, 0xb3, + 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, + 0x20, 0xfc, 0xb1, 0x5b, + 0x6a, 0xcb, 0xbe, 0x39, + 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, + 0x43, 0x4d, 0x33, 0x85, + 0x45, 0xf9, 0x02, 0x7f, + 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, + 0x92, 0x9d, 0x38, 0xf5, + 0xbc, 0xb6, 0xda, 0x21, + 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, + 0x5f, 0x97, 0x44, 0x17, + 0xc4, 0xa7, 0x7e, 0x3d, + 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, + 0x22, 0x2a, 0x90, 0x88, + 0x46, 0xee, 0xb8, 0x14, + 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, + 0x49, 0x06, 0x24, 0x5c, + 0xc2, 0xd3, 0xac, 0x62, + 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, + 0x8d, 0xd5, 0x4e, 0xa9, + 0x6c, 0x56, 0xf4, 0xea, + 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, + 0x1c, 0xa6, 0xb4, 0xc6, + 0xe8, 0xdd, 0x74, 0x1f, + 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, + 0x48, 0x03, 0xf6, 0x0e, + 0x61, 0x35, 0x57, 0xb9, + 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, + 0x69, 0xd9, 0x8e, 0x94, + 0x9b, 0x1e, 0x87, 0xe9, + 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, + 0xbf, 0xe6, 0x42, 0x68, + 0x41, 0x99, 0x2d, 0x0f, + 0xb0, 0x54, 0xbb, 0x16, +}; + +const byte Rijndael::Base::Sd[256] = { + 0x52, 0x09, 0x6a, 0xd5, + 0x30, 0x36, 0xa5, 0x38, + 0xbf, 0x40, 0xa3, 0x9e, + 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, + 0x9b, 0x2f, 0xff, 0x87, + 0x34, 0x8e, 0x43, 0x44, + 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, + 0xa6, 0xc2, 0x23, 0x3d, + 0xee, 0x4c, 0x95, 0x0b, + 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, + 0x28, 0xd9, 0x24, 0xb2, + 0x76, 0x5b, 0xa2, 0x49, + 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, + 0x86, 0x68, 0x98, 0x16, + 0xd4, 0xa4, 0x5c, 0xcc, + 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, + 0xfd, 0xed, 0xb9, 0xda, + 0x5e, 0x15, 0x46, 0x57, + 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, + 0x8c, 0xbc, 0xd3, 0x0a, + 0xf7, 0xe4, 0x58, 0x05, + 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, + 0xca, 0x3f, 0x0f, 0x02, + 0xc1, 0xaf, 0xbd, 0x03, + 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, + 0x4f, 0x67, 0xdc, 0xea, + 0x97, 0xf2, 0xcf, 0xce, + 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, + 0xe7, 0xad, 0x35, 0x85, + 0xe2, 0xf9, 0x37, 0xe8, + 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, + 0x1d, 0x29, 0xc5, 0x89, + 0x6f, 0xb7, 0x62, 0x0e, + 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, + 0xc6, 0xd2, 0x79, 0x20, + 0x9a, 0xdb, 0xc0, 0xfe, + 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, + 0x88, 0x07, 0xc7, 0x31, + 0xb1, 0x12, 0x10, 0x59, + 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, + 0x19, 0xb5, 0x4a, 0x0d, + 0x2d, 0xe5, 0x7a, 0x9f, + 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, + 0xae, 0x2a, 0xf5, 0xb0, + 0xc8, 0xeb, 0xbb, 0x3c, + 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, + 0xba, 0x77, 0xd6, 0x26, + 0xe1, 0x69, 0x14, 0x63, + 0x55, 0x21, 0x0c, 0x7d, +}; + +const word32 Rijndael::Base::rcon[] = { + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/regtest.cpp b/external/crypto++-5.6.3/regtest.cpp new file mode 100644 index 000000000..c5dd04d54 --- /dev/null +++ b/external/crypto++-5.6.3/regtest.cpp @@ -0,0 +1,166 @@ +// regtest.cpp - written and placed in the public domain by Wei Dai + +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 + +#include "cryptlib.h" +#include "factory.h" +#include "modes.h" +#include "dh.h" +#include "esign.h" +#include "md2.h" +#include "rw.h" +#include "md5.h" +#include "rsa.h" +#include "ripemd.h" +#include "dsa.h" +#include "seal.h" +#include "whrlpool.h" +#include "ttmac.h" +#include "camellia.h" +#include "shacal2.h" +#include "tea.h" +#include "panama.h" +#include "pssr.h" +#include "aes.h" +#include "salsa.h" +#include "vmac.h" +#include "tiger.h" +#include "md5.h" +#include "sosemanuk.h" +#include "arc4.h" +#include "ccm.h" +#include "gcm.h" +#include "eax.h" +#include "twofish.h" +#include "serpent.h" +#include "cast.h" +#include "rc6.h" +#include "mars.h" +#include "des.h" +#include "idea.h" +#include "rc5.h" +#include "tea.h" +#include "skipjack.h" +#include "cmac.h" +#include "dmac.h" +#include "blowfish.h" +#include "seed.h" +#include "wake.h" +#include "seal.h" +#include "crc.h" +#include "adler32.h" +#include "sha3.h" +#include "hkdf.h" + +// Aggressive stack checking with VS2005 SP1 and above. +#if (CRYPTOPP_MSC_VERSION >= 1410) +# pragma strict_gs_check (on) +#endif + +USING_NAMESPACE(CryptoPP) + +void RegisterFactories() +{ + static bool s_registered = false; + if (s_registered) + return; + + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterAsymmetricCipherDefaultFactories > >("RSA/OAEP-MGF1(SHA-1)"); + RegisterAsymmetricCipherDefaultFactories >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)"); + RegisterSignatureSchemeDefaultFactories(); + RegisterSignatureSchemeDefaultFactories >(); + RegisterSignatureSchemeDefaultFactories >(); + RegisterSignatureSchemeDefaultFactories >(); + RegisterSignatureSchemeDefaultFactories >(); + RegisterSignatureSchemeDefaultFactories >("NR(1363)/EMSA1(SHA-1)"); + RegisterSignatureSchemeDefaultFactories >("DSA-1363/EMSA1(SHA-1)"); + RegisterSignatureSchemeDefaultFactories >("RSA/PKCS1-1.5(MD2)"); + RegisterSignatureSchemeDefaultFactories >("RSA/PKCS1-1.5(SHA-1)"); + RegisterSignatureSchemeDefaultFactories >("ESIGN/EMSA5-MGF1(SHA-1)"); + RegisterSignatureSchemeDefaultFactories >("RW/EMSA2(SHA-1)"); + RegisterSignatureSchemeDefaultFactories >("RSA/PSS-MGF1(SHA-1)"); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories(); + RegisterSymmetricCipherDefaultFactories(); + RegisterSymmetricCipherDefaultFactories(); + RegisterSymmetricCipherDefaultFactories(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterAuthenticatedSymmetricCipherDefaultFactories >(); + RegisterAuthenticatedSymmetricCipherDefaultFactories >(); + RegisterAuthenticatedSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterSymmetricCipherDefaultFactories >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + RegisterDefaultFactoryFor >(); + + s_registered = true; +} diff --git a/external/crypto++-5.6.3/resource.h b/external/crypto++-5.6.3/resource.h new file mode 100644 index 000000000..861e22ba3 --- /dev/null +++ b/external/crypto++-5.6.3/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by cryptopp.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/external/crypto++-5.6.3/rijndael.cpp b/external/crypto++-5.6.3/rijndael.cpp new file mode 100644 index 000000000..99e6b8c81 --- /dev/null +++ b/external/crypto++-5.6.3/rijndael.cpp @@ -0,0 +1,1277 @@ +// rijndael.cpp - modified by Chris Morgan +// and Wei Dai from Paulo Baretto's Rijndael implementation +// The original code and all modifications are in the public domain. + +// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM rijndael.cpp" to generate MASM code + +/* +July 2010: Added support for AES-NI instructions via compiler intrinsics. +*/ + +/* +Feb 2009: The x86/x64 assembly code was rewritten in by Wei Dai to do counter mode +caching, which was invented by Hongjun Wu and popularized by Daniel J. Bernstein +and Peter Schwabe in their paper "New AES software speed records". The round +function was also modified to include a trick similar to one in Brian Gladman's +x86 assembly code, doing an 8-bit register move to minimize the number of +register spills. Also switched to compressed tables and copying round keys to +the stack. + +The C++ implementation now uses compressed tables if +CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is defined. +*/ + +/* +July 2006: Defense against timing attacks was added in by Wei Dai. + +The code now uses smaller tables in the first and last rounds, +and preloads them into L1 cache before usage (by loading at least +one element in each cache line). + +We try to delay subsequent accesses to each table (used in the first +and last rounds) until all of the table has been preloaded. Hopefully +the compiler isn't smart enough to optimize that code away. + +After preloading the table, we also try not to access any memory location +other than the table and the stack, in order to prevent table entries from +being unloaded from L1 cache, until that round is finished. +(Some popular CPUs have 2-way associative caches.) +*/ + +// This is the original introductory comment: + +/** + * version 3.0 (December 2000) + * + * Optimised ANSI C code for the Rijndael cipher (now AES) + * + * author Vincent Rijmen + * author Antoon Bosselaers + * author Paulo Barreto + * + * This code is hereby placed in the public domain. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "pch.h" +#include "config.h" + +#ifndef CRYPTOPP_IMPORTS +#ifndef CRYPTOPP_GENERATE_X64_MASMrij + +#include "rijndael.h" +#include "stdcpp.h" // alloca +#include "misc.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +// Hack for https://github.com/weidai11/cryptopp/issues/42 +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) +# define CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS 1 +#endif + +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) +# if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) +namespace rdtable {CRYPTOPP_ALIGN_DATA(16) word64 Te[256+2];} +using namespace rdtable; +# else +static word64 Te[256]; +# endif +static word64 Td[256]; +#else +static word32 Te[256*4], Td[256*4]; +#endif +static volatile bool s_TeFilled = false, s_TdFilled = false; + +// ************************* Portable Code ************************************ + +#define QUARTER_ROUND(L, T, t, a, b, c, d) \ + a ^= L(T, 3, byte(t)); t >>= 8;\ + b ^= L(T, 2, byte(t)); t >>= 8;\ + c ^= L(T, 1, byte(t)); t >>= 8;\ + d ^= L(T, 0, t); + +#define QUARTER_ROUND_LE(t, a, b, c, d) \ + tempBlock[a] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\ + tempBlock[b] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\ + tempBlock[c] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\ + tempBlock[d] = ((byte *)(Te+t))[1]; + +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + #define QUARTER_ROUND_LD(t, a, b, c, d) \ + tempBlock[a] = ((byte *)(Td+byte(t)))[GetNativeByteOrder()*7]; t >>= 8;\ + tempBlock[b] = ((byte *)(Td+byte(t)))[GetNativeByteOrder()*7]; t >>= 8;\ + tempBlock[c] = ((byte *)(Td+byte(t)))[GetNativeByteOrder()*7]; t >>= 8;\ + tempBlock[d] = ((byte *)(Td+t))[GetNativeByteOrder()*7]; +#else + #define QUARTER_ROUND_LD(t, a, b, c, d) \ + tempBlock[a] = Sd[byte(t)]; t >>= 8;\ + tempBlock[b] = Sd[byte(t)]; t >>= 8;\ + tempBlock[c] = Sd[byte(t)]; t >>= 8;\ + tempBlock[d] = Sd[t]; +#endif + +#define QUARTER_ROUND_E(t, a, b, c, d) QUARTER_ROUND(TL_M, Te, t, a, b, c, d) +#define QUARTER_ROUND_D(t, a, b, c, d) QUARTER_ROUND(TL_M, Td, t, a, b, c, d) + +#ifdef IS_LITTLE_ENDIAN + #define QUARTER_ROUND_FE(t, a, b, c, d) QUARTER_ROUND(TL_F, Te, t, d, c, b, a) + #define QUARTER_ROUND_FD(t, a, b, c, d) QUARTER_ROUND(TL_F, Td, t, d, c, b, a) + #if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + #define TL_F(T, i, x) (*(word32 *)((byte *)T + x*8 + (6-i)%4+1)) + #define TL_M(T, i, x) (*(word32 *)((byte *)T + x*8 + (i+3)%4+1)) + #else + #define TL_F(T, i, x) rotrFixed(T[x], (3-i)*8) + #define TL_M(T, i, x) T[i*256 + x] + #endif +#else + #define QUARTER_ROUND_FE(t, a, b, c, d) QUARTER_ROUND(TL_F, Te, t, a, b, c, d) + #define QUARTER_ROUND_FD(t, a, b, c, d) QUARTER_ROUND(TL_F, Td, t, a, b, c, d) + #if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + #define TL_F(T, i, x) (*(word32 *)((byte *)T + x*8 + (4-i)%4)) + #define TL_M TL_F + #else + #define TL_F(T, i, x) rotrFixed(T[x], i*8) + #define TL_M(T, i, x) T[i*256 + x] + #endif +#endif + + +#define f2(x) ((x<<1)^(((x>>7)&1)*0x11b)) +#define f4(x) ((x<<2)^(((x>>6)&1)*0x11b)^(((x>>6)&2)*0x11b)) +#define f8(x) ((x<<3)^(((x>>5)&1)*0x11b)^(((x>>5)&2)*0x11b)^(((x>>5)&4)*0x11b)) + +#define f3(x) (f2(x) ^ x) +#define f9(x) (f8(x) ^ x) +#define fb(x) (f8(x) ^ f2(x) ^ x) +#define fd(x) (f8(x) ^ f4(x) ^ x) +#define fe(x) (f8(x) ^ f4(x) ^ f2(x)) + +void Rijndael::Base::FillEncTable() +{ + for (int i=0; i<256; i++) + { + byte x = Se[i]; +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + word32 y = word32(x)<<8 | word32(x)<<16 | word32(f2(x))<<24; + Te[i] = word64(y | f3(x))<<32 | y; +#else + word32 y = f3(x) | word32(x)<<8 | word32(x)<<16 | word32(f2(x))<<24; + for (int j=0; j<4; j++) + { + Te[i+j*256] = y; + y = rotrFixed(y, 8); + } +#endif + } +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) + Te[256] = Te[257] = 0; +#endif + s_TeFilled = true; +} + +void Rijndael::Base::FillDecTable() +{ + for (int i=0; i<256; i++) + { + byte x = Sd[i]; +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + word32 y = word32(fd(x))<<8 | word32(f9(x))<<16 | word32(fe(x))<<24; + Td[i] = word64(y | fb(x))<<32 | y | x; +#else + word32 y = fb(x) | word32(fd(x))<<8 | word32(f9(x))<<16 | word32(fe(x))<<24;; + for (int j=0; j<4; j++) + { + Td[i+j*256] = y; + y = rotrFixed(y, 8); + } +#endif + } + s_TdFilled = true; +} + +void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, const NameValuePairs &) +{ + AssertValidKeyLength(keylen); + + m_rounds = keylen/4 + 6; + m_key.New(4*(m_rounds+1)); + + word32 *rk = m_key; + +#if (CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && (!defined(_MSC_VER) || _MSC_VER >= 1600 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)) + // MSVC 2008 SP1 generates bad code for _mm_extract_epi32() when compiling for X64 + if (HasAESNI()) + { + static const word32 rcLE[] = { + 0x01, 0x02, 0x04, 0x08, + 0x10, 0x20, 0x40, 0x80, + 0x1B, 0x36, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ + }; + const word32 *rc = rcLE; + + __m128i temp = _mm_loadu_si128((__m128i *)(userKey+keylen-16)); + memcpy(rk, userKey, keylen); + + while (true) + { + rk[keylen/4] = rk[0] ^ _mm_extract_epi32(_mm_aeskeygenassist_si128(temp, 0), 3) ^ *(rc++); + rk[keylen/4+1] = rk[1] ^ rk[keylen/4]; + rk[keylen/4+2] = rk[2] ^ rk[keylen/4+1]; + rk[keylen/4+3] = rk[3] ^ rk[keylen/4+2]; + + if (rk + keylen/4 + 4 == m_key.end()) + break; + + if (keylen == 24) + { + rk[10] = rk[ 4] ^ rk[ 9]; + rk[11] = rk[ 5] ^ rk[10]; + temp = _mm_insert_epi32(temp, rk[11], 3); + } + else if (keylen == 32) + { + temp = _mm_insert_epi32(temp, rk[11], 3); + rk[12] = rk[ 4] ^ _mm_extract_epi32(_mm_aeskeygenassist_si128(temp, 0), 2); + rk[13] = rk[ 5] ^ rk[12]; + rk[14] = rk[ 6] ^ rk[13]; + rk[15] = rk[ 7] ^ rk[14]; + temp = _mm_insert_epi32(temp, rk[15], 3); + } + else + temp = _mm_insert_epi32(temp, rk[7], 3); + + rk += keylen/4; + } + + if (!IsForwardTransformation()) + { + rk = m_key; + unsigned int i, j; + + std::swap(*(__m128i *)(rk), *(__m128i *)(rk+4*m_rounds)); + + for (i = 4, j = 4*m_rounds-4; i < j; i += 4, j -= 4) + { + temp = _mm_aesimc_si128(*(__m128i *)(rk+i)); + *(__m128i *)(rk+i) = _mm_aesimc_si128(*(__m128i *)(rk+j)); + *(__m128i *)(rk+j) = temp; + } + + *(__m128i *)(rk+i) = _mm_aesimc_si128(*(__m128i *)(rk+i)); + } + + return; + } +#endif + + GetUserKey(BIG_ENDIAN_ORDER, rk, keylen/4, userKey, keylen); + const word32 *rc = rcon; + word32 temp; + + while (true) + { + temp = rk[keylen/4-1]; + word32 x = (word32(Se[GETBYTE(temp, 2)]) << 24) ^ (word32(Se[GETBYTE(temp, 1)]) << 16) ^ (word32(Se[GETBYTE(temp, 0)]) << 8) ^ Se[GETBYTE(temp, 3)]; + rk[keylen/4] = rk[0] ^ x ^ *(rc++); + rk[keylen/4+1] = rk[1] ^ rk[keylen/4]; + rk[keylen/4+2] = rk[2] ^ rk[keylen/4+1]; + rk[keylen/4+3] = rk[3] ^ rk[keylen/4+2]; + + if (rk + keylen/4 + 4 == m_key.end()) + break; + + if (keylen == 24) + { + rk[10] = rk[ 4] ^ rk[ 9]; + rk[11] = rk[ 5] ^ rk[10]; + } + else if (keylen == 32) + { + temp = rk[11]; + rk[12] = rk[ 4] ^ (word32(Se[GETBYTE(temp, 3)]) << 24) ^ (word32(Se[GETBYTE(temp, 2)]) << 16) ^ (word32(Se[GETBYTE(temp, 1)]) << 8) ^ Se[GETBYTE(temp, 0)]; + rk[13] = rk[ 5] ^ rk[12]; + rk[14] = rk[ 6] ^ rk[13]; + rk[15] = rk[ 7] ^ rk[14]; + } + rk += keylen/4; + } + + rk = m_key; + + if (IsForwardTransformation()) + { + if (!s_TeFilled) + FillEncTable(); + + ConditionalByteReverse(BIG_ENDIAN_ORDER, rk, rk, 16); + ConditionalByteReverse(BIG_ENDIAN_ORDER, rk + m_rounds*4, rk + m_rounds*4, 16); + } + else + { + if (!s_TdFilled) + FillDecTable(); + + unsigned int i, j; + +#define InverseMixColumn(x) TL_M(Td, 0, Se[GETBYTE(x, 3)]) ^ TL_M(Td, 1, Se[GETBYTE(x, 2)]) ^ TL_M(Td, 2, Se[GETBYTE(x, 1)]) ^ TL_M(Td, 3, Se[GETBYTE(x, 0)]) + + for (i = 4, j = 4*m_rounds-4; i < j; i += 4, j -= 4) + { + temp = InverseMixColumn(rk[i ]); rk[i ] = InverseMixColumn(rk[j ]); rk[j ] = temp; + temp = InverseMixColumn(rk[i + 1]); rk[i + 1] = InverseMixColumn(rk[j + 1]); rk[j + 1] = temp; + temp = InverseMixColumn(rk[i + 2]); rk[i + 2] = InverseMixColumn(rk[j + 2]); rk[j + 2] = temp; + temp = InverseMixColumn(rk[i + 3]); rk[i + 3] = InverseMixColumn(rk[j + 3]); rk[j + 3] = temp; + } + + rk[i+0] = InverseMixColumn(rk[i+0]); + rk[i+1] = InverseMixColumn(rk[i+1]); + rk[i+2] = InverseMixColumn(rk[i+2]); + rk[i+3] = InverseMixColumn(rk[i+3]); + + temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[0]); rk[0] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+0]); rk[4*m_rounds+0] = temp; + temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[1]); rk[1] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+1]); rk[4*m_rounds+1] = temp; + temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[2]); rk[2] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+2]); rk[4*m_rounds+2] = temp; + temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[3]); rk[3] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+3]); rk[4*m_rounds+3] = temp; + } + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasAESNI()) + ConditionalByteReverse(BIG_ENDIAN_ORDER, rk+4, rk+4, (m_rounds-1)*16); +#endif +} + +void Rijndael::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) + if (HasSSE2()) +#else + if (HasAESNI()) +#endif + { + return (void)Rijndael::Enc::AdvancedProcessBlocks(inBlock, xorBlock, outBlock, 16, 0); + } +#endif + + typedef BlockGetAndPut Block; + + word32 s0, s1, s2, s3, t0, t1, t2, t3; + Block::Get(inBlock)(s0)(s1)(s2)(s3); + + const word32 *rk = m_key; + s0 ^= rk[0]; + s1 ^= rk[1]; + s2 ^= rk[2]; + s3 ^= rk[3]; + t0 = rk[4]; + t1 = rk[5]; + t2 = rk[6]; + t3 = rk[7]; + rk += 8; + + // timing attack countermeasure. see comments at top for more details + const int cacheLineSize = GetCacheLineSize(); + unsigned int i; + word32 u = 0; +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + for (i=0; i<2048; i+=cacheLineSize) +#else + for (i=0; i<1024; i+=cacheLineSize) +#endif + u &= *(const word32 *)(((const byte *)Te)+i); + u &= Te[255]; + s0 |= u; s1 |= u; s2 |= u; s3 |= u; + + QUARTER_ROUND_FE(s3, t0, t1, t2, t3) + QUARTER_ROUND_FE(s2, t3, t0, t1, t2) + QUARTER_ROUND_FE(s1, t2, t3, t0, t1) + QUARTER_ROUND_FE(s0, t1, t2, t3, t0) + + // Nr - 2 full rounds: + unsigned int r = m_rounds/2 - 1; + do + { + s0 = rk[0]; s1 = rk[1]; s2 = rk[2]; s3 = rk[3]; + + QUARTER_ROUND_E(t3, s0, s1, s2, s3) + QUARTER_ROUND_E(t2, s3, s0, s1, s2) + QUARTER_ROUND_E(t1, s2, s3, s0, s1) + QUARTER_ROUND_E(t0, s1, s2, s3, s0) + + t0 = rk[4]; t1 = rk[5]; t2 = rk[6]; t3 = rk[7]; + + QUARTER_ROUND_E(s3, t0, t1, t2, t3) + QUARTER_ROUND_E(s2, t3, t0, t1, t2) + QUARTER_ROUND_E(s1, t2, t3, t0, t1) + QUARTER_ROUND_E(s0, t1, t2, t3, t0) + + rk += 8; + } while (--r); + + word32 tbw[4]; + byte *const tempBlock = (byte *)tbw; + + QUARTER_ROUND_LE(t2, 15, 2, 5, 8) + QUARTER_ROUND_LE(t1, 11, 14, 1, 4) + QUARTER_ROUND_LE(t0, 7, 10, 13, 0) + QUARTER_ROUND_LE(t3, 3, 6, 9, 12) + + Block::Put(xorBlock, outBlock)(tbw[0]^rk[0])(tbw[1]^rk[1])(tbw[2]^rk[2])(tbw[3]^rk[3]); +} + +void Rijndael::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasAESNI()) + { + Rijndael::Dec::AdvancedProcessBlocks(inBlock, xorBlock, outBlock, 16, 0); + return; + } +#endif + + typedef BlockGetAndPut Block; + + word32 s0, s1, s2, s3, t0, t1, t2, t3; + Block::Get(inBlock)(s0)(s1)(s2)(s3); + + const word32 *rk = m_key; + s0 ^= rk[0]; + s1 ^= rk[1]; + s2 ^= rk[2]; + s3 ^= rk[3]; + t0 = rk[4]; + t1 = rk[5]; + t2 = rk[6]; + t3 = rk[7]; + rk += 8; + + // timing attack countermeasure. see comments at top for more details + const int cacheLineSize = GetCacheLineSize(); + unsigned int i; + word32 u = 0; +#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) + for (i=0; i<2048; i+=cacheLineSize) +#else + for (i=0; i<1024; i+=cacheLineSize) +#endif + u &= *(const word32 *)(((const byte *)Td)+i); + u &= Td[255]; + s0 |= u; s1 |= u; s2 |= u; s3 |= u; + + QUARTER_ROUND_FD(s3, t2, t1, t0, t3) + QUARTER_ROUND_FD(s2, t1, t0, t3, t2) + QUARTER_ROUND_FD(s1, t0, t3, t2, t1) + QUARTER_ROUND_FD(s0, t3, t2, t1, t0) + + // Nr - 2 full rounds: + unsigned int r = m_rounds/2 - 1; + do + { + s0 = rk[0]; s1 = rk[1]; s2 = rk[2]; s3 = rk[3]; + + QUARTER_ROUND_D(t3, s2, s1, s0, s3) + QUARTER_ROUND_D(t2, s1, s0, s3, s2) + QUARTER_ROUND_D(t1, s0, s3, s2, s1) + QUARTER_ROUND_D(t0, s3, s2, s1, s0) + + t0 = rk[4]; t1 = rk[5]; t2 = rk[6]; t3 = rk[7]; + + QUARTER_ROUND_D(s3, t2, t1, t0, t3) + QUARTER_ROUND_D(s2, t1, t0, t3, t2) + QUARTER_ROUND_D(s1, t0, t3, t2, t1) + QUARTER_ROUND_D(s0, t3, t2, t1, t0) + + rk += 8; + } while (--r); + +#if !(defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS)) + // timing attack countermeasure. see comments at top for more details + // If CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is defined, + // QUARTER_ROUND_LD will use Td, which is already preloaded. + u = 0; + for (i=0; i<256; i+=cacheLineSize) + u &= *(const word32 *)(Sd+i); + u &= *(const word32 *)(Sd+252); + t0 |= u; t1 |= u; t2 |= u; t3 |= u; +#endif + + word32 tbw[4]; + byte *const tempBlock = (byte *)tbw; + + QUARTER_ROUND_LD(t2, 7, 2, 13, 8) + QUARTER_ROUND_LD(t1, 3, 14, 9, 4) + QUARTER_ROUND_LD(t0, 15, 10, 5, 0) + QUARTER_ROUND_LD(t3, 11, 6, 1, 12) + + Block::Put(xorBlock, outBlock)(tbw[0]^rk[0])(tbw[1]^rk[1])(tbw[2]^rk[2])(tbw[3]^rk[3]); +} + +// ************************* Assembly Code ************************************ + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code +#endif + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) + +CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k) +{ + CRYPTOPP_UNUSED(locals); CRYPTOPP_UNUSED(k); + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + +#define L_REG esp +#define L_INDEX(i) (L_REG+768+i) +#define L_INXORBLOCKS L_INBLOCKS+4 +#define L_OUTXORBLOCKS L_INBLOCKS+8 +#define L_OUTBLOCKS L_INBLOCKS+12 +#define L_INCREMENTS L_INDEX(16*15) +#define L_SP L_INDEX(16*16) +#define L_LENGTH L_INDEX(16*16+4) +#define L_KEYS_BEGIN L_INDEX(16*16+8) + +#define MOVD movd +#define MM(i) mm##i + +#define MXOR(a,b,c) \ + AS2( movzx esi, b)\ + AS2( movd mm7, DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ + AS2( pxor MM(a), mm7)\ + +#define MMOV(a,b,c) \ + AS2( movzx esi, b)\ + AS2( movd MM(a), DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ + +#else + +#define L_REG r8 +#define L_INDEX(i) (L_REG+i) +#define L_INXORBLOCKS L_INBLOCKS+8 +#define L_OUTXORBLOCKS L_INBLOCKS+16 +#define L_OUTBLOCKS L_INBLOCKS+24 +#define L_INCREMENTS L_INDEX(16*16) +#define L_LENGTH L_INDEX(16*18+8) +#define L_KEYS_BEGIN L_INDEX(16*19) + +#define MOVD mov +#define MM_0 r9d +#define MM_1 r12d +#ifdef __GNUC__ +#define MM_2 r11d +#else +#define MM_2 r10d +#endif +#define MM(i) MM_##i + +#define MXOR(a,b,c) \ + AS2( movzx esi, b)\ + AS2( xor MM(a), DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ + +#define MMOV(a,b,c) \ + AS2( movzx esi, b)\ + AS2( mov MM(a), DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ + +#endif + +#define L_SUBKEYS L_INDEX(0) +#define L_SAVED_X L_SUBKEYS +#define L_KEY12 L_INDEX(16*12) +#define L_LASTROUND L_INDEX(16*13) +#define L_INBLOCKS L_INDEX(16*14) +#define MAP0TO4(i) (ASM_MOD(i+3,4)+1) + +#define XOR(a,b,c) \ + AS2( movzx esi, b)\ + AS2( xor a, DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ + +#define MOV(a,b,c) \ + AS2( movzx esi, b)\ + AS2( mov a, DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ + +#ifdef CRYPTOPP_GENERATE_X64_MASM + ALIGN 8 + Rijndael_Enc_AdvancedProcessBlocks PROC FRAME + rex_push_reg rsi + push_reg rdi + push_reg rbx + push_reg r12 + .endprolog + mov L_REG, rcx + mov AS_REG_7, ?Te@rdtable@CryptoPP@@3PA_KA + mov edi, DWORD PTR [?g_cacheLineSize@CryptoPP@@3IA] +#elif defined(__GNUC__) + __asm__ __volatile__ + ( + INTEL_NOPREFIX + #if CRYPTOPP_BOOL_X64 + AS2( mov L_REG, rcx) + #endif + AS_PUSH_IF86(bx) + AS_PUSH_IF86(bp) + AS2( mov AS_REG_7, WORD_REG(si)) +#else + AS_PUSH_IF86(si) + AS_PUSH_IF86(di) + AS_PUSH_IF86(bx) + AS_PUSH_IF86(bp) + AS2( lea AS_REG_7, [Te]) + AS2( mov edi, [g_cacheLineSize]) +#endif + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( mov [ecx+16*12+16*4], esp) // save esp to L_SP + AS2( lea esp, [ecx-768]) +#endif + + // copy subkeys to stack + AS2( mov WORD_REG(si), [L_KEYS_BEGIN]) + AS2( mov WORD_REG(ax), 16) + AS2( and WORD_REG(ax), WORD_REG(si)) + AS2( movdqa xmm3, XMMWORD_PTR [WORD_REG(dx)+16+WORD_REG(ax)]) // subkey 1 (non-counter) or 2 (counter) + AS2( movdqa [L_KEY12], xmm3) + AS2( lea WORD_REG(ax), [WORD_REG(dx)+WORD_REG(ax)+2*16]) + AS2( sub WORD_REG(ax), WORD_REG(si)) + ASL(0) + AS2( movdqa xmm0, [WORD_REG(ax)+WORD_REG(si)]) + AS2( movdqa XMMWORD_PTR [L_SUBKEYS+WORD_REG(si)], xmm0) + AS2( add WORD_REG(si), 16) + AS2( cmp WORD_REG(si), 16*12) + ASJ( jl, 0, b) + + // read subkeys 0, 1 and last + AS2( movdqa xmm4, [WORD_REG(ax)+WORD_REG(si)]) // last subkey + AS2( movdqa xmm1, [WORD_REG(dx)]) // subkey 0 + AS2( MOVD MM(1), [WORD_REG(dx)+4*4]) // 0,1,2,3 + AS2( mov ebx, [WORD_REG(dx)+5*4]) // 4,5,6,7 + AS2( mov ecx, [WORD_REG(dx)+6*4]) // 8,9,10,11 + AS2( mov edx, [WORD_REG(dx)+7*4]) // 12,13,14,15 + + // load table into cache + AS2( xor WORD_REG(ax), WORD_REG(ax)) + ASL(9) + AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) + AS2( add WORD_REG(ax), WORD_REG(di)) + AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) + AS2( add WORD_REG(ax), WORD_REG(di)) + AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) + AS2( add WORD_REG(ax), WORD_REG(di)) + AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) + AS2( add WORD_REG(ax), WORD_REG(di)) + AS2( cmp WORD_REG(ax), 2048) + ASJ( jl, 9, b) + AS1( lfence) + + AS2( test DWORD PTR [L_LENGTH], 1) + ASJ( jz, 8, f) + + // counter mode one-time setup + AS2( mov WORD_REG(si), [L_INBLOCKS]) + AS2( movdqu xmm2, [WORD_REG(si)]) // counter + AS2( pxor xmm2, xmm1) + AS2( psrldq xmm1, 14) + AS2( movd eax, xmm1) + AS2( mov al, BYTE PTR [WORD_REG(si)+15]) + AS2( MOVD MM(2), eax) +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( mov eax, 1) + AS2( movd mm3, eax) +#endif + + // partial first round, in: xmm2(15,14,13,12;11,10,9,8;7,6,5,4;3,2,1,0), out: mm1, ebx, ecx, edx + AS2( movd eax, xmm2) + AS2( psrldq xmm2, 4) + AS2( movd edi, xmm2) + AS2( psrldq xmm2, 4) + MXOR( 1, al, 0) // 0 + XOR( edx, ah, 1) // 1 + AS2( shr eax, 16) + XOR( ecx, al, 2) // 2 + XOR( ebx, ah, 3) // 3 + AS2( mov eax, edi) + AS2( movd edi, xmm2) + AS2( psrldq xmm2, 4) + XOR( ebx, al, 0) // 4 + MXOR( 1, ah, 1) // 5 + AS2( shr eax, 16) + XOR( edx, al, 2) // 6 + XOR( ecx, ah, 3) // 7 + AS2( mov eax, edi) + AS2( movd edi, xmm2) + XOR( ecx, al, 0) // 8 + XOR( ebx, ah, 1) // 9 + AS2( shr eax, 16) + MXOR( 1, al, 2) // 10 + XOR( edx, ah, 3) // 11 + AS2( mov eax, edi) + XOR( edx, al, 0) // 12 + XOR( ecx, ah, 1) // 13 + AS2( shr eax, 16) + XOR( ebx, al, 2) // 14 + AS2( psrldq xmm2, 3) + + // partial second round, in: ebx(4,5,6,7), ecx(8,9,10,11), edx(12,13,14,15), out: eax, ebx, edi, mm0 + AS2( mov eax, [L_KEY12+0*4]) + AS2( mov edi, [L_KEY12+2*4]) + AS2( MOVD MM(0), [L_KEY12+3*4]) + MXOR( 0, cl, 3) /* 11 */ + XOR( edi, bl, 3) /* 7 */ + MXOR( 0, bh, 2) /* 6 */ + AS2( shr ebx, 16) /* 4,5 */ + XOR( eax, bl, 1) /* 5 */ + MOV( ebx, bh, 0) /* 4 */ + AS2( xor ebx, [L_KEY12+1*4]) + XOR( eax, ch, 2) /* 10 */ + AS2( shr ecx, 16) /* 8,9 */ + XOR( eax, dl, 3) /* 15 */ + XOR( ebx, dh, 2) /* 14 */ + AS2( shr edx, 16) /* 12,13 */ + XOR( edi, ch, 0) /* 8 */ + XOR( ebx, cl, 1) /* 9 */ + XOR( edi, dl, 1) /* 13 */ + MXOR( 0, dh, 0) /* 12 */ + + AS2( movd ecx, xmm2) + AS2( MOVD edx, MM(1)) + AS2( MOVD [L_SAVED_X+3*4], MM(0)) + AS2( mov [L_SAVED_X+0*4], eax) + AS2( mov [L_SAVED_X+1*4], ebx) + AS2( mov [L_SAVED_X+2*4], edi) + ASJ( jmp, 5, f) + + ASL(3) + // non-counter mode per-block setup + AS2( MOVD MM(1), [L_KEY12+0*4]) // 0,1,2,3 + AS2( mov ebx, [L_KEY12+1*4]) // 4,5,6,7 + AS2( mov ecx, [L_KEY12+2*4]) // 8,9,10,11 + AS2( mov edx, [L_KEY12+3*4]) // 12,13,14,15 + ASL(8) + AS2( mov WORD_REG(ax), [L_INBLOCKS]) + AS2( movdqu xmm2, [WORD_REG(ax)]) + AS2( mov WORD_REG(si), [L_INXORBLOCKS]) + AS2( movdqu xmm5, [WORD_REG(si)]) + AS2( pxor xmm2, xmm1) + AS2( pxor xmm2, xmm5) + + // first round, in: xmm2(15,14,13,12;11,10,9,8;7,6,5,4;3,2,1,0), out: eax, ebx, ecx, edx + AS2( movd eax, xmm2) + AS2( psrldq xmm2, 4) + AS2( movd edi, xmm2) + AS2( psrldq xmm2, 4) + MXOR( 1, al, 0) // 0 + XOR( edx, ah, 1) // 1 + AS2( shr eax, 16) + XOR( ecx, al, 2) // 2 + XOR( ebx, ah, 3) // 3 + AS2( mov eax, edi) + AS2( movd edi, xmm2) + AS2( psrldq xmm2, 4) + XOR( ebx, al, 0) // 4 + MXOR( 1, ah, 1) // 5 + AS2( shr eax, 16) + XOR( edx, al, 2) // 6 + XOR( ecx, ah, 3) // 7 + AS2( mov eax, edi) + AS2( movd edi, xmm2) + XOR( ecx, al, 0) // 8 + XOR( ebx, ah, 1) // 9 + AS2( shr eax, 16) + MXOR( 1, al, 2) // 10 + XOR( edx, ah, 3) // 11 + AS2( mov eax, edi) + XOR( edx, al, 0) // 12 + XOR( ecx, ah, 1) // 13 + AS2( shr eax, 16) + XOR( ebx, al, 2) // 14 + MXOR( 1, ah, 3) // 15 + AS2( MOVD eax, MM(1)) + + AS2( add L_REG, [L_KEYS_BEGIN]) + AS2( add L_REG, 4*16) + ASJ( jmp, 2, f) + + ASL(1) + // counter-mode per-block setup + AS2( MOVD ecx, MM(2)) + AS2( MOVD edx, MM(1)) + AS2( mov eax, [L_SAVED_X+0*4]) + AS2( mov ebx, [L_SAVED_X+1*4]) + AS2( xor cl, ch) + AS2( and WORD_REG(cx), 255) + ASL(5) +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( paddb MM(2), mm3) +#else + AS2( add MM(2), 1) +#endif + // remaining part of second round, in: edx(previous round),esi(keyed counter byte) eax,ebx,[L_SAVED_X+2*4],[L_SAVED_X+3*4], out: eax,ebx,ecx,edx + AS2( xor edx, DWORD PTR [AS_REG_7+WORD_REG(cx)*8+3]) + XOR( ebx, dl, 3) + MOV( ecx, dh, 2) + AS2( shr edx, 16) + AS2( xor ecx, [L_SAVED_X+2*4]) + XOR( eax, dh, 0) + MOV( edx, dl, 1) + AS2( xor edx, [L_SAVED_X+3*4]) + + AS2( add L_REG, [L_KEYS_BEGIN]) + AS2( add L_REG, 3*16) + ASJ( jmp, 4, f) + +// in: eax(0,1,2,3), ebx(4,5,6,7), ecx(8,9,10,11), edx(12,13,14,15) +// out: eax, ebx, edi, mm0 +#define ROUND() \ + MXOR( 0, cl, 3) /* 11 */\ + AS2( mov cl, al) /* 8,9,10,3 */\ + XOR( edi, ah, 2) /* 2 */\ + AS2( shr eax, 16) /* 0,1 */\ + XOR( edi, bl, 3) /* 7 */\ + MXOR( 0, bh, 2) /* 6 */\ + AS2( shr ebx, 16) /* 4,5 */\ + MXOR( 0, al, 1) /* 1 */\ + MOV( eax, ah, 0) /* 0 */\ + XOR( eax, bl, 1) /* 5 */\ + MOV( ebx, bh, 0) /* 4 */\ + XOR( eax, ch, 2) /* 10 */\ + XOR( ebx, cl, 3) /* 3 */\ + AS2( shr ecx, 16) /* 8,9 */\ + XOR( eax, dl, 3) /* 15 */\ + XOR( ebx, dh, 2) /* 14 */\ + AS2( shr edx, 16) /* 12,13 */\ + XOR( edi, ch, 0) /* 8 */\ + XOR( ebx, cl, 1) /* 9 */\ + XOR( edi, dl, 1) /* 13 */\ + MXOR( 0, dh, 0) /* 12 */\ + + ASL(2) // 2-round loop + AS2( MOVD MM(0), [L_SUBKEYS-4*16+3*4]) + AS2( mov edi, [L_SUBKEYS-4*16+2*4]) + ROUND() + AS2( mov ecx, edi) + AS2( xor eax, [L_SUBKEYS-4*16+0*4]) + AS2( xor ebx, [L_SUBKEYS-4*16+1*4]) + AS2( MOVD edx, MM(0)) + + ASL(4) + AS2( MOVD MM(0), [L_SUBKEYS-4*16+7*4]) + AS2( mov edi, [L_SUBKEYS-4*16+6*4]) + ROUND() + AS2( mov ecx, edi) + AS2( xor eax, [L_SUBKEYS-4*16+4*4]) + AS2( xor ebx, [L_SUBKEYS-4*16+5*4]) + AS2( MOVD edx, MM(0)) + + AS2( add L_REG, 32) + AS2( test L_REG, 255) + ASJ( jnz, 2, b) + AS2( sub L_REG, 16*16) + +#define LAST(a, b, c) \ + AS2( movzx esi, a )\ + AS2( movzx edi, BYTE PTR [AS_REG_7+WORD_REG(si)*8+1] )\ + AS2( movzx esi, b )\ + AS2( xor edi, DWORD PTR [AS_REG_7+WORD_REG(si)*8+0] )\ + AS2( mov WORD PTR [L_LASTROUND+c], di )\ + + // last round + LAST(ch, dl, 2) + LAST(dh, al, 6) + AS2( shr edx, 16) + LAST(ah, bl, 10) + AS2( shr eax, 16) + LAST(bh, cl, 14) + AS2( shr ebx, 16) + LAST(dh, al, 12) + AS2( shr ecx, 16) + LAST(ah, bl, 0) + LAST(bh, cl, 4) + LAST(ch, dl, 8) + + AS2( mov WORD_REG(ax), [L_OUTXORBLOCKS]) + AS2( mov WORD_REG(bx), [L_OUTBLOCKS]) + + AS2( mov WORD_REG(cx), [L_LENGTH]) + AS2( sub WORD_REG(cx), 16) + + AS2( movdqu xmm2, [WORD_REG(ax)]) + AS2( pxor xmm2, xmm4) + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( movdqa xmm0, [L_INCREMENTS]) + AS2( paddd xmm0, [L_INBLOCKS]) + AS2( movdqa [L_INBLOCKS], xmm0) +#else + AS2( movdqa xmm0, [L_INCREMENTS+16]) + AS2( paddq xmm0, [L_INBLOCKS+16]) + AS2( movdqa [L_INBLOCKS+16], xmm0) +#endif + + AS2( pxor xmm2, [L_LASTROUND]) + AS2( movdqu [WORD_REG(bx)], xmm2) + + ASJ( jle, 7, f) + AS2( mov [L_LENGTH], WORD_REG(cx)) + AS2( test WORD_REG(cx), 1) + ASJ( jnz, 1, b) +#if CRYPTOPP_BOOL_X64 + AS2( movdqa xmm0, [L_INCREMENTS]) + AS2( paddq xmm0, [L_INBLOCKS]) + AS2( movdqa [L_INBLOCKS], xmm0) +#endif + ASJ( jmp, 3, b) + + ASL(7) + // erase keys on stack + AS2( xorps xmm0, xmm0) + AS2( lea WORD_REG(ax), [L_SUBKEYS+7*16]) + AS2( movaps [WORD_REG(ax)-7*16], xmm0) + AS2( movaps [WORD_REG(ax)-6*16], xmm0) + AS2( movaps [WORD_REG(ax)-5*16], xmm0) + AS2( movaps [WORD_REG(ax)-4*16], xmm0) + AS2( movaps [WORD_REG(ax)-3*16], xmm0) + AS2( movaps [WORD_REG(ax)-2*16], xmm0) + AS2( movaps [WORD_REG(ax)-1*16], xmm0) + AS2( movaps [WORD_REG(ax)+0*16], xmm0) + AS2( movaps [WORD_REG(ax)+1*16], xmm0) + AS2( movaps [WORD_REG(ax)+2*16], xmm0) + AS2( movaps [WORD_REG(ax)+3*16], xmm0) + AS2( movaps [WORD_REG(ax)+4*16], xmm0) + AS2( movaps [WORD_REG(ax)+5*16], xmm0) + AS2( movaps [WORD_REG(ax)+6*16], xmm0) +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( mov esp, [L_SP]) + AS1( emms) +#endif + AS_POP_IF86(bp) + AS_POP_IF86(bx) +#if defined(_MSC_VER) && CRYPTOPP_BOOL_X86 + AS_POP_IF86(di) + AS_POP_IF86(si) + AS1(ret) +#endif +#ifdef CRYPTOPP_GENERATE_X64_MASM + pop r12 + pop rbx + pop rdi + pop rsi + ret + Rijndael_Enc_AdvancedProcessBlocks ENDP +#endif +#ifdef __GNUC__ + ATT_PREFIX + : + : "c" (locals), "d" (k), "S" (Te), "D" (g_cacheLineSize) + : "memory", "cc", "%eax" + #if CRYPTOPP_BOOL_X64 + , "%rbx", "%r8", "%r9", "%r10", "%r11", "%r12" + #endif + ); +#endif +} + +#endif + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +void Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k); +} +#endif + +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 + +static inline bool AliasedWithTable(const byte *begin, const byte *end) +{ + size_t s0 = size_t(begin)%4096, s1 = size_t(end)%4096; + size_t t0 = size_t(Te)%4096, t1 = (size_t(Te)+sizeof(Te))%4096; + if (t1 > t0) + return (s0 >= t0 && s0 < t1) || (s1 > t0 && s1 <= t1); + else + return (s0 < t1 || s1 <= t1) || (s0 >= t0 || s1 > t0); +} + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + +inline void AESNI_Enc_Block(__m128i &block, const __m128i *subkeys, unsigned int rounds) +{ + block = _mm_xor_si128(block, subkeys[0]); + for (unsigned int i=1; i +inline size_t AESNI_AdvancedProcessBlocks(F1 func1, F4 func4, const __m128i *subkeys, unsigned int rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) +{ + size_t blockSize = 16; + size_t inIncrement = (flags & (BlockTransformation::BT_InBlockIsCounter|BlockTransformation::BT_DontIncrementInOutPointers)) ? 0 : blockSize; + size_t xorIncrement = xorBlocks ? blockSize : 0; + size_t outIncrement = (flags & BlockTransformation::BT_DontIncrementInOutPointers) ? 0 : blockSize; + + if (flags & BlockTransformation::BT_ReverseDirection) + { + assert(length % blockSize == 0); + inBlocks += length - blockSize; + xorBlocks += length - blockSize; + outBlocks += length - blockSize; + inIncrement = 0-inIncrement; + xorIncrement = 0-xorIncrement; + outIncrement = 0-outIncrement; + } + + if (flags & BlockTransformation::BT_AllowParallel) + { + while (length >= 4*blockSize) + { + __m128i block0 = _mm_loadu_si128((const __m128i *)inBlocks), block1, block2, block3; + if (flags & BlockTransformation::BT_InBlockIsCounter) + { + const __m128i be1 = *(const __m128i *)s_one; + block1 = _mm_add_epi32(block0, be1); + block2 = _mm_add_epi32(block1, be1); + block3 = _mm_add_epi32(block2, be1); + _mm_storeu_si128((__m128i *)inBlocks, _mm_add_epi32(block3, be1)); + } + else + { + inBlocks += inIncrement; + block1 = _mm_loadu_si128((const __m128i *)inBlocks); + inBlocks += inIncrement; + block2 = _mm_loadu_si128((const __m128i *)inBlocks); + inBlocks += inIncrement; + block3 = _mm_loadu_si128((const __m128i *)inBlocks); + inBlocks += inIncrement; + } + + if (flags & BlockTransformation::BT_XorInput) + { + block0 = _mm_xor_si128(block0, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + block1 = _mm_xor_si128(block1, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + block2 = _mm_xor_si128(block2, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + block3 = _mm_xor_si128(block3, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + } + + func4(block0, block1, block2, block3, subkeys, rounds); + + if (xorBlocks && !(flags & BlockTransformation::BT_XorInput)) + { + block0 = _mm_xor_si128(block0, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + block1 = _mm_xor_si128(block1, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + block2 = _mm_xor_si128(block2, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + block3 = _mm_xor_si128(block3, _mm_loadu_si128((const __m128i *)xorBlocks)); + xorBlocks += xorIncrement; + } + + _mm_storeu_si128((__m128i *)outBlocks, block0); + outBlocks += outIncrement; + _mm_storeu_si128((__m128i *)outBlocks, block1); + outBlocks += outIncrement; + _mm_storeu_si128((__m128i *)outBlocks, block2); + outBlocks += outIncrement; + _mm_storeu_si128((__m128i *)outBlocks, block3); + outBlocks += outIncrement; + + length -= 4*blockSize; + } + } + + while (length >= blockSize) + { + __m128i block = _mm_loadu_si128((const __m128i *)inBlocks); + + if (flags & BlockTransformation::BT_XorInput) + block = _mm_xor_si128(block, _mm_loadu_si128((const __m128i *)xorBlocks)); + + if (flags & BlockTransformation::BT_InBlockIsCounter) + const_cast(inBlocks)[15]++; + + func1(block, subkeys, rounds); + + if (xorBlocks && !(flags & BlockTransformation::BT_XorInput)) + block = _mm_xor_si128(block, _mm_loadu_si128((const __m128i *)xorBlocks)); + + _mm_storeu_si128((__m128i *)outBlocks, block); + + inBlocks += inIncrement; + outBlocks += outIncrement; + xorBlocks += xorIncrement; + length -= blockSize; + } + + return length; +} +#endif + +size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const +{ +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + if (HasAESNI()) + return AESNI_AdvancedProcessBlocks(AESNI_Enc_Block, AESNI_Enc_4_Blocks, (const __m128i *)m_key.begin(), m_rounds, inBlocks, xorBlocks, outBlocks, length, flags); +#endif + +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) + if (HasSSE2()) + { + if (length < BLOCKSIZE) + return length; + + struct Locals + { + word32 subkeys[4*12], workspace[8]; + const byte *inBlocks, *inXorBlocks, *outXorBlocks; + byte *outBlocks; + size_t inIncrement, inXorIncrement, outXorIncrement, outIncrement; + size_t regSpill, lengthAndCounterFlag, keysBegin; + }; + + size_t increment = BLOCKSIZE; + const byte* zeros = (byte *)(Te+256); + byte *space; + + do { + // https://msdn.microsoft.com/en-us/library/5471dc8s.aspx +#if (CRYPTOPP_MSC_VERION >= 1400) + space = (byte *)_malloca(255+sizeof(Locals)); + space += (256-(size_t)space%256)%256; +#else + space = (byte *)alloca(255+sizeof(Locals)); + space += (256-(size_t)space%256)%256; +#endif + } + while (AliasedWithTable(space, space+sizeof(Locals))); + + if (flags & BT_ReverseDirection) + { + assert(length % BLOCKSIZE == 0); + inBlocks += length - BLOCKSIZE; + xorBlocks += length - BLOCKSIZE; + outBlocks += length - BLOCKSIZE; + increment = 0-increment; + } + + Locals &locals = *(Locals *)space; + + locals.inBlocks = inBlocks; + locals.inXorBlocks = (flags & BT_XorInput) && xorBlocks ? xorBlocks : zeros; + locals.outXorBlocks = (flags & BT_XorInput) || !xorBlocks ? zeros : xorBlocks; + locals.outBlocks = outBlocks; + + locals.inIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : increment; + locals.inXorIncrement = (flags & BT_XorInput) && xorBlocks ? increment : 0; + locals.outXorIncrement = (flags & BT_XorInput) || !xorBlocks ? 0 : increment; + locals.outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : increment; + + locals.lengthAndCounterFlag = length - (length%16) - bool(flags & BT_InBlockIsCounter); + int keysToCopy = m_rounds - (flags & BT_InBlockIsCounter ? 3 : 2); + locals.keysBegin = (12-keysToCopy)*16; + + Rijndael_Enc_AdvancedProcessBlocks(&locals, m_key); + return length % BLOCKSIZE; + } +#endif + + return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags); +} + +#endif + +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + +size_t Rijndael::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const +{ + if (HasAESNI()) + return AESNI_AdvancedProcessBlocks(AESNI_Dec_Block, AESNI_Dec_4_Blocks, (const __m128i *)m_key.begin(), m_rounds, inBlocks, xorBlocks, outBlocks, length, flags); + + return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags); +} + +#endif // #if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + +NAMESPACE_END + +#endif +#endif diff --git a/external/crypto++-5.6.3/rijndael.h b/external/crypto++-5.6.3/rijndael.h new file mode 100644 index 000000000..2afa93092 --- /dev/null +++ b/external/crypto++-5.6.3/rijndael.h @@ -0,0 +1,83 @@ +// rijndael.h - written and placed in the public domain by Wei Dai + +//! \file rijndael.h +//! \brief Classes for Rijndael encryption algorithm +//! \details All key sizes are supported. The library only provides Rijndael with 128-bit blocks, +//! and not 192-bit or 256-bit blocks + +#ifndef CRYPTOPP_RIJNDAEL_H +#define CRYPTOPP_RIJNDAEL_H + +#include "seckey.h" +#include "secblock.h" + +#if CRYPTOPP_BOOL_X32 +# define CRYPTOPP_DISABLE_RIJNDAEL_ASM +#endif + +NAMESPACE_BEGIN(CryptoPP) + +//! \brief Rijndael block cipher information +struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8> +{ + CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return CRYPTOPP_RIJNDAEL_NAME;} +}; + +//! \brief Rijndael block cipher implementation details +//! \sa Rijndael +class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentation +{ + //! \brief Rijndael block cipher data processing functionss + //! \details Provides implementation common to encryption and decryption + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + static void FillEncTable(); + static void FillDecTable(); + + // VS2005 workaround: have to put these on separate lines, or error C2487 is triggered in DLL build + static const byte Se[256]; + static const byte Sd[256]; + + static const word32 rcon[]; + + unsigned int m_rounds; + FixedSizeAlignedSecBlock m_key; + }; + + //! \brief Rijndael block cipher data processing functions + //! \details Provides implementation for encryption transformation + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; +#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 + size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const; +#endif + }; + + //! \brief Rijndael block cipher data processing functions + //! \details Provides implementation for decryption transformation + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; +#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE + size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const; +#endif + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef Rijndael::Encryption RijndaelEncryption; +typedef Rijndael::Decryption RijndaelDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ripemd.cpp b/external/crypto++-5.6.3/ripemd.cpp new file mode 100644 index 000000000..3476aa8b5 --- /dev/null +++ b/external/crypto++-5.6.3/ripemd.cpp @@ -0,0 +1,803 @@ +// ripemd.cpp +// RIPEMD-160 written and placed in the public domain by Wei Dai +// RIPEMD-320, RIPEMD-128, RIPEMD-256 written by Kevin Springle +// and also placed in the public domain + +#include "pch.h" +#include "ripemd.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +#define F(x, y, z) (x ^ y ^ z) +#define G(x, y, z) (z ^ (x & (y^z))) +#define H(x, y, z) (z ^ (x | ~y)) +#define I(x, y, z) (y ^ (z & (x^y))) +#define J(x, y, z) (x ^ (y | ~z)) + +#define k0 0 +#define k1 0x5a827999UL +#define k2 0x6ed9eba1UL +#define k3 0x8f1bbcdcUL +#define k4 0xa953fd4eUL +#define k5 0x50a28be6UL +#define k6 0x5c4dd124UL +#define k7 0x6d703ef3UL +#define k8 0x7a6d76e9UL +#define k9 0 + +// ************************************************************* + +// for 160 and 320 +#define Subround(f, a, b, c, d, e, x, s, k) \ + a += f(b, c, d) + x + k;\ + a = rotlFixed((word32)a, s) + e;\ + c = rotlFixed((word32)c, 10U) + +void RIPEMD160::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xefcdab89L; + state[2] = 0x98badcfeL; + state[3] = 0x10325476L; + state[4] = 0xc3d2e1f0L; +} + +void RIPEMD160::Transform (word32 *digest, const word32 *X) +{ + unsigned long a1, b1, c1, d1, e1, a2, b2, c2, d2, e2; + a1 = a2 = digest[0]; + b1 = b2 = digest[1]; + c1 = c2 = digest[2]; + d1 = d2 = digest[3]; + e1 = e2 = digest[4]; + + Subround(F, a1, b1, c1, d1, e1, X[ 0], 11, k0); + Subround(F, e1, a1, b1, c1, d1, X[ 1], 14, k0); + Subround(F, d1, e1, a1, b1, c1, X[ 2], 15, k0); + Subround(F, c1, d1, e1, a1, b1, X[ 3], 12, k0); + Subround(F, b1, c1, d1, e1, a1, X[ 4], 5, k0); + Subround(F, a1, b1, c1, d1, e1, X[ 5], 8, k0); + Subround(F, e1, a1, b1, c1, d1, X[ 6], 7, k0); + Subround(F, d1, e1, a1, b1, c1, X[ 7], 9, k0); + Subround(F, c1, d1, e1, a1, b1, X[ 8], 11, k0); + Subround(F, b1, c1, d1, e1, a1, X[ 9], 13, k0); + Subround(F, a1, b1, c1, d1, e1, X[10], 14, k0); + Subround(F, e1, a1, b1, c1, d1, X[11], 15, k0); + Subround(F, d1, e1, a1, b1, c1, X[12], 6, k0); + Subround(F, c1, d1, e1, a1, b1, X[13], 7, k0); + Subround(F, b1, c1, d1, e1, a1, X[14], 9, k0); + Subround(F, a1, b1, c1, d1, e1, X[15], 8, k0); + + Subround(G, e1, a1, b1, c1, d1, X[ 7], 7, k1); + Subround(G, d1, e1, a1, b1, c1, X[ 4], 6, k1); + Subround(G, c1, d1, e1, a1, b1, X[13], 8, k1); + Subround(G, b1, c1, d1, e1, a1, X[ 1], 13, k1); + Subround(G, a1, b1, c1, d1, e1, X[10], 11, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 6], 9, k1); + Subround(G, d1, e1, a1, b1, c1, X[15], 7, k1); + Subround(G, c1, d1, e1, a1, b1, X[ 3], 15, k1); + Subround(G, b1, c1, d1, e1, a1, X[12], 7, k1); + Subround(G, a1, b1, c1, d1, e1, X[ 0], 12, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 9], 15, k1); + Subround(G, d1, e1, a1, b1, c1, X[ 5], 9, k1); + Subround(G, c1, d1, e1, a1, b1, X[ 2], 11, k1); + Subround(G, b1, c1, d1, e1, a1, X[14], 7, k1); + Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1); + + Subround(H, d1, e1, a1, b1, c1, X[ 3], 11, k2); + Subround(H, c1, d1, e1, a1, b1, X[10], 13, k2); + Subround(H, b1, c1, d1, e1, a1, X[14], 6, k2); + Subround(H, a1, b1, c1, d1, e1, X[ 4], 7, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 9], 14, k2); + Subround(H, d1, e1, a1, b1, c1, X[15], 9, k2); + Subround(H, c1, d1, e1, a1, b1, X[ 8], 13, k2); + Subround(H, b1, c1, d1, e1, a1, X[ 1], 15, k2); + Subround(H, a1, b1, c1, d1, e1, X[ 2], 14, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 7], 8, k2); + Subround(H, d1, e1, a1, b1, c1, X[ 0], 13, k2); + Subround(H, c1, d1, e1, a1, b1, X[ 6], 6, k2); + Subround(H, b1, c1, d1, e1, a1, X[13], 5, k2); + Subround(H, a1, b1, c1, d1, e1, X[11], 12, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 5], 7, k2); + Subround(H, d1, e1, a1, b1, c1, X[12], 5, k2); + + Subround(I, c1, d1, e1, a1, b1, X[ 1], 11, k3); + Subround(I, b1, c1, d1, e1, a1, X[ 9], 12, k3); + Subround(I, a1, b1, c1, d1, e1, X[11], 14, k3); + Subround(I, e1, a1, b1, c1, d1, X[10], 15, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 0], 14, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 8], 15, k3); + Subround(I, b1, c1, d1, e1, a1, X[12], 9, k3); + Subround(I, a1, b1, c1, d1, e1, X[ 4], 8, k3); + Subround(I, e1, a1, b1, c1, d1, X[13], 9, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 3], 14, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 7], 5, k3); + Subround(I, b1, c1, d1, e1, a1, X[15], 6, k3); + Subround(I, a1, b1, c1, d1, e1, X[14], 8, k3); + Subround(I, e1, a1, b1, c1, d1, X[ 5], 6, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 6], 5, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 2], 12, k3); + + Subround(J, b1, c1, d1, e1, a1, X[ 4], 9, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 0], 15, k4); + Subround(J, e1, a1, b1, c1, d1, X[ 5], 5, k4); + Subround(J, d1, e1, a1, b1, c1, X[ 9], 11, k4); + Subround(J, c1, d1, e1, a1, b1, X[ 7], 6, k4); + Subround(J, b1, c1, d1, e1, a1, X[12], 8, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 2], 13, k4); + Subround(J, e1, a1, b1, c1, d1, X[10], 12, k4); + Subround(J, d1, e1, a1, b1, c1, X[14], 5, k4); + Subround(J, c1, d1, e1, a1, b1, X[ 1], 12, k4); + Subround(J, b1, c1, d1, e1, a1, X[ 3], 13, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 8], 14, k4); + Subround(J, e1, a1, b1, c1, d1, X[11], 11, k4); + Subround(J, d1, e1, a1, b1, c1, X[ 6], 8, k4); + Subround(J, c1, d1, e1, a1, b1, X[15], 5, k4); + Subround(J, b1, c1, d1, e1, a1, X[13], 6, k4); + + Subround(J, a2, b2, c2, d2, e2, X[ 5], 8, k5); + Subround(J, e2, a2, b2, c2, d2, X[14], 9, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 7], 9, k5); + Subround(J, c2, d2, e2, a2, b2, X[ 0], 11, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 9], 13, k5); + Subround(J, a2, b2, c2, d2, e2, X[ 2], 15, k5); + Subround(J, e2, a2, b2, c2, d2, X[11], 15, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 4], 5, k5); + Subround(J, c2, d2, e2, a2, b2, X[13], 7, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 6], 7, k5); + Subround(J, a2, b2, c2, d2, e2, X[15], 8, k5); + Subround(J, e2, a2, b2, c2, d2, X[ 8], 11, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 1], 14, k5); + Subround(J, c2, d2, e2, a2, b2, X[10], 14, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5); + Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5); + + Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6); + Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6); + Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6); + Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6); + Subround(I, a2, b2, c2, d2, e2, X[ 0], 12, k6); + Subround(I, e2, a2, b2, c2, d2, X[13], 8, k6); + Subround(I, d2, e2, a2, b2, c2, X[ 5], 9, k6); + Subround(I, c2, d2, e2, a2, b2, X[10], 11, k6); + Subround(I, b2, c2, d2, e2, a2, X[14], 7, k6); + Subround(I, a2, b2, c2, d2, e2, X[15], 7, k6); + Subround(I, e2, a2, b2, c2, d2, X[ 8], 12, k6); + Subround(I, d2, e2, a2, b2, c2, X[12], 7, k6); + Subround(I, c2, d2, e2, a2, b2, X[ 4], 6, k6); + Subround(I, b2, c2, d2, e2, a2, X[ 9], 15, k6); + Subround(I, a2, b2, c2, d2, e2, X[ 1], 13, k6); + Subround(I, e2, a2, b2, c2, d2, X[ 2], 11, k6); + + Subround(H, d2, e2, a2, b2, c2, X[15], 9, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 5], 7, k7); + Subround(H, b2, c2, d2, e2, a2, X[ 1], 15, k7); + Subround(H, a2, b2, c2, d2, e2, X[ 3], 11, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 7], 8, k7); + Subround(H, d2, e2, a2, b2, c2, X[14], 6, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 6], 6, k7); + Subround(H, b2, c2, d2, e2, a2, X[ 9], 14, k7); + Subround(H, a2, b2, c2, d2, e2, X[11], 12, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 8], 13, k7); + Subround(H, d2, e2, a2, b2, c2, X[12], 5, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 2], 14, k7); + Subround(H, b2, c2, d2, e2, a2, X[10], 13, k7); + Subround(H, a2, b2, c2, d2, e2, X[ 0], 13, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 4], 7, k7); + Subround(H, d2, e2, a2, b2, c2, X[13], 5, k7); + + Subround(G, c2, d2, e2, a2, b2, X[ 8], 15, k8); + Subround(G, b2, c2, d2, e2, a2, X[ 6], 5, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 4], 8, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 1], 11, k8); + Subround(G, d2, e2, a2, b2, c2, X[ 3], 14, k8); + Subround(G, c2, d2, e2, a2, b2, X[11], 14, k8); + Subround(G, b2, c2, d2, e2, a2, X[15], 6, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 0], 14, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 5], 6, k8); + Subround(G, d2, e2, a2, b2, c2, X[12], 9, k8); + Subround(G, c2, d2, e2, a2, b2, X[ 2], 12, k8); + Subround(G, b2, c2, d2, e2, a2, X[13], 9, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 9], 12, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 7], 5, k8); + Subround(G, d2, e2, a2, b2, c2, X[10], 15, k8); + Subround(G, c2, d2, e2, a2, b2, X[14], 8, k8); + + Subround(F, b2, c2, d2, e2, a2, X[12], 8, k9); + Subround(F, a2, b2, c2, d2, e2, X[15], 5, k9); + Subround(F, e2, a2, b2, c2, d2, X[10], 12, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 4], 9, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 1], 12, k9); + Subround(F, b2, c2, d2, e2, a2, X[ 5], 5, k9); + Subround(F, a2, b2, c2, d2, e2, X[ 8], 14, k9); + Subround(F, e2, a2, b2, c2, d2, X[ 7], 6, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 6], 8, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 2], 13, k9); + Subround(F, b2, c2, d2, e2, a2, X[13], 6, k9); + Subround(F, a2, b2, c2, d2, e2, X[14], 5, k9); + Subround(F, e2, a2, b2, c2, d2, X[ 0], 15, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 3], 13, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 9], 11, k9); + Subround(F, b2, c2, d2, e2, a2, X[11], 11, k9); + + c1 = digest[1] + c1 + d2; + digest[1] = digest[2] + d1 + e2; + digest[2] = digest[3] + e1 + a2; + digest[3] = digest[4] + a1 + b2; + digest[4] = digest[0] + b1 + c2; + digest[0] = c1; +} + +// ************************************************************* + +void RIPEMD320::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xefcdab89L; + state[2] = 0x98badcfeL; + state[3] = 0x10325476L; + state[4] = 0xc3d2e1f0L; + state[5] = 0x76543210L; + state[6] = 0xfedcba98L; + state[7] = 0x89abcdefL; + state[8] = 0x01234567L; + state[9] = 0x3c2d1e0fL; +} + +void RIPEMD320::Transform (word32 *digest, const word32 *X) +{ + unsigned long a1, b1, c1, d1, e1, a2, b2, c2, d2, e2, t; + a1 = digest[0]; + b1 = digest[1]; + c1 = digest[2]; + d1 = digest[3]; + e1 = digest[4]; + a2 = digest[5]; + b2 = digest[6]; + c2 = digest[7]; + d2 = digest[8]; + e2 = digest[9]; + + Subround(F, a1, b1, c1, d1, e1, X[ 0], 11, k0); + Subround(F, e1, a1, b1, c1, d1, X[ 1], 14, k0); + Subround(F, d1, e1, a1, b1, c1, X[ 2], 15, k0); + Subround(F, c1, d1, e1, a1, b1, X[ 3], 12, k0); + Subround(F, b1, c1, d1, e1, a1, X[ 4], 5, k0); + Subround(F, a1, b1, c1, d1, e1, X[ 5], 8, k0); + Subround(F, e1, a1, b1, c1, d1, X[ 6], 7, k0); + Subround(F, d1, e1, a1, b1, c1, X[ 7], 9, k0); + Subround(F, c1, d1, e1, a1, b1, X[ 8], 11, k0); + Subround(F, b1, c1, d1, e1, a1, X[ 9], 13, k0); + Subround(F, a1, b1, c1, d1, e1, X[10], 14, k0); + Subround(F, e1, a1, b1, c1, d1, X[11], 15, k0); + Subround(F, d1, e1, a1, b1, c1, X[12], 6, k0); + Subround(F, c1, d1, e1, a1, b1, X[13], 7, k0); + Subround(F, b1, c1, d1, e1, a1, X[14], 9, k0); + Subround(F, a1, b1, c1, d1, e1, X[15], 8, k0); + + Subround(J, a2, b2, c2, d2, e2, X[ 5], 8, k5); + Subround(J, e2, a2, b2, c2, d2, X[14], 9, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 7], 9, k5); + Subround(J, c2, d2, e2, a2, b2, X[ 0], 11, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 9], 13, k5); + Subround(J, a2, b2, c2, d2, e2, X[ 2], 15, k5); + Subround(J, e2, a2, b2, c2, d2, X[11], 15, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 4], 5, k5); + Subround(J, c2, d2, e2, a2, b2, X[13], 7, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 6], 7, k5); + Subround(J, a2, b2, c2, d2, e2, X[15], 8, k5); + Subround(J, e2, a2, b2, c2, d2, X[ 8], 11, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 1], 14, k5); + Subround(J, c2, d2, e2, a2, b2, X[10], 14, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5); + Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5); + + t = a1; a1 = a2; a2 = t; + + Subround(G, e1, a1, b1, c1, d1, X[ 7], 7, k1); + Subround(G, d1, e1, a1, b1, c1, X[ 4], 6, k1); + Subround(G, c1, d1, e1, a1, b1, X[13], 8, k1); + Subround(G, b1, c1, d1, e1, a1, X[ 1], 13, k1); + Subround(G, a1, b1, c1, d1, e1, X[10], 11, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 6], 9, k1); + Subround(G, d1, e1, a1, b1, c1, X[15], 7, k1); + Subround(G, c1, d1, e1, a1, b1, X[ 3], 15, k1); + Subround(G, b1, c1, d1, e1, a1, X[12], 7, k1); + Subround(G, a1, b1, c1, d1, e1, X[ 0], 12, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 9], 15, k1); + Subround(G, d1, e1, a1, b1, c1, X[ 5], 9, k1); + Subround(G, c1, d1, e1, a1, b1, X[ 2], 11, k1); + Subround(G, b1, c1, d1, e1, a1, X[14], 7, k1); + Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1); + + Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6); + Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6); + Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6); + Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6); + Subround(I, a2, b2, c2, d2, e2, X[ 0], 12, k6); + Subround(I, e2, a2, b2, c2, d2, X[13], 8, k6); + Subround(I, d2, e2, a2, b2, c2, X[ 5], 9, k6); + Subround(I, c2, d2, e2, a2, b2, X[10], 11, k6); + Subround(I, b2, c2, d2, e2, a2, X[14], 7, k6); + Subround(I, a2, b2, c2, d2, e2, X[15], 7, k6); + Subround(I, e2, a2, b2, c2, d2, X[ 8], 12, k6); + Subround(I, d2, e2, a2, b2, c2, X[12], 7, k6); + Subround(I, c2, d2, e2, a2, b2, X[ 4], 6, k6); + Subround(I, b2, c2, d2, e2, a2, X[ 9], 15, k6); + Subround(I, a2, b2, c2, d2, e2, X[ 1], 13, k6); + Subround(I, e2, a2, b2, c2, d2, X[ 2], 11, k6); + + t = b1; b1 = b2; b2 = t; + + Subround(H, d1, e1, a1, b1, c1, X[ 3], 11, k2); + Subround(H, c1, d1, e1, a1, b1, X[10], 13, k2); + Subround(H, b1, c1, d1, e1, a1, X[14], 6, k2); + Subround(H, a1, b1, c1, d1, e1, X[ 4], 7, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 9], 14, k2); + Subround(H, d1, e1, a1, b1, c1, X[15], 9, k2); + Subround(H, c1, d1, e1, a1, b1, X[ 8], 13, k2); + Subround(H, b1, c1, d1, e1, a1, X[ 1], 15, k2); + Subround(H, a1, b1, c1, d1, e1, X[ 2], 14, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 7], 8, k2); + Subround(H, d1, e1, a1, b1, c1, X[ 0], 13, k2); + Subround(H, c1, d1, e1, a1, b1, X[ 6], 6, k2); + Subround(H, b1, c1, d1, e1, a1, X[13], 5, k2); + Subround(H, a1, b1, c1, d1, e1, X[11], 12, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 5], 7, k2); + Subround(H, d1, e1, a1, b1, c1, X[12], 5, k2); + + Subround(H, d2, e2, a2, b2, c2, X[15], 9, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 5], 7, k7); + Subround(H, b2, c2, d2, e2, a2, X[ 1], 15, k7); + Subround(H, a2, b2, c2, d2, e2, X[ 3], 11, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 7], 8, k7); + Subround(H, d2, e2, a2, b2, c2, X[14], 6, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 6], 6, k7); + Subround(H, b2, c2, d2, e2, a2, X[ 9], 14, k7); + Subround(H, a2, b2, c2, d2, e2, X[11], 12, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 8], 13, k7); + Subround(H, d2, e2, a2, b2, c2, X[12], 5, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 2], 14, k7); + Subround(H, b2, c2, d2, e2, a2, X[10], 13, k7); + Subround(H, a2, b2, c2, d2, e2, X[ 0], 13, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 4], 7, k7); + Subround(H, d2, e2, a2, b2, c2, X[13], 5, k7); + + t = c1; c1 = c2; c2 = t; + + Subround(I, c1, d1, e1, a1, b1, X[ 1], 11, k3); + Subround(I, b1, c1, d1, e1, a1, X[ 9], 12, k3); + Subround(I, a1, b1, c1, d1, e1, X[11], 14, k3); + Subround(I, e1, a1, b1, c1, d1, X[10], 15, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 0], 14, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 8], 15, k3); + Subround(I, b1, c1, d1, e1, a1, X[12], 9, k3); + Subround(I, a1, b1, c1, d1, e1, X[ 4], 8, k3); + Subround(I, e1, a1, b1, c1, d1, X[13], 9, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 3], 14, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 7], 5, k3); + Subround(I, b1, c1, d1, e1, a1, X[15], 6, k3); + Subround(I, a1, b1, c1, d1, e1, X[14], 8, k3); + Subround(I, e1, a1, b1, c1, d1, X[ 5], 6, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 6], 5, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 2], 12, k3); + + Subround(G, c2, d2, e2, a2, b2, X[ 8], 15, k8); + Subround(G, b2, c2, d2, e2, a2, X[ 6], 5, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 4], 8, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 1], 11, k8); + Subround(G, d2, e2, a2, b2, c2, X[ 3], 14, k8); + Subround(G, c2, d2, e2, a2, b2, X[11], 14, k8); + Subround(G, b2, c2, d2, e2, a2, X[15], 6, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 0], 14, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 5], 6, k8); + Subround(G, d2, e2, a2, b2, c2, X[12], 9, k8); + Subround(G, c2, d2, e2, a2, b2, X[ 2], 12, k8); + Subround(G, b2, c2, d2, e2, a2, X[13], 9, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 9], 12, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 7], 5, k8); + Subround(G, d2, e2, a2, b2, c2, X[10], 15, k8); + Subround(G, c2, d2, e2, a2, b2, X[14], 8, k8); + + t = d1; d1 = d2; d2 = t; + + Subround(J, b1, c1, d1, e1, a1, X[ 4], 9, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 0], 15, k4); + Subround(J, e1, a1, b1, c1, d1, X[ 5], 5, k4); + Subround(J, d1, e1, a1, b1, c1, X[ 9], 11, k4); + Subround(J, c1, d1, e1, a1, b1, X[ 7], 6, k4); + Subround(J, b1, c1, d1, e1, a1, X[12], 8, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 2], 13, k4); + Subround(J, e1, a1, b1, c1, d1, X[10], 12, k4); + Subround(J, d1, e1, a1, b1, c1, X[14], 5, k4); + Subround(J, c1, d1, e1, a1, b1, X[ 1], 12, k4); + Subround(J, b1, c1, d1, e1, a1, X[ 3], 13, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 8], 14, k4); + Subround(J, e1, a1, b1, c1, d1, X[11], 11, k4); + Subround(J, d1, e1, a1, b1, c1, X[ 6], 8, k4); + Subround(J, c1, d1, e1, a1, b1, X[15], 5, k4); + Subround(J, b1, c1, d1, e1, a1, X[13], 6, k4); + + Subround(F, b2, c2, d2, e2, a2, X[12], 8, k9); + Subround(F, a2, b2, c2, d2, e2, X[15], 5, k9); + Subround(F, e2, a2, b2, c2, d2, X[10], 12, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 4], 9, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 1], 12, k9); + Subround(F, b2, c2, d2, e2, a2, X[ 5], 5, k9); + Subround(F, a2, b2, c2, d2, e2, X[ 8], 14, k9); + Subround(F, e2, a2, b2, c2, d2, X[ 7], 6, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 6], 8, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 2], 13, k9); + Subround(F, b2, c2, d2, e2, a2, X[13], 6, k9); + Subround(F, a2, b2, c2, d2, e2, X[14], 5, k9); + Subround(F, e2, a2, b2, c2, d2, X[ 0], 15, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 3], 13, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 9], 11, k9); + Subround(F, b2, c2, d2, e2, a2, X[11], 11, k9); + + t = e1; e1 = e2; e2 = t; + + digest[0] += a1; + digest[1] += b1; + digest[2] += c1; + digest[3] += d1; + digest[4] += e1; + digest[5] += a2; + digest[6] += b2; + digest[7] += c2; + digest[8] += d2; + digest[9] += e2; +} + +#undef Subround + +// ************************************************************* + +// for 128 and 256 +#define Subround(f, a, b, c, d, x, s, k) \ + a += f(b, c, d) + x + k;\ + a = rotlFixed((word32)a, s); + +void RIPEMD128::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xefcdab89L; + state[2] = 0x98badcfeL; + state[3] = 0x10325476L; +} + +void RIPEMD128::Transform (word32 *digest, const word32 *X) +{ + unsigned long a1, b1, c1, d1, a2, b2, c2, d2; + a1 = a2 = digest[0]; + b1 = b2 = digest[1]; + c1 = c2 = digest[2]; + d1 = d2 = digest[3]; + + Subround(F, a1, b1, c1, d1, X[ 0], 11, k0); + Subround(F, d1, a1, b1, c1, X[ 1], 14, k0); + Subround(F, c1, d1, a1, b1, X[ 2], 15, k0); + Subround(F, b1, c1, d1, a1, X[ 3], 12, k0); + Subround(F, a1, b1, c1, d1, X[ 4], 5, k0); + Subround(F, d1, a1, b1, c1, X[ 5], 8, k0); + Subround(F, c1, d1, a1, b1, X[ 6], 7, k0); + Subround(F, b1, c1, d1, a1, X[ 7], 9, k0); + Subround(F, a1, b1, c1, d1, X[ 8], 11, k0); + Subround(F, d1, a1, b1, c1, X[ 9], 13, k0); + Subround(F, c1, d1, a1, b1, X[10], 14, k0); + Subround(F, b1, c1, d1, a1, X[11], 15, k0); + Subround(F, a1, b1, c1, d1, X[12], 6, k0); + Subround(F, d1, a1, b1, c1, X[13], 7, k0); + Subround(F, c1, d1, a1, b1, X[14], 9, k0); + Subround(F, b1, c1, d1, a1, X[15], 8, k0); + + Subround(G, a1, b1, c1, d1, X[ 7], 7, k1); + Subround(G, d1, a1, b1, c1, X[ 4], 6, k1); + Subround(G, c1, d1, a1, b1, X[13], 8, k1); + Subround(G, b1, c1, d1, a1, X[ 1], 13, k1); + Subround(G, a1, b1, c1, d1, X[10], 11, k1); + Subround(G, d1, a1, b1, c1, X[ 6], 9, k1); + Subround(G, c1, d1, a1, b1, X[15], 7, k1); + Subround(G, b1, c1, d1, a1, X[ 3], 15, k1); + Subround(G, a1, b1, c1, d1, X[12], 7, k1); + Subround(G, d1, a1, b1, c1, X[ 0], 12, k1); + Subround(G, c1, d1, a1, b1, X[ 9], 15, k1); + Subround(G, b1, c1, d1, a1, X[ 5], 9, k1); + Subround(G, a1, b1, c1, d1, X[ 2], 11, k1); + Subround(G, d1, a1, b1, c1, X[14], 7, k1); + Subround(G, c1, d1, a1, b1, X[11], 13, k1); + Subround(G, b1, c1, d1, a1, X[ 8], 12, k1); + + Subround(H, a1, b1, c1, d1, X[ 3], 11, k2); + Subround(H, d1, a1, b1, c1, X[10], 13, k2); + Subround(H, c1, d1, a1, b1, X[14], 6, k2); + Subround(H, b1, c1, d1, a1, X[ 4], 7, k2); + Subround(H, a1, b1, c1, d1, X[ 9], 14, k2); + Subround(H, d1, a1, b1, c1, X[15], 9, k2); + Subround(H, c1, d1, a1, b1, X[ 8], 13, k2); + Subround(H, b1, c1, d1, a1, X[ 1], 15, k2); + Subround(H, a1, b1, c1, d1, X[ 2], 14, k2); + Subround(H, d1, a1, b1, c1, X[ 7], 8, k2); + Subround(H, c1, d1, a1, b1, X[ 0], 13, k2); + Subround(H, b1, c1, d1, a1, X[ 6], 6, k2); + Subround(H, a1, b1, c1, d1, X[13], 5, k2); + Subround(H, d1, a1, b1, c1, X[11], 12, k2); + Subround(H, c1, d1, a1, b1, X[ 5], 7, k2); + Subround(H, b1, c1, d1, a1, X[12], 5, k2); + + Subround(I, a1, b1, c1, d1, X[ 1], 11, k3); + Subround(I, d1, a1, b1, c1, X[ 9], 12, k3); + Subround(I, c1, d1, a1, b1, X[11], 14, k3); + Subround(I, b1, c1, d1, a1, X[10], 15, k3); + Subround(I, a1, b1, c1, d1, X[ 0], 14, k3); + Subround(I, d1, a1, b1, c1, X[ 8], 15, k3); + Subround(I, c1, d1, a1, b1, X[12], 9, k3); + Subround(I, b1, c1, d1, a1, X[ 4], 8, k3); + Subround(I, a1, b1, c1, d1, X[13], 9, k3); + Subround(I, d1, a1, b1, c1, X[ 3], 14, k3); + Subround(I, c1, d1, a1, b1, X[ 7], 5, k3); + Subround(I, b1, c1, d1, a1, X[15], 6, k3); + Subround(I, a1, b1, c1, d1, X[14], 8, k3); + Subround(I, d1, a1, b1, c1, X[ 5], 6, k3); + Subround(I, c1, d1, a1, b1, X[ 6], 5, k3); + Subround(I, b1, c1, d1, a1, X[ 2], 12, k3); + + Subround(I, a2, b2, c2, d2, X[ 5], 8, k5); + Subround(I, d2, a2, b2, c2, X[14], 9, k5); + Subround(I, c2, d2, a2, b2, X[ 7], 9, k5); + Subround(I, b2, c2, d2, a2, X[ 0], 11, k5); + Subround(I, a2, b2, c2, d2, X[ 9], 13, k5); + Subround(I, d2, a2, b2, c2, X[ 2], 15, k5); + Subround(I, c2, d2, a2, b2, X[11], 15, k5); + Subround(I, b2, c2, d2, a2, X[ 4], 5, k5); + Subround(I, a2, b2, c2, d2, X[13], 7, k5); + Subround(I, d2, a2, b2, c2, X[ 6], 7, k5); + Subround(I, c2, d2, a2, b2, X[15], 8, k5); + Subround(I, b2, c2, d2, a2, X[ 8], 11, k5); + Subround(I, a2, b2, c2, d2, X[ 1], 14, k5); + Subround(I, d2, a2, b2, c2, X[10], 14, k5); + Subround(I, c2, d2, a2, b2, X[ 3], 12, k5); + Subround(I, b2, c2, d2, a2, X[12], 6, k5); + + Subround(H, a2, b2, c2, d2, X[ 6], 9, k6); + Subround(H, d2, a2, b2, c2, X[11], 13, k6); + Subround(H, c2, d2, a2, b2, X[ 3], 15, k6); + Subround(H, b2, c2, d2, a2, X[ 7], 7, k6); + Subround(H, a2, b2, c2, d2, X[ 0], 12, k6); + Subround(H, d2, a2, b2, c2, X[13], 8, k6); + Subround(H, c2, d2, a2, b2, X[ 5], 9, k6); + Subround(H, b2, c2, d2, a2, X[10], 11, k6); + Subround(H, a2, b2, c2, d2, X[14], 7, k6); + Subround(H, d2, a2, b2, c2, X[15], 7, k6); + Subround(H, c2, d2, a2, b2, X[ 8], 12, k6); + Subround(H, b2, c2, d2, a2, X[12], 7, k6); + Subround(H, a2, b2, c2, d2, X[ 4], 6, k6); + Subround(H, d2, a2, b2, c2, X[ 9], 15, k6); + Subround(H, c2, d2, a2, b2, X[ 1], 13, k6); + Subround(H, b2, c2, d2, a2, X[ 2], 11, k6); + + Subround(G, a2, b2, c2, d2, X[15], 9, k7); + Subround(G, d2, a2, b2, c2, X[ 5], 7, k7); + Subround(G, c2, d2, a2, b2, X[ 1], 15, k7); + Subround(G, b2, c2, d2, a2, X[ 3], 11, k7); + Subround(G, a2, b2, c2, d2, X[ 7], 8, k7); + Subround(G, d2, a2, b2, c2, X[14], 6, k7); + Subround(G, c2, d2, a2, b2, X[ 6], 6, k7); + Subround(G, b2, c2, d2, a2, X[ 9], 14, k7); + Subround(G, a2, b2, c2, d2, X[11], 12, k7); + Subround(G, d2, a2, b2, c2, X[ 8], 13, k7); + Subround(G, c2, d2, a2, b2, X[12], 5, k7); + Subround(G, b2, c2, d2, a2, X[ 2], 14, k7); + Subround(G, a2, b2, c2, d2, X[10], 13, k7); + Subround(G, d2, a2, b2, c2, X[ 0], 13, k7); + Subround(G, c2, d2, a2, b2, X[ 4], 7, k7); + Subround(G, b2, c2, d2, a2, X[13], 5, k7); + + Subround(F, a2, b2, c2, d2, X[ 8], 15, k9); + Subround(F, d2, a2, b2, c2, X[ 6], 5, k9); + Subround(F, c2, d2, a2, b2, X[ 4], 8, k9); + Subround(F, b2, c2, d2, a2, X[ 1], 11, k9); + Subround(F, a2, b2, c2, d2, X[ 3], 14, k9); + Subround(F, d2, a2, b2, c2, X[11], 14, k9); + Subround(F, c2, d2, a2, b2, X[15], 6, k9); + Subround(F, b2, c2, d2, a2, X[ 0], 14, k9); + Subround(F, a2, b2, c2, d2, X[ 5], 6, k9); + Subround(F, d2, a2, b2, c2, X[12], 9, k9); + Subround(F, c2, d2, a2, b2, X[ 2], 12, k9); + Subround(F, b2, c2, d2, a2, X[13], 9, k9); + Subround(F, a2, b2, c2, d2, X[ 9], 12, k9); + Subround(F, d2, a2, b2, c2, X[ 7], 5, k9); + Subround(F, c2, d2, a2, b2, X[10], 15, k9); + Subround(F, b2, c2, d2, a2, X[14], 8, k9); + + c1 = digest[1] + c1 + d2; + digest[1] = digest[2] + d1 + a2; + digest[2] = digest[3] + a1 + b2; + digest[3] = digest[0] + b1 + c2; + digest[0] = c1; +} + +// ************************************************************* + +void RIPEMD256::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xefcdab89L; + state[2] = 0x98badcfeL; + state[3] = 0x10325476L; + state[4] = 0x76543210L; + state[5] = 0xfedcba98L; + state[6] = 0x89abcdefL; + state[7] = 0x01234567L; +} + +void RIPEMD256::Transform (word32 *digest, const word32 *X) +{ + unsigned long a1, b1, c1, d1, a2, b2, c2, d2, t; + a1 = digest[0]; + b1 = digest[1]; + c1 = digest[2]; + d1 = digest[3]; + a2 = digest[4]; + b2 = digest[5]; + c2 = digest[6]; + d2 = digest[7]; + + Subround(F, a1, b1, c1, d1, X[ 0], 11, k0); + Subround(F, d1, a1, b1, c1, X[ 1], 14, k0); + Subround(F, c1, d1, a1, b1, X[ 2], 15, k0); + Subround(F, b1, c1, d1, a1, X[ 3], 12, k0); + Subround(F, a1, b1, c1, d1, X[ 4], 5, k0); + Subround(F, d1, a1, b1, c1, X[ 5], 8, k0); + Subround(F, c1, d1, a1, b1, X[ 6], 7, k0); + Subround(F, b1, c1, d1, a1, X[ 7], 9, k0); + Subround(F, a1, b1, c1, d1, X[ 8], 11, k0); + Subround(F, d1, a1, b1, c1, X[ 9], 13, k0); + Subround(F, c1, d1, a1, b1, X[10], 14, k0); + Subround(F, b1, c1, d1, a1, X[11], 15, k0); + Subround(F, a1, b1, c1, d1, X[12], 6, k0); + Subround(F, d1, a1, b1, c1, X[13], 7, k0); + Subround(F, c1, d1, a1, b1, X[14], 9, k0); + Subround(F, b1, c1, d1, a1, X[15], 8, k0); + + Subround(I, a2, b2, c2, d2, X[ 5], 8, k5); + Subround(I, d2, a2, b2, c2, X[14], 9, k5); + Subround(I, c2, d2, a2, b2, X[ 7], 9, k5); + Subround(I, b2, c2, d2, a2, X[ 0], 11, k5); + Subround(I, a2, b2, c2, d2, X[ 9], 13, k5); + Subround(I, d2, a2, b2, c2, X[ 2], 15, k5); + Subround(I, c2, d2, a2, b2, X[11], 15, k5); + Subround(I, b2, c2, d2, a2, X[ 4], 5, k5); + Subround(I, a2, b2, c2, d2, X[13], 7, k5); + Subround(I, d2, a2, b2, c2, X[ 6], 7, k5); + Subround(I, c2, d2, a2, b2, X[15], 8, k5); + Subround(I, b2, c2, d2, a2, X[ 8], 11, k5); + Subround(I, a2, b2, c2, d2, X[ 1], 14, k5); + Subround(I, d2, a2, b2, c2, X[10], 14, k5); + Subround(I, c2, d2, a2, b2, X[ 3], 12, k5); + Subround(I, b2, c2, d2, a2, X[12], 6, k5); + + t = a1; a1 = a2; a2 = t; + + Subround(G, a1, b1, c1, d1, X[ 7], 7, k1); + Subround(G, d1, a1, b1, c1, X[ 4], 6, k1); + Subround(G, c1, d1, a1, b1, X[13], 8, k1); + Subround(G, b1, c1, d1, a1, X[ 1], 13, k1); + Subround(G, a1, b1, c1, d1, X[10], 11, k1); + Subround(G, d1, a1, b1, c1, X[ 6], 9, k1); + Subround(G, c1, d1, a1, b1, X[15], 7, k1); + Subround(G, b1, c1, d1, a1, X[ 3], 15, k1); + Subround(G, a1, b1, c1, d1, X[12], 7, k1); + Subround(G, d1, a1, b1, c1, X[ 0], 12, k1); + Subround(G, c1, d1, a1, b1, X[ 9], 15, k1); + Subround(G, b1, c1, d1, a1, X[ 5], 9, k1); + Subround(G, a1, b1, c1, d1, X[ 2], 11, k1); + Subround(G, d1, a1, b1, c1, X[14], 7, k1); + Subround(G, c1, d1, a1, b1, X[11], 13, k1); + Subround(G, b1, c1, d1, a1, X[ 8], 12, k1); + + Subround(H, a2, b2, c2, d2, X[ 6], 9, k6); + Subround(H, d2, a2, b2, c2, X[11], 13, k6); + Subround(H, c2, d2, a2, b2, X[ 3], 15, k6); + Subround(H, b2, c2, d2, a2, X[ 7], 7, k6); + Subround(H, a2, b2, c2, d2, X[ 0], 12, k6); + Subround(H, d2, a2, b2, c2, X[13], 8, k6); + Subround(H, c2, d2, a2, b2, X[ 5], 9, k6); + Subround(H, b2, c2, d2, a2, X[10], 11, k6); + Subround(H, a2, b2, c2, d2, X[14], 7, k6); + Subround(H, d2, a2, b2, c2, X[15], 7, k6); + Subround(H, c2, d2, a2, b2, X[ 8], 12, k6); + Subround(H, b2, c2, d2, a2, X[12], 7, k6); + Subround(H, a2, b2, c2, d2, X[ 4], 6, k6); + Subround(H, d2, a2, b2, c2, X[ 9], 15, k6); + Subround(H, c2, d2, a2, b2, X[ 1], 13, k6); + Subround(H, b2, c2, d2, a2, X[ 2], 11, k6); + + t = b1; b1 = b2; b2 = t; + + Subround(H, a1, b1, c1, d1, X[ 3], 11, k2); + Subround(H, d1, a1, b1, c1, X[10], 13, k2); + Subround(H, c1, d1, a1, b1, X[14], 6, k2); + Subround(H, b1, c1, d1, a1, X[ 4], 7, k2); + Subround(H, a1, b1, c1, d1, X[ 9], 14, k2); + Subround(H, d1, a1, b1, c1, X[15], 9, k2); + Subround(H, c1, d1, a1, b1, X[ 8], 13, k2); + Subround(H, b1, c1, d1, a1, X[ 1], 15, k2); + Subround(H, a1, b1, c1, d1, X[ 2], 14, k2); + Subround(H, d1, a1, b1, c1, X[ 7], 8, k2); + Subround(H, c1, d1, a1, b1, X[ 0], 13, k2); + Subround(H, b1, c1, d1, a1, X[ 6], 6, k2); + Subround(H, a1, b1, c1, d1, X[13], 5, k2); + Subround(H, d1, a1, b1, c1, X[11], 12, k2); + Subround(H, c1, d1, a1, b1, X[ 5], 7, k2); + Subround(H, b1, c1, d1, a1, X[12], 5, k2); + + Subround(G, a2, b2, c2, d2, X[15], 9, k7); + Subround(G, d2, a2, b2, c2, X[ 5], 7, k7); + Subround(G, c2, d2, a2, b2, X[ 1], 15, k7); + Subround(G, b2, c2, d2, a2, X[ 3], 11, k7); + Subround(G, a2, b2, c2, d2, X[ 7], 8, k7); + Subround(G, d2, a2, b2, c2, X[14], 6, k7); + Subround(G, c2, d2, a2, b2, X[ 6], 6, k7); + Subround(G, b2, c2, d2, a2, X[ 9], 14, k7); + Subround(G, a2, b2, c2, d2, X[11], 12, k7); + Subround(G, d2, a2, b2, c2, X[ 8], 13, k7); + Subround(G, c2, d2, a2, b2, X[12], 5, k7); + Subround(G, b2, c2, d2, a2, X[ 2], 14, k7); + Subround(G, a2, b2, c2, d2, X[10], 13, k7); + Subround(G, d2, a2, b2, c2, X[ 0], 13, k7); + Subround(G, c2, d2, a2, b2, X[ 4], 7, k7); + Subround(G, b2, c2, d2, a2, X[13], 5, k7); + + t = c1; c1 = c2; c2 = t; + + Subround(I, a1, b1, c1, d1, X[ 1], 11, k3); + Subround(I, d1, a1, b1, c1, X[ 9], 12, k3); + Subround(I, c1, d1, a1, b1, X[11], 14, k3); + Subround(I, b1, c1, d1, a1, X[10], 15, k3); + Subround(I, a1, b1, c1, d1, X[ 0], 14, k3); + Subround(I, d1, a1, b1, c1, X[ 8], 15, k3); + Subround(I, c1, d1, a1, b1, X[12], 9, k3); + Subround(I, b1, c1, d1, a1, X[ 4], 8, k3); + Subround(I, a1, b1, c1, d1, X[13], 9, k3); + Subround(I, d1, a1, b1, c1, X[ 3], 14, k3); + Subround(I, c1, d1, a1, b1, X[ 7], 5, k3); + Subround(I, b1, c1, d1, a1, X[15], 6, k3); + Subround(I, a1, b1, c1, d1, X[14], 8, k3); + Subround(I, d1, a1, b1, c1, X[ 5], 6, k3); + Subround(I, c1, d1, a1, b1, X[ 6], 5, k3); + Subround(I, b1, c1, d1, a1, X[ 2], 12, k3); + + Subround(F, a2, b2, c2, d2, X[ 8], 15, k9); + Subround(F, d2, a2, b2, c2, X[ 6], 5, k9); + Subround(F, c2, d2, a2, b2, X[ 4], 8, k9); + Subround(F, b2, c2, d2, a2, X[ 1], 11, k9); + Subround(F, a2, b2, c2, d2, X[ 3], 14, k9); + Subround(F, d2, a2, b2, c2, X[11], 14, k9); + Subround(F, c2, d2, a2, b2, X[15], 6, k9); + Subround(F, b2, c2, d2, a2, X[ 0], 14, k9); + Subround(F, a2, b2, c2, d2, X[ 5], 6, k9); + Subround(F, d2, a2, b2, c2, X[12], 9, k9); + Subround(F, c2, d2, a2, b2, X[ 2], 12, k9); + Subround(F, b2, c2, d2, a2, X[13], 9, k9); + Subround(F, a2, b2, c2, d2, X[ 9], 12, k9); + Subround(F, d2, a2, b2, c2, X[ 7], 5, k9); + Subround(F, c2, d2, a2, b2, X[10], 15, k9); + Subround(F, b2, c2, d2, a2, X[14], 8, k9); + + t = d1; d1 = d2; d2 = t; + + digest[0] += a1; + digest[1] += b1; + digest[2] += c1; + digest[3] += d1; + digest[4] += a2; + digest[5] += b2; + digest[6] += c2; + digest[7] += d2; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/ripemd.h b/external/crypto++-5.6.3/ripemd.h new file mode 100644 index 000000000..302ecedd7 --- /dev/null +++ b/external/crypto++-5.6.3/ripemd.h @@ -0,0 +1,54 @@ +// ripemd.h - written and placed in the public domain by Wei Dai + +//! \file +//! \brief Classes for RIPEMD message digest + +#ifndef CRYPTOPP_RIPEMD_H +#define CRYPTOPP_RIPEMD_H + +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! RIPEMD-160 +/*! Digest Length = 160 bits */ +class RIPEMD160 : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word32 *digest, const word32 *data); + static const char * StaticAlgorithmName() {return "RIPEMD-160";} +}; + +/*! Digest Length = 320 bits, Security is similar to RIPEMD-160 */ +class RIPEMD320 : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word32 *digest, const word32 *data); + static const char * StaticAlgorithmName() {return "RIPEMD-320";} +}; + +/*! \warning RIPEMD-128 is considered insecure, and should not be used + unless you absolutely need it for compatibility. */ +class RIPEMD128 : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word32 *digest, const word32 *data); + static const char * StaticAlgorithmName() {return "RIPEMD-128";} +}; + +/*! \warning RIPEMD-256 is considered insecure, and should not be used + unless you absolutely need it for compatibility. */ +class RIPEMD256 : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word32 *digest, const word32 *data); + static const char * StaticAlgorithmName() {return "RIPEMD-256";} +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rng.cpp b/external/crypto++-5.6.3/rng.cpp new file mode 100644 index 000000000..f3d5cbd1f --- /dev/null +++ b/external/crypto++-5.6.3/rng.cpp @@ -0,0 +1,155 @@ +// rng.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "rng.h" +#include "fips140.h" + +#include +#include + +NAMESPACE_BEGIN(CryptoPP) + +// linear congruential generator +// originally by William S. England + +// do not use for cryptographic purposes + +/* +** Original_numbers are the original published m and q in the +** ACM article above. John Burton has furnished numbers for +** a reportedly better generator. The new numbers are now +** used in this program by default. +*/ + +#ifndef LCRNG_ORIGINAL_NUMBERS +const word32 LC_RNG::m=2147483647L; +const word32 LC_RNG::q=44488L; + +const word16 LC_RNG::a=(unsigned int)48271L; +const word16 LC_RNG::r=3399; +#else +const word32 LC_RNG::m=2147483647L; +const word32 LC_RNG::q=127773L; + +const word16 LC_RNG::a=16807; +const word16 LC_RNG::r=2836; +#endif + +void LC_RNG::GenerateBlock(byte *output, size_t size) +{ + while (size--) + { + word32 hi = seed/q; + word32 lo = seed%q; + + long test = a*lo - r*hi; + + if (test > 0) + seed = test; + else + seed = test+ m; + + *output++ = byte((GETBYTE(seed, 0) ^ GETBYTE(seed, 1) ^ GETBYTE(seed, 2) ^ GETBYTE(seed, 3))); + } +} + +// ******************************************************** + +#ifndef CRYPTOPP_IMPORTS + +X917RNG::X917RNG(BlockTransformation *c, const byte *seed, const byte *deterministicTimeVector) + : cipher(c), + S(cipher->BlockSize()), + dtbuf(S), + randseed(seed, S), + m_lastBlock(S), + m_deterministicTimeVector(deterministicTimeVector, deterministicTimeVector ? S : 0) +{ + if (!deterministicTimeVector) + { + time_t tstamp1 = time(0); + xorbuf(dtbuf, (byte *)&tstamp1, UnsignedMin(sizeof(tstamp1), S)); + cipher->ProcessBlock(dtbuf); + clock_t tstamp2 = clock(); + xorbuf(dtbuf, (byte *)&tstamp2, UnsignedMin(sizeof(tstamp2), S)); + cipher->ProcessBlock(dtbuf); + } + + // for FIPS 140-2 + GenerateBlock(m_lastBlock, S); +} + +void X917RNG::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size) +{ + while (size > 0) + { + // calculate new enciphered timestamp + if (m_deterministicTimeVector.size()) + { + cipher->ProcessBlock(m_deterministicTimeVector, dtbuf); + IncrementCounterByOne(m_deterministicTimeVector, S); + } + else + { + clock_t c = clock(); + xorbuf(dtbuf, (byte *)&c, UnsignedMin(sizeof(c), S)); + time_t t = time(NULL); + xorbuf(dtbuf+S-UnsignedMin(sizeof(t), S), (byte *)&t, UnsignedMin(sizeof(t), S)); + cipher->ProcessBlock(dtbuf); + } + + // combine enciphered timestamp with seed + xorbuf(randseed, dtbuf, S); + + // generate a new block of random bytes + cipher->ProcessBlock(randseed); + if (memcmp(m_lastBlock, randseed, S) == 0) + throw SelfTestFailure("X917RNG: Continuous random number generator test failed."); + + // output random bytes + size_t len = UnsignedMin(S, size); + target.ChannelPut(channel, randseed, len); + size -= len; + + // compute new seed vector + memcpy(m_lastBlock, randseed, S); + xorbuf(randseed, dtbuf, S); + cipher->ProcessBlock(randseed); + } +} + +#endif + +MaurerRandomnessTest::MaurerRandomnessTest() + : sum(0.0), n(0) +{ + for (unsigned i=0; i= Q) + sum += log(double(n - tab[inByte])); + tab[inByte] = n; + n++; + } + return 0; +} + +double MaurerRandomnessTest::GetTestValue() const +{ + if (BytesNeeded() > 0) + throw Exception(Exception::OTHER_ERROR, "MaurerRandomnessTest: " + IntToString(BytesNeeded()) + " more bytes of input needed"); + + double fTu = (sum/(n-Q))/log(2.0); // this is the test value defined by Maurer + + double value = fTu * 0.1392; // arbitrarily normalize it to + return value > 1.0 ? 1.0 : value; // a number between 0 and 1 +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/rng.h b/external/crypto++-5.6.3/rng.h new file mode 100644 index 000000000..22237807d --- /dev/null +++ b/external/crypto++-5.6.3/rng.h @@ -0,0 +1,110 @@ +// rng.h - written and placed in the public domain by Wei Dai + +//! \file rng.h +//! \brief Miscellaneous classes for RNGs +//! \details This file contains miscellaneous classes for RNGs, including LC_RNG(), +//! X917RNG() and MaurerRandomnessTest() +//! \sa osrng.h, randpool.h + +#ifndef CRYPTOPP_RNG_H +#define CRYPTOPP_RNG_H + +#include "cryptlib.h" +#include "filters.h" +#include "smartptr.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \brief Linear Congruential Generator (LCG) +//! \details Originally propsed by William S. England. +//! \warning LC_RNG is suitable for simulations, where uniformaly distrubuted numbers are +//! required quickly. It should not be used for cryptographic purposes. +class LC_RNG : public RandomNumberGenerator +{ +public: + //! \brief Construct a Linear Congruential Generator (LCG) + //! \param init_seed the initial value for the generator + LC_RNG(word32 init_seed) + : seed(init_seed) {} + + void GenerateBlock(byte *output, size_t size); + + word32 GetSeed() {return seed;} + +private: + word32 seed; + + static const word32 m; + static const word32 q; + static const word16 a; + static const word16 r; +}; + +//! \class X917RNG +//! \brief ANSI X9.17 RNG +//! \details X917RNG is from ANSI X9.17 Appendix C. +//! \sa AutoSeededX917RNG, DefaultAutoSeededRNG +class CRYPTOPP_DLL X917RNG : public RandomNumberGenerator, public NotCopyable +{ +public: + //! \brief Construct a X917RNG + //! \param cipher the block cipher to use for the generator + //! \param seed a byte buffer to use as a seed + //! \param deterministicTimeVector additional entropy + //! \details cipher will be deleted by the destructor. seed must be at least + //! BlockSize() in length. deterministicTimeVector = 0 means obtain time vector + //! from the system. + //! \details When constructing an AutoSeededX917RNG, the generator must be keyed or an + //! access violation will occur because the time vector is encrypted using the block cipher. + //! To key the generator during constructions, perform the following: + //!
+	//!   SecByteBlock key(AES::DEFAULT_KEYLENGTH), seed(AES::BLOCKSIZE);
+	//!   OS_GenerateRandomBlock(false, key, key.size());
+	//!   OS_GenerateRandomBlock(false, seed, seed.size());
+	//!   X917RNG prng(new AES::Encryption(key, AES::DEFAULT_KEYLENGTH), seed, NULL);
+	//! 
+ //! \sa AutoSeededX917RNG + X917RNG(BlockTransformation *cipher, const byte *seed, const byte *deterministicTimeVector = 0); + + void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size); + +private: + member_ptr cipher; + const unsigned int S; // blocksize of cipher + SecByteBlock dtbuf; // buffer for enciphered timestamp + SecByteBlock randseed, m_lastBlock, m_deterministicTimeVector; +}; + +//! \class MaurerRandomnessTest +//! \brief Maurer's Universal Statistical Test for Random Bit Generators +//! \details This class implements Maurer's Universal Statistical Test for +//! Random Bit Generators. It is intended for measuring the randomness of +//! *PHYSICAL* RNGs. +//! \details For more details see Maurer's paper in Journal of Cryptology, 1992. +class MaurerRandomnessTest : public Bufferless +{ +public: + MaurerRandomnessTest(); + + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + + //! \brief Provides the number of bytes of input is needed by the test + //! \returns how many more bytes of input is needed by the test + // BytesNeeded() returns how many more bytes of input is needed by the test + // GetTestValue() should not be called before BytesNeeded()==0 + unsigned int BytesNeeded() const {return n >= (Q+K) ? 0 : Q+K-n;} + + // returns a number between 0.0 and 1.0, describing the quality of the + // random numbers entered + double GetTestValue() const; + +private: + enum {L=8, V=256, Q=2000, K=2000}; + double sum; + unsigned int n; + unsigned int tab[V]; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rsa.cpp b/external/crypto++-5.6.3/rsa.cpp new file mode 100644 index 000000000..2d7e25a2b --- /dev/null +++ b/external/crypto++-5.6.3/rsa.cpp @@ -0,0 +1,308 @@ +// rsa.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "rsa.h" +#include "asn.h" +#include "sha.h" +#include "oids.h" +#include "modarith.h" +#include "nbtheory.h" +#include "algparam.h" +#include "fips140.h" + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL) +#include "pssr.h" +NAMESPACE_BEGIN(CryptoPP) +void RSA_TestInstantiations() +{ + RSASS::Verifier x1(1, 1); + RSASS::Signer x2(NullRNG(), 1); + RSASS::Verifier x3(x2); + RSASS::Verifier x4(x2.GetKey()); + RSASS::Verifier x5(x3); +#ifndef __MWERKS__ + RSASS::Signer x6 = x2; + x3 = x2; + x6 = x2; +#endif + RSAES::Encryptor x7(x2); +#ifndef __GNUC__ + RSAES::Encryptor x8(x3); +#endif + RSAES >::Encryptor x9(x2); + + x4 = x2.GetKey(); +} +NAMESPACE_END +#endif + +#ifndef CRYPTOPP_IMPORTS + +NAMESPACE_BEGIN(CryptoPP) + +OID RSAFunction::GetAlgorithmID() const +{ + return ASN1::rsaEncryption(); +} + +void RSAFunction::BERDecodePublicKey(BufferedTransformation &bt, bool, size_t) +{ + BERSequenceDecoder seq(bt); + m_n.BERDecode(seq); + m_e.BERDecode(seq); + seq.MessageEnd(); +} + +void RSAFunction::DEREncodePublicKey(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_n.DEREncode(seq); + m_e.DEREncode(seq); + seq.MessageEnd(); +} + +Integer RSAFunction::ApplyFunction(const Integer &x) const +{ + DoQuickSanityCheck(); + return a_exp_b_mod_c(x, m_e, m_n); +} + +bool RSAFunction::Validate(RandomNumberGenerator& rng, unsigned int level) const +{ + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level); + + bool pass = true; + pass = pass && m_n > Integer::One() && m_n.IsOdd(); + pass = pass && m_e > Integer::One() && m_e.IsOdd() && m_e < m_n; + return pass; +} + +bool RSAFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_GET_FUNCTION_ENTRY(PublicExponent) + ; +} + +void RSAFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_SET_FUNCTION_ENTRY(PublicExponent) + ; +} + +// ***************************************************************************** + +class RSAPrimeSelector : public PrimeSelector +{ +public: + RSAPrimeSelector(const Integer &e) : m_e(e) {} + bool IsAcceptable(const Integer &candidate) const {return RelativelyPrime(m_e, candidate-Integer::One());} + Integer m_e; +}; + +void InvertibleRSAFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + int modulusSize = 2048; + alg.GetIntValue(Name::ModulusSize(), modulusSize) || alg.GetIntValue(Name::KeySize(), modulusSize); + + assert(modulusSize >= 16); + if (modulusSize < 16) + throw InvalidArgument("InvertibleRSAFunction: specified modulus size is too small"); + + m_e = alg.GetValueWithDefault(Name::PublicExponent(), Integer(17)); + + assert(m_e >= 3); assert(!m_e.IsEven()); + if (m_e < 3 || m_e.IsEven()) + throw InvalidArgument("InvertibleRSAFunction: invalid public exponent"); + + RSAPrimeSelector selector(m_e); + AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) + (Name::PointerToPrimeSelector(), selector.GetSelectorPointer()); + m_p.GenerateRandom(rng, primeParam); + m_q.GenerateRandom(rng, primeParam); + + m_d = m_e.InverseMod(LCM(m_p-1, m_q-1)); + assert(m_d.IsPositive()); + + m_dp = m_d % (m_p-1); + m_dq = m_d % (m_q-1); + m_n = m_p * m_q; + m_u = m_q.InverseMod(m_p); + + if (FIPS_140_2_ComplianceEnabled()) + { + RSASS::Signer signer(*this); + RSASS::Verifier verifier(signer); + SignaturePairwiseConsistencyTest_FIPS_140_Only(signer, verifier); + + RSAES >::Decryptor decryptor(*this); + RSAES >::Encryptor encryptor(decryptor); + EncryptionPairwiseConsistencyTest_FIPS_140_Only(encryptor, decryptor); + } +} + +void InvertibleRSAFunction::Initialize(RandomNumberGenerator &rng, unsigned int keybits, const Integer &e) +{ + GenerateRandom(rng, MakeParameters(Name::ModulusSize(), (int)keybits)(Name::PublicExponent(), e+e.IsEven())); +} + +void InvertibleRSAFunction::Initialize(const Integer &n, const Integer &e, const Integer &d) +{ + if (n.IsEven() || e.IsEven() | d.IsEven()) + throw InvalidArgument("InvertibleRSAFunction: input is not a valid RSA private key"); + + m_n = n; + m_e = e; + m_d = d; + + Integer r = --(d*e); + unsigned int s = 0; + while (r.IsEven()) + { + r >>= 1; + s++; + } + + ModularArithmetic modn(n); + for (Integer i = 2; ; ++i) + { + Integer a = modn.Exponentiate(i, r); + if (a == 1) + continue; + Integer b; + unsigned int j = 0; + while (a != n-1) + { + b = modn.Square(a); + if (b == 1) + { + m_p = GCD(a-1, n); + m_q = n/m_p; + m_dp = m_d % (m_p-1); + m_dq = m_d % (m_q-1); + m_u = m_q.InverseMod(m_p); + return; + } + if (++j == s) + throw InvalidArgument("InvertibleRSAFunction: input is not a valid RSA private key"); + a = b; + } + } +} + +void InvertibleRSAFunction::BERDecodePrivateKey(BufferedTransformation &bt, bool, size_t) +{ + BERSequenceDecoder privateKey(bt); + word32 version; + BERDecodeUnsigned(privateKey, version, INTEGER, 0, 0); // check version + m_n.BERDecode(privateKey); + m_e.BERDecode(privateKey); + m_d.BERDecode(privateKey); + m_p.BERDecode(privateKey); + m_q.BERDecode(privateKey); + m_dp.BERDecode(privateKey); + m_dq.BERDecode(privateKey); + m_u.BERDecode(privateKey); + privateKey.MessageEnd(); +} + +void InvertibleRSAFunction::DEREncodePrivateKey(BufferedTransformation &bt) const +{ + DERSequenceEncoder privateKey(bt); + DEREncodeUnsigned(privateKey, 0); // version + m_n.DEREncode(privateKey); + m_e.DEREncode(privateKey); + m_d.DEREncode(privateKey); + m_p.DEREncode(privateKey); + m_q.DEREncode(privateKey); + m_dp.DEREncode(privateKey); + m_dq.DEREncode(privateKey); + m_u.DEREncode(privateKey); + privateKey.MessageEnd(); +} + +Integer InvertibleRSAFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const +{ + DoQuickSanityCheck(); + ModularArithmetic modn(m_n); + Integer r, rInv; + do { // do this in a loop for people using small numbers for testing + r.Randomize(rng, Integer::One(), m_n - Integer::One()); + rInv = modn.MultiplicativeInverse(r); + } while (rInv.IsZero()); + Integer re = modn.Exponentiate(r, m_e); + re = modn.Multiply(re, x); // blind + // here we follow the notation of PKCS #1 and let u=q inverse mod p + // but in ModRoot, u=p inverse mod q, so we reverse the order of p and q + Integer y = ModularRoot(re, m_dq, m_dp, m_q, m_p, m_u); + y = modn.Multiply(y, rInv); // unblind + if (modn.Exponentiate(y, m_e) != x) // check + throw Exception(Exception::OTHER_ERROR, "InvertibleRSAFunction: computational error during private key operation"); + return y; +} + +bool InvertibleRSAFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = RSAFunction::Validate(rng, level); + pass = pass && m_p > Integer::One() && m_p.IsOdd() && m_p < m_n; + pass = pass && m_q > Integer::One() && m_q.IsOdd() && m_q < m_n; + pass = pass && m_d > Integer::One() && m_d.IsOdd() && m_d < m_n; + pass = pass && m_dp > Integer::One() && m_dp.IsOdd() && m_dp < m_p; + pass = pass && m_dq > Integer::One() && m_dq.IsOdd() && m_dq < m_q; + pass = pass && m_u.IsPositive() && m_u < m_p; + if (level >= 1) + { + pass = pass && m_p * m_q == m_n; + pass = pass && m_e*m_d % LCM(m_p-1, m_q-1) == 1; + pass = pass && m_dp == m_d%(m_p-1) && m_dq == m_d%(m_q-1); + pass = pass && m_u * m_q % m_p == 1; + } + if (level >= 2) + pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); + return pass; +} + +bool InvertibleRSAFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_GET_FUNCTION_ENTRY(PrivateExponent) + CRYPTOPP_GET_FUNCTION_ENTRY(ModPrime1PrivateExponent) + CRYPTOPP_GET_FUNCTION_ENTRY(ModPrime2PrivateExponent) + CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +void InvertibleRSAFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_SET_FUNCTION_ENTRY(PrivateExponent) + CRYPTOPP_SET_FUNCTION_ENTRY(ModPrime1PrivateExponent) + CRYPTOPP_SET_FUNCTION_ENTRY(ModPrime2PrivateExponent) + CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +// ***************************************************************************** + +Integer RSAFunction_ISO::ApplyFunction(const Integer &x) const +{ + Integer t = RSAFunction::ApplyFunction(x); + return t % 16 == 12 ? t : m_n - t; +} + +Integer InvertibleRSAFunction_ISO::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const +{ + Integer t = InvertibleRSAFunction::CalculateInverse(rng, x); + return STDMIN(t, m_n-t); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rsa.h b/external/crypto++-5.6.3/rsa.h new file mode 100644 index 000000000..46e5b5a96 --- /dev/null +++ b/external/crypto++-5.6.3/rsa.h @@ -0,0 +1,178 @@ +// rsa.h - written and placed in the public domain by Wei Dai + +//! \file rsa.h +//! \brief Classes for the RSA cryptosystem +//! \details This file contains classes that implement the RSA +//! ciphers and signature schemes as defined in PKCS #1 v2.0. + +#ifndef CRYPTOPP_RSA_H +#define CRYPTOPP_RSA_H + +#include "cryptlib.h" +#include "pubkey.h" +#include "integer.h" +#include "pkcspad.h" +#include "oaep.h" +#include "emsa2.h" +#include "asn.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class CRYPTOPP_DLL RSAFunction : public TrapdoorFunction, public X509PublicKey +{ + typedef RSAFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &e) + {m_n = n; m_e = e;} + + // X509PublicKey + OID GetAlgorithmID() const; + void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size); + void DEREncodePublicKey(BufferedTransformation &bt) const; + + // CryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // TrapdoorFunction + Integer ApplyFunction(const Integer &x) const; + Integer PreimageBound() const {return m_n;} + Integer ImageBound() const {return m_n;} + + // non-derived + const Integer & GetModulus() const {return m_n;} + const Integer & GetPublicExponent() const {return m_e;} + + void SetModulus(const Integer &n) {m_n = n;} + void SetPublicExponent(const Integer &e) {m_e = e;} + +protected: + Integer m_n, m_e; +}; + +//! _ +class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey +{ + typedef InvertibleRSAFunction ThisClass; + +public: + void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits, const Integer &e = 17); + void Initialize(const Integer &n, const Integer &e, const Integer &d, const Integer &p, const Integer &q, const Integer &dp, const Integer &dq, const Integer &u) + {m_n = n; m_e = e; m_d = d; m_p = p; m_q = q; m_dp = dp; m_dq = dq; m_u = u;} + //! factor n given private exponent + void Initialize(const Integer &n, const Integer &e, const Integer &d); + + // PKCS8PrivateKey + void BERDecode(BufferedTransformation &bt) + {PKCS8PrivateKey::BERDecode(bt);} + void DEREncode(BufferedTransformation &bt) const + {PKCS8PrivateKey::DEREncode(bt);} + void Load(BufferedTransformation &bt) + {PKCS8PrivateKey::BERDecode(bt);} + void Save(BufferedTransformation &bt) const + {PKCS8PrivateKey::DEREncode(bt);} + OID GetAlgorithmID() const {return RSAFunction::GetAlgorithmID();} + void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size); + void DEREncodePrivateKey(BufferedTransformation &bt) const; + + // TrapdoorFunctionInverse + Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; + + // GeneratableCryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + /*! parameters: (ModulusSize, PublicExponent (default 17)) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + // non-derived interface + const Integer& GetPrime1() const {return m_p;} + const Integer& GetPrime2() const {return m_q;} + const Integer& GetPrivateExponent() const {return m_d;} + const Integer& GetModPrime1PrivateExponent() const {return m_dp;} + const Integer& GetModPrime2PrivateExponent() const {return m_dq;} + const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} + + void SetPrime1(const Integer &p) {m_p = p;} + void SetPrime2(const Integer &q) {m_q = q;} + void SetPrivateExponent(const Integer &d) {m_d = d;} + void SetModPrime1PrivateExponent(const Integer &dp) {m_dp = dp;} + void SetModPrime2PrivateExponent(const Integer &dq) {m_dq = dq;} + void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} + +protected: + Integer m_d, m_p, m_q, m_dp, m_dq, m_u; +}; + +class CRYPTOPP_DLL RSAFunction_ISO : public RSAFunction +{ +public: + Integer ApplyFunction(const Integer &x) const; + Integer PreimageBound() const {return ++(m_n>>1);} +}; + +class CRYPTOPP_DLL InvertibleRSAFunction_ISO : public InvertibleRSAFunction +{ +public: + Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; + Integer PreimageBound() const {return ++(m_n>>1);} +}; + +//! RSA +struct CRYPTOPP_DLL RSA +{ + static const char * CRYPTOPP_API StaticAlgorithmName() {return "RSA";} + typedef RSAFunction PublicKey; + typedef InvertibleRSAFunction PrivateKey; +}; + +//! RSA cryptosystem +template +struct RSAES : public TF_ES +{ +}; + +//! RSA signature scheme with appendix +/*! See documentation of PKCS1v15 for a list of hash functions that can be used with it. */ +template +struct RSASS : public TF_SS +{ +}; + +struct CRYPTOPP_DLL RSA_ISO +{ + static const char * CRYPTOPP_API StaticAlgorithmName() {return "RSA-ISO";} + typedef RSAFunction_ISO PublicKey; + typedef InvertibleRSAFunction_ISO PrivateKey; +}; + +template +struct RSASS_ISO : public TF_SS +{ +}; + +// The two RSA encryption schemes defined in PKCS #1 v2.0 +typedef RSAES::Decryptor RSAES_PKCS1v15_Decryptor; +typedef RSAES::Encryptor RSAES_PKCS1v15_Encryptor; + +typedef RSAES >::Decryptor RSAES_OAEP_SHA_Decryptor; +typedef RSAES >::Encryptor RSAES_OAEP_SHA_Encryptor; + +// The three RSA signature schemes defined in PKCS #1 v2.0 +typedef RSASS::Signer RSASSA_PKCS1v15_SHA_Signer; +typedef RSASS::Verifier RSASSA_PKCS1v15_SHA_Verifier; + +namespace Weak { +typedef RSASS::Signer RSASSA_PKCS1v15_MD2_Signer; +typedef RSASS::Verifier RSASSA_PKCS1v15_MD2_Verifier; + +typedef RSASS::Signer RSASSA_PKCS1v15_MD5_Signer; +typedef RSASS::Verifier RSASSA_PKCS1v15_MD5_Verifier; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rw.cpp b/external/crypto++-5.6.3/rw.cpp new file mode 100644 index 000000000..3d14d11c8 --- /dev/null +++ b/external/crypto++-5.6.3/rw.cpp @@ -0,0 +1,204 @@ +// rw.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "rw.h" +#include "asn.h" +#include "integer.h" +#include "nbtheory.h" +#include "modarith.h" + +#ifndef CRYPTOPP_IMPORTS + +NAMESPACE_BEGIN(CryptoPP) + +void RWFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + m_n.BERDecode(seq); + seq.MessageEnd(); +} + +void RWFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_n.DEREncode(seq); + seq.MessageEnd(); +} + +Integer RWFunction::ApplyFunction(const Integer &in) const +{ + DoQuickSanityCheck(); + + Integer out = in.Squared()%m_n; + const word r = 12; + // this code was written to handle both r = 6 and r = 12, + // but now only r = 12 is used in P1363 + const word r2 = r/2; + const word r3a = (16 + 5 - r) % 16; // n%16 could be 5 or 13 + const word r3b = (16 + 13 - r) % 16; + const word r4 = (8 + 5 - r/2) % 8; // n%8 == 5 + switch (out % 16) + { + case r: + break; + case r2: + case r2+8: + out <<= 1; + break; + case r3a: + case r3b: + out.Negate(); + out += m_n; + break; + case r4: + case r4+8: + out.Negate(); + out += m_n; + out <<= 1; + break; + default: + out = Integer::Zero(); + } + return out; +} + +bool RWFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level); + bool pass = true; + pass = pass && m_n > Integer::One() && m_n%8 == 5; + return pass; +} + +bool RWFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) + ; +} + +void RWFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) + ; +} + +// ***************************************************************************** +// private key operations: + +// generate a random private key +void InvertibleRWFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) +{ + int modulusSize = 2048; + alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); + + if (modulusSize < 16) + throw InvalidArgument("InvertibleRWFunction: specified modulus length is too small"); + + AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize); + m_p.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("EquivalentTo", 3)("Mod", 8))); + m_q.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("EquivalentTo", 7)("Mod", 8))); + + m_n = m_p * m_q; + m_u = m_q.InverseMod(m_p); +} + +void InvertibleRWFunction::BERDecode(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + m_n.BERDecode(seq); + m_p.BERDecode(seq); + m_q.BERDecode(seq); + m_u.BERDecode(seq); + seq.MessageEnd(); +} + +void InvertibleRWFunction::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_n.DEREncode(seq); + m_p.DEREncode(seq); + m_q.DEREncode(seq); + m_u.DEREncode(seq); + seq.MessageEnd(); +} + +Integer InvertibleRWFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const +{ + DoQuickSanityCheck(); + ModularArithmetic modn(m_n); + Integer r, rInv; + do { + // do this in a loop for people using small numbers for testing + r.Randomize(rng, Integer::One(), m_n - Integer::One()); + // Fix for CVE-2015-2141. Thanks to Evgeny Sidorov for reporting. + // Squaring to satisfy Jacobi requirements suggested by Jean-Pierre Münch. + r = modn.Square(r); + rInv = modn.MultiplicativeInverse(r); + } while (rInv.IsZero()); + Integer re = modn.Square(r); + re = modn.Multiply(re, x); // blind + + Integer cp=re%m_p, cq=re%m_q; + if (Jacobi(cp, m_p) * Jacobi(cq, m_q) != 1) + { + cp = cp.IsOdd() ? (cp+m_p) >> 1 : cp >> 1; + cq = cq.IsOdd() ? (cq+m_q) >> 1 : cq >> 1; + } + + #pragma omp parallel + #pragma omp sections + { + #pragma omp section + cp = ModularSquareRoot(cp, m_p); + #pragma omp section + cq = ModularSquareRoot(cq, m_q); + } + + Integer y = CRT(cq, m_q, cp, m_p, m_u); + y = modn.Multiply(y, rInv); // unblind + y = STDMIN(y, m_n-y); + if (ApplyFunction(y) != x) // check + throw Exception(Exception::OTHER_ERROR, "InvertibleRWFunction: computational error during private key operation"); + return y; +} + +bool InvertibleRWFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = RWFunction::Validate(rng, level); + pass = pass && m_p > Integer::One() && m_p%8 == 3 && m_p < m_n; + pass = pass && m_q > Integer::One() && m_q%8 == 7 && m_q < m_n; + pass = pass && m_u.IsPositive() && m_u < m_p; + if (level >= 1) + { + pass = pass && m_p * m_q == m_n; + pass = pass && m_u * m_q % m_p == 1; + } + if (level >= 2) + pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); + return pass; +} + +bool InvertibleRWFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +void InvertibleRWFunction::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) + CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) + CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) + ; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/rw.h b/external/crypto++-5.6.3/rw.h new file mode 100644 index 000000000..95e6ce798 --- /dev/null +++ b/external/crypto++-5.6.3/rw.h @@ -0,0 +1,106 @@ +// rw.h - written and placed in the public domain by Wei Dai + +//! \file rw.h +//! \brief Classes for Rabin-Williams signature schemes +//! \details Rabin-Williams signature schemes as defined in IEEE P1363. + +#ifndef CRYPTOPP_RW_H +#define CRYPTOPP_RW_H + + +#include "cryptlib.h" +#include "pubkey.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class CRYPTOPP_DLL RWFunction : public TrapdoorFunction, public PublicKey +{ + typedef RWFunction ThisClass; + +public: + void Initialize(const Integer &n) + {m_n = n;} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + void Save(BufferedTransformation &bt) const + {DEREncode(bt);} + void Load(BufferedTransformation &bt) + {BERDecode(bt);} + + Integer ApplyFunction(const Integer &x) const; + Integer PreimageBound() const {return ++(m_n>>1);} + Integer ImageBound() const {return m_n;} + + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + + const Integer& GetModulus() const {return m_n;} + void SetModulus(const Integer &n) {m_n = n;} + +protected: + Integer m_n; +}; + +//! _ +class CRYPTOPP_DLL InvertibleRWFunction : public RWFunction, public TrapdoorFunctionInverse, public PrivateKey +{ + typedef InvertibleRWFunction ThisClass; + +public: + void Initialize(const Integer &n, const Integer &p, const Integer &q, const Integer &u) + {m_n = n; m_p = p; m_q = q; m_u = u;} + // generate a random private key + void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits) + {GenerateRandomWithKeySize(rng, modulusBits);} + + void BERDecode(BufferedTransformation &bt); + void DEREncode(BufferedTransformation &bt) const; + + void Save(BufferedTransformation &bt) const + {DEREncode(bt);} + void Load(BufferedTransformation &bt) + {BERDecode(bt);} + + Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; + + // GeneratibleCryptoMaterial + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + /*! parameters: (ModulusSize) */ + void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); + + const Integer& GetPrime1() const {return m_p;} + const Integer& GetPrime2() const {return m_q;} + const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} + + void SetPrime1(const Integer &p) {m_p = p;} + void SetPrime2(const Integer &q) {m_q = q;} + void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} + +protected: + Integer m_p, m_q, m_u; +}; + +//! RW +struct RW +{ + static std::string StaticAlgorithmName() {return "RW";} + typedef RWFunction PublicKey; + typedef InvertibleRWFunction PrivateKey; +}; + +//! RWSS +template +struct RWSS : public TF_SS +{ +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/safer.cpp b/external/crypto++-5.6.3/safer.cpp new file mode 100644 index 000000000..717fef1df --- /dev/null +++ b/external/crypto++-5.6.3/safer.cpp @@ -0,0 +1,157 @@ +// safer.cpp - modified by by Wei Dai from Richard De Moliner's safer.c + +#include "pch.h" +#include "safer.h" +#include "misc.h" +#include "argnames.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4244) +#endif + +NAMESPACE_BEGIN(CryptoPP) + +const byte SAFER::Base::exp_tab[256] = + {1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63, + 8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247, + 64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177, + 255, 167, 62, 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131, + 241, 51, 239, 218, 44, 181, 178, 43, 136, 209, 153, 203, 140, 132, 29, 20, + 129, 151, 113, 202, 95, 163, 139, 87, 60, 130, 196, 82, 92, 28, 232, 160, + 4, 180, 133, 74, 246, 19, 84, 182, 223, 12, 26, 142, 222, 224, 57, 252, + 32, 155, 36, 78, 169, 152, 158, 171, 242, 96, 208, 108, 234, 250, 199, 217, + 0, 212, 31, 110, 67, 188, 236, 83, 137, 254, 122, 93, 73, 201, 50, 194, + 249, 154, 248, 109, 22, 219, 89, 150, 68, 233, 205, 230, 70, 66, 143, 10, + 193, 204, 185, 101, 176, 210, 198, 172, 30, 65, 98, 41, 46, 14, 116, 80, + 2, 90, 195, 37, 123, 138, 42, 91, 240, 6, 13, 71, 111, 112, 157, 126, + 16, 206, 18, 39, 213, 76, 79, 214, 121, 48, 104, 54, 117, 125, 228, 237, + 128, 106, 144, 55, 162, 94, 118, 170, 197, 127, 61, 175, 165, 229, 25, 97, + 253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35, 33, 200, 5, + 225, 102, 221, 179, 88, 105, 99, 86, 15, 161, 49, 149, 23, 7, 58, 40}; + +const byte SAFER::Base::log_tab[256] = + {128, 0, 176, 9, 96, 239, 185, 253, 16, 18, 159, 228, 105, 186, 173, 248, + 192, 56, 194, 101, 79, 6, 148, 252, 25, 222, 106, 27, 93, 78, 168, 130, + 112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37, + 201, 250, 142, 65, 26, 33, 203, 211, 13, 110, 254, 38, 88, 218, 50, 15, + 32, 169, 157, 132, 152, 5, 156, 187, 34, 140, 99, 231, 197, 225, 115, 198, + 175, 36, 91, 135, 102, 39, 247, 87, 244, 150, 177, 183, 92, 139, 213, 84, + 121, 223, 170, 246, 62, 163, 241, 17, 202, 245, 209, 23, 123, 147, 131, 188, + 189, 82, 30, 235, 174, 204, 214, 53, 8, 200, 138, 180, 226, 205, 191, 217, + 208, 80, 89, 63, 77, 98, 52, 10, 72, 136, 181, 86, 76, 46, 107, 158, + 210, 61, 60, 3, 19, 251, 151, 81, 117, 74, 145, 113, 35, 190, 118, 42, + 95, 249, 212, 85, 11, 220, 55, 49, 22, 116, 215, 119, 167, 230, 7, 219, + 164, 47, 70, 243, 97, 69, 103, 227, 12, 162, 59, 28, 133, 24, 4, 29, + 41, 160, 143, 178, 90, 216, 166, 126, 238, 141, 83, 75, 161, 154, 193, 14, + 122, 73, 165, 44, 129, 196, 199, 54, 43, 127, 67, 149, 51, 242, 108, 104, + 109, 240, 2, 40, 206, 221, 155, 234, 94, 153, 124, 20, 134, 207, 229, 66, + 184, 64, 120, 45, 58, 233, 100, 31, 146, 144, 125, 57, 111, 224, 137, 48}; + +#define EXP(x) exp_tab[(x)] +#define LOG(x) log_tab[(x)] +#define PHT(x, y) { y += x; x += y; } +#define IPHT(x, y) { x -= y; y -= x; } + +static const unsigned int BLOCKSIZE = 8; +static const unsigned int MAX_ROUNDS = 13; + +void SAFER::Base::UncheckedSetKey(const byte *userkey_1, unsigned int length, const NameValuePairs ¶ms) +{ + bool strengthened = Strengthened(); + unsigned int nof_rounds = params.GetIntValueWithDefault(Name::Rounds(), length == 8 ? (strengthened ? 8 : 6) : 10); + + const byte *userkey_2 = length == 8 ? userkey_1 : userkey_1 + 8; + keySchedule.New(1 + BLOCKSIZE * (1 + 2 * nof_rounds)); + + unsigned int i, j; + byte *key = keySchedule; + SecByteBlock ka(BLOCKSIZE + 1), kb(BLOCKSIZE + 1); + + if (MAX_ROUNDS < nof_rounds) + nof_rounds = MAX_ROUNDS; + *key++ = (unsigned char)nof_rounds; + ka[BLOCKSIZE] = 0; + kb[BLOCKSIZE] = 0; + for (j = 0; j < BLOCKSIZE; j++) + { + ka[BLOCKSIZE] ^= ka[j] = rotlFixed(userkey_1[j], 5U); + kb[BLOCKSIZE] ^= kb[j] = *key++ = userkey_2[j]; + } + + for (i = 1; i <= nof_rounds; i++) + { + for (j = 0; j < BLOCKSIZE + 1; j++) + { + ka[j] = rotlFixed(ka[j], 6U); + kb[j] = rotlFixed(kb[j], 6U); + } + for (j = 0; j < BLOCKSIZE; j++) + if (strengthened) + *key++ = (ka[(j + 2 * i - 1) % (BLOCKSIZE + 1)] + + exp_tab[exp_tab[18 * i + j + 1]]) & 0xFF; + else + *key++ = (ka[j] + exp_tab[exp_tab[18 * i + j + 1]]) & 0xFF; + for (j = 0; j < BLOCKSIZE; j++) + if (strengthened) + *key++ = (kb[(j + 2 * i) % (BLOCKSIZE + 1)] + + exp_tab[exp_tab[18 * i + j + 10]]) & 0xFF; + else + *key++ = (kb[j] + exp_tab[exp_tab[18 * i + j + 10]]) & 0xFF; + } +} + +typedef BlockGetAndPut Block; + +void SAFER::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + byte a, b, c, d, e, f, g, h, t; + const byte *key = keySchedule+1; + unsigned int round = keySchedule[0]; + + Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); + while(round--) + { + a ^= key[0]; b += key[1]; c += key[2]; d ^= key[3]; + e ^= key[4]; f += key[5]; g += key[6]; h ^= key[7]; + a = EXP(a) + key[ 8]; b = LOG(b) ^ key[ 9]; + c = LOG(c) ^ key[10]; d = EXP(d) + key[11]; + e = EXP(e) + key[12]; f = LOG(f) ^ key[13]; + g = LOG(g) ^ key[14]; h = EXP(h) + key[15]; + key += 16; + PHT(a, b); PHT(c, d); PHT(e, f); PHT(g, h); + PHT(a, c); PHT(e, g); PHT(b, d); PHT(f, h); + PHT(a, e); PHT(b, f); PHT(c, g); PHT(d, h); + t = b; b = e; e = c; c = t; t = d; d = f; f = g; g = t; + } + a ^= key[0]; b += key[1]; c += key[2]; d ^= key[3]; + e ^= key[4]; f += key[5]; g += key[6]; h ^= key[7]; + Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); +} + +void SAFER::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + byte a, b, c, d, e, f, g, h, t; + unsigned int round = keySchedule[0]; + const byte *key = keySchedule + BLOCKSIZE * (1 + 2 * round) - 7; + + Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); + h ^= key[7]; g -= key[6]; f -= key[5]; e ^= key[4]; + d ^= key[3]; c -= key[2]; b -= key[1]; a ^= key[0]; + while (round--) + { + key -= 16; + t = e; e = b; b = c; c = t; t = f; f = d; d = g; g = t; + IPHT(a, e); IPHT(b, f); IPHT(c, g); IPHT(d, h); + IPHT(a, c); IPHT(e, g); IPHT(b, d); IPHT(f, h); + IPHT(a, b); IPHT(c, d); IPHT(e, f); IPHT(g, h); + h -= key[15]; g ^= key[14]; f ^= key[13]; e -= key[12]; + d -= key[11]; c ^= key[10]; b ^= key[9]; a -= key[8]; + h = LOG(h) ^ key[7]; g = EXP(g) - key[6]; + f = EXP(f) - key[5]; e = LOG(e) ^ key[4]; + d = LOG(d) ^ key[3]; c = EXP(c) - key[2]; + b = EXP(b) - key[1]; a = LOG(a) ^ key[0]; + } + Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/safer.h b/external/crypto++-5.6.3/safer.h new file mode 100644 index 000000000..3f5ec2110 --- /dev/null +++ b/external/crypto++-5.6.3/safer.h @@ -0,0 +1,88 @@ +// safer.h - written and placed in the public domain by Wei Dai + +//! \file safer.h +//! \brief Classes for the SAFER block cipher + +#ifndef CRYPTOPP_SAFER_H +#define CRYPTOPP_SAFER_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// base class, do not use directly +class SAFER +{ +public: + class CRYPTOPP_NO_VTABLE Base : public BlockCipher + { + public: + unsigned int OptimalDataAlignment() const {return 1;} + void UncheckedSetKey(const byte *userkey, unsigned int length, const NameValuePairs ¶ms); + + protected: + virtual bool Strengthened() const =0; + + SecByteBlock keySchedule; + static const byte exp_tab[256]; + static const byte log_tab[256]; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; +}; + +template +class CRYPTOPP_NO_VTABLE SAFER_Impl : public BlockCipherImpl +{ +protected: + bool Strengthened() const {return STR;} +}; + +//! _ +struct SAFER_K_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13> +{ + static const char *StaticAlgorithmName() {return "SAFER-K";} +}; + +/// SAFER-K +class SAFER_K : public SAFER_K_Info, public SAFER, public BlockCipherDocumentation +{ +public: + typedef BlockCipherFinal > Encryption; + typedef BlockCipherFinal > Decryption; +}; + +//! _ +struct SAFER_SK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13> +{ + static const char *StaticAlgorithmName() {return "SAFER-SK";} +}; + +/// SAFER-SK +class SAFER_SK : public SAFER_SK_Info, public SAFER, public BlockCipherDocumentation +{ +public: + typedef BlockCipherFinal > Encryption; + typedef BlockCipherFinal > Decryption; +}; + +typedef SAFER_K::Encryption SAFER_K_Encryption; +typedef SAFER_K::Decryption SAFER_K_Decryption; + +typedef SAFER_SK::Encryption SAFER_SK_Encryption; +typedef SAFER_SK::Decryption SAFER_SK_Decryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/salsa.cpp b/external/crypto++-5.6.3/salsa.cpp new file mode 100644 index 000000000..9db2f3957 --- /dev/null +++ b/external/crypto++-5.6.3/salsa.cpp @@ -0,0 +1,625 @@ +// salsa.cpp - written and placed in the public domain by Wei Dai + +// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM salsa.cpp" to generate MASM code + +#include "pch.h" +#include "config.h" + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#include "salsa.h" +#include "argnames.h" +#include "misc.h" +#include "cpu.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4702 4740) +#endif + +// TODO: work around GCC 4.8+ issue with SSE2 ASM until the exact details are known +// and fix is released. Duplicate with "valgrind ./cryptest.exe tv salsa" +// Clang due to "Inline assembly operands don't work with .intel_syntax" +// https://llvm.org/bugs/show_bug.cgi?id=24232 +#if defined(CRYPTOPP_DISABLE_SALSA_ASM) +# undef CRYPTOPP_X86_ASM_AVAILABLE +# undef CRYPTOPP_X32_ASM_AVAILABLE +# undef CRYPTOPP_X64_ASM_AVAILABLE +# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE +# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 +# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void Salsa20_TestInstantiations() +{ + Salsa20::Encryption x; +} +#endif + +void Salsa20_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) +{ + m_rounds = params.GetIntValueWithDefault(Name::Rounds(), 20); + + if (!(m_rounds == 8 || m_rounds == 12 || m_rounds == 20)) + throw InvalidRounds(Salsa20::StaticAlgorithmName(), m_rounds); + + // m_state is reordered for SSE2 + GetBlock get1(key); + get1(m_state[13])(m_state[10])(m_state[7])(m_state[4]); + GetBlock get2(key + length - 16); + get2(m_state[15])(m_state[12])(m_state[9])(m_state[6]); + + // "expand 16-byte k" or "expand 32-byte k" + m_state[0] = 0x61707865; + m_state[1] = (length == 16) ? 0x3120646e : 0x3320646e; + m_state[2] = (length == 16) ? 0x79622d36 : 0x79622d32; + m_state[3] = 0x6b206574; +} + +void Salsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); + assert(length==8); + + GetBlock get(IV); + get(m_state[14])(m_state[11]); + m_state[8] = m_state[5] = 0; +} + +void Salsa20_Policy::SeekToIteration(lword iterationCount) +{ + m_state[8] = (word32)iterationCount; + m_state[5] = (word32)SafeRightShift<32>(iterationCount); +} + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SALSA_ASM) +unsigned int Salsa20_Policy::GetAlignment() const +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + if (HasSSE2()) + return 16; + else +#endif + return GetAlignmentOf(); +} + +unsigned int Salsa20_Policy::GetOptimalBlockSize() const +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + if (HasSSE2()) + return 4*BYTES_PER_ITERATION; + else +#endif + return BYTES_PER_ITERATION; +} +#endif + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +void Salsa20_OperateKeystream(byte *output, const byte *input, size_t iterationCount, int rounds, void *state); +} +#endif + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code +#endif + +void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) +{ +#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE + Salsa20_OperateKeystream(output, input, iterationCount, m_rounds, m_state.data()); + return; +#endif + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#ifdef CRYPTOPP_GENERATE_X64_MASM + ALIGN 8 + Salsa20_OperateKeystream PROC FRAME + mov r10, [rsp + 5*8] ; state + alloc_stack(10*16 + 32*16 + 8) + save_xmm128 xmm6, 0200h + save_xmm128 xmm7, 0210h + save_xmm128 xmm8, 0220h + save_xmm128 xmm9, 0230h + save_xmm128 xmm10, 0240h + save_xmm128 xmm11, 0250h + save_xmm128 xmm12, 0260h + save_xmm128 xmm13, 0270h + save_xmm128 xmm14, 0280h + save_xmm128 xmm15, 0290h + .endprolog + + #define REG_output rcx + #define REG_input rdx + #define REG_iterationCount r8 + #define REG_state r10 + #define REG_rounds e9d + #define REG_roundsLeft eax + #define REG_temp32 r11d + #define REG_temp r11 + #define SSE2_WORKSPACE rsp +#else + if (HasSSE2()) + { + #if CRYPTOPP_BOOL_X64 + #define REG_output %1 + #define REG_input %0 + #define REG_iterationCount %2 + #define REG_state %4 /* constant */ + #define REG_rounds %3 /* constant */ + #define REG_roundsLeft eax + #define REG_temp32 edx + #define REG_temp rdx + #define SSE2_WORKSPACE %5 /* constant */ + + CRYPTOPP_ALIGN_DATA(16) byte workspace[16*32]; + #else + #define REG_output edi + #define REG_input eax + #define REG_iterationCount ecx + #define REG_state esi + #define REG_rounds edx + #define REG_roundsLeft ebx + #define REG_temp32 ebp + #define REG_temp ebp + #define SSE2_WORKSPACE esp + WORD_SZ + #endif + + #ifdef __GNUC__ + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS_PUSH_IF86( bx) + #else + void *s = m_state.data(); + word32 r = m_rounds; + + AS2( mov REG_iterationCount, iterationCount) + AS2( mov REG_input, input) + AS2( mov REG_output, output) + AS2( mov REG_state, s) + AS2( mov REG_rounds, r) + #endif +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM + + AS_PUSH_IF86( bp) + AS2( cmp REG_iterationCount, 4) + ASJ( jl, 5, f) + +#if CRYPTOPP_BOOL_X86 + AS2( mov ebx, esp) + AS2( and esp, -16) + AS2( sub esp, 32*16) + AS1( push ebx) +#endif + +#define SSE2_EXPAND_S(i, j) \ + ASS( pshufd xmm4, xmm##i, j, j, j, j) \ + AS2( movdqa [SSE2_WORKSPACE + (i*4+j)*16 + 256], xmm4) + + AS2( movdqa xmm0, [REG_state + 0*16]) + AS2( movdqa xmm1, [REG_state + 1*16]) + AS2( movdqa xmm2, [REG_state + 2*16]) + AS2( movdqa xmm3, [REG_state + 3*16]) + SSE2_EXPAND_S(0, 0) + SSE2_EXPAND_S(0, 1) + SSE2_EXPAND_S(0, 2) + SSE2_EXPAND_S(0, 3) + SSE2_EXPAND_S(1, 0) + SSE2_EXPAND_S(1, 2) + SSE2_EXPAND_S(1, 3) + SSE2_EXPAND_S(2, 1) + SSE2_EXPAND_S(2, 2) + SSE2_EXPAND_S(2, 3) + SSE2_EXPAND_S(3, 0) + SSE2_EXPAND_S(3, 1) + SSE2_EXPAND_S(3, 2) + SSE2_EXPAND_S(3, 3) + +#define SSE2_EXPAND_S85(i) \ + AS2( mov dword ptr [SSE2_WORKSPACE + 8*16 + i*4 + 256], REG_roundsLeft) \ + AS2( mov dword ptr [SSE2_WORKSPACE + 5*16 + i*4 + 256], REG_temp32) \ + AS2( add REG_roundsLeft, 1) \ + AS2( adc REG_temp32, 0) + + ASL(1) + AS2( mov REG_roundsLeft, dword ptr [REG_state + 8*4]) + AS2( mov REG_temp32, dword ptr [REG_state + 5*4]) + SSE2_EXPAND_S85(0) + SSE2_EXPAND_S85(1) + SSE2_EXPAND_S85(2) + SSE2_EXPAND_S85(3) + AS2( mov dword ptr [REG_state + 8*4], REG_roundsLeft) + AS2( mov dword ptr [REG_state + 5*4], REG_temp32) + +#define SSE2_QUARTER_ROUND(a, b, d, i) \ + AS2( movdqa xmm4, xmm##d) \ + AS2( paddd xmm4, xmm##a) \ + AS2( movdqa xmm5, xmm4) \ + AS2( pslld xmm4, i) \ + AS2( psrld xmm5, 32-i) \ + AS2( pxor xmm##b, xmm4) \ + AS2( pxor xmm##b, xmm5) + +#define L01(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##A, [SSE2_WORKSPACE + d*16 + i*256]) /* y3 */ +#define L02(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##C, [SSE2_WORKSPACE + a*16 + i*256]) /* y0 */ +#define L03(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##C) /* y0+y3 */ +#define L04(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##B, xmm##A) +#define L05(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 7) +#define L06(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##B, 32-7) +#define L07(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, [SSE2_WORKSPACE + b*16 + i*256]) +#define L08(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##B) /* z1 */ +#define L09(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + b*16], xmm##A) +#define L10(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##B, xmm##A) +#define L11(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##C) /* z1+y0 */ +#define L12(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##D, xmm##A) +#define L13(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 9) +#define L14(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##D, 32-9) +#define L15(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, [SSE2_WORKSPACE + c*16 + i*256]) +#define L16(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##D) /* z2 */ +#define L17(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + c*16], xmm##A) +#define L18(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##D, xmm##A) +#define L19(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##B) /* z2+z1 */ +#define L20(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##B, xmm##A) +#define L21(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 13) +#define L22(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##B, 32-13) +#define L23(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, [SSE2_WORKSPACE + d*16 + i*256]) +#define L24(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##B) /* z3 */ +#define L25(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + d*16], xmm##A) +#define L26(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##D) /* z3+z2 */ +#define L27(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##D, xmm##A) +#define L28(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 18) +#define L29(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##D, 32-18) +#define L30(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##C) /* xor y0 */ +#define L31(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##D) /* z0 */ +#define L32(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + a*16], xmm##A) + +#define SSE2_QUARTER_ROUND_X8(i, a, b, c, d, e, f, g, h) \ + L01(0,1,2,3, a,b,c,d, i) L01(4,5,6,7, e,f,g,h, i) \ + L02(0,1,2,3, a,b,c,d, i) L02(4,5,6,7, e,f,g,h, i) \ + L03(0,1,2,3, a,b,c,d, i) L03(4,5,6,7, e,f,g,h, i) \ + L04(0,1,2,3, a,b,c,d, i) L04(4,5,6,7, e,f,g,h, i) \ + L05(0,1,2,3, a,b,c,d, i) L05(4,5,6,7, e,f,g,h, i) \ + L06(0,1,2,3, a,b,c,d, i) L06(4,5,6,7, e,f,g,h, i) \ + L07(0,1,2,3, a,b,c,d, i) L07(4,5,6,7, e,f,g,h, i) \ + L08(0,1,2,3, a,b,c,d, i) L08(4,5,6,7, e,f,g,h, i) \ + L09(0,1,2,3, a,b,c,d, i) L09(4,5,6,7, e,f,g,h, i) \ + L10(0,1,2,3, a,b,c,d, i) L10(4,5,6,7, e,f,g,h, i) \ + L11(0,1,2,3, a,b,c,d, i) L11(4,5,6,7, e,f,g,h, i) \ + L12(0,1,2,3, a,b,c,d, i) L12(4,5,6,7, e,f,g,h, i) \ + L13(0,1,2,3, a,b,c,d, i) L13(4,5,6,7, e,f,g,h, i) \ + L14(0,1,2,3, a,b,c,d, i) L14(4,5,6,7, e,f,g,h, i) \ + L15(0,1,2,3, a,b,c,d, i) L15(4,5,6,7, e,f,g,h, i) \ + L16(0,1,2,3, a,b,c,d, i) L16(4,5,6,7, e,f,g,h, i) \ + L17(0,1,2,3, a,b,c,d, i) L17(4,5,6,7, e,f,g,h, i) \ + L18(0,1,2,3, a,b,c,d, i) L18(4,5,6,7, e,f,g,h, i) \ + L19(0,1,2,3, a,b,c,d, i) L19(4,5,6,7, e,f,g,h, i) \ + L20(0,1,2,3, a,b,c,d, i) L20(4,5,6,7, e,f,g,h, i) \ + L21(0,1,2,3, a,b,c,d, i) L21(4,5,6,7, e,f,g,h, i) \ + L22(0,1,2,3, a,b,c,d, i) L22(4,5,6,7, e,f,g,h, i) \ + L23(0,1,2,3, a,b,c,d, i) L23(4,5,6,7, e,f,g,h, i) \ + L24(0,1,2,3, a,b,c,d, i) L24(4,5,6,7, e,f,g,h, i) \ + L25(0,1,2,3, a,b,c,d, i) L25(4,5,6,7, e,f,g,h, i) \ + L26(0,1,2,3, a,b,c,d, i) L26(4,5,6,7, e,f,g,h, i) \ + L27(0,1,2,3, a,b,c,d, i) L27(4,5,6,7, e,f,g,h, i) \ + L28(0,1,2,3, a,b,c,d, i) L28(4,5,6,7, e,f,g,h, i) \ + L29(0,1,2,3, a,b,c,d, i) L29(4,5,6,7, e,f,g,h, i) \ + L30(0,1,2,3, a,b,c,d, i) L30(4,5,6,7, e,f,g,h, i) \ + L31(0,1,2,3, a,b,c,d, i) L31(4,5,6,7, e,f,g,h, i) \ + L32(0,1,2,3, a,b,c,d, i) L32(4,5,6,7, e,f,g,h, i) + +#define SSE2_QUARTER_ROUND_X16(i, a, b, c, d, e, f, g, h, A, B, C, D, E, F, G, H) \ + L01(0,1,2,3, a,b,c,d, i) L01(4,5,6,7, e,f,g,h, i) L01(8,9,10,11, A,B,C,D, i) L01(12,13,14,15, E,F,G,H, i) \ + L02(0,1,2,3, a,b,c,d, i) L02(4,5,6,7, e,f,g,h, i) L02(8,9,10,11, A,B,C,D, i) L02(12,13,14,15, E,F,G,H, i) \ + L03(0,1,2,3, a,b,c,d, i) L03(4,5,6,7, e,f,g,h, i) L03(8,9,10,11, A,B,C,D, i) L03(12,13,14,15, E,F,G,H, i) \ + L04(0,1,2,3, a,b,c,d, i) L04(4,5,6,7, e,f,g,h, i) L04(8,9,10,11, A,B,C,D, i) L04(12,13,14,15, E,F,G,H, i) \ + L05(0,1,2,3, a,b,c,d, i) L05(4,5,6,7, e,f,g,h, i) L05(8,9,10,11, A,B,C,D, i) L05(12,13,14,15, E,F,G,H, i) \ + L06(0,1,2,3, a,b,c,d, i) L06(4,5,6,7, e,f,g,h, i) L06(8,9,10,11, A,B,C,D, i) L06(12,13,14,15, E,F,G,H, i) \ + L07(0,1,2,3, a,b,c,d, i) L07(4,5,6,7, e,f,g,h, i) L07(8,9,10,11, A,B,C,D, i) L07(12,13,14,15, E,F,G,H, i) \ + L08(0,1,2,3, a,b,c,d, i) L08(4,5,6,7, e,f,g,h, i) L08(8,9,10,11, A,B,C,D, i) L08(12,13,14,15, E,F,G,H, i) \ + L09(0,1,2,3, a,b,c,d, i) L09(4,5,6,7, e,f,g,h, i) L09(8,9,10,11, A,B,C,D, i) L09(12,13,14,15, E,F,G,H, i) \ + L10(0,1,2,3, a,b,c,d, i) L10(4,5,6,7, e,f,g,h, i) L10(8,9,10,11, A,B,C,D, i) L10(12,13,14,15, E,F,G,H, i) \ + L11(0,1,2,3, a,b,c,d, i) L11(4,5,6,7, e,f,g,h, i) L11(8,9,10,11, A,B,C,D, i) L11(12,13,14,15, E,F,G,H, i) \ + L12(0,1,2,3, a,b,c,d, i) L12(4,5,6,7, e,f,g,h, i) L12(8,9,10,11, A,B,C,D, i) L12(12,13,14,15, E,F,G,H, i) \ + L13(0,1,2,3, a,b,c,d, i) L13(4,5,6,7, e,f,g,h, i) L13(8,9,10,11, A,B,C,D, i) L13(12,13,14,15, E,F,G,H, i) \ + L14(0,1,2,3, a,b,c,d, i) L14(4,5,6,7, e,f,g,h, i) L14(8,9,10,11, A,B,C,D, i) L14(12,13,14,15, E,F,G,H, i) \ + L15(0,1,2,3, a,b,c,d, i) L15(4,5,6,7, e,f,g,h, i) L15(8,9,10,11, A,B,C,D, i) L15(12,13,14,15, E,F,G,H, i) \ + L16(0,1,2,3, a,b,c,d, i) L16(4,5,6,7, e,f,g,h, i) L16(8,9,10,11, A,B,C,D, i) L16(12,13,14,15, E,F,G,H, i) \ + L17(0,1,2,3, a,b,c,d, i) L17(4,5,6,7, e,f,g,h, i) L17(8,9,10,11, A,B,C,D, i) L17(12,13,14,15, E,F,G,H, i) \ + L18(0,1,2,3, a,b,c,d, i) L18(4,5,6,7, e,f,g,h, i) L18(8,9,10,11, A,B,C,D, i) L18(12,13,14,15, E,F,G,H, i) \ + L19(0,1,2,3, a,b,c,d, i) L19(4,5,6,7, e,f,g,h, i) L19(8,9,10,11, A,B,C,D, i) L19(12,13,14,15, E,F,G,H, i) \ + L20(0,1,2,3, a,b,c,d, i) L20(4,5,6,7, e,f,g,h, i) L20(8,9,10,11, A,B,C,D, i) L20(12,13,14,15, E,F,G,H, i) \ + L21(0,1,2,3, a,b,c,d, i) L21(4,5,6,7, e,f,g,h, i) L21(8,9,10,11, A,B,C,D, i) L21(12,13,14,15, E,F,G,H, i) \ + L22(0,1,2,3, a,b,c,d, i) L22(4,5,6,7, e,f,g,h, i) L22(8,9,10,11, A,B,C,D, i) L22(12,13,14,15, E,F,G,H, i) \ + L23(0,1,2,3, a,b,c,d, i) L23(4,5,6,7, e,f,g,h, i) L23(8,9,10,11, A,B,C,D, i) L23(12,13,14,15, E,F,G,H, i) \ + L24(0,1,2,3, a,b,c,d, i) L24(4,5,6,7, e,f,g,h, i) L24(8,9,10,11, A,B,C,D, i) L24(12,13,14,15, E,F,G,H, i) \ + L25(0,1,2,3, a,b,c,d, i) L25(4,5,6,7, e,f,g,h, i) L25(8,9,10,11, A,B,C,D, i) L25(12,13,14,15, E,F,G,H, i) \ + L26(0,1,2,3, a,b,c,d, i) L26(4,5,6,7, e,f,g,h, i) L26(8,9,10,11, A,B,C,D, i) L26(12,13,14,15, E,F,G,H, i) \ + L27(0,1,2,3, a,b,c,d, i) L27(4,5,6,7, e,f,g,h, i) L27(8,9,10,11, A,B,C,D, i) L27(12,13,14,15, E,F,G,H, i) \ + L28(0,1,2,3, a,b,c,d, i) L28(4,5,6,7, e,f,g,h, i) L28(8,9,10,11, A,B,C,D, i) L28(12,13,14,15, E,F,G,H, i) \ + L29(0,1,2,3, a,b,c,d, i) L29(4,5,6,7, e,f,g,h, i) L29(8,9,10,11, A,B,C,D, i) L29(12,13,14,15, E,F,G,H, i) \ + L30(0,1,2,3, a,b,c,d, i) L30(4,5,6,7, e,f,g,h, i) L30(8,9,10,11, A,B,C,D, i) L30(12,13,14,15, E,F,G,H, i) \ + L31(0,1,2,3, a,b,c,d, i) L31(4,5,6,7, e,f,g,h, i) L31(8,9,10,11, A,B,C,D, i) L31(12,13,14,15, E,F,G,H, i) \ + L32(0,1,2,3, a,b,c,d, i) L32(4,5,6,7, e,f,g,h, i) L32(8,9,10,11, A,B,C,D, i) L32(12,13,14,15, E,F,G,H, i) + +#if CRYPTOPP_BOOL_X64 + SSE2_QUARTER_ROUND_X16(1, 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15) +#else + SSE2_QUARTER_ROUND_X8(1, 2, 6, 10, 14, 3, 7, 11, 15) + SSE2_QUARTER_ROUND_X8(1, 0, 4, 8, 12, 1, 5, 9, 13) +#endif + AS2( mov REG_roundsLeft, REG_rounds) + ASJ( jmp, 2, f) + + ASL(SSE2_Salsa_Output) + AS2( movdqa xmm0, xmm4) + AS2( punpckldq xmm4, xmm5) + AS2( movdqa xmm1, xmm6) + AS2( punpckldq xmm6, xmm7) + AS2( movdqa xmm2, xmm4) + AS2( punpcklqdq xmm4, xmm6) // e + AS2( punpckhqdq xmm2, xmm6) // f + AS2( punpckhdq xmm0, xmm5) + AS2( punpckhdq xmm1, xmm7) + AS2( movdqa xmm6, xmm0) + AS2( punpcklqdq xmm0, xmm1) // g + AS2( punpckhqdq xmm6, xmm1) // h + AS_XMM_OUTPUT4(SSE2_Salsa_Output_A, REG_input, REG_output, 4, 2, 0, 6, 1, 0, 4, 8, 12, 1) + AS1( ret) + + ASL(6) +#if CRYPTOPP_BOOL_X64 + SSE2_QUARTER_ROUND_X16(0, 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15) + ASL(2) + SSE2_QUARTER_ROUND_X16(0, 0, 13, 10, 7, 1, 14, 11, 4, 2, 15, 8, 5, 3, 12, 9, 6) +#else + SSE2_QUARTER_ROUND_X8(0, 2, 6, 10, 14, 3, 7, 11, 15) + SSE2_QUARTER_ROUND_X8(0, 0, 4, 8, 12, 1, 5, 9, 13) + ASL(2) + SSE2_QUARTER_ROUND_X8(0, 2, 15, 8, 5, 3, 12, 9, 6) + SSE2_QUARTER_ROUND_X8(0, 0, 13, 10, 7, 1, 14, 11, 4) +#endif + AS2( sub REG_roundsLeft, 2) + ASJ( jnz, 6, b) + +#define SSE2_OUTPUT_4(a, b, c, d) \ + AS2( movdqa xmm4, [SSE2_WORKSPACE + a*16 + 256])\ + AS2( paddd xmm4, [SSE2_WORKSPACE + a*16])\ + AS2( movdqa xmm5, [SSE2_WORKSPACE + b*16 + 256])\ + AS2( paddd xmm5, [SSE2_WORKSPACE + b*16])\ + AS2( movdqa xmm6, [SSE2_WORKSPACE + c*16 + 256])\ + AS2( paddd xmm6, [SSE2_WORKSPACE + c*16])\ + AS2( movdqa xmm7, [SSE2_WORKSPACE + d*16 + 256])\ + AS2( paddd xmm7, [SSE2_WORKSPACE + d*16])\ + ASC( call, SSE2_Salsa_Output) + + SSE2_OUTPUT_4(0, 13, 10, 7) + SSE2_OUTPUT_4(4, 1, 14, 11) + SSE2_OUTPUT_4(8, 5, 2, 15) + SSE2_OUTPUT_4(12, 9, 6, 3) + AS2( test REG_input, REG_input) + ASJ( jz, 9, f) + AS2( add REG_input, 12*16) + ASL(9) + AS2( add REG_output, 12*16) + AS2( sub REG_iterationCount, 4) + AS2( cmp REG_iterationCount, 4) + ASJ( jge, 1, b) + AS_POP_IF86( sp) + + ASL(5) + AS2( sub REG_iterationCount, 1) + ASJ( jl, 4, f) + AS2( movdqa xmm0, [REG_state + 0*16]) + AS2( movdqa xmm1, [REG_state + 1*16]) + AS2( movdqa xmm2, [REG_state + 2*16]) + AS2( movdqa xmm3, [REG_state + 3*16]) + AS2( mov REG_roundsLeft, REG_rounds) + + ASL(0) + SSE2_QUARTER_ROUND(0, 1, 3, 7) + SSE2_QUARTER_ROUND(1, 2, 0, 9) + SSE2_QUARTER_ROUND(2, 3, 1, 13) + SSE2_QUARTER_ROUND(3, 0, 2, 18) + ASS( pshufd xmm1, xmm1, 2, 1, 0, 3) + ASS( pshufd xmm2, xmm2, 1, 0, 3, 2) + ASS( pshufd xmm3, xmm3, 0, 3, 2, 1) + SSE2_QUARTER_ROUND(0, 3, 1, 7) + SSE2_QUARTER_ROUND(3, 2, 0, 9) + SSE2_QUARTER_ROUND(2, 1, 3, 13) + SSE2_QUARTER_ROUND(1, 0, 2, 18) + ASS( pshufd xmm1, xmm1, 0, 3, 2, 1) + ASS( pshufd xmm2, xmm2, 1, 0, 3, 2) + ASS( pshufd xmm3, xmm3, 2, 1, 0, 3) + AS2( sub REG_roundsLeft, 2) + ASJ( jnz, 0, b) + + AS2( paddd xmm0, [REG_state + 0*16]) + AS2( paddd xmm1, [REG_state + 1*16]) + AS2( paddd xmm2, [REG_state + 2*16]) + AS2( paddd xmm3, [REG_state + 3*16]) + + AS2( add dword ptr [REG_state + 8*4], 1) + AS2( adc dword ptr [REG_state + 5*4], 0) + + AS2( pcmpeqb xmm6, xmm6) // all ones + AS2( psrlq xmm6, 32) // lo32 mask + ASS( pshufd xmm7, xmm6, 0, 1, 2, 3) // hi32 mask + AS2( movdqa xmm4, xmm0) + AS2( movdqa xmm5, xmm3) + AS2( pand xmm0, xmm7) + AS2( pand xmm4, xmm6) + AS2( pand xmm3, xmm6) + AS2( pand xmm5, xmm7) + AS2( por xmm4, xmm5) // 0,13,2,15 + AS2( movdqa xmm5, xmm1) + AS2( pand xmm1, xmm7) + AS2( pand xmm5, xmm6) + AS2( por xmm0, xmm5) // 4,1,6,3 + AS2( pand xmm6, xmm2) + AS2( pand xmm2, xmm7) + AS2( por xmm1, xmm6) // 8,5,10,7 + AS2( por xmm2, xmm3) // 12,9,14,11 + + AS2( movdqa xmm5, xmm4) + AS2( movdqa xmm6, xmm0) + AS3( shufpd xmm4, xmm1, 2) // 0,13,10,7 + AS3( shufpd xmm0, xmm2, 2) // 4,1,14,11 + AS3( shufpd xmm1, xmm5, 2) // 8,5,2,15 + AS3( shufpd xmm2, xmm6, 2) // 12,9,6,3 + + // output keystream + AS_XMM_OUTPUT4(SSE2_Salsa_Output_B, REG_input, REG_output, 4, 0, 1, 2, 3, 0, 1, 2, 3, 4) + ASJ( jmp, 5, b) + ASL(4) + + AS_POP_IF86( bp) +#ifdef __GNUC__ + AS_POP_IF86( bx) + ATT_PREFIX + #if CRYPTOPP_BOOL_X64 + : "+r" (input), "+r" (output), "+r" (iterationCount) + : "r" (m_rounds), "r" (m_state.m_ptr), "r" (workspace) + : "%eax", "%rdx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" + #else + : "+a" (input), "+D" (output), "+c" (iterationCount) + : "d" (m_rounds), "S" (m_state.m_ptr) + : "memory", "cc" + #endif + ); +#endif +#ifdef CRYPTOPP_GENERATE_X64_MASM + movdqa xmm6, [rsp + 0200h] + movdqa xmm7, [rsp + 0210h] + movdqa xmm8, [rsp + 0220h] + movdqa xmm9, [rsp + 0230h] + movdqa xmm10, [rsp + 0240h] + movdqa xmm11, [rsp + 0250h] + movdqa xmm12, [rsp + 0260h] + movdqa xmm13, [rsp + 0270h] + movdqa xmm14, [rsp + 0280h] + movdqa xmm15, [rsp + 0290h] + add rsp, 10*16 + 32*16 + 8 + ret +Salsa20_OperateKeystream ENDP +#else + } + else +#endif +#endif +#ifndef CRYPTOPP_GENERATE_X64_MASM + { + word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; + + while (iterationCount--) + { + x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3]; + x4 = m_state[4]; x5 = m_state[5]; x6 = m_state[6]; x7 = m_state[7]; + x8 = m_state[8]; x9 = m_state[9]; x10 = m_state[10]; x11 = m_state[11]; + x12 = m_state[12]; x13 = m_state[13]; x14 = m_state[14]; x15 = m_state[15]; + + for (int i=m_rounds; i>0; i-=2) + { + #define QUARTER_ROUND(a, b, c, d) \ + b = b ^ rotlFixed(a + d, 7); \ + c = c ^ rotlFixed(b + a, 9); \ + d = d ^ rotlFixed(c + b, 13); \ + a = a ^ rotlFixed(d + c, 18); + + QUARTER_ROUND(x0, x4, x8, x12) + QUARTER_ROUND(x1, x5, x9, x13) + QUARTER_ROUND(x2, x6, x10, x14) + QUARTER_ROUND(x3, x7, x11, x15) + + QUARTER_ROUND(x0, x13, x10, x7) + QUARTER_ROUND(x1, x14, x11, x4) + QUARTER_ROUND(x2, x15, x8, x5) + QUARTER_ROUND(x3, x12, x9, x6) + } + + #define SALSA_OUTPUT(x) {\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, x0 + m_state[0]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, x13 + m_state[13]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, x10 + m_state[10]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, x7 + m_state[7]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 4, x4 + m_state[4]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 5, x1 + m_state[1]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 6, x14 + m_state[14]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 7, x11 + m_state[11]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 8, x8 + m_state[8]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 9, x5 + m_state[5]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 10, x2 + m_state[2]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 11, x15 + m_state[15]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 12, x12 + m_state[12]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 13, x9 + m_state[9]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 14, x6 + m_state[6]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 15, x3 + m_state[3]);} + +#ifndef CRYPTOPP_DOXYGEN_PROCESSING + CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SALSA_OUTPUT, BYTES_PER_ITERATION); +#endif + + if (++m_state[8] == 0) + ++m_state[5]; + } + } +} // see comment above if an internal compiler error occurs here + +void XSalsa20_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) +{ + m_rounds = params.GetIntValueWithDefault(Name::Rounds(), 20); + + if (!(m_rounds == 8 || m_rounds == 12 || m_rounds == 20)) + throw InvalidRounds(XSalsa20::StaticAlgorithmName(), m_rounds); + + GetUserKey(LITTLE_ENDIAN_ORDER, m_key.begin(), m_key.size(), key, length); + if (length == 16) + memcpy(m_key.begin()+4, m_key.begin(), 16); + + // "expand 32-byte k" + m_state[0] = 0x61707865; + m_state[1] = 0x3320646e; + m_state[2] = 0x79622d32; + m_state[3] = 0x6b206574; +} + +void XSalsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); + assert(length==24); + + word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; + + GetBlock get(IV); + get(x14)(x11)(x8)(x5)(m_state[14])(m_state[11]); + + x13 = m_key[0]; x10 = m_key[1]; x7 = m_key[2]; x4 = m_key[3]; + x15 = m_key[4]; x12 = m_key[5]; x9 = m_key[6]; x6 = m_key[7]; + x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3]; + + for (int i=m_rounds; i>0; i-=2) + { + QUARTER_ROUND(x0, x4, x8, x12) + QUARTER_ROUND(x1, x5, x9, x13) + QUARTER_ROUND(x2, x6, x10, x14) + QUARTER_ROUND(x3, x7, x11, x15) + + QUARTER_ROUND(x0, x13, x10, x7) + QUARTER_ROUND(x1, x14, x11, x4) + QUARTER_ROUND(x2, x15, x8, x5) + QUARTER_ROUND(x3, x12, x9, x6) + } + + m_state[13] = x0; m_state[10] = x1; m_state[7] = x2; m_state[4] = x3; + m_state[15] = x14; m_state[12] = x11; m_state[9] = x8; m_state[6] = x5; + m_state[8] = m_state[5] = 0; +} + +NAMESPACE_END + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM diff --git a/external/crypto++-5.6.3/salsa.h b/external/crypto++-5.6.3/salsa.h new file mode 100644 index 000000000..92dd0fb50 --- /dev/null +++ b/external/crypto++-5.6.3/salsa.h @@ -0,0 +1,84 @@ +// salsa.h - written and placed in the public domain by Wei Dai + +//! \file salsa.h +//! \brief Classes for Salsa and Salsa20 stream ciphers + +#ifndef CRYPTOPP_SALSA_H +#define CRYPTOPP_SALSA_H + +#include "strciphr.h" +#include "secblock.h" + +// TODO: work around GCC 4.8+ issue with SSE2 ASM until the exact details are known +// and fix is released. Duplicate with "valgrind ./cryptest.exe tv salsa" +// "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 +#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) || (CRYPTOPP_GCC_VERSION >= 40800) +# define CRYPTOPP_DISABLE_SALSA_ASM +#endif + +NAMESPACE_BEGIN(CryptoPP) + +//! \class Salsa20_Info +//! \brief Salsa block cipher information +struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8> +{ + static const char *StaticAlgorithmName() {return "Salsa20";} +}; + +class CRYPTOPP_NO_VTABLE Salsa20_Policy : public AdditiveCipherConcretePolicy +{ +protected: + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); + void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); + void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); + bool CipherIsRandomAccess() const {return true;} + void SeekToIteration(lword iterationCount); +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SALSA_ASM) + unsigned int GetAlignment() const; + unsigned int GetOptimalBlockSize() const; +#endif + + FixedSizeAlignedSecBlock m_state; + int m_rounds; +}; + +// Salsa20, variable rounds: 8, 12 or 20 (default 20) +//! \class Salsa20 +//! \brief Salsa20 block cipher information +//! \details Salsa20 provides a variable number of rounds: 8, 12 or 20. The default number of rounds is 20. +struct Salsa20 : public Salsa20_Info, public SymmetricCipherDocumentation +{ + typedef SymmetricCipherFinal >, Salsa20_Info> Encryption; + typedef Encryption Decryption; +}; + +//! \class XSalsa20_Info +//! \brief XSalsa20 block cipher information +struct XSalsa20_Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 24> +{ + static const char *StaticAlgorithmName() {return "XSalsa20";} +}; + +class CRYPTOPP_NO_VTABLE XSalsa20_Policy : public Salsa20_Policy +{ +public: + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); + void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); + +protected: + FixedSizeSecBlock m_key; +}; + +// XSalsa20, variable rounds: 8, 12 or 20 (default 20) +//! \class XSalsa20 +//! \brief XSalsa20 block cipher information +//! \details XSalsa20 provides a variable number of rounds: 8, 12 or 20. The default number of rounds is 20. +struct XSalsa20 : public XSalsa20_Info, public SymmetricCipherDocumentation +{ + typedef SymmetricCipherFinal >, XSalsa20_Info> Encryption; + typedef Encryption Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/seal.cpp b/external/crypto++-5.6.3/seal.cpp new file mode 100644 index 000000000..7ec9775ab --- /dev/null +++ b/external/crypto++-5.6.3/seal.cpp @@ -0,0 +1,219 @@ +// seal.cpp - written and placed in the public domain by Wei Dai +// updated to SEAL 3.0 by Leonard Janke + +#include "pch.h" + +#include "seal.h" +#include "sha.h" +#include "misc.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void SEAL_TestInstantiations() +{ + SEAL<>::Encryption x; +} +#endif + +struct SEAL_Gamma +{ + SEAL_Gamma(const byte *key) + : H(5), Z(5), D(16), lastIndex(0xffffffff) + { + GetUserKey(BIG_ENDIAN_ORDER, H.begin(), 5, key, 20); + memset(D, 0, 64); + } + + word32 Apply(word32 i); + + SecBlock H, Z, D; + word32 lastIndex; +}; + +word32 SEAL_Gamma::Apply(word32 i) +{ + word32 shaIndex = i/5; + if (shaIndex != lastIndex) + { + memcpy(Z, H, 20); + D[0] = shaIndex; + SHA::Transform(Z, D); + lastIndex = shaIndex; + } + return Z[i%5]; +} + +template +void SEAL_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) +{ + CRYPTOPP_UNUSED(length); + m_insideCounter = m_outsideCounter = m_startCount = 0; + + unsigned int L = params.GetIntValueWithDefault("NumberOfOutputBitsPerPositionIndex", 32*1024); + m_iterationsPerCount = L / 8192; + + SEAL_Gamma gamma(key); + unsigned int i; + + for (i=0; i<512; i++) + m_T[i] = gamma.Apply(i); + + for (i=0; i<256; i++) + m_S[i] = gamma.Apply(0x1000+i); + + m_R.New(4*(L/8192)); + + for (i=0; i +void SEAL_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(IV), CRYPTOPP_UNUSED(length); + assert(length==4); + + m_outsideCounter = IV ? GetWord(false, BIG_ENDIAN_ORDER, IV) : 0; + m_startCount = m_outsideCounter; + m_insideCounter = 0; +} + +template +void SEAL_Policy::SeekToIteration(lword iterationCount) +{ + m_outsideCounter = m_startCount + (unsigned int)(iterationCount / m_iterationsPerCount); + m_insideCounter = (unsigned int)(iterationCount % m_iterationsPerCount); +} + +template +void SEAL_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) +{ + word32 a, b, c, d, n1, n2, n3, n4; + unsigned int p, q; + + for (size_t iteration = 0; iteration < iterationCount; ++iteration) + { +#define Ttab(x) *(word32 *)((byte *)m_T.begin()+x) + + a = m_outsideCounter ^ m_R[4*m_insideCounter]; + b = rotrFixed(m_outsideCounter, 8U) ^ m_R[4*m_insideCounter+1]; + c = rotrFixed(m_outsideCounter, 16U) ^ m_R[4*m_insideCounter+2]; + d = rotrFixed(m_outsideCounter, 24U) ^ m_R[4*m_insideCounter+3]; + + for (unsigned int j=0; j<2; j++) + { + p = a & 0x7fc; + b += Ttab(p); + a = rotrFixed(a, 9U); + + p = b & 0x7fc; + c += Ttab(p); + b = rotrFixed(b, 9U); + + p = c & 0x7fc; + d += Ttab(p); + c = rotrFixed(c, 9U); + + p = d & 0x7fc; + a += Ttab(p); + d = rotrFixed(d, 9U); + } + + n1 = d, n2 = b, n3 = a, n4 = c; + + p = a & 0x7fc; + b += Ttab(p); + a = rotrFixed(a, 9U); + + p = b & 0x7fc; + c += Ttab(p); + b = rotrFixed(b, 9U); + + p = c & 0x7fc; + d += Ttab(p); + c = rotrFixed(c, 9U); + + p = d & 0x7fc; + a += Ttab(p); + d = rotrFixed(d, 9U); + + // generate 8192 bits + for (unsigned int i=0; i<64; i++) + { + p = a & 0x7fc; + a = rotrFixed(a, 9U); + b += Ttab(p); + b ^= a; + + q = b & 0x7fc; + b = rotrFixed(b, 9U); + c ^= Ttab(q); + c += b; + + p = (p+c) & 0x7fc; + c = rotrFixed(c, 9U); + d += Ttab(p); + d ^= c; + + q = (q+d) & 0x7fc; + d = rotrFixed(d, 9U); + a ^= Ttab(q); + a += d; + + p = (p+a) & 0x7fc; + b ^= Ttab(p); + a = rotrFixed(a, 9U); + + q = (q+b) & 0x7fc; + c += Ttab(q); + b = rotrFixed(b, 9U); + + p = (p+c) & 0x7fc; + d ^= Ttab(p); + c = rotrFixed(c, 9U); + + q = (q+d) & 0x7fc; + d = rotrFixed(d, 9U); + a += Ttab(q); + +#define SEAL_OUTPUT(x) \ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, b + m_S[4*i+0]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, c ^ m_S[4*i+1]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, d + m_S[4*i+2]);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a ^ m_S[4*i+3]); + + CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SEAL_OUTPUT, 4*4); + + if (i & 1) + { + a += n3; + b += n4; + c ^= n3; + d ^= n4; + } + else + { + a += n1; + b += n2; + c ^= n1; + d ^= n2; + } + } + + if (++m_insideCounter == m_iterationsPerCount) + { + ++m_outsideCounter; + m_insideCounter = 0; + } + } + + a = b = c = d = n1 = n2 = n3 = n4 = 0; + p = q = 0; +} + +template class SEAL_Policy; +template class SEAL_Policy; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/seal.h b/external/crypto++-5.6.3/seal.h new file mode 100644 index 000000000..386eeb2a0 --- /dev/null +++ b/external/crypto++-5.6.3/seal.h @@ -0,0 +1,50 @@ +// seal.h - written and placed in the public domain by Wei Dai + +//! \file seal.h +//! \brief Classes for SEAL stream cipher + +#ifndef CRYPTOPP_SEAL_H +#define CRYPTOPP_SEAL_H + +#include "strciphr.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +template +struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4> +{ + static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";} +}; + +template +class CRYPTOPP_NO_VTABLE SEAL_Policy : public AdditiveCipherConcretePolicy, public SEAL_Info +{ +protected: + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); + void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); + void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); + bool CipherIsRandomAccess() const {return true;} + void SeekToIteration(lword iterationCount); + +private: + FixedSizeSecBlock m_T; + FixedSizeSecBlock m_S; + SecBlock m_R; + + word32 m_startCount, m_iterationsPerCount; + word32 m_outsideCounter, m_insideCounter; +}; + +//! SEAL +template +struct SEAL : public SEAL_Info, public SymmetricCipherDocumentation +{ + typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, SEAL_Info > Encryption; + typedef Encryption Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/secblock.h b/external/crypto++-5.6.3/secblock.h new file mode 100644 index 000000000..ef8cab103 --- /dev/null +++ b/external/crypto++-5.6.3/secblock.h @@ -0,0 +1,804 @@ +// secblock.h - written and placed in the public domain by Wei Dai + +//! \file secblock.h +//! \brief Classes and functions for secure memory allocations. + +#ifndef CRYPTOPP_SECBLOCK_H +#define CRYPTOPP_SECBLOCK_H + +#include "config.h" +#include "stdcpp.h" +#include "misc.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4700) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6386) +# endif +#endif + +NAMESPACE_BEGIN(CryptoPP) + +// ************** secure memory allocation *************** + +//! \class AllocatorBase +//! \brief Base class for all allocators used by SecBlock +//! \tparam T the class or type +template +class AllocatorBase +{ +public: + typedef T value_type; + typedef size_t size_type; +#ifdef CRYPTOPP_MSVCRT6 + typedef ptrdiff_t difference_type; +#else + typedef std::ptrdiff_t difference_type; +#endif + typedef T * pointer; + typedef const T * const_pointer; + typedef T & reference; + typedef const T & const_reference; + + pointer address(reference r) const {return (&r);} + const_pointer address(const_reference r) const {return (&r); } + void construct(pointer p, const T& val) {new (p) T(val);} + void destroy(pointer p) {CRYPTOPP_UNUSED(p); p->~T();} + + //! \brief Returns the maximum number of elements the allocator can provide + //! \returns the maximum number of elements the allocator can provide + //! \details Internally, preprocessor macros are used rather than std::numeric_limits + //! because the latter is \a not a \a constexpr. Some compilers, like Clang, do not + //! optimize it well under all circumstances. Compilers like GCC, ICC and MSVC appear + //! to optimize it well in either form. + size_type max_size() const {return (SIZE_MAX/sizeof(T));} + +#if defined(CRYPTOPP_CXX11_VARIADIC_TEMPLATES) || defined(CRYPTOPP_DOXYGEN_PROCESSING) + + //! \brief Constructs a new U using variadic arguments + //! \tparam U the type to be forwarded + //! \tparam Args the arguments to be forwarded + //! \param ptr pointer to type U + //! \param args variadic arguments + //! \details This is a C++11 feature. It is available when CRYPTOPP_CXX11_VARIADIC_TEMPLATES + //! is defined. The define is controlled by compiler versions detected in config.h. + template + void construct(U* ptr, Args&&... args) {::new ((void*)ptr) U(std::forward(args)...);} + + //! \brief Destroys an U constructed with variadic arguments + //! \tparam U the type to be forwarded + //! \details This is a C++11 feature. It is available when CRYPTOPP_CXX11_VARIADIC_TEMPLATES + //! is defined. The define is controlled by compiler versions detected in config.h. + template + void destroy(U* ptr) {if(ptr) ptr->~U();} + +#endif + +protected: + + //! \brief Verifies the allocator can satisfy a request based on size + //! \param size the number of elements + //! \throws InvalidArgument + //! \details CheckSize verifies the number of elements requested is valid. + //! \details If size is greater than max_size(), then InvalidArgument is thrown. + //! The library throws InvalidArgument if the size is too large to satisfy. + //! \details Internally, preprocessor macros are used rather than std::numeric_limits + //! because the latter is \a not a \a constexpr. Some compilers, like Clang, do not + //! optimize it well under all circumstances. Compilers like GCC, ICC and MSVC appear + //! to optimize it well in either form. + //! \note size is the count of elements, and not the number of bytes + static void CheckSize(size_t size) + { + // C++ throws std::bad_alloc (C++03) or std::bad_array_new_length (C++11) here. + if (size > (SIZE_MAX/sizeof(T))) + throw InvalidArgument("AllocatorBase: requested size would cause integer overflow"); + } +}; + +#define CRYPTOPP_INHERIT_ALLOCATOR_TYPES \ +typedef typename AllocatorBase::value_type value_type;\ +typedef typename AllocatorBase::size_type size_type;\ +typedef typename AllocatorBase::difference_type difference_type;\ +typedef typename AllocatorBase::pointer pointer;\ +typedef typename AllocatorBase::const_pointer const_pointer;\ +typedef typename AllocatorBase::reference reference;\ +typedef typename AllocatorBase::const_reference const_reference; + +//! \brief Reallocation function +//! \tparam T the class or type +//! \tparam A the class or type's allocator +//! \param alloc the allocator +//! \param oldPtr the previous allocation +//! \param oldSize the size of the previous allocation +//! \param newSize the new, requested size +//! \param preserve flag that indicates if the old allocation should be preserved +//! \note oldSize and newSize are the count of elements, and not the +//! number of bytes. +template +typename A::pointer StandardReallocate(A& alloc, T *oldPtr, typename A::size_type oldSize, typename A::size_type newSize, bool preserve) +{ + assert((oldPtr && oldSize) || !(oldPtr || oldSize)); + if (oldSize == newSize) + return oldPtr; + + if (preserve) + { + typename A::pointer newPointer = alloc.allocate(newSize, NULL); + const size_t copySize = STDMIN(oldSize, newSize) * sizeof(T); + + if (oldPtr && newPointer) {memcpy_s(newPointer, copySize, oldPtr, copySize);} + alloc.deallocate(oldPtr, oldSize); + return newPointer; + } + else + { + alloc.deallocate(oldPtr, oldSize); + return alloc.allocate(newSize, NULL); + } +} + +//! \class AllocatorWithCleanup +//! \brief Allocates a block of memory with cleanup +//! \tparam T class or type +//! \tparam T_Align16 boolean that determines whether allocations should be aligned on 16-byte boundaries +//! \details If T_Align16 is true, then AllocatorWithCleanup calls AlignedAllocate() +//! for memory allocations. If T_Align16 is false, then AllocatorWithCleanup() calls +//! UnalignedAllocate() for memory allocations. +//! \details Template parameter T_Align16 is effectively controlled by cryptlib.h and mirrors +//! CRYPTOPP_BOOL_ALIGN16. CRYPTOPP_BOOL_ALIGN16 is often used as the template parameter. +template +class AllocatorWithCleanup : public AllocatorBase +{ +public: + CRYPTOPP_INHERIT_ALLOCATOR_TYPES + + //! \brief Allocates a block of memory + //! \param ptr the size of the allocation + //! \param size the size of the allocation + //! \returns a memory block + //! \throws InvalidArgument + //! \details allocate() first checks the size of the request. If it is non-0 + //! and less than max_size(), then an attempt is made to fulfill the request using either + //! AlignedAllocate() or UnalignedAllocate(). + //! \details AlignedAllocate() is used if T_Align16 is true. + //! UnalignedAllocate() used if T_Align16 is false. + //! \details This is the C++ *Placement New* operator. ptr is not used, and the function + //! asserts in Debug builds if ptr is non-NULL. + //! \sa CallNewHandler() for the methods used to recover from a failed + //! allocation attempt. + //! \note size is the count of elements, and not the number of bytes + pointer allocate(size_type size, const void *ptr = NULL) + { + CRYPTOPP_UNUSED(ptr); assert(ptr == NULL); + this->CheckSize(size); + if (size == 0) + return NULL; + +#if CRYPTOPP_BOOL_ALIGN16 + // TODO: should this need the test 'size*sizeof(T) >= 16'? + if (T_Align16 && size*sizeof(T) >= 16) + return (pointer)AlignedAllocate(size*sizeof(T)); +#endif + + return (pointer)UnalignedAllocate(size*sizeof(T)); + } + + //! \brief Deallocates a block of memory + //! \param ptr the size of the allocation + //! \param size the size of the allocation + //! \details Internally, SecureWipeArray() is called before deallocating the memory. + //! Once the memory block is wiped or zeroized, AlignedDeallocate() or + //! UnalignedDeallocate() is called. + //! \details AlignedDeallocate() is used if T_Align16 is true. + //! UnalignedDeallocate() used if T_Align16 is false. + void deallocate(void *ptr, size_type size) + { + assert((ptr && size) || !(ptr || size)); + SecureWipeArray((pointer)ptr, size); + +#if CRYPTOPP_BOOL_ALIGN16 + if (T_Align16 && size*sizeof(T) >= 16) + return AlignedDeallocate(ptr); +#endif + + UnalignedDeallocate(ptr); + } + + //! \brief Reallocates a block of memory + //! \param oldPtr the previous allocation + //! \param oldSize the size of the previous allocation + //! \param newSize the new, requested size + //! \param preserve flag that indicates if the old allocation should be preserved + //! \returns pointer to the new memory block + //! \details Internally, reallocate() calls StandardReallocate(). + //! \details If preserve is true, then index 0 is used to begin copying the + //! old memory block to the new one. If the block grows, then the old array + //! is copied in its entirety. If the block shrinks, then only newSize + //! elements are copied from the old block to the new one. + //! \note oldSize and newSize are the count of elements, and not the + //! number of bytes. + pointer reallocate(T *oldPtr, size_type oldSize, size_type newSize, bool preserve) + { + assert((oldPtr && oldSize) || !(oldPtr || oldSize)); + return StandardReallocate(*this, oldPtr, oldSize, newSize, preserve); + } + + // VS.NET STL enforces the policy of "All STL-compliant allocators have to provide a + // template class member called rebind". + template struct rebind { typedef AllocatorWithCleanup other; }; +#if _MSC_VER >= 1500 + AllocatorWithCleanup() {} + template AllocatorWithCleanup(const AllocatorWithCleanup &) {} +#endif +}; + +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; +#if CRYPTOPP_BOOL_X86 +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; // for Integer +#endif + +//! \class NullAllocator +//! \brief NULL allocator +//! \tparam T class or type +//! \details A NullAllocator is useful for fixed-size, stack based allocations +//! (i.e., static arrays used by FixedSizeAllocatorWithCleanup). +//! \details A NullAllocator always returns 0 for max_size(), and always returns +//! NULL for allocation requests. Though the allocator does not allocate at +//! runtime, it does perform a secure wipe or zeroization during cleanup. +template +class NullAllocator : public AllocatorBase +{ +public: + CRYPTOPP_INHERIT_ALLOCATOR_TYPES + + // TODO: should this return NULL or throw bad_alloc? Non-Windows C++ standard + // libraries always throw. And late mode Windows throws. Early model Windows + // (circa VC++ 6.0) returned NULL. + pointer allocate(size_type n, const void* unused = NULL) + { + CRYPTOPP_UNUSED(n); CRYPTOPP_UNUSED(unused); + assert(false); return NULL; + } + + void deallocate(void *p, size_type n) + { + CRYPTOPP_UNUSED(p); CRYPTOPP_UNUSED(n); + assert(false); + } + + size_type max_size() const {return 0;} +}; + +//! \class FixedSizeAllocatorWithCleanup +//! \brief Static secure memory block with cleanup +//! \tparam T class or type +//! \tparam S fixed-size of the stack-based memory block +//! \tparam A AllocatorBase derived class for allocation and cleanup +//! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- +//! based allocation at compile time. The class can grow its memory +//! block at runtime if a suitable allocator is available. If size +//! grows beyond S and a suitable allocator is available, then the +//! statically allocated array is obsoleted. +//! \note This allocator can't be used with standard collections because +//! they require that all objects of the same allocator type are equivalent. +template , bool T_Align16 = false> +class FixedSizeAllocatorWithCleanup : public AllocatorBase +{ +public: + CRYPTOPP_INHERIT_ALLOCATOR_TYPES + + //! \brief Constructs a FixedSizeAllocatorWithCleanup + FixedSizeAllocatorWithCleanup() : m_allocated(false) {} + + //! \brief Allocates a block of memory + //! \param size size of the memory block + //! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- + //! based allocation at compile time. If size is less than or equal to + //! S, then a pointer to the static array is returned. + //! \details The class can grow its memory block at runtime if a suitable + //! allocator is available. If size grows beyond S and a suitable + //! allocator is available, then the statically allocated array is + //! obsoleted. If a suitable allocator is \a not available, as with a + //! NullAllocator, then the function returns NULL and a runtime error + //! eventually occurs. + //! \note size is the count of elements, and not the number of bytes. + //! \sa reallocate(), SecBlockWithHint + pointer allocate(size_type size) + { + assert(IsAlignedOn(m_array, 8)); + + if (size <= S && !m_allocated) + { + m_allocated = true; + return GetAlignedArray(); + } + else + return m_fallbackAllocator.allocate(size); + } + + //! \brief Allocates a block of memory + //! \param size size of the memory block + //! \param hint an unused hint + //! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- + //! based allocation at compile time. If size is less than or equal to + //! S, then a pointer to the static array is returned. + //! \details The class can grow its memory block at runtime if a suitable + //! allocator is available. If size grows beyond S and a suitable + //! allocator is available, then the statically allocated array is + //! obsoleted. If a suitable allocator is \a not available, as with a + //! NullAllocator, then the function returns NULL and a runtime error + //! eventually occurs. + //! \note size is the count of elements, and not the number of bytes. + //! \sa reallocate(), SecBlockWithHint + pointer allocate(size_type size, const void *hint) + { + if (size <= S && !m_allocated) + { + m_allocated = true; + return GetAlignedArray(); + } + else + return m_fallbackAllocator.allocate(size, hint); + } + + //! \brief Deallocates a block of memory + //! \param ptr a pointer to the memory block to deallocate + //! \param size size of the memory block + //! \details The memory block is wiped or zeroized before deallocation. + //! If the statically allocated memory block is active, then no + //! additional actions are taken after the wipe. + //! \details If a dynamic memory block is active, then the pointer and + //! size are passed to the allocator for deallocation. + void deallocate(void *ptr, size_type size) + { + if (ptr == GetAlignedArray()) + { + assert(size <= S); + assert(m_allocated); + m_allocated = false; + SecureWipeArray((pointer)ptr, size); + } + else + m_fallbackAllocator.deallocate(ptr, size); + } + + //! \brief Reallocates a block of memory + //! \param oldPtr the previous allocation + //! \param oldSize the size of the previous allocation + //! \param newSize the new, requested size + //! \param preserve flag that indicates if the old allocation should be preserved + //! \returns pointer to the new memory block + //! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- + //! based allocation at compile time. If size is less than or equal to + //! S, then a pointer to the static array is returned. + //! \details The class can grow its memory block at runtime if a suitable + //! allocator is available. If size grows beyond S and a suitable + //! allocator is available, then the statically allocated array is + //! obsoleted. If a suitable allocator is \a not available, as with a + //! NullAllocator, then the function returns NULL and a runtime error + //! eventually occurs. + //! \note size is the count of elements, and not the number of bytes. + //! \sa reallocate(), SecBlockWithHint + pointer reallocate(pointer oldPtr, size_type oldSize, size_type newSize, bool preserve) + { + if (oldPtr == GetAlignedArray() && newSize <= S) + { + assert(oldSize <= S); + if (oldSize > newSize) + SecureWipeArray(oldPtr+newSize, oldSize-newSize); + return oldPtr; + } + + pointer newPointer = allocate(newSize, NULL); + if (preserve && newSize) + { + const size_t copySize = STDMIN(oldSize, newSize); + memcpy_s(newPointer, copySize, oldPtr, copySize); + } + deallocate(oldPtr, oldSize); + return newPointer; + } + + size_type max_size() const {return STDMAX(m_fallbackAllocator.max_size(), S);} + +private: +#ifdef __BORLANDC__ + T* GetAlignedArray() {return m_array;} + T m_array[S]; +#else + T* GetAlignedArray() {return (CRYPTOPP_BOOL_ALIGN16 && T_Align16) ? (T*)(((byte *)m_array) + (0-(size_t)m_array)%16) : m_array;} + CRYPTOPP_ALIGN_DATA(8) T m_array[(CRYPTOPP_BOOL_ALIGN16 && T_Align16) ? S+8/sizeof(T) : S]; +#endif + A m_fallbackAllocator; + bool m_allocated; +}; + +//! \class SecBlock +//! \brief Secure memory block with allocator and cleanup +//! \tparam T a class or type +//! \tparam A AllocatorWithCleanup derived class for allocation and cleanup +template > +class SecBlock +{ +public: + typedef typename A::value_type value_type; + typedef typename A::pointer iterator; + typedef typename A::const_pointer const_iterator; + typedef typename A::size_type size_type; + + //! \brief Construct a SecBlock with space for size elements. + //! \param size the number of elements in the allocation + //! \throws std::bad_alloc + //! \details The elements are not initialized. + //! \note size is the count of elements, and not the number of bytes + explicit SecBlock(size_type size=0) + : m_size(size), m_ptr(m_alloc.allocate(size, NULL)) { } + + //! \brief Copy construct a SecBlock from another SecBlock + //! \param t the other SecBlock + //! \throws std::bad_alloc + SecBlock(const SecBlock &t) + : m_size(t.m_size), m_ptr(m_alloc.allocate(t.m_size, NULL)) { + assert((!t.m_ptr && !m_size) || (t.m_ptr && m_size)); + if (t.m_ptr) {memcpy_s(m_ptr, m_size*sizeof(T), t.m_ptr, t.m_size*sizeof(T));} + } + + //! \brief Construct a SecBlock from an array of elements. + //! \param ptr a pointer to an array of T + //! \param len the number of elements in the memory block + //! \throws std::bad_alloc + //! \details If ptr!=NULL and len!=0, then the block is initialized from the pointer ptr. + //! If ptr==NULL and len!=0, then the block is initialized to 0. + //! Otherwise, the block is empty and uninitialized. + //! \note size is the count of elements, and not the number of bytes + SecBlock(const T *ptr, size_type len) + : m_size(len), m_ptr(m_alloc.allocate(len, NULL)) { + assert((!m_ptr && !m_size) || (m_ptr && m_size)); + if (ptr && m_ptr) + memcpy_s(m_ptr, m_size*sizeof(T), ptr, len*sizeof(T)); + else if (m_size) + memset(m_ptr, 0, m_size*sizeof(T)); + } + + ~SecBlock() + {m_alloc.deallocate(m_ptr, m_size);} + +#ifdef __BORLANDC__ + operator T *() const + {return (T*)m_ptr;} +#else + operator const void *() const + {return m_ptr;} + operator void *() + {return m_ptr;} + + operator const T *() const + {return m_ptr;} + operator T *() + {return m_ptr;} +#endif + + //! \brief Provides an iterator pointing to the first element in the memory block + //! \returns iterator pointing to the first element in the memory block + iterator begin() + {return m_ptr;} + //! \brief Provides a constant iterator pointing to the first element in the memory block + //! \returns constant iterator pointing to the first element in the memory block + const_iterator begin() const + {return m_ptr;} + //! \brief Provides an iterator pointing beyond the last element in the memory block + //! \returns iterator pointing beyond the last element in the memory block + iterator end() + {return m_ptr+m_size;} + //! \brief Provides a constant iterator pointing beyond the last element in the memory block + //! \returns constant iterator pointing beyond the last element in the memory block + const_iterator end() const + {return m_ptr+m_size;} + + //! \brief Provides a pointer to the first element in the memory block + //! \returns pointer to the first element in the memory block + typename A::pointer data() {return m_ptr;} + //! \brief Provides a pointer to the first element in the memory block + //! \returns constant pointer to the first element in the memory block + typename A::const_pointer data() const {return m_ptr;} + + //! \brief Provides the count of elements in the SecBlock + //! \returns number of elements in the memory block + //! \note the return value is the count of elements, and not the number of bytes + size_type size() const {return m_size;} + //! \brief Determines if the SecBlock is empty + //! \returns true if number of elements in the memory block is 0, false otherwise + bool empty() const {return m_size == 0;} + + //! \brief Provides a byte pointer to the first element in the memory block + //! \returns byte pointer to the first element in the memory block + byte * BytePtr() {return (byte *)m_ptr;} + //! \brief Return a byte pointer to the first element in the memory block + //! \returns constant byte pointer to the first element in the memory block + const byte * BytePtr() const {return (const byte *)m_ptr;} + //! \brief Provides the number of bytes in the SecBlock + //! \return the number of bytes in the memory block + //! \note the return value is the number of bytes, and not count of elements. + size_type SizeInBytes() const {return m_size*sizeof(T);} + + //! \brief Set contents and size from an array + //! \param ptr a pointer to an array of T + //! \param len the number of elements in the memory block + //! \details If the memory block is reduced in size, then the unused area is set to 0. + void Assign(const T *ptr, size_type len) + { + New(len); + if (m_ptr && ptr && len) + {memcpy_s(m_ptr, m_size*sizeof(T), ptr, len*sizeof(T));} + } + + //! \brief Copy contents from another SecBlock + //! \param t the other SecBlock + //! \details Assign checks for self assignment. + //! \details If the memory block is reduced in size, then the unused area is set to 0. + void Assign(const SecBlock &t) + { + if (this != &t) + { + New(t.m_size); + if (m_ptr && t.m_ptr && t.m_size) + {memcpy_s(m_ptr, m_size*sizeof(T), t, t.m_size*sizeof(T));} + } + } + + //! \brief Assign contents from another SecBlock + //! \param t the other SecBlock + //! \details Internally, operator=() calls Assign(). + //! \details If the memory block is reduced in size, then the unused area is set to 0. + SecBlock& operator=(const SecBlock &t) + { + // Assign guards for self-assignment + Assign(t); + return *this; + } + + //! \brief Append contents from another SecBlock + //! \param t the other SecBlock + //! \details Internally, this SecBlock calls Grow and then copies the new content. + //! \details If the memory block is reduced in size, then the unused area is set to 0. + SecBlock& operator+=(const SecBlock &t) + { + assert((!t.m_ptr && !t.m_size) || (t.m_ptr && t.m_ptr.m_size)); + + if(t.size) + { + size_type oldSize = m_size; + Grow(m_size+t.m_size); + + if (m_ptr && t.m_ptr) + {memcpy_s(m_ptr+oldSize, (m_size-oldSize)*sizeof(T), t.m_ptr, t.m_size*sizeof(T));} + } + return *this; + } + + //! \brief Concatenate contents from another SecBlock + //! \param t the other SecBlock + //! \returns a newly constructed SecBlock that is a conacentation of this and t + //! \details Internally, a temporary SecBlock is created and the content from this + //! SecBlock and the other SecBlock are concatenated. The temporary + //! SecBlock is returned to the caller. + SecBlock operator+(const SecBlock &t) + { + assert((!m_ptr && !m_size) || (m_ptr && m_size)); + assert((!t.m_ptr && !t.m_size) || (t.m_ptr && t.m_ptr.m_size)); + if(!t.size) return SecBlock(*this); + + SecBlock result(m_size+t.m_size); + memcpy_s(result.m_ptr, result.m_size*sizeof(T), m_ptr, m_size*sizeof(T)); + memcpy_s(result.m_ptr+m_size, (t.m_size-m_size)*sizeof(T), t.m_ptr, t.m_size*sizeof(T)); + return result; + } + + //! \brief Bitwise compare two SecBlocks + //! \param t the other SecBlock + //! \returns true if the size and bits are equal, false otherwise + //! \details Uses a constant time compare if the arrays are equal size. The constant time + //! compare is VerifyBufsEqual() found in misc.h. + //! \sa operator!=() + bool operator==(const SecBlock &t) const + { + return m_size == t.m_size && VerifyBufsEqual(m_ptr, t.m_ptr, m_size*sizeof(T)); + } + + //! \brief Bitwise compare two SecBlocks + //! \param t the other SecBlock + //! \returns true if the size and bits are equal, false otherwise + //! \details Uses a constant time compare if the arrays are equal size. The constant time + //! compare is VerifyBufsEqual() found in misc.h. + //! \details Internally, operator!=() returns the inverse of operator==(). + //! \sa operator==() + bool operator!=(const SecBlock &t) const + { + return !operator==(t); + } + + //! \brief Change size without preserving contents + //! \param newSize the new size of the memory block + //! \details Old content is \a not preserved. If the memory block is reduced in size, + //! then the unused content is set to 0. If the memory block grows in size, then + //! all content is uninitialized. + //! \details Internally, this SecBlock calls reallocate(). + //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() + void New(size_type newSize) + { + m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, false); + m_size = newSize; + } + + //! \brief Change size without preserving contents + //! \param newSize the new size of the memory block + //! \details Old content is not preserved. If the memory block is reduced in size, + //! then the unused content is set to 0. Existing and new content is set to 0. + //! \details Internally, this SecBlock calls reallocate(). + //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() + void CleanNew(size_type newSize) + { + New(newSize); + if (m_ptr) {memset_z(m_ptr, 0, m_size*sizeof(T));} + } + + //! \brief Change size and preserve contents + //! \param newSize the new size of the memory block + //! \details Old content is preserved. If the memory block grows in size, then + //! all content is uninitialized. + //! \details Internally, this SecBlock calls reallocate(). + //! \note reallocate() is called if the size increases. If the size does not + //! increase, then Grow does not take action. If the size must change, + //! then use resize(). + //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() + void Grow(size_type newSize) + { + if (newSize > m_size) + { + m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true); + m_size = newSize; + } + } + + //! \brief Change size and preserve contents + //! \param newSize the new size of the memory block + //! \details Old content is preserved. If the memory block is reduced in size, + //! then the unused content is set to 0. If the memory block grows in size, + //! then the new content is uninitialized. + //! \details Internally, this SecBlock calls reallocate(). + //! \note reallocate() is called if the size increases. If the size does not + //! increase, then Grow does not take action. If the size must change, + //! then use resize(). + //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() + void CleanGrow(size_type newSize) + { + if (newSize > m_size) + { + m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true); + memset_z(m_ptr+m_size, 0, (newSize-m_size)*sizeof(T)); + m_size = newSize; + } + } + + //! \brief Change size and preserve contents + //! \param newSize the new size of the memory block + //! \details Old content is preserved. If the memory block grows in size, then + //! all content is uninitialized. + //! \details Internally, this SecBlock calls reallocate(). + //! \note reallocate() is called if the size increases. If the size does not + //! increase, then Grow does not take action. If the size must change, + //! then use resize(). + //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() + void resize(size_type newSize) + { + m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true); + m_size = newSize; + } + + //! \brief Swap contents with another SecBlock + //! \param b the other SecBlock + //! \details Internally, std::swap() is called on m_alloc, m_size and m_ptr. + void swap(SecBlock &b) + { + // Swap must occur on the allocator in case its FixedSize that spilled into the heap. + std::swap(m_alloc, b.m_alloc); + std::swap(m_size, b.m_size); + std::swap(m_ptr, b.m_ptr); + } + +// protected: + A m_alloc; + size_type m_size; + T *m_ptr; +}; + +#ifdef CRYPTOPP_DOXYGEN_PROCESSING +//! \class SecByteBlock +//! \brief SecByteBlock is a SecBlock typedef. +class SecByteBlock : public SecBlock {}; +//! \class SecWordBlock +//! \brief SecWordBlock is a SecBlock typedef. +class SecWordBlock : public SecBlock {}; +//! \class AlignedSecByteBlock +//! \brief AlignedSecByteBlock is a SecBlock > typedef. +class AlignedSecByteBlock SecBlock > {}; +#else +typedef SecBlock SecByteBlock; +typedef SecBlock SecWordBlock; +typedef SecBlock > AlignedSecByteBlock; +#endif + +// No need for move semantics on derived class *if* the class does not add any +// data members; see http://stackoverflow.com/q/31755703, and Rule of {0|3|5}. + +//! \class FixedSizeSecBlock +//! \brief Fixed size stack-based SecBlock +//! \tparam T class or type +//! \tparam S fixed-size of the stack-based memory block +//! \tparam A AllocatorBase derived class for allocation and cleanup +template > +class FixedSizeSecBlock : public SecBlock +{ +public: + //! \brief Construct a FixedSizeSecBlock + explicit FixedSizeSecBlock() : SecBlock(S) {} +}; + +//! \class FixedSizeAlignedSecBlock +//! \brief Fixed size stack-based SecBlock with 16-byte alignment +//! \tparam T class or type +//! \tparam S fixed-size of the stack-based memory block +//! \tparam A AllocatorBase derived class for allocation and cleanup +template +class FixedSizeAlignedSecBlock : public FixedSizeSecBlock, T_Align16> > +{ +}; + +//! \class SecBlockWithHint +//! \brief Stack-based SecBlock that grows into the heap +//! \tparam T class or type +//! \tparam S fixed-size of the stack-based memory block +//! \tparam A AllocatorBase derived class for allocation and cleanup +template > > +class SecBlockWithHint : public SecBlock +{ +public: + //! construct a SecBlockWithHint with a count of elements + explicit SecBlockWithHint(size_t size) : SecBlock(size) {} +}; + +template +inline bool operator==(const CryptoPP::AllocatorWithCleanup&, const CryptoPP::AllocatorWithCleanup&) {return (true);} +template +inline bool operator!=(const CryptoPP::AllocatorWithCleanup&, const CryptoPP::AllocatorWithCleanup&) {return (false);} + +NAMESPACE_END + +NAMESPACE_BEGIN(std) +template +inline void swap(CryptoPP::SecBlock &a, CryptoPP::SecBlock &b) +{ + a.swap(b); +} + +#if defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) || (defined(_STLPORT_VERSION) && !defined(_STLP_MEMBER_TEMPLATE_CLASSES)) +// working for STLport 5.1.3 and MSVC 6 SP5 +template +inline CryptoPP::AllocatorWithCleanup<_Tp2>& +__stl_alloc_rebind(CryptoPP::AllocatorWithCleanup<_Tp1>& __a, const _Tp2*) +{ + return (CryptoPP::AllocatorWithCleanup<_Tp2>&)(__a); +} +#endif + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/seckey.h b/external/crypto++-5.6.3/seckey.h new file mode 100644 index 000000000..f03ea8450 --- /dev/null +++ b/external/crypto++-5.6.3/seckey.h @@ -0,0 +1,428 @@ +// seckey.h - written and placed in the public domain by Wei Dai + +//! \file +//! \brief Classes and functions for implementing secret key algorithms. + +#ifndef CRYPTOPP_SECKEY_H +#define CRYPTOPP_SECKEY_H + +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4189) +#endif + +#include "cryptlib.h" +#include "misc.h" +#include "simple.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \brief Inverts the cipher's direction +//! \param dir the cipher's direction +//! \returns DECRYPTION if dir is ENCRYPTION, DECRYPTION otherwise +inline CipherDir ReverseCipherDir(CipherDir dir) +{ + return (dir == ENCRYPTION) ? DECRYPTION : ENCRYPTION; +} + +//! \class FixedBlockSize +//! \brief Inherited by block ciphers with fixed block size +//! \tparam N the blocksize of the cipher +template +class FixedBlockSize +{ +public: + //! \brief The block size of the cipher provided as a constant. + CRYPTOPP_CONSTANT(BLOCKSIZE = N) +}; + +// ************** rounds *************** + +//! \class FixedRounds +//! \brief Inherited by ciphers with fixed number of rounds +//! \tparam R the number of rounds used by the cipher +template +class FixedRounds +{ +public: + //! \brief The number of rounds for the cipher provided as a constant. + CRYPTOPP_CONSTANT(ROUNDS = R) +}; + +//! \class VariableRounds +//! \brief Inherited by ciphers with variable number of rounds +//! \tparam D Default number of rounds +//! \tparam N Minimum number of rounds +//! \tparam D Maximum number of rounds +template // use INT_MAX here because enums are treated as signed ints +class VariableRounds +{ +public: + //! \brief The default number of rounds for the cipher provided as a constant. + CRYPTOPP_CONSTANT(DEFAULT_ROUNDS = D) + //! \brief The minimum number of rounds for the cipher provided as a constant. + CRYPTOPP_CONSTANT(MIN_ROUNDS = N) + //! \brief The maximum number of rounds for the cipher provided as a constant. + CRYPTOPP_CONSTANT(MAX_ROUNDS = M) + //! \brief The default number of rounds for the cipher based on key length + //! provided by a static function. + //! \param keylength the size of the key, in bytes + //! \details keylength is unused in the default implementation. + static unsigned int StaticGetDefaultRounds(size_t keylength) + {CRYPTOPP_UNUSED(keylength); return DEFAULT_ROUNDS;} + +protected: + //! \brief Validates the number of rounds for a cipher. + //! \param rounds the canddiate number of rounds + //! \param alg an Algorithm object used if the number of rounds are invalid + //! \throws InvalidRounds if the number of rounds are invalid + inline void ThrowIfInvalidRounds(int rounds, const Algorithm *alg) + { +#if (M==INT_MAX) // Coverity and result_independent_of_operands + if (rounds < MIN_ROUNDS) + throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds); +#else + if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS) + throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds); +#endif + } + + //! \brief Validates the number of rounds for a cipher + //! \param param the canddiate number of rounds + //! \param alg an Algorithm object used if the number of rounds are invalid + //! \returns the number of rounds for the cipher + //! \throws InvalidRounds if the number of rounds are invalid + inline unsigned int GetRoundsAndThrowIfInvalid(const NameValuePairs ¶m, const Algorithm *alg) + { + int rounds = param.GetIntValueWithDefault("Rounds", DEFAULT_ROUNDS); + ThrowIfInvalidRounds(rounds, alg); + return (unsigned int)rounds; + } +}; + +// ************** key length *************** + +//! \class FixedKeyLength +//! \brief Inherited by keyed algorithms with fixed key length +//! \tparam N Default key length, in bytes +//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values +//! \tparam IV_L Default IV length, in bytes +template +class FixedKeyLength +{ +public: + //! \brief The default key length used by the cipher provided as a constant + //! \details KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(KEYLENGTH=N) + //! \brief The minimum key length used by the cipher provided as a constant + //! \details MIN_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N) + //! \brief The maximum key length used by the cipher provided as a constant + //! \details MAX_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(MAX_KEYLENGTH=N) + //! \brief The default key length used by the cipher provided as a constant + //! \details DEFAULT_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=N) + //! \brief The default IV requirements for the cipher provided as a constant + //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement + //! in cryptlib.h for allowed values. + CRYPTOPP_CONSTANT(IV_REQUIREMENT = IV_REQ) + //! \brief The default IV length used by the cipher provided as a constant + //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0. + CRYPTOPP_CONSTANT(IV_LENGTH = IV_L) + //! \brief The default key length for the cipher provided by a static function. + //! \param keylength the size of the key, in bytes + //! \details The default implementation returns KEYLENGTH. keylength is unused + //! in the default implementation. + static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) + {CRYPTOPP_UNUSED(keylength); return KEYLENGTH;} +}; + +//! \class VariableKeyLength +//! \brief Inherited by keyed algorithms with variable key length +//! \tparam D Default key length, in bytes +//! \tparam N Minimum key length, in bytes +//! \tparam M Maximum key length, in bytes +//! \tparam M Default key length multiple, in bytes. The default multiple is 1. +//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values +//! \tparam IV_L Default IV length, in bytes. The default length is 0. +template +class VariableKeyLength +{ + // Make these private to avoid Doxygen documenting them in all derived classes + CRYPTOPP_COMPILE_ASSERT(Q > 0); + CRYPTOPP_COMPILE_ASSERT(N % Q == 0); + CRYPTOPP_COMPILE_ASSERT(M % Q == 0); + CRYPTOPP_COMPILE_ASSERT(N < M); + CRYPTOPP_COMPILE_ASSERT(D >= N); + CRYPTOPP_COMPILE_ASSERT(M >= D); + +public: + //! \brief The minimum key length used by the cipher provided as a constant + //! \details MIN_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N) + //! \brief The maximum key length used by the cipher provided as a constant + //! \details MAX_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(MAX_KEYLENGTH=M) + //! \brief The default key length used by the cipher provided as a constant + //! \details DEFAULT_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=D) + //! \brief The key length multiple used by the cipher provided as a constant + //! \details MAX_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(KEYLENGTH_MULTIPLE=Q) + //! \brief The default IV requirements for the cipher provided as a constant + //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement + //! in cryptlib.h for allowed values. + CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ) + //! \brief The default initialization vector length for the cipher provided as a constant + //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0. + CRYPTOPP_CONSTANT(IV_LENGTH=IV_L) + //! \brief Provides a valid key length for the cipher provided by a static function. + //! \param keylength the size of the key, in bytes + //! \details If keylength is less than MIN_KEYLENGTH, then the function returns + //! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function + //! returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE, + //! then keylength is returned. Otherwise, the function returns keylength rounded + //! \a down to the next smaller multiple of KEYLENGTH_MULTIPLE. + //! \details keylength is provided in bytes, not bits. + static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) + { +#if MIN_KEYLENGTH > 0 + if (keylength < (size_t)MIN_KEYLENGTH) + return MIN_KEYLENGTH; + else +#endif + if (keylength > (size_t)MAX_KEYLENGTH) + return (size_t)MAX_KEYLENGTH; + else + { + keylength += KEYLENGTH_MULTIPLE-1; + return keylength - keylength%KEYLENGTH_MULTIPLE; + } + } +}; + +//! \class SameKeyLengthAs +//! \brief Provides key lengths based on another class's key length +//! \tparam T another FixedKeyLength or VariableKeyLength class +//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values +//! \tparam IV_L Default IV length, in bytes +template +class SameKeyLengthAs +{ +public: + //! \brief The minimum key length used by the cipher provided as a constant + //! \details MIN_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(MIN_KEYLENGTH=T::MIN_KEYLENGTH) + //! \brief The maximum key length used by the cipher provided as a constant + //! \details MIN_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(MAX_KEYLENGTH=T::MAX_KEYLENGTH) + //! \brief The default key length used by the cipher provided as a constant + //! \details MIN_KEYLENGTH is provided in bytes, not bits + CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH) + //! \brief The default IV requirements for the cipher provided as a constant + //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement + //! in cryptlib.h for allowed values. + CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ) + //! \brief The default initialization vector length for the cipher provided as a constant + //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0. + CRYPTOPP_CONSTANT(IV_LENGTH=IV_L) + //! \brief Provides a valid key length for the cipher provided by a static function. + //! \param keylength the size of the key, in bytes + //! \details If keylength is less than MIN_KEYLENGTH, then the function returns + //! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function + //! returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE, + //! then keylength is returned. Otherwise, the function returns keylength rounded + //! \a down to the next smaller multiple of KEYLENGTH_MULTIPLE. + //! \details keylength is provided in bytes, not bits. + static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) + {return T::StaticGetValidKeyLength(keylength);} +}; + +// ************** implementation helper for SimpleKeyed *************** + +//! \class SimpleKeyingInterfaceImpl +//! \brief Provides class member functions to access SimpleKeyingInterface constants +//! \tparam BASE a SimpleKeyingInterface derived class +//! \tparam INFO a SimpleKeyingInterface derived class +template +class CRYPTOPP_NO_VTABLE SimpleKeyingInterfaceImpl : public BASE +{ +public: + //! \brief The minimum key length used by the cipher + size_t MinKeyLength() const + {return INFO::MIN_KEYLENGTH;} + + //! \brief The maximum key length used by the cipher + size_t MaxKeyLength() const + {return (size_t)INFO::MAX_KEYLENGTH;} + + //! \brief The default key length used by the cipher + size_t DefaultKeyLength() const + {return INFO::DEFAULT_KEYLENGTH;} + + //! \brief Provides a valid key length for the cipher + //! \param keylength the size of the key, in bytes + //! \details keylength is provided in bytes, not bits. If keylength is less than MIN_KEYLENGTH, + //! then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, + //! then the function returns MAX_KEYLENGTH. if If keylength is a multiple of KEYLENGTH_MULTIPLE, + //! then keylength is returned. Otherwise, the function returns a \a lower multiple of + //! KEYLENGTH_MULTIPLE. + size_t GetValidKeyLength(size_t keylength) const {return INFO::StaticGetValidKeyLength(keylength);} + + //! \brief The default IV requirements for the cipher + //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement + //! in cryptlib.h for allowed values. + SimpleKeyingInterface::IV_Requirement IVRequirement() const + {return (SimpleKeyingInterface::IV_Requirement)INFO::IV_REQUIREMENT;} + + //! \brief The default initialization vector length for the cipher + //! \details IVSize is provided in bytes, not bits. The default implementation uses IV_LENGTH, which is 0. + unsigned int IVSize() const + {return INFO::IV_LENGTH;} +}; + +//! \class BlockCipherImpl +//! \brief Provides class member functions to access BlockCipher constants +//! \tparam INFO a SimpleKeyingInterface derived class +//! \tparam BASE a SimpleKeyingInterface derived class +template +class CRYPTOPP_NO_VTABLE BlockCipherImpl : public AlgorithmImpl > > +{ +public: + //! Provides the block size of the cipher + //! \returns the block size of the cipher, in bytes + unsigned int BlockSize() const {return this->BLOCKSIZE;} +}; + +//! \class BlockCipherFinal +//! \brief Provides class member functions to key a block cipher +//! \tparam DIR a CipherDir +//! \tparam BASE a BlockCipherImpl derived class +template +class BlockCipherFinal : public ClonableImpl, BASE> +{ +public: + //! \brief Construct a default BlockCipherFinal + //! \details The cipher is not keyed. + BlockCipherFinal() {} + + //! \brief Construct a BlockCipherFinal + //! \param key a byte array used to key the cipher + //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls + //! SimpleKeyingInterface::SetKey. + BlockCipherFinal(const byte *key) + {this->SetKey(key, this->DEFAULT_KEYLENGTH);} + + //! \brief Construct a BlockCipherFinal + //! \param key a byte array used to key the cipher + //! \param length the length of the byte array + //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls + //! SimpleKeyingInterface::SetKey. + BlockCipherFinal(const byte *key, size_t length) + {this->SetKey(key, length);} + + //! \brief Construct a BlockCipherFinal + //! \param key a byte array used to key the cipher + //! \param length the length of the byte array + //! \param rounds the number of rounds + //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls + //! SimpleKeyingInterface::SetKeyWithRounds. + BlockCipherFinal(const byte *key, size_t length, unsigned int rounds) + {this->SetKeyWithRounds(key, length, rounds);} + + //! \brief Provides the direction of the cipher + //! \returns true if DIR is ENCRYPTION, false otherwise + //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() + bool IsForwardTransformation() const {return DIR == ENCRYPTION;} +}; + +//! \class MessageAuthenticationCodeImpl +//! \brief Provides class member functions to access MessageAuthenticationCode constants +//! \tparam INFO a SimpleKeyingInterface derived class +//! \tparam BASE a SimpleKeyingInterface derived class +template +class MessageAuthenticationCodeImpl : public AlgorithmImpl, INFO> +{ +}; + +//! \class MessageAuthenticationCodeFinal +//! \brief Provides class member functions to key a message authentication code +//! \tparam DIR a CipherDir +//! \tparam BASE a BlockCipherImpl derived class +template +class MessageAuthenticationCodeFinal : public ClonableImpl, MessageAuthenticationCodeImpl > +{ +public: + //! \brief Construct a default MessageAuthenticationCodeFinal + //! \details The message authentication code is not keyed. + MessageAuthenticationCodeFinal() {} + //! \brief Construct a BlockCipherFinal + //! \param key a byte array used to key the cipher + //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls + //! SimpleKeyingInterface::SetKey. + MessageAuthenticationCodeFinal(const byte *key) + {this->SetKey(key, this->DEFAULT_KEYLENGTH);} + //! \brief Construct a BlockCipherFinal + //! \param key a byte array used to key the cipher + //! \param length the length of the byte array + //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls + //! SimpleKeyingInterface::SetKey. + MessageAuthenticationCodeFinal(const byte *key, size_t length) + {this->SetKey(key, length);} +}; + +// ************** documentation *************** + +//! \class BlockCipherDocumentation +//! \brief Provides Encryption and Decryption typedefs used by derived classes to +//! implement a block cipher +//! \details These objects usually should not be used directly. See CipherModeDocumentation +//! instead. Each class derived from this one defines two types, Encryption and Decryption, +//! both of which implement the BlockCipher interface. +struct BlockCipherDocumentation +{ + //! implements the BlockCipher interface + typedef BlockCipher Encryption; + //! implements the BlockCipher interface + typedef BlockCipher Decryption; +}; + +//! \class SymmetricCipherDocumentation +//! \brief Provides Encryption and Decryption typedefs used by derived classes to +//! implement a symmetric cipher +//! \details Each class derived from this one defines two types, Encryption and Decryption, +//! both of which implement the SymmetricCipher interface. Two types of classes derive +//! from this class: stream ciphers and block cipher modes. Stream ciphers can be used +//! alone, cipher mode classes need to be used with a block cipher. See CipherModeDocumentation +//! for more for information about using cipher modes and block ciphers. +struct SymmetricCipherDocumentation +{ + //! implements the SymmetricCipher interface + typedef SymmetricCipher Encryption; + //! implements the SymmetricCipher interface + typedef SymmetricCipher Decryption; +}; + +//! \class AuthenticatedSymmetricCipherDocumentation +//! \brief Provides Encryption and Decryption typedefs used by derived classes to +//! implement an authenticated encryption cipher +//! \details Each class derived from this one defines two types, Encryption and Decryption, +//! both of which implement the AuthenticatedSymmetricCipher interface. +struct AuthenticatedSymmetricCipherDocumentation +{ + //! implements the AuthenticatedSymmetricCipher interface + typedef AuthenticatedSymmetricCipher Encryption; + //! implements the AuthenticatedSymmetricCipher interface + typedef AuthenticatedSymmetricCipher Decryption; +}; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/seed.cpp b/external/crypto++-5.6.3/seed.cpp new file mode 100644 index 000000000..6779f38ae --- /dev/null +++ b/external/crypto++-5.6.3/seed.cpp @@ -0,0 +1,104 @@ +// seed.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "seed.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const word32 s_kc[16] = { + 0x9e3779b9, 0x3c6ef373, 0x78dde6e6, 0xf1bbcdcc, 0xe3779b99, 0xc6ef3733, 0x8dde6e67, 0x1bbcdccf, + 0x3779b99e, 0x6ef3733c, 0xdde6e678, 0xbbcdccf1, 0x779b99e3, 0xef3733c6, 0xde6e678d, 0xbcdccf1b}; + +static const byte s_s0[256] = { + 0xA9, 0x85, 0xD6, 0xD3, 0x54, 0x1D, 0xAC, 0x25, 0x5D, 0x43, 0x18, 0x1E, 0x51, 0xFC, 0xCA, 0x63, 0x28, + 0x44, 0x20, 0x9D, 0xE0, 0xE2, 0xC8, 0x17, 0xA5, 0x8F, 0x03, 0x7B, 0xBB, 0x13, 0xD2, 0xEE, 0x70, 0x8C, + 0x3F, 0xA8, 0x32, 0xDD, 0xF6, 0x74, 0xEC, 0x95, 0x0B, 0x57, 0x5C, 0x5B, 0xBD, 0x01, 0x24, 0x1C, 0x73, + 0x98, 0x10, 0xCC, 0xF2, 0xD9, 0x2C, 0xE7, 0x72, 0x83, 0x9B, 0xD1, 0x86, 0xC9, 0x60, 0x50, 0xA3, 0xEB, + 0x0D, 0xB6, 0x9E, 0x4F, 0xB7, 0x5A, 0xC6, 0x78, 0xA6, 0x12, 0xAF, 0xD5, 0x61, 0xC3, 0xB4, 0x41, 0x52, + 0x7D, 0x8D, 0x08, 0x1F, 0x99, 0x00, 0x19, 0x04, 0x53, 0xF7, 0xE1, 0xFD, 0x76, 0x2F, 0x27, 0xB0, 0x8B, + 0x0E, 0xAB, 0xA2, 0x6E, 0x93, 0x4D, 0x69, 0x7C, 0x09, 0x0A, 0xBF, 0xEF, 0xF3, 0xC5, 0x87, 0x14, 0xFE, + 0x64, 0xDE, 0x2E, 0x4B, 0x1A, 0x06, 0x21, 0x6B, 0x66, 0x02, 0xF5, 0x92, 0x8A, 0x0C, 0xB3, 0x7E, 0xD0, + 0x7A, 0x47, 0x96, 0xE5, 0x26, 0x80, 0xAD, 0xDF, 0xA1, 0x30, 0x37, 0xAE, 0x36, 0x15, 0x22, 0x38, 0xF4, + 0xA7, 0x45, 0x4C, 0x81, 0xE9, 0x84, 0x97, 0x35, 0xCB, 0xCE, 0x3C, 0x71, 0x11, 0xC7, 0x89, 0x75, 0xFB, + 0xDA, 0xF8, 0x94, 0x59, 0x82, 0xC4, 0xFF, 0x49, 0x39, 0x67, 0xC0, 0xCF, 0xD7, 0xB8, 0x0F, 0x8E, 0x42, + 0x23, 0x91, 0x6C, 0xDB, 0xA4, 0x34, 0xF1, 0x48, 0xC2, 0x6F, 0x3D, 0x2D, 0x40, 0xBE, 0x3E, 0xBC, 0xC1, + 0xAA, 0xBA, 0x4E, 0x55, 0x3B, 0xDC, 0x68, 0x7F, 0x9C, 0xD8, 0x4A, 0x56, 0x77, 0xA0, 0xED, 0x46, 0xB5, + 0x2B, 0x65, 0xFA, 0xE3, 0xB9, 0xB1, 0x9F, 0x5E, 0xF9, 0xE6, 0xB2, 0x31, 0xEA, 0x6D, 0x5F, 0xE4, 0xF0, + 0xCD, 0x88, 0x16, 0x3A, 0x58, 0xD4, 0x62, 0x29, 0x07, 0x33, 0xE8, 0x1B, 0x05, 0x79, 0x90, 0x6A, 0x2A, + 0x9A}; + +static const byte s_s1[256] = { + 0x38, 0xE8, 0x2D, 0xA6, 0xCF, 0xDE, 0xB3, 0xB8, 0xAF, 0x60, 0x55, 0xC7, 0x44, 0x6F, 0x6B, 0x5B, 0xC3, + 0x62, 0x33, 0xB5, 0x29, 0xA0, 0xE2, 0xA7, 0xD3, 0x91, 0x11, 0x06, 0x1C, 0xBC, 0x36, 0x4B, 0xEF, 0x88, + 0x6C, 0xA8, 0x17, 0xC4, 0x16, 0xF4, 0xC2, 0x45, 0xE1, 0xD6, 0x3F, 0x3D, 0x8E, 0x98, 0x28, 0x4E, 0xF6, + 0x3E, 0xA5, 0xF9, 0x0D, 0xDF, 0xD8, 0x2B, 0x66, 0x7A, 0x27, 0x2F, 0xF1, 0x72, 0x42, 0xD4, 0x41, 0xC0, + 0x73, 0x67, 0xAC, 0x8B, 0xF7, 0xAD, 0x80, 0x1F, 0xCA, 0x2C, 0xAA, 0x34, 0xD2, 0x0B, 0xEE, 0xE9, 0x5D, + 0x94, 0x18, 0xF8, 0x57, 0xAE, 0x08, 0xC5, 0x13, 0xCD, 0x86, 0xB9, 0xFF, 0x7D, 0xC1, 0x31, 0xF5, 0x8A, + 0x6A, 0xB1, 0xD1, 0x20, 0xD7, 0x02, 0x22, 0x04, 0x68, 0x71, 0x07, 0xDB, 0x9D, 0x99, 0x61, 0xBE, 0xE6, + 0x59, 0xDD, 0x51, 0x90, 0xDC, 0x9A, 0xA3, 0xAB, 0xD0, 0x81, 0x0F, 0x47, 0x1A, 0xE3, 0xEC, 0x8D, 0xBF, + 0x96, 0x7B, 0x5C, 0xA2, 0xA1, 0x63, 0x23, 0x4D, 0xC8, 0x9E, 0x9C, 0x3A, 0x0C, 0x2E, 0xBA, 0x6E, 0x9F, + 0x5A, 0xF2, 0x92, 0xF3, 0x49, 0x78, 0xCC, 0x15, 0xFB, 0x70, 0x75, 0x7F, 0x35, 0x10, 0x03, 0x64, 0x6D, + 0xC6, 0x74, 0xD5, 0xB4, 0xEA, 0x09, 0x76, 0x19, 0xFE, 0x40, 0x12, 0xE0, 0xBD, 0x05, 0xFA, 0x01, 0xF0, + 0x2A, 0x5E, 0xA9, 0x56, 0x43, 0x85, 0x14, 0x89, 0x9B, 0xB0, 0xE5, 0x48, 0x79, 0x97, 0xFC, 0x1E, 0x82, + 0x21, 0x8C, 0x1B, 0x5F, 0x77, 0x54, 0xB2, 0x1D, 0x25, 0x4F, 0x00, 0x46, 0xED, 0x58, 0x52, 0xEB, 0x7E, + 0xDA, 0xC9, 0xFD, 0x30, 0x95, 0x65, 0x3C, 0xB6, 0xE4, 0xBB, 0x7C, 0x0E, 0x50, 0x39, 0x26, 0x32, 0x84, + 0x69, 0x93, 0x37, 0xE7, 0x24, 0xA4, 0xCB, 0x53, 0x0A, 0x87, 0xD9, 0x4C, 0x83, 0x8F, 0xCE, 0x3B, 0x4A, + 0xB7}; + +#define SS0(x) ((s_s0[x]*0x01010101UL) & 0x3FCFF3FC) +#define SS1(x) ((s_s1[x]*0x01010101UL) & 0xFC3FCFF3) +#define SS2(x) ((s_s0[x]*0x01010101UL) & 0xF3FC3FCF) +#define SS3(x) ((s_s1[x]*0x01010101UL) & 0xCFF3FC3F) +#define G(x) (SS0(GETBYTE(x, 0)) ^ SS1(GETBYTE(x, 1)) ^ SS2(GETBYTE(x, 2)) ^ SS3(GETBYTE(x, 3))) + +void SEED::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs& /*params*/) +{ + AssertValidKeyLength(length); + + word64 key01, key23; + GetBlock get(userKey); + get(key01)(key23); + word32 *k = m_k; + size_t kInc = 2; + if (!IsForwardTransformation()) + { + k = k+30; + kInc = 0-kInc; + } + + for (unsigned int i=0; i>32) + word32(key23>>32) - s_kc[i]; + word32 t1 = word32(key01) - word32(key23) + s_kc[i]; + k[0] = G(t0); + k[1] = G(t1); + k+=kInc; + if (i&1) + key23 = rotlFixed(key23, 8); + else + key01 = rotrFixed(key01, 8); + } +} + +void SEED::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + typedef BlockGetAndPut Block; + word32 a0, a1, b0, b1, t0, t1; + Block::Get(inBlock)(a0)(a1)(b0)(b1); + + for (int i=0; i, public FixedKeyLength<16>, public FixedRounds<16> +{ + static const char *StaticAlgorithmName() {return "SEED";} +}; + +/// SEED +class SEED : public SEED_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + protected: + FixedSizeSecBlock m_k; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/serpent.cpp b/external/crypto++-5.6.3/serpent.cpp new file mode 100644 index 000000000..64b12a7c4 --- /dev/null +++ b/external/crypto++-5.6.3/serpent.cpp @@ -0,0 +1,125 @@ +// serpent.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "serpent.h" +#include "secblock.h" +#include "misc.h" + +#include "serpentp.h" + +NAMESPACE_BEGIN(CryptoPP) + +void Serpent_KeySchedule(word32 *k, unsigned int rounds, const byte *userKey, size_t keylen) +{ + FixedSizeSecBlock k0; + GetUserKey(LITTLE_ENDIAN_ORDER, k0.begin(), 8, userKey, keylen); + if (keylen < 32) + k0[keylen/4] |= word32(1) << ((keylen%4)*8); + + word32 t = k0[7]; + unsigned int i; + for (i = 0; i < 8; ++i) + k[i] = k0[i] = t = rotlFixed(k0[i] ^ k0[(i+3)%8] ^ k0[(i+5)%8] ^ t ^ 0x9e3779b9 ^ i, 11); + for (i = 8; i < 4*(rounds+1); ++i) + k[i] = t = rotlFixed(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11); + k -= 20; + + word32 a,b,c,d,e; + for (i=0; i Block; + +void Serpent::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 a, b, c, d, e; + + Block::Get(inBlock)(a)(b)(c)(d); + + const word32 *k = m_key; + unsigned int i=1; + + do + { + beforeS0(KX); beforeS0(S0); afterS0(LT); + afterS0(KX); afterS0(S1); afterS1(LT); + afterS1(KX); afterS1(S2); afterS2(LT); + afterS2(KX); afterS2(S3); afterS3(LT); + afterS3(KX); afterS3(S4); afterS4(LT); + afterS4(KX); afterS4(S5); afterS5(LT); + afterS5(KX); afterS5(S6); afterS6(LT); + afterS6(KX); afterS6(S7); + + if (i == 4) + break; + + ++i; + c = b; + b = e; + e = d; + d = a; + a = e; + k += 32; + beforeS0(LT); + } + while (true); + + afterS7(KX); + + Block::Put(xorBlock, outBlock)(d)(e)(b)(a); +} + +void Serpent::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 a, b, c, d, e; + + Block::Get(inBlock)(a)(b)(c)(d); + + const word32 *k = m_key + 96; + unsigned int i=4; + + beforeI7(KX); + goto start; + + do + { + c = b; + b = d; + d = e; + k -= 32; + beforeI7(ILT); +start: + beforeI7(I7); afterI7(KX); + afterI7(ILT); afterI7(I6); afterI6(KX); + afterI6(ILT); afterI6(I5); afterI5(KX); + afterI5(ILT); afterI5(I4); afterI4(KX); + afterI4(ILT); afterI4(I3); afterI3(KX); + afterI3(ILT); afterI3(I2); afterI2(KX); + afterI2(ILT); afterI2(I1); afterI1(KX); + afterI1(ILT); afterI1(I0); afterI0(KX); + } + while (--i != 0); + + Block::Put(xorBlock, outBlock)(a)(d)(b)(e); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/serpent.h b/external/crypto++-5.6.3/serpent.h new file mode 100644 index 000000000..1782669d3 --- /dev/null +++ b/external/crypto++-5.6.3/serpent.h @@ -0,0 +1,54 @@ +// serpent.h - written and placed in the public domain by Wei Dai + +//! \file serpent.h +//! \brief Classes for the Serpent block cipher + +#ifndef CRYPTOPP_SERPENT_H +#define CRYPTOPP_SERPENT_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, public FixedRounds<32> +{ + static const char *StaticAlgorithmName() {return "Serpent";} +}; + +/// Serpent +class Serpent : public Serpent_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + FixedSizeSecBlock m_key; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef Serpent::Encryption SerpentEncryption; +typedef Serpent::Decryption SerpentDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/serpentp.h b/external/crypto++-5.6.3/serpentp.h new file mode 100644 index 000000000..7869a3fcf --- /dev/null +++ b/external/crypto++-5.6.3/serpentp.h @@ -0,0 +1,434 @@ +// private header for Serpent and Sosemanuk + +NAMESPACE_BEGIN(CryptoPP) + +// linear transformation +#define LT(i,a,b,c,d,e) {\ + a = rotlFixed(a, 13); \ + c = rotlFixed(c, 3); \ + d = rotlFixed(d ^ c ^ (a << 3), 7); \ + b = rotlFixed(b ^ a ^ c, 1); \ + a = rotlFixed(a ^ b ^ d, 5); \ + c = rotlFixed(c ^ d ^ (b << 7), 22);} + +// inverse linear transformation +#define ILT(i,a,b,c,d,e) {\ + c = rotrFixed(c, 22); \ + a = rotrFixed(a, 5); \ + c ^= d ^ (b << 7); \ + a ^= b ^ d; \ + b = rotrFixed(b, 1); \ + d = rotrFixed(d, 7) ^ c ^ (a << 3); \ + b ^= a ^ c; \ + c = rotrFixed(c, 3); \ + a = rotrFixed(a, 13);} + +// order of output from S-box functions +#define beforeS0(f) f(0,a,b,c,d,e) +#define afterS0(f) f(1,b,e,c,a,d) +#define afterS1(f) f(2,c,b,a,e,d) +#define afterS2(f) f(3,a,e,b,d,c) +#define afterS3(f) f(4,e,b,d,c,a) +#define afterS4(f) f(5,b,a,e,c,d) +#define afterS5(f) f(6,a,c,b,e,d) +#define afterS6(f) f(7,a,c,d,b,e) +#define afterS7(f) f(8,d,e,b,a,c) + +// order of output from inverse S-box functions +#define beforeI7(f) f(8,a,b,c,d,e) +#define afterI7(f) f(7,d,a,b,e,c) +#define afterI6(f) f(6,a,b,c,e,d) +#define afterI5(f) f(5,b,d,e,c,a) +#define afterI4(f) f(4,b,c,e,a,d) +#define afterI3(f) f(3,a,b,e,c,d) +#define afterI2(f) f(2,b,d,e,c,a) +#define afterI1(f) f(1,a,b,c,e,d) +#define afterI0(f) f(0,a,d,b,e,c) + +// The instruction sequences for the S-box functions +// come from Dag Arne Osvik's paper "Speeding up Serpent". + +#define S0(i, r0, r1, r2, r3, r4) \ + { \ + r3 ^= r0; \ + r4 = r1; \ + r1 &= r3; \ + r4 ^= r2; \ + r1 ^= r0; \ + r0 |= r3; \ + r0 ^= r4; \ + r4 ^= r3; \ + r3 ^= r2; \ + r2 |= r1; \ + r2 ^= r4; \ + r4 = ~r4; \ + r4 |= r1; \ + r1 ^= r3; \ + r1 ^= r4; \ + r3 |= r0; \ + r1 ^= r3; \ + r4 ^= r3; \ + } + +#define I0(i, r0, r1, r2, r3, r4) \ + { \ + r2 = ~r2; \ + r4 = r1; \ + r1 |= r0; \ + r4 = ~r4; \ + r1 ^= r2; \ + r2 |= r4; \ + r1 ^= r3; \ + r0 ^= r4; \ + r2 ^= r0; \ + r0 &= r3; \ + r4 ^= r0; \ + r0 |= r1; \ + r0 ^= r2; \ + r3 ^= r4; \ + r2 ^= r1; \ + r3 ^= r0; \ + r3 ^= r1; \ + r2 &= r3; \ + r4 ^= r2; \ + } + +#define S1(i, r0, r1, r2, r3, r4) \ + { \ + r0 = ~r0; \ + r2 = ~r2; \ + r4 = r0; \ + r0 &= r1; \ + r2 ^= r0; \ + r0 |= r3; \ + r3 ^= r2; \ + r1 ^= r0; \ + r0 ^= r4; \ + r4 |= r1; \ + r1 ^= r3; \ + r2 |= r0; \ + r2 &= r4; \ + r0 ^= r1; \ + r1 &= r2; \ + r1 ^= r0; \ + r0 &= r2; \ + r0 ^= r4; \ + } + +#define I1(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r1; \ + r1 ^= r3; \ + r3 &= r1; \ + r4 ^= r2; \ + r3 ^= r0; \ + r0 |= r1; \ + r2 ^= r3; \ + r0 ^= r4; \ + r0 |= r2; \ + r1 ^= r3; \ + r0 ^= r1; \ + r1 |= r3; \ + r1 ^= r0; \ + r4 = ~r4; \ + r4 ^= r1; \ + r1 |= r0; \ + r1 ^= r0; \ + r1 |= r4; \ + r3 ^= r1; \ + } + +#define S2(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r0; \ + r0 &= r2; \ + r0 ^= r3; \ + r2 ^= r1; \ + r2 ^= r0; \ + r3 |= r4; \ + r3 ^= r1; \ + r4 ^= r2; \ + r1 = r3; \ + r3 |= r4; \ + r3 ^= r0; \ + r0 &= r1; \ + r4 ^= r0; \ + r1 ^= r3; \ + r1 ^= r4; \ + r4 = ~r4; \ + } + +#define I2(i, r0, r1, r2, r3, r4) \ + { \ + r2 ^= r3; \ + r3 ^= r0; \ + r4 = r3; \ + r3 &= r2; \ + r3 ^= r1; \ + r1 |= r2; \ + r1 ^= r4; \ + r4 &= r3; \ + r2 ^= r3; \ + r4 &= r0; \ + r4 ^= r2; \ + r2 &= r1; \ + r2 |= r0; \ + r3 = ~r3; \ + r2 ^= r3; \ + r0 ^= r3; \ + r0 &= r1; \ + r3 ^= r4; \ + r3 ^= r0; \ + } + +#define S3(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r0; \ + r0 |= r3; \ + r3 ^= r1; \ + r1 &= r4; \ + r4 ^= r2; \ + r2 ^= r3; \ + r3 &= r0; \ + r4 |= r1; \ + r3 ^= r4; \ + r0 ^= r1; \ + r4 &= r0; \ + r1 ^= r3; \ + r4 ^= r2; \ + r1 |= r0; \ + r1 ^= r2; \ + r0 ^= r3; \ + r2 = r1; \ + r1 |= r3; \ + r1 ^= r0; \ + } + +#define I3(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r2; \ + r2 ^= r1; \ + r1 &= r2; \ + r1 ^= r0; \ + r0 &= r4; \ + r4 ^= r3; \ + r3 |= r1; \ + r3 ^= r2; \ + r0 ^= r4; \ + r2 ^= r0; \ + r0 |= r3; \ + r0 ^= r1; \ + r4 ^= r2; \ + r2 &= r3; \ + r1 |= r3; \ + r1 ^= r2; \ + r4 ^= r0; \ + r2 ^= r4; \ + } + +#define S4(i, r0, r1, r2, r3, r4) \ + { \ + r1 ^= r3; \ + r3 = ~r3; \ + r2 ^= r3; \ + r3 ^= r0; \ + r4 = r1; \ + r1 &= r3; \ + r1 ^= r2; \ + r4 ^= r3; \ + r0 ^= r4; \ + r2 &= r4; \ + r2 ^= r0; \ + r0 &= r1; \ + r3 ^= r0; \ + r4 |= r1; \ + r4 ^= r0; \ + r0 |= r3; \ + r0 ^= r2; \ + r2 &= r3; \ + r0 = ~r0; \ + r4 ^= r2; \ + } + +#define I4(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r2; \ + r2 &= r3; \ + r2 ^= r1; \ + r1 |= r3; \ + r1 &= r0; \ + r4 ^= r2; \ + r4 ^= r1; \ + r1 &= r2; \ + r0 = ~r0; \ + r3 ^= r4; \ + r1 ^= r3; \ + r3 &= r0; \ + r3 ^= r2; \ + r0 ^= r1; \ + r2 &= r0; \ + r3 ^= r0; \ + r2 ^= r4; \ + r2 |= r3; \ + r3 ^= r0; \ + r2 ^= r1; \ + } + +#define S5(i, r0, r1, r2, r3, r4) \ + { \ + r0 ^= r1; \ + r1 ^= r3; \ + r3 = ~r3; \ + r4 = r1; \ + r1 &= r0; \ + r2 ^= r3; \ + r1 ^= r2; \ + r2 |= r4; \ + r4 ^= r3; \ + r3 &= r1; \ + r3 ^= r0; \ + r4 ^= r1; \ + r4 ^= r2; \ + r2 ^= r0; \ + r0 &= r3; \ + r2 = ~r2; \ + r0 ^= r4; \ + r4 |= r3; \ + r2 ^= r4; \ + } + +#define I5(i, r0, r1, r2, r3, r4) \ + { \ + r1 = ~r1; \ + r4 = r3; \ + r2 ^= r1; \ + r3 |= r0; \ + r3 ^= r2; \ + r2 |= r1; \ + r2 &= r0; \ + r4 ^= r3; \ + r2 ^= r4; \ + r4 |= r0; \ + r4 ^= r1; \ + r1 &= r2; \ + r1 ^= r3; \ + r4 ^= r2; \ + r3 &= r4; \ + r4 ^= r1; \ + r3 ^= r0; \ + r3 ^= r4; \ + r4 = ~r4; \ + } + +#define S6(i, r0, r1, r2, r3, r4) \ + { \ + r2 = ~r2; \ + r4 = r3; \ + r3 &= r0; \ + r0 ^= r4; \ + r3 ^= r2; \ + r2 |= r4; \ + r1 ^= r3; \ + r2 ^= r0; \ + r0 |= r1; \ + r2 ^= r1; \ + r4 ^= r0; \ + r0 |= r3; \ + r0 ^= r2; \ + r4 ^= r3; \ + r4 ^= r0; \ + r3 = ~r3; \ + r2 &= r4; \ + r2 ^= r3; \ + } + +#define I6(i, r0, r1, r2, r3, r4) \ + { \ + r0 ^= r2; \ + r4 = r2; \ + r2 &= r0; \ + r4 ^= r3; \ + r2 = ~r2; \ + r3 ^= r1; \ + r2 ^= r3; \ + r4 |= r0; \ + r0 ^= r2; \ + r3 ^= r4; \ + r4 ^= r1; \ + r1 &= r3; \ + r1 ^= r0; \ + r0 ^= r3; \ + r0 |= r2; \ + r3 ^= r1; \ + r4 ^= r0; \ + } + +#define S7(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r2; \ + r2 &= r1; \ + r2 ^= r3; \ + r3 &= r1; \ + r4 ^= r2; \ + r2 ^= r1; \ + r1 ^= r0; \ + r0 |= r4; \ + r0 ^= r2; \ + r3 ^= r1; \ + r2 ^= r3; \ + r3 &= r0; \ + r3 ^= r4; \ + r4 ^= r2; \ + r2 &= r0; \ + r4 = ~r4; \ + r2 ^= r4; \ + r4 &= r0; \ + r1 ^= r3; \ + r4 ^= r1; \ + } + +#define I7(i, r0, r1, r2, r3, r4) \ + { \ + r4 = r2; \ + r2 ^= r0; \ + r0 &= r3; \ + r2 = ~r2; \ + r4 |= r3; \ + r3 ^= r1; \ + r1 |= r0; \ + r0 ^= r2; \ + r2 &= r4; \ + r1 ^= r2; \ + r2 ^= r0; \ + r0 |= r2; \ + r3 &= r4; \ + r0 ^= r3; \ + r4 ^= r1; \ + r3 ^= r4; \ + r4 |= r0; \ + r3 ^= r2; \ + r4 ^= r2; \ + } + +// key xor +#define KX(r, a, b, c, d, e) {\ + a ^= k[4 * r + 0]; \ + b ^= k[4 * r + 1]; \ + c ^= k[4 * r + 2]; \ + d ^= k[4 * r + 3];} + +#define LK(r, a, b, c, d, e) {\ + a = k[(8-r)*4 + 0]; \ + b = k[(8-r)*4 + 1]; \ + c = k[(8-r)*4 + 2]; \ + d = k[(8-r)*4 + 3];} + +#define SK(r, a, b, c, d, e) {\ + k[(8-r)*4 + 4] = a; \ + k[(8-r)*4 + 5] = b; \ + k[(8-r)*4 + 6] = c; \ + k[(8-r)*4 + 7] = d;} + +void Serpent_KeySchedule(word32 *k, unsigned int rounds, const byte *userKey, size_t keylen); + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/sha.cpp b/external/crypto++-5.6.3/sha.cpp new file mode 100644 index 000000000..7b02059ac --- /dev/null +++ b/external/crypto++-5.6.3/sha.cpp @@ -0,0 +1,925 @@ +// sha.cpp - modified by Wei Dai from Steve Reid's public domain sha1.c + +// Steve Reid implemented SHA-1. Wei Dai implemented SHA-2. +// Both are in the public domain. + +// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM sha.cpp" to generate MASM code + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4100 4731) +#endif + +#ifndef CRYPTOPP_IMPORTS +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#include "secblock.h" +#include "sha.h" +#include "misc.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +// start of Steve Reid's code + +#define blk0(i) (W[i] = data[i]) +#define blk1(i) (W[i&15] = rotlFixed(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1)) + +void SHA1::InitState(HashWordType *state) +{ + state[0] = 0x67452301L; + state[1] = 0xEFCDAB89L; + state[2] = 0x98BADCFEL; + state[3] = 0x10325476L; + state[4] = 0xC3D2E1F0L; +} + +#define f1(x,y,z) (z^(x&(y^z))) +#define f2(x,y,z) (x^y^z) +#define f3(x,y,z) ((x&y)|(z&(x|y))) +#define f4(x,y,z) (x^y^z) + +/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ +#define R0(v,w,x,y,z,i) z+=f1(w,x,y)+blk0(i)+0x5A827999+rotlFixed(v,5);w=rotlFixed(w,30); +#define R1(v,w,x,y,z,i) z+=f1(w,x,y)+blk1(i)+0x5A827999+rotlFixed(v,5);w=rotlFixed(w,30); +#define R2(v,w,x,y,z,i) z+=f2(w,x,y)+blk1(i)+0x6ED9EBA1+rotlFixed(v,5);w=rotlFixed(w,30); +#define R3(v,w,x,y,z,i) z+=f3(w,x,y)+blk1(i)+0x8F1BBCDC+rotlFixed(v,5);w=rotlFixed(w,30); +#define R4(v,w,x,y,z,i) z+=f4(w,x,y)+blk1(i)+0xCA62C1D6+rotlFixed(v,5);w=rotlFixed(w,30); + +void SHA1::Transform(word32 *state, const word32 *data) +{ + word32 W[16]; + /* Copy context->state[] to working vars */ + word32 a = state[0]; + word32 b = state[1]; + word32 c = state[2]; + word32 d = state[3]; + word32 e = state[4]; + /* 4 rounds of 20 operations each. Loop unrolled. */ + R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); + R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); + R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); + R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); + R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); + R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); + R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); + R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); + R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); + R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); + R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); + R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); + R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); + R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); + R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); + R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); + R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); + R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); + R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); + R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); + /* Add the working vars back into context.state[] */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; +} + +// end of Steve Reid's code + +// ************************************************************* + +void SHA224::InitState(HashWordType *state) +{ + static const word32 s[8] = {0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4}; + memcpy(state, s, sizeof(s)); +} + +void SHA256::InitState(HashWordType *state) +{ + static const word32 s[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; + memcpy(state, s, sizeof(s)); +} + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +CRYPTOPP_ALIGN_DATA(16) extern const word32 SHA256_K[64] CRYPTOPP_SECTION_ALIGN16 = { +#else +extern const word32 SHA256_K[64] = { +#endif + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM + +#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_GENERATE_X64_MASM) + +static void CRYPTOPP_FASTCALL X86_SHA256_HashBlocks(word32 *state, const word32 *data, size_t len +#if defined(_MSC_VER) && (_MSC_VER == 1200) + , ... // VC60 workaround: prevent VC 6 from inlining this function +#endif + ) +{ +#if defined(_MSC_VER) && (_MSC_VER == 1200) + AS2(mov ecx, [state]) + AS2(mov edx, [data]) +#endif + + #define LOCALS_SIZE 8*4 + 16*4 + 4*WORD_SZ + #define H(i) [BASE+ASM_MOD(1024+7-(i),8)*4] + #define G(i) H(i+1) + #define F(i) H(i+2) + #define E(i) H(i+3) + #define D(i) H(i+4) + #define C(i) H(i+5) + #define B(i) H(i+6) + #define A(i) H(i+7) + #define Wt(i) BASE+8*4+ASM_MOD(1024+15-(i),16)*4 + #define Wt_2(i) Wt((i)-2) + #define Wt_15(i) Wt((i)-15) + #define Wt_7(i) Wt((i)-7) + #define K_END [BASE+8*4+16*4+0*WORD_SZ] + #define STATE_SAVE [BASE+8*4+16*4+1*WORD_SZ] + #define DATA_SAVE [BASE+8*4+16*4+2*WORD_SZ] + #define DATA_END [BASE+8*4+16*4+3*WORD_SZ] + #define Kt(i) WORD_REG(si)+(i)*4 +#if CRYPTOPP_BOOL_X32 + #define BASE esp+8 +#elif CRYPTOPP_BOOL_X86 + #define BASE esp+4 +#elif defined(__GNUC__) + #define BASE r8 +#else + #define BASE rsp +#endif + +#define RA0(i, edx, edi) \ + AS2( add edx, [Kt(i)] )\ + AS2( add edx, [Wt(i)] )\ + AS2( add edx, H(i) )\ + +#define RA1(i, edx, edi) + +#define RB0(i, edx, edi) + +#define RB1(i, edx, edi) \ + AS2( mov AS_REG_7d, [Wt_2(i)] )\ + AS2( mov edi, [Wt_15(i)])\ + AS2( mov ebx, AS_REG_7d )\ + AS2( shr AS_REG_7d, 10 )\ + AS2( ror ebx, 17 )\ + AS2( xor AS_REG_7d, ebx )\ + AS2( ror ebx, 2 )\ + AS2( xor ebx, AS_REG_7d )/* s1(W_t-2) */\ + AS2( add ebx, [Wt_7(i)])\ + AS2( mov AS_REG_7d, edi )\ + AS2( shr AS_REG_7d, 3 )\ + AS2( ror edi, 7 )\ + AS2( add ebx, [Wt(i)])/* s1(W_t-2) + W_t-7 + W_t-16 */\ + AS2( xor AS_REG_7d, edi )\ + AS2( add edx, [Kt(i)])\ + AS2( ror edi, 11 )\ + AS2( add edx, H(i) )\ + AS2( xor AS_REG_7d, edi )/* s0(W_t-15) */\ + AS2( add AS_REG_7d, ebx )/* W_t = s1(W_t-2) + W_t-7 + s0(W_t-15) W_t-16*/\ + AS2( mov [Wt(i)], AS_REG_7d)\ + AS2( add edx, AS_REG_7d )\ + +#define ROUND(i, r, eax, ecx, edi, edx)\ + /* in: edi = E */\ + /* unused: eax, ecx, temp: ebx, AS_REG_7d, out: edx = T1 */\ + AS2( mov edx, F(i) )\ + AS2( xor edx, G(i) )\ + AS2( and edx, edi )\ + AS2( xor edx, G(i) )/* Ch(E,F,G) = (G^(E&(F^G))) */\ + AS2( mov AS_REG_7d, edi )\ + AS2( ror edi, 6 )\ + AS2( ror AS_REG_7d, 25 )\ + RA##r(i, edx, edi )/* H + Wt + Kt + Ch(E,F,G) */\ + AS2( xor AS_REG_7d, edi )\ + AS2( ror edi, 5 )\ + AS2( xor AS_REG_7d, edi )/* S1(E) */\ + AS2( add edx, AS_REG_7d )/* T1 = S1(E) + Ch(E,F,G) + H + Wt + Kt */\ + RB##r(i, edx, edi )/* H + Wt + Kt + Ch(E,F,G) */\ + /* in: ecx = A, eax = B^C, edx = T1 */\ + /* unused: edx, temp: ebx, AS_REG_7d, out: eax = A, ecx = B^C, edx = E */\ + AS2( mov ebx, ecx )\ + AS2( xor ecx, B(i) )/* A^B */\ + AS2( and eax, ecx )\ + AS2( xor eax, B(i) )/* Maj(A,B,C) = B^((A^B)&(B^C) */\ + AS2( mov AS_REG_7d, ebx )\ + AS2( ror ebx, 2 )\ + AS2( add eax, edx )/* T1 + Maj(A,B,C) */\ + AS2( add edx, D(i) )\ + AS2( mov D(i), edx )\ + AS2( ror AS_REG_7d, 22 )\ + AS2( xor AS_REG_7d, ebx )\ + AS2( ror ebx, 11 )\ + AS2( xor AS_REG_7d, ebx )\ + AS2( add eax, AS_REG_7d )/* T1 + S0(A) + Maj(A,B,C) */\ + AS2( mov H(i), eax )\ + +// Unroll the use of CRYPTOPP_BOOL_X64 in assembler math. The GAS assembler on X32 (version 2.25) +// complains "Error: invalid operands (*ABS* and *UND* sections) for `*` and `-`" +#if CRYPTOPP_BOOL_X64 +#define SWAP_COPY(i) \ + AS2( mov WORD_REG(bx), [WORD_REG(dx)+i*WORD_SZ])\ + AS1( bswap WORD_REG(bx))\ + AS2( mov [Wt(i*2+1)], WORD_REG(bx)) +#else // X86 and X32 +#define SWAP_COPY(i) \ + AS2( mov WORD_REG(bx), [WORD_REG(dx)+i*WORD_SZ])\ + AS1( bswap WORD_REG(bx))\ + AS2( mov [Wt(i)], WORD_REG(bx)) +#endif + +#if defined(__GNUC__) + #if CRYPTOPP_BOOL_X64 + FixedSizeAlignedSecBlock workspace; + #endif + __asm__ __volatile__ + ( + #if CRYPTOPP_BOOL_X64 + "lea %4, %%r8;" + #endif + INTEL_NOPREFIX +#elif defined(CRYPTOPP_GENERATE_X64_MASM) + ALIGN 8 + X86_SHA256_HashBlocks PROC FRAME + rex_push_reg rsi + push_reg rdi + push_reg rbx + push_reg rbp + alloc_stack(LOCALS_SIZE+8) + .endprolog + mov rdi, r8 + lea rsi, [?SHA256_K@CryptoPP@@3QBIB + 48*4] +#endif + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + #ifndef __GNUC__ + AS2( mov edi, [len]) + AS2( lea WORD_REG(si), [SHA256_K+48*4]) + #endif + #if !defined(_MSC_VER) || (_MSC_VER < 1400) + AS_PUSH_IF86(bx) + #endif + + AS_PUSH_IF86(bp) + AS2( mov ebx, esp) + AS2( and esp, -16) + AS2( sub WORD_REG(sp), LOCALS_SIZE) + AS_PUSH_IF86(bx) +#endif + AS2( mov STATE_SAVE, WORD_REG(cx)) + AS2( mov DATA_SAVE, WORD_REG(dx)) + AS2( lea WORD_REG(ax), [WORD_REG(di) + WORD_REG(dx)]) + AS2( mov DATA_END, WORD_REG(ax)) + AS2( mov K_END, WORD_REG(si)) + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( test edi, 1) + ASJ( jnz, 2, f) + AS1( dec DWORD PTR K_END) +#endif + AS2( movdqa xmm0, XMMWORD_PTR [WORD_REG(cx)+0*16]) + AS2( movdqa xmm1, XMMWORD_PTR [WORD_REG(cx)+1*16]) +#endif + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + ASJ( jmp, 0, f) +#endif + ASL(2) // non-SSE2 + AS2( mov esi, ecx) + AS2( lea edi, A(0)) + AS2( mov ecx, 8) + AS1( rep movsd) + AS2( mov esi, K_END) + ASJ( jmp, 3, f) +#endif + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + ASL(0) + AS2( movdqa E(0), xmm1) + AS2( movdqa A(0), xmm0) +#endif +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + ASL(3) +#endif + AS2( sub WORD_REG(si), 48*4) + SWAP_COPY(0) SWAP_COPY(1) SWAP_COPY(2) SWAP_COPY(3) + SWAP_COPY(4) SWAP_COPY(5) SWAP_COPY(6) SWAP_COPY(7) +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + SWAP_COPY(8) SWAP_COPY(9) SWAP_COPY(10) SWAP_COPY(11) + SWAP_COPY(12) SWAP_COPY(13) SWAP_COPY(14) SWAP_COPY(15) +#endif + AS2( mov edi, E(0)) // E + AS2( mov eax, B(0)) // B + AS2( xor eax, C(0)) // B^C + AS2( mov ecx, A(0)) // A + + ROUND(0, 0, eax, ecx, edi, edx) + ROUND(1, 0, ecx, eax, edx, edi) + ROUND(2, 0, eax, ecx, edi, edx) + ROUND(3, 0, ecx, eax, edx, edi) + ROUND(4, 0, eax, ecx, edi, edx) + ROUND(5, 0, ecx, eax, edx, edi) + ROUND(6, 0, eax, ecx, edi, edx) + ROUND(7, 0, ecx, eax, edx, edi) + ROUND(8, 0, eax, ecx, edi, edx) + ROUND(9, 0, ecx, eax, edx, edi) + ROUND(10, 0, eax, ecx, edi, edx) + ROUND(11, 0, ecx, eax, edx, edi) + ROUND(12, 0, eax, ecx, edi, edx) + ROUND(13, 0, ecx, eax, edx, edi) + ROUND(14, 0, eax, ecx, edi, edx) + ROUND(15, 0, ecx, eax, edx, edi) + + ASL(1) + AS2(add WORD_REG(si), 4*16) + ROUND(0, 1, eax, ecx, edi, edx) + ROUND(1, 1, ecx, eax, edx, edi) + ROUND(2, 1, eax, ecx, edi, edx) + ROUND(3, 1, ecx, eax, edx, edi) + ROUND(4, 1, eax, ecx, edi, edx) + ROUND(5, 1, ecx, eax, edx, edi) + ROUND(6, 1, eax, ecx, edi, edx) + ROUND(7, 1, ecx, eax, edx, edi) + ROUND(8, 1, eax, ecx, edi, edx) + ROUND(9, 1, ecx, eax, edx, edi) + ROUND(10, 1, eax, ecx, edi, edx) + ROUND(11, 1, ecx, eax, edx, edi) + ROUND(12, 1, eax, ecx, edi, edx) + ROUND(13, 1, ecx, eax, edx, edi) + ROUND(14, 1, eax, ecx, edi, edx) + ROUND(15, 1, ecx, eax, edx, edi) + AS2( cmp WORD_REG(si), K_END) + ASJ( jb, 1, b) + + AS2( mov WORD_REG(dx), DATA_SAVE) + AS2( add WORD_REG(dx), 64) + AS2( mov AS_REG_7, STATE_SAVE) + AS2( mov DATA_SAVE, WORD_REG(dx)) + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( test DWORD PTR K_END, 1) + ASJ( jz, 4, f) +#endif + AS2( movdqa xmm1, XMMWORD_PTR [AS_REG_7+1*16]) + AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_7+0*16]) + AS2( paddd xmm1, E(0)) + AS2( paddd xmm0, A(0)) + AS2( movdqa [AS_REG_7+1*16], xmm1) + AS2( movdqa [AS_REG_7+0*16], xmm0) + AS2( cmp WORD_REG(dx), DATA_END) + ASJ( jb, 0, b) +#endif + +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + ASJ( jmp, 5, f) + ASL(4) // non-SSE2 +#endif + AS2( add [AS_REG_7+0*4], ecx) // A + AS2( add [AS_REG_7+4*4], edi) // E + AS2( mov eax, B(0)) + AS2( mov ebx, C(0)) + AS2( mov ecx, D(0)) + AS2( add [AS_REG_7+1*4], eax) + AS2( add [AS_REG_7+2*4], ebx) + AS2( add [AS_REG_7+3*4], ecx) + AS2( mov eax, F(0)) + AS2( mov ebx, G(0)) + AS2( mov ecx, H(0)) + AS2( add [AS_REG_7+5*4], eax) + AS2( add [AS_REG_7+6*4], ebx) + AS2( add [AS_REG_7+7*4], ecx) + AS2( mov ecx, AS_REG_7d) + AS2( cmp WORD_REG(dx), DATA_END) + ASJ( jb, 2, b) +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + ASL(5) +#endif +#endif + + AS_POP_IF86(sp) + AS_POP_IF86(bp) + #if !defined(_MSC_VER) || (_MSC_VER < 1400) + AS_POP_IF86(bx) + #endif + +#ifdef CRYPTOPP_GENERATE_X64_MASM + add rsp, LOCALS_SIZE+8 + pop rbp + pop rbx + pop rdi + pop rsi + ret + X86_SHA256_HashBlocks ENDP +#endif + +#ifdef __GNUC__ + ATT_PREFIX + : + : "c" (state), "d" (data), "S" (SHA256_K+48), "D" (len) + #if CRYPTOPP_BOOL_X64 + , "m" (workspace[0]) + #endif + : "memory", "cc", "%eax" + #if CRYPTOPP_BOOL_X64 + , "%rbx", "%r8", "%r10" + #endif + ); +#endif +} + +#endif // (defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_GENERATE_X64_MASM)) + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +void CRYPTOPP_FASTCALL X86_SHA256_HashBlocks(word32 *state, const word32 *data, size_t len); +} +#endif + +#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) + +size_t SHA256::HashMultipleBlocks(const word32 *input, size_t length) +{ + X86_SHA256_HashBlocks(m_state, input, (length&(size_t(0)-BLOCKSIZE)) - !HasSSE2()); + return length % BLOCKSIZE; +} + +size_t SHA224::HashMultipleBlocks(const word32 *input, size_t length) +{ + X86_SHA256_HashBlocks(m_state, input, (length&(size_t(0)-BLOCKSIZE)) - !HasSSE2()); + return length % BLOCKSIZE; +} + +#endif + +#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15])) + +#define Ch(x,y,z) (z^(x&(y^z))) +#define Maj(x,y,z) (y^((x^y)&(y^z))) + +#define a(i) T[(0-i)&7] +#define b(i) T[(1-i)&7] +#define c(i) T[(2-i)&7] +#define d(i) T[(3-i)&7] +#define e(i) T[(4-i)&7] +#define f(i) T[(5-i)&7] +#define g(i) T[(6-i)&7] +#define h(i) T[(7-i)&7] + +#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+SHA256_K[i+j]+(j?blk2(i):blk0(i));\ + d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) + +// for SHA256 +#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22)) +#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25)) +#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3)) +#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10)) + +void SHA256::Transform(word32 *state, const word32 *data) +{ + word32 W[16]; +#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) + // this byte reverse is a waste of time, but this function is only called by MDC + ByteReverse(W, data, BLOCKSIZE); + X86_SHA256_HashBlocks(state, W, BLOCKSIZE - !HasSSE2()); +#else + word32 T[8]; + /* Copy context->state[] to working vars */ + memcpy(T, state, sizeof(T)); + /* 64 operations, partially loop unrolled */ + for (unsigned int j=0; j<64; j+=16) + { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + /* Add the working vars back into context.state[] */ + state[0] += a(0); + state[1] += b(0); + state[2] += c(0); + state[3] += d(0); + state[4] += e(0); + state[5] += f(0); + state[6] += g(0); + state[7] += h(0); +#endif +} + +/* +// smaller but slower +void SHA256::Transform(word32 *state, const word32 *data) +{ + word32 T[20]; + word32 W[32]; + unsigned int i = 0, j = 0; + word32 *t = T+8; + + memcpy(t, state, 8*4); + word32 e = t[4], a = t[0]; + + do + { + word32 w = data[j]; + W[j] = w; + w += SHA256_K[j]; + w += t[7]; + w += S1(e); + w += Ch(e, t[5], t[6]); + e = t[3] + w; + t[3] = t[3+8] = e; + w += S0(t[0]); + a = w + Maj(a, t[1], t[2]); + t[-1] = t[7] = a; + --t; + ++j; + if (j%8 == 0) + t += 8; + } while (j<16); + + do + { + i = j&0xf; + word32 w = s1(W[i+16-2]) + s0(W[i+16-15]) + W[i] + W[i+16-7]; + W[i+16] = W[i] = w; + w += SHA256_K[j]; + w += t[7]; + w += S1(e); + w += Ch(e, t[5], t[6]); + e = t[3] + w; + t[3] = t[3+8] = e; + w += S0(t[0]); + a = w + Maj(a, t[1], t[2]); + t[-1] = t[7] = a; + + w = s1(W[(i+1)+16-2]) + s0(W[(i+1)+16-15]) + W[(i+1)] + W[(i+1)+16-7]; + W[(i+1)+16] = W[(i+1)] = w; + w += SHA256_K[j+1]; + w += (t-1)[7]; + w += S1(e); + w += Ch(e, (t-1)[5], (t-1)[6]); + e = (t-1)[3] + w; + (t-1)[3] = (t-1)[3+8] = e; + w += S0((t-1)[0]); + a = w + Maj(a, (t-1)[1], (t-1)[2]); + (t-1)[-1] = (t-1)[7] = a; + + t-=2; + j+=2; + if (j%8 == 0) + t += 8; + } while (j<64); + + state[0] += a; + state[1] += t[1]; + state[2] += t[2]; + state[3] += t[3]; + state[4] += e; + state[5] += t[5]; + state[6] += t[6]; + state[7] += t[7]; +} +*/ + +#undef S0 +#undef S1 +#undef s0 +#undef s1 +#undef R + +// ************************************************************* + +void SHA384::InitState(HashWordType *state) +{ + static const word64 s[8] = { + W64LIT(0xcbbb9d5dc1059ed8), W64LIT(0x629a292a367cd507), + W64LIT(0x9159015a3070dd17), W64LIT(0x152fecd8f70e5939), + W64LIT(0x67332667ffc00b31), W64LIT(0x8eb44a8768581511), + W64LIT(0xdb0c2e0d64f98fa7), W64LIT(0x47b5481dbefa4fa4)}; + memcpy(state, s, sizeof(s)); +} + +void SHA512::InitState(HashWordType *state) +{ + static const word64 s[8] = { + W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b), + W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1), + W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f), + W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179)}; + memcpy(state, s, sizeof(s)); +} + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) +CRYPTOPP_ALIGN_DATA(16) static const word64 SHA512_K[80] CRYPTOPP_SECTION_ALIGN16 = { +#else +static const word64 SHA512_K[80] = { +#endif + W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd), + W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc), + W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019), + W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118), + W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe), + W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2), + W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1), + W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694), + W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3), + W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65), + W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483), + W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5), + W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210), + W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4), + W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725), + W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70), + W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926), + W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df), + W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8), + W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b), + W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001), + W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30), + W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910), + W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8), + W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53), + W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8), + W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb), + W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3), + W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60), + W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec), + W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9), + W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b), + W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207), + W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178), + W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6), + W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b), + W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493), + W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c), + W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a), + W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817) +}; + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) +// put assembly version in separate function, otherwise MSVC 2005 SP1 doesn't generate correct code for the non-assembly version +CRYPTOPP_NAKED static void CRYPTOPP_FASTCALL SHA512_SSE2_Transform(word64 *state, const word64 *data) +{ +#ifdef __GNUC__ + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS_PUSH_IF86( bx) + AS2( mov ebx, eax) +#else + AS1( push ebx) + AS1( push esi) + AS1( push edi) + AS2( lea ebx, SHA512_K) +#endif + + AS2( mov eax, esp) + AS2( and esp, 0xfffffff0) + AS2( sub esp, 27*16) // 17*16 for expanded data, 20*8 for state + AS_PUSH_IF86( ax) + AS2( xor eax, eax) + +#if CRYPTOPP_BOOL_X32 + AS2( lea edi, [esp+8+8*8]) // start at middle of state buffer. will decrement pointer each round to avoid copying + AS2( lea esi, [esp+8+20*8+8]) // 16-byte alignment, then add 8 +#else + AS2( lea edi, [esp+4+8*8]) // start at middle of state buffer. will decrement pointer each round to avoid copying + AS2( lea esi, [esp+4+20*8+8]) // 16-byte alignment, then add 8 +#endif + + AS2( movdqa xmm0, [ecx+0*16]) + AS2( movdq2q mm4, xmm0) + AS2( movdqa [edi+0*16], xmm0) + AS2( movdqa xmm0, [ecx+1*16]) + AS2( movdqa [edi+1*16], xmm0) + AS2( movdqa xmm0, [ecx+2*16]) + AS2( movdq2q mm5, xmm0) + AS2( movdqa [edi+2*16], xmm0) + AS2( movdqa xmm0, [ecx+3*16]) + AS2( movdqa [edi+3*16], xmm0) + ASJ( jmp, 0, f) + +#define SSE2_S0_S1(r, a, b, c) \ + AS2( movq mm6, r)\ + AS2( psrlq r, a)\ + AS2( movq mm7, r)\ + AS2( psllq mm6, 64-c)\ + AS2( pxor mm7, mm6)\ + AS2( psrlq r, b-a)\ + AS2( pxor mm7, r)\ + AS2( psllq mm6, c-b)\ + AS2( pxor mm7, mm6)\ + AS2( psrlq r, c-b)\ + AS2( pxor r, mm7)\ + AS2( psllq mm6, b-a)\ + AS2( pxor r, mm6) + +#define SSE2_s0(r, a, b, c) \ + AS2( movdqa xmm6, r)\ + AS2( psrlq r, a)\ + AS2( movdqa xmm7, r)\ + AS2( psllq xmm6, 64-c)\ + AS2( pxor xmm7, xmm6)\ + AS2( psrlq r, b-a)\ + AS2( pxor xmm7, r)\ + AS2( psrlq r, c-b)\ + AS2( pxor r, xmm7)\ + AS2( psllq xmm6, c-a)\ + AS2( pxor r, xmm6) + +#define SSE2_s1(r, a, b, c) \ + AS2( movdqa xmm6, r)\ + AS2( psrlq r, a)\ + AS2( movdqa xmm7, r)\ + AS2( psllq xmm6, 64-c)\ + AS2( pxor xmm7, xmm6)\ + AS2( psrlq r, b-a)\ + AS2( pxor xmm7, r)\ + AS2( psllq xmm6, c-b)\ + AS2( pxor xmm7, xmm6)\ + AS2( psrlq r, c-b)\ + AS2( pxor r, xmm7) + + ASL(SHA512_Round) + // k + w is in mm0, a is in mm4, e is in mm5 + AS2( paddq mm0, [edi+7*8]) // h + AS2( movq mm2, [edi+5*8]) // f + AS2( movq mm3, [edi+6*8]) // g + AS2( pxor mm2, mm3) + AS2( pand mm2, mm5) + SSE2_S0_S1(mm5,14,18,41) + AS2( pxor mm2, mm3) + AS2( paddq mm0, mm2) // h += Ch(e,f,g) + AS2( paddq mm5, mm0) // h += S1(e) + AS2( movq mm2, [edi+1*8]) // b + AS2( movq mm1, mm2) + AS2( por mm2, mm4) + AS2( pand mm2, [edi+2*8]) // c + AS2( pand mm1, mm4) + AS2( por mm1, mm2) + AS2( paddq mm1, mm5) // temp = h + Maj(a,b,c) + AS2( paddq mm5, [edi+3*8]) // e = d + h + AS2( movq [edi+3*8], mm5) + AS2( movq [edi+11*8], mm5) + SSE2_S0_S1(mm4,28,34,39) // S0(a) + AS2( paddq mm4, mm1) // a = temp + S0(a) + AS2( movq [edi-8], mm4) + AS2( movq [edi+7*8], mm4) + AS1( ret) + + // first 16 rounds + ASL(0) + AS2( movq mm0, [edx+eax*8]) + AS2( movq [esi+eax*8], mm0) + AS2( movq [esi+eax*8+16*8], mm0) + AS2( paddq mm0, [ebx+eax*8]) + ASC( call, SHA512_Round) + AS1( inc eax) + AS2( sub edi, 8) + AS2( test eax, 7) + ASJ( jnz, 0, b) + AS2( add edi, 8*8) + AS2( cmp eax, 16) + ASJ( jne, 0, b) + + // rest of the rounds + AS2( movdqu xmm0, [esi+(16-2)*8]) + ASL(1) + // data expansion, W[i-2] already in xmm0 + AS2( movdqu xmm3, [esi]) + AS2( paddq xmm3, [esi+(16-7)*8]) + AS2( movdqa xmm2, [esi+(16-15)*8]) + SSE2_s1(xmm0, 6, 19, 61) + AS2( paddq xmm0, xmm3) + SSE2_s0(xmm2, 1, 7, 8) + AS2( paddq xmm0, xmm2) + AS2( movdq2q mm0, xmm0) + AS2( movhlps xmm1, xmm0) + AS2( paddq mm0, [ebx+eax*8]) + AS2( movlps [esi], xmm0) + AS2( movlps [esi+8], xmm1) + AS2( movlps [esi+8*16], xmm0) + AS2( movlps [esi+8*17], xmm1) + // 2 rounds + ASC( call, SHA512_Round) + AS2( sub edi, 8) + AS2( movdq2q mm0, xmm1) + AS2( paddq mm0, [ebx+eax*8+8]) + ASC( call, SHA512_Round) + // update indices and loop + AS2( add esi, 16) + AS2( add eax, 2) + AS2( sub edi, 8) + AS2( test eax, 7) + ASJ( jnz, 1, b) + // do housekeeping every 8 rounds + AS2( mov esi, 0xf) + AS2( and esi, eax) +#if CRYPTOPP_BOOL_X32 + AS2( lea esi, [esp+8+20*8+8+esi*8]) +#else + AS2( lea esi, [esp+4+20*8+8+esi*8]) +#endif + AS2( add edi, 8*8) + AS2( cmp eax, 80) + ASJ( jne, 1, b) + +#define SSE2_CombineState(i) \ + AS2( movdqa xmm0, [edi+i*16])\ + AS2( paddq xmm0, [ecx+i*16])\ + AS2( movdqa [ecx+i*16], xmm0) + + SSE2_CombineState(0) + SSE2_CombineState(1) + SSE2_CombineState(2) + SSE2_CombineState(3) + + AS_POP_IF86( sp) + AS1( emms) + +#if defined(__GNUC__) + AS_POP_IF86( bx) + ATT_PREFIX + : + : "a" (SHA512_K), "c" (state), "d" (data) + : "%esi", "%edi", "memory", "cc" + ); +#else + AS1( pop edi) + AS1( pop esi) + AS1( pop ebx) + AS1( ret) +#endif +} +#endif // #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + +void SHA512::Transform(word64 *state, const word64 *data) +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) + if (HasSSE2()) + { + SHA512_SSE2_Transform(state, data); + return; + } +#endif + +#define S0(x) (rotrFixed(x,28)^rotrFixed(x,34)^rotrFixed(x,39)) +#define S1(x) (rotrFixed(x,14)^rotrFixed(x,18)^rotrFixed(x,41)) +#define s0(x) (rotrFixed(x,1)^rotrFixed(x,8)^(x>>7)) +#define s1(x) (rotrFixed(x,19)^rotrFixed(x,61)^(x>>6)) + +#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+SHA512_K[i+j]+(j?blk2(i):blk0(i));\ + d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) + + word64 W[16]; + word64 T[8]; + /* Copy context->state[] to working vars */ + memcpy(T, state, sizeof(T)); + /* 80 operations, partially loop unrolled */ + for (unsigned int j=0; j<80; j+=16) + { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + /* Add the working vars back into context.state[] */ + state[0] += a(0); + state[1] += b(0); + state[2] += c(0); + state[3] += d(0); + state[4] += e(0); + state[5] += f(0); + state[6] += g(0); + state[7] += h(0); +} + +NAMESPACE_END + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM +#endif // #ifndef CRYPTOPP_IMPORTS diff --git a/external/crypto++-5.6.3/sha.h b/external/crypto++-5.6.3/sha.h new file mode 100644 index 000000000..bf6d1227f --- /dev/null +++ b/external/crypto++-5.6.3/sha.h @@ -0,0 +1,70 @@ +// sha.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile sha.h +//! \brief Classes for SHA-1 and SHA-2 family of message digests + +#ifndef CRYPTOPP_SHA_H +#define CRYPTOPP_SHA_H + +#include "config.h" +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// SHA-1 +class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform +{ +public: + static void CRYPTOPP_API InitState(HashWordType *state); + static void CRYPTOPP_API Transform(word32 *digest, const word32 *data); + static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-1";} +}; + +typedef SHA1 SHA; // for backwards compatibility + +//! implements the SHA-256 standard +class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform +{ +public: +#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) && !defined(CRYPTOPP_DISABLE_SHA_ASM) + size_t HashMultipleBlocks(const word32 *input, size_t length); +#endif + static void CRYPTOPP_API InitState(HashWordType *state); + static void CRYPTOPP_API Transform(word32 *digest, const word32 *data); + static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-256";} +}; + +//! implements the SHA-224 standard +class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform +{ +public: +#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) && !defined(CRYPTOPP_DISABLE_SHA_ASM) + size_t HashMultipleBlocks(const word32 *input, size_t length); +#endif + static void CRYPTOPP_API InitState(HashWordType *state); + static void CRYPTOPP_API Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);} + static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-224";} +}; + +//! implements the SHA-512 standard +class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform +{ +public: + static void CRYPTOPP_API InitState(HashWordType *state); + static void CRYPTOPP_API Transform(word64 *digest, const word64 *data); + static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-512";} +}; + +//! implements the SHA-384 standard +class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform +{ +public: + static void CRYPTOPP_API InitState(HashWordType *state); + static void CRYPTOPP_API Transform(word64 *digest, const word64 *data) {SHA512::Transform(digest, data);} + static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-384";} +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/sha3.cpp b/external/crypto++-5.6.3/sha3.cpp new file mode 100644 index 000000000..987975612 --- /dev/null +++ b/external/crypto++-5.6.3/sha3.cpp @@ -0,0 +1,290 @@ +// sha3.cpp - modified by Wei Dai from Ronny Van Keer's public domain Keccak-simple.c +// all modifications here are placed in the public domain by Wei Dai + +/* +The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, +Michael Peeters and Gilles Van Assche. For more information, feedback or +questions, please refer to our website: http://keccak.noekeon.org/ + +Implementation by Ronny Van Keer, +hereby denoted as "the implementer". + +To the extent possible under law, the implementer has waived all copyright +and related or neighboring rights to the source code in this file. +http://creativecommons.org/publicdomain/zero/1.0/ +*/ + +#include "pch.h" +#include "sha3.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const word64 KeccakF_RoundConstants[24] = +{ + W64LIT(0x0000000000000001), W64LIT(0x0000000000008082), W64LIT(0x800000000000808a), + W64LIT(0x8000000080008000), W64LIT(0x000000000000808b), W64LIT(0x0000000080000001), + W64LIT(0x8000000080008081), W64LIT(0x8000000000008009), W64LIT(0x000000000000008a), + W64LIT(0x0000000000000088), W64LIT(0x0000000080008009), W64LIT(0x000000008000000a), + W64LIT(0x000000008000808b), W64LIT(0x800000000000008b), W64LIT(0x8000000000008089), + W64LIT(0x8000000000008003), W64LIT(0x8000000000008002), W64LIT(0x8000000000000080), + W64LIT(0x000000000000800a), W64LIT(0x800000008000000a), W64LIT(0x8000000080008081), + W64LIT(0x8000000000008080), W64LIT(0x0000000080000001), W64LIT(0x8000000080008008) +}; + +static void KeccakF1600(word64 *state) +{ + { + word64 Aba, Abe, Abi, Abo, Abu; + word64 Aga, Age, Agi, Ago, Agu; + word64 Aka, Ake, Aki, Ako, Aku; + word64 Ama, Ame, Ami, Amo, Amu; + word64 Asa, Ase, Asi, Aso, Asu; + word64 BCa, BCe, BCi, BCo, BCu; + word64 Da, De, Di, Do, Du; + word64 Eba, Ebe, Ebi, Ebo, Ebu; + word64 Ega, Ege, Egi, Ego, Egu; + word64 Eka, Eke, Eki, Eko, Eku; + word64 Ema, Eme, Emi, Emo, Emu; + word64 Esa, Ese, Esi, Eso, Esu; + + //copyFromState(A, state) + typedef BlockGetAndPut Block; + Block::Get(state)(Aba)(Abe)(Abi)(Abo)(Abu)(Aga)(Age)(Agi)(Ago)(Agu)(Aka)(Ake)(Aki)(Ako)(Aku)(Ama)(Ame)(Ami)(Amo)(Amu)(Asa)(Ase)(Asi)(Aso)(Asu); + + for( unsigned int round = 0; round < 24; round += 2 ) + { + // prepareTheta + BCa = Aba^Aga^Aka^Ama^Asa; + BCe = Abe^Age^Ake^Ame^Ase; + BCi = Abi^Agi^Aki^Ami^Asi; + BCo = Abo^Ago^Ako^Amo^Aso; + BCu = Abu^Agu^Aku^Amu^Asu; + + //thetaRhoPiChiIotaPrepareTheta(round , A, E) + Da = BCu^rotlFixed(BCe, 1); + De = BCa^rotlFixed(BCi, 1); + Di = BCe^rotlFixed(BCo, 1); + Do = BCi^rotlFixed(BCu, 1); + Du = BCo^rotlFixed(BCa, 1); + + Aba ^= Da; + BCa = Aba; + Age ^= De; + BCe = rotlFixed(Age, 44); + Aki ^= Di; + BCi = rotlFixed(Aki, 43); + Amo ^= Do; + BCo = rotlFixed(Amo, 21); + Asu ^= Du; + BCu = rotlFixed(Asu, 14); + Eba = BCa ^((~BCe)& BCi ); + Eba ^= (word64)KeccakF_RoundConstants[round]; + Ebe = BCe ^((~BCi)& BCo ); + Ebi = BCi ^((~BCo)& BCu ); + Ebo = BCo ^((~BCu)& BCa ); + Ebu = BCu ^((~BCa)& BCe ); + + Abo ^= Do; + BCa = rotlFixed(Abo, 28); + Agu ^= Du; + BCe = rotlFixed(Agu, 20); + Aka ^= Da; + BCi = rotlFixed(Aka, 3); + Ame ^= De; + BCo = rotlFixed(Ame, 45); + Asi ^= Di; + BCu = rotlFixed(Asi, 61); + Ega = BCa ^((~BCe)& BCi ); + Ege = BCe ^((~BCi)& BCo ); + Egi = BCi ^((~BCo)& BCu ); + Ego = BCo ^((~BCu)& BCa ); + Egu = BCu ^((~BCa)& BCe ); + + Abe ^= De; + BCa = rotlFixed(Abe, 1); + Agi ^= Di; + BCe = rotlFixed(Agi, 6); + Ako ^= Do; + BCi = rotlFixed(Ako, 25); + Amu ^= Du; + BCo = rotlFixed(Amu, 8); + Asa ^= Da; + BCu = rotlFixed(Asa, 18); + Eka = BCa ^((~BCe)& BCi ); + Eke = BCe ^((~BCi)& BCo ); + Eki = BCi ^((~BCo)& BCu ); + Eko = BCo ^((~BCu)& BCa ); + Eku = BCu ^((~BCa)& BCe ); + + Abu ^= Du; + BCa = rotlFixed(Abu, 27); + Aga ^= Da; + BCe = rotlFixed(Aga, 36); + Ake ^= De; + BCi = rotlFixed(Ake, 10); + Ami ^= Di; + BCo = rotlFixed(Ami, 15); + Aso ^= Do; + BCu = rotlFixed(Aso, 56); + Ema = BCa ^((~BCe)& BCi ); + Eme = BCe ^((~BCi)& BCo ); + Emi = BCi ^((~BCo)& BCu ); + Emo = BCo ^((~BCu)& BCa ); + Emu = BCu ^((~BCa)& BCe ); + + Abi ^= Di; + BCa = rotlFixed(Abi, 62); + Ago ^= Do; + BCe = rotlFixed(Ago, 55); + Aku ^= Du; + BCi = rotlFixed(Aku, 39); + Ama ^= Da; + BCo = rotlFixed(Ama, 41); + Ase ^= De; + BCu = rotlFixed(Ase, 2); + Esa = BCa ^((~BCe)& BCi ); + Ese = BCe ^((~BCi)& BCo ); + Esi = BCi ^((~BCo)& BCu ); + Eso = BCo ^((~BCu)& BCa ); + Esu = BCu ^((~BCa)& BCe ); + + // prepareTheta + BCa = Eba^Ega^Eka^Ema^Esa; + BCe = Ebe^Ege^Eke^Eme^Ese; + BCi = Ebi^Egi^Eki^Emi^Esi; + BCo = Ebo^Ego^Eko^Emo^Eso; + BCu = Ebu^Egu^Eku^Emu^Esu; + + //thetaRhoPiChiIotaPrepareTheta(round+1, E, A) + Da = BCu^rotlFixed(BCe, 1); + De = BCa^rotlFixed(BCi, 1); + Di = BCe^rotlFixed(BCo, 1); + Do = BCi^rotlFixed(BCu, 1); + Du = BCo^rotlFixed(BCa, 1); + + Eba ^= Da; + BCa = Eba; + Ege ^= De; + BCe = rotlFixed(Ege, 44); + Eki ^= Di; + BCi = rotlFixed(Eki, 43); + Emo ^= Do; + BCo = rotlFixed(Emo, 21); + Esu ^= Du; + BCu = rotlFixed(Esu, 14); + Aba = BCa ^((~BCe)& BCi ); + Aba ^= (word64)KeccakF_RoundConstants[round+1]; + Abe = BCe ^((~BCi)& BCo ); + Abi = BCi ^((~BCo)& BCu ); + Abo = BCo ^((~BCu)& BCa ); + Abu = BCu ^((~BCa)& BCe ); + + Ebo ^= Do; + BCa = rotlFixed(Ebo, 28); + Egu ^= Du; + BCe = rotlFixed(Egu, 20); + Eka ^= Da; + BCi = rotlFixed(Eka, 3); + Eme ^= De; + BCo = rotlFixed(Eme, 45); + Esi ^= Di; + BCu = rotlFixed(Esi, 61); + Aga = BCa ^((~BCe)& BCi ); + Age = BCe ^((~BCi)& BCo ); + Agi = BCi ^((~BCo)& BCu ); + Ago = BCo ^((~BCu)& BCa ); + Agu = BCu ^((~BCa)& BCe ); + + Ebe ^= De; + BCa = rotlFixed(Ebe, 1); + Egi ^= Di; + BCe = rotlFixed(Egi, 6); + Eko ^= Do; + BCi = rotlFixed(Eko, 25); + Emu ^= Du; + BCo = rotlFixed(Emu, 8); + Esa ^= Da; + BCu = rotlFixed(Esa, 18); + Aka = BCa ^((~BCe)& BCi ); + Ake = BCe ^((~BCi)& BCo ); + Aki = BCi ^((~BCo)& BCu ); + Ako = BCo ^((~BCu)& BCa ); + Aku = BCu ^((~BCa)& BCe ); + + Ebu ^= Du; + BCa = rotlFixed(Ebu, 27); + Ega ^= Da; + BCe = rotlFixed(Ega, 36); + Eke ^= De; + BCi = rotlFixed(Eke, 10); + Emi ^= Di; + BCo = rotlFixed(Emi, 15); + Eso ^= Do; + BCu = rotlFixed(Eso, 56); + Ama = BCa ^((~BCe)& BCi ); + Ame = BCe ^((~BCi)& BCo ); + Ami = BCi ^((~BCo)& BCu ); + Amo = BCo ^((~BCu)& BCa ); + Amu = BCu ^((~BCa)& BCe ); + + Ebi ^= Di; + BCa = rotlFixed(Ebi, 62); + Ego ^= Do; + BCe = rotlFixed(Ego, 55); + Eku ^= Du; + BCi = rotlFixed(Eku, 39); + Ema ^= Da; + BCo = rotlFixed(Ema, 41); + Ese ^= De; + BCu = rotlFixed(Ese, 2); + Asa = BCa ^((~BCe)& BCi ); + Ase = BCe ^((~BCi)& BCo ); + Asi = BCi ^((~BCo)& BCu ); + Aso = BCo ^((~BCu)& BCa ); + Asu = BCu ^((~BCa)& BCe ); + } + + //copyToState(state, A) + Block::Put(NULL, state)(Aba)(Abe)(Abi)(Abo)(Abu)(Aga)(Age)(Agi)(Ago)(Agu)(Aka)(Ake)(Aki)(Ako)(Aku)(Ama)(Ame)(Ami)(Amo)(Amu)(Asa)(Ase)(Asi)(Aso)(Asu); + } +} + +void SHA3::Update(const byte *input, size_t length) +{ + assert((input && length) || !(input || length)); + if (!length) + return; + + size_t spaceLeft; + while (length >= (spaceLeft = r() - m_counter)) + { + if (spaceLeft) + xorbuf(m_state.BytePtr() + m_counter, input, spaceLeft); + KeccakF1600(m_state); + input += spaceLeft; + length -= spaceLeft; + m_counter = 0; + } + + if (length) + xorbuf(m_state.BytePtr() + m_counter, input, length); + m_counter += (unsigned int)length; +} + +void SHA3::Restart() +{ + memset(m_state, 0, m_state.SizeInBytes()); + m_counter = 0; +} + +void SHA3::TruncatedFinal(byte *hash, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + m_state.BytePtr()[m_counter] ^= 1; + m_state.BytePtr()[r()-1] ^= 0x80; + KeccakF1600(m_state); + memcpy(hash, m_state, size); + Restart(); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/sha3.h b/external/crypto++-5.6.3/sha3.h new file mode 100644 index 000000000..5183e52db --- /dev/null +++ b/external/crypto++-5.6.3/sha3.h @@ -0,0 +1,69 @@ +// sha3.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile sha3.h +//! \brief Classes for SHA-3 message digests + +#ifndef CRYPTOPP_SHA3_H +#define CRYPTOPP_SHA3_H + +#include "cryptlib.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// SHA-3 +class SHA3 : public HashTransformation +{ +public: + SHA3(unsigned int digestSize) : m_digestSize(digestSize) {Restart();} + unsigned int DigestSize() const {return m_digestSize;} + std::string AlgorithmName() const {return "SHA-3-" + IntToString(m_digestSize*8);} + unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} + + void Update(const byte *input, size_t length); + void Restart(); + void TruncatedFinal(byte *hash, size_t size); + +protected: + inline unsigned int r() const {return 200 - 2 * m_digestSize;} + + FixedSizeSecBlock m_state; + unsigned int m_digestSize, m_counter; +}; + +class SHA3_224 : public SHA3 +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 28) + SHA3_224() : SHA3(DIGESTSIZE) {} + static const char * StaticAlgorithmName() {return "SHA-3-224";} +}; + +class SHA3_256 : public SHA3 +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 32) + SHA3_256() : SHA3(DIGESTSIZE) {} + static const char * StaticAlgorithmName() {return "SHA-3-256";} +}; + +class SHA3_384 : public SHA3 +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 48) + SHA3_384() : SHA3(DIGESTSIZE) {} + static const char * StaticAlgorithmName() {return "SHA-3-384";} +}; + +class SHA3_512 : public SHA3 +{ +public: + CRYPTOPP_CONSTANT(DIGESTSIZE = 64) + SHA3_512() : SHA3(DIGESTSIZE) {} + static const char * StaticAlgorithmName() {return "SHA-3-512";} +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/shacal2.cpp b/external/crypto++-5.6.3/shacal2.cpp new file mode 100644 index 000000000..b0360e404 --- /dev/null +++ b/external/crypto++-5.6.3/shacal2.cpp @@ -0,0 +1,140 @@ +// shacal2.cpp - by Kevin Springle, 2003 +// +// Portions of this code were derived from +// Wei Dai's implementation of SHA-2 +// +// The original code and all modifications are in the public domain. + +#include "pch.h" +#include "shacal2.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +// SHACAL-2 function and round definitions + +#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22)) +#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25)) +#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3)) +#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10)) + +#define Ch(x,y,z) (z^(x&(y^z))) +#define Maj(x,y,z) ((x&y)|(z&(x|y))) + +/* R is the SHA-256 round function. */ +/* This macro increments the k argument as a side effect. */ +#define R(a,b,c,d,e,f,g,h,k) \ + h+=S1(e)+Ch(e,f,g)+*k++;d+=h;h+=S0(a)+Maj(a,b,c); + +/* P is the inverse of the SHA-256 round function. */ +/* This macro decrements the k argument as a side effect. */ +#define P(a,b,c,d,e,f,g,h,k) \ + h-=S0(a)+Maj(a,b,c);d-=h;h-=S1(e)+Ch(e,f,g)+*--k; + +void SHACAL2::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, const NameValuePairs &) +{ + AssertValidKeyLength(keylen); + + word32 *rk = m_key; + unsigned int i; + + GetUserKey(BIG_ENDIAN_ORDER, rk, m_key.size(), userKey, keylen); + for (i = 0; i < 48; i++, rk++) + { + rk[16] = rk[0] + s0(rk[1]) + rk[9] + s1(rk[14]); + rk[0] += K[i]; + } + for (i = 48; i < 64; i++, rk++) + { + rk[0] += K[i]; + } +} + +typedef BlockGetAndPut Block; + +void SHACAL2::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 a, b, c, d, e, f, g, h; + const word32 *rk = m_key; + + /* + * map byte array block to cipher state: + */ + Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); + + // Perform SHA-256 transformation. + + /* 64 operations, partially loop unrolled */ + for (unsigned int j=0; j<64; j+=8) + { + R(a,b,c,d,e,f,g,h,rk); + R(h,a,b,c,d,e,f,g,rk); + R(g,h,a,b,c,d,e,f,rk); + R(f,g,h,a,b,c,d,e,rk); + R(e,f,g,h,a,b,c,d,rk); + R(d,e,f,g,h,a,b,c,rk); + R(c,d,e,f,g,h,a,b,rk); + R(b,c,d,e,f,g,h,a,rk); + } + + /* + * map cipher state to byte array block: + */ + + Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); +} + +void SHACAL2::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 a, b, c, d, e, f, g, h; + const word32 *rk = m_key + 64; + + /* + * map byte array block to cipher state: + */ + Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); + + // Perform inverse SHA-256 transformation. + + /* 64 operations, partially loop unrolled */ + for (unsigned int j=0; j<64; j+=8) + { + P(b,c,d,e,f,g,h,a,rk); + P(c,d,e,f,g,h,a,b,rk); + P(d,e,f,g,h,a,b,c,rk); + P(e,f,g,h,a,b,c,d,rk); + P(f,g,h,a,b,c,d,e,rk); + P(g,h,a,b,c,d,e,f,rk); + P(h,a,b,c,d,e,f,g,rk); + P(a,b,c,d,e,f,g,h,rk); + } + + /* + * map cipher state to byte array block: + */ + + Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); +} + +// The SHACAL-2 round constants are identical to the SHA-256 round constants. +const word32 SHACAL2::Base::K[64] = +{ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/shacal2.h b/external/crypto++-5.6.3/shacal2.h new file mode 100644 index 000000000..94a09922b --- /dev/null +++ b/external/crypto++-5.6.3/shacal2.h @@ -0,0 +1,56 @@ +// shacal.h - written and placed in the public domain by Wei Dai + +//! \file shacal.h +//! \brief Classes for the SHACAL-2 block cipher + +#ifndef CRYPTOPP_SHACAL2_H +#define CRYPTOPP_SHACAL2_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64> +{ + static const char *StaticAlgorithmName() {return "SHACAL-2";} +}; + +/// SHACAL-2 +class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + FixedSizeSecBlock m_key; + + static const word32 K[64]; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef SHACAL2::Encryption SHACAL2Encryption; +typedef SHACAL2::Decryption SHACAL2Decryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/shark.cpp b/external/crypto++-5.6.3/shark.cpp new file mode 100644 index 000000000..eb2ecc334 --- /dev/null +++ b/external/crypto++-5.6.3/shark.cpp @@ -0,0 +1,140 @@ +// shark.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "shark.h" +#include "misc.h" +#include "modes.h" +#include "gf256.h" + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +static word64 SHARKTransform(word64 a) +{ + static const byte iG[8][8] = { + 0xe7, 0x30, 0x90, 0x85, 0xd0, 0x4b, 0x91, 0x41, + 0x53, 0x95, 0x9b, 0xa5, 0x96, 0xbc, 0xa1, 0x68, + 0x02, 0x45, 0xf7, 0x65, 0x5c, 0x1f, 0xb6, 0x52, + 0xa2, 0xca, 0x22, 0x94, 0x44, 0x63, 0x2a, 0xa2, + 0xfc, 0x67, 0x8e, 0x10, 0x29, 0x75, 0x85, 0x71, + 0x24, 0x45, 0xa2, 0xcf, 0x2f, 0x22, 0xc1, 0x0e, + 0xa1, 0xf1, 0x71, 0x40, 0x91, 0x27, 0x18, 0xa5, + 0x56, 0xf4, 0xaf, 0x32, 0xd2, 0xa4, 0xdc, 0x71, + }; + + word64 result=0; + GF256 gf256(0xf5); + for (unsigned int i=0; i<8; i++) + for(unsigned int j=0; j<8; j++) + result ^= word64(gf256.Multiply(iG[i][j], GF256::Element(a>>(56-8*j)))) << (56-8*i); + return result; +} + +void SHARK::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(keyLen); + + m_rounds = GetRoundsAndThrowIfInvalid(params, this); + m_roundKeys.New(m_rounds+1); + + // concatenate key enought times to fill a + for (unsigned int i=0; i<(m_rounds+1)*8; i++) + ((byte *)m_roundKeys.begin())[i] = key[i%keyLen]; + + SHARK::Encryption e; + e.InitForKeySetup(); + byte IV[8] = {0,0,0,0,0,0,0,0}; + CFB_Mode_ExternalCipher::Encryption cfb(e, IV); + + cfb.ProcessString((byte *)m_roundKeys.begin(), (m_rounds+1)*8); + + ConditionalByteReverse(BIG_ENDIAN_ORDER, m_roundKeys.begin(), m_roundKeys.begin(), (m_rounds+1)*8); + + m_roundKeys[m_rounds] = SHARKTransform(m_roundKeys[m_rounds]); + + if (!IsForwardTransformation()) + { + unsigned int i; + + // transform encryption round keys into decryption round keys + for (i=0; i +struct SharkProcessAndXorBlock{ // VC60 workaround: problem with template functions +inline SharkProcessAndXorBlock(const word64 *roundKeys, unsigned int rounds, const byte *inBlock, const byte *xorBlock, byte *outBlock) +{ + word64 tmp = *(word64 *)inBlock ^ roundKeys[0]; + + ByteOrder order = GetNativeByteOrder(); + tmp = cbox[0][GetByte(order, tmp, 0)] ^ cbox[1][GetByte(order, tmp, 1)] + ^ cbox[2][GetByte(order, tmp, 2)] ^ cbox[3][GetByte(order, tmp, 3)] + ^ cbox[4][GetByte(order, tmp, 4)] ^ cbox[5][GetByte(order, tmp, 5)] + ^ cbox[6][GetByte(order, tmp, 6)] ^ cbox[7][GetByte(order, tmp, 7)] + ^ roundKeys[1]; + + for(unsigned int i=2; i(xorBlock, outBlock) + (sbox[GETBYTE(tmp, 7)]) + (sbox[GETBYTE(tmp, 6)]) + (sbox[GETBYTE(tmp, 5)]) + (sbox[GETBYTE(tmp, 4)]) + (sbox[GETBYTE(tmp, 3)]) + (sbox[GETBYTE(tmp, 2)]) + (sbox[GETBYTE(tmp, 1)]) + (sbox[GETBYTE(tmp, 0)]); + + *(word64 *)outBlock ^= roundKeys[rounds]; +}}; + +void SHARK::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + SharkProcessAndXorBlock(m_roundKeys, m_rounds, inBlock, xorBlock, outBlock); +} + +void SHARK::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + SharkProcessAndXorBlock(m_roundKeys, m_rounds, inBlock, xorBlock, outBlock); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/shark.h b/external/crypto++-5.6.3/shark.h new file mode 100644 index 000000000..93f505be3 --- /dev/null +++ b/external/crypto++-5.6.3/shark.h @@ -0,0 +1,67 @@ +// shark.h - written and placed in the public domain by Wei Dai + +//! \file shark.h +//! \brief Classes for the SHARK block cipher + +#ifndef CRYPTOPP_SHARK_H +#define CRYPTOPP_SHARK_H + +#include "config.h" +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct SHARK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 16>, public VariableRounds<6, 2> +{ + static const char *StaticAlgorithmName() {return "SHARK-E";} +}; + +/// SHARK-E +class SHARK : public SHARK_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶m); + + protected: + unsigned int m_rounds; + SecBlock m_roundKeys; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + // used by Base to do key setup + void InitForKeySetup(); + + private: + static const byte sbox[256]; + static const word64 cbox[8][256]; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + + private: + static const byte sbox[256]; + static const word64 cbox[8][256]; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef SHARK::Encryption SHARKEncryption; +typedef SHARK::Decryption SHARKDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/sharkbox.cpp b/external/crypto++-5.6.3/sharkbox.cpp new file mode 100644 index 000000000..230456d9b --- /dev/null +++ b/external/crypto++-5.6.3/sharkbox.cpp @@ -0,0 +1,4166 @@ +#include "pch.h" +#include "shark.h" + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +const byte SHARK::Enc::sbox[256] = { +177, 206, 195, 149, 90, 173, 231, 2, 77, 68, 251, 145, 12, 135, 161, 80, +203, 103, 84, 221, 70, 143, 225, 78, 240, 253, 252, 235, 249, 196, 26, 110, + 94, 245, 204, 141, 28, 86, 67, 254, 7, 97, 248, 117, 89, 255, 3, 34, +138, 209, 19, 238, 136, 0, 14, 52, 21, 128, 148, 227, 237, 181, 83, 35, + 75, 71, 23, 167, 144, 53, 171, 216, 184, 223, 79, 87, 154, 146, 219, 27, + 60, 200, 153, 4, 142, 224, 215, 125, 133, 187, 64, 44, 58, 69, 241, 66, +101, 32, 65, 24, 114, 37, 147, 112, 54, 5, 242, 11, 163, 121, 236, 8, + 39, 49, 50, 182, 124, 176, 10, 115, 91, 123, 183, 129, 210, 13, 106, 38, +158, 88, 156, 131, 116, 179, 172, 48, 122, 105, 119, 15, 174, 33, 222, 208, + 46, 151, 16, 164, 152, 168, 212, 104, 45, 98, 41, 109, 22, 73, 118, 199, +232, 193, 150, 55, 229, 202, 244, 233, 99, 18, 194, 166, 20, 188, 211, 40, +175, 47, 230, 36, 82, 198, 160, 9, 189, 140, 207, 93, 17, 95, 1, 197, +159, 61, 162, 155, 201, 59, 190, 81, 25, 31, 63, 92, 178, 239, 74, 205, +191, 186, 111, 100, 217, 243, 62, 180, 170, 220, 213, 6, 192, 126, 246, 102, +108, 132, 113, 56, 185, 29, 127, 157, 72, 139, 42, 218, 165, 51, 130, 57, +214, 120, 134, 250, 228, 43, 169, 30, 137, 96, 107, 234, 85, 76, 247, 226, +}; + +const byte SHARK::Dec::sbox[256] = { + 53, 190, 7, 46, 83, 105, 219, 40, 111, 183, 118, 107, 12, 125, 54, 139, +146, 188, 169, 50, 172, 56, 156, 66, 99, 200, 30, 79, 36, 229, 247, 201, + 97, 141, 47, 63, 179, 101, 127, 112, 175, 154, 234, 245, 91, 152, 144, 177, +135, 113, 114, 237, 55, 69, 104, 163, 227, 239, 92, 197, 80, 193, 214, 202, + 90, 98, 95, 38, 9, 93, 20, 65, 232, 157, 206, 64, 253, 8, 23, 74, + 15, 199, 180, 62, 18, 252, 37, 75, 129, 44, 4, 120, 203, 187, 32, 189, +249, 41, 153, 168, 211, 96, 223, 17, 151, 137, 126, 250, 224, 155, 31, 210, +103, 226, 100, 119, 132, 43, 158, 138, 241, 109, 136, 121, 116, 87, 221, 230, + 57, 123, 238, 131, 225, 88, 242, 13, 52, 248, 48, 233, 185, 35, 84, 21, + 68, 11, 77, 102, 58, 3, 162, 145, 148, 82, 76, 195, 130, 231, 128, 192, +182, 14, 194, 108, 147, 236, 171, 67, 149, 246, 216, 70, 134, 5, 140, 176, +117, 0, 204, 133, 215, 61, 115, 122, 72, 228, 209, 89, 173, 184, 198, 208, +220, 161, 170, 2, 29, 191, 181, 159, 81, 196, 165, 16, 34, 207, 1, 186, +143, 49, 124, 174, 150, 218, 240, 86, 71, 212, 235, 78, 217, 19, 142, 73, + 85, 22, 255, 59, 244, 164, 178, 6, 160, 167, 251, 27, 110, 60, 51, 205, + 24, 94, 106, 213, 166, 33, 222, 254, 42, 28, 243, 10, 26, 25, 39, 45, +}; + +const word64 SHARK::Enc::cbox[8][256] = { +/* box 0 */ +W64LIT(0x060d838f16f3a365), +W64LIT(0xa68857ee5cae56f6), +W64LIT(0xebf516353c2c4d89), +W64LIT(0x652174be88e85bdc), +W64LIT(0x0d4e9a8086c17921), +W64LIT(0x27ba7d33cffa58a1), +W64LIT(0x88d9e104a237b530), +W64LIT(0x693b8755a4fbe816), +W64LIT(0xdac9591826b254a0), +W64LIT(0x45c2e369fb336af3), +W64LIT(0xa96e1fb87b3e4ef4), +W64LIT(0xb7578f1435eb7ef0), +W64LIT(0x839af80b32056f74), +W64LIT(0xae37f55cc71f277a), +W64LIT(0xa4208538fdff37d5), +W64LIT(0x35991e74ad3cdb6f), +W64LIT(0xba191594b32a07d1), +W64LIT(0x5344d1772e572b7b), +W64LIT(0xe7efe5de103ffe43), +W64LIT(0xa3796fdc41de5e5b), +W64LIT(0x2cf9643c5fc882e5), +W64LIT(0xffdbf6fd48196d22), +W64LIT(0x33949dfbbbcf780a), +W64LIT(0x7d15679dd0cec8bd), +W64LIT(0x5f5e229c024498b1), +W64LIT(0x1223634762c683ce), +W64LIT(0xdcc4da973041f7c5), +W64LIT(0x0b43190f9032da44), +W64LIT(0xc05598eddfc5a6e2), +W64LIT(0x9e5fd31a7753f4b8), +W64LIT(0x9afa8243c0f136fe), +W64LIT(0xcc4f6b06f3d61528), +W64LIT(0xdf38612a3bc25c0d), +W64LIT(0x43cf60e6edc0c996), +W64LIT(0xcfb3d0bbf855bee0), +W64LIT(0x96e071a8ece28534), +W64LIT(0x21b7febcd909fbc4), +W64LIT(0x8ed4628bb4c41655), +W64LIT(0x30682646b04cd3c2), +W64LIT(0xb5ff5dc294ba1fd3), +W64LIT(0x75aac52f4b7fb931), +W64LIT(0xe809ad8837afe641), +W64LIT(0x0eb2213d8d42d2e9), +W64LIT(0x9852509561a057dd), +W64LIT(0xaa92a40570bde53c), +W64LIT(0x7b18e412c63d6bd8), +W64LIT(0xa7dc3e85f67c9c1d), +W64LIT(0xd8618bce87e33583), +W64LIT(0xe34ab487a79d3c05), +W64LIT(0x20e397d773db312f), +W64LIT(0x05f138321d7008ad), +W64LIT(0x17d25b757fb68b63), +W64LIT(0x8a7133d20366d413), +W64LIT(0x0000000000000000), +W64LIT(0xeaa17f5e96fe8762), +W64LIT(0xc101f18675176c09), +W64LIT(0xbebc44cd0488c597), +W64LIT(0xdb9d30738c609e4b), +W64LIT(0xabc6cd6eda6f2fd7), +W64LIT(0x5aaf1aae1f34901c), +W64LIT(0xb00e65f089ca177e), +W64LIT(0xd47b7825abf08649), +W64LIT(0x924520f15b404772), +W64LIT(0x1686321ed5644188), +W64LIT(0x618425e73f4a999a), +W64LIT(0xe21eddec0d4ff6ee), +W64LIT(0xd787c398a0732d81), +W64LIT(0x1f6df9c7e407faef), +W64LIT(0x79b036c4676c0afb), +W64LIT(0x0fe6485627901802), +W64LIT(0x9cf701ccd602959b), +W64LIT(0xbfe82da6ae5a0f7c), +W64LIT(0x990639fecb729d36), +W64LIT(0xca42e889e525b64d), +W64LIT(0xb3f2de4d8249bcb6), +W64LIT(0x4033db5be643625e), +W64LIT(0x4167b2304c91a8b5), +W64LIT(0x108bb191c397e2ed), +W64LIT(0x1834132358269361), +W64LIT(0x541d3b93927642f5), +W64LIT(0x90edf227fa112651), +W64LIT(0x1dc52b1145569bcc), +W64LIT(0xe6bb8cb5baed34a8), +W64LIT(0xd276fbaabd03252c), +W64LIT(0x313c4f2d1a9e1929), +W64LIT(0xfd73242be9480c01), +W64LIT(0x9baeeb286a23fc15), +W64LIT(0xc9be5334eea61d85), +W64LIT(0xc70c720963e4cf6c), +W64LIT(0x3eda077b3d0e012b), +W64LIT(0x97b418c346304fdf), +W64LIT(0x32c0f490111db2e1), +W64LIT(0x2ba08ed8e3e9eb6b), +W64LIT(0x8b255ab9a9b41ef8), +W64LIT(0x91b99b4c50c3ecba), +W64LIT(0xfe8f9f96e2cba7c9), +W64LIT(0x3a7f56228aacc36d), +W64LIT(0xb15a0c9b2318dd95), +W64LIT(0x5953a11314b73bd4), +W64LIT(0xf3c10516640adee8), +W64LIT(0xedf895ba2adfeeec), +W64LIT(0xadcb4ee1cc9c8cb2), +W64LIT(0xde6c0841911096e6), +W64LIT(0x84c312ef8e2406fa), +W64LIT(0xa83a76d3d1ec841f), +W64LIT(0x1c91427aef845127), +W64LIT(0x3665a5c9a6bf70a7), +W64LIT(0xf6303d24797ad645), +W64LIT(0xcd1b026d5904dfc3), +W64LIT(0x1bc8a89e53a538a9), +W64LIT(0x7ee9dc20db4d6375), +W64LIT(0x51ec03a18f064a58), +W64LIT(0xc4f0c9b4686764a4), +W64LIT(0xdd90b3fc9a933d2e), +W64LIT(0x7a4c8d796cefa133), +W64LIT(0x73a746a05d8c1a54), +W64LIT(0x0759eae4bc21698e), +W64LIT(0xc8ea3a5f4474d76e), +W64LIT(0x38d784f42bfda24e), +W64LIT(0x231f2c6a78589ae7), +W64LIT(0xc3a92350d4460d2a), +W64LIT(0x72f32fcbf75ed0bf), +W64LIT(0xbd40ff700f0b6e5f), +W64LIT(0x157a89a3dee7ea40), +W64LIT(0x873fa95285a7ad32), +W64LIT(0x4d7d41db60821b7f), +W64LIT(0x1e3990ac4ed53004), +W64LIT(0x0a1770643ae010af), +W64LIT(0x9311499af1928d99), +W64LIT(0x64751dd5223a9137), +W64LIT(0xfa2acecf5569658f), +W64LIT(0x7c410ef67a1c0256), +W64LIT(0x56b5e945332723d6), +W64LIT(0x6f3604dab2084b73), +W64LIT(0xe95dc4e39d7d2caa), +W64LIT(0x13770a2cc8144925), +W64LIT(0xbc14961ba5d9a4b4), +W64LIT(0xb9e5ae29b8a9ac19), +W64LIT(0xf169d7c0c55bbfcb), +W64LIT(0x2446c68ec479f369), +W64LIT(0x806643b63986c4bc), +W64LIT(0x7fbdb54b719fa99e), +W64LIT(0x04a55159b7a2c246), +W64LIT(0xee042e07215c4524), +W64LIT(0x5bfb73c5b5e65af7), +W64LIT(0x0c1af3eb2c13b3ca), +W64LIT(0xa22d06b7eb0c94b0), +W64LIT(0xb8b1c742127b66f2), +W64LIT(0x285c3565e86a40a3), +W64LIT(0x3b2b3f49207e0986), +W64LIT(0x3c72d5ad9c5f6008), +W64LIT(0x770217f9ea2ed812), +W64LIT(0xfc274d40439ac6ea), +W64LIT(0x4fd5930dc1d37a5c), +W64LIT(0x2e51b6eafe99e3c6), +W64LIT(0x6b93558305aa8935), +W64LIT(0x19607a48f2f4598a), +W64LIT(0x08bfa2b29bb1718c), +W64LIT(0x3f8e6e1097dccbc0), +W64LIT(0x3983ed9f812f68a5), +W64LIT(0xac9f278a664e4659), +W64LIT(0x82ce916098d7a59f), +W64LIT(0xc2fd4a3b7e94c7c1), +W64LIT(0x66ddcf03836bf014), +W64LIT(0xe1e2665106cc5d26), +W64LIT(0x74feac44e1ad73da), +W64LIT(0x8d28d936bf47bd9d), +W64LIT(0x62789e5a34c93252), +W64LIT(0x81322add93540e57), +W64LIT(0xcb1681e24ff77ca6), +W64LIT(0x2512afe56eab3982), +W64LIT(0xd18a4017b6808ee4), +W64LIT(0x705bfd1d560fb19c), +W64LIT(0x4b70c2547671b81a), +W64LIT(0x49d81082d720d939), +W64LIT(0xe0b60f3aac1e97cd), +W64LIT(0x4e81fa666b01b0b7), +W64LIT(0x951cca15e7612efc), +W64LIT(0x463e58d4f0b0c13b), +W64LIT(0x632cf7319e1bf8b9), +W64LIT(0x5ca2992109c73379), +W64LIT(0xf764544fd3a81cae), +W64LIT(0x6ac73ce8af7843de), +W64LIT(0x9f0bba71dd813e53), +W64LIT(0x85977b8424f6cc11), +W64LIT(0x5807c878be65f13f), +W64LIT(0x686fee3e0e2922fd), +W64LIT(0x78e45fafcdbec010), +W64LIT(0x6ccabf67b98be0bb), +W64LIT(0x11dfd8fa69452806), +W64LIT(0xcee7b9d05287740b), +W64LIT(0x50b86aca25d480b3), +W64LIT(0x5df6f04aa315f992), +W64LIT(0x5e0a4bf7a896525a), +W64LIT(0x03fcbbbd0b83abc8), +W64LIT(0x8f800be01e16dcbe), +W64LIT(0xd32292c117d1efc7), +W64LIT(0xe5473708b16e9f60), +W64LIT(0x224b4501d28a500c), +W64LIT(0xfb7ea7a4ffbbaf64), +W64LIT(0x3d26bcc6368daae3), +W64LIT(0x866bc0392f7567d9), +W64LIT(0x3731cca20c6dba4c), +W64LIT(0xb603e67f9f39b41b), +W64LIT(0xa1d1bd0ae08f3f78), +W64LIT(0xd935e2a52d31ff68), +W64LIT(0xaf639c376dcded91), +W64LIT(0x0154696baad2caeb), +W64LIT(0xecacfcd1800d2407), +W64LIT(0xf03dbeab6f897520), +W64LIT(0x02a8d2d6a1516123), +W64LIT(0xf498eff2d82bb766), +W64LIT(0x710f9476fcdd7b77), +W64LIT(0xf8821c19f43804ac), +W64LIT(0xf9d675725eeace47), +W64LIT(0x1a9cc1f5f977f242), +W64LIT(0x5210b81c8485e190), +W64LIT(0x6d9ed60c13592a50), +W64LIT(0xf2956c7dced81403), +W64LIT(0xbb4d7cff19f8cd3a), +W64LIT(0x4c2928b0ca50d194), +W64LIT(0x6e626db118da8198), +W64LIT(0xe4135e631bbc558b), +W64LIT(0x9da368a77cd05f70), +W64LIT(0xa574ec53572dfd3e), +W64LIT(0x09ebcbd93163bb67), +W64LIT(0x4a24ab3fdca372f1), +W64LIT(0x429b098d4712037d), +W64LIT(0x57e1802e99f5e93d), +W64LIT(0xef50476c8b8e8fcf), +W64LIT(0xa085d4614a5df593), +W64LIT(0x34cd771f07ee1184), +W64LIT(0xc6581b62c9360587), +W64LIT(0x2dad0d57f51a480e), +W64LIT(0x898d886f08e57fdb), +W64LIT(0xd6d3aaf30aa1e76a), +W64LIT(0x76567e9240fc12f9), +W64LIT(0xb4ab34a93e68d538), +W64LIT(0xb2a6b726289b765d), +W64LIT(0x8c7cb05d15957776), +W64LIT(0x554952f838a4881e), +W64LIT(0xd52f114e01224ca2), +W64LIT(0x60d04c8c95985371), +W64LIT(0x6789a66829b93aff), +W64LIT(0x2f05df81544b292d), +W64LIT(0x476a31bf5a620bd0), +W64LIT(0xf5cc869972f97d8d), +W64LIT(0x488c79e97df213d2), +W64LIT(0x44968a0251e1a018), +W64LIT(0x26ee14586528924a), +W64LIT(0xd0de297c1c52440f), +W64LIT(0xc5a4a0dfc2b5ae4f), +W64LIT(0x29085c0e42b88a48), +W64LIT(0x142ee0c8743520ab), +W64LIT(0x2af4e7b3493b2180), +W64LIT(0x9448a37e4db3e417), +/* box 1 */ +W64LIT(0xe2795ba105ba30ce), +W64LIT(0x65b5d634f5e0fbdd), +W64LIT(0x2d7d7f1464dd8c55), +W64LIT(0xeefbf778add1c20b), +W64LIT(0x1eb0fbd1f11968e7), +W64LIT(0xe6073f45ce30cd8d), +W64LIT(0x21ffd3cdccb67e90), +W64LIT(0xdf0941cfa750a262), +W64LIT(0xc61df5b1b75ef18a), +W64LIT(0xc5c7defa9dc337c6), +W64LIT(0x2581b729073c83d3), +W64LIT(0xa5e97513167173cf), +W64LIT(0xdd3673bd381526b9), +W64LIT(0xe8baa1eef91ebb93), +W64LIT(0x3b314cf8f625eb34), +W64LIT(0x579d4bc8d5fc5df8), +W64LIT(0xbb598ec2e7681b28), +W64LIT(0xc8a06b1a80708794), +W64LIT(0x1c8fc9a36e5cec3c), +W64LIT(0xf60a5a3f0807d374), +W64LIT(0x1ace9f353a9395a4), +W64LIT(0x7e9e50387aab2cee), +W64LIT(0xb5e41069d0466d36), +W64LIT(0x8cea6ee3b92602d9), +W64LIT(0xf952ddad8af1e7fd), +W64LIT(0xb19a748d1bcc9075), +W64LIT(0x2464ae10b2e4c144), +W64LIT(0xfcc9a070f4a35829), +W64LIT(0xfa88f6e6a06c21b1), +W64LIT(0x2c98662dd105cec2), +W64LIT(0x9065a740d77aeee5), +W64LIT(0xcb7a4051aaed41d8), +W64LIT(0x55a279ba4ab9d923), +W64LIT(0x27be855b98790708), +W64LIT(0xbabc97fb52b059bf), +W64LIT(0xa19711f7ddfb8e8c), +W64LIT(0x047e64e4cb8afd43), +W64LIT(0xc386886cc90c4e5e), +W64LIT(0xc422c7c3281b7551), +W64LIT(0xfb6defdf15b46326), +W64LIT(0x01e51939b5d84297), +W64LIT(0x5cbba8be9c809432), +W64LIT(0x6f762c7b09447080), +W64LIT(0xcee13d8cd4bffe0c), +W64LIT(0x54476083ff619bb4), +W64LIT(0x6e933542bc9c3217), +W64LIT(0x4af79b520e78f353), +W64LIT(0x98996f7db49be163), +W64LIT(0xa07208ce6823cc1b), +W64LIT(0x2b3c29823012f5cd), +W64LIT(0x93bf8c0bfde728a9), +W64LIT(0x2225f886e62bb8dc), +W64LIT(0x7f7b4901cf736e79), +W64LIT(0x0000000000000000), +W64LIT(0x023f32729f4584db), +W64LIT(0xd5cabb805bf4293f), +W64LIT(0x07a44fafe1173b0f), +W64LIT(0xe95fb8d74cc6f904), +W64LIT(0x7b052de504f9933a), +W64LIT(0x6aed51a67716cf54), +W64LIT(0x68d263d4e8534b8f), +W64LIT(0xa96bd9cabe1a810a), +W64LIT(0x1d6ad09adb84aeab), +W64LIT(0x0d67b5e01db3b052), +W64LIT(0x52063615abaee22c), +W64LIT(0x8f3045a893bbc495), +W64LIT(0xd8ad0e604647996d), +W64LIT(0xaf2a8f5cead5f892), +W64LIT(0x3017af8ebf5922fe), +W64LIT(0x4034611df2dc780e), +W64LIT(0x721cfce1d2c0de2b), +W64LIT(0x28e602c91a8f3381), +W64LIT(0xe1a370ea2f27f682), +W64LIT(0x29031bf0af577116), +W64LIT(0x1914b47e100e53e8), +W64LIT(0x567852f160241f6f), +W64LIT(0x793a1f979bbc17e1), +W64LIT(0xef1eee411809809c), +W64LIT(0x6211999b14f7c0d2), +W64LIT(0x059b7ddd7e52bfd4), +W64LIT(0x43ee4a56d841be42), +W64LIT(0xf1ae1590e910e87b), +W64LIT(0x33cd84c595c4e4b2), +W64LIT(0x4b12826bbba0b1c4), +W64LIT(0xeb608aa5d3837ddf), +W64LIT(0x201acaf4796e3c07), +W64LIT(0xbf27ea262ce2e66b), +W64LIT(0x58c5cc5a570a6971), +W64LIT(0x37b3e0215e4e19f1), +W64LIT(0xab54ebb8215f05d1), +W64LIT(0x8ed55c9126638602), +W64LIT(0x9aa65d0f2bde65b8), +W64LIT(0xd7f589f2c4b1ade4), +W64LIT(0x5039046734eb66f7), +W64LIT(0x6cac073023d9b6cc), +W64LIT(0x51dc1d5e81332460), +W64LIT(0x17a92ad5272025f6), +W64LIT(0x47902eb213cb4301), +W64LIT(0x1b2b860c8f4bd733), +W64LIT(0x4f6ce68f702a4c87), +W64LIT(0xcf0424b56167bc9b), +W64LIT(0x997c76440143a3f4), +W64LIT(0x7ae034dcb121d1ad), +W64LIT(0x100d657ac6371ef9), +W64LIT(0x0ac3fa4ffca48b5d), +W64LIT(0xdeec58f61288e0f5), +W64LIT(0x265b9c622da1459f), +W64LIT(0xdcd36a848dcd642e), +W64LIT(0xe4380d3751754956), +W64LIT(0x13d74e31ecaad8b5), +W64LIT(0xfd2cb949417b1abe), +W64LIT(0x9624f1d683b5977d), +W64LIT(0x4675378ba6130196), +W64LIT(0x0b26e376497cc9ca), +W64LIT(0x41d1782447043a99), +W64LIT(0xe39c4298b0627259), +W64LIT(0xcd3b16c7fe223840), +W64LIT(0x7787813cac9261ff), +W64LIT(0x492db01924e5351f), +W64LIT(0x5afafe28c84fedaa), +W64LIT(0x8b4e214c583139d6), +W64LIT(0xccde0ffe4bfa7ad7), +W64LIT(0x76629805194a2368), +W64LIT(0x7ca1624ae5eea835), +W64LIT(0x61cbb2d03e6a069e), +W64LIT(0x48c8a920913d7788), +W64LIT(0x8068c23a114df01c), +W64LIT(0xd38bed160f3b50a7), +W64LIT(0x32289dfc201ca625), +W64LIT(0xc1b9ba1e5649ca85), +W64LIT(0xed21dc33874c0447), +W64LIT(0xa3a8238542be0a57), +W64LIT(0x5b1fe7117d97af3d), +W64LIT(0x3d701a6ea2ea92ac), +W64LIT(0x73f9e5d867189cbc), +W64LIT(0x9ed839ebe05498fb), +W64LIT(0x5920d563e2d22be6), +W64LIT(0xca9f59681f35034f), +W64LIT(0x11e87c4373ef5c6e), +W64LIT(0x97c1e8ef366dd5ea), +W64LIT(0xacf0a417c0483ede), +W64LIT(0xd26ef42fbae31230), +W64LIT(0xbcfdc16d067f2027), +W64LIT(0xbec2f31f993aa4fc), +W64LIT(0x45af1cc08c8ec7da), +W64LIT(0x31f2b6b70a816069), +W64LIT(0xd9481759f39fdbfa), +W64LIT(0xe5dd140ee4ad0bc1), +W64LIT(0xa6335e583cecb583), +W64LIT(0x38eb67b3dcb82d78), +W64LIT(0xf5d07174229a1538), +W64LIT(0x5f6183f5b61d527e), +W64LIT(0x0f58879282f63489), +W64LIT(0x164c33ec92f86761), +W64LIT(0x444a05f93956854d), +W64LIT(0x818ddb03a495b28b), +W64LIT(0x4d53d4fdef6fc85c), +W64LIT(0x8d0f77da0cfe404e), +W64LIT(0x8416a6dedac70d5f), +W64LIT(0x666ffd7fdf7d3d91), +W64LIT(0xb63e3b22fadbab7a), +W64LIT(0xf2743edbc38d2e37), +W64LIT(0xa40c6c2aa3a93158), +W64LIT(0x9f3d20d2558cda6c), +W64LIT(0xfef692026be6dcf2), +W64LIT(0x2ea7545f4e404a19), +W64LIT(0xb2405fc631515639), +W64LIT(0x23c0e1bf53f3fa4b), +W64LIT(0x83b2e9713bd03650), +W64LIT(0x0641569654cf7998), +W64LIT(0xb883a589cdf5dd64), +W64LIT(0x3ad455c143fda9a3), +W64LIT(0x925a9532483f6a3e), +W64LIT(0xaab1f28194874746), +W64LIT(0xf435684d974257af), +W64LIT(0xd1b4df64907ed47c), +W64LIT(0x390e7e8a69606fef), +W64LIT(0xd051c65d25a696eb), +W64LIT(0xb4010950659e2fa1), +W64LIT(0x0c82acd9a86bf2c5), +W64LIT(0x88940a0772acff9a), +W64LIT(0xf39127e276556ca0), +W64LIT(0xaecf96655f0dba05), +W64LIT(0x03da2b4b2a9dc64c), +W64LIT(0x3f4f281c3daf1677), +W64LIT(0x3469cb6a74d3dfbd), +W64LIT(0xf04b0ca95cc8aaec), +W64LIT(0x1f55e2e844c12a70), +W64LIT(0x4cb6cdc45ab78acb), +W64LIT(0xc05ca327e3918812), +W64LIT(0x95feda9da9285131), +W64LIT(0xb966bcb0782d9ff3), +W64LIT(0xa7d647618934f714), +W64LIT(0xd61090cb7169ef73), +W64LIT(0x71c6d7aaf85d1867), +W64LIT(0xecc4c50a329446d0), +W64LIT(0x6450cf0d4038b94a), +W64LIT(0x420b536f6d99fcd5), +W64LIT(0x75b8b34e33d7e524), +W64LIT(0xc26391557cd40cc9), +W64LIT(0xda923c12d9021db6), +W64LIT(0x4e89ffb6c5f20e10), +W64LIT(0x0919d104d6394d11), +W64LIT(0x8aab3875ede97b41), +W64LIT(0xa88ec0f30bc2c39d), +W64LIT(0xb7db221b4f03e9ed), +W64LIT(0xc7f8ec880286b31d), +W64LIT(0x2f424d66fb98088e), +W64LIT(0xe04669d39affb415), +W64LIT(0x3eaa3125887754e0), +W64LIT(0x5e849acc03c510e9), +W64LIT(0x8257f0488e0874c7), +W64LIT(0xbd18d854b3a762b0), +W64LIT(0xb3a546ff848914ae), +W64LIT(0x9ce70b997f111c20), +W64LIT(0x3c9503571732d03b), +W64LIT(0xe7e2267c7be88f1a), +W64LIT(0x63f480a2a12f8245), +W64LIT(0x602eabe98bb24409), +W64LIT(0x941bc3a41cf013a6), +W64LIT(0x678ae4466aa57f06), +W64LIT(0x1232570859729a22), +W64LIT(0x6d491e099601f45b), +W64LIT(0x5d5eb1872958d6a5), +W64LIT(0x1473019e0dbde3ba), +W64LIT(0xa24d3abcf76648c0), +W64LIT(0x85f3bfe76f1f4fc8), +W64LIT(0x08fcc83d63e10f86), +W64LIT(0x745daa77860fa7b3), +W64LIT(0x9180be7962a2ac72), +W64LIT(0x87cc8d95f05acb13), +W64LIT(0x78df06ae2e645576), +W64LIT(0x18f1ad47a5d6117f), +W64LIT(0x358cd253c10b9d2a), +W64LIT(0x0ebd9eab372e761e), +W64LIT(0xf7ef4306bddf91e3), +W64LIT(0x7023ce934d855af0), +W64LIT(0xd42fa2b9ee2c6ba8), +W64LIT(0x3656f918eb965b66), +W64LIT(0x9d0212a0cac95eb7), +W64LIT(0x2ad930bb85cab75a), +W64LIT(0x862994ac45828984), +W64LIT(0x7d447b735036eaa2), +W64LIT(0xb07f6db4ae14d2e2), +W64LIT(0x6b08489fc2ce8dc3), +W64LIT(0x9b4344369e06272f), +W64LIT(0xad15bd2e75907c49), +W64LIT(0xdb77252b6cda5f21), +W64LIT(0xea85939c665b3f48), +W64LIT(0xc945722335a8c503), +W64LIT(0x159618a7b865a12d), +W64LIT(0x69377aed5d8b0918), +W64LIT(0x8971133ec774bd0d), +W64LIT(0x53e32f2c1e76a0bb), +W64LIT(0xf8b7c4943f29a56a), +W64LIT(0xff138b3bde3e9e65), +/* box 2 */ +W64LIT(0x7c6a2eb5fdabecc6), +W64LIT(0x401cda0a752bbea0), +W64LIT(0x1925217156dc57c4), +W64LIT(0x56dec6d301d70787), +W64LIT(0x41c751ff73c6ac58), +W64LIT(0xc9067697a92cb5f9), +W64LIT(0x3391c917aaa0bc85), +W64LIT(0xae0a9a4c0e742afe), +W64LIT(0xaa8ca972162a62f4), +W64LIT(0x5aa193912935df99), +W64LIT(0x86fd9135fe27e5ba), +W64LIT(0xffca074b1d3f538e), +W64LIT(0x0e3cb65d24cdfc1b), +W64LIT(0x4384b2e07fe9885d), +W64LIT(0xc73ac0ca8de149e2), +W64LIT(0x48e5bc7645972eb4), +W64LIT(0xbe0d56b46ef9ffd6), +W64LIT(0x200e6d05c0ef5f50), +W64LIT(0xe1f17dee597f7abd), +W64LIT(0x0243e31f0c2f2405), +W64LIT(0xf4ab09dd2741f567), +W64LIT(0xe4acc52547cc204f), +W64LIT(0x348f92c3b83cc272), +W64LIT(0x53837e181f645d75), +W64LIT(0xd8da319acf4c7229), +W64LIT(0x81e3cae1ecbb9b4d), +W64LIT(0xd6e687c7eb818e32), +W64LIT(0x3dad7f4a8e6d409e), +W64LIT(0x28f70b79f053cf44), +W64LIT(0x493e3783437a3c4c), +W64LIT(0xb27203f6461b27c8), +W64LIT(0xd02357e6fff0e23d), +W64LIT(0xe8d390676f2ef851), +W64LIT(0x26cbbd24d49e335f), +W64LIT(0xee1640467b5f945e), +W64LIT(0x4aa65f6949b80ab1), +W64LIT(0xb56c58225487593f), +W64LIT(0x4ffbe7a2570b5043), +W64LIT(0x0aba85633c93b411), +W64LIT(0x78ec1d8be5f5a4cc), +W64LIT(0x501b16f215a66b88), +W64LIT(0x271036d1d27321a7), +W64LIT(0x7ff2465ff769da3b), +W64LIT(0x35541936bed1d08a), +W64LIT(0xb8c886957a8893d9), +W64LIT(0x2fe950ade2cfb1b3), +W64LIT(0xf90fd76a094e3f81), +W64LIT(0x2daab3b2eee095b6), +W64LIT(0x1abd499b5c1e6139), +W64LIT(0x0c7f554228e2d81e), +W64LIT(0x425f391579049aa5), +W64LIT(0xc3bcf3f495bf01e8), +W64LIT(0xb4b7d3d7526a4bc7), +W64LIT(0x0000000000000000), +W64LIT(0xa0362c112ab9d6e5), +W64LIT(0x91e406198c364e65), +W64LIT(0x454162c16b98e452), +W64LIT(0x139fa4126a4fe3d5), +W64LIT(0x01db8bf506ed12f8), +W64LIT(0x9a85088fb648e88c), +W64LIT(0x3ab3249e9cf13e69), +W64LIT(0xd57eef2de143b8cf), +W64LIT(0xb1ea6b1c4cd91135), +W64LIT(0x7aaffe94e9da80c9), +W64LIT(0xad92f2a604b61c03), +W64LIT(0xa3ae44fb207be018), +W64LIT(0xeb4bf88d65ecceac), +W64LIT(0xc0249b1e9f7d3715), +W64LIT(0xa8cf4a6d1a0546f1), +W64LIT(0xc6e14b3f8b0c5b1a), +W64LIT(0xce182d43bbb0cb0e), +W64LIT(0xfc526fa117fd6573), +W64LIT(0x8c471456c2b451ab), +W64LIT(0xac497953025b0efb), +W64LIT(0x0486333e185e480a), +W64LIT(0x18feaa845031453c), +W64LIT(0xa1eda7e42c54c41d), +W64LIT(0x06c5d02114716c0f), +W64LIT(0x055db8cb1eb35af2), +W64LIT(0xe5774ed0412132b7), +W64LIT(0x36cc71dcb413e677), +W64LIT(0x470281de67b7c057), +W64LIT(0x58e2708e251afb9c), +W64LIT(0xa914c1981ce85409), +W64LIT(0xb3a9880340f63530), +W64LIT(0x638adfe5bf06d70d), +W64LIT(0x0b610e963a7ea6e9), +W64LIT(0x927c6ef386f47898), +W64LIT(0xed8e28ac719da2a3), +W64LIT(0x7548c33ccbfa6e2a), +W64LIT(0xf3b5520935dd8b90), +W64LIT(0x8d9c9fa3c4594353), +W64LIT(0x31d22a08a68f9880), +W64LIT(0x0da4deb72e0fcae6), +W64LIT(0x8fdf7cbcc8766756), +W64LIT(0x5dbfc8453ba9a16e), +W64LIT(0x8e04f749ce9b75ae), +W64LIT(0x83a029fee094bf48), +W64LIT(0xa4b01f2f32e79eef), +W64LIT(0x1c7899ba486f0d36), +W64LIT(0x654f0fc4ab77bb02), +W64LIT(0x7db1a540fb46fe3e), +W64LIT(0x51c09d07134b7970), +W64LIT(0xcb459588a50391fc), +W64LIT(0x3fee9c558242649b), +W64LIT(0xfe118cbe1bd24176), +W64LIT(0x76d0abd6c13858d7), +W64LIT(0x5e27a0af316b9793), +W64LIT(0x69305a868395631c), +W64LIT(0x3b68af6b9a1c2c91), +W64LIT(0x6db669b89bcb2b16), +W64LIT(0xa72877c53825a812), +W64LIT(0xd3bb3f0cf532d4c0), +W64LIT(0x6ff58aa797e40f13), +W64LIT(0x96fa5dcd9eaa3092), +W64LIT(0x2c713847e80d874e), +W64LIT(0xc57923d581ce6de7), +W64LIT(0x2b6f6393fa91f9b9), +W64LIT(0x0922ed89365182ec), +W64LIT(0x324a42e2ac4dae7d), +W64LIT(0x16c21cd974fcb927), +W64LIT(0x956235279468066f), +W64LIT(0x7b747561ef379231), +W64LIT(0x449ae9346d75f6aa), +W64LIT(0xf570822821ace79f), +W64LIT(0x5939fb7b23f7e964), +W64LIT(0x7937967ee318b634), +W64LIT(0x84be722af208c1bf), +W64LIT(0x08f9667c30bc9014), +W64LIT(0xefcdcbb37db286a6), +W64LIT(0xa6f3fc303ec8baea), +W64LIT(0xea9073786301dc54), +W64LIT(0x62515410b9ebc5f5), +W64LIT(0xd260b4f9f3dfc638), +W64LIT(0x9e033bb1ae16a086), +W64LIT(0x38f0c78190de1a6c), +W64LIT(0xc267780193521310), +W64LIT(0x80384114ea5689b5), +W64LIT(0x9b5e837ab0a5fa74), +W64LIT(0xf73361372d83c39a), +W64LIT(0x3009a1fda0628a78), +W64LIT(0xd4a564d8e7aeaa37), +W64LIT(0xfb4c347505611b84), +W64LIT(0x5b7a18642fd8cd61), +W64LIT(0x239605efca2d69ad), +W64LIT(0xf8d45c9f0fa32d79), +W64LIT(0xbb50ee7f704aa524), +W64LIT(0x392b4c7496330894), +W64LIT(0x0fe73da82220eee3), +W64LIT(0x3717fa29b2fef48f), +W64LIT(0xf26ed9fc33309968), +W64LIT(0xd73d0c32ed6c9cca), +W64LIT(0xda99d285c363562c), +W64LIT(0xde1fe1bbdb3d1e26), +W64LIT(0x738d131ddf8b0225), +W64LIT(0x292c808cf6beddbc), +W64LIT(0xbc4eb5ab62d6dbd3), +W64LIT(0x039868ea0ac236fd), +W64LIT(0xcc5bce5cb79fef0b), +W64LIT(0xb031e0e94a3403cd), +W64LIT(0xc4a2a82087237f1f), +W64LIT(0xb72fbb3d58a87d3a), +W64LIT(0xafd111b908993806), +W64LIT(0x68ebd173857871e4), +W64LIT(0x9d9b535ba4d4967b), +W64LIT(0xe9081b9269c3eaa9), +W64LIT(0x71cef002d3a42620), +W64LIT(0x93a7e50680196a60), +W64LIT(0x891aac9ddc070b59), +W64LIT(0x155a74337e3e8fda), +W64LIT(0x4e206c5751e642bb), +W64LIT(0x9721d6389847226a), +W64LIT(0x12442fe76ca2f12d), +W64LIT(0x2553d5cede5c05a2), +W64LIT(0xa275cf0e2696f2e0), +W64LIT(0x24885e3bd8b1175a), +W64LIT(0x670cecdba7589f07), +W64LIT(0x749348c9cd177cd2), +W64LIT(0x64948431ad9aa9fa), +W64LIT(0x2ab4e866fc7ceb41), +W64LIT(0xe6ef263a4be3044a), +W64LIT(0xe734adcf4d0e16b2), +W64LIT(0x903f8dec8adb5c9d), +W64LIT(0xf02d3ae33f1fbd6d), +W64LIT(0x725698e8d96610dd), +W64LIT(0x1da3124f4e821fce), +W64LIT(0x1719972c7211abdf), +W64LIT(0x11dc470d6660c7d0), +W64LIT(0xec55a3597770b05b), +W64LIT(0xbfd6dd416814ed2e), +W64LIT(0x57054d26073a157f), +W64LIT(0x1e3b7aa544402933), +W64LIT(0x5ffc2b5a3786856b), +W64LIT(0x61c93cfab329f308), +W64LIT(0x3e3517a084af7663), +W64LIT(0xf6e8eac22b6ed162), +W64LIT(0x1007ccf8608dd528), +W64LIT(0x66d7672ea1b58dff), +W64LIT(0x8b594f82d0282f5c), +W64LIT(0x1fe0f15042ad3bcb), +W64LIT(0x4b7dd49c4f551849), +W64LIT(0x4c638f485dc966be), +W64LIT(0xcfc3a6b6bd5dd9f6), +W64LIT(0x46d90a2b615ad2af), +W64LIT(0x8565f9dff4e5d347), +W64LIT(0x94b9bed292851497), +W64LIT(0xfa97bf80038c097c), +W64LIT(0xb9130d607c658121), +W64LIT(0xdc5c02a4d7123a23), +W64LIT(0x224d8e1accc07b55), +W64LIT(0x87261ac0f8caf742), +W64LIT(0xd901ba6fc9a160d1), +W64LIT(0xab57228710c7700c), +W64LIT(0x21d5e6f0c6024da8), +W64LIT(0x98c6eb90ba67cc89), +W64LIT(0x827ba20be679adb0), +W64LIT(0x991d6065bc8ade71), +W64LIT(0x5546ae390b15317a), +W64LIT(0xa56b94da340a8c17), +W64LIT(0x071e5bd4129c7ef7), +W64LIT(0xe02af61b5f926845), +W64LIT(0x6b73b9998fba4719), +W64LIT(0xdfc46a4eddd00cde), +W64LIT(0x770b2023c7d54a2f), +W64LIT(0x7e29cdaaf184c8c3), +W64LIT(0xba8b658a76a7b7dc), +W64LIT(0x9c40d8aea2398483), +W64LIT(0x9fd8b044a8fbb27e), +W64LIT(0xdb425970c58e44d4), +W64LIT(0xe269150453bd4c40), +W64LIT(0x3c76f4bf88805266), +W64LIT(0xf1f6b11639f2af95), +W64LIT(0x549d25cc0df82382), +W64LIT(0x4db804bd5b247446), +W64LIT(0x8a82c477d6c53da4), +W64LIT(0x5258f5ed19894f8d), +W64LIT(0x6e2e015291091deb), +W64LIT(0xc1ff10eb999025ed), +W64LIT(0xbd953e5e643bc92b), +W64LIT(0xc8ddfd62afc1a701), +W64LIT(0x5c6443b03d44b396), +W64LIT(0x6c6de24d9d2639ee), +W64LIT(0x1481ffc678d39d22), +W64LIT(0xd1f8dc13f91df0c5), +W64LIT(0xca9e1e7da3ee8304), +W64LIT(0xdd878951d1ff28db), +W64LIT(0x6012b70fb5c4e1f0), +W64LIT(0x1b66c26e5af373c1), +W64LIT(0xe3b29ef155505eb8), +W64LIT(0x70157bf7d54934d8), +W64LIT(0x2e32db58e422a34b), +W64LIT(0x6aa8326c895755e1), +W64LIT(0xb6f430c85e456fc2), +W64LIT(0xfd89e4541110778b), +W64LIT(0x88c12768daea19a1), +W64LIT(0xcd8045a9b172fdf3), +/* box 3 */ +W64LIT(0x99183e616655b742), +W64LIT(0xb2872032a50d6860), +W64LIT(0x0946f63b060528ef), +W64LIT(0x36612b9a141ef07d), +W64LIT(0x0634da84dd49579b), +W64LIT(0xfc9c9e9b486c8a57), +W64LIT(0xa63fe3c0744e6fd0), +W64LIT(0xf1515758d8b46bf9), +W64LIT(0x3e82559fcd5197ff), +W64LIT(0x92e12d262bc40177), +W64LIT(0xc3bb433a5a7752c5), +W64LIT(0x21c3852a5183267a), +W64LIT(0x39130725cf528f09), +W64LIT(0x9ba7db1d2dc12998), +W64LIT(0xc58f99be873e055e), +W64LIT(0xd9d424498f32656c), +W64LIT(0x27f75fae8cca71e1), +W64LIT(0x59b91019a8fc3430), +W64LIT(0xce768af9caafb36b), +W64LIT(0x9d930199f0887e03), +W64LIT(0x63b07a7ef3706a8e), +W64LIT(0xb5167288a70e7096), +W64LIT(0x40cc1a28e967d22e), +W64LIT(0x4d01d3eb79bf3380), +W64LIT(0x9e896cdb6456afb4), +W64LIT(0x2548bad2c75eef3b), +W64LIT(0xa79a6bfeab0420bd), +W64LIT(0x9f2ce4e5bb1ce0d9), +W64LIT(0x32ea146282c3393c), +W64LIT(0x6d67defff7765a97), +W64LIT(0x83775912b31080eb), +W64LIT(0xf5da68a04e69a2b8), +W64LIT(0x1196743498d4819c), +W64LIT(0x0bf913474d91b635), +W64LIT(0x43d6776a7db90399), +W64LIT(0x444725d07fba1b6f), +W64LIT(0x6584a0fa2e393d15), +W64LIT(0x3f27dda1121bd892), +W64LIT(0xf6c005e2dab7730f), +W64LIT(0x56cb3ca673b04b44), +W64LIT(0x642128c4f1737278), +W64LIT(0xbf4ae9f135d589ce), +W64LIT(0xb038c54eee99f6ba), +W64LIT(0xf47fe09e9123edd5), +W64LIT(0x75b75cf069a7f3e4), +W64LIT(0xd419ed8a1fea84c2), +W64LIT(0x73838674b4eea47f), +W64LIT(0x498aec13ef62fac1), +W64LIT(0x20660d148ec96917), +W64LIT(0xa48006bc3fdaf10a), +W64LIT(0x2f1421ab55851663), +W64LIT(0x0a5c9b7992dbf958), +W64LIT(0xd1375a4c567d02ee), +W64LIT(0x0000000000000000), +W64LIT(0xc842507d17e6e4f0), +W64LIT(0xf3eeb2249320f523), +W64LIT(0xc9e7d843c8acab9d), +W64LIT(0xff86f3d9dcb25be0), +W64LIT(0xb4b3fab678443ffb), +W64LIT(0xb19d4d7031d3b9d7), +W64LIT(0x79df1d0d26355d27), +W64LIT(0x8eba90d123c86145), +W64LIT(0xaa57a23d3bdcc113), +W64LIT(0xcb583d3f83383547), +W64LIT(0xd871ac7750782a01), +W64LIT(0xe162ab529f2aa508), +W64LIT(0x38b68f1b1018c064), +W64LIT(0x237c60561a17b8a0), +W64LIT(0xa31154063dd9e9fc), +W64LIT(0x713c6308ff7a3aa5), +W64LIT(0x1a6f6773d54537a9), +W64LIT(0x08e37e05d94f6782), +W64LIT(0x357b46d880c021ca), +W64LIT(0x6cc256c1283c15fa), +W64LIT(0xcfd302c715e5fc06), +W64LIT(0xbdf50c8d7e411714), +W64LIT(0x7cf1aacb6fa2db0b), +W64LIT(0x5240035ee56d8205), +W64LIT(0x7b60f8716da1c3fd), +W64LIT(0x01a5883edf4a4f6d), +W64LIT(0xdd5f1bb119efac2d), +W64LIT(0x5474d9da3824d59e), +W64LIT(0x0f722cbfdb4c7f74), +W64LIT(0x17a2aeb0459dd607), +W64LIT(0x37c4a3a4cb54bf10), +W64LIT(0xc21ecb04853d1da8), +W64LIT(0x4273ff54a2f34cf4), +W64LIT(0xdace490b1becb4db), +W64LIT(0x6af68c45f5754261), +W64LIT(0x46f8c0ac342e85b5), +W64LIT(0x854383966e59d770), +W64LIT(0x81c8bc6ef8841e31), +W64LIT(0x3bace25984c611d3), +W64LIT(0x1033fc0a479ecef1), +W64LIT(0x1c5bbdf7080c6032), +W64LIT(0x7412d4ceb6edbc89), +W64LIT(0xa8e8474170485fc9), +W64LIT(0xb8dbbb4b37d69138), +W64LIT(0x079152ba020318f6), +W64LIT(0x72260e4a6ba4eb12), +W64LIT(0x905ec85a60509fad), +W64LIT(0x2dabc4d71e1188b9), +W64LIT(0xd092d27289374d83), +W64LIT(0x610f9f02b8e4f454), +W64LIT(0x02bfe57c4b949eda), +W64LIT(0x95707f9c29c71981), +W64LIT(0x6fd83b83bce2c44d), +W64LIT(0x5d322fe13e21fd71), +W64LIT(0x34decee65f8a6ea7), +W64LIT(0xcd6ce7bb5e7162dc), +W64LIT(0xfb0dcc214a6f92a1), +W64LIT(0x2eb1a9958acf590e), +W64LIT(0xdcfa938fc6a5e340), +W64LIT(0x669ecdb8bae7eca2), +W64LIT(0x151d4bcc0e0948dd), +W64LIT(0xfd3916a59726c53a), +W64LIT(0x581c982777b67b5d), +W64LIT(0x1bcaef4d0a0f78c4), +W64LIT(0xdfe0fecd527b32f7), +W64LIT(0x128c19760c0a502b), +W64LIT(0x84e60ba8b113981d), +W64LIT(0x3c3db0e386c50925), +W64LIT(0x7febc789fb7c0abc), +W64LIT(0x7d5422f5b0e89466), +W64LIT(0xd70380c88b345575), +W64LIT(0xbbc1d609a308408f), +W64LIT(0xe278c6100bf474bf), +W64LIT(0x5e2842a3aaff2cc6), +W64LIT(0x6b53047b2a3f0d0c), +W64LIT(0xf7658ddc05fd3c62), +W64LIT(0x9a025323f28b66f5), +W64LIT(0x8c0575ad685cff9f), +W64LIT(0x76ad31b2fd792253), +W64LIT(0x68496939bee1dcbb), +W64LIT(0x7e4e4fb7243645d1), +W64LIT(0xe44c1c94d6bd2324), +W64LIT(0xbeef61cfea9fc6a3), +W64LIT(0x91fb4064bf1ad0c0), +W64LIT(0x052eb7c64997862c), +W64LIT(0x4a9081517bbc2b76), +W64LIT(0x8f1f18effc822e28), +W64LIT(0x3a096a675b8c5ebe), +W64LIT(0xee1087ed4466da7c), +W64LIT(0x2652d79053803e8c), +W64LIT(0x7099eb36203075c8), +W64LIT(0xc7307cc2ccaa9b84), +W64LIT(0x5c97a7dfe16bb21c), +W64LIT(0x50ffe622aef91cdf), +W64LIT(0x8da0fd93b716b0f2), +W64LIT(0x69ece10761ab93d6), +W64LIT(0x31f07920161de88b), +W64LIT(0x13299148d3401f46), +W64LIT(0x031a6d4294ded1b7), +W64LIT(0xccc96f85813b2db1), +W64LIT(0x14b8c3f2d14307b0), +W64LIT(0x8659eed4fa8706c7), +W64LIT(0xba645e377c420fe2), +W64LIT(0x2920fb2f88cc41f8), +W64LIT(0x87fc66ea25cd49aa), +W64LIT(0x1ee4588b4398fee8), +W64LIT(0xecaf62910ff244a6), +W64LIT(0xf817a163deb14316), +W64LIT(0x45e2adeea0f05402), +W64LIT(0x806d345027ce515c), +W64LIT(0x576eb498acfa0429), +W64LIT(0xa5258e82e090be67), +W64LIT(0x892bc26b21cb79b3), +W64LIT(0x6e7db3bd63a88b20), +W64LIT(0x4e1bbea9ed61e237), +W64LIT(0xadc6f08739dfd9e5), +W64LIT(0x8b9427176a5fe769), +W64LIT(0xa1aeb17a764d7726), +W64LIT(0x4b35096fa4f6641b), +W64LIT(0x22d9e868c55df7cd), +W64LIT(0x55d151e4e76e9af3), +W64LIT(0x966a12debd19c836), +W64LIT(0x0dcdc9c390d8e1ae), +W64LIT(0xf24b3a1a4c6aba4e), +W64LIT(0x24ed32ec1814a056), +W64LIT(0xaf7915fb724b473f), +W64LIT(0x2885731157860e95), +W64LIT(0x9c3689a72fc2316e), +W64LIT(0x475d4892eb64cad8), +W64LIT(0xac6378b9e6959688), +W64LIT(0xa00b3944a907384b), +W64LIT(0xc695f4fc13e0d4e9), +W64LIT(0x3055f11ec957a7e6), +W64LIT(0x6215f2402c3a25e3), +W64LIT(0xde4576f38d317d9a), +W64LIT(0x9344a518f48e4e1a), +W64LIT(0x82d2d12c6c5acf86), +W64LIT(0xefb50fd39b2c9511), +W64LIT(0xe981d5574665c28a), +W64LIT(0x5f8dca9d75b563ab), +W64LIT(0xb60c1fca33d0a121), +W64LIT(0xfe237be703f8148d), +W64LIT(0xd6a608f6547e1a18), +W64LIT(0xb97e3375e89cde55), +W64LIT(0xd388bf301de99c34), +W64LIT(0x5b06f565e368aaea), +W64LIT(0xf0f4df6607fe2494), +W64LIT(0x1607268e9ad7996a), +W64LIT(0xaedc9dc5ad010852), +W64LIT(0xe0c7236c4060ea65), +W64LIT(0xea9bb815d2bb133d), +W64LIT(0x888e4a55fe8136de), +W64LIT(0x5aa37d5b3c22e587), +W64LIT(0xc104a64611e3cc1f), +W64LIT(0x515a6e1c71b353b2), +W64LIT(0xc42a118058744a33), +W64LIT(0x7708b98c22336d3e), +W64LIT(0x2a3a966d1c12904f), +W64LIT(0x8a31af29b515a804), +W64LIT(0xed0aeaafd0b80bcb), +W64LIT(0x2c0e4ce9c15bc7d4), +W64LIT(0x0c6841fd4f92aec3), +W64LIT(0x98bdb65fb91ff82f), +W64LIT(0x1f41d0b59cd2b185), +W64LIT(0xb322a80c7a47270d), +W64LIT(0xe6f3f9e89d29bdfe), +W64LIT(0x7ac5704fb2eb8c90), +W64LIT(0xa94dcf7faf0210a4), +W64LIT(0x787a9533f97f124a), +W64LIT(0xdb6bc135c4a6fbb6), +W64LIT(0x048b3ff896ddc941), +W64LIT(0xe8245d69992f8de7), +W64LIT(0xe3dd4e2ed4be3bd2), +W64LIT(0xcafdb5015c727a2a), +W64LIT(0xb7a997f4ec9aee4c), +W64LIT(0xe75671d64263f293), +W64LIT(0x2b9f1e53c358df22), +W64LIT(0x18d0820f9ed1a973), +W64LIT(0xabf22a03e4968e7e), +W64LIT(0xa2b4dc38e293a691), +W64LIT(0x673b458665ada3cf), +W64LIT(0xf9b2295d01fb0c7b), +W64LIT(0xd22d370ec2a3d359), +W64LIT(0x97cf9ae06253875b), +W64LIT(0x0ed7a48104063019), +W64LIT(0x482f642d3028b5ac), +W64LIT(0xc0a12e78cea98372), +W64LIT(0x4fbe3697322bad5a), +W64LIT(0x19750a31419be61e), +W64LIT(0x41699216362d9d43), +W64LIT(0xd5bc65b4c0a0cbaf), +W64LIT(0xe5e994aa09f76c49), +W64LIT(0xeb3e302b0df15c50), +W64LIT(0x94d5f7a2f68d56ec), +W64LIT(0x53e58b603a27cd68), +W64LIT(0x3d9838dd598f4648), +W64LIT(0x60aa173c67aebb39), +W64LIT(0x1dfe35c9d7462f5f), +W64LIT(0x4ca45bd5a6f57ced), +W64LIT(0xbc5084b3a10b5879), +W64LIT(0xfaa8441f9525ddcc), +W64LIT(0x334f9c5c5d897651), +/* box 4 */ +W64LIT(0xda1687a883adf27e), +W64LIT(0xe35c9378578d9f22), +W64LIT(0x303ca4531637fa40), +W64LIT(0xa088321f74b20375), +W64LIT(0xc9863f3a9acb95e9), +W64LIT(0x5fcf47c57d0b0ed4), +W64LIT(0x4aa211e4e1280b4b), +W64LIT(0xe1a4c9ba871d1289), +W64LIT(0x4926664759f03a4f), +W64LIT(0xadfb36ede3707bca), +W64LIT(0xcf7bd1891f8ef7e1), +W64LIT(0x9735559e8f882792), +W64LIT(0x5932a976f84e6cdc), +W64LIT(0x9dc792bef547818a), +W64LIT(0x06fdeeb385456208), +W64LIT(0x46ad38771ea2cf5b), +W64LIT(0x5eb36aa41543b27b), +W64LIT(0x8b2eb33cd1bcb511), +W64LIT(0x71105ff6e598ebbc), +W64LIT(0x5441ad846f8c1463), +W64LIT(0x4c5fff57646d6943), +W64LIT(0xf3485c49f633c9b1), +W64LIT(0x9cbbbfdf9d0f3d25), +W64LIT(0x22d031a067192178), +W64LIT(0xca0248992213a4ed), +W64LIT(0x19627fb263a9c18f), +W64LIT(0x9330e1efda5dc831), +W64LIT(0x1390b89219666797), +W64LIT(0x2edf18339893e568), +W64LIT(0x6c779435d3e4c590), +W64LIT(0x53c06e568281cac4), +W64LIT(0x6ff3e3966b3cf494), +W64LIT(0xfe3b58bb61f1b10e), +W64LIT(0x77edb14560dd89b4), +W64LIT(0x02f85ac2d0908dab), +W64LIT(0x12ec95f3712edb38), +W64LIT(0x85d9c06dfea6fcaa), +W64LIT(0x90b4964c6285f935), +W64LIT(0xf1b0068b26a3441a), +W64LIT(0x729428555d40dab8), +W64LIT(0x5c4b3066c5d33fd0), +W64LIT(0x5d371d07ad9b837f), +W64LIT(0xa48d866e2167ecd6), +W64LIT(0xb661139d504937ee), +W64LIT(0xa27068dda4228ede), +W64LIT(0xf8c6b608e4b4d306), +W64LIT(0x6bf657e73ee91b37), +W64LIT(0xac871b8c8b38c765), +W64LIT(0x4ea7a595b4fde4e8), +W64LIT(0x0d7304f297c278bf), +W64LIT(0xb71d3efc38018b41), +W64LIT(0xae7f414e5ba84ace), +W64LIT(0xaf036c2f33e0f661), +W64LIT(0x0000000000000000), +W64LIT(0xb89660cc7f537e55), +W64LIT(0xa675dcacf1f7617d), +W64LIT(0x610490c74426bd2f), +W64LIT(0xc18ca2d83094be5a), +W64LIT(0x2adaac42cd460acb), +W64LIT(0x7d1f76651a122fac), +W64LIT(0xc58916a9654151f9), +W64LIT(0xedabe0297897d699), +W64LIT(0x2d5b6f90204bd46c), +W64LIT(0x26d585d132cccedb), +W64LIT(0x9f3fc87c25d70c21), +W64LIT(0xc60d610add9960fd), +W64LIT(0x80a0597dc33bafa6), +W64LIT(0xd0e44088f9625466), +W64LIT(0x1d67cbc3367c2e2c), +W64LIT(0x2c2742f1480368c3), +W64LIT(0x89d6e9fe012c38ba), +W64LIT(0xe9ae54582d42393a), +W64LIT(0x3ecbd702392db3fb), +W64LIT(0xb5e5643ee89106ea), +W64LIT(0xa882affddeed28c6), +W64LIT(0x1ae60811db71f08b), +W64LIT(0x924ccc8eb215749e), +W64LIT(0xfcc30279b1613ca5), +W64LIT(0x825803bf13ab220d), +W64LIT(0xd992f00b3b75c37a), +W64LIT(0xc8fa125bf2832946), +W64LIT(0x35453d432baaa94c), +W64LIT(0xf9ba9b698cfc6fa9), +W64LIT(0x37bd6781fb3a24e7), +W64LIT(0x791ac2144fc7c00f), +W64LIT(0x16e9218224fb349b), +W64LIT(0xdb6aaac9ebe54ed1), +W64LIT(0xd8eedd6a533d7fd5), +W64LIT(0x7c635b04725a9303), +W64LIT(0x553d80e507c4a8cc), +W64LIT(0x9a46516c184a5f2d), +W64LIT(0x14117b40f46bb930), +W64LIT(0x1ee3bc608ea41f28), +W64LIT(0x27a9a8b05a847274), +W64LIT(0x4050d6c49be7ad53), +W64LIT(0x7be298d69f574da4), +W64LIT(0x6a8a7a8656a1a798), +W64LIT(0x4d23d2360c25d5ec), +W64LIT(0x1014cf31a1be5693), +W64LIT(0xb264a7ec059cd84d), +W64LIT(0xea2a23fb959a083e), +W64LIT(0xf0cc2bea4eebf8b5), +W64LIT(0x76919c240895351b), +W64LIT(0x0b8eea4112871ab7), +W64LIT(0x47d1151676ea73f4), +W64LIT(0xbdeff9dc42ce2d59), +W64LIT(0x2ba68123a50eb664), +W64LIT(0x057999103d9d530c), +W64LIT(0xe759270902587081), +W64LIT(0xef53baeba8075b32), +W64LIT(0x4fdb88f4dcb55847), +W64LIT(0x6e8fcef70374483b), +W64LIT(0x1168e250c9f6ea3c), +W64LIT(0x1b9a2570b3394c24), +W64LIT(0x706c72978dd05713), +W64LIT(0x865db7ce467ecdae), +W64LIT(0x52bc4337eac9766b), +W64LIT(0x504419f53a59fbc0), +W64LIT(0x8f2b074d84695ab2), +W64LIT(0x6078bda62c6e0180), +W64LIT(0x43d4a167233f9c57), +W64LIT(0x0ef773512f1a49bb), +W64LIT(0x0c0f2993ff8ac410), +W64LIT(0x4bde3c858960b7e4), +W64LIT(0x66855315a92b6388), +W64LIT(0xd360372b41ba6562), +W64LIT(0x584e84179006d073), +W64LIT(0x9b3a7c0d7002e382), +W64LIT(0xa5f1ab0f492f5079), +W64LIT(0x2822f6801dd68760), +W64LIT(0x445562b5ce3242f0), +W64LIT(0xaa7af53f0e7da56d), +W64LIT(0x3c338dc0e9bd3e50), +W64LIT(0x3bb24e1204b0e0f7), +W64LIT(0xd59dd998c4ff076a), +W64LIT(0x91c8bb2d0acd459a), +W64LIT(0x84a5ed0c96ee4005), +W64LIT(0x33b8d3f0aeefcb44), +W64LIT(0x57c5da27d7542567), +W64LIT(0x32c4fe91c6a777eb), +W64LIT(0x3439102243e215e3), +W64LIT(0xc7714c6bb5d1dc52), +W64LIT(0x3fb7fa6351650f54), +W64LIT(0x87219aaf2e367101), +W64LIT(0xf5b5b2fa7376abb9), +W64LIT(0x412cfba5f3af11fc), +W64LIT(0xdceb691b06e89076), +W64LIT(0xbb12176fc78b4f51), +W64LIT(0x73e8053435086617), +W64LIT(0xe220be193fc5238d), +W64LIT(0xb09cfd2ed50c55e6), +W64LIT(0xb9ea4dad171bc2fa), +W64LIT(0x9e43e51d4d9fb08e), +W64LIT(0x36c14ae093729848), +W64LIT(0xa9fe829cb6a59469), +W64LIT(0x0405b47155d5efa3), +W64LIT(0x0af2c7207acfa618), +W64LIT(0x7e9b01c6a2ca1ea8), +W64LIT(0xdd97447a6ea02cd9), +W64LIT(0x0781c3d2ed0ddea7), +W64LIT(0x7866ef75278f7ca0), +W64LIT(0xd1986de9912ae8c9), +W64LIT(0xcb7e65f84a5b1842), +W64LIT(0xcd838b4bcf1e7a4a), +W64LIT(0xab06d85e663519c2), +W64LIT(0xd4e1f4f9acb7bbc5), +W64LIT(0xfdbf2f18d929800a), +W64LIT(0xf23471289e7b751e), +W64LIT(0xbc93d4bd2a8691f6), +W64LIT(0x3d4fa0a181f582ff), +W64LIT(0xba6e3a0eafc3f3fe), +W64LIT(0x5ab6ded540965dd8), +W64LIT(0xeb560e9afdd2b491), +W64LIT(0x0976b083c217971c), +W64LIT(0xecd7cd4810df6a36), +W64LIT(0x23ac1cc10f519dd7), +W64LIT(0xbe6b8e7ffa161c5d), +W64LIT(0x7fe72ca7ca82a207), +W64LIT(0xc0f08fb958dc02f5), +W64LIT(0x7a9eb5b7f71ff10b), +W64LIT(0xa709f1cd99bfddd2), +W64LIT(0x8dd35d8f54f9d719), +W64LIT(0x8caf70ee3cb16bb6), +W64LIT(0xe4dd50aaba804185), +W64LIT(0x83242ede7be39ea2), +W64LIT(0x98be0baec8dad286), +W64LIT(0x690e0d25ee79969c), +W64LIT(0x95cd0f5c5f18aa39), +W64LIT(0x56b9f746bf1c99c8), +W64LIT(0x7469c6e6d805b8b0), +W64LIT(0x8a529e5db9f409be), +W64LIT(0xe6250a686a10cc2e), +W64LIT(0x2fa33552f0db59c7), +W64LIT(0x42a88c064b7720f8), +W64LIT(0x6d0bb954bbac793f), +W64LIT(0x181e52d30be17d20), +W64LIT(0xbf17a31e925ea0f2), +W64LIT(0x94b1223d37501696), +W64LIT(0xe8d27939450a8595), +W64LIT(0xccffa62aa756c6e5), +W64LIT(0x383639b1bc68d1f3), +W64LIT(0xee2f978ac04fe79d), +W64LIT(0xa30c45bccc6a3271), +W64LIT(0x1f9f9101e6eca387), +W64LIT(0xb1e0d04fbd44e949), +W64LIT(0x242ddf13e25c4370), +W64LIT(0x156d56219c23059f), +W64LIT(0x88aac49f69648415), +W64LIT(0x6280e764fcfe8c2b), +W64LIT(0xdf6f1eb8be30a172), +W64LIT(0xe5a17dcbd2c8fd2a), +W64LIT(0xe0d8e4dbef55ae26), +W64LIT(0x63fcca0594b63084), +W64LIT(0xa1f41f7e1cfabfda), +W64LIT(0x295edbe1759e3bcf), +W64LIT(0x67f97e74c163df27), +W64LIT(0x038477a3b8d83104), +W64LIT(0xde1333d9d6781ddd), +W64LIT(0x3ace63736cf85c58), +W64LIT(0xd619ae3b7c27366e), +W64LIT(0x5bcaf3b428dee177), +W64LIT(0xb3188a8d6dd464e2), +W64LIT(0x1c1be6a25e349283), +W64LIT(0x017c2d616848bcaf), +W64LIT(0x8e572a2cec21e61d), +W64LIT(0xf631c559cbae9abd), +W64LIT(0x81dc741cab731309), +W64LIT(0xff4775da09b90da1), +W64LIT(0xb499495f80d9ba45), +W64LIT(0x0f8b5e304752f514), +W64LIT(0x394a14d0d4206d5c), +W64LIT(0xce07fce877c64b4e), +W64LIT(0xf4c99f9b1b3e1716), +W64LIT(0xc4f53bc80d09ed56), +W64LIT(0xc208d57b884c8f5e), +W64LIT(0x080a9de2aa5f2bb3), +W64LIT(0x314089327e7f46ef), +W64LIT(0xfa3eecca34245ead), +W64LIT(0x20286b62b789acd3), +W64LIT(0x7515eb87b04d041f), +W64LIT(0x513834945211476f), +W64LIT(0x650124b611f3528c), +W64LIT(0x17950ce34cb38834), +W64LIT(0x45294fd4a67afe5f), +W64LIT(0x21544603dfc1107c), +W64LIT(0x485a4b2631b886e0), +W64LIT(0x6872204486312a33), +W64LIT(0x647d09d779bbee23), +W64LIT(0x2551f2728a14ffdf), +W64LIT(0xd765835a146f8ac1), +W64LIT(0xd21c1a4a29f2d9cd), +W64LIT(0x99c226cfa0926e29), +W64LIT(0xfb42c1ab5c6ce202), +W64LIT(0xc374f81ae00433f1), +W64LIT(0x964978ffe7c09b3d), +W64LIT(0xf74de838a3e62612), +/* box 5 */ +W64LIT(0x74b87b36b0592c6a), +W64LIT(0x3d82d75dffb4b81c), +W64LIT(0x8884246715267825), +W64LIT(0xdaf2d8a77ed4e5de), +W64LIT(0xfeb118650e53f9c7), +W64LIT(0xbd2d1aea59226b06), +W64LIT(0x26ce87f6dbabb191), +W64LIT(0x32772ecbeb66bd0a), +W64LIT(0xd4bbf82bc5104c8c), +W64LIT(0x055357720c4e03a1), +W64LIT(0xef5be62a32d0f6fd), +W64LIT(0xbe1c84c45d186aca), +W64LIT(0xacc7e4a565a1643c), +W64LIT(0x8dd7731519687b84), +W64LIT(0x11eafe4f3c830f3a), +W64LIT(0x04ef8e68a358afe5), +W64LIT(0x40ad9ca1534b930d), +W64LIT(0xe44191d4855a5c0e), +W64LIT(0x6001d20b809420f1), +W64LIT(0x73666b70173b8243), +W64LIT(0x372479b9e728beab), +W64LIT(0x45fecbd35f0590ac), +W64LIT(0x7057f55e1301838f), +W64LIT(0xff0dc17fa1455583), +W64LIT(0x0cc467b810e804da), +W64LIT(0xb9c29482fa7ac4e3), +W64LIT(0xa003831d754960e6), +W64LIT(0x8a096353be0ad5ad), +W64LIT(0xdd2cc8e1d9b64bf7), +W64LIT(0xc7dc415052bfee3e), +W64LIT(0x9f0c137421d17572), +W64LIT(0x35a93e8d4c041323), +W64LIT(0x9a5f44062d9f76d3), +W64LIT(0x71eb2c44bc172fcb), +W64LIT(0x0ff5f99614d20516), +W64LIT(0x7789e518b4632da6), +W64LIT(0xc99561dce97b476c), +W64LIT(0x5276fcc06bf29dfb), +W64LIT(0x4a0b32454bd795ba), +W64LIT(0x9274add69e2fddec), +W64LIT(0x4f5865374799961b), +W64LIT(0xb2d8e37c4df06e10), +W64LIT(0xc4eddf7e5685eff2), +W64LIT(0xb3643a66e2e6c254), +W64LIT(0xd50721316a06e0c8), +W64LIT(0x8bb5ba49111c79e9), +W64LIT(0x2bb639546455190f), +W64LIT(0xf8d3d1390627fbaa), +W64LIT(0x38d1802ff3fabbbd), +W64LIT(0xdfa18fd5729ae67f), +W64LIT(0x4ee4bc2de88f3a5f), +W64LIT(0xf72628af12f5febc), +W64LIT(0x0aa6aee4189c06b7), +W64LIT(0x0000000000000000), +W64LIT(0x9eb0ca6e8ec7d936), +W64LIT(0xcb1826e84257eae4), +W64LIT(0x187dce8520250841), +W64LIT(0xc28f16225ef1ed9f), +W64LIT(0xc333cf38f1e741db), +W64LIT(0x4220db95f8673e85), +W64LIT(0xdc9011fb76a0e7b3), +W64LIT(0x105627559395a37e), +W64LIT(0x2f59b73cc70db6ea), +W64LIT(0xe112c6a689145faf), +W64LIT(0x82228a830dba7e92), +W64LIT(0x2ee56e26681b1aae), +W64LIT(0x2a0ae04ecb43b54b), +W64LIT(0x47738ce7f4293d24), +W64LIT(0xa7dd935bd22bcecf), +W64LIT(0xd2d93177cd644ee1), +W64LIT(0xebb4684291885918), +W64LIT(0x0e49208cbbc4a952), +W64LIT(0xa550d46f79076347), +W64LIT(0x411145bbfc5d3f49), +W64LIT(0xe6ccd6e02e76f186), +W64LIT(0x4bb7eb5fe4c139fe), +W64LIT(0x5d8305567f2098ed), +W64LIT(0x95aabd90394d73c5), +W64LIT(0x25ff19d8df91b05d), +W64LIT(0x86cd04ebaee2d177), +W64LIT(0x03319e2e043a01cc), +W64LIT(0x6b1ba5f5371e8a02), +W64LIT(0x76353c021b7581e2), +W64LIT(0x64ee5c6323cc8f14), +W64LIT(0x5c3fdc4cd03634a9), +W64LIT(0x6996e2c19c32278a), +W64LIT(0x8938fd7dba30d461), +W64LIT(0x7b4d82a0a48b297c), +W64LIT(0xbfa05ddef20ec68e), +W64LIT(0x8ee6ed3b1d527a48), +W64LIT(0x61bd0b112f828cb5), +W64LIT(0x66631b5788e0229c), +W64LIT(0x55a8ec86cc9033d2), +W64LIT(0x1c9240ed837da7a4), +W64LIT(0x150570279fdba0df), +W64LIT(0x53ca25dac4e431bf), +W64LIT(0xd636bf1f6e3ce104), +W64LIT(0xcaa4fff2ed4146a0), +W64LIT(0x787c1c8ea0b128b0), +W64LIT(0xad7b3dbfcab7c878), +W64LIT(0xfc3c5f51a57f544f), +W64LIT(0xb78bb40e41be6db1), +W64LIT(0x8c6baa0fb67ed7c0), +W64LIT(0xce4b719a4e19e945), +W64LIT(0xf96f0823a93157ee), +W64LIT(0x7d2f4bfcacff2b11), +W64LIT(0x3eb34973fb8eb9d0), +W64LIT(0xe39f81922238f227), +W64LIT(0x239dd084d7e5b230), +W64LIT(0x1fa3dec38747a668), +W64LIT(0xc5510664f99343b6), +W64LIT(0xc829b8c6466deb28), +W64LIT(0x85fc9ac5aad8d0bb), +W64LIT(0xb6376d14eea8c1f5), +W64LIT(0x9d8154408afdd8fa), +W64LIT(0x3be01e01f7c0ba71), +W64LIT(0x628c953f2bb88d79), +W64LIT(0x6d796ca93f6a886f), +W64LIT(0xfa5e960dad0b5622), +W64LIT(0xe5fd48ce2a4cf04a), +W64LIT(0xe7700ffa81605dc2), +W64LIT(0x2dd4f0086c211b62), +W64LIT(0x2221099e78f31e74), +W64LIT(0xdb4e01bdd1c2499a), +W64LIT(0xf417b68116cfff70), +W64LIT(0xb506f33aea92c039), +W64LIT(0x514762ee6fc89c37), +W64LIT(0x9c3d8d5a25eb74be), +W64LIT(0x396d59355cec17f9), +W64LIT(0xccc636aee53544cd), +W64LIT(0x0b1a77feb78aaaf3), +W64LIT(0xe9392f763aa4f490), +W64LIT(0xaaa52df96dd56651), +W64LIT(0x46cf55fd5b3f9160), +W64LIT(0xa4ec0d75d611cf03), +W64LIT(0xaff67a8b619b65f0), +W64LIT(0x3415e797e312bf67), +W64LIT(0x7af15bba0b9d8538), +W64LIT(0x811314ad09807f5e), +W64LIT(0x8771ddf101f47d33), +W64LIT(0x969b23be3d777209), +W64LIT(0xd365e86d6272e2a5), +W64LIT(0x58d05224736e9b4c), +W64LIT(0xc660984afda9427a), +W64LIT(0x5414359c63869f96), +W64LIT(0xe885f66c95b258d4), +W64LIT(0x655285798cda2350), +W64LIT(0x6cc5b5b3907c242b), +W64LIT(0x6ff42b9d944625e7), +W64LIT(0xc0025116f5dd4017), +W64LIT(0xa28ec429de65cd6e), +W64LIT(0x63304c2584ae213d), +W64LIT(0x7fa20cc807d38699), +W64LIT(0x996eda2829a5771f), +W64LIT(0x1b4c50ab241f098d), +W64LIT(0x1e1f07d928510a2c), +W64LIT(0x33cbf7d14470114e), +W64LIT(0xb055a448e6dcc398), +W64LIT(0x98d2033286b3db5b), +W64LIT(0xec6a780436eaf731), +W64LIT(0xa1bf5a07da5fcca2), +W64LIT(0xbaf30aacfe40c52f), +W64LIT(0xf144e1f31a81fcd1), +W64LIT(0xe0ae1fbc2602f3eb), +W64LIT(0x14b9a93d30cd0c9b), +W64LIT(0x596c8b3edc783708), +W64LIT(0x682a3bdb33248bce), +W64LIT(0xb87e4d98556c68a7), +W64LIT(0x80afcdb7a696d31a), +W64LIT(0x5725abb267bc9e5a), +W64LIT(0x914533f89a15dc20), +W64LIT(0x5eb29b787b1a9921), +W64LIT(0x01bcd91aaf16ac44), +W64LIT(0xc1be880c5acbec53), +W64LIT(0xedd6a11e99fc5b75), +W64LIT(0x028d4734ab2cad88), +W64LIT(0x8f5a3421b244d60c), +W64LIT(0x4dd52203ecb53b93), +W64LIT(0x3f0f906954981594), +W64LIT(0xae4aa391ce8dc9b4), +W64LIT(0x3698a0a3483e12ef), +W64LIT(0xf5ab6f9bb9d95334), +W64LIT(0x082be9d0b3b0ab3f), +W64LIT(0xd1e8af59c95e4f2d), +W64LIT(0xd87f9f93d5f84856), +W64LIT(0x6e48f2873b5089a3), +W64LIT(0x2443c0c270871c19), +W64LIT(0xb1e97d5249ca6fdc), +W64LIT(0x7c9392e603e98755), +W64LIT(0x839e5399a2acd2d6), +W64LIT(0x19c1179f8f33a405), +W64LIT(0xde1d56cfdd8c4a3b), +W64LIT(0x20ac4eaad3dfb3fc), +W64LIT(0x1af089b18b09a5c9), +W64LIT(0x3a5cc71b58d61635), +W64LIT(0x444212c9f0133ce8), +W64LIT(0x72dab26ab82d2e07), +W64LIT(0x4c69fb1943a397d7), +W64LIT(0xf3c9a6c7b1ad5159), +W64LIT(0x1d2e99f72c6b0be0), +W64LIT(0xb4ba2a2045846c7d), +W64LIT(0xe22358888d2e5e63), +W64LIT(0x2887a77a606f18c3), +W64LIT(0xa8286acdc6f9cbd9), +W64LIT(0x5f0e4262d40c3565), +W64LIT(0xeee73f309dc65ab9), +W64LIT(0x9be39d1c8289da97), +W64LIT(0x1634ee099be1a113), +W64LIT(0xea08b1583e9ef55c), +W64LIT(0x9727faa49261de4d), +W64LIT(0x2c682912c337b726), +W64LIT(0xcff7a880e10f4501), +W64LIT(0x1788371334f70d57), +W64LIT(0x27725eec74bd1dd5), +W64LIT(0x3146b0e5ef5cbcc6), +W64LIT(0x099730ca1ca6077b), +W64LIT(0xf2757fdd1ebbfd1d), +W64LIT(0x6aa77cef98082646), +W64LIT(0xbb4fd3b65156696b), +W64LIT(0x569972a8c8aa321e), +W64LIT(0xa3321d337173612a), +W64LIT(0x50fbbbf4c0de3073), +W64LIT(0x5a5d1510d84236c4), +W64LIT(0xfd80864b0a69f80b), +W64LIT(0x07de1046a762ae29), +W64LIT(0xa6614a417d3d628b), +W64LIT(0xd78a6605c12a4d40), +W64LIT(0x67dfc24d27f68ed8), +W64LIT(0xbc91c3f0f634c742), +W64LIT(0xd05476436648e369), +W64LIT(0x493aac6b4fed9476), +W64LIT(0x12db606138b90ef6), +W64LIT(0xa994b3d769ef679d), +W64LIT(0x211097b07cc91fb8), +W64LIT(0x30fa69ff404a1082), +W64LIT(0x3c3e0e4750a21458), +W64LIT(0x7504a22c1f4f802e), +W64LIT(0x844043df05ce7cff), +W64LIT(0xf0f838e9b5975095), +W64LIT(0x7e1ed5d2a8c52add), +W64LIT(0x90f9eae235037064), +W64LIT(0x0662c95c0874026d), +W64LIT(0x9416648a965bdf81), +W64LIT(0xf69af1b5bde352f8), +W64LIT(0x0d78bea2bffea89e), +W64LIT(0x293b7e60cf79b487), +W64LIT(0xd9c346897aeee412), +W64LIT(0xfbe24f17021dfa66), +W64LIT(0x1367b97b97afa2b2), +W64LIT(0xab19f4e3c2c3ca15), +W64LIT(0x48867571e0fb3832), +W64LIT(0x93c874cc313971a8), +W64LIT(0x79c0c5940fa784f4), +W64LIT(0xcd7aefb44a23e889), +W64LIT(0x439c028f577192c1), +W64LIT(0x5be1cc0a77549a80), +/* box 6 */ +W64LIT(0x714d28d778656928), +W64LIT(0xc88a7c6b84f64f7c), +W64LIT(0xec43cac5ab89aaca), +W64LIT(0x777fa38110dc16a3), +W64LIT(0x0f7d5c87e4213b5c), +W64LIT(0x73f051e5f3a1ef51), +W64LIT(0xea714193c330d541), +W64LIT(0x95e5f3dae016c4f3), +W64LIT(0x63d3738095a0e173), +W64LIT(0x9825d66f8ff379d6), +W64LIT(0xe8cc38a148f45338), +W64LIT(0xa840b0c025f06bb0), +W64LIT(0x944135c35f748735), +W64LIT(0x74661caa247ad31c), +W64LIT(0xe7b16426acd56864), +W64LIT(0xd1e689df6e6f0589), +W64LIT(0xa73dec47c1d150ec), +W64LIT(0x64453ecf427bdd3e), +W64LIT(0x0ed99a9e5b43789a), +W64LIT(0x7b1b402dc05be840), +W64LIT(0x0dc025b56fe5bd25), +W64LIT(0x3f183a284e22293a), +W64LIT(0xa0aba108160a6ca1), +W64LIT(0x46be033705bd4703), +W64LIT(0x86df6e94b2b10f6e), +W64LIT(0xa216d83a9dceead8), +W64LIT(0x129e5b57edc5885b), +W64LIT(0x7e3074509c445274), +W64LIT(0x7d29cb7ba8e297cb), +W64LIT(0x1611a9330eb871a9), +W64LIT(0x486799a95efe3f99), +W64LIT(0x9fb39b205828459b), +W64LIT(0xd0424fc6d10d464f), +W64LIT(0xe968feb8f79610fe), +W64LIT(0x5d6f8fb164e08b8f), +W64LIT(0xaafdc9f2ae34edc9), +W64LIT(0x02bd79328bc48679), +W64LIT(0x9b3c6944bb55bc69), +W64LIT(0x6277b5992ac2a2b5), +W64LIT(0x877ba88d0dd34ca8), +W64LIT(0xfa5263f6a531db63), +W64LIT(0x2e9fde54974164de), +W64LIT(0xcda14816d8e9f548), +W64LIT(0x675c81e476dd1881), +W64LIT(0x2a102c30743c9d2c), +W64LIT(0x37f32be07dd82e2b), +W64LIT(0x256d70b7901da670), +W64LIT(0x4ce86bcdbd83c66b), +W64LIT(0x50afaa040b0536aa), +W64LIT(0xef5a75ee9f2f6f75), +W64LIT(0xb3913c4644ada73c), +W64LIT(0x1187e47cd9634de4), +W64LIT(0xc54a59deeb13f259), +W64LIT(0x0000000000000000), +W64LIT(0x01a4c619bf6243c6), +W64LIT(0x90cec7a7bc097ec7), +W64LIT(0xf94bdcdd91971edc), +W64LIT(0x8e347f5c814b087f), +W64LIT(0xc7f720ec60d77420), +W64LIT(0x354e52d2f61ca852), +W64LIT(0x34ea94cb497eeb94), +W64LIT(0xae723b964d49143b), +W64LIT(0xf48bf968fe72a3f9), +W64LIT(0xfc60e8a0cd88a4e8), +W64LIT(0x2909931b409a5893), +W64LIT(0xbd48a6d81feedfa6), +W64LIT(0x6cae2f077181da2f), +W64LIT(0xad6b84bd79efd184), +W64LIT(0x18c833ad55fb0933), +W64LIT(0x204644cacc021c44), +W64LIT(0x392ab17e269b56b1), +W64LIT(0x14acd001857cf7d0), +W64LIT(0x8abb8d386236f18d), +W64LIT(0xeefeb3f7204d2cb3), +W64LIT(0xf636805a75b62580), +W64LIT(0x2bb4ea29cb5edeea), +W64LIT(0xc653e6f5dfb537e6), +W64LIT(0x8d2dc077b5edcdc0), +W64LIT(0x31c1a0b6156151a0), +W64LIT(0xf8ef1ac42ef55d1a), +W64LIT(0xdbb0e125d65184e1), +W64LIT(0x82509cf051ccf69c), +W64LIT(0xe33e96424fa89196), +W64LIT(0xdf3f1341352c7d13), +W64LIT(0x8f90b9453e294bb9), +W64LIT(0x1023226566010e22), +W64LIT(0xa58095754a15d695), +W64LIT(0x2c22a7661c85e2a7), +W64LIT(0xe183ef70c46c17ef), +W64LIT(0xafd6fd8ff22b57fd), +W64LIT(0x471ac52ebadf04c5), +W64LIT(0x4d4cadd402e185ad), +W64LIT(0x916a01be036b3d01), +W64LIT(0x28ad5502fff81b55), +W64LIT(0x3657edf9c2ba6ded), +W64LIT(0xd2ff36f45ac9c036), +W64LIT(0xf1a0cd15a26d19cd), +W64LIT(0xd90d98175d950298), +W64LIT(0xf7924643cad46646), +W64LIT(0xdd826a73bee8fb6a), +W64LIT(0x9d0ee212d3ecc3e2), +W64LIT(0xb6ba083b18b21d08), +W64LIT(0x3da5431ac5e6af43), +W64LIT(0x08eb11c833fa0711), +W64LIT(0x052b347d5c1fba34), +W64LIT(0x6fb7902c45271f90), +W64LIT(0x133a9d4e52a7cb9d), +W64LIT(0x6e135635fa455c56), +W64LIT(0x725497fc4cc3ac97), +W64LIT(0xf31db42729a99fb4), +W64LIT(0x846217a639758917), +W64LIT(0x4b7e26826a58fa26), +W64LIT(0x235ffbe1f8a4d9fb), +W64LIT(0xff79578bf92e6157), +W64LIT(0xda14273c6933c727), +W64LIT(0x8b1f4b21dd54b24b), +W64LIT(0x9caa240b6c8e8024), +W64LIT(0xc1c5abba086e0bab), +W64LIT(0xde9bd5588a4e3ed5), +W64LIT(0x2d86617fa3e7a161), +W64LIT(0xbff5dfea942a59df), +W64LIT(0x66f847fdc9bf5b47), +W64LIT(0x3b97c84cad5fd0c8), +W64LIT(0x3ebcfc31f1406afc), +W64LIT(0xca3705590f32c905), +W64LIT(0x24c9b6ae2f7fe5b6), +W64LIT(0x408c88616d043888), +W64LIT(0x93d7788c88afbb78), +W64LIT(0x196cf5b4ea994af5), +W64LIT(0x9a98af5d0437ffaf), +W64LIT(0x8c89066e0a8f8e06), +W64LIT(0xab590feb1156ae0f), +W64LIT(0xd7d4028906d67a02), +W64LIT(0xe4a8db0d9873addb), +W64LIT(0xc378d28883aa8dd2), +W64LIT(0x4ff1d4e6892503d4), +W64LIT(0xd670c490b9b439c4), +W64LIT(0x65e1f8d6fd199ef8), +W64LIT(0xf2b9723e96cbdc72), +W64LIT(0xb12c4574cf692145), +W64LIT(0x569d215263bc4921), +W64LIT(0x69851b7a2d9e601b), +W64LIT(0x5e76309a50464e30), +W64LIT(0x5fd2f683ef240df6), +W64LIT(0xd8a95e0ee2f7415e), +W64LIT(0xe29a505bf0cad250), +W64LIT(0x96fc4cf1d4b0014c), +W64LIT(0x8806f40ae9f277f4), +W64LIT(0x53b6152f3fa3f315), +W64LIT(0x1c47c1c9b686f0c1), +W64LIT(0x80ede5c2da0870e5), +W64LIT(0xd5697bbb8d12fc7b), +W64LIT(0xfdc42eb972eae72e), +W64LIT(0x0bf2aee3075cc2ae), +W64LIT(0x22fb3df847c69a3d), +W64LIT(0xbadeeb97c835e3eb), +W64LIT(0xdc26ac6a018ab8ac), +W64LIT(0xbcec60c1a08c9c60), +W64LIT(0x4231f153e6c0bef1), +W64LIT(0x337cd9849ea5d7d9), +W64LIT(0x5b5d04e70c59f404), +W64LIT(0x79a6391f4b9f6e39), +W64LIT(0x5212d33680c1b0d3), +W64LIT(0xb5a3b7102c14d8b7), +W64LIT(0x7f94b249232611b2), +W64LIT(0x17b56f2ab1da326f), +W64LIT(0x59e07dd5879d727d), +W64LIT(0xebd5878a7c529687), +W64LIT(0xbb7a2d8e7757a02d), +W64LIT(0x0319bf2b34a6c5bf), +W64LIT(0x5ccb49a8db82c849), +W64LIT(0x1de307d009e4b307), +W64LIT(0x49c35fb0e19c7c5f), +W64LIT(0x55849e79571a8c9e), +W64LIT(0x7abf86347f39ab86), +W64LIT(0x9273be9537cdf8be), +W64LIT(0xe615a23f13b72ba2), +W64LIT(0x6821dd6392fc23dd), +W64LIT(0x5af9c2feb33bb7c2), +W64LIT(0x06328b5668b97f8b), +W64LIT(0x44037a058e79c17a), +W64LIT(0x83f45ae9eeaeb55a), +W64LIT(0x5739e74bdcde0ae7), +W64LIT(0xfbf6a5ef1a5398a5), +W64LIT(0xe50c1d142711ee1d), +W64LIT(0x1a754a9fde3f8f4a), +W64LIT(0x7802ff06f4fd2dff), +W64LIT(0xf52f3f714110e03f), +W64LIT(0x2674cf9ca4bb63cf), +W64LIT(0x60caccaba10624cc), +W64LIT(0xb088836d700b6283), +W64LIT(0xa6992a5e7eb3132a), +W64LIT(0xa9e476d99a922876), +W64LIT(0x6b386248a65ae662), +W64LIT(0xc2dc14913cc8ce14), +W64LIT(0x76db6598afbe5565), +W64LIT(0x32d81f9d21c7941f), +W64LIT(0x21e282d373605f82), +W64LIT(0xc0616da3b70c486d), +W64LIT(0x616e0ab21e64670a), +W64LIT(0x6d0ae91ecee399e9), +W64LIT(0x27d009851bd92009), +W64LIT(0xfedd9192464c2291), +W64LIT(0x45a7bc1c311b82bc), +W64LIT(0x54205860e878cf58), +W64LIT(0xa10f6711a9682f67), +W64LIT(0x9981107630913a10), +W64LIT(0xede70cdc14ebe90c), +W64LIT(0x70e9eecec7072aee), +W64LIT(0x1f5e7ee28220357e), +W64LIT(0x2f3b184d28232718), +W64LIT(0x41284e78d2667b4e), +W64LIT(0xa424536cf5779553), +W64LIT(0xa3b21e2322aca91e), +W64LIT(0x4e5512ff36474012), +W64LIT(0x1efab8fb3d4276b8), +W64LIT(0x89a2321356903432), +W64LIT(0xcb93c340b0508ac3), +W64LIT(0x306566afaa031266), +W64LIT(0x4adae09bd53ab9e0), +W64LIT(0xc92eba723b940cba), +W64LIT(0x094fd7d18c9844d7), +W64LIT(0xcc058e0f678bb68e), +W64LIT(0xd4cdbda23270bfbd), +W64LIT(0x0a5668fab83e8168), +W64LIT(0x510b6c1db467756c), +W64LIT(0xb86392a543f16592), +W64LIT(0x048ff264e37df9f2), +W64LIT(0x3a330e55123d930e), +W64LIT(0xb235fa5ffbcfe4fa), +W64LIT(0xb9c754bcfc932654), +W64LIT(0x3c0185037a84ec85), +W64LIT(0x0c64e3acd087fee3), +W64LIT(0xe02729697b0e5429), +W64LIT(0x07964d4fd7db3c4d), +W64LIT(0x814923db656a3323), +W64LIT(0x388e776799f91577), +W64LIT(0x6a9ca4511938a5a4), +W64LIT(0x1bd18c86615dcc8c), +W64LIT(0xb407710993769b71), +W64LIT(0x150816183a1eb416), +W64LIT(0x4395374a59a2fd37), +W64LIT(0xc4ee9fc75471b19f), +W64LIT(0x5844bbcc38ff31bb), +W64LIT(0xcf1c3124532d7331), +W64LIT(0xb71ece22a7d05ece), +W64LIT(0xaccf42a4c68d9242), +W64LIT(0x97588ae86bd2428a), +W64LIT(0x75c2dab39b1890da), +W64LIT(0x9e175d39e74a065d), +W64LIT(0xf0040b0c1d0f5a0b), +W64LIT(0xceb8f73dec4f30f7), +W64LIT(0xbe5119f32b481a19), +W64LIT(0xd35bf0ede5ab83f0), +W64LIT(0x7c8d0d621780d40d), +W64LIT(0x85c6d1bf8617cad1), +/* box 7 */ +W64LIT(0xb1c742127b66f2a4), +W64LIT(0xce916098d7a59fc1), +W64LIT(0xc312ef8e2406fa70), +W64LIT(0x956c7dced81403d5), +W64LIT(0x5a0c9b2318dd9520), +W64LIT(0xad0d57f51a480e8b), +W64LIT(0xe7b9d05287740b01), +W64LIT(0x0217f9ea2ed81268), +W64LIT(0x4d7cff19f8cd3a06), +W64LIT(0x44d1772e572b7b67), +W64LIT(0xfb73c5b5e65af72e), +W64LIT(0x91427aef84512705), +W64LIT(0x0c720963e4cf6c85), +W64LIT(0x87c398a0732d8117), +W64LIT(0xa17f5e96fe87620e), +W64LIT(0x50476c8b8e8fcf1d), +W64LIT(0xcb4ee1cc9c8cb225), +W64LIT(0x67b2304c91a8b59a), +W64LIT(0x54696baad2caebcd), +W64LIT(0xddcf03836bf01437), +W64LIT(0x46c68ec479f3690f), +W64LIT(0x8f9f96e2cba7c942), +W64LIT(0xe1802e99f5e93db9), +W64LIT(0x4e9a8086c179215a), +W64LIT(0xf0c9b4686764a427), +W64LIT(0xfd4a3b7e94c7c196), +W64LIT(0xfcbbbd0b83abc8a2), +W64LIT(0xebcbd93163bb6784), +W64LIT(0xf9643c5fc882e546), +W64LIT(0xc4da973041f7c5fc), +W64LIT(0x1af3eb2c13b3ca97), +W64LIT(0x6e1fb87b3e4ef4fb), +W64LIT(0x5e229c024498b1f0), +W64LIT(0xf516353c2c4d89c3), +W64LIT(0xcc869972f97d8da9), +W64LIT(0x8d886f08e57fdb2a), +W64LIT(0x1cca15e7612efc2f), +W64LIT(0x567e9240fc12f9a5), +W64LIT(0x43190f9032da44eb), +W64LIT(0xfeac44e1ad73daca), +W64LIT(0x07c878be65f13f8c), +W64LIT(0x618bce87e3358322), +W64LIT(0xf895ba2adfeeec72), +W64LIT(0x751dd5223a913758), +W64LIT(0x59eae4bc21698e7c), +W64LIT(0xff5dc294ba1fd3fe), +W64LIT(0x03e67f9f39b41b5c), +W64LIT(0x2292c117d1efc7c9), +W64LIT(0x8a4017b6808ee4a6), +W64LIT(0xd1bd0ae08f3f78b2), +W64LIT(0x135e631bbc558bf6), +W64LIT(0xee14586528924a60), +W64LIT(0x8857ee5cae56f6ce), +W64LIT(0x0000000000000000), +W64LIT(0x0e65f089ca177eed), +W64LIT(0x34132358269361db), +W64LIT(0x15679dd0cec8bd4e), +W64LIT(0x800be01e16dcbe9b), +W64LIT(0x949dfbbbcf780ae1), +W64LIT(0xe397d773db312fd1), +W64LIT(0xedf227fa1126513c), +W64LIT(0xb5e945332723d674), +W64LIT(0x53a11314b73bd441), +W64LIT(0x23634762c683cefd), +W64LIT(0x4b4501d28a500cbe), +W64LIT(0x473708b16e9f603b), +W64LIT(0x1770643ae010af26), +W64LIT(0xa746a05d8c1a54b6), +W64LIT(0x90b3fc9a933d2e31), +W64LIT(0x35e2a52d31ff68ef), +W64LIT(0xab34a93e68d53833), +W64LIT(0xd81082d720d939d3), +W64LIT(0xb86aca25d480b3c5), +W64LIT(0xdfd8fa694528065f), +W64LIT(0x4f6b06f3d615286e), +W64LIT(0x578f1435eb7ef091), +W64LIT(0x9af80b32056f740c), +W64LIT(0x92a40570bde53c59), +W64LIT(0xdbf6fd48196d228f), +W64LIT(0x1b026d5904dfc3a3), +W64LIT(0x3c4f2d1a9e19298e), +W64LIT(0xc8a89e53a538a979), +W64LIT(0x991e74ad3cdb6f50), +W64LIT(0x042e07215c4524d0), +W64LIT(0x8e6e1097dccbc076), +W64LIT(0xe071a8ece285348d), +W64LIT(0xd784f42bfda24e0a), +W64LIT(0x7d41db60821b7f0d), +W64LIT(0x85d4614a5df5937f), +W64LIT(0xbb8cb5baed34a899), +W64LIT(0x40ff700f0b6e5fb7), +W64LIT(0x2cf7319e1bf8b924), +W64LIT(0x3a76d3d1ec841f36), +W64LIT(0x4520f15b40477253), +W64LIT(0xf138321d7008ad13), +W64LIT(0x42e889e525b64ddf), +W64LIT(0x65a5c9a6bf70a7f2), +W64LIT(0x208538fdff37d5a1), +W64LIT(0x410ef67a1c025683), +W64LIT(0x18e412c63d6bd8ff), +W64LIT(0x72d5ad9c5f6008d4), +W64LIT(0x255ab9a9b41ef845), +W64LIT(0x93558305aa89356d), +W64LIT(0x70c2547671b81abc), +W64LIT(0x3604dab2084b73b3), +W64LIT(0x05df81544b292de4), +W64LIT(0xf2de4d8249bcb64f), +W64LIT(0x0bba71dd813e5309), +W64LIT(0xa368a77cd05f7066), +W64LIT(0x796fdc41de5e5bdd), +W64LIT(0xec03a18f064a5808), +W64LIT(0x085c0e42b88a4855), +W64LIT(0x274d40439ac6ea2d), +W64LIT(0x31cca20c6dba4c3f), +W64LIT(0x322add93540e5763), +W64LIT(0xb60f3aac1e97cd28), +W64LIT(0x7cb05d1595777639), +W64LIT(0xb036c4676c0afb90), +W64LIT(0x0a4bf7a896525a3d), +W64LIT(0x73242be9480c01e0), +W64LIT(0x5bfd1d560fb19c14), +W64LIT(0x7b7825abf08649b5), +W64LIT(0xb7febcd909fbc41c), +W64LIT(0x81fa666b01b0b7af), +W64LIT(0xd25b757fb68b63ee), +W64LIT(0x0d838f16f3a365b1), +W64LIT(0x6a31bf5a620bd02b), +W64LIT(0x26bcc6368daae319), +W64LIT(0x9ed60c13592a50dc), +W64LIT(0x581b62c936058748), +W64LIT(0x9cc1f5f977f242b4), +W64LIT(0x83ed9f812f68a5c7), +W64LIT(0x74ec53572dfd3e6c), +W64LIT(0xb3d0bbf855bee0cc), +W64LIT(0xacfcd1800d2407bf), +W64LIT(0x303d24797ad6450b), +W64LIT(0x7a89a3dee7ea4081), +W64LIT(0x69d7c0c55bbfcb77), +W64LIT(0x770a2cc814492530), +W64LIT(0x0f9476fcdd7b77d9), +W64LIT(0xaeeb286a23fc15d7), +W64LIT(0x2174be88e85bdc95), +W64LIT(0xde297c1c52440f6b), +W64LIT(0xd04c8c9598537186), +W64LIT(0x2ee0c8743520ab4c), +W64LIT(0x977b8424f6cc11bd), +W64LIT(0x10b81c8485e190aa), +W64LIT(0xa4a0dfc2b5ae4fea), +W64LIT(0x98eff2d82bb76664), +W64LIT(0xa8d2d6a15161236f), +W64LIT(0xd4628bb4c4165556), +W64LIT(0x682646b04cd3c243), +W64LIT(0x2d06b7eb0c94b010), +W64LIT(0x626db118da81987e), +W64LIT(0x2928b0ca50d194c0), +W64LIT(0x6df9c7e407faefa7), +W64LIT(0x1681e24ff77ca612), +W64LIT(0x4952f838a4881ed6), +W64LIT(0x76fbaabd03252c04), +W64LIT(0xc73ce8af7843dea0), +W64LIT(0xe82da6ae5a0f7cd8), +W64LIT(0xc10516640adee818), +W64LIT(0x968a0251e1a01889), +W64LIT(0x37f55cc71f277a87), +W64LIT(0xe5ae29b8a9ac1969), +W64LIT(0xcabf67b98be0bb11), +W64LIT(0xf4e7b3493b2180f7), +W64LIT(0xe9dc20db4d6375ec), +W64LIT(0x639c376dcded914a), +W64LIT(0x12afe56eab3982c2), +W64LIT(0xc2e369fb336af344), +W64LIT(0xa6b726289b765d82), +W64LIT(0x14961ba5d9a4b47a), +W64LIT(0xbc44cd0488c59715), +W64LIT(0xd3aaf30aa1e76ada), +W64LIT(0x28d936bf47bd9df4), +W64LIT(0xaf1aae1f34901ce3), +W64LIT(0x2f114e01224ca278), +W64LIT(0xe648562790180235), +W64LIT(0x24ab3fdca372f171), +W64LIT(0x52509561a057dd75), +W64LIT(0xc6cd6eda6f2fd794), +W64LIT(0xa08ed8e3e9eb6b3a), +W64LIT(0x09ad8837afe64161), +W64LIT(0xbdb54b719fa99e21), +W64LIT(0x8c79e97df213d21e), +W64LIT(0xcf60e6edc0c996f5), +W64LIT(0x5dc4e39d7d2caaac), +W64LIT(0x11499af1928d999e), +W64LIT(0x5fd31a7753f4b8c4), +W64LIT(0x01f18675176c0934), +W64LIT(0xc52b1145569bccc8), +W64LIT(0x9f278a664e4659e8), +W64LIT(0x3dbeab6f897520ba), +W64LIT(0xa2992109c7337952), +W64LIT(0x9b098d4712037d38), +W64LIT(0xc9591826b254a04d), +W64LIT(0x3b8755a4fbe81602), +W64LIT(0xbe5334eea61d857d), +W64LIT(0x51b6eafe99e3c629), +W64LIT(0x191594b32a07d1cb), +W64LIT(0x1f2c6a78589ae773), +W64LIT(0x3fa95285a7ad32d2), +W64LIT(0x5c3565e86a40a398), +W64LIT(0xb2213d8d42d2e9f8), +W64LIT(0xefe5de103ffe4354), +W64LIT(0x4ab487a79d3c058a), +W64LIT(0xcd771f07ee11849d), +W64LIT(0xbfa2b29bb1718c49), +W64LIT(0xba7d33cffa58a1ad), +W64LIT(0x6fee3e0e2922fdcf), +W64LIT(0x64544fd3a81caec6), +W64LIT(0xd9e104a237b530e7), +W64LIT(0xf32fcbf75ed0bf7b), +W64LIT(0x3e58d4f0b0c13be6), +W64LIT(0xb418c346304fdf40), +W64LIT(0xaac52f4b7fb93107), +W64LIT(0xdc3e85f67c9c1d03), +W64LIT(0xd5930dc1d37a5c62), +W64LIT(0x0639fecb729d36b8), +W64LIT(0xc0f490111db2e12c), +W64LIT(0x7ea7a4ffbbaf6451), +W64LIT(0xf6f04aa315f9929f), +W64LIT(0x6643b63986c4bcae), +W64LIT(0x6c0841911096e693), +W64LIT(0x8425e73f4a999a4b), +W64LIT(0x7133d20366d41388), +W64LIT(0x38612a3bc25c0d5e), +W64LIT(0xb99b4c50c3ecbaf1), +W64LIT(0x1d3b93927642f51b), +W64LIT(0x7f56228aacc36d65), +W64LIT(0x9d30738c609e4b80), +W64LIT(0x48a37e4db3e417e2), +W64LIT(0x8bb191c397e2ed92), +W64LIT(0x2acecf5569658f9c), +W64LIT(0xda077b3d0e012bbb), +W64LIT(0xa55159b7a2c246de), +W64LIT(0x33db5be643625e57), +W64LIT(0x821c19f43804acf3), +W64LIT(0x3990ac4ed530046a), +W64LIT(0xd675725eeace473e), +W64LIT(0x789e5a34c93252e9), +W64LIT(0x86321ed564418823), +W64LIT(0xfa8243c0f136fe1a), +W64LIT(0xe45fafcdbec0105d), +W64LIT(0x2b3f49207e0986a8), +W64LIT(0xa92350d4460d2a5b), +W64LIT(0x1eddec0d4ff6ee47), +W64LIT(0x89a66829b93afffa), +W64LIT(0x607a48f2f4598a16), +W64LIT(0x6bc0392f7567d91f), +W64LIT(0xea3a5f4474d76eb0), +W64LIT(0x5598eddfc5a6e2f9), +W64LIT(0x4c8d796cefa13332), +W64LIT(0xf701ccd602959bab), +W64LIT(0xe2665106cc5d26e5), +}; + +const word64 SHARK::Dec::cbox[8][256] = { +/* box 0 */ +W64LIT(0xe6126af05e55aff3), +W64LIT(0x4b6c893f310b0835), +W64LIT(0xaa4c0e84ebfc8d57), +W64LIT(0xfb9b5c7bf3b3090d), +W64LIT(0x4508a6a9ccba5ce2), +W64LIT(0xe5d1d2064dc6bde9), +W64LIT(0x348343755288edde), +W64LIT(0xb684505de46b250c), +W64LIT(0xa8cede205a1e91e8), +W64LIT(0x40b89b46f9fa6acc), +W64LIT(0x8ee1ec1afab080ba), +W64LIT(0xde77d6b7408e0a45), +W64LIT(0x9a3e184c2e455802), +W64LIT(0xbe93fad23f0955ef), +W64LIT(0x3ae76ce3af39b909), +W64LIT(0xad7ee3cf6f5ea7c6), +W64LIT(0x8b51d1f5cff0b694), +W64LIT(0x70ca8d8e3c43bf99), +W64LIT(0xccdba7f8b2a8f6c9), +W64LIT(0x4c5e6474b5a922a4), +W64LIT(0x5d31adcd541ccc32), +W64LIT(0x9b7f701e8c3456a7), +W64LIT(0x2ac9cd08ecfd593a), +W64LIT(0x8fa0844858c18e1f), +W64LIT(0x32f0c66c745bc9ea), +W64LIT(0xc58d6525cbbb888f), +W64LIT(0x8c633cbe4b529c05), +W64LIT(0xf2cd9ea68aa0774b), +W64LIT(0x2cba4811ca2e7d0e), +W64LIT(0xe2e33f4dc9649778), +W64LIT(0xf4be1bbfac73537f), +W64LIT(0x22de6787379f29d9), +W64LIT(0x0956c2dd79137e46), +W64LIT(0xe061efe978868bc7), +W64LIT(0x1cc85ed90f97a85b), +W64LIT(0x31337e9a67c8dbf0), +W64LIT(0x360193d1e36af161), +W64LIT(0x7fefca4a6383e5eb), +W64LIT(0x8535fe633241e243), +W64LIT(0xc3fee03ced68acbb), +W64LIT(0x81c4abdea570dac8), +W64LIT(0x67d6c12efb25753b), +W64LIT(0xa4282112164dd980), +W64LIT(0xcf181f0ea13be4d3), +W64LIT(0xa98fb672f86f9f4d), +W64LIT(0x5c70c59ff66dc297), +W64LIT(0xb0f7d544c2b80138), +W64LIT(0x0da79760ee2246cd), +W64LIT(0x3740fb83411bffc4), +W64LIT(0x24ade29e114c0ded), +W64LIT(0xf858e48de0201b17), +W64LIT(0x0e642f96fdb154d7), +W64LIT(0xddb46e41531d185f), +W64LIT(0x25ec8accb33d0348), +W64LIT(0x0282d0a4b1e21cbf), +W64LIT(0x1bfab3928b3582ca), +W64LIT(0xaffc336bdebcbb79), +W64LIT(0x35c22b27f0f9e37b), +W64LIT(0x03c3b8f61393121a), +W64LIT(0xb8e07fcb19da71db), +W64LIT(0x99fda0ba3dd64a18), +W64LIT(0xce59775c034aea76), +W64LIT(0x49ee599b80e9148a), +W64LIT(0xfe2b6194c6f33f23), +W64LIT(0x4edcb4d0044b3e1b), +W64LIT(0xd5a3c4ce887f68bc), +W64LIT(0xdf36bee5e2ff04e0), +W64LIT(0x171c4ca0c766caa2), +W64LIT(0x0bd41279c8f162f9), +W64LIT(0xe490ba54efb7b34c), +W64LIT(0x5b4228d472cfe806), +W64LIT(0x5355825ba9ad98e5), +W64LIT(0x9f8e25a31b056e2c), +W64LIT(0xcd9acfaa10d9f86c), +W64LIT(0x88926903dc63a48e), +W64LIT(0xb40680f9558939b3), +W64LIT(0x239f0fd595ee277c), +W64LIT(0xec8710db34d5c3af), +W64LIT(0x87b72ec783a3fefc), +W64LIT(0x632794936c144db0), +W64LIT(0x46cb1e5fdf294ef8), +W64LIT(0x83467b7a1492c677), +W64LIT(0x9c4d9d5508967c36), +W64LIT(0xd6607c389bec7aa6), +W64LIT(0x165d24f26517c407), +W64LIT(0xc4cc0d7769ca862a), +W64LIT(0xcbe94ab3360adc58), +W64LIT(0x847496319030ece6), +W64LIT(0x7a5ff7a556c3d3c5), +W64LIT(0xc03d58cafefbbea1), +W64LIT(0x76b908971a909bad), +W64LIT(0x2f79f0e7d9bd6f14), +W64LIT(0x197863363ad79e75), +W64LIT(0xda86830ad7bf32ce), +W64LIT(0x5a034086d0bee6a3), +W64LIT(0x97998f2cc0671ecf), +W64LIT(0x552607428f7ebcd1), +W64LIT(0x51d752ff184f845a), +W64LIT(0xbb23c73d0a4963c1), +W64LIT(0x2b88a55a4e8c579f), +W64LIT(0xd80453ae665d2e71), +W64LIT(0xee05c07f8537df10), +W64LIT(0x423a4be248187673), +W64LIT(0xcaa822e1947bd2fd), +W64LIT(0x1abbdbc029448c6f), +W64LIT(0x96d8e77e6216106a), +W64LIT(0x6266fcc1ce654315), +W64LIT(0x89d301517e12aa2b), +W64LIT(0x730935782fd0ad83), +W64LIT(0x8085c38c0701d46d), +W64LIT(0x6b303e1cb7763d53), +W64LIT(0x3f57510c9a798f27), +W64LIT(0x4449cefb6ecb5247), +W64LIT(0x48af31c922981a2f), +W64LIT(0x98bcc8e89fa744bd), +W64LIT(0x69b2eeb8069421ec), +W64LIT(0xebb5fd90b077e93e), +W64LIT(0x6a71564e150733f6), +W64LIT(0x116fc9b9e1b5ee96), +W64LIT(0x4a2de16d937a0690), +W64LIT(0xb9a11799bbab7f7e), +W64LIT(0x9368da9157562644), +W64LIT(0x718be5dc9e32b13c), +W64LIT(0xc82af2452599ce42), +W64LIT(0xb547e8abf7f83716), +W64LIT(0x33b1ae3ed62ac74f), +W64LIT(0x799c4f534550c1df), +W64LIT(0x3e16395e38088182), +W64LIT(0x7c2c72bc7010f7f1), +W64LIT(0xf38cf6f428d179ee), +W64LIT(0xd29129850cdd422d), +W64LIT(0x41f9f3145b8b6469), +W64LIT(0x945a37dad3f40cd5), +W64LIT(0x757ab061090389b7), +W64LIT(0x6554118a4ac76984), +W64LIT(0x7d6d1aeed261f954), +W64LIT(0x01416852a2710ea5), +W64LIT(0xb27505e0735a1d87), +W64LIT(0x77f860c5b8e19508), +W64LIT(0x78dd2701e721cf7a), +W64LIT(0xe12087bbdaf78562), +W64LIT(0x86f6469521d2f059), +W64LIT(0xef44a82d2746d1b5), +W64LIT(0xbc112a768eeb4950), +W64LIT(0xc2bf886e4f19a21e), +W64LIT(0x307216c8c5b9d555), +W64LIT(0xc96b9a1787e8c0e7), +W64LIT(0xa31acc5992eff311), +W64LIT(0xa0d974af817ce10b), +W64LIT(0xdcf50613f16c16fa), +W64LIT(0xfca9b1307711239c), +W64LIT(0x57a4d7e63e9ca06e), +W64LIT(0xc64eddd3d8289a95), +W64LIT(0xa25ba40b309efdb4), +W64LIT(0x2e3898b57bcc61b1), +W64LIT(0xf5ff73ed0e025dda), +W64LIT(0xa6aaf1b6a7afc53f), +W64LIT(0xd9453bfcc42c20d4), +W64LIT(0x9d0cf507aae77293), +W64LIT(0x290a75feff6e4b20), +W64LIT(0xa7eb99e405decb9a), +W64LIT(0xa1981cfd230defae), +W64LIT(0x12ac714ff226fc8c), +W64LIT(0x743bd833ab728712), +W64LIT(0x6c02d35733d417c2), +W64LIT(0xe9372d340195f581), +W64LIT(0xf77da349bfe04165), +W64LIT(0x68f386eaa4e52f49), +W64LIT(0x211ddf71240c3bc3), +W64LIT(0x13ed191d5057f229), +W64LIT(0xe8764566a3e4fb24), +W64LIT(0xf9198cdf425115b2), +W64LIT(0xd013f921bd3f5e92), +W64LIT(0x91ea0a35e6b43afb), +W64LIT(0x0732ed4b84a22a91), +W64LIT(0xeaf495c21206e79b), +W64LIT(0x5214ea090bdc9640), +W64LIT(0x0000000000000000), +W64LIT(0xb3346db2d12b1322), +W64LIT(0x0ce6ff324c534868), +W64LIT(0xaebd5b397ccdb5dc), +W64LIT(0x0a957a2b6a806c5c), +W64LIT(0x1f0be62f1c04ba41), +W64LIT(0x14dff456d4f5d8b8), +W64LIT(0x58819022615cfa1c), +W64LIT(0x05b03def3540362e), +W64LIT(0xe3a2571f6b1599dd), +W64LIT(0x9229b2c3f52728e1), +W64LIT(0xba62af6fa8386d64), +W64LIT(0x0673851926d32434), +W64LIT(0x641579d8e8b66721), +W64LIT(0x04f155bd9731388b), +W64LIT(0x9ecf4df1b9746089), +W64LIT(0x205cb723867d3566), +W64LIT(0x102ea1eb43c4e033), +W64LIT(0x3ba604b10d48b7ac), +W64LIT(0x50963aadba3e8aff), +W64LIT(0xac3f8b9dcd2fa963), +W64LIT(0x7b1e9ff7f4b2dd60), +W64LIT(0xf63ccb1b1d914fc0), +W64LIT(0x7eaea218c1f2eb4e), +W64LIT(0x5fb37d69e5fed08d), +W64LIT(0x56e5bfb49cedaecb), +W64LIT(0x2dfb2043685f73ab), +W64LIT(0x61a54437ddf6510f), +W64LIT(0x6fc16ba1204705d8), +W64LIT(0xe75302a2fc24a156), +W64LIT(0x3dd581a82b9b9398), +W64LIT(0xdbc7eb5875ce3c6b), +W64LIT(0x90ab626744c5345e), +W64LIT(0x59c0f870c32df4b9), +W64LIT(0x6697a97c59547b9e), +W64LIT(0xfde8d962d5602d39), +W64LIT(0xd3d041d7aeac4c88), +W64LIT(0x5ef2153b478fde28), +W64LIT(0xd4e2ac9c2a0e6619), +W64LIT(0x1e4a8e7dbe75b4e4), +W64LIT(0x72485d2a8da1a326), +W64LIT(0x437b23b0ea6978d6), +W64LIT(0x159e9c047684d61d), +W64LIT(0x0f2547c45fc05a72), +W64LIT(0xf10e265099336551), +W64LIT(0x3c94e9fa89ea9d3d), +W64LIT(0xbfd292809d785b4a), +W64LIT(0x0817aa8fdb6270e3), +W64LIT(0x60e42c657f875faa), +W64LIT(0x18390b6498a690d0), +W64LIT(0x478a760d7d58405d), +W64LIT(0x284b1dac5d1f4585), +W64LIT(0xb1b6bd1660c90f9d), +W64LIT(0xd15291731f4e5037), +W64LIT(0x4d1f0c2617d82c01), +W64LIT(0xc70fb5817a599430), +W64LIT(0x6d43bb0591a51967), +W64LIT(0x6e8003f382360b7d), +W64LIT(0x1d89368bade6a6fe), +W64LIT(0x4f9ddc82a63a30be), +W64LIT(0xedc6788996a4cd0a), +W64LIT(0xab0d66d6498d83f2), +W64LIT(0x54676f102d0fb274), +W64LIT(0xc17c30985c8ab004), +W64LIT(0x3865bc471edba5b6), +W64LIT(0x3924d415bcaaab13), +W64LIT(0x951b5f8871850270), +W64LIT(0x8a10b9a76d81b831), +W64LIT(0xbd5042242c9a47f5), +W64LIT(0xa5694940b43cd725), +W64LIT(0xff6a09c664823186), +W64LIT(0x8d2254ece92392a0), +W64LIT(0xb7c5380f461a2ba9), +W64LIT(0x82071328b6e3c8d2), +W64LIT(0xd721146a399d7403), +W64LIT(0xfada342951c207a8), +W64LIT(0x262f323aa0ae1152), +W64LIT(0xf04f4e023b426bf4), +W64LIT(0x276e5a6802df1ff7), +/* box 1 */ +W64LIT(0x3b4016dbfd16e203), +W64LIT(0x9a7574c51174530a), +W64LIT(0x90012e69c02ec8d3), +W64LIT(0xf44580e3d780e076), +W64LIT(0xf81dec2b49eca14b), +W64LIT(0x26cae3e8a6e3d7ef), +W64LIT(0x0962419e0c41f6ab), +W64LIT(0x54d1eb4070ebd951), +W64LIT(0x865e884b0188eec8), +W64LIT(0xdf76067ea406fe8a), +W64LIT(0x29849412e594fba0), +W64LIT(0x461569896869c0f2), +W64LIT(0xb5ddd6b3bbd6724e), +W64LIT(0x0c586cc89e6c413d), +W64LIT(0x6b0ad97054d904ea), +W64LIT(0xa135621eec62b109), +W64LIT(0x0eef7e47087ea461), +W64LIT(0xfaaafea4dffe4417), +W64LIT(0xe0ad344e80342331), +W64LIT(0xab4138b23d382ad0), +W64LIT(0x107390468e90fcff), +W64LIT(0xbe0885a2218561b9), +W64LIT(0xdbed22957d22c132), +W64LIT(0x2251c7037fc7e857), +W64LIT(0x33835ef8ba5e9c86), +W64LIT(0xb3f1e0d7f4e0a8aa), +W64LIT(0x3fdb32302432ddbb), +W64LIT(0xa719547aa3546bed), +W64LIT(0xe10c3df3cb3dab1f), +W64LIT(0x17feaf9f8aafae35), +W64LIT(0x9df84b1c154b01c0), +W64LIT(0x8364a51d93a5595e), +W64LIT(0x535cd49974d48b9b), +W64LIT(0x01a109bd4b09882e), +W64LIT(0xc4d0c529b0c51182), +W64LIT(0x2e09abcbe1aba96a), +W64LIT(0x1f3de7bccde7d0b0), +W64LIT(0x9317355b1d35a5a1), +W64LIT(0x6c87e6a950e65620), +W64LIT(0x8910ffb142ffc287), +W64LIT(0x40395fed275f1a16), +W64LIT(0x7b794936da49f815), +W64LIT(0xf269b68798b63a92), +W64LIT(0xfd27c17ddbc116dd), +W64LIT(0x8d8bdb5a9bdbfd3f), +W64LIT(0x1ba6c35714c3ef08), +W64LIT(0x6e30f426c6f4b37c), +W64LIT(0x7fe26ddd036dc7ad), +W64LIT(0x14e8b4ad57b4c347), +W64LIT(0xb985ba7b25ba3373), +W64LIT(0xe9cf75d08c75d59a), +W64LIT(0x626898ee5898f241), +W64LIT(0x5b9f9cba339cf51e), +W64LIT(0xb250e96abfe92084), +W64LIT(0x165fa622c1a6261b), +W64LIT(0xf5e4895e9c896858), +W64LIT(0xb76ac43c2dc49712), +W64LIT(0x02b7128f9612e55c), +W64LIT(0x1d8af5335bf535ec), +W64LIT(0x36b973ae28732b10), +W64LIT(0xa8572380e02347a2), +W64LIT(0xf6f2926c4192052a), +W64LIT(0x8c2ad2e7d0d27511), +W64LIT(0xd32e6ab63a6abfb7), +W64LIT(0xbd1e9e90fc9e0ccb), +W64LIT(0x03161b32dd1b6d72), +W64LIT(0x4dc03a98f23ad305), +W64LIT(0x81d3b79205b7bc02), +W64LIT(0x450372bbb572ad80), +W64LIT(0x2d1fb0f93cb0c418), +W64LIT(0x2a928f20388f96d2), +W64LIT(0x721b08a8d6080ebe), +W64LIT(0x92b63ce6563c2d8f), +W64LIT(0xeb78675f1a6730c6), +W64LIT(0x13658b74538b918d), +W64LIT(0x428e4d62b14dff4a), +W64LIT(0x88b1f60c09f64aa9), +W64LIT(0x75963771d2375c74), +W64LIT(0x7ad8408b9140703b), +W64LIT(0x57c7f072adf0b423), +W64LIT(0xe5971918121994a7), +W64LIT(0x5666f9cfe6f93c0d), +W64LIT(0x8f3cc9d50dc91863), +W64LIT(0x1e9cee0186ee589e), +W64LIT(0x8a06e4839fe4aff5), +W64LIT(0xb824b3c66eb3bb5d), +W64LIT(0xd1997839ac785aeb), +W64LIT(0x6752b5b8cab545d7), +W64LIT(0xb47cdf0ef0dffa60), +W64LIT(0x949a0a82190af76b), +W64LIT(0xc04be1c269e12e3a), +W64LIT(0xfc86c8c090c89ef3), +W64LIT(0xe3bb2f7c5d2f4e43), +W64LIT(0x6aabd0cd1fd08cc4), +W64LIT(0x2147dc31a2dc8525), +W64LIT(0xca3fbb6eb8bbb5e3), +W64LIT(0x48fa17ce60176493), +W64LIT(0x6444ae8a17ae28a5), +W64LIT(0x2b33869d73861efc), +W64LIT(0xd0387184e771d2c5), +W64LIT(0x7cf476efde76aadf), +W64LIT(0x63c9915313917a6f), +W64LIT(0xc929a05c65a0d891), +W64LIT(0xda4c2b28362b491c), +W64LIT(0xfe31da4f06da7baf), +W64LIT(0xc1eae87f22e8a614), +W64LIT(0x5c12a36337a3a7d4), +W64LIT(0x18b0d865c9d8827a), +W64LIT(0xe7200b97840b71fb), +W64LIT(0x4bec0cfcbd0c09e1), +W64LIT(0x0f4e77fa43772c4f), +W64LIT(0x4c613325b9335b2b), +W64LIT(0xf3c8bf3ad3bfb2bc), +W64LIT(0x87ff81f64a8166e6), +W64LIT(0xa38270917a705455), +W64LIT(0x1911d1d882d10a54), +W64LIT(0x44a27b06fe7b25ae), +W64LIT(0x049b24ebd9243fb8), +W64LIT(0xbb32a8f4b3a8d62f), +W64LIT(0x91a027d48b2740fd), +W64LIT(0x3d6c20bfb22038e7), +W64LIT(0xe681022acf02f9d5), +W64LIT(0xf17fadb545ad57e0), +W64LIT(0xcc138d0af78d6f07), +W64LIT(0x495b1e732b1eecbd), +W64LIT(0x38560de9200d8f71), +W64LIT(0xa9f62a3dab2acf8c), +W64LIT(0x47b46034236048dc), +W64LIT(0x8e9dc06846c0904d), +W64LIT(0xaccc076b3907781a), +W64LIT(0x32225745f15714a8), +W64LIT(0xd4a3556f3e55ed7d), +W64LIT(0xd7b54e5de34e800f), +W64LIT(0xddc114f132141bd6), +W64LIT(0x6d26ef141befde0e), +W64LIT(0x85489379dc9383ba), +W64LIT(0x0bd553119a5313f7), +W64LIT(0x786f520407529567), +W64LIT(0xcb9eb2d3f3b23dcd), +W64LIT(0xa223792c3179dc7b), +W64LIT(0x0a745aacd15a9bd9), +W64LIT(0x710d139a0b1363cc), +W64LIT(0x681cc24289c26998), +W64LIT(0x1a07caea5fca6726), +W64LIT(0x82c5aca0d8acd170), +W64LIT(0x25dcf8da7bf8ba9d), +W64LIT(0xc7c6de1b6dde7cf0), +W64LIT(0xc35dfaf0b4fa4348), +W64LIT(0xded70fc3ef0f76a4), +W64LIT(0x504acfaba9cfe6e9), +W64LIT(0xc571cc94fbcc99ac), +W64LIT(0x5ea5b1eca1b14288), +W64LIT(0xae7b15e4af159d46), +W64LIT(0xc888a9e12ea950bf), +W64LIT(0xf7539bd10a9b8d04), +W64LIT(0x962d180d8f181237), +W64LIT(0xe43610a559101c89), +W64LIT(0x772125fe4425b928), +W64LIT(0x84e99ac4979a0b94), +W64LIT(0xc667d7a626d7f4de), +W64LIT(0xefe343b4c3430f7e), +W64LIT(0xd5025cd2755c6553), +W64LIT(0xa6b85dc7e85de3c3), +W64LIT(0xd61447e0a8470821), +W64LIT(0x3e7a3b8d6f3b5595), +W64LIT(0x52fddd243fdd03b5), +W64LIT(0x8072be2f4ebe342c), +W64LIT(0x12c482c9188219a3), +W64LIT(0x9eee502ec8506cb2), +W64LIT(0xad6d0ed6720ef034), +W64LIT(0x59288e35a58e1042), +W64LIT(0xe21a26c11626c66d), +W64LIT(0x247df16730f132b3), +W64LIT(0xf0dea4080ea4dfce), +W64LIT(0x31344c772c4c79da), +W64LIT(0x4f77281764283659), +W64LIT(0x79ce5bb94c5b1d49), +W64LIT(0x0000000000000000), +W64LIT(0x73ba01159d018690), +W64LIT(0x74373ecc993ed45a), +W64LIT(0xbcbf972db79784e5), +W64LIT(0x4ed621aa2f21be77), +W64LIT(0xd95a301aeb30246e), +W64LIT(0x9c5942a15e4289ee), +W64LIT(0x37187a13637aa33e), +W64LIT(0x276bea55edea5fc1), +W64LIT(0x1c2bfc8e10fcbdc2), +W64LIT(0xed54513b5551ea22), +W64LIT(0x20e6d58ce9d50d0b), +W64LIT(0x3ae11f66b61f6a2d), +W64LIT(0x66f3bc0581bccdf9), +W64LIT(0x2cbeb94477b94c36), +W64LIT(0x99636ff7cc6f3e78), +W64LIT(0x953b033f52037f45), +W64LIT(0xb0e7fbe529fbc5d8), +W64LIT(0x60df8a61ce8a171d), +W64LIT(0x6f91fd9b8dfd3b52), +W64LIT(0xaae0310f7631a2fe), +W64LIT(0xbfa98c1f6a8ce997), +W64LIT(0x8ba7ed3ed4ed27db), +W64LIT(0x98c2664a8766b656), +W64LIT(0x062c36644f36dae4), +W64LIT(0x5570e2fd3be2517f), +W64LIT(0xead96ee2516eb8e8), +W64LIT(0x419856506c569238), +W64LIT(0x23f0cebe34ce6079), +W64LIT(0x309545ca6745f1f4), +W64LIT(0x5a3e950778957d30), +W64LIT(0x617e83dc85839f33), +W64LIT(0xfb0bf71994f7cc39), +W64LIT(0x3ccd2902f929b0c9), +W64LIT(0x70ac1a27401aebe2), +W64LIT(0xcea49f85619f8a5b), +W64LIT(0x39f704546b04075f), +W64LIT(0x0df96575d565c913), +W64LIT(0x08c3482347487e85), +W64LIT(0xd28f630b71633799), +W64LIT(0xecf558861e58620c), +W64LIT(0xc2fcf34dfff3cb66), +W64LIT(0x978c11b0c4119a19), +W64LIT(0x69bdcbffc2cbe1b6), +W64LIT(0xba93a149f8a15e01), +W64LIT(0x51ebc616e2c66ec7), +W64LIT(0x078d3fd9043f52ca), +W64LIT(0x58898788ee87986c), +W64LIT(0x4a4d0541f60581cf), +W64LIT(0xe86e7c6dc77c5db4), +W64LIT(0xee424a09884a8750), +W64LIT(0xcdb284b7bc84e729), +W64LIT(0x65e5a7375ca7a08b), +W64LIT(0x2fa8a276aaa22144), +W64LIT(0xa0946ba3a76b3927), +W64LIT(0xa5ae46f535468eb1), +W64LIT(0x35af689cf5684662), +W64LIT(0x28259dafae9d738e), +W64LIT(0xcf0596382a960275), +W64LIT(0xb6cbcd8166cd1f3c), +W64LIT(0x7e43646048644f83), +W64LIT(0x9bd47d785a7ddb24), +W64LIT(0x432f44dffa447764), +W64LIT(0x9f4f59938359e49c), +W64LIT(0x7d557f52957f22f1), +W64LIT(0x76802c430f2c3106), +W64LIT(0xdc601d4c791d93f8), +W64LIT(0x053a2d56922db796), +W64LIT(0x11d299fbc59974d1), +W64LIT(0xf9bce59602e52965), +W64LIT(0xd8fb39a7a039ac40), +W64LIT(0x340e6121be61ce4c), +W64LIT(0x5f04b851eab8caa6), +W64LIT(0x5db3aade7caa2ffa), +W64LIT(0x1549bd101cbd4b69), +W64LIT(0xff90d3f24dd3f381), +W64LIT(0xafda1c59e41c1568), +W64LIT(0xb146f25862f24df6), +W64LIT(0xa40f4f487e4f069f), +/* box 2 */ +W64LIT(0xa1a35cebf8f0f94c), +W64LIT(0x2c203d650f3f095d), +W64LIT(0x1a2bdaee4084a2a7), +W64LIT(0xd32404574d7bcc68), +W64LIT(0xf785bea594a9adc4), +W64LIT(0xf2eb54456206949c), +W64LIT(0x3f5e334d0475ced1), +W64LIT(0x5994299b835d1f60), +W64LIT(0x785b7989ac204794), +W64LIT(0x025da6a2cf461a41), +W64LIT(0xdf1f3a71f01a901b), +W64LIT(0x27284f018bb77637), +W64LIT(0xe1955a6d694c5310), +W64LIT(0x24a1baf2d9d261ac), +W64LIT(0xe4fbb08d9fe36a48), +W64LIT(0x8d83618ef7cff011), +W64LIT(0x2ac72276abf5279e), +W64LIT(0xf9e32621e68eebf6), +W64LIT(0xbf323fb4d3f86f69), +W64LIT(0xbb888605b8745beb), +W64LIT(0x70dafe1e7acd2f65), +W64LIT(0xd0adf1a41f1edbf3), +W64LIT(0x1e91635f2b089625), +W64LIT(0xee2791b8864818f8), +W64LIT(0x99ce23e4c56c1484), +W64LIT(0xf33f0714ff259946), +W64LIT(0xbd6f99161cbe7528), +W64LIT(0x9f293cf761a63a47), +W64LIT(0xb80173f6ea114c70), +W64LIT(0x6543ef25d54dc62a), +W64LIT(0x39b92c5ea0bfe012), +W64LIT(0x63a4f0367187e8e9), +W64LIT(0x4c0d38a02cddf62f), +W64LIT(0x07334c4239e92319), +W64LIT(0x43bff375c3d9bdc7), +W64LIT(0xca862b4a5f9a7954), +W64LIT(0x5d2e902ae8d12be2), +W64LIT(0x137e0e280b4ac78c), +W64LIT(0xf162a1b630638307), +W64LIT(0x55af17bd3e3c4313), +W64LIT(0x358212781ddebc61), +W64LIT(0x94214e93e52e452d), +W64LIT(0xc18e592edb12063e), +W64LIT(0xec7a371a490e02b9), +W64LIT(0x4963d240da72cf77), +W64LIT(0x41e255d70c9fa786), +W64LIT(0xff0439324244c535), +W64LIT(0x88ed8b6e0160c949), +W64LIT(0x6c163be39e83a301), +W64LIT(0xc534e09fb09e32bc), +W64LIT(0x806c0cf9d78da1b8), +W64LIT(0xdba583c09b96a499), +W64LIT(0x746047af11411be7), +W64LIT(0xf40c4b56c6ccba5f), +W64LIT(0x6270a367eca4e533), +W64LIT(0xd41748157492ef71), +W64LIT(0xeff3c2e91b6b1522), +W64LIT(0x0e66988472274632), +W64LIT(0x534808ae9af66dd0), +W64LIT(0x8231aa5b18cbbbf9), +W64LIT(0xb2dd52c3f3ba3ec0), +W64LIT(0xdd429cd33f5c8a5a), +W64LIT(0x4e509e02e39bec6e), +W64LIT(0x26fc1c5016947bed), +W64LIT(0xd9f8256254d0bed8), +W64LIT(0x0955d4c64bce652b), +W64LIT(0x1610e4c8fde5fed4), +W64LIT(0x6dc268b203a0aedb), +W64LIT(0x2e7d9bc7c079131c), +W64LIT(0xc3d3ff8c14541c7f), +W64LIT(0xd64aeeb7bbd4f530), +W64LIT(0xab7f7ddee15b8bfc), +W64LIT(0x144d426a32a3e495), +W64LIT(0x8e0a947da5aae78a), +W64LIT(0x798f2ad831034a4e), +W64LIT(0x3be48afc6ff9fa53), +W64LIT(0x529c5bff07d5600a), +W64LIT(0xbee66ce54edb62b3), +W64LIT(0x931202d1dcc76634), +W64LIT(0x50c1fd5dc8937a4b), +W64LIT(0xa4cdb60b0e5fc014), +W64LIT(0x57f2b11ff17a5952), +W64LIT(0x47054ac4a8558945), +W64LIT(0x5a1ddc68d13808fb), +W64LIT(0x5cfac37b75f22638), +W64LIT(0xc207acdd897711a5), +W64LIT(0x289a84d464b33ddf), +W64LIT(0xc05a0a7f46310be4), +W64LIT(0xe6a6162f50a57009), +W64LIT(0x06e71f13a4ca2ec3), +W64LIT(0x5f733688279731a3), +W64LIT(0xeb497b5870e721a0), +W64LIT(0xb667eb7298360a42), +W64LIT(0xe3c8fccfa60a4951), +W64LIT(0xe772457ecd867dd3), +W64LIT(0x6978d103682c9a59), +W64LIT(0x0def6d77204251a9), +W64LIT(0xc90fdeb90dff6ecf), +W64LIT(0xd179a2f5823dd629), +W64LIT(0x2fa9c8965d5a1ec6), +W64LIT(0x81b85fa84aaeac62), +W64LIT(0xdc96cf82a27f8780), +W64LIT(0x602d05c523e2ff72), +W64LIT(0x19a22f1d12e1b53c), +W64LIT(0xe52fe3dc02c06792), +W64LIT(0x58407aca1e7e12ba), +W64LIT(0x61f95694bec1f2a8), +W64LIT(0x48b781114751c2ad), +W64LIT(0xaaab2e8f7c788626), +W64LIT(0x04bab9b16b8c3482), +W64LIT(0x2df46e34921c0487), +W64LIT(0x1123a88ac40cddcd), +W64LIT(0xc6bd156ce2fb2527), +W64LIT(0x7f6835cb95c9648d), +W64LIT(0x83e5f90a85e8b623), +W64LIT(0x4f84cd537eb8e1b4), +W64LIT(0x294ed785f9903005), +W64LIT(0x1cccc5fde44e8c64), +W64LIT(0xcb52781bc2b9748e), +W64LIT(0x1d1896ac796d81be), +W64LIT(0xb30901926e99331a), +W64LIT(0xad9862cd4591a53f), +W64LIT(0xc8db8de890dc6315), +W64LIT(0x7bd28c7afe45500f), +W64LIT(0x0adc213519ab72b0), +W64LIT(0xa8f6882db33e9c67), +W64LIT(0xb5ee1e81ca531dd9), +W64LIT(0x201b0343b25e552e), +W64LIT(0x4036068691bcaa5c), +W64LIT(0xae11973e17f4b2a4), +W64LIT(0x9efd6fa6fc85379d), +W64LIT(0x33650d6bb91492a2), +W64LIT(0x3a30d9adf2daf789), +W64LIT(0x0c3b3e26bd615c73), +W64LIT(0xf651edf4098aa01e), +W64LIT(0x710ead4fe7ee22bf), +W64LIT(0x3138abc9765288e3), +W64LIT(0x9d749a55aee02006), +W64LIT(0x6e4b9d4151c5b940), +W64LIT(0x84d6b548bc01953a), +W64LIT(0x360be78b4fbbabfa), +W64LIT(0xa22aa918aa95eed7), +W64LIT(0xedae644bd42d0f63), +W64LIT(0x46d119953576849f), +W64LIT(0x6497bc74486ecbf0), +W64LIT(0xfbbe808329c8f1b7), +W64LIT(0x4aea27b38817d8ec), +W64LIT(0x5626e24e6c595488), +W64LIT(0x056eeae0f6af3958), +W64LIT(0x4558ec6667139304), +W64LIT(0x448cbf37fa309ede), +W64LIT(0x6f9fce10cce6b49a), +W64LIT(0xa0770fba65d3f496), +W64LIT(0x671e49871a0bdc6b), +W64LIT(0xda71d09106b5a943), +W64LIT(0x08818797d6ed68f1), +W64LIT(0xa3fefa4937b6e30d), +W64LIT(0xb080f4613cfc2481), +W64LIT(0x763de10dde0701a6), +W64LIT(0x4dd96bf1b1fefbf5), +W64LIT(0x92c6518041e46bee), +W64LIT(0x3456412980fdb1bb), +W64LIT(0x981a70b5584f195e), +W64LIT(0x3d0395efcb33d490), +W64LIT(0xba5cd55425575631), +W64LIT(0x4b3e74e21534d536), +W64LIT(0x6af124f03a498dc2), +W64LIT(0x7ebc669a08ea6957), +W64LIT(0x30ecf898eb718539), +W64LIT(0xa922db7c2e1d91bd), +W64LIT(0x7a06df2b63665dd5), +W64LIT(0xb154a730a1df295b), +W64LIT(0xfc8dccc11021d2ae), +W64LIT(0xcfe8c1aaa935400c), +W64LIT(0x97a8bb60b74b52b6), +W64LIT(0x18767c4c8fc2b8e6), +W64LIT(0x9a47d6179709031f), +W64LIT(0x0000000000000000), +W64LIT(0xac4c319cd8b2a8e5), +W64LIT(0xb9d520a7773241aa), +W64LIT(0xdecb69206d399dc1), +W64LIT(0x1f45300eb62b9bff), +W64LIT(0x10f7fbdb592fd017), +W64LIT(0x3e8a601c9956c30b), +W64LIT(0x8502e619212298e0), +W64LIT(0xf5d818075befb785), +W64LIT(0x547b44eca31f4ec9), +W64LIT(0x9ca0c90433c32ddc), +W64LIT(0xe041093cf46f5eca), +W64LIT(0xa69010a9c119da55), +W64LIT(0xc769463d7fd828fd), +W64LIT(0xc4e0b3ce2dbd3f66), +W64LIT(0x2575e9a344f16c76), +W64LIT(0x01d453519d230dda), +W64LIT(0xfa6ad3d2b4ebfc6d), +W64LIT(0xd5c31b44e9b1e2ab), +W64LIT(0xf83775707bade62c), +W64LIT(0xbcbbca47819d78f2), +W64LIT(0xd79ebde626f7f8ea), +W64LIT(0x5bc98f394c1b0521), +W64LIT(0x2246a5e17d184f6f), +W64LIT(0x12aa5d799669ca56), +W64LIT(0x5ea765d9bab43c79), +W64LIT(0x8939d83f9c43c493), +W64LIT(0x32b15e3a24379f78), +W64LIT(0xe914ddfabfa13be1), +W64LIT(0x909bf7228ea271af), +W64LIT(0x73530bed28a838fe), +W64LIT(0xd2f05706d058c1b2), +W64LIT(0xfed06a63df67c8ef), +W64LIT(0xb43a4dd057701003), +W64LIT(0xa519e55a937ccdce), +W64LIT(0x75b414fe8c62163d), +W64LIT(0xafc5c46f8ad7bf7e), +W64LIT(0x2392f6b0e03b42b5), +W64LIT(0x386d7f0f3d9cedc8), +W64LIT(0x21cf50122f7d58f4), +W64LIT(0x9b9385460a2a0ec5), +W64LIT(0x5115ae0c55b07791), +W64LIT(0x0fb2cbd5ef044be8), +W64LIT(0xea9d2809edc42c7a), +W64LIT(0xcc613459fb505797), +W64LIT(0x426ba0245efab01d), +W64LIT(0x1599113baf80e94f), +W64LIT(0x7d3593695a8f7ecc), +W64LIT(0x0389f5f35265179b), +W64LIT(0x875f40bbee6482a1), +W64LIT(0x95f51dc2780d48f7), +W64LIT(0x7ce1c038c7ac7316), +W64LIT(0xce3c92fb34164dd6), +W64LIT(0xcdb5670866735a4d), +W64LIT(0x8ab02dccce26d308), +W64LIT(0x914fa47313817c75), +W64LIT(0x8b647e9d5305ded2), +W64LIT(0xd82c7633c9f3b302), +W64LIT(0x728758bcb58b3524), +W64LIT(0xe8c08eab2282363b), +W64LIT(0x8fdec72c3889ea50), +W64LIT(0x2b13712736d62a44), +W64LIT(0x3cd7c6be5610d94a), +W64LIT(0x37dfb4dad298a620), +W64LIT(0x868b13ea73478f7b), +W64LIT(0xb7b3b82305150798), +W64LIT(0x0b08726484887f6a), +W64LIT(0x1bff89bfdda7af7d), +W64LIT(0x77e9b25c43240c7c), +W64LIT(0xf0b6f2e7ad408edd), +W64LIT(0x17c4b79960c6f30e), +W64LIT(0x8c5732df6aecfdcb), +W64LIT(0x68ac8252f50f9783), +W64LIT(0x66ca1ad68728d1b1), +W64LIT(0x6b2577a1a76a8018), +W64LIT(0xe21caf9e3b29448b), +W64LIT(0xa74443f85c3ad78f), +W64LIT(0xfd599f908d02df74), +W64LIT(0x967ce8312a685f6c), +/* box 3 */ +W64LIT(0xfa7b9775ba3af751), +W64LIT(0x03ef98cb769c2d13), +W64LIT(0x7191ce067072359e), +W64LIT(0xbab18b6bff7516a8), +W64LIT(0xe6e5ef4efbc1065e), +W64LIT(0x7bec74a3b1d0dbf4), +W64LIT(0x656b4fb907c31c4a), +W64LIT(0x4e8520f99fc86304), +W64LIT(0x8fd8df31d16dae58), +W64LIT(0x90a93fc1e60a7244), +W64LIT(0x30ad09f2b449cfc5), +W64LIT(0x8453be7e91bb5b90), +W64LIT(0x1d68a3d1c08feaad), +W64LIT(0x5c54642504b410f6), +W64LIT(0x8061383c8a9e3707), +W64LIT(0xf9940fbecca6da42), +W64LIT(0x46e1d97da982bbdf), +W64LIT(0xfc50521656f7ad77), +W64LIT(0x5e4d2704f35c2647), +W64LIT(0x8bea5973ca48c2cf), +W64LIT(0xd06323dfa34593bd), +W64LIT(0x62b651306a7a5dce), +W64LIT(0xa436b0714966d116), +W64LIT(0x4f73fb131ebc78a6), +W64LIT(0x92b07ce011e244f5), +W64LIT(0x33429139c2d5e2d6), +W64LIT(0xcee418c515565403), +W64LIT(0xd7be3d56cefcd239), +W64LIT(0x53ed83285f4789a9), +W64LIT(0xf3e9b51b0d043428), +W64LIT(0x20650e0fd8dd8a86), +W64LIT(0xb6e7f4add21aa2e4), +W64LIT(0x6d0fb63d3189c491), +W64LIT(0x0da0a42cac1bafee), +W64LIT(0x3f14eeffefba569a), +W64LIT(0x13279f361a086850), +W64LIT(0x9b225e8ea6dc878c), +W64LIT(0x6684d772715f3159), +W64LIT(0xa3ebaef824df9092), +W64LIT(0xc499a260d4f4ba69), +W64LIT(0xaa798c9693e153eb), +W64LIT(0x50021be329dba4ba), +W64LIT(0x949bb983fd2f1ed3), +W64LIT(0xdfdac4d2f8b60ae2), +W64LIT(0xf0062dd07b98193b), +W64LIT(0xafbdd13e09b024de), +W64LIT(0xb95e13a089e93bbb), +W64LIT(0x649d945386b707e8), +W64LIT(0xe4fcac6f0c2930ef), +W64LIT(0x413cc7f4c43bfa5b), +W64LIT(0x3b2668bdf49f3a0d), +W64LIT(0xe50a77858d5d2b4d), +W64LIT(0x05c45da89a517735), +W64LIT(0x3ee235156ece4d38), +W64LIT(0xfe491137a11f9bc6), +W64LIT(0xb7112f47536eb946), +W64LIT(0x07dd1e896db94184), +W64LIT(0x1ab5bd58ad36ab29), +W64LIT(0x8197e3d60bea2ca5), +W64LIT(0xab8f577c12954849), +W64LIT(0x9cff4007cb65c608), +W64LIT(0xa00436335243bd81), +W64LIT(0xfda689fcd783b6d5), +W64LIT(0xccfd5be4e2be62b2), +W64LIT(0x75a348446b575909), +W64LIT(0x17151974012d04c7), +W64LIT(0xfb8d4c9f3b4eecf3), +W64LIT(0xac5249f57f2c09cd), +W64LIT(0x9346a70a90965f57), +W64LIT(0x043286421b256c97), +W64LIT(0x27b81086b564cb02), +W64LIT(0x3569545a2e18b8f0), +W64LIT(0x6b24735edd449eb7), +W64LIT(0x2193d5e559a99124), +W64LIT(0xc7763aaba268977a), +W64LIT(0xb0cc31ce3ed7f8c2), +W64LIT(0xc939064c78ef1587), +W64LIT(0x16e3c29e80591f65), +W64LIT(0x5da2bfcf85c00b54), +W64LIT(0x5990398d9ee567c3), +W64LIT(0x67720c98f02b2afb), +W64LIT(0x54309da132fec82d), +W64LIT(0xeab39088d6aeb212), +W64LIT(0x9682faa20ac72862), +W64LIT(0xd38cbb14d5d9beae), +W64LIT(0x4c9c63d8682055b5), +W64LIT(0xd648e6bc4f88c99b), +W64LIT(0xdc355c198e2a27f1), +W64LIT(0x10c807fd6c944543), +W64LIT(0x450e41b6df1e96cc), +W64LIT(0x0b8b614f40d6f5c8), +W64LIT(0xd27a60fe54ada50c), +W64LIT(0x49583e70f2712280), +W64LIT(0x8dc19c10268598e9), +W64LIT(0x5866e2671f917c61), +W64LIT(0x79f537824638ed45), +W64LIT(0xc2b267033839e04f), +W64LIT(0xcb20456d8f072336), +W64LIT(0x2a18b4aa197f64ec), +W64LIT(0xdbe84290e3936675), +W64LIT(0x73888d27879a032f), +W64LIT(0xe8aad3a9214684a3), +W64LIT(0x6ee02ef64715e982), +W64LIT(0xa996145de57d7ef8), +W64LIT(0xc8cfdda6f99b0e25), +W64LIT(0x062bc563eccd5a26), +W64LIT(0x264ecb6c3410d0a0), +W64LIT(0xb8a8c84a089d2019), +W64LIT(0x7dc7b1c05d1d81d2), +W64LIT(0xd5a77e773914e488), +W64LIT(0x4b417d5105991431), +W64LIT(0xf62de8b39755431d), +W64LIT(0x993b1daf5134b13d), +W64LIT(0x82787b1d7d7601b6), +W64LIT(0xe321b2e66190716b), +W64LIT(0xb5086c66a4868ff7), +W64LIT(0x9ee603263c8df0b9), +W64LIT(0x349f8fb0af6ca352), +W64LIT(0x5b897aac690d5172), +W64LIT(0x7c316a2adc699a70), +W64LIT(0xd451a59db860ff2a), +W64LIT(0x706715ecf1062e3c), +W64LIT(0x838ea0f7fc021a14), +W64LIT(0x57df056a4462e53e), +W64LIT(0xcf12c32f94224fa1), +W64LIT(0xed6e8e01bb17f396), +W64LIT(0x915fe42b677e69e6), +W64LIT(0x89f31a523da0f47e), +W64LIT(0xe71334a47ab51dfc), +W64LIT(0xa860cfb76409655a), +W64LIT(0x9f10d8ccbdf9eb1b), +W64LIT(0xef77cd204cffc527), +W64LIT(0xf862d4544dd2c1e0), +W64LIT(0x8a1c82994b3cd96d), +W64LIT(0xae4b0ad488c43f7c), +W64LIT(0x98cdc645d040aa9f), +W64LIT(0x7fdef2e1aaf5b763), +W64LIT(0x4717029728f6a07d), +W64LIT(0x745593aeea2342ab), +W64LIT(0xee8116cacd8bde85), +W64LIT(0x727e56cd06ee188d), +W64LIT(0x227c4d2e2f35bc37), +W64LIT(0x977421488bb333c0), +W64LIT(0xa21d7512a5ab8b30), +W64LIT(0xbb4750817e010d0a), +W64LIT(0x6cf96dd7b0fddf33), +W64LIT(0x2801f78bee97525d), +W64LIT(0x1c9e783b41fbf10f), +W64LIT(0x9d099bed4a11ddaa), +W64LIT(0x7a1aaf4930a4c056), +W64LIT(0x32b44ad343a1f974), +W64LIT(0x3cfb763499267b89), +W64LIT(0xb2d572efc93fce73), +W64LIT(0x63408adaeb0e466c), +W64LIT(0xada4921ffe58126f), +W64LIT(0x5fbbfcee72283de5), +W64LIT(0x6ad2a8b45c308515), +W64LIT(0x0c567fc62d6fb44c), +W64LIT(0x956d62697c5b0571), +W64LIT(0x25a153a7428cfdb3), +W64LIT(0x150c5a55f6c53276), +W64LIT(0xe2d7690ce0e46ac9), +W64LIT(0xda1e997a62e77dd7), +W64LIT(0xf5c27078e1c96e0e), +W64LIT(0xc344bce9b94dfbed), +W64LIT(0x60af12119d926b7f), +W64LIT(0xa1f2edd9d337a623), +W64LIT(0xcad69e870e733894), +W64LIT(0x3770177bd9f08e41), +W64LIT(0xa5c06b9bc812cab4), +W64LIT(0x1f71e0f03767dc1c), +W64LIT(0x44f89a5c5e6a8d6e), +W64LIT(0x6159c9fb1ce670dd), +W64LIT(0x8e2e04db5019b5fa), +W64LIT(0x8805c1b8bcd4efdc), +W64LIT(0xe138f1c7967847da), +W64LIT(0x4ab7a6bb84ed0f93), +W64LIT(0x0000000000000000), +W64LIT(0x38c9f0768203171e), +W64LIT(0x1b4366b22c42b08b), +W64LIT(0x7803ec68c74cf6e7), +W64LIT(0xec9855eb3a63e834), +W64LIT(0xbe830d29e4507a3f), +W64LIT(0x2dc5aa2374c62568), +W64LIT(0xa62ff350be8ee7a7), +W64LIT(0x764cd08f1dcb741a), +W64LIT(0x8c3747faa7f1834b), +W64LIT(0x0fb9e70d5bf3995f), +W64LIT(0x55c6464bb38ad38f), +W64LIT(0xf7db3359162158bf), +W64LIT(0xd195f8352231881f), +W64LIT(0x0992226eb73ec379), +W64LIT(0x14fa81bf77b129d4), +W64LIT(0x48aee59a73053922), +W64LIT(0x2457884dc3f8e611), +W64LIT(0xffbfcadd206b8064), +W64LIT(0xb4feb78c25f29455), +W64LIT(0x864afd5f66536d21), +W64LIT(0x6f16f51cc661f220), +W64LIT(0xde2c1f3879c21140), +W64LIT(0x195a2593dbaa863a), +W64LIT(0x2e2a32e8025a087b), +W64LIT(0x432584d533d3ccea), +W64LIT(0x2c3371c9f5b23eca), +W64LIT(0xa7d928ba3ffafc05), +W64LIT(0x42d35f3fb2a7d748), +W64LIT(0x85a5659410cf4032), +W64LIT(0x0864f984364ad8db), +W64LIT(0xf21f6ef18c702f8a), +W64LIT(0xf1f0f63afaec0299), +W64LIT(0xd9f101b1147b50c4), +W64LIT(0x2fdce902832e13d9), +W64LIT(0x4d6ab832e9544e17), +W64LIT(0xe0ce2a2d170c5c78), +W64LIT(0x51f4c009a8afbf18), +W64LIT(0x68cbeb95abd8b3a4), +W64LIT(0xc15dffc84ea5cd5c), +W64LIT(0x02194321f7e836b1), +W64LIT(0x113edc17ede05ee1), +W64LIT(0x521b58c2de33920b), +W64LIT(0x9ad4856427a89c2e), +W64LIT(0x5629de80c516fe9c), +W64LIT(0x77ba0b659cbf6fb8), +W64LIT(0x238a96c4ae41a795), +W64LIT(0x12d144dc9b7c73f2), +W64LIT(0xd807da5b950f4b66), +W64LIT(0x3686cc91588495e3), +W64LIT(0x18acfe795ade9d98), +W64LIT(0x5a7fa146e8794ad0), +W64LIT(0xc680e141231c8cd8), +W64LIT(0x1e873b1ab613c7be), +W64LIT(0xf434ab9260bd75ac), +W64LIT(0xcd0b800e63ca7910), +W64LIT(0xbc9a4e0813b84c8e), +W64LIT(0x3d0dadde1852602b), +W64LIT(0x40ca1c1e454fe1f9), +W64LIT(0x0a7dbaa5c1a2ee6a), +W64LIT(0x693d307f2aaca806), +W64LIT(0x0e4f3ce7da8782fd), +W64LIT(0xbd6c95e292cc572c), +W64LIT(0x3ad0b35775eb21af), +W64LIT(0x7e28290b2b81acc1), +W64LIT(0x01f6dbea81741ba2), +W64LIT(0x87bc26b5e7277683), +W64LIT(0x393f2b9c03770cbc), +W64LIT(0xddc387f30f5e3c53), +W64LIT(0xeb454b6257daa9b0), +W64LIT(0xb323a905484bd5d1), +W64LIT(0xb13aea24bfa3e360), +W64LIT(0x315bd218353dd467), +W64LIT(0x2bee6f40980b7f4e), +W64LIT(0xe95c0843a0329f01), +W64LIT(0xc56f798a5580a1cb), +W64LIT(0xbf75d6c36524619d), +W64LIT(0x29f72c616fe349ff), +W64LIT(0xc0ab2422cfd1d6fe), +/* box 4 */ +W64LIT(0x561fc423e957943c), +W64LIT(0x014287ca69079288), +W64LIT(0x2f086129dfcd1d21), +W64LIT(0xc537d4aea044fd99), +W64LIT(0xf1e8c3bfd7c8a457), +W64LIT(0x2971998a5cdf9bfb), +W64LIT(0x23fa649a2ce9e460), +W64LIT(0x3aa9e9c356a6716a), +W64LIT(0xd6efa4e7aa3d1708), +W64LIT(0x705a24b1fda5b5eb), +W64LIT(0x101e0ce2b170a9fc), +W64LIT(0x7ca821020e814caa), +W64LIT(0x0bc97ada1931ed13), +W64LIT(0x34df1711778c59ce), +W64LIT(0xd35020ef9226d2bf), +W64LIT(0x575d43e9805006b4), +W64LIT(0x91acebec9b1db840), +W64LIT(0x549b3f423b5945d9), +W64LIT(0x99a3ed9d3925163e), +W64LIT(0x7917a50a369a891d), +W64LIT(0xe372343cb4b6dc4e), +W64LIT(0x8d40e2bdd949e8fd), +W64LIT(0xcfbc29bed0728202), +W64LIT(0x969794857108ac12), +W64LIT(0xdd26de3db30cfa1b), +W64LIT(0x115c8b28d8773b74), +W64LIT(0xe9f9c92cc480a3d5), +W64LIT(0x4dc8b21b4116d0d3), +W64LIT(0x316093194f979c79), +W64LIT(0x5124bb4a0342806e), +W64LIT(0xb31408bcdef3cea8), +W64LIT(0xc1cad76cf158aaa6), +W64LIT(0x88ff66b5e1522d4a), +W64LIT(0xa8c37e8476b28a47), +W64LIT(0x15a188ea896b6c4b), +W64LIT(0xa24883940684f5dc), +W64LIT(0xda1da1545919ee49), +W64LIT(0x22b8e35045ee76e8), +W64LIT(0x6106af9925d28e9f), +W64LIT(0xef80318f4792250f), +W64LIT(0x663dd0f0cfc79acd), +W64LIT(0x302214d326900ef1), +W64LIT(0xdfa2255c61022bfe), +W64LIT(0xe6cdb0348cad19f9), +W64LIT(0x50663c806a4512e6), +W64LIT(0x65fbac5b74ced9a0), +W64LIT(0xc4755364c9436f11), +W64LIT(0x8fc419dc0b473918), +W64LIT(0x5c9439339961eba7), +W64LIT(0x3f166dcb6ebdb4dd), +W64LIT(0xba59890715ccf25e), +W64LIT(0xf0aa4475becf36df), +W64LIT(0x03c67cabbb09436d), +W64LIT(0xb99ff5acaec5b133), +W64LIT(0xf9e7c5ce75f00a29), +W64LIT(0x6df4aa2ad6f677de), +W64LIT(0xaeba8627f5a00c9d), +W64LIT(0xa573fcfdec91e18e), +W64LIT(0x7f6e5da9b5880fc7), +W64LIT(0xca03adb6e86947b5), +W64LIT(0x74a72773acb9e2d4), +W64LIT(0x604428534cd51c17), +W64LIT(0xf8a542041cf798a1), +W64LIT(0x448533a08a29ec25), +W64LIT(0x80f060c4436a8334), +W64LIT(0x0db082799a236bc9), +W64LIT(0xfa21b965cef94944), +W64LIT(0x64b92b911dc94b28), +W64LIT(0x7118a37b94a22763), +W64LIT(0xaff801ed9ca79e15), +W64LIT(0x1dae8e9b2b53c235), +W64LIT(0x13d870490a79ea91), +W64LIT(0x8a7b9dd4335cfcaf), +W64LIT(0x1f2a75faf95d13d0), +W64LIT(0xeec2b6452e95b787), +W64LIT(0xc34e2c0d23567b43), +W64LIT(0x47434f0b3120af48), +W64LIT(0xa18eff3fbd8db6b1), +W64LIT(0x98e16a57502284b6), +W64LIT(0x37196bbacc851aa3), +W64LIT(0x8e869e166240ab90), +W64LIT(0x9fda153eba3790e4), +W64LIT(0xf515c07d86d4f368), +W64LIT(0x72dedfd02fab640e), +W64LIT(0xe230b3f6ddb14ec6), +W64LIT(0x97d5134f180f3e9a), +W64LIT(0xe1f6cf5d66b80dab), +W64LIT(0xe78f37fee5aa8b71), +W64LIT(0xa30a045e6f836754), +W64LIT(0x90ee6c26f21a2ac8), +W64LIT(0xaa4785e5a4bc5ba2), +W64LIT(0x4e0eceb0fa1f93be), +W64LIT(0x94136fe4a3067df7), +W64LIT(0x7b935e6be49458f8), +W64LIT(0x9b2716fceb2bc7db), +W64LIT(0x840d63061276d40b), +W64LIT(0xed04caee959cf4ea), +W64LIT(0xea3fb5877f89e0b8), +W64LIT(0xb56df01f5de14872), +W64LIT(0x4935b1d9100a87ec), +W64LIT(0x82749ba5916452d1), +W64LIT(0x58693af1c87dbc98), +W64LIT(0x89bde17f8855bfc2), +W64LIT(0x677f573aa6c00845), +W64LIT(0xeb7d324d168e7230), +W64LIT(0x0284fb61d20ed1e5), +W64LIT(0xb190f3dd0cfd1f4d), +W64LIT(0x684b2e22eeedb269), +W64LIT(0x2bf562eb8ed14a1e), +W64LIT(0xe0b448970fbf9f23), +W64LIT(0x396f9568edaf3207), +W64LIT(0x52e2c7e1b84bc303), +W64LIT(0x77615bd817b0a1b9), +W64LIT(0x7e2cda63dc8f9d4f), +W64LIT(0xf22ebf146cc1e73a), +W64LIT(0xc08850a6985f382e), +W64LIT(0xd9dbddffe210ad24), +W64LIT(0xbfe60d0f2dd737e9), +W64LIT(0x9a659136822c5553), +W64LIT(0x87cb1fada97f9766), +W64LIT(0x4c8a35d12811425b), +W64LIT(0x83361c6ff863c059), +W64LIT(0xd212a725fb214037), +W64LIT(0x9e9892f4d330026c), +W64LIT(0x45c7b46ae32e7ead), +W64LIT(0x5baf465a7374fff5), +W64LIT(0xdc6459f7da0b6893), +W64LIT(0xd46b5f867833c6ed), +W64LIT(0x5dd6bef9f066792f), +W64LIT(0xcb412a7c816ed53d), +W64LIT(0x75e5a0b9c5be705c), +W64LIT(0xf6d3bcd63dddb005), +W64LIT(0xfb633eafa7fedbcc), +W64LIT(0xd529d84c11345465), +W64LIT(0xc9c5d11d536004d8), +W64LIT(0xdb5f269e301e7cc1), +W64LIT(0x86899867c07805ee), +W64LIT(0x3d9296aabcb36538), +W64LIT(0x2cce1d8264c45e4c), +W64LIT(0x5aedc1901a736d7d), +W64LIT(0x2e4ae6e3b6ca8fa9), +W64LIT(0x1e68f230905a8158), +W64LIT(0xdee0a2960805b976), +W64LIT(0xcd38d2df027c53e7), +W64LIT(0x6909a9e887ea20e1), +W64LIT(0x24c11bf3c6fcf032), +W64LIT(0x18110a9313480782), +W64LIT(0xa7f7079c3e9f306b), +W64LIT(0xd8995a358b173fac), +W64LIT(0x854fe4cc7b714683), +W64LIT(0xbd62f66effd9e60c), +W64LIT(0x14e30f20e06cfec3), +W64LIT(0x6e32d6816dff34b3), +W64LIT(0x217e9ffbfee73585), +W64LIT(0xc88756d73a679650), +W64LIT(0x359d90db1e8bcb46), +W64LIT(0x2645e09214f221d7), +W64LIT(0x04fd03c2511c573f), +W64LIT(0x739c581a46acf686), +W64LIT(0xb0d2741765fa8dc5), +W64LIT(0xa0cc78f5d48a2439), +W64LIT(0x5e10c2524b6f3a42), +W64LIT(0xe50bcc9f37a45a94), +W64LIT(0x53a0402bd14c518b), +W64LIT(0x413ab7a8b2322992), +W64LIT(0x203c183197e0a70d), +W64LIT(0xcc7a55156b7bc16f), +W64LIT(0x4601c8c158273dc0), +W64LIT(0xbea48ac544d0a561), +W64LIT(0x638254f8f7dc5f7a), +W64LIT(0xa6b580565798a2e3), +W64LIT(0x3cd01160d5b4f7b0), +W64LIT(0x8c026577b04e7a75), +W64LIT(0x7ad1d9a18d93ca70), +W64LIT(0x785522c05f9d1b95), +W64LIT(0x5f5245982268a8ca), +W64LIT(0x9551e82eca01ef7f), +W64LIT(0x0000000000000000), +W64LIT(0xbb1b0ecd7ccb60d6), +W64LIT(0x094d81bbcb3f3cf6), +W64LIT(0x28331e4035d80973), +W64LIT(0xf7913b1c54da228d), +W64LIT(0x6acfd5433ce3638c), +W64LIT(0x1bd77638a84144ef), +W64LIT(0x62c0d3329edbcdf2), +W64LIT(0x81b2e70e2a6d11bc), +W64LIT(0xd7ad232dc33a8580), +W64LIT(0x05bf8408381bc5b7), +W64LIT(0x33e468789d994d9c), +W64LIT(0xfedcbaa79fe51e7b), +W64LIT(0x4f4c497a93180136), +W64LIT(0x073b7f69ea151452), +W64LIT(0x0cf205b3f324f941), +W64LIT(0x382d12a284a8a08f), +W64LIT(0x1cec0951425450bd), +W64LIT(0x55d9b888525ed751), +W64LIT(0x6cb62de0bff1e556), +W64LIT(0xd1d4db8e4028035a), +W64LIT(0x25839c39affb62ba), +W64LIT(0x4af3cd72ab03c481), +W64LIT(0xa4317b3785967306), +W64LIT(0x1a95f1f2c146d667), +W64LIT(0x926a97472014fb2d), +W64LIT(0xb7e90b7e8fef9997), +W64LIT(0xcefeae74b975108a), +W64LIT(0x3e54ea0107ba2655), +W64LIT(0xd0965c44292f91d2), +W64LIT(0xab05022fcdbbc92a), +W64LIT(0xfd1ac60c24ec5d16), +W64LIT(0xfc5841c64debcf9e), +W64LIT(0xe4494b555ea3c81c), +W64LIT(0xb6ab8cb4e6e80b1f), +W64LIT(0x3beb6e093fa1e3e2), +W64LIT(0xf36c38de05c675b2), +W64LIT(0x9c1c6995013ed389), +W64LIT(0x8b391a1e5a5b6e27), +W64LIT(0xec464d24fc9b6662), +W64LIT(0xad7cfa8c4ea94ff0), +W64LIT(0x0f347918482dba2c), +W64LIT(0x9d5eee5f68394101), +W64LIT(0x7623dc127eb73331), +W64LIT(0x32a6efb2f49edf14), +W64LIT(0x2d8c9a480dc3ccc4), +W64LIT(0xb2568f76b7f45c20), +W64LIT(0x0e76fed2212a28a4), +W64LIT(0x48773613790d1564), +W64LIT(0x129af783637e7819), +W64LIT(0x080f0671a238ae7e), +W64LIT(0x365bec70a582882b), +W64LIT(0x42fccb03093b6aff), +W64LIT(0x0a8bfd1070367f9b), +W64LIT(0xff9e3d6df6e28cf3), +W64LIT(0xe8bb4ee6ad87315d), +W64LIT(0xc7b32fcf724a2c7c), +W64LIT(0xb8dd7266c7c223bb), +W64LIT(0x9328108d491369a5), +W64LIT(0x0679f8a3831286da), +W64LIT(0x270767587df5b35f), +W64LIT(0xa981f94e1fb518cf), +W64LIT(0x6b8d528955e4f104), +W64LIT(0x1667f44132622f26), +W64LIT(0x2ab7e521e7d6d896), +W64LIT(0xac3e7d4627aedd78), +W64LIT(0x7deaa6c86786de22), +W64LIT(0x1725738b5b65bdae), +W64LIT(0x4bb14ab8c2045609), +W64LIT(0x592bbd3ba17a2e10), +W64LIT(0xc20cabc74a51e9cb), +W64LIT(0x6f70514b04f8a63b), +W64LIT(0xbc2071a496de7484), +W64LIT(0x19538d597a4f950a), +W64LIT(0xf45747b7efd361e0), +W64LIT(0x43be4cc9603cf877), +W64LIT(0xc6f1a8051b4dbef4), +W64LIT(0xb42f77d534e6dafa), +W64LIT(0x40783062db35bb1a), +/* box 5 */ +W64LIT(0xf5a96c292deb0a4e), +W64LIT(0x211c9df6ee653c51), +W64LIT(0x04de5ddcbeeef596), +W64LIT(0xe1e5b06f7457c19f), +W64LIT(0x74ca30f014a54fb6), +W64LIT(0xc296f9f7c5457d85), +W64LIT(0x7d4ee08a484d10b0), +W64LIT(0xae87f2d0bf9b13ad), +W64LIT(0x8df4bb480e89afb7), +W64LIT(0x2d8b7a67d9a2d61e), +W64LIT(0x0f3559c8bd712adb), +W64LIT(0x541bc7312f013338), +W64LIT(0x9ec4848b636d5164), +W64LIT(0x952f809f60f28e29), +W64LIT(0x28984d8cb28d6357), +W64LIT(0xd4b5f1dfc38e361f), +W64LIT(0x5674135f7076b373), +W64LIT(0xb791a330042172ec), +W64LIT(0xab94c53bd4b4a6e4), +W64LIT(0xf17731f59305ffd8), +W64LIT(0x39c7a621801e1dcf), +W64LIT(0x20d1f7c13ba47c8e), +W64LIT(0x5e3da912f95facaa), +W64LIT(0xb1202a82e5b80731), +W64LIT(0x13303fc36de4fed3), +W64LIT(0x2e29c43e5314168a), +W64LIT(0x861fbf5c0d1670fa), +W64LIT(0x6458b16af3f771f1), +W64LIT(0x3043765bdcf642c9), +W64LIT(0x12fd55f4b825be0c), +W64LIT(0x0a266e23d65e9f92), +W64LIT(0x6595db5d2636312e), +W64LIT(0x85bd010587a0b06e), +W64LIT(0x9bd7b3600842e42d), +W64LIT(0xaa59af0c0175e63b), +W64LIT(0x240faa1d854a8918), +W64LIT(0xf464061ef82a4a91), +W64LIT(0x5c527d7ca6282ce1), +W64LIT(0x03a2be598ab6c094), +W64LIT(0x40571b7776bdf8e9), +W64LIT(0xe4f687841f7874d6), +W64LIT(0x115febad32937e98), +W64LIT(0x5108f0da442e8671), +W64LIT(0x9cab50e53c1ad12f), +W64LIT(0x33e1c8025640825d), +W64LIT(0x87d2d56bd8d73025), +W64LIT(0xc0f92d999a32fdce), +W64LIT(0x62e938d8126e042c), +W64LIT(0x4a717554a0e3677b), +W64LIT(0x0beb0414039fdf4d), +W64LIT(0xd6da25b19cf9b654), +W64LIT(0x55d6ad06fac073e7), +W64LIT(0x632452efc7af44f3), +W64LIT(0xb5fe775e5b56f2a7), +W64LIT(0x892ae694b0675a21), +W64LIT(0x7a32030f7c1525b2), +W64LIT(0x5d9f174b73e96c3e), +W64LIT(0xc35b93c010843d5a), +W64LIT(0x373f95dee8ae77cb), +W64LIT(0xfb515fd6455b604a), +W64LIT(0xa9fb11558bc326af), +W64LIT(0x22be23af64d3fcc5), +W64LIT(0xa8367b625e026670), +W64LIT(0xb8a4faf8b9505837), +W64LIT(0x785dd7612362a5f9), +W64LIT(0x588c20a018c6d977), +W64LIT(0xea0eb47b77c81ed2), +W64LIT(0xa6ce489d36b20c74), +W64LIT(0x0c97e79137c7ea4f), +W64LIT(0x7c838abd9d8c506f), +W64LIT(0x57b97968a5b7f3ac), +W64LIT(0x6c110b277ade6e28), +W64LIT(0xc785ce1cae6ac8cc), +W64LIT(0x1581b6718c7d8b0e), +W64LIT(0x614b868198d8c4b8), +W64LIT(0x27ad14440ffc498c), +W64LIT(0xdb80a8177eff1cc4), +W64LIT(0x472bf8f242e5cdeb), +W64LIT(0x8a8858cd3ad19ab5), +W64LIT(0xf60bd270a75dcada), +W64LIT(0x43f5a52efc0b387d), +W64LIT(0x6ddc6110af1f2ef7), +W64LIT(0xf0ba5bc246c4bf07), +W64LIT(0x6fb3b57ef068aebc), +W64LIT(0x18db3bd76e7b219e), +W64LIT(0x903cb7740bdd3b60), +W64LIT(0x7bff6938a9d4656d), +W64LIT(0xbdb7cd13d27fed7e), +W64LIT(0x051337eb6b2fb549), +W64LIT(0x77688ea99e138f22), +W64LIT(0xd9ef7c7921889c8f), +W64LIT(0x077ce38534583502), +W64LIT(0xf318e59bcc727f93), +W64LIT(0xb34ffeecbacf877a), +W64LIT(0xe9ac0a22fd7ede46), +W64LIT(0xfc2dbc5371035548), +W64LIT(0x026fd46e5f77804b), +W64LIT(0xe53bedb3cab93409), +W64LIT(0xcc6eca08adf51781), +W64LIT(0xe028da58a1968140), +W64LIT(0x3a6518780aa8dd5b), +W64LIT(0xce011e66f28297ca), +W64LIT(0xa4a19cf369c58c3f), +W64LIT(0xc5ea1a72f11d4887), +W64LIT(0xc427704524dc0858), +W64LIT(0x4238cf1929ca78a2), +W64LIT(0x481ea13aff94e730), +W64LIT(0xdf5ef5cbc011e952), +W64LIT(0x80ae36eeec8f0527), +W64LIT(0x5ae3f4ce47b1593c), +W64LIT(0xcda3a03f7834575e), +W64LIT(0x71d9071b7f8afaff), +W64LIT(0xcadf43ba4c6c625c), +W64LIT(0x1623082806cb4b9a), +W64LIT(0x17ee621fd30a0b45), +W64LIT(0x448946abc8530d7f), +W64LIT(0x974054f13f850e62), +W64LIT(0x73b6d37520fd7ab4), +W64LIT(0xc8b097d4131be217), +W64LIT(0x9f09eebcb6ac11bb), +W64LIT(0x45442c9c1d924da0), +W64LIT(0x1b79858ee4cde10a), +W64LIT(0x0984d07a5ce85f06), +W64LIT(0x4cc0fce6417a12a6), +W64LIT(0x99b8670e57356466), +W64LIT(0xad254c89352dd339), +W64LIT(0x322ca2358381c282), +W64LIT(0xcfcc74512743d715), +W64LIT(0x6b6de8a24e865b2a), +W64LIT(0xda4dc220ab3e5c1b), +W64LIT(0x88e78ca365a61afe), +W64LIT(0x939e092d816bfbf4), +W64LIT(0xcb12298d99ad2283), +W64LIT(0xeed0e9a7c926eb44), +W64LIT(0x98750d3982f424b9), +W64LIT(0xd5789be8164f76c0), +W64LIT(0xbe15734a58c92dea), +W64LIT(0x49d3cb0d2a55a7ef), +W64LIT(0x67fa0f337941b165), +W64LIT(0x8c39d17fdb48ef68), +W64LIT(0x25c2c02a508bc9c7), +W64LIT(0x349d2b876218b75f), +W64LIT(0x70146d2caa4bba20), +W64LIT(0x1c05660bd095d408), +W64LIT(0xfe42683d2e74d503), +W64LIT(0x9a1ad957dd83a4f2), +W64LIT(0xf2d58fac19b33f4c), +W64LIT(0x81635cd9394e45f8), +W64LIT(0xb65cc907d1e03233), +W64LIT(0xdd3121a59f666919), +W64LIT(0x318e1c6c09370216), +W64LIT(0x8b4532faef10da6a), +W64LIT(0x191651e0bbba6141), +W64LIT(0x3f762f9361876812), +W64LIT(0xb96990cf6c9118e8), +W64LIT(0xb4331d698e97b278), +W64LIT(0xd822164ef449dc50), +W64LIT(0x84706b325261f0b1), +W64LIT(0x4eaf28881e0d92ed), +W64LIT(0x69023ccc11f1db61), +W64LIT(0x66376504ac80f1ba), +W64LIT(0x0849ba4d89291fd9), +W64LIT(0xff8f020afbb595dc), +W64LIT(0x50c59aed91efc6ae), +W64LIT(0x1dc80c3c055494d7), +W64LIT(0x1e6ab2658fe25443), +W64LIT(0x3d19fbfd3ef0e859), +W64LIT(0xfa9c35e1909a2095), +W64LIT(0x52aa4e83ce9846e5), +W64LIT(0x419a7140a37cb836), +W64LIT(0xa07fc12fd72b79a9), +W64LIT(0x68cf56fbc4309bbe), +W64LIT(0x01cd6a37d5c140df), +W64LIT(0x9253631a54aabb2b), +W64LIT(0xd06bac037d60c389), +W64LIT(0x295527bb674c2388), +W64LIT(0xd204786d221743c2), +W64LIT(0x0000000000000000), +W64LIT(0xf7c6b847729c8a05), +W64LIT(0xdcfc4b924aa729c6), +W64LIT(0xe38a64012b2041d4), +W64LIT(0xb28294db6f0ec7a5), +W64LIT(0x9d663ad2e9db91f0), +W64LIT(0x91f1dd43de1c7bbf), +W64LIT(0x6086ecb64d198467), +W64LIT(0x59414a97cd0799a8), +W64LIT(0xace826bee0ec93e6), +W64LIT(0xa56cf6c4bc04cce0), +W64LIT(0x727bb942f53c3a6b), +W64LIT(0x6e7edf4925a9ee63), +W64LIT(0x26607e73da3d0953), +W64LIT(0xe75439dd95ceb442), +W64LIT(0x7990bd56f6a3e526), +W64LIT(0xecbf3dc996516b0f), +W64LIT(0x76a5e49e4bd2cffd), +W64LIT(0x968d3ec6ea444ebd), +W64LIT(0x5b2e9ef9927019e3), +W64LIT(0x6aa082959b471bf5), +W64LIT(0xbb0644a133e698a3), +W64LIT(0x830c88b76639c5b3), +W64LIT(0xe2470e36fee1010b), +W64LIT(0xb0ed40b5307947ee), +W64LIT(0x355041b0b7d9f780), +W64LIT(0x8e560511843f6f23), +W64LIT(0x7f2134e4173a90fb), +W64LIT(0x2af799e2edfae31c), +W64LIT(0x4bbc1f63752227a4), +W64LIT(0xf8f3e18fcfeda0de), +W64LIT(0x0d5a8da6e206aa90), +W64LIT(0x2c4610500c6396c1), +W64LIT(0xde939ffc15d0a98d), +W64LIT(0xaf4a98e76a5a5372), +W64LIT(0x8f9b6f2651fe2ffc), +W64LIT(0x36f2ffe93d6f3714), +W64LIT(0x0ef833ff68b06a04), +W64LIT(0xe69953ea400ff49d), +W64LIT(0x23734998b112bc1a), +W64LIT(0x3ebb45a4b44628cd), +W64LIT(0x1ab4efb9310ca1d5), +W64LIT(0x2fe4ae0986d55655), +W64LIT(0xebc3de4ca2095e0d), +W64LIT(0x536724b41b59063a), +W64LIT(0x46e692c597248d34), +W64LIT(0x2b3af3d5383ba3c3), +W64LIT(0x3ba8724fdf699d84), +W64LIT(0xc13447ae4ff3bd11), +W64LIT(0x4d0d96d194bb5279), +W64LIT(0xfde0d664a4c21597), +W64LIT(0xd7174f864938f68b), +W64LIT(0x7eec5ed3c2fbd024), +W64LIT(0xbfd8197d8d086d35), +W64LIT(0x4f6242bfcbccd232), +W64LIT(0xa70322aae3734cab), +W64LIT(0xa3dd7f765d9db93d), +W64LIT(0x94e2eaa8b533cef6), +W64LIT(0x144cdc4659bccbd1), +W64LIT(0xc648a42b7bab8813), +W64LIT(0xf93e8bb81a2ce001), +W64LIT(0xbacb2e96e627d87c), +W64LIT(0xbc7aa72407beada1), +W64LIT(0xc97dfde3c6daa2c8), +W64LIT(0xa1b2ab1802ea3976), +W64LIT(0x1fa7d8525a23149c), +W64LIT(0x75075ac7c1640f69), +W64LIT(0xe861601528bf9e99), +W64LIT(0xa2101541885cf9e2), +W64LIT(0xef1d83901ce7ab9b), +W64LIT(0x06b189b2e19975dd), +W64LIT(0x380acc1655df5d10), +W64LIT(0x1092819ae7523e47), +W64LIT(0xd3c9125af7d6031d), +W64LIT(0xd1a6c634a8a18356), +W64LIT(0x5ff0c3252c9eec75), +W64LIT(0x82c1e280b3f8856c), +W64LIT(0xed7257fe43902bd0), +W64LIT(0x3cd491caeb31a886), +/* box 6 */ +W64LIT(0x94af9eb6fad9e7df), +W64LIT(0x9208ae5e03c94ddd), +W64LIT(0x1d8de8d67158480b), +W64LIT(0xfd093cd2ba147af8), +W64LIT(0xa45ceb22e6597ccf), +W64LIT(0x9bbde6e77bf113da), +W64LIT(0xe4edf4b465fffe5c), +W64LIT(0x7125622e4e8d2a2f), +W64LIT(0x1791b81b8f68430d), +W64LIT(0xb56a63d1902195c0), +W64LIT(0xa980832b30d2ee67), +W64LIT(0x4c0a7fb384862397), +W64LIT(0xed58bc0d1dc7a05b), +W64LIT(0x5955d7f05c4d0637), +W64LIT(0xd2b9b1c8806fcf4e), +W64LIT(0x06a730e8f910aa02), +W64LIT(0xb8b60bd846aa0768), +W64LIT(0x45bf370afcbe7d90), +W64LIT(0x16f6b0375ec370a1), +W64LIT(0x892276608b81afd4), +W64LIT(0xdcccc1b5d0ec08e7), +W64LIT(0xe856949162df5f58), +W64LIT(0x82592e81a41a977e), +W64LIT(0xac8eabb74fca1164), +W64LIT(0xfac9041692afe356), +W64LIT(0x3b882d75331ba3ba), +W64LIT(0xa39cd3e6cee2e561), +W64LIT(0xd077a190d7cca9e3), +W64LIT(0x9c7dde23534a8a74), +W64LIT(0x80973ed9f3b9f1d3), +W64LIT(0xce535132209cb4e9), +W64LIT(0xaa299b5fb6dabb66), +W64LIT(0x2d7e9d426dd8d31b), +W64LIT(0x8a8b6e140d89fad5), +W64LIT(0x6ca88af83fd56224), +W64LIT(0xf5db7c4713871753), +W64LIT(0xeef1a4799bcff55a), +W64LIT(0x76e55aea6636b381), +W64LIT(0x8ee24ea4a33a367a), +W64LIT(0x25acddd7c44bbeb0), +W64LIT(0x9adaeecbaa5a2076), +W64LIT(0x0e75707d5083c7a9), +W64LIT(0x2bd9adaa94c87919), +W64LIT(0x19e4c866dfeb84a4), +W64LIT(0x129f9087f070bc0e), +W64LIT(0xd9c2e929aff4f7e4), +W64LIT(0x6f01928cb9dd3725), +W64LIT(0x39463d2d64b8c517), +W64LIT(0xebff8ce5e4d70a59), +W64LIT(0xb40d6bfd418aa66c), +W64LIT(0xf21b44833b3c8efd), +W64LIT(0x3654457ce5903112), +W64LIT(0x431807e205aed792), +W64LIT(0xb10343613e92596f), +W64LIT(0x0a1c50cdfe300b06), +W64LIT(0x778252c6b79d802d), +W64LIT(0x0cbb60250720a104), +W64LIT(0xe1e3dc281ae7015f), +W64LIT(0x0f1278518128f405), +W64LIT(0x47712752ab1d1b3d), +W64LIT(0xe24ac45c9cef545e), +W64LIT(0x1ceae0faa0f37ba7), +W64LIT(0x9814fe93fdf946db), +W64LIT(0xec3fb421cc6c93f7), +W64LIT(0x833e26ad75b1a4d2), +W64LIT(0x6b68b23c176efb8a), +W64LIT(0x4904572ffb9edc94), +W64LIT(0x4bca4777ac3dba39), +W64LIT(0x2762cd8f93e8d81d), +W64LIT(0x9eb3ce7b04e9ecd9), +W64LIT(0xc2e8311727bc15ed), +W64LIT(0xea9884c9357c39f5), +W64LIT(0xfc6e34fe6bbf4954), +W64LIT(0x13f898ab21db8fa2), +W64LIT(0xb7a47389c782f36d), +W64LIT(0x7b3932e3b0bd2129), +W64LIT(0xaf27b3c3c9c24465), +W64LIT(0xb6c37ba51629c0c1), +W64LIT(0x84fe1e695d0a3d7c), +W64LIT(0x1a4dd01259e3d1a5), +W64LIT(0xab4e9373677188ca), +W64LIT(0x90c6be06546a2b70), +W64LIT(0xf37c4cafea97bd51), +W64LIT(0x647aca6d96460f8f), +W64LIT(0x4ec46febd325453a), +W64LIT(0x3e8605e94c035cb9), +W64LIT(0x0ddc6809d68b92a8), +W64LIT(0x8bec6638dc22c979), +W64LIT(0x67d3d219104e5a8e), +W64LIT(0x2abea58645634ab5), +W64LIT(0x5b9bc7a80bee609a), +W64LIT(0x936fa672d2627e71), +W64LIT(0x7d9e020b49ad8b2b), +W64LIT(0x5832dfdc8de6359b), +W64LIT(0xc7e6198b58a4eaee), +W64LIT(0xd41e8120797f654c), +W64LIT(0xf4bc746bc22c24ff), +W64LIT(0xe084d404cb4c32f3), +W64LIT(0x48635f032a35ef38), +W64LIT(0x8757061ddb02687d), +W64LIT(0x522e8f1173d63e9d), +W64LIT(0xbcdf2b68e819cbc7), +W64LIT(0xbf76331c6e119ec6), +W64LIT(0x08d24095a9936dab), +W64LIT(0x728c7a5ac8857f2e), +W64LIT(0xd110a9bc06679a4f), +W64LIT(0x1f43f88e26fb2ea6), +W64LIT(0xb2aa5b15b89a0c6e), +W64LIT(0x4aad4f5b7d968995), +W64LIT(0x9fd4c657d542df75), +W64LIT(0x323d65cc4b23fdbd), +W64LIT(0xc38f393bf6172641), +W64LIT(0xa152c3be994183cc), +W64LIT(0x9d1ad60f82e1b9d8), +W64LIT(0xe744ecc0e3f7ab5d), +W64LIT(0x38213501b513f6bb), +W64LIT(0xade9a39b9e6122c8), +W64LIT(0x37334d50343b02be), +W64LIT(0x55eeb7d55b6da733), +W64LIT(0x970686c27cd1b2de), +W64LIT(0x427f0fced405e43e), +W64LIT(0xc026214f701f7340), +W64LIT(0x40b11f9683a68293), +W64LIT(0x02ce105857a366ad), +W64LIT(0x7e371a7fcfa5de2a), +W64LIT(0xffc72c8aedb71c55), +W64LIT(0x68c1aa489166ae8b), +W64LIT(0xc68111a7890fd942), +W64LIT(0x79f722bbe71e4784), +W64LIT(0xd579890ca8d456e0), +W64LIT(0x70426a029f261983), +W64LIT(0xb0644b4def396ac3), +W64LIT(0xdb0cf971f8579149), +W64LIT(0x5489bff98ac6949f), +W64LIT(0x046920b0aeb3ccaf), +W64LIT(0x7cf90a279806b887), +W64LIT(0x050e289c7f18ff03), +W64LIT(0x651dc24147ed3c23), +W64LIT(0x5e95ef3474f69f99), +W64LIT(0x6dcf82d4ee7e5188), +W64LIT(0x8f854688729105d6), +W64LIT(0x81f036f52212c27f), +W64LIT(0xb9d103f4970134c4), +W64LIT(0x5349873da27d0d31), +W64LIT(0x20a2f54bbb5341b3), +W64LIT(0xf0d554db6c9fe850), +W64LIT(0x07c038c428bb99ae), +W64LIT(0x30f375941c809b10), +W64LIT(0x3fe10dc59da86f15), +W64LIT(0x46162f7e7ab62891), +W64LIT(0xe623e4ec325c98f1), +W64LIT(0xfea024a63c1c2ff9), +W64LIT(0x349a5524b23357bf), +W64LIT(0x35fd5d0863986413), +W64LIT(0x96618eeead7a8172), +W64LIT(0xcb5d79ae5f844bea), +W64LIT(0x21c5fd676af8721f), +W64LIT(0x5720a78d0ccec19e), +W64LIT(0xf6726433958f4252), +W64LIT(0x8d4b56d02532637b), +W64LIT(0x24cbd5fb15e08d1c), +W64LIT(0x3aef2559e2b09016), +W64LIT(0x5afccf84da455336), +W64LIT(0x51879765f5de6b9c), +W64LIT(0x2917bdf2c36b1fb4), +W64LIT(0xa7f5f356605129ce), +W64LIT(0xc1412963a1b440ec), +W64LIT(0x3d2f1d9dca0b09b8), +W64LIT(0xa53be30e37f24f63), +W64LIT(0x5ff2e718a55dac35), +W64LIT(0xa2fbdbca1f49d6cd), +W64LIT(0xf7156c1f442471fe), +W64LIT(0x7a5e3acf61161285), +W64LIT(0xca3a71828e2f7846), +W64LIT(0x1b2ad83e8848e209), +W64LIT(0xa8e78b07e179ddcb), +W64LIT(0xef96ac554a64c6f6), +W64LIT(0x0000000000000000), +W64LIT(0x6013eadd38f5c320), +W64LIT(0x3c4815b11ba03a14), +W64LIT(0x09b548b978385e07), +W64LIT(0x226ce513ecf0271e), +W64LIT(0x63baf2a9befd9621), +W64LIT(0x44d83f262d154e3c), +W64LIT(0xcdfa4946a694e1e8), +W64LIT(0x113688f37678e90f), +W64LIT(0x859916458ca10ed0), +W64LIT(0xc52809d30f078c43), +W64LIT(0x4d6d779f552d103b), +W64LIT(0x1e24f0a2f7501d0a), +W64LIT(0x0167082cd1ab33ac), +W64LIT(0x1438a06f0960160c), +W64LIT(0xf9601c6214a7b657), +W64LIT(0xa035cb9248eab060), +W64LIT(0x50e09f4924755830), +W64LIT(0xd7b79954ff77304d), +W64LIT(0xe58afc98b454cdf0), +W64LIT(0x03a9187486085501), +W64LIT(0x62ddfa856f56a58d), +W64LIT(0xc44f01ffdeacbfef), +W64LIT(0x73eb7276192e4c82), +W64LIT(0xd6d091782edc03e1), +W64LIT(0xfbae0c3a4304d0fa), +W64LIT(0x9973f6bf2c527577), +W64LIT(0x105180dfa7d3daa3), +W64LIT(0x2605c5a34243ebb1), +W64LIT(0x91a1b62a85c118dc), +W64LIT(0xc99369f608272d47), +W64LIT(0x5d3cf740f2feca98), +W64LIT(0xcf34591ef1378745), +W64LIT(0xc8f461dad98c1eeb), +W64LIT(0x0b7b58e12f9b38aa), +W64LIT(0xe32dcc704d4467f2), +W64LIT(0x754c429ee03ee680), +W64LIT(0xd3deb9e451c4fce2), +W64LIT(0x6e669aa068760489), +W64LIT(0x66b4da35c1e56922), +W64LIT(0x4fa367c7028e7696), +W64LIT(0xba781b80110961c5), +W64LIT(0x41d617ba520db13f), +W64LIT(0x335a6de09a88ce11), +W64LIT(0xdf65d9c156e45de6), +W64LIT(0xcc9d416a773fd244), +W64LIT(0x5c5bff6c2355f934), +W64LIT(0x2870b5de12c02c18), +W64LIT(0x155fa843d8cb25a0), +W64LIT(0x78902a9736b57428), +W64LIT(0xae40bbef186977c9), +W64LIT(0x88457e4c5a2a9c78), +W64LIT(0x6a0fba10c6c5c826), +W64LIT(0x7f5012531e0eed86), +W64LIT(0x8c2c5efcf49950d7), +W64LIT(0x31947db8cd2ba8bc), +W64LIT(0x2c19956ebc73e0b7), +W64LIT(0x230bed3f3d5b14b2), +W64LIT(0x69a6a26440cd9d27), +W64LIT(0x86300e310aa95bd1), +W64LIT(0xb3cd533969313fc2), +W64LIT(0x1883c04a0e40b708), +W64LIT(0xf1b25cf7bd34dbfc), +W64LIT(0x2fb08d1a3a7bb5b6), +W64LIT(0xd8a5e1057e5fc448), +W64LIT(0xddabc99901473b4b), +W64LIT(0xde02d1ed874f6e4a), +W64LIT(0xbdb8234439b2f86b), +W64LIT(0x5647afa1dd65f232), +W64LIT(0x2ed78536ebd0861a), +W64LIT(0xe9319cbdb3746cf4), +W64LIT(0xa692fb7ab1fa1a62), +W64LIT(0x742b4ab23195d52c), +W64LIT(0x95c8969a2b72d473), +W64LIT(0x6174e2f1e95ef08c), +W64LIT(0xf807144ec50c85fb), +W64LIT(0xbe113b30bfbaad6a), +W64LIT(0xda6bf15d29fca2e5), +W64LIT(0xbb1f13acc0a25269), +/* box 7 */ +W64LIT(0xc22b27f0f9e37bf9), +W64LIT(0x93fad23f0955ef09), +W64LIT(0x32ed4b84a22a91a2), +W64LIT(0x3898b57bcc61b1cc), +W64LIT(0x55825ba9ad98e5ad), +W64LIT(0xb2eeb8069421ec94), +W64LIT(0xc7eb5875ce3c6bce), +W64LIT(0x4b1dac5d1f45851f), +W64LIT(0xc16ba1204705d847), +W64LIT(0xc5380f461a2ba91a), +W64LIT(0xb908971a909bad90), +W64LIT(0x303e1cb7763d5376), +W64LIT(0xe6ff324c53486853), +W64LIT(0x6d1aeed261f95461), +W64LIT(0x0193d1e36af1616a), +W64LIT(0x51d1f5cff0b694f0), +W64LIT(0x29b2c3f52728e127), +W64LIT(0x112a768eeb4950eb), +W64LIT(0x8fb672f86f9f4d6f), +W64LIT(0xf0c66c745bc9ea5b), +W64LIT(0x3f8b9dcd2fa9632f), +W64LIT(0x65bc471edba5b6db), +W64LIT(0x4d9d5508967c3696), +W64LIT(0x3a4be24818767318), +W64LIT(0x2794936c144db014), +W64LIT(0x2af2452599ce4299), +W64LIT(0x4a8e7dbe75b4e475), +W64LIT(0x9ddc82a63a30be3a), +W64LIT(0xade29e114c0ded4c), +W64LIT(0xd1d2064dc6bde9c6), +W64LIT(0x7da349bfe04165e0), +W64LIT(0x6b9a1787e8c0e7e8), +W64LIT(0xa54437ddf6510ff6), +W64LIT(0x2254ece92392a023), +W64LIT(0x79f0e7d9bd6f14bd), +W64LIT(0x57510c9a798f2779), +W64LIT(0x346db2d12b13222b), +W64LIT(0x54118a4ac76984c7), +W64LIT(0xefca4a6383e5eb83), +W64LIT(0xca8d8e3c43bf9943), +W64LIT(0xfc336bdebcbb79bc), +W64LIT(0x3e184c2e45580245), +W64LIT(0xf495c21206e79b06), +W64LIT(0xff73ed0e025dda02), +W64LIT(0x4228d472cfe806cf), +W64LIT(0xbcc8e89fa744bda7), +W64LIT(0xab626744c5345ec5), +W64LIT(0xb6bd1660c90f9dc9), +W64LIT(0xb72ec783a3fefca3), +W64LIT(0x8be5dc9e32b13c32), +W64LIT(0x485d2a8da1a326a1), +W64LIT(0xc6788996a4cd0aa4), +W64LIT(0x40fb83411bffc41b), +W64LIT(0x08a6a9ccba5ce2ba), +W64LIT(0xf386eaa4e52f49e5), +W64LIT(0x1acc5992eff311ef), +W64LIT(0xa2571f6b1599dd15), +W64LIT(0x44a82d2746d1b546), +W64LIT(0x70c59ff66dc2976d), +W64LIT(0x8d6525cbbb888fbb), +W64LIT(0x963aadba3e8aff3e), +W64LIT(0x7c30985c8ab0048a), +W64LIT(0x607c389bec7aa6ec), +W64LIT(0xa822e1947bd2fd7b), +W64LIT(0x034086d0bee6a3be), +W64LIT(0x66fcc1ce65431565), +W64LIT(0xb37d69e5fed08dfe), +W64LIT(0x2f323aa0ae1152ae), +W64LIT(0x56c2dd79137e4613), +W64LIT(0x31adcd541ccc321c), +W64LIT(0xdff456d4f5d8b8f5), +W64LIT(0xf9f3145b8b64698b), +W64LIT(0x764566a3e4fb24e4), +W64LIT(0x0cf507aae77293e7), +W64LIT(0x59775c034aea764a), +W64LIT(0xb89b46f9fa6accfa), +W64LIT(0xe8d962d5602d3960), +W64LIT(0x17aa8fdb6270e362), +W64LIT(0x1c4ca0c766caa266), +W64LIT(0x2de16d937a06907a), +W64LIT(0x2547c45fc05a72c0), +W64LIT(0x0fb5817a59943059), +W64LIT(0x0680f9558939b389), +W64LIT(0x16395e3808818208), +W64LIT(0xac714ff226fc8c26), +W64LIT(0xa9b1307711239c11), +W64LIT(0xec8accb33d03483d), +W64LIT(0x6c893f310b08350b), +W64LIT(0xc4abdea570dac870), +W64LIT(0xba4811ca2e7d0e2e), +W64LIT(0xf155bd9731388b31), +W64LIT(0xdd2701e721cf7a21), +W64LIT(0xe94ab3360adc580a), +W64LIT(0x23c73d0a4963c149), +W64LIT(0x5cb723867d35667d), +W64LIT(0x5042242c9a47f59a), +W64LIT(0x198cdf425115b251), +W64LIT(0x0a75feff6e4b206e), +W64LIT(0xfda0ba3dd64a18d6), +W64LIT(0xcede205a1e91e81e), +W64LIT(0xd041d7aeac4c88ac), +W64LIT(0xe42c657f875faa87), +W64LIT(0x36bee5e2ff04e0ff), +W64LIT(0x6fc9b9e1b5ee96b5), +W64LIT(0x998f2cc0671ecf67), +W64LIT(0xd301517e12aa2b12), +W64LIT(0xaea218c1f2eb4ef2), +W64LIT(0xda342951c207a8c2), +W64LIT(0x61efe978868bc786), +W64LIT(0x7f701e8c3456a734), +W64LIT(0x0be62f1c04ba4104), +W64LIT(0x9129850cdd422ddd), +W64LIT(0xd6c12efb25753b25), +W64LIT(0xe33f4dc964977864), +W64LIT(0x1579d8e8b66721b6), +W64LIT(0xf860c5b8e19508e1), +W64LIT(0x7496319030ece630), +W64LIT(0x88a55a4e8c579f8c), +W64LIT(0xcf4df1b974608974), +W64LIT(0x10b9a76d81b83181), +W64LIT(0x0e26509933655133), +W64LIT(0x43bb0591a51967a5), +W64LIT(0x926903dc63a48e63), +W64LIT(0x9c4f534550c1df50), +W64LIT(0x3bd833ab72871272), +W64LIT(0xa4d7e63e9ca06e9c), +W64LIT(0xb46e41531d185f1d), +W64LIT(0x126af05e55aff355), +W64LIT(0x24d415bcaaab13aa), +W64LIT(0x1e9ff7f4b2dd60b2), +W64LIT(0x05c07f8537df1037), +W64LIT(0x467b7a1492c67792), +W64LIT(0x2087bbdaf78562f7), +W64LIT(0x819022615cfa1c5c), +W64LIT(0xcd9ea68aa0774ba0), +W64LIT(0xa79760ee2246cd22), +W64LIT(0x8343755288edde88), +W64LIT(0x58e48de0201b1720), +W64LIT(0x7216c8c5b9d555b9), +W64LIT(0x372d340195f58195), +W64LIT(0xa11799bbab7f7eab), +W64LIT(0x9f0fd595ee277cee), +W64LIT(0x676f102d0fb2740f), +W64LIT(0x9e9c047684d61d84), +W64LIT(0x49cefb6ecb5247cb), +W64LIT(0xd41279c8f162f9f1), +W64LIT(0x1f0c2617d82c01d8), +W64LIT(0x97a97c59547b9e54), +W64LIT(0xe76ce3af39b90939), +W64LIT(0xc3b8f61393121a93), +W64LIT(0x5ba40b309efdb49e), +W64LIT(0xea0a35e6b43afbb4), +W64LIT(0x5a37dad3f40cd5f4), +W64LIT(0x14ea090bdc9640dc), +W64LIT(0x5e6474b5a922a4a9), +W64LIT(0xfee03ced68acbb68), +W64LIT(0x071328b6e3c8d2e3), +W64LIT(0x5302a2fc24a15624), +W64LIT(0x85c38c0701d46d01), +W64LIT(0x3d58cafefbbea1fb), +W64LIT(0x84505de46b250c6b), +W64LIT(0x642f96fdb154d7b1), +W64LIT(0xbf886e4f19a21e19), +W64LIT(0x02d35733d417c2d4), +W64LIT(0x68da915756264456), +W64LIT(0x8710db34d5c3afd5), +W64LIT(0x0d66d6498d83f28d), +W64LIT(0x7b23b0ea6978d669), +W64LIT(0x1b5f887185027085), +W64LIT(0x3ccb1b1d914fc091), +W64LIT(0x0453ae665d2e715d), +W64LIT(0xcb1e5fdf294ef829), +W64LIT(0xf6469521d2f059d2), +W64LIT(0xb03def3540362e40), +W64LIT(0x633cbe4b529c0552), +W64LIT(0xf7d544c2b80138b8), +W64LIT(0x7ab061090389b703), +W64LIT(0x0000000000000000), +W64LIT(0xdba7f8b2a8f6c9a8), +W64LIT(0x35fe633241e24341), +W64LIT(0x21146a399d74039d), +W64LIT(0xd581a82b9b93989b), +W64LIT(0x0935782fd0ad83d0), +W64LIT(0x5ff7a556c3d3c5c3), +W64LIT(0xaf31c922981a2f98), +W64LIT(0x90ba54efb7b34cb7), +W64LIT(0x5291731f4e50374e), +W64LIT(0xc0f870c32df4b92d), +W64LIT(0x7ee3cf6f5ea7c65e), +W64LIT(0xe07fcb19da71dbda), +W64LIT(0x4eddd3d8289a9528), +W64LIT(0x13f921bd3f5e923f), +W64LIT(0xf50613f16c16fa6c), +W64LIT(0x981cfd230defae0d), +W64LIT(0x4c0e84ebfc8d57fc), +W64LIT(0x82d0a4b1e21cbfe2), +W64LIT(0x89368bade6a6fee6), +W64LIT(0xd292809d785b4a78), +W64LIT(0x47e8abf7f83716f8), +W64LIT(0x8e25a31b056e2c05), +W64LIT(0xd752ff184f845a4f), +W64LIT(0xcc0d7769ca862aca), +W64LIT(0x694940b43cd7253c), +W64LIT(0x2ea1eb43c4e033c4), +W64LIT(0xde6787379f29d99f), +W64LIT(0x181f0ea13be4d33b), +W64LIT(0x416852a2710ea571), +W64LIT(0x62af6fa8386d6438), +W64LIT(0xa0844858c18e1fc1), +W64LIT(0x337e9a67c8dbf0c8), +W64LIT(0x2c72bc7010f7f110), +W64LIT(0xbd5b397ccdb5dccd), +W64LIT(0xd8e77e6216106a16), +W64LIT(0x86830ad7bf32cebf), +W64LIT(0x4f4e023b426bf442), +W64LIT(0xe5bfb49cedaecbed), +W64LIT(0x8a760d7d58405d58), +W64LIT(0xe2ac9c2a0e66190e), +W64LIT(0xb5fd90b077e93e77), +W64LIT(0xdcb4d0044b3e1b4b), +W64LIT(0x453bfcc42c20d42c), +W64LIT(0xed191d5057f22957), +W64LIT(0xe1ec1afab080bab0), +W64LIT(0xee599b80e9148ae9), +W64LIT(0x2607428f7ebcd17e), +W64LIT(0x5d24f26517c40717), +W64LIT(0x6a09c66482318682), +W64LIT(0xa604b10d48b7ac48), +W64LIT(0xbe1bbfac73537f73), +W64LIT(0x282112164dd9804d), +W64LIT(0x7505e0735a1d875a), +W64LIT(0x73851926d32434d3), +W64LIT(0xd974af817ce10b7c), +W64LIT(0xeb99e405decb9ade), +W64LIT(0x9b5c7bf3b3090db3), +W64LIT(0xfab3928b3582ca35), +W64LIT(0x8003f382360b7d36), +W64LIT(0x94e9fa89ea9d3dea), +W64LIT(0xb1ae3ed62ac74f2a), +W64LIT(0x9acfaa10d9f86cd9), +W64LIT(0x390b6498a690d0a6), +W64LIT(0xf2153b478fde288f), +W64LIT(0x71564e150733f607), +W64LIT(0xa3c4ce887f68bc7f), +W64LIT(0xaaf1b6a7afc53faf), +W64LIT(0x1ddf71240c3bc30c), +W64LIT(0x77d6b7408e0a458e), +W64LIT(0x2b6194c6f33f23f3), +W64LIT(0xc9cd08ecfd593afd), +W64LIT(0xc85ed90f97a85b97), +W64LIT(0x8cf6f428d179eed1), +W64LIT(0x957a2b6a806c5c80), +W64LIT(0xbbdbc029448c6f44), +W64LIT(0x7863363ad79e75d7), +W64LIT(0x6e5a6802df1ff7df), +W64LIT(0xfb2043685f73ab5f), +}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/simple.cpp b/external/crypto++-5.6.3/simple.cpp new file mode 100644 index 000000000..82564dae3 --- /dev/null +++ b/external/crypto++-5.6.3/simple.cpp @@ -0,0 +1,13 @@ +// simple.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "simple.h" + +NAMESPACE_BEGIN(CryptoPP) + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/simple.h b/external/crypto++-5.6.3/simple.h new file mode 100644 index 000000000..c1cd1c92f --- /dev/null +++ b/external/crypto++-5.6.3/simple.h @@ -0,0 +1,289 @@ +// simple.h - written and placed in the public domain by Wei Dai + +//! \file simple.h +//! \brief Classes providing simple keying interfaces. + +#ifndef CRYPTOPP_SIMPLE_H +#define CRYPTOPP_SIMPLE_H + +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4127 4189) +#endif + +#include "cryptlib.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class ClonableImpl +//! \brief Base class for identifying alogorithm +//! \tparam BASE base class from which to derive +//! \tparam DERIVED class which to clone +template +class CRYPTOPP_NO_VTABLE ClonableImpl : public BASE +{ +public: + Clonable * Clone() const {return new DERIVED(*static_cast(this));} +}; + +//! \class AlgorithmImpl +//! \brief Base class for identifying alogorithm +//! \tparam BASE an Algorithm derived class +//! \tparam ALGORITHM_INFO an Algorithm derived class +//! \details AlgorithmImpl provides StaticAlgorithmName from the template parameter BASE +template +class CRYPTOPP_NO_VTABLE AlgorithmImpl : public BASE +{ +public: + static std::string CRYPTOPP_API StaticAlgorithmName() {return ALGORITHM_INFO::StaticAlgorithmName();} + std::string AlgorithmName() const {return ALGORITHM_INFO::StaticAlgorithmName();} +}; + +//! \class InvalidKeyLength +//! \brief Exception thrown when an invalid key length is encountered +class CRYPTOPP_DLL InvalidKeyLength : public InvalidArgument +{ +public: + explicit InvalidKeyLength(const std::string &algorithm, size_t length) : InvalidArgument(algorithm + ": " + IntToString(length) + " is not a valid key length") {} +}; + +//! \class InvalidRounds +//! \brief Exception thrown when an invalid number of rounds is encountered +class CRYPTOPP_DLL InvalidRounds : public InvalidArgument +{ +public: + explicit InvalidRounds(const std::string &algorithm, unsigned int rounds) : InvalidArgument(algorithm + ": " + IntToString(rounds) + " is not a valid number of rounds") {} +}; + +// ***************************** + +//! \class Bufferless +//! \brief Base class for bufferless filters +//! \tparam T the class or type +template +class CRYPTOPP_NO_VTABLE Bufferless : public T +{ +public: + bool IsolatedFlush(bool hardFlush, bool blocking) + {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); return false;} +}; + +//! \class Unflushable +//! \brief Base class for unflushable filters +//! \tparam T the class or type +template +class CRYPTOPP_NO_VTABLE Unflushable : public T +{ +public: + bool Flush(bool completeFlush, int propagation=-1, bool blocking=true) + {return ChannelFlush(DEFAULT_CHANNEL, completeFlush, propagation, blocking);} + bool IsolatedFlush(bool hardFlush, bool blocking) + {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); assert(false); return false;} + bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) + { + if (hardFlush && !InputBufferIsEmpty()) + throw CannotFlush("Unflushable: this object has buffered input that cannot be flushed"); + else + { + BufferedTransformation *attached = this->AttachedTransformation(); + return attached && propagation ? attached->ChannelFlush(channel, hardFlush, propagation-1, blocking) : false; + } + } + +protected: + virtual bool InputBufferIsEmpty() const {return false;} +}; + +//! \class InputRejecting +//! \brief Base class for input rejecting filters +//! \tparam T the class or type +//! \details T should be a BufferedTransformation derived class +template +class CRYPTOPP_NO_VTABLE InputRejecting : public T +{ +public: + struct InputRejected : public NotImplemented + {InputRejected() : NotImplemented("BufferedTransformation: this object doesn't allow input") {}}; + + //! \name INPUT + //@{ + + //! \brief Input a byte array for processing + //! \param inString the byte array to process + //! \param length the size of the string, in bytes + //! \param messageEnd means how many filters to signal MessageEnd() to, including this one + //! \param blocking specifies whether the object should block when processing input + //! \throws InputRejected + //! \returns the number of bytes that remain in the block (i.e., bytes not processed) + //! \details Internally, the default implmentation throws InputRejected. + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); throw InputRejected();} + //@} + + //! \name SIGNALS + //@{ + bool IsolatedFlush(bool hardFlush, bool blocking) + {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); return false;} + bool IsolatedMessageSeriesEnd(bool blocking) + {CRYPTOPP_UNUSED(blocking); throw InputRejected();} + size_t ChannelPut2(const std::string &channel, const byte *inString, size_t length, int messageEnd, bool blocking) + {CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); throw InputRejected();} + bool ChannelMessageSeriesEnd(const std::string& channel, int messageEnd, bool blocking) + {CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); throw InputRejected();} + //@} +}; + +//! \class CustomFlushPropagation +//! \brief Provides interface for custom flush signals +//! \tparam T the class or type +//! \details T should be a BufferedTransformation derived class +template +class CRYPTOPP_NO_VTABLE CustomFlushPropagation : public T +{ +public: + //! \name SIGNALS + //@{ + virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) =0; + //@} + +private: + bool IsolatedFlush(bool hardFlush, bool blocking) + {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); assert(false); return false;} +}; + +//! \class CustomSignalPropagation +//! \brief Provides interface for initialization of derived filters +//! \tparam T the class or type +//! \details T should be a BufferedTransformation derived class +template +class CRYPTOPP_NO_VTABLE CustomSignalPropagation : public CustomFlushPropagation +{ +public: + virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1) =0; + +private: + void IsolatedInitialize(const NameValuePairs ¶meters) + {CRYPTOPP_UNUSED(parameters); assert(false);} +}; + +//! \class Multichannel +//! \brief Provides multiple channels support for custom flush signal processing +//! \tparam T the class or type +//! \details T should be a BufferedTransformation derived class +template +class CRYPTOPP_NO_VTABLE Multichannel : public CustomFlushPropagation +{ +public: + bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) + {return this->ChannelFlush(DEFAULT_CHANNEL, hardFlush, propagation, blocking);} + bool MessageSeriesEnd(int propagation=-1, bool blocking=true) + {return this->ChannelMessageSeriesEnd(DEFAULT_CHANNEL, propagation, blocking);} + byte * CreatePutSpace(size_t &size) + {return this->ChannelCreatePutSpace(DEFAULT_CHANNEL, size);} + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + {return this->ChannelPut2(DEFAULT_CHANNEL, inString, length, messageEnd, blocking);} + size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking) + {return this->ChannelPutModifiable2(DEFAULT_CHANNEL, inString, length, messageEnd, blocking);} + +// void ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1) +// {PropagateMessageSeriesEnd(propagation, channel);} + byte * ChannelCreatePutSpace(const std::string &channel, size_t &size) + {CRYPTOPP_UNUSED(channel); size = 0; return NULL;} + bool ChannelPutModifiable(const std::string &channel, byte *inString, size_t length) + {this->ChannelPut(channel, inString, length); return false;} + + virtual size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) =0; + size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) + {return ChannelPut2(channel, begin, length, messageEnd, blocking);} + + virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) =0; +}; + +//! \class AutoSignaling +//! \brief Provides auto signaling support +//! \tparam T the class or type +//! \details T should be a BufferedTransformation derived class +template +class CRYPTOPP_NO_VTABLE AutoSignaling : public T +{ +public: + AutoSignaling(int propagation=-1) : m_autoSignalPropagation(propagation) {} + + void SetAutoSignalPropagation(int propagation) + {m_autoSignalPropagation = propagation;} + int GetAutoSignalPropagation() const + {return m_autoSignalPropagation;} + +private: + int m_autoSignalPropagation; +}; + +//! \class Store +//! \brief Acts as a Source for pre-existing, static data +//! \tparam T the class or type +//! \details A BufferedTransformation that only contains pre-existing data as "output" +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Store : public AutoSignaling > +{ +public: + Store() : m_messageEnd(false) {} + + void IsolatedInitialize(const NameValuePairs ¶meters) + { + m_messageEnd = false; + StoreInitialize(parameters); + } + + unsigned int NumberOfMessages() const {return m_messageEnd ? 0 : 1;} + bool GetNextMessage(); + unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const; + +protected: + virtual void StoreInitialize(const NameValuePairs ¶meters) =0; + + bool m_messageEnd; +}; + +//! \class Sink +//! \brief Implementation of BufferedTransformation's attachment interface +//! \details Sink is a cornerstone of the Pipeline trinitiy. Data flows from +//! Sources, through Filters, and then terminates in Sinks. The difference +//! between a Source and Filter is a Source \a pumps data, while a Filter does +//! not. The difference between a Filter and a Sink is a Filter allows an +//! attached transformation, while a Sink does not. +//! \details A Sink doesnot produce any retrievable output. +//! \details See the discussion of BufferedTransformation in cryptlib.h for +//! more details. +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Sink : public BufferedTransformation +{ +public: + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) + {CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(transferBytes); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking); transferBytes = 0; return 0;} + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const + {CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking); return 0;} +}; + +//! \class BitBucket +//! \brief Acts as an input discarding Filter or Sink +//! \tparam T the class or type +//! \details The BitBucket discards all input and returns 0 to the caller +//! to indicate all data was processed. +class CRYPTOPP_DLL BitBucket : public Bufferless +{ +public: + std::string AlgorithmName() const {return "BitBucket";} + void IsolatedInitialize(const NameValuePairs ¶ms) + {CRYPTOPP_UNUSED(params);} + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); return 0;} +}; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/skipjack.cpp b/external/crypto++-5.6.3/skipjack.cpp new file mode 100644 index 000000000..dad14bd76 --- /dev/null +++ b/external/crypto++-5.6.3/skipjack.cpp @@ -0,0 +1,202 @@ +// skipjack.cpp - modified by Wei Dai from Paulo Barreto's skipjack32.c, +// which is public domain according to his web site. + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "skipjack.h" + +/* + * Optimized implementation of SKIPJACK algorithm + * + * originally written by Panu Rissanen 1998.06.24 + * optimized by Mark Tillotson 1998.06.25 + * optimized by Paulo Barreto 1998.06.30 + */ + +NAMESPACE_BEGIN(CryptoPP) + +/** + * The F-table byte permutation (see description of the G-box permutation) + */ +const byte SKIPJACK::Base::fTable[256] = { + 0xa3,0xd7,0x09,0x83,0xf8,0x48,0xf6,0xf4,0xb3,0x21,0x15,0x78,0x99,0xb1,0xaf,0xf9, + 0xe7,0x2d,0x4d,0x8a,0xce,0x4c,0xca,0x2e,0x52,0x95,0xd9,0x1e,0x4e,0x38,0x44,0x28, + 0x0a,0xdf,0x02,0xa0,0x17,0xf1,0x60,0x68,0x12,0xb7,0x7a,0xc3,0xe9,0xfa,0x3d,0x53, + 0x96,0x84,0x6b,0xba,0xf2,0x63,0x9a,0x19,0x7c,0xae,0xe5,0xf5,0xf7,0x16,0x6a,0xa2, + 0x39,0xb6,0x7b,0x0f,0xc1,0x93,0x81,0x1b,0xee,0xb4,0x1a,0xea,0xd0,0x91,0x2f,0xb8, + 0x55,0xb9,0xda,0x85,0x3f,0x41,0xbf,0xe0,0x5a,0x58,0x80,0x5f,0x66,0x0b,0xd8,0x90, + 0x35,0xd5,0xc0,0xa7,0x33,0x06,0x65,0x69,0x45,0x00,0x94,0x56,0x6d,0x98,0x9b,0x76, + 0x97,0xfc,0xb2,0xc2,0xb0,0xfe,0xdb,0x20,0xe1,0xeb,0xd6,0xe4,0xdd,0x47,0x4a,0x1d, + 0x42,0xed,0x9e,0x6e,0x49,0x3c,0xcd,0x43,0x27,0xd2,0x07,0xd4,0xde,0xc7,0x67,0x18, + 0x89,0xcb,0x30,0x1f,0x8d,0xc6,0x8f,0xaa,0xc8,0x74,0xdc,0xc9,0x5d,0x5c,0x31,0xa4, + 0x70,0x88,0x61,0x2c,0x9f,0x0d,0x2b,0x87,0x50,0x82,0x54,0x64,0x26,0x7d,0x03,0x40, + 0x34,0x4b,0x1c,0x73,0xd1,0xc4,0xfd,0x3b,0xcc,0xfb,0x7f,0xab,0xe6,0x3e,0x5b,0xa5, + 0xad,0x04,0x23,0x9c,0x14,0x51,0x22,0xf0,0x29,0x79,0x71,0x7e,0xff,0x8c,0x0e,0xe2, + 0x0c,0xef,0xbc,0x72,0x75,0x6f,0x37,0xa1,0xec,0xd3,0x8e,0x62,0x8b,0x86,0x10,0xe8, + 0x08,0x77,0x11,0xbe,0x92,0x4f,0x24,0xc5,0x32,0x36,0x9d,0xcf,0xf3,0xa6,0xbb,0xac, + 0x5e,0x6c,0xa9,0x13,0x57,0x25,0xb5,0xe3,0xbd,0xa8,0x3a,0x01,0x05,0x59,0x2a,0x46 +}; + +/** + * The key-dependent permutation G on V^16 is a four-round Feistel network. + * The round function is a fixed byte-substitution table (permutation on V^8), + * the F-table. Each round of G incorporates a single byte from the key. + */ +#define g(tab, w, i, j, k, l) \ +{ \ + w ^= (word)tab[i*256 + (w & 0xff)] << 8; \ + w ^= (word)tab[j*256 + (w >> 8)]; \ + w ^= (word)tab[k*256 + (w & 0xff)] << 8; \ + w ^= (word)tab[l*256 + (w >> 8)]; \ +} + +#define g0(tab, w) g(tab, w, 0, 1, 2, 3) +#define g1(tab, w) g(tab, w, 4, 5, 6, 7) +#define g2(tab, w) g(tab, w, 8, 9, 0, 1) +#define g3(tab, w) g(tab, w, 2, 3, 4, 5) +#define g4(tab, w) g(tab, w, 6, 7, 8, 9) + +/** + * The inverse of the G permutation. + */ +#define h(tab, w, i, j, k, l) \ +{ \ + w ^= (word)tab[l*256 + (w >> 8)]; \ + w ^= (word)tab[k*256 + (w & 0xff)] << 8; \ + w ^= (word)tab[j*256 + (w >> 8)]; \ + w ^= (word)tab[i*256 + (w & 0xff)] << 8; \ +} + +#define h0(tab, w) h(tab, w, 0, 1, 2, 3) +#define h1(tab, w) h(tab, w, 4, 5, 6, 7) +#define h2(tab, w) h(tab, w, 8, 9, 0, 1) +#define h3(tab, w) h(tab, w, 2, 3, 4, 5) +#define h4(tab, w) h(tab, w, 6, 7, 8, 9) + +/** + * Preprocess a user key into a table to save an XOR at each F-table access. + */ +void SKIPJACK::Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + /* tab[i][c] = fTable[c ^ key[i]] */ + int i; + for (i = 0; i < 10; i++) { + byte *t = tab+i*256, k = key[9-i]; + int c; + for (c = 0; c < 256; c++) { + t[c] = fTable[c ^ k]; + } + } +} + +typedef BlockGetAndPut Block; + +/** + * Encrypt a single block of data. + */ +void SKIPJACK::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word16 w1, w2, w3, w4; + Block::Get(inBlock)(w4)(w3)(w2)(w1); + + /* stepping rule A: */ + g0(tab, w1); w4 ^= w1 ^ 1; + g1(tab, w4); w3 ^= w4 ^ 2; + g2(tab, w3); w2 ^= w3 ^ 3; + g3(tab, w2); w1 ^= w2 ^ 4; + g4(tab, w1); w4 ^= w1 ^ 5; + g0(tab, w4); w3 ^= w4 ^ 6; + g1(tab, w3); w2 ^= w3 ^ 7; + g2(tab, w2); w1 ^= w2 ^ 8; + + /* stepping rule B: */ + w2 ^= w1 ^ 9; g3(tab, w1); + w1 ^= w4 ^ 10; g4(tab, w4); + w4 ^= w3 ^ 11; g0(tab, w3); + w3 ^= w2 ^ 12; g1(tab, w2); + w2 ^= w1 ^ 13; g2(tab, w1); + w1 ^= w4 ^ 14; g3(tab, w4); + w4 ^= w3 ^ 15; g4(tab, w3); + w3 ^= w2 ^ 16; g0(tab, w2); + + /* stepping rule A: */ + g1(tab, w1); w4 ^= w1 ^ 17; + g2(tab, w4); w3 ^= w4 ^ 18; + g3(tab, w3); w2 ^= w3 ^ 19; + g4(tab, w2); w1 ^= w2 ^ 20; + g0(tab, w1); w4 ^= w1 ^ 21; + g1(tab, w4); w3 ^= w4 ^ 22; + g2(tab, w3); w2 ^= w3 ^ 23; + g3(tab, w2); w1 ^= w2 ^ 24; + + /* stepping rule B: */ + w2 ^= w1 ^ 25; g4(tab, w1); + w1 ^= w4 ^ 26; g0(tab, w4); + w4 ^= w3 ^ 27; g1(tab, w3); + w3 ^= w2 ^ 28; g2(tab, w2); + w2 ^= w1 ^ 29; g3(tab, w1); + w1 ^= w4 ^ 30; g4(tab, w4); + w4 ^= w3 ^ 31; g0(tab, w3); + w3 ^= w2 ^ 32; g1(tab, w2); + + Block::Put(xorBlock, outBlock)(w4)(w3)(w2)(w1); +} + +/** + * Decrypt a single block of data. + */ +void SKIPJACK::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word16 w1, w2, w3, w4; + Block::Get(inBlock)(w4)(w3)(w2)(w1); + + /* stepping rule A: */ + h1(tab, w2); w3 ^= w2 ^ 32; + h0(tab, w3); w4 ^= w3 ^ 31; + h4(tab, w4); w1 ^= w4 ^ 30; + h3(tab, w1); w2 ^= w1 ^ 29; + h2(tab, w2); w3 ^= w2 ^ 28; + h1(tab, w3); w4 ^= w3 ^ 27; + h0(tab, w4); w1 ^= w4 ^ 26; + h4(tab, w1); w2 ^= w1 ^ 25; + + /* stepping rule B: */ + w1 ^= w2 ^ 24; h3(tab, w2); + w2 ^= w3 ^ 23; h2(tab, w3); + w3 ^= w4 ^ 22; h1(tab, w4); + w4 ^= w1 ^ 21; h0(tab, w1); + w1 ^= w2 ^ 20; h4(tab, w2); + w2 ^= w3 ^ 19; h3(tab, w3); + w3 ^= w4 ^ 18; h2(tab, w4); + w4 ^= w1 ^ 17; h1(tab, w1); + + /* stepping rule A: */ + h0(tab, w2); w3 ^= w2 ^ 16; + h4(tab, w3); w4 ^= w3 ^ 15; + h3(tab, w4); w1 ^= w4 ^ 14; + h2(tab, w1); w2 ^= w1 ^ 13; + h1(tab, w2); w3 ^= w2 ^ 12; + h0(tab, w3); w4 ^= w3 ^ 11; + h4(tab, w4); w1 ^= w4 ^ 10; + h3(tab, w1); w2 ^= w1 ^ 9; + + /* stepping rule B: */ + w1 ^= w2 ^ 8; h2(tab, w2); + w2 ^= w3 ^ 7; h1(tab, w3); + w3 ^= w4 ^ 6; h0(tab, w4); + w4 ^= w1 ^ 5; h4(tab, w1); + w1 ^= w2 ^ 4; h3(tab, w2); + w2 ^= w3 ^ 3; h2(tab, w3); + w3 ^= w4 ^ 2; h1(tab, w4); + w4 ^= w1 ^ 1; h0(tab, w1); + + Block::Put(xorBlock, outBlock)(w4)(w3)(w2)(w1); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/skipjack.h b/external/crypto++-5.6.3/skipjack.h new file mode 100644 index 000000000..76960a5aa --- /dev/null +++ b/external/crypto++-5.6.3/skipjack.h @@ -0,0 +1,63 @@ +// skipjack.h - written and placed in the public domain by Wei Dai + +//! \file skipjack.h +//! \brief Classes for the SKIPJACK block cipher + +#ifndef CRYPTOPP_SKIPJACK_H +#define CRYPTOPP_SKIPJACK_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10> +{ + CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "SKIPJACK";} +}; + +/// SKIPJACK +class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} + + protected: + static const byte fTable[256]; + + FixedSizeSecBlock tab; + }; + + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + private: + static const byte Se[256]; + static const word32 Te[4][256]; + }; + + class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + private: + static const byte Sd[256]; + static const word32 Td[4][256]; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef SKIPJACK::Encryption SKIPJACKEncryption; +typedef SKIPJACK::Decryption SKIPJACKDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/smartptr.h b/external/crypto++-5.6.3/smartptr.h new file mode 100644 index 000000000..bf06f5f86 --- /dev/null +++ b/external/crypto++-5.6.3/smartptr.h @@ -0,0 +1,321 @@ +// smartptr.h - written and placed in the public domain by Wei Dai + +//! \file +//! \headerfile smartptr.h +//! \brief Classes for automatic resource management + +#ifndef CRYPTOPP_SMARTPTR_H +#define CRYPTOPP_SMARTPTR_H + +#include "config.h" +#include "stdcpp.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! \class simple_ptr +//! \brief Manages resources for a single object +//! \tparam T class or type +//! \details \p simple_ptr is used frequently in the library to manage resources and +//! ensure cleanup under the RAII pattern (Resource Acquisition Is Initialization). +template class simple_ptr +{ +public: + simple_ptr(T *p = NULL) : m_p(p) {} + ~simple_ptr() + { + delete m_p; + *((volatile T**)&m_p) = NULL; + } + + T *m_p; +}; + +//! \class member_ptr +//! \brief Pointer that overloads operator→ +//! \tparam T class or type +//! \details member_ptr is used frequently in the library to avoid the issues related to +//! std::auto_ptr in C++11 (deprecated) and std::unique_ptr in C++03 (non-existent). +//! \bug Issue 48: "Use of auto_ptr causes dirty compile under C++11" +template class member_ptr +{ +public: + explicit member_ptr(T *p = NULL) : m_p(p) {} + + ~member_ptr(); + + const T& operator*() const { return *m_p; } + T& operator*() { return *m_p; } + + const T* operator->() const { return m_p; } + T* operator->() { return m_p; } + + const T* get() const { return m_p; } + T* get() { return m_p; } + + T* release() + { + T *old_p = m_p; + *((volatile T**)&m_p) = NULL; + return old_p; + } + + void reset(T *p = 0); + +protected: + member_ptr(const member_ptr& rhs); // copy not allowed + void operator=(const member_ptr& rhs); // assignment not allowed + + T *m_p; +}; + +template member_ptr::~member_ptr() {delete m_p;} +template void member_ptr::reset(T *p) {delete m_p; m_p = p;} + +// ******************************************************** + +//! \class value_ptr +//! \brief Value pointer +//! \tparam T class or type +template class value_ptr : public member_ptr +{ +public: + value_ptr(const T &obj) : member_ptr(new T(obj)) {} + value_ptr(T *p = NULL) : member_ptr(p) {} + value_ptr(const value_ptr& rhs) + : member_ptr(rhs.m_p ? new T(*rhs.m_p) : NULL) {} + + value_ptr& operator=(const value_ptr& rhs); + bool operator==(const value_ptr& rhs) + { + return (!this->m_p && !rhs.m_p) || (this->m_p && rhs.m_p && *this->m_p == *rhs.m_p); + } +}; + +template value_ptr& value_ptr::operator=(const value_ptr& rhs) +{ + T *old_p = this->m_p; + this->m_p = rhs.m_p ? new T(*rhs.m_p) : NULL; + delete old_p; + return *this; +} + +// ******************************************************** + +//! \class clonable_ptr +//! \brief A pointer which can be copied and cloned +//! \tparam T class or type +//! \details \p T should adhere to the \p Clonable interface +template class clonable_ptr : public member_ptr +{ +public: + clonable_ptr(const T &obj) : member_ptr(obj.Clone()) {} + clonable_ptr(T *p = NULL) : member_ptr(p) {} + clonable_ptr(const clonable_ptr& rhs) + : member_ptr(rhs.m_p ? rhs.m_p->Clone() : NULL) {} + + clonable_ptr& operator=(const clonable_ptr& rhs); +}; + +template clonable_ptr& clonable_ptr::operator=(const clonable_ptr& rhs) +{ + T *old_p = this->m_p; + this->m_p = rhs.m_p ? rhs.m_p->Clone() : NULL; + delete old_p; + return *this; +} + +// ******************************************************** + +//! \class counted_ptr +//! \brief Reference counted pointer +//! \tparam T class or type +//! \details users should declare \p m_referenceCount as std::atomic +//! (or similar) under C++ 11 +template class counted_ptr +{ +public: + explicit counted_ptr(T *p = 0); + counted_ptr(const T &r) : m_p(0) {attach(r);} + counted_ptr(const counted_ptr& rhs); + + ~counted_ptr(); + + const T& operator*() const { return *m_p; } + T& operator*() { return *m_p; } + + const T* operator->() const { return m_p; } + T* operator->() { return get(); } + + const T* get() const { return m_p; } + T* get(); + + void attach(const T &p); + + counted_ptr & operator=(const counted_ptr& rhs); + +private: + T *m_p; +}; + +template counted_ptr::counted_ptr(T *p) + : m_p(p) +{ + if (m_p) + m_p->m_referenceCount = 1; +} + +template counted_ptr::counted_ptr(const counted_ptr& rhs) + : m_p(rhs.m_p) +{ + if (m_p) + m_p->m_referenceCount++; +} + +template counted_ptr::~counted_ptr() +{ + if (m_p && --m_p->m_referenceCount == 0) + delete m_p; +} + +template void counted_ptr::attach(const T &r) +{ + if (m_p && --m_p->m_referenceCount == 0) + delete m_p; + if (r.m_referenceCount == 0) + { + m_p = r.clone(); + m_p->m_referenceCount = 1; + } + else + { + m_p = const_cast(&r); + m_p->m_referenceCount++; + } +} + +template T* counted_ptr::get() +{ + if (m_p && m_p->m_referenceCount > 1) + { + T *temp = m_p->clone(); + m_p->m_referenceCount--; + m_p = temp; + m_p->m_referenceCount = 1; + } + return m_p; +} + +template counted_ptr & counted_ptr::operator=(const counted_ptr& rhs) +{ + if (m_p != rhs.m_p) + { + if (m_p && --m_p->m_referenceCount == 0) + delete m_p; + m_p = rhs.m_p; + if (m_p) + m_p->m_referenceCount++; + } + return *this; +} + +// ******************************************************** + +//! \class vector_ptr +//! \brief Manages resources for an array of objects +//! \tparam T class or type +//! \details \p vector_ptr is used frequently in the library to avoid large stack allocations, +//! and manage resources and ensure cleanup under the RAII pattern (Resource Acquisition +//! Is Initialization). +template class vector_ptr +{ +public: + //! Construct an arry of \p T + //! \param size the size of the array, in elements + //! \details If \p T is a Plain Old Dataype (POD), then the array is uninitialized. + vector_ptr(size_t size=0) + : m_size(size), m_ptr(new T[m_size]) {} + ~vector_ptr() + {delete [] m_ptr;} + + T& operator[](size_t index) + {assert(m_size && indexm_size); return this->m_ptr[index];} + const T& operator[](size_t index) const + {assert(m_size && indexm_size); return this->m_ptr[index];} + + size_t size() const {return this->m_size;} + void resize(size_t newSize) + { + T *newPtr = new T[newSize]; + for (size_t i=0; im_size && im_ptr; + this->m_size = newSize; + this->m_ptr = newPtr; + } + +#ifdef __BORLANDC__ + operator T *() const + {return (T*)m_ptr;} +#else + operator const void *() const + {return m_ptr;} + operator void *() + {return m_ptr;} + + operator const T *() const + {return m_ptr;} + operator T *() + {return m_ptr;} +#endif + +private: + vector_ptr(const vector_ptr &c); // copy not allowed + void operator=(const vector_ptr &x); // assignment not allowed + + size_t m_size; + T *m_ptr; +}; + +// ******************************************************** + +//! \class vector_member_ptrs +//! \brief Manages resources for an array of objects +//! \tparam T class or type +template class vector_member_ptrs +{ +public: + //! Construct an arry of \p T + //! \param size the size of the array, in elements + //! \details If \p T is a Plain Old Dataype (POD), then the array is uninitialized. + vector_member_ptrs(size_t size=0) + : m_size(size), m_ptr(new member_ptr[size]) {} + ~vector_member_ptrs() + {delete [] this->m_ptr;} + + member_ptr& operator[](size_t index) + {assert(indexm_size); return this->m_ptr[index];} + const member_ptr& operator[](size_t index) const + {assert(indexm_size); return this->m_ptr[index];} + + size_t size() const {return this->m_size;} + void resize(size_t newSize) + { + member_ptr *newPtr = new member_ptr[newSize]; + for (size_t i=0; im_size && im_ptr[i].release()); + delete [] this->m_ptr; + this->m_size = newSize; + this->m_ptr = newPtr; + } + +private: + vector_member_ptrs(const vector_member_ptrs &c); // copy not allowed + void operator=(const vector_member_ptrs &x); // assignment not allowed + + size_t m_size; + member_ptr *m_ptr; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/socketft.cpp b/external/crypto++-5.6.3/socketft.cpp new file mode 100644 index 000000000..21ba01f75 --- /dev/null +++ b/external/crypto++-5.6.3/socketft.cpp @@ -0,0 +1,546 @@ +// socketft.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +// TODO: http://github.com/weidai11/cryptopp/issues/19 +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#include "socketft.h" + +#ifdef SOCKETS_AVAILABLE + +#include "wait.h" + +#ifdef USE_BERKELEY_STYLE_SOCKETS +#include +#include +#include +#include +#include +#include +#endif + +#ifdef PREFER_WINDOWS_STYLE_SOCKETS +# pragma comment(lib, "ws2_32.lib") +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#ifdef USE_WINDOWS_STYLE_SOCKETS +const int SOCKET_EINVAL = WSAEINVAL; +const int SOCKET_EWOULDBLOCK = WSAEWOULDBLOCK; +typedef int socklen_t; +#else +const int SOCKET_EINVAL = EINVAL; +const int SOCKET_EWOULDBLOCK = EWOULDBLOCK; +#endif + +// Solaris doesn't have INADDR_NONE +#ifndef INADDR_NONE +# define INADDR_NONE 0xffffffff +#endif /* INADDR_NONE */ + +Socket::Err::Err(socket_t s, const std::string& operation, int error) + : OS_Error(IO_ERROR, "Socket: " + operation + " operation failed with error " + IntToString(error), operation, error) + , m_s(s) +{ +} + +Socket::~Socket() +{ + if (m_own) + { + try + { + CloseSocket(); + } + catch (const Exception&) + { + assert(0); + } + } +} + +void Socket::AttachSocket(socket_t s, bool own) +{ + if (m_own) + CloseSocket(); + + m_s = s; + m_own = own; + SocketChanged(); +} + +socket_t Socket::DetachSocket() +{ + socket_t s = m_s; + m_s = INVALID_SOCKET; + SocketChanged(); + return s; +} + +void Socket::Create(int nType) +{ + assert(m_s == INVALID_SOCKET); + m_s = socket(AF_INET, nType, 0); + CheckAndHandleError("socket", m_s); + m_own = true; + SocketChanged(); +} + +void Socket::CloseSocket() +{ + if (m_s != INVALID_SOCKET) + { +#ifdef USE_WINDOWS_STYLE_SOCKETS + CancelIo((HANDLE) m_s); + CheckAndHandleError_int("closesocket", closesocket(m_s)); +#else + CheckAndHandleError_int("close", close(m_s)); +#endif + m_s = INVALID_SOCKET; + SocketChanged(); + } +} + +void Socket::Bind(unsigned int port, const char *addr) +{ + sockaddr_in sa; + memset(&sa, 0, sizeof(sa)); + sa.sin_family = AF_INET; + + if (addr == NULL) + sa.sin_addr.s_addr = htonl(INADDR_ANY); + else + { + unsigned long result = inet_addr(addr); + if (result == INADDR_NONE) + { + SetLastError(SOCKET_EINVAL); + CheckAndHandleError_int("inet_addr", SOCKET_ERROR); + } + sa.sin_addr.s_addr = result; + } + + sa.sin_port = htons((u_short)port); + + Bind((sockaddr *)&sa, sizeof(sa)); +} + +void Socket::Bind(const sockaddr *psa, socklen_t saLen) +{ + assert(m_s != INVALID_SOCKET); + // cygwin workaround: needs const_cast + CheckAndHandleError_int("bind", bind(m_s, const_cast(psa), saLen)); +} + +void Socket::Listen(int backlog) +{ + assert(m_s != INVALID_SOCKET); + CheckAndHandleError_int("listen", listen(m_s, backlog)); +} + +bool Socket::Connect(const char *addr, unsigned int port) +{ + assert(addr != NULL); + + sockaddr_in sa; + memset(&sa, 0, sizeof(sa)); + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = inet_addr(addr); + + if (sa.sin_addr.s_addr == INADDR_NONE) + { + hostent *lphost = gethostbyname(addr); + if (lphost == NULL) + { + SetLastError(SOCKET_EINVAL); + CheckAndHandleError_int("gethostbyname", SOCKET_ERROR); + } + else + { + sa.sin_addr.s_addr = ((in_addr *)lphost->h_addr)->s_addr; + } + } + + sa.sin_port = htons((u_short)port); + + return Connect((const sockaddr *)&sa, sizeof(sa)); +} + +bool Socket::Connect(const sockaddr* psa, socklen_t saLen) +{ + assert(m_s != INVALID_SOCKET); + int result = connect(m_s, const_cast(psa), saLen); + if (result == SOCKET_ERROR && GetLastError() == SOCKET_EWOULDBLOCK) + return false; + CheckAndHandleError_int("connect", result); + return true; +} + +bool Socket::Accept(Socket& target, sockaddr *psa, socklen_t *psaLen) +{ + assert(m_s != INVALID_SOCKET); + socket_t s = accept(m_s, psa, psaLen); + if (s == INVALID_SOCKET && GetLastError() == SOCKET_EWOULDBLOCK) + return false; + CheckAndHandleError("accept", s); + target.AttachSocket(s, true); + return true; +} + +void Socket::GetSockName(sockaddr *psa, socklen_t *psaLen) +{ + assert(m_s != INVALID_SOCKET); + CheckAndHandleError_int("getsockname", getsockname(m_s, psa, psaLen)); +} + +void Socket::GetPeerName(sockaddr *psa, socklen_t *psaLen) +{ + assert(m_s != INVALID_SOCKET); + CheckAndHandleError_int("getpeername", getpeername(m_s, psa, psaLen)); +} + +unsigned int Socket::Send(const byte* buf, size_t bufLen, int flags) +{ + assert(m_s != INVALID_SOCKET); + int result = send(m_s, (const char *)buf, UnsignedMin(INT_MAX, bufLen), flags); + CheckAndHandleError_int("send", result); + return result; +} + +unsigned int Socket::Receive(byte* buf, size_t bufLen, int flags) +{ + assert(m_s != INVALID_SOCKET); + int result = recv(m_s, (char *)buf, UnsignedMin(INT_MAX, bufLen), flags); + CheckAndHandleError_int("recv", result); + return result; +} + +void Socket::ShutDown(int how) +{ + assert(m_s != INVALID_SOCKET); + int result = shutdown(m_s, how); + CheckAndHandleError_int("shutdown", result); +} + +void Socket::IOCtl(long cmd, unsigned long *argp) +{ + assert(m_s != INVALID_SOCKET); +#ifdef USE_WINDOWS_STYLE_SOCKETS + CheckAndHandleError_int("ioctlsocket", ioctlsocket(m_s, cmd, argp)); +#else + CheckAndHandleError_int("ioctl", ioctl(m_s, cmd, argp)); +#endif +} + +bool Socket::SendReady(const timeval *timeout) +{ + fd_set fds; + FD_ZERO(&fds); + FD_SET(m_s, &fds); + int ready; + if (timeout == NULL) + ready = select((int)m_s+1, NULL, &fds, NULL, NULL); + else + { + timeval timeoutCopy = *timeout; // select() modified timeout on Linux + ready = select((int)m_s+1, NULL, &fds, NULL, &timeoutCopy); + } + CheckAndHandleError_int("select", ready); + return ready > 0; +} + +bool Socket::ReceiveReady(const timeval *timeout) +{ + fd_set fds; + FD_ZERO(&fds); + FD_SET(m_s, &fds); + int ready; + if (timeout == NULL) + ready = select((int)m_s+1, &fds, NULL, NULL, NULL); + else + { + timeval timeoutCopy = *timeout; // select() modified timeout on Linux + ready = select((int)m_s+1, &fds, NULL, NULL, &timeoutCopy); + } + CheckAndHandleError_int("select", ready); + return ready > 0; +} + +unsigned int Socket::PortNameToNumber(const char *name, const char *protocol) +{ + int port = atoi(name); + if (IntToString(port) == name) + return port; + + servent *se = getservbyname(name, protocol); + if (!se) + throw Err(INVALID_SOCKET, "getservbyname", SOCKET_EINVAL); + return ntohs(se->s_port); +} + +void Socket::StartSockets() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + WSADATA wsd; + int result = WSAStartup(0x0202, &wsd); + if (result != 0) + throw Err(INVALID_SOCKET, "WSAStartup", result); +#endif +} + +void Socket::ShutdownSockets() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + int result = WSACleanup(); + if (result != 0) + throw Err(INVALID_SOCKET, "WSACleanup", result); +#endif +} + +int Socket::GetLastError() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + return WSAGetLastError(); +#else + return errno; +#endif +} + +void Socket::SetLastError(int errorCode) +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + WSASetLastError(errorCode); +#else + errno = errorCode; +#endif +} + +void Socket::HandleError(const char *operation) const +{ + int err = GetLastError(); + throw Err(m_s, operation, err); +} + +#ifdef USE_WINDOWS_STYLE_SOCKETS + +SocketReceiver::SocketReceiver(Socket &s) + : m_s(s), m_eofReceived(false), m_resultPending(false) +{ + m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); + m_s.CheckAndHandleError("CreateEvent", m_event.HandleValid()); + memset(&m_overlapped, 0, sizeof(m_overlapped)); + m_overlapped.hEvent = m_event; +} + +SocketReceiver::~SocketReceiver() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + CancelIo((HANDLE) m_s.GetSocket()); +#endif +} + +bool SocketReceiver::Receive(byte* buf, size_t bufLen) +{ + assert(!m_resultPending && !m_eofReceived); + + DWORD flags = 0; + // don't queue too much at once, or we might use up non-paged memory + WSABUF wsabuf = {UnsignedMin((u_long)128*1024, bufLen), (char *)buf}; + if (WSARecv(m_s, &wsabuf, 1, &m_lastResult, &flags, &m_overlapped, NULL) == 0) + { + if (m_lastResult == 0) + m_eofReceived = true; + } + else + { + switch (WSAGetLastError()) + { + default: + m_s.CheckAndHandleError_int("WSARecv", SOCKET_ERROR); + case WSAEDISCON: + m_lastResult = 0; + m_eofReceived = true; + break; + case WSA_IO_PENDING: + m_resultPending = true; + } + } + return !m_resultPending; +} + +void SocketReceiver::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (m_resultPending) + container.AddHandle(m_event, CallStack("SocketReceiver::GetWaitObjects() - result pending", &callStack)); + else if (!m_eofReceived) + container.SetNoWait(CallStack("SocketReceiver::GetWaitObjects() - result ready", &callStack)); +} + +unsigned int SocketReceiver::GetReceiveResult() +{ + if (m_resultPending) + { + DWORD flags = 0; + if (WSAGetOverlappedResult(m_s, &m_overlapped, &m_lastResult, false, &flags)) + { + if (m_lastResult == 0) + m_eofReceived = true; + } + else + { + switch (WSAGetLastError()) + { + default: + m_s.CheckAndHandleError("WSAGetOverlappedResult", FALSE); + case WSAEDISCON: + m_lastResult = 0; + m_eofReceived = true; + } + } + m_resultPending = false; + } + return m_lastResult; +} + +// ************************************************************* + +SocketSender::SocketSender(Socket &s) + : m_s(s), m_resultPending(false), m_lastResult(0) +{ + m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); + m_s.CheckAndHandleError("CreateEvent", m_event.HandleValid()); + memset(&m_overlapped, 0, sizeof(m_overlapped)); + m_overlapped.hEvent = m_event; +} + + +SocketSender::~SocketSender() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + CancelIo((HANDLE) m_s.GetSocket()); +#endif +} + +void SocketSender::Send(const byte* buf, size_t bufLen) +{ + assert(!m_resultPending); + DWORD written = 0; + // don't queue too much at once, or we might use up non-paged memory + WSABUF wsabuf = {UnsignedMin((u_long)128*1024, bufLen), (char *)buf}; + if (WSASend(m_s, &wsabuf, 1, &written, 0, &m_overlapped, NULL) == 0) + { + m_resultPending = false; + m_lastResult = written; + } + else + { + if (WSAGetLastError() != WSA_IO_PENDING) + m_s.CheckAndHandleError_int("WSASend", SOCKET_ERROR); + + m_resultPending = true; + } +} + +void SocketSender::SendEof() +{ + assert(!m_resultPending); + m_s.ShutDown(SD_SEND); + m_s.CheckAndHandleError("ResetEvent", ResetEvent(m_event)); + m_s.CheckAndHandleError_int("WSAEventSelect", WSAEventSelect(m_s, m_event, FD_CLOSE)); + m_resultPending = true; +} + +bool SocketSender::EofSent() +{ + if (m_resultPending) + { + WSANETWORKEVENTS events; + m_s.CheckAndHandleError_int("WSAEnumNetworkEvents", WSAEnumNetworkEvents(m_s, m_event, &events)); + if ((events.lNetworkEvents & FD_CLOSE) != FD_CLOSE) + throw Socket::Err(m_s, "WSAEnumNetworkEvents (FD_CLOSE not present)", E_FAIL); + if (events.iErrorCode[FD_CLOSE_BIT] != 0) + throw Socket::Err(m_s, "FD_CLOSE (via WSAEnumNetworkEvents)", events.iErrorCode[FD_CLOSE_BIT]); + m_resultPending = false; + } + return m_lastResult != 0; +} + +void SocketSender::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (m_resultPending) + container.AddHandle(m_event, CallStack("SocketSender::GetWaitObjects() - result pending", &callStack)); + else + container.SetNoWait(CallStack("SocketSender::GetWaitObjects() - result ready", &callStack)); +} + +unsigned int SocketSender::GetSendResult() +{ + if (m_resultPending) + { + DWORD flags = 0; + BOOL result = WSAGetOverlappedResult(m_s, &m_overlapped, &m_lastResult, false, &flags); + m_s.CheckAndHandleError("WSAGetOverlappedResult", result); + m_resultPending = false; + } + return m_lastResult; +} + +#endif + +#ifdef USE_BERKELEY_STYLE_SOCKETS + +SocketReceiver::SocketReceiver(Socket &s) + : m_s(s), m_eofReceived(false), m_lastResult(0) +{ +} + +void SocketReceiver::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (!m_eofReceived) + container.AddReadFd(m_s, CallStack("SocketReceiver::GetWaitObjects()", &callStack)); +} + +bool SocketReceiver::Receive(byte* buf, size_t bufLen) +{ + m_lastResult = m_s.Receive(buf, bufLen); + if (bufLen > 0 && m_lastResult == 0) + m_eofReceived = true; + return true; +} + +unsigned int SocketReceiver::GetReceiveResult() +{ + return m_lastResult; +} + +SocketSender::SocketSender(Socket &s) + : m_s(s), m_lastResult(0) +{ +} + +void SocketSender::Send(const byte* buf, size_t bufLen) +{ + m_lastResult = m_s.Send(buf, bufLen); +} + +void SocketSender::SendEof() +{ + m_s.ShutDown(SD_SEND); +} + +unsigned int SocketSender::GetSendResult() +{ + return m_lastResult; +} + +void SocketSender::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + container.AddWriteFd(m_s, CallStack("SocketSender::GetWaitObjects()", &callStack)); +} + +#endif + +NAMESPACE_END + +#endif // #ifdef SOCKETS_AVAILABLE diff --git a/external/crypto++-5.6.3/socketft.h b/external/crypto++-5.6.3/socketft.h new file mode 100644 index 000000000..7c605582e --- /dev/null +++ b/external/crypto++-5.6.3/socketft.h @@ -0,0 +1,223 @@ +#ifndef CRYPTOPP_SOCKETFT_H +#define CRYPTOPP_SOCKETFT_H + +#ifdef SOCKETS_AVAILABLE + +#include "cryptlib.h" +#include "network.h" +#include "queue.h" + +#ifdef USE_WINDOWS_STYLE_SOCKETS +# if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) +# error Winsock 1 is not supported by this library. Please include this file or winsock2.h before windows.h. +# endif +#include +#include "winpipes.h" +#else +#include +#include +#include +#include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#ifdef USE_WINDOWS_STYLE_SOCKETS +typedef ::SOCKET socket_t; +#else +typedef int socket_t; +const socket_t INVALID_SOCKET = -1; +// cygwin 1.1.4 doesn't have SHUT_RD +const int SD_RECEIVE = 0; +const int SD_SEND = 1; +const int SD_BOTH = 2; +const int SOCKET_ERROR = -1; +#endif + +#ifndef socklen_t +typedef TYPE_OF_SOCKLEN_T socklen_t; // see config.h +#endif + +//! wrapper for Windows or Berkeley Sockets +class Socket +{ +public: + //! exception thrown by Socket class + class Err : public OS_Error + { + public: + Err(socket_t s, const std::string& operation, int error); + socket_t GetSocket() const {return m_s;} + + private: + socket_t m_s; + }; + + Socket(socket_t s = INVALID_SOCKET, bool own=false) : m_s(s), m_own(own) {} + Socket(const Socket &s) : m_s(s.m_s), m_own(false) {} + virtual ~Socket(); + + bool GetOwnership() const {return m_own;} + void SetOwnership(bool own) {m_own = own;} + + operator socket_t() {return m_s;} + socket_t GetSocket() const {return m_s;} + void AttachSocket(socket_t s, bool own=false); + socket_t DetachSocket(); + void CloseSocket(); + + void Create(int nType = SOCK_STREAM); + void Bind(unsigned int port, const char *addr=NULL); + void Bind(const sockaddr* psa, socklen_t saLen); + void Listen(int backlog=5); + // the next three functions return false if the socket is in nonblocking mode + // and the operation cannot be completed immediately + bool Connect(const char *addr, unsigned int port); + bool Connect(const sockaddr* psa, socklen_t saLen); + bool Accept(Socket& s, sockaddr *psa=NULL, socklen_t *psaLen=NULL); + void GetSockName(sockaddr *psa, socklen_t *psaLen); + void GetPeerName(sockaddr *psa, socklen_t *psaLen); + unsigned int Send(const byte* buf, size_t bufLen, int flags=0); + unsigned int Receive(byte* buf, size_t bufLen, int flags=0); + void ShutDown(int how = SD_SEND); + + void IOCtl(long cmd, unsigned long *argp); + bool SendReady(const timeval *timeout); + bool ReceiveReady(const timeval *timeout); + + virtual void HandleError(const char *operation) const; + void CheckAndHandleError_int(const char *operation, int result) const + {if (result == SOCKET_ERROR) HandleError(operation);} + void CheckAndHandleError(const char *operation, socket_t result) const + {if (result == static_cast(SOCKET_ERROR)) HandleError(operation);} +#ifdef USE_WINDOWS_STYLE_SOCKETS + void CheckAndHandleError(const char *operation, BOOL result) const + {assert(result==TRUE || result==FALSE); if (!result) HandleError(operation);} + void CheckAndHandleError(const char *operation, bool result) const + {if (!result) HandleError(operation);} +#endif + + //! look up the port number given its name, returns 0 if not found + static unsigned int PortNameToNumber(const char *name, const char *protocol="tcp"); + //! start Windows Sockets 2 + static void StartSockets(); + //! calls WSACleanup for Windows Sockets + static void ShutdownSockets(); + //! returns errno or WSAGetLastError + static int GetLastError(); + //! sets errno or calls WSASetLastError + static void SetLastError(int errorCode); + +protected: + virtual void SocketChanged() {} + + socket_t m_s; + bool m_own; +}; + +class SocketsInitializer +{ +public: + SocketsInitializer() {Socket::StartSockets();} + ~SocketsInitializer() {try {Socket::ShutdownSockets();} catch (const Exception&) {assert(0);}} +}; + +class SocketReceiver : public NetworkReceiver +{ +public: + SocketReceiver(Socket &s); + +#ifdef USE_BERKELEY_STYLE_SOCKETS + bool MustWaitToReceive() {return true;} +#else + ~SocketReceiver(); + bool MustWaitForResult() {return true;} +#endif + bool Receive(byte* buf, size_t bufLen); + unsigned int GetReceiveResult(); + bool EofReceived() const {return m_eofReceived;} + + unsigned int GetMaxWaitObjectCount() const {return 1;} + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + +private: + Socket &m_s; + bool m_eofReceived; + +#ifdef USE_WINDOWS_STYLE_SOCKETS + WindowsHandle m_event; + OVERLAPPED m_overlapped; + bool m_resultPending; + DWORD m_lastResult; +#else + unsigned int m_lastResult; +#endif +}; + +class SocketSender : public NetworkSender +{ +public: + SocketSender(Socket &s); + +#ifdef USE_BERKELEY_STYLE_SOCKETS + bool MustWaitToSend() {return true;} +#else + ~SocketSender(); + bool MustWaitForResult() {return true;} + bool MustWaitForEof() { return true; } + bool EofSent(); +#endif + void Send(const byte* buf, size_t bufLen); + unsigned int GetSendResult(); + void SendEof(); + + unsigned int GetMaxWaitObjectCount() const {return 1;} + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + +private: + Socket &m_s; +#ifdef USE_WINDOWS_STYLE_SOCKETS + WindowsHandle m_event; + OVERLAPPED m_overlapped; + bool m_resultPending; + DWORD m_lastResult; +#else + unsigned int m_lastResult; +#endif +}; + +//! socket-based implementation of NetworkSource +class SocketSource : public NetworkSource, public Socket +{ +public: + SocketSource(socket_t s = INVALID_SOCKET, bool pumpAll = false, BufferedTransformation *attachment = NULL) + : NetworkSource(attachment), Socket(s), m_receiver(*this) + { + if (pumpAll) + PumpAll(); + } + +private: + NetworkReceiver & AccessReceiver() {return m_receiver;} + SocketReceiver m_receiver; +}; + +//! socket-based implementation of NetworkSink +class SocketSink : public NetworkSink, public Socket +{ +public: + SocketSink(socket_t s=INVALID_SOCKET, unsigned int maxBufferSize=0, unsigned int autoFlushBound=16*1024) + : NetworkSink(maxBufferSize, autoFlushBound), Socket(s), m_sender(*this) {} + + void SendEof() {ShutDown(SD_SEND);} + +private: + NetworkSender & AccessSender() {return m_sender;} + SocketSender m_sender; +}; + +NAMESPACE_END + +#endif // #ifdef SOCKETS_AVAILABLE + +#endif diff --git a/external/crypto++-5.6.3/sosemanuk.cpp b/external/crypto++-5.6.3/sosemanuk.cpp new file mode 100644 index 000000000..76c70037a --- /dev/null +++ b/external/crypto++-5.6.3/sosemanuk.cpp @@ -0,0 +1,717 @@ +// sosemanuk.cpp - written and placed in the public domain by Wei Dai + +// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM sosemanuk.cpp" to generate MASM code + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4702 4731) +#endif + +#ifndef CRYPTOPP_GENERATE_X64_MASM + +#include "sosemanuk.h" +#include "serpentp.h" +#include "secblock.h" +#include "misc.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +void SosemanukPolicy::CipherSetKey(const NameValuePairs ¶ms, const byte *userKey, size_t keylen) +{ + CRYPTOPP_UNUSED(params); + Serpent_KeySchedule(m_key, 24, userKey, keylen); +} + +void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) +{ + CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(iv), CRYPTOPP_UNUSED(length); + assert(length==16); + + word32 a, b, c, d, e; + + typedef BlockGetAndPut Block; + Block::Get(iv)(a)(b)(c)(d); + + const word32 *k = m_key; + unsigned int i=1; + + do + { + beforeS0(KX); beforeS0(S0); afterS0(LT); + afterS0(KX); afterS0(S1); afterS1(LT); + if (i == 3) // after 18th round + { + m_state[4] = b; + m_state[5] = e; + m_state[10] = c; + m_state[11] = a; + } + afterS1(KX); afterS1(S2); afterS2(LT); + afterS2(KX); afterS2(S3); afterS3(LT); + if (i == 2) // after 12th round + { + m_state[6] = c; + m_state[7] = d; + m_state[8] = b; + m_state[9] = e; + } + afterS3(KX); afterS3(S4); afterS4(LT); + afterS4(KX); afterS4(S5); afterS5(LT); + afterS5(KX); afterS5(S6); afterS6(LT); + afterS6(KX); afterS6(S7); afterS7(LT); + + if (i == 3) + break; + + ++i; + c = b; + b = e; + e = d; + d = a; + a = e; + k += 32; + } + while (true); + + afterS7(KX); + + m_state[0] = a; + m_state[1] = b; + m_state[2] = e; + m_state[3] = d; + +#define XMUX(c, x, y) (x ^ (y & (0 - (c & 1)))) + m_state[11] += XMUX(m_state[10], m_state[1], m_state[8]); + m_state[10] = rotlFixed(m_state[10] * 0x54655307, 7); +} + +extern "C" { +word32 s_sosemanukMulTables[512] = { +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) + 0x00000000, 0xE19FCF12, 0x6B973724, 0x8A08F836, + 0xD6876E48, 0x3718A15A, 0xBD10596C, 0x5C8F967E, + 0x05A7DC90, 0xE4381382, 0x6E30EBB4, 0x8FAF24A6, + 0xD320B2D8, 0x32BF7DCA, 0xB8B785FC, 0x59284AEE, + 0x0AE71189, 0xEB78DE9B, 0x617026AD, 0x80EFE9BF, + 0xDC607FC1, 0x3DFFB0D3, 0xB7F748E5, 0x566887F7, + 0x0F40CD19, 0xEEDF020B, 0x64D7FA3D, 0x8548352F, + 0xD9C7A351, 0x38586C43, 0xB2509475, 0x53CF5B67, + 0x146722BB, 0xF5F8EDA9, 0x7FF0159F, 0x9E6FDA8D, + 0xC2E04CF3, 0x237F83E1, 0xA9777BD7, 0x48E8B4C5, + 0x11C0FE2B, 0xF05F3139, 0x7A57C90F, 0x9BC8061D, + 0xC7479063, 0x26D85F71, 0xACD0A747, 0x4D4F6855, + 0x1E803332, 0xFF1FFC20, 0x75170416, 0x9488CB04, + 0xC8075D7A, 0x29989268, 0xA3906A5E, 0x420FA54C, + 0x1B27EFA2, 0xFAB820B0, 0x70B0D886, 0x912F1794, + 0xCDA081EA, 0x2C3F4EF8, 0xA637B6CE, 0x47A879DC, + 0x28CE44DF, 0xC9518BCD, 0x435973FB, 0xA2C6BCE9, + 0xFE492A97, 0x1FD6E585, 0x95DE1DB3, 0x7441D2A1, + 0x2D69984F, 0xCCF6575D, 0x46FEAF6B, 0xA7616079, + 0xFBEEF607, 0x1A713915, 0x9079C123, 0x71E60E31, + 0x22295556, 0xC3B69A44, 0x49BE6272, 0xA821AD60, + 0xF4AE3B1E, 0x1531F40C, 0x9F390C3A, 0x7EA6C328, + 0x278E89C6, 0xC61146D4, 0x4C19BEE2, 0xAD8671F0, + 0xF109E78E, 0x1096289C, 0x9A9ED0AA, 0x7B011FB8, + 0x3CA96664, 0xDD36A976, 0x573E5140, 0xB6A19E52, + 0xEA2E082C, 0x0BB1C73E, 0x81B93F08, 0x6026F01A, + 0x390EBAF4, 0xD89175E6, 0x52998DD0, 0xB30642C2, + 0xEF89D4BC, 0x0E161BAE, 0x841EE398, 0x65812C8A, + 0x364E77ED, 0xD7D1B8FF, 0x5DD940C9, 0xBC468FDB, + 0xE0C919A5, 0x0156D6B7, 0x8B5E2E81, 0x6AC1E193, + 0x33E9AB7D, 0xD276646F, 0x587E9C59, 0xB9E1534B, + 0xE56EC535, 0x04F10A27, 0x8EF9F211, 0x6F663D03, + 0x50358817, 0xB1AA4705, 0x3BA2BF33, 0xDA3D7021, + 0x86B2E65F, 0x672D294D, 0xED25D17B, 0x0CBA1E69, + 0x55925487, 0xB40D9B95, 0x3E0563A3, 0xDF9AACB1, + 0x83153ACF, 0x628AF5DD, 0xE8820DEB, 0x091DC2F9, + 0x5AD2999E, 0xBB4D568C, 0x3145AEBA, 0xD0DA61A8, + 0x8C55F7D6, 0x6DCA38C4, 0xE7C2C0F2, 0x065D0FE0, + 0x5F75450E, 0xBEEA8A1C, 0x34E2722A, 0xD57DBD38, + 0x89F22B46, 0x686DE454, 0xE2651C62, 0x03FAD370, + 0x4452AAAC, 0xA5CD65BE, 0x2FC59D88, 0xCE5A529A, + 0x92D5C4E4, 0x734A0BF6, 0xF942F3C0, 0x18DD3CD2, + 0x41F5763C, 0xA06AB92E, 0x2A624118, 0xCBFD8E0A, + 0x97721874, 0x76EDD766, 0xFCE52F50, 0x1D7AE042, + 0x4EB5BB25, 0xAF2A7437, 0x25228C01, 0xC4BD4313, + 0x9832D56D, 0x79AD1A7F, 0xF3A5E249, 0x123A2D5B, + 0x4B1267B5, 0xAA8DA8A7, 0x20855091, 0xC11A9F83, + 0x9D9509FD, 0x7C0AC6EF, 0xF6023ED9, 0x179DF1CB, + 0x78FBCCC8, 0x996403DA, 0x136CFBEC, 0xF2F334FE, + 0xAE7CA280, 0x4FE36D92, 0xC5EB95A4, 0x24745AB6, + 0x7D5C1058, 0x9CC3DF4A, 0x16CB277C, 0xF754E86E, + 0xABDB7E10, 0x4A44B102, 0xC04C4934, 0x21D38626, + 0x721CDD41, 0x93831253, 0x198BEA65, 0xF8142577, + 0xA49BB309, 0x45047C1B, 0xCF0C842D, 0x2E934B3F, + 0x77BB01D1, 0x9624CEC3, 0x1C2C36F5, 0xFDB3F9E7, + 0xA13C6F99, 0x40A3A08B, 0xCAAB58BD, 0x2B3497AF, + 0x6C9CEE73, 0x8D032161, 0x070BD957, 0xE6941645, + 0xBA1B803B, 0x5B844F29, 0xD18CB71F, 0x3013780D, + 0x693B32E3, 0x88A4FDF1, 0x02AC05C7, 0xE333CAD5, + 0xBFBC5CAB, 0x5E2393B9, 0xD42B6B8F, 0x35B4A49D, + 0x667BFFFA, 0x87E430E8, 0x0DECC8DE, 0xEC7307CC, + 0xB0FC91B2, 0x51635EA0, 0xDB6BA696, 0x3AF46984, + 0x63DC236A, 0x8243EC78, 0x084B144E, 0xE9D4DB5C, + 0xB55B4D22, 0x54C48230, 0xDECC7A06, 0x3F53B514, +#else + 0x00000000, 0xE19FCF13, 0x6B973726, 0x8A08F835, + 0xD6876E4C, 0x3718A15F, 0xBD10596A, 0x5C8F9679, + 0x05A7DC98, 0xE438138B, 0x6E30EBBE, 0x8FAF24AD, + 0xD320B2D4, 0x32BF7DC7, 0xB8B785F2, 0x59284AE1, + 0x0AE71199, 0xEB78DE8A, 0x617026BF, 0x80EFE9AC, + 0xDC607FD5, 0x3DFFB0C6, 0xB7F748F3, 0x566887E0, + 0x0F40CD01, 0xEEDF0212, 0x64D7FA27, 0x85483534, + 0xD9C7A34D, 0x38586C5E, 0xB250946B, 0x53CF5B78, + 0x1467229B, 0xF5F8ED88, 0x7FF015BD, 0x9E6FDAAE, + 0xC2E04CD7, 0x237F83C4, 0xA9777BF1, 0x48E8B4E2, + 0x11C0FE03, 0xF05F3110, 0x7A57C925, 0x9BC80636, + 0xC747904F, 0x26D85F5C, 0xACD0A769, 0x4D4F687A, + 0x1E803302, 0xFF1FFC11, 0x75170424, 0x9488CB37, + 0xC8075D4E, 0x2998925D, 0xA3906A68, 0x420FA57B, + 0x1B27EF9A, 0xFAB82089, 0x70B0D8BC, 0x912F17AF, + 0xCDA081D6, 0x2C3F4EC5, 0xA637B6F0, 0x47A879E3, + 0x28CE449F, 0xC9518B8C, 0x435973B9, 0xA2C6BCAA, + 0xFE492AD3, 0x1FD6E5C0, 0x95DE1DF5, 0x7441D2E6, + 0x2D699807, 0xCCF65714, 0x46FEAF21, 0xA7616032, + 0xFBEEF64B, 0x1A713958, 0x9079C16D, 0x71E60E7E, + 0x22295506, 0xC3B69A15, 0x49BE6220, 0xA821AD33, + 0xF4AE3B4A, 0x1531F459, 0x9F390C6C, 0x7EA6C37F, + 0x278E899E, 0xC611468D, 0x4C19BEB8, 0xAD8671AB, + 0xF109E7D2, 0x109628C1, 0x9A9ED0F4, 0x7B011FE7, + 0x3CA96604, 0xDD36A917, 0x573E5122, 0xB6A19E31, + 0xEA2E0848, 0x0BB1C75B, 0x81B93F6E, 0x6026F07D, + 0x390EBA9C, 0xD891758F, 0x52998DBA, 0xB30642A9, + 0xEF89D4D0, 0x0E161BC3, 0x841EE3F6, 0x65812CE5, + 0x364E779D, 0xD7D1B88E, 0x5DD940BB, 0xBC468FA8, + 0xE0C919D1, 0x0156D6C2, 0x8B5E2EF7, 0x6AC1E1E4, + 0x33E9AB05, 0xD2766416, 0x587E9C23, 0xB9E15330, + 0xE56EC549, 0x04F10A5A, 0x8EF9F26F, 0x6F663D7C, + 0x50358897, 0xB1AA4784, 0x3BA2BFB1, 0xDA3D70A2, + 0x86B2E6DB, 0x672D29C8, 0xED25D1FD, 0x0CBA1EEE, + 0x5592540F, 0xB40D9B1C, 0x3E056329, 0xDF9AAC3A, + 0x83153A43, 0x628AF550, 0xE8820D65, 0x091DC276, + 0x5AD2990E, 0xBB4D561D, 0x3145AE28, 0xD0DA613B, + 0x8C55F742, 0x6DCA3851, 0xE7C2C064, 0x065D0F77, + 0x5F754596, 0xBEEA8A85, 0x34E272B0, 0xD57DBDA3, + 0x89F22BDA, 0x686DE4C9, 0xE2651CFC, 0x03FAD3EF, + 0x4452AA0C, 0xA5CD651F, 0x2FC59D2A, 0xCE5A5239, + 0x92D5C440, 0x734A0B53, 0xF942F366, 0x18DD3C75, + 0x41F57694, 0xA06AB987, 0x2A6241B2, 0xCBFD8EA1, + 0x977218D8, 0x76EDD7CB, 0xFCE52FFE, 0x1D7AE0ED, + 0x4EB5BB95, 0xAF2A7486, 0x25228CB3, 0xC4BD43A0, + 0x9832D5D9, 0x79AD1ACA, 0xF3A5E2FF, 0x123A2DEC, + 0x4B12670D, 0xAA8DA81E, 0x2085502B, 0xC11A9F38, + 0x9D950941, 0x7C0AC652, 0xF6023E67, 0x179DF174, + 0x78FBCC08, 0x9964031B, 0x136CFB2E, 0xF2F3343D, + 0xAE7CA244, 0x4FE36D57, 0xC5EB9562, 0x24745A71, + 0x7D5C1090, 0x9CC3DF83, 0x16CB27B6, 0xF754E8A5, + 0xABDB7EDC, 0x4A44B1CF, 0xC04C49FA, 0x21D386E9, + 0x721CDD91, 0x93831282, 0x198BEAB7, 0xF81425A4, + 0xA49BB3DD, 0x45047CCE, 0xCF0C84FB, 0x2E934BE8, + 0x77BB0109, 0x9624CE1A, 0x1C2C362F, 0xFDB3F93C, + 0xA13C6F45, 0x40A3A056, 0xCAAB5863, 0x2B349770, + 0x6C9CEE93, 0x8D032180, 0x070BD9B5, 0xE69416A6, + 0xBA1B80DF, 0x5B844FCC, 0xD18CB7F9, 0x301378EA, + 0x693B320B, 0x88A4FD18, 0x02AC052D, 0xE333CA3E, + 0xBFBC5C47, 0x5E239354, 0xD42B6B61, 0x35B4A472, + 0x667BFF0A, 0x87E43019, 0x0DECC82C, 0xEC73073F, + 0xB0FC9146, 0x51635E55, 0xDB6BA660, 0x3AF46973, + 0x63DC2392, 0x8243EC81, 0x084B14B4, 0xE9D4DBA7, + 0xB55B4DDE, 0x54C482CD, 0xDECC7AF8, 0x3F53B5EB, +#endif + 0x00000000, 0x180F40CD, 0x301E8033, 0x2811C0FE, + 0x603CA966, 0x7833E9AB, 0x50222955, 0x482D6998, + 0xC078FBCC, 0xD877BB01, 0xF0667BFF, 0xE8693B32, + 0xA04452AA, 0xB84B1267, 0x905AD299, 0x88559254, + 0x29F05F31, 0x31FF1FFC, 0x19EEDF02, 0x01E19FCF, + 0x49CCF657, 0x51C3B69A, 0x79D27664, 0x61DD36A9, + 0xE988A4FD, 0xF187E430, 0xD99624CE, 0xC1996403, + 0x89B40D9B, 0x91BB4D56, 0xB9AA8DA8, 0xA1A5CD65, + 0x5249BE62, 0x4A46FEAF, 0x62573E51, 0x7A587E9C, + 0x32751704, 0x2A7A57C9, 0x026B9737, 0x1A64D7FA, + 0x923145AE, 0x8A3E0563, 0xA22FC59D, 0xBA208550, + 0xF20DECC8, 0xEA02AC05, 0xC2136CFB, 0xDA1C2C36, + 0x7BB9E153, 0x63B6A19E, 0x4BA76160, 0x53A821AD, + 0x1B854835, 0x038A08F8, 0x2B9BC806, 0x339488CB, + 0xBBC11A9F, 0xA3CE5A52, 0x8BDF9AAC, 0x93D0DA61, + 0xDBFDB3F9, 0xC3F2F334, 0xEBE333CA, 0xF3EC7307, + 0xA492D5C4, 0xBC9D9509, 0x948C55F7, 0x8C83153A, + 0xC4AE7CA2, 0xDCA13C6F, 0xF4B0FC91, 0xECBFBC5C, + 0x64EA2E08, 0x7CE56EC5, 0x54F4AE3B, 0x4CFBEEF6, + 0x04D6876E, 0x1CD9C7A3, 0x34C8075D, 0x2CC74790, + 0x8D628AF5, 0x956DCA38, 0xBD7C0AC6, 0xA5734A0B, + 0xED5E2393, 0xF551635E, 0xDD40A3A0, 0xC54FE36D, + 0x4D1A7139, 0x551531F4, 0x7D04F10A, 0x650BB1C7, + 0x2D26D85F, 0x35299892, 0x1D38586C, 0x053718A1, + 0xF6DB6BA6, 0xEED42B6B, 0xC6C5EB95, 0xDECAAB58, + 0x96E7C2C0, 0x8EE8820D, 0xA6F942F3, 0xBEF6023E, + 0x36A3906A, 0x2EACD0A7, 0x06BD1059, 0x1EB25094, + 0x569F390C, 0x4E9079C1, 0x6681B93F, 0x7E8EF9F2, + 0xDF2B3497, 0xC724745A, 0xEF35B4A4, 0xF73AF469, + 0xBF179DF1, 0xA718DD3C, 0x8F091DC2, 0x97065D0F, + 0x1F53CF5B, 0x075C8F96, 0x2F4D4F68, 0x37420FA5, + 0x7F6F663D, 0x676026F0, 0x4F71E60E, 0x577EA6C3, + 0xE18D0321, 0xF98243EC, 0xD1938312, 0xC99CC3DF, + 0x81B1AA47, 0x99BEEA8A, 0xB1AF2A74, 0xA9A06AB9, + 0x21F5F8ED, 0x39FAB820, 0x11EB78DE, 0x09E43813, + 0x41C9518B, 0x59C61146, 0x71D7D1B8, 0x69D89175, + 0xC87D5C10, 0xD0721CDD, 0xF863DC23, 0xE06C9CEE, + 0xA841F576, 0xB04EB5BB, 0x985F7545, 0x80503588, + 0x0805A7DC, 0x100AE711, 0x381B27EF, 0x20146722, + 0x68390EBA, 0x70364E77, 0x58278E89, 0x4028CE44, + 0xB3C4BD43, 0xABCBFD8E, 0x83DA3D70, 0x9BD57DBD, + 0xD3F81425, 0xCBF754E8, 0xE3E69416, 0xFBE9D4DB, + 0x73BC468F, 0x6BB30642, 0x43A2C6BC, 0x5BAD8671, + 0x1380EFE9, 0x0B8FAF24, 0x239E6FDA, 0x3B912F17, + 0x9A34E272, 0x823BA2BF, 0xAA2A6241, 0xB225228C, + 0xFA084B14, 0xE2070BD9, 0xCA16CB27, 0xD2198BEA, + 0x5A4C19BE, 0x42435973, 0x6A52998D, 0x725DD940, + 0x3A70B0D8, 0x227FF015, 0x0A6E30EB, 0x12617026, + 0x451FD6E5, 0x5D109628, 0x750156D6, 0x6D0E161B, + 0x25237F83, 0x3D2C3F4E, 0x153DFFB0, 0x0D32BF7D, + 0x85672D29, 0x9D686DE4, 0xB579AD1A, 0xAD76EDD7, + 0xE55B844F, 0xFD54C482, 0xD545047C, 0xCD4A44B1, + 0x6CEF89D4, 0x74E0C919, 0x5CF109E7, 0x44FE492A, + 0x0CD320B2, 0x14DC607F, 0x3CCDA081, 0x24C2E04C, + 0xAC977218, 0xB49832D5, 0x9C89F22B, 0x8486B2E6, + 0xCCABDB7E, 0xD4A49BB3, 0xFCB55B4D, 0xE4BA1B80, + 0x17566887, 0x0F59284A, 0x2748E8B4, 0x3F47A879, + 0x776AC1E1, 0x6F65812C, 0x477441D2, 0x5F7B011F, + 0xD72E934B, 0xCF21D386, 0xE7301378, 0xFF3F53B5, + 0xB7123A2D, 0xAF1D7AE0, 0x870CBA1E, 0x9F03FAD3, + 0x3EA637B6, 0x26A9777B, 0x0EB8B785, 0x16B7F748, + 0x5E9A9ED0, 0x4695DE1D, 0x6E841EE3, 0x768B5E2E, + 0xFEDECC7A, 0xE6D18CB7, 0xCEC04C49, 0xD6CF0C84, + 0x9EE2651C, 0x86ED25D1, 0xAEFCE52F, 0xB6F3A5E2 +}; +} + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) +unsigned int SosemanukPolicy::GetAlignment() const +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) +#ifdef __INTEL_COMPILER + if (HasSSE2() && !IsP4()) // Intel compiler produces faster code for this algorithm on the P4 +#else + if (HasSSE2()) +#endif + return 16; + else +#endif + return GetAlignmentOf(); +} + +unsigned int SosemanukPolicy::GetOptimalBlockSize() const +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) +#ifdef __INTEL_COMPILER + if (HasSSE2() && !IsP4()) // Intel compiler produces faster code for this algorithm on the P4 +#else + if (HasSSE2()) +#endif + return 4*BYTES_PER_ITERATION; + else +#endif + return BYTES_PER_ITERATION; +} +#endif + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE +extern "C" { +void Sosemanuk_OperateKeystream(size_t iterationCount, const byte *input, byte *output, word32 *state); +} +#endif + +void SosemanukPolicy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) +{ +#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM + +#ifdef CRYPTOPP_X64_MASM_AVAILABLE + Sosemanuk_OperateKeystream(iterationCount, input, output, m_state.data()); + return; +#endif + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) +#ifdef CRYPTOPP_GENERATE_X64_MASM + ALIGN 8 + Sosemanuk_OperateKeystream PROC FRAME + rex_push_reg rsi + push_reg rdi + alloc_stack(80*4*2+12*4+8*WORD_SZ + 2*16+8) + save_xmm128 xmm6, 02f0h + save_xmm128 xmm7, 0300h + .endprolog + mov rdi, r8 + mov rax, r9 +#else +#ifdef __INTEL_COMPILER + if (HasSSE2() && !IsP4()) // Intel compiler produces faster code for this algorithm on the P4 +#else + if (HasSSE2()) +#endif + { +#ifdef __GNUC__ + #if CRYPTOPP_BOOL_X64 + FixedSizeAlignedSecBlock workspace; + #endif + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS_PUSH_IF86( bx) +#else + word32 *state = m_state; + AS2( mov WORD_REG(ax), state) + AS2( mov WORD_REG(di), output) + AS2( mov WORD_REG(dx), input) + AS2( mov WORD_REG(cx), iterationCount) +#endif +#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM + +#if defined(__GNUC__) && CRYPTOPP_BOOL_X64 + #define SSE2_workspace %5 +#else + #define SSE2_workspace WORD_REG(sp) +#endif + +#define SSE2_output WORD_PTR [SSE2_workspace+1*WORD_SZ] +#define SSE2_input WORD_PTR [SSE2_workspace+2*WORD_SZ] +#define SSE2_wordsLeft WORD_PTR [SSE2_workspace+3*WORD_SZ] +#define SSE2_diEnd WORD_PTR [SSE2_workspace+4*WORD_SZ] +#define SSE2_pMulTables WORD_PTR [SSE2_workspace+5*WORD_SZ] +#define SSE2_state WORD_PTR [SSE2_workspace+6*WORD_SZ] +#define SSE2_wordsLeft2 WORD_PTR [SSE2_workspace+7*WORD_SZ] +#define SSE2_stateCopy SSE2_workspace + 8*WORD_SZ +#define SSE2_uvStart SSE2_stateCopy + 12*4 + +#if (CRYPTOPP_BOOL_X86) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) + AS_PUSH_IF86( bp) + AS2( mov AS_REG_6, esp) + AS2( and esp, -16) + AS2( sub esp, 80*4*2+12*4+8*WORD_SZ) // 80 v's, 80 u's, 12 state, 8 locals + AS2( mov [esp], AS_REG_6) +#endif + AS2( mov SSE2_output, WORD_REG(di)) + AS2( mov SSE2_input, WORD_REG(dx)) + AS2( mov SSE2_state, WORD_REG(ax)) +#ifndef _MSC_VER + AS2( mov SSE2_pMulTables, WORD_REG(si)) +#endif + AS2( lea WORD_REG(cx), [4*WORD_REG(cx)+WORD_REG(cx)]) + AS2( lea WORD_REG(si), [4*WORD_REG(cx)]) + AS2( mov SSE2_wordsLeft, WORD_REG(si)) + AS2( movdqa xmm0, [WORD_REG(ax)+0*16]) // copy state to stack to save a register + AS2( movdqa [SSE2_stateCopy+0*16], xmm0) + AS2( movdqa xmm0, [WORD_REG(ax)+1*16]) + AS2( movdqa [SSE2_stateCopy+1*16], xmm0) + AS2( movq xmm0, QWORD PTR [WORD_REG(ax)+2*16]) + AS2( movq QWORD PTR [SSE2_stateCopy+2*16], xmm0) + AS2( psrlq xmm0, 32) + AS2( movd AS_REG_6d, xmm0) // s(9) + AS2( mov ecx, [WORD_REG(ax)+10*4]) + AS2( mov edx, [WORD_REG(ax)+11*4]) + AS2( pcmpeqb xmm7, xmm7) // all ones + +#define s(i) SSE2_stateCopy + ASM_MOD(i,10)*4 +#define u(j) WORD_REG(di) + (ASM_MOD(j,4)*20 + (j/4)) * 4 +#define v(j) WORD_REG(di) + (ASM_MOD(j,4)*20 + (j/4)) * 4 + 80*4 + +#define R10 ecx +#define R11 edx +#define R20 edx +#define R21 ecx +// workaround bug in GAS 2.15 +#define R20r WORD_REG(dx) +#define R21r WORD_REG(cx) + +#define SSE2_STEP(i, j) \ + AS2( mov eax, [s(i+0)])\ + AS2( mov [v(i)], eax)\ + AS2( rol eax, 8)\ + AS2( lea AS_REG_7, [AS_REG_6 + R2##j##r])\ + AS2( xor AS_REG_7d, R1##j)\ + AS2( mov [u(i)], AS_REG_7d)\ + AS2( mov AS_REG_7d, 1)\ + AS2( and AS_REG_7d, R2##j)\ + AS1( neg AS_REG_7d)\ + AS2( and AS_REG_7d, AS_REG_6d)\ + AS2( xor AS_REG_6d, eax)\ + AS2( movzx eax, al)\ + AS2( xor AS_REG_6d, [WORD_REG(si)+WORD_REG(ax)*4])\ + AS2( mov eax, [s(i+3)])\ + AS2( xor AS_REG_7d, [s(i+2)])\ + AS2( add R1##j, AS_REG_7d)\ + AS2( movzx AS_REG_7d, al)\ + AS2( shr eax, 8)\ + AS2( xor AS_REG_6d, [WORD_REG(si)+1024+AS_REG_7*4])\ + AS2( xor AS_REG_6d, eax)\ + AS2( imul R2##j, AS_HEX(54655307))\ + AS2( rol R2##j, 7)\ + AS2( mov [s(i+0)], AS_REG_6d)\ + + ASL(2) // outer loop, each iteration of this processes 80 words + AS2( lea WORD_REG(di), [SSE2_uvStart]) // start of v and u + AS2( mov WORD_REG(ax), 80) + AS2( cmp WORD_REG(si), 80) + AS2( cmovg WORD_REG(si), WORD_REG(ax)) + AS2( mov SSE2_wordsLeft2, WORD_REG(si)) + AS2( lea WORD_REG(si), [WORD_REG(di)+WORD_REG(si)]) // use to end first inner loop + AS2( mov SSE2_diEnd, WORD_REG(si)) +#ifdef _MSC_VER + AS2( lea WORD_REG(si), s_sosemanukMulTables) +#else + AS2( mov WORD_REG(si), SSE2_pMulTables) +#endif + + ASL(0) // first inner loop, 20 words each, 4 iterations + SSE2_STEP(0, 0) + SSE2_STEP(1, 1) + SSE2_STEP(2, 0) + SSE2_STEP(3, 1) + SSE2_STEP(4, 0) + SSE2_STEP(5, 1) + SSE2_STEP(6, 0) + SSE2_STEP(7, 1) + SSE2_STEP(8, 0) + SSE2_STEP(9, 1) + SSE2_STEP(10, 0) + SSE2_STEP(11, 1) + SSE2_STEP(12, 0) + SSE2_STEP(13, 1) + SSE2_STEP(14, 0) + SSE2_STEP(15, 1) + SSE2_STEP(16, 0) + SSE2_STEP(17, 1) + SSE2_STEP(18, 0) + SSE2_STEP(19, 1) + // loop + AS2( add WORD_REG(di), 5*4) + AS2( cmp WORD_REG(di), SSE2_diEnd) + ASJ( jne, 0, b) + + AS2( mov WORD_REG(ax), SSE2_input) + AS2( mov AS_REG_7, SSE2_output) + AS2( lea WORD_REG(di), [SSE2_uvStart]) // start of v and u + AS2( mov WORD_REG(si), SSE2_wordsLeft2) + + ASL(1) // second inner loop, 16 words each, 5 iterations + AS2( movdqa xmm0, [WORD_REG(di)+0*20*4]) + AS2( movdqa xmm2, [WORD_REG(di)+2*20*4]) + AS2( movdqa xmm3, [WORD_REG(di)+3*20*4]) + AS2( movdqa xmm1, [WORD_REG(di)+1*20*4]) + // S2 + AS2( movdqa xmm4, xmm0) + AS2( pand xmm0, xmm2) + AS2( pxor xmm0, xmm3) + AS2( pxor xmm2, xmm1) + AS2( pxor xmm2, xmm0) + AS2( por xmm3, xmm4) + AS2( pxor xmm3, xmm1) + AS2( pxor xmm4, xmm2) + AS2( movdqa xmm1, xmm3) + AS2( por xmm3, xmm4) + AS2( pxor xmm3, xmm0) + AS2( pand xmm0, xmm1) + AS2( pxor xmm4, xmm0) + AS2( pxor xmm1, xmm3) + AS2( pxor xmm1, xmm4) + AS2( pxor xmm4, xmm7) + // xor with v + AS2( pxor xmm2, [WORD_REG(di)+80*4]) + AS2( pxor xmm3, [WORD_REG(di)+80*5]) + AS2( pxor xmm1, [WORD_REG(di)+80*6]) + AS2( pxor xmm4, [WORD_REG(di)+80*7]) + // exit loop early if less than 16 words left to output + // this is necessary because block size is 20 words, and we output 16 words in each iteration of this loop + AS2( cmp WORD_REG(si), 16) + ASJ( jl, 4, f) + // unpack + AS2( movdqa xmm6, xmm2) + AS2( punpckldq xmm2, xmm3) + AS2( movdqa xmm5, xmm1) + AS2( punpckldq xmm1, xmm4) + AS2( movdqa xmm0, xmm2) + AS2( punpcklqdq xmm2, xmm1) + AS2( punpckhqdq xmm0, xmm1) + AS2( punpckhdq xmm6, xmm3) + AS2( punpckhdq xmm5, xmm4) + AS2( movdqa xmm3, xmm6) + AS2( punpcklqdq xmm6, xmm5) + AS2( punpckhqdq xmm3, xmm5) + + // output keystream + AS_XMM_OUTPUT4(SSE2_Sosemanuk_Output, WORD_REG(ax), AS_REG_7, 2,0,6,3, 1, 0,1,2,3, 4) + + // loop + AS2( add WORD_REG(di), 4*4) + AS2( sub WORD_REG(si), 16) + ASJ( jnz, 1, b) + + // outer loop + AS2( mov WORD_REG(si), SSE2_wordsLeft) + AS2( sub WORD_REG(si), 80) + ASJ( jz, 6, f) + AS2( mov SSE2_wordsLeft, WORD_REG(si)) + AS2( mov SSE2_input, WORD_REG(ax)) + AS2( mov SSE2_output, AS_REG_7) + ASJ( jmp, 2, b) + + ASL(4) // final output of less than 16 words + AS2( test WORD_REG(ax), WORD_REG(ax)) + ASJ( jz, 5, f) + AS2( movd xmm0, dword ptr [WORD_REG(ax)+0*4]) + AS2( pxor xmm2, xmm0) + AS2( movd xmm0, dword ptr [WORD_REG(ax)+1*4]) + AS2( pxor xmm3, xmm0) + AS2( movd xmm0, dword ptr [WORD_REG(ax)+2*4]) + AS2( pxor xmm1, xmm0) + AS2( movd xmm0, dword ptr [WORD_REG(ax)+3*4]) + AS2( pxor xmm4, xmm0) + AS2( add WORD_REG(ax), 16) + ASL(5) + AS2( movd dword ptr [AS_REG_7+0*4], xmm2) + AS2( movd dword ptr [AS_REG_7+1*4], xmm3) + AS2( movd dword ptr [AS_REG_7+2*4], xmm1) + AS2( movd dword ptr [AS_REG_7+3*4], xmm4) + AS2( sub WORD_REG(si), 4) + ASJ( jz, 6, f) + AS2( add AS_REG_7, 16) + AS2( psrldq xmm2, 4) + AS2( psrldq xmm3, 4) + AS2( psrldq xmm1, 4) + AS2( psrldq xmm4, 4) + ASJ( jmp, 4, b) + + ASL(6) // save state + AS2( mov AS_REG_6, SSE2_state) + AS2( movdqa xmm0, [SSE2_stateCopy+0*16]) + AS2( movdqa [AS_REG_6+0*16], xmm0) + AS2( movdqa xmm0, [SSE2_stateCopy+1*16]) + AS2( movdqa [AS_REG_6+1*16], xmm0) + AS2( movq xmm0, QWORD PTR [SSE2_stateCopy+2*16]) + AS2( movq QWORD PTR [AS_REG_6+2*16], xmm0) + AS2( mov [AS_REG_6+10*4], ecx) + AS2( mov [AS_REG_6+11*4], edx) + + AS_POP_IF86( sp) + AS_POP_IF86( bp) + +#ifdef __GNUC__ + AS_POP_IF86( bx) + ATT_PREFIX + : + : "a" (m_state.m_ptr), "c" (iterationCount), "S" (s_sosemanukMulTables), "D" (output), "d" (input) + #if CRYPTOPP_BOOL_X64 + , "r" (workspace.m_ptr) + : "memory", "cc", "%r9", "%r10", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7" + #else + : "memory", "cc" + #endif + ); +#endif +#ifdef CRYPTOPP_GENERATE_X64_MASM + movdqa xmm6, [rsp + 02f0h] + movdqa xmm7, [rsp + 0300h] + add rsp, 80*4*2+12*4+8*WORD_SZ + 2*16+8 + pop rdi + pop rsi + ret + Sosemanuk_OperateKeystream ENDP +#else + } + else +#endif +#endif +#ifndef CRYPTOPP_GENERATE_X64_MASM + { +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) +#define MUL_A(x) (x = rotlFixed(x, 8), x ^ s_sosemanukMulTables[byte(x)]) +#else +#define MUL_A(x) (((x) << 8) ^ s_sosemanukMulTables[(x) >> 24]) +#endif + +#define DIV_A(x) (((x) >> 8) ^ s_sosemanukMulTables[256 + byte(x)]) + +#define r1(i) ((i%2) ? reg2 : reg1) +#define r2(i) ((i%2) ? reg1 : reg2) + +#define STEP(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, v, u) \ + u = (s##x9 + r2(x0)) ^ r1(x0);\ + v = s##x0;\ + s##x0 = MUL_A(s##x0) ^ DIV_A(s##x3) ^ s##x9;\ + r1(x0) += XMUX(r2(x0), s##x2, s##x9);\ + r2(x0) = rotlFixed(r2(x0) * 0x54655307, 7);\ + +#define SOSEMANUK_OUTPUT(x) \ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, u2 ^ v0);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, u3 ^ v1);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, u1 ^ v2);\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, u4 ^ v3); + +#define OUTPUT4 \ + S2(0, u0, u1, u2, u3, u4);\ + CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SOSEMANUK_OUTPUT, 4*4); + + word32 s0 = m_state[0]; + word32 s1 = m_state[1]; + word32 s2 = m_state[2]; + word32 s3 = m_state[3]; + word32 s4 = m_state[4]; + word32 s5 = m_state[5]; + word32 s6 = m_state[6]; + word32 s7 = m_state[7]; + word32 s8 = m_state[8]; + word32 s9 = m_state[9]; + word32 reg1 = m_state[10]; + word32 reg2 = m_state[11]; + word32 u0, u1, u2, u3, u4, v0, v1, v2, v3; + + do + { + STEP(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, v0, u0) + STEP(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, v1, u1) + STEP(2, 3, 4, 5, 6, 7, 8, 9, 0, 1, v2, u2) + STEP(3, 4, 5, 6, 7, 8, 9, 0, 1, 2, v3, u3) + OUTPUT4 + STEP(4, 5, 6, 7, 8, 9, 0, 1, 2, 3, v0, u0) + STEP(5, 6, 7, 8, 9, 0, 1, 2, 3, 4, v1, u1) + STEP(6, 7, 8, 9, 0, 1, 2, 3, 4, 5, v2, u2) + STEP(7, 8, 9, 0, 1, 2, 3, 4, 5, 6, v3, u3) + OUTPUT4 + STEP(8, 9, 0, 1, 2, 3, 4, 5, 6, 7, v0, u0) + STEP(9, 0, 1, 2, 3, 4, 5, 6, 7, 8, v1, u1) + STEP(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, v2, u2) + STEP(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, v3, u3) + OUTPUT4 + STEP(2, 3, 4, 5, 6, 7, 8, 9, 0, 1, v0, u0) + STEP(3, 4, 5, 6, 7, 8, 9, 0, 1, 2, v1, u1) + STEP(4, 5, 6, 7, 8, 9, 0, 1, 2, 3, v2, u2) + STEP(5, 6, 7, 8, 9, 0, 1, 2, 3, 4, v3, u3) + OUTPUT4 + STEP(6, 7, 8, 9, 0, 1, 2, 3, 4, 5, v0, u0) + STEP(7, 8, 9, 0, 1, 2, 3, 4, 5, 6, v1, u1) + STEP(8, 9, 0, 1, 2, 3, 4, 5, 6, 7, v2, u2) + STEP(9, 0, 1, 2, 3, 4, 5, 6, 7, 8, v3, u3) + OUTPUT4 + } + while (--iterationCount); + + m_state[0] = s0; + m_state[1] = s1; + m_state[2] = s2; + m_state[3] = s3; + m_state[4] = s4; + m_state[5] = s5; + m_state[6] = s6; + m_state[7] = s7; + m_state[8] = s8; + m_state[9] = s9; + m_state[10] = reg1; + m_state[11] = reg2; + } +} + +NAMESPACE_END + +#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM diff --git a/external/crypto++-5.6.3/sosemanuk.h b/external/crypto++-5.6.3/sosemanuk.h new file mode 100644 index 000000000..5a55157d1 --- /dev/null +++ b/external/crypto++-5.6.3/sosemanuk.h @@ -0,0 +1,52 @@ +// sosemanuk.h - written and placed in the public domain by Wei Dai + +//! \file sosemanuk.h +//! \brief Classes for Sosemanuk stream cipher + +#ifndef CRYPTOPP_SOSEMANUK_H +#define CRYPTOPP_SOSEMANUK_H + +#include "strciphr.h" +#include "secblock.h" + +// Clang due to "Inline assembly operands don't work with .intel_syntax" +// https://llvm.org/bugs/show_bug.cgi?id=24232 +#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) +# define CRYPTOPP_DISABLE_SOSEMANUK_ASM +#endif + +NAMESPACE_BEGIN(CryptoPP) + +//! algorithm info +struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16> +{ + static const char * StaticAlgorithmName() {return "Sosemanuk";} +}; + +//! _ +class SosemanukPolicy : public AdditiveCipherConcretePolicy, public SosemanukInfo +{ +protected: + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); + void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); + void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); + bool CipherIsRandomAccess() const {return false;} +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) + unsigned int GetAlignment() const; + unsigned int GetOptimalBlockSize() const; +#endif + + FixedSizeSecBlock m_key; + FixedSizeAlignedSecBlock m_state; +}; + +//! Sosemanuk +struct Sosemanuk : public SosemanukInfo, public SymmetricCipherDocumentation +{ + typedef SymmetricCipherFinal >, SosemanukInfo> Encryption; + typedef Encryption Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/square.cpp b/external/crypto++-5.6.3/square.cpp new file mode 100644 index 000000000..8524e1a87 --- /dev/null +++ b/external/crypto++-5.6.3/square.cpp @@ -0,0 +1,187 @@ +// square.cpp - written and placed in the public domain by Wei Dai +// Based on Paulo S.L.M. Barreto's public domain implementation + +#include "pch.h" +#include "config.h" + +#include "square.h" +#include "misc.h" +#include "gf256.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4244) +#endif + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +// apply theta to a roundkey +static void SquareTransform (word32 in[4], word32 out[4]) +{ + static const byte G[4][4] = + { + 0x02U, 0x01U, 0x01U, 0x03U, + 0x03U, 0x02U, 0x01U, 0x01U, + 0x01U, 0x03U, 0x02U, 0x01U, + 0x01U, 0x01U, 0x03U, 0x02U + }; + + GF256 gf256(0xf5); + + for (int i = 0; i < 4; i++) + { + word32 temp = 0; + for (unsigned int j = 0; j < 4; j++) + for (unsigned int k = 0; k < 4; k++) + temp ^= (word32)gf256.Multiply(GETBYTE(in[i], 3-k), G[k][j]) << ((3-j)*8); + out[i] = temp; + } +} + +#define roundkeys(i, j) m_roundkeys[(i)*4+(j)] +#define roundkeys4(i) (m_roundkeys+(i)*4) + +void Square::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) +{ + AssertValidKeyLength(length); + + static const word32 offset[ROUNDS] = { + 0x01000000UL, 0x02000000UL, 0x04000000UL, 0x08000000UL, + 0x10000000UL, 0x20000000UL, 0x40000000UL, 0x80000000UL, + }; + + GetUserKey(BIG_ENDIAN_ORDER, m_roundkeys.data(), KEYLENGTH/4, userKey, KEYLENGTH); + + /* apply the key evolution function */ + for (int i = 1; i < ROUNDS+1; i++) + { + roundkeys(i, 0) = roundkeys(i-1, 0) ^ rotlFixed(roundkeys(i-1, 3), 8U) ^ offset[i-1]; + roundkeys(i, 1) = roundkeys(i-1, 1) ^ roundkeys(i, 0); + roundkeys(i, 2) = roundkeys(i-1, 2) ^ roundkeys(i, 1); + roundkeys(i, 3) = roundkeys(i-1, 3) ^ roundkeys(i, 2); + } + + /* produce the round keys */ + if (IsForwardTransformation()) + { + for (int i = 0; i < ROUNDS; i++) + SquareTransform (roundkeys4(i), roundkeys4(i)); + } + else + { + for (int i = 0; i < ROUNDS/2; i++) + for (int j = 0; j < 4; j++) + std::swap(roundkeys(i, j), roundkeys(ROUNDS-i, j)); + SquareTransform (roundkeys4(ROUNDS), roundkeys4(ROUNDS)); + } +} + +#define MSB(x) (((x) >> 24) & 0xffU) /* most significant byte */ +#define SSB(x) (((x) >> 16) & 0xffU) /* second in significance */ +#define TSB(x) (((x) >> 8) & 0xffU) /* third in significance */ +#define LSB(x) (((x) ) & 0xffU) /* least significant byte */ + +#define squareRound(text, temp, T0, T1, T2, T3, roundkey) \ +{ \ + temp[0] = T0[MSB (text[0])] \ + ^ T1[MSB (text[1])] \ + ^ T2[MSB (text[2])] \ + ^ T3[MSB (text[3])] \ + ^ roundkey[0]; \ + temp[1] = T0[SSB (text[0])] \ + ^ T1[SSB (text[1])] \ + ^ T2[SSB (text[2])] \ + ^ T3[SSB (text[3])] \ + ^ roundkey[1]; \ + temp[2] = T0[TSB (text[0])] \ + ^ T1[TSB (text[1])] \ + ^ T2[TSB (text[2])] \ + ^ T3[TSB (text[3])] \ + ^ roundkey[2]; \ + temp[3] = T0[LSB (text[0])] \ + ^ T1[LSB (text[1])] \ + ^ T2[LSB (text[2])] \ + ^ T3[LSB (text[3])] \ + ^ roundkey[3]; \ +} /* squareRound */ + +#define squareFinal(text, temp, S, roundkey) \ +{ \ + text[0] = ((word32) (S[MSB (temp[0])]) << 24) \ + ^ ((word32) (S[MSB (temp[1])]) << 16) \ + ^ ((word32) (S[MSB (temp[2])]) << 8) \ + ^ (word32) (S[MSB (temp[3])]) \ + ^ roundkey[0]; \ + text[1] = ((word32) (S[SSB (temp[0])]) << 24) \ + ^ ((word32) (S[SSB (temp[1])]) << 16) \ + ^ ((word32) (S[SSB (temp[2])]) << 8) \ + ^ (word32) (S[SSB (temp[3])]) \ + ^ roundkey[1]; \ + text[2] = ((word32) (S[TSB (temp[0])]) << 24) \ + ^ ((word32) (S[TSB (temp[1])]) << 16) \ + ^ ((word32) (S[TSB (temp[2])]) << 8) \ + ^ (word32) (S[TSB (temp[3])]) \ + ^ roundkey[2]; \ + text[3] = ((word32) (S[LSB (temp[0])]) << 24) \ + ^ ((word32) (S[LSB (temp[1])]) << 16) \ + ^ ((word32) (S[LSB (temp[2])]) << 8) \ + ^ (word32) (S[LSB (temp[3])]) \ + ^ roundkey[3]; \ +} /* squareFinal */ + +typedef BlockGetAndPut Block; + +void Square::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 text[4], temp[4]; + Block::Get(inBlock)(text[0])(text[1])(text[2])(text[3]); + + /* initial key addition */ + text[0] ^= roundkeys(0, 0); + text[1] ^= roundkeys(0, 1); + text[2] ^= roundkeys(0, 2); + text[3] ^= roundkeys(0, 3); + + /* ROUNDS - 1 full rounds */ + for (int i=1; i+1, public FixedKeyLength<16>, FixedRounds<8> +{ + static const char *StaticAlgorithmName() {return "Square";} +}; + +/// Square +class Square : public Square_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + FixedSizeSecBlock m_roundkeys; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + private: + static const byte Se[256]; + static const word32 Te[4][256]; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + private: + static const byte Sd[256]; + static const word32 Td[4][256]; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef Square::Encryption SquareEncryption; +typedef Square::Decryption SquareDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/squaretb.cpp b/external/crypto++-5.6.3/squaretb.cpp new file mode 100644 index 000000000..bc3bee7df --- /dev/null +++ b/external/crypto++-5.6.3/squaretb.cpp @@ -0,0 +1,582 @@ +#include "pch.h" +#include "square.h" + +NAMESPACE_BEGIN(CryptoPP) + +const byte Square::Enc::Se[256] = { +177, 206, 195, 149, 90, 173, 231, 2, 77, 68, 251, 145, 12, 135, 161, 80, +203, 103, 84, 221, 70, 143, 225, 78, 240, 253, 252, 235, 249, 196, 26, 110, + 94, 245, 204, 141, 28, 86, 67, 254, 7, 97, 248, 117, 89, 255, 3, 34, +138, 209, 19, 238, 136, 0, 14, 52, 21, 128, 148, 227, 237, 181, 83, 35, + 75, 71, 23, 167, 144, 53, 171, 216, 184, 223, 79, 87, 154, 146, 219, 27, + 60, 200, 153, 4, 142, 224, 215, 125, 133, 187, 64, 44, 58, 69, 241, 66, +101, 32, 65, 24, 114, 37, 147, 112, 54, 5, 242, 11, 163, 121, 236, 8, + 39, 49, 50, 182, 124, 176, 10, 115, 91, 123, 183, 129, 210, 13, 106, 38, +158, 88, 156, 131, 116, 179, 172, 48, 122, 105, 119, 15, 174, 33, 222, 208, + 46, 151, 16, 164, 152, 168, 212, 104, 45, 98, 41, 109, 22, 73, 118, 199, +232, 193, 150, 55, 229, 202, 244, 233, 99, 18, 194, 166, 20, 188, 211, 40, +175, 47, 230, 36, 82, 198, 160, 9, 189, 140, 207, 93, 17, 95, 1, 197, +159, 61, 162, 155, 201, 59, 190, 81, 25, 31, 63, 92, 178, 239, 74, 205, +191, 186, 111, 100, 217, 243, 62, 180, 170, 220, 213, 6, 192, 126, 246, 102, +108, 132, 113, 56, 185, 29, 127, 157, 72, 139, 42, 218, 165, 51, 130, 57, +214, 120, 134, 250, 228, 43, 169, 30, 137, 96, 107, 234, 85, 76, 247, 226, +}; + +const byte Square::Dec::Sd[256] = { + 53, 190, 7, 46, 83, 105, 219, 40, 111, 183, 118, 107, 12, 125, 54, 139, +146, 188, 169, 50, 172, 56, 156, 66, 99, 200, 30, 79, 36, 229, 247, 201, + 97, 141, 47, 63, 179, 101, 127, 112, 175, 154, 234, 245, 91, 152, 144, 177, +135, 113, 114, 237, 55, 69, 104, 163, 227, 239, 92, 197, 80, 193, 214, 202, + 90, 98, 95, 38, 9, 93, 20, 65, 232, 157, 206, 64, 253, 8, 23, 74, + 15, 199, 180, 62, 18, 252, 37, 75, 129, 44, 4, 120, 203, 187, 32, 189, +249, 41, 153, 168, 211, 96, 223, 17, 151, 137, 126, 250, 224, 155, 31, 210, +103, 226, 100, 119, 132, 43, 158, 138, 241, 109, 136, 121, 116, 87, 221, 230, + 57, 123, 238, 131, 225, 88, 242, 13, 52, 248, 48, 233, 185, 35, 84, 21, + 68, 11, 77, 102, 58, 3, 162, 145, 148, 82, 76, 195, 130, 231, 128, 192, +182, 14, 194, 108, 147, 236, 171, 67, 149, 246, 216, 70, 134, 5, 140, 176, +117, 0, 204, 133, 215, 61, 115, 122, 72, 228, 209, 89, 173, 184, 198, 208, +220, 161, 170, 2, 29, 191, 181, 159, 81, 196, 165, 16, 34, 207, 1, 186, +143, 49, 124, 174, 150, 218, 240, 86, 71, 212, 235, 78, 217, 19, 142, 73, + 85, 22, 255, 59, 244, 164, 178, 6, 160, 167, 251, 27, 110, 60, 51, 205, + 24, 94, 106, 213, 166, 33, 222, 254, 42, 28, 243, 10, 26, 25, 39, 45, +}; + +const word32 Square::Enc::Te[4][256] = { +{ +0x97b1b126UL, 0x69cecea7UL, 0x73c3c3b0UL, 0xdf95954aUL, +0xb45a5aeeUL, 0xafadad02UL, 0x3be7e7dcUL, 0x04020206UL, +0x9a4d4dd7UL, 0x884444ccUL, 0x03fbfbf8UL, 0xd7919146UL, +0x180c0c14UL, 0xfb87877cUL, 0xb7a1a116UL, 0xa05050f0UL, +0x63cbcba8UL, 0xce6767a9UL, 0xa85454fcUL, 0x4fdddd92UL, +0x8c4646caUL, 0xeb8f8f64UL, 0x37e1e1d6UL, 0x9c4e4ed2UL, +0x15f0f0e5UL, 0x0ffdfdf2UL, 0x0dfcfcf1UL, 0x23ebebc8UL, +0x07f9f9feUL, 0x7dc4c4b9UL, 0x341a1a2eUL, 0xdc6e6eb2UL, +0xbc5e5ee2UL, 0x1ff5f5eaUL, 0x6dcccca1UL, 0xef8d8d62UL, +0x381c1c24UL, 0xac5656faUL, 0x864343c5UL, 0x09fefef7UL, +0x0e070709UL, 0xc26161a3UL, 0x05f8f8fdUL, 0xea75759fUL, +0xb25959ebUL, 0x0bfffff4UL, 0x06030305UL, 0x44222266UL, +0xe18a8a6bUL, 0x57d1d186UL, 0x26131335UL, 0x29eeeec7UL, +0xe588886dUL, 0x00000000UL, 0x1c0e0e12UL, 0x6834345cUL, +0x2a15153fUL, 0xf5808075UL, 0xdd949449UL, 0x33e3e3d0UL, +0x2fededc2UL, 0x9fb5b52aUL, 0xa65353f5UL, 0x46232365UL, +0x964b4bddUL, 0x8e4747c9UL, 0x2e171739UL, 0xbba7a71cUL, +0xd5909045UL, 0x6a35355fUL, 0xa3abab08UL, 0x45d8d89dUL, +0x85b8b83dUL, 0x4bdfdf94UL, 0x9e4f4fd1UL, 0xae5757f9UL, +0xc19a9a5bUL, 0xd1929243UL, 0x43dbdb98UL, 0x361b1b2dUL, +0x783c3c44UL, 0x65c8c8adUL, 0xc799995eUL, 0x0804040cUL, +0xe98e8e67UL, 0x35e0e0d5UL, 0x5bd7d78cUL, 0xfa7d7d87UL, +0xff85857aUL, 0x83bbbb38UL, 0x804040c0UL, 0x582c2c74UL, +0x743a3a4eUL, 0x8a4545cfUL, 0x17f1f1e6UL, 0x844242c6UL, +0xca6565afUL, 0x40202060UL, 0x824141c3UL, 0x30181828UL, +0xe4727296UL, 0x4a25256fUL, 0xd3939340UL, 0xe0707090UL, +0x6c36365aUL, 0x0a05050fUL, 0x11f2f2e3UL, 0x160b0b1dUL, +0xb3a3a310UL, 0xf279798bUL, 0x2dececc1UL, 0x10080818UL, +0x4e272769UL, 0x62313153UL, 0x64323256UL, 0x99b6b62fUL, +0xf87c7c84UL, 0x95b0b025UL, 0x140a0a1eUL, 0xe6737395UL, +0xb65b5bedUL, 0xf67b7b8dUL, 0x9bb7b72cUL, 0xf7818176UL, +0x51d2d283UL, 0x1a0d0d17UL, 0xd46a6abeUL, 0x4c26266aUL, +0xc99e9e57UL, 0xb05858e8UL, 0xcd9c9c51UL, 0xf3838370UL, +0xe874749cUL, 0x93b3b320UL, 0xadacac01UL, 0x60303050UL, +0xf47a7a8eUL, 0xd26969bbUL, 0xee777799UL, 0x1e0f0f11UL, +0xa9aeae07UL, 0x42212163UL, 0x49dede97UL, 0x55d0d085UL, +0x5c2e2e72UL, 0xdb97974cUL, 0x20101030UL, 0xbda4a419UL, +0xc598985dUL, 0xa5a8a80dUL, 0x5dd4d489UL, 0xd06868b8UL, +0x5a2d2d77UL, 0xc46262a6UL, 0x5229297bUL, 0xda6d6db7UL, +0x2c16163aUL, 0x924949dbUL, 0xec76769aUL, 0x7bc7c7bcUL, +0x25e8e8cdUL, 0x77c1c1b6UL, 0xd996964fUL, 0x6e373759UL, +0x3fe5e5daUL, 0x61cacaabUL, 0x1df4f4e9UL, 0x27e9e9ceUL, +0xc66363a5UL, 0x24121236UL, 0x71c2c2b3UL, 0xb9a6a61fUL, +0x2814143cUL, 0x8dbcbc31UL, 0x53d3d380UL, 0x50282878UL, +0xabafaf04UL, 0x5e2f2f71UL, 0x39e6e6dfUL, 0x4824246cUL, +0xa45252f6UL, 0x79c6c6bfUL, 0xb5a0a015UL, 0x1209091bUL, +0x8fbdbd32UL, 0xed8c8c61UL, 0x6bcfcfa4UL, 0xba5d5de7UL, +0x22111133UL, 0xbe5f5fe1UL, 0x02010103UL, 0x7fc5c5baUL, +0xcb9f9f54UL, 0x7a3d3d47UL, 0xb1a2a213UL, 0xc39b9b58UL, +0x67c9c9aeUL, 0x763b3b4dUL, 0x89bebe37UL, 0xa25151f3UL, +0x3219192bUL, 0x3e1f1f21UL, 0x7e3f3f41UL, 0xb85c5ce4UL, +0x91b2b223UL, 0x2befefc4UL, 0x944a4adeUL, 0x6fcdcda2UL, +0x8bbfbf34UL, 0x81baba3bUL, 0xde6f6fb1UL, 0xc86464acUL, +0x47d9d99eUL, 0x13f3f3e0UL, 0x7c3e3e42UL, 0x9db4b429UL, +0xa1aaaa0bUL, 0x4ddcdc91UL, 0x5fd5d58aUL, 0x0c06060aUL, +0x75c0c0b5UL, 0xfc7e7e82UL, 0x19f6f6efUL, 0xcc6666aaUL, +0xd86c6cb4UL, 0xfd848479UL, 0xe2717193UL, 0x70383848UL, +0x87b9b93eUL, 0x3a1d1d27UL, 0xfe7f7f81UL, 0xcf9d9d52UL, +0x904848d8UL, 0xe38b8b68UL, 0x542a2a7eUL, 0x41dada9bUL, +0xbfa5a51aUL, 0x66333355UL, 0xf1828273UL, 0x7239394bUL, +0x59d6d68fUL, 0xf0787888UL, 0xf986867fUL, 0x01fafafbUL, +0x3de4e4d9UL, 0x562b2b7dUL, 0xa7a9a90eUL, 0x3c1e1e22UL, +0xe789896eUL, 0xc06060a0UL, 0xd66b6bbdUL, 0x21eaeacbUL, +0xaa5555ffUL, 0x984c4cd4UL, 0x1bf7f7ecUL, 0x31e2e2d3UL, +}, + +{ +0x2697b1b1UL, 0xa769ceceUL, 0xb073c3c3UL, 0x4adf9595UL, +0xeeb45a5aUL, 0x02afadadUL, 0xdc3be7e7UL, 0x06040202UL, +0xd79a4d4dUL, 0xcc884444UL, 0xf803fbfbUL, 0x46d79191UL, +0x14180c0cUL, 0x7cfb8787UL, 0x16b7a1a1UL, 0xf0a05050UL, +0xa863cbcbUL, 0xa9ce6767UL, 0xfca85454UL, 0x924fddddUL, +0xca8c4646UL, 0x64eb8f8fUL, 0xd637e1e1UL, 0xd29c4e4eUL, +0xe515f0f0UL, 0xf20ffdfdUL, 0xf10dfcfcUL, 0xc823ebebUL, +0xfe07f9f9UL, 0xb97dc4c4UL, 0x2e341a1aUL, 0xb2dc6e6eUL, +0xe2bc5e5eUL, 0xea1ff5f5UL, 0xa16dccccUL, 0x62ef8d8dUL, +0x24381c1cUL, 0xfaac5656UL, 0xc5864343UL, 0xf709fefeUL, +0x090e0707UL, 0xa3c26161UL, 0xfd05f8f8UL, 0x9fea7575UL, +0xebb25959UL, 0xf40bffffUL, 0x05060303UL, 0x66442222UL, +0x6be18a8aUL, 0x8657d1d1UL, 0x35261313UL, 0xc729eeeeUL, +0x6de58888UL, 0x00000000UL, 0x121c0e0eUL, 0x5c683434UL, +0x3f2a1515UL, 0x75f58080UL, 0x49dd9494UL, 0xd033e3e3UL, +0xc22fededUL, 0x2a9fb5b5UL, 0xf5a65353UL, 0x65462323UL, +0xdd964b4bUL, 0xc98e4747UL, 0x392e1717UL, 0x1cbba7a7UL, +0x45d59090UL, 0x5f6a3535UL, 0x08a3ababUL, 0x9d45d8d8UL, +0x3d85b8b8UL, 0x944bdfdfUL, 0xd19e4f4fUL, 0xf9ae5757UL, +0x5bc19a9aUL, 0x43d19292UL, 0x9843dbdbUL, 0x2d361b1bUL, +0x44783c3cUL, 0xad65c8c8UL, 0x5ec79999UL, 0x0c080404UL, +0x67e98e8eUL, 0xd535e0e0UL, 0x8c5bd7d7UL, 0x87fa7d7dUL, +0x7aff8585UL, 0x3883bbbbUL, 0xc0804040UL, 0x74582c2cUL, +0x4e743a3aUL, 0xcf8a4545UL, 0xe617f1f1UL, 0xc6844242UL, +0xafca6565UL, 0x60402020UL, 0xc3824141UL, 0x28301818UL, +0x96e47272UL, 0x6f4a2525UL, 0x40d39393UL, 0x90e07070UL, +0x5a6c3636UL, 0x0f0a0505UL, 0xe311f2f2UL, 0x1d160b0bUL, +0x10b3a3a3UL, 0x8bf27979UL, 0xc12dececUL, 0x18100808UL, +0x694e2727UL, 0x53623131UL, 0x56643232UL, 0x2f99b6b6UL, +0x84f87c7cUL, 0x2595b0b0UL, 0x1e140a0aUL, 0x95e67373UL, +0xedb65b5bUL, 0x8df67b7bUL, 0x2c9bb7b7UL, 0x76f78181UL, +0x8351d2d2UL, 0x171a0d0dUL, 0xbed46a6aUL, 0x6a4c2626UL, +0x57c99e9eUL, 0xe8b05858UL, 0x51cd9c9cUL, 0x70f38383UL, +0x9ce87474UL, 0x2093b3b3UL, 0x01adacacUL, 0x50603030UL, +0x8ef47a7aUL, 0xbbd26969UL, 0x99ee7777UL, 0x111e0f0fUL, +0x07a9aeaeUL, 0x63422121UL, 0x9749dedeUL, 0x8555d0d0UL, +0x725c2e2eUL, 0x4cdb9797UL, 0x30201010UL, 0x19bda4a4UL, +0x5dc59898UL, 0x0da5a8a8UL, 0x895dd4d4UL, 0xb8d06868UL, +0x775a2d2dUL, 0xa6c46262UL, 0x7b522929UL, 0xb7da6d6dUL, +0x3a2c1616UL, 0xdb924949UL, 0x9aec7676UL, 0xbc7bc7c7UL, +0xcd25e8e8UL, 0xb677c1c1UL, 0x4fd99696UL, 0x596e3737UL, +0xda3fe5e5UL, 0xab61cacaUL, 0xe91df4f4UL, 0xce27e9e9UL, +0xa5c66363UL, 0x36241212UL, 0xb371c2c2UL, 0x1fb9a6a6UL, +0x3c281414UL, 0x318dbcbcUL, 0x8053d3d3UL, 0x78502828UL, +0x04abafafUL, 0x715e2f2fUL, 0xdf39e6e6UL, 0x6c482424UL, +0xf6a45252UL, 0xbf79c6c6UL, 0x15b5a0a0UL, 0x1b120909UL, +0x328fbdbdUL, 0x61ed8c8cUL, 0xa46bcfcfUL, 0xe7ba5d5dUL, +0x33221111UL, 0xe1be5f5fUL, 0x03020101UL, 0xba7fc5c5UL, +0x54cb9f9fUL, 0x477a3d3dUL, 0x13b1a2a2UL, 0x58c39b9bUL, +0xae67c9c9UL, 0x4d763b3bUL, 0x3789bebeUL, 0xf3a25151UL, +0x2b321919UL, 0x213e1f1fUL, 0x417e3f3fUL, 0xe4b85c5cUL, +0x2391b2b2UL, 0xc42befefUL, 0xde944a4aUL, 0xa26fcdcdUL, +0x348bbfbfUL, 0x3b81babaUL, 0xb1de6f6fUL, 0xacc86464UL, +0x9e47d9d9UL, 0xe013f3f3UL, 0x427c3e3eUL, 0x299db4b4UL, +0x0ba1aaaaUL, 0x914ddcdcUL, 0x8a5fd5d5UL, 0x0a0c0606UL, +0xb575c0c0UL, 0x82fc7e7eUL, 0xef19f6f6UL, 0xaacc6666UL, +0xb4d86c6cUL, 0x79fd8484UL, 0x93e27171UL, 0x48703838UL, +0x3e87b9b9UL, 0x273a1d1dUL, 0x81fe7f7fUL, 0x52cf9d9dUL, +0xd8904848UL, 0x68e38b8bUL, 0x7e542a2aUL, 0x9b41dadaUL, +0x1abfa5a5UL, 0x55663333UL, 0x73f18282UL, 0x4b723939UL, +0x8f59d6d6UL, 0x88f07878UL, 0x7ff98686UL, 0xfb01fafaUL, +0xd93de4e4UL, 0x7d562b2bUL, 0x0ea7a9a9UL, 0x223c1e1eUL, +0x6ee78989UL, 0xa0c06060UL, 0xbdd66b6bUL, 0xcb21eaeaUL, +0xffaa5555UL, 0xd4984c4cUL, 0xec1bf7f7UL, 0xd331e2e2UL, +}, + +{ +0xb12697b1UL, 0xcea769ceUL, 0xc3b073c3UL, 0x954adf95UL, +0x5aeeb45aUL, 0xad02afadUL, 0xe7dc3be7UL, 0x02060402UL, +0x4dd79a4dUL, 0x44cc8844UL, 0xfbf803fbUL, 0x9146d791UL, +0x0c14180cUL, 0x877cfb87UL, 0xa116b7a1UL, 0x50f0a050UL, +0xcba863cbUL, 0x67a9ce67UL, 0x54fca854UL, 0xdd924fddUL, +0x46ca8c46UL, 0x8f64eb8fUL, 0xe1d637e1UL, 0x4ed29c4eUL, +0xf0e515f0UL, 0xfdf20ffdUL, 0xfcf10dfcUL, 0xebc823ebUL, +0xf9fe07f9UL, 0xc4b97dc4UL, 0x1a2e341aUL, 0x6eb2dc6eUL, +0x5ee2bc5eUL, 0xf5ea1ff5UL, 0xcca16dccUL, 0x8d62ef8dUL, +0x1c24381cUL, 0x56faac56UL, 0x43c58643UL, 0xfef709feUL, +0x07090e07UL, 0x61a3c261UL, 0xf8fd05f8UL, 0x759fea75UL, +0x59ebb259UL, 0xfff40bffUL, 0x03050603UL, 0x22664422UL, +0x8a6be18aUL, 0xd18657d1UL, 0x13352613UL, 0xeec729eeUL, +0x886de588UL, 0x00000000UL, 0x0e121c0eUL, 0x345c6834UL, +0x153f2a15UL, 0x8075f580UL, 0x9449dd94UL, 0xe3d033e3UL, +0xedc22fedUL, 0xb52a9fb5UL, 0x53f5a653UL, 0x23654623UL, +0x4bdd964bUL, 0x47c98e47UL, 0x17392e17UL, 0xa71cbba7UL, +0x9045d590UL, 0x355f6a35UL, 0xab08a3abUL, 0xd89d45d8UL, +0xb83d85b8UL, 0xdf944bdfUL, 0x4fd19e4fUL, 0x57f9ae57UL, +0x9a5bc19aUL, 0x9243d192UL, 0xdb9843dbUL, 0x1b2d361bUL, +0x3c44783cUL, 0xc8ad65c8UL, 0x995ec799UL, 0x040c0804UL, +0x8e67e98eUL, 0xe0d535e0UL, 0xd78c5bd7UL, 0x7d87fa7dUL, +0x857aff85UL, 0xbb3883bbUL, 0x40c08040UL, 0x2c74582cUL, +0x3a4e743aUL, 0x45cf8a45UL, 0xf1e617f1UL, 0x42c68442UL, +0x65afca65UL, 0x20604020UL, 0x41c38241UL, 0x18283018UL, +0x7296e472UL, 0x256f4a25UL, 0x9340d393UL, 0x7090e070UL, +0x365a6c36UL, 0x050f0a05UL, 0xf2e311f2UL, 0x0b1d160bUL, +0xa310b3a3UL, 0x798bf279UL, 0xecc12decUL, 0x08181008UL, +0x27694e27UL, 0x31536231UL, 0x32566432UL, 0xb62f99b6UL, +0x7c84f87cUL, 0xb02595b0UL, 0x0a1e140aUL, 0x7395e673UL, +0x5bedb65bUL, 0x7b8df67bUL, 0xb72c9bb7UL, 0x8176f781UL, +0xd28351d2UL, 0x0d171a0dUL, 0x6abed46aUL, 0x266a4c26UL, +0x9e57c99eUL, 0x58e8b058UL, 0x9c51cd9cUL, 0x8370f383UL, +0x749ce874UL, 0xb32093b3UL, 0xac01adacUL, 0x30506030UL, +0x7a8ef47aUL, 0x69bbd269UL, 0x7799ee77UL, 0x0f111e0fUL, +0xae07a9aeUL, 0x21634221UL, 0xde9749deUL, 0xd08555d0UL, +0x2e725c2eUL, 0x974cdb97UL, 0x10302010UL, 0xa419bda4UL, +0x985dc598UL, 0xa80da5a8UL, 0xd4895dd4UL, 0x68b8d068UL, +0x2d775a2dUL, 0x62a6c462UL, 0x297b5229UL, 0x6db7da6dUL, +0x163a2c16UL, 0x49db9249UL, 0x769aec76UL, 0xc7bc7bc7UL, +0xe8cd25e8UL, 0xc1b677c1UL, 0x964fd996UL, 0x37596e37UL, +0xe5da3fe5UL, 0xcaab61caUL, 0xf4e91df4UL, 0xe9ce27e9UL, +0x63a5c663UL, 0x12362412UL, 0xc2b371c2UL, 0xa61fb9a6UL, +0x143c2814UL, 0xbc318dbcUL, 0xd38053d3UL, 0x28785028UL, +0xaf04abafUL, 0x2f715e2fUL, 0xe6df39e6UL, 0x246c4824UL, +0x52f6a452UL, 0xc6bf79c6UL, 0xa015b5a0UL, 0x091b1209UL, +0xbd328fbdUL, 0x8c61ed8cUL, 0xcfa46bcfUL, 0x5de7ba5dUL, +0x11332211UL, 0x5fe1be5fUL, 0x01030201UL, 0xc5ba7fc5UL, +0x9f54cb9fUL, 0x3d477a3dUL, 0xa213b1a2UL, 0x9b58c39bUL, +0xc9ae67c9UL, 0x3b4d763bUL, 0xbe3789beUL, 0x51f3a251UL, +0x192b3219UL, 0x1f213e1fUL, 0x3f417e3fUL, 0x5ce4b85cUL, +0xb22391b2UL, 0xefc42befUL, 0x4ade944aUL, 0xcda26fcdUL, +0xbf348bbfUL, 0xba3b81baUL, 0x6fb1de6fUL, 0x64acc864UL, +0xd99e47d9UL, 0xf3e013f3UL, 0x3e427c3eUL, 0xb4299db4UL, +0xaa0ba1aaUL, 0xdc914ddcUL, 0xd58a5fd5UL, 0x060a0c06UL, +0xc0b575c0UL, 0x7e82fc7eUL, 0xf6ef19f6UL, 0x66aacc66UL, +0x6cb4d86cUL, 0x8479fd84UL, 0x7193e271UL, 0x38487038UL, +0xb93e87b9UL, 0x1d273a1dUL, 0x7f81fe7fUL, 0x9d52cf9dUL, +0x48d89048UL, 0x8b68e38bUL, 0x2a7e542aUL, 0xda9b41daUL, +0xa51abfa5UL, 0x33556633UL, 0x8273f182UL, 0x394b7239UL, +0xd68f59d6UL, 0x7888f078UL, 0x867ff986UL, 0xfafb01faUL, +0xe4d93de4UL, 0x2b7d562bUL, 0xa90ea7a9UL, 0x1e223c1eUL, +0x896ee789UL, 0x60a0c060UL, 0x6bbdd66bUL, 0xeacb21eaUL, +0x55ffaa55UL, 0x4cd4984cUL, 0xf7ec1bf7UL, 0xe2d331e2UL, +}, + +{ +0xb1b12697UL, 0xcecea769UL, 0xc3c3b073UL, 0x95954adfUL, +0x5a5aeeb4UL, 0xadad02afUL, 0xe7e7dc3bUL, 0x02020604UL, +0x4d4dd79aUL, 0x4444cc88UL, 0xfbfbf803UL, 0x919146d7UL, +0x0c0c1418UL, 0x87877cfbUL, 0xa1a116b7UL, 0x5050f0a0UL, +0xcbcba863UL, 0x6767a9ceUL, 0x5454fca8UL, 0xdddd924fUL, +0x4646ca8cUL, 0x8f8f64ebUL, 0xe1e1d637UL, 0x4e4ed29cUL, +0xf0f0e515UL, 0xfdfdf20fUL, 0xfcfcf10dUL, 0xebebc823UL, +0xf9f9fe07UL, 0xc4c4b97dUL, 0x1a1a2e34UL, 0x6e6eb2dcUL, +0x5e5ee2bcUL, 0xf5f5ea1fUL, 0xcccca16dUL, 0x8d8d62efUL, +0x1c1c2438UL, 0x5656faacUL, 0x4343c586UL, 0xfefef709UL, +0x0707090eUL, 0x6161a3c2UL, 0xf8f8fd05UL, 0x75759feaUL, +0x5959ebb2UL, 0xfffff40bUL, 0x03030506UL, 0x22226644UL, +0x8a8a6be1UL, 0xd1d18657UL, 0x13133526UL, 0xeeeec729UL, +0x88886de5UL, 0x00000000UL, 0x0e0e121cUL, 0x34345c68UL, +0x15153f2aUL, 0x808075f5UL, 0x949449ddUL, 0xe3e3d033UL, +0xededc22fUL, 0xb5b52a9fUL, 0x5353f5a6UL, 0x23236546UL, +0x4b4bdd96UL, 0x4747c98eUL, 0x1717392eUL, 0xa7a71cbbUL, +0x909045d5UL, 0x35355f6aUL, 0xabab08a3UL, 0xd8d89d45UL, +0xb8b83d85UL, 0xdfdf944bUL, 0x4f4fd19eUL, 0x5757f9aeUL, +0x9a9a5bc1UL, 0x929243d1UL, 0xdbdb9843UL, 0x1b1b2d36UL, +0x3c3c4478UL, 0xc8c8ad65UL, 0x99995ec7UL, 0x04040c08UL, +0x8e8e67e9UL, 0xe0e0d535UL, 0xd7d78c5bUL, 0x7d7d87faUL, +0x85857affUL, 0xbbbb3883UL, 0x4040c080UL, 0x2c2c7458UL, +0x3a3a4e74UL, 0x4545cf8aUL, 0xf1f1e617UL, 0x4242c684UL, +0x6565afcaUL, 0x20206040UL, 0x4141c382UL, 0x18182830UL, +0x727296e4UL, 0x25256f4aUL, 0x939340d3UL, 0x707090e0UL, +0x36365a6cUL, 0x05050f0aUL, 0xf2f2e311UL, 0x0b0b1d16UL, +0xa3a310b3UL, 0x79798bf2UL, 0xececc12dUL, 0x08081810UL, +0x2727694eUL, 0x31315362UL, 0x32325664UL, 0xb6b62f99UL, +0x7c7c84f8UL, 0xb0b02595UL, 0x0a0a1e14UL, 0x737395e6UL, +0x5b5bedb6UL, 0x7b7b8df6UL, 0xb7b72c9bUL, 0x818176f7UL, +0xd2d28351UL, 0x0d0d171aUL, 0x6a6abed4UL, 0x26266a4cUL, +0x9e9e57c9UL, 0x5858e8b0UL, 0x9c9c51cdUL, 0x838370f3UL, +0x74749ce8UL, 0xb3b32093UL, 0xacac01adUL, 0x30305060UL, +0x7a7a8ef4UL, 0x6969bbd2UL, 0x777799eeUL, 0x0f0f111eUL, +0xaeae07a9UL, 0x21216342UL, 0xdede9749UL, 0xd0d08555UL, +0x2e2e725cUL, 0x97974cdbUL, 0x10103020UL, 0xa4a419bdUL, +0x98985dc5UL, 0xa8a80da5UL, 0xd4d4895dUL, 0x6868b8d0UL, +0x2d2d775aUL, 0x6262a6c4UL, 0x29297b52UL, 0x6d6db7daUL, +0x16163a2cUL, 0x4949db92UL, 0x76769aecUL, 0xc7c7bc7bUL, +0xe8e8cd25UL, 0xc1c1b677UL, 0x96964fd9UL, 0x3737596eUL, +0xe5e5da3fUL, 0xcacaab61UL, 0xf4f4e91dUL, 0xe9e9ce27UL, +0x6363a5c6UL, 0x12123624UL, 0xc2c2b371UL, 0xa6a61fb9UL, +0x14143c28UL, 0xbcbc318dUL, 0xd3d38053UL, 0x28287850UL, +0xafaf04abUL, 0x2f2f715eUL, 0xe6e6df39UL, 0x24246c48UL, +0x5252f6a4UL, 0xc6c6bf79UL, 0xa0a015b5UL, 0x09091b12UL, +0xbdbd328fUL, 0x8c8c61edUL, 0xcfcfa46bUL, 0x5d5de7baUL, +0x11113322UL, 0x5f5fe1beUL, 0x01010302UL, 0xc5c5ba7fUL, +0x9f9f54cbUL, 0x3d3d477aUL, 0xa2a213b1UL, 0x9b9b58c3UL, +0xc9c9ae67UL, 0x3b3b4d76UL, 0xbebe3789UL, 0x5151f3a2UL, +0x19192b32UL, 0x1f1f213eUL, 0x3f3f417eUL, 0x5c5ce4b8UL, +0xb2b22391UL, 0xefefc42bUL, 0x4a4ade94UL, 0xcdcda26fUL, +0xbfbf348bUL, 0xbaba3b81UL, 0x6f6fb1deUL, 0x6464acc8UL, +0xd9d99e47UL, 0xf3f3e013UL, 0x3e3e427cUL, 0xb4b4299dUL, +0xaaaa0ba1UL, 0xdcdc914dUL, 0xd5d58a5fUL, 0x06060a0cUL, +0xc0c0b575UL, 0x7e7e82fcUL, 0xf6f6ef19UL, 0x6666aaccUL, +0x6c6cb4d8UL, 0x848479fdUL, 0x717193e2UL, 0x38384870UL, +0xb9b93e87UL, 0x1d1d273aUL, 0x7f7f81feUL, 0x9d9d52cfUL, +0x4848d890UL, 0x8b8b68e3UL, 0x2a2a7e54UL, 0xdada9b41UL, +0xa5a51abfUL, 0x33335566UL, 0x828273f1UL, 0x39394b72UL, +0xd6d68f59UL, 0x787888f0UL, 0x86867ff9UL, 0xfafafb01UL, +0xe4e4d93dUL, 0x2b2b7d56UL, 0xa9a90ea7UL, 0x1e1e223cUL, +0x89896ee7UL, 0x6060a0c0UL, 0x6b6bbdd6UL, 0xeaeacb21UL, +0x5555ffaaUL, 0x4c4cd498UL, 0xf7f7ec1bUL, 0xe2e2d331UL, +}}; + +const word32 Square::Dec::Td[4][256] = { +{ +0xe368bc02UL, 0x5585620cUL, 0x2a3f2331UL, 0x61ab13f7UL, +0x98d46d72UL, 0x21cb9a19UL, 0x3c22a461UL, 0x459d3dcdUL, +0x05fdb423UL, 0x2bc4075fUL, 0x9b2c01c0UL, 0x3dd9800fUL, +0x486c5c74UL, 0xf97f7e85UL, 0xf173ab1fUL, 0xb6edde0eUL, +0x283c6bedUL, 0x4997781aUL, 0x9f2a918dUL, 0xc9579f33UL, +0xa907a8aaUL, 0xa50ded7dUL, 0x7c422d8fUL, 0x764db0c9UL, +0x4d91e857UL, 0xcea963ccUL, 0xb4ee96d2UL, 0x3028e1b6UL, +0x0df161b9UL, 0xbd196726UL, 0x419bad80UL, 0xc0a06ec7UL, +0x5183f241UL, 0x92dbf034UL, 0x6fa21efcUL, 0x8f32ce4cUL, +0x13e03373UL, 0x69a7c66dUL, 0xe56d6493UL, 0xbf1a2ffaUL, +0xbb1cbfb7UL, 0x587403b5UL, 0xe76e2c4fUL, 0x5d89b796UL, +0xe89c052aUL, 0x446619a3UL, 0x342e71fbUL, 0x0ff22965UL, +0xfe81827aUL, 0xb11322f1UL, 0xa30835ecUL, 0xcd510f7eUL, +0xff7aa614UL, 0x5c7293f8UL, 0x2fc29712UL, 0xf370e3c3UL, +0x992f491cUL, 0xd1431568UL, 0xc2a3261bUL, 0x88cc32b3UL, +0x8acf7a6fUL, 0xb0e8069fUL, 0x7a47f51eUL, 0xd2bb79daUL, +0xe6950821UL, 0x4398e55cUL, 0xd0b83106UL, 0x11e37bafUL, +0x7e416553UL, 0xccaa2b10UL, 0xd8b4e49cUL, 0x6456a7d4UL, +0xfb7c3659UL, 0x724b2084UL, 0xea9f4df6UL, 0x6a5faadfUL, +0x2dc1dfceUL, 0x70486858UL, 0xcaaff381UL, 0x0605d891UL, +0x5a774b69UL, 0x94de28a5UL, 0x39df1042UL, 0x813bc347UL, +0xfc82caa6UL, 0x23c8d2c5UL, 0x03f86cb2UL, 0x080cd59aUL, +0xdab7ac40UL, 0x7db909e1UL, 0x3824342cUL, 0xcf5247a2UL, +0xdcb274d1UL, 0x63a85b2bUL, 0x35d55595UL, 0x479e7511UL, +0x15e5ebe2UL, 0x4b9430c6UL, 0x4a6f14a8UL, 0x91239c86UL, +0x4c6acc39UL, 0x5f8aff4aUL, 0x0406904dUL, 0xee99ddbbUL, +0x1e1152caUL, 0xaaffc418UL, 0xeb646998UL, 0x07fefcffUL, +0x8b345e01UL, 0x567d0ebeUL, 0xbae79bd9UL, 0x4263c132UL, +0x75b5dc7bUL, 0x97264417UL, 0x67aecb66UL, 0x95250ccbUL, +0xec9a9567UL, 0x57862ad0UL, 0x60503799UL, 0xb8e4d305UL, +0x65ad83baUL, 0x19efae35UL, 0xa4f6c913UL, 0xc15b4aa9UL, +0x873e1bd6UL, 0xa0f0595eUL, 0x18148a5bUL, 0xaf02703bUL, +0xab04e076UL, 0xdd4950bfUL, 0xdf4a1863UL, 0xc6a5b656UL, +0x853d530aUL, 0xfa871237UL, 0x77b694a7UL, 0x4665517fUL, +0xed61b109UL, 0x1bece6e9UL, 0xd5458525UL, 0xf5753b52UL, +0x7fba413dUL, 0x27ce4288UL, 0xb2eb4e43UL, 0xd6bde997UL, +0x527b9ef3UL, 0x62537f45UL, 0x2c3afba0UL, 0x7bbcd170UL, +0xb91ff76bUL, 0x121b171dUL, 0xfd79eec8UL, 0x3a277cf0UL, +0x0c0a45d7UL, 0x96dd6079UL, 0x2233f6abUL, 0xacfa1c89UL, +0xc8acbb5dUL, 0xa10b7d30UL, 0xd4bea14bUL, 0xbee10b94UL, +0x25cd0a54UL, 0x547e4662UL, 0xa2f31182UL, 0x17e6a33eUL, +0x263566e6UL, 0xc3580275UL, 0x83388b9bUL, 0x7844bdc2UL, +0x020348dcUL, 0x4f92a08bUL, 0x2e39b37cUL, 0x4e6984e5UL, +0xf0888f71UL, 0x362d3927UL, 0x9cd2fd3fUL, 0x01fb246eUL, +0x893716ddUL, 0x00000000UL, 0xf68d57e0UL, 0xe293986cUL, +0x744ef815UL, 0x9320d45aUL, 0xad0138e7UL, 0xd3405db4UL, +0x1a17c287UL, 0xb3106a2dUL, 0x5078d62fUL, 0xf48e1f3cUL, +0xa70ea5a1UL, 0x71b34c36UL, 0x9ad725aeUL, 0x5e71db24UL, +0x161d8750UL, 0xef62f9d5UL, 0x8d318690UL, 0x1c121a16UL, +0xa6f581cfUL, 0x5b8c6f07UL, 0x37d61d49UL, 0x6e593a92UL, +0x84c67764UL, 0x86c53fb8UL, 0xd746cdf9UL, 0xe090d0b0UL, +0x29c74f83UL, 0xe49640fdUL, 0x0e090d0bUL, 0x6da15620UL, +0x8ec9ea22UL, 0xdb4c882eUL, 0xf776738eUL, 0xb515b2bcUL, +0x10185fc1UL, 0x322ba96aUL, 0x6ba48eb1UL, 0xaef95455UL, +0x406089eeUL, 0x6655ef08UL, 0xe9672144UL, 0x3e21ecbdUL, +0x2030be77UL, 0xf28bc7adUL, 0x80c0e729UL, 0x141ecf8cUL, +0xbce24348UL, 0xc4a6fe8aUL, 0x31d3c5d8UL, 0xb716fa60UL, +0x5380ba9dUL, 0xd94fc0f2UL, 0x1de93e78UL, 0x24362e3aUL, +0xe16bf4deUL, 0xcb54d7efUL, 0x09f7f1f4UL, 0x82c3aff5UL, +0x0bf4b928UL, 0x9d29d951UL, 0xc75e9238UL, 0xf8845aebUL, +0x90d8b8e8UL, 0xdeb13c0dUL, 0x33d08d04UL, 0x685ce203UL, +0xc55ddae4UL, 0x3bdc589eUL, 0x0a0f9d46UL, 0x3fdac8d3UL, +0x598f27dbUL, 0xa8fc8cc4UL, 0x79bf99acUL, 0x6c5a724eUL, +0x8ccaa2feUL, 0x9ed1b5e3UL, 0x1fea76a4UL, 0x73b004eaUL, +}, + +{ +0x02e368bcUL, 0x0c558562UL, 0x312a3f23UL, 0xf761ab13UL, +0x7298d46dUL, 0x1921cb9aUL, 0x613c22a4UL, 0xcd459d3dUL, +0x2305fdb4UL, 0x5f2bc407UL, 0xc09b2c01UL, 0x0f3dd980UL, +0x74486c5cUL, 0x85f97f7eUL, 0x1ff173abUL, 0x0eb6eddeUL, +0xed283c6bUL, 0x1a499778UL, 0x8d9f2a91UL, 0x33c9579fUL, +0xaaa907a8UL, 0x7da50dedUL, 0x8f7c422dUL, 0xc9764db0UL, +0x574d91e8UL, 0xcccea963UL, 0xd2b4ee96UL, 0xb63028e1UL, +0xb90df161UL, 0x26bd1967UL, 0x80419badUL, 0xc7c0a06eUL, +0x415183f2UL, 0x3492dbf0UL, 0xfc6fa21eUL, 0x4c8f32ceUL, +0x7313e033UL, 0x6d69a7c6UL, 0x93e56d64UL, 0xfabf1a2fUL, +0xb7bb1cbfUL, 0xb5587403UL, 0x4fe76e2cUL, 0x965d89b7UL, +0x2ae89c05UL, 0xa3446619UL, 0xfb342e71UL, 0x650ff229UL, +0x7afe8182UL, 0xf1b11322UL, 0xeca30835UL, 0x7ecd510fUL, +0x14ff7aa6UL, 0xf85c7293UL, 0x122fc297UL, 0xc3f370e3UL, +0x1c992f49UL, 0x68d14315UL, 0x1bc2a326UL, 0xb388cc32UL, +0x6f8acf7aUL, 0x9fb0e806UL, 0x1e7a47f5UL, 0xdad2bb79UL, +0x21e69508UL, 0x5c4398e5UL, 0x06d0b831UL, 0xaf11e37bUL, +0x537e4165UL, 0x10ccaa2bUL, 0x9cd8b4e4UL, 0xd46456a7UL, +0x59fb7c36UL, 0x84724b20UL, 0xf6ea9f4dUL, 0xdf6a5faaUL, +0xce2dc1dfUL, 0x58704868UL, 0x81caaff3UL, 0x910605d8UL, +0x695a774bUL, 0xa594de28UL, 0x4239df10UL, 0x47813bc3UL, +0xa6fc82caUL, 0xc523c8d2UL, 0xb203f86cUL, 0x9a080cd5UL, +0x40dab7acUL, 0xe17db909UL, 0x2c382434UL, 0xa2cf5247UL, +0xd1dcb274UL, 0x2b63a85bUL, 0x9535d555UL, 0x11479e75UL, +0xe215e5ebUL, 0xc64b9430UL, 0xa84a6f14UL, 0x8691239cUL, +0x394c6accUL, 0x4a5f8affUL, 0x4d040690UL, 0xbbee99ddUL, +0xca1e1152UL, 0x18aaffc4UL, 0x98eb6469UL, 0xff07fefcUL, +0x018b345eUL, 0xbe567d0eUL, 0xd9bae79bUL, 0x324263c1UL, +0x7b75b5dcUL, 0x17972644UL, 0x6667aecbUL, 0xcb95250cUL, +0x67ec9a95UL, 0xd057862aUL, 0x99605037UL, 0x05b8e4d3UL, +0xba65ad83UL, 0x3519efaeUL, 0x13a4f6c9UL, 0xa9c15b4aUL, +0xd6873e1bUL, 0x5ea0f059UL, 0x5b18148aUL, 0x3baf0270UL, +0x76ab04e0UL, 0xbfdd4950UL, 0x63df4a18UL, 0x56c6a5b6UL, +0x0a853d53UL, 0x37fa8712UL, 0xa777b694UL, 0x7f466551UL, +0x09ed61b1UL, 0xe91bece6UL, 0x25d54585UL, 0x52f5753bUL, +0x3d7fba41UL, 0x8827ce42UL, 0x43b2eb4eUL, 0x97d6bde9UL, +0xf3527b9eUL, 0x4562537fUL, 0xa02c3afbUL, 0x707bbcd1UL, +0x6bb91ff7UL, 0x1d121b17UL, 0xc8fd79eeUL, 0xf03a277cUL, +0xd70c0a45UL, 0x7996dd60UL, 0xab2233f6UL, 0x89acfa1cUL, +0x5dc8acbbUL, 0x30a10b7dUL, 0x4bd4bea1UL, 0x94bee10bUL, +0x5425cd0aUL, 0x62547e46UL, 0x82a2f311UL, 0x3e17e6a3UL, +0xe6263566UL, 0x75c35802UL, 0x9b83388bUL, 0xc27844bdUL, +0xdc020348UL, 0x8b4f92a0UL, 0x7c2e39b3UL, 0xe54e6984UL, +0x71f0888fUL, 0x27362d39UL, 0x3f9cd2fdUL, 0x6e01fb24UL, +0xdd893716UL, 0x00000000UL, 0xe0f68d57UL, 0x6ce29398UL, +0x15744ef8UL, 0x5a9320d4UL, 0xe7ad0138UL, 0xb4d3405dUL, +0x871a17c2UL, 0x2db3106aUL, 0x2f5078d6UL, 0x3cf48e1fUL, +0xa1a70ea5UL, 0x3671b34cUL, 0xae9ad725UL, 0x245e71dbUL, +0x50161d87UL, 0xd5ef62f9UL, 0x908d3186UL, 0x161c121aUL, +0xcfa6f581UL, 0x075b8c6fUL, 0x4937d61dUL, 0x926e593aUL, +0x6484c677UL, 0xb886c53fUL, 0xf9d746cdUL, 0xb0e090d0UL, +0x8329c74fUL, 0xfde49640UL, 0x0b0e090dUL, 0x206da156UL, +0x228ec9eaUL, 0x2edb4c88UL, 0x8ef77673UL, 0xbcb515b2UL, +0xc110185fUL, 0x6a322ba9UL, 0xb16ba48eUL, 0x55aef954UL, +0xee406089UL, 0x086655efUL, 0x44e96721UL, 0xbd3e21ecUL, +0x772030beUL, 0xadf28bc7UL, 0x2980c0e7UL, 0x8c141ecfUL, +0x48bce243UL, 0x8ac4a6feUL, 0xd831d3c5UL, 0x60b716faUL, +0x9d5380baUL, 0xf2d94fc0UL, 0x781de93eUL, 0x3a24362eUL, +0xdee16bf4UL, 0xefcb54d7UL, 0xf409f7f1UL, 0xf582c3afUL, +0x280bf4b9UL, 0x519d29d9UL, 0x38c75e92UL, 0xebf8845aUL, +0xe890d8b8UL, 0x0ddeb13cUL, 0x0433d08dUL, 0x03685ce2UL, +0xe4c55ddaUL, 0x9e3bdc58UL, 0x460a0f9dUL, 0xd33fdac8UL, +0xdb598f27UL, 0xc4a8fc8cUL, 0xac79bf99UL, 0x4e6c5a72UL, +0xfe8ccaa2UL, 0xe39ed1b5UL, 0xa41fea76UL, 0xea73b004UL, +}, + +{ +0xbc02e368UL, 0x620c5585UL, 0x23312a3fUL, 0x13f761abUL, +0x6d7298d4UL, 0x9a1921cbUL, 0xa4613c22UL, 0x3dcd459dUL, +0xb42305fdUL, 0x075f2bc4UL, 0x01c09b2cUL, 0x800f3dd9UL, +0x5c74486cUL, 0x7e85f97fUL, 0xab1ff173UL, 0xde0eb6edUL, +0x6bed283cUL, 0x781a4997UL, 0x918d9f2aUL, 0x9f33c957UL, +0xa8aaa907UL, 0xed7da50dUL, 0x2d8f7c42UL, 0xb0c9764dUL, +0xe8574d91UL, 0x63cccea9UL, 0x96d2b4eeUL, 0xe1b63028UL, +0x61b90df1UL, 0x6726bd19UL, 0xad80419bUL, 0x6ec7c0a0UL, +0xf2415183UL, 0xf03492dbUL, 0x1efc6fa2UL, 0xce4c8f32UL, +0x337313e0UL, 0xc66d69a7UL, 0x6493e56dUL, 0x2ffabf1aUL, +0xbfb7bb1cUL, 0x03b55874UL, 0x2c4fe76eUL, 0xb7965d89UL, +0x052ae89cUL, 0x19a34466UL, 0x71fb342eUL, 0x29650ff2UL, +0x827afe81UL, 0x22f1b113UL, 0x35eca308UL, 0x0f7ecd51UL, +0xa614ff7aUL, 0x93f85c72UL, 0x97122fc2UL, 0xe3c3f370UL, +0x491c992fUL, 0x1568d143UL, 0x261bc2a3UL, 0x32b388ccUL, +0x7a6f8acfUL, 0x069fb0e8UL, 0xf51e7a47UL, 0x79dad2bbUL, +0x0821e695UL, 0xe55c4398UL, 0x3106d0b8UL, 0x7baf11e3UL, +0x65537e41UL, 0x2b10ccaaUL, 0xe49cd8b4UL, 0xa7d46456UL, +0x3659fb7cUL, 0x2084724bUL, 0x4df6ea9fUL, 0xaadf6a5fUL, +0xdfce2dc1UL, 0x68587048UL, 0xf381caafUL, 0xd8910605UL, +0x4b695a77UL, 0x28a594deUL, 0x104239dfUL, 0xc347813bUL, +0xcaa6fc82UL, 0xd2c523c8UL, 0x6cb203f8UL, 0xd59a080cUL, +0xac40dab7UL, 0x09e17db9UL, 0x342c3824UL, 0x47a2cf52UL, +0x74d1dcb2UL, 0x5b2b63a8UL, 0x559535d5UL, 0x7511479eUL, +0xebe215e5UL, 0x30c64b94UL, 0x14a84a6fUL, 0x9c869123UL, +0xcc394c6aUL, 0xff4a5f8aUL, 0x904d0406UL, 0xddbbee99UL, +0x52ca1e11UL, 0xc418aaffUL, 0x6998eb64UL, 0xfcff07feUL, +0x5e018b34UL, 0x0ebe567dUL, 0x9bd9bae7UL, 0xc1324263UL, +0xdc7b75b5UL, 0x44179726UL, 0xcb6667aeUL, 0x0ccb9525UL, +0x9567ec9aUL, 0x2ad05786UL, 0x37996050UL, 0xd305b8e4UL, +0x83ba65adUL, 0xae3519efUL, 0xc913a4f6UL, 0x4aa9c15bUL, +0x1bd6873eUL, 0x595ea0f0UL, 0x8a5b1814UL, 0x703baf02UL, +0xe076ab04UL, 0x50bfdd49UL, 0x1863df4aUL, 0xb656c6a5UL, +0x530a853dUL, 0x1237fa87UL, 0x94a777b6UL, 0x517f4665UL, +0xb109ed61UL, 0xe6e91becUL, 0x8525d545UL, 0x3b52f575UL, +0x413d7fbaUL, 0x428827ceUL, 0x4e43b2ebUL, 0xe997d6bdUL, +0x9ef3527bUL, 0x7f456253UL, 0xfba02c3aUL, 0xd1707bbcUL, +0xf76bb91fUL, 0x171d121bUL, 0xeec8fd79UL, 0x7cf03a27UL, +0x45d70c0aUL, 0x607996ddUL, 0xf6ab2233UL, 0x1c89acfaUL, +0xbb5dc8acUL, 0x7d30a10bUL, 0xa14bd4beUL, 0x0b94bee1UL, +0x0a5425cdUL, 0x4662547eUL, 0x1182a2f3UL, 0xa33e17e6UL, +0x66e62635UL, 0x0275c358UL, 0x8b9b8338UL, 0xbdc27844UL, +0x48dc0203UL, 0xa08b4f92UL, 0xb37c2e39UL, 0x84e54e69UL, +0x8f71f088UL, 0x3927362dUL, 0xfd3f9cd2UL, 0x246e01fbUL, +0x16dd8937UL, 0x00000000UL, 0x57e0f68dUL, 0x986ce293UL, +0xf815744eUL, 0xd45a9320UL, 0x38e7ad01UL, 0x5db4d340UL, +0xc2871a17UL, 0x6a2db310UL, 0xd62f5078UL, 0x1f3cf48eUL, +0xa5a1a70eUL, 0x4c3671b3UL, 0x25ae9ad7UL, 0xdb245e71UL, +0x8750161dUL, 0xf9d5ef62UL, 0x86908d31UL, 0x1a161c12UL, +0x81cfa6f5UL, 0x6f075b8cUL, 0x1d4937d6UL, 0x3a926e59UL, +0x776484c6UL, 0x3fb886c5UL, 0xcdf9d746UL, 0xd0b0e090UL, +0x4f8329c7UL, 0x40fde496UL, 0x0d0b0e09UL, 0x56206da1UL, +0xea228ec9UL, 0x882edb4cUL, 0x738ef776UL, 0xb2bcb515UL, +0x5fc11018UL, 0xa96a322bUL, 0x8eb16ba4UL, 0x5455aef9UL, +0x89ee4060UL, 0xef086655UL, 0x2144e967UL, 0xecbd3e21UL, +0xbe772030UL, 0xc7adf28bUL, 0xe72980c0UL, 0xcf8c141eUL, +0x4348bce2UL, 0xfe8ac4a6UL, 0xc5d831d3UL, 0xfa60b716UL, +0xba9d5380UL, 0xc0f2d94fUL, 0x3e781de9UL, 0x2e3a2436UL, +0xf4dee16bUL, 0xd7efcb54UL, 0xf1f409f7UL, 0xaff582c3UL, +0xb9280bf4UL, 0xd9519d29UL, 0x9238c75eUL, 0x5aebf884UL, +0xb8e890d8UL, 0x3c0ddeb1UL, 0x8d0433d0UL, 0xe203685cUL, +0xdae4c55dUL, 0x589e3bdcUL, 0x9d460a0fUL, 0xc8d33fdaUL, +0x27db598fUL, 0x8cc4a8fcUL, 0x99ac79bfUL, 0x724e6c5aUL, +0xa2fe8ccaUL, 0xb5e39ed1UL, 0x76a41feaUL, 0x04ea73b0UL, +}, + +{ +0x68bc02e3UL, 0x85620c55UL, 0x3f23312aUL, 0xab13f761UL, +0xd46d7298UL, 0xcb9a1921UL, 0x22a4613cUL, 0x9d3dcd45UL, +0xfdb42305UL, 0xc4075f2bUL, 0x2c01c09bUL, 0xd9800f3dUL, +0x6c5c7448UL, 0x7f7e85f9UL, 0x73ab1ff1UL, 0xedde0eb6UL, +0x3c6bed28UL, 0x97781a49UL, 0x2a918d9fUL, 0x579f33c9UL, +0x07a8aaa9UL, 0x0ded7da5UL, 0x422d8f7cUL, 0x4db0c976UL, +0x91e8574dUL, 0xa963ccceUL, 0xee96d2b4UL, 0x28e1b630UL, +0xf161b90dUL, 0x196726bdUL, 0x9bad8041UL, 0xa06ec7c0UL, +0x83f24151UL, 0xdbf03492UL, 0xa21efc6fUL, 0x32ce4c8fUL, +0xe0337313UL, 0xa7c66d69UL, 0x6d6493e5UL, 0x1a2ffabfUL, +0x1cbfb7bbUL, 0x7403b558UL, 0x6e2c4fe7UL, 0x89b7965dUL, +0x9c052ae8UL, 0x6619a344UL, 0x2e71fb34UL, 0xf229650fUL, +0x81827afeUL, 0x1322f1b1UL, 0x0835eca3UL, 0x510f7ecdUL, +0x7aa614ffUL, 0x7293f85cUL, 0xc297122fUL, 0x70e3c3f3UL, +0x2f491c99UL, 0x431568d1UL, 0xa3261bc2UL, 0xcc32b388UL, +0xcf7a6f8aUL, 0xe8069fb0UL, 0x47f51e7aUL, 0xbb79dad2UL, +0x950821e6UL, 0x98e55c43UL, 0xb83106d0UL, 0xe37baf11UL, +0x4165537eUL, 0xaa2b10ccUL, 0xb4e49cd8UL, 0x56a7d464UL, +0x7c3659fbUL, 0x4b208472UL, 0x9f4df6eaUL, 0x5faadf6aUL, +0xc1dfce2dUL, 0x48685870UL, 0xaff381caUL, 0x05d89106UL, +0x774b695aUL, 0xde28a594UL, 0xdf104239UL, 0x3bc34781UL, +0x82caa6fcUL, 0xc8d2c523UL, 0xf86cb203UL, 0x0cd59a08UL, +0xb7ac40daUL, 0xb909e17dUL, 0x24342c38UL, 0x5247a2cfUL, +0xb274d1dcUL, 0xa85b2b63UL, 0xd5559535UL, 0x9e751147UL, +0xe5ebe215UL, 0x9430c64bUL, 0x6f14a84aUL, 0x239c8691UL, +0x6acc394cUL, 0x8aff4a5fUL, 0x06904d04UL, 0x99ddbbeeUL, +0x1152ca1eUL, 0xffc418aaUL, 0x646998ebUL, 0xfefcff07UL, +0x345e018bUL, 0x7d0ebe56UL, 0xe79bd9baUL, 0x63c13242UL, +0xb5dc7b75UL, 0x26441797UL, 0xaecb6667UL, 0x250ccb95UL, +0x9a9567ecUL, 0x862ad057UL, 0x50379960UL, 0xe4d305b8UL, +0xad83ba65UL, 0xefae3519UL, 0xf6c913a4UL, 0x5b4aa9c1UL, +0x3e1bd687UL, 0xf0595ea0UL, 0x148a5b18UL, 0x02703bafUL, +0x04e076abUL, 0x4950bfddUL, 0x4a1863dfUL, 0xa5b656c6UL, +0x3d530a85UL, 0x871237faUL, 0xb694a777UL, 0x65517f46UL, +0x61b109edUL, 0xece6e91bUL, 0x458525d5UL, 0x753b52f5UL, +0xba413d7fUL, 0xce428827UL, 0xeb4e43b2UL, 0xbde997d6UL, +0x7b9ef352UL, 0x537f4562UL, 0x3afba02cUL, 0xbcd1707bUL, +0x1ff76bb9UL, 0x1b171d12UL, 0x79eec8fdUL, 0x277cf03aUL, +0x0a45d70cUL, 0xdd607996UL, 0x33f6ab22UL, 0xfa1c89acUL, +0xacbb5dc8UL, 0x0b7d30a1UL, 0xbea14bd4UL, 0xe10b94beUL, +0xcd0a5425UL, 0x7e466254UL, 0xf31182a2UL, 0xe6a33e17UL, +0x3566e626UL, 0x580275c3UL, 0x388b9b83UL, 0x44bdc278UL, +0x0348dc02UL, 0x92a08b4fUL, 0x39b37c2eUL, 0x6984e54eUL, +0x888f71f0UL, 0x2d392736UL, 0xd2fd3f9cUL, 0xfb246e01UL, +0x3716dd89UL, 0x00000000UL, 0x8d57e0f6UL, 0x93986ce2UL, +0x4ef81574UL, 0x20d45a93UL, 0x0138e7adUL, 0x405db4d3UL, +0x17c2871aUL, 0x106a2db3UL, 0x78d62f50UL, 0x8e1f3cf4UL, +0x0ea5a1a7UL, 0xb34c3671UL, 0xd725ae9aUL, 0x71db245eUL, +0x1d875016UL, 0x62f9d5efUL, 0x3186908dUL, 0x121a161cUL, +0xf581cfa6UL, 0x8c6f075bUL, 0xd61d4937UL, 0x593a926eUL, +0xc6776484UL, 0xc53fb886UL, 0x46cdf9d7UL, 0x90d0b0e0UL, +0xc74f8329UL, 0x9640fde4UL, 0x090d0b0eUL, 0xa156206dUL, +0xc9ea228eUL, 0x4c882edbUL, 0x76738ef7UL, 0x15b2bcb5UL, +0x185fc110UL, 0x2ba96a32UL, 0xa48eb16bUL, 0xf95455aeUL, +0x6089ee40UL, 0x55ef0866UL, 0x672144e9UL, 0x21ecbd3eUL, +0x30be7720UL, 0x8bc7adf2UL, 0xc0e72980UL, 0x1ecf8c14UL, +0xe24348bcUL, 0xa6fe8ac4UL, 0xd3c5d831UL, 0x16fa60b7UL, +0x80ba9d53UL, 0x4fc0f2d9UL, 0xe93e781dUL, 0x362e3a24UL, +0x6bf4dee1UL, 0x54d7efcbUL, 0xf7f1f409UL, 0xc3aff582UL, +0xf4b9280bUL, 0x29d9519dUL, 0x5e9238c7UL, 0x845aebf8UL, +0xd8b8e890UL, 0xb13c0ddeUL, 0xd08d0433UL, 0x5ce20368UL, +0x5ddae4c5UL, 0xdc589e3bUL, 0x0f9d460aUL, 0xdac8d33fUL, +0x8f27db59UL, 0xfc8cc4a8UL, 0xbf99ac79UL, 0x5a724e6cUL, +0xcaa2fe8cUL, 0xd1b5e39eUL, 0xea76a41fUL, 0xb004ea73UL, +}}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/stdcpp.h b/external/crypto++-5.6.3/stdcpp.h new file mode 100644 index 000000000..b3edab700 --- /dev/null +++ b/external/crypto++-5.6.3/stdcpp.h @@ -0,0 +1,55 @@ +#ifndef CRYPTOPP_STDCPP_H +#define CRYPTOPP_STDCPP_H + +#if _MSC_VER >= 1500 +#define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if _MSC_VER >= 1600 +// for make_unchecked_array_iterator +#include +#endif + +#include +#include +#include +#include +#include + +#ifdef CRYPTOPP_INCLUDE_VECTOR_CC +// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 +#include +#endif + +// for alloca +#if defined(CRYPTOPP_BSD_AVAILABLE) +#include +#elif defined(CRYPTOPP_UNIX_AVAILABLE) || defined(__sun) || defined(QNX) +#include +#elif defined(CRYPTOPP_WIN32_AVAILABLE) || defined(__MINGW32__) || defined(__BORLANDC__) +#include +#endif + +#ifdef _MSC_VER +#pragma warning(disable: 4231) // re-disable this +#ifdef _CRTAPI1 +#define CRYPTOPP_MSVCRT6 +#endif +#endif + +#endif diff --git a/external/crypto++-5.6.3/strciphr.cpp b/external/crypto++-5.6.3/strciphr.cpp new file mode 100644 index 000000000..53e007376 --- /dev/null +++ b/external/crypto++-5.6.3/strciphr.cpp @@ -0,0 +1,252 @@ +// strciphr.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#ifndef CRYPTOPP_IMPORTS + +#include "strciphr.h" + +NAMESPACE_BEGIN(CryptoPP) + +template +void AdditiveCipherTemplate::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + PolicyInterface &policy = this->AccessPolicy(); + policy.CipherSetKey(params, key, length); + m_leftOver = 0; + unsigned int bufferByteSize = policy.CanOperateKeystream() ? GetBufferByteSize(policy) : RoundUpToMultipleOf(1024U, GetBufferByteSize(policy)); + m_buffer.New(bufferByteSize); + + if (this->IsResynchronizable()) + { + size_t ivLength; + const byte *iv = this->GetIVAndThrowIfInvalid(params, ivLength); + policy.CipherResynchronize(m_buffer, iv, ivLength); + } +} + +template +void AdditiveCipherTemplate::GenerateBlock(byte *outString, size_t length) +{ + if (m_leftOver > 0) + { + size_t len = STDMIN(m_leftOver, length); + memcpy(outString, KeystreamBufferEnd()-m_leftOver, len); + length -= len; + m_leftOver -= len; + outString += len; + + if (!length) + return; + } + assert(m_leftOver == 0); + + PolicyInterface &policy = this->AccessPolicy(); + unsigned int bytesPerIteration = policy.GetBytesPerIteration(); + + if (length >= bytesPerIteration) + { + size_t iterations = length / bytesPerIteration; + policy.WriteKeystream(outString, iterations); + outString += iterations * bytesPerIteration; + length -= iterations * bytesPerIteration; + } + + if (length > 0) + { + size_t bufferByteSize = RoundUpToMultipleOf(length, bytesPerIteration); + size_t bufferIterations = bufferByteSize / bytesPerIteration; + + policy.WriteKeystream(KeystreamBufferEnd()-bufferByteSize, bufferIterations); + memcpy(outString, KeystreamBufferEnd()-bufferByteSize, length); + m_leftOver = bufferByteSize - length; + } +} + +template +void AdditiveCipherTemplate::ProcessData(byte *outString, const byte *inString, size_t length) +{ + if (m_leftOver > 0) + { + size_t len = STDMIN(m_leftOver, length); + xorbuf(outString, inString, KeystreamBufferEnd()-m_leftOver, len); + length -= len; + m_leftOver -= len; + inString += len; + outString += len; + + if (!length) + return; + } + assert(m_leftOver == 0); + + PolicyInterface &policy = this->AccessPolicy(); + unsigned int bytesPerIteration = policy.GetBytesPerIteration(); + + if (policy.CanOperateKeystream() && length >= bytesPerIteration) + { + size_t iterations = length / bytesPerIteration; + unsigned int alignment = policy.GetAlignment(); + KeystreamOperation operation = KeystreamOperation((IsAlignedOn(inString, alignment) * 2) | (int)IsAlignedOn(outString, alignment)); + + policy.OperateKeystream(operation, outString, inString, iterations); + + inString += iterations * bytesPerIteration; + outString += iterations * bytesPerIteration; + length -= iterations * bytesPerIteration; + + if (!length) + return; + } + + size_t bufferByteSize = m_buffer.size(); + size_t bufferIterations = bufferByteSize / bytesPerIteration; + + while (length >= bufferByteSize) + { + policy.WriteKeystream(m_buffer, bufferIterations); + xorbuf(outString, inString, KeystreamBufferBegin(), bufferByteSize); + length -= bufferByteSize; + inString += bufferByteSize; + outString += bufferByteSize; + } + + if (length > 0) + { + bufferByteSize = RoundUpToMultipleOf(length, bytesPerIteration); + bufferIterations = bufferByteSize / bytesPerIteration; + + policy.WriteKeystream(KeystreamBufferEnd()-bufferByteSize, bufferIterations); + xorbuf(outString, inString, KeystreamBufferEnd()-bufferByteSize, length); + m_leftOver = bufferByteSize - length; + } +} + +template +void AdditiveCipherTemplate::Resynchronize(const byte *iv, int length) +{ + PolicyInterface &policy = this->AccessPolicy(); + m_leftOver = 0; + m_buffer.New(GetBufferByteSize(policy)); + policy.CipherResynchronize(m_buffer, iv, this->ThrowIfInvalidIVLength(length)); +} + +template +void AdditiveCipherTemplate::Seek(lword position) +{ + PolicyInterface &policy = this->AccessPolicy(); + unsigned int bytesPerIteration = policy.GetBytesPerIteration(); + + policy.SeekToIteration(position / bytesPerIteration); + position %= bytesPerIteration; + + if (position > 0) + { + policy.WriteKeystream(KeystreamBufferEnd()-bytesPerIteration, 1); + m_leftOver = bytesPerIteration - (unsigned int)position; + } + else + m_leftOver = 0; +} + +template +void CFB_CipherTemplate::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +{ + PolicyInterface &policy = this->AccessPolicy(); + policy.CipherSetKey(params, key, length); + + if (this->IsResynchronizable()) + { + size_t ivLength; + const byte *iv = this->GetIVAndThrowIfInvalid(params, ivLength); + policy.CipherResynchronize(iv, ivLength); + } + + m_leftOver = policy.GetBytesPerIteration(); +} + +template +void CFB_CipherTemplate::Resynchronize(const byte *iv, int length) +{ + PolicyInterface &policy = this->AccessPolicy(); + policy.CipherResynchronize(iv, this->ThrowIfInvalidIVLength(length)); + m_leftOver = policy.GetBytesPerIteration(); +} + +template +void CFB_CipherTemplate::ProcessData(byte *outString, const byte *inString, size_t length) +{ + assert(length % this->MandatoryBlockSize() == 0); + + PolicyInterface &policy = this->AccessPolicy(); + unsigned int bytesPerIteration = policy.GetBytesPerIteration(); + unsigned int alignment = policy.GetAlignment(); + byte *reg = policy.GetRegisterBegin(); + + if (m_leftOver) + { + size_t len = STDMIN(m_leftOver, length); + CombineMessageAndShiftRegister(outString, reg + bytesPerIteration - m_leftOver, inString, len); + m_leftOver -= len; + length -= len; + inString += len; + outString += len; + } + + if (!length) + return; + + assert(m_leftOver == 0); + + if (policy.CanIterate() && length >= bytesPerIteration && IsAlignedOn(outString, alignment)) + { + if (IsAlignedOn(inString, alignment)) + policy.Iterate(outString, inString, GetCipherDir(*this), length / bytesPerIteration); + else + { + memcpy(outString, inString, length); + policy.Iterate(outString, outString, GetCipherDir(*this), length / bytesPerIteration); + } + inString += length - length % bytesPerIteration; + outString += length - length % bytesPerIteration; + length %= bytesPerIteration; + } + + while (length >= bytesPerIteration) + { + policy.TransformRegister(); + CombineMessageAndShiftRegister(outString, reg, inString, bytesPerIteration); + length -= bytesPerIteration; + inString += bytesPerIteration; + outString += bytesPerIteration; + } + + if (length > 0) + { + policy.TransformRegister(); + CombineMessageAndShiftRegister(outString, reg, inString, length); + m_leftOver = bytesPerIteration - length; + } +} + +template +void CFB_EncryptionTemplate::CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length) +{ + xorbuf(reg, message, length); + memcpy(output, reg, length); +} + +template +void CFB_DecryptionTemplate::CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length) +{ + for (unsigned int i=0; i, AdditiveCipherTemplate\<\> \> \> Encryption; + + AdditiveCipherTemplate and CFB_CipherTemplate are designed so that they don't need + to take a policy class as a template parameter (although this is allowed), so that + their code is not duplicated for each new cipher. Instead they each + get a reference to an abstract policy interface by calling AccessPolicy() on itself, so + AccessPolicy() must be overriden to return the actual policy reference. This is done + by the ConceretePolicyHolder class. Finally, SymmetricCipherFinal implements the constructors and + other functions that must be implemented by the most derived class. +*/ + +#ifndef CRYPTOPP_STRCIPHR_H +#define CRYPTOPP_STRCIPHR_H + +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4127 4189) +#endif + +#include "cryptlib.h" +#include "seckey.h" +#include "secblock.h" +#include "argnames.h" + +NAMESPACE_BEGIN(CryptoPP) + +template +class CRYPTOPP_NO_VTABLE AbstractPolicyHolder : public BASE +{ +public: + typedef POLICY_INTERFACE PolicyInterface; + virtual ~AbstractPolicyHolder() {} + +protected: + virtual const POLICY_INTERFACE & GetPolicy() const =0; + virtual POLICY_INTERFACE & AccessPolicy() =0; +}; + +template +class ConcretePolicyHolder : public BASE, protected POLICY +{ +protected: + const POLICY_INTERFACE & GetPolicy() const {return *this;} + POLICY_INTERFACE & AccessPolicy() {return *this;} +}; + +enum KeystreamOperationFlags {OUTPUT_ALIGNED=1, INPUT_ALIGNED=2, INPUT_NULL = 4}; +enum KeystreamOperation { + WRITE_KEYSTREAM = INPUT_NULL, + WRITE_KEYSTREAM_ALIGNED = INPUT_NULL | OUTPUT_ALIGNED, + XOR_KEYSTREAM = 0, + XOR_KEYSTREAM_INPUT_ALIGNED = INPUT_ALIGNED, + XOR_KEYSTREAM_OUTPUT_ALIGNED= OUTPUT_ALIGNED, + XOR_KEYSTREAM_BOTH_ALIGNED = OUTPUT_ALIGNED | INPUT_ALIGNED}; + +struct CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AdditiveCipherAbstractPolicy +{ + virtual ~AdditiveCipherAbstractPolicy() {} + virtual unsigned int GetAlignment() const {return 1;} + virtual unsigned int GetBytesPerIteration() const =0; + virtual unsigned int GetOptimalBlockSize() const {return GetBytesPerIteration();} + virtual unsigned int GetIterationsToBuffer() const =0; + virtual void WriteKeystream(byte *keystream, size_t iterationCount) + {OperateKeystream(KeystreamOperation(INPUT_NULL | (KeystreamOperationFlags)IsAlignedOn(keystream, GetAlignment())), keystream, NULL, iterationCount);} + virtual bool CanOperateKeystream() const {return false;} + virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) + {CRYPTOPP_UNUSED(operation); CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(iterationCount); assert(false);} + virtual void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) =0; + virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) + {CRYPTOPP_UNUSED(keystreamBuffer); CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(length); throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");} + virtual bool CipherIsRandomAccess() const =0; + virtual void SeekToIteration(lword iterationCount) + {CRYPTOPP_UNUSED(iterationCount); assert(!CipherIsRandomAccess()); throw NotImplemented("StreamTransformation: this object doesn't support random access");} +}; + +template +struct CRYPTOPP_NO_VTABLE AdditiveCipherConcretePolicy : public BASE +{ + typedef WT WordType; + CRYPTOPP_CONSTANT(BYTES_PER_ITERATION = sizeof(WordType) * W) + +#if !(CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64) + unsigned int GetAlignment() const {return GetAlignmentOf();} +#endif + unsigned int GetBytesPerIteration() const {return BYTES_PER_ITERATION;} + unsigned int GetIterationsToBuffer() const {return X;} + bool CanOperateKeystream() const {return true;} + virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) =0; +}; + +// use these to implement OperateKeystream +#define CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, b, i, a) \ + PutWord(bool(x & OUTPUT_ALIGNED), b, output+i*sizeof(WordType), (x & INPUT_NULL) ? (a) : (a) ^ GetWord(bool(x & INPUT_ALIGNED), b, input+i*sizeof(WordType))); +#define CRYPTOPP_KEYSTREAM_OUTPUT_XMM(x, i, a) {\ + __m128i t = (x & INPUT_NULL) ? a : _mm_xor_si128(a, (x & INPUT_ALIGNED) ? _mm_load_si128((__m128i *)input+i) : _mm_loadu_si128((__m128i *)input+i));\ + if (x & OUTPUT_ALIGNED) _mm_store_si128((__m128i *)output+i, t);\ + else _mm_storeu_si128((__m128i *)output+i, t);} +#define CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(x, y) \ + switch (operation) \ + { \ + case WRITE_KEYSTREAM: \ + x(WRITE_KEYSTREAM) \ + break; \ + case XOR_KEYSTREAM: \ + x(XOR_KEYSTREAM) \ + input += y; \ + break; \ + case XOR_KEYSTREAM_INPUT_ALIGNED: \ + x(XOR_KEYSTREAM_INPUT_ALIGNED) \ + input += y; \ + break; \ + case XOR_KEYSTREAM_OUTPUT_ALIGNED: \ + x(XOR_KEYSTREAM_OUTPUT_ALIGNED) \ + input += y; \ + break; \ + case WRITE_KEYSTREAM_ALIGNED: \ + x(WRITE_KEYSTREAM_ALIGNED) \ + break; \ + case XOR_KEYSTREAM_BOTH_ALIGNED: \ + x(XOR_KEYSTREAM_BOTH_ALIGNED) \ + input += y; \ + break; \ + } \ + output += y; + +template > +class CRYPTOPP_NO_VTABLE AdditiveCipherTemplate : public BASE, public RandomNumberGenerator +{ +public: + void GenerateBlock(byte *output, size_t size); + void ProcessData(byte *outString, const byte *inString, size_t length); + void Resynchronize(const byte *iv, int length=-1); + unsigned int OptimalBlockSize() const {return this->GetPolicy().GetOptimalBlockSize();} + unsigned int GetOptimalNextBlockSize() const {return (unsigned int)this->m_leftOver;} + unsigned int OptimalDataAlignment() const {return this->GetPolicy().GetAlignment();} + bool IsSelfInverting() const {return true;} + bool IsForwardTransformation() const {return true;} + bool IsRandomAccess() const {return this->GetPolicy().CipherIsRandomAccess();} + void Seek(lword position); + + typedef typename BASE::PolicyInterface PolicyInterface; + +protected: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + + unsigned int GetBufferByteSize(const PolicyInterface &policy) const {return policy.GetBytesPerIteration() * policy.GetIterationsToBuffer();} + + inline byte * KeystreamBufferBegin() {return this->m_buffer.data();} + inline byte * KeystreamBufferEnd() {return (this->m_buffer.data() + this->m_buffer.size());} + + SecByteBlock m_buffer; + size_t m_leftOver; +}; + +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_CipherAbstractPolicy +{ +public: + virtual ~CFB_CipherAbstractPolicy() {} + virtual unsigned int GetAlignment() const =0; + virtual unsigned int GetBytesPerIteration() const =0; + virtual byte * GetRegisterBegin() =0; + virtual void TransformRegister() =0; + virtual bool CanIterate() const {return false;} + virtual void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount) + {CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(dir); CRYPTOPP_UNUSED(iterationCount); + assert(false); /*throw 0;*/ throw Exception(Exception::OTHER_ERROR, "SimpleKeyingInterface: unexpected error");} + virtual void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) =0; + virtual void CipherResynchronize(const byte *iv, size_t length) + {CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(length); throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");} +}; + +template +struct CRYPTOPP_NO_VTABLE CFB_CipherConcretePolicy : public BASE +{ + typedef WT WordType; + + unsigned int GetAlignment() const {return sizeof(WordType);} + unsigned int GetBytesPerIteration() const {return sizeof(WordType) * W;} + bool CanIterate() const {return true;} + void TransformRegister() {this->Iterate(NULL, NULL, ENCRYPTION, 1);} + + template + struct RegisterOutput + { + RegisterOutput(byte *output, const byte *input, CipherDir dir) + : m_output(output), m_input(input), m_dir(dir) {} + + inline RegisterOutput& operator()(WordType ®isterWord) + { + assert(IsAligned(m_output)); + assert(IsAligned(m_input)); + + if (!NativeByteOrderIs(B::ToEnum())) + registerWord = ByteReverse(registerWord); + + if (m_dir == ENCRYPTION) + { + if (m_input == NULL) + assert(m_output == NULL); + else + { + WordType ct = *(const WordType *)m_input ^ registerWord; + registerWord = ct; + *(WordType*)m_output = ct; + m_input += sizeof(WordType); + m_output += sizeof(WordType); + } + } + else + { + WordType ct = *(const WordType *)m_input; + *(WordType*)m_output = registerWord ^ ct; + registerWord = ct; + m_input += sizeof(WordType); + m_output += sizeof(WordType); + } + + // registerWord is left unreversed so it can be xor-ed with further input + + return *this; + } + + byte *m_output; + const byte *m_input; + CipherDir m_dir; + }; +}; + +template +class CRYPTOPP_NO_VTABLE CFB_CipherTemplate : public BASE +{ +public: + void ProcessData(byte *outString, const byte *inString, size_t length); + void Resynchronize(const byte *iv, int length=-1); + unsigned int OptimalBlockSize() const {return this->GetPolicy().GetBytesPerIteration();} + unsigned int GetOptimalNextBlockSize() const {return (unsigned int)m_leftOver;} + unsigned int OptimalDataAlignment() const {return this->GetPolicy().GetAlignment();} + bool IsRandomAccess() const {return false;} + bool IsSelfInverting() const {return false;} + + typedef typename BASE::PolicyInterface PolicyInterface; + +protected: + virtual void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length) =0; + + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + + size_t m_leftOver; +}; + +template > +class CRYPTOPP_NO_VTABLE CFB_EncryptionTemplate : public CFB_CipherTemplate +{ + bool IsForwardTransformation() const {return true;} + void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length); +}; + +template > +class CRYPTOPP_NO_VTABLE CFB_DecryptionTemplate : public CFB_CipherTemplate +{ + bool IsForwardTransformation() const {return false;} + void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length); +}; + +template +class CFB_RequireFullDataBlocks : public BASE +{ +public: + unsigned int MandatoryBlockSize() const {return this->OptimalBlockSize();} +}; + +//! _ +template +class SymmetricCipherFinal : public AlgorithmImpl, INFO> +{ +public: + SymmetricCipherFinal() {} + SymmetricCipherFinal(const byte *key) + {this->SetKey(key, this->DEFAULT_KEYLENGTH);} + SymmetricCipherFinal(const byte *key, size_t length) + {this->SetKey(key, length);} + SymmetricCipherFinal(const byte *key, size_t length, const byte *iv) + {this->SetKeyWithIV(key, length, iv);} + + Clonable * Clone() const {return static_cast(new SymmetricCipherFinal(*this));} +}; + +NAMESPACE_END + +#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES +#include "strciphr.cpp" +#endif + +NAMESPACE_BEGIN(CryptoPP) +CRYPTOPP_DLL_TEMPLATE_CLASS AbstractPolicyHolder; +CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate >; +CRYPTOPP_DLL_TEMPLATE_CLASS CFB_CipherTemplate >; +CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate >; +CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate >; + +NAMESPACE_END + +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + +#endif diff --git a/external/crypto++-5.6.3/tea.cpp b/external/crypto++-5.6.3/tea.cpp new file mode 100644 index 000000000..80f2052ab --- /dev/null +++ b/external/crypto++-5.6.3/tea.cpp @@ -0,0 +1,161 @@ +// tea.cpp - modified by Wei Dai from code in the original paper + +#include "pch.h" +#include "tea.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const word32 DELTA = 0x9e3779b9; +typedef BlockGetAndPut Block; + +void TEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(length); + + GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, userKey, KEYLENGTH); + m_limit = GetRoundsAndThrowIfInvalid(params, this) * DELTA; +} + +void TEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 y, z; + Block::Get(inBlock)(y)(z); + + word32 sum = 0; + while (sum != m_limit) + { + sum += DELTA; + y += ((z << 4) + m_k[0]) ^ (z + sum) ^ ((z >> 5) + m_k[1]); + z += ((y << 4) + m_k[2]) ^ (y + sum) ^ ((y >> 5) + m_k[3]); + } + + Block::Put(xorBlock, outBlock)(y)(z); +} + +void TEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 y, z; + Block::Get(inBlock)(y)(z); + + word32 sum = m_limit; + while (sum != 0) + { + z -= ((y << 4) + m_k[2]) ^ (y + sum) ^ ((y >> 5) + m_k[3]); + y -= ((z << 4) + m_k[0]) ^ (z + sum) ^ ((z >> 5) + m_k[1]); + sum -= DELTA; + } + + Block::Put(xorBlock, outBlock)(y)(z); +} + +void XTEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(length); + + GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, userKey, KEYLENGTH); + m_limit = GetRoundsAndThrowIfInvalid(params, this) * DELTA; +} + +void XTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 y, z; + Block::Get(inBlock)(y)(z); + +#ifdef __SUNPRO_CC + // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 + size_t sum = 0; + while ((sum&0xffffffff) != m_limit) +#else + word32 sum = 0; + while (sum != m_limit) +#endif + { + y += ((z<<4 ^ z>>5) + z) ^ (sum + m_k[sum&3]); + sum += DELTA; + z += ((y<<4 ^ y>>5) + y) ^ (sum + m_k[sum>>11 & 3]); + } + + Block::Put(xorBlock, outBlock)(y)(z); +} + +void XTEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 y, z; + Block::Get(inBlock)(y)(z); + +#ifdef __SUNPRO_CC + // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 + size_t sum = m_limit; + while ((sum&0xffffffff) != 0) +#else + word32 sum = m_limit; + while (sum != 0) +#endif + { + z -= ((y<<4 ^ y>>5) + y) ^ (sum + m_k[sum>>11 & 3]); + sum -= DELTA; + y -= ((z<<4 ^ z>>5) + z) ^ (sum + m_k[sum&3]); + } + + Block::Put(xorBlock, outBlock)(y)(z); +} + +#define MX ((z>>5^y<<2)+(y>>3^z<<4))^((sum^y)+(m_k[(p&3)^e]^z)) + +void BTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + CRYPTOPP_UNUSED(xorBlock); + unsigned int n = m_blockSize / 4; + word32 *v = (word32*)outBlock; + ConditionalByteReverse(BIG_ENDIAN_ORDER, v, (const word32*)inBlock, m_blockSize); + + word32 y = v[0], z = v[n-1], e; + word32 p, q = 6+52/n; + word32 sum = 0; + + while (q-- > 0) + { + sum += DELTA; + e = sum>>2 & 3; + for (p = 0; p < n-1; p++) + { + y = v[p+1]; + z = v[p] += MX; + } + y = v[0]; + z = v[n-1] += MX; + } + + ConditionalByteReverse(BIG_ENDIAN_ORDER, v, v, m_blockSize); +} + +void BTEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + CRYPTOPP_UNUSED(xorBlock); + unsigned int n = m_blockSize / 4; + word32 *v = (word32*)outBlock; + ConditionalByteReverse(BIG_ENDIAN_ORDER, v, (const word32*)inBlock, m_blockSize); + + word32 y = v[0], z = v[n-1], e; + word32 p, q = 6+52/n; + word32 sum = q * DELTA; + + while (sum != 0) + { + e = sum>>2 & 3; + for (p = n-1; p > 0; p--) + { + z = v[p-1]; + y = v[p] -= MX; + } + + z = v[n-1]; + y = v[0] -= MX; + sum -= DELTA; + } + + ConditionalByteReverse(BIG_ENDIAN_ORDER, v, v, m_blockSize); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/tea.h b/external/crypto++-5.6.3/tea.h new file mode 100644 index 000000000..3b0907551 --- /dev/null +++ b/external/crypto++-5.6.3/tea.h @@ -0,0 +1,136 @@ +// tea.h - written and placed in the public domain by Wei Dai + +//! \file tea.h +//! \brief Classes for the TEA, BTEA and XTEA block ciphers + +#ifndef CRYPTOPP_TEA_H +#define CRYPTOPP_TEA_H + +#include "seckey.h" +#include "secblock.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct TEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32> +{ + static const char *StaticAlgorithmName() {return "TEA";} +}; + +/// TEA +class TEA : public TEA_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + FixedSizeSecBlock m_k; + word32 m_limit; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef TEA::Encryption TEAEncryption; +typedef TEA::Decryption TEADecryption; + +//! _ +struct XTEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32> +{ + static const char *StaticAlgorithmName() {return "XTEA";} +}; + +/// XTEA +class XTEA : public XTEA_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + FixedSizeSecBlock m_k; + word32 m_limit; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +//! _ +struct BTEA_Info : public FixedKeyLength<16> +{ + static const char *StaticAlgorithmName() {return "BTEA";} +}; + +//! corrected Block TEA (as described in "xxtea"). +/*! This class hasn't been tested yet. */ +class BTEA : public BTEA_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public AlgorithmImpl, BTEA_Info>, public BTEA_Info + { + public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) + { + CRYPTOPP_UNUSED(length), CRYPTOPP_UNUSED(params); + m_blockSize = params.GetIntValueWithDefault("BlockSize", 60*4); + GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, key, KEYLENGTH); + } + + unsigned int BlockSize() const {return m_blockSize;} + + protected: + FixedSizeSecBlock m_k; + unsigned int m_blockSize; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/test.cpp b/external/crypto++-5.6.3/test.cpp new file mode 100644 index 000000000..3d691d038 --- /dev/null +++ b/external/crypto++-5.6.3/test.cpp @@ -0,0 +1,963 @@ +// test.cpp - written and placed in the public domain by Wei Dai + +#define CRYPTOPP_DEFAULT_NO_DLL +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 + +#include "dll.h" +#include "aes.h" +#include "cryptlib.h" +#include "filters.h" +#include "md5.h" +#include "ripemd.h" +#include "rng.h" +#include "gzip.h" +#include "default.h" +#include "randpool.h" +#include "ida.h" +#include "base64.h" +#include "socketft.h" +#include "wait.h" +#include "factory.h" +#include "whrlpool.h" +#include "tiger.h" +#include "smartptr.h" + +#include "validate.h" +#include "bench.h" + +#include +#include +#include +#include +#include +#include + +#ifdef CRYPTOPP_WIN32_AVAILABLE +#include +#endif + +#if defined(USE_BERKELEY_STYLE_SOCKETS) && !defined(macintosh) +#include +#include +#endif + +#if (_MSC_VER >= 1000) +#include // for the debug heap +#endif + +#if defined(__MWERKS__) && defined(macintosh) +#include +#endif + +#ifdef _OPENMP +# include +#endif + +#ifdef __BORLANDC__ +#pragma comment(lib, "cryptlib_bds.lib") +#pragma comment(lib, "ws2_32.lib") +#endif + +// Aggressive stack checking with VS2005 SP1 and above. +#if (CRYPTOPP_MSC_VERSION >= 1410) +# pragma strict_gs_check (on) +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +const int MAX_PHRASE_LENGTH=250; + +void RegisterFactories(); +void PrintSeedAndThreads(const std::string& seed); + +void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed); +string RSAEncryptString(const char *pubFilename, const char *seed, const char *message); +string RSADecryptString(const char *privFilename, const char *ciphertext); +void RSASignFile(const char *privFilename, const char *messageFilename, const char *signatureFilename); +bool RSAVerifyFile(const char *pubFilename, const char *messageFilename, const char *signatureFilename); + +void DigestFile(const char *file); +void HmacFile(const char *hexKey, const char *file); + +void AES_CTR_Encrypt(const char *hexKey, const char *hexIV, const char *infile, const char *outfile); + +string EncryptString(const char *plaintext, const char *passPhrase); +string DecryptString(const char *ciphertext, const char *passPhrase); + +void EncryptFile(const char *in, const char *out, const char *passPhrase); +void DecryptFile(const char *in, const char *out, const char *passPhrase); + +void SecretShareFile(int threshold, int nShares, const char *filename, const char *seed); +void SecretRecoverFile(int threshold, const char *outFilename, char *const *inFilenames); + +void InformationDisperseFile(int threshold, int nShares, const char *filename); +void InformationRecoverFile(int threshold, const char *outFilename, char *const *inFilenames); + +void GzipFile(const char *in, const char *out, int deflate_level); +void GunzipFile(const char *in, const char *out); + +void Base64Encode(const char *infile, const char *outfile); +void Base64Decode(const char *infile, const char *outfile); +void HexEncode(const char *infile, const char *outfile); +void HexDecode(const char *infile, const char *outfile); + +void ForwardTcpPort(const char *sourcePort, const char *destinationHost, const char *destinationPort); + +void FIPS140_SampleApplication(); +void FIPS140_GenerateRandomFiles(); + +bool Validate(int, bool, const char *); +void PrintSeedAndThreads(const std::string& seed); + +int (*AdhocTest)(int argc, char *argv[]) = NULL; + +RandomNumberGenerator & GlobalRNG() +{ + static OFB_Mode::Encryption s_globalRNG; + return dynamic_cast(s_globalRNG); +} + +int CRYPTOPP_API main(int argc, char *argv[]) +{ +#ifdef _CRTDBG_LEAK_CHECK_DF + // Turn on leak-checking + int tempflag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); + tempflag |= _CRTDBG_LEAK_CHECK_DF; + _CrtSetDbgFlag( tempflag ); +#endif + +#if defined(__MWERKS__) && defined(macintosh) + argc = ccommand(&argv); +#endif + + try + { + RegisterFactories(); + + // Some editors have problems with the '\0' character when redirecting output. + std::string seed = IntToString(time(NULL)); + seed.resize(16, ' '); + + OFB_Mode::Encryption& prng = dynamic_cast::Encryption&>(GlobalRNG()); + prng.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data()); + + std::string command, executableName, macFilename; + + if (argc < 2) + command = 'h'; + else + command = argv[1]; + + if (command == "g") + { + char thisSeed[1024], privFilename[128], pubFilename[128]; + unsigned int keyLength; + + cout << "Key length in bits: "; + cin >> keyLength; + + cout << "\nSave private key to file: "; + cin >> privFilename; + + cout << "\nSave public key to file: "; + cin >> pubFilename; + + cout << "\nRandom Seed: "; + ws(cin); + cin.getline(thisSeed, 1024); + + GenerateRSAKey(keyLength, privFilename, pubFilename, thisSeed); + } + else if (command == "rs") + RSASignFile(argv[2], argv[3], argv[4]); + else if (command == "rv") + { + bool verified = RSAVerifyFile(argv[2], argv[3], argv[4]); + cout << (verified ? "valid signature" : "invalid signature") << endl; + } + else if (command == "r") + { + char privFilename[128], pubFilename[128]; + char thisSeed[1024], message[1024]; + + cout << "Private key file: "; + cin >> privFilename; + + cout << "\nPublic key file: "; + cin >> pubFilename; + + cout << "\nRandom Seed: "; + ws(cin); + cin.getline(thisSeed, 1024); + + cout << "\nMessage: "; + cin.getline(message, 1024); + + string ciphertext = RSAEncryptString(pubFilename, thisSeed, message); + cout << "\nCiphertext: " << ciphertext << endl; + + string decrypted = RSADecryptString(privFilename, ciphertext.c_str()); + cout << "\nDecrypted: " << decrypted << endl; + } + else if (command == "mt") + { + MaurerRandomnessTest mt; + FileStore fs(argv[2]); + fs.TransferAllTo(mt); + cout << "Maurer Test Value: " << mt.GetTestValue() << endl; + } + else if (command == "mac_dll") + { + std::string fname(argv[2] ? argv[2] : ""); + + // sanity check on file size + std::fstream dllFile(fname.c_str(), ios::in | ios::out | ios::binary); + if (!dllFile.good()) + { + cerr << "Failed to open file \"" << fname << "\"\n"; + return 1; + } + + std::ifstream::pos_type fileEnd = dllFile.seekg(0, std::ios_base::end).tellg(); + if (fileEnd > 20*1000*1000) + { + cerr << "Input file " << fname << " is too large"; + cerr << "(size is " << fileEnd << ").\n"; + return 1; + } + + // read file into memory + unsigned int fileSize = (unsigned int)fileEnd; + SecByteBlock buf(fileSize); + dllFile.seekg(0, std::ios_base::beg); + dllFile.read((char *)buf.begin(), fileSize); + + // find positions of relevant sections in the file, based on version 8 of documentation from http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx + word32 coffPos = *(word16 *)(buf+0x3c); + word32 optionalHeaderPos = coffPos + 24; + word16 optionalHeaderMagic = *(word16 *)(buf+optionalHeaderPos); + if (optionalHeaderMagic != 0x10b && optionalHeaderMagic != 0x20b) + { + cerr << "Target file is not a PE32 or PE32+ image.\n"; + return 3; + } + word32 checksumPos = optionalHeaderPos + 64; + word32 certificateTableDirectoryPos = optionalHeaderPos + (optionalHeaderMagic == 0x10b ? 128 : 144); + word32 certificateTablePos = *(word32 *)(buf+certificateTableDirectoryPos); + word32 certificateTableSize = *(word32 *)(buf+certificateTableDirectoryPos+4); + if (certificateTableSize != 0) + cerr << "Warning: certificate table (IMAGE_DIRECTORY_ENTRY_SECURITY) of target image is not empty.\n"; + + // find where to place computed MAC + byte mac[] = CRYPTOPP_DUMMY_DLL_MAC; + byte *found = std::search(buf.begin(), buf.end(), mac+0, mac+sizeof(mac)); + if (found == buf.end()) + { + cerr << "MAC placeholder not found. The MAC may already be placed.\n"; + return 2; + } + word32 macPos = (unsigned int)(found-buf.begin()); + + // compute MAC + member_ptr pMac(NewIntegrityCheckingMAC()); + assert(pMac->DigestSize() == sizeof(mac)); + MeterFilter f(new HashFilter(*pMac, new ArraySink(mac, sizeof(mac)))); + f.AddRangeToSkip(0, checksumPos, 4); + f.AddRangeToSkip(0, certificateTableDirectoryPos, 8); + f.AddRangeToSkip(0, macPos, sizeof(mac)); + f.AddRangeToSkip(0, certificateTablePos, certificateTableSize); + f.PutMessageEnd(buf.begin(), buf.size()); + + // place MAC + cout << "Placing MAC in file " << fname << ", location " << macPos; + cout << " (0x" << std::hex << macPos << std::dec << ").\n"; + dllFile.seekg(macPos, std::ios_base::beg); + dllFile.write((char *)mac, sizeof(mac)); + } + else if (command == "m") + DigestFile(argv[2]); + else if (command == "tv") + { + std::string fname = (argv[2] ? argv[2] : "all"); + if (fname.find(".txt") == std::string::npos) + fname = "TestVectors/" + fname + ".txt"; + + PrintSeedAndThreads(seed); + return !RunTestDataFile(fname.c_str()); + } + else if (command == "t") + { + // VC60 workaround: use char array instead of std::string to workaround MSVC's getline bug + char passPhrase[MAX_PHRASE_LENGTH], plaintext[1024]; + + cout << "Passphrase: "; + cin.getline(passPhrase, MAX_PHRASE_LENGTH); + + cout << "\nPlaintext: "; + cin.getline(plaintext, 1024); + + string ciphertext = EncryptString(plaintext, passPhrase); + cout << "\nCiphertext: " << ciphertext << endl; + + string decrypted = DecryptString(ciphertext.c_str(), passPhrase); + cout << "\nDecrypted: " << decrypted << endl; + + return 0; + } + else if (command == "e64") + Base64Encode(argv[2], argv[3]); + else if (command == "d64") + Base64Decode(argv[2], argv[3]); + else if (command == "e16") + HexEncode(argv[2], argv[3]); + else if (command == "d16") + HexDecode(argv[2], argv[3]); + else if (command == "e" || command == "d") + { + char passPhrase[MAX_PHRASE_LENGTH]; + cout << "Passphrase: "; + cin.getline(passPhrase, MAX_PHRASE_LENGTH); + if (command == "e") + EncryptFile(argv[2], argv[3], passPhrase); + else + DecryptFile(argv[2], argv[3], passPhrase); + } + else if (command == "ss") + { + char thisSeed[1024]; + cout << "\nRandom Seed: "; + ws(cin); + cin.getline(thisSeed, 1024); + SecretShareFile(StringToValue(argv[2]), StringToValue(argv[3]), argv[4], thisSeed); + } + else if (command == "sr") + SecretRecoverFile(argc-3, argv[2], argv+3); + else if (command == "id") + InformationDisperseFile(StringToValue(argv[2]), StringToValue(argv[3]), argv[4]); + else if (command == "ir") + InformationRecoverFile(argc-3, argv[2], argv+3); + else if (command == "v" || command == "vv") + return !Validate(argc>2 ? StringToValue(argv[2]) : 0, argv[1][1] == 'v', argc>3 ? argv[3] : NULL); + else if (command == "b") + BenchmarkAll(argc<3 ? 1 : StringToValue(argv[2]), argc<4 ? 0 : StringToValue(argv[3])*1e9); + else if (command == "b2") + BenchmarkAll2(argc<3 ? 1 : StringToValue(argv[2]), argc<4 ? 0 : StringToValue(argv[3])*1e9); + else if (command == "z") + GzipFile(argv[3], argv[4], argv[2][0]-'0'); + else if (command == "u") + GunzipFile(argv[2], argv[3]); + else if (command == "fips") + FIPS140_SampleApplication(); + else if (command == "fips-rand") + FIPS140_GenerateRandomFiles(); + else if (command == "ft") + ForwardTcpPort(argv[2], argv[3], argv[4]); + else if (command == "a") + { + if (AdhocTest) + return (*AdhocTest)(argc, argv); + else + { + cerr << "AdhocTest not defined.\n"; + return 1; + } + } + else if (command == "hmac") + HmacFile(argv[2], argv[3]); + else if (command == "ae") + AES_CTR_Encrypt(argv[2], argv[3], argv[4], argv[5]); + else if (command == "h") + { + FileSource usage("TestData/usage.dat", true, new FileSink(cout)); + return 1; + } + else if (command == "V") + { + cout << CRYPTOPP_VERSION / 100 << '.' << (CRYPTOPP_VERSION % 100) / 10 << '.' << CRYPTOPP_VERSION % 10 << endl; + } + else + { + cerr << "Unrecognized command. Run \"cryptest h\" to obtain usage information.\n"; + return 1; + } + return 0; + } + catch(const CryptoPP::Exception &e) + { + cout << "\nCryptoPP::Exception caught: " << e.what() << endl; + return -1; + } + catch(const std::exception &e) + { + cout << "\nstd::exception caught: " << e.what() << endl; + return -2; + } +} // End main() + +void FIPS140_GenerateRandomFiles() +{ +#ifdef OS_RNG_AVAILABLE + DefaultAutoSeededRNG rng; + RandomNumberStore store(rng, ULONG_MAX); + + for (unsigned int i=0; i<100000; i++) + store.TransferTo(FileSink((IntToString(i) + ".rnd").c_str()).Ref(), 20000); +#else + cout << "OS provided RNG not available.\n"; + exit(-1); +#endif +} + +template +T StringToValue(const std::string& str) { + std::istringstream iss(str); + T value; + iss >> value; + + // Use fail(), not bad() + if (iss.fail()) + throw InvalidArgument("cryptest.exe: '" + str +"' is not a value"); + +#if NON_NEGATIVE + if (value < 0) + throw InvalidArgument("cryptest.exe: '" + str +"' is negative"); +#endif + + return value; +} + +template<> +int StringToValue(const std::string& str) +{ + Integer n(str.c_str()); + long l = n.ConvertToLong(); + + int r; + if(!SafeConvert(l, r)) + throw InvalidArgument("cryptest.exe: '" + str +"' is not an integer value"); + + return r; +} + +void PrintSeedAndThreads(const std::string& seed) +{ + cout << "Using seed: " << seed << endl; + +#ifdef _OPENMP + int tc = 0; + #pragma omp parallel + { + tc = omp_get_num_threads(); + } + + std::cout << "Using " << tc << " OMP " << (tc == 1 ? "thread" : "threads") << std::endl; +#endif +} + +SecByteBlock HexDecodeString(const char *hex) +{ + StringSource ss(hex, true, new HexDecoder); + SecByteBlock result((size_t)ss.MaxRetrievable()); + ss.Get(result, result.size()); + return result; +} + +void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed) +{ + RandomPool randPool; + randPool.IncorporateEntropy((byte *)seed, strlen(seed)); + + RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength); + HexEncoder privFile(new FileSink(privFilename)); + priv.DEREncode(privFile); + privFile.MessageEnd(); + + RSAES_OAEP_SHA_Encryptor pub(priv); + HexEncoder pubFile(new FileSink(pubFilename)); + pub.DEREncode(pubFile); + pubFile.MessageEnd(); +} + +string RSAEncryptString(const char *pubFilename, const char *seed, const char *message) +{ + FileSource pubFile(pubFilename, true, new HexDecoder); + RSAES_OAEP_SHA_Encryptor pub(pubFile); + + RandomPool randPool; + randPool.IncorporateEntropy((byte *)seed, strlen(seed)); + + string result; + StringSource(message, true, new PK_EncryptorFilter(randPool, pub, new HexEncoder(new StringSink(result)))); + return result; +} + +string RSADecryptString(const char *privFilename, const char *ciphertext) +{ + FileSource privFile(privFilename, true, new HexDecoder); + RSAES_OAEP_SHA_Decryptor priv(privFile); + + string result; + StringSource(ciphertext, true, new HexDecoder(new PK_DecryptorFilter(GlobalRNG(), priv, new StringSink(result)))); + return result; +} + +void RSASignFile(const char *privFilename, const char *messageFilename, const char *signatureFilename) +{ + FileSource privFile(privFilename, true, new HexDecoder); + RSASS::Signer priv(privFile); + FileSource f(messageFilename, true, new SignerFilter(GlobalRNG(), priv, new HexEncoder(new FileSink(signatureFilename)))); +} + +bool RSAVerifyFile(const char *pubFilename, const char *messageFilename, const char *signatureFilename) +{ + FileSource pubFile(pubFilename, true, new HexDecoder); + RSASS::Verifier pub(pubFile); + + FileSource signatureFile(signatureFilename, true, new HexDecoder); + if (signatureFile.MaxRetrievable() != pub.SignatureLength()) + return false; + SecByteBlock signature(pub.SignatureLength()); + signatureFile.Get(signature, signature.size()); + + VerifierFilter *verifierFilter = new VerifierFilter(pub); + verifierFilter->Put(signature, pub.SignatureLength()); + FileSource f(messageFilename, true, verifierFilter); + + return verifierFilter->GetLastResult(); +} + +void DigestFile(const char *filename) +{ + SHA1 sha; + RIPEMD160 ripemd; + SHA256 sha256; + Tiger tiger; + SHA512 sha512; + Whirlpool whirlpool; + vector_member_ptrs filters(6); + filters[0].reset(new HashFilter(sha)); + filters[1].reset(new HashFilter(ripemd)); + filters[2].reset(new HashFilter(tiger)); + filters[3].reset(new HashFilter(sha256)); + filters[4].reset(new HashFilter(sha512)); + filters[5].reset(new HashFilter(whirlpool)); + + member_ptr channelSwitch(new ChannelSwitch); + size_t i; + for (i=0; iAddDefaultRoute(*filters[i]); + FileSource(filename, true, channelSwitch.release()); + + HexEncoder encoder(new FileSink(cout), false); + for (i=0; iAlgorithmName() << ": "; + filters[i]->TransferTo(encoder); + cout << "\n"; + } +} + +void HmacFile(const char *hexKey, const char *file) +{ + member_ptr mac; + if (strcmp(hexKey, "selftest") == 0) + { + cerr << "Computing HMAC/SHA1 value for self test.\n"; + mac.reset(NewIntegrityCheckingMAC()); + } + else + { + std::string decodedKey; + StringSource(hexKey, true, new HexDecoder(new StringSink(decodedKey))); + mac.reset(new HMAC((const byte *)decodedKey.data(), decodedKey.size())); + } + FileSource(file, true, new HashFilter(*mac, new HexEncoder(new FileSink(cout)))); +} + +void AES_CTR_Encrypt(const char *hexKey, const char *hexIV, const char *infile, const char *outfile) +{ + SecByteBlock key = HexDecodeString(hexKey); + SecByteBlock iv = HexDecodeString(hexIV); + CTR_Mode::Encryption aes(key, key.size(), iv); + FileSource(infile, true, new StreamTransformationFilter(aes, new FileSink(outfile))); +} + +string EncryptString(const char *instr, const char *passPhrase) +{ + string outstr; + + DefaultEncryptorWithMAC encryptor(passPhrase, new HexEncoder(new StringSink(outstr))); + encryptor.Put((byte *)instr, strlen(instr)); + encryptor.MessageEnd(); + + return outstr; +} + +string DecryptString(const char *instr, const char *passPhrase) +{ + string outstr; + + HexDecoder decryptor(new DefaultDecryptorWithMAC(passPhrase, new StringSink(outstr))); + decryptor.Put((byte *)instr, strlen(instr)); + decryptor.MessageEnd(); + + return outstr; +} + +void EncryptFile(const char *in, const char *out, const char *passPhrase) +{ + FileSource f(in, true, new DefaultEncryptorWithMAC(passPhrase, new FileSink(out))); +} + +void DecryptFile(const char *in, const char *out, const char *passPhrase) +{ + FileSource f(in, true, new DefaultDecryptorWithMAC(passPhrase, new FileSink(out))); +} + +void SecretShareFile(int threshold, int nShares, const char *filename, const char *seed) +{ + assert(nShares >= 1 && nShares<=1000); + if (nShares < 1 || nShares > 1000) + throw InvalidArgument("SecretShareFile: " + IntToString(nShares) + " is not in range [1, 1000]"); + + RandomPool rng; + rng.IncorporateEntropy((byte *)seed, strlen(seed)); + + ChannelSwitch *channelSwitch; + FileSource source(filename, false, new SecretSharing(rng, threshold, nShares, channelSwitch = new ChannelSwitch)); + + vector_member_ptrs fileSinks(nShares); + string channel; + for (int i=0; i(i); + fileSinks[i]->Put((const byte *)channel.data(), 4); + channelSwitch->AddRoute(channel, *fileSinks[i], DEFAULT_CHANNEL); + } + + source.PumpAll(); +} + +void SecretRecoverFile(int threshold, const char *outFilename, char *const *inFilenames) +{ + assert(threshold >= 1 && threshold <=1000); + if (threshold < 1 || threshold > 1000) + throw InvalidArgument("SecretRecoverFile: " + IntToString(threshold) + " is not in range [1, 1000]"); + + SecretRecovery recovery(threshold, new FileSink(outFilename)); + + vector_member_ptrs fileSources(threshold); + SecByteBlock channel(4); + int i; + for (i=0; iPump(4); + fileSources[i]->Get(channel, 4); + fileSources[i]->Attach(new ChannelSwitch(recovery, string((char *)channel.begin(), 4))); + } + + while (fileSources[0]->Pump(256)) + for (i=1; iPump(256); + + for (i=0; iPumpAll(); +} + +void InformationDisperseFile(int threshold, int nShares, const char *filename) +{ + assert(threshold >= 1 && threshold <=1000); + if (threshold < 1 || threshold > 1000) + throw InvalidArgument("InformationDisperseFile: " + IntToString(nShares) + " is not in range [1, 1000]"); + + ChannelSwitch *channelSwitch; + FileSource source(filename, false, new InformationDispersal(threshold, nShares, channelSwitch = new ChannelSwitch)); + + vector_member_ptrs fileSinks(nShares); + string channel; + for (int i=0; i(i); + fileSinks[i]->Put((const byte *)channel.data(), 4); + channelSwitch->AddRoute(channel, *fileSinks[i], DEFAULT_CHANNEL); + } + + source.PumpAll(); +} + +void InformationRecoverFile(int threshold, const char *outFilename, char *const *inFilenames) +{ + assert(threshold<=1000); + if (threshold < 1 || threshold > 1000) + throw InvalidArgument("InformationRecoverFile: " + IntToString(threshold) + " is not in range [1, 1000]"); + + InformationRecovery recovery(threshold, new FileSink(outFilename)); + + vector_member_ptrs fileSources(threshold); + SecByteBlock channel(4); + int i; + for (i=0; iPump(4); + fileSources[i]->Get(channel, 4); + fileSources[i]->Attach(new ChannelSwitch(recovery, string((char *)channel.begin(), 4))); + } + + while (fileSources[0]->Pump(256)) + for (i=1; iPump(256); + + for (i=0; iPumpAll(); +} + +void GzipFile(const char *in, const char *out, int deflate_level) +{ +// FileSource(in, true, new Gzip(new FileSink(out), deflate_level)); + + // use a filter graph to compare decompressed data with original + // + // Source ----> Gzip ------> Sink + // \ | + // \ Gunzip + // \ | + // \ v + // > ComparisonFilter + + EqualityComparisonFilter comparison; + + Gunzip gunzip(new ChannelSwitch(comparison, "0")); + gunzip.SetAutoSignalPropagation(0); + + FileSink sink(out); + + ChannelSwitch *cs; + Gzip gzip(cs = new ChannelSwitch(sink), deflate_level); + cs->AddDefaultRoute(gunzip); + + cs = new ChannelSwitch(gzip); + cs->AddDefaultRoute(comparison, "1"); + FileSource source(in, true, cs); + + comparison.ChannelMessageSeriesEnd("0"); + comparison.ChannelMessageSeriesEnd("1"); +} + +void GunzipFile(const char *in, const char *out) +{ + FileSource(in, true, new Gunzip(new FileSink(out))); +} + +void Base64Encode(const char *in, const char *out) +{ + FileSource(in, true, new Base64Encoder(new FileSink(out))); +} + +void Base64Decode(const char *in, const char *out) +{ + FileSource(in, true, new Base64Decoder(new FileSink(out))); +} + +void HexEncode(const char *in, const char *out) +{ + FileSource(in, true, new HexEncoder(new FileSink(out))); +} + +void HexDecode(const char *in, const char *out) +{ + FileSource(in, true, new HexDecoder(new FileSink(out))); +} + +void ForwardTcpPort(const char *sourcePortName, const char *destinationHost, const char *destinationPortName) +{ +#ifdef SOCKETS_AVAILABLE + SocketsInitializer sockInit; + + Socket sockListen, sockSource, sockDestination; + + int sourcePort = Socket::PortNameToNumber(sourcePortName); + int destinationPort = Socket::PortNameToNumber(destinationPortName); + + sockListen.Create(); + sockListen.Bind(sourcePort); + + int err = setsockopt(sockListen, IPPROTO_TCP, TCP_NODELAY, "\x01", 1); + assert(err == 0); + if(err != 0) + throw Socket::Err(sockListen, "setsockopt", sockListen.GetLastError()); + + cout << "Listing on port " << sourcePort << ".\n"; + sockListen.Listen(); + + sockListen.Accept(sockSource); + cout << "Connection accepted on port " << sourcePort << ".\n"; + sockListen.CloseSocket(); + + cout << "Making connection to " << destinationHost << ", port " << destinationPort << ".\n"; + sockDestination.Create(); + sockDestination.Connect(destinationHost, destinationPort); + + cout << "Connection made to " << destinationHost << ", starting to forward.\n"; + + SocketSource out(sockSource, false, new SocketSink(sockDestination)); + SocketSource in(sockDestination, false, new SocketSink(sockSource)); + + WaitObjectContainer waitObjects; + + while (!(in.SourceExhausted() && out.SourceExhausted())) + { + waitObjects.Clear(); + + out.GetWaitObjects(waitObjects, CallStack("ForwardTcpPort - out", NULL)); + in.GetWaitObjects(waitObjects, CallStack("ForwardTcpPort - in", NULL)); + + waitObjects.Wait(INFINITE_TIME); + + if (!out.SourceExhausted()) + { + cout << "o" << flush; + out.PumpAll2(false); + if (out.SourceExhausted()) + cout << "EOF received on source socket.\n"; + } + + if (!in.SourceExhausted()) + { + cout << "i" << flush; + in.PumpAll2(false); + if (in.SourceExhausted()) + cout << "EOF received on destination socket.\n"; + } + } +#else + cout << "Socket support was not enabled at compile time.\n"; + exit(-1); +#endif +} + +bool Validate(int alg, bool thorough, const char *seedInput) +{ + bool result; + + // Some editors have problems with the '\0' character when redirecting output. + // seedInput is argv[3] when issuing 'cryptest.exe v all ' + std::string seed = (seedInput ? seedInput : IntToString(time(NULL))); + seed.resize(16, ' '); + + OFB_Mode::Encryption& prng = dynamic_cast::Encryption&>(GlobalRNG()); + prng.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data()); + + PrintSeedAndThreads(seed); + + switch (alg) + { + case 0: result = ValidateAll(thorough); break; + case 1: result = TestSettings(); break; + case 2: result = TestOS_RNG(); break; + case 3: result = ValidateMD5(); break; + case 4: result = ValidateSHA(); break; + case 5: result = ValidateDES(); break; + case 6: result = ValidateIDEA(); break; + case 7: result = ValidateARC4(); break; + case 8: result = ValidateRC5(); break; + case 9: result = ValidateBlowfish(); break; +// case 10: result = ValidateDiamond2(); break; + case 11: result = ValidateThreeWay(); break; + case 12: result = ValidateBBS(); break; + case 13: result = ValidateDH(); break; + case 14: result = ValidateRSA(); break; + case 15: result = ValidateElGamal(); break; + case 16: result = ValidateDSA(thorough); break; +// case 17: result = ValidateHAVAL(); break; + case 18: result = ValidateSAFER(); break; + case 19: result = ValidateLUC(); break; + case 20: result = ValidateRabin(); break; +// case 21: result = ValidateBlumGoldwasser(); break; + case 22: result = ValidateECP(); break; + case 23: result = ValidateEC2N(); break; +// case 24: result = ValidateMD5MAC(); break; + case 25: result = ValidateGOST(); break; + case 26: result = ValidateTiger(); break; + case 27: result = ValidateRIPEMD(); break; + case 28: result = ValidateHMAC(); break; +// case 29: result = ValidateXMACC(); break; + case 30: result = ValidateSHARK(); break; + case 32: result = ValidateLUC_DH(); break; + case 33: result = ValidateLUC_DL(); break; + case 34: result = ValidateSEAL(); break; + case 35: result = ValidateCAST(); break; + case 36: result = ValidateSquare(); break; + case 37: result = ValidateRC2(); break; + case 38: result = ValidateRC6(); break; + case 39: result = ValidateMARS(); break; + case 40: result = ValidateRW(); break; + case 41: result = ValidateMD2(); break; + case 42: result = ValidateNR(); break; + case 43: result = ValidateMQV(); break; + case 44: result = ValidateRijndael(); break; + case 45: result = ValidateTwofish(); break; + case 46: result = ValidateSerpent(); break; + case 47: result = ValidateCipherModes(); break; + case 48: result = ValidateCRC32(); break; + case 49: result = ValidateECDSA(); break; + case 50: result = ValidateXTR_DH(); break; + case 51: result = ValidateSKIPJACK(); break; + case 52: result = ValidateSHA2(); break; + case 53: result = ValidatePanama(); break; + case 54: result = ValidateAdler32(); break; + case 55: result = ValidateMD4(); break; + case 56: result = ValidatePBKDF(); break; + case 57: result = ValidateESIGN(); break; + case 58: result = ValidateDLIES(); break; + case 59: result = ValidateBaseCode(); break; + case 60: result = ValidateSHACAL2(); break; + case 61: result = ValidateCamellia(); break; + case 62: result = ValidateWhirlpool(); break; + case 63: result = ValidateTTMAC(); break; + case 64: result = ValidateSalsa(); break; + case 65: result = ValidateSosemanuk(); break; + case 66: result = ValidateVMAC(); break; + case 67: result = ValidateCCM(); break; + case 68: result = ValidateGCM(); break; + case 69: result = ValidateCMAC(); break; + case 70: result = ValidateHKDF(); break; + default: return false; + } + +// Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55 +#if (CRYPTOPP_MSC_VERSION >= 1400) + tm localTime = {}; + char timeBuf[64]; + errno_t err; + + const time_t endTime = time(NULL); + err = localtime_s(&localTime, &endTime); + assert(err == 0); + err = asctime_s(timeBuf, sizeof(timeBuf), &localTime); + assert(err == 0); + + cout << "\nTest ended at " << timeBuf; +#else + const time_t endTime = time(NULL); + cout << "\nTest ended at " << asctime(localtime(&endTime)); +#endif + + cout << "Seed used was: " << seed << endl; + + return result; +} diff --git a/external/crypto++-5.6.3/tftables.cpp b/external/crypto++-5.6.3/tftables.cpp new file mode 100644 index 000000000..b74b35a1e --- /dev/null +++ b/external/crypto++-5.6.3/tftables.cpp @@ -0,0 +1,323 @@ +// Twofish tables + +#include "pch.h" +#include "config.h" + +#include "twofish.h" + +#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + +NAMESPACE_BEGIN(CryptoPP) + +const byte Twofish::Base::q[2][256] = { + 0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, + 0xE4, 0xDD, 0xD1, 0x38, 0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C, + 0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 0xF2, 0xD0, 0x8B, 0x30, + 0x84, 0x54, 0xDF, 0x23, 0x19, 0x5B, 0x3D, 0x59, 0xF3, 0xAE, 0xA2, 0x82, + 0x63, 0x01, 0x83, 0x2E, 0xD9, 0x51, 0x9B, 0x7C, 0xA6, 0xEB, 0xA5, 0xBE, + 0x16, 0x0C, 0xE3, 0x61, 0xC0, 0x8C, 0x3A, 0xF5, 0x73, 0x2C, 0x25, 0x0B, + 0xBB, 0x4E, 0x89, 0x6B, 0x53, 0x6A, 0xB4, 0xF1, 0xE1, 0xE6, 0xBD, 0x45, + 0xE2, 0xF4, 0xB6, 0x66, 0xCC, 0x95, 0x03, 0x56, 0xD4, 0x1C, 0x1E, 0xD7, + 0xFB, 0xC3, 0x8E, 0xB5, 0xE9, 0xCF, 0xBF, 0xBA, 0xEA, 0x77, 0x39, 0xAF, + 0x33, 0xC9, 0x62, 0x71, 0x81, 0x79, 0x09, 0xAD, 0x24, 0xCD, 0xF9, 0xD8, + 0xE5, 0xC5, 0xB9, 0x4D, 0x44, 0x08, 0x86, 0xE7, 0xA1, 0x1D, 0xAA, 0xED, + 0x06, 0x70, 0xB2, 0xD2, 0x41, 0x7B, 0xA0, 0x11, 0x31, 0xC2, 0x27, 0x90, + 0x20, 0xF6, 0x60, 0xFF, 0x96, 0x5C, 0xB1, 0xAB, 0x9E, 0x9C, 0x52, 0x1B, + 0x5F, 0x93, 0x0A, 0xEF, 0x91, 0x85, 0x49, 0xEE, 0x2D, 0x4F, 0x8F, 0x3B, + 0x47, 0x87, 0x6D, 0x46, 0xD6, 0x3E, 0x69, 0x64, 0x2A, 0xCE, 0xCB, 0x2F, + 0xFC, 0x97, 0x05, 0x7A, 0xAC, 0x7F, 0xD5, 0x1A, 0x4B, 0x0E, 0xA7, 0x5A, + 0x28, 0x14, 0x3F, 0x29, 0x88, 0x3C, 0x4C, 0x02, 0xB8, 0xDA, 0xB0, 0x17, + 0x55, 0x1F, 0x8A, 0x7D, 0x57, 0xC7, 0x8D, 0x74, 0xB7, 0xC4, 0x9F, 0x72, + 0x7E, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34, 0x6E, 0x50, 0xDE, 0x68, + 0x65, 0xBC, 0xDB, 0xF8, 0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, + 0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 0x6F, 0x9D, 0x36, 0x42, + 0x4A, 0x5E, 0xC1, 0xE0, + + 0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 0x4A, 0xD3, 0xE6, 0x6B, + 0x45, 0x7D, 0xE8, 0x4B, 0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1, + 0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 0x5E, 0xBA, 0xAE, 0x5B, + 0x8A, 0x00, 0xBC, 0x9D, 0x6D, 0xC1, 0xB1, 0x0E, 0x80, 0x5D, 0xD2, 0xD5, + 0xA0, 0x84, 0x07, 0x14, 0xB5, 0x90, 0x2C, 0xA3, 0xB2, 0x73, 0x4C, 0x54, + 0x92, 0x74, 0x36, 0x51, 0x38, 0xB0, 0xBD, 0x5A, 0xFC, 0x60, 0x62, 0x96, + 0x6C, 0x42, 0xF7, 0x10, 0x7C, 0x28, 0x27, 0x8C, 0x13, 0x95, 0x9C, 0xC7, + 0x24, 0x46, 0x3B, 0x70, 0xCA, 0xE3, 0x85, 0xCB, 0x11, 0xD0, 0x93, 0xB8, + 0xA6, 0x83, 0x20, 0xFF, 0x9F, 0x77, 0xC3, 0xCC, 0x03, 0x6F, 0x08, 0xBF, + 0x40, 0xE7, 0x2B, 0xE2, 0x79, 0x0C, 0xAA, 0x82, 0x41, 0x3A, 0xEA, 0xB9, + 0xE4, 0x9A, 0xA4, 0x97, 0x7E, 0xDA, 0x7A, 0x17, 0x66, 0x94, 0xA1, 0x1D, + 0x3D, 0xF0, 0xDE, 0xB3, 0x0B, 0x72, 0xA7, 0x1C, 0xEF, 0xD1, 0x53, 0x3E, + 0x8F, 0x33, 0x26, 0x5F, 0xEC, 0x76, 0x2A, 0x49, 0x81, 0x88, 0xEE, 0x21, + 0xC4, 0x1A, 0xEB, 0xD9, 0xC5, 0x39, 0x99, 0xCD, 0xAD, 0x31, 0x8B, 0x01, + 0x18, 0x23, 0xDD, 0x1F, 0x4E, 0x2D, 0xF9, 0x48, 0x4F, 0xF2, 0x65, 0x8E, + 0x78, 0x5C, 0x58, 0x19, 0x8D, 0xE5, 0x98, 0x57, 0x67, 0x7F, 0x05, 0x64, + 0xAF, 0x63, 0xB6, 0xFE, 0xF5, 0xB7, 0x3C, 0xA5, 0xCE, 0xE9, 0x68, 0x44, + 0xE0, 0x4D, 0x43, 0x69, 0x29, 0x2E, 0xAC, 0x15, 0x59, 0xA8, 0x0A, 0x9E, + 0x6E, 0x47, 0xDF, 0x34, 0x35, 0x6A, 0xCF, 0xDC, 0x22, 0xC9, 0xC0, 0x9B, + 0x89, 0xD4, 0xED, 0xAB, 0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, + 0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 0x16, 0x25, 0x86, 0x56, + 0x55, 0x09, 0xBE, 0x91 +}; + +const word32 Twofish::Base::mds[4][256] = { + 0xbcbc3275, 0xecec21f3, 0x202043c6, 0xb3b3c9f4, + 0xdada03db, 0x02028b7b, 0xe2e22bfb, 0x9e9efac8, + 0xc9c9ec4a, 0xd4d409d3, 0x18186be6, 0x1e1e9f6b, + 0x98980e45, 0xb2b2387d, 0xa6a6d2e8, 0x2626b74b, + 0x3c3c57d6, 0x93938a32, 0x8282eed8, 0x525298fd, + 0x7b7bd437, 0xbbbb3771, 0x5b5b97f1, 0x474783e1, + 0x24243c30, 0x5151e20f, 0xbabac6f8, 0x4a4af31b, + 0xbfbf4887, 0x0d0d70fa, 0xb0b0b306, 0x7575de3f, + 0xd2d2fd5e, 0x7d7d20ba, 0x666631ae, 0x3a3aa35b, + 0x59591c8a, 0x00000000, 0xcdcd93bc, 0x1a1ae09d, + 0xaeae2c6d, 0x7f7fabc1, 0x2b2bc7b1, 0xbebeb90e, + 0xe0e0a080, 0x8a8a105d, 0x3b3b52d2, 0x6464bad5, + 0xd8d888a0, 0xe7e7a584, 0x5f5fe807, 0x1b1b1114, + 0x2c2cc2b5, 0xfcfcb490, 0x3131272c, 0x808065a3, + 0x73732ab2, 0x0c0c8173, 0x79795f4c, 0x6b6b4154, + 0x4b4b0292, 0x53536974, 0x94948f36, 0x83831f51, + 0x2a2a3638, 0xc4c49cb0, 0x2222c8bd, 0xd5d5f85a, + 0xbdbdc3fc, 0x48487860, 0xffffce62, 0x4c4c0796, + 0x4141776c, 0xc7c7e642, 0xebeb24f7, 0x1c1c1410, + 0x5d5d637c, 0x36362228, 0x6767c027, 0xe9e9af8c, + 0x4444f913, 0x1414ea95, 0xf5f5bb9c, 0xcfcf18c7, + 0x3f3f2d24, 0xc0c0e346, 0x7272db3b, 0x54546c70, + 0x29294cca, 0xf0f035e3, 0x0808fe85, 0xc6c617cb, + 0xf3f34f11, 0x8c8ce4d0, 0xa4a45993, 0xcaca96b8, + 0x68683ba6, 0xb8b84d83, 0x38382820, 0xe5e52eff, + 0xadad569f, 0x0b0b8477, 0xc8c81dc3, 0x9999ffcc, + 0x5858ed03, 0x19199a6f, 0x0e0e0a08, 0x95957ebf, + 0x70705040, 0xf7f730e7, 0x6e6ecf2b, 0x1f1f6ee2, + 0xb5b53d79, 0x09090f0c, 0x616134aa, 0x57571682, + 0x9f9f0b41, 0x9d9d803a, 0x111164ea, 0x2525cdb9, + 0xafafdde4, 0x4545089a, 0xdfdf8da4, 0xa3a35c97, + 0xeaead57e, 0x353558da, 0xededd07a, 0x4343fc17, + 0xf8f8cb66, 0xfbfbb194, 0x3737d3a1, 0xfafa401d, + 0xc2c2683d, 0xb4b4ccf0, 0x32325dde, 0x9c9c71b3, + 0x5656e70b, 0xe3e3da72, 0x878760a7, 0x15151b1c, + 0xf9f93aef, 0x6363bfd1, 0x3434a953, 0x9a9a853e, + 0xb1b1428f, 0x7c7cd133, 0x88889b26, 0x3d3da65f, + 0xa1a1d7ec, 0xe4e4df76, 0x8181942a, 0x91910149, + 0x0f0ffb81, 0xeeeeaa88, 0x161661ee, 0xd7d77321, + 0x9797f5c4, 0xa5a5a81a, 0xfefe3feb, 0x6d6db5d9, + 0x7878aec5, 0xc5c56d39, 0x1d1de599, 0x7676a4cd, + 0x3e3edcad, 0xcbcb6731, 0xb6b6478b, 0xefef5b01, + 0x12121e18, 0x6060c523, 0x6a6ab0dd, 0x4d4df61f, + 0xcecee94e, 0xdede7c2d, 0x55559df9, 0x7e7e5a48, + 0x2121b24f, 0x03037af2, 0xa0a02665, 0x5e5e198e, + 0x5a5a6678, 0x65654b5c, 0x62624e58, 0xfdfd4519, + 0x0606f48d, 0x404086e5, 0xf2f2be98, 0x3333ac57, + 0x17179067, 0x05058e7f, 0xe8e85e05, 0x4f4f7d64, + 0x89896aaf, 0x10109563, 0x74742fb6, 0x0a0a75fe, + 0x5c5c92f5, 0x9b9b74b7, 0x2d2d333c, 0x3030d6a5, + 0x2e2e49ce, 0x494989e9, 0x46467268, 0x77775544, + 0xa8a8d8e0, 0x9696044d, 0x2828bd43, 0xa9a92969, + 0xd9d97929, 0x8686912e, 0xd1d187ac, 0xf4f44a15, + 0x8d8d1559, 0xd6d682a8, 0xb9b9bc0a, 0x42420d9e, + 0xf6f6c16e, 0x2f2fb847, 0xdddd06df, 0x23233934, + 0xcccc6235, 0xf1f1c46a, 0xc1c112cf, 0x8585ebdc, + 0x8f8f9e22, 0x7171a1c9, 0x9090f0c0, 0xaaaa539b, + 0x0101f189, 0x8b8be1d4, 0x4e4e8ced, 0x8e8e6fab, + 0xababa212, 0x6f6f3ea2, 0xe6e6540d, 0xdbdbf252, + 0x92927bbb, 0xb7b7b602, 0x6969ca2f, 0x3939d9a9, + 0xd3d30cd7, 0xa7a72361, 0xa2a2ad1e, 0xc3c399b4, + 0x6c6c4450, 0x07070504, 0x04047ff6, 0x272746c2, + 0xacaca716, 0xd0d07625, 0x50501386, 0xdcdcf756, + 0x84841a55, 0xe1e15109, 0x7a7a25be, 0x1313ef91, + + 0xa9d93939, 0x67901717, 0xb3719c9c, 0xe8d2a6a6, + 0x04050707, 0xfd985252, 0xa3658080, 0x76dfe4e4, + 0x9a084545, 0x92024b4b, 0x80a0e0e0, 0x78665a5a, + 0xe4ddafaf, 0xddb06a6a, 0xd1bf6363, 0x38362a2a, + 0x0d54e6e6, 0xc6432020, 0x3562cccc, 0x98bef2f2, + 0x181e1212, 0xf724ebeb, 0xecd7a1a1, 0x6c774141, + 0x43bd2828, 0x7532bcbc, 0x37d47b7b, 0x269b8888, + 0xfa700d0d, 0x13f94444, 0x94b1fbfb, 0x485a7e7e, + 0xf27a0303, 0xd0e48c8c, 0x8b47b6b6, 0x303c2424, + 0x84a5e7e7, 0x54416b6b, 0xdf06dddd, 0x23c56060, + 0x1945fdfd, 0x5ba33a3a, 0x3d68c2c2, 0x59158d8d, + 0xf321ecec, 0xae316666, 0xa23e6f6f, 0x82165757, + 0x63951010, 0x015befef, 0x834db8b8, 0x2e918686, + 0xd9b56d6d, 0x511f8383, 0x9b53aaaa, 0x7c635d5d, + 0xa63b6868, 0xeb3ffefe, 0xa5d63030, 0xbe257a7a, + 0x16a7acac, 0x0c0f0909, 0xe335f0f0, 0x6123a7a7, + 0xc0f09090, 0x8cafe9e9, 0x3a809d9d, 0xf5925c5c, + 0x73810c0c, 0x2c273131, 0x2576d0d0, 0x0be75656, + 0xbb7b9292, 0x4ee9cece, 0x89f10101, 0x6b9f1e1e, + 0x53a93434, 0x6ac4f1f1, 0xb499c3c3, 0xf1975b5b, + 0xe1834747, 0xe66b1818, 0xbdc82222, 0x450e9898, + 0xe26e1f1f, 0xf4c9b3b3, 0xb62f7474, 0x66cbf8f8, + 0xccff9999, 0x95ea1414, 0x03ed5858, 0x56f7dcdc, + 0xd4e18b8b, 0x1c1b1515, 0x1eada2a2, 0xd70cd3d3, + 0xfb2be2e2, 0xc31dc8c8, 0x8e195e5e, 0xb5c22c2c, + 0xe9894949, 0xcf12c1c1, 0xbf7e9595, 0xba207d7d, + 0xea641111, 0x77840b0b, 0x396dc5c5, 0xaf6a8989, + 0x33d17c7c, 0xc9a17171, 0x62ceffff, 0x7137bbbb, + 0x81fb0f0f, 0x793db5b5, 0x0951e1e1, 0xaddc3e3e, + 0x242d3f3f, 0xcda47676, 0xf99d5555, 0xd8ee8282, + 0xe5864040, 0xc5ae7878, 0xb9cd2525, 0x4d049696, + 0x44557777, 0x080a0e0e, 0x86135050, 0xe730f7f7, + 0xa1d33737, 0x1d40fafa, 0xaa346161, 0xed8c4e4e, + 0x06b3b0b0, 0x706c5454, 0xb22a7373, 0xd2523b3b, + 0x410b9f9f, 0x7b8b0202, 0xa088d8d8, 0x114ff3f3, + 0x3167cbcb, 0xc2462727, 0x27c06767, 0x90b4fcfc, + 0x20283838, 0xf67f0404, 0x60784848, 0xff2ee5e5, + 0x96074c4c, 0x5c4b6565, 0xb1c72b2b, 0xab6f8e8e, + 0x9e0d4242, 0x9cbbf5f5, 0x52f2dbdb, 0x1bf34a4a, + 0x5fa63d3d, 0x9359a4a4, 0x0abcb9b9, 0xef3af9f9, + 0x91ef1313, 0x85fe0808, 0x49019191, 0xee611616, + 0x2d7cdede, 0x4fb22121, 0x8f42b1b1, 0x3bdb7272, + 0x47b82f2f, 0x8748bfbf, 0x6d2caeae, 0x46e3c0c0, + 0xd6573c3c, 0x3e859a9a, 0x6929a9a9, 0x647d4f4f, + 0x2a948181, 0xce492e2e, 0xcb17c6c6, 0x2fca6969, + 0xfcc3bdbd, 0x975ca3a3, 0x055ee8e8, 0x7ad0eded, + 0xac87d1d1, 0x7f8e0505, 0xd5ba6464, 0x1aa8a5a5, + 0x4bb72626, 0x0eb9bebe, 0xa7608787, 0x5af8d5d5, + 0x28223636, 0x14111b1b, 0x3fde7575, 0x2979d9d9, + 0x88aaeeee, 0x3c332d2d, 0x4c5f7979, 0x02b6b7b7, + 0xb896caca, 0xda583535, 0xb09cc4c4, 0x17fc4343, + 0x551a8484, 0x1ff64d4d, 0x8a1c5959, 0x7d38b2b2, + 0x57ac3333, 0xc718cfcf, 0x8df40606, 0x74695353, + 0xb7749b9b, 0xc4f59797, 0x9f56adad, 0x72dae3e3, + 0x7ed5eaea, 0x154af4f4, 0x229e8f8f, 0x12a2abab, + 0x584e6262, 0x07e85f5f, 0x99e51d1d, 0x34392323, + 0x6ec1f6f6, 0x50446c6c, 0xde5d3232, 0x68724646, + 0x6526a0a0, 0xbc93cdcd, 0xdb03dada, 0xf8c6baba, + 0xc8fa9e9e, 0xa882d6d6, 0x2bcf6e6e, 0x40507070, + 0xdceb8585, 0xfe750a0a, 0x328a9393, 0xa48ddfdf, + 0xca4c2929, 0x10141c1c, 0x2173d7d7, 0xf0ccb4b4, + 0xd309d4d4, 0x5d108a8a, 0x0fe25151, 0x00000000, + 0x6f9a1919, 0x9de01a1a, 0x368f9494, 0x42e6c7c7, + 0x4aecc9c9, 0x5efdd2d2, 0xc1ab7f7f, 0xe0d8a8a8, + + 0xbc75bc32, 0xecf3ec21, 0x20c62043, 0xb3f4b3c9, + 0xdadbda03, 0x027b028b, 0xe2fbe22b, 0x9ec89efa, + 0xc94ac9ec, 0xd4d3d409, 0x18e6186b, 0x1e6b1e9f, + 0x9845980e, 0xb27db238, 0xa6e8a6d2, 0x264b26b7, + 0x3cd63c57, 0x9332938a, 0x82d882ee, 0x52fd5298, + 0x7b377bd4, 0xbb71bb37, 0x5bf15b97, 0x47e14783, + 0x2430243c, 0x510f51e2, 0xbaf8bac6, 0x4a1b4af3, + 0xbf87bf48, 0x0dfa0d70, 0xb006b0b3, 0x753f75de, + 0xd25ed2fd, 0x7dba7d20, 0x66ae6631, 0x3a5b3aa3, + 0x598a591c, 0x00000000, 0xcdbccd93, 0x1a9d1ae0, + 0xae6dae2c, 0x7fc17fab, 0x2bb12bc7, 0xbe0ebeb9, + 0xe080e0a0, 0x8a5d8a10, 0x3bd23b52, 0x64d564ba, + 0xd8a0d888, 0xe784e7a5, 0x5f075fe8, 0x1b141b11, + 0x2cb52cc2, 0xfc90fcb4, 0x312c3127, 0x80a38065, + 0x73b2732a, 0x0c730c81, 0x794c795f, 0x6b546b41, + 0x4b924b02, 0x53745369, 0x9436948f, 0x8351831f, + 0x2a382a36, 0xc4b0c49c, 0x22bd22c8, 0xd55ad5f8, + 0xbdfcbdc3, 0x48604878, 0xff62ffce, 0x4c964c07, + 0x416c4177, 0xc742c7e6, 0xebf7eb24, 0x1c101c14, + 0x5d7c5d63, 0x36283622, 0x672767c0, 0xe98ce9af, + 0x441344f9, 0x149514ea, 0xf59cf5bb, 0xcfc7cf18, + 0x3f243f2d, 0xc046c0e3, 0x723b72db, 0x5470546c, + 0x29ca294c, 0xf0e3f035, 0x088508fe, 0xc6cbc617, + 0xf311f34f, 0x8cd08ce4, 0xa493a459, 0xcab8ca96, + 0x68a6683b, 0xb883b84d, 0x38203828, 0xe5ffe52e, + 0xad9fad56, 0x0b770b84, 0xc8c3c81d, 0x99cc99ff, + 0x580358ed, 0x196f199a, 0x0e080e0a, 0x95bf957e, + 0x70407050, 0xf7e7f730, 0x6e2b6ecf, 0x1fe21f6e, + 0xb579b53d, 0x090c090f, 0x61aa6134, 0x57825716, + 0x9f419f0b, 0x9d3a9d80, 0x11ea1164, 0x25b925cd, + 0xafe4afdd, 0x459a4508, 0xdfa4df8d, 0xa397a35c, + 0xea7eead5, 0x35da3558, 0xed7aedd0, 0x431743fc, + 0xf866f8cb, 0xfb94fbb1, 0x37a137d3, 0xfa1dfa40, + 0xc23dc268, 0xb4f0b4cc, 0x32de325d, 0x9cb39c71, + 0x560b56e7, 0xe372e3da, 0x87a78760, 0x151c151b, + 0xf9eff93a, 0x63d163bf, 0x345334a9, 0x9a3e9a85, + 0xb18fb142, 0x7c337cd1, 0x8826889b, 0x3d5f3da6, + 0xa1eca1d7, 0xe476e4df, 0x812a8194, 0x91499101, + 0x0f810ffb, 0xee88eeaa, 0x16ee1661, 0xd721d773, + 0x97c497f5, 0xa51aa5a8, 0xfeebfe3f, 0x6dd96db5, + 0x78c578ae, 0xc539c56d, 0x1d991de5, 0x76cd76a4, + 0x3ead3edc, 0xcb31cb67, 0xb68bb647, 0xef01ef5b, + 0x1218121e, 0x602360c5, 0x6add6ab0, 0x4d1f4df6, + 0xce4ecee9, 0xde2dde7c, 0x55f9559d, 0x7e487e5a, + 0x214f21b2, 0x03f2037a, 0xa065a026, 0x5e8e5e19, + 0x5a785a66, 0x655c654b, 0x6258624e, 0xfd19fd45, + 0x068d06f4, 0x40e54086, 0xf298f2be, 0x335733ac, + 0x17671790, 0x057f058e, 0xe805e85e, 0x4f644f7d, + 0x89af896a, 0x10631095, 0x74b6742f, 0x0afe0a75, + 0x5cf55c92, 0x9bb79b74, 0x2d3c2d33, 0x30a530d6, + 0x2ece2e49, 0x49e94989, 0x46684672, 0x77447755, + 0xa8e0a8d8, 0x964d9604, 0x284328bd, 0xa969a929, + 0xd929d979, 0x862e8691, 0xd1acd187, 0xf415f44a, + 0x8d598d15, 0xd6a8d682, 0xb90ab9bc, 0x429e420d, + 0xf66ef6c1, 0x2f472fb8, 0xdddfdd06, 0x23342339, + 0xcc35cc62, 0xf16af1c4, 0xc1cfc112, 0x85dc85eb, + 0x8f228f9e, 0x71c971a1, 0x90c090f0, 0xaa9baa53, + 0x018901f1, 0x8bd48be1, 0x4eed4e8c, 0x8eab8e6f, + 0xab12aba2, 0x6fa26f3e, 0xe60de654, 0xdb52dbf2, + 0x92bb927b, 0xb702b7b6, 0x692f69ca, 0x39a939d9, + 0xd3d7d30c, 0xa761a723, 0xa21ea2ad, 0xc3b4c399, + 0x6c506c44, 0x07040705, 0x04f6047f, 0x27c22746, + 0xac16aca7, 0xd025d076, 0x50865013, 0xdc56dcf7, + 0x8455841a, 0xe109e151, 0x7abe7a25, 0x139113ef, + + 0xd939a9d9, 0x90176790, 0x719cb371, 0xd2a6e8d2, + 0x05070405, 0x9852fd98, 0x6580a365, 0xdfe476df, + 0x08459a08, 0x024b9202, 0xa0e080a0, 0x665a7866, + 0xddafe4dd, 0xb06addb0, 0xbf63d1bf, 0x362a3836, + 0x54e60d54, 0x4320c643, 0x62cc3562, 0xbef298be, + 0x1e12181e, 0x24ebf724, 0xd7a1ecd7, 0x77416c77, + 0xbd2843bd, 0x32bc7532, 0xd47b37d4, 0x9b88269b, + 0x700dfa70, 0xf94413f9, 0xb1fb94b1, 0x5a7e485a, + 0x7a03f27a, 0xe48cd0e4, 0x47b68b47, 0x3c24303c, + 0xa5e784a5, 0x416b5441, 0x06dddf06, 0xc56023c5, + 0x45fd1945, 0xa33a5ba3, 0x68c23d68, 0x158d5915, + 0x21ecf321, 0x3166ae31, 0x3e6fa23e, 0x16578216, + 0x95106395, 0x5bef015b, 0x4db8834d, 0x91862e91, + 0xb56dd9b5, 0x1f83511f, 0x53aa9b53, 0x635d7c63, + 0x3b68a63b, 0x3ffeeb3f, 0xd630a5d6, 0x257abe25, + 0xa7ac16a7, 0x0f090c0f, 0x35f0e335, 0x23a76123, + 0xf090c0f0, 0xafe98caf, 0x809d3a80, 0x925cf592, + 0x810c7381, 0x27312c27, 0x76d02576, 0xe7560be7, + 0x7b92bb7b, 0xe9ce4ee9, 0xf10189f1, 0x9f1e6b9f, + 0xa93453a9, 0xc4f16ac4, 0x99c3b499, 0x975bf197, + 0x8347e183, 0x6b18e66b, 0xc822bdc8, 0x0e98450e, + 0x6e1fe26e, 0xc9b3f4c9, 0x2f74b62f, 0xcbf866cb, + 0xff99ccff, 0xea1495ea, 0xed5803ed, 0xf7dc56f7, + 0xe18bd4e1, 0x1b151c1b, 0xada21ead, 0x0cd3d70c, + 0x2be2fb2b, 0x1dc8c31d, 0x195e8e19, 0xc22cb5c2, + 0x8949e989, 0x12c1cf12, 0x7e95bf7e, 0x207dba20, + 0x6411ea64, 0x840b7784, 0x6dc5396d, 0x6a89af6a, + 0xd17c33d1, 0xa171c9a1, 0xceff62ce, 0x37bb7137, + 0xfb0f81fb, 0x3db5793d, 0x51e10951, 0xdc3eaddc, + 0x2d3f242d, 0xa476cda4, 0x9d55f99d, 0xee82d8ee, + 0x8640e586, 0xae78c5ae, 0xcd25b9cd, 0x04964d04, + 0x55774455, 0x0a0e080a, 0x13508613, 0x30f7e730, + 0xd337a1d3, 0x40fa1d40, 0x3461aa34, 0x8c4eed8c, + 0xb3b006b3, 0x6c54706c, 0x2a73b22a, 0x523bd252, + 0x0b9f410b, 0x8b027b8b, 0x88d8a088, 0x4ff3114f, + 0x67cb3167, 0x4627c246, 0xc06727c0, 0xb4fc90b4, + 0x28382028, 0x7f04f67f, 0x78486078, 0x2ee5ff2e, + 0x074c9607, 0x4b655c4b, 0xc72bb1c7, 0x6f8eab6f, + 0x0d429e0d, 0xbbf59cbb, 0xf2db52f2, 0xf34a1bf3, + 0xa63d5fa6, 0x59a49359, 0xbcb90abc, 0x3af9ef3a, + 0xef1391ef, 0xfe0885fe, 0x01914901, 0x6116ee61, + 0x7cde2d7c, 0xb2214fb2, 0x42b18f42, 0xdb723bdb, + 0xb82f47b8, 0x48bf8748, 0x2cae6d2c, 0xe3c046e3, + 0x573cd657, 0x859a3e85, 0x29a96929, 0x7d4f647d, + 0x94812a94, 0x492ece49, 0x17c6cb17, 0xca692fca, + 0xc3bdfcc3, 0x5ca3975c, 0x5ee8055e, 0xd0ed7ad0, + 0x87d1ac87, 0x8e057f8e, 0xba64d5ba, 0xa8a51aa8, + 0xb7264bb7, 0xb9be0eb9, 0x6087a760, 0xf8d55af8, + 0x22362822, 0x111b1411, 0xde753fde, 0x79d92979, + 0xaaee88aa, 0x332d3c33, 0x5f794c5f, 0xb6b702b6, + 0x96cab896, 0x5835da58, 0x9cc4b09c, 0xfc4317fc, + 0x1a84551a, 0xf64d1ff6, 0x1c598a1c, 0x38b27d38, + 0xac3357ac, 0x18cfc718, 0xf4068df4, 0x69537469, + 0x749bb774, 0xf597c4f5, 0x56ad9f56, 0xdae372da, + 0xd5ea7ed5, 0x4af4154a, 0x9e8f229e, 0xa2ab12a2, + 0x4e62584e, 0xe85f07e8, 0xe51d99e5, 0x39233439, + 0xc1f66ec1, 0x446c5044, 0x5d32de5d, 0x72466872, + 0x26a06526, 0x93cdbc93, 0x03dadb03, 0xc6baf8c6, + 0xfa9ec8fa, 0x82d6a882, 0xcf6e2bcf, 0x50704050, + 0xeb85dceb, 0x750afe75, 0x8a93328a, 0x8ddfa48d, + 0x4c29ca4c, 0x141c1014, 0x73d72173, 0xccb4f0cc, + 0x09d4d309, 0x108a5d10, 0xe2510fe2, 0x00000000, + 0x9a196f9a, 0xe01a9de0, 0x8f94368f, 0xe6c742e6, + 0xecc94aec, 0xfdd25efd, 0xab7fc1ab, 0xd8a8e0d8}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/tiger.cpp b/external/crypto++-5.6.3/tiger.cpp new file mode 100644 index 000000000..a837636a7 --- /dev/null +++ b/external/crypto++-5.6.3/tiger.cpp @@ -0,0 +1,276 @@ +// tiger.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +#include "tiger.h" +#include "misc.h" +#include "cpu.h" + +NAMESPACE_BEGIN(CryptoPP) + +void Tiger::InitState(HashWordType *state) +{ + state[0] = W64LIT(0x0123456789ABCDEF); + state[1] = W64LIT(0xFEDCBA9876543210); + state[2] = W64LIT(0xF096A5B4C3B2E187); +} + +void Tiger::TruncatedFinal(byte *hash, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + PadLastBlock(56, 0x01); + CorrectEndianess(m_data, m_data, 56); + + m_data[7] = GetBitCountLo(); + + Transform(m_state, m_data); + CorrectEndianess(m_state, m_state, DigestSize()); + memcpy(hash, m_state, size); + + Restart(); // reinit for next use +} + +void Tiger::Transform (word64 *digest, const word64 *X) +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) + if (HasSSE2()) + { +#ifdef __GNUC__ + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS_PUSH_IF86(bx) +#else + #if _MSC_VER < 1300 + const word64 *t = table; + AS2( mov edx, t) + #else + AS2( lea edx, [table]) + #endif + AS2( mov eax, digest) + AS2( mov esi, X) +#endif + AS2( movq mm0, [eax]) + AS2( movq mm1, [eax+1*8]) + AS2( movq mm5, mm1) + AS2( movq mm2, [eax+2*8]) + AS2( movq mm7, [edx+4*2048+0*8]) + AS2( movq mm6, [edx+4*2048+1*8]) + AS2( mov ecx, esp) + AS2( and esp, 0xfffffff0) + AS2( sub esp, 8*8) + AS_PUSH_IF86(cx) + +#define SSE2_round(a,b,c,x,mul) \ + AS2( pxor c, [x])\ + AS2( movd ecx, c)\ + AS2( movzx edi, cl)\ + AS2( movq mm3, [edx+0*2048+edi*8])\ + AS2( movzx edi, ch)\ + AS2( movq mm4, [edx+3*2048+edi*8])\ + AS2( shr ecx, 16)\ + AS2( movzx edi, cl)\ + AS2( pxor mm3, [edx+1*2048+edi*8])\ + AS2( movzx edi, ch)\ + AS2( pxor mm4, [edx+2*2048+edi*8])\ + AS3( pextrw ecx, c, 2)\ + AS2( movzx edi, cl)\ + AS2( pxor mm3, [edx+2*2048+edi*8])\ + AS2( movzx edi, ch)\ + AS2( pxor mm4, [edx+1*2048+edi*8])\ + AS3( pextrw ecx, c, 3)\ + AS2( movzx edi, cl)\ + AS2( pxor mm3, [edx+3*2048+edi*8])\ + AS2( psubq a, mm3)\ + AS2( movzx edi, ch)\ + AS2( pxor mm4, [edx+0*2048+edi*8])\ + AS2( paddq b, mm4)\ + SSE2_mul_##mul(b) + +#define SSE2_mul_5(b) \ + AS2( movq mm3, b)\ + AS2( psllq b, 2)\ + AS2( paddq b, mm3) + +#define SSE2_mul_7(b) \ + AS2( movq mm3, b)\ + AS2( psllq b, 3)\ + AS2( psubq b, mm3) + +#define SSE2_mul_9(b) \ + AS2( movq mm3, b)\ + AS2( psllq b, 3)\ + AS2( paddq b, mm3) + +#define label2_5 1 +#define label2_7 2 +#define label2_9 3 + +#define SSE2_pass(A,B,C,mul,X) \ + AS2( xor ebx, ebx)\ + ASL(mul)\ + SSE2_round(A,B,C,X+0*8+ebx,mul)\ + SSE2_round(B,C,A,X+1*8+ebx,mul)\ + AS2( cmp ebx, 6*8)\ + ASJ( je, label2_##mul, f)\ + SSE2_round(C,A,B,X+2*8+ebx,mul)\ + AS2( add ebx, 3*8)\ + ASJ( jmp, mul, b)\ + ASL(label2_##mul) + +#define SSE2_key_schedule(Y,X) \ + AS2( movq mm3, [X+7*8])\ + AS2( pxor mm3, mm6)\ + AS2( movq mm4, [X+0*8])\ + AS2( psubq mm4, mm3)\ + AS2( movq [Y+0*8], mm4)\ + AS2( pxor mm4, [X+1*8])\ + AS2( movq mm3, mm4)\ + AS2( movq [Y+1*8], mm4)\ + AS2( paddq mm4, [X+2*8])\ + AS2( pxor mm3, mm7)\ + AS2( psllq mm3, 19)\ + AS2( movq [Y+2*8], mm4)\ + AS2( pxor mm3, mm4)\ + AS2( movq mm4, [X+3*8])\ + AS2( psubq mm4, mm3)\ + AS2( movq [Y+3*8], mm4)\ + AS2( pxor mm4, [X+4*8])\ + AS2( movq mm3, mm4)\ + AS2( movq [Y+4*8], mm4)\ + AS2( paddq mm4, [X+5*8])\ + AS2( pxor mm3, mm7)\ + AS2( psrlq mm3, 23)\ + AS2( movq [Y+5*8], mm4)\ + AS2( pxor mm3, mm4)\ + AS2( movq mm4, [X+6*8])\ + AS2( psubq mm4, mm3)\ + AS2( movq [Y+6*8], mm4)\ + AS2( pxor mm4, [X+7*8])\ + AS2( movq mm3, mm4)\ + AS2( movq [Y+7*8], mm4)\ + AS2( paddq mm4, [Y+0*8])\ + AS2( pxor mm3, mm7)\ + AS2( psllq mm3, 19)\ + AS2( movq [Y+0*8], mm4)\ + AS2( pxor mm3, mm4)\ + AS2( movq mm4, [Y+1*8])\ + AS2( psubq mm4, mm3)\ + AS2( movq [Y+1*8], mm4)\ + AS2( pxor mm4, [Y+2*8])\ + AS2( movq mm3, mm4)\ + AS2( movq [Y+2*8], mm4)\ + AS2( paddq mm4, [Y+3*8])\ + AS2( pxor mm3, mm7)\ + AS2( psrlq mm3, 23)\ + AS2( movq [Y+3*8], mm4)\ + AS2( pxor mm3, mm4)\ + AS2( movq mm4, [Y+4*8])\ + AS2( psubq mm4, mm3)\ + AS2( movq [Y+4*8], mm4)\ + AS2( pxor mm4, [Y+5*8])\ + AS2( movq [Y+5*8], mm4)\ + AS2( paddq mm4, [Y+6*8])\ + AS2( movq [Y+6*8], mm4)\ + AS2( pxor mm4, [edx+4*2048+2*8])\ + AS2( movq mm3, [Y+7*8])\ + AS2( psubq mm3, mm4)\ + AS2( movq [Y+7*8], mm3) + +#if CRYPTOPP_BOOL_X32 + SSE2_pass(mm0, mm1, mm2, 5, esi) + SSE2_key_schedule(esp+8, esi) + SSE2_pass(mm2, mm0, mm1, 7, esp+8) + SSE2_key_schedule(esp+8, esp+8) + SSE2_pass(mm1, mm2, mm0, 9, esp+8) +#else + SSE2_pass(mm0, mm1, mm2, 5, esi) + SSE2_key_schedule(esp+4, esi) + SSE2_pass(mm2, mm0, mm1, 7, esp+4) + SSE2_key_schedule(esp+4, esp+4) + SSE2_pass(mm1, mm2, mm0, 9, esp+4) +#endif + + AS2( pxor mm0, [eax+0*8]) + AS2( movq [eax+0*8], mm0) + AS2( psubq mm1, mm5) + AS2( movq [eax+1*8], mm1) + AS2( paddq mm2, [eax+2*8]) + AS2( movq [eax+2*8], mm2) + + AS_POP_IF86(sp) + AS1( emms) + +#ifdef __GNUC__ + AS_POP_IF86(bx) + ATT_PREFIX + : + : "a" (digest), "S" (X), "d" (table) + : "%ecx", "%edi", "memory", "cc" + ); +#endif + } + else +#endif + { + word64 a = digest[0]; + word64 b = digest[1]; + word64 c = digest[2]; + word64 Y[8]; + +#define t1 (table) +#define t2 (table+256) +#define t3 (table+256*2) +#define t4 (table+256*3) + +#define round(a,b,c,x,mul) \ + c ^= x; \ + a -= t1[GETBYTE(c,0)] ^ t2[GETBYTE(c,2)] ^ t3[GETBYTE(c,4)] ^ t4[GETBYTE(c,6)]; \ + b += t4[GETBYTE(c,1)] ^ t3[GETBYTE(c,3)] ^ t2[GETBYTE(c,5)] ^ t1[GETBYTE(c,7)]; \ + b *= mul + +#define pass(a,b,c,mul,X) {\ + int i=0;\ + while (true)\ + {\ + round(a,b,c,X[i+0],mul); \ + round(b,c,a,X[i+1],mul); \ + if (i==6)\ + break;\ + round(c,a,b,X[i+2],mul); \ + i+=3;\ + }} + +#define key_schedule(Y,X) \ + Y[0] = X[0] - (X[7]^W64LIT(0xA5A5A5A5A5A5A5A5)); \ + Y[1] = X[1] ^ Y[0]; \ + Y[2] = X[2] + Y[1]; \ + Y[3] = X[3] - (Y[2] ^ ((~Y[1])<<19)); \ + Y[4] = X[4] ^ Y[3]; \ + Y[5] = X[5] + Y[4]; \ + Y[6] = X[6] - (Y[5] ^ ((~Y[4])>>23)); \ + Y[7] = X[7] ^ Y[6]; \ + Y[0] += Y[7]; \ + Y[1] -= Y[0] ^ ((~Y[7])<<19); \ + Y[2] ^= Y[1]; \ + Y[3] += Y[2]; \ + Y[4] -= Y[3] ^ ((~Y[2])>>23); \ + Y[5] ^= Y[4]; \ + Y[6] += Y[5]; \ + Y[7] -= Y[6] ^ W64LIT(0x0123456789ABCDEF) + + pass(a,b,c,5,X); + key_schedule(Y,X); + pass(c,a,b,7,Y); + key_schedule(Y,Y); + pass(b,c,a,9,Y); + + digest[0] = a ^ digest[0]; + digest[1] = b - digest[1]; + digest[2] = c + digest[2]; + } +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/tiger.h b/external/crypto++-5.6.3/tiger.h new file mode 100644 index 000000000..5f6e941ac --- /dev/null +++ b/external/crypto++-5.6.3/tiger.h @@ -0,0 +1,24 @@ +#ifndef CRYPTOPP_TIGER_H +#define CRYPTOPP_TIGER_H + +#include "config.h" +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// Tiger +class Tiger : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word64 *digest, const word64 *data); + void TruncatedFinal(byte *hash, size_t size); + static const char * StaticAlgorithmName() {return "Tiger";} + +protected: + static const word64 table[4*256+3]; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/tigertab.cpp b/external/crypto++-5.6.3/tigertab.cpp new file mode 100644 index 000000000..5c1595b5b --- /dev/null +++ b/external/crypto++-5.6.3/tigertab.cpp @@ -0,0 +1,525 @@ +#include "pch.h" +#include "tiger.h" + +NAMESPACE_BEGIN(CryptoPP) + +const word64 Tiger::table[4*256+3] = +{ + W64LIT(0x02AAB17CF7E90C5E) /* 0 */, W64LIT(0xAC424B03E243A8EC) /* 1 */, + W64LIT(0x72CD5BE30DD5FCD3) /* 2 */, W64LIT(0x6D019B93F6F97F3A) /* 3 */, + W64LIT(0xCD9978FFD21F9193) /* 4 */, W64LIT(0x7573A1C9708029E2) /* 5 */, + W64LIT(0xB164326B922A83C3) /* 6 */, W64LIT(0x46883EEE04915870) /* 7 */, + W64LIT(0xEAACE3057103ECE6) /* 8 */, W64LIT(0xC54169B808A3535C) /* 9 */, + W64LIT(0x4CE754918DDEC47C) /* 10 */, W64LIT(0x0AA2F4DFDC0DF40C) /* 11 */, + W64LIT(0x10B76F18A74DBEFA) /* 12 */, W64LIT(0xC6CCB6235AD1AB6A) /* 13 */, + W64LIT(0x13726121572FE2FF) /* 14 */, W64LIT(0x1A488C6F199D921E) /* 15 */, + W64LIT(0x4BC9F9F4DA0007CA) /* 16 */, W64LIT(0x26F5E6F6E85241C7) /* 17 */, + W64LIT(0x859079DBEA5947B6) /* 18 */, W64LIT(0x4F1885C5C99E8C92) /* 19 */, + W64LIT(0xD78E761EA96F864B) /* 20 */, W64LIT(0x8E36428C52B5C17D) /* 21 */, + W64LIT(0x69CF6827373063C1) /* 22 */, W64LIT(0xB607C93D9BB4C56E) /* 23 */, + W64LIT(0x7D820E760E76B5EA) /* 24 */, W64LIT(0x645C9CC6F07FDC42) /* 25 */, + W64LIT(0xBF38A078243342E0) /* 26 */, W64LIT(0x5F6B343C9D2E7D04) /* 27 */, + W64LIT(0xF2C28AEB600B0EC6) /* 28 */, W64LIT(0x6C0ED85F7254BCAC) /* 29 */, + W64LIT(0x71592281A4DB4FE5) /* 30 */, W64LIT(0x1967FA69CE0FED9F) /* 31 */, + W64LIT(0xFD5293F8B96545DB) /* 32 */, W64LIT(0xC879E9D7F2A7600B) /* 33 */, + W64LIT(0x860248920193194E) /* 34 */, W64LIT(0xA4F9533B2D9CC0B3) /* 35 */, + W64LIT(0x9053836C15957613) /* 36 */, W64LIT(0xDB6DCF8AFC357BF1) /* 37 */, + W64LIT(0x18BEEA7A7A370F57) /* 38 */, W64LIT(0x037117CA50B99066) /* 39 */, + W64LIT(0x6AB30A9774424A35) /* 40 */, W64LIT(0xF4E92F02E325249B) /* 41 */, + W64LIT(0x7739DB07061CCAE1) /* 42 */, W64LIT(0xD8F3B49CECA42A05) /* 43 */, + W64LIT(0xBD56BE3F51382F73) /* 44 */, W64LIT(0x45FAED5843B0BB28) /* 45 */, + W64LIT(0x1C813D5C11BF1F83) /* 46 */, W64LIT(0x8AF0E4B6D75FA169) /* 47 */, + W64LIT(0x33EE18A487AD9999) /* 48 */, W64LIT(0x3C26E8EAB1C94410) /* 49 */, + W64LIT(0xB510102BC0A822F9) /* 50 */, W64LIT(0x141EEF310CE6123B) /* 51 */, + W64LIT(0xFC65B90059DDB154) /* 52 */, W64LIT(0xE0158640C5E0E607) /* 53 */, + W64LIT(0x884E079826C3A3CF) /* 54 */, W64LIT(0x930D0D9523C535FD) /* 55 */, + W64LIT(0x35638D754E9A2B00) /* 56 */, W64LIT(0x4085FCCF40469DD5) /* 57 */, + W64LIT(0xC4B17AD28BE23A4C) /* 58 */, W64LIT(0xCAB2F0FC6A3E6A2E) /* 59 */, + W64LIT(0x2860971A6B943FCD) /* 60 */, W64LIT(0x3DDE6EE212E30446) /* 61 */, + W64LIT(0x6222F32AE01765AE) /* 62 */, W64LIT(0x5D550BB5478308FE) /* 63 */, + W64LIT(0xA9EFA98DA0EDA22A) /* 64 */, W64LIT(0xC351A71686C40DA7) /* 65 */, + W64LIT(0x1105586D9C867C84) /* 66 */, W64LIT(0xDCFFEE85FDA22853) /* 67 */, + W64LIT(0xCCFBD0262C5EEF76) /* 68 */, W64LIT(0xBAF294CB8990D201) /* 69 */, + W64LIT(0xE69464F52AFAD975) /* 70 */, W64LIT(0x94B013AFDF133E14) /* 71 */, + W64LIT(0x06A7D1A32823C958) /* 72 */, W64LIT(0x6F95FE5130F61119) /* 73 */, + W64LIT(0xD92AB34E462C06C0) /* 74 */, W64LIT(0xED7BDE33887C71D2) /* 75 */, + W64LIT(0x79746D6E6518393E) /* 76 */, W64LIT(0x5BA419385D713329) /* 77 */, + W64LIT(0x7C1BA6B948A97564) /* 78 */, W64LIT(0x31987C197BFDAC67) /* 79 */, + W64LIT(0xDE6C23C44B053D02) /* 80 */, W64LIT(0x581C49FED002D64D) /* 81 */, + W64LIT(0xDD474D6338261571) /* 82 */, W64LIT(0xAA4546C3E473D062) /* 83 */, + W64LIT(0x928FCE349455F860) /* 84 */, W64LIT(0x48161BBACAAB94D9) /* 85 */, + W64LIT(0x63912430770E6F68) /* 86 */, W64LIT(0x6EC8A5E602C6641C) /* 87 */, + W64LIT(0x87282515337DDD2B) /* 88 */, W64LIT(0x2CDA6B42034B701B) /* 89 */, + W64LIT(0xB03D37C181CB096D) /* 90 */, W64LIT(0xE108438266C71C6F) /* 91 */, + W64LIT(0x2B3180C7EB51B255) /* 92 */, W64LIT(0xDF92B82F96C08BBC) /* 93 */, + W64LIT(0x5C68C8C0A632F3BA) /* 94 */, W64LIT(0x5504CC861C3D0556) /* 95 */, + W64LIT(0xABBFA4E55FB26B8F) /* 96 */, W64LIT(0x41848B0AB3BACEB4) /* 97 */, + W64LIT(0xB334A273AA445D32) /* 98 */, W64LIT(0xBCA696F0A85AD881) /* 99 */, + W64LIT(0x24F6EC65B528D56C) /* 100 */, W64LIT(0x0CE1512E90F4524A) /* 101 */, + W64LIT(0x4E9DD79D5506D35A) /* 102 */, W64LIT(0x258905FAC6CE9779) /* 103 */, + W64LIT(0x2019295B3E109B33) /* 104 */, W64LIT(0xF8A9478B73A054CC) /* 105 */, + W64LIT(0x2924F2F934417EB0) /* 106 */, W64LIT(0x3993357D536D1BC4) /* 107 */, + W64LIT(0x38A81AC21DB6FF8B) /* 108 */, W64LIT(0x47C4FBF17D6016BF) /* 109 */, + W64LIT(0x1E0FAADD7667E3F5) /* 110 */, W64LIT(0x7ABCFF62938BEB96) /* 111 */, + W64LIT(0xA78DAD948FC179C9) /* 112 */, W64LIT(0x8F1F98B72911E50D) /* 113 */, + W64LIT(0x61E48EAE27121A91) /* 114 */, W64LIT(0x4D62F7AD31859808) /* 115 */, + W64LIT(0xECEBA345EF5CEAEB) /* 116 */, W64LIT(0xF5CEB25EBC9684CE) /* 117 */, + W64LIT(0xF633E20CB7F76221) /* 118 */, W64LIT(0xA32CDF06AB8293E4) /* 119 */, + W64LIT(0x985A202CA5EE2CA4) /* 120 */, W64LIT(0xCF0B8447CC8A8FB1) /* 121 */, + W64LIT(0x9F765244979859A3) /* 122 */, W64LIT(0xA8D516B1A1240017) /* 123 */, + W64LIT(0x0BD7BA3EBB5DC726) /* 124 */, W64LIT(0xE54BCA55B86ADB39) /* 125 */, + W64LIT(0x1D7A3AFD6C478063) /* 126 */, W64LIT(0x519EC608E7669EDD) /* 127 */, + W64LIT(0x0E5715A2D149AA23) /* 128 */, W64LIT(0x177D4571848FF194) /* 129 */, + W64LIT(0xEEB55F3241014C22) /* 130 */, W64LIT(0x0F5E5CA13A6E2EC2) /* 131 */, + W64LIT(0x8029927B75F5C361) /* 132 */, W64LIT(0xAD139FABC3D6E436) /* 133 */, + W64LIT(0x0D5DF1A94CCF402F) /* 134 */, W64LIT(0x3E8BD948BEA5DFC8) /* 135 */, + W64LIT(0xA5A0D357BD3FF77E) /* 136 */, W64LIT(0xA2D12E251F74F645) /* 137 */, + W64LIT(0x66FD9E525E81A082) /* 138 */, W64LIT(0x2E0C90CE7F687A49) /* 139 */, + W64LIT(0xC2E8BCBEBA973BC5) /* 140 */, W64LIT(0x000001BCE509745F) /* 141 */, + W64LIT(0x423777BBE6DAB3D6) /* 142 */, W64LIT(0xD1661C7EAEF06EB5) /* 143 */, + W64LIT(0xA1781F354DAACFD8) /* 144 */, W64LIT(0x2D11284A2B16AFFC) /* 145 */, + W64LIT(0xF1FC4F67FA891D1F) /* 146 */, W64LIT(0x73ECC25DCB920ADA) /* 147 */, + W64LIT(0xAE610C22C2A12651) /* 148 */, W64LIT(0x96E0A810D356B78A) /* 149 */, + W64LIT(0x5A9A381F2FE7870F) /* 150 */, W64LIT(0xD5AD62EDE94E5530) /* 151 */, + W64LIT(0xD225E5E8368D1427) /* 152 */, W64LIT(0x65977B70C7AF4631) /* 153 */, + W64LIT(0x99F889B2DE39D74F) /* 154 */, W64LIT(0x233F30BF54E1D143) /* 155 */, + W64LIT(0x9A9675D3D9A63C97) /* 156 */, W64LIT(0x5470554FF334F9A8) /* 157 */, + W64LIT(0x166ACB744A4F5688) /* 158 */, W64LIT(0x70C74CAAB2E4AEAD) /* 159 */, + W64LIT(0xF0D091646F294D12) /* 160 */, W64LIT(0x57B82A89684031D1) /* 161 */, + W64LIT(0xEFD95A5A61BE0B6B) /* 162 */, W64LIT(0x2FBD12E969F2F29A) /* 163 */, + W64LIT(0x9BD37013FEFF9FE8) /* 164 */, W64LIT(0x3F9B0404D6085A06) /* 165 */, + W64LIT(0x4940C1F3166CFE15) /* 166 */, W64LIT(0x09542C4DCDF3DEFB) /* 167 */, + W64LIT(0xB4C5218385CD5CE3) /* 168 */, W64LIT(0xC935B7DC4462A641) /* 169 */, + W64LIT(0x3417F8A68ED3B63F) /* 170 */, W64LIT(0xB80959295B215B40) /* 171 */, + W64LIT(0xF99CDAEF3B8C8572) /* 172 */, W64LIT(0x018C0614F8FCB95D) /* 173 */, + W64LIT(0x1B14ACCD1A3ACDF3) /* 174 */, W64LIT(0x84D471F200BB732D) /* 175 */, + W64LIT(0xC1A3110E95E8DA16) /* 176 */, W64LIT(0x430A7220BF1A82B8) /* 177 */, + W64LIT(0xB77E090D39DF210E) /* 178 */, W64LIT(0x5EF4BD9F3CD05E9D) /* 179 */, + W64LIT(0x9D4FF6DA7E57A444) /* 180 */, W64LIT(0xDA1D60E183D4A5F8) /* 181 */, + W64LIT(0xB287C38417998E47) /* 182 */, W64LIT(0xFE3EDC121BB31886) /* 183 */, + W64LIT(0xC7FE3CCC980CCBEF) /* 184 */, W64LIT(0xE46FB590189BFD03) /* 185 */, + W64LIT(0x3732FD469A4C57DC) /* 186 */, W64LIT(0x7EF700A07CF1AD65) /* 187 */, + W64LIT(0x59C64468A31D8859) /* 188 */, W64LIT(0x762FB0B4D45B61F6) /* 189 */, + W64LIT(0x155BAED099047718) /* 190 */, W64LIT(0x68755E4C3D50BAA6) /* 191 */, + W64LIT(0xE9214E7F22D8B4DF) /* 192 */, W64LIT(0x2ADDBF532EAC95F4) /* 193 */, + W64LIT(0x32AE3909B4BD0109) /* 194 */, W64LIT(0x834DF537B08E3450) /* 195 */, + W64LIT(0xFA209DA84220728D) /* 196 */, W64LIT(0x9E691D9B9EFE23F7) /* 197 */, + W64LIT(0x0446D288C4AE8D7F) /* 198 */, W64LIT(0x7B4CC524E169785B) /* 199 */, + W64LIT(0x21D87F0135CA1385) /* 200 */, W64LIT(0xCEBB400F137B8AA5) /* 201 */, + W64LIT(0x272E2B66580796BE) /* 202 */, W64LIT(0x3612264125C2B0DE) /* 203 */, + W64LIT(0x057702BDAD1EFBB2) /* 204 */, W64LIT(0xD4BABB8EACF84BE9) /* 205 */, + W64LIT(0x91583139641BC67B) /* 206 */, W64LIT(0x8BDC2DE08036E024) /* 207 */, + W64LIT(0x603C8156F49F68ED) /* 208 */, W64LIT(0xF7D236F7DBEF5111) /* 209 */, + W64LIT(0x9727C4598AD21E80) /* 210 */, W64LIT(0xA08A0896670A5FD7) /* 211 */, + W64LIT(0xCB4A8F4309EBA9CB) /* 212 */, W64LIT(0x81AF564B0F7036A1) /* 213 */, + W64LIT(0xC0B99AA778199ABD) /* 214 */, W64LIT(0x959F1EC83FC8E952) /* 215 */, + W64LIT(0x8C505077794A81B9) /* 216 */, W64LIT(0x3ACAAF8F056338F0) /* 217 */, + W64LIT(0x07B43F50627A6778) /* 218 */, W64LIT(0x4A44AB49F5ECCC77) /* 219 */, + W64LIT(0x3BC3D6E4B679EE98) /* 220 */, W64LIT(0x9CC0D4D1CF14108C) /* 221 */, + W64LIT(0x4406C00B206BC8A0) /* 222 */, W64LIT(0x82A18854C8D72D89) /* 223 */, + W64LIT(0x67E366B35C3C432C) /* 224 */, W64LIT(0xB923DD61102B37F2) /* 225 */, + W64LIT(0x56AB2779D884271D) /* 226 */, W64LIT(0xBE83E1B0FF1525AF) /* 227 */, + W64LIT(0xFB7C65D4217E49A9) /* 228 */, W64LIT(0x6BDBE0E76D48E7D4) /* 229 */, + W64LIT(0x08DF828745D9179E) /* 230 */, W64LIT(0x22EA6A9ADD53BD34) /* 231 */, + W64LIT(0xE36E141C5622200A) /* 232 */, W64LIT(0x7F805D1B8CB750EE) /* 233 */, + W64LIT(0xAFE5C7A59F58E837) /* 234 */, W64LIT(0xE27F996A4FB1C23C) /* 235 */, + W64LIT(0xD3867DFB0775F0D0) /* 236 */, W64LIT(0xD0E673DE6E88891A) /* 237 */, + W64LIT(0x123AEB9EAFB86C25) /* 238 */, W64LIT(0x30F1D5D5C145B895) /* 239 */, + W64LIT(0xBB434A2DEE7269E7) /* 240 */, W64LIT(0x78CB67ECF931FA38) /* 241 */, + W64LIT(0xF33B0372323BBF9C) /* 242 */, W64LIT(0x52D66336FB279C74) /* 243 */, + W64LIT(0x505F33AC0AFB4EAA) /* 244 */, W64LIT(0xE8A5CD99A2CCE187) /* 245 */, + W64LIT(0x534974801E2D30BB) /* 246 */, W64LIT(0x8D2D5711D5876D90) /* 247 */, + W64LIT(0x1F1A412891BC038E) /* 248 */, W64LIT(0xD6E2E71D82E56648) /* 249 */, + W64LIT(0x74036C3A497732B7) /* 250 */, W64LIT(0x89B67ED96361F5AB) /* 251 */, + W64LIT(0xFFED95D8F1EA02A2) /* 252 */, W64LIT(0xE72B3BD61464D43D) /* 253 */, + W64LIT(0xA6300F170BDC4820) /* 254 */, W64LIT(0xEBC18760ED78A77A) /* 255 */, + W64LIT(0xE6A6BE5A05A12138) /* 256 */, W64LIT(0xB5A122A5B4F87C98) /* 257 */, + W64LIT(0x563C6089140B6990) /* 258 */, W64LIT(0x4C46CB2E391F5DD5) /* 259 */, + W64LIT(0xD932ADDBC9B79434) /* 260 */, W64LIT(0x08EA70E42015AFF5) /* 261 */, + W64LIT(0xD765A6673E478CF1) /* 262 */, W64LIT(0xC4FB757EAB278D99) /* 263 */, + W64LIT(0xDF11C6862D6E0692) /* 264 */, W64LIT(0xDDEB84F10D7F3B16) /* 265 */, + W64LIT(0x6F2EF604A665EA04) /* 266 */, W64LIT(0x4A8E0F0FF0E0DFB3) /* 267 */, + W64LIT(0xA5EDEEF83DBCBA51) /* 268 */, W64LIT(0xFC4F0A2A0EA4371E) /* 269 */, + W64LIT(0xE83E1DA85CB38429) /* 270 */, W64LIT(0xDC8FF882BA1B1CE2) /* 271 */, + W64LIT(0xCD45505E8353E80D) /* 272 */, W64LIT(0x18D19A00D4DB0717) /* 273 */, + W64LIT(0x34A0CFEDA5F38101) /* 274 */, W64LIT(0x0BE77E518887CAF2) /* 275 */, + W64LIT(0x1E341438B3C45136) /* 276 */, W64LIT(0xE05797F49089CCF9) /* 277 */, + W64LIT(0xFFD23F9DF2591D14) /* 278 */, W64LIT(0x543DDA228595C5CD) /* 279 */, + W64LIT(0x661F81FD99052A33) /* 280 */, W64LIT(0x8736E641DB0F7B76) /* 281 */, + W64LIT(0x15227725418E5307) /* 282 */, W64LIT(0xE25F7F46162EB2FA) /* 283 */, + W64LIT(0x48A8B2126C13D9FE) /* 284 */, W64LIT(0xAFDC541792E76EEA) /* 285 */, + W64LIT(0x03D912BFC6D1898F) /* 286 */, W64LIT(0x31B1AAFA1B83F51B) /* 287 */, + W64LIT(0xF1AC2796E42AB7D9) /* 288 */, W64LIT(0x40A3A7D7FCD2EBAC) /* 289 */, + W64LIT(0x1056136D0AFBBCC5) /* 290 */, W64LIT(0x7889E1DD9A6D0C85) /* 291 */, + W64LIT(0xD33525782A7974AA) /* 292 */, W64LIT(0xA7E25D09078AC09B) /* 293 */, + W64LIT(0xBD4138B3EAC6EDD0) /* 294 */, W64LIT(0x920ABFBE71EB9E70) /* 295 */, + W64LIT(0xA2A5D0F54FC2625C) /* 296 */, W64LIT(0xC054E36B0B1290A3) /* 297 */, + W64LIT(0xF6DD59FF62FE932B) /* 298 */, W64LIT(0x3537354511A8AC7D) /* 299 */, + W64LIT(0xCA845E9172FADCD4) /* 300 */, W64LIT(0x84F82B60329D20DC) /* 301 */, + W64LIT(0x79C62CE1CD672F18) /* 302 */, W64LIT(0x8B09A2ADD124642C) /* 303 */, + W64LIT(0xD0C1E96A19D9E726) /* 304 */, W64LIT(0x5A786A9B4BA9500C) /* 305 */, + W64LIT(0x0E020336634C43F3) /* 306 */, W64LIT(0xC17B474AEB66D822) /* 307 */, + W64LIT(0x6A731AE3EC9BAAC2) /* 308 */, W64LIT(0x8226667AE0840258) /* 309 */, + W64LIT(0x67D4567691CAECA5) /* 310 */, W64LIT(0x1D94155C4875ADB5) /* 311 */, + W64LIT(0x6D00FD985B813FDF) /* 312 */, W64LIT(0x51286EFCB774CD06) /* 313 */, + W64LIT(0x5E8834471FA744AF) /* 314 */, W64LIT(0xF72CA0AEE761AE2E) /* 315 */, + W64LIT(0xBE40E4CDAEE8E09A) /* 316 */, W64LIT(0xE9970BBB5118F665) /* 317 */, + W64LIT(0x726E4BEB33DF1964) /* 318 */, W64LIT(0x703B000729199762) /* 319 */, + W64LIT(0x4631D816F5EF30A7) /* 320 */, W64LIT(0xB880B5B51504A6BE) /* 321 */, + W64LIT(0x641793C37ED84B6C) /* 322 */, W64LIT(0x7B21ED77F6E97D96) /* 323 */, + W64LIT(0x776306312EF96B73) /* 324 */, W64LIT(0xAE528948E86FF3F4) /* 325 */, + W64LIT(0x53DBD7F286A3F8F8) /* 326 */, W64LIT(0x16CADCE74CFC1063) /* 327 */, + W64LIT(0x005C19BDFA52C6DD) /* 328 */, W64LIT(0x68868F5D64D46AD3) /* 329 */, + W64LIT(0x3A9D512CCF1E186A) /* 330 */, W64LIT(0x367E62C2385660AE) /* 331 */, + W64LIT(0xE359E7EA77DCB1D7) /* 332 */, W64LIT(0x526C0773749ABE6E) /* 333 */, + W64LIT(0x735AE5F9D09F734B) /* 334 */, W64LIT(0x493FC7CC8A558BA8) /* 335 */, + W64LIT(0xB0B9C1533041AB45) /* 336 */, W64LIT(0x321958BA470A59BD) /* 337 */, + W64LIT(0x852DB00B5F46C393) /* 338 */, W64LIT(0x91209B2BD336B0E5) /* 339 */, + W64LIT(0x6E604F7D659EF19F) /* 340 */, W64LIT(0xB99A8AE2782CCB24) /* 341 */, + W64LIT(0xCCF52AB6C814C4C7) /* 342 */, W64LIT(0x4727D9AFBE11727B) /* 343 */, + W64LIT(0x7E950D0C0121B34D) /* 344 */, W64LIT(0x756F435670AD471F) /* 345 */, + W64LIT(0xF5ADD442615A6849) /* 346 */, W64LIT(0x4E87E09980B9957A) /* 347 */, + W64LIT(0x2ACFA1DF50AEE355) /* 348 */, W64LIT(0xD898263AFD2FD556) /* 349 */, + W64LIT(0xC8F4924DD80C8FD6) /* 350 */, W64LIT(0xCF99CA3D754A173A) /* 351 */, + W64LIT(0xFE477BACAF91BF3C) /* 352 */, W64LIT(0xED5371F6D690C12D) /* 353 */, + W64LIT(0x831A5C285E687094) /* 354 */, W64LIT(0xC5D3C90A3708A0A4) /* 355 */, + W64LIT(0x0F7F903717D06580) /* 356 */, W64LIT(0x19F9BB13B8FDF27F) /* 357 */, + W64LIT(0xB1BD6F1B4D502843) /* 358 */, W64LIT(0x1C761BA38FFF4012) /* 359 */, + W64LIT(0x0D1530C4E2E21F3B) /* 360 */, W64LIT(0x8943CE69A7372C8A) /* 361 */, + W64LIT(0xE5184E11FEB5CE66) /* 362 */, W64LIT(0x618BDB80BD736621) /* 363 */, + W64LIT(0x7D29BAD68B574D0B) /* 364 */, W64LIT(0x81BB613E25E6FE5B) /* 365 */, + W64LIT(0x071C9C10BC07913F) /* 366 */, W64LIT(0xC7BEEB7909AC2D97) /* 367 */, + W64LIT(0xC3E58D353BC5D757) /* 368 */, W64LIT(0xEB017892F38F61E8) /* 369 */, + W64LIT(0xD4EFFB9C9B1CC21A) /* 370 */, W64LIT(0x99727D26F494F7AB) /* 371 */, + W64LIT(0xA3E063A2956B3E03) /* 372 */, W64LIT(0x9D4A8B9A4AA09C30) /* 373 */, + W64LIT(0x3F6AB7D500090FB4) /* 374 */, W64LIT(0x9CC0F2A057268AC0) /* 375 */, + W64LIT(0x3DEE9D2DEDBF42D1) /* 376 */, W64LIT(0x330F49C87960A972) /* 377 */, + W64LIT(0xC6B2720287421B41) /* 378 */, W64LIT(0x0AC59EC07C00369C) /* 379 */, + W64LIT(0xEF4EAC49CB353425) /* 380 */, W64LIT(0xF450244EEF0129D8) /* 381 */, + W64LIT(0x8ACC46E5CAF4DEB6) /* 382 */, W64LIT(0x2FFEAB63989263F7) /* 383 */, + W64LIT(0x8F7CB9FE5D7A4578) /* 384 */, W64LIT(0x5BD8F7644E634635) /* 385 */, + W64LIT(0x427A7315BF2DC900) /* 386 */, W64LIT(0x17D0C4AA2125261C) /* 387 */, + W64LIT(0x3992486C93518E50) /* 388 */, W64LIT(0xB4CBFEE0A2D7D4C3) /* 389 */, + W64LIT(0x7C75D6202C5DDD8D) /* 390 */, W64LIT(0xDBC295D8E35B6C61) /* 391 */, + W64LIT(0x60B369D302032B19) /* 392 */, W64LIT(0xCE42685FDCE44132) /* 393 */, + W64LIT(0x06F3DDB9DDF65610) /* 394 */, W64LIT(0x8EA4D21DB5E148F0) /* 395 */, + W64LIT(0x20B0FCE62FCD496F) /* 396 */, W64LIT(0x2C1B912358B0EE31) /* 397 */, + W64LIT(0xB28317B818F5A308) /* 398 */, W64LIT(0xA89C1E189CA6D2CF) /* 399 */, + W64LIT(0x0C6B18576AAADBC8) /* 400 */, W64LIT(0xB65DEAA91299FAE3) /* 401 */, + W64LIT(0xFB2B794B7F1027E7) /* 402 */, W64LIT(0x04E4317F443B5BEB) /* 403 */, + W64LIT(0x4B852D325939D0A6) /* 404 */, W64LIT(0xD5AE6BEEFB207FFC) /* 405 */, + W64LIT(0x309682B281C7D374) /* 406 */, W64LIT(0xBAE309A194C3B475) /* 407 */, + W64LIT(0x8CC3F97B13B49F05) /* 408 */, W64LIT(0x98A9422FF8293967) /* 409 */, + W64LIT(0x244B16B01076FF7C) /* 410 */, W64LIT(0xF8BF571C663D67EE) /* 411 */, + W64LIT(0x1F0D6758EEE30DA1) /* 412 */, W64LIT(0xC9B611D97ADEB9B7) /* 413 */, + W64LIT(0xB7AFD5887B6C57A2) /* 414 */, W64LIT(0x6290AE846B984FE1) /* 415 */, + W64LIT(0x94DF4CDEACC1A5FD) /* 416 */, W64LIT(0x058A5BD1C5483AFF) /* 417 */, + W64LIT(0x63166CC142BA3C37) /* 418 */, W64LIT(0x8DB8526EB2F76F40) /* 419 */, + W64LIT(0xE10880036F0D6D4E) /* 420 */, W64LIT(0x9E0523C9971D311D) /* 421 */, + W64LIT(0x45EC2824CC7CD691) /* 422 */, W64LIT(0x575B8359E62382C9) /* 423 */, + W64LIT(0xFA9E400DC4889995) /* 424 */, W64LIT(0xD1823ECB45721568) /* 425 */, + W64LIT(0xDAFD983B8206082F) /* 426 */, W64LIT(0xAA7D29082386A8CB) /* 427 */, + W64LIT(0x269FCD4403B87588) /* 428 */, W64LIT(0x1B91F5F728BDD1E0) /* 429 */, + W64LIT(0xE4669F39040201F6) /* 430 */, W64LIT(0x7A1D7C218CF04ADE) /* 431 */, + W64LIT(0x65623C29D79CE5CE) /* 432 */, W64LIT(0x2368449096C00BB1) /* 433 */, + W64LIT(0xAB9BF1879DA503BA) /* 434 */, W64LIT(0xBC23ECB1A458058E) /* 435 */, + W64LIT(0x9A58DF01BB401ECC) /* 436 */, W64LIT(0xA070E868A85F143D) /* 437 */, + W64LIT(0x4FF188307DF2239E) /* 438 */, W64LIT(0x14D565B41A641183) /* 439 */, + W64LIT(0xEE13337452701602) /* 440 */, W64LIT(0x950E3DCF3F285E09) /* 441 */, + W64LIT(0x59930254B9C80953) /* 442 */, W64LIT(0x3BF299408930DA6D) /* 443 */, + W64LIT(0xA955943F53691387) /* 444 */, W64LIT(0xA15EDECAA9CB8784) /* 445 */, + W64LIT(0x29142127352BE9A0) /* 446 */, W64LIT(0x76F0371FFF4E7AFB) /* 447 */, + W64LIT(0x0239F450274F2228) /* 448 */, W64LIT(0xBB073AF01D5E868B) /* 449 */, + W64LIT(0xBFC80571C10E96C1) /* 450 */, W64LIT(0xD267088568222E23) /* 451 */, + W64LIT(0x9671A3D48E80B5B0) /* 452 */, W64LIT(0x55B5D38AE193BB81) /* 453 */, + W64LIT(0x693AE2D0A18B04B8) /* 454 */, W64LIT(0x5C48B4ECADD5335F) /* 455 */, + W64LIT(0xFD743B194916A1CA) /* 456 */, W64LIT(0x2577018134BE98C4) /* 457 */, + W64LIT(0xE77987E83C54A4AD) /* 458 */, W64LIT(0x28E11014DA33E1B9) /* 459 */, + W64LIT(0x270CC59E226AA213) /* 460 */, W64LIT(0x71495F756D1A5F60) /* 461 */, + W64LIT(0x9BE853FB60AFEF77) /* 462 */, W64LIT(0xADC786A7F7443DBF) /* 463 */, + W64LIT(0x0904456173B29A82) /* 464 */, W64LIT(0x58BC7A66C232BD5E) /* 465 */, + W64LIT(0xF306558C673AC8B2) /* 466 */, W64LIT(0x41F639C6B6C9772A) /* 467 */, + W64LIT(0x216DEFE99FDA35DA) /* 468 */, W64LIT(0x11640CC71C7BE615) /* 469 */, + W64LIT(0x93C43694565C5527) /* 470 */, W64LIT(0xEA038E6246777839) /* 471 */, + W64LIT(0xF9ABF3CE5A3E2469) /* 472 */, W64LIT(0x741E768D0FD312D2) /* 473 */, + W64LIT(0x0144B883CED652C6) /* 474 */, W64LIT(0xC20B5A5BA33F8552) /* 475 */, + W64LIT(0x1AE69633C3435A9D) /* 476 */, W64LIT(0x97A28CA4088CFDEC) /* 477 */, + W64LIT(0x8824A43C1E96F420) /* 478 */, W64LIT(0x37612FA66EEEA746) /* 479 */, + W64LIT(0x6B4CB165F9CF0E5A) /* 480 */, W64LIT(0x43AA1C06A0ABFB4A) /* 481 */, + W64LIT(0x7F4DC26FF162796B) /* 482 */, W64LIT(0x6CBACC8E54ED9B0F) /* 483 */, + W64LIT(0xA6B7FFEFD2BB253E) /* 484 */, W64LIT(0x2E25BC95B0A29D4F) /* 485 */, + W64LIT(0x86D6A58BDEF1388C) /* 486 */, W64LIT(0xDED74AC576B6F054) /* 487 */, + W64LIT(0x8030BDBC2B45805D) /* 488 */, W64LIT(0x3C81AF70E94D9289) /* 489 */, + W64LIT(0x3EFF6DDA9E3100DB) /* 490 */, W64LIT(0xB38DC39FDFCC8847) /* 491 */, + W64LIT(0x123885528D17B87E) /* 492 */, W64LIT(0xF2DA0ED240B1B642) /* 493 */, + W64LIT(0x44CEFADCD54BF9A9) /* 494 */, W64LIT(0x1312200E433C7EE6) /* 495 */, + W64LIT(0x9FFCC84F3A78C748) /* 496 */, W64LIT(0xF0CD1F72248576BB) /* 497 */, + W64LIT(0xEC6974053638CFE4) /* 498 */, W64LIT(0x2BA7B67C0CEC4E4C) /* 499 */, + W64LIT(0xAC2F4DF3E5CE32ED) /* 500 */, W64LIT(0xCB33D14326EA4C11) /* 501 */, + W64LIT(0xA4E9044CC77E58BC) /* 502 */, W64LIT(0x5F513293D934FCEF) /* 503 */, + W64LIT(0x5DC9645506E55444) /* 504 */, W64LIT(0x50DE418F317DE40A) /* 505 */, + W64LIT(0x388CB31A69DDE259) /* 506 */, W64LIT(0x2DB4A83455820A86) /* 507 */, + W64LIT(0x9010A91E84711AE9) /* 508 */, W64LIT(0x4DF7F0B7B1498371) /* 509 */, + W64LIT(0xD62A2EABC0977179) /* 510 */, W64LIT(0x22FAC097AA8D5C0E) /* 511 */, + W64LIT(0xF49FCC2FF1DAF39B) /* 512 */, W64LIT(0x487FD5C66FF29281) /* 513 */, + W64LIT(0xE8A30667FCDCA83F) /* 514 */, W64LIT(0x2C9B4BE3D2FCCE63) /* 515 */, + W64LIT(0xDA3FF74B93FBBBC2) /* 516 */, W64LIT(0x2FA165D2FE70BA66) /* 517 */, + W64LIT(0xA103E279970E93D4) /* 518 */, W64LIT(0xBECDEC77B0E45E71) /* 519 */, + W64LIT(0xCFB41E723985E497) /* 520 */, W64LIT(0xB70AAA025EF75017) /* 521 */, + W64LIT(0xD42309F03840B8E0) /* 522 */, W64LIT(0x8EFC1AD035898579) /* 523 */, + W64LIT(0x96C6920BE2B2ABC5) /* 524 */, W64LIT(0x66AF4163375A9172) /* 525 */, + W64LIT(0x2174ABDCCA7127FB) /* 526 */, W64LIT(0xB33CCEA64A72FF41) /* 527 */, + W64LIT(0xF04A4933083066A5) /* 528 */, W64LIT(0x8D970ACDD7289AF5) /* 529 */, + W64LIT(0x8F96E8E031C8C25E) /* 530 */, W64LIT(0xF3FEC02276875D47) /* 531 */, + W64LIT(0xEC7BF310056190DD) /* 532 */, W64LIT(0xF5ADB0AEBB0F1491) /* 533 */, + W64LIT(0x9B50F8850FD58892) /* 534 */, W64LIT(0x4975488358B74DE8) /* 535 */, + W64LIT(0xA3354FF691531C61) /* 536 */, W64LIT(0x0702BBE481D2C6EE) /* 537 */, + W64LIT(0x89FB24057DEDED98) /* 538 */, W64LIT(0xAC3075138596E902) /* 539 */, + W64LIT(0x1D2D3580172772ED) /* 540 */, W64LIT(0xEB738FC28E6BC30D) /* 541 */, + W64LIT(0x5854EF8F63044326) /* 542 */, W64LIT(0x9E5C52325ADD3BBE) /* 543 */, + W64LIT(0x90AA53CF325C4623) /* 544 */, W64LIT(0xC1D24D51349DD067) /* 545 */, + W64LIT(0x2051CFEEA69EA624) /* 546 */, W64LIT(0x13220F0A862E7E4F) /* 547 */, + W64LIT(0xCE39399404E04864) /* 548 */, W64LIT(0xD9C42CA47086FCB7) /* 549 */, + W64LIT(0x685AD2238A03E7CC) /* 550 */, W64LIT(0x066484B2AB2FF1DB) /* 551 */, + W64LIT(0xFE9D5D70EFBF79EC) /* 552 */, W64LIT(0x5B13B9DD9C481854) /* 553 */, + W64LIT(0x15F0D475ED1509AD) /* 554 */, W64LIT(0x0BEBCD060EC79851) /* 555 */, + W64LIT(0xD58C6791183AB7F8) /* 556 */, W64LIT(0xD1187C5052F3EEE4) /* 557 */, + W64LIT(0xC95D1192E54E82FF) /* 558 */, W64LIT(0x86EEA14CB9AC6CA2) /* 559 */, + W64LIT(0x3485BEB153677D5D) /* 560 */, W64LIT(0xDD191D781F8C492A) /* 561 */, + W64LIT(0xF60866BAA784EBF9) /* 562 */, W64LIT(0x518F643BA2D08C74) /* 563 */, + W64LIT(0x8852E956E1087C22) /* 564 */, W64LIT(0xA768CB8DC410AE8D) /* 565 */, + W64LIT(0x38047726BFEC8E1A) /* 566 */, W64LIT(0xA67738B4CD3B45AA) /* 567 */, + W64LIT(0xAD16691CEC0DDE19) /* 568 */, W64LIT(0xC6D4319380462E07) /* 569 */, + W64LIT(0xC5A5876D0BA61938) /* 570 */, W64LIT(0x16B9FA1FA58FD840) /* 571 */, + W64LIT(0x188AB1173CA74F18) /* 572 */, W64LIT(0xABDA2F98C99C021F) /* 573 */, + W64LIT(0x3E0580AB134AE816) /* 574 */, W64LIT(0x5F3B05B773645ABB) /* 575 */, + W64LIT(0x2501A2BE5575F2F6) /* 576 */, W64LIT(0x1B2F74004E7E8BA9) /* 577 */, + W64LIT(0x1CD7580371E8D953) /* 578 */, W64LIT(0x7F6ED89562764E30) /* 579 */, + W64LIT(0xB15926FF596F003D) /* 580 */, W64LIT(0x9F65293DA8C5D6B9) /* 581 */, + W64LIT(0x6ECEF04DD690F84C) /* 582 */, W64LIT(0x4782275FFF33AF88) /* 583 */, + W64LIT(0xE41433083F820801) /* 584 */, W64LIT(0xFD0DFE409A1AF9B5) /* 585 */, + W64LIT(0x4325A3342CDB396B) /* 586 */, W64LIT(0x8AE77E62B301B252) /* 587 */, + W64LIT(0xC36F9E9F6655615A) /* 588 */, W64LIT(0x85455A2D92D32C09) /* 589 */, + W64LIT(0xF2C7DEA949477485) /* 590 */, W64LIT(0x63CFB4C133A39EBA) /* 591 */, + W64LIT(0x83B040CC6EBC5462) /* 592 */, W64LIT(0x3B9454C8FDB326B0) /* 593 */, + W64LIT(0x56F56A9E87FFD78C) /* 594 */, W64LIT(0x2DC2940D99F42BC6) /* 595 */, + W64LIT(0x98F7DF096B096E2D) /* 596 */, W64LIT(0x19A6E01E3AD852BF) /* 597 */, + W64LIT(0x42A99CCBDBD4B40B) /* 598 */, W64LIT(0xA59998AF45E9C559) /* 599 */, + W64LIT(0x366295E807D93186) /* 600 */, W64LIT(0x6B48181BFAA1F773) /* 601 */, + W64LIT(0x1FEC57E2157A0A1D) /* 602 */, W64LIT(0x4667446AF6201AD5) /* 603 */, + W64LIT(0xE615EBCACFB0F075) /* 604 */, W64LIT(0xB8F31F4F68290778) /* 605 */, + W64LIT(0x22713ED6CE22D11E) /* 606 */, W64LIT(0x3057C1A72EC3C93B) /* 607 */, + W64LIT(0xCB46ACC37C3F1F2F) /* 608 */, W64LIT(0xDBB893FD02AAF50E) /* 609 */, + W64LIT(0x331FD92E600B9FCF) /* 610 */, W64LIT(0xA498F96148EA3AD6) /* 611 */, + W64LIT(0xA8D8426E8B6A83EA) /* 612 */, W64LIT(0xA089B274B7735CDC) /* 613 */, + W64LIT(0x87F6B3731E524A11) /* 614 */, W64LIT(0x118808E5CBC96749) /* 615 */, + W64LIT(0x9906E4C7B19BD394) /* 616 */, W64LIT(0xAFED7F7E9B24A20C) /* 617 */, + W64LIT(0x6509EADEEB3644A7) /* 618 */, W64LIT(0x6C1EF1D3E8EF0EDE) /* 619 */, + W64LIT(0xB9C97D43E9798FB4) /* 620 */, W64LIT(0xA2F2D784740C28A3) /* 621 */, + W64LIT(0x7B8496476197566F) /* 622 */, W64LIT(0x7A5BE3E6B65F069D) /* 623 */, + W64LIT(0xF96330ED78BE6F10) /* 624 */, W64LIT(0xEEE60DE77A076A15) /* 625 */, + W64LIT(0x2B4BEE4AA08B9BD0) /* 626 */, W64LIT(0x6A56A63EC7B8894E) /* 627 */, + W64LIT(0x02121359BA34FEF4) /* 628 */, W64LIT(0x4CBF99F8283703FC) /* 629 */, + W64LIT(0x398071350CAF30C8) /* 630 */, W64LIT(0xD0A77A89F017687A) /* 631 */, + W64LIT(0xF1C1A9EB9E423569) /* 632 */, W64LIT(0x8C7976282DEE8199) /* 633 */, + W64LIT(0x5D1737A5DD1F7ABD) /* 634 */, W64LIT(0x4F53433C09A9FA80) /* 635 */, + W64LIT(0xFA8B0C53DF7CA1D9) /* 636 */, W64LIT(0x3FD9DCBC886CCB77) /* 637 */, + W64LIT(0xC040917CA91B4720) /* 638 */, W64LIT(0x7DD00142F9D1DCDF) /* 639 */, + W64LIT(0x8476FC1D4F387B58) /* 640 */, W64LIT(0x23F8E7C5F3316503) /* 641 */, + W64LIT(0x032A2244E7E37339) /* 642 */, W64LIT(0x5C87A5D750F5A74B) /* 643 */, + W64LIT(0x082B4CC43698992E) /* 644 */, W64LIT(0xDF917BECB858F63C) /* 645 */, + W64LIT(0x3270B8FC5BF86DDA) /* 646 */, W64LIT(0x10AE72BB29B5DD76) /* 647 */, + W64LIT(0x576AC94E7700362B) /* 648 */, W64LIT(0x1AD112DAC61EFB8F) /* 649 */, + W64LIT(0x691BC30EC5FAA427) /* 650 */, W64LIT(0xFF246311CC327143) /* 651 */, + W64LIT(0x3142368E30E53206) /* 652 */, W64LIT(0x71380E31E02CA396) /* 653 */, + W64LIT(0x958D5C960AAD76F1) /* 654 */, W64LIT(0xF8D6F430C16DA536) /* 655 */, + W64LIT(0xC8FFD13F1BE7E1D2) /* 656 */, W64LIT(0x7578AE66004DDBE1) /* 657 */, + W64LIT(0x05833F01067BE646) /* 658 */, W64LIT(0xBB34B5AD3BFE586D) /* 659 */, + W64LIT(0x095F34C9A12B97F0) /* 660 */, W64LIT(0x247AB64525D60CA8) /* 661 */, + W64LIT(0xDCDBC6F3017477D1) /* 662 */, W64LIT(0x4A2E14D4DECAD24D) /* 663 */, + W64LIT(0xBDB5E6D9BE0A1EEB) /* 664 */, W64LIT(0x2A7E70F7794301AB) /* 665 */, + W64LIT(0xDEF42D8A270540FD) /* 666 */, W64LIT(0x01078EC0A34C22C1) /* 667 */, + W64LIT(0xE5DE511AF4C16387) /* 668 */, W64LIT(0x7EBB3A52BD9A330A) /* 669 */, + W64LIT(0x77697857AA7D6435) /* 670 */, W64LIT(0x004E831603AE4C32) /* 671 */, + W64LIT(0xE7A21020AD78E312) /* 672 */, W64LIT(0x9D41A70C6AB420F2) /* 673 */, + W64LIT(0x28E06C18EA1141E6) /* 674 */, W64LIT(0xD2B28CBD984F6B28) /* 675 */, + W64LIT(0x26B75F6C446E9D83) /* 676 */, W64LIT(0xBA47568C4D418D7F) /* 677 */, + W64LIT(0xD80BADBFE6183D8E) /* 678 */, W64LIT(0x0E206D7F5F166044) /* 679 */, + W64LIT(0xE258A43911CBCA3E) /* 680 */, W64LIT(0x723A1746B21DC0BC) /* 681 */, + W64LIT(0xC7CAA854F5D7CDD3) /* 682 */, W64LIT(0x7CAC32883D261D9C) /* 683 */, + W64LIT(0x7690C26423BA942C) /* 684 */, W64LIT(0x17E55524478042B8) /* 685 */, + W64LIT(0xE0BE477656A2389F) /* 686 */, W64LIT(0x4D289B5E67AB2DA0) /* 687 */, + W64LIT(0x44862B9C8FBBFD31) /* 688 */, W64LIT(0xB47CC8049D141365) /* 689 */, + W64LIT(0x822C1B362B91C793) /* 690 */, W64LIT(0x4EB14655FB13DFD8) /* 691 */, + W64LIT(0x1ECBBA0714E2A97B) /* 692 */, W64LIT(0x6143459D5CDE5F14) /* 693 */, + W64LIT(0x53A8FBF1D5F0AC89) /* 694 */, W64LIT(0x97EA04D81C5E5B00) /* 695 */, + W64LIT(0x622181A8D4FDB3F3) /* 696 */, W64LIT(0xE9BCD341572A1208) /* 697 */, + W64LIT(0x1411258643CCE58A) /* 698 */, W64LIT(0x9144C5FEA4C6E0A4) /* 699 */, + W64LIT(0x0D33D06565CF620F) /* 700 */, W64LIT(0x54A48D489F219CA1) /* 701 */, + W64LIT(0xC43E5EAC6D63C821) /* 702 */, W64LIT(0xA9728B3A72770DAF) /* 703 */, + W64LIT(0xD7934E7B20DF87EF) /* 704 */, W64LIT(0xE35503B61A3E86E5) /* 705 */, + W64LIT(0xCAE321FBC819D504) /* 706 */, W64LIT(0x129A50B3AC60BFA6) /* 707 */, + W64LIT(0xCD5E68EA7E9FB6C3) /* 708 */, W64LIT(0xB01C90199483B1C7) /* 709 */, + W64LIT(0x3DE93CD5C295376C) /* 710 */, W64LIT(0xAED52EDF2AB9AD13) /* 711 */, + W64LIT(0x2E60F512C0A07884) /* 712 */, W64LIT(0xBC3D86A3E36210C9) /* 713 */, + W64LIT(0x35269D9B163951CE) /* 714 */, W64LIT(0x0C7D6E2AD0CDB5FA) /* 715 */, + W64LIT(0x59E86297D87F5733) /* 716 */, W64LIT(0x298EF221898DB0E7) /* 717 */, + W64LIT(0x55000029D1A5AA7E) /* 718 */, W64LIT(0x8BC08AE1B5061B45) /* 719 */, + W64LIT(0xC2C31C2B6C92703A) /* 720 */, W64LIT(0x94CC596BAF25EF42) /* 721 */, + W64LIT(0x0A1D73DB22540456) /* 722 */, W64LIT(0x04B6A0F9D9C4179A) /* 723 */, + W64LIT(0xEFFDAFA2AE3D3C60) /* 724 */, W64LIT(0xF7C8075BB49496C4) /* 725 */, + W64LIT(0x9CC5C7141D1CD4E3) /* 726 */, W64LIT(0x78BD1638218E5534) /* 727 */, + W64LIT(0xB2F11568F850246A) /* 728 */, W64LIT(0xEDFABCFA9502BC29) /* 729 */, + W64LIT(0x796CE5F2DA23051B) /* 730 */, W64LIT(0xAAE128B0DC93537C) /* 731 */, + W64LIT(0x3A493DA0EE4B29AE) /* 732 */, W64LIT(0xB5DF6B2C416895D7) /* 733 */, + W64LIT(0xFCABBD25122D7F37) /* 734 */, W64LIT(0x70810B58105DC4B1) /* 735 */, + W64LIT(0xE10FDD37F7882A90) /* 736 */, W64LIT(0x524DCAB5518A3F5C) /* 737 */, + W64LIT(0x3C9E85878451255B) /* 738 */, W64LIT(0x4029828119BD34E2) /* 739 */, + W64LIT(0x74A05B6F5D3CECCB) /* 740 */, W64LIT(0xB610021542E13ECA) /* 741 */, + W64LIT(0x0FF979D12F59E2AC) /* 742 */, W64LIT(0x6037DA27E4F9CC50) /* 743 */, + W64LIT(0x5E92975A0DF1847D) /* 744 */, W64LIT(0xD66DE190D3E623FE) /* 745 */, + W64LIT(0x5032D6B87B568048) /* 746 */, W64LIT(0x9A36B7CE8235216E) /* 747 */, + W64LIT(0x80272A7A24F64B4A) /* 748 */, W64LIT(0x93EFED8B8C6916F7) /* 749 */, + W64LIT(0x37DDBFF44CCE1555) /* 750 */, W64LIT(0x4B95DB5D4B99BD25) /* 751 */, + W64LIT(0x92D3FDA169812FC0) /* 752 */, W64LIT(0xFB1A4A9A90660BB6) /* 753 */, + W64LIT(0x730C196946A4B9B2) /* 754 */, W64LIT(0x81E289AA7F49DA68) /* 755 */, + W64LIT(0x64669A0F83B1A05F) /* 756 */, W64LIT(0x27B3FF7D9644F48B) /* 757 */, + W64LIT(0xCC6B615C8DB675B3) /* 758 */, W64LIT(0x674F20B9BCEBBE95) /* 759 */, + W64LIT(0x6F31238275655982) /* 760 */, W64LIT(0x5AE488713E45CF05) /* 761 */, + W64LIT(0xBF619F9954C21157) /* 762 */, W64LIT(0xEABAC46040A8EAE9) /* 763 */, + W64LIT(0x454C6FE9F2C0C1CD) /* 764 */, W64LIT(0x419CF6496412691C) /* 765 */, + W64LIT(0xD3DC3BEF265B0F70) /* 766 */, W64LIT(0x6D0E60F5C3578A9E) /* 767 */, + W64LIT(0x5B0E608526323C55) /* 768 */, W64LIT(0x1A46C1A9FA1B59F5) /* 769 */, + W64LIT(0xA9E245A17C4C8FFA) /* 770 */, W64LIT(0x65CA5159DB2955D7) /* 771 */, + W64LIT(0x05DB0A76CE35AFC2) /* 772 */, W64LIT(0x81EAC77EA9113D45) /* 773 */, + W64LIT(0x528EF88AB6AC0A0D) /* 774 */, W64LIT(0xA09EA253597BE3FF) /* 775 */, + W64LIT(0x430DDFB3AC48CD56) /* 776 */, W64LIT(0xC4B3A67AF45CE46F) /* 777 */, + W64LIT(0x4ECECFD8FBE2D05E) /* 778 */, W64LIT(0x3EF56F10B39935F0) /* 779 */, + W64LIT(0x0B22D6829CD619C6) /* 780 */, W64LIT(0x17FD460A74DF2069) /* 781 */, + W64LIT(0x6CF8CC8E8510ED40) /* 782 */, W64LIT(0xD6C824BF3A6ECAA7) /* 783 */, + W64LIT(0x61243D581A817049) /* 784 */, W64LIT(0x048BACB6BBC163A2) /* 785 */, + W64LIT(0xD9A38AC27D44CC32) /* 786 */, W64LIT(0x7FDDFF5BAAF410AB) /* 787 */, + W64LIT(0xAD6D495AA804824B) /* 788 */, W64LIT(0xE1A6A74F2D8C9F94) /* 789 */, + W64LIT(0xD4F7851235DEE8E3) /* 790 */, W64LIT(0xFD4B7F886540D893) /* 791 */, + W64LIT(0x247C20042AA4BFDA) /* 792 */, W64LIT(0x096EA1C517D1327C) /* 793 */, + W64LIT(0xD56966B4361A6685) /* 794 */, W64LIT(0x277DA5C31221057D) /* 795 */, + W64LIT(0x94D59893A43ACFF7) /* 796 */, W64LIT(0x64F0C51CCDC02281) /* 797 */, + W64LIT(0x3D33BCC4FF6189DB) /* 798 */, W64LIT(0xE005CB184CE66AF1) /* 799 */, + W64LIT(0xFF5CCD1D1DB99BEA) /* 800 */, W64LIT(0xB0B854A7FE42980F) /* 801 */, + W64LIT(0x7BD46A6A718D4B9F) /* 802 */, W64LIT(0xD10FA8CC22A5FD8C) /* 803 */, + W64LIT(0xD31484952BE4BD31) /* 804 */, W64LIT(0xC7FA975FCB243847) /* 805 */, + W64LIT(0x4886ED1E5846C407) /* 806 */, W64LIT(0x28CDDB791EB70B04) /* 807 */, + W64LIT(0xC2B00BE2F573417F) /* 808 */, W64LIT(0x5C9590452180F877) /* 809 */, + W64LIT(0x7A6BDDFFF370EB00) /* 810 */, W64LIT(0xCE509E38D6D9D6A4) /* 811 */, + W64LIT(0xEBEB0F00647FA702) /* 812 */, W64LIT(0x1DCC06CF76606F06) /* 813 */, + W64LIT(0xE4D9F28BA286FF0A) /* 814 */, W64LIT(0xD85A305DC918C262) /* 815 */, + W64LIT(0x475B1D8732225F54) /* 816 */, W64LIT(0x2D4FB51668CCB5FE) /* 817 */, + W64LIT(0xA679B9D9D72BBA20) /* 818 */, W64LIT(0x53841C0D912D43A5) /* 819 */, + W64LIT(0x3B7EAA48BF12A4E8) /* 820 */, W64LIT(0x781E0E47F22F1DDF) /* 821 */, + W64LIT(0xEFF20CE60AB50973) /* 822 */, W64LIT(0x20D261D19DFFB742) /* 823 */, + W64LIT(0x16A12B03062A2E39) /* 824 */, W64LIT(0x1960EB2239650495) /* 825 */, + W64LIT(0x251C16FED50EB8B8) /* 826 */, W64LIT(0x9AC0C330F826016E) /* 827 */, + W64LIT(0xED152665953E7671) /* 828 */, W64LIT(0x02D63194A6369570) /* 829 */, + W64LIT(0x5074F08394B1C987) /* 830 */, W64LIT(0x70BA598C90B25CE1) /* 831 */, + W64LIT(0x794A15810B9742F6) /* 832 */, W64LIT(0x0D5925E9FCAF8C6C) /* 833 */, + W64LIT(0x3067716CD868744E) /* 834 */, W64LIT(0x910AB077E8D7731B) /* 835 */, + W64LIT(0x6A61BBDB5AC42F61) /* 836 */, W64LIT(0x93513EFBF0851567) /* 837 */, + W64LIT(0xF494724B9E83E9D5) /* 838 */, W64LIT(0xE887E1985C09648D) /* 839 */, + W64LIT(0x34B1D3C675370CFD) /* 840 */, W64LIT(0xDC35E433BC0D255D) /* 841 */, + W64LIT(0xD0AAB84234131BE0) /* 842 */, W64LIT(0x08042A50B48B7EAF) /* 843 */, + W64LIT(0x9997C4EE44A3AB35) /* 844 */, W64LIT(0x829A7B49201799D0) /* 845 */, + W64LIT(0x263B8307B7C54441) /* 846 */, W64LIT(0x752F95F4FD6A6CA6) /* 847 */, + W64LIT(0x927217402C08C6E5) /* 848 */, W64LIT(0x2A8AB754A795D9EE) /* 849 */, + W64LIT(0xA442F7552F72943D) /* 850 */, W64LIT(0x2C31334E19781208) /* 851 */, + W64LIT(0x4FA98D7CEAEE6291) /* 852 */, W64LIT(0x55C3862F665DB309) /* 853 */, + W64LIT(0xBD0610175D53B1F3) /* 854 */, W64LIT(0x46FE6CB840413F27) /* 855 */, + W64LIT(0x3FE03792DF0CFA59) /* 856 */, W64LIT(0xCFE700372EB85E8F) /* 857 */, + W64LIT(0xA7BE29E7ADBCE118) /* 858 */, W64LIT(0xE544EE5CDE8431DD) /* 859 */, + W64LIT(0x8A781B1B41F1873E) /* 860 */, W64LIT(0xA5C94C78A0D2F0E7) /* 861 */, + W64LIT(0x39412E2877B60728) /* 862 */, W64LIT(0xA1265EF3AFC9A62C) /* 863 */, + W64LIT(0xBCC2770C6A2506C5) /* 864 */, W64LIT(0x3AB66DD5DCE1CE12) /* 865 */, + W64LIT(0xE65499D04A675B37) /* 866 */, W64LIT(0x7D8F523481BFD216) /* 867 */, + W64LIT(0x0F6F64FCEC15F389) /* 868 */, W64LIT(0x74EFBE618B5B13C8) /* 869 */, + W64LIT(0xACDC82B714273E1D) /* 870 */, W64LIT(0xDD40BFE003199D17) /* 871 */, + W64LIT(0x37E99257E7E061F8) /* 872 */, W64LIT(0xFA52626904775AAA) /* 873 */, + W64LIT(0x8BBBF63A463D56F9) /* 874 */, W64LIT(0xF0013F1543A26E64) /* 875 */, + W64LIT(0xA8307E9F879EC898) /* 876 */, W64LIT(0xCC4C27A4150177CC) /* 877 */, + W64LIT(0x1B432F2CCA1D3348) /* 878 */, W64LIT(0xDE1D1F8F9F6FA013) /* 879 */, + W64LIT(0x606602A047A7DDD6) /* 880 */, W64LIT(0xD237AB64CC1CB2C7) /* 881 */, + W64LIT(0x9B938E7225FCD1D3) /* 882 */, W64LIT(0xEC4E03708E0FF476) /* 883 */, + W64LIT(0xFEB2FBDA3D03C12D) /* 884 */, W64LIT(0xAE0BCED2EE43889A) /* 885 */, + W64LIT(0x22CB8923EBFB4F43) /* 886 */, W64LIT(0x69360D013CF7396D) /* 887 */, + W64LIT(0x855E3602D2D4E022) /* 888 */, W64LIT(0x073805BAD01F784C) /* 889 */, + W64LIT(0x33E17A133852F546) /* 890 */, W64LIT(0xDF4874058AC7B638) /* 891 */, + W64LIT(0xBA92B29C678AA14A) /* 892 */, W64LIT(0x0CE89FC76CFAADCD) /* 893 */, + W64LIT(0x5F9D4E0908339E34) /* 894 */, W64LIT(0xF1AFE9291F5923B9) /* 895 */, + W64LIT(0x6E3480F60F4A265F) /* 896 */, W64LIT(0xEEBF3A2AB29B841C) /* 897 */, + W64LIT(0xE21938A88F91B4AD) /* 898 */, W64LIT(0x57DFEFF845C6D3C3) /* 899 */, + W64LIT(0x2F006B0BF62CAAF2) /* 900 */, W64LIT(0x62F479EF6F75EE78) /* 901 */, + W64LIT(0x11A55AD41C8916A9) /* 902 */, W64LIT(0xF229D29084FED453) /* 903 */, + W64LIT(0x42F1C27B16B000E6) /* 904 */, W64LIT(0x2B1F76749823C074) /* 905 */, + W64LIT(0x4B76ECA3C2745360) /* 906 */, W64LIT(0x8C98F463B91691BD) /* 907 */, + W64LIT(0x14BCC93CF1ADE66A) /* 908 */, W64LIT(0x8885213E6D458397) /* 909 */, + W64LIT(0x8E177DF0274D4711) /* 910 */, W64LIT(0xB49B73B5503F2951) /* 911 */, + W64LIT(0x10168168C3F96B6B) /* 912 */, W64LIT(0x0E3D963B63CAB0AE) /* 913 */, + W64LIT(0x8DFC4B5655A1DB14) /* 914 */, W64LIT(0xF789F1356E14DE5C) /* 915 */, + W64LIT(0x683E68AF4E51DAC1) /* 916 */, W64LIT(0xC9A84F9D8D4B0FD9) /* 917 */, + W64LIT(0x3691E03F52A0F9D1) /* 918 */, W64LIT(0x5ED86E46E1878E80) /* 919 */, + W64LIT(0x3C711A0E99D07150) /* 920 */, W64LIT(0x5A0865B20C4E9310) /* 921 */, + W64LIT(0x56FBFC1FE4F0682E) /* 922 */, W64LIT(0xEA8D5DE3105EDF9B) /* 923 */, + W64LIT(0x71ABFDB12379187A) /* 924 */, W64LIT(0x2EB99DE1BEE77B9C) /* 925 */, + W64LIT(0x21ECC0EA33CF4523) /* 926 */, W64LIT(0x59A4D7521805C7A1) /* 927 */, + W64LIT(0x3896F5EB56AE7C72) /* 928 */, W64LIT(0xAA638F3DB18F75DC) /* 929 */, + W64LIT(0x9F39358DABE9808E) /* 930 */, W64LIT(0xB7DEFA91C00B72AC) /* 931 */, + W64LIT(0x6B5541FD62492D92) /* 932 */, W64LIT(0x6DC6DEE8F92E4D5B) /* 933 */, + W64LIT(0x353F57ABC4BEEA7E) /* 934 */, W64LIT(0x735769D6DA5690CE) /* 935 */, + W64LIT(0x0A234AA642391484) /* 936 */, W64LIT(0xF6F9508028F80D9D) /* 937 */, + W64LIT(0xB8E319A27AB3F215) /* 938 */, W64LIT(0x31AD9C1151341A4D) /* 939 */, + W64LIT(0x773C22A57BEF5805) /* 940 */, W64LIT(0x45C7561A07968633) /* 941 */, + W64LIT(0xF913DA9E249DBE36) /* 942 */, W64LIT(0xDA652D9B78A64C68) /* 943 */, + W64LIT(0x4C27A97F3BC334EF) /* 944 */, W64LIT(0x76621220E66B17F4) /* 945 */, + W64LIT(0x967743899ACD7D0B) /* 946 */, W64LIT(0xF3EE5BCAE0ED6782) /* 947 */, + W64LIT(0x409F753600C879FC) /* 948 */, W64LIT(0x06D09A39B5926DB6) /* 949 */, + W64LIT(0x6F83AEB0317AC588) /* 950 */, W64LIT(0x01E6CA4A86381F21) /* 951 */, + W64LIT(0x66FF3462D19F3025) /* 952 */, W64LIT(0x72207C24DDFD3BFB) /* 953 */, + W64LIT(0x4AF6B6D3E2ECE2EB) /* 954 */, W64LIT(0x9C994DBEC7EA08DE) /* 955 */, + W64LIT(0x49ACE597B09A8BC4) /* 956 */, W64LIT(0xB38C4766CF0797BA) /* 957 */, + W64LIT(0x131B9373C57C2A75) /* 958 */, W64LIT(0xB1822CCE61931E58) /* 959 */, + W64LIT(0x9D7555B909BA1C0C) /* 960 */, W64LIT(0x127FAFDD937D11D2) /* 961 */, + W64LIT(0x29DA3BADC66D92E4) /* 962 */, W64LIT(0xA2C1D57154C2ECBC) /* 963 */, + W64LIT(0x58C5134D82F6FE24) /* 964 */, W64LIT(0x1C3AE3515B62274F) /* 965 */, + W64LIT(0xE907C82E01CB8126) /* 966 */, W64LIT(0xF8ED091913E37FCB) /* 967 */, + W64LIT(0x3249D8F9C80046C9) /* 968 */, W64LIT(0x80CF9BEDE388FB63) /* 969 */, + W64LIT(0x1881539A116CF19E) /* 970 */, W64LIT(0x5103F3F76BD52457) /* 971 */, + W64LIT(0x15B7E6F5AE47F7A8) /* 972 */, W64LIT(0xDBD7C6DED47E9CCF) /* 973 */, + W64LIT(0x44E55C410228BB1A) /* 974 */, W64LIT(0xB647D4255EDB4E99) /* 975 */, + W64LIT(0x5D11882BB8AAFC30) /* 976 */, W64LIT(0xF5098BBB29D3212A) /* 977 */, + W64LIT(0x8FB5EA14E90296B3) /* 978 */, W64LIT(0x677B942157DD025A) /* 979 */, + W64LIT(0xFB58E7C0A390ACB5) /* 980 */, W64LIT(0x89D3674C83BD4A01) /* 981 */, + W64LIT(0x9E2DA4DF4BF3B93B) /* 982 */, W64LIT(0xFCC41E328CAB4829) /* 983 */, + W64LIT(0x03F38C96BA582C52) /* 984 */, W64LIT(0xCAD1BDBD7FD85DB2) /* 985 */, + W64LIT(0xBBB442C16082AE83) /* 986 */, W64LIT(0xB95FE86BA5DA9AB0) /* 987 */, + W64LIT(0xB22E04673771A93F) /* 988 */, W64LIT(0x845358C9493152D8) /* 989 */, + W64LIT(0xBE2A488697B4541E) /* 990 */, W64LIT(0x95A2DC2DD38E6966) /* 991 */, + W64LIT(0xC02C11AC923C852B) /* 992 */, W64LIT(0x2388B1990DF2A87B) /* 993 */, + W64LIT(0x7C8008FA1B4F37BE) /* 994 */, W64LIT(0x1F70D0C84D54E503) /* 995 */, + W64LIT(0x5490ADEC7ECE57D4) /* 996 */, W64LIT(0x002B3C27D9063A3A) /* 997 */, + W64LIT(0x7EAEA3848030A2BF) /* 998 */, W64LIT(0xC602326DED2003C0) /* 999 */, + W64LIT(0x83A7287D69A94086) /* 1000 */, W64LIT(0xC57A5FCB30F57A8A) /* 1001 */, + W64LIT(0xB56844E479EBE779) /* 1002 */, W64LIT(0xA373B40F05DCBCE9) /* 1003 */, + W64LIT(0xD71A786E88570EE2) /* 1004 */, W64LIT(0x879CBACDBDE8F6A0) /* 1005 */, + W64LIT(0x976AD1BCC164A32F) /* 1006 */, W64LIT(0xAB21E25E9666D78B) /* 1007 */, + W64LIT(0x901063AAE5E5C33C) /* 1008 */, W64LIT(0x9818B34448698D90) /* 1009 */, + W64LIT(0xE36487AE3E1E8ABB) /* 1010 */, W64LIT(0xAFBDF931893BDCB4) /* 1011 */, + W64LIT(0x6345A0DC5FBBD519) /* 1012 */, W64LIT(0x8628FE269B9465CA) /* 1013 */, + W64LIT(0x1E5D01603F9C51EC) /* 1014 */, W64LIT(0x4DE44006A15049B7) /* 1015 */, + W64LIT(0xBF6C70E5F776CBB1) /* 1016 */, W64LIT(0x411218F2EF552BED) /* 1017 */, + W64LIT(0xCB0C0708705A36A3) /* 1018 */, W64LIT(0xE74D14754F986044) /* 1019 */, + W64LIT(0xCD56D9430EA8280E) /* 1020 */, W64LIT(0xC12591D7535F5065) /* 1021 */, + W64LIT(0xC83223F1720AEF96) /* 1022 */, W64LIT(0xC3A0396F7363A51F) /* 1023 */, + W64LIT(0xffffffffffffffff), + W64LIT(0xA5A5A5A5A5A5A5A5), + W64LIT(0x0123456789ABCDEF), +}; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/trdlocal.cpp b/external/crypto++-5.6.3/trdlocal.cpp new file mode 100644 index 000000000..aded14602 --- /dev/null +++ b/external/crypto++-5.6.3/trdlocal.cpp @@ -0,0 +1,104 @@ +// trdlocal.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "config.h" + +// TODO: fix this when more complete C++11 support is cut-in +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4297) +#endif + +#ifndef CRYPTOPP_IMPORTS +#ifdef THREADS_AVAILABLE + +#include "trdlocal.h" + +#ifdef HAS_WINTHREADS +#include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +ThreadLocalStorage::Err::Err(const std::string& operation, int error) + : OS_Error(OTHER_ERROR, "ThreadLocalStorage: " + operation + " operation failed with error 0x" + IntToString(error, 16), operation, error) +{ +} + +ThreadLocalStorage::ThreadLocalStorage() +{ +#ifdef HAS_WINTHREADS + m_index = TlsAlloc(); + assert(m_index != TLS_OUT_OF_INDEXES); + if (m_index == TLS_OUT_OF_INDEXES) + throw Err("TlsAlloc", GetLastError()); +#else + m_index = 0; + int error = pthread_key_create(&m_index, NULL); + assert(!error); + if (error) + throw Err("pthread_key_create", error); +#endif +} + +ThreadLocalStorage::~ThreadLocalStorage() CRYPTOPP_THROW +{ +#ifdef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE + if (!std::uncaught_exception()) +#else + try +#endif +#ifdef HAS_WINTHREADS + { + int rc = TlsFree(m_index); + assert(rc); + if (!rc) + throw Err("TlsFree", GetLastError()); + } +#else + { + int error = pthread_key_delete(m_index); + assert(!error); + if (error) + throw Err("pthread_key_delete", error); + } +#endif +#ifndef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE + catch(const Exception&) + { + } +#endif +} + +void ThreadLocalStorage::SetValue(void *value) +{ +#ifdef HAS_WINTHREADS + if (!TlsSetValue(m_index, value)) + throw Err("TlsSetValue", GetLastError()); +#else + int error = pthread_setspecific(m_index, value); + if (error) + throw Err("pthread_key_getspecific", error); +#endif +} + +void *ThreadLocalStorage::GetValue() const +{ +#ifdef HAS_WINTHREADS + void *result = TlsGetValue(m_index); + const DWORD dwRet = GetLastError(); + + assert(result || (!result && (dwRet == NO_ERROR))); + if (!result && dwRet != NO_ERROR) + throw Err("TlsGetValue", dwRet); +#else + // Null is a valid return value. Posix does not provide a way to + // check for a "good" Null vs a "bad" Null (errno is not set). + void *result = pthread_getspecific(m_index); +#endif + return result; +} + +NAMESPACE_END + +#endif // #ifdef THREADS_AVAILABLE +#endif diff --git a/external/crypto++-5.6.3/trdlocal.h b/external/crypto++-5.6.3/trdlocal.h new file mode 100644 index 000000000..cfc5a532a --- /dev/null +++ b/external/crypto++-5.6.3/trdlocal.h @@ -0,0 +1,44 @@ +#ifndef CRYPTOPP_TRDLOCAL_H +#define CRYPTOPP_TRDLOCAL_H + +#include "config.h" + +#ifdef THREADS_AVAILABLE + +#include "misc.h" + +#ifdef HAS_WINTHREADS +typedef unsigned long ThreadLocalIndexType; +#else +#include +typedef pthread_key_t ThreadLocalIndexType; +#endif + +NAMESPACE_BEGIN(CryptoPP) + +//! thread local storage +class CRYPTOPP_DLL ThreadLocalStorage : public NotCopyable +{ +public: + //! exception thrown by ThreadLocalStorage class + class Err : public OS_Error + { + public: + Err(const std::string& operation, int error); + }; + + ThreadLocalStorage(); + ~ThreadLocalStorage() CRYPTOPP_THROW; + + void SetValue(void *value); + void *GetValue() const; + +private: + ThreadLocalIndexType m_index; +}; + +NAMESPACE_END + +#endif // #ifdef THREADS_AVAILABLE + +#endif diff --git a/external/crypto++-5.6.3/trunhash.h b/external/crypto++-5.6.3/trunhash.h new file mode 100644 index 000000000..dd0cfa1d3 --- /dev/null +++ b/external/crypto++-5.6.3/trunhash.h @@ -0,0 +1,52 @@ +#ifndef CRYPTOPP_TRUNHASH_H +#define CRYPTOPP_TRUNHASH_H + +#include "cryptlib.h" + +NAMESPACE_BEGIN(CryptoPP) + +class NullHash : public HashTransformation +{ +public: + void Update(const byte *input, size_t length) + {CRYPTOPP_UNUSED(input);CRYPTOPP_UNUSED(length);} + unsigned int DigestSize() const + {return 0;} + void TruncatedFinal(byte *digest, size_t digestSize) + {CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestSize);} + bool TruncatedVerify(const byte *digest, size_t digestLength) + {CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestLength);return true;} +}; + +//! construct new HashModule with smaller DigestSize() from existing one +template +class TruncatedHashTemplate : public HashTransformation +{ +public: + TruncatedHashTemplate(T hm, unsigned int digestSize) + : m_hm(hm), m_digestSize(digestSize) {} + TruncatedHashTemplate(const byte *key, size_t keyLength, unsigned int digestSize) + : m_hm(key, keyLength), m_digestSize(digestSize) {} + TruncatedHashTemplate(size_t digestSize) + : m_digestSize(digestSize) {} + + void Restart() + {m_hm.Restart();} + void Update(const byte *input, size_t length) + {m_hm.Update(input, length);} + unsigned int DigestSize() const {return m_digestSize;} + void TruncatedFinal(byte *digest, size_t digestSize) + {m_hm.TruncatedFinal(digest, digestSize);} + bool TruncatedVerify(const byte *digest, size_t digestLength) + {return m_hm.TruncatedVerify(digest, digestLength);} + +private: + T m_hm; + unsigned int m_digestSize; +}; + +typedef TruncatedHashTemplate TruncatedHashModule; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/ttmac.cpp b/external/crypto++-5.6.3/ttmac.cpp new file mode 100644 index 000000000..177b898b3 --- /dev/null +++ b/external/crypto++-5.6.3/ttmac.cpp @@ -0,0 +1,338 @@ +// ttmac.cpp - written and placed in the public domain by Kevin Springle + +#include "pch.h" +#include "ttmac.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +void TTMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) +{ + AssertValidKeyLength(keylength); + + memcpy(m_key, userKey, KEYLENGTH); + CorrectEndianess(m_key, m_key, KEYLENGTH); + + Init(); +} + +void TTMAC_Base::Init() +{ + m_digest[0] = m_digest[5] = m_key[0]; + m_digest[1] = m_digest[6] = m_key[1]; + m_digest[2] = m_digest[7] = m_key[2]; + m_digest[3] = m_digest[8] = m_key[3]; + m_digest[4] = m_digest[9] = m_key[4]; +} + +void TTMAC_Base::TruncatedFinal(byte *hash, size_t size) +{ + PadLastBlock(BlockSize() - 2*sizeof(HashWordType)); + CorrectEndianess(m_data, m_data, BlockSize() - 2*sizeof(HashWordType)); + + m_data[m_data.size()-2] = GetBitCountLo(); + m_data[m_data.size()-1] = GetBitCountHi(); + + Transform(m_digest, m_data, true); + + word32 t2 = m_digest[2]; + word32 t3 = m_digest[3]; + if (size != DIGESTSIZE) + { + switch (size) + { + case 16: + m_digest[3] += m_digest[1] + m_digest[4]; + // fall through + case 12: + m_digest[2] += m_digest[0] + t3; + // fall through + case 8: + m_digest[0] += m_digest[1] + t3; + m_digest[1] += m_digest[4] + t2; + break; + + case 4: + m_digest[0] += + m_digest[1] + + m_digest[2] + + m_digest[3] + + m_digest[4]; + break; + + case 0: + // Used by HashTransformation::Restart() + break; + + default: + throw InvalidArgument("TTMAC_Base: can't truncate a Two-Track-MAC 20 byte digest to " + IntToString(size) + " bytes"); + break; + } + } + + CorrectEndianess(m_digest, m_digest, size); + memcpy(hash, m_digest, size); + + Restart(); // reinit for next use +} + +// RIPEMD-160 definitions used by Two-Track-MAC + +#define F(x, y, z) (x ^ y ^ z) +#define G(x, y, z) (z ^ (x & (y^z))) +#define H(x, y, z) (z ^ (x | ~y)) +#define I(x, y, z) (y ^ (z & (x^y))) +#define J(x, y, z) (x ^ (y | ~z)) + +#define k0 0 +#define k1 0x5a827999UL +#define k2 0x6ed9eba1UL +#define k3 0x8f1bbcdcUL +#define k4 0xa953fd4eUL +#define k5 0x50a28be6UL +#define k6 0x5c4dd124UL +#define k7 0x6d703ef3UL +#define k8 0x7a6d76e9UL +#define k9 0 + +void TTMAC_Base::Transform(word32 *digest, const word32 *X, bool last) +{ +#define Subround(f, a, b, c, d, e, x, s, k) \ + a += f(b, c, d) + x + k;\ + a = rotlFixed((word32)a, s) + e;\ + c = rotlFixed((word32)c, 10U) + + word32 a1, b1, c1, d1, e1, a2, b2, c2, d2, e2; + word32 *trackA, *trackB; + + if (!last) + { + trackA = digest; + trackB = digest+5; + } + else + { + trackB = digest; + trackA = digest+5; + } + a1 = trackA[0]; + b1 = trackA[1]; + c1 = trackA[2]; + d1 = trackA[3]; + e1 = trackA[4]; + a2 = trackB[0]; + b2 = trackB[1]; + c2 = trackB[2]; + d2 = trackB[3]; + e2 = trackB[4]; + + Subround(F, a1, b1, c1, d1, e1, X[ 0], 11, k0); + Subround(F, e1, a1, b1, c1, d1, X[ 1], 14, k0); + Subround(F, d1, e1, a1, b1, c1, X[ 2], 15, k0); + Subround(F, c1, d1, e1, a1, b1, X[ 3], 12, k0); + Subround(F, b1, c1, d1, e1, a1, X[ 4], 5, k0); + Subround(F, a1, b1, c1, d1, e1, X[ 5], 8, k0); + Subround(F, e1, a1, b1, c1, d1, X[ 6], 7, k0); + Subround(F, d1, e1, a1, b1, c1, X[ 7], 9, k0); + Subround(F, c1, d1, e1, a1, b1, X[ 8], 11, k0); + Subround(F, b1, c1, d1, e1, a1, X[ 9], 13, k0); + Subround(F, a1, b1, c1, d1, e1, X[10], 14, k0); + Subround(F, e1, a1, b1, c1, d1, X[11], 15, k0); + Subround(F, d1, e1, a1, b1, c1, X[12], 6, k0); + Subround(F, c1, d1, e1, a1, b1, X[13], 7, k0); + Subround(F, b1, c1, d1, e1, a1, X[14], 9, k0); + Subround(F, a1, b1, c1, d1, e1, X[15], 8, k0); + + Subround(G, e1, a1, b1, c1, d1, X[ 7], 7, k1); + Subround(G, d1, e1, a1, b1, c1, X[ 4], 6, k1); + Subround(G, c1, d1, e1, a1, b1, X[13], 8, k1); + Subround(G, b1, c1, d1, e1, a1, X[ 1], 13, k1); + Subround(G, a1, b1, c1, d1, e1, X[10], 11, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 6], 9, k1); + Subround(G, d1, e1, a1, b1, c1, X[15], 7, k1); + Subround(G, c1, d1, e1, a1, b1, X[ 3], 15, k1); + Subround(G, b1, c1, d1, e1, a1, X[12], 7, k1); + Subround(G, a1, b1, c1, d1, e1, X[ 0], 12, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 9], 15, k1); + Subround(G, d1, e1, a1, b1, c1, X[ 5], 9, k1); + Subround(G, c1, d1, e1, a1, b1, X[ 2], 11, k1); + Subround(G, b1, c1, d1, e1, a1, X[14], 7, k1); + Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1); + Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1); + + Subround(H, d1, e1, a1, b1, c1, X[ 3], 11, k2); + Subround(H, c1, d1, e1, a1, b1, X[10], 13, k2); + Subround(H, b1, c1, d1, e1, a1, X[14], 6, k2); + Subround(H, a1, b1, c1, d1, e1, X[ 4], 7, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 9], 14, k2); + Subround(H, d1, e1, a1, b1, c1, X[15], 9, k2); + Subround(H, c1, d1, e1, a1, b1, X[ 8], 13, k2); + Subround(H, b1, c1, d1, e1, a1, X[ 1], 15, k2); + Subround(H, a1, b1, c1, d1, e1, X[ 2], 14, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 7], 8, k2); + Subround(H, d1, e1, a1, b1, c1, X[ 0], 13, k2); + Subround(H, c1, d1, e1, a1, b1, X[ 6], 6, k2); + Subround(H, b1, c1, d1, e1, a1, X[13], 5, k2); + Subround(H, a1, b1, c1, d1, e1, X[11], 12, k2); + Subround(H, e1, a1, b1, c1, d1, X[ 5], 7, k2); + Subround(H, d1, e1, a1, b1, c1, X[12], 5, k2); + + Subround(I, c1, d1, e1, a1, b1, X[ 1], 11, k3); + Subround(I, b1, c1, d1, e1, a1, X[ 9], 12, k3); + Subround(I, a1, b1, c1, d1, e1, X[11], 14, k3); + Subround(I, e1, a1, b1, c1, d1, X[10], 15, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 0], 14, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 8], 15, k3); + Subround(I, b1, c1, d1, e1, a1, X[12], 9, k3); + Subround(I, a1, b1, c1, d1, e1, X[ 4], 8, k3); + Subround(I, e1, a1, b1, c1, d1, X[13], 9, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 3], 14, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 7], 5, k3); + Subround(I, b1, c1, d1, e1, a1, X[15], 6, k3); + Subround(I, a1, b1, c1, d1, e1, X[14], 8, k3); + Subround(I, e1, a1, b1, c1, d1, X[ 5], 6, k3); + Subround(I, d1, e1, a1, b1, c1, X[ 6], 5, k3); + Subround(I, c1, d1, e1, a1, b1, X[ 2], 12, k3); + + Subround(J, b1, c1, d1, e1, a1, X[ 4], 9, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 0], 15, k4); + Subround(J, e1, a1, b1, c1, d1, X[ 5], 5, k4); + Subround(J, d1, e1, a1, b1, c1, X[ 9], 11, k4); + Subround(J, c1, d1, e1, a1, b1, X[ 7], 6, k4); + Subround(J, b1, c1, d1, e1, a1, X[12], 8, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 2], 13, k4); + Subround(J, e1, a1, b1, c1, d1, X[10], 12, k4); + Subround(J, d1, e1, a1, b1, c1, X[14], 5, k4); + Subround(J, c1, d1, e1, a1, b1, X[ 1], 12, k4); + Subround(J, b1, c1, d1, e1, a1, X[ 3], 13, k4); + Subround(J, a1, b1, c1, d1, e1, X[ 8], 14, k4); + Subround(J, e1, a1, b1, c1, d1, X[11], 11, k4); + Subround(J, d1, e1, a1, b1, c1, X[ 6], 8, k4); + Subround(J, c1, d1, e1, a1, b1, X[15], 5, k4); + Subround(J, b1, c1, d1, e1, a1, X[13], 6, k4); + + Subround(J, a2, b2, c2, d2, e2, X[ 5], 8, k5); + Subround(J, e2, a2, b2, c2, d2, X[14], 9, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 7], 9, k5); + Subround(J, c2, d2, e2, a2, b2, X[ 0], 11, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 9], 13, k5); + Subround(J, a2, b2, c2, d2, e2, X[ 2], 15, k5); + Subround(J, e2, a2, b2, c2, d2, X[11], 15, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 4], 5, k5); + Subround(J, c2, d2, e2, a2, b2, X[13], 7, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 6], 7, k5); + Subround(J, a2, b2, c2, d2, e2, X[15], 8, k5); + Subround(J, e2, a2, b2, c2, d2, X[ 8], 11, k5); + Subround(J, d2, e2, a2, b2, c2, X[ 1], 14, k5); + Subround(J, c2, d2, e2, a2, b2, X[10], 14, k5); + Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5); + Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5); + + Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6); + Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6); + Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6); + Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6); + Subround(I, a2, b2, c2, d2, e2, X[ 0], 12, k6); + Subround(I, e2, a2, b2, c2, d2, X[13], 8, k6); + Subround(I, d2, e2, a2, b2, c2, X[ 5], 9, k6); + Subround(I, c2, d2, e2, a2, b2, X[10], 11, k6); + Subround(I, b2, c2, d2, e2, a2, X[14], 7, k6); + Subround(I, a2, b2, c2, d2, e2, X[15], 7, k6); + Subround(I, e2, a2, b2, c2, d2, X[ 8], 12, k6); + Subround(I, d2, e2, a2, b2, c2, X[12], 7, k6); + Subround(I, c2, d2, e2, a2, b2, X[ 4], 6, k6); + Subround(I, b2, c2, d2, e2, a2, X[ 9], 15, k6); + Subround(I, a2, b2, c2, d2, e2, X[ 1], 13, k6); + Subround(I, e2, a2, b2, c2, d2, X[ 2], 11, k6); + + Subround(H, d2, e2, a2, b2, c2, X[15], 9, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 5], 7, k7); + Subround(H, b2, c2, d2, e2, a2, X[ 1], 15, k7); + Subround(H, a2, b2, c2, d2, e2, X[ 3], 11, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 7], 8, k7); + Subround(H, d2, e2, a2, b2, c2, X[14], 6, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 6], 6, k7); + Subround(H, b2, c2, d2, e2, a2, X[ 9], 14, k7); + Subround(H, a2, b2, c2, d2, e2, X[11], 12, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 8], 13, k7); + Subround(H, d2, e2, a2, b2, c2, X[12], 5, k7); + Subround(H, c2, d2, e2, a2, b2, X[ 2], 14, k7); + Subround(H, b2, c2, d2, e2, a2, X[10], 13, k7); + Subround(H, a2, b2, c2, d2, e2, X[ 0], 13, k7); + Subround(H, e2, a2, b2, c2, d2, X[ 4], 7, k7); + Subround(H, d2, e2, a2, b2, c2, X[13], 5, k7); + + Subround(G, c2, d2, e2, a2, b2, X[ 8], 15, k8); + Subround(G, b2, c2, d2, e2, a2, X[ 6], 5, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 4], 8, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 1], 11, k8); + Subround(G, d2, e2, a2, b2, c2, X[ 3], 14, k8); + Subround(G, c2, d2, e2, a2, b2, X[11], 14, k8); + Subround(G, b2, c2, d2, e2, a2, X[15], 6, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 0], 14, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 5], 6, k8); + Subround(G, d2, e2, a2, b2, c2, X[12], 9, k8); + Subround(G, c2, d2, e2, a2, b2, X[ 2], 12, k8); + Subround(G, b2, c2, d2, e2, a2, X[13], 9, k8); + Subround(G, a2, b2, c2, d2, e2, X[ 9], 12, k8); + Subround(G, e2, a2, b2, c2, d2, X[ 7], 5, k8); + Subround(G, d2, e2, a2, b2, c2, X[10], 15, k8); + Subround(G, c2, d2, e2, a2, b2, X[14], 8, k8); + + Subround(F, b2, c2, d2, e2, a2, X[12], 8, k9); + Subround(F, a2, b2, c2, d2, e2, X[15], 5, k9); + Subround(F, e2, a2, b2, c2, d2, X[10], 12, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 4], 9, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 1], 12, k9); + Subround(F, b2, c2, d2, e2, a2, X[ 5], 5, k9); + Subround(F, a2, b2, c2, d2, e2, X[ 8], 14, k9); + Subround(F, e2, a2, b2, c2, d2, X[ 7], 6, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 6], 8, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 2], 13, k9); + Subround(F, b2, c2, d2, e2, a2, X[13], 6, k9); + Subround(F, a2, b2, c2, d2, e2, X[14], 5, k9); + Subround(F, e2, a2, b2, c2, d2, X[ 0], 15, k9); + Subround(F, d2, e2, a2, b2, c2, X[ 3], 13, k9); + Subround(F, c2, d2, e2, a2, b2, X[ 9], 11, k9); + Subround(F, b2, c2, d2, e2, a2, X[11], 11, k9); + + a1 -= trackA[0]; + b1 -= trackA[1]; + c1 -= trackA[2]; + d1 -= trackA[3]; + e1 -= trackA[4]; + a2 -= trackB[0]; + b2 -= trackB[1]; + c2 -= trackB[2]; + d2 -= trackB[3]; + e2 -= trackB[4]; + + if (!last) + { + trackA[0] = (b1 + e1) - d2; + trackA[1] = c1 - e2; + trackA[2] = d1 - a2; + trackA[3] = e1 - b2; + trackA[4] = a1 - c2; + trackB[0] = d1 - e2; + trackB[1] = (e1 + c1) - a2; + trackB[2] = a1 - b2; + trackB[3] = b1 - c2; + trackB[4] = c1 - d2; + } + else + { + trackB[0] = a2 - a1; + trackB[1] = b2 - b1; + trackB[2] = c2 - c1; + trackB[3] = d2 - d1; + trackB[4] = e2 - e1; + trackA[0] = 0; + trackA[1] = 0; + trackA[2] = 0; + trackA[3] = 0; + trackA[4] = 0; + } +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/ttmac.h b/external/crypto++-5.6.3/ttmac.h new file mode 100644 index 000000000..c0ab7e9fb --- /dev/null +++ b/external/crypto++-5.6.3/ttmac.h @@ -0,0 +1,39 @@ +// ttmac.h - written and placed in the public domain by Kevin Springle + +#ifndef CRYPTOPP_TTMAC_H +#define CRYPTOPP_TTMAC_H + +#include "seckey.h" +#include "iterhash.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash +{ +public: + static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");} + CRYPTOPP_CONSTANT(DIGESTSIZE=20) + + unsigned int DigestSize() const {return DIGESTSIZE;}; + void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); + void TruncatedFinal(byte *mac, size_t size); + +protected: + static void Transform (word32 *digest, const word32 *X, bool last); + void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, false);} + void Init(); + word32* StateBuf() {return m_digest;} + + FixedSizeSecBlock m_digest; + FixedSizeSecBlock m_key; +}; + +//! Two-Track-MAC +/*! 160 Bit MAC with 160 Bit Key */ +DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal, TTMAC) + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/twofish.cpp b/external/crypto++-5.6.3/twofish.cpp new file mode 100644 index 000000000..14abd9f25 --- /dev/null +++ b/external/crypto++-5.6.3/twofish.cpp @@ -0,0 +1,169 @@ +// twofish.cpp - modified by Wei Dai from Matthew Skala's twofish.c +// The original code and all modifications are in the public domain. + +#include "pch.h" +#include "twofish.h" +#include "secblock.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +// compute (c * x^4) mod (x^4 + (a + 1/a) * x^3 + a * x^2 + (a + 1/a) * x + 1) +// over GF(256) +static inline unsigned int Mod(unsigned int c) +{ + static const unsigned int modulus = 0x14d; + unsigned int c2 = (c<<1) ^ ((c & 0x80) ? modulus : 0); + unsigned int c1 = c2 ^ (c>>1) ^ ((c & 1) ? (modulus>>1) : 0); + return c | (c1 << 8) | (c2 << 16) | (c1 << 24); +} + +// compute RS(12,8) code with the above polynomial as generator +// this is equivalent to multiplying by the RS matrix +static word32 ReedSolomon(word32 high, word32 low) +{ + for (unsigned int i=0; i<8; i++) + { + high = Mod(high>>24) ^ (high<<8) ^ (low>>24); + low <<= 8; + } + return high; +} + +inline word32 Twofish::Base::h0(word32 x, const word32 *key, unsigned int kLen) +{ + x = x | (x<<8) | (x<<16) | (x<<24); + switch(kLen) + { +#define Q(a, b, c, d, t) q[a][GETBYTE(t,0)] ^ (q[b][GETBYTE(t,1)] << 8) ^ (q[c][GETBYTE(t,2)] << 16) ^ (q[d][GETBYTE(t,3)] << 24) + case 4: x = Q(1, 0, 0, 1, x) ^ key[6]; + case 3: x = Q(1, 1, 0, 0, x) ^ key[4]; + case 2: x = Q(0, 1, 0, 1, x) ^ key[2]; + x = Q(0, 0, 1, 1, x) ^ key[0]; + } + return x; +} + +inline word32 Twofish::Base::h(word32 x, const word32 *key, unsigned int kLen) +{ + x = h0(x, key, kLen); + return mds[0][GETBYTE(x,0)] ^ mds[1][GETBYTE(x,1)] ^ mds[2][GETBYTE(x,2)] ^ mds[3][GETBYTE(x,3)]; +} + +void Twofish::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) +{ + AssertValidKeyLength(keylength); + + unsigned int len = (keylength <= 16 ? 2 : (keylength <= 24 ? 3 : 4)); + SecBlock key(len*2); + GetUserKey(LITTLE_ENDIAN_ORDER, key.begin(), len*2, userKey, keylength); + + unsigned int i; + for (i=0; i<40; i+=2) + { + word32 a = h(i, key, len); + word32 b = rotlFixed(h(i+1, key+1, len), 8); + m_k[i] = a+b; + m_k[i+1] = rotlFixed(a+2*b, 9); + } + + SecBlock svec(2*len); + for (i=0; i Block; + +void Twofish::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 x, y, a, b, c, d; + + Block::Get(inBlock)(a)(b)(c)(d); + + a ^= m_k[0]; + b ^= m_k[1]; + c ^= m_k[2]; + d ^= m_k[3]; + + const word32 *k = m_k+8; + ENCCYCLE (0); + ENCCYCLE (1); + ENCCYCLE (2); + ENCCYCLE (3); + ENCCYCLE (4); + ENCCYCLE (5); + ENCCYCLE (6); + ENCCYCLE (7); + + c ^= m_k[4]; + d ^= m_k[5]; + a ^= m_k[6]; + b ^= m_k[7]; + + Block::Put(xorBlock, outBlock)(c)(d)(a)(b); +} + +void Twofish::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + word32 x, y, a, b, c, d; + + Block::Get(inBlock)(c)(d)(a)(b); + + c ^= m_k[4]; + d ^= m_k[5]; + a ^= m_k[6]; + b ^= m_k[7]; + + const word32 *k = m_k+8; + DECCYCLE (7); + DECCYCLE (6); + DECCYCLE (5); + DECCYCLE (4); + DECCYCLE (3); + DECCYCLE (2); + DECCYCLE (1); + DECCYCLE (0); + + a ^= m_k[0]; + b ^= m_k[1]; + c ^= m_k[2]; + d ^= m_k[3]; + + Block::Put(xorBlock, outBlock)(a)(b)(c)(d); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/twofish.h b/external/crypto++-5.6.3/twofish.h new file mode 100644 index 000000000..0ab3e36d4 --- /dev/null +++ b/external/crypto++-5.6.3/twofish.h @@ -0,0 +1,61 @@ +// twofish.h - written and placed in the public domain by Wei Dai + +//! \file twofish.h +//! \brief Classes for the Twofish block cipher + +#ifndef CRYPTOPP_TWOFISH_H +#define CRYPTOPP_TWOFISH_H + +#include "seckey.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, FixedRounds<16> +{ + static const char *StaticAlgorithmName() {return "Twofish";} +}; + +/// Twofish +class Twofish : public Twofish_Info, public BlockCipherDocumentation +{ + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); + + protected: + static word32 h0(word32 x, const word32 *key, unsigned int kLen); + static word32 h(word32 x, const word32 *key, unsigned int kLen); + + static const byte q[2][256]; + static const word32 mds[4][256]; + + FixedSizeSecBlock m_k; + FixedSizeSecBlock m_s; + }; + + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef Twofish::Encryption TwofishEncryption; +typedef Twofish::Decryption TwofishDecryption; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/validat1.cpp b/external/crypto++-5.6.3/validat1.cpp new file mode 100644 index 000000000..96993c507 --- /dev/null +++ b/external/crypto++-5.6.3/validat1.cpp @@ -0,0 +1,1639 @@ +// validat1.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 + +#include "cryptlib.h" +#include "pubkey.h" +#include "gfpcrypt.h" +#include "eccrypto.h" +#include "filters.h" +#include "files.h" +#include "hex.h" +#include "base32.h" +#include "base64.h" +#include "modes.h" +#include "cbcmac.h" +#include "dmac.h" +#include "idea.h" +#include "des.h" +#include "rc2.h" +#include "arc4.h" +#include "rc5.h" +#include "blowfish.h" +#include "3way.h" +#include "safer.h" +#include "gost.h" +#include "shark.h" +#include "cast.h" +#include "square.h" +#include "seal.h" +#include "rc6.h" +#include "mars.h" +#include "aes.h" +#include "cpu.h" +#include "rng.h" +#include "rijndael.h" +#include "twofish.h" +#include "serpent.h" +#include "skipjack.h" +#include "shacal2.h" +#include "camellia.h" +#include "osrng.h" +#include "rdrand.h" +#include "zdeflate.h" +#include "smartptr.h" +#include "channels.h" + +#include +#include +#include +#include + +#include "validate.h" + +// Aggressive stack checking with VS2005 SP1 and above. +#if (CRYPTOPP_MSC_VERSION >= 1410) +# pragma strict_gs_check (on) +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +bool ValidateAll(bool thorough) +{ + bool pass=TestSettings(); + pass=TestOS_RNG() && pass; + pass=TestAutoSeeded() && pass; + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) + pass=TestRDRAND() && pass; + pass=TestRDSEED() && pass; +#else + +#endif + +#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS) + // http://github.com/weidai11/cryptopp/issues/64 + pass=TestPolynomialMod2() && pass; +#endif + + pass=ValidateCRC32() && pass; + pass=ValidateAdler32() && pass; + pass=ValidateMD2() && pass; + pass=ValidateMD5() && pass; + pass=ValidateSHA() && pass; + pass=RunTestDataFile("TestVectors/sha3.txt") && pass; + pass=ValidateTiger() && pass; + pass=ValidateRIPEMD() && pass; + pass=ValidatePanama() && pass; + pass=ValidateWhirlpool() && pass; + + pass=ValidateHMAC() && pass; + pass=ValidateTTMAC() && pass; + + pass=ValidatePBKDF() && pass; + pass=ValidateHKDF() && pass; + + pass=ValidateDES() && pass; + pass=ValidateCipherModes() && pass; + pass=ValidateIDEA() && pass; + pass=ValidateSAFER() && pass; + pass=ValidateRC2() && pass; + pass=ValidateARC4() && pass; + pass=ValidateRC5() && pass; + pass=ValidateBlowfish() && pass; + pass=ValidateThreeWay() && pass; + pass=ValidateGOST() && pass; + pass=ValidateSHARK() && pass; + pass=ValidateCAST() && pass; + pass=ValidateSquare() && pass; + pass=ValidateSKIPJACK() && pass; + pass=ValidateSEAL() && pass; + pass=ValidateRC6() && pass; + pass=ValidateMARS() && pass; + pass=ValidateRijndael() && pass; + pass=ValidateTwofish() && pass; + pass=ValidateSerpent() && pass; + pass=ValidateSHACAL2() && pass; + pass=ValidateCamellia() && pass; + pass=ValidateSalsa() && pass; + pass=ValidateSosemanuk() && pass; + pass=ValidateVMAC() && pass; + pass=ValidateCCM() && pass; + pass=ValidateGCM() && pass; + pass=ValidateCMAC() && pass; + pass=RunTestDataFile("TestVectors/eax.txt") && pass; + pass=RunTestDataFile("TestVectors/seed.txt") && pass; + + pass=ValidateBBS() && pass; + pass=ValidateDH() && pass; + pass=ValidateMQV() && pass; + pass=ValidateRSA() && pass; + pass=ValidateElGamal() && pass; + pass=ValidateDLIES() && pass; + pass=ValidateNR() && pass; + pass=ValidateDSA(thorough) && pass; + pass=ValidateLUC() && pass; + pass=ValidateLUC_DH() && pass; + pass=ValidateLUC_DL() && pass; + pass=ValidateXTR_DH() && pass; + pass=ValidateRabin() && pass; + pass=ValidateRW() && pass; +// pass=ValidateBlumGoldwasser() && pass; + pass=ValidateECP() && pass; + pass=ValidateEC2N() && pass; + pass=ValidateECDSA() && pass; + pass=ValidateESIGN() && pass; + + if (pass) + cout << "\nAll tests passed!\n"; + else + cout << "\nOops! Not all tests passed.\n"; + + return pass; +} + +bool TestSettings() +{ + // Thanks to IlyaBizyaev and Zireael-N, http://github.com/weidai11/cryptopp/issues/28 +#if defined(__MINGW32__) + using CryptoPP::memcpy_s; +#endif + + bool pass = true; + + cout << "\nTesting Settings...\n\n"; + + word32 w; + memcpy_s(&w, sizeof(w), "\x01\x02\x03\x04", 4); + + if (w == 0x04030201L) + { +#ifdef IS_LITTLE_ENDIAN + cout << "passed: "; +#else + cout << "FAILED: "; + pass = false; +#endif + cout << "Your machine is little endian.\n"; + } + else if (w == 0x01020304L) + { +#ifndef IS_LITTLE_ENDIAN + cout << "passed: "; +#else + cout << "FAILED: "; + pass = false; +#endif + cout << "Your machine is big endian.\n"; + } + else + { + cout << "FAILED: Your machine is neither big endian nor little endian.\n"; + pass = false; + } + +#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS + byte testvals[10] = {1,2,2,3,3,3,3,2,2,1}; + if (*(word32 *)(testvals+3) == 0x03030303 && *(word64 *)(testvals+1) == W64LIT(0x0202030303030202)) + cout << "passed: Your machine allows unaligned data access.\n"; + else + { + cout << "FAILED: Unaligned data access gave incorrect results.\n"; + pass = false; + } +#else + cout << "passed: CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is not defined. Will restrict to aligned data access.\n"; +#endif + + if (sizeof(byte) == 1) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(byte) == " << sizeof(byte) << endl; + + if (sizeof(word16) == 2) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(word16) == " << sizeof(word16) << endl; + + if (sizeof(word32) == 4) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(word32) == " << sizeof(word32) << endl; + + if (sizeof(word64) == 8) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(word64) == " << sizeof(word64) << endl; + +#ifdef CRYPTOPP_WORD128_AVAILABLE + if (sizeof(word128) == 16) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(word128) == " << sizeof(word128) << endl; +#endif + + if (sizeof(word) == 2*sizeof(hword) +#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + && sizeof(dword) == 2*sizeof(word) +#endif + ) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(hword) == " << sizeof(hword) << ", sizeof(word) == " << sizeof(word); +#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE + cout << ", sizeof(dword) == " << sizeof(dword); +#endif + cout << endl; + +#ifdef CRYPTOPP_CPUID_AVAILABLE + bool hasMMX = HasMMX(); + bool hasISSE = HasISSE(); + bool hasSSE2 = HasSSE2(); + bool hasSSSE3 = HasSSSE3(); + bool isP4 = IsP4(); + int cacheLineSize = GetCacheLineSize(); + + if ((isP4 && (!hasMMX || !hasSSE2)) || (hasSSE2 && !hasMMX) || (cacheLineSize < 16 || cacheLineSize > 256 || !IsPowerOf2(cacheLineSize))) + { + cout << "FAILED: "; + pass = false; + } + else + cout << "passed: "; + + cout << "hasMMX == " << hasMMX << ", hasISSE == " << hasISSE << ", hasSSE2 == " << hasSSE2 << ", hasSSSE3 == " << hasSSSE3 << ", hasAESNI == " << HasAESNI() << ", hasRDRAND == " << HasRDRAND() << ", hasRDSEED == " << HasRDSEED() << ", hasCLMUL == " << HasCLMUL() << ", isP4 == " << isP4 << ", cacheLineSize == " << cacheLineSize; + cout << ", AESNI_INTRINSICS == " << CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE << endl; +#endif + + if (!pass) + { + cout << "Some critical setting in config.h is in error. Please fix it and recompile." << endl; + abort(); + } + return pass; +} + +bool TestOS_RNG() +{ + bool pass = true; + + member_ptr rng; + +#ifdef BLOCKING_RNG_AVAILABLE + try {rng.reset(new BlockingRng);} + catch (OS_RNG_Err &) {} +#endif + + if (rng.get()) + { + cout << "\nTesting operating system provided blocking random number generator...\n\n"; + + MeterFilter meter(new Redirector(TheBitBucket())); + RandomNumberSource test(*rng, UINT_MAX, false, new Deflator(new Redirector(meter))); + unsigned long total=0, length=0; + time_t t = time(NULL), t1 = 0; + CRYPTOPP_UNUSED(length); + + // check that it doesn't take too long to generate a reasonable amount of randomness + while (total < 16 && (t1 < 10 || total*8 > (unsigned long)t1)) + { + test.Pump(1); + total += 1; + t1 = time(NULL) - t; + } + + if (total < 16) + { + cout << "FAILED:"; + pass = false; + } + else + cout << "passed:"; + cout << " it took " << long(t1) << " seconds to generate " << total << " bytes" << endl; + +#if 0 // disable this part. it's causing an unpredictable pause during the validation testing + if (t1 < 2) + { + // that was fast, are we really blocking? + // first exhaust the extropy reserve + t = time(NULL); + while (time(NULL) - t < 2) + { + test.Pump(1); + total += 1; + } + + // if it generates too many bytes in a certain amount of time, + // something's probably wrong + t = time(NULL); + while (time(NULL) - t < 2) + { + test.Pump(1); + total += 1; + length += 1; + } + if (length > 1024) + { + cout << "FAILED:"; + pass = false; + } + else + cout << "passed:"; + cout << " it generated " << length << " bytes in " << long(time(NULL) - t) << " seconds" << endl; + } +#endif + + test.AttachedTransformation()->MessageEnd(); + + if (meter.GetTotalBytes() < total) + { + cout << "FAILED:"; + pass = false; + } + else + cout << "passed:"; + cout << " " << total << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE" << endl; + } + else + cout << "\nNo operating system provided blocking random number generator, skipping test." << endl; + + rng.reset(NULL); +#ifdef NONBLOCKING_RNG_AVAILABLE + try {rng.reset(new NonblockingRng);} + catch (OS_RNG_Err &) {} +#endif + + if (rng.get()) + { + cout << "\nTesting operating system provided nonblocking random number generator...\n\n"; + + MeterFilter meter(new Redirector(TheBitBucket())); + RandomNumberSource test(*rng, 100000, true, new Deflator(new Redirector(meter))); + + if (meter.GetTotalBytes() < 100000) + { + cout << "FAILED:"; + pass = false; + } + else + cout << "passed:"; + cout << " 100000 generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE" << endl; + } + else + cout << "\nNo operating system provided nonblocking random number generator, skipping test." << endl; + + return pass; +} + +#if NO_OS_DEPENDENCE +bool TestAutoSeeded() +{ + return true; +} +#else +bool TestAutoSeeded() +{ + // This tests Auto-Seeding and GenerateIntoBufferedTransformation. + cout << "\nTesting AutoSeeded generator...\n\n"; + + AutoSeededRandomPool prng; + bool generate = true, discard = true; + + MeterFilter meter(new Redirector(TheBitBucket())); + RandomNumberSource test(prng, 100000, true, new Deflator(new Redirector(meter))); + + if (meter.GetTotalBytes() < 100000) + { + cout << "FAILED:"; + generate = false; + } + else + cout << "passed:"; + cout << " 100000 generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE" << endl; + + try + { + prng.DiscardBytes(100000); + } + catch(const Exception&) + { + discard = false; + } + + if (!discard) + cout << "FAILED:"; + else + cout << "passed:"; + cout << " discarded 10000 bytes" << endl; + + return generate && discard; +} +#endif // NO_OS_DEPENDENCE + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) +bool TestRDRAND() +{ + RDRAND rdrand; + bool entropy = true, compress = true, discard = true; + static const unsigned int SIZE = 10000; + + if (HasRDRAND()) + { + cout << "\nTesting RDRAND generator...\n\n"; + + MeterFilter meter(new Redirector(TheBitBucket())); + Deflator deflator(new Redirector(meter)); + MaurerRandomnessTest maurer; + + ChannelSwitch chsw; + chsw.AddDefaultRoute(deflator); + chsw.AddDefaultRoute(maurer); + + RandomNumberSource rns(rdrand, SIZE, true, new Redirector(chsw)); + deflator.Flush(true); + + assert(0 == maurer.BytesNeeded()); + const double mv = maurer.GetTestValue(); + if (mv < 0.98f) + { + cout << "FAILED:"; + entropy = false; + } + else + cout << "passed:"; + + const std::streamsize oldp = cout.precision(6); + const std::ios::fmtflags oldf = cout.setf(std::ios::fixed, std::ios::floatfield); + cout << " Maurer Randomness Test returned value " << mv << endl; + cout.precision(oldp); + cout.setf(oldf, std::ios::floatfield); + + if (meter.GetTotalBytes() < SIZE) + { + cout << "FAILED:"; + compress = false; + } + else + cout << "passed:"; + cout << " " << SIZE << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE\n"; + + try + { + rdrand.DiscardBytes(SIZE); + } + catch(const Exception&) + { + discard = false; + } + + if (!discard) + cout << "FAILED:"; + else + cout << "passed:"; + cout << " discarded " << SIZE << " bytes\n"; + } + else + cout << "\nRDRAND generator not available, skipping test.\n"; + + if (!(entropy && compress && discard)) + cout.flush(); + + return entropy && compress && discard; +} +#endif + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) +bool TestRDSEED() +{ + RDSEED rdseed; + bool entropy = true, compress = true, discard = true; + static const unsigned int SIZE = 10000; + + if (HasRDSEED()) + { + cout << "\nTesting RDSEED generator...\n\n"; + + MeterFilter meter(new Redirector(TheBitBucket())); + Deflator deflator(new Redirector(meter)); + MaurerRandomnessTest maurer; + + ChannelSwitch chsw; + chsw.AddDefaultRoute(deflator); + chsw.AddDefaultRoute(maurer); + + RandomNumberSource rns(rdseed, SIZE, true, new Redirector(chsw)); + deflator.Flush(true); + + assert(0 == maurer.BytesNeeded()); + const double mv = maurer.GetTestValue(); + if (mv < 0.98f) + { + cout << "FAILED:"; + entropy = false; + } + else + cout << "passed:"; + + const std::streamsize oldp = cout.precision(6); + const std::ios::fmtflags oldf = cout.setf(std::ios::fixed, std::ios::floatfield); + cout << " Maurer Randomness Test returned value " << mv << endl; + cout.precision(oldp); + cout.setf(oldf, std::ios::floatfield); + + if (meter.GetTotalBytes() < SIZE) + { + cout << "FAILED:"; + compress = false; + } + else + cout << "passed:"; + cout << " " << SIZE << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE\n"; + + try + { + rdseed.DiscardBytes(SIZE); + } + catch(const Exception&) + { + discard = false; + } + + if (!discard) + cout << "FAILED:"; + else + cout << "passed:"; + cout << " discarded " << SIZE << " bytes\n"; + } + else + cout << "\nRDSEED generator not available, skipping test.\n"; + + if (!(entropy && compress && discard)) + cout.flush(); + + return entropy && compress && discard; +} +#endif + +// VC50 workaround +typedef auto_ptr apbt; + +class CipherFactory +{ +public: + virtual unsigned int BlockSize() const =0; + virtual unsigned int KeyLength() const =0; + + virtual apbt NewEncryption(const byte *key) const =0; + virtual apbt NewDecryption(const byte *key) const =0; +}; + +template class FixedRoundsCipherFactory : public CipherFactory +{ +public: + FixedRoundsCipherFactory(unsigned int keylen=0) : m_keylen(keylen?keylen:E::DEFAULT_KEYLENGTH) {} + unsigned int BlockSize() const {return E::BLOCKSIZE;} + unsigned int KeyLength() const {return m_keylen;} + + apbt NewEncryption(const byte *key) const + {return apbt(new E(key, m_keylen));} + apbt NewDecryption(const byte *key) const + {return apbt(new D(key, m_keylen));} + + unsigned int m_keylen; +}; + +template class VariableRoundsCipherFactory : public CipherFactory +{ +public: + VariableRoundsCipherFactory(unsigned int keylen=0, unsigned int rounds=0) + : m_keylen(keylen ? keylen : E::DEFAULT_KEYLENGTH), m_rounds(rounds ? rounds : E::DEFAULT_ROUNDS) {} + unsigned int BlockSize() const {return E::BLOCKSIZE;} + unsigned int KeyLength() const {return m_keylen;} + + apbt NewEncryption(const byte *key) const + {return apbt(new E(key, m_keylen, m_rounds));} + apbt NewDecryption(const byte *key) const + {return apbt(new D(key, m_keylen, m_rounds));} + + unsigned int m_keylen, m_rounds; +}; + +bool BlockTransformationTest(const CipherFactory &cg, BufferedTransformation &valdata, unsigned int tuples = 0xffff) +{ + HexEncoder output(new FileSink(cout)); + SecByteBlock plain(cg.BlockSize()), cipher(cg.BlockSize()), out(cg.BlockSize()), outplain(cg.BlockSize()); + SecByteBlock key(cg.KeyLength()); + bool pass=true, fail; + + while (valdata.MaxRetrievable() && tuples--) + { + valdata.Get(key, cg.KeyLength()); + valdata.Get(plain, cg.BlockSize()); + valdata.Get(cipher, cg.BlockSize()); + + apbt transE = cg.NewEncryption(key); + transE->ProcessBlock(plain, out); + fail = memcmp(out, cipher, cg.BlockSize()) != 0; + + apbt transD = cg.NewDecryption(key); + transD->ProcessBlock(out, outplain); + fail=fail || memcmp(outplain, plain, cg.BlockSize()); + + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + output.Put(key, cg.KeyLength()); + cout << " "; + output.Put(outplain, cg.BlockSize()); + cout << " "; + output.Put(out, cg.BlockSize()); + cout << endl; + } + return pass; +} + +class FilterTester : public Unflushable +{ +public: + FilterTester(const byte *validOutput, size_t outputLen) + : validOutput(validOutput), outputLen(outputLen), counter(0), fail(false) {} + void PutByte(byte inByte) + { + if (counter >= outputLen || validOutput[counter] != inByte) + { + std::cerr << "incorrect output " << counter << ", " << (word16)validOutput[counter] << ", " << (word16)inByte << "\n"; + fail = true; + assert(false); + } + counter++; + } + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) + { + CRYPTOPP_UNUSED(messageEnd), CRYPTOPP_UNUSED(blocking); + + while (length--) + FilterTester::PutByte(*inString++); + + if (messageEnd) + if (counter != outputLen) + { + fail = true; + assert(false); + } + + return 0; + } + bool GetResult() + { + return !fail; + } + + const byte *validOutput; + size_t outputLen, counter; + bool fail; +}; + +bool TestFilter(BufferedTransformation &bt, const byte *in, size_t inLen, const byte *out, size_t outLen) +{ + FilterTester *ft; + bt.Attach(ft = new FilterTester(out, outLen)); + + while (inLen) + { + size_t randomLen = GlobalRNG().GenerateWord32(0, (word32)inLen); + bt.Put(in, randomLen); + in += randomLen; + inLen -= randomLen; + } + bt.MessageEnd(); + return ft->GetResult(); +} + +bool ValidateDES() +{ + cout << "\nDES validation suite running...\n\n"; + + FileSource valdata("TestData/descert.dat", true, new HexDecoder); + bool pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata); + + cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n"; + + FileSource valdata1("TestData/3desval.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; + + return pass; +} + +bool TestModeIV(SymmetricCipher &e, SymmetricCipher &d) +{ + SecByteBlock lastIV, iv(e.IVSize()); + StreamTransformationFilter filter(e, new StreamTransformationFilter(d)); + + // vector_ptr due to Enterprise Analysis finding on the stack based array. + vector_ptr plaintext(20480); + + for (unsigned int i=1; i<20480; i*=2) + { + e.GetNextIV(GlobalRNG(), iv); + if (iv == lastIV) + return false; + else + lastIV = iv; + + e.Resynchronize(iv); + d.Resynchronize(iv); + + unsigned int length = STDMAX(GlobalRNG().GenerateWord32(0, i), (word32)e.MinLastBlockSize()); + GlobalRNG().GenerateBlock(plaintext, length); + + if (!TestFilter(filter, plaintext, length, plaintext, length)) + return false; + } + + return true; +} + +bool ValidateCipherModes() +{ + cout << "\nTesting DES modes...\n\n"; + const byte key[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; + const byte iv[] = {0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}; + const byte plain[] = { // "Now is the time for all " without tailing 0 + 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, + 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, + 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20}; + DESEncryption desE(key); + DESDecryption desD(key); + bool pass=true, fail; + + { + // from FIPS 81 + const byte encrypted[] = { + 0x3f, 0xa4, 0x0e, 0x8a, 0x98, 0x4d, 0x48, 0x15, + 0x6a, 0x27, 0x17, 0x87, 0xab, 0x88, 0x83, 0xf9, + 0x89, 0x3d, 0x51, 0xec, 0x4b, 0x56, 0x3b, 0x53}; + + ECB_Mode_ExternalCipher::Encryption modeE(desE); + fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::NO_PADDING).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "ECB encryption" << endl; + + ECB_Mode_ExternalCipher::Decryption modeD(desD); + fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::NO_PADDING).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "ECB decryption" << endl; + } + { + // from FIPS 81 + const byte encrypted[] = { + 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, + 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F, + 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6}; + + CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::NO_PADDING).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC encryption with no padding" << endl; + + CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); + fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::NO_PADDING).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC decryption with no padding" << endl; + + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC mode IV generation" << endl; + } + { + // generated with Crypto++, matches FIPS 81 + // but has extra 8 bytes as result of padding + const byte encrypted[] = { + 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, + 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F, + 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6, + 0x62, 0xC1, 0x6A, 0x27, 0xE4, 0xFC, 0xF2, 0x77}; + + CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC encryption with PKCS #7 padding" << endl; + + CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC decryption with PKCS #7 padding" << endl; + } + { + // generated with Crypto++ 5.2, matches FIPS 81 + // but has extra 8 bytes as result of padding + const byte encrypted[] = { + 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, + 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F, + 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6, + 0xcf, 0xb7, 0xc7, 0x64, 0x0e, 0x7c, 0xd9, 0xa7}; + + CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::ONE_AND_ZEROS_PADDING).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC encryption with one-and-zeros padding" << endl; + + CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); + fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::ONE_AND_ZEROS_PADDING).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC decryption with one-and-zeros padding" << endl; + } + { + const byte plain_1[] = {'a', 0, 0, 0, 0, 0, 0, 0}; + // generated with Crypto++ + const byte encrypted[] = { + 0x9B, 0x47, 0x57, 0x59, 0xD6, 0x9C, 0xF6, 0xD0}; + + CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::ZEROS_PADDING).Ref(), + plain_1, 1, encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC encryption with zeros padding" << endl; + + CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); + fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::ZEROS_PADDING).Ref(), + encrypted, sizeof(encrypted), plain_1, sizeof(plain_1)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC decryption with zeros padding" << endl; + } + { + // generated with Crypto++, matches FIPS 81 + // but with last two blocks swapped as result of CTS + const byte encrypted[] = { + 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, + 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6, + 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F}; + + CBC_CTS_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC encryption with ciphertext stealing (CTS)" << endl; + + CBC_CTS_Mode_ExternalCipher::Decryption modeD(desD, iv); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC decryption with ciphertext stealing (CTS)" << endl; + + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC CTS IV generation" << endl; + } + { + // generated with Crypto++ + const byte decryptionIV[] = {0x4D, 0xD0, 0xAC, 0x8F, 0x47, 0xCF, 0x79, 0xCE}; + const byte encrypted[] = {0x12, 0x34, 0x56}; + + byte stolenIV[8]; + + CBC_CTS_Mode_ExternalCipher::Encryption modeE(desE, iv); + modeE.SetStolenIV(stolenIV); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain, 3, encrypted, sizeof(encrypted)); + fail = memcmp(stolenIV, decryptionIV, 8) != 0 || fail; + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC encryption with ciphertext and IV stealing" << endl; + + CBC_CTS_Mode_ExternalCipher::Decryption modeD(desD, stolenIV); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain, 3); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC decryption with ciphertext and IV stealing" << endl; + } + { + const byte encrypted[] = { // from FIPS 81 + 0xF3,0x09,0x62,0x49,0xC7,0xF4,0x6E,0x51, + 0xA6,0x9E,0x83,0x9B,0x1A,0x92,0xF7,0x84, + 0x03,0x46,0x71,0x33,0x89,0x8E,0xA6,0x22}; + + CFB_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CFB encryption" << endl; + + CFB_Mode_ExternalCipher::Decryption modeD(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CFB decryption" << endl; + + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CFB mode IV generation" << endl; + } + { + const byte plain_2[] = { // "Now is the." without tailing 0 + 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,0x68,0x65}; + const byte encrypted[] = { // from FIPS 81 + 0xf3,0x1f,0xda,0x07,0x01,0x14,0x62,0xee,0x18,0x7f}; + + CFB_Mode_ExternalCipher::Encryption modeE(desE, iv, 1); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain_2, sizeof(plain_2), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CFB (8-bit feedback) encryption" << endl; + + CFB_Mode_ExternalCipher::Decryption modeD(desE, iv, 1); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain_2, sizeof(plain_2)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CFB (8-bit feedback) decryption" << endl; + + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CFB (8-bit feedback) IV generation" << endl; + } + { + const byte encrypted[] = { // from Eric Young's libdes + 0xf3,0x09,0x62,0x49,0xc7,0xf4,0x6e,0x51, + 0x35,0xf2,0x4a,0x24,0x2e,0xeb,0x3d,0x3f, + 0x3d,0x6d,0x5b,0xe3,0x25,0x5a,0xf8,0xc3}; + + OFB_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "OFB encryption" << endl; + + OFB_Mode_ExternalCipher::Decryption modeD(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "OFB decryption" << endl; + + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "OFB IV generation" << endl; + } + { + const byte encrypted[] = { // generated with Crypto++ + 0xF3, 0x09, 0x62, 0x49, 0xC7, 0xF4, 0x6E, 0x51, + 0x16, 0x3A, 0x8C, 0xA0, 0xFF, 0xC9, 0x4C, 0x27, + 0xFA, 0x2F, 0x80, 0xF4, 0x80, 0xB8, 0x6F, 0x75}; + + CTR_Mode_ExternalCipher::Encryption modeE(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), + plain, sizeof(plain), encrypted, sizeof(encrypted)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "Counter Mode encryption" << endl; + + CTR_Mode_ExternalCipher::Decryption modeD(desE, iv); + fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), + encrypted, sizeof(encrypted), plain, sizeof(plain)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "Counter Mode decryption" << endl; + + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "Counter Mode IV generation" << endl; + } + { + const byte plain_3[] = { // "7654321 Now is the time for " + 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20, + 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, + 0x66, 0x6f, 0x72, 0x20}; + const byte mac1[] = { // from FIPS 113 + 0xf1, 0xd3, 0x0f, 0x68, 0x49, 0x31, 0x2c, 0xa4}; + const byte mac2[] = { // generated with Crypto++ + 0x35, 0x80, 0xC5, 0xC4, 0x6B, 0x81, 0x24, 0xE2}; + + CBC_MAC cbcmac(key); + HashFilter cbcmacFilter(cbcmac); + fail = !TestFilter(cbcmacFilter, plain_3, sizeof(plain_3), mac1, sizeof(mac1)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "CBC MAC" << endl; + + DMAC dmac(key); + HashFilter dmacFilter(dmac); + fail = !TestFilter(dmacFilter, plain_3, sizeof(plain_3), mac2, sizeof(mac2)); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "DMAC" << endl; + } + { + CTR_Mode::Encryption modeE(plain, 16, plain); + CTR_Mode::Decryption modeD(plain, 16, plain); + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "AES CTR Mode" << endl; + } + { + OFB_Mode::Encryption modeE(plain, 16, plain); + OFB_Mode::Decryption modeD(plain, 16, plain); + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "AES OFB Mode" << endl; + } + { + CFB_Mode::Encryption modeE(plain, 16, plain); + CFB_Mode::Decryption modeD(plain, 16, plain); + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "AES CFB Mode" << endl; + } + { + CBC_Mode::Encryption modeE(plain, 16, plain); + CBC_Mode::Decryption modeD(plain, 16, plain); + fail = !TestModeIV(modeE, modeD); + pass = pass && !fail; + cout << (fail ? "FAILED " : "passed ") << "AES CBC Mode" << endl; + } + + return pass; +} + +bool ValidateIDEA() +{ + cout << "\nIDEA validation suite running...\n\n"; + + FileSource valdata("TestData/ideaval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); +} + +bool ValidateSAFER() +{ + cout << "\nSAFER validation suite running...\n\n"; + + FileSource valdata("TestData/saferval.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(VariableRoundsCipherFactory(8,6), valdata, 4) && pass; + pass = BlockTransformationTest(VariableRoundsCipherFactory(16,12), valdata, 4) && pass; + pass = BlockTransformationTest(VariableRoundsCipherFactory(8,6), valdata, 4) && pass; + pass = BlockTransformationTest(VariableRoundsCipherFactory(16,10), valdata, 4) && pass; + return pass; +} + +bool ValidateRC2() +{ + cout << "\nRC2 validation suite running...\n\n"; + + FileSource valdata("TestData/rc2val.dat", true, new HexDecoder); + HexEncoder output(new FileSink(cout)); + SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE); + SecByteBlock key(128); + bool pass=true, fail; + + while (valdata.MaxRetrievable()) + { + byte keyLen, effectiveLen; + + valdata.Get(keyLen); + valdata.Get(effectiveLen); + valdata.Get(key, keyLen); + valdata.Get(plain, RC2Encryption::BLOCKSIZE); + valdata.Get(cipher, RC2Encryption::BLOCKSIZE); + + apbt transE(new RC2Encryption(key, keyLen, effectiveLen)); + transE->ProcessBlock(plain, out); + fail = memcmp(out, cipher, RC2Encryption::BLOCKSIZE) != 0; + + apbt transD(new RC2Decryption(key, keyLen, effectiveLen)); + transD->ProcessBlock(out, outplain); + fail=fail || memcmp(outplain, plain, RC2Encryption::BLOCKSIZE); + + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + output.Put(key, keyLen); + cout << " "; + output.Put(outplain, RC2Encryption::BLOCKSIZE); + cout << " "; + output.Put(out, RC2Encryption::BLOCKSIZE); + cout << endl; + } + return pass; +} + +bool ValidateARC4() +{ + unsigned char Key0[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; + unsigned char Input0[]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; + unsigned char Output0[] = {0x75,0xb7,0x87,0x80,0x99,0xe0,0xc5,0x96}; + + unsigned char Key1[]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; + unsigned char Input1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + unsigned char Output1[]={0x74,0x94,0xc2,0xe7,0x10,0x4b,0x08,0x79}; + + unsigned char Key2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + unsigned char Input2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + unsigned char Output2[]={0xde,0x18,0x89,0x41,0xa3,0x37,0x5d,0x3a}; + + unsigned char Key3[]={0xef,0x01,0x23,0x45}; + unsigned char Input3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + unsigned char Output3[]={0xd6,0xa1,0x41,0xa7,0xec,0x3c,0x38,0xdf,0xbd,0x61}; + + unsigned char Key4[]={ 0x01,0x23,0x45,0x67,0x89,0xab, 0xcd,0xef }; + unsigned char Input4[] = + {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x01}; + unsigned char Output4[]= { + 0x75,0x95,0xc3,0xe6,0x11,0x4a,0x09,0x78,0x0c,0x4a,0xd4, + 0x52,0x33,0x8e,0x1f,0xfd,0x9a,0x1b,0xe9,0x49,0x8f, + 0x81,0x3d,0x76,0x53,0x34,0x49,0xb6,0x77,0x8d,0xca, + 0xd8,0xc7,0x8a,0x8d,0x2b,0xa9,0xac,0x66,0x08,0x5d, + 0x0e,0x53,0xd5,0x9c,0x26,0xc2,0xd1,0xc4,0x90,0xc1, + 0xeb,0xbe,0x0c,0xe6,0x6d,0x1b,0x6b,0x1b,0x13,0xb6, + 0xb9,0x19,0xb8,0x47,0xc2,0x5a,0x91,0x44,0x7a,0x95, + 0xe7,0x5e,0x4e,0xf1,0x67,0x79,0xcd,0xe8,0xbf,0x0a, + 0x95,0x85,0x0e,0x32,0xaf,0x96,0x89,0x44,0x4f,0xd3, + 0x77,0x10,0x8f,0x98,0xfd,0xcb,0xd4,0xe7,0x26,0x56, + 0x75,0x00,0x99,0x0b,0xcc,0x7e,0x0c,0xa3,0xc4,0xaa, + 0xa3,0x04,0xa3,0x87,0xd2,0x0f,0x3b,0x8f,0xbb,0xcd, + 0x42,0xa1,0xbd,0x31,0x1d,0x7a,0x43,0x03,0xdd,0xa5, + 0xab,0x07,0x88,0x96,0xae,0x80,0xc1,0x8b,0x0a,0xf6, + 0x6d,0xff,0x31,0x96,0x16,0xeb,0x78,0x4e,0x49,0x5a, + 0xd2,0xce,0x90,0xd7,0xf7,0x72,0xa8,0x17,0x47,0xb6, + 0x5f,0x62,0x09,0x3b,0x1e,0x0d,0xb9,0xe5,0xba,0x53, + 0x2f,0xaf,0xec,0x47,0x50,0x83,0x23,0xe6,0x71,0x32, + 0x7d,0xf9,0x44,0x44,0x32,0xcb,0x73,0x67,0xce,0xc8, + 0x2f,0x5d,0x44,0xc0,0xd0,0x0b,0x67,0xd6,0x50,0xa0, + 0x75,0xcd,0x4b,0x70,0xde,0xdd,0x77,0xeb,0x9b,0x10, + 0x23,0x1b,0x6b,0x5b,0x74,0x13,0x47,0x39,0x6d,0x62, + 0x89,0x74,0x21,0xd4,0x3d,0xf9,0xb4,0x2e,0x44,0x6e, + 0x35,0x8e,0x9c,0x11,0xa9,0xb2,0x18,0x4e,0xcb,0xef, + 0x0c,0xd8,0xe7,0xa8,0x77,0xef,0x96,0x8f,0x13,0x90, + 0xec,0x9b,0x3d,0x35,0xa5,0x58,0x5c,0xb0,0x09,0x29, + 0x0e,0x2f,0xcd,0xe7,0xb5,0xec,0x66,0xd9,0x08,0x4b, + 0xe4,0x40,0x55,0xa6,0x19,0xd9,0xdd,0x7f,0xc3,0x16, + 0x6f,0x94,0x87,0xf7,0xcb,0x27,0x29,0x12,0x42,0x64, + 0x45,0x99,0x85,0x14,0xc1,0x5d,0x53,0xa1,0x8c,0x86, + 0x4c,0xe3,0xa2,0xb7,0x55,0x57,0x93,0x98,0x81,0x26, + 0x52,0x0e,0xac,0xf2,0xe3,0x06,0x6e,0x23,0x0c,0x91, + 0xbe,0xe4,0xdd,0x53,0x04,0xf5,0xfd,0x04,0x05,0xb3, + 0x5b,0xd9,0x9c,0x73,0x13,0x5d,0x3d,0x9b,0xc3,0x35, + 0xee,0x04,0x9e,0xf6,0x9b,0x38,0x67,0xbf,0x2d,0x7b, + 0xd1,0xea,0xa5,0x95,0xd8,0xbf,0xc0,0x06,0x6f,0xf8, + 0xd3,0x15,0x09,0xeb,0x0c,0x6c,0xaa,0x00,0x6c,0x80, + 0x7a,0x62,0x3e,0xf8,0x4c,0x3d,0x33,0xc1,0x95,0xd2, + 0x3e,0xe3,0x20,0xc4,0x0d,0xe0,0x55,0x81,0x57,0xc8, + 0x22,0xd4,0xb8,0xc5,0x69,0xd8,0x49,0xae,0xd5,0x9d, + 0x4e,0x0f,0xd7,0xf3,0x79,0x58,0x6b,0x4b,0x7f,0xf6, + 0x84,0xed,0x6a,0x18,0x9f,0x74,0x86,0xd4,0x9b,0x9c, + 0x4b,0xad,0x9b,0xa2,0x4b,0x96,0xab,0xf9,0x24,0x37, + 0x2c,0x8a,0x8f,0xff,0xb1,0x0d,0x55,0x35,0x49,0x00, + 0xa7,0x7a,0x3d,0xb5,0xf2,0x05,0xe1,0xb9,0x9f,0xcd, + 0x86,0x60,0x86,0x3a,0x15,0x9a,0xd4,0xab,0xe4,0x0f, + 0xa4,0x89,0x34,0x16,0x3d,0xdd,0xe5,0x42,0xa6,0x58, + 0x55,0x40,0xfd,0x68,0x3c,0xbf,0xd8,0xc0,0x0f,0x12, + 0x12,0x9a,0x28,0x4d,0xea,0xcc,0x4c,0xde,0xfe,0x58, + 0xbe,0x71,0x37,0x54,0x1c,0x04,0x71,0x26,0xc8,0xd4, + 0x9e,0x27,0x55,0xab,0x18,0x1a,0xb7,0xe9,0x40,0xb0, + 0xc0}; + + // VC60 workaround: auto_ptr lacks reset() + member_ptr arc4; + bool pass=true, fail; + unsigned int i; + + cout << "\nARC4 validation suite running...\n\n"; + + arc4.reset(new Weak::ARC4(Key0, sizeof(Key0))); + arc4->ProcessString(Input0, sizeof(Input0)); + fail = memcmp(Input0, Output0, sizeof(Input0)) != 0; + cout << (fail ? "FAILED" : "passed") << " Test 0" << endl; + pass = pass && !fail; + + arc4.reset(new Weak::ARC4(Key1, sizeof(Key1))); + arc4->ProcessString(Key1, Input1, sizeof(Key1)); + fail = memcmp(Output1, Key1, sizeof(Key1)) != 0; + cout << (fail ? "FAILED" : "passed") << " Test 1" << endl; + pass = pass && !fail; + + arc4.reset(new Weak::ARC4(Key2, sizeof(Key2))); + for (i=0, fail=false; iProcessByte(Input2[i]) != Output2[i]) + fail = true; + cout << (fail ? "FAILED" : "passed") << " Test 2" << endl; + pass = pass && !fail; + + arc4.reset(new Weak::ARC4(Key3, sizeof(Key3))); + for (i=0, fail=false; iProcessByte(Input3[i]) != Output3[i]) + fail = true; + cout << (fail ? "FAILED" : "passed") << " Test 3" << endl; + pass = pass && !fail; + + arc4.reset(new Weak::ARC4(Key4, sizeof(Key4))); + for (i=0, fail=false; iProcessByte(Input4[i]) != Output4[i]) + fail = true; + cout << (fail ? "FAILED" : "passed") << " Test 4" << endl; + pass = pass && !fail; + + return pass; +} + +bool ValidateRC5() +{ + cout << "\nRC5 validation suite running...\n\n"; + + FileSource valdata("TestData/rc5val.dat", true, new HexDecoder); + return BlockTransformationTest(VariableRoundsCipherFactory(16, 12), valdata); +} + +bool ValidateRC6() +{ + cout << "\nRC6 validation suite running...\n\n"; + + FileSource valdata("TestData/rc6val.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 2) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 2) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; + return pass; +} + +bool ValidateMARS() +{ + cout << "\nMARS validation suite running...\n\n"; + + FileSource valdata("TestData/marsval.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; + return pass; +} + +bool ValidateRijndael() +{ + cout << "\nRijndael (AES) validation suite running...\n\n"; + + FileSource valdata("TestData/rijndael.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; + pass = RunTestDataFile("TestVectors/aes.txt") && pass; + return pass; +} + +bool ValidateTwofish() +{ + cout << "\nTwofish validation suite running...\n\n"; + + FileSource valdata("TestData/twofishv.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; + return pass; +} + +bool ValidateSerpent() +{ + cout << "\nSerpent validation suite running...\n\n"; + + FileSource valdata("TestData/serpentv.dat", true, new HexDecoder); + bool pass = true; + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 5) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 3) && pass; + return pass; +} + +bool ValidateBlowfish() +{ + cout << "\nBlowfish validation suite running...\n\n"; + + HexEncoder output(new FileSink(cout)); + const char *key[]={"abcdefghijklmnopqrstuvwxyz", "Who is John Galt?"}; + byte *plain[]={(byte *)"BLOWFISH", (byte *)"\xfe\xdc\xba\x98\x76\x54\x32\x10"}; + byte *cipher[]={(byte *)"\x32\x4e\xd0\xfe\xf4\x13\xa2\x03", (byte *)"\xcc\x91\x73\x2b\x80\x22\xf6\x84"}; + byte out[8], outplain[8]; + bool pass=true, fail; + + for (int i=0; i<2; i++) + { + ECB_Mode::Encryption enc((byte *)key[i], strlen(key[i])); + enc.ProcessData(out, plain[i], 8); + fail = memcmp(out, cipher[i], 8) != 0; + + ECB_Mode::Decryption dec((byte *)key[i], strlen(key[i])); + dec.ProcessData(outplain, cipher[i], 8); + fail = fail || memcmp(outplain, plain[i], 8); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << '\"' << key[i] << '\"'; + for (int j=0; j<(signed int)(30-strlen(key[i])); j++) + cout << ' '; + output.Put(outplain, 8); + cout << " "; + output.Put(out, 8); + cout << endl; + } + return pass; +} + +bool ValidateThreeWay() +{ + cout << "\n3-WAY validation suite running...\n\n"; + + FileSource valdata("TestData/3wayval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); +} + +bool ValidateGOST() +{ + cout << "\nGOST validation suite running...\n\n"; + + FileSource valdata("TestData/gostval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); +} + +bool ValidateSHARK() +{ + cout << "\nSHARK validation suite running...\n\n"; + + FileSource valdata("TestData/sharkval.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); +} + +bool ValidateCAST() +{ + bool pass = true; + + cout << "\nCAST-128 validation suite running...\n\n"; + + FileSource val128("TestData/cast128v.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), val128, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(10), val128, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(5), val128, 1) && pass; + + cout << "\nCAST-256 validation suite running...\n\n"; + + FileSource val256("TestData/cast256v.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), val256, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), val256, 1) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), val256, 1) && pass; + + return pass; +} + +bool ValidateSquare() +{ + cout << "\nSquare validation suite running...\n\n"; + + FileSource valdata("TestData/squareva.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); +} + +bool ValidateSKIPJACK() +{ + cout << "\nSKIPJACK validation suite running...\n\n"; + + FileSource valdata("TestData/skipjack.dat", true, new HexDecoder); + return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); +} + +bool ValidateSEAL() +{ + byte input[] = {0x37,0xa0,0x05,0x95,0x9b,0x84,0xc4,0x9c,0xa4,0xbe,0x1e,0x05,0x06,0x73,0x53,0x0f,0x5f,0xb0,0x97,0xfd,0xf6,0xa1,0x3f,0xbd,0x6c,0x2c,0xde,0xcd,0x81,0xfd,0xee,0x7c}; + byte output[32]; + byte key[] = {0x67, 0x45, 0x23, 0x01, 0xef, 0xcd, 0xab, 0x89, 0x98, 0xba, 0xdc, 0xfe, 0x10, 0x32, 0x54, 0x76, 0xc3, 0xd2, 0xe1, 0xf0}; + byte iv[] = {0x01, 0x35, 0x77, 0xaf}; + + cout << "\nSEAL validation suite running...\n\n"; + + SEAL<>::Encryption seal(key, sizeof(key), iv); + unsigned int size = sizeof(input); + bool pass = true; + + memset(output, 1, size); + seal.ProcessString(output, input, size); + for (unsigned int i=0; i(16), valdata, 4) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(64), valdata, 10) && pass; + return pass; +} + +bool ValidateCamellia() +{ + cout << "\nCamellia validation suite running...\n\n"; + + bool pass = true; + FileSource valdata("TestData/camellia.dat", true, new HexDecoder); + pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 15) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 15) && pass; + pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 15) && pass; + return pass; +} + +bool ValidateSalsa() +{ + cout << "\nSalsa validation suite running...\n"; + + return RunTestDataFile("TestVectors/salsa.txt"); +} + +bool ValidateSosemanuk() +{ + cout << "\nSosemanuk validation suite running...\n"; + return RunTestDataFile("TestVectors/sosemanuk.txt"); +} + +bool ValidateVMAC() +{ + cout << "\nVMAC validation suite running...\n"; + return RunTestDataFile("TestVectors/vmac.txt"); +} + +bool ValidateCCM() +{ + cout << "\nAES/CCM validation suite running...\n"; + return RunTestDataFile("TestVectors/ccm.txt"); +} + +bool ValidateGCM() +{ + cout << "\nAES/GCM validation suite running...\n"; + cout << "\n2K tables:"; + bool pass = RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)2048)); + cout << "\n64K tables:"; + return RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)64*1024)) && pass; +} + +bool ValidateCMAC() +{ + cout << "\nCMAC validation suite running...\n"; + return RunTestDataFile("TestVectors/cmac.txt"); +} diff --git a/external/crypto++-5.6.3/validat2.cpp b/external/crypto++-5.6.3/validat2.cpp new file mode 100644 index 000000000..b13d9bfdc --- /dev/null +++ b/external/crypto++-5.6.3/validat2.cpp @@ -0,0 +1,852 @@ +// validat2.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 + +#include "cryptlib.h" +#include "pubkey.h" +#include "gfpcrypt.h" +#include "eccrypto.h" +#include "blumshub.h" +#include "filters.h" +#include "files.h" +#include "rsa.h" +#include "md2.h" +#include "elgamal.h" +#include "nr.h" +#include "dsa.h" +#include "dh.h" +#include "mqv.h" +#include "luc.h" +#include "xtrcrypt.h" +#include "rabin.h" +#include "rw.h" +#include "eccrypto.h" +#include "integer.h" +#include "gf2n.h" +#include "ecp.h" +#include "ec2n.h" +#include "asn.h" +#include "rng.h" +#include "hex.h" +#include "oids.h" +#include "esign.h" +#include "osrng.h" +#include "smartptr.h" + +#include +#include +#include + +#include "validate.h" + +// Aggressive stack checking with VS2005 SP1 and above. +#if (CRYPTOPP_MSC_VERSION >= 1410) +# pragma strict_gs_check (on) +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +class FixedRNG : public RandomNumberGenerator +{ +public: + FixedRNG(BufferedTransformation &source) : m_source(source) {} + + void GenerateBlock(byte *output, size_t size) + { + m_source.Get(output, size); + } + +private: + BufferedTransformation &m_source; +}; + +bool ValidateBBS() +{ + cout << "\nBlumBlumShub validation suite running...\n\n"; + + Integer p("212004934506826557583707108431463840565872545889679278744389317666981496005411448865750399674653351"); + Integer q("100677295735404212434355574418077394581488455772477016953458064183204108039226017738610663984508231"); + Integer seed("63239752671357255800299643604761065219897634268887145610573595874544114193025997412441121667211431"); + BlumBlumShub bbs(p, q, seed); + bool pass = true, fail; + int j; + + const byte output1[] = { + 0x49,0xEA,0x2C,0xFD,0xB0,0x10,0x64,0xA0,0xBB,0xB9, + 0x2A,0xF1,0x01,0xDA,0xC1,0x8A,0x94,0xF7,0xB7,0xCE}; + const byte output2[] = { + 0x74,0x45,0x48,0xAE,0xAC,0xB7,0x0E,0xDF,0xAF,0xD7, + 0xD5,0x0E,0x8E,0x29,0x83,0x75,0x6B,0x27,0x46,0xA1}; + + byte buf[20]; + + bbs.GenerateBlock(buf, 20); + fail = memcmp(output1, buf, 20) != 0; + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + for (j=0;j<20;j++) + cout << setw(2) << setfill('0') << hex << (int)buf[j]; + cout << endl; + + bbs.Seek(10); + bbs.GenerateBlock(buf, 10); + fail = memcmp(output1+10, buf, 10) != 0; + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + for (j=0;j<10;j++) + cout << setw(2) << setfill('0') << hex << (int)buf[j]; + cout << endl; + + bbs.Seek(1234567); + bbs.GenerateBlock(buf, 20); + fail = memcmp(output2, buf, 20) != 0; + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + for (j=0;j<20;j++) + cout << setw(2) << setfill('0') << hex << (int)buf[j]; + cout << endl; + + return pass; +} + +bool SignatureValidate(PK_Signer &priv, PK_Verifier &pub, bool thorough = false) +{ + bool pass = true, fail; + + fail = !pub.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2) || !priv.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "signature key validation\n"; + + const byte *message = (byte *)"test message"; + const int messageLen = 12; + + SecByteBlock signature(priv.MaxSignatureLength()); + size_t signatureLength = priv.SignMessage(GlobalRNG(), message, messageLen, signature); + fail = !pub.VerifyMessage(message, messageLen, signature, signatureLength); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "signature and verification\n"; + + ++signature[0]; + fail = pub.VerifyMessage(message, messageLen, signature, signatureLength); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "checking invalid signature" << endl; + + if (priv.MaxRecoverableLength() > 0) + { + signatureLength = priv.SignMessageWithRecovery(GlobalRNG(), message, messageLen, NULL, 0, signature); + SecByteBlock recovered(priv.MaxRecoverableLengthFromSignatureLength(signatureLength)); + DecodingResult result = pub.RecoverMessage(recovered, NULL, 0, signature, signatureLength); + fail = !(result.isValidCoding && result.messageLength == messageLen && memcmp(recovered, message, messageLen) == 0); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "signature and verification with recovery" << endl; + + ++signature[0]; + result = pub.RecoverMessage(recovered, NULL, 0, signature, signatureLength); + fail = result.isValidCoding; + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "recovery with invalid signature" << endl; + } + + return pass; +} + +bool CryptoSystemValidate(PK_Decryptor &priv, PK_Encryptor &pub, bool thorough = false) +{ + bool pass = true, fail; + + fail = !pub.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2) || !priv.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "cryptosystem key validation\n"; + + const byte *message = (byte *)"test message"; + const int messageLen = 12; + SecByteBlock ciphertext(priv.CiphertextLength(messageLen)); + SecByteBlock plaintext(priv.MaxPlaintextLength(ciphertext.size())); + + pub.Encrypt(GlobalRNG(), message, messageLen, ciphertext); + fail = priv.Decrypt(GlobalRNG(), ciphertext, priv.CiphertextLength(messageLen), plaintext) != DecodingResult(messageLen); + fail = fail || memcmp(message, plaintext, messageLen); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "encryption and decryption\n"; + + return pass; +} + +bool SimpleKeyAgreementValidate(SimpleKeyAgreementDomain &d) +{ + if (d.GetCryptoParameters().Validate(GlobalRNG(), 3)) + cout << "passed simple key agreement domain parameters validation" << endl; + else + { + cout << "FAILED simple key agreement domain parameters invalid" << endl; + return false; + } + + SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength()); + SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength()); + SecByteBlock val1(d.AgreedValueLength()), val2(d.AgreedValueLength()); + + d.GenerateKeyPair(GlobalRNG(), priv1, pub1); + d.GenerateKeyPair(GlobalRNG(), priv2, pub2); + + memset(val1.begin(), 0x10, val1.size()); + memset(val2.begin(), 0x11, val2.size()); + + if (!(d.Agree(val1, priv1, pub2) && d.Agree(val2, priv2, pub1))) + { + cout << "FAILED simple key agreement failed" << endl; + return false; + } + + if (memcmp(val1.begin(), val2.begin(), d.AgreedValueLength())) + { + cout << "FAILED simple agreed values not equal" << endl; + return false; + } + + cout << "passed simple key agreement" << endl; + return true; +} + +bool AuthenticatedKeyAgreementValidate(AuthenticatedKeyAgreementDomain &d) +{ + if (d.GetCryptoParameters().Validate(GlobalRNG(), 3)) + cout << "passed authenticated key agreement domain parameters validation" << endl; + else + { + cout << "FAILED authenticated key agreement domain parameters invalid" << endl; + return false; + } + + SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength()); + SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength()); + SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength()); + SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength()); + SecByteBlock val1(d.AgreedValueLength()), val2(d.AgreedValueLength()); + + d.GenerateStaticKeyPair(GlobalRNG(), spriv1, spub1); + d.GenerateStaticKeyPair(GlobalRNG(), spriv2, spub2); + d.GenerateEphemeralKeyPair(GlobalRNG(), epriv1, epub1); + d.GenerateEphemeralKeyPair(GlobalRNG(), epriv2, epub2); + + memset(val1.begin(), 0x10, val1.size()); + memset(val2.begin(), 0x11, val2.size()); + + if (!(d.Agree(val1, spriv1, epriv1, spub2, epub2) && d.Agree(val2, spriv2, epriv2, spub1, epub1))) + { + cout << "FAILED authenticated key agreement failed" << endl; + return false; + } + + if (memcmp(val1.begin(), val2.begin(), d.AgreedValueLength())) + { + cout << "FAILED authenticated agreed values not equal" << endl; + return false; + } + + cout << "passed authenticated key agreement" << endl; + return true; +} + +bool ValidateRSA() +{ + cout << "\nRSA validation suite running...\n\n"; + + byte out[100], outPlain[100]; + bool pass = true, fail; + + { + const char *plain = "Everyone gets Friday off."; + static const byte signature[] = + "\x05\xfa\x6a\x81\x2f\xc7\xdf\x8b\xf4\xf2\x54\x25\x09\xe0\x3e\x84" + "\x6e\x11\xb9\xc6\x20\xbe\x20\x09\xef\xb4\x40\xef\xbc\xc6\x69\x21" + "\x69\x94\xac\x04\xf3\x41\xb5\x7d\x05\x20\x2d\x42\x8f\xb2\xa2\x7b" + "\x5c\x77\xdf\xd9\xb1\x5b\xfc\x3d\x55\x93\x53\x50\x34\x10\xc1\xe1"; + + FileSource keys("TestData/rsa512a.dat", true, new HexDecoder); + Weak::RSASSA_PKCS1v15_MD2_Signer rsaPriv(keys); + Weak::RSASSA_PKCS1v15_MD2_Verifier rsaPub(rsaPriv); + + size_t signatureLength = rsaPriv.SignMessage(GlobalRNG(), (byte *)plain, strlen(plain), out); + fail = memcmp(signature, out, 64) != 0; + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "signature check against test vector\n"; + + fail = !rsaPub.VerifyMessage((byte *)plain, strlen(plain), out, signatureLength); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "verification check against test vector\n"; + + out[10]++; + fail = rsaPub.VerifyMessage((byte *)plain, strlen(plain), out, signatureLength); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "invalid signature verification\n"; + } + { + FileSource keys("TestData/rsa1024.dat", true, new HexDecoder); + RSAES_PKCS1v15_Decryptor rsaPriv(keys); + RSAES_PKCS1v15_Encryptor rsaPub(rsaPriv); + + pass = CryptoSystemValidate(rsaPriv, rsaPub) && pass; + } + { + RSAES >::Decryptor rsaPriv(GlobalRNG(), 512); + RSAES >::Encryptor rsaPub(rsaPriv); + + pass = CryptoSystemValidate(rsaPriv, rsaPub) && pass; + } + { + byte *plain = (byte *) + "\x54\x85\x9b\x34\x2c\x49\xea\x2a"; + static const byte encrypted[] = + "\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a" + "\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4" + "\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52" + "\x62\x51"; + static const byte oaepSeed[] = + "\xaa\xfd\x12\xf6\x59\xca\xe6\x34\x89\xb4\x79\xe5\x07\x6d\xde\xc2" + "\xf0\x6c\xb5\x8f"; + ByteQueue bq; + bq.Put(oaepSeed, 20); + FixedRNG rng(bq); + + FileSource privFile("TestData/rsa400pv.dat", true, new HexDecoder); + FileSource pubFile("TestData/rsa400pb.dat", true, new HexDecoder); + RSAES_OAEP_SHA_Decryptor rsaPriv; + rsaPriv.AccessKey().BERDecodePrivateKey(privFile, false, 0); + RSAES_OAEP_SHA_Encryptor rsaPub(pubFile); + + memset(out, 0, 50); + memset(outPlain, 0, 8); + rsaPub.Encrypt(rng, plain, 8, out); + DecodingResult result = rsaPriv.FixedLengthDecrypt(GlobalRNG(), encrypted, outPlain); + fail = !result.isValidCoding || (result.messageLength!=8) || memcmp(out, encrypted, 50) || memcmp(plain, outPlain, 8); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "PKCS 2.0 encryption and decryption\n"; + } + + return pass; +} + +bool ValidateDH() +{ + cout << "\nDH validation suite running...\n\n"; + + FileSource f("TestData/dh1024.dat", true, new HexDecoder()); + DH dh(f); + return SimpleKeyAgreementValidate(dh); +} + +bool ValidateMQV() +{ + cout << "\nMQV validation suite running...\n\n"; + + FileSource f("TestData/mqv1024.dat", true, new HexDecoder()); + MQV mqv(f); + return AuthenticatedKeyAgreementValidate(mqv); +} + +bool ValidateLUC_DH() +{ + cout << "\nLUC-DH validation suite running...\n\n"; + + FileSource f("TestData/lucd512.dat", true, new HexDecoder()); + LUC_DH dh(f); + return SimpleKeyAgreementValidate(dh); +} + +bool ValidateXTR_DH() +{ + cout << "\nXTR-DH validation suite running...\n\n"; + + FileSource f("TestData/xtrdh171.dat", true, new HexDecoder()); + XTR_DH dh(f); + return SimpleKeyAgreementValidate(dh); +} + +bool ValidateElGamal() +{ + cout << "\nElGamal validation suite running...\n\n"; + bool pass = true; + { + FileSource fc("TestData/elgc1024.dat", true, new HexDecoder); + ElGamalDecryptor privC(fc); + ElGamalEncryptor pubC(privC); + privC.AccessKey().Precompute(); + ByteQueue queue; + privC.AccessKey().SavePrecomputation(queue); + privC.AccessKey().LoadPrecomputation(queue); + + pass = CryptoSystemValidate(privC, pubC) && pass; + } + return pass; +} + +bool ValidateDLIES() +{ + cout << "\nDLIES validation suite running...\n\n"; + bool pass = true; + { + FileSource fc("TestData/dlie1024.dat", true, new HexDecoder); + DLIES<>::Decryptor privC(fc); + DLIES<>::Encryptor pubC(privC); + pass = CryptoSystemValidate(privC, pubC) && pass; + } + { + cout << "Generating new encryption key..." << endl; + DLIES<>::GroupParameters gp; + gp.GenerateRandomWithKeySize(GlobalRNG(), 128); + DLIES<>::Decryptor decryptor; + decryptor.AccessKey().GenerateRandom(GlobalRNG(), gp); + DLIES<>::Encryptor encryptor(decryptor); + + pass = CryptoSystemValidate(decryptor, encryptor) && pass; + } + return pass; +} + +bool ValidateNR() +{ + cout << "\nNR validation suite running...\n\n"; + bool pass = true; + { + FileSource f("TestData/nr2048.dat", true, new HexDecoder); + NR::Signer privS(f); + privS.AccessKey().Precompute(); + NR::Verifier pubS(privS); + + pass = SignatureValidate(privS, pubS) && pass; + } + { + cout << "Generating new signature key..." << endl; + NR::Signer privS(GlobalRNG(), 256); + NR::Verifier pubS(privS); + + pass = SignatureValidate(privS, pubS) && pass; + } + return pass; +} + +bool ValidateDSA(bool thorough) +{ + cout << "\nDSA validation suite running...\n\n"; + + bool pass = true; + FileSource fs1("TestData/dsa1024.dat", true, new HexDecoder()); + DSA::Signer priv(fs1); + DSA::Verifier pub(priv); + FileSource fs2("TestData/dsa1024b.dat", true, new HexDecoder()); + DSA::Verifier pub1(fs2); + assert(pub.GetKey() == pub1.GetKey()); + pass = SignatureValidate(priv, pub, thorough) && pass; + pass = RunTestDataFile("TestVectors/dsa.txt", g_nullNameValuePairs, thorough) && pass; + + return pass; +} + +bool ValidateLUC() +{ + cout << "\nLUC validation suite running...\n\n"; + bool pass=true; + + { + FileSource f("TestData/luc1024.dat", true, new HexDecoder); + LUCSSA_PKCS1v15_SHA_Signer priv(f); + LUCSSA_PKCS1v15_SHA_Verifier pub(priv); + pass = SignatureValidate(priv, pub) && pass; + } + { + LUCES_OAEP_SHA_Decryptor priv(GlobalRNG(), 512); + LUCES_OAEP_SHA_Encryptor pub(priv); + pass = CryptoSystemValidate(priv, pub) && pass; + } + return pass; +} + +bool ValidateLUC_DL() +{ + cout << "\nLUC-HMP validation suite running...\n\n"; + + FileSource f("TestData/lucs512.dat", true, new HexDecoder); + LUC_HMP::Signer privS(f); + LUC_HMP::Verifier pubS(privS); + bool pass = SignatureValidate(privS, pubS); + + cout << "\nLUC-IES validation suite running...\n\n"; + + FileSource fc("TestData/lucc512.dat", true, new HexDecoder); + LUC_IES<>::Decryptor privC(fc); + LUC_IES<>::Encryptor pubC(privC); + pass = CryptoSystemValidate(privC, pubC) && pass; + + return pass; +} + +bool ValidateRabin() +{ + cout << "\nRabin validation suite running...\n\n"; + bool pass=true; + + { + FileSource f("TestData/rabi1024.dat", true, new HexDecoder); + RabinSS::Signer priv(f); + RabinSS::Verifier pub(priv); + pass = SignatureValidate(priv, pub) && pass; + } + { + RabinES >::Decryptor priv(GlobalRNG(), 512); + RabinES >::Encryptor pub(priv); + pass = CryptoSystemValidate(priv, pub) && pass; + } + return pass; +} + +bool ValidateRW() +{ + cout << "\nRW validation suite running...\n\n"; + + FileSource f("TestData/rw1024.dat", true, new HexDecoder); + RWSS::Signer priv(f); + RWSS::Verifier pub(priv); + + return SignatureValidate(priv, pub); +} + +/* +bool ValidateBlumGoldwasser() +{ + cout << "\nBlumGoldwasser validation suite running...\n\n"; + + FileSource f("TestData/blum512.dat", true, new HexDecoder); + BlumGoldwasserPrivateKey priv(f); + BlumGoldwasserPublicKey pub(priv); + + return CryptoSystemValidate(priv, pub); +} +*/ + +#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS) +// Issue 64: "PolynomialMod2::operator<<=", http://github.com/weidai11/cryptopp/issues/64 +bool TestPolynomialMod2() +{ + bool pass1 = true, pass2 = true, pass3 = true; + + cout << "\nTesting PolynomialMod2 bit operations...\n\n"; + + static const unsigned int start = 0; + static const unsigned int stop = 4 * WORD_BITS + 1; + + for (unsigned int i=start; i < stop; i++) + { + PolynomialMod2 p(1); + p <<= i; + + Integer n(Integer::One()); + n <<= i; + + std::ostringstream oss1; + oss1 << p; + + std::string str1, str2; + + // str1 needs the commas removed used for grouping + str1 = oss1.str(); + str1.erase(std::remove(str1.begin(), str1.end(), ','), str1.end()); + + // str1 needs the trailing 'b' removed + str1.erase(str1.end() - 1); + + // str2 is fine as-is + str2 = IntToString(n, 2); + + pass1 &= (str1 == str2); + } + + for (unsigned int i=start; i < stop; i++) + { + const word w(SIZE_MAX); + + PolynomialMod2 p(w); + p <<= i; + + Integer n(Integer::POSITIVE, static_cast(w)); + n <<= i; + + std::ostringstream oss1; + oss1 << p; + + std::string str1, str2; + + // str1 needs the commas removed used for grouping + str1 = oss1.str(); + str1.erase(std::remove(str1.begin(), str1.end(), ','), str1.end()); + + // str1 needs the trailing 'b' removed + str1.erase(str1.end() - 1); + + // str2 is fine as-is + str2 = IntToString(n, 2); + + pass2 &= (str1 == str2); + } + + RandomNumberGenerator& prng = GlobalRNG(); + for (unsigned int i=start; i < stop; i++) + { + word w; // Cast to lword due to Visual Studio + prng.GenerateBlock((byte*)&w, sizeof(w)); + + PolynomialMod2 p(w); + p <<= i; + + Integer n(Integer::POSITIVE, static_cast(w)); + n <<= i; + + std::ostringstream oss1; + oss1 << p; + + std::string str1, str2; + + // str1 needs the commas removed used for grouping + str1 = oss1.str(); + str1.erase(std::remove(str1.begin(), str1.end(), ','), str1.end()); + + // str1 needs the trailing 'b' removed + str1.erase(str1.end() - 1); + + // str2 is fine as-is + str2 = IntToString(n, 2); + + if (str1 != str2) + { + cout << " Oops..." << "\n"; + cout << " random: " << std::hex << n << std::dec << "\n"; + cout << " str1: " << str1 << "\n"; + cout << " str2: " << str2 << "\n"; + } + + pass3 &= (str1 == str2); + } + + cout << (!pass1 ? "FAILED" : "passed") << " " << "1 shifted over range [" << dec << start << "," << stop << "]" << "\n"; + cout << (!pass2 ? "FAILED" : "passed") << " " << "0x" << hex << word(SIZE_MAX) << dec << " shifted over range [" << start << "," << stop << "]" << "\n"; + cout << (!pass3 ? "FAILED" : "passed") << " " << "random values shifted over range [" << dec << start << "," << stop << "]" << "\n"; + + if (!(pass1 && pass2 && pass3)) + cout.flush(); + + return pass1 && pass2 && pass3; +} +#endif + +bool ValidateECP() +{ + cout << "\nECP validation suite running...\n\n"; + + ECIES::Decryptor cpriv(GlobalRNG(), ASN1::secp192r1()); + ECIES::Encryptor cpub(cpriv); + ByteQueue bq; + cpriv.GetKey().DEREncode(bq); + cpub.AccessKey().AccessGroupParameters().SetEncodeAsOID(true); + cpub.GetKey().DEREncode(bq); + ECDSA::Signer spriv(bq); + ECDSA::Verifier spub(bq); + ECDH::Domain ecdhc(ASN1::secp192r1()); + ECMQV::Domain ecmqvc(ASN1::secp192r1()); + + spriv.AccessKey().Precompute(); + ByteQueue queue; + spriv.AccessKey().SavePrecomputation(queue); + spriv.AccessKey().LoadPrecomputation(queue); + + bool pass = SignatureValidate(spriv, spub); + cpub.AccessKey().Precompute(); + cpriv.AccessKey().Precompute(); + pass = CryptoSystemValidate(cpriv, cpub) && pass; + pass = SimpleKeyAgreementValidate(ecdhc) && pass; + pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; + + cout << "Turning on point compression..." << endl; + cpriv.AccessKey().AccessGroupParameters().SetPointCompression(true); + cpub.AccessKey().AccessGroupParameters().SetPointCompression(true); + ecdhc.AccessGroupParameters().SetPointCompression(true); + ecmqvc.AccessGroupParameters().SetPointCompression(true); + pass = CryptoSystemValidate(cpriv, cpub) && pass; + pass = SimpleKeyAgreementValidate(ecdhc) && pass; + pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; + + cout << "Testing SEC 2, NIST, and Brainpool recommended curves..." << endl; + OID oid; + while (!(oid = DL_GroupParameters_EC::GetNextRecommendedParametersOID(oid)).m_values.empty()) + { + DL_GroupParameters_EC params(oid); + bool fail = !params.Validate(GlobalRNG(), 2); + cout << (fail ? "FAILED" : "passed") << " " << dec << params.GetCurve().GetField().MaxElementBitLength() << " bits" << endl; + pass = pass && !fail; + } + + return pass; +} + +bool ValidateEC2N() +{ + cout << "\nEC2N validation suite running...\n\n"; + + ECIES::Decryptor cpriv(GlobalRNG(), ASN1::sect193r1()); + ECIES::Encryptor cpub(cpriv); + ByteQueue bq; + cpriv.DEREncode(bq); + cpub.AccessKey().AccessGroupParameters().SetEncodeAsOID(true); + cpub.DEREncode(bq); + ECDSA::Signer spriv(bq); + ECDSA::Verifier spub(bq); + ECDH::Domain ecdhc(ASN1::sect193r1()); + ECMQV::Domain ecmqvc(ASN1::sect193r1()); + + spriv.AccessKey().Precompute(); + ByteQueue queue; + spriv.AccessKey().SavePrecomputation(queue); + spriv.AccessKey().LoadPrecomputation(queue); + + bool pass = SignatureValidate(spriv, spub); + pass = CryptoSystemValidate(cpriv, cpub) && pass; + pass = SimpleKeyAgreementValidate(ecdhc) && pass; + pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; + + cout << "Turning on point compression..." << endl; + cpriv.AccessKey().AccessGroupParameters().SetPointCompression(true); + cpub.AccessKey().AccessGroupParameters().SetPointCompression(true); + ecdhc.AccessGroupParameters().SetPointCompression(true); + ecmqvc.AccessGroupParameters().SetPointCompression(true); + pass = CryptoSystemValidate(cpriv, cpub) && pass; + pass = SimpleKeyAgreementValidate(ecdhc) && pass; + pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; + +#if 0 // TODO: turn this back on when I make EC2N faster for pentanomial basis + cout << "Testing SEC 2 recommended curves..." << endl; + OID oid; + while (!(oid = DL_GroupParameters_EC::GetNextRecommendedParametersOID(oid)).m_values.empty()) + { + DL_GroupParameters_EC params(oid); + bool fail = !params.Validate(GlobalRNG(), 2); + cout << (fail ? "FAILED" : "passed") << " " << params.GetCurve().GetField().MaxElementBitLength() << " bits" << endl; + pass = pass && !fail; + } +#endif + + return pass; +} + +bool ValidateECDSA() +{ + cout << "\nECDSA validation suite running...\n\n"; + + // from Sample Test Vectors for P1363 + GF2NT gf2n(191, 9, 0); + byte a[]="\x28\x66\x53\x7B\x67\x67\x52\x63\x6A\x68\xF5\x65\x54\xE1\x26\x40\x27\x6B\x64\x9E\xF7\x52\x62\x67"; + byte b[]="\x2E\x45\xEF\x57\x1F\x00\x78\x6F\x67\xB0\x08\x1B\x94\x95\xA3\xD9\x54\x62\xF5\xDE\x0A\xA1\x85\xEC"; + EC2N ec(gf2n, PolynomialMod2(a,24), PolynomialMod2(b,24)); + + EC2N::Point P; + ec.DecodePoint(P, (byte *)"\x04\x36\xB3\xDA\xF8\xA2\x32\x06\xF9\xC4\xF2\x99\xD7\xB2\x1A\x9C\x36\x91\x37\xF2\xC8\x4A\xE1\xAA\x0D" + "\x76\x5B\xE7\x34\x33\xB3\xF9\x5E\x33\x29\x32\xE7\x0E\xA2\x45\xCA\x24\x18\xEA\x0E\xF9\x80\x18\xFB", ec.EncodedPointSize()); + Integer n("40000000000000000000000004a20e90c39067c893bbb9a5H"); + Integer d("340562e1dda332f9d2aec168249b5696ee39d0ed4d03760fH"); + EC2N::Point Q(ec.Multiply(d, P)); + ECDSA::Signer priv(ec, P, n, d); + ECDSA::Verifier pub(priv); + + Integer h("A9993E364706816ABA3E25717850C26C9CD0D89DH"); + Integer k("3eeace72b4919d991738d521879f787cb590aff8189d2b69H"); + static const byte sig[]="\x03\x8e\x5a\x11\xfb\x55\xe4\xc6\x54\x71\xdc\xd4\x99\x84\x52\xb1\xe0\x2d\x8a\xf7\x09\x9b\xb9\x30" + "\x0c\x9a\x08\xc3\x44\x68\xc2\x44\xb4\xe5\xd6\xb2\x1b\x3c\x68\x36\x28\x07\x41\x60\x20\x32\x8b\x6e"; + Integer r(sig, 24); + Integer s(sig+24, 24); + + Integer rOut, sOut; + bool fail, pass=true; + + priv.RawSign(k, h, rOut, sOut); + fail = (rOut != r) || (sOut != s); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "signature check against test vector\n"; + + fail = !pub.VerifyMessage((byte *)"abc", 3, sig, sizeof(sig)); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "verification check against test vector\n"; + + fail = pub.VerifyMessage((byte *)"xyz", 3, sig, sizeof(sig)); + pass = pass && !fail; + + pass = SignatureValidate(priv, pub) && pass; + + return pass; +} + +bool ValidateESIGN() +{ + cout << "\nESIGN validation suite running...\n\n"; + + bool pass = true, fail; + + static const char plain[] = "test"; + static const byte signature[] = + "\xA3\xE3\x20\x65\xDE\xDA\xE7\xEC\x05\xC1\xBF\xCD\x25\x79\x7D\x99\xCD\xD5\x73\x9D\x9D\xF3\xA4\xAA\x9A\xA4\x5A\xC8\x23\x3D\x0D\x37\xFE\xBC\x76\x3F\xF1\x84\xF6\x59" + "\x14\x91\x4F\x0C\x34\x1B\xAE\x9A\x5C\x2E\x2E\x38\x08\x78\x77\xCB\xDC\x3C\x7E\xA0\x34\x44\x5B\x0F\x67\xD9\x35\x2A\x79\x47\x1A\x52\x37\x71\xDB\x12\x67\xC1\xB6\xC6" + "\x66\x73\xB3\x40\x2E\xD6\xF2\x1A\x84\x0A\xB6\x7B\x0F\xEB\x8B\x88\xAB\x33\xDD\xE4\x83\x21\x90\x63\x2D\x51\x2A\xB1\x6F\xAB\xA7\x5C\xFD\x77\x99\xF2\xE1\xEF\x67\x1A" + "\x74\x02\x37\x0E\xED\x0A\x06\xAD\xF4\x15\x65\xB8\xE1\xD1\x45\xAE\x39\x19\xB4\xFF\x5D\xF1\x45\x7B\xE0\xFE\x72\xED\x11\x92\x8F\x61\x41\x4F\x02\x00\xF2\x76\x6F\x7C" + "\x79\xA2\xE5\x52\x20\x5D\x97\x5E\xFE\x39\xAE\x21\x10\xFB\x35\xF4\x80\x81\x41\x13\xDD\xE8\x5F\xCA\x1E\x4F\xF8\x9B\xB2\x68\xFB\x28"; + + FileSource keys("TestData/esig1536.dat", true, new HexDecoder); + ESIGN::Signer signer(keys); + ESIGN::Verifier verifier(signer); + + fail = !SignatureValidate(signer, verifier); + pass = pass && !fail; + + fail = !verifier.VerifyMessage((byte *)plain, strlen(plain), signature, verifier.SignatureLength()); + pass = pass && !fail; + + cout << (fail ? "FAILED " : "passed "); + cout << "verification check against test vector\n"; + + cout << "Generating signature key from seed..." << endl; + signer.AccessKey().GenerateRandom(GlobalRNG(), MakeParameters("Seed", ConstByteArrayParameter((const byte *)"test", 4))("KeySize", 3*512)); + verifier = signer; + + fail = !SignatureValidate(signer, verifier); + pass = pass && !fail; + + return pass; +} diff --git a/external/crypto++-5.6.3/validat3.cpp b/external/crypto++-5.6.3/validat3.cpp new file mode 100644 index 000000000..53d1aabb6 --- /dev/null +++ b/external/crypto++-5.6.3/validat3.cpp @@ -0,0 +1,741 @@ +// validat3.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 + +#include "cryptlib.h" +#include "pubkey.h" +#include "gfpcrypt.h" +#include "eccrypto.h" + +#include "smartptr.h" +#include "crc.h" +#include "adler32.h" +#include "md2.h" +#include "md4.h" +#include "md5.h" +#include "sha.h" +#include "tiger.h" +#include "ripemd.h" +#include "whrlpool.h" +#include "hkdf.h" +#include "hmac.h" +#include "ttmac.h" +#include "integer.h" +#include "pwdbased.h" +#include "filters.h" +#include "files.h" +#include "hex.h" +#include "smartptr.h" + +#include +#include +#include + +#include "validate.h" + +// Aggressive stack checking with VS2005 SP1 and above. +#if (CRYPTOPP_MSC_VERSION >= 1410) +# pragma strict_gs_check (on) +#endif + +USING_NAMESPACE(CryptoPP) +USING_NAMESPACE(std) + +struct HashTestTuple +{ + HashTestTuple(const char *input, const char *output, unsigned int repeatTimes=1) + : input((byte *)input), output((byte *)output), inputLen(strlen(input)), repeatTimes(repeatTimes) {} + + HashTestTuple(const char *input, unsigned int inputLen, const char *output, unsigned int repeatTimes) + : input((byte *)input), output((byte *)output), inputLen(inputLen), repeatTimes(repeatTimes) {} + + const byte *input, *output; + size_t inputLen; + unsigned int repeatTimes; +}; + +bool HashModuleTest(HashTransformation &md, const HashTestTuple *testSet, unsigned int testSetSize) +{ + bool pass=true, fail; + SecByteBlock digest(md.DigestSize()); + + // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) + std::ostringstream out; + out.copyfmt(cout); + + for (unsigned int i=0; i XMACC_MD5; + + const byte keys[2][XMACC_MD5::KEYLENGTH]={ + {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xaa,0xbb}, + {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98}}; + + const word32 counters[2]={0xccddeeff, 0x76543210}; + + const char *TestVals[7]={ + "", + "a", + "abc", + "message digest", + "abcdefghijklmnopqrstuvwxyz", + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890"}; + + const byte output[2][7][XMACC_MD5::DIGESTSIZE]={ + {{0xcc,0xdd,0xef,0x00,0xfa,0x89,0x54,0x92,0x86,0x32,0xda,0x2a,0x3f,0x29,0xc5,0x52,0xa0,0x0d,0x05,0x13}, + {0xcc,0xdd,0xef,0x01,0xae,0xdb,0x8b,0x7b,0x69,0x71,0xc7,0x91,0x71,0x48,0x9d,0x18,0xe7,0xdf,0x9d,0x5a}, + {0xcc,0xdd,0xef,0x02,0x5e,0x01,0x2e,0x2e,0x4b,0xc3,0x83,0x62,0xc2,0xf4,0xe6,0x18,0x1c,0x44,0xaf,0xca}, + {0xcc,0xdd,0xef,0x03,0x3e,0xa9,0xf1,0xe0,0x97,0x91,0xf8,0xe2,0xbe,0xe0,0xdf,0xf3,0x41,0x03,0xb3,0x5a}, + {0xcc,0xdd,0xef,0x04,0x2e,0x6a,0x8d,0xb9,0x72,0xe3,0xce,0x9f,0xf4,0x28,0x45,0xe7,0xbc,0x80,0xa9,0xc7}, + {0xcc,0xdd,0xef,0x05,0x1a,0xd5,0x40,0x78,0xfb,0x16,0x37,0xfc,0x7a,0x1d,0xce,0xb4,0x77,0x10,0xb2,0xa0}, + {0xcc,0xdd,0xef,0x06,0x13,0x2f,0x11,0x47,0xd7,0x1b,0xb5,0x52,0x36,0x51,0x26,0xb0,0x96,0xd7,0x60,0x81}}, + {{0x76,0x54,0x32,0x11,0xe9,0xcb,0x74,0x32,0x07,0x93,0xfe,0x01,0xdd,0x27,0xdb,0xde,0x6b,0x77,0xa4,0x56}, + {0x76,0x54,0x32,0x12,0xcd,0x55,0x87,0x5c,0xc0,0x35,0x85,0x99,0x44,0x02,0xa5,0x0b,0x8c,0xe7,0x2c,0x68}, + {0x76,0x54,0x32,0x13,0xac,0xfd,0x87,0x50,0xc3,0x8f,0xcd,0x58,0xaa,0xa5,0x7e,0x7a,0x25,0x63,0x26,0xd1}, + {0x76,0x54,0x32,0x14,0xe3,0x30,0xf5,0xdd,0x27,0x2b,0x76,0x22,0x7f,0xaa,0x90,0x73,0x6a,0x48,0xdb,0x00}, + {0x76,0x54,0x32,0x15,0xfc,0x57,0x00,0x20,0x7c,0x9d,0xf6,0x30,0x6f,0xbd,0x46,0x3e,0xfb,0x8a,0x2c,0x60}, + {0x76,0x54,0x32,0x16,0xfb,0x0f,0xd3,0xdf,0x4c,0x4b,0xc3,0x05,0x9d,0x63,0x1e,0xba,0x25,0x2b,0xbe,0x35}, + {0x76,0x54,0x32,0x17,0xc6,0xfe,0xe6,0x5f,0xb1,0x35,0x8a,0xf5,0x32,0x7a,0x80,0xbd,0xb8,0x72,0xee,0xae}}}; + + byte digest[XMACC_MD5::DIGESTSIZE]; + bool pass=true, fail; + + cout << "\nXMACC/MD5 validation suite running...\n"; + + for (int k=0; k<2; k++) + { + XMACC_MD5 mac(keys[k], counters[k]); + cout << "\nKEY: "; + for (int j=0;j pbkdf; + + cout << "\nPKCS #12 PBKDF validation suite running...\n\n"; + pass = TestPBKDF(pbkdf, testSet, sizeof(testSet)/sizeof(testSet[0])) && pass; + } + + { + // from draft-ietf-smime-password-03.txt, at http://www.imc.org/draft-ietf-smime-password + PBKDF_TestTuple testSet[] = + { + {0, 5, "70617373776f7264", "1234567878563412", "D1DAA78615F287E6"}, + {0, 500, "416C6C206E2D656E746974696573206D75737420636F6D6D756E69636174652077697468206F74686572206E2d656E74697469657320766961206E2D3120656E746974656568656568656573", "1234567878563412","6A8970BF68C92CAEA84A8DF28510858607126380CC47AB2D"} + }; + + PKCS5_PBKDF2_HMAC pbkdf; + + cout << "\nPKCS #5 PBKDF2 validation suite running...\n\n"; + pass = TestPBKDF(pbkdf, testSet, sizeof(testSet)/sizeof(testSet[0])) && pass; + } + + return pass; +} + +struct HKDF_TestTuple +{ + const char *hexSecret, *hexSalt, *hexInfo, *hexExpected; + size_t len; +}; + +bool TestHKDF(KeyDerivationFunction &kdf, const HKDF_TestTuple *testSet, unsigned int testSetSize) +{ + bool pass = true; + + for (unsigned int i=0; i(secret.data()), secret.size(), + (tuple.hexSalt ? reinterpret_cast(salt.data()) : NULL), salt.size(), + (tuple.hexInfo ? reinterpret_cast(info.data()) : NULL), info.size()); + + bool fail = !VerifyBufsEqual(derived, reinterpret_cast(expected.data()), derived.size()); + pass = pass && (ret == tuple.len) && !fail; + + HexEncoder enc(new FileSink(std::cout)); + std::cout << (fail ? "FAILED " : "passed "); + std::cout << " " << tuple.hexSecret << " "; + std::cout << (tuple.hexSalt ? (strlen(tuple.hexSalt) ? tuple.hexSalt : "<0-LEN SALT>") : ""); + std::cout << " "; + std::cout << (tuple.hexInfo ? (strlen(tuple.hexInfo) ? tuple.hexInfo : "<0-LEN INFO>") : ""); + std::cout << " "; + enc.Put(derived, derived.size()); + std::cout << std::endl; + } + + return pass; +} + +bool ValidateHKDF() +{ + bool pass = true; + + { + // SHA-1 from RFC 5869, Appendix A, https://tools.ietf.org/html/rfc5869 + static const HKDF_TestTuple testSet[] = + { + // Test Case #4 + {"0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "085a01ea1b10f36933068b56efa5ad81 a4f14b822f5b091568a9cdd4f155fda2 c22e422478d305f3f896", 42}, + // Test Case #5 + {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "0bd770a74d1160f7c9f12cd5912a06eb ff6adcae899d92191fe4305673ba2ffe 8fa3f1a4e5ad79f3f334b3b202b2173c 486ea37ce3d397ed034c7f9dfeb15c5e 927336d0441f4c4300e2cff0d0900b52 d3b4", 82}, + // Test Case #6 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "0ac1af7002b3d761d1e55298da9d0506 b9ae52057220a306e07b6b87e8df21d0 ea00033de03984d34918", 42}, + // Test Case #7 + {"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", NULL, "", "2c91117204d745f3500d636a62f64f0 ab3bae548aa53d423b0d1f27ebba6f5e5 673a081d70cce7acfc48", 42} + }; + + HKDF hkdf; + + std::cout << "\nRFC 5869 HKDF(SHA-1) validation suite running...\n\n"; + pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; + } + + { + // SHA-256 from RFC 5869, Appendix A, https://tools.ietf.org/html/rfc5869 + static const HKDF_TestTuple testSet[] = + { + // Test Case #1 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "3cb25f25faacd57a90434f64d0362f2a 2d2d0a90cf1a5a4c5db02d56ecc4c5bf 34007208d5b887185865", 42}, + // Test Case #2 + {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "b11e398dc80327a1c8e7f78c596a4934 4f012eda2d4efad8a050cc4c19afa97c 59045a99cac7827271cb41c65e590e09 da3275600c2f09b8367793a9aca3db71 cc30c58179ec3e87c14c01d5c1f3434f 1d87", 82}, + // Test Case #3 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "8da4e775a563c18f715f802a063c5a31 b8a11f5c5ee1879ec3454e5f3c738d2d 9d201395faa4b61a96c8", 42} + }; + + HKDF hkdf; + + std::cout << "\nRFC 5869 HKDF(SHA-256) validation suite running...\n\n"; + pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; + } + + { + // SHA-512, Crypto++ generated, based on RFC 5869, https://tools.ietf.org/html/rfc5869 + static const HKDF_TestTuple testSet[] = + { + // Test Case #0 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "832390086CDA71FB47625BB5CEB168E4 C8E26A1A16ED34D9FC7FE92C14815793 38DA362CB8D9F925D7CB", 42}, + // Test Case #0 + {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "CE6C97192805B346E6161E821ED16567 3B84F400A2B514B2FE23D84CD189DDF1 B695B48CBD1C8388441137B3CE28F16A A64BA33BA466B24DF6CFCB021ECFF235 F6A2056CE3AF1DE44D572097A8505D9E 7A93", 82}, + // Test Case #0 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "F5FA02B18298A72A8C23898A8703472C 6EB179DC204C03425C970E3B164BF90F FF22D04836D0E2343BAC", 42}, + // Test Case #0 + {"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", NULL, "", "1407D46013D98BC6DECEFCFEE55F0F90 B0C7F63D68EB1A80EAF07E953CFC0A3A 5240A155D6E4DAA965BB", 42} + }; + + HKDF hkdf; + + std::cout << "\nRFC 5869 HKDF(SHA-512) validation suite running...\n\n"; + pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; + } + + + + { + // Whirlpool, Crypto++ generated, based on RFC 5869, https://tools.ietf.org/html/rfc5869 + static const HKDF_TestTuple testSet[] = + { + // Test Case #0 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "0D29F74CCD8640F44B0DD9638111C1B5 766EFED752AF358109E2E7C9CD4A28EF 2F90B2AD461FBA0744D4", 42}, + // Test Case #0 + {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "4EBE4FE2DCCEC42661699500BE279A99 3FED90351E19373B3926FAA3A410700B2 BBF77E254CF1451AE6068D64A0904D96 6F4FF25498445A501B88F50D21E3A68A8 90E09445DC5886DD00E7F4F7C58A5121 70", 82}, + // Test Case #0 + {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "110632D0F7AEFAC31771FC66C22BB346 2614B81E4B04BA7F2B662E0BD694F564 58615F9A9CB56C57ECF2", 42}, + // Test Case #0 + {"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c" /*key*/, NULL /*salt*/, "" /*info*/, "4089286EBFB23DD8A02F0C9DAA35D538 EB09CD0A8CBAB203F39083AA3E0BD313 E6F91E64F21A187510B0", 42} + }; + + HKDF hkdf; + + std::cout << "\nRFC 5869 HKDF(Whirlpool) validation suite running...\n\n"; + pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; + } + + + return pass; +} diff --git a/external/crypto++-5.6.3/validate.h b/external/crypto++-5.6.3/validate.h new file mode 100644 index 000000000..4f19e1a01 --- /dev/null +++ b/external/crypto++-5.6.3/validate.h @@ -0,0 +1,100 @@ +#ifndef CRYPTOPP_VALIDATE_H +#define CRYPTOPP_VALIDATE_H + +#include "cryptlib.h" + +bool ValidateAll(bool thorough); +bool TestSettings(); +bool TestOS_RNG(); +bool TestAutoSeeded(); + +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) +bool TestRDRAND(); +bool TestRDSEED(); +#endif + +bool ValidateBaseCode(); +bool ValidateCRC32(); +bool ValidateAdler32(); +bool ValidateMD2(); +bool ValidateMD4(); +bool ValidateMD5(); +bool ValidateSHA(); +bool ValidateSHA2(); +bool ValidateTiger(); +bool ValidateRIPEMD(); +bool ValidatePanama(); +bool ValidateWhirlpool(); + +bool ValidateHMAC(); +bool ValidateTTMAC(); + +bool ValidateCipherModes(); +bool ValidatePBKDF(); +bool ValidateHKDF(); + +bool ValidateDES(); +bool ValidateIDEA(); +bool ValidateSAFER(); +bool ValidateRC2(); +bool ValidateARC4(); + +bool ValidateRC5(); +bool ValidateBlowfish(); +bool ValidateThreeWay(); +bool ValidateGOST(); +bool ValidateSHARK(); +bool ValidateSEAL(); +bool ValidateCAST(); +bool ValidateSquare(); +bool ValidateSKIPJACK(); +bool ValidateRC6(); +bool ValidateMARS(); +bool ValidateRijndael(); +bool ValidateTwofish(); +bool ValidateSerpent(); +bool ValidateSHACAL2(); +bool ValidateCamellia(); +bool ValidateSalsa(); +bool ValidateSosemanuk(); +bool ValidateVMAC(); +bool ValidateCCM(); +bool ValidateGCM(); +bool ValidateCMAC(); + +bool ValidateBBS(); +bool ValidateDH(); +bool ValidateMQV(); +bool ValidateRSA(); +bool ValidateElGamal(); +bool ValidateDLIES(); +bool ValidateNR(); +bool ValidateDSA(bool thorough); +bool ValidateLUC(); +bool ValidateLUC_DL(); +bool ValidateLUC_DH(); +bool ValidateXTR_DH(); +bool ValidateRabin(); +bool ValidateRW(); +//bool ValidateBlumGoldwasser(); +bool ValidateECP(); +bool ValidateEC2N(); +bool ValidateECDSA(); +bool ValidateESIGN(); + +#if !defined(NDEBUG) +bool TestPolynomialMod2(); +#endif + +// Coverity findings +template +T StringToValue(const std::string& str); +template<> +int StringToValue(const std::string& str); + +// Functions that need a RNG; uses AES inf CFB mode with Seed. +CryptoPP::RandomNumberGenerator & GlobalRNG(); + +bool RunTestDataFile(const char *filename, const CryptoPP::NameValuePairs &overrideParameters=CryptoPP::g_nullNameValuePairs, bool thorough=true); + +#endif diff --git a/external/crypto++-5.6.3/vmac.cpp b/external/crypto++-5.6.3/vmac.cpp new file mode 100644 index 000000000..e44b772df --- /dev/null +++ b/external/crypto++-5.6.3/vmac.cpp @@ -0,0 +1,910 @@ +// vmac.cpp - written and placed in the public domain by Wei Dai +// based on Ted Krovetz's public domain vmac.c and draft-krovetz-vmac-01.txt + +#include "pch.h" +#include "config.h" + +#include "vmac.h" +#include "cpu.h" +#include "argnames.h" +#include "secblock.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4731) +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#if defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64 +#include +#endif + +#define VMAC_BOOL_WORD128 (defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(CRYPTOPP_X64_ASM_AVAILABLE)) +#ifdef __BORLANDC__ +#define const // Turbo C++ 2006 workaround +#endif +static const word64 p64 = W64LIT(0xfffffffffffffeff); /* 2^64 - 257 prime */ +static const word64 m62 = W64LIT(0x3fffffffffffffff); /* 62-bit mask */ +static const word64 m63 = W64LIT(0x7fffffffffffffff); /* 63-bit mask */ +static const word64 m64 = W64LIT(0xffffffffffffffff); /* 64-bit mask */ +static const word64 mpoly = W64LIT(0x1fffffff1fffffff); /* Poly key mask */ +#ifdef __BORLANDC__ +#undef const +#endif +#if VMAC_BOOL_WORD128 +#ifdef __powerpc__ +// workaround GCC Bug 31690: ICE with const __uint128_t and C++ front-end +#define m126 ((word128(m62)<<64)|m64) +#else +static const word128 m126 = (word128(m62)<<64)|m64; /* 126-bit mask */ +#endif +#endif + +void VMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms) +{ + int digestLength = params.GetIntValueWithDefault(Name::DigestSize(), DefaultDigestSize()); + if (digestLength != 8 && digestLength != 16) + throw InvalidArgument("VMAC: DigestSize must be 8 or 16"); + m_is128 = digestLength == 16; + + m_L1KeyLength = params.GetIntValueWithDefault(Name::L1KeyLength(), 128); + if (m_L1KeyLength <= 0 || m_L1KeyLength % 128 != 0) + throw InvalidArgument("VMAC: L1KeyLength must be a positive multiple of 128"); + + AllocateBlocks(); + + BlockCipher &cipher = AccessCipher(); + cipher.SetKey(userKey, keylength, params); + const unsigned int blockSize = cipher.BlockSize(); + const unsigned int blockSizeInWords = blockSize / sizeof(word64); + SecBlock out(blockSizeInWords); + SecByteBlock in; + in.CleanNew(blockSize); + size_t i; + + /* Fill nh key */ + in[0] = 0x80; + cipher.AdvancedProcessBlocks(in, NULL, (byte *)m_nhKey(), m_nhKeySize()*sizeof(word64), cipher.BT_InBlockIsCounter); + ConditionalByteReverse(BIG_ENDIAN_ORDER, m_nhKey(), m_nhKey(), m_nhKeySize()*sizeof(word64)); + + /* Fill poly key */ + in[0] = 0xC0; + in[15] = 0; + for (i = 0; i <= (size_t)m_is128; i++) + { + cipher.ProcessBlock(in, out.BytePtr()); + m_polyState()[i*4+2] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()) & mpoly; + m_polyState()[i*4+3] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()+8) & mpoly; + in[15]++; + } + + /* Fill ip key */ + in[0] = 0xE0; + in[15] = 0; + word64 *l3Key = m_l3Key(); + for (i = 0; i <= (size_t)m_is128; i++) + do + { + cipher.ProcessBlock(in, out.BytePtr()); + l3Key[i*2+0] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()); + l3Key[i*2+1] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()+8); + in[15]++; + } while ((l3Key[i*2+0] >= p64) || (l3Key[i*2+1] >= p64)); + + m_padCached = false; + size_t nonceLength; + const byte *nonce = GetIVAndThrowIfInvalid(params, nonceLength); + Resynchronize(nonce, (int)nonceLength); +} + +void VMAC_Base::GetNextIV(RandomNumberGenerator &rng, byte *IV) +{ + SimpleKeyingInterface::GetNextIV(rng, IV); + IV[0] &= 0x7f; +} + +void VMAC_Base::Resynchronize(const byte *nonce, int len) +{ + size_t length = ThrowIfInvalidIVLength(len); + size_t s = IVSize(); + byte *storedNonce = m_nonce(); + + if (m_is128) + { + memset(storedNonce, 0, s-length); + memcpy(storedNonce+s-length, nonce, length); + AccessCipher().ProcessBlock(storedNonce, m_pad()); + } + else + { + if (m_padCached && (storedNonce[s-1] | 1) == (nonce[length-1] | 1)) + { + m_padCached = VerifyBufsEqual(storedNonce+s-length, nonce, length-1); + for (size_t i=0; m_padCached && i>64); rl = word64(p);} + #define AccumulateNH(a, b, c) a += word128(b)*(c) + #define Multiply128(r, i1, i2) r = word128(word64(i1)) * word64(i2) +#else + #if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) + #define MUL32(a, b) __emulu(word32(a), word32(b)) + #else + #define MUL32(a, b) ((word64)((word32)(a)) * (word32)(b)) + #endif + #if defined(CRYPTOPP_X64_ASM_AVAILABLE) + #define DeclareNH(a) word64 a##0=0, a##1=0 + #define MUL64(rh,rl,i1,i2) asm ("mulq %3" : "=a"(rl), "=d"(rh) : "a"(i1), "g"(i2) : "cc"); + #define AccumulateNH(a, b, c) asm ("mulq %3; addq %%rax, %0; adcq %%rdx, %1" : "+r"(a##0), "+r"(a##1) : "a"(b), "g"(c) : "%rdx", "cc"); + #define ADD128(rh,rl,ih,il) asm ("addq %3, %1; adcq %2, %0" : "+r"(rh),"+r"(rl) : "r"(ih),"r"(il) : "cc"); + #elif defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64 + #define DeclareNH(a) word64 a##0=0, a##1=0 + #define MUL64(rh,rl,i1,i2) (rl) = _umul128(i1,i2,&(rh)); + #define AccumulateNH(a, b, c) {\ + word64 ph, pl;\ + pl = _umul128(b,c,&ph);\ + a##0 += pl;\ + a##1 += ph + (a##0 < pl);} + #else + #define VMAC_BOOL_32BIT 1 + #define DeclareNH(a) word64 a##0=0, a##1=0, a##2=0 + #define MUL64(rh,rl,i1,i2) \ + { word64 _i1 = (i1), _i2 = (i2); \ + word64 m1= MUL32(_i1,_i2>>32); \ + word64 m2= MUL32(_i1>>32,_i2); \ + rh = MUL32(_i1>>32,_i2>>32); \ + rl = MUL32(_i1,_i2); \ + ADD128(rh,rl,(m1 >> 32),(m1 << 32)); \ + ADD128(rh,rl,(m2 >> 32),(m2 << 32)); \ + } + #define AccumulateNH(a, b, c) {\ + word64 p = MUL32(b, c);\ + a##1 += word32((p)>>32);\ + a##0 += word32(p);\ + p = MUL32((b)>>32, c);\ + a##2 += word32((p)>>32);\ + a##1 += word32(p);\ + p = MUL32((b)>>32, (c)>>32);\ + a##2 += p;\ + p = MUL32(b, (c)>>32);\ + a##1 += word32(p);\ + a##2 += word32(p>>32);} + #endif +#endif +#ifndef VMAC_BOOL_32BIT + #define VMAC_BOOL_32BIT 0 +#endif +#ifndef ADD128 + #define ADD128(rh,rl,ih,il) \ + { word64 _il = (il); \ + (rl) += (_il); \ + (rh) += (ih) + ((rl) < (_il)); \ + } +#endif + +#if !(defined(_MSC_VER) && _MSC_VER < 1300) +template +#endif +void VMAC_Base::VHASH_Update_Template(const word64 *data, size_t blocksRemainingInWord64) +{ + #define INNER_LOOP_ITERATION(j) {\ + word64 d0 = ConditionalByteReverse(LITTLE_ENDIAN_ORDER, data[i+2*j+0]);\ + word64 d1 = ConditionalByteReverse(LITTLE_ENDIAN_ORDER, data[i+2*j+1]);\ + AccumulateNH(nhA, d0+nhK[i+2*j+0], d1+nhK[i+2*j+1]);\ + if (T_128BitTag)\ + AccumulateNH(nhB, d0+nhK[i+2*j+2], d1+nhK[i+2*j+3]);\ + } + +#if (defined(_MSC_VER) && _MSC_VER < 1300) + bool T_128BitTag = m_is128; +#endif + size_t L1KeyLengthInWord64 = m_L1KeyLength / 8; + size_t innerLoopEnd = L1KeyLengthInWord64; + const word64 *nhK = m_nhKey(); + word64 *polyS = m_polyState(); + bool isFirstBlock = true; + size_t i; + + #if !VMAC_BOOL_32BIT + #if VMAC_BOOL_WORD128 + word128 a1=0, a2=0; + #else + word64 ah1=0, al1=0, ah2=0, al2=0; + #endif + word64 kh1, kl1, kh2, kl2; + kh1=(polyS+0*4+2)[0]; kl1=(polyS+0*4+2)[1]; + if (T_128BitTag) + { + kh2=(polyS+1*4+2)[0]; kl2=(polyS+1*4+2)[1]; + } + #endif + + do + { + DeclareNH(nhA); + DeclareNH(nhB); + + i = 0; + if (blocksRemainingInWord64 < L1KeyLengthInWord64) + { + if (blocksRemainingInWord64 % 8) + { + innerLoopEnd = blocksRemainingInWord64 % 8; + for (; i> 32); + nh1[0] = word32(nhA1); + nh2[0] = (nhA2 + (nhA1 >> 32)) & m62; + + if (T_128BitTag) + { + nh0[1] = word32(nhB0); + nhB1 += (nhB0 >> 32); + nh1[1] = word32(nhB1); + nh2[1] = (nhB2 + (nhB1 >> 32)) & m62; + } + + #define a0 (((word32 *)(polyS+i*4))[2+NativeByteOrder::ToEnum()]) + #define a1 (*(((word32 *)(polyS+i*4))+3-NativeByteOrder::ToEnum())) // workaround for GCC 3.2 + #define a2 (((word32 *)(polyS+i*4))[0+NativeByteOrder::ToEnum()]) + #define a3 (*(((word32 *)(polyS+i*4))+1-NativeByteOrder::ToEnum())) + #define aHi ((polyS+i*4)[0]) + #define k0 (((word32 *)(polyS+i*4+2))[2+NativeByteOrder::ToEnum()]) + #define k1 (*(((word32 *)(polyS+i*4+2))+3-NativeByteOrder::ToEnum())) + #define k2 (((word32 *)(polyS+i*4+2))[0+NativeByteOrder::ToEnum()]) + #define k3 (*(((word32 *)(polyS+i*4+2))+1-NativeByteOrder::ToEnum())) + #define kHi ((polyS+i*4+2)[0]) + + if (isFirstBlock) + { + isFirstBlock = false; + if (m_isFirstBlock) + { + m_isFirstBlock = false; + for (i=0; i<=(size_t)T_128BitTag; i++) + { + word64 t = (word64)nh0[i] + k0; + a0 = (word32)t; + t = (t >> 32) + nh1[i] + k1; + a1 = (word32)t; + aHi = (t >> 32) + nh2[i] + kHi; + } + continue; + } + } + for (i=0; i<=(size_t)T_128BitTag; i++) + { + word64 p, t; + word32 t2; + + p = MUL32(a3, 2*k3); + p += nh2[i]; + p += MUL32(a0, k2); + p += MUL32(a1, k1); + p += MUL32(a2, k0); + t2 = (word32)p; + p >>= 32; + p += MUL32(a0, k3); + p += MUL32(a1, k2); + p += MUL32(a2, k1); + p += MUL32(a3, k0); + t = (word64(word32(p) & 0x7fffffff) << 32) | t2; + p >>= 31; + p += nh0[i]; + p += MUL32(a0, k0); + p += MUL32(a1, 2*k3); + p += MUL32(a2, 2*k2); + p += MUL32(a3, 2*k1); + t2 = (word32)p; + p >>= 32; + p += nh1[i]; + p += MUL32(a0, k1); + p += MUL32(a1, k0); + p += MUL32(a2, 2*k3); + p += MUL32(a3, 2*k2); + a0 = t2; + a1 = (word32)p; + aHi = (p >> 32) + t; + } + + #undef a0 + #undef a1 + #undef a2 + #undef a3 + #undef aHi + #undef k0 + #undef k1 + #undef k2 + #undef k3 + #undef kHi + #else // #if VMAC_BOOL_32BIT + if (isFirstBlock) + { + isFirstBlock = false; + if (m_isFirstBlock) + { + m_isFirstBlock = false; + #if VMAC_BOOL_WORD128 + #define first_poly_step(a, kh, kl, m) a = (m & m126) + ((word128(kh) << 64) | kl) + + first_poly_step(a1, kh1, kl1, nhA); + if (T_128BitTag) + first_poly_step(a2, kh2, kl2, nhB); + #else + #define first_poly_step(ah, al, kh, kl, mh, ml) {\ + mh &= m62;\ + ADD128(mh, ml, kh, kl); \ + ah = mh; al = ml;} + + first_poly_step(ah1, al1, kh1, kl1, nhA1, nhA0); + if (T_128BitTag) + first_poly_step(ah2, al2, kh2, kl2, nhB1, nhB0); + #endif + continue; + } + else + { + #if VMAC_BOOL_WORD128 + a1 = (word128((polyS+0*4)[0]) << 64) | (polyS+0*4)[1]; + #else + ah1=(polyS+0*4)[0]; al1=(polyS+0*4)[1]; + #endif + if (T_128BitTag) + { + #if VMAC_BOOL_WORD128 + a2 = (word128((polyS+1*4)[0]) << 64) | (polyS+1*4)[1]; + #else + ah2=(polyS+1*4)[0]; al2=(polyS+1*4)[1]; + #endif + } + } + } + + #if VMAC_BOOL_WORD128 + #define poly_step(a, kh, kl, m) \ + { word128 t1, t2, t3, t4;\ + Multiply128(t2, a>>64, kl);\ + Multiply128(t3, a, kh);\ + Multiply128(t1, a, kl);\ + Multiply128(t4, a>>64, 2*kh);\ + t2 += t3;\ + t4 += t1;\ + t2 += t4>>64;\ + a = (word128(word64(t2)&m63) << 64) | word64(t4);\ + t2 *= 2;\ + a += m & m126;\ + a += t2>>64;} + + poly_step(a1, kh1, kl1, nhA); + if (T_128BitTag) + poly_step(a2, kh2, kl2, nhB); + #else + #define poly_step(ah, al, kh, kl, mh, ml) \ + { word64 t1h, t1l, t2h, t2l, t3h, t3l, z=0; \ + /* compute ab*cd, put bd into result registers */ \ + MUL64(t2h,t2l,ah,kl); \ + MUL64(t3h,t3l,al,kh); \ + MUL64(t1h,t1l,ah,2*kh); \ + MUL64(ah,al,al,kl); \ + /* add together ad + bc */ \ + ADD128(t2h,t2l,t3h,t3l); \ + /* add 2 * ac to result */ \ + ADD128(ah,al,t1h,t1l); \ + /* now (ah,al), (t2l,2*t2h) need summing */ \ + /* first add the high registers, carrying into t2h */ \ + ADD128(t2h,ah,z,t2l); \ + /* double t2h and add top bit of ah */ \ + t2h += t2h + (ah >> 63); \ + ah &= m63; \ + /* now add the low registers */ \ + mh &= m62; \ + ADD128(ah,al,mh,ml); \ + ADD128(ah,al,z,t2h); \ + } + + poly_step(ah1, al1, kh1, kl1, nhA1, nhA0); + if (T_128BitTag) + poly_step(ah2, al2, kh2, kl2, nhB1, nhB0); + #endif + #endif // #if VMAC_BOOL_32BIT + } while (blocksRemainingInWord64); + + #if VMAC_BOOL_WORD128 + (polyS+0*4)[0]=word64(a1>>64); (polyS+0*4)[1]=word64(a1); + if (T_128BitTag) + { + (polyS+1*4)[0]=word64(a2>>64); (polyS+1*4)[1]=word64(a2); + } + #elif !VMAC_BOOL_32BIT + (polyS+0*4)[0]=ah1; (polyS+0*4)[1]=al1; + if (T_128BitTag) + { + (polyS+1*4)[0]=ah2; (polyS+1*4)[1]=al2; + } + #endif +} + +inline void VMAC_Base::VHASH_Update(const word64 *data, size_t blocksRemainingInWord64) +{ +#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || (CRYPTOPP_BOOL_X32 && !defined(CRYPTOPP_DISABLE_VMAC_ASM)))) + if (HasSSE2()) + { + VHASH_Update_SSE2(data, blocksRemainingInWord64, 0); + if (m_is128) + VHASH_Update_SSE2(data, blocksRemainingInWord64, 1); + m_isFirstBlock = false; + } + else +#endif + { +#if defined(_MSC_VER) && _MSC_VER < 1300 + VHASH_Update_Template(data, blocksRemainingInWord64); +#else + if (m_is128) + VHASH_Update_Template(data, blocksRemainingInWord64); + else + VHASH_Update_Template(data, blocksRemainingInWord64); +#endif + } +} + +size_t VMAC_Base::HashMultipleBlocks(const word64 *data, size_t length) +{ + size_t remaining = ModPowerOf2(length, m_L1KeyLength); + VHASH_Update(data, (length-remaining)/8); + return remaining; +} + +static word64 L3Hash(const word64 *input, const word64 *l3Key, size_t len) +{ + word64 rh, rl, t, z=0; + word64 p1 = input[0], p2 = input[1]; + word64 k1 = l3Key[0], k2 = l3Key[1]; + + /* fully reduce (p1,p2)+(len,0) mod p127 */ + t = p1 >> 63; + p1 &= m63; + ADD128(p1, p2, len, t); + /* At this point, (p1,p2) is at most 2^127+(len<<64) */ + t = (p1 > m63) + ((p1 == m63) & (p2 == m64)); + ADD128(p1, p2, z, t); + p1 &= m63; + + /* compute (p1,p2)/(2^64-2^32) and (p1,p2)%(2^64-2^32) */ + t = p1 + (p2 >> 32); + t += (t >> 32); + t += (word32)t > 0xfffffffeU; + p1 += (t >> 32); + p2 += (p1 << 32); + + /* compute (p1+k1)%p64 and (p2+k2)%p64 */ + p1 += k1; + p1 += (0 - (p1 < k1)) & 257; + p2 += k2; + p2 += (0 - (p2 < k2)) & 257; + + /* compute (p1+k1)*(p2+k2)%p64 */ + MUL64(rh, rl, p1, p2); + t = rh >> 56; + ADD128(t, rl, z, rh); + rh <<= 8; + ADD128(t, rl, z, rh); + t += t << 8; + rl += t; + rl += (0 - (rl < t)) & 257; + rl += (0 - (rl > p64-1)) & 257; + return rl; +} + +void VMAC_Base::TruncatedFinal(byte *mac, size_t size) +{ + size_t len = ModPowerOf2(GetBitCountLo()/8, m_L1KeyLength); + + if (len) + { + memset(m_data()+len, 0, (0-len)%16); + VHASH_Update(DataBuf(), ((len+15)/16)*2); + len *= 8; // convert to bits + } + else if (m_isFirstBlock) + { + // special case for empty string + m_polyState()[0] = m_polyState()[2]; + m_polyState()[1] = m_polyState()[3]; + if (m_is128) + { + m_polyState()[4] = m_polyState()[6]; + m_polyState()[5] = m_polyState()[7]; + } + } + + if (m_is128) + { + word64 t[2]; + t[0] = L3Hash(m_polyState(), m_l3Key(), len) + GetWord(true, BIG_ENDIAN_ORDER, m_pad()); + t[1] = L3Hash(m_polyState()+4, m_l3Key()+2, len) + GetWord(true, BIG_ENDIAN_ORDER, m_pad()+8); + if (size == 16) + { + PutWord(false, BIG_ENDIAN_ORDER, mac, t[0]); + PutWord(false, BIG_ENDIAN_ORDER, mac+8, t[1]); + } + else + { + t[0] = ConditionalByteReverse(BIG_ENDIAN_ORDER, t[0]); + t[1] = ConditionalByteReverse(BIG_ENDIAN_ORDER, t[1]); + memcpy(mac, t, size); + } + } + else + { + word64 t = L3Hash(m_polyState(), m_l3Key(), len); + t += GetWord(true, BIG_ENDIAN_ORDER, m_pad() + (m_nonce()[IVSize()-1]&1) * 8); + if (size == 8) + PutWord(false, BIG_ENDIAN_ORDER, mac, t); + else + { + t = ConditionalByteReverse(BIG_ENDIAN_ORDER, t); + memcpy(mac, &t, size); + } + } +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/vmac.h b/external/crypto++-5.6.3/vmac.h new file mode 100644 index 000000000..229f89cd8 --- /dev/null +++ b/external/crypto++-5.6.3/vmac.h @@ -0,0 +1,86 @@ +#ifndef CRYPTOPP_VMAC_H +#define CRYPTOPP_VMAC_H + +#include "cryptlib.h" +#include "iterhash.h" +#include "seckey.h" + +#if CRYPTOPP_BOOL_X32 +# define CRYPTOPP_DISABLE_VMAC_ASM +#endif + +NAMESPACE_BEGIN(CryptoPP) + +//! \class VMAC_Base +//! \brief Class specific methods used to operate the MAC. +class VMAC_Base : public IteratedHashBase +{ +public: + std::string AlgorithmName() const {return std::string("VMAC(") + GetCipher().AlgorithmName() + ")-" + IntToString(DigestSize()*8);} + unsigned int IVSize() const {return GetCipher().BlockSize();} + unsigned int MinIVLength() const {return 1;} + void Resynchronize(const byte *nonce, int length=-1); + void GetNextIV(RandomNumberGenerator &rng, byte *IV); + unsigned int DigestSize() const {return m_is128 ? 16 : 8;}; + void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); + void TruncatedFinal(byte *mac, size_t size); + unsigned int BlockSize() const {return m_L1KeyLength;} + ByteOrder GetByteOrder() const {return LITTLE_ENDIAN_ORDER;} + unsigned int OptimalDataAlignment() const; + +protected: + virtual BlockCipher & AccessCipher() =0; + virtual int DefaultDigestSize() const =0; + const BlockCipher & GetCipher() const {return const_cast(this)->AccessCipher();} + void HashEndianCorrectedBlock(const word64 *data); + size_t HashMultipleBlocks(const word64 *input, size_t length); + void Init() {} + word64* StateBuf() {return NULL;} + word64* DataBuf() {return (word64 *)m_data();} + + void VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWord64, int tagPart); +#if !(defined(_MSC_VER) && _MSC_VER < 1300) // can't use function template here with VC6 + template +#endif + void VHASH_Update_Template(const word64 *data, size_t blockRemainingInWord128); + void VHASH_Update(const word64 *data, size_t blocksRemainingInWord128); + +#if CRYPTOPP_DOXYGEN_PROCESSING + private: // hide from documentation +#endif + + CRYPTOPP_BLOCK_1(polyState, word64, 4*(m_is128+1)) + CRYPTOPP_BLOCK_2(nhKey, word64, m_L1KeyLength/sizeof(word64) + 2*m_is128) + CRYPTOPP_BLOCK_3(data, byte, m_L1KeyLength) + CRYPTOPP_BLOCK_4(l3Key, word64, 2*(m_is128+1)) + CRYPTOPP_BLOCK_5(nonce, byte, IVSize()) + CRYPTOPP_BLOCK_6(pad, byte, IVSize()) + CRYPTOPP_BLOCKS_END(6) + + bool m_is128, m_padCached, m_isFirstBlock; + int m_L1KeyLength; +}; + +//! \class VMAC +//! \brief The VMAC message authentication code +//! \details VMAC is a block cipher-based message authentication code algorithm +//! using a universal hash proposed by Ted Krovetz and Wei Dai in April 2007. The +//! algorithm was designed for high performance backed by a formal analysis. +//! \tparam T_BlockCipher block cipher +//! \tparam T_DigestBitSize digest size, in bits +//! \sa VMAC at the Crypto Lounge. +template +class VMAC : public SimpleKeyingInterfaceImpl > +{ +public: + static std::string StaticAlgorithmName() {return std::string("VMAC(") + T_BlockCipher::StaticAlgorithmName() + ")-" + IntToString(T_DigestBitSize);} + +private: + BlockCipher & AccessCipher() {return m_cipher;} + int DefaultDigestSize() const {return T_DigestBitSize/8;} + typename T_BlockCipher::Encryption m_cipher; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/vs2010.zip b/external/crypto++-5.6.3/vs2010.zip new file mode 100644 index 0000000000000000000000000000000000000000..b4cc9e3d3854c0af0b822f66ed97c17a8adf292e GIT binary patch literal 19917 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 Wmt$pghaK83Ql?(yR<{!+LG`==$Qm<|O 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 +#include +#include +#include +#endif + +NAMESPACE_BEGIN(CryptoPP) + +unsigned int WaitObjectContainer::MaxWaitObjects() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + return MAXIMUM_WAIT_OBJECTS * (MAXIMUM_WAIT_OBJECTS-1); +#else + return FD_SETSIZE; +#endif +} + +WaitObjectContainer::WaitObjectContainer(WaitObjectsTracer* tracer) + : m_tracer(tracer), m_eventTimer(Timer::MILLISECONDS), m_lastResult(0) + , m_sameResultCount(0), m_noWaitTimer(Timer::MILLISECONDS) +{ + Clear(); + m_eventTimer.StartTimer(); +} + +void WaitObjectContainer::Clear() +{ +#ifdef USE_WINDOWS_STYLE_SOCKETS + m_handles.clear(); +#else + m_maxFd = 0; + FD_ZERO(&m_readfds); + FD_ZERO(&m_writefds); +#endif + m_noWait = false; + m_firstEventTime = 0; +} + +inline void WaitObjectContainer::SetLastResult(LastResultType result) +{ + if (result == m_lastResult) + m_sameResultCount++; + else + { + m_lastResult = result; + m_sameResultCount = 0; + } +} + +void WaitObjectContainer::DetectNoWait(LastResultType result, CallStack const& callStack) +{ + if (result == m_lastResult && m_noWaitTimer.ElapsedTime() > 1000) + { + if (m_sameResultCount > m_noWaitTimer.ElapsedTime()) + { + if (m_tracer) + { + std::string desc = "No wait loop detected - m_lastResult: "; + desc.append(IntToString(m_lastResult)).append(", call stack:"); + for (CallStack const* cs = &callStack; cs; cs = cs->Prev()) + desc.append("\n- ").append(cs->Format()); + m_tracer->TraceNoWaitLoop(desc); + } + try { throw 0; } catch (...) {} // help debugger break + } + + m_noWaitTimer.StartTimer(); + m_sameResultCount = 0; + } +} + +void WaitObjectContainer::SetNoWait(CallStack const& callStack) +{ + DetectNoWait(LastResultType(LASTRESULT_NOWAIT), CallStack("WaitObjectContainer::SetNoWait()", &callStack)); + m_noWait = true; +} + +void WaitObjectContainer::ScheduleEvent(double milliseconds, CallStack const& callStack) +{ + if (milliseconds <= 3) + DetectNoWait(LastResultType(LASTRESULT_SCHEDULED), CallStack("WaitObjectContainer::ScheduleEvent()", &callStack)); + double thisEventTime = m_eventTimer.ElapsedTimeAsDouble() + milliseconds; + if (!m_firstEventTime || thisEventTime < m_firstEventTime) + m_firstEventTime = thisEventTime; +} + +#ifdef USE_WINDOWS_STYLE_SOCKETS + +struct WaitingThreadData +{ + bool waitingToWait, terminate; + HANDLE startWaiting, stopWaiting; + const HANDLE *waitHandles; + unsigned int count; + HANDLE threadHandle; + DWORD threadId; + DWORD* error; +}; + +WaitObjectContainer::~WaitObjectContainer() +{ + try // don't let exceptions escape destructor + { + if (!m_threads.empty()) + { + HANDLE threadHandles[MAXIMUM_WAIT_OBJECTS] = {0}; + + unsigned int i; + for (i=0; i= WAIT_OBJECT_0) && (dwResult < (DWORD)m_threads.size())); + + for (i=0; i pThread((WaitingThreadData *)lParam); + WaitingThreadData &thread = *pThread; + std::vector handles; + + while (true) + { + thread.waitingToWait = true; + DWORD result = ::WaitForSingleObject(thread.startWaiting, INFINITE); + assert(result != WAIT_FAILED); + + thread.waitingToWait = false; + if (thread.terminate) + break; + if (!thread.count) + continue; + + handles.resize(thread.count + 1); + handles[0] = thread.stopWaiting; + std::copy(thread.waitHandles, thread.waitHandles+thread.count, handles.begin()+1); + + result = ::WaitForMultipleObjects((DWORD)handles.size(), &handles[0], FALSE, INFINITE); + assert(result != WAIT_FAILED); + + if (result == WAIT_OBJECT_0) + continue; // another thread finished waiting first, so do nothing + SetEvent(thread.stopWaiting); + if (!(result > WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + handles.size())) + { + assert(!"error in WaitingThread"); // break here so we can see which thread has an error + *thread.error = ::GetLastError(); + } + } + + return S_OK; // return a value here to avoid compiler warning +} + +void WaitObjectContainer::CreateThreads(unsigned int count) +{ + size_t currentCount = m_threads.size(); + if (currentCount == 0) + { + m_startWaiting = ::CreateEvent(NULL, TRUE, FALSE, NULL); + m_stopWaiting = ::CreateEvent(NULL, TRUE, FALSE, NULL); + } + + if (currentCount < count) + { + m_threads.resize(count); + for (size_t i=currentCount; i MAXIMUM_WAIT_OBJECTS) + { + // too many wait objects for a single WaitForMultipleObjects call, so use multiple threads + static const unsigned int WAIT_OBJECTS_PER_THREAD = MAXIMUM_WAIT_OBJECTS-1; + unsigned int nThreads = (unsigned int)((m_handles.size() + WAIT_OBJECTS_PER_THREAD - 1) / WAIT_OBJECTS_PER_THREAD); + if (nThreads > MAXIMUM_WAIT_OBJECTS) // still too many wait objects, maybe implement recursive threading later? + throw Err("WaitObjectContainer: number of wait objects exceeds limit"); + CreateThreads(nThreads); + DWORD error = S_OK; + + for (unsigned int i=0; i 0) + { + unsigned long timeAfterWait = t.ElapsedTime(); + OutputDebugString(("Handles " + IntToString(m_handles.size()) + ", Woke up by " + IntToString(result-WAIT_OBJECT_0) + ", Busied for " + IntToString(timeBeforeWait-lastTime) + " us, Waited for " + IntToString(timeAfterWait-timeBeforeWait) + " us, max " + IntToString(milliseconds) + "ms\n").c_str()); + lastTime = timeAfterWait; + } +#endif + if (result >= WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + m_handles.size()) + { + if (result == m_lastResult) + m_sameResultCount++; + else + { + m_lastResult = result; + m_sameResultCount = 0; + } + return true; + } + else if (result == WAIT_TIMEOUT) + { + SetLastResult(timeoutIsScheduledEvent ? LASTRESULT_SCHEDULED : LASTRESULT_TIMEOUT); + return timeoutIsScheduledEvent; + } + else + throw Err("WaitObjectContainer: WaitForMultipleObjects failed with error " + IntToString(::GetLastError())); + } +} + +#else // #ifdef USE_WINDOWS_STYLE_SOCKETS + +void WaitObjectContainer::AddReadFd(int fd, CallStack const& callStack) // TODO: do something with callStack +{ + CRYPTOPP_UNUSED(callStack); + FD_SET(fd, &m_readfds); + m_maxFd = STDMAX(m_maxFd, fd); +} + +void WaitObjectContainer::AddWriteFd(int fd, CallStack const& callStack) // TODO: do something with callStack +{ + CRYPTOPP_UNUSED(callStack); + FD_SET(fd, &m_writefds); + m_maxFd = STDMAX(m_maxFd, fd); +} + +bool WaitObjectContainer::Wait(unsigned long milliseconds) +{ + if (m_noWait || (!m_maxFd && !m_firstEventTime)) + return true; + + bool timeoutIsScheduledEvent = false; + + if (m_firstEventTime) + { + double timeToFirstEvent = SaturatingSubtract(m_firstEventTime, m_eventTimer.ElapsedTimeAsDouble()); + if (timeToFirstEvent <= milliseconds) + { + milliseconds = (unsigned long)timeToFirstEvent; + timeoutIsScheduledEvent = true; + } + } + + timeval tv, *timeout; + + if (milliseconds == INFINITE_TIME) + timeout = NULL; + else + { + tv.tv_sec = milliseconds / 1000; + tv.tv_usec = (milliseconds % 1000) * 1000; + timeout = &tv; + } + + int result = select(m_maxFd+1, &m_readfds, &m_writefds, NULL, timeout); + + if (result > 0) + return true; + else if (result == 0) + return timeoutIsScheduledEvent; + else + throw Err("WaitObjectContainer: select failed with error " + IntToString(errno)); +} + +#endif + +// ******************************************************** + +std::string CallStack::Format() const +{ + return m_info; +} + +std::string CallStackWithNr::Format() const +{ + return std::string(m_info) + " / nr: " + IntToString(m_nr); +} + +std::string CallStackWithStr::Format() const +{ + return std::string(m_info) + " / " + std::string(m_z); +} + +bool Waitable::Wait(unsigned long milliseconds, CallStack const& callStack) +{ + WaitObjectContainer container; + GetWaitObjects(container, callStack); // reduce clutter by not adding this func to stack + return container.Wait(milliseconds); +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/wait.h b/external/crypto++-5.6.3/wait.h new file mode 100644 index 000000000..773a747ea --- /dev/null +++ b/external/crypto++-5.6.3/wait.h @@ -0,0 +1,217 @@ +#ifndef CRYPTOPP_WAIT_H +#define CRYPTOPP_WAIT_H + +#include "config.h" + +#ifdef SOCKETS_AVAILABLE + +#include "misc.h" +#include "cryptlib.h" +#include + +#ifdef USE_WINDOWS_STYLE_SOCKETS +#include +#else +#include +#endif + +#if defined(__ANDROID__) +#include +#endif + +#include "hrtimer.h" + +NAMESPACE_BEGIN(CryptoPP) + +class Tracer +{ +public: + Tracer(unsigned int level) : m_level(level) {} + virtual ~Tracer() {} + +protected: + //! Override this in your most-derived tracer to do the actual tracing. + virtual void Trace(unsigned int n, std::string const& s) = 0; + + /*! By default, tracers will decide which trace messages to trace according to a trace level + mechanism. If your most-derived tracer uses a different mechanism, override this to + return false. If this method returns false, the default TraceXxxx(void) methods will all + return 0 and must be overridden explicitly by your tracer for trace messages you want. */ + virtual bool UsingDefaults() const { return true; } + +protected: + unsigned int m_level; + + void TraceIf(unsigned int n, std::string const&s) + { if (n) Trace(n, s); } + + /*! Returns nr if, according to the default log settings mechanism (using log levels), + the message should be traced. Returns 0 if the default trace level mechanism is not + in use, or if it is in use but the event should not be traced. Provided as a utility + method for easier and shorter coding of default TraceXxxx(void) implementations. */ + unsigned int Tracing(unsigned int nr, unsigned int minLevel) const + { return (UsingDefaults() && m_level >= minLevel) ? nr : 0; } +}; + +// Your Tracer-derived class should inherit as virtual public from Tracer or another +// Tracer-derived class, and should pass the log level in its constructor. You can use the +// following methods to begin and end your Tracer definition. + +// This constructor macro initializes Tracer directly even if not derived directly from it; +// this is intended, virtual base classes are always initialized by the most derived class. +#define CRYPTOPP_TRACER_CONSTRUCTOR(DERIVED) \ + public: DERIVED(unsigned int level = 0) : Tracer(level) {} + +#define CRYPTOPP_BEGIN_TRACER_CLASS_1(DERIVED, BASE1) \ + class DERIVED : virtual public BASE1, public NotCopyable { CRYPTOPP_TRACER_CONSTRUCTOR(DERIVED) + +#define CRYPTOPP_BEGIN_TRACER_CLASS_2(DERIVED, BASE1, BASE2) \ + class DERIVED : virtual public BASE1, virtual public BASE2, public NotCopyable { CRYPTOPP_TRACER_CONSTRUCTOR(DERIVED) + +#define CRYPTOPP_END_TRACER_CLASS }; + +// In your Tracer-derived class, you should define a globally unique event number for each +// new event defined. This can be done using the following macros. + +#define CRYPTOPP_BEGIN_TRACER_EVENTS(UNIQUENR) enum { EVENTBASE = UNIQUENR, +#define CRYPTOPP_TRACER_EVENT(EVENTNAME) EventNr_##EVENTNAME, +#define CRYPTOPP_END_TRACER_EVENTS }; + +// In your own Tracer-derived class, you must define two methods per new trace event type: +// - unsigned int TraceXxxx() const +// Your default implementation of this method should return the event number if according +// to the default trace level system the event should be traced, or 0 if it should not. +// - void TraceXxxx(string const& s) +// This method should call TraceIf(TraceXxxx(), s); to do the tracing. +// For your convenience, a macro to define these two types of methods are defined below. +// If you use this macro, you should also use the TRACER_EVENTS macros above to associate +// event names with numbers. + +#define CRYPTOPP_TRACER_EVENT_METHODS(EVENTNAME, LOGLEVEL) \ + virtual unsigned int Trace##EVENTNAME() const { return Tracing(EventNr_##EVENTNAME, LOGLEVEL); } \ + virtual void Trace##EVENTNAME(std::string const& s) { TraceIf(Trace##EVENTNAME(), s); } + + +/*! A simple unidirectional linked list with m_prev == 0 to indicate the final entry. + The aim of this implementation is to provide a very lightweight and practical + tracing mechanism with a low performance impact. Functions and methods supporting + this call-stack mechanism would take a parameter of the form "CallStack const& callStack", + and would pass this parameter to subsequent functions they call using the construct: + + SubFunc(arg1, arg2, CallStack("my func at place such and such", &callStack)); + + The advantage of this approach is that it is easy to use and should be very efficient, + involving no allocation from the heap, just a linked list of stack objects containing + pointers to static ASCIIZ strings (or possibly additional but simple data if derived). */ +class CallStack +{ +public: + CallStack(char const* i, CallStack const* p) : m_info(i), m_prev(p) {} + CallStack const* Prev() const { return m_prev; } + virtual std::string Format() const; + +protected: + char const* m_info; + CallStack const* m_prev; +}; + +/*! An extended CallStack entry type with an additional numeric parameter. */ +class CallStackWithNr : public CallStack +{ +public: + CallStackWithNr(char const* i, word32 n, CallStack const* p) : CallStack(i, p), m_nr(n) {} + std::string Format() const; + +protected: + word32 m_nr; +}; + +/*! An extended CallStack entry type with an additional string parameter. */ +class CallStackWithStr : public CallStack +{ +public: + CallStackWithStr(char const* i, char const* z, CallStack const* p) : CallStack(i, p), m_z(z) {} + std::string Format() const; + +protected: + char const* m_z; +}; + +// Thanks to Maximilian Zamorsky for help with http://connect.microsoft.com/VisualStudio/feedback/details/1570496/ +CRYPTOPP_BEGIN_TRACER_CLASS_1(WaitObjectsTracer, Tracer) + CRYPTOPP_BEGIN_TRACER_EVENTS(0x48752841) + CRYPTOPP_TRACER_EVENT(NoWaitLoop) + CRYPTOPP_END_TRACER_EVENTS + CRYPTOPP_TRACER_EVENT_METHODS(NoWaitLoop, 1) +CRYPTOPP_END_TRACER_CLASS + +struct WaitingThreadData; + +//! container of wait objects +class WaitObjectContainer : public NotCopyable +{ +public: + //! exception thrown by WaitObjectContainer + class Err : public Exception + { + public: + Err(const std::string& s) : Exception(IO_ERROR, s) {} + }; + + static unsigned int MaxWaitObjects(); + + WaitObjectContainer(WaitObjectsTracer* tracer = 0); + + void Clear(); + void SetNoWait(CallStack const& callStack); + void ScheduleEvent(double milliseconds, CallStack const& callStack); + // returns false if timed out + bool Wait(unsigned long milliseconds); + +#ifdef USE_WINDOWS_STYLE_SOCKETS +# ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~WaitObjectContainer(); +# else + ~WaitObjectContainer(); +#endif + void AddHandle(HANDLE handle, CallStack const& callStack); +#else + void AddReadFd(int fd, CallStack const& callStack); + void AddWriteFd(int fd, CallStack const& callStack); +#endif + +private: + WaitObjectsTracer* m_tracer; + +#ifdef USE_WINDOWS_STYLE_SOCKETS + void CreateThreads(unsigned int count); + std::vector m_handles; + std::vector m_threads; + HANDLE m_startWaiting; + HANDLE m_stopWaiting; +#else + fd_set m_readfds, m_writefds; + int m_maxFd; +#endif + bool m_noWait; + double m_firstEventTime; + Timer m_eventTimer; + +#ifdef USE_WINDOWS_STYLE_SOCKETS + typedef size_t LastResultType; +#else + typedef int LastResultType; +#endif + enum { LASTRESULT_NOWAIT = -1, LASTRESULT_SCHEDULED = -2, LASTRESULT_TIMEOUT = -3 }; + LastResultType m_lastResult; + unsigned int m_sameResultCount; + Timer m_noWaitTimer; + void SetLastResult(LastResultType result); + void DetectNoWait(LastResultType result, CallStack const& callStack); +}; + +NAMESPACE_END + +#endif + +#endif diff --git a/external/crypto++-5.6.3/wake.cpp b/external/crypto++-5.6.3/wake.cpp new file mode 100644 index 000000000..9bc7f79bc --- /dev/null +++ b/external/crypto++-5.6.3/wake.cpp @@ -0,0 +1,114 @@ +// wake.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "wake.h" +#include "smartptr.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void WAKE_TestInstantiations() +{ + WAKE_OFB<>::Encryption x2; + WAKE_OFB<>::Decryption x4; +} +#endif + +inline word32 WAKE_Base::M(word32 x, word32 y) +{ + word32 w = x+y; + return (w>>8) ^ t[w & 0xff]; +} + +void WAKE_Base::GenKey(word32 k0, word32 k1, word32 k2, word32 k3) +{ + // this code is mostly copied from David Wheeler's paper "A Bulk Data Encryption Algorithm" + signed int x, z, p; + // x and z were declared as "long" in Wheeler's paper, which is a signed type. I don't know if that was intentional, but it's too late to change it now. -- Wei 7/4/2010 + CRYPTOPP_COMPILE_ASSERT(sizeof(x) == 4); + static unsigned int tt[10]= { + 0x726a8f3b, // table + 0xe69a3b5c, + 0xd3c71fe5, + 0xab3c73d2, + 0x4d3a8eb3, + 0x0396d6e8, + 0x3d4c2f7a, + 0x9ee27cf3, } ; + t[0] = k0; + t[1] = k1; + t[2] = k2; + t[3] = k3; + for (p=4 ; p<256 ; p++) + { + x=t[p-4]+t[p-1] ; // fill t + t[p]= (x>>3) ^ tt[x&7] ; + } + + for (p=0 ; p<23 ; p++) + t[p]+=t[p+89] ; // mix first entries + x=t[33] ; z=t[59] | 0x01000001 ; + z=z&0xff7fffff ; + for (p=0 ; p<256 ; p++) { //change top byte to + x=(x&0xff7fffff)+z ; // a permutation etc + t[p]=(t[p] & 0x00ffffff) ^ x ; } + + t[256]=t[0] ; + byte y=byte(x); + for (p=0 ; p<256 ; p++) { // further change perm. + t[p]=t[y=byte(t[p^y]^y)] ; // and other digits + t[y]=t[p+1] ; } +} + +template +void WAKE_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) +{ + CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(key); CRYPTOPP_UNUSED(length); + word32 k0, k1, k2, k3; + BlockGetAndPut::Get(key)(r3)(r4)(r5)(r6)(k0)(k1)(k2)(k3); + GenKey(k0, k1, k2, k3); +} + +// OFB +template +void WAKE_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) +{ +#define WAKE_OUTPUT(x)\ + while (iterationCount--)\ + {\ + CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, r6);\ + r3 = M(r3, r6);\ + r4 = M(r4, r3);\ + r5 = M(r5, r4);\ + r6 = M(r6, r5);\ + output += 4;\ + if (!(x & INPUT_NULL))\ + input += 4;\ + } + + typedef word32 WordType; + CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(WAKE_OUTPUT, 0); +} +/* +template +void WAKE_ROFB_Policy::Iterate(KeystreamOperation operation, byte *output, const byte *input, unsigned int iterationCount) +{ + KeystreamOutput keystreamOperation(operation, output, input); + + while (iterationCount--) + { + keystreamOperation(r6); + r3 = M(r3, r6); + r4 = M(r4, r3); + r5 = M(r5, r4); + r6 = M(r6, r5); + } +} +*/ +template class WAKE_Policy; +template class WAKE_Policy; +//template class WAKE_ROFB_Policy; +//template class WAKE_ROFB_Policy; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/wake.h b/external/crypto++-5.6.3/wake.h new file mode 100644 index 000000000..c5c6fbe13 --- /dev/null +++ b/external/crypto++-5.6.3/wake.h @@ -0,0 +1,68 @@ +// wake.h - written and placed in the public domain by Wei Dai + +//! \file wake.h +//! \brief Classes for WAKE stream cipher + +#ifndef CRYPTOPP_WAKE_H +#define CRYPTOPP_WAKE_H + +#include "seckey.h" +#include "secblock.h" +#include "strciphr.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +template +struct WAKE_OFB_Info : public FixedKeyLength<32> +{ + static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";} +}; + +class CRYPTOPP_NO_VTABLE WAKE_Base +{ +protected: + word32 M(word32 x, word32 y); + void GenKey(word32 k0, word32 k1, word32 k2, word32 k3); + + word32 t[257]; + word32 r3, r4, r5, r6; +}; + +template +class CRYPTOPP_NO_VTABLE WAKE_Policy : public AdditiveCipherConcretePolicy, protected WAKE_Base +{ +protected: + void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); + // OFB + void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); + bool CipherIsRandomAccess() const {return false;} +}; + +//! WAKE-OFB +template +struct WAKE_OFB : public WAKE_OFB_Info, public SymmetricCipherDocumentation +{ + typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, WAKE_OFB_Info > Encryption; + typedef Encryption Decryption; +}; + +/* +template +class WAKE_ROFB_Policy : public WAKE_Policy +{ +protected: + void Iterate(KeystreamOperation operation, byte *output, const byte *input, unsigned int iterationCount); +}; + +template +struct WAKE_ROFB : public WAKE_Info +{ + typedef SymmetricCipherTemplate, WAKE_ROFB_Policy > > Encryption; + typedef Encryption Decryption; +}; +*/ + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/whrlpool.cpp b/external/crypto++-5.6.3/whrlpool.cpp new file mode 100644 index 000000000..bf70f320c --- /dev/null +++ b/external/crypto++-5.6.3/whrlpool.cpp @@ -0,0 +1,723 @@ +// whrlpool.cpp - originally modified by Kevin Springle from +// Paulo Barreto and Vincent Rijmen's public domain code, whirlpool.c. +// Updated to Whirlpool version 3.0, optimized and SSE version added by Wei Dai +// All modifications are placed in the public domain + +// This is the original introductory comment: + +/** + * The Whirlpool hashing function. + * + *

+ * References + * + *

+ * The Whirlpool algorithm was developed by + * Paulo S. L. M. Barreto and + * Vincent Rijmen. + * + * See + * P.S.L.M. Barreto, V. Rijmen, + * ``The Whirlpool hashing function,'' + * NESSIE submission, 2000 (tweaked version, 2001), + * + * + * @author Paulo S.L.M. Barreto + * @author Vincent Rijmen. + * + * @version 3.0 (2003.03.12) + * + * ============================================================================= + * + * Differences from version 2.1: + * + * - Suboptimal diffusion matrix replaced by cir(1, 1, 4, 1, 8, 5, 2, 9). + * + * ============================================================================= + * + * Differences from version 2.0: + * + * - Generation of ISO/IEC 10118-3 test vectors. + * - Bug fix: nonzero carry was ignored when tallying the data length + * (this bug apparently only manifested itself when feeding data + * in pieces rather than in a single chunk at once). + * - Support for MS Visual C++ 64-bit integer arithmetic. + * + * Differences from version 1.0: + * + * - Original S-box replaced by the tweaked, hardware-efficient version. + * + * ============================================================================= + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "pch.h" +#include "config.h" + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4127) +#endif + +#include "whrlpool.h" +#include "misc.h" +#include "cpu.h" + +// "Inline assembly operands don't work with .intel_syntax", +// http://llvm.org/bugs/show_bug.cgi?id=24232 +#if defined(CRYPTOPP_DISABLE_INTEL_ASM) +# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE +# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 +# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 +#endif + +NAMESPACE_BEGIN(CryptoPP) + +#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void Whirlpool_TestInstantiations() +{ + Whirlpool x; +} +#endif + +void Whirlpool::InitState(HashWordType *state) +{ + memset(state, 0, 8*sizeof(state[0])); +} + +void Whirlpool::TruncatedFinal(byte *hash, size_t size) +{ + ThrowIfInvalidTruncatedSize(size); + + PadLastBlock(32); + CorrectEndianess(m_data, m_data, 32); + + m_data[m_data.size()-4] = 0; + m_data[m_data.size()-3] = 0; + m_data[m_data.size()-2] = GetBitCountHi(); + m_data[m_data.size()-1] = GetBitCountLo(); + + Transform(m_state, m_data); + CorrectEndianess(m_state, m_state, DigestSize()); + memcpy(hash, m_state, size); + + Restart(); // reinit for next use +} + +/* + * The number of rounds of the internal dedicated block cipher. + */ +#define R 10 + +/* + * Though Whirlpool is endianness-neutral, the encryption tables are listed + * in BIG-ENDIAN format, which is adopted throughout this implementation + * (but little-endian notation would be equally suitable if consistently + * employed). + */ + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +CRYPTOPP_ALIGN_DATA(16) static const word64 Whirlpool_C[4*256+R] CRYPTOPP_SECTION_ALIGN16 = { +#else +static const word64 Whirlpool_C[4*256+R] = { +#endif + W64LIT(0x18186018c07830d8), W64LIT(0x23238c2305af4626), W64LIT(0xc6c63fc67ef991b8), W64LIT(0xe8e887e8136fcdfb), + W64LIT(0x878726874ca113cb), W64LIT(0xb8b8dab8a9626d11), W64LIT(0x0101040108050209), W64LIT(0x4f4f214f426e9e0d), + W64LIT(0x3636d836adee6c9b), W64LIT(0xa6a6a2a6590451ff), W64LIT(0xd2d26fd2debdb90c), W64LIT(0xf5f5f3f5fb06f70e), + W64LIT(0x7979f979ef80f296), W64LIT(0x6f6fa16f5fcede30), W64LIT(0x91917e91fcef3f6d), W64LIT(0x52525552aa07a4f8), + W64LIT(0x60609d6027fdc047), W64LIT(0xbcbccabc89766535), W64LIT(0x9b9b569baccd2b37), W64LIT(0x8e8e028e048c018a), + W64LIT(0xa3a3b6a371155bd2), W64LIT(0x0c0c300c603c186c), W64LIT(0x7b7bf17bff8af684), W64LIT(0x3535d435b5e16a80), + W64LIT(0x1d1d741de8693af5), W64LIT(0xe0e0a7e05347ddb3), W64LIT(0xd7d77bd7f6acb321), W64LIT(0xc2c22fc25eed999c), + W64LIT(0x2e2eb82e6d965c43), W64LIT(0x4b4b314b627a9629), W64LIT(0xfefedffea321e15d), W64LIT(0x575741578216aed5), + W64LIT(0x15155415a8412abd), W64LIT(0x7777c1779fb6eee8), W64LIT(0x3737dc37a5eb6e92), W64LIT(0xe5e5b3e57b56d79e), + W64LIT(0x9f9f469f8cd92313), W64LIT(0xf0f0e7f0d317fd23), W64LIT(0x4a4a354a6a7f9420), W64LIT(0xdada4fda9e95a944), + W64LIT(0x58587d58fa25b0a2), W64LIT(0xc9c903c906ca8fcf), W64LIT(0x2929a429558d527c), W64LIT(0x0a0a280a5022145a), + W64LIT(0xb1b1feb1e14f7f50), W64LIT(0xa0a0baa0691a5dc9), W64LIT(0x6b6bb16b7fdad614), W64LIT(0x85852e855cab17d9), + W64LIT(0xbdbdcebd8173673c), W64LIT(0x5d5d695dd234ba8f), W64LIT(0x1010401080502090), W64LIT(0xf4f4f7f4f303f507), + W64LIT(0xcbcb0bcb16c08bdd), W64LIT(0x3e3ef83eedc67cd3), W64LIT(0x0505140528110a2d), W64LIT(0x676781671fe6ce78), + W64LIT(0xe4e4b7e47353d597), W64LIT(0x27279c2725bb4e02), W64LIT(0x4141194132588273), W64LIT(0x8b8b168b2c9d0ba7), + W64LIT(0xa7a7a6a7510153f6), W64LIT(0x7d7de97dcf94fab2), W64LIT(0x95956e95dcfb3749), W64LIT(0xd8d847d88e9fad56), + W64LIT(0xfbfbcbfb8b30eb70), W64LIT(0xeeee9fee2371c1cd), W64LIT(0x7c7ced7cc791f8bb), W64LIT(0x6666856617e3cc71), + W64LIT(0xdddd53dda68ea77b), W64LIT(0x17175c17b84b2eaf), W64LIT(0x4747014702468e45), W64LIT(0x9e9e429e84dc211a), + W64LIT(0xcaca0fca1ec589d4), W64LIT(0x2d2db42d75995a58), W64LIT(0xbfbfc6bf9179632e), W64LIT(0x07071c07381b0e3f), + W64LIT(0xadad8ead012347ac), W64LIT(0x5a5a755aea2fb4b0), W64LIT(0x838336836cb51bef), W64LIT(0x3333cc3385ff66b6), + W64LIT(0x636391633ff2c65c), W64LIT(0x02020802100a0412), W64LIT(0xaaaa92aa39384993), W64LIT(0x7171d971afa8e2de), + W64LIT(0xc8c807c80ecf8dc6), W64LIT(0x19196419c87d32d1), W64LIT(0x494939497270923b), W64LIT(0xd9d943d9869aaf5f), + W64LIT(0xf2f2eff2c31df931), W64LIT(0xe3e3abe34b48dba8), W64LIT(0x5b5b715be22ab6b9), W64LIT(0x88881a8834920dbc), + W64LIT(0x9a9a529aa4c8293e), W64LIT(0x262698262dbe4c0b), W64LIT(0x3232c8328dfa64bf), W64LIT(0xb0b0fab0e94a7d59), + W64LIT(0xe9e983e91b6acff2), W64LIT(0x0f0f3c0f78331e77), W64LIT(0xd5d573d5e6a6b733), W64LIT(0x80803a8074ba1df4), + W64LIT(0xbebec2be997c6127), W64LIT(0xcdcd13cd26de87eb), W64LIT(0x3434d034bde46889), W64LIT(0x48483d487a759032), + W64LIT(0xffffdbffab24e354), W64LIT(0x7a7af57af78ff48d), W64LIT(0x90907a90f4ea3d64), W64LIT(0x5f5f615fc23ebe9d), + W64LIT(0x202080201da0403d), W64LIT(0x6868bd6867d5d00f), W64LIT(0x1a1a681ad07234ca), W64LIT(0xaeae82ae192c41b7), + W64LIT(0xb4b4eab4c95e757d), W64LIT(0x54544d549a19a8ce), W64LIT(0x93937693ece53b7f), W64LIT(0x222288220daa442f), + W64LIT(0x64648d6407e9c863), W64LIT(0xf1f1e3f1db12ff2a), W64LIT(0x7373d173bfa2e6cc), W64LIT(0x12124812905a2482), + W64LIT(0x40401d403a5d807a), W64LIT(0x0808200840281048), W64LIT(0xc3c32bc356e89b95), W64LIT(0xecec97ec337bc5df), + W64LIT(0xdbdb4bdb9690ab4d), W64LIT(0xa1a1bea1611f5fc0), W64LIT(0x8d8d0e8d1c830791), W64LIT(0x3d3df43df5c97ac8), + W64LIT(0x97976697ccf1335b), W64LIT(0x0000000000000000), W64LIT(0xcfcf1bcf36d483f9), W64LIT(0x2b2bac2b4587566e), + W64LIT(0x7676c57697b3ece1), W64LIT(0x8282328264b019e6), W64LIT(0xd6d67fd6fea9b128), W64LIT(0x1b1b6c1bd87736c3), + W64LIT(0xb5b5eeb5c15b7774), W64LIT(0xafaf86af112943be), W64LIT(0x6a6ab56a77dfd41d), W64LIT(0x50505d50ba0da0ea), + W64LIT(0x45450945124c8a57), W64LIT(0xf3f3ebf3cb18fb38), W64LIT(0x3030c0309df060ad), W64LIT(0xefef9bef2b74c3c4), + W64LIT(0x3f3ffc3fe5c37eda), W64LIT(0x55554955921caac7), W64LIT(0xa2a2b2a2791059db), W64LIT(0xeaea8fea0365c9e9), + W64LIT(0x656589650fecca6a), W64LIT(0xbabad2bab9686903), W64LIT(0x2f2fbc2f65935e4a), W64LIT(0xc0c027c04ee79d8e), + W64LIT(0xdede5fdebe81a160), W64LIT(0x1c1c701ce06c38fc), W64LIT(0xfdfdd3fdbb2ee746), W64LIT(0x4d4d294d52649a1f), + W64LIT(0x92927292e4e03976), W64LIT(0x7575c9758fbceafa), W64LIT(0x06061806301e0c36), W64LIT(0x8a8a128a249809ae), + W64LIT(0xb2b2f2b2f940794b), W64LIT(0xe6e6bfe66359d185), W64LIT(0x0e0e380e70361c7e), W64LIT(0x1f1f7c1ff8633ee7), + W64LIT(0x6262956237f7c455), W64LIT(0xd4d477d4eea3b53a), W64LIT(0xa8a89aa829324d81), W64LIT(0x96966296c4f43152), + W64LIT(0xf9f9c3f99b3aef62), W64LIT(0xc5c533c566f697a3), W64LIT(0x2525942535b14a10), W64LIT(0x59597959f220b2ab), + W64LIT(0x84842a8454ae15d0), W64LIT(0x7272d572b7a7e4c5), W64LIT(0x3939e439d5dd72ec), W64LIT(0x4c4c2d4c5a619816), + W64LIT(0x5e5e655eca3bbc94), W64LIT(0x7878fd78e785f09f), W64LIT(0x3838e038ddd870e5), W64LIT(0x8c8c0a8c14860598), + W64LIT(0xd1d163d1c6b2bf17), W64LIT(0xa5a5aea5410b57e4), W64LIT(0xe2e2afe2434dd9a1), W64LIT(0x616199612ff8c24e), + W64LIT(0xb3b3f6b3f1457b42), W64LIT(0x2121842115a54234), W64LIT(0x9c9c4a9c94d62508), W64LIT(0x1e1e781ef0663cee), + W64LIT(0x4343114322528661), W64LIT(0xc7c73bc776fc93b1), W64LIT(0xfcfcd7fcb32be54f), W64LIT(0x0404100420140824), + W64LIT(0x51515951b208a2e3), W64LIT(0x99995e99bcc72f25), W64LIT(0x6d6da96d4fc4da22), W64LIT(0x0d0d340d68391a65), + W64LIT(0xfafacffa8335e979), W64LIT(0xdfdf5bdfb684a369), W64LIT(0x7e7ee57ed79bfca9), W64LIT(0x242490243db44819), + W64LIT(0x3b3bec3bc5d776fe), W64LIT(0xabab96ab313d4b9a), W64LIT(0xcece1fce3ed181f0), W64LIT(0x1111441188552299), + W64LIT(0x8f8f068f0c890383), W64LIT(0x4e4e254e4a6b9c04), W64LIT(0xb7b7e6b7d1517366), W64LIT(0xebeb8beb0b60cbe0), + W64LIT(0x3c3cf03cfdcc78c1), W64LIT(0x81813e817cbf1ffd), W64LIT(0x94946a94d4fe3540), W64LIT(0xf7f7fbf7eb0cf31c), + W64LIT(0xb9b9deb9a1676f18), W64LIT(0x13134c13985f268b), W64LIT(0x2c2cb02c7d9c5851), W64LIT(0xd3d36bd3d6b8bb05), + W64LIT(0xe7e7bbe76b5cd38c), W64LIT(0x6e6ea56e57cbdc39), W64LIT(0xc4c437c46ef395aa), W64LIT(0x03030c03180f061b), + W64LIT(0x565645568a13acdc), W64LIT(0x44440d441a49885e), W64LIT(0x7f7fe17fdf9efea0), W64LIT(0xa9a99ea921374f88), + W64LIT(0x2a2aa82a4d825467), W64LIT(0xbbbbd6bbb16d6b0a), W64LIT(0xc1c123c146e29f87), W64LIT(0x53535153a202a6f1), + W64LIT(0xdcdc57dcae8ba572), W64LIT(0x0b0b2c0b58271653), W64LIT(0x9d9d4e9d9cd32701), W64LIT(0x6c6cad6c47c1d82b), + W64LIT(0x3131c43195f562a4), W64LIT(0x7474cd7487b9e8f3), W64LIT(0xf6f6fff6e309f115), W64LIT(0x464605460a438c4c), + W64LIT(0xacac8aac092645a5), W64LIT(0x89891e893c970fb5), W64LIT(0x14145014a04428b4), W64LIT(0xe1e1a3e15b42dfba), + W64LIT(0x16165816b04e2ca6), W64LIT(0x3a3ae83acdd274f7), W64LIT(0x6969b9696fd0d206), W64LIT(0x09092409482d1241), + W64LIT(0x7070dd70a7ade0d7), W64LIT(0xb6b6e2b6d954716f), W64LIT(0xd0d067d0ceb7bd1e), W64LIT(0xeded93ed3b7ec7d6), + W64LIT(0xcccc17cc2edb85e2), W64LIT(0x424215422a578468), W64LIT(0x98985a98b4c22d2c), W64LIT(0xa4a4aaa4490e55ed), + W64LIT(0x2828a0285d885075), W64LIT(0x5c5c6d5cda31b886), W64LIT(0xf8f8c7f8933fed6b), W64LIT(0x8686228644a411c2), + + W64LIT(0xd818186018c07830), W64LIT(0x2623238c2305af46), W64LIT(0xb8c6c63fc67ef991), W64LIT(0xfbe8e887e8136fcd), + W64LIT(0xcb878726874ca113), W64LIT(0x11b8b8dab8a9626d), W64LIT(0x0901010401080502), W64LIT(0x0d4f4f214f426e9e), + W64LIT(0x9b3636d836adee6c), W64LIT(0xffa6a6a2a6590451), W64LIT(0x0cd2d26fd2debdb9), W64LIT(0x0ef5f5f3f5fb06f7), + W64LIT(0x967979f979ef80f2), W64LIT(0x306f6fa16f5fcede), W64LIT(0x6d91917e91fcef3f), W64LIT(0xf852525552aa07a4), + W64LIT(0x4760609d6027fdc0), W64LIT(0x35bcbccabc897665), W64LIT(0x379b9b569baccd2b), W64LIT(0x8a8e8e028e048c01), + W64LIT(0xd2a3a3b6a371155b), W64LIT(0x6c0c0c300c603c18), W64LIT(0x847b7bf17bff8af6), W64LIT(0x803535d435b5e16a), + W64LIT(0xf51d1d741de8693a), W64LIT(0xb3e0e0a7e05347dd), W64LIT(0x21d7d77bd7f6acb3), W64LIT(0x9cc2c22fc25eed99), + W64LIT(0x432e2eb82e6d965c), W64LIT(0x294b4b314b627a96), W64LIT(0x5dfefedffea321e1), W64LIT(0xd5575741578216ae), + W64LIT(0xbd15155415a8412a), W64LIT(0xe87777c1779fb6ee), W64LIT(0x923737dc37a5eb6e), W64LIT(0x9ee5e5b3e57b56d7), + W64LIT(0x139f9f469f8cd923), W64LIT(0x23f0f0e7f0d317fd), W64LIT(0x204a4a354a6a7f94), W64LIT(0x44dada4fda9e95a9), + W64LIT(0xa258587d58fa25b0), W64LIT(0xcfc9c903c906ca8f), W64LIT(0x7c2929a429558d52), W64LIT(0x5a0a0a280a502214), + W64LIT(0x50b1b1feb1e14f7f), W64LIT(0xc9a0a0baa0691a5d), W64LIT(0x146b6bb16b7fdad6), W64LIT(0xd985852e855cab17), + W64LIT(0x3cbdbdcebd817367), W64LIT(0x8f5d5d695dd234ba), W64LIT(0x9010104010805020), W64LIT(0x07f4f4f7f4f303f5), + W64LIT(0xddcbcb0bcb16c08b), W64LIT(0xd33e3ef83eedc67c), W64LIT(0x2d0505140528110a), W64LIT(0x78676781671fe6ce), + W64LIT(0x97e4e4b7e47353d5), W64LIT(0x0227279c2725bb4e), W64LIT(0x7341411941325882), W64LIT(0xa78b8b168b2c9d0b), + W64LIT(0xf6a7a7a6a7510153), W64LIT(0xb27d7de97dcf94fa), W64LIT(0x4995956e95dcfb37), W64LIT(0x56d8d847d88e9fad), + W64LIT(0x70fbfbcbfb8b30eb), W64LIT(0xcdeeee9fee2371c1), W64LIT(0xbb7c7ced7cc791f8), W64LIT(0x716666856617e3cc), + W64LIT(0x7bdddd53dda68ea7), W64LIT(0xaf17175c17b84b2e), W64LIT(0x454747014702468e), W64LIT(0x1a9e9e429e84dc21), + W64LIT(0xd4caca0fca1ec589), W64LIT(0x582d2db42d75995a), W64LIT(0x2ebfbfc6bf917963), W64LIT(0x3f07071c07381b0e), + W64LIT(0xacadad8ead012347), W64LIT(0xb05a5a755aea2fb4), W64LIT(0xef838336836cb51b), W64LIT(0xb63333cc3385ff66), + W64LIT(0x5c636391633ff2c6), W64LIT(0x1202020802100a04), W64LIT(0x93aaaa92aa393849), W64LIT(0xde7171d971afa8e2), + W64LIT(0xc6c8c807c80ecf8d), W64LIT(0xd119196419c87d32), W64LIT(0x3b49493949727092), W64LIT(0x5fd9d943d9869aaf), + W64LIT(0x31f2f2eff2c31df9), W64LIT(0xa8e3e3abe34b48db), W64LIT(0xb95b5b715be22ab6), W64LIT(0xbc88881a8834920d), + W64LIT(0x3e9a9a529aa4c829), W64LIT(0x0b262698262dbe4c), W64LIT(0xbf3232c8328dfa64), W64LIT(0x59b0b0fab0e94a7d), + W64LIT(0xf2e9e983e91b6acf), W64LIT(0x770f0f3c0f78331e), W64LIT(0x33d5d573d5e6a6b7), W64LIT(0xf480803a8074ba1d), + W64LIT(0x27bebec2be997c61), W64LIT(0xebcdcd13cd26de87), W64LIT(0x893434d034bde468), W64LIT(0x3248483d487a7590), + W64LIT(0x54ffffdbffab24e3), W64LIT(0x8d7a7af57af78ff4), W64LIT(0x6490907a90f4ea3d), W64LIT(0x9d5f5f615fc23ebe), + W64LIT(0x3d202080201da040), W64LIT(0x0f6868bd6867d5d0), W64LIT(0xca1a1a681ad07234), W64LIT(0xb7aeae82ae192c41), + W64LIT(0x7db4b4eab4c95e75), W64LIT(0xce54544d549a19a8), W64LIT(0x7f93937693ece53b), W64LIT(0x2f222288220daa44), + W64LIT(0x6364648d6407e9c8), W64LIT(0x2af1f1e3f1db12ff), W64LIT(0xcc7373d173bfa2e6), W64LIT(0x8212124812905a24), + W64LIT(0x7a40401d403a5d80), W64LIT(0x4808082008402810), W64LIT(0x95c3c32bc356e89b), W64LIT(0xdfecec97ec337bc5), + W64LIT(0x4ddbdb4bdb9690ab), W64LIT(0xc0a1a1bea1611f5f), W64LIT(0x918d8d0e8d1c8307), W64LIT(0xc83d3df43df5c97a), + W64LIT(0x5b97976697ccf133), W64LIT(0x0000000000000000), W64LIT(0xf9cfcf1bcf36d483), W64LIT(0x6e2b2bac2b458756), + W64LIT(0xe17676c57697b3ec), W64LIT(0xe68282328264b019), W64LIT(0x28d6d67fd6fea9b1), W64LIT(0xc31b1b6c1bd87736), + W64LIT(0x74b5b5eeb5c15b77), W64LIT(0xbeafaf86af112943), W64LIT(0x1d6a6ab56a77dfd4), W64LIT(0xea50505d50ba0da0), + W64LIT(0x5745450945124c8a), W64LIT(0x38f3f3ebf3cb18fb), W64LIT(0xad3030c0309df060), W64LIT(0xc4efef9bef2b74c3), + W64LIT(0xda3f3ffc3fe5c37e), W64LIT(0xc755554955921caa), W64LIT(0xdba2a2b2a2791059), W64LIT(0xe9eaea8fea0365c9), + W64LIT(0x6a656589650fecca), W64LIT(0x03babad2bab96869), W64LIT(0x4a2f2fbc2f65935e), W64LIT(0x8ec0c027c04ee79d), + W64LIT(0x60dede5fdebe81a1), W64LIT(0xfc1c1c701ce06c38), W64LIT(0x46fdfdd3fdbb2ee7), W64LIT(0x1f4d4d294d52649a), + W64LIT(0x7692927292e4e039), W64LIT(0xfa7575c9758fbcea), W64LIT(0x3606061806301e0c), W64LIT(0xae8a8a128a249809), + W64LIT(0x4bb2b2f2b2f94079), W64LIT(0x85e6e6bfe66359d1), W64LIT(0x7e0e0e380e70361c), W64LIT(0xe71f1f7c1ff8633e), + W64LIT(0x556262956237f7c4), W64LIT(0x3ad4d477d4eea3b5), W64LIT(0x81a8a89aa829324d), W64LIT(0x5296966296c4f431), + W64LIT(0x62f9f9c3f99b3aef), W64LIT(0xa3c5c533c566f697), W64LIT(0x102525942535b14a), W64LIT(0xab59597959f220b2), + W64LIT(0xd084842a8454ae15), W64LIT(0xc57272d572b7a7e4), W64LIT(0xec3939e439d5dd72), W64LIT(0x164c4c2d4c5a6198), + W64LIT(0x945e5e655eca3bbc), W64LIT(0x9f7878fd78e785f0), W64LIT(0xe53838e038ddd870), W64LIT(0x988c8c0a8c148605), + W64LIT(0x17d1d163d1c6b2bf), W64LIT(0xe4a5a5aea5410b57), W64LIT(0xa1e2e2afe2434dd9), W64LIT(0x4e616199612ff8c2), + W64LIT(0x42b3b3f6b3f1457b), W64LIT(0x342121842115a542), W64LIT(0x089c9c4a9c94d625), W64LIT(0xee1e1e781ef0663c), + W64LIT(0x6143431143225286), W64LIT(0xb1c7c73bc776fc93), W64LIT(0x4ffcfcd7fcb32be5), W64LIT(0x2404041004201408), + W64LIT(0xe351515951b208a2), W64LIT(0x2599995e99bcc72f), W64LIT(0x226d6da96d4fc4da), W64LIT(0x650d0d340d68391a), + W64LIT(0x79fafacffa8335e9), W64LIT(0x69dfdf5bdfb684a3), W64LIT(0xa97e7ee57ed79bfc), W64LIT(0x19242490243db448), + W64LIT(0xfe3b3bec3bc5d776), W64LIT(0x9aabab96ab313d4b), W64LIT(0xf0cece1fce3ed181), W64LIT(0x9911114411885522), + W64LIT(0x838f8f068f0c8903), W64LIT(0x044e4e254e4a6b9c), W64LIT(0x66b7b7e6b7d15173), W64LIT(0xe0ebeb8beb0b60cb), + W64LIT(0xc13c3cf03cfdcc78), W64LIT(0xfd81813e817cbf1f), W64LIT(0x4094946a94d4fe35), W64LIT(0x1cf7f7fbf7eb0cf3), + W64LIT(0x18b9b9deb9a1676f), W64LIT(0x8b13134c13985f26), W64LIT(0x512c2cb02c7d9c58), W64LIT(0x05d3d36bd3d6b8bb), + W64LIT(0x8ce7e7bbe76b5cd3), W64LIT(0x396e6ea56e57cbdc), W64LIT(0xaac4c437c46ef395), W64LIT(0x1b03030c03180f06), + W64LIT(0xdc565645568a13ac), W64LIT(0x5e44440d441a4988), W64LIT(0xa07f7fe17fdf9efe), W64LIT(0x88a9a99ea921374f), + W64LIT(0x672a2aa82a4d8254), W64LIT(0x0abbbbd6bbb16d6b), W64LIT(0x87c1c123c146e29f), W64LIT(0xf153535153a202a6), + W64LIT(0x72dcdc57dcae8ba5), W64LIT(0x530b0b2c0b582716), W64LIT(0x019d9d4e9d9cd327), W64LIT(0x2b6c6cad6c47c1d8), + W64LIT(0xa43131c43195f562), W64LIT(0xf37474cd7487b9e8), W64LIT(0x15f6f6fff6e309f1), W64LIT(0x4c464605460a438c), + W64LIT(0xa5acac8aac092645), W64LIT(0xb589891e893c970f), W64LIT(0xb414145014a04428), W64LIT(0xbae1e1a3e15b42df), + W64LIT(0xa616165816b04e2c), W64LIT(0xf73a3ae83acdd274), W64LIT(0x066969b9696fd0d2), W64LIT(0x4109092409482d12), + W64LIT(0xd77070dd70a7ade0), W64LIT(0x6fb6b6e2b6d95471), W64LIT(0x1ed0d067d0ceb7bd), W64LIT(0xd6eded93ed3b7ec7), + W64LIT(0xe2cccc17cc2edb85), W64LIT(0x68424215422a5784), W64LIT(0x2c98985a98b4c22d), W64LIT(0xeda4a4aaa4490e55), + W64LIT(0x752828a0285d8850), W64LIT(0x865c5c6d5cda31b8), W64LIT(0x6bf8f8c7f8933fed), W64LIT(0xc28686228644a411), + + W64LIT(0x30d818186018c078), W64LIT(0x462623238c2305af), W64LIT(0x91b8c6c63fc67ef9), W64LIT(0xcdfbe8e887e8136f), + W64LIT(0x13cb878726874ca1), W64LIT(0x6d11b8b8dab8a962), W64LIT(0x0209010104010805), W64LIT(0x9e0d4f4f214f426e), + W64LIT(0x6c9b3636d836adee), W64LIT(0x51ffa6a6a2a65904), W64LIT(0xb90cd2d26fd2debd), W64LIT(0xf70ef5f5f3f5fb06), + W64LIT(0xf2967979f979ef80), W64LIT(0xde306f6fa16f5fce), W64LIT(0x3f6d91917e91fcef), W64LIT(0xa4f852525552aa07), + W64LIT(0xc04760609d6027fd), W64LIT(0x6535bcbccabc8976), W64LIT(0x2b379b9b569baccd), W64LIT(0x018a8e8e028e048c), + W64LIT(0x5bd2a3a3b6a37115), W64LIT(0x186c0c0c300c603c), W64LIT(0xf6847b7bf17bff8a), W64LIT(0x6a803535d435b5e1), + W64LIT(0x3af51d1d741de869), W64LIT(0xddb3e0e0a7e05347), W64LIT(0xb321d7d77bd7f6ac), W64LIT(0x999cc2c22fc25eed), + W64LIT(0x5c432e2eb82e6d96), W64LIT(0x96294b4b314b627a), W64LIT(0xe15dfefedffea321), W64LIT(0xaed5575741578216), + W64LIT(0x2abd15155415a841), W64LIT(0xeee87777c1779fb6), W64LIT(0x6e923737dc37a5eb), W64LIT(0xd79ee5e5b3e57b56), + W64LIT(0x23139f9f469f8cd9), W64LIT(0xfd23f0f0e7f0d317), W64LIT(0x94204a4a354a6a7f), W64LIT(0xa944dada4fda9e95), + W64LIT(0xb0a258587d58fa25), W64LIT(0x8fcfc9c903c906ca), W64LIT(0x527c2929a429558d), W64LIT(0x145a0a0a280a5022), + W64LIT(0x7f50b1b1feb1e14f), W64LIT(0x5dc9a0a0baa0691a), W64LIT(0xd6146b6bb16b7fda), W64LIT(0x17d985852e855cab), + W64LIT(0x673cbdbdcebd8173), W64LIT(0xba8f5d5d695dd234), W64LIT(0x2090101040108050), W64LIT(0xf507f4f4f7f4f303), + W64LIT(0x8bddcbcb0bcb16c0), W64LIT(0x7cd33e3ef83eedc6), W64LIT(0x0a2d050514052811), W64LIT(0xce78676781671fe6), + W64LIT(0xd597e4e4b7e47353), W64LIT(0x4e0227279c2725bb), W64LIT(0x8273414119413258), W64LIT(0x0ba78b8b168b2c9d), + W64LIT(0x53f6a7a7a6a75101), W64LIT(0xfab27d7de97dcf94), W64LIT(0x374995956e95dcfb), W64LIT(0xad56d8d847d88e9f), + W64LIT(0xeb70fbfbcbfb8b30), W64LIT(0xc1cdeeee9fee2371), W64LIT(0xf8bb7c7ced7cc791), W64LIT(0xcc716666856617e3), + W64LIT(0xa77bdddd53dda68e), W64LIT(0x2eaf17175c17b84b), W64LIT(0x8e45474701470246), W64LIT(0x211a9e9e429e84dc), + W64LIT(0x89d4caca0fca1ec5), W64LIT(0x5a582d2db42d7599), W64LIT(0x632ebfbfc6bf9179), W64LIT(0x0e3f07071c07381b), + W64LIT(0x47acadad8ead0123), W64LIT(0xb4b05a5a755aea2f), W64LIT(0x1bef838336836cb5), W64LIT(0x66b63333cc3385ff), + W64LIT(0xc65c636391633ff2), W64LIT(0x041202020802100a), W64LIT(0x4993aaaa92aa3938), W64LIT(0xe2de7171d971afa8), + W64LIT(0x8dc6c8c807c80ecf), W64LIT(0x32d119196419c87d), W64LIT(0x923b494939497270), W64LIT(0xaf5fd9d943d9869a), + W64LIT(0xf931f2f2eff2c31d), W64LIT(0xdba8e3e3abe34b48), W64LIT(0xb6b95b5b715be22a), W64LIT(0x0dbc88881a883492), + W64LIT(0x293e9a9a529aa4c8), W64LIT(0x4c0b262698262dbe), W64LIT(0x64bf3232c8328dfa), W64LIT(0x7d59b0b0fab0e94a), + W64LIT(0xcff2e9e983e91b6a), W64LIT(0x1e770f0f3c0f7833), W64LIT(0xb733d5d573d5e6a6), W64LIT(0x1df480803a8074ba), + W64LIT(0x6127bebec2be997c), W64LIT(0x87ebcdcd13cd26de), W64LIT(0x68893434d034bde4), W64LIT(0x903248483d487a75), + W64LIT(0xe354ffffdbffab24), W64LIT(0xf48d7a7af57af78f), W64LIT(0x3d6490907a90f4ea), W64LIT(0xbe9d5f5f615fc23e), + W64LIT(0x403d202080201da0), W64LIT(0xd00f6868bd6867d5), W64LIT(0x34ca1a1a681ad072), W64LIT(0x41b7aeae82ae192c), + W64LIT(0x757db4b4eab4c95e), W64LIT(0xa8ce54544d549a19), W64LIT(0x3b7f93937693ece5), W64LIT(0x442f222288220daa), + W64LIT(0xc86364648d6407e9), W64LIT(0xff2af1f1e3f1db12), W64LIT(0xe6cc7373d173bfa2), W64LIT(0x248212124812905a), + W64LIT(0x807a40401d403a5d), W64LIT(0x1048080820084028), W64LIT(0x9b95c3c32bc356e8), W64LIT(0xc5dfecec97ec337b), + W64LIT(0xab4ddbdb4bdb9690), W64LIT(0x5fc0a1a1bea1611f), W64LIT(0x07918d8d0e8d1c83), W64LIT(0x7ac83d3df43df5c9), + W64LIT(0x335b97976697ccf1), W64LIT(0x0000000000000000), W64LIT(0x83f9cfcf1bcf36d4), W64LIT(0x566e2b2bac2b4587), + W64LIT(0xece17676c57697b3), W64LIT(0x19e68282328264b0), W64LIT(0xb128d6d67fd6fea9), W64LIT(0x36c31b1b6c1bd877), + W64LIT(0x7774b5b5eeb5c15b), W64LIT(0x43beafaf86af1129), W64LIT(0xd41d6a6ab56a77df), W64LIT(0xa0ea50505d50ba0d), + W64LIT(0x8a5745450945124c), W64LIT(0xfb38f3f3ebf3cb18), W64LIT(0x60ad3030c0309df0), W64LIT(0xc3c4efef9bef2b74), + W64LIT(0x7eda3f3ffc3fe5c3), W64LIT(0xaac755554955921c), W64LIT(0x59dba2a2b2a27910), W64LIT(0xc9e9eaea8fea0365), + W64LIT(0xca6a656589650fec), W64LIT(0x6903babad2bab968), W64LIT(0x5e4a2f2fbc2f6593), W64LIT(0x9d8ec0c027c04ee7), + W64LIT(0xa160dede5fdebe81), W64LIT(0x38fc1c1c701ce06c), W64LIT(0xe746fdfdd3fdbb2e), W64LIT(0x9a1f4d4d294d5264), + W64LIT(0x397692927292e4e0), W64LIT(0xeafa7575c9758fbc), W64LIT(0x0c3606061806301e), W64LIT(0x09ae8a8a128a2498), + W64LIT(0x794bb2b2f2b2f940), W64LIT(0xd185e6e6bfe66359), W64LIT(0x1c7e0e0e380e7036), W64LIT(0x3ee71f1f7c1ff863), + W64LIT(0xc4556262956237f7), W64LIT(0xb53ad4d477d4eea3), W64LIT(0x4d81a8a89aa82932), W64LIT(0x315296966296c4f4), + W64LIT(0xef62f9f9c3f99b3a), W64LIT(0x97a3c5c533c566f6), W64LIT(0x4a102525942535b1), W64LIT(0xb2ab59597959f220), + W64LIT(0x15d084842a8454ae), W64LIT(0xe4c57272d572b7a7), W64LIT(0x72ec3939e439d5dd), W64LIT(0x98164c4c2d4c5a61), + W64LIT(0xbc945e5e655eca3b), W64LIT(0xf09f7878fd78e785), W64LIT(0x70e53838e038ddd8), W64LIT(0x05988c8c0a8c1486), + W64LIT(0xbf17d1d163d1c6b2), W64LIT(0x57e4a5a5aea5410b), W64LIT(0xd9a1e2e2afe2434d), W64LIT(0xc24e616199612ff8), + W64LIT(0x7b42b3b3f6b3f145), W64LIT(0x42342121842115a5), W64LIT(0x25089c9c4a9c94d6), W64LIT(0x3cee1e1e781ef066), + W64LIT(0x8661434311432252), W64LIT(0x93b1c7c73bc776fc), W64LIT(0xe54ffcfcd7fcb32b), W64LIT(0x0824040410042014), + W64LIT(0xa2e351515951b208), W64LIT(0x2f2599995e99bcc7), W64LIT(0xda226d6da96d4fc4), W64LIT(0x1a650d0d340d6839), + W64LIT(0xe979fafacffa8335), W64LIT(0xa369dfdf5bdfb684), W64LIT(0xfca97e7ee57ed79b), W64LIT(0x4819242490243db4), + W64LIT(0x76fe3b3bec3bc5d7), W64LIT(0x4b9aabab96ab313d), W64LIT(0x81f0cece1fce3ed1), W64LIT(0x2299111144118855), + W64LIT(0x03838f8f068f0c89), W64LIT(0x9c044e4e254e4a6b), W64LIT(0x7366b7b7e6b7d151), W64LIT(0xcbe0ebeb8beb0b60), + W64LIT(0x78c13c3cf03cfdcc), W64LIT(0x1ffd81813e817cbf), W64LIT(0x354094946a94d4fe), W64LIT(0xf31cf7f7fbf7eb0c), + W64LIT(0x6f18b9b9deb9a167), W64LIT(0x268b13134c13985f), W64LIT(0x58512c2cb02c7d9c), W64LIT(0xbb05d3d36bd3d6b8), + W64LIT(0xd38ce7e7bbe76b5c), W64LIT(0xdc396e6ea56e57cb), W64LIT(0x95aac4c437c46ef3), W64LIT(0x061b03030c03180f), + W64LIT(0xacdc565645568a13), W64LIT(0x885e44440d441a49), W64LIT(0xfea07f7fe17fdf9e), W64LIT(0x4f88a9a99ea92137), + W64LIT(0x54672a2aa82a4d82), W64LIT(0x6b0abbbbd6bbb16d), W64LIT(0x9f87c1c123c146e2), W64LIT(0xa6f153535153a202), + W64LIT(0xa572dcdc57dcae8b), W64LIT(0x16530b0b2c0b5827), W64LIT(0x27019d9d4e9d9cd3), W64LIT(0xd82b6c6cad6c47c1), + W64LIT(0x62a43131c43195f5), W64LIT(0xe8f37474cd7487b9), W64LIT(0xf115f6f6fff6e309), W64LIT(0x8c4c464605460a43), + W64LIT(0x45a5acac8aac0926), W64LIT(0x0fb589891e893c97), W64LIT(0x28b414145014a044), W64LIT(0xdfbae1e1a3e15b42), + W64LIT(0x2ca616165816b04e), W64LIT(0x74f73a3ae83acdd2), W64LIT(0xd2066969b9696fd0), W64LIT(0x124109092409482d), + W64LIT(0xe0d77070dd70a7ad), W64LIT(0x716fb6b6e2b6d954), W64LIT(0xbd1ed0d067d0ceb7), W64LIT(0xc7d6eded93ed3b7e), + W64LIT(0x85e2cccc17cc2edb), W64LIT(0x8468424215422a57), W64LIT(0x2d2c98985a98b4c2), W64LIT(0x55eda4a4aaa4490e), + W64LIT(0x50752828a0285d88), W64LIT(0xb8865c5c6d5cda31), W64LIT(0xed6bf8f8c7f8933f), W64LIT(0x11c28686228644a4), + + W64LIT(0x7830d818186018c0), W64LIT(0xaf462623238c2305), W64LIT(0xf991b8c6c63fc67e), W64LIT(0x6fcdfbe8e887e813), + W64LIT(0xa113cb878726874c), W64LIT(0x626d11b8b8dab8a9), W64LIT(0x0502090101040108), W64LIT(0x6e9e0d4f4f214f42), + W64LIT(0xee6c9b3636d836ad), W64LIT(0x0451ffa6a6a2a659), W64LIT(0xbdb90cd2d26fd2de), W64LIT(0x06f70ef5f5f3f5fb), + W64LIT(0x80f2967979f979ef), W64LIT(0xcede306f6fa16f5f), W64LIT(0xef3f6d91917e91fc), W64LIT(0x07a4f852525552aa), + W64LIT(0xfdc04760609d6027), W64LIT(0x766535bcbccabc89), W64LIT(0xcd2b379b9b569bac), W64LIT(0x8c018a8e8e028e04), + W64LIT(0x155bd2a3a3b6a371), W64LIT(0x3c186c0c0c300c60), W64LIT(0x8af6847b7bf17bff), W64LIT(0xe16a803535d435b5), + W64LIT(0x693af51d1d741de8), W64LIT(0x47ddb3e0e0a7e053), W64LIT(0xacb321d7d77bd7f6), W64LIT(0xed999cc2c22fc25e), + W64LIT(0x965c432e2eb82e6d), W64LIT(0x7a96294b4b314b62), W64LIT(0x21e15dfefedffea3), W64LIT(0x16aed55757415782), + W64LIT(0x412abd15155415a8), W64LIT(0xb6eee87777c1779f), W64LIT(0xeb6e923737dc37a5), W64LIT(0x56d79ee5e5b3e57b), + W64LIT(0xd923139f9f469f8c), W64LIT(0x17fd23f0f0e7f0d3), W64LIT(0x7f94204a4a354a6a), W64LIT(0x95a944dada4fda9e), + W64LIT(0x25b0a258587d58fa), W64LIT(0xca8fcfc9c903c906), W64LIT(0x8d527c2929a42955), W64LIT(0x22145a0a0a280a50), + W64LIT(0x4f7f50b1b1feb1e1), W64LIT(0x1a5dc9a0a0baa069), W64LIT(0xdad6146b6bb16b7f), W64LIT(0xab17d985852e855c), + W64LIT(0x73673cbdbdcebd81), W64LIT(0x34ba8f5d5d695dd2), W64LIT(0x5020901010401080), W64LIT(0x03f507f4f4f7f4f3), + W64LIT(0xc08bddcbcb0bcb16), W64LIT(0xc67cd33e3ef83eed), W64LIT(0x110a2d0505140528), W64LIT(0xe6ce78676781671f), + W64LIT(0x53d597e4e4b7e473), W64LIT(0xbb4e0227279c2725), W64LIT(0x5882734141194132), W64LIT(0x9d0ba78b8b168b2c), + W64LIT(0x0153f6a7a7a6a751), W64LIT(0x94fab27d7de97dcf), W64LIT(0xfb374995956e95dc), W64LIT(0x9fad56d8d847d88e), + W64LIT(0x30eb70fbfbcbfb8b), W64LIT(0x71c1cdeeee9fee23), W64LIT(0x91f8bb7c7ced7cc7), W64LIT(0xe3cc716666856617), + W64LIT(0x8ea77bdddd53dda6), W64LIT(0x4b2eaf17175c17b8), W64LIT(0x468e454747014702), W64LIT(0xdc211a9e9e429e84), + W64LIT(0xc589d4caca0fca1e), W64LIT(0x995a582d2db42d75), W64LIT(0x79632ebfbfc6bf91), W64LIT(0x1b0e3f07071c0738), + W64LIT(0x2347acadad8ead01), W64LIT(0x2fb4b05a5a755aea), W64LIT(0xb51bef838336836c), W64LIT(0xff66b63333cc3385), + W64LIT(0xf2c65c636391633f), W64LIT(0x0a04120202080210), W64LIT(0x384993aaaa92aa39), W64LIT(0xa8e2de7171d971af), + W64LIT(0xcf8dc6c8c807c80e), W64LIT(0x7d32d119196419c8), W64LIT(0x70923b4949394972), W64LIT(0x9aaf5fd9d943d986), + W64LIT(0x1df931f2f2eff2c3), W64LIT(0x48dba8e3e3abe34b), W64LIT(0x2ab6b95b5b715be2), W64LIT(0x920dbc88881a8834), + W64LIT(0xc8293e9a9a529aa4), W64LIT(0xbe4c0b262698262d), W64LIT(0xfa64bf3232c8328d), W64LIT(0x4a7d59b0b0fab0e9), + W64LIT(0x6acff2e9e983e91b), W64LIT(0x331e770f0f3c0f78), W64LIT(0xa6b733d5d573d5e6), W64LIT(0xba1df480803a8074), + W64LIT(0x7c6127bebec2be99), W64LIT(0xde87ebcdcd13cd26), W64LIT(0xe468893434d034bd), W64LIT(0x75903248483d487a), + W64LIT(0x24e354ffffdbffab), W64LIT(0x8ff48d7a7af57af7), W64LIT(0xea3d6490907a90f4), W64LIT(0x3ebe9d5f5f615fc2), + W64LIT(0xa0403d202080201d), W64LIT(0xd5d00f6868bd6867), W64LIT(0x7234ca1a1a681ad0), W64LIT(0x2c41b7aeae82ae19), + W64LIT(0x5e757db4b4eab4c9), W64LIT(0x19a8ce54544d549a), W64LIT(0xe53b7f93937693ec), W64LIT(0xaa442f222288220d), + W64LIT(0xe9c86364648d6407), W64LIT(0x12ff2af1f1e3f1db), W64LIT(0xa2e6cc7373d173bf), W64LIT(0x5a24821212481290), + W64LIT(0x5d807a40401d403a), W64LIT(0x2810480808200840), W64LIT(0xe89b95c3c32bc356), W64LIT(0x7bc5dfecec97ec33), + W64LIT(0x90ab4ddbdb4bdb96), W64LIT(0x1f5fc0a1a1bea161), W64LIT(0x8307918d8d0e8d1c), W64LIT(0xc97ac83d3df43df5), + W64LIT(0xf1335b97976697cc), W64LIT(0x0000000000000000), W64LIT(0xd483f9cfcf1bcf36), W64LIT(0x87566e2b2bac2b45), + W64LIT(0xb3ece17676c57697), W64LIT(0xb019e68282328264), W64LIT(0xa9b128d6d67fd6fe), W64LIT(0x7736c31b1b6c1bd8), + W64LIT(0x5b7774b5b5eeb5c1), W64LIT(0x2943beafaf86af11), W64LIT(0xdfd41d6a6ab56a77), W64LIT(0x0da0ea50505d50ba), + W64LIT(0x4c8a574545094512), W64LIT(0x18fb38f3f3ebf3cb), W64LIT(0xf060ad3030c0309d), W64LIT(0x74c3c4efef9bef2b), + W64LIT(0xc37eda3f3ffc3fe5), W64LIT(0x1caac75555495592), W64LIT(0x1059dba2a2b2a279), W64LIT(0x65c9e9eaea8fea03), + W64LIT(0xecca6a656589650f), W64LIT(0x686903babad2bab9), W64LIT(0x935e4a2f2fbc2f65), W64LIT(0xe79d8ec0c027c04e), + W64LIT(0x81a160dede5fdebe), W64LIT(0x6c38fc1c1c701ce0), W64LIT(0x2ee746fdfdd3fdbb), W64LIT(0x649a1f4d4d294d52), + W64LIT(0xe0397692927292e4), W64LIT(0xbceafa7575c9758f), W64LIT(0x1e0c360606180630), W64LIT(0x9809ae8a8a128a24), + W64LIT(0x40794bb2b2f2b2f9), W64LIT(0x59d185e6e6bfe663), W64LIT(0x361c7e0e0e380e70), W64LIT(0x633ee71f1f7c1ff8), + W64LIT(0xf7c4556262956237), W64LIT(0xa3b53ad4d477d4ee), W64LIT(0x324d81a8a89aa829), W64LIT(0xf4315296966296c4), + W64LIT(0x3aef62f9f9c3f99b), W64LIT(0xf697a3c5c533c566), W64LIT(0xb14a102525942535), W64LIT(0x20b2ab59597959f2), + W64LIT(0xae15d084842a8454), W64LIT(0xa7e4c57272d572b7), W64LIT(0xdd72ec3939e439d5), W64LIT(0x6198164c4c2d4c5a), + W64LIT(0x3bbc945e5e655eca), W64LIT(0x85f09f7878fd78e7), W64LIT(0xd870e53838e038dd), W64LIT(0x8605988c8c0a8c14), + W64LIT(0xb2bf17d1d163d1c6), W64LIT(0x0b57e4a5a5aea541), W64LIT(0x4dd9a1e2e2afe243), W64LIT(0xf8c24e616199612f), + W64LIT(0x457b42b3b3f6b3f1), W64LIT(0xa542342121842115), W64LIT(0xd625089c9c4a9c94), W64LIT(0x663cee1e1e781ef0), + W64LIT(0x5286614343114322), W64LIT(0xfc93b1c7c73bc776), W64LIT(0x2be54ffcfcd7fcb3), W64LIT(0x1408240404100420), + W64LIT(0x08a2e351515951b2), W64LIT(0xc72f2599995e99bc), W64LIT(0xc4da226d6da96d4f), W64LIT(0x391a650d0d340d68), + W64LIT(0x35e979fafacffa83), W64LIT(0x84a369dfdf5bdfb6), W64LIT(0x9bfca97e7ee57ed7), W64LIT(0xb44819242490243d), + W64LIT(0xd776fe3b3bec3bc5), W64LIT(0x3d4b9aabab96ab31), W64LIT(0xd181f0cece1fce3e), W64LIT(0x5522991111441188), + W64LIT(0x8903838f8f068f0c), W64LIT(0x6b9c044e4e254e4a), W64LIT(0x517366b7b7e6b7d1), W64LIT(0x60cbe0ebeb8beb0b), + W64LIT(0xcc78c13c3cf03cfd), W64LIT(0xbf1ffd81813e817c), W64LIT(0xfe354094946a94d4), W64LIT(0x0cf31cf7f7fbf7eb), + W64LIT(0x676f18b9b9deb9a1), W64LIT(0x5f268b13134c1398), W64LIT(0x9c58512c2cb02c7d), W64LIT(0xb8bb05d3d36bd3d6), + W64LIT(0x5cd38ce7e7bbe76b), W64LIT(0xcbdc396e6ea56e57), W64LIT(0xf395aac4c437c46e), W64LIT(0x0f061b03030c0318), + W64LIT(0x13acdc565645568a), W64LIT(0x49885e44440d441a), W64LIT(0x9efea07f7fe17fdf), W64LIT(0x374f88a9a99ea921), + W64LIT(0x8254672a2aa82a4d), W64LIT(0x6d6b0abbbbd6bbb1), W64LIT(0xe29f87c1c123c146), W64LIT(0x02a6f153535153a2), + W64LIT(0x8ba572dcdc57dcae), W64LIT(0x2716530b0b2c0b58), W64LIT(0xd327019d9d4e9d9c), W64LIT(0xc1d82b6c6cad6c47), + W64LIT(0xf562a43131c43195), W64LIT(0xb9e8f37474cd7487), W64LIT(0x09f115f6f6fff6e3), W64LIT(0x438c4c464605460a), + W64LIT(0x2645a5acac8aac09), W64LIT(0x970fb589891e893c), W64LIT(0x4428b414145014a0), W64LIT(0x42dfbae1e1a3e15b), + W64LIT(0x4e2ca616165816b0), W64LIT(0xd274f73a3ae83acd), W64LIT(0xd0d2066969b9696f), W64LIT(0x2d12410909240948), + W64LIT(0xade0d77070dd70a7), W64LIT(0x54716fb6b6e2b6d9), W64LIT(0xb7bd1ed0d067d0ce), W64LIT(0x7ec7d6eded93ed3b), + W64LIT(0xdb85e2cccc17cc2e), W64LIT(0x578468424215422a), W64LIT(0xc22d2c98985a98b4), W64LIT(0x0e55eda4a4aaa449), + W64LIT(0x8850752828a0285d), W64LIT(0x31b8865c5c6d5cda), W64LIT(0x3fed6bf8f8c7f893), W64LIT(0xa411c28686228644), + + W64LIT(0x1823c6e887b8014f), + W64LIT(0x36a6d2f5796f9152), + W64LIT(0x60bc9b8ea30c7b35), + W64LIT(0x1de0d7c22e4bfe57), + W64LIT(0x157737e59ff04ada), + W64LIT(0x58c9290ab1a06b85), + W64LIT(0xbd5d10f4cb3e0567), + W64LIT(0xe427418ba77d95d8), + W64LIT(0xfbee7c66dd17479e), + W64LIT(0xca2dbf07ad5a8333) +}; + +// Whirlpool basic transformation. Transforms state based on block. +void Whirlpool::Transform(word64 *digest, const word64 *block) +{ +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE + if (HasISSE()) + { + // MMX version has the same structure as C version below +#ifdef __GNUC__ + #if CRYPTOPP_BOOL_X64 + word64 workspace[16]; + #endif + __asm__ __volatile__ + ( + INTEL_NOPREFIX + AS_PUSH_IF86( bx) + AS2( mov AS_REG_6, WORD_REG(ax)) +#else + #if _MSC_VER < 1300 + AS_PUSH_IF86( bx) + #endif + AS2( lea AS_REG_6, [Whirlpool_C]) + AS2( mov WORD_REG(cx), digest) + AS2( mov WORD_REG(dx), block) +#endif +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 + AS2( mov eax, esp) + AS2( and esp, -16) + AS2( sub esp, 16*8) + AS_PUSH_IF86( ax) + #if CRYPTOPP_BOOL_X86 + #define SSE2_workspace esp+WORD_SZ + #elif CRYPTOPP_BOOL_X32 + #define SSE2_workspace esp+(WORD_SZ*2) + #endif +#else + #define SSE2_workspace %3 +#endif + AS2( xor esi, esi) + ASL(0) + AS2( movq mm0, [WORD_REG(cx)+8*WORD_REG(si)]) + AS2( movq [SSE2_workspace+8*WORD_REG(si)], mm0) // k + AS2( pxor mm0, [WORD_REG(dx)+8*WORD_REG(si)]) + AS2( movq [SSE2_workspace+64+8*WORD_REG(si)], mm0) // s + AS2( movq [WORD_REG(cx)+8*WORD_REG(si)], mm0) + AS1( inc WORD_REG(si)) + AS2( cmp WORD_REG(si), 8) + ASJ( jne, 0, b) + + AS2( xor esi, esi) + ASL(1) + +#define KSL0(a, b) AS2(movq mm##a, b) +#define KSL1(a, b) AS2(pxor mm##a, b) + +#define KSL(op, i, a, b, c, d) \ + AS2(mov eax, [SSE2_workspace+8*i])\ + AS2(movzx edi, al)\ + KSL##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ + AS2(movzx edi, ah)\ + KSL##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ + AS2(shr eax, 16)\ + AS2(movzx edi, al)\ + AS2(shr eax, 8)\ + KSL##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ + KSL##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) + +#define KSH0(a, b) \ + ASS(pshufw mm##a, mm##a, 1, 0, 3, 2)\ + AS2(pxor mm##a, b) +#define KSH1(a, b) \ + AS2(pxor mm##a, b) +#define KSH2(a, b) \ + AS2(pxor mm##a, b)\ + AS2(movq [SSE2_workspace+8*a], mm##a) + +#define KSH(op, i, a, b, c, d) \ + AS2(mov eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\ + AS2(movzx edi, al)\ + KSH##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ + AS2(movzx edi, ah)\ + KSH##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ + AS2(shr eax, 16)\ + AS2(movzx edi, al)\ + AS2(shr eax, 8)\ + KSH##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ + KSH##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) + +#define TSL(op, i, a, b, c, d) \ + AS2(mov eax, [SSE2_workspace+64+8*i])\ + AS2(movzx edi, al)\ + KSL##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ + AS2(movzx edi, ah)\ + KSL##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ + AS2(shr eax, 16)\ + AS2(movzx edi, al)\ + AS2(shr eax, 8)\ + KSL##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ + KSL##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) + +#define TSH0(a, b) \ + ASS(pshufw mm##a, mm##a, 1, 0, 3, 2)\ + AS2(pxor mm##a, [SSE2_workspace+8*a])\ + AS2(pxor mm##a, b) +#define TSH1(a, b) \ + AS2(pxor mm##a, b) +#define TSH2(a, b) \ + AS2(pxor mm##a, b)\ + AS2(movq [SSE2_workspace+64+8*a], mm##a) +#define TSH3(a, b) \ + AS2(pxor mm##a, b)\ + AS2(pxor mm##a, [WORD_REG(cx)+8*a])\ + AS2(movq [WORD_REG(cx)+8*a], mm##a) + +#define TSH(op, i, a, b, c, d) \ + AS2(mov eax, [SSE2_workspace+64+8*((i+4)-8*((i+4)/8))+4])\ + AS2(movzx edi, al)\ + TSH##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ + AS2(movzx edi, ah)\ + TSH##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ + AS2(shr eax, 16)\ + AS2(movzx edi, al)\ + AS2(shr eax, 8)\ + TSH##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ + TSH##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) + + KSL(0, 4, 3, 2, 1, 0) + KSL(0, 0, 7, 6, 5, 4) + KSL(1, 1, 0, 7, 6, 5) + KSL(1, 2, 1, 0, 7, 6) + KSL(1, 3, 2, 1, 0, 7) + KSL(1, 5, 4, 3, 2, 1) + KSL(1, 6, 5, 4, 3, 2) + KSL(1, 7, 6, 5, 4, 3) + KSH(0, 0, 7, 6, 5, 4) + KSH(0, 4, 3, 2, 1, 0) + KSH(1, 1, 0, 7, 6, 5) + KSH(1, 2, 1, 0, 7, 6) + KSH(1, 5, 4, 3, 2, 1) + KSH(1, 6, 5, 4, 3, 2) + KSH(2, 3, 2, 1, 0, 7) + KSH(2, 7, 6, 5, 4, 3) + + AS2( pxor mm0, [AS_REG_6 + 8*1024 + WORD_REG(si)*8]) + AS2( movq [SSE2_workspace], mm0) + + TSL(0, 4, 3, 2, 1, 0) + TSL(0, 0, 7, 6, 5, 4) + TSL(1, 1, 0, 7, 6, 5) + TSL(1, 2, 1, 0, 7, 6) + TSL(1, 3, 2, 1, 0, 7) + TSL(1, 5, 4, 3, 2, 1) + TSL(1, 6, 5, 4, 3, 2) + TSL(1, 7, 6, 5, 4, 3) + TSH(0, 0, 7, 6, 5, 4) + TSH(0, 4, 3, 2, 1, 0) + TSH(1, 1, 0, 7, 6, 5) + TSH(1, 2, 1, 0, 7, 6) + TSH(1, 5, 4, 3, 2, 1) + TSH(1, 6, 5, 4, 3, 2) + + AS1( inc WORD_REG(si)) + AS2( cmp WORD_REG(si), 10) + ASJ( je, 2, f) + + TSH(2, 3, 2, 1, 0, 7) + TSH(2, 7, 6, 5, 4, 3) + + ASJ( jmp, 1, b) + ASL(2) + + TSH(3, 3, 2, 1, 0, 7) + TSH(3, 7, 6, 5, 4, 3) + +#undef KSL +#undef KSH +#undef TSL +#undef TSH + + AS_POP_IF86( sp) + AS1( emms) + +#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER < 1300) + AS_POP_IF86( bx) +#endif +#ifdef __GNUC__ + ATT_PREFIX + : + : "a" (Whirlpool_C), "c" (digest), "d" (block) + #if CRYPTOPP_BOOL_X64 + , "r" (workspace) + #endif + : "%esi", "%edi", "memory", "cc" + #if CRYPTOPP_BOOL_X64 + , "%r9" + #endif + ); +#endif + } + else +#endif // #ifdef CRYPTOPP_X86_ASM_AVAILABLE + { + word64 s[8]; // the cipher state + word64 k[8]; // the round key + + // Compute and apply K^0 to the cipher state + // Also apply part of the Miyaguchi-Preneel compression function + for (int i=0; i<8; i++) + digest[i] = s[i] = block[i] ^ (k[i] = digest[i]); + +#define KSL(op, i, a, b, c, d) \ + t = (word32)k[i];\ + w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : 0);\ + t >>= 8;\ + w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : 0);\ + t >>= 8;\ + w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : 0);\ + t >>= 8;\ + w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : 0); + +#define KSH(op, i, a, b, c, d) \ + t = (word32)(k[(i+4)%8]>>32);\ + w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : rotrFixed(w##a, 32));\ + if (op==2) k[a] = w##a;\ + t >>= 8;\ + w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : rotrFixed(w##b, 32));\ + if (op==2) k[b] = w##b;\ + t >>= 8;\ + w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : rotrFixed(w##c, 32));\ + if (op==2) k[c] = w##c;\ + t >>= 8;\ + w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : rotrFixed(w##d, 32));\ + if (op==2) k[d] = w##d;\ + +#define TSL(op, i, a, b, c, d) \ + t = (word32)s[i];\ + w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : 0);\ + t >>= 8;\ + w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : 0);\ + t >>= 8;\ + w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : 0);\ + t >>= 8;\ + w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : 0); + +#define TSH_OP(op, a, b) \ + w##a = Whirlpool_C[b*256 + (byte)t] ^ (op ? w##a : rotrFixed(w##a, 32) ^ k[a]);\ + if (op==2) s[a] = w##a;\ + if (op==3) digest[a] ^= w##a;\ + +#define TSH(op, i, a, b, c, d) \ + t = (word32)(s[(i+4)%8]>>32);\ + TSH_OP(op, a, 3);\ + t >>= 8;\ + TSH_OP(op, b, 2);\ + t >>= 8;\ + TSH_OP(op, c, 1);\ + t >>= 8;\ + TSH_OP(op, d, 0);\ + + // Iterate over all rounds: + int r=0; + while (true) + { + // Added initialization due to Coverity findings. + word64 w0=0, w1=0, w2=0, w3=0, w4=0, w5=0, w6=0, w7=0; + word32 t=0; + + KSL(0, 4, 3, 2, 1, 0) + KSL(0, 0, 7, 6, 5, 4) + KSL(1, 1, 0, 7, 6, 5) + KSL(1, 2, 1, 0, 7, 6) + KSL(1, 3, 2, 1, 0, 7) + KSL(1, 5, 4, 3, 2, 1) + KSL(1, 6, 5, 4, 3, 2) + KSL(1, 7, 6, 5, 4, 3) + KSH(0, 0, 7, 6, 5, 4) + KSH(0, 4, 3, 2, 1, 0) + KSH(1, 1, 0, 7, 6, 5) + KSH(1, 2, 1, 0, 7, 6) + KSH(1, 5, 4, 3, 2, 1) + KSH(1, 6, 5, 4, 3, 2) + KSH(2, 3, 2, 1, 0, 7) + KSH(2, 7, 6, 5, 4, 3) + + k[0] ^= Whirlpool_C[1024+r]; + + TSL(0, 4, 3, 2, 1, 0) + TSL(0, 0, 7, 6, 5, 4) + TSL(1, 1, 0, 7, 6, 5) + TSL(1, 2, 1, 0, 7, 6) + TSL(1, 3, 2, 1, 0, 7) + TSL(1, 5, 4, 3, 2, 1) + TSL(1, 6, 5, 4, 3, 2) + TSL(1, 7, 6, 5, 4, 3) + TSH(0, 0, 7, 6, 5, 4) + TSH(0, 4, 3, 2, 1, 0) + TSH(1, 1, 0, 7, 6, 5) + TSH(1, 2, 1, 0, 7, 6) + TSH(1, 5, 4, 3, 2, 1) + TSH(1, 6, 5, 4, 3, 2) + + if (++r < R) + { + TSH(2, 3, 2, 1, 0, 7) + TSH(2, 7, 6, 5, 4, 3) + } + else + { + TSH(3, 3, 2, 1, 0, 7) + TSH(3, 7, 6, 5, 4, 3) + break; + } + } + } +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/whrlpool.h b/external/crypto++-5.6.3/whrlpool.h new file mode 100644 index 000000000..62c9d8a53 --- /dev/null +++ b/external/crypto++-5.6.3/whrlpool.h @@ -0,0 +1,21 @@ +#ifndef CRYPTOPP_WHIRLPOOL_H +#define CRYPTOPP_WHIRLPOOL_H + +#include "config.h" +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Whirlpool +class Whirlpool : public IteratedHashWithStaticTransform +{ +public: + static void InitState(HashWordType *state); + static void Transform(word64 *digest, const word64 *data); + void TruncatedFinal(byte *hash, size_t size); + static const char * StaticAlgorithmName() {return "Whirlpool";} +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/winpipes.cpp b/external/crypto++-5.6.3/winpipes.cpp new file mode 100644 index 000000000..685e83c24 --- /dev/null +++ b/external/crypto++-5.6.3/winpipes.cpp @@ -0,0 +1,206 @@ +// winpipes.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" +#include "winpipes.h" + +#ifdef WINDOWS_PIPES_AVAILABLE + +#include "wait.h" + +NAMESPACE_BEGIN(CryptoPP) + +WindowsHandle::WindowsHandle(HANDLE h, bool own) + : m_h(h), m_own(own) +{ +} + +WindowsHandle::~WindowsHandle() +{ + if (m_own) + { + try + { + CloseHandle(); + } + catch (const Exception&) + { + assert(0); + } + } +} + +bool WindowsHandle::HandleValid() const +{ + return m_h && m_h != INVALID_HANDLE_VALUE; +} + +void WindowsHandle::AttachHandle(HANDLE h, bool own) +{ + if (m_own) + CloseHandle(); + + m_h = h; + m_own = own; + HandleChanged(); +} + +HANDLE WindowsHandle::DetachHandle() +{ + HANDLE h = m_h; + m_h = INVALID_HANDLE_VALUE; + HandleChanged(); + return h; +} + +void WindowsHandle::CloseHandle() +{ + if (m_h != INVALID_HANDLE_VALUE) + { + ::CloseHandle(m_h); + m_h = INVALID_HANDLE_VALUE; + HandleChanged(); + } +} + +// ******************************************************** + +void WindowsPipe::HandleError(const char *operation) const +{ + DWORD err = GetLastError(); + throw Err(GetHandle(), operation, err); +} + +WindowsPipe::Err::Err(HANDLE s, const std::string& operation, int error) + : OS_Error(IO_ERROR, "WindowsPipe: " + operation + " operation failed with error 0x" + IntToString(error, 16), operation, error) + , m_h(s) +{ +} + +// ************************************************************* + +WindowsPipeReceiver::WindowsPipeReceiver() + : m_resultPending(false), m_eofReceived(false) +{ + m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); + CheckAndHandleError("CreateEvent", m_event.HandleValid()); + memset(&m_overlapped, 0, sizeof(m_overlapped)); + m_overlapped.hEvent = m_event; +} + +bool WindowsPipeReceiver::Receive(byte* buf, size_t bufLen) +{ + assert(!m_resultPending && !m_eofReceived); + + const HANDLE h = GetHandle(); + // don't queue too much at once, or we might use up non-paged memory + if (ReadFile(h, buf, UnsignedMin((DWORD)128*1024, bufLen), &m_lastResult, &m_overlapped)) + { + if (m_lastResult == 0) + m_eofReceived = true; + } + else + { + switch (GetLastError()) + { + default: + CheckAndHandleError("ReadFile", false); + case ERROR_BROKEN_PIPE: + case ERROR_HANDLE_EOF: + m_lastResult = 0; + m_eofReceived = true; + break; + case ERROR_IO_PENDING: + m_resultPending = true; + } + } + return !m_resultPending; +} + +void WindowsPipeReceiver::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (m_resultPending) + container.AddHandle(m_event, CallStack("WindowsPipeReceiver::GetWaitObjects() - result pending", &callStack)); + else if (!m_eofReceived) + container.SetNoWait(CallStack("WindowsPipeReceiver::GetWaitObjects() - result ready", &callStack)); +} + +unsigned int WindowsPipeReceiver::GetReceiveResult() +{ + if (m_resultPending) + { + const HANDLE h = GetHandle(); + if (GetOverlappedResult(h, &m_overlapped, &m_lastResult, false)) + { + if (m_lastResult == 0) + m_eofReceived = true; + } + else + { + switch (GetLastError()) + { + default: + CheckAndHandleError("GetOverlappedResult", false); + case ERROR_BROKEN_PIPE: + case ERROR_HANDLE_EOF: + m_lastResult = 0; + m_eofReceived = true; + } + } + m_resultPending = false; + } + return m_lastResult; +} + +// ************************************************************* + +WindowsPipeSender::WindowsPipeSender() + : m_resultPending(false), m_lastResult(0) +{ + m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); + CheckAndHandleError("CreateEvent", m_event.HandleValid()); + memset(&m_overlapped, 0, sizeof(m_overlapped)); + m_overlapped.hEvent = m_event; +} + +void WindowsPipeSender::Send(const byte* buf, size_t bufLen) +{ + DWORD written = 0; + const HANDLE h = GetHandle(); + // don't queue too much at once, or we might use up non-paged memory + if (WriteFile(h, buf, UnsignedMin((DWORD)128*1024, bufLen), &written, &m_overlapped)) + { + m_resultPending = false; + m_lastResult = written; + } + else + { + if (GetLastError() != ERROR_IO_PENDING) + CheckAndHandleError("WriteFile", false); + + m_resultPending = true; + } +} + +void WindowsPipeSender::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) +{ + if (m_resultPending) + container.AddHandle(m_event, CallStack("WindowsPipeSender::GetWaitObjects() - result pending", &callStack)); + else + container.SetNoWait(CallStack("WindowsPipeSender::GetWaitObjects() - result ready", &callStack)); +} + +unsigned int WindowsPipeSender::GetSendResult() +{ + if (m_resultPending) + { + const HANDLE h = GetHandle(); + BOOL result = GetOverlappedResult(h, &m_overlapped, &m_lastResult, false); + CheckAndHandleError("GetOverlappedResult", result); + m_resultPending = false; + } + return m_lastResult; +} + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/winpipes.h b/external/crypto++-5.6.3/winpipes.h new file mode 100644 index 000000000..14dc5d0d6 --- /dev/null +++ b/external/crypto++-5.6.3/winpipes.h @@ -0,0 +1,143 @@ +#ifndef CRYPTOPP_WINPIPES_H +#define CRYPTOPP_WINPIPES_H + +#ifdef WINDOWS_PIPES_AVAILABLE + +#include "cryptlib.h" +#include "network.h" +#include "queue.h" +#include + +NAMESPACE_BEGIN(CryptoPP) + +//! Windows Handle +class WindowsHandle +{ +public: + WindowsHandle(HANDLE h = INVALID_HANDLE_VALUE, bool own=false); + WindowsHandle(const WindowsHandle &h) : m_h(h.m_h), m_own(false) {} + virtual ~WindowsHandle(); + + bool GetOwnership() const {return m_own;} + void SetOwnership(bool own) {m_own = own;} + + operator HANDLE() const {return m_h;} + HANDLE GetHandle() const {return m_h;} + bool HandleValid() const; + void AttachHandle(HANDLE h, bool own=false); + HANDLE DetachHandle(); + void CloseHandle(); + +protected: + virtual void HandleChanged() {} + + HANDLE m_h; + bool m_own; +}; + +//! Windows Pipe +class WindowsPipe +{ +public: + class Err : public OS_Error + { + public: + Err(HANDLE h, const std::string& operation, int error); + HANDLE GetHandle() const {return m_h;} + + private: + HANDLE m_h; + }; + +protected: + virtual HANDLE GetHandle() const =0; + virtual void HandleError(const char *operation) const; + void CheckAndHandleError(const char *operation, BOOL result) const + {assert(result==TRUE || result==FALSE); if (!result) HandleError(operation);} +}; + +//! pipe-based implementation of NetworkReceiver +class WindowsPipeReceiver : public WindowsPipe, public NetworkReceiver +{ +public: + WindowsPipeReceiver(); + + bool MustWaitForResult() {return true;} + bool Receive(byte* buf, size_t bufLen); + unsigned int GetReceiveResult(); + bool EofReceived() const {return m_eofReceived;} + + HANDLE GetHandle() const {return m_event;} + unsigned int GetMaxWaitObjectCount() const {return 1;} + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + +private: + WindowsHandle m_event; + OVERLAPPED m_overlapped; + bool m_resultPending; + DWORD m_lastResult; + bool m_eofReceived; +}; + +//! pipe-based implementation of NetworkSender +class WindowsPipeSender : public WindowsPipe, public NetworkSender +{ +public: + WindowsPipeSender(); + + bool MustWaitForResult() {return true;} + void Send(const byte* buf, size_t bufLen); + unsigned int GetSendResult(); + bool MustWaitForEof() { return false; } + void SendEof() {} + + HANDLE GetHandle() const {return m_event;} + unsigned int GetMaxWaitObjectCount() const {return 1;} + void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); + +private: + WindowsHandle m_event; + OVERLAPPED m_overlapped; + bool m_resultPending; + DWORD m_lastResult; +}; + +//! Windows Pipe Source +class WindowsPipeSource : public WindowsHandle, public NetworkSource, public WindowsPipeReceiver +{ +public: + WindowsPipeSource(HANDLE h=INVALID_HANDLE_VALUE, bool pumpAll=false, BufferedTransformation *attachment=NULL) + : WindowsHandle(h), NetworkSource(attachment) + { + if (pumpAll) + PumpAll(); + } + + using NetworkSource::GetMaxWaitObjectCount; + using NetworkSource::GetWaitObjects; + +private: + HANDLE GetHandle() const {return WindowsHandle::GetHandle();} + NetworkReceiver & AccessReceiver() {return *this;} +}; + +//! Windows Pipe Sink +class WindowsPipeSink : public WindowsHandle, public NetworkSink, public WindowsPipeSender +{ +public: + WindowsPipeSink(HANDLE h=INVALID_HANDLE_VALUE, unsigned int maxBufferSize=0, unsigned int autoFlushBound=16*1024) + : WindowsHandle(h), NetworkSink(maxBufferSize, autoFlushBound) {} + + using NetworkSink::GetMaxWaitObjectCount; + using NetworkSink::GetWaitObjects; + +private: + HANDLE GetHandle() const {return WindowsHandle::GetHandle();} + NetworkSender & AccessSender() {return *this;} +}; + +NAMESPACE_END + +#endif // WINDOWS_PIPES_AVAILABLE + +#endif diff --git a/external/crypto++-5.6.3/words.h b/external/crypto++-5.6.3/words.h new file mode 100644 index 000000000..8fdec94ea --- /dev/null +++ b/external/crypto++-5.6.3/words.h @@ -0,0 +1,108 @@ +#ifndef CRYPTOPP_WORDS_H +#define CRYPTOPP_WORDS_H + +#include "config.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +inline size_t CountWords(const word *X, size_t N) +{ + while (N && X[N-1]==0) + N--; + return N; +} + +inline void SetWords(word *r, word a, size_t n) +{ + for (size_t i=0; i> (WORD_BITS-shiftBits); + } + return carry; +} + +inline word ShiftWordsRightByBits(word *r, size_t n, unsigned int shiftBits) +{ + assert (shiftBits0; i--) + { + u = r[i-1]; + r[i-1] = (u >> shiftBits) | carry; + carry = u << (WORD_BITS-shiftBits); + } + return carry; +} + +inline void ShiftWordsLeftByWords(word *r, size_t n, size_t shiftWords) +{ + shiftWords = STDMIN(shiftWords, n); + if (shiftWords) + { + for (size_t i=n-1; i>=shiftWords; i--) + r[i] = r[i-shiftWords]; + SetWords(r, 0, shiftWords); + } +} + +inline void ShiftWordsRightByWords(word *r, size_t n, size_t shiftWords) +{ + shiftWords = STDMIN(shiftWords, n); + if (shiftWords) + { + for (size_t i=0; i+shiftWords().Ref(); +} + +void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits) +{ + assert(qbits > 9); // no primes exist for pbits = 10, qbits = 9 + assert(pbits > qbits); + + const Integer minQ = Integer::Power2(qbits - 1); + const Integer maxQ = Integer::Power2(qbits) - 1; + const Integer minP = Integer::Power2(pbits - 1); + const Integer maxP = Integer::Power2(pbits) - 1; + + Integer r1, r2; + do + { + bool qFound = q.Randomize(rng, minQ, maxQ, Integer::PRIME, 7, 12); + CRYPTOPP_UNUSED(qFound); assert(qFound); + bool solutionsExist = SolveModularQuadraticEquation(r1, r2, 1, -1, 1, q); + CRYPTOPP_UNUSED(solutionsExist); assert(solutionsExist); + } while (!p.Randomize(rng, minP, maxP, Integer::PRIME, CRT(rng.GenerateBit()?r1:r2, q, 2, 3, EuclideanMultiplicativeInverse(p, 3)), 3*q)); + assert(((p.Squared() - p + 1) % q).IsZero()); + + GFP2_ONB gfp2(p); + GFP2Element three = gfp2.ConvertIn(3), t; + + while (true) + { + g.c1.Randomize(rng, Integer::Zero(), p-1); + g.c2.Randomize(rng, Integer::Zero(), p-1); + t = XTR_Exponentiate(g, p+1, p); + if (t.c1 == t.c2) + continue; + g = XTR_Exponentiate(g, (p.Squared()-p+1)/q, p); + if (g != three) + break; + } + assert(XTR_Exponentiate(g, q, p) == three); +} + +GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p) +{ + unsigned int bitCount = e.BitCount(); + if (bitCount == 0) + return GFP2Element(-3, -3); + + // find the lowest bit of e that is 1 + unsigned int lowest1bit; + for (lowest1bit=0; e.GetBit(lowest1bit) == 0; lowest1bit++) {} + + GFP2_ONB gfp2(p); + GFP2Element c = gfp2.ConvertIn(b); + GFP2Element cp = gfp2.PthPower(c); + GFP2Element S[5] = {gfp2.ConvertIn(3), c, gfp2.SpecialOperation1(c)}; + + // do all exponents bits except the lowest zeros starting from the top + unsigned int i; + for (i = e.BitCount() - 1; i>lowest1bit; i--) + { + if (e.GetBit(i)) + { + gfp2.RaiseToPthPower(S[0]); + gfp2.Accumulate(S[0], gfp2.SpecialOperation2(S[2], c, S[1])); + S[1] = gfp2.SpecialOperation1(S[1]); + S[2] = gfp2.SpecialOperation1(S[2]); + S[0].swap(S[1]); + } + else + { + gfp2.RaiseToPthPower(S[2]); + gfp2.Accumulate(S[2], gfp2.SpecialOperation2(S[0], cp, S[1])); + S[1] = gfp2.SpecialOperation1(S[1]); + S[0] = gfp2.SpecialOperation1(S[0]); + S[2].swap(S[1]); + } + } + + // now do the lowest zeros + while (i--) + S[1] = gfp2.SpecialOperation1(S[1]); + + return gfp2.ConvertOut(S[1]); +} + +template class AbstractRing; +template class AbstractGroup; + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/xtr.h b/external/crypto++-5.6.3/xtr.h new file mode 100644 index 000000000..3317feb90 --- /dev/null +++ b/external/crypto++-5.6.3/xtr.h @@ -0,0 +1,217 @@ +#ifndef CRYPTOPP_XTR_H +#define CRYPTOPP_XTR_H + +/** \file + "The XTR public key system" by Arjen K. Lenstra and Eric R. Verheul +*/ + +#include "cryptlib.h" +#include "modarith.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! an element of GF(p^2) +class GFP2Element +{ +public: + GFP2Element() {} + GFP2Element(const Integer &c1, const Integer &c2) : c1(c1), c2(c2) {} + GFP2Element(const byte *encodedElement, unsigned int size) + : c1(encodedElement, size/2), c2(encodedElement+size/2, size/2) {} + + void Encode(byte *encodedElement, unsigned int size) + { + c1.Encode(encodedElement, size/2); + c2.Encode(encodedElement+size/2, size/2); + } + + bool operator==(const GFP2Element &rhs) const {return c1 == rhs.c1 && c2 == rhs.c2;} + bool operator!=(const GFP2Element &rhs) const {return !operator==(rhs);} + + void swap(GFP2Element &a) + { + c1.swap(a.c1); + c2.swap(a.c2); + } + + static const GFP2Element & Zero(); + + Integer c1, c2; +}; + +//! GF(p^2), optimal normal basis +template +class GFP2_ONB : public AbstractRing +{ +public: + typedef F BaseField; + + GFP2_ONB(const Integer &p) : modp(p) + { + if (p%3 != 2) + throw InvalidArgument("GFP2_ONB: modulus must be equivalent to 2 mod 3"); + } + + const Integer& GetModulus() const {return modp.GetModulus();} + + GFP2Element ConvertIn(const Integer &a) const + { + t = modp.Inverse(modp.ConvertIn(a)); + return GFP2Element(t, t); + } + + GFP2Element ConvertIn(const GFP2Element &a) const + {return GFP2Element(modp.ConvertIn(a.c1), modp.ConvertIn(a.c2));} + + GFP2Element ConvertOut(const GFP2Element &a) const + {return GFP2Element(modp.ConvertOut(a.c1), modp.ConvertOut(a.c2));} + + bool Equal(const GFP2Element &a, const GFP2Element &b) const + { + return modp.Equal(a.c1, b.c1) && modp.Equal(a.c2, b.c2); + } + + const Element& Identity() const + { + return GFP2Element::Zero(); + } + + const Element& Add(const Element &a, const Element &b) const + { + result.c1 = modp.Add(a.c1, b.c1); + result.c2 = modp.Add(a.c2, b.c2); + return result; + } + + const Element& Inverse(const Element &a) const + { + result.c1 = modp.Inverse(a.c1); + result.c2 = modp.Inverse(a.c2); + return result; + } + + const Element& Double(const Element &a) const + { + result.c1 = modp.Double(a.c1); + result.c2 = modp.Double(a.c2); + return result; + } + + const Element& Subtract(const Element &a, const Element &b) const + { + result.c1 = modp.Subtract(a.c1, b.c1); + result.c2 = modp.Subtract(a.c2, b.c2); + return result; + } + + Element& Accumulate(Element &a, const Element &b) const + { + modp.Accumulate(a.c1, b.c1); + modp.Accumulate(a.c2, b.c2); + return a; + } + + Element& Reduce(Element &a, const Element &b) const + { + modp.Reduce(a.c1, b.c1); + modp.Reduce(a.c2, b.c2); + return a; + } + + bool IsUnit(const Element &a) const + { + return a.c1.NotZero() || a.c2.NotZero(); + } + + const Element& MultiplicativeIdentity() const + { + result.c1 = result.c2 = modp.Inverse(modp.MultiplicativeIdentity()); + return result; + } + + const Element& Multiply(const Element &a, const Element &b) const + { + t = modp.Add(a.c1, a.c2); + t = modp.Multiply(t, modp.Add(b.c1, b.c2)); + result.c1 = modp.Multiply(a.c1, b.c1); + result.c2 = modp.Multiply(a.c2, b.c2); + result.c1.swap(result.c2); + modp.Reduce(t, result.c1); + modp.Reduce(t, result.c2); + modp.Reduce(result.c1, t); + modp.Reduce(result.c2, t); + return result; + } + + const Element& MultiplicativeInverse(const Element &a) const + { + return result = Exponentiate(a, modp.GetModulus()-2); + } + + const Element& Square(const Element &a) const + { + const Integer &ac1 = (&a == &result) ? (t = a.c1) : a.c1; + result.c1 = modp.Multiply(modp.Subtract(modp.Subtract(a.c2, a.c1), a.c1), a.c2); + result.c2 = modp.Multiply(modp.Subtract(modp.Subtract(ac1, a.c2), a.c2), ac1); + return result; + } + + Element Exponentiate(const Element &a, const Integer &e) const + { + Integer edivp, emodp; + Integer::Divide(emodp, edivp, e, modp.GetModulus()); + Element b = PthPower(a); + return AbstractRing::CascadeExponentiate(a, emodp, b, edivp); + } + + const Element & PthPower(const Element &a) const + { + result = a; + result.c1.swap(result.c2); + return result; + } + + void RaiseToPthPower(Element &a) const + { + a.c1.swap(a.c2); + } + + // a^2 - 2a^p + const Element & SpecialOperation1(const Element &a) const + { + assert(&a != &result); + result = Square(a); + modp.Reduce(result.c1, a.c2); + modp.Reduce(result.c1, a.c2); + modp.Reduce(result.c2, a.c1); + modp.Reduce(result.c2, a.c1); + return result; + } + + // x * z - y * z^p + const Element & SpecialOperation2(const Element &x, const Element &y, const Element &z) const + { + assert(&x != &result && &y != &result && &z != &result); + t = modp.Add(x.c2, y.c2); + result.c1 = modp.Multiply(z.c1, modp.Subtract(y.c1, t)); + modp.Accumulate(result.c1, modp.Multiply(z.c2, modp.Subtract(t, x.c1))); + t = modp.Add(x.c1, y.c1); + result.c2 = modp.Multiply(z.c2, modp.Subtract(y.c2, t)); + modp.Accumulate(result.c2, modp.Multiply(z.c1, modp.Subtract(t, x.c2))); + return result; + } + +protected: + BaseField modp; + mutable GFP2Element result; + mutable Integer t; +}; + +void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits); + +GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p); + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/xtrcrypt.cpp b/external/crypto++-5.6.3/xtrcrypt.cpp new file mode 100644 index 000000000..a9fd7879b --- /dev/null +++ b/external/crypto++-5.6.3/xtrcrypt.cpp @@ -0,0 +1,112 @@ +// xtrcrypt.cpp - written and placed in the public domain by Wei Dai + +#include "pch.h" + +#include "asn.h" +#include "integer.h" +#include "xtrcrypt.h" +#include "nbtheory.h" +#include "modarith.h" +#include "argnames.h" + +NAMESPACE_BEGIN(CryptoPP) + +XTR_DH::XTR_DH(const Integer &p, const Integer &q, const GFP2Element &g) + : m_p(p), m_q(q), m_g(g) +{ +} + +XTR_DH::XTR_DH(RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits) +{ + XTR_FindPrimesAndGenerator(rng, m_p, m_q, m_g, pbits, qbits); +} + +XTR_DH::XTR_DH(BufferedTransformation &bt) +{ + BERSequenceDecoder seq(bt); + m_p.BERDecode(seq); + m_q.BERDecode(seq); + m_g.c1.BERDecode(seq); + m_g.c2.BERDecode(seq); + seq.MessageEnd(); +} + +void XTR_DH::DEREncode(BufferedTransformation &bt) const +{ + DERSequenceEncoder seq(bt); + m_p.DEREncode(seq); + m_q.DEREncode(seq); + m_g.c1.DEREncode(seq); + m_g.c2.DEREncode(seq); + seq.MessageEnd(); +} + +bool XTR_DH::Validate(RandomNumberGenerator &rng, unsigned int level) const +{ + bool pass = true; + pass = pass && m_p > Integer::One() && m_p.IsOdd(); + pass = pass && m_q > Integer::One() && m_q.IsOdd(); + GFP2Element three = GFP2_ONB(m_p).ConvertIn(3); + pass = pass && !(m_g.c1.IsNegative() || m_g.c2.IsNegative() || m_g.c1 >= m_p || m_g.c2 >= m_p || m_g == three); + if (level >= 1) + pass = pass && ((m_p.Squared()-m_p+1)%m_q).IsZero(); + if (level >= 2) + { + pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); + pass = pass && XTR_Exponentiate(m_g, (m_p.Squared()-m_p+1)/m_q, m_p) != three; + pass = pass && XTR_Exponentiate(m_g, m_q, m_p) == three; + } + return pass; +} + +bool XTR_DH::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const +{ + return GetValueHelper(this, name, valueType, pValue).Assignable() + CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupOrder) + CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupGenerator) + ; +} + +void XTR_DH::AssignFrom(const NameValuePairs &source) +{ + AssignFromHelper(this, source) + CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) + CRYPTOPP_SET_FUNCTION_ENTRY(SubgroupOrder) + CRYPTOPP_SET_FUNCTION_ENTRY(SubgroupGenerator) + ; +} + +void XTR_DH::GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const +{ + Integer x(rng, Integer::Zero(), m_q-1); + x.Encode(privateKey, PrivateKeyLength()); +} + +void XTR_DH::GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const +{ + CRYPTOPP_UNUSED(rng); + Integer x(privateKey, PrivateKeyLength()); + GFP2Element y = XTR_Exponentiate(m_g, x, m_p); + y.Encode(publicKey, PublicKeyLength()); +} + +bool XTR_DH::Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey) const +{ + GFP2Element w(otherPublicKey, PublicKeyLength()); + if (validateOtherPublicKey) + { + GFP2_ONB gfp2(m_p); + GFP2Element three = gfp2.ConvertIn(3); + if (w.c1.IsNegative() || w.c2.IsNegative() || w.c1 >= m_p || w.c2 >= m_p || w == three) + return false; + if (XTR_Exponentiate(w, m_q, m_p) != three) + return false; + } + Integer s(privateKey, PrivateKeyLength()); + GFP2Element z = XTR_Exponentiate(w, s, m_p); + z.Encode(agreedValue, AgreedValueLength()); + return true; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/xtrcrypt.h b/external/crypto++-5.6.3/xtrcrypt.h new file mode 100644 index 000000000..c8a2f820f --- /dev/null +++ b/external/crypto++-5.6.3/xtrcrypt.h @@ -0,0 +1,56 @@ +#ifndef CRYPTOPP_XTRCRYPT_H +#define CRYPTOPP_XTRCRYPT_H + +/** \file + "The XTR public key system" by Arjen K. Lenstra and Eric R. Verheul +*/ + +#include "cryptlib.h" +#include "xtr.h" +#include "integer.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! XTR-DH with key validation + +class XTR_DH : public SimpleKeyAgreementDomain, public CryptoParameters +{ + typedef XTR_DH ThisClass; + +public: + XTR_DH(const Integer &p, const Integer &q, const GFP2Element &g); + XTR_DH(RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits); + XTR_DH(BufferedTransformation &domainParams); + + void DEREncode(BufferedTransformation &domainParams) const; + + bool Validate(RandomNumberGenerator &rng, unsigned int level) const; + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + void AssignFrom(const NameValuePairs &source); + CryptoParameters & AccessCryptoParameters() {return *this;} + unsigned int AgreedValueLength() const {return 2*m_p.ByteCount();} + unsigned int PrivateKeyLength() const {return m_q.ByteCount();} + unsigned int PublicKeyLength() const {return 2*m_p.ByteCount();} + + void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const; + void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const; + bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const; + + const Integer &GetModulus() const {return m_p;} + const Integer &GetSubgroupOrder() const {return m_q;} + const GFP2Element &GetSubgroupGenerator() const {return m_g;} + + void SetModulus(const Integer &p) {m_p = p;} + void SetSubgroupOrder(const Integer &q) {m_q = q;} + void SetSubgroupGenerator(const GFP2Element &g) {m_g = g;} + +private: + unsigned int ExponentBitLength() const; + + Integer m_p, m_q; + GFP2Element m_g; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/zdeflate.cpp b/external/crypto++-5.6.3/zdeflate.cpp new file mode 100644 index 000000000..407c2a263 --- /dev/null +++ b/external/crypto++-5.6.3/zdeflate.cpp @@ -0,0 +1,815 @@ +// zdeflate.cpp - written and placed in the public domain by Wei Dai + +// Many of the algorithms and tables used here came from the deflate implementation +// by Jean-loup Gailly, which was included in Crypto++ 4.0 and earlier. I completely +// rewrote it in order to fix a bug that I could not figure out. This code +// is less clever, but hopefully more understandable and maintainable. + +#include "pch.h" +#include "zdeflate.h" +#include "stdcpp.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +LowFirstBitWriter::LowFirstBitWriter(BufferedTransformation *attachment) + : Filter(attachment), m_counting(false), m_bitCount(0), m_buffer(0) + , m_bitsBuffered(0), m_bytesBuffered(0) +{ +} + +void LowFirstBitWriter::StartCounting() +{ + assert(!m_counting); + m_counting = true; + m_bitCount = 0; +} + +unsigned long LowFirstBitWriter::FinishCounting() +{ + assert(m_counting); + m_counting = false; + return m_bitCount; +} + +void LowFirstBitWriter::PutBits(unsigned long value, unsigned int length) +{ + if (m_counting) + m_bitCount += length; + else + { + m_buffer |= value << m_bitsBuffered; + m_bitsBuffered += length; + assert(m_bitsBuffered <= sizeof(unsigned long)*8); + while (m_bitsBuffered >= 8) + { + m_outputBuffer[m_bytesBuffered++] = (byte)m_buffer; + if (m_bytesBuffered == m_outputBuffer.size()) + { + AttachedTransformation()->PutModifiable(m_outputBuffer, m_bytesBuffered); + m_bytesBuffered = 0; + } + m_buffer >>= 8; + m_bitsBuffered -= 8; + } + } +} + +void LowFirstBitWriter::FlushBitBuffer() +{ + if (m_counting) + m_bitCount += 8*(m_bitsBuffered > 0); + else + { + if (m_bytesBuffered > 0) + { + AttachedTransformation()->PutModifiable(m_outputBuffer, m_bytesBuffered); + m_bytesBuffered = 0; + } + if (m_bitsBuffered > 0) + { + AttachedTransformation()->Put((byte)m_buffer); + m_buffer = 0; + m_bitsBuffered = 0; + } + } +} + +void LowFirstBitWriter::ClearBitBuffer() +{ + m_buffer = 0; + m_bytesBuffered = 0; + m_bitsBuffered = 0; +} + +HuffmanEncoder::HuffmanEncoder(const unsigned int *codeBits, unsigned int nCodes) +{ + Initialize(codeBits, nCodes); +} + +struct HuffmanNode +{ + // Coverity finding on uninitalized 'symbol' member + HuffmanNode() + : symbol(0), parent(0) {} + HuffmanNode(const HuffmanNode& rhs) + : symbol(rhs.symbol), parent(rhs.parent) {} + + size_t symbol; + union {size_t parent; unsigned depth, freq;}; +}; + +struct FreqLessThan +{ + inline bool operator()(unsigned int lhs, const HuffmanNode &rhs) {return lhs < rhs.freq;} + inline bool operator()(const HuffmanNode &lhs, const HuffmanNode &rhs) const {return lhs.freq < rhs.freq;} + // needed for MSVC .NET 2005 + inline bool operator()(const HuffmanNode &lhs, unsigned int rhs) {return lhs.freq < rhs;} +}; + +void HuffmanEncoder::GenerateCodeLengths(unsigned int *codeBits, unsigned int maxCodeBits, const unsigned int *codeCounts, size_t nCodes) +{ + assert(nCodes > 0); + assert(nCodes <= ((size_t)1 << maxCodeBits)); + + size_t i; + SecBlockWithHint tree(nCodes); + for (i=0; i= 2) + for (i=tree.size()-2; i>=nCodes; i--) + tree[i].depth = tree[tree[i].parent].depth + 1; + unsigned int sum = 0; + SecBlockWithHint blCount(maxCodeBits+1); + std::fill(blCount.begin(), blCount.end(), 0); + for (i=treeBegin; i (unsigned int)(1 << maxCodeBits) ? sum - (1 << maxCodeBits) : 0; + + while (overflow--) + { + unsigned int bits = maxCodeBits-1; + while (blCount[bits] == 0) + bits--; + blCount[bits]--; + blCount[bits+1] += 2; + assert(blCount[maxCodeBits] > 0); + blCount[maxCodeBits]--; + } + + for (i=0; i 0); + unsigned int maxCodeBits = *std::max_element(codeBits, codeBits+nCodes); + if (maxCodeBits == 0) + return; // assume this object won't be used + + SecBlockWithHint blCount(maxCodeBits+1); + std::fill(blCount.begin(), blCount.end(), 0); + unsigned int i; + for (i=0; i nextCode(maxCodeBits+1); + nextCode[1] = 0; + for (i=2; i<=maxCodeBits; i++) + { + code = (code + blCount[i-1]) << 1; + nextCode[i] = code; + } + assert(maxCodeBits == 1 || code == (1 << maxCodeBits) - blCount[maxCodeBits]); + + m_valueToCode.resize(nCodes); + for (i=0; i> (8*sizeof(code_t)-len); + } +} + +inline void HuffmanEncoder::Encode(LowFirstBitWriter &writer, value_t value) const +{ + assert(m_valueToCode[value].len > 0); + writer.PutBits(m_valueToCode[value].code, m_valueToCode[value].len); +} + +Deflator::Deflator(BufferedTransformation *attachment, int deflateLevel, int log2WindowSize, bool detectUncompressible) + : LowFirstBitWriter(attachment) + , m_deflateLevel(-1) +{ + InitializeStaticEncoders(); + IsolatedInitialize(MakeParameters("DeflateLevel", deflateLevel)("Log2WindowSize", log2WindowSize)("DetectUncompressible", detectUncompressible)); +} + +Deflator::Deflator(const NameValuePairs ¶meters, BufferedTransformation *attachment) + : LowFirstBitWriter(attachment) + , m_deflateLevel(-1) +{ + InitializeStaticEncoders(); + IsolatedInitialize(parameters); +} + +void Deflator::InitializeStaticEncoders() +{ + unsigned int codeLengths[288]; + std::fill(codeLengths + 0, codeLengths + 144, 8); + std::fill(codeLengths + 144, codeLengths + 256, 9); + std::fill(codeLengths + 256, codeLengths + 280, 7); + std::fill(codeLengths + 280, codeLengths + 288, 8); + m_staticLiteralEncoder.Initialize(codeLengths, 288); + std::fill(codeLengths + 0, codeLengths + 32, 5); + m_staticDistanceEncoder.Initialize(codeLengths, 32); +} + +void Deflator::IsolatedInitialize(const NameValuePairs ¶meters) +{ + int log2WindowSize = parameters.GetIntValueWithDefault("Log2WindowSize", DEFAULT_LOG2_WINDOW_SIZE); + if (!(MIN_LOG2_WINDOW_SIZE <= log2WindowSize && log2WindowSize <= MAX_LOG2_WINDOW_SIZE)) + throw InvalidArgument("Deflator: " + IntToString(log2WindowSize) + " is an invalid window size"); + + m_log2WindowSize = log2WindowSize; + DSIZE = 1 << m_log2WindowSize; + DMASK = DSIZE - 1; + HSIZE = 1 << m_log2WindowSize; + HMASK = HSIZE - 1; + m_byteBuffer.New(2*DSIZE); + m_head.New(HSIZE); + m_prev.New(DSIZE); + m_matchBuffer.New(DSIZE/2); + Reset(true); + + const int deflateLevel = parameters.GetIntValueWithDefault("DeflateLevel", DEFAULT_DEFLATE_LEVEL); + assert(deflateLevel >= MIN_DEFLATE_LEVEL /*0*/ && deflateLevel <= MAX_DEFLATE_LEVEL /*9*/); + SetDeflateLevel(deflateLevel); + bool detectUncompressible = parameters.GetValueWithDefault("DetectUncompressible", true); + m_compressibleDeflateLevel = detectUncompressible ? m_deflateLevel : 0; +} + +void Deflator::Reset(bool forceReset) +{ + if (forceReset) + ClearBitBuffer(); + else + assert(m_bitsBuffered == 0); + + m_headerWritten = false; + m_matchAvailable = false; + m_dictionaryEnd = 0; + m_stringStart = 0; + m_lookahead = 0; + m_minLookahead = MAX_MATCH; + m_matchBufferEnd = 0; + m_blockStart = 0; + m_blockLength = 0; + + m_detectCount = 1; + m_detectSkip = 0; + + // m_prev will be initialized automaticly in InsertString + std::fill(m_head.begin(), m_head.end(), byte(0)); + + std::fill(m_literalCounts.begin(), m_literalCounts.end(), byte(0)); + std::fill(m_distanceCounts.begin(), m_distanceCounts.end(), byte(0)); +} + +void Deflator::SetDeflateLevel(int deflateLevel) +{ + if (!(MIN_DEFLATE_LEVEL <= deflateLevel && deflateLevel <= MAX_DEFLATE_LEVEL)) + throw InvalidArgument("Deflator: " + IntToString(deflateLevel) + " is an invalid deflate level"); + + if (deflateLevel == m_deflateLevel) + return; + + EndBlock(false); + + static const unsigned int configurationTable[10][4] = { + /* good lazy nice chain */ + /* 0 */ {0, 0, 0, 0}, /* store only */ + /* 1 */ {4, 3, 8, 4}, /* maximum speed, no lazy matches */ + /* 2 */ {4, 3, 16, 8}, + /* 3 */ {4, 3, 32, 32}, + /* 4 */ {4, 4, 16, 16}, /* lazy matches */ + /* 5 */ {8, 16, 32, 32}, + /* 6 */ {8, 16, 128, 128}, + /* 7 */ {8, 32, 128, 256}, + /* 8 */ {32, 128, 258, 1024}, + /* 9 */ {32, 258, 258, 4096}}; /* maximum compression */ + + GOOD_MATCH = configurationTable[deflateLevel][0]; + MAX_LAZYLENGTH = configurationTable[deflateLevel][1]; + MAX_CHAIN_LENGTH = configurationTable[deflateLevel][3]; + + m_deflateLevel = deflateLevel; +} + +unsigned int Deflator::FillWindow(const byte *str, size_t length) +{ + unsigned int maxBlockSize = (unsigned int)STDMIN(2UL*DSIZE, 0xffffUL); + + if (m_stringStart >= maxBlockSize - MAX_MATCH) + { + if (m_blockStart < DSIZE) + EndBlock(false); + + memcpy(m_byteBuffer, m_byteBuffer + DSIZE, DSIZE); + + m_dictionaryEnd = m_dictionaryEnd < DSIZE ? 0 : m_dictionaryEnd-DSIZE; + assert(m_stringStart >= DSIZE); + m_stringStart -= DSIZE; + assert(!m_matchAvailable || m_previousMatch >= DSIZE); + m_previousMatch -= DSIZE; + assert(m_blockStart >= DSIZE); + m_blockStart -= DSIZE; + + // These are set to the same value in IsolatedInitialize(). If they + // are the same, then we can clear a Coverity false alarm. + assert(DSIZE == HSIZE); + + unsigned int i; + for (i=0; i m_stringStart+m_lookahead); + unsigned int accepted = UnsignedMin(maxBlockSize-(m_stringStart+m_lookahead), length); + assert(accepted > 0); + memcpy(m_byteBuffer + m_stringStart + m_lookahead, str, accepted); + m_lookahead += accepted; + return accepted; +} + +inline unsigned int Deflator::ComputeHash(const byte *str) const +{ + assert(str+3 <= m_byteBuffer + m_stringStart + m_lookahead); + return ((str[0] << 10) ^ (str[1] << 5) ^ str[2]) & HMASK; +} + +unsigned int Deflator::LongestMatch(unsigned int &bestMatch) const +{ + assert(m_previousLength < MAX_MATCH); + + bestMatch = 0; + unsigned int bestLength = STDMAX(m_previousLength, (unsigned int)MIN_MATCH-1); + if (m_lookahead <= bestLength) + return 0; + + const byte *scan = m_byteBuffer + m_stringStart, *scanEnd = scan + STDMIN((unsigned int)MAX_MATCH, m_lookahead); + unsigned int limit = m_stringStart > (DSIZE-MAX_MATCH) ? m_stringStart - (DSIZE-MAX_MATCH) : 0; + unsigned int current = m_head[ComputeHash(scan)]; + + unsigned int chainLength = MAX_CHAIN_LENGTH; + if (m_previousLength >= GOOD_MATCH) + chainLength >>= 2; + + while (current > limit && --chainLength > 0) + { + const byte *match = m_byteBuffer + current; + assert(scan + bestLength < m_byteBuffer + m_stringStart + m_lookahead); + if (scan[bestLength-1] == match[bestLength-1] && scan[bestLength] == match[bestLength] && scan[0] == match[0] && scan[1] == match[1]) + { + assert(scan[2] == match[2]); + unsigned int len = (unsigned int)( +#if defined(_STDEXT_BEGIN) && !(defined(_MSC_VER) && (_MSC_VER < 1400 || _MSC_VER >= 1600)) && !defined(_STLPORT_VERSION) + stdext::unchecked_mismatch +#else + std::mismatch +#endif +#if _MSC_VER >= 1600 + (stdext::make_unchecked_array_iterator(scan)+3, stdext::make_unchecked_array_iterator(scanEnd), stdext::make_unchecked_array_iterator(match)+3).first - stdext::make_unchecked_array_iterator(scan)); +#else + (scan+3, scanEnd, match+3).first - scan); +#endif + assert(len != bestLength); + if (len > bestLength) + { + bestLength = len; + bestMatch = current; + + assert(scanEnd >= scan); + if (len == (unsigned int)(scanEnd - scan)) + break; + } + } + current = m_prev[current & DMASK]; + } + return (bestMatch > 0) ? bestLength : 0; +} + +inline void Deflator::InsertString(unsigned int start) +{ + assert(start <= 0xffff); + unsigned int hash = ComputeHash(m_byteBuffer + start); + m_prev[start & DMASK] = m_head[hash]; + m_head[hash] = word16(start); +} + +void Deflator::ProcessBuffer() +{ + if (!m_headerWritten) + { + WritePrestreamHeader(); + m_headerWritten = true; + } + + if (m_deflateLevel == 0) + { + m_stringStart += m_lookahead; + m_lookahead = 0; + m_blockLength = m_stringStart - m_blockStart; + m_matchAvailable = false; + return; + } + + while (m_lookahead > m_minLookahead) + { + while (m_dictionaryEnd < m_stringStart && m_dictionaryEnd+3 <= m_stringStart+m_lookahead) + InsertString(m_dictionaryEnd++); + + if (m_matchAvailable) + { + unsigned int matchPosition = 0, matchLength = 0; + bool usePreviousMatch; + if (m_previousLength >= MAX_LAZYLENGTH) + usePreviousMatch = true; + else + { + matchLength = LongestMatch(matchPosition); + usePreviousMatch = (matchLength == 0); + } + if (usePreviousMatch) + { + MatchFound(m_stringStart-1-m_previousMatch, m_previousLength); + m_stringStart += m_previousLength-1; + m_lookahead -= m_previousLength-1; + m_matchAvailable = false; + } + else + { + m_previousLength = matchLength; + m_previousMatch = matchPosition; + LiteralByte(m_byteBuffer[m_stringStart-1]); + m_stringStart++; + m_lookahead--; + } + } + else + { + m_previousLength = 0; + m_previousLength = LongestMatch(m_previousMatch); + if (m_previousLength) + m_matchAvailable = true; + else + LiteralByte(m_byteBuffer[m_stringStart]); + m_stringStart++; + m_lookahead--; + } + + assert(m_stringStart - (m_blockStart+m_blockLength) == (unsigned int)m_matchAvailable); + } + + if (m_minLookahead == 0 && m_matchAvailable) + { + LiteralByte(m_byteBuffer[m_stringStart-1]); + m_matchAvailable = false; + } +} + +size_t Deflator::Put2(const byte *str, size_t length, int messageEnd, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("Deflator"); + + size_t accepted = 0; + while (accepted < length) + { + unsigned int newAccepted = FillWindow(str+accepted, length-accepted); + ProcessBuffer(); + // call ProcessUncompressedData() after WritePrestreamHeader() + ProcessUncompressedData(str+accepted, newAccepted); + accepted += newAccepted; + } + assert(accepted == length); + + if (messageEnd) + { + m_minLookahead = 0; + ProcessBuffer(); + EndBlock(true); + FlushBitBuffer(); + WritePoststreamTail(); + Reset(); + } + + Output(0, NULL, 0, messageEnd, blocking); + return 0; +} + +bool Deflator::IsolatedFlush(bool hardFlush, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("Deflator"); + + m_minLookahead = 0; + ProcessBuffer(); + m_minLookahead = MAX_MATCH; + EndBlock(false); + if (hardFlush) + EncodeBlock(false, STORED); + return false; +} + +void Deflator::LiteralByte(byte b) +{ + if (m_matchBufferEnd == m_matchBuffer.size()) + EndBlock(false); + + m_matchBuffer[m_matchBufferEnd++].literalCode = b; + m_literalCounts[b]++; + m_blockLength++; +} + +void Deflator::MatchFound(unsigned int distance, unsigned int length) +{ + if (m_matchBufferEnd == m_matchBuffer.size()) + EndBlock(false); + + static const unsigned int lengthCodes[] = { + 257, 258, 259, 260, 261, 262, 263, 264, 265, 265, 266, 266, 267, 267, 268, 268, + 269, 269, 269, 269, 270, 270, 270, 270, 271, 271, 271, 271, 272, 272, 272, 272, + 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 274, 274, 274, 274, 274, 274, + 275, 275, 275, 275, 275, 275, 275, 275, 276, 276, 276, 276, 276, 276, 276, 276, + 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 285}; + static const unsigned int lengthBases[] = + {3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195, + 227,258}; + static const unsigned int distanceBases[30] = + {1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073, + 4097,6145,8193,12289,16385,24577}; + + assert(m_matchBufferEnd < m_matchBuffer.size()); + EncodedMatch &m = m_matchBuffer[m_matchBufferEnd++]; + assert(length >= 3 && length < COUNTOF(lengthCodes)); + unsigned int lengthCode = lengthCodes[length-3]; + m.literalCode = lengthCode; + m.literalExtra = length - lengthBases[lengthCode-257]; + unsigned int distanceCode = (unsigned int)(std::upper_bound(distanceBases, distanceBases+30, distance) - distanceBases - 1); + m.distanceCode = distanceCode; + m.distanceExtra = distance - distanceBases[distanceCode]; + + m_literalCounts[lengthCode]++; + m_distanceCounts[distanceCode]++; + m_blockLength += length; +} + +inline unsigned int CodeLengthEncode(const unsigned int *begin, + const unsigned int *end, + const unsigned int *& p, + unsigned int &extraBits, + unsigned int &extraBitsLength) +{ + unsigned int v = *p; + if ((end-p) >= 3) + { + const unsigned int *oldp = p; + if (v==0 && p[1]==0 && p[2]==0) + { + for (p=p+3; p!=end && *p==0 && p!=oldp+138; p++) {} + unsigned int repeat = (unsigned int)(p - oldp); + if (repeat <= 10) + { + extraBits = repeat-3; + extraBitsLength = 3; + return 17; + } + else + { + extraBits = repeat-11; + extraBitsLength = 7; + return 18; + } + } + else if (p!=begin && v==p[-1] && v==p[1] && v==p[2]) + { + for (p=p+3; p!=end && *p==v && p!=oldp+6; p++) {} + unsigned int repeat = (unsigned int)(p - oldp); + extraBits = repeat-3; + extraBitsLength = 2; + return 16; + } + } + p++; + extraBits = 0; + extraBitsLength = 0; + return v; +} + +void Deflator::EncodeBlock(bool eof, unsigned int blockType) +{ + PutBits(eof, 1); + PutBits(blockType, 2); + + if (blockType == STORED) + { + assert(m_blockStart + m_blockLength <= m_byteBuffer.size()); + assert(m_blockLength <= 0xffff); + FlushBitBuffer(); + AttachedTransformation()->PutWord16(word16(m_blockLength), LITTLE_ENDIAN_ORDER); + AttachedTransformation()->PutWord16(word16(~m_blockLength), LITTLE_ENDIAN_ORDER); + AttachedTransformation()->Put(m_byteBuffer + m_blockStart, m_blockLength); + } + else + { + if (blockType == DYNAMIC) + { +#if defined(_MSC_VER) && !defined(__MWERKS__) && (_MSC_VER <= 1300) + // VC60 and VC7 workaround: built-in std::reverse_iterator has two template parameters, Dinkumware only has one + typedef reverse_bidirectional_iterator RevIt; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator RevIt; +#else + typedef std::reverse_iterator RevIt; +#endif + + FixedSizeSecBlock literalCodeLengths; + FixedSizeSecBlock distanceCodeLengths; + + m_literalCounts[256] = 1; + HuffmanEncoder::GenerateCodeLengths(literalCodeLengths, 15, m_literalCounts, 286); + m_dynamicLiteralEncoder.Initialize(literalCodeLengths, 286); + unsigned int hlit = (unsigned int)(std::find_if(RevIt(literalCodeLengths.end()), RevIt(literalCodeLengths.begin()+257), std::bind2nd(std::not_equal_to(), 0)).base() - (literalCodeLengths.begin()+257)); + + HuffmanEncoder::GenerateCodeLengths(distanceCodeLengths, 15, m_distanceCounts, 30); + m_dynamicDistanceEncoder.Initialize(distanceCodeLengths, 30); + unsigned int hdist = (unsigned int)(std::find_if(RevIt(distanceCodeLengths.end()), RevIt(distanceCodeLengths.begin()+1), std::bind2nd(std::not_equal_to(), 0)).base() - (distanceCodeLengths.begin()+1)); + + SecBlockWithHint combinedLengths(hlit+257+hdist+1); + memcpy(combinedLengths, literalCodeLengths, (hlit+257)*sizeof(unsigned int)); + memcpy(combinedLengths+hlit+257, distanceCodeLengths, (hdist+1)*sizeof(unsigned int)); + + FixedSizeSecBlock codeLengthCodeCounts, codeLengthCodeLengths; + std::fill(codeLengthCodeCounts.begin(), codeLengthCodeCounts.end(), 0); + const unsigned int *p = combinedLengths.begin(), *begin = combinedLengths.begin(), *end = combinedLengths.end(); + while (p != end) + { + unsigned int code=0, extraBits=0, extraBitsLength=0; + code = CodeLengthEncode(begin, end, p, extraBits, extraBitsLength); + codeLengthCodeCounts[code]++; + } + HuffmanEncoder::GenerateCodeLengths(codeLengthCodeLengths, 7, codeLengthCodeCounts, 19); + HuffmanEncoder codeLengthEncoder(codeLengthCodeLengths, 19); + static const unsigned int border[] = { // Order of the bit length code lengths + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + unsigned int hclen = 19; + while (hclen > 4 && codeLengthCodeLengths[border[hclen-1]] == 0) + hclen--; + hclen -= 4; + + PutBits(hlit, 5); + PutBits(hdist, 5); + PutBits(hclen, 4); + + for (unsigned int i=0; i= 257) + { + assert(literalCode <= 285); + PutBits(m_matchBuffer[i].literalExtra, lengthExtraBits[literalCode-257]); + unsigned int distanceCode = m_matchBuffer[i].distanceCode; + distanceEncoder.Encode(*this, distanceCode); + PutBits(m_matchBuffer[i].distanceExtra, distanceExtraBits[distanceCode]); + } + } + literalEncoder.Encode(*this, 256); // end of block + } +} + +void Deflator::EndBlock(bool eof) +{ + if (m_blockLength == 0 && !eof) + return; + + if (m_deflateLevel == 0) + { + EncodeBlock(eof, STORED); + + if (m_compressibleDeflateLevel > 0 && ++m_detectCount == m_detectSkip) + { + m_deflateLevel = m_compressibleDeflateLevel; + m_detectCount = 1; + } + } + else + { + unsigned long storedLen = 8*((unsigned long)m_blockLength+4) + RoundUpToMultipleOf(m_bitsBuffered+3, 8U)-m_bitsBuffered; + + StartCounting(); + EncodeBlock(eof, STATIC); + unsigned long staticLen = FinishCounting(); + + unsigned long dynamicLen; + if (m_blockLength < 128 && m_deflateLevel < 8) + dynamicLen = ULONG_MAX; + else + { + StartCounting(); + EncodeBlock(eof, DYNAMIC); + dynamicLen = FinishCounting(); + } + + if (storedLen <= staticLen && storedLen <= dynamicLen) + { + EncodeBlock(eof, STORED); + + if (m_compressibleDeflateLevel > 0) + { + if (m_detectSkip) + m_deflateLevel = 0; + m_detectSkip = m_detectSkip ? STDMIN(2*m_detectSkip, 128U) : 1; + } + } + else + { + if (staticLen <= dynamicLen) + EncodeBlock(eof, STATIC); + else + EncodeBlock(eof, DYNAMIC); + + if (m_compressibleDeflateLevel > 0) + m_detectSkip = 0; + } + } + + m_matchBufferEnd = 0; + m_blockStart += m_blockLength; + m_blockLength = 0; + std::fill(m_literalCounts.begin(), m_literalCounts.end(), 0); + std::fill(m_distanceCounts.begin(), m_distanceCounts.end(), 0); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/zdeflate.h b/external/crypto++-5.6.3/zdeflate.h new file mode 100644 index 000000000..6c0a79287 --- /dev/null +++ b/external/crypto++-5.6.3/zdeflate.h @@ -0,0 +1,132 @@ +#ifndef CRYPTOPP_ZDEFLATE_H +#define CRYPTOPP_ZDEFLATE_H + +#include "cryptlib.h" +#include "filters.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class LowFirstBitWriter : public Filter +{ +public: + LowFirstBitWriter(BufferedTransformation *attachment); + void PutBits(unsigned long value, unsigned int length); + void FlushBitBuffer(); + void ClearBitBuffer(); + + void StartCounting(); + unsigned long FinishCounting(); + +protected: + bool m_counting; + unsigned long m_bitCount; + unsigned long m_buffer; + unsigned int m_bitsBuffered, m_bytesBuffered; + FixedSizeSecBlock m_outputBuffer; +}; + +//! \class HuffmanEncoder +class HuffmanEncoder +{ +public: + typedef unsigned int code_t; + typedef unsigned int value_t; + + //! \brief Construct a HuffmanEncoder + HuffmanEncoder() {} + + //! \brief Construct a HuffmanEncoder + //! \param codeBits a table of code bits + //! \param nCodes the number of codes in the table + HuffmanEncoder(const unsigned int *codeBits, unsigned int nCodes); + + //! \brief Initialize or reinitialize this object + //! \param codeBits a table of code bits + //! \param nCodes the number of codes in the table + void Initialize(const unsigned int *codeBits, unsigned int nCodes); + + static void GenerateCodeLengths(unsigned int *codeBits, unsigned int maxCodeBits, const unsigned int *codeCounts, size_t nCodes); + + void Encode(LowFirstBitWriter &writer, value_t value) const; + + struct Code + { + unsigned int code; + unsigned int len; + }; + + SecBlock m_valueToCode; +}; + +//! DEFLATE (RFC 1951) compressor + +class Deflator : public LowFirstBitWriter +{ +public: + enum {MIN_DEFLATE_LEVEL = 0, DEFAULT_DEFLATE_LEVEL = 6, MAX_DEFLATE_LEVEL = 9}; + enum {MIN_LOG2_WINDOW_SIZE = 9, DEFAULT_LOG2_WINDOW_SIZE = 15, MAX_LOG2_WINDOW_SIZE = 15}; + /*! \note detectUncompressible makes it faster to process uncompressible files, but + if a file has both compressible and uncompressible parts, it may fail to compress some of the + compressible parts. */ + Deflator(BufferedTransformation *attachment=NULL, int deflateLevel=DEFAULT_DEFLATE_LEVEL, int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true); + //! possible parameter names: Log2WindowSize, DeflateLevel, DetectUncompressible + Deflator(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL); + + //! this function can be used to set the deflate level in the middle of compression + void SetDeflateLevel(int deflateLevel); + int GetDeflateLevel() const {return m_deflateLevel;} + int GetLog2WindowSize() const {return m_log2WindowSize;} + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + bool IsolatedFlush(bool hardFlush, bool blocking); + +protected: + virtual void WritePrestreamHeader() {} + virtual void ProcessUncompressedData(const byte *string, size_t length) + {CRYPTOPP_UNUSED(string), CRYPTOPP_UNUSED(length);} + virtual void WritePoststreamTail() {} + + enum {STORED = 0, STATIC = 1, DYNAMIC = 2}; + enum {MIN_MATCH = 3, MAX_MATCH = 258}; + + void InitializeStaticEncoders(); + void Reset(bool forceReset = false); + unsigned int FillWindow(const byte *str, size_t length); + unsigned int ComputeHash(const byte *str) const; + unsigned int LongestMatch(unsigned int &bestMatch) const; + void InsertString(unsigned int start); + void ProcessBuffer(); + + void LiteralByte(byte b); + void MatchFound(unsigned int distance, unsigned int length); + void EncodeBlock(bool eof, unsigned int blockType); + void EndBlock(bool eof); + + struct EncodedMatch + { + unsigned literalCode : 9; + unsigned literalExtra : 5; + unsigned distanceCode : 5; + unsigned distanceExtra : 13; + }; + + int m_deflateLevel, m_log2WindowSize, m_compressibleDeflateLevel; + unsigned int m_detectSkip, m_detectCount; + unsigned int DSIZE, DMASK, HSIZE, HMASK, GOOD_MATCH, MAX_LAZYLENGTH, MAX_CHAIN_LENGTH; + bool m_headerWritten, m_matchAvailable; + unsigned int m_dictionaryEnd, m_stringStart, m_lookahead, m_minLookahead, m_previousMatch, m_previousLength; + HuffmanEncoder m_staticLiteralEncoder, m_staticDistanceEncoder, m_dynamicLiteralEncoder, m_dynamicDistanceEncoder; + SecByteBlock m_byteBuffer; + SecBlock m_head, m_prev; + FixedSizeSecBlock m_literalCounts; + FixedSizeSecBlock m_distanceCounts; + SecBlock m_matchBuffer; + unsigned int m_matchBufferEnd, m_blockStart, m_blockLength; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/zinflate.cpp b/external/crypto++-5.6.3/zinflate.cpp new file mode 100644 index 000000000..669efba32 --- /dev/null +++ b/external/crypto++-5.6.3/zinflate.cpp @@ -0,0 +1,637 @@ +// zinflate.cpp - written and placed in the public domain by Wei Dai + +// This is a complete reimplementation of the DEFLATE decompression algorithm. +// It should not be affected by any security vulnerabilities in the zlib +// compression library. In particular it is not affected by the double free bug +// (http://www.kb.cert.org/vuls/id/368819). + +#include "pch.h" + +#include "zinflate.h" +#include "secblock.h" +#include "smartptr.h" + +NAMESPACE_BEGIN(CryptoPP) + +struct CodeLessThan +{ + inline bool operator()(CryptoPP::HuffmanDecoder::code_t lhs, const CryptoPP::HuffmanDecoder::CodeInfo &rhs) + {return lhs < rhs.code;} + // needed for MSVC .NET 2005 + inline bool operator()(const CryptoPP::HuffmanDecoder::CodeInfo &lhs, const CryptoPP::HuffmanDecoder::CodeInfo &rhs) + {return lhs.code < rhs.code;} +}; + +inline bool LowFirstBitReader::FillBuffer(unsigned int length) +{ + while (m_bitsBuffered < length) + { + byte b; + if (!m_store.Get(b)) + return false; + m_buffer |= (unsigned long)b << m_bitsBuffered; + m_bitsBuffered += 8; + } + assert(m_bitsBuffered <= sizeof(unsigned long)*8); + return true; +} + +inline unsigned long LowFirstBitReader::PeekBits(unsigned int length) +{ + bool result = FillBuffer(length); + CRYPTOPP_UNUSED(result); assert(result); + return m_buffer & (((unsigned long)1 << length) - 1); +} + +inline void LowFirstBitReader::SkipBits(unsigned int length) +{ + assert(m_bitsBuffered >= length); + m_buffer >>= length; + m_bitsBuffered -= length; +} + +inline unsigned long LowFirstBitReader::GetBits(unsigned int length) +{ + unsigned long result = PeekBits(length); + SkipBits(length); + return result; +} + +inline HuffmanDecoder::code_t HuffmanDecoder::NormalizeCode(HuffmanDecoder::code_t code, unsigned int codeBits) +{ + return code << (MAX_CODE_BITS - codeBits); +} + +void HuffmanDecoder::Initialize(const unsigned int *codeBits, unsigned int nCodes) +{ + // the Huffman codes are represented in 3 ways in this code: + // + // 1. most significant code bit (i.e. top of code tree) in the least significant bit position + // 2. most significant code bit (i.e. top of code tree) in the most significant bit position + // 3. most significant code bit (i.e. top of code tree) in n-th least significant bit position, + // where n is the maximum code length for this code tree + // + // (1) is the way the codes come in from the deflate stream + // (2) is used to sort codes so they can be binary searched + // (3) is used in this function to compute codes from code lengths + // + // a code in representation (2) is called "normalized" here + // The BitReverse() function is used to convert between (1) and (2) + // The NormalizeCode() function is used to convert from (3) to (2) + + if (nCodes == 0) + throw Err("null code"); + + m_maxCodeBits = *std::max_element(codeBits, codeBits+nCodes); + + if (m_maxCodeBits > MAX_CODE_BITS) + throw Err("code length exceeds maximum"); + + if (m_maxCodeBits == 0) + throw Err("null code"); + + // count number of codes of each length + SecBlockWithHint blCount(m_maxCodeBits+1); + std::fill(blCount.begin(), blCount.end(), 0); + unsigned int i; + for (i=0; i nextCode(m_maxCodeBits+1); + nextCode[1] = 0; + for (i=2; i<=m_maxCodeBits; i++) + { + // compute this while checking for overflow: code = (code + blCount[i-1]) << 1 + if (code > code + blCount[i-1]) + throw Err("codes oversubscribed"); + code += blCount[i-1]; + if (code > (code << 1)) + throw Err("codes oversubscribed"); + code <<= 1; + nextCode[i] = code; + } + + // MAX_CODE_BITS is 32, m_maxCodeBits may be smaller. + const unsigned long long shiftedMaxCode = (1ULL << m_maxCodeBits); + if (code > shiftedMaxCode - blCount[m_maxCodeBits]) + throw Err("codes oversubscribed"); + else if (m_maxCodeBits != 1 && code < shiftedMaxCode - blCount[m_maxCodeBits]) + throw Err("codes incomplete"); + + // compute a vector of triples sorted by code + m_codeToValue.resize(nCodes - blCount[0]); + unsigned int j=0; + for (i=0; ilen) + { + entry.type = 2; + entry.len = codeInfo.len; + } + else + { + entry.type = 3; + entry.end = last+1; + } + } +} + +inline unsigned int HuffmanDecoder::Decode(code_t code, /* out */ value_t &value) const +{ + assert(m_codeToValue.size() > 0); + LookupEntry &entry = m_cache[code & m_cacheMask]; + + code_t normalizedCode = 0; + if (entry.type != 1) + normalizedCode = BitReverse(code); + + if (entry.type == 0) + FillCacheEntry(entry, normalizedCode); + + if (entry.type == 1) + { + value = entry.value; + return entry.len; + } + else + { + const CodeInfo &codeInfo = (entry.type == 2) + ? entry.begin[(normalizedCode << m_cacheBits) >> (MAX_CODE_BITS - (entry.len - m_cacheBits))] + : *(std::upper_bound(entry.begin, entry.end, normalizedCode, CodeLessThan())-1); + value = codeInfo.value; + return codeInfo.len; + } +} + +bool HuffmanDecoder::Decode(LowFirstBitReader &reader, value_t &value) const +{ + bool result = reader.FillBuffer(m_maxCodeBits); + if(!result) return false; + + unsigned int codeBits = Decode(reader.PeekBuffer(), value); + if (codeBits > reader.BitsBuffered()) + return false; + reader.SkipBits(codeBits); + return true; +} + +// ************************************************************* + +Inflator::Inflator(BufferedTransformation *attachment, bool repeat, int propagation) + : AutoSignaling(propagation) + , m_state(PRE_STREAM), m_repeat(repeat), m_eof(0), m_wrappedAround(0) + , m_blockType(0xff), m_storedLen(0xffff), m_nextDecode(), m_literal(0) + , m_distance(0), m_reader(m_inQueue), m_current(0), m_lastFlush(0) +{ + Detach(attachment); +} + +void Inflator::IsolatedInitialize(const NameValuePairs ¶meters) +{ + m_state = PRE_STREAM; + parameters.GetValue("Repeat", m_repeat); + m_inQueue.Clear(); + m_reader.SkipBits(m_reader.BitsBuffered()); +} + +void Inflator::OutputByte(byte b) +{ + m_window[m_current++] = b; + if (m_current == m_window.size()) + { + ProcessDecompressedData(m_window + m_lastFlush, m_window.size() - m_lastFlush); + m_lastFlush = 0; + m_current = 0; + m_wrappedAround = true; + } +} + +void Inflator::OutputString(const byte *string, size_t length) +{ + while (length) + { + size_t len = UnsignedMin(length, m_window.size() - m_current); + memcpy(m_window + m_current, string, len); + m_current += len; + if (m_current == m_window.size()) + { + ProcessDecompressedData(m_window + m_lastFlush, m_window.size() - m_lastFlush); + m_lastFlush = 0; + m_current = 0; + m_wrappedAround = true; + } + string += len; + length -= len; + } +} + +void Inflator::OutputPast(unsigned int length, unsigned int distance) +{ + size_t start; + if (distance <= m_current) + start = m_current - distance; + else if (m_wrappedAround && distance <= m_window.size()) + start = m_current + m_window.size() - distance; + else + throw BadBlockErr(); + + if (start + length > m_window.size()) + { + for (; start < m_window.size(); start++, length--) + OutputByte(m_window[start]); + start = 0; + } + + if (start + length > m_current || m_current + length >= m_window.size()) + { + while (length--) + OutputByte(m_window[start++]); + } + else + { + memcpy(m_window + m_current, m_window + start, length); + m_current += length; + } +} + +size_t Inflator::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("Inflator"); + + LazyPutter lp(m_inQueue, inString, length); + ProcessInput(messageEnd != 0); + + if (messageEnd) + if (!(m_state == PRE_STREAM || m_state == AFTER_END)) + throw UnexpectedEndErr(); + + Output(0, NULL, 0, messageEnd, blocking); + return 0; +} + +bool Inflator::IsolatedFlush(bool hardFlush, bool blocking) +{ + if (!blocking) + throw BlockingInputOnly("Inflator"); + + if (hardFlush) + ProcessInput(true); + FlushOutput(); + + return false; +} + +void Inflator::ProcessInput(bool flush) +{ + while (true) + { + switch (m_state) + { + case PRE_STREAM: + if (!flush && m_inQueue.CurrentSize() < MaxPrestreamHeaderSize()) + return; + ProcessPrestreamHeader(); + m_state = WAIT_HEADER; + m_wrappedAround = false; + m_current = 0; + m_lastFlush = 0; + m_window.New(1 << GetLog2WindowSize()); + break; + case WAIT_HEADER: + { + // maximum number of bytes before actual compressed data starts + const size_t MAX_HEADER_SIZE = BitsToBytes(3+5+5+4+19*7+286*15+19*15); + if (m_inQueue.CurrentSize() < (flush ? 1 : MAX_HEADER_SIZE)) + return; + DecodeHeader(); + break; + } + case DECODING_BODY: + if (!DecodeBody()) + return; + break; + case POST_STREAM: + if (!flush && m_inQueue.CurrentSize() < MaxPoststreamTailSize()) + return; + ProcessPoststreamTail(); + m_state = m_repeat ? PRE_STREAM : AFTER_END; + Output(0, NULL, 0, GetAutoSignalPropagation(), true); // TODO: non-blocking + if (m_inQueue.IsEmpty()) + return; + break; + case AFTER_END: + m_inQueue.TransferTo(*AttachedTransformation()); + return; + } + } +} + +void Inflator::DecodeHeader() +{ + if (!m_reader.FillBuffer(3)) + throw UnexpectedEndErr(); + m_eof = m_reader.GetBits(1) != 0; + m_blockType = (byte)m_reader.GetBits(2); + switch (m_blockType) + { + case 0: // stored + { + m_reader.SkipBits(m_reader.BitsBuffered() % 8); + if (!m_reader.FillBuffer(32)) + throw UnexpectedEndErr(); + m_storedLen = (word16)m_reader.GetBits(16); + word16 nlen = (word16)m_reader.GetBits(16); + if (nlen != (word16)~m_storedLen) + throw BadBlockErr(); + break; + } + case 1: // fixed codes + m_nextDecode = LITERAL; + break; + case 2: // dynamic codes + { + if (!m_reader.FillBuffer(5+5+4)) + throw UnexpectedEndErr(); + unsigned int hlit = m_reader.GetBits(5); + unsigned int hdist = m_reader.GetBits(5); + unsigned int hclen = m_reader.GetBits(4); + + FixedSizeSecBlock codeLengths; + unsigned int i; + static const unsigned int border[] = { // Order of the bit length code lengths + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + std::fill(codeLengths.begin(), codeLengths+19, 0); + for (i=0; i hlit+257+hdist+1) + throw BadBlockErr(); + std::fill(codeLengths + i, codeLengths + i + count, repeater); + i += count; + } + m_dynamicLiteralDecoder.Initialize(codeLengths, hlit+257); + if (hdist == 0 && codeLengths[hlit+257] == 0) + { + if (hlit != 0) // a single zero distance code length means all literals + throw BadBlockErr(); + } + else + m_dynamicDistanceDecoder.Initialize(codeLengths+hlit+257, hdist+1); + m_nextDecode = LITERAL; + } + catch (HuffmanDecoder::Err &) + { + throw BadBlockErr(); + } + break; + } + default: + throw BadBlockErr(); // reserved block type + } + m_state = DECODING_BODY; +} + +bool Inflator::DecodeBody() +{ + bool blockEnd = false; + switch (m_blockType) + { + case 0: // stored + assert(m_reader.BitsBuffered() == 0); + while (!m_inQueue.IsEmpty() && !blockEnd) + { + size_t size; + const byte *block = m_inQueue.Spy(size); + size = UnsignedMin(m_storedLen, size); + assert(size <= 0xffff); + + OutputString(block, size); + m_inQueue.Skip(size); + m_storedLen = m_storedLen - (word16)size; + if (m_storedLen == 0) + blockEnd = true; + } + break; + case 1: // fixed codes + case 2: // dynamic codes + static const unsigned int lengthStarts[] = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; + static const unsigned int lengthExtraBits[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; + static const unsigned int distanceStarts[] = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; + static const unsigned int distanceExtraBits[] = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + + const HuffmanDecoder& literalDecoder = GetLiteralDecoder(); + const HuffmanDecoder& distanceDecoder = GetDistanceDecoder(); + + switch (m_nextDecode) + { + case LITERAL: + while (true) + { + if (!literalDecoder.Decode(m_reader, m_literal)) + { + m_nextDecode = LITERAL; + break; + } + if (m_literal < 256) + OutputByte((byte)m_literal); + else if (m_literal == 256) // end of block + { + blockEnd = true; + break; + } + else + { + if (m_literal > 285) + throw BadBlockErr(); + unsigned int bits; + case LENGTH_BITS: + bits = lengthExtraBits[m_literal-257]; + if (!m_reader.FillBuffer(bits)) + { + m_nextDecode = LENGTH_BITS; + break; + } + m_literal = m_reader.GetBits(bits) + lengthStarts[m_literal-257]; + case DISTANCE: + if (!distanceDecoder.Decode(m_reader, m_distance)) + { + m_nextDecode = DISTANCE; + break; + } + case DISTANCE_BITS: + bits = distanceExtraBits[m_distance]; + if (!m_reader.FillBuffer(bits)) + { + m_nextDecode = DISTANCE_BITS; + break; + } + m_distance = m_reader.GetBits(bits) + distanceStarts[m_distance]; + OutputPast(m_literal, m_distance); + } + } + break; + default: + assert(0); + } + } + if (blockEnd) + { + if (m_eof) + { + FlushOutput(); + m_reader.SkipBits(m_reader.BitsBuffered()%8); + if (m_reader.BitsBuffered()) + { + // undo too much lookahead + SecBlockWithHint buffer(m_reader.BitsBuffered() / 8); + for (unsigned int i=0; i= m_lastFlush); + ProcessDecompressedData(m_window + m_lastFlush, m_current - m_lastFlush); + m_lastFlush = m_current; + } +} + +struct NewFixedLiteralDecoder +{ + HuffmanDecoder * operator()() const + { + unsigned int codeLengths[288]; + std::fill(codeLengths + 0, codeLengths + 144, 8); + std::fill(codeLengths + 144, codeLengths + 256, 9); + std::fill(codeLengths + 256, codeLengths + 280, 7); + std::fill(codeLengths + 280, codeLengths + 288, 8); + member_ptr pDecoder(new HuffmanDecoder); + pDecoder->Initialize(codeLengths, 288); + return pDecoder.release(); + } +}; + +struct NewFixedDistanceDecoder +{ + HuffmanDecoder * operator()() const + { + unsigned int codeLengths[32]; + std::fill(codeLengths + 0, codeLengths + 32, 5); + member_ptr pDecoder(new HuffmanDecoder); + pDecoder->Initialize(codeLengths, 32); + return pDecoder.release(); + } +}; + +const HuffmanDecoder& Inflator::GetLiteralDecoder() const +{ + return m_blockType == 1 ? Singleton().Ref() : m_dynamicLiteralDecoder; +} + +const HuffmanDecoder& Inflator::GetDistanceDecoder() const +{ + return m_blockType == 1 ? Singleton().Ref() : m_dynamicDistanceDecoder; +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/zinflate.h b/external/crypto++-5.6.3/zinflate.h new file mode 100644 index 000000000..e2fd23700 --- /dev/null +++ b/external/crypto++-5.6.3/zinflate.h @@ -0,0 +1,153 @@ +#ifndef CRYPTOPP_ZINFLATE_H +#define CRYPTOPP_ZINFLATE_H + +#include "cryptlib.h" +#include "secblock.h" +#include "filters.h" +#include "stdcpp.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! _ +class LowFirstBitReader +{ +public: + LowFirstBitReader(BufferedTransformation &store) + : m_store(store), m_buffer(0), m_bitsBuffered(0) {} + unsigned int BitsBuffered() const {return m_bitsBuffered;} + unsigned long PeekBuffer() const {return m_buffer;} + bool FillBuffer(unsigned int length); + unsigned long PeekBits(unsigned int length); + void SkipBits(unsigned int length); + unsigned long GetBits(unsigned int length); + +private: + BufferedTransformation &m_store; + unsigned long m_buffer; + unsigned int m_bitsBuffered; +}; + +struct CodeLessThan; + +//! Huffman Decoder +class HuffmanDecoder +{ +public: + typedef unsigned int code_t; + typedef unsigned int value_t; + enum {MAX_CODE_BITS = sizeof(code_t)*8}; + + class Err : public Exception {public: Err(const std::string &what) : Exception(INVALID_DATA_FORMAT, "HuffmanDecoder: " + what) {}}; + + HuffmanDecoder() : m_maxCodeBits(0), m_cacheBits(0), m_cacheMask(0), m_normalizedCacheMask(0) {} + HuffmanDecoder(const unsigned int *codeBitLengths, unsigned int nCodes) + : m_maxCodeBits(0), m_cacheBits(0), m_cacheMask(0), m_normalizedCacheMask(0) + {Initialize(codeBitLengths, nCodes);} + + void Initialize(const unsigned int *codeBitLengths, unsigned int nCodes); + unsigned int Decode(code_t code, /* out */ value_t &value) const; + bool Decode(LowFirstBitReader &reader, value_t &value) const; + +private: + friend struct CodeLessThan; + + struct CodeInfo + { + CodeInfo(code_t code=0, unsigned int len=0, value_t value=0) : code(code), len(len), value(value) {} + inline bool operator<(const CodeInfo &rhs) const {return code < rhs.code;} + code_t code; + unsigned int len; + value_t value; + }; + + struct LookupEntry + { + unsigned int type; + union + { + value_t value; + const CodeInfo *begin; + }; + union + { + unsigned int len; + const CodeInfo *end; + }; + }; + + static code_t NormalizeCode(code_t code, unsigned int codeBits); + void FillCacheEntry(LookupEntry &entry, code_t normalizedCode) const; + + unsigned int m_maxCodeBits, m_cacheBits, m_cacheMask, m_normalizedCacheMask; + std::vector > m_codeToValue; + mutable std::vector > m_cache; +}; + +//! DEFLATE (RFC 1951) decompressor + +class Inflator : public AutoSignaling +{ +public: + class Err : public Exception + { + public: + Err(ErrorType e, const std::string &s) + : Exception(e, s) {} + }; + class UnexpectedEndErr : public Err {public: UnexpectedEndErr() : Err(INVALID_DATA_FORMAT, "Inflator: unexpected end of compressed block") {}}; + class BadBlockErr : public Err {public: BadBlockErr() : Err(INVALID_DATA_FORMAT, "Inflator: error in compressed block") {}}; + + //! \brief RFC 1951 Decompressor + //! \param attachment the filter's attached transformation + //! \param repeat decompress multiple compressed streams in series + //! \param autoSignalPropagation 0 to turn off MessageEnd signal + Inflator(BufferedTransformation *attachment = NULL, bool repeat = false, int autoSignalPropagation = -1); + + void IsolatedInitialize(const NameValuePairs ¶meters); + size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); + bool IsolatedFlush(bool hardFlush, bool blocking); + + virtual unsigned int GetLog2WindowSize() const {return 15;} + +protected: + ByteQueue m_inQueue; + +private: + virtual unsigned int MaxPrestreamHeaderSize() const {return 0;} + virtual void ProcessPrestreamHeader() {} + virtual void ProcessDecompressedData(const byte *string, size_t length) + {AttachedTransformation()->Put(string, length);} + virtual unsigned int MaxPoststreamTailSize() const {return 0;} + virtual void ProcessPoststreamTail() {} + + void ProcessInput(bool flush); + void DecodeHeader(); + bool DecodeBody(); + void FlushOutput(); + void OutputByte(byte b); + void OutputString(const byte *string, size_t length); + void OutputPast(unsigned int length, unsigned int distance); + + static const HuffmanDecoder *FixedLiteralDecoder(); + static const HuffmanDecoder *FixedDistanceDecoder(); + + const HuffmanDecoder& GetLiteralDecoder() const; + const HuffmanDecoder& GetDistanceDecoder() const; + + enum State {PRE_STREAM, WAIT_HEADER, DECODING_BODY, POST_STREAM, AFTER_END}; + State m_state; + bool m_repeat, m_eof, m_wrappedAround; + byte m_blockType; + word16 m_storedLen; + enum NextDecode {LITERAL, LENGTH_BITS, DISTANCE, DISTANCE_BITS}; + NextDecode m_nextDecode; + unsigned int m_literal, m_distance; // for LENGTH_BITS or DISTANCE_BITS + HuffmanDecoder m_dynamicLiteralDecoder, m_dynamicDistanceDecoder; + LowFirstBitReader m_reader; + SecByteBlock m_window; + size_t m_current, m_lastFlush; +}; + +NAMESPACE_END + +#endif diff --git a/external/crypto++-5.6.3/zlib.cpp b/external/crypto++-5.6.3/zlib.cpp new file mode 100644 index 000000000..e30c05174 --- /dev/null +++ b/external/crypto++-5.6.3/zlib.cpp @@ -0,0 +1,93 @@ +// zlib.cpp - written and placed in the public domain by Wei Dai + +// "zlib" is the name of a well known C language compression library +// (http://www.zlib.org) and also the name of a compression format +// (RFC 1950) that the library implements. This file is part of a +// complete reimplementation of the zlib compression format. + +#include "pch.h" +#include "zlib.h" +#include "zdeflate.h" +#include "zinflate.h" +#include "secblock.h" + +NAMESPACE_BEGIN(CryptoPP) + +static const byte DEFLATE_METHOD = 8; +static const byte FDICT_FLAG = (1 << 5); + +// ************************************************************* + +void ZlibCompressor::WritePrestreamHeader() +{ + m_adler32.Restart(); + assert(((GetLog2WindowSize()-8) << 4) <= 255); + byte cmf = byte(DEFLATE_METHOD | ((GetLog2WindowSize()-8) << 4)); + assert((GetCompressionLevel() << 6) <= 255); + byte flags = byte(GetCompressionLevel() << 6); + AttachedTransformation()->PutWord16(RoundUpToMultipleOf(word16(cmf*256+flags), word16(31))); +} + +void ZlibCompressor::ProcessUncompressedData(const byte *inString, size_t length) +{ + m_adler32.Update(inString, length); +} + +void ZlibCompressor::WritePoststreamTail() +{ + FixedSizeSecBlock adler32; + m_adler32.Final(adler32); + AttachedTransformation()->Put(adler32, 4); +} + +unsigned int ZlibCompressor::GetCompressionLevel() const +{ + static const unsigned int deflateToCompressionLevel[] = {0, 1, 1, 1, 2, 2, 2, 2, 2, 3}; + return deflateToCompressionLevel[GetDeflateLevel()]; +} + +// ************************************************************* + +ZlibDecompressor::ZlibDecompressor(BufferedTransformation *attachment, bool repeat, int propagation) + : Inflator(attachment, repeat, propagation), m_log2WindowSize(0) +{ +} + +void ZlibDecompressor::ProcessPrestreamHeader() +{ + m_adler32.Restart(); + + byte cmf; + byte flags; + + if (!m_inQueue.Get(cmf) || !m_inQueue.Get(flags)) + throw HeaderErr(); + + if ((cmf*256+flags) % 31 != 0) + throw HeaderErr(); // if you hit this exception, you're probably trying to decompress invalid data + + if ((cmf & 0xf) != DEFLATE_METHOD) + throw UnsupportedAlgorithm(); + + if (flags & FDICT_FLAG) + throw UnsupportedPresetDictionary(); + + m_log2WindowSize = 8 + (cmf >> 4); +} + +void ZlibDecompressor::ProcessDecompressedData(const byte *inString, size_t length) +{ + AttachedTransformation()->Put(inString, length); + m_adler32.Update(inString, length); +} + +void ZlibDecompressor::ProcessPoststreamTail() +{ + FixedSizeSecBlock adler32; + if (m_inQueue.Get(adler32, 4) != 4) + throw Adler32Err(); + if (!m_adler32.Verify(adler32)) + throw Adler32Err(); +} + +NAMESPACE_END diff --git a/external/crypto++-5.6.3/zlib.h b/external/crypto++-5.6.3/zlib.h new file mode 100644 index 000000000..ef7cbcd95 --- /dev/null +++ b/external/crypto++-5.6.3/zlib.h @@ -0,0 +1,60 @@ +#ifndef CRYPTOPP_ZLIB_H +#define CRYPTOPP_ZLIB_H + +#include "cryptlib.h" +#include "adler32.h" +#include "zdeflate.h" +#include "zinflate.h" + +NAMESPACE_BEGIN(CryptoPP) + +/// ZLIB Compressor (RFC 1950) +class ZlibCompressor : public Deflator +{ +public: + ZlibCompressor(BufferedTransformation *attachment=NULL, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true) + : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible) {} + ZlibCompressor(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL) + : Deflator(parameters, attachment) {} + + unsigned int GetCompressionLevel() const; + +protected: + void WritePrestreamHeader(); + void ProcessUncompressedData(const byte *string, size_t length); + void WritePoststreamTail(); + + Adler32 m_adler32; +}; + +/// ZLIB Decompressor (RFC 1950) +class ZlibDecompressor : public Inflator +{ +public: + typedef Inflator::Err Err; + class HeaderErr : public Err {public: HeaderErr() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: header decoding error") {}}; + class Adler32Err : public Err {public: Adler32Err() : Err(DATA_INTEGRITY_CHECK_FAILED, "ZlibDecompressor: ADLER32 check error") {}}; + class UnsupportedAlgorithm : public Err {public: UnsupportedAlgorithm() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: unsupported algorithm") {}}; + class UnsupportedPresetDictionary : public Err {public: UnsupportedPresetDictionary() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: unsupported preset dictionary") {}}; + + //! \brief Construct a ZlibDecompressor + //! \param attachment a \ BufferedTransformation to attach to this object + //! \param repeat decompress multiple compressed streams in series + //! \param autoSignalPropagation 0 to turn off MessageEnd signal + ZlibDecompressor(BufferedTransformation *attachment = NULL, bool repeat = false, int autoSignalPropagation = -1); + unsigned int GetLog2WindowSize() const {return m_log2WindowSize;} + +private: + unsigned int MaxPrestreamHeaderSize() const {return 2;} + void ProcessPrestreamHeader(); + void ProcessDecompressedData(const byte *string, size_t length); + unsigned int MaxPoststreamTailSize() const {return 4;} + void ProcessPoststreamTail(); + + unsigned int m_log2WindowSize; + Adler32 m_adler32; +}; + +NAMESPACE_END + +#endif diff --git a/public/bitvec.h b/public/bitvec.h index be13e3f58..51ac08161 100644 --- a/public/bitvec.h +++ b/public/bitvec.h @@ -1,4 +1,4 @@ -//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// +//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -46,7 +46,7 @@ inline int FirstBitInWord( unsigned int elem, int offset ) #if _WIN32 if ( !elem ) return -1; -#if _X360 +#if defined( _X360 ) // this implements CountTrailingZeros() / BitScanForward() unsigned int mask = elem-1; unsigned int comp = ~elem; @@ -276,7 +276,7 @@ class CBitVecT : public BASE_OPS // class CVarBitVecBase // // Defines the operations necessary for a variable sized bit array - +template class CVarBitVecBase { public: @@ -296,18 +296,18 @@ class CVarBitVecBase protected: CVarBitVecBase(); CVarBitVecBase(int numBits); - CVarBitVecBase( const CVarBitVecBase &from ); - CVarBitVecBase &operator=( const CVarBitVecBase &from ); + CVarBitVecBase( const CVarBitVecBase &from ); + CVarBitVecBase &operator=( const CVarBitVecBase &from ); ~CVarBitVecBase(void); - void ValidateOperand( const CVarBitVecBase &operand ) const { Assert(GetNumBits() == operand.GetNumBits()); } + void ValidateOperand( const CVarBitVecBase &operand ) const { Assert(GetNumBits() == operand.GetNumBits()); } unsigned GetEndMask() const { return ::GetEndMask( GetNumBits() ); } private: - unsigned short m_numBits; // Number of bits in the bitstring - unsigned short m_numInts; // Number of ints to needed to store bitstring + BITCOUNTTYPE m_numBits; // Number of bits in the bitstring + BITCOUNTTYPE m_numInts; // Number of ints to needed to store bitstring uint32 m_iBitStringStorage; // If the bit string fits in one int, it goes here uint32 * m_pInt; // Array of ints containing the bitstring @@ -396,7 +396,7 @@ class CFixedBitVecBase // // inheritance instead of typedef to allow forward declarations -class CVarBitVec : public CBitVecT +class CVarBitVec : public CBitVecT< CVarBitVecBase > { public: CVarBitVec() @@ -404,7 +404,20 @@ class CVarBitVec : public CBitVecT } CVarBitVec(int numBits) - : CBitVecT(numBits) + : CBitVecT< CVarBitVecBase >(numBits) + { + } +}; + +class CLargeVarBitVec : public CBitVecT< CVarBitVecBase > +{ +public: + CLargeVarBitVec() + { + } + + CLargeVarBitVec(int numBits) + : CBitVecT< CVarBitVecBase >(numBits) { } }; @@ -432,14 +445,16 @@ typedef CBitVec<32> CDWordBitVec; //----------------------------------------------------------------------------- -inline CVarBitVecBase::CVarBitVecBase() +template +inline CVarBitVecBase::CVarBitVecBase() { memset( this, 0, sizeof( *this ) ); } //----------------------------------------------------------------------------- -inline CVarBitVecBase::CVarBitVecBase(int numBits) +template +inline CVarBitVecBase::CVarBitVecBase(int numBits) { Assert( numBits ); m_numBits = numBits; @@ -452,7 +467,8 @@ inline CVarBitVecBase::CVarBitVecBase(int numBits) //----------------------------------------------------------------------------- -inline CVarBitVecBase::CVarBitVecBase( const CVarBitVecBase &from ) +template +inline CVarBitVecBase::CVarBitVecBase( const CVarBitVecBase &from ) { if ( from.m_numInts ) { @@ -468,7 +484,8 @@ inline CVarBitVecBase::CVarBitVecBase( const CVarBitVecBase &from ) //----------------------------------------------------------------------------- -inline CVarBitVecBase &CVarBitVecBase::operator=( const CVarBitVecBase &from ) +template +inline CVarBitVecBase &CVarBitVecBase::operator=( const CVarBitVecBase &from ) { Resize( from.GetNumBits() ); if ( m_pInt ) @@ -482,14 +499,16 @@ inline CVarBitVecBase &CVarBitVecBase::operator=( const CVarBitVecBase &from ) // Output : //----------------------------------------------------------------------------- -inline CVarBitVecBase::~CVarBitVecBase(void) +template +inline CVarBitVecBase::~CVarBitVecBase(void) { FreeInts(); } //----------------------------------------------------------------------------- -inline void CVarBitVecBase::Attach( uint32 *pBits, int numBits ) +template +inline void CVarBitVecBase::Attach( uint32 *pBits, int numBits ) { FreeInts(); m_numBits = numBits; @@ -508,7 +527,8 @@ inline void CVarBitVecBase::Attach( uint32 *pBits, int numBits ) //----------------------------------------------------------------------------- -inline bool CVarBitVecBase::Detach( uint32 **ppBits, int *pNumBits ) +template +inline bool CVarBitVecBase::Detach( uint32 **ppBits, int *pNumBits ) { if ( !m_numBits ) { @@ -683,8 +703,8 @@ inline uint32 CBitVecT::Get( uint32 offset, uint32 mask ) template inline void CBitVecT::And(const CBitVecT &addStr, CBitVecT *out) const { - ValidateOperand( addStr ); - ValidateOperand( *out ); + this->ValidateOperand( addStr ); + this->ValidateOperand( *out ); uint32 * pDest = out->Base(); const uint32 *pOperand1 = this->Base(); @@ -704,8 +724,8 @@ inline void CBitVecT::And(const CBitVecT &addStr, CBitVecT *out) const template inline void CBitVecT::Or(const CBitVecT &orStr, CBitVecT *out) const { - ValidateOperand( orStr ); - ValidateOperand( *out ); + this->ValidateOperand( orStr ); + this->ValidateOperand( *out ); uint32 * pDest = out->Base(); const uint32 *pOperand1 = this->Base(); @@ -743,7 +763,7 @@ inline void CBitVecT::Xor(const CBitVecT &xorStr, CBitVecT *out) const template inline void CBitVecT::Not(CBitVecT *out) const { - ValidateOperand( *out ); + this->ValidateOperand( *out ); uint32 * pDest = out->Base(); const uint32 *pOperand = this->Base(); @@ -764,7 +784,7 @@ inline void CBitVecT::CopyTo(CBitVecT *out) const { out->Resize( this->GetNumBits() ); - ValidateOperand( *out ); + this->ValidateOperand( *out ); Assert( out != this ); memcpy( out->Base(), this->Base(), this->GetNumDWords() * sizeof( int ) ); @@ -851,7 +871,7 @@ inline void CBitVecT::Copy( const CBitVecT &other, int nBits this->Resize( nBits ); - ValidateOperand( other ); + this->ValidateOperand( other ); Assert( &other != this ); memcpy( this->Base(), other.Base(), this->GetNumDWords() * sizeof( uint32 ) ); @@ -943,7 +963,8 @@ inline unsigned GetStartBitMask( int startBit ) return g_StartMask[ startBit & 31 ]; } -inline int CVarBitVecBase::FindNextSetBit( int startBit ) const +template +inline int CVarBitVecBase::FindNextSetBit( int startBit ) const { if ( startBit < GetNumBits() ) { @@ -1044,14 +1065,18 @@ inline int CFixedBitVecBase::FindNextSetBit( int startBit ) const const uint32 * RESTRICT pCurElem = Base() + wordIndex; unsigned int elem = *pCurElem; elem &= startMask; - do + while ( wordIndex < NUM_INTS ) { if ( elem ) + { return FirstBitInWord(elem, wordIndex << 5); - ++pCurElem; - elem = *pCurElem; - ++wordIndex; - } while( wordIndex <= NUM_INTS-1); + } + else if ( ++wordIndex < NUM_INTS ) + { + ++pCurElem; + elem = *pCurElem; + } + } } } @@ -1276,9 +1301,10 @@ inline void CBitVecT< CFixedBitVecBase<32> >::Set( int bitNum, bool bNewVal ) // Purpose: Resizes the bit string to a new number of bits // Input : resizeNumBits - //----------------------------------------------------------------------------- -inline void CVarBitVecBase::Resize( int resizeNumBits, bool bClearAll ) +template +inline void CVarBitVecBase::Resize( int resizeNumBits, bool bClearAll ) { - Assert( resizeNumBits >= 0 && resizeNumBits <= USHRT_MAX ); + Assert( resizeNumBits >= 0 && ((BITCOUNTTYPE)resizeNumBits == resizeNumBits) ); int newIntCount = CalcNumIntsForBits( resizeNumBits ); if ( newIntCount != GetNumDWords() ) @@ -1320,7 +1346,8 @@ inline void CVarBitVecBase::Resize( int resizeNumBits, bool bClearAll ) // Purpose: Allocate the storage for the ints // Input : numInts - //----------------------------------------------------------------------------- -inline void CVarBitVecBase::AllocInts( int numInts ) +template +inline void CVarBitVecBase::AllocInts( int numInts ) { Assert( !m_pInt ); @@ -1341,7 +1368,8 @@ inline void CVarBitVecBase::AllocInts( int numInts ) // Purpose: Reallocate the storage for the ints // Input : numInts - //----------------------------------------------------------------------------- -inline void CVarBitVecBase::ReallocInts( int numInts ) +template +inline void CVarBitVecBase::ReallocInts( int numInts ) { Assert( Base() ); if ( numInts == 0) @@ -1376,7 +1404,8 @@ inline void CVarBitVecBase::ReallocInts( int numInts ) //----------------------------------------------------------------------------- // Purpose: Free storage allocated with AllocInts //----------------------------------------------------------------------------- -inline void CVarBitVecBase::FreeInts( void ) +template +inline void CVarBitVecBase::FreeInts( void ) { if ( m_numInts > 1 ) { diff --git a/public/dt_common.h b/public/dt_common.h index de9a49333..e28e39fb9 100644 --- a/public/dt_common.h +++ b/public/dt_common.h @@ -18,11 +18,6 @@ #include "tier1/strtools.h" #include -#ifdef LINUX -#undef offsetof -#define offsetof(s,m) (size_t)&(((s *)0)->m) -#endif - // Max number of properties in a datatable and its children. #define MAX_DATATABLES 1024 // must be a power of 2. #define MAX_DATATABLE_PROPS 4096 diff --git a/public/steam/isteamapplist.h b/public/steam/isteamapplist.h new file mode 100644 index 000000000..e6726c1ac --- /dev/null +++ b/public/steam/isteamapplist.h @@ -0,0 +1,63 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to app data in Steam +// +//============================================================================= + +#ifndef ISTEAMAPPLIST_H +#define ISTEAMAPPLIST_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" +#include "steamtypes.h" + +//----------------------------------------------------------------------------- +// Purpose: This is a restricted interface that can only be used by previously approved apps, +// contact your Steam Account Manager if you believe you need access to this API. +// This interface lets you detect installed apps for the local Steam client, useful for debugging tools +// to offer lists of apps to debug via Steam. +//----------------------------------------------------------------------------- +class ISteamAppList +{ +public: + virtual uint32 GetNumInstalledApps() = 0; + virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; + + virtual int GetAppName( AppId_t nAppID, char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found + virtual int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax ) = 0; // returns -1 if no dir was found + + virtual int GetAppBuildId( AppId_t nAppID ) = 0; // return the buildid of this app, may change at any time based on backend updates to the game +}; + +#define STEAMAPPLIST_INTERFACE_VERSION "STEAMAPPLIST_INTERFACE_VERSION001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +//--------------------------------------------------------------------------------- +// Purpose: Sent when a new app is installed +//--------------------------------------------------------------------------------- +DEFINE_CALLBACK( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); + CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs +END_DEFINE_CALLBACK_1() + + +//--------------------------------------------------------------------------------- +// Purpose: Sent when an app is uninstalled +//--------------------------------------------------------------------------------- +DEFINE_CALLBACK( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); + CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs +END_DEFINE_CALLBACK_1() + + +#pragma pack( pop ) +#endif // ISTEAMAPPLIST_H diff --git a/public/steam/isteamapps.h b/public/steam/isteamapps.h index 4a8a2c156..070058360 100644 --- a/public/steam/isteamapps.h +++ b/public/steam/isteamapps.h @@ -1,39 +1,154 @@ -//====== Copyright © 1996-2007, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to app data in Steam -// -//============================================================================= - -#ifndef ISTEAMAPPS_H -#define ISTEAMAPPS_H -#ifdef _WIN32 -#pragma once -#endif - -#include "steam/isteamapps.h" - -//----------------------------------------------------------------------------- -// Purpose: interface to app data -//----------------------------------------------------------------------------- -class ISteamApps -{ -public: - // returns 0 if the key does not exist - // this may be true on first call, since the app data may not be cached locally yet - // If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again - virtual int GetAppData( uint32 nAppID, const char *pchKey, char *pchValue, int cchValueMax ) = 0; -}; - -#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION001" - -//----------------------------------------------------------------------------- -// Purpose: called when new information about an app has arrived -//----------------------------------------------------------------------------- -struct AppDataChanged_t -{ - enum { k_iCallback = k_iSteamAppsCallbacks + 1 }; - uint32 m_nAppID; - bool m_bWebDataChanged; -}; - -#endif // ISTEAMAPPS_H +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to app data in Steam +// +//============================================================================= + +#ifndef ISTEAMAPPS_H +#define ISTEAMAPPS_H +#ifdef _WIN32 +#pragma once +#endif + +const int k_cubAppProofOfPurchaseKeyMax = 64; // max bytes of a legacy cd key we support + + +//----------------------------------------------------------------------------- +// Purpose: interface to app data +//----------------------------------------------------------------------------- +class ISteamApps +{ +public: + virtual bool BIsSubscribed() = 0; + virtual bool BIsLowViolence() = 0; + virtual bool BIsCybercafe() = 0; + virtual bool BIsVACBanned() = 0; + virtual const char *GetCurrentGameLanguage() = 0; + virtual const char *GetAvailableGameLanguages() = 0; + + // only use this member if you need to check ownership of another game related to yours, a demo for example + virtual bool BIsSubscribedApp( AppId_t appID ) = 0; + + // Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed + virtual bool BIsDlcInstalled( AppId_t appID ) = 0; + + // returns the Unix time of the purchase of the app + virtual uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID ) = 0; + + // Checks if the user is subscribed to the current app through a free weekend + // This function will return false for users who have a retail or other type of license + // Before using, please ask your Valve technical contact how to package and secure your free weekened + virtual bool BIsSubscribedFromFreeWeekend() = 0; + + // Returns the number of DLC pieces for the running app + virtual int GetDLCCount() = 0; + + // Returns metadata for DLC by index, of range [0, GetDLCCount()] + virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0; + + // Install/Uninstall control for optional DLC + virtual void InstallDLC( AppId_t nAppID ) = 0; + virtual void UninstallDLC( AppId_t nAppID ) = 0; + + // Request cd-key for yourself or owned DLC. If you are interested in this + // data then make sure you provide us with a list of valid keys to be distributed + // to users when they purchase the game, before the game ships. + // You'll receive an AppProofOfPurchaseKeyResponse_t callback when + // the key is available (which may be immediately). + virtual void RequestAppProofOfPurchaseKey( AppId_t nAppID ) = 0; + + virtual bool GetCurrentBetaName( char *pchName, int cchNameBufferSize ) = 0; // returns current beta branch name, 'public' is the default branch + virtual bool MarkContentCorrupt( bool bMissingFilesOnly ) = 0; // signal Steam that game files seems corrupt or missing + virtual uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ) = 0; // return installed depots in mount order + + // returns current app install folder for AppID, returns folder name length + virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0; + virtual bool BIsAppInstalled( AppId_t appID ) = 0; // returns true if that app is installed (not necessarily owned) + + virtual CSteamID GetAppOwner() = 0; // returns the SteamID of the original owner. If different from current user, it's borrowed + + // Returns the associated launch param if the game is run via steam://run///?param1=value1;param2=value2;param3=value3 etc. + // Parameter names starting with the character '@' are reserved for internal use and will always return and empty string. + // Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, + // but it is advised that you not param names beginning with an underscore for your own features. + virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; + + // get download progress for optional DLC + virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // return the buildid of this app, may change at any time based on backend updates to the game + virtual int GetAppBuildId() = 0; +#ifdef _PS3 + // Result returned in a RegisterActivationCodeResponse_t callresult + virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0; +#endif +}; + +#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION007" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif +//----------------------------------------------------------------------------- +// Purpose: posted after the user gains ownership of DLC & that DLC is installed +//----------------------------------------------------------------------------- +struct DlcInstalled_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 5 }; + AppId_t m_nAppID; // AppID of the DLC +}; + + +//----------------------------------------------------------------------------- +// Purpose: possible results when registering an activation code +//----------------------------------------------------------------------------- +enum ERegisterActivationCodeResult +{ + k_ERegisterActivationCodeResultOK = 0, + k_ERegisterActivationCodeResultFail = 1, + k_ERegisterActivationCodeResultAlreadyRegistered = 2, + k_ERegisterActivationCodeResultTimeout = 3, + k_ERegisterActivationCodeAlreadyOwned = 4, +}; + + +//----------------------------------------------------------------------------- +// Purpose: response to RegisterActivationCode() +//----------------------------------------------------------------------------- +struct RegisterActivationCodeResponse_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 8 }; + ERegisterActivationCodeResult m_eResult; + uint32 m_unPackageRegistered; // package that was registered. Only set on success +}; + +//----------------------------------------------------------------------------- +// Purpose: response to RegisterActivationCode() +//----------------------------------------------------------------------------- +struct AppProofOfPurchaseKeyResponse_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 13 }; + EResult m_eResult; + uint32 m_nAppID; + char m_rgchKey[ k_cubAppProofOfPurchaseKeyMax ]; +}; + +//--------------------------------------------------------------------------------- +// Purpose: posted after the user gains executes a steam url with query parameters +// such as steam://run///?param1=value1;param2=value2;param3=value3; etc +// while the game is already running. The new params can be queried +// with GetLaunchQueryParam. +//--------------------------------------------------------------------------------- +struct NewLaunchQueryParameters_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 14 }; +}; + + +#pragma pack( pop ) +#endif // ISTEAMAPPS_H diff --git a/public/steam/isteamappticket.h b/public/steam/isteamappticket.h new file mode 100644 index 000000000..2e39eb0b4 --- /dev/null +++ b/public/steam/isteamappticket.h @@ -0,0 +1,28 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: a private, but well versioned, interface to get at critical bits +// of a steam3 appticket - consumed by the simple drm wrapper to let it +// ask about ownership with greater confidence. +// +//============================================================================= + +#ifndef ISTEAMAPPTICKET_H +#define ISTEAMAPPTICKET_H +#pragma once + +//----------------------------------------------------------------------------- +// Purpose: hand out a reasonable "future proof" view of an app ownership ticket +// the raw (signed) buffer, and indices into that buffer where the appid and +// steamid are located. the sizes of the appid and steamid are implicit in +// (each version of) the interface - currently uin32 appid and uint64 steamid +//----------------------------------------------------------------------------- +class ISteamAppTicket +{ +public: + virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0; +}; + +#define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001" + + +#endif // ISTEAMAPPTICKET_H diff --git a/public/steam/isteamclient.h b/public/steam/isteamclient.h index 6c98bcc81..796d72d69 100644 --- a/public/steam/isteamclient.h +++ b/public/steam/isteamclient.h @@ -1,137 +1,503 @@ -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: -// -//============================================================================= - -#ifndef ISTEAMCLIENT_H -#define ISTEAMCLIENT_H -#ifdef _WIN32 -#pragma once -#endif - -#include "steamtypes.h" -#include "steamclientpublic.h" - -// handle to a communication pipe to the Steam client -typedef int32 HSteamPipe; -// handle to single instance of a steam user -typedef int32 HSteamUser; - -#ifndef DLL_EXPORT -#define DLL_EXPORT -#endif - -// interface predec -class ISteamUser; -class ISteamGameServer; -class ISteamFriends; -class ISteamUtils; -class ISteamMatchmaking; -class ISteamContentServer; -class ISteamMasterServerUpdater; -class ISteamMatchmakingServers; -class ISteam2Bridge; -class ISteamUserStats; -class ISteamApps; - -//----------------------------------------------------------------------------- -// Purpose: Interface to creating a new steam instance, or to -// connect to an existing steam instance, whether it's in a -// different process or is local -//----------------------------------------------------------------------------- -class ISteamClient -{ -public: - // Creates a communication pipe to the Steam client - virtual HSteamPipe CreateSteamPipe() = 0; - - // Releases a previously created communications pipe - virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0; - - // connects to an existing global user, failing if none exists - // used by the game to coordinate with the steamUI - virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0; - - // used by game servers, create a steam user that won't be shared with anyone else - virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe ) = 0; - - // removes an allocated user - virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0; - - // retrieves the ISteamUser interface associated with the handle - virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // retrieves the ISteamGameServer interface associated with the handle - virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // set the local IP and Port to bind to - // this must be set before CreateLocalUser() - virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0; - - // returns the ISteamFriends interface - virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns the ISteamUtils interface - virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns the ISteamMatchmaking interface - virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns the ISteamContentServer interface - virtual ISteamContentServer *GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns the ISteamMasterServerUpdater interface - virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns the ISteamMatchmakingServers interface - virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns the ISteam2Bridge interface - virtual ISteam2Bridge *GetISteam2Bridge( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - virtual void RunFrame() = 0; - - // returns the number of IPC calls made since the last time this function was called - // Used for perf debugging so you can understand how many IPC calls your game makes per frame - // Every IPC call is at minimum a thread context switch if not a process one so you want to rate - // control how often you do them. - virtual uint32 GetIPCCallCount() = 0; - - // returns the ISteamUserStats interface - virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - - // returns apps interface - virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; -}; - -#define STEAMCLIENT_INTERFACE_VERSION "SteamClient007" - -//----------------------------------------------------------------------------- -// Purpose: Base values for callback identifiers, each callback must -// have a unique ID. -//----------------------------------------------------------------------------- -enum { k_iSteamUserCallbacks = 100 }; -enum { k_iSteamGameServerCallbacks = 200 }; -enum { k_iSteamFriendsCallbacks = 300 }; -enum { k_iSteamBillingCallbacks = 400 }; -enum { k_iSteamMatchmakingCallbacks = 500 }; -enum { k_iSteamContentServerCallbacks = 600 }; -enum { k_iSteamUtilsCallbacks = 700 }; -enum { k_iClientFriendsCallbacks = 800 }; -enum { k_iClientUserCallbacks = 900 }; -enum { k_iSteamAppsCallbacks = 1000 }; -enum { k_iSteamUserStatsCallbacks = 1100 }; - -// For GoldSRC we need a C API as the C++ ABI changed from the GoldSRC compiler -// (GCC 2.95.3) to the Source/Steam3 one (GCC 3.4.1) -// C functions we export for the C API, maps to ISteamClient functions -DLL_EXPORT HSteamPipe Steam_CreateSteamPipe(); -DLL_EXPORT bool Steam_BReleaseSteamPipe( HSteamPipe hSteamPipe ); -DLL_EXPORT HSteamUser Steam_CreateLocalUser( HSteamPipe *phSteamPipe ); -DLL_EXPORT HSteamUser Steam_ConnectToGlobalUser( HSteamPipe hSteamPipe ); -DLL_EXPORT void Steam_ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ); -DLL_EXPORT void Steam_SetLocalIPBinding( uint32 unIP, uint16 usLocalPort ); - - -#endif // ISTEAMCLIENT_H +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: Main interface for loading and accessing Steamworks API's from the +// Steam client. +// For most uses, this code is wrapped inside of SteamAPI_Init() +//============================================================================= + +#ifndef ISTEAMCLIENT_H +#define ISTEAMCLIENT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" + +// Define compile time assert macros to let us validate the structure sizes. +#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; + +#ifndef REFERENCE +#define REFERENCE(arg) ((void)arg) +#endif + +#if defined(__linux__) || defined(__APPLE__) +// The 32-bit version of gcc has the alignment requirement for uint64 and double set to +// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. +// The 64-bit version of gcc has the alignment requirement for these types set to +// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. +// The 64-bit structure packing has to match the 32-bit structure packing for each platform. +#define VALVE_CALLBACK_PACK_SMALL +#else +#define VALVE_CALLBACK_PACK_LARGE +#endif + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error ??? +#endif + +typedef struct ValvePackingSentinel_t +{ + uint32 m_u32; + uint64 m_u64; + uint16 m_u16; + double m_d; +} ValvePackingSentinel_t; + +#pragma pack( pop ) + + +#if defined(VALVE_CALLBACK_PACK_SMALL) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) +#elif defined(VALVE_CALLBACK_PACK_LARGE) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) +#else +#error ??? +#endif + + +// handle to a communication pipe to the Steam client +typedef int32 HSteamPipe; +// handle to single instance of a steam user +typedef int32 HSteamUser; +// function prototype +#if defined( POSIX ) +#define __cdecl +#endif +extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *); +extern "C" typedef void( *SteamAPI_PostAPIResultInProcess_t )(SteamAPICall_t callHandle, void *, uint32 unCallbackSize, int iCallbackNum); +extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum ); +#if defined( __SNC__ ) + #pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor +#endif + +// interface predec +class ISteamUser; +class ISteamGameServer; +class ISteamFriends; +class ISteamUtils; +class ISteamMatchmaking; +class ISteamContentServer; +class ISteamMatchmakingServers; +class ISteamUserStats; +class ISteamApps; +class ISteamNetworking; +class ISteamRemoteStorage; +class ISteamScreenshots; +class ISteamMusic; +class ISteamMusicRemote; +class ISteamGameServerStats; +class ISteamPS3OverlayRender; +class ISteamHTTP; +class ISteamUnifiedMessages; +class ISteamController; +class ISteamUGC; +class ISteamAppList; +class ISteamHTMLSurface; +class ISteamInventory; +class ISteamVideo; + +//----------------------------------------------------------------------------- +// Purpose: Interface to creating a new steam instance, or to +// connect to an existing steam instance, whether it's in a +// different process or is local. +// +// For most scenarios this is all handled automatically via SteamAPI_Init(). +// You'll only need to use these interfaces if you have a more complex versioning scheme, +// where you want to get different versions of the same interface in different dll's in your project. +//----------------------------------------------------------------------------- +class ISteamClient +{ +public: + // Creates a communication pipe to the Steam client + virtual HSteamPipe CreateSteamPipe() = 0; + + // Releases a previously created communications pipe + virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0; + + // connects to an existing global user, failing if none exists + // used by the game to coordinate with the steamUI + virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0; + + // used by game servers, create a steam user that won't be shared with anyone else + virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0; + + // removes an allocated user + virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0; + + // retrieves the ISteamUser interface associated with the handle + virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // retrieves the ISteamGameServer interface associated with the handle + virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // set the local IP and Port to bind to + // this must be set before CreateLocalUser() + virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0; + + // returns the ISteamFriends interface + virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamUtils interface + virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamMatchmaking interface + virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamMatchmakingServers interface + virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the a generic interface + virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamUserStats interface + virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamGameServerStats interface + virtual ISteamGameServerStats *GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns apps interface + virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // networking + virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // remote storage + virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // user screenshots + virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // this needs to be called every frame to process matchmaking results + // redundant if you're already calling SteamAPI_RunCallbacks() + virtual void RunFrame() = 0; + + // returns the number of IPC calls made since the last time this function was called + // Used for perf debugging so you can understand how many IPC calls your game makes per frame + // Every IPC call is at minimum a thread context switch if not a process one so you want to rate + // control how often you do them. + virtual uint32 GetIPCCallCount() = 0; + + // API warning handling + // 'int' is the severity; 0 for msg, 1 for warning + // 'const char *' is the text of the message + // callbacks will occur directly after the API function is called that generated the warning or message + virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0; + + // Trigger global shutdown for the DLL + virtual bool BShutdownIfAllPipesClosed() = 0; + +#ifdef _PS3 + virtual ISteamPS3OverlayRender *GetISteamPS3OverlayRender() = 0; +#endif + + // Expose HTTP interface + virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the ISteamUnifiedMessages interface + virtual ISteamUnifiedMessages *GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the ISteamController interface + virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the ISteamUGC interface + virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns app list interface, only available on specially registered apps + virtual ISteamAppList *GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Music Player + virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Music Player Remote + virtual ISteamMusicRemote *GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0; + + // html page display + virtual ISteamHTMLSurface *GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0; + + // Helper functions for internal Steam usage + virtual void Set_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func ) = 0; + virtual void Remove_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func ) = 0; + virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func ) = 0; + + // inventory + virtual ISteamInventory *GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Video + virtual ISteamVideo *GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; +}; + + +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient017" + +//----------------------------------------------------------------------------- +// Purpose: Base values for callback identifiers, each callback must +// have a unique ID. +//----------------------------------------------------------------------------- +enum { k_iSteamUserCallbacks = 100 }; +enum { k_iSteamGameServerCallbacks = 200 }; +enum { k_iSteamFriendsCallbacks = 300 }; +enum { k_iSteamBillingCallbacks = 400 }; +enum { k_iSteamMatchmakingCallbacks = 500 }; +enum { k_iSteamContentServerCallbacks = 600 }; +enum { k_iSteamUtilsCallbacks = 700 }; +enum { k_iClientFriendsCallbacks = 800 }; +enum { k_iClientUserCallbacks = 900 }; +enum { k_iSteamAppsCallbacks = 1000 }; +enum { k_iSteamUserStatsCallbacks = 1100 }; +enum { k_iSteamNetworkingCallbacks = 1200 }; +enum { k_iClientRemoteStorageCallbacks = 1300 }; +enum { k_iClientDepotBuilderCallbacks = 1400 }; +enum { k_iSteamGameServerItemsCallbacks = 1500 }; +enum { k_iClientUtilsCallbacks = 1600 }; +enum { k_iSteamGameCoordinatorCallbacks = 1700 }; +enum { k_iSteamGameServerStatsCallbacks = 1800 }; +enum { k_iSteam2AsyncCallbacks = 1900 }; +enum { k_iSteamGameStatsCallbacks = 2000 }; +enum { k_iClientHTTPCallbacks = 2100 }; +enum { k_iClientScreenshotsCallbacks = 2200 }; +enum { k_iSteamScreenshotsCallbacks = 2300 }; +enum { k_iClientAudioCallbacks = 2400 }; +enum { k_iClientUnifiedMessagesCallbacks = 2500 }; +enum { k_iSteamStreamLauncherCallbacks = 2600 }; +enum { k_iClientControllerCallbacks = 2700 }; +enum { k_iSteamControllerCallbacks = 2800 }; +enum { k_iClientParentalSettingsCallbacks = 2900 }; +enum { k_iClientDeviceAuthCallbacks = 3000 }; +enum { k_iClientNetworkDeviceManagerCallbacks = 3100 }; +enum { k_iClientMusicCallbacks = 3200 }; +enum { k_iClientRemoteClientManagerCallbacks = 3300 }; +enum { k_iClientUGCCallbacks = 3400 }; +enum { k_iSteamStreamClientCallbacks = 3500 }; +enum { k_IClientProductBuilderCallbacks = 3600 }; +enum { k_iClientShortcutsCallbacks = 3700 }; +enum { k_iClientRemoteControlManagerCallbacks = 3800 }; +enum { k_iSteamAppListCallbacks = 3900 }; +enum { k_iSteamMusicCallbacks = 4000 }; +enum { k_iSteamMusicRemoteCallbacks = 4100 }; +enum { k_iClientVRCallbacks = 4200 }; +enum { k_iClientReservedCallbacks = 4300 }; +enum { k_iSteamReservedCallbacks = 4400 }; +enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; +enum { k_iClientVideoCallbacks = 4600 }; +enum { k_iClientInventoryCallbacks = 4700 }; + +//----------------------------------------------------------------------------- +// The CALLBACK macros are for client side callback logging enabled with +// log_callback +// Do not change any of these. +//----------------------------------------------------------------------------- + +struct SteamCallback_t +{ +public: + SteamCallback_t() {} +}; + +#define DEFINE_CALLBACK( callbackname, callbackid ) \ +struct callbackname : SteamCallback_t { \ + enum { k_iCallback = callbackid }; \ + static callbackname *GetNullPointer() { return 0; } \ + static const char *GetCallbackName() { return #callbackname; } \ + static uint32 GetCallbackID() { return callbackname::k_iCallback; } + +#define CALLBACK_MEMBER( varidx, vartype, varname ) \ + public: vartype varname ; \ + static void GetMemberVar_##varidx( unsigned int &varOffset, unsigned int &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ + varOffset = (unsigned int)(size_t)&GetNullPointer()->varname; \ + varSize = sizeof( vartype ); \ + varCount = 1; \ + *pszName = #varname; *pszType = #vartype; } + +#define CALLBACK_ARRAY( varidx, vartype, varname, varcount ) \ + public: vartype varname [ varcount ]; \ + static void GetMemberVar_##varidx( unsigned int &varOffset, unsigned int &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ + varOffset = (unsigned int)(size_t)&GetNullPointer()->varname[0]; \ + varSize = sizeof( vartype ); \ + varCount = varcount; \ + *pszName = #varname; *pszType = #vartype; } + + +#define END_CALLBACK_INTERNAL_BEGIN( numvars ) \ + static uint32 GetNumMemberVariables() { return numvars; } \ + static bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ + switch ( index ) { default : return false; + + +#define END_CALLBACK_INTERNAL_SWITCH( varidx ) case varidx : GetMemberVar_##varidx( varOffset, varSize, varCount, pszName, pszType ); return true; + +#define END_CALLBACK_INTERNAL_END() }; } }; + +#define END_DEFINE_CALLBACK_0() \ + static uint32 GetNumMemberVariables() { return 0; } \ + static bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { REFERENCE( pszType ); REFERENCE( pszName ); REFERENCE( varCount ); REFERENCE( varSize ); REFERENCE( varOffset ); REFERENCE( index ); return false; } \ + }; + + +#define END_DEFINE_CALLBACK_1() \ + END_CALLBACK_INTERNAL_BEGIN( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_2() \ + END_CALLBACK_INTERNAL_BEGIN( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_3() \ + END_CALLBACK_INTERNAL_BEGIN( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_4() \ + END_CALLBACK_INTERNAL_BEGIN( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_5() \ + END_CALLBACK_INTERNAL_BEGIN( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_END() + + +#define END_DEFINE_CALLBACK_6() \ + END_CALLBACK_INTERNAL_BEGIN( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_7() \ + END_CALLBACK_INTERNAL_BEGIN( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_8() \ + END_CALLBACK_INTERNAL_BEGIN( 8 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_9() \ + END_CALLBACK_INTERNAL_BEGIN( 9 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 8 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_10() \ + END_CALLBACK_INTERNAL_BEGIN( 10 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 8 ) \ + END_CALLBACK_INTERNAL_SWITCH( 9 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_11() \ + END_CALLBACK_INTERNAL_BEGIN( 11 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 8 ) \ + END_CALLBACK_INTERNAL_SWITCH( 9 ) \ + END_CALLBACK_INTERNAL_SWITCH( 10 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_12() \ + END_CALLBACK_INTERNAL_BEGIN( 12 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 8 ) \ + END_CALLBACK_INTERNAL_SWITCH( 9 ) \ + END_CALLBACK_INTERNAL_SWITCH( 10 ) \ + END_CALLBACK_INTERNAL_SWITCH( 11 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_13() \ + END_CALLBACK_INTERNAL_BEGIN( 13 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 8 ) \ + END_CALLBACK_INTERNAL_SWITCH( 9 ) \ + END_CALLBACK_INTERNAL_SWITCH( 10 ) \ + END_CALLBACK_INTERNAL_SWITCH( 11 ) \ + END_CALLBACK_INTERNAL_SWITCH( 12 ) \ + END_CALLBACK_INTERNAL_END() + +#define END_DEFINE_CALLBACK_14() \ + END_CALLBACK_INTERNAL_BEGIN( 14 ) \ + END_CALLBACK_INTERNAL_SWITCH( 0 ) \ + END_CALLBACK_INTERNAL_SWITCH( 1 ) \ + END_CALLBACK_INTERNAL_SWITCH( 2 ) \ + END_CALLBACK_INTERNAL_SWITCH( 3 ) \ + END_CALLBACK_INTERNAL_SWITCH( 4 ) \ + END_CALLBACK_INTERNAL_SWITCH( 5 ) \ + END_CALLBACK_INTERNAL_SWITCH( 6 ) \ + END_CALLBACK_INTERNAL_SWITCH( 7 ) \ + END_CALLBACK_INTERNAL_SWITCH( 8 ) \ + END_CALLBACK_INTERNAL_SWITCH( 9 ) \ + END_CALLBACK_INTERNAL_SWITCH( 10 ) \ + END_CALLBACK_INTERNAL_SWITCH( 11 ) \ + END_CALLBACK_INTERNAL_SWITCH( 12 ) \ + END_CALLBACK_INTERNAL_SWITCH( 13 ) \ + END_CALLBACK_INTERNAL_END() + +#endif // ISTEAMCLIENT_H diff --git a/public/steam/isteamcontroller.h b/public/steam/isteamcontroller.h new file mode 100644 index 000000000..a973696c1 --- /dev/null +++ b/public/steam/isteamcontroller.h @@ -0,0 +1,210 @@ +//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to valve controller +// +//============================================================================= + +#ifndef ISTEAMCONTROLLER_H +#define ISTEAMCONTROLLER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +#define STEAM_CONTROLLER_MAX_COUNT 16 + +#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 16 + +#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 32 + +#define STEAM_CONTROLLER_MAX_ORIGINS 8 + +// When sending an option to a specific controller handle, you can send to all controllers via this command +#define STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS UINT64_MAX + +#define STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA -1.0f +#define STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA 1.0f + +enum ESteamControllerPad +{ + k_ESteamControllerPad_Left, + k_ESteamControllerPad_Right +}; + +enum EControllerSource +{ + k_EControllerSource_None, + k_EControllerSource_LeftTrackpad, + k_EControllerSource_RightTrackpad, + k_EControllerSource_Joystick, + k_EControllerSource_ABXY, + k_EControllerSource_Switch, + k_EControllerSource_LeftTrigger, + k_EControllerSource_RightTrigger, + k_EControllerSource_Gyro +}; + +enum EControllerSourceMode +{ + k_EControllerSourceMode_None, + k_EControllerSourceMode_Dpad, + k_EControllerSourceMode_Buttons, + k_EControllerSourceMode_FourButtons, + k_EControllerSourceMode_AbsoluteMouse, + k_EControllerSourceMode_RelativeMouse, + k_EControllerSourceMode_JoystickMove, + k_EControllerSourceMode_JoystickCamera, + k_EControllerSourceMode_ScrollWheel, + k_EControllerSourceMode_Trigger, + k_EControllerSourceMode_TouchMenu +}; + +enum EControllerActionOrigin +{ + k_EControllerActionOrigin_None, + k_EControllerActionOrigin_A, + k_EControllerActionOrigin_B, + k_EControllerActionOrigin_X, + k_EControllerActionOrigin_Y, + k_EControllerActionOrigin_LeftBumper, + k_EControllerActionOrigin_RightBumper, + k_EControllerActionOrigin_LeftGrip, + k_EControllerActionOrigin_RightGrip, + k_EControllerActionOrigin_Start, + k_EControllerActionOrigin_Back, + k_EControllerActionOrigin_LeftPad_Touch, + k_EControllerActionOrigin_LeftPad_Swipe, + k_EControllerActionOrigin_LeftPad_Click, + k_EControllerActionOrigin_LeftPad_DPadNorth, + k_EControllerActionOrigin_LeftPad_DPadSouth, + k_EControllerActionOrigin_LeftPad_DPadWest, + k_EControllerActionOrigin_LeftPad_DPadEast, + k_EControllerActionOrigin_RightPad_Touch, + k_EControllerActionOrigin_RightPad_Swipe, + k_EControllerActionOrigin_RightPad_Click, + k_EControllerActionOrigin_RightPad_DPadNorth, + k_EControllerActionOrigin_RightPad_DPadSouth, + k_EControllerActionOrigin_RightPad_DPadWest, + k_EControllerActionOrigin_RightPad_DPadEast, + k_EControllerActionOrigin_LeftTrigger_Pull, + k_EControllerActionOrigin_LeftTrigger_Click, + k_EControllerActionOrigin_RightTrigger_Pull, + k_EControllerActionOrigin_RightTrigger_Click, + k_EControllerActionOrigin_LeftStick_Move, + k_EControllerActionOrigin_LeftStick_Click, + k_EControllerActionOrigin_LeftStick_DPadNorth, + k_EControllerActionOrigin_LeftStick_DPadSouth, + k_EControllerActionOrigin_LeftStick_DPadWest, + k_EControllerActionOrigin_LeftStick_DPadEast, + k_EControllerActionOrigin_Gyro_Move, + k_EControllerActionOrigin_Gyro_Pitch, + k_EControllerActionOrigin_Gyro_Yaw, + k_EControllerActionOrigin_Gyro_Roll, + + k_EControllerActionOrigin_Count +}; + +// ControllerHandle_t is used to refer to a specific controller. +// This handle will consistently identify a controller, even if it is disconnected and re-connected +typedef uint64 ControllerHandle_t; + + +// These handles are used to refer to a specific in-game action or action set +// All action handles should be queried during initialization for performance reasons +typedef uint64 ControllerActionSetHandle_t; +typedef uint64 ControllerDigitalActionHandle_t; +typedef uint64 ControllerAnalogActionHandle_t; + +#pragma pack( push, 1 ) + +struct ControllerAnalogActionData_t +{ + // Type of data coming from this action, this will match what got specified in the action set + EControllerSourceMode eMode; + + // The current state of this action; will be delta updates for mouse actions + float x, y; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct ControllerDigitalActionData_t +{ + // The current state of this action; will be true if currently pressed + bool bState; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Native Steam controller support API +//----------------------------------------------------------------------------- +class ISteamController +{ +public: + + // Init and Shutdown must be called when starting/ending use of this interface + virtual bool Init() = 0; + virtual bool Shutdown() = 0; + + // Pump callback/callresult events + // Note: SteamAPI_RunCallbacks will do this for you, so you should never need to call this directly. + virtual void RunFrame() = 0; + + // Enumerate currently connected controllers + // handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles + // Returns the number of handles written to handlesOut + virtual int GetConnectedControllers( ControllerHandle_t *handlesOut ) = 0; + + // Invokes the Steam overlay and brings up the binding screen + // Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode + virtual bool ShowBindingPanel( ControllerHandle_t controllerHandle ) = 0; + + // ACTION SETS + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. + virtual ControllerActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; + + // Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + // This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + // your state loops, instead of trying to place it in all of your state transitions. + virtual void ActivateActionSet( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) = 0; + virtual ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle ) = 0; + + // ACTIONS + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. + virtual ControllerDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of the supplied digital game action + virtual ControllerDigitalActionData_t GetDigitalActionData( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) = 0; + + // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles + virtual int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin *originsOut ) = 0; + + // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. + virtual ControllerAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of these supplied analog game action + virtual ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) = 0; + + // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles + virtual int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin *originsOut ) = 0; + + + + virtual void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) = 0; + + // Trigger a haptic pulse on a controller + virtual void TriggerHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; +}; + +#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController003" + +#endif // ISTEAMCONTROLLER_H diff --git a/public/steam/isteamfriends.h b/public/steam/isteamfriends.h index d326ef875..7a8504673 100644 --- a/public/steam/isteamfriends.h +++ b/public/steam/isteamfriends.h @@ -1,168 +1,629 @@ - -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to friends data in Steam -// -//============================================================================= - -#ifndef ISTEAMFRIENDS_H -#define ISTEAMFRIENDS_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -//----------------------------------------------------------------------------- -// Purpose: set of relationships to other users -//----------------------------------------------------------------------------- -// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE -enum EFriendRelationship -{ - k_EFriendRelationshipNone = 0, - k_EFriendRelationshipBlocked = 1, - k_EFriendRelationshipRequestRecipient = 2, - k_EFriendRelationshipFriend = 3, - k_EFriendRelationshipRequestInitiator = 4, -}; - - -//----------------------------------------------------------------------------- -// Purpose: list of states a friend can be in -//----------------------------------------------------------------------------- -enum EPersonaState -{ - k_EPersonaStateOffline = 0, // friend is not currently logged on - k_EPersonaStateOnline = 1, // friend is logged on - k_EPersonaStateBusy = 2, // user is on, but busy - k_EPersonaStateAway = 3, // auto-away feature - k_EPersonaStateSnooze = 4, // auto-away for a long time - k_EPersonaStateMax, -}; - - -// for enumerating friends list -enum k_EFriendFlags -{ - k_EFriendFlagNone = 0x00, - k_EFriendFlagBlocked = 0x01, - k_EFriendFlagFriendshipRequested = 0x02, - k_EFriendFlagImmediate = 0x04, // "regular" friend - k_EFriendFlagClanMember = 0x08, - k_EFriendFlagOnGameServer = 0x10, - // k_EFriendFlagHasPlayedWith = 0x20, - // k_EFriendFlagFriendOfFriend = 0x40, - k_EFriendFlagRequestingFriendship = 0x80, - k_EFriendFlagRequestingInfo = 0x100, - k_EFriendFlagAll = 0xFFFF, -}; - - -enum { k_cchPersonaNameMax = 128 }; - -// size limit on chat room or member metadata -const uint32 k_cubChatMetadataMax = 4096; - -//----------------------------------------------------------------------------- -// Purpose: interface to friends -//----------------------------------------------------------------------------- -class ISteamFriends -{ -public: - // returns the local players name - guaranteed to not be NULL. - virtual const char *GetPersonaName() = 0; - // sets the player name, stores it on the server and publishes the changes to all friends who are online - virtual void SetPersonaName( const char *pchPersonaName ) = 0; - // gets the friend status of the current user - virtual EPersonaState GetPersonaState() = 0; - - // friend iteration - virtual int GetFriendCount( int iFriendFlags ) = 0; - virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0; - - // gets the relationship to a user - virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0; - // returns true if the specified user is considered a friend (can see our online status) - virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0; - // returns the name of a friend - guaranteed to not be NULL. - virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; - // gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set - virtual int GetFriendAvatar( CSteamID steamIDFriend ) = 0; - // returns true if the friend is actually in a game - virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, uint64 *pulGameID, uint32 *punGameIP, uint16 *pusGamePort, uint16 *pusQueryPort ) = 0; - // accesses old friends names - returns an empty string when their are no more items in the history - virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; - - // returns true if the specified user is considered a friend - virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0; - - // clan functions - virtual int GetClanCount() = 0; - virtual CSteamID GetClanByIndex( int iClan ) = 0; - virtual const char *GetClanName( CSteamID steamIDClan ) = 0; - - // iterators for any source - virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0; - virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0; - virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0; - - // User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI) - virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0; - - // activates the game overlay, with an optional dialog to open ("Friends", "Community", "Players", "Settings") - virtual void ActivateGameOverlay( const char *pchDialog ) = 0; -}; - -#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends003" - -//----------------------------------------------------------------------------- -// Purpose: called when a friends' status changes -//----------------------------------------------------------------------------- -struct PersonaStateChange_t -{ - enum { k_iCallback = k_iSteamFriendsCallbacks + 4 }; - - uint64 m_ulSteamID; // steamID of the friend who changed - int m_nChangeFlags; // what's changed -}; - - -// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user -// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend -enum EPersonaChange -{ - k_EPersonaChangeName = 0x001, - k_EPersonaChangeStatus = 0x002, - k_EPersonaChangeComeOnline = 0x004, - k_EPersonaChangeGoneOffline = 0x008, - k_EPersonaChangeGamePlayed = 0x010, - k_EPersonaChangeGameServer = 0x020, - k_EPersonaChangeAvatar = 0x040, - k_EPersonaChangeJoinedSource= 0x080, - k_EPersonaChangeLeftSource = 0x100, - k_EPersonaChangeRelationshipChanged = 0x200, - k_EPersonaChangeNameFirstSet = 0x400, -}; - - -//----------------------------------------------------------------------------- -// Purpose: posted when game overlay activates or deactivates -//----------------------------------------------------------------------------- -struct GameOverlayActivated_t -{ - enum { k_iCallback = k_iSteamFriendsCallbacks + 31 }; - uint8 m_bActive; // true if it's just been activated, false otherwise -}; - - -//----------------------------------------------------------------------------- -// Purpose: called when the user tries to join a different game server from their friends list -//----------------------------------------------------------------------------- -struct GameServerChangeRequested_t -{ - enum { k_iCallback = k_iSteamFriendsCallbacks + 32 }; - char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") - char m_rgchPassword[64]; // server password, if any -}; - -#endif // ISTEAMFRIENDS_H +//====== Copyright (C) 1996-2008, Valve Corporation, All rights reserved. ===== +// +// Purpose: interface to both friends list data and general information about users +// +//============================================================================= + +#ifndef ISTEAMFRIENDS_H +#define ISTEAMFRIENDS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" +#include "steamclientpublic.h" + + +//----------------------------------------------------------------------------- +// Purpose: set of relationships to other users +//----------------------------------------------------------------------------- +enum EFriendRelationship +{ + k_EFriendRelationshipNone = 0, + k_EFriendRelationshipBlocked = 1, // this doesn't get stored; the user has just done an Ignore on an friendship invite + k_EFriendRelationshipRequestRecipient = 2, + k_EFriendRelationshipFriend = 3, + k_EFriendRelationshipRequestInitiator = 4, + k_EFriendRelationshipIgnored = 5, // this is stored; the user has explicit blocked this other user from comments/chat/etc + k_EFriendRelationshipIgnoredFriend = 6, + k_EFriendRelationshipSuggested = 7, + + // keep this updated + k_EFriendRelationshipMax = 8, +}; + +// maximum length of friend group name (not including terminating nul!) +const int k_cchMaxFriendsGroupName = 64; + +// maximum number of groups a single user is allowed +const int k_cFriendsGroupLimit = 100; + +// friends group identifier type +typedef int16 FriendsGroupID_t; + +// invalid friends group identifier constant +const FriendsGroupID_t k_FriendsGroupID_Invalid = -1; + +const int k_cEnumerateFollowersMax = 50; + + +//----------------------------------------------------------------------------- +// Purpose: list of states a friend can be in +//----------------------------------------------------------------------------- +enum EPersonaState +{ + k_EPersonaStateOffline = 0, // friend is not currently logged on + k_EPersonaStateOnline = 1, // friend is logged on + k_EPersonaStateBusy = 2, // user is on, but busy + k_EPersonaStateAway = 3, // auto-away feature + k_EPersonaStateSnooze = 4, // auto-away for a long time + k_EPersonaStateLookingToTrade = 5, // Online, trading + k_EPersonaStateLookingToPlay = 6, // Online, wanting to play + k_EPersonaStateMax, +}; + + +//----------------------------------------------------------------------------- +// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users +//----------------------------------------------------------------------------- +enum EFriendFlags +{ + k_EFriendFlagNone = 0x00, + k_EFriendFlagBlocked = 0x01, + k_EFriendFlagFriendshipRequested = 0x02, + k_EFriendFlagImmediate = 0x04, // "regular" friend + k_EFriendFlagClanMember = 0x08, + k_EFriendFlagOnGameServer = 0x10, + // k_EFriendFlagHasPlayedWith = 0x20, // not currently used + // k_EFriendFlagFriendOfFriend = 0x40, // not currently used + k_EFriendFlagRequestingFriendship = 0x80, + k_EFriendFlagRequestingInfo = 0x100, + k_EFriendFlagIgnored = 0x200, + k_EFriendFlagIgnoredFriend = 0x400, + k_EFriendFlagSuggested = 0x800, + k_EFriendFlagAll = 0xFFFF, +}; + + +// friend game played information +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif +struct FriendGameInfo_t +{ + CGameID m_gameID; + uint32 m_unGameIP; + uint16 m_usGamePort; + uint16 m_usQueryPort; + CSteamID m_steamIDLobby; +}; +#pragma pack( pop ) + +// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16. +// The UTF-8 version has to be very generous to accomodate characters that get large when encoded +// in UTF-8. +enum +{ + k_cchPersonaNameMax = 128, + k_cwchPersonaNameMax = 32, +}; + +//----------------------------------------------------------------------------- +// Purpose: user restriction flags +//----------------------------------------------------------------------------- +enum EUserRestriction +{ + k_nUserRestrictionNone = 0, // no known chat/content restriction + k_nUserRestrictionUnknown = 1, // we don't know yet (user offline) + k_nUserRestrictionAnyChat = 2, // user is not allowed to (or can't) send/recv any chat + k_nUserRestrictionVoiceChat = 4, // user is not allowed to (or can't) send/recv voice chat + k_nUserRestrictionGroupChat = 8, // user is not allowed to (or can't) send/recv group chat + k_nUserRestrictionRating = 16, // user is too young according to rating in current region + k_nUserRestrictionGameInvites = 32, // user cannot send or recv game invites (e.g. mobile) + k_nUserRestrictionTrading = 64, // user cannot participate in trading (console, mobile) +}; + +//----------------------------------------------------------------------------- +// Purpose: information about user sessions +//----------------------------------------------------------------------------- +struct FriendSessionStateInfo_t +{ + uint32 m_uiOnlineSessionInstances; + uint8 m_uiPublishedToFriendsSessionInstance; +}; + + + +// size limit on chat room or member metadata +const uint32 k_cubChatMetadataMax = 8192; + +// size limits on Rich Presence data +enum { k_cchMaxRichPresenceKeys = 20 }; +enum { k_cchMaxRichPresenceKeyLength = 64 }; +enum { k_cchMaxRichPresenceValueLength = 256 }; + +// These values are passed as parameters to the store +enum EOverlayToStoreFlag +{ + k_EOverlayToStoreFlag_None = 0, + k_EOverlayToStoreFlag_AddToCart = 1, + k_EOverlayToStoreFlag_AddToCartAndShow = 2, +}; + +//----------------------------------------------------------------------------- +// Purpose: interface to accessing information about individual users, +// that can be a friend, in a group, on a game server or in a lobby with the local user +//----------------------------------------------------------------------------- +class ISteamFriends +{ +public: + // returns the local players name - guaranteed to not be NULL. + // this is the same name as on the users community profile page + // this is stored in UTF-8 format + // like all the other interface functions that return a char *, it's important that this pointer is not saved + // off; it will eventually be free'd or re-allocated + virtual const char *GetPersonaName() = 0; + + // Sets the player name, stores it on the server and publishes the changes to all friends who are online. + // Changes take place locally immediately, and a PersonaStateChange_t is posted, presuming success. + // + // The final results are available through the return value SteamAPICall_t, using SetPersonaNameResponse_t. + // + // If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted + // to change the name back, in addition to the SetPersonaNameResponse_t callback. + virtual SteamAPICall_t SetPersonaName( const char *pchPersonaName ) = 0; + + // gets the status of the current user + virtual EPersonaState GetPersonaState() = 0; + + // friend iteration + // takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria + // then GetFriendByIndex() can then be used to return the id's of each of those users + virtual int GetFriendCount( int iFriendFlags ) = 0; + + // returns the steamID of a user + // iFriend is a index of range [0, GetFriendCount()) + // iFriendsFlags must be the same value as used in GetFriendCount() + // the returned CSteamID can then be used by all the functions below to access details about the user + virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0; + + // returns a relationship to a user + virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0; + + // returns the current status of the specified user + // this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user + virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0; + + // returns the name another user - guaranteed to not be NULL. + // same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user + // note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously + // + virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; + + // returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details + virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; + // accesses old friends names - returns an empty string when their are no more items in the history + virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; + // friends steam level + virtual int GetFriendSteamLevel( CSteamID steamIDFriend ) = 0; + + // Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player. + virtual const char *GetPlayerNickname( CSteamID steamIDPlayer ) = 0; + + // friend grouping (tag) apis + // returns the number of friends groups + virtual int GetFriendsGroupCount() = 0; + // returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid) + virtual FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) = 0; + // returns the name for the given friends group (NULL in the case of invalid friends group IDs) + virtual const char *GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) = 0; + // returns the number of members in a given friends group + virtual int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) = 0; + // gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid + virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; + + // returns true if the specified user meets any of the criteria specified in iFriendFlags + // iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values + virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0; + + // clan (group) iteration and access functions + virtual int GetClanCount() = 0; + virtual CSteamID GetClanByIndex( int iClan ) = 0; + virtual const char *GetClanName( CSteamID steamIDClan ) = 0; + virtual const char *GetClanTag( CSteamID steamIDClan ) = 0; + // returns the most recent information we have about what's happening in a clan + virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0; + // for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest + virtual SteamAPICall_t DownloadClanActivityCounts( ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; + + // iterators for getting users in a chat room, lobby, game server or clan + // note that large clans that cannot be iterated by the local user + // note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby + // steamIDSource can be the steamID of a group, game server, lobby or chat room + virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0; + virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0; + + // returns true if the local user can see that steamIDUser is a member or in steamIDSource + virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0; + + // User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI) + virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0; + + // activates the game overlay, with an optional dialog to open + // valid options are "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements" + virtual void ActivateGameOverlay( const char *pchDialog ) = 0; + + // activates game overlay to a specific place + // valid options are + // "steamid" - opens the overlay web browser to the specified user or groups profile + // "chat" - opens a chat window to the specified user, or joins the group chat + // "jointrade" - opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API + // "stats" - opens the overlay web browser to the specified user's stats + // "achievements" - opens the overlay web browser to the specified user's achievements + // "friendadd" - opens the overlay in minimal mode prompting the user to add the target user as a friend + // "friendremove" - opens the overlay in minimal mode prompting the user to remove the target friend + // "friendrequestaccept" - opens the overlay in minimal mode prompting the user to accept an incoming friend invite + // "friendrequestignore" - opens the overlay in minimal mode prompting the user to ignore an incoming friend invite + virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0; + + // activates game overlay web browser directly to the specified URL + // full address with protocol type is required, e.g. https://store.steampowered.com/ + virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0; + + // activates game overlay to store page for app + virtual void ActivateGameOverlayToStore( AppId_t nAppID, EOverlayToStoreFlag eFlag ) = 0; + + // Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is + // in game + virtual void SetPlayedWith( CSteamID steamIDUserPlayedWith ) = 0; + + // activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby. + virtual void ActivateGameOverlayInviteDialog( CSteamID steamIDLobby ) = 0; + + // gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + virtual int GetSmallFriendAvatar( CSteamID steamIDFriend ) = 0; + + // gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + virtual int GetMediumFriendAvatar( CSteamID steamIDFriend ) = 0; + + // gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + // returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again + virtual int GetLargeFriendAvatar( CSteamID steamIDFriend ) = 0; + + // requests information about a user - persona name & avatar + // if bRequireNameOnly is set, then the avatar of a user isn't downloaded + // - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them + // if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved + // if returns false, it means that we already have all the details about that user, and functions can be called immediately + virtual bool RequestUserInformation( CSteamID steamIDUser, bool bRequireNameOnly ) = 0; + + // requests information about a clan officer list + // when complete, data is returned in ClanOfficerListResponse_t call result + // this makes available the calls below + // you can only ask about clans that a user is a member of + // note that this won't download avatars automatically; if you get an officer, + // and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar + virtual SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan ) = 0; + + // iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed + + // returns the steamID of the clan owner + virtual CSteamID GetClanOwner( CSteamID steamIDClan ) = 0; + // returns the number of officers in a clan (including the owner) + virtual int GetClanOfficerCount( CSteamID steamIDClan ) = 0; + // returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount) + virtual CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer ) = 0; + // if current user is chat restricted, he can't send or receive any text/voice chat messages. + // the user can't see custom avatars. But the user can be online and send/recv game invites. + // a chat restricted user can't add friends or join any groups. + virtual uint32 GetUserRestrictions() = 0; + + // Rich Presence data is automatically shared between friends who are in the same game + // Each user has a set of Key/Value pairs + // Up to 20 different keys can be set + // There are two magic keys: + // "status" - a UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list + // "connect" - a UTF-8 string that contains the command-line for how a friend can connect to a game + // GetFriendRichPresence() returns an empty string "" if no value is set + // SetRichPresence() to a NULL or an empty string deletes the key + // You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount() + // and GetFriendRichPresenceKeyByIndex() (typically only used for debugging) + virtual bool SetRichPresence( const char *pchKey, const char *pchValue ) = 0; + virtual void ClearRichPresence() = 0; + virtual const char *GetFriendRichPresence( CSteamID steamIDFriend, const char *pchKey ) = 0; + virtual int GetFriendRichPresenceKeyCount( CSteamID steamIDFriend ) = 0; + virtual const char *GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend, int iKey ) = 0; + // Requests rich presence for a specific user. + virtual void RequestFriendRichPresence( CSteamID steamIDFriend ) = 0; + + // rich invite support + // if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game + // if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string + // invites can only be sent to friends + virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0; + + // recently-played-with friends iteration + // this iterates the entire list of users recently played with, across games + // GetFriendCoplayTime() returns as a unix time + virtual int GetCoplayFriendCount() = 0; + virtual CSteamID GetCoplayFriend( int iCoplayFriend ) = 0; + virtual int GetFriendCoplayTime( CSteamID steamIDFriend ) = 0; + virtual AppId_t GetFriendCoplayGame( CSteamID steamIDFriend ) = 0; + + // chat interface for games + // this allows in-game access to group (clan) chats from in the game + // the behavior is somewhat sophisticated, because the user may or may not be already in the group chat from outside the game or in the overlay + // use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat + virtual SteamAPICall_t JoinClanChatRoom( CSteamID steamIDClan ) = 0; + virtual bool LeaveClanChatRoom( CSteamID steamIDClan ) = 0; + virtual int GetClanChatMemberCount( CSteamID steamIDClan ) = 0; + virtual CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser ) = 0; + virtual bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText ) = 0; + virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, OUT_STRUCT() CSteamID *psteamidChatter ) = 0; + virtual bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser ) = 0; + + // interact with the Steam (game overlay / desktop) + virtual bool IsClanChatWindowOpenInSteam( CSteamID steamIDClanChat ) = 0; + virtual bool OpenClanChatWindowInSteam( CSteamID steamIDClanChat ) = 0; + virtual bool CloseClanChatWindowInSteam( CSteamID steamIDClanChat ) = 0; + + // peer-to-peer chat interception + // this is so you can show P2P chats inline in the game + virtual bool SetListenForFriendsMessages( bool bInterceptEnabled ) = 0; + virtual bool ReplyToFriendMessage( CSteamID steamIDFriend, const char *pchMsgToSend ) = 0; + virtual int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // following apis + virtual SteamAPICall_t GetFollowerCount( CSteamID steamID ) = 0; + virtual SteamAPICall_t IsFollowing( CSteamID steamID ) = 0; + virtual SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex ) = 0; +}; + +#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends015" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when a friends' status changes +//----------------------------------------------------------------------------- +struct PersonaStateChange_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 4 }; + + uint64 m_ulSteamID; // steamID of the friend who changed + int m_nChangeFlags; // what's changed +}; + + +// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user +// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend +enum EPersonaChange +{ + k_EPersonaChangeName = 0x0001, + k_EPersonaChangeStatus = 0x0002, + k_EPersonaChangeComeOnline = 0x0004, + k_EPersonaChangeGoneOffline = 0x0008, + k_EPersonaChangeGamePlayed = 0x0010, + k_EPersonaChangeGameServer = 0x0020, + k_EPersonaChangeAvatar = 0x0040, + k_EPersonaChangeJoinedSource= 0x0080, + k_EPersonaChangeLeftSource = 0x0100, + k_EPersonaChangeRelationshipChanged = 0x0200, + k_EPersonaChangeNameFirstSet = 0x0400, + k_EPersonaChangeFacebookInfo = 0x0800, + k_EPersonaChangeNickname = 0x1000, + k_EPersonaChangeSteamLevel = 0x2000, +}; + + +//----------------------------------------------------------------------------- +// Purpose: posted when game overlay activates or deactivates +// the game can use this to be pause or resume single player games +//----------------------------------------------------------------------------- +struct GameOverlayActivated_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 31 }; + uint8 m_bActive; // true if it's just been activated, false otherwise +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the user tries to join a different game server from their friends list +// game client should attempt to connect to specified server when this is received +//----------------------------------------------------------------------------- +struct GameServerChangeRequested_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 32 }; + char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") + char m_rgchPassword[64]; // server password, if any +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the user tries to join a lobby from their friends list +// game client should attempt to connect to specified lobby when this is received +//----------------------------------------------------------------------------- +struct GameLobbyJoinRequested_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 33 }; + CSteamID m_steamIDLobby; + + // The friend they did the join via (will be invalid if not directly via a friend) + // + // On PS3, the friend will be invalid if this was triggered by a PSN invite via the XMB, but + // the account type will be console user so you can tell at least that this was from a PSN friend + // rather than a Steam friend. + CSteamID m_steamIDFriend; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call +// if the image wasn't already available +//----------------------------------------------------------------------------- +struct AvatarImageLoaded_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 34 }; + CSteamID m_steamID; // steamid the avatar has been loaded for + int m_iImage; // the image index of the now loaded image + int m_iWide; // width of the loaded image + int m_iTall; // height of the loaded image +}; + + +//----------------------------------------------------------------------------- +// Purpose: marks the return of a request officer list call +//----------------------------------------------------------------------------- +struct ClanOfficerListResponse_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 35 }; + CSteamID m_steamIDClan; + int m_cOfficers; + uint8 m_bSuccess; +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback indicating updated data about friends rich presence information +//----------------------------------------------------------------------------- +struct FriendRichPresenceUpdate_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 36 }; + CSteamID m_steamIDFriend; // friend who's rich presence has changed + AppId_t m_nAppID; // the appID of the game (should always be the current game) +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the user tries to join a game from their friends list +// rich presence will have been set with the "connect" key which is set here +//----------------------------------------------------------------------------- +struct GameRichPresenceJoinRequested_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 37 }; + CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend) + char m_rgchConnect[k_cchMaxRichPresenceValueLength]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a chat message has been received for a clan chat the game has joined +//----------------------------------------------------------------------------- +struct GameConnectedClanChatMsg_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 38 }; + CSteamID m_steamIDClanChat; + CSteamID m_steamIDUser; + int m_iMessageID; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a user has joined a clan chat +//----------------------------------------------------------------------------- +struct GameConnectedChatJoin_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 39 }; + CSteamID m_steamIDClanChat; + CSteamID m_steamIDUser; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a user has left the chat we're in +//----------------------------------------------------------------------------- +struct GameConnectedChatLeave_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 40 }; + CSteamID m_steamIDClanChat; + CSteamID m_steamIDUser; + bool m_bKicked; // true if admin kicked + bool m_bDropped; // true if Steam connection dropped +}; + + +//----------------------------------------------------------------------------- +// Purpose: a DownloadClanActivityCounts() call has finished +//----------------------------------------------------------------------------- +struct DownloadClanActivityCountsResult_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 41 }; + bool m_bSuccess; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a JoinClanChatRoom() call has finished +//----------------------------------------------------------------------------- +struct JoinClanChatRoomCompletionResult_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 42 }; + CSteamID m_steamIDClanChat; + EChatRoomEnterResponse m_eChatRoomEnterResponse; +}; + +//----------------------------------------------------------------------------- +// Purpose: a chat message has been received from a user +//----------------------------------------------------------------------------- +struct GameConnectedFriendChatMsg_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 43 }; + CSteamID m_steamIDUser; + int m_iMessageID; +}; + + +struct FriendsGetFollowerCount_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 44 }; + EResult m_eResult; + CSteamID m_steamID; + int m_nCount; +}; + + +struct FriendsIsFollowing_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 45 }; + EResult m_eResult; + CSteamID m_steamID; + bool m_bIsFollowing; +}; + + +struct FriendsEnumerateFollowingList_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 46 }; + EResult m_eResult; + CSteamID m_rgSteamID[ k_cEnumerateFollowersMax ]; + int32 m_nResultsReturned; + int32 m_nTotalResultCount; +}; + +//----------------------------------------------------------------------------- +// Purpose: reports the result of an attempt to change the user's persona name +//----------------------------------------------------------------------------- +struct SetPersonaNameResponse_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 47 }; + + bool m_bSuccess; // true if name change succeeded completely. + bool m_bLocalSuccess; // true if name change was retained locally. (We might not have been able to communicate with Steam) + EResult m_result; // detailed result code +}; + + +#pragma pack( pop ) + +#endif // ISTEAMFRIENDS_H diff --git a/public/steam/isteamgamecoordinator.h b/public/steam/isteamgamecoordinator.h new file mode 100644 index 000000000..5ab0637f0 --- /dev/null +++ b/public/steam/isteamgamecoordinator.h @@ -0,0 +1,75 @@ +//====== Copyright ©, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to the game coordinator for this application +// +//============================================================================= + +#ifndef ISTEAMGAMECOORDINATOR +#define ISTEAMGAMECOORDINATOR +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" + + +// list of possible return values from the ISteamGameCoordinator API +enum EGCResults +{ + k_EGCResultOK = 0, + k_EGCResultNoMessage = 1, // There is no message in the queue + k_EGCResultBufferTooSmall = 2, // The buffer is too small for the requested message + k_EGCResultNotLoggedOn = 3, // The client is not logged onto Steam + k_EGCResultInvalidMessage = 4, // Something was wrong with the message being sent with SendMessage +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for sending and receiving messages from the Game Coordinator +// for this application +//----------------------------------------------------------------------------- +class ISteamGameCoordinator +{ +public: + + // sends a message to the Game Coordinator + virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0; + + // returns true if there is a message waiting from the game coordinator + virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0; + + // fills the provided buffer with the first message in the queue and returns k_EGCResultOK or + // returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size. + // If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned + // and the message remains at the head of the queue. + virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; + +}; +#define STEAMGAMECOORDINATOR_INTERFACE_VERSION "SteamGameCoordinator001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +// callback notification - A new message is available for reading from the message queue +struct GCMessageAvailable_t +{ + enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 }; + uint32 m_nMessageSize; +}; + +// callback notification - A message failed to make it to the GC. It may be down temporarily +struct GCMessageFailed_t +{ + enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 }; +}; + +#pragma pack( pop ) + +#endif // ISTEAMGAMECOORDINATOR diff --git a/public/steam/isteamgameserver.h b/public/steam/isteamgameserver.h index bad4d35f9..cc1099857 100644 --- a/public/steam/isteamgameserver.h +++ b/public/steam/isteamgameserver.h @@ -1,226 +1,384 @@ -//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to steam for game servers -// -//============================================================================= - -#ifndef ISTEAMGAMESERVER_H -#define ISTEAMGAMESERVER_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - - -//----------------------------------------------------------------------------- -// Purpose: Functions for authenticating users via Steam to play on a game server -//----------------------------------------------------------------------------- -class ISteamGameServer -{ -public: - // connection functions - virtual void LogOn() = 0; - virtual void LogOff() = 0; - - // status functions - virtual bool BLoggedOn() = 0; - virtual bool BSecure() = 0; - virtual CSteamID GetSteamID() = 0; - - // Handles receiving a new connection from a Steam user. This call will ask the Steam - // servers to validate the users identity, app ownership, and VAC status. If the Steam servers - // are off-line, then it will validate the cached ticket itself which will validate app ownership - // and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection() - // and must then be sent up to the game server for authentication. - // - // Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL - // If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication - // for the user has succeeded or failed (the steamid in the callback will match the one returned by this call) - virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0; - - // Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation. - // - // Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect() - // when this user leaves the server just like you would for a real user. - virtual CSteamID CreateUnauthenticatedUserConnection() = 0; - - // Should be called whenever a user leaves our game server, this lets Steam internally - // track which users are currently on which servers for the purposes of preventing a single - // account being logged into multiple servers, showing who is currently on a server, etc. - virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0; - - // Update the data to be displayed in the server browser and matchmaking interfaces for a user - // currently connected to the server. For regular users you must call this after you receive a - // GSUserValidationSuccess callback. - // - // Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player) - virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0; - - // You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once. - // - // To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below. - // - // Input: nGameAppID - The Steam assigned AppID for the game - // unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below) - // unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY) - // unGamePort - The port which the server is listening for client connections on - // unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported - // usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests - // pchGameDir - A unique string identifier for your game - // pchVersion - The current version of the server as a string like 1.0.0.0 - // bLanMode - Is this a LAN only server? - // - // bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used, - // and stop calling it in SteamGameServer_Init()? - virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort, - uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0; - - // Updates server status values which shows up in the server browser and matchmaking APIs - virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers, - const char *pchServerName, const char *pSpectatorServerName, - const char *pchMapName ) = 0; - - // This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now). - virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0; - - // Sets a string defining the "gametags" for this server, this is optional, but if it is set - // it allows users to filter in the matchmaking/server-browser interfaces based on the value - virtual void SetGameTags( const char *pchGameTags ) = 0; - - // Ask for the gameplay stats for the server. Results returned in a callback - virtual void GetGameplayStats( ) = 0; - - // Gets the reputation score for the game server. This API also checks if the server or some - // other server on the same IP is banned from the Steam master servers. - virtual SteamAPICall_t GetServerReputation( ) = 0; - - // Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t - // returns false if we're not connected to the steam servers and thus cannot ask - virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0; - - // Returns the public IP of the server according to Steam, useful when the server is - // behind NAT and you want to advertise its IP in a lobby for other clients to directly - // connect to - virtual uint32 GetPublicIP() = 0; - - // Sets a string defining the "gamedata" for this server, this is optional, but if it is set - // it allows users to filter in the matchmaking/server-browser interfaces based on the value - // don't set this unless it actually changes, its only uploaded to the master once (when - // acknowledged) - virtual void SetGameData( const char *pchGameData) = 0; - - // After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function - // to determine if the user owns downloadable content specified by the provided AppID. - virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0; -}; - -#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer010" - -// game server flags -const uint32 k_unServerFlagNone = 0x00; -const uint32 k_unServerFlagActive = 0x01; // server has users playing -const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure -const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated -const uint32 k_unServerFlagLinux = 0x08; // linux build -const uint32 k_unServerFlagPassworded = 0x10; // password protected -const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and - // won't enforce authentication of users that connect to the server. - // Useful when you run a server where the clients may not - // be connected to the internet but you want them to play (i.e LANs) - - -// callbacks -#pragma pack( push, 8 ) - - -// client has been approved to connect to this game server -struct GSClientApprove_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 1 }; - CSteamID m_SteamID; -}; - - -// client has been denied to connection to this game server -struct GSClientDeny_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 2 }; - CSteamID m_SteamID; - EDenyReason m_eDenyReason; - char m_rgchOptionalText[128]; -}; - - -// request the game server should kick the user -struct GSClientKick_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 3 }; - CSteamID m_SteamID; - EDenyReason m_eDenyReason; -}; - -// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks, -// do not reuse them here. - - -// client achievement info -struct GSClientAchievementStatus_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 6 }; - uint64 m_SteamID; - char m_pchAchievement[128]; - bool m_bUnlocked; -}; - -// received when the game server requests to be displayed as secure (VAC protected) -// m_bSecure is true if the game server should display itself as secure to users, false otherwise -struct GSPolicyResponse_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 15 }; - uint8 m_bSecure; -}; - -// GS gameplay stats info -struct GSGameplayStats_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 7 }; - EResult m_eResult; // Result of the call - int32 m_nRank; // Overall rank of the server (0-based) - uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server - uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server -}; - -// send as a reply to RequestUserGroupStatus() -struct GSClientGroupStatus_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 8 }; - CSteamID m_SteamIDUser; - CSteamID m_SteamIDGroup; - bool m_bMember; - bool m_bOfficer; -}; - -// Sent as a reply to GetServerReputation() -struct GSReputation_t -{ - enum { k_iCallback = k_iSteamGameServerCallbacks + 9 }; - EResult m_eResult; // Result of the call; - uint32 m_unReputationScore; // The reputation score for the game server - bool m_bBanned; // True if the server is banned from the Steam - // master servers - - // The following members are only filled out if m_bBanned is true. They will all - // be set to zero otherwise. Master server bans are by IP so it is possible to be - // banned even when the score is good high if there is a bad server on another port. - // This information can be used to determine which server is bad. - - uint32 m_unBannedIP; // The IP of the banned server - uint16 m_usBannedPort; // The port of the banned server - uint64 m_ulBannedGameID; // The game ID the banned server is serving - uint32 m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) -}; - -#pragma pack( pop ) - -#endif // ISTEAMGAMESERVER_H +//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam for game servers +// +//============================================================================= + +#ifndef ISTEAMGAMESERVER_H +#define ISTEAMGAMESERVER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1) + +//----------------------------------------------------------------------------- +// Purpose: Functions for authenticating users via Steam to play on a game server +//----------------------------------------------------------------------------- +class ISteamGameServer +{ +public: + +// +// Basic server data. These properties, if set, must be set before before calling LogOn. They +// may not be changed after logged in. +// + + /// This is called by SteamGameServer_Init, and you will usually not need to call it directly + virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0; + + /// Game product identifier. This is currently used by the master server for version checking purposes. + /// It's a required field, but will eventually will go away, and the AppID will be used for this purpose. + virtual void SetProduct( const char *pszProduct ) = 0; + + /// Description of the game. This is a required field and is displayed in the steam server browser....for now. + /// This is a required field, but it will go away eventually, as the data should be determined from the AppID. + virtual void SetGameDescription( const char *pszGameDescription ) = 0; + + /// If your game is a "mod," pass the string that identifies it. The default is an empty string, meaning + /// this application is the original game, not a mod. + /// + /// @see k_cbMaxGameServerGameDir + virtual void SetModDir( const char *pszModDir ) = 0; + + /// Is this is a dedicated server? The default value is false. + virtual void SetDedicatedServer( bool bDedicated ) = 0; + +// +// Login +// + + /// Begin process to login to a persistent game server account + /// + /// You need to register for callbacks to determine the result of this operation. + /// @see SteamServersConnected_t + /// @see SteamServerConnectFailure_t + /// @see SteamServersDisconnected_t + virtual void LogOn( const char *pszToken ) = 0; + + /// Login to a generic, anonymous account. + /// + /// Note: in previous versions of the SDK, this was automatically called within SteamGameServer_Init, + /// but this is no longer the case. + virtual void LogOnAnonymous() = 0; + + /// Begin process of logging game server out of steam + virtual void LogOff() = 0; + + // status functions + virtual bool BLoggedOn() = 0; + virtual bool BSecure() = 0; + virtual CSteamID GetSteamID() = 0; + + /// Returns true if the master server has requested a restart. + /// Only returns true once per request. + virtual bool WasRestartRequested() = 0; + +// +// Server state. These properties may be changed at any time. +// + + /// Max player count that will be reported to server browser and client queries + virtual void SetMaxPlayerCount( int cPlayersMax ) = 0; + + /// Number of bots. Default value is zero + virtual void SetBotPlayerCount( int cBotplayers ) = 0; + + /// Set the name of server as it will appear in the server browser + /// + /// @see k_cbMaxGameServerName + virtual void SetServerName( const char *pszServerName ) = 0; + + /// Set name of map to report in the server browser + /// + /// @see k_cbMaxGameServerName + virtual void SetMapName( const char *pszMapName ) = 0; + + /// Let people know if your server will require a password + virtual void SetPasswordProtected( bool bPasswordProtected ) = 0; + + /// Spectator server. The default value is zero, meaning the service + /// is not used. + virtual void SetSpectatorPort( uint16 unSpectatorPort ) = 0; + + /// Name of the spectator server. (Only used if spectator port is nonzero.) + /// + /// @see k_cbMaxGameServerMapName + virtual void SetSpectatorServerName( const char *pszSpectatorServerName ) = 0; + + /// Call this to clear the whole list of key/values that are sent in rules queries. + virtual void ClearAllKeyValues() = 0; + + /// Call this to add/update a key/value pair. + virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0; + + /// Sets a string defining the "gametags" for this server, this is optional, but if it is set + /// it allows users to filter in the matchmaking/server-browser interfaces based on the value + /// + /// @see k_cbMaxGameServerTags + virtual void SetGameTags( const char *pchGameTags ) = 0; + + /// Sets a string defining the "gamedata" for this server, this is optional, but if it is set + /// it allows users to filter in the matchmaking/server-browser interfaces based on the value + /// don't set this unless it actually changes, its only uploaded to the master once (when + /// acknowledged) + /// + /// @see k_cbMaxGameServerGameData + virtual void SetGameData( const char *pchGameData ) = 0; + + /// Region identifier. This is an optional field, the default value is empty, meaning the "world" region + virtual void SetRegion( const char *pszRegion ) = 0; + +// +// Player list management / authentication +// + + // Handles receiving a new connection from a Steam user. This call will ask the Steam + // servers to validate the users identity, app ownership, and VAC status. If the Steam servers + // are off-line, then it will validate the cached ticket itself which will validate app ownership + // and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection() + // and must then be sent up to the game server for authentication. + // + // Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL + // If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication + // for the user has succeeded or failed (the steamid in the callback will match the one returned by this call) + virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0; + + // Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation. + // + // Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect() + // when this user leaves the server just like you would for a real user. + virtual CSteamID CreateUnauthenticatedUserConnection() = 0; + + // Should be called whenever a user leaves our game server, this lets Steam internally + // track which users are currently on which servers for the purposes of preventing a single + // account being logged into multiple servers, showing who is currently on a server, etc. + virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0; + + // Update the data to be displayed in the server browser and matchmaking interfaces for a user + // currently connected to the server. For regular users you must call this after you receive a + // GSUserValidationSuccess callback. + // + // Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player) + virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0; + + // New auth system APIs - do not mix with the old auth system APIs. + // ---------------------------------------------------------------- + + // Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ). + // pcbTicket retrieves the length of the actual ticket. + virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0; + + // Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused + // Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) + virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0; + + // Stop tracking started by BeginAuthSession - called when no longer playing game with this entity + virtual void EndAuthSession( CSteamID steamID ) = 0; + + // Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to + virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0; + + // After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function + // to determine if the user owns downloadable content specified by the provided AppID. + virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0; + + // Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t + // returns false if we're not connected to the steam servers and thus cannot ask + virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0; + + + // these two functions s are deprecated, and will not return results + // they will be removed in a future version of the SDK + virtual void GetGameplayStats( ) = 0; + virtual SteamAPICall_t GetServerReputation( ) = 0; + + // Returns the public IP of the server according to Steam, useful when the server is + // behind NAT and you want to advertise its IP in a lobby for other clients to directly + // connect to + virtual uint32 GetPublicIP() = 0; + +// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own +// socket to talk to the master server on, it lets the game use its socket to forward messages +// back and forth. This prevents us from requiring server ops to open up yet another port +// in their firewalls. +// +// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001 + + // These are used when you've elected to multiplex the game server's UDP socket + // rather than having the master server updater use its own sockets. + // + // Source games use this to simplify the job of the server admins, so they + // don't have to open up more ports on their firewalls. + + // Call this when a packet that starts with 0xFFFFFFFF comes in. That means + // it's for us. + virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0; + + // AFTER calling HandleIncomingPacket for any packets that came in that frame, call this. + // This gets a packet that the master server updater needs to send out on UDP. + // It returns the length of the packet it wants to send, or 0 if there are no more packets to send. + // Call this each frame until it returns 0. + virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0; + +// +// Control heartbeats / advertisement with master server +// + + // Call this as often as you like to tell the master server updater whether or not + // you want it to be active (default: off). + virtual void EnableHeartbeats( bool bActive ) = 0; + + // You usually don't need to modify this. + // Pass -1 to use the default value for iHeartbeatInterval. + // Some mods change this. + virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0; + + // Force a heartbeat to steam at the next opportunity + virtual void ForceHeartbeat() = 0; + + // associate this game server with this clan for the purposes of computing player compat + virtual SteamAPICall_t AssociateWithClan( CSteamID steamIDClan ) = 0; + + // ask if any of the current players dont want to play with this new player - or vice versa + virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0; + +}; + +#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer012" + +// game server flags +const uint32 k_unServerFlagNone = 0x00; +const uint32 k_unServerFlagActive = 0x01; // server has users playing +const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure +const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated +const uint32 k_unServerFlagLinux = 0x08; // linux build +const uint32 k_unServerFlagPassworded = 0x10; // password protected +const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and + // won't enforce authentication of users that connect to the server. + // Useful when you run a server where the clients may not + // be connected to the internet but you want them to play (i.e LANs) + + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +// client has been approved to connect to this game server +struct GSClientApprove_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 1 }; + CSteamID m_SteamID; // SteamID of approved player + CSteamID m_OwnerSteamID; // SteamID of original owner for game license +}; + + +// client has been denied to connection to this game server +struct GSClientDeny_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 2 }; + CSteamID m_SteamID; + EDenyReason m_eDenyReason; + char m_rgchOptionalText[128]; +}; + + +// request the game server should kick the user +struct GSClientKick_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 3 }; + CSteamID m_SteamID; + EDenyReason m_eDenyReason; +}; + +// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks, +// do not reuse them here. + + +// client achievement info +struct GSClientAchievementStatus_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 6 }; + uint64 m_SteamID; + char m_pchAchievement[128]; + bool m_bUnlocked; +}; + +// received when the game server requests to be displayed as secure (VAC protected) +// m_bSecure is true if the game server should display itself as secure to users, false otherwise +struct GSPolicyResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 15 }; + uint8 m_bSecure; +}; + +// GS gameplay stats info +struct GSGameplayStats_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 7 }; + EResult m_eResult; // Result of the call + int32 m_nRank; // Overall rank of the server (0-based) + uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server + uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server +}; + +// send as a reply to RequestUserGroupStatus() +struct GSClientGroupStatus_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 8 }; + CSteamID m_SteamIDUser; + CSteamID m_SteamIDGroup; + bool m_bMember; + bool m_bOfficer; +}; + +// Sent as a reply to GetServerReputation() +struct GSReputation_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 9 }; + EResult m_eResult; // Result of the call; + uint32 m_unReputationScore; // The reputation score for the game server + bool m_bBanned; // True if the server is banned from the Steam + // master servers + + // The following members are only filled out if m_bBanned is true. They will all + // be set to zero otherwise. Master server bans are by IP so it is possible to be + // banned even when the score is good high if there is a bad server on another port. + // This information can be used to determine which server is bad. + + uint32 m_unBannedIP; // The IP of the banned server + uint16 m_usBannedPort; // The port of the banned server + uint64 m_ulBannedGameID; // The game ID the banned server is serving + uint32 m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) +}; + +// Sent as a reply to AssociateWithClan() +struct AssociateWithClanResult_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 10 }; + EResult m_eResult; // Result of the call; +}; + +// Sent as a reply to ComputeNewPlayerCompatibility() +struct ComputeNewPlayerCompatibilityResult_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 11 }; + EResult m_eResult; // Result of the call; + int m_cPlayersThatDontLikeCandidate; + int m_cPlayersThatCandidateDoesntLike; + int m_cClanPlayersThatDontLikeCandidate; + CSteamID m_SteamIDCandidate; +}; + + +#pragma pack( pop ) + +#endif // ISTEAMGAMESERVER_H diff --git a/public/steam/isteamgameserverstats.h b/public/steam/isteamgameserverstats.h index 988b284dd..8d53186ec 100644 --- a/public/steam/isteamgameserverstats.h +++ b/public/steam/isteamgameserverstats.h @@ -1,93 +1,99 @@ -//====== Copyright © Valve Corporation, All rights reserved. ======= -// -// Purpose: interface for game servers to steam stats and achievements -// -//============================================================================= - -#ifndef ISTEAMGAMESERVERSTATS_H -#define ISTEAMGAMESERVERSTATS_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -//----------------------------------------------------------------------------- -// Purpose: Functions for authenticating users via Steam to play on a game server -//----------------------------------------------------------------------------- -class ISteamGameServerStats -{ -public: - // downloads stats for the user - // returns a GSStatsReceived_t callback when completed - // if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail - // these stats will only be auto-updated for clients playing on the server. For other - // users you'll need to call RequestUserStats() again to refresh any data - virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; - - // requests stat information for a user, usable after a successful call to RequestUserStats() - virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0; - virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0; - virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0; - - // Set / update stats and achievements. - // Note: These updates will work only on stats game servers are allowed to edit and only for - // game servers that have been declared as officially controlled by the game creators. - // Set the IP range of your official servers on the Steamworks page - virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0; - virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0; - virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0; - - virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; - virtual bool ClearUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; - - // Store the current data on the server, will get a GSStatsStored_t callback when set. - // - // If the callback has a result of k_EResultInvalidParam, one or more stats - // uploaded has been rejected, either because they broke constraints - // or were out of date. In this case the server sends back updated values. - // The stats should be re-iterated to keep in sync. - virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0; -}; - -#define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001" - -// callbacks -#pragma pack( push, 8 ) - -//----------------------------------------------------------------------------- -// Purpose: called when the latests stats and achievements have been received -// from the server -//----------------------------------------------------------------------------- -struct GSStatsReceived_t -{ - enum { k_iCallback = k_iSteamGameServerStatsCallbacks }; - EResult m_eResult; // Success / error fetching the stats - CSteamID m_steamIDUser; // The user for whom the stats are retrieved for -}; - - -//----------------------------------------------------------------------------- -// Purpose: result of a request to store the user stats for a game -//----------------------------------------------------------------------------- -struct GSStatsStored_t -{ - enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 }; - EResult m_eResult; // success / error - CSteamID m_steamIDUser; // The user for whom the stats were stored -}; - -//----------------------------------------------------------------------------- -// Purpose: Callback indicating that a user's stats have been unloaded. -// Call RequestUserStats again to access stats for this user -//----------------------------------------------------------------------------- -struct GSStatsUnloaded_t -{ - enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 }; - CSteamID m_steamIDUser; // User whose stats have been unloaded -}; - -#pragma pack( pop ) - - -#endif // ISTEAMGAMESERVERSTATS_H +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: interface for game servers to steam stats and achievements +// +//============================================================================= + +#ifndef ISTEAMGAMESERVERSTATS_H +#define ISTEAMGAMESERVERSTATS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +//----------------------------------------------------------------------------- +// Purpose: Functions for authenticating users via Steam to play on a game server +//----------------------------------------------------------------------------- +class ISteamGameServerStats +{ +public: + // downloads stats for the user + // returns a GSStatsReceived_t callback when completed + // if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail + // these stats will only be auto-updated for clients playing on the server. For other + // users you'll need to call RequestUserStats() again to refresh any data + virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; + + // requests stat information for a user, usable after a successful call to RequestUserStats() + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0; + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0; + virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0; + + // Set / update stats and achievements. + // Note: These updates will work only on stats game servers are allowed to edit and only for + // game servers that have been declared as officially controlled by the game creators. + // Set the IP range of your official servers on the Steamworks page + virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0; + virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0; + virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0; + + virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; + virtual bool ClearUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; + + // Store the current data on the server, will get a GSStatsStored_t callback when set. + // + // If the callback has a result of k_EResultInvalidParam, one or more stats + // uploaded has been rejected, either because they broke constraints + // or were out of date. In this case the server sends back updated values. + // The stats should be re-iterated to keep in sync. + virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0; +}; + +#define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when the latests stats and achievements have been received +// from the server +//----------------------------------------------------------------------------- +struct GSStatsReceived_t +{ + enum { k_iCallback = k_iSteamGameServerStatsCallbacks }; + EResult m_eResult; // Success / error fetching the stats + CSteamID m_steamIDUser; // The user for whom the stats are retrieved for +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the user stats for a game +//----------------------------------------------------------------------------- +struct GSStatsStored_t +{ + enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 }; + EResult m_eResult; // success / error + CSteamID m_steamIDUser; // The user for whom the stats were stored +}; + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that a user's stats have been unloaded. +// Call RequestUserStats again to access stats for this user +//----------------------------------------------------------------------------- +struct GSStatsUnloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 }; + CSteamID m_steamIDUser; // User whose stats have been unloaded +}; + +#pragma pack( pop ) + + +#endif // ISTEAMGAMESERVERSTATS_H diff --git a/public/steam/isteamgamestats.h b/public/steam/isteamgamestats.h new file mode 100644 index 000000000..a32ae4abd --- /dev/null +++ b/public/steam/isteamgamestats.h @@ -0,0 +1,75 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: interface to steam for game play statistics +// +//============================================================================= + +#ifndef ISTEAMGAMESTATS_H +#define ISTEAMGAMESTATS_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for recording game play sessions and details thereof +//----------------------------------------------------------------------------- +class ISteamGameStats +{ +public: + virtual SteamAPICall_t GetNewSession( int8 nAccountType, uint64 ulAccountID, int32 nAppID, RTime32 rtTimeStarted ) = 0; + virtual SteamAPICall_t EndSession( uint64 ulSessionID, RTime32 rtTimeEnded, int nReasonCode ) = 0; + virtual EResult AddSessionAttributeInt( uint64 ulSessionID, const char* pstrName, int32 nData ) = 0; + virtual EResult AddSessionAttributeString( uint64 ulSessionID, const char* pstrName, const char *pstrData ) = 0; + virtual EResult AddSessionAttributeFloat( uint64 ulSessionID, const char* pstrName, float fData ) = 0; + + virtual EResult AddNewRow( uint64 *pulRowID, uint64 ulSessionID, const char *pstrTableName ) = 0; + virtual EResult CommitRow( uint64 ulRowID ) = 0; + virtual EResult CommitOutstandingRows( uint64 ulSessionID ) = 0; + virtual EResult AddRowAttributeInt( uint64 ulRowID, const char *pstrName, int32 nData ) = 0; + virtual EResult AddRowAtributeString( uint64 ulRowID, const char *pstrName, const char *pstrData ) = 0; + virtual EResult AddRowAttributeFloat( uint64 ulRowID, const char *pstrName, float fData ) = 0; + + virtual EResult AddSessionAttributeInt64( uint64 ulSessionID, const char *pstrName, int64 llData ) = 0; + virtual EResult AddRowAttributeInt64( uint64 ulRowID, const char *pstrName, int64 llData ) = 0; +}; + +#define STEAMGAMESTATS_INTERFACE_VERSION "SteamGameStats001" + + +//----------------------------------------------------------------------------- +// Purpose: nAccountType for GetNewSession +//----------------------------------------------------------------------------- +enum EGameStatsAccountType +{ + k_EGameStatsAccountType_Steam = 1, // ullAccountID is a 64-bit SteamID for a player + k_EGameStatsAccountType_Xbox = 2, // ullAccountID is a 64-bit XUID + k_EGameStatsAccountType_SteamGameServer = 3, // ullAccountID is a 64-bit SteamID for a game server +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback for GetNewSession() method +//----------------------------------------------------------------------------- +struct GameStatsSessionIssued_t +{ + enum { k_iCallback = k_iSteamGameStatsCallbacks + 1 }; + + uint64 m_ulSessionID; + EResult m_eResult; + bool m_bCollectingAny; + bool m_bCollectingDetails; +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback for EndSession() method +//----------------------------------------------------------------------------- +struct GameStatsSessionClosed_t +{ + enum { k_iCallback = k_iSteamGameStatsCallbacks + 2 }; + + uint64 m_ulSessionID; + EResult m_eResult; +}; + +#endif // ISTEAMGAMESTATS_H diff --git a/public/steam/isteamhtmlsurface.h b/public/steam/isteamhtmlsurface.h new file mode 100644 index 000000000..c257164ae --- /dev/null +++ b/public/steam/isteamhtmlsurface.h @@ -0,0 +1,444 @@ +//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to display html pages in a texture +// +//============================================================================= + +#ifndef ISTEAMHTMLSURFACE_H +#define ISTEAMHTMLSURFACE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +typedef uint32 HHTMLBrowser; +const uint32 INVALID_HTMLBROWSER = 0; + +//----------------------------------------------------------------------------- +// Purpose: Functions for displaying HTML pages and interacting with them +//----------------------------------------------------------------------------- +class ISteamHTMLSurface +{ +public: + virtual ~ISteamHTMLSurface() {} + + // Must call init and shutdown when starting/ending use of the interface + virtual bool Init() = 0; + virtual bool Shutdown() = 0; + + // Create a browser object for display of a html page, when creation is complete the call handle + // will return a HTML_BrowserReady_t callback for the HHTMLBrowser of your new browser. + // The user agent string is a substring to be added to the general user agent string so you can + // identify your client on web servers. + // The userCSS string lets you apply a CSS style sheet to every displayed page, leave null if + // you do not require this functionality. + virtual SteamAPICall_t CreateBrowser( const char *pchUserAgent, const char *pchUserCSS ) = 0; + + // Call this when you are done with a html surface, this lets us free the resources being used by it + virtual void RemoveBrowser( HHTMLBrowser unBrowserHandle ) = 0; + + // Navigate to this URL, results in a HTML_StartRequest_t as the request commences + virtual void LoadURL( HHTMLBrowser unBrowserHandle, const char *pchURL, const char *pchPostData ) = 0; + + // Tells the surface the size in pixels to display the surface + virtual void SetSize( HHTMLBrowser unBrowserHandle, uint32 unWidth, uint32 unHeight ) = 0; + + // Stop the load of the current html page + virtual void StopLoad( HHTMLBrowser unBrowserHandle ) = 0; + // Reload (most likely from local cache) the current page + virtual void Reload( HHTMLBrowser unBrowserHandle ) = 0; + // navigate back in the page history + virtual void GoBack( HHTMLBrowser unBrowserHandle ) = 0; + // navigate forward in the page history + virtual void GoForward( HHTMLBrowser unBrowserHandle ) = 0; + + // add this header to any url requests from this browser + virtual void AddHeader( HHTMLBrowser unBrowserHandle, const char *pchKey, const char *pchValue ) = 0; + // run this javascript script in the currently loaded page + virtual void ExecuteJavascript( HHTMLBrowser unBrowserHandle, const char *pchScript ) = 0; + + enum EHTMLMouseButton + { + eHTMLMouseButton_Left = 0, + eHTMLMouseButton_Right = 1, + eHTMLMouseButton_Middle = 2, + }; + + // Mouse click and mouse movement commands + virtual void MouseUp( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0; + virtual void MouseDown( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0; + virtual void MouseDoubleClick( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0; + // x and y are relative to the HTML bounds + virtual void MouseMove( HHTMLBrowser unBrowserHandle, int x, int y ) = 0; + // nDelta is pixels of scroll + virtual void MouseWheel( HHTMLBrowser unBrowserHandle, int32 nDelta ) = 0; + + enum EMouseCursor + { + dc_user = 0, + dc_none, + dc_arrow, + dc_ibeam, + dc_hourglass, + dc_waitarrow, + dc_crosshair, + dc_up, + dc_sizenw, + dc_sizese, + dc_sizene, + dc_sizesw, + dc_sizew, + dc_sizee, + dc_sizen, + dc_sizes, + dc_sizewe, + dc_sizens, + dc_sizeall, + dc_no, + dc_hand, + dc_blank, // don't show any custom cursor, just use your default + dc_middle_pan, + dc_north_pan, + dc_north_east_pan, + dc_east_pan, + dc_south_east_pan, + dc_south_pan, + dc_south_west_pan, + dc_west_pan, + dc_north_west_pan, + dc_alias, + dc_cell, + dc_colresize, + dc_copycur, + dc_verticaltext, + dc_rowresize, + dc_zoomin, + dc_zoomout, + dc_help, + dc_custom, + + dc_last, // custom cursors start from this value and up + }; + + enum EHTMLKeyModifiers + { + k_eHTMLKeyModifier_None = 0, + k_eHTMLKeyModifier_AltDown = 1 << 0, + k_eHTMLKeyModifier_CtrlDown = 1 << 1, + k_eHTMLKeyModifier_ShiftDown = 1 << 2, + }; + + // keyboard interactions, native keycode is the virtual key code value from your OS + virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + virtual void KeyUp( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + // cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press) + virtual void KeyChar( HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + + // programmatically scroll this many pixels on the page + virtual void SetHorizontalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0; + virtual void SetVerticalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0; + + // tell the html control if it has key focus currently, controls showing the I-beam cursor in text controls amongst other things + virtual void SetKeyFocus( HHTMLBrowser unBrowserHandle, bool bHasKeyFocus ) = 0; + + // open the current pages html code in the local editor of choice, used for debugging + virtual void ViewSource( HHTMLBrowser unBrowserHandle ) = 0; + // copy the currently selected text on the html page to the local clipboard + virtual void CopyToClipboard( HHTMLBrowser unBrowserHandle ) = 0; + // paste from the local clipboard to the current html page + virtual void PasteFromClipboard( HHTMLBrowser unBrowserHandle ) = 0; + + // find this string in the browser, if bCurrentlyInFind is true then instead cycle to the next matching element + virtual void Find( HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse ) = 0; + // cancel a currently running find + virtual void StopFind( HHTMLBrowser unBrowserHandle ) = 0; + + // return details about the link at position x,y on the current page + virtual void GetLinkAtPosition( HHTMLBrowser unBrowserHandle, int x, int y ) = 0; + + // set a webcookie for the hostname in question + virtual void SetCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath = "/", RTime32 nExpires = 0, bool bSecure = false, bool bHTTPOnly = false ) = 0; + + // Zoom the current page by flZoom ( from 0.0 to 2.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care) + virtual void SetPageScaleFactor( HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ) = 0; + + // Enable/disable low-resource background mode, where javascript and repaint timers are throttled, resources are + // more aggressively purged from memory, and audio/video elements are paused. When background mode is enabled, + // all HTML5 video and audio objects will execute ".pause()" and gain the property "._steam_background_paused = 1". + // When background mode is disabled, any video or audio objects with that property will resume with ".play()". + virtual void SetBackgroundMode( HHTMLBrowser unBrowserHandle, bool bBackgroundMode ) = 0; + + // CALLBACKS + // + // These set of functions are used as responses to callback requests + // + + // You MUST call this in response to a HTML_StartRequest_t callback + // Set bAllowed to true to allow this navigation, false to cancel it and stay + // on the current page. You can use this feature to limit the valid pages + // allowed in your HTML surface. + virtual void AllowStartRequest( HHTMLBrowser unBrowserHandle, bool bAllowed ) = 0; + + // You MUST call this in response to a HTML_JSAlert_t or HTML_JSConfirm_t callback + // Set bResult to true for the OK option of a confirm, use false otherwise + virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0; + + // You MUST call this in response to a HTML_FileOpenDialog_t callback + virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0; +}; + +#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_003" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +//----------------------------------------------------------------------------- +// Purpose: The browser is ready for use +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages +END_DEFINE_CALLBACK_1() + + +//----------------------------------------------------------------------------- +// Purpose: the browser has a pending paint +//----------------------------------------------------------------------------- +DEFINE_CALLBACK(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) +CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint +CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called +CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture +CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture +CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update +CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update +CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update +CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update +CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered +CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered +CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered +CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages +END_DEFINE_CALLBACK_12() + + +//----------------------------------------------------------------------------- +// Purpose: The browser wanted to navigate to a new page +// NOTE - you MUST call AllowStartRequest in response to this callback +//----------------------------------------------------------------------------- +DEFINE_CALLBACK(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) +CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating +CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to +CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) +CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request +CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request +END_DEFINE_CALLBACK_5() + + +//----------------------------------------------------------------------------- +// Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) +//----------------------------------------------------------------------------- +DEFINE_CALLBACK(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) +CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface +END_DEFINE_CALLBACK_1() + + +//----------------------------------------------------------------------------- +// Purpose: the browser is navigating to a new url +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating +CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to +CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request +CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request +CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page +CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page +END_DEFINE_CALLBACK_6() + + +//----------------------------------------------------------------------------- +// Purpose: A page is finished loading +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchURL ) // +CALLBACK_MEMBER( 2, const char *, pchPageTitle ) // +END_DEFINE_CALLBACK_3() + + +//----------------------------------------------------------------------------- +// Purpose: a request to load this url in a new tab +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchURL ) // +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: the page has a new title now +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchTitle ) // +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: results from a search +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, uint32, unResults ) // +CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // +END_DEFINE_CALLBACK_3() + + +//----------------------------------------------------------------------------- +// Purpose: page history status changed on the ability to go backwards and forward +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, bool, bCanGoBack ) // +CALLBACK_MEMBER( 2, bool, bCanGoForward ) // +END_DEFINE_CALLBACK_3() + + +//----------------------------------------------------------------------------- +// Purpose: details on the visibility and size of the horizontal scrollbar +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +CALLBACK_MEMBER( 3, float, flPageScale ) // +CALLBACK_MEMBER( 4, bool , bVisible ) // +CALLBACK_MEMBER( 5, uint32, unPageSize ) // +END_DEFINE_CALLBACK_6() + + +//----------------------------------------------------------------------------- +// Purpose: details on the visibility and size of the vertical scrollbar +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +CALLBACK_MEMBER( 3, float, flPageScale ) // +CALLBACK_MEMBER( 4, bool, bVisible ) // +CALLBACK_MEMBER( 5, uint32, unPageSize ) // +END_DEFINE_CALLBACK_6() + + +//----------------------------------------------------------------------------- +// Purpose: response to GetLinkAtPosition call +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set +CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set +CALLBACK_MEMBER( 3, const char *, pchURL ) // +CALLBACK_MEMBER( 4, bool, bInput ) // +CALLBACK_MEMBER( 5, bool, bLiveLink ) // +END_DEFINE_CALLBACK_6() + + + +//----------------------------------------------------------------------------- +// Purpose: show a Javascript alert dialog, call JSDialogResponse +// when the user dismisses this dialog (or right away to ignore it) +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchMessage ) // +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: show a Javascript confirmation dialog, call JSDialogResponse +// when the user dismisses this dialog (or right away to ignore it) +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchMessage ) // +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: when received show a file open dialog +// then call FileLoadDialogResponse with the file(s) the user selected. +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchTitle ) // +CALLBACK_MEMBER( 2, const char *, pchInitialFile ) // +END_DEFINE_CALLBACK_3() + + +//----------------------------------------------------------------------------- +// Purpose: a new html window has been created +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface +CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load +CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup +CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup +CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture +CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture +CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle ) // the handle of the new window surface +END_DEFINE_CALLBACK_7() + + +//----------------------------------------------------------------------------- +// Purpose: change the cursor to display +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor to display +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: informational message from the browser +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: show a tooltip +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: update the text of an existing tooltip +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +END_DEFINE_CALLBACK_2() + + +//----------------------------------------------------------------------------- +// Purpose: hide the tooltip you are showing +//----------------------------------------------------------------------------- +DEFINE_CALLBACK( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) +CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +END_DEFINE_CALLBACK_1() + + +#pragma pack( pop ) + + +#endif // ISTEAMHTMLSURFACE_H diff --git a/public/steam/isteamhttp.h b/public/steam/isteamhttp.h new file mode 100644 index 000000000..8fab537de --- /dev/null +++ b/public/steam/isteamhttp.h @@ -0,0 +1,210 @@ +//====== Copyright © 1996-2009, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to http client +// +//============================================================================= + +#ifndef ISTEAMHTTP_H +#define ISTEAMHTTP_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" +#include "steamhttpenums.h" + +// Handle to a HTTP Request handle +typedef uint32 HTTPRequestHandle; +#define INVALID_HTTPREQUEST_HANDLE 0 + +typedef uint32 HTTPCookieContainerHandle; +#define INVALID_HTTPCOOKIE_HANDLE 0 + +//----------------------------------------------------------------------------- +// Purpose: interface to http client +//----------------------------------------------------------------------------- +class ISteamHTTP +{ +public: + + // Initializes a new HTTP request, returning a handle to use in further operations on it. Requires + // the method (GET or POST) and the absolute URL for the request. Both http and https are supported, + // so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/ + // or such. + virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, const char *pchAbsoluteURL ) = 0; + + // Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after + // sending the request. This is just so the caller can easily keep track of which callbacks go with which request data. + virtual bool SetHTTPRequestContextValue( HTTPRequestHandle hRequest, uint64 ulContextValue ) = 0; + + // Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default + // timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request + // has already been sent. + virtual bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest, uint32 unTimeoutSeconds ) = 0; + + // Set a request header value for the request, must be called prior to sending the request. Will + // return false if the handle is invalid or the request is already sent. + virtual bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, const char *pchHeaderValue ) = 0; + + // Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified + // when creating the request. Must be called prior to sending the request. Will return false if the + // handle is invalid or the request is already sent. + virtual bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, const char *pchParamName, const char *pchParamValue ) = 0; + + // Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on + // asynchronous response via callback. + // + // Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control + // header and only do a local cache lookup rather than sending any actual remote request. + virtual bool SendHTTPRequest( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0; + + // Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on + // asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and + // HTTPRequestDataReceived_t callbacks while streaming. + virtual bool SendHTTPRequestAndStreamResponse( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0; + + // Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move + // the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent. + virtual bool DeferHTTPRequest( HTTPRequestHandle hRequest ) = 0; + + // Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move + // the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent. + virtual bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest ) = 0; + + // Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also + // returns the size of the header value if present so the caller and allocate a correctly sized buffer for + // GetHTTPResponseHeaderValue. + virtual bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, const char *pchHeaderName, uint32 *unResponseHeaderSize ) = 0; + + // Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the + // header is not present or if your buffer is too small to contain it's value. You should first call + // BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed. + virtual bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 unBufferSize ) = 0; + + // Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the + // handle is invalid. + virtual bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest, uint32 *unBodySize ) = 0; + + // Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the + // handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out + // the correct buffer size to use. + virtual bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0; + + // Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the + // handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset + // do not match the size and offset sent in HTTPRequestDataReceived_t. + virtual bool GetHTTPStreamingResponseBodyData( HTTPRequestHandle hRequest, uint32 cOffset, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0; + + // Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t + // callback and finishing using the response. + virtual bool ReleaseHTTPRequest( HTTPRequestHandle hRequest ) = 0; + + // Gets progress on downloading the body for the request. This will be zero unless a response header has already been + // received which included a content-length field. For responses that contain no content-length it will report + // zero for the duration of the request as the size is unknown until the connection closes. + virtual bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, float *pflPercentOut ) = 0; + + // Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params + // have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType + // parameter will set the content-type header for the request so the server may know how to interpret the body. + virtual bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen ) = 0; + + // Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true + // than any response to your requests using this cookie container may add new cookies which may be transmitted with + // future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for + // during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across + // repeat executions of your process. + virtual HTTPCookieContainerHandle CreateCookieContainer( bool bAllowResponsesToModify ) = 0; + + // Release a cookie container you are finished using, freeing it's memory + virtual bool ReleaseCookieContainer( HTTPCookieContainerHandle hCookieContainer ) = 0; + + // Adds a cookie to the specified cookie container that will be used with future requests. + virtual bool SetCookie( HTTPCookieContainerHandle hCookieContainer, const char *pchHost, const char *pchUrl, const char *pchCookie ) = 0; + + // Set the cookie container to use for a HTTP request + virtual bool SetHTTPRequestCookieContainer( HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ) = 0; + + // Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end + virtual bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, const char *pchUserAgentInfo ) = 0; + + // Set that https request should require verified SSL certificate via machines certificate trust store + virtual bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate ) = 0; + + // Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout + // which can bump everytime we get more data + virtual bool SetHTTPRequestAbsoluteTimeoutMS( HTTPRequestHandle hRequest, uint32 unMilliseconds ) = 0; + + // Check if the reason the request failed was because we timed it out (rather than some harder failure) + virtual bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest, bool *pbWasTimedOut ) = 0; +}; + +#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION002" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +struct HTTPRequestCompleted_t +{ + enum { k_iCallback = k_iClientHTTPCallbacks + 1 }; + + // Handle value for the request that has completed. + HTTPRequestHandle m_hRequest; + + // Context value that the user defined on the request that this callback is associated with, 0 if + // no context value was set. + uint64 m_ulContextValue; + + // This will be true if we actually got any sort of response from the server (even an error). + // It will be false if we failed due to an internal error or client side network failure. + bool m_bRequestSuccessful; + + // Will be the HTTP status code value returned by the server, k_EHTTPStatusCode200OK is the normal + // OK response, if you get something else you probably need to treat it as a failure. + EHTTPStatusCode m_eStatusCode; + + uint32 m_unBodySize; // Same as GetHTTPResponseBodySize() +}; + + +struct HTTPRequestHeadersReceived_t +{ + enum { k_iCallback = k_iClientHTTPCallbacks + 2 }; + + // Handle value for the request that has received headers. + HTTPRequestHandle m_hRequest; + + // Context value that the user defined on the request that this callback is associated with, 0 if + // no context value was set. + uint64 m_ulContextValue; +}; + +struct HTTPRequestDataReceived_t +{ + enum { k_iCallback = k_iClientHTTPCallbacks + 3 }; + + // Handle value for the request that has received data. + HTTPRequestHandle m_hRequest; + + // Context value that the user defined on the request that this callback is associated with, 0 if + // no context value was set. + uint64 m_ulContextValue; + + + // Offset to provide to GetHTTPStreamingResponseBodyData to get this chunk of data + uint32 m_cOffset; + + // Size to provide to GetHTTPStreamingResponseBodyData to get this chunk of data + uint32 m_cBytesReceived; +}; + + +#pragma pack( pop ) + +#endif // ISTEAMHTTP_H \ No newline at end of file diff --git a/public/steam/isteaminventory.h b/public/steam/isteaminventory.h new file mode 100644 index 000000000..3802dafeb --- /dev/null +++ b/public/steam/isteaminventory.h @@ -0,0 +1,354 @@ +//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to Steam Inventory +// +//============================================================================= + +#ifndef ISTEAMINVENTORY_H +#define ISTEAMINVENTORY_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +// Every individual instance of an item has a globally-unique ItemInstanceID. +// This ID is unique to the combination of (player, specific item instance) +// and will not be transferred to another player or re-used for another item. +typedef uint64 SteamItemInstanceID_t; + +static const SteamItemInstanceID_t k_SteamItemInstanceIDInvalid = ~(SteamItemInstanceID_t)0; + +// Types of items in your game are identified by a 32-bit "item definition number". +// Valid definition numbers are between 1 and 999999999; numbers less than or equal to +// zero are invalid, and numbers greater than or equal to one billion (1x10^9) are +// reserved for internal Steam use. +typedef int32 SteamItemDef_t; + + +enum ESteamItemFlags +{ + // Item status flags - these flags are permanently attached to specific item instances + k_ESteamItemNoTrade = 1 << 0, // This item is account-locked and cannot be traded or given away. + + // Action confirmation flags - these flags are set one time only, as part of a result set + k_ESteamItemRemoved = 1 << 8, // The item has been destroyed, traded away, expired, or otherwise invalidated + k_ESteamItemConsumed = 1 << 9, // The item quantity has been decreased by 1 via ConsumeItem API. + + // All other flag bits are currently reserved for internal Steam use at this time. + // Do not assume anything about the state of other flags which are not defined here. +}; + +struct SteamItemDetails_t +{ + SteamItemInstanceID_t m_itemId; + SteamItemDef_t m_iDefinition; + uint16 m_unQuantity; + uint16 m_unFlags; // see ESteamItemFlags +}; + +typedef int32 SteamInventoryResult_t; + +static const SteamInventoryResult_t k_SteamInventoryResultInvalid = -1; + + +//----------------------------------------------------------------------------- +// Purpose: Steam Inventory query and manipulation API +//----------------------------------------------------------------------------- +class ISteamInventory +{ +public: + + // INVENTORY ASYNC RESULT MANAGEMENT + // + // Asynchronous inventory queries always output a result handle which can be used with + // GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will + // be triggered when the asynchronous result becomes ready (or fails). + // + + // Find out the status of an asynchronous inventory result handle. Possible values: + // k_EResultPending - still in progress + // k_EResultOK - done, result ready + // k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult) + // k_EResultInvalidParam - ERROR: invalid API call parameters + // k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later + // k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits + // k_EResultFail - ERROR: unknown / generic error + METHOD_DESC(Find out the status of an asynchronous inventory result handle.) + virtual EResult GetResultStatus( SteamInventoryResult_t resultHandle ) = 0; + + // Copies the contents of a result set into a flat array. The specific + // contents of the result set depend on which query which was used. + METHOD_DESC(Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.) + virtual bool GetResultItems( SteamInventoryResult_t resultHandle, + OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray, + uint32 *punOutItemsArraySize ) = 0; + + // Returns the server time at which the result was generated. Compare against + // the value of IClientUtils::GetServerRealTime() to determine age. + METHOD_DESC(Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.) + virtual uint32 GetResultTimestamp( SteamInventoryResult_t resultHandle ) = 0; + + // Returns true if the result belongs to the target steam ID, false if the + // result does not. This is important when using DeserializeResult, to verify + // that a remote player is not pretending to have a different user's inventory. + METHOD_DESC(Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.) + virtual bool CheckResultSteamID( SteamInventoryResult_t resultHandle, CSteamID steamIDExpected ) = 0; + + // Destroys a result handle and frees all associated memory. + METHOD_DESC(Destroys a result handle and frees all associated memory.) + virtual void DestroyResult( SteamInventoryResult_t resultHandle ) = 0; + + + // INVENTORY ASYNC QUERY + // + + // Captures the entire state of the current user's Steam inventory. + // You must call DestroyResult on this handle when you are done with it. + // Returns false and sets *pResultHandle to zero if inventory is unavailable. + // Note: calls to this function are subject to rate limits and may return + // cached results if called too frequently. It is suggested that you call + // this function only when you are about to display the user's full inventory, + // or if you expect that the inventory may have changed. + METHOD_DESC(Captures the entire state of the current users Steam inventory.) + virtual bool GetAllItems( SteamInventoryResult_t *pResultHandle ) = 0; + + + // Captures the state of a subset of the current user's Steam inventory, + // identified by an array of item instance IDs. The results from this call + // can be serialized and passed to other players to "prove" that the current + // user owns specific items, without exposing the user's entire inventory. + // For example, you could call GetItemsByID with the IDs of the user's + // currently equipped cosmetic items and serialize this to a buffer, and + // then transmit this buffer to other players upon joining a game. + METHOD_DESC(Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.) + virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0; + + + // RESULT SERIALIZATION AND AUTHENTICATION + // + // Serialized result sets contain a short signature which can't be forged + // or replayed across different game sessions. A result set can be serialized + // on the local client, transmitted to other players via your game networking, + // and deserialized by the remote players. This is a secure way of preventing + // hackers from lying about posessing rare/high-value items. + + // Serializes a result set with signature bytes to an output buffer. Pass + // NULL as an output buffer to get the required size via punOutBufferSize. + // The size of a serialized result depends on the number items which are being + // serialized. When securely transmitting items to other players, it is + // recommended to use "GetItemsByID" first to create a minimal result set. + // Results have a built-in timestamp which will be considered "expired" after + // an hour has elapsed. See DeserializeResult for expiration handling. + virtual bool SerializeResult( SteamInventoryResult_t resultHandle, OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize ) = 0; + + // Deserializes a result set and verifies the signature bytes. Returns false + // if bRequireFullOnlineVerify is set but Steam is running in Offline mode. + // Otherwise returns true and then delivers error codes via GetResultStatus. + // + // The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not + // be set to true by your game at this time. + // + // DeserializeResult has a potential soft-failure mode where the handle status + // is set to k_EResultExpired. GetResultItems() still succeeds in this mode. + // The "expired" result could indicate that the data may be out of date - not + // just due to timed expiration (one hour), but also because one of the items + // in the result set may have been traded or consumed since the result set was + // generated. You could compare the timestamp from GetResultTimestamp() to + // ISteamUtils::GetServerRealTime() to determine how old the data is. You could + // simply ignore the "expired" result code and continue as normal, or you + // could challenge the player with expired data to send an updated result set. + virtual bool DeserializeResult( SteamInventoryResult_t *pOutResultHandle, BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0; + + + // INVENTORY ASYNC MODIFICATION + // + + // GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t + // notification with a matching nCallbackContext parameter. This API is insecure, and could + // be abused by hacked clients. It is, however, very useful as a development cheat or as + // a means of prototyping item-related features for your game. The use of GenerateItems can + // be restricted to certain item definitions or fully blocked via the Steamworks website. + // If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should + // describe the quantity of each item to generate. + virtual bool GenerateItems( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + + // GrantPromoItems() checks the list of promotional items for which the user may be eligible + // and grants the items (one time only). On success, the result set will include items which + // were granted, if any. If no items were granted because the user isn't eligible for any + // promotions, this is still considered a success. + METHOD_DESC(GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).) + virtual bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) = 0; + + // AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of + // scanning for all eligible promotional items, the check is restricted to a single item + // definition or set of item definitions. This can be useful if your game has custom UI for + // showing a specific promo item to the user. + virtual bool AddPromoItem( SteamInventoryResult_t *pResultHandle, SteamItemDef_t itemDef ) = 0; + virtual bool AddPromoItems( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) = 0; + + // ConsumeItem() removes items from the inventory, permanently. They cannot be recovered. + // Not for the faint of heart - if your game implements item removal at all, a high-friction + // UI confirmation process is highly recommended. Similar to GenerateItems, punArrayQuantity + // can be NULL or else an array of the same length as pArrayItems which describe the quantity + // of each item to destroy. ConsumeItem can be restricted to certain item definitions or + // fully blocked via the Steamworks website to minimize support/abuse issues such as the + // clasic "my brother borrowed my laptop and deleted all of my rare items". + METHOD_DESC(ConsumeItem() removes items from the inventory permanently.) + virtual bool ConsumeItem( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ) = 0; + + // ExchangeItems() is an atomic combination of GenerateItems and DestroyItems. It can be + // used to implement crafting recipes or transmutations, or items which unpack themselves + // into other items. Like GenerateItems, this is a flexible and dangerous API which is + // meant for rapid prototyping. You can configure restrictions on ExchangeItems via the + // Steamworks website, such as limiting it to a whitelist of input/output combinations + // corresponding to recipes. + // (Note: although GenerateItems may be hard or impossible to use securely in your game, + // ExchangeItems is perfectly reasonable to use once the whitelists are set accordingly.) + virtual bool ExchangeItems( SteamInventoryResult_t *pResultHandle, + ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength, + ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0; + + + // TransferItemQuantity() is intended for use with items which are "stackable" (can have + // quantity greater than one). It can be used to split a stack into two, or to transfer + // quantity from one stack into another stack of identical items. To split one stack into + // two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated. + virtual bool TransferItemQuantity( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest ) = 0; + + + // TIMED DROPS AND PLAYTIME CREDIT + // + + // Applications which use timed-drop mechanics should call SendItemDropHeartbeat() when + // active gameplay begins, and at least once every two minutes afterwards. The backend + // performs its own time calculations, so the precise timing of the heartbeat is not + // critical as long as you send at least one heartbeat every two minutes. Calling the + // function more often than that is not harmful, it will simply have no effect. Note: + // players may be able to spoof this message by hacking their client, so you should not + // attempt to use this as a mechanism to restrict playtime credits. It is simply meant + // to distinguish between being in any kind of gameplay situation vs the main menu or + // a pre-game launcher window. (If you are stingy with handing out playtime credit, it + // will only encourage players to run bots or use mouse/kb event simulators.) + // + // Playtime credit accumulation can be capped on a daily or weekly basis through your + // Steamworks configuration. + // + METHOD_DESC(Applications which use timed-drop mechanics should call SendItemDropHeartbeat() when active gameplay begins and at least once every two minutes afterwards.) + virtual void SendItemDropHeartbeat() = 0; + + // Playtime credit must be consumed and turned into item drops by your game. Only item + // definitions which are marked as "playtime item generators" can be spawned. The call + // will return an empty result set if there is not enough playtime credit for a drop. + // Your game should call TriggerItemDrop at an appropriate time for the user to receive + // new items, such as between rounds or while the player is dead. Note that players who + // hack their clients could modify the value of "dropListDefinition", so do not use it + // to directly control rarity. It is primarily useful during testing and development, + // where you may wish to perform experiments with different types of drops. + METHOD_DESC(Playtime credit must be consumed and turned into item drops by your game.) + virtual bool TriggerItemDrop( SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition ) = 0; + + + // IN-GAME TRADING + // + // TradeItems() implements limited in-game trading of items, if you prefer not to use + // the overlay or an in-game web browser to perform Steam Trading through the website. + // You should implement a UI where both players can see and agree to a trade, and then + // each client should call TradeItems simultaneously (+/- 5 seconds) with matching + // (but reversed) parameters. The result is the same as if both players performed a + // Steam Trading transaction through the web. Each player will get an inventory result + // confirming the removal or quantity changes of the items given away, and the new + // item instance id numbers and quantities of the received items. + // (Note: new item instance IDs are generated whenever an item changes ownership.) + virtual bool TradeItems( SteamInventoryResult_t *pResultHandle, CSteamID steamIDTradePartner, + ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength, + ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0; + + + // ITEM DEFINITIONS + // + // Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000) + // to a set of string properties. Some of these properties are required to display items + // on the Steam community web site. Other properties can be defined by applications. + // Use of these functions is optional; there is no reason to call LoadItemDefinitions + // if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue + // weapon mod = 55) and does not allow for adding new item types without a client patch. + // + + // LoadItemDefinitions triggers the automatic load and refresh of item definitions. + // Every time new item definitions are available (eg, from the dynamic addition of new + // item types while players are still in-game), a SteamInventoryDefinitionUpdate_t + // callback will be fired. + METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of item definitions.) + virtual bool LoadItemDefinitions() = 0; + + // GetItemDefinitionIDs returns the set of all defined item definition IDs (which are + // defined via Steamworks configuration, and not necessarily contiguous integers). + // If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will + // contain the total size necessary for a subsequent call. Otherwise, the call will + // return false if and only if there is not enough space in the output array. + virtual bool GetItemDefinitionIDs( + OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + + // GetItemDefinitionProperty returns a string property from a given item definition. + // Note that some properties (for example, "name") may be localized and will depend + // on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage). + // Property names are always composed of ASCII letters, numbers, and/or underscores. + // Pass a NULL pointer for pchPropertyName to get a comma - separated list of available + // property names. + virtual bool GetItemDefinitionProperty( SteamItemDef_t iDefinition, const char *pchPropertyName, + OUT_STRING_COUNT(punValueBufferSize) char *pchValueBuffer, uint32 *punValueBufferSize ) = 0; +}; + +#define STEAMINVENTORY_INTERFACE_VERSION "STEAMINVENTORY_INTERFACE_V001" + + +// SteamInventoryResultReady_t callbacks are fired whenever asynchronous +// results transition from "Pending" to "OK" or an error state. There will +// always be exactly one callback per handle. +struct SteamInventoryResultReady_t +{ + enum { k_iCallback = k_iClientInventoryCallbacks + 0 }; + SteamInventoryResult_t m_handle; + EResult m_result; +}; + + +// SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems +// successfully returns a result which is newer / fresher than the last +// known result. (It will not trigger if the inventory hasn't changed, +// or if results from two overlapping calls are reversed in flight and +// the earlier result is already known to be stale/out-of-date.) +// The normal ResultReady callback will still be triggered immediately +// afterwards; this is an additional notification for your convenience. +struct SteamInventoryFullUpdate_t +{ + enum { k_iCallback = k_iClientInventoryCallbacks + 1 }; + SteamInventoryResult_t m_handle; +}; + + +// A SteamInventoryDefinitionUpdate_t callback is triggered whenever +// item definitions have been updated, which could be in response to +// LoadItemDefinitions() or any other async request which required +// a definition update in order to process results from the server. +struct SteamInventoryDefinitionUpdate_t +{ + enum { k_iCallback = k_iClientInventoryCallbacks + 2 }; +}; + +#pragma pack( pop ) + + +#endif // ISTEAMCONTROLLER_H diff --git a/public/steam/isteammasterserverupdater.h b/public/steam/isteammasterserverupdater.h index 9ea09a8b4..9f2e712e5 100644 --- a/public/steam/isteammasterserverupdater.h +++ b/public/steam/isteammasterserverupdater.h @@ -1,103 +1,2 @@ -//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to steam for retrieving list of game servers -// -//============================================================================= - -#ifndef ISTEAMMASTERSERVERUPDATER_H -#define ISTEAMMASTERSERVERUPDATER_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1) - - -//----------------------------------------------------------------------------- -// Purpose: Game engines use this to tell the Steam master servers -// about their games so their games can show up in the server browser. -//----------------------------------------------------------------------------- -class ISteamMasterServerUpdater -{ -public: - - // Call this as often as you like to tell the master server updater whether or not - // you want it to be active (default: off). - virtual void SetActive( bool bActive ) = 0; - - // You usually don't need to modify this. - // Pass -1 to use the default value for iHeartbeatInterval. - // Some mods change this. - virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0; - - -// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own -// socket to talk to the master server on, it lets the game use its socket to forward messages -// back and forth. This prevents us from requiring server ops to open up yet another port -// in their firewalls. -// -// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001 - - // These are used when you've elected to multiplex the game server's UDP socket - // rather than having the master server updater use its own sockets. - // - // Source games use this to simplify the job of the server admins, so they - // don't have to open up more ports on their firewalls. - - // Call this when a packet that starts with 0xFFFFFFFF comes in. That means - // it's for us. - virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0; - - // AFTER calling HandleIncomingPacket for any packets that came in that frame, call this. - // This gets a packet that the master server updater needs to send out on UDP. - // It returns the length of the packet it wants to send, or 0 if there are no more packets to send. - // Call this each frame until it returns 0. - virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0; - - -// Functions to set various fields that are used to respond to queries. - - // Call this to set basic data that is passed to the server browser. - virtual void SetBasicServerData( - unsigned short nProtocolVersion, - bool bDedicatedServer, - const char *pRegionName, - const char *pProductName, - unsigned short nMaxReportedClients, - bool bPasswordProtected, - const char *pGameDescription ) = 0; - - // Call this to clear the whole list of key/values that are sent in rules queries. - virtual void ClearAllKeyValues() = 0; - - // Call this to add/update a key/value pair. - virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0; - - - // You can call this upon shutdown to clear out data stored for this game server and - // to tell the master servers that this server is going away. - virtual void NotifyShutdown() = 0; - - // Returns true if the master server has requested a restart. - // Only returns true once per request. - virtual bool WasRestartRequested() = 0; - - // Force it to request a heartbeat from the master servers. - virtual void ForceHeartbeat() = 0; - - // Manually edit and query the master server list. - // It will provide name resolution and use the default master server port if none is provided. - virtual bool AddMasterServer( const char *pServerAddress ) = 0; - virtual bool RemoveMasterServer( const char *pServerAddress ) = 0; - - virtual int GetNumMasterServers() = 0; - - // Returns the # of bytes written to pOut. - virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0; -}; - -#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001" - -#endif // ISTEAMMASTERSERVERUPDATER_H +//========= Copyright Valve Corporation, All rights reserved. ============// +#error "This file isn't used any more" diff --git a/public/steam/isteammatchmaking.h b/public/steam/isteammatchmaking.h index 0a2e214d9..e3be340d9 100644 --- a/public/steam/isteammatchmaking.h +++ b/public/steam/isteammatchmaking.h @@ -1,300 +1,747 @@ -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to steam managing game server/client match making -// -//============================================================================= -#ifndef ISTEAMMATCHMAKING -#define ISTEAMMATCHMAKING -#ifdef _WIN32 -#pragma once -#endif - -#include "steamtypes.h" -#include "steamclientpublic.h" -#include "matchmakingtypes.h" -#include "isteamclient.h" -#include "isteamfriends.h" - -// 32KB max size on chat messages -enum { k_cchFriendChatMsgMax = 32 * 1024 }; - -//----------------------------------------------------------------------------- -// Purpose: Functions for match making services for clients to get to favorites -//----------------------------------------------------------------------------- -class ISteamMatchmaking -{ -public: - virtual int GetFavoriteGameCount() = 0; - - // Obsolete. Use the ...2 versions of these functions, which take separate connection and query ports. - virtual bool GetFavoriteGame( int iGame, uint32 *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; - virtual int AddFavoriteGame( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0; - virtual bool RemoveFavoriteGame( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint32 unFlags ) = 0; - - - // returns the details of the game server - // iGame is of range [0,iGame) - virtual bool GetFavoriteGame2( int iGame, uint32 *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; - - // returns the new index of the game - virtual int AddFavoriteGame2( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0; - - // removes the game; returns true if one was removed - virtual bool RemoveFavoriteGame2( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; - - /////// - // Game lobby functions - - // Get a list of relevant lobbies - virtual void RequestLobbyList( uint64 ulGameID, MatchMakingKeyValuePair_t *pFilters, uint32 nFilters ) = 0; - virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; - // Create a lobby - you'll get the SteamID of it on success - virtual void CreateLobby( uint64 ulGameID, bool bPrivate ) = 0; - // Join a lobby - virtual void JoinLobby( CSteamID steamIDLobby ) = 0; - // Leave a lobby - virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; - // Invite someone to the lobby - virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; - // List users in this lobby - virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; - virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; - // Get data associated with this lobby - virtual const char *GetLobbyData( CSteamID SteamIDLobby, const char *pchKey ) = 0; - // Update lobby data (Admin only) - virtual void SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; - // Get per-user data for someone in this lobby - virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; - // Update user data (for you only) - virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; - // change the lobby Admin (Admin only) - virtual void ChangeLobbyAdmin( CSteamID steamIDLobby, CSteamID steamIDNewAdmin ) = 0; - // Send a chat message to the lobby - virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; - // Get a chat message entry - virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; - -}; -#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking001" - - -//----------------------------------------------------------------------------- -// Purpose: Callback interfaces for server list functions -//----------------------------------------------------------------------------- -class ISteamMatchmakingServerListResponse -{ -public: - virtual void ServerResponded( int iServer ) = 0; - virtual void ServerFailedToRespond( int iServer ) = 0; - virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0; -}; - -class ISteamMatchmakingPingResponse -{ -public: - virtual void ServerResponded( gameserveritem_t &server ) = 0; - virtual void ServerFailedToRespond() = 0; -}; - -class ISteamMatchmakingPlayersResponse -{ -public: - virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0; - virtual void PlayersFailedToRespond() = 0; - virtual void PlayersRefreshComplete() = 0; -}; - - -class ISteamMatchmakingRulesResponse -{ -public: - virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0; - virtual void RulesFailedToRespond() = 0; - virtual void RulesRefreshComplete() = 0; -}; - -typedef int HServerQuery; -const int HSERVERQUERY_INVALID = 0xffffffff; - -//----------------------------------------------------------------------------- -// Purpose: Functions for match making services for clients to get to game servers -//----------------------------------------------------------------------------- -class ISteamMatchmakingServers -{ -public: - // request a new list of servers of a particular type - virtual void RequestInternetServerList( uint32 iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual void RequestLANServerList( uint32 iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual void RequestFriendsServerList( uint32 iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual void RequestFavoritesServerList( uint32 iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual void RequestHistoryServerList( uint32 iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual void RequestSpectatorServerList( uint32 iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - - virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0; - - virtual void CancelQuery( EMatchMakingType eType ) = 0; // stop getting new servers from an earlier query - virtual void RefreshQuery( EMatchMakingType eType ) = 0; // ping every server in your list again but don't update the list of servers - virtual bool IsRefreshing( EMatchMakingType eType ) = 0; // returns true if the list is currently refreshing its server list - virtual int GetServerCount( EMatchMakingType eType ) = 0; // how many servers in this list, GetServerDetails takes 0... GetServerCount() - 1 - virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0; // refresh a single server inside of a query (rather than all the servers ) - - // queries to individual servers - virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0; // request details from a single server - virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0; // get a list of players from a server - virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0; // get the rules that server is running - virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0; // cancel an outstanding query from above -}; -#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001" - -//----------------------------------------------------------------------------- -// Callbacks -//----------------------------------------------------------------------------- - -// game server flags -const uint32 k_unFavoriteFlagNone = 0x00; -const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list -const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list - -// callbacks - - -// a server was added/removed from the favorites list, you should refresh now -struct FavoritesListChanged_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 }; // +2 as +1 was a previous version of this call with a different layout - uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server - uint32 m_nQueryPort; - uint32 m_nConnPort; - uint32 m_nAppID; - uint32 m_nFlags; - bool m_bAdd; // true if this is adding the entry, otherwise it is a remove -}; - -//----------------------------------------------------------------------------- -// Purpose: Someone has invited you to join a Lobby -//----------------------------------------------------------------------------- -struct LobbyInvite_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 }; - - uint64 m_ulSteamIDUser; // Steam ID of the person making the invite - uint64 m_ulSteamIDLobby; // Steam ID of the Lobby -}; - -//----------------------------------------------------------------------------- -// Purpose: You have entered a Lobby -//----------------------------------------------------------------------------- -struct LobbyEnter_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 }; - - uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered - uint32 m_rgfChatPermissions; // Permissions of the current user - bool m_bLocked; // If true, then only invited users may join - uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse -}; - -//----------------------------------------------------------------------------- -// Purpose: The lobby data has changed -//----------------------------------------------------------------------------- -struct LobbyDataUpdate_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 }; - - uint64 m_ulSteamIDLobby; // steamID of the Lobby - uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself -}; - - -//----------------------------------------------------------------------------- -// Purpose: The lobby chat room state has changed -//----------------------------------------------------------------------------- -struct LobbyChatUpdate_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 }; - - uint64 m_ulSteamIDLobby; // Lobby ID - uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient - uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.) - uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values -}; - -//----------------------------------------------------------------------------- -// Purpose: A chat message for this lobby -//----------------------------------------------------------------------------- -struct LobbyChatMsg_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 }; - - uint64 m_ulSteamIDLobby; // the lobby id this is in - uint64 m_ulSteamIDUser; // steamID of the user who has sent this message - uint8 m_eChatEntryType; // type of message - uint32 m_iChatID; // index of the chat entry to lookup -}; - -//----------------------------------------------------------------------------- -// Purpose: There's a change of Admin in this Lobby -//----------------------------------------------------------------------------- -struct LobbyAdminChange_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 8 }; - - uint64 m_ulSteamIDLobby; - uint64 m_ulSteamIDNewAdmin; -}; - - -//----------------------------------------------------------------------------- -// Purpose: The Admin of a Lobby has created a game to join -//----------------------------------------------------------------------------- -struct LobbyGameCreated_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 }; - - uint64 m_ulSteamIDLobby; - uint32 m_unIP; - uint16 m_usPort; -}; - -//----------------------------------------------------------------------------- -// Purpose: Number of matching lobbies found, iterate with GetLobbyByIndex -//----------------------------------------------------------------------------- -struct LobbyMatchList_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 }; - uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for -}; - - -//----------------------------------------------------------------------------- -// Purpose: The Lobby is closing -//----------------------------------------------------------------------------- -struct LobbyClosing_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 11 }; - uint64 m_ulSteamIDLobby; // Lobby -}; - - -//----------------------------------------------------------------------------- -// Purpose: You have been kicked from the lobby -//----------------------------------------------------------------------------- -struct LobbyKicked_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 }; - uint64 m_ulSteamIDLobby; // Lobby - uint64 m_ulSteamIDAdmin; // User who kicked you -}; - - -//----------------------------------------------------------------------------- -// Purpose: Result of our request to create a Lobby -//----------------------------------------------------------------------------- -struct LobbyCreate_t -{ - enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 }; - EResult m_eResult; // Result - uint64 m_ulSteamIDLobby; // chat room, zero if failed -}; - -#endif // ISTEAMMATCHMAKING +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam managing game server/client match making +// +//============================================================================= + +#ifndef ISTEAMMATCHMAKING +#define ISTEAMMATCHMAKING +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" +#include "matchmakingtypes.h" +#include "isteamclient.h" +#include "isteamfriends.h" + +// lobby type description +enum ELobbyType +{ + k_ELobbyTypePrivate = 0, // only way to join the lobby is to invite to someone else + k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list + k_ELobbyTypePublic = 2, // visible for friends and in lobby list + k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends + // useful if you want a user in two lobbies, for example matching groups together + // a user can be in only one regular lobby, and up to two invisible lobbies +}; + +// lobby search filter tools +enum ELobbyComparison +{ + k_ELobbyComparisonEqualToOrLessThan = -2, + k_ELobbyComparisonLessThan = -1, + k_ELobbyComparisonEqual = 0, + k_ELobbyComparisonGreaterThan = 1, + k_ELobbyComparisonEqualToOrGreaterThan = 2, + k_ELobbyComparisonNotEqual = 3, +}; + +// lobby search distance. Lobby results are sorted from closest to farthest. +enum ELobbyDistanceFilter +{ + k_ELobbyDistanceFilterClose, // only lobbies in the same immediate region will be returned + k_ELobbyDistanceFilterDefault, // only lobbies in the same region or near by regions + k_ELobbyDistanceFilterFar, // for games that don't have many latency requirements, will return lobbies about half-way around the globe + k_ELobbyDistanceFilterWorldwide, // no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients) +}; + +// maximum number of characters a lobby metadata key can be +#define k_nMaxLobbyKeyLength 255 + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamMatchmaking +{ +public: + // game server favorites storage + // saves basic details about a multiplayer game server locally + + // returns the number of favorites servers the user has stored + virtual int GetFavoriteGameCount() = 0; + + // returns the details of the game server + // iGame is of range [0,GetFavoriteGameCount()) + // *pnIP, *pnConnPort are filled in the with IP:port of the game server + // *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections + // *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added + virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; + + // adds the game server to the local list; updates the time played of the server if it already exists in the list + virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) = 0; + + // removes the game server from the local storage; returns true if one was removed + virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; + + /////// + // Game lobby functions + + // Get a list of relevant lobbies + // this is an asynchronous request + // results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found + // this will never return lobbies that are full + // to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call + // use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g. + /* + class CMyLobbyListManager + { + CCallResult m_CallResultLobbyMatchList; + void FindLobbies() + { + // SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList() + SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList(); + m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList ); + } + + void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure ) + { + // lobby list has be retrieved from Steam back-end, use results + } + } + */ + // + virtual SteamAPICall_t RequestLobbyList() = 0; + // filters for lobbies + // this needs to be called before RequestLobbyList() to take effect + // these are cleared on each call to RequestLobbyList() + virtual void AddRequestLobbyListStringFilter( const char *pchKeyToMatch, const char *pchValueToMatch, ELobbyComparison eComparisonType ) = 0; + // numerical comparison + virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType ) = 0; + // returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence + virtual void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo ) = 0; + // returns only lobbies with the specified number of slots available + virtual void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) = 0; + // sets the distance for which we should search for lobbies (based on users IP address to location map on the Steam backed) + virtual void AddRequestLobbyListDistanceFilter( ELobbyDistanceFilter eLobbyDistanceFilter ) = 0; + // sets how many results to return, the lower the count the faster it is to download the lobby results & details to the client + virtual void AddRequestLobbyListResultCountFilter( int cMaxResults ) = 0; + + virtual void AddRequestLobbyListCompatibleMembersFilter( CSteamID steamIDLobby ) = 0; + + // returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call + // should only be called after a LobbyMatchList_t callback is received + // iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching) + // the returned CSteamID::IsValid() will be false if iLobby is out of range + virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; + + // Create a lobby on the Steam servers. + // If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID + // of the lobby will need to be communicated via game channels or via InviteUserToLobby() + // this is an asynchronous request + // results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this point + // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) + virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers ) = 0; + + // Joins an existing lobby + // this is an asynchronous request + // results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful + // lobby metadata is available to use immediately on this call completing + virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0; + + // Leave a lobby; this will take effect immediately on the client side + // other users in the lobby will be notified by a LobbyChatUpdate_t callback + virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; + + // Invite another user to the lobby + // the target user will receive a LobbyInvite_t callback + // will return true if the invite is successfully sent, whether or not the target responds + // returns false if the local user is not connected to the Steam servers + // if the other user clicks the join link, a GameLobbyJoinRequested_t will be posted if the user is in-game, + // or if the game isn't running yet the game will be launched with the parameter +connect_lobby <64-bit lobby id> + virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; + + // Lobby iteration, for viewing details of users in a lobby + // only accessible if the lobby user is a member of the specified lobby + // persona information for other lobby members (name, avatar, etc.) will be asynchronously received + // and accessible via ISteamFriends interface + + // returns the number of users in the specified lobby + virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; + // returns the CSteamID of a user in the lobby + // iMember is of range [0,GetNumLobbyMembers()) + // note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby + virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; + + // Get data associated with this lobby + // takes a simple key, and returns the string associated with it + // "" will be returned if no value is set, or if steamIDLobby is invalid + virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + // Sets a key/value pair in the lobby metadata + // each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data + // this can be used to set lobby names, map, etc. + // to reset a key, just set it to "" + // other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback + virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // returns the number of metadata keys set on the specified lobby + virtual int GetLobbyDataCount( CSteamID steamIDLobby ) = 0; + + // returns a lobby metadata key/values pair by index, of range [0, GetLobbyDataCount()) + virtual bool GetLobbyDataByIndex( CSteamID steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize ) = 0; + + // removes a metadata key from the lobby + virtual bool DeleteLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + + // Gets per-user metadata for someone in this lobby + virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; + // Sets per-user metadata (for the local user implicitly) + virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // Broadcasts a chat message to the all the users in the lobby + // users in the lobby (including the local user) will receive a LobbyChatMsg_t callback + // returns true if the message is successfully sent + // pvMsgBody can be binary or text data, up to 4k + // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator + virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; + // Get a chat message as specified in a LobbyChatMsg_t callback + // iChatID is the LobbyChatMsg_t::m_iChatID value in the callback + // *pSteamIDUser is filled in with the CSteamID of the member + // *pvData is filled in with the message itself + // return value is the number of bytes written into the buffer + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // Refreshes metadata for a lobby you're not necessarily in right now + // you never do this for lobbies you're a member of, only if your + // this will send down all the metadata associated with a lobby + // this is an asynchronous call + // returns false if the local user is not connected to the Steam servers + // results will be returned by a LobbyDataUpdate_t callback + // if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false + virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0; + + // sets the game server associated with the lobby + // usually at this point, the users will join the specified game server + // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect + virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; + // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; + + // set the limit on the # of users who can join the lobby + virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; + // returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined + virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0; + + // updates which type of lobby it is + // only lobbies that are k_ELobbyTypePublic or k_ELobbyTypeInvisible, and are set to joinable, will be returned by RequestLobbyList() calls + virtual bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType ) = 0; + + // sets whether or not a lobby is joinable - defaults to true for a new lobby + // if set to false, no user can join, even if they are a friend or have been invited + virtual bool SetLobbyJoinable( CSteamID steamIDLobby, bool bLobbyJoinable ) = 0; + + // returns the current lobby owner + // you must be a member of the lobby to access this + // there always one lobby owner - if the current owner leaves, another user will become the owner + // it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner + virtual CSteamID GetLobbyOwner( CSteamID steamIDLobby ) = 0; + + // changes who the lobby owner is + // you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby + // after completion, the local user will no longer be the owner + virtual bool SetLobbyOwner( CSteamID steamIDLobby, CSteamID steamIDNewOwner ) = 0; + + // link two lobbies for the purposes of checking player compatibility + // you must be the lobby owner of both lobbies + virtual bool SetLinkedLobby( CSteamID steamIDLobby, CSteamID steamIDLobbyDependent ) = 0; + +#ifdef _PS3 + // changes who the lobby owner is + // you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby + // after completion, the local user will no longer be the owner + virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0; +#endif +}; +#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009" + + +//----------------------------------------------------------------------------- +// Callback interfaces for server list functions (see ISteamMatchmakingServers below) +// +// The idea here is that your game code implements objects that implement these +// interfaces to receive callback notifications after calling asynchronous functions +// inside the ISteamMatchmakingServers() interface below. +// +// This is different than normal Steam callback handling due to the potentially +// large size of server lists. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Typedef for handle type you will receive when requesting server list. +//----------------------------------------------------------------------------- +typedef void* HServerListRequest; + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after a server list refresh +// or an individual server update. +// +// Since you get these callbacks after requesting full list refreshes you will +// usually implement this interface inside an object like CServerBrowser. If that +// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery() +// to cancel any in-progress queries so you don't get a callback into the destructed +// object and crash. +//----------------------------------------------------------------------------- +class ISteamMatchmakingServerListResponse +{ +public: + // Server has responded ok with updated data + virtual void ServerResponded( HServerListRequest hRequest, int iServer ) = 0; + + // Server has failed to respond + virtual void ServerFailedToRespond( HServerListRequest hRequest, int iServer ) = 0; + + // A list refresh you had initiated is now 100% completed + virtual void RefreshComplete( HServerListRequest hRequest, EMatchMakingServerResponse response ) = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after pinging an individual server +// +// These callbacks all occur in response to querying an individual server +// via the ISteamMatchmakingServers()->PingServer() call below. If you are +// destructing an object that implements this interface then you should call +// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query +// which is in progress. Failure to cancel in progress queries when destructing +// a callback handler may result in a crash when a callback later occurs. +//----------------------------------------------------------------------------- +class ISteamMatchmakingPingResponse +{ +public: + // Server has responded successfully and has updated data + virtual void ServerResponded( gameserveritem_t &server ) = 0; + + // Server failed to respond to the ping request + virtual void ServerFailedToRespond() = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after requesting details on +// who is playing on a particular server. +// +// These callbacks all occur in response to querying an individual server +// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are +// destructing an object that implements this interface then you should call +// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query +// which is in progress. Failure to cancel in progress queries when destructing +// a callback handler may result in a crash when a callback later occurs. +//----------------------------------------------------------------------------- +class ISteamMatchmakingPlayersResponse +{ +public: + // Got data on a new player on the server -- you'll get this callback once per player + // on the server which you have requested player data on. + virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0; + + // The server failed to respond to the request for player details + virtual void PlayersFailedToRespond() = 0; + + // The server has finished responding to the player details request + // (ie, you won't get anymore AddPlayerToList callbacks) + virtual void PlayersRefreshComplete() = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after requesting rules +// details on a particular server. +// +// These callbacks all occur in response to querying an individual server +// via the ISteamMatchmakingServers()->ServerRules() call below. If you are +// destructing an object that implements this interface then you should call +// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query +// which is in progress. Failure to cancel in progress queries when destructing +// a callback handler may result in a crash when a callback later occurs. +//----------------------------------------------------------------------------- +class ISteamMatchmakingRulesResponse +{ +public: + // Got data on a rule on the server -- you'll get one of these per rule defined on + // the server you are querying + virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0; + + // The server failed to respond to the request for rule details + virtual void RulesFailedToRespond() = 0; + + // The server has finished responding to the rule details request + // (ie, you won't get anymore RulesResponded callbacks) + virtual void RulesRefreshComplete() = 0; +}; + + +//----------------------------------------------------------------------------- +// Typedef for handle type you will receive when querying details on an individual server. +//----------------------------------------------------------------------------- +typedef int HServerQuery; +const int HSERVERQUERY_INVALID = 0xffffffff; + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to game lists and details +//----------------------------------------------------------------------------- +class ISteamMatchmakingServers +{ +public: + // Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. + // Each call allocates a new asynchronous request object. + // Request object must be released by calling ReleaseRequest( hServerListRequest ) + virtual HServerListRequest RequestInternetServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + + // Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. + // RefreshComplete callback is not posted when request is released. + virtual void ReleaseRequest( HServerListRequest hServerListRequest ) = 0; + + /* the filter operation codes that go in the key part of MatchMakingKeyValuePair_t should be one of these: + + "map" + - Server passes the filter if the server is playing the specified map. + "gamedataand" + - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains all of the + specified strings. The value field is a comma-delimited list of strings to match. + "gamedataor" + - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains at least one of the + specified strings. The value field is a comma-delimited list of strings to match. + "gamedatanor" + - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) does not contain any + of the specified strings. The value field is a comma-delimited list of strings to check. + "gametagsand" + - Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) contains all + of the specified strings. The value field is a comma-delimited list of strings to check. + "gametagsnor" + - Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) does not contain any + of the specified strings. The value field is a comma-delimited list of strings to check. + "and" (x1 && x2 && ... && xn) + "or" (x1 || x2 || ... || xn) + "nand" !(x1 && x2 && ... && xn) + "nor" !(x1 || x2 || ... || xn) + - Performs Boolean operation on the following filters. The operand to this filter specifies + the "size" of the Boolean inputs to the operation, in Key/value pairs. (The keyvalue + pairs must immediately follow, i.e. this is a prefix logical operator notation.) + In the simplest case where Boolean expressions are not nested, this is simply + the number of operands. + + For example, to match servers on a particular map or with a particular tag, would would + use these filters. + + ( server.map == "cp_dustbowl" || server.gametags.contains("payload") ) + "or", "2" + "map", "cp_dustbowl" + "gametagsand", "payload" + + If logical inputs are nested, then the operand specifies the size of the entire + "length" of its operands, not the number of immediate children. + + ( server.map == "cp_dustbowl" || ( server.gametags.contains("payload") && !server.gametags.contains("payloadrace") ) ) + "or", "4" + "map", "cp_dustbowl" + "and", "2" + "gametagsand", "payload" + "gametagsnor", "payloadrace" + + Unary NOT can be achieved using either "nand" or "nor" with a single operand. + + "addr" + - Server passes the filter if the server's query address matches the specified IP or IP:port. + "gameaddr" + - Server passes the filter if the server's game address matches the specified IP or IP:port. + + The following filter operations ignore the "value" part of MatchMakingKeyValuePair_t + + "dedicated" + - Server passes the filter if it passed true to SetDedicatedServer. + "secure" + - Server passes the filter if the server is VAC-enabled. + "notfull" + - Server passes the filter if the player count is less than the reported max player count. + "hasplayers" + - Server passes the filter if the player count is greater than zero. + "noplayers" + - Server passes the filter if it doesn't have any players. + "linux" + - Server passes the filter if it's a linux server + */ + + // Get details on a given server in the list, you can get the valid range of index + // values by calling GetServerCount(). You will also receive index values in + // ISteamMatchmakingServerListResponse::ServerResponded() callbacks + virtual gameserveritem_t *GetServerDetails( HServerListRequest hRequest, int iServer ) = 0; + + // Cancel an request which is operation on the given list type. You should call this to cancel + // any in-progress requests before destructing a callback object that may have been passed + // to one of the above list request calls. Not doing so may result in a crash when a callback + // occurs on the destructed object. + // Canceling a query does not release the allocated request handle. + // The request handle must be released using ReleaseRequest( hRequest ) + virtual void CancelQuery( HServerListRequest hRequest ) = 0; + + // Ping every server in your list again but don't update the list of servers + // Query callback installed when the server list was requested will be used + // again to post notifications and RefreshComplete, so the callback must remain + // valid until another RefreshComplete is called on it or the request + // is released with ReleaseRequest( hRequest ) + virtual void RefreshQuery( HServerListRequest hRequest ) = 0; + + // Returns true if the list is currently refreshing its server list + virtual bool IsRefreshing( HServerListRequest hRequest ) = 0; + + // How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1 + virtual int GetServerCount( HServerListRequest hRequest ) = 0; + + // Refresh a single server inside of a query (rather than all the servers ) + virtual void RefreshServer( HServerListRequest hRequest, int iServer ) = 0; + + + //----------------------------------------------------------------------------- + // Queries to individual servers directly via IP/Port + //----------------------------------------------------------------------------- + + // Request updated ping time and other details from a single server + virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0; + + // Request the list of players currently playing on a server + virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0; + + // Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side) + virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0; + + // Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel + // any in-progress requests before destructing a callback object that may have been passed + // to one of the above calls to avoid crashing when callbacks occur. + virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0; +}; +#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers002" + +// game server flags +const uint32 k_unFavoriteFlagNone = 0x00; +const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list +const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list + + +//----------------------------------------------------------------------------- +// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32 +//----------------------------------------------------------------------------- +enum EChatMemberStateChange +{ + // Specific to joining / leaving the chatroom + k_EChatMemberStateChangeEntered = 0x0001, // This user has joined or is joining the chat room + k_EChatMemberStateChangeLeft = 0x0002, // This user has left or is leaving the chat room + k_EChatMemberStateChangeDisconnected = 0x0004, // User disconnected without leaving the chat first + k_EChatMemberStateChangeKicked = 0x0008, // User kicked + k_EChatMemberStateChangeBanned = 0x0010, // User kicked and banned +}; + +// returns true of the flags indicate that a user has been removed from the chat +#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) ) + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: a server was added/removed from the favorites list, you should refresh now +//----------------------------------------------------------------------------- +struct FavoritesListChanged_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 }; + uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server + uint32 m_nQueryPort; + uint32 m_nConnPort; + uint32 m_nAppID; + uint32 m_nFlags; + bool m_bAdd; // true if this is adding the entry, otherwise it is a remove + AccountID_t m_unAccountId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Someone has invited you to join a Lobby +// normally you don't need to do anything with this, since +// the Steam UI will also display a ' has invited you to the lobby, join?' dialog +// +// if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>", +// or with the callback GameLobbyJoinRequested_t if they're already in-game +//----------------------------------------------------------------------------- +struct LobbyInvite_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 }; + + uint64 m_ulSteamIDUser; // Steam ID of the person making the invite + uint64 m_ulSteamIDLobby; // Steam ID of the Lobby + uint64 m_ulGameID; // GameID of the Lobby +}; + + +//----------------------------------------------------------------------------- +// Purpose: Sent on entering a lobby, or on failing to enter +// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success, +// or a higher value on failure (see enum EChatRoomEnterResponse) +//----------------------------------------------------------------------------- +struct LobbyEnter_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 }; + + uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered + uint32 m_rgfChatPermissions; // Permissions of the current user + bool m_bLocked; // If true, then only invited users may join + uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse +}; + + +//----------------------------------------------------------------------------- +// Purpose: The lobby metadata has changed +// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details +// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata +//----------------------------------------------------------------------------- +struct LobbyDataUpdate_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 }; + + uint64 m_ulSteamIDLobby; // steamID of the Lobby + uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself + uint8 m_bSuccess; // true if we lobby data was successfully changed; + // will only be false if RequestLobbyData() was called on a lobby that no longer exists +}; + + +//----------------------------------------------------------------------------- +// Purpose: The lobby chat room state has changed +// this is usually sent when a user has joined or left the lobby +//----------------------------------------------------------------------------- +struct LobbyChatUpdate_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 }; + + uint64 m_ulSteamIDLobby; // Lobby ID + uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient + uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.) + // for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick + uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values +}; + + +//----------------------------------------------------------------------------- +// Purpose: A chat message for this lobby has been sent +// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message +//----------------------------------------------------------------------------- +struct LobbyChatMsg_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 }; + + uint64 m_ulSteamIDLobby; // the lobby id this is in + uint64 m_ulSteamIDUser; // steamID of the user who has sent this message + uint8 m_eChatEntryType; // type of message + uint32 m_iChatID; // index of the chat entry to lookup +}; + + +//----------------------------------------------------------------------------- +// Purpose: A game created a game for all the members of the lobby to join, +// as triggered by a SetLobbyGameServer() +// it's up to the individual clients to take action on this; the usual +// game behavior is to leave the lobby and connect to the specified game server +//----------------------------------------------------------------------------- +struct LobbyGameCreated_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 }; + + uint64 m_ulSteamIDLobby; // the lobby we were in + uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members + uint32 m_unIP; // IP & Port of the game server (if any) + uint16 m_usPort; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Number of matching lobbies found +// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1 +//----------------------------------------------------------------------------- +struct LobbyMatchList_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 }; + uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for +}; + + +//----------------------------------------------------------------------------- +// Purpose: posted if a user is forcefully removed from a lobby +// can occur if a user loses connection to Steam +//----------------------------------------------------------------------------- +struct LobbyKicked_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 }; + uint64 m_ulSteamIDLobby; // Lobby + uint64 m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself + uint8 m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true) +}; + + +//----------------------------------------------------------------------------- +// Purpose: Result of our request to create a Lobby +// m_eResult == k_EResultOK on success +// at this point, the lobby has been joined and is ready for use +// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) +//----------------------------------------------------------------------------- +struct LobbyCreated_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 }; + + EResult m_eResult; // k_EResultOK - the lobby was successfully created + // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end + // k_EResultTimeout - you the message to the Steam servers, but it didn't respond + // k_EResultFail - the server responded, but with an unknown internal error + // k_EResultAccessDenied - your game isn't set to allow lobbies, or your client does haven't rights to play the game + // k_EResultLimitExceeded - your game client has created too many lobbies + + uint64 m_ulSteamIDLobby; // chat room, zero if failed +}; + +// used by now obsolete RequestFriendsLobbiesResponse_t +// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 }; + + +//----------------------------------------------------------------------------- +// Purpose: Result of CheckForPSNGameBootInvite +// m_eResult == k_EResultOK on success +// at this point, the local user may not have finishing joining this lobby; +// game code should wait until the subsequent LobbyEnter_t callback is received +//----------------------------------------------------------------------------- +struct PSNGameBootInviteResult_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 15 }; + + bool m_bGameBootInviteExists; + CSteamID m_steamIDLobby; // Should be valid if m_bGameBootInviteExists == true +}; + + +//----------------------------------------------------------------------------- +// Purpose: Result of our request to create a Lobby +// m_eResult == k_EResultOK on success +// at this point, the lobby has been joined and is ready for use +// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) +//----------------------------------------------------------------------------- +struct FavoritesListAccountsUpdated_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 16 }; + + EResult m_eResult; +}; + +#pragma pack( pop ) + + +#endif // ISTEAMMATCHMAKING diff --git a/public/steam/isteammusic.h b/public/steam/isteammusic.h new file mode 100644 index 000000000..779a4c2eb --- /dev/null +++ b/public/steam/isteammusic.h @@ -0,0 +1,67 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMMUSIC_H +#define ISTEAMMUSIC_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +enum AudioPlayback_Status +{ + AudioPlayback_Undefined = 0, + AudioPlayback_Playing = 1, + AudioPlayback_Paused = 2, + AudioPlayback_Idle = 3 +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions to control music playback in the steam client +//----------------------------------------------------------------------------- +class ISteamMusic +{ +public: + virtual bool BIsEnabled() = 0; + virtual bool BIsPlaying() = 0; + + virtual AudioPlayback_Status GetPlaybackStatus() = 0; + + virtual void Play() = 0; + virtual void Pause() = 0; + virtual void PlayPrevious() = 0; + virtual void PlayNext() = 0; + + // volume is between 0.0 and 1.0 + virtual void SetVolume( float flVolume ) = 0; + virtual float GetVolume() = 0; + +}; + +#define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +DEFINE_CALLBACK( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) + CALLBACK_MEMBER( 0, float, m_flNewVolume ) +END_DEFINE_CALLBACK_1() + +#pragma pack( pop ) + + +#endif // #define ISTEAMMUSIC_H diff --git a/public/steam/isteammusicremote.h b/public/steam/isteammusicremote.h new file mode 100644 index 000000000..ea29a7dee --- /dev/null +++ b/public/steam/isteammusicremote.h @@ -0,0 +1,129 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMMUSICREMOTE_H +#define ISTEAMMUSICREMOTE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" +#include "isteammusic.h" + +#define k_SteamMusicNameMaxLength 255 +#define k_SteamMusicPNGMaxLength 65535 + + +class ISteamMusicRemote +{ +public: + // Service Definition + virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0; + virtual bool DeregisterSteamMusicRemote() = 0; + virtual bool BIsCurrentMusicRemote() = 0; + virtual bool BActivationSuccess( bool bValue ) = 0; + + virtual bool SetDisplayName( const char *pchDisplayName ) = 0; + virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0; + + // Abilities for the user interface + virtual bool EnablePlayPrevious(bool bValue) = 0; + virtual bool EnablePlayNext( bool bValue ) = 0; + virtual bool EnableShuffled( bool bValue ) = 0; + virtual bool EnableLooped( bool bValue ) = 0; + virtual bool EnableQueue( bool bValue ) = 0; + virtual bool EnablePlaylists( bool bValue ) = 0; + + // Status + virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0; + virtual bool UpdateShuffled( bool bValue ) = 0; + virtual bool UpdateLooped( bool bValue ) = 0; + virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0 + + // Current Entry + virtual bool CurrentEntryWillChange() = 0; + virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0; + virtual bool UpdateCurrentEntryText( const char *pchText ) = 0; + virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0; + virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0; + virtual bool CurrentEntryDidChange() = 0; + + // Queue + virtual bool QueueWillChange() = 0; + virtual bool ResetQueueEntries() = 0; + virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0; + virtual bool SetCurrentQueueEntry( int nID ) = 0; + virtual bool QueueDidChange() = 0; + + // Playlist + virtual bool PlaylistWillChange() = 0; + virtual bool ResetPlaylistEntries() = 0; + virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0; + virtual bool SetCurrentPlaylistEntry( int nID ) = 0; + virtual bool PlaylistDidChange() = 0; +}; + +#define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +DEFINE_CALLBACK( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) + CALLBACK_MEMBER( 0, bool, m_bShuffled ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) + CALLBACK_MEMBER(0, bool, m_bLooped ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) + CALLBACK_MEMBER(0, float, m_flNewVolume) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) + CALLBACK_MEMBER(0, int, nID ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) + CALLBACK_MEMBER(0, int, nID ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) + CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) +END_DEFINE_CALLBACK_1() + +#pragma pack( pop ) + + + +#endif // #define ISTEAMMUSICREMOTE_H diff --git a/public/steam/isteamnetworking.h b/public/steam/isteamnetworking.h index 5161fc213..c77f7bf77 100644 --- a/public/steam/isteamnetworking.h +++ b/public/steam/isteamnetworking.h @@ -1,278 +1,306 @@ -//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to steam managing network connections between game clients & servers -// -//============================================================================= - -#ifndef ISTEAMNETWORKING -#define ISTEAMNETWORKING -#ifdef _WIN32 -#pragma once -#endif - -#include "steamtypes.h" -#include "steamclientpublic.h" - - -// list of possible errors returned by SendP2PPacket() API -// these will be posted in the P2PSessionConnectFail_t callback -enum EP2PSessionError -{ - k_EP2PSessionErrorNone = 0, - k_EP2PSessionErrorNotRunningApp = 1, // target is not running the same game - k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running - k_EP2PSessionErrorDestinationNotLoggedIn = 3, // target user isn't connected to Steam - k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser() - // corporate firewalls can also block this (NAT traversal is not firewall traversal) - // make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction - -}; - -// SendP2PPacket() send types -// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets -enum EP2PSend -{ - // Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare). - // The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or - // there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again. - k_EP2PSendUnreliable = 0, - - // As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first - // packet sent to a remote host almost guarantees the packet will be dropped. - // This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets - k_EP2PSendUnreliableNoDelay = 1, - - // Reliable message send. Can send up to 1MB of data in a single message. - // Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data. - k_EP2PSendReliable = 2, - - // As above, but applies the Nagle algorithm to the send - sends will accumulate - // until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm). - // Useful if you want to send a set of smaller messages but have the coalesced into a single packet - // Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then - // do a normal k_EP2PSendReliable to force all the buffered data to be sent. - k_EP2PSendReliableWithBuffering = 3, - -}; - - -// connection state to a specified user, returned by GetP2PSessionState() -// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin -#pragma pack( push, 8 ) -struct P2PSessionState_t -{ - uint8 m_bConnectionActive; // true if we've got an active open connection - uint8 m_bConnecting; // true if we're currently trying to establish a connection - uint8 m_eP2PSessionError; // last error recorded (see enum above) - uint8 m_bUsingRelay; // true if it's going through a relay server (TURN) - int32 m_nBytesQueuedForSend; - int32 m_nPacketsQueuedForSend; - uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server. - uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's -}; -#pragma pack( pop ) - - -// handle to a socket -typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket() -typedef uint32 SNetListenSocket_t; // CreateListenSocket() - -// connection progress indicators, used by CreateP2PConnectionSocket() -enum ESNetSocketState -{ - k_ESNetSocketStateInvalid = 0, - - // communication is valid - k_ESNetSocketStateConnected = 1, - - // states while establishing a connection - k_ESNetSocketStateInitiated = 10, // the connection state machine has started - - // p2p connections - k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info - k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info - - // direct connections - k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server - - // failure states - k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end - k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown - k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection - k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us - k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke - -}; - -// describes how the socket is currently connected -enum ESNetSocketConnectionType -{ - k_ESNetSocketConnectionTypeNotConnected = 0, - k_ESNetSocketConnectionTypeUDP = 1, - k_ESNetSocketConnectionTypeUDPRelay = 2, -}; - - -//----------------------------------------------------------------------------- -// Purpose: Functions for making connections and sending data between clients, -// traversing NAT's where possible -//----------------------------------------------------------------------------- -class ISteamNetworking -{ -public: - //////////////////////////////////////////////////////////////////////////////////////////// - // Session-less connection functions - // automatically establishes NAT-traversing or Relay server connections - - // Sends a P2P packet to the specified user - // UDP-like, unreliable and a max packet size of 1200 bytes - // the first packet send may be delayed as the NAT-traversal code runs - // if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t - // see EP2PSend enum above for the descriptions of the different ways of sending packets - virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType ) = 0; - - // returns true if any data is available for read, and the amount of data that will need to be read - virtual bool IsP2PPacketAvailable( uint32 *pcubMsgSize ) = 0; - - // reads in a packet that has been sent from another user via SendP2PPacket() - // returns the size of the message and the steamID of the user who sent it in the last two parameters - // if the buffer passed in is too small, the message will be truncated - // this call is not blocking, and will return false if no data is available - virtual bool ReadP2PPacket( void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote ) = 0; - - // AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback - // P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet - // if you don't want to talk to the user, just ignore the request - // if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically - // this may be called multiple times for a single user - // (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request) - virtual bool AcceptP2PSessionWithUser( CSteamID steamIDRemote ) = 0; - - // call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood - // if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted - virtual bool CloseP2PSessionWithUser( CSteamID steamIDRemote ) = 0; - - // fills out P2PSessionState_t structure with details about the underlying connection to the user - // should only needed for debugging purposes - // returns false if no connection exists to the specified user - virtual bool GetP2PSessionState( CSteamID steamIDRemote, P2PSessionState_t *pConnectionState ) = 0; - - - //////////////////////////////////////////////////////////////////////////////////////////// - // LISTEN / CONNECT style interface functions - // - // This is an older set of functions designed around the Berkeley TCP sockets model - // it's preferential that you use the above P2P functions, they're more robust - // and these older functions will be removed eventually - // - //////////////////////////////////////////////////////////////////////////////////////////// - - - // creates a socket and listens others to connect - // will trigger a SocketStatusCallback_t callback on another client connecting - // nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports - // this can usually just be 0 unless you want multiple sets of connections - // unIP is the local IP address to bind to - // pass in 0 if you just want the default local IP - // unPort is the port to use - // pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only - virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0; - - // creates a socket and begin connection to a remote destination - // can connect via a known steamID (client or game server), or directly to an IP - // on success will trigger a SocketStatusCallback_t callback - // on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState - virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0; - virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0; - - // disconnects the connection to the socket, if any, and invalidates the handle - // any unread data on the socket will be thrown away - // if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect - virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; - // destroying a listen socket will automatically kill all the regular sockets generated from it - virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; - - // sending data - // must be a handle to a connected socket - // data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets - // use the reliable flag with caution; although the resend rate is pretty aggressive, - // it can still cause stalls in receiving data (like TCP) - virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0; - - // receiving data - // returns false if there is no data remaining - // fills out *pcubMsgSize with the size of the next message, in bytes - virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0; - - // fills in pubDest with the contents of the message - // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) - // if *pcubMsgSize < cubDest, only partial data is written - // returns false if no data is available - virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; - - // checks for data from any socket that has been connected off this listen socket - // returns false if there is no data remaining - // fills out *pcubMsgSize with the size of the next message, in bytes - // fills out *phSocket with the socket that data is available on - virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; - - // retrieves data from any socket that has been connected off this listen socket - // fills in pubDest with the contents of the message - // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) - // if *pcubMsgSize < cubDest, only partial data is written - // returns false if no data is available - // fills out *phSocket with the socket that data is available on - virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; - - // returns information about the specified socket, filling out the contents of the pointers - virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0; - - // returns which local port the listen socket is bound to - // *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only - virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0; - - // returns true to describe how the socket ended up connecting - virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0; - - // max packet size, in bytes - virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0; -}; -#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking003" - -// callbacks -#pragma pack( push, 8 ) - -// callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API -// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them -struct P2PSessionRequest_t -{ - enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 }; - CSteamID m_steamIDRemote; // user who wants to talk to us -}; - - -// callback notification - packets can't get through to the specified user via the SendP2PPacket() API -// all packets queued packets unsent at this point will be dropped -// further attempts to send will retry making the connection (but will be dropped if we fail again) -struct P2PSessionConnectFail_t -{ - enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 }; - CSteamID m_steamIDRemote; // user we were sending packets to - uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble -}; - - -// callback notification - status of a socket has changed -// used as part of the CreateListenSocket() / CreateP2PConnectionSocket() -struct SocketStatusCallback_t -{ - enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 }; - SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host - SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection - CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one - int m_eSNetSocketState; // socket state, ESNetSocketState -}; - -#pragma pack( pop ) - -#endif // ISTEAMNETWORKING +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: interface to steam managing network connections between game clients & servers +// +//============================================================================= + +#ifndef ISTEAMNETWORKING +#define ISTEAMNETWORKING +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" + + +// list of possible errors returned by SendP2PPacket() API +// these will be posted in the P2PSessionConnectFail_t callback +enum EP2PSessionError +{ + k_EP2PSessionErrorNone = 0, + k_EP2PSessionErrorNotRunningApp = 1, // target is not running the same game + k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running + k_EP2PSessionErrorDestinationNotLoggedIn = 3, // target user isn't connected to Steam + k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser() + // corporate firewalls can also block this (NAT traversal is not firewall traversal) + // make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction + k_EP2PSessionErrorMax = 5 +}; + +// SendP2PPacket() send types +// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets +enum EP2PSend +{ + // Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare). + // The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or + // there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again. + k_EP2PSendUnreliable = 0, + + // As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first + // packet sent to a remote host almost guarantees the packet will be dropped. + // This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets + k_EP2PSendUnreliableNoDelay = 1, + + // Reliable message send. Can send up to 1MB of data in a single message. + // Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data. + k_EP2PSendReliable = 2, + + // As above, but applies the Nagle algorithm to the send - sends will accumulate + // until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm). + // Useful if you want to send a set of smaller messages but have the coalesced into a single packet + // Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then + // do a normal k_EP2PSendReliable to force all the buffered data to be sent. + k_EP2PSendReliableWithBuffering = 3, + +}; + + +// connection state to a specified user, returned by GetP2PSessionState() +// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif +struct P2PSessionState_t +{ + uint8 m_bConnectionActive; // true if we've got an active open connection + uint8 m_bConnecting; // true if we're currently trying to establish a connection + uint8 m_eP2PSessionError; // last error recorded (see enum above) + uint8 m_bUsingRelay; // true if it's going through a relay server (TURN) + int32 m_nBytesQueuedForSend; + int32 m_nPacketsQueuedForSend; + uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server. + uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's +}; +#pragma pack( pop ) + + +// handle to a socket +typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket() +typedef uint32 SNetListenSocket_t; // CreateListenSocket() + +// connection progress indicators, used by CreateP2PConnectionSocket() +enum ESNetSocketState +{ + k_ESNetSocketStateInvalid = 0, + + // communication is valid + k_ESNetSocketStateConnected = 1, + + // states while establishing a connection + k_ESNetSocketStateInitiated = 10, // the connection state machine has started + + // p2p connections + k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info + k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info + + // direct connections + k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server + + // failure states + k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end + k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown + k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection + k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us + k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke + +}; + +// describes how the socket is currently connected +enum ESNetSocketConnectionType +{ + k_ESNetSocketConnectionTypeNotConnected = 0, + k_ESNetSocketConnectionTypeUDP = 1, + k_ESNetSocketConnectionTypeUDPRelay = 2, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for making connections and sending data between clients, +// traversing NAT's where possible +//----------------------------------------------------------------------------- +class ISteamNetworking +{ +public: + //////////////////////////////////////////////////////////////////////////////////////////// + // Session-less connection functions + // automatically establishes NAT-traversing or Relay server connections + + // Sends a P2P packet to the specified user + // UDP-like, unreliable and a max packet size of 1200 bytes + // the first packet send may be delayed as the NAT-traversal code runs + // if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t + // see EP2PSend enum above for the descriptions of the different ways of sending packets + // + // nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket() + // with the same channel number in order to retrieve the data on the other end + // using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources + virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel = 0 ) = 0; + + // returns true if any data is available for read, and the amount of data that will need to be read + virtual bool IsP2PPacketAvailable( uint32 *pcubMsgSize, int nChannel = 0 ) = 0; + + // reads in a packet that has been sent from another user via SendP2PPacket() + // returns the size of the message and the steamID of the user who sent it in the last two parameters + // if the buffer passed in is too small, the message will be truncated + // this call is not blocking, and will return false if no data is available + virtual bool ReadP2PPacket( void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote, int nChannel = 0 ) = 0; + + // AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback + // P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet + // if you don't want to talk to the user, just ignore the request + // if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically + // this may be called multiple times for a single user + // (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request) + virtual bool AcceptP2PSessionWithUser( CSteamID steamIDRemote ) = 0; + + // call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood + // if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted + virtual bool CloseP2PSessionWithUser( CSteamID steamIDRemote ) = 0; + + // call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels + // open channels to a user have been closed, the open session to the user will be closed and new data from this + // user will trigger a P2PSessionRequest_t callback + virtual bool CloseP2PChannelWithUser( CSteamID steamIDRemote, int nChannel ) = 0; + + // fills out P2PSessionState_t structure with details about the underlying connection to the user + // should only needed for debugging purposes + // returns false if no connection exists to the specified user + virtual bool GetP2PSessionState( CSteamID steamIDRemote, P2PSessionState_t *pConnectionState ) = 0; + + // Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection + // or NAT-traversal cannot be established. Only applies to connections created after setting this value, + // or to existing connections that need to automatically reconnect after this value is set. + // + // P2P packet relay is allowed by default + virtual bool AllowP2PPacketRelay( bool bAllow ) = 0; + + + //////////////////////////////////////////////////////////////////////////////////////////// + // LISTEN / CONNECT style interface functions + // + // This is an older set of functions designed around the Berkeley TCP sockets model + // it's preferential that you use the above P2P functions, they're more robust + // and these older functions will be removed eventually + // + //////////////////////////////////////////////////////////////////////////////////////////// + + + // creates a socket and listens others to connect + // will trigger a SocketStatusCallback_t callback on another client connecting + // nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports + // this can usually just be 0 unless you want multiple sets of connections + // unIP is the local IP address to bind to + // pass in 0 if you just want the default local IP + // unPort is the port to use + // pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only + virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0; + + // creates a socket and begin connection to a remote destination + // can connect via a known steamID (client or game server), or directly to an IP + // on success will trigger a SocketStatusCallback_t callback + // on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState + virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0; + virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0; + + // disconnects the connection to the socket, if any, and invalidates the handle + // any unread data on the socket will be thrown away + // if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect + virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; + // destroying a listen socket will automatically kill all the regular sockets generated from it + virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; + + // sending data + // must be a handle to a connected socket + // data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets + // use the reliable flag with caution; although the resend rate is pretty aggressive, + // it can still cause stalls in receiving data (like TCP) + virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0; + + // receiving data + // returns false if there is no data remaining + // fills out *pcubMsgSize with the size of the next message, in bytes + virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0; + + // fills in pubDest with the contents of the message + // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) + // if *pcubMsgSize < cubDest, only partial data is written + // returns false if no data is available + virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; + + // checks for data from any socket that has been connected off this listen socket + // returns false if there is no data remaining + // fills out *pcubMsgSize with the size of the next message, in bytes + // fills out *phSocket with the socket that data is available on + virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; + + // retrieves data from any socket that has been connected off this listen socket + // fills in pubDest with the contents of the message + // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) + // if *pcubMsgSize < cubDest, only partial data is written + // returns false if no data is available + // fills out *phSocket with the socket that data is available on + virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; + + // returns information about the specified socket, filling out the contents of the pointers + virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0; + + // returns which local port the listen socket is bound to + // *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only + virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0; + + // returns true to describe how the socket ended up connecting + virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0; + + // max packet size, in bytes + virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0; +}; +#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking005" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +// callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API +// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them +struct P2PSessionRequest_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 }; + CSteamID m_steamIDRemote; // user who wants to talk to us +}; + + +// callback notification - packets can't get through to the specified user via the SendP2PPacket() API +// all packets queued packets unsent at this point will be dropped +// further attempts to send will retry making the connection (but will be dropped if we fail again) +struct P2PSessionConnectFail_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 }; + CSteamID m_steamIDRemote; // user we were sending packets to + uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble +}; + + +// callback notification - status of a socket has changed +// used as part of the CreateListenSocket() / CreateP2PConnectionSocket() +struct SocketStatusCallback_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 }; + SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host + SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection + CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one + int m_eSNetSocketState; // socket state, ESNetSocketState +}; + +#pragma pack( pop ) + +#endif // ISTEAMNETWORKING diff --git a/public/steam/isteamps3overlayrenderer.h b/public/steam/isteamps3overlayrenderer.h new file mode 100644 index 000000000..5c410d829 --- /dev/null +++ b/public/steam/isteamps3overlayrenderer.h @@ -0,0 +1,91 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: interface the game must provide Steam with on PS3 in order for the +// Steam overlay to render. +// +//============================================================================= + +#ifndef ISTEAMPS3OVERLAYRENDERER_H +#define ISTEAMPS3OVERLAYRENDERER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "cell/pad.h" + +//----------------------------------------------------------------------------- +// Purpose: Enum for supported gradient directions +//----------------------------------------------------------------------------- +enum EOverlayGradientDirection +{ + k_EOverlayGradientHorizontal = 1, + k_EOverlayGradientVertical = 2, + k_EOverlayGradientNone = 3, +}; + +// Helpers for fetching individual color components from ARGB packed DWORD colors Steam PS3 overlay renderer uses. +#define STEAM_COLOR_RED( color ) \ + (int)(((color)>>16)&0xff) + +#define STEAM_COLOR_GREEN( color ) \ + (int)(((color)>>8)&0xff) + +#define STEAM_COLOR_BLUE( color ) \ + (int)((color)&0xff) + +#define STEAM_COLOR_ALPHA( color ) \ + (int)(((color)>>24)&0xff) + + +//----------------------------------------------------------------------------- +// Purpose: Interface the game must expose to Steam for rendering +//----------------------------------------------------------------------------- +class ISteamPS3OverlayRenderHost +{ +public: + + // Interface for game engine to implement which Steam requires to render. + + // Draw a textured rect. This may use only part of the texture and will pass texture coords, it will also possibly request a gradient and will specify colors for vertexes. + virtual void DrawTexturedRect( int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection ) = 0; + + // Load a RGBA texture for Steam, or update a previously loaded one. Updates may be partial. You must not evict or remove this texture once Steam has uploaded it. + virtual void LoadOrUpdateTexture( int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData ) = 0; + + // Delete a texture Steam previously uploaded + virtual void DeleteTexture( int32 iTextureID ) = 0; + + // Delete all previously uploaded textures + virtual void DeleteAllTextures() = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Interface Steam exposes for the game to tell it when to render, etc. +//----------------------------------------------------------------------------- +class ISteamPS3OverlayRender +{ +public: + + // Call once at startup to initialize the Steam overlay and pass it your host interface ptr + virtual bool BHostInitialize( uint32 unScreenWidth, uint32 unScreenHeight, uint32 unRefreshRate, ISteamPS3OverlayRenderHost *pRenderHost, void *CellFontLib ) = 0; + + // Call this once a frame when you are ready for the Steam overlay to render (ie, right before flipping buffers, after all your rendering) + virtual void Render() = 0; + + // Call this everytime you read input on PS3. + // + // If this returns true, then the overlay is active and has consumed the input, your game + // should then ignore all the input until BHandleCellPadData once again returns false, which + // will mean the overlay is deactivated. + virtual bool BHandleCellPadData( const CellPadData &padData ) = 0; + + // Call this if you detect no controllers connected or that the XMB is intercepting input + // + // This is important to clear input state for the overlay, so keys left down during XMB activation + // are not continued to be processed. + virtual bool BResetInputState() = 0; +}; + + +#endif // ISTEAMPS3OVERLAYRENDERER_H \ No newline at end of file diff --git a/public/steam/isteamremotestorage.h b/public/steam/isteamremotestorage.h index 8287228b8..cce39dfe0 100644 --- a/public/steam/isteamremotestorage.h +++ b/public/steam/isteamremotestorage.h @@ -1,45 +1,675 @@ -//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= -// -// Purpose: public interface to user remote file storage in Steam -// -//============================================================================= - -#ifndef ISTEAMREMOTESTORAGE_H -#define ISTEAMREMOTESTORAGE_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -//----------------------------------------------------------------------------- -// Purpose: Functions for accessing, reading and writing files stored remotely -// and cached locally -//----------------------------------------------------------------------------- -class ISteamRemoteStorage -{ - public: - // NOTE - // - // Filenames are case-insensitive, and will be converted to lowercase automatically. - // So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then - // iterate the files, the filename returned will be "foo.bar". - // - - // file operations - virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; - virtual int32 GetFileSize( const char *pchFile ) = 0; - virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; - virtual bool FileExists( const char *pchFile ) = 0; - - // iteration - virtual int32 GetFileCount() = 0; - virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0; - - // quota management - virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0; -}; - -#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION002" - -#endif // ISTEAMREMOTESTORAGE_H +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMREMOTESTORAGE_H +#define ISTEAMREMOTESTORAGE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + + +//----------------------------------------------------------------------------- +// Purpose: Defines the largest allowed file size. Cloud files cannot be written +// in a single chunk over 100MB (and cannot be over 200MB total.) +//----------------------------------------------------------------------------- +const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024; + + +//----------------------------------------------------------------------------- +// Purpose: Structure that contains an array of const char * strings and the number of those strings +//----------------------------------------------------------------------------- +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif +struct SteamParamStringArray_t +{ + const char ** m_ppStrings; + int32 m_nNumStrings; +}; +#pragma pack( pop ) + +// A handle to a piece of user generated content +typedef uint64 UGCHandle_t; +typedef uint64 PublishedFileUpdateHandle_t; +typedef uint64 PublishedFileId_t; +const PublishedFileId_t k_PublishedFileIdInvalid = 0; +const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull; +const PublishedFileUpdateHandle_t k_PublishedFileUpdateHandleInvalid = 0xffffffffffffffffull; + +// Handle for writing to Steam Cloud +typedef uint64 UGCFileWriteStreamHandle_t; +const UGCFileWriteStreamHandle_t k_UGCFileStreamHandleInvalid = 0xffffffffffffffffull; + +const uint32 k_cchPublishedDocumentTitleMax = 128 + 1; +const uint32 k_cchPublishedDocumentDescriptionMax = 8000; +const uint32 k_cchPublishedDocumentChangeDescriptionMax = 8000; +const uint32 k_unEnumeratePublishedFilesMaxResults = 50; +const uint32 k_cchTagListMax = 1024 + 1; +const uint32 k_cchFilenameMax = 260; +const uint32 k_cchPublishedFileURLMax = 256; + +// Ways to handle a synchronization conflict +enum EResolveConflict +{ + k_EResolveConflictKeepClient = 1, // The local version of each file will be used to overwrite the server version + k_EResolveConflictKeepServer = 2, // The server version of each file will be used to overwrite the local version +}; + +enum ERemoteStoragePlatform +{ + k_ERemoteStoragePlatformNone = 0, + k_ERemoteStoragePlatformWindows = (1 << 0), + k_ERemoteStoragePlatformOSX = (1 << 1), + k_ERemoteStoragePlatformPS3 = (1 << 2), + k_ERemoteStoragePlatformLinux = (1 << 3), + k_ERemoteStoragePlatformReserved2 = (1 << 4), + + k_ERemoteStoragePlatformAll = 0xffffffff +}; + +enum ERemoteStoragePublishedFileVisibility +{ + k_ERemoteStoragePublishedFileVisibilityPublic = 0, + k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1, + k_ERemoteStoragePublishedFileVisibilityPrivate = 2, +}; + + +enum EWorkshopFileType +{ + k_EWorkshopFileTypeFirst = 0, + + k_EWorkshopFileTypeCommunity = 0, // normal Workshop item that can be subscribed to + k_EWorkshopFileTypeMicrotransaction = 1, // Workshop item that is meant to be voted on for the purpose of selling in-game + k_EWorkshopFileTypeCollection = 2, // a collection of Workshop or Greenlight items + k_EWorkshopFileTypeArt = 3, // artwork + k_EWorkshopFileTypeVideo = 4, // external video + k_EWorkshopFileTypeScreenshot = 5, // screenshot + k_EWorkshopFileTypeGame = 6, // Greenlight game entry + k_EWorkshopFileTypeSoftware = 7, // Greenlight software entry + k_EWorkshopFileTypeConcept = 8, // Greenlight concept + k_EWorkshopFileTypeWebGuide = 9, // Steam web guide + k_EWorkshopFileTypeIntegratedGuide = 10, // application integrated guide + k_EWorkshopFileTypeMerch = 11, // Workshop merchandise meant to be voted on for the purpose of being sold + k_EWorkshopFileTypeControllerBinding = 12, // Steam Controller bindings + k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal + k_EWorkshopFileTypeSteamVideo = 14, // Steam video + k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web + + // Update k_EWorkshopFileTypeMax if you add values. + k_EWorkshopFileTypeMax = 16 + +}; + +enum EWorkshopVote +{ + k_EWorkshopVoteUnvoted = 0, + k_EWorkshopVoteFor = 1, + k_EWorkshopVoteAgainst = 2, + k_EWorkshopVoteLater = 3, +}; + +enum EWorkshopFileAction +{ + k_EWorkshopFileActionPlayed = 0, + k_EWorkshopFileActionCompleted = 1, +}; + +enum EWorkshopEnumerationType +{ + k_EWorkshopEnumerationTypeRankedByVote = 0, + k_EWorkshopEnumerationTypeRecent = 1, + k_EWorkshopEnumerationTypeTrending = 2, + k_EWorkshopEnumerationTypeFavoritesOfFriends = 3, + k_EWorkshopEnumerationTypeVotedByFriends = 4, + k_EWorkshopEnumerationTypeContentByFriends = 5, + k_EWorkshopEnumerationTypeRecentFromFollowedUsers = 6, +}; + +enum EWorkshopVideoProvider +{ + k_EWorkshopVideoProviderNone = 0, + k_EWorkshopVideoProviderYoutube = 1 +}; + + +enum EUGCReadAction +{ + // Keeps the file handle open unless the last byte is read. You can use this when reading large files (over 100MB) in sequential chunks. + // If the last byte is read, this will behave the same as k_EUGCRead_Close. Otherwise, it behaves the same as k_EUGCRead_ContinueReading. + // This value maintains the same behavior as before the EUGCReadAction parameter was introduced. + k_EUGCRead_ContinueReadingUntilFinished = 0, + + // Keeps the file handle open. Use this when using UGCRead to seek to different parts of the file. + // When you are done seeking around the file, make a final call with k_EUGCRead_Close to close it. + k_EUGCRead_ContinueReading = 1, + + // Frees the file handle. Use this when you're done reading the content. + // To read the file from Steam again you will need to call UGCDownload again. + k_EUGCRead_Close = 2, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing, reading and writing files stored remotely +// and cached locally +//----------------------------------------------------------------------------- +class ISteamRemoteStorage +{ + public: + // NOTE + // + // Filenames are case-insensitive, and will be converted to lowercase automatically. + // So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then + // iterate the files, the filename returned will be "foo.bar". + // + + // file operations + virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; + virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; + + virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0; + + virtual SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToRead ) = 0; + virtual bool FileReadAsyncComplete( SteamAPICall_t hReadCall, void *pvBuffer, uint32 cubToRead ) = 0; + + virtual bool FileForget( const char *pchFile ) = 0; + virtual bool FileDelete( const char *pchFile ) = 0; + virtual SteamAPICall_t FileShare( const char *pchFile ) = 0; + virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0; + + // file operations that cause network IO + virtual UGCFileWriteStreamHandle_t FileWriteStreamOpen( const char *pchFile ) = 0; + virtual bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, const void *pvData, int32 cubData ) = 0; + virtual bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) = 0; + virtual bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) = 0; + + // file information + virtual bool FileExists( const char *pchFile ) = 0; + virtual bool FilePersisted( const char *pchFile ) = 0; + virtual int32 GetFileSize( const char *pchFile ) = 0; + virtual int64 GetFileTimestamp( const char *pchFile ) = 0; + virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0; + + // iteration + virtual int32 GetFileCount() = 0; + virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0; + + // configuration management + virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0; + virtual bool IsCloudEnabledForAccount() = 0; + virtual bool IsCloudEnabledForApp() = 0; + virtual void SetCloudEnabledForApp( bool bEnabled ) = 0; + + // user generated content + + // Downloads a UGC file. A priority value of 0 will download the file immediately, + // otherwise it will wait to download the file until all downloads with a lower priority + // value are completed. Downloads with equal priority will occur simultaneously. + virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0; + + // Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false + // or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage + virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0; + + // Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result + virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; + + // After download, gets the content of the file. + // Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file. + // Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate + // enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail + // unless UGCDownload is called again. + // For especially large files (anything over 100MB) it is a requirement that the file is read in chunks. + virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction ) = 0; + + // Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead() + virtual int32 GetCachedUGCCount() = 0; + virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0; + + // The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you + // On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget. + +#if defined(_PS3) || defined(_SERVER) + // Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback + virtual void GetFileListFromServer() = 0; + // Indicate this file should be downloaded in the next sync + virtual bool FileFetch( const char *pchFile ) = 0; + // Indicate this file should be persisted in the next sync + virtual bool FilePersist( const char *pchFile ) = 0; + // Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback + virtual bool SynchronizeToClient() = 0; + // Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback + virtual bool SynchronizeToServer() = 0; + // Reset any fetch/persist/etc requests + virtual bool ResetFileRequestState() = 0; +#endif + + // publishing UGC + virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0; + virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0; + virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0; + virtual bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle, const char *pchPreviewFile ) = 0; + virtual bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle, const char *pchTitle ) = 0; + virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0; + virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; + virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0; + virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0; + // Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0, + // cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh. + // A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is. + virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0; + virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; + // enumerate the files that the current user published with this app + virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0; + virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; + virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0; + virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; + virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0; + virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; + virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0; + virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; + virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0; + virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0; + virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0; + virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0; + // this method enumerates the public view of workshop files + virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0; + + virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0; +}; + +#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION013" + + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: sent when the local file cache is fully synced with the server for an app +// That means that an application can be started and has all latest files +//----------------------------------------------------------------------------- +struct RemoteStorageAppSyncedClient_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 }; + AppId_t m_nAppID; + EResult m_eResult; + int m_unNumDownloads; +}; + +//----------------------------------------------------------------------------- +// Purpose: sent when the server is fully synced with the local file cache for an app +// That means that we can shutdown Steam and our data is stored on the server +//----------------------------------------------------------------------------- +struct RemoteStorageAppSyncedServer_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 }; + AppId_t m_nAppID; + EResult m_eResult; + int m_unNumUploads; +}; + +//----------------------------------------------------------------------------- +// Purpose: Status of up and downloads during a sync session +// +//----------------------------------------------------------------------------- +struct RemoteStorageAppSyncProgress_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 }; + char m_rgchCurrentFile[k_cchFilenameMax]; // Current file being transferred + AppId_t m_nAppID; // App this info relates to + uint32 m_uBytesTransferredThisChunk; // Bytes transferred this chunk + double m_dAppPercentComplete; // Percent complete that this app's transfers are + bool m_bUploading; // if false, downloading +}; + +// +// IMPORTANT! k_iClientRemoteStorageCallbacks + 4 is used, see iclientremotestorage.h +// + + +//----------------------------------------------------------------------------- +// Purpose: Sent after we've determined the list of files that are out of sync +// with the server. +//----------------------------------------------------------------------------- +struct RemoteStorageAppSyncStatusCheck_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 5 }; + AppId_t m_nAppID; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: Sent after a conflict resolution attempt. +//----------------------------------------------------------------------------- +struct RemoteStorageConflictResolution_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 6 }; + AppId_t m_nAppID; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to FileShare() +//----------------------------------------------------------------------------- +struct RemoteStorageFileShareResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 }; + EResult m_eResult; // The result of the operation + UGCHandle_t m_hFile; // The handle that can be shared with users and features + char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared +}; + + +// k_iClientRemoteStorageCallbacks + 8 is deprecated! Do not reuse + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to PublishFile() +//----------------------------------------------------------------------------- +struct RemoteStoragePublishFileResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 9 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to DeletePublishedFile() +//----------------------------------------------------------------------------- +struct RemoteStorageDeletePublishedFileResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 11 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to EnumerateUserPublishedFiles() +//----------------------------------------------------------------------------- +struct RemoteStorageEnumerateUserPublishedFilesResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 }; + EResult m_eResult; // The result of the operation. + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to SubscribePublishedFile() +//----------------------------------------------------------------------------- +struct RemoteStorageSubscribePublishedFileResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 13 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to EnumerateSubscribePublishedFiles() +//----------------------------------------------------------------------------- +struct RemoteStorageEnumerateUserSubscribedFilesResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 14 }; + EResult m_eResult; // The result of the operation. + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; + uint32 m_rgRTimeSubscribed[ k_unEnumeratePublishedFilesMaxResults ]; +}; + +#if defined(VALVE_CALLBACK_PACK_SMALL) + VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 ); +#elif defined(VALVE_CALLBACK_PACK_LARGE) + VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 ); +#else +#warning You must first include isteamclient.h +#endif + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to UnsubscribePublishedFile() +//----------------------------------------------------------------------------- +struct RemoteStorageUnsubscribePublishedFileResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 15 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to CommitPublishedFileUpdate() +//----------------------------------------------------------------------------- +struct RemoteStorageUpdatePublishedFileResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 16 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to UGCDownload() +//----------------------------------------------------------------------------- +struct RemoteStorageDownloadUGCResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 17 }; + EResult m_eResult; // The result of the operation. + UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. + AppId_t m_nAppID; // ID of the app that created this file. + int32 m_nSizeInBytes; // The size of the file that was downloaded, in bytes. + char m_pchFileName[k_cchFilenameMax]; // The name of the file that was downloaded. + uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content. +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetPublishedFileDetails() +//----------------------------------------------------------------------------- +struct RemoteStorageGetPublishedFileDetailsResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 18 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; + AppId_t m_nCreatorAppID; // ID of the app that created this file. + AppId_t m_nConsumerAppID; // ID of the app that will consume this file. + char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document + char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document + UGCHandle_t m_hFile; // The handle of the primary file + UGCHandle_t m_hPreviewFile; // The handle of the preview file + uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content. + uint32 m_rtimeCreated; // time when the published file was created + uint32 m_rtimeUpdated; // time when the published file was last updated + ERemoteStoragePublishedFileVisibility m_eVisibility; + bool m_bBanned; + char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file + bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer + char m_pchFileName[k_cchFilenameMax]; // The name of the primary file + int32 m_nFileSize; // Size of the primary file + int32 m_nPreviewFileSize; // Size of the preview file + char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website) + EWorkshopFileType m_eFileType; // Type of the file + bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop +}; + + +struct RemoteStorageEnumerateWorkshopFilesResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 19 }; + EResult m_eResult; + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; + float m_rgScore[ k_unEnumeratePublishedFilesMaxResults ]; + AppId_t m_nAppId; + uint32 m_unStartIndex; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of GetPublishedItemVoteDetails +//----------------------------------------------------------------------------- +struct RemoteStorageGetPublishedItemVoteDetailsResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 20 }; + EResult m_eResult; + PublishedFileId_t m_unPublishedFileId; + int32 m_nVotesFor; + int32 m_nVotesAgainst; + int32 m_nReports; + float m_fScore; +}; + + +//----------------------------------------------------------------------------- +// Purpose: User subscribed to a file for the app (from within the app or on the web) +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileSubscribed_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 21 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. +}; + +//----------------------------------------------------------------------------- +// Purpose: User unsubscribed from a file for the app (from within the app or on the web) +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileUnsubscribed_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 22 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. +}; + + +//----------------------------------------------------------------------------- +// Purpose: Published file that a user owns was deleted (from within the app or the web) +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileDeleted_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 23 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to UpdateUserPublishedItemVote() +//----------------------------------------------------------------------------- +struct RemoteStorageUpdateUserPublishedItemVoteResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 24 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; // The published file id +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetUserPublishedItemVoteDetails() +//----------------------------------------------------------------------------- +struct RemoteStorageUserVoteDetails_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 25 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; // The published file id + EWorkshopVote m_eVote; // what the user voted +}; + +struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 26 }; + EResult m_eResult; // The result of the operation. + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; +}; + +struct RemoteStorageSetUserPublishedFileActionResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 27 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; // The published file id + EWorkshopFileAction m_eAction; // the action that was attempted +}; + +struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 28 }; + EResult m_eResult; // The result of the operation. + EWorkshopFileAction m_eAction; // the action that was filtered on + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; + uint32 m_rgRTimeUpdated[ k_unEnumeratePublishedFilesMaxResults ]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Called periodically while a PublishWorkshopFile is in progress +//----------------------------------------------------------------------------- +struct RemoteStoragePublishFileProgress_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 29 }; + double m_dPercentFile; + bool m_bPreview; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Called when the content for a published file is updated +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileUpdated_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 30 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. + UGCHandle_t m_hFile; // The new content +}; + +//----------------------------------------------------------------------------- +// Purpose: Called when a FileWriteAsync completes +//----------------------------------------------------------------------------- +struct RemoteStorageFileWriteAsyncComplete_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 31 }; + EResult m_eResult; // result +}; + +//----------------------------------------------------------------------------- +// Purpose: Called when a FileReadAsync completes +//----------------------------------------------------------------------------- +struct RemoteStorageFileReadAsyncComplete_t +{ + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 32 }; + SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made + EResult m_eResult; // result + uint32 m_nOffset; // offset in the file this read was at + uint32 m_cubRead; // amount read - will the <= the amount requested +}; + +#pragma pack( pop ) + + +#endif // ISTEAMREMOTESTORAGE_H diff --git a/public/steam/isteamscreenshots.h b/public/steam/isteamscreenshots.h new file mode 100644 index 000000000..1636c1603 --- /dev/null +++ b/public/steam/isteamscreenshots.h @@ -0,0 +1,96 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMSCREENSHOTS_H +#define ISTEAMSCREENSHOTS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +const uint32 k_nScreenshotMaxTaggedUsers = 32; +const uint32 k_nScreenshotMaxTaggedPublishedFiles = 32; +const int k_cubUFSTagTypeMax = 255; +const int k_cubUFSTagValueMax = 255; + +// Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail +// one will be generated. +const int k_ScreenshotThumbWidth = 200; + +// Handle is valid for the lifetime of your process and no longer +typedef uint32 ScreenshotHandle; +#define INVALID_SCREENSHOT_HANDLE 0 + +//----------------------------------------------------------------------------- +// Purpose: Functions for adding screenshots to the user's screenshot library +//----------------------------------------------------------------------------- +class ISteamScreenshots +{ +public: + // Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0; + + // Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio + // as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + // JPEG, TGA, and PNG formats are supported. + virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0; + + // Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead. + virtual void TriggerScreenshot() = 0; + + // Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, + // then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary + // in response. + virtual void HookScreenshots( bool bHook ) = 0; + + // Sets metadata about a screenshot's location (for example, the name of the map) + virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0; + + // Tags a user as being visible in the screenshot + virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0; + + // Tags a published file as being visible in the screenshot + virtual bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ) = 0; +}; + +#define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION002" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif +//----------------------------------------------------------------------------- +// Purpose: Screenshot successfully written or otherwise added to the library +// and can now be tagged +//----------------------------------------------------------------------------- +struct ScreenshotReady_t +{ + enum { k_iCallback = k_iSteamScreenshotsCallbacks + 1 }; + ScreenshotHandle m_hLocal; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: Screenshot has been requested by the user. Only sent if +// HookScreenshots() has been called, in which case Steam will not take +// the screenshot itself. +//----------------------------------------------------------------------------- +struct ScreenshotRequested_t +{ + enum { k_iCallback = k_iSteamScreenshotsCallbacks + 2 }; +}; + +#pragma pack( pop ) + + +#endif // ISTEAMSCREENSHOTS_H diff --git a/public/steam/isteamstreamlauncher.h b/public/steam/isteamstreamlauncher.h new file mode 100644 index 000000000..5f258667a --- /dev/null +++ b/public/steam/isteamstreamlauncher.h @@ -0,0 +1,85 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: interface to streaming launcher functions in Steam +// +//============================================================================= + +#ifndef ISTEAMSTREAMLAUNCHER_H +#define ISTEAMSTREAMLAUNCHER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +enum EStreamLauncherResult +{ + k_EStreamLaunchResultSuccess = 0, + k_EStreamLaunchResultFailure = 1, // Unknown streaming launch failure + k_EStreamLaunchResultAlreadyStreaming = 2, // The UI is already streaming to a different application + k_EStreamLaunchResultInvalidLauncher = 3, // The streaming launcher doesn't exist, or failed signature check + k_EStreamLaunchResultNotReady = 4, // The UI isn't ready to go into streaming mode (Desktop UI login?) +}; + +//----------------------------------------------------------------------------- +// Purpose: interface to streaming launcher functions in Steam +//----------------------------------------------------------------------------- +class ISteamStreamLauncher +{ +public: + // Switch Steam to Big Picture mode and optionally set a launcher to run all games + virtual EStreamLauncherResult StartStreaming( const char *pchLauncher = NULL ) = 0; + + // Switch Steam back to the original mode and clear the launcher + virtual void StopStreaming() = 0; +}; + +#define STEAMSTREAMLAUNCHER_INTERFACE_VERSION "SteamStreamLauncher001" + + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// The big picture window is visible and ready for streaming +//----------------------------------------------------------------------------- +struct BigPictureStreamingResult_t +{ + enum { k_iCallback = k_iSteamStreamLauncherCallbacks + 1 }; + bool m_bSuccess; + void *m_hwnd; +}; + +//----------------------------------------------------------------------------- +// The user requested that the application stop streaming +//----------------------------------------------------------------------------- +struct StopStreamingRequest_t +{ + enum { k_iCallback = k_iSteamStreamLauncherCallbacks + 2 }; +}; + +//----------------------------------------------------------------------------- +// The big picture window is closed and no longer ready for streaming +//----------------------------------------------------------------------------- +struct BigPictureStreamingDone_t +{ + enum { k_iCallback = k_iSteamStreamLauncherCallbacks + 3 }; +}; + +//----------------------------------------------------------------------------- +// Steam is about to restart, continue streaming when it is available again +//----------------------------------------------------------------------------- +struct BigPictureStreamRestarting_t +{ + enum { k_iCallback = k_iSteamStreamLauncherCallbacks + 4 }; +}; + +#pragma pack( pop ) + +#endif // ISTEAMSTREAMLAUNCHER_H diff --git a/public/steam/isteamugc.h b/public/steam/isteamugc.h new file mode 100644 index 000000000..c574bf5ce --- /dev/null +++ b/public/steam/isteamugc.h @@ -0,0 +1,385 @@ +//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam ugc +// +//============================================================================= + +#ifndef ISTEAMUGC_H +#define ISTEAMUGC_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +typedef uint64 UGCQueryHandle_t; +typedef uint64 UGCUpdateHandle_t; + + +const UGCQueryHandle_t k_UGCQueryHandleInvalid = 0xffffffffffffffffull; +const UGCUpdateHandle_t k_UGCUpdateHandleInvalid = 0xffffffffffffffffull; + + +// Matching UGC types for queries +enum EUGCMatchingUGCType +{ + k_EUGCMatchingUGCType_Items = 0, // both mtx items and ready-to-use items + k_EUGCMatchingUGCType_Items_Mtx = 1, + k_EUGCMatchingUGCType_Items_ReadyToUse = 2, + k_EUGCMatchingUGCType_Collections = 3, + k_EUGCMatchingUGCType_Artwork = 4, + k_EUGCMatchingUGCType_Videos = 5, + k_EUGCMatchingUGCType_Screenshots = 6, + k_EUGCMatchingUGCType_AllGuides = 7, // both web guides and integrated guides + k_EUGCMatchingUGCType_WebGuides = 8, + k_EUGCMatchingUGCType_IntegratedGuides = 9, + k_EUGCMatchingUGCType_UsableInGame = 10, // ready-to-use items and integrated guides + k_EUGCMatchingUGCType_ControllerBindings = 11, + k_EUGCMatchingUGCType_GameManagedItems = 12, // game managed items (not managed by users) + k_EUGCMatchingUGCType_All = ~0, // return everything +}; + +// Different lists of published UGC for a user. +// If the current logged in user is different than the specified user, then some options may not be allowed. +enum EUserUGCList +{ + k_EUserUGCList_Published, + k_EUserUGCList_VotedOn, + k_EUserUGCList_VotedUp, + k_EUserUGCList_VotedDown, + k_EUserUGCList_WillVoteLater, + k_EUserUGCList_Favorited, + k_EUserUGCList_Subscribed, + k_EUserUGCList_UsedOrPlayed, + k_EUserUGCList_Followed, +}; + +// Sort order for user published UGC lists (defaults to creation order descending) +enum EUserUGCListSortOrder +{ + k_EUserUGCListSortOrder_CreationOrderDesc, + k_EUserUGCListSortOrder_CreationOrderAsc, + k_EUserUGCListSortOrder_TitleAsc, + k_EUserUGCListSortOrder_LastUpdatedDesc, + k_EUserUGCListSortOrder_SubscriptionDateDesc, + k_EUserUGCListSortOrder_VoteScoreDesc, + k_EUserUGCListSortOrder_ForModeration, +}; + +// Combination of sorting and filtering for queries across all UGC +enum EUGCQuery +{ + k_EUGCQuery_RankedByVote = 0, + k_EUGCQuery_RankedByPublicationDate = 1, + k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate = 2, + k_EUGCQuery_RankedByTrend = 3, + k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate = 4, + k_EUGCQuery_CreatedByFriendsRankedByPublicationDate = 5, + k_EUGCQuery_RankedByNumTimesReported = 6, + k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate = 7, + k_EUGCQuery_NotYetRated = 8, + k_EUGCQuery_RankedByTotalVotesAsc = 9, + k_EUGCQuery_RankedByVotesUp = 10, + k_EUGCQuery_RankedByTextSearch = 11, + k_EUGCQuery_RankedByTotalUniqueSubscriptions = 12, +}; + +enum EItemUpdateStatus +{ + k_EItemUpdateStatusInvalid = 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t + k_EItemUpdateStatusPreparingConfig = 1, // The item update is processing configuration data + k_EItemUpdateStatusPreparingContent = 2, // The item update is reading and processing content files + k_EItemUpdateStatusUploadingContent = 3, // The item update is uploading content changes to Steam + k_EItemUpdateStatusUploadingPreviewFile = 4, // The item update is uploading new preview file image + k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes +}; + +enum EItemState +{ + k_EItemStateNone = 0, // item not tracked on client + k_EItemStateSubscribed = 1, // current user is subscribed to this item. Not just cached. + k_EItemStateLegacyItem = 2, // item was created with ISteamRemoteStorage + k_EItemStateInstalled = 4, // item is installed and usable (but maybe out of date) + k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content + k_EItemStateDownloading = 16, // item update is currently downloading + k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired +}; + +enum EItemStatistic +{ + k_EItemStatistic_NumSubscriptions = 0, + k_EItemStatistic_NumFavorites = 1, + k_EItemStatistic_NumFollowers = 2, + k_EItemStatistic_NumUniqueSubscriptions = 3, + k_EItemStatistic_NumUniqueFavorites = 4, + k_EItemStatistic_NumUniqueFollowers = 5, + k_EItemStatistic_NumUniqueWebsiteViews = 6, + k_EItemStatistic_ReportScore = 7, +}; + +const uint32 kNumUGCResultsPerPage = 50; +const uint32 k_cchDeveloperMetadataMax = 5000; + +// Details for a single published file/UGC +struct SteamUGCDetails_t +{ + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; // The result of the operation. + EWorkshopFileType m_eFileType; // Type of the file + AppId_t m_nCreatorAppID; // ID of the app that created this file. + AppId_t m_nConsumerAppID; // ID of the app that will consume this file. + char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document + char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document + uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content. + uint32 m_rtimeCreated; // time when the published file was created + uint32 m_rtimeUpdated; // time when the published file was last updated + uint32 m_rtimeAddedToUserList; // time when the user added the published file to their list (not always applicable) + ERemoteStoragePublishedFileVisibility m_eVisibility; // visibility + bool m_bBanned; // whether the file was banned + bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop + bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer + char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file + // file/url information + UGCHandle_t m_hFile; // The handle of the primary file + UGCHandle_t m_hPreviewFile; // The handle of the preview file + char m_pchFileName[k_cchFilenameMax]; // The cloud filename of the primary file + int32 m_nFileSize; // Size of the primary file + int32 m_nPreviewFileSize; // Size of the preview file + char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website) + // voting information + uint32 m_unVotesUp; // number of votes up + uint32 m_unVotesDown; // number of votes down + float m_flScore; // calculated score + // collection details + uint32 m_unNumChildren; +}; + +//----------------------------------------------------------------------------- +// Purpose: Steam UGC support API +//----------------------------------------------------------------------------- +class ISteamUGC +{ +public: + + // Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. + virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + + // Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + + // Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this) + virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + + // Send the query to Steam + virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0; + + // Retrieve an individual result after receiving the callback for querying UGC + virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0; + virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0; + virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0; + virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; + virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint32 *pStatValue ) = 0; + virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, char *pchURLOrVideoID, uint32 cchURLSize, bool *pbIsImage ) = 0; + virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, char *pchKey, uint32 cchKeySize, char *pchValue, uint32 cchValueSize ) = 0; + + // Release the request to free up memory, after retrieving results + virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0; + + // Options to set for querying UGC + virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0; + virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0; + virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0; + virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0; + virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0; + virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0; + virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0; + virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0; + + // Options only for querying user UGC + virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0; + + // Options only for querying all UGC + virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0; + virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0; + virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0; + virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0; + + // DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead! + virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; + + // Steam Workshop Creator API + virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet + + virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate() + + virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item + virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item + virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set + virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) + virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item + virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item + virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder + virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key + virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. + + virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() + virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; + + // Steam Workshop Consumer API + virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0; + virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0; + virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP + virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits + virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items + virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs + + // get EItemState flags about item on this client + virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0; + + // get info about currently installed content on disc for items that have k_EItemStateInstalled set + // if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder) + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; + + // get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once + virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed, + // then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time. + // If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP. + virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0; + + // game servers can set a specific workshop folder before issuing any UGC commands. + // This is helpful if you want to support multiple game servers running out of the same install folder + virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0; + + // SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends + virtual void SuspendDownloads( bool bSuspend ) = 0; +}; + +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION007" + +//----------------------------------------------------------------------------- +// Purpose: Callback for querying UGC +//----------------------------------------------------------------------------- +struct SteamUGCQueryCompleted_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 1 }; + UGCQueryHandle_t m_handle; + EResult m_eResult; + uint32 m_unNumResultsReturned; + uint32 m_unTotalMatchingResults; + bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback for requesting details on one piece of UGC +//----------------------------------------------------------------------------- +struct SteamUGCRequestUGCDetailsResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 2 }; + SteamUGCDetails_t m_details; + bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache +}; + + +//----------------------------------------------------------------------------- +// Purpose: result for ISteamUGC::CreateItem() +//----------------------------------------------------------------------------- +struct CreateItemResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 3 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: result for ISteamUGC::SubmitItemUpdate() +//----------------------------------------------------------------------------- +struct SubmitItemUpdateResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 4 }; + EResult m_eResult; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a Workshop item has been installed or updated +//----------------------------------------------------------------------------- +struct ItemInstalled_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 5 }; + AppId_t m_unAppID; + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of DownloadItem(), existing item files can be accessed again +//----------------------------------------------------------------------------- +struct DownloadItemResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 6 }; + AppId_t m_unAppID; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() +//----------------------------------------------------------------------------- +struct UserFavoriteItemsListChanged_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 7 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bWasAddRequest; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to SetUserItemVote() +//----------------------------------------------------------------------------- +struct SetUserItemVoteResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 8 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bVoteUp; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetUserItemVote() +//----------------------------------------------------------------------------- +struct GetUserItemVoteResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 9 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bVotedUp; + bool m_bVotedDown; + bool m_bVoteSkipped; +}; + +#pragma pack( pop ) + +#endif // ISTEAMUGC_H diff --git a/public/steam/isteamunifiedmessages.h b/public/steam/isteamunifiedmessages.h new file mode 100644 index 000000000..edee4a486 --- /dev/null +++ b/public/steam/isteamunifiedmessages.h @@ -0,0 +1,63 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Interface to unified messages client +// +// You should not need to use this interface except if your product is using a language other than C++. +// Contact your Steam Tech contact for more details. +// +//============================================================================= + +#ifndef ISTEAMUNIFIEDMESSAGES_H +#define ISTEAMUNIFIEDMESSAGES_H +#ifdef _WIN32 +#pragma once +#endif + +typedef uint64 ClientUnifiedMessageHandle; + +class ISteamUnifiedMessages +{ +public: + static const ClientUnifiedMessageHandle k_InvalidUnifiedMessageHandle = 0; + + // Sends a service method (in binary serialized form) using the Steam Client. + // Returns a unified message handle (k_InvalidUnifiedMessageHandle if could not send the message). + virtual ClientUnifiedMessageHandle SendMethod( const char *pchServiceMethod, const void *pRequestBuffer, uint32 unRequestBufferSize, uint64 unContext ) = 0; + + // Gets the size of the response and the EResult. Returns false if the response is not ready yet. + virtual bool GetMethodResponseInfo( ClientUnifiedMessageHandle hHandle, uint32 *punResponseSize, EResult *peResult ) = 0; + + // Gets a response in binary serialized form (and optionally release the corresponding allocated memory). + virtual bool GetMethodResponseData( ClientUnifiedMessageHandle hHandle, void *pResponseBuffer, uint32 unResponseBufferSize, bool bAutoRelease ) = 0; + + // Releases the message and its corresponding allocated memory. + virtual bool ReleaseMethod( ClientUnifiedMessageHandle hHandle ) = 0; + + // Sends a service notification (in binary serialized form) using the Steam Client. + // Returns true if the notification was sent successfully. + virtual bool SendNotification( const char *pchServiceNotification, const void *pNotificationBuffer, uint32 unNotificationBufferSize ) = 0; +}; + +#define STEAMUNIFIEDMESSAGES_INTERFACE_VERSION "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +struct SteamUnifiedMessagesSendMethodResult_t +{ + enum { k_iCallback = k_iClientUnifiedMessagesCallbacks + 1 }; + ClientUnifiedMessageHandle m_hHandle; // The handle returned by SendMethod(). + uint64 m_unContext; // Context provided when calling SendMethod(). + EResult m_eResult; // The result of the method call. + uint32 m_unResponseSize; // The size of the response. +}; + +#pragma pack( pop ) + +#endif // ISTEAMUNIFIEDMESSAGES_H diff --git a/public/steam/isteamuser.h b/public/steam/isteamuser.h index 7bd468785..5af937d27 100644 --- a/public/steam/isteamuser.h +++ b/public/steam/isteamuser.h @@ -1,174 +1,380 @@ -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to user account information in Steam -// -//============================================================================= - -#ifndef ISTEAMUSER_H -#define ISTEAMUSER_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -// structure that contains client callback data -struct CallbackMsg_t -{ - HSteamUser m_hSteamUser; - int m_iCallback; - uint8 *m_pubParam; - int m_cubParam; -}; - -// reference to a steam call, to filter results by -typedef int32 HSteamCall; - -enum ERegistrySubTree -{ - k_ERegistrySubTreeNews = 0, - k_ERegistrySubTreeApps = 1, - k_ERegistrySubTreeSubscriptions = 2, - k_ERegistrySubTreeGameServers = 3, - k_ERegistrySubTreeFriends = 4, - k_ERegistrySubTreeSystem = 5, -}; - -enum EAppUsageEvent -{ - k_EAppUsageEventGameLaunch = 1, - k_EAppUsageEventGameLaunchTrial = 2, - k_EAppUsageEventMedia = 3, - k_EAppUsageEventPreloadStart = 4, - k_EAppUsageEventPreloadFinish = 5, - k_EAppUsageEventMarketingMessageView = 6, // deprecated, do not use - k_EAppUsageEventInGameAdViewed = 7, - k_EAppUsageEventGameLaunchFreeWeekend = 8, -}; - - -//----------------------------------------------------------------------------- -// Purpose: Functions for accessing and manipulating a steam account -// associated with one client instance -//----------------------------------------------------------------------------- -class ISteamUser -{ -public: - // returns the HSteamUser this interface represents - virtual HSteamUser GetHSteamUser() = 0; - - // steam account management functions - virtual bool BLoggedOn() = 0; - virtual CSteamID GetSteamID() = 0; - - // notify of connection to game server - virtual int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure, void *pvSteam2GetEncryptionKey, int cbSteam2GetEncryptionKey ) = 0; - // notify of disconnect - virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0; - - // game info - virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0; - - // legacy authentication support - need to be called if the game server rejects the user with a 'bad ticket' error - virtual void RefreshSteam2Login() = 0; -}; - -#define STEAMUSER_INTERFACE_VERSION "SteamUser008" - - -// callbacks - - -//----------------------------------------------------------------------------- -// Purpose: called when a logon attempt has succeeded -//----------------------------------------------------------------------------- -struct LogonSuccess_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 1 }; -}; - - -//----------------------------------------------------------------------------- -// Purpose: called when a logon attempt has failed -//----------------------------------------------------------------------------- -struct LogonFailure_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 2 }; - EResult m_eResult; -}; - - -//----------------------------------------------------------------------------- -// Purpose: called when the user logs off -//----------------------------------------------------------------------------- -struct LoggedOff_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 3 }; - EResult m_eResult; -}; - - -//----------------------------------------------------------------------------- -// Purpose: called when the client is trying to retry logon after being unintentionally logged off -//----------------------------------------------------------------------------- -struct BeginLogonRetry_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 4 }; -}; - - -//----------------------------------------------------------------------------- -// Purpose: connect to game server denied -//----------------------------------------------------------------------------- -struct ClientGameServerDeny_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 13 }; - - uint32 m_uAppID; - uint32 m_unGameServerIP; - uint16 m_usGameServerPort; - uint16 m_bSecure; - uint32 m_uReason; -}; - - -//----------------------------------------------------------------------------- -// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) -// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect -//----------------------------------------------------------------------------- -struct CallbackPipeFailure_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 17 }; -}; - - -//----------------------------------------------------------------------------- -// Purpose: connect to game server denied -//----------------------------------------------------------------------------- -struct GSPolicyResponse_t -{ - enum { k_iCallback = k_iSteamUserCallbacks + 15 }; - uint8 m_bSecure; -}; - - -// C API bindings for GoldSRC, see isteamclient.h for details -extern "C" -{ - // C functions we export for the C API, maps to ISteamUser functions - DLL_EXPORT void Steam_LogOn( HSteamUser hUser, HSteamPipe hSteamPipe, uint64 ulSteamID ); - DLL_EXPORT void Steam_LogOff( HSteamUser hUser, HSteamPipe hSteamPipe ); - DLL_EXPORT bool Steam_BLoggedOn( HSteamUser hUser, HSteamPipe hSteamPipe ); - DLL_EXPORT bool Steam_BConnected( HSteamUser hUser, HSteamPipe hSteamPipe ); - DLL_EXPORT bool Steam_BGetCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg, HSteamCall *phSteamCall ); - DLL_EXPORT void Steam_FreeLastCallback( HSteamPipe hSteamPipe ); - DLL_EXPORT int Steam_GSGetSteamGameConnectToken( HSteamUser hUser, HSteamPipe hSteamPipe, void *pBlob, int cbBlobMax ); - DLL_EXPORT int Steam_InitiateGameConnection( HSteamUser hUser, HSteamPipe hSteamPipe, void *pBlob, int cbMaxBlob, uint64 steamID, int nGameAppID, uint32 unIPServer, uint16 usPortServer, bool bSecure ); - DLL_EXPORT void Steam_TerminateGameConnection( HSteamUser hUser, HSteamPipe hSteamPipe, uint32 unIPServer, uint16 usPortServer ); - - - typedef bool (*PFNSteam_BGetCallback)( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg, HSteamCall *phSteamCall ); - typedef void (*PFNSteam_FreeLastCallback)( HSteamPipe hSteamPipe ); -} - -#endif // ISTEAMUSER_H +//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to user account information in Steam +// +//============================================================================= + +#ifndef ISTEAMUSER_H +#define ISTEAMUSER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +// structure that contains client callback data +// see callbacks documentation for more details +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif +struct CallbackMsg_t +{ + HSteamUser m_hSteamUser; + int m_iCallback; + uint8 *m_pubParam; + int m_cubParam; +}; +#pragma pack( pop ) + +// reference to a steam call, to filter results by +typedef int32 HSteamCall; + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing and manipulating a steam account +// associated with one client instance +//----------------------------------------------------------------------------- +class ISteamUser +{ +public: + // returns the HSteamUser this interface represents + // this is only used internally by the API, and by a few select interfaces that support multi-user + virtual HSteamUser GetHSteamUser() = 0; + + // returns true if the Steam client current has a live connection to the Steam servers. + // If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy. + // The Steam client will automatically be trying to recreate the connection as often as possible. + virtual bool BLoggedOn() = 0; + + // returns the CSteamID of the account currently logged into the Steam client + // a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API + virtual CSteamID GetSteamID() = 0; + + // Multiplayer Authentication functions + + // InitiateGameConnection() starts the state machine for authenticating the game client with the game server + // It is the client portion of a three-way handshake between the client, the game server, and the steam servers + // + // Parameters: + // void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token. + // int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes. + // CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client + // CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( ) + // uint32 unIPServer, uint16 usPortServer - the IP address of the game server + // bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running) + // + // return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed + // The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process. + virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0; + + // notify of disconnect + // needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call + virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0; + + // Legacy functions + + // used by only a few games to track usage events + virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0; + + // get the local storage folder for current Steam account to write application data, e.g. save games, configs etc. + // this will usually be something like "C:\Progam Files\Steam\userdata\\\local" + virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0; + + // Starts voice recording. Once started, use GetVoice() to get the data + virtual void StartVoiceRecording( ) = 0; + + // Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for + // a little bit after this function is called. GetVoice() should continue to be called until it returns + // k_eVoiceResultNotRecording + virtual void StopVoiceRecording( ) = 0; + + // Determine the amount of captured audio data that is available in bytes. + // This provides both the compressed and uncompressed data. Please note that the uncompressed + // data is not the raw feed from the microphone: data may only be available if audible + // levels of speech are detected. + // nUncompressedVoiceDesiredSampleRate is necessary to know the number of bytes to return in pcbUncompressed - can be set to 0 if you don't need uncompressed (the usual case) + // If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate + virtual EVoiceResult GetAvailableVoice( uint32 *pcbCompressed, uint32 *pcbUncompressed, uint32 nUncompressedVoiceDesiredSampleRate ) = 0; + + // Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to + // DecompressVoice() for playback later as a binary blob. Uncompressed data is 16-bit, signed integer, 11025Hz PCM format. + // Please note that the uncompressed data is not the raw feed from the microphone: data may only be available if audible + // levels of speech are detected, and may have passed through denoising filters, etc. + // This function should be called as often as possible once recording has started; once per frame at least. + // nBytesWritten is set to the number of bytes written to pDestBuffer. + // nUncompressedBytesWritten is set to the number of bytes written to pUncompressedDestBuffer. + // You must grab both compressed and uncompressed here at the same time, if you want both. + // Matching data that is not read during this call will be thrown away. + // GetAvailableVoice() can be used to determine how much data is actually available. + // If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate + virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 *nUncompressBytesWritten, uint32 nUncompressedVoiceDesiredSampleRate ) = 0; + + // Decompresses a chunk of compressed data produced by GetVoice(). + // nBytesWritten is set to the number of bytes written to pDestBuffer unless the return value is k_EVoiceResultBufferTooSmall. + // In that case, nBytesWritten is set to the size of the buffer required to decompress the given + // data. The suggested buffer size for the destination buffer is 22 kilobytes. + // The output format of the data is 16-bit signed at the requested samples per second. + // If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nDesiredSampleRate + virtual EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate ) = 0; + + // This returns the frequency of the voice data as it's stored internally; calling DecompressVoice() with this size will yield the best results + virtual uint32 GetVoiceOptimalSampleRate() = 0; + + // Retrieve ticket to be sent to the entity who wishes to authenticate you. + // pcbTicket retrieves the length of the actual ticket. + virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0; + + // Authenticate ticket from entity steamID to be sure it is valid and isnt reused + // Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) + virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0; + + // Stop tracking started by BeginAuthSession - called when no longer playing game with this entity + virtual void EndAuthSession( CSteamID steamID ) = 0; + + // Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to + virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0; + + // After receiving a user's authentication data, and passing it to BeginAuthSession, use this function + // to determine if the user owns downloadable content specified by the provided AppID. + virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0; + + // returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam + // (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT. + virtual bool BIsBehindNAT() = 0; + + // set data to be replicated to friends so that they can join your game + // CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client + // uint32 unIPServer, uint16 usPortServer - the IP address of the game server + virtual void AdvertiseGame( CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer ) = 0; + + // Requests a ticket encrypted with an app specific shared key + // pDataToInclude, cbDataToInclude will be encrypted into the ticket + // ( This is asynchronous, you must wait for the ticket to be completed by the server ) + virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0; + + // retrieve a finished ticket + virtual bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0; + + // Trading Card badges data access + // if you only have one set of cards, the series will be 1 + // the user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1) + virtual int GetGameBadgeLevel( int nSeries, bool bFoil ) = 0; + + // gets the Steam Level of the user, as shown on their profile + virtual int GetPlayerSteamLevel() = 0; + + // Requests a URL which authenticates an in-game browser for store check-out, + // and then redirects to the specified URL. As long as the in-game browser + // accepts and handles session cookies, Steam microtransaction checkout pages + // will automatically recognize the user instead of presenting a login page. + // The result of this API call will be a StoreAuthURLResponse_t callback. + // NOTE: The URL has a very short lifetime to prevent history-snooping attacks, + // so you should only call this API when you are about to launch the browser, + // or else immediately navigate to the result URL using a hidden browser window. + // NOTE 2: The resulting authorization cookie has an expiration time of one day, + // so it would be a good idea to request and visit a new auth URL every 12 hours. + virtual SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL ) = 0; + +#ifdef _PS3 + // Initiates PS3 Logon request using just PSN ticket. + // + // PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to + // prompt the user for network setup/PSN logon before initiating the Steam side of the logon. + // + // Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t + // may return with EResult k_EResultExternalAccountUnlinked if the PSN account is unknown to Steam. You should + // then call LogOnAndLinkSteamAccountToPSN() after prompting the user for credentials to establish a link. + // Future calls to LogOn() after the one time link call should succeed as long as the user is connected to PSN. + virtual void LogOn( bool bInteractive ) = 0; + + // Initiates a request to logon with a specific steam username/password and create a PSN account link at + // the same time. Should call this only if LogOn() has failed and indicated the PSN account is unlinked. + // + // PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to + // prompt the user for network setup/PSN logon before initiating the Steam side of the logon. pchUserName + // should be the users Steam username, and pchPassword should be the users Steam password. + // + // Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t + // may return with EResult k_EResultOtherAccountAlreadyLinked if already linked to another account. + virtual void LogOnAndLinkSteamAccountToPSN( bool bInteractive, const char *pchUserName, const char *pchPassword ) = 0; + + // Final logon option for PS3, this logs into an existing account if already linked, but if not already linked + // creates a new account using the info in the PSN ticket to generate a unique account name. The new account is + // then linked to the PSN ticket. This is the faster option for new users who don't have an existing Steam account + // to get into multiplayer. + // + // PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to + // prompt the user for network setup/PSN logon before initiating the Steam side of the logon. + virtual void LogOnAndCreateNewSteamAccountIfNeeded( bool bInteractive ) = 0; + + // Returns a special SteamID that represents the user's PSN information. Can be used to query the user's PSN avatar, + // online name, etc. through the standard Steamworks interfaces. + virtual CSteamID GetConsoleSteamID() = 0; +#endif + +}; + +#define STEAMUSER_INTERFACE_VERSION "SteamUser018" + + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when a connections to the Steam back-end has been established +// this means the Steam client now has a working connection to the Steam servers +// usually this will have occurred before the game has launched, and should +// only be seen if the user has dropped connection due to a networking issue +// or a Steam server update +//----------------------------------------------------------------------------- +struct SteamServersConnected_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 1 }; +}; + +//----------------------------------------------------------------------------- +// Purpose: called when a connection attempt has failed +// this will occur periodically if the Steam client is not connected, +// and has failed in it's retry to establish a connection +//----------------------------------------------------------------------------- +struct SteamServerConnectFailure_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 2 }; + EResult m_eResult; + bool m_bStillRetrying; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called if the client has lost connection to the Steam servers +// real-time services will be disabled until a matching SteamServersConnected_t has been posted +//----------------------------------------------------------------------------- +struct SteamServersDisconnected_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 3 }; + EResult m_eResult; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, +// which it may be in the process of or already connected to. +// The game client should immediately disconnect upon receiving this message. +// This can usually occur if the user doesn't have rights to play on the game server. +//----------------------------------------------------------------------------- +struct ClientGameServerDeny_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 13 }; + + uint32 m_uAppID; + uint32 m_unGameServerIP; + uint16 m_usGameServerPort; + uint16 m_bSecure; + uint32 m_uReason; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) +// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect. +// This usually occurs in the rare event the Steam client has some kind of fatal error. +//----------------------------------------------------------------------------- +struct IPCFailure_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 17 }; + enum EFailureType + { + k_EFailureFlushedCallbackQueue, + k_EFailurePipeFail, + }; + uint8 m_eFailureType; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Signaled whenever licenses change +//----------------------------------------------------------------------------- +struct LicensesUpdated_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 25 }; +}; + + +//----------------------------------------------------------------------------- +// callback for BeginAuthSession +//----------------------------------------------------------------------------- +struct ValidateAuthTicketResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 43 }; + CSteamID m_SteamID; + EAuthSessionResponse m_eAuthSessionResponse; + CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when a user has responded to a microtransaction authorization request +//----------------------------------------------------------------------------- +struct MicroTxnAuthorizationResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 52 }; + + uint32 m_unAppID; // AppID for this microtransaction + uint64 m_ulOrderID; // OrderID provided for the microtransaction + uint8 m_bAuthorized; // if user authorized transaction +}; + + +//----------------------------------------------------------------------------- +// Purpose: Result from RequestEncryptedAppTicket +//----------------------------------------------------------------------------- +struct EncryptedAppTicketResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 54 }; + + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// callback for GetAuthSessionTicket +//----------------------------------------------------------------------------- +struct GetAuthSessionTicketResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 63 }; + HAuthTicket m_hAuthTicket; + EResult m_eResult; +}; + + +//----------------------------------------------------------------------------- +// Purpose: sent to your game in response to a steam://gamewebcallback/ command +//----------------------------------------------------------------------------- +struct GameWebCallback_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 64 }; + char m_szURL[256]; +}; + +//----------------------------------------------------------------------------- +// Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL +//----------------------------------------------------------------------------- +struct StoreAuthURLResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 65 }; + char m_szURL[512]; +}; + + + +#pragma pack( pop ) + +#endif // ISTEAMUSER_H diff --git a/public/steam/isteamuserstats.h b/public/steam/isteamuserstats.h index d36e3dc24..3a65691ce 100644 --- a/public/steam/isteamuserstats.h +++ b/public/steam/isteamuserstats.h @@ -1,112 +1,465 @@ -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to user account information in Steam -// -//============================================================================= - -#ifndef ISTEAMUSERSTATS_H -#define ISTEAMUSERSTATS_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -// size limit on stat or achievement name -const uint32 k_cchStatNameMax = 128; - -class ISteamUserStats -{ -public: - - // The "schema" of a Game's UserData is really defined elsewhere, and - // the game should know it before accessing this interface. These top - // three functions are mostly provided for iteration / testing purposes. - // Get the number of stats fields for nGameID - virtual uint32 GetNumStats( CGameID nGameID ) = 0; - // Get stat name iStat in [0,GetNumStats) - virtual const char *GetStatName( CGameID nGameID, uint32 iStat ) = 0; - // Get type of this field - virtual ESteamUserStatType GetStatType( CGameID nGameID, const char *pchName ) = 0; - // Get the number of achievements for nGameID - virtual uint32 GetNumAchievements( CGameID nGameID ) = 0; - // Get achievement name iAchievement in [0,GetNumAchievements) - virtual const char *GetAchievementName( CGameID nGameID, uint32 iAchievement ) = 0; - - // Ask the server to send down this user's data and achievements for nGameID - virtual bool RequestCurrentStats( CGameID nGameID ) = 0; - - // Data accessors - virtual bool GetStat( CGameID nGameID, const char *pchName, int32 *pData ) = 0; - virtual bool GetStat( CGameID nGameID, const char *pchName, float *pData ) = 0; - - // Set / update data - virtual bool SetStat( CGameID nGameID, const char *pchName, int32 nData ) = 0; - virtual bool SetStat( CGameID nGameID, const char *pchName, float fData ) = 0; - virtual bool UpdateAvgRateStat( CGameID nGameID, const char *pchName, uint32 nCountThisSession, double dSessionLength ) = 0; - - // Achievement flag accessors - virtual bool GetAchievement( CGameID nGameID, const char *pchName, bool *pbAchieved ) = 0; - virtual bool SetAchievement( CGameID nGameID, const char *pchName ) = 0; - virtual bool ClearAchievement( CGameID nGameID, const char *pchName ) = 0; - - // Store the current data on the server, will get a callback when set - // And one callback for every new achievement - virtual bool StoreStats( CGameID nGameID ) = 0; - - // Achievement / GroupAchievement metadata - - // Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set - virtual int GetAchievementIcon( CGameID nGameID, const char *pchName ) = 0; - // Get general attributes (display name / text, etc) for an Achievement - virtual const char *GetAchievementDisplayAttribute( CGameID nGameID, const char *pchName, const char *pchKey ) = 0; - - // Achievement progress - triggers an AchievementProgress callback, that is all. - // Calling this w/ N out of N progress will NOT set the achievement, the game must still do that. - virtual bool IndicateAchievementProgress( CGameID nGameID, const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0; - -}; - - -#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION002" - -//----------------------------------------------------------------------------- -// Purpose: called when the latests stats and achievements have been received -// from the server -//----------------------------------------------------------------------------- -struct UserStatsReceived_t -{ - enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 }; - uint64 m_nGameID; // Game these stats are for - EResult m_eResult; // Success / error fetching the stats -}; - - -//----------------------------------------------------------------------------- -// Purpose: result of a request to store the user stats for a game -//----------------------------------------------------------------------------- -struct UserStatsStored_t -{ - enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 }; - uint64 m_nGameID; // Game these stats are for - EResult m_eResult; // success / error -}; - -//----------------------------------------------------------------------------- -// Purpose: result of a request to store the achievements for a game, or an -// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress -// are zero, that means the achievement has been fully unlocked. -//----------------------------------------------------------------------------- -struct UserAchievementStored_t -{ - enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 }; - - uint64 m_nGameID; // Game this is for - bool m_bGroupAchievement; // if this is a "group" achievement - char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement - uint32 m_nCurProgress; // current progress towards the achievement - uint32 m_nMaxProgress; // "out of" this many -}; - - -#endif // ISTEAMUSER_H +//====== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to stats, achievements, and leaderboards +// +//============================================================================= + +#ifndef ISTEAMUSERSTATS_H +#define ISTEAMUSERSTATS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" +#include "isteamremotestorage.h" + +// size limit on stat or achievement name (UTF-8 encoded) +enum { k_cchStatNameMax = 128 }; + +// maximum number of bytes for a leaderboard name (UTF-8 encoded) +enum { k_cchLeaderboardNameMax = 128 }; + +// maximum number of details int32's storable for a single leaderboard entry +enum { k_cLeaderboardDetailsMax = 64 }; + +// handle to a single leaderboard +typedef uint64 SteamLeaderboard_t; + +// handle to a set of downloaded entries in a leaderboard +typedef uint64 SteamLeaderboardEntries_t; + +// type of data request, when downloading leaderboard entries +enum ELeaderboardDataRequest +{ + k_ELeaderboardDataRequestGlobal = 0, + k_ELeaderboardDataRequestGlobalAroundUser = 1, + k_ELeaderboardDataRequestFriends = 2, + k_ELeaderboardDataRequestUsers = 3 +}; + +// the sort order of a leaderboard +enum ELeaderboardSortMethod +{ + k_ELeaderboardSortMethodNone = 0, + k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number + k_ELeaderboardSortMethodDescending = 2, // top-score is highest number +}; + +// the display type (used by the Steam Community web site) for a leaderboard +enum ELeaderboardDisplayType +{ + k_ELeaderboardDisplayTypeNone = 0, + k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score + k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds + k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds +}; + +enum ELeaderboardUploadScoreMethod +{ + k_ELeaderboardUploadScoreMethodNone = 0, + k_ELeaderboardUploadScoreMethodKeepBest = 1, // Leaderboard will keep user's best score + k_ELeaderboardUploadScoreMethodForceUpdate = 2, // Leaderboard will always replace score with specified +}; + +// a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry() +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +struct LeaderboardEntry_t +{ + CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info + int32 m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard + int32 m_nScore; // score as set in the leaderboard + int32 m_cDetails; // number of int32 details available for this entry + UGCHandle_t m_hUGC; // handle for UGC attached to the entry +}; + +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing stats, achievements, and leaderboard information +//----------------------------------------------------------------------------- +class ISteamUserStats +{ +public: + // Ask the server to send down this user's data and achievements for this game + virtual bool RequestCurrentStats() = 0; + + // Data accessors + virtual bool GetStat( const char *pchName, int32 *pData ) = 0; + virtual bool GetStat( const char *pchName, float *pData ) = 0; + + // Set / update data + virtual bool SetStat( const char *pchName, int32 nData ) = 0; + virtual bool SetStat( const char *pchName, float fData ) = 0; + virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0; + + // Achievement flag accessors + virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0; + virtual bool SetAchievement( const char *pchName ) = 0; + virtual bool ClearAchievement( const char *pchName ) = 0; + + // Get the achievement status, and the time it was unlocked if unlocked. + // If the return value is true, but the unlock time is zero, that means it was unlocked before Steam + // began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970. + virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0; + + // Store the current data on the server, will get a callback when set + // And one callback for every new achievement + // + // If the callback has a result of k_EResultInvalidParam, one or more stats + // uploaded has been rejected, either because they broke constraints + // or were out of date. In this case the server sends back updated values. + // The stats should be re-iterated to keep in sync. + virtual bool StoreStats() = 0; + + // Achievement / GroupAchievement metadata + + // Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set. + // A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback + // which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the + // specified achievement. + virtual int GetAchievementIcon( const char *pchName ) = 0; + + // Get general attributes for an achievement. Accepts the following keys: + // - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8) + // - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden) + virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0; + + // Achievement progress - triggers an AchievementProgress callback, that is all. + // Calling this w/ N out of N progress will NOT set the achievement, the game must still do that. + virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0; + + // Used for iterating achievements. In general games should not need these functions because they should have a + // list of existing achievements compiled into them + virtual uint32 GetNumAchievements() = 0; + // Get achievement name iAchievement in [0,GetNumAchievements) + virtual const char *GetAchievementName( uint32 iAchievement ) = 0; + + // Friends stats & achievements + + // downloads stats for the user + // returns a UserStatsReceived_t received when completed + // if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail + // these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data + virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; + + // requests stat information for a user, usable after a successful call to RequestUserStats() + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0; + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0; + virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0; + // See notes for GetAchievementAndUnlockTime above + virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0; + + // Reset stats + virtual bool ResetAllStats( bool bAchievementsToo ) = 0; + + // Leaderboard functions + + // asks the Steam back-end for a leaderboard by name, and will create it if it's not yet + // This call is asynchronous, with the result returned in LeaderboardFindResult_t + virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0; + + // as above, but won't create the leaderboard if it's not found + // This call is asynchronous, with the result returned in LeaderboardFindResult_t + virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0; + + // returns the name of a leaderboard + virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // returns the total number of entries in a leaderboard, as of the last request + virtual int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // returns the sort method of the leaderboard + virtual ELeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // returns the display type of the leaderboard + virtual ELeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // Asks the Steam back-end for a set of rows in the leaderboard. + // This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t + // LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below) + // You can ask for more entries than exist, and it will return as many as do exist. + // k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries] + // k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate + // e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after + // k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user + virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0; + // as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers + // if a user doesn't have a leaderboard entry, they won't be included in the result + // a max of 100 users can be downloaded at a time, with only one outstanding call at a time + METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) + virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, + ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; + + // Returns data about a single leaderboard entry + // use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries + // e.g. + // void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded ) + // { + // for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ ) + // { + // LeaderboardEntry_t leaderboardEntry; + // int32 details[3]; // we know this is how many we've stored previously + // GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 ); + // assert( leaderboardEntry.m_cDetails == 3 ); + // ... + // } + // once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid + virtual bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) = 0; + + // Uploads a user score to the Steam back-end. + // This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t + // Details are extra game-defined information regarding how the user got that score + // pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list + virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0; + + // Attaches a piece of user generated content the user's entry on a leaderboard. + // hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare(). + // This call is asynchronous, with the result returned in LeaderboardUGCSet_t. + virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0; + + // Retrieves the number of players currently playing your game (online + offline) + // This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t + virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0; + + // Requests that Steam fetch data on the percentage of players who have received each achievement + // for the game globally. + // This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t. + virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0; + + // Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch + // the next most achieved afterwards. Will return -1 if there is no data on achievement + // percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback). + virtual int GetMostAchievedAchievementInfo( char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0; + + // Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another + // GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last + // achievement has been iterated. + virtual int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0; + + // Returns the percentage of users who have achieved the specified achievement. + virtual bool GetAchievementAchievedPercent( const char *pchName, float *pflPercent ) = 0; + + // Requests global stats data, which is available for stats marked as "aggregated". + // This call is asynchronous, with the results returned in GlobalStatsReceived_t. + // nHistoryDays specifies how many days of day-by-day history to retrieve in addition + // to the overall totals. The limit is 60. + virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0; + + // Gets the lifetime totals for an aggregated stat + virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0; + virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0; + + // Gets history for an aggregated stat. pData will be filled with daily values, starting with today. + // So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, + // etc. cubData is the size in bytes of the pubData buffer. Returns the number of + // elements actually set. + virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; + +#ifdef _PS3 + // Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t + // callback. + virtual bool InstallPS3Trophies() = 0; + + // Returns the amount of space required at boot to install trophies. This value can be used when comparing the amount of space needed + // by the game to the available space value passed to the game at boot. The value is set during InstallPS3Trophies(). + virtual uint64 GetTrophySpaceRequiredBeforeInstall() = 0; + + // On PS3, user stats & achievement progress through Steam must be stored with the user's saved game data. + // At startup, before calling RequestCurrentStats(), you must pass the user's stats data to Steam via this method. + // If you do not have any user data, call this function with pvData = NULL and cubData = 0 + virtual bool SetUserStatsData( const void *pvData, uint32 cubData ) = 0; + + // Call to get the user's current stats data. You should retrieve this data after receiving successful UserStatsReceived_t & UserStatsStored_t + // callbacks, and store the data with the user's save game data. You can call this method with pvData = NULL and cubData = 0 to get the required + // buffer size. + virtual bool GetUserStatsData( void *pvData, uint32 cubData, uint32 *pcubWritten ) = 0; +#endif +}; + +#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION011" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when the latests stats and achievements have been received +// from the server +//----------------------------------------------------------------------------- +struct UserStatsReceived_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 }; + uint64 m_nGameID; // Game these stats are for + EResult m_eResult; // Success / error fetching the stats + CSteamID m_steamIDUser; // The user for whom the stats are retrieved for +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the user stats for a game +//----------------------------------------------------------------------------- +struct UserStatsStored_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 }; + uint64 m_nGameID; // Game these stats are for + EResult m_eResult; // success / error +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the achievements for a game, or an +// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress +// are zero, that means the achievement has been fully unlocked. +//----------------------------------------------------------------------------- +struct UserAchievementStored_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 }; + + uint64 m_nGameID; // Game this is for + bool m_bGroupAchievement; // if this is a "group" achievement + char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement + uint32 m_nCurProgress; // current progress towards the achievement + uint32 m_nMaxProgress; // "out of" this many +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() +// use CCallResult<> to map this async result to a member function +//----------------------------------------------------------------------------- +struct LeaderboardFindResult_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 }; + SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found + uint8 m_bLeaderboardFound; // 0 if no leaderboard found +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries() +// use CCallResult<> to map this async result to a member function +//----------------------------------------------------------------------------- +struct LeaderboardScoresDownloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 }; + SteamLeaderboard_t m_hSteamLeaderboard; + SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries() + int m_cEntryCount; // the number of entries downloaded +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore() +// use CCallResult<> to map this async result to a member function +//----------------------------------------------------------------------------- +struct LeaderboardScoreUploaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 }; + uint8 m_bSuccess; // 1 if the call was successful + SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was + int32 m_nScore; // the score that was attempted to set + uint8 m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better + int m_nGlobalRankNew; // the new global rank of the user in this leaderboard + int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard +}; + +struct NumberOfCurrentPlayers_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 7 }; + uint8 m_bSuccess; // 1 if the call was successful + int32 m_cPlayers; // Number of players currently playing +}; + + + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that a user's stats have been unloaded. +// Call RequestUserStats again to access stats for this user +//----------------------------------------------------------------------------- +struct UserStatsUnloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 }; + CSteamID m_steamIDUser; // User whose stats have been unloaded +}; + + + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that an achievement icon has been fetched +//----------------------------------------------------------------------------- +struct UserAchievementIconFetched_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 9 }; + + CGameID m_nGameID; // Game this is for + char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement + bool m_bAchieved; // Is the icon for the achieved or not achieved version? + int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that global achievement percentages are fetched +//----------------------------------------------------------------------------- +struct GlobalAchievementPercentagesReady_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 10 }; + + uint64 m_nGameID; // Game this is for + EResult m_eResult; // Result of the operation +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC() +//----------------------------------------------------------------------------- +struct LeaderboardUGCSet_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 }; + EResult m_eResult; // The result of the operation + SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback indicating that PS3 trophies have been installed +//----------------------------------------------------------------------------- +struct PS3TrophiesInstalled_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 }; + uint64 m_nGameID; // Game these stats are for + EResult m_eResult; // The result of the operation + uint64 m_ulRequiredDiskSpace; // If m_eResult is k_EResultDiskFull, will contain the amount of space needed to install trophies + +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback indicating global stats have been received. +// Returned as a result of RequestGlobalStats() +//----------------------------------------------------------------------------- +struct GlobalStatsReceived_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 }; + uint64 m_nGameID; // Game global stats were requested for + EResult m_eResult; // The result of the request +}; + +#pragma pack( pop ) + + +#endif // ISTEAMUSER_H diff --git a/public/steam/isteamutils.h b/public/steam/isteamutils.h index 8a0610274..54777d33c 100644 --- a/public/steam/isteamutils.h +++ b/public/steam/isteamutils.h @@ -1,74 +1,310 @@ -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to utility functions in Steam -// -//============================================================================= - -#ifndef ISTEAMUTILS_H -#define ISTEAMUTILS_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" - -//----------------------------------------------------------------------------- -// Purpose: interface to user independent utility functions -//----------------------------------------------------------------------------- -class ISteamUtils -{ -public: - // return the number of seconds since the user - virtual uint32 GetSecondsSinceAppActive() = 0; - virtual uint32 GetSecondsSinceComputerActive() = 0; - - // the universe this client is connecting to - virtual EUniverse GetConnectedUniverse() = 0; - - // Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time) - virtual uint32 GetServerRealTime() = 0; - - // returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) - // e.g "US" or "UK". - virtual const char *GetIPCountry() = 0; - - // returns true if the image exists, and valid sizes were filled out - virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0; - - // returns true if the image exists, and the buffer was successfully filled out - // results are returned in RGBA format - // the destination buffer size should be 4 * height * width * sizeof(char) - virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0; - - // returns the IP of the reporting server for valve - currently only used in Source engine games - virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0; - - // return the amount of battery power left in the current system in % [0..100], 255 for being on AC power - virtual uint8 GetCurrentBatteryPower() = 0; -}; - -#define STEAMUTILS_INTERFACE_VERSION "SteamUtils002" - - -// callbacks - - -//----------------------------------------------------------------------------- -// Purpose: The country of the user changed -//----------------------------------------------------------------------------- -struct IPCountry_t -{ - enum { k_iCallback = k_iSteamUtilsCallbacks + 1 }; -}; - - -//----------------------------------------------------------------------------- -// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute -//----------------------------------------------------------------------------- -struct LowBatteryPower_t -{ - enum { k_iCallback = k_iSteamUtilsCallbacks + 2 }; - uint8 m_nMinutesBatteryLeft; -}; - -#endif // ISTEAMUTILS_H +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to utility functions in Steam +// +//============================================================================= + +#ifndef ISTEAMUTILS_H +#define ISTEAMUTILS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + + +// Steam API call failure results +enum ESteamAPICallFailure +{ + k_ESteamAPICallFailureNone = -1, // no failure + k_ESteamAPICallFailureSteamGone = 0, // the local Steam process has gone away + k_ESteamAPICallFailureNetworkFailure = 1, // the network connection to Steam has been broken, or was already broken + // SteamServersDisconnected_t callback will be sent around the same time + // SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again + k_ESteamAPICallFailureInvalidHandle = 2, // the SteamAPICall_t handle passed in no longer exists + k_ESteamAPICallFailureMismatchedCallback = 3,// GetAPICallResult() was called with the wrong callback type for this API call +}; + + +// Input modes for the Big Picture gamepad text entry +enum EGamepadTextInputMode +{ + k_EGamepadTextInputModeNormal = 0, + k_EGamepadTextInputModePassword = 1 +}; + + +// Controls number of allowed lines for the Big Picture gamepad text entry +enum EGamepadTextInputLineMode +{ + k_EGamepadTextInputLineModeSingleLine = 0, + k_EGamepadTextInputLineModeMultipleLines = 1 +}; + + +// function prototype for warning message hook +#if defined( POSIX ) +#define __cdecl +#endif +extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *); + +//----------------------------------------------------------------------------- +// Purpose: interface to user independent utility functions +//----------------------------------------------------------------------------- +class ISteamUtils +{ +public: + // return the number of seconds since the user + virtual uint32 GetSecondsSinceAppActive() = 0; + virtual uint32 GetSecondsSinceComputerActive() = 0; + + // the universe this client is connecting to + virtual EUniverse GetConnectedUniverse() = 0; + + // Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time) + virtual uint32 GetServerRealTime() = 0; + + // returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) + // e.g "US" or "UK". + virtual const char *GetIPCountry() = 0; + + // returns true if the image exists, and valid sizes were filled out + virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0; + + // returns true if the image exists, and the buffer was successfully filled out + // results are returned in RGBA format + // the destination buffer size should be 4 * height * width * sizeof(char) + virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0; + + // returns the IP of the reporting server for valve - currently only used in Source engine games + virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0; + + // return the amount of battery power left in the current system in % [0..100], 255 for being on AC power + virtual uint8 GetCurrentBatteryPower() = 0; + + // returns the appID of the current process + virtual uint32 GetAppID() = 0; + + // Sets the position where the overlay instance for the currently calling game should show notifications. + // This position is per-game and if this function is called from outside of a game context it will do nothing. + virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0; + + // API asynchronous call results + // can be used directly, but more commonly used via the callback dispatch API (see steam_api.h) + virtual bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFailed ) = 0; + virtual ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) = 0; + virtual bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ) = 0; + + // this needs to be called every frame to process matchmaking results + // redundant if you're already calling SteamAPI_RunCallbacks() + virtual void RunFrame() = 0; + + // returns the number of IPC calls made since the last time this function was called + // Used for perf debugging so you can understand how many IPC calls your game makes per frame + // Every IPC call is at minimum a thread context switch if not a process one so you want to rate + // control how often you do them. + virtual uint32 GetIPCCallCount() = 0; + + // API warning handling + // 'int' is the severity; 0 for msg, 1 for warning + // 'const char *' is the text of the message + // callbacks will occur directly after the API function is called that generated the warning or message + virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0; + + // Returns true if the overlay is running & the user can access it. The overlay process could take a few seconds to + // start & hook the game process, so this function will initially return false while the overlay is loading. + virtual bool IsOverlayEnabled() = 0; + + // Normally this call is unneeded if your game has a constantly running frame loop that calls the + // D3D Present API, or OGL SwapBuffers API every frame. + // + // However, if you have a game that only refreshes the screen on an event driven basis then that can break + // the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also + // need to Present() to the screen any time an even needing a notification happens or when the overlay is + // brought up over the game by a user. You can use this API to ask the overlay if it currently need a present + // in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you + // refresh the screen with Present or SwapBuffers to allow the overlay to do it's work. + virtual bool BOverlayNeedsPresent() = 0; + +#ifndef _PS3 + // Asynchronous call to check if an executable file has been signed using the public key set on the signing tab + // of the partner site, for example to refuse to load modified executable files. + // The result is returned in CheckFileSignature_t. + // k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function. + // k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site. + // k_ECheckFileSignatureFileNotFound - The file does not exist on disk. + // k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match. + // k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid. + virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0; +#endif + +#ifdef _PS3 + virtual void PostPS3SysutilCallback( uint64_t status, uint64_t param, void* userdata ) = 0; + virtual bool BIsReadyToShutdown() = 0; + virtual bool BIsPSNOnline() = 0; + + // Call this with localized strings for the language the game is running in, otherwise default english + // strings will be used by Steam. + virtual void SetPSNGameBootInviteStrings( const char *pchSubject, const char *pchBody ) = 0; +#endif + + // Activates the Big Picture text input dialog which only supports gamepad input + virtual bool ShowGamepadTextInput( EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char *pchDescription, uint32 unCharMax, const char *pchExistingText ) = 0; + + // Returns previously entered text & length + virtual uint32 GetEnteredGamepadTextLength() = 0; + virtual bool GetEnteredGamepadTextInput( char *pchText, uint32 cchText ) = 0; + + // returns the language the steam client is running in, you probably want ISteamApps::GetCurrentGameLanguage instead, this is for very special usage cases + virtual const char *GetSteamUILanguage() = 0; + + // returns true if Steam itself is running in VR mode + virtual bool IsSteamRunningInVR() = 0; + + // Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition. + virtual void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) = 0; +}; + +#define STEAMUTILS_INTERFACE_VERSION "SteamUtils007" + + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + +//----------------------------------------------------------------------------- +// Purpose: The country of the user changed +//----------------------------------------------------------------------------- +struct IPCountry_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 1 }; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute +//----------------------------------------------------------------------------- +struct LowBatteryPower_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 2 }; + uint8 m_nMinutesBatteryLeft; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when a SteamAsyncCall_t has completed (or failed) +//----------------------------------------------------------------------------- +struct SteamAPICallCompleted_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 3 }; + SteamAPICall_t m_hAsyncCall; +}; + + +//----------------------------------------------------------------------------- +// called when Steam wants to shutdown +//----------------------------------------------------------------------------- +struct SteamShutdown_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 4 }; +}; + +//----------------------------------------------------------------------------- +// results for CheckFileSignature +//----------------------------------------------------------------------------- +enum ECheckFileSignature +{ + k_ECheckFileSignatureInvalidSignature = 0, + k_ECheckFileSignatureValidSignature = 1, + k_ECheckFileSignatureFileNotFound = 2, + k_ECheckFileSignatureNoSignaturesFoundForThisApp = 3, + k_ECheckFileSignatureNoSignaturesFoundForThisFile = 4, +}; + +//----------------------------------------------------------------------------- +// callback for CheckFileSignature +//----------------------------------------------------------------------------- +struct CheckFileSignature_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 5 }; + ECheckFileSignature m_eCheckFileSignature; +}; + +#ifdef _PS3 +//----------------------------------------------------------------------------- +// callback for NetCtlNetStartDialog finishing on PS3 +//----------------------------------------------------------------------------- +struct NetStartDialogFinished_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 6 }; +}; + +//----------------------------------------------------------------------------- +// callback for NetCtlNetStartDialog unloaded on PS3 +//----------------------------------------------------------------------------- +struct NetStartDialogUnloaded_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 7 }; +}; + +//----------------------------------------------------------------------------- +// callback for system menu closing on PS3 - should trigger resyncronizing friends list, etc. +//----------------------------------------------------------------------------- +struct PS3SystemMenuClosed_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 8 }; +}; + +//----------------------------------------------------------------------------- +// callback for NP message being selected by user on PS3 - should trigger handling of message if it's a lobby invite, etc. +//----------------------------------------------------------------------------- +struct PS3NPMessageSelected_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 9 }; + uint32 dataid; +}; + +//----------------------------------------------------------------------------- +// callback for when the PS3 keyboard dialog closes +//----------------------------------------------------------------------------- +struct PS3KeyboardDialogFinished_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 10 }; +}; + +// k_iSteamUtilsCallbacks + 11 is taken + +//----------------------------------------------------------------------------- +// callback for PSN status changing on PS3 +//----------------------------------------------------------------------------- +struct PS3PSNStatusChange_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 12 }; + bool m_bPSNOnline; +}; + +#endif + +// k_iSteamUtilsCallbacks + 13 is taken + + +//----------------------------------------------------------------------------- +// Big Picture gamepad text input has been closed +//----------------------------------------------------------------------------- +struct GamepadTextInputDismissed_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 14 }; + bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input + uint32 m_unSubmittedText; +}; + +// k_iSteamUtilsCallbacks + 15 is taken + +#pragma pack( pop ) + +#endif // ISTEAMUTILS_H diff --git a/public/steam/isteamvideo.h b/public/steam/isteamvideo.h new file mode 100644 index 000000000..6893f0b20 --- /dev/null +++ b/public/steam/isteamvideo.h @@ -0,0 +1,60 @@ +//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to Steam Video +// +//============================================================================= + +#ifndef ISTEAMVIDEO_H +#define ISTEAMVIDEO_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + + + +//----------------------------------------------------------------------------- +// Purpose: Steam Video API +//----------------------------------------------------------------------------- +class ISteamVideo +{ +public: + + // Get a URL suitable for streaming the given Video app ID's video + virtual void GetVideoURL( AppId_t unVideoAppID ) = 0; + + // returns true if user is uploading a live broadcast + virtual bool IsBroadcasting( int *pnNumViewers ) = 0; +}; + +#define STEAMVIDEO_INTERFACE_VERSION "STEAMVIDEO_INTERFACE_V001" + +DEFINE_CALLBACK( BroadcastUploadStart_t, k_iClientVideoCallbacks + 4 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 ) + CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 ) + CALLBACK_MEMBER( 0, EResult, m_eResult ) + CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) + CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) +END_DEFINE_CALLBACK_1() + + +#pragma pack( pop ) + + +#endif // ISTEAMVIDEO_H diff --git a/public/steam/matchmakingtypes.h b/public/steam/matchmakingtypes.h index 2386d669e..08d5a9669 100644 --- a/public/steam/matchmakingtypes.h +++ b/public/steam/matchmakingtypes.h @@ -1,235 +1,251 @@ -//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#ifndef MATCHMAKINGTYPES_H -#define MATCHMAKINGTYPES_H - -#ifdef _WIN32 -#pragma once -#endif - -#include -#include - -struct MatchMakingKeyValuePair_t -{ - MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; } - MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue ) - { - strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only! - strncpy( m_szValue, pchValue, sizeof(m_szValue) ); - } - char m_szKey[ 256 ]; - char m_szValue[ 256 ]; -}; - - -enum EMatchMakingServerResponse -{ - eServerResponded = 0, - eServerFailedToRespond, - eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match -}; - -enum EMatchMakingType -{ - eInternetServer = 0, - eLANServer, - eFriendsServer, - eFavoritesServer, - eHistoryServer, - eSpectatorServer, - eInvalidServer -}; - - -// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server, -// namely: its IP, its connection port, and its query port. -class servernetadr_t -{ -public: - - void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); -#ifdef NETADR_H - void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort ); - netadr_t& GetIPAndQueryPort(); -#endif - - // Access the query port. - uint16 GetQueryPort() const; - void SetQueryPort( uint16 usPort ); - - // Access the connection port. - uint16 GetConnectionPort() const; - void SetConnectionPort( uint16 usPort ); - - // Access the IP - uint32 GetIP() const; - void SetIP( uint32 ); - - // This gets the 'a.b.c.d:port' string with the connection port (instead of the query port). - const char *GetConnectionAddressString() const; - const char *GetQueryAddressString() const; - - // Comparison operators and functions. - bool operator<(const servernetadr_t &netadr) const; - void operator=( const servernetadr_t &that ) - { - m_usConnectionPort = that.m_usConnectionPort; - m_usQueryPort = that.m_usQueryPort; - m_unIP = that.m_unIP; - } - - -private: - const char *ToString( uint32 unIP, uint16 usPort ) const; - uint16 m_usConnectionPort; // (in HOST byte order) - uint16 m_usQueryPort; - uint32 m_unIP; -}; - - -inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ) -{ - m_unIP = ip; - m_usQueryPort = usQueryPort; - m_usConnectionPort = usConnectionPort; -} - -#ifdef NETADR_H -inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort ) -{ - Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort ); -} - -inline netadr_t& servernetadr_t::GetIPAndQueryPort() -{ - static netadr_t netAdr; - netAdr.SetIP( m_unIP ); - netAdr.SetPort( m_usQueryPort ); - return netAdr; -} -#endif - -inline uint16 servernetadr_t::GetQueryPort() const -{ - return m_usQueryPort; -} - -inline void servernetadr_t::SetQueryPort( uint16 usPort ) -{ - m_usQueryPort = usPort; -} - -inline uint16 servernetadr_t::GetConnectionPort() const -{ - return m_usConnectionPort; -} - -inline void servernetadr_t::SetConnectionPort( uint16 usPort ) -{ - m_usConnectionPort = usPort; -} - -inline uint32 servernetadr_t::GetIP() const -{ - return m_unIP; -} - -inline void servernetadr_t::SetIP( uint32 unIP ) -{ - m_unIP = unIP; -} - -inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const -{ - static char s[4][64]; - static int nBuf = 0; - unsigned char *ipByte = (unsigned char *)&unIP; - Q_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); - const char *pchRet = s[nBuf]; - ++nBuf; - nBuf %= ( (sizeof(s)/sizeof(s[0])) ); - return pchRet; -} - -inline const char* servernetadr_t::GetConnectionAddressString() const -{ - return ToString( m_unIP, m_usConnectionPort ); -} - -inline const char* servernetadr_t::GetQueryAddressString() const -{ - return ToString( m_unIP, m_usQueryPort ); -} - -inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const -{ - return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort ); -} - -//----------------------------------------------------------------------------- -// Purpose: Data describing a single server -//----------------------------------------------------------------------------- -class gameserveritem_t -{ -public: - gameserveritem_t(); - - const char* GetName() const; - void SetName( const char *pName ); - -public: - servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server - int m_nPing; // current ping time in milliseconds - bool m_bHadSuccessfulResponse; // server has responded successfully in the past - bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed - char m_szGameDir[32]; // current game directory - char m_szMap[32]; // current map - char m_szGameDescription[64]; // game description - int m_nAppID; // Steam App ID of this server - int m_nPlayers; // current number of players on the server - int m_nMaxPlayers; // Maximum players that can join this server - int m_nBotPlayers; // Number of bots (i.e simulated players) on this server - bool m_bPassword; // true if this server needs a password to join - bool m_bSecure; // Is this server protected by VAC - uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers) - int m_nServerVersion; // server version as reported to Steam - -private: - char m_szServerName[64]; // Game server name - - // For data added after SteamMatchMaking001 add it here -public: - char m_szGameTags[128]; // the tags this server exposes -}; - - -inline gameserveritem_t::gameserveritem_t() -{ - m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0; - m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false; - m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0; - m_szGameTags[0] = 0; -} - -inline const char* gameserveritem_t::GetName() const -{ - // Use the IP address as the name if nothing is set yet. - if ( m_szServerName[0] == 0 ) - return m_NetAdr.GetConnectionAddressString(); - else - return m_szServerName; -} - -inline void gameserveritem_t::SetName( const char *pName ) -{ - strncpy( m_szServerName, pName, sizeof( m_szServerName ) ); -} - - -#endif // MATCHMAKINGTYPES_H +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef MATCHMAKINGTYPES_H +#define MATCHMAKINGTYPES_H + +#ifdef _WIN32 +#pragma once +#endif + +#ifdef POSIX +#ifndef _snprintf +#define _snprintf snprintf +#endif +#endif + +#include +#include + +// +// Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator. +// WARNING: These cannot be changed easily, without breaking clients using old interfaces. +// +const int k_cbMaxGameServerGameDir = 32; +const int k_cbMaxGameServerMapName = 32; +const int k_cbMaxGameServerGameDescription = 64; +const int k_cbMaxGameServerName = 64; +const int k_cbMaxGameServerTags = 128; +const int k_cbMaxGameServerGameData = 2048; + +/// Store key/value pair used in matchmaking queries. +/// +/// Actually, the name Key/Value is a bit misleading. The "key" is better +/// understood as "filter operation code" and the "value" is the operand to this +/// filter operation. The meaning of the operand depends upon the filter. +struct MatchMakingKeyValuePair_t +{ + MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; } + MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue ) + { + strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only! + m_szKey[ sizeof( m_szKey ) - 1 ] = '\0'; + strncpy( m_szValue, pchValue, sizeof(m_szValue) ); + m_szValue[ sizeof( m_szValue ) - 1 ] = '\0'; + } + char m_szKey[ 256 ]; + char m_szValue[ 256 ]; +}; + + +enum EMatchMakingServerResponse +{ + eServerResponded = 0, + eServerFailedToRespond, + eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match +}; + +// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server, +// namely: its IP, its connection port, and its query port. +class servernetadr_t +{ +public: + + servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {} + + void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); +#ifdef NETADR_H + netadr_t GetIPAndQueryPort(); +#endif + + // Access the query port. + uint16 GetQueryPort() const; + void SetQueryPort( uint16 usPort ); + + // Access the connection port. + uint16 GetConnectionPort() const; + void SetConnectionPort( uint16 usPort ); + + // Access the IP + uint32 GetIP() const; + void SetIP( uint32 ); + + // This gets the 'a.b.c.d:port' string with the connection port (instead of the query port). + const char *GetConnectionAddressString() const; + const char *GetQueryAddressString() const; + + // Comparison operators and functions. + bool operator<(const servernetadr_t &netadr) const; + void operator=( const servernetadr_t &that ) + { + m_usConnectionPort = that.m_usConnectionPort; + m_usQueryPort = that.m_usQueryPort; + m_unIP = that.m_unIP; + } + + +private: + const char *ToString( uint32 unIP, uint16 usPort ) const; + uint16 m_usConnectionPort; // (in HOST byte order) + uint16 m_usQueryPort; + uint32 m_unIP; +}; + + +inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ) +{ + m_unIP = ip; + m_usQueryPort = usQueryPort; + m_usConnectionPort = usConnectionPort; +} + +#ifdef NETADR_H +inline netadr_t servernetadr_t::GetIPAndQueryPort() +{ + return netadr_t( m_unIP, m_usQueryPort ); +} +#endif + +inline uint16 servernetadr_t::GetQueryPort() const +{ + return m_usQueryPort; +} + +inline void servernetadr_t::SetQueryPort( uint16 usPort ) +{ + m_usQueryPort = usPort; +} + +inline uint16 servernetadr_t::GetConnectionPort() const +{ + return m_usConnectionPort; +} + +inline void servernetadr_t::SetConnectionPort( uint16 usPort ) +{ + m_usConnectionPort = usPort; +} + +inline uint32 servernetadr_t::GetIP() const +{ + return m_unIP; +} + +inline void servernetadr_t::SetIP( uint32 unIP ) +{ + m_unIP = unIP; +} + +inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const +{ + static char s[4][64]; + static int nBuf = 0; + unsigned char *ipByte = (unsigned char *)&unIP; +#ifdef VALVE_BIG_ENDIAN + V_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort ); +#else + V_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); +#endif + const char *pchRet = s[nBuf]; + ++nBuf; + nBuf %= ( (sizeof(s)/sizeof(s[0])) ); + return pchRet; +} + +inline const char* servernetadr_t::GetConnectionAddressString() const +{ + return ToString( m_unIP, m_usConnectionPort ); +} + +inline const char* servernetadr_t::GetQueryAddressString() const +{ + return ToString( m_unIP, m_usQueryPort ); +} + +inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const +{ + return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort ); +} + +//----------------------------------------------------------------------------- +// Purpose: Data describing a single server +//----------------------------------------------------------------------------- +class gameserveritem_t +{ +public: + gameserveritem_t(); + + const char* GetName() const; + void SetName( const char *pName ); + +public: + servernetadr_t m_NetAdr; ///< IP/Query Port/Connection Port for this server + int m_nPing; ///< current ping time in milliseconds + bool m_bHadSuccessfulResponse; ///< server has responded successfully in the past + bool m_bDoNotRefresh; ///< server is marked as not responding and should no longer be refreshed + char m_szGameDir[k_cbMaxGameServerGameDir]; ///< current game directory + char m_szMap[k_cbMaxGameServerMapName]; ///< current map + char m_szGameDescription[k_cbMaxGameServerGameDescription]; ///< game description + uint32 m_nAppID; ///< Steam App ID of this server + int m_nPlayers; ///< total number of players currently on the server. INCLUDES BOTS!! + int m_nMaxPlayers; ///< Maximum players that can join this server + int m_nBotPlayers; ///< Number of bots (i.e simulated players) on this server + bool m_bPassword; ///< true if this server needs a password to join + bool m_bSecure; ///< Is this server protected by VAC + uint32 m_ulTimeLastPlayed; ///< time (in unix time) when this server was last played on (for favorite/history servers) + int m_nServerVersion; ///< server version as reported to Steam + +private: + + /// Game server name + char m_szServerName[k_cbMaxGameServerName]; + + // For data added after SteamMatchMaking001 add it here +public: + /// the tags this server exposes + char m_szGameTags[k_cbMaxGameServerTags]; + + /// steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam) + CSteamID m_steamID; +}; + + +inline gameserveritem_t::gameserveritem_t() +{ + m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0; + m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false; + m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0; + m_szGameTags[0] = 0; +} + +inline const char* gameserveritem_t::GetName() const +{ + // Use the IP address as the name if nothing is set yet. + if ( m_szServerName[0] == 0 ) + return m_NetAdr.GetConnectionAddressString(); + else + return m_szServerName; +} + +inline void gameserveritem_t::SetName( const char *pName ) +{ + strncpy( m_szServerName, pName, sizeof( m_szServerName ) ); + m_szServerName[ sizeof( m_szServerName ) - 1 ] = '\0'; +} + + +#endif // MATCHMAKINGTYPES_H diff --git a/public/steam/steam_api.h b/public/steam/steam_api.h index 4b410d317..f3872501c 100644 --- a/public/steam/steam_api.h +++ b/public/steam/steam_api.h @@ -1,295 +1,650 @@ -//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. ======= -// -// Purpose: -// -//============================================================================= - -#ifndef STEAM_API_H -#define STEAM_API_H -#ifdef _WIN32 -#pragma once -#endif - -#include "isteamclient.h" -#include "isteamuser.h" -#include "isteamfriends.h" -#include "isteamutils.h" -#include "isteammatchmaking.h" -#include "isteamuserstats.h" -#include "isteamapps.h" - -// Steam API export macro -#if defined( _WIN32 ) && !defined( _X360 ) - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" __declspec( dllexport ) - #elif defined( STEAM_API_NODLL ) - #define S_API extern "C" - #else - #define S_API extern "C" __declspec( dllimport ) - #endif // STEAM_API_EXPORTS -#else // !WIN32 - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" - #else - #define S_API extern "C" - #endif // STEAM_API_EXPORTS -#endif - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// Steam API setup & teardown -// -// These functions manage loading, initializing and shutdown of the steamclient.dll -// -// bugbug johnc: seperate defining these to defining game server interface more cleanly -// -//----------------------------------------------------------------------------------------------------------------------------------------------------------// - -S_API void SteamAPI_Shutdown(); - -S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID ); -S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg ); - -// interface pointers, configured by SteamAPI_Init() -S_API ISteamClient *SteamClient(); - - -// -// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing -// new steam_api.dll's without recompiling/rereleasing modules that use it. -// -// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the -// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there. -// -// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX() -// functions below to get at the Steam interfaces. -// -#ifdef VERSION_SAFE_STEAM_API_INTERFACES -S_API bool SteamAPI_InitSafe(); -#else -S_API bool SteamAPI_Init(); - -S_API ISteamUser *SteamUser(); -S_API ISteamFriends *SteamFriends(); -S_API ISteamUtils *SteamUtils(); -S_API ISteamMatchmaking *SteamMatchmaking(); -S_API ISteamUserStats *SteamUserStats(); -S_API ISteamApps *SteamApps(); -S_API ISteamMatchmakingServers *SteamMatchmakingServers(); -#endif // VERSION_SAFE_STEAM_API_INTERFACES - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steam callback helper functions -// -// These following classes/macros are used to be able to easily multiplex callbacks -// from the Steam API into various objects in the app in a thread-safe manner -// -// This functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback -// to as many functions/objects as are registered to it -//----------------------------------------------------------------------------------------------------------------------------------------------------------// - -S_API void SteamAPI_RunCallbacks(); - - - -// functions used by the utility CCallback objects to receive callbacks -S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); -S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); - -//----------------------------------------------------------------------------- -// Purpose: base for callbacks, -// used only by CCallback, shouldn't be used directly -//----------------------------------------------------------------------------- -class CCallbackBase -{ -public: - CCallbackBase() { m_nCallbackFlags = 0; } - // don't add a virtual destructor because we export this binary interface across dll's - virtual void Run( void *pvParam ) = 0; - -protected: - enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; - uint8 m_nCallbackFlags; -private: - int m_iCallback; - friend class CCallbackMgr; -}; - - -//----------------------------------------------------------------------------- -// Purpose: maps a steam callback to a class member function -// template params: T = local class, P = parameter struct -//----------------------------------------------------------------------------- -template< class T, class P, bool bGameServer > -class CCallback : private CCallbackBase -{ -public: - typedef void (T::*func_t)( P* ); - - // If you can't support constructing a callback with the correct parameters - // then uncomment the empty constructor below and manually call - // ::Register() for your object - //CCallback() {} - - // constructor for initializing this object in owner's constructor - CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func ) - { - if ( bGameServer ) - { - m_nCallbackFlags |= k_ECallbackFlagsGameServer; - } - - Register( pObj, func ); - } - - ~CCallback() - { - SteamAPI_UnregisterCallback( this ); - } - - // manual registration of the callback - void Register( T *pObj, func_t func ) - { - m_pObj = pObj; - m_Func = func; - SteamAPI_RegisterCallback( this, P::k_iCallback ); - } - -private: - virtual void Run( void *pvParam ) - { - (m_pObj->*m_Func)( (P *)pvParam ); - } - - T *m_pObj; - func_t m_Func; -}; - - -// utility macro for declaring the function and callback object together -#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam ) - - - - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steamclient.dll private wrapper functions -// -// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases -//----------------------------------------------------------------------------------------------------------------------------------------------------------// - -// pumps out all the steam messages, calling the register callback -S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks ); - -// register the callback funcs to use to interact with the steam dll -S_API void Steam_RegisterInterfaceFuncs( void *hModule ); - -// returns the HSteamUser of the last user to dispatch a callback -S_API HSteamUser Steam_GetHSteamUserCurrent(); - -// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name -S_API const char *SteamAPI_GetSteamInstallPath(); - - -#ifdef VERSION_SAFE_STEAM_API_INTERFACES -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that -// lets them each specify the interface versions they are compiled with. -// -// It's important that these stay inlined in the header so the calling module specifies the interface versions -// for whatever Steam API version it has. -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#if defined( _WIN32 ) && !defined( _X360 ) - S_API HSteamPipe GetHSteamPipe(); - S_API HSteamUser GetHSteamUser(); -#endif - -class CSteamAPIContext -{ -public: - CSteamAPIContext(); - void Clear(); - - bool Init(); - - ISteamUser* SteamUser() { return m_pSteamUser; } - ISteamFriends* SteamFriends() { return m_pSteamFriends; } - ISteamUtils* SteamUtils() { return m_pSteamUtils; } - ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; } - ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; } - ISteamApps* SteamApps() { return m_pSteamApps; } - ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; } - -private: - ISteamUser *m_pSteamUser; - ISteamFriends *m_pSteamFriends; - ISteamUtils *m_pSteamUtils; - ISteamMatchmaking *m_pSteamMatchmaking; - ISteamUserStats *m_pSteamUserStats; - ISteamApps *m_pSteamApps; - ISteamMatchmakingServers *m_pSteamMatchmakingServers; -}; - -inline CSteamAPIContext::CSteamAPIContext() -{ - Clear(); -} - -inline void CSteamAPIContext::Clear() -{ - m_pSteamUser = NULL; - m_pSteamFriends = NULL; - m_pSteamUtils = NULL; - m_pSteamMatchmaking = NULL; - m_pSteamUserStats = NULL; - m_pSteamApps = NULL; - m_pSteamMatchmakingServers = NULL; -} - -// This function must be inlined so the module using steam_api.dll gets the version names they want. -inline bool CSteamAPIContext::Init() -{ -#if defined( _WIN32 ) && !defined( _X360 ) - - if ( !SteamClient() ) - return false; - - HSteamUser hSteamUser = GetHSteamUser(); - HSteamPipe hSteamPipe = GetHSteamPipe(); - - m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION ); - if ( !m_pSteamUser ) - return false; - - m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION ); - if ( !m_pSteamFriends ) - return false; - - m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamUser, STEAMUTILS_INTERFACE_VERSION ); - if ( !m_pSteamUtils ) - return false; - - m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION ); - if ( !m_pSteamMatchmaking ) - return false; - - m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); - if ( !m_pSteamMatchmakingServers ) - return false; - - m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION ); - if ( !m_pSteamUserStats ) - return false; - - m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION ); - if ( !m_pSteamApps ) - return false; - - return true; -#else - return false; -#endif -} - -#endif // VERSION_SAFE_STEAM_API_INTERFACES - -#endif // STEAM_API_H +//====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: +// +//============================================================================= + +#ifndef STEAM_API_H +#define STEAM_API_H +#ifdef _WIN32 +#pragma once +#endif + +#include "isteamclient.h" +#include "isteamuser.h" +#include "isteamfriends.h" +#include "isteamutils.h" +#include "isteammatchmaking.h" +#include "isteamuserstats.h" +#include "isteamapps.h" +#include "isteamnetworking.h" +#include "isteamremotestorage.h" +#include "isteamscreenshots.h" +#include "isteammusic.h" +#include "isteammusicremote.h" +#include "isteamhttp.h" +#include "isteamunifiedmessages.h" +#include "isteamcontroller.h" +#include "isteamugc.h" +#include "isteamapplist.h" +#include "isteamhtmlsurface.h" +#include "isteaminventory.h" +#include "isteamvideo.h" + +#if defined( _PS3 ) +#include "steamps3params.h" +#endif + +// Steam API export macro +#if defined( _WIN32 ) && !defined( _X360 ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __declspec( dllexport ) + #elif defined( STEAM_API_NODLL ) + #define S_API extern "C" + #else + #define S_API extern "C" __declspec( dllimport ) + #endif // STEAM_API_EXPORTS +#elif defined( GNUC ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __attribute__ ((visibility("default"))) + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#else // !WIN32 + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// Steam API setup & shutdown +// +// These functions manage loading, initializing and shutdown of the steamclient.dll +// +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +// S_API void SteamAPI_Init(); (see below) +S_API void S_CALLTYPE SteamAPI_Shutdown(); + +// checks if a local Steam client is running +S_API bool S_CALLTYPE SteamAPI_IsSteamRunning(); + +// Detects if your executable was launched through the Steam client, and restarts your game through +// the client if necessary. The Steam client will be started if it is not running. +// +// Returns: true if your executable was NOT launched through the Steam client. This function will +// then start your application through the client. Your current process should exit. +// +// false if your executable was started through the Steam client or a steam_appid.txt file +// is present in your game's directory (for development). Your current process should continue. +// +// NOTE: This function should be used only if you are using CEG or not using Steam's DRM. Once applied +// to your executable, Steam's DRM will handle restarting through Steam if necessary. +S_API bool S_CALLTYPE SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID ); + +// crash dump recording functions +S_API void S_CALLTYPE SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID ); +S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg ); + +// interface pointers, configured by SteamAPI_Init() +S_API ISteamClient *S_CALLTYPE SteamClient(); + + +// +// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing +// new steam_api.dll's without recompiling/rereleasing modules that use it. +// +// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the +// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there. +// +// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX() +// functions below to get at the Steam interfaces. +// +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +S_API bool S_CALLTYPE SteamAPI_InitSafe(); +#else + +#if defined(_PS3) +S_API bool S_CALLTYPE SteamAPI_Init( SteamPS3Params_t *pParams ); +#else +S_API bool S_CALLTYPE SteamAPI_Init(); +#endif + +S_API ISteamUser *S_CALLTYPE SteamUser(); +S_API ISteamFriends *S_CALLTYPE SteamFriends(); +S_API ISteamUtils *S_CALLTYPE SteamUtils(); +S_API ISteamMatchmaking *S_CALLTYPE SteamMatchmaking(); +S_API ISteamUserStats *S_CALLTYPE SteamUserStats(); +S_API ISteamApps *S_CALLTYPE SteamApps(); +S_API ISteamNetworking *S_CALLTYPE SteamNetworking(); +S_API ISteamMatchmakingServers *S_CALLTYPE SteamMatchmakingServers(); +S_API ISteamRemoteStorage *S_CALLTYPE SteamRemoteStorage(); +S_API ISteamScreenshots *S_CALLTYPE SteamScreenshots(); +S_API ISteamHTTP *S_CALLTYPE SteamHTTP(); +S_API ISteamUnifiedMessages *S_CALLTYPE SteamUnifiedMessages(); +S_API ISteamController *S_CALLTYPE SteamController(); +S_API ISteamUGC *S_CALLTYPE SteamUGC(); +S_API ISteamAppList *S_CALLTYPE SteamAppList(); +S_API ISteamMusic *S_CALLTYPE SteamMusic(); +S_API ISteamMusicRemote *S_CALLTYPE SteamMusicRemote(); +S_API ISteamHTMLSurface *S_CALLTYPE SteamHTMLSurface(); +S_API ISteamInventory *S_CALLTYPE SteamInventory(); +S_API ISteamVideo *S_CALLTYPE SteamVideo(); +#ifdef _PS3 +S_API ISteamPS3OverlayRender *S_CALLTYPE SteamPS3OverlayRender(); +#endif +#endif // VERSION_SAFE_STEAM_API_INTERFACES + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steam callback and call-result helpers +// +// The following macros and classes are used to register your application for +// callbacks and call-results, which are delivered in a predictable manner. +// +// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. +// They map a Steam notification callback directly to a class member function +// which is automatically prototyped as "void func( callback_type *pParam )". +// +// CCallResult is used with specific Steam APIs that return "result handles". +// The handle can be passed to a CCallResult object's Set function, along with +// an object pointer and member-function pointer. The member function will +// be executed once the results of the Steam API call are available. +// +// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK +// macros if you require finer control over registration and unregistration. +// +// Callbacks and call-results are queued automatically and are only +// delivered/executed when your application calls SteamAPI_RunCallbacks(). +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +S_API void S_CALLTYPE SteamAPI_RunCallbacks(); + + + +// Declares a callback member function plus a helper member variable which +// registers the callback on object creation and unregisters on destruction. +// The optional fourth 'var' param exists only for backwards-compatibility +// and can be ignored. +#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) + +// Declares a callback function and a named CCallbackManual variable which +// has Register and Unregister functions instead of automatic registration. +#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) + + +// Internal functions used by the utility CCallback objects to receive callbacks +S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); +// Internal functions used by the utility CCallResult objects to receive async call results +S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); + + +//----------------------------------------------------------------------------- +// Purpose: base for callbacks and call results - internal implementation detail +//----------------------------------------------------------------------------- +class CCallbackBase +{ +public: + CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; } + // don't add a virtual destructor because we export this binary interface across dll's + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0; + int GetICallback() { return m_iCallback; } + virtual int GetCallbackSizeBytes() = 0; + +protected: + enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; + uint8 m_nCallbackFlags; + int m_iCallback; + friend class CCallbackMgr; + +private: + CCallbackBase( const CCallbackBase& ); + CCallbackBase& operator=( const CCallbackBase& ); +}; + +//----------------------------------------------------------------------------- +// Purpose: templated base for callbacks - internal implementation detail +//----------------------------------------------------------------------------- +template< int sizeof_P > +class CCallbackImpl : protected CCallbackBase +{ +public: + ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } + +protected: + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } + virtual int GetCallbackSizeBytes() { return sizeof_P; } +}; + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam async call result to a class member function +// template params: T = local class, P = parameter struct +//----------------------------------------------------------------------------- +template< class T, class P > +class CCallResult : private CCallbackBase +{ +public: + typedef void (T::*func_t)( P*, bool ); + + CCallResult() + { + m_hAPICall = k_uAPICallInvalid; + m_pObj = NULL; + m_Func = NULL; + m_iCallback = P::k_iCallback; + } + + void Set( SteamAPICall_t hAPICall, T *p, func_t func ) + { + if ( m_hAPICall ) + SteamAPI_UnregisterCallResult( this, m_hAPICall ); + + m_hAPICall = hAPICall; + m_pObj = p; + m_Func = func; + + if ( hAPICall ) + SteamAPI_RegisterCallResult( this, hAPICall ); + } + + bool IsActive() const + { + return ( m_hAPICall != k_uAPICallInvalid ); + } + + void Cancel() + { + if ( m_hAPICall != k_uAPICallInvalid ) + { + SteamAPI_UnregisterCallResult( this, m_hAPICall ); + m_hAPICall = k_uAPICallInvalid; + } + + } + + ~CCallResult() + { + Cancel(); + } + + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } +private: + virtual void Run( void *pvParam ) + { + m_hAPICall = k_uAPICallInvalid; // caller unregisters for us + (m_pObj->*m_Func)( (P *)pvParam, false ); + } + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) + { + if ( hSteamAPICall == m_hAPICall ) + { + m_hAPICall = k_uAPICallInvalid; // caller unregisters for us + (m_pObj->*m_Func)( (P *)pvParam, bIOFailure ); + } + } + virtual int GetCallbackSizeBytes() + { + return sizeof( P ); + } + + SteamAPICall_t m_hAPICall; + T *m_pObj; + func_t m_Func; +}; + + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam callback to a class member function +// template params: T = local class, P = parameter struct, +// bGameserver = listen for gameserver callbacks instead of client callbacks +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameserver = false > +class CCallback : public CCallbackImpl< sizeof( P ) > +{ +public: + typedef void (T::*func_t)(P*); + + // NOTE: If you can't provide the correct parameters at construction time, you should + // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. + CCallback( T *pObj, func_t func ) : m_pObj( NULL ), m_Func( NULL ) + { + if ( bGameserver ) + { + this->SetGameserverFlag(); + } + Register( pObj, func ); + } + + // manual registration of the callback + void Register( T *pObj, func_t func ) + { + if ( !pObj || !func ) + return; + + if ( this->m_nCallbackFlags & CCallbackBase::k_ECallbackFlagsRegistered ) + Unregister(); + + m_pObj = pObj; + m_Func = func; + // SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered + SteamAPI_RegisterCallback( this, P::k_iCallback ); + } + + void Unregister() + { + // SteamAPI_UnregisterCallback removes k_ECallbackFlagsRegistered + SteamAPI_UnregisterCallback( this ); + } + +protected: + virtual void Run( void *pvParam ) + { + (m_pObj->*m_Func)( (P *)pvParam ); + } + + T *m_pObj; + func_t m_Func; +}; + + +//----------------------------------------------------------------------------- +// Purpose: subclass of CCallback which allows default-construction in +// an unregistered state; you must call Register manually +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameServer = false > +class CCallbackManual : public CCallback< T, P, bGameServer > +{ +public: + CCallbackManual() : CCallback< T, P, bGameServer >( NULL, NULL ) {} + + // Inherits public Register and Unregister functions from base class +}; + + + +//----------------------------------------------------------------------------- +// The following macros are implementation details, not intended for public use +//----------------------------------------------------------------------------- +#define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) +#define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED +#define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y +#define _STEAM_CALLBACK_3( extra_code, thisclass, func, param ) \ + struct CCallbackInternal_ ## func : private CCallbackImpl< sizeof( param ) > { \ + CCallbackInternal_ ## func () { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ + CCallbackInternal_ ## func ( const CCallbackInternal_ ## func & ) { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ + CCallbackInternal_ ## func & operator=( const CCallbackInternal_ ## func & ) { return *this; } \ + private: virtual void Run( void *pvParam ) { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \ + thisclass *pOuter = reinterpret_cast( reinterpret_cast(this) - offsetof( thisclass, m_steamcallback_ ## func ) ); \ + pOuter->func( reinterpret_cast( pvParam ) ); \ + } \ + } m_steamcallback_ ## func ; void func( param *pParam ) +#define _STEAM_CALLBACK_4( _, thisclass, func, param, var ) \ + CCallback< thisclass, param > var; void func( param *pParam ) + + +#ifdef _WIN32 +// disable this warning; this pattern need for steam callback registration +#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list +#endif + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steamclient.dll private wrapper functions +// +// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +// pumps out all the steam messages, calling the register callback +S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks ); + +// register the callback funcs to use to interact with the steam dll +S_API void Steam_RegisterInterfaceFuncs( void *hModule ); + +// returns the HSteamUser of the last user to dispatch a callback +S_API HSteamUser Steam_GetHSteamUserCurrent(); + +// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name +S_API const char *SteamAPI_GetSteamInstallPath(); + +// returns the pipe we are communicating to Steam with +S_API HSteamPipe SteamAPI_GetHSteamPipe(); + +// sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks +S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks ); + +// backwards compat export, passes through to SteamAPI_ variants +S_API HSteamPipe GetHSteamPipe(); +S_API HSteamUser GetHSteamUser(); + +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that +// lets them each specify the interface versions they are compiled with. +// +// It's important that these stay inlined in the header so the calling module specifies the interface versions +// for whatever Steam API version it has. +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +S_API HSteamUser SteamAPI_GetHSteamUser(); + +class CSteamAPIContext +{ +public: + CSteamAPIContext(); + void Clear(); + + bool Init(); + + ISteamUser* SteamUser() { return m_pSteamUser; } + ISteamFriends* SteamFriends() { return m_pSteamFriends; } + ISteamUtils* SteamUtils() { return m_pSteamUtils; } + ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; } + ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; } + ISteamApps* SteamApps() { return m_pSteamApps; } + ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; } + ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; } + ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; } + ISteamScreenshots* SteamScreenshots() { return m_pSteamScreenshots; } + ISteamHTTP* SteamHTTP() { return m_pSteamHTTP; } + ISteamUnifiedMessages* SteamUnifiedMessages() { return m_pSteamUnifiedMessages; } + ISteamController* SteamController() { return m_pController; } + ISteamUGC* SteamUGC() { return m_pSteamUGC; } + ISteamAppList* SteamAppList() { return m_pSteamAppList; } + ISteamMusic* SteamMusic() { return m_pSteamMusic; } + ISteamMusicRemote* SteamMusicRemote() { return m_pSteamMusicRemote; } + ISteamHTMLSurface* SteamHTMLSurface() { return m_pSteamHTMLSurface; } + ISteamInventory* SteamInventory() { return m_pSteamInventory; } + ISteamVideo* SteamVideo() { return m_pSteamVideo; } +#ifdef _PS3 + ISteamPS3OverlayRender* SteamPS3OverlayRender() { return m_pSteamPS3OverlayRender; } +#endif + +private: + ISteamUser *m_pSteamUser; + ISteamFriends *m_pSteamFriends; + ISteamUtils *m_pSteamUtils; + ISteamMatchmaking *m_pSteamMatchmaking; + ISteamUserStats *m_pSteamUserStats; + ISteamApps *m_pSteamApps; + ISteamMatchmakingServers *m_pSteamMatchmakingServers; + ISteamNetworking *m_pSteamNetworking; + ISteamRemoteStorage *m_pSteamRemoteStorage; + ISteamScreenshots *m_pSteamScreenshots; + ISteamHTTP *m_pSteamHTTP; + ISteamUnifiedMessages*m_pSteamUnifiedMessages; + ISteamController *m_pController; + ISteamUGC *m_pSteamUGC; + ISteamAppList *m_pSteamAppList; + ISteamMusic *m_pSteamMusic; + ISteamMusicRemote *m_pSteamMusicRemote; + ISteamHTMLSurface *m_pSteamHTMLSurface; + ISteamInventory *m_pSteamInventory; + ISteamVideo *m_pSteamVideo; +#ifdef _PS3 + ISteamPS3OverlayRender *m_pSteamPS3OverlayRender; +#endif +}; + +inline CSteamAPIContext::CSteamAPIContext() +{ + Clear(); +} + +inline void CSteamAPIContext::Clear() +{ + m_pSteamUser = NULL; + m_pSteamFriends = NULL; + m_pSteamUtils = NULL; + m_pSteamMatchmaking = NULL; + m_pSteamUserStats = NULL; + m_pSteamApps = NULL; + m_pSteamMatchmakingServers = NULL; + m_pSteamNetworking = NULL; + m_pSteamRemoteStorage = NULL; + m_pSteamHTTP = NULL; + m_pSteamScreenshots = NULL; + m_pSteamMusic = NULL; + m_pSteamUnifiedMessages = NULL; + m_pController = NULL; + m_pSteamUGC = NULL; + m_pSteamAppList = NULL; + m_pSteamMusic = NULL; + m_pSteamMusicRemote= NULL; + m_pSteamHTMLSurface = NULL; + m_pSteamInventory = NULL; +#ifdef _PS3 + m_pSteamPS3OverlayRender = NULL; +#endif +} + +// This function must be inlined so the module using steam_api.dll gets the version names they want. +inline bool CSteamAPIContext::Init() +{ + if ( !SteamClient() ) + return false; + + HSteamUser hSteamUser = SteamAPI_GetHSteamUser(); + HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe(); + + m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION ); + if ( !m_pSteamUser ) + return false; + + m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION ); + if ( !m_pSteamFriends ) + return false; + + m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); + if ( !m_pSteamUtils ) + return false; + + m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION ); + if ( !m_pSteamMatchmaking ) + return false; + + m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); + if ( !m_pSteamMatchmakingServers ) + return false; + + m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION ); + if ( !m_pSteamUserStats ) + return false; + + m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION ); + if ( !m_pSteamApps ) + return false; + + m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); + if ( !m_pSteamNetworking ) + return false; + + m_pSteamRemoteStorage = SteamClient()->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION ); + if ( !m_pSteamRemoteStorage ) + return false; + + m_pSteamScreenshots = SteamClient()->GetISteamScreenshots( hSteamUser, hSteamPipe, STEAMSCREENSHOTS_INTERFACE_VERSION ); + if ( !m_pSteamScreenshots ) + return false; + + m_pSteamHTTP = SteamClient()->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); + if ( !m_pSteamHTTP ) + return false; + + m_pSteamUnifiedMessages = SteamClient()->GetISteamUnifiedMessages( hSteamUser, hSteamPipe, STEAMUNIFIEDMESSAGES_INTERFACE_VERSION ); + if ( !m_pSteamUnifiedMessages ) + return false; + + m_pController = SteamClient()->GetISteamController( hSteamUser, hSteamPipe, STEAMCONTROLLER_INTERFACE_VERSION ); + if ( !m_pController ) + return false; + + m_pSteamUGC = SteamClient()->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); + if ( !m_pSteamUGC ) + return false; + + m_pSteamAppList = SteamClient()->GetISteamAppList( hSteamUser, hSteamPipe, STEAMAPPLIST_INTERFACE_VERSION ); + if ( !m_pSteamAppList ) + return false; + + m_pSteamMusic = SteamClient()->GetISteamMusic( hSteamUser, hSteamPipe, STEAMMUSIC_INTERFACE_VERSION ); + if ( !m_pSteamMusic ) + { + return false; + } + + m_pSteamMusicRemote = SteamClient()->GetISteamMusicRemote( hSteamUser, hSteamPipe, STEAMMUSICREMOTE_INTERFACE_VERSION ); + if ( !m_pSteamMusicRemote ) + { + return false; + } + + m_pSteamHTMLSurface = SteamClient()->GetISteamHTMLSurface( hSteamUser, hSteamPipe, STEAMHTMLSURFACE_INTERFACE_VERSION ); + if ( !m_pSteamHTMLSurface ) + { + return false; + } + + m_pSteamInventory = SteamClient()->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION ); + if ( !m_pSteamInventory ) + { + return false; + } + + m_pSteamVideo = SteamClient()->GetISteamVideo( hSteamUser, hSteamPipe, STEAMVIDEO_INTERFACE_VERSION ); + if ( !m_pSteamVideo ) + { + return false; + } + +#ifdef _PS3 + m_pSteamPS3OverlayRender = SteamClient()->GetISteamPS3OverlayRender(); +#endif + + return true; +} + +#endif // VERSION_SAFE_STEAM_API_INTERFACES + +#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) +// this should be called before the game initialized the steam APIs +// pchDate should be of the format "Mmm dd yyyy" (such as from the __DATE__ macro ) +// pchTime should be of the format "hh:mm:ss" (such as from the __TIME__ macro ) +// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder +// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback +// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream. +S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback ); +S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID ); +#endif + +#endif // STEAM_API_H diff --git a/public/steam/steam_api.json b/public/steam/steam_api.json new file mode 100644 index 000000000..4d94b6b50 --- /dev/null +++ b/public/steam/steam_api.json @@ -0,0 +1,7241 @@ +{"typedefs":[{"typedef": "uint8","type": "unsigned char"} +,{"typedef": "uint8","type": "unsigned char"} +,{"typedef": "int8","type": "signed char"} +,{"typedef": "int16","type": "short"} +,{"typedef": "uint16","type": "unsigned short"} +,{"typedef": "int32","type": "int"} +,{"typedef": "uint32","type": "unsigned int"} +,{"typedef": "int64","type": "long long"} +,{"typedef": "uint64","type": "unsigned long long"} +,{"typedef": "lint64","type": "int64"} +,{"typedef": "ulint64","type": "uint64"} +,{"typedef": "intp","type": "long long"} +,{"typedef": "uintp","type": "unsigned long long"} +,{"typedef": "Salt_t","type": "uint8 [8]"} +,{"typedef": "GID_t","type": "uint64"} +,{"typedef": "JobID_t","type": "uint64"} +,{"typedef": "TxnID_t","type": "GID_t"} +,{"typedef": "PackageId_t","type": "uint32"} +,{"typedef": "BundleId_t","type": "uint32"} +,{"typedef": "AppId_t","type": "uint32"} +,{"typedef": "AssetClassId_t","type": "uint64"} +,{"typedef": "PhysicalItemId_t","type": "uint32"} +,{"typedef": "DepotId_t","type": "uint32"} +,{"typedef": "RTime32","type": "uint32"} +,{"typedef": "CellID_t","type": "uint32"} +,{"typedef": "SteamAPICall_t","type": "uint64"} +,{"typedef": "AccountID_t","type": "uint32"} +,{"typedef": "PartnerId_t","type": "uint32"} +,{"typedef": "ManifestId_t","type": "uint64"} +,{"typedef": "HAuthTicket","type": "uint32"} +,{"typedef": "PFNLegacyKeyRegistration","type": "void (*)(const char *, const char *)"} +,{"typedef": "PFNLegacyKeyInstalled","type": "_Bool (*)(void)"} +,{"typedef": "PFNPreMinidumpCallback","type": "void (*)(void *)"} +,{"typedef": "BREAKPAD_HANDLE","type": "void *"} +,{"typedef": "ValvePackingSentinel_t","type": "struct ValvePackingSentinel_t"} +,{"typedef": "compile_time_assert_type","type": "char [1]"} +,{"typedef": "HSteamPipe","type": "int32"} +,{"typedef": "HSteamUser","type": "int32"} +,{"typedef": "SteamAPIWarningMessageHook_t","type": "void (*)(int, const char *) __attribute__((cdecl))"} +,{"typedef": "SteamAPI_PostAPIResultInProcess_t","type": "void (*)(SteamAPICall_t, void *, uint32, int)"} +,{"typedef": "SteamAPI_CheckCallbackRegistered_t","type": "uint32 (*)(int)"} +,{"typedef": "HSteamCall","type": "int32"} +,{"typedef": "FriendsGroupID_t","type": "int16"} +,{"typedef": "SteamAPIWarningMessageHook_t","type": "void (*)(int, const char *) __attribute__((cdecl))"} +,{"typedef": "HServerListRequest","type": "void *"} +,{"typedef": "HServerQuery","type": "int"} +,{"typedef": "UGCHandle_t","type": "uint64"} +,{"typedef": "PublishedFileUpdateHandle_t","type": "uint64"} +,{"typedef": "PublishedFileId_t","type": "uint64"} +,{"typedef": "UGCFileWriteStreamHandle_t","type": "uint64"} +,{"typedef": "compile_time_assert_type","type": "char [1]"} +,{"typedef": "SteamLeaderboard_t","type": "uint64"} +,{"typedef": "SteamLeaderboardEntries_t","type": "uint64"} +,{"typedef": "SNetSocket_t","type": "uint32"} +,{"typedef": "SNetListenSocket_t","type": "uint32"} +,{"typedef": "ScreenshotHandle","type": "uint32"} +,{"typedef": "HTTPRequestHandle","type": "uint32"} +,{"typedef": "HTTPCookieContainerHandle","type": "uint32"} +,{"typedef": "ClientUnifiedMessageHandle","type": "uint64"} +,{"typedef": "ControllerHandle_t","type": "uint64"} +,{"typedef": "ControllerActionSetHandle_t","type": "uint64"} +,{"typedef": "ControllerDigitalActionHandle_t","type": "uint64"} +,{"typedef": "ControllerAnalogActionHandle_t","type": "uint64"} +,{"typedef": "UGCQueryHandle_t","type": "uint64"} +,{"typedef": "UGCUpdateHandle_t","type": "uint64"} +,{"typedef": "HHTMLBrowser","type": "uint32"} +,{"typedef": "SteamItemInstanceID_t","type": "uint64"} +,{"typedef": "SteamItemDef_t","type": "int32"} +,{"typedef": "SteamInventoryResult_t","type": "int32"} +,{"typedef": "CCallResult::func_t","type": "void (T::*)(P *, _Bool)"} +,{"typedef": "CCallback::func_t","type": "void (T::*)(P *)"} +], +"enums":[ + {"enumname": "EUniverse","values": [ + {"name": "k_EUniverseInvalid","value": "0"} + ,{"name": "k_EUniversePublic","value": "1"} + ,{"name": "k_EUniverseBeta","value": "2"} + ,{"name": "k_EUniverseInternal","value": "3"} + ,{"name": "k_EUniverseDev","value": "4"} + ,{"name": "k_EUniverseMax","value": "5"} +]} +, {"enumname": "EResult","values": [ + {"name": "k_EResultOK","value": "1"} + ,{"name": "k_EResultFail","value": "2"} + ,{"name": "k_EResultNoConnection","value": "3"} + ,{"name": "k_EResultInvalidPassword","value": "5"} + ,{"name": "k_EResultLoggedInElsewhere","value": "6"} + ,{"name": "k_EResultInvalidProtocolVer","value": "7"} + ,{"name": "k_EResultInvalidParam","value": "8"} + ,{"name": "k_EResultFileNotFound","value": "9"} + ,{"name": "k_EResultBusy","value": "10"} + ,{"name": "k_EResultInvalidState","value": "11"} + ,{"name": "k_EResultInvalidName","value": "12"} + ,{"name": "k_EResultInvalidEmail","value": "13"} + ,{"name": "k_EResultDuplicateName","value": "14"} + ,{"name": "k_EResultAccessDenied","value": "15"} + ,{"name": "k_EResultTimeout","value": "16"} + ,{"name": "k_EResultBanned","value": "17"} + ,{"name": "k_EResultAccountNotFound","value": "18"} + ,{"name": "k_EResultInvalidSteamID","value": "19"} + ,{"name": "k_EResultServiceUnavailable","value": "20"} + ,{"name": "k_EResultNotLoggedOn","value": "21"} + ,{"name": "k_EResultPending","value": "22"} + ,{"name": "k_EResultEncryptionFailure","value": "23"} + ,{"name": "k_EResultInsufficientPrivilege","value": "24"} + ,{"name": "k_EResultLimitExceeded","value": "25"} + ,{"name": "k_EResultRevoked","value": "26"} + ,{"name": "k_EResultExpired","value": "27"} + ,{"name": "k_EResultAlreadyRedeemed","value": "28"} + ,{"name": "k_EResultDuplicateRequest","value": "29"} + ,{"name": "k_EResultAlreadyOwned","value": "30"} + ,{"name": "k_EResultIPNotFound","value": "31"} + ,{"name": "k_EResultPersistFailed","value": "32"} + ,{"name": "k_EResultLockingFailed","value": "33"} + ,{"name": "k_EResultLogonSessionReplaced","value": "34"} + ,{"name": "k_EResultConnectFailed","value": "35"} + ,{"name": "k_EResultHandshakeFailed","value": "36"} + ,{"name": "k_EResultIOFailure","value": "37"} + ,{"name": "k_EResultRemoteDisconnect","value": "38"} + ,{"name": "k_EResultShoppingCartNotFound","value": "39"} + ,{"name": "k_EResultBlocked","value": "40"} + ,{"name": "k_EResultIgnored","value": "41"} + ,{"name": "k_EResultNoMatch","value": "42"} + ,{"name": "k_EResultAccountDisabled","value": "43"} + ,{"name": "k_EResultServiceReadOnly","value": "44"} + ,{"name": "k_EResultAccountNotFeatured","value": "45"} + ,{"name": "k_EResultAdministratorOK","value": "46"} + ,{"name": "k_EResultContentVersion","value": "47"} + ,{"name": "k_EResultTryAnotherCM","value": "48"} + ,{"name": "k_EResultPasswordRequiredToKickSession","value": "49"} + ,{"name": "k_EResultAlreadyLoggedInElsewhere","value": "50"} + ,{"name": "k_EResultSuspended","value": "51"} + ,{"name": "k_EResultCancelled","value": "52"} + ,{"name": "k_EResultDataCorruption","value": "53"} + ,{"name": "k_EResultDiskFull","value": "54"} + ,{"name": "k_EResultRemoteCallFailed","value": "55"} + ,{"name": "k_EResultPasswordUnset","value": "56"} + ,{"name": "k_EResultExternalAccountUnlinked","value": "57"} + ,{"name": "k_EResultPSNTicketInvalid","value": "58"} + ,{"name": "k_EResultExternalAccountAlreadyLinked","value": "59"} + ,{"name": "k_EResultRemoteFileConflict","value": "60"} + ,{"name": "k_EResultIllegalPassword","value": "61"} + ,{"name": "k_EResultSameAsPreviousValue","value": "62"} + ,{"name": "k_EResultAccountLogonDenied","value": "63"} + ,{"name": "k_EResultCannotUseOldPassword","value": "64"} + ,{"name": "k_EResultInvalidLoginAuthCode","value": "65"} + ,{"name": "k_EResultAccountLogonDeniedNoMail","value": "66"} + ,{"name": "k_EResultHardwareNotCapableOfIPT","value": "67"} + ,{"name": "k_EResultIPTInitError","value": "68"} + ,{"name": "k_EResultParentalControlRestricted","value": "69"} + ,{"name": "k_EResultFacebookQueryError","value": "70"} + ,{"name": "k_EResultExpiredLoginAuthCode","value": "71"} + ,{"name": "k_EResultIPLoginRestrictionFailed","value": "72"} + ,{"name": "k_EResultAccountLockedDown","value": "73"} + ,{"name": "k_EResultAccountLogonDeniedVerifiedEmailRequired","value": "74"} + ,{"name": "k_EResultNoMatchingURL","value": "75"} + ,{"name": "k_EResultBadResponse","value": "76"} + ,{"name": "k_EResultRequirePasswordReEntry","value": "77"} + ,{"name": "k_EResultValueOutOfRange","value": "78"} + ,{"name": "k_EResultUnexpectedError","value": "79"} + ,{"name": "k_EResultDisabled","value": "80"} + ,{"name": "k_EResultInvalidCEGSubmission","value": "81"} + ,{"name": "k_EResultRestrictedDevice","value": "82"} + ,{"name": "k_EResultRegionLocked","value": "83"} + ,{"name": "k_EResultRateLimitExceeded","value": "84"} + ,{"name": "k_EResultAccountLoginDeniedNeedTwoFactor","value": "85"} + ,{"name": "k_EResultItemDeleted","value": "86"} + ,{"name": "k_EResultAccountLoginDeniedThrottle","value": "87"} + ,{"name": "k_EResultTwoFactorCodeMismatch","value": "88"} + ,{"name": "k_EResultTwoFactorActivationCodeMismatch","value": "89"} + ,{"name": "k_EResultAccountAssociatedToMultiplePartners","value": "90"} + ,{"name": "k_EResultNotModified","value": "91"} + ,{"name": "k_EResultNoMobileDevice","value": "92"} + ,{"name": "k_EResultTimeNotSynced","value": "93"} + ,{"name": "k_EResultSmsCodeFailed","value": "94"} + ,{"name": "k_EResultAccountLimitExceeded","value": "95"} + ,{"name": "k_EResultAccountActivityLimitExceeded","value": "96"} + ,{"name": "k_EResultPhoneActivityLimitExceeded","value": "97"} + ,{"name": "k_EResultRefundToWallet","value": "98"} + ,{"name": "k_EResultEmailSendFailure","value": "99"} + ,{"name": "k_EResultNotSettled","value": "100"} + ,{"name": "k_EResultNeedCaptcha","value": "101"} +]} +, {"enumname": "EVoiceResult","values": [ + {"name": "k_EVoiceResultOK","value": "0"} + ,{"name": "k_EVoiceResultNotInitialized","value": "1"} + ,{"name": "k_EVoiceResultNotRecording","value": "2"} + ,{"name": "k_EVoiceResultNoData","value": "3"} + ,{"name": "k_EVoiceResultBufferTooSmall","value": "4"} + ,{"name": "k_EVoiceResultDataCorrupted","value": "5"} + ,{"name": "k_EVoiceResultRestricted","value": "6"} + ,{"name": "k_EVoiceResultUnsupportedCodec","value": "7"} + ,{"name": "k_EVoiceResultReceiverOutOfDate","value": "8"} + ,{"name": "k_EVoiceResultReceiverDidNotAnswer","value": "9"} +]} +, {"enumname": "EDenyReason","values": [ + {"name": "k_EDenyInvalid","value": "0"} + ,{"name": "k_EDenyInvalidVersion","value": "1"} + ,{"name": "k_EDenyGeneric","value": "2"} + ,{"name": "k_EDenyNotLoggedOn","value": "3"} + ,{"name": "k_EDenyNoLicense","value": "4"} + ,{"name": "k_EDenyCheater","value": "5"} + ,{"name": "k_EDenyLoggedInElseWhere","value": "6"} + ,{"name": "k_EDenyUnknownText","value": "7"} + ,{"name": "k_EDenyIncompatibleAnticheat","value": "8"} + ,{"name": "k_EDenyMemoryCorruption","value": "9"} + ,{"name": "k_EDenyIncompatibleSoftware","value": "10"} + ,{"name": "k_EDenySteamConnectionLost","value": "11"} + ,{"name": "k_EDenySteamConnectionError","value": "12"} + ,{"name": "k_EDenySteamResponseTimedOut","value": "13"} + ,{"name": "k_EDenySteamValidationStalled","value": "14"} + ,{"name": "k_EDenySteamOwnerLeftGuestUser","value": "15"} +]} +, {"enumname": "EBeginAuthSessionResult","values": [ + {"name": "k_EBeginAuthSessionResultOK","value": "0"} + ,{"name": "k_EBeginAuthSessionResultInvalidTicket","value": "1"} + ,{"name": "k_EBeginAuthSessionResultDuplicateRequest","value": "2"} + ,{"name": "k_EBeginAuthSessionResultInvalidVersion","value": "3"} + ,{"name": "k_EBeginAuthSessionResultGameMismatch","value": "4"} + ,{"name": "k_EBeginAuthSessionResultExpiredTicket","value": "5"} +]} +, {"enumname": "EAuthSessionResponse","values": [ + {"name": "k_EAuthSessionResponseOK","value": "0"} + ,{"name": "k_EAuthSessionResponseUserNotConnectedToSteam","value": "1"} + ,{"name": "k_EAuthSessionResponseNoLicenseOrExpired","value": "2"} + ,{"name": "k_EAuthSessionResponseVACBanned","value": "3"} + ,{"name": "k_EAuthSessionResponseLoggedInElseWhere","value": "4"} + ,{"name": "k_EAuthSessionResponseVACCheckTimedOut","value": "5"} + ,{"name": "k_EAuthSessionResponseAuthTicketCanceled","value": "6"} + ,{"name": "k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed","value": "7"} + ,{"name": "k_EAuthSessionResponseAuthTicketInvalid","value": "8"} + ,{"name": "k_EAuthSessionResponsePublisherIssuedBan","value": "9"} +]} +, {"enumname": "EUserHasLicenseForAppResult","values": [ + {"name": "k_EUserHasLicenseResultHasLicense","value": "0"} + ,{"name": "k_EUserHasLicenseResultDoesNotHaveLicense","value": "1"} + ,{"name": "k_EUserHasLicenseResultNoAuth","value": "2"} +]} +, {"enumname": "EAccountType","values": [ + {"name": "k_EAccountTypeInvalid","value": "0"} + ,{"name": "k_EAccountTypeIndividual","value": "1"} + ,{"name": "k_EAccountTypeMultiseat","value": "2"} + ,{"name": "k_EAccountTypeGameServer","value": "3"} + ,{"name": "k_EAccountTypeAnonGameServer","value": "4"} + ,{"name": "k_EAccountTypePending","value": "5"} + ,{"name": "k_EAccountTypeContentServer","value": "6"} + ,{"name": "k_EAccountTypeClan","value": "7"} + ,{"name": "k_EAccountTypeChat","value": "8"} + ,{"name": "k_EAccountTypeConsoleUser","value": "9"} + ,{"name": "k_EAccountTypeAnonUser","value": "10"} + ,{"name": "k_EAccountTypeMax","value": "11"} +]} +, {"enumname": "EAppReleaseState","values": [ + {"name": "k_EAppReleaseState_Unknown","value": "0"} + ,{"name": "k_EAppReleaseState_Unavailable","value": "1"} + ,{"name": "k_EAppReleaseState_Prerelease","value": "2"} + ,{"name": "k_EAppReleaseState_PreloadOnly","value": "3"} + ,{"name": "k_EAppReleaseState_Released","value": "4"} +]} +, {"enumname": "EAppOwnershipFlags","values": [ + {"name": "k_EAppOwnershipFlags_None","value": "0"} + ,{"name": "k_EAppOwnershipFlags_OwnsLicense","value": "1"} + ,{"name": "k_EAppOwnershipFlags_FreeLicense","value": "2"} + ,{"name": "k_EAppOwnershipFlags_RegionRestricted","value": "4"} + ,{"name": "k_EAppOwnershipFlags_LowViolence","value": "8"} + ,{"name": "k_EAppOwnershipFlags_InvalidPlatform","value": "16"} + ,{"name": "k_EAppOwnershipFlags_SharedLicense","value": "32"} + ,{"name": "k_EAppOwnershipFlags_FreeWeekend","value": "64"} + ,{"name": "k_EAppOwnershipFlags_RetailLicense","value": "128"} + ,{"name": "k_EAppOwnershipFlags_LicenseLocked","value": "256"} + ,{"name": "k_EAppOwnershipFlags_LicensePending","value": "512"} + ,{"name": "k_EAppOwnershipFlags_LicenseExpired","value": "1024"} + ,{"name": "k_EAppOwnershipFlags_LicensePermanent","value": "2048"} + ,{"name": "k_EAppOwnershipFlags_LicenseRecurring","value": "4096"} + ,{"name": "k_EAppOwnershipFlags_LicenseCanceled","value": "8192"} + ,{"name": "k_EAppOwnershipFlags_AutoGrant","value": "16384"} + ,{"name": "k_EAppOwnershipFlags_PendingGift","value": "32768"} +]} +, {"enumname": "EAppType","values": [ + {"name": "k_EAppType_Invalid","value": "0"} + ,{"name": "k_EAppType_Game","value": "1"} + ,{"name": "k_EAppType_Application","value": "2"} + ,{"name": "k_EAppType_Tool","value": "4"} + ,{"name": "k_EAppType_Demo","value": "8"} + ,{"name": "k_EAppType_Media_DEPRECATED","value": "16"} + ,{"name": "k_EAppType_DLC","value": "32"} + ,{"name": "k_EAppType_Guide","value": "64"} + ,{"name": "k_EAppType_Driver","value": "128"} + ,{"name": "k_EAppType_Config","value": "256"} + ,{"name": "k_EAppType_Hardware","value": "512"} + ,{"name": "k_EAppType_Video","value": "2048"} + ,{"name": "k_EAppType_Plugin","value": "4096"} + ,{"name": "k_EAppType_Music","value": "8192"} + ,{"name": "k_EAppType_Shortcut","value": "1073741824"} + ,{"name": "k_EAppType_DepotOnly","value": "-2147483648"} +]} +, {"enumname": "ESteamUserStatType","values": [ + {"name": "k_ESteamUserStatTypeINVALID","value": "0"} + ,{"name": "k_ESteamUserStatTypeINT","value": "1"} + ,{"name": "k_ESteamUserStatTypeFLOAT","value": "2"} + ,{"name": "k_ESteamUserStatTypeAVGRATE","value": "3"} + ,{"name": "k_ESteamUserStatTypeACHIEVEMENTS","value": "4"} + ,{"name": "k_ESteamUserStatTypeGROUPACHIEVEMENTS","value": "5"} + ,{"name": "k_ESteamUserStatTypeMAX","value": "6"} +]} +, {"enumname": "EChatEntryType","values": [ + {"name": "k_EChatEntryTypeInvalid","value": "0"} + ,{"name": "k_EChatEntryTypeChatMsg","value": "1"} + ,{"name": "k_EChatEntryTypeTyping","value": "2"} + ,{"name": "k_EChatEntryTypeInviteGame","value": "3"} + ,{"name": "k_EChatEntryTypeEmote","value": "4"} + ,{"name": "k_EChatEntryTypeLeftConversation","value": "6"} + ,{"name": "k_EChatEntryTypeEntered","value": "7"} + ,{"name": "k_EChatEntryTypeWasKicked","value": "8"} + ,{"name": "k_EChatEntryTypeWasBanned","value": "9"} + ,{"name": "k_EChatEntryTypeDisconnected","value": "10"} + ,{"name": "k_EChatEntryTypeHistoricalChat","value": "11"} + ,{"name": "k_EChatEntryTypeReserved1","value": "12"} + ,{"name": "k_EChatEntryTypeReserved2","value": "13"} + ,{"name": "k_EChatEntryTypeLinkBlocked","value": "14"} +]} +, {"enumname": "EChatRoomEnterResponse","values": [ + {"name": "k_EChatRoomEnterResponseSuccess","value": "1"} + ,{"name": "k_EChatRoomEnterResponseDoesntExist","value": "2"} + ,{"name": "k_EChatRoomEnterResponseNotAllowed","value": "3"} + ,{"name": "k_EChatRoomEnterResponseFull","value": "4"} + ,{"name": "k_EChatRoomEnterResponseError","value": "5"} + ,{"name": "k_EChatRoomEnterResponseBanned","value": "6"} + ,{"name": "k_EChatRoomEnterResponseLimited","value": "7"} + ,{"name": "k_EChatRoomEnterResponseClanDisabled","value": "8"} + ,{"name": "k_EChatRoomEnterResponseCommunityBan","value": "9"} + ,{"name": "k_EChatRoomEnterResponseMemberBlockedYou","value": "10"} + ,{"name": "k_EChatRoomEnterResponseYouBlockedMember","value": "11"} +]} +, {"enumname": "EChatSteamIDInstanceFlags","values": [ + {"name": "k_EChatAccountInstanceMask","value": "4095"} + ,{"name": "k_EChatInstanceFlagClan","value": "524288"} + ,{"name": "k_EChatInstanceFlagLobby","value": "262144"} + ,{"name": "k_EChatInstanceFlagMMSLobby","value": "131072"} +]} +, {"enumname": "EMarketingMessageFlags","values": [ + {"name": "k_EMarketingMessageFlagsNone","value": "0"} + ,{"name": "k_EMarketingMessageFlagsHighPriority","value": "1"} + ,{"name": "k_EMarketingMessageFlagsPlatformWindows","value": "2"} + ,{"name": "k_EMarketingMessageFlagsPlatformMac","value": "4"} + ,{"name": "k_EMarketingMessageFlagsPlatformLinux","value": "8"} + ,{"name": "k_EMarketingMessageFlagsPlatformRestrictions","value": "14"} +]} +, {"enumname": "ENotificationPosition","values": [ + {"name": "k_EPositionTopLeft","value": "0"} + ,{"name": "k_EPositionTopRight","value": "1"} + ,{"name": "k_EPositionBottomLeft","value": "2"} + ,{"name": "k_EPositionBottomRight","value": "3"} +]} +, {"enumname": "EBroadcastUploadResult","values": [ + {"name": "k_EBroadcastUploadResultNone","value": "0"} + ,{"name": "k_EBroadcastUploadResultOK","value": "1"} + ,{"name": "k_EBroadcastUploadResultInitFailed","value": "2"} + ,{"name": "k_EBroadcastUploadResultFrameFailed","value": "3"} + ,{"name": "k_EBroadcastUploadResultTimeout","value": "4"} + ,{"name": "k_EBroadcastUploadResultBandwidthExceeded","value": "5"} + ,{"name": "k_EBroadcastUploadResultLowFPS","value": "6"} + ,{"name": "k_EBroadcastUploadResultMissingKeyFrames","value": "7"} + ,{"name": "k_EBroadcastUploadResultNoConnection","value": "8"} + ,{"name": "k_EBroadcastUploadResultRelayFailed","value": "9"} + ,{"name": "k_EBroadcastUploadResultSettingsChanged","value": "10"} + ,{"name": "k_EBroadcastUploadResultMissingAudio","value": "11"} + ,{"name": "k_EBroadcastUploadResultTooFarBehind","value": "12"} + ,{"name": "k_EBroadcastUploadResultTranscodeBehind","value": "13"} +]} +, {"enumname": "ELaunchOptionType","values": [ + {"name": "k_ELaunchOptionType_None","value": "0"} + ,{"name": "k_ELaunchOptionType_Default","value": "1"} + ,{"name": "k_ELaunchOptionType_SafeMode","value": "2"} + ,{"name": "k_ELaunchOptionType_Multiplayer","value": "3"} + ,{"name": "k_ELaunchOptionType_Config","value": "4"} + ,{"name": "k_ELaunchOptionType_VR","value": "5"} + ,{"name": "k_ELaunchOptionType_Server","value": "6"} + ,{"name": "k_ELaunchOptionType_Editor","value": "7"} + ,{"name": "k_ELaunchOptionType_Manual","value": "8"} + ,{"name": "k_ELaunchOptionType_Benchmark","value": "9"} + ,{"name": "k_ELaunchOptionType_Option1","value": "10"} + ,{"name": "k_ELaunchOptionType_Option2","value": "11"} + ,{"name": "k_ELaunchOptionType_Option3","value": "12"} + ,{"name": "k_ELaunchOptionType_Dialog","value": "1000"} +]} +, {"enumname": "CGameID::EGameIDType","values": [ + {"name": "k_EGameIDTypeApp","value": "0"} + ,{"name": "k_EGameIDTypeGameMod","value": "1"} + ,{"name": "k_EGameIDTypeShortcut","value": "2"} + ,{"name": "k_EGameIDTypeP2P","value": "3"} +]} +, {"enumname": "IPCFailure_t::EFailureType","values": [ + {"name": "k_EFailureFlushedCallbackQueue","value": "0"} + ,{"name": "k_EFailurePipeFail","value": "1"} +]} +, {"enumname": "EFriendRelationship","values": [ + {"name": "k_EFriendRelationshipNone","value": "0"} + ,{"name": "k_EFriendRelationshipBlocked","value": "1"} + ,{"name": "k_EFriendRelationshipRequestRecipient","value": "2"} + ,{"name": "k_EFriendRelationshipFriend","value": "3"} + ,{"name": "k_EFriendRelationshipRequestInitiator","value": "4"} + ,{"name": "k_EFriendRelationshipIgnored","value": "5"} + ,{"name": "k_EFriendRelationshipIgnoredFriend","value": "6"} + ,{"name": "k_EFriendRelationshipSuggested","value": "7"} + ,{"name": "k_EFriendRelationshipMax","value": "8"} +]} +, {"enumname": "EPersonaState","values": [ + {"name": "k_EPersonaStateOffline","value": "0"} + ,{"name": "k_EPersonaStateOnline","value": "1"} + ,{"name": "k_EPersonaStateBusy","value": "2"} + ,{"name": "k_EPersonaStateAway","value": "3"} + ,{"name": "k_EPersonaStateSnooze","value": "4"} + ,{"name": "k_EPersonaStateLookingToTrade","value": "5"} + ,{"name": "k_EPersonaStateLookingToPlay","value": "6"} + ,{"name": "k_EPersonaStateMax","value": "7"} +]} +, {"enumname": "EFriendFlags","values": [ + {"name": "k_EFriendFlagNone","value": "0"} + ,{"name": "k_EFriendFlagBlocked","value": "1"} + ,{"name": "k_EFriendFlagFriendshipRequested","value": "2"} + ,{"name": "k_EFriendFlagImmediate","value": "4"} + ,{"name": "k_EFriendFlagClanMember","value": "8"} + ,{"name": "k_EFriendFlagOnGameServer","value": "16"} + ,{"name": "k_EFriendFlagRequestingFriendship","value": "128"} + ,{"name": "k_EFriendFlagRequestingInfo","value": "256"} + ,{"name": "k_EFriendFlagIgnored","value": "512"} + ,{"name": "k_EFriendFlagIgnoredFriend","value": "1024"} + ,{"name": "k_EFriendFlagSuggested","value": "2048"} + ,{"name": "k_EFriendFlagAll","value": "65535"} +]} +, {"enumname": "EUserRestriction","values": [ + {"name": "k_nUserRestrictionNone","value": "0"} + ,{"name": "k_nUserRestrictionUnknown","value": "1"} + ,{"name": "k_nUserRestrictionAnyChat","value": "2"} + ,{"name": "k_nUserRestrictionVoiceChat","value": "4"} + ,{"name": "k_nUserRestrictionGroupChat","value": "8"} + ,{"name": "k_nUserRestrictionRating","value": "16"} + ,{"name": "k_nUserRestrictionGameInvites","value": "32"} + ,{"name": "k_nUserRestrictionTrading","value": "64"} +]} +, {"enumname": "EOverlayToStoreFlag","values": [ + {"name": "k_EOverlayToStoreFlag_None","value": "0"} + ,{"name": "k_EOverlayToStoreFlag_AddToCart","value": "1"} + ,{"name": "k_EOverlayToStoreFlag_AddToCartAndShow","value": "2"} +]} +, {"enumname": "EPersonaChange","values": [ + {"name": "k_EPersonaChangeName","value": "1"} + ,{"name": "k_EPersonaChangeStatus","value": "2"} + ,{"name": "k_EPersonaChangeComeOnline","value": "4"} + ,{"name": "k_EPersonaChangeGoneOffline","value": "8"} + ,{"name": "k_EPersonaChangeGamePlayed","value": "16"} + ,{"name": "k_EPersonaChangeGameServer","value": "32"} + ,{"name": "k_EPersonaChangeAvatar","value": "64"} + ,{"name": "k_EPersonaChangeJoinedSource","value": "128"} + ,{"name": "k_EPersonaChangeLeftSource","value": "256"} + ,{"name": "k_EPersonaChangeRelationshipChanged","value": "512"} + ,{"name": "k_EPersonaChangeNameFirstSet","value": "1024"} + ,{"name": "k_EPersonaChangeFacebookInfo","value": "2048"} + ,{"name": "k_EPersonaChangeNickname","value": "4096"} + ,{"name": "k_EPersonaChangeSteamLevel","value": "8192"} +]} +, {"enumname": "ESteamAPICallFailure","values": [ + {"name": "k_ESteamAPICallFailureNone","value": "-1"} + ,{"name": "k_ESteamAPICallFailureSteamGone","value": "0"} + ,{"name": "k_ESteamAPICallFailureNetworkFailure","value": "1"} + ,{"name": "k_ESteamAPICallFailureInvalidHandle","value": "2"} + ,{"name": "k_ESteamAPICallFailureMismatchedCallback","value": "3"} +]} +, {"enumname": "EGamepadTextInputMode","values": [ + {"name": "k_EGamepadTextInputModeNormal","value": "0"} + ,{"name": "k_EGamepadTextInputModePassword","value": "1"} +]} +, {"enumname": "EGamepadTextInputLineMode","values": [ + {"name": "k_EGamepadTextInputLineModeSingleLine","value": "0"} + ,{"name": "k_EGamepadTextInputLineModeMultipleLines","value": "1"} +]} +, {"enumname": "ECheckFileSignature","values": [ + {"name": "k_ECheckFileSignatureInvalidSignature","value": "0"} + ,{"name": "k_ECheckFileSignatureValidSignature","value": "1"} + ,{"name": "k_ECheckFileSignatureFileNotFound","value": "2"} + ,{"name": "k_ECheckFileSignatureNoSignaturesFoundForThisApp","value": "3"} + ,{"name": "k_ECheckFileSignatureNoSignaturesFoundForThisFile","value": "4"} +]} +, {"enumname": "EMatchMakingServerResponse","values": [ + {"name": "eServerResponded","value": "0"} + ,{"name": "eServerFailedToRespond","value": "1"} + ,{"name": "eNoServersListedOnMasterServer","value": "2"} +]} +, {"enumname": "ELobbyType","values": [ + {"name": "k_ELobbyTypePrivate","value": "0"} + ,{"name": "k_ELobbyTypeFriendsOnly","value": "1"} + ,{"name": "k_ELobbyTypePublic","value": "2"} + ,{"name": "k_ELobbyTypeInvisible","value": "3"} +]} +, {"enumname": "ELobbyComparison","values": [ + {"name": "k_ELobbyComparisonEqualToOrLessThan","value": "-2"} + ,{"name": "k_ELobbyComparisonLessThan","value": "-1"} + ,{"name": "k_ELobbyComparisonEqual","value": "0"} + ,{"name": "k_ELobbyComparisonGreaterThan","value": "1"} + ,{"name": "k_ELobbyComparisonEqualToOrGreaterThan","value": "2"} + ,{"name": "k_ELobbyComparisonNotEqual","value": "3"} +]} +, {"enumname": "ELobbyDistanceFilter","values": [ + {"name": "k_ELobbyDistanceFilterClose","value": "0"} + ,{"name": "k_ELobbyDistanceFilterDefault","value": "1"} + ,{"name": "k_ELobbyDistanceFilterFar","value": "2"} + ,{"name": "k_ELobbyDistanceFilterWorldwide","value": "3"} +]} +, {"enumname": "EChatMemberStateChange","values": [ + {"name": "k_EChatMemberStateChangeEntered","value": "1"} + ,{"name": "k_EChatMemberStateChangeLeft","value": "2"} + ,{"name": "k_EChatMemberStateChangeDisconnected","value": "4"} + ,{"name": "k_EChatMemberStateChangeKicked","value": "8"} + ,{"name": "k_EChatMemberStateChangeBanned","value": "16"} +]} +, {"enumname": "EResolveConflict","values": [ + {"name": "k_EResolveConflictKeepClient","value": "1"} + ,{"name": "k_EResolveConflictKeepServer","value": "2"} +]} +, {"enumname": "ERemoteStoragePlatform","values": [ + {"name": "k_ERemoteStoragePlatformNone","value": "0"} + ,{"name": "k_ERemoteStoragePlatformWindows","value": "1"} + ,{"name": "k_ERemoteStoragePlatformOSX","value": "2"} + ,{"name": "k_ERemoteStoragePlatformPS3","value": "4"} + ,{"name": "k_ERemoteStoragePlatformLinux","value": "8"} + ,{"name": "k_ERemoteStoragePlatformReserved2","value": "16"} + ,{"name": "k_ERemoteStoragePlatformAll","value": "-1"} +]} +, {"enumname": "ERemoteStoragePublishedFileVisibility","values": [ + {"name": "k_ERemoteStoragePublishedFileVisibilityPublic","value": "0"} + ,{"name": "k_ERemoteStoragePublishedFileVisibilityFriendsOnly","value": "1"} + ,{"name": "k_ERemoteStoragePublishedFileVisibilityPrivate","value": "2"} +]} +, {"enumname": "EWorkshopFileType","values": [ + {"name": "k_EWorkshopFileTypeFirst","value": "0"} + ,{"name": "k_EWorkshopFileTypeCommunity","value": "0"} + ,{"name": "k_EWorkshopFileTypeMicrotransaction","value": "1"} + ,{"name": "k_EWorkshopFileTypeCollection","value": "2"} + ,{"name": "k_EWorkshopFileTypeArt","value": "3"} + ,{"name": "k_EWorkshopFileTypeVideo","value": "4"} + ,{"name": "k_EWorkshopFileTypeScreenshot","value": "5"} + ,{"name": "k_EWorkshopFileTypeGame","value": "6"} + ,{"name": "k_EWorkshopFileTypeSoftware","value": "7"} + ,{"name": "k_EWorkshopFileTypeConcept","value": "8"} + ,{"name": "k_EWorkshopFileTypeWebGuide","value": "9"} + ,{"name": "k_EWorkshopFileTypeIntegratedGuide","value": "10"} + ,{"name": "k_EWorkshopFileTypeMerch","value": "11"} + ,{"name": "k_EWorkshopFileTypeControllerBinding","value": "12"} + ,{"name": "k_EWorkshopFileTypeSteamworksAccessInvite","value": "13"} + ,{"name": "k_EWorkshopFileTypeSteamVideo","value": "14"} + ,{"name": "k_EWorkshopFileTypeGameManagedItem","value": "15"} + ,{"name": "k_EWorkshopFileTypeMax","value": "16"} +]} +, {"enumname": "EWorkshopVote","values": [ + {"name": "k_EWorkshopVoteUnvoted","value": "0"} + ,{"name": "k_EWorkshopVoteFor","value": "1"} + ,{"name": "k_EWorkshopVoteAgainst","value": "2"} + ,{"name": "k_EWorkshopVoteLater","value": "3"} +]} +, {"enumname": "EWorkshopFileAction","values": [ + {"name": "k_EWorkshopFileActionPlayed","value": "0"} + ,{"name": "k_EWorkshopFileActionCompleted","value": "1"} +]} +, {"enumname": "EWorkshopEnumerationType","values": [ + {"name": "k_EWorkshopEnumerationTypeRankedByVote","value": "0"} + ,{"name": "k_EWorkshopEnumerationTypeRecent","value": "1"} + ,{"name": "k_EWorkshopEnumerationTypeTrending","value": "2"} + ,{"name": "k_EWorkshopEnumerationTypeFavoritesOfFriends","value": "3"} + ,{"name": "k_EWorkshopEnumerationTypeVotedByFriends","value": "4"} + ,{"name": "k_EWorkshopEnumerationTypeContentByFriends","value": "5"} + ,{"name": "k_EWorkshopEnumerationTypeRecentFromFollowedUsers","value": "6"} +]} +, {"enumname": "EWorkshopVideoProvider","values": [ + {"name": "k_EWorkshopVideoProviderNone","value": "0"} + ,{"name": "k_EWorkshopVideoProviderYoutube","value": "1"} +]} +, {"enumname": "EUGCReadAction","values": [ + {"name": "k_EUGCRead_ContinueReadingUntilFinished","value": "0"} + ,{"name": "k_EUGCRead_ContinueReading","value": "1"} + ,{"name": "k_EUGCRead_Close","value": "2"} +]} +, {"enumname": "ELeaderboardDataRequest","values": [ + {"name": "k_ELeaderboardDataRequestGlobal","value": "0"} + ,{"name": "k_ELeaderboardDataRequestGlobalAroundUser","value": "1"} + ,{"name": "k_ELeaderboardDataRequestFriends","value": "2"} + ,{"name": "k_ELeaderboardDataRequestUsers","value": "3"} +]} +, {"enumname": "ELeaderboardSortMethod","values": [ + {"name": "k_ELeaderboardSortMethodNone","value": "0"} + ,{"name": "k_ELeaderboardSortMethodAscending","value": "1"} + ,{"name": "k_ELeaderboardSortMethodDescending","value": "2"} +]} +, {"enumname": "ELeaderboardDisplayType","values": [ + {"name": "k_ELeaderboardDisplayTypeNone","value": "0"} + ,{"name": "k_ELeaderboardDisplayTypeNumeric","value": "1"} + ,{"name": "k_ELeaderboardDisplayTypeTimeSeconds","value": "2"} + ,{"name": "k_ELeaderboardDisplayTypeTimeMilliSeconds","value": "3"} +]} +, {"enumname": "ELeaderboardUploadScoreMethod","values": [ + {"name": "k_ELeaderboardUploadScoreMethodNone","value": "0"} + ,{"name": "k_ELeaderboardUploadScoreMethodKeepBest","value": "1"} + ,{"name": "k_ELeaderboardUploadScoreMethodForceUpdate","value": "2"} +]} +, {"enumname": "ERegisterActivationCodeResult","values": [ + {"name": "k_ERegisterActivationCodeResultOK","value": "0"} + ,{"name": "k_ERegisterActivationCodeResultFail","value": "1"} + ,{"name": "k_ERegisterActivationCodeResultAlreadyRegistered","value": "2"} + ,{"name": "k_ERegisterActivationCodeResultTimeout","value": "3"} + ,{"name": "k_ERegisterActivationCodeAlreadyOwned","value": "4"} +]} +, {"enumname": "EP2PSessionError","values": [ + {"name": "k_EP2PSessionErrorNone","value": "0"} + ,{"name": "k_EP2PSessionErrorNotRunningApp","value": "1"} + ,{"name": "k_EP2PSessionErrorNoRightsToApp","value": "2"} + ,{"name": "k_EP2PSessionErrorDestinationNotLoggedIn","value": "3"} + ,{"name": "k_EP2PSessionErrorTimeout","value": "4"} + ,{"name": "k_EP2PSessionErrorMax","value": "5"} +]} +, {"enumname": "EP2PSend","values": [ + {"name": "k_EP2PSendUnreliable","value": "0"} + ,{"name": "k_EP2PSendUnreliableNoDelay","value": "1"} + ,{"name": "k_EP2PSendReliable","value": "2"} + ,{"name": "k_EP2PSendReliableWithBuffering","value": "3"} +]} +, {"enumname": "ESNetSocketState","values": [ + {"name": "k_ESNetSocketStateInvalid","value": "0"} + ,{"name": "k_ESNetSocketStateConnected","value": "1"} + ,{"name": "k_ESNetSocketStateInitiated","value": "10"} + ,{"name": "k_ESNetSocketStateLocalCandidatesFound","value": "11"} + ,{"name": "k_ESNetSocketStateReceivedRemoteCandidates","value": "12"} + ,{"name": "k_ESNetSocketStateChallengeHandshake","value": "15"} + ,{"name": "k_ESNetSocketStateDisconnecting","value": "21"} + ,{"name": "k_ESNetSocketStateLocalDisconnect","value": "22"} + ,{"name": "k_ESNetSocketStateTimeoutDuringConnect","value": "23"} + ,{"name": "k_ESNetSocketStateRemoteEndDisconnected","value": "24"} + ,{"name": "k_ESNetSocketStateConnectionBroken","value": "25"} +]} +, {"enumname": "ESNetSocketConnectionType","values": [ + {"name": "k_ESNetSocketConnectionTypeNotConnected","value": "0"} + ,{"name": "k_ESNetSocketConnectionTypeUDP","value": "1"} + ,{"name": "k_ESNetSocketConnectionTypeUDPRelay","value": "2"} +]} +, {"enumname": "AudioPlayback_Status","values": [ + {"name": "AudioPlayback_Undefined","value": "0"} + ,{"name": "AudioPlayback_Playing","value": "1"} + ,{"name": "AudioPlayback_Paused","value": "2"} + ,{"name": "AudioPlayback_Idle","value": "3"} +]} +, {"enumname": "EHTTPMethod","values": [ + {"name": "k_EHTTPMethodInvalid","value": "0"} + ,{"name": "k_EHTTPMethodGET","value": "1"} + ,{"name": "k_EHTTPMethodHEAD","value": "2"} + ,{"name": "k_EHTTPMethodPOST","value": "3"} + ,{"name": "k_EHTTPMethodPUT","value": "4"} + ,{"name": "k_EHTTPMethodDELETE","value": "5"} + ,{"name": "k_EHTTPMethodOPTIONS","value": "6"} +]} +, {"enumname": "EHTTPStatusCode","values": [ + {"name": "k_EHTTPStatusCodeInvalid","value": "0"} + ,{"name": "k_EHTTPStatusCode100Continue","value": "100"} + ,{"name": "k_EHTTPStatusCode101SwitchingProtocols","value": "101"} + ,{"name": "k_EHTTPStatusCode200OK","value": "200"} + ,{"name": "k_EHTTPStatusCode201Created","value": "201"} + ,{"name": "k_EHTTPStatusCode202Accepted","value": "202"} + ,{"name": "k_EHTTPStatusCode203NonAuthoritative","value": "203"} + ,{"name": "k_EHTTPStatusCode204NoContent","value": "204"} + ,{"name": "k_EHTTPStatusCode205ResetContent","value": "205"} + ,{"name": "k_EHTTPStatusCode206PartialContent","value": "206"} + ,{"name": "k_EHTTPStatusCode300MultipleChoices","value": "300"} + ,{"name": "k_EHTTPStatusCode301MovedPermanently","value": "301"} + ,{"name": "k_EHTTPStatusCode302Found","value": "302"} + ,{"name": "k_EHTTPStatusCode303SeeOther","value": "303"} + ,{"name": "k_EHTTPStatusCode304NotModified","value": "304"} + ,{"name": "k_EHTTPStatusCode305UseProxy","value": "305"} + ,{"name": "k_EHTTPStatusCode307TemporaryRedirect","value": "307"} + ,{"name": "k_EHTTPStatusCode400BadRequest","value": "400"} + ,{"name": "k_EHTTPStatusCode401Unauthorized","value": "401"} + ,{"name": "k_EHTTPStatusCode402PaymentRequired","value": "402"} + ,{"name": "k_EHTTPStatusCode403Forbidden","value": "403"} + ,{"name": "k_EHTTPStatusCode404NotFound","value": "404"} + ,{"name": "k_EHTTPStatusCode405MethodNotAllowed","value": "405"} + ,{"name": "k_EHTTPStatusCode406NotAcceptable","value": "406"} + ,{"name": "k_EHTTPStatusCode407ProxyAuthRequired","value": "407"} + ,{"name": "k_EHTTPStatusCode408RequestTimeout","value": "408"} + ,{"name": "k_EHTTPStatusCode409Conflict","value": "409"} + ,{"name": "k_EHTTPStatusCode410Gone","value": "410"} + ,{"name": "k_EHTTPStatusCode411LengthRequired","value": "411"} + ,{"name": "k_EHTTPStatusCode412PreconditionFailed","value": "412"} + ,{"name": "k_EHTTPStatusCode413RequestEntityTooLarge","value": "413"} + ,{"name": "k_EHTTPStatusCode414RequestURITooLong","value": "414"} + ,{"name": "k_EHTTPStatusCode415UnsupportedMediaType","value": "415"} + ,{"name": "k_EHTTPStatusCode416RequestedRangeNotSatisfiable","value": "416"} + ,{"name": "k_EHTTPStatusCode417ExpectationFailed","value": "417"} + ,{"name": "k_EHTTPStatusCode4xxUnknown","value": "418"} + ,{"name": "k_EHTTPStatusCode429TooManyRequests","value": "429"} + ,{"name": "k_EHTTPStatusCode500InternalServerError","value": "500"} + ,{"name": "k_EHTTPStatusCode501NotImplemented","value": "501"} + ,{"name": "k_EHTTPStatusCode502BadGateway","value": "502"} + ,{"name": "k_EHTTPStatusCode503ServiceUnavailable","value": "503"} + ,{"name": "k_EHTTPStatusCode504GatewayTimeout","value": "504"} + ,{"name": "k_EHTTPStatusCode505HTTPVersionNotSupported","value": "505"} + ,{"name": "k_EHTTPStatusCode5xxUnknown","value": "599"} +]} +, {"enumname": "ESteamControllerPad","values": [ + {"name": "k_ESteamControllerPad_Left","value": "0"} + ,{"name": "k_ESteamControllerPad_Right","value": "1"} +]} +, {"enumname": "EControllerSource","values": [ + {"name": "k_EControllerSource_None","value": "0"} + ,{"name": "k_EControllerSource_LeftTrackpad","value": "1"} + ,{"name": "k_EControllerSource_RightTrackpad","value": "2"} + ,{"name": "k_EControllerSource_Joystick","value": "3"} + ,{"name": "k_EControllerSource_ABXY","value": "4"} + ,{"name": "k_EControllerSource_Switch","value": "5"} + ,{"name": "k_EControllerSource_LeftTrigger","value": "6"} + ,{"name": "k_EControllerSource_RightTrigger","value": "7"} + ,{"name": "k_EControllerSource_Gyro","value": "8"} +]} +, {"enumname": "EControllerSourceMode","values": [ + {"name": "k_EControllerSourceMode_None","value": "0"} + ,{"name": "k_EControllerSourceMode_Dpad","value": "1"} + ,{"name": "k_EControllerSourceMode_Buttons","value": "2"} + ,{"name": "k_EControllerSourceMode_FourButtons","value": "3"} + ,{"name": "k_EControllerSourceMode_AbsoluteMouse","value": "4"} + ,{"name": "k_EControllerSourceMode_RelativeMouse","value": "5"} + ,{"name": "k_EControllerSourceMode_JoystickMove","value": "6"} + ,{"name": "k_EControllerSourceMode_JoystickCamera","value": "7"} + ,{"name": "k_EControllerSourceMode_ScrollWheel","value": "8"} + ,{"name": "k_EControllerSourceMode_Trigger","value": "9"} + ,{"name": "k_EControllerSourceMode_TouchMenu","value": "10"} +]} +, {"enumname": "EControllerActionOrigin","values": [ + {"name": "k_EControllerActionOrigin_None","value": "0"} + ,{"name": "k_EControllerActionOrigin_A","value": "1"} + ,{"name": "k_EControllerActionOrigin_B","value": "2"} + ,{"name": "k_EControllerActionOrigin_X","value": "3"} + ,{"name": "k_EControllerActionOrigin_Y","value": "4"} + ,{"name": "k_EControllerActionOrigin_LeftBumper","value": "5"} + ,{"name": "k_EControllerActionOrigin_RightBumper","value": "6"} + ,{"name": "k_EControllerActionOrigin_LeftGrip","value": "7"} + ,{"name": "k_EControllerActionOrigin_RightGrip","value": "8"} + ,{"name": "k_EControllerActionOrigin_Start","value": "9"} + ,{"name": "k_EControllerActionOrigin_Back","value": "10"} + ,{"name": "k_EControllerActionOrigin_LeftPad_Touch","value": "11"} + ,{"name": "k_EControllerActionOrigin_LeftPad_Swipe","value": "12"} + ,{"name": "k_EControllerActionOrigin_LeftPad_Click","value": "13"} + ,{"name": "k_EControllerActionOrigin_LeftPad_DPadNorth","value": "14"} + ,{"name": "k_EControllerActionOrigin_LeftPad_DPadSouth","value": "15"} + ,{"name": "k_EControllerActionOrigin_LeftPad_DPadWest","value": "16"} + ,{"name": "k_EControllerActionOrigin_LeftPad_DPadEast","value": "17"} + ,{"name": "k_EControllerActionOrigin_RightPad_Touch","value": "18"} + ,{"name": "k_EControllerActionOrigin_RightPad_Swipe","value": "19"} + ,{"name": "k_EControllerActionOrigin_RightPad_Click","value": "20"} + ,{"name": "k_EControllerActionOrigin_RightPad_DPadNorth","value": "21"} + ,{"name": "k_EControllerActionOrigin_RightPad_DPadSouth","value": "22"} + ,{"name": "k_EControllerActionOrigin_RightPad_DPadWest","value": "23"} + ,{"name": "k_EControllerActionOrigin_RightPad_DPadEast","value": "24"} + ,{"name": "k_EControllerActionOrigin_LeftTrigger_Pull","value": "25"} + ,{"name": "k_EControllerActionOrigin_LeftTrigger_Click","value": "26"} + ,{"name": "k_EControllerActionOrigin_RightTrigger_Pull","value": "27"} + ,{"name": "k_EControllerActionOrigin_RightTrigger_Click","value": "28"} + ,{"name": "k_EControllerActionOrigin_LeftStick_Move","value": "29"} + ,{"name": "k_EControllerActionOrigin_LeftStick_Click","value": "30"} + ,{"name": "k_EControllerActionOrigin_LeftStick_DPadNorth","value": "31"} + ,{"name": "k_EControllerActionOrigin_LeftStick_DPadSouth","value": "32"} + ,{"name": "k_EControllerActionOrigin_LeftStick_DPadWest","value": "33"} + ,{"name": "k_EControllerActionOrigin_LeftStick_DPadEast","value": "34"} + ,{"name": "k_EControllerActionOrigin_Gyro_Move","value": "35"} + ,{"name": "k_EControllerActionOrigin_Gyro_Pitch","value": "36"} + ,{"name": "k_EControllerActionOrigin_Gyro_Yaw","value": "37"} + ,{"name": "k_EControllerActionOrigin_Gyro_Roll","value": "38"} + ,{"name": "k_EControllerActionOrigin_Count","value": "39"} +]} +, {"enumname": "EUGCMatchingUGCType","values": [ + {"name": "k_EUGCMatchingUGCType_Items","value": "0"} + ,{"name": "k_EUGCMatchingUGCType_Items_Mtx","value": "1"} + ,{"name": "k_EUGCMatchingUGCType_Items_ReadyToUse","value": "2"} + ,{"name": "k_EUGCMatchingUGCType_Collections","value": "3"} + ,{"name": "k_EUGCMatchingUGCType_Artwork","value": "4"} + ,{"name": "k_EUGCMatchingUGCType_Videos","value": "5"} + ,{"name": "k_EUGCMatchingUGCType_Screenshots","value": "6"} + ,{"name": "k_EUGCMatchingUGCType_AllGuides","value": "7"} + ,{"name": "k_EUGCMatchingUGCType_WebGuides","value": "8"} + ,{"name": "k_EUGCMatchingUGCType_IntegratedGuides","value": "9"} + ,{"name": "k_EUGCMatchingUGCType_UsableInGame","value": "10"} + ,{"name": "k_EUGCMatchingUGCType_ControllerBindings","value": "11"} + ,{"name": "k_EUGCMatchingUGCType_GameManagedItems","value": "12"} + ,{"name": "k_EUGCMatchingUGCType_All","value": "-1"} +]} +, {"enumname": "EUserUGCList","values": [ + {"name": "k_EUserUGCList_Published","value": "0"} + ,{"name": "k_EUserUGCList_VotedOn","value": "1"} + ,{"name": "k_EUserUGCList_VotedUp","value": "2"} + ,{"name": "k_EUserUGCList_VotedDown","value": "3"} + ,{"name": "k_EUserUGCList_WillVoteLater","value": "4"} + ,{"name": "k_EUserUGCList_Favorited","value": "5"} + ,{"name": "k_EUserUGCList_Subscribed","value": "6"} + ,{"name": "k_EUserUGCList_UsedOrPlayed","value": "7"} + ,{"name": "k_EUserUGCList_Followed","value": "8"} +]} +, {"enumname": "EUserUGCListSortOrder","values": [ + {"name": "k_EUserUGCListSortOrder_CreationOrderDesc","value": "0"} + ,{"name": "k_EUserUGCListSortOrder_CreationOrderAsc","value": "1"} + ,{"name": "k_EUserUGCListSortOrder_TitleAsc","value": "2"} + ,{"name": "k_EUserUGCListSortOrder_LastUpdatedDesc","value": "3"} + ,{"name": "k_EUserUGCListSortOrder_SubscriptionDateDesc","value": "4"} + ,{"name": "k_EUserUGCListSortOrder_VoteScoreDesc","value": "5"} + ,{"name": "k_EUserUGCListSortOrder_ForModeration","value": "6"} +]} +, {"enumname": "EUGCQuery","values": [ + {"name": "k_EUGCQuery_RankedByVote","value": "0"} + ,{"name": "k_EUGCQuery_RankedByPublicationDate","value": "1"} + ,{"name": "k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate","value": "2"} + ,{"name": "k_EUGCQuery_RankedByTrend","value": "3"} + ,{"name": "k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate","value": "4"} + ,{"name": "k_EUGCQuery_CreatedByFriendsRankedByPublicationDate","value": "5"} + ,{"name": "k_EUGCQuery_RankedByNumTimesReported","value": "6"} + ,{"name": "k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate","value": "7"} + ,{"name": "k_EUGCQuery_NotYetRated","value": "8"} + ,{"name": "k_EUGCQuery_RankedByTotalVotesAsc","value": "9"} + ,{"name": "k_EUGCQuery_RankedByVotesUp","value": "10"} + ,{"name": "k_EUGCQuery_RankedByTextSearch","value": "11"} + ,{"name": "k_EUGCQuery_RankedByTotalUniqueSubscriptions","value": "12"} +]} +, {"enumname": "EItemUpdateStatus","values": [ + {"name": "k_EItemUpdateStatusInvalid","value": "0"} + ,{"name": "k_EItemUpdateStatusPreparingConfig","value": "1"} + ,{"name": "k_EItemUpdateStatusPreparingContent","value": "2"} + ,{"name": "k_EItemUpdateStatusUploadingContent","value": "3"} + ,{"name": "k_EItemUpdateStatusUploadingPreviewFile","value": "4"} + ,{"name": "k_EItemUpdateStatusCommittingChanges","value": "5"} +]} +, {"enumname": "EItemState","values": [ + {"name": "k_EItemStateNone","value": "0"} + ,{"name": "k_EItemStateSubscribed","value": "1"} + ,{"name": "k_EItemStateLegacyItem","value": "2"} + ,{"name": "k_EItemStateInstalled","value": "4"} + ,{"name": "k_EItemStateNeedsUpdate","value": "8"} + ,{"name": "k_EItemStateDownloading","value": "16"} + ,{"name": "k_EItemStateDownloadPending","value": "32"} +]} +, {"enumname": "EItemStatistic","values": [ + {"name": "k_EItemStatistic_NumSubscriptions","value": "0"} + ,{"name": "k_EItemStatistic_NumFavorites","value": "1"} + ,{"name": "k_EItemStatistic_NumFollowers","value": "2"} + ,{"name": "k_EItemStatistic_NumUniqueSubscriptions","value": "3"} + ,{"name": "k_EItemStatistic_NumUniqueFavorites","value": "4"} + ,{"name": "k_EItemStatistic_NumUniqueFollowers","value": "5"} + ,{"name": "k_EItemStatistic_NumUniqueWebsiteViews","value": "6"} + ,{"name": "k_EItemStatistic_ReportScore","value": "7"} +]} +, {"enumname": "ISteamHTMLSurface::EHTMLMouseButton","values": [ + {"name": "eHTMLMouseButton_Left","value": "0"} + ,{"name": "eHTMLMouseButton_Right","value": "1"} + ,{"name": "eHTMLMouseButton_Middle","value": "2"} +]} +, {"enumname": "ISteamHTMLSurface::EMouseCursor","values": [ + {"name": "dc_user","value": "0"} + ,{"name": "dc_none","value": "1"} + ,{"name": "dc_arrow","value": "2"} + ,{"name": "dc_ibeam","value": "3"} + ,{"name": "dc_hourglass","value": "4"} + ,{"name": "dc_waitarrow","value": "5"} + ,{"name": "dc_crosshair","value": "6"} + ,{"name": "dc_up","value": "7"} + ,{"name": "dc_sizenw","value": "8"} + ,{"name": "dc_sizese","value": "9"} + ,{"name": "dc_sizene","value": "10"} + ,{"name": "dc_sizesw","value": "11"} + ,{"name": "dc_sizew","value": "12"} + ,{"name": "dc_sizee","value": "13"} + ,{"name": "dc_sizen","value": "14"} + ,{"name": "dc_sizes","value": "15"} + ,{"name": "dc_sizewe","value": "16"} + ,{"name": "dc_sizens","value": "17"} + ,{"name": "dc_sizeall","value": "18"} + ,{"name": "dc_no","value": "19"} + ,{"name": "dc_hand","value": "20"} + ,{"name": "dc_blank","value": "21"} + ,{"name": "dc_middle_pan","value": "22"} + ,{"name": "dc_north_pan","value": "23"} + ,{"name": "dc_north_east_pan","value": "24"} + ,{"name": "dc_east_pan","value": "25"} + ,{"name": "dc_south_east_pan","value": "26"} + ,{"name": "dc_south_pan","value": "27"} + ,{"name": "dc_south_west_pan","value": "28"} + ,{"name": "dc_west_pan","value": "29"} + ,{"name": "dc_north_west_pan","value": "30"} + ,{"name": "dc_alias","value": "31"} + ,{"name": "dc_cell","value": "32"} + ,{"name": "dc_colresize","value": "33"} + ,{"name": "dc_copycur","value": "34"} + ,{"name": "dc_verticaltext","value": "35"} + ,{"name": "dc_rowresize","value": "36"} + ,{"name": "dc_zoomin","value": "37"} + ,{"name": "dc_zoomout","value": "38"} + ,{"name": "dc_help","value": "39"} + ,{"name": "dc_custom","value": "40"} + ,{"name": "dc_last","value": "41"} +]} +, {"enumname": "ISteamHTMLSurface::EHTMLKeyModifiers","values": [ + {"name": "k_eHTMLKeyModifier_None","value": "0"} + ,{"name": "k_eHTMLKeyModifier_AltDown","value": "1"} + ,{"name": "k_eHTMLKeyModifier_CtrlDown","value": "2"} + ,{"name": "k_eHTMLKeyModifier_ShiftDown","value": "4"} +]} +, {"enumname": "ESteamItemFlags","values": [ + {"name": "k_ESteamItemNoTrade","value": "1"} + ,{"name": "k_ESteamItemRemoved","value": "256"} + ,{"name": "k_ESteamItemConsumed","value": "512"} +]} +], +"consts":[{ + "constname": "k_iSteamUserCallbacks","consttype": "int", "constval": "100"} +,{ + "constname": "k_iSteamGameServerCallbacks","consttype": "int", "constval": "200"} +,{ + "constname": "k_iSteamFriendsCallbacks","consttype": "int", "constval": "300"} +,{ + "constname": "k_iSteamBillingCallbacks","consttype": "int", "constval": "400"} +,{ + "constname": "k_iSteamMatchmakingCallbacks","consttype": "int", "constval": "500"} +,{ + "constname": "k_iSteamContentServerCallbacks","consttype": "int", "constval": "600"} +,{ + "constname": "k_iSteamUtilsCallbacks","consttype": "int", "constval": "700"} +,{ + "constname": "k_iClientFriendsCallbacks","consttype": "int", "constval": "800"} +,{ + "constname": "k_iClientUserCallbacks","consttype": "int", "constval": "900"} +,{ + "constname": "k_iSteamAppsCallbacks","consttype": "int", "constval": "1000"} +,{ + "constname": "k_iSteamUserStatsCallbacks","consttype": "int", "constval": "1100"} +,{ + "constname": "k_iSteamNetworkingCallbacks","consttype": "int", "constval": "1200"} +,{ + "constname": "k_iClientRemoteStorageCallbacks","consttype": "int", "constval": "1300"} +,{ + "constname": "k_iClientDepotBuilderCallbacks","consttype": "int", "constval": "1400"} +,{ + "constname": "k_iSteamGameServerItemsCallbacks","consttype": "int", "constval": "1500"} +,{ + "constname": "k_iClientUtilsCallbacks","consttype": "int", "constval": "1600"} +,{ + "constname": "k_iSteamGameCoordinatorCallbacks","consttype": "int", "constval": "1700"} +,{ + "constname": "k_iSteamGameServerStatsCallbacks","consttype": "int", "constval": "1800"} +,{ + "constname": "k_iSteam2AsyncCallbacks","consttype": "int", "constval": "1900"} +,{ + "constname": "k_iSteamGameStatsCallbacks","consttype": "int", "constval": "2000"} +,{ + "constname": "k_iClientHTTPCallbacks","consttype": "int", "constval": "2100"} +,{ + "constname": "k_iClientScreenshotsCallbacks","consttype": "int", "constval": "2200"} +,{ + "constname": "k_iSteamScreenshotsCallbacks","consttype": "int", "constval": "2300"} +,{ + "constname": "k_iClientAudioCallbacks","consttype": "int", "constval": "2400"} +,{ + "constname": "k_iClientUnifiedMessagesCallbacks","consttype": "int", "constval": "2500"} +,{ + "constname": "k_iSteamStreamLauncherCallbacks","consttype": "int", "constval": "2600"} +,{ + "constname": "k_iClientControllerCallbacks","consttype": "int", "constval": "2700"} +,{ + "constname": "k_iSteamControllerCallbacks","consttype": "int", "constval": "2800"} +,{ + "constname": "k_iClientParentalSettingsCallbacks","consttype": "int", "constval": "2900"} +,{ + "constname": "k_iClientDeviceAuthCallbacks","consttype": "int", "constval": "3000"} +,{ + "constname": "k_iClientNetworkDeviceManagerCallbacks","consttype": "int", "constval": "3100"} +,{ + "constname": "k_iClientMusicCallbacks","consttype": "int", "constval": "3200"} +,{ + "constname": "k_iClientRemoteClientManagerCallbacks","consttype": "int", "constval": "3300"} +,{ + "constname": "k_iClientUGCCallbacks","consttype": "int", "constval": "3400"} +,{ + "constname": "k_iSteamStreamClientCallbacks","consttype": "int", "constval": "3500"} +,{ + "constname": "k_IClientProductBuilderCallbacks","consttype": "int", "constval": "3600"} +,{ + "constname": "k_iClientShortcutsCallbacks","consttype": "int", "constval": "3700"} +,{ + "constname": "k_iClientRemoteControlManagerCallbacks","consttype": "int", "constval": "3800"} +,{ + "constname": "k_iSteamAppListCallbacks","consttype": "int", "constval": "3900"} +,{ + "constname": "k_iSteamMusicCallbacks","consttype": "int", "constval": "4000"} +,{ + "constname": "k_iSteamMusicRemoteCallbacks","consttype": "int", "constval": "4100"} +,{ + "constname": "k_iClientVRCallbacks","consttype": "int", "constval": "4200"} +,{ + "constname": "k_iClientReservedCallbacks","consttype": "int", "constval": "4300"} +,{ + "constname": "k_iSteamReservedCallbacks","consttype": "int", "constval": "4400"} +,{ + "constname": "k_iSteamHTMLSurfaceCallbacks","consttype": "int", "constval": "4500"} +,{ + "constname": "k_iClientVideoCallbacks","consttype": "int", "constval": "4600"} +,{ + "constname": "k_iClientInventoryCallbacks","consttype": "int", "constval": "4700"} +,{ + "constname": "k_cchPersonaNameMax","consttype": "int", "constval": "128"} +,{ + "constname": "k_cwchPersonaNameMax","consttype": "int", "constval": "32"} +,{ + "constname": "k_cchMaxRichPresenceKeys","consttype": "int", "constval": "20"} +,{ + "constname": "k_cchMaxRichPresenceKeyLength","consttype": "int", "constval": "64"} +,{ + "constname": "k_cchMaxRichPresenceValueLength","consttype": "int", "constval": "256"} +,{ + "constname": "k_cchStatNameMax","consttype": "int", "constval": "128"} +,{ + "constname": "k_cchLeaderboardNameMax","consttype": "int", "constval": "128"} +,{ + "constname": "k_cLeaderboardDetailsMax","consttype": "int", "constval": "64"} +,{ + "constname": "k_InvalidUnifiedMessageHandle","consttype": "const ClientUnifiedMessageHandle", "constval": "0"} +,{ + "constname": "k_SteamItemInstanceIDInvalid","consttype": "const SteamItemInstanceID_t", "constval": "18446744073709551615"} +,{ + "constname": "k_SteamInventoryResultInvalid","consttype": "const SteamInventoryResult_t", "constval": "-1"} +], +"structs":[{"struct": "CSteamID","fields": [ +{ "fieldname": "m_steamid", "fieldtype": "union SteamID_t"}]} +,{"struct": "CSteamID::SteamID_t","fields": [ +{ "fieldname": "m_comp", "fieldtype": "struct SteamIDComponent_t"}, +{ "fieldname": "m_unAll64Bits", "fieldtype": "uint64"}]} +,{"struct": "CSteamID::SteamID_t::SteamIDComponent_t","fields": [ +{ "fieldname": "m_unAccountID", "fieldtype": "uint32"}, +{ "fieldname": "m_unAccountInstance", "fieldtype": "unsigned int"}, +{ "fieldname": "m_EAccountType", "fieldtype": "unsigned int"}, +{ "fieldname": "m_EUniverse", "fieldtype": "enum EUniverse"}]} +,{"struct": "CGameID::GameID_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "unsigned int"}, +{ "fieldname": "m_nType", "fieldtype": "unsigned int"}, +{ "fieldname": "m_nModID", "fieldtype": "unsigned int"}]} +,{"struct": "CGameID::(anonymous)","fields": [ +{ "fieldname": "m_ulGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_gameID", "fieldtype": "struct CGameID::GameID_t"}]} +,{"struct": "ValvePackingSentinel_t","fields": [ +{ "fieldname": "m_u32", "fieldtype": "uint32"}, +{ "fieldname": "m_u64", "fieldtype": "uint64"}, +{ "fieldname": "m_u16", "fieldtype": "uint16"}, +{ "fieldname": "m_d", "fieldtype": "double"}]} +,{"struct": "CallbackMsg_t","fields": [ +{ "fieldname": "m_hSteamUser", "fieldtype": "HSteamUser"}, +{ "fieldname": "m_iCallback", "fieldtype": "int"}, +{ "fieldname": "m_pubParam", "fieldtype": "uint8 *"}, +{ "fieldname": "m_cubParam", "fieldtype": "int"}]} +,{"struct": "SteamServerConnectFailure_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_bStillRetrying", "fieldtype": "_Bool"}]} +,{"struct": "SteamServersDisconnected_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "ClientGameServerDeny_t","fields": [ +{ "fieldname": "m_uAppID", "fieldtype": "uint32"}, +{ "fieldname": "m_unGameServerIP", "fieldtype": "uint32"}, +{ "fieldname": "m_usGameServerPort", "fieldtype": "uint16"}, +{ "fieldname": "m_bSecure", "fieldtype": "uint16"}, +{ "fieldname": "m_uReason", "fieldtype": "uint32"}]} +,{"struct": "ValidateAuthTicketResponse_t","fields": [ +{ "fieldname": "m_SteamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_eAuthSessionResponse", "fieldtype": "enum EAuthSessionResponse"}, +{ "fieldname": "m_OwnerSteamID", "fieldtype": "class CSteamID"}]} +,{"struct": "MicroTxnAuthorizationResponse_t","fields": [ +{ "fieldname": "m_unAppID", "fieldtype": "uint32"}, +{ "fieldname": "m_ulOrderID", "fieldtype": "uint64"}, +{ "fieldname": "m_bAuthorized", "fieldtype": "uint8"}]} +,{"struct": "EncryptedAppTicketResponse_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "GetAuthSessionTicketResponse_t","fields": [ +{ "fieldname": "m_hAuthTicket", "fieldtype": "HAuthTicket"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "GameWebCallback_t","fields": [ +{ "fieldname": "m_szURL", "fieldtype": "char [256]"}]} +,{"struct": "StoreAuthURLResponse_t","fields": [ +{ "fieldname": "m_szURL", "fieldtype": "char [512]"}]} +,{"struct": "FriendGameInfo_t","fields": [ +{ "fieldname": "m_gameID", "fieldtype": "class CGameID"}, +{ "fieldname": "m_unGameIP", "fieldtype": "uint32"}, +{ "fieldname": "m_usGamePort", "fieldtype": "uint16"}, +{ "fieldname": "m_usQueryPort", "fieldtype": "uint16"}, +{ "fieldname": "m_steamIDLobby", "fieldtype": "class CSteamID"}]} +,{"struct": "FriendSessionStateInfo_t","fields": [ +{ "fieldname": "m_uiOnlineSessionInstances", "fieldtype": "uint32"}, +{ "fieldname": "m_uiPublishedToFriendsSessionInstance", "fieldtype": "uint8"}]} +,{"struct": "PersonaStateChange_t","fields": [ +{ "fieldname": "m_ulSteamID", "fieldtype": "uint64"}, +{ "fieldname": "m_nChangeFlags", "fieldtype": "int"}]} +,{"struct": "GameOverlayActivated_t","fields": [ +{ "fieldname": "m_bActive", "fieldtype": "uint8"}]} +,{"struct": "GameServerChangeRequested_t","fields": [ +{ "fieldname": "m_rgchServer", "fieldtype": "char [64]"}, +{ "fieldname": "m_rgchPassword", "fieldtype": "char [64]"}]} +,{"struct": "GameLobbyJoinRequested_t","fields": [ +{ "fieldname": "m_steamIDLobby", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_steamIDFriend", "fieldtype": "class CSteamID"}]} +,{"struct": "AvatarImageLoaded_t","fields": [ +{ "fieldname": "m_steamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_iImage", "fieldtype": "int"}, +{ "fieldname": "m_iWide", "fieldtype": "int"}, +{ "fieldname": "m_iTall", "fieldtype": "int"}]} +,{"struct": "ClanOfficerListResponse_t","fields": [ +{ "fieldname": "m_steamIDClan", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_cOfficers", "fieldtype": "int"}, +{ "fieldname": "m_bSuccess", "fieldtype": "uint8"}]} +,{"struct": "FriendRichPresenceUpdate_t","fields": [ +{ "fieldname": "m_steamIDFriend", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "GameRichPresenceJoinRequested_t","fields": [ +{ "fieldname": "m_steamIDFriend", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_rgchConnect", "fieldtype": "char [256]"}]} +,{"struct": "GameConnectedClanChatMsg_t","fields": [ +{ "fieldname": "m_steamIDClanChat", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_iMessageID", "fieldtype": "int"}]} +,{"struct": "GameConnectedChatJoin_t","fields": [ +{ "fieldname": "m_steamIDClanChat", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}]} +,{"struct": "GameConnectedChatLeave_t","fields": [ +{ "fieldname": "m_steamIDClanChat", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_bKicked", "fieldtype": "_Bool"}, +{ "fieldname": "m_bDropped", "fieldtype": "_Bool"}]} +,{"struct": "DownloadClanActivityCountsResult_t","fields": [ +{ "fieldname": "m_bSuccess", "fieldtype": "_Bool"}]} +,{"struct": "JoinClanChatRoomCompletionResult_t","fields": [ +{ "fieldname": "m_steamIDClanChat", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_eChatRoomEnterResponse", "fieldtype": "enum EChatRoomEnterResponse"}]} +,{"struct": "GameConnectedFriendChatMsg_t","fields": [ +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_iMessageID", "fieldtype": "int"}]} +,{"struct": "FriendsGetFollowerCount_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_steamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_nCount", "fieldtype": "int"}]} +,{"struct": "FriendsIsFollowing_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_steamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_bIsFollowing", "fieldtype": "_Bool"}]} +,{"struct": "FriendsEnumerateFollowingList_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_rgSteamID", "fieldtype": "class CSteamID [50]"}, +{ "fieldname": "m_nResultsReturned", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalResultCount", "fieldtype": "int32"}]} +,{"struct": "SetPersonaNameResponse_t","fields": [ +{ "fieldname": "m_bSuccess", "fieldtype": "_Bool"}, +{ "fieldname": "m_bLocalSuccess", "fieldtype": "_Bool"}, +{ "fieldname": "m_result", "fieldtype": "enum EResult"}]} +,{"struct": "LowBatteryPower_t","fields": [ +{ "fieldname": "m_nMinutesBatteryLeft", "fieldtype": "uint8"}]} +,{"struct": "SteamAPICallCompleted_t","fields": [ +{ "fieldname": "m_hAsyncCall", "fieldtype": "SteamAPICall_t"}]} +,{"struct": "CheckFileSignature_t","fields": [ +{ "fieldname": "m_eCheckFileSignature", "fieldtype": "enum ECheckFileSignature"}]} +,{"struct": "GamepadTextInputDismissed_t","fields": [ +{ "fieldname": "m_bSubmitted", "fieldtype": "_Bool"}, +{ "fieldname": "m_unSubmittedText", "fieldtype": "uint32"}]} +,{"struct": "MatchMakingKeyValuePair_t","fields": [ +{ "fieldname": "m_szKey", "fieldtype": "char [256]"}, +{ "fieldname": "m_szValue", "fieldtype": "char [256]"}]} +,{"struct": "servernetadr_t","fields": [ +{ "fieldname": "m_usConnectionPort", "fieldtype": "uint16"}, +{ "fieldname": "m_usQueryPort", "fieldtype": "uint16"}, +{ "fieldname": "m_unIP", "fieldtype": "uint32"}]} +,{"struct": "gameserveritem_t","fields": [ +{ "fieldname": "m_NetAdr", "fieldtype": "class servernetadr_t"}, +{ "fieldname": "m_nPing", "fieldtype": "int"}, +{ "fieldname": "m_bHadSuccessfulResponse", "fieldtype": "_Bool"}, +{ "fieldname": "m_bDoNotRefresh", "fieldtype": "_Bool"}, +{ "fieldname": "m_szGameDir", "fieldtype": "char [32]"}, +{ "fieldname": "m_szMap", "fieldtype": "char [32]"}, +{ "fieldname": "m_szGameDescription", "fieldtype": "char [64]"}, +{ "fieldname": "m_nAppID", "fieldtype": "uint32"}, +{ "fieldname": "m_nPlayers", "fieldtype": "int"}, +{ "fieldname": "m_nMaxPlayers", "fieldtype": "int"}, +{ "fieldname": "m_nBotPlayers", "fieldtype": "int"}, +{ "fieldname": "m_bPassword", "fieldtype": "_Bool"}, +{ "fieldname": "m_bSecure", "fieldtype": "_Bool"}, +{ "fieldname": "m_ulTimeLastPlayed", "fieldtype": "uint32"}, +{ "fieldname": "m_nServerVersion", "fieldtype": "int"}, +{ "fieldname": "m_szServerName", "fieldtype": "char [64]"}, +{ "fieldname": "m_szGameTags", "fieldtype": "char [128]"}, +{ "fieldname": "m_steamID", "fieldtype": "class CSteamID"}]} +,{"struct": "FavoritesListChanged_t","fields": [ +{ "fieldname": "m_nIP", "fieldtype": "uint32"}, +{ "fieldname": "m_nQueryPort", "fieldtype": "uint32"}, +{ "fieldname": "m_nConnPort", "fieldtype": "uint32"}, +{ "fieldname": "m_nAppID", "fieldtype": "uint32"}, +{ "fieldname": "m_nFlags", "fieldtype": "uint32"}, +{ "fieldname": "m_bAdd", "fieldtype": "_Bool"}, +{ "fieldname": "m_unAccountId", "fieldtype": "AccountID_t"}]} +,{"struct": "LobbyInvite_t","fields": [ +{ "fieldname": "m_ulSteamIDUser", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_ulGameID", "fieldtype": "uint64"}]} +,{"struct": "LobbyEnter_t","fields": [ +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_rgfChatPermissions", "fieldtype": "uint32"}, +{ "fieldname": "m_bLocked", "fieldtype": "_Bool"}, +{ "fieldname": "m_EChatRoomEnterResponse", "fieldtype": "uint32"}]} +,{"struct": "LobbyDataUpdate_t","fields": [ +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDMember", "fieldtype": "uint64"}, +{ "fieldname": "m_bSuccess", "fieldtype": "uint8"}]} +,{"struct": "LobbyChatUpdate_t","fields": [ +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDUserChanged", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDMakingChange", "fieldtype": "uint64"}, +{ "fieldname": "m_rgfChatMemberStateChange", "fieldtype": "uint32"}]} +,{"struct": "LobbyChatMsg_t","fields": [ +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDUser", "fieldtype": "uint64"}, +{ "fieldname": "m_eChatEntryType", "fieldtype": "uint8"}, +{ "fieldname": "m_iChatID", "fieldtype": "uint32"}]} +,{"struct": "LobbyGameCreated_t","fields": [ +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDGameServer", "fieldtype": "uint64"}, +{ "fieldname": "m_unIP", "fieldtype": "uint32"}, +{ "fieldname": "m_usPort", "fieldtype": "uint16"}]} +,{"struct": "LobbyMatchList_t","fields": [ +{ "fieldname": "m_nLobbiesMatching", "fieldtype": "uint32"}]} +,{"struct": "LobbyKicked_t","fields": [ +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}, +{ "fieldname": "m_ulSteamIDAdmin", "fieldtype": "uint64"}, +{ "fieldname": "m_bKickedDueToDisconnect", "fieldtype": "uint8"}]} +,{"struct": "LobbyCreated_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ulSteamIDLobby", "fieldtype": "uint64"}]} +,{"struct": "PSNGameBootInviteResult_t","fields": [ +{ "fieldname": "m_bGameBootInviteExists", "fieldtype": "_Bool"}, +{ "fieldname": "m_steamIDLobby", "fieldtype": "class CSteamID"}]} +,{"struct": "FavoritesListAccountsUpdated_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "SteamParamStringArray_t","fields": [ +{ "fieldname": "m_ppStrings", "fieldtype": "const char **"}, +{ "fieldname": "m_nNumStrings", "fieldtype": "int32"}]} +,{"struct": "RemoteStorageAppSyncedClient_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unNumDownloads", "fieldtype": "int"}]} +,{"struct": "RemoteStorageAppSyncedServer_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unNumUploads", "fieldtype": "int"}]} +,{"struct": "RemoteStorageAppSyncProgress_t","fields": [ +{ "fieldname": "m_rgchCurrentFile", "fieldtype": "char [260]"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_uBytesTransferredThisChunk", "fieldtype": "uint32"}, +{ "fieldname": "m_dAppPercentComplete", "fieldtype": "double"}, +{ "fieldname": "m_bUploading", "fieldtype": "_Bool"}]} +,{"struct": "RemoteStorageAppSyncStatusCheck_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "RemoteStorageConflictResolution_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "RemoteStorageFileShareResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_hFile", "fieldtype": "UGCHandle_t"}, +{ "fieldname": "m_rgchFilename", "fieldtype": "char [260]"}]} +,{"struct": "RemoteStoragePublishFileResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype": "_Bool"}]} +,{"struct": "RemoteStorageDeletePublishedFileResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}]} +,{"struct": "RemoteStorageEnumerateUserPublishedFilesResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nResultsReturned", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalResultCount", "fieldtype": "int32"}, +{ "fieldname": "m_rgPublishedFileId", "fieldtype": "PublishedFileId_t [50]"}]} +,{"struct": "RemoteStorageSubscribePublishedFileResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}]} +,{"struct": "RemoteStorageEnumerateUserSubscribedFilesResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nResultsReturned", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalResultCount", "fieldtype": "int32"}, +{ "fieldname": "m_rgPublishedFileId", "fieldtype": "PublishedFileId_t [50]"}, +{ "fieldname": "m_rgRTimeSubscribed", "fieldtype": "uint32 [50]"}]} +,{"struct": "RemoteStorageUnsubscribePublishedFileResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}]} +,{"struct": "RemoteStorageUpdatePublishedFileResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype": "_Bool"}]} +,{"struct": "RemoteStorageDownloadUGCResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_hFile", "fieldtype": "UGCHandle_t"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_nSizeInBytes", "fieldtype": "int32"}, +{ "fieldname": "m_pchFileName", "fieldtype": "char [260]"}, +{ "fieldname": "m_ulSteamIDOwner", "fieldtype": "uint64"}]} +,{"struct": "RemoteStorageGetPublishedFileDetailsResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_nCreatorAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_nConsumerAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_rgchTitle", "fieldtype": "char [129]"}, +{ "fieldname": "m_rgchDescription", "fieldtype": "char [8000]"}, +{ "fieldname": "m_hFile", "fieldtype": "UGCHandle_t"}, +{ "fieldname": "m_hPreviewFile", "fieldtype": "UGCHandle_t"}, +{ "fieldname": "m_ulSteamIDOwner", "fieldtype": "uint64"}, +{ "fieldname": "m_rtimeCreated", "fieldtype": "uint32"}, +{ "fieldname": "m_rtimeUpdated", "fieldtype": "uint32"}, +{ "fieldname": "m_eVisibility", "fieldtype": "enum ERemoteStoragePublishedFileVisibility"}, +{ "fieldname": "m_bBanned", "fieldtype": "_Bool"}, +{ "fieldname": "m_rgchTags", "fieldtype": "char [1025]"}, +{ "fieldname": "m_bTagsTruncated", "fieldtype": "_Bool"}, +{ "fieldname": "m_pchFileName", "fieldtype": "char [260]"}, +{ "fieldname": "m_nFileSize", "fieldtype": "int32"}, +{ "fieldname": "m_nPreviewFileSize", "fieldtype": "int32"}, +{ "fieldname": "m_rgchURL", "fieldtype": "char [256]"}, +{ "fieldname": "m_eFileType", "fieldtype": "enum EWorkshopFileType"}, +{ "fieldname": "m_bAcceptedForUse", "fieldtype": "_Bool"}]} +,{"struct": "RemoteStorageEnumerateWorkshopFilesResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nResultsReturned", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalResultCount", "fieldtype": "int32"}, +{ "fieldname": "m_rgPublishedFileId", "fieldtype": "PublishedFileId_t [50]"}, +{ "fieldname": "m_rgScore", "fieldtype": "float [50]"}, +{ "fieldname": "m_nAppId", "fieldtype": "AppId_t"}, +{ "fieldname": "m_unStartIndex", "fieldtype": "uint32"}]} +,{"struct": "RemoteStorageGetPublishedItemVoteDetailsResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_nVotesFor", "fieldtype": "int32"}, +{ "fieldname": "m_nVotesAgainst", "fieldtype": "int32"}, +{ "fieldname": "m_nReports", "fieldtype": "int32"}, +{ "fieldname": "m_fScore", "fieldtype": "float"}]} +,{"struct": "RemoteStoragePublishedFileSubscribed_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "RemoteStoragePublishedFileUnsubscribed_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "RemoteStoragePublishedFileDeleted_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "RemoteStorageUpdateUserPublishedItemVoteResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}]} +,{"struct": "RemoteStorageUserVoteDetails_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eVote", "fieldtype": "enum EWorkshopVote"}]} +,{"struct": "RemoteStorageEnumerateUserSharedWorkshopFilesResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nResultsReturned", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalResultCount", "fieldtype": "int32"}, +{ "fieldname": "m_rgPublishedFileId", "fieldtype": "PublishedFileId_t [50]"}]} +,{"struct": "RemoteStorageSetUserPublishedFileActionResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eAction", "fieldtype": "enum EWorkshopFileAction"}]} +,{"struct": "RemoteStorageEnumeratePublishedFilesByUserActionResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_eAction", "fieldtype": "enum EWorkshopFileAction"}, +{ "fieldname": "m_nResultsReturned", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalResultCount", "fieldtype": "int32"}, +{ "fieldname": "m_rgPublishedFileId", "fieldtype": "PublishedFileId_t [50]"}, +{ "fieldname": "m_rgRTimeUpdated", "fieldtype": "uint32 [50]"}]} +,{"struct": "RemoteStoragePublishFileProgress_t","fields": [ +{ "fieldname": "m_dPercentFile", "fieldtype": "double"}, +{ "fieldname": "m_bPreview", "fieldtype": "_Bool"}]} +,{"struct": "RemoteStoragePublishedFileUpdated_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_hFile", "fieldtype": "UGCHandle_t"}]} +,{"struct": "RemoteStorageFileWriteAsyncComplete_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "RemoteStorageFileReadAsyncComplete_t","fields": [ +{ "fieldname": "m_hFileReadAsync", "fieldtype": "SteamAPICall_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nOffset", "fieldtype": "uint32"}, +{ "fieldname": "m_cubRead", "fieldtype": "uint32"}]} +,{"struct": "LeaderboardEntry_t","fields": [ +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_nGlobalRank", "fieldtype": "int32"}, +{ "fieldname": "m_nScore", "fieldtype": "int32"}, +{ "fieldname": "m_cDetails", "fieldtype": "int32"}, +{ "fieldname": "m_hUGC", "fieldtype": "UGCHandle_t"}]} +,{"struct": "UserStatsReceived_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}]} +,{"struct": "UserStatsStored_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "UserAchievementStored_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_bGroupAchievement", "fieldtype": "_Bool"}, +{ "fieldname": "m_rgchAchievementName", "fieldtype": "char [128]"}, +{ "fieldname": "m_nCurProgress", "fieldtype": "uint32"}, +{ "fieldname": "m_nMaxProgress", "fieldtype": "uint32"}]} +,{"struct": "LeaderboardFindResult_t","fields": [ +{ "fieldname": "m_hSteamLeaderboard", "fieldtype": "SteamLeaderboard_t"}, +{ "fieldname": "m_bLeaderboardFound", "fieldtype": "uint8"}]} +,{"struct": "LeaderboardScoresDownloaded_t","fields": [ +{ "fieldname": "m_hSteamLeaderboard", "fieldtype": "SteamLeaderboard_t"}, +{ "fieldname": "m_hSteamLeaderboardEntries", "fieldtype": "SteamLeaderboardEntries_t"}, +{ "fieldname": "m_cEntryCount", "fieldtype": "int"}]} +,{"struct": "LeaderboardScoreUploaded_t","fields": [ +{ "fieldname": "m_bSuccess", "fieldtype": "uint8"}, +{ "fieldname": "m_hSteamLeaderboard", "fieldtype": "SteamLeaderboard_t"}, +{ "fieldname": "m_nScore", "fieldtype": "int32"}, +{ "fieldname": "m_bScoreChanged", "fieldtype": "uint8"}, +{ "fieldname": "m_nGlobalRankNew", "fieldtype": "int"}, +{ "fieldname": "m_nGlobalRankPrevious", "fieldtype": "int"}]} +,{"struct": "NumberOfCurrentPlayers_t","fields": [ +{ "fieldname": "m_bSuccess", "fieldtype": "uint8"}, +{ "fieldname": "m_cPlayers", "fieldtype": "int32"}]} +,{"struct": "UserStatsUnloaded_t","fields": [ +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}]} +,{"struct": "UserAchievementIconFetched_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "class CGameID"}, +{ "fieldname": "m_rgchAchievementName", "fieldtype": "char [128]"}, +{ "fieldname": "m_bAchieved", "fieldtype": "_Bool"}, +{ "fieldname": "m_nIconHandle", "fieldtype": "int"}]} +,{"struct": "GlobalAchievementPercentagesReady_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "LeaderboardUGCSet_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_hSteamLeaderboard", "fieldtype": "SteamLeaderboard_t"}]} +,{"struct": "PS3TrophiesInstalled_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ulRequiredDiskSpace", "fieldtype": "uint64"}]} +,{"struct": "GlobalStatsReceived_t","fields": [ +{ "fieldname": "m_nGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "DlcInstalled_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "RegisterActivationCodeResponse_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum ERegisterActivationCodeResult"}, +{ "fieldname": "m_unPackageRegistered", "fieldtype": "uint32"}]} +,{"struct": "AppProofOfPurchaseKeyResponse_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nAppID", "fieldtype": "uint32"}, +{ "fieldname": "m_rgchKey", "fieldtype": "char [64]"}]} +,{"struct": "P2PSessionState_t","fields": [ +{ "fieldname": "m_bConnectionActive", "fieldtype": "uint8"}, +{ "fieldname": "m_bConnecting", "fieldtype": "uint8"}, +{ "fieldname": "m_eP2PSessionError", "fieldtype": "uint8"}, +{ "fieldname": "m_bUsingRelay", "fieldtype": "uint8"}, +{ "fieldname": "m_nBytesQueuedForSend", "fieldtype": "int32"}, +{ "fieldname": "m_nPacketsQueuedForSend", "fieldtype": "int32"}, +{ "fieldname": "m_nRemoteIP", "fieldtype": "uint32"}, +{ "fieldname": "m_nRemotePort", "fieldtype": "uint16"}]} +,{"struct": "P2PSessionRequest_t","fields": [ +{ "fieldname": "m_steamIDRemote", "fieldtype": "class CSteamID"}]} +,{"struct": "P2PSessionConnectFail_t","fields": [ +{ "fieldname": "m_steamIDRemote", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_eP2PSessionError", "fieldtype": "uint8"}]} +,{"struct": "SocketStatusCallback_t","fields": [ +{ "fieldname": "m_hSocket", "fieldtype": "SNetSocket_t"}, +{ "fieldname": "m_hListenSocket", "fieldtype": "SNetListenSocket_t"}, +{ "fieldname": "m_steamIDRemote", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_eSNetSocketState", "fieldtype": "int"}]} +,{"struct": "ScreenshotReady_t","fields": [ +{ "fieldname": "m_hLocal", "fieldtype": "ScreenshotHandle"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "VolumeHasChanged_t","fields": [ +{ "fieldname": "m_flNewVolume", "fieldtype": "float"}]} +,{"struct": "MusicPlayerWantsShuffled_t","fields": [ +{ "fieldname": "m_bShuffled", "fieldtype": "_Bool"}]} +,{"struct": "MusicPlayerWantsLooped_t","fields": [ +{ "fieldname": "m_bLooped", "fieldtype": "_Bool"}]} +,{"struct": "MusicPlayerWantsVolume_t","fields": [ +{ "fieldname": "m_flNewVolume", "fieldtype": "float"}]} +,{"struct": "MusicPlayerSelectsQueueEntry_t","fields": [ +{ "fieldname": "nID", "fieldtype": "int"}]} +,{"struct": "MusicPlayerSelectsPlaylistEntry_t","fields": [ +{ "fieldname": "nID", "fieldtype": "int"}]} +,{"struct": "MusicPlayerWantsPlayingRepeatStatus_t","fields": [ +{ "fieldname": "m_nPlayingRepeatStatus", "fieldtype": "int"}]} +,{"struct": "HTTPRequestCompleted_t","fields": [ +{ "fieldname": "m_hRequest", "fieldtype": "HTTPRequestHandle"}, +{ "fieldname": "m_ulContextValue", "fieldtype": "uint64"}, +{ "fieldname": "m_bRequestSuccessful", "fieldtype": "_Bool"}, +{ "fieldname": "m_eStatusCode", "fieldtype": "enum EHTTPStatusCode"}, +{ "fieldname": "m_unBodySize", "fieldtype": "uint32"}]} +,{"struct": "HTTPRequestHeadersReceived_t","fields": [ +{ "fieldname": "m_hRequest", "fieldtype": "HTTPRequestHandle"}, +{ "fieldname": "m_ulContextValue", "fieldtype": "uint64"}]} +,{"struct": "HTTPRequestDataReceived_t","fields": [ +{ "fieldname": "m_hRequest", "fieldtype": "HTTPRequestHandle"}, +{ "fieldname": "m_ulContextValue", "fieldtype": "uint64"}, +{ "fieldname": "m_cOffset", "fieldtype": "uint32"}, +{ "fieldname": "m_cBytesReceived", "fieldtype": "uint32"}]} +,{"struct": "SteamUnifiedMessagesSendMethodResult_t","fields": [ +{ "fieldname": "m_hHandle", "fieldtype": "ClientUnifiedMessageHandle"}, +{ "fieldname": "m_unContext", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unResponseSize", "fieldtype": "uint32"}]} +,{"struct": "ControllerAnalogActionData_t","fields": [ +{ "fieldname": "eMode", "fieldtype": "enum EControllerSourceMode"}, +{ "fieldname": "x", "fieldtype": "float"}, +{ "fieldname": "y", "fieldtype": "float"}, +{ "fieldname": "bActive", "fieldtype": "_Bool"}]} +,{"struct": "ControllerDigitalActionData_t","fields": [ +{ "fieldname": "bState", "fieldtype": "_Bool"}, +{ "fieldname": "bActive", "fieldtype": "_Bool"}]} +,{"struct": "SteamUGCDetails_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_eFileType", "fieldtype": "enum EWorkshopFileType"}, +{ "fieldname": "m_nCreatorAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_nConsumerAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_rgchTitle", "fieldtype": "char [129]"}, +{ "fieldname": "m_rgchDescription", "fieldtype": "char [8000]"}, +{ "fieldname": "m_ulSteamIDOwner", "fieldtype": "uint64"}, +{ "fieldname": "m_rtimeCreated", "fieldtype": "uint32"}, +{ "fieldname": "m_rtimeUpdated", "fieldtype": "uint32"}, +{ "fieldname": "m_rtimeAddedToUserList", "fieldtype": "uint32"}, +{ "fieldname": "m_eVisibility", "fieldtype": "enum ERemoteStoragePublishedFileVisibility"}, +{ "fieldname": "m_bBanned", "fieldtype": "_Bool"}, +{ "fieldname": "m_bAcceptedForUse", "fieldtype": "_Bool"}, +{ "fieldname": "m_bTagsTruncated", "fieldtype": "_Bool"}, +{ "fieldname": "m_rgchTags", "fieldtype": "char [1025]"}, +{ "fieldname": "m_hFile", "fieldtype": "UGCHandle_t"}, +{ "fieldname": "m_hPreviewFile", "fieldtype": "UGCHandle_t"}, +{ "fieldname": "m_pchFileName", "fieldtype": "char [260]"}, +{ "fieldname": "m_nFileSize", "fieldtype": "int32"}, +{ "fieldname": "m_nPreviewFileSize", "fieldtype": "int32"}, +{ "fieldname": "m_rgchURL", "fieldtype": "char [256]"}, +{ "fieldname": "m_unVotesUp", "fieldtype": "uint32"}, +{ "fieldname": "m_unVotesDown", "fieldtype": "uint32"}, +{ "fieldname": "m_flScore", "fieldtype": "float"}, +{ "fieldname": "m_unNumChildren", "fieldtype": "uint32"}]} +,{"struct": "SteamUGCQueryCompleted_t","fields": [ +{ "fieldname": "m_handle", "fieldtype": "UGCQueryHandle_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unNumResultsReturned", "fieldtype": "uint32"}, +{ "fieldname": "m_unTotalMatchingResults", "fieldtype": "uint32"}, +{ "fieldname": "m_bCachedData", "fieldtype": "_Bool"}]} +,{"struct": "SteamUGCRequestUGCDetailsResult_t","fields": [ +{ "fieldname": "m_details", "fieldtype": "struct SteamUGCDetails_t"}, +{ "fieldname": "m_bCachedData", "fieldtype": "_Bool"}]} +,{"struct": "CreateItemResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype": "_Bool"}]} +,{"struct": "SubmitItemUpdateResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype": "_Bool"}]} +,{"struct": "DownloadItemResult_t","fields": [ +{ "fieldname": "m_unAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "UserFavoriteItemsListChanged_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_bWasAddRequest", "fieldtype": "_Bool"}]} +,{"struct": "SetUserItemVoteResult_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_bVoteUp", "fieldtype": "_Bool"}]} +,{"struct": "GetUserItemVoteResult_t","fields": [ +{ "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_bVotedUp", "fieldtype": "_Bool"}, +{ "fieldname": "m_bVotedDown", "fieldtype": "_Bool"}, +{ "fieldname": "m_bVoteSkipped", "fieldtype": "_Bool"}]} +,{"struct": "SteamAppInstalled_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "SteamAppUninstalled_t","fields": [ +{ "fieldname": "m_nAppID", "fieldtype": "AppId_t"}]} +,{"struct": "HTML_BrowserReady_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}]} +,{"struct": "HTML_NeedsPaint_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pBGRA", "fieldtype": "const char *"}, +{ "fieldname": "unWide", "fieldtype": "uint32"}, +{ "fieldname": "unTall", "fieldtype": "uint32"}, +{ "fieldname": "unUpdateX", "fieldtype": "uint32"}, +{ "fieldname": "unUpdateY", "fieldtype": "uint32"}, +{ "fieldname": "unUpdateWide", "fieldtype": "uint32"}, +{ "fieldname": "unUpdateTall", "fieldtype": "uint32"}, +{ "fieldname": "unScrollX", "fieldtype": "uint32"}, +{ "fieldname": "unScrollY", "fieldtype": "uint32"}, +{ "fieldname": "flPageScale", "fieldtype": "float"}, +{ "fieldname": "unPageSerial", "fieldtype": "uint32"}]} +,{"struct": "HTML_StartRequest_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchURL", "fieldtype": "const char *"}, +{ "fieldname": "pchTarget", "fieldtype": "const char *"}, +{ "fieldname": "pchPostData", "fieldtype": "const char *"}, +{ "fieldname": "bIsRedirect", "fieldtype": "_Bool"}]} +,{"struct": "HTML_CloseBrowser_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}]} +,{"struct": "HTML_URLChanged_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchURL", "fieldtype": "const char *"}, +{ "fieldname": "pchPostData", "fieldtype": "const char *"}, +{ "fieldname": "bIsRedirect", "fieldtype": "_Bool"}, +{ "fieldname": "pchPageTitle", "fieldtype": "const char *"}, +{ "fieldname": "bNewNavigation", "fieldtype": "_Bool"}]} +,{"struct": "HTML_FinishedRequest_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchURL", "fieldtype": "const char *"}, +{ "fieldname": "pchPageTitle", "fieldtype": "const char *"}]} +,{"struct": "HTML_OpenLinkInNewTab_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchURL", "fieldtype": "const char *"}]} +,{"struct": "HTML_ChangedTitle_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchTitle", "fieldtype": "const char *"}]} +,{"struct": "HTML_SearchResults_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "unResults", "fieldtype": "uint32"}, +{ "fieldname": "unCurrentMatch", "fieldtype": "uint32"}]} +,{"struct": "HTML_CanGoBackAndForward_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "bCanGoBack", "fieldtype": "_Bool"}, +{ "fieldname": "bCanGoForward", "fieldtype": "_Bool"}]} +,{"struct": "HTML_HorizontalScroll_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "unScrollMax", "fieldtype": "uint32"}, +{ "fieldname": "unScrollCurrent", "fieldtype": "uint32"}, +{ "fieldname": "flPageScale", "fieldtype": "float"}, +{ "fieldname": "bVisible", "fieldtype": "_Bool"}, +{ "fieldname": "unPageSize", "fieldtype": "uint32"}]} +,{"struct": "HTML_VerticalScroll_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "unScrollMax", "fieldtype": "uint32"}, +{ "fieldname": "unScrollCurrent", "fieldtype": "uint32"}, +{ "fieldname": "flPageScale", "fieldtype": "float"}, +{ "fieldname": "bVisible", "fieldtype": "_Bool"}, +{ "fieldname": "unPageSize", "fieldtype": "uint32"}]} +,{"struct": "HTML_LinkAtPosition_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "x", "fieldtype": "uint32"}, +{ "fieldname": "y", "fieldtype": "uint32"}, +{ "fieldname": "pchURL", "fieldtype": "const char *"}, +{ "fieldname": "bInput", "fieldtype": "_Bool"}, +{ "fieldname": "bLiveLink", "fieldtype": "_Bool"}]} +,{"struct": "HTML_JSAlert_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchMessage", "fieldtype": "const char *"}]} +,{"struct": "HTML_JSConfirm_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchMessage", "fieldtype": "const char *"}]} +,{"struct": "HTML_FileOpenDialog_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchTitle", "fieldtype": "const char *"}, +{ "fieldname": "pchInitialFile", "fieldtype": "const char *"}]} +,{"struct": "HTML_NewWindow_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchURL", "fieldtype": "const char *"}, +{ "fieldname": "unX", "fieldtype": "uint32"}, +{ "fieldname": "unY", "fieldtype": "uint32"}, +{ "fieldname": "unWide", "fieldtype": "uint32"}, +{ "fieldname": "unTall", "fieldtype": "uint32"}, +{ "fieldname": "unNewWindow_BrowserHandle", "fieldtype": "HHTMLBrowser"}]} +,{"struct": "HTML_SetCursor_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "eMouseCursor", "fieldtype": "uint32"}]} +,{"struct": "HTML_StatusText_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchMsg", "fieldtype": "const char *"}]} +,{"struct": "HTML_ShowToolTip_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchMsg", "fieldtype": "const char *"}]} +,{"struct": "HTML_UpdateToolTip_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, +{ "fieldname": "pchMsg", "fieldtype": "const char *"}]} +,{"struct": "HTML_HideToolTip_t","fields": [ +{ "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}]} +,{"struct": "SteamItemDetails_t","fields": [ +{ "fieldname": "m_itemId", "fieldtype": "SteamItemInstanceID_t"}, +{ "fieldname": "m_iDefinition", "fieldtype": "SteamItemDef_t"}, +{ "fieldname": "m_unQuantity", "fieldtype": "uint16"}, +{ "fieldname": "m_unFlags", "fieldtype": "uint16"}]} +,{"struct": "SteamInventoryResultReady_t","fields": [ +{ "fieldname": "m_handle", "fieldtype": "SteamInventoryResult_t"}, +{ "fieldname": "m_result", "fieldtype": "enum EResult"}]} +,{"struct": "SteamInventoryFullUpdate_t","fields": [ +{ "fieldname": "m_handle", "fieldtype": "SteamInventoryResult_t"}]} +,{"struct": "BroadcastUploadStop_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EBroadcastUploadResult"}]} +,{"struct": "GetVideoURLResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unVideoAppID", "fieldtype": "AppId_t"}, +{ "fieldname": "m_rgchURL", "fieldtype": "char [256]"}]} +,{"struct": "CCallbackBase","fields": [ +{ "fieldname": "m_nCallbackFlags", "fieldtype": "uint8"}, +{ "fieldname": "m_iCallback", "fieldtype": "int"}]} +,{"struct": "CCallResult","fields": [ +{ "fieldname": "m_hAPICall", "fieldtype": "SteamAPICall_t"}, +{ "fieldname": "m_pObj", "fieldtype": "T *"}, +{ "fieldname": "m_Func", "fieldtype": "func_t"}]} +,{"struct": "CCallback","fields": [ +{ "fieldname": "m_pObj", "fieldtype": "T *"}, +{ "fieldname": "m_Func", "fieldtype": "func_t"}]} +,{"struct": "CSteamAPIContext","fields": [ +{ "fieldname": "m_pSteamUser", "fieldtype": "class ISteamUser *"}, +{ "fieldname": "m_pSteamFriends", "fieldtype": "class ISteamFriends *"}, +{ "fieldname": "m_pSteamUtils", "fieldtype": "class ISteamUtils *"}, +{ "fieldname": "m_pSteamMatchmaking", "fieldtype": "class ISteamMatchmaking *"}, +{ "fieldname": "m_pSteamUserStats", "fieldtype": "class ISteamUserStats *"}, +{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}, +{ "fieldname": "m_pSteamMatchmakingServers", "fieldtype": "class ISteamMatchmakingServers *"}, +{ "fieldname": "m_pSteamNetworking", "fieldtype": "class ISteamNetworking *"}, +{ "fieldname": "m_pSteamRemoteStorage", "fieldtype": "class ISteamRemoteStorage *"}, +{ "fieldname": "m_pSteamScreenshots", "fieldtype": "class ISteamScreenshots *"}, +{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, +{ "fieldname": "m_pSteamUnifiedMessages", "fieldtype": "class ISteamUnifiedMessages *"}, +{ "fieldname": "m_pController", "fieldtype": "class ISteamController *"}, +{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, +{ "fieldname": "m_pSteamAppList", "fieldtype": "class ISteamAppList *"}, +{ "fieldname": "m_pSteamMusic", "fieldtype": "class ISteamMusic *"}, +{ "fieldname": "m_pSteamMusicRemote", "fieldtype": "class ISteamMusicRemote *"}, +{ "fieldname": "m_pSteamHTMLSurface", "fieldtype": "class ISteamHTMLSurface *"}, +{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, +{ "fieldname": "m_pSteamVideo", "fieldtype": "class ISteamVideo *"}]} +,{"struct": "GSClientApprove_t","fields": [ +{ "fieldname": "m_SteamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_OwnerSteamID", "fieldtype": "class CSteamID"}]} +,{"struct": "GSClientDeny_t","fields": [ +{ "fieldname": "m_SteamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_eDenyReason", "fieldtype": "enum EDenyReason"}, +{ "fieldname": "m_rgchOptionalText", "fieldtype": "char [128]"}]} +,{"struct": "GSClientKick_t","fields": [ +{ "fieldname": "m_SteamID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_eDenyReason", "fieldtype": "enum EDenyReason"}]} +,{"struct": "GSClientAchievementStatus_t","fields": [ +{ "fieldname": "m_SteamID", "fieldtype": "uint64"}, +{ "fieldname": "m_pchAchievement", "fieldtype": "char [128]"}, +{ "fieldname": "m_bUnlocked", "fieldtype": "_Bool"}]} +,{"struct": "GSPolicyResponse_t","fields": [ +{ "fieldname": "m_bSecure", "fieldtype": "uint8"}]} +,{"struct": "GSGameplayStats_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nRank", "fieldtype": "int32"}, +{ "fieldname": "m_unTotalConnects", "fieldtype": "uint32"}, +{ "fieldname": "m_unTotalMinutesPlayed", "fieldtype": "uint32"}]} +,{"struct": "GSClientGroupStatus_t","fields": [ +{ "fieldname": "m_SteamIDUser", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_SteamIDGroup", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_bMember", "fieldtype": "_Bool"}, +{ "fieldname": "m_bOfficer", "fieldtype": "_Bool"}]} +,{"struct": "GSReputation_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_unReputationScore", "fieldtype": "uint32"}, +{ "fieldname": "m_bBanned", "fieldtype": "_Bool"}, +{ "fieldname": "m_unBannedIP", "fieldtype": "uint32"}, +{ "fieldname": "m_usBannedPort", "fieldtype": "uint16"}, +{ "fieldname": "m_ulBannedGameID", "fieldtype": "uint64"}, +{ "fieldname": "m_unBanExpires", "fieldtype": "uint32"}]} +,{"struct": "AssociateWithClanResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "ComputeNewPlayerCompatibilityResult_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_cPlayersThatDontLikeCandidate", "fieldtype": "int"}, +{ "fieldname": "m_cPlayersThatCandidateDoesntLike", "fieldtype": "int"}, +{ "fieldname": "m_cClanPlayersThatDontLikeCandidate", "fieldtype": "int"}, +{ "fieldname": "m_SteamIDCandidate", "fieldtype": "class CSteamID"}]} +,{"struct": "GSStatsReceived_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}]} +,{"struct": "GSStatsStored_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}]} +,{"struct": "GSStatsUnloaded_t","fields": [ +{ "fieldname": "m_steamIDUser", "fieldtype": "class CSteamID"}]} +], +"methods":[{ + "classname": "ISteamClient", + "methodname": "CreateSteamPipe", + "returntype": "HSteamPipe" +} +,{ + "classname": "ISteamClient", + "methodname": "BReleaseSteamPipe", + "returntype": "bool", + "params": [ +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "ConnectToGlobalUser", + "returntype": "HSteamUser", + "params": [ +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "CreateLocalUser", + "returntype": "HSteamUser", + "params": [ +{ "paramname": "phSteamPipe" ,"paramtype": "HSteamPipe *"}, +{ "paramname": "eAccountType" ,"paramtype": "EAccountType"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "ReleaseUser", + "returntype": "void", + "params": [ +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "hUser" ,"paramtype": "HSteamUser"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamUser", + "returntype": "class ISteamUser *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamGameServer", + "returntype": "class ISteamGameServer *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "SetLocalIPBinding", + "returntype": "void", + "params": [ +{ "paramname": "unIP" ,"paramtype": "uint32"}, +{ "paramname": "usPort" ,"paramtype": "uint16"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamFriends", + "returntype": "class ISteamFriends *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamUtils", + "returntype": "class ISteamUtils *", + "params": [ +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamMatchmaking", + "returntype": "class ISteamMatchmaking *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamMatchmakingServers", + "returntype": "class ISteamMatchmakingServers *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamGenericInterface", + "returntype": "void *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamUserStats", + "returntype": "class ISteamUserStats *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamGameServerStats", + "returntype": "class ISteamGameServerStats *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamApps", + "returntype": "class ISteamApps *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamNetworking", + "returntype": "class ISteamNetworking *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamRemoteStorage", + "returntype": "class ISteamRemoteStorage *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamScreenshots", + "returntype": "class ISteamScreenshots *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "RunFrame", + "returntype": "void" +} +,{ + "classname": "ISteamClient", + "methodname": "GetIPCCallCount", + "returntype": "uint32" +} +,{ + "classname": "ISteamClient", + "methodname": "SetWarningMessageHook", + "returntype": "void", + "params": [ +{ "paramname": "pFunction" ,"paramtype": "SteamAPIWarningMessageHook_t"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "BShutdownIfAllPipesClosed", + "returntype": "bool" +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamHTTP", + "returntype": "class ISteamHTTP *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamUnifiedMessages", + "returntype": "class ISteamUnifiedMessages *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamController", + "returntype": "class ISteamController *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamUGC", + "returntype": "class ISteamUGC *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamAppList", + "returntype": "class ISteamAppList *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamMusic", + "returntype": "class ISteamMusic *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamMusicRemote", + "returntype": "class ISteamMusicRemote *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamHTMLSurface", + "returntype": "class ISteamHTMLSurface *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "Set_SteamAPI_CPostAPIResultInProcess", + "returntype": "void", + "params": [ +{ "paramname": "func" ,"paramtype": "SteamAPI_PostAPIResultInProcess_t"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "Remove_SteamAPI_CPostAPIResultInProcess", + "returntype": "void", + "params": [ +{ "paramname": "func" ,"paramtype": "SteamAPI_PostAPIResultInProcess_t"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "Set_SteamAPI_CCheckCallbackRegisteredInProcess", + "returntype": "void", + "params": [ +{ "paramname": "func" ,"paramtype": "SteamAPI_CheckCallbackRegistered_t"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamInventory", + "returntype": "class ISteamInventory *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamVideo", + "returntype": "class ISteamVideo *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetHSteamUser", + "returntype": "HSteamUser" +} +,{ + "classname": "ISteamUser", + "methodname": "BLoggedOn", + "returntype": "bool" +} +,{ + "classname": "ISteamUser", + "methodname": "GetSteamID", + "returntype": "class CSteamID" +} +,{ + "classname": "ISteamUser", + "methodname": "InitiateGameConnection", + "returntype": "int", + "params": [ +{ "paramname": "pAuthBlob" ,"paramtype": "void *"}, +{ "paramname": "cbMaxAuthBlob" ,"paramtype": "int"}, +{ "paramname": "steamIDGameServer" ,"paramtype": "class CSteamID"}, +{ "paramname": "unIPServer" ,"paramtype": "uint32"}, +{ "paramname": "usPortServer" ,"paramtype": "uint16"}, +{ "paramname": "bSecure" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "TerminateGameConnection", + "returntype": "void", + "params": [ +{ "paramname": "unIPServer" ,"paramtype": "uint32"}, +{ "paramname": "usPortServer" ,"paramtype": "uint16"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "TrackAppUsageEvent", + "returntype": "void", + "params": [ +{ "paramname": "gameID" ,"paramtype": "class CGameID"}, +{ "paramname": "eAppUsageEvent" ,"paramtype": "int"}, +{ "paramname": "pchExtraInfo" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetUserDataFolder", + "returntype": "bool", + "params": [ +{ "paramname": "pchBuffer" ,"paramtype": "char *"}, +{ "paramname": "cubBuffer" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "StartVoiceRecording", + "returntype": "void" +} +,{ + "classname": "ISteamUser", + "methodname": "StopVoiceRecording", + "returntype": "void" +} +,{ + "classname": "ISteamUser", + "methodname": "GetAvailableVoice", + "returntype": "EVoiceResult", + "params": [ +{ "paramname": "pcbCompressed" ,"paramtype": "uint32 *"}, +{ "paramname": "pcbUncompressed" ,"paramtype": "uint32 *"}, +{ "paramname": "nUncompressedVoiceDesiredSampleRate" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetVoice", + "returntype": "EVoiceResult", + "params": [ +{ "paramname": "bWantCompressed" ,"paramtype": "bool"}, +{ "paramname": "pDestBuffer" ,"paramtype": "void *"}, +{ "paramname": "cbDestBufferSize" ,"paramtype": "uint32"}, +{ "paramname": "nBytesWritten" ,"paramtype": "uint32 *"}, +{ "paramname": "bWantUncompressed" ,"paramtype": "bool"}, +{ "paramname": "pUncompressedDestBuffer" ,"paramtype": "void *"}, +{ "paramname": "cbUncompressedDestBufferSize" ,"paramtype": "uint32"}, +{ "paramname": "nUncompressBytesWritten" ,"paramtype": "uint32 *"}, +{ "paramname": "nUncompressedVoiceDesiredSampleRate" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "DecompressVoice", + "returntype": "EVoiceResult", + "params": [ +{ "paramname": "pCompressed" ,"paramtype": "const void *"}, +{ "paramname": "cbCompressed" ,"paramtype": "uint32"}, +{ "paramname": "pDestBuffer" ,"paramtype": "void *"}, +{ "paramname": "cbDestBufferSize" ,"paramtype": "uint32"}, +{ "paramname": "nBytesWritten" ,"paramtype": "uint32 *"}, +{ "paramname": "nDesiredSampleRate" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetVoiceOptimalSampleRate", + "returntype": "uint32" +} +,{ + "classname": "ISteamUser", + "methodname": "GetAuthSessionTicket", + "returntype": "HAuthTicket", + "params": [ +{ "paramname": "pTicket" ,"paramtype": "void *"}, +{ "paramname": "cbMaxTicket" ,"paramtype": "int"}, +{ "paramname": "pcbTicket" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "BeginAuthSession", + "returntype": "EBeginAuthSessionResult", + "params": [ +{ "paramname": "pAuthTicket" ,"paramtype": "const void *"}, +{ "paramname": "cbAuthTicket" ,"paramtype": "int"}, +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "EndAuthSession", + "returntype": "void", + "params": [ +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "CancelAuthTicket", + "returntype": "void", + "params": [ +{ "paramname": "hAuthTicket" ,"paramtype": "HAuthTicket"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "UserHasLicenseForApp", + "returntype": "EUserHasLicenseForAppResult", + "params": [ +{ "paramname": "steamID" ,"paramtype": "class CSteamID"}, +{ "paramname": "appID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "BIsBehindNAT", + "returntype": "bool" +} +,{ + "classname": "ISteamUser", + "methodname": "AdvertiseGame", + "returntype": "void", + "params": [ +{ "paramname": "steamIDGameServer" ,"paramtype": "class CSteamID"}, +{ "paramname": "unIPServer" ,"paramtype": "uint32"}, +{ "paramname": "usPortServer" ,"paramtype": "uint16"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "RequestEncryptedAppTicket", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pDataToInclude" ,"paramtype": "void *"}, +{ "paramname": "cbDataToInclude" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetEncryptedAppTicket", + "returntype": "bool", + "params": [ +{ "paramname": "pTicket" ,"paramtype": "void *"}, +{ "paramname": "cbMaxTicket" ,"paramtype": "int"}, +{ "paramname": "pcbTicket" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetGameBadgeLevel", + "returntype": "int", + "params": [ +{ "paramname": "nSeries" ,"paramtype": "int"}, +{ "paramname": "bFoil" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUser", + "methodname": "GetPlayerSteamLevel", + "returntype": "int" +} +,{ + "classname": "ISteamUser", + "methodname": "RequestStoreAuthURL", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchRedirectURL" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetPersonaName", + "returntype": "const char *" +} +,{ + "classname": "ISteamFriends", + "methodname": "SetPersonaName", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchPersonaName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetPersonaState", + "returntype": "EPersonaState" +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendCount", + "returntype": "int", + "params": [ +{ "paramname": "iFriendFlags" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "iFriend" ,"paramtype": "int"}, +{ "paramname": "iFriendFlags" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendRelationship", + "returntype": "EFriendRelationship", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendPersonaState", + "returntype": "EPersonaState", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendPersonaName", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendGamePlayed", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "pFriendGameInfo" ,"out_struct": " " ,"paramtype": "struct FriendGameInfo_t *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendPersonaNameHistory", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "iPersonaName" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendSteamLevel", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetPlayerNickname", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDPlayer" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendsGroupCount", + "returntype": "int" +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendsGroupIDByIndex", + "returntype": "FriendsGroupID_t", + "params": [ +{ "paramname": "iFG" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendsGroupName", + "returntype": "const char *", + "params": [ +{ "paramname": "friendsGroupID" ,"paramtype": "FriendsGroupID_t"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendsGroupMembersCount", + "returntype": "int", + "params": [ +{ "paramname": "friendsGroupID" ,"paramtype": "FriendsGroupID_t"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendsGroupMembersList", + "returntype": "void", + "params": [ +{ "paramname": "friendsGroupID" ,"paramtype": "FriendsGroupID_t"}, +{ "paramname": "pOutSteamIDMembers" ,"out_array_call": "nMembersCount,GetFriendsGroupMembersCount,friendsGroupID" ,"paramtype": "class CSteamID *"}, +{ "paramname": "nMembersCount" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "HasFriend", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "iFriendFlags" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanCount", + "returntype": "int" +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "iClan" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanName", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanTag", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanActivityCounts", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"}, +{ "paramname": "pnOnline" ,"paramtype": "int *"}, +{ "paramname": "pnInGame" ,"paramtype": "int *"}, +{ "paramname": "pnChatting" ,"paramtype": "int *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "DownloadClanActivityCounts", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "psteamIDClans" ,"array_count": "cClansToRequest" ,"paramtype": "class CSteamID *"}, +{ "paramname": "cClansToRequest" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendCountFromSource", + "returntype": "int", + "params": [ +{ "paramname": "steamIDSource" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendFromSourceByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "steamIDSource" ,"paramtype": "class CSteamID"}, +{ "paramname": "iFriend" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "IsUserInSource", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDSource" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "SetInGameVoiceSpeaking", + "returntype": "void", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "bSpeaking" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ActivateGameOverlay", + "returntype": "void", + "params": [ +{ "paramname": "pchDialog" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ActivateGameOverlayToUser", + "returntype": "void", + "params": [ +{ "paramname": "pchDialog" ,"paramtype": "const char *"}, +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ActivateGameOverlayToWebPage", + "returntype": "void", + "params": [ +{ "paramname": "pchURL" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ActivateGameOverlayToStore", + "returntype": "void", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "eFlag" ,"paramtype": "EOverlayToStoreFlag"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "SetPlayedWith", + "returntype": "void", + "params": [ +{ "paramname": "steamIDUserPlayedWith" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ActivateGameOverlayInviteDialog", + "returntype": "void", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetSmallFriendAvatar", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetMediumFriendAvatar", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetLargeFriendAvatar", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "RequestUserInformation", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "bRequireNameOnly" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "RequestClanOfficerList", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanOwner", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanOfficerCount", + "returntype": "int", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanOfficerByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"}, +{ "paramname": "iOfficer" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetUserRestrictions", + "returntype": "uint32" +} +,{ + "classname": "ISteamFriends", + "methodname": "SetRichPresence", + "returntype": "bool", + "params": [ +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ClearRichPresence", + "returntype": "void" +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendRichPresence", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendRichPresenceKeyCount", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendRichPresenceKeyByIndex", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "iKey" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "RequestFriendRichPresence", + "returntype": "void", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "InviteUserToGame", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchConnectString" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetCoplayFriendCount", + "returntype": "int" +} +,{ + "classname": "ISteamFriends", + "methodname": "GetCoplayFriend", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "iCoplayFriend" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendCoplayTime", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendCoplayGame", + "returntype": "AppId_t", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "JoinClanChatRoom", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "LeaveClanChatRoom", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanChatMemberCount", + "returntype": "int", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetChatMemberByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"}, +{ "paramname": "iUser" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "SendClanChatMessage", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClanChat" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchText" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetClanChatMessage", + "returntype": "int", + "params": [ +{ "paramname": "steamIDClanChat" ,"paramtype": "class CSteamID"}, +{ "paramname": "iMessage" ,"paramtype": "int"}, +{ "paramname": "prgchText" ,"paramtype": "void *"}, +{ "paramname": "cchTextMax" ,"paramtype": "int"}, +{ "paramname": "peChatEntryType" ,"paramtype": "EChatEntryType *"}, +{ "paramname": "psteamidChatter" ,"out_struct": " " ,"paramtype": "class CSteamID *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "IsClanChatAdmin", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClanChat" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "IsClanChatWindowOpenInSteam", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClanChat" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "OpenClanChatWindowInSteam", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClanChat" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "CloseClanChatWindowInSteam", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDClanChat" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "SetListenForFriendsMessages", + "returntype": "bool", + "params": [ +{ "paramname": "bInterceptEnabled" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "ReplyToFriendMessage", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchMsgToSend" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFriendMessage", + "returntype": "int", + "params": [ +{ "paramname": "steamIDFriend" ,"paramtype": "class CSteamID"}, +{ "paramname": "iMessageID" ,"paramtype": "int"}, +{ "paramname": "pvData" ,"paramtype": "void *"}, +{ "paramname": "cubData" ,"paramtype": "int"}, +{ "paramname": "peChatEntryType" ,"paramtype": "EChatEntryType *"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "GetFollowerCount", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "IsFollowing", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamFriends", + "methodname": "EnumerateFollowingList", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unStartIndex" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetSecondsSinceAppActive", + "returntype": "uint32" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetSecondsSinceComputerActive", + "returntype": "uint32" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetConnectedUniverse", + "returntype": "EUniverse" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetServerRealTime", + "returntype": "uint32" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetIPCountry", + "returntype": "const char *" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetImageSize", + "returntype": "bool", + "params": [ +{ "paramname": "iImage" ,"paramtype": "int"}, +{ "paramname": "pnWidth" ,"paramtype": "uint32 *"}, +{ "paramname": "pnHeight" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetImageRGBA", + "returntype": "bool", + "params": [ +{ "paramname": "iImage" ,"paramtype": "int"}, +{ "paramname": "pubDest" ,"paramtype": "uint8 *"}, +{ "paramname": "nDestBufferSize" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetCSERIPPort", + "returntype": "bool", + "params": [ +{ "paramname": "unIP" ,"paramtype": "uint32 *"}, +{ "paramname": "usPort" ,"paramtype": "uint16 *"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetCurrentBatteryPower", + "returntype": "uint8" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetAppID", + "returntype": "uint32" +} +,{ + "classname": "ISteamUtils", + "methodname": "SetOverlayNotificationPosition", + "returntype": "void", + "params": [ +{ "paramname": "eNotificationPosition" ,"paramtype": "ENotificationPosition"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "IsAPICallCompleted", + "returntype": "bool", + "params": [ +{ "paramname": "hSteamAPICall" ,"paramtype": "SteamAPICall_t"}, +{ "paramname": "pbFailed" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetAPICallFailureReason", + "returntype": "ESteamAPICallFailure", + "params": [ +{ "paramname": "hSteamAPICall" ,"paramtype": "SteamAPICall_t"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetAPICallResult", + "returntype": "bool", + "params": [ +{ "paramname": "hSteamAPICall" ,"paramtype": "SteamAPICall_t"}, +{ "paramname": "pCallback" ,"paramtype": "void *"}, +{ "paramname": "cubCallback" ,"paramtype": "int"}, +{ "paramname": "iCallbackExpected" ,"paramtype": "int"}, +{ "paramname": "pbFailed" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "RunFrame", + "returntype": "void" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetIPCCallCount", + "returntype": "uint32" +} +,{ + "classname": "ISteamUtils", + "methodname": "SetWarningMessageHook", + "returntype": "void", + "params": [ +{ "paramname": "pFunction" ,"paramtype": "SteamAPIWarningMessageHook_t"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "IsOverlayEnabled", + "returntype": "bool" +} +,{ + "classname": "ISteamUtils", + "methodname": "BOverlayNeedsPresent", + "returntype": "bool" +} +,{ + "classname": "ISteamUtils", + "methodname": "CheckFileSignature", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "szFileName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "ShowGamepadTextInput", + "returntype": "bool", + "params": [ +{ "paramname": "eInputMode" ,"paramtype": "EGamepadTextInputMode"}, +{ "paramname": "eLineInputMode" ,"paramtype": "EGamepadTextInputLineMode"}, +{ "paramname": "pchDescription" ,"paramtype": "const char *"}, +{ "paramname": "unCharMax" ,"paramtype": "uint32"}, +{ "paramname": "pchExistingText" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetEnteredGamepadTextLength", + "returntype": "uint32" +} +,{ + "classname": "ISteamUtils", + "methodname": "GetEnteredGamepadTextInput", + "returntype": "bool", + "params": [ +{ "paramname": "pchText" ,"paramtype": "char *"}, +{ "paramname": "cchText" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUtils", + "methodname": "GetSteamUILanguage", + "returntype": "const char *" +} +,{ + "classname": "ISteamUtils", + "methodname": "IsSteamRunningInVR", + "returntype": "bool" +} +,{ + "classname": "ISteamUtils", + "methodname": "SetOverlayNotificationInset", + "returntype": "void", + "params": [ +{ "paramname": "nHorizontalInset" ,"paramtype": "int"}, +{ "paramname": "nVerticalInset" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetFavoriteGameCount", + "returntype": "int" +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetFavoriteGame", + "returntype": "bool", + "params": [ +{ "paramname": "iGame" ,"paramtype": "int"}, +{ "paramname": "pnAppID" ,"paramtype": "AppId_t *"}, +{ "paramname": "pnIP" ,"paramtype": "uint32 *"}, +{ "paramname": "pnConnPort" ,"paramtype": "uint16 *"}, +{ "paramname": "pnQueryPort" ,"paramtype": "uint16 *"}, +{ "paramname": "punFlags" ,"paramtype": "uint32 *"}, +{ "paramname": "pRTime32LastPlayedOnServer" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddFavoriteGame", + "returntype": "int", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "nIP" ,"paramtype": "uint32"}, +{ "paramname": "nConnPort" ,"paramtype": "uint16"}, +{ "paramname": "nQueryPort" ,"paramtype": "uint16"}, +{ "paramname": "unFlags" ,"paramtype": "uint32"}, +{ "paramname": "rTime32LastPlayedOnServer" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "RemoveFavoriteGame", + "returntype": "bool", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "nIP" ,"paramtype": "uint32"}, +{ "paramname": "nConnPort" ,"paramtype": "uint16"}, +{ "paramname": "nQueryPort" ,"paramtype": "uint16"}, +{ "paramname": "unFlags" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "RequestLobbyList", + "returntype": "SteamAPICall_t" +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListStringFilter", + "returntype": "void", + "params": [ +{ "paramname": "pchKeyToMatch" ,"paramtype": "const char *"}, +{ "paramname": "pchValueToMatch" ,"paramtype": "const char *"}, +{ "paramname": "eComparisonType" ,"paramtype": "ELobbyComparison"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListNumericalFilter", + "returntype": "void", + "params": [ +{ "paramname": "pchKeyToMatch" ,"paramtype": "const char *"}, +{ "paramname": "nValueToMatch" ,"paramtype": "int"}, +{ "paramname": "eComparisonType" ,"paramtype": "ELobbyComparison"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListNearValueFilter", + "returntype": "void", + "params": [ +{ "paramname": "pchKeyToMatch" ,"paramtype": "const char *"}, +{ "paramname": "nValueToBeCloseTo" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListFilterSlotsAvailable", + "returntype": "void", + "params": [ +{ "paramname": "nSlotsAvailable" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListDistanceFilter", + "returntype": "void", + "params": [ +{ "paramname": "eLobbyDistanceFilter" ,"paramtype": "ELobbyDistanceFilter"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListResultCountFilter", + "returntype": "void", + "params": [ +{ "paramname": "cMaxResults" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "AddRequestLobbyListCompatibleMembersFilter", + "returntype": "void", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "iLobby" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "CreateLobby", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "eLobbyType" ,"paramtype": "ELobbyType"}, +{ "paramname": "cMaxMembers" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "JoinLobby", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "LeaveLobby", + "returntype": "void", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "InviteUserToLobby", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDInvitee" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetNumLobbyMembers", + "returntype": "int", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyMemberByIndex", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "iMember" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyData", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyData", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyDataCount", + "returntype": "int", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyDataByIndex", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "iLobbyData" ,"paramtype": "int"}, +{ "paramname": "pchKey" ,"paramtype": "char *"}, +{ "paramname": "cchKeyBufferSize" ,"paramtype": "int"}, +{ "paramname": "pchValue" ,"paramtype": "char *"}, +{ "paramname": "cchValueBufferSize" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "DeleteLobbyData", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyMemberData", + "returntype": "const char *", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyMemberData", + "returntype": "void", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SendLobbyChatMsg", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "pvMsgBody" ,"paramtype": "const void *"}, +{ "paramname": "cubMsgBody" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyChatEntry", + "returntype": "int", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "iChatID" ,"paramtype": "int"}, +{ "paramname": "pSteamIDUser" ,"out_struct": " " ,"paramtype": "class CSteamID *"}, +{ "paramname": "pvData" ,"paramtype": "void *"}, +{ "paramname": "cubData" ,"paramtype": "int"}, +{ "paramname": "peChatEntryType" ,"paramtype": "EChatEntryType *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "RequestLobbyData", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyGameServer", + "returntype": "void", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "unGameServerIP" ,"paramtype": "uint32"}, +{ "paramname": "unGameServerPort" ,"paramtype": "uint16"}, +{ "paramname": "steamIDGameServer" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyGameServer", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "punGameServerIP" ,"paramtype": "uint32 *"}, +{ "paramname": "punGameServerPort" ,"paramtype": "uint16 *"}, +{ "paramname": "psteamIDGameServer" ,"out_struct": " " ,"paramtype": "class CSteamID *"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyMemberLimit", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "cMaxMembers" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyMemberLimit", + "returntype": "int", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyType", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "eLobbyType" ,"paramtype": "ELobbyType"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyJoinable", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "bLobbyJoinable" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "GetLobbyOwner", + "returntype": "class CSteamID", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLobbyOwner", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDNewOwner" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmaking", + "methodname": "SetLinkedLobby", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDLobbyDependent" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamMatchmakingServerListResponse", + "methodname": "ServerResponded", + "returntype": "void", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"}, +{ "paramname": "iServer" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmakingServerListResponse", + "methodname": "ServerFailedToRespond", + "returntype": "void", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"}, +{ "paramname": "iServer" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmakingServerListResponse", + "methodname": "RefreshComplete", + "returntype": "void", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"}, +{ "paramname": "response" ,"paramtype": "EMatchMakingServerResponse"} + ] +} +,{ + "classname": "ISteamMatchmakingPingResponse", + "methodname": "ServerResponded", + "returntype": "void", + "params": [ +{ "paramname": "server" ,"paramtype": "class gameserveritem_t &"} + ] +} +,{ + "classname": "ISteamMatchmakingPingResponse", + "methodname": "ServerFailedToRespond", + "returntype": "void" +} +,{ + "classname": "ISteamMatchmakingPlayersResponse", + "methodname": "AddPlayerToList", + "returntype": "void", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "nScore" ,"paramtype": "int"}, +{ "paramname": "flTimePlayed" ,"paramtype": "float"} + ] +} +,{ + "classname": "ISteamMatchmakingPlayersResponse", + "methodname": "PlayersFailedToRespond", + "returntype": "void" +} +,{ + "classname": "ISteamMatchmakingPlayersResponse", + "methodname": "PlayersRefreshComplete", + "returntype": "void" +} +,{ + "classname": "ISteamMatchmakingRulesResponse", + "methodname": "RulesResponded", + "returntype": "void", + "params": [ +{ "paramname": "pchRule" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMatchmakingRulesResponse", + "methodname": "RulesFailedToRespond", + "returntype": "void" +} +,{ + "classname": "ISteamMatchmakingRulesResponse", + "methodname": "RulesRefreshComplete", + "returntype": "void" +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RequestInternetServerList", + "returntype": "HServerListRequest", + "params": [ +{ "paramname": "iApp" ,"paramtype": "AppId_t"}, +{ "paramname": "ppchFilters" ,"array_count": "nFilters" ,"paramtype": "struct MatchMakingKeyValuePair_t **"}, +{ "paramname": "nFilters" ,"paramtype": "uint32"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingServerListResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RequestLANServerList", + "returntype": "HServerListRequest", + "params": [ +{ "paramname": "iApp" ,"paramtype": "AppId_t"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingServerListResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RequestFriendsServerList", + "returntype": "HServerListRequest", + "params": [ +{ "paramname": "iApp" ,"paramtype": "AppId_t"}, +{ "paramname": "ppchFilters" ,"array_count": "nFilters" ,"paramtype": "struct MatchMakingKeyValuePair_t **"}, +{ "paramname": "nFilters" ,"paramtype": "uint32"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingServerListResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RequestFavoritesServerList", + "returntype": "HServerListRequest", + "params": [ +{ "paramname": "iApp" ,"paramtype": "AppId_t"}, +{ "paramname": "ppchFilters" ,"array_count": "nFilters" ,"paramtype": "struct MatchMakingKeyValuePair_t **"}, +{ "paramname": "nFilters" ,"paramtype": "uint32"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingServerListResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RequestHistoryServerList", + "returntype": "HServerListRequest", + "params": [ +{ "paramname": "iApp" ,"paramtype": "AppId_t"}, +{ "paramname": "ppchFilters" ,"array_count": "nFilters" ,"paramtype": "struct MatchMakingKeyValuePair_t **"}, +{ "paramname": "nFilters" ,"paramtype": "uint32"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingServerListResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RequestSpectatorServerList", + "returntype": "HServerListRequest", + "params": [ +{ "paramname": "iApp" ,"paramtype": "AppId_t"}, +{ "paramname": "ppchFilters" ,"array_count": "nFilters" ,"paramtype": "struct MatchMakingKeyValuePair_t **"}, +{ "paramname": "nFilters" ,"paramtype": "uint32"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingServerListResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "ReleaseRequest", + "returntype": "void", + "params": [ +{ "paramname": "hServerListRequest" ,"paramtype": "HServerListRequest"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "GetServerDetails", + "returntype": "class gameserveritem_t *", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"}, +{ "paramname": "iServer" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "CancelQuery", + "returntype": "void", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RefreshQuery", + "returntype": "void", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "IsRefreshing", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "GetServerCount", + "returntype": "int", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "RefreshServer", + "returntype": "void", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HServerListRequest"}, +{ "paramname": "iServer" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "PingServer", + "returntype": "HServerQuery", + "params": [ +{ "paramname": "unIP" ,"paramtype": "uint32"}, +{ "paramname": "usPort" ,"paramtype": "uint16"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingPingResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "PlayerDetails", + "returntype": "HServerQuery", + "params": [ +{ "paramname": "unIP" ,"paramtype": "uint32"}, +{ "paramname": "usPort" ,"paramtype": "uint16"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingPlayersResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "ServerRules", + "returntype": "HServerQuery", + "params": [ +{ "paramname": "unIP" ,"paramtype": "uint32"}, +{ "paramname": "usPort" ,"paramtype": "uint16"}, +{ "paramname": "pRequestServersResponse" ,"paramtype": "class ISteamMatchmakingRulesResponse *"} + ] +} +,{ + "classname": "ISteamMatchmakingServers", + "methodname": "CancelServerQuery", + "returntype": "void", + "params": [ +{ "paramname": "hServerQuery" ,"paramtype": "HServerQuery"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileWrite", + "returntype": "bool", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"}, +{ "paramname": "pvData" ,"paramtype": "const void *"}, +{ "paramname": "cubData" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileRead", + "returntype": "int32", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"}, +{ "paramname": "pvData" ,"paramtype": "void *"}, +{ "paramname": "cubDataToRead" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileWriteAsync", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"}, +{ "paramname": "pvData" ,"paramtype": "const void *"}, +{ "paramname": "cubData" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileReadAsync", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"}, +{ "paramname": "nOffset" ,"paramtype": "uint32"}, +{ "paramname": "cubToRead" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileReadAsyncComplete", + "returntype": "bool", + "params": [ +{ "paramname": "hReadCall" ,"paramtype": "SteamAPICall_t"}, +{ "paramname": "pvBuffer" ,"paramtype": "void *"}, +{ "paramname": "cubToRead" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileForget", + "returntype": "bool", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileDelete", + "returntype": "bool", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileShare", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "SetSyncPlatforms", + "returntype": "bool", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"}, +{ "paramname": "eRemoteStoragePlatform" ,"paramtype": "ERemoteStoragePlatform"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileWriteStreamOpen", + "returntype": "UGCFileWriteStreamHandle_t", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileWriteStreamWriteChunk", + "returntype": "bool", + "params": [ +{ "paramname": "writeHandle" ,"paramtype": "UGCFileWriteStreamHandle_t"}, +{ "paramname": "pvData" ,"paramtype": "const void *"}, +{ "paramname": "cubData" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileWriteStreamClose", + "returntype": "bool", + "params": [ +{ "paramname": "writeHandle" ,"paramtype": "UGCFileWriteStreamHandle_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileWriteStreamCancel", + "returntype": "bool", + "params": [ +{ "paramname": "writeHandle" ,"paramtype": "UGCFileWriteStreamHandle_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FileExists", + "returntype": "bool", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "FilePersisted", + "returntype": "bool", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetFileSize", + "returntype": "int32", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetFileTimestamp", + "returntype": "int64", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetSyncPlatforms", + "returntype": "ERemoteStoragePlatform", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetFileCount", + "returntype": "int32" +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetFileNameAndSize", + "returntype": "const char *", + "params": [ +{ "paramname": "iFile" ,"paramtype": "int"}, +{ "paramname": "pnFileSizeInBytes" ,"paramtype": "int32 *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetQuota", + "returntype": "bool", + "params": [ +{ "paramname": "pnTotalBytes" ,"paramtype": "int32 *"}, +{ "paramname": "puAvailableBytes" ,"paramtype": "int32 *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "IsCloudEnabledForAccount", + "returntype": "bool" +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "IsCloudEnabledForApp", + "returntype": "bool" +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "SetCloudEnabledForApp", + "returntype": "void", + "params": [ +{ "paramname": "bEnabled" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UGCDownload", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "hContent" ,"paramtype": "UGCHandle_t"}, +{ "paramname": "unPriority" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetUGCDownloadProgress", + "returntype": "bool", + "params": [ +{ "paramname": "hContent" ,"paramtype": "UGCHandle_t"}, +{ "paramname": "pnBytesDownloaded" ,"paramtype": "int32 *"}, +{ "paramname": "pnBytesExpected" ,"paramtype": "int32 *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetUGCDetails", + "returntype": "bool", + "params": [ +{ "paramname": "hContent" ,"paramtype": "UGCHandle_t"}, +{ "paramname": "pnAppID" ,"paramtype": "AppId_t *"}, +{ "paramname": "ppchName" ,"paramtype": "char **"}, +{ "paramname": "pnFileSizeInBytes" ,"paramtype": "int32 *"}, +{ "paramname": "pSteamIDOwner" ,"out_struct": " " ,"paramtype": "class CSteamID *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UGCRead", + "returntype": "int32", + "params": [ +{ "paramname": "hContent" ,"paramtype": "UGCHandle_t"}, +{ "paramname": "pvData" ,"paramtype": "void *"}, +{ "paramname": "cubDataToRead" ,"paramtype": "int32"}, +{ "paramname": "cOffset" ,"paramtype": "uint32"}, +{ "paramname": "eAction" ,"paramtype": "EUGCReadAction"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetCachedUGCCount", + "returntype": "int32" +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetCachedUGCHandle", + "returntype": "UGCHandle_t", + "params": [ +{ "paramname": "iCachedContent" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "PublishWorkshopFile", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchFile" ,"paramtype": "const char *"}, +{ "paramname": "pchPreviewFile" ,"paramtype": "const char *"}, +{ "paramname": "nConsumerAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "pchTitle" ,"paramtype": "const char *"}, +{ "paramname": "pchDescription" ,"paramtype": "const char *"}, +{ "paramname": "eVisibility" ,"paramtype": "ERemoteStoragePublishedFileVisibility"}, +{ "paramname": "pTags" ,"paramtype": "struct SteamParamStringArray_t *"}, +{ "paramname": "eWorkshopFileType" ,"paramtype": "EWorkshopFileType"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "CreatePublishedFileUpdateRequest", + "returntype": "PublishedFileUpdateHandle_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFileFile", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "pchFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFilePreviewFile", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "pchPreviewFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFileTitle", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "pchTitle" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFileDescription", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "pchDescription" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFileVisibility", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "eVisibility" ,"paramtype": "ERemoteStoragePublishedFileVisibility"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFileTags", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "pTags" ,"paramtype": "struct SteamParamStringArray_t *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "CommitPublishedFileUpdate", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetPublishedFileDetails", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "unMaxSecondsOld" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "DeletePublishedFile", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "EnumerateUserPublishedFiles", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unStartIndex" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "SubscribePublishedFile", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "EnumerateUserSubscribedFiles", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unStartIndex" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UnsubscribePublishedFile", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdatePublishedFileSetChangeDescription", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "PublishedFileUpdateHandle_t"}, +{ "paramname": "pchChangeDescription" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetPublishedItemVoteDetails", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UpdateUserPublishedItemVote", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "bVoteUp" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "GetUserPublishedItemVoteDetails", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "EnumerateUserSharedWorkshopFiles", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamId" ,"paramtype": "class CSteamID"}, +{ "paramname": "unStartIndex" ,"paramtype": "uint32"}, +{ "paramname": "pRequiredTags" ,"paramtype": "struct SteamParamStringArray_t *"}, +{ "paramname": "pExcludedTags" ,"paramtype": "struct SteamParamStringArray_t *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "PublishVideo", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "eVideoProvider" ,"paramtype": "EWorkshopVideoProvider"}, +{ "paramname": "pchVideoAccount" ,"paramtype": "const char *"}, +{ "paramname": "pchVideoIdentifier" ,"paramtype": "const char *"}, +{ "paramname": "pchPreviewFile" ,"paramtype": "const char *"}, +{ "paramname": "nConsumerAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "pchTitle" ,"paramtype": "const char *"}, +{ "paramname": "pchDescription" ,"paramtype": "const char *"}, +{ "paramname": "eVisibility" ,"paramtype": "ERemoteStoragePublishedFileVisibility"}, +{ "paramname": "pTags" ,"paramtype": "struct SteamParamStringArray_t *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "SetUserPublishedFileAction", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unPublishedFileId" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "eAction" ,"paramtype": "EWorkshopFileAction"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "EnumeratePublishedFilesByUserAction", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "eAction" ,"paramtype": "EWorkshopFileAction"}, +{ "paramname": "unStartIndex" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "EnumeratePublishedWorkshopFiles", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "eEnumerationType" ,"paramtype": "EWorkshopEnumerationType"}, +{ "paramname": "unStartIndex" ,"paramtype": "uint32"}, +{ "paramname": "unCount" ,"paramtype": "uint32"}, +{ "paramname": "unDays" ,"paramtype": "uint32"}, +{ "paramname": "pTags" ,"paramtype": "struct SteamParamStringArray_t *"}, +{ "paramname": "pUserTags" ,"paramtype": "struct SteamParamStringArray_t *"} + ] +} +,{ + "classname": "ISteamRemoteStorage", + "methodname": "UGCDownloadToLocation", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "hContent" ,"paramtype": "UGCHandle_t"}, +{ "paramname": "pchLocation" ,"paramtype": "const char *"}, +{ "paramname": "unPriority" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "RequestCurrentStats", + "returntype": "bool" +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "int32 *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "float *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "SetStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "nData" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "SetStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "fData" ,"paramtype": "float"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "UpdateAvgRateStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "flCountThisSession" ,"paramtype": "float"}, +{ "paramname": "dSessionLength" ,"paramtype": "double"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "SetAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "ClearAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetAchievementAndUnlockTime", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"}, +{ "paramname": "punUnlockTime" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "StoreStats", + "returntype": "bool" +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetAchievementIcon", + "returntype": "int", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetAchievementDisplayAttribute", + "returntype": "const char *", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "IndicateAchievementProgress", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "nCurProgress" ,"paramtype": "uint32"}, +{ "paramname": "nMaxProgress" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetNumAchievements", + "returntype": "uint32" +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetAchievementName", + "returntype": "const char *", + "params": [ +{ "paramname": "iAchievement" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "RequestUserStats", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetUserStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "int32 *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetUserStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "float *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetUserAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetUserAchievementAndUnlockTime", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"}, +{ "paramname": "punUnlockTime" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "ResetAllStats", + "returntype": "bool", + "params": [ +{ "paramname": "bAchievementsToo" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "FindOrCreateLeaderboard", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchLeaderboardName" ,"paramtype": "const char *"}, +{ "paramname": "eLeaderboardSortMethod" ,"paramtype": "ELeaderboardSortMethod"}, +{ "paramname": "eLeaderboardDisplayType" ,"paramtype": "ELeaderboardDisplayType"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "FindLeaderboard", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchLeaderboardName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetLeaderboardName", + "returntype": "const char *", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetLeaderboardEntryCount", + "returntype": "int", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetLeaderboardSortMethod", + "returntype": "ELeaderboardSortMethod", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetLeaderboardDisplayType", + "returntype": "ELeaderboardDisplayType", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "DownloadLeaderboardEntries", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"}, +{ "paramname": "eLeaderboardDataRequest" ,"paramtype": "ELeaderboardDataRequest"}, +{ "paramname": "nRangeStart" ,"paramtype": "int"}, +{ "paramname": "nRangeEnd" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "DownloadLeaderboardEntriesForUsers", "desc": "Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"}, +{ "paramname": "prgUsers" ,"array_count": "cUsers" ,"desc": "Array of users to retrieve" ,"paramtype": "class CSteamID *"}, +{ "paramname": "cUsers" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetDownloadedLeaderboardEntry", + "returntype": "bool", + "params": [ +{ "paramname": "hSteamLeaderboardEntries" ,"paramtype": "SteamLeaderboardEntries_t"}, +{ "paramname": "index" ,"paramtype": "int"}, +{ "paramname": "pLeaderboardEntry" ,"paramtype": "struct LeaderboardEntry_t *"}, +{ "paramname": "pDetails" ,"paramtype": "int32 *"}, +{ "paramname": "cDetailsMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "UploadLeaderboardScore", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"}, +{ "paramname": "eLeaderboardUploadScoreMethod" ,"paramtype": "ELeaderboardUploadScoreMethod"}, +{ "paramname": "nScore" ,"paramtype": "int32"}, +{ "paramname": "pScoreDetails" ,"paramtype": "const int32 *"}, +{ "paramname": "cScoreDetailsCount" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "AttachLeaderboardUGC", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "hSteamLeaderboard" ,"paramtype": "SteamLeaderboard_t"}, +{ "paramname": "hUGC" ,"paramtype": "UGCHandle_t"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetNumberOfCurrentPlayers", + "returntype": "SteamAPICall_t" +} +,{ + "classname": "ISteamUserStats", + "methodname": "RequestGlobalAchievementPercentages", + "returntype": "SteamAPICall_t" +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetMostAchievedAchievementInfo", + "returntype": "int", + "params": [ +{ "paramname": "pchName" ,"paramtype": "char *"}, +{ "paramname": "unNameBufLen" ,"paramtype": "uint32"}, +{ "paramname": "pflPercent" ,"paramtype": "float *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetNextMostAchievedAchievementInfo", + "returntype": "int", + "params": [ +{ "paramname": "iIteratorPrevious" ,"paramtype": "int"}, +{ "paramname": "pchName" ,"paramtype": "char *"}, +{ "paramname": "unNameBufLen" ,"paramtype": "uint32"}, +{ "paramname": "pflPercent" ,"paramtype": "float *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetAchievementAchievedPercent", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pflPercent" ,"paramtype": "float *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "RequestGlobalStats", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nHistoryDays" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetGlobalStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchStatName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "int64 *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetGlobalStat", + "returntype": "bool", + "params": [ +{ "paramname": "pchStatName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "double *"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetGlobalStatHistory", + "returntype": "int32", + "params": [ +{ "paramname": "pchStatName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"array_count": "cubData" ,"paramtype": "int64 *"}, +{ "paramname": "cubData" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUserStats", + "methodname": "GetGlobalStatHistory", + "returntype": "int32", + "params": [ +{ "paramname": "pchStatName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"array_count": "cubData" ,"paramtype": "double *"}, +{ "paramname": "cubData" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "BIsSubscribed", + "returntype": "bool" +} +,{ + "classname": "ISteamApps", + "methodname": "BIsLowViolence", + "returntype": "bool" +} +,{ + "classname": "ISteamApps", + "methodname": "BIsCybercafe", + "returntype": "bool" +} +,{ + "classname": "ISteamApps", + "methodname": "BIsVACBanned", + "returntype": "bool" +} +,{ + "classname": "ISteamApps", + "methodname": "GetCurrentGameLanguage", + "returntype": "const char *" +} +,{ + "classname": "ISteamApps", + "methodname": "GetAvailableGameLanguages", + "returntype": "const char *" +} +,{ + "classname": "ISteamApps", + "methodname": "BIsSubscribedApp", + "returntype": "bool", + "params": [ +{ "paramname": "appID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "BIsDlcInstalled", + "returntype": "bool", + "params": [ +{ "paramname": "appID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetEarliestPurchaseUnixTime", + "returntype": "uint32", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "BIsSubscribedFromFreeWeekend", + "returntype": "bool" +} +,{ + "classname": "ISteamApps", + "methodname": "GetDLCCount", + "returntype": "int" +} +,{ + "classname": "ISteamApps", + "methodname": "BGetDLCDataByIndex", + "returntype": "bool", + "params": [ +{ "paramname": "iDLC" ,"paramtype": "int"}, +{ "paramname": "pAppID" ,"paramtype": "AppId_t *"}, +{ "paramname": "pbAvailable" ,"paramtype": "bool *"}, +{ "paramname": "pchName" ,"paramtype": "char *"}, +{ "paramname": "cchNameBufferSize" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "InstallDLC", + "returntype": "void", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "UninstallDLC", + "returntype": "void", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "RequestAppProofOfPurchaseKey", + "returntype": "void", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetCurrentBetaName", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "char *"}, +{ "paramname": "cchNameBufferSize" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "MarkContentCorrupt", + "returntype": "bool", + "params": [ +{ "paramname": "bMissingFilesOnly" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetInstalledDepots", + "returntype": "uint32", + "params": [ +{ "paramname": "appID" ,"paramtype": "AppId_t"}, +{ "paramname": "pvecDepots" ,"paramtype": "DepotId_t *"}, +{ "paramname": "cMaxDepots" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetAppInstallDir", + "returntype": "uint32", + "params": [ +{ "paramname": "appID" ,"paramtype": "AppId_t"}, +{ "paramname": "pchFolder" ,"paramtype": "char *"}, +{ "paramname": "cchFolderBufferSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "BIsAppInstalled", + "returntype": "bool", + "params": [ +{ "paramname": "appID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetAppOwner", + "returntype": "class CSteamID" +} +,{ + "classname": "ISteamApps", + "methodname": "GetLaunchQueryParam", + "returntype": "const char *", + "params": [ +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetDlcDownloadProgress", + "returntype": "bool", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "punBytesDownloaded" ,"paramtype": "uint64 *"}, +{ "paramname": "punBytesTotal" ,"paramtype": "uint64 *"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "GetAppBuildId", + "returntype": "int" +} +,{ + "classname": "ISteamNetworking", + "methodname": "SendP2PPacket", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDRemote" ,"paramtype": "class CSteamID"}, +{ "paramname": "pubData" ,"paramtype": "const void *"}, +{ "paramname": "cubData" ,"paramtype": "uint32"}, +{ "paramname": "eP2PSendType" ,"paramtype": "EP2PSend"}, +{ "paramname": "nChannel" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "IsP2PPacketAvailable", + "returntype": "bool", + "params": [ +{ "paramname": "pcubMsgSize" ,"paramtype": "uint32 *"}, +{ "paramname": "nChannel" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "ReadP2PPacket", + "returntype": "bool", + "params": [ +{ "paramname": "pubDest" ,"paramtype": "void *"}, +{ "paramname": "cubDest" ,"paramtype": "uint32"}, +{ "paramname": "pcubMsgSize" ,"paramtype": "uint32 *"}, +{ "paramname": "psteamIDRemote" ,"paramtype": "class CSteamID *"}, +{ "paramname": "nChannel" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "AcceptP2PSessionWithUser", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDRemote" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "CloseP2PSessionWithUser", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDRemote" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "CloseP2PChannelWithUser", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDRemote" ,"paramtype": "class CSteamID"}, +{ "paramname": "nChannel" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "GetP2PSessionState", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDRemote" ,"paramtype": "class CSteamID"}, +{ "paramname": "pConnectionState" ,"paramtype": "struct P2PSessionState_t *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "AllowP2PPacketRelay", + "returntype": "bool", + "params": [ +{ "paramname": "bAllow" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "CreateListenSocket", + "returntype": "SNetListenSocket_t", + "params": [ +{ "paramname": "nVirtualP2PPort" ,"paramtype": "int"}, +{ "paramname": "nIP" ,"paramtype": "uint32"}, +{ "paramname": "nPort" ,"paramtype": "uint16"}, +{ "paramname": "bAllowUseOfPacketRelay" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "CreateP2PConnectionSocket", + "returntype": "SNetSocket_t", + "params": [ +{ "paramname": "steamIDTarget" ,"paramtype": "class CSteamID"}, +{ "paramname": "nVirtualPort" ,"paramtype": "int"}, +{ "paramname": "nTimeoutSec" ,"paramtype": "int"}, +{ "paramname": "bAllowUseOfPacketRelay" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "CreateConnectionSocket", + "returntype": "SNetSocket_t", + "params": [ +{ "paramname": "nIP" ,"paramtype": "uint32"}, +{ "paramname": "nPort" ,"paramtype": "uint16"}, +{ "paramname": "nTimeoutSec" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "DestroySocket", + "returntype": "bool", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"}, +{ "paramname": "bNotifyRemoteEnd" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "DestroyListenSocket", + "returntype": "bool", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetListenSocket_t"}, +{ "paramname": "bNotifyRemoteEnd" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "SendDataOnSocket", + "returntype": "bool", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"}, +{ "paramname": "pubData" ,"paramtype": "void *"}, +{ "paramname": "cubData" ,"paramtype": "uint32"}, +{ "paramname": "bReliable" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "IsDataAvailableOnSocket", + "returntype": "bool", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"}, +{ "paramname": "pcubMsgSize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "RetrieveDataFromSocket", + "returntype": "bool", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"}, +{ "paramname": "pubDest" ,"paramtype": "void *"}, +{ "paramname": "cubDest" ,"paramtype": "uint32"}, +{ "paramname": "pcubMsgSize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "IsDataAvailable", + "returntype": "bool", + "params": [ +{ "paramname": "hListenSocket" ,"paramtype": "SNetListenSocket_t"}, +{ "paramname": "pcubMsgSize" ,"paramtype": "uint32 *"}, +{ "paramname": "phSocket" ,"paramtype": "SNetSocket_t *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "RetrieveData", + "returntype": "bool", + "params": [ +{ "paramname": "hListenSocket" ,"paramtype": "SNetListenSocket_t"}, +{ "paramname": "pubDest" ,"paramtype": "void *"}, +{ "paramname": "cubDest" ,"paramtype": "uint32"}, +{ "paramname": "pcubMsgSize" ,"paramtype": "uint32 *"}, +{ "paramname": "phSocket" ,"paramtype": "SNetSocket_t *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "GetSocketInfo", + "returntype": "bool", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"}, +{ "paramname": "pSteamIDRemote" ,"paramtype": "class CSteamID *"}, +{ "paramname": "peSocketStatus" ,"paramtype": "int *"}, +{ "paramname": "punIPRemote" ,"paramtype": "uint32 *"}, +{ "paramname": "punPortRemote" ,"paramtype": "uint16 *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "GetListenSocketInfo", + "returntype": "bool", + "params": [ +{ "paramname": "hListenSocket" ,"paramtype": "SNetListenSocket_t"}, +{ "paramname": "pnIP" ,"paramtype": "uint32 *"}, +{ "paramname": "pnPort" ,"paramtype": "uint16 *"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "GetSocketConnectionType", + "returntype": "ESNetSocketConnectionType", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"} + ] +} +,{ + "classname": "ISteamNetworking", + "methodname": "GetMaxPacketSize", + "returntype": "int", + "params": [ +{ "paramname": "hSocket" ,"paramtype": "SNetSocket_t"} + ] +} +,{ + "classname": "ISteamScreenshots", + "methodname": "WriteScreenshot", + "returntype": "ScreenshotHandle", + "params": [ +{ "paramname": "pubRGB" ,"paramtype": "void *"}, +{ "paramname": "cubRGB" ,"paramtype": "uint32"}, +{ "paramname": "nWidth" ,"paramtype": "int"}, +{ "paramname": "nHeight" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamScreenshots", + "methodname": "AddScreenshotToLibrary", + "returntype": "ScreenshotHandle", + "params": [ +{ "paramname": "pchFilename" ,"paramtype": "const char *"}, +{ "paramname": "pchThumbnailFilename" ,"paramtype": "const char *"}, +{ "paramname": "nWidth" ,"paramtype": "int"}, +{ "paramname": "nHeight" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamScreenshots", + "methodname": "TriggerScreenshot", + "returntype": "void" +} +,{ + "classname": "ISteamScreenshots", + "methodname": "HookScreenshots", + "returntype": "void", + "params": [ +{ "paramname": "bHook" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamScreenshots", + "methodname": "SetLocation", + "returntype": "bool", + "params": [ +{ "paramname": "hScreenshot" ,"paramtype": "ScreenshotHandle"}, +{ "paramname": "pchLocation" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamScreenshots", + "methodname": "TagUser", + "returntype": "bool", + "params": [ +{ "paramname": "hScreenshot" ,"paramtype": "ScreenshotHandle"}, +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamScreenshots", + "methodname": "TagPublishedFile", + "returntype": "bool", + "params": [ +{ "paramname": "hScreenshot" ,"paramtype": "ScreenshotHandle"}, +{ "paramname": "unPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamMusic", + "methodname": "BIsEnabled", + "returntype": "bool" +} +,{ + "classname": "ISteamMusic", + "methodname": "BIsPlaying", + "returntype": "bool" +} +,{ + "classname": "ISteamMusic", + "methodname": "GetPlaybackStatus", + "returntype": "AudioPlayback_Status" +} +,{ + "classname": "ISteamMusic", + "methodname": "Play", + "returntype": "void" +} +,{ + "classname": "ISteamMusic", + "methodname": "Pause", + "returntype": "void" +} +,{ + "classname": "ISteamMusic", + "methodname": "PlayPrevious", + "returntype": "void" +} +,{ + "classname": "ISteamMusic", + "methodname": "PlayNext", + "returntype": "void" +} +,{ + "classname": "ISteamMusic", + "methodname": "SetVolume", + "returntype": "void", + "params": [ +{ "paramname": "flVolume" ,"paramtype": "float"} + ] +} +,{ + "classname": "ISteamMusic", + "methodname": "GetVolume", + "returntype": "float" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "RegisterSteamMusicRemote", + "returntype": "bool", + "params": [ +{ "paramname": "pchName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "DeregisterSteamMusicRemote", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "BIsCurrentMusicRemote", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "BActivationSuccess", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "SetDisplayName", + "returntype": "bool", + "params": [ +{ "paramname": "pchDisplayName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "SetPNGIcon_64x64", + "returntype": "bool", + "params": [ +{ "paramname": "pvBuffer" ,"paramtype": "void *"}, +{ "paramname": "cbBufferLength" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "EnablePlayPrevious", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "EnablePlayNext", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "EnableShuffled", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "EnableLooped", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "EnableQueue", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "EnablePlaylists", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdatePlaybackStatus", + "returntype": "bool", + "params": [ +{ "paramname": "nStatus" ,"paramtype": "AudioPlayback_Status"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdateShuffled", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdateLooped", + "returntype": "bool", + "params": [ +{ "paramname": "bValue" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdateVolume", + "returntype": "bool", + "params": [ +{ "paramname": "flValue" ,"paramtype": "float"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "CurrentEntryWillChange", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "CurrentEntryIsAvailable", + "returntype": "bool", + "params": [ +{ "paramname": "bAvailable" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdateCurrentEntryText", + "returntype": "bool", + "params": [ +{ "paramname": "pchText" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdateCurrentEntryElapsedSeconds", + "returntype": "bool", + "params": [ +{ "paramname": "nValue" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "UpdateCurrentEntryCoverArt", + "returntype": "bool", + "params": [ +{ "paramname": "pvBuffer" ,"paramtype": "void *"}, +{ "paramname": "cbBufferLength" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "CurrentEntryDidChange", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "QueueWillChange", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "ResetQueueEntries", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "SetQueueEntry", + "returntype": "bool", + "params": [ +{ "paramname": "nID" ,"paramtype": "int"}, +{ "paramname": "nPosition" ,"paramtype": "int"}, +{ "paramname": "pchEntryText" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "SetCurrentQueueEntry", + "returntype": "bool", + "params": [ +{ "paramname": "nID" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "QueueDidChange", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "PlaylistWillChange", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "ResetPlaylistEntries", + "returntype": "bool" +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "SetPlaylistEntry", + "returntype": "bool", + "params": [ +{ "paramname": "nID" ,"paramtype": "int"}, +{ "paramname": "nPosition" ,"paramtype": "int"}, +{ "paramname": "pchEntryText" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "SetCurrentPlaylistEntry", + "returntype": "bool", + "params": [ +{ "paramname": "nID" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamMusicRemote", + "methodname": "PlaylistDidChange", + "returntype": "bool" +} +,{ + "classname": "ISteamHTTP", + "methodname": "CreateHTTPRequest", + "returntype": "HTTPRequestHandle", + "params": [ +{ "paramname": "eHTTPRequestMethod" ,"paramtype": "EHTTPMethod"}, +{ "paramname": "pchAbsoluteURL" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestContextValue", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "ulContextValue" ,"paramtype": "uint64"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestNetworkActivityTimeout", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "unTimeoutSeconds" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestHeaderValue", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pchHeaderName" ,"paramtype": "const char *"}, +{ "paramname": "pchHeaderValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestGetOrPostParameter", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pchParamName" ,"paramtype": "const char *"}, +{ "paramname": "pchParamValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SendHTTPRequest", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pCallHandle" ,"paramtype": "SteamAPICall_t *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SendHTTPRequestAndStreamResponse", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pCallHandle" ,"paramtype": "SteamAPICall_t *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "DeferHTTPRequest", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "PrioritizeHTTPRequest", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPResponseHeaderSize", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pchHeaderName" ,"paramtype": "const char *"}, +{ "paramname": "unResponseHeaderSize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPResponseHeaderValue", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pchHeaderName" ,"paramtype": "const char *"}, +{ "paramname": "pHeaderValueBuffer" ,"paramtype": "uint8 *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPResponseBodySize", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "unBodySize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPResponseBodyData", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pBodyDataBuffer" ,"paramtype": "uint8 *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPStreamingResponseBodyData", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "cOffset" ,"paramtype": "uint32"}, +{ "paramname": "pBodyDataBuffer" ,"paramtype": "uint8 *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "ReleaseHTTPRequest", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPDownloadProgressPct", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pflPercentOut" ,"paramtype": "float *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestRawPostBody", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pchContentType" ,"paramtype": "const char *"}, +{ "paramname": "pubBody" ,"paramtype": "uint8 *"}, +{ "paramname": "unBodyLen" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "CreateCookieContainer", + "returntype": "HTTPCookieContainerHandle", + "params": [ +{ "paramname": "bAllowResponsesToModify" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "ReleaseCookieContainer", + "returntype": "bool", + "params": [ +{ "paramname": "hCookieContainer" ,"paramtype": "HTTPCookieContainerHandle"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetCookie", + "returntype": "bool", + "params": [ +{ "paramname": "hCookieContainer" ,"paramtype": "HTTPCookieContainerHandle"}, +{ "paramname": "pchHost" ,"paramtype": "const char *"}, +{ "paramname": "pchUrl" ,"paramtype": "const char *"}, +{ "paramname": "pchCookie" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestCookieContainer", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "hCookieContainer" ,"paramtype": "HTTPCookieContainerHandle"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestUserAgentInfo", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pchUserAgentInfo" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestRequiresVerifiedCertificate", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "bRequireVerifiedCertificate" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "SetHTTPRequestAbsoluteTimeoutMS", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "unMilliseconds" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTTP", + "methodname": "GetHTTPRequestWasTimedOut", + "returntype": "bool", + "params": [ +{ "paramname": "hRequest" ,"paramtype": "HTTPRequestHandle"}, +{ "paramname": "pbWasTimedOut" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUnifiedMessages", + "methodname": "SendMethod", + "returntype": "ClientUnifiedMessageHandle", + "params": [ +{ "paramname": "pchServiceMethod" ,"paramtype": "const char *"}, +{ "paramname": "pRequestBuffer" ,"paramtype": "const void *"}, +{ "paramname": "unRequestBufferSize" ,"paramtype": "uint32"}, +{ "paramname": "unContext" ,"paramtype": "uint64"} + ] +} +,{ + "classname": "ISteamUnifiedMessages", + "methodname": "GetMethodResponseInfo", + "returntype": "bool", + "params": [ +{ "paramname": "hHandle" ,"paramtype": "ClientUnifiedMessageHandle"}, +{ "paramname": "punResponseSize" ,"paramtype": "uint32 *"}, +{ "paramname": "peResult" ,"paramtype": "EResult *"} + ] +} +,{ + "classname": "ISteamUnifiedMessages", + "methodname": "GetMethodResponseData", + "returntype": "bool", + "params": [ +{ "paramname": "hHandle" ,"paramtype": "ClientUnifiedMessageHandle"}, +{ "paramname": "pResponseBuffer" ,"paramtype": "void *"}, +{ "paramname": "unResponseBufferSize" ,"paramtype": "uint32"}, +{ "paramname": "bAutoRelease" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUnifiedMessages", + "methodname": "ReleaseMethod", + "returntype": "bool", + "params": [ +{ "paramname": "hHandle" ,"paramtype": "ClientUnifiedMessageHandle"} + ] +} +,{ + "classname": "ISteamUnifiedMessages", + "methodname": "SendNotification", + "returntype": "bool", + "params": [ +{ "paramname": "pchServiceNotification" ,"paramtype": "const char *"}, +{ "paramname": "pNotificationBuffer" ,"paramtype": "const void *"}, +{ "paramname": "unNotificationBufferSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "Init", + "returntype": "bool" +} +,{ + "classname": "ISteamController", + "methodname": "Shutdown", + "returntype": "bool" +} +,{ + "classname": "ISteamController", + "methodname": "RunFrame", + "returntype": "void" +} +,{ + "classname": "ISteamController", + "methodname": "GetConnectedControllers", + "returntype": "int", + "params": [ +{ "paramname": "handlesOut" ,"paramtype": "ControllerHandle_t *"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "ShowBindingPanel", + "returntype": "bool", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetActionSetHandle", + "returntype": "ControllerActionSetHandle_t", + "params": [ +{ "paramname": "pszActionSetName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "ActivateActionSet", + "returntype": "void", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "ControllerActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetCurrentActionSet", + "returntype": "ControllerActionSetHandle_t", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetDigitalActionHandle", + "returntype": "ControllerDigitalActionHandle_t", + "params": [ +{ "paramname": "pszActionName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetDigitalActionData", + "returntype": "struct ControllerDigitalActionData_t", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "ControllerDigitalActionHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetDigitalActionOrigins", + "returntype": "int", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "ControllerActionSetHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "ControllerDigitalActionHandle_t"}, +{ "paramname": "originsOut" ,"paramtype": "EControllerActionOrigin *"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetAnalogActionHandle", + "returntype": "ControllerAnalogActionHandle_t", + "params": [ +{ "paramname": "pszActionName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetAnalogActionData", + "returntype": "struct ControllerAnalogActionData_t", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "analogActionHandle" ,"paramtype": "ControllerAnalogActionHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetAnalogActionOrigins", + "returntype": "int", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "ControllerActionSetHandle_t"}, +{ "paramname": "analogActionHandle" ,"paramtype": "ControllerAnalogActionHandle_t"}, +{ "paramname": "originsOut" ,"paramtype": "EControllerActionOrigin *"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "StopAnalogActionMomentum", + "returntype": "void", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "eAction" ,"paramtype": "ControllerAnalogActionHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "TriggerHapticPulse", + "returntype": "void", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "eTargetPad" ,"paramtype": "ESteamControllerPad"}, +{ "paramname": "usDurationMicroSec" ,"paramtype": "unsigned short"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "CreateQueryUserUGCRequest", + "returntype": "UGCQueryHandle_t", + "params": [ +{ "paramname": "unAccountID" ,"paramtype": "AccountID_t"}, +{ "paramname": "eListType" ,"paramtype": "EUserUGCList"}, +{ "paramname": "eMatchingUGCType" ,"paramtype": "EUGCMatchingUGCType"}, +{ "paramname": "eSortOrder" ,"paramtype": "EUserUGCListSortOrder"}, +{ "paramname": "nCreatorAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "nConsumerAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "unPage" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "CreateQueryAllUGCRequest", + "returntype": "UGCQueryHandle_t", + "params": [ +{ "paramname": "eQueryType" ,"paramtype": "EUGCQuery"}, +{ "paramname": "eMatchingeMatchingUGCTypeFileType" ,"paramtype": "EUGCMatchingUGCType"}, +{ "paramname": "nCreatorAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "nConsumerAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "unPage" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "CreateQueryUGCDetailsRequest", + "returntype": "UGCQueryHandle_t", + "params": [ +{ "paramname": "pvecPublishedFileID" ,"paramtype": "PublishedFileId_t *"}, +{ "paramname": "unNumPublishedFileIDs" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SendQueryUGCRequest", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCResult", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "pDetails" ,"paramtype": "struct SteamUGCDetails_t *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCPreviewURL", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "pchURL" ,"paramtype": "char *"}, +{ "paramname": "cchURLSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCMetadata", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "pchMetadata" ,"paramtype": "char *"}, +{ "paramname": "cchMetadatasize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCChildren", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "pvecPublishedFileID" ,"paramtype": "PublishedFileId_t *"}, +{ "paramname": "cMaxEntries" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCStatistic", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "eStatType" ,"paramtype": "EItemStatistic"}, +{ "paramname": "pStatValue" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCNumAdditionalPreviews", + "returntype": "uint32", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCAdditionalPreview", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "previewIndex" ,"paramtype": "uint32"}, +{ "paramname": "pchURLOrVideoID" ,"paramtype": "char *"}, +{ "paramname": "cchURLSize" ,"paramtype": "uint32"}, +{ "paramname": "pbIsImage" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCNumKeyValueTags", + "returntype": "uint32", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetQueryUGCKeyValueTag", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "index" ,"paramtype": "uint32"}, +{ "paramname": "keyValueTagIndex" ,"paramtype": "uint32"}, +{ "paramname": "pchKey" ,"paramtype": "char *"}, +{ "paramname": "cchKeySize" ,"paramtype": "uint32"}, +{ "paramname": "pchValue" ,"paramtype": "char *"}, +{ "paramname": "cchValueSize" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "ReleaseQueryUGCRequest", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "AddRequiredTag", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "pTagName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "AddExcludedTag", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "pTagName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetReturnKeyValueTags", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bReturnKeyValueTags" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetReturnLongDescription", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bReturnLongDescription" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetReturnMetadata", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bReturnMetadata" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetReturnChildren", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bReturnChildren" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetReturnAdditionalPreviews", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bReturnAdditionalPreviews" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetReturnTotalOnly", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bReturnTotalOnly" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetLanguage", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "pchLanguage" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetAllowCachedResponse", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "unMaxAgeSeconds" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetCloudFileNameFilter", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "pMatchCloudFileName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetMatchAnyTag", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "bMatchAnyTag" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetSearchText", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "pSearchText" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetRankedByTrendDays", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "unDays" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "AddRequiredKeyValueTag", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCQueryHandle_t"}, +{ "paramname": "pKey" ,"paramtype": "const char *"}, +{ "paramname": "pValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "RequestUGCDetails", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "unMaxAgeSeconds" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "CreateItem", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nConsumerAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "eFileType" ,"paramtype": "EWorkshopFileType"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "StartItemUpdate", + "returntype": "UGCUpdateHandle_t", + "params": [ +{ "paramname": "nConsumerAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemTitle", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchTitle" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemDescription", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchDescription" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemUpdateLanguage", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchLanguage" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemMetadata", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchMetaData" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemVisibility", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "eVisibility" ,"paramtype": "ERemoteStoragePublishedFileVisibility"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemTags", + "returntype": "bool", + "params": [ +{ "paramname": "updateHandle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pTags" ,"paramtype": "const struct SteamParamStringArray_t *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemContent", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pszContentFolder" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetItemPreview", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pszPreviewFile" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "RemoveItemKeyValueTags", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "AddItemKeyValueTag", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SubmitItemUpdate", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "pchChangeNote" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetItemUpdateProgress", + "returntype": "EItemUpdateStatus", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "punBytesProcessed" ,"paramtype": "uint64 *"}, +{ "paramname": "punBytesTotal" ,"paramtype": "uint64 *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SetUserItemVote", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "bVoteUp" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetUserItemVote", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "AddItemToFavorites", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "RemoveItemFromFavorites", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SubscribeItem", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "UnsubscribeItem", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetNumSubscribedItems", + "returntype": "uint32" +} +,{ + "classname": "ISteamUGC", + "methodname": "GetSubscribedItems", + "returntype": "uint32", + "params": [ +{ "paramname": "pvecPublishedFileID" ,"paramtype": "PublishedFileId_t *"}, +{ "paramname": "cMaxEntries" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetItemState", + "returntype": "uint32", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetItemInstallInfo", + "returntype": "bool", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "punSizeOnDisk" ,"paramtype": "uint64 *"}, +{ "paramname": "pchFolder" ,"paramtype": "char *"}, +{ "paramname": "cchFolderSize" ,"paramtype": "uint32"}, +{ "paramname": "punTimeStamp" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "GetItemDownloadInfo", + "returntype": "bool", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "punBytesDownloaded" ,"paramtype": "uint64 *"}, +{ "paramname": "punBytesTotal" ,"paramtype": "uint64 *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "DownloadItem", + "returntype": "bool", + "params": [ +{ "paramname": "nPublishedFileID" ,"paramtype": "PublishedFileId_t"}, +{ "paramname": "bHighPriority" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "BInitWorkshopForGameServer", + "returntype": "bool", + "params": [ +{ "paramname": "unWorkshopDepotID" ,"paramtype": "DepotId_t"}, +{ "paramname": "pszFolder" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamUGC", + "methodname": "SuspendDownloads", + "returntype": "void", + "params": [ +{ "paramname": "bSuspend" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamAppList", + "methodname": "GetNumInstalledApps", + "returntype": "uint32" +} +,{ + "classname": "ISteamAppList", + "methodname": "GetInstalledApps", + "returntype": "uint32", + "params": [ +{ "paramname": "pvecAppID" ,"paramtype": "AppId_t *"}, +{ "paramname": "unMaxAppIDs" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamAppList", + "methodname": "GetAppName", + "returntype": "int", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "pchName" ,"paramtype": "char *"}, +{ "paramname": "cchNameMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamAppList", + "methodname": "GetAppInstallDir", + "returntype": "int", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "pchDirectory" ,"paramtype": "char *"}, +{ "paramname": "cchNameMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamAppList", + "methodname": "GetAppBuildId", + "returntype": "int", + "params": [ +{ "paramname": "nAppID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "DestructISteamHTMLSurface", + "returntype": "void" +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "Init", + "returntype": "bool" +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "Shutdown", + "returntype": "bool" +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "CreateBrowser", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "pchUserAgent" ,"paramtype": "const char *"}, +{ "paramname": "pchUserCSS" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "RemoveBrowser", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "LoadURL", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "pchURL" ,"paramtype": "const char *"}, +{ "paramname": "pchPostData" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetSize", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "unWidth" ,"paramtype": "uint32"}, +{ "paramname": "unHeight" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "StopLoad", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "Reload", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "GoBack", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "GoForward", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "AddHeader", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "ExecuteJavascript", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "pchScript" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "MouseUp", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "eMouseButton" ,"paramtype": "ISteamHTMLSurface::EHTMLMouseButton"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "MouseDown", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "eMouseButton" ,"paramtype": "ISteamHTMLSurface::EHTMLMouseButton"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "MouseDoubleClick", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "eMouseButton" ,"paramtype": "ISteamHTMLSurface::EHTMLMouseButton"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "MouseMove", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "x" ,"paramtype": "int"}, +{ "paramname": "y" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "MouseWheel", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "nDelta" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "KeyDown", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "nNativeKeyCode" ,"paramtype": "uint32"}, +{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "KeyUp", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "nNativeKeyCode" ,"paramtype": "uint32"}, +{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "KeyChar", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "cUnicodeChar" ,"paramtype": "uint32"}, +{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetHorizontalScroll", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "nAbsolutePixelScroll" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetVerticalScroll", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "nAbsolutePixelScroll" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetKeyFocus", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "bHasKeyFocus" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "ViewSource", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "CopyToClipboard", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "PasteFromClipboard", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "Find", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "pchSearchStr" ,"paramtype": "const char *"}, +{ "paramname": "bCurrentlyInFind" ,"paramtype": "bool"}, +{ "paramname": "bReverse" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "StopFind", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "GetLinkAtPosition", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "x" ,"paramtype": "int"}, +{ "paramname": "y" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetCookie", + "returntype": "void", + "params": [ +{ "paramname": "pchHostname" ,"paramtype": "const char *"}, +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"}, +{ "paramname": "pchPath" ,"paramtype": "const char *"}, +{ "paramname": "nExpires" ,"paramtype": "RTime32"}, +{ "paramname": "bSecure" ,"paramtype": "bool"}, +{ "paramname": "bHTTPOnly" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetPageScaleFactor", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "flZoom" ,"paramtype": "float"}, +{ "paramname": "nPointX" ,"paramtype": "int"}, +{ "paramname": "nPointY" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "SetBackgroundMode", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "bBackgroundMode" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "AllowStartRequest", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "bAllowed" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "JSDialogResponse", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "bResult" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamHTMLSurface", + "methodname": "FileLoadDialogResponse", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, +{ "paramname": "pchSelectedFiles" ,"paramtype": "const char **"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GetResultStatus", "desc": "Find out the status of an asynchronous inventory result handle.", + "returntype": "EResult", + "params": [ +{ "paramname": "resultHandle" ,"paramtype": "SteamInventoryResult_t"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GetResultItems", "desc": "Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.", + "returntype": "bool", + "params": [ +{ "paramname": "resultHandle" ,"paramtype": "SteamInventoryResult_t"}, +{ "paramname": "pOutItemsArray" ,"out_array_count": "punOutItemsArraySize" ,"desc": "Output array" ,"paramtype": "struct SteamItemDetails_t *"}, +{ "paramname": "punOutItemsArraySize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GetResultTimestamp", "desc": "Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.", + "returntype": "uint32", + "params": [ +{ "paramname": "resultHandle" ,"paramtype": "SteamInventoryResult_t"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "CheckResultSteamID", "desc": "Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.", + "returntype": "bool", + "params": [ +{ "paramname": "resultHandle" ,"paramtype": "SteamInventoryResult_t"}, +{ "paramname": "steamIDExpected" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "DestroyResult", "desc": "Destroys a result handle and frees all associated memory.", + "returntype": "void", + "params": [ +{ "paramname": "resultHandle" ,"paramtype": "SteamInventoryResult_t"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GetAllItems", "desc": "Captures the entire state of the current users Steam inventory.", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GetItemsByID", "desc": "Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "pInstanceIDs" ,"array_count": "unCountInstanceIDs" ,"paramtype": "const SteamItemInstanceID_t *"}, +{ "paramname": "unCountInstanceIDs" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "SerializeResult", + "returntype": "bool", + "params": [ +{ "paramname": "resultHandle" ,"paramtype": "SteamInventoryResult_t"}, +{ "paramname": "pOutBuffer" ,"out_buffer_count": "punOutBufferSize" ,"paramtype": "void *"}, +{ "paramname": "punOutBufferSize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "DeserializeResult", + "returntype": "bool", + "params": [ +{ "paramname": "pOutResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "pBuffer" ,"buffer_count": "punOutBufferSize" ,"paramtype": "const void *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32"}, +{ "paramname": "bRESERVED_MUST_BE_FALSE" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GenerateItems", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "pArrayItemDefs" ,"array_count": "unArrayLength" ,"paramtype": "const SteamItemDef_t *"}, +{ "paramname": "punArrayQuantity" ,"array_count": "unArrayLength" ,"paramtype": "const uint32 *"}, +{ "paramname": "unArrayLength" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GrantPromoItems", "desc": "GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "AddPromoItem", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "itemDef" ,"paramtype": "SteamItemDef_t"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "AddPromoItems", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "pArrayItemDefs" ,"array_count": "unArrayLength" ,"paramtype": "const SteamItemDef_t *"}, +{ "paramname": "unArrayLength" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "ConsumeItem", "desc": "ConsumeItem() removes items from the inventory permanently.", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "itemConsume" ,"paramtype": "SteamItemInstanceID_t"}, +{ "paramname": "unQuantity" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "ExchangeItems", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "pArrayGenerate" ,"array_count": "unArrayGenerateLength" ,"paramtype": "const SteamItemDef_t *"}, +{ "paramname": "punArrayGenerateQuantity" ,"array_count": "unArrayGenerateLength" ,"paramtype": "const uint32 *"}, +{ "paramname": "unArrayGenerateLength" ,"paramtype": "uint32"}, +{ "paramname": "pArrayDestroy" ,"array_count": "unArrayDestroyLength" ,"paramtype": "const SteamItemInstanceID_t *"}, +{ "paramname": "punArrayDestroyQuantity" ,"array_count": "unArrayDestroyLength" ,"paramtype": "const uint32 *"}, +{ "paramname": "unArrayDestroyLength" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "TransferItemQuantity", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "itemIdSource" ,"paramtype": "SteamItemInstanceID_t"}, +{ "paramname": "unQuantity" ,"paramtype": "uint32"}, +{ "paramname": "itemIdDest" ,"paramtype": "SteamItemInstanceID_t"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "SendItemDropHeartbeat", "desc": "Applications which use timed-drop mechanics should call SendItemDropHeartbeat() when active gameplay begins and at least once every two minutes afterwards.", + "returntype": "void" +} +,{ + "classname": "ISteamInventory", + "methodname": "TriggerItemDrop", "desc": "Playtime credit must be consumed and turned into item drops by your game.", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "dropListDefinition" ,"paramtype": "SteamItemDef_t"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "TradeItems", + "returntype": "bool", + "params": [ +{ "paramname": "pResultHandle" ,"paramtype": "SteamInventoryResult_t *"}, +{ "paramname": "steamIDTradePartner" ,"paramtype": "class CSteamID"}, +{ "paramname": "pArrayGive" ,"array_count": "nArrayGiveLength" ,"paramtype": "const SteamItemInstanceID_t *"}, +{ "paramname": "pArrayGiveQuantity" ,"array_count": "nArrayGiveLength" ,"paramtype": "const uint32 *"}, +{ "paramname": "nArrayGiveLength" ,"paramtype": "uint32"}, +{ "paramname": "pArrayGet" ,"array_count": "nArrayGetLength" ,"paramtype": "const SteamItemInstanceID_t *"}, +{ "paramname": "pArrayGetQuantity" ,"array_count": "nArrayGetLength" ,"paramtype": "const uint32 *"}, +{ "paramname": "nArrayGetLength" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "LoadItemDefinitions", "desc": "LoadItemDefinitions triggers the automatic load and refresh of item definitions.", + "returntype": "bool" +} +,{ + "classname": "ISteamInventory", + "methodname": "GetItemDefinitionIDs", + "returntype": "bool", + "params": [ +{ "paramname": "pItemDefIDs" ,"out_array_count": "punItemDefIDsArraySize" ,"desc": "List of item definition IDs" ,"paramtype": "SteamItemDef_t *"}, +{ "paramname": "punItemDefIDsArraySize" ,"desc": "Size of array is passed in and actual size used is returned in this param" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamInventory", + "methodname": "GetItemDefinitionProperty", + "returntype": "bool", + "params": [ +{ "paramname": "iDefinition" ,"paramtype": "SteamItemDef_t"}, +{ "paramname": "pchPropertyName" ,"paramtype": "const char *"}, +{ "paramname": "pchValueBuffer" ,"out_string_count": "punValueBufferSize" ,"paramtype": "char *"}, +{ "paramname": "punValueBufferSize" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamVideo", + "methodname": "GetVideoURL", + "returntype": "void", + "params": [ +{ "paramname": "unVideoAppID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamVideo", + "methodname": "IsBroadcasting", + "returntype": "bool", + "params": [ +{ "paramname": "pnNumViewers" ,"paramtype": "int *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "InitGameServer", + "returntype": "bool", + "params": [ +{ "paramname": "unIP" ,"paramtype": "uint32"}, +{ "paramname": "usGamePort" ,"paramtype": "uint16"}, +{ "paramname": "usQueryPort" ,"paramtype": "uint16"}, +{ "paramname": "unFlags" ,"paramtype": "uint32"}, +{ "paramname": "nGameAppId" ,"paramtype": "AppId_t"}, +{ "paramname": "pchVersionString" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetProduct", + "returntype": "void", + "params": [ +{ "paramname": "pszProduct" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetGameDescription", + "returntype": "void", + "params": [ +{ "paramname": "pszGameDescription" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetModDir", + "returntype": "void", + "params": [ +{ "paramname": "pszModDir" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetDedicatedServer", + "returntype": "void", + "params": [ +{ "paramname": "bDedicated" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "LogOn", + "returntype": "void", + "params": [ +{ "paramname": "pszToken" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "LogOnAnonymous", + "returntype": "void" +} +,{ + "classname": "ISteamGameServer", + "methodname": "LogOff", + "returntype": "void" +} +,{ + "classname": "ISteamGameServer", + "methodname": "BLoggedOn", + "returntype": "bool" +} +,{ + "classname": "ISteamGameServer", + "methodname": "BSecure", + "returntype": "bool" +} +,{ + "classname": "ISteamGameServer", + "methodname": "GetSteamID", + "returntype": "class CSteamID" +} +,{ + "classname": "ISteamGameServer", + "methodname": "WasRestartRequested", + "returntype": "bool" +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetMaxPlayerCount", + "returntype": "void", + "params": [ +{ "paramname": "cPlayersMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetBotPlayerCount", + "returntype": "void", + "params": [ +{ "paramname": "cBotplayers" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetServerName", + "returntype": "void", + "params": [ +{ "paramname": "pszServerName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetMapName", + "returntype": "void", + "params": [ +{ "paramname": "pszMapName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetPasswordProtected", + "returntype": "void", + "params": [ +{ "paramname": "bPasswordProtected" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetSpectatorPort", + "returntype": "void", + "params": [ +{ "paramname": "unSpectatorPort" ,"paramtype": "uint16"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetSpectatorServerName", + "returntype": "void", + "params": [ +{ "paramname": "pszSpectatorServerName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "ClearAllKeyValues", + "returntype": "void" +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetKeyValue", + "returntype": "void", + "params": [ +{ "paramname": "pKey" ,"paramtype": "const char *"}, +{ "paramname": "pValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetGameTags", + "returntype": "void", + "params": [ +{ "paramname": "pchGameTags" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetGameData", + "returntype": "void", + "params": [ +{ "paramname": "pchGameData" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetRegion", + "returntype": "void", + "params": [ +{ "paramname": "pszRegion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SendUserConnectAndAuthenticate", + "returntype": "bool", + "params": [ +{ "paramname": "unIPClient" ,"paramtype": "uint32"}, +{ "paramname": "pvAuthBlob" ,"paramtype": "const void *"}, +{ "paramname": "cubAuthBlobSize" ,"paramtype": "uint32"}, +{ "paramname": "pSteamIDUser" ,"paramtype": "class CSteamID *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "CreateUnauthenticatedUserConnection", + "returntype": "class CSteamID" +} +,{ + "classname": "ISteamGameServer", + "methodname": "SendUserDisconnect", + "returntype": "void", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "BUpdateUserData", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchPlayerName" ,"paramtype": "const char *"}, +{ "paramname": "uScore" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "GetAuthSessionTicket", + "returntype": "HAuthTicket", + "params": [ +{ "paramname": "pTicket" ,"paramtype": "void *"}, +{ "paramname": "cbMaxTicket" ,"paramtype": "int"}, +{ "paramname": "pcbTicket" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "BeginAuthSession", + "returntype": "EBeginAuthSessionResult", + "params": [ +{ "paramname": "pAuthTicket" ,"paramtype": "const void *"}, +{ "paramname": "cbAuthTicket" ,"paramtype": "int"}, +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "EndAuthSession", + "returntype": "void", + "params": [ +{ "paramname": "steamID" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "CancelAuthTicket", + "returntype": "void", + "params": [ +{ "paramname": "hAuthTicket" ,"paramtype": "HAuthTicket"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "UserHasLicenseForApp", + "returntype": "EUserHasLicenseForAppResult", + "params": [ +{ "paramname": "steamID" ,"paramtype": "class CSteamID"}, +{ "paramname": "appID" ,"paramtype": "AppId_t"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "RequestUserGroupStatus", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "steamIDGroup" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "GetGameplayStats", + "returntype": "void" +} +,{ + "classname": "ISteamGameServer", + "methodname": "GetServerReputation", + "returntype": "SteamAPICall_t" +} +,{ + "classname": "ISteamGameServer", + "methodname": "GetPublicIP", + "returntype": "uint32" +} +,{ + "classname": "ISteamGameServer", + "methodname": "HandleIncomingPacket", + "returntype": "bool", + "params": [ +{ "paramname": "pData" ,"paramtype": "const void *"}, +{ "paramname": "cbData" ,"paramtype": "int"}, +{ "paramname": "srcIP" ,"paramtype": "uint32"}, +{ "paramname": "srcPort" ,"paramtype": "uint16"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "GetNextOutgoingPacket", + "returntype": "int", + "params": [ +{ "paramname": "pOut" ,"paramtype": "void *"}, +{ "paramname": "cbMaxOut" ,"paramtype": "int"}, +{ "paramname": "pNetAdr" ,"paramtype": "uint32 *"}, +{ "paramname": "pPort" ,"paramtype": "uint16 *"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "EnableHeartbeats", + "returntype": "void", + "params": [ +{ "paramname": "bActive" ,"paramtype": "bool"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "SetHeartbeatInterval", + "returntype": "void", + "params": [ +{ "paramname": "iHeartbeatInterval" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "ForceHeartbeat", + "returntype": "void" +} +,{ + "classname": "ISteamGameServer", + "methodname": "AssociateWithClan", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServer", + "methodname": "ComputeNewPlayerCompatibility", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDNewPlayer" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "RequestUserStats", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "GetUserStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "int32 *"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "GetUserStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pData" ,"paramtype": "float *"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "GetUserAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "pbAchieved" ,"paramtype": "bool *"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "SetUserStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "nData" ,"paramtype": "int32"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "SetUserStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "fData" ,"paramtype": "float"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "UpdateUserAvgRateStat", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"}, +{ "paramname": "flCountThisSession" ,"paramtype": "float"}, +{ "paramname": "dSessionLength" ,"paramtype": "double"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "SetUserAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "ClearUserAchievement", + "returntype": "bool", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameServerStats", + "methodname": "StoreUserStats", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +] +} \ No newline at end of file diff --git a/public/steam/steam_api_flat.h b/public/steam/steam_api_flat.h new file mode 100644 index 000000000..0039a8b19 --- /dev/null +++ b/public/steam/steam_api_flat.h @@ -0,0 +1,657 @@ +//====== Copyright (c) 1996-2014, Valve Corporation, All rights reserved. ======= +// +// Purpose: Header for flatted SteamAPI. Use this for binding to other languages. +// This file is auto-generated, do not edit it. +// +//============================================================================= + +#ifndef STEAMAPIFLAT_H +#define STEAMAPIFLAT_H +#ifdef _WIN32 +#pragma once +#endif + +#include + + +S_API HSteamPipe SteamAPI_ISteamClient_CreateSteamPipe(intptr_t instancePtr); +S_API bool SteamAPI_ISteamClient_BReleaseSteamPipe(intptr_t instancePtr, HSteamPipe hSteamPipe); +S_API HSteamUser SteamAPI_ISteamClient_ConnectToGlobalUser(intptr_t instancePtr, HSteamPipe hSteamPipe); +S_API HSteamUser SteamAPI_ISteamClient_CreateLocalUser(intptr_t instancePtr, HSteamPipe * phSteamPipe, EAccountType eAccountType); +S_API void SteamAPI_ISteamClient_ReleaseUser(intptr_t instancePtr, HSteamPipe hSteamPipe, HSteamUser hUser); +S_API class ISteamUser * SteamAPI_ISteamClient_GetISteamUser(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamGameServer * SteamAPI_ISteamClient_GetISteamGameServer(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API void SteamAPI_ISteamClient_SetLocalIPBinding(intptr_t instancePtr, uint32 unIP, uint16 usPort); +S_API class ISteamFriends * SteamAPI_ISteamClient_GetISteamFriends(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamUtils * SteamAPI_ISteamClient_GetISteamUtils(intptr_t instancePtr, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamMatchmaking * SteamAPI_ISteamClient_GetISteamMatchmaking(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamMatchmakingServers * SteamAPI_ISteamClient_GetISteamMatchmakingServers(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API void * SteamAPI_ISteamClient_GetISteamGenericInterface(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamUserStats * SteamAPI_ISteamClient_GetISteamUserStats(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamGameServerStats * SteamAPI_ISteamClient_GetISteamGameServerStats(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamApps * SteamAPI_ISteamClient_GetISteamApps(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamNetworking * SteamAPI_ISteamClient_GetISteamNetworking(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamRemoteStorage * SteamAPI_ISteamClient_GetISteamRemoteStorage(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamScreenshots * SteamAPI_ISteamClient_GetISteamScreenshots(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API void SteamAPI_ISteamClient_RunFrame(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamClient_GetIPCCallCount(intptr_t instancePtr); +S_API void SteamAPI_ISteamClient_SetWarningMessageHook(intptr_t instancePtr, SteamAPIWarningMessageHook_t pFunction); +S_API bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(intptr_t instancePtr); +S_API class ISteamHTTP * SteamAPI_ISteamClient_GetISteamHTTP(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamUnifiedMessages * SteamAPI_ISteamClient_GetISteamUnifiedMessages(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamController * SteamAPI_ISteamClient_GetISteamController(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamUGC * SteamAPI_ISteamClient_GetISteamUGC(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamAppList * SteamAPI_ISteamClient_GetISteamAppList(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamMusic * SteamAPI_ISteamClient_GetISteamMusic(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamMusicRemote * SteamAPI_ISteamClient_GetISteamMusicRemote(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamHTMLSurface * SteamAPI_ISteamClient_GetISteamHTMLSurface(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API void SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess(intptr_t instancePtr, SteamAPI_PostAPIResultInProcess_t func); +S_API void SteamAPI_ISteamClient_Remove_SteamAPI_CPostAPIResultInProcess(intptr_t instancePtr, SteamAPI_PostAPIResultInProcess_t func); +S_API void SteamAPI_ISteamClient_Set_SteamAPI_CCheckCallbackRegisteredInProcess(intptr_t instancePtr, SteamAPI_CheckCallbackRegistered_t func); +S_API class ISteamInventory * SteamAPI_ISteamClient_GetISteamInventory(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamVideo * SteamAPI_ISteamClient_GetISteamVideo(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser(intptr_t instancePtr); +S_API bool SteamAPI_ISteamUser_BLoggedOn(intptr_t instancePtr); +S_API uint64 SteamAPI_ISteamUser_GetSteamID(intptr_t instancePtr); +S_API int SteamAPI_ISteamUser_InitiateGameConnection(intptr_t instancePtr, void * pAuthBlob, int cbMaxAuthBlob, class CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure); +S_API void SteamAPI_ISteamUser_TerminateGameConnection(intptr_t instancePtr, uint32 unIPServer, uint16 usPortServer); +S_API void SteamAPI_ISteamUser_TrackAppUsageEvent(intptr_t instancePtr, class CGameID gameID, int eAppUsageEvent, const char * pchExtraInfo); +S_API bool SteamAPI_ISteamUser_GetUserDataFolder(intptr_t instancePtr, char * pchBuffer, int cubBuffer); +S_API void SteamAPI_ISteamUser_StartVoiceRecording(intptr_t instancePtr); +S_API void SteamAPI_ISteamUser_StopVoiceRecording(intptr_t instancePtr); +S_API EVoiceResult SteamAPI_ISteamUser_GetAvailableVoice(intptr_t instancePtr, uint32 * pcbCompressed, uint32 * pcbUncompressed, uint32 nUncompressedVoiceDesiredSampleRate); +S_API EVoiceResult SteamAPI_ISteamUser_GetVoice(intptr_t instancePtr, bool bWantCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, bool bWantUncompressed, void * pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 * nUncompressBytesWritten, uint32 nUncompressedVoiceDesiredSampleRate); +S_API EVoiceResult SteamAPI_ISteamUser_DecompressVoice(intptr_t instancePtr, const void * pCompressed, uint32 cbCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, uint32 nDesiredSampleRate); +S_API uint32 SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(intptr_t instancePtr); +S_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket(intptr_t instancePtr, void * pTicket, int cbMaxTicket, uint32 * pcbTicket); +S_API EBeginAuthSessionResult SteamAPI_ISteamUser_BeginAuthSession(intptr_t instancePtr, const void * pAuthTicket, int cbAuthTicket, class CSteamID steamID); +S_API void SteamAPI_ISteamUser_EndAuthSession(intptr_t instancePtr, class CSteamID steamID); +S_API void SteamAPI_ISteamUser_CancelAuthTicket(intptr_t instancePtr, HAuthTicket hAuthTicket); +S_API EUserHasLicenseForAppResult SteamAPI_ISteamUser_UserHasLicenseForApp(intptr_t instancePtr, class CSteamID steamID, AppId_t appID); +S_API bool SteamAPI_ISteamUser_BIsBehindNAT(intptr_t instancePtr); +S_API void SteamAPI_ISteamUser_AdvertiseGame(intptr_t instancePtr, class CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer); +S_API SteamAPICall_t SteamAPI_ISteamUser_RequestEncryptedAppTicket(intptr_t instancePtr, void * pDataToInclude, int cbDataToInclude); +S_API bool SteamAPI_ISteamUser_GetEncryptedAppTicket(intptr_t instancePtr, void * pTicket, int cbMaxTicket, uint32 * pcbTicket); +S_API int SteamAPI_ISteamUser_GetGameBadgeLevel(intptr_t instancePtr, int nSeries, bool bFoil); +S_API int SteamAPI_ISteamUser_GetPlayerSteamLevel(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamUser_RequestStoreAuthURL(intptr_t instancePtr, const char * pchRedirectURL); +S_API const char * SteamAPI_ISteamFriends_GetPersonaName(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamFriends_SetPersonaName(intptr_t instancePtr, const char * pchPersonaName); +S_API EPersonaState SteamAPI_ISteamFriends_GetPersonaState(intptr_t instancePtr); +S_API int SteamAPI_ISteamFriends_GetFriendCount(intptr_t instancePtr, int iFriendFlags); +S_API uint64 SteamAPI_ISteamFriends_GetFriendByIndex(intptr_t instancePtr, int iFriend, int iFriendFlags); +S_API EFriendRelationship SteamAPI_ISteamFriends_GetFriendRelationship(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API EPersonaState SteamAPI_ISteamFriends_GetFriendPersonaState(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API const char * SteamAPI_ISteamFriends_GetFriendPersonaName(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API bool SteamAPI_ISteamFriends_GetFriendGamePlayed(intptr_t instancePtr, class CSteamID steamIDFriend, struct FriendGameInfo_t * pFriendGameInfo); +S_API const char * SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(intptr_t instancePtr, class CSteamID steamIDFriend, int iPersonaName); +S_API int SteamAPI_ISteamFriends_GetFriendSteamLevel(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API const char * SteamAPI_ISteamFriends_GetPlayerNickname(intptr_t instancePtr, class CSteamID steamIDPlayer); +S_API int SteamAPI_ISteamFriends_GetFriendsGroupCount(intptr_t instancePtr); +S_API FriendsGroupID_t SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(intptr_t instancePtr, int iFG); +S_API const char * SteamAPI_ISteamFriends_GetFriendsGroupName(intptr_t instancePtr, FriendsGroupID_t friendsGroupID); +S_API int SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(intptr_t instancePtr, FriendsGroupID_t friendsGroupID); +S_API void SteamAPI_ISteamFriends_GetFriendsGroupMembersList(intptr_t instancePtr, FriendsGroupID_t friendsGroupID, class CSteamID * pOutSteamIDMembers, int nMembersCount); +S_API bool SteamAPI_ISteamFriends_HasFriend(intptr_t instancePtr, class CSteamID steamIDFriend, int iFriendFlags); +S_API int SteamAPI_ISteamFriends_GetClanCount(intptr_t instancePtr); +S_API uint64 SteamAPI_ISteamFriends_GetClanByIndex(intptr_t instancePtr, int iClan); +S_API const char * SteamAPI_ISteamFriends_GetClanName(intptr_t instancePtr, class CSteamID steamIDClan); +S_API const char * SteamAPI_ISteamFriends_GetClanTag(intptr_t instancePtr, class CSteamID steamIDClan); +S_API bool SteamAPI_ISteamFriends_GetClanActivityCounts(intptr_t instancePtr, class CSteamID steamIDClan, int * pnOnline, int * pnInGame, int * pnChatting); +S_API SteamAPICall_t SteamAPI_ISteamFriends_DownloadClanActivityCounts(intptr_t instancePtr, class CSteamID * psteamIDClans, int cClansToRequest); +S_API int SteamAPI_ISteamFriends_GetFriendCountFromSource(intptr_t instancePtr, class CSteamID steamIDSource); +S_API uint64 SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(intptr_t instancePtr, class CSteamID steamIDSource, int iFriend); +S_API bool SteamAPI_ISteamFriends_IsUserInSource(intptr_t instancePtr, class CSteamID steamIDUser, class CSteamID steamIDSource); +S_API void SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(intptr_t instancePtr, class CSteamID steamIDUser, bool bSpeaking); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlay(intptr_t instancePtr, const char * pchDialog); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToUser(intptr_t instancePtr, const char * pchDialog, class CSteamID steamID); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(intptr_t instancePtr, const char * pchURL); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(intptr_t instancePtr, AppId_t nAppID, EOverlayToStoreFlag eFlag); +S_API void SteamAPI_ISteamFriends_SetPlayedWith(intptr_t instancePtr, class CSteamID steamIDUserPlayedWith); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API int SteamAPI_ISteamFriends_GetSmallFriendAvatar(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API int SteamAPI_ISteamFriends_GetMediumFriendAvatar(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API int SteamAPI_ISteamFriends_GetLargeFriendAvatar(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API bool SteamAPI_ISteamFriends_RequestUserInformation(intptr_t instancePtr, class CSteamID steamIDUser, bool bRequireNameOnly); +S_API SteamAPICall_t SteamAPI_ISteamFriends_RequestClanOfficerList(intptr_t instancePtr, class CSteamID steamIDClan); +S_API uint64 SteamAPI_ISteamFriends_GetClanOwner(intptr_t instancePtr, class CSteamID steamIDClan); +S_API int SteamAPI_ISteamFriends_GetClanOfficerCount(intptr_t instancePtr, class CSteamID steamIDClan); +S_API uint64 SteamAPI_ISteamFriends_GetClanOfficerByIndex(intptr_t instancePtr, class CSteamID steamIDClan, int iOfficer); +S_API uint32 SteamAPI_ISteamFriends_GetUserRestrictions(intptr_t instancePtr); +S_API bool SteamAPI_ISteamFriends_SetRichPresence(intptr_t instancePtr, const char * pchKey, const char * pchValue); +S_API void SteamAPI_ISteamFriends_ClearRichPresence(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamFriends_GetFriendRichPresence(intptr_t instancePtr, class CSteamID steamIDFriend, const char * pchKey); +S_API int SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API const char * SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(intptr_t instancePtr, class CSteamID steamIDFriend, int iKey); +S_API void SteamAPI_ISteamFriends_RequestFriendRichPresence(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API bool SteamAPI_ISteamFriends_InviteUserToGame(intptr_t instancePtr, class CSteamID steamIDFriend, const char * pchConnectString); +S_API int SteamAPI_ISteamFriends_GetCoplayFriendCount(intptr_t instancePtr); +S_API uint64 SteamAPI_ISteamFriends_GetCoplayFriend(intptr_t instancePtr, int iCoplayFriend); +S_API int SteamAPI_ISteamFriends_GetFriendCoplayTime(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API AppId_t SteamAPI_ISteamFriends_GetFriendCoplayGame(intptr_t instancePtr, class CSteamID steamIDFriend); +S_API SteamAPICall_t SteamAPI_ISteamFriends_JoinClanChatRoom(intptr_t instancePtr, class CSteamID steamIDClan); +S_API bool SteamAPI_ISteamFriends_LeaveClanChatRoom(intptr_t instancePtr, class CSteamID steamIDClan); +S_API int SteamAPI_ISteamFriends_GetClanChatMemberCount(intptr_t instancePtr, class CSteamID steamIDClan); +S_API uint64 SteamAPI_ISteamFriends_GetChatMemberByIndex(intptr_t instancePtr, class CSteamID steamIDClan, int iUser); +S_API bool SteamAPI_ISteamFriends_SendClanChatMessage(intptr_t instancePtr, class CSteamID steamIDClanChat, const char * pchText); +S_API int SteamAPI_ISteamFriends_GetClanChatMessage(intptr_t instancePtr, class CSteamID steamIDClanChat, int iMessage, void * prgchText, int cchTextMax, EChatEntryType * peChatEntryType, class CSteamID * psteamidChatter); +S_API bool SteamAPI_ISteamFriends_IsClanChatAdmin(intptr_t instancePtr, class CSteamID steamIDClanChat, class CSteamID steamIDUser); +S_API bool SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(intptr_t instancePtr, class CSteamID steamIDClanChat); +S_API bool SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(intptr_t instancePtr, class CSteamID steamIDClanChat); +S_API bool SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(intptr_t instancePtr, class CSteamID steamIDClanChat); +S_API bool SteamAPI_ISteamFriends_SetListenForFriendsMessages(intptr_t instancePtr, bool bInterceptEnabled); +S_API bool SteamAPI_ISteamFriends_ReplyToFriendMessage(intptr_t instancePtr, class CSteamID steamIDFriend, const char * pchMsgToSend); +S_API int SteamAPI_ISteamFriends_GetFriendMessage(intptr_t instancePtr, class CSteamID steamIDFriend, int iMessageID, void * pvData, int cubData, EChatEntryType * peChatEntryType); +S_API SteamAPICall_t SteamAPI_ISteamFriends_GetFollowerCount(intptr_t instancePtr, class CSteamID steamID); +S_API SteamAPICall_t SteamAPI_ISteamFriends_IsFollowing(intptr_t instancePtr, class CSteamID steamID); +S_API SteamAPICall_t SteamAPI_ISteamFriends_EnumerateFollowingList(intptr_t instancePtr, uint32 unStartIndex); +S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceAppActive(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(intptr_t instancePtr); +S_API EUniverse SteamAPI_ISteamUtils_GetConnectedUniverse(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamUtils_GetServerRealTime(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamUtils_GetIPCountry(intptr_t instancePtr); +S_API bool SteamAPI_ISteamUtils_GetImageSize(intptr_t instancePtr, int iImage, uint32 * pnWidth, uint32 * pnHeight); +S_API bool SteamAPI_ISteamUtils_GetImageRGBA(intptr_t instancePtr, int iImage, uint8 * pubDest, int nDestBufferSize); +S_API bool SteamAPI_ISteamUtils_GetCSERIPPort(intptr_t instancePtr, uint32 * unIP, uint16 * usPort); +S_API uint8 SteamAPI_ISteamUtils_GetCurrentBatteryPower(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamUtils_GetAppID(intptr_t instancePtr); +S_API void SteamAPI_ISteamUtils_SetOverlayNotificationPosition(intptr_t instancePtr, ENotificationPosition eNotificationPosition); +S_API bool SteamAPI_ISteamUtils_IsAPICallCompleted(intptr_t instancePtr, SteamAPICall_t hSteamAPICall, bool * pbFailed); +S_API ESteamAPICallFailure SteamAPI_ISteamUtils_GetAPICallFailureReason(intptr_t instancePtr, SteamAPICall_t hSteamAPICall); +S_API bool SteamAPI_ISteamUtils_GetAPICallResult(intptr_t instancePtr, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed); +S_API void SteamAPI_ISteamUtils_RunFrame(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamUtils_GetIPCCallCount(intptr_t instancePtr); +S_API void SteamAPI_ISteamUtils_SetWarningMessageHook(intptr_t instancePtr, SteamAPIWarningMessageHook_t pFunction); +S_API bool SteamAPI_ISteamUtils_IsOverlayEnabled(intptr_t instancePtr); +S_API bool SteamAPI_ISteamUtils_BOverlayNeedsPresent(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamUtils_CheckFileSignature(intptr_t instancePtr, const char * szFileName); +S_API bool SteamAPI_ISteamUtils_ShowGamepadTextInput(intptr_t instancePtr, EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char * pchDescription, uint32 unCharMax, const char * pchExistingText); +S_API uint32 SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(intptr_t instancePtr); +S_API bool SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(intptr_t instancePtr, char * pchText, uint32 cchText); +S_API const char * SteamAPI_ISteamUtils_GetSteamUILanguage(intptr_t instancePtr); +S_API bool SteamAPI_ISteamUtils_IsSteamRunningInVR(intptr_t instancePtr); +S_API void SteamAPI_ISteamUtils_SetOverlayNotificationInset(intptr_t instancePtr, int nHorizontalInset, int nVerticalInset); +S_API int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMatchmaking_GetFavoriteGame(intptr_t instancePtr, int iGame, AppId_t * pnAppID, uint32 * pnIP, uint16 * pnConnPort, uint16 * pnQueryPort, uint32 * punFlags, uint32 * pRTime32LastPlayedOnServer); +S_API int SteamAPI_ISteamMatchmaking_AddFavoriteGame(intptr_t instancePtr, AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer); +S_API bool SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(intptr_t instancePtr, AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags); +S_API SteamAPICall_t SteamAPI_ISteamMatchmaking_RequestLobbyList(intptr_t instancePtr); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(intptr_t instancePtr, const char * pchKeyToMatch, const char * pchValueToMatch, ELobbyComparison eComparisonType); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(intptr_t instancePtr, const char * pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(intptr_t instancePtr, const char * pchKeyToMatch, int nValueToBeCloseTo); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(intptr_t instancePtr, int nSlotsAvailable); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(intptr_t instancePtr, ELobbyDistanceFilter eLobbyDistanceFilter); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(intptr_t instancePtr, int cMaxResults); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API uint64 SteamAPI_ISteamMatchmaking_GetLobbyByIndex(intptr_t instancePtr, int iLobby); +S_API SteamAPICall_t SteamAPI_ISteamMatchmaking_CreateLobby(intptr_t instancePtr, ELobbyType eLobbyType, int cMaxMembers); +S_API SteamAPICall_t SteamAPI_ISteamMatchmaking_JoinLobby(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API void SteamAPI_ISteamMatchmaking_LeaveLobby(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API bool SteamAPI_ISteamMatchmaking_InviteUserToLobby(intptr_t instancePtr, class CSteamID steamIDLobby, class CSteamID steamIDInvitee); +S_API int SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API uint64 SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(intptr_t instancePtr, class CSteamID steamIDLobby, int iMember); +S_API const char * SteamAPI_ISteamMatchmaking_GetLobbyData(intptr_t instancePtr, class CSteamID steamIDLobby, const char * pchKey); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyData(intptr_t instancePtr, class CSteamID steamIDLobby, const char * pchKey, const char * pchValue); +S_API int SteamAPI_ISteamMatchmaking_GetLobbyDataCount(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API bool SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(intptr_t instancePtr, class CSteamID steamIDLobby, int iLobbyData, char * pchKey, int cchKeyBufferSize, char * pchValue, int cchValueBufferSize); +S_API bool SteamAPI_ISteamMatchmaking_DeleteLobbyData(intptr_t instancePtr, class CSteamID steamIDLobby, const char * pchKey); +S_API const char * SteamAPI_ISteamMatchmaking_GetLobbyMemberData(intptr_t instancePtr, class CSteamID steamIDLobby, class CSteamID steamIDUser, const char * pchKey); +S_API void SteamAPI_ISteamMatchmaking_SetLobbyMemberData(intptr_t instancePtr, class CSteamID steamIDLobby, const char * pchKey, const char * pchValue); +S_API bool SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(intptr_t instancePtr, class CSteamID steamIDLobby, const void * pvMsgBody, int cubMsgBody); +S_API int SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(intptr_t instancePtr, class CSteamID steamIDLobby, int iChatID, class CSteamID * pSteamIDUser, void * pvData, int cubData, EChatEntryType * peChatEntryType); +S_API bool SteamAPI_ISteamMatchmaking_RequestLobbyData(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API void SteamAPI_ISteamMatchmaking_SetLobbyGameServer(intptr_t instancePtr, class CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, class CSteamID steamIDGameServer); +S_API bool SteamAPI_ISteamMatchmaking_GetLobbyGameServer(intptr_t instancePtr, class CSteamID steamIDLobby, uint32 * punGameServerIP, uint16 * punGameServerPort, class CSteamID * psteamIDGameServer); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(intptr_t instancePtr, class CSteamID steamIDLobby, int cMaxMembers); +S_API int SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyType(intptr_t instancePtr, class CSteamID steamIDLobby, ELobbyType eLobbyType); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyJoinable(intptr_t instancePtr, class CSteamID steamIDLobby, bool bLobbyJoinable); +S_API uint64 SteamAPI_ISteamMatchmaking_GetLobbyOwner(intptr_t instancePtr, class CSteamID steamIDLobby); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyOwner(intptr_t instancePtr, class CSteamID steamIDLobby, class CSteamID steamIDNewOwner); +S_API bool SteamAPI_ISteamMatchmaking_SetLinkedLobby(intptr_t instancePtr, class CSteamID steamIDLobby, class CSteamID steamIDLobbyDependent); +S_API void SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded(intptr_t instancePtr, HServerListRequest hRequest, int iServer); +S_API void SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond(intptr_t instancePtr, HServerListRequest hRequest, int iServer); +S_API void SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete(intptr_t instancePtr, HServerListRequest hRequest, EMatchMakingServerResponse response); +S_API void SteamAPI_ISteamMatchmakingPingResponse_ServerResponded(intptr_t instancePtr, class gameserveritem_t & server); +S_API void SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond(intptr_t instancePtr); +S_API void SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList(intptr_t instancePtr, const char * pchName, int nScore, float flTimePlayed); +S_API void SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond(intptr_t instancePtr); +S_API void SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete(intptr_t instancePtr); +S_API void SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded(intptr_t instancePtr, const char * pchRule, const char * pchValue); +S_API void SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond(intptr_t instancePtr); +S_API void SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete(intptr_t instancePtr); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(intptr_t instancePtr, AppId_t iApp, struct MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, class ISteamMatchmakingServerListResponse * pRequestServersResponse); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestLANServerList(intptr_t instancePtr, AppId_t iApp, class ISteamMatchmakingServerListResponse * pRequestServersResponse); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(intptr_t instancePtr, AppId_t iApp, struct MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, class ISteamMatchmakingServerListResponse * pRequestServersResponse); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(intptr_t instancePtr, AppId_t iApp, struct MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, class ISteamMatchmakingServerListResponse * pRequestServersResponse); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(intptr_t instancePtr, AppId_t iApp, struct MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, class ISteamMatchmakingServerListResponse * pRequestServersResponse); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(intptr_t instancePtr, AppId_t iApp, struct MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, class ISteamMatchmakingServerListResponse * pRequestServersResponse); +S_API void SteamAPI_ISteamMatchmakingServers_ReleaseRequest(intptr_t instancePtr, HServerListRequest hServerListRequest); +S_API class gameserveritem_t * SteamAPI_ISteamMatchmakingServers_GetServerDetails(intptr_t instancePtr, HServerListRequest hRequest, int iServer); +S_API void SteamAPI_ISteamMatchmakingServers_CancelQuery(intptr_t instancePtr, HServerListRequest hRequest); +S_API void SteamAPI_ISteamMatchmakingServers_RefreshQuery(intptr_t instancePtr, HServerListRequest hRequest); +S_API bool SteamAPI_ISteamMatchmakingServers_IsRefreshing(intptr_t instancePtr, HServerListRequest hRequest); +S_API int SteamAPI_ISteamMatchmakingServers_GetServerCount(intptr_t instancePtr, HServerListRequest hRequest); +S_API void SteamAPI_ISteamMatchmakingServers_RefreshServer(intptr_t instancePtr, HServerListRequest hRequest, int iServer); +S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PingServer(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingPingResponse * pRequestServersResponse); +S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PlayerDetails(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingPlayersResponse * pRequestServersResponse); +S_API HServerQuery SteamAPI_ISteamMatchmakingServers_ServerRules(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingRulesResponse * pRequestServersResponse); +S_API void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(intptr_t instancePtr, HServerQuery hServerQuery); +S_API bool SteamAPI_ISteamRemoteStorage_FileWrite(intptr_t instancePtr, const char * pchFile, const void * pvData, int32 cubData); +S_API int32 SteamAPI_ISteamRemoteStorage_FileRead(intptr_t instancePtr, const char * pchFile, void * pvData, int32 cubDataToRead); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileWriteAsync(intptr_t instancePtr, const char * pchFile, const void * pvData, uint32 cubData); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileReadAsync(intptr_t instancePtr, const char * pchFile, uint32 nOffset, uint32 cubToRead); +S_API bool SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(intptr_t instancePtr, SteamAPICall_t hReadCall, void * pvBuffer, uint32 cubToRead); +S_API bool SteamAPI_ISteamRemoteStorage_FileForget(intptr_t instancePtr, const char * pchFile); +S_API bool SteamAPI_ISteamRemoteStorage_FileDelete(intptr_t instancePtr, const char * pchFile); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileShare(intptr_t instancePtr, const char * pchFile); +S_API bool SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(intptr_t instancePtr, const char * pchFile, ERemoteStoragePlatform eRemoteStoragePlatform); +S_API UGCFileWriteStreamHandle_t SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(intptr_t instancePtr, const char * pchFile); +S_API bool SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(intptr_t instancePtr, UGCFileWriteStreamHandle_t writeHandle, const void * pvData, int32 cubData); +S_API bool SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(intptr_t instancePtr, UGCFileWriteStreamHandle_t writeHandle); +S_API bool SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(intptr_t instancePtr, UGCFileWriteStreamHandle_t writeHandle); +S_API bool SteamAPI_ISteamRemoteStorage_FileExists(intptr_t instancePtr, const char * pchFile); +S_API bool SteamAPI_ISteamRemoteStorage_FilePersisted(intptr_t instancePtr, const char * pchFile); +S_API int32 SteamAPI_ISteamRemoteStorage_GetFileSize(intptr_t instancePtr, const char * pchFile); +S_API int64 SteamAPI_ISteamRemoteStorage_GetFileTimestamp(intptr_t instancePtr, const char * pchFile); +S_API ERemoteStoragePlatform SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(intptr_t instancePtr, const char * pchFile); +S_API int32 SteamAPI_ISteamRemoteStorage_GetFileCount(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(intptr_t instancePtr, int iFile, int32 * pnFileSizeInBytes); +S_API bool SteamAPI_ISteamRemoteStorage_GetQuota(intptr_t instancePtr, int32 * pnTotalBytes, int32 * puAvailableBytes); +S_API bool SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(intptr_t instancePtr); +S_API bool SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(intptr_t instancePtr); +S_API void SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(intptr_t instancePtr, bool bEnabled); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UGCDownload(intptr_t instancePtr, UGCHandle_t hContent, uint32 unPriority); +S_API bool SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(intptr_t instancePtr, UGCHandle_t hContent, int32 * pnBytesDownloaded, int32 * pnBytesExpected); +S_API bool SteamAPI_ISteamRemoteStorage_GetUGCDetails(intptr_t instancePtr, UGCHandle_t hContent, AppId_t * pnAppID, char ** ppchName, int32 * pnFileSizeInBytes, class CSteamID * pSteamIDOwner); +S_API int32 SteamAPI_ISteamRemoteStorage_UGCRead(intptr_t instancePtr, UGCHandle_t hContent, void * pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction); +S_API int32 SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(intptr_t instancePtr); +S_API UGCHandle_t SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(intptr_t instancePtr, int32 iCachedContent); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(intptr_t instancePtr, const char * pchFile, const char * pchPreviewFile, AppId_t nConsumerAppId, const char * pchTitle, const char * pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, struct SteamParamStringArray_t * pTags, EWorkshopFileType eWorkshopFileType); +S_API PublishedFileUpdateHandle_t SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(intptr_t instancePtr, PublishedFileId_t unPublishedFileId); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, const char * pchFile); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, const char * pchPreviewFile); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, const char * pchTitle); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, const char * pchDescription); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, struct SteamParamStringArray_t * pTags); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(intptr_t instancePtr, PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_DeletePublishedFile(intptr_t instancePtr, PublishedFileId_t unPublishedFileId); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(intptr_t instancePtr, uint32 unStartIndex); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(intptr_t instancePtr, PublishedFileId_t unPublishedFileId); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(intptr_t instancePtr, uint32 unStartIndex); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(intptr_t instancePtr, PublishedFileId_t unPublishedFileId); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(intptr_t instancePtr, PublishedFileUpdateHandle_t updateHandle, const char * pchChangeDescription); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(intptr_t instancePtr, PublishedFileId_t unPublishedFileId); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(intptr_t instancePtr, PublishedFileId_t unPublishedFileId, bool bVoteUp); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(intptr_t instancePtr, PublishedFileId_t unPublishedFileId); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(intptr_t instancePtr, class CSteamID steamId, uint32 unStartIndex, struct SteamParamStringArray_t * pRequiredTags, struct SteamParamStringArray_t * pExcludedTags); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_PublishVideo(intptr_t instancePtr, EWorkshopVideoProvider eVideoProvider, const char * pchVideoAccount, const char * pchVideoIdentifier, const char * pchPreviewFile, AppId_t nConsumerAppId, const char * pchTitle, const char * pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, struct SteamParamStringArray_t * pTags); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(intptr_t instancePtr, PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(intptr_t instancePtr, EWorkshopFileAction eAction, uint32 unStartIndex); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(intptr_t instancePtr, EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, struct SteamParamStringArray_t * pTags, struct SteamParamStringArray_t * pUserTags); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(intptr_t instancePtr, UGCHandle_t hContent, const char * pchLocation, uint32 unPriority); +S_API bool SteamAPI_ISteamUserStats_RequestCurrentStats(intptr_t instancePtr); +S_API bool SteamAPI_ISteamUserStats_GetStat(intptr_t instancePtr, const char * pchName, int32 * pData); +S_API bool SteamAPI_ISteamUserStats_GetStat0(intptr_t instancePtr, const char * pchName, float * pData); +S_API bool SteamAPI_ISteamUserStats_SetStat(intptr_t instancePtr, const char * pchName, int32 nData); +S_API bool SteamAPI_ISteamUserStats_SetStat0(intptr_t instancePtr, const char * pchName, float fData); +S_API bool SteamAPI_ISteamUserStats_UpdateAvgRateStat(intptr_t instancePtr, const char * pchName, float flCountThisSession, double dSessionLength); +S_API bool SteamAPI_ISteamUserStats_GetAchievement(intptr_t instancePtr, const char * pchName, bool * pbAchieved); +S_API bool SteamAPI_ISteamUserStats_SetAchievement(intptr_t instancePtr, const char * pchName); +S_API bool SteamAPI_ISteamUserStats_ClearAchievement(intptr_t instancePtr, const char * pchName); +S_API bool SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(intptr_t instancePtr, const char * pchName, bool * pbAchieved, uint32 * punUnlockTime); +S_API bool SteamAPI_ISteamUserStats_StoreStats(intptr_t instancePtr); +S_API int SteamAPI_ISteamUserStats_GetAchievementIcon(intptr_t instancePtr, const char * pchName); +S_API const char * SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(intptr_t instancePtr, const char * pchName, const char * pchKey); +S_API bool SteamAPI_ISteamUserStats_IndicateAchievementProgress(intptr_t instancePtr, const char * pchName, uint32 nCurProgress, uint32 nMaxProgress); +S_API uint32 SteamAPI_ISteamUserStats_GetNumAchievements(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamUserStats_GetAchievementName(intptr_t instancePtr, uint32 iAchievement); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_RequestUserStats(intptr_t instancePtr, class CSteamID steamIDUser); +S_API bool SteamAPI_ISteamUserStats_GetUserStat(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, int32 * pData); +S_API bool SteamAPI_ISteamUserStats_GetUserStat0(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, float * pData); +S_API bool SteamAPI_ISteamUserStats_GetUserAchievement(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, bool * pbAchieved); +S_API bool SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, bool * pbAchieved, uint32 * punUnlockTime); +S_API bool SteamAPI_ISteamUserStats_ResetAllStats(intptr_t instancePtr, bool bAchievementsToo); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(intptr_t instancePtr, const char * pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_FindLeaderboard(intptr_t instancePtr, const char * pchLeaderboardName); +S_API const char * SteamAPI_ISteamUserStats_GetLeaderboardName(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard); +S_API int SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard); +S_API ELeaderboardSortMethod SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard); +S_API ELeaderboardDisplayType SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard, class CSteamID * prgUsers, int cUsers); +S_API bool SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(intptr_t instancePtr, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, struct LeaderboardEntry_t * pLeaderboardEntry, int32 * pDetails, int cDetailsMax); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_UploadLeaderboardScore(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 * pScoreDetails, int cScoreDetailsCount); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_AttachLeaderboardUGC(intptr_t instancePtr, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(intptr_t instancePtr); +S_API int SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(intptr_t instancePtr, char * pchName, uint32 unNameBufLen, float * pflPercent, bool * pbAchieved); +S_API int SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(intptr_t instancePtr, int iIteratorPrevious, char * pchName, uint32 unNameBufLen, float * pflPercent, bool * pbAchieved); +S_API bool SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(intptr_t instancePtr, const char * pchName, float * pflPercent); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_RequestGlobalStats(intptr_t instancePtr, int nHistoryDays); +S_API bool SteamAPI_ISteamUserStats_GetGlobalStat(intptr_t instancePtr, const char * pchStatName, int64 * pData); +S_API bool SteamAPI_ISteamUserStats_GetGlobalStat0(intptr_t instancePtr, const char * pchStatName, double * pData); +S_API int32 SteamAPI_ISteamUserStats_GetGlobalStatHistory(intptr_t instancePtr, const char * pchStatName, int64 * pData, uint32 cubData); +S_API int32 SteamAPI_ISteamUserStats_GetGlobalStatHistory0(intptr_t instancePtr, const char * pchStatName, double * pData, uint32 cubData); +S_API bool SteamAPI_ISteamApps_BIsSubscribed(intptr_t instancePtr); +S_API bool SteamAPI_ISteamApps_BIsLowViolence(intptr_t instancePtr); +S_API bool SteamAPI_ISteamApps_BIsCybercafe(intptr_t instancePtr); +S_API bool SteamAPI_ISteamApps_BIsVACBanned(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamApps_GetCurrentGameLanguage(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamApps_GetAvailableGameLanguages(intptr_t instancePtr); +S_API bool SteamAPI_ISteamApps_BIsSubscribedApp(intptr_t instancePtr, AppId_t appID); +S_API bool SteamAPI_ISteamApps_BIsDlcInstalled(intptr_t instancePtr, AppId_t appID); +S_API uint32 SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(intptr_t instancePtr, AppId_t nAppID); +S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(intptr_t instancePtr); +S_API int SteamAPI_ISteamApps_GetDLCCount(intptr_t instancePtr); +S_API bool SteamAPI_ISteamApps_BGetDLCDataByIndex(intptr_t instancePtr, int iDLC, AppId_t * pAppID, bool * pbAvailable, char * pchName, int cchNameBufferSize); +S_API void SteamAPI_ISteamApps_InstallDLC(intptr_t instancePtr, AppId_t nAppID); +S_API void SteamAPI_ISteamApps_UninstallDLC(intptr_t instancePtr, AppId_t nAppID); +S_API void SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(intptr_t instancePtr, AppId_t nAppID); +S_API bool SteamAPI_ISteamApps_GetCurrentBetaName(intptr_t instancePtr, char * pchName, int cchNameBufferSize); +S_API bool SteamAPI_ISteamApps_MarkContentCorrupt(intptr_t instancePtr, bool bMissingFilesOnly); +S_API uint32 SteamAPI_ISteamApps_GetInstalledDepots(intptr_t instancePtr, AppId_t appID, DepotId_t * pvecDepots, uint32 cMaxDepots); +S_API uint32 SteamAPI_ISteamApps_GetAppInstallDir(intptr_t instancePtr, AppId_t appID, char * pchFolder, uint32 cchFolderBufferSize); +S_API bool SteamAPI_ISteamApps_BIsAppInstalled(intptr_t instancePtr, AppId_t appID); +S_API uint64 SteamAPI_ISteamApps_GetAppOwner(intptr_t instancePtr); +S_API const char * SteamAPI_ISteamApps_GetLaunchQueryParam(intptr_t instancePtr, const char * pchKey); +S_API bool SteamAPI_ISteamApps_GetDlcDownloadProgress(intptr_t instancePtr, AppId_t nAppID, uint64 * punBytesDownloaded, uint64 * punBytesTotal); +S_API int SteamAPI_ISteamApps_GetAppBuildId(intptr_t instancePtr); +S_API bool SteamAPI_ISteamNetworking_SendP2PPacket(intptr_t instancePtr, class CSteamID steamIDRemote, const void * pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel); +S_API bool SteamAPI_ISteamNetworking_IsP2PPacketAvailable(intptr_t instancePtr, uint32 * pcubMsgSize, int nChannel); +S_API bool SteamAPI_ISteamNetworking_ReadP2PPacket(intptr_t instancePtr, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize, class CSteamID * psteamIDRemote, int nChannel); +S_API bool SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(intptr_t instancePtr, class CSteamID steamIDRemote); +S_API bool SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(intptr_t instancePtr, class CSteamID steamIDRemote); +S_API bool SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(intptr_t instancePtr, class CSteamID steamIDRemote, int nChannel); +S_API bool SteamAPI_ISteamNetworking_GetP2PSessionState(intptr_t instancePtr, class CSteamID steamIDRemote, struct P2PSessionState_t * pConnectionState); +S_API bool SteamAPI_ISteamNetworking_AllowP2PPacketRelay(intptr_t instancePtr, bool bAllow); +S_API SNetListenSocket_t SteamAPI_ISteamNetworking_CreateListenSocket(intptr_t instancePtr, int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay); +S_API SNetSocket_t SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(intptr_t instancePtr, class CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay); +S_API SNetSocket_t SteamAPI_ISteamNetworking_CreateConnectionSocket(intptr_t instancePtr, uint32 nIP, uint16 nPort, int nTimeoutSec); +S_API bool SteamAPI_ISteamNetworking_DestroySocket(intptr_t instancePtr, SNetSocket_t hSocket, bool bNotifyRemoteEnd); +S_API bool SteamAPI_ISteamNetworking_DestroyListenSocket(intptr_t instancePtr, SNetListenSocket_t hSocket, bool bNotifyRemoteEnd); +S_API bool SteamAPI_ISteamNetworking_SendDataOnSocket(intptr_t instancePtr, SNetSocket_t hSocket, void * pubData, uint32 cubData, bool bReliable); +S_API bool SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(intptr_t instancePtr, SNetSocket_t hSocket, uint32 * pcubMsgSize); +S_API bool SteamAPI_ISteamNetworking_RetrieveDataFromSocket(intptr_t instancePtr, SNetSocket_t hSocket, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize); +S_API bool SteamAPI_ISteamNetworking_IsDataAvailable(intptr_t instancePtr, SNetListenSocket_t hListenSocket, uint32 * pcubMsgSize, SNetSocket_t * phSocket); +S_API bool SteamAPI_ISteamNetworking_RetrieveData(intptr_t instancePtr, SNetListenSocket_t hListenSocket, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize, SNetSocket_t * phSocket); +S_API bool SteamAPI_ISteamNetworking_GetSocketInfo(intptr_t instancePtr, SNetSocket_t hSocket, class CSteamID * pSteamIDRemote, int * peSocketStatus, uint32 * punIPRemote, uint16 * punPortRemote); +S_API bool SteamAPI_ISteamNetworking_GetListenSocketInfo(intptr_t instancePtr, SNetListenSocket_t hListenSocket, uint32 * pnIP, uint16 * pnPort); +S_API ESNetSocketConnectionType SteamAPI_ISteamNetworking_GetSocketConnectionType(intptr_t instancePtr, SNetSocket_t hSocket); +S_API int SteamAPI_ISteamNetworking_GetMaxPacketSize(intptr_t instancePtr, SNetSocket_t hSocket); +S_API ScreenshotHandle SteamAPI_ISteamScreenshots_WriteScreenshot(intptr_t instancePtr, void * pubRGB, uint32 cubRGB, int nWidth, int nHeight); +S_API ScreenshotHandle SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(intptr_t instancePtr, const char * pchFilename, const char * pchThumbnailFilename, int nWidth, int nHeight); +S_API void SteamAPI_ISteamScreenshots_TriggerScreenshot(intptr_t instancePtr); +S_API void SteamAPI_ISteamScreenshots_HookScreenshots(intptr_t instancePtr, bool bHook); +S_API bool SteamAPI_ISteamScreenshots_SetLocation(intptr_t instancePtr, ScreenshotHandle hScreenshot, const char * pchLocation); +S_API bool SteamAPI_ISteamScreenshots_TagUser(intptr_t instancePtr, ScreenshotHandle hScreenshot, class CSteamID steamID); +S_API bool SteamAPI_ISteamScreenshots_TagPublishedFile(intptr_t instancePtr, ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID); +S_API bool SteamAPI_ISteamMusic_BIsEnabled(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusic_BIsPlaying(intptr_t instancePtr); +S_API AudioPlayback_Status SteamAPI_ISteamMusic_GetPlaybackStatus(intptr_t instancePtr); +S_API void SteamAPI_ISteamMusic_Play(intptr_t instancePtr); +S_API void SteamAPI_ISteamMusic_Pause(intptr_t instancePtr); +S_API void SteamAPI_ISteamMusic_PlayPrevious(intptr_t instancePtr); +S_API void SteamAPI_ISteamMusic_PlayNext(intptr_t instancePtr); +S_API void SteamAPI_ISteamMusic_SetVolume(intptr_t instancePtr, float flVolume); +S_API float SteamAPI_ISteamMusic_GetVolume(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(intptr_t instancePtr, const char * pchName); +S_API bool SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_BActivationSuccess(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_SetDisplayName(intptr_t instancePtr, const char * pchDisplayName); +S_API bool SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(intptr_t instancePtr, void * pvBuffer, uint32 cbBufferLength); +S_API bool SteamAPI_ISteamMusicRemote_EnablePlayPrevious(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_EnablePlayNext(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_EnableShuffled(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_EnableLooped(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_EnableQueue(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_EnablePlaylists(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(intptr_t instancePtr, AudioPlayback_Status nStatus); +S_API bool SteamAPI_ISteamMusicRemote_UpdateShuffled(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_UpdateLooped(intptr_t instancePtr, bool bValue); +S_API bool SteamAPI_ISteamMusicRemote_UpdateVolume(intptr_t instancePtr, float flValue); +S_API bool SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(intptr_t instancePtr, bool bAvailable); +S_API bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(intptr_t instancePtr, const char * pchText); +S_API bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(intptr_t instancePtr, int nValue); +S_API bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(intptr_t instancePtr, void * pvBuffer, uint32 cbBufferLength); +S_API bool SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_QueueWillChange(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_ResetQueueEntries(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_SetQueueEntry(intptr_t instancePtr, int nID, int nPosition, const char * pchEntryText); +S_API bool SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(intptr_t instancePtr, int nID); +S_API bool SteamAPI_ISteamMusicRemote_QueueDidChange(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_PlaylistWillChange(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(intptr_t instancePtr); +S_API bool SteamAPI_ISteamMusicRemote_SetPlaylistEntry(intptr_t instancePtr, int nID, int nPosition, const char * pchEntryText); +S_API bool SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(intptr_t instancePtr, int nID); +S_API bool SteamAPI_ISteamMusicRemote_PlaylistDidChange(intptr_t instancePtr); +S_API HTTPRequestHandle SteamAPI_ISteamHTTP_CreateHTTPRequest(intptr_t instancePtr, EHTTPMethod eHTTPRequestMethod, const char * pchAbsoluteURL); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(intptr_t instancePtr, HTTPRequestHandle hRequest, uint64 ulContextValue); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(intptr_t instancePtr, HTTPRequestHandle hRequest, uint32 unTimeoutSeconds); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(intptr_t instancePtr, HTTPRequestHandle hRequest, const char * pchHeaderName, const char * pchHeaderValue); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(intptr_t instancePtr, HTTPRequestHandle hRequest, const char * pchParamName, const char * pchParamValue); +S_API bool SteamAPI_ISteamHTTP_SendHTTPRequest(intptr_t instancePtr, HTTPRequestHandle hRequest, SteamAPICall_t * pCallHandle); +S_API bool SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(intptr_t instancePtr, HTTPRequestHandle hRequest, SteamAPICall_t * pCallHandle); +S_API bool SteamAPI_ISteamHTTP_DeferHTTPRequest(intptr_t instancePtr, HTTPRequestHandle hRequest); +S_API bool SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(intptr_t instancePtr, HTTPRequestHandle hRequest); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(intptr_t instancePtr, HTTPRequestHandle hRequest, const char * pchHeaderName, uint32 * unResponseHeaderSize); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(intptr_t instancePtr, HTTPRequestHandle hRequest, const char * pchHeaderName, uint8 * pHeaderValueBuffer, uint32 unBufferSize); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(intptr_t instancePtr, HTTPRequestHandle hRequest, uint32 * unBodySize); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(intptr_t instancePtr, HTTPRequestHandle hRequest, uint8 * pBodyDataBuffer, uint32 unBufferSize); +S_API bool SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(intptr_t instancePtr, HTTPRequestHandle hRequest, uint32 cOffset, uint8 * pBodyDataBuffer, uint32 unBufferSize); +S_API bool SteamAPI_ISteamHTTP_ReleaseHTTPRequest(intptr_t instancePtr, HTTPRequestHandle hRequest); +S_API bool SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(intptr_t instancePtr, HTTPRequestHandle hRequest, float * pflPercentOut); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(intptr_t instancePtr, HTTPRequestHandle hRequest, const char * pchContentType, uint8 * pubBody, uint32 unBodyLen); +S_API HTTPCookieContainerHandle SteamAPI_ISteamHTTP_CreateCookieContainer(intptr_t instancePtr, bool bAllowResponsesToModify); +S_API bool SteamAPI_ISteamHTTP_ReleaseCookieContainer(intptr_t instancePtr, HTTPCookieContainerHandle hCookieContainer); +S_API bool SteamAPI_ISteamHTTP_SetCookie(intptr_t instancePtr, HTTPCookieContainerHandle hCookieContainer, const char * pchHost, const char * pchUrl, const char * pchCookie); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(intptr_t instancePtr, HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(intptr_t instancePtr, HTTPRequestHandle hRequest, const char * pchUserAgentInfo); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(intptr_t instancePtr, HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(intptr_t instancePtr, HTTPRequestHandle hRequest, uint32 unMilliseconds); +S_API bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(intptr_t instancePtr, HTTPRequestHandle hRequest, bool * pbWasTimedOut); +S_API ClientUnifiedMessageHandle SteamAPI_ISteamUnifiedMessages_SendMethod(intptr_t instancePtr, const char * pchServiceMethod, const void * pRequestBuffer, uint32 unRequestBufferSize, uint64 unContext); +S_API bool SteamAPI_ISteamUnifiedMessages_GetMethodResponseInfo(intptr_t instancePtr, ClientUnifiedMessageHandle hHandle, uint32 * punResponseSize, EResult * peResult); +S_API bool SteamAPI_ISteamUnifiedMessages_GetMethodResponseData(intptr_t instancePtr, ClientUnifiedMessageHandle hHandle, void * pResponseBuffer, uint32 unResponseBufferSize, bool bAutoRelease); +S_API bool SteamAPI_ISteamUnifiedMessages_ReleaseMethod(intptr_t instancePtr, ClientUnifiedMessageHandle hHandle); +S_API bool SteamAPI_ISteamUnifiedMessages_SendNotification(intptr_t instancePtr, const char * pchServiceNotification, const void * pNotificationBuffer, uint32 unNotificationBufferSize); +S_API bool SteamAPI_ISteamController_Init(intptr_t instancePtr); +S_API bool SteamAPI_ISteamController_Shutdown(intptr_t instancePtr); +S_API void SteamAPI_ISteamController_RunFrame(intptr_t instancePtr); +S_API int SteamAPI_ISteamController_GetConnectedControllers(intptr_t instancePtr, ControllerHandle_t * handlesOut); +S_API bool SteamAPI_ISteamController_ShowBindingPanel(intptr_t instancePtr, ControllerHandle_t controllerHandle); +S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetActionSetHandle(intptr_t instancePtr, const char * pszActionSetName); +S_API void SteamAPI_ISteamController_ActivateActionSet(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle); +S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetCurrentActionSet(intptr_t instancePtr, ControllerHandle_t controllerHandle); +S_API ControllerDigitalActionHandle_t SteamAPI_ISteamController_GetDigitalActionHandle(intptr_t instancePtr, const char * pszActionName); +S_API struct ControllerDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle); +S_API int SteamAPI_ISteamController_GetDigitalActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin * originsOut); +S_API ControllerAnalogActionHandle_t SteamAPI_ISteamController_GetAnalogActionHandle(intptr_t instancePtr, const char * pszActionName); +S_API struct ControllerAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle); +S_API int SteamAPI_ISteamController_GetAnalogActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin * originsOut); +S_API void SteamAPI_ISteamController_StopAnalogActionMomentum(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction); +S_API void SteamAPI_ISteamController_TriggerHapticPulse(intptr_t instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(intptr_t instancePtr, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(intptr_t instancePtr, PublishedFileId_t * pvecPublishedFileID, uint32 unNumPublishedFileIDs); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SendQueryUGCRequest(intptr_t instancePtr, UGCQueryHandle_t handle); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCResult(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, struct SteamUGCDetails_t * pDetails); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, char * pchURL, uint32 cchURLSize); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCMetadata(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, char * pchMetadata, uint32 cchMetadatasize); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCChildren(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, PublishedFileId_t * pvecPublishedFileID, uint32 cMaxEntries); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCStatistic(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint32 * pStatValue); +S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, char * pchURLOrVideoID, uint32 cchURLSize, bool * pbIsImage); +S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, char * pchKey, uint32 cchKeySize, char * pchValue, uint32 cchValueSize); +S_API bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(intptr_t instancePtr, UGCQueryHandle_t handle); +S_API bool SteamAPI_ISteamUGC_AddRequiredTag(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pTagName); +S_API bool SteamAPI_ISteamUGC_AddExcludedTag(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pTagName); +S_API bool SteamAPI_ISteamUGC_SetReturnKeyValueTags(intptr_t instancePtr, UGCQueryHandle_t handle, bool bReturnKeyValueTags); +S_API bool SteamAPI_ISteamUGC_SetReturnLongDescription(intptr_t instancePtr, UGCQueryHandle_t handle, bool bReturnLongDescription); +S_API bool SteamAPI_ISteamUGC_SetReturnMetadata(intptr_t instancePtr, UGCQueryHandle_t handle, bool bReturnMetadata); +S_API bool SteamAPI_ISteamUGC_SetReturnChildren(intptr_t instancePtr, UGCQueryHandle_t handle, bool bReturnChildren); +S_API bool SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(intptr_t instancePtr, UGCQueryHandle_t handle, bool bReturnAdditionalPreviews); +S_API bool SteamAPI_ISteamUGC_SetReturnTotalOnly(intptr_t instancePtr, UGCQueryHandle_t handle, bool bReturnTotalOnly); +S_API bool SteamAPI_ISteamUGC_SetLanguage(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pchLanguage); +S_API bool SteamAPI_ISteamUGC_SetAllowCachedResponse(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 unMaxAgeSeconds); +S_API bool SteamAPI_ISteamUGC_SetCloudFileNameFilter(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pMatchCloudFileName); +S_API bool SteamAPI_ISteamUGC_SetMatchAnyTag(intptr_t instancePtr, UGCQueryHandle_t handle, bool bMatchAnyTag); +S_API bool SteamAPI_ISteamUGC_SetSearchText(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pSearchText); +S_API bool SteamAPI_ISteamUGC_SetRankedByTrendDays(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 unDays); +S_API bool SteamAPI_ISteamUGC_AddRequiredKeyValueTag(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pKey, const char * pValue); +S_API SteamAPICall_t SteamAPI_ISteamUGC_RequestUGCDetails(intptr_t instancePtr, PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds); +S_API SteamAPICall_t SteamAPI_ISteamUGC_CreateItem(intptr_t instancePtr, AppId_t nConsumerAppId, EWorkshopFileType eFileType); +S_API UGCUpdateHandle_t SteamAPI_ISteamUGC_StartItemUpdate(intptr_t instancePtr, AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID); +S_API bool SteamAPI_ISteamUGC_SetItemTitle(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchTitle); +S_API bool SteamAPI_ISteamUGC_SetItemDescription(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchDescription); +S_API bool SteamAPI_ISteamUGC_SetItemUpdateLanguage(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchLanguage); +S_API bool SteamAPI_ISteamUGC_SetItemMetadata(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchMetaData); +S_API bool SteamAPI_ISteamUGC_SetItemVisibility(intptr_t instancePtr, UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility); +S_API bool SteamAPI_ISteamUGC_SetItemTags(intptr_t instancePtr, UGCUpdateHandle_t updateHandle, const struct SteamParamStringArray_t * pTags); +S_API bool SteamAPI_ISteamUGC_SetItemContent(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszContentFolder); +S_API bool SteamAPI_ISteamUGC_SetItemPreview(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile); +S_API bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey); +S_API bool SteamAPI_ISteamUGC_AddItemKeyValueTag(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey, const char * pchValue); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SubmitItemUpdate(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchChangeNote); +S_API EItemUpdateStatus SteamAPI_ISteamUGC_GetItemUpdateProgress(intptr_t instancePtr, UGCUpdateHandle_t handle, uint64 * punBytesProcessed, uint64 * punBytesTotal); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SetUserItemVote(intptr_t instancePtr, PublishedFileId_t nPublishedFileID, bool bVoteUp); +S_API SteamAPICall_t SteamAPI_ISteamUGC_GetUserItemVote(intptr_t instancePtr, PublishedFileId_t nPublishedFileID); +S_API SteamAPICall_t SteamAPI_ISteamUGC_AddItemToFavorites(intptr_t instancePtr, AppId_t nAppId, PublishedFileId_t nPublishedFileID); +S_API SteamAPICall_t SteamAPI_ISteamUGC_RemoveItemFromFavorites(intptr_t instancePtr, AppId_t nAppId, PublishedFileId_t nPublishedFileID); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SubscribeItem(intptr_t instancePtr, PublishedFileId_t nPublishedFileID); +S_API SteamAPICall_t SteamAPI_ISteamUGC_UnsubscribeItem(intptr_t instancePtr, PublishedFileId_t nPublishedFileID); +S_API uint32 SteamAPI_ISteamUGC_GetNumSubscribedItems(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamUGC_GetSubscribedItems(intptr_t instancePtr, PublishedFileId_t * pvecPublishedFileID, uint32 cMaxEntries); +S_API uint32 SteamAPI_ISteamUGC_GetItemState(intptr_t instancePtr, PublishedFileId_t nPublishedFileID); +S_API bool SteamAPI_ISteamUGC_GetItemInstallInfo(intptr_t instancePtr, PublishedFileId_t nPublishedFileID, uint64 * punSizeOnDisk, char * pchFolder, uint32 cchFolderSize, uint32 * punTimeStamp); +S_API bool SteamAPI_ISteamUGC_GetItemDownloadInfo(intptr_t instancePtr, PublishedFileId_t nPublishedFileID, uint64 * punBytesDownloaded, uint64 * punBytesTotal); +S_API bool SteamAPI_ISteamUGC_DownloadItem(intptr_t instancePtr, PublishedFileId_t nPublishedFileID, bool bHighPriority); +S_API bool SteamAPI_ISteamUGC_BInitWorkshopForGameServer(intptr_t instancePtr, DepotId_t unWorkshopDepotID, const char * pszFolder); +S_API void SteamAPI_ISteamUGC_SuspendDownloads(intptr_t instancePtr, bool bSuspend); +S_API uint32 SteamAPI_ISteamAppList_GetNumInstalledApps(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamAppList_GetInstalledApps(intptr_t instancePtr, AppId_t * pvecAppID, uint32 unMaxAppIDs); +S_API int SteamAPI_ISteamAppList_GetAppName(intptr_t instancePtr, AppId_t nAppID, char * pchName, int cchNameMax); +S_API int SteamAPI_ISteamAppList_GetAppInstallDir(intptr_t instancePtr, AppId_t nAppID, char * pchDirectory, int cchNameMax); +S_API int SteamAPI_ISteamAppList_GetAppBuildId(intptr_t instancePtr, AppId_t nAppID); +S_API void SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(intptr_t instancePtr); +S_API bool SteamAPI_ISteamHTMLSurface_Init(intptr_t instancePtr); +S_API bool SteamAPI_ISteamHTMLSurface_Shutdown(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamHTMLSurface_CreateBrowser(intptr_t instancePtr, const char * pchUserAgent, const char * pchUserCSS); +S_API void SteamAPI_ISteamHTMLSurface_RemoveBrowser(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_LoadURL(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, const char * pchURL, const char * pchPostData); +S_API void SteamAPI_ISteamHTMLSurface_SetSize(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 unWidth, uint32 unHeight); +S_API void SteamAPI_ISteamHTMLSurface_StopLoad(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_Reload(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_GoBack(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_GoForward(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_AddHeader(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, const char * pchKey, const char * pchValue); +S_API void SteamAPI_ISteamHTMLSurface_ExecuteJavascript(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, const char * pchScript); +S_API void SteamAPI_ISteamHTMLSurface_MouseUp(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton); +S_API void SteamAPI_ISteamHTMLSurface_MouseDown(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton); +S_API void SteamAPI_ISteamHTMLSurface_MouseDoubleClick(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton); +S_API void SteamAPI_ISteamHTMLSurface_MouseMove(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int x, int y); +S_API void SteamAPI_ISteamHTMLSurface_MouseWheel(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int32 nDelta); +S_API void SteamAPI_ISteamHTMLSurface_KeyDown(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); +S_API void SteamAPI_ISteamHTMLSurface_KeyUp(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); +S_API void SteamAPI_ISteamHTMLSurface_KeyChar(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); +S_API void SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll); +S_API void SteamAPI_ISteamHTMLSurface_SetVerticalScroll(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll); +S_API void SteamAPI_ISteamHTMLSurface_SetKeyFocus(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bHasKeyFocus); +S_API void SteamAPI_ISteamHTMLSurface_ViewSource(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_CopyToClipboard(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_PasteFromClipboard(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_Find(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, const char * pchSearchStr, bool bCurrentlyInFind, bool bReverse); +S_API void SteamAPI_ISteamHTMLSurface_StopFind(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); +S_API void SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int x, int y); +S_API void SteamAPI_ISteamHTMLSurface_SetCookie(intptr_t instancePtr, const char * pchHostname, const char * pchKey, const char * pchValue, const char * pchPath, RTime32 nExpires, bool bSecure, bool bHTTPOnly); +S_API void SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY); +S_API void SteamAPI_ISteamHTMLSurface_SetBackgroundMode(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bBackgroundMode); +S_API void SteamAPI_ISteamHTMLSurface_AllowStartRequest(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bAllowed); +S_API void SteamAPI_ISteamHTMLSurface_JSDialogResponse(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bResult); +S_API void SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, const char ** pchSelectedFiles); +S_API EResult SteamAPI_ISteamInventory_GetResultStatus(intptr_t instancePtr, SteamInventoryResult_t resultHandle); +S_API bool SteamAPI_ISteamInventory_GetResultItems(intptr_t instancePtr, SteamInventoryResult_t resultHandle, struct SteamItemDetails_t * pOutItemsArray, uint32 * punOutItemsArraySize); +S_API uint32 SteamAPI_ISteamInventory_GetResultTimestamp(intptr_t instancePtr, SteamInventoryResult_t resultHandle); +S_API bool SteamAPI_ISteamInventory_CheckResultSteamID(intptr_t instancePtr, SteamInventoryResult_t resultHandle, class CSteamID steamIDExpected); +S_API void SteamAPI_ISteamInventory_DestroyResult(intptr_t instancePtr, SteamInventoryResult_t resultHandle); +S_API bool SteamAPI_ISteamInventory_GetAllItems(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle); +S_API bool SteamAPI_ISteamInventory_GetItemsByID(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, const SteamItemInstanceID_t * pInstanceIDs, uint32 unCountInstanceIDs); +S_API bool SteamAPI_ISteamInventory_SerializeResult(intptr_t instancePtr, SteamInventoryResult_t resultHandle, void * pOutBuffer, uint32 * punOutBufferSize); +S_API bool SteamAPI_ISteamInventory_DeserializeResult(intptr_t instancePtr, SteamInventoryResult_t * pOutResultHandle, const void * pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE); +S_API bool SteamAPI_ISteamInventory_GenerateItems(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, const SteamItemDef_t * pArrayItemDefs, const uint32 * punArrayQuantity, uint32 unArrayLength); +S_API bool SteamAPI_ISteamInventory_GrantPromoItems(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle); +S_API bool SteamAPI_ISteamInventory_AddPromoItem(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, SteamItemDef_t itemDef); +S_API bool SteamAPI_ISteamInventory_AddPromoItems(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, const SteamItemDef_t * pArrayItemDefs, uint32 unArrayLength); +S_API bool SteamAPI_ISteamInventory_ConsumeItem(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity); +S_API bool SteamAPI_ISteamInventory_ExchangeItems(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, const SteamItemDef_t * pArrayGenerate, const uint32 * punArrayGenerateQuantity, uint32 unArrayGenerateLength, const SteamItemInstanceID_t * pArrayDestroy, const uint32 * punArrayDestroyQuantity, uint32 unArrayDestroyLength); +S_API bool SteamAPI_ISteamInventory_TransferItemQuantity(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest); +S_API void SteamAPI_ISteamInventory_SendItemDropHeartbeat(intptr_t instancePtr); +S_API bool SteamAPI_ISteamInventory_TriggerItemDrop(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, SteamItemDef_t dropListDefinition); +S_API bool SteamAPI_ISteamInventory_TradeItems(intptr_t instancePtr, SteamInventoryResult_t * pResultHandle, class CSteamID steamIDTradePartner, const SteamItemInstanceID_t * pArrayGive, const uint32 * pArrayGiveQuantity, uint32 nArrayGiveLength, const SteamItemInstanceID_t * pArrayGet, const uint32 * pArrayGetQuantity, uint32 nArrayGetLength); +S_API bool SteamAPI_ISteamInventory_LoadItemDefinitions(intptr_t instancePtr); +S_API bool SteamAPI_ISteamInventory_GetItemDefinitionIDs(intptr_t instancePtr, SteamItemDef_t * pItemDefIDs, uint32 * punItemDefIDsArraySize); +S_API bool SteamAPI_ISteamInventory_GetItemDefinitionProperty(intptr_t instancePtr, SteamItemDef_t iDefinition, const char * pchPropertyName, char * pchValueBuffer, uint32 * punValueBufferSize); +S_API void SteamAPI_ISteamVideo_GetVideoURL(intptr_t instancePtr, AppId_t unVideoAppID); +S_API bool SteamAPI_ISteamVideo_IsBroadcasting(intptr_t instancePtr, int * pnNumViewers); +S_API bool SteamAPI_ISteamGameServer_InitGameServer(intptr_t instancePtr, uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char * pchVersionString); +S_API void SteamAPI_ISteamGameServer_SetProduct(intptr_t instancePtr, const char * pszProduct); +S_API void SteamAPI_ISteamGameServer_SetGameDescription(intptr_t instancePtr, const char * pszGameDescription); +S_API void SteamAPI_ISteamGameServer_SetModDir(intptr_t instancePtr, const char * pszModDir); +S_API void SteamAPI_ISteamGameServer_SetDedicatedServer(intptr_t instancePtr, bool bDedicated); +S_API void SteamAPI_ISteamGameServer_LogOn(intptr_t instancePtr, const char * pszToken); +S_API void SteamAPI_ISteamGameServer_LogOnAnonymous(intptr_t instancePtr); +S_API void SteamAPI_ISteamGameServer_LogOff(intptr_t instancePtr); +S_API bool SteamAPI_ISteamGameServer_BLoggedOn(intptr_t instancePtr); +S_API bool SteamAPI_ISteamGameServer_BSecure(intptr_t instancePtr); +S_API uint64 SteamAPI_ISteamGameServer_GetSteamID(intptr_t instancePtr); +S_API bool SteamAPI_ISteamGameServer_WasRestartRequested(intptr_t instancePtr); +S_API void SteamAPI_ISteamGameServer_SetMaxPlayerCount(intptr_t instancePtr, int cPlayersMax); +S_API void SteamAPI_ISteamGameServer_SetBotPlayerCount(intptr_t instancePtr, int cBotplayers); +S_API void SteamAPI_ISteamGameServer_SetServerName(intptr_t instancePtr, const char * pszServerName); +S_API void SteamAPI_ISteamGameServer_SetMapName(intptr_t instancePtr, const char * pszMapName); +S_API void SteamAPI_ISteamGameServer_SetPasswordProtected(intptr_t instancePtr, bool bPasswordProtected); +S_API void SteamAPI_ISteamGameServer_SetSpectatorPort(intptr_t instancePtr, uint16 unSpectatorPort); +S_API void SteamAPI_ISteamGameServer_SetSpectatorServerName(intptr_t instancePtr, const char * pszSpectatorServerName); +S_API void SteamAPI_ISteamGameServer_ClearAllKeyValues(intptr_t instancePtr); +S_API void SteamAPI_ISteamGameServer_SetKeyValue(intptr_t instancePtr, const char * pKey, const char * pValue); +S_API void SteamAPI_ISteamGameServer_SetGameTags(intptr_t instancePtr, const char * pchGameTags); +S_API void SteamAPI_ISteamGameServer_SetGameData(intptr_t instancePtr, const char * pchGameData); +S_API void SteamAPI_ISteamGameServer_SetRegion(intptr_t instancePtr, const char * pszRegion); +S_API bool SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(intptr_t instancePtr, uint32 unIPClient, const void * pvAuthBlob, uint32 cubAuthBlobSize, class CSteamID * pSteamIDUser); +S_API uint64 SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(intptr_t instancePtr); +S_API void SteamAPI_ISteamGameServer_SendUserDisconnect(intptr_t instancePtr, class CSteamID steamIDUser); +S_API bool SteamAPI_ISteamGameServer_BUpdateUserData(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchPlayerName, uint32 uScore); +S_API HAuthTicket SteamAPI_ISteamGameServer_GetAuthSessionTicket(intptr_t instancePtr, void * pTicket, int cbMaxTicket, uint32 * pcbTicket); +S_API EBeginAuthSessionResult SteamAPI_ISteamGameServer_BeginAuthSession(intptr_t instancePtr, const void * pAuthTicket, int cbAuthTicket, class CSteamID steamID); +S_API void SteamAPI_ISteamGameServer_EndAuthSession(intptr_t instancePtr, class CSteamID steamID); +S_API void SteamAPI_ISteamGameServer_CancelAuthTicket(intptr_t instancePtr, HAuthTicket hAuthTicket); +S_API EUserHasLicenseForAppResult SteamAPI_ISteamGameServer_UserHasLicenseForApp(intptr_t instancePtr, class CSteamID steamID, AppId_t appID); +S_API bool SteamAPI_ISteamGameServer_RequestUserGroupStatus(intptr_t instancePtr, class CSteamID steamIDUser, class CSteamID steamIDGroup); +S_API void SteamAPI_ISteamGameServer_GetGameplayStats(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamGameServer_GetServerReputation(intptr_t instancePtr); +S_API uint32 SteamAPI_ISteamGameServer_GetPublicIP(intptr_t instancePtr); +S_API bool SteamAPI_ISteamGameServer_HandleIncomingPacket(intptr_t instancePtr, const void * pData, int cbData, uint32 srcIP, uint16 srcPort); +S_API int SteamAPI_ISteamGameServer_GetNextOutgoingPacket(intptr_t instancePtr, void * pOut, int cbMaxOut, uint32 * pNetAdr, uint16 * pPort); +S_API void SteamAPI_ISteamGameServer_EnableHeartbeats(intptr_t instancePtr, bool bActive); +S_API void SteamAPI_ISteamGameServer_SetHeartbeatInterval(intptr_t instancePtr, int iHeartbeatInterval); +S_API void SteamAPI_ISteamGameServer_ForceHeartbeat(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamGameServer_AssociateWithClan(intptr_t instancePtr, class CSteamID steamIDClan); +S_API SteamAPICall_t SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(intptr_t instancePtr, class CSteamID steamIDNewPlayer); +S_API SteamAPICall_t SteamAPI_ISteamGameServerStats_RequestUserStats(intptr_t instancePtr, class CSteamID steamIDUser); +S_API bool SteamAPI_ISteamGameServerStats_GetUserStat(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, int32 * pData); +S_API bool SteamAPI_ISteamGameServerStats_GetUserStat0(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, float * pData); +S_API bool SteamAPI_ISteamGameServerStats_GetUserAchievement(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, bool * pbAchieved); +S_API bool SteamAPI_ISteamGameServerStats_SetUserStat(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, int32 nData); +S_API bool SteamAPI_ISteamGameServerStats_SetUserStat0(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, float fData); +S_API bool SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName, float flCountThisSession, double dSessionLength); +S_API bool SteamAPI_ISteamGameServerStats_SetUserAchievement(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName); +S_API bool SteamAPI_ISteamGameServerStats_ClearUserAchievement(intptr_t instancePtr, class CSteamID steamIDUser, const char * pchName); +S_API SteamAPICall_t SteamAPI_ISteamGameServerStats_StoreUserStats(intptr_t instancePtr, class CSteamID steamIDUser); +#endif // STEAMAPIFLAT_H + + diff --git a/public/steam/steam_api_interop.cs b/public/steam/steam_api_interop.cs new file mode 100644 index 000000000..756186f58 --- /dev/null +++ b/public/steam/steam_api_interop.cs @@ -0,0 +1,8803 @@ +//=== === Copyright 1996-2014, Valve Corporation, All rights reserved. ======= +// +// Purpose: This file contains C#/managed code bindings for the SteamAPI interfaces +// This file is auto-generated, do not edit it. +// +//============================================================================= + +using System; +using System.Runtime.InteropServices; +using Valve.Steamworks; +using Valve.Interop; +using Valve.VR; + +namespace Valve.Interop +{ + +class NativeEntrypoints +{ + + +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_CreateSteamPipe")] +internal static extern uint SteamAPI_ISteamClient_CreateSteamPipe(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_BReleaseSteamPipe")] +internal static extern bool SteamAPI_ISteamClient_BReleaseSteamPipe(IntPtr instancePtr, uint hSteamPipe); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_ConnectToGlobalUser")] +internal static extern uint SteamAPI_ISteamClient_ConnectToGlobalUser(IntPtr instancePtr, uint hSteamPipe); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_CreateLocalUser")] +internal static extern uint SteamAPI_ISteamClient_CreateLocalUser(IntPtr instancePtr, ref uint phSteamPipe, uint eAccountType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_ReleaseUser")] +internal static extern void SteamAPI_ISteamClient_ReleaseUser(IntPtr instancePtr, uint hSteamPipe, uint hUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamUser")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUser(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServer")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGameServer(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_SetLocalIPBinding")] +internal static extern void SteamAPI_ISteamClient_SetLocalIPBinding(IntPtr instancePtr, uint unIP, char usPort); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamFriends")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamFriends(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamUtils")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUtils(IntPtr instancePtr, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmaking")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMatchmaking(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmakingServers")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMatchmakingServers(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamGenericInterface")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGenericInterface(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamUserStats")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUserStats(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServerStats")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGameServerStats(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamApps")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamApps(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamNetworking")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamNetworking(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamRemoteStorage")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamRemoteStorage(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamScreenshots")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamScreenshots(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_RunFrame")] +internal static extern void SteamAPI_ISteamClient_RunFrame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetIPCCallCount")] +internal static extern uint SteamAPI_ISteamClient_GetIPCCallCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_SetWarningMessageHook")] +internal static extern void SteamAPI_ISteamClient_SetWarningMessageHook(IntPtr instancePtr, IntPtr pFunction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_BShutdownIfAllPipesClosed")] +internal static extern bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamHTTP")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamHTTP(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamUnifiedMessages")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUnifiedMessages(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamController")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamController(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamUGC")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUGC(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamAppList")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamAppList(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamMusic")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMusic(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamMusicRemote")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMusicRemote(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamHTMLSurface")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamHTMLSurface(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess")] +internal static extern void SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess(IntPtr instancePtr, IntPtr func); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_Remove_SteamAPI_CPostAPIResultInProcess")] +internal static extern void SteamAPI_ISteamClient_Remove_SteamAPI_CPostAPIResultInProcess(IntPtr instancePtr, IntPtr func); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_Set_SteamAPI_CCheckCallbackRegisteredInProcess")] +internal static extern void SteamAPI_ISteamClient_Set_SteamAPI_CCheckCallbackRegisteredInProcess(IntPtr instancePtr, IntPtr func); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamInventory")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamInventory(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamVideo")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamVideo(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] +internal static extern uint SteamAPI_ISteamUser_GetHSteamUser(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BLoggedOn")] +internal static extern bool SteamAPI_ISteamUser_BLoggedOn(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetSteamID")] +internal static extern ulong SteamAPI_ISteamUser_GetSteamID(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_InitiateGameConnection")] +internal static extern int SteamAPI_ISteamUser_InitiateGameConnection(IntPtr instancePtr, IntPtr pAuthBlob, int cbMaxAuthBlob, ulong steamIDGameServer, uint unIPServer, char usPortServer, bool bSecure); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_TerminateGameConnection")] +internal static extern void SteamAPI_ISteamUser_TerminateGameConnection(IntPtr instancePtr, uint unIPServer, char usPortServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_TrackAppUsageEvent")] +internal static extern void SteamAPI_ISteamUser_TrackAppUsageEvent(IntPtr instancePtr, ulong gameID, int eAppUsageEvent, string pchExtraInfo); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetUserDataFolder")] +internal static extern bool SteamAPI_ISteamUser_GetUserDataFolder(IntPtr instancePtr, string pchBuffer, int cubBuffer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_StartVoiceRecording")] +internal static extern void SteamAPI_ISteamUser_StartVoiceRecording(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_StopVoiceRecording")] +internal static extern void SteamAPI_ISteamUser_StopVoiceRecording(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetAvailableVoice")] +internal static extern uint SteamAPI_ISteamUser_GetAvailableVoice(IntPtr instancePtr, ref uint pcbCompressed, ref uint pcbUncompressed, uint nUncompressedVoiceDesiredSampleRate); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetVoice")] +internal static extern uint SteamAPI_ISteamUser_GetVoice(IntPtr instancePtr, bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, bool bWantUncompressed, IntPtr pUncompressedDestBuffer, uint cbUncompressedDestBufferSize, ref uint nUncompressBytesWritten, uint nUncompressedVoiceDesiredSampleRate); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_DecompressVoice")] +internal static extern uint SteamAPI_ISteamUser_DecompressVoice(IntPtr instancePtr, IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetVoiceOptimalSampleRate")] +internal static extern uint SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetAuthSessionTicket")] +internal static extern uint SteamAPI_ISteamUser_GetAuthSessionTicket(IntPtr instancePtr, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BeginAuthSession")] +internal static extern uint SteamAPI_ISteamUser_BeginAuthSession(IntPtr instancePtr, IntPtr pAuthTicket, int cbAuthTicket, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_EndAuthSession")] +internal static extern void SteamAPI_ISteamUser_EndAuthSession(IntPtr instancePtr, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_CancelAuthTicket")] +internal static extern void SteamAPI_ISteamUser_CancelAuthTicket(IntPtr instancePtr, uint hAuthTicket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_UserHasLicenseForApp")] +internal static extern uint SteamAPI_ISteamUser_UserHasLicenseForApp(IntPtr instancePtr, ulong steamID, uint appID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BIsBehindNAT")] +internal static extern bool SteamAPI_ISteamUser_BIsBehindNAT(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_AdvertiseGame")] +internal static extern void SteamAPI_ISteamUser_AdvertiseGame(IntPtr instancePtr, ulong steamIDGameServer, uint unIPServer, char usPortServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_RequestEncryptedAppTicket")] +internal static extern ulong SteamAPI_ISteamUser_RequestEncryptedAppTicket(IntPtr instancePtr, IntPtr pDataToInclude, int cbDataToInclude); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetEncryptedAppTicket")] +internal static extern bool SteamAPI_ISteamUser_GetEncryptedAppTicket(IntPtr instancePtr, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetGameBadgeLevel")] +internal static extern int SteamAPI_ISteamUser_GetGameBadgeLevel(IntPtr instancePtr, int nSeries, bool bFoil); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetPlayerSteamLevel")] +internal static extern int SteamAPI_ISteamUser_GetPlayerSteamLevel(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_RequestStoreAuthURL")] +internal static extern ulong SteamAPI_ISteamUser_RequestStoreAuthURL(IntPtr instancePtr, string pchRedirectURL); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName")] +internal static extern ulong SteamAPI_ISteamFriends_SetPersonaName(IntPtr instancePtr, string pchPersonaName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetPersonaState")] +internal static extern uint SteamAPI_ISteamFriends_GetPersonaState(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendCount")] +internal static extern int SteamAPI_ISteamFriends_GetFriendCount(IntPtr instancePtr, int iFriendFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendByIndex")] +internal static extern ulong SteamAPI_ISteamFriends_GetFriendByIndex(IntPtr instancePtr, int iFriend, int iFriendFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendRelationship")] +internal static extern uint SteamAPI_ISteamFriends_GetFriendRelationship(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaState")] +internal static extern uint SteamAPI_ISteamFriends_GetFriendPersonaState(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaName")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendGamePlayed")] +internal static extern bool SteamAPI_ISteamFriends_GetFriendGamePlayed(IntPtr instancePtr, ulong steamIDFriend, ref FriendGameInfo_t pFriendGameInfo); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaNameHistory")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(IntPtr instancePtr, ulong steamIDFriend, int iPersonaName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendSteamLevel")] +internal static extern int SteamAPI_ISteamFriends_GetFriendSteamLevel(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetPlayerNickname")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname(IntPtr instancePtr, ulong steamIDPlayer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupCount")] +internal static extern int SteamAPI_ISteamFriends_GetFriendsGroupCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex")] +internal static extern char SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(IntPtr instancePtr, int iFG); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupName")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName(IntPtr instancePtr, char friendsGroupID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersCount")] +internal static extern int SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(IntPtr instancePtr, char friendsGroupID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersList")] +internal static extern void SteamAPI_ISteamFriends_GetFriendsGroupMembersList(IntPtr instancePtr, char friendsGroupID, [In, Out] CSteamID[] pOutSteamIDMembers, int nMembersCount); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_HasFriend")] +internal static extern bool SteamAPI_ISteamFriends_HasFriend(IntPtr instancePtr, ulong steamIDFriend, int iFriendFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanCount")] +internal static extern int SteamAPI_ISteamFriends_GetClanCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanByIndex")] +internal static extern ulong SteamAPI_ISteamFriends_GetClanByIndex(IntPtr instancePtr, int iClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanName")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanTag")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanActivityCounts")] +internal static extern bool SteamAPI_ISteamFriends_GetClanActivityCounts(IntPtr instancePtr, ulong steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_DownloadClanActivityCounts")] +internal static extern ulong SteamAPI_ISteamFriends_DownloadClanActivityCounts(IntPtr instancePtr, [In, Out] CSteamID[] psteamIDClans, int cClansToRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendCountFromSource")] +internal static extern int SteamAPI_ISteamFriends_GetFriendCountFromSource(IntPtr instancePtr, ulong steamIDSource); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendFromSourceByIndex")] +internal static extern ulong SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(IntPtr instancePtr, ulong steamIDSource, int iFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_IsUserInSource")] +internal static extern bool SteamAPI_ISteamFriends_IsUserInSource(IntPtr instancePtr, ulong steamIDUser, ulong steamIDSource); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetInGameVoiceSpeaking")] +internal static extern void SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(IntPtr instancePtr, ulong steamIDUser, bool bSpeaking); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlay")] +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlay(IntPtr instancePtr, string pchDialog); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser")] +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToUser(IntPtr instancePtr, string pchDialog, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage")] +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(IntPtr instancePtr, string pchURL); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToStore")] +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(IntPtr instancePtr, uint nAppID, char eFlag); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetPlayedWith")] +internal static extern void SteamAPI_ISteamFriends_SetPlayedWith(IntPtr instancePtr, ulong steamIDUserPlayedWith); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog")] +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetSmallFriendAvatar")] +internal static extern int SteamAPI_ISteamFriends_GetSmallFriendAvatar(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetMediumFriendAvatar")] +internal static extern int SteamAPI_ISteamFriends_GetMediumFriendAvatar(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetLargeFriendAvatar")] +internal static extern int SteamAPI_ISteamFriends_GetLargeFriendAvatar(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_RequestUserInformation")] +internal static extern bool SteamAPI_ISteamFriends_RequestUserInformation(IntPtr instancePtr, ulong steamIDUser, bool bRequireNameOnly); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_RequestClanOfficerList")] +internal static extern ulong SteamAPI_ISteamFriends_RequestClanOfficerList(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanOwner")] +internal static extern ulong SteamAPI_ISteamFriends_GetClanOwner(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerCount")] +internal static extern int SteamAPI_ISteamFriends_GetClanOfficerCount(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerByIndex")] +internal static extern ulong SteamAPI_ISteamFriends_GetClanOfficerByIndex(IntPtr instancePtr, ulong steamIDClan, int iOfficer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetUserRestrictions")] +internal static extern uint SteamAPI_ISteamFriends_GetUserRestrictions(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetRichPresence")] +internal static extern bool SteamAPI_ISteamFriends_SetRichPresence(IntPtr instancePtr, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ClearRichPresence")] +internal static extern void SteamAPI_ISteamFriends_ClearRichPresence(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresence")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence(IntPtr instancePtr, ulong steamIDFriend, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount")] +internal static extern int SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex")] +internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(IntPtr instancePtr, ulong steamIDFriend, int iKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_RequestFriendRichPresence")] +internal static extern void SteamAPI_ISteamFriends_RequestFriendRichPresence(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_InviteUserToGame")] +internal static extern bool SteamAPI_ISteamFriends_InviteUserToGame(IntPtr instancePtr, ulong steamIDFriend, string pchConnectString); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriendCount")] +internal static extern int SteamAPI_ISteamFriends_GetCoplayFriendCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriend")] +internal static extern ulong SteamAPI_ISteamFriends_GetCoplayFriend(IntPtr instancePtr, int iCoplayFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayTime")] +internal static extern int SteamAPI_ISteamFriends_GetFriendCoplayTime(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayGame")] +internal static extern uint SteamAPI_ISteamFriends_GetFriendCoplayGame(IntPtr instancePtr, ulong steamIDFriend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_JoinClanChatRoom")] +internal static extern ulong SteamAPI_ISteamFriends_JoinClanChatRoom(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_LeaveClanChatRoom")] +internal static extern bool SteamAPI_ISteamFriends_LeaveClanChatRoom(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMemberCount")] +internal static extern int SteamAPI_ISteamFriends_GetClanChatMemberCount(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetChatMemberByIndex")] +internal static extern ulong SteamAPI_ISteamFriends_GetChatMemberByIndex(IntPtr instancePtr, ulong steamIDClan, int iUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SendClanChatMessage")] +internal static extern bool SteamAPI_ISteamFriends_SendClanChatMessage(IntPtr instancePtr, ulong steamIDClanChat, string pchText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMessage")] +internal static extern int SteamAPI_ISteamFriends_GetClanChatMessage(IntPtr instancePtr, ulong steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref uint peChatEntryType, ref CSteamID psteamidChatter); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_IsClanChatAdmin")] +internal static extern bool SteamAPI_ISteamFriends_IsClanChatAdmin(IntPtr instancePtr, ulong steamIDClanChat, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam")] +internal static extern bool SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(IntPtr instancePtr, ulong steamIDClanChat); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_OpenClanChatWindowInSteam")] +internal static extern bool SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(IntPtr instancePtr, ulong steamIDClanChat); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_CloseClanChatWindowInSteam")] +internal static extern bool SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(IntPtr instancePtr, ulong steamIDClanChat); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetListenForFriendsMessages")] +internal static extern bool SteamAPI_ISteamFriends_SetListenForFriendsMessages(IntPtr instancePtr, bool bInterceptEnabled); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ReplyToFriendMessage")] +internal static extern bool SteamAPI_ISteamFriends_ReplyToFriendMessage(IntPtr instancePtr, ulong steamIDFriend, string pchMsgToSend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFriendMessage")] +internal static extern int SteamAPI_ISteamFriends_GetFriendMessage(IntPtr instancePtr, ulong steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref uint peChatEntryType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetFollowerCount")] +internal static extern ulong SteamAPI_ISteamFriends_GetFollowerCount(IntPtr instancePtr, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_IsFollowing")] +internal static extern ulong SteamAPI_ISteamFriends_IsFollowing(IntPtr instancePtr, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_EnumerateFollowingList")] +internal static extern ulong SteamAPI_ISteamFriends_EnumerateFollowingList(IntPtr instancePtr, uint unStartIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] +internal static extern uint SteamAPI_ISteamUtils_GetSecondsSinceAppActive(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive")] +internal static extern uint SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetConnectedUniverse")] +internal static extern int SteamAPI_ISteamUtils_GetConnectedUniverse(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetServerRealTime")] +internal static extern uint SteamAPI_ISteamUtils_GetServerRealTime(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetIPCountry")] +internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetImageSize")] +internal static extern bool SteamAPI_ISteamUtils_GetImageSize(IntPtr instancePtr, int iImage, ref uint pnWidth, ref uint pnHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetImageRGBA")] +internal static extern bool SteamAPI_ISteamUtils_GetImageRGBA(IntPtr instancePtr, int iImage, IntPtr pubDest, int nDestBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetCSERIPPort")] +internal static extern bool SteamAPI_ISteamUtils_GetCSERIPPort(IntPtr instancePtr, ref uint unIP, ref char usPort); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetCurrentBatteryPower")] +internal static extern byte SteamAPI_ISteamUtils_GetCurrentBatteryPower(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetAppID")] +internal static extern uint SteamAPI_ISteamUtils_GetAppID(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationPosition")] +internal static extern void SteamAPI_ISteamUtils_SetOverlayNotificationPosition(IntPtr instancePtr, uint eNotificationPosition); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_IsAPICallCompleted")] +internal static extern bool SteamAPI_ISteamUtils_IsAPICallCompleted(IntPtr instancePtr, ulong hSteamAPICall, ref bool pbFailed); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetAPICallFailureReason")] +internal static extern int SteamAPI_ISteamUtils_GetAPICallFailureReason(IntPtr instancePtr, ulong hSteamAPICall); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetAPICallResult")] +internal static extern bool SteamAPI_ISteamUtils_GetAPICallResult(IntPtr instancePtr, ulong hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, ref bool pbFailed); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_RunFrame")] +internal static extern void SteamAPI_ISteamUtils_RunFrame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetIPCCallCount")] +internal static extern uint SteamAPI_ISteamUtils_GetIPCCallCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_SetWarningMessageHook")] +internal static extern void SteamAPI_ISteamUtils_SetWarningMessageHook(IntPtr instancePtr, IntPtr pFunction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_IsOverlayEnabled")] +internal static extern bool SteamAPI_ISteamUtils_IsOverlayEnabled(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_BOverlayNeedsPresent")] +internal static extern bool SteamAPI_ISteamUtils_BOverlayNeedsPresent(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_CheckFileSignature")] +internal static extern ulong SteamAPI_ISteamUtils_CheckFileSignature(IntPtr instancePtr, string szFileName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_ShowGamepadTextInput")] +internal static extern bool SteamAPI_ISteamUtils_ShowGamepadTextInput(IntPtr instancePtr, int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextLength")] +internal static extern uint SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextInput")] +internal static extern bool SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(IntPtr instancePtr, string pchText, uint cchText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSteamUILanguage")] +internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_IsSteamRunningInVR")] +internal static extern bool SteamAPI_ISteamUtils_IsSteamRunningInVR(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationInset")] +internal static extern void SteamAPI_ISteamUtils_SetOverlayNotificationInset(IntPtr instancePtr, int nHorizontalInset, int nVerticalInset); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] +internal static extern int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGame")] +internal static extern bool SteamAPI_ISteamMatchmaking_GetFavoriteGame(IntPtr instancePtr, int iGame, ref uint pnAppID, ref uint pnIP, ref char pnConnPort, ref char pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddFavoriteGame")] +internal static extern int SteamAPI_ISteamMatchmaking_AddFavoriteGame(IntPtr instancePtr, uint nAppID, uint nIP, char nConnPort, char nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_RemoveFavoriteGame")] +internal static extern bool SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(IntPtr instancePtr, uint nAppID, uint nIP, char nConnPort, char nQueryPort, uint unFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyList")] +internal static extern ulong SteamAPI_ISteamMatchmaking_RequestLobbyList(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(IntPtr instancePtr, string pchKeyToMatch, string pchValueToMatch, uint eComparisonType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(IntPtr instancePtr, string pchKeyToMatch, int nValueToMatch, uint eComparisonType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(IntPtr instancePtr, string pchKeyToMatch, int nValueToBeCloseTo); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(IntPtr instancePtr, int nSlotsAvailable); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(IntPtr instancePtr, uint eLobbyDistanceFilter); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(IntPtr instancePtr, int cMaxResults); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter")] +internal static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyByIndex")] +internal static extern ulong SteamAPI_ISteamMatchmaking_GetLobbyByIndex(IntPtr instancePtr, int iLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_CreateLobby")] +internal static extern ulong SteamAPI_ISteamMatchmaking_CreateLobby(IntPtr instancePtr, uint eLobbyType, int cMaxMembers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_JoinLobby")] +internal static extern ulong SteamAPI_ISteamMatchmaking_JoinLobby(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_LeaveLobby")] +internal static extern void SteamAPI_ISteamMatchmaking_LeaveLobby(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_InviteUserToLobby")] +internal static extern bool SteamAPI_ISteamMatchmaking_InviteUserToLobby(IntPtr instancePtr, ulong steamIDLobby, ulong steamIDInvitee); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetNumLobbyMembers")] +internal static extern int SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex")] +internal static extern ulong SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(IntPtr instancePtr, ulong steamIDLobby, int iMember); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyData")] +internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData(IntPtr instancePtr, ulong steamIDLobby, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyData")] +internal static extern bool SteamAPI_ISteamMatchmaking_SetLobbyData(IntPtr instancePtr, ulong steamIDLobby, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataCount")] +internal static extern int SteamAPI_ISteamMatchmaking_GetLobbyDataCount(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex")] +internal static extern bool SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(IntPtr instancePtr, ulong steamIDLobby, int iLobbyData, string pchKey, int cchKeyBufferSize, string pchValue, int cchValueBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_DeleteLobbyData")] +internal static extern bool SteamAPI_ISteamMatchmaking_DeleteLobbyData(IntPtr instancePtr, ulong steamIDLobby, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberData")] +internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData(IntPtr instancePtr, ulong steamIDLobby, ulong steamIDUser, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberData")] +internal static extern void SteamAPI_ISteamMatchmaking_SetLobbyMemberData(IntPtr instancePtr, ulong steamIDLobby, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SendLobbyChatMsg")] +internal static extern bool SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(IntPtr instancePtr, ulong steamIDLobby, IntPtr pvMsgBody, int cubMsgBody); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyChatEntry")] +internal static extern int SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(IntPtr instancePtr, ulong steamIDLobby, int iChatID, ref CSteamID pSteamIDUser, IntPtr pvData, int cubData, ref uint peChatEntryType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyData")] +internal static extern bool SteamAPI_ISteamMatchmaking_RequestLobbyData(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyGameServer")] +internal static extern void SteamAPI_ISteamMatchmaking_SetLobbyGameServer(IntPtr instancePtr, ulong steamIDLobby, uint unGameServerIP, char unGameServerPort, ulong steamIDGameServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyGameServer")] +internal static extern bool SteamAPI_ISteamMatchmaking_GetLobbyGameServer(IntPtr instancePtr, ulong steamIDLobby, ref uint punGameServerIP, ref char punGameServerPort, ref CSteamID psteamIDGameServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit")] +internal static extern bool SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(IntPtr instancePtr, ulong steamIDLobby, int cMaxMembers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit")] +internal static extern int SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyType")] +internal static extern bool SteamAPI_ISteamMatchmaking_SetLobbyType(IntPtr instancePtr, ulong steamIDLobby, uint eLobbyType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyJoinable")] +internal static extern bool SteamAPI_ISteamMatchmaking_SetLobbyJoinable(IntPtr instancePtr, ulong steamIDLobby, bool bLobbyJoinable); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyOwner")] +internal static extern ulong SteamAPI_ISteamMatchmaking_GetLobbyOwner(IntPtr instancePtr, ulong steamIDLobby); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyOwner")] +internal static extern bool SteamAPI_ISteamMatchmaking_SetLobbyOwner(IntPtr instancePtr, ulong steamIDLobby, ulong steamIDNewOwner); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmaking_SetLinkedLobby")] +internal static extern bool SteamAPI_ISteamMatchmaking_SetLinkedLobby(IntPtr instancePtr, ulong steamIDLobby, ulong steamIDLobbyDependent); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded")] +internal static extern void SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded(IntPtr instancePtr, uint hRequest, int iServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond")] +internal static extern void SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond(IntPtr instancePtr, uint hRequest, int iServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete")] +internal static extern void SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete(IntPtr instancePtr, uint hRequest, uint response); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingPingResponse_ServerResponded")] +internal static extern void SteamAPI_ISteamMatchmakingPingResponse_ServerResponded(IntPtr instancePtr, IntPtr server); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond")] +internal static extern void SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList")] +internal static extern void SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList(IntPtr instancePtr, string pchName, int nScore, float flTimePlayed); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond")] +internal static extern void SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete")] +internal static extern void SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded")] +internal static extern void SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded(IntPtr instancePtr, string pchRule, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond")] +internal static extern void SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete")] +internal static extern void SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(IntPtr instancePtr, uint iApp, [In, Out] MatchMakingKeyValuePair_t [] ppchFilters, uint nFilters, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestLANServerList")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_RequestLANServerList(IntPtr instancePtr, uint iApp, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(IntPtr instancePtr, uint iApp, [In, Out] MatchMakingKeyValuePair_t [] ppchFilters, uint nFilters, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(IntPtr instancePtr, uint iApp, [In, Out] MatchMakingKeyValuePair_t [] ppchFilters, uint nFilters, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(IntPtr instancePtr, uint iApp, [In, Out] MatchMakingKeyValuePair_t [] ppchFilters, uint nFilters, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(IntPtr instancePtr, uint iApp, [In, Out] MatchMakingKeyValuePair_t [] ppchFilters, uint nFilters, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_ReleaseRequest")] +internal static extern void SteamAPI_ISteamMatchmakingServers_ReleaseRequest(IntPtr instancePtr, uint hServerListRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerDetails")] +internal static extern IntPtr SteamAPI_ISteamMatchmakingServers_GetServerDetails(IntPtr instancePtr, uint hRequest, int iServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelQuery")] +internal static extern void SteamAPI_ISteamMatchmakingServers_CancelQuery(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshQuery")] +internal static extern void SteamAPI_ISteamMatchmakingServers_RefreshQuery(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_IsRefreshing")] +internal static extern bool SteamAPI_ISteamMatchmakingServers_IsRefreshing(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerCount")] +internal static extern int SteamAPI_ISteamMatchmakingServers_GetServerCount(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshServer")] +internal static extern void SteamAPI_ISteamMatchmakingServers_RefreshServer(IntPtr instancePtr, uint hRequest, int iServer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_PingServer")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_PingServer(IntPtr instancePtr, uint unIP, char usPort, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_PlayerDetails")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_PlayerDetails(IntPtr instancePtr, uint unIP, char usPort, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_ServerRules")] +internal static extern uint SteamAPI_ISteamMatchmakingServers_ServerRules(IntPtr instancePtr, uint unIP, char usPort, IntPtr pRequestServersResponse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelServerQuery")] +internal static extern void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(IntPtr instancePtr, uint hServerQuery); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileWrite(IntPtr instancePtr, string pchFile, IntPtr pvData, int cubData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead")] +internal static extern int SteamAPI_ISteamRemoteStorage_FileRead(IntPtr instancePtr, string pchFile, IntPtr pvData, int cubDataToRead); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteAsync")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_FileWriteAsync(IntPtr instancePtr, string pchFile, IntPtr pvData, uint cubData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsync")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_FileReadAsync(IntPtr instancePtr, string pchFile, uint nOffset, uint cubToRead); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(IntPtr instancePtr, ulong hReadCall, IntPtr pvBuffer, uint cubToRead); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileForget")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileForget(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileDelete")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileDelete(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileShare")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_FileShare(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetSyncPlatforms")] +internal static extern bool SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(IntPtr instancePtr, string pchFile, uint eRemoteStoragePlatform); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(IntPtr instancePtr, ulong writeHandle, IntPtr pvData, int cubData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamClose")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(IntPtr instancePtr, ulong writeHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(IntPtr instancePtr, ulong writeHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileExists")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FileExists(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FilePersisted")] +internal static extern bool SteamAPI_ISteamRemoteStorage_FilePersisted(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileSize")] +internal static extern int SteamAPI_ISteamRemoteStorage_GetFileSize(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileTimestamp")] +internal static extern long SteamAPI_ISteamRemoteStorage_GetFileTimestamp(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetSyncPlatforms")] +internal static extern uint SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(IntPtr instancePtr, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileCount")] +internal static extern int SteamAPI_ISteamRemoteStorage_GetFileCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileNameAndSize")] +internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(IntPtr instancePtr, int iFile, ref int pnFileSizeInBytes); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetQuota")] +internal static extern bool SteamAPI_ISteamRemoteStorage_GetQuota(IntPtr instancePtr, ref int pnTotalBytes, ref int puAvailableBytes); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount")] +internal static extern bool SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp")] +internal static extern bool SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp")] +internal static extern void SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(IntPtr instancePtr, bool bEnabled); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownload")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_UGCDownload(IntPtr instancePtr, ulong hContent, uint unPriority); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress")] +internal static extern bool SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(IntPtr instancePtr, ulong hContent, ref int pnBytesDownloaded, ref int pnBytesExpected); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDetails")] +internal static extern bool SteamAPI_ISteamRemoteStorage_GetUGCDetails(IntPtr instancePtr, ulong hContent, ref uint pnAppID, string ppchName, ref int pnFileSizeInBytes, ref CSteamID pSteamIDOwner); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCRead")] +internal static extern int SteamAPI_ISteamRemoteStorage_UGCRead(IntPtr instancePtr, ulong hContent, IntPtr pvData, int cubDataToRead, uint cOffset, uint eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCCount")] +internal static extern int SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(IntPtr instancePtr, int iCachedContent); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(IntPtr instancePtr, string pchFile, string pchPreviewFile, uint nConsumerAppId, string pchTitle, string pchDescription, uint eVisibility, ref SteamParamStringArray_t pTags, uint eWorkshopFileType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(IntPtr instancePtr, ulong unPublishedFileId); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(IntPtr instancePtr, ulong updateHandle, string pchFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(IntPtr instancePtr, ulong updateHandle, string pchPreviewFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(IntPtr instancePtr, ulong updateHandle, string pchTitle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(IntPtr instancePtr, ulong updateHandle, string pchDescription); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(IntPtr instancePtr, ulong updateHandle, uint eVisibility); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(IntPtr instancePtr, ulong updateHandle, ref SteamParamStringArray_t pTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(IntPtr instancePtr, ulong updateHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(IntPtr instancePtr, ulong unPublishedFileId, uint unMaxSecondsOld); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_DeletePublishedFile")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_DeletePublishedFile(IntPtr instancePtr, ulong unPublishedFileId); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(IntPtr instancePtr, uint unStartIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_SubscribePublishedFile")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(IntPtr instancePtr, ulong unPublishedFileId); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(IntPtr instancePtr, uint unStartIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(IntPtr instancePtr, ulong unPublishedFileId); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription")] +internal static extern bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(IntPtr instancePtr, ulong updateHandle, string pchChangeDescription); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(IntPtr instancePtr, ulong unPublishedFileId); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(IntPtr instancePtr, ulong unPublishedFileId, bool bVoteUp); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(IntPtr instancePtr, ulong unPublishedFileId); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(IntPtr instancePtr, ulong steamId, uint unStartIndex, ref SteamParamStringArray_t pRequiredTags, ref SteamParamStringArray_t pExcludedTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_PublishVideo(IntPtr instancePtr, uint eVideoProvider, string pchVideoAccount, string pchVideoIdentifier, string pchPreviewFile, uint nConsumerAppId, string pchTitle, string pchDescription, uint eVisibility, ref SteamParamStringArray_t pTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(IntPtr instancePtr, ulong unPublishedFileId, uint eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(IntPtr instancePtr, uint eAction, uint unStartIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(IntPtr instancePtr, uint eEnumerationType, uint unStartIndex, uint unCount, uint unDays, ref SteamParamStringArray_t pTags, ref SteamParamStringArray_t pUserTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation")] +internal static extern ulong SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(IntPtr instancePtr, ulong hContent, string pchLocation, uint unPriority); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")] +internal static extern bool SteamAPI_ISteamUserStats_RequestCurrentStats(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetStat")] +internal static extern bool SteamAPI_ISteamUserStats_GetStat(IntPtr instancePtr, string pchName, ref int pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetStat0")] +internal static extern bool SteamAPI_ISteamUserStats_GetStat0(IntPtr instancePtr, string pchName, ref float pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_SetStat")] +internal static extern bool SteamAPI_ISteamUserStats_SetStat(IntPtr instancePtr, string pchName, int nData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_SetStat0")] +internal static extern bool SteamAPI_ISteamUserStats_SetStat0(IntPtr instancePtr, string pchName, float fData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_UpdateAvgRateStat")] +internal static extern bool SteamAPI_ISteamUserStats_UpdateAvgRateStat(IntPtr instancePtr, string pchName, float flCountThisSession, double dSessionLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetAchievement")] +internal static extern bool SteamAPI_ISteamUserStats_GetAchievement(IntPtr instancePtr, string pchName, ref bool pbAchieved); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_SetAchievement")] +internal static extern bool SteamAPI_ISteamUserStats_SetAchievement(IntPtr instancePtr, string pchName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_ClearAchievement")] +internal static extern bool SteamAPI_ISteamUserStats_ClearAchievement(IntPtr instancePtr, string pchName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime")] +internal static extern bool SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(IntPtr instancePtr, string pchName, ref bool pbAchieved, ref uint punUnlockTime); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_StoreStats")] +internal static extern bool SteamAPI_ISteamUserStats_StoreStats(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementIcon")] +internal static extern int SteamAPI_ISteamUserStats_GetAchievementIcon(IntPtr instancePtr, string pchName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute")] +internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(IntPtr instancePtr, string pchName, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_IndicateAchievementProgress")] +internal static extern bool SteamAPI_ISteamUserStats_IndicateAchievementProgress(IntPtr instancePtr, string pchName, uint nCurProgress, uint nMaxProgress); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetNumAchievements")] +internal static extern uint SteamAPI_ISteamUserStats_GetNumAchievements(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementName")] +internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName(IntPtr instancePtr, uint iAchievement); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_RequestUserStats")] +internal static extern ulong SteamAPI_ISteamUserStats_RequestUserStats(IntPtr instancePtr, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetUserStat")] +internal static extern bool SteamAPI_ISteamUserStats_GetUserStat(IntPtr instancePtr, ulong steamIDUser, string pchName, ref int pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetUserStat0")] +internal static extern bool SteamAPI_ISteamUserStats_GetUserStat0(IntPtr instancePtr, ulong steamIDUser, string pchName, ref float pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievement")] +internal static extern bool SteamAPI_ISteamUserStats_GetUserAchievement(IntPtr instancePtr, ulong steamIDUser, string pchName, ref bool pbAchieved); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime")] +internal static extern bool SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(IntPtr instancePtr, ulong steamIDUser, string pchName, ref bool pbAchieved, ref uint punUnlockTime); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_ResetAllStats")] +internal static extern bool SteamAPI_ISteamUserStats_ResetAllStats(IntPtr instancePtr, bool bAchievementsToo); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_FindOrCreateLeaderboard")] +internal static extern ulong SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(IntPtr instancePtr, string pchLeaderboardName, uint eLeaderboardSortMethod, uint eLeaderboardDisplayType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_FindLeaderboard")] +internal static extern ulong SteamAPI_ISteamUserStats_FindLeaderboard(IntPtr instancePtr, string pchLeaderboardName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardName")] +internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName(IntPtr instancePtr, ulong hSteamLeaderboard); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardEntryCount")] +internal static extern int SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(IntPtr instancePtr, ulong hSteamLeaderboard); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardSortMethod")] +internal static extern uint SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(IntPtr instancePtr, ulong hSteamLeaderboard); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardDisplayType")] +internal static extern uint SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(IntPtr instancePtr, ulong hSteamLeaderboard); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntries")] +internal static extern ulong SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(IntPtr instancePtr, ulong hSteamLeaderboard, uint eLeaderboardDataRequest, int nRangeStart, int nRangeEnd); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers")] +internal static extern ulong SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(IntPtr instancePtr, ulong hSteamLeaderboard, [In, Out] CSteamID[] prgUsers, int cUsers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry")] +internal static extern bool SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(IntPtr instancePtr, ulong hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, ref int pDetails, int cDetailsMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_UploadLeaderboardScore")] +internal static extern ulong SteamAPI_ISteamUserStats_UploadLeaderboardScore(IntPtr instancePtr, ulong hSteamLeaderboard, uint eLeaderboardUploadScoreMethod, int nScore, ref int pScoreDetails, int cScoreDetailsCount); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_AttachLeaderboardUGC")] +internal static extern ulong SteamAPI_ISteamUserStats_AttachLeaderboardUGC(IntPtr instancePtr, ulong hSteamLeaderboard, ulong hUGC); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers")] +internal static extern ulong SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages")] +internal static extern ulong SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo")] +internal static extern int SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(IntPtr instancePtr, string pchName, uint unNameBufLen, ref float pflPercent, ref bool pbAchieved); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo")] +internal static extern int SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(IntPtr instancePtr, int iIteratorPrevious, string pchName, uint unNameBufLen, ref float pflPercent, ref bool pbAchieved); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAchievedPercent")] +internal static extern bool SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(IntPtr instancePtr, string pchName, ref float pflPercent); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalStats")] +internal static extern ulong SteamAPI_ISteamUserStats_RequestGlobalStats(IntPtr instancePtr, int nHistoryDays); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStat")] +internal static extern bool SteamAPI_ISteamUserStats_GetGlobalStat(IntPtr instancePtr, string pchStatName, ref long pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStat0")] +internal static extern bool SteamAPI_ISteamUserStats_GetGlobalStat0(IntPtr instancePtr, string pchStatName, ref double pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistory")] +internal static extern int SteamAPI_ISteamUserStats_GetGlobalStatHistory(IntPtr instancePtr, string pchStatName, [In, Out] long[] pData, uint cubData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistory0")] +internal static extern int SteamAPI_ISteamUserStats_GetGlobalStatHistory0(IntPtr instancePtr, string pchStatName, [In, Out] double[] pData, uint cubData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] +internal static extern bool SteamAPI_ISteamApps_BIsSubscribed(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsLowViolence")] +internal static extern bool SteamAPI_ISteamApps_BIsLowViolence(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsCybercafe")] +internal static extern bool SteamAPI_ISteamApps_BIsCybercafe(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsVACBanned")] +internal static extern bool SteamAPI_ISteamApps_BIsVACBanned(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetCurrentGameLanguage")] +internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetAvailableGameLanguages")] +internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedApp")] +internal static extern bool SteamAPI_ISteamApps_BIsSubscribedApp(IntPtr instancePtr, uint appID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsDlcInstalled")] +internal static extern bool SteamAPI_ISteamApps_BIsDlcInstalled(IntPtr instancePtr, uint appID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime")] +internal static extern uint SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(IntPtr instancePtr, uint nAppID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend")] +internal static extern bool SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetDLCCount")] +internal static extern int SteamAPI_ISteamApps_GetDLCCount(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BGetDLCDataByIndex")] +internal static extern bool SteamAPI_ISteamApps_BGetDLCDataByIndex(IntPtr instancePtr, int iDLC, ref uint pAppID, ref bool pbAvailable, string pchName, int cchNameBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_InstallDLC")] +internal static extern void SteamAPI_ISteamApps_InstallDLC(IntPtr instancePtr, uint nAppID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_UninstallDLC")] +internal static extern void SteamAPI_ISteamApps_UninstallDLC(IntPtr instancePtr, uint nAppID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey")] +internal static extern void SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(IntPtr instancePtr, uint nAppID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetCurrentBetaName")] +internal static extern bool SteamAPI_ISteamApps_GetCurrentBetaName(IntPtr instancePtr, string pchName, int cchNameBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_MarkContentCorrupt")] +internal static extern bool SteamAPI_ISteamApps_MarkContentCorrupt(IntPtr instancePtr, bool bMissingFilesOnly); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetInstalledDepots")] +internal static extern uint SteamAPI_ISteamApps_GetInstalledDepots(IntPtr instancePtr, uint appID, ref uint pvecDepots, uint cMaxDepots); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetAppInstallDir")] +internal static extern uint SteamAPI_ISteamApps_GetAppInstallDir(IntPtr instancePtr, uint appID, string pchFolder, uint cchFolderBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsAppInstalled")] +internal static extern bool SteamAPI_ISteamApps_BIsAppInstalled(IntPtr instancePtr, uint appID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetAppOwner")] +internal static extern ulong SteamAPI_ISteamApps_GetAppOwner(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetLaunchQueryParam")] +internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam(IntPtr instancePtr, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetDlcDownloadProgress")] +internal static extern bool SteamAPI_ISteamApps_GetDlcDownloadProgress(IntPtr instancePtr, uint nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetAppBuildId")] +internal static extern int SteamAPI_ISteamApps_GetAppBuildId(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] +internal static extern bool SteamAPI_ISteamNetworking_SendP2PPacket(IntPtr instancePtr, ulong steamIDRemote, IntPtr pubData, uint cubData, uint eP2PSendType, int nChannel); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_IsP2PPacketAvailable")] +internal static extern bool SteamAPI_ISteamNetworking_IsP2PPacketAvailable(IntPtr instancePtr, ref uint pcubMsgSize, int nChannel); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_ReadP2PPacket")] +internal static extern bool SteamAPI_ISteamNetworking_ReadP2PPacket(IntPtr instancePtr, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref CSteamID psteamIDRemote, int nChannel); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser")] +internal static extern bool SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(IntPtr instancePtr, ulong steamIDRemote); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PSessionWithUser")] +internal static extern bool SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(IntPtr instancePtr, ulong steamIDRemote); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PChannelWithUser")] +internal static extern bool SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(IntPtr instancePtr, ulong steamIDRemote, int nChannel); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_GetP2PSessionState")] +internal static extern bool SteamAPI_ISteamNetworking_GetP2PSessionState(IntPtr instancePtr, ulong steamIDRemote, ref P2PSessionState_t pConnectionState); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_AllowP2PPacketRelay")] +internal static extern bool SteamAPI_ISteamNetworking_AllowP2PPacketRelay(IntPtr instancePtr, bool bAllow); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_CreateListenSocket")] +internal static extern uint SteamAPI_ISteamNetworking_CreateListenSocket(IntPtr instancePtr, int nVirtualP2PPort, uint nIP, char nPort, bool bAllowUseOfPacketRelay); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_CreateP2PConnectionSocket")] +internal static extern uint SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(IntPtr instancePtr, ulong steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_CreateConnectionSocket")] +internal static extern uint SteamAPI_ISteamNetworking_CreateConnectionSocket(IntPtr instancePtr, uint nIP, char nPort, int nTimeoutSec); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_DestroySocket")] +internal static extern bool SteamAPI_ISteamNetworking_DestroySocket(IntPtr instancePtr, uint hSocket, bool bNotifyRemoteEnd); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_DestroyListenSocket")] +internal static extern bool SteamAPI_ISteamNetworking_DestroyListenSocket(IntPtr instancePtr, uint hSocket, bool bNotifyRemoteEnd); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_SendDataOnSocket")] +internal static extern bool SteamAPI_ISteamNetworking_SendDataOnSocket(IntPtr instancePtr, uint hSocket, IntPtr pubData, uint cubData, bool bReliable); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_IsDataAvailableOnSocket")] +internal static extern bool SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(IntPtr instancePtr, uint hSocket, ref uint pcubMsgSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_RetrieveDataFromSocket")] +internal static extern bool SteamAPI_ISteamNetworking_RetrieveDataFromSocket(IntPtr instancePtr, uint hSocket, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_IsDataAvailable")] +internal static extern bool SteamAPI_ISteamNetworking_IsDataAvailable(IntPtr instancePtr, uint hListenSocket, ref uint pcubMsgSize, ref uint phSocket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_RetrieveData")] +internal static extern bool SteamAPI_ISteamNetworking_RetrieveData(IntPtr instancePtr, uint hListenSocket, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref uint phSocket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_GetSocketInfo")] +internal static extern bool SteamAPI_ISteamNetworking_GetSocketInfo(IntPtr instancePtr, uint hSocket, ref CSteamID pSteamIDRemote, ref int peSocketStatus, ref uint punIPRemote, ref char punPortRemote); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_GetListenSocketInfo")] +internal static extern bool SteamAPI_ISteamNetworking_GetListenSocketInfo(IntPtr instancePtr, uint hListenSocket, ref uint pnIP, ref char pnPort); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_GetSocketConnectionType")] +internal static extern uint SteamAPI_ISteamNetworking_GetSocketConnectionType(IntPtr instancePtr, uint hSocket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_GetMaxPacketSize")] +internal static extern int SteamAPI_ISteamNetworking_GetMaxPacketSize(IntPtr instancePtr, uint hSocket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")] +internal static extern uint SteamAPI_ISteamScreenshots_WriteScreenshot(IntPtr instancePtr, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_AddScreenshotToLibrary")] +internal static extern uint SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(IntPtr instancePtr, string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_TriggerScreenshot")] +internal static extern void SteamAPI_ISteamScreenshots_TriggerScreenshot(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_HookScreenshots")] +internal static extern void SteamAPI_ISteamScreenshots_HookScreenshots(IntPtr instancePtr, bool bHook); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_SetLocation")] +internal static extern bool SteamAPI_ISteamScreenshots_SetLocation(IntPtr instancePtr, uint hScreenshot, string pchLocation); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_TagUser")] +internal static extern bool SteamAPI_ISteamScreenshots_TagUser(IntPtr instancePtr, uint hScreenshot, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamScreenshots_TagPublishedFile")] +internal static extern bool SteamAPI_ISteamScreenshots_TagPublishedFile(IntPtr instancePtr, uint hScreenshot, ulong unPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] +internal static extern bool SteamAPI_ISteamMusic_BIsEnabled(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_BIsPlaying")] +internal static extern bool SteamAPI_ISteamMusic_BIsPlaying(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_GetPlaybackStatus")] +internal static extern int SteamAPI_ISteamMusic_GetPlaybackStatus(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_Play")] +internal static extern void SteamAPI_ISteamMusic_Play(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_Pause")] +internal static extern void SteamAPI_ISteamMusic_Pause(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_PlayPrevious")] +internal static extern void SteamAPI_ISteamMusic_PlayPrevious(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_PlayNext")] +internal static extern void SteamAPI_ISteamMusic_PlayNext(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_SetVolume")] +internal static extern void SteamAPI_ISteamMusic_SetVolume(IntPtr instancePtr, float flVolume); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusic_GetVolume")] +internal static extern float SteamAPI_ISteamMusic_GetVolume(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote")] +internal static extern bool SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(IntPtr instancePtr, string pchName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote")] +internal static extern bool SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote")] +internal static extern bool SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_BActivationSuccess")] +internal static extern bool SteamAPI_ISteamMusicRemote_BActivationSuccess(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_SetDisplayName")] +internal static extern bool SteamAPI_ISteamMusicRemote_SetDisplayName(IntPtr instancePtr, string pchDisplayName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64")] +internal static extern bool SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(IntPtr instancePtr, IntPtr pvBuffer, uint cbBufferLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlayPrevious")] +internal static extern bool SteamAPI_ISteamMusicRemote_EnablePlayPrevious(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlayNext")] +internal static extern bool SteamAPI_ISteamMusicRemote_EnablePlayNext(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_EnableShuffled")] +internal static extern bool SteamAPI_ISteamMusicRemote_EnableShuffled(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_EnableLooped")] +internal static extern bool SteamAPI_ISteamMusicRemote_EnableLooped(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_EnableQueue")] +internal static extern bool SteamAPI_ISteamMusicRemote_EnableQueue(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlaylists")] +internal static extern bool SteamAPI_ISteamMusicRemote_EnablePlaylists(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(IntPtr instancePtr, int nStatus); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateShuffled")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdateShuffled(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateLooped")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdateLooped(IntPtr instancePtr, bool bValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateVolume")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdateVolume(IntPtr instancePtr, float flValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryWillChange")] +internal static extern bool SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable")] +internal static extern bool SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(IntPtr instancePtr, bool bAvailable); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(IntPtr instancePtr, string pchText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(IntPtr instancePtr, int nValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt")] +internal static extern bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(IntPtr instancePtr, IntPtr pvBuffer, uint cbBufferLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryDidChange")] +internal static extern bool SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_QueueWillChange")] +internal static extern bool SteamAPI_ISteamMusicRemote_QueueWillChange(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_ResetQueueEntries")] +internal static extern bool SteamAPI_ISteamMusicRemote_ResetQueueEntries(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_SetQueueEntry")] +internal static extern bool SteamAPI_ISteamMusicRemote_SetQueueEntry(IntPtr instancePtr, int nID, int nPosition, string pchEntryText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry")] +internal static extern bool SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(IntPtr instancePtr, int nID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_QueueDidChange")] +internal static extern bool SteamAPI_ISteamMusicRemote_QueueDidChange(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_PlaylistWillChange")] +internal static extern bool SteamAPI_ISteamMusicRemote_PlaylistWillChange(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_ResetPlaylistEntries")] +internal static extern bool SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_SetPlaylistEntry")] +internal static extern bool SteamAPI_ISteamMusicRemote_SetPlaylistEntry(IntPtr instancePtr, int nID, int nPosition, string pchEntryText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry")] +internal static extern bool SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(IntPtr instancePtr, int nID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMusicRemote_PlaylistDidChange")] +internal static extern bool SteamAPI_ISteamMusicRemote_PlaylistDidChange(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest")] +internal static extern uint SteamAPI_ISteamHTTP_CreateHTTPRequest(IntPtr instancePtr, uint eHTTPRequestMethod, string pchAbsoluteURL); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestContextValue")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(IntPtr instancePtr, uint hRequest, ulong ulContextValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(IntPtr instancePtr, uint hRequest, uint unTimeoutSeconds); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(IntPtr instancePtr, uint hRequest, string pchHeaderName, string pchHeaderValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(IntPtr instancePtr, uint hRequest, string pchParamName, string pchParamValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SendHTTPRequest")] +internal static extern bool SteamAPI_ISteamHTTP_SendHTTPRequest(IntPtr instancePtr, uint hRequest, ref ulong pCallHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse")] +internal static extern bool SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(IntPtr instancePtr, uint hRequest, ref ulong pCallHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_DeferHTTPRequest")] +internal static extern bool SteamAPI_ISteamHTTP_DeferHTTPRequest(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_PrioritizeHTTPRequest")] +internal static extern bool SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(IntPtr instancePtr, uint hRequest, string pchHeaderName, ref uint unResponseHeaderSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(IntPtr instancePtr, uint hRequest, string pchHeaderName, IntPtr pHeaderValueBuffer, uint unBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseBodySize")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(IntPtr instancePtr, uint hRequest, ref uint unBodySize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseBodyData")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(IntPtr instancePtr, uint hRequest, IntPtr pBodyDataBuffer, uint unBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(IntPtr instancePtr, uint hRequest, uint cOffset, IntPtr pBodyDataBuffer, uint unBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_ReleaseHTTPRequest")] +internal static extern bool SteamAPI_ISteamHTTP_ReleaseHTTPRequest(IntPtr instancePtr, uint hRequest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(IntPtr instancePtr, uint hRequest, ref float pflPercentOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(IntPtr instancePtr, uint hRequest, string pchContentType, IntPtr pubBody, uint unBodyLen); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_CreateCookieContainer")] +internal static extern uint SteamAPI_ISteamHTTP_CreateCookieContainer(IntPtr instancePtr, bool bAllowResponsesToModify); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_ReleaseCookieContainer")] +internal static extern bool SteamAPI_ISteamHTTP_ReleaseCookieContainer(IntPtr instancePtr, uint hCookieContainer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetCookie")] +internal static extern bool SteamAPI_ISteamHTTP_SetCookie(IntPtr instancePtr, uint hCookieContainer, string pchHost, string pchUrl, string pchCookie); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(IntPtr instancePtr, uint hRequest, uint hCookieContainer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(IntPtr instancePtr, uint hRequest, string pchUserAgentInfo); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(IntPtr instancePtr, uint hRequest, bool bRequireVerifiedCertificate); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS")] +internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(IntPtr instancePtr, uint hRequest, uint unMilliseconds); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut")] +internal static extern bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(IntPtr instancePtr, uint hRequest, ref bool pbWasTimedOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUnifiedMessages_SendMethod")] +internal static extern ulong SteamAPI_ISteamUnifiedMessages_SendMethod(IntPtr instancePtr, string pchServiceMethod, IntPtr pRequestBuffer, uint unRequestBufferSize, ulong unContext); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUnifiedMessages_GetMethodResponseInfo")] +internal static extern bool SteamAPI_ISteamUnifiedMessages_GetMethodResponseInfo(IntPtr instancePtr, ulong hHandle, ref uint punResponseSize, ref uint peResult); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUnifiedMessages_GetMethodResponseData")] +internal static extern bool SteamAPI_ISteamUnifiedMessages_GetMethodResponseData(IntPtr instancePtr, ulong hHandle, IntPtr pResponseBuffer, uint unResponseBufferSize, bool bAutoRelease); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUnifiedMessages_ReleaseMethod")] +internal static extern bool SteamAPI_ISteamUnifiedMessages_ReleaseMethod(IntPtr instancePtr, ulong hHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUnifiedMessages_SendNotification")] +internal static extern bool SteamAPI_ISteamUnifiedMessages_SendNotification(IntPtr instancePtr, string pchServiceNotification, IntPtr pNotificationBuffer, uint unNotificationBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_Init")] +internal static extern bool SteamAPI_ISteamController_Init(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_Shutdown")] +internal static extern bool SteamAPI_ISteamController_Shutdown(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_RunFrame")] +internal static extern void SteamAPI_ISteamController_RunFrame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetConnectedControllers")] +internal static extern int SteamAPI_ISteamController_GetConnectedControllers(IntPtr instancePtr, ref ulong handlesOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel")] +internal static extern bool SteamAPI_ISteamController_ShowBindingPanel(IntPtr instancePtr, ulong controllerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetActionSetHandle")] +internal static extern ulong SteamAPI_ISteamController_GetActionSetHandle(IntPtr instancePtr, string pszActionSetName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ActivateActionSet")] +internal static extern void SteamAPI_ISteamController_ActivateActionSet(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetCurrentActionSet")] +internal static extern ulong SteamAPI_ISteamController_GetCurrentActionSet(IntPtr instancePtr, ulong controllerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle")] +internal static extern ulong SteamAPI_ISteamController_GetDigitalActionHandle(IntPtr instancePtr, string pszActionName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionData")] +internal static extern ControllerDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionOrigins")] +internal static extern int SteamAPI_ISteamController_GetDigitalActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionHandle")] +internal static extern ulong SteamAPI_ISteamController_GetAnalogActionHandle(IntPtr instancePtr, string pszActionName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionData")] +internal static extern ControllerAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionOrigins")] +internal static extern int SteamAPI_ISteamController_GetAnalogActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_StopAnalogActionMomentum")] +internal static extern void SteamAPI_ISteamController_StopAnalogActionMomentum(IntPtr instancePtr, ulong controllerHandle, ulong eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TriggerHapticPulse")] +internal static extern void SteamAPI_ISteamController_TriggerHapticPulse(IntPtr instancePtr, ulong controllerHandle, uint eTargetPad, char usDurationMicroSec); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] +internal static extern ulong SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(IntPtr instancePtr, uint unAccountID, uint eListType, uint eMatchingUGCType, uint eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint unPage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest")] +internal static extern ulong SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(IntPtr instancePtr, uint eQueryType, uint eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint unPage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest")] +internal static extern ulong SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(IntPtr instancePtr, ref ulong pvecPublishedFileID, uint unNumPublishedFileIDs); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SendQueryUGCRequest")] +internal static extern ulong SteamAPI_ISteamUGC_SendQueryUGCRequest(IntPtr instancePtr, ulong handle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCResult")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCResult(IntPtr instancePtr, ulong handle, uint index, ref SteamUGCDetails_t pDetails); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCPreviewURL")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(IntPtr instancePtr, ulong handle, uint index, string pchURL, uint cchURLSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCMetadata")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCMetadata(IntPtr instancePtr, ulong handle, uint index, string pchMetadata, uint cchMetadatasize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCChildren")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCChildren(IntPtr instancePtr, ulong handle, uint index, ref ulong pvecPublishedFileID, uint cMaxEntries); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCStatistic")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCStatistic(IntPtr instancePtr, ulong handle, uint index, uint eStatType, ref uint pStatValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews")] +internal static extern uint SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(IntPtr instancePtr, ulong handle, uint index); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(IntPtr instancePtr, ulong handle, uint index, uint previewIndex, string pchURLOrVideoID, uint cchURLSize, ref bool pbIsImage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags")] +internal static extern uint SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(IntPtr instancePtr, ulong handle, uint index); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag")] +internal static extern bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(IntPtr instancePtr, ulong handle, uint index, uint keyValueTagIndex, string pchKey, uint cchKeySize, string pchValue, uint cchValueSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest")] +internal static extern bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(IntPtr instancePtr, ulong handle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTag")] +internal static extern bool SteamAPI_ISteamUGC_AddRequiredTag(IntPtr instancePtr, ulong handle, string pTagName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddExcludedTag")] +internal static extern bool SteamAPI_ISteamUGC_AddExcludedTag(IntPtr instancePtr, ulong handle, string pTagName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetReturnKeyValueTags")] +internal static extern bool SteamAPI_ISteamUGC_SetReturnKeyValueTags(IntPtr instancePtr, ulong handle, bool bReturnKeyValueTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetReturnLongDescription")] +internal static extern bool SteamAPI_ISteamUGC_SetReturnLongDescription(IntPtr instancePtr, ulong handle, bool bReturnLongDescription); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetReturnMetadata")] +internal static extern bool SteamAPI_ISteamUGC_SetReturnMetadata(IntPtr instancePtr, ulong handle, bool bReturnMetadata); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetReturnChildren")] +internal static extern bool SteamAPI_ISteamUGC_SetReturnChildren(IntPtr instancePtr, ulong handle, bool bReturnChildren); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetReturnAdditionalPreviews")] +internal static extern bool SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(IntPtr instancePtr, ulong handle, bool bReturnAdditionalPreviews); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetReturnTotalOnly")] +internal static extern bool SteamAPI_ISteamUGC_SetReturnTotalOnly(IntPtr instancePtr, ulong handle, bool bReturnTotalOnly); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetLanguage")] +internal static extern bool SteamAPI_ISteamUGC_SetLanguage(IntPtr instancePtr, ulong handle, string pchLanguage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetAllowCachedResponse")] +internal static extern bool SteamAPI_ISteamUGC_SetAllowCachedResponse(IntPtr instancePtr, ulong handle, uint unMaxAgeSeconds); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetCloudFileNameFilter")] +internal static extern bool SteamAPI_ISteamUGC_SetCloudFileNameFilter(IntPtr instancePtr, ulong handle, string pMatchCloudFileName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetMatchAnyTag")] +internal static extern bool SteamAPI_ISteamUGC_SetMatchAnyTag(IntPtr instancePtr, ulong handle, bool bMatchAnyTag); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetSearchText")] +internal static extern bool SteamAPI_ISteamUGC_SetSearchText(IntPtr instancePtr, ulong handle, string pSearchText); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetRankedByTrendDays")] +internal static extern bool SteamAPI_ISteamUGC_SetRankedByTrendDays(IntPtr instancePtr, ulong handle, uint unDays); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddRequiredKeyValueTag")] +internal static extern bool SteamAPI_ISteamUGC_AddRequiredKeyValueTag(IntPtr instancePtr, ulong handle, string pKey, string pValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_RequestUGCDetails")] +internal static extern ulong SteamAPI_ISteamUGC_RequestUGCDetails(IntPtr instancePtr, ulong nPublishedFileID, uint unMaxAgeSeconds); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateItem")] +internal static extern ulong SteamAPI_ISteamUGC_CreateItem(IntPtr instancePtr, uint nConsumerAppId, uint eFileType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_StartItemUpdate")] +internal static extern ulong SteamAPI_ISteamUGC_StartItemUpdate(IntPtr instancePtr, uint nConsumerAppId, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemTitle")] +internal static extern bool SteamAPI_ISteamUGC_SetItemTitle(IntPtr instancePtr, ulong handle, string pchTitle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemDescription")] +internal static extern bool SteamAPI_ISteamUGC_SetItemDescription(IntPtr instancePtr, ulong handle, string pchDescription); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemUpdateLanguage")] +internal static extern bool SteamAPI_ISteamUGC_SetItemUpdateLanguage(IntPtr instancePtr, ulong handle, string pchLanguage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemMetadata")] +internal static extern bool SteamAPI_ISteamUGC_SetItemMetadata(IntPtr instancePtr, ulong handle, string pchMetaData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility")] +internal static extern bool SteamAPI_ISteamUGC_SetItemVisibility(IntPtr instancePtr, ulong handle, uint eVisibility); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemTags")] +internal static extern bool SteamAPI_ISteamUGC_SetItemTags(IntPtr instancePtr, ulong updateHandle, ref SteamParamStringArray_t pTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemContent")] +internal static extern bool SteamAPI_ISteamUGC_SetItemContent(IntPtr instancePtr, ulong handle, string pszContentFolder); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview")] +internal static extern bool SteamAPI_ISteamUGC_SetItemPreview(IntPtr instancePtr, ulong handle, string pszPreviewFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags")] +internal static extern bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(IntPtr instancePtr, ulong handle, string pchKey); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag")] +internal static extern bool SteamAPI_ISteamUGC_AddItemKeyValueTag(IntPtr instancePtr, ulong handle, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SubmitItemUpdate")] +internal static extern ulong SteamAPI_ISteamUGC_SubmitItemUpdate(IntPtr instancePtr, ulong handle, string pchChangeNote); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetItemUpdateProgress")] +internal static extern uint SteamAPI_ISteamUGC_GetItemUpdateProgress(IntPtr instancePtr, ulong handle, ref ulong punBytesProcessed, ref ulong punBytesTotal); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetUserItemVote")] +internal static extern ulong SteamAPI_ISteamUGC_SetUserItemVote(IntPtr instancePtr, ulong nPublishedFileID, bool bVoteUp); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetUserItemVote")] +internal static extern ulong SteamAPI_ISteamUGC_GetUserItemVote(IntPtr instancePtr, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddItemToFavorites")] +internal static extern ulong SteamAPI_ISteamUGC_AddItemToFavorites(IntPtr instancePtr, uint nAppId, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_RemoveItemFromFavorites")] +internal static extern ulong SteamAPI_ISteamUGC_RemoveItemFromFavorites(IntPtr instancePtr, uint nAppId, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SubscribeItem")] +internal static extern ulong SteamAPI_ISteamUGC_SubscribeItem(IntPtr instancePtr, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_UnsubscribeItem")] +internal static extern ulong SteamAPI_ISteamUGC_UnsubscribeItem(IntPtr instancePtr, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetNumSubscribedItems")] +internal static extern uint SteamAPI_ISteamUGC_GetNumSubscribedItems(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetSubscribedItems")] +internal static extern uint SteamAPI_ISteamUGC_GetSubscribedItems(IntPtr instancePtr, ref ulong pvecPublishedFileID, uint cMaxEntries); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetItemState")] +internal static extern uint SteamAPI_ISteamUGC_GetItemState(IntPtr instancePtr, ulong nPublishedFileID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetItemInstallInfo")] +internal static extern bool SteamAPI_ISteamUGC_GetItemInstallInfo(IntPtr instancePtr, ulong nPublishedFileID, ref ulong punSizeOnDisk, string pchFolder, uint cchFolderSize, ref uint punTimeStamp); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_GetItemDownloadInfo")] +internal static extern bool SteamAPI_ISteamUGC_GetItemDownloadInfo(IntPtr instancePtr, ulong nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_DownloadItem")] +internal static extern bool SteamAPI_ISteamUGC_DownloadItem(IntPtr instancePtr, ulong nPublishedFileID, bool bHighPriority); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_BInitWorkshopForGameServer")] +internal static extern bool SteamAPI_ISteamUGC_BInitWorkshopForGameServer(IntPtr instancePtr, uint unWorkshopDepotID, string pszFolder); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SuspendDownloads")] +internal static extern void SteamAPI_ISteamUGC_SuspendDownloads(IntPtr instancePtr, bool bSuspend); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamAppList_GetNumInstalledApps")] +internal static extern uint SteamAPI_ISteamAppList_GetNumInstalledApps(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamAppList_GetInstalledApps")] +internal static extern uint SteamAPI_ISteamAppList_GetInstalledApps(IntPtr instancePtr, ref uint pvecAppID, uint unMaxAppIDs); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamAppList_GetAppName")] +internal static extern int SteamAPI_ISteamAppList_GetAppName(IntPtr instancePtr, uint nAppID, string pchName, int cchNameMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamAppList_GetAppInstallDir")] +internal static extern int SteamAPI_ISteamAppList_GetAppInstallDir(IntPtr instancePtr, uint nAppID, string pchDirectory, int cchNameMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamAppList_GetAppBuildId")] +internal static extern int SteamAPI_ISteamAppList_GetAppBuildId(IntPtr instancePtr, uint nAppID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface")] +internal static extern void SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_Init")] +internal static extern bool SteamAPI_ISteamHTMLSurface_Init(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_Shutdown")] +internal static extern bool SteamAPI_ISteamHTMLSurface_Shutdown(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_CreateBrowser")] +internal static extern ulong SteamAPI_ISteamHTMLSurface_CreateBrowser(IntPtr instancePtr, string pchUserAgent, string pchUserCSS); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_RemoveBrowser")] +internal static extern void SteamAPI_ISteamHTMLSurface_RemoveBrowser(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_LoadURL")] +internal static extern void SteamAPI_ISteamHTMLSurface_LoadURL(IntPtr instancePtr, uint unBrowserHandle, string pchURL, string pchPostData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetSize")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetSize(IntPtr instancePtr, uint unBrowserHandle, uint unWidth, uint unHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_StopLoad")] +internal static extern void SteamAPI_ISteamHTMLSurface_StopLoad(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_Reload")] +internal static extern void SteamAPI_ISteamHTMLSurface_Reload(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_GoBack")] +internal static extern void SteamAPI_ISteamHTMLSurface_GoBack(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_GoForward")] +internal static extern void SteamAPI_ISteamHTMLSurface_GoForward(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_AddHeader")] +internal static extern void SteamAPI_ISteamHTMLSurface_AddHeader(IntPtr instancePtr, uint unBrowserHandle, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_ExecuteJavascript")] +internal static extern void SteamAPI_ISteamHTMLSurface_ExecuteJavascript(IntPtr instancePtr, uint unBrowserHandle, string pchScript); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseUp")] +internal static extern void SteamAPI_ISteamHTMLSurface_MouseUp(IntPtr instancePtr, uint unBrowserHandle, uint eMouseButton); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseDown")] +internal static extern void SteamAPI_ISteamHTMLSurface_MouseDown(IntPtr instancePtr, uint unBrowserHandle, uint eMouseButton); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseDoubleClick")] +internal static extern void SteamAPI_ISteamHTMLSurface_MouseDoubleClick(IntPtr instancePtr, uint unBrowserHandle, uint eMouseButton); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseMove")] +internal static extern void SteamAPI_ISteamHTMLSurface_MouseMove(IntPtr instancePtr, uint unBrowserHandle, int x, int y); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseWheel")] +internal static extern void SteamAPI_ISteamHTMLSurface_MouseWheel(IntPtr instancePtr, uint unBrowserHandle, int nDelta); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyDown")] +internal static extern void SteamAPI_ISteamHTMLSurface_KeyDown(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyUp")] +internal static extern void SteamAPI_ISteamHTMLSurface_KeyUp(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyChar")] +internal static extern void SteamAPI_ISteamHTMLSurface_KeyChar(IntPtr instancePtr, uint unBrowserHandle, uint cUnicodeChar, uint eHTMLKeyModifiers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetHorizontalScroll")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(IntPtr instancePtr, uint unBrowserHandle, uint nAbsolutePixelScroll); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetVerticalScroll")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetVerticalScroll(IntPtr instancePtr, uint unBrowserHandle, uint nAbsolutePixelScroll); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetKeyFocus")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetKeyFocus(IntPtr instancePtr, uint unBrowserHandle, bool bHasKeyFocus); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_ViewSource")] +internal static extern void SteamAPI_ISteamHTMLSurface_ViewSource(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_CopyToClipboard")] +internal static extern void SteamAPI_ISteamHTMLSurface_CopyToClipboard(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_PasteFromClipboard")] +internal static extern void SteamAPI_ISteamHTMLSurface_PasteFromClipboard(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_Find")] +internal static extern void SteamAPI_ISteamHTMLSurface_Find(IntPtr instancePtr, uint unBrowserHandle, string pchSearchStr, bool bCurrentlyInFind, bool bReverse); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_StopFind")] +internal static extern void SteamAPI_ISteamHTMLSurface_StopFind(IntPtr instancePtr, uint unBrowserHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_GetLinkAtPosition")] +internal static extern void SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(IntPtr instancePtr, uint unBrowserHandle, int x, int y); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetCookie")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetCookie(IntPtr instancePtr, string pchHostname, string pchKey, string pchValue, string pchPath, ulong nExpires, bool bSecure, bool bHTTPOnly); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetPageScaleFactor")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(IntPtr instancePtr, uint unBrowserHandle, float flZoom, int nPointX, int nPointY); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetBackgroundMode")] +internal static extern void SteamAPI_ISteamHTMLSurface_SetBackgroundMode(IntPtr instancePtr, uint unBrowserHandle, bool bBackgroundMode); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_AllowStartRequest")] +internal static extern void SteamAPI_ISteamHTMLSurface_AllowStartRequest(IntPtr instancePtr, uint unBrowserHandle, bool bAllowed); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_JSDialogResponse")] +internal static extern void SteamAPI_ISteamHTMLSurface_JSDialogResponse(IntPtr instancePtr, uint unBrowserHandle, bool bResult); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse")] +internal static extern void SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse(IntPtr instancePtr, uint unBrowserHandle, string pchSelectedFiles); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")] +internal static extern uint SteamAPI_ISteamInventory_GetResultStatus(IntPtr instancePtr, int resultHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetResultItems")] +internal static extern bool SteamAPI_ISteamInventory_GetResultItems(IntPtr instancePtr, int resultHandle, [In, Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetResultTimestamp")] +internal static extern uint SteamAPI_ISteamInventory_GetResultTimestamp(IntPtr instancePtr, int resultHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_CheckResultSteamID")] +internal static extern bool SteamAPI_ISteamInventory_CheckResultSteamID(IntPtr instancePtr, int resultHandle, ulong steamIDExpected); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_DestroyResult")] +internal static extern void SteamAPI_ISteamInventory_DestroyResult(IntPtr instancePtr, int resultHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetAllItems")] +internal static extern bool SteamAPI_ISteamInventory_GetAllItems(IntPtr instancePtr, ref int pResultHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemsByID")] +internal static extern bool SteamAPI_ISteamInventory_GetItemsByID(IntPtr instancePtr, ref int pResultHandle, [In, Out] ulong[] pInstanceIDs, uint unCountInstanceIDs); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_SerializeResult")] +internal static extern bool SteamAPI_ISteamInventory_SerializeResult(IntPtr instancePtr, int resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_DeserializeResult")] +internal static extern bool SteamAPI_ISteamInventory_DeserializeResult(IntPtr instancePtr, ref int pOutResultHandle, IntPtr pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GenerateItems")] +internal static extern bool SteamAPI_ISteamInventory_GenerateItems(IntPtr instancePtr, ref int pResultHandle, [In, Out] int[] pArrayItemDefs, [In, Out] uint[] punArrayQuantity, uint unArrayLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GrantPromoItems")] +internal static extern bool SteamAPI_ISteamInventory_GrantPromoItems(IntPtr instancePtr, ref int pResultHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_AddPromoItem")] +internal static extern bool SteamAPI_ISteamInventory_AddPromoItem(IntPtr instancePtr, ref int pResultHandle, int itemDef); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_AddPromoItems")] +internal static extern bool SteamAPI_ISteamInventory_AddPromoItems(IntPtr instancePtr, ref int pResultHandle, [In, Out] int[] pArrayItemDefs, uint unArrayLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_ConsumeItem")] +internal static extern bool SteamAPI_ISteamInventory_ConsumeItem(IntPtr instancePtr, ref int pResultHandle, ulong itemConsume, uint unQuantity); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_ExchangeItems")] +internal static extern bool SteamAPI_ISteamInventory_ExchangeItems(IntPtr instancePtr, ref int pResultHandle, [In, Out] int[] pArrayGenerate, [In, Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In, Out] ulong[] pArrayDestroy, [In, Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_TransferItemQuantity")] +internal static extern bool SteamAPI_ISteamInventory_TransferItemQuantity(IntPtr instancePtr, ref int pResultHandle, ulong itemIdSource, uint unQuantity, ulong itemIdDest); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_SendItemDropHeartbeat")] +internal static extern void SteamAPI_ISteamInventory_SendItemDropHeartbeat(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_TriggerItemDrop")] +internal static extern bool SteamAPI_ISteamInventory_TriggerItemDrop(IntPtr instancePtr, ref int pResultHandle, int dropListDefinition); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_TradeItems")] +internal static extern bool SteamAPI_ISteamInventory_TradeItems(IntPtr instancePtr, ref int pResultHandle, ulong steamIDTradePartner, [In, Out] ulong[] pArrayGive, [In, Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In, Out] ulong[] pArrayGet, [In, Out] uint[] pArrayGetQuantity, uint nArrayGetLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_LoadItemDefinitions")] +internal static extern bool SteamAPI_ISteamInventory_LoadItemDefinitions(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionIDs")] +internal static extern bool SteamAPI_ISteamInventory_GetItemDefinitionIDs(IntPtr instancePtr, [In, Out] int[] pItemDefIDs, ref uint punItemDefIDsArraySize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty")] +internal static extern bool SteamAPI_ISteamInventory_GetItemDefinitionProperty(IntPtr instancePtr, int iDefinition, string pchPropertyName, System.Text.StringBuilder pchValueBuffer, ref uint punValueBufferSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] +internal static extern void SteamAPI_ISteamVideo_GetVideoURL(IntPtr instancePtr, uint unVideoAppID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamVideo_IsBroadcasting")] +internal static extern bool SteamAPI_ISteamVideo_IsBroadcasting(IntPtr instancePtr, ref int pnNumViewers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_InitGameServer")] +internal static extern bool SteamAPI_ISteamGameServer_InitGameServer(IntPtr instancePtr, uint unIP, char usGamePort, char usQueryPort, uint unFlags, uint nGameAppId, string pchVersionString); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetProduct")] +internal static extern void SteamAPI_ISteamGameServer_SetProduct(IntPtr instancePtr, string pszProduct); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetGameDescription")] +internal static extern void SteamAPI_ISteamGameServer_SetGameDescription(IntPtr instancePtr, string pszGameDescription); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetModDir")] +internal static extern void SteamAPI_ISteamGameServer_SetModDir(IntPtr instancePtr, string pszModDir); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetDedicatedServer")] +internal static extern void SteamAPI_ISteamGameServer_SetDedicatedServer(IntPtr instancePtr, bool bDedicated); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_LogOn")] +internal static extern void SteamAPI_ISteamGameServer_LogOn(IntPtr instancePtr, string pszToken); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_LogOnAnonymous")] +internal static extern void SteamAPI_ISteamGameServer_LogOnAnonymous(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_LogOff")] +internal static extern void SteamAPI_ISteamGameServer_LogOff(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_BLoggedOn")] +internal static extern bool SteamAPI_ISteamGameServer_BLoggedOn(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_BSecure")] +internal static extern bool SteamAPI_ISteamGameServer_BSecure(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_GetSteamID")] +internal static extern ulong SteamAPI_ISteamGameServer_GetSteamID(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_WasRestartRequested")] +internal static extern bool SteamAPI_ISteamGameServer_WasRestartRequested(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetMaxPlayerCount")] +internal static extern void SteamAPI_ISteamGameServer_SetMaxPlayerCount(IntPtr instancePtr, int cPlayersMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetBotPlayerCount")] +internal static extern void SteamAPI_ISteamGameServer_SetBotPlayerCount(IntPtr instancePtr, int cBotplayers); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetServerName")] +internal static extern void SteamAPI_ISteamGameServer_SetServerName(IntPtr instancePtr, string pszServerName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetMapName")] +internal static extern void SteamAPI_ISteamGameServer_SetMapName(IntPtr instancePtr, string pszMapName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetPasswordProtected")] +internal static extern void SteamAPI_ISteamGameServer_SetPasswordProtected(IntPtr instancePtr, bool bPasswordProtected); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorPort")] +internal static extern void SteamAPI_ISteamGameServer_SetSpectatorPort(IntPtr instancePtr, char unSpectatorPort); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorServerName")] +internal static extern void SteamAPI_ISteamGameServer_SetSpectatorServerName(IntPtr instancePtr, string pszSpectatorServerName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_ClearAllKeyValues")] +internal static extern void SteamAPI_ISteamGameServer_ClearAllKeyValues(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetKeyValue")] +internal static extern void SteamAPI_ISteamGameServer_SetKeyValue(IntPtr instancePtr, string pKey, string pValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetGameTags")] +internal static extern void SteamAPI_ISteamGameServer_SetGameTags(IntPtr instancePtr, string pchGameTags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetGameData")] +internal static extern void SteamAPI_ISteamGameServer_SetGameData(IntPtr instancePtr, string pchGameData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetRegion")] +internal static extern void SteamAPI_ISteamGameServer_SetRegion(IntPtr instancePtr, string pszRegion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate")] +internal static extern bool SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(IntPtr instancePtr, uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref CSteamID pSteamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection")] +internal static extern ulong SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SendUserDisconnect")] +internal static extern void SteamAPI_ISteamGameServer_SendUserDisconnect(IntPtr instancePtr, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_BUpdateUserData")] +internal static extern bool SteamAPI_ISteamGameServer_BUpdateUserData(IntPtr instancePtr, ulong steamIDUser, string pchPlayerName, uint uScore); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_GetAuthSessionTicket")] +internal static extern uint SteamAPI_ISteamGameServer_GetAuthSessionTicket(IntPtr instancePtr, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_BeginAuthSession")] +internal static extern uint SteamAPI_ISteamGameServer_BeginAuthSession(IntPtr instancePtr, IntPtr pAuthTicket, int cbAuthTicket, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_EndAuthSession")] +internal static extern void SteamAPI_ISteamGameServer_EndAuthSession(IntPtr instancePtr, ulong steamID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_CancelAuthTicket")] +internal static extern void SteamAPI_ISteamGameServer_CancelAuthTicket(IntPtr instancePtr, uint hAuthTicket); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_UserHasLicenseForApp")] +internal static extern uint SteamAPI_ISteamGameServer_UserHasLicenseForApp(IntPtr instancePtr, ulong steamID, uint appID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_RequestUserGroupStatus")] +internal static extern bool SteamAPI_ISteamGameServer_RequestUserGroupStatus(IntPtr instancePtr, ulong steamIDUser, ulong steamIDGroup); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_GetGameplayStats")] +internal static extern void SteamAPI_ISteamGameServer_GetGameplayStats(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_GetServerReputation")] +internal static extern ulong SteamAPI_ISteamGameServer_GetServerReputation(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_GetPublicIP")] +internal static extern uint SteamAPI_ISteamGameServer_GetPublicIP(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_HandleIncomingPacket")] +internal static extern bool SteamAPI_ISteamGameServer_HandleIncomingPacket(IntPtr instancePtr, IntPtr pData, int cbData, uint srcIP, char srcPort); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_GetNextOutgoingPacket")] +internal static extern int SteamAPI_ISteamGameServer_GetNextOutgoingPacket(IntPtr instancePtr, IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref char pPort); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_EnableHeartbeats")] +internal static extern void SteamAPI_ISteamGameServer_EnableHeartbeats(IntPtr instancePtr, bool bActive); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_SetHeartbeatInterval")] +internal static extern void SteamAPI_ISteamGameServer_SetHeartbeatInterval(IntPtr instancePtr, int iHeartbeatInterval); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_ForceHeartbeat")] +internal static extern void SteamAPI_ISteamGameServer_ForceHeartbeat(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_AssociateWithClan")] +internal static extern ulong SteamAPI_ISteamGameServer_AssociateWithClan(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility")] +internal static extern ulong SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(IntPtr instancePtr, ulong steamIDNewPlayer); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")] +internal static extern ulong SteamAPI_ISteamGameServerStats_RequestUserStats(IntPtr instancePtr, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStat")] +internal static extern bool SteamAPI_ISteamGameServerStats_GetUserStat(IntPtr instancePtr, ulong steamIDUser, string pchName, ref int pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStat0")] +internal static extern bool SteamAPI_ISteamGameServerStats_GetUserStat0(IntPtr instancePtr, ulong steamIDUser, string pchName, ref float pData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserAchievement")] +internal static extern bool SteamAPI_ISteamGameServerStats_GetUserAchievement(IntPtr instancePtr, ulong steamIDUser, string pchName, ref bool pbAchieved); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStat")] +internal static extern bool SteamAPI_ISteamGameServerStats_SetUserStat(IntPtr instancePtr, ulong steamIDUser, string pchName, int nData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStat0")] +internal static extern bool SteamAPI_ISteamGameServerStats_SetUserStat0(IntPtr instancePtr, ulong steamIDUser, string pchName, float fData); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat")] +internal static extern bool SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(IntPtr instancePtr, ulong steamIDUser, string pchName, float flCountThisSession, double dSessionLength); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserAchievement")] +internal static extern bool SteamAPI_ISteamGameServerStats_SetUserAchievement(IntPtr instancePtr, ulong steamIDUser, string pchName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_ClearUserAchievement")] +internal static extern bool SteamAPI_ISteamGameServerStats_ClearUserAchievement(IntPtr instancePtr, ulong steamIDUser, string pchName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameServerStats_StoreUserStats")] +internal static extern ulong SteamAPI_ISteamGameServerStats_StoreUserStats(IntPtr instancePtr, ulong steamIDUser); + +} + +} + +namespace Valve.Steamworks +{ + + public abstract class ISteamClient + { + public abstract IntPtr GetIntPtr(); + public abstract uint CreateSteamPipe(); + public abstract bool BReleaseSteamPipe(uint hSteamPipe); + public abstract uint ConnectToGlobalUser(uint hSteamPipe); + public abstract uint CreateLocalUser(ref uint phSteamPipe,uint eAccountType); + public abstract void ReleaseUser(uint hSteamPipe,uint hUser); + public abstract ISteamUser GetISteamUser(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamGameServer GetISteamGameServer(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract void SetLocalIPBinding(uint unIP,char usPort); + public abstract ISteamFriends GetISteamFriends(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamUtils GetISteamUtils(uint hSteamPipe,string pchVersion); + public abstract ISteamMatchmaking GetISteamMatchmaking(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamMatchmakingServers GetISteamMatchmakingServers(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract IntPtr GetISteamGenericInterface(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamUserStats GetISteamUserStats(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamGameServerStats GetISteamGameServerStats(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamApps GetISteamApps(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamNetworking GetISteamNetworking(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamRemoteStorage GetISteamRemoteStorage(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamScreenshots GetISteamScreenshots(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract void RunFrame(); + public abstract uint GetIPCCallCount(); + public abstract void SetWarningMessageHook(IntPtr pFunction); + public abstract bool BShutdownIfAllPipesClosed(); + public abstract ISteamHTTP GetISteamHTTP(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamUnifiedMessages GetISteamUnifiedMessages(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamController GetISteamController(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamUGC GetISteamUGC(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamAppList GetISteamAppList(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamMusic GetISteamMusic(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamMusicRemote GetISteamMusicRemote(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamHTMLSurface GetISteamHTMLSurface(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract void Set_SteamAPI_CPostAPIResultInProcess(IntPtr func); + public abstract void Remove_SteamAPI_CPostAPIResultInProcess(IntPtr func); + public abstract void Set_SteamAPI_CCheckCallbackRegisteredInProcess(IntPtr func); + public abstract ISteamInventory GetISteamInventory(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamVideo GetISteamVideo(uint hSteamuser,uint hSteamPipe,string pchVersion); + } + + + public abstract class ISteamUser + { + public abstract IntPtr GetIntPtr(); + public abstract uint GetHSteamUser(); + public abstract bool BLoggedOn(); + public abstract ulong GetSteamID(); + public abstract int InitiateGameConnection(IntPtr pAuthBlob,int cbMaxAuthBlob,ulong steamIDGameServer,uint unIPServer,char usPortServer,bool bSecure); + public abstract void TerminateGameConnection(uint unIPServer,char usPortServer); + public abstract void TrackAppUsageEvent(ulong gameID,int eAppUsageEvent,string pchExtraInfo); + public abstract bool GetUserDataFolder(string pchBuffer,int cubBuffer); + public abstract void StartVoiceRecording(); + public abstract void StopVoiceRecording(); + public abstract uint GetAvailableVoice(ref uint pcbCompressed,ref uint pcbUncompressed,uint nUncompressedVoiceDesiredSampleRate); + public abstract uint GetVoice(bool bWantCompressed,IntPtr pDestBuffer,uint cbDestBufferSize,ref uint nBytesWritten,bool bWantUncompressed,IntPtr pUncompressedDestBuffer,uint cbUncompressedDestBufferSize,ref uint nUncompressBytesWritten,uint nUncompressedVoiceDesiredSampleRate); + public abstract uint DecompressVoice(IntPtr pCompressed,uint cbCompressed,IntPtr pDestBuffer,uint cbDestBufferSize,ref uint nBytesWritten,uint nDesiredSampleRate); + public abstract uint GetVoiceOptimalSampleRate(); + public abstract uint GetAuthSessionTicket(IntPtr pTicket,int cbMaxTicket,ref uint pcbTicket); + public abstract uint BeginAuthSession(IntPtr pAuthTicket,int cbAuthTicket,ulong steamID); + public abstract void EndAuthSession(ulong steamID); + public abstract void CancelAuthTicket(uint hAuthTicket); + public abstract uint UserHasLicenseForApp(ulong steamID,uint appID); + public abstract bool BIsBehindNAT(); + public abstract void AdvertiseGame(ulong steamIDGameServer,uint unIPServer,char usPortServer); + public abstract ulong RequestEncryptedAppTicket(IntPtr pDataToInclude,int cbDataToInclude); + public abstract bool GetEncryptedAppTicket(IntPtr pTicket,int cbMaxTicket,ref uint pcbTicket); + public abstract int GetGameBadgeLevel(int nSeries,bool bFoil); + public abstract int GetPlayerSteamLevel(); + public abstract ulong RequestStoreAuthURL(string pchRedirectURL); + } + + + public abstract class ISteamFriends + { + public abstract IntPtr GetIntPtr(); + public abstract string GetPersonaName(); + public abstract ulong SetPersonaName(string pchPersonaName); + public abstract uint GetPersonaState(); + public abstract int GetFriendCount(int iFriendFlags); + public abstract ulong GetFriendByIndex(int iFriend,int iFriendFlags); + public abstract uint GetFriendRelationship(ulong steamIDFriend); + public abstract uint GetFriendPersonaState(ulong steamIDFriend); + public abstract string GetFriendPersonaName(ulong steamIDFriend); + public abstract bool GetFriendGamePlayed(ulong steamIDFriend,out FriendGameInfo_t pFriendGameInfo); + public abstract string GetFriendPersonaNameHistory(ulong steamIDFriend,int iPersonaName); + public abstract int GetFriendSteamLevel(ulong steamIDFriend); + public abstract string GetPlayerNickname(ulong steamIDPlayer); + public abstract int GetFriendsGroupCount(); + public abstract char GetFriendsGroupIDByIndex(int iFG); + public abstract string GetFriendsGroupName(char friendsGroupID); + public abstract int GetFriendsGroupMembersCount(char friendsGroupID); + public abstract void GetFriendsGroupMembersList(char friendsGroupID,out CSteamID [] pOutSteamIDMembers); + public abstract bool HasFriend(ulong steamIDFriend,int iFriendFlags); + public abstract int GetClanCount(); + public abstract ulong GetClanByIndex(int iClan); + public abstract string GetClanName(ulong steamIDClan); + public abstract string GetClanTag(ulong steamIDClan); + public abstract bool GetClanActivityCounts(ulong steamIDClan,ref int pnOnline,ref int pnInGame,ref int pnChatting); + public abstract ulong DownloadClanActivityCounts(CSteamID [] psteamIDClans); + public abstract int GetFriendCountFromSource(ulong steamIDSource); + public abstract ulong GetFriendFromSourceByIndex(ulong steamIDSource,int iFriend); + public abstract bool IsUserInSource(ulong steamIDUser,ulong steamIDSource); + public abstract void SetInGameVoiceSpeaking(ulong steamIDUser,bool bSpeaking); + public abstract void ActivateGameOverlay(string pchDialog); + public abstract void ActivateGameOverlayToUser(string pchDialog,ulong steamID); + public abstract void ActivateGameOverlayToWebPage(string pchURL); + public abstract void ActivateGameOverlayToStore(uint nAppID,char eFlag); + public abstract void SetPlayedWith(ulong steamIDUserPlayedWith); + public abstract void ActivateGameOverlayInviteDialog(ulong steamIDLobby); + public abstract int GetSmallFriendAvatar(ulong steamIDFriend); + public abstract int GetMediumFriendAvatar(ulong steamIDFriend); + public abstract int GetLargeFriendAvatar(ulong steamIDFriend); + public abstract bool RequestUserInformation(ulong steamIDUser,bool bRequireNameOnly); + public abstract ulong RequestClanOfficerList(ulong steamIDClan); + public abstract ulong GetClanOwner(ulong steamIDClan); + public abstract int GetClanOfficerCount(ulong steamIDClan); + public abstract ulong GetClanOfficerByIndex(ulong steamIDClan,int iOfficer); + public abstract uint GetUserRestrictions(); + public abstract bool SetRichPresence(string pchKey,string pchValue); + public abstract void ClearRichPresence(); + public abstract string GetFriendRichPresence(ulong steamIDFriend,string pchKey); + public abstract int GetFriendRichPresenceKeyCount(ulong steamIDFriend); + public abstract string GetFriendRichPresenceKeyByIndex(ulong steamIDFriend,int iKey); + public abstract void RequestFriendRichPresence(ulong steamIDFriend); + public abstract bool InviteUserToGame(ulong steamIDFriend,string pchConnectString); + public abstract int GetCoplayFriendCount(); + public abstract ulong GetCoplayFriend(int iCoplayFriend); + public abstract int GetFriendCoplayTime(ulong steamIDFriend); + public abstract uint GetFriendCoplayGame(ulong steamIDFriend); + public abstract ulong JoinClanChatRoom(ulong steamIDClan); + public abstract bool LeaveClanChatRoom(ulong steamIDClan); + public abstract int GetClanChatMemberCount(ulong steamIDClan); + public abstract ulong GetChatMemberByIndex(ulong steamIDClan,int iUser); + public abstract bool SendClanChatMessage(ulong steamIDClanChat,string pchText); + public abstract int GetClanChatMessage(ulong steamIDClanChat,int iMessage,IntPtr prgchText,int cchTextMax,ref uint peChatEntryType,out CSteamID psteamidChatter); + public abstract bool IsClanChatAdmin(ulong steamIDClanChat,ulong steamIDUser); + public abstract bool IsClanChatWindowOpenInSteam(ulong steamIDClanChat); + public abstract bool OpenClanChatWindowInSteam(ulong steamIDClanChat); + public abstract bool CloseClanChatWindowInSteam(ulong steamIDClanChat); + public abstract bool SetListenForFriendsMessages(bool bInterceptEnabled); + public abstract bool ReplyToFriendMessage(ulong steamIDFriend,string pchMsgToSend); + public abstract int GetFriendMessage(ulong steamIDFriend,int iMessageID,IntPtr pvData,int cubData,ref uint peChatEntryType); + public abstract ulong GetFollowerCount(ulong steamID); + public abstract ulong IsFollowing(ulong steamID); + public abstract ulong EnumerateFollowingList(uint unStartIndex); + } + + + public abstract class ISteamUtils + { + public abstract IntPtr GetIntPtr(); + public abstract uint GetSecondsSinceAppActive(); + public abstract uint GetSecondsSinceComputerActive(); + public abstract int GetConnectedUniverse(); + public abstract uint GetServerRealTime(); + public abstract string GetIPCountry(); + public abstract bool GetImageSize(int iImage,ref uint pnWidth,ref uint pnHeight); + public abstract bool GetImageRGBA(int iImage,IntPtr pubDest,int nDestBufferSize); + public abstract bool GetCSERIPPort(ref uint unIP,ref char usPort); + public abstract byte GetCurrentBatteryPower(); + public abstract uint GetAppID(); + public abstract void SetOverlayNotificationPosition(uint eNotificationPosition); + public abstract bool IsAPICallCompleted(ulong hSteamAPICall,ref bool pbFailed); + public abstract int GetAPICallFailureReason(ulong hSteamAPICall); + public abstract bool GetAPICallResult(ulong hSteamAPICall,IntPtr pCallback,int cubCallback,int iCallbackExpected,ref bool pbFailed); + public abstract void RunFrame(); + public abstract uint GetIPCCallCount(); + public abstract void SetWarningMessageHook(IntPtr pFunction); + public abstract bool IsOverlayEnabled(); + public abstract bool BOverlayNeedsPresent(); + public abstract ulong CheckFileSignature(string szFileName); + public abstract bool ShowGamepadTextInput(int eInputMode,int eLineInputMode,string pchDescription,uint unCharMax,string pchExistingText); + public abstract uint GetEnteredGamepadTextLength(); + public abstract bool GetEnteredGamepadTextInput(string pchText,uint cchText); + public abstract string GetSteamUILanguage(); + public abstract bool IsSteamRunningInVR(); + public abstract void SetOverlayNotificationInset(int nHorizontalInset,int nVerticalInset); + } + + + public abstract class ISteamMatchmaking + { + public abstract IntPtr GetIntPtr(); + public abstract int GetFavoriteGameCount(); + public abstract bool GetFavoriteGame(int iGame,ref uint pnAppID,ref uint pnIP,ref char pnConnPort,ref char pnQueryPort,ref uint punFlags,ref uint pRTime32LastPlayedOnServer); + public abstract int AddFavoriteGame(uint nAppID,uint nIP,char nConnPort,char nQueryPort,uint unFlags,uint rTime32LastPlayedOnServer); + public abstract bool RemoveFavoriteGame(uint nAppID,uint nIP,char nConnPort,char nQueryPort,uint unFlags); + public abstract ulong RequestLobbyList(); + public abstract void AddRequestLobbyListStringFilter(string pchKeyToMatch,string pchValueToMatch,uint eComparisonType); + public abstract void AddRequestLobbyListNumericalFilter(string pchKeyToMatch,int nValueToMatch,uint eComparisonType); + public abstract void AddRequestLobbyListNearValueFilter(string pchKeyToMatch,int nValueToBeCloseTo); + public abstract void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable); + public abstract void AddRequestLobbyListDistanceFilter(uint eLobbyDistanceFilter); + public abstract void AddRequestLobbyListResultCountFilter(int cMaxResults); + public abstract void AddRequestLobbyListCompatibleMembersFilter(ulong steamIDLobby); + public abstract ulong GetLobbyByIndex(int iLobby); + public abstract ulong CreateLobby(uint eLobbyType,int cMaxMembers); + public abstract ulong JoinLobby(ulong steamIDLobby); + public abstract void LeaveLobby(ulong steamIDLobby); + public abstract bool InviteUserToLobby(ulong steamIDLobby,ulong steamIDInvitee); + public abstract int GetNumLobbyMembers(ulong steamIDLobby); + public abstract ulong GetLobbyMemberByIndex(ulong steamIDLobby,int iMember); + public abstract string GetLobbyData(ulong steamIDLobby,string pchKey); + public abstract bool SetLobbyData(ulong steamIDLobby,string pchKey,string pchValue); + public abstract int GetLobbyDataCount(ulong steamIDLobby); + public abstract bool GetLobbyDataByIndex(ulong steamIDLobby,int iLobbyData,string pchKey,int cchKeyBufferSize,string pchValue,int cchValueBufferSize); + public abstract bool DeleteLobbyData(ulong steamIDLobby,string pchKey); + public abstract string GetLobbyMemberData(ulong steamIDLobby,ulong steamIDUser,string pchKey); + public abstract void SetLobbyMemberData(ulong steamIDLobby,string pchKey,string pchValue); + public abstract bool SendLobbyChatMsg(ulong steamIDLobby,IntPtr pvMsgBody,int cubMsgBody); + public abstract int GetLobbyChatEntry(ulong steamIDLobby,int iChatID,out CSteamID pSteamIDUser,IntPtr pvData,int cubData,ref uint peChatEntryType); + public abstract bool RequestLobbyData(ulong steamIDLobby); + public abstract void SetLobbyGameServer(ulong steamIDLobby,uint unGameServerIP,char unGameServerPort,ulong steamIDGameServer); + public abstract bool GetLobbyGameServer(ulong steamIDLobby,ref uint punGameServerIP,ref char punGameServerPort,out CSteamID psteamIDGameServer); + public abstract bool SetLobbyMemberLimit(ulong steamIDLobby,int cMaxMembers); + public abstract int GetLobbyMemberLimit(ulong steamIDLobby); + public abstract bool SetLobbyType(ulong steamIDLobby,uint eLobbyType); + public abstract bool SetLobbyJoinable(ulong steamIDLobby,bool bLobbyJoinable); + public abstract ulong GetLobbyOwner(ulong steamIDLobby); + public abstract bool SetLobbyOwner(ulong steamIDLobby,ulong steamIDNewOwner); + public abstract bool SetLinkedLobby(ulong steamIDLobby,ulong steamIDLobbyDependent); + } + + + public abstract class ISteamMatchmakingServerListResponse + { + public abstract IntPtr GetIntPtr(); + public abstract void ServerResponded(uint hRequest,int iServer); + public abstract void ServerFailedToRespond(uint hRequest,int iServer); + public abstract void RefreshComplete(uint hRequest,uint response); + } + + + public abstract class ISteamMatchmakingPingResponse + { + public abstract IntPtr GetIntPtr(); + public abstract void ServerResponded(IntPtr server); + public abstract void ServerFailedToRespond(); + } + + + public abstract class ISteamMatchmakingPlayersResponse + { + public abstract IntPtr GetIntPtr(); + public abstract void AddPlayerToList(string pchName,int nScore,float flTimePlayed); + public abstract void PlayersFailedToRespond(); + public abstract void PlayersRefreshComplete(); + } + + + public abstract class ISteamMatchmakingRulesResponse + { + public abstract IntPtr GetIntPtr(); + public abstract void RulesResponded(string pchRule,string pchValue); + public abstract void RulesFailedToRespond(); + public abstract void RulesRefreshComplete(); + } + + + public abstract class ISteamMatchmakingServers + { + public abstract IntPtr GetIntPtr(); + public abstract uint RequestInternetServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse); + public abstract uint RequestLANServerList(uint iApp,ISteamMatchmakingServerListResponse pRequestServersResponse); + public abstract uint RequestFriendsServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse); + public abstract uint RequestFavoritesServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse); + public abstract uint RequestHistoryServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse); + public abstract uint RequestSpectatorServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse); + public abstract void ReleaseRequest(uint hServerListRequest); + public abstract gameserveritem_t GetServerDetails(uint hRequest,int iServer); + public abstract void CancelQuery(uint hRequest); + public abstract void RefreshQuery(uint hRequest); + public abstract bool IsRefreshing(uint hRequest); + public abstract int GetServerCount(uint hRequest); + public abstract void RefreshServer(uint hRequest,int iServer); + public abstract uint PingServer(uint unIP,char usPort,ISteamMatchmakingPingResponse pRequestServersResponse); + public abstract uint PlayerDetails(uint unIP,char usPort,ISteamMatchmakingPlayersResponse pRequestServersResponse); + public abstract uint ServerRules(uint unIP,char usPort,ISteamMatchmakingRulesResponse pRequestServersResponse); + public abstract void CancelServerQuery(uint hServerQuery); + } + + + public abstract class ISteamRemoteStorage + { + public abstract IntPtr GetIntPtr(); + public abstract bool FileWrite(string pchFile,IntPtr pvData,int cubData); + public abstract int FileRead(string pchFile,IntPtr pvData,int cubDataToRead); + public abstract ulong FileWriteAsync(string pchFile,IntPtr pvData,uint cubData); + public abstract ulong FileReadAsync(string pchFile,uint nOffset,uint cubToRead); + public abstract bool FileReadAsyncComplete(ulong hReadCall,IntPtr pvBuffer,uint cubToRead); + public abstract bool FileForget(string pchFile); + public abstract bool FileDelete(string pchFile); + public abstract ulong FileShare(string pchFile); + public abstract bool SetSyncPlatforms(string pchFile,uint eRemoteStoragePlatform); + public abstract ulong FileWriteStreamOpen(string pchFile); + public abstract bool FileWriteStreamWriteChunk(ulong writeHandle,IntPtr pvData,int cubData); + public abstract bool FileWriteStreamClose(ulong writeHandle); + public abstract bool FileWriteStreamCancel(ulong writeHandle); + public abstract bool FileExists(string pchFile); + public abstract bool FilePersisted(string pchFile); + public abstract int GetFileSize(string pchFile); + public abstract long GetFileTimestamp(string pchFile); + public abstract uint GetSyncPlatforms(string pchFile); + public abstract int GetFileCount(); + public abstract string GetFileNameAndSize(int iFile,ref int pnFileSizeInBytes); + public abstract bool GetQuota(ref int pnTotalBytes,ref int puAvailableBytes); + public abstract bool IsCloudEnabledForAccount(); + public abstract bool IsCloudEnabledForApp(); + public abstract void SetCloudEnabledForApp(bool bEnabled); + public abstract ulong UGCDownload(ulong hContent,uint unPriority); + public abstract bool GetUGCDownloadProgress(ulong hContent,ref int pnBytesDownloaded,ref int pnBytesExpected); + public abstract bool GetUGCDetails(ulong hContent,ref uint pnAppID,string ppchName,ref int pnFileSizeInBytes,out CSteamID pSteamIDOwner); + public abstract int UGCRead(ulong hContent,IntPtr pvData,int cubDataToRead,uint cOffset,uint eAction); + public abstract int GetCachedUGCCount(); + public abstract ulong GetCachedUGCHandle(int iCachedContent); + public abstract ulong PublishWorkshopFile(string pchFile,string pchPreviewFile,uint nConsumerAppId,string pchTitle,string pchDescription,uint eVisibility,ref SteamParamStringArray_t pTags,uint eWorkshopFileType); + public abstract ulong CreatePublishedFileUpdateRequest(ulong unPublishedFileId); + public abstract bool UpdatePublishedFileFile(ulong updateHandle,string pchFile); + public abstract bool UpdatePublishedFilePreviewFile(ulong updateHandle,string pchPreviewFile); + public abstract bool UpdatePublishedFileTitle(ulong updateHandle,string pchTitle); + public abstract bool UpdatePublishedFileDescription(ulong updateHandle,string pchDescription); + public abstract bool UpdatePublishedFileVisibility(ulong updateHandle,uint eVisibility); + public abstract bool UpdatePublishedFileTags(ulong updateHandle,ref SteamParamStringArray_t pTags); + public abstract ulong CommitPublishedFileUpdate(ulong updateHandle); + public abstract ulong GetPublishedFileDetails(ulong unPublishedFileId,uint unMaxSecondsOld); + public abstract ulong DeletePublishedFile(ulong unPublishedFileId); + public abstract ulong EnumerateUserPublishedFiles(uint unStartIndex); + public abstract ulong SubscribePublishedFile(ulong unPublishedFileId); + public abstract ulong EnumerateUserSubscribedFiles(uint unStartIndex); + public abstract ulong UnsubscribePublishedFile(ulong unPublishedFileId); + public abstract bool UpdatePublishedFileSetChangeDescription(ulong updateHandle,string pchChangeDescription); + public abstract ulong GetPublishedItemVoteDetails(ulong unPublishedFileId); + public abstract ulong UpdateUserPublishedItemVote(ulong unPublishedFileId,bool bVoteUp); + public abstract ulong GetUserPublishedItemVoteDetails(ulong unPublishedFileId); + public abstract ulong EnumerateUserSharedWorkshopFiles(ulong steamId,uint unStartIndex,ref SteamParamStringArray_t pRequiredTags,ref SteamParamStringArray_t pExcludedTags); + public abstract ulong PublishVideo(uint eVideoProvider,string pchVideoAccount,string pchVideoIdentifier,string pchPreviewFile,uint nConsumerAppId,string pchTitle,string pchDescription,uint eVisibility,ref SteamParamStringArray_t pTags); + public abstract ulong SetUserPublishedFileAction(ulong unPublishedFileId,uint eAction); + public abstract ulong EnumeratePublishedFilesByUserAction(uint eAction,uint unStartIndex); + public abstract ulong EnumeratePublishedWorkshopFiles(uint eEnumerationType,uint unStartIndex,uint unCount,uint unDays,ref SteamParamStringArray_t pTags,ref SteamParamStringArray_t pUserTags); + public abstract ulong UGCDownloadToLocation(ulong hContent,string pchLocation,uint unPriority); + } + + + public abstract class ISteamUserStats + { + public abstract IntPtr GetIntPtr(); + public abstract bool RequestCurrentStats(); + public abstract bool GetStat(string pchName,ref int pData); + public abstract bool GetStat0(string pchName,ref float pData); + public abstract bool SetStat(string pchName,int nData); + public abstract bool SetStat0(string pchName,float fData); + public abstract bool UpdateAvgRateStat(string pchName,float flCountThisSession,double dSessionLength); + public abstract bool GetAchievement(string pchName,ref bool pbAchieved); + public abstract bool SetAchievement(string pchName); + public abstract bool ClearAchievement(string pchName); + public abstract bool GetAchievementAndUnlockTime(string pchName,ref bool pbAchieved,ref uint punUnlockTime); + public abstract bool StoreStats(); + public abstract int GetAchievementIcon(string pchName); + public abstract string GetAchievementDisplayAttribute(string pchName,string pchKey); + public abstract bool IndicateAchievementProgress(string pchName,uint nCurProgress,uint nMaxProgress); + public abstract uint GetNumAchievements(); + public abstract string GetAchievementName(uint iAchievement); + public abstract ulong RequestUserStats(ulong steamIDUser); + public abstract bool GetUserStat(ulong steamIDUser,string pchName,ref int pData); + public abstract bool GetUserStat0(ulong steamIDUser,string pchName,ref float pData); + public abstract bool GetUserAchievement(ulong steamIDUser,string pchName,ref bool pbAchieved); + public abstract bool GetUserAchievementAndUnlockTime(ulong steamIDUser,string pchName,ref bool pbAchieved,ref uint punUnlockTime); + public abstract bool ResetAllStats(bool bAchievementsToo); + public abstract ulong FindOrCreateLeaderboard(string pchLeaderboardName,uint eLeaderboardSortMethod,uint eLeaderboardDisplayType); + public abstract ulong FindLeaderboard(string pchLeaderboardName); + public abstract string GetLeaderboardName(ulong hSteamLeaderboard); + public abstract int GetLeaderboardEntryCount(ulong hSteamLeaderboard); + public abstract uint GetLeaderboardSortMethod(ulong hSteamLeaderboard); + public abstract uint GetLeaderboardDisplayType(ulong hSteamLeaderboard); + public abstract ulong DownloadLeaderboardEntries(ulong hSteamLeaderboard,uint eLeaderboardDataRequest,int nRangeStart,int nRangeEnd); + public abstract ulong DownloadLeaderboardEntriesForUsers(ulong hSteamLeaderboard,CSteamID [] prgUsers); + public abstract bool GetDownloadedLeaderboardEntry(ulong hSteamLeaderboardEntries,int index,ref LeaderboardEntry_t pLeaderboardEntry,ref int pDetails,int cDetailsMax); + public abstract ulong UploadLeaderboardScore(ulong hSteamLeaderboard,uint eLeaderboardUploadScoreMethod,int nScore,ref int pScoreDetails,int cScoreDetailsCount); + public abstract ulong AttachLeaderboardUGC(ulong hSteamLeaderboard,ulong hUGC); + public abstract ulong GetNumberOfCurrentPlayers(); + public abstract ulong RequestGlobalAchievementPercentages(); + public abstract int GetMostAchievedAchievementInfo(string pchName,uint unNameBufLen,ref float pflPercent,ref bool pbAchieved); + public abstract int GetNextMostAchievedAchievementInfo(int iIteratorPrevious,string pchName,uint unNameBufLen,ref float pflPercent,ref bool pbAchieved); + public abstract bool GetAchievementAchievedPercent(string pchName,ref float pflPercent); + public abstract ulong RequestGlobalStats(int nHistoryDays); + public abstract bool GetGlobalStat(string pchStatName,ref long pData); + public abstract bool GetGlobalStat0(string pchStatName,ref double pData); + public abstract int GetGlobalStatHistory(string pchStatName,long [] pData); + public abstract int GetGlobalStatHistory0(string pchStatName,double [] pData); + } + + + public abstract class ISteamApps + { + public abstract IntPtr GetIntPtr(); + public abstract bool BIsSubscribed(); + public abstract bool BIsLowViolence(); + public abstract bool BIsCybercafe(); + public abstract bool BIsVACBanned(); + public abstract string GetCurrentGameLanguage(); + public abstract string GetAvailableGameLanguages(); + public abstract bool BIsSubscribedApp(uint appID); + public abstract bool BIsDlcInstalled(uint appID); + public abstract uint GetEarliestPurchaseUnixTime(uint nAppID); + public abstract bool BIsSubscribedFromFreeWeekend(); + public abstract int GetDLCCount(); + public abstract bool BGetDLCDataByIndex(int iDLC,ref uint pAppID,ref bool pbAvailable,string pchName,int cchNameBufferSize); + public abstract void InstallDLC(uint nAppID); + public abstract void UninstallDLC(uint nAppID); + public abstract void RequestAppProofOfPurchaseKey(uint nAppID); + public abstract bool GetCurrentBetaName(string pchName,int cchNameBufferSize); + public abstract bool MarkContentCorrupt(bool bMissingFilesOnly); + public abstract uint GetInstalledDepots(uint appID,ref uint pvecDepots,uint cMaxDepots); + public abstract uint GetAppInstallDir(uint appID,string pchFolder,uint cchFolderBufferSize); + public abstract bool BIsAppInstalled(uint appID); + public abstract ulong GetAppOwner(); + public abstract string GetLaunchQueryParam(string pchKey); + public abstract bool GetDlcDownloadProgress(uint nAppID,ref ulong punBytesDownloaded,ref ulong punBytesTotal); + public abstract int GetAppBuildId(); + } + + + public abstract class ISteamNetworking + { + public abstract IntPtr GetIntPtr(); + public abstract bool SendP2PPacket(ulong steamIDRemote,IntPtr pubData,uint cubData,uint eP2PSendType,int nChannel); + public abstract bool IsP2PPacketAvailable(ref uint pcubMsgSize,int nChannel); + public abstract bool ReadP2PPacket(IntPtr pubDest,uint cubDest,ref uint pcubMsgSize,ref CSteamID psteamIDRemote,int nChannel); + public abstract bool AcceptP2PSessionWithUser(ulong steamIDRemote); + public abstract bool CloseP2PSessionWithUser(ulong steamIDRemote); + public abstract bool CloseP2PChannelWithUser(ulong steamIDRemote,int nChannel); + public abstract bool GetP2PSessionState(ulong steamIDRemote,ref P2PSessionState_t pConnectionState); + public abstract bool AllowP2PPacketRelay(bool bAllow); + public abstract uint CreateListenSocket(int nVirtualP2PPort,uint nIP,char nPort,bool bAllowUseOfPacketRelay); + public abstract uint CreateP2PConnectionSocket(ulong steamIDTarget,int nVirtualPort,int nTimeoutSec,bool bAllowUseOfPacketRelay); + public abstract uint CreateConnectionSocket(uint nIP,char nPort,int nTimeoutSec); + public abstract bool DestroySocket(uint hSocket,bool bNotifyRemoteEnd); + public abstract bool DestroyListenSocket(uint hSocket,bool bNotifyRemoteEnd); + public abstract bool SendDataOnSocket(uint hSocket,IntPtr pubData,uint cubData,bool bReliable); + public abstract bool IsDataAvailableOnSocket(uint hSocket,ref uint pcubMsgSize); + public abstract bool RetrieveDataFromSocket(uint hSocket,IntPtr pubDest,uint cubDest,ref uint pcubMsgSize); + public abstract bool IsDataAvailable(uint hListenSocket,ref uint pcubMsgSize,ref uint phSocket); + public abstract bool RetrieveData(uint hListenSocket,IntPtr pubDest,uint cubDest,ref uint pcubMsgSize,ref uint phSocket); + public abstract bool GetSocketInfo(uint hSocket,ref CSteamID pSteamIDRemote,ref int peSocketStatus,ref uint punIPRemote,ref char punPortRemote); + public abstract bool GetListenSocketInfo(uint hListenSocket,ref uint pnIP,ref char pnPort); + public abstract uint GetSocketConnectionType(uint hSocket); + public abstract int GetMaxPacketSize(uint hSocket); + } + + + public abstract class ISteamScreenshots + { + public abstract IntPtr GetIntPtr(); + public abstract uint WriteScreenshot(IntPtr pubRGB,uint cubRGB,int nWidth,int nHeight); + public abstract uint AddScreenshotToLibrary(string pchFilename,string pchThumbnailFilename,int nWidth,int nHeight); + public abstract void TriggerScreenshot(); + public abstract void HookScreenshots(bool bHook); + public abstract bool SetLocation(uint hScreenshot,string pchLocation); + public abstract bool TagUser(uint hScreenshot,ulong steamID); + public abstract bool TagPublishedFile(uint hScreenshot,ulong unPublishedFileID); + } + + + public abstract class ISteamMusic + { + public abstract IntPtr GetIntPtr(); + public abstract bool BIsEnabled(); + public abstract bool BIsPlaying(); + public abstract int GetPlaybackStatus(); + public abstract void Play(); + public abstract void Pause(); + public abstract void PlayPrevious(); + public abstract void PlayNext(); + public abstract void SetVolume(float flVolume); + public abstract float GetVolume(); + } + + + public abstract class ISteamMusicRemote + { + public abstract IntPtr GetIntPtr(); + public abstract bool RegisterSteamMusicRemote(string pchName); + public abstract bool DeregisterSteamMusicRemote(); + public abstract bool BIsCurrentMusicRemote(); + public abstract bool BActivationSuccess(bool bValue); + public abstract bool SetDisplayName(string pchDisplayName); + public abstract bool SetPNGIcon_64x64(IntPtr pvBuffer,uint cbBufferLength); + public abstract bool EnablePlayPrevious(bool bValue); + public abstract bool EnablePlayNext(bool bValue); + public abstract bool EnableShuffled(bool bValue); + public abstract bool EnableLooped(bool bValue); + public abstract bool EnableQueue(bool bValue); + public abstract bool EnablePlaylists(bool bValue); + public abstract bool UpdatePlaybackStatus(int nStatus); + public abstract bool UpdateShuffled(bool bValue); + public abstract bool UpdateLooped(bool bValue); + public abstract bool UpdateVolume(float flValue); + public abstract bool CurrentEntryWillChange(); + public abstract bool CurrentEntryIsAvailable(bool bAvailable); + public abstract bool UpdateCurrentEntryText(string pchText); + public abstract bool UpdateCurrentEntryElapsedSeconds(int nValue); + public abstract bool UpdateCurrentEntryCoverArt(IntPtr pvBuffer,uint cbBufferLength); + public abstract bool CurrentEntryDidChange(); + public abstract bool QueueWillChange(); + public abstract bool ResetQueueEntries(); + public abstract bool SetQueueEntry(int nID,int nPosition,string pchEntryText); + public abstract bool SetCurrentQueueEntry(int nID); + public abstract bool QueueDidChange(); + public abstract bool PlaylistWillChange(); + public abstract bool ResetPlaylistEntries(); + public abstract bool SetPlaylistEntry(int nID,int nPosition,string pchEntryText); + public abstract bool SetCurrentPlaylistEntry(int nID); + public abstract bool PlaylistDidChange(); + } + + + public abstract class ISteamHTTP + { + public abstract IntPtr GetIntPtr(); + public abstract uint CreateHTTPRequest(uint eHTTPRequestMethod,string pchAbsoluteURL); + public abstract bool SetHTTPRequestContextValue(uint hRequest,ulong ulContextValue); + public abstract bool SetHTTPRequestNetworkActivityTimeout(uint hRequest,uint unTimeoutSeconds); + public abstract bool SetHTTPRequestHeaderValue(uint hRequest,string pchHeaderName,string pchHeaderValue); + public abstract bool SetHTTPRequestGetOrPostParameter(uint hRequest,string pchParamName,string pchParamValue); + public abstract bool SendHTTPRequest(uint hRequest,ref ulong pCallHandle); + public abstract bool SendHTTPRequestAndStreamResponse(uint hRequest,ref ulong pCallHandle); + public abstract bool DeferHTTPRequest(uint hRequest); + public abstract bool PrioritizeHTTPRequest(uint hRequest); + public abstract bool GetHTTPResponseHeaderSize(uint hRequest,string pchHeaderName,ref uint unResponseHeaderSize); + public abstract bool GetHTTPResponseHeaderValue(uint hRequest,string pchHeaderName,IntPtr pHeaderValueBuffer,uint unBufferSize); + public abstract bool GetHTTPResponseBodySize(uint hRequest,ref uint unBodySize); + public abstract bool GetHTTPResponseBodyData(uint hRequest,IntPtr pBodyDataBuffer,uint unBufferSize); + public abstract bool GetHTTPStreamingResponseBodyData(uint hRequest,uint cOffset,IntPtr pBodyDataBuffer,uint unBufferSize); + public abstract bool ReleaseHTTPRequest(uint hRequest); + public abstract bool GetHTTPDownloadProgressPct(uint hRequest,ref float pflPercentOut); + public abstract bool SetHTTPRequestRawPostBody(uint hRequest,string pchContentType,IntPtr pubBody,uint unBodyLen); + public abstract uint CreateCookieContainer(bool bAllowResponsesToModify); + public abstract bool ReleaseCookieContainer(uint hCookieContainer); + public abstract bool SetCookie(uint hCookieContainer,string pchHost,string pchUrl,string pchCookie); + public abstract bool SetHTTPRequestCookieContainer(uint hRequest,uint hCookieContainer); + public abstract bool SetHTTPRequestUserAgentInfo(uint hRequest,string pchUserAgentInfo); + public abstract bool SetHTTPRequestRequiresVerifiedCertificate(uint hRequest,bool bRequireVerifiedCertificate); + public abstract bool SetHTTPRequestAbsoluteTimeoutMS(uint hRequest,uint unMilliseconds); + public abstract bool GetHTTPRequestWasTimedOut(uint hRequest,ref bool pbWasTimedOut); + } + + + public abstract class ISteamUnifiedMessages + { + public abstract IntPtr GetIntPtr(); + public abstract ulong SendMethod(string pchServiceMethod,IntPtr pRequestBuffer,uint unRequestBufferSize,ulong unContext); + public abstract bool GetMethodResponseInfo(ulong hHandle,ref uint punResponseSize,ref uint peResult); + public abstract bool GetMethodResponseData(ulong hHandle,IntPtr pResponseBuffer,uint unResponseBufferSize,bool bAutoRelease); + public abstract bool ReleaseMethod(ulong hHandle); + public abstract bool SendNotification(string pchServiceNotification,IntPtr pNotificationBuffer,uint unNotificationBufferSize); + } + + + public abstract class ISteamController + { + public abstract IntPtr GetIntPtr(); + public abstract bool Init(); + public abstract bool Shutdown(); + public abstract void RunFrame(); + public abstract int GetConnectedControllers(ref ulong handlesOut); + public abstract bool ShowBindingPanel(ulong controllerHandle); + public abstract ulong GetActionSetHandle(string pszActionSetName); + public abstract void ActivateActionSet(ulong controllerHandle,ulong actionSetHandle); + public abstract ulong GetCurrentActionSet(ulong controllerHandle); + public abstract ulong GetDigitalActionHandle(string pszActionName); + public abstract ControllerDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle); + public abstract int GetDigitalActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut); + public abstract ulong GetAnalogActionHandle(string pszActionName); + public abstract ControllerAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle); + public abstract int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut); + public abstract void StopAnalogActionMomentum(ulong controllerHandle,ulong eAction); + public abstract void TriggerHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec); + } + + + public abstract class ISteamUGC + { + public abstract IntPtr GetIntPtr(); + public abstract ulong CreateQueryUserUGCRequest(uint unAccountID,uint eListType,uint eMatchingUGCType,uint eSortOrder,uint nCreatorAppID,uint nConsumerAppID,uint unPage); + public abstract ulong CreateQueryAllUGCRequest(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,uint unPage); + public abstract ulong CreateQueryUGCDetailsRequest(ref ulong pvecPublishedFileID,uint unNumPublishedFileIDs); + public abstract ulong SendQueryUGCRequest(ulong handle); + public abstract bool GetQueryUGCResult(ulong handle,uint index,ref SteamUGCDetails_t pDetails); + public abstract bool GetQueryUGCPreviewURL(ulong handle,uint index,string pchURL,uint cchURLSize); + public abstract bool GetQueryUGCMetadata(ulong handle,uint index,string pchMetadata,uint cchMetadatasize); + public abstract bool GetQueryUGCChildren(ulong handle,uint index,ref ulong pvecPublishedFileID,uint cMaxEntries); + public abstract bool GetQueryUGCStatistic(ulong handle,uint index,uint eStatType,ref uint pStatValue); + public abstract uint GetQueryUGCNumAdditionalPreviews(ulong handle,uint index); + public abstract bool GetQueryUGCAdditionalPreview(ulong handle,uint index,uint previewIndex,string pchURLOrVideoID,uint cchURLSize,ref bool pbIsImage); + public abstract uint GetQueryUGCNumKeyValueTags(ulong handle,uint index); + public abstract bool GetQueryUGCKeyValueTag(ulong handle,uint index,uint keyValueTagIndex,string pchKey,uint cchKeySize,string pchValue,uint cchValueSize); + public abstract bool ReleaseQueryUGCRequest(ulong handle); + public abstract bool AddRequiredTag(ulong handle,string pTagName); + public abstract bool AddExcludedTag(ulong handle,string pTagName); + public abstract bool SetReturnKeyValueTags(ulong handle,bool bReturnKeyValueTags); + public abstract bool SetReturnLongDescription(ulong handle,bool bReturnLongDescription); + public abstract bool SetReturnMetadata(ulong handle,bool bReturnMetadata); + public abstract bool SetReturnChildren(ulong handle,bool bReturnChildren); + public abstract bool SetReturnAdditionalPreviews(ulong handle,bool bReturnAdditionalPreviews); + public abstract bool SetReturnTotalOnly(ulong handle,bool bReturnTotalOnly); + public abstract bool SetLanguage(ulong handle,string pchLanguage); + public abstract bool SetAllowCachedResponse(ulong handle,uint unMaxAgeSeconds); + public abstract bool SetCloudFileNameFilter(ulong handle,string pMatchCloudFileName); + public abstract bool SetMatchAnyTag(ulong handle,bool bMatchAnyTag); + public abstract bool SetSearchText(ulong handle,string pSearchText); + public abstract bool SetRankedByTrendDays(ulong handle,uint unDays); + public abstract bool AddRequiredKeyValueTag(ulong handle,string pKey,string pValue); + public abstract ulong RequestUGCDetails(ulong nPublishedFileID,uint unMaxAgeSeconds); + public abstract ulong CreateItem(uint nConsumerAppId,uint eFileType); + public abstract ulong StartItemUpdate(uint nConsumerAppId,ulong nPublishedFileID); + public abstract bool SetItemTitle(ulong handle,string pchTitle); + public abstract bool SetItemDescription(ulong handle,string pchDescription); + public abstract bool SetItemUpdateLanguage(ulong handle,string pchLanguage); + public abstract bool SetItemMetadata(ulong handle,string pchMetaData); + public abstract bool SetItemVisibility(ulong handle,uint eVisibility); + public abstract bool SetItemTags(ulong updateHandle,ref SteamParamStringArray_t pTags); + public abstract bool SetItemContent(ulong handle,string pszContentFolder); + public abstract bool SetItemPreview(ulong handle,string pszPreviewFile); + public abstract bool RemoveItemKeyValueTags(ulong handle,string pchKey); + public abstract bool AddItemKeyValueTag(ulong handle,string pchKey,string pchValue); + public abstract ulong SubmitItemUpdate(ulong handle,string pchChangeNote); + public abstract uint GetItemUpdateProgress(ulong handle,ref ulong punBytesProcessed,ref ulong punBytesTotal); + public abstract ulong SetUserItemVote(ulong nPublishedFileID,bool bVoteUp); + public abstract ulong GetUserItemVote(ulong nPublishedFileID); + public abstract ulong AddItemToFavorites(uint nAppId,ulong nPublishedFileID); + public abstract ulong RemoveItemFromFavorites(uint nAppId,ulong nPublishedFileID); + public abstract ulong SubscribeItem(ulong nPublishedFileID); + public abstract ulong UnsubscribeItem(ulong nPublishedFileID); + public abstract uint GetNumSubscribedItems(); + public abstract uint GetSubscribedItems(ref ulong pvecPublishedFileID,uint cMaxEntries); + public abstract uint GetItemState(ulong nPublishedFileID); + public abstract bool GetItemInstallInfo(ulong nPublishedFileID,ref ulong punSizeOnDisk,string pchFolder,uint cchFolderSize,ref uint punTimeStamp); + public abstract bool GetItemDownloadInfo(ulong nPublishedFileID,ref ulong punBytesDownloaded,ref ulong punBytesTotal); + public abstract bool DownloadItem(ulong nPublishedFileID,bool bHighPriority); + public abstract bool BInitWorkshopForGameServer(uint unWorkshopDepotID,string pszFolder); + public abstract void SuspendDownloads(bool bSuspend); + } + + + public abstract class ISteamAppList + { + public abstract IntPtr GetIntPtr(); + public abstract uint GetNumInstalledApps(); + public abstract uint GetInstalledApps(ref uint pvecAppID,uint unMaxAppIDs); + public abstract int GetAppName(uint nAppID,string pchName,int cchNameMax); + public abstract int GetAppInstallDir(uint nAppID,string pchDirectory,int cchNameMax); + public abstract int GetAppBuildId(uint nAppID); + } + + + public abstract class ISteamHTMLSurface + { + public abstract IntPtr GetIntPtr(); + public abstract void DestructISteamHTMLSurface(); + public abstract bool Init(); + public abstract bool Shutdown(); + public abstract ulong CreateBrowser(string pchUserAgent,string pchUserCSS); + public abstract void RemoveBrowser(uint unBrowserHandle); + public abstract void LoadURL(uint unBrowserHandle,string pchURL,string pchPostData); + public abstract void SetSize(uint unBrowserHandle,uint unWidth,uint unHeight); + public abstract void StopLoad(uint unBrowserHandle); + public abstract void Reload(uint unBrowserHandle); + public abstract void GoBack(uint unBrowserHandle); + public abstract void GoForward(uint unBrowserHandle); + public abstract void AddHeader(uint unBrowserHandle,string pchKey,string pchValue); + public abstract void ExecuteJavascript(uint unBrowserHandle,string pchScript); + public abstract void MouseUp(uint unBrowserHandle,uint eMouseButton); + public abstract void MouseDown(uint unBrowserHandle,uint eMouseButton); + public abstract void MouseDoubleClick(uint unBrowserHandle,uint eMouseButton); + public abstract void MouseMove(uint unBrowserHandle,int x,int y); + public abstract void MouseWheel(uint unBrowserHandle,int nDelta); + public abstract void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers); + public abstract void KeyUp(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers); + public abstract void KeyChar(uint unBrowserHandle,uint cUnicodeChar,uint eHTMLKeyModifiers); + public abstract void SetHorizontalScroll(uint unBrowserHandle,uint nAbsolutePixelScroll); + public abstract void SetVerticalScroll(uint unBrowserHandle,uint nAbsolutePixelScroll); + public abstract void SetKeyFocus(uint unBrowserHandle,bool bHasKeyFocus); + public abstract void ViewSource(uint unBrowserHandle); + public abstract void CopyToClipboard(uint unBrowserHandle); + public abstract void PasteFromClipboard(uint unBrowserHandle); + public abstract void Find(uint unBrowserHandle,string pchSearchStr,bool bCurrentlyInFind,bool bReverse); + public abstract void StopFind(uint unBrowserHandle); + public abstract void GetLinkAtPosition(uint unBrowserHandle,int x,int y); + public abstract void SetCookie(string pchHostname,string pchKey,string pchValue,string pchPath,ulong nExpires,bool bSecure,bool bHTTPOnly); + public abstract void SetPageScaleFactor(uint unBrowserHandle,float flZoom,int nPointX,int nPointY); + public abstract void SetBackgroundMode(uint unBrowserHandle,bool bBackgroundMode); + public abstract void AllowStartRequest(uint unBrowserHandle,bool bAllowed); + public abstract void JSDialogResponse(uint unBrowserHandle,bool bResult); + public abstract void FileLoadDialogResponse(uint unBrowserHandle,string pchSelectedFiles); + } + + + public abstract class ISteamInventory + { + public abstract IntPtr GetIntPtr(); + public abstract uint GetResultStatus(int resultHandle); + public abstract bool GetResultItems(int resultHandle,out SteamItemDetails_t [] pOutItemsArray); + public abstract uint GetResultTimestamp(int resultHandle); + public abstract bool CheckResultSteamID(int resultHandle,ulong steamIDExpected); + public abstract void DestroyResult(int resultHandle); + public abstract bool GetAllItems(ref int pResultHandle); + public abstract bool GetItemsByID(ref int pResultHandle,ulong [] pInstanceIDs); + public abstract bool SerializeResult(int resultHandle,IntPtr pOutBuffer,ref uint punOutBufferSize); + public abstract bool DeserializeResult(ref int pOutResultHandle,IntPtr pBuffer,uint unBufferSize,bool bRESERVED_MUST_BE_FALSE); + public abstract bool GenerateItems(ref int pResultHandle,int [] pArrayItemDefs,uint [] punArrayQuantity); + public abstract bool GrantPromoItems(ref int pResultHandle); + public abstract bool AddPromoItem(ref int pResultHandle,int itemDef); + public abstract bool AddPromoItems(ref int pResultHandle,int [] pArrayItemDefs); + public abstract bool ConsumeItem(ref int pResultHandle,ulong itemConsume,uint unQuantity); + public abstract bool ExchangeItems(ref int pResultHandle,int [] pArrayGenerate,uint [] punArrayGenerateQuantity,ulong [] pArrayDestroy,uint [] punArrayDestroyQuantity); + public abstract bool TransferItemQuantity(ref int pResultHandle,ulong itemIdSource,uint unQuantity,ulong itemIdDest); + public abstract void SendItemDropHeartbeat(); + public abstract bool TriggerItemDrop(ref int pResultHandle,int dropListDefinition); + public abstract bool TradeItems(ref int pResultHandle,ulong steamIDTradePartner,ulong [] pArrayGive,uint [] pArrayGiveQuantity,ulong [] pArrayGet,uint [] pArrayGetQuantity); + public abstract bool LoadItemDefinitions(); + public abstract bool GetItemDefinitionIDs(out int [] pItemDefIDs); + public abstract bool GetItemDefinitionProperty(int iDefinition,string pchPropertyName,out string pchValueBuffer); + } + + + public abstract class ISteamVideo + { + public abstract IntPtr GetIntPtr(); + public abstract void GetVideoURL(uint unVideoAppID); + public abstract bool IsBroadcasting(ref int pnNumViewers); + } + + + public abstract class ISteamGameServer + { + public abstract IntPtr GetIntPtr(); + public abstract bool InitGameServer(uint unIP,char usGamePort,char usQueryPort,uint unFlags,uint nGameAppId,string pchVersionString); + public abstract void SetProduct(string pszProduct); + public abstract void SetGameDescription(string pszGameDescription); + public abstract void SetModDir(string pszModDir); + public abstract void SetDedicatedServer(bool bDedicated); + public abstract void LogOn(string pszToken); + public abstract void LogOnAnonymous(); + public abstract void LogOff(); + public abstract bool BLoggedOn(); + public abstract bool BSecure(); + public abstract ulong GetSteamID(); + public abstract bool WasRestartRequested(); + public abstract void SetMaxPlayerCount(int cPlayersMax); + public abstract void SetBotPlayerCount(int cBotplayers); + public abstract void SetServerName(string pszServerName); + public abstract void SetMapName(string pszMapName); + public abstract void SetPasswordProtected(bool bPasswordProtected); + public abstract void SetSpectatorPort(char unSpectatorPort); + public abstract void SetSpectatorServerName(string pszSpectatorServerName); + public abstract void ClearAllKeyValues(); + public abstract void SetKeyValue(string pKey,string pValue); + public abstract void SetGameTags(string pchGameTags); + public abstract void SetGameData(string pchGameData); + public abstract void SetRegion(string pszRegion); + public abstract bool SendUserConnectAndAuthenticate(uint unIPClient,IntPtr pvAuthBlob,uint cubAuthBlobSize,ref CSteamID pSteamIDUser); + public abstract ulong CreateUnauthenticatedUserConnection(); + public abstract void SendUserDisconnect(ulong steamIDUser); + public abstract bool BUpdateUserData(ulong steamIDUser,string pchPlayerName,uint uScore); + public abstract uint GetAuthSessionTicket(IntPtr pTicket,int cbMaxTicket,ref uint pcbTicket); + public abstract uint BeginAuthSession(IntPtr pAuthTicket,int cbAuthTicket,ulong steamID); + public abstract void EndAuthSession(ulong steamID); + public abstract void CancelAuthTicket(uint hAuthTicket); + public abstract uint UserHasLicenseForApp(ulong steamID,uint appID); + public abstract bool RequestUserGroupStatus(ulong steamIDUser,ulong steamIDGroup); + public abstract void GetGameplayStats(); + public abstract ulong GetServerReputation(); + public abstract uint GetPublicIP(); + public abstract bool HandleIncomingPacket(IntPtr pData,int cbData,uint srcIP,char srcPort); + public abstract int GetNextOutgoingPacket(IntPtr pOut,int cbMaxOut,ref uint pNetAdr,ref char pPort); + public abstract void EnableHeartbeats(bool bActive); + public abstract void SetHeartbeatInterval(int iHeartbeatInterval); + public abstract void ForceHeartbeat(); + public abstract ulong AssociateWithClan(ulong steamIDClan); + public abstract ulong ComputeNewPlayerCompatibility(ulong steamIDNewPlayer); + } + + + public abstract class ISteamGameServerStats + { + public abstract IntPtr GetIntPtr(); + public abstract ulong RequestUserStats(ulong steamIDUser); + public abstract bool GetUserStat(ulong steamIDUser,string pchName,ref int pData); + public abstract bool GetUserStat0(ulong steamIDUser,string pchName,ref float pData); + public abstract bool GetUserAchievement(ulong steamIDUser,string pchName,ref bool pbAchieved); + public abstract bool SetUserStat(ulong steamIDUser,string pchName,int nData); + public abstract bool SetUserStat0(ulong steamIDUser,string pchName,float fData); + public abstract bool UpdateUserAvgRateStat(ulong steamIDUser,string pchName,float flCountThisSession,double dSessionLength); + public abstract bool SetUserAchievement(ulong steamIDUser,string pchName); + public abstract bool ClearUserAchievement(ulong steamIDUser,string pchName); + public abstract ulong StoreUserStats(ulong steamIDUser); + } + + +public class CSteamClient : ISteamClient +{ +public CSteamClient(IntPtr SteamClient) +{ + m_pSteamClient = SteamClient; +} +IntPtr m_pSteamClient; + +public override IntPtr GetIntPtr() { return m_pSteamClient; } + +private void CheckIfUsable() +{ + if (m_pSteamClient == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint CreateSteamPipe() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamClient_CreateSteamPipe(m_pSteamClient); + return result; +} +public override bool BReleaseSteamPipe(uint hSteamPipe) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamClient_BReleaseSteamPipe(m_pSteamClient,hSteamPipe); + return result; +} +public override uint ConnectToGlobalUser(uint hSteamPipe) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamClient_ConnectToGlobalUser(m_pSteamClient,hSteamPipe); + return result; +} +public override uint CreateLocalUser(ref uint phSteamPipe,uint eAccountType) +{ + CheckIfUsable(); + phSteamPipe = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamClient_CreateLocalUser(m_pSteamClient,ref phSteamPipe,eAccountType); + return result; +} +public override void ReleaseUser(uint hSteamPipe,uint hUser) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_ReleaseUser(m_pSteamClient,hSteamPipe,hUser); +} +public override ISteamUser GetISteamUser(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamUser(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamUser) Marshal.PtrToStructure(result, typeof(ISteamUser)); +} +public override ISteamGameServer GetISteamGameServer(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamGameServer(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamGameServer) Marshal.PtrToStructure(result, typeof(ISteamGameServer)); +} +public override void SetLocalIPBinding(uint unIP,char usPort) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_SetLocalIPBinding(m_pSteamClient,unIP,usPort); +} +public override ISteamFriends GetISteamFriends(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamFriends(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamFriends) Marshal.PtrToStructure(result, typeof(ISteamFriends)); +} +public override ISteamUtils GetISteamUtils(uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamUtils(m_pSteamClient,hSteamPipe,pchVersion); + return (ISteamUtils) Marshal.PtrToStructure(result, typeof(ISteamUtils)); +} +public override ISteamMatchmaking GetISteamMatchmaking(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamMatchmaking(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamMatchmaking) Marshal.PtrToStructure(result, typeof(ISteamMatchmaking)); +} +public override ISteamMatchmakingServers GetISteamMatchmakingServers(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamMatchmakingServers(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamMatchmakingServers) Marshal.PtrToStructure(result, typeof(ISteamMatchmakingServers)); +} +public override IntPtr GetISteamGenericInterface(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamGenericInterface(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (IntPtr) Marshal.PtrToStructure(result, typeof(IntPtr)); +} +public override ISteamUserStats GetISteamUserStats(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamUserStats(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamUserStats) Marshal.PtrToStructure(result, typeof(ISteamUserStats)); +} +public override ISteamGameServerStats GetISteamGameServerStats(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamGameServerStats(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamGameServerStats) Marshal.PtrToStructure(result, typeof(ISteamGameServerStats)); +} +public override ISteamApps GetISteamApps(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamApps(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamApps) Marshal.PtrToStructure(result, typeof(ISteamApps)); +} +public override ISteamNetworking GetISteamNetworking(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamNetworking(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamNetworking) Marshal.PtrToStructure(result, typeof(ISteamNetworking)); +} +public override ISteamRemoteStorage GetISteamRemoteStorage(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamRemoteStorage(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamRemoteStorage) Marshal.PtrToStructure(result, typeof(ISteamRemoteStorage)); +} +public override ISteamScreenshots GetISteamScreenshots(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamScreenshots(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamScreenshots) Marshal.PtrToStructure(result, typeof(ISteamScreenshots)); +} +public override void RunFrame() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_RunFrame(m_pSteamClient); +} +public override uint GetIPCCallCount() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamClient_GetIPCCallCount(m_pSteamClient); + return result; +} +public override void SetWarningMessageHook(IntPtr pFunction) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_SetWarningMessageHook(m_pSteamClient,pFunction); +} +public override bool BShutdownIfAllPipesClosed() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(m_pSteamClient); + return result; +} +public override ISteamHTTP GetISteamHTTP(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamHTTP(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamHTTP) Marshal.PtrToStructure(result, typeof(ISteamHTTP)); +} +public override ISteamUnifiedMessages GetISteamUnifiedMessages(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamUnifiedMessages(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamUnifiedMessages) Marshal.PtrToStructure(result, typeof(ISteamUnifiedMessages)); +} +public override ISteamController GetISteamController(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamController(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamController) Marshal.PtrToStructure(result, typeof(ISteamController)); +} +public override ISteamUGC GetISteamUGC(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamUGC(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamUGC) Marshal.PtrToStructure(result, typeof(ISteamUGC)); +} +public override ISteamAppList GetISteamAppList(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamAppList(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamAppList) Marshal.PtrToStructure(result, typeof(ISteamAppList)); +} +public override ISteamMusic GetISteamMusic(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamMusic(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamMusic) Marshal.PtrToStructure(result, typeof(ISteamMusic)); +} +public override ISteamMusicRemote GetISteamMusicRemote(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamMusicRemote(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamMusicRemote) Marshal.PtrToStructure(result, typeof(ISteamMusicRemote)); +} +public override ISteamHTMLSurface GetISteamHTMLSurface(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamHTMLSurface(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamHTMLSurface) Marshal.PtrToStructure(result, typeof(ISteamHTMLSurface)); +} +public override void Set_SteamAPI_CPostAPIResultInProcess(IntPtr func) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess(m_pSteamClient,func); +} +public override void Remove_SteamAPI_CPostAPIResultInProcess(IntPtr func) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_Remove_SteamAPI_CPostAPIResultInProcess(m_pSteamClient,func); +} +public override void Set_SteamAPI_CCheckCallbackRegisteredInProcess(IntPtr func) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamClient_Set_SteamAPI_CCheckCallbackRegisteredInProcess(m_pSteamClient,func); +} +public override ISteamInventory GetISteamInventory(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamInventory(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamInventory) Marshal.PtrToStructure(result, typeof(ISteamInventory)); +} +public override ISteamVideo GetISteamVideo(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamVideo(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamVideo) Marshal.PtrToStructure(result, typeof(ISteamVideo)); +} +} + + +public class CSteamUser : ISteamUser +{ +public CSteamUser(IntPtr SteamUser) +{ + m_pSteamUser = SteamUser; +} +IntPtr m_pSteamUser; + +public override IntPtr GetIntPtr() { return m_pSteamUser; } + +private void CheckIfUsable() +{ + if (m_pSteamUser == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint GetHSteamUser() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUser_GetHSteamUser(m_pSteamUser); + return result; +} +public override bool BLoggedOn() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUser_BLoggedOn(m_pSteamUser); + return result; +} +public override ulong GetSteamID() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUser_GetSteamID(m_pSteamUser); + return result; +} +public override int InitiateGameConnection(IntPtr pAuthBlob,int cbMaxAuthBlob,ulong steamIDGameServer,uint unIPServer,char usPortServer,bool bSecure) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUser_InitiateGameConnection(m_pSteamUser,pAuthBlob,cbMaxAuthBlob,steamIDGameServer,unIPServer,usPortServer,bSecure); + return result; +} +public override void TerminateGameConnection(uint unIPServer,char usPortServer) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_TerminateGameConnection(m_pSteamUser,unIPServer,usPortServer); +} +public override void TrackAppUsageEvent(ulong gameID,int eAppUsageEvent,string pchExtraInfo) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_TrackAppUsageEvent(m_pSteamUser,gameID,eAppUsageEvent,pchExtraInfo); +} +public override bool GetUserDataFolder(string pchBuffer,int cubBuffer) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUser_GetUserDataFolder(m_pSteamUser,pchBuffer,cubBuffer); + return result; +} +public override void StartVoiceRecording() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_StartVoiceRecording(m_pSteamUser); +} +public override void StopVoiceRecording() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_StopVoiceRecording(m_pSteamUser); +} +public override uint GetAvailableVoice(ref uint pcbCompressed,ref uint pcbUncompressed,uint nUncompressedVoiceDesiredSampleRate) +{ + CheckIfUsable(); + pcbCompressed = 0; + pcbUncompressed = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamUser_GetAvailableVoice(m_pSteamUser,ref pcbCompressed,ref pcbUncompressed,nUncompressedVoiceDesiredSampleRate); + return result; +} +public override uint GetVoice(bool bWantCompressed,IntPtr pDestBuffer,uint cbDestBufferSize,ref uint nBytesWritten,bool bWantUncompressed,IntPtr pUncompressedDestBuffer,uint cbUncompressedDestBufferSize,ref uint nUncompressBytesWritten,uint nUncompressedVoiceDesiredSampleRate) +{ + CheckIfUsable(); + nBytesWritten = 0; + nUncompressBytesWritten = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamUser_GetVoice(m_pSteamUser,bWantCompressed,pDestBuffer,cbDestBufferSize,ref nBytesWritten,bWantUncompressed,pUncompressedDestBuffer,cbUncompressedDestBufferSize,ref nUncompressBytesWritten,nUncompressedVoiceDesiredSampleRate); + return result; +} +public override uint DecompressVoice(IntPtr pCompressed,uint cbCompressed,IntPtr pDestBuffer,uint cbDestBufferSize,ref uint nBytesWritten,uint nDesiredSampleRate) +{ + CheckIfUsable(); + nBytesWritten = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamUser_DecompressVoice(m_pSteamUser,pCompressed,cbCompressed,pDestBuffer,cbDestBufferSize,ref nBytesWritten,nDesiredSampleRate); + return result; +} +public override uint GetVoiceOptimalSampleRate() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(m_pSteamUser); + return result; +} +public override uint GetAuthSessionTicket(IntPtr pTicket,int cbMaxTicket,ref uint pcbTicket) +{ + CheckIfUsable(); + pcbTicket = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamUser_GetAuthSessionTicket(m_pSteamUser,pTicket,cbMaxTicket,ref pcbTicket); + return result; +} +public override uint BeginAuthSession(IntPtr pAuthTicket,int cbAuthTicket,ulong steamID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUser_BeginAuthSession(m_pSteamUser,pAuthTicket,cbAuthTicket,steamID); + return result; +} +public override void EndAuthSession(ulong steamID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_EndAuthSession(m_pSteamUser,steamID); +} +public override void CancelAuthTicket(uint hAuthTicket) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_CancelAuthTicket(m_pSteamUser,hAuthTicket); +} +public override uint UserHasLicenseForApp(ulong steamID,uint appID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUser_UserHasLicenseForApp(m_pSteamUser,steamID,appID); + return result; +} +public override bool BIsBehindNAT() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUser_BIsBehindNAT(m_pSteamUser); + return result; +} +public override void AdvertiseGame(ulong steamIDGameServer,uint unIPServer,char usPortServer) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUser_AdvertiseGame(m_pSteamUser,steamIDGameServer,unIPServer,usPortServer); +} +public override ulong RequestEncryptedAppTicket(IntPtr pDataToInclude,int cbDataToInclude) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUser_RequestEncryptedAppTicket(m_pSteamUser,pDataToInclude,cbDataToInclude); + return result; +} +public override bool GetEncryptedAppTicket(IntPtr pTicket,int cbMaxTicket,ref uint pcbTicket) +{ + CheckIfUsable(); + pcbTicket = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUser_GetEncryptedAppTicket(m_pSteamUser,pTicket,cbMaxTicket,ref pcbTicket); + return result; +} +public override int GetGameBadgeLevel(int nSeries,bool bFoil) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUser_GetGameBadgeLevel(m_pSteamUser,nSeries,bFoil); + return result; +} +public override int GetPlayerSteamLevel() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUser_GetPlayerSteamLevel(m_pSteamUser); + return result; +} +public override ulong RequestStoreAuthURL(string pchRedirectURL) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUser_RequestStoreAuthURL(m_pSteamUser,pchRedirectURL); + return result; +} +} + + +public class CSteamFriends : ISteamFriends +{ +public CSteamFriends(IntPtr SteamFriends) +{ + m_pSteamFriends = SteamFriends; +} +IntPtr m_pSteamFriends; + +public override IntPtr GetIntPtr() { return m_pSteamFriends; } + +private void CheckIfUsable() +{ + if (m_pSteamFriends == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override string GetPersonaName() +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetPersonaName(m_pSteamFriends); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override ulong SetPersonaName(string pchPersonaName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_SetPersonaName(m_pSteamFriends,pchPersonaName); + return result; +} +public override uint GetPersonaState() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamFriends_GetPersonaState(m_pSteamFriends); + return result; +} +public override int GetFriendCount(int iFriendFlags) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendCount(m_pSteamFriends,iFriendFlags); + return result; +} +public override ulong GetFriendByIndex(int iFriend,int iFriendFlags) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendByIndex(m_pSteamFriends,iFriend,iFriendFlags); + return result; +} +public override uint GetFriendRelationship(ulong steamIDFriend) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendRelationship(m_pSteamFriends,steamIDFriend); + return result; +} +public override uint GetFriendPersonaState(ulong steamIDFriend) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendPersonaState(m_pSteamFriends,steamIDFriend); + return result; +} +public override string GetFriendPersonaName(ulong steamIDFriend) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendPersonaName(m_pSteamFriends,steamIDFriend); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool GetFriendGamePlayed(ulong steamIDFriend,out FriendGameInfo_t pFriendGameInfo) +{ + CheckIfUsable(); + pFriendGameInfo = new FriendGameInfo_t(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendGamePlayed(m_pSteamFriends,steamIDFriend,ref pFriendGameInfo); + return result; +} +public override string GetFriendPersonaNameHistory(ulong steamIDFriend,int iPersonaName) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(m_pSteamFriends,steamIDFriend,iPersonaName); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override int GetFriendSteamLevel(ulong steamIDFriend) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendSteamLevel(m_pSteamFriends,steamIDFriend); + return result; +} +public override string GetPlayerNickname(ulong steamIDPlayer) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetPlayerNickname(m_pSteamFriends,steamIDPlayer); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override int GetFriendsGroupCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendsGroupCount(m_pSteamFriends); + return result; +} +public override char GetFriendsGroupIDByIndex(int iFG) +{ + CheckIfUsable(); + char result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(m_pSteamFriends,iFG); + return result; +} +public override string GetFriendsGroupName(char friendsGroupID) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendsGroupName(m_pSteamFriends,friendsGroupID); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override int GetFriendsGroupMembersCount(char friendsGroupID) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(m_pSteamFriends,friendsGroupID); + return result; +} +public override void GetFriendsGroupMembersList(char friendsGroupID,out CSteamID [] pOutSteamIDMembers) +{ + CheckIfUsable(); + int nMembersCount = GetFriendsGroupMembersCount (friendsGroupID); + pOutSteamIDMembers = new CSteamID[nMembersCount]; + NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendsGroupMembersList(m_pSteamFriends,friendsGroupID,pOutSteamIDMembers,nMembersCount); +} +public override bool HasFriend(ulong steamIDFriend,int iFriendFlags) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_HasFriend(m_pSteamFriends,steamIDFriend,iFriendFlags); + return result; +} +public override int GetClanCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanCount(m_pSteamFriends); + return result; +} +public override ulong GetClanByIndex(int iClan) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanByIndex(m_pSteamFriends,iClan); + return result; +} +public override string GetClanName(ulong steamIDClan) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanName(m_pSteamFriends,steamIDClan); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override string GetClanTag(ulong steamIDClan) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanTag(m_pSteamFriends,steamIDClan); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool GetClanActivityCounts(ulong steamIDClan,ref int pnOnline,ref int pnInGame,ref int pnChatting) +{ + CheckIfUsable(); + pnOnline = 0; + pnInGame = 0; + pnChatting = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanActivityCounts(m_pSteamFriends,steamIDClan,ref pnOnline,ref pnInGame,ref pnChatting); + return result; +} +public override ulong DownloadClanActivityCounts(CSteamID [] psteamIDClans) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_DownloadClanActivityCounts(m_pSteamFriends,psteamIDClans,(int) psteamIDClans.Length); + return result; +} +public override int GetFriendCountFromSource(ulong steamIDSource) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendCountFromSource(m_pSteamFriends,steamIDSource); + return result; +} +public override ulong GetFriendFromSourceByIndex(ulong steamIDSource,int iFriend) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(m_pSteamFriends,steamIDSource,iFriend); + return result; +} +public override bool IsUserInSource(ulong steamIDUser,ulong steamIDSource) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_IsUserInSource(m_pSteamFriends,steamIDUser,steamIDSource); + return result; +} +public override void SetInGameVoiceSpeaking(ulong steamIDUser,bool bSpeaking) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(m_pSteamFriends,steamIDUser,bSpeaking); +} +public override void ActivateGameOverlay(string pchDialog) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlay(m_pSteamFriends,pchDialog); +} +public override void ActivateGameOverlayToUser(string pchDialog,ulong steamID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(m_pSteamFriends,pchDialog,steamID); +} +public override void ActivateGameOverlayToWebPage(string pchURL) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(m_pSteamFriends,pchURL); +} +public override void ActivateGameOverlayToStore(uint nAppID,char eFlag) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToStore(m_pSteamFriends,nAppID,eFlag); +} +public override void SetPlayedWith(ulong steamIDUserPlayedWith) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_SetPlayedWith(m_pSteamFriends,steamIDUserPlayedWith); +} +public override void ActivateGameOverlayInviteDialog(ulong steamIDLobby) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(m_pSteamFriends,steamIDLobby); +} +public override int GetSmallFriendAvatar(ulong steamIDFriend) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetSmallFriendAvatar(m_pSteamFriends,steamIDFriend); + return result; +} +public override int GetMediumFriendAvatar(ulong steamIDFriend) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetMediumFriendAvatar(m_pSteamFriends,steamIDFriend); + return result; +} +public override int GetLargeFriendAvatar(ulong steamIDFriend) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetLargeFriendAvatar(m_pSteamFriends,steamIDFriend); + return result; +} +public override bool RequestUserInformation(ulong steamIDUser,bool bRequireNameOnly) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_RequestUserInformation(m_pSteamFriends,steamIDUser,bRequireNameOnly); + return result; +} +public override ulong RequestClanOfficerList(ulong steamIDClan) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_RequestClanOfficerList(m_pSteamFriends,steamIDClan); + return result; +} +public override ulong GetClanOwner(ulong steamIDClan) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanOwner(m_pSteamFriends,steamIDClan); + return result; +} +public override int GetClanOfficerCount(ulong steamIDClan) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanOfficerCount(m_pSteamFriends,steamIDClan); + return result; +} +public override ulong GetClanOfficerByIndex(ulong steamIDClan,int iOfficer) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanOfficerByIndex(m_pSteamFriends,steamIDClan,iOfficer); + return result; +} +public override uint GetUserRestrictions() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamFriends_GetUserRestrictions(m_pSteamFriends); + return result; +} +public override bool SetRichPresence(string pchKey,string pchValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_SetRichPresence(m_pSteamFriends,pchKey,pchValue); + return result; +} +public override void ClearRichPresence() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_ClearRichPresence(m_pSteamFriends); +} +public override string GetFriendRichPresence(ulong steamIDFriend,string pchKey) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendRichPresence(m_pSteamFriends,steamIDFriend,pchKey); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override int GetFriendRichPresenceKeyCount(ulong steamIDFriend) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(m_pSteamFriends,steamIDFriend); + return result; +} +public override string GetFriendRichPresenceKeyByIndex(ulong steamIDFriend,int iKey) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(m_pSteamFriends,steamIDFriend,iKey); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override void RequestFriendRichPresence(ulong steamIDFriend) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamFriends_RequestFriendRichPresence(m_pSteamFriends,steamIDFriend); +} +public override bool InviteUserToGame(ulong steamIDFriend,string pchConnectString) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_InviteUserToGame(m_pSteamFriends,steamIDFriend,pchConnectString); + return result; +} +public override int GetCoplayFriendCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetCoplayFriendCount(m_pSteamFriends); + return result; +} +public override ulong GetCoplayFriend(int iCoplayFriend) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetCoplayFriend(m_pSteamFriends,iCoplayFriend); + return result; +} +public override int GetFriendCoplayTime(ulong steamIDFriend) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendCoplayTime(m_pSteamFriends,steamIDFriend); + return result; +} +public override uint GetFriendCoplayGame(ulong steamIDFriend) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendCoplayGame(m_pSteamFriends,steamIDFriend); + return result; +} +public override ulong JoinClanChatRoom(ulong steamIDClan) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_JoinClanChatRoom(m_pSteamFriends,steamIDClan); + return result; +} +public override bool LeaveClanChatRoom(ulong steamIDClan) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_LeaveClanChatRoom(m_pSteamFriends,steamIDClan); + return result; +} +public override int GetClanChatMemberCount(ulong steamIDClan) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanChatMemberCount(m_pSteamFriends,steamIDClan); + return result; +} +public override ulong GetChatMemberByIndex(ulong steamIDClan,int iUser) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetChatMemberByIndex(m_pSteamFriends,steamIDClan,iUser); + return result; +} +public override bool SendClanChatMessage(ulong steamIDClanChat,string pchText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_SendClanChatMessage(m_pSteamFriends,steamIDClanChat,pchText); + return result; +} +public override int GetClanChatMessage(ulong steamIDClanChat,int iMessage,IntPtr prgchText,int cchTextMax,ref uint peChatEntryType,out CSteamID psteamidChatter) +{ + CheckIfUsable(); + peChatEntryType = 0; + psteamidChatter = new CSteamID(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetClanChatMessage(m_pSteamFriends,steamIDClanChat,iMessage,prgchText,cchTextMax,ref peChatEntryType,ref psteamidChatter); + return result; +} +public override bool IsClanChatAdmin(ulong steamIDClanChat,ulong steamIDUser) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_IsClanChatAdmin(m_pSteamFriends,steamIDClanChat,steamIDUser); + return result; +} +public override bool IsClanChatWindowOpenInSteam(ulong steamIDClanChat) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(m_pSteamFriends,steamIDClanChat); + return result; +} +public override bool OpenClanChatWindowInSteam(ulong steamIDClanChat) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(m_pSteamFriends,steamIDClanChat); + return result; +} +public override bool CloseClanChatWindowInSteam(ulong steamIDClanChat) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(m_pSteamFriends,steamIDClanChat); + return result; +} +public override bool SetListenForFriendsMessages(bool bInterceptEnabled) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_SetListenForFriendsMessages(m_pSteamFriends,bInterceptEnabled); + return result; +} +public override bool ReplyToFriendMessage(ulong steamIDFriend,string pchMsgToSend) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamFriends_ReplyToFriendMessage(m_pSteamFriends,steamIDFriend,pchMsgToSend); + return result; +} +public override int GetFriendMessage(ulong steamIDFriend,int iMessageID,IntPtr pvData,int cubData,ref uint peChatEntryType) +{ + CheckIfUsable(); + peChatEntryType = 0; + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFriendMessage(m_pSteamFriends,steamIDFriend,iMessageID,pvData,cubData,ref peChatEntryType); + return result; +} +public override ulong GetFollowerCount(ulong steamID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_GetFollowerCount(m_pSteamFriends,steamID); + return result; +} +public override ulong IsFollowing(ulong steamID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_IsFollowing(m_pSteamFriends,steamID); + return result; +} +public override ulong EnumerateFollowingList(uint unStartIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamFriends_EnumerateFollowingList(m_pSteamFriends,unStartIndex); + return result; +} +} + + +public class CSteamUtils : ISteamUtils +{ +public CSteamUtils(IntPtr SteamUtils) +{ + m_pSteamUtils = SteamUtils; +} +IntPtr m_pSteamUtils; + +public override IntPtr GetIntPtr() { return m_pSteamUtils; } + +private void CheckIfUsable() +{ + if (m_pSteamUtils == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint GetSecondsSinceAppActive() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUtils_GetSecondsSinceAppActive(m_pSteamUtils); + return result; +} +public override uint GetSecondsSinceComputerActive() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(m_pSteamUtils); + return result; +} +public override int GetConnectedUniverse() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUtils_GetConnectedUniverse(m_pSteamUtils); + return result; +} +public override uint GetServerRealTime() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUtils_GetServerRealTime(m_pSteamUtils); + return result; +} +public override string GetIPCountry() +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamUtils_GetIPCountry(m_pSteamUtils); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool GetImageSize(int iImage,ref uint pnWidth,ref uint pnHeight) +{ + CheckIfUsable(); + pnWidth = 0; + pnHeight = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_GetImageSize(m_pSteamUtils,iImage,ref pnWidth,ref pnHeight); + return result; +} +public override bool GetImageRGBA(int iImage,IntPtr pubDest,int nDestBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_GetImageRGBA(m_pSteamUtils,iImage,pubDest,nDestBufferSize); + return result; +} +public override bool GetCSERIPPort(ref uint unIP,ref char usPort) +{ + CheckIfUsable(); + unIP = 0; + usPort = (char) 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_GetCSERIPPort(m_pSteamUtils,ref unIP,ref usPort); + return result; +} +public override byte GetCurrentBatteryPower() +{ + CheckIfUsable(); + byte result = NativeEntrypoints.SteamAPI_ISteamUtils_GetCurrentBatteryPower(m_pSteamUtils); + return result; +} +public override uint GetAppID() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUtils_GetAppID(m_pSteamUtils); + return result; +} +public override void SetOverlayNotificationPosition(uint eNotificationPosition) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUtils_SetOverlayNotificationPosition(m_pSteamUtils,eNotificationPosition); +} +public override bool IsAPICallCompleted(ulong hSteamAPICall,ref bool pbFailed) +{ + CheckIfUsable(); + pbFailed = false; + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_IsAPICallCompleted(m_pSteamUtils,hSteamAPICall,ref pbFailed); + return result; +} +public override int GetAPICallFailureReason(ulong hSteamAPICall) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUtils_GetAPICallFailureReason(m_pSteamUtils,hSteamAPICall); + return result; +} +public override bool GetAPICallResult(ulong hSteamAPICall,IntPtr pCallback,int cubCallback,int iCallbackExpected,ref bool pbFailed) +{ + CheckIfUsable(); + pbFailed = false; + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_GetAPICallResult(m_pSteamUtils,hSteamAPICall,pCallback,cubCallback,iCallbackExpected,ref pbFailed); + return result; +} +public override void RunFrame() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUtils_RunFrame(m_pSteamUtils); +} +public override uint GetIPCCallCount() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUtils_GetIPCCallCount(m_pSteamUtils); + return result; +} +public override void SetWarningMessageHook(IntPtr pFunction) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUtils_SetWarningMessageHook(m_pSteamUtils,pFunction); +} +public override bool IsOverlayEnabled() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_IsOverlayEnabled(m_pSteamUtils); + return result; +} +public override bool BOverlayNeedsPresent() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_BOverlayNeedsPresent(m_pSteamUtils); + return result; +} +public override ulong CheckFileSignature(string szFileName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUtils_CheckFileSignature(m_pSteamUtils,szFileName); + return result; +} +public override bool ShowGamepadTextInput(int eInputMode,int eLineInputMode,string pchDescription,uint unCharMax,string pchExistingText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_ShowGamepadTextInput(m_pSteamUtils,eInputMode,eLineInputMode,pchDescription,unCharMax,pchExistingText); + return result; +} +public override uint GetEnteredGamepadTextLength() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(m_pSteamUtils); + return result; +} +public override bool GetEnteredGamepadTextInput(string pchText,uint cchText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(m_pSteamUtils,pchText,cchText); + return result; +} +public override string GetSteamUILanguage() +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamUtils_GetSteamUILanguage(m_pSteamUtils); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool IsSteamRunningInVR() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUtils_IsSteamRunningInVR(m_pSteamUtils); + return result; +} +public override void SetOverlayNotificationInset(int nHorizontalInset,int nVerticalInset) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUtils_SetOverlayNotificationInset(m_pSteamUtils,nHorizontalInset,nVerticalInset); +} +} + + +public class CSteamMatchmaking : ISteamMatchmaking +{ +public CSteamMatchmaking(IntPtr SteamMatchmaking) +{ + m_pSteamMatchmaking = SteamMatchmaking; +} +IntPtr m_pSteamMatchmaking; + +public override IntPtr GetIntPtr() { return m_pSteamMatchmaking; } + +private void CheckIfUsable() +{ + if (m_pSteamMatchmaking == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override int GetFavoriteGameCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(m_pSteamMatchmaking); + return result; +} +public override bool GetFavoriteGame(int iGame,ref uint pnAppID,ref uint pnIP,ref char pnConnPort,ref char pnQueryPort,ref uint punFlags,ref uint pRTime32LastPlayedOnServer) +{ + CheckIfUsable(); + pnAppID = 0; + pnIP = 0; + pnConnPort = (char) 0; + pnQueryPort = (char) 0; + punFlags = 0; + pRTime32LastPlayedOnServer = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetFavoriteGame(m_pSteamMatchmaking,iGame,ref pnAppID,ref pnIP,ref pnConnPort,ref pnQueryPort,ref punFlags,ref pRTime32LastPlayedOnServer); + return result; +} +public override int AddFavoriteGame(uint nAppID,uint nIP,char nConnPort,char nQueryPort,uint unFlags,uint rTime32LastPlayedOnServer) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddFavoriteGame(m_pSteamMatchmaking,nAppID,nIP,nConnPort,nQueryPort,unFlags,rTime32LastPlayedOnServer); + return result; +} +public override bool RemoveFavoriteGame(uint nAppID,uint nIP,char nConnPort,char nQueryPort,uint unFlags) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(m_pSteamMatchmaking,nAppID,nIP,nConnPort,nQueryPort,unFlags); + return result; +} +public override ulong RequestLobbyList() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_RequestLobbyList(m_pSteamMatchmaking); + return result; +} +public override void AddRequestLobbyListStringFilter(string pchKeyToMatch,string pchValueToMatch,uint eComparisonType) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(m_pSteamMatchmaking,pchKeyToMatch,pchValueToMatch,eComparisonType); +} +public override void AddRequestLobbyListNumericalFilter(string pchKeyToMatch,int nValueToMatch,uint eComparisonType) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(m_pSteamMatchmaking,pchKeyToMatch,nValueToMatch,eComparisonType); +} +public override void AddRequestLobbyListNearValueFilter(string pchKeyToMatch,int nValueToBeCloseTo) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(m_pSteamMatchmaking,pchKeyToMatch,nValueToBeCloseTo); +} +public override void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(m_pSteamMatchmaking,nSlotsAvailable); +} +public override void AddRequestLobbyListDistanceFilter(uint eLobbyDistanceFilter) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(m_pSteamMatchmaking,eLobbyDistanceFilter); +} +public override void AddRequestLobbyListResultCountFilter(int cMaxResults) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(m_pSteamMatchmaking,cMaxResults); +} +public override void AddRequestLobbyListCompatibleMembersFilter(ulong steamIDLobby) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(m_pSteamMatchmaking,steamIDLobby); +} +public override ulong GetLobbyByIndex(int iLobby) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyByIndex(m_pSteamMatchmaking,iLobby); + return result; +} +public override ulong CreateLobby(uint eLobbyType,int cMaxMembers) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_CreateLobby(m_pSteamMatchmaking,eLobbyType,cMaxMembers); + return result; +} +public override ulong JoinLobby(ulong steamIDLobby) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_JoinLobby(m_pSteamMatchmaking,steamIDLobby); + return result; +} +public override void LeaveLobby(ulong steamIDLobby) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_LeaveLobby(m_pSteamMatchmaking,steamIDLobby); +} +public override bool InviteUserToLobby(ulong steamIDLobby,ulong steamIDInvitee) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_InviteUserToLobby(m_pSteamMatchmaking,steamIDLobby,steamIDInvitee); + return result; +} +public override int GetNumLobbyMembers(ulong steamIDLobby) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(m_pSteamMatchmaking,steamIDLobby); + return result; +} +public override ulong GetLobbyMemberByIndex(ulong steamIDLobby,int iMember) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(m_pSteamMatchmaking,steamIDLobby,iMember); + return result; +} +public override string GetLobbyData(ulong steamIDLobby,string pchKey) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyData(m_pSteamMatchmaking,steamIDLobby,pchKey); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool SetLobbyData(ulong steamIDLobby,string pchKey,string pchValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyData(m_pSteamMatchmaking,steamIDLobby,pchKey,pchValue); + return result; +} +public override int GetLobbyDataCount(ulong steamIDLobby) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyDataCount(m_pSteamMatchmaking,steamIDLobby); + return result; +} +public override bool GetLobbyDataByIndex(ulong steamIDLobby,int iLobbyData,string pchKey,int cchKeyBufferSize,string pchValue,int cchValueBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(m_pSteamMatchmaking,steamIDLobby,iLobbyData,pchKey,cchKeyBufferSize,pchValue,cchValueBufferSize); + return result; +} +public override bool DeleteLobbyData(ulong steamIDLobby,string pchKey) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_DeleteLobbyData(m_pSteamMatchmaking,steamIDLobby,pchKey); + return result; +} +public override string GetLobbyMemberData(ulong steamIDLobby,ulong steamIDUser,string pchKey) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyMemberData(m_pSteamMatchmaking,steamIDLobby,steamIDUser,pchKey); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override void SetLobbyMemberData(ulong steamIDLobby,string pchKey,string pchValue) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyMemberData(m_pSteamMatchmaking,steamIDLobby,pchKey,pchValue); +} +public override bool SendLobbyChatMsg(ulong steamIDLobby,IntPtr pvMsgBody,int cubMsgBody) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(m_pSteamMatchmaking,steamIDLobby,pvMsgBody,cubMsgBody); + return result; +} +public override int GetLobbyChatEntry(ulong steamIDLobby,int iChatID,out CSteamID pSteamIDUser,IntPtr pvData,int cubData,ref uint peChatEntryType) +{ + CheckIfUsable(); + pSteamIDUser = new CSteamID(); + peChatEntryType = 0; + int result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(m_pSteamMatchmaking,steamIDLobby,iChatID,ref pSteamIDUser,pvData,cubData,ref peChatEntryType); + return result; +} +public override bool RequestLobbyData(ulong steamIDLobby) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_RequestLobbyData(m_pSteamMatchmaking,steamIDLobby); + return result; +} +public override void SetLobbyGameServer(ulong steamIDLobby,uint unGameServerIP,char unGameServerPort,ulong steamIDGameServer) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyGameServer(m_pSteamMatchmaking,steamIDLobby,unGameServerIP,unGameServerPort,steamIDGameServer); +} +public override bool GetLobbyGameServer(ulong steamIDLobby,ref uint punGameServerIP,ref char punGameServerPort,out CSteamID psteamIDGameServer) +{ + CheckIfUsable(); + punGameServerIP = 0; + punGameServerPort = (char) 0; + psteamIDGameServer = new CSteamID(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyGameServer(m_pSteamMatchmaking,steamIDLobby,ref punGameServerIP,ref punGameServerPort,ref psteamIDGameServer); + return result; +} +public override bool SetLobbyMemberLimit(ulong steamIDLobby,int cMaxMembers) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(m_pSteamMatchmaking,steamIDLobby,cMaxMembers); + return result; +} +public override int GetLobbyMemberLimit(ulong steamIDLobby) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(m_pSteamMatchmaking,steamIDLobby); + return result; +} +public override bool SetLobbyType(ulong steamIDLobby,uint eLobbyType) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyType(m_pSteamMatchmaking,steamIDLobby,eLobbyType); + return result; +} +public override bool SetLobbyJoinable(ulong steamIDLobby,bool bLobbyJoinable) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyJoinable(m_pSteamMatchmaking,steamIDLobby,bLobbyJoinable); + return result; +} +public override ulong GetLobbyOwner(ulong steamIDLobby) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_GetLobbyOwner(m_pSteamMatchmaking,steamIDLobby); + return result; +} +public override bool SetLobbyOwner(ulong steamIDLobby,ulong steamIDNewOwner) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLobbyOwner(m_pSteamMatchmaking,steamIDLobby,steamIDNewOwner); + return result; +} +public override bool SetLinkedLobby(ulong steamIDLobby,ulong steamIDLobbyDependent) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmaking_SetLinkedLobby(m_pSteamMatchmaking,steamIDLobby,steamIDLobbyDependent); + return result; +} +} + + +public class CSteamMatchmakingServerListResponse : ISteamMatchmakingServerListResponse +{ +public CSteamMatchmakingServerListResponse(IntPtr SteamMatchmakingServerListResponse) +{ + m_pSteamMatchmakingServerListResponse = SteamMatchmakingServerListResponse; +} +IntPtr m_pSteamMatchmakingServerListResponse; + +public override IntPtr GetIntPtr() { return m_pSteamMatchmakingServerListResponse; } + +private void CheckIfUsable() +{ + if (m_pSteamMatchmakingServerListResponse == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void ServerResponded(uint hRequest,int iServer) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded(m_pSteamMatchmakingServerListResponse,hRequest,iServer); +} +public override void ServerFailedToRespond(uint hRequest,int iServer) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond(m_pSteamMatchmakingServerListResponse,hRequest,iServer); +} +public override void RefreshComplete(uint hRequest,uint response) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete(m_pSteamMatchmakingServerListResponse,hRequest,response); +} +} + + +public class CSteamMatchmakingPingResponse : ISteamMatchmakingPingResponse +{ +public CSteamMatchmakingPingResponse(IntPtr SteamMatchmakingPingResponse) +{ + m_pSteamMatchmakingPingResponse = SteamMatchmakingPingResponse; +} +IntPtr m_pSteamMatchmakingPingResponse; + +public override IntPtr GetIntPtr() { return m_pSteamMatchmakingPingResponse; } + +private void CheckIfUsable() +{ + if (m_pSteamMatchmakingPingResponse == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void ServerResponded(IntPtr server) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingPingResponse_ServerResponded(m_pSteamMatchmakingPingResponse,server); +} +public override void ServerFailedToRespond() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond(m_pSteamMatchmakingPingResponse); +} +} + + +public class CSteamMatchmakingPlayersResponse : ISteamMatchmakingPlayersResponse +{ +public CSteamMatchmakingPlayersResponse(IntPtr SteamMatchmakingPlayersResponse) +{ + m_pSteamMatchmakingPlayersResponse = SteamMatchmakingPlayersResponse; +} +IntPtr m_pSteamMatchmakingPlayersResponse; + +public override IntPtr GetIntPtr() { return m_pSteamMatchmakingPlayersResponse; } + +private void CheckIfUsable() +{ + if (m_pSteamMatchmakingPlayersResponse == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void AddPlayerToList(string pchName,int nScore,float flTimePlayed) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList(m_pSteamMatchmakingPlayersResponse,pchName,nScore,flTimePlayed); +} +public override void PlayersFailedToRespond() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond(m_pSteamMatchmakingPlayersResponse); +} +public override void PlayersRefreshComplete() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete(m_pSteamMatchmakingPlayersResponse); +} +} + + +public class CSteamMatchmakingRulesResponse : ISteamMatchmakingRulesResponse +{ +public CSteamMatchmakingRulesResponse(IntPtr SteamMatchmakingRulesResponse) +{ + m_pSteamMatchmakingRulesResponse = SteamMatchmakingRulesResponse; +} +IntPtr m_pSteamMatchmakingRulesResponse; + +public override IntPtr GetIntPtr() { return m_pSteamMatchmakingRulesResponse; } + +private void CheckIfUsable() +{ + if (m_pSteamMatchmakingRulesResponse == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void RulesResponded(string pchRule,string pchValue) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded(m_pSteamMatchmakingRulesResponse,pchRule,pchValue); +} +public override void RulesFailedToRespond() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond(m_pSteamMatchmakingRulesResponse); +} +public override void RulesRefreshComplete() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete(m_pSteamMatchmakingRulesResponse); +} +} + + +public class CSteamMatchmakingServers : ISteamMatchmakingServers +{ +public CSteamMatchmakingServers(IntPtr SteamMatchmakingServers) +{ + m_pSteamMatchmakingServers = SteamMatchmakingServers; +} +IntPtr m_pSteamMatchmakingServers; + +public override IntPtr GetIntPtr() { return m_pSteamMatchmakingServers; } + +private void CheckIfUsable() +{ + if (m_pSteamMatchmakingServers == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint RequestInternetServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(m_pSteamMatchmakingServers,iApp,ppchFilters,(uint) ppchFilters.Length,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint RequestLANServerList(uint iApp,ISteamMatchmakingServerListResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RequestLANServerList(m_pSteamMatchmakingServers,iApp,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint RequestFriendsServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(m_pSteamMatchmakingServers,iApp,ppchFilters,(uint) ppchFilters.Length,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint RequestFavoritesServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(m_pSteamMatchmakingServers,iApp,ppchFilters,(uint) ppchFilters.Length,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint RequestHistoryServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(m_pSteamMatchmakingServers,iApp,ppchFilters,(uint) ppchFilters.Length,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint RequestSpectatorServerList(uint iApp,MatchMakingKeyValuePair_t [] ppchFilters,ISteamMatchmakingServerListResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(m_pSteamMatchmakingServers,iApp,ppchFilters,(uint) ppchFilters.Length,pRequestServersResponse.GetIntPtr()); + return result; +} +public override void ReleaseRequest(uint hServerListRequest) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_ReleaseRequest(m_pSteamMatchmakingServers,hServerListRequest); +} +public override gameserveritem_t GetServerDetails(uint hRequest,int iServer) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_GetServerDetails(m_pSteamMatchmakingServers,hRequest,iServer); + return (gameserveritem_t) Marshal.PtrToStructure(result, typeof(gameserveritem_t)); +} +public override void CancelQuery(uint hRequest) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_CancelQuery(m_pSteamMatchmakingServers,hRequest); +} +public override void RefreshQuery(uint hRequest) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RefreshQuery(m_pSteamMatchmakingServers,hRequest); +} +public override bool IsRefreshing(uint hRequest) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_IsRefreshing(m_pSteamMatchmakingServers,hRequest); + return result; +} +public override int GetServerCount(uint hRequest) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_GetServerCount(m_pSteamMatchmakingServers,hRequest); + return result; +} +public override void RefreshServer(uint hRequest,int iServer) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_RefreshServer(m_pSteamMatchmakingServers,hRequest,iServer); +} +public override uint PingServer(uint unIP,char usPort,ISteamMatchmakingPingResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_PingServer(m_pSteamMatchmakingServers,unIP,usPort,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint PlayerDetails(uint unIP,char usPort,ISteamMatchmakingPlayersResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_PlayerDetails(m_pSteamMatchmakingServers,unIP,usPort,pRequestServersResponse.GetIntPtr()); + return result; +} +public override uint ServerRules(uint unIP,char usPort,ISteamMatchmakingRulesResponse pRequestServersResponse) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_ServerRules(m_pSteamMatchmakingServers,unIP,usPort,pRequestServersResponse.GetIntPtr()); + return result; +} +public override void CancelServerQuery(uint hServerQuery) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_CancelServerQuery(m_pSteamMatchmakingServers,hServerQuery); +} +} + + +public class CSteamRemoteStorage : ISteamRemoteStorage +{ +public CSteamRemoteStorage(IntPtr SteamRemoteStorage) +{ + m_pSteamRemoteStorage = SteamRemoteStorage; +} +IntPtr m_pSteamRemoteStorage; + +public override IntPtr GetIntPtr() { return m_pSteamRemoteStorage; } + +private void CheckIfUsable() +{ + if (m_pSteamRemoteStorage == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool FileWrite(string pchFile,IntPtr pvData,int cubData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileWrite(m_pSteamRemoteStorage,pchFile,pvData,cubData); + return result; +} +public override int FileRead(string pchFile,IntPtr pvData,int cubDataToRead) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileRead(m_pSteamRemoteStorage,pchFile,pvData,cubDataToRead); + return result; +} +public override ulong FileWriteAsync(string pchFile,IntPtr pvData,uint cubData) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileWriteAsync(m_pSteamRemoteStorage,pchFile,pvData,cubData); + return result; +} +public override ulong FileReadAsync(string pchFile,uint nOffset,uint cubToRead) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileReadAsync(m_pSteamRemoteStorage,pchFile,nOffset,cubToRead); + return result; +} +public override bool FileReadAsyncComplete(ulong hReadCall,IntPtr pvBuffer,uint cubToRead) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(m_pSteamRemoteStorage,hReadCall,pvBuffer,cubToRead); + return result; +} +public override bool FileForget(string pchFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileForget(m_pSteamRemoteStorage,pchFile); + return result; +} +public override bool FileDelete(string pchFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileDelete(m_pSteamRemoteStorage,pchFile); + return result; +} +public override ulong FileShare(string pchFile) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileShare(m_pSteamRemoteStorage,pchFile); + return result; +} +public override bool SetSyncPlatforms(string pchFile,uint eRemoteStoragePlatform) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(m_pSteamRemoteStorage,pchFile,eRemoteStoragePlatform); + return result; +} +public override ulong FileWriteStreamOpen(string pchFile) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(m_pSteamRemoteStorage,pchFile); + return result; +} +public override bool FileWriteStreamWriteChunk(ulong writeHandle,IntPtr pvData,int cubData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(m_pSteamRemoteStorage,writeHandle,pvData,cubData); + return result; +} +public override bool FileWriteStreamClose(ulong writeHandle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(m_pSteamRemoteStorage,writeHandle); + return result; +} +public override bool FileWriteStreamCancel(ulong writeHandle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(m_pSteamRemoteStorage,writeHandle); + return result; +} +public override bool FileExists(string pchFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FileExists(m_pSteamRemoteStorage,pchFile); + return result; +} +public override bool FilePersisted(string pchFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_FilePersisted(m_pSteamRemoteStorage,pchFile); + return result; +} +public override int GetFileSize(string pchFile) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetFileSize(m_pSteamRemoteStorage,pchFile); + return result; +} +public override long GetFileTimestamp(string pchFile) +{ + CheckIfUsable(); + long result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetFileTimestamp(m_pSteamRemoteStorage,pchFile); + return result; +} +public override uint GetSyncPlatforms(string pchFile) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(m_pSteamRemoteStorage,pchFile); + return result; +} +public override int GetFileCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetFileCount(m_pSteamRemoteStorage); + return result; +} +public override string GetFileNameAndSize(int iFile,ref int pnFileSizeInBytes) +{ + CheckIfUsable(); + pnFileSizeInBytes = 0; + IntPtr result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(m_pSteamRemoteStorage,iFile,ref pnFileSizeInBytes); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool GetQuota(ref int pnTotalBytes,ref int puAvailableBytes) +{ + CheckIfUsable(); + pnTotalBytes = 0; + puAvailableBytes = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetQuota(m_pSteamRemoteStorage,ref pnTotalBytes,ref puAvailableBytes); + return result; +} +public override bool IsCloudEnabledForAccount() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(m_pSteamRemoteStorage); + return result; +} +public override bool IsCloudEnabledForApp() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(m_pSteamRemoteStorage); + return result; +} +public override void SetCloudEnabledForApp(bool bEnabled) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(m_pSteamRemoteStorage,bEnabled); +} +public override ulong UGCDownload(ulong hContent,uint unPriority) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UGCDownload(m_pSteamRemoteStorage,hContent,unPriority); + return result; +} +public override bool GetUGCDownloadProgress(ulong hContent,ref int pnBytesDownloaded,ref int pnBytesExpected) +{ + CheckIfUsable(); + pnBytesDownloaded = 0; + pnBytesExpected = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(m_pSteamRemoteStorage,hContent,ref pnBytesDownloaded,ref pnBytesExpected); + return result; +} +public override bool GetUGCDetails(ulong hContent,ref uint pnAppID,string ppchName,ref int pnFileSizeInBytes,out CSteamID pSteamIDOwner) +{ + CheckIfUsable(); + pnAppID = 0; + ppchName = ""; + pnFileSizeInBytes = 0; + pSteamIDOwner = new CSteamID(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetUGCDetails(m_pSteamRemoteStorage,hContent,ref pnAppID,ppchName,ref pnFileSizeInBytes,ref pSteamIDOwner); + return result; +} +public override int UGCRead(ulong hContent,IntPtr pvData,int cubDataToRead,uint cOffset,uint eAction) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UGCRead(m_pSteamRemoteStorage,hContent,pvData,cubDataToRead,cOffset,eAction); + return result; +} +public override int GetCachedUGCCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(m_pSteamRemoteStorage); + return result; +} +public override ulong GetCachedUGCHandle(int iCachedContent) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(m_pSteamRemoteStorage,iCachedContent); + return result; +} +public override ulong PublishWorkshopFile(string pchFile,string pchPreviewFile,uint nConsumerAppId,string pchTitle,string pchDescription,uint eVisibility,ref SteamParamStringArray_t pTags,uint eWorkshopFileType) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(m_pSteamRemoteStorage,pchFile,pchPreviewFile,nConsumerAppId,pchTitle,pchDescription,eVisibility,ref pTags,eWorkshopFileType); + return result; +} +public override ulong CreatePublishedFileUpdateRequest(ulong unPublishedFileId) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(m_pSteamRemoteStorage,unPublishedFileId); + return result; +} +public override bool UpdatePublishedFileFile(ulong updateHandle,string pchFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(m_pSteamRemoteStorage,updateHandle,pchFile); + return result; +} +public override bool UpdatePublishedFilePreviewFile(ulong updateHandle,string pchPreviewFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(m_pSteamRemoteStorage,updateHandle,pchPreviewFile); + return result; +} +public override bool UpdatePublishedFileTitle(ulong updateHandle,string pchTitle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(m_pSteamRemoteStorage,updateHandle,pchTitle); + return result; +} +public override bool UpdatePublishedFileDescription(ulong updateHandle,string pchDescription) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(m_pSteamRemoteStorage,updateHandle,pchDescription); + return result; +} +public override bool UpdatePublishedFileVisibility(ulong updateHandle,uint eVisibility) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(m_pSteamRemoteStorage,updateHandle,eVisibility); + return result; +} +public override bool UpdatePublishedFileTags(ulong updateHandle,ref SteamParamStringArray_t pTags) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(m_pSteamRemoteStorage,updateHandle,ref pTags); + return result; +} +public override ulong CommitPublishedFileUpdate(ulong updateHandle) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(m_pSteamRemoteStorage,updateHandle); + return result; +} +public override ulong GetPublishedFileDetails(ulong unPublishedFileId,uint unMaxSecondsOld) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(m_pSteamRemoteStorage,unPublishedFileId,unMaxSecondsOld); + return result; +} +public override ulong DeletePublishedFile(ulong unPublishedFileId) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_DeletePublishedFile(m_pSteamRemoteStorage,unPublishedFileId); + return result; +} +public override ulong EnumerateUserPublishedFiles(uint unStartIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(m_pSteamRemoteStorage,unStartIndex); + return result; +} +public override ulong SubscribePublishedFile(ulong unPublishedFileId) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(m_pSteamRemoteStorage,unPublishedFileId); + return result; +} +public override ulong EnumerateUserSubscribedFiles(uint unStartIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(m_pSteamRemoteStorage,unStartIndex); + return result; +} +public override ulong UnsubscribePublishedFile(ulong unPublishedFileId) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(m_pSteamRemoteStorage,unPublishedFileId); + return result; +} +public override bool UpdatePublishedFileSetChangeDescription(ulong updateHandle,string pchChangeDescription) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(m_pSteamRemoteStorage,updateHandle,pchChangeDescription); + return result; +} +public override ulong GetPublishedItemVoteDetails(ulong unPublishedFileId) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(m_pSteamRemoteStorage,unPublishedFileId); + return result; +} +public override ulong UpdateUserPublishedItemVote(ulong unPublishedFileId,bool bVoteUp) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(m_pSteamRemoteStorage,unPublishedFileId,bVoteUp); + return result; +} +public override ulong GetUserPublishedItemVoteDetails(ulong unPublishedFileId) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(m_pSteamRemoteStorage,unPublishedFileId); + return result; +} +public override ulong EnumerateUserSharedWorkshopFiles(ulong steamId,uint unStartIndex,ref SteamParamStringArray_t pRequiredTags,ref SteamParamStringArray_t pExcludedTags) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(m_pSteamRemoteStorage,steamId,unStartIndex,ref pRequiredTags,ref pExcludedTags); + return result; +} +public override ulong PublishVideo(uint eVideoProvider,string pchVideoAccount,string pchVideoIdentifier,string pchPreviewFile,uint nConsumerAppId,string pchTitle,string pchDescription,uint eVisibility,ref SteamParamStringArray_t pTags) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_PublishVideo(m_pSteamRemoteStorage,eVideoProvider,pchVideoAccount,pchVideoIdentifier,pchPreviewFile,nConsumerAppId,pchTitle,pchDescription,eVisibility,ref pTags); + return result; +} +public override ulong SetUserPublishedFileAction(ulong unPublishedFileId,uint eAction) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(m_pSteamRemoteStorage,unPublishedFileId,eAction); + return result; +} +public override ulong EnumeratePublishedFilesByUserAction(uint eAction,uint unStartIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(m_pSteamRemoteStorage,eAction,unStartIndex); + return result; +} +public override ulong EnumeratePublishedWorkshopFiles(uint eEnumerationType,uint unStartIndex,uint unCount,uint unDays,ref SteamParamStringArray_t pTags,ref SteamParamStringArray_t pUserTags) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(m_pSteamRemoteStorage,eEnumerationType,unStartIndex,unCount,unDays,ref pTags,ref pUserTags); + return result; +} +public override ulong UGCDownloadToLocation(ulong hContent,string pchLocation,uint unPriority) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(m_pSteamRemoteStorage,hContent,pchLocation,unPriority); + return result; +} +} + + +public class CSteamUserStats : ISteamUserStats +{ +public CSteamUserStats(IntPtr SteamUserStats) +{ + m_pSteamUserStats = SteamUserStats; +} +IntPtr m_pSteamUserStats; + +public override IntPtr GetIntPtr() { return m_pSteamUserStats; } + +private void CheckIfUsable() +{ + if (m_pSteamUserStats == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool RequestCurrentStats() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_RequestCurrentStats(m_pSteamUserStats); + return result; +} +public override bool GetStat(string pchName,ref int pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetStat(m_pSteamUserStats,pchName,ref pData); + return result; +} +public override bool GetStat0(string pchName,ref float pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetStat0(m_pSteamUserStats,pchName,ref pData); + return result; +} +public override bool SetStat(string pchName,int nData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_SetStat(m_pSteamUserStats,pchName,nData); + return result; +} +public override bool SetStat0(string pchName,float fData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_SetStat0(m_pSteamUserStats,pchName,fData); + return result; +} +public override bool UpdateAvgRateStat(string pchName,float flCountThisSession,double dSessionLength) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_UpdateAvgRateStat(m_pSteamUserStats,pchName,flCountThisSession,dSessionLength); + return result; +} +public override bool GetAchievement(string pchName,ref bool pbAchieved) +{ + CheckIfUsable(); + pbAchieved = false; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetAchievement(m_pSteamUserStats,pchName,ref pbAchieved); + return result; +} +public override bool SetAchievement(string pchName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_SetAchievement(m_pSteamUserStats,pchName); + return result; +} +public override bool ClearAchievement(string pchName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_ClearAchievement(m_pSteamUserStats,pchName); + return result; +} +public override bool GetAchievementAndUnlockTime(string pchName,ref bool pbAchieved,ref uint punUnlockTime) +{ + CheckIfUsable(); + pbAchieved = false; + punUnlockTime = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(m_pSteamUserStats,pchName,ref pbAchieved,ref punUnlockTime); + return result; +} +public override bool StoreStats() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_StoreStats(m_pSteamUserStats); + return result; +} +public override int GetAchievementIcon(string pchName) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetAchievementIcon(m_pSteamUserStats,pchName); + return result; +} +public override string GetAchievementDisplayAttribute(string pchName,string pchKey) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(m_pSteamUserStats,pchName,pchKey); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool IndicateAchievementProgress(string pchName,uint nCurProgress,uint nMaxProgress) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_IndicateAchievementProgress(m_pSteamUserStats,pchName,nCurProgress,nMaxProgress); + return result; +} +public override uint GetNumAchievements() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetNumAchievements(m_pSteamUserStats); + return result; +} +public override string GetAchievementName(uint iAchievement) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetAchievementName(m_pSteamUserStats,iAchievement); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override ulong RequestUserStats(ulong steamIDUser) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_RequestUserStats(m_pSteamUserStats,steamIDUser); + return result; +} +public override bool GetUserStat(ulong steamIDUser,string pchName,ref int pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetUserStat(m_pSteamUserStats,steamIDUser,pchName,ref pData); + return result; +} +public override bool GetUserStat0(ulong steamIDUser,string pchName,ref float pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetUserStat0(m_pSteamUserStats,steamIDUser,pchName,ref pData); + return result; +} +public override bool GetUserAchievement(ulong steamIDUser,string pchName,ref bool pbAchieved) +{ + CheckIfUsable(); + pbAchieved = false; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetUserAchievement(m_pSteamUserStats,steamIDUser,pchName,ref pbAchieved); + return result; +} +public override bool GetUserAchievementAndUnlockTime(ulong steamIDUser,string pchName,ref bool pbAchieved,ref uint punUnlockTime) +{ + CheckIfUsable(); + pbAchieved = false; + punUnlockTime = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(m_pSteamUserStats,steamIDUser,pchName,ref pbAchieved,ref punUnlockTime); + return result; +} +public override bool ResetAllStats(bool bAchievementsToo) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_ResetAllStats(m_pSteamUserStats,bAchievementsToo); + return result; +} +public override ulong FindOrCreateLeaderboard(string pchLeaderboardName,uint eLeaderboardSortMethod,uint eLeaderboardDisplayType) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(m_pSteamUserStats,pchLeaderboardName,eLeaderboardSortMethod,eLeaderboardDisplayType); + return result; +} +public override ulong FindLeaderboard(string pchLeaderboardName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_FindLeaderboard(m_pSteamUserStats,pchLeaderboardName); + return result; +} +public override string GetLeaderboardName(ulong hSteamLeaderboard) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetLeaderboardName(m_pSteamUserStats,hSteamLeaderboard); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override int GetLeaderboardEntryCount(ulong hSteamLeaderboard) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(m_pSteamUserStats,hSteamLeaderboard); + return result; +} +public override uint GetLeaderboardSortMethod(ulong hSteamLeaderboard) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(m_pSteamUserStats,hSteamLeaderboard); + return result; +} +public override uint GetLeaderboardDisplayType(ulong hSteamLeaderboard) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(m_pSteamUserStats,hSteamLeaderboard); + return result; +} +public override ulong DownloadLeaderboardEntries(ulong hSteamLeaderboard,uint eLeaderboardDataRequest,int nRangeStart,int nRangeEnd) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(m_pSteamUserStats,hSteamLeaderboard,eLeaderboardDataRequest,nRangeStart,nRangeEnd); + return result; +} +public override ulong DownloadLeaderboardEntriesForUsers(ulong hSteamLeaderboard,CSteamID [] prgUsers) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(m_pSteamUserStats,hSteamLeaderboard,prgUsers,(int) prgUsers.Length); + return result; +} +public override bool GetDownloadedLeaderboardEntry(ulong hSteamLeaderboardEntries,int index,ref LeaderboardEntry_t pLeaderboardEntry,ref int pDetails,int cDetailsMax) +{ + CheckIfUsable(); + pDetails = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(m_pSteamUserStats,hSteamLeaderboardEntries,index,ref pLeaderboardEntry,ref pDetails,cDetailsMax); + return result; +} +public override ulong UploadLeaderboardScore(ulong hSteamLeaderboard,uint eLeaderboardUploadScoreMethod,int nScore,ref int pScoreDetails,int cScoreDetailsCount) +{ + CheckIfUsable(); + pScoreDetails = 0; + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_UploadLeaderboardScore(m_pSteamUserStats,hSteamLeaderboard,eLeaderboardUploadScoreMethod,nScore,ref pScoreDetails,cScoreDetailsCount); + return result; +} +public override ulong AttachLeaderboardUGC(ulong hSteamLeaderboard,ulong hUGC) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_AttachLeaderboardUGC(m_pSteamUserStats,hSteamLeaderboard,hUGC); + return result; +} +public override ulong GetNumberOfCurrentPlayers() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(m_pSteamUserStats); + return result; +} +public override ulong RequestGlobalAchievementPercentages() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(m_pSteamUserStats); + return result; +} +public override int GetMostAchievedAchievementInfo(string pchName,uint unNameBufLen,ref float pflPercent,ref bool pbAchieved) +{ + CheckIfUsable(); + pflPercent = 0; + pbAchieved = false; + int result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(m_pSteamUserStats,pchName,unNameBufLen,ref pflPercent,ref pbAchieved); + return result; +} +public override int GetNextMostAchievedAchievementInfo(int iIteratorPrevious,string pchName,uint unNameBufLen,ref float pflPercent,ref bool pbAchieved) +{ + CheckIfUsable(); + pflPercent = 0; + pbAchieved = false; + int result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(m_pSteamUserStats,iIteratorPrevious,pchName,unNameBufLen,ref pflPercent,ref pbAchieved); + return result; +} +public override bool GetAchievementAchievedPercent(string pchName,ref float pflPercent) +{ + CheckIfUsable(); + pflPercent = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(m_pSteamUserStats,pchName,ref pflPercent); + return result; +} +public override ulong RequestGlobalStats(int nHistoryDays) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUserStats_RequestGlobalStats(m_pSteamUserStats,nHistoryDays); + return result; +} +public override bool GetGlobalStat(string pchStatName,ref long pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetGlobalStat(m_pSteamUserStats,pchStatName,ref pData); + return result; +} +public override bool GetGlobalStat0(string pchStatName,ref double pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetGlobalStat0(m_pSteamUserStats,pchStatName,ref pData); + return result; +} +public override int GetGlobalStatHistory(string pchStatName,long [] pData) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetGlobalStatHistory(m_pSteamUserStats,pchStatName,pData,(uint) pData.Length); + return result; +} +public override int GetGlobalStatHistory0(string pchStatName,double [] pData) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamUserStats_GetGlobalStatHistory0(m_pSteamUserStats,pchStatName,pData,(uint) pData.Length); + return result; +} +} + + +public class CSteamApps : ISteamApps +{ +public CSteamApps(IntPtr SteamApps) +{ + m_pSteamApps = SteamApps; +} +IntPtr m_pSteamApps; + +public override IntPtr GetIntPtr() { return m_pSteamApps; } + +private void CheckIfUsable() +{ + if (m_pSteamApps == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool BIsSubscribed() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsSubscribed(m_pSteamApps); + return result; +} +public override bool BIsLowViolence() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsLowViolence(m_pSteamApps); + return result; +} +public override bool BIsCybercafe() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsCybercafe(m_pSteamApps); + return result; +} +public override bool BIsVACBanned() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsVACBanned(m_pSteamApps); + return result; +} +public override string GetCurrentGameLanguage() +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamApps_GetCurrentGameLanguage(m_pSteamApps); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override string GetAvailableGameLanguages() +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamApps_GetAvailableGameLanguages(m_pSteamApps); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool BIsSubscribedApp(uint appID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsSubscribedApp(m_pSteamApps,appID); + return result; +} +public override bool BIsDlcInstalled(uint appID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsDlcInstalled(m_pSteamApps,appID); + return result; +} +public override uint GetEarliestPurchaseUnixTime(uint nAppID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(m_pSteamApps,nAppID); + return result; +} +public override bool BIsSubscribedFromFreeWeekend() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(m_pSteamApps); + return result; +} +public override int GetDLCCount() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamApps_GetDLCCount(m_pSteamApps); + return result; +} +public override bool BGetDLCDataByIndex(int iDLC,ref uint pAppID,ref bool pbAvailable,string pchName,int cchNameBufferSize) +{ + CheckIfUsable(); + pAppID = 0; + pbAvailable = false; + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BGetDLCDataByIndex(m_pSteamApps,iDLC,ref pAppID,ref pbAvailable,pchName,cchNameBufferSize); + return result; +} +public override void InstallDLC(uint nAppID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamApps_InstallDLC(m_pSteamApps,nAppID); +} +public override void UninstallDLC(uint nAppID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamApps_UninstallDLC(m_pSteamApps,nAppID); +} +public override void RequestAppProofOfPurchaseKey(uint nAppID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(m_pSteamApps,nAppID); +} +public override bool GetCurrentBetaName(string pchName,int cchNameBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_GetCurrentBetaName(m_pSteamApps,pchName,cchNameBufferSize); + return result; +} +public override bool MarkContentCorrupt(bool bMissingFilesOnly) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_MarkContentCorrupt(m_pSteamApps,bMissingFilesOnly); + return result; +} +public override uint GetInstalledDepots(uint appID,ref uint pvecDepots,uint cMaxDepots) +{ + CheckIfUsable(); + pvecDepots = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamApps_GetInstalledDepots(m_pSteamApps,appID,ref pvecDepots,cMaxDepots); + return result; +} +public override uint GetAppInstallDir(uint appID,string pchFolder,uint cchFolderBufferSize) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamApps_GetAppInstallDir(m_pSteamApps,appID,pchFolder,cchFolderBufferSize); + return result; +} +public override bool BIsAppInstalled(uint appID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsAppInstalled(m_pSteamApps,appID); + return result; +} +public override ulong GetAppOwner() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamApps_GetAppOwner(m_pSteamApps); + return result; +} +public override string GetLaunchQueryParam(string pchKey) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamApps_GetLaunchQueryParam(m_pSteamApps,pchKey); + return (string) Marshal.PtrToStructure(result, typeof(string)); +} +public override bool GetDlcDownloadProgress(uint nAppID,ref ulong punBytesDownloaded,ref ulong punBytesTotal) +{ + CheckIfUsable(); + punBytesDownloaded = 0; + punBytesTotal = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamApps_GetDlcDownloadProgress(m_pSteamApps,nAppID,ref punBytesDownloaded,ref punBytesTotal); + return result; +} +public override int GetAppBuildId() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamApps_GetAppBuildId(m_pSteamApps); + return result; +} +} + + +public class CSteamNetworking : ISteamNetworking +{ +public CSteamNetworking(IntPtr SteamNetworking) +{ + m_pSteamNetworking = SteamNetworking; +} +IntPtr m_pSteamNetworking; + +public override IntPtr GetIntPtr() { return m_pSteamNetworking; } + +private void CheckIfUsable() +{ + if (m_pSteamNetworking == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool SendP2PPacket(ulong steamIDRemote,IntPtr pubData,uint cubData,uint eP2PSendType,int nChannel) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_SendP2PPacket(m_pSteamNetworking,steamIDRemote,pubData,cubData,eP2PSendType,nChannel); + return result; +} +public override bool IsP2PPacketAvailable(ref uint pcubMsgSize,int nChannel) +{ + CheckIfUsable(); + pcubMsgSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_IsP2PPacketAvailable(m_pSteamNetworking,ref pcubMsgSize,nChannel); + return result; +} +public override bool ReadP2PPacket(IntPtr pubDest,uint cubDest,ref uint pcubMsgSize,ref CSteamID psteamIDRemote,int nChannel) +{ + CheckIfUsable(); + pcubMsgSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_ReadP2PPacket(m_pSteamNetworking,pubDest,cubDest,ref pcubMsgSize,ref psteamIDRemote,nChannel); + return result; +} +public override bool AcceptP2PSessionWithUser(ulong steamIDRemote) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(m_pSteamNetworking,steamIDRemote); + return result; +} +public override bool CloseP2PSessionWithUser(ulong steamIDRemote) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(m_pSteamNetworking,steamIDRemote); + return result; +} +public override bool CloseP2PChannelWithUser(ulong steamIDRemote,int nChannel) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(m_pSteamNetworking,steamIDRemote,nChannel); + return result; +} +public override bool GetP2PSessionState(ulong steamIDRemote,ref P2PSessionState_t pConnectionState) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_GetP2PSessionState(m_pSteamNetworking,steamIDRemote,ref pConnectionState); + return result; +} +public override bool AllowP2PPacketRelay(bool bAllow) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_AllowP2PPacketRelay(m_pSteamNetworking,bAllow); + return result; +} +public override uint CreateListenSocket(int nVirtualP2PPort,uint nIP,char nPort,bool bAllowUseOfPacketRelay) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamNetworking_CreateListenSocket(m_pSteamNetworking,nVirtualP2PPort,nIP,nPort,bAllowUseOfPacketRelay); + return result; +} +public override uint CreateP2PConnectionSocket(ulong steamIDTarget,int nVirtualPort,int nTimeoutSec,bool bAllowUseOfPacketRelay) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(m_pSteamNetworking,steamIDTarget,nVirtualPort,nTimeoutSec,bAllowUseOfPacketRelay); + return result; +} +public override uint CreateConnectionSocket(uint nIP,char nPort,int nTimeoutSec) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamNetworking_CreateConnectionSocket(m_pSteamNetworking,nIP,nPort,nTimeoutSec); + return result; +} +public override bool DestroySocket(uint hSocket,bool bNotifyRemoteEnd) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_DestroySocket(m_pSteamNetworking,hSocket,bNotifyRemoteEnd); + return result; +} +public override bool DestroyListenSocket(uint hSocket,bool bNotifyRemoteEnd) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_DestroyListenSocket(m_pSteamNetworking,hSocket,bNotifyRemoteEnd); + return result; +} +public override bool SendDataOnSocket(uint hSocket,IntPtr pubData,uint cubData,bool bReliable) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_SendDataOnSocket(m_pSteamNetworking,hSocket,pubData,cubData,bReliable); + return result; +} +public override bool IsDataAvailableOnSocket(uint hSocket,ref uint pcubMsgSize) +{ + CheckIfUsable(); + pcubMsgSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(m_pSteamNetworking,hSocket,ref pcubMsgSize); + return result; +} +public override bool RetrieveDataFromSocket(uint hSocket,IntPtr pubDest,uint cubDest,ref uint pcubMsgSize) +{ + CheckIfUsable(); + pcubMsgSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_RetrieveDataFromSocket(m_pSteamNetworking,hSocket,pubDest,cubDest,ref pcubMsgSize); + return result; +} +public override bool IsDataAvailable(uint hListenSocket,ref uint pcubMsgSize,ref uint phSocket) +{ + CheckIfUsable(); + pcubMsgSize = 0; + phSocket = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_IsDataAvailable(m_pSteamNetworking,hListenSocket,ref pcubMsgSize,ref phSocket); + return result; +} +public override bool RetrieveData(uint hListenSocket,IntPtr pubDest,uint cubDest,ref uint pcubMsgSize,ref uint phSocket) +{ + CheckIfUsable(); + pcubMsgSize = 0; + phSocket = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_RetrieveData(m_pSteamNetworking,hListenSocket,pubDest,cubDest,ref pcubMsgSize,ref phSocket); + return result; +} +public override bool GetSocketInfo(uint hSocket,ref CSteamID pSteamIDRemote,ref int peSocketStatus,ref uint punIPRemote,ref char punPortRemote) +{ + CheckIfUsable(); + peSocketStatus = 0; + punIPRemote = 0; + punPortRemote = (char) 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_GetSocketInfo(m_pSteamNetworking,hSocket,ref pSteamIDRemote,ref peSocketStatus,ref punIPRemote,ref punPortRemote); + return result; +} +public override bool GetListenSocketInfo(uint hListenSocket,ref uint pnIP,ref char pnPort) +{ + CheckIfUsable(); + pnIP = 0; + pnPort = (char) 0; + bool result = NativeEntrypoints.SteamAPI_ISteamNetworking_GetListenSocketInfo(m_pSteamNetworking,hListenSocket,ref pnIP,ref pnPort); + return result; +} +public override uint GetSocketConnectionType(uint hSocket) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamNetworking_GetSocketConnectionType(m_pSteamNetworking,hSocket); + return result; +} +public override int GetMaxPacketSize(uint hSocket) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamNetworking_GetMaxPacketSize(m_pSteamNetworking,hSocket); + return result; +} +} + + +public class CSteamScreenshots : ISteamScreenshots +{ +public CSteamScreenshots(IntPtr SteamScreenshots) +{ + m_pSteamScreenshots = SteamScreenshots; +} +IntPtr m_pSteamScreenshots; + +public override IntPtr GetIntPtr() { return m_pSteamScreenshots; } + +private void CheckIfUsable() +{ + if (m_pSteamScreenshots == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint WriteScreenshot(IntPtr pubRGB,uint cubRGB,int nWidth,int nHeight) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamScreenshots_WriteScreenshot(m_pSteamScreenshots,pubRGB,cubRGB,nWidth,nHeight); + return result; +} +public override uint AddScreenshotToLibrary(string pchFilename,string pchThumbnailFilename,int nWidth,int nHeight) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(m_pSteamScreenshots,pchFilename,pchThumbnailFilename,nWidth,nHeight); + return result; +} +public override void TriggerScreenshot() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamScreenshots_TriggerScreenshot(m_pSteamScreenshots); +} +public override void HookScreenshots(bool bHook) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamScreenshots_HookScreenshots(m_pSteamScreenshots,bHook); +} +public override bool SetLocation(uint hScreenshot,string pchLocation) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamScreenshots_SetLocation(m_pSteamScreenshots,hScreenshot,pchLocation); + return result; +} +public override bool TagUser(uint hScreenshot,ulong steamID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamScreenshots_TagUser(m_pSteamScreenshots,hScreenshot,steamID); + return result; +} +public override bool TagPublishedFile(uint hScreenshot,ulong unPublishedFileID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamScreenshots_TagPublishedFile(m_pSteamScreenshots,hScreenshot,unPublishedFileID); + return result; +} +} + + +public class CSteamMusic : ISteamMusic +{ +public CSteamMusic(IntPtr SteamMusic) +{ + m_pSteamMusic = SteamMusic; +} +IntPtr m_pSteamMusic; + +public override IntPtr GetIntPtr() { return m_pSteamMusic; } + +private void CheckIfUsable() +{ + if (m_pSteamMusic == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool BIsEnabled() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusic_BIsEnabled(m_pSteamMusic); + return result; +} +public override bool BIsPlaying() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusic_BIsPlaying(m_pSteamMusic); + return result; +} +public override int GetPlaybackStatus() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamMusic_GetPlaybackStatus(m_pSteamMusic); + return result; +} +public override void Play() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMusic_Play(m_pSteamMusic); +} +public override void Pause() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMusic_Pause(m_pSteamMusic); +} +public override void PlayPrevious() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMusic_PlayPrevious(m_pSteamMusic); +} +public override void PlayNext() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMusic_PlayNext(m_pSteamMusic); +} +public override void SetVolume(float flVolume) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamMusic_SetVolume(m_pSteamMusic,flVolume); +} +public override float GetVolume() +{ + CheckIfUsable(); + float result = NativeEntrypoints.SteamAPI_ISteamMusic_GetVolume(m_pSteamMusic); + return result; +} +} + + +public class CSteamMusicRemote : ISteamMusicRemote +{ +public CSteamMusicRemote(IntPtr SteamMusicRemote) +{ + m_pSteamMusicRemote = SteamMusicRemote; +} +IntPtr m_pSteamMusicRemote; + +public override IntPtr GetIntPtr() { return m_pSteamMusicRemote; } + +private void CheckIfUsable() +{ + if (m_pSteamMusicRemote == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool RegisterSteamMusicRemote(string pchName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(m_pSteamMusicRemote,pchName); + return result; +} +public override bool DeregisterSteamMusicRemote() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(m_pSteamMusicRemote); + return result; +} +public override bool BIsCurrentMusicRemote() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(m_pSteamMusicRemote); + return result; +} +public override bool BActivationSuccess(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_BActivationSuccess(m_pSteamMusicRemote,bValue); + return result; +} +public override bool SetDisplayName(string pchDisplayName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_SetDisplayName(m_pSteamMusicRemote,pchDisplayName); + return result; +} +public override bool SetPNGIcon_64x64(IntPtr pvBuffer,uint cbBufferLength) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(m_pSteamMusicRemote,pvBuffer,cbBufferLength); + return result; +} +public override bool EnablePlayPrevious(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_EnablePlayPrevious(m_pSteamMusicRemote,bValue); + return result; +} +public override bool EnablePlayNext(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_EnablePlayNext(m_pSteamMusicRemote,bValue); + return result; +} +public override bool EnableShuffled(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_EnableShuffled(m_pSteamMusicRemote,bValue); + return result; +} +public override bool EnableLooped(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_EnableLooped(m_pSteamMusicRemote,bValue); + return result; +} +public override bool EnableQueue(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_EnableQueue(m_pSteamMusicRemote,bValue); + return result; +} +public override bool EnablePlaylists(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_EnablePlaylists(m_pSteamMusicRemote,bValue); + return result; +} +public override bool UpdatePlaybackStatus(int nStatus) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(m_pSteamMusicRemote,nStatus); + return result; +} +public override bool UpdateShuffled(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdateShuffled(m_pSteamMusicRemote,bValue); + return result; +} +public override bool UpdateLooped(bool bValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdateLooped(m_pSteamMusicRemote,bValue); + return result; +} +public override bool UpdateVolume(float flValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdateVolume(m_pSteamMusicRemote,flValue); + return result; +} +public override bool CurrentEntryWillChange() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(m_pSteamMusicRemote); + return result; +} +public override bool CurrentEntryIsAvailable(bool bAvailable) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(m_pSteamMusicRemote,bAvailable); + return result; +} +public override bool UpdateCurrentEntryText(string pchText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(m_pSteamMusicRemote,pchText); + return result; +} +public override bool UpdateCurrentEntryElapsedSeconds(int nValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(m_pSteamMusicRemote,nValue); + return result; +} +public override bool UpdateCurrentEntryCoverArt(IntPtr pvBuffer,uint cbBufferLength) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(m_pSteamMusicRemote,pvBuffer,cbBufferLength); + return result; +} +public override bool CurrentEntryDidChange() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(m_pSteamMusicRemote); + return result; +} +public override bool QueueWillChange() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_QueueWillChange(m_pSteamMusicRemote); + return result; +} +public override bool ResetQueueEntries() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_ResetQueueEntries(m_pSteamMusicRemote); + return result; +} +public override bool SetQueueEntry(int nID,int nPosition,string pchEntryText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_SetQueueEntry(m_pSteamMusicRemote,nID,nPosition,pchEntryText); + return result; +} +public override bool SetCurrentQueueEntry(int nID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(m_pSteamMusicRemote,nID); + return result; +} +public override bool QueueDidChange() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_QueueDidChange(m_pSteamMusicRemote); + return result; +} +public override bool PlaylistWillChange() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_PlaylistWillChange(m_pSteamMusicRemote); + return result; +} +public override bool ResetPlaylistEntries() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(m_pSteamMusicRemote); + return result; +} +public override bool SetPlaylistEntry(int nID,int nPosition,string pchEntryText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_SetPlaylistEntry(m_pSteamMusicRemote,nID,nPosition,pchEntryText); + return result; +} +public override bool SetCurrentPlaylistEntry(int nID) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(m_pSteamMusicRemote,nID); + return result; +} +public override bool PlaylistDidChange() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamMusicRemote_PlaylistDidChange(m_pSteamMusicRemote); + return result; +} +} + + +public class CSteamHTTP : ISteamHTTP +{ +public CSteamHTTP(IntPtr SteamHTTP) +{ + m_pSteamHTTP = SteamHTTP; +} +IntPtr m_pSteamHTTP; + +public override IntPtr GetIntPtr() { return m_pSteamHTTP; } + +private void CheckIfUsable() +{ + if (m_pSteamHTTP == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint CreateHTTPRequest(uint eHTTPRequestMethod,string pchAbsoluteURL) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamHTTP_CreateHTTPRequest(m_pSteamHTTP,eHTTPRequestMethod,pchAbsoluteURL); + return result; +} +public override bool SetHTTPRequestContextValue(uint hRequest,ulong ulContextValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(m_pSteamHTTP,hRequest,ulContextValue); + return result; +} +public override bool SetHTTPRequestNetworkActivityTimeout(uint hRequest,uint unTimeoutSeconds) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(m_pSteamHTTP,hRequest,unTimeoutSeconds); + return result; +} +public override bool SetHTTPRequestHeaderValue(uint hRequest,string pchHeaderName,string pchHeaderValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(m_pSteamHTTP,hRequest,pchHeaderName,pchHeaderValue); + return result; +} +public override bool SetHTTPRequestGetOrPostParameter(uint hRequest,string pchParamName,string pchParamValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(m_pSteamHTTP,hRequest,pchParamName,pchParamValue); + return result; +} +public override bool SendHTTPRequest(uint hRequest,ref ulong pCallHandle) +{ + CheckIfUsable(); + pCallHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SendHTTPRequest(m_pSteamHTTP,hRequest,ref pCallHandle); + return result; +} +public override bool SendHTTPRequestAndStreamResponse(uint hRequest,ref ulong pCallHandle) +{ + CheckIfUsable(); + pCallHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(m_pSteamHTTP,hRequest,ref pCallHandle); + return result; +} +public override bool DeferHTTPRequest(uint hRequest) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_DeferHTTPRequest(m_pSteamHTTP,hRequest); + return result; +} +public override bool PrioritizeHTTPRequest(uint hRequest) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(m_pSteamHTTP,hRequest); + return result; +} +public override bool GetHTTPResponseHeaderSize(uint hRequest,string pchHeaderName,ref uint unResponseHeaderSize) +{ + CheckIfUsable(); + unResponseHeaderSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(m_pSteamHTTP,hRequest,pchHeaderName,ref unResponseHeaderSize); + return result; +} +public override bool GetHTTPResponseHeaderValue(uint hRequest,string pchHeaderName,IntPtr pHeaderValueBuffer,uint unBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(m_pSteamHTTP,hRequest,pchHeaderName,pHeaderValueBuffer,unBufferSize); + return result; +} +public override bool GetHTTPResponseBodySize(uint hRequest,ref uint unBodySize) +{ + CheckIfUsable(); + unBodySize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(m_pSteamHTTP,hRequest,ref unBodySize); + return result; +} +public override bool GetHTTPResponseBodyData(uint hRequest,IntPtr pBodyDataBuffer,uint unBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(m_pSteamHTTP,hRequest,pBodyDataBuffer,unBufferSize); + return result; +} +public override bool GetHTTPStreamingResponseBodyData(uint hRequest,uint cOffset,IntPtr pBodyDataBuffer,uint unBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(m_pSteamHTTP,hRequest,cOffset,pBodyDataBuffer,unBufferSize); + return result; +} +public override bool ReleaseHTTPRequest(uint hRequest) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_ReleaseHTTPRequest(m_pSteamHTTP,hRequest); + return result; +} +public override bool GetHTTPDownloadProgressPct(uint hRequest,ref float pflPercentOut) +{ + CheckIfUsable(); + pflPercentOut = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(m_pSteamHTTP,hRequest,ref pflPercentOut); + return result; +} +public override bool SetHTTPRequestRawPostBody(uint hRequest,string pchContentType,IntPtr pubBody,uint unBodyLen) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(m_pSteamHTTP,hRequest,pchContentType,pubBody,unBodyLen); + return result; +} +public override uint CreateCookieContainer(bool bAllowResponsesToModify) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamHTTP_CreateCookieContainer(m_pSteamHTTP,bAllowResponsesToModify); + return result; +} +public override bool ReleaseCookieContainer(uint hCookieContainer) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_ReleaseCookieContainer(m_pSteamHTTP,hCookieContainer); + return result; +} +public override bool SetCookie(uint hCookieContainer,string pchHost,string pchUrl,string pchCookie) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetCookie(m_pSteamHTTP,hCookieContainer,pchHost,pchUrl,pchCookie); + return result; +} +public override bool SetHTTPRequestCookieContainer(uint hRequest,uint hCookieContainer) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(m_pSteamHTTP,hRequest,hCookieContainer); + return result; +} +public override bool SetHTTPRequestUserAgentInfo(uint hRequest,string pchUserAgentInfo) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(m_pSteamHTTP,hRequest,pchUserAgentInfo); + return result; +} +public override bool SetHTTPRequestRequiresVerifiedCertificate(uint hRequest,bool bRequireVerifiedCertificate) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(m_pSteamHTTP,hRequest,bRequireVerifiedCertificate); + return result; +} +public override bool SetHTTPRequestAbsoluteTimeoutMS(uint hRequest,uint unMilliseconds) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(m_pSteamHTTP,hRequest,unMilliseconds); + return result; +} +public override bool GetHTTPRequestWasTimedOut(uint hRequest,ref bool pbWasTimedOut) +{ + CheckIfUsable(); + pbWasTimedOut = false; + bool result = NativeEntrypoints.SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(m_pSteamHTTP,hRequest,ref pbWasTimedOut); + return result; +} +} + + +public class CSteamUnifiedMessages : ISteamUnifiedMessages +{ +public CSteamUnifiedMessages(IntPtr SteamUnifiedMessages) +{ + m_pSteamUnifiedMessages = SteamUnifiedMessages; +} +IntPtr m_pSteamUnifiedMessages; + +public override IntPtr GetIntPtr() { return m_pSteamUnifiedMessages; } + +private void CheckIfUsable() +{ + if (m_pSteamUnifiedMessages == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override ulong SendMethod(string pchServiceMethod,IntPtr pRequestBuffer,uint unRequestBufferSize,ulong unContext) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUnifiedMessages_SendMethod(m_pSteamUnifiedMessages,pchServiceMethod,pRequestBuffer,unRequestBufferSize,unContext); + return result; +} +public override bool GetMethodResponseInfo(ulong hHandle,ref uint punResponseSize,ref uint peResult) +{ + CheckIfUsable(); + punResponseSize = 0; + peResult = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUnifiedMessages_GetMethodResponseInfo(m_pSteamUnifiedMessages,hHandle,ref punResponseSize,ref peResult); + return result; +} +public override bool GetMethodResponseData(ulong hHandle,IntPtr pResponseBuffer,uint unResponseBufferSize,bool bAutoRelease) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUnifiedMessages_GetMethodResponseData(m_pSteamUnifiedMessages,hHandle,pResponseBuffer,unResponseBufferSize,bAutoRelease); + return result; +} +public override bool ReleaseMethod(ulong hHandle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUnifiedMessages_ReleaseMethod(m_pSteamUnifiedMessages,hHandle); + return result; +} +public override bool SendNotification(string pchServiceNotification,IntPtr pNotificationBuffer,uint unNotificationBufferSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUnifiedMessages_SendNotification(m_pSteamUnifiedMessages,pchServiceNotification,pNotificationBuffer,unNotificationBufferSize); + return result; +} +} + + +public class CSteamController : ISteamController +{ +public CSteamController(IntPtr SteamController) +{ + m_pSteamController = SteamController; +} +IntPtr m_pSteamController; + +public override IntPtr GetIntPtr() { return m_pSteamController; } + +private void CheckIfUsable() +{ + if (m_pSteamController == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool Init() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamController_Init(m_pSteamController); + return result; +} +public override bool Shutdown() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamController_Shutdown(m_pSteamController); + return result; +} +public override void RunFrame() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamController_RunFrame(m_pSteamController); +} +public override int GetConnectedControllers(ref ulong handlesOut) +{ + CheckIfUsable(); + handlesOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamController_GetConnectedControllers(m_pSteamController,ref handlesOut); + return result; +} +public override bool ShowBindingPanel(ulong controllerHandle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowBindingPanel(m_pSteamController,controllerHandle); + return result; +} +public override ulong GetActionSetHandle(string pszActionSetName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetActionSetHandle(m_pSteamController,pszActionSetName); + return result; +} +public override void ActivateActionSet(ulong controllerHandle,ulong actionSetHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamController_ActivateActionSet(m_pSteamController,controllerHandle,actionSetHandle); +} +public override ulong GetCurrentActionSet(ulong controllerHandle) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetCurrentActionSet(m_pSteamController,controllerHandle); + return result; +} +public override ulong GetDigitalActionHandle(string pszActionName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionHandle(m_pSteamController,pszActionName); + return result; +} +public override ControllerDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle) +{ + CheckIfUsable(); + ControllerDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionData(m_pSteamController,controllerHandle,digitalActionHandle); + return result; +} +public override int GetDigitalActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut) +{ + CheckIfUsable(); + originsOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionOrigins(m_pSteamController,controllerHandle,actionSetHandle,digitalActionHandle,ref originsOut); + return result; +} +public override ulong GetAnalogActionHandle(string pszActionName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionHandle(m_pSteamController,pszActionName); + return result; +} +public override ControllerAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle) +{ + CheckIfUsable(); + ControllerAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionData(m_pSteamController,controllerHandle,analogActionHandle); + return result; +} +public override int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut) +{ + CheckIfUsable(); + originsOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionOrigins(m_pSteamController,controllerHandle,actionSetHandle,analogActionHandle,ref originsOut); + return result; +} +public override void StopAnalogActionMomentum(ulong controllerHandle,ulong eAction) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamController_StopAnalogActionMomentum(m_pSteamController,controllerHandle,eAction); +} +public override void TriggerHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamController_TriggerHapticPulse(m_pSteamController,controllerHandle,eTargetPad,usDurationMicroSec); +} +} + + +public class CSteamUGC : ISteamUGC +{ +public CSteamUGC(IntPtr SteamUGC) +{ + m_pSteamUGC = SteamUGC; +} +IntPtr m_pSteamUGC; + +public override IntPtr GetIntPtr() { return m_pSteamUGC; } + +private void CheckIfUsable() +{ + if (m_pSteamUGC == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override ulong CreateQueryUserUGCRequest(uint unAccountID,uint eListType,uint eMatchingUGCType,uint eSortOrder,uint nCreatorAppID,uint nConsumerAppID,uint unPage) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(m_pSteamUGC,unAccountID,eListType,eMatchingUGCType,eSortOrder,nCreatorAppID,nConsumerAppID,unPage); + return result; +} +public override ulong CreateQueryAllUGCRequest(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,uint unPage) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(m_pSteamUGC,eQueryType,eMatchingeMatchingUGCTypeFileType,nCreatorAppID,nConsumerAppID,unPage); + return result; +} +public override ulong CreateQueryUGCDetailsRequest(ref ulong pvecPublishedFileID,uint unNumPublishedFileIDs) +{ + CheckIfUsable(); + pvecPublishedFileID = 0; + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(m_pSteamUGC,ref pvecPublishedFileID,unNumPublishedFileIDs); + return result; +} +public override ulong SendQueryUGCRequest(ulong handle) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_SendQueryUGCRequest(m_pSteamUGC,handle); + return result; +} +public override bool GetQueryUGCResult(ulong handle,uint index,ref SteamUGCDetails_t pDetails) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCResult(m_pSteamUGC,handle,index,ref pDetails); + return result; +} +public override bool GetQueryUGCPreviewURL(ulong handle,uint index,string pchURL,uint cchURLSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(m_pSteamUGC,handle,index,pchURL,cchURLSize); + return result; +} +public override bool GetQueryUGCMetadata(ulong handle,uint index,string pchMetadata,uint cchMetadatasize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCMetadata(m_pSteamUGC,handle,index,pchMetadata,cchMetadatasize); + return result; +} +public override bool GetQueryUGCChildren(ulong handle,uint index,ref ulong pvecPublishedFileID,uint cMaxEntries) +{ + CheckIfUsable(); + pvecPublishedFileID = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCChildren(m_pSteamUGC,handle,index,ref pvecPublishedFileID,cMaxEntries); + return result; +} +public override bool GetQueryUGCStatistic(ulong handle,uint index,uint eStatType,ref uint pStatValue) +{ + CheckIfUsable(); + pStatValue = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCStatistic(m_pSteamUGC,handle,index,eStatType,ref pStatValue); + return result; +} +public override uint GetQueryUGCNumAdditionalPreviews(ulong handle,uint index) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(m_pSteamUGC,handle,index); + return result; +} +public override bool GetQueryUGCAdditionalPreview(ulong handle,uint index,uint previewIndex,string pchURLOrVideoID,uint cchURLSize,ref bool pbIsImage) +{ + CheckIfUsable(); + pbIsImage = false; + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(m_pSteamUGC,handle,index,previewIndex,pchURLOrVideoID,cchURLSize,ref pbIsImage); + return result; +} +public override uint GetQueryUGCNumKeyValueTags(ulong handle,uint index) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(m_pSteamUGC,handle,index); + return result; +} +public override bool GetQueryUGCKeyValueTag(ulong handle,uint index,uint keyValueTagIndex,string pchKey,uint cchKeySize,string pchValue,uint cchValueSize) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(m_pSteamUGC,handle,index,keyValueTagIndex,pchKey,cchKeySize,pchValue,cchValueSize); + return result; +} +public override bool ReleaseQueryUGCRequest(ulong handle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(m_pSteamUGC,handle); + return result; +} +public override bool AddRequiredTag(ulong handle,string pTagName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_AddRequiredTag(m_pSteamUGC,handle,pTagName); + return result; +} +public override bool AddExcludedTag(ulong handle,string pTagName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_AddExcludedTag(m_pSteamUGC,handle,pTagName); + return result; +} +public override bool SetReturnKeyValueTags(ulong handle,bool bReturnKeyValueTags) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetReturnKeyValueTags(m_pSteamUGC,handle,bReturnKeyValueTags); + return result; +} +public override bool SetReturnLongDescription(ulong handle,bool bReturnLongDescription) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetReturnLongDescription(m_pSteamUGC,handle,bReturnLongDescription); + return result; +} +public override bool SetReturnMetadata(ulong handle,bool bReturnMetadata) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetReturnMetadata(m_pSteamUGC,handle,bReturnMetadata); + return result; +} +public override bool SetReturnChildren(ulong handle,bool bReturnChildren) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetReturnChildren(m_pSteamUGC,handle,bReturnChildren); + return result; +} +public override bool SetReturnAdditionalPreviews(ulong handle,bool bReturnAdditionalPreviews) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(m_pSteamUGC,handle,bReturnAdditionalPreviews); + return result; +} +public override bool SetReturnTotalOnly(ulong handle,bool bReturnTotalOnly) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetReturnTotalOnly(m_pSteamUGC,handle,bReturnTotalOnly); + return result; +} +public override bool SetLanguage(ulong handle,string pchLanguage) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetLanguage(m_pSteamUGC,handle,pchLanguage); + return result; +} +public override bool SetAllowCachedResponse(ulong handle,uint unMaxAgeSeconds) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetAllowCachedResponse(m_pSteamUGC,handle,unMaxAgeSeconds); + return result; +} +public override bool SetCloudFileNameFilter(ulong handle,string pMatchCloudFileName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetCloudFileNameFilter(m_pSteamUGC,handle,pMatchCloudFileName); + return result; +} +public override bool SetMatchAnyTag(ulong handle,bool bMatchAnyTag) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetMatchAnyTag(m_pSteamUGC,handle,bMatchAnyTag); + return result; +} +public override bool SetSearchText(ulong handle,string pSearchText) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetSearchText(m_pSteamUGC,handle,pSearchText); + return result; +} +public override bool SetRankedByTrendDays(ulong handle,uint unDays) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetRankedByTrendDays(m_pSteamUGC,handle,unDays); + return result; +} +public override bool AddRequiredKeyValueTag(ulong handle,string pKey,string pValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_AddRequiredKeyValueTag(m_pSteamUGC,handle,pKey,pValue); + return result; +} +public override ulong RequestUGCDetails(ulong nPublishedFileID,uint unMaxAgeSeconds) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_RequestUGCDetails(m_pSteamUGC,nPublishedFileID,unMaxAgeSeconds); + return result; +} +public override ulong CreateItem(uint nConsumerAppId,uint eFileType) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateItem(m_pSteamUGC,nConsumerAppId,eFileType); + return result; +} +public override ulong StartItemUpdate(uint nConsumerAppId,ulong nPublishedFileID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_StartItemUpdate(m_pSteamUGC,nConsumerAppId,nPublishedFileID); + return result; +} +public override bool SetItemTitle(ulong handle,string pchTitle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemTitle(m_pSteamUGC,handle,pchTitle); + return result; +} +public override bool SetItemDescription(ulong handle,string pchDescription) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemDescription(m_pSteamUGC,handle,pchDescription); + return result; +} +public override bool SetItemUpdateLanguage(ulong handle,string pchLanguage) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemUpdateLanguage(m_pSteamUGC,handle,pchLanguage); + return result; +} +public override bool SetItemMetadata(ulong handle,string pchMetaData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemMetadata(m_pSteamUGC,handle,pchMetaData); + return result; +} +public override bool SetItemVisibility(ulong handle,uint eVisibility) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemVisibility(m_pSteamUGC,handle,eVisibility); + return result; +} +public override bool SetItemTags(ulong updateHandle,ref SteamParamStringArray_t pTags) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemTags(m_pSteamUGC,updateHandle,ref pTags); + return result; +} +public override bool SetItemContent(ulong handle,string pszContentFolder) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemContent(m_pSteamUGC,handle,pszContentFolder); + return result; +} +public override bool SetItemPreview(ulong handle,string pszPreviewFile) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemPreview(m_pSteamUGC,handle,pszPreviewFile); + return result; +} +public override bool RemoveItemKeyValueTags(ulong handle,string pchKey) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_RemoveItemKeyValueTags(m_pSteamUGC,handle,pchKey); + return result; +} +public override bool AddItemKeyValueTag(ulong handle,string pchKey,string pchValue) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_AddItemKeyValueTag(m_pSteamUGC,handle,pchKey,pchValue); + return result; +} +public override ulong SubmitItemUpdate(ulong handle,string pchChangeNote) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_SubmitItemUpdate(m_pSteamUGC,handle,pchChangeNote); + return result; +} +public override uint GetItemUpdateProgress(ulong handle,ref ulong punBytesProcessed,ref ulong punBytesTotal) +{ + CheckIfUsable(); + punBytesProcessed = 0; + punBytesTotal = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamUGC_GetItemUpdateProgress(m_pSteamUGC,handle,ref punBytesProcessed,ref punBytesTotal); + return result; +} +public override ulong SetUserItemVote(ulong nPublishedFileID,bool bVoteUp) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_SetUserItemVote(m_pSteamUGC,nPublishedFileID,bVoteUp); + return result; +} +public override ulong GetUserItemVote(ulong nPublishedFileID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_GetUserItemVote(m_pSteamUGC,nPublishedFileID); + return result; +} +public override ulong AddItemToFavorites(uint nAppId,ulong nPublishedFileID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_AddItemToFavorites(m_pSteamUGC,nAppId,nPublishedFileID); + return result; +} +public override ulong RemoveItemFromFavorites(uint nAppId,ulong nPublishedFileID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_RemoveItemFromFavorites(m_pSteamUGC,nAppId,nPublishedFileID); + return result; +} +public override ulong SubscribeItem(ulong nPublishedFileID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_SubscribeItem(m_pSteamUGC,nPublishedFileID); + return result; +} +public override ulong UnsubscribeItem(ulong nPublishedFileID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_UnsubscribeItem(m_pSteamUGC,nPublishedFileID); + return result; +} +public override uint GetNumSubscribedItems() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUGC_GetNumSubscribedItems(m_pSteamUGC); + return result; +} +public override uint GetSubscribedItems(ref ulong pvecPublishedFileID,uint cMaxEntries) +{ + CheckIfUsable(); + pvecPublishedFileID = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamUGC_GetSubscribedItems(m_pSteamUGC,ref pvecPublishedFileID,cMaxEntries); + return result; +} +public override uint GetItemState(ulong nPublishedFileID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamUGC_GetItemState(m_pSteamUGC,nPublishedFileID); + return result; +} +public override bool GetItemInstallInfo(ulong nPublishedFileID,ref ulong punSizeOnDisk,string pchFolder,uint cchFolderSize,ref uint punTimeStamp) +{ + CheckIfUsable(); + punSizeOnDisk = 0; + punTimeStamp = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetItemInstallInfo(m_pSteamUGC,nPublishedFileID,ref punSizeOnDisk,pchFolder,cchFolderSize,ref punTimeStamp); + return result; +} +public override bool GetItemDownloadInfo(ulong nPublishedFileID,ref ulong punBytesDownloaded,ref ulong punBytesTotal) +{ + CheckIfUsable(); + punBytesDownloaded = 0; + punBytesTotal = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetItemDownloadInfo(m_pSteamUGC,nPublishedFileID,ref punBytesDownloaded,ref punBytesTotal); + return result; +} +public override bool DownloadItem(ulong nPublishedFileID,bool bHighPriority) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_DownloadItem(m_pSteamUGC,nPublishedFileID,bHighPriority); + return result; +} +public override bool BInitWorkshopForGameServer(uint unWorkshopDepotID,string pszFolder) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_BInitWorkshopForGameServer(m_pSteamUGC,unWorkshopDepotID,pszFolder); + return result; +} +public override void SuspendDownloads(bool bSuspend) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamUGC_SuspendDownloads(m_pSteamUGC,bSuspend); +} +} + + +public class CSteamAppList : ISteamAppList +{ +public CSteamAppList(IntPtr SteamAppList) +{ + m_pSteamAppList = SteamAppList; +} +IntPtr m_pSteamAppList; + +public override IntPtr GetIntPtr() { return m_pSteamAppList; } + +private void CheckIfUsable() +{ + if (m_pSteamAppList == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint GetNumInstalledApps() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamAppList_GetNumInstalledApps(m_pSteamAppList); + return result; +} +public override uint GetInstalledApps(ref uint pvecAppID,uint unMaxAppIDs) +{ + CheckIfUsable(); + pvecAppID = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamAppList_GetInstalledApps(m_pSteamAppList,ref pvecAppID,unMaxAppIDs); + return result; +} +public override int GetAppName(uint nAppID,string pchName,int cchNameMax) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamAppList_GetAppName(m_pSteamAppList,nAppID,pchName,cchNameMax); + return result; +} +public override int GetAppInstallDir(uint nAppID,string pchDirectory,int cchNameMax) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamAppList_GetAppInstallDir(m_pSteamAppList,nAppID,pchDirectory,cchNameMax); + return result; +} +public override int GetAppBuildId(uint nAppID) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamAppList_GetAppBuildId(m_pSteamAppList,nAppID); + return result; +} +} + + +public class CSteamHTMLSurface : ISteamHTMLSurface +{ +public CSteamHTMLSurface(IntPtr SteamHTMLSurface) +{ + m_pSteamHTMLSurface = SteamHTMLSurface; +} +IntPtr m_pSteamHTMLSurface; + +public override IntPtr GetIntPtr() { return m_pSteamHTMLSurface; } + +private void CheckIfUsable() +{ + if (m_pSteamHTMLSurface == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void DestructISteamHTMLSurface() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(m_pSteamHTMLSurface); +} +public override bool Init() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTMLSurface_Init(m_pSteamHTMLSurface); + return result; +} +public override bool Shutdown() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamHTMLSurface_Shutdown(m_pSteamHTMLSurface); + return result; +} +public override ulong CreateBrowser(string pchUserAgent,string pchUserCSS) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamHTMLSurface_CreateBrowser(m_pSteamHTMLSurface,pchUserAgent,pchUserCSS); + return result; +} +public override void RemoveBrowser(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_RemoveBrowser(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void LoadURL(uint unBrowserHandle,string pchURL,string pchPostData) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_LoadURL(m_pSteamHTMLSurface,unBrowserHandle,pchURL,pchPostData); +} +public override void SetSize(uint unBrowserHandle,uint unWidth,uint unHeight) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetSize(m_pSteamHTMLSurface,unBrowserHandle,unWidth,unHeight); +} +public override void StopLoad(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_StopLoad(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void Reload(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_Reload(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void GoBack(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_GoBack(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void GoForward(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_GoForward(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void AddHeader(uint unBrowserHandle,string pchKey,string pchValue) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_AddHeader(m_pSteamHTMLSurface,unBrowserHandle,pchKey,pchValue); +} +public override void ExecuteJavascript(uint unBrowserHandle,string pchScript) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_ExecuteJavascript(m_pSteamHTMLSurface,unBrowserHandle,pchScript); +} +public override void MouseUp(uint unBrowserHandle,uint eMouseButton) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseUp(m_pSteamHTMLSurface,unBrowserHandle,eMouseButton); +} +public override void MouseDown(uint unBrowserHandle,uint eMouseButton) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseDown(m_pSteamHTMLSurface,unBrowserHandle,eMouseButton); +} +public override void MouseDoubleClick(uint unBrowserHandle,uint eMouseButton) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseDoubleClick(m_pSteamHTMLSurface,unBrowserHandle,eMouseButton); +} +public override void MouseMove(uint unBrowserHandle,int x,int y) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseMove(m_pSteamHTMLSurface,unBrowserHandle,x,y); +} +public override void MouseWheel(uint unBrowserHandle,int nDelta) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseWheel(m_pSteamHTMLSurface,unBrowserHandle,nDelta); +} +public override void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyDown(m_pSteamHTMLSurface,unBrowserHandle,nNativeKeyCode,eHTMLKeyModifiers); +} +public override void KeyUp(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyUp(m_pSteamHTMLSurface,unBrowserHandle,nNativeKeyCode,eHTMLKeyModifiers); +} +public override void KeyChar(uint unBrowserHandle,uint cUnicodeChar,uint eHTMLKeyModifiers) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyChar(m_pSteamHTMLSurface,unBrowserHandle,cUnicodeChar,eHTMLKeyModifiers); +} +public override void SetHorizontalScroll(uint unBrowserHandle,uint nAbsolutePixelScroll) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(m_pSteamHTMLSurface,unBrowserHandle,nAbsolutePixelScroll); +} +public override void SetVerticalScroll(uint unBrowserHandle,uint nAbsolutePixelScroll) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetVerticalScroll(m_pSteamHTMLSurface,unBrowserHandle,nAbsolutePixelScroll); +} +public override void SetKeyFocus(uint unBrowserHandle,bool bHasKeyFocus) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetKeyFocus(m_pSteamHTMLSurface,unBrowserHandle,bHasKeyFocus); +} +public override void ViewSource(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_ViewSource(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void CopyToClipboard(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_CopyToClipboard(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void PasteFromClipboard(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_PasteFromClipboard(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void Find(uint unBrowserHandle,string pchSearchStr,bool bCurrentlyInFind,bool bReverse) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_Find(m_pSteamHTMLSurface,unBrowserHandle,pchSearchStr,bCurrentlyInFind,bReverse); +} +public override void StopFind(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_StopFind(m_pSteamHTMLSurface,unBrowserHandle); +} +public override void GetLinkAtPosition(uint unBrowserHandle,int x,int y) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(m_pSteamHTMLSurface,unBrowserHandle,x,y); +} +public override void SetCookie(string pchHostname,string pchKey,string pchValue,string pchPath,ulong nExpires,bool bSecure,bool bHTTPOnly) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetCookie(m_pSteamHTMLSurface,pchHostname,pchKey,pchValue,pchPath,nExpires,bSecure,bHTTPOnly); +} +public override void SetPageScaleFactor(uint unBrowserHandle,float flZoom,int nPointX,int nPointY) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(m_pSteamHTMLSurface,unBrowserHandle,flZoom,nPointX,nPointY); +} +public override void SetBackgroundMode(uint unBrowserHandle,bool bBackgroundMode) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetBackgroundMode(m_pSteamHTMLSurface,unBrowserHandle,bBackgroundMode); +} +public override void AllowStartRequest(uint unBrowserHandle,bool bAllowed) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_AllowStartRequest(m_pSteamHTMLSurface,unBrowserHandle,bAllowed); +} +public override void JSDialogResponse(uint unBrowserHandle,bool bResult) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_JSDialogResponse(m_pSteamHTMLSurface,unBrowserHandle,bResult); +} +public override void FileLoadDialogResponse(uint unBrowserHandle,string pchSelectedFiles) +{ + CheckIfUsable(); + pchSelectedFiles = ""; + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse(m_pSteamHTMLSurface,unBrowserHandle,pchSelectedFiles); +} +} + + +public class CSteamInventory : ISteamInventory +{ +public CSteamInventory(IntPtr SteamInventory) +{ + m_pSteamInventory = SteamInventory; +} +IntPtr m_pSteamInventory; + +public override IntPtr GetIntPtr() { return m_pSteamInventory; } + +private void CheckIfUsable() +{ + if (m_pSteamInventory == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint GetResultStatus(int resultHandle) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInventory_GetResultStatus(m_pSteamInventory,resultHandle); + return result; +} +public override bool GetResultItems(int resultHandle,out SteamItemDetails_t [] pOutItemsArray) +{ + CheckIfUsable(); + uint punOutItemsArraySize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetResultItems(m_pSteamInventory,resultHandle,null,ref punOutItemsArraySize); + pOutItemsArray= new SteamItemDetails_t[punOutItemsArraySize]; + result = NativeEntrypoints.SteamAPI_ISteamInventory_GetResultItems(m_pSteamInventory,resultHandle,pOutItemsArray,ref punOutItemsArraySize); + return result; +} +public override uint GetResultTimestamp(int resultHandle) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInventory_GetResultTimestamp(m_pSteamInventory,resultHandle); + return result; +} +public override bool CheckResultSteamID(int resultHandle,ulong steamIDExpected) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_CheckResultSteamID(m_pSteamInventory,resultHandle,steamIDExpected); + return result; +} +public override void DestroyResult(int resultHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInventory_DestroyResult(m_pSteamInventory,resultHandle); +} +public override bool GetAllItems(ref int pResultHandle) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetAllItems(m_pSteamInventory,ref pResultHandle); + return result; +} +public override bool GetItemsByID(ref int pResultHandle,ulong [] pInstanceIDs) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsByID(m_pSteamInventory,ref pResultHandle,pInstanceIDs,(uint) pInstanceIDs.Length); + return result; +} +public override bool SerializeResult(int resultHandle,IntPtr pOutBuffer,ref uint punOutBufferSize) +{ + CheckIfUsable(); + punOutBufferSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_SerializeResult(m_pSteamInventory,resultHandle,pOutBuffer,ref punOutBufferSize); + return result; +} +public override bool DeserializeResult(ref int pOutResultHandle,IntPtr pBuffer,uint unBufferSize,bool bRESERVED_MUST_BE_FALSE) +{ + CheckIfUsable(); + pOutResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_DeserializeResult(m_pSteamInventory,ref pOutResultHandle,pBuffer,unBufferSize,bRESERVED_MUST_BE_FALSE); + return result; +} +public override bool GenerateItems(ref int pResultHandle,int [] pArrayItemDefs,uint [] punArrayQuantity) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GenerateItems(m_pSteamInventory,ref pResultHandle,pArrayItemDefs,punArrayQuantity,(uint) punArrayQuantity.Length); + return result; +} +public override bool GrantPromoItems(ref int pResultHandle) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GrantPromoItems(m_pSteamInventory,ref pResultHandle); + return result; +} +public override bool AddPromoItem(ref int pResultHandle,int itemDef) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_AddPromoItem(m_pSteamInventory,ref pResultHandle,itemDef); + return result; +} +public override bool AddPromoItems(ref int pResultHandle,int [] pArrayItemDefs) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_AddPromoItems(m_pSteamInventory,ref pResultHandle,pArrayItemDefs,(uint) pArrayItemDefs.Length); + return result; +} +public override bool ConsumeItem(ref int pResultHandle,ulong itemConsume,uint unQuantity) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_ConsumeItem(m_pSteamInventory,ref pResultHandle,itemConsume,unQuantity); + return result; +} +public override bool ExchangeItems(ref int pResultHandle,int [] pArrayGenerate,uint [] punArrayGenerateQuantity,ulong [] pArrayDestroy,uint [] punArrayDestroyQuantity) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_ExchangeItems(m_pSteamInventory,ref pResultHandle,pArrayGenerate,punArrayGenerateQuantity,(uint) punArrayGenerateQuantity.Length,pArrayDestroy,punArrayDestroyQuantity,(uint) punArrayDestroyQuantity.Length); + return result; +} +public override bool TransferItemQuantity(ref int pResultHandle,ulong itemIdSource,uint unQuantity,ulong itemIdDest) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_TransferItemQuantity(m_pSteamInventory,ref pResultHandle,itemIdSource,unQuantity,itemIdDest); + return result; +} +public override void SendItemDropHeartbeat() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInventory_SendItemDropHeartbeat(m_pSteamInventory); +} +public override bool TriggerItemDrop(ref int pResultHandle,int dropListDefinition) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_TriggerItemDrop(m_pSteamInventory,ref pResultHandle,dropListDefinition); + return result; +} +public override bool TradeItems(ref int pResultHandle,ulong steamIDTradePartner,ulong [] pArrayGive,uint [] pArrayGiveQuantity,ulong [] pArrayGet,uint [] pArrayGetQuantity) +{ + CheckIfUsable(); + pResultHandle = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_TradeItems(m_pSteamInventory,ref pResultHandle,steamIDTradePartner,pArrayGive,pArrayGiveQuantity,(uint) pArrayGiveQuantity.Length,pArrayGet,pArrayGetQuantity,(uint) pArrayGetQuantity.Length); + return result; +} +public override bool LoadItemDefinitions() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_LoadItemDefinitions(m_pSteamInventory); + return result; +} +public override bool GetItemDefinitionIDs(out int [] pItemDefIDs) +{ + CheckIfUsable(); + uint punItemDefIDsArraySize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemDefinitionIDs(m_pSteamInventory,null,ref punItemDefIDsArraySize); + pItemDefIDs= new int[punItemDefIDsArraySize]; + result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemDefinitionIDs(m_pSteamInventory,pItemDefIDs,ref punItemDefIDsArraySize); + return result; +} +public override bool GetItemDefinitionProperty(int iDefinition,string pchPropertyName,out string pchValueBuffer) +{ + CheckIfUsable(); + uint punValueBufferSize = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemDefinitionProperty(m_pSteamInventory,iDefinition,pchPropertyName,null,ref punValueBufferSize); + System.Text.StringBuilder pStrBuffer = new System.Text.StringBuilder((int)punValueBufferSize); + result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemDefinitionProperty(m_pSteamInventory,iDefinition,pchPropertyName,pStrBuffer,ref punValueBufferSize); + pchValueBuffer = pStrBuffer.ToString(); + return result; +} +} + + +public class CSteamVideo : ISteamVideo +{ +public CSteamVideo(IntPtr SteamVideo) +{ + m_pSteamVideo = SteamVideo; +} +IntPtr m_pSteamVideo; + +public override IntPtr GetIntPtr() { return m_pSteamVideo; } + +private void CheckIfUsable() +{ + if (m_pSteamVideo == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void GetVideoURL(uint unVideoAppID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamVideo_GetVideoURL(m_pSteamVideo,unVideoAppID); +} +public override bool IsBroadcasting(ref int pnNumViewers) +{ + CheckIfUsable(); + pnNumViewers = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamVideo_IsBroadcasting(m_pSteamVideo,ref pnNumViewers); + return result; +} +} + + +public class CSteamGameServer : ISteamGameServer +{ +public CSteamGameServer(IntPtr SteamGameServer) +{ + m_pSteamGameServer = SteamGameServer; +} +IntPtr m_pSteamGameServer; + +public override IntPtr GetIntPtr() { return m_pSteamGameServer; } + +private void CheckIfUsable() +{ + if (m_pSteamGameServer == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool InitGameServer(uint unIP,char usGamePort,char usQueryPort,uint unFlags,uint nGameAppId,string pchVersionString) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_InitGameServer(m_pSteamGameServer,unIP,usGamePort,usQueryPort,unFlags,nGameAppId,pchVersionString); + return result; +} +public override void SetProduct(string pszProduct) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetProduct(m_pSteamGameServer,pszProduct); +} +public override void SetGameDescription(string pszGameDescription) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetGameDescription(m_pSteamGameServer,pszGameDescription); +} +public override void SetModDir(string pszModDir) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetModDir(m_pSteamGameServer,pszModDir); +} +public override void SetDedicatedServer(bool bDedicated) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetDedicatedServer(m_pSteamGameServer,bDedicated); +} +public override void LogOn(string pszToken) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_LogOn(m_pSteamGameServer,pszToken); +} +public override void LogOnAnonymous() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_LogOnAnonymous(m_pSteamGameServer); +} +public override void LogOff() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_LogOff(m_pSteamGameServer); +} +public override bool BLoggedOn() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_BLoggedOn(m_pSteamGameServer); + return result; +} +public override bool BSecure() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_BSecure(m_pSteamGameServer); + return result; +} +public override ulong GetSteamID() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServer_GetSteamID(m_pSteamGameServer); + return result; +} +public override bool WasRestartRequested() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_WasRestartRequested(m_pSteamGameServer); + return result; +} +public override void SetMaxPlayerCount(int cPlayersMax) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetMaxPlayerCount(m_pSteamGameServer,cPlayersMax); +} +public override void SetBotPlayerCount(int cBotplayers) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetBotPlayerCount(m_pSteamGameServer,cBotplayers); +} +public override void SetServerName(string pszServerName) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetServerName(m_pSteamGameServer,pszServerName); +} +public override void SetMapName(string pszMapName) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetMapName(m_pSteamGameServer,pszMapName); +} +public override void SetPasswordProtected(bool bPasswordProtected) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetPasswordProtected(m_pSteamGameServer,bPasswordProtected); +} +public override void SetSpectatorPort(char unSpectatorPort) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetSpectatorPort(m_pSteamGameServer,unSpectatorPort); +} +public override void SetSpectatorServerName(string pszSpectatorServerName) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetSpectatorServerName(m_pSteamGameServer,pszSpectatorServerName); +} +public override void ClearAllKeyValues() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_ClearAllKeyValues(m_pSteamGameServer); +} +public override void SetKeyValue(string pKey,string pValue) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetKeyValue(m_pSteamGameServer,pKey,pValue); +} +public override void SetGameTags(string pchGameTags) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetGameTags(m_pSteamGameServer,pchGameTags); +} +public override void SetGameData(string pchGameData) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetGameData(m_pSteamGameServer,pchGameData); +} +public override void SetRegion(string pszRegion) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetRegion(m_pSteamGameServer,pszRegion); +} +public override bool SendUserConnectAndAuthenticate(uint unIPClient,IntPtr pvAuthBlob,uint cubAuthBlobSize,ref CSteamID pSteamIDUser) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(m_pSteamGameServer,unIPClient,pvAuthBlob,cubAuthBlobSize,ref pSteamIDUser); + return result; +} +public override ulong CreateUnauthenticatedUserConnection() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(m_pSteamGameServer); + return result; +} +public override void SendUserDisconnect(ulong steamIDUser) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SendUserDisconnect(m_pSteamGameServer,steamIDUser); +} +public override bool BUpdateUserData(ulong steamIDUser,string pchPlayerName,uint uScore) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_BUpdateUserData(m_pSteamGameServer,steamIDUser,pchPlayerName,uScore); + return result; +} +public override uint GetAuthSessionTicket(IntPtr pTicket,int cbMaxTicket,ref uint pcbTicket) +{ + CheckIfUsable(); + pcbTicket = 0; + uint result = NativeEntrypoints.SteamAPI_ISteamGameServer_GetAuthSessionTicket(m_pSteamGameServer,pTicket,cbMaxTicket,ref pcbTicket); + return result; +} +public override uint BeginAuthSession(IntPtr pAuthTicket,int cbAuthTicket,ulong steamID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameServer_BeginAuthSession(m_pSteamGameServer,pAuthTicket,cbAuthTicket,steamID); + return result; +} +public override void EndAuthSession(ulong steamID) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_EndAuthSession(m_pSteamGameServer,steamID); +} +public override void CancelAuthTicket(uint hAuthTicket) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_CancelAuthTicket(m_pSteamGameServer,hAuthTicket); +} +public override uint UserHasLicenseForApp(ulong steamID,uint appID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameServer_UserHasLicenseForApp(m_pSteamGameServer,steamID,appID); + return result; +} +public override bool RequestUserGroupStatus(ulong steamIDUser,ulong steamIDGroup) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_RequestUserGroupStatus(m_pSteamGameServer,steamIDUser,steamIDGroup); + return result; +} +public override void GetGameplayStats() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_GetGameplayStats(m_pSteamGameServer); +} +public override ulong GetServerReputation() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServer_GetServerReputation(m_pSteamGameServer); + return result; +} +public override uint GetPublicIP() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameServer_GetPublicIP(m_pSteamGameServer); + return result; +} +public override bool HandleIncomingPacket(IntPtr pData,int cbData,uint srcIP,char srcPort) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServer_HandleIncomingPacket(m_pSteamGameServer,pData,cbData,srcIP,srcPort); + return result; +} +public override int GetNextOutgoingPacket(IntPtr pOut,int cbMaxOut,ref uint pNetAdr,ref char pPort) +{ + CheckIfUsable(); + pNetAdr = 0; + pPort = (char) 0; + int result = NativeEntrypoints.SteamAPI_ISteamGameServer_GetNextOutgoingPacket(m_pSteamGameServer,pOut,cbMaxOut,ref pNetAdr,ref pPort); + return result; +} +public override void EnableHeartbeats(bool bActive) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_EnableHeartbeats(m_pSteamGameServer,bActive); +} +public override void SetHeartbeatInterval(int iHeartbeatInterval) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_SetHeartbeatInterval(m_pSteamGameServer,iHeartbeatInterval); +} +public override void ForceHeartbeat() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamGameServer_ForceHeartbeat(m_pSteamGameServer); +} +public override ulong AssociateWithClan(ulong steamIDClan) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServer_AssociateWithClan(m_pSteamGameServer,steamIDClan); + return result; +} +public override ulong ComputeNewPlayerCompatibility(ulong steamIDNewPlayer) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(m_pSteamGameServer,steamIDNewPlayer); + return result; +} +} + + +public class CSteamGameServerStats : ISteamGameServerStats +{ +public CSteamGameServerStats(IntPtr SteamGameServerStats) +{ + m_pSteamGameServerStats = SteamGameServerStats; +} +IntPtr m_pSteamGameServerStats; + +public override IntPtr GetIntPtr() { return m_pSteamGameServerStats; } + +private void CheckIfUsable() +{ + if (m_pSteamGameServerStats == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override ulong RequestUserStats(ulong steamIDUser) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_RequestUserStats(m_pSteamGameServerStats,steamIDUser); + return result; +} +public override bool GetUserStat(ulong steamIDUser,string pchName,ref int pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_GetUserStat(m_pSteamGameServerStats,steamIDUser,pchName,ref pData); + return result; +} +public override bool GetUserStat0(ulong steamIDUser,string pchName,ref float pData) +{ + CheckIfUsable(); + pData = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_GetUserStat0(m_pSteamGameServerStats,steamIDUser,pchName,ref pData); + return result; +} +public override bool GetUserAchievement(ulong steamIDUser,string pchName,ref bool pbAchieved) +{ + CheckIfUsable(); + pbAchieved = false; + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_GetUserAchievement(m_pSteamGameServerStats,steamIDUser,pchName,ref pbAchieved); + return result; +} +public override bool SetUserStat(ulong steamIDUser,string pchName,int nData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_SetUserStat(m_pSteamGameServerStats,steamIDUser,pchName,nData); + return result; +} +public override bool SetUserStat0(ulong steamIDUser,string pchName,float fData) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_SetUserStat0(m_pSteamGameServerStats,steamIDUser,pchName,fData); + return result; +} +public override bool UpdateUserAvgRateStat(ulong steamIDUser,string pchName,float flCountThisSession,double dSessionLength) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(m_pSteamGameServerStats,steamIDUser,pchName,flCountThisSession,dSessionLength); + return result; +} +public override bool SetUserAchievement(ulong steamIDUser,string pchName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_SetUserAchievement(m_pSteamGameServerStats,steamIDUser,pchName); + return result; +} +public override bool ClearUserAchievement(ulong steamIDUser,string pchName) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_ClearUserAchievement(m_pSteamGameServerStats,steamIDUser,pchName); + return result; +} +public override ulong StoreUserStats(ulong steamIDUser) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamGameServerStats_StoreUserStats(m_pSteamGameServerStats,steamIDUser); + return result; +} +} + + +public class SteamAPIInterop +{ +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_RestartAppIfNecessary")] +internal static extern void SteamAPI_RestartAppIfNecessary(uint unOwnAppID ); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_Init")] +internal static extern void SteamAPI_Init(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_RunCallbacks")] +internal static extern void SteamAPI_RunCallbacks(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_RegisterCallback")] +internal static extern void SteamAPI_RegisterCallback(IntPtr pCallback, int iCallback); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_UnregisterCallback")] +internal static extern void SteamAPI_UnregisterCallback(IntPtr pCallback); +[DllImportAttribute("Steam_api", EntryPoint = "SteamClient")] +internal static extern IntPtr SteamClient(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamUser")] +internal static extern IntPtr SteamUser(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamFriends")] +internal static extern IntPtr SteamFriends(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamUtils")] +internal static extern IntPtr SteamUtils(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmaking")] +internal static extern IntPtr SteamMatchmaking(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingServerListResponse")] +internal static extern IntPtr SteamMatchmakingServerListResponse(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingPingResponse")] +internal static extern IntPtr SteamMatchmakingPingResponse(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingPlayersResponse")] +internal static extern IntPtr SteamMatchmakingPlayersResponse(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingRulesResponse")] +internal static extern IntPtr SteamMatchmakingRulesResponse(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingServers")] +internal static extern IntPtr SteamMatchmakingServers(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamRemoteStorage")] +internal static extern IntPtr SteamRemoteStorage(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamUserStats")] +internal static extern IntPtr SteamUserStats(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamApps")] +internal static extern IntPtr SteamApps(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamNetworking")] +internal static extern IntPtr SteamNetworking(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamScreenshots")] +internal static extern IntPtr SteamScreenshots(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMusic")] +internal static extern IntPtr SteamMusic(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamMusicRemote")] +internal static extern IntPtr SteamMusicRemote(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamHTTP")] +internal static extern IntPtr SteamHTTP(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamUnifiedMessages")] +internal static extern IntPtr SteamUnifiedMessages(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamController")] +internal static extern IntPtr SteamController(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamUGC")] +internal static extern IntPtr SteamUGC(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAppList")] +internal static extern IntPtr SteamAppList(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamHTMLSurface")] +internal static extern IntPtr SteamHTMLSurface(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamInventory")] +internal static extern IntPtr SteamInventory(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamVideo")] +internal static extern IntPtr SteamVideo(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamGameServer")] +internal static extern IntPtr SteamGameServer(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamGameServerStats")] +internal static extern IntPtr SteamGameServerStats(); +} + + +public enum EUniverse +{ + k_EUniverseInvalid = 0, + k_EUniversePublic = 1, + k_EUniverseBeta = 2, + k_EUniverseInternal = 3, + k_EUniverseDev = 4, + k_EUniverseMax = 5, +} +public enum EResult +{ + k_EResultOK = 1, + k_EResultFail = 2, + k_EResultNoConnection = 3, + k_EResultInvalidPassword = 5, + k_EResultLoggedInElsewhere = 6, + k_EResultInvalidProtocolVer = 7, + k_EResultInvalidParam = 8, + k_EResultFileNotFound = 9, + k_EResultBusy = 10, + k_EResultInvalidState = 11, + k_EResultInvalidName = 12, + k_EResultInvalidEmail = 13, + k_EResultDuplicateName = 14, + k_EResultAccessDenied = 15, + k_EResultTimeout = 16, + k_EResultBanned = 17, + k_EResultAccountNotFound = 18, + k_EResultInvalidSteamID = 19, + k_EResultServiceUnavailable = 20, + k_EResultNotLoggedOn = 21, + k_EResultPending = 22, + k_EResultEncryptionFailure = 23, + k_EResultInsufficientPrivilege = 24, + k_EResultLimitExceeded = 25, + k_EResultRevoked = 26, + k_EResultExpired = 27, + k_EResultAlreadyRedeemed = 28, + k_EResultDuplicateRequest = 29, + k_EResultAlreadyOwned = 30, + k_EResultIPNotFound = 31, + k_EResultPersistFailed = 32, + k_EResultLockingFailed = 33, + k_EResultLogonSessionReplaced = 34, + k_EResultConnectFailed = 35, + k_EResultHandshakeFailed = 36, + k_EResultIOFailure = 37, + k_EResultRemoteDisconnect = 38, + k_EResultShoppingCartNotFound = 39, + k_EResultBlocked = 40, + k_EResultIgnored = 41, + k_EResultNoMatch = 42, + k_EResultAccountDisabled = 43, + k_EResultServiceReadOnly = 44, + k_EResultAccountNotFeatured = 45, + k_EResultAdministratorOK = 46, + k_EResultContentVersion = 47, + k_EResultTryAnotherCM = 48, + k_EResultPasswordRequiredToKickSession = 49, + k_EResultAlreadyLoggedInElsewhere = 50, + k_EResultSuspended = 51, + k_EResultCancelled = 52, + k_EResultDataCorruption = 53, + k_EResultDiskFull = 54, + k_EResultRemoteCallFailed = 55, + k_EResultPasswordUnset = 56, + k_EResultExternalAccountUnlinked = 57, + k_EResultPSNTicketInvalid = 58, + k_EResultExternalAccountAlreadyLinked = 59, + k_EResultRemoteFileConflict = 60, + k_EResultIllegalPassword = 61, + k_EResultSameAsPreviousValue = 62, + k_EResultAccountLogonDenied = 63, + k_EResultCannotUseOldPassword = 64, + k_EResultInvalidLoginAuthCode = 65, + k_EResultAccountLogonDeniedNoMail = 66, + k_EResultHardwareNotCapableOfIPT = 67, + k_EResultIPTInitError = 68, + k_EResultParentalControlRestricted = 69, + k_EResultFacebookQueryError = 70, + k_EResultExpiredLoginAuthCode = 71, + k_EResultIPLoginRestrictionFailed = 72, + k_EResultAccountLockedDown = 73, + k_EResultAccountLogonDeniedVerifiedEmailRequired = 74, + k_EResultNoMatchingURL = 75, + k_EResultBadResponse = 76, + k_EResultRequirePasswordReEntry = 77, + k_EResultValueOutOfRange = 78, + k_EResultUnexpectedError = 79, + k_EResultDisabled = 80, + k_EResultInvalidCEGSubmission = 81, + k_EResultRestrictedDevice = 82, + k_EResultRegionLocked = 83, + k_EResultRateLimitExceeded = 84, + k_EResultAccountLoginDeniedNeedTwoFactor = 85, + k_EResultItemDeleted = 86, + k_EResultAccountLoginDeniedThrottle = 87, + k_EResultTwoFactorCodeMismatch = 88, + k_EResultTwoFactorActivationCodeMismatch = 89, + k_EResultAccountAssociatedToMultiplePartners = 90, + k_EResultNotModified = 91, + k_EResultNoMobileDevice = 92, + k_EResultTimeNotSynced = 93, + k_EResultSmsCodeFailed = 94, + k_EResultAccountLimitExceeded = 95, + k_EResultAccountActivityLimitExceeded = 96, + k_EResultPhoneActivityLimitExceeded = 97, + k_EResultRefundToWallet = 98, + k_EResultEmailSendFailure = 99, + k_EResultNotSettled = 100, + k_EResultNeedCaptcha = 101, +} +public enum EVoiceResult +{ + k_EVoiceResultOK = 0, + k_EVoiceResultNotInitialized = 1, + k_EVoiceResultNotRecording = 2, + k_EVoiceResultNoData = 3, + k_EVoiceResultBufferTooSmall = 4, + k_EVoiceResultDataCorrupted = 5, + k_EVoiceResultRestricted = 6, + k_EVoiceResultUnsupportedCodec = 7, + k_EVoiceResultReceiverOutOfDate = 8, + k_EVoiceResultReceiverDidNotAnswer = 9, +} +public enum EDenyReason +{ + k_EDenyInvalid = 0, + k_EDenyInvalidVersion = 1, + k_EDenyGeneric = 2, + k_EDenyNotLoggedOn = 3, + k_EDenyNoLicense = 4, + k_EDenyCheater = 5, + k_EDenyLoggedInElseWhere = 6, + k_EDenyUnknownText = 7, + k_EDenyIncompatibleAnticheat = 8, + k_EDenyMemoryCorruption = 9, + k_EDenyIncompatibleSoftware = 10, + k_EDenySteamConnectionLost = 11, + k_EDenySteamConnectionError = 12, + k_EDenySteamResponseTimedOut = 13, + k_EDenySteamValidationStalled = 14, + k_EDenySteamOwnerLeftGuestUser = 15, +} +public enum EBeginAuthSessionResult +{ + k_EBeginAuthSessionResultOK = 0, + k_EBeginAuthSessionResultInvalidTicket = 1, + k_EBeginAuthSessionResultDuplicateRequest = 2, + k_EBeginAuthSessionResultInvalidVersion = 3, + k_EBeginAuthSessionResultGameMismatch = 4, + k_EBeginAuthSessionResultExpiredTicket = 5, +} +public enum EAuthSessionResponse +{ + k_EAuthSessionResponseOK = 0, + k_EAuthSessionResponseUserNotConnectedToSteam = 1, + k_EAuthSessionResponseNoLicenseOrExpired = 2, + k_EAuthSessionResponseVACBanned = 3, + k_EAuthSessionResponseLoggedInElseWhere = 4, + k_EAuthSessionResponseVACCheckTimedOut = 5, + k_EAuthSessionResponseAuthTicketCanceled = 6, + k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, + k_EAuthSessionResponseAuthTicketInvalid = 8, + k_EAuthSessionResponsePublisherIssuedBan = 9, +} +public enum EUserHasLicenseForAppResult +{ + k_EUserHasLicenseResultHasLicense = 0, + k_EUserHasLicenseResultDoesNotHaveLicense = 1, + k_EUserHasLicenseResultNoAuth = 2, +} +public enum EAccountType +{ + k_EAccountTypeInvalid = 0, + k_EAccountTypeIndividual = 1, + k_EAccountTypeMultiseat = 2, + k_EAccountTypeGameServer = 3, + k_EAccountTypeAnonGameServer = 4, + k_EAccountTypePending = 5, + k_EAccountTypeContentServer = 6, + k_EAccountTypeClan = 7, + k_EAccountTypeChat = 8, + k_EAccountTypeConsoleUser = 9, + k_EAccountTypeAnonUser = 10, + k_EAccountTypeMax = 11, +} +public enum EAppReleaseState +{ + k_EAppReleaseState_Unknown = 0, + k_EAppReleaseState_Unavailable = 1, + k_EAppReleaseState_Prerelease = 2, + k_EAppReleaseState_PreloadOnly = 3, + k_EAppReleaseState_Released = 4, +} +public enum EAppOwnershipFlags +{ + k_EAppOwnershipFlags_None = 0, + k_EAppOwnershipFlags_OwnsLicense = 1, + k_EAppOwnershipFlags_FreeLicense = 2, + k_EAppOwnershipFlags_RegionRestricted = 4, + k_EAppOwnershipFlags_LowViolence = 8, + k_EAppOwnershipFlags_InvalidPlatform = 16, + k_EAppOwnershipFlags_SharedLicense = 32, + k_EAppOwnershipFlags_FreeWeekend = 64, + k_EAppOwnershipFlags_RetailLicense = 128, + k_EAppOwnershipFlags_LicenseLocked = 256, + k_EAppOwnershipFlags_LicensePending = 512, + k_EAppOwnershipFlags_LicenseExpired = 1024, + k_EAppOwnershipFlags_LicensePermanent = 2048, + k_EAppOwnershipFlags_LicenseRecurring = 4096, + k_EAppOwnershipFlags_LicenseCanceled = 8192, + k_EAppOwnershipFlags_AutoGrant = 16384, + k_EAppOwnershipFlags_PendingGift = 32768, +} +public enum EAppType +{ + k_EAppType_Invalid = 0, + k_EAppType_Game = 1, + k_EAppType_Application = 2, + k_EAppType_Tool = 4, + k_EAppType_Demo = 8, + k_EAppType_Media_DEPRECATED = 16, + k_EAppType_DLC = 32, + k_EAppType_Guide = 64, + k_EAppType_Driver = 128, + k_EAppType_Config = 256, + k_EAppType_Hardware = 512, + k_EAppType_Video = 2048, + k_EAppType_Plugin = 4096, + k_EAppType_Music = 8192, + k_EAppType_Shortcut = 1073741824, + k_EAppType_DepotOnly = -2147483648, +} +public enum ESteamUserStatType +{ + k_ESteamUserStatTypeINVALID = 0, + k_ESteamUserStatTypeINT = 1, + k_ESteamUserStatTypeFLOAT = 2, + k_ESteamUserStatTypeAVGRATE = 3, + k_ESteamUserStatTypeACHIEVEMENTS = 4, + k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5, + k_ESteamUserStatTypeMAX = 6, +} +public enum EChatEntryType +{ + k_EChatEntryTypeInvalid = 0, + k_EChatEntryTypeChatMsg = 1, + k_EChatEntryTypeTyping = 2, + k_EChatEntryTypeInviteGame = 3, + k_EChatEntryTypeEmote = 4, + k_EChatEntryTypeLeftConversation = 6, + k_EChatEntryTypeEntered = 7, + k_EChatEntryTypeWasKicked = 8, + k_EChatEntryTypeWasBanned = 9, + k_EChatEntryTypeDisconnected = 10, + k_EChatEntryTypeHistoricalChat = 11, + k_EChatEntryTypeReserved1 = 12, + k_EChatEntryTypeReserved2 = 13, + k_EChatEntryTypeLinkBlocked = 14, +} +public enum EChatRoomEnterResponse +{ + k_EChatRoomEnterResponseSuccess = 1, + k_EChatRoomEnterResponseDoesntExist = 2, + k_EChatRoomEnterResponseNotAllowed = 3, + k_EChatRoomEnterResponseFull = 4, + k_EChatRoomEnterResponseError = 5, + k_EChatRoomEnterResponseBanned = 6, + k_EChatRoomEnterResponseLimited = 7, + k_EChatRoomEnterResponseClanDisabled = 8, + k_EChatRoomEnterResponseCommunityBan = 9, + k_EChatRoomEnterResponseMemberBlockedYou = 10, + k_EChatRoomEnterResponseYouBlockedMember = 11, +} +public enum EChatSteamIDInstanceFlags +{ + k_EChatAccountInstanceMask = 4095, + k_EChatInstanceFlagClan = 524288, + k_EChatInstanceFlagLobby = 262144, + k_EChatInstanceFlagMMSLobby = 131072, +} +public enum EMarketingMessageFlags +{ + k_EMarketingMessageFlagsNone = 0, + k_EMarketingMessageFlagsHighPriority = 1, + k_EMarketingMessageFlagsPlatformWindows = 2, + k_EMarketingMessageFlagsPlatformMac = 4, + k_EMarketingMessageFlagsPlatformLinux = 8, + k_EMarketingMessageFlagsPlatformRestrictions = 14, +} +public enum ENotificationPosition +{ + k_EPositionTopLeft = 0, + k_EPositionTopRight = 1, + k_EPositionBottomLeft = 2, + k_EPositionBottomRight = 3, +} +public enum EBroadcastUploadResult +{ + k_EBroadcastUploadResultNone = 0, + k_EBroadcastUploadResultOK = 1, + k_EBroadcastUploadResultInitFailed = 2, + k_EBroadcastUploadResultFrameFailed = 3, + k_EBroadcastUploadResultTimeout = 4, + k_EBroadcastUploadResultBandwidthExceeded = 5, + k_EBroadcastUploadResultLowFPS = 6, + k_EBroadcastUploadResultMissingKeyFrames = 7, + k_EBroadcastUploadResultNoConnection = 8, + k_EBroadcastUploadResultRelayFailed = 9, + k_EBroadcastUploadResultSettingsChanged = 10, + k_EBroadcastUploadResultMissingAudio = 11, + k_EBroadcastUploadResultTooFarBehind = 12, + k_EBroadcastUploadResultTranscodeBehind = 13, +} +public enum ELaunchOptionType +{ + k_ELaunchOptionType_None = 0, + k_ELaunchOptionType_Default = 1, + k_ELaunchOptionType_SafeMode = 2, + k_ELaunchOptionType_Multiplayer = 3, + k_ELaunchOptionType_Config = 4, + k_ELaunchOptionType_VR = 5, + k_ELaunchOptionType_Server = 6, + k_ELaunchOptionType_Editor = 7, + k_ELaunchOptionType_Manual = 8, + k_ELaunchOptionType_Benchmark = 9, + k_ELaunchOptionType_Option1 = 10, + k_ELaunchOptionType_Option2 = 11, + k_ELaunchOptionType_Option3 = 12, + k_ELaunchOptionType_Dialog = 1000, +} +public enum EFailureType +{ + k_EFailureFlushedCallbackQueue = 0, + k_EFailurePipeFail = 1, +} +public enum EFriendRelationship +{ + k_EFriendRelationshipNone = 0, + k_EFriendRelationshipBlocked = 1, + k_EFriendRelationshipRequestRecipient = 2, + k_EFriendRelationshipFriend = 3, + k_EFriendRelationshipRequestInitiator = 4, + k_EFriendRelationshipIgnored = 5, + k_EFriendRelationshipIgnoredFriend = 6, + k_EFriendRelationshipSuggested = 7, + k_EFriendRelationshipMax = 8, +} +public enum EPersonaState +{ + k_EPersonaStateOffline = 0, + k_EPersonaStateOnline = 1, + k_EPersonaStateBusy = 2, + k_EPersonaStateAway = 3, + k_EPersonaStateSnooze = 4, + k_EPersonaStateLookingToTrade = 5, + k_EPersonaStateLookingToPlay = 6, + k_EPersonaStateMax = 7, +} +public enum EFriendFlags +{ + k_EFriendFlagNone = 0, + k_EFriendFlagBlocked = 1, + k_EFriendFlagFriendshipRequested = 2, + k_EFriendFlagImmediate = 4, + k_EFriendFlagClanMember = 8, + k_EFriendFlagOnGameServer = 16, + k_EFriendFlagRequestingFriendship = 128, + k_EFriendFlagRequestingInfo = 256, + k_EFriendFlagIgnored = 512, + k_EFriendFlagIgnoredFriend = 1024, + k_EFriendFlagSuggested = 2048, + k_EFriendFlagAll = 65535, +} +public enum EUserRestriction +{ + k_nUserRestrictionNone = 0, + k_nUserRestrictionUnknown = 1, + k_nUserRestrictionAnyChat = 2, + k_nUserRestrictionVoiceChat = 4, + k_nUserRestrictionGroupChat = 8, + k_nUserRestrictionRating = 16, + k_nUserRestrictionGameInvites = 32, + k_nUserRestrictionTrading = 64, +} +public enum EOverlayToStoreFlag +{ + k_EOverlayToStoreFlag_None = 0, + k_EOverlayToStoreFlag_AddToCart = 1, + k_EOverlayToStoreFlag_AddToCartAndShow = 2, +} +public enum EPersonaChange +{ + k_EPersonaChangeName = 1, + k_EPersonaChangeStatus = 2, + k_EPersonaChangeComeOnline = 4, + k_EPersonaChangeGoneOffline = 8, + k_EPersonaChangeGamePlayed = 16, + k_EPersonaChangeGameServer = 32, + k_EPersonaChangeAvatar = 64, + k_EPersonaChangeJoinedSource = 128, + k_EPersonaChangeLeftSource = 256, + k_EPersonaChangeRelationshipChanged = 512, + k_EPersonaChangeNameFirstSet = 1024, + k_EPersonaChangeFacebookInfo = 2048, + k_EPersonaChangeNickname = 4096, + k_EPersonaChangeSteamLevel = 8192, +} +public enum ESteamAPICallFailure +{ + k_ESteamAPICallFailureNone = -1, + k_ESteamAPICallFailureSteamGone = 0, + k_ESteamAPICallFailureNetworkFailure = 1, + k_ESteamAPICallFailureInvalidHandle = 2, + k_ESteamAPICallFailureMismatchedCallback = 3, +} +public enum EGamepadTextInputMode +{ + k_EGamepadTextInputModeNormal = 0, + k_EGamepadTextInputModePassword = 1, +} +public enum EGamepadTextInputLineMode +{ + k_EGamepadTextInputLineModeSingleLine = 0, + k_EGamepadTextInputLineModeMultipleLines = 1, +} +public enum ECheckFileSignature +{ + k_ECheckFileSignatureInvalidSignature = 0, + k_ECheckFileSignatureValidSignature = 1, + k_ECheckFileSignatureFileNotFound = 2, + k_ECheckFileSignatureNoSignaturesFoundForThisApp = 3, + k_ECheckFileSignatureNoSignaturesFoundForThisFile = 4, +} +public enum EMatchMakingServerResponse +{ + eServerResponded = 0, + eServerFailedToRespond = 1, + eNoServersListedOnMasterServer = 2, +} +public enum ELobbyType +{ + k_ELobbyTypePrivate = 0, + k_ELobbyTypeFriendsOnly = 1, + k_ELobbyTypePublic = 2, + k_ELobbyTypeInvisible = 3, +} +public enum ELobbyComparison +{ + k_ELobbyComparisonEqualToOrLessThan = -2, + k_ELobbyComparisonLessThan = -1, + k_ELobbyComparisonEqual = 0, + k_ELobbyComparisonGreaterThan = 1, + k_ELobbyComparisonEqualToOrGreaterThan = 2, + k_ELobbyComparisonNotEqual = 3, +} +public enum ELobbyDistanceFilter +{ + k_ELobbyDistanceFilterClose = 0, + k_ELobbyDistanceFilterDefault = 1, + k_ELobbyDistanceFilterFar = 2, + k_ELobbyDistanceFilterWorldwide = 3, +} +public enum EChatMemberStateChange +{ + k_EChatMemberStateChangeEntered = 1, + k_EChatMemberStateChangeLeft = 2, + k_EChatMemberStateChangeDisconnected = 4, + k_EChatMemberStateChangeKicked = 8, + k_EChatMemberStateChangeBanned = 16, +} +public enum EResolveConflict +{ + k_EResolveConflictKeepClient = 1, + k_EResolveConflictKeepServer = 2, +} +public enum ERemoteStoragePlatform +{ + k_ERemoteStoragePlatformNone = 0, + k_ERemoteStoragePlatformWindows = 1, + k_ERemoteStoragePlatformOSX = 2, + k_ERemoteStoragePlatformPS3 = 4, + k_ERemoteStoragePlatformLinux = 8, + k_ERemoteStoragePlatformReserved2 = 16, + k_ERemoteStoragePlatformAll = -1, +} +public enum ERemoteStoragePublishedFileVisibility +{ + k_ERemoteStoragePublishedFileVisibilityPublic = 0, + k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1, + k_ERemoteStoragePublishedFileVisibilityPrivate = 2, +} +public enum EWorkshopFileType +{ + k_EWorkshopFileTypeFirst = 0, + k_EWorkshopFileTypeCommunity = 0, + k_EWorkshopFileTypeMicrotransaction = 1, + k_EWorkshopFileTypeCollection = 2, + k_EWorkshopFileTypeArt = 3, + k_EWorkshopFileTypeVideo = 4, + k_EWorkshopFileTypeScreenshot = 5, + k_EWorkshopFileTypeGame = 6, + k_EWorkshopFileTypeSoftware = 7, + k_EWorkshopFileTypeConcept = 8, + k_EWorkshopFileTypeWebGuide = 9, + k_EWorkshopFileTypeIntegratedGuide = 10, + k_EWorkshopFileTypeMerch = 11, + k_EWorkshopFileTypeControllerBinding = 12, + k_EWorkshopFileTypeSteamworksAccessInvite = 13, + k_EWorkshopFileTypeSteamVideo = 14, + k_EWorkshopFileTypeGameManagedItem = 15, + k_EWorkshopFileTypeMax = 16, +} +public enum EWorkshopVote +{ + k_EWorkshopVoteUnvoted = 0, + k_EWorkshopVoteFor = 1, + k_EWorkshopVoteAgainst = 2, + k_EWorkshopVoteLater = 3, +} +public enum EWorkshopFileAction +{ + k_EWorkshopFileActionPlayed = 0, + k_EWorkshopFileActionCompleted = 1, +} +public enum EWorkshopEnumerationType +{ + k_EWorkshopEnumerationTypeRankedByVote = 0, + k_EWorkshopEnumerationTypeRecent = 1, + k_EWorkshopEnumerationTypeTrending = 2, + k_EWorkshopEnumerationTypeFavoritesOfFriends = 3, + k_EWorkshopEnumerationTypeVotedByFriends = 4, + k_EWorkshopEnumerationTypeContentByFriends = 5, + k_EWorkshopEnumerationTypeRecentFromFollowedUsers = 6, +} +public enum EWorkshopVideoProvider +{ + k_EWorkshopVideoProviderNone = 0, + k_EWorkshopVideoProviderYoutube = 1, +} +public enum EUGCReadAction +{ + k_EUGCRead_ContinueReadingUntilFinished = 0, + k_EUGCRead_ContinueReading = 1, + k_EUGCRead_Close = 2, +} +public enum ELeaderboardDataRequest +{ + k_ELeaderboardDataRequestGlobal = 0, + k_ELeaderboardDataRequestGlobalAroundUser = 1, + k_ELeaderboardDataRequestFriends = 2, + k_ELeaderboardDataRequestUsers = 3, +} +public enum ELeaderboardSortMethod +{ + k_ELeaderboardSortMethodNone = 0, + k_ELeaderboardSortMethodAscending = 1, + k_ELeaderboardSortMethodDescending = 2, +} +public enum ELeaderboardDisplayType +{ + k_ELeaderboardDisplayTypeNone = 0, + k_ELeaderboardDisplayTypeNumeric = 1, + k_ELeaderboardDisplayTypeTimeSeconds = 2, + k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, +} +public enum ELeaderboardUploadScoreMethod +{ + k_ELeaderboardUploadScoreMethodNone = 0, + k_ELeaderboardUploadScoreMethodKeepBest = 1, + k_ELeaderboardUploadScoreMethodForceUpdate = 2, +} +public enum ERegisterActivationCodeResult +{ + k_ERegisterActivationCodeResultOK = 0, + k_ERegisterActivationCodeResultFail = 1, + k_ERegisterActivationCodeResultAlreadyRegistered = 2, + k_ERegisterActivationCodeResultTimeout = 3, + k_ERegisterActivationCodeAlreadyOwned = 4, +} +public enum EP2PSessionError +{ + k_EP2PSessionErrorNone = 0, + k_EP2PSessionErrorNotRunningApp = 1, + k_EP2PSessionErrorNoRightsToApp = 2, + k_EP2PSessionErrorDestinationNotLoggedIn = 3, + k_EP2PSessionErrorTimeout = 4, + k_EP2PSessionErrorMax = 5, +} +public enum EP2PSend +{ + k_EP2PSendUnreliable = 0, + k_EP2PSendUnreliableNoDelay = 1, + k_EP2PSendReliable = 2, + k_EP2PSendReliableWithBuffering = 3, +} +public enum ESNetSocketState +{ + k_ESNetSocketStateInvalid = 0, + k_ESNetSocketStateConnected = 1, + k_ESNetSocketStateInitiated = 10, + k_ESNetSocketStateLocalCandidatesFound = 11, + k_ESNetSocketStateReceivedRemoteCandidates = 12, + k_ESNetSocketStateChallengeHandshake = 15, + k_ESNetSocketStateDisconnecting = 21, + k_ESNetSocketStateLocalDisconnect = 22, + k_ESNetSocketStateTimeoutDuringConnect = 23, + k_ESNetSocketStateRemoteEndDisconnected = 24, + k_ESNetSocketStateConnectionBroken = 25, +} +public enum ESNetSocketConnectionType +{ + k_ESNetSocketConnectionTypeNotConnected = 0, + k_ESNetSocketConnectionTypeUDP = 1, + k_ESNetSocketConnectionTypeUDPRelay = 2, +} +public enum AudioPlayback_Status +{ + AudioPlayback_Undefined = 0, + AudioPlayback_Playing = 1, + AudioPlayback_Paused = 2, + AudioPlayback_Idle = 3, +} +public enum EHTTPMethod +{ + k_EHTTPMethodInvalid = 0, + k_EHTTPMethodGET = 1, + k_EHTTPMethodHEAD = 2, + k_EHTTPMethodPOST = 3, + k_EHTTPMethodPUT = 4, + k_EHTTPMethodDELETE = 5, + k_EHTTPMethodOPTIONS = 6, +} +public enum EHTTPStatusCode +{ + k_EHTTPStatusCodeInvalid = 0, + k_EHTTPStatusCode100Continue = 100, + k_EHTTPStatusCode101SwitchingProtocols = 101, + k_EHTTPStatusCode200OK = 200, + k_EHTTPStatusCode201Created = 201, + k_EHTTPStatusCode202Accepted = 202, + k_EHTTPStatusCode203NonAuthoritative = 203, + k_EHTTPStatusCode204NoContent = 204, + k_EHTTPStatusCode205ResetContent = 205, + k_EHTTPStatusCode206PartialContent = 206, + k_EHTTPStatusCode300MultipleChoices = 300, + k_EHTTPStatusCode301MovedPermanently = 301, + k_EHTTPStatusCode302Found = 302, + k_EHTTPStatusCode303SeeOther = 303, + k_EHTTPStatusCode304NotModified = 304, + k_EHTTPStatusCode305UseProxy = 305, + k_EHTTPStatusCode307TemporaryRedirect = 307, + k_EHTTPStatusCode400BadRequest = 400, + k_EHTTPStatusCode401Unauthorized = 401, + k_EHTTPStatusCode402PaymentRequired = 402, + k_EHTTPStatusCode403Forbidden = 403, + k_EHTTPStatusCode404NotFound = 404, + k_EHTTPStatusCode405MethodNotAllowed = 405, + k_EHTTPStatusCode406NotAcceptable = 406, + k_EHTTPStatusCode407ProxyAuthRequired = 407, + k_EHTTPStatusCode408RequestTimeout = 408, + k_EHTTPStatusCode409Conflict = 409, + k_EHTTPStatusCode410Gone = 410, + k_EHTTPStatusCode411LengthRequired = 411, + k_EHTTPStatusCode412PreconditionFailed = 412, + k_EHTTPStatusCode413RequestEntityTooLarge = 413, + k_EHTTPStatusCode414RequestURITooLong = 414, + k_EHTTPStatusCode415UnsupportedMediaType = 415, + k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416, + k_EHTTPStatusCode417ExpectationFailed = 417, + k_EHTTPStatusCode4xxUnknown = 418, + k_EHTTPStatusCode429TooManyRequests = 429, + k_EHTTPStatusCode500InternalServerError = 500, + k_EHTTPStatusCode501NotImplemented = 501, + k_EHTTPStatusCode502BadGateway = 502, + k_EHTTPStatusCode503ServiceUnavailable = 503, + k_EHTTPStatusCode504GatewayTimeout = 504, + k_EHTTPStatusCode505HTTPVersionNotSupported = 505, + k_EHTTPStatusCode5xxUnknown = 599, +} +public enum ESteamControllerPad +{ + k_ESteamControllerPad_Left = 0, + k_ESteamControllerPad_Right = 1, +} +public enum EControllerSource +{ + k_EControllerSource_None = 0, + k_EControllerSource_LeftTrackpad = 1, + k_EControllerSource_RightTrackpad = 2, + k_EControllerSource_Joystick = 3, + k_EControllerSource_ABXY = 4, + k_EControllerSource_Switch = 5, + k_EControllerSource_LeftTrigger = 6, + k_EControllerSource_RightTrigger = 7, + k_EControllerSource_Gyro = 8, +} +public enum EControllerSourceMode +{ + k_EControllerSourceMode_None = 0, + k_EControllerSourceMode_Dpad = 1, + k_EControllerSourceMode_Buttons = 2, + k_EControllerSourceMode_FourButtons = 3, + k_EControllerSourceMode_AbsoluteMouse = 4, + k_EControllerSourceMode_RelativeMouse = 5, + k_EControllerSourceMode_JoystickMove = 6, + k_EControllerSourceMode_JoystickCamera = 7, + k_EControllerSourceMode_ScrollWheel = 8, + k_EControllerSourceMode_Trigger = 9, + k_EControllerSourceMode_TouchMenu = 10, +} +public enum EControllerActionOrigin +{ + k_EControllerActionOrigin_None = 0, + k_EControllerActionOrigin_A = 1, + k_EControllerActionOrigin_B = 2, + k_EControllerActionOrigin_X = 3, + k_EControllerActionOrigin_Y = 4, + k_EControllerActionOrigin_LeftBumper = 5, + k_EControllerActionOrigin_RightBumper = 6, + k_EControllerActionOrigin_LeftGrip = 7, + k_EControllerActionOrigin_RightGrip = 8, + k_EControllerActionOrigin_Start = 9, + k_EControllerActionOrigin_Back = 10, + k_EControllerActionOrigin_LeftPad_Touch = 11, + k_EControllerActionOrigin_LeftPad_Swipe = 12, + k_EControllerActionOrigin_LeftPad_Click = 13, + k_EControllerActionOrigin_LeftPad_DPadNorth = 14, + k_EControllerActionOrigin_LeftPad_DPadSouth = 15, + k_EControllerActionOrigin_LeftPad_DPadWest = 16, + k_EControllerActionOrigin_LeftPad_DPadEast = 17, + k_EControllerActionOrigin_RightPad_Touch = 18, + k_EControllerActionOrigin_RightPad_Swipe = 19, + k_EControllerActionOrigin_RightPad_Click = 20, + k_EControllerActionOrigin_RightPad_DPadNorth = 21, + k_EControllerActionOrigin_RightPad_DPadSouth = 22, + k_EControllerActionOrigin_RightPad_DPadWest = 23, + k_EControllerActionOrigin_RightPad_DPadEast = 24, + k_EControllerActionOrigin_LeftTrigger_Pull = 25, + k_EControllerActionOrigin_LeftTrigger_Click = 26, + k_EControllerActionOrigin_RightTrigger_Pull = 27, + k_EControllerActionOrigin_RightTrigger_Click = 28, + k_EControllerActionOrigin_LeftStick_Move = 29, + k_EControllerActionOrigin_LeftStick_Click = 30, + k_EControllerActionOrigin_LeftStick_DPadNorth = 31, + k_EControllerActionOrigin_LeftStick_DPadSouth = 32, + k_EControllerActionOrigin_LeftStick_DPadWest = 33, + k_EControllerActionOrigin_LeftStick_DPadEast = 34, + k_EControllerActionOrigin_Gyro_Move = 35, + k_EControllerActionOrigin_Gyro_Pitch = 36, + k_EControllerActionOrigin_Gyro_Yaw = 37, + k_EControllerActionOrigin_Gyro_Roll = 38, + k_EControllerActionOrigin_Count = 39, +} +public enum EUGCMatchingUGCType +{ + k_EUGCMatchingUGCType_Items = 0, + k_EUGCMatchingUGCType_Items_Mtx = 1, + k_EUGCMatchingUGCType_Items_ReadyToUse = 2, + k_EUGCMatchingUGCType_Collections = 3, + k_EUGCMatchingUGCType_Artwork = 4, + k_EUGCMatchingUGCType_Videos = 5, + k_EUGCMatchingUGCType_Screenshots = 6, + k_EUGCMatchingUGCType_AllGuides = 7, + k_EUGCMatchingUGCType_WebGuides = 8, + k_EUGCMatchingUGCType_IntegratedGuides = 9, + k_EUGCMatchingUGCType_UsableInGame = 10, + k_EUGCMatchingUGCType_ControllerBindings = 11, + k_EUGCMatchingUGCType_GameManagedItems = 12, + k_EUGCMatchingUGCType_All = -1, +} +public enum EUserUGCList +{ + k_EUserUGCList_Published = 0, + k_EUserUGCList_VotedOn = 1, + k_EUserUGCList_VotedUp = 2, + k_EUserUGCList_VotedDown = 3, + k_EUserUGCList_WillVoteLater = 4, + k_EUserUGCList_Favorited = 5, + k_EUserUGCList_Subscribed = 6, + k_EUserUGCList_UsedOrPlayed = 7, + k_EUserUGCList_Followed = 8, +} +public enum EUserUGCListSortOrder +{ + k_EUserUGCListSortOrder_CreationOrderDesc = 0, + k_EUserUGCListSortOrder_CreationOrderAsc = 1, + k_EUserUGCListSortOrder_TitleAsc = 2, + k_EUserUGCListSortOrder_LastUpdatedDesc = 3, + k_EUserUGCListSortOrder_SubscriptionDateDesc = 4, + k_EUserUGCListSortOrder_VoteScoreDesc = 5, + k_EUserUGCListSortOrder_ForModeration = 6, +} +public enum EUGCQuery +{ + k_EUGCQuery_RankedByVote = 0, + k_EUGCQuery_RankedByPublicationDate = 1, + k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate = 2, + k_EUGCQuery_RankedByTrend = 3, + k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate = 4, + k_EUGCQuery_CreatedByFriendsRankedByPublicationDate = 5, + k_EUGCQuery_RankedByNumTimesReported = 6, + k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate = 7, + k_EUGCQuery_NotYetRated = 8, + k_EUGCQuery_RankedByTotalVotesAsc = 9, + k_EUGCQuery_RankedByVotesUp = 10, + k_EUGCQuery_RankedByTextSearch = 11, + k_EUGCQuery_RankedByTotalUniqueSubscriptions = 12, +} +public enum EItemUpdateStatus +{ + k_EItemUpdateStatusInvalid = 0, + k_EItemUpdateStatusPreparingConfig = 1, + k_EItemUpdateStatusPreparingContent = 2, + k_EItemUpdateStatusUploadingContent = 3, + k_EItemUpdateStatusUploadingPreviewFile = 4, + k_EItemUpdateStatusCommittingChanges = 5, +} +public enum EItemState +{ + k_EItemStateNone = 0, + k_EItemStateSubscribed = 1, + k_EItemStateLegacyItem = 2, + k_EItemStateInstalled = 4, + k_EItemStateNeedsUpdate = 8, + k_EItemStateDownloading = 16, + k_EItemStateDownloadPending = 32, +} +public enum EItemStatistic +{ + k_EItemStatistic_NumSubscriptions = 0, + k_EItemStatistic_NumFavorites = 1, + k_EItemStatistic_NumFollowers = 2, + k_EItemStatistic_NumUniqueSubscriptions = 3, + k_EItemStatistic_NumUniqueFavorites = 4, + k_EItemStatistic_NumUniqueFollowers = 5, + k_EItemStatistic_NumUniqueWebsiteViews = 6, + k_EItemStatistic_ReportScore = 7, +} +public enum EHTMLMouseButton +{ + eHTMLMouseButton_Left = 0, + eHTMLMouseButton_Right = 1, + eHTMLMouseButton_Middle = 2, +} +public enum EMouseCursor +{ + dc_user = 0, + dc_none = 1, + dc_arrow = 2, + dc_ibeam = 3, + dc_hourglass = 4, + dc_waitarrow = 5, + dc_crosshair = 6, + dc_up = 7, + dc_sizenw = 8, + dc_sizese = 9, + dc_sizene = 10, + dc_sizesw = 11, + dc_sizew = 12, + dc_sizee = 13, + dc_sizen = 14, + dc_sizes = 15, + dc_sizewe = 16, + dc_sizens = 17, + dc_sizeall = 18, + dc_no = 19, + dc_hand = 20, + dc_blank = 21, + dc_middle_pan = 22, + dc_north_pan = 23, + dc_north_east_pan = 24, + dc_east_pan = 25, + dc_south_east_pan = 26, + dc_south_pan = 27, + dc_south_west_pan = 28, + dc_west_pan = 29, + dc_north_west_pan = 30, + dc_alias = 31, + dc_cell = 32, + dc_colresize = 33, + dc_copycur = 34, + dc_verticaltext = 35, + dc_rowresize = 36, + dc_zoomin = 37, + dc_zoomout = 38, + dc_help = 39, + dc_custom = 40, + dc_last = 41, +} +public enum EHTMLKeyModifiers +{ + k_eHTMLKeyModifier_None = 0, + k_eHTMLKeyModifier_AltDown = 1, + k_eHTMLKeyModifier_CtrlDown = 2, + k_eHTMLKeyModifier_ShiftDown = 4, +} +public enum ESteamItemFlags +{ + k_ESteamItemNoTrade = 1, + k_ESteamItemRemoved = 256, + k_ESteamItemConsumed = 512, +} +[StructLayout(LayoutKind.Sequential)] public struct CSteamID +{ + public SteamID_t m_steamid; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamID_t +{ + public SteamIDComponent_t m_comp; + public ulong m_unAll64Bits; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamIDComponent_t +{ + public uint m_unAccountID; + public uint m_unAccountInstance; + public uint m_EAccountType; + public EUniverse m_EUniverse; +} +[StructLayout(LayoutKind.Sequential)] public struct GameID_t +{ + public uint m_nAppID; + public uint m_nType; + public uint m_nModID; +} +[StructLayout(LayoutKind.Sequential)] public struct ValvePackingSentinel_t +{ + public uint m_u32; + public ulong m_u64; + public char m_u16; + public double m_d; +} +[StructLayout(LayoutKind.Sequential)] public struct CallbackMsg_t +{ + public uint m_hSteamUser; + public int m_iCallback; + public IntPtr m_pubParam; + public int m_cubParam; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamServerConnectFailure_t +{ + public EResult m_eResult; + public bool m_bStillRetrying; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamServersDisconnected_t +{ + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct ClientGameServerDeny_t +{ + public uint m_uAppID; + public uint m_unGameServerIP; + public char m_usGameServerPort; + public char m_bSecure; + public uint m_uReason; +} +[StructLayout(LayoutKind.Sequential)] public struct ValidateAuthTicketResponse_t +{ + public ulong m_SteamID; + public EAuthSessionResponse m_eAuthSessionResponse; + public ulong m_OwnerSteamID; +} +[StructLayout(LayoutKind.Sequential)] public struct MicroTxnAuthorizationResponse_t +{ + public uint m_unAppID; + public ulong m_ulOrderID; + public byte m_bAuthorized; +} +[StructLayout(LayoutKind.Sequential)] public struct EncryptedAppTicketResponse_t +{ + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct GetAuthSessionTicketResponse_t +{ + public uint m_hAuthTicket; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct GameWebCallback_t +{ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_szURL; //char[256] +} +[StructLayout(LayoutKind.Sequential)] public struct StoreAuthURLResponse_t +{ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512, ArraySubType = UnmanagedType.I1)] + public char[] m_szURL; //char[512] +} +[StructLayout(LayoutKind.Sequential)] public struct FriendGameInfo_t +{ + public ulong m_gameID; + public uint m_unGameIP; + public char m_usGamePort; + public char m_usQueryPort; + public ulong m_steamIDLobby; +} +[StructLayout(LayoutKind.Sequential)] public struct FriendSessionStateInfo_t +{ + public uint m_uiOnlineSessionInstances; + public byte m_uiPublishedToFriendsSessionInstance; +} +[StructLayout(LayoutKind.Sequential)] public struct PersonaStateChange_t +{ + public ulong m_ulSteamID; + public int m_nChangeFlags; +} +[StructLayout(LayoutKind.Sequential)] public struct GameOverlayActivated_t +{ + public byte m_bActive; +} +[StructLayout(LayoutKind.Sequential)] public struct GameServerChangeRequested_t +{ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchServer; //char[64] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchPassword; //char[64] +} +[StructLayout(LayoutKind.Sequential)] public struct GameLobbyJoinRequested_t +{ + public ulong m_steamIDLobby; + public ulong m_steamIDFriend; +} +[StructLayout(LayoutKind.Sequential)] public struct AvatarImageLoaded_t +{ + public ulong m_steamID; + public int m_iImage; + public int m_iWide; + public int m_iTall; +} +[StructLayout(LayoutKind.Sequential)] public struct ClanOfficerListResponse_t +{ + public ulong m_steamIDClan; + public int m_cOfficers; + public byte m_bSuccess; +} +[StructLayout(LayoutKind.Sequential)] public struct FriendRichPresenceUpdate_t +{ + public ulong m_steamIDFriend; + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct GameRichPresenceJoinRequested_t +{ + public ulong m_steamIDFriend; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchConnect; //char[256] +} +[StructLayout(LayoutKind.Sequential)] public struct GameConnectedClanChatMsg_t +{ + public ulong m_steamIDClanChat; + public ulong m_steamIDUser; + public int m_iMessageID; +} +[StructLayout(LayoutKind.Sequential)] public struct GameConnectedChatJoin_t +{ + public ulong m_steamIDClanChat; + public ulong m_steamIDUser; +} +[StructLayout(LayoutKind.Sequential)] public struct GameConnectedChatLeave_t +{ + public ulong m_steamIDClanChat; + public ulong m_steamIDUser; + public bool m_bKicked; + public bool m_bDropped; +} +[StructLayout(LayoutKind.Sequential)] public struct DownloadClanActivityCountsResult_t +{ + public bool m_bSuccess; +} +[StructLayout(LayoutKind.Sequential)] public struct JoinClanChatRoomCompletionResult_t +{ + public ulong m_steamIDClanChat; + public EChatRoomEnterResponse m_eChatRoomEnterResponse; +} +[StructLayout(LayoutKind.Sequential)] public struct GameConnectedFriendChatMsg_t +{ + public ulong m_steamIDUser; + public int m_iMessageID; +} +[StructLayout(LayoutKind.Sequential)] public struct FriendsGetFollowerCount_t +{ + public EResult m_eResult; + public ulong m_steamID; + public int m_nCount; +} +[StructLayout(LayoutKind.Sequential)] public struct FriendsIsFollowing_t +{ + public EResult m_eResult; + public ulong m_steamID; + public bool m_bIsFollowing; +} +[StructLayout(LayoutKind.Sequential)] public struct FriendsEnumerateFollowingList_t +{ + public EResult m_eResult; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + public CSteamID[] m_rgSteamID; //CSteamID[50] + public int m_nResultsReturned; + public int m_nTotalResultCount; +} +[StructLayout(LayoutKind.Sequential)] public struct SetPersonaNameResponse_t +{ + public bool m_bSuccess; + public bool m_bLocalSuccess; + public EResult m_result; +} +[StructLayout(LayoutKind.Sequential)] public struct LowBatteryPower_t +{ + public byte m_nMinutesBatteryLeft; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamAPICallCompleted_t +{ + public ulong m_hAsyncCall; +} +[StructLayout(LayoutKind.Sequential)] public struct CheckFileSignature_t +{ + public ECheckFileSignature m_eCheckFileSignature; +} +[StructLayout(LayoutKind.Sequential)] public struct GamepadTextInputDismissed_t +{ + public bool m_bSubmitted; + public uint m_unSubmittedText; +} +[StructLayout(LayoutKind.Sequential)] public struct MatchMakingKeyValuePair_t +{ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_szKey; //char[256] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_szValue; //char[256] +} +[StructLayout(LayoutKind.Sequential)] public struct servernetadr_t +{ + public char m_usConnectionPort; + public char m_usQueryPort; + public uint m_unIP; +} +[StructLayout(LayoutKind.Sequential)] public struct gameserveritem_t +{ + public servernetadr_t m_NetAdr; + public int m_nPing; + public bool m_bHadSuccessfulResponse; + public bool m_bDoNotRefresh; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)] + public char[] m_szGameDir; //char[32] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)] + public char[] m_szMap; //char[32] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)] + public char[] m_szGameDescription; //char[64] + public uint m_nAppID; + public int m_nPlayers; + public int m_nMaxPlayers; + public int m_nBotPlayers; + public bool m_bPassword; + public bool m_bSecure; + public uint m_ulTimeLastPlayed; + public int m_nServerVersion; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)] + public char[] m_szServerName; //char[64] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] + public char[] m_szGameTags; //char[128] + public ulong m_steamID; +} +[StructLayout(LayoutKind.Sequential)] public struct FavoritesListChanged_t +{ + public uint m_nIP; + public uint m_nQueryPort; + public uint m_nConnPort; + public uint m_nAppID; + public uint m_nFlags; + public bool m_bAdd; + public uint m_unAccountId; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyInvite_t +{ + public ulong m_ulSteamIDUser; + public ulong m_ulSteamIDLobby; + public ulong m_ulGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyEnter_t +{ + public ulong m_ulSteamIDLobby; + public uint m_rgfChatPermissions; + public bool m_bLocked; + public uint m_EChatRoomEnterResponse; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyDataUpdate_t +{ + public ulong m_ulSteamIDLobby; + public ulong m_ulSteamIDMember; + public byte m_bSuccess; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyChatUpdate_t +{ + public ulong m_ulSteamIDLobby; + public ulong m_ulSteamIDUserChanged; + public ulong m_ulSteamIDMakingChange; + public uint m_rgfChatMemberStateChange; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyChatMsg_t +{ + public ulong m_ulSteamIDLobby; + public ulong m_ulSteamIDUser; + public byte m_eChatEntryType; + public uint m_iChatID; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyGameCreated_t +{ + public ulong m_ulSteamIDLobby; + public ulong m_ulSteamIDGameServer; + public uint m_unIP; + public char m_usPort; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyMatchList_t +{ + public uint m_nLobbiesMatching; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyKicked_t +{ + public ulong m_ulSteamIDLobby; + public ulong m_ulSteamIDAdmin; + public byte m_bKickedDueToDisconnect; +} +[StructLayout(LayoutKind.Sequential)] public struct LobbyCreated_t +{ + public EResult m_eResult; + public ulong m_ulSteamIDLobby; +} +[StructLayout(LayoutKind.Sequential)] public struct PSNGameBootInviteResult_t +{ + public bool m_bGameBootInviteExists; + public ulong m_steamIDLobby; +} +[StructLayout(LayoutKind.Sequential)] public struct FavoritesListAccountsUpdated_t +{ + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamParamStringArray_t +{ + public string m_ppStrings; + public int m_nNumStrings; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageAppSyncedClient_t +{ + public uint m_nAppID; + public EResult m_eResult; + public int m_unNumDownloads; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageAppSyncedServer_t +{ + public uint m_nAppID; + public EResult m_eResult; + public int m_unNumUploads; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageAppSyncProgress_t +{ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchCurrentFile; //char[260] + public uint m_nAppID; + public uint m_uBytesTransferredThisChunk; + public double m_dAppPercentComplete; + public bool m_bUploading; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageAppSyncStatusCheck_t +{ + public uint m_nAppID; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageConflictResolution_t +{ + public uint m_nAppID; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageFileShareResult_t +{ + public EResult m_eResult; + public ulong m_hFile; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchFilename; //char[260] +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStoragePublishFileResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; + public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageDeletePublishedFileResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageEnumerateUserPublishedFilesResult_t +{ + public EResult m_eResult; + public int m_nResultsReturned; + public int m_nTotalResultCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + public ulong[] m_rgPublishedFileId; //ulong[50] +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageSubscribePublishedFileResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageEnumerateUserSubscribedFilesResult_t +{ + public EResult m_eResult; + public int m_nResultsReturned; + public int m_nTotalResultCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + public ulong[] m_rgPublishedFileId; //ulong[50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] + public uint[] m_rgRTimeSubscribed; //uint[50] +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageUnsubscribePublishedFileResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageUpdatePublishedFileResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; + public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageDownloadUGCResult_t +{ + public EResult m_eResult; + public ulong m_hFile; + public uint m_nAppID; + public int m_nSizeInBytes; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260, ArraySubType = UnmanagedType.I1)] + public char[] m_pchFileName; //char[260] + public ulong m_ulSteamIDOwner; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageGetPublishedFileDetailsResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; + public uint m_nCreatorAppID; + public uint m_nConsumerAppID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchTitle; //char[129] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchDescription; //char[8000] + public ulong m_hFile; + public ulong m_hPreviewFile; + public ulong m_ulSteamIDOwner; + public uint m_rtimeCreated; + public uint m_rtimeUpdated; + public ERemoteStoragePublishedFileVisibility m_eVisibility; + public bool m_bBanned; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchTags; //char[1025] + public bool m_bTagsTruncated; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260, ArraySubType = UnmanagedType.I1)] + public char[] m_pchFileName; //char[260] + public int m_nFileSize; + public int m_nPreviewFileSize; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchURL; //char[256] + public EWorkshopFileType m_eFileType; + public bool m_bAcceptedForUse; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageEnumerateWorkshopFilesResult_t +{ + public EResult m_eResult; + public int m_nResultsReturned; + public int m_nTotalResultCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + public ulong[] m_rgPublishedFileId; //ulong[50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] + public float[] m_rgScore; //float[50] + public uint m_nAppId; + public uint m_unStartIndex; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageGetPublishedItemVoteDetailsResult_t +{ + public EResult m_eResult; + public ulong m_unPublishedFileId; + public int m_nVotesFor; + public int m_nVotesAgainst; + public int m_nReports; + public float m_fScore; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStoragePublishedFileSubscribed_t +{ + public ulong m_nPublishedFileId; + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStoragePublishedFileUnsubscribed_t +{ + public ulong m_nPublishedFileId; + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStoragePublishedFileDeleted_t +{ + public ulong m_nPublishedFileId; + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageUpdateUserPublishedItemVoteResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageUserVoteDetails_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; + public EWorkshopVote m_eVote; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t +{ + public EResult m_eResult; + public int m_nResultsReturned; + public int m_nTotalResultCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + public ulong[] m_rgPublishedFileId; //ulong[50] +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageSetUserPublishedFileActionResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; + public EWorkshopFileAction m_eAction; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t +{ + public EResult m_eResult; + public EWorkshopFileAction m_eAction; + public int m_nResultsReturned; + public int m_nTotalResultCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + public ulong[] m_rgPublishedFileId; //ulong[50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] + public uint[] m_rgRTimeUpdated; //uint[50] +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStoragePublishFileProgress_t +{ + public double m_dPercentFile; + public bool m_bPreview; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStoragePublishedFileUpdated_t +{ + public ulong m_nPublishedFileId; + public uint m_nAppID; + public ulong m_hFile; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageFileWriteAsyncComplete_t +{ + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct RemoteStorageFileReadAsyncComplete_t +{ + public ulong m_hFileReadAsync; + public EResult m_eResult; + public uint m_nOffset; + public uint m_cubRead; +} +[StructLayout(LayoutKind.Sequential)] public struct LeaderboardEntry_t +{ + public ulong m_steamIDUser; + public int m_nGlobalRank; + public int m_nScore; + public int m_cDetails; + public ulong m_hUGC; +} +[StructLayout(LayoutKind.Sequential)] public struct UserStatsReceived_t +{ + public ulong m_nGameID; + public EResult m_eResult; + public ulong m_steamIDUser; +} +[StructLayout(LayoutKind.Sequential)] public struct UserStatsStored_t +{ + public ulong m_nGameID; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct UserAchievementStored_t +{ + public ulong m_nGameID; + public bool m_bGroupAchievement; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchAchievementName; //char[128] + public uint m_nCurProgress; + public uint m_nMaxProgress; +} +[StructLayout(LayoutKind.Sequential)] public struct LeaderboardFindResult_t +{ + public ulong m_hSteamLeaderboard; + public byte m_bLeaderboardFound; +} +[StructLayout(LayoutKind.Sequential)] public struct LeaderboardScoresDownloaded_t +{ + public ulong m_hSteamLeaderboard; + public ulong m_hSteamLeaderboardEntries; + public int m_cEntryCount; +} +[StructLayout(LayoutKind.Sequential)] public struct LeaderboardScoreUploaded_t +{ + public byte m_bSuccess; + public ulong m_hSteamLeaderboard; + public int m_nScore; + public byte m_bScoreChanged; + public int m_nGlobalRankNew; + public int m_nGlobalRankPrevious; +} +[StructLayout(LayoutKind.Sequential)] public struct NumberOfCurrentPlayers_t +{ + public byte m_bSuccess; + public int m_cPlayers; +} +[StructLayout(LayoutKind.Sequential)] public struct UserStatsUnloaded_t +{ + public ulong m_steamIDUser; +} +[StructLayout(LayoutKind.Sequential)] public struct UserAchievementIconFetched_t +{ + public ulong m_nGameID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchAchievementName; //char[128] + public bool m_bAchieved; + public int m_nIconHandle; +} +[StructLayout(LayoutKind.Sequential)] public struct GlobalAchievementPercentagesReady_t +{ + public ulong m_nGameID; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct LeaderboardUGCSet_t +{ + public EResult m_eResult; + public ulong m_hSteamLeaderboard; +} +[StructLayout(LayoutKind.Sequential)] public struct PS3TrophiesInstalled_t +{ + public ulong m_nGameID; + public EResult m_eResult; + public ulong m_ulRequiredDiskSpace; +} +[StructLayout(LayoutKind.Sequential)] public struct GlobalStatsReceived_t +{ + public ulong m_nGameID; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct DlcInstalled_t +{ + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct RegisterActivationCodeResponse_t +{ + public ERegisterActivationCodeResult m_eResult; + public uint m_unPackageRegistered; +} +[StructLayout(LayoutKind.Sequential)] public struct AppProofOfPurchaseKeyResponse_t +{ + public EResult m_eResult; + public uint m_nAppID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchKey; //char[64] +} +[StructLayout(LayoutKind.Sequential)] public struct P2PSessionState_t +{ + public byte m_bConnectionActive; + public byte m_bConnecting; + public byte m_eP2PSessionError; + public byte m_bUsingRelay; + public int m_nBytesQueuedForSend; + public int m_nPacketsQueuedForSend; + public uint m_nRemoteIP; + public char m_nRemotePort; +} +[StructLayout(LayoutKind.Sequential)] public struct P2PSessionRequest_t +{ + public ulong m_steamIDRemote; +} +[StructLayout(LayoutKind.Sequential)] public struct P2PSessionConnectFail_t +{ + public ulong m_steamIDRemote; + public byte m_eP2PSessionError; +} +[StructLayout(LayoutKind.Sequential)] public struct SocketStatusCallback_t +{ + public uint m_hSocket; + public uint m_hListenSocket; + public ulong m_steamIDRemote; + public int m_eSNetSocketState; +} +[StructLayout(LayoutKind.Sequential)] public struct ScreenshotReady_t +{ + public uint m_hLocal; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct VolumeHasChanged_t +{ + public float m_flNewVolume; +} +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsShuffled_t +{ + public bool m_bShuffled; +} +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsLooped_t +{ + public bool m_bLooped; +} +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsVolume_t +{ + public float m_flNewVolume; +} +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerSelectsQueueEntry_t +{ + public int nID; +} +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerSelectsPlaylistEntry_t +{ + public int nID; +} +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsPlayingRepeatStatus_t +{ + public int m_nPlayingRepeatStatus; +} +[StructLayout(LayoutKind.Sequential)] public struct HTTPRequestCompleted_t +{ + public uint m_hRequest; + public ulong m_ulContextValue; + public bool m_bRequestSuccessful; + public EHTTPStatusCode m_eStatusCode; + public uint m_unBodySize; +} +[StructLayout(LayoutKind.Sequential)] public struct HTTPRequestHeadersReceived_t +{ + public uint m_hRequest; + public ulong m_ulContextValue; +} +[StructLayout(LayoutKind.Sequential)] public struct HTTPRequestDataReceived_t +{ + public uint m_hRequest; + public ulong m_ulContextValue; + public uint m_cOffset; + public uint m_cBytesReceived; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamUnifiedMessagesSendMethodResult_t +{ + public ulong m_hHandle; + public ulong m_unContext; + public EResult m_eResult; + public uint m_unResponseSize; +} +[StructLayout(LayoutKind.Sequential)] public struct ControllerAnalogActionData_t +{ + public EControllerSourceMode eMode; + public float x; + public float y; + public bool bActive; +} +[StructLayout(LayoutKind.Sequential)] public struct ControllerDigitalActionData_t +{ + public bool bState; + public bool bActive; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamUGCDetails_t +{ + public ulong m_nPublishedFileId; + public EResult m_eResult; + public EWorkshopFileType m_eFileType; + public uint m_nCreatorAppID; + public uint m_nConsumerAppID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchTitle; //char[129] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchDescription; //char[8000] + public ulong m_ulSteamIDOwner; + public uint m_rtimeCreated; + public uint m_rtimeUpdated; + public uint m_rtimeAddedToUserList; + public ERemoteStoragePublishedFileVisibility m_eVisibility; + public bool m_bBanned; + public bool m_bAcceptedForUse; + public bool m_bTagsTruncated; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchTags; //char[1025] + public ulong m_hFile; + public ulong m_hPreviewFile; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260, ArraySubType = UnmanagedType.I1)] + public char[] m_pchFileName; //char[260] + public int m_nFileSize; + public int m_nPreviewFileSize; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchURL; //char[256] + public uint m_unVotesUp; + public uint m_unVotesDown; + public float m_flScore; + public uint m_unNumChildren; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamUGCQueryCompleted_t +{ + public ulong m_handle; + public EResult m_eResult; + public uint m_unNumResultsReturned; + public uint m_unTotalMatchingResults; + public bool m_bCachedData; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamUGCRequestUGCDetailsResult_t +{ + public SteamUGCDetails_t m_details; + public bool m_bCachedData; +} +[StructLayout(LayoutKind.Sequential)] public struct CreateItemResult_t +{ + public EResult m_eResult; + public ulong m_nPublishedFileId; + public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +} +[StructLayout(LayoutKind.Sequential)] public struct SubmitItemUpdateResult_t +{ + public EResult m_eResult; + public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +} +[StructLayout(LayoutKind.Sequential)] public struct DownloadItemResult_t +{ + public uint m_unAppID; + public ulong m_nPublishedFileId; + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct UserFavoriteItemsListChanged_t +{ + public ulong m_nPublishedFileId; + public EResult m_eResult; + public bool m_bWasAddRequest; +} +[StructLayout(LayoutKind.Sequential)] public struct SetUserItemVoteResult_t +{ + public ulong m_nPublishedFileId; + public EResult m_eResult; + public bool m_bVoteUp; +} +[StructLayout(LayoutKind.Sequential)] public struct GetUserItemVoteResult_t +{ + public ulong m_nPublishedFileId; + public EResult m_eResult; + public bool m_bVotedUp; + public bool m_bVotedDown; + public bool m_bVoteSkipped; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamAppInstalled_t +{ + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamAppUninstalled_t +{ + public uint m_nAppID; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_BrowserReady_t +{ + public uint unBrowserHandle; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_NeedsPaint_t +{ + public uint unBrowserHandle; + public string pBGRA; + public uint unWide; + public uint unTall; + public uint unUpdateX; + public uint unUpdateY; + public uint unUpdateWide; + public uint unUpdateTall; + public uint unScrollX; + public uint unScrollY; + public float flPageScale; + public uint unPageSerial; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_StartRequest_t +{ + public uint unBrowserHandle; + public string pchURL; + public string pchTarget; + public string pchPostData; + public bool bIsRedirect; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_CloseBrowser_t +{ + public uint unBrowserHandle; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_URLChanged_t +{ + public uint unBrowserHandle; + public string pchURL; + public string pchPostData; + public bool bIsRedirect; + public string pchPageTitle; + public bool bNewNavigation; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_FinishedRequest_t +{ + public uint unBrowserHandle; + public string pchURL; + public string pchPageTitle; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_OpenLinkInNewTab_t +{ + public uint unBrowserHandle; + public string pchURL; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_ChangedTitle_t +{ + public uint unBrowserHandle; + public string pchTitle; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_SearchResults_t +{ + public uint unBrowserHandle; + public uint unResults; + public uint unCurrentMatch; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_CanGoBackAndForward_t +{ + public uint unBrowserHandle; + public bool bCanGoBack; + public bool bCanGoForward; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_HorizontalScroll_t +{ + public uint unBrowserHandle; + public uint unScrollMax; + public uint unScrollCurrent; + public float flPageScale; + public bool bVisible; + public uint unPageSize; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_VerticalScroll_t +{ + public uint unBrowserHandle; + public uint unScrollMax; + public uint unScrollCurrent; + public float flPageScale; + public bool bVisible; + public uint unPageSize; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_LinkAtPosition_t +{ + public uint unBrowserHandle; + public uint x; + public uint y; + public string pchURL; + public bool bInput; + public bool bLiveLink; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_JSAlert_t +{ + public uint unBrowserHandle; + public string pchMessage; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_JSConfirm_t +{ + public uint unBrowserHandle; + public string pchMessage; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_FileOpenDialog_t +{ + public uint unBrowserHandle; + public string pchTitle; + public string pchInitialFile; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_NewWindow_t +{ + public uint unBrowserHandle; + public string pchURL; + public uint unX; + public uint unY; + public uint unWide; + public uint unTall; + public uint unNewWindow_BrowserHandle; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_SetCursor_t +{ + public uint unBrowserHandle; + public uint eMouseCursor; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_StatusText_t +{ + public uint unBrowserHandle; + public string pchMsg; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_ShowToolTip_t +{ + public uint unBrowserHandle; + public string pchMsg; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_UpdateToolTip_t +{ + public uint unBrowserHandle; + public string pchMsg; +} +[StructLayout(LayoutKind.Sequential)] public struct HTML_HideToolTip_t +{ + public uint unBrowserHandle; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamItemDetails_t +{ + public ulong m_itemId; + public int m_iDefinition; + public char m_unQuantity; + public char m_unFlags; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamInventoryResultReady_t +{ + public int m_handle; + public EResult m_result; +} +[StructLayout(LayoutKind.Sequential)] public struct SteamInventoryFullUpdate_t +{ + public int m_handle; +} +[StructLayout(LayoutKind.Sequential)] public struct BroadcastUploadStop_t +{ + public EBroadcastUploadResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct GetVideoURLResult_t +{ + public EResult m_eResult; + public uint m_unVideoAppID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchURL; //char[256] +} +[StructLayout(LayoutKind.Sequential)] public struct CCallbackBase +{ + public byte m_nCallbackFlags; + public int m_iCallback; +} +[StructLayout(LayoutKind.Sequential)] public struct CCallResult +{ + public ulong m_hAPICall; + public IntPtr m_pObj; + public IntPtr m_Func; +} +[StructLayout(LayoutKind.Sequential)] public struct CCallback +{ + public IntPtr m_pObj; + public IntPtr m_Func; +} +[StructLayout(LayoutKind.Sequential)] public struct CSteamAPIContext +{ + public ISteamUser m_pSteamUser; + public ISteamFriends m_pSteamFriends; + public ISteamUtils m_pSteamUtils; + public ISteamMatchmaking m_pSteamMatchmaking; + public ISteamUserStats m_pSteamUserStats; + public ISteamApps m_pSteamApps; + public ISteamMatchmakingServers m_pSteamMatchmakingServers; + public ISteamNetworking m_pSteamNetworking; + public ISteamRemoteStorage m_pSteamRemoteStorage; + public ISteamScreenshots m_pSteamScreenshots; + public ISteamHTTP m_pSteamHTTP; + public ISteamUnifiedMessages m_pSteamUnifiedMessages; + public ISteamController m_pController; + public ISteamUGC m_pSteamUGC; + public ISteamAppList m_pSteamAppList; + public ISteamMusic m_pSteamMusic; + public ISteamMusicRemote m_pSteamMusicRemote; + public ISteamHTMLSurface m_pSteamHTMLSurface; + public ISteamInventory m_pSteamInventory; + public ISteamVideo m_pSteamVideo; +} +[StructLayout(LayoutKind.Sequential)] public struct GSClientApprove_t +{ + public ulong m_SteamID; + public ulong m_OwnerSteamID; +} +[StructLayout(LayoutKind.Sequential)] public struct GSClientDeny_t +{ + public ulong m_SteamID; + public EDenyReason m_eDenyReason; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] + public char[] m_rgchOptionalText; //char[128] +} +[StructLayout(LayoutKind.Sequential)] public struct GSClientKick_t +{ + public ulong m_SteamID; + public EDenyReason m_eDenyReason; +} +[StructLayout(LayoutKind.Sequential)] public struct GSClientAchievementStatus_t +{ + public ulong m_SteamID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] + public char[] m_pchAchievement; //char[128] + public bool m_bUnlocked; +} +[StructLayout(LayoutKind.Sequential)] public struct GSPolicyResponse_t +{ + public byte m_bSecure; +} +[StructLayout(LayoutKind.Sequential)] public struct GSGameplayStats_t +{ + public EResult m_eResult; + public int m_nRank; + public uint m_unTotalConnects; + public uint m_unTotalMinutesPlayed; +} +[StructLayout(LayoutKind.Sequential)] public struct GSClientGroupStatus_t +{ + public ulong m_SteamIDUser; + public ulong m_SteamIDGroup; + public bool m_bMember; + public bool m_bOfficer; +} +[StructLayout(LayoutKind.Sequential)] public struct GSReputation_t +{ + public EResult m_eResult; + public uint m_unReputationScore; + public bool m_bBanned; + public uint m_unBannedIP; + public char m_usBannedPort; + public ulong m_ulBannedGameID; + public uint m_unBanExpires; +} +[StructLayout(LayoutKind.Sequential)] public struct AssociateWithClanResult_t +{ + public EResult m_eResult; +} +[StructLayout(LayoutKind.Sequential)] public struct ComputeNewPlayerCompatibilityResult_t +{ + public EResult m_eResult; + public int m_cPlayersThatDontLikeCandidate; + public int m_cPlayersThatCandidateDoesntLike; + public int m_cClanPlayersThatDontLikeCandidate; + public ulong m_SteamIDCandidate; +} +[StructLayout(LayoutKind.Sequential)] public struct GSStatsReceived_t +{ + public EResult m_eResult; + public ulong m_steamIDUser; +} +[StructLayout(LayoutKind.Sequential)] public struct GSStatsStored_t +{ + public EResult m_eResult; + public ulong m_steamIDUser; +} +[StructLayout(LayoutKind.Sequential)] public struct GSStatsUnloaded_t +{ + public ulong m_steamIDUser; +} + +public class SteamAPI +{ +public static void Init(uint appId) +{ +SteamAPIInterop.SteamAPI_RestartAppIfNecessary (appId); +SteamAPIInterop.SteamAPI_Init (); +} + +public static void RunCallbacks() +{ +SteamAPIInterop.SteamAPI_RunCallbacks (); +} + +public static void RegisterCallback(IntPtr pCallback, int iCallback) +{ +SteamAPIInterop.SteamAPI_RegisterCallback (pCallback, iCallback); +} + +public static void UnregisterCallback(IntPtr pCallback) +{ +SteamAPIInterop.SteamAPI_UnregisterCallback (pCallback); +} + +public const int k_iSteamUserCallbacks = 100; +public const int k_iSteamGameServerCallbacks = 200; +public const int k_iSteamFriendsCallbacks = 300; +public const int k_iSteamBillingCallbacks = 400; +public const int k_iSteamMatchmakingCallbacks = 500; +public const int k_iSteamContentServerCallbacks = 600; +public const int k_iSteamUtilsCallbacks = 700; +public const int k_iClientFriendsCallbacks = 800; +public const int k_iClientUserCallbacks = 900; +public const int k_iSteamAppsCallbacks = 1000; +public const int k_iSteamUserStatsCallbacks = 1100; +public const int k_iSteamNetworkingCallbacks = 1200; +public const int k_iClientRemoteStorageCallbacks = 1300; +public const int k_iClientDepotBuilderCallbacks = 1400; +public const int k_iSteamGameServerItemsCallbacks = 1500; +public const int k_iClientUtilsCallbacks = 1600; +public const int k_iSteamGameCoordinatorCallbacks = 1700; +public const int k_iSteamGameServerStatsCallbacks = 1800; +public const int k_iSteam2AsyncCallbacks = 1900; +public const int k_iSteamGameStatsCallbacks = 2000; +public const int k_iClientHTTPCallbacks = 2100; +public const int k_iClientScreenshotsCallbacks = 2200; +public const int k_iSteamScreenshotsCallbacks = 2300; +public const int k_iClientAudioCallbacks = 2400; +public const int k_iClientUnifiedMessagesCallbacks = 2500; +public const int k_iSteamStreamLauncherCallbacks = 2600; +public const int k_iClientControllerCallbacks = 2700; +public const int k_iSteamControllerCallbacks = 2800; +public const int k_iClientParentalSettingsCallbacks = 2900; +public const int k_iClientDeviceAuthCallbacks = 3000; +public const int k_iClientNetworkDeviceManagerCallbacks = 3100; +public const int k_iClientMusicCallbacks = 3200; +public const int k_iClientRemoteClientManagerCallbacks = 3300; +public const int k_iClientUGCCallbacks = 3400; +public const int k_iSteamStreamClientCallbacks = 3500; +public const int k_IClientProductBuilderCallbacks = 3600; +public const int k_iClientShortcutsCallbacks = 3700; +public const int k_iClientRemoteControlManagerCallbacks = 3800; +public const int k_iSteamAppListCallbacks = 3900; +public const int k_iSteamMusicCallbacks = 4000; +public const int k_iSteamMusicRemoteCallbacks = 4100; +public const int k_iClientVRCallbacks = 4200; +public const int k_iClientReservedCallbacks = 4300; +public const int k_iSteamReservedCallbacks = 4400; +public const int k_iSteamHTMLSurfaceCallbacks = 4500; +public const int k_iClientVideoCallbacks = 4600; +public const int k_iClientInventoryCallbacks = 4700; +public const int k_cchPersonaNameMax = 128; +public const int k_cwchPersonaNameMax = 32; +public const int k_cchMaxRichPresenceKeys = 20; +public const int k_cchMaxRichPresenceKeyLength = 64; +public const int k_cchMaxRichPresenceValueLength = 256; +public const int k_cchStatNameMax = 128; +public const int k_cchLeaderboardNameMax = 128; +public const int k_cLeaderboardDetailsMax = 64; +public const const ClientUnifiedMessageHandle k_InvalidUnifiedMessageHandle = 0; +public const const SteamItemInstanceID_t k_SteamItemInstanceIDInvalid = 18446744073709551615; +public const const SteamInventoryResult_t k_SteamInventoryResultInvalid = -1; +public static ISteamClient SteamClient() +{ +return new CSteamClient(SteamAPIInterop.SteamClient()); +} + +public static ISteamUser SteamUser() +{ +return new CSteamUser(SteamAPIInterop.SteamUser()); +} + +public static ISteamFriends SteamFriends() +{ +return new CSteamFriends(SteamAPIInterop.SteamFriends()); +} + +public static ISteamUtils SteamUtils() +{ +return new CSteamUtils(SteamAPIInterop.SteamUtils()); +} + +public static ISteamMatchmaking SteamMatchmaking() +{ +return new CSteamMatchmaking(SteamAPIInterop.SteamMatchmaking()); +} + +public static ISteamMatchmakingServerListResponse SteamMatchmakingServerListResponse() +{ +return new CSteamMatchmakingServerListResponse(SteamAPIInterop.SteamMatchmakingServerListResponse()); +} + +public static ISteamMatchmakingPingResponse SteamMatchmakingPingResponse() +{ +return new CSteamMatchmakingPingResponse(SteamAPIInterop.SteamMatchmakingPingResponse()); +} + +public static ISteamMatchmakingPlayersResponse SteamMatchmakingPlayersResponse() +{ +return new CSteamMatchmakingPlayersResponse(SteamAPIInterop.SteamMatchmakingPlayersResponse()); +} + +public static ISteamMatchmakingRulesResponse SteamMatchmakingRulesResponse() +{ +return new CSteamMatchmakingRulesResponse(SteamAPIInterop.SteamMatchmakingRulesResponse()); +} + +public static ISteamMatchmakingServers SteamMatchmakingServers() +{ +return new CSteamMatchmakingServers(SteamAPIInterop.SteamMatchmakingServers()); +} + +public static ISteamRemoteStorage SteamRemoteStorage() +{ +return new CSteamRemoteStorage(SteamAPIInterop.SteamRemoteStorage()); +} + +public static ISteamUserStats SteamUserStats() +{ +return new CSteamUserStats(SteamAPIInterop.SteamUserStats()); +} + +public static ISteamApps SteamApps() +{ +return new CSteamApps(SteamAPIInterop.SteamApps()); +} + +public static ISteamNetworking SteamNetworking() +{ +return new CSteamNetworking(SteamAPIInterop.SteamNetworking()); +} + +public static ISteamScreenshots SteamScreenshots() +{ +return new CSteamScreenshots(SteamAPIInterop.SteamScreenshots()); +} + +public static ISteamMusic SteamMusic() +{ +return new CSteamMusic(SteamAPIInterop.SteamMusic()); +} + +public static ISteamMusicRemote SteamMusicRemote() +{ +return new CSteamMusicRemote(SteamAPIInterop.SteamMusicRemote()); +} + +public static ISteamHTTP SteamHTTP() +{ +return new CSteamHTTP(SteamAPIInterop.SteamHTTP()); +} + +public static ISteamUnifiedMessages SteamUnifiedMessages() +{ +return new CSteamUnifiedMessages(SteamAPIInterop.SteamUnifiedMessages()); +} + +public static ISteamController SteamController() +{ +return new CSteamController(SteamAPIInterop.SteamController()); +} + +public static ISteamUGC SteamUGC() +{ +return new CSteamUGC(SteamAPIInterop.SteamUGC()); +} + +public static ISteamAppList SteamAppList() +{ +return new CSteamAppList(SteamAPIInterop.SteamAppList()); +} + +public static ISteamHTMLSurface SteamHTMLSurface() +{ +return new CSteamHTMLSurface(SteamAPIInterop.SteamHTMLSurface()); +} + +public static ISteamInventory SteamInventory() +{ +return new CSteamInventory(SteamAPIInterop.SteamInventory()); +} + +public static ISteamVideo SteamVideo() +{ +return new CSteamVideo(SteamAPIInterop.SteamVideo()); +} + +public static ISteamGameServer SteamGameServer() +{ +return new CSteamGameServer(SteamAPIInterop.SteamGameServer()); +} + +public static ISteamGameServerStats SteamGameServerStats() +{ +return new CSteamGameServerStats(SteamAPIInterop.SteamGameServerStats()); +} + +} + + + +} + diff --git a/public/steam/steam_gameserver.h b/public/steam/steam_gameserver.h index 014f53e66..f58791f00 100644 --- a/public/steam/steam_gameserver.h +++ b/public/steam/steam_gameserver.h @@ -1,143 +1,191 @@ -//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= -// -// Purpose: -// -//============================================================================= - -#ifndef STEAM_GAMESERVER_H -#define STEAM_GAMESERVER_H -#ifdef _WIN32 -#pragma once -#endif - -#include "steam_api.h" -#include "isteamgameserver.h" -#include "isteammasterserverupdater.h" -#include "isteamgameserverstats.h" - -enum EServerMode -{ - eServerModeInvalid = 0, // DO NOT USE - eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list - eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect - eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients -}; - -// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode, -// which means that the game is responsible for sending and receiving UDP packets for the master -// server updater. See references to GameSocketShare in isteammasterserverupdater.h. -// -// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report -// what's running based on that. -#ifdef VERSION_SAFE_STEAM_API_INTERFACES -S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString ); -#else -S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString ); - -S_API ISteamGameServer *SteamGameServer(); -S_API ISteamUtils *SteamGameServerUtils(); -S_API ISteamMasterServerUpdater *SteamMasterServerUpdater(); -S_API ISteamNetworking *SteamGameServerNetworking(); -S_API ISteamGameServerStats *SteamGameServerStats(); -#endif - -S_API void SteamGameServer_Shutdown(); -S_API void SteamGameServer_RunCallbacks(); - -S_API bool SteamGameServer_BSecure(); -S_API uint64 SteamGameServer_GetSteamID(); - -#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam ) - - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steamclient.dll private wrapper functions -// -// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -S_API HSteamPipe SteamGameServer_GetHSteamPipe(); - -#ifdef VERSION_SAFE_STEAM_API_INTERFACES -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that -// lets them each specify the interface versions they are compiled with. -// -// It's important that these stay inlined in the header so the calling module specifies the interface versions -// for whatever Steam API version it has. -//----------------------------------------------------------------------------------------------------------------------------------------------------------// - -S_API HSteamUser SteamGameServer_GetHSteamUser(); - -class CSteamGameServerAPIContext -{ -public: - CSteamGameServerAPIContext(); - void Clear(); - - bool Init(); - - ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; } - ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; } - ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; } - ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; } - ISteamGameServerStats *SteamGameServerStats() { return m_pSteamGameServerStats; } - -private: - ISteamGameServer *m_pSteamGameServer; - ISteamUtils *m_pSteamGameServerUtils; - ISteamMasterServerUpdater *m_pSteamMasterServerUpdater; - ISteamNetworking *m_pSteamGameServerNetworking; - ISteamGameServerStats *m_pSteamGameServerStats; -}; - -inline CSteamGameServerAPIContext::CSteamGameServerAPIContext() -{ - Clear(); -} - -inline void CSteamGameServerAPIContext::Clear() -{ - m_pSteamGameServer = NULL; - m_pSteamGameServerUtils = NULL; - m_pSteamMasterServerUpdater = NULL; - m_pSteamGameServerNetworking = NULL; - m_pSteamGameServerStats = NULL; -} - -S_API ISteamClient *g_pSteamClientGameServer; -// This function must be inlined so the module using steam_api.dll gets the version names they want. -inline bool CSteamGameServerAPIContext::Init() -{ - if ( !g_pSteamClientGameServer ) - return false; - - HSteamUser hSteamUser = SteamGameServer_GetHSteamUser(); - HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe(); - - m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION ); - if ( !m_pSteamGameServer ) - return false; - - m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); - if ( !m_pSteamGameServerUtils ) - return false; - - m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION ); - if ( !m_pSteamMasterServerUpdater ) - return false; - - m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); - if ( !m_pSteamGameServerNetworking ) - return false; - - m_pSteamGameServerStats = g_pSteamClientGameServer->GetISteamGameServerStats( hSteamUser, hSteamPipe, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); - if ( !m_pSteamGameServerStats ) - return false; - - return true; -} - -#endif // VERSION_SAFE_STEAM_API_INTERFACES - - -#endif // STEAM_GAMESERVER_H +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: +// +//============================================================================= + +#ifndef STEAM_GAMESERVER_H +#define STEAM_GAMESERVER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api.h" +#include "isteamgameserver.h" +#include "isteamgameserverstats.h" + +enum EServerMode +{ + eServerModeInvalid = 0, // DO NOT USE + eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list + eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect + eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients +}; + +// Initialize ISteamGameServer interface object, and set server properties which may not be changed. +// +// After calling this function, you should set any additional server parameters, and then +// call ISteamGameServer::LogOnAnonymous() or ISteamGameServer::LogOn() +// +// - usSteamPort is the local port used to communicate with the steam servers. +// - usGamePort is the port that clients will connect to for gameplay. +// - usQueryPort is the port that will manage server browser related duties and info +// pings from clients. If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it +// will use "GameSocketShare" mode, which means that the game is responsible for sending and receiving +// UDP packets for the master server updater. See references to GameSocketShare in isteamgameserver.h. +// - The version string is usually in the form x.x.x.x, and is used by the master server to detect when the +// server is out of date. (Only servers with the latest version will be listed.) +#ifndef _PS3 + +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +#else +S_API bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +#endif + +#else + +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +S_API bool SteamGameServer_InitSafe( const SteamPS3Params_t *ps3Params, uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +#else +S_API bool SteamGameServer_Init( const SteamPS3Params_t *ps3Params, uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +#endif + +#endif + +#ifndef VERSION_SAFE_STEAM_API_INTERFACES +S_API ISteamGameServer *SteamGameServer(); +S_API ISteamUtils *SteamGameServerUtils(); +S_API ISteamNetworking *SteamGameServerNetworking(); +S_API ISteamGameServerStats *SteamGameServerStats(); +S_API ISteamHTTP *SteamGameServerHTTP(); +S_API ISteamInventory *SteamGameServerInventory(); +S_API ISteamUGC *SteamGameServerUGC(); +#endif + +S_API void SteamGameServer_Shutdown(); +S_API void SteamGameServer_RunCallbacks(); + +S_API bool SteamGameServer_BSecure(); +S_API uint64 SteamGameServer_GetSteamID(); + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// These macros are similar to the STEAM_CALLBACK_* macros in steam_api.h, but only trigger for gameserver callbacks +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) + +#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) + + + +#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ + CCallback< thisclass, param, true > var; void func( param *pParam ) + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steamclient.dll private wrapper functions +// +// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +S_API HSteamPipe SteamGameServer_GetHSteamPipe(); + +#ifdef VERSION_SAFE_STEAM_API_INTERFACES +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that +// lets them each specify the interface versions they are compiled with. +// +// It's important that these stay inlined in the header so the calling module specifies the interface versions +// for whatever Steam API version it has. +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +S_API HSteamUser SteamGameServer_GetHSteamUser(); + +class CSteamGameServerAPIContext +{ +public: + CSteamGameServerAPIContext(); + void Clear(); + + bool Init(); + + ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; } + ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; } + ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; } + ISteamGameServerStats *SteamGameServerStats() { return m_pSteamGameServerStats; } + ISteamHTTP *SteamHTTP() { return m_pSteamHTTP; } + ISteamInventory *SteamInventory() { return m_pSteamInventory; } + ISteamUGC *SteamUGC() { return m_pSteamUGC; } + +private: + ISteamGameServer *m_pSteamGameServer; + ISteamUtils *m_pSteamGameServerUtils; + ISteamNetworking *m_pSteamGameServerNetworking; + ISteamGameServerStats *m_pSteamGameServerStats; + ISteamHTTP *m_pSteamHTTP; + ISteamInventory *m_pSteamInventory; + ISteamUGC *m_pSteamUGC; +}; + +inline CSteamGameServerAPIContext::CSteamGameServerAPIContext() +{ + Clear(); +} + +inline void CSteamGameServerAPIContext::Clear() +{ + m_pSteamGameServer = NULL; + m_pSteamGameServerUtils = NULL; + m_pSteamGameServerNetworking = NULL; + m_pSteamGameServerStats = NULL; + m_pSteamHTTP = NULL; + m_pSteamInventory = NULL; + m_pSteamUGC = NULL; +} + +S_API ISteamClient *g_pSteamClientGameServer; +// This function must be inlined so the module using steam_api.dll gets the version names they want. +inline bool CSteamGameServerAPIContext::Init() +{ + if ( !g_pSteamClientGameServer ) + return false; + + HSteamUser hSteamUser = SteamGameServer_GetHSteamUser(); + HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe(); + + m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION ); + if ( !m_pSteamGameServer ) + return false; + + m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); + if ( !m_pSteamGameServerUtils ) + return false; + + m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); + if ( !m_pSteamGameServerNetworking ) + return false; + + m_pSteamGameServerStats = g_pSteamClientGameServer->GetISteamGameServerStats( hSteamUser, hSteamPipe, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); + if ( !m_pSteamGameServerStats ) + return false; + + m_pSteamHTTP = g_pSteamClientGameServer->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); + if ( !m_pSteamHTTP ) + return false; + + m_pSteamInventory = g_pSteamClientGameServer->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION ); + if ( !m_pSteamInventory ) + return false; + + m_pSteamUGC = g_pSteamClientGameServer->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); + if ( !m_pSteamUGC ) + return false; + + return true; +} + +#endif // VERSION_SAFE_STEAM_API_INTERFACES + + +#endif // STEAM_GAMESERVER_H diff --git a/public/steam/steamclientpublic.h b/public/steam/steamclientpublic.h index d9e4db0cc..a90a13cbc 100644 --- a/public/steam/steamclientpublic.h +++ b/public/steam/steamclientpublic.h @@ -1,709 +1,1165 @@ -//========= Copyright © 1996-2004, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#ifndef STEAMCLIENTPUBLIC_H -#define STEAMCLIENTPUBLIC_H -#ifdef _WIN32 -#pragma once -#endif -//lint -save -e1931 -e1927 -e1924 -e613 -e726 - -// This header file defines the interface between the calling application and the code that -// knows how to communicate with the connection manager (CM) from the Steam service - -// This header file is intended to be portable; ideally this 1 header file plus a lib or dll -// is all you need to integrate the client library into some other tree. So please avoid -// including or requiring other header files if possible. This header should only describe the -// interface layer, no need to include anything about the implementation. - -#include "steamtypes.h" - - -// General result codes -enum EResult -{ - k_EResultOK = 1, // success - k_EResultFail = 2, // generic failure - k_EResultNoConnection = 3, // no/failed network connection -// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed - k_EResultInvalidPassword = 5, // password/ticket is invalid - k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere - k_EResultInvalidProtocolVer = 7, // protocol version is incorrect - k_EResultInvalidParam = 8, // a parameter is incorrect - k_EResultFileNotFound = 9, // file was not found - k_EResultBusy = 10, // called method busy - action not taken - k_EResultInvalidState = 11, // called object was in an invalid state - k_EResultInvalidName = 12, // name is invalid - k_EResultInvalidEmail = 13, // email is invalid - k_EResultDuplicateName = 14, // name is not unique - k_EResultAccessDenied = 15, // access is denied - k_EResultTimeout = 16, // operation timed out - k_EResultBanned = 17, // VAC2 banned - k_EResultAccountNotFound = 18, // account not found - k_EResultInvalidSteamID = 19, // steamID is invalid - k_EResultServiceUnavailable = 20, // The requested service is currently unavailable - k_EResultNotLoggedOn = 21, // The user is not logged on - k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party) - k_EResultEncryptionFailure = 23, // Encryption or Decryption failed - k_EResultInsufficientPrivilege = 24, // Insufficient privilege - k_EResultLimitExceeded = 25, // Too much of a good thing - k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes) - k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired - k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again - k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time - k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user - k_EResultIPNotFound = 31, // IP address not found - k_EResultPersistFailed = 32, // failed to write change to the data store - k_EResultLockingFailed = 33, // failed to acquire access lock for this operation - k_EResultLogonSessionReplaced = 34, - k_EResultConnectFailed = 35, - k_EResultHandshakeFailed = 36, - k_EResultIOFailure = 37, - k_EResultRemoteDisconnect = 38, - k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested -}; - -// Result codes to GSHandleClientDeny/Kick -typedef enum -{ - k_EDenyInvalidVersion = 1, - k_EDenyGeneric = 2, - k_EDenyNotLoggedOn = 3, - k_EDenyNoLicense = 4, - k_EDenyCheater = 5, - k_EDenyLoggedInElseWhere = 6, - k_EDenyUnknownText = 7, - k_EDenyIncompatibleAnticheat = 8, - k_EDenyMemoryCorruption = 9, - k_EDenyIncompatibleSoftware = 10, - k_EDenySteamConnectionLost = 11, - k_EDenySteamConnectionError = 12, - k_EDenySteamResponseTimedOut = 13, - k_EDenySteamValidationStalled = 14, -} EDenyReason; - -// Steam universes. Each universe is a self-contained Steam instance. -enum EUniverse -{ - k_EUniverseInvalid = 0, - k_EUniversePublic = 1, - k_EUniverseBeta = 2, - k_EUniverseInternal = 3, - k_EUniverseDev = 4, - k_EUniverseRC = 5, - - k_EUniverseMax -}; - -// Steam account types -enum EAccountType -{ - k_EAccountTypeInvalid = 0, - k_EAccountTypeIndividual = 1, // single user account - k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account - k_EAccountTypeGameServer = 3, // game server account - k_EAccountTypeAnonGameServer = 4, // anonymous game server account - k_EAccountTypePending = 5, // pending - k_EAccountTypeContentServer = 6, // content server - k_EAccountTypeClan = 7, - k_EAccountTypeChat = 8, - k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff - - // Max of 16 items in this field - k_EAccountTypeMax -}; - - -//----------------------------------------------------------------------------- -// types of user game stats fields -// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE -//----------------------------------------------------------------------------- -enum ESteamUserStatType -{ - k_ESteamUserStatTypeINVALID = 0, - k_ESteamUserStatTypeINT = 1, - k_ESteamUserStatTypeFLOAT = 2, - // Read as FLOAT, set with count / session length - k_ESteamUserStatTypeAVGRATE = 3, - k_ESteamUserStatTypeACHIEVEMENTS = 4, - k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5, -}; - - -//----------------------------------------------------------------------------- -// Purpose: Chat Entry Types (previously was only friend-to-friend message types) -//----------------------------------------------------------------------------- -enum EChatEntryType -{ - k_EChatEntryTypeChatMsg = 1, // Normal text message from another user - k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat) - k_EChatEntryTypeInviteGame = 3, // DEPRECATED Invite from other user into that users current game - k_EChatEntryTypeEmote = 4, // text emote message - // Above are previous FriendMsgType entries, now merged into more generic chat entry types -}; - - -//----------------------------------------------------------------------------- -// Purpose: Chat Room Enter Responses -//----------------------------------------------------------------------------- -enum EChatRoomEnterResponse -{ - k_EChatRoomEnterResponseSuccess = 1, // Success - k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed) - k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat - k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size - k_EChatRoomEnterResponseError = 5, // Unexpected Error - k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join -}; - - -typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath ); -typedef bool (*PFNLegacyKeyInstalled)(); - - -#pragma pack( push, 1 ) - -// Steam ID structure (64 bits total) -class CSteamID -{ -public: - - //----------------------------------------------------------------------------- - // Purpose: Constructor - //----------------------------------------------------------------------------- - CSteamID() - { - m_unAccountID = 0; - m_EAccountType = k_EAccountTypeInvalid; - m_EUniverse = k_EUniverseInvalid; - m_unAccountInstance = 0; - } - - - //----------------------------------------------------------------------------- - // Purpose: Constructor - // Input : unAccountID - 32-bit account ID - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) - { - Set( unAccountID, eUniverse, eAccountType ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Constructor - // Input : unAccountID - 32-bit account ID - // unAccountInstance - instance - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType ) - { -#if defined(_SERVER) && defined(Assert) - Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1 -#endif // _SERVER - InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Constructor - // Input : ulSteamID - 64-bit representation of a Steam ID - // Note: Will not accept a uint32 or int32 as input, as that is a probable mistake. - // See the stubbed out overloads in the private: section for more info. - //----------------------------------------------------------------------------- - CSteamID( uint64 ulSteamID ) - { - SetFromUint64( ulSteamID ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Sets parameters for steam ID - // Input : unAccountID - 32-bit account ID - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) - { - m_unAccountID = unAccountID; - m_EUniverse = eUniverse; - m_EAccountType = eAccountType; - m_unAccountInstance = 1; - } - - - //----------------------------------------------------------------------------- - // Purpose: Sets parameters for steam ID - // Input : unAccountID - 32-bit account ID - // eUniverse - Universe this account belongs to - // eAccountType - Type of account - //----------------------------------------------------------------------------- - void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType ) - { - m_unAccountID = unAccountID; - m_EUniverse = eUniverse; - m_EAccountType = eAccountType; - m_unAccountInstance = unInstance; - } - - - //----------------------------------------------------------------------------- - // Purpose: Initializes a steam ID from its 52 bit parts and universe/type - // Input : ulIdentifier - 52 bits of goodness - //----------------------------------------------------------------------------- - void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType ) - { - m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits - m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits - m_EUniverse = eUniverse; - m_EAccountType = eAccountType; - } - - - //----------------------------------------------------------------------------- - // Purpose: Initializes a steam ID from its 64-bit representation - // Input : ulSteamID - 64-bit representation of a Steam ID - //----------------------------------------------------------------------------- - void SetFromUint64( uint64 ulSteamID ) - { - m_unAccountID = ( ulSteamID & 0xFFFFFFFF ); // account ID is low 32 bits - m_unAccountInstance = ( ( ulSteamID >> 32 ) & 0xFFFFF ); // account instance is next 20 bits - - m_EAccountType = ( EAccountType ) ( ( ulSteamID >> 52 ) & 0xF ); // type is next 4 bits - m_EUniverse = ( EUniverse ) ( ( ulSteamID >> 56 ) & 0xFF ); // universe is next 8 bits - } - - -#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H ) - //----------------------------------------------------------------------------- - // Purpose: Initializes a steam ID from a Steam2 ID structure - // Input: pTSteamGlobalUserID - Steam2 ID to convert - // eUniverse - universe this ID belongs to - //----------------------------------------------------------------------------- - void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse ) - { - m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + - pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits; - m_EUniverse = eUniverse; // set the universe - m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual - m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1 - } - - //----------------------------------------------------------------------------- - // Purpose: Fills out a Steam2 ID structure - // Input: pTSteamGlobalUserID - Steam2 ID to write to - //----------------------------------------------------------------------------- - void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const - { - // only individual accounts have any meaning in Steam 2, only they can be mapped - // Assert( m_EAccountType == k_EAccountTypeIndividual ); - - pTSteamGlobalUserID->m_SteamInstanceID = 0; - pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_unAccountID % 2; - pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_unAccountID / 2; - } -#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H ) - - //----------------------------------------------------------------------------- - // Purpose: Converts steam ID to its 64-bit representation - // Output : 64-bit representation of a Steam ID - //----------------------------------------------------------------------------- - uint64 ConvertToUint64() const - { - return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ( ( (uint64) m_EAccountType ) << 52 ) + - ( ( (uint64) m_unAccountInstance ) << 32 ) + m_unAccountID ); - } - - - //----------------------------------------------------------------------------- - // Purpose: Converts the static parts of a steam ID to a 64-bit representation. - // For multiseat accounts, all instances of that account will have the - // same static account key, so they can be grouped together by the static - // account key. - // Output : 64-bit static account key - //----------------------------------------------------------------------------- - uint64 GetStaticAccountKey() const - { - // note we do NOT include the account instance (which is a dynamic property) in the static account key - return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ((uint64) m_EAccountType << 52 ) + m_unAccountID ); - } - - - //----------------------------------------------------------------------------- - // Purpose: create an anonymous game server login to be filled in by the AM - //----------------------------------------------------------------------------- - void CreateBlankAnonLogon( EUniverse eUniverse ) - { - m_unAccountID = 0; - m_EAccountType = k_EAccountTypeAnonGameServer; - m_EUniverse = eUniverse; - m_unAccountInstance = 0; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this an anonymous game server login that will be filled in? - //----------------------------------------------------------------------------- - bool BBlankAnonAccount() const - { - return m_unAccountID == 0 && - m_EAccountType == k_EAccountTypeAnonGameServer && - m_unAccountInstance == 0; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a game server account id? - //----------------------------------------------------------------------------- - bool BGameServerAccount() const - { - return m_EAccountType == k_EAccountTypeGameServer || m_EAccountType == k_EAccountTypeAnonGameServer; - } - - //----------------------------------------------------------------------------- - // Purpose: Is this a content server account id? - //----------------------------------------------------------------------------- - bool BContentServerAccount() const - { - return m_EAccountType == k_EAccountTypeContentServer; - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this a clan account id? - //----------------------------------------------------------------------------- - bool BClanAccount() const - { - return m_EAccountType == k_EAccountTypeClan; - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this a chat account id? - //----------------------------------------------------------------------------- - bool BChatAccount() const - { - return m_EAccountType == k_EAccountTypeChat; - } - - - //----------------------------------------------------------------------------- - // Purpose: Is this an individual user account id? - //----------------------------------------------------------------------------- - bool BIndividualAccount() const - { - return m_EAccountType == k_EAccountTypeIndividual; - } - - - // simple accessors - void SetAccountID( uint32 unAccountID ) { m_unAccountID = unAccountID; } - uint32 GetAccountID() const { return m_unAccountID; } - uint32 GetUnAccountInstance() const { return m_unAccountInstance; } - EAccountType GetEAccountType() const { return ( EAccountType ) m_EAccountType; } - EUniverse GetEUniverse() const { return m_EUniverse; } - void SetEUniverse( EUniverse eUniverse ) { m_EUniverse = eUniverse; } - bool IsValid() const { return ( m_EAccountType != k_EAccountTypeInvalid && m_EUniverse != k_EUniverseInvalid ); } - - // this set of functions is hidden, will be moved out of class - explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid ); - const char * Render() const; // renders this steam ID to string - static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string - - void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse ); - bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse ); - - bool operator==( const CSteamID &val ) const - { - return ( ( val.m_unAccountID == m_unAccountID ) && ( val.m_unAccountInstance == m_unAccountInstance ) - && ( val.m_EAccountType == m_EAccountType ) && ( val.m_EUniverse == m_EUniverse ) ); - } - - bool operator!=( const CSteamID &val ) const { return !operator==( val ); } - bool operator<( const CSteamID &val ) const { return ConvertToUint64() < val.ConvertToUint64(); } - - // DEBUG function - bool BValidExternalSteamID() const; - -private: - // These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID. - // If you get a compiler error about an ambiguous constructor/function then it may be because you're - // passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID - // using the correct Universe and account Type/Instance values. - CSteamID( uint32 ); - CSteamID( int32 ); - -#ifdef _WIN32 -#pragma warning(push) -#pragma warning(disable:4201) // nameless union is nonstandard - // 64 bits total - union - { - struct - { -#endif - uint32 m_unAccountID : 32; // unique account identifier - unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only) - unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference - EUniverse m_EUniverse : 8; // universe this account belongs to -#ifdef _WIN32 - }; - - uint64 m_unAll64Bits; - }; -#pragma warning(pop) // no more anonymous unions until next time -#endif -}; - -const int k_unSteamAccountIDMask = 0xFFFFFFFF; -const int k_unSteamAccountInstanceMask = 0x000FFFFF; - - -// Special flags for Chat accounts - they go in the top 8 bits -// of the steam ID's "instance", leaving 12 for the actual instances -enum EChatSteamIDInstanceFlags -{ - k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags - - k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit - k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc - - // Max of 8 flags -}; - - -// generic invalid CSteamID -const CSteamID k_steamIDNil; - -// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol -// to provide its steamID -const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ); -// This steamID comes from a user game connection to an sv_lan GS -const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid ); -// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized -// its steam3 component and started logging on. -const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ); - - -#ifdef STEAM -// Returns the matching chat steamID, with the default instance of 0 -// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance -CSteamID ChatIDFromSteamID( CSteamID &steamID ); -// Returns the matching clan steamID, with the default instance of 0 -// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance -CSteamID ClanIDFromSteamID( CSteamID &steamID ); -// Asserts steamID type before conversion -CSteamID ChatIDFromClanID( CSteamID &steamIDClan ); -// Asserts steamID type before conversion -CSteamID ClanIDFromChatID( CSteamID &steamIDChat ); - -#endif // _STEAM - - -//----------------------------------------------------------------------------- -// Purpose: encapsulates an appID/modID pair -//----------------------------------------------------------------------------- -class CGameID -{ -public: - CGameID() - { - m_ulGameID = 0; - } - - explicit CGameID( uint64 ulGameID ) - { - m_ulGameID = ulGameID; - } - - explicit CGameID( int32 nAppID ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = nAppID; - } - - explicit CGameID( uint32 nAppID ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = nAppID; - } - - CGameID( uint32 nAppID, uint32 nModID ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = nAppID; - m_gameID.m_nModID = nModID; - m_gameID.m_nType = k_EGameIDTypeGameMod; - } - - // Hidden functions used only by Steam - explicit CGameID( const char *pchGameID ); - char * Render() const; // renders this Game ID to string - static char * Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string - - // must include checksum_crc.h first to get this functionality -#if defined( CHECKSUM_CRC_H ) - CGameID( uint32 nAppID, const char *pchModPath ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = nAppID; - m_gameID.m_nType = k_EGameIDTypeGameMod; - - char rgchModDir[MAX_PATH]; - Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) ); - CRC32_t crc32; - CRC32_Init( &crc32 ); - CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) ); - CRC32_Final( &crc32 ); - - // set the high-bit on the mod-id - // reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique - // replacement for appID's - m_gameID.m_nModID = crc32 | (0x80000000); - } - - CGameID( const char *pchExePath, const char *pchAppName ) - { - m_ulGameID = 0; - m_gameID.m_nAppID = 0; - m_gameID.m_nType = k_EGameIDTypeShortcut; - - CRC32_t crc32; - CRC32_Init( &crc32 ); - CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) ); - CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) ); - CRC32_Final( &crc32 ); - - // set the high-bit on the mod-id - // reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique - // replacement for appID's - m_gameID.m_nModID = crc32 | (0x80000000); - } -#endif - - void SetAsShortcut() - { - m_gameID.m_nAppID = 0; - m_gameID.m_nType = k_EGameIDTypeShortcut; - } - - void SetAsP2PFile() - { - m_gameID.m_nAppID = 0; - m_gameID.m_nType = k_EGameIDTypeP2P; - } - - uint64 ToUint64() const - { - return m_ulGameID; - } - - uint64 *GetUint64Ptr() - { - return &m_ulGameID; - } - - bool IsMod() const - { - return ( m_gameID.m_nType == k_EGameIDTypeGameMod ); - } - - bool IsShortcut() const - { - return ( m_gameID.m_nType == k_EGameIDTypeShortcut ); - } - - bool IsP2PFile() const - { - return ( m_gameID.m_nType == k_EGameIDTypeP2P ); - } - - bool IsSteamApp() const - { - return ( m_gameID.m_nType == k_EGameIDTypeApp ); - } - - - - uint32 ModID() const - { - return m_gameID.m_nModID; - } - - uint32 AppID() const - { - return m_gameID.m_nAppID; - } - - bool operator == ( const CGameID &rhs ) const - { - return m_ulGameID == rhs.m_ulGameID; - } - - bool operator != ( const CGameID &rhs ) const - { - return !(*this == rhs); - } - - bool operator < ( const CGameID &rhs ) const - { - return ( m_ulGameID < rhs.m_ulGameID ); - } - - bool IsValid() const - { - return ( m_ulGameID != 0 ); - } - - void Reset() - { - m_ulGameID = 0; - } - - - -private: - enum EGameIDType - { - k_EGameIDTypeApp = 0, - k_EGameIDTypeGameMod = 1, - k_EGameIDTypeShortcut = 2, - k_EGameIDTypeP2P = 3, - }; - - struct GameID_t - { - unsigned int m_nAppID : 24; - unsigned int m_nType : 8; - unsigned int m_nModID : 32; - }; - - union - { - uint64 m_ulGameID; - GameID_t m_gameID; - }; -}; - -#pragma pack( pop ) - -const int k_cchGameExtraInfoMax = 64; - - -// Max number of credit cards stored for one account -const int k_nMaxNumCardsPerAccount = 1; - - -//----------------------------------------------------------------------------- -// Constants used for query ports. -//----------------------------------------------------------------------------- - -#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet. -#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server. - -#endif // STEAMCLIENTPUBLIC_H +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +//============================================================================= + +#ifndef STEAMCLIENTPUBLIC_H +#define STEAMCLIENTPUBLIC_H +#ifdef _WIN32 +#pragma once +#endif +//lint -save -e1931 -e1927 -e1924 -e613 -e726 + +// This header file defines the interface between the calling application and the code that +// knows how to communicate with the connection manager (CM) from the Steam service + +// This header file is intended to be portable; ideally this 1 header file plus a lib or dll +// is all you need to integrate the client library into some other tree. So please avoid +// including or requiring other header files if possible. This header should only describe the +// interface layer, no need to include anything about the implementation. + +#include "steamtypes.h" +#include "steamuniverse.h" + +// General result codes +enum EResult +{ + k_EResultOK = 1, // success + k_EResultFail = 2, // generic failure + k_EResultNoConnection = 3, // no/failed network connection +// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed + k_EResultInvalidPassword = 5, // password/ticket is invalid + k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere + k_EResultInvalidProtocolVer = 7, // protocol version is incorrect + k_EResultInvalidParam = 8, // a parameter is incorrect + k_EResultFileNotFound = 9, // file was not found + k_EResultBusy = 10, // called method busy - action not taken + k_EResultInvalidState = 11, // called object was in an invalid state + k_EResultInvalidName = 12, // name is invalid + k_EResultInvalidEmail = 13, // email is invalid + k_EResultDuplicateName = 14, // name is not unique + k_EResultAccessDenied = 15, // access is denied + k_EResultTimeout = 16, // operation timed out + k_EResultBanned = 17, // VAC2 banned + k_EResultAccountNotFound = 18, // account not found + k_EResultInvalidSteamID = 19, // steamID is invalid + k_EResultServiceUnavailable = 20, // The requested service is currently unavailable + k_EResultNotLoggedOn = 21, // The user is not logged on + k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party) + k_EResultEncryptionFailure = 23, // Encryption or Decryption failed + k_EResultInsufficientPrivilege = 24, // Insufficient privilege + k_EResultLimitExceeded = 25, // Too much of a good thing + k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes) + k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired + k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again + k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time + k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user + k_EResultIPNotFound = 31, // IP address not found + k_EResultPersistFailed = 32, // failed to write change to the data store + k_EResultLockingFailed = 33, // failed to acquire access lock for this operation + k_EResultLogonSessionReplaced = 34, + k_EResultConnectFailed = 35, + k_EResultHandshakeFailed = 36, + k_EResultIOFailure = 37, + k_EResultRemoteDisconnect = 38, + k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested + k_EResultBlocked = 40, // a user didn't allow it + k_EResultIgnored = 41, // target is ignoring sender + k_EResultNoMatch = 42, // nothing matching the request found + k_EResultAccountDisabled = 43, + k_EResultServiceReadOnly = 44, // this service is not accepting content changes right now + k_EResultAccountNotFeatured = 45, // account doesn't have value, so this feature isn't available + k_EResultAdministratorOK = 46, // allowed to take this action, but only because requester is admin + k_EResultContentVersion = 47, // A Version mismatch in content transmitted within the Steam protocol. + k_EResultTryAnotherCM = 48, // The current CM can't service the user making a request, user should try another. + k_EResultPasswordRequiredToKickSession = 49,// You are already logged in elsewhere, this cached credential login has failed. + k_EResultAlreadyLoggedInElsewhere = 50, // You are already logged in elsewhere, you must wait + k_EResultSuspended = 51, // Long running operation (content download) suspended/paused + k_EResultCancelled = 52, // Operation canceled (typically by user: content download) + k_EResultDataCorruption = 53, // Operation canceled because data is ill formed or unrecoverable + k_EResultDiskFull = 54, // Operation canceled - not enough disk space. + k_EResultRemoteCallFailed = 55, // an remote call or IPC call failed + k_EResultPasswordUnset = 56, // Password could not be verified as it's unset server side + k_EResultExternalAccountUnlinked = 57, // External account (PSN, Facebook...) is not linked to a Steam account + k_EResultPSNTicketInvalid = 58, // PSN ticket was invalid + k_EResultExternalAccountAlreadyLinked = 59, // External account (PSN, Facebook...) is already linked to some other account, must explicitly request to replace/delete the link first + k_EResultRemoteFileConflict = 60, // The sync cannot resume due to a conflict between the local and remote files + k_EResultIllegalPassword = 61, // The requested new password is not legal + k_EResultSameAsPreviousValue = 62, // new value is the same as the old one ( secret question and answer ) + k_EResultAccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure + k_EResultCannotUseOldPassword = 64, // The requested new password is not legal + k_EResultInvalidLoginAuthCode = 65, // account login denied due to auth code invalid + k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent + k_EResultHardwareNotCapableOfIPT = 67, // + k_EResultIPTInitError = 68, // + k_EResultParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user + k_EResultFacebookQueryError = 70, // Facebook query returned an error + k_EResultExpiredLoginAuthCode = 71, // account login denied due to auth code expired + k_EResultIPLoginRestrictionFailed = 72, + k_EResultAccountLockedDown = 73, + k_EResultAccountLogonDeniedVerifiedEmailRequired = 74, + k_EResultNoMatchingURL = 75, + k_EResultBadResponse = 76, // parse failure, missing field, etc. + k_EResultRequirePasswordReEntry = 77, // The user cannot complete the action until they re-enter their password + k_EResultValueOutOfRange = 78, // the value entered is outside the acceptable range + k_EResultUnexpectedError = 79, // something happened that we didn't expect to ever happen + k_EResultDisabled = 80, // The requested service has been configured to be unavailable + k_EResultInvalidCEGSubmission = 81, // The set of files submitted to the CEG server are not valid ! + k_EResultRestrictedDevice = 82, // The device being used is not allowed to perform this action + k_EResultRegionLocked = 83, // The action could not be complete because it is region restricted + k_EResultRateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent + k_EResultAccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login + k_EResultItemDeleted = 86, // The thing we're trying to access has been deleted + k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker + k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch + k_EResultTwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match + k_EResultAccountAssociatedToMultiplePartners = 90, // account has been associated with multiple partners + k_EResultNotModified = 91, // data not modified + k_EResultNoMobileDevice = 92, // the account does not have a mobile device associated with it + k_EResultTimeNotSynced = 93, // the time presented is out of range or tolerance + k_EResultSmsCodeFailed = 94, // SMS code failure (no match, none pending, etc.) + k_EResultAccountLimitExceeded = 95, // Too many accounts access this resource + k_EResultAccountActivityLimitExceeded = 96, // Too many changes to this account + k_EResultPhoneActivityLimitExceeded = 97, // Too many changes to this phone + k_EResultRefundToWallet = 98, // Cannot refund to payment method, must use wallet + k_EResultEmailSendFailure = 99, // Cannot send an email + k_EResultNotSettled = 100, // Can't perform operation till payment has settled + k_EResultNeedCaptcha = 101, // Needs to provide a valid captcha +}; + +// Error codes for use with the voice functions +enum EVoiceResult +{ + k_EVoiceResultOK = 0, + k_EVoiceResultNotInitialized = 1, + k_EVoiceResultNotRecording = 2, + k_EVoiceResultNoData = 3, + k_EVoiceResultBufferTooSmall = 4, + k_EVoiceResultDataCorrupted = 5, + k_EVoiceResultRestricted = 6, + k_EVoiceResultUnsupportedCodec = 7, + k_EVoiceResultReceiverOutOfDate = 8, + k_EVoiceResultReceiverDidNotAnswer = 9, + +}; + +// Result codes to GSHandleClientDeny/Kick +enum EDenyReason +{ + k_EDenyInvalid = 0, + k_EDenyInvalidVersion = 1, + k_EDenyGeneric = 2, + k_EDenyNotLoggedOn = 3, + k_EDenyNoLicense = 4, + k_EDenyCheater = 5, + k_EDenyLoggedInElseWhere = 6, + k_EDenyUnknownText = 7, + k_EDenyIncompatibleAnticheat = 8, + k_EDenyMemoryCorruption = 9, + k_EDenyIncompatibleSoftware = 10, + k_EDenySteamConnectionLost = 11, + k_EDenySteamConnectionError = 12, + k_EDenySteamResponseTimedOut = 13, + k_EDenySteamValidationStalled = 14, + k_EDenySteamOwnerLeftGuestUser = 15, +}; + +// return type of GetAuthSessionTicket +typedef uint32 HAuthTicket; +const HAuthTicket k_HAuthTicketInvalid = 0; + +// results from BeginAuthSession +enum EBeginAuthSessionResult +{ + k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID. + k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid. + k_EBeginAuthSessionResultDuplicateRequest = 2, // A ticket has already been submitted for this steamID + k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version + k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game + k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired +}; + +// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession +enum EAuthSessionResponse +{ + k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused. + k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam + k_EAuthSessionResponseNoLicenseOrExpired = 2, // The license has expired. + k_EAuthSessionResponseVACBanned = 3, // The user is VAC banned for this game. + k_EAuthSessionResponseLoggedInElseWhere = 4, // The user account has logged in elsewhere and the session containing the game instance has been disconnected. + k_EAuthSessionResponseVACCheckTimedOut = 5, // VAC has been unable to perform anti-cheat checks on this user + k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer + k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid. + k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam. + k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC +}; + +// results from UserHasLicenseForApp +enum EUserHasLicenseForAppResult +{ + k_EUserHasLicenseResultHasLicense = 0, // User has a license for specified app + k_EUserHasLicenseResultDoesNotHaveLicense = 1, // User does not have a license for the specified app + k_EUserHasLicenseResultNoAuth = 2, // User has not been authenticated +}; + + +// Steam account types +enum EAccountType +{ + k_EAccountTypeInvalid = 0, + k_EAccountTypeIndividual = 1, // single user account + k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account + k_EAccountTypeGameServer = 3, // game server account + k_EAccountTypeAnonGameServer = 4, // anonymous game server account + k_EAccountTypePending = 5, // pending + k_EAccountTypeContentServer = 6, // content server + k_EAccountTypeClan = 7, + k_EAccountTypeChat = 8, + k_EAccountTypeConsoleUser = 9, // Fake SteamID for local PSN account on PS3 or Live account on 360, etc. + k_EAccountTypeAnonUser = 10, + + // Max of 16 items in this field + k_EAccountTypeMax +}; + + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +enum EAppReleaseState +{ + k_EAppReleaseState_Unknown = 0, // unknown, required appinfo or license info is missing + k_EAppReleaseState_Unavailable = 1, // even if user 'just' owns it, can see game at all + k_EAppReleaseState_Prerelease = 2, // can be purchased and is visible in games list, nothing else. Common appInfo section released + k_EAppReleaseState_PreloadOnly = 3, // owners can preload app, not play it. AppInfo fully released. + k_EAppReleaseState_Released = 4, // owners can download and play app. +}; + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +enum EAppOwnershipFlags +{ + k_EAppOwnershipFlags_None = 0x0000, // unknown + k_EAppOwnershipFlags_OwnsLicense = 0x0001, // owns license for this game + k_EAppOwnershipFlags_FreeLicense = 0x0002, // not paid for game + k_EAppOwnershipFlags_RegionRestricted = 0x0004, // owns app, but not allowed to play in current region + k_EAppOwnershipFlags_LowViolence = 0x0008, // only low violence version + k_EAppOwnershipFlags_InvalidPlatform = 0x0010, // app not supported on current platform + k_EAppOwnershipFlags_SharedLicense = 0x0020, // license was granted by authorized local device + k_EAppOwnershipFlags_FreeWeekend = 0x0040, // owned by a free weekend licenses + k_EAppOwnershipFlags_RetailLicense = 0x0080, // has a retail license for game, (CD-Key etc) + k_EAppOwnershipFlags_LicenseLocked = 0x0100, // shared license is locked (in use) by other user + k_EAppOwnershipFlags_LicensePending = 0x0200, // owns app, but transaction is still pending. Can't install or play + k_EAppOwnershipFlags_LicenseExpired = 0x0400, // doesn't own app anymore since license expired + k_EAppOwnershipFlags_LicensePermanent = 0x0800, // permanent license, not borrowed, or guest or freeweekend etc + k_EAppOwnershipFlags_LicenseRecurring = 0x1000, // Recurring license, user is charged periodically + k_EAppOwnershipFlags_LicenseCanceled = 0x2000, // Mark as canceled, but might be still active if recurring + k_EAppOwnershipFlags_AutoGrant = 0x4000, // Ownership is based on any kind of autogrant license + k_EAppOwnershipFlags_PendingGift = 0x8000, // user has pending gift to redeem +}; + + +//----------------------------------------------------------------------------- +// Purpose: designed as flags to allow filters masks +//----------------------------------------------------------------------------- +enum EAppType +{ + k_EAppType_Invalid = 0x000, // unknown / invalid + k_EAppType_Game = 0x001, // playable game, default type + k_EAppType_Application = 0x002, // software application + k_EAppType_Tool = 0x004, // SDKs, editors & dedicated servers + k_EAppType_Demo = 0x008, // game demo + k_EAppType_Media_DEPRECATED = 0x010, // legacy - was used for game trailers, which are now just videos on the web + k_EAppType_DLC = 0x020, // down loadable content + k_EAppType_Guide = 0x040, // game guide, PDF etc + k_EAppType_Driver = 0x080, // hardware driver updater (ATI, Razor etc) + k_EAppType_Config = 0x100, // hidden app used to config Steam features (backpack, sales, etc) + k_EAppType_Hardware = 0x200, // a hardware device (Steam Machine, Steam Controller, Steam Link, etc.) + // 0x400 is up for grabs here + k_EAppType_Video = 0x800, // A video component of either a Film or TVSeries (may be the feature, an episode, preview, making-of, etc) + k_EAppType_Plugin = 0x1000, // Plug-in types for other Apps + k_EAppType_Music = 0x2000, // Music files + + k_EAppType_Shortcut = 0x40000000, // just a shortcut, client side only + k_EAppType_DepotOnly = 0x80000000, // placeholder since depots and apps share the same namespace +}; + + + +//----------------------------------------------------------------------------- +// types of user game stats fields +// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE +//----------------------------------------------------------------------------- +enum ESteamUserStatType +{ + k_ESteamUserStatTypeINVALID = 0, + k_ESteamUserStatTypeINT = 1, + k_ESteamUserStatTypeFLOAT = 2, + // Read as FLOAT, set with count / session length + k_ESteamUserStatTypeAVGRATE = 3, + k_ESteamUserStatTypeACHIEVEMENTS = 4, + k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5, + + // max, for sanity checks + k_ESteamUserStatTypeMAX +}; + + +//----------------------------------------------------------------------------- +// Purpose: Chat Entry Types (previously was only friend-to-friend message types) +//----------------------------------------------------------------------------- +enum EChatEntryType +{ + k_EChatEntryTypeInvalid = 0, + k_EChatEntryTypeChatMsg = 1, // Normal text message from another user + k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat) + k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game + k_EChatEntryTypeEmote = 4, // text emote message (deprecated, should be treated as ChatMsg) + //k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting (dead - listen for LobbyGameCreated_t callback instead) + k_EChatEntryTypeLeftConversation = 6, // user has left the conversation ( closed chat window ) + // Above are previous FriendMsgType entries, now merged into more generic chat entry types + k_EChatEntryTypeEntered = 7, // user has entered the conversation (used in multi-user chat and group chat) + k_EChatEntryTypeWasKicked = 8, // user was kicked (data: 64-bit steamid of actor performing the kick) + k_EChatEntryTypeWasBanned = 9, // user was banned (data: 64-bit steamid of actor performing the ban) + k_EChatEntryTypeDisconnected = 10, // user disconnected + k_EChatEntryTypeHistoricalChat = 11, // a chat message from user's chat history or offilne message + k_EChatEntryTypeReserved1 = 12, + k_EChatEntryTypeReserved2 = 13, + k_EChatEntryTypeLinkBlocked = 14, // a link was removed by the chat filter. +}; + + +//----------------------------------------------------------------------------- +// Purpose: Chat Room Enter Responses +//----------------------------------------------------------------------------- +enum EChatRoomEnterResponse +{ + k_EChatRoomEnterResponseSuccess = 1, // Success + k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed) + k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat + k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size + k_EChatRoomEnterResponseError = 5, // Unexpected Error + k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join + k_EChatRoomEnterResponseLimited = 7, // Joining this chat is not allowed because you are a limited user (no value on account) + k_EChatRoomEnterResponseClanDisabled = 8, // Attempt to join a clan chat when the clan is locked or disabled + k_EChatRoomEnterResponseCommunityBan = 9, // Attempt to join a chat when the user has a community lock on their account + k_EChatRoomEnterResponseMemberBlockedYou = 10, // Join failed - some member in the chat has blocked you from joining + k_EChatRoomEnterResponseYouBlockedMember = 11, // Join failed - you have blocked some member already in the chat + // k_EChatRoomEnterResponseNoRankingDataLobby = 12, // No longer used + // k_EChatRoomEnterResponseNoRankingDataUser = 13, // No longer used + // k_EChatRoomEnterResponseRankOutOfRange = 14, // No longer used +}; + + +typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath ); +typedef bool (*PFNLegacyKeyInstalled)(); + +const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF; +const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF; +// we allow 3 simultaneous user account instances right now, 1= desktop, 2 = console, 4 = web, 0 = all +const unsigned int k_unSteamUserDesktopInstance = 1; +const unsigned int k_unSteamUserConsoleInstance = 2; +const unsigned int k_unSteamUserWebInstance = 4; + +// Special flags for Chat accounts - they go in the top 8 bits +// of the steam ID's "instance", leaving 12 for the actual instances +enum EChatSteamIDInstanceFlags +{ + k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags + + k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit + k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc + k_EChatInstanceFlagMMSLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 3, // next one down, etc + + // Max of 8 flags +}; + + +//----------------------------------------------------------------------------- +// Purpose: Marketing message flags that change how a client should handle them +//----------------------------------------------------------------------------- +enum EMarketingMessageFlags +{ + k_EMarketingMessageFlagsNone = 0, + k_EMarketingMessageFlagsHighPriority = 1 << 0, + k_EMarketingMessageFlagsPlatformWindows = 1 << 1, + k_EMarketingMessageFlagsPlatformMac = 1 << 2, + k_EMarketingMessageFlagsPlatformLinux = 1 << 3, + + //aggregate flags + k_EMarketingMessageFlagsPlatformRestrictions = + k_EMarketingMessageFlagsPlatformWindows | + k_EMarketingMessageFlagsPlatformMac | + k_EMarketingMessageFlagsPlatformLinux, +}; + + + +//----------------------------------------------------------------------------- +// Purpose: Possible positions to tell the overlay to show notifications in +//----------------------------------------------------------------------------- +enum ENotificationPosition +{ + k_EPositionTopLeft = 0, + k_EPositionTopRight = 1, + k_EPositionBottomLeft = 2, + k_EPositionBottomRight = 3, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Broadcast upload result details +//----------------------------------------------------------------------------- +enum EBroadcastUploadResult +{ + k_EBroadcastUploadResultNone = 0, // broadcast state unknown + k_EBroadcastUploadResultOK = 1, // broadcast was good, no problems + k_EBroadcastUploadResultInitFailed = 2, // broadcast init failed + k_EBroadcastUploadResultFrameFailed = 3, // broadcast frame upload failed + k_EBroadcastUploadResultTimeout = 4, // broadcast upload timed out + k_EBroadcastUploadResultBandwidthExceeded = 5, // broadcast send too much data + k_EBroadcastUploadResultLowFPS = 6, // broadcast FPS too low + k_EBroadcastUploadResultMissingKeyFrames = 7, // broadcast sending not enough key frames + k_EBroadcastUploadResultNoConnection = 8, // broadcast client failed to connect to relay + k_EBroadcastUploadResultRelayFailed = 9, // relay dropped the upload + k_EBroadcastUploadResultSettingsChanged = 10, // the client changed broadcast settings + k_EBroadcastUploadResultMissingAudio = 11, // client failed to send audio data + k_EBroadcastUploadResultTooFarBehind = 12, // clients was too slow uploading + k_EBroadcastUploadResultTranscodeBehind = 13, // server failed to keep up with transcode +}; + + +//----------------------------------------------------------------------------- +// Purpose: codes for well defined launch options +//----------------------------------------------------------------------------- +enum ELaunchOptionType +{ + k_ELaunchOptionType_None = 0, // unknown what launch option does + k_ELaunchOptionType_Default = 1, // runs the game, app, whatever in default mode + k_ELaunchOptionType_SafeMode = 2, // runs the game in safe mode + k_ELaunchOptionType_Multiplayer = 3, // runs the game in multiplayer mode + k_ELaunchOptionType_Config = 4, // runs config tool for this game + k_ELaunchOptionType_VR = 5, // runs game in VR mode + k_ELaunchOptionType_Server = 6, // runs dedicated server for this game + k_ELaunchOptionType_Editor = 7, // runs game editor + k_ELaunchOptionType_Manual = 8, // shows game manual + k_ELaunchOptionType_Benchmark = 9, // runs game benchmark + k_ELaunchOptionType_Option1 = 10, // generic run option, uses description field for game name + k_ELaunchOptionType_Option2 = 11, // generic run option, uses description field for game name + k_ELaunchOptionType_Option3 = 12, // generic run option, uses description field for game name + + + k_ELaunchOptionType_Dialog = 1000, // show launch options dialog +}; + + +#pragma pack( push, 1 ) + +#define CSTEAMID_DEFINED + +// Steam ID structure (64 bits total) +class CSteamID +{ +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CSteamID() + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid; + m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + + //----------------------------------------------------------------------------- + // Purpose: Constructor + // Input : unAccountID - 32-bit account ID + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) + { + Set( unAccountID, eUniverse, eAccountType ); + } + + + //----------------------------------------------------------------------------- + // Purpose: Constructor + // Input : unAccountID - 32-bit account ID + // unAccountInstance - instance + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType ) + { +#if defined(_SERVER) && defined(Assert) + Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( unAccountInstance > k_unSteamUserWebInstance ) ) ); // enforce that for individual accounts, instance is always 1 +#endif // _SERVER + InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType ); + } + + + //----------------------------------------------------------------------------- + // Purpose: Constructor + // Input : ulSteamID - 64-bit representation of a Steam ID + // Note: Will not accept a uint32 or int32 as input, as that is a probable mistake. + // See the stubbed out overloads in the private: section for more info. + //----------------------------------------------------------------------------- + CSteamID( uint64 ulSteamID ) + { + SetFromUint64( ulSteamID ); + } +#ifdef INT64_DIFFERENT_FROM_INT64_T + CSteamID( uint64_t ulSteamID ) + { + SetFromUint64( (uint64)ulSteamID ); + } +#endif + + + //----------------------------------------------------------------------------- + // Purpose: Sets parameters for steam ID + // Input : unAccountID - 32-bit account ID + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) + { + m_steamid.m_comp.m_unAccountID = unAccountID; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_EAccountType = eAccountType; + + if ( eAccountType == k_EAccountTypeClan || eAccountType == k_EAccountTypeGameServer ) + { + m_steamid.m_comp.m_unAccountInstance = 0; + } + else + { + // by default we pick the desktop instance + m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance; + } + } + + + //----------------------------------------------------------------------------- + // Purpose: Sets parameters for steam ID + // Input : unAccountID - 32-bit account ID + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType ) + { + m_steamid.m_comp.m_unAccountID = unAccountID; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_EAccountType = eAccountType; + m_steamid.m_comp.m_unAccountInstance = unInstance; + } + + + //----------------------------------------------------------------------------- + // Purpose: Initializes a steam ID from its 52 bit parts and universe/type + // Input : ulIdentifier - 52 bits of goodness + //----------------------------------------------------------------------------- + void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType ) + { + m_steamid.m_comp.m_unAccountID = ( ulIdentifier & k_unSteamAccountIDMask ); // account ID is low 32 bits + m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & k_unSteamAccountInstanceMask ); // account instance is next 20 bits + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_EAccountType = eAccountType; + } + + + //----------------------------------------------------------------------------- + // Purpose: Initializes a steam ID from its 64-bit representation + // Input : ulSteamID - 64-bit representation of a Steam ID + //----------------------------------------------------------------------------- + void SetFromUint64( uint64 ulSteamID ) + { + m_steamid.m_unAll64Bits = ulSteamID; + } + + + //----------------------------------------------------------------------------- + // Purpose: Clear all fields, leaving an invalid ID. + //----------------------------------------------------------------------------- + void Clear() + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid; + m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + +#if defined( INCLUDED_STEAM2_USERID_STRUCTS ) + //----------------------------------------------------------------------------- + // Purpose: Initializes a steam ID from a Steam2 ID structure + // Input: pTSteamGlobalUserID - Steam2 ID to convert + // eUniverse - universe this ID belongs to + //----------------------------------------------------------------------------- + void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse ) + { + m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + + pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits; + m_steamid.m_comp.m_EUniverse = eUniverse; // set the universe + m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual + m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance; // Steam2 only knew desktop instances + } + + //----------------------------------------------------------------------------- + // Purpose: Fills out a Steam2 ID structure + // Input: pTSteamGlobalUserID - Steam2 ID to write to + //----------------------------------------------------------------------------- + void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const + { + // only individual accounts have any meaning in Steam 2, only they can be mapped + // Assert( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual ); + + pTSteamGlobalUserID->m_SteamInstanceID = 0; + pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_steamid.m_comp.m_unAccountID % 2; + pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_steamid.m_comp.m_unAccountID / 2; + } +#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H ) + + //----------------------------------------------------------------------------- + // Purpose: Converts steam ID to its 64-bit representation + // Output : 64-bit representation of a Steam ID + //----------------------------------------------------------------------------- + uint64 ConvertToUint64() const + { + return m_steamid.m_unAll64Bits; + } + + + //----------------------------------------------------------------------------- + // Purpose: Converts the static parts of a steam ID to a 64-bit representation. + // For multiseat accounts, all instances of that account will have the + // same static account key, so they can be grouped together by the static + // account key. + // Output : 64-bit static account key + //----------------------------------------------------------------------------- + uint64 GetStaticAccountKey() const + { + // note we do NOT include the account instance (which is a dynamic property) in the static account key + return (uint64) ( ( ( (uint64) m_steamid.m_comp.m_EUniverse ) << 56 ) + ((uint64) m_steamid.m_comp.m_EAccountType << 52 ) + m_steamid.m_comp.m_unAccountID ); + } + + + //----------------------------------------------------------------------------- + // Purpose: create an anonymous game server login to be filled in by the AM + //----------------------------------------------------------------------------- + void CreateBlankAnonLogon( EUniverse eUniverse ) + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonGameServer; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + + //----------------------------------------------------------------------------- + // Purpose: create an anonymous game server login to be filled in by the AM + //----------------------------------------------------------------------------- + void CreateBlankAnonUserLogon( EUniverse eUniverse ) + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonUser; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous game server login that will be filled in? + //----------------------------------------------------------------------------- + bool BBlankAnonAccount() const + { + return m_steamid.m_comp.m_unAccountID == 0 && BAnonAccount() && m_steamid.m_comp.m_unAccountInstance == 0; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a game server account id? (Either persistent or anonymous) + //----------------------------------------------------------------------------- + bool BGameServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a persistent (not anonymous) game server account id? + //----------------------------------------------------------------------------- + bool BPersistentGameServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous game server account id? + //----------------------------------------------------------------------------- + bool BAnonGameServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a content server account id? + //----------------------------------------------------------------------------- + bool BContentServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer; + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this a clan account id? + //----------------------------------------------------------------------------- + bool BClanAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan; + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this a chat account id? + //----------------------------------------------------------------------------- + bool BChatAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a chat account id? + //----------------------------------------------------------------------------- + bool IsLobby() const + { + return ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat ) + && ( m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby ); + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this an individual user account id? + //----------------------------------------------------------------------------- + bool BIndividualAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual || m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser; + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous account? + //----------------------------------------------------------------------------- + bool BAnonAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous user account? ( used to create an account or reset a password ) + //----------------------------------------------------------------------------- + bool BAnonUserAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a faked up Steam ID for a PSN friend account? + //----------------------------------------------------------------------------- + bool BConsoleUserAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser; + } + + // simple accessors + void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; } + void SetAccountInstance( uint32 unInstance ){ m_steamid.m_comp.m_unAccountInstance = unInstance; } + void ClearIndividualInstance() { if ( BIndividualAccount() ) m_steamid.m_comp.m_unAccountInstance = 0; } + bool HasNoIndividualInstance() const { return BIndividualAccount() && (m_steamid.m_comp.m_unAccountInstance==0); } + AccountID_t GetAccountID() const { return m_steamid.m_comp.m_unAccountID; } + uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; } + EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; } + EUniverse GetEUniverse() const { return m_steamid.m_comp.m_EUniverse; } + void SetEUniverse( EUniverse eUniverse ) { m_steamid.m_comp.m_EUniverse = eUniverse; } + bool IsValid() const; + + // this set of functions is hidden, will be moved out of class + explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid ); + const char * Render() const; // renders this steam ID to string + static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string + + void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse ); + // SetFromString allows many partially-correct strings, constraining how + // we might be able to change things in the future. + // SetFromStringStrict requires the exact string forms that we support + // and is preferred when the caller knows it's safe to be strict. + // Returns whether the string parsed correctly. + bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse ); + bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse ); + + inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; } + inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); } + inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; } + inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; } + + // DEBUG function + bool BValidExternalSteamID() const; + +private: + // These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID. + // If you get a compiler error about an ambiguous constructor/function then it may be because you're + // passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID + // using the correct Universe and account Type/Instance values. + CSteamID( uint32 ); + CSteamID( int32 ); + + // 64 bits total + union SteamID_t + { + struct SteamIDComponent_t + { +#ifdef VALVE_BIG_ENDIAN + EUniverse m_EUniverse : 8; // universe this account belongs to + unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference + unsigned int m_unAccountInstance : 20; // dynamic instance ID + uint32 m_unAccountID : 32; // unique account identifier +#else + uint32 m_unAccountID : 32; // unique account identifier + unsigned int m_unAccountInstance : 20; // dynamic instance ID + unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference + EUniverse m_EUniverse : 8; // universe this account belongs to +#endif + } m_comp; + + uint64 m_unAll64Bits; + } m_steamid; +}; + +inline bool CSteamID::IsValid() const +{ + if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax ) + return false; + + if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax ) + return false; + + if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual ) + { + if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance > k_unSteamUserWebInstance ) + return false; + } + + if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan ) + { + if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 0 ) + return false; + } + + if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer ) + { + if ( m_steamid.m_comp.m_unAccountID == 0 ) + return false; + // Any limit on instances? We use them for local users and bots + } + return true; +} + +// generic invalid CSteamID +#define k_steamIDNil CSteamID() + +// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol +// to provide its steamID +#define k_steamIDOutofDateGS CSteamID( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) +// This steamID comes from a user game connection to an sv_lan GS +#define k_steamIDLanModeGS CSteamID( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid ) +// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized +// its steam3 component and started logging on. +#define k_steamIDNotInitYetGS CSteamID( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) +// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still +// wants to support the "Join Game" option in the friends list +#define k_steamIDNonSteamGS CSteamID( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) + + +#ifdef STEAM +// Returns the matching chat steamID, with the default instance of 0 +// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance +CSteamID ChatIDFromSteamID( const CSteamID &steamID ); +// Returns the matching clan steamID, with the default instance of 0 +// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance +CSteamID ClanIDFromSteamID( const CSteamID &steamID ); +// Asserts steamID type before conversion +CSteamID ChatIDFromClanID( const CSteamID &steamIDClan ); +// Asserts steamID type before conversion +CSteamID ClanIDFromChatID( const CSteamID &steamIDChat ); + +#endif // _STEAM + + +//----------------------------------------------------------------------------- +// Purpose: encapsulates an appID/modID pair +//----------------------------------------------------------------------------- +class CGameID +{ +public: + + CGameID() + { + m_gameID.m_nType = k_EGameIDTypeApp; + m_gameID.m_nAppID = k_uAppIdInvalid; + m_gameID.m_nModID = 0; + } + + explicit CGameID( uint64 ulGameID ) + { + m_ulGameID = ulGameID; + } +#ifdef INT64_DIFFERENT_FROM_INT64_T + CGameID( uint64_t ulGameID ) + { + m_ulGameID = (uint64)ulGameID; + } +#endif + + explicit CGameID( int32 nAppID ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = nAppID; + } + + explicit CGameID( uint32 nAppID ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = nAppID; + } + + CGameID( uint32 nAppID, uint32 nModID ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = nAppID; + m_gameID.m_nModID = nModID; + m_gameID.m_nType = k_EGameIDTypeGameMod; + } + + // Hidden functions used only by Steam + explicit CGameID( const char *pchGameID ); + const char *Render() const; // render this Game ID to string + static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string + + // must include checksum_crc.h first to get this functionality +#if defined( CHECKSUM_CRC_H ) + CGameID( uint32 nAppID, const char *pchModPath ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = nAppID; + m_gameID.m_nType = k_EGameIDTypeGameMod; + + char rgchModDir[MAX_PATH]; + V_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) ); + CRC32_t crc32; + CRC32_Init( &crc32 ); + CRC32_ProcessBuffer( &crc32, rgchModDir, V_strlen( rgchModDir ) ); + CRC32_Final( &crc32 ); + + // set the high-bit on the mod-id + // reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique + // replacement for appID's + m_gameID.m_nModID = crc32 | (0x80000000); + } + + CGameID( const char *pchExePath, const char *pchAppName ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = k_uAppIdInvalid; + m_gameID.m_nType = k_EGameIDTypeShortcut; + + CRC32_t crc32; + CRC32_Init( &crc32 ); + CRC32_ProcessBuffer( &crc32, pchExePath, V_strlen( pchExePath ) ); + CRC32_ProcessBuffer( &crc32, pchAppName, V_strlen( pchAppName ) ); + CRC32_Final( &crc32 ); + + // set the high-bit on the mod-id + // reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique + // replacement for appID's + m_gameID.m_nModID = crc32 | (0x80000000); + } + +#if defined( VSTFILEID_H ) + + CGameID( VstFileID vstFileID ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = k_uAppIdInvalid; + m_gameID.m_nType = k_EGameIDTypeP2P; + + CRC32_t crc32; + CRC32_Init( &crc32 ); + const char *pchFileId = vstFileID.Render(); + CRC32_ProcessBuffer( &crc32, pchFileId, V_strlen( pchFileId ) ); + CRC32_Final( &crc32 ); + + // set the high-bit on the mod-id + // reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique + // replacement for appID's + m_gameID.m_nModID = crc32 | (0x80000000); + } + +#endif /* VSTFILEID_H */ + +#endif /* CHECKSUM_CRC_H */ + + + uint64 ToUint64() const + { + return m_ulGameID; + } + + uint64 *GetUint64Ptr() + { + return &m_ulGameID; + } + + void Set( uint64 ulGameID ) + { + m_ulGameID = ulGameID; + } + + bool IsMod() const + { + return ( m_gameID.m_nType == k_EGameIDTypeGameMod ); + } + + bool IsShortcut() const + { + return ( m_gameID.m_nType == k_EGameIDTypeShortcut ); + } + + bool IsP2PFile() const + { + return ( m_gameID.m_nType == k_EGameIDTypeP2P ); + } + + bool IsSteamApp() const + { + return ( m_gameID.m_nType == k_EGameIDTypeApp ); + } + + uint32 ModID() const + { + return m_gameID.m_nModID; + } + + uint32 AppID() const + { + return m_gameID.m_nAppID; + } + + bool operator == ( const CGameID &rhs ) const + { + return m_ulGameID == rhs.m_ulGameID; + } + + bool operator != ( const CGameID &rhs ) const + { + return !(*this == rhs); + } + + bool operator < ( const CGameID &rhs ) const + { + return ( m_ulGameID < rhs.m_ulGameID ); + } + + bool IsValid() const + { + // each type has it's own invalid fixed point: + switch( m_gameID.m_nType ) + { + case k_EGameIDTypeApp: + return m_gameID.m_nAppID != k_uAppIdInvalid; + + case k_EGameIDTypeGameMod: + return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000; + + case k_EGameIDTypeShortcut: + return (m_gameID.m_nModID & 0x80000000) != 0; + + case k_EGameIDTypeP2P: + return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000; + + default: +#if defined(Assert) + Assert(false); +#endif + return false; + } + + } + + void Reset() + { + m_ulGameID = 0; + } + + + +private: + + enum EGameIDType + { + k_EGameIDTypeApp = 0, + k_EGameIDTypeGameMod = 1, + k_EGameIDTypeShortcut = 2, + k_EGameIDTypeP2P = 3, + }; + + struct GameID_t + { +#ifdef VALVE_BIG_ENDIAN + unsigned int m_nModID : 32; + unsigned int m_nType : 8; + unsigned int m_nAppID : 24; +#else + unsigned int m_nAppID : 24; + unsigned int m_nType : 8; + unsigned int m_nModID : 32; +#endif + }; + + union + { + uint64 m_ulGameID; + GameID_t m_gameID; + }; +}; + +#pragma pack( pop ) + +const int k_cchGameExtraInfoMax = 64; + + +//----------------------------------------------------------------------------- +// Constants used for query ports. +//----------------------------------------------------------------------------- + +#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet. +#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server. + + +//----------------------------------------------------------------------------- +// Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback +// just before minidump file is captured after a crash has occurred. (Allows app to append additional comment data to the dump, etc.) +//----------------------------------------------------------------------------- +typedef void (*PFNPreMinidumpCallback)(void *context); + +//----------------------------------------------------------------------------- +// Purpose: Used by ICrashHandler interfaces to reference particular installed crash handlers +//----------------------------------------------------------------------------- +typedef void *BREAKPAD_HANDLE; +#define BREAKPAD_INVALID_HANDLE (BREAKPAD_HANDLE)0 + +#endif // STEAMCLIENTPUBLIC_H diff --git a/public/steam/steamencryptedappticket.h b/public/steam/steamencryptedappticket.h new file mode 100644 index 000000000..d85df5a96 --- /dev/null +++ b/public/steam/steamencryptedappticket.h @@ -0,0 +1,32 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: utilities to decode/decrypt a ticket from the +// ISteamUser::RequestEncryptedAppTicket, ISteamUser::GetEncryptedAppTicket API +// +// To use: declare CSteamEncryptedAppTicket, then call BDecryptTicket +// if BDecryptTicket returns true, other accessors are valid +// +//============================================================================= + +#include "steam_api.h" + +static const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32; + + +S_API bool SteamEncryptedAppTicket_BDecryptTicket( const uint8 *rgubTicketEncrypted, uint32 cubTicketEncrypted, + uint8 *rgubTicketDecrypted, uint32 *pcubTicketDecrypted, + const uint8 rgubKey[k_nSteamEncryptedAppTicketSymmetricKeyLen], int cubKey ); + +S_API bool SteamEncryptedAppTicket_BIsTicketForApp( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, AppId_t nAppID ); + +S_API RTime32 SteamEncryptedAppTicket_GetTicketIssueTime( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API void SteamEncryptedAppTicket_GetTicketSteamID( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, CSteamID *psteamID ); + +S_API AppId_t SteamEncryptedAppTicket_GetTicketAppID( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API bool SteamEncryptedAppTicket_BUserOwnsAppInTicket( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, AppId_t nAppID ); + +S_API bool SteamEncryptedAppTicket_BUserIsVacBanned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API const uint8 *SteamEncryptedAppTicket_GetUserVariableData( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pcubUserData ); \ No newline at end of file diff --git a/public/steam/steamhttpenums.h b/public/steam/steamhttpenums.h new file mode 100644 index 000000000..e15171f4e --- /dev/null +++ b/public/steam/steamhttpenums.h @@ -0,0 +1,97 @@ +//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. ======= +// +// Purpose: HTTP related enums, stuff that is shared by both clients and servers, and our +// UI projects goes here. +// +//============================================================================= + +#ifndef STEAMHTTPENUMS_H +#define STEAMHTTPENUMS_H +#ifdef _WIN32 +#pragma once +#endif + +// HTTP related types + +// This enum is used in client API methods, do not re-number existing values. +enum EHTTPMethod +{ + k_EHTTPMethodInvalid = 0, + k_EHTTPMethodGET, + k_EHTTPMethodHEAD, + k_EHTTPMethodPOST, + k_EHTTPMethodPUT, + k_EHTTPMethodDELETE, + k_EHTTPMethodOPTIONS, + + // The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for + // a compliant general purpose server. We'll likely add more as we find uses for them. + + // k_EHTTPMethodTRACE, + // k_EHTTPMethodCONNECT +}; + + +// HTTP Status codes that the server can send in response to a request, see rfc2616 section 10.3 for descriptions +// of each of these. +enum EHTTPStatusCode +{ + // Invalid status code (this isn't defined in HTTP, used to indicate unset in our code) + k_EHTTPStatusCodeInvalid = 0, + + // Informational codes + k_EHTTPStatusCode100Continue = 100, + k_EHTTPStatusCode101SwitchingProtocols = 101, + + // Success codes + k_EHTTPStatusCode200OK = 200, + k_EHTTPStatusCode201Created = 201, + k_EHTTPStatusCode202Accepted = 202, + k_EHTTPStatusCode203NonAuthoritative = 203, + k_EHTTPStatusCode204NoContent = 204, + k_EHTTPStatusCode205ResetContent = 205, + k_EHTTPStatusCode206PartialContent = 206, + + // Redirection codes + k_EHTTPStatusCode300MultipleChoices = 300, + k_EHTTPStatusCode301MovedPermanently = 301, + k_EHTTPStatusCode302Found = 302, + k_EHTTPStatusCode303SeeOther = 303, + k_EHTTPStatusCode304NotModified = 304, + k_EHTTPStatusCode305UseProxy = 305, + //k_EHTTPStatusCode306Unused = 306, (used in old HTTP spec, now unused in 1.1) + k_EHTTPStatusCode307TemporaryRedirect = 307, + + // Error codes + k_EHTTPStatusCode400BadRequest = 400, + k_EHTTPStatusCode401Unauthorized = 401, // You probably want 403 or something else. 401 implies you're sending a WWW-Authenticate header and the client can sent an Authorization header in response. + k_EHTTPStatusCode402PaymentRequired = 402, // This is reserved for future HTTP specs, not really supported by clients + k_EHTTPStatusCode403Forbidden = 403, + k_EHTTPStatusCode404NotFound = 404, + k_EHTTPStatusCode405MethodNotAllowed = 405, + k_EHTTPStatusCode406NotAcceptable = 406, + k_EHTTPStatusCode407ProxyAuthRequired = 407, + k_EHTTPStatusCode408RequestTimeout = 408, + k_EHTTPStatusCode409Conflict = 409, + k_EHTTPStatusCode410Gone = 410, + k_EHTTPStatusCode411LengthRequired = 411, + k_EHTTPStatusCode412PreconditionFailed = 412, + k_EHTTPStatusCode413RequestEntityTooLarge = 413, + k_EHTTPStatusCode414RequestURITooLong = 414, + k_EHTTPStatusCode415UnsupportedMediaType = 415, + k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416, + k_EHTTPStatusCode417ExpectationFailed = 417, + k_EHTTPStatusCode4xxUnknown = 418, // 418 is reserved, so we'll use it to mean unknown + k_EHTTPStatusCode429TooManyRequests = 429, + + // Server error codes + k_EHTTPStatusCode500InternalServerError = 500, + k_EHTTPStatusCode501NotImplemented = 501, + k_EHTTPStatusCode502BadGateway = 502, + k_EHTTPStatusCode503ServiceUnavailable = 503, + k_EHTTPStatusCode504GatewayTimeout = 504, + k_EHTTPStatusCode505HTTPVersionNotSupported = 505, + k_EHTTPStatusCode5xxUnknown = 599, +}; + +#endif // STEAMHTTPENUMS_H \ No newline at end of file diff --git a/public/steam/steamps3params.h b/public/steam/steamps3params.h new file mode 100644 index 000000000..d6f2fd755 --- /dev/null +++ b/public/steam/steamps3params.h @@ -0,0 +1,112 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef STEAMPS3PARAMS_H +#define STEAMPS3PARAMS_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// PlayStation 3 initialization parameters +// +// The following structure must be passed to when loading steam_api_ps3.prx +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +#define STEAM_PS3_PATH_MAX 1055 +#define STEAM_PS3_SERVICE_ID_MAX 32 +#define STEAM_PS3_COMMUNICATION_ID_MAX 10 +#define STEAM_PS3_COMMUNICATION_SIG_MAX 160 +#define STEAM_PS3_LANGUAGE_MAX 64 +#define STEAM_PS3_REGION_CODE_MAX 16 +#define STEAM_PS3_CURRENT_PARAMS_VER 2 +struct SteamPS3Params_t +{ + uint32 m_unVersion; // set to STEAM_PS3_CURRENT_PARAMS_VER + + void *pReserved; + uint32 m_nAppId; // set to your game's appid + + char m_rgchInstallationPath[ STEAM_PS3_PATH_MAX ]; // directory containing latest steam prx's and sdata. Can be read only (BDVD) + char m_rgchSystemCache[ STEAM_PS3_PATH_MAX ]; // temp working cache, not persistent + char m_rgchGameData[ STEAM_PS3_PATH_MAX ]; // persistent game data path for storing user data + char m_rgchNpServiceID[ STEAM_PS3_SERVICE_ID_MAX ]; + char m_rgchNpCommunicationID[ STEAM_PS3_COMMUNICATION_ID_MAX ]; + char m_rgchNpCommunicationSig[ STEAM_PS3_COMMUNICATION_SIG_MAX ]; + + // Language should be one of the following. must be zero terminated + // danish + // dutch + // english + // finnish + // french + // german + // italian + // korean + // norwegian + // polish + // portuguese + // russian + // schinese + // spanish + // swedish + // tchinese + char m_rgchSteamLanguage[ STEAM_PS3_LANGUAGE_MAX ]; + + // region codes are "SCEA", "SCEE", "SCEJ". must be zero terminated + char m_rgchRegionCode[ STEAM_PS3_REGION_CODE_MAX ]; + + // Should be SYS_TTYP3 through SYS_TTYP10, if it's 0 then Steam won't spawn a + // thread to read console input at all. Using this let's you use Steam console commands + // like: profile_on, profile_off, profile_dump, mem_stats, mem_validate. + unsigned int m_cSteamInputTTY; + + struct Ps3netInit_t + { + bool m_bNeedInit; + void *m_pMemory; + int m_nMemorySize; + int m_flags; + } m_sysNetInitInfo; + + struct Ps3jpgInit_t + { + bool m_bNeedInit; + } m_sysJpgInitInfo; + + struct Ps3pngInit_t + { + bool m_bNeedInit; + } m_sysPngInitInfo; + + struct Ps3sysutilUserInfo_t + { + bool m_bNeedInit; + } m_sysSysUtilUserInfo; + + bool m_bIncludeNewsPage; +}; + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// PlayStation 3 memory structure +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +#define STEAMPS3_MALLOC_INUSE 0x53D04A51 +#define STEAMPS3_MALLOC_SYSTEM 0x0D102C48 +#define STEAMPS3_MALLOC_OK 0xFFD04A51 +struct SteamPS3Memory_t +{ + bool m_bSingleAllocation; // If true, Steam will request one 6MB allocation and use the returned memory for all future allocations + // If false, Steam will make call malloc for each allocation + + // required function pointers + void* (*m_pfMalloc)(size_t); + void* (*m_pfRealloc)(void *, size_t); + void (*m_pfFree)(void *); + size_t (*m_pUsable_size)(void*); +}; + + +#endif // STEAMPS3PARAMS_H diff --git a/public/steam/steamtypes.h b/public/steam/steamtypes.h index 960a2710b..14d3e5a7a 100644 --- a/public/steam/steamtypes.h +++ b/public/steam/steamtypes.h @@ -1,75 +1,179 @@ -//========= Copyright © 1996-2004, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#ifndef STEAMTYPES_H -#define STEAMTYPES_H -#ifdef _WIN32 -#pragma once -#endif - -// Steam-specific types. Defined here so this header file can be included in other code bases. -#ifndef WCHARTYPES_H -typedef unsigned char uint8; -#endif - - -#if defined(__x86_64__) || defined(_WIN64) -#define X64BITS -#endif - -typedef unsigned char uint8; -typedef signed char int8; - -#if defined( _WIN32 ) - -typedef __int16 int16; -typedef unsigned __int16 uint16; -typedef __int32 int32; -typedef unsigned __int32 uint32; -typedef __int64 int64; -typedef unsigned __int64 uint64; - -#ifdef X64BITS -typedef __int64 intp; // intp is an integer that can accomodate a pointer -typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *) -#else -typedef __int32 intp; -typedef unsigned __int32 uintp; -#endif - -#else // _WIN32 - -typedef short int16; -typedef unsigned short uint16; -typedef int int32; -typedef unsigned int uint32; -typedef long long int64; -typedef unsigned long long uint64; -#ifdef X64BITS -typedef long long intp; -typedef unsigned long long uintp; -#else -typedef int intp; -typedef unsigned int uintp; -#endif - -#endif // else _WIN32 - -const int k_cubDigestSize = 20; // CryptoPP::SHA::DIGESTSIZE -const int k_cubSaltSize = 8; - -typedef uint8 SHADigest_t[ k_cubDigestSize ]; -typedef uint8 Salt_t[ k_cubSaltSize ]; - -typedef uint64 GID_t; // globally unique identifier - -// RTime32 -// We use this 32 bit time representing real world time. -// It offers 1 second resolution beginning on January 1, 1970 (Unix time) -typedef uint32 RTime32; - -#endif // STEAMTYPES_H +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +//============================================================================= + +#ifndef STEAMTYPES_H +#define STEAMTYPES_H +#ifdef _WIN32 +#pragma once +#endif + +#define S_CALLTYPE __cdecl + +// Steam-specific types. Defined here so this header file can be included in other code bases. +#ifndef WCHARTYPES_H +typedef unsigned char uint8; +#endif + +#if defined( __GNUC__ ) && !defined(POSIX) + #if __GNUC__ < 4 + #error "Steamworks requires GCC 4.X (4.2 or 4.4 have been tested)" + #endif + #define POSIX 1 +#endif + +#if defined(__x86_64__) || defined(_WIN64) +#define X64BITS +#endif + +// Make sure VALVE_BIG_ENDIAN gets set on PS3, may already be set previously in Valve internal code. +#if !defined(VALVE_BIG_ENDIAN) && defined(_PS3) +#define VALVE_BIG_ENDIAN +#endif + +typedef unsigned char uint8; +typedef signed char int8; + +#if defined( _WIN32 ) + +typedef __int16 int16; +typedef unsigned __int16 uint16; +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; + +typedef int64 lint64; +typedef uint64 ulint64; + +#ifdef X64BITS +typedef __int64 intp; // intp is an integer that can accomodate a pointer +typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *) +#else +typedef __int32 intp; +typedef unsigned __int32 uintp; +#endif + +#else // _WIN32 + +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; + +// [u]int64 are actually defined as 'long long' and gcc 64-bit +// doesn't automatically consider them the same as 'long int'. +// Changing the types for [u]int64 is complicated by +// there being many definitions, so we just +// define a 'long int' here and use it in places that would +// otherwise confuse the compiler. +typedef long int lint64; +typedef unsigned long int ulint64; + +#ifdef X64BITS +typedef long long intp; +typedef unsigned long long uintp; +#else +typedef int intp; +typedef unsigned int uintp; +#endif + +#endif // else _WIN32 + +#ifdef __clang__ +# define CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) +#else +# define CLANG_ATTR(ATTR) +#endif + +#define METHOD_DESC(DESC) CLANG_ATTR( "desc:" #DESC ";" ) +#define IGNOREATTR() CLANG_ATTR( "ignore" ) +#define OUT_STRUCT() CLANG_ATTR( "out_struct: ;" ) +#define OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) +#define OUT_ARRAY_COUNT(COUNTER, DESC) CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) +#define ARRAY_COUNT(COUNTER) CLANG_ATTR( "array_count:" #COUNTER ";" ) +#define ARRAY_COUNT_D(COUNTER, DESC) CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) +#define BUFFER_COUNT(COUNTER) CLANG_ATTR( "buffer_count:" #COUNTER ";" ) +#define OUT_BUFFER_COUNT(COUNTER) CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) +#define OUT_STRING_COUNT(COUNTER) CLANG_ATTR( "out_string_count:" #COUNTER ";" ) +#define DESC(DESC) CLANG_ATTR("desc:" #DESC ";") + + +const int k_cubSaltSize = 8; +typedef uint8 Salt_t[ k_cubSaltSize ]; + +//----------------------------------------------------------------------------- +// GID (GlobalID) stuff +// This is a globally unique identifier. It's guaranteed to be unique across all +// racks and servers for as long as a given universe persists. +//----------------------------------------------------------------------------- +// NOTE: for GID parsing/rendering and other utils, see gid.h +typedef uint64 GID_t; + +const GID_t k_GIDNil = 0xffffffffffffffffull; + +// For convenience, we define a number of types that are just new names for GIDs +typedef uint64 JobID_t; // Each Job has a unique ID +typedef GID_t TxnID_t; // Each financial transaction has a unique ID + +const GID_t k_TxnIDNil = k_GIDNil; +const GID_t k_TxnIDUnknown = 0; + +const JobID_t k_JobIDNil = 0xffffffffffffffffull; + +// this is baked into client messages and interfaces as an int, +// make sure we never break this. +typedef uint32 PackageId_t; +const PackageId_t k_uPackageIdFreeSub = 0x0; +const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF; + +typedef uint32 BundleId_t; +const BundleId_t k_uBundleIdInvalid = 0; + +// this is baked into client messages and interfaces as an int, +// make sure we never break this. +typedef uint32 AppId_t; +const AppId_t k_uAppIdInvalid = 0x0; + +typedef uint64 AssetClassId_t; +const AssetClassId_t k_ulAssetClassIdInvalid = 0x0; + +typedef uint32 PhysicalItemId_t; +const PhysicalItemId_t k_uPhysicalItemIdInvalid = 0x0; + + +// this is baked into client messages and interfaces as an int, +// make sure we never break this. AppIds and DepotIDs also presently +// share the same namespace, but since we'd like to change that in the future +// I've defined it separately here. +typedef uint32 DepotId_t; +const DepotId_t k_uDepotIdInvalid = 0x0; + +// RTime32 +// We use this 32 bit time representing real world time. +// It offers 1 second resolution beginning on January 1, 1970 (Unix time) +typedef uint32 RTime32; + +typedef uint32 CellID_t; +const CellID_t k_uCellIDInvalid = 0xFFFFFFFF; + +// handle to a Steam API call +typedef uint64 SteamAPICall_t; +const SteamAPICall_t k_uAPICallInvalid = 0x0; + +typedef uint32 AccountID_t; + +typedef uint32 PartnerId_t; +const PartnerId_t k_uPartnerIdInvalid = 0; + +// ID for a depot content manifest +typedef uint64 ManifestId_t; +const ManifestId_t k_uManifestIdInvalid = 0; + + + +#endif // STEAMTYPES_H diff --git a/public/steam/steamuniverse.h b/public/steam/steamuniverse.h new file mode 100644 index 000000000..dd384dcc4 --- /dev/null +++ b/public/steam/steamuniverse.h @@ -0,0 +1,27 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +//============================================================================= + +#ifndef STEAMUNIVERSE_H +#define STEAMUNIVERSE_H +#ifdef _WIN32 +#pragma once +#endif + + +// Steam universes. Each universe is a self-contained Steam instance. +enum EUniverse +{ + k_EUniverseInvalid = 0, + k_EUniversePublic = 1, + k_EUniverseBeta = 2, + k_EUniverseInternal = 3, + k_EUniverseDev = 4, + // k_EUniverseRC = 5, // no such universe anymore + k_EUniverseMax +}; + + +#endif // STEAMUNIVERSE_H diff --git a/public/steam/steamvr_flat.h b/public/steam/steamvr_flat.h new file mode 100644 index 000000000..a521ecb1a --- /dev/null +++ b/public/steam/steamvr_flat.h @@ -0,0 +1,33 @@ +//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to user account information in Steam +// +//============================================================================= + +#ifndef STEAMVRFLAT_H +#define STEAMVRFLAT_H +#ifdef _WIN32 +#pragma once +#endif + + + +S_API void SteamAPI_IHmd_GetWindowBounds(intptr_t instancePtr, int32_t * pnX, int32_t * pnY, uint32_t * pnWidth, uint32_t * pnHeight); +S_API void SteamAPI_IHmd_GetRecommendedRenderTargetSize(intptr_t instancePtr, uint32_t * pnWidth, uint32_t * pnHeight); +S_API void SteamAPI_IHmd_GetEyeOutputViewport(intptr_t instancePtr, vr::Hmd_Eye eEye, uint32_t * pnX, uint32_t * pnY, uint32_t * pnWidth, uint32_t * pnHeight); +S_API struct vr::HmdMatrix44_t SteamAPI_IHmd_GetProjectionMatrix(intptr_t instancePtr, vr::Hmd_Eye eEye, float fNearZ, float fFarZ, vr::GraphicsAPIConvention eProjType); +S_API void SteamAPI_IHmd_GetProjectionRaw(intptr_t instancePtr, vr::Hmd_Eye eEye, float * pfLeft, float * pfRight, float * pfTop, float * pfBottom); +S_API struct vr::DistortionCoordinates_t SteamAPI_IHmd_ComputeDistortion(intptr_t instancePtr, vr::Hmd_Eye eEye, float fU, float fV); +S_API struct vr::HmdMatrix34_t SteamAPI_IHmd_GetHeadFromEyePose(intptr_t instancePtr, vr::Hmd_Eye eEye); +S_API bool SteamAPI_IHmd_GetViewMatrix(intptr_t instancePtr, float fSecondsFromNow, struct vr::HmdMatrix44_t * pMatLeftView, struct vr::HmdMatrix44_t * pMatRightView, vr::HmdTrackingResult * peResult); +S_API int32_t SteamAPI_IHmd_GetD3D9AdapterIndex(intptr_t instancePtr); +S_API void SteamAPI_IHmd_GetDXGIOutputInfo(intptr_t instancePtr, int32_t * pnAdapterIndex, int32_t * pnAdapterOutputIndex); +S_API void SteamAPI_IHmd_AttachToWindow(intptr_t instancePtr, void * hWnd); +S_API bool SteamAPI_IHmd_GetTrackerFromHeadPose(intptr_t instancePtr, float fPredictedSecondsFromNow, struct vr::HmdMatrix34_t * pmPose, vr::HmdTrackingResult * peResult); +S_API bool SteamAPI_IHmd_GetLastTrackerFromHeadPose(intptr_t instancePtr, struct vr::HmdMatrix34_t * pmPose); +S_API bool SteamAPI_IHmd_WillDriftInYaw(intptr_t instancePtr); +S_API void SteamAPI_IHmd_ZeroTracker(intptr_t instancePtr); +S_API struct vr::HmdMatrix34_t SteamAPI_IHmd_GetTrackerZeroPose(intptr_t instancePtr); +S_API uint32_t SteamAPI_IHmd_GetDriverId(intptr_t instancePtr, char * pchBuffer, uint32_t unBufferLen); +S_API uint32_t SteamAPI_IHmd_GetDisplayId(intptr_t instancePtr, char * pchBuffer, uint32_t unBufferLen); +#endif // STEAMVRFLAT_H diff --git a/public/steam/steamvr_interop.cs b/public/steam/steamvr_interop.cs new file mode 100644 index 000000000..15c5e9b07 --- /dev/null +++ b/public/steam/steamvr_interop.cs @@ -0,0 +1,285 @@ +//=== === Copyright 1996-2004, Valve Corporation, All rights reserved. ======= +// +// Purpose: +// +//============================================================================= + +using System; +using System.Runtime.InteropServices; + +namespace Valve.SteamVRInterop +{ + +class NativeEntrypoints +{ + + +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetWindowBounds")] +internal static extern void SteamAPI_IHmd_GetWindowBounds(IntPtr instancePtr, ref int32_t pnX, ref int32_t pnY, ref uint32_t pnWidth, ref uint32_t pnHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetRecommendedRenderTargetSize")] +internal static extern void SteamAPI_IHmd_GetRecommendedRenderTargetSize(IntPtr instancePtr, ref uint32_t pnWidth, ref uint32_t pnHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetEyeOutputViewport")] +internal static extern void SteamAPI_IHmd_GetEyeOutputViewport(IntPtr instancePtr, vr::Hmd_Eye eEye, ref uint32_t pnX, ref uint32_t pnY, ref uint32_t pnWidth, ref uint32_t pnHeight); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetProjectionMatrix")] +internal static extern vr::HmdMatrix44_t SteamAPI_IHmd_GetProjectionMatrix(IntPtr instancePtr, vr::Hmd_Eye eEye, float fNearZ, float fFarZ, vr::GraphicsAPIConvention eProjType); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetProjectionRaw")] +internal static extern void SteamAPI_IHmd_GetProjectionRaw(IntPtr instancePtr, vr::Hmd_Eye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_ComputeDistortion")] +internal static extern vr::DistortionCoordinates_t SteamAPI_IHmd_ComputeDistortion(IntPtr instancePtr, vr::Hmd_Eye eEye, float fU, float fV); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetHeadFromEyePose")] +internal static extern vr::HmdMatrix34_t SteamAPI_IHmd_GetHeadFromEyePose(IntPtr instancePtr, vr::Hmd_Eye eEye); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetViewMatrix")] +internal static extern bool SteamAPI_IHmd_GetViewMatrix(IntPtr instancePtr, float fSecondsFromNow, ref vr::HmdMatrix44_t pMatLeftView, ref vr::HmdMatrix44_t pMatRightView, ref vr::HmdTrackingResult peResult); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetD3D9AdapterIndex")] +internal static extern int32_t SteamAPI_IHmd_GetD3D9AdapterIndex(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetDXGIOutputInfo")] +internal static extern void SteamAPI_IHmd_GetDXGIOutputInfo(IntPtr instancePtr, ref int32_t pnAdapterIndex, ref int32_t pnAdapterOutputIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_AttachToWindow")] +internal static extern void SteamAPI_IHmd_AttachToWindow(IntPtr instancePtr, IntPtr hWnd); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetTrackerFromHeadPose")] +internal static extern bool SteamAPI_IHmd_GetTrackerFromHeadPose(IntPtr instancePtr, float fPredictedSecondsFromNow, ref vr::HmdMatrix34_t pmPose, ref vr::HmdTrackingResult peResult); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetLastTrackerFromHeadPose")] +internal static extern bool SteamAPI_IHmd_GetLastTrackerFromHeadPose(IntPtr instancePtr, ref vr::HmdMatrix34_t pmPose); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_WillDriftInYaw")] +internal static extern bool SteamAPI_IHmd_WillDriftInYaw(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_ZeroTracker")] +internal static extern void SteamAPI_IHmd_ZeroTracker(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetTrackerZeroPose")] +internal static extern vr::HmdMatrix34_t SteamAPI_IHmd_GetTrackerZeroPose(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetDriverId")] +internal static extern uint32_t SteamAPI_IHmd_GetDriverId(IntPtr instancePtr, string pchBuffer, uint32_t unBufferLen); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_IHmd_GetDisplayId")] +internal static extern uint32_t SteamAPI_IHmd_GetDisplayId(IntPtr instancePtr, string pchBuffer, uint32_t unBufferLen); + +} + + +public abstract class IHmd +{ +public abstract void GetWindowBounds(out int32_t pnX,out int32_t pnY,out uint32_t pnWidth,out uint32_t pnHeight); +public abstract void GetRecommendedRenderTargetSize(out uint32_t pnWidth,out uint32_t pnHeight); +public abstract void GetEyeOutputViewport(vr::Hmd_Eye eEye,out uint32_t pnX,out uint32_t pnY,out uint32_t pnWidth,out uint32_t pnHeight); +public abstract vr::HmdMatrix44_t GetProjectionMatrix(vr::Hmd_Eye eEye,float fNearZ,float fFarZ,vr::GraphicsAPIConvention eProjType); +public abstract void GetProjectionRaw(vr::Hmd_Eye eEye,out float pfLeft,out float pfRight,out float pfTop,out float pfBottom); +public abstract vr::DistortionCoordinates_t ComputeDistortion(vr::Hmd_Eye eEye,float fU,float fV); +public abstract vr::HmdMatrix34_t GetHeadFromEyePose(vr::Hmd_Eye eEye); +public abstract bool GetViewMatrix(float fSecondsFromNow,out vr::HmdMatrix44_t pMatLeftView,out vr::HmdMatrix44_t pMatRightView,out vr::HmdTrackingResult peResult); +public abstract int32_t GetD3D9AdapterIndex(); +public abstract void GetDXGIOutputInfo(out int32_t pnAdapterIndex,out int32_t pnAdapterOutputIndex); +public abstract void AttachToWindow(IntPtr hWnd); +public abstract bool GetTrackerFromHeadPose(float fPredictedSecondsFromNow,out vr::HmdMatrix34_t pmPose,out vr::HmdTrackingResult peResult); +public abstract bool GetLastTrackerFromHeadPose(out vr::HmdMatrix34_t pmPose); +public abstract bool WillDriftInYaw(); +public abstract void ZeroTracker(); +public abstract vr::HmdMatrix34_t GetTrackerZeroPose(); +public abstract uint32_t GetDriverId(string pchBuffer,uint32_t unBufferLen); +public abstract uint32_t GetDisplayId(string pchBuffer,uint32_t unBufferLen); +} + + +public class CHmd : IHmd +{ +public CHmd(IntPtr hmd) +{ + m_hmd = hmd; +} +IntPtr m_hmd; + +private void CheckIfUsable() +{ + if (m_hmd == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override void GetWindowBounds(out int32_t pnX,out int32_t pnY,out uint32_t pnWidth,out uint32_t pnHeight) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_IHmd_GetWindowBounds(m_hmd,ref pnX,ref pnY,ref pnWidth,ref pnHeight); +} +public override void GetRecommendedRenderTargetSize(out uint32_t pnWidth,out uint32_t pnHeight) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_IHmd_GetRecommendedRenderTargetSize(m_hmd,ref pnWidth,ref pnHeight); +} +public override void GetEyeOutputViewport(vr::Hmd_Eye eEye,out uint32_t pnX,out uint32_t pnY,out uint32_t pnWidth,out uint32_t pnHeight) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_IHmd_GetEyeOutputViewport(m_hmd,eEye,ref pnX,ref pnY,ref pnWidth,ref pnHeight); +} +public override vr::HmdMatrix44_t GetProjectionMatrix(vr::Hmd_Eye eEye,float fNearZ,float fFarZ,vr::GraphicsAPIConvention eProjType) +{ + CheckIfUsable(); + vr::HmdMatrix44_t result = NativeEntrypoints.SteamAPI_IHmd_GetProjectionMatrix(m_hmd,eEye,fNearZ,fFarZ,eProjType); + return result; +} +public override void GetProjectionRaw(vr::Hmd_Eye eEye,out float pfLeft,out float pfRight,out float pfTop,out float pfBottom) +{ + CheckIfUsable(); + pfLeft = 0; + pfRight = 0; + pfTop = 0; + pfBottom = 0; + NativeEntrypoints.SteamAPI_IHmd_GetProjectionRaw(m_hmd,eEye,ref pfLeft,ref pfRight,ref pfTop,ref pfBottom); +} +public override vr::DistortionCoordinates_t ComputeDistortion(vr::Hmd_Eye eEye,float fU,float fV) +{ + CheckIfUsable(); + vr::DistortionCoordinates_t result = NativeEntrypoints.SteamAPI_IHmd_ComputeDistortion(m_hmd,eEye,fU,fV); + return result; +} +public override vr::HmdMatrix34_t GetHeadFromEyePose(vr::Hmd_Eye eEye) +{ + CheckIfUsable(); + vr::HmdMatrix34_t result = NativeEntrypoints.SteamAPI_IHmd_GetHeadFromEyePose(m_hmd,eEye); + return result; +} +public override bool GetViewMatrix(float fSecondsFromNow,out vr::HmdMatrix44_t pMatLeftView,out vr::HmdMatrix44_t pMatRightView,out vr::HmdTrackingResult peResult) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_IHmd_GetViewMatrix(m_hmd,fSecondsFromNow,ref pMatLeftView,ref pMatRightView,ref peResult); + return result; +} +public override int32_t GetD3D9AdapterIndex() +{ + CheckIfUsable(); + int32_t result = NativeEntrypoints.SteamAPI_IHmd_GetD3D9AdapterIndex(m_hmd); + return result; +} +public override void GetDXGIOutputInfo(out int32_t pnAdapterIndex,out int32_t pnAdapterOutputIndex) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_IHmd_GetDXGIOutputInfo(m_hmd,ref pnAdapterIndex,ref pnAdapterOutputIndex); +} +public override void AttachToWindow(IntPtr hWnd) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_IHmd_AttachToWindow(m_hmd,hWnd); +} +public override bool GetTrackerFromHeadPose(float fPredictedSecondsFromNow,out vr::HmdMatrix34_t pmPose,out vr::HmdTrackingResult peResult) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_IHmd_GetTrackerFromHeadPose(m_hmd,fPredictedSecondsFromNow,ref pmPose,ref peResult); + return result; +} +public override bool GetLastTrackerFromHeadPose(out vr::HmdMatrix34_t pmPose) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_IHmd_GetLastTrackerFromHeadPose(m_hmd,ref pmPose); + return result; +} +public override bool WillDriftInYaw() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_IHmd_WillDriftInYaw(m_hmd); + return result; +} +public override void ZeroTracker() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_IHmd_ZeroTracker(m_hmd); +} +public override vr::HmdMatrix34_t GetTrackerZeroPose() +{ + CheckIfUsable(); + vr::HmdMatrix34_t result = NativeEntrypoints.SteamAPI_IHmd_GetTrackerZeroPose(m_hmd); + return result; +} +public override uint32_t GetDriverId(string pchBuffer,uint32_t unBufferLen) +{ + CheckIfUsable(); + uint32_t result = NativeEntrypoints.SteamAPI_IHmd_GetDriverId(m_hmd,pchBuffer,unBufferLen); + return result; +} +public override uint32_t GetDisplayId(string pchBuffer,uint32_t unBufferLen) +{ + CheckIfUsable(); + uint32_t result = NativeEntrypoints.SteamAPI_IHmd_GetDisplayId(m_hmd,pchBuffer,unBufferLen); + return result; +} +} + + +public class SteamVRInterop +{ +[DllImportAttribute("Steam_api", EntryPoint = "VR_Init")] +internal static extern IntPtr VR_Init(out HmdError peError); +[DllImportAttribute("Steam_api", EntryPoint = "VR_Shutdown")] +internal static extern void VR_Shutdown(); +[DllImportAttribute("Steam_api", EntryPoint = "VR_IsHmdPresent")] +internal static extern bool VR_IsHmdPresent(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_UnregisterCallback")] +internal static extern string VR_GetStringForHmdError(HmdError error); +[DllImportAttribute("Steam_api", EntryPoint = "Hmd")] +internal static extern IntPtr Hmd(); +} + + +public enum Hmd_Eye +{ + Eye_Left = 0, + Eye_Right = 1, +} +public enum GraphicsAPIConvention +{ + API_DirectX = 0, + API_OpenGL = 1, +} +public enum HmdTrackingResult +{ + TrackingResult_Uninitialized = 1, + TrackingResult_Calibrating_InProgress = 100, + TrackingResult_Calibrating_OutOfRange = 101, + TrackingResult_Running_OK = 200, + TrackingResult_Running_OutOfRange = 201, +} +public enum HmdError +{ + HmdError_None = 0, + HmdError_Init_InstallationNotFound = 100, + HmdError_Init_InstallationCorrupt = 101, + HmdError_Init_VRClientDLLNotFound = 102, + HmdError_Init_FileNotFound = 103, + HmdError_Init_FactoryNotFound = 104, + HmdError_Init_InterfaceNotFound = 105, + HmdError_Init_InvalidInterface = 106, + HmdError_Init_UserConfigDirectoryInvalid = 107, + HmdError_Init_HmdNotFound = 108, + HmdError_Init_NotInitialized = 109, + HmdError_Driver_Failed = 200, + HmdError_Driver_Unknown = 201, + HmdError_Driver_HmdUnknown = 202, + HmdError_Driver_NotLoaded = 203, + HmdError_IPC_ServerInitFailed = 300, + HmdError_IPC_ConnectFailed = 301, + HmdError_IPC_SharedStateInitFailed = 302, + HmdError_VendorSpecific_UnableToConnectToOculusRuntime = 1000, +} +[StructLayout(LayoutKind.Sequential)] public struct HmdMatrix34_t +{ + public float m; +} +[StructLayout(LayoutKind.Sequential)] public struct HmdMatrix44_t +{ + public float m; +} +[StructLayout(LayoutKind.Sequential)] public struct DistortionCoordinates_t +{ + public float rfRed; + public float rfGreen; + public float rfBlue; +} + +public class SteamVR +{ +public static IHMD Init(out HmdError peError) +{ + return new CHMD(VR_Init(out peError)); +} + +} + + + +} + diff --git a/public/tier0/annotations.h b/public/tier0/annotations.h new file mode 100644 index 000000000..7e0f46987 --- /dev/null +++ b/public/tier0/annotations.h @@ -0,0 +1,84 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +#ifndef ANALYSIS_ANNOTATIONS_H +#define ANALYSIS_ANNOTATIONS_H + +#if _MSC_VER >= 1600 // VS 2010 and above. +//----------------------------------------------------------------------------- +// Upgrading important helpful warnings to errors +//----------------------------------------------------------------------------- +#pragma warning(error : 4789 ) // warning C4789: destination of memory copy is too small + +// Suppress some code analysis warnings +#ifdef _PREFAST_ +// Include the annotation header file. +#include + +// For temporarily suppressing warnings -- the warnings are suppressed for the next source line. +#define ANALYZE_SUPPRESS(wnum) __pragma(warning(suppress: wnum)) +#define ANALYZE_SUPPRESS2(wnum1, wnum2) __pragma(warning(supress: wnum1 wnum2)) +#define ANALYZE_SUPPRESS3(wnum1, wnum2, wnum3) __pragma(warning(suppress: wnum1 wnum2 wnum3)) +#define ANALYZE_SUPPRESS4(wnum1, wnum2, wnum3, wnum4) __pragma(warning(suppress: wnum1 wnum2 wnum3 wnum4)) + +// Tag all printf style format strings with this +#define PRINTF_FORMAT_STRING _Printf_format_string_ +#define SCANF_FORMAT_STRING _Scanf_format_string_impl_ +// Various macros for specifying the capacity of the buffer pointed +// to by a function parameter. Variations include in/out/inout, +// CAP (elements) versus BYTECAP (bytes), and null termination or +// not (_Z). +#define IN_Z _In_z_ +#define IN_CAP(x) _In_count_(x) +#define IN_BYTECAP(x) _In_bytecount_(x) +#define OUT_Z_CAP(x) _Out_z_cap_(x) +#define OUT_CAP(x) _Out_cap_(x) +#define OUT_CAP_C(x) _Out_cap_c_(x) // Output buffer with specified *constant* capacity in elements +#define OUT_BYTECAP(x) _Out_bytecap_(x) +#define OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) +#define INOUT_BYTECAP(x) _Inout_bytecap_(x) +#define INOUT_Z_CAP(x) _Inout_z_cap_(x) +#define INOUT_Z_BYTECAP(x) _Inout_z_bytecap_(x) +// These macros are use for annotating array reference parameters, typically used in functions +// such as V_strcpy_safe. Because they are array references the capacity is already known. +#if _MSC_VER >= 1700 +#define IN_Z_ARRAY _Pre_z_ +#define OUT_Z_ARRAY _Post_z_ +#define INOUT_Z_ARRAY _Prepost_z_ +#else +#define IN_Z_ARRAY _Deref_pre_z_ +#define OUT_Z_ARRAY _Deref_post_z_ +#define INOUT_Z_ARRAY _Deref_prepost_z_ +#endif // _MSC_VER >= 1700 +// Used for annotating functions to describe their return types. +#define MUST_CHECK_RETURN _Check_return_ +// Use the macros above to annotate string functions that fill buffers as shown here, +// in order to give VS's /analyze more opportunities to find bugs. +// void V_wcsncpy( OUT_Z_BYTECAP(maxLenInBytes) wchar_t *pDest, wchar_t const *pSrc, int maxLenInBytes ); +// int V_snwprintf( OUT_Z_CAP(maxLenInCharacters) wchar_t *pDest, int maxLenInCharacters, PRINTF_FORMAT_STRING const wchar_t *pFormat, ... ); + +#endif // _PREFAST_ +#endif // _MSC_VER >= 1600 // VS 2010 and above. + +#ifndef ANALYZE_SUPPRESS +#define ANALYZE_SUPPRESS(wnum) +#define ANALYZE_SUPPRESS2(wnum1, wnum2) +#define ANALYZE_SUPPRESS3(wnum1, wnum2, wnum3) +#define ANALYZE_SUPPRESS4(wnum1, wnum2, wnum3, wnum4) +#define PRINTF_FORMAT_STRING +#define SCANF_FORMAT_STRING +#define IN_Z +#define IN_CAP(x) +#define IN_BYTECAP(x) +#define OUT_Z_CAP(x) +#define OUT_CAP(x) +#define OUT_CAP_C(x) +#define OUT_BYTECAP(x) +#define OUT_Z_BYTECAP(x) +#define INOUT_BYTECAP(x) +#define INOUT_Z_CAP(x) +#define INOUT_Z_BYTECAP(x) +#define OUT_Z_ARRAY +#define INOUT_Z_ARRAY +#define MUST_CHECK_RETURN +#endif + +#endif // ANALYSIS_ANNOTATIONS_H diff --git a/public/tier0/dbg.h b/public/tier0/dbg.h index 8d0f9e640..d1b509661 100644 --- a/public/tier0/dbg.h +++ b/public/tier0/dbg.h @@ -47,6 +47,27 @@ #endif // BUILD_AS_DLL +enum SpewType_t +{ + SPEW_MESSAGE = 0, + SPEW_WARNING, + SPEW_ASSERT, + SPEW_ERROR, + SPEW_LOG, + + SPEW_TYPE_COUNT +}; + +enum SpewRetval_t +{ + SPEW_DEBUGGER = 0, + SPEW_CONTINUE, + SPEW_ABORT +}; + +/* type of externally defined function used to display debug spew */ +typedef SpewRetval_t (*SpewOutputFunc_t)( SpewType_t spewType, const tchar *pMsg ); + class Color; diff --git a/public/tier0/fasttimer.h b/public/tier0/fasttimer.h index d59a93a57..315db9ba7 100644 --- a/public/tier0/fasttimer.h +++ b/public/tier0/fasttimer.h @@ -558,7 +558,7 @@ class CLimitTimer { public: void SetLimit( uint64 m_cMicroSecDuration ); - bool BLimitReached( void ); + bool BLimitReached( void ) const; private: int64 m_lCycleLimit; @@ -582,7 +582,7 @@ inline void CLimitTimer::SetLimit( uint64 m_cMicroSecDuration ) // Purpose: Determines whether our specified time period has passed // Output: true if at least the specified time period has passed //----------------------------------------------------------------------------- -inline bool CLimitTimer::BLimitReached( ) +inline bool CLimitTimer::BLimitReached( ) const { CCycleCount cycleCount; cycleCount.Sample( ); diff --git a/public/tier0/platform.h b/public/tier0/platform.h index b387a4995..0dd4d4c7b 100644 --- a/public/tier0/platform.h +++ b/public/tier0/platform.h @@ -131,6 +131,8 @@ typedef unsigned __int32 uintp; #define __m128 __vector4 #endif +#define OVERRIDE override + #else // _WIN32 typedef short int16; @@ -147,8 +149,21 @@ typedef int intp; typedef unsigned int uintp; #endif +#undef OVERRIDE +#if __cplusplus >= 201103L + #define OVERRIDE override + #if defined(__clang__) + // warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] + // Disabling this warning is less intrusive than enabling C++11 extensions + #pragma GCC diagnostic ignored "-Wc++11-extensions" + #endif +#else + #define OVERRIDE +#endif + #endif // else _WIN32 +typedef uint32 RTime32; typedef float float32; typedef double float64; @@ -159,8 +174,7 @@ typedef unsigned int uint; #ifdef GNUC #undef offsetof -//#define offsetof( type, var ) __builtin_offsetof( type, var ) -#define offsetof(s,m) (size_t)&(((s *)0)->m) +#define offsetof( type, var ) __builtin_offsetof( type, var ) #else #include #undef offsetof @@ -330,6 +344,7 @@ typedef void * HINSTANCE; #error #endif +#include "annotations.h" // Linux had a few areas where it didn't construct objects in the same order that Windows does. // So when CVProfile::CVProfile() would access g_pMemAlloc, it would crash because the allocator wasn't initalized yet. @@ -444,7 +459,7 @@ typedef void * HINSTANCE; #define stackfree( _p ) #elif defined(_LINUX) || defined(__APPLE__) // Alloca defined for this platform -#define stackalloc( _size ) _alloca( ALIGN_VALUE( _size, 16 ) ) +#define stackalloc( _size ) alloca( ALIGN_VALUE( _size, 16 ) ) #define stackfree( _p ) #endif diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index 128966c84..e4cd3ef41 100644 --- a/public/tier0/threadtools.h +++ b/public/tier0/threadtools.h @@ -1095,6 +1095,8 @@ class TT_CLASS CThread // Access the thread handle directly HANDLE GetThreadHandle(); uint GetThreadId(); +#elif defined( LINUX ) + uint GetThreadId(); #endif //----------------------------------------------------- diff --git a/public/tier0/valve_minmax_off.h b/public/tier0/valve_minmax_off.h new file mode 100644 index 000000000..633a37809 --- /dev/null +++ b/public/tier0/valve_minmax_off.h @@ -0,0 +1,7 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +#ifdef min + #undef min +#endif +#ifdef max + #undef max +#endif diff --git a/public/tier0/valve_minmax_on.h b/public/tier0/valve_minmax_on.h new file mode 100644 index 000000000..738eabc16 --- /dev/null +++ b/public/tier0/valve_minmax_on.h @@ -0,0 +1,9 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +#if !defined(POSIX) +#ifndef min + #define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef max + #define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#endif diff --git a/public/tier1/KeyValues.h b/public/tier1/KeyValues.h index 7eb2f026c..9cce28d16 100644 --- a/public/tier1/KeyValues.h +++ b/public/tier1/KeyValues.h @@ -30,6 +30,15 @@ class CUtlBuffer; class Color; typedef void * FileHandle_t; +#define FOR_EACH_SUBKEY( kvRoot, kvSubKey ) \ + for ( KeyValues * kvSubKey = kvRoot->GetFirstSubKey(); kvSubKey != NULL; kvSubKey = kvSubKey->GetNextKey() ) + +#define FOR_EACH_TRUE_SUBKEY( kvRoot, kvSubKey ) \ + for ( KeyValues * kvSubKey = kvRoot->GetFirstTrueSubKey(); kvSubKey != NULL; kvSubKey = kvSubKey->GetNextTrueSubKey() ) + +#define FOR_EACH_VALUE( kvRoot, kvValue ) \ + for ( KeyValues * kvValue = kvRoot->GetFirstValue(); kvValue != NULL; kvValue = kvValue->GetNextValue() ) + //----------------------------------------------------------------------------- // Purpose: Simple recursive data access class // Used in vgui for message parameters and resource files @@ -146,6 +155,7 @@ class KeyValues const wchar_t *GetWString( const char *keyName = NULL, const wchar_t *defaultValue = L"" ); void *GetPtr( const char *keyName = NULL, void *defaultValue = (void*)0 ); Color GetColor( const char *keyName = NULL /* default value is all black */); + bool GetBool( const char *keyName = NULL, bool defaultValue = false ) { return GetInt( keyName, defaultValue ? 1 : 0 ) ? true : false; } bool IsEmpty(const char *keyName = NULL); // Data access @@ -155,6 +165,7 @@ class KeyValues const wchar_t *GetWString( int keySymbol, const wchar_t *defaultValue = L"" ); void *GetPtr( int keySymbol, void *defaultValue = (void*)0 ); Color GetColor( int keySymbol /* default value is all black */); + bool GetBool( int keySymbol, bool defaultValue = false ) { return GetInt( keySymbol, defaultValue ? 1 : 0 ) ? true : false; } bool IsEmpty( int keySymbol ); // Key writing @@ -354,4 +365,13 @@ inline bool KeyValues::IsEmpty( int keySymbol ) bool EvaluateConditional( const char *str ); +class CUtlSortVectorKeyValuesByName +{ +public: + bool Less( const KeyValues* lhs, const KeyValues* rhs, void * ) + { + return Q_stricmp( lhs->GetName(), rhs->GetName() ) < 0; + } +}; + #endif // KEYVALUES_H diff --git a/public/tier1/UtlSortVector.h b/public/tier1/UtlSortVector.h index 3844f0a63..08ad33397 100644 --- a/public/tier1/UtlSortVector.h +++ b/public/tier1/UtlSortVector.h @@ -1,4 +1,4 @@ -//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright ? 1996-2005, Valve Corporation, All rights reserved. ======// // // $Header: $ // $NoKeywords: $ @@ -32,34 +32,62 @@ extern void *g_pUtlSortVectorQSortContext; #endif -template -class CUtlSortVector : public CUtlVector +template +class CUtlSortVectorDefaultLess { public: + bool Less( const T& lhs, const T& rhs, void * ) + { + return lhs < rhs; + } +}; - // constructor +template , class BaseVector = CUtlVector > +class CUtlSortVector : public BaseVector +{ + typedef BaseVector BaseClass; +public: + /// constructor CUtlSortVector( int nGrowSize = 0, int initSize = 0 ); CUtlSortVector( T* pMemory, int numElements ); - // inserts (copy constructs) an element in sorted order into the list + /// inserts (copy constructs) an element in sorted order into the list int Insert( const T& src ); - // Finds an element within the list using a binary search - int Find( const T& search ) const; - int FindLessOrEqual( const T& search ) const; - int FindLess( const T& search ) const; + /// inserts (copy constructs) an element in sorted order into the list if it isn't already in the list + int InsertIfNotFound( const T& src ); + + /// Finds an element within the list using a binary search. These are templatized based upon the key + /// in which case the less function must handle the Less function for key, T and T, key + template< typename TKey > + int Find( const TKey& search ) const; + template< typename TKey > + int FindLessOrEqual( const TKey& search ) const; + template< typename TKey > + int FindLess( const TKey& search ) const; - // Removes a particular element + /// Removes a particular element void Remove( const T& search ); void Remove( int i ); - // Allows methods to set a context to be used with the less function.. + /// Allows methods to set a context to be used with the less function.. void SetLessContext( void *pCtx ); - // Note that you can only use this index until sorting is redone!!! + /// A version of insertion that will produce an un-ordered list. + /// Note that you can only use this index until sorting is redone with RedoSort!!! int InsertNoSort( const T& src ); void RedoSort( bool bForceSort = false ); + /// Use this to insert at a specific insertion point; using FindLessOrEqual + /// is required for use this this. This will test that what you've inserted + /// produces a correctly ordered list. + int InsertAfter( int nElemIndex, const T &src ); + + /// finds a particular element using a linear search. Useful when used + /// in between calls to InsertNoSort and RedoSort + template< typename TKey > + int FindUnsorted( const TKey &src ) const; + protected: // No copy constructor CUtlSortVector( const CUtlSortVector & ); @@ -69,10 +97,9 @@ class CUtlSortVector : public CUtlVector int AddToTail(); int InsertBefore( int elem ); int InsertAfter( int elem ); + int InsertBefore( int elem, const T& src ); int AddToHead( const T& src ); int AddToTail( const T& src ); - int InsertBefore( int elem, const T& src ); - int InsertAfter( int elem, const T& src ); int AddMultipleToHead( int num ); int AddMultipleToTail( int num, const T *pToCopy=NULL ); int InsertMultipleBefore( int elem, int num, const T *pToCopy=NULL ); @@ -111,6 +138,9 @@ class CUtlSortVector : public CUtlVector bool m_bNeedsSort; private: + template< typename TKey > + int FindLessOrEqual( const TKey& search, bool *pFound ) const; + void QuickSort( LessFunc& less, int X, int I ); }; @@ -118,23 +148,23 @@ class CUtlSortVector : public CUtlVector //----------------------------------------------------------------------------- // constructor //----------------------------------------------------------------------------- -template -CUtlSortVector::CUtlSortVector( int nGrowSize, int initSize ) : - CUtlVector( nGrowSize, initSize ), m_pLessContext(NULL), m_bNeedsSort( false ) +template +CUtlSortVector::CUtlSortVector( int nGrowSize, int initSize ) : + m_pLessContext(NULL), BaseVector( nGrowSize, initSize ), m_bNeedsSort( false ) { } -template -CUtlSortVector::CUtlSortVector( T* pMemory, int numElements ) : - CUtlVector( pMemory, numElements ), m_pLessContext(NULL), m_bNeedsSort( false ) +template +CUtlSortVector::CUtlSortVector( T* pMemory, int numElements ) : + m_pLessContext(NULL), BaseVector( pMemory, numElements ), m_bNeedsSort( false ) { } //----------------------------------------------------------------------------- // Allows methods to set a context to be used with the less function.. //----------------------------------------------------------------------------- -template -void CUtlSortVector::SetLessContext( void *pCtx ) +template +void CUtlSortVector::SetLessContext( void *pCtx ) { m_pLessContext = pCtx; } @@ -142,36 +172,73 @@ void CUtlSortVector::SetLessContext( void *pCtx ) //----------------------------------------------------------------------------- // grows the vector //----------------------------------------------------------------------------- -template -int CUtlSortVector::Insert( const T& src ) +template +int CUtlSortVector::Insert( const T& src ) { AssertFatal( !m_bNeedsSort ); int pos = FindLessOrEqual( src ) + 1; - CUtlVector::GrowVector(); - CUtlVector::ShiftElementsRight(pos); - CopyConstruct( &CUtlVector::Element(pos), src ); + this->GrowVector(); + this->ShiftElementsRight(pos); + CopyConstruct( &this->Element(pos), src ); return pos; } -template -int CUtlSortVector::InsertNoSort( const T& src ) +template +int CUtlSortVector::InsertNoSort( const T& src ) { m_bNeedsSort = true; - int lastElement = CUtlVector::m_Size; + int lastElement = BaseVector::m_Size; // Just stick the new element at the end of the vector, but don't do a sort - CUtlVector::GrowVector(); - CUtlVector::ShiftElementsRight(lastElement); - CopyConstruct( &CUtlVector::Element(lastElement), src ); + this->GrowVector(); + this->ShiftElementsRight(lastElement); + CopyConstruct( &this->Element(lastElement), src ); return lastElement; } -template -void CUtlSortVector::QuickSort( LessFunc& less, int nLower, int nUpper ) +/// inserts (copy constructs) an element in sorted order into the list if it isn't already in the list +template +int CUtlSortVector::InsertIfNotFound( const T& src ) +{ + AssertFatal( !m_bNeedsSort ); + bool bFound; + int pos = FindLessOrEqual( src, &bFound ); + if ( bFound ) + return pos; + + ++pos; + this->GrowVector(); + this->ShiftElementsRight(pos); + CopyConstruct( &this->Element(pos), src ); + return pos; +} + +template +int CUtlSortVector::InsertAfter( int nIndex, const T &src ) +{ + int nInsertedIndex = this->BaseClass::InsertAfter( nIndex, src ); + +#ifdef DEBUG + LessFunc less; + if ( nInsertedIndex > 0 ) + { + Assert( less.Less( this->Element(nInsertedIndex-1), src, m_pLessContext ) ); + } + if ( nInsertedIndex < BaseClass::Count()-1 ) + { + Assert( less.Less( src, this->Element(nInsertedIndex+1), m_pLessContext ) ); + } +#endif + return nInsertedIndex; +} + + +template +void CUtlSortVector::QuickSort( LessFunc& less, int nLower, int nUpper ) { #ifdef _WIN32 typedef int (__cdecl *QSortCompareFunc_t)(void *context, const void *, const void *); - if ( Count() > 1 ) + if ( this->Count() > 1 ) { QSortContext_t ctx; ctx.m_pLessContext = m_pLessContext; @@ -181,48 +248,49 @@ void CUtlSortVector::QuickSort( LessFunc& less, int nLower, int nUp } #else typedef int (__cdecl *QSortCompareFunc_t)( const void *, const void *); - if ( CUtlVector::Count() > 1 ) + if ( this->Count() > 1 ) { QSortContext_t ctx; ctx.m_pLessContext = m_pLessContext; ctx.m_pLessFunc = &less; g_pUtlSortVectorQSortContext = &ctx; - qsort( CUtlVector::Base(), CUtlVector::Count(), sizeof(T), (QSortCompareFunc_t)&CUtlSortVector::CompareHelper ); + qsort( this->Base(), this->Count(), sizeof(T), (QSortCompareFunc_t)&CUtlSortVector::CompareHelper ); } #endif } -template -void CUtlSortVector::RedoSort( bool bForceSort /*= false */ ) +template +void CUtlSortVector::RedoSort( bool bForceSort /*= false */ ) { if ( !m_bNeedsSort && !bForceSort ) return; m_bNeedsSort = false; LessFunc less; - QuickSort( less, 0, CUtlVector::Count() - 1 ); + QuickSort( less, 0, this->Count() - 1 ); } //----------------------------------------------------------------------------- // finds a particular element //----------------------------------------------------------------------------- -template -int CUtlSortVector::Find( const T& src ) const +template +template < typename TKey > +int CUtlSortVector::Find( const TKey& src ) const { AssertFatal( !m_bNeedsSort ); LessFunc less; - int start = 0, end = CUtlVector::Count() - 1; + int start = 0, end = this->Count() - 1; while (start <= end) { int mid = (start + end) >> 1; - if ( less.Less( CUtlVector::Element(mid), src, m_pLessContext ) ) + if ( less.Less( this->Element(mid), src, m_pLessContext ) ) { start = mid + 1; } - else if ( less.Less( src, CUtlVector::Element(mid), m_pLessContext ) ) + else if ( less.Less( src, this->Element(mid), m_pLessContext ) ) { end = mid - 1; } @@ -235,46 +303,81 @@ int CUtlSortVector::Find( const T& src ) const } +//----------------------------------------------------------------------------- +// finds a particular element using a linear search. Useful when used +// in between calls to InsertNoSort and RedoSort +//----------------------------------------------------------------------------- +template< class T, class LessFunc, class BaseVector > +template < typename TKey > +int CUtlSortVector::FindUnsorted( const TKey &src ) const +{ + LessFunc less; + int nCount = this->Count(); + for ( int i = 0; i < nCount; ++i ) + { + if ( less.Less( this->Element(i), src, m_pLessContext ) ) + continue; + if ( less.Less( src, this->Element(i), m_pLessContext ) ) + continue; + return i; + } + return -1; +} + + //----------------------------------------------------------------------------- // finds a particular element //----------------------------------------------------------------------------- -template -int CUtlSortVector::FindLessOrEqual( const T& src ) const +template +template < typename TKey > +int CUtlSortVector::FindLessOrEqual( const TKey& src, bool *pFound ) const { AssertFatal( !m_bNeedsSort ); LessFunc less; - int start = 0, end = CUtlVector::Count() - 1; + int start = 0, end = this->Count() - 1; while (start <= end) { int mid = (start + end) >> 1; - if ( less.Less( CUtlVector::Element(mid), src, m_pLessContext ) ) + if ( less.Less( this->Element(mid), src, m_pLessContext ) ) { start = mid + 1; } - else if ( less.Less( src, CUtlVector::Element(mid), m_pLessContext ) ) + else if ( less.Less( src, this->Element(mid), m_pLessContext ) ) { end = mid - 1; } else { + *pFound = true; return mid; } } + + *pFound = false; return end; } -template -int CUtlSortVector::FindLess( const T& src ) const +template +template < typename TKey > +int CUtlSortVector::FindLessOrEqual( const TKey& src ) const +{ + bool bFound; + return FindLessOrEqual( src, &bFound ); +} + +template +template < typename TKey > +int CUtlSortVector::FindLess( const TKey& src ) const { AssertFatal( !m_bNeedsSort ); LessFunc less; - int start = 0, end = CUtlVector::Count() - 1; + int start = 0, end = this->Count() - 1; while (start <= end) { int mid = (start + end) >> 1; - if ( less.Less( CUtlVector::Element(mid), src, m_pLessContext ) ) + if ( less.Less( this->Element(mid), src, m_pLessContext ) ) { start = mid + 1; } @@ -290,22 +393,22 @@ int CUtlSortVector::FindLess( const T& src ) const //----------------------------------------------------------------------------- // Removes a particular element //----------------------------------------------------------------------------- -template -void CUtlSortVector::Remove( const T& search ) +template +void CUtlSortVector::Remove( const T& search ) { AssertFatal( !m_bNeedsSort ); int pos = Find(search); if (pos != -1) { - CUtlVector::Remove(pos); + BaseVector::Remove(pos); } } -template -void CUtlSortVector::Remove( int i ) +template +void CUtlSortVector::Remove( int i ) { - CUtlVector::Remove( i ); + BaseVector::Remove( i ); } #endif // UTLSORTVECTOR_H diff --git a/public/tier1/checksum_sha1.h b/public/tier1/checksum_sha1.h new file mode 100644 index 000000000..7c87aa5c7 --- /dev/null +++ b/public/tier1/checksum_sha1.h @@ -0,0 +1,174 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Implementation of SHA-1 +// +//============================================================================= + +#ifndef CHECKSUM_SHA1_H +#define CHECKSUM_SHA1_H + +#if defined( _WIN32 ) +#pragma once +#endif + +/* + 100% free public domain implementation of the SHA-1 + algorithm by Dominik Reichl + + + === Test Vectors (from FIPS PUB 180-1) === + + SHA1("abc") = + A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D + + SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = + 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 + + SHA1(A million repetitions of "a") = + 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F +*/ + +#if !defined(_MINIMUM_BUILD_) +#include // Needed for file access +#if defined( _PS3 ) +#include +#else +#include +#endif +#include // Needed for strcat and strcpy +#endif + +// If you're compiling big endian, just comment out the following line +#define SHA1_LITTLE_ENDIAN + +typedef union +{ + unsigned char c[64]; + unsigned long l[16]; +} SHA1_WORKSPACE_BLOCK; + +// SHA1 hash +const unsigned int k_cubHash = 20; +const unsigned int k_cchHash = 41; // k_cubHash * 2, plus 1 for terminator +#pragma pack( push, 1 ) +typedef unsigned char SHADigest_t[ k_cubHash ]; +#pragma pack( pop ) + +#if !defined(_MINIMUM_BUILD_) +class CSHA1 +#else +class Minimum_CSHA1 +#endif +{ +public: + // Two different formats for ReportHash(...) + enum + { + REPORT_HEX = 0, + REPORT_DIGIT = 1 + }; + + // Constructor and Destructor +#if !defined(_MINIMUM_BUILD_) + CSHA1(); + virtual ~CSHA1() ; +#else + Minimum_CSHA1() ; + ~Minimum_CSHA1() ; // no virtual destructor's in the minimal builds ! +#endif + + unsigned long m_state[5]; + unsigned long m_count[2]; + unsigned char m_buffer[64]; + unsigned char m_digest[k_cubHash]; + + void Reset(); + + // Update the hash value + void Update(unsigned char *data, unsigned int len); +#if !defined(_MINIMUM_BUILD_) + bool HashFile(char *szFileName); +#endif + + // Finalize hash and report + void Final(); +#if !defined(_MINIMUM_BUILD_) + void ReportHash(char *szReport, unsigned char uReportType = REPORT_HEX); +#endif + void GetHash(unsigned char *uDest); + +private: + // Private SHA-1 transformation + void Transform(unsigned long state[5], unsigned char buffer[64]); + + // Member variables + unsigned char m_workspace[64]; + SHA1_WORKSPACE_BLOCK *m_block; // SHA1 pointer to the byte array above +}; + +#define GenerateHash( hash, pubData, cubData ) { CSHA1 sha1; sha1.Update( (byte *)pubData, cubData ); sha1.Final(); sha1.GetHash( hash ); } + +#if !defined(_MINIMUM_BUILD_) +// hash comparison function, for use with CUtlMap/CUtlRBTree +bool HashLessFunc( SHADigest_t const &lhs, SHADigest_t const &rhs ); + +// utility class for manipulating SHA1 hashes in their compact form +struct CSHA +{ +public: + SHADigest_t m_shaDigest; + + CSHA() + { + memset( m_shaDigest, 0, k_cubHash ); + } + + explicit CSHA( const SHADigest_t rhs ) + { + memcpy( m_shaDigest, rhs, k_cubHash ); + } + + SHADigest_t &SHADigest() + { + return m_shaDigest; + } + + bool operator<( const CSHA &rhs ) const + { + return memcmp( m_shaDigest, rhs.m_shaDigest, k_cubHash ) < 0; + } + + bool operator==( const CSHA &rhs ) const + { + return memcmp( m_shaDigest, rhs.m_shaDigest, k_cubHash ) == 0; + } + + bool operator!=( const CSHA &rhs ) const + { + return !(*this == rhs); + } + + bool operator==( const SHADigest_t &rhs ) const + { + return memcmp( m_shaDigest, rhs, k_cubHash ) == 0; + } + + bool operator!=( const SHADigest_t &rhs ) const + { + return !(*this == rhs); + } + + CSHA &operator=( const SHADigest_t rhs ) + { + memcpy( m_shaDigest, rhs, k_cubHash ); + return *this; + } + + void AssignTo( SHADigest_t rhs ) const + { + memcpy( rhs, m_shaDigest, k_cubHash ); + } +}; +#endif // _MINIMUM_BUILD_ + +#endif // CHECKSUM_SHA1_H diff --git a/public/tier1/convar.h b/public/tier1/convar.h index e1d816e3b..298b4b168 100644 --- a/public/tier1/convar.h +++ b/public/tier1/convar.h @@ -68,6 +68,7 @@ void ConVar_PublishToVXConsole(); // Called when a ConCommand needs to execute //----------------------------------------------------------------------------- typedef void ( *FnCommandCallbackV1_t )( void ); +typedef void ( *FnCommandCallbackVoid_t )( void ); typedef void ( *FnCommandCallback_t )( const CCommand &command ); #define COMMAND_COMPLETION_MAXITEMS 64 diff --git a/public/tier1/fmtstr.h b/public/tier1/fmtstr.h index 50d9f9f25..2af5515d5 100644 --- a/public/tier1/fmtstr.h +++ b/public/tier1/fmtstr.h @@ -32,6 +32,7 @@ va_end(arg_ptr); \ \ (szBuf)[(nBufSize)-1] = 0; \ + m_nLength = V_strlen( szBuf ); \ } \ while (0) @@ -44,7 +45,7 @@ template class CFmtStrN { public: - CFmtStrN() { m_szBuf[0] = 0; } + CFmtStrN() { m_szBuf[0] = 0; m_nLength = 0; } // Standard C formatting CFmtStrN(const char *pszFormat, ...) { FmtStrVSNPrintf(m_szBuf, SIZE_BUF, &pszFormat); } @@ -61,11 +62,37 @@ class CFmtStrN // Use for access operator const char *() const { return m_szBuf; } char *Access() { return m_szBuf; } - - void Clear() { m_szBuf[0] = 0; } - + char *Get() { return m_szBuf; } + + void Clear() { m_szBuf[0] = 0; m_nLength = 0; } + + void Append( const char *pchValue ) + { + // This function is close to the metal to cut down on the CPU cost + // of the previous incantation of Append which was implemented as + // AppendFormat( "%s", pchValue ). This implementation, though not + // as easy to read, instead does a strcpy from the existing end + // point of the CFmtStrN. This brings something like a 10-20x speedup + // in my rudimentary tests. It isn't using V_strncpy because that + // function doesn't return the number of characters copied, which + // we need to adjust m_nLength. Doing the V_strncpy with a V_strlen + // afterwards took twice as long as this implementations in tests, + // so V_strncpy's implementation was used to write this method. + char *pDest = m_szBuf + m_nLength; + const int maxLen = SIZE_BUF - m_nLength; + char *pLast = pDest + maxLen - 1; + while ( (pDest < pLast) && (*pchValue != 0) ) + { + *pDest = *pchValue; + ++pDest; ++pchValue; + } + *pDest = 0; + m_nLength = pDest - m_szBuf; + } + private: char m_szBuf[SIZE_BUF]; + int m_nLength; }; //----------------------------------------------------------------------------- @@ -76,6 +103,77 @@ class CFmtStrN #define FMTSTR_STD_LEN 256 typedef CFmtStrN CFmtStr; +typedef CFmtStrN<1024> CFmtStr1024; +typedef CFmtStrN<8192> CFmtStrMax; + +class CNumStr +{ +public: + CNumStr() { m_szBuf[0] = 0; } + + explicit CNumStr( bool b ) { SetBool( b ); } + + explicit CNumStr( int8 n8 ) { SetInt8( n8 ); } + explicit CNumStr( uint8 un8 ) { SetUint8( un8 ); } + explicit CNumStr( int16 n16 ) { SetInt16( n16 ); } + explicit CNumStr( uint16 un16 ) { SetUint16( un16 ); } + explicit CNumStr( int32 n32 ) { SetInt32( n32 ); } + explicit CNumStr( uint32 un32 ) { SetUint32( un32 ); } + explicit CNumStr( int64 n64 ) { SetInt64( n64 ); } + explicit CNumStr( uint64 un64 ) { SetUint64( un64 ); } + +#if defined(COMPILER_GCC) && defined(PLATFORM_64BITS) + explicit CNumStr( lint64 n64 ) { SetInt64( (int64)n64 ); } + explicit CNumStr( ulint64 un64 ) { SetUint64( (uint64)un64 ); } +#endif + + explicit CNumStr( double f ) { SetDouble( f ); } + explicit CNumStr( float f ) { SetFloat( f ); } + + inline void SetBool( bool b ) { Q_memcpy( m_szBuf, b ? "1" : "0", 2 ); } + +#ifdef _WIN32 + inline void SetInt8( int8 n8 ) { _itoa( (int32)n8, m_szBuf, 10 ); } + inline void SetUint8( uint8 un8 ) { _itoa( (int32)un8, m_szBuf, 10 ); } + inline void SetInt16( int16 n16 ) { _itoa( (int32)n16, m_szBuf, 10 ); } + inline void SetUint16( uint16 un16 ) { _itoa( (int32)un16, m_szBuf, 10 ); } + inline void SetInt32( int32 n32 ) { _itoa( n32, m_szBuf, 10 ); } + inline void SetUint32( uint32 un32 ) { _i64toa( (int64)un32, m_szBuf, 10 ); } + inline void SetInt64( int64 n64 ) { _i64toa( n64, m_szBuf, 10 ); } + inline void SetUint64( uint64 un64 ) { _ui64toa( un64, m_szBuf, 10 ); } +#else + inline void SetInt8( int8 n8 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)n8 ); } + inline void SetUint8( uint8 un8 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)un8 ); } + inline void SetInt16( int16 n16 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)n16 ); } + inline void SetUint16( uint16 un16 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)un16 ); } + inline void SetInt32( int32 n32 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", n32 ); } + inline void SetUint32( uint32 un32 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%u", un32 ); } + inline void SetInt64( int64 n64 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%lld", n64 ); } + inline void SetUint64( uint64 un64 ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%llu", un64 ); } +#endif + + inline void SetDouble( double f ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%.18g", f ); } + inline void SetFloat( float f ) { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%.18g", f ); } + + inline void SetHexUint64( uint64 un64 ) { Q_binarytohex( (byte *)&un64, sizeof( un64 ), m_szBuf, sizeof( m_szBuf ) ); } + + operator const char *() const { return m_szBuf; } + const char* String() const { return m_szBuf; } + + void AddQuotes() + { + Assert( m_szBuf[0] != '"' ); + const int nLength = Q_strlen( m_szBuf ); + Q_memmove( m_szBuf + 1, m_szBuf, nLength ); + m_szBuf[0] = '"'; + m_szBuf[nLength + 1] = '"'; + m_szBuf[nLength + 2] = 0; + } + +protected: + char m_szBuf[28]; // long enough to hold 18 digits of precision, a decimal, a - sign, e+### suffix, and quotes + +}; //============================================================================= diff --git a/public/tier1/ilocalize.h b/public/tier1/ilocalize.h new file mode 100644 index 000000000..35d8d3aca --- /dev/null +++ b/public/tier1/ilocalize.h @@ -0,0 +1,504 @@ + +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//===========================================================================// + +#ifndef TIER1_ILOCALIZE_H +#define TIER1_ILOCALIZE_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "appframework/IAppSystem.h" +#include + +// unicode character type +// for more unicode manipulation functions #include +#if !defined(_WCHAR_T_DEFINED) && !defined(GNUC) +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + + +// direct references to localized strings +typedef unsigned long StringIndex_t; +const unsigned long INVALID_LOCALIZE_STRING_INDEX = (StringIndex_t) -1; + +//----------------------------------------------------------------------------- +// Purpose: Handles localization of text +// looks up string names and returns the localized unicode text +//----------------------------------------------------------------------------- +abstract_class ILocalize +{ +public: + // adds the contents of a file to the localization table + virtual bool AddFile( const char *fileName, const char *pPathID = NULL, bool bIncludeFallbackSearchPaths = false ) = 0; + + // Remove all strings from the table + virtual void RemoveAll() = 0; + + // Finds the localized text for tokenName + virtual wchar_t *Find(char const *tokenName) = 0; + + // finds the index of a token by token name, INVALID_STRING_INDEX if not found + virtual StringIndex_t FindIndex(const char *tokenName) = 0; + + // gets the values by the string index + virtual const char *GetNameByIndex(StringIndex_t index) = 0; + virtual wchar_t *GetValueByIndex(StringIndex_t index) = 0; + + /////////////////////////////////////////////////////////////////// + // the following functions should only be used by localization editors + + // iteration functions + virtual StringIndex_t GetFirstStringIndex() = 0; + // returns the next index, or INVALID_STRING_INDEX if no more strings available + virtual StringIndex_t GetNextStringIndex(StringIndex_t index) = 0; + + // adds a single name/unicode string pair to the table + virtual void AddString( const char *tokenName, wchar_t *unicodeString, const char *fileName ) = 0; + + // changes the value of a string + virtual void SetValueByIndex(StringIndex_t index, wchar_t *newValue) = 0; + + // saves the entire contents of the token tree to the file + virtual bool SaveToFile( const char *fileName ) = 0; + + // iterates the filenames + virtual int GetLocalizationFileCount() = 0; + virtual const char *GetLocalizationFileName(int index) = 0; + + // returns the name of the file the specified localized string is stored in + virtual const char *GetFileNameByIndex(StringIndex_t index) = 0; + + // for development only, reloads localization files + virtual void ReloadLocalizationFiles( ) = 0; + + virtual const char *FindAsUTF8( const char *pchTokenName ) = 0; + + // need to replace the existing ConstructString with this + virtual void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t *unicodeOutput, int unicodeBufferSizeInBytes, const char *tokenName, KeyValues *localizationVariables) = 0; + virtual void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t *unicodeOutput, int unicodeBufferSizeInBytes, StringIndex_t unlocalizedTextSymbol, KeyValues *localizationVariables) = 0; + + /////////////////////////////////////////////////////////////////// + // static interface + + // converts an english string to unicode + // returns the number of wchar_t in resulting string, including null terminator + static int ConvertANSIToUnicode(const char *ansi, OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t *unicode, int unicodeBufferSizeInBytes); + + // converts an unicode string to an english string + // unrepresentable characters are converted to system default + // returns the number of characters in resulting string, including null terminator + static int ConvertUnicodeToANSI(const wchar_t *unicode, OUT_Z_BYTECAP(ansiBufferSize) char *ansi, int ansiBufferSize); + + // builds a localized formatted string + // uses the format strings first: %s1, %s2, ... unicode strings (wchar_t *) + template < typename T > + static void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T *unicodeOuput, int unicodeBufferSizeInBytes, const T *formatString, int numFormatParameters, ...) + { + va_list argList; + va_start( argList, numFormatParameters ); + + ConstructStringVArgsInternal( unicodeOuput, unicodeBufferSizeInBytes, formatString, numFormatParameters, argList ); + + va_end( argList ); + } + + template < typename T > + static void ConstructStringVArgs(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T *unicodeOuput, int unicodeBufferSizeInBytes, const T *formatString, int numFormatParameters, va_list argList) + { + ConstructStringVArgsInternal( unicodeOuput, unicodeBufferSizeInBytes, formatString, numFormatParameters, argList ); + } + + template < typename T > + static void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T *unicodeOutput, int unicodeBufferSizeInBytes, const T *formatString, KeyValues *localizationVariables) + { + ConstructStringKeyValuesInternal( unicodeOutput, unicodeBufferSizeInBytes, formatString, localizationVariables ); + } + + + // Safe version of Construct String that has the compiler infer the buffer size + template + static void ConstructString_safe( OUT_Z_ARRAY T (&pDest)[maxLenInChars], const T *formatString, int numFormatParameters, ... ) + { + va_list argList; + va_start( argList, numFormatParameters ); + + ConstructStringVArgsInternal( pDest, maxLenInChars * sizeof( *pDest ), formatString, numFormatParameters, argList ); + + va_end( argList ); + } + + template + static void ConstructString_safe( OUT_Z_ARRAY T (&pDest)[maxLenInChars], const T *formatString, KeyValues *localizationVariables ) + { + ConstructStringKeyValuesInternal( pDest, maxLenInChars * sizeof( *pDest ), formatString, localizationVariables ); + } + + // Non-static version to be safe version of the virtual functions that utilize KVP + template + void ConstructString_safe( OUT_Z_ARRAY T( &pDest )[maxLenInChars], const char *formatString, KeyValues *localizationVariables ) + { + ConstructString( pDest, maxLenInChars * sizeof( *pDest ), formatString, localizationVariables ); + } + +private: + // internal "interface" + static void ConstructStringVArgsInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) char *unicodeOutput, int unicodeBufferSizeInBytes, const char *formatString, int numFormatParameters, va_list argList); + static void ConstructStringVArgsInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t *unicodeOutput, int unicodeBufferSizeInBytes, const wchar_t *formatString, int numFormatParameters, va_list argList); + + static void ConstructStringKeyValuesInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) char *unicodeOutput, int unicodeBufferSizeInBytes, const char *formatString, KeyValues *localizationVariables); + static void ConstructStringKeyValuesInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t *unicodeOutput, int unicodeBufferSizeInBytes, const wchar_t *formatString, KeyValues *localizationVariables); +}; + +#ifdef GC + + typedef char locchar_t; + + #define loc_snprintf Q_snprintf + #define loc_sprintf_safe V_sprintf_safe + #define loc_sncat Q_strncat + #define loc_scat_safe V_strcat_safe + #define loc_sncpy Q_strncpy + #define loc_scpy_safe V_strcpy_safe + #define loc_strlen Q_strlen + #define LOCCHAR( x ) x + +#else + + typedef wchar_t locchar_t; + + #define loc_snprintf V_snwprintf + #define loc_sprintf_safe V_swprintf_safe + #define loc_sncat V_wcsncat + #define loc_scat_safe V_wcscat_safe + #define loc_sncpy Q_wcsncpy + #define loc_scpy_safe V_wcscpy_safe + #define loc_strlen Q_wcslen + #define LOCCHAR(x) L ## x + +#endif + +// -------------------------------------------------------------------------- +// Purpose: +// -------------------------------------------------------------------------- + +template < typename T > +class TypedKeyValuesStringHelper +{ +public: + static const T *Read( KeyValues *pKeyValues, const char *pKeyName, const T *pDefaultValue ); + static void Write( KeyValues *pKeyValues, const char *pKeyName, const T *pValue ); +}; + +// -------------------------------------------------------------------------- + +template < > +class TypedKeyValuesStringHelper +{ +public: + static const char *Read( KeyValues *pKeyValues, const char *pKeyName, const char *pDefaultValue ) { return pKeyValues->GetString( pKeyName, pDefaultValue ); } + static void Write( KeyValues *pKeyValues, const char *pKeyName, const char *pValue ) { pKeyValues->SetString( pKeyName, pValue ); } +}; + +// -------------------------------------------------------------------------- + +template < > +class TypedKeyValuesStringHelper +{ +public: + static const wchar_t *Read( KeyValues *pKeyValues, const char *pKeyName, const wchar_t *pDefaultValue ) { return pKeyValues->GetWString( pKeyName, pDefaultValue ); } + static void Write( KeyValues *pKeyValues, const char *pKeyName, const wchar_t *pValue ) { pKeyValues->SetWString( pKeyName, pValue ); } +}; + +// -------------------------------------------------------------------------- +// Purpose: CLocalizedStringArg<> is a class that will take a variable of any +// arbitary type and convert it to a string of whatever character type +// we're using for localization (locchar_t). +// +// Independently it isn't very useful, though it can be used to sort-of- +// intelligently fill out the correct format string. It's designed to be +// used for the arguments of CConstructLocalizedString, which can be of +// arbitrary number and type. +// +// If you pass in a (non-specialized) pointer, the code will assume that +// you meant that pointer to be used as a localized string. This will +// still fail to compile if some non-string type is passed in, but will +// handle weird combinations of const/volatile/whatever automatically. +// -------------------------------------------------------------------------- + +// The base implementation doesn't do anything except fail to compile if you +// use it. Getting an "incomplete type" error here means that you tried to construct +// a localized string with a type that doesn't have a specialization. +template < typename T > +class CLocalizedStringArg; + +// -------------------------------------------------------------------------- + +template < typename T > +class CLocalizedStringArgStringImpl +{ +public: + enum { kIsValid = true }; + + CLocalizedStringArgStringImpl( const locchar_t *pStr ) : m_pStr( pStr ) { } + + const locchar_t *GetLocArg() const { Assert( m_pStr ); return m_pStr; } + +private: + const locchar_t *m_pStr; +}; + +// -------------------------------------------------------------------------- + +template < typename T > +class CLocalizedStringArg : public CLocalizedStringArgStringImpl +{ +public: + CLocalizedStringArg( const locchar_t *pStr ) : CLocalizedStringArgStringImpl( pStr ) { } +}; + +// -------------------------------------------------------------------------- + +template < typename T > +class CLocalizedStringArgPrintfImpl +{ +public: + enum { kIsValid = true }; + + CLocalizedStringArgPrintfImpl( T value, const locchar_t *loc_Format ) { loc_snprintf( m_cBuffer, kBufferSize, loc_Format, value ); } + + const locchar_t *GetLocArg() const { return m_cBuffer; } + +private: + enum { kBufferSize = 128, }; + locchar_t m_cBuffer[ kBufferSize ]; +}; + +// -------------------------------------------------------------------------- + +template < > +class CLocalizedStringArg : public CLocalizedStringArgPrintfImpl +{ +public: + CLocalizedStringArg( uint16 unValue ) : CLocalizedStringArgPrintfImpl( unValue, LOCCHAR("%u") ) { } +}; + +// -------------------------------------------------------------------------- + +template < > +class CLocalizedStringArg : public CLocalizedStringArgPrintfImpl +{ +public: + CLocalizedStringArg( uint32 unValue ) : CLocalizedStringArgPrintfImpl( unValue, LOCCHAR("%u") ) { } +}; + +// -------------------------------------------------------------------------- + +template < > +class CLocalizedStringArg : public CLocalizedStringArgPrintfImpl +{ +public: + CLocalizedStringArg( uint64 unValue ) : CLocalizedStringArgPrintfImpl( unValue, LOCCHAR("%llu") ) { } +}; + +// -------------------------------------------------------------------------- + +template < > +class CLocalizedStringArg : public CLocalizedStringArgPrintfImpl +{ +public: + // Display one decimal point if we've got a value less than one, and no point + // if we're greater than one or are effectively zero. + CLocalizedStringArg( float fValue ) + : CLocalizedStringArgPrintfImpl( fValue, + fabsf( fValue ) <= FLT_EPSILON || fabsf( fValue ) >= 1.0f ? LOCCHAR("%.0f") : LOCCHAR("%.1f") ) + { + // + } +}; + +// -------------------------------------------------------------------------- +// Purpose: +// -------------------------------------------------------------------------- +class CConstructLocalizedString +{ +public: + template < typename T > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0 ) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, sizeof( m_loc_Buffer ), loc_Format, 1, CLocalizedStringArg( arg0 ).GetLocArg() ); + } + } + + template < typename T, typename U > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1 ) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, sizeof( m_loc_Buffer ), loc_Format, 2, CLocalizedStringArg( arg0 ).GetLocArg(), CLocalizedStringArg( arg1 ).GetLocArg() ); + } + } + + template < typename T, typename U, typename V > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1, V arg2 ) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, + sizeof( m_loc_Buffer ), + loc_Format, + 3, + CLocalizedStringArg( arg0 ).GetLocArg(), + CLocalizedStringArg( arg1 ).GetLocArg(), + CLocalizedStringArg( arg2 ).GetLocArg() ); + } + } + + template < typename T, typename U, typename V, typename W > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1, V arg2, W arg3 ) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, + sizeof( m_loc_Buffer ), + loc_Format, + 4, + CLocalizedStringArg( arg0 ).GetLocArg(), + CLocalizedStringArg( arg1 ).GetLocArg(), + CLocalizedStringArg( arg2 ).GetLocArg(), + CLocalizedStringArg( arg3 ).GetLocArg() ); + } + } + + template < typename T, typename U, typename V, typename W, typename X > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4 ) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, + sizeof( m_loc_Buffer ), + loc_Format, + 5, + CLocalizedStringArg( arg0 ).GetLocArg(), + CLocalizedStringArg( arg1 ).GetLocArg(), + CLocalizedStringArg( arg2 ).GetLocArg(), + CLocalizedStringArg( arg3 ).GetLocArg(), + CLocalizedStringArg( arg4 ).GetLocArg() ); + } + } + + template < typename T, typename U, typename V, typename W, typename X, typename Y > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5 ) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, + sizeof( m_loc_Buffer ), + loc_Format, + 6, + CLocalizedStringArg( arg0 ).GetLocArg(), + CLocalizedStringArg( arg1 ).GetLocArg(), + CLocalizedStringArg( arg2 ).GetLocArg(), + CLocalizedStringArg( arg3 ).GetLocArg(), + CLocalizedStringArg( arg4 ).GetLocArg(), + CLocalizedStringArg( arg5 ).GetLocArg() ); + } + } + + template < typename T, typename U, typename V, typename W, typename X, typename Y, typename Z > + CConstructLocalizedString( const locchar_t *loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5, Z arg6) + { + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + COMPILE_TIME_ASSERT( CLocalizedStringArg::kIsValid ); + + m_loc_Buffer[0] = '\0'; + + if ( loc_Format ) + { + ::ILocalize::ConstructString( m_loc_Buffer, + sizeof( m_loc_Buffer ), + loc_Format, + 7, + CLocalizedStringArg( arg0 ).GetLocArg(), + CLocalizedStringArg( arg1 ).GetLocArg(), + CLocalizedStringArg( arg2 ).GetLocArg(), + CLocalizedStringArg( arg3 ).GetLocArg(), + CLocalizedStringArg( arg4 ).GetLocArg(), + CLocalizedStringArg( arg5 ).GetLocArg(), + CLocalizedStringArg( arg6 ).GetLocArg() ); + } + } + + CConstructLocalizedString( const locchar_t *loc_Format, KeyValues *pKeyValues ) + { + m_loc_Buffer[0] = '\0'; + + if ( loc_Format && pKeyValues ) + { + ::ILocalize::ConstructString( m_loc_Buffer, sizeof( m_loc_Buffer ), loc_Format, pKeyValues ); + } + } + + operator const locchar_t *() const + { + return m_loc_Buffer; + } + +private: + enum { kBufferSize = 512, }; + locchar_t m_loc_Buffer[ kBufferSize ]; +}; + +#endif // TIER1_ILOCALIZE_H diff --git a/public/tier1/kvpacker.h b/public/tier1/kvpacker.h new file mode 100644 index 000000000..7e47fa1a9 --- /dev/null +++ b/public/tier1/kvpacker.h @@ -0,0 +1,49 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef KVPACKER_H +#define KVPACKER_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "KeyValues.h" + +//----------------------------------------------------------------------------- +// Purpose: Handles packing KeyValues binary packing and unpacking in a a +// consistent way across all branches, including Steam. If you change +// this packing format you need to do so in a backward compatible way +// so that the Steam servers and all the various GCs can still talk to +// each other. +//----------------------------------------------------------------------------- +class KVPacker +{ +public: + bool WriteAsBinary( KeyValues *pNode, CUtlBuffer &buffer ); + bool ReadAsBinary( KeyValues *pNode, CUtlBuffer &buffer ); + +private: + // These types are used for serialization of KeyValues nodes. + // Do not renumber them or you will break serialization across + // branches. + enum EPackType + { + PACKTYPE_NONE = 0, + PACKTYPE_STRING, + PACKTYPE_INT, + PACKTYPE_FLOAT, + PACKTYPE_PTR, + PACKTYPE_WSTRING, + PACKTYPE_COLOR, + PACKTYPE_UINT64, + PACKTYPE_NULLMARKER, // used to mark the end of a block in the binary format + }; +}; + + +#endif // KVPACKER_H diff --git a/public/tier1/mempool.h b/public/tier1/mempool.h index 3b9278126..e3f707729 100644 --- a/public/tier1/mempool.h +++ b/public/tier1/mempool.h @@ -30,16 +30,24 @@ typedef void (*MemoryPoolReportFunc_t)( char const* pMsg, ... ); +enum MemoryPoolGrowType_t +{ + UTLMEMORYPOOL_GROW_NONE=0, // Don't allow new blobs. + UTLMEMORYPOOL_GROW_FAST=1, // New blob size is numElements * (i+1) (ie: the blocks it allocates + // get larger and larger each time it allocates one). + UTLMEMORYPOOL_GROW_SLOW=2 // New blob size is numElements. +}; + class CMemoryPool { public: // Ways the memory pool can grow when it needs to make a new blob. enum MemoryPoolGrowType_t { - GROW_NONE=0, // Don't allow new blobs. - GROW_FAST=1, // New blob size is numElements * (i+1) (ie: the blocks it allocates + GROW_NONE=UTLMEMORYPOOL_GROW_NONE, // Don't allow new blobs. + GROW_FAST=UTLMEMORYPOOL_GROW_FAST, // New blob size is numElements * (i+1) (ie: the blocks it allocates // get larger and larger each time it allocates one). - GROW_SLOW=2 // New blob size is numElements. + GROW_SLOW=UTLMEMORYPOOL_GROW_SLOW // New blob size is numElements. }; CMemoryPool( int blockSize, int numElements, int growMode = GROW_FAST, const char *pszAllocOwner = NULL, int nAlignment = 0 ); @@ -93,6 +101,8 @@ class CMemoryPool }; +typedef CMemoryPool CUtlMemoryPool; + //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- diff --git a/public/tier1/passwordhash.h b/public/tier1/passwordhash.h new file mode 100644 index 000000000..f557c7f78 --- /dev/null +++ b/public/tier1/passwordhash.h @@ -0,0 +1,94 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Cryptographic hash agility helper definitions +// +//============================================================================= + +#ifndef PASSWORDHASH_H +#define PASSWORDHASH_H + +#if defined( _WIN32 ) +#pragma once +#endif + + +#include "checksum_sha1.h" + +typedef unsigned char BigPasswordHash_t[32]; +typedef unsigned char PBKDF2Hash_t[32]; + +// +// A union of all the possible password hash types. +// When adding to this, if the maximum size of the +// structure has changed then the Account table and +// the AccountSecurityHistory table need to be manually +// revised using something like the following SQL: +// +// ALTER TABLE Account ALTER COLUMN PasswordHash binary(32) +// ALTER TABLE AccountSecurityHistory ALTER COLUMN PasswordHashOld binary(32) +// ALTER TABLE AccountSecurityHistory ALTER COLUMN PasswordHashNew binary(32) +// +// Replace 32 with the new size of PasswordHash_t. +// +// If the width of those columns does not match sizeof(PasswordHash_t), many +// database operations will fail. +// +// Note that while this query was correct at the time this code was checked in, +// it may not be sufficient at the time you actually change the size of the +// type, so look around. +// +typedef union +{ + SHADigest_t sha; + BigPasswordHash_t bigpassword; + PBKDF2Hash_t pbkdf2; +} PasswordHash_t; + + +// +// Enum of all available password hash algorithms. These should +// be consecutive and ordinals should never be reused. +// +// k_EHashSHA1: A salted SHA-1 hash, width 20 bytes. +// k_EHashBigPassword: For testing purposes, a salted SHA-1 hash extended to 32 bytes, with 6 bytes of 0x1 on either side. +// k_EHashPBKDF2_1000: A PKCS#5 v2.0 Password-Based Key Derivation Function hash (PBKDF2-HMAC-SHA256) with 1,000 iterations. +// The digest width is 32 bytes. +// k_EHashPBKDF2_5000: A PKCS#5 v2.0 Password-Based Key Derivation Function hash (PBKDF2-HMAC-SHA256) with 5,000 iterations. +// k_EHashPBKDF2_10000: A PKCS#5 v2.0 Password-Based Key Derivation Function hash (PBKDF2-HMAC-SHA256) with 10,000 iterations. +// k_EHashSHA1WrappedWithPBKDF2_10000: A SHA-1 hash which is then further hashed with PBKDF2 at 10,000 rounds. Used for +// strengthening old hashes in the database that haven't been logged in in a long time. +// +// Make sure to update k_EHashMax when adding new hash types. Also add the length into the k_HashLengths array below. +enum EPasswordHashAlg +{ + k_EHashSHA1 = 0, + k_EHashBigPassword = 1, + k_EHashPBKDF2_1000 = 2, + k_EHashPBKDF2_5000 = 3, + k_EHashPBKDF2_10000 = 4, + k_EHashSHA1WrappedWithPBKDF2_10000 = 5, + k_EHashMax = 5, +}; + +// +// Hash sizes for the various available hash algorithms, +// indexed by EPasswordHashAlg. +const size_t k_HashLengths[] = { + sizeof(SHADigest_t), + sizeof(BigPasswordHash_t), + sizeof(PBKDF2Hash_t), + sizeof(PBKDF2Hash_t), + sizeof(PBKDF2Hash_t), + sizeof(PBKDF2Hash_t), +}; + +#if defined(C_ASSERT) +// +// If you're hitting this assert at compile time, it means that you've added a new +// hash type and properly updated k_EHashMax, but you forgot to add the length +// of the new hash type into k_HashLengths. So do that. +// +C_ASSERT( ( ( sizeof(k_HashLengths) / sizeof(size_t) ) == k_EHashMax + 1 ) ); +#endif + +#endif // PASSWORDHASH_H diff --git a/public/tier1/reliabletimer.h b/public/tier1/reliabletimer.h new file mode 100644 index 000000000..c830fbe34 --- /dev/null +++ b/public/tier1/reliabletimer.h @@ -0,0 +1,183 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef RELIABLETIMER_H +#define RELIABLETIMER_H + +#include "tier0/dbg.h" +//#include "constants.h" +#include "tier0/fasttimer.h" +#include "tier1/tier1.h" +#include "tier1/strtools.h" + +#define DbgAssert Assert +#define kMILLION (1000000) +#define kTHOUSAND (1000) + +// Timer class that uses QueryPerformanceCounter. This is heavier-weight than CFastTimer which uses rdtsc, +// but this is reliable on multi-core systems whereas CFastTimer is not. + +class CReliableTimer +{ +public: + CReliableTimer(); + void Start(); + void End(); + int64 GetMicroseconds(); + int64 GetMilliseconds(); + void SetLimit( uint64 m_cMicroSecDuration ); + bool BLimitReached(); + int64 CMicroSecOverage(); + int64 CMicroSecLeft(); + int64 CMilliSecLeft(); +private: + int64 GetPerformanceCountNow(); + + int64 m_nPerformanceCounterStart; + int64 m_nPerformanceCounterEnd; + int64 m_nPerformanceCounterLimit; + + static int64 sm_nPerformanceFrequency; + static bool sm_bUseQPC; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Records timer start time +//----------------------------------------------------------------------------- +inline void CReliableTimer::Start() +{ + m_nPerformanceCounterStart = GetPerformanceCountNow(); +} + +//----------------------------------------------------------------------------- +// Purpose: Records timer end time +//----------------------------------------------------------------------------- +inline void CReliableTimer::End() +{ + m_nPerformanceCounterEnd = GetPerformanceCountNow(); + + // enforce that we've advanced at least one cycle + if ( m_nPerformanceCounterEnd < m_nPerformanceCounterStart ) + { +#ifdef _SERVER + if ( m_nPerformanceCounterEnd+10000 < m_nPerformanceCounterStart ) + AssertMsgOnce( false, CDbgFmtMsg( "CReliableTimer went backwards - start:%lld end:%lld", m_nPerformanceCounterStart, m_nPerformanceCounterEnd ).ToString() ); +#endif + m_nPerformanceCounterEnd = m_nPerformanceCounterStart + 1; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Gets microseconds elapsed between start and end +//----------------------------------------------------------------------------- +inline int64 CReliableTimer::GetMicroseconds() +{ + DbgAssert( m_nPerformanceCounterStart ); // timer must have been started + DbgAssert( m_nPerformanceCounterEnd ); // timer must have been ended + DbgAssert( 0 != sm_nPerformanceFrequency ); // must have calc'd performance counter frequency + return ( ( m_nPerformanceCounterEnd - m_nPerformanceCounterStart ) * kMILLION / sm_nPerformanceFrequency ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Gets microseconds elapsed between start and end +//----------------------------------------------------------------------------- +inline int64 CReliableTimer::GetMilliseconds() +{ + DbgAssert( m_nPerformanceCounterStart ); // timer must have been started + DbgAssert( m_nPerformanceCounterEnd ); // timer must have been ended + DbgAssert( 0 != sm_nPerformanceFrequency ); // must have calc'd performance counter frequency + return ( ( m_nPerformanceCounterEnd - m_nPerformanceCounterStart ) * kTHOUSAND / sm_nPerformanceFrequency ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Sets a limit on this timer that can subsequently be checked against +//----------------------------------------------------------------------------- +inline void CReliableTimer::SetLimit( uint64 cMicroSecDuration ) +{ + DbgAssert( 0 != sm_nPerformanceFrequency ); // must have calc'd performance counter frequency + m_nPerformanceCounterStart = GetPerformanceCountNow(); + m_nPerformanceCounterLimit = m_nPerformanceCounterStart + ( ( cMicroSecDuration * sm_nPerformanceFrequency ) / kMILLION ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns if previously set limit has been reached +//----------------------------------------------------------------------------- +inline bool CReliableTimer::BLimitReached() +{ + DbgAssert( m_nPerformanceCounterStart ); // SetLimit must have been called + DbgAssert( m_nPerformanceCounterLimit ); // SetLimit must have been called + int64 nPerformanceCountNow = GetPerformanceCountNow(); + + // make sure time advances + if ( nPerformanceCountNow < m_nPerformanceCounterStart ) + { +#ifdef _SERVER + if ( nPerformanceCountNow+10000 < m_nPerformanceCounterStart ) + AssertMsgOnce( false, CDbgFmtMsg( "CReliableTimer went backwards - start:%lld end:%lld", m_nPerformanceCounterStart, m_nPerformanceCounterEnd ).ToString() ); +#endif + // reset the limit to be lower, to match our new clock + m_nPerformanceCounterLimit = nPerformanceCountNow + (m_nPerformanceCounterLimit - m_nPerformanceCounterStart); + } + + return ( nPerformanceCountNow >= m_nPerformanceCounterLimit ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns microseconds current time is past limit, or 0 if not past limit +//----------------------------------------------------------------------------- +inline int64 CReliableTimer::CMicroSecOverage() +{ + DbgAssert( m_nPerformanceCounterStart ); // SetLimit must have been called + DbgAssert( m_nPerformanceCounterLimit ); // SetLimit must have been called + int64 nPerformanceCountNow = GetPerformanceCountNow(); +#ifdef _SERVER + if ( nPerformanceCountNow+10000 < m_nPerformanceCounterStart ) + AssertMsgOnce( nPerformanceCountNow >= m_nPerformanceCounterStart, CDbgFmtMsg( "CReliableTimer went backwards - start:%lld end:%lld", m_nPerformanceCounterStart, m_nPerformanceCounterEnd ).ToString() ); +#endif + int64 nPerformanceCountOver = ( nPerformanceCountNow > m_nPerformanceCounterLimit ? + nPerformanceCountNow - m_nPerformanceCounterLimit : 0 ); + + Assert( 0 != sm_nPerformanceFrequency ); // must have calc'd performance counter frequency + return ( nPerformanceCountOver * kMILLION / sm_nPerformanceFrequency ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns microseconds remaining until limit +//----------------------------------------------------------------------------- +inline int64 CReliableTimer::CMicroSecLeft() +{ + DbgAssert( m_nPerformanceCounterStart ); // SetLimit must have been called + DbgAssert( m_nPerformanceCounterLimit ); // SetLimit must have been called + int64 nPerformanceCountNow = GetPerformanceCountNow(); +#ifdef _SERVER + if ( nPerformanceCountNow+10000 < m_nPerformanceCounterStart ) + AssertMsgOnce( nPerformanceCountNow >= m_nPerformanceCounterStart, CDbgFmtMsg( "CReliableTimer went backwards - start:%lld end:%lld", m_nPerformanceCounterStart, m_nPerformanceCounterEnd ).ToString() ); +#endif + int64 nPerformanceCountLeft = ( nPerformanceCountNow < m_nPerformanceCounterLimit ? + m_nPerformanceCounterLimit - nPerformanceCountNow : 0 ); + + DbgAssert( 0 != sm_nPerformanceFrequency ); // must have calc'd performance counter frequency + return ( nPerformanceCountLeft * kMILLION / sm_nPerformanceFrequency ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns milliseconds remaining until limit +//----------------------------------------------------------------------------- +inline int64 CReliableTimer::CMilliSecLeft() +{ + return CMicroSecLeft() / 1000; +} + + +#endif // TICKLIMITTIMER_H diff --git a/public/tier1/smartptr.h b/public/tier1/smartptr.h index fa17a792c..24a82199c 100644 --- a/public/tier1/smartptr.h +++ b/public/tier1/smartptr.h @@ -66,10 +66,10 @@ class CPlainAutoPtr { public: explicit CPlainAutoPtr( T *p = NULL ) : m_p( p ) {} - ~CPlainAutoPtr( void ) { Delete(); } + ~CPlainAutoPtr( void ) { this->Delete(); } public: - void Delete( void ) { delete Detach(); } + void Delete( void ) { delete this->Detach(); } private: // Disallow copying, use Detach() instead to avoid ambiguity CPlainAutoPtr( CPlainAutoPtr const &x ); @@ -82,8 +82,8 @@ class CPlainAutoPtr public: bool IsValid( void ) const { return m_p != NULL; } T * Get( void ) const { return m_p; } - T * operator -> ( void ) const { return Get(); } - T & operator * ( void ) const { return *Get(); } + T * operator -> ( void ) const { return this->Get(); } + T & operator * ( void ) const { return *this->Get(); } private: T * m_p; @@ -107,14 +107,14 @@ template < typename T > class CArrayAutoPtr : public CPlainAutoPtr < T > // Warning: no polymorphic destructor (delete on base class will be a mistake) { public: - explicit CArrayAutoPtr( T *p = NULL ) { Attach( p ); } - ~CArrayAutoPtr( void ) { Delete(); } + explicit CArrayAutoPtr( T *p = NULL ) { this->Attach( p ); } + ~CArrayAutoPtr( void ) { this->Delete(); } public: - void Delete( void ) { delete [] Detach(); } + void Delete( void ) { delete [] this->Detach(); } public: - T & operator [] ( int k ) const { return Get()[ k ]; } + T & operator [] ( int k ) const { return this->Get()[ k ]; } }; diff --git a/public/tier1/thash.h b/public/tier1/thash.h new file mode 100644 index 000000000..51020749e --- /dev/null +++ b/public/tier1/thash.h @@ -0,0 +1,698 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef THASH_H +#define THASH_H +#ifdef _WIN32 +#pragma once +#endif + +#include + +//#define DBGFLAG_THASH // Perform extra sanity checks on the THash + + +// THash +// This is a heavyweight, templatized version of DHash. +// It differs from DHash in the following ways: +// - It's templetized, and automatically constructs and destructs its records as appropriate +// - It provides a scheduling service, which can be used to touch every record in the table +// at a specified interval. The scheduler is low-overhead, and provides a very smooth +// distribution of touches across frames. + +// Template arguments: +// Data: the class to be stored in the hash table +// I: the type of the primary key (uint32 by default) +template +class CTHash +{ +private: + // RecHdr + // We insert one of these at the beginning of every record. It's used for + // keeping the records in a linked list. + typedef struct RecHdr_t + { + RecHdr_t *m_pRecHdrNext; // Next item in our linked list + RecHdr_t *m_pRecHdrPrev; // Previous item in our linked list + I m_unKey; // Key of this item + int m_iBucket; // The bucket we're in + int m_nRunRatio; // We want to run 1 cycle out of every m_nRunRatio + // cycles (not at all if 0). +#ifdef DBGFLAG_THASH + uint m_iCycleLast; // Last cycle we were visited (whether or not we ran) +#endif + } RecHdr_t; + + // Bucket + // Each hash bucket is represented by a Bucket structure, which points to the + // first record with the bucket's hash. + typedef struct Bucket_t + { + RecHdr_t *m_pRecHdrFirst; // First record in our list + } Bucket_t; + + +public: + // Constructors & destructors + CTHash( int cFramesPerCycle ); + ~CTHash(); + + // Initializer + void Init( int cRecordInit, int cBuckets ); + + // Insert a record into the table + Data *PvRecordInsert( I unKey ); + // Insert a record into the table and set the allocated object's pointer as the hash key + Data *PvRecordInsertAutoKey(); + // Changes the key for a previously inserted item + void ChangeKey( Data * pvRecord, I unOldKey, I unNewKey ); + + // Remove a record + void Remove( I unKey ); + // Remove a record + void Remove( Data * pvRecord ); + // Remove all records + void RemoveAll(); + + // Find a record + Data *PvRecordFind( I unKey ) const; + + // How many records do we have + int Count() const { return m_cRecordInUse; } + + // Iterate through our members + Data *PvRecordFirst() const; + Data *PvRecordNext( Data *pvRecordCur ) const; + + // We provide a scheduling service. Call StartFrameSchedule when you want to start running + // records in a given frame, and repeatedly call PvRecordRun until it returns NULL (or you + // run our of time). + void SetRunRatio( Data *pvRecord, int nRunRatio ); + void SetMicroSecPerCycle( int cMicroSecPerCycle, int cMicroSecPerFrame ) { m_cFramesPerCycle = cMicroSecPerCycle / cMicroSecPerFrame; } + void StartFrameSchedule( bool bNewFrame ); + Data *PvRecordRun(); + + bool BCompletedPass(); + +#ifdef DBGFLAG_VALIDATE + virtual void Validate( CValidator &validator, const char *pchName ); +#endif // DBGFLAG_VALIDATE + + +private: + // Insert a record into the table + Data *PvRecordInsertInternal( RecHdr_t *pRecHdr, I unKey ); + + // Get the record associated with a THashHdr + Data *PvRecordFromPRecHdr( RecHdr_t *pRecHdr ) const { return ( Data * ) ( ( ( uint8 * ) pRecHdr + sizeof( RecHdr_t ) ) ); } + + // Get the RecHdr preceding a PvRecord + RecHdr_t *PRecHdrFromPvRecord( Data *pvRecord ) const { return ( ( ( RecHdr_t * ) pvRecord ) - 1 ); } + + // Get the hash bucket corresponding to a key + int IBucket( I unKey ) const; + + void InsertIntoHash( RecHdr_t *pRecHdr, I unKey ); + void RemoveFromHash( Data * pvRecord ); + + int m_cBucket; // # of hash buckets we have + Bucket_t *m_pBucket; // Big array of hash buckets + + CUtlMemoryPool *m_pMemoryPoolRecord; // All our data records + + int m_cRecordInUse; // # of records in use + RecHdr_t m_RecHdrHead; // Head of our linked list + RecHdr_t m_RecHdrTail; // Tail of our linked list + + int m_cFramesPerCycle; // Run each of our records once every m_cFramesPerCycle frames + RecHdr_t *m_pRecHdrRunNext; // Next record to run (be careful-- this is more complicated than it sounds) + int m_iBucketRunMax; // Stop running when we get to this bucket + uint m_iCycleCur; // Current cycle (ie, how many times we've made a complete scheduler pass) + uint m_iCycleLast; // Our previous cycle + uint m_iFrameCur; // Our current frame (incremented once each StartFrameSchedule) + uint m_iCycleLastReported; // Last cycle checked by BCompletedPass() +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +// Input: cMicroSecRunInterval - How often we want the scheduler to run each of our records +//----------------------------------------------------------------------------- +template +CTHash::CTHash( int cFramesPerCycle ) +{ + m_cBucket = 0; + m_pBucket = NULL; + m_pMemoryPoolRecord = NULL; + m_cRecordInUse = 0; + + m_cFramesPerCycle = cFramesPerCycle; + m_pRecHdrRunNext = &m_RecHdrTail; // This will make us start at the beginning on our first frame + m_iBucketRunMax = 0; + m_iCycleCur = 0; + m_iCycleLast = 0; + m_iFrameCur = 0; + m_iCycleLastReported = 0; + + m_RecHdrHead.m_pRecHdrPrev = NULL; + m_RecHdrHead.m_pRecHdrNext = &m_RecHdrTail; + m_RecHdrHead.m_iBucket = -1; + + m_RecHdrTail.m_pRecHdrPrev = &m_RecHdrHead; + m_RecHdrTail.m_pRecHdrNext = NULL; +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +template +CTHash::~CTHash() +{ + RemoveAll(); + + if ( NULL != m_pBucket ) + FreePv( m_pBucket ); + m_pBucket = NULL; + + if ( NULL != m_pMemoryPoolRecord ) + delete( m_pMemoryPoolRecord ); + m_pMemoryPoolRecord = NULL; +} + + +//----------------------------------------------------------------------------- +// Purpose: Initializer. Allocate our various arrays, and set up the free +// list. +// Input: cRecordInit - Initial # of data records we can contain +// cBucket - # of hash buckets we should use +//----------------------------------------------------------------------------- +template +void CTHash::Init( int cRecordInit, int cBucket ) +{ + Assert( cRecordInit > 0 ); // need to init with non-zero value or memory pool will never grow + + // Copy our parameters + m_cBucket = cBucket; + + // Alloc our arrays + m_pBucket = ( Bucket_t * ) PvAlloc( sizeof( Bucket_t ) * m_cBucket ); + m_pMemoryPoolRecord = new CUtlMemoryPool( sizeof( Data ) + sizeof( RecHdr_t ), cRecordInit, + CUtlMemoryPool::GROW_SLOW ); + + // Init the hash buckets + for ( int iBucket = 0; iBucket < m_cBucket; iBucket++ ) + m_pBucket[iBucket].m_pRecHdrFirst = NULL; + + // Make the tail have an illegally large bucket + m_RecHdrTail.m_iBucket = m_cBucket + 1; +} + + +//----------------------------------------------------------------------------- +// Purpose: Inserts a new record into the table +// Input: unKey - Primary key of the new record +// Output: Pointer to the new record +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordInsert( I unKey ) +{ + Assert( PvRecordFind( unKey ) == NULL ); // keys are unique; no record with this key may exist + + // Find a free record + RecHdr_t *pRecHdr = ( RecHdr_t * ) m_pMemoryPoolRecord->Alloc(); + + return PvRecordInsertInternal( pRecHdr, unKey ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Inserts a new record into the table and sets its key to the pointer +// value of the record +// Output: Pointer to the new record +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordInsertAutoKey() +{ + // Find a free record + RecHdr_t *pRecHdr = ( RecHdr_t * ) m_pMemoryPoolRecord->Alloc(); + + return PvRecordInsertInternal( pRecHdr, (I) PvRecordFromPRecHdr( pRecHdr ) ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Inserts an allocated record into the hash table with specified key +// and calls the constructor of the allocated object +// Input: pRecHdr - record to insert +// unKey - hash key to use for record +// Output: Pointer to the new record +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordInsertInternal( RecHdr_t *pRecHdr, I unKey ) +{ + InsertIntoHash( pRecHdr, unKey ); + + // assert that we don't have too many items per bucket + static bool s_bPerfWarning = false; + if ( !s_bPerfWarning && Count() >= ( 5 * m_cBucket ) ) + { + s_bPerfWarning = true; + AssertMsg( false, "Performance warning: too many items, not enough buckets" ); + Msg( "not enough buckets in thash class %s (%d records, %d buckets)\n", +#ifdef _WIN32 + typeid(*this).raw_name(), +#else + typeid(*this).name(), +#endif + Count(), m_cBucket ); + } + + // Construct ourselves + Data *pData = PvRecordFromPRecHdr( pRecHdr ); + Construct( pData ); + return pData; +} + +//----------------------------------------------------------------------------- +// Purpose: Changes key on previously inserted item +// Input: pvRecord - record to change key for +// unOldKey - old key (not strictly needed, but helpful consistency check) +// unNewKey - new key to use +//----------------------------------------------------------------------------- +template +void CTHash::ChangeKey( Data * pvRecord, I unOldKey, I unNewKey ) +{ + Data * pvRecordFound = PvRecordFind( unOldKey ); + Assert( pvRecordFound == pvRecord ); + if ( pvRecordFound == pvRecord ) + { + RemoveFromHash( pvRecord ); + InsertIntoHash( PRecHdrFromPvRecord( pvRecord), unNewKey ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes the entry with a specified key from the table +// Input: unKey - Key of the entry to remove +//----------------------------------------------------------------------------- +template +void CTHash::Remove( I unKey ) +{ + Data *pvRemove = ( Data * ) PvRecordFind( unKey ); + Assert( pvRemove ); + if ( !pvRemove ) + return; + Remove( pvRemove ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes the specified entry from the table +// Input: pvRemove - Pointer to the entry to remove +//----------------------------------------------------------------------------- +template +void CTHash::Remove( Data * pvRemove ) +{ + // Destruct the record we're removing + Destruct( pvRemove ); + + RemoveFromHash( pvRemove ); + m_pMemoryPoolRecord->Free( PRecHdrFromPvRecord( pvRemove ) ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes all entries from the table +//----------------------------------------------------------------------------- +template +void CTHash::RemoveAll() +{ + Data * pvRecord = PvRecordFirst(); + while ( pvRecord ) + { + Data *pvRecordNext = PvRecordNext( pvRecord ); + Remove( pvRecord ); + pvRecord = pvRecordNext; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Finds the entry with a specified key +// Input: unKey - Key to find +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordFind( I unKey ) const +{ + // Find our hash bucket + int iBucket = IBucket( unKey ); + + // Walk the bucket's list looking for an exact match + for ( RecHdr_t *pRecHdr = m_pBucket[iBucket].m_pRecHdrFirst; + NULL != pRecHdr && pRecHdr->m_iBucket == iBucket; + pRecHdr = pRecHdr->m_pRecHdrNext ) + { + if ( unKey == pRecHdr->m_unKey ) + return PvRecordFromPRecHdr( pRecHdr ); + } + + // Didn't find a match + return NULL; +} + + +//----------------------------------------------------------------------------- +// Purpose: Finds our first record +// Output: Pointer to our first record +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordFirst() const +{ + if ( &m_RecHdrTail != m_RecHdrHead.m_pRecHdrNext ) + return PvRecordFromPRecHdr( m_RecHdrHead.m_pRecHdrNext ); + else + return NULL; +} + + +//----------------------------------------------------------------------------- +// Purpose: Iterates to the record after a given record +// Input: Pointer to a current record +// Output: Pointer to the next record +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordNext( Data *pvRecordCur ) const +{ + RecHdr_t *pRecHdr = PRecHdrFromPvRecord( pvRecordCur ); + if ( &m_RecHdrTail == pRecHdr->m_pRecHdrNext ) + return NULL; + + return PvRecordFromPRecHdr( pRecHdr->m_pRecHdrNext ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Sets the run ratio of a particular record in the hash table. +// The record will be run 1 cycle out of every nRunRatio cycles. +// Input: pvRecord - The record we're setting +// nRunRatio - The run ratio for this record +//----------------------------------------------------------------------------- +template +void CTHash::SetRunRatio( Data *pvRecord, int nRunRatio ) +{ + PRecHdrFromPvRecord( pvRecord )->m_nRunRatio = nRunRatio; +} + + +//----------------------------------------------------------------------------- +// Purpose: Prepares us to run all records that are due to be run this frame. +// Records are run at a particular time dependent on their hash bucket, +// regardless of when they were last run. +// Input: bNewFrame - True if this is a new frame. If false, we've run +// off the end of the list and are checking whether +// we need to keep going at the beginning. +//----------------------------------------------------------------------------- +template +void CTHash::StartFrameSchedule( bool bNewFrame ) +{ + // Calculate our current frame and cycle cycle + if ( bNewFrame ) + { + m_iCycleLast = m_iCycleCur; + m_iFrameCur++; + m_iCycleCur = m_iFrameCur / m_cFramesPerCycle; + } + + // Calculate the last bucket to run + int iFrameInCycle = m_iFrameCur % m_cFramesPerCycle; + m_iBucketRunMax = ( int ) ( ( ( int64 ) ( iFrameInCycle + 1 ) * ( int64 ) m_cBucket ) + / ( int64 ) m_cFramesPerCycle ); + AssertFatal( m_iBucketRunMax >= 0 && m_iBucketRunMax <= m_cBucket ); + + // Are we starting a new cycle? + if ( m_iCycleCur > m_iCycleLast ) + { +#ifdef DBGFLAG_THASH + Assert( m_iCycleCur == m_iCycleLast + 1 ); +#endif + + // Did we finish the last cycle? + if ( &m_RecHdrTail == m_pRecHdrRunNext ) + { + m_pRecHdrRunNext = m_RecHdrHead.m_pRecHdrNext; + } + // No-- finish it up before moving on + else + { + m_iBucketRunMax = m_cBucket + 1; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns the next record to run, if any +// Output: Pointer to the next record that needs to run (NULL if we're done) +//----------------------------------------------------------------------------- +template +Data *CTHash::PvRecordRun() +{ + // Loop until we find a record to run, or until we pass m_iBucketRunMax + for ( ; ; ) + { + // Are we past our stopping point? + if ( m_pRecHdrRunNext->m_iBucket >= m_iBucketRunMax ) + { + // If this cycle ran to the very end, see if we need to start over + if ( m_iBucketRunMax > m_cBucket ) + { + StartFrameSchedule( false ); + continue; + } + + return NULL; + } + +#ifdef DBGFLAG_THASH + Assert( m_pRecHdrRunNext->m_iBucket >= m_iBucketRunFirst ); + if ( 0 != m_pRecHdrRunNext->m_iCycleLast ) + { + if ( m_pRecHdrRunNext->m_iCycleLast == m_iCycleCur ) + { + DMsg( SPEW_CONSOLE, 1, "Double cycle: hdr = 0x%x, last frame = %d, curFrame = %d, first = %d, last = %d, bucket = %d\n", + m_pRecHdrRunNext, m_pRecHdrRunNext->m_iFrameLast, m_iFrame, + m_iBucketRunFirst, m_iBucketRunMax, m_pRecHdrRunNext->m_iBucket ); + } + else if ( m_pRecHdrRunNext->m_iCycleLast != m_iCycleCur - 1 ) + { + DMsg( SPEW_CONSOLE, 1, "Skipped cycle: hdr = 0x%x, cycleLast = %u, cycleCur = %u (missed %u cycles)\n", + m_pRecHdrRunNext, m_pRecHdrRunNext->m_iCycleLast, m_iCycleCur, + m_iCycleCur - m_pRecHdrRunNext->m_iCycleLast ); + Assert( false ); + } + } + m_pRecHdrRunNext->m_iCycleLast = m_iCycleCur; + m_pRecHdrRunNext->m_iFrameLast = m_iFrame; +#endif + + // Set up the record to run next time + RecHdr_t *pRecHdrCur = m_pRecHdrRunNext; + m_pRecHdrRunNext = m_pRecHdrRunNext->m_pRecHdrNext; + + // Does this record need to run? + if ( 0 == pRecHdrCur->m_nRunRatio ) + continue; + + if ( 0 == m_iCycleCur % pRecHdrCur->m_nRunRatio ) + return PvRecordFromPRecHdr( pRecHdrCur ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Return true if we've completed a scheduler pass since last called +//----------------------------------------------------------------------------- +template +bool CTHash::BCompletedPass() +{ + if ( m_iCycleCur != m_iCycleLastReported ) + { + m_iCycleLastReported = m_iCycleCur; + return true; + } + return false; +} + + +extern const unsigned char g_CTHashRandomValues[256]; // definition lives in globals.cpp + +//----------------------------------------------------------------------------- +// Purpose: Returns the index of the hash bucket corresponding to a particular key +// Input: unKey - Key to find +// Output: Index of the hash bucket corresponding to unKey +//----------------------------------------------------------------------------- +template +int CTHash::IBucket( I unKey ) const +{ + AssertFatal( m_cBucket > 0 ); + + // This is a pearsons hash variant that returns a maximum of 32 bits + size_t size = sizeof(I); + const uint8 * k = (const uint8 *) &unKey; + uint32 byte_one = 0, byte_two = 0, byte_three = 0, byte_four = 0, n; + + while (size) + { + --size; + n = *k++; + byte_one = g_CTHashRandomValues[byte_one ^ n]; + + if (size) + { + --size; + n = *k++; + byte_two = g_CTHashRandomValues[byte_two ^ n]; + } + else + break; + + if (size) + { + --size; + n = *k++; + byte_three = g_CTHashRandomValues[byte_three ^ n]; + } + else + break; + + if (size) + { + --size; + n = *k++; + byte_four = g_CTHashRandomValues[byte_four ^ n]; + } + else + break; + } + + uint32 idx = ( byte_four << 24 ) | ( byte_three << 16 ) | ( byte_two << 8 ) | byte_one; + idx = idx % m_cBucket; + return ( (int) idx ); +} + + +#ifdef DBGFLAG_VALIDATE +//----------------------------------------------------------------------------- +// Purpose: Run a global validation pass on all of our data structures and memory +// allocations. +// Input: validator - Our global validator object +// pchName - Our name (typically a member var in our container) +//----------------------------------------------------------------------------- +template +void CTHash::Validate( CValidator &validator, const char *pchName ) +{ + VALIDATE_SCOPE(); + + validator.ClaimMemory( m_pBucket ); + ValidatePtr( m_pMemoryPoolRecord ); + +#if defined( _DEBUG ) + // first verify m_cRecordInUse + Data * pvRecord = PvRecordFirst(); + int cItems = 0; + while ( pvRecord ) + { + Data *pvRecordNext = PvRecordNext( pvRecord ); + cItems++; + pvRecord = pvRecordNext; + } + Assert( m_cRecordInUse == cItems ); + // then ask the mempool to verify this + if ( m_pMemoryPoolRecord ) + m_pMemoryPoolRecord->LeakCheck( cItems ); +#endif // _DEBUG +} +#endif // DBGFLAG_VALIDATE + + +//----------------------------------------------------------------------------- +// Purpose: Inserts a new record into the table +// Input: unKey - Primary key of the new record +// Output: Pointer to the new record +//----------------------------------------------------------------------------- +template +void CTHash::InsertIntoHash( RecHdr_t *pRecHdr, I unKey ) +{ + m_cRecordInUse++; + + // Init the RecHdr + pRecHdr->m_unKey = unKey; + pRecHdr->m_nRunRatio = 1; + + // Find our hash bucket + int iBucket = IBucket( unKey ); + pRecHdr->m_iBucket = iBucket; +#ifdef DBGFLAG_THASH + pRecHdr->m_iCycleLast = 0; +#endif + + // Find where to insert ourselves in the linked list + RecHdr_t *pRecHdrInsertBefore = &m_RecHdrTail; + // Find the first bucket with anything in it that's at or after our bucket + for ( int iBucketT = iBucket; iBucketT < m_cBucket; iBucketT++ ) + { + if ( NULL != m_pBucket[iBucketT].m_pRecHdrFirst ) + { + pRecHdrInsertBefore = m_pBucket[iBucketT].m_pRecHdrFirst; + break; + } + } + + // Insert ourselves + pRecHdr->m_pRecHdrNext = pRecHdrInsertBefore; + pRecHdr->m_pRecHdrPrev = pRecHdrInsertBefore->m_pRecHdrPrev; + pRecHdrInsertBefore->m_pRecHdrPrev = pRecHdr; + pRecHdr->m_pRecHdrPrev->m_pRecHdrNext = pRecHdr; + + // Our bucket should point to us + m_pBucket[iBucket].m_pRecHdrFirst = pRecHdr; +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes the specified entry from the table +// Input: pvRemove - Pointer to the entry to remove +//----------------------------------------------------------------------------- +template +void CTHash::RemoveFromHash( Data * pvRemove ) +{ + // Find our RecHdr + RecHdr_t *pRecHdr = PRecHdrFromPvRecord( pvRemove ); + + // If our bucket points to us, point it to the next record (or else NULL) + int iBucket = IBucket( pRecHdr->m_unKey ); + if ( pRecHdr == m_pBucket[iBucket].m_pRecHdrFirst ) + { + if ( pRecHdr->m_pRecHdrNext->m_iBucket == iBucket ) + m_pBucket[iBucket].m_pRecHdrFirst = pRecHdr->m_pRecHdrNext; + else + m_pBucket[iBucket].m_pRecHdrFirst = NULL; + } + + // Remove us from the linked list + pRecHdr->m_pRecHdrPrev->m_pRecHdrNext = pRecHdr->m_pRecHdrNext; + pRecHdr->m_pRecHdrNext->m_pRecHdrPrev = pRecHdr->m_pRecHdrPrev; + + // Are we the next record to run? + if ( pRecHdr == m_pRecHdrRunNext ) + m_pRecHdrRunNext = pRecHdr->m_pRecHdrNext; + + m_cRecordInUse--; +} + +#endif // THASH_H diff --git a/public/tier1/utlallocation.h b/public/tier1/utlallocation.h new file mode 100644 index 000000000..65416bcfe --- /dev/null +++ b/public/tier1/utlallocation.h @@ -0,0 +1,134 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// The CUtlAllocation class: +// A single allocation in the style of CUtlMemory/CUtlString/CUtlBuffer +// as compact as possible, no virtuals or extraneous data +// to be used primarily to replace CUtlBuffer +//============================================================================= + +#ifndef UTLALLOCATION_H +#define UTLALLOCATION_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tier1/utlmemory.h" + +class CUtlAllocation +{ +public: + + // constructor, destructor + CUtlAllocation() + { + m_pMemory = NULL; + } + + CUtlAllocation( const void *pMemory, int cub ) + { + m_pMemory = NULL; + Copy( pMemory, cub ); + } + + CUtlAllocation( CUtlAllocation const &src ) + { + m_pMemory = NULL; + Copy( src ); + } + + ~CUtlAllocation() + { + Purge(); + } + + CUtlAllocation &operator=( CUtlAllocation const &src ) + { + Copy( src ); + return *this; + } + + bool operator==( CUtlAllocation const &src ) + { + if ( Count() != src.Count() ) + return false; + return Q_memcmp( Base(), src.Base(), Count() ) == 0; + } + + void Copy( const void *pMemory, int cub ) + { + if ( cub == 0 || pMemory == NULL ) + { + Purge(); + return; + } + if ( cub != Count() ) + { + Purge(); + m_pMemory = (ActualMemory_t *)malloc( cub + sizeof( int ) ); + m_pMemory->cub = cub; + } + Q_memcpy( Base(), pMemory, cub ); + } + + // Gets the base address + uint8* Base() + { + if ( m_pMemory == NULL ) + return NULL; + return m_pMemory->rgub; + } + + const uint8* Base() const + { + if ( m_pMemory == NULL ) + return NULL; + return m_pMemory->rgub; + } + + // Size + int Count() const + { + if ( m_pMemory == NULL ) + return 0; + return m_pMemory->cub; + } + + // Memory deallocation + void Purge() + { + if ( m_pMemory ) + free(m_pMemory); + m_pMemory = NULL; + } + + void Copy( const CUtlAllocation &alloc ) + { + Copy( alloc.Base(), alloc.Count() ); + } + + void Swap( CUtlAllocation &alloc ) + { + ActualMemory_t *pTemp = m_pMemory; + m_pMemory = alloc.m_pMemory; + alloc.m_pMemory = pTemp; + } + + void Alloc( int cub ) + { + Purge(); + m_pMemory = (ActualMemory_t *)malloc( cub + sizeof( int ) ); + m_pMemory->cub = cub; + } + +private: + struct ActualMemory_t + { + int cub; + uint8 rgub[4]; // i'd prefer to make this 0 but the compiler whines when i do + }; + + ActualMemory_t *m_pMemory; +}; + +#endif // UTLALLOCATION_H diff --git a/public/tier1/utlcommon.h b/public/tier1/utlcommon.h new file mode 100644 index 000000000..23e67f040 --- /dev/null +++ b/public/tier1/utlcommon.h @@ -0,0 +1,371 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: common helpers for reuse among various Utl containers +// +// $NoKeywords: $ +// +//=============================================================================// + +#ifndef UTLCOMMON_H +#define UTLCOMMON_H +#pragma once + +//----------------------------------------------------------------------------- +// Henry Goffin (henryg) was here. Questions? Bugs? Go slap him around a bit. +//----------------------------------------------------------------------------- + +// empty_t is the canonical "no-value" type which is fully defined but empty. +struct empty_t {}; + +// undefined_t is the canonical "undefined" type, used mostly for typedefs; +// parameters of type undefined_t will not compile, which is actually useful +// behavior when it comes to template programming. Google "SFINAE" for info. +struct undefined_t; + +// CTypeSelect::type is a typedef of A if sel is nonzero, else B +template +struct CTypeSelect { typedef A type; }; + +template +struct CTypeSelect<0, A, B> { typedef B type; }; + +// CTypeEquals::value is nonzero if A and B are the same type +template +struct CTypeEquals { enum { value = 0 }; }; + +template +struct CTypeEquals { enum { value = 1 }; }; + +template +struct CTypeEquals : CTypeEquals< const volatile A&, const volatile B& > {}; + +template +struct CTypeEquals : CTypeEquals< const volatile A, const volatile B > {}; + +template +struct CTypeEquals : CTypeEquals< A&, B& > {}; + +// CUtlKeyValuePair is intended for use with key-lookup containers. +// Because it is specialized for "empty_t" values, one container can +// function as either a set of keys OR a key-value dictionary while +// avoiding storage waste or padding for the empty_t value objects. +template +class CUtlKeyValuePair +{ +public: + typedef V ValueReturn_t; + K m_key; + V m_value; + + CUtlKeyValuePair() {} + + template < typename KInit > + explicit CUtlKeyValuePair( const KInit &k ) : m_key( k ) {} + + template < typename KInit, typename VInit > + CUtlKeyValuePair( const KInit &k, const VInit &v ) : m_key( k ), m_value( v ) {} + + V &GetValue() { return m_value; } + const V &GetValue() const { return m_value; } +}; + +template +class CUtlKeyValuePair +{ +public: + typedef const K ValueReturn_t; + K m_key; + + CUtlKeyValuePair() {} + + template < typename KInit > + explicit CUtlKeyValuePair( const KInit &k ) : m_key( k ) {} + + template < typename KInit > + CUtlKeyValuePair( const KInit &k, empty_t ) : m_key( k ) {} + + CUtlKeyValuePair( const K &k, const empty_t& ) : m_key( k ) {} + const K &GetValue() const { return m_key; } +}; + + +// Default functors. You can specialize these if your type does +// not implement operator== or operator< in an efficient way for +// some odd reason. +template struct DefaultLessFunctor; +template struct DefaultEqualFunctor; + +// Hashing functor used by hash tables. You can either specialize +// for types which are widely used, or plug a custom functor directly +// into the hash table. If you do roll your own, please read up on +// bit-mixing and the avalanche property; be sure that your values +// are reasonably well-distributed across the entire 32-bit range. +// http://en.wikipedia.org/wiki/Avalanche_effect +// http://home.comcast.net/~bretm/hash/5.html +// +template struct DefaultHashFunctor; + +// Argument type information. Struct currently contains one or two typedefs: +// typename Arg_t = primary argument type. Usually const T&, sometimes T. +// typename Alt_t = optional alternate type. Usually *undefined*. +// +// Any specializations should be implemented via simple inheritance +// from ArgumentTypeInfoImpl< BestArgType, [optional] AlternateArgType > +// +template struct ArgumentTypeInfo; + + +// Some fundamental building-block functors... +struct StringLessFunctor { bool operator()( const char *a, const char *b ) const { return Q_strcmp( a, b ) < 0; } }; +struct StringEqualFunctor { bool operator()( const char *a, const char *b ) const { return Q_strcmp( a, b ) == 0; } }; +struct CaselessStringLessFunctor { bool operator()( const char *a, const char *b ) const { return Q_strcasecmp( a, b ) < 0; } }; +struct CaselessStringEqualFunctor { bool operator()( const char *a, const char *b ) const { return Q_strcasecmp( a, b ) == 0; } }; + +struct Mix32HashFunctor { unsigned int operator()( uint32 s ) const; }; +struct Mix64HashFunctor { unsigned int operator()( uint64 s ) const; }; +struct StringHashFunctor { unsigned int operator()( const char* s ) const; }; +struct CaselessStringHashFunctor { unsigned int operator()( const char* s ) const; }; + +struct PointerLessFunctor { bool operator()( const void *a, const void *b ) const { return a < b; } }; +struct PointerEqualFunctor { bool operator()( const void *a, const void *b ) const { return a == b; } }; +#if defined( PLATFORM_64BITS ) +struct PointerHashFunctor { unsigned int operator()( const void* s ) const { return Mix64HashFunctor()( ( uintp ) s ); } }; +#else +struct PointerHashFunctor { unsigned int operator()( const void* s ) const { return Mix32HashFunctor()( ( uintp ) s ); } }; +#endif + + +// Generic implementation of Less and Equal functors +template < typename T > +struct DefaultLessFunctor +{ + bool operator()( typename ArgumentTypeInfo< T >::Arg_t a, typename ArgumentTypeInfo< T >::Arg_t b ) const { return a < b; } + bool operator()( typename ArgumentTypeInfo< T >::Alt_t a, typename ArgumentTypeInfo< T >::Arg_t b ) const { return a < b; } + bool operator()( typename ArgumentTypeInfo< T >::Arg_t a, typename ArgumentTypeInfo< T >::Alt_t b ) const { return a < b; } +}; + +template < typename T > +struct DefaultEqualFunctor +{ + bool operator()( typename ArgumentTypeInfo< T >::Arg_t a, typename ArgumentTypeInfo< T >::Arg_t b ) const { return a == b; } + bool operator()( typename ArgumentTypeInfo< T >::Alt_t a, typename ArgumentTypeInfo< T >::Arg_t b ) const { return a == b; } + bool operator()( typename ArgumentTypeInfo< T >::Arg_t a, typename ArgumentTypeInfo< T >::Alt_t b ) const { return a == b; } +}; + +// Hashes for basic types +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +#if !defined(PLATFORM_64BITS) || defined(_WIN32) +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +#elif defined(POSIX) +template <> struct DefaultHashFunctor : Mix64HashFunctor { }; +template <> struct DefaultHashFunctor : Mix64HashFunctor { }; +#endif +template <> struct DefaultHashFunctor : Mix64HashFunctor { }; +template <> struct DefaultHashFunctor : Mix64HashFunctor { }; +template <> struct DefaultHashFunctor : PointerHashFunctor { }; +template <> struct DefaultHashFunctor : PointerHashFunctor { }; +#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) +template <> struct DefaultHashFunctor : Mix32HashFunctor { }; +#endif + +// String specializations. If you want to operate on raw values, use +// PointerLessFunctor and friends from the "building-block" section above +template <> struct DefaultLessFunctor : StringLessFunctor { }; +template <> struct DefaultLessFunctor : StringLessFunctor { }; +template <> struct DefaultEqualFunctor : StringEqualFunctor { }; +template <> struct DefaultEqualFunctor : StringEqualFunctor { }; +template <> struct DefaultHashFunctor : StringHashFunctor { }; +template <> struct DefaultHashFunctor : StringHashFunctor { }; + +// CUtlString/CUtlConstString are specialized here and not in utlstring.h +// because I consider string datatypes to be fundamental, and don't feel +// comfortable making that header file dependent on this one. (henryg) +class CUtlString; +template < typename T > class CUtlConstStringBase; + +template <> struct DefaultLessFunctor : StringLessFunctor { }; +template <> struct DefaultHashFunctor : StringHashFunctor { }; +template < typename T > struct DefaultLessFunctor< CUtlConstStringBase > : StringLessFunctor { }; +template < typename T > struct DefaultHashFunctor< CUtlConstStringBase > : StringHashFunctor { }; + + +// Helpers to deduce if a type defines a public AltArgumentType_t typedef: +template < typename T > +struct HasClassAltArgumentType +{ + template < typename X > static long Test( typename X::AltArgumentType_t* ); + template < typename X > static char Test( ... ); + enum { value = ( sizeof( Test< T >( NULL ) ) != sizeof( char ) ) }; +}; + +template < typename T, bool = HasClassAltArgumentType< T >::value > +struct GetClassAltArgumentType { typedef typename T::AltArgumentType_t Result_t; }; + +template < typename T > +struct GetClassAltArgumentType< T, false > { typedef undefined_t Result_t; }; + +// Unwrap references; reference types don't have member typedefs. +template < typename T > +struct GetClassAltArgumentType< T&, false > : GetClassAltArgumentType< T > { }; + +// ArgumentTypeInfoImpl is the base for all ArgumentTypeInfo specializations. +template < typename ArgT, typename AltT = typename GetClassAltArgumentType::Result_t > +struct ArgumentTypeInfoImpl +{ + enum { has_alt = 1 }; + typedef ArgT Arg_t; + typedef AltT Alt_t; +}; + +// Handle cases where AltArgumentType_t is typedef'd to undefined_t +template < typename ArgT > +struct ArgumentTypeInfoImpl< ArgT, undefined_t > +{ + enum { has_alt = 0 }; + typedef ArgT Arg_t; + typedef undefined_t Alt_t; +}; + +// Handle cases where AltArgumentType_t is typedef'd to the primary type +template < typename ArgT > +struct ArgumentTypeInfoImpl< ArgT, ArgT > +{ + enum { has_alt = 0 }; + typedef ArgT Arg_t; + typedef undefined_t Alt_t; +}; + + +// By default, everything is passed via const ref and doesn't define an alternate type. +template struct ArgumentTypeInfo : ArgumentTypeInfoImpl< const T& > { }; + +// Small native types are most efficiently passed by value. +template <> struct ArgumentTypeInfo< bool > : ArgumentTypeInfoImpl< bool > { }; +template <> struct ArgumentTypeInfo< char > : ArgumentTypeInfoImpl< char > { }; +template <> struct ArgumentTypeInfo< signed char > : ArgumentTypeInfoImpl< signed char > { }; +template <> struct ArgumentTypeInfo< unsigned char > : ArgumentTypeInfoImpl< unsigned char > { }; +template <> struct ArgumentTypeInfo< signed short > : ArgumentTypeInfoImpl< signed short > { }; +template <> struct ArgumentTypeInfo< unsigned short > : ArgumentTypeInfoImpl< unsigned short > { }; +template <> struct ArgumentTypeInfo< signed int > : ArgumentTypeInfoImpl< signed int > { }; +template <> struct ArgumentTypeInfo< unsigned int > : ArgumentTypeInfoImpl< unsigned int > { }; +template <> struct ArgumentTypeInfo< signed long > : ArgumentTypeInfoImpl< signed long > { }; +template <> struct ArgumentTypeInfo< unsigned long > : ArgumentTypeInfoImpl< unsigned long > { }; +template <> struct ArgumentTypeInfo< signed long long > : ArgumentTypeInfoImpl< signed long long > { }; +template <> struct ArgumentTypeInfo< unsigned long long > : ArgumentTypeInfoImpl< unsigned long long > { }; +template <> struct ArgumentTypeInfo< float > : ArgumentTypeInfoImpl< float > { }; +template <> struct ArgumentTypeInfo< double > : ArgumentTypeInfoImpl< double > { }; +template <> struct ArgumentTypeInfo< long double > : ArgumentTypeInfoImpl< long double > { }; +#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) +template <> struct ArgumentTypeInfo< wchar_t > : ArgumentTypeInfoImpl< wchar_t > { }; +#endif + +// Pointers are also most efficiently passed by value. +template < typename T > struct ArgumentTypeInfo< T* > : ArgumentTypeInfoImpl< T* > { }; + + +// Specializations to unwrap const-decorated types and references +template struct ArgumentTypeInfo : ArgumentTypeInfo { }; +template struct ArgumentTypeInfo : ArgumentTypeInfo { }; +template struct ArgumentTypeInfo : ArgumentTypeInfo { }; +template struct ArgumentTypeInfo : ArgumentTypeInfo { }; + +template struct DefaultLessFunctor : DefaultLessFunctor { }; +template struct DefaultLessFunctor : DefaultLessFunctor { }; +template struct DefaultLessFunctor : DefaultLessFunctor { }; +template struct DefaultLessFunctor : DefaultLessFunctor { }; + +template struct DefaultEqualFunctor : DefaultEqualFunctor { }; +template struct DefaultEqualFunctor : DefaultEqualFunctor { }; +template struct DefaultEqualFunctor : DefaultEqualFunctor { }; +template struct DefaultEqualFunctor : DefaultEqualFunctor { }; + +template struct DefaultHashFunctor : DefaultHashFunctor { }; +template struct DefaultHashFunctor : DefaultHashFunctor { }; +template struct DefaultHashFunctor : DefaultHashFunctor { }; +template struct DefaultHashFunctor : DefaultHashFunctor { }; + + +// Hash all pointer types as raw pointers by default +template struct DefaultHashFunctor< T * > : PointerHashFunctor { }; + + +// Here follow the useful implementations. + +// Bob Jenkins's 32-bit mix function. +inline unsigned int Mix32HashFunctor::operator()( uint32 n ) const +{ + // Perform a mixture of the bits in n, where each bit + // of the input value has an equal chance to affect each + // bit of the output. This turns tightly clustered input + // values into a smooth distribution. + // + // This takes 16-20 cycles on modern x86 architectures; + // that's roughly the same cost as a mispredicted branch. + // It's also reasonably efficient on PPC-based consoles. + // + // If you're still thinking, "too many instructions!", + // do keep in mind that reading one byte of uncached RAM + // is about 30x slower than executing this code. It pays + // to have a good hash function which minimizes collisions + // (and therefore long lookup chains). + n = ( n + 0x7ed55d16 ) + ( n << 12 ); + n = ( n ^ 0xc761c23c ) ^ ( n >> 19 ); + n = ( n + 0x165667b1 ) + ( n << 5 ); + n = ( n + 0xd3a2646c ) ^ ( n << 9 ); + n = ( n + 0xfd7046c5 ) + ( n << 3 ); + n = ( n ^ 0xb55a4f09 ) ^ ( n >> 16 ); + return n; +} + +inline unsigned int Mix64HashFunctor::operator()( uint64 s ) const +{ + // Thomas Wang hash, http://www.concentric.net/~ttwang/tech/inthash.htm + s = ( ~s ) + ( s << 21 ); // s = (s << 21) - s - 1; + s = s ^ ( s >> 24 ); + s = (s + ( s << 3 ) ) + ( s << 8 ); // s * 265 + s = s ^ ( s >> 14 ); + s = ( s + ( s << 2 ) ) + ( s << 4 ); // s * 21 + s = s ^ ( s >> 28 ); + s = s + ( s << 31 ); + return (unsigned int)s; +} + + +// Based on the widely-used FNV-1A string hash with a final +// mixing step to improve dispersion for very small and very +// large hash table sizes. +inline unsigned int StringHashFunctor::operator()( const char* s ) const +{ + uint32 h = 2166136261u; + for ( ; *s; ++s ) + { + uint32 c = (unsigned char) *s; + h = (h ^ c) * 16777619; + } + return (h ^ (h << 17)) + (h >> 21); +} + +// Equivalent to StringHashFunctor on lower-case strings. +inline unsigned int CaselessStringHashFunctor::operator()( const char* s ) const +{ + uint32 h = 2166136261u; + for ( ; *s; ++s ) + { + uint32 c = (unsigned char) *s; + // Brutally fast branchless ASCII tolower(): + // if ((c >= 'A') && (c <= 'Z')) c += ('a' - 'A'); + c += (((('A'-1) - c) & (c - ('Z'+1))) >> 26) & 32; + h = (h ^ c) * 16777619; + } + return (h ^ (h << 17)) + (h >> 21); +} + + +#endif // UTLCOMMON_H diff --git a/public/tier1/utldict.h b/public/tier1/utldict.h index d6e777d12..bdccf576f 100644 --- a/public/tier1/utldict.h +++ b/public/tier1/utldict.h @@ -31,10 +31,12 @@ enum EDictCompareType //----------------------------------------------------------------------------- // A dictionary mapping from symbol to structure //----------------------------------------------------------------------------- -template +template class CUtlDict { public: + typedef I IndexType_t; + // constructor, destructor // Left at growSize = 0, the memory will first allocate 1 element and double in size // at each increment. diff --git a/public/tier1/utlhashtable.h b/public/tier1/utlhashtable.h new file mode 100644 index 000000000..eca14dfad --- /dev/null +++ b/public/tier1/utlhashtable.h @@ -0,0 +1,988 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: a fast growable hashtable with stored hashes, L2-friendly behavior. +// Useful as a string dictionary or a low-overhead set/map for small POD types. +// +// Usage notes: +// - handles are NOT STABLE across element removal! use RemoveAndAdvance() +// if you are removing elements while iterating through the hashtable. +// Use CUtlStableHashtable if you need stable handles (less efficient). +// - handles are also NOT STABLE across element insertion. The handle +// resulting from the insertion of an element may not retreive the +// same (or any!) element after further insertions. Again, use +// CUtlStableHashtable if you need stable handles +// - Insert() first searches for an existing match and returns it if found +// - a value type of "empty_t" can be used to eliminate value storage and +// switch Element() to return const Key references instead of values +// - an extra user flag bit is accessible via Get/SetUserFlag() +// - hash function pointer / functor is exposed via GetHashRef() +// - comparison function pointer / functor is exposed via GetEqualRef() +// - if your value type cannot be copy-constructed, use key-only Insert() +// to default-initialize the value and then manipulate it afterwards. +// - The reason that UtlHashtable permutes itself and invalidates +// iterators is to make it faster in the case where you are not +// tracking iterators. If you use it as a set or a map ("is this +// value a member?") as opposed to a long-term container, then you +// probably don't need stable iterators. Hashtable tries to place +// newly inserted data in the primary hash slot, making an +// assumption that if you inserted it recently, you're more likely +// to access it than if you inserted something a long time +// ago. It's effectively trying to minimize cache misses for hot +// data if you add and remove a lot. +// If you don't care too much about cache misses, UtlStableHashtable +// is what you're looking for +// +// Implementation notes: +// - overall hash table load is kept between .25 and .75 +// - items which would map to the same ideal slot are chained together +// - chained items are stored sequentially in adjacent free spaces +// - "root" entries are prioritized over chained entries; if a +// slot is not occupied by an item in its root position, the table +// is guaranteed to contain no keys which would hash to that slot. +// - new items go at the head of the chain (ie, in their root slot) +// and evict / "bump" any chained entries which occupy that slot +// - chain-following skips over unused holes and continues examining +// table entries until a chain entry with FLAG_LAST is encountered +// +// CUtlHashtable< uint32 > setOfIntegers; +// CUtlHashtable< const char* > setOfStringPointers; +// CUtlHashtable< int, CUtlVector > mapFromIntsToArrays; +// +// $NoKeywords: $ +// +// A closed-form (open addressing) hashtable with linear sequential probing. +//=============================================================================// + +#ifndef UTLHASHTABLE_H +#define UTLHASHTABLE_H +#pragma once + +#include "utlcommon.h" +#include "utlmemory.h" +#include "mathlib/mathlib.h" +#include "utllinkedlist.h" + +//----------------------------------------------------------------------------- +// Henry Goffin (henryg) was here. Questions? Bugs? Go slap him around a bit. +//----------------------------------------------------------------------------- + +typedef unsigned int UtlHashHandle_t; + +#define FOR_EACH_HASHTABLE( table, iter ) \ + for ( UtlHashHandle_t iter = (table).FirstHandle(); iter != (table).InvalidHandle(); iter = (table).NextHandle( iter ) ) + +// CUtlHashtableEntry selects between 16 and 32 bit storage backing +// for flags_and_hash depending on the size of the stored types. +template < typename KeyT, typename ValueT = empty_t > +class CUtlHashtableEntry +{ +public: + typedef CUtlKeyValuePair< KeyT, ValueT > KVPair; + + enum { INT16_STORAGE = ( sizeof( KVPair ) <= 2 ) }; + typedef typename CTypeSelect< INT16_STORAGE, int16, int32 >::type storage_t; + + enum + { + FLAG_FREE = INT16_STORAGE ? 0x8000 : 0x80000000, // must be high bit for IsValid and IdealIndex to work + FLAG_LAST = INT16_STORAGE ? 0x4000 : 0x40000000, + MASK_HASH = INT16_STORAGE ? 0x3FFF : 0x3FFFFFFF + }; + + storage_t flags_and_hash; + storage_t data[ ( sizeof(KVPair) + sizeof(storage_t) - 1 ) / sizeof(storage_t) ]; + + bool IsValid() const { return flags_and_hash >= 0; } + void MarkInvalid() { int32 flag = FLAG_FREE; flags_and_hash = (storage_t)flag; } + const KVPair *Raw() const { return reinterpret_cast< const KVPair * >( &data[0] ); } + const KVPair *operator->() const { Assert( IsValid() ); return reinterpret_cast< const KVPair * >( &data[0] ); } + KVPair *Raw() { return reinterpret_cast< KVPair * >( &data[0] ); } + KVPair *operator->() { Assert( IsValid() ); return reinterpret_cast< KVPair * >( &data[0] ); } + + // Returns the ideal index of the data in this slot, or all bits set if invalid + uint32 FORCEINLINE IdealIndex( uint32 slotmask ) const { return IdealIndex( flags_and_hash, slotmask ) | ( (int32)flags_and_hash >> 31 ); } + + // Use template tricks to fully define only one function that takes either 16 or 32 bits + // and performs different logic without using "if ( INT16_STORAGE )", because GCC and MSVC + // sometimes have trouble removing the constant branch, which is dumb... but whatever. + // 16-bit hashes are simply too narrow for large hashtables; more mask bits than hash bits! + // So we duplicate the hash bits. (Note: h *= MASK_HASH+2 is the same as h += h<::type uint32_if16BitStorage; + typedef typename CTypeSelect< INT16_STORAGE, undefined_t, int32 >::type uint32_if32BitStorage; + static FORCEINLINE uint32 IdealIndex( uint32_if16BitStorage h, uint32 m ) { h &= MASK_HASH; h *= MASK_HASH + 2; return h & m; } + static FORCEINLINE uint32 IdealIndex( uint32_if32BitStorage h, uint32 m ) { return h & m; } + + // More efficient than memcpy for the small types that are stored in a hashtable + void MoveDataFrom( CUtlHashtableEntry &src ) + { + storage_t * RESTRICT srcData = &src.data[0]; + for ( int i = 0; i < ARRAYSIZE( data ); ++i ) { data[i] = srcData[i]; } + } +}; + +template , typename KeyIsEqualT = DefaultEqualFunctor, typename AlternateKeyT = typename ArgumentTypeInfo::Alt_t > +class CUtlHashtable +{ +public: + typedef UtlHashHandle_t handle_t; + +protected: + typedef CUtlKeyValuePair KVPair; + typedef typename ArgumentTypeInfo::Arg_t KeyArg_t; + typedef typename ArgumentTypeInfo::Arg_t ValueArg_t; + typedef typename ArgumentTypeInfo::Arg_t KeyAlt_t; + typedef CUtlHashtableEntry< KeyT, ValueT > entry_t; + + enum { FLAG_FREE = entry_t::FLAG_FREE }; + enum { FLAG_LAST = entry_t::FLAG_LAST }; + enum { MASK_HASH = entry_t::MASK_HASH }; + + CUtlMemory< entry_t > m_table; + int m_nUsed; + int m_nMinSize; + bool m_bSizeLocked; + KeyIsEqualT m_eq; + KeyHashT m_hash; + + // Allocate an empty table and then re-insert all existing entries. + void DoRealloc( int size ); + + // Move an existing entry to a free slot, leaving a hole behind + void BumpEntry( unsigned int idx ); + + // Insert an unconstructed KVPair at the primary slot + int DoInsertUnconstructed( unsigned int h, bool allowGrow ); + + // Implementation for Insert functions, constructs a KVPair + // with either a default-construted or copy-constructed value + template handle_t DoInsert( KeyParamT k, unsigned int h ); + template handle_t DoInsert( KeyParamT k, typename ArgumentTypeInfo::Arg_t v, unsigned int h, bool* pDidInsert ); + template handle_t DoInsertNoCheck( KeyParamT k, typename ArgumentTypeInfo::Arg_t v, unsigned int h ); + + // Key lookup. Can also return previous-in-chain if result is chained. + template handle_t DoLookup( KeyParamT x, unsigned int h, handle_t *pPreviousInChain ) const; + + // Remove single element by key + hash. Returns the index of the new hole + // that was created. Returns InvalidHandle() if element was not found. + template int DoRemove( KeyParamT x, unsigned int h ); + + // Friend CUtlStableHashtable so that it can call our Do* functions directly + template < typename K, typename V, typename S, typename H, typename E, typename A > friend class CUtlStableHashtable; + +public: + explicit CUtlHashtable( int minimumSize = 32 ) + : m_nUsed(0), m_nMinSize(MAX(8, minimumSize)), m_bSizeLocked(false), m_eq(), m_hash() { } + + CUtlHashtable( int minimumSize, const KeyHashT &hash, KeyIsEqualT const &eq = KeyIsEqualT() ) + : m_nUsed(0), m_nMinSize(MAX(8, minimumSize)), m_bSizeLocked(false), m_eq(eq), m_hash(hash) { } + + CUtlHashtable( entry_t* pMemory, unsigned int nCount, const KeyHashT &hash = KeyHashT(), KeyIsEqualT const &eq = KeyIsEqualT() ) + : m_nUsed(0), m_nMinSize(8), m_bSizeLocked(false), m_eq(eq), m_hash(hash) { SetExternalBuffer( pMemory, nCount ); } + + ~CUtlHashtable() { RemoveAll(); } + + CUtlHashtable &operator=( CUtlHashtable const &src ); + + // Set external memory + void SetExternalBuffer( byte* pRawBuffer, unsigned int nBytes, bool bAssumeOwnership = false, bool bGrowable = false ); + void SetExternalBuffer( entry_t* pBuffer, unsigned int nSize, bool bAssumeOwnership = false, bool bGrowable = false ); + + // Functor/function-pointer access + KeyHashT& GetHashRef() { return m_hash; } + KeyIsEqualT& GetEqualRef() { return m_eq; } + KeyHashT const &GetHashRef() const { return m_hash; } + KeyIsEqualT const &GetEqualRef() const { return m_eq; } + + // Handle validation + bool IsValidHandle( handle_t idx ) const { return (unsigned)idx < (unsigned)m_table.Count() && m_table[idx].IsValid(); } + static handle_t InvalidHandle() { return (handle_t) -1; } + + // Iteration functions + handle_t FirstHandle() const { return NextHandle( (handle_t) -1 ); } + handle_t NextHandle( handle_t start ) const; + + // Returns the number of unique keys in the table + int Count() const { return m_nUsed; } + + + // Key lookup, returns InvalidHandle() if not found + handle_t Find( KeyArg_t k ) const { return DoLookup( k, m_hash(k), NULL ); } + handle_t Find( KeyArg_t k, unsigned int hash) const { Assert( hash == m_hash(k) ); return DoLookup( k, hash, NULL ); } + // Alternate-type key lookup, returns InvalidHandle() if not found + handle_t Find( KeyAlt_t k ) const { return DoLookup( k, m_hash(k), NULL ); } + handle_t Find( KeyAlt_t k, unsigned int hash) const { Assert( hash == m_hash(k) ); return DoLookup( k, hash, NULL ); } + + // True if the key is in the table + bool HasElement( KeyArg_t k ) const { return InvalidHandle() != Find( k ); } + bool HasElement( KeyAlt_t k ) const { return InvalidHandle() != Find( k ); } + + // Key insertion or lookup, always returns a valid handle + handle_t Insert( KeyArg_t k ) { return DoInsert( k, m_hash(k) ); } + handle_t Insert( KeyArg_t k, ValueArg_t v, bool *pDidInsert = NULL ) { return DoInsert( k, v, m_hash(k), pDidInsert ); } + handle_t Insert( KeyArg_t k, ValueArg_t v, unsigned int hash, bool *pDidInsert = NULL ) { Assert( hash == m_hash(k) ); return DoInsert( k, v, hash, pDidInsert ); } + // Alternate-type key insertion or lookup, always returns a valid handle + handle_t Insert( KeyAlt_t k ) { return DoInsert( k, m_hash(k) ); } + handle_t Insert( KeyAlt_t k, ValueArg_t v, bool *pDidInsert = NULL ) { return DoInsert( k, v, m_hash(k), pDidInsert ); } + handle_t Insert( KeyAlt_t k, ValueArg_t v, unsigned int hash, bool *pDidInsert = NULL ) { Assert( hash == m_hash(k) ); return DoInsert( k, v, hash, pDidInsert ); } + + // Key removal, returns false if not found + bool Remove( KeyArg_t k ) { return DoRemove( k, m_hash(k) ) >= 0; } + bool Remove( KeyArg_t k, unsigned int hash ) { Assert( hash == m_hash(k) ); return DoRemove( k, hash ) >= 0; } + // Alternate-type key removal, returns false if not found + bool Remove( KeyAlt_t k ) { return DoRemove( k, m_hash(k) ) >= 0; } + bool Remove( KeyAlt_t k, unsigned int hash ) { Assert( hash == m_hash(k) ); return DoRemove( k, hash ) >= 0; } + + // Remove while iterating, returns the next handle for forward iteration + // Note: aside from this, ALL handles are invalid if an element is removed + handle_t RemoveAndAdvance( handle_t idx ); + + // Remove by handle, convenient when you look up a handle and do something with it before removing the element + void RemoveByHandle( handle_t idx ); + + // Nuke contents + void RemoveAll(); + + // Nuke and release memory. + void Purge() { RemoveAll(); m_table.Purge(); } + + // Reserve table capacity up front to avoid reallocation during insertions + void Reserve( int expected ) { if ( expected > m_nUsed ) DoRealloc( expected * 4 / 3 ); } + + // Shrink to best-fit size, re-insert keys for optimal lookup + void Compact( bool bMinimal ) { DoRealloc( bMinimal ? m_nUsed : ( m_nUsed * 4 / 3 ) ); } + + // Access functions. Note: if ValueT is empty_t, all functions return const keys. + typedef typename KVPair::ValueReturn_t Element_t; + KeyT const &Key( handle_t idx ) const { return m_table[idx]->m_key; } + Element_t const &Element( handle_t idx ) const { return m_table[idx]->GetValue(); } + Element_t &Element(handle_t idx) { return m_table[idx]->GetValue(); } + Element_t const &operator[]( handle_t idx ) const { return m_table[idx]->GetValue(); } + Element_t &operator[]( handle_t idx ) { return m_table[idx]->GetValue(); } + + void ReplaceKey( handle_t idx, KeyArg_t k ) { Assert( m_eq( m_table[idx]->m_key, k ) && m_hash( k ) == m_hash( m_table[idx]->m_key ) ); m_table[idx]->m_key = k; } + void ReplaceKey( handle_t idx, KeyAlt_t k ) { Assert( m_eq( m_table[idx]->m_key, k ) && m_hash( k ) == m_hash( m_table[idx]->m_key ) ); m_table[idx]->m_key = k; } + + Element_t const &Get( KeyArg_t k, Element_t const &defaultValue ) const { handle_t h = Find( k ); if ( h != InvalidHandle() ) return Element( h ); return defaultValue; } + Element_t const &Get( KeyAlt_t k, Element_t const &defaultValue ) const { handle_t h = Find( k ); if ( h != InvalidHandle() ) return Element( h ); return defaultValue; } + + Element_t const *GetPtr( KeyArg_t k ) const { handle_t h = Find(k); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + Element_t const *GetPtr( KeyAlt_t k ) const { handle_t h = Find(k); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + Element_t *GetPtr( KeyArg_t k ) { handle_t h = Find( k ); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + Element_t *GetPtr( KeyAlt_t k ) { handle_t h = Find( k ); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + + // Swap memory and contents with another identical hashtable + // (NOTE: if using function pointers or functors with state, + // it is up to the caller to ensure that they are compatible!) + void Swap( CUtlHashtable &other ) { m_table.Swap(other.m_table); ::V_swap(m_nUsed, other.m_nUsed); } + + // GetMemoryUsage returns all memory held by this class + // and its held classes. It does not include sizeof(*this). + size_t GetMemoryUsage() const + { + return m_table.AllocSize(); + } + + size_t GetReserveCount( )const + { + return m_table.Count(); + } + + +#if _DEBUG + // Validate the integrity of the hashtable + void DbgCheckIntegrity() const; +#endif + +private: + CUtlHashtable(const CUtlHashtable& copyConstructorIsNotImplemented); +}; + + +// Set external memory (raw byte buffer, best-fit) +template +void CUtlHashtable::SetExternalBuffer( byte* pRawBuffer, unsigned int nBytes, bool bAssumeOwnership, bool bGrowable ) +{ + Assert( ((uintptr_t)pRawBuffer % __alignof(int)) == 0 ); + uint32 bestSize = LargestPowerOfTwoLessThanOrEqual( nBytes / sizeof(entry_t) ); + Assert( bestSize != 0 && bestSize*sizeof(entry_t) <= nBytes ); + + return SetExternalBuffer( (entry_t*) pRawBuffer, bestSize, bAssumeOwnership, bGrowable ); +} + +// Set external memory (typechecked, must be power of two) +template +void CUtlHashtable::SetExternalBuffer( entry_t* pBuffer, unsigned int nSize, bool bAssumeOwnership, bool bGrowable ) +{ + Assert( IsPowerOfTwo(nSize) ); + Assert( m_nUsed == 0 ); + for ( uint i = 0; i < nSize; ++i ) + pBuffer[i].MarkInvalid(); + if ( bAssumeOwnership ) + m_table.AssumeMemory( pBuffer, nSize ); + else + m_table.SetExternalBuffer( pBuffer, nSize ); + m_bSizeLocked = !bGrowable; +} + +// Allocate an empty table and then re-insert all existing entries. +template +void CUtlHashtable::DoRealloc( int size ) +{ + Assert( !m_bSizeLocked ); + + size = SmallestPowerOfTwoGreaterOrEqual( MAX( m_nMinSize, size ) ); + Assert( size > 0 && (uint)size <= entry_t::IdealIndex( ~0, 0x1FFFFFFF ) ); // reasonable power of 2 + Assert( size > m_nUsed ); + + CUtlMemory oldTable; + oldTable.Swap( m_table ); + entry_t * RESTRICT const pOldBase = oldTable.Base(); + + m_table.EnsureCapacity( size ); + entry_t * const pNewBase = m_table.Base(); + for ( int i = 0; i < size; ++i ) + pNewBase[i].MarkInvalid(); + + int nLeftToMove = m_nUsed; + m_nUsed = 0; + for ( int i = oldTable.Count() - 1; i >= 0; --i ) + { + if ( pOldBase[i].IsValid() ) + { + int newIdx = DoInsertUnconstructed( pOldBase[i].flags_and_hash, false ); + pNewBase[newIdx].MoveDataFrom( pOldBase[i] ); + if ( --nLeftToMove == 0 ) + break; + } + } + Assert( nLeftToMove == 0 ); +} + + +// Move an existing entry to a free slot, leaving a hole behind +template +void CUtlHashtable::BumpEntry( unsigned int idx ) +{ + Assert( m_table[idx].IsValid() ); + Assert( m_nUsed < m_table.Count() ); + + entry_t* table = m_table.Base(); + unsigned int slotmask = m_table.Count()-1; + unsigned int new_flags_and_hash = table[idx].flags_and_hash & (FLAG_LAST | MASK_HASH); + + unsigned int chainid = entry_t::IdealIndex( new_flags_and_hash, slotmask ); + + // Look for empty slots scanning forward, stripping FLAG_LAST as we go. + // Note: this potentially strips FLAG_LAST from table[idx] if we pass it + int newIdx = chainid; // start at ideal slot + for ( ; ; newIdx = (newIdx + 1) & slotmask ) + { + if ( table[newIdx].IdealIndex( slotmask ) == chainid ) + { + if ( table[newIdx].flags_and_hash & FLAG_LAST ) + { + table[newIdx].flags_and_hash &= ~FLAG_LAST; + new_flags_and_hash |= FLAG_LAST; + } + continue; + } + if ( table[newIdx].IsValid() ) + { + continue; + } + break; + } + + // Did we pick something closer to the ideal slot, leaving behind a + // FLAG_LAST bit on the current slot because we didn't scan past it? + if ( table[idx].flags_and_hash & FLAG_LAST ) + { +#ifdef _DEBUG + Assert( new_flags_and_hash & FLAG_LAST ); + // Verify logic: we must have moved to an earlier slot, right? + uint offset = ((uint)idx - chainid + slotmask + 1) & slotmask; + uint newOffset = ((uint)newIdx - chainid + slotmask + 1) & slotmask; + Assert( newOffset < offset ); +#endif + // Scan backwards from old to new location, depositing FLAG_LAST on + // the first match we find. (+slotmask) is the same as (-1) without + // having to make anyone think about two's complement shenanigans. + int scan = (idx + slotmask) & slotmask; + while ( scan != newIdx ) + { + if ( table[scan].IdealIndex( slotmask ) == chainid ) + { + table[scan].flags_and_hash |= FLAG_LAST; + new_flags_and_hash &= ~FLAG_LAST; + break; + } + scan = (scan + slotmask) & slotmask; + } + } + + // Move entry to the free slot we found, leaving a hole at idx + table[newIdx].flags_and_hash = new_flags_and_hash; + table[newIdx].MoveDataFrom( table[idx] ); + table[idx].MarkInvalid(); +} + + +// Insert a value at the root position for that value's hash chain. +template +int CUtlHashtable::DoInsertUnconstructed( unsigned int h, bool allowGrow ) +{ + if ( allowGrow && !m_bSizeLocked ) + { + // Keep the load factor between .25 and .75 + int newSize = m_nUsed + 1; + if ( ( newSize*4 < m_table.Count() && m_table.Count() > m_nMinSize*2 ) || newSize*4 > m_table.Count()*3 ) + { + DoRealloc( newSize * 4 / 3 ); + } + } + Assert( m_nUsed < m_table.Count() ); + ++m_nUsed; + + entry_t* table = m_table.Base(); + unsigned int slotmask = m_table.Count()-1; + unsigned int new_flags_and_hash = FLAG_LAST | (h & MASK_HASH); + unsigned int idx = entry_t::IdealIndex( h, slotmask ); + if ( table[idx].IdealIndex( slotmask ) == idx ) + { + // There is already an entry in this chain. + new_flags_and_hash &= ~FLAG_LAST; + BumpEntry(idx); + } + else if ( table[idx].IsValid() ) + { + // Somebody else is living in our ideal index but does not belong + // to our entry chain; move it out of the way, start a new chain. + BumpEntry(idx); + } + table[idx].flags_and_hash = new_flags_and_hash; + return idx; +} + + +// Key lookup. Can also return previous-in-chain if result is a chained slot. +template +template +UtlHashHandle_t CUtlHashtable::DoLookup( KeyParamT x, unsigned int h, handle_t *pPreviousInChain ) const +{ + if ( m_nUsed == 0 ) + { + // Empty table. + return (handle_t) -1; + } + + const entry_t* table = m_table.Base(); + unsigned int slotmask = m_table.Count()-1; + Assert( m_table.Count() > 0 && (slotmask & m_table.Count()) == 0 ); + unsigned int chainid = entry_t::IdealIndex( h, slotmask ); + + unsigned int idx = chainid; + if ( table[idx].IdealIndex( slotmask ) != chainid ) + { + // Nothing in root position? No match. + return (handle_t) -1; + } + + // Linear scan until found or end of chain + handle_t lastIdx = (handle_t) -1; + while (1) + { + // Only examine this slot if it is valid and belongs to our hash chain + if ( table[idx].IdealIndex( slotmask ) == chainid ) + { + // Test the full-width hash to avoid unnecessary calls to m_eq() + if ( ((table[idx].flags_and_hash ^ h) & MASK_HASH) == 0 && m_eq( table[idx]->m_key, x ) ) + { + // Found match! + if (pPreviousInChain) + *pPreviousInChain = lastIdx; + + return (handle_t) idx; + } + + if ( table[idx].flags_and_hash & FLAG_LAST ) + { + // End of chain. No match. + return (handle_t) -1; + } + + lastIdx = (handle_t) idx; + } + idx = (idx + 1) & slotmask; + } +} + + +// Key insertion, or return index of existing key if found +template +template +UtlHashHandle_t CUtlHashtable::DoInsert( KeyParamT k, unsigned int h ) +{ + handle_t idx = DoLookup( k, h, NULL ); + if ( idx == (handle_t) -1 ) + { + idx = (handle_t) DoInsertUnconstructed( h, true ); + ConstructOneArg( m_table[ idx ].Raw(), k ); + } + return idx; +} + +// Key insertion, or return index of existing key if found +template +template +UtlHashHandle_t CUtlHashtable::DoInsert( KeyParamT k, typename ArgumentTypeInfo::Arg_t v, unsigned int h, bool *pDidInsert ) +{ + handle_t idx = DoLookup( k, h, NULL ); + if ( idx == (handle_t) -1 ) + { + idx = (handle_t) DoInsertUnconstructed( h, true ); + ConstructTwoArg( m_table[ idx ].Raw(), k, v ); + if ( pDidInsert ) *pDidInsert = true; + } + else + { + if ( pDidInsert ) *pDidInsert = false; + } + return idx; +} + +// Key insertion +template +template +UtlHashHandle_t CUtlHashtable::DoInsertNoCheck( KeyParamT k, typename ArgumentTypeInfo::Arg_t v, unsigned int h ) +{ + Assert( DoLookup( k, h, NULL ) == (handle_t) -1 ); + handle_t idx = (handle_t) DoInsertUnconstructed( h, true ); + ConstructTwoArg( m_table[ idx ].Raw(), k, v ); + return idx; +} + + +// Remove single element by key + hash. Returns the location of the new empty hole. +template +template +int CUtlHashtable::DoRemove( KeyParamT x, unsigned int h ) +{ + unsigned int slotmask = m_table.Count()-1; + handle_t previous = (handle_t) -1; + int idx = (int) DoLookup( x, h, &previous ); + if (idx == -1) + { + return -1; + } + + enum { FAKEFLAG_ROOT = 1 }; + int nLastAndRootFlags = m_table[idx].flags_and_hash & FLAG_LAST; + nLastAndRootFlags |= ( (uint)idx == m_table[idx].IdealIndex( slotmask ) ); + + // Remove from table + m_table[idx].MarkInvalid(); + Destruct( m_table[idx].Raw() ); + --m_nUsed; + + if ( nLastAndRootFlags == FLAG_LAST ) // last only, not root + { + // This was the end of the chain - mark previous as last. + // (This isn't the root, so there must be a previous.) + Assert( previous != (handle_t) -1 ); + m_table[previous].flags_and_hash |= FLAG_LAST; + } + + if ( nLastAndRootFlags == FAKEFLAG_ROOT ) // root only, not last + { + // If we are removing the root and there is more to the chain, + // scan to find the next chain entry and move it to the root. + unsigned int chainid = entry_t::IdealIndex( h, slotmask ); + unsigned int nextIdx = idx; + while (1) + { + nextIdx = (nextIdx + 1) & slotmask; + if ( m_table[nextIdx].IdealIndex( slotmask ) == chainid ) + { + break; + } + } + Assert( !(m_table[nextIdx].flags_and_hash & FLAG_FREE) ); + + // Leave a hole where the next entry in the chain was. + m_table[idx].flags_and_hash = m_table[nextIdx].flags_and_hash; + m_table[idx].MoveDataFrom( m_table[nextIdx] ); + m_table[nextIdx].MarkInvalid(); + return nextIdx; + } + + // The hole is still where the element used to be. + return idx; +} + + +// Assignment operator. It's up to the user to make sure that the hash and equality functors match. +template +CUtlHashtable &CUtlHashtable::operator=( CUtlHashtable const &src ) +{ + if ( &src != this ) + { + Assert( !m_bSizeLocked || m_table.Count() >= src.m_nUsed ); + if ( !m_bSizeLocked ) + { + Purge(); + Reserve(src.m_nUsed); + } + else + { + RemoveAll(); + } + + const entry_t * srcTable = src.m_table.Base(); + for ( int i = src.m_table.Count() - 1; i >= 0; --i ) + { + if ( srcTable[i].IsValid() ) + { + // If this assert trips, double-check that both hashtables + // have the same hash function pointers or hash functor state! + Assert( m_hash(srcTable[i]->m_key) == src.m_hash(srcTable[i]->m_key) ); + int newIdx = DoInsertUnconstructed( srcTable[i].flags_and_hash , false ); + CopyConstruct( m_table[newIdx].Raw(), *srcTable[i].Raw() ); // copy construct KVPair + } + } + } + return *this; +} + +// Remove and return the next valid iterator for a forward iteration. +template +UtlHashHandle_t CUtlHashtable::RemoveAndAdvance( UtlHashHandle_t idx ) +{ + Assert( IsValidHandle( idx ) ); + + // TODO optimize, implement DoRemoveAt that does not need to re-evaluate equality in DoLookup + int hole = DoRemove< KeyArg_t >( m_table[idx]->m_key, m_table[idx].flags_and_hash & MASK_HASH ); + // DoRemove returns the index of the element that it moved to fill the hole, if any. + if ( hole <= (int) idx ) + { + // Didn't fill, or filled from a previously seen element. + return NextHandle( idx ); + } + else + { + // Do not advance; slot has a new un-iterated value. + Assert( IsValidHandle(idx) ); + return idx; + } +} + + +// Remove and return the next valid iterator for a forward iteration. +template +void CUtlHashtable::RemoveByHandle( UtlHashHandle_t idx ) +{ + Assert( IsValidHandle( idx ) ); + + // Copied from RemoveAndAdvance(): TODO optimize, implement DoRemoveAt that does not need to re-evaluate equality in DoLookup + DoRemove< KeyArg_t >( m_table[idx]->m_key, m_table[idx].flags_and_hash & MASK_HASH ); +} + + +// Burn it with fire. +template +void CUtlHashtable::RemoveAll() +{ + int used = m_nUsed; + if ( used != 0 ) + { + entry_t* table = m_table.Base(); + for ( int i = m_table.Count() - 1; i >= 0; --i ) + { + if ( table[i].IsValid() ) + { + table[i].MarkInvalid(); + Destruct( table[i].Raw() ); + if ( --used == 0 ) + break; + } + } + m_nUsed = 0; + } +} + +template +UtlHashHandle_t CUtlHashtable::NextHandle( handle_t start ) const +{ + const entry_t *table = m_table.Base(); + for ( int i = (int)start + 1; i < m_table.Count(); ++i ) + { + if ( table[i].IsValid() ) + return (handle_t) i; + } + return (handle_t) -1; +} + + +#if _DEBUG +template +void CUtlHashtable::DbgCheckIntegrity() const +{ + // Stress test the hash table as a test of both container functionality + // and also the validity of the user's Hash and Equal function objects. + // NOTE: will fail if function objects require any sort of state! + CUtlHashtable clone; + unsigned int bytes = sizeof(entry_t)*max(16,m_table.Count()); + byte* tempbuf = (byte*) malloc(bytes); + clone.SetExternalBuffer( tempbuf, bytes, false, false ); + clone = *this; + + int count = 0, roots = 0, ends = 0; + int slotmask = m_table.Count() - 1; + for (int i = 0; i < m_table.Count(); ++i) + { + if (!(m_table[i].flags_and_hash & FLAG_FREE)) ++count; + if (m_table[i].IdealIndex(slotmask) == (uint)i) ++roots; + if (m_table[i].flags_and_hash & FLAG_LAST) ++ends; + if (m_table[i].IsValid()) + { + Assert( Find(m_table[i]->m_key) == (handle_t)i ); + Verify( clone.Remove(m_table[i]->m_key) ); + } + else + { + Assert( m_table[i].flags_and_hash == FLAG_FREE ); + } + } + Assert( count == Count() && count >= roots && roots == ends ); + Assert( clone.Count() == 0 ); + clone.Purge(); + free(tempbuf); +} +#endif + +//----------------------------------------------------------------------- +// CUtlStableHashtable +//----------------------------------------------------------------------- + +// Stable hashtables are less memory and cache efficient, but can be +// iterated quickly and their element handles are completely stable. +// Implemented as a hashtable which only stores indices, and a separate +// CUtlLinkedList data table which contains key-value pairs; this may +// change to a more efficient structure in the future if space becomes +// critical. I have some ideas about that but not the time to implement +// at the moment. -henryg + +// Note: RemoveAndAdvance is slower than in CUtlHashtable because the +// key needs to be re-hashed under the current implementation. + +template , typename KeyIsEqualT = DefaultEqualFunctor, typename IndexStorageT = uint16, typename AlternateKeyT = typename ArgumentTypeInfo::Alt_t > +class CUtlStableHashtable +{ +public: + typedef typename ArgumentTypeInfo::Arg_t KeyArg_t; + typedef typename ArgumentTypeInfo::Arg_t ValueArg_t; + typedef typename ArgumentTypeInfo::Arg_t KeyAlt_t; + typedef typename CTypeSelect< sizeof( IndexStorageT ) == 2, uint16, uint32 >::type IndexStorage_t; + +protected: + //COMPILE_TIME_ASSERT( sizeof( IndexStorage_t ) == sizeof( IndexStorageT ) ); + + typedef CUtlKeyValuePair< KeyT, ValueT > KVPair; + struct HashProxy; + struct EqualProxy; + struct IndirectIndex; + + typedef CUtlHashtable< IndirectIndex, empty_t, HashProxy, EqualProxy, AlternateKeyT > Hashtable_t; + typedef CUtlLinkedList< KVPair, IndexStorage_t > LinkedList_t; + + template bool DoRemove( KeyArgumentT k ); + template UtlHashHandle_t DoFind( KeyArgumentT k ) const; + template UtlHashHandle_t DoInsert( KeyArgumentT k ); + template UtlHashHandle_t DoInsert( KeyArgumentT k, ValueArgumentT v ); + +public: + + KeyHashT &GetHashRef() { return m_table.GetHashRef().m_hash; } + KeyIsEqualT &GetEqualRef() { return m_table.GetEqualRef().m_eq; } + KeyHashT const &GetHashRef() const { return m_table.GetHashRef().m_hash; } + KeyIsEqualT const &GetEqualRef() const { return m_table.GetEqualRef().m_eq; } + + UtlHashHandle_t Insert( KeyArg_t k ) { return DoInsert( k ); } + UtlHashHandle_t Insert( KeyAlt_t k ) { return DoInsert( k ); } + UtlHashHandle_t Insert( KeyArg_t k, ValueArg_t v ) { return DoInsert( k, v ); } + UtlHashHandle_t Insert( KeyAlt_t k, ValueArg_t v ) { return DoInsert( k, v ); } + UtlHashHandle_t Find( KeyArg_t k ) const { return DoFind( k ); } + UtlHashHandle_t Find( KeyAlt_t k ) const { return DoFind( k ); } + bool Remove( KeyArg_t k ) { return DoRemove( k ); } + bool Remove( KeyAlt_t k ) { return DoRemove( k ); } + + void RemoveAll() { m_table.RemoveAll(); m_data.RemoveAll(); } + void Purge() { m_table.Purge(); m_data.Purge(); } + int Count() const { return m_table.Count(); } + + typedef typename KVPair::ValueReturn_t Element_t; + KeyT const &Key( UtlHashHandle_t idx ) const { return m_data[idx].m_key; } + Element_t const &Element( UtlHashHandle_t idx ) const { return m_data[idx].GetValue(); } + Element_t &Element( UtlHashHandle_t idx ) { return m_data[idx].GetValue(); } + Element_t const &operator[]( UtlHashHandle_t idx ) const { return m_data[idx].GetValue(); } + Element_t &operator[]( UtlHashHandle_t idx ) { return m_data[idx].GetValue(); } + + void ReplaceKey( UtlHashHandle_t idx, KeyArg_t k ) { Assert( GetEqualRef()( m_data[idx].m_key, k ) && GetHashRef()( k ) == GetHashRef()( m_data[idx].m_key ) ); m_data[idx].m_key = k; } + void ReplaceKey( UtlHashHandle_t idx, KeyAlt_t k ) { Assert( GetEqualRef()( m_data[idx].m_key, k ) && GetHashRef()( k ) == GetHashRef()( m_data[idx].m_key ) ); m_data[idx].m_key = k; } + + Element_t const &Get( KeyArg_t k, Element_t const &defaultValue ) const { UtlHashHandle_t h = Find( k ); if ( h != InvalidHandle() ) return Element( h ); return defaultValue; } + Element_t const &Get( KeyAlt_t k, Element_t const &defaultValue ) const { UtlHashHandle_t h = Find( k ); if ( h != InvalidHandle() ) return Element( h ); return defaultValue; } + + Element_t const *GetPtr( KeyArg_t k ) const { UtlHashHandle_t h = Find(k); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + Element_t const *GetPtr( KeyAlt_t k ) const { UtlHashHandle_t h = Find(k); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + Element_t *GetPtr( KeyArg_t k ) { UtlHashHandle_t h = Find( k ); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + Element_t *GetPtr( KeyAlt_t k ) { UtlHashHandle_t h = Find( k ); if ( h != InvalidHandle() ) return &Element( h ); return NULL; } + + UtlHashHandle_t FirstHandle() const { return ExtendInvalidHandle( m_data.Head() ); } + UtlHashHandle_t NextHandle( UtlHashHandle_t h ) const { return ExtendInvalidHandle( m_data.Next( h ) ); } + bool IsValidHandle( UtlHashHandle_t h ) const { return m_data.IsValidIndex( h ); } + UtlHashHandle_t InvalidHandle() const { return (UtlHashHandle_t)-1; } + + UtlHashHandle_t RemoveAndAdvance( UtlHashHandle_t h ) + { + Assert( m_data.IsValidIndex( h ) ); + m_table.Remove( IndirectIndex( h ) ); + IndexStorage_t next = m_data.Next( h ); + m_data.Remove( h ); + return ExtendInvalidHandle(next); + } + + void Compact( bool bMinimal ) { m_table.Compact( bMinimal ); /*m_data.Compact();*/ } + + void Swap( CUtlStableHashtable &other ) + { + m_table.Swap(other.m_table); + // XXX swapping CUtlLinkedList by block memory swap, ugh + char buf[ sizeof(m_data) ]; + memcpy( buf, &m_data, sizeof(m_data) ); + memcpy( &m_data, &other.m_data, sizeof(m_data) ); + memcpy( &other.m_data, buf, sizeof(m_data) ); + } + + +protected: + // Perform extension of 0xFFFF to 0xFFFFFFFF if necessary. Note: ( a < CONSTANT ) ? 0 : -1 is usually branchless + static UtlHashHandle_t ExtendInvalidHandle( uint32 x ) { return x; } + static UtlHashHandle_t ExtendInvalidHandle( uint16 x ) { uint32 a = x; return a | ( ( a < 0xFFFFu ) ? 0 : -1 ); } + + struct IndirectIndex + { + explicit IndirectIndex(IndexStorage_t i) : m_index(i) { } + IndexStorage_t m_index; + }; + + struct HashProxy + { + KeyHashT m_hash; + unsigned int operator()( IndirectIndex idx ) const + { + const ptrdiff_t tableoffset = (uintptr_t)(&((Hashtable_t*)1024)->GetHashRef()) - 1024; + const ptrdiff_t owneroffset = offsetof(CUtlStableHashtable, m_table) + tableoffset; + CUtlStableHashtable* pOwner = (CUtlStableHashtable*)((uintptr_t)this - owneroffset); + return m_hash( pOwner->m_data[ idx.m_index ].m_key ); + } + unsigned int operator()( KeyArg_t k ) const { return m_hash( k ); } + unsigned int operator()( KeyAlt_t k ) const { return m_hash( k ); } + }; + + struct EqualProxy + { + KeyIsEqualT m_eq; + unsigned int operator()( IndirectIndex lhs, IndirectIndex rhs ) const + { + return lhs.m_index == rhs.m_index; + } + unsigned int operator()( IndirectIndex lhs, KeyArg_t rhs ) const + { + const ptrdiff_t tableoffset = (uintptr_t)(&((Hashtable_t*)1024)->GetEqualRef()) - 1024; + const ptrdiff_t owneroffset = offsetof(CUtlStableHashtable, m_table) + tableoffset; + CUtlStableHashtable* pOwner = (CUtlStableHashtable*)((uintptr_t)this - owneroffset); + return m_eq( pOwner->m_data[ lhs.m_index ].m_key, rhs ); + } + unsigned int operator()( IndirectIndex lhs, KeyAlt_t rhs ) const + { + const ptrdiff_t tableoffset = (uintptr_t)(&((Hashtable_t*)1024)->GetEqualRef()) - 1024; + const ptrdiff_t owneroffset = offsetof(CUtlStableHashtable, m_table) + tableoffset; + CUtlStableHashtable* pOwner = (CUtlStableHashtable*)((uintptr_t)this - owneroffset); + return m_eq( pOwner->m_data[ lhs.m_index ].m_key, rhs ); + } + }; + + class CCustomLinkedList : public LinkedList_t + { + public: + int AddToTailUnconstructed() + { + IndexStorage_t newNode = this->AllocInternal(); + if ( newNode != this->InvalidIndex() ) + this->LinkToTail( newNode ); + return newNode; + } + }; + + Hashtable_t m_table; + CCustomLinkedList m_data; +}; + +template +template +inline bool CUtlStableHashtable::DoRemove( KeyArgumentT k ) +{ + unsigned int hash = m_table.GetHashRef()( k ); + UtlHashHandle_t h = m_table.template DoLookup( k, hash, NULL ); + if ( h == m_table.InvalidHandle() ) + return false; + + int idx = m_table[ h ].m_index; + m_table.template DoRemove( IndirectIndex( idx ), hash ); + m_data.Remove( idx ); + return true; +} + +template +template +inline UtlHashHandle_t CUtlStableHashtable::DoFind( KeyArgumentT k ) const +{ + unsigned int hash = m_table.GetHashRef()( k ); + UtlHashHandle_t h = m_table.template DoLookup( k, hash, NULL ); + if ( h != m_table.InvalidHandle() ) + return m_table[ h ].m_index; + + return (UtlHashHandle_t) -1; +} + +template +template +inline UtlHashHandle_t CUtlStableHashtable::DoInsert( KeyArgumentT k ) +{ + unsigned int hash = m_table.GetHashRef()( k ); + UtlHashHandle_t h = m_table.template DoLookup( k, hash, NULL ); + if ( h != m_table.InvalidHandle() ) + return m_table[ h ].m_index; + + int idx = m_data.AddToTailUnconstructed(); + ConstructOneArg( &m_data[idx], k ); + m_table.template DoInsertNoCheck( IndirectIndex( idx ), empty_t(), hash ); + return idx; +} + +template +template +inline UtlHashHandle_t CUtlStableHashtable::DoInsert( KeyArgumentT k, ValueArgumentT v ) +{ + unsigned int hash = m_table.GetHashRef()( k ); + UtlHashHandle_t h = m_table.template DoLookup( k, hash, NULL ); + if ( h != m_table.InvalidHandle() ) + return m_table[ h ].m_index; + + int idx = m_data.AddToTailUnconstructed(); + ConstructTwoArg( &m_data[idx], k, v ); + m_table.template DoInsertNoCheck( IndirectIndex( idx ), empty_t(), hash ); + return idx; +} + +#endif // UTLHASHTABLE_H diff --git a/public/tier1/utlmap.h b/public/tier1/utlmap.h index 6f933c81b..986d2d9a8 100644 --- a/public/tier1/utlmap.h +++ b/public/tier1/utlmap.h @@ -24,11 +24,11 @@ // This is a useful macro to iterate from start to end in order in a map #define FOR_EACH_MAP( mapName, iteratorName ) \ - for ( int iteratorName = mapName.FirstInorder(); iteratorName != mapName.InvalidIndex(); iteratorName = mapName.NextInorder( iteratorName ) ) + for ( int iteratorName = (mapName).FirstInorder(); iteratorName != (mapName).InvalidIndex(); iteratorName = (mapName).NextInorder( iteratorName ) ) // faster iteration, but in an unspecified order #define FOR_EACH_MAP_FAST( mapName, iteratorName ) \ - for ( int iteratorName = 0; iteratorName < mapName.MaxElement(); ++iteratorName ) if ( !mapName.IsValidIndex( iteratorName ) ) continue; else + for ( int iteratorName = 0; iteratorName < (mapName).MaxElement(); ++iteratorName ) if ( !(mapName).IsValidIndex( iteratorName ) ) continue; else template class CUtlMap @@ -123,6 +123,8 @@ class CUtlMap void RemoveAll( ) { m_Tree.RemoveAll(); } void Purge( ) { m_Tree.Purge(); } + + void PurgeAndDeleteElements(); // Iteration IndexType_t FirstInorder() const { return m_Tree.FirstInorder(); } @@ -198,6 +200,32 @@ class CUtlMap CTree m_Tree; }; +template< typename K, typename T, typename I > +inline void CUtlMap::PurgeAndDeleteElements() +{ + for ( I i = 0; i < MaxElement(); ++i ) + { + if ( !IsValidIndex( i ) ) + continue; + + delete Element( i ); + } + + Purge(); +} + +template < typename K, typename T, typename I > +void DeepCopyMap( const CUtlMap& pmapIn, CUtlMap *out_pmapOut ) +{ + Assert( out_pmapOut ); + + out_pmapOut->Purge(); + FOR_EACH_MAP_FAST( pmapIn, i ) + { + out_pmapOut->Insert( pmapIn.Key( i ), pmapIn.Element( i ) ); + } +} + //----------------------------------------------------------------------------- #endif // UTLMAP_H diff --git a/public/tier1/utlrbtree.h b/public/tier1/utlrbtree.h index b9b49eb8b..76e7b9d95 100644 --- a/public/tier1/utlrbtree.h +++ b/public/tier1/utlrbtree.h @@ -27,6 +27,16 @@ class CDefOps #define DefLessFunc( type ) CDefOps< type >::LessFunc +template +class CDefLess +{ +public: + CDefLess() {} + CDefLess( int i ) {} + inline bool operator()( const T &lhs, const T &rhs ) const { return ( lhs < rhs ); } + inline bool operator!() const { return false; } +}; + //------------------------------------- inline bool StringLessThan( const char * const &lhs, const char * const &rhs) { return ( strcmp( lhs, rhs) < 0 ); } diff --git a/public/tier1/utlstring.h b/public/tier1/utlstring.h index 6c4274015..d043352c7 100644 --- a/public/tier1/utlstring.h +++ b/public/tier1/utlstring.h @@ -125,6 +125,8 @@ class CUtlString // Strips the trailing slash void StripTrailingSlash(); + + void ToLower(); CUtlString &operator=( const CUtlString &src ); CUtlString &operator=( const char *src ); @@ -140,6 +142,9 @@ class CUtlString CUtlString &operator+=( char c ); CUtlString &operator+=( int rhs ); CUtlString &operator+=( double rhs ); + + void Append( const char *pchAddition ) + { this->operator+=(pchAddition); } int Format( const char *pFormat, ... ); @@ -147,6 +152,15 @@ class CUtlString CUtlBinaryBlock m_Storage; }; +inline void CUtlString::ToLower() +{ + if ( IsEmpty() ) + { + return; + } + + V_strlower( (char *)m_Storage.Get() ); +} //----------------------------------------------------------------------------- // Inline methods @@ -156,5 +170,121 @@ inline bool CUtlString::IsEmpty() const return Length() == 0; } +template < typename T > +class StringFuncs +{ +public: + static T *Duplicate( const T *pValue ); + // Note that this function takes a character count, and does not guarantee null-termination. + static void Copy( T *out_pOut, const T *pIn, int iLengthInChars ); + static int Compare( const T *pLhs, const T *pRhs ); + static int CaselessCompare( const T *pLhs, const T *pRhs ); + static int Length( const T *pValue ); + static const T *FindChar( const T *pStr, const T cSearch ); + static const T *EmptyString(); + static const T *NullDebugString(); +}; + +template < > +class StringFuncs +{ +public: + static char *Duplicate( const char *pValue ) { return strdup( pValue ); } + // Note that this function takes a character count, and does not guarantee null-termination. + static void Copy( OUT_CAP(iLengthInChars) char *out_pOut, const char *pIn, int iLengthInChars ) { strncpy( out_pOut, pIn, iLengthInChars ); } + static int Compare( const char *pLhs, const char *pRhs ) { return strcmp( pLhs, pRhs ); } + static int CaselessCompare( const char *pLhs, const char *pRhs ) { return Q_strcasecmp( pLhs, pRhs ); } + static int Length( const char *pValue ) { return (int)strlen( pValue ); } + static const char *FindChar( const char *pStr, const char cSearch ) { return strchr( pStr, cSearch ); } + static const char *EmptyString() { return ""; } + static const char *NullDebugString() { return "(null)"; } +}; + +template < > +class StringFuncs +{ +public: + static wchar_t *Duplicate( const wchar_t *pValue ) { return wcsdup( pValue ); } + // Note that this function takes a character count, and does not guarantee null-termination. + static void Copy( OUT_CAP(iLengthInChars) wchar_t *out_pOut, const wchar_t *pIn, int iLengthInChars ) { wcsncpy( out_pOut, pIn, iLengthInChars ); } + static int Compare( const wchar_t *pLhs, const wchar_t *pRhs ) { return wcscmp( pLhs, pRhs ); } + static int CaselessCompare( const wchar_t *pLhs, const wchar_t *pRhs ); // no implementation? + static int Length( const wchar_t *pValue ) { return (int)wcslen( pValue ); } + static const wchar_t *FindChar( const wchar_t *pStr, const wchar_t cSearch ) { return wcschr( pStr, cSearch ); } + static const wchar_t *EmptyString() { return L""; } + static const wchar_t *NullDebugString() { return L"(null)"; } +}; + +template < typename T = char > +class CUtlConstStringBase +{ +public: + CUtlConstStringBase() : m_pString( NULL ) {} + explicit CUtlConstStringBase( const T *pString ) : m_pString( NULL ) { Set( pString ); } + CUtlConstStringBase( const CUtlConstStringBase& src ) : m_pString( NULL ) { Set( src.m_pString ); } + ~CUtlConstStringBase() { Set( NULL ); } + + void Set( const T *pValue ); + void Clear() { Set( NULL ); } + + const T *Get() const { return m_pString ? m_pString : StringFuncs::EmptyString(); } + operator const T*() const { return m_pString ? m_pString : StringFuncs::EmptyString(); } + + bool IsEmpty() const { return m_pString == NULL; } // Note: empty strings are never stored by Set + + int Compare( const T *rhs ) const; + + // Logical ops + bool operator<( const T *rhs ) const { return Compare( rhs ) < 0; } + bool operator==( const T *rhs ) const { return Compare( rhs ) == 0; } + bool operator!=( const T *rhs ) const { return Compare( rhs ) != 0; } + bool operator<( const CUtlConstStringBase &rhs ) const { return Compare( rhs.m_pString ) < 0; } + bool operator==( const CUtlConstStringBase &rhs ) const { return Compare( rhs.m_pString ) == 0; } + bool operator!=( const CUtlConstStringBase &rhs ) const { return Compare( rhs.m_pString ) != 0; } + + // If these are not defined, CUtlConstString as rhs will auto-convert + // to const char* and do logical operations on the raw pointers. Ugh. + inline friend bool operator<( const T *lhs, const CUtlConstStringBase &rhs ) { return rhs.Compare( lhs ) > 0; } + inline friend bool operator==( const T *lhs, const CUtlConstStringBase &rhs ) { return rhs.Compare( lhs ) == 0; } + inline friend bool operator!=( const T *lhs, const CUtlConstStringBase &rhs ) { return rhs.Compare( lhs ) != 0; } + + CUtlConstStringBase &operator=( const T *src ) { Set( src ); return *this; } + CUtlConstStringBase &operator=( const CUtlConstStringBase &src ) { Set( src.m_pString ); return *this; } + + // Defining AltArgumentType_t is a hint to containers that they should + // implement Find/Insert/Remove functions that take const char* params. + typedef const T *AltArgumentType_t; + +protected: + const T *m_pString; +}; + +template < typename T > +void CUtlConstStringBase::Set( const T *pValue ) +{ + if ( pValue != m_pString ) + { + free( ( void* ) m_pString ); + m_pString = pValue && pValue[0] ? StringFuncs::Duplicate( pValue ) : NULL; + } +} + +template < typename T > +int CUtlConstStringBase::Compare( const T *rhs ) const +{ + // Empty or null RHS? + if ( !rhs || !rhs[0] ) + return m_pString ? 1 : 0; + + // Empty *this, non-empty RHS? + if ( !m_pString ) + return -1; + + // Neither empty + return StringFuncs::Compare( m_pString, rhs ); +} + +typedef CUtlConstStringBase CUtlConstString; +typedef CUtlConstStringBase CUtlConstWideString; #endif // UTLSTRING_H diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index a4940be05..58e6ea0ac 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -26,7 +26,9 @@ #define FOR_EACH_VEC( vecName, iteratorName ) \ for ( int iteratorName = 0; iteratorName < vecName.Count(); iteratorName++ ) - +#define FOR_EACH_VEC_BACK( vecName, iteratorName ) \ + for ( int iteratorName = (vecName).Count()-1; iteratorName >= 0; iteratorName-- ) + //----------------------------------------------------------------------------- // The CUtlVector class: // A growable array class which doubles in size by default. @@ -41,6 +43,8 @@ class CUtlVector typedef A CAllocator; public: typedef T ElemType_t; + typedef T* iterator; + typedef const T* const_iterator; // constructor, destructor CUtlVector( int growSize = 0, int initSize = 0 ); @@ -69,6 +73,11 @@ class CUtlVector int Count() const; int Size() const; // don't use me! + iterator begin() { return Base(); } + const_iterator begin() const { return Base(); } + iterator end() { return Base() + Count(); } + const_iterator end() const { return Base() + Count(); } + // Is element index valid? bool IsValidIndex( int i ) const; static int InvalidIndex(); @@ -119,6 +128,7 @@ class CUtlVector void FastRemove( int elem ); // doesn't preserve order void Remove( int elem ); // preserves order, shifts elements bool FindAndRemove( const T& src ); // removes first occurrence of src, preserves order, shifts elements + bool FindAndFastRemove( const T& src ); void RemoveMultiple( int elem, int num ); // preserves order, shifts elements void RemoveAll(); // doesn't deallocate memory @@ -977,6 +987,18 @@ bool CUtlVector::FindAndRemove( const T& src ) return false; } +template< typename T, class A > +bool CUtlVector::FindAndFastRemove( const T& src ) +{ + int elem = Find( src ); + if ( elem != -1 ) + { + FastRemove( elem ); + return true; + } + return false; +} + template< typename T, class A > void CUtlVector::RemoveMultiple( int elem, int num ) { @@ -1053,5 +1075,75 @@ void CUtlVector::Validate( CValidator &validator, char *pchName ) } #endif // DBGFLAG_VALIDATE +template class CUtlVectorAutoPurge : public CUtlVector< T, CUtlMemory< T, int> > +{ +public: + ~CUtlVectorAutoPurge( void ) + { + this->PurgeAndDeleteElements(); + } + +}; + +// easy string list class with dynamically allocated strings. For use with V_SplitString, etc. +// Frees the dynamic strings in destructor. +class CUtlStringList : public CUtlVectorAutoPurge< char *> +{ +public: + void CopyAndAddToTail( char const *pString ) // clone the string and add to the end + { + char *pNewStr = new char[1 + strlen( pString )]; + V_strcpy( pNewStr, pString ); + AddToTail( pNewStr ); + } + + static int __cdecl SortFunc( char * const * sz1, char * const * sz2 ) + { + return strcmp( *sz1, *sz2 ); + } + + CUtlStringList(){} + + CUtlStringList( char const *pString, char const *pSeparator ) + { + SplitString( pString, pSeparator ); + } + + CUtlStringList( char const *pString, const char **pSeparators, int nSeparators ) + { + SplitString2( pString, pSeparators, nSeparators ); + } + + void SplitString( char const *pString, char const *pSeparator ) + { + V_SplitString( pString, pSeparator, *this ); + } + + void SplitString2( char const *pString, const char **pSeparators, int nSeparators ) + { + V_SplitString2( pString, pSeparators, nSeparators, *this ); + } +private: + CUtlStringList( const CUtlStringList &other ); // copying directly will cause double-release of the same strings; maybe we need to do a deep copy, but unless and until such need arises, this will guard against double-release +}; + + + +// placing it here a few days before Cert to minimize disruption to the rest of codebase +class CSplitString: public CUtlVector > +{ +public: + CSplitString(const char *pString, const char *pSeparator); + CSplitString(const char *pString, const char **pSeparators, int nSeparators); + ~CSplitString(); + // + // NOTE: If you want to make Construct() public and implement Purge() here, you'll have to free m_szBuffer there + // +private: + void Construct(const char *pString, const char **pSeparators, int nSeparators); + void PurgeAndDeleteElements(); +private: + char *m_szBuffer; // a copy of original string, with '\0' instead of separators +}; #endif // CCVECTOR_H diff --git a/public/vstdlib/coroutine.h b/public/vstdlib/coroutine.h new file mode 100644 index 000000000..797324df9 --- /dev/null +++ b/public/vstdlib/coroutine.h @@ -0,0 +1,69 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: setjmp/longjmp based cooperative multitasking system +// +//============================================================================= + +#ifndef COROUTINE_H +#define COROUTINE_H +#pragma once + +#include "vstdlib/vstdlib.h" + +// enable this to do coroutine tracing +// this will tell coroutine API users to set coroutine names +// #define COROUTINE_TRACE + +//----------------------------------------------------------------------------- +// Purpose: handles running coroutines +// setjmp/longjmp based cooperative multitasking system +//----------------------------------------------------------------------------- + +// coroutine callback +typedef void (__cdecl *CoroutineFunc_t )(void *); + +// handle to a coroutine +typedef int32 HCoroutine; + +// creates a new coroutine +// no coroutine code is executed until Coroutine_Continue() is called +VSTDLIB_INTERFACE HCoroutine Coroutine_Create( CoroutineFunc_t pFunc, void *pvParam ); + +// continues the specified coroutine +// returns true if the coroutine is still running, false otherwise +VSTDLIB_INTERFACE bool Coroutine_Continue( HCoroutine hCoroutine, const char *pchName = NULL ); + +// cancels a currently running coroutine +VSTDLIB_INTERFACE void Coroutine_Cancel( HCoroutine hCoroutine ); + +// 'load' a coroutine only to debug it - immediately breaks into debugger +// when continued, pops back to the prior coroutine +VSTDLIB_INTERFACE void Coroutine_DebugBreak( HCoroutine hCoroutine ); + +// Load a coroutine and generate an assert. Used to get a minidump of a job +VSTDLIB_INTERFACE void Coroutine_DebugAssert( HCoroutine hCoroutine, const char *pchMsg ); + +// called from the coroutine to return control to the main thread +VSTDLIB_INTERFACE void Coroutine_YieldToMain(); + +// returns true if the code is currently running inside of a coroutine +VSTDLIB_INTERFACE bool Coroutine_IsActive(); + +// returns a handle the currently active coroutine +VSTDLIB_INTERFACE HCoroutine Coroutine_GetCurrentlyActive(); + +// call when a thread is quiting to release any per-thread memory +VSTDLIB_INTERFACE void Coroutine_ReleaseThreadMemory(); + +// runs a self-test of the coroutine system +VSTDLIB_INTERFACE bool Coroutine_Test(); + +// memory validation +VSTDLIB_INTERFACE void Coroutine_ValidateGlobals( class CValidator &validator ); + +// for debugging purposes - returns stack depth of current coroutine +VSTDLIB_INTERFACE size_t Coroutine_GetStackDepth(); + + + +#endif // COROUTINE_H diff --git a/public/vstdlib/osversion.h b/public/vstdlib/osversion.h new file mode 100644 index 000000000..ecc68ae53 --- /dev/null +++ b/public/vstdlib/osversion.h @@ -0,0 +1,60 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef OSVERSION_H +#define OSVERSION_H +#pragma once + +#include "vstdlib/vstdlib.h" + +// OS types we know about +// Must be in ascending capability order, we use this for min OS requirements +enum EOSType +{ + k_eOSUnknown = -1, + k_eMacOSUnknown = -102, + k_eMacOS104 = -101, + k_eMacOS105 = -100, + k_eMacOS1058 = -99, + k_eMacOS106 = -95, + k_eMacOS1063 = -94, + k_eMacOS107 = -90, + // k_eMacOSMax = -1 + k_eLinuxUnknown = -203, + k_eLinux22 = -202, + k_eLinux24 = -201, + k_eLinux26 = -200, + // k_eLinuxMax = -103 + k_eWinUnknown = 0, + k_eWin311 = 1, + k_eWin95, + k_eWin98, + k_eWinME, + k_eWinNT, + k_eWin2000, + k_eWinXP, + k_eWin2003, + k_eWinVista, + k_eWindows7, + k_eWin2008, + k_eWinMAX, + k_eOSTypeMax = k_eWinMAX + 11 // win types + other ifdef'd types +}; + +VSTDLIB_INTERFACE const char *GetNameFromOSType( EOSType eOSType ); +VSTDLIB_INTERFACE const char *GetOSDetailString( char *pchOutBuf, int cchOutBuf ); +VSTDLIB_INTERFACE EOSType GetOSType(); +VSTDLIB_INTERFACE bool OSTypesAreCompatible( EOSType eOSTypeDetected, EOSType eOSTypeRequired ); +VSTDLIB_INTERFACE const char *GetPlatformName( bool *pbIs64Bit ); + +#endif // OSVERSION_H diff --git a/tier1/checksum_sha1.cpp b/tier1/checksum_sha1.cpp new file mode 100644 index 000000000..ee6e27c29 --- /dev/null +++ b/tier1/checksum_sha1.cpp @@ -0,0 +1,299 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Implementation of SHA-1 +// +//============================================================================= + +/* + 100% free public domain implementation of the SHA-1 + algorithm by Dominik Reichl + + + === Test Vectors (from FIPS PUB 180-1) === + + SHA1("abc") = + A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D + + SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = + 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 + + SHA1(A million repetitions of "a") = + 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F +*/ + +#if !defined(_MINIMUM_BUILD_) +#include "checksum_sha1.h" +#else +// +// This path is build in the CEG/DRM projects where we require that no CRT references are made ! +// +#include // memcpy, memset etc... will be inlined. +#include "tier1/checksum_sha1.h" +#endif + +#define MAX_FILE_READ_BUFFER 8000 + +// Rotate x bits to the left +#ifndef ROL32 +#define ROL32(_val32, _nBits) (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits)))) +#endif + +#ifdef SHA1_LITTLE_ENDIAN + #define SHABLK0(i) (m_block->l[i] = \ + (ROL32(m_block->l[i],24) & 0xFF00FF00) | (ROL32(m_block->l[i],8) & 0x00FF00FF)) +#else + #define SHABLK0(i) (m_block->l[i]) +#endif + +#define SHABLK(i) (m_block->l[i&15] = ROL32(m_block->l[(i+13)&15] ^ m_block->l[(i+8)&15] \ + ^ m_block->l[(i+2)&15] ^ m_block->l[i&15],1)) + +// SHA-1 rounds +#define _R0(v,w,x,y,z,i) { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); } +#define _R1(v,w,x,y,z,i) { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); } +#define _R2(v,w,x,y,z,i) { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); } +#define _R3(v,w,x,y,z,i) { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); } +#define _R4(v,w,x,y,z,i) { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); } + +#ifdef _MINIMUM_BUILD_ +Minimum_CSHA1::Minimum_CSHA1() +#else +CSHA1::CSHA1() +#endif +{ + m_block = (SHA1_WORKSPACE_BLOCK *)m_workspace; + + Reset(); +} +#ifdef _MINIMUM_BUILD_ +Minimum_CSHA1::~Minimum_CSHA1() +#else +CSHA1::~CSHA1() +#endif +{ + // Reset(); +} +#ifdef _MINIMUM_BUILD_ +void Minimum_CSHA1::Reset() +#else +void CSHA1::Reset() +#endif +{ + // SHA1 initialization constants + m_state[0] = 0x67452301; + m_state[1] = 0xEFCDAB89; + m_state[2] = 0x98BADCFE; + m_state[3] = 0x10325476; + m_state[4] = 0xC3D2E1F0; + + m_count[0] = 0; + m_count[1] = 0; +} + +#ifdef _MINIMUM_BUILD_ +void Minimum_CSHA1::Transform(unsigned long state[5], unsigned char buffer[64]) +#else +void CSHA1::Transform(unsigned long state[5], unsigned char buffer[64]) +#endif +{ + unsigned long a = 0, b = 0, c = 0, d = 0, e = 0; + + memcpy(m_block, buffer, 64); + + // Copy state[] to working vars + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + + // 4 rounds of 20 operations each. Loop unrolled. + _R0(a,b,c,d,e, 0); _R0(e,a,b,c,d, 1); _R0(d,e,a,b,c, 2); _R0(c,d,e,a,b, 3); + _R0(b,c,d,e,a, 4); _R0(a,b,c,d,e, 5); _R0(e,a,b,c,d, 6); _R0(d,e,a,b,c, 7); + _R0(c,d,e,a,b, 8); _R0(b,c,d,e,a, 9); _R0(a,b,c,d,e,10); _R0(e,a,b,c,d,11); + _R0(d,e,a,b,c,12); _R0(c,d,e,a,b,13); _R0(b,c,d,e,a,14); _R0(a,b,c,d,e,15); + _R1(e,a,b,c,d,16); _R1(d,e,a,b,c,17); _R1(c,d,e,a,b,18); _R1(b,c,d,e,a,19); + _R2(a,b,c,d,e,20); _R2(e,a,b,c,d,21); _R2(d,e,a,b,c,22); _R2(c,d,e,a,b,23); + _R2(b,c,d,e,a,24); _R2(a,b,c,d,e,25); _R2(e,a,b,c,d,26); _R2(d,e,a,b,c,27); + _R2(c,d,e,a,b,28); _R2(b,c,d,e,a,29); _R2(a,b,c,d,e,30); _R2(e,a,b,c,d,31); + _R2(d,e,a,b,c,32); _R2(c,d,e,a,b,33); _R2(b,c,d,e,a,34); _R2(a,b,c,d,e,35); + _R2(e,a,b,c,d,36); _R2(d,e,a,b,c,37); _R2(c,d,e,a,b,38); _R2(b,c,d,e,a,39); + _R3(a,b,c,d,e,40); _R3(e,a,b,c,d,41); _R3(d,e,a,b,c,42); _R3(c,d,e,a,b,43); + _R3(b,c,d,e,a,44); _R3(a,b,c,d,e,45); _R3(e,a,b,c,d,46); _R3(d,e,a,b,c,47); + _R3(c,d,e,a,b,48); _R3(b,c,d,e,a,49); _R3(a,b,c,d,e,50); _R3(e,a,b,c,d,51); + _R3(d,e,a,b,c,52); _R3(c,d,e,a,b,53); _R3(b,c,d,e,a,54); _R3(a,b,c,d,e,55); + _R3(e,a,b,c,d,56); _R3(d,e,a,b,c,57); _R3(c,d,e,a,b,58); _R3(b,c,d,e,a,59); + _R4(a,b,c,d,e,60); _R4(e,a,b,c,d,61); _R4(d,e,a,b,c,62); _R4(c,d,e,a,b,63); + _R4(b,c,d,e,a,64); _R4(a,b,c,d,e,65); _R4(e,a,b,c,d,66); _R4(d,e,a,b,c,67); + _R4(c,d,e,a,b,68); _R4(b,c,d,e,a,69); _R4(a,b,c,d,e,70); _R4(e,a,b,c,d,71); + _R4(d,e,a,b,c,72); _R4(c,d,e,a,b,73); _R4(b,c,d,e,a,74); _R4(a,b,c,d,e,75); + _R4(e,a,b,c,d,76); _R4(d,e,a,b,c,77); _R4(c,d,e,a,b,78); _R4(b,c,d,e,a,79); + + // Add the working vars back into state[] + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + + // Wipe variables + a = b = c = d = e = 0; +} + +// Use this function to hash in binary data and strings +#ifdef _MINIMUM_BUILD_ +void Minimum_CSHA1::Update(unsigned char *data, unsigned int len) +#else +void CSHA1::Update(unsigned char *data, unsigned int len) +#endif +{ + unsigned long i = 0, j; + + j = (m_count[0] >> 3) & 63; + + if((m_count[0] += len << 3) < (len << 3)) m_count[1]++; + + m_count[1] += (len >> 29); + + if((j + len) > 63) + { + memcpy(&m_buffer[j], data, (i = 64 - j)); + Transform(m_state, m_buffer); + + for (; i+63 < len; i += 64) + Transform(m_state, &data[i]); + + j = 0; + } + else i = 0; + + memcpy(&m_buffer[j], &data[i], len - i); +} + +#if !defined(_MINIMUM_BUILD_) +// Hash in file contents +bool CSHA1::HashFile(char *szFileName) +{ + unsigned long ulFileSize = 0, ulRest = 0, ulBlocks = 0; + unsigned long i = 0; + unsigned char uData[MAX_FILE_READ_BUFFER]; + FILE *fIn = NULL; + + if(szFileName == NULL) return(false); + + if((fIn = fopen(szFileName, "rb")) == NULL) return(false); + + fseek(fIn, 0, SEEK_END); + ulFileSize = ftell(fIn); + fseek(fIn, 0, SEEK_SET); + + ulRest = ulFileSize % MAX_FILE_READ_BUFFER; + ulBlocks = ulFileSize / MAX_FILE_READ_BUFFER; + + for(i = 0; i < ulBlocks; i++) + { + fread(uData, 1, MAX_FILE_READ_BUFFER, fIn); + Update(uData, MAX_FILE_READ_BUFFER); + } + + if(ulRest != 0) + { + fread(uData, 1, ulRest, fIn); + Update(uData, ulRest); + } + + fclose(fIn); + fIn = NULL; + + return(true); +} +#endif + +#ifdef _MINIMUM_BUILD_ +void Minimum_CSHA1::Final() +#else +void CSHA1::Final() +#endif +{ + unsigned long i = 0; + unsigned char finalcount[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + for (i = 0; i < 8; i++) + finalcount[i] = (unsigned char)((m_count[(i >= 4 ? 0 : 1)] + >> ((3 - (i & 3)) * 8) ) & 255); // Endian independent + + Update((unsigned char *)"\200", 1); + + while ((m_count[0] & 504) != 448) + Update((unsigned char *)"\0", 1); + + Update(finalcount, 8); // Cause a SHA1Transform() + + for (i = 0; i < k_cubHash; i++) + { + m_digest[i] = (unsigned char)((m_state[i >> 2] >> ((3 - (i & 3)) * 8) ) & 255); + } + + // Wipe variables for security reasons + i = 0; + memset(m_buffer, 0, sizeof(m_buffer) ); + memset(m_state, 0, sizeof(m_state) ); + memset(m_count, 0, sizeof(m_count) ); + memset(finalcount, 0, sizeof( finalcount) ); + + Transform(m_state, m_buffer); +} + +#if !defined(_MINIMUM_BUILD_) +// Get the final hash as a pre-formatted string +void CSHA1::ReportHash(char *szReport, unsigned char uReportType) +{ + unsigned char i = 0; + char szTemp[12]; + + if(szReport == NULL) return; + + if(uReportType == REPORT_HEX) + { + sprintf(szTemp, "%02X", m_digest[0]); + strcat(szReport, szTemp); + + for(i = 1; i < k_cubHash; i++) + { + sprintf(szTemp, " %02X", m_digest[i]); + strcat(szReport, szTemp); + } + } + else if(uReportType == REPORT_DIGIT) + { + sprintf(szTemp, "%u", m_digest[0]); + strcat(szReport, szTemp); + + for(i = 1; i < k_cubHash; i++) + { + sprintf(szTemp, " %u", m_digest[i]); + strcat(szReport, szTemp); + } + } + else strcpy(szReport, "Error: Unknown report type!"); +} +#endif // _MINIMUM_BUILD_ + +// Get the raw message digest +#ifdef _MINIMUM_BUILD_ +void Minimum_CSHA1::GetHash(unsigned char *uDest) +#else +void CSHA1::GetHash(unsigned char *uDest) +#endif +{ + memcpy(uDest, m_digest, k_cubHash); +} + +#ifndef _MINIMUM_BUILD_ +// utility hash comparison function +bool HashLessFunc( SHADigest_t const &lhs, SHADigest_t const &rhs ) +{ + int iRes = memcmp( &lhs, &rhs, sizeof( SHADigest_t ) ); + return ( iRes < 0 ); +} +#endif diff --git a/tier1/reliabletimer.cpp b/tier1/reliabletimer.cpp new file mode 100644 index 000000000..af8b8421a --- /dev/null +++ b/tier1/reliabletimer.cpp @@ -0,0 +1,93 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#include "tier1/reliabletimer.h" + +int64 CReliableTimer::sm_nPerformanceFrequency = 0; +bool CReliableTimer::sm_bUseQPC = false; + +#ifdef _WIN32 +#include "winlite.h" +#endif + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CReliableTimer::CReliableTimer() +{ + m_nPerformanceCounterStart = 0; + m_nPerformanceCounterEnd = 0; + m_nPerformanceCounterLimit = 0; + +#ifdef _WIN32 + // calculate performance frequency the first time we use a timer + if ( 0 == sm_nPerformanceFrequency ) + { + // Are we on a bad CPU? + sm_bUseQPC = false; // todo + const CPUInformation &cpu = *GetCPUInformation(); + sm_bUseQPC = ( ( 0 == Q_stricmp( cpu.m_szProcessorID, "AuthenticAMD" ) ) + && ( cpu.m_nPhysicalProcessors > 1 ) + && !cpu.m_bSSE41 ); + + if ( sm_bUseQPC ) + { + LARGE_INTEGER li; + QueryPerformanceFrequency( &li ); + sm_nPerformanceFrequency = li.QuadPart; + } + else + { + sm_nPerformanceFrequency = g_ClockSpeed; + } + } +#elif defined(_PS3) + // On PowerPC, the time base register increment frequency is implementation dependent, and doesn't have to be constant. + // On PS3, measured it to be just shy of 80Mhz on the PPU and doesn't seem to change + if ( sm_nPerformanceFrequency == 0 ) + sm_nPerformanceFrequency = sys_time_get_timebase_frequency(); +#else + // calculate performance frequency the first time we use a timer + if ( 0 == sm_nPerformanceFrequency ) + { + sm_nPerformanceFrequency = g_ClockSpeed; + } +#endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns current QueryPerformanceCounter value +//----------------------------------------------------------------------------- +int64 CReliableTimer::GetPerformanceCountNow() +{ + //VPROF_BUDGET( "CReliableTimer::GetPerformanceCountNow", VPROF_BUDGETGROUP_OTHER_UNACCOUNTED ); +#ifdef _WIN32 + if ( sm_bUseQPC ) + { + LARGE_INTEGER li = {0}; + QueryPerformanceCounter( &li ); + return li.QuadPart; + } + else + { + CCycleCount CycleCount; + CycleCount.Sample(); + return CycleCount.GetLongCycles(); + } +#elif defined( _PS3 ) + // use handy macro to grab tb + uint64 ulNow; + SYS_TIMEBASE_GET( ulNow ); + return ulNow; +#else + uint64 un64; + __asm__ __volatile__ ( + "rdtsc\n\t" + : "=A" (un64) ); + return (int64)un64; +#endif +} From 1cac49d8cfd9d79ac76ac380eeae8e60ec437031 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Fri, 2 Apr 2021 23:41:44 -0300 Subject: [PATCH 12/24] fix the thread fix --- public/tier0/logging.h | 2 +- public/tier0/threadtools.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/public/tier0/logging.h b/public/tier0/logging.h index c62f9bfbe..7c84ac520 100644 --- a/public/tier0/logging.h +++ b/public/tier0/logging.h @@ -83,7 +83,7 @@ class CLoggingSystem; -#if defined(_WIN32) && !defined(THREAD_PROFILER) +#if !defined(THREAD_PROFILER) class CThreadFastMutex; #else class CThreadMutex; diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index e4cd3ef41..e3ec21cd5 100644 --- a/public/tier0/threadtools.h +++ b/public/tier0/threadtools.h @@ -574,6 +574,13 @@ class TT_CLASS CThreadMutex #else #error #endif + +#ifdef THREAD_MUTEX_TRACING_SUPPORTED + // Debugging (always herge to allow mixed debug/release builds w/o changing size) + uint m_currentOwnerID; + uint16 m_lockCount; + bool m_bTrace; +#endif }; //----------------------------------------------------------------------------- @@ -586,7 +593,7 @@ class TT_CLASS CThreadMutex // //----------------------------------------------------------------------------- -#if defined(_WIN32) && !defined(THREAD_PROFILER) +#if !defined(THREAD_PROFILER) class CThreadFastMutex { @@ -600,7 +607,7 @@ class CThreadFastMutex private: FORCEINLINE bool TryLockInline( const uint32 threadId ) volatile { - if ( threadId != m_ownerID && !ThreadInterlockedAssignIf( (volatile long *)&m_ownerID, (long)threadId, 0 ) ) + if ( threadId != m_ownerID && !ThreadInterlockedAssignIf( (volatile uint32 *)&m_ownerID, (uint32)threadId, 0 ) ) return false; ++m_depth; @@ -799,7 +806,7 @@ typedef CAutoLockT CAutoLock; template struct CAutoLockTypeDeducer {}; template <> struct CAutoLockTypeDeducer { typedef CThreadMutex Type_t; }; template <> struct CAutoLockTypeDeducer { typedef CThreadNullMutex Type_t; }; -#if defined(_WIN32) && !defined(THREAD_PROFILER) +#if !defined(THREAD_PROFILER) template <> struct CAutoLockTypeDeducer { typedef CThreadFastMutex Type_t; }; template <> struct CAutoLockTypeDeducer { typedef CAlignedThreadFastMutex Type_t; }; #endif From 15ce6f70bd41a9c76e5995fabd9a7a074ec0ad3b Mon Sep 17 00:00:00 2001 From: arthurdead Date: Sun, 4 Apr 2021 23:05:24 -0300 Subject: [PATCH 13/24] use offsetof --- public/networkvar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/networkvar.h b/public/networkvar.h index c00ec09e3..52e6256a2 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -21,7 +21,7 @@ #pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) -#define MyOffsetOf( type, var ) ( (int)&((type*)0)->var ) +#define MyOffsetOf( type, var ) offsetof( type, var ) #ifdef _DEBUG #undef new From 7883ea8ad25b934593c5a47c6a5cc8a896bcbd51 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Sun, 4 Apr 2021 23:15:53 -0300 Subject: [PATCH 14/24] shut up --- public/networkvar.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/networkvar.h b/public/networkvar.h index 52e6256a2..d4ad1a14e 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -21,6 +21,10 @@ #pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) +#ifdef GNUC +#pragma GCC diagnostic ignored "-Winvalid-offsetof" +#endif + #define MyOffsetOf( type, var ) offsetof( type, var ) #ifdef _DEBUG From 9ee2a1062a95a1283c8a0ca1cb46272dfee39605 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Mon, 5 Apr 2021 00:03:26 -0300 Subject: [PATCH 15/24] remove developer --- game/shared/util_shared.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/shared/util_shared.h b/game/shared/util_shared.h index 77ceaf4e6..1f108dd20 100644 --- a/game/shared/util_shared.h +++ b/game/shared/util_shared.h @@ -33,7 +33,7 @@ class CGameTrace; class CBasePlayer; typedef CGameTrace trace_t; -extern ConVar developer; // developer mode + //----------------------------------------------------------------------------- From be7e4dd9cde00a50634e19a6ae556c8e372fb748 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Mon, 5 Apr 2021 10:33:28 -0300 Subject: [PATCH 16/24] make r_visualizetraces a ptr --- game/shared/util_shared.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/game/shared/util_shared.h b/game/shared/util_shared.h index 1f108dd20..72a7bea2d 100644 --- a/game/shared/util_shared.h +++ b/game/shared/util_shared.h @@ -265,7 +265,7 @@ class CTraceFilterChain : public CTraceFilter // helper void DebugDrawLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, int r, int g, int b, bool test, float duration ); -extern ConVar r_visualizetraces; +extern ConVar *r_visualizetraces; #ifdef DETECT_TRACE_SPIKES #define BeginDetectTraceSpike() \ @@ -301,9 +301,9 @@ inline void UTIL_TraceLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); EndDetectTraceSpike(); - if( r_visualizetraces.GetBool() || DidTraceSpike() ) + if( r_visualizetraces->GetBool() || DidTraceSpike() ) { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, ( r_visualizetraces->GetBool() ) ? -1.0f : .5 ); ReportExpensiveTrace( false ); if ( DidTraceSpike() ) // Opimizer will remove this block { @@ -333,9 +333,9 @@ inline void UTIL_TraceLine( const Vector& vecAbsStart, const Vector& vecAbsEnd, enginetrace->TraceRay( ray, mask, pFilter, ptr ); EndDetectTraceSpike(); - if( r_visualizetraces.GetBool() || DidTraceSpike() ) + if( r_visualizetraces->GetBool() || DidTraceSpike() ) { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, ( r_visualizetraces->GetBool() ) ? -1.0f : .5 ); ReportExpensiveTrace( false ); if ( DidTraceSpike() ) // Opimizer will remove this block { @@ -366,9 +366,9 @@ inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); EndDetectTraceSpike(); - if( r_visualizetraces.GetBool() || DidTraceSpike() ) + if( r_visualizetraces->GetBool() || DidTraceSpike() ) { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, ( r_visualizetraces->GetBool() ) ? -1.0f : .5 ); ReportExpensiveTrace( false ); if ( DidTraceSpike() ) // Opimizer will remove this block { @@ -398,9 +398,9 @@ inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, enginetrace->TraceRay( ray, mask, pFilter, ptr ); EndDetectTraceSpike(); - if( r_visualizetraces.GetBool() || DidTraceSpike() ) + if( r_visualizetraces->GetBool() || DidTraceSpike() ) { - DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, ( r_visualizetraces.GetBool() ) ? -1.0f : .5 ); + DebugDrawLine( ptr->startpos, ptr->endpos, 255, 255, 0, true, ( r_visualizetraces->GetBool() ) ? -1.0f : .5 ); ReportExpensiveTrace( false ); if ( DidTraceSpike() ) // Opimizer will remove this block { @@ -426,7 +426,7 @@ inline void UTIL_TraceRay( const Ray_t &ray, unsigned int mask, enginetrace->TraceRay( ray, mask, &traceFilter, ptr ); - if( r_visualizetraces.GetBool() ) + if( r_visualizetraces->GetBool() ) { DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); } @@ -437,7 +437,7 @@ inline void UTIL_TraceRay( const Ray_t &ray, unsigned int mask, { enginetrace->TraceRay( ray, mask, pFilter, ptr ); - if( r_visualizetraces.GetBool() ) + if( r_visualizetraces->GetBool() ) { DebugDrawLine( ptr->startpos, ptr->endpos, 255, 0, 0, true, -1.0f ); } From e07b56144b844dabf891cba3cc9de10cf6733ba4 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Mon, 5 Apr 2021 10:52:01 -0300 Subject: [PATCH 17/24] dont reference TheNavAreas --- game/server/nav_mesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index 20f7e94c6..54323815f 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -503,7 +503,7 @@ class CNavMesh : public CGameEventListener if ( !m_grid.Count() ) { #if _DEBUG - Warning("Query before nav mesh is loaded! %d\n", TheNavAreas.Count() ); + //Warning("Query before nav mesh is loaded! %d\n", TheNavAreas.Count() ); #endif return true; } From 3c1a1a3ccfb04c0ec0331b2217b5ded8e372692d Mon Sep 17 00:00:00 2001 From: arthurdead Date: Tue, 6 Apr 2021 04:39:16 -0300 Subject: [PATCH 18/24] fix sm compile errors --- public/cmodel.h | 4 ++-- public/networkvar.h | 3 ++- public/studio.h | 2 +- public/tier1/utlmemory.h | 1 + public/tier1/utlvector.h | 4 ++++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/cmodel.h b/public/cmodel.h index b86a44231..c848c4701 100644 --- a/public/cmodel.h +++ b/public/cmodel.h @@ -71,7 +71,7 @@ struct Ray_t void Init( Vector const& start, Vector const& end ) { - Assert( &end ); + //Assert( &end ); VectorSubtract( end, start, m_Delta ); m_IsSwept = (m_Delta.LengthSqr() != 0); @@ -87,7 +87,7 @@ struct Ray_t void Init( Vector const& start, Vector const& end, Vector const& mins, Vector const& maxs ) { - Assert( &end ); + //Assert( &end ); VectorSubtract( end, start, m_Delta ); m_pWorldAxisTransform = NULL; diff --git a/public/networkvar.h b/public/networkvar.h index d4ad1a14e..8a68654ca 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -18,8 +18,9 @@ #include "basehandle.h" #endif - +#ifdef _MSC_VER #pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) +#endif #ifdef GNUC #pragma GCC diagnostic ignored "-Winvalid-offsetof" diff --git a/public/studio.h b/public/studio.h index b318f40b4..665e95584 100644 --- a/public/studio.h +++ b/public/studio.h @@ -2716,7 +2716,7 @@ class CStudioHdr // ctor CActivityToSequenceMapping( void ) - : m_pSequenceTuples(NULL), m_iSequenceTuplesCount(0), m_ActToSeqHash(8,0,0), m_expectedVModel(NULL), m_pStudioHdr(NULL) + : m_pSequenceTuples(NULL), m_iSequenceTuplesCount(0), m_ActToSeqHash(8,0,0), m_pStudioHdr(NULL), m_expectedVModel(NULL) {}; // dtor -- not virtual because this class has no inheritors diff --git a/public/tier1/utlmemory.h b/public/tier1/utlmemory.h index aac299e26..a667f40a6 100644 --- a/public/tier1/utlmemory.h +++ b/public/tier1/utlmemory.h @@ -17,6 +17,7 @@ #include "tier0/dbg.h" #include #include "tier0/platform.h" +#include "mathlib/mathlib.h" #include "tier0/memalloc.h" #include "tier0/memdbgon.h" diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index 58e6ea0ac..53df41aaf 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -256,9 +256,11 @@ class CUtlVectorConservative : public CUtlVector< T, CUtlMemoryConservative > // Especialy useful if you have a lot of vectors that are sparse, or if you're // carefully packing holders of vectors //----------------------------------------------------------------------------- +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4200) // warning C4200: nonstandard extension used : zero-sized array in struct/union #pragma warning(disable : 4815 ) // warning C4815: 'staticData' : zero-sized array in stack object will have no elements +#endif class CUtlVectorUltraConservativeAllocator { @@ -496,7 +498,9 @@ class CUtlVectorUltraConservative : private A } }; +#ifdef _MSC_VER #pragma warning(pop) +#endif //----------------------------------------------------------------------------- // The CCopyableUtlVector class: From 614f0806053ebf59190be384c7a111b9531b1e5c Mon Sep 17 00:00:00 2001 From: arthurdead Date: Tue, 6 Apr 2021 14:25:43 -0300 Subject: [PATCH 19/24] remove files added by mistake --- common/crypto.cpp | 2219 ---- common/crypto.h | 281 - common/simplebitstring.cpp | 234 - common/simplebitstring.h | 159 - external/crypto++-5.6.3/3way.cpp | 143 - external/crypto++-5.6.3/3way.h | 69 - external/crypto++-5.6.3/Doxyfile | 2373 ---- external/crypto++-5.6.3/Filelist.txt | 393 - external/crypto++-5.6.3/GNUmakefile | 575 - external/crypto++-5.6.3/GNUmakefile-cross | 186 - external/crypto++-5.6.3/Install.txt | 169 - external/crypto++-5.6.3/License.txt | 51 - external/crypto++-5.6.3/Readme.txt | 499 - external/crypto++-5.6.3/TestData/3desval.dat | 3 - external/crypto++-5.6.3/TestData/3wayval.dat | 5 - external/crypto++-5.6.3/TestData/camellia.dat | 45 - external/crypto++-5.6.3/TestData/cast128v.dat | 11 - external/crypto++-5.6.3/TestData/cast256v.dat | 11 - external/crypto++-5.6.3/TestData/descert.dat | 171 - external/crypto++-5.6.3/TestData/dh1024.dat | 1 - external/crypto++-5.6.3/TestData/dh2048.dat | 1 - external/crypto++-5.6.3/TestData/dlie1024.dat | 1 - external/crypto++-5.6.3/TestData/dlie2048.dat | 1 - external/crypto++-5.6.3/TestData/dsa1024.dat | 1 - external/crypto++-5.6.3/TestData/dsa1024b.dat | 1 - external/crypto++-5.6.3/TestData/dsa512.dat | 1 - external/crypto++-5.6.3/TestData/elgc1024.dat | 1 - external/crypto++-5.6.3/TestData/esig1023.dat | 1 - external/crypto++-5.6.3/TestData/esig1536.dat | 1 - external/crypto++-5.6.3/TestData/esig2046.dat | 1 - external/crypto++-5.6.3/TestData/gostval.dat | 23 - external/crypto++-5.6.3/TestData/ideaval.dat | 11 - external/crypto++-5.6.3/TestData/luc1024.dat | 1 - external/crypto++-5.6.3/TestData/luc2048.dat | 1 - external/crypto++-5.6.3/TestData/lucc1024.dat | 1 - external/crypto++-5.6.3/TestData/lucc512.dat | 1 - external/crypto++-5.6.3/TestData/lucd1024.dat | 4 - external/crypto++-5.6.3/TestData/lucd512.dat | 2 - external/crypto++-5.6.3/TestData/lucs1024.dat | 1 - external/crypto++-5.6.3/TestData/lucs512.dat | 1 - external/crypto++-5.6.3/TestData/marsval.dat | 9 - external/crypto++-5.6.3/TestData/mqv1024.dat | 1 - external/crypto++-5.6.3/TestData/mqv2048.dat | 1 - external/crypto++-5.6.3/TestData/nr1024.dat | 1 - external/crypto++-5.6.3/TestData/nr2048.dat | 1 - external/crypto++-5.6.3/TestData/rabi1024.dat | 1 - external/crypto++-5.6.3/TestData/rabi2048.dat | 1 - external/crypto++-5.6.3/TestData/rc2val.dat | 48 - external/crypto++-5.6.3/TestData/rc5val.dat | 5 - external/crypto++-5.6.3/TestData/rc6val.dat | 17 - external/crypto++-5.6.3/TestData/rijndael.dat | 9 - external/crypto++-5.6.3/TestData/rsa1024.dat | 32 - external/crypto++-5.6.3/TestData/rsa2048.dat | 61 - external/crypto++-5.6.3/TestData/rsa400pb.dat | 10 - external/crypto++-5.6.3/TestData/rsa400pv.dat | 41 - external/crypto++-5.6.3/TestData/rsa512a.dat | 35 - external/crypto++-5.6.3/TestData/rw1024.dat | 1 - external/crypto++-5.6.3/TestData/rw2048.dat | 1 - external/crypto++-5.6.3/TestData/saferval.dat | 16 - external/crypto++-5.6.3/TestData/serpentv.dat | 12 - external/crypto++-5.6.3/TestData/shacal2v.dat | 14 - external/crypto++-5.6.3/TestData/sharkval.dat | 7 - external/crypto++-5.6.3/TestData/skipjack.dat | 1 - external/crypto++-5.6.3/TestData/squareva.dat | 8 - external/crypto++-5.6.3/TestData/twofishv.dat | 9 - external/crypto++-5.6.3/TestData/usage.dat | 81 - external/crypto++-5.6.3/TestData/xtrdh171.dat | 3 - external/crypto++-5.6.3/TestData/xtrdh342.dat | 5 - .../crypto++-5.6.3/TestVectors/Readme.txt | 76 - external/crypto++-5.6.3/TestVectors/aes.txt | 241 - external/crypto++-5.6.3/TestVectors/all.txt | 32 - .../crypto++-5.6.3/TestVectors/camellia.txt | 8646 --------------- external/crypto++-5.6.3/TestVectors/ccm.txt | 240 - external/crypto++-5.6.3/TestVectors/cmac.txt | 38 - external/crypto++-5.6.3/TestVectors/dlies.txt | 542 - external/crypto++-5.6.3/TestVectors/dsa.txt | 397 - .../crypto++-5.6.3/TestVectors/dsa_1363.txt | 553 - external/crypto++-5.6.3/TestVectors/eax.txt | 75 - external/crypto++-5.6.3/TestVectors/esign.txt | 93 - external/crypto++-5.6.3/TestVectors/gcm.txt | 168 - external/crypto++-5.6.3/TestVectors/hkdf.txt | 175 - external/crypto++-5.6.3/TestVectors/hmac.txt | 281 - external/crypto++-5.6.3/TestVectors/mars.txt | 66 - external/crypto++-5.6.3/TestVectors/nr.txt | 615 -- .../crypto++-5.6.3/TestVectors/panama.txt | 76 - .../crypto++-5.6.3/TestVectors/rsa_oaep.txt | 1765 --- .../TestVectors/rsa_pkcs1_1_5.txt | 89 - .../crypto++-5.6.3/TestVectors/rsa_pss.txt | 2083 ---- external/crypto++-5.6.3/TestVectors/rw.txt | 166 - external/crypto++-5.6.3/TestVectors/salsa.txt | 463 - external/crypto++-5.6.3/TestVectors/seal.txt | 137 - external/crypto++-5.6.3/TestVectors/seed.txt | 19 - external/crypto++-5.6.3/TestVectors/sha.txt | 59 - external/crypto++-5.6.3/TestVectors/sha3.txt | 861 -- .../crypto++-5.6.3/TestVectors/shacal2.txt | 5123 --------- .../crypto++-5.6.3/TestVectors/sosemanuk.txt | 25 - external/crypto++-5.6.3/TestVectors/tea.txt | 711 -- external/crypto++-5.6.3/TestVectors/ttmac.txt | 40 - external/crypto++-5.6.3/TestVectors/vmac.txt | 77 - external/crypto++-5.6.3/TestVectors/wake.txt | 10 - .../crypto++-5.6.3/TestVectors/whrlpool.txt | 39 - external/crypto++-5.6.3/adhoc.cpp.proto | 23 - external/crypto++-5.6.3/adler32.cpp | 82 - external/crypto++-5.6.3/adler32.h | 34 - external/crypto++-5.6.3/aes.h | 21 - external/crypto++-5.6.3/algebra.cpp | 341 - external/crypto++-5.6.3/algebra.h | 295 - external/crypto++-5.6.3/algparam.cpp | 77 - external/crypto++-5.6.3/algparam.h | 511 - external/crypto++-5.6.3/arc4.cpp | 122 - external/crypto++-5.6.3/arc4.h | 83 - external/crypto++-5.6.3/argnames.h | 88 - external/crypto++-5.6.3/asn.cpp | 606 -- external/crypto++-5.6.3/asn.h | 389 - external/crypto++-5.6.3/authenc.cpp | 180 - external/crypto++-5.6.3/authenc.h | 57 - external/crypto++-5.6.3/base32.cpp | 39 - external/crypto++-5.6.3/base32.h | 70 - external/crypto++-5.6.3/base64.cpp | 76 - external/crypto++-5.6.3/base64.h | 135 - external/crypto++-5.6.3/basecode.cpp | 247 - external/crypto++-5.6.3/basecode.h | 142 - external/crypto++-5.6.3/bench.cpp | 399 - external/crypto++-5.6.3/bench.h | 13 - external/crypto++-5.6.3/bench2.cpp | 337 - external/crypto++-5.6.3/bfinit.cpp | 277 - external/crypto++-5.6.3/blowfish.cpp | 99 - external/crypto++-5.6.3/blowfish.h | 56 - external/crypto++-5.6.3/blumshub.cpp | 64 - external/crypto++-5.6.3/blumshub.h | 63 - external/crypto++-5.6.3/build.sh | 10 - external/crypto++-5.6.3/camellia.cpp | 532 - external/crypto++-5.6.3/camellia.h | 48 - external/crypto++-5.6.3/cast.cpp | 296 - external/crypto++-5.6.3/cast.h | 93 - external/crypto++-5.6.3/casts.cpp | 545 - external/crypto++-5.6.3/cbcmac.cpp | 62 - external/crypto++-5.6.3/cbcmac.h | 56 - external/crypto++-5.6.3/ccm.cpp | 140 - external/crypto++-5.6.3/ccm.h | 106 - external/crypto++-5.6.3/channels.cpp | 312 - external/crypto++-5.6.3/channels.h | 134 - external/crypto++-5.6.3/clean-vs.cmd | 48 - external/crypto++-5.6.3/cmac.cpp | 126 - external/crypto++-5.6.3/cmac.h | 58 - external/crypto++-5.6.3/config.h | 715 -- external/crypto++-5.6.3/config.recommend | 708 -- external/crypto++-5.6.3/cpu.cpp | 268 - external/crypto++-5.6.3/cpu.h | 413 - external/crypto++-5.6.3/crc.cpp | 160 - external/crypto++-5.6.3/crc.h | 48 - external/crypto++-5.6.3/cryptdll.dsp | 606 -- external/crypto++-5.6.3/cryptdll.vcproj | 2639 ----- external/crypto++-5.6.3/cryptest.dsp | 207 - external/crypto++-5.6.3/cryptest.dsw | 74 - external/crypto++-5.6.3/cryptest.sh | 839 -- external/crypto++-5.6.3/cryptest.vcproj | 1711 --- external/crypto++-5.6.3/cryptest_bds.bdsgroup | 22 - external/crypto++-5.6.3/cryptest_bds.bdsproj | 267 - external/crypto++-5.6.3/cryptest_bds.bpf | 5 - external/crypto++-5.6.3/cryptlib.cpp | 949 -- external/crypto++-5.6.3/cryptlib.dsp | 1216 --- external/crypto++-5.6.3/cryptlib.h | 2667 ----- external/crypto++-5.6.3/cryptlib.vcproj | 9653 ----------------- external/crypto++-5.6.3/cryptlib_bds.bdsproj | 378 - external/crypto++-5.6.3/cryptlib_bds.cpp | 10 - .../crypto++-5.6.3/cryptodisablewarnings.h | 30 - .../crypto++-5.6.3/cryptopopdisablewarnings.h | 9 - external/crypto++-5.6.3/cryptopp.rc | 104 - external/crypto++-5.6.3/cryptopp563.diff | 0 .../cryptopushdisablewarnings.h | 11 - external/crypto++-5.6.3/datatest.cpp | 813 -- external/crypto++-5.6.3/default.cpp | 273 - external/crypto++-5.6.3/default.h | 201 - external/crypto++-5.6.3/des.cpp | 453 - external/crypto++-5.6.3/des.h | 146 - external/crypto++-5.6.3/dessp.cpp | 95 - external/crypto++-5.6.3/dh.cpp | 21 - external/crypto++-5.6.3/dh.h | 107 - external/crypto++-5.6.3/dh2.cpp | 24 - external/crypto++-5.6.3/dh2.h | 65 - external/crypto++-5.6.3/dll.cpp | 160 - external/crypto++-5.6.3/dll.h | 77 - external/crypto++-5.6.3/dlltest.cpp | 207 - external/crypto++-5.6.3/dlltest.dsp | 90 - external/crypto++-5.6.3/dlltest.vcproj | 346 - external/crypto++-5.6.3/dmac.h | 99 - external/crypto++-5.6.3/dsa.cpp | 66 - external/crypto++-5.6.3/dsa.h | 41 - external/crypto++-5.6.3/eax.cpp | 59 - external/crypto++-5.6.3/eax.h | 112 - external/crypto++-5.6.3/ec2n.cpp | 294 - external/crypto++-5.6.3/ec2n.h | 134 - external/crypto++-5.6.3/eccrypto.cpp | 719 -- external/crypto++-5.6.3/eccrypto.h | 671 -- external/crypto++-5.6.3/ecp.cpp | 476 - external/crypto++-5.6.3/ecp.h | 145 - external/crypto++-5.6.3/elgamal.cpp | 19 - external/crypto++-5.6.3/elgamal.h | 144 - external/crypto++-5.6.3/emsa2.cpp | 35 - external/crypto++-5.6.3/emsa2.h | 88 - external/crypto++-5.6.3/eprecomp.cpp | 113 - external/crypto++-5.6.3/eprecomp.h | 93 - external/crypto++-5.6.3/esign.cpp | 221 - external/crypto++-5.6.3/esign.h | 133 - external/crypto++-5.6.3/factory.h | 139 - external/crypto++-5.6.3/files.cpp | 258 - external/crypto++-5.6.3/files.h | 113 - external/crypto++-5.6.3/filters.cpp | 1168 -- external/crypto++-5.6.3/filters.h | 979 -- external/crypto++-5.6.3/fips140.cpp | 88 - external/crypto++-5.6.3/fips140.h | 113 - external/crypto++-5.6.3/fipsalgt.cpp | 1294 --- external/crypto++-5.6.3/fipstest.cpp | 615 -- external/crypto++-5.6.3/fltrimpl.h | 85 - external/crypto++-5.6.3/gcm.cpp | 864 -- external/crypto++-5.6.3/gcm.h | 127 - external/crypto++-5.6.3/gf256.cpp | 34 - external/crypto++-5.6.3/gf256.h | 67 - external/crypto++-5.6.3/gf2_32.cpp | 99 - external/crypto++-5.6.3/gf2_32.h | 68 - external/crypto++-5.6.3/gf2n.cpp | 903 -- external/crypto++-5.6.3/gf2n.h | 370 - external/crypto++-5.6.3/gfpcrypt.cpp | 306 - external/crypto++-5.6.3/gfpcrypt.h | 636 -- external/crypto++-5.6.3/gost.cpp | 123 - external/crypto++-5.6.3/gost.h | 60 - external/crypto++-5.6.3/gzip.cpp | 99 - external/crypto++-5.6.3/gzip.h | 74 - external/crypto++-5.6.3/hex.cpp | 44 - external/crypto++-5.6.3/hex.h | 42 - external/crypto++-5.6.3/hkdf.h | 100 - external/crypto++-5.6.3/hmac.cpp | 86 - external/crypto++-5.6.3/hmac.h | 64 - external/crypto++-5.6.3/hrtimer.cpp | 142 - external/crypto++-5.6.3/hrtimer.h | 63 - external/crypto++-5.6.3/ida.cpp | 423 - external/crypto++-5.6.3/ida.h | 161 - external/crypto++-5.6.3/idea.cpp | 193 - external/crypto++-5.6.3/idea.h | 63 - external/crypto++-5.6.3/integer.cpp | 4404 -------- external/crypto++-5.6.3/integer.h | 570 - external/crypto++-5.6.3/iterhash.cpp | 162 - external/crypto++-5.6.3/iterhash.h | 106 - external/crypto++-5.6.3/lubyrack.h | 142 - external/crypto++-5.6.3/luc.cpp | 215 - external/crypto++-5.6.3/luc.h | 305 - external/crypto++-5.6.3/mars.cpp | 154 - external/crypto++-5.6.3/mars.h | 56 - external/crypto++-5.6.3/marss.cpp | 140 - external/crypto++-5.6.3/md2.cpp | 120 - external/crypto++-5.6.3/md2.h | 46 - external/crypto++-5.6.3/md4.cpp | 110 - external/crypto++-5.6.3/md4.h | 35 - external/crypto++-5.6.3/md5.cpp | 120 - external/crypto++-5.6.3/md5.h | 33 - external/crypto++-5.6.3/mdc.h | 73 - external/crypto++-5.6.3/mersenne.h | 193 - external/crypto++-5.6.3/misc.cpp | 210 - external/crypto++-5.6.3/misc.h | 2116 ---- external/crypto++-5.6.3/modarith.h | 177 - external/crypto++-5.6.3/modes.cpp | 280 - external/crypto++-5.6.3/modes.h | 459 - external/crypto++-5.6.3/modexppc.h | 36 - external/crypto++-5.6.3/mqueue.cpp | 174 - external/crypto++-5.6.3/mqueue.h | 105 - external/crypto++-5.6.3/mqv.cpp | 15 - external/crypto++-5.6.3/mqv.h | 155 - external/crypto++-5.6.3/nbtheory.cpp | 1125 -- external/crypto++-5.6.3/nbtheory.h | 173 - external/crypto++-5.6.3/network.cpp | 553 - external/crypto++-5.6.3/network.h | 235 - external/crypto++-5.6.3/nr.h | 6 - external/crypto++-5.6.3/oaep.cpp | 98 - external/crypto++-5.6.3/oaep.h | 43 - external/crypto++-5.6.3/oids.h | 129 - external/crypto++-5.6.3/osrng.cpp | 202 - external/crypto++-5.6.3/osrng.h | 256 - external/crypto++-5.6.3/panama.cpp | 518 - external/crypto++-5.6.3/panama.h | 154 - external/crypto++-5.6.3/pch.cpp | 1 - external/crypto++-5.6.3/pch.h | 24 - external/crypto++-5.6.3/pkcspad.cpp | 129 - external/crypto++-5.6.3/pkcspad.h | 99 - external/crypto++-5.6.3/polynomi.cpp | 577 - external/crypto++-5.6.3/polynomi.h | 467 - external/crypto++-5.6.3/pssr.cpp | 161 - external/crypto++-5.6.3/pssr.h | 73 - external/crypto++-5.6.3/pubkey.cpp | 170 - external/crypto++-5.6.3/pubkey.h | 1968 ---- external/crypto++-5.6.3/pwdbased.h | 227 - external/crypto++-5.6.3/queue.cpp | 574 - external/crypto++-5.6.3/queue.h | 149 - external/crypto++-5.6.3/rabin.cpp | 222 - external/crypto++-5.6.3/rabin.h | 111 - external/crypto++-5.6.3/randpool.cpp | 74 - external/crypto++-5.6.3/randpool.h | 36 - external/crypto++-5.6.3/rc2.cpp | 118 - external/crypto++-5.6.3/rc2.h | 95 - external/crypto++-5.6.3/rc5.cpp | 80 - external/crypto++-5.6.3/rc5.h | 56 - external/crypto++-5.6.3/rc6.cpp | 97 - external/crypto++-5.6.3/rc6.h | 56 - external/crypto++-5.6.3/rdrand-masm.cmd | 117 - external/crypto++-5.6.3/rdrand-nasm.sh | 24 - external/crypto++-5.6.3/rdrand.S | 596 - external/crypto++-5.6.3/rdrand.asm | 557 - external/crypto++-5.6.3/rdrand.cpp | 515 - external/crypto++-5.6.3/rdrand.h | 186 - external/crypto++-5.6.3/rdtables.cpp | 172 - external/crypto++-5.6.3/regtest.cpp | 166 - external/crypto++-5.6.3/resource.h | 15 - external/crypto++-5.6.3/rijndael.cpp | 1277 --- external/crypto++-5.6.3/rijndael.h | 83 - external/crypto++-5.6.3/ripemd.cpp | 803 -- external/crypto++-5.6.3/ripemd.h | 54 - external/crypto++-5.6.3/rng.cpp | 155 - external/crypto++-5.6.3/rng.h | 110 - external/crypto++-5.6.3/rsa.cpp | 308 - external/crypto++-5.6.3/rsa.h | 178 - external/crypto++-5.6.3/rw.cpp | 204 - external/crypto++-5.6.3/rw.h | 106 - external/crypto++-5.6.3/safer.cpp | 157 - external/crypto++-5.6.3/safer.h | 88 - external/crypto++-5.6.3/salsa.cpp | 625 -- external/crypto++-5.6.3/salsa.h | 84 - external/crypto++-5.6.3/seal.cpp | 219 - external/crypto++-5.6.3/seal.h | 50 - external/crypto++-5.6.3/secblock.h | 804 -- external/crypto++-5.6.3/seckey.h | 428 - external/crypto++-5.6.3/seed.cpp | 104 - external/crypto++-5.6.3/seed.h | 40 - external/crypto++-5.6.3/serpent.cpp | 125 - external/crypto++-5.6.3/serpent.h | 54 - external/crypto++-5.6.3/serpentp.h | 434 - external/crypto++-5.6.3/sha.cpp | 925 -- external/crypto++-5.6.3/sha.h | 70 - external/crypto++-5.6.3/sha3.cpp | 290 - external/crypto++-5.6.3/sha3.h | 69 - external/crypto++-5.6.3/shacal2.cpp | 140 - external/crypto++-5.6.3/shacal2.h | 56 - external/crypto++-5.6.3/shark.cpp | 140 - external/crypto++-5.6.3/shark.h | 67 - external/crypto++-5.6.3/sharkbox.cpp | 4166 ------- external/crypto++-5.6.3/simple.cpp | 13 - external/crypto++-5.6.3/simple.h | 289 - external/crypto++-5.6.3/skipjack.cpp | 202 - external/crypto++-5.6.3/skipjack.h | 63 - external/crypto++-5.6.3/smartptr.h | 321 - external/crypto++-5.6.3/socketft.cpp | 546 - external/crypto++-5.6.3/socketft.h | 223 - external/crypto++-5.6.3/sosemanuk.cpp | 717 -- external/crypto++-5.6.3/sosemanuk.h | 52 - external/crypto++-5.6.3/square.cpp | 187 - external/crypto++-5.6.3/square.h | 60 - external/crypto++-5.6.3/squaretb.cpp | 582 - external/crypto++-5.6.3/stdcpp.h | 55 - external/crypto++-5.6.3/strciphr.cpp | 252 - external/crypto++-5.6.3/strciphr.h | 325 - external/crypto++-5.6.3/tea.cpp | 161 - external/crypto++-5.6.3/tea.h | 136 - external/crypto++-5.6.3/test.cpp | 963 -- external/crypto++-5.6.3/tftables.cpp | 323 - external/crypto++-5.6.3/tiger.cpp | 276 - external/crypto++-5.6.3/tiger.h | 24 - external/crypto++-5.6.3/tigertab.cpp | 525 - external/crypto++-5.6.3/trdlocal.cpp | 104 - external/crypto++-5.6.3/trdlocal.h | 44 - external/crypto++-5.6.3/trunhash.h | 52 - external/crypto++-5.6.3/ttmac.cpp | 338 - external/crypto++-5.6.3/ttmac.h | 39 - external/crypto++-5.6.3/twofish.cpp | 169 - external/crypto++-5.6.3/twofish.h | 61 - external/crypto++-5.6.3/validat1.cpp | 1639 --- external/crypto++-5.6.3/validat2.cpp | 852 -- external/crypto++-5.6.3/validat3.cpp | 741 -- external/crypto++-5.6.3/validate.h | 100 - external/crypto++-5.6.3/vmac.cpp | 910 -- external/crypto++-5.6.3/vmac.h | 86 - external/crypto++-5.6.3/vs2010.zip | Bin 19917 -> 0 bytes external/crypto++-5.6.3/wait.cpp | 435 - external/crypto++-5.6.3/wait.h | 217 - external/crypto++-5.6.3/wake.cpp | 114 - external/crypto++-5.6.3/wake.h | 68 - external/crypto++-5.6.3/whrlpool.cpp | 723 -- external/crypto++-5.6.3/whrlpool.h | 21 - external/crypto++-5.6.3/winpipes.cpp | 206 - external/crypto++-5.6.3/winpipes.h | 143 - external/crypto++-5.6.3/words.h | 108 - external/crypto++-5.6.3/x64dll.asm | 1968 ---- external/crypto++-5.6.3/x64masm.asm | 1565 --- external/crypto++-5.6.3/xtr.cpp | 102 - external/crypto++-5.6.3/xtr.h | 217 - external/crypto++-5.6.3/xtrcrypt.cpp | 112 - external/crypto++-5.6.3/xtrcrypt.h | 56 - external/crypto++-5.6.3/zdeflate.cpp | 815 -- external/crypto++-5.6.3/zdeflate.h | 132 - external/crypto++-5.6.3/zinflate.cpp | 637 -- external/crypto++-5.6.3/zinflate.h | 153 - external/crypto++-5.6.3/zlib.cpp | 93 - external/crypto++-5.6.3/zlib.h | 60 - 401 files changed, 133973 deletions(-) delete mode 100644 common/crypto.cpp delete mode 100644 common/crypto.h delete mode 100644 common/simplebitstring.cpp delete mode 100644 common/simplebitstring.h delete mode 100644 external/crypto++-5.6.3/3way.cpp delete mode 100644 external/crypto++-5.6.3/3way.h delete mode 100644 external/crypto++-5.6.3/Doxyfile delete mode 100644 external/crypto++-5.6.3/Filelist.txt delete mode 100644 external/crypto++-5.6.3/GNUmakefile delete mode 100644 external/crypto++-5.6.3/GNUmakefile-cross delete mode 100644 external/crypto++-5.6.3/Install.txt delete mode 100644 external/crypto++-5.6.3/License.txt delete mode 100644 external/crypto++-5.6.3/Readme.txt delete mode 100644 external/crypto++-5.6.3/TestData/3desval.dat delete mode 100644 external/crypto++-5.6.3/TestData/3wayval.dat delete mode 100644 external/crypto++-5.6.3/TestData/camellia.dat delete mode 100644 external/crypto++-5.6.3/TestData/cast128v.dat delete mode 100644 external/crypto++-5.6.3/TestData/cast256v.dat delete mode 100644 external/crypto++-5.6.3/TestData/descert.dat delete mode 100644 external/crypto++-5.6.3/TestData/dh1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/dh2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/dlie1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/dlie2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/dsa1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/dsa1024b.dat delete mode 100644 external/crypto++-5.6.3/TestData/dsa512.dat delete mode 100644 external/crypto++-5.6.3/TestData/elgc1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/esig1023.dat delete mode 100644 external/crypto++-5.6.3/TestData/esig1536.dat delete mode 100644 external/crypto++-5.6.3/TestData/esig2046.dat delete mode 100644 external/crypto++-5.6.3/TestData/gostval.dat delete mode 100644 external/crypto++-5.6.3/TestData/ideaval.dat delete mode 100644 external/crypto++-5.6.3/TestData/luc1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/luc2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/lucc1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/lucc512.dat delete mode 100644 external/crypto++-5.6.3/TestData/lucd1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/lucd512.dat delete mode 100644 external/crypto++-5.6.3/TestData/lucs1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/lucs512.dat delete mode 100644 external/crypto++-5.6.3/TestData/marsval.dat delete mode 100644 external/crypto++-5.6.3/TestData/mqv1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/mqv2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/nr1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/nr2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/rabi1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/rabi2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/rc2val.dat delete mode 100644 external/crypto++-5.6.3/TestData/rc5val.dat delete mode 100644 external/crypto++-5.6.3/TestData/rc6val.dat delete mode 100644 external/crypto++-5.6.3/TestData/rijndael.dat delete mode 100644 external/crypto++-5.6.3/TestData/rsa1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/rsa2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/rsa400pb.dat delete mode 100644 external/crypto++-5.6.3/TestData/rsa400pv.dat delete mode 100644 external/crypto++-5.6.3/TestData/rsa512a.dat delete mode 100644 external/crypto++-5.6.3/TestData/rw1024.dat delete mode 100644 external/crypto++-5.6.3/TestData/rw2048.dat delete mode 100644 external/crypto++-5.6.3/TestData/saferval.dat delete mode 100644 external/crypto++-5.6.3/TestData/serpentv.dat delete mode 100644 external/crypto++-5.6.3/TestData/shacal2v.dat delete mode 100644 external/crypto++-5.6.3/TestData/sharkval.dat delete mode 100644 external/crypto++-5.6.3/TestData/skipjack.dat delete mode 100644 external/crypto++-5.6.3/TestData/squareva.dat delete mode 100644 external/crypto++-5.6.3/TestData/twofishv.dat delete mode 100644 external/crypto++-5.6.3/TestData/usage.dat delete mode 100644 external/crypto++-5.6.3/TestData/xtrdh171.dat delete mode 100644 external/crypto++-5.6.3/TestData/xtrdh342.dat delete mode 100644 external/crypto++-5.6.3/TestVectors/Readme.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/aes.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/all.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/camellia.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/ccm.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/cmac.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/dlies.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/dsa.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/dsa_1363.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/eax.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/esign.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/gcm.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/hkdf.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/hmac.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/mars.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/nr.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/panama.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/rsa_oaep.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/rsa_pss.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/rw.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/salsa.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/seal.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/seed.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/sha.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/sha3.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/shacal2.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/sosemanuk.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/tea.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/ttmac.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/vmac.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/wake.txt delete mode 100644 external/crypto++-5.6.3/TestVectors/whrlpool.txt delete mode 100644 external/crypto++-5.6.3/adhoc.cpp.proto delete mode 100644 external/crypto++-5.6.3/adler32.cpp delete mode 100644 external/crypto++-5.6.3/adler32.h delete mode 100644 external/crypto++-5.6.3/aes.h delete mode 100644 external/crypto++-5.6.3/algebra.cpp delete mode 100644 external/crypto++-5.6.3/algebra.h delete mode 100644 external/crypto++-5.6.3/algparam.cpp delete mode 100644 external/crypto++-5.6.3/algparam.h delete mode 100644 external/crypto++-5.6.3/arc4.cpp delete mode 100644 external/crypto++-5.6.3/arc4.h delete mode 100644 external/crypto++-5.6.3/argnames.h delete mode 100644 external/crypto++-5.6.3/asn.cpp delete mode 100644 external/crypto++-5.6.3/asn.h delete mode 100644 external/crypto++-5.6.3/authenc.cpp delete mode 100644 external/crypto++-5.6.3/authenc.h delete mode 100644 external/crypto++-5.6.3/base32.cpp delete mode 100644 external/crypto++-5.6.3/base32.h delete mode 100644 external/crypto++-5.6.3/base64.cpp delete mode 100644 external/crypto++-5.6.3/base64.h delete mode 100644 external/crypto++-5.6.3/basecode.cpp delete mode 100644 external/crypto++-5.6.3/basecode.h delete mode 100644 external/crypto++-5.6.3/bench.cpp delete mode 100644 external/crypto++-5.6.3/bench.h delete mode 100644 external/crypto++-5.6.3/bench2.cpp delete mode 100644 external/crypto++-5.6.3/bfinit.cpp delete mode 100644 external/crypto++-5.6.3/blowfish.cpp delete mode 100644 external/crypto++-5.6.3/blowfish.h delete mode 100644 external/crypto++-5.6.3/blumshub.cpp delete mode 100644 external/crypto++-5.6.3/blumshub.h delete mode 100644 external/crypto++-5.6.3/build.sh delete mode 100644 external/crypto++-5.6.3/camellia.cpp delete mode 100644 external/crypto++-5.6.3/camellia.h delete mode 100644 external/crypto++-5.6.3/cast.cpp delete mode 100644 external/crypto++-5.6.3/cast.h delete mode 100644 external/crypto++-5.6.3/casts.cpp delete mode 100644 external/crypto++-5.6.3/cbcmac.cpp delete mode 100644 external/crypto++-5.6.3/cbcmac.h delete mode 100644 external/crypto++-5.6.3/ccm.cpp delete mode 100644 external/crypto++-5.6.3/ccm.h delete mode 100644 external/crypto++-5.6.3/channels.cpp delete mode 100644 external/crypto++-5.6.3/channels.h delete mode 100644 external/crypto++-5.6.3/clean-vs.cmd delete mode 100644 external/crypto++-5.6.3/cmac.cpp delete mode 100644 external/crypto++-5.6.3/cmac.h delete mode 100644 external/crypto++-5.6.3/config.h delete mode 100644 external/crypto++-5.6.3/config.recommend delete mode 100644 external/crypto++-5.6.3/cpu.cpp delete mode 100644 external/crypto++-5.6.3/cpu.h delete mode 100644 external/crypto++-5.6.3/crc.cpp delete mode 100644 external/crypto++-5.6.3/crc.h delete mode 100644 external/crypto++-5.6.3/cryptdll.dsp delete mode 100644 external/crypto++-5.6.3/cryptdll.vcproj delete mode 100644 external/crypto++-5.6.3/cryptest.dsp delete mode 100644 external/crypto++-5.6.3/cryptest.dsw delete mode 100644 external/crypto++-5.6.3/cryptest.sh delete mode 100644 external/crypto++-5.6.3/cryptest.vcproj delete mode 100644 external/crypto++-5.6.3/cryptest_bds.bdsgroup delete mode 100644 external/crypto++-5.6.3/cryptest_bds.bdsproj delete mode 100644 external/crypto++-5.6.3/cryptest_bds.bpf delete mode 100644 external/crypto++-5.6.3/cryptlib.cpp delete mode 100644 external/crypto++-5.6.3/cryptlib.dsp delete mode 100644 external/crypto++-5.6.3/cryptlib.h delete mode 100644 external/crypto++-5.6.3/cryptlib.vcproj delete mode 100644 external/crypto++-5.6.3/cryptlib_bds.bdsproj delete mode 100644 external/crypto++-5.6.3/cryptlib_bds.cpp delete mode 100644 external/crypto++-5.6.3/cryptodisablewarnings.h delete mode 100644 external/crypto++-5.6.3/cryptopopdisablewarnings.h delete mode 100644 external/crypto++-5.6.3/cryptopp.rc delete mode 100644 external/crypto++-5.6.3/cryptopp563.diff delete mode 100644 external/crypto++-5.6.3/cryptopushdisablewarnings.h delete mode 100644 external/crypto++-5.6.3/datatest.cpp delete mode 100644 external/crypto++-5.6.3/default.cpp delete mode 100644 external/crypto++-5.6.3/default.h delete mode 100644 external/crypto++-5.6.3/des.cpp delete mode 100644 external/crypto++-5.6.3/des.h delete mode 100644 external/crypto++-5.6.3/dessp.cpp delete mode 100644 external/crypto++-5.6.3/dh.cpp delete mode 100644 external/crypto++-5.6.3/dh.h delete mode 100644 external/crypto++-5.6.3/dh2.cpp delete mode 100644 external/crypto++-5.6.3/dh2.h delete mode 100644 external/crypto++-5.6.3/dll.cpp delete mode 100644 external/crypto++-5.6.3/dll.h delete mode 100644 external/crypto++-5.6.3/dlltest.cpp delete mode 100644 external/crypto++-5.6.3/dlltest.dsp delete mode 100644 external/crypto++-5.6.3/dlltest.vcproj delete mode 100644 external/crypto++-5.6.3/dmac.h delete mode 100644 external/crypto++-5.6.3/dsa.cpp delete mode 100644 external/crypto++-5.6.3/dsa.h delete mode 100644 external/crypto++-5.6.3/eax.cpp delete mode 100644 external/crypto++-5.6.3/eax.h delete mode 100644 external/crypto++-5.6.3/ec2n.cpp delete mode 100644 external/crypto++-5.6.3/ec2n.h delete mode 100644 external/crypto++-5.6.3/eccrypto.cpp delete mode 100644 external/crypto++-5.6.3/eccrypto.h delete mode 100644 external/crypto++-5.6.3/ecp.cpp delete mode 100644 external/crypto++-5.6.3/ecp.h delete mode 100644 external/crypto++-5.6.3/elgamal.cpp delete mode 100644 external/crypto++-5.6.3/elgamal.h delete mode 100644 external/crypto++-5.6.3/emsa2.cpp delete mode 100644 external/crypto++-5.6.3/emsa2.h delete mode 100644 external/crypto++-5.6.3/eprecomp.cpp delete mode 100644 external/crypto++-5.6.3/eprecomp.h delete mode 100644 external/crypto++-5.6.3/esign.cpp delete mode 100644 external/crypto++-5.6.3/esign.h delete mode 100644 external/crypto++-5.6.3/factory.h delete mode 100644 external/crypto++-5.6.3/files.cpp delete mode 100644 external/crypto++-5.6.3/files.h delete mode 100644 external/crypto++-5.6.3/filters.cpp delete mode 100644 external/crypto++-5.6.3/filters.h delete mode 100644 external/crypto++-5.6.3/fips140.cpp delete mode 100644 external/crypto++-5.6.3/fips140.h delete mode 100644 external/crypto++-5.6.3/fipsalgt.cpp delete mode 100644 external/crypto++-5.6.3/fipstest.cpp delete mode 100644 external/crypto++-5.6.3/fltrimpl.h delete mode 100644 external/crypto++-5.6.3/gcm.cpp delete mode 100644 external/crypto++-5.6.3/gcm.h delete mode 100644 external/crypto++-5.6.3/gf256.cpp delete mode 100644 external/crypto++-5.6.3/gf256.h delete mode 100644 external/crypto++-5.6.3/gf2_32.cpp delete mode 100644 external/crypto++-5.6.3/gf2_32.h delete mode 100644 external/crypto++-5.6.3/gf2n.cpp delete mode 100644 external/crypto++-5.6.3/gf2n.h delete mode 100644 external/crypto++-5.6.3/gfpcrypt.cpp delete mode 100644 external/crypto++-5.6.3/gfpcrypt.h delete mode 100644 external/crypto++-5.6.3/gost.cpp delete mode 100644 external/crypto++-5.6.3/gost.h delete mode 100644 external/crypto++-5.6.3/gzip.cpp delete mode 100644 external/crypto++-5.6.3/gzip.h delete mode 100644 external/crypto++-5.6.3/hex.cpp delete mode 100644 external/crypto++-5.6.3/hex.h delete mode 100644 external/crypto++-5.6.3/hkdf.h delete mode 100644 external/crypto++-5.6.3/hmac.cpp delete mode 100644 external/crypto++-5.6.3/hmac.h delete mode 100644 external/crypto++-5.6.3/hrtimer.cpp delete mode 100644 external/crypto++-5.6.3/hrtimer.h delete mode 100644 external/crypto++-5.6.3/ida.cpp delete mode 100644 external/crypto++-5.6.3/ida.h delete mode 100644 external/crypto++-5.6.3/idea.cpp delete mode 100644 external/crypto++-5.6.3/idea.h delete mode 100644 external/crypto++-5.6.3/integer.cpp delete mode 100644 external/crypto++-5.6.3/integer.h delete mode 100644 external/crypto++-5.6.3/iterhash.cpp delete mode 100644 external/crypto++-5.6.3/iterhash.h delete mode 100644 external/crypto++-5.6.3/lubyrack.h delete mode 100644 external/crypto++-5.6.3/luc.cpp delete mode 100644 external/crypto++-5.6.3/luc.h delete mode 100644 external/crypto++-5.6.3/mars.cpp delete mode 100644 external/crypto++-5.6.3/mars.h delete mode 100644 external/crypto++-5.6.3/marss.cpp delete mode 100644 external/crypto++-5.6.3/md2.cpp delete mode 100644 external/crypto++-5.6.3/md2.h delete mode 100644 external/crypto++-5.6.3/md4.cpp delete mode 100644 external/crypto++-5.6.3/md4.h delete mode 100644 external/crypto++-5.6.3/md5.cpp delete mode 100644 external/crypto++-5.6.3/md5.h delete mode 100644 external/crypto++-5.6.3/mdc.h delete mode 100644 external/crypto++-5.6.3/mersenne.h delete mode 100644 external/crypto++-5.6.3/misc.cpp delete mode 100644 external/crypto++-5.6.3/misc.h delete mode 100644 external/crypto++-5.6.3/modarith.h delete mode 100644 external/crypto++-5.6.3/modes.cpp delete mode 100644 external/crypto++-5.6.3/modes.h delete mode 100644 external/crypto++-5.6.3/modexppc.h delete mode 100644 external/crypto++-5.6.3/mqueue.cpp delete mode 100644 external/crypto++-5.6.3/mqueue.h delete mode 100644 external/crypto++-5.6.3/mqv.cpp delete mode 100644 external/crypto++-5.6.3/mqv.h delete mode 100644 external/crypto++-5.6.3/nbtheory.cpp delete mode 100644 external/crypto++-5.6.3/nbtheory.h delete mode 100644 external/crypto++-5.6.3/network.cpp delete mode 100644 external/crypto++-5.6.3/network.h delete mode 100644 external/crypto++-5.6.3/nr.h delete mode 100644 external/crypto++-5.6.3/oaep.cpp delete mode 100644 external/crypto++-5.6.3/oaep.h delete mode 100644 external/crypto++-5.6.3/oids.h delete mode 100644 external/crypto++-5.6.3/osrng.cpp delete mode 100644 external/crypto++-5.6.3/osrng.h delete mode 100644 external/crypto++-5.6.3/panama.cpp delete mode 100644 external/crypto++-5.6.3/panama.h delete mode 100644 external/crypto++-5.6.3/pch.cpp delete mode 100644 external/crypto++-5.6.3/pch.h delete mode 100644 external/crypto++-5.6.3/pkcspad.cpp delete mode 100644 external/crypto++-5.6.3/pkcspad.h delete mode 100644 external/crypto++-5.6.3/polynomi.cpp delete mode 100644 external/crypto++-5.6.3/polynomi.h delete mode 100644 external/crypto++-5.6.3/pssr.cpp delete mode 100644 external/crypto++-5.6.3/pssr.h delete mode 100644 external/crypto++-5.6.3/pubkey.cpp delete mode 100644 external/crypto++-5.6.3/pubkey.h delete mode 100644 external/crypto++-5.6.3/pwdbased.h delete mode 100644 external/crypto++-5.6.3/queue.cpp delete mode 100644 external/crypto++-5.6.3/queue.h delete mode 100644 external/crypto++-5.6.3/rabin.cpp delete mode 100644 external/crypto++-5.6.3/rabin.h delete mode 100644 external/crypto++-5.6.3/randpool.cpp delete mode 100644 external/crypto++-5.6.3/randpool.h delete mode 100644 external/crypto++-5.6.3/rc2.cpp delete mode 100644 external/crypto++-5.6.3/rc2.h delete mode 100644 external/crypto++-5.6.3/rc5.cpp delete mode 100644 external/crypto++-5.6.3/rc5.h delete mode 100644 external/crypto++-5.6.3/rc6.cpp delete mode 100644 external/crypto++-5.6.3/rc6.h delete mode 100644 external/crypto++-5.6.3/rdrand-masm.cmd delete mode 100644 external/crypto++-5.6.3/rdrand-nasm.sh delete mode 100644 external/crypto++-5.6.3/rdrand.S delete mode 100644 external/crypto++-5.6.3/rdrand.asm delete mode 100644 external/crypto++-5.6.3/rdrand.cpp delete mode 100644 external/crypto++-5.6.3/rdrand.h delete mode 100644 external/crypto++-5.6.3/rdtables.cpp delete mode 100644 external/crypto++-5.6.3/regtest.cpp delete mode 100644 external/crypto++-5.6.3/resource.h delete mode 100644 external/crypto++-5.6.3/rijndael.cpp delete mode 100644 external/crypto++-5.6.3/rijndael.h delete mode 100644 external/crypto++-5.6.3/ripemd.cpp delete mode 100644 external/crypto++-5.6.3/ripemd.h delete mode 100644 external/crypto++-5.6.3/rng.cpp delete mode 100644 external/crypto++-5.6.3/rng.h delete mode 100644 external/crypto++-5.6.3/rsa.cpp delete mode 100644 external/crypto++-5.6.3/rsa.h delete mode 100644 external/crypto++-5.6.3/rw.cpp delete mode 100644 external/crypto++-5.6.3/rw.h delete mode 100644 external/crypto++-5.6.3/safer.cpp delete mode 100644 external/crypto++-5.6.3/safer.h delete mode 100644 external/crypto++-5.6.3/salsa.cpp delete mode 100644 external/crypto++-5.6.3/salsa.h delete mode 100644 external/crypto++-5.6.3/seal.cpp delete mode 100644 external/crypto++-5.6.3/seal.h delete mode 100644 external/crypto++-5.6.3/secblock.h delete mode 100644 external/crypto++-5.6.3/seckey.h delete mode 100644 external/crypto++-5.6.3/seed.cpp delete mode 100644 external/crypto++-5.6.3/seed.h delete mode 100644 external/crypto++-5.6.3/serpent.cpp delete mode 100644 external/crypto++-5.6.3/serpent.h delete mode 100644 external/crypto++-5.6.3/serpentp.h delete mode 100644 external/crypto++-5.6.3/sha.cpp delete mode 100644 external/crypto++-5.6.3/sha.h delete mode 100644 external/crypto++-5.6.3/sha3.cpp delete mode 100644 external/crypto++-5.6.3/sha3.h delete mode 100644 external/crypto++-5.6.3/shacal2.cpp delete mode 100644 external/crypto++-5.6.3/shacal2.h delete mode 100644 external/crypto++-5.6.3/shark.cpp delete mode 100644 external/crypto++-5.6.3/shark.h delete mode 100644 external/crypto++-5.6.3/sharkbox.cpp delete mode 100644 external/crypto++-5.6.3/simple.cpp delete mode 100644 external/crypto++-5.6.3/simple.h delete mode 100644 external/crypto++-5.6.3/skipjack.cpp delete mode 100644 external/crypto++-5.6.3/skipjack.h delete mode 100644 external/crypto++-5.6.3/smartptr.h delete mode 100644 external/crypto++-5.6.3/socketft.cpp delete mode 100644 external/crypto++-5.6.3/socketft.h delete mode 100644 external/crypto++-5.6.3/sosemanuk.cpp delete mode 100644 external/crypto++-5.6.3/sosemanuk.h delete mode 100644 external/crypto++-5.6.3/square.cpp delete mode 100644 external/crypto++-5.6.3/square.h delete mode 100644 external/crypto++-5.6.3/squaretb.cpp delete mode 100644 external/crypto++-5.6.3/stdcpp.h delete mode 100644 external/crypto++-5.6.3/strciphr.cpp delete mode 100644 external/crypto++-5.6.3/strciphr.h delete mode 100644 external/crypto++-5.6.3/tea.cpp delete mode 100644 external/crypto++-5.6.3/tea.h delete mode 100644 external/crypto++-5.6.3/test.cpp delete mode 100644 external/crypto++-5.6.3/tftables.cpp delete mode 100644 external/crypto++-5.6.3/tiger.cpp delete mode 100644 external/crypto++-5.6.3/tiger.h delete mode 100644 external/crypto++-5.6.3/tigertab.cpp delete mode 100644 external/crypto++-5.6.3/trdlocal.cpp delete mode 100644 external/crypto++-5.6.3/trdlocal.h delete mode 100644 external/crypto++-5.6.3/trunhash.h delete mode 100644 external/crypto++-5.6.3/ttmac.cpp delete mode 100644 external/crypto++-5.6.3/ttmac.h delete mode 100644 external/crypto++-5.6.3/twofish.cpp delete mode 100644 external/crypto++-5.6.3/twofish.h delete mode 100644 external/crypto++-5.6.3/validat1.cpp delete mode 100644 external/crypto++-5.6.3/validat2.cpp delete mode 100644 external/crypto++-5.6.3/validat3.cpp delete mode 100644 external/crypto++-5.6.3/validate.h delete mode 100644 external/crypto++-5.6.3/vmac.cpp delete mode 100644 external/crypto++-5.6.3/vmac.h delete mode 100644 external/crypto++-5.6.3/vs2010.zip delete mode 100644 external/crypto++-5.6.3/wait.cpp delete mode 100644 external/crypto++-5.6.3/wait.h delete mode 100644 external/crypto++-5.6.3/wake.cpp delete mode 100644 external/crypto++-5.6.3/wake.h delete mode 100644 external/crypto++-5.6.3/whrlpool.cpp delete mode 100644 external/crypto++-5.6.3/whrlpool.h delete mode 100644 external/crypto++-5.6.3/winpipes.cpp delete mode 100644 external/crypto++-5.6.3/winpipes.h delete mode 100644 external/crypto++-5.6.3/words.h delete mode 100644 external/crypto++-5.6.3/x64dll.asm delete mode 100644 external/crypto++-5.6.3/x64masm.asm delete mode 100644 external/crypto++-5.6.3/xtr.cpp delete mode 100644 external/crypto++-5.6.3/xtr.h delete mode 100644 external/crypto++-5.6.3/xtrcrypt.cpp delete mode 100644 external/crypto++-5.6.3/xtrcrypt.h delete mode 100644 external/crypto++-5.6.3/zdeflate.cpp delete mode 100644 external/crypto++-5.6.3/zdeflate.h delete mode 100644 external/crypto++-5.6.3/zinflate.cpp delete mode 100644 external/crypto++-5.6.3/zinflate.h delete mode 100644 external/crypto++-5.6.3/zlib.cpp delete mode 100644 external/crypto++-5.6.3/zlib.h diff --git a/common/crypto.cpp b/common/crypto.cpp deleted file mode 100644 index 8ef69cdf8..000000000 --- a/common/crypto.cpp +++ /dev/null @@ -1,2219 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -// Note: not using precompiled headers. The crypto++ headers create gunk that anyone including them -// has to link to, so they can't be included in the global project file. They also contain -// string functions which are deprecated by the global project file so they can't be included after, either. -// So we can't use the global precompiled header, need to manually include the things we need. - -//#include "winlite.h" - -#ifdef POSIX -#include -#include -#endif - -/* this stuff needs to be before the crypto headers, as it relies on memdbg, which doesn't - do the right thing in the face of xdebug getting included below */ -// tier0 -//#include "tier0/tier0.h" -#include "tier0/basetypes.h" -#include "tier0/vprof.h" -//#include "constants.h" -#include "vstdlib/vstdlib.h" -#include "strtools.h" -//#include "version.h" -//#include "globals.h" -//#include "ivalidate.h" -#include "tier1/utlvector.h" -#include "simplebitstring.h" -#include "tier1/checksum_sha1.h" -#include "tier0/memdbgon.h" -#include "tier0/tslist.h" -#include "tier0/memdbgoff.h" - - -#ifdef ENABLE_OPENSSLCONNECTION -#define USE_OPENSSL_AES_DECRYPT 1 -#endif - -#ifdef USE_OPENSSL_AES_DECRYPT -// openssl optimized AES routines -#include "openssl/aes.h" -#if defined(_M_IX86) || defined (_M_X64) || defined(__i386__) || defined(__x86_64__) -#include -#endif -#endif - -// crypto ++ -#include "tier0/valve_off.h" -#include "../external/crypto++-5.6.3/cryptopushdisablewarnings.h" -#if _MSC_VER < 1400 // doesn't work with vc8, things below need xdebug -#define _XDEBUG_ // keep crypto++-5.2 from including xdebug -// these are defined in xdebug and used in some subsequent headers, define them to be our version -#define _NEW_CRT new -#define _DELETE_CRT(_P) delete (_P) -#define _DELETE_CRT_VEC(_P) delete[] (_P) -#define _STRING_CRT string -#endif -#define CRYPTOPP_DLL -#undef min -#undef max -#undef Verify -#define VPROF_BUDGETGROUP_ENCRYPTION _T("Encryption") -#define SPEW_CRYPTO "crypto" -const int k_cMedBuff = 1024; // medium buffer - -#if defined(GNUC) -#pragma GCC diagnostic ignored "-Wshadow" -#endif - -#include "../external/crypto++-5.6.3/cryptlib.h" -#include "../external/crypto++-5.6.3/osrng.h" -#include "../external/crypto++-5.6.3/crc.h" -#include "../external/crypto++-5.6.3/modes.h" -#include "../external/crypto++-5.6.3/files.h" -#include "../external/crypto++-5.6.3/hex.h" -#include "../external/crypto++-5.6.3/base64.h" -#include "../external/crypto++-5.6.3/base32.h" -#include "../external/crypto++-5.6.3/words.h" -#include "../external/crypto++-5.6.3/rsa.h" -#include "../external/crypto++-5.6.3/aes.h" -#include "../external/crypto++-5.6.3/hmac.h" -#include "../external/crypto++-5.6.3/zlib.h" -#include "../external/crypto++-5.6.3/gzip.h" -#include "../external/crypto++-5.6.3/pwdbased.h" -using namespace CryptoPP; -typedef AutoSeededX917RNG CAutoSeededRNG; -#include "../external/crypto++-5.6.3/cryptopopdisablewarnings.h" - -#if defined(GNUC) -#pragma GCC diagnostic warning "-Wshadow" -#endif - -#include "tier0/memdbgon.h" -#include "tier0/valve_on.h" - -#include "crypto.h" -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#define min(a,b) (((a) < (b)) ? (a) : (b)) - - -// list of auto-seeded RNG pointers -// these are very expensive to construct, so it makes sense to cache them -CTSList g_tslistPAutoSeededRNG; - -// to avoid deconstructor order issuses we allow to manually free the list -void FreeListRNG() -{ - g_tslistPAutoSeededRNG.Purge(); -} - -//----------------------------------------------------------------------------- -// Purpose: thread-safe access to a pool of cryptoPP random number generators -//----------------------------------------------------------------------------- -class CPoolAllocatedRNG -{ -public: - CPoolAllocatedRNG() - { - m_pRNGNode = g_tslistPAutoSeededRNG.Pop(); - if ( !m_pRNGNode ) - { - m_pRNGNode = new CTSList::Node_t; - } - } - - ~CPoolAllocatedRNG() - { - g_tslistPAutoSeededRNG.Push( m_pRNGNode ); - } - - CAutoSeededRNG &GetRNG() - { - return m_pRNGNode->elem; - } - -private: - CTSList::Node_t *m_pRNGNode; -}; - -// force run this static construction code -class CGlobalInitConstructor -{ -public: - CGlobalInitConstructor() - { - // we have to use this function once since the underlying static constructor - // is not thread safe. See use of MicrosoftCryptoProvider in Crypto++ - CAutoSeededRNG rng; - rng.GenerateByte(); - } -}; - -volatile static CGlobalInitConstructor s_StaticCryptoConstructor; - -//----------------------------------------------------------------------------- -// Purpose: Encrypts the specified data with the specified key. Uses AES (Rijndael) symmetric -// encryption. The encrypted data may then be decrypted by calling SymmetricDecrypt -// with the same key. -// Input: pubPlaintextData - Data to be encrypted -// cubPlaintextData - Size of data to be encrypted -// pIV - Pointer to initialization vector -// cubIV - Size of initialization vector -// pubEncryptedData - Pointer to buffer to receive encrypted data -// pcubEncryptedData - Pointer to a variable that at time of call contains the size of -// the receive buffer for encrypted data. When the method returns, this will contain -// the actual size of the encrypted data. -// pubKey - the key to encrypt the data with -// cubKey - Size of the key (must be k_nSymmetricKeyLen) -// Output: true if successful, false if encryption failed -//----------------------------------------------------------------------------- -bool CCrypto::SymmetricEncryptWithIV( const uint8 *pubPlaintextData, const uint32 cubPlaintextData, - const uint8 *pIV, const uint32 cubIV, - uint8 *pubEncryptedData, uint32 *pcubEncryptedData, - const uint8 *pubKey, const uint32 cubKey ) -{ - //VPROF_BUDGET( "CCrypto::SymmetricEncrypt", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubPlaintextData ); - Assert( cubPlaintextData ); - Assert( pubEncryptedData ); - Assert( pcubEncryptedData ); - Assert( *pcubEncryptedData ); - Assert( pubKey ); - Assert( k_nSymmetricKeyLen == cubKey ); // the only key length supported is k_nSymmetricKeyLen - - bool bRet = false; - - uint32 cubEncryptedData = *pcubEncryptedData; // remember how big the caller's buffer is - bool bUseTempBuffer = false; - uint8 *pTemp = pubEncryptedData; - - - // - // Crypto++ does not play well with overlapping buffers. If the buffers are - // overlapping, then allocate some temp space to use for the encryption. - // - // It does work fine with _identical_ buffers. - // - if ( ( pubEncryptedData + cubEncryptedData >= pubPlaintextData ) && - ( pubPlaintextData + cubPlaintextData >= pubEncryptedData ) ) - { - pTemp = new uint8[cubEncryptedData]; - bUseTempBuffer = true; - } - - try // handle any exceptions crypto++ may throw - { - if ( pTemp != NULL ) - { - AESEncryption aesEncrypt( pubKey, cubKey ); - - byte rgubIVEncrypted[k_cMedBuff]; - Assert( Q_ARRAYSIZE( rgubIVEncrypted ) >= aesEncrypt.BlockSize() ); - Assert( pIV != NULL && cubIV >= aesEncrypt.BlockSize() ); - - ArraySink * pOutputSink = new ArraySink( pTemp, *pcubEncryptedData ); - - // encrypt the initial vector with the key - aesEncrypt.ProcessBlock( pIV, rgubIVEncrypted ); - - // store the encrypted IV in the output - the recipient will need it - pOutputSink->Put( rgubIVEncrypted, aesEncrypt.BlockSize() ); - - // encrypt the message, given the key & IV - CBC_Mode_ExternalCipher::Encryption cipher( aesEncrypt, pIV ); - // Note: StreamTransformationFilter now owns the pointer to pOutputSink and will - // free it when the filter goes out of scope and destructs - StreamTransformationFilter filter( cipher, pOutputSink ); - filter.Put( (byte *) pubPlaintextData, cubPlaintextData ); - filter.MessageEnd(); - // return length of encrypted data to caller - *pcubEncryptedData = pOutputSink->TotalPutLength(); - // CryptoPP may leave garbage hanging around in the caller's buffer past the stated output length. - // Just to be safe, zero out caller's buffer from end out output to end of max buffer - if ( bUseTempBuffer ) - { - Q_memcpy( pubEncryptedData, pTemp, *pcubEncryptedData ); - } - Q_memset( pubEncryptedData + *pcubEncryptedData, 0, (cubEncryptedData - *pcubEncryptedData ) ); - bRet = true; - } - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::SymmetricEncrypt: crypto++ threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - if ( bUseTempBuffer ) - { - delete[] pTemp; - } - - return bRet; -} - -//----------------------------------------------------------------------------- -// Purpose: Encrypts the specified data with the specified key. Uses AES (Rijndael) symmetric -// encryption. The encrypted data may then be decrypted by calling SymmetricDecrypt -// with the same key. Generates a random initialization vector of the -// appropriate size. -// Input: pubPlaintextData - Data to be encrypted -// cubPlaintextData - Size of data to be encrypted -// pubEncryptedData - Pointer to buffer to receive encrypted data -// pcubEncryptedData - Pointer to a variable that at time of call contains the size of -// the receive buffer for encrypted data. When the method returns, this will contain -// the actual size of the encrypted data. -// pubKey - the key to encrypt the data with -// cubKey - Size of the key (must be k_nSymmetricKeyLen) -// Output: true if successful, false if encryption failed -//----------------------------------------------------------------------------- - -bool CCrypto::SymmetricEncrypt( const uint8 *pubPlaintextData, const uint32 cubPlaintextData, - uint8 *pubEncryptedData, uint32 *pcubEncryptedData, - const uint8 *pubKey, const uint32 cubKey ) -{ - bool bRet = false; - - // - // Generate a random IV - // - AESEncryption aesEncrypt( pubKey, cubKey ); - byte rgubIV[k_cMedBuff]; - CPoolAllocatedRNG rng; - rng.GetRNG().GenerateBlock( rgubIV, aesEncrypt.BlockSize() ); - - bRet = SymmetricEncryptWithIV( pubPlaintextData, cubPlaintextData, rgubIV, aesEncrypt.BlockSize(), pubEncryptedData, pcubEncryptedData, pubKey, cubKey ); - - return bRet; -} - - -#ifdef USE_OPENSSL_AES_DECRYPT - -// Local helper to perform AES+CBC decryption using optimized OpenSSL AES routines -static bool BDecryptAESUsingOpenSSL( const uint8 *pubEncryptedData, uint32 cubEncryptedData, uint8 *pubPlaintextData, uint32 *pcubPlaintextData, AES_KEY *key, const uint8 *pIV ) -{ - COMPILE_TIME_ASSERT( k_nSymmetricBlockSize == 16 ); - - // Block cipher encrypted text must be a multiple of the block size - if ( cubEncryptedData % k_nSymmetricBlockSize != 0 ) - return false; - - // Enough input? Requirement is one padded final block - if ( cubEncryptedData < k_nSymmetricBlockSize ) - return false; - - // Enough output space for all the full non-final blocks? - if ( *pcubPlaintextData < cubEncryptedData - k_nSymmetricBlockSize ) - return false; - - uint8 rgubWorking[k_nSymmetricBlockSize]; - uint32 nDecrypted = 0; - - // Process non-final blocks -#if defined(_M_IX86) || defined (_M_X64) || defined(__i386__) || defined(__x86_64__) - // ... believe it or not, Steam client on Windows supports Athlon XP without SSE2 - if ( !IsWindows() || GetCPUInformation().m_bSSE2 ) - { - while ( nDecrypted < cubEncryptedData - k_nSymmetricBlockSize ) - { - AES_decrypt( pubEncryptedData + nDecrypted, rgubWorking, key ); - __m128i m128Temp = _mm_xor_si128( _mm_loadu_si128( (__m128i*)pIV ), _mm_loadu_si128( (__m128i*)rgubWorking ) ); - pIV = pubEncryptedData + nDecrypted; - nDecrypted += k_nSymmetricBlockSize; - _mm_storeu_si128( (__m128i* RESTRICT)( pubPlaintextData + nDecrypted - k_nSymmetricBlockSize ), m128Temp ); - } - } - else -#endif - { - while ( nDecrypted < cubEncryptedData - k_nSymmetricBlockSize ) - { - AES_decrypt( pubEncryptedData + nDecrypted, rgubWorking, key ); - for ( int i = 0; i < k_nSymmetricBlockSize; ++i ) - pubPlaintextData[nDecrypted + i] = rgubWorking[i] ^ pIV[i]; - pIV = pubEncryptedData + nDecrypted; - nDecrypted += k_nSymmetricBlockSize; - } - } - - // Process final block into rgubWorking for padding inspection - Assert( nDecrypted == cubEncryptedData - k_nSymmetricBlockSize ); - AES_decrypt( pubEncryptedData + nDecrypted, rgubWorking, key ); - for ( int i = 0; i < k_nSymmetricBlockSize; ++i ) - rgubWorking[i] ^= pIV[i]; - - // Get final block padding length and make sure it is backfilled properly (PKCS#5) - uint8 pad = rgubWorking[ k_nSymmetricBlockSize - 1 ]; - if ( pad < 1 || pad > k_nSymmetricBlockSize ) - return false; - for ( int i = k_nSymmetricBlockSize - pad; i < k_nSymmetricBlockSize; ++i ) - if ( rgubWorking[i] != pad ) - return false; - - // Check that we have enough space for final bytes - if ( *pcubPlaintextData < nDecrypted + k_nSymmetricBlockSize - pad ) - return false; - - // Write any non-pad bytes from rgubWorking to pubPlaintextData - for ( int i = 0; i < k_nSymmetricBlockSize - pad; ++i ) - pubPlaintextData[nDecrypted++] = rgubWorking[i]; - - // The old CryptoPP path zeros out the entire destination buffer, but that - // behavior isn't documented or even expected. We'll just zero out one byte - // in case anyone relies on string termination, but that zero isn't counted. - if ( *pcubPlaintextData > nDecrypted ) - pubPlaintextData[nDecrypted] = 0; - - *pcubPlaintextData = nDecrypted; - return true; -} - -#else - -/* function, not method */ -static bool SymmetricDecryptWorker( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - const uint8 * pIV, uint32 cubIV, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, - AESDecryption &aesDecrypt ) -{ - //VPROF_BUDGET( "CCrypto::SymmetricDecrypt", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubEncryptedData ); - Assert( cubEncryptedData); - Assert( pIV ); - Assert( cubIV ); - Assert( pubPlaintextData ); - Assert( pcubPlaintextData ); - Assert( *pcubPlaintextData ); - - bool bRet = false; - - uint32 cubPlaintextData = *pcubPlaintextData; // remember how big the caller's buffer is - bool bUseTempBuffer = false; - uint8* pTemp = pubPlaintextData; - - // - // Crypto++ does not play nice with decrypting in place. If the buffers are - // overlapping, then allocate some temp space to use for the decryption. - // - // It does work fine with _identical_ buffers, but due to the way we store - // the IV in the returned encrypted data we never actually hit that case. - // - if ( ( pubEncryptedData + cubEncryptedData >= pubPlaintextData ) && - ( pubPlaintextData + cubPlaintextData >= pubEncryptedData ) ) - { - pTemp = new uint8[cubPlaintextData]; - bUseTempBuffer = true; - } - - try // handle any exceptions crypto++ may throw - { - if ( pTemp != NULL ) - { - CryptoPP::ArraySink* pOutputSink = new CryptoPP::ArraySink( pTemp, *pcubPlaintextData ); - CryptoPP::CBC_Mode_ExternalCipher::Decryption cbc( aesDecrypt, pIV ); - // Note: StreamTransformationFilter now owns the pointer to pOutputSink and will - // free it when the filter goes out of scope and destructs - CryptoPP::StreamTransformationFilter padding( cbc, pOutputSink ); - padding.Put( pubEncryptedData, cubEncryptedData ); - padding.MessageEnd(); - // return length of decrypted data to caller - *pcubPlaintextData = pOutputSink->TotalPutLength(); - // CryptoPP may leave garbage hanging around in the caller's buffer past the stated output length. - // Just to be safe, zero out caller's buffer from end out output to end of max buffer - if ( bUseTempBuffer ) - { - Q_memcpy( pubPlaintextData, pTemp, *pcubPlaintextData ); - } - Q_memset( pubPlaintextData + *pcubPlaintextData, 0, (cubPlaintextData - *pcubPlaintextData ) ); - - bRet = true; - } - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 4, "CCrypto::SymmetricDecrypt: crypto++ threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - if ( bUseTempBuffer ) - { - delete[] pTemp; - } - - return bRet; -} - -#endif - - -//----------------------------------------------------------------------------- -// Purpose: Decrypts the specified data with the specified key. Uses AES (Rijndael) symmetric -// decryption. -// Input: pubEncryptedData - Data to be decrypted -// cubEncryptedData - Size of data to be decrypted -// pubPlaintextData - Pointer to buffer to receive decrypted data -// pcubPlaintextData - Pointer to a variable that at time of call contains the size of -// the receive buffer for decrypted data. When the method returns, this will contain -// the actual size of the decrypted data. -// pubKey - the key to decrypt the data with -// cubKey - Size of the key (must be k_nSymmetricKeyLen) -// Output: true if successful, false if decryption failed -//----------------------------------------------------------------------------- -bool CCrypto::SymmetricDecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, - const uint8 *pubKey, const uint32 cubKey ) -{ - Assert( pubEncryptedData ); - Assert( cubEncryptedData); - Assert( pubPlaintextData ); - Assert( pcubPlaintextData ); - Assert( *pcubPlaintextData ); - Assert( pubKey ); - Assert( k_nSymmetricKeyLen == cubKey ); // the only key length supported is k_nSymmetricKeyLen - - // the initialization vector (IV) must be stored in the first block of bytes. - // If the size of encrypted data is not at least the block size, it is not valid - if ( cubEncryptedData < k_nSymmetricBlockSize ) - return false; - -#ifdef USE_OPENSSL_AES_DECRYPT - - AES_KEY key; - if ( AES_set_decrypt_key( pubKey, cubKey * 8, &key ) < 0 ) - return false; - - // Our first block is straight AES block encryption of IV with user key, no XOR. - uint8 rgubIV[ k_nSymmetricBlockSize ]; - AES_decrypt( pubEncryptedData, rgubIV, &key ); - pubEncryptedData += k_nSymmetricBlockSize; - cubEncryptedData -= k_nSymmetricBlockSize; - - return BDecryptAESUsingOpenSSL( pubEncryptedData, cubEncryptedData, pubPlaintextData, pcubPlaintextData, &key, rgubIV ); - -#else - - AESDecryption aesDecrypt( pubKey, cubKey ); - Assert( k_nSymmetricBlockSize == aesDecrypt.BlockSize() ); - - // Decrypt the IV - byte rgubIV[k_cMedBuff]; - Assert( Q_ARRAYSIZE( rgubIV ) >= aesDecrypt.BlockSize() ); - aesDecrypt.ProcessBlock( pubEncryptedData, rgubIV ); - - // We have now consumed the IV, so remove it from the front of the message - pubEncryptedData += k_nSymmetricBlockSize; - cubEncryptedData -= k_nSymmetricBlockSize; - - // given the IV stored in the message, and the key, decrypt the message - return SymmetricDecryptWorker( pubEncryptedData, cubEncryptedData, - rgubIV, aesDecrypt.BlockSize(), - pubPlaintextData, pcubPlaintextData, - aesDecrypt ); - -#endif -} - -//----------------------------------------------------------------------------- -// Purpose: Decrypts the specified data with the specified key. Uses AES (Rijndael) symmetric -// decryption. -// Input: pubEncryptedData - Data to be decrypted -// cubEncryptedData - Size of data to be decrypted -// pIV - Initialization vector. Byte array one block in size. -// cubIV - size of IV. This should be 16 (one block, 128 bits) -// pubPlaintextData - Pointer to buffer to receive decrypted data -// pcubPlaintextData - Pointer to a variable that at time of call contains the size of -// the receive buffer for decrypted data. When the method returns, this will contain -// the actual size of the decrypted data. -// pubKey - the key to decrypt the data with -// cubKey - Size of the key (must be k_nSymmetricKeyLen) -// Output: true if successful, false if decryption failed -//----------------------------------------------------------------------------- -bool CCrypto::SymmetricDecryptWithIV( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - const uint8 * pIV, uint32 cubIV, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, - const uint8 *pubKey, const uint32 cubKey ) -{ - Assert( pubEncryptedData ); - Assert( cubEncryptedData); - Assert( pIV ); - Assert( cubIV ); - Assert( pubPlaintextData ); - Assert( pcubPlaintextData ); - Assert( *pcubPlaintextData ); - Assert( pubKey ); - Assert( k_nSymmetricKeyLen == cubKey ); // the only key length supported is k_nSymmetricKeyLen - - // IV input into CBC must be exactly one block size - if ( cubIV != k_nSymmetricBlockSize ) - return false; - -#ifdef USE_OPENSSL_AES_DECRYPT - - AES_KEY key; - if ( AES_set_decrypt_key( pubKey, cubKey * 8, &key ) < 0 ) - return false; - - return BDecryptAESUsingOpenSSL( pubEncryptedData, cubEncryptedData, pubPlaintextData, pcubPlaintextData, &key, pIV ); - -#else - - AESDecryption aesDecrypt( pubKey, cubKey ); - Assert( k_nSymmetricBlockSize == aesDecrypt.BlockSize() ); - - return SymmetricDecryptWorker( pubEncryptedData, cubEncryptedData, - pIV, cubIV, - pubPlaintextData, pcubPlaintextData, - aesDecrypt ); - -#endif -} - - -//----------------------------------------------------------------------------- -// Purpose: For specified plaintext data size, returns what size of symmetric -// encrypted data will be -//----------------------------------------------------------------------------- -uint32 CCrypto::GetSymmetricEncryptedSize( uint32 cubPlaintextData ) -{ - // empirically determined encrypted size as function of plaintext size for AES encryption - uint k_cubBlock = 16; - uint k_cubHeader = 16; - return k_cubHeader + ( ( cubPlaintextData / k_cubBlock ) * k_cubBlock ) + k_cubBlock; -} - - -//----------------------------------------------------------------------------- -// Purpose: Encrypts the specified data with the specified text password. -// Uses the SHA256 hash of the password as the key for AES (Rijndael) symmetric -// encryption. A SHA1 HMAC of the result is appended, for authentication on -// the receiving end. -// The encrypted data may then be decrypted by calling DecryptWithPasswordAndAuthenticate -// with the same password. -// Input: pubPlaintextData - Data to be encrypted -// cubPlaintextData - Size of data to be encrypted -// pubEncryptedData - Pointer to buffer to receive encrypted data -// pcubEncryptedData - Pointer to a variable that at time of call contains the size of -// the receive buffer for encrypted data. When the method returns, this will contain -// the actual size of the encrypted data. -// pchPassword - text password -// Output: true if successful, false if encryption failed -//----------------------------------------------------------------------------- -bool CCrypto::EncryptWithPasswordAndHMAC( const uint8 *pubPlaintextData, uint32 cubPlaintextData, - uint8 * pubEncryptedData, uint32 * pcubEncryptedData, - const char *pchPassword ) -{ - // - // Generate a random IV - // - byte rgubIV[k_nSymmetricBlockSize]; - CPoolAllocatedRNG rng; - rng.GetRNG().GenerateBlock( rgubIV, k_nSymmetricBlockSize ); - - return EncryptWithPasswordAndHMACWithIV( pubPlaintextData, cubPlaintextData, rgubIV, k_nSymmetricBlockSize, pubEncryptedData, pcubEncryptedData, pchPassword ); -} - - -//----------------------------------------------------------------------------- -// Purpose: Encrypts the specified data with the specified text password. -// Uses the SHA256 hash of the password as the key for AES (Rijndael) symmetric -// encryption. A SHA1 HMAC of the result is appended, for authentication on -// the receiving end. -// The encrypted data may then be decrypted by calling DecryptWithPasswordAndAuthenticate -// with the same password. -// Input: pubPlaintextData - Data to be encrypted -// cubPlaintextData - Size of data to be encrypted -// pIV - IV to use for AES encryption. Should be random and never used before unless you know -// exactly what you're doing. -// cubIV - size of the IV - should be same ase the AES blocksize. -// pubEncryptedData - Pointer to buffer to receive encrypted data -// pcubEncryptedData - Pointer to a variable that at time of call contains the size of -// the receive buffer for encrypted data. When the method returns, this will contain -// the actual size of the encrypted data. -// pchPassword - text password -// Output: true if successful, false if encryption failed -//----------------------------------------------------------------------------- -bool CCrypto::EncryptWithPasswordAndHMACWithIV( const uint8 *pubPlaintextData, uint32 cubPlaintextData, - const uint8 * pIV, uint32 cubIV, - uint8 * pubEncryptedData, uint32 * pcubEncryptedData, - const char *pchPassword ) -{ - uint8 rgubKey[k_nSymmetricKeyLen]; - if ( !pchPassword || !pchPassword[0] ) - return false; - - if ( !cubPlaintextData ) - return false; - - uint32 cubBuffer = *pcubEncryptedData; - uint32 cubExpectedResult = GetSymmetricEncryptedSize( cubPlaintextData ) + sizeof( SHADigest_t ); - - if ( cubBuffer < cubExpectedResult ) - return false; - - try - { - CryptoPP::SHA256().CalculateDigest( rgubKey, (const uint8 *)pchPassword, Q_strlen( pchPassword ) ); - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 4, "CCrypto::EncryptWithPassword: crypto++ threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - return false; - } - - bool bRet = SymmetricEncryptWithIV( pubPlaintextData, cubPlaintextData, pIV, cubIV, pubEncryptedData, pcubEncryptedData, rgubKey, k_nSymmetricKeyLen ); - if ( bRet ) - { - // calc HMAC - uint32 cubEncrypted = *pcubEncryptedData; - *pcubEncryptedData += sizeof( SHADigest_t ); - if ( cubBuffer < *pcubEncryptedData ) - return false; - - SHADigest_t *pHMAC = (SHADigest_t*)( pubEncryptedData + cubEncrypted ); - bRet = CCrypto::GenerateHMAC( pubEncryptedData, cubEncrypted, rgubKey, k_nSymmetricKeyLen, pHMAC ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Decrypts the specified data with the specified password. Uses AES (Rijndael) symmetric -// decryption. First, the HMAC is verified - if it is not correct, then we know that -// the key is incorrect or the data is corrupted, and the decryption fails. -// Input: pubEncryptedData - Data to be decrypted -// cubEncryptedData - Size of data to be decrypted -// pubPlaintextData - Pointer to buffer to receive decrypted data -// pcubPlaintextData - Pointer to a variable that at time of call contains the size of -// the receive buffer for decrypted data. When the method returns, this will contain -// the actual size of the decrypted data. -// pchPassword - the text password to decrypt the data with -// Output: true if successful, false if decryption failed -//----------------------------------------------------------------------------- -bool CCrypto::DecryptWithPasswordAndAuthenticate( const uint8 * pubEncryptedData, uint32 cubEncryptedData, - uint8 * pubPlaintextData, uint32 * pcubPlaintextData, - const char *pchPassword ) -{ - uint8 rgubKey[k_nSymmetricKeyLen]; - if ( !pchPassword || !pchPassword[0] ) - return false; - - if ( cubEncryptedData <= sizeof( SHADigest_t ) ) - return false; - - try - { - CryptoPP::SHA256().CalculateDigest( rgubKey, (const uint8 *)pchPassword, Q_strlen( pchPassword ) ); - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 4, "CCrypto::EncryptWithPassword: crypto++ threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - return false; - } - - uint32 cubCiphertext = cubEncryptedData - sizeof( SHADigest_t ); - SHADigest_t *pHMAC = (SHADigest_t*)( pubEncryptedData + cubCiphertext ); - SHADigest_t hmacActual; - bool bRet = CCrypto::GenerateHMAC( pubEncryptedData, cubCiphertext, rgubKey, k_nSymmetricKeyLen, &hmacActual ); - - if ( bRet ) - { - // invalid ciphertext or key - if ( Q_memcmp( &hmacActual, pHMAC, sizeof( SHADigest_t ) ) ) - return false; - - bRet = SymmetricDecrypt( pubEncryptedData, cubCiphertext, pubPlaintextData, pcubPlaintextData, rgubKey, k_nSymmetricKeyLen ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generates a new pair of private/public RSA keys -// Input: pubPublicKey - Pointer to buffer to receive public key (should be of size k_nRSAKeyLenMax) -// pcubPublicKey - Pointer to variable that contains size of pubPublicKey buffer. At exit, -// this is filled in with the actual size of the public key -// pubPrivateKey - Pointer to buffer to receive private key (should be of size k_nRSAKeyLenMax) -// pcubPrivateKey - Pointer to variable that contains size of pubPrivateKey buffer. At exit, -// this is filled in with the actual size of the private key -// Output: true if successful, false if key generation failed -//----------------------------------------------------------------------------- -bool CCrypto::RSAGenerateKeys( uint8 *pubPublicKey, uint32 *pcubPublicKey, uint8 *pubPrivateKey, uint32 *pcubPrivateKey ) -{ - VPROF_BUDGET( "CCrypto::RSAGenerateKeys", VPROF_BUDGETGROUP_ENCRYPTION ); - bool bRet = false; - Assert( pubPublicKey ); - Assert( pcubPublicKey ); - Assert( pubPrivateKey ); - Assert( pcubPrivateKey ); - - try // handle any exceptions crypto++ may throw - { - // generate private key - ArraySink arraySinkPrivateKey( pubPrivateKey, *pcubPrivateKey ); - CPoolAllocatedRNG rng; - RSAES_OAEP_SHA_Decryptor priv( rng.GetRNG(), k_nRSAKeyBits ); - priv.DEREncode( arraySinkPrivateKey ); - *pcubPrivateKey = arraySinkPrivateKey.TotalPutLength(); - // generate public key - ArraySink arraySinkPublicKey( pubPublicKey, *pcubPublicKey ); - RSAES_OAEP_SHA_Encryptor pub(priv); - pub.DEREncode( arraySinkPublicKey ); - *pcubPublicKey = arraySinkPublicKey.TotalPutLength(); - bRet = true; - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSAGenerateKeys: crypto++ threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Encrypts the specified data with the specified RSA public key. -// The encrypted data may then be decrypted by calling RSADecrypt with the -// corresponding RSA private key. -// Input: pubPlaintextData - Data to be encrypted -// cubPlaintextData - Size of data to be encrypted -// pubEncryptedData - Pointer to buffer to receive encrypted data -// pcubEncryptedData - Pointer to a variable that at time of call contains the size of -// the receive buffer for encrypted data. When the method returns, this will contain -// the actual size of the encrypted data. -// pubPublicKey - the RSA public key to encrypt the data with -// cubPublicKey - Size of the key (must be k_nSymmetricKeyLen) -// Output: true if successful, false if encryption failed -//----------------------------------------------------------------------------- -bool CCrypto::RSAEncrypt( const uint8 *pubPlaintextData, uint32 cubPlaintextData, - uint8 *pubEncryptedData, uint32 *pcubEncryptedData, - const uint8 *pubPublicKey, const uint32 cubPublicKey ) -{ - VPROF_BUDGET( "CCrypto::RSAEncrypt", VPROF_BUDGETGROUP_ENCRYPTION ); - bool bRet = false; - Assert( cubPlaintextData > 0 ); // must pass in some data - - try // handle any exceptions crypto++ may throw - { - StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); - RSAES_OAEP_SHA_Encryptor rsaEncryptor( stringSourcePublicKey ); - - // calculate how many blocks of encryption will we need to do - AssertFatal( rsaEncryptor.FixedMaxPlaintextLength() <= ULONG_MAX ); - uint32 cBlocks = 1 + ( ( cubPlaintextData - 1 ) / (uint32)rsaEncryptor.FixedMaxPlaintextLength() ); - // calculate how big the output will be - AssertFatal( rsaEncryptor.FixedCiphertextLength() <= ULONG_MAX / cBlocks ); - uint32 cubCipherText = cBlocks * (uint32)rsaEncryptor.FixedCiphertextLength(); - Assert( cubCipherText > 0 ); - - // ensure there is sufficient room in output buffer for result - if ( cubCipherText > ( *pcubEncryptedData ) ) - { - /*AssertMsg2( false, "CCrypto::RSAEncrypt: insufficient output buffer for encryption, needed %d got %d\n", - cubCipherText, *pcubEncryptedData );*/ - return false; - } - - // encrypt the message, using as many blocks as required - CPoolAllocatedRNG rng; - for ( uint32 nBlock = 0; nBlock < cBlocks; nBlock++ ) - { - // encrypt either all remaining plaintext, or maximum allowed plaintext per RSA encryption operation - uint32 cubToEncrypt = min( cubPlaintextData, (uint32)rsaEncryptor.FixedMaxPlaintextLength() ); - // encrypt the plaintext - rsaEncryptor.Encrypt( rng.GetRNG(), pubPlaintextData, cubToEncrypt, pubEncryptedData ); - // adjust input and output pointers and remaining plaintext byte count - pubPlaintextData += cubToEncrypt; - cubPlaintextData -= cubToEncrypt; - pubEncryptedData += rsaEncryptor.FixedCiphertextLength(); - } - Assert( 0 == cubPlaintextData ); // should have no remaining plaintext to encrypt - *pcubEncryptedData = cubCipherText; - - bRet = true; - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSAEncrypt: Encrypt() threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Decrypts the specified data with the specified RSA private key -// Input: pubEncryptedData - Data to be decrypted -// cubEncryptedData - Size of data to be decrypted -// pubPlaintextData - Pointer to buffer to receive decrypted data -// pcubPlaintextData - Pointer to a variable that at time of call contains the size of -// the receive buffer for decrypted data. When the method returns, this will contain -// the actual size of the decrypted data. -// pubPrivateKey - the RSA private key key to decrypt the data with -// cubPrivateKey - Size of the key (must be k_nSymmetricKeyLen) -// Output: true if successful, false if decryption failed -//----------------------------------------------------------------------------- -bool CCrypto::RSADecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, - const uint8 *pubPrivateKey, const uint32 cubPrivateKey ) -{ - VPROF_BUDGET( "CCrypto::RSADecrypt", VPROF_BUDGETGROUP_ENCRYPTION ); - bool bRet = false; - - Assert( cubEncryptedData > 0 ); // must pass in some data - - try // handle any exceptions crypto++ may throw - { - StringSource stringSourcePrivateKey( pubPrivateKey, cubPrivateKey, true ); - RSAES_OAEP_SHA_Decryptor rsaDecryptor( stringSourcePrivateKey ); - - // calculate how many blocks of decryption will we need to do - AssertFatal( rsaDecryptor.FixedCiphertextLength() <= ULONG_MAX ); - uint32 cubFixedCiphertextLength = (uint32)rsaDecryptor.FixedCiphertextLength(); - // Ensure encrypted data is valid and has length that is exact multiple of 128 bytes - if ( 0 != ( cubEncryptedData % cubFixedCiphertextLength ) ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSADecrypt: invalid ciphertext length %d, needs to be a multiple of %d\n", - cubEncryptedData, cubFixedCiphertextLength ); - return false; - } - uint32 cBlocks = cubEncryptedData / cubFixedCiphertextLength; - - // calculate how big the maximum output will be - size_t cubMaxPlaintext = rsaDecryptor.MaxPlaintextLength( rsaDecryptor.FixedCiphertextLength() ); - AssertFatal( cubMaxPlaintext <= ULONG_MAX / cBlocks ); - uint32 cubPlaintextDataMax = cBlocks * (uint32)cubMaxPlaintext; - Assert( cubPlaintextDataMax > 0 ); - // ensure there is sufficient room in output buffer for result - if ( cubPlaintextDataMax >= ( *pcubPlaintextData ) ) - { - /*AssertMsg2( false, "CCrypto::RSADecrypt: insufficient output buffer for decryption, needed %d got %d\n", - cubPlaintextDataMax, *pcubPlaintextData );*/ - return false; - } - - // decrypt the data, using as many blocks as required - CPoolAllocatedRNG rng; - uint32 cubPlaintextData = 0; - for ( uint32 nBlock = 0; nBlock < cBlocks; nBlock++ ) - { - // decrypt one block (always of fixed size) - int cubToDecrypt = cubFixedCiphertextLength; - DecodingResult decodingResult = rsaDecryptor.Decrypt( rng.GetRNG(), pubEncryptedData, cubToDecrypt, pubPlaintextData ); - if ( !decodingResult.isValidCoding ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSADecrypt: failed to decrypt\n" ); - return false; - } - // adjust input and output pointers and remaining encrypted byte count - pubEncryptedData += cubToDecrypt; - cubEncryptedData -= cubToDecrypt; - pubPlaintextData += decodingResult.messageLength; - AssertFatal( decodingResult.messageLength <= ULONG_MAX ); - cubPlaintextData += (uint32)decodingResult.messageLength; - } - Assert( 0 == cubEncryptedData ); // should have no remaining encrypted data to decrypt - *pcubPlaintextData = cubPlaintextData; - - bRet = true; - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSADecrypt: Decrypt() threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Decrypts the specified data with the specified RSA PUBLIC key, -// using no padding (eg un-padded signature). -// Input: pubEncryptedData - Data to be decrypted -// cubEncryptedData - Size of data to be decrypted -// pubPlaintextData - Pointer to buffer to receive decrypted data -// pcubPlaintextData - Pointer to a variable that at time of call contains the size of -// the receive buffer for decrypted data. When the method returns, this will contain -// the actual size of the decrypted data. -// pubPublicKey - the RSA public key key to decrypt the data with -// cubPublicKey - Size of the key -// Output: true if successful, false if decryption failed -//----------------------------------------------------------------------------- -bool CCrypto::RSAPublicDecrypt_NoPadding( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, - const uint8 *pubPublicKey, const uint32 cubPublicKey ) -{ - VPROF_BUDGET( "CCrypto::RSADecrypt", VPROF_BUDGETGROUP_ENCRYPTION ); - bool bRet = false; - - Assert( cubEncryptedData > 0 ); // must pass in some data - - // BUGBUG taylor - // This probably only works for reasonably small ciphertext sizes. - - try // handle any exceptions crypto++-5.2 may throw - { - StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); - - // 1. We need to use a Verifier because a Decryptor expects a private key, - // which is encoded differently - // 2. We are using neither PKCS1v15 padding nor SHA in any way, we are simply - // using this object as a means of instantiating the key decryption function - RSASSA_PKCS1v15_SHA_Verifier pub( stringSourcePublicKey ); - - // Ask for the data to be decrypted - // Caveat: this may "succeed" even if the ciphertext is bogus, so it - // is up to the caller to do any MAC or other sanity checking - Integer x = pub.AccessKey().ApplyFunction(Integer(pubEncryptedData, cubEncryptedData)); - - // Result is an 'Integer', essentially a string of bytes for our - // purposes though. - uint32 nBytes = x.ByteCount(); - if ( nBytes > *pcubPlaintextData ) - { - return false; - } - - // don't tell it to encode to the full buffer size, because it will - // pre-pad with zeros. Just squeeze it in to the first nBytes of the - // buffer. - x.Encode( pubPlaintextData, nBytes ); - *pcubPlaintextData = nBytes; - - bRet = true; - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSAPublicDecrypt_NoPadding: Decrypt() threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generates an RSA signature block for the specified data with the specified -// RSA private key. The signature can be verified by calling RSAVerifySignature -// with the RSA public key. -// Input: pubData - Data to be signed -// cubData - Size of data to be signed -// pubSignature - Pointer to buffer to receive signature block -// pcubSignature - Pointer to a variable that at time of call contains the size of -// the pubSignature buffer. When the method returns, this will contain -// the actual size of the signature block -// pubPrivateKey - The RSA private key to use to sign the data -// cubPrivateKey - Size of the key -// Output: true if successful, false if signature failed -//----------------------------------------------------------------------------- -bool CCrypto::RSASign( const uint8 *pubData, const uint32 cubData, - uint8 *pubSignature, uint32 *pcubSignature, - const uint8 *pubPrivateKey, const uint32 cubPrivateKey ) -{ - VPROF_BUDGET( "CCrypto::RSASign", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( pubPrivateKey ); - Assert( cubPrivateKey > 0 ); - Assert( pubSignature ); - Assert( pcubSignature ); - bool bRet = false; - try // handle any exceptions crypto++ may throw - { - StringSource stringSourcePrivateKey( pubPrivateKey, cubPrivateKey, true ); - RSASSA_PKCS1v15_SHA_Signer rsaSigner( stringSourcePrivateKey ); - CPoolAllocatedRNG rng; - size_t len = rsaSigner.SignMessage( rng.GetRNG(), (byte *)pubData, cubData, pubSignature ); - AssertFatal( len <= ULONG_MAX ); - *pcubSignature = (uint32)len; - bRet = true; - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: SignMessage threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Verifies that signature block is authentic for given data & RSA public key -// Input: pubData - Data that was signed -// cubData - Size of data that was signed signed -// pubSignature - Signature block -// cubSignature - Size of signature block -// pubPublicKey - The RSA public key to use to verify the signature -// (must be from same pair as RSA private key used to generate signature) -// cubPublicKey - Size of the key -// Output: true if successful and signature is authentic, false if signature does not match or other error -//----------------------------------------------------------------------------- -bool CCrypto::RSAVerifySignature( const uint8 *pubData, const uint32 cubData, - const uint8 *pubSignature, const uint32 cubSignature, - const uint8 *pubPublicKey, const uint32 cubPublicKey ) -{ - VPROF_BUDGET( "CCrypto::RSAVerifySignature", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( pubSignature ); - Assert( pubPublicKey ); - - bool bRet = false; - try // handle any exceptions crypto++ may throw - { - StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); - RSASSA_PKCS1v15_SHA_Verifier pub( stringSourcePublicKey ); - bRet = pub.VerifyMessage( pubData, cubData, pubSignature, cubSignature ); - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: VerifyMessage threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - -//----------------------------------------------------------------------------- -// Purpose: Generates an RSA signature block for the specified data with the specified -// RSA private key. The signature can be verified by calling RSAVerifySignature -// with the RSA public key. -// Input: pubData - Data to be signed -// cubData - Size of data to be signed -// pubSignature - Pointer to buffer to receive signature block -// pcubSignature - Pointer to a variable that at time of call contains the size of -// the pubSignature buffer. When the method returns, this will contain -// the actual size of the signature block -// pubPrivateKey - The RSA private key to use to sign the data -// cubPrivateKey - Size of the key -// Output: true if successful, false if signature failed -//----------------------------------------------------------------------------- -bool CCrypto::RSASignSHA256( const uint8 *pubData, const uint32 cubData, - uint8 *pubSignature, uint32 *pcubSignature, - const uint8 *pubPrivateKey, const uint32 cubPrivateKey ) -{ - VPROF_BUDGET( "CCrypto::RSASign", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( pubPrivateKey ); - Assert( cubPrivateKey > 0 ); - Assert( pubSignature ); - Assert( pcubSignature ); - bool bRet = false; - try // handle any exceptions crypto++ may throw - { - StringSource stringSourcePrivateKey( pubPrivateKey, cubPrivateKey, true ); - RSASS::Signer rsaSigner( stringSourcePrivateKey ); - CPoolAllocatedRNG rng; - size_t len = rsaSigner.SignMessage( rng.GetRNG(), (byte *)pubData, cubData, pubSignature ); - AssertFatal( len <= ULONG_MAX ); - *pcubSignature = (uint32)len; - bRet = true; - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: SignMessage threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Verifies that signature block is authentic for given data & RSA public key -// Input: pubData - Data that was signed -// cubData - Size of data that was signed signed -// pubSignature - Signature block -// cubSignature - Size of signature block -// pubPublicKey - The RSA public key to use to verify the signature -// (must be from same pair as RSA private key used to generate signature) -// cubPublicKey - Size of the key -// Output: true if successful and signature is authentic, false if signature does not match or other error -//----------------------------------------------------------------------------- -bool CCrypto::RSAVerifySignatureSHA256( const uint8 *pubData, const uint32 cubData, - const uint8 *pubSignature, const uint32 cubSignature, - const uint8 *pubPublicKey, const uint32 cubPublicKey ) -{ - //VPROF_BUDGET( "CCrypto::RSAVerifySignature", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( pubSignature ); - Assert( pubPublicKey ); - - bool bRet = false; - try // handle any exceptions crypto++ may throw - { - StringSource stringSourcePublicKey( pubPublicKey, cubPublicKey, true ); - RSASS::Verifier pub( stringSourcePublicKey ); - bRet = pub.VerifyMessage( pubData, cubData, pubSignature, cubSignature ); - } - catch ( Exception e ) - { - DMsg( SPEW_CRYPTO, 2, "CCrypto::RSASign: VerifyMessage threw exception %s (%d)\n", - e.what(), e.GetErrorType() ); - } - - return bRet; -} - - -//----------------------------------------------------------------------------- -// Purpose: Hex-encodes a block of data. (Binary -> text representation.) The output -// is null-terminated and can be treated as a string. -// Input: pubData - Data to encode -// cubData - Size of data to encode -// pchEncodedData - Pointer to string buffer to store output in -// cchEncodedData - Size of pchEncodedData buffer -//----------------------------------------------------------------------------- -bool CCrypto::HexEncode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ) -{ - VPROF_BUDGET( "CCrypto::HexEncode", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( cubData ); - Assert( pchEncodedData ); - Assert( cchEncodedData > 0 ); - - if ( cchEncodedData < ( ( cubData * 2 ) + 1 ) ) - { - Assert( cchEncodedData >= ( cubData * 2 ) + 1 ); // expands to 2x input + NULL, must have room in output buffer - *pchEncodedData = '\0'; - return false; - } - - ArraySink * pArraySinkOutput = new ArraySink( (byte *) pchEncodedData, cchEncodedData ); - // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs - HexEncoder hexEncoder( pArraySinkOutput ); - hexEncoder.Put( pubData, cubData ); - hexEncoder.MessageEnd(); - - uint32 len = pArraySinkOutput->TotalPutLength(); - if ( len >= cchEncodedData ) - { - /*AssertMsg2( false, "CCrypto::HexEncode: insufficient output buffer for encoding, needed %d got %d\n", - len, cchEncodedData );*/ - return false; - } - - pchEncodedData[len] = 0; // NULL-terminate - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Hex-decodes a block of data. (Text -> binary representation.) -// Input: pchData - Null-terminated hex-encoded string -// pubDecodedData - Pointer to buffer to store output in -// pcubDecodedData - Pointer to variable that contains size of -// output buffer. At exit, is filled in with actual size -// of decoded data. -//----------------------------------------------------------------------------- -bool CCrypto::HexDecode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ) -{ - VPROF_BUDGET( "CCrypto::HexDecode", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pchData ); - Assert( pubDecodedData ); - Assert( pcubDecodedData ); - Assert( *pcubDecodedData ); - - ArraySink * pArraySinkOutput = new ArraySink( pubDecodedData, *pcubDecodedData ); - // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs - HexDecoder hexDecoder( pArraySinkOutput ); - hexDecoder.Put( (byte *) pchData, Q_strlen( pchData ) ); - hexDecoder.MessageEnd(); - - uint32 len = pArraySinkOutput->TotalPutLength(); - if ( len > *pcubDecodedData ) - { - /*AssertMsg2( false, "CCrypto::HexDecode: insufficient output buffer for decoding, needed %d got %d\n", - len, *pcubDecodedData );*/ - return false; - } - *pcubDecodedData = len; - - return true; -} - - -static const int k_LineBreakEveryNGroups = 18; // line break every 18 groups of 4 characters (every 72 characters) - -//----------------------------------------------------------------------------- -// Purpose: Returns the expected buffer size that should be passed to Base64Encode. -// Input: cubData - Size of data to encode -// bInsertLineBreaks - If line breaks should be inserted automatically -//----------------------------------------------------------------------------- -uint32 CCrypto::Base64EncodeMaxOutput( const uint32 cubData, const char *pszLineBreak ) -{ - // terminating null + 4 chars per 3-byte group + line break after every 18 groups (72 output chars) + final line break - uint32 nGroups = (cubData+2)/3; - str_size cchRequired = 1 + nGroups*4 + ( pszLineBreak ? Q_strlen(pszLineBreak)*(1+(nGroups-1)/k_LineBreakEveryNGroups) : 0 ); - return cchRequired; -} - - -//----------------------------------------------------------------------------- -// Purpose: Base64-encodes a block of data. (Binary -> text representation.) The output -// is null-terminated and can be treated as a string. -// Input: pubData - Data to encode -// cubData - Size of data to encode -// pchEncodedData - Pointer to string buffer to store output in -// cchEncodedData - Size of pchEncodedData buffer -// bInsertLineBreaks - If "\n" line breaks should be inserted automatically -//----------------------------------------------------------------------------- -bool CCrypto::Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32 cchEncodedData, bool bInsertLineBreaks ) -{ - const char *pszLineBreak = bInsertLineBreaks ? "\n" : NULL; - uint32 cchRequired = Base64EncodeMaxOutput( cubData, pszLineBreak ); - (void)cchRequired; - //AssertMsg2( cchEncodedData >= cchRequired, "CCrypto::Base64Encode: insufficient output buffer for encoding, needed %d got %d\n", cchRequired, cchEncodedData ); - return Base64Encode( pubData, cubData, pchEncodedData, &cchEncodedData, pszLineBreak ); -} - -//----------------------------------------------------------------------------- -// Purpose: Base64-encodes a block of data. (Binary -> text representation.) The output -// is null-terminated and can be treated as a string. -// Input: pubData - Data to encode -// cubData - Size of data to encode -// pchEncodedData - Pointer to string buffer to store output in -// pcchEncodedData - Pointer to size of pchEncodedData buffer; adjusted to number of characters written (before NULL) -// pszLineBreak - String to be inserted every 72 characters; empty string or NULL pointer for no line breaks -// Note: if pchEncodedData is NULL and *pcchEncodedData is zero, *pcchEncodedData is filled with the actual required length -// for output. A simpler approximation for maximum output size is (cubData * 4 / 3) + 5 if there are no linebreaks. -//----------------------------------------------------------------------------- -bool CCrypto::Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32* pcchEncodedData, const char *pszLineBreak ) -{ - VPROF_BUDGET( "CCrypto::Base64Encode", VPROF_BUDGETGROUP_ENCRYPTION ); - - if ( pchEncodedData == NULL ) - { - //AssertMsg( *pcchEncodedData == 0, "NULL output buffer with non-zero size passed to Base64Encode" ); - *pcchEncodedData = Base64EncodeMaxOutput( cubData, pszLineBreak ); - return true; - } - - const uint8 *pubDataEnd = pubData + cubData; - char *pchEncodedDataStart = pchEncodedData; - str_size unLineBreakLen = pszLineBreak ? Q_strlen( pszLineBreak ) : 0; - int nNextLineBreak = unLineBreakLen ? k_LineBreakEveryNGroups : INT_MAX; - - const char * const pszBase64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - uint32 cchEncodedData = *pcchEncodedData; - if ( cchEncodedData == 0 ) - goto out_of_space; - - --cchEncodedData; // pre-decrement for the terminating null so we don't forget about it - - // input 3 x 8-bit, output 4 x 6-bit - while ( pubDataEnd - pubData >= 3 ) - { - if ( cchEncodedData < 4 + unLineBreakLen ) - goto out_of_space; - - if ( nNextLineBreak == 0 ) - { - memcpy( pchEncodedData, pszLineBreak, unLineBreakLen ); - pchEncodedData += unLineBreakLen; - cchEncodedData -= unLineBreakLen; - nNextLineBreak = k_LineBreakEveryNGroups; - } - - uint32 un24BitsData; - un24BitsData = (uint32) pubData[0] << 16; - un24BitsData |= (uint32) pubData[1] << 8; - un24BitsData |= (uint32) pubData[2]; - pubData += 3; - - pchEncodedData[0] = pszBase64Chars[ (un24BitsData >> 18) & 63 ]; - pchEncodedData[1] = pszBase64Chars[ (un24BitsData >> 12) & 63 ]; - pchEncodedData[2] = pszBase64Chars[ (un24BitsData >> 6) & 63 ]; - pchEncodedData[3] = pszBase64Chars[ (un24BitsData ) & 63 ]; - pchEncodedData += 4; - cchEncodedData -= 4; - --nNextLineBreak; - } - - // Clean up remaining 1 or 2 bytes of input, pad output with '=' - if ( pubData != pubDataEnd ) - { - if ( cchEncodedData < 4 + unLineBreakLen ) - goto out_of_space; - - if ( nNextLineBreak == 0 ) - { - memcpy( pchEncodedData, pszLineBreak, unLineBreakLen ); - pchEncodedData += unLineBreakLen; - cchEncodedData -= unLineBreakLen; - } - - uint32 un24BitsData; - un24BitsData = (uint32) pubData[0] << 16; - if ( pubData+1 != pubDataEnd ) - { - un24BitsData |= (uint32) pubData[1] << 8; - } - pchEncodedData[0] = pszBase64Chars[ (un24BitsData >> 18) & 63 ]; - pchEncodedData[1] = pszBase64Chars[ (un24BitsData >> 12) & 63 ]; - pchEncodedData[2] = pubData+1 != pubDataEnd ? pszBase64Chars[ (un24BitsData >> 6) & 63 ] : '='; - pchEncodedData[3] = '='; - pchEncodedData += 4; - cchEncodedData -= 4; - } - - if ( unLineBreakLen ) - { - if ( cchEncodedData < unLineBreakLen ) - goto out_of_space; - memcpy( pchEncodedData, pszLineBreak, unLineBreakLen ); - pchEncodedData += unLineBreakLen; - cchEncodedData -= unLineBreakLen; - } - - *pchEncodedData = 0; - *pcchEncodedData = pchEncodedData - pchEncodedDataStart; - return true; - -out_of_space: - *pchEncodedData = 0; - *pcchEncodedData = Base64EncodeMaxOutput( cubData, pszLineBreak ); - //AssertMsg( false, "CCrypto::Base64Encode: insufficient output buffer (up to n*4/3+5 bytes required, plus linebreaks)" ); - return false; -} - - -//----------------------------------------------------------------------------- -// Purpose: Base64-decodes a block of data. (Text -> binary representation.) -// Input: pchData - Null-terminated hex-encoded string -// pubDecodedData - Pointer to buffer to store output in -// pcubDecodedData - Pointer to variable that contains size of -// output buffer. At exit, is filled in with actual size -// of decoded data. -// Note: if NULL is passed as the output buffer and *pcubDecodedData is zero, the function -// will calculate the actual required size and place it in *pcubDecodedData. A simpler upper -// bound on the required size is ( strlen(pchData)*3/4 + 1 ). -//----------------------------------------------------------------------------- -bool CCrypto::Base64Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters ) -{ - return Base64Decode( pchData, ~0u, pubDecodedData, pcubDecodedData, bIgnoreInvalidCharacters ); -} - -//----------------------------------------------------------------------------- -// Purpose: Base64-decodes a block of data. (Text -> binary representation.) -// Input: pchData - base64-encoded string, null terminated -// cchDataMax - maximum length of string unless a null is encountered first -// pubDecodedData - Pointer to buffer to store output in -// pcubDecodedData - Pointer to variable that contains size of -// output buffer. At exit, is filled in with actual size -// of decoded data. -// Note: if NULL is passed as the output buffer and *pcubDecodedData is zero, the function -// will calculate the actual required size and place it in *pcubDecodedData. A simpler upper -// bound on the required size is ( strlen(pchData)*3/4 + 2 ). -//----------------------------------------------------------------------------- -bool CCrypto::Base64Decode( const char *pchData, uint32 cchDataMax, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters ) -{ - //VPROF_BUDGET( "CCrypto::Base64Decode", VPROF_BUDGETGROUP_ENCRYPTION ); - - uint32 cubDecodedData = *pcubDecodedData; - uint32 cubDecodedDataOrig = cubDecodedData; - - if ( pubDecodedData == NULL ) - { - //AssertMsg( *pcubDecodedData == 0, "NULL output buffer with non-zero size passed to Base64Decode" ); - cubDecodedDataOrig = cubDecodedData = ~0u; - } - - // valid base64 character range: '+' (0x2B) to 'z' (0x7A) - // table entries are 0-63, -1 for invalid entries, -2 for '=' - static const char rgchInvBase64[] = { - 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51 - }; - COMPILE_TIME_ASSERT( Q_ARRAYSIZE(rgchInvBase64) == 0x7A - 0x2B + 1 ); - - uint32 un24BitsWithSentinel = 1; - while ( cchDataMax-- > 0 ) - { - char c = *pchData++; - - if ( (uint8)(c - 0x2B) >= Q_ARRAYSIZE( rgchInvBase64 ) ) - { - if ( c == '\0' ) - break; - - if ( !bIgnoreInvalidCharacters && !( c == '\r' || c == '\n' || c == '\t' || c == ' ' ) ) - goto decode_failed; - else - continue; - } - - c = rgchInvBase64[(uint8)(c - 0x2B)]; - if ( c < 0 ) - { - if ( c == -2 ) // -2 -> terminating '=' - break; - - if ( !bIgnoreInvalidCharacters ) - goto decode_failed; - else - continue; - } - - un24BitsWithSentinel <<= 6; - un24BitsWithSentinel |= c; - if ( un24BitsWithSentinel & (1<<24) ) - { - if ( cubDecodedData < 3 ) // out of space? go to final write logic - break; - if ( pubDecodedData ) - { - pubDecodedData[0] = (uint8)( un24BitsWithSentinel >> 16 ); - pubDecodedData[1] = (uint8)( un24BitsWithSentinel >> 8); - pubDecodedData[2] = (uint8)( un24BitsWithSentinel ); - pubDecodedData += 3; - } - cubDecodedData -= 3; - un24BitsWithSentinel = 1; - } - } - - // If un24BitsWithSentinel contains data, output the remaining full bytes - if ( un24BitsWithSentinel >= (1<<6) ) - { - // Possibilities are 3, 2, 1, or 0 full output bytes. - int nWriteBytes = 3; - while ( un24BitsWithSentinel < (1<<24) ) - { - nWriteBytes--; - un24BitsWithSentinel <<= 6; - } - - // Write completed bytes to output - while ( nWriteBytes-- > 0 ) - { - if ( cubDecodedData == 0 ) - { - //AssertMsg( false, "CCrypto::Base64Decode: insufficient output buffer (up to n*3/4+2 bytes required)" ); - goto decode_failed; - } - if ( pubDecodedData ) - { - *pubDecodedData++ = (uint8)(un24BitsWithSentinel >> 16); - } - --cubDecodedData; - un24BitsWithSentinel <<= 8; - } - } - - *pcubDecodedData = cubDecodedDataOrig - cubDecodedData; - return true; - -decode_failed: - *pcubDecodedData = cubDecodedDataOrig - cubDecodedData; - return false; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generate a SHA1 hash -// Input: pchInput - Plaintext string of item to hash (null terminated) -// pOutDigest - Pointer to receive hashed digest output -//----------------------------------------------------------------------------- -bool CCrypto::GenerateSHA1Digest( const uint8 *pubInput, const int cubInput, SHADigest_t *pOutDigest ) -{ - //VPROF_BUDGET( "CCrypto::GenerateSHA1Digest", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubInput ); - Assert( cubInput > 0 ); - Assert( pOutDigest ); - - bool bSuccess = true; - try - { - CryptoPP::SHA().CalculateDigest( *pOutDigest, pubInput, cubInput ); - } - catch(...) - { - bSuccess = false; - } - - return bSuccess; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generate a hash Salt - be careful, over-writing an existing salt -// will render the hashed value unverifiable. -//----------------------------------------------------------------------------- -bool CCrypto::GenerateSalt( Salt_t *pSalt ) -{ - //VPROF_BUDGET( "CCrypto::GenerateSalt", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pSalt ); - - bool bSuccess = true; - try - { - CPoolAllocatedRNG rng; - rng.GetRNG().GenerateBlock( (byte*)pSalt, sizeof(Salt_t) ); - } - catch(...) - { - bSuccess = false; - } - - return bSuccess; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generate a SHA1 hash using a salt. -// Input: pchInput - Plaintext string of item to hash (null terminated) -// pSalt - Salt -// pOutDigest - Pointer to receive salted digest output -//----------------------------------------------------------------------------- -bool CCrypto::GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSalt, SHADigest_t *pOutDigest ) -{ - //VPROF_BUDGET( "CCrypto::GenerateSaltedSHA1Digest", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pchInput ); - Assert( pSalt ); - Assert( pOutDigest ); - - int iInputLen = Q_strlen( pchInput ); - uint8 *pubSaltedInput = new uint8[ iInputLen + sizeof( Salt_t ) ]; - - // Insert half the salt before the input string and half at the end. - // This is probably unnecessary (to split the salt) but we're stuck with it for historical reasons. - uint8 *pubCursor = pubSaltedInput; - Q_memcpy( pubCursor, (uint8 *)pSalt, sizeof(Salt_t) / 2 ); - pubCursor += sizeof( Salt_t ) / 2; - Q_memcpy( pubCursor, pchInput, iInputLen ); - pubCursor += iInputLen; - Q_memcpy( pubCursor, (uint8 *)pSalt + sizeof(Salt_t) / 2, sizeof(Salt_t) / 2 ); - - bool bSuccess = true; - try - { - CryptoPP::SHA().CalculateDigest( *pOutDigest, pubSaltedInput, iInputLen + sizeof( Salt_t ) ); - } - catch(...) - { - bSuccess = false; - } - - delete [] pubSaltedInput; - - return bSuccess; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generates a random block of data -//----------------------------------------------------------------------------- -bool CCrypto::GenerateRandomBlock( uint8 *pubDest, int cubDest ) -{ - CPoolAllocatedRNG rng; - rng.GetRNG().GenerateBlock( pubDest, cubDest ); - - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generate a keyed-hash MAC using SHA1 -// Input: pubData - Plaintext data to digest -// cubData - length of data -// pubKey - key to use in HMAC -// cubKey - length of key -// pOutDigest - Pointer to receive hashed digest output -//----------------------------------------------------------------------------- -bool CCrypto::GenerateHMAC( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHADigest_t *pOutputDigest ) -{ - //VPROF_BUDGET( "CCrypto::GenerateHMAC", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( cubData > 0 ); - Assert( pubKey ); - Assert( cubKey > 0 ); - Assert( pOutputDigest ); - - bool bSuccess = true; - try - { - CryptoPP::HMAC< CryptoPP::SHA1 > hmac( pubKey, cubKey ); - hmac.CalculateDigest( *pOutputDigest, pubData, cubData ); - } - catch(...) - { - bSuccess = false; - } - - return bSuccess; -} - - -//----------------------------------------------------------------------------- -// Purpose: Generate a keyed-hash MAC using SHA-256 -//----------------------------------------------------------------------------- -bool CCrypto::GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest ) -{ - //VPROF_BUDGET( "CCrypto::GenerateHMAC256", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( cubData > 0 ); - Assert( pubKey ); - Assert( cubKey > 0 ); - Assert( pOutputDigest ); - - bool bSuccess = true; - try - { - CryptoPP::HMAC< CryptoPP::SHA256 > hmac( pubKey, cubKey ); - hmac.CalculateDigest( *pOutputDigest, pubData, cubData ); - } - catch(...) - { - bSuccess = false; - } - - return bSuccess; -} - - -bool CCrypto::BGzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ) -{ - bool bSuccess = true; - try - { - std::string gzip_output; - StringSource( (byte *)pubData, cubData, true, new Gzip( new StringSink( gzip_output ) ) ); - bufOutput.Set( (uint8*)gzip_output.c_str(), (uint32)gzip_output.length() ); - } - catch( ... ) - { - bSuccess = false; - } - return bSuccess; -} - - -bool CCrypto::BGunzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ) -{ - bool bSuccess = true; - try - { - std::string gunzip_output; - StringSource( (byte *)pubData, cubData, true, new Gunzip( new StringSink( gunzip_output ) ) ); - bufOutput.Set( (uint8*)gunzip_output.c_str(), (uint32)gunzip_output.length() ); - } - catch( ... ) - { - bSuccess = false; - } - return bSuccess; -} - - -//! These are all needed to get around stack-overflow bug in Initialize() -class HexDecoderTKS : public HexDecoder -{ -public: - HexDecoderTKS(BufferedTransformation *attachment, const int *pnDecodingArray) - : HexDecoder(attachment) - { - BaseN_Decoder::IsolatedInitialize( MakeParameters( Name::DecodingLookupArray(), pnDecodingArray )( Name::Log2Base(), 4 ) ); - } -}; - -class Base32DecoderTKS : public Base32Decoder -{ -public: - Base32DecoderTKS(BufferedTransformation *attachment, const int *pnDecodingArray) - : Base32Decoder(attachment) - { - BaseN_Decoder::IsolatedInitialize( MakeParameters( Name::DecodingLookupArray(), pnDecodingArray )( Name::Log2Base(), 5 ) ); - } -}; - - -//----------------------------------------------------------------------------- -// Purpose: Implement hex encoding / decoding using a custom lookup table. -// This is a class because the decoding is done via a generated -// reverse-lookup table, and to save time it's best to just create -// that table once. -//----------------------------------------------------------------------------- -CCustomHexEncoder::CCustomHexEncoder( const char *pchEncodingTable ) -{ - m_bValidEncoding = false; - if ( Q_strlen( pchEncodingTable ) == sizeof( m_rgubEncodingTable ) ) - { - Q_memcpy( m_rgubEncodingTable, pchEncodingTable, sizeof( m_rgubEncodingTable ) ); - - BaseN_Decoder::InitializeDecodingLookupArray( m_rgnDecodingTable, m_rgubEncodingTable, 16, false ); - m_bValidEncoding = true; - } - else - { - //AssertMsg( false, "CCrypto::CustomHexEncoder: Improper encoding table\n" ); - } -} - - -//----------------------------------------------------------------------------- -// Purpose: Destructor -//----------------------------------------------------------------------------- -CCustomHexEncoder::~CCustomHexEncoder() -{ -} - - -//----------------------------------------------------------------------------- -// Purpose: Hex-encodes a block of data. (Binary -> text representation.) The output -// is null-terminated and can be treated as a string. -// Uses the supplied custom encoding characters -// Input: pubData - Data to encode -// cubData - Size of data to encode -// pchEncodedData - Pointer to string buffer to store output in -// cchEncodedData - Size of pchEncodedData buffer -//----------------------------------------------------------------------------- -bool CCustomHexEncoder::Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ) -{ - //VPROF_BUDGET( "CCrypto::CustomHexEncode", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( cubData ); - Assert( pchEncodedData ); - Assert( cchEncodedData > 0 ); - - if ( !m_bValidEncoding ) - return false; - - ArraySink * pArraySinkOutput = new ArraySink( (byte *) pchEncodedData, cchEncodedData ); - // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs - HexEncoder hexEncoder( pArraySinkOutput ); - hexEncoder.IsolatedInitialize( MakeParameters( Name::EncodingLookupArray(), (const uint8 *)m_rgubEncodingTable ) ); - hexEncoder.Put( pubData, cubData ); - hexEncoder.MessageEnd(); - - uint32 len = pArraySinkOutput->TotalPutLength(); - pchEncodedData[len] = 0; // NULL-terminate - if ( len >= cchEncodedData ) - { - /*AssertMsg2( false, "CCrypto::CustomHexEncode: insufficient output buffer for encoding, needed %d got %d\n", - len, cchEncodedData );*/ - return false; - } - - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Hex-decodes a block of data. (Text -> binary representation.) -// With custom encoding-table -// Input: pchData - Null-terminated hex-encoded string -// pubDecodedData - Pointer to buffer to store output in -// pcubDecodedData - Pointer to variable that contains size of -// output buffer. At exit, is filled in with actual size -// of decoded data. -//----------------------------------------------------------------------------- -bool CCustomHexEncoder::Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ) -{ - //VPROF_BUDGET( "CCrypto::CustomHexDecode", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pchData ); - Assert( pubDecodedData ); - Assert( pcubDecodedData ); - Assert( *pcubDecodedData ); - - if ( !m_bValidEncoding ) - return false; - - ArraySink * pArraySinkOutput = new ArraySink( pubDecodedData, *pcubDecodedData ); - // Note: HexEncoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs - HexDecoderTKS hexDecoder( pArraySinkOutput, (const int *)m_rgnDecodingTable ); - hexDecoder.Put( (byte *) pchData, Q_strlen( pchData ) ); - hexDecoder.MessageEnd(); - - uint32 len = pArraySinkOutput->TotalPutLength(); - if ( len > *pcubDecodedData ) - { - /*AssertMsg2( false, "CCrypto::CustomHexDecode: insufficient output buffer for decoding, needed %d got %d\n", - len, *pcubDecodedData );*/ - return false; - } - *pcubDecodedData = len; - - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Implement hex encoding / decoding using a custom lookup table. -// This is a class because the decoding is done via a generated -// reverse-lookup table, and to save time it's best to just create -// that table once. -//----------------------------------------------------------------------------- -CCustomBase32Encoder::CCustomBase32Encoder( const char *pchEncodingTable ) -{ - m_bValidEncoding = false; - if ( Q_strlen( pchEncodingTable ) == sizeof( m_rgubEncodingTable ) ) - { - Q_memcpy( m_rgubEncodingTable, pchEncodingTable, sizeof( m_rgubEncodingTable ) ); - - BaseN_Decoder::InitializeDecodingLookupArray( m_rgnDecodingTable, m_rgubEncodingTable, 32, false ); - m_bValidEncoding = true; - } - else - { - //AssertMsg( false, "CCrypto::CustomBase32Encoder: Improper encoding table\n" ); - } -} - - -//----------------------------------------------------------------------------- -// Purpose: Destructor -//----------------------------------------------------------------------------- -CCustomBase32Encoder::~CCustomBase32Encoder() -{ -} - - -//----------------------------------------------------------------------------- -// Purpose: Base32-encodes a block of data. (Binary -> text representation.) The output -// is null-terminated and can be treated as a string. -// Uses the supplied custom encoding table -// Input: pubData - Data to encode -// cubData - Size of data to encode -// pchEncodedData - Pointer to string buffer to store output in -// cchEncodedData - Size of pchEncodedData buffer -//----------------------------------------------------------------------------- -bool CCustomBase32Encoder::Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ) -{ - //VPROF_BUDGET( "CCrypto::CustomBase32Encode", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pubData ); - Assert( cubData ); - Assert( pchEncodedData ); - Assert( cchEncodedData > 0 ); - - if ( !m_bValidEncoding ) - return false; - - ArraySink * pArraySinkOutput = new ArraySink( (byte *) pchEncodedData, cchEncodedData ); - // Note: Base32Encoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs - Base32Encoder base32Encoder( pArraySinkOutput ); - base32Encoder.IsolatedInitialize( MakeParameters( Name::EncodingLookupArray(), (const uint8 *)m_rgubEncodingTable ) ); - base32Encoder.Put( pubData, cubData ); - base32Encoder.MessageEnd(); - - uint32 len = pArraySinkOutput->TotalPutLength(); - pchEncodedData[len] = 0; // NULL-terminate - if ( len >= cchEncodedData ) - { - /*AssertMsg2( false, "CCrypto::CustomBase32Encode: insufficient output buffer for encoding, needed %d got %d\n", - len, cchEncodedData );*/ - return false; - } - - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Base32-decodes a block of data. (Text -> binary representation.) -// With custom encoding table -// Input: pchData - Null-terminated hex-encoded string -// pubDecodedData - Pointer to buffer to store output in -// pcubDecodedData - Pointer to variable that contains size of -// output buffer. At exit, is filled in with actual size -// of decoded data. -//----------------------------------------------------------------------------- -bool CCustomBase32Encoder::Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ) -{ - //VPROF_BUDGET( "CCrypto::CustomBase32Decode", VPROF_BUDGETGROUP_ENCRYPTION ); - Assert( pchData ); - Assert( pubDecodedData ); - Assert( pcubDecodedData ); - Assert( *pcubDecodedData ); - - if ( !m_bValidEncoding ) - return false; - - ArraySink * pArraySinkOutput = new ArraySink( pubDecodedData, *pcubDecodedData ); - // Note: Base32Encoder now owns the pointer to pOutputSink and will free it when the encoder goes out of scope and destructs - Base32DecoderTKS base32Decoder( pArraySinkOutput, (const int *)m_rgnDecodingTable ); - base32Decoder.Put( (byte *) pchData, Q_strlen( pchData ) ); - base32Decoder.MessageEnd(); - - uint32 len = pArraySinkOutput->TotalPutLength(); - if ( len > *pcubDecodedData ) - { - /*AssertMsg2( false, "CCrypto::CustomBase32Decode: insufficient output buffer for decoding, needed %d got %d\n", - len, *pcubDecodedData );*/ - return false; - } - *pcubDecodedData = len; - - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Base32-encodes a block of data. (Binary -> text representation.) The output -// is null-terminated and can be treated as a string. -// Uses the supplied custom encoding table, and a bit-stream input source -// (not necessarily an integer number of bytes). -// Input: pBitStringData - Data to encode -// pchEncodedData - Pointer to string buffer to store output in -// cchEncodedData - Size of pchEncodedData buffer -//----------------------------------------------------------------------------- -bool CCustomBase32Encoder::Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, uint32 cchEncodedData ) -{ - // This is useful if you have, say, 125 bits of information and - // want to encode them into 25 base32-encoded characters. - uint32 cBits = pBitStringData->GetCurrNumBits(); - - uint32 cCharacters = (cBits / 5); - uint32 cBitsRemainder = cBits % 5; - if ( cBitsRemainder ) - cCharacters++; - - // GTE because of NULL - if ( cCharacters >= cchEncodedData ) - return false; - - CSimpleBitString::iterator itBitString( *pBitStringData ); - uint ich = 0; - for ( ; ich < cCharacters; ++ich ) - { - uint32 unCodon = itBitString.GetNextBits( 5 ); - // Pad w/ zero bits to integer num codons - if ( ich == (cCharacters - 1) ) - unCodon <<= cBitsRemainder; - - pchEncodedData[ich] = m_rgubEncodingTable[ unCodon ]; - } - - // NULL - pchEncodedData[ich] = 0; - - return true; -} - - -//----------------------------------------------------------------------------- -// Purpose: Base32-decodes a block of data. (Text -> binary representation.) -// With custom encoding table, and a BitString output -// Input: pchData - Null-terminated base32-encoded string -// pBitStringDecodedData - Pointer to BitString to receive decoded data -//----------------------------------------------------------------------------- -bool CCustomBase32Encoder::Decode( const char *pchData, CSimpleBitString *pBitStringDecodedData ) -{ - // Note: 25 base32-encoded characters contain 125 bits of information. - // Decoded into a byte buffer, this yields 15 bytes plus 5 bits of padding. - // Decoded into a CSimpleBitString, it will yield all 125 bits - while ( *pchData ) - { - uint32 unData = m_rgnDecodingTable[(unsigned)*pchData++]; - if ( unData == 0xFFFFFFFF ) - return false; - - pBitStringDecodedData->AppendBits( unData, 5 ); - } - - return true; -} - -#ifdef DBGFLAG_VALIDATE -//----------------------------------------------------------------------------- -// Purpose: validates memory structures -//----------------------------------------------------------------------------- -void CCrypto::ValidateStatics( CValidator &validator, const char *pchName ) -{ - ValidateObj( g_tslistPAutoSeededRNG ); -} -#endif // DBGFLAG_VALIDATE - - -//----------------------------------------------------------------------------- -// Purpose: Given a plaintext password, check whether it matches an existing -// hash -//----------------------------------------------------------------------------- -bool CCrypto::BValidatePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const PasswordHash_t &DigestStored, const Salt_t &Salt, PasswordHash_t *pDigestComputed ) -{ - //VPROF_BUDGET( "CCrypto::BValidatePasswordHash", VPROF_BUDGETGROUP_ENCRYPTION ); - - bool bResult = false; - size_t cDigest = k_HashLengths[hashType]; - Assert( cDigest != 0 ); - PasswordHash_t tmpDigest; - PasswordHash_t *pOutputDigest = pDigestComputed; - if ( pOutputDigest == NULL ) - { - pOutputDigest = &tmpDigest; - } - - BGeneratePasswordHash( pchInput, hashType, Salt, *pOutputDigest ); - bResult = ( 0 == Q_memcmp( &DigestStored, pOutputDigest, cDigest ) ); - - return bResult; -} - -//----------------------------------------------------------------------------- -// Purpose: Given a plaintext password and salt, generate a password hash of -// the requested type. -//----------------------------------------------------------------------------- -bool CCrypto::BGeneratePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const Salt_t &Salt, PasswordHash_t &OutPasswordHash ) -{ - //VPROF_BUDGET( "CCrypto::BGeneratePasswordHash", VPROF_BUDGETGROUP_ENCRYPTION ); - - bool bResult = false; - size_t cDigest = k_HashLengths[hashType]; - - switch ( hashType ) - { - case k_EHashSHA1: - bResult = CCrypto::GenerateSaltedSHA1Digest( pchInput, &Salt, (SHADigest_t *)&OutPasswordHash.sha ); - break; - case k_EHashBigPassword: - { - // - // This is a fake algorithm to test widening of the column. It's a salted SHA-1 hash with 0x01 padding - // on either side of it. - // - size_t cDigestSHA1 = k_HashLengths[k_EHashSHA1]; - size_t cPadding = ( cDigest - cDigestSHA1 ) / 2; - - //AssertMsg( ( ( cDigest - cDigestSHA1 ) % 2 ) == 0, "Invalid hash width for k_EHashBigPassword, needs to be even." ); - - CCrypto::GenerateSaltedSHA1Digest( pchInput, &Salt, (SHADigest_t *)( (uint8 *)&OutPasswordHash.bigpassword + cPadding ) ); - Q_memset( (uint8 *)&OutPasswordHash, 0x01, cPadding ); - Q_memset( (uint8 *)&OutPasswordHash + cPadding + cDigestSHA1 , 0x01, cPadding ); - bResult = true; - break; - } - case k_EHashPBKDF2_1000: - bResult = CCrypto::BGeneratePBKDF2Hash( pchInput, Salt, 1000, OutPasswordHash ); - break; - case k_EHashPBKDF2_5000: - bResult = CCrypto::BGeneratePBKDF2Hash( pchInput, Salt, 5000, OutPasswordHash ); - break; - case k_EHashPBKDF2_10000: - bResult = CCrypto::BGeneratePBKDF2Hash( pchInput, Salt, 10000, OutPasswordHash ); - break; - case k_EHashSHA1WrappedWithPBKDF2_10000: - bResult = CCrypto::BGenerateWrappedSHA1PasswordHash( pchInput, Salt, 10000, OutPasswordHash ); - break; - default: - //AssertMsg1( false, "Invalid password hash type %u passed to BGeneratePasswordHash\n", hashType ); - bResult = false; - } - - return bResult; -} - -//----------------------------------------------------------------------------- -// Purpose: Given a plaintext password and salt and a count of rounds, generate a PBKDF2 hash -// with the requested number of rounds. -//----------------------------------------------------------------------------- -bool CCrypto::BGeneratePBKDF2Hash( const char* pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ) -{ - PKCS5_PBKDF2_HMAC pbkdf; - - unsigned int iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)pchInput, Q_strlen(pchInput), (const byte *)&Salt, sizeof(Salt), rounds ); - - return ( iterations == rounds ); -} - - -//----------------------------------------------------------------------------- -// Purpose: Given a plaintext password and salt and a count of rounds, generate a SHA1 hash wrapped with -// a PBKDF2 hash with the specified number of rounds. -// Used to provide a stronger password hash for accounts that haven't logged in in a while. -//----------------------------------------------------------------------------- -bool CCrypto::BGenerateWrappedSHA1PasswordHash( const char *pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ) -{ - bool bResult; - bResult = CCrypto::GenerateSaltedSHA1Digest( pchInput, &Salt, (SHADigest_t *)&OutPasswordHash.sha ); - if ( bResult ) - { - PKCS5_PBKDF2_HMAC pbkdf; - unsigned int iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)&OutPasswordHash.sha, sizeof(OutPasswordHash.sha), (const byte *)&Salt, sizeof(Salt), rounds ); - - bResult = ( iterations == rounds ); - } - return bResult; -} - -//----------------------------------------------------------------------------- -// Purpose: Given an existing password hash and salt, attempt to construct a stronger -// password hash and return the new hash type. -// -// Currently the only transformation available is from a SHA1 (or BigPassword) -// hash to a PBKDF2 hash with 10,000 rounds. In the future this function -// may be extended to allow additional transformations. -//----------------------------------------------------------------------------- -bool CCrypto::BUpgradeOrWrapPasswordHash( PasswordHash_t &InPasswordHash, EPasswordHashAlg hashTypeIn, const Salt_t &Salt, PasswordHash_t &OutPasswordHash, EPasswordHashAlg &hashTypeOut ) -{ - bool bResult = true;; - - if ( hashTypeIn == k_EHashSHA1 || hashTypeIn == k_EHashBigPassword ) - { - // - // Can wrap a SHA1 hash with any PBKDF variant, but right now only 10,000 rounds is - // implemented. - // - if ( hashTypeOut == k_EHashPBKDF2_10000 ) - { - hashTypeOut = k_EHashSHA1WrappedWithPBKDF2_10000; - - byte * pbHash; - if ( hashTypeIn == k_EHashSHA1 ) - { - pbHash = (byte *)&InPasswordHash.sha; - } - else - { - // - // Need to unroll BigPasswordHash into unpadded SHA1 - // - size_t cDigest = k_HashLengths[k_EHashBigPassword]; - size_t cDigestSHA1 = k_HashLengths[k_EHashSHA1]; - size_t cPadding = ( cDigest - cDigestSHA1 ) / 2; - - AssertMsg( ( ( cDigest - cDigestSHA1 ) % 2 ) == 0, "Invalid hash width for k_EHashBigPassword, needs to be even." ); - pbHash = (byte *)&InPasswordHash.sha + cPadding; - } - - PKCS5_PBKDF2_HMAC pbkdf; - PasswordHash_t passOut; - unsigned int iterations = pbkdf.DeriveKey( (byte *)passOut.pbkdf2, sizeof(passOut.pbkdf2), 0, pbHash, k_HashLengths[k_EHashSHA1], (const byte *)&Salt, sizeof(Salt), 10000 ); - - bResult = ( iterations == 10000 ); - if ( bResult ) - { - Q_memcpy( &OutPasswordHash, &passOut, sizeof(OutPasswordHash) ); - } - } - else - { - Assert( hashTypeOut == k_EHashPBKDF2_10000 ); - bResult = false; - } - } - else - { - bResult = false; - Assert( false ); - } - - return bResult; -} - diff --git a/common/crypto.h b/common/crypto.h deleted file mode 100644 index 80b25b2c9..000000000 --- a/common/crypto.h +++ /dev/null @@ -1,281 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: This module is for wrapping Crypto++ functions, including crypto++ -// directly has nasty consequences polluting the global namespace, and -// conflicting with xdebug and locale stuff, so we only include it here -// and use this wrapper in the rest of our code. -// -// $NoKeywords: $ -//============================================================================= - -#ifndef CRYPTO_H -#define CRYPTO_H - -#include // for Assert & AssertMsg -#include "tier1/passwordhash.h" -#include "tier1/utlmemory.h" -#include // for Salt_t - -extern void FreeListRNG(); - -const unsigned int k_cubSHA256Hash = 32; -typedef unsigned char SHA256Digest_t[ k_cubSHA256Hash ]; - -const int k_nSymmetricBlockSize = 16; // AES block size (128 bits) -const int k_nSymmetricKeyLen = 32; // length in bytes of keys used for symmetric encryption - -const int k_nRSAKeyLenMax = 1024; // max length in bytes of keys used for RSA encryption (includes DER encoding) -const int k_nRSAKeyLenMaxEncoded = k_nRSAKeyLenMax*2; // max length in bytes of hex-encoded key (hex encoding exactly doubles size) -const int k_nRSAKeyBits = 1024; // length in bits of keys used for RSA encryption -const int k_cubRSAEncryptedBlockSize = 128; -const int k_cubRSAPlaintextBlockSize = 86 + 1; // assume plaintext is text, so add a byte for the trailing \0 -const uint32 k_cubRSASignature = k_cubRSAEncryptedBlockSize; - -// Simple buffer class to encapsulate output from crypto functions with unknown output size -class CCryptoOutBuffer -{ -public: - - CCryptoOutBuffer() - { - m_pubData = NULL; - m_cubData = 0; - } - - ~CCryptoOutBuffer() - { - if ( m_pubData ) - delete[] m_pubData; - m_pubData = NULL; - m_cubData = 0; - } - - void Set( uint8 *pubData, uint32 cubData ) - { - if ( !pubData || !cubData ) - return; - - if ( m_pubData ) - delete[] m_pubData; - - m_pubData = new uint8[ cubData ]; - memcpy( m_pubData, pubData, cubData ); - m_cubData = cubData; - } - - void Allocate( uint32 cubData ) - { - if ( m_pubData ) - delete[] m_pubData; - - m_pubData = new uint8[ cubData ]; - m_cubData = cubData; - } - - void Trim( uint32 cubTrim ) - { - Assert( cubTrim <= m_cubData ); - m_cubData = cubTrim; - } - - uint8 *PubData() { return m_pubData; } - uint32 CubData() { return m_cubData; } - -private: - uint8 *m_pubData; - uint32 m_cubData; -}; - -#if !defined(_PS3) -class CCrypto -{ -public: - static uint32 GetSymmetricEncryptedSize( uint32 cubPlaintextData ); - - // this method writes the encrypted IV, then the ciphertext - static bool SymmetricEncryptWithIV( const uint8 * pubPlaintextData, uint32 cubPlaintextData, - const uint8 * pIV, uint32 cubIV, - uint8 * pubEncryptedData, uint32 * pcubEncryptedData, - const uint8 * pubKey, uint32 cubKey ); - static bool SymmetricEncrypt( const uint8 * pubPlaintextData, uint32 cubPlaintextData, - uint8 * pubEncryptedData, uint32 * pcubEncryptedData, - const uint8 * pubKey, uint32 cubKey ); - // this method assumes there is no IV before the payload - dissimilar to SymmetricEncryptWithIV - static bool SymmetricDecryptWithIV( const uint8 * pubEncryptedData, uint32 cubEncryptedData, - const uint8 * pIV, uint32 cubIV, - uint8 * pubPlaintextData, uint32 * pcubPlaintextData, - const uint8 * pubKey, uint32 cubKey ); - static bool SymmetricDecrypt( const uint8 * pubEncryptedData, uint32 cubEncryptedData, - uint8 * pubPlaintextData, uint32 * pcubPlaintextData, - const uint8 * pubKey, uint32 cubKey ); - - // symmetrically encrypt data with a text password. A SHA256 hash of the password - // is used as an AES encryption key (calls SymmetricEncrypt, above). - // An HMAC of the ciphertext is appended, for authentication. - static bool EncryptWithPasswordAndHMAC( const uint8 *pubPlaintextData, uint32 cubPlaintextData, - uint8 * pubEncryptedData, uint32 * pcubEncryptedData, - const char *pchPassword ); - - // Same as above but uses an explicit IV. The format of the ciphertext is the same. - // Be sure you know what you're doing if you use this - a random IV is much more secure in general! - static bool EncryptWithPasswordAndHMACWithIV( const uint8 *pubPlaintextData, uint32 cubPlaintextData, - const uint8 * pIV, uint32 cubIV, - uint8 * pubEncryptedData, uint32 * pcubEncryptedData, - const char *pchPassword ); - - // Symmetrically decrypt data with the given password (see above). - // If the HMAC does not match what we expect, then we know that either the password is - // incorrect or the message is corrupted. - static bool DecryptWithPasswordAndAuthenticate( const uint8 * pubEncryptedData, uint32 cubEncryptedData, - uint8 * pubPlaintextData, uint32 * pcubPlaintextData, - const char *pchPassword ); - - static bool RSAGenerateKeys( uint8 *pubPublicKey, uint32 *pcubPublicKey, uint8 *pubPrivateKey, uint32 *pcubPrivateKey ); - - static bool RSAEncrypt( const uint8 *pubPlaintextPlaintextData, const uint32 cubData, uint8 *pubEncryptedData, - uint32 *pcubEncryptedData, const uint8 *pubPublicKey, const uint32 cubPublicKey ); - static bool RSADecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPrivateKey, const uint32 cubPrivateKey ); - - // decrypt using a public key, and no padding - static bool RSAPublicDecrypt_NoPadding( const uint8 *pubEncryptedData, uint32 cubEncryptedData, - uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPublicKey, const uint32 cubPublicKey ); - - static bool RSASign( const uint8 *pubData, const uint32 cubData, - uint8 *pubSignature, uint32 *pcubSignature, - const uint8 * pubPrivateKey, const uint32 cubPrivateKey ); - static bool RSAVerifySignature( const uint8 *pubData, const uint32 cubData, - const uint8 *pubSignature, const uint32 cubSignature, - const uint8 *pubPublicKey, const uint32 cubPublicKey ); - - static bool RSASignSHA256( const uint8 *pubData, const uint32 cubData, - uint8 *pubSignature, uint32 *pcubSignature, - const uint8 * pubPrivateKey, const uint32 cubPrivateKey ); - static bool RSAVerifySignatureSHA256( const uint8 *pubData, const uint32 cubData, - const uint8 *pubSignature, const uint32 cubSignature, - const uint8 *pubPublicKey, const uint32 cubPublicKey ); - - static bool HexEncode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); - static bool HexDecode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); - - static uint32 Base64EncodeMaxOutput( uint32 cubData, const char *pszLineBreakOrNull ); - static bool Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32 cchEncodedData, bool bInsertLineBreaks = true ); // legacy, deprecated - static bool Base64Encode( const uint8 *pubData, uint32 cubData, char *pchEncodedData, uint32 *pcchEncodedData, const char *pszLineBreak = "\n" ); - - static uint32 Base64DecodeMaxOutput( uint32 cubData ) { return ( (cubData + 3 ) / 4) * 3 + 1; } - static bool Base64Decode( const char *pchEncodedData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters = true ); // legacy, deprecated - static bool Base64Decode( const char *pchEncodedData, uint32 cchEncodedData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters = true ); - - static bool GenerateSalt( Salt_t *pSalt ); - static bool GenerateSHA1Digest( const uint8 *pubInput, const int cubInput, SHADigest_t *pOutDigest ); - static bool GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSalt, SHADigest_t *pOutDigest ); - static bool GenerateRandomBlock( uint8 *pubDest, int cubDest ); - - static bool GenerateHMAC( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHADigest_t *pOutputDigest ); - static bool GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest ); - - static bool BGeneratePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const Salt_t &Salt, PasswordHash_t &OutPasswordHash ); - static bool BValidatePasswordHash( const char *pchInput, EPasswordHashAlg hashType, const PasswordHash_t &DigestStored, const Salt_t &Salt, PasswordHash_t *pDigestComputed ); - static bool BGeneratePBKDF2Hash( const char *pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ); - static bool BGenerateWrappedSHA1PasswordHash( const char *pchInput, const Salt_t &Salt, unsigned int rounds, PasswordHash_t &OutPasswordHash ); - static bool BUpgradeOrWrapPasswordHash( PasswordHash_t &InPasswordHash, EPasswordHashAlg hashTypeIn, const Salt_t &Salt, PasswordHash_t &OutPasswordHash, EPasswordHashAlg &hashTypeOut ); - - static bool BGzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); - static bool BGunzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); - -#ifdef DBGFLAG_VALIDATE - static void ValidateStatics( CValidator &validator, const char *pchName ); -#endif -}; - -#else - -// bugbug ps3 - stub until we implement from PS3 libs -class CCrypto -{ -public: - // ps3 only - static bool Init(); - static void Shutdown(); - - //shared - static uint32 GetSymmetricEncryptedSize( uint32 cubPlaintextData ); - - static bool SymmetricEncrypt( const uint8 * pubPlaintextData, uint32 cubPlaintextData, uint8 * pubEncryptedData, uint32 * pcubEncryptedData, const uint8 * pubKey, uint32 cubKey ); - static bool SymmetricDecrypt( const uint8 * pubEncryptedData, uint32 cubEncryptedData, uint8 * pubPlaintextData, uint32 * pcubPlaintextData, const uint8 * pubKey, uint32 cubKey ); - static bool RSAGenerateKeys( uint8 *pubPublicKey, uint32 *pcubPublicKey, uint8 *pubPrivateKey, uint32 *pcubPrivateKey ) { AssertMsg( false, "RSAGenerateKeys not implemented on PS3" ); return false; } - static bool RSAEncrypt( const uint8 *pubPlaintextPlaintextData, const uint32 cubData, uint8 *pubEncryptedData, uint32 *pcubEncryptedData, const uint8 *pubPublicKey, const uint32 cubPublicKey ); - static bool RSADecrypt( const uint8 *pubEncryptedData, uint32 cubEncryptedData, uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPrivateKey, const uint32 cubPrivateKey ); - static bool RSAPublicDecrypt_NoPadding( const uint8 *pubEncryptedData, uint32 cubEncryptedData, uint8 *pubPlaintextData, uint32 *pcubPlaintextData, const uint8 *pubPublicKey, const uint32 cubPublicKey ) { AssertMsg( false, "RSAPublicDecrypt_NoPadding not implemented on PS3" ); return false; } - static bool RSASign( const uint8 *pubData, const uint32 cubData, uint8 *pubSignature, uint32 *pcubSignature, const uint8 * pubPrivateKey, const uint32 cubPrivateKey ); - static bool RSAVerifySignature( const uint8 *pubData, const uint32 cubData, const uint8 *pubSignature, const uint32 cubSignature, const uint8 *pubPublicKey, const uint32 cubPublicKey ); - static bool HexEncode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); - static bool HexDecode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); - static bool Base64Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData, bool bInsertLineBreaks = true ) { AssertMsg( false, "Base64Encode not implemented on PS3" ); return false; } // cellHttpUtilBase64Encoder() - static bool Base64Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData, bool bIgnoreInvalidCharacters = true ) { AssertMsg( false, "Base64Decode not implemented on PS3" ); return false; } // cellHttpUtilBase64Decoder() - static bool GenerateSalt( Salt_t *pSalt ); - static bool GenerateSHA1Digest( const uint8 *pubInput, const int cubInput, SHADigest_t *pOutDigest ); - static bool GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSalt, SHADigest_t *pOutDigest ) { AssertMsg( false, "GenerateSaltedSHA1Digest not implemented on PS3" ); return false; } - static bool GenerateRandomBlock( uint8 *pubDest, int cubDest ); - static bool GenerateHMAC( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHADigest_t *pOutputDigest ) { AssertMsg( false, "GenerateHMAC not implemented on PS3" ); return false; } - static bool GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest ) { AssertMsg( false, "GenerateHMAC256 not implemented on PS3" ); return false; } - static bool BGzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); - static bool BGunzipBuffer( const uint8 *pubData, uint32 cubData, CCryptoOutBuffer &bufOutput ); - -#ifdef DBGFLAG_VALIDATE - static void ValidateStatics( CValidator &validator, const char *pchName ); -#endif -}; - - -#endif //!_PS3 - - -class CSimpleBitString; - -//----------------------------------------------------------------------------- -// Purpose: Implement hex encoding / decoding using a custom lookup table. -// This is a class because the decoding is done via a generated -// reverse-lookup table, and to save time it's best to just create -// that table once. -//----------------------------------------------------------------------------- -class CCustomHexEncoder -{ -public: - CCustomHexEncoder( const char *pchEncodingTable ); - ~CCustomHexEncoder(); - - bool Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); - bool Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); - -private: - bool m_bValidEncoding; - uint8 m_rgubEncodingTable[16]; - int m_rgnDecodingTable[256]; -}; - -//----------------------------------------------------------------------------- -// Purpose: Implement base32 encoding / decoding using a custom lookup table. -// This is a class because the decoding is done via a generated -// reverse-lookup table, and to save time it's best to just create -// that table once. -//----------------------------------------------------------------------------- -class CCustomBase32Encoder -{ -public: - CCustomBase32Encoder( const char *pchEncodingTable ); - ~CCustomBase32Encoder(); - - bool Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData ); - bool Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData ); - - bool Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, uint32 cchEncodedData ); - bool Decode( const char *pchData, CSimpleBitString *pBitStringDecodedData ); - -private: - bool m_bValidEncoding; - uint8 m_rgubEncodingTable[32]; - int m_rgnDecodingTable[256]; -}; - -#endif // CRYPTO_H diff --git a/common/simplebitstring.cpp b/common/simplebitstring.cpp deleted file mode 100644 index e8a568425..000000000 --- a/common/simplebitstring.cpp +++ /dev/null @@ -1,234 +0,0 @@ - -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// The copyright to the contents herein is the property of Valve, L.L.C. -// The contents may be used and/or copied only with the written permission of -// Valve, L.L.C., or in accordance with the terms and conditions stipulated in -// the agreement/contract under which the contents have been supplied. -// -//***************************************************************************** -// -// Contents: -// -// CSimpleBitString -// -// Authors: chrisn -// -// Target restrictions: -// -// Tool restrictions: -// -// Things to do: -// -//***************************************************************************** - - -//***************************************************************************** -// -// Include files required to build and use this module. -// -//***************************************************************************** - -// Precompiled header (must come first - includes project common headers) -//#include "stdafx.h" -#include "tier0/platform.h" -#include "tier1/utlvector.h" -#include "simplebitstring.h" - - - -//***************************************************************************** -// -// Class definitions: -// -//***************************************************************************** - -// -// class CSimpleBitString::iterator -// - - -//----------------------------------------------------------------------------- -// -// Function: -// -//----------------------------------------------------------------------------- -void CSimpleBitString::AppendBits( uint64 u64Data, uint32 NumSignificantLowBitsOfData ) -{ - Assert - ( - NumSignificantLowBitsOfData <= 64 - ); - - while ( NumSignificantLowBitsOfData > 0 ) - { - // Clear top bits of data - if ( NumSignificantLowBitsOfData < 64 ) - u64Data &= ( (1ULL << NumSignificantLowBitsOfData) - 1 ); // will fail for 64 bits - - uint32 Idx = m_uNumBits / 8; - uint32 NumUsedBitsInLastByte = m_uNumBits % 8; - - uint32 NumAvailableBitsInLastByte = 8 - NumUsedBitsInLastByte; - - uint32 NumBitsToPutInThisByte - = min( NumAvailableBitsInLastByte, NumSignificantLowBitsOfData ); - - uint8 BitsForThisByte - = ( u64Data >> (NumSignificantLowBitsOfData - NumBitsToPutInThisByte) ) - & ( (1ULL << NumBitsToPutInThisByte) - 1 ); - - m_vecU8[Idx] |= ( BitsForThisByte - << ( NumAvailableBitsInLastByte - NumBitsToPutInThisByte ) ); - - m_uNumBits += NumBitsToPutInThisByte; - - NumAvailableBitsInLastByte -= NumBitsToPutInThisByte; - if ( NumAvailableBitsInLastByte == 0 ) - { - m_vecU8[ m_vecU8.AddToTail() ] = 0x00; - } - - // We've used the top N bits of data - NumSignificantLowBitsOfData -= NumBitsToPutInThisByte; - } -} - - -//----------------------------------------------------------------------------- -// -// Function: -// -//----------------------------------------------------------------------------- -void CSimpleBitString::AppendBits( const uint8 * pData, uint32 NumBitsOfData ) -{ - Assert( pData ); - - uint32 NumBytes = NumBitsOfData / 8; - for ( uint32 i = 0; i < NumBytes; ++i ) - { - AppendBits( *(pData++), 8 ); - } - uint32 NumTailBits = NumBitsOfData % 8; - AppendBits( (*pData) >> (8U - NumTailBits), NumTailBits ); -} - - - -//----------------------------------------------------------------------------- -// -// Function: -// -//----------------------------------------------------------------------------- -void CSimpleBitString::ReversiblyObfusticateBitsFromStart( uint NumBits, const uint8 * pObfusticationData, size_t uSizeOfObfusticationData ) -{ - Assert( pObfusticationData ); - - if ( NumBits > m_uNumBits - || NumBits > uSizeOfObfusticationData * 8 - ) - { - //AssertMsg( false, "ReversiblyObfusticateBitsFromStart(): Bad NumBits" ); - return; // bugbug taylor bool return - } - - uint8 * pBits = & m_vecU8[0]; - - uint NumBytes = NumBits / 8; - for ( uint i = 0; i < NumBytes; ++i ) - { - *(pBits++) ^= *(pObfusticationData++); - } - uint NumTailBits = NumBits % 8; - if ( NumTailBits > 0 ) - { - *pBits ^= ( *(pObfusticationData++) & (((1U << NumTailBits) - 1) << (8U - NumTailBits) ) ); - } -} - - -//----------------------------------------------------------------------------- -// -// Function: -// -//----------------------------------------------------------------------------- -uint8 CSimpleBitString::GetByteChecksumFromStart( uint NumBits ) const -{ - if ( NumBits > m_uNumBits ) - { - //AssertMsg( false, "GenerateByteChecksumFromStart(): Bad NumBits" ); - return 0; - } - - uint8 u8Checksum = 0; - const uint8 * pBits = & m_vecU8[0]; - - uint NumBytes = NumBits / 8; - for ( uint i = 0; i < NumBytes; ++i ) - { - u8Checksum += *(pBits++); - } - uint NumTailBits = NumBits % 8; - if ( NumTailBits > 0 ) - { - u8Checksum += ( *(pBits) & (((1U << NumTailBits) - 1) << (8U - NumTailBits) ) ); - } - - return u8Checksum; -} - - - -// -// class CSimpleBitString::iterator -// -uint32 CSimpleBitString::iterator::GetNextBits( uint32 NumBitsToGet ) -{ - Assert - ( - NumBitsToGet <= 32 - ); - - return static_cast( GetNextBits64( NumBitsToGet ) ); -} - -uint64 CSimpleBitString::iterator::GetNextBits64( uint32 NumBitsToGet ) -{ - Assert - ( - NumBitsToGet <= 64 - ); - - if ( m_uNextBitIdx + NumBitsToGet > m_rSimpleBitString.m_uNumBits ) - { - //AssertMsg( false, "Not enough bits in CSimpleBitString" ); - return 0; - } - - uint64 u64Data = 0; - - while ( NumBitsToGet > 0 ) - { - uint32 Idx = m_uNextBitIdx / 8; - Assert( Idx < (uint32)m_rSimpleBitString.m_vecU8.Count() ); - - uint32 NumConsumedBitsInThisByte = m_uNextBitIdx % 8; - uint32 NumAvailableBitsInThisByte = 8 - NumConsumedBitsInThisByte; - - uint32 NumBitsToGetFromThisByte - = min( NumAvailableBitsInThisByte, NumBitsToGet ); - - uint8 BitsFromThisByte - = ( m_rSimpleBitString.m_vecU8[Idx] >> (NumAvailableBitsInThisByte - NumBitsToGetFromThisByte) ) - & ( (1UL << NumBitsToGetFromThisByte) - 1 ); - - u64Data <<= NumBitsToGetFromThisByte; - u64Data |= BitsFromThisByte; - - m_uNextBitIdx += NumBitsToGetFromThisByte; - NumBitsToGet -= NumBitsToGetFromThisByte; - } - - return u64Data; -} - diff --git a/common/simplebitstring.h b/common/simplebitstring.h deleted file mode 100644 index 7d42d67ce..000000000 --- a/common/simplebitstring.h +++ /dev/null @@ -1,159 +0,0 @@ - -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// The copyright to the contents herein is the property of Valve, L.L.C. -// The contents may be used and/or copied only with the written permission of -// Valve, L.L.C., or in accordance with the terms and conditions stipulated in -// the agreement/contract under which the contents have been supplied. -// -//***************************************************************************** -// -// Contents: -// -// CSimpleBitString -// -// Authors: -// -// Target restrictions: -// -// Tool restrictions: -// -// Things to do: -// -// -// -//***************************************************************************** - -#ifndef INCLUDED_COMMON_SIMPLEBITSTRING_H -#define INCLUDED_COMMON_SIMPLEBITSTRING_H - -#if defined(_MSC_VER) && (_MSC_VER > 1000) -#pragma once -#endif - - -//***************************************************************************** -// -// Include files required by this header. -// -// Note: Do NOT place any 'using' directives or declarations in header files - -// put them at the top of the source files that require them. -// Use fully-qualified names in header files. -// -//***************************************************************************** - -// All precompiled headers (Stable.h) include this first to give use a common -// place for including order-dependent library headers (things that need to go first). - - - - - -class CSimpleBitString -{ -public: - explicit CSimpleBitString( uint32 ReserveNumBits = 0 ) - : - m_uNumBits( 0 ), - m_vecU8() - { - m_vecU8.EnsureCapacity( (ReserveNumBits / 8) + 1 ); - m_vecU8[ m_vecU8.AddToTail() ] = 0x00; // always need 1 byte - } - - void clear() - { - m_uNumBits = 0; - m_vecU8.RemoveAll(); - m_vecU8[ m_vecU8.AddToTail() ] = 0x00; // always need 1 byte - } - - void AppendBits( uint64 data, uint32 NumSignificantLowBitsOfData ); - void AppendBits( const uint8 * pData, uint32 NumBitsOfData ); - - void ReversiblyObfusticateBitsFromStart( uint32 NumBits, const uint8 * pObfusticationData, size_t uSizeOfObfusticationData ); - uint8 GetByteChecksumFromStart( uint32 NumBits ) const; - - uint GetCurrNumBits() const - { - return m_uNumBits; - } - - const uint8 * data() const - { - return & m_vecU8[0]; - } - - size_t size() const - { - return m_vecU8.Count(); - } - -private: - uint32 m_uNumBits; - CUtlVector m_vecU8; - -public: - - // Iterator class for retrieving bits - class iterator - { - public: - explicit iterator( const CSimpleBitString & bs ) - : - m_rSimpleBitString( bs ), - m_uNextBitIdx( 0 ) - { - } - - void ResetToStart() - { - m_uNextBitIdx = 0; - } - - uint32 GetNumConsumedBits() const - { - return m_uNextBitIdx; - } - - uint32 GetNumRemainingBits() const - { - return m_rSimpleBitString.m_uNumBits - m_uNextBitIdx; - } - - uint32 GetNextBits( uint32 NumBitsToGet ); - uint64 GetNextBits64( uint32 NumBitsToGet ); - - void SkipNextBits( uint32 NumBitsToSkip ) - { - if ( m_uNextBitIdx + NumBitsToSkip > m_rSimpleBitString.m_uNumBits ) - { - AssertMsg( false, "Not enough bits in CSimpleBitString" ); - NumBitsToSkip = 0; - } - - m_uNextBitIdx += NumBitsToSkip; - } - - bool operator ==( const iterator & other ) const - { - return (& m_rSimpleBitString == & other.m_rSimpleBitString) - && m_uNextBitIdx == other.m_uNextBitIdx; - } - - void DoAssertClassInvariant() const; - - private: - const CSimpleBitString & m_rSimpleBitString; //lint !e1725 reference - uint32 m_uNextBitIdx; - }; - - friend class iterator; - -}; - - - - - -#endif diff --git a/external/crypto++-5.6.3/3way.cpp b/external/crypto++-5.6.3/3way.cpp deleted file mode 100644 index 066ab3304..000000000 --- a/external/crypto++-5.6.3/3way.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// 3way.cpp - modifed by Wei Dai from Joan Daemen's 3way.c -// The original code and all modifications are in the public domain. - -#include "pch.h" -#include "3way.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void ThreeWay_TestInstantiations() -{ - ThreeWay::Encryption x1; - ThreeWay::Decryption x2; -} -#endif - -static const word32 START_E = 0x0b0b; // round constant of first encryption round -static const word32 START_D = 0xb1b1; // round constant of first decryption round -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -static const word32 RC_MODULUS = 0x11011; -#endif - -static inline word32 reverseBits(word32 a) -{ - a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1); - a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2); - return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4); -} - -#define mu(a0, a1, a2) \ -{ \ - a1 = reverseBits(a1); \ - word32 t = reverseBits(a0); \ - a0 = reverseBits(a2); \ - a2 = t; \ -} - -#define pi_gamma_pi(a0, a1, a2) \ -{ \ - word32 b0, b2; \ - b2 = rotlFixed(a2, 1U); \ - b0 = rotlFixed(a0, 22U); \ - a0 = rotlFixed(b0 ^ (a1|(~b2)), 1U); \ - a2 = rotlFixed(b2 ^ (b0|(~a1)), 22U);\ - a1 ^= (b2|(~b0)); \ -} - -// thanks to Paulo Barreto for this optimized theta() -#define theta(a0, a1, a2) \ -{ \ - word32 b0, b1, c; \ - c = a0 ^ a1 ^ a2; \ - c = rotlFixed(c, 16U) ^ rotlFixed(c, 8U); \ - b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \ - b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \ - a0 ^= c ^ b0; \ - a1 ^= c ^ b1; \ - a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \ -} - -#define rho(a0, a1, a2) \ -{ \ - theta(a0, a1, a2); \ - pi_gamma_pi(a0, a1, a2); \ -} - -void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(length); - - m_rounds = GetRoundsAndThrowIfInvalid(params, this); - - for (unsigned int i=0; i<3; i++) - m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24); - - if (!IsForwardTransformation()) - { - theta(m_k[0], m_k[1], m_k[2]); - mu(m_k[0], m_k[1], m_k[2]); - m_k[0] = ByteReverse(m_k[0]); - m_k[1] = ByteReverse(m_k[1]); - m_k[2] = ByteReverse(m_k[2]); - } -} - -void ThreeWay::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - typedef BlockGetAndPut Block; - - word32 a0, a1, a2; - Block::Get(inBlock)(a0)(a1)(a2); - - word32 rc = START_E; - - for(unsigned i=0; i Block; - - word32 a0, a1, a2; - Block::Get(inBlock)(a0)(a1)(a2); - - word32 rc = START_D; - - mu(a0, a1, a2); - for(unsigned i=0; i, public FixedKeyLength<12>, public VariableRounds<11> -{ - static const char *StaticAlgorithmName() {return "3-Way";} -}; - -// 3-Way - -//! \class ThreeWay -//! \brief Provides 3-Way encryption and decryption -class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation -{ - //! \class Base - //! \brief Class specific implementation and overrides used to operate the cipher. - //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - - protected: - unsigned int m_rounds; - FixedSizeSecBlock m_k; - }; - - //! \class Enc - //! \brief Class specific methods used to operate the cipher in the forward direction. - //! \details Implementations and overrides in \p Enc apply to \p ENCRYPTION. - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - //! \class Dec - //! \brief Class specific methods used to operate the cipher in the reverse direction. - //! \details Implementations and overrides in \p Dec apply to \p DECRYPTION. - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef ThreeWay::Encryption ThreeWayEncryption; -typedef ThreeWay::Decryption ThreeWayDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/Doxyfile b/external/crypto++-5.6.3/Doxyfile deleted file mode 100644 index dbc50acf1..000000000 --- a/external/crypto++-5.6.3/Doxyfile +++ /dev/null @@ -1,2373 +0,0 @@ -# Doxyfile 1.8.9 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). -# -# The file can be upgraded to the latest version of Doxygen with `doxygen -u

Crypto++" $(LIB_MAJOR).$(LIB_MINOR).$(LIB_REVISION) "Benchmarks

" >> benchmarks.html - echo "

Here are speed benchmarks for some commonly used cryptographic algorithms.

" >> benchmarks.html - ./cryptest.exe b 3 2.4 >> benchmarks.html - echo "" >> benchmarks.html - echo "" >> benchmarks.html - -adhoc.cpp: adhoc.cpp.proto -ifeq ($(wildcard adhoc.cpp),) - cp adhoc.cpp.proto adhoc.cpp -else - touch adhoc.cpp -endif - -# Include dependencies, if present. You must issue `make deps` to create them. -ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps) --include GNUmakefile.deps -endif # Dependencies - -# MacPorts/GCC issue with init_priority. Apple/GCC and Fink/GCC are fine; limit to MacPorts. -# Also see http://lists.macosforge.org/pipermail/macports-users/2015-September/039223.html -ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER),11) -ifeq ($(findstring -DMACPORTS_GCC_COMPILER,$(CXXFLAGS)),) -cryptlib.o: - $(CXX) $(CXXFLAGS) -DMACPORTS_GCC_COMPILER=1 -c cryptlib.cpp -cpu.o: - $(CXX) $(CXXFLAGS) -DMACPORTS_GCC_COMPILER=1 -c cpu.cpp -endif -endif - -%.dllonly.o : %.cpp - $(CXX) $(CXXFLAGS) -DCRYPTOPP_DLL_ONLY -c $< -o $@ - -%.import.o : %.cpp - $(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@ - -%.export.o : %.cpp - $(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@ - -%.o : %.cpp - $(CXX) $(CXXFLAGS) -c $< - -# Verify the options. -start_status: - @echo $(BUILDVERSION); - @if [ "$(MAKE_DEBUG)" == "1" ]; then\ - echo ""; \ - echo ""; \ - echo "NOTE: Relevant environment variables detected.";\ - if [ "$(MAKE_DEBUG)" == "1" ]; then\ - echo " MAKE_DEBUG was found so optimizations will be reduced.";\ - echo "";\ - echo "";\ - fi;\ - fi - -end_status: - @if [ "$(MAKE_DEBUG)" == "1" ]; then\ - echo ""; \ - echo ""; \ - echo "NOTE: MAKE_DEBUG was found so a debug build was made.";\ - echo ""; \ - echo ""; \ - fi - -# Warn of potential configurations issues. They will go away after 5.6.3. -UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h) -NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h) -COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h) -.PHONY: public_service -public_service: -ifneq ($(UNALIGNED_ACCESS),0) - $(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.) -endif -ifneq ($(NO_INIT_PRIORITY),0) - $(info WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.) -endif -ifneq ($(COMPATIBILITY_562),0) - $(info WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.) -endif -ifneq ($(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),000) - $(info WARNING: You should make these changes in config.h, and not CXXFLAGS.) - $(info WARNING: You can 'mv config.recommend config.h', but it breaks versioning.) - $(info WARNING: See http://cryptopp.com/wiki/config.h for more details.) - $(info ) -endif diff --git a/external/crypto++-5.6.3/GNUmakefile-cross b/external/crypto++-5.6.3/GNUmakefile-cross deleted file mode 100644 index 83aebf66c..000000000 --- a/external/crypto++-5.6.3/GNUmakefile-cross +++ /dev/null @@ -1,186 +0,0 @@ -CXXFLAGS ?= -DNDEBUG -g2 -Os -fPIC -pipe - -# The following options reduce code size, but breaks link or makes link very slow on some systems -# CXXFLAGS += -ffunction-sections -fdata-sections -# LDFLAGS += -Wl,--gc-sections - -ARFLAGS = -cr # ar needs the dash on OpenBSD -RANLIB ?= ranlib -CP = cp -MKDIR = mkdir -EGREP = egrep -CHMOD = chmod - -CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang") - -IS_X86=0 -IS_LINUX=0 -IS_MINGW=0 -IS_DARWIN=0 -UNAME=CrossCompile - -# Default prefix for make install -ifeq ($(PREFIX),) -PREFIX = /usr/local -endif - -# Sadly, we can't actually use GCC_PRAGMA_AWARE because of GCC bug 53431. -# Its a shame because GCC has so much to offer by the way of analysis. -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 -ifneq ($(CLANG_COMPILER),0) -CXXFLAGS += -Wall -endif - -# iOS cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE. -# See http://www.cryptopp.com/wiki/iOS_(Command_Line). -ifeq ($(IS_IOS),1) - CXX = clang++ - - CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(IOS_FLAGS) - CXXFLAGS += -arch $(IOS_ARCH) -isysroot $(IOS_SYSROOT) - CXXFLAGS += -stdlib=libc++ - - AR = libtool - ARFLAGS = -static -o -endif - -# Android cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE. -# See http://www.cryptopp.com/wiki/Android_(Command_Line). -ifeq ($(IS_ANDROID),1) - # CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-android.sh' - CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ANDROID_FLAGS) - CXXFLAGS += --sysroot=$(ANDROID_SYSROOT) -I$(ANDROID_STL_INC) - LDLIBS += $(ANDROID_STL_LIB) -endif - -# ARM embedded cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE. -# See http://www.cryptopp.com/wiki/ARM_Embedded_(Command_Line) -# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal). -ifeq ($(IS_ARM_EMBEDDED),1) - # CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-embedded.sh' - CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ARM_EMBEDDED_FLAGS) - CXXFLAGS += --sysroot=$(ARM_EMBEDDED_SYSROOT) -endif - -# List cryptlib.cpp first in an attempt to tame C++ static initialization problems -SRCS := cryptlib.cpp cpu.cpp $(filter-out cryptlib.cpp cpu.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp)) - -# List of objects with crytlib.o at the first index position -OBJS := $(SRCS:.cpp=.o) - -# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?) -TESTOBJS := bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o -LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS)) - -# List cryptlib.cpp first in an attempt to tame C++ static initialization problems -DLLSRCS := cryptlib.cpp cpu.cpp algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp -DLLOBJS := $(DLLSRCS:.cpp=.export.o) - -# Import lib testing -LIBIMPORTOBJS := $(LIBOBJS:.o=.import.o) -TESTIMPORTOBJS := $(TESTOBJS:.o=.import.o) -DLLTESTOBJS := dlltest.dllonly.o - -all: cryptest.exe - -ifneq ($(IS_DARWIN),0) -static: libcryptopp.a -shared dynamic dylib: libcryptopp.dylib -else -static: libcryptopp.a -shared dynamic: libcryptopp.so -endif - -test: cryptest.exe - ./cryptest.exe v - -.PHONY: clean -clean: - -$(RM) cryptest.exe dlltest.exe libcryptopp.a libcryptopp.so libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe ct - -$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS) -ifneq ($(wildcard *.dSYM),) - -$(RM) -r cryptest.exe.dSYM dlltest.exe.dSYM -endif - -.PHONY: distclean -distclean: clean - -$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps cryptopp$(LIB_VER).diff cryptopp$(LIB_VER).zip *.o *.ii *.s - -.PHONY: install -install: - $(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin - -$(CP) *.h $(PREFIX)/include/cryptopp - -$(CHMOD) 755 $(PREFIX)/include/cryptopp - -$(CHMOD) 644 $(PREFIX)/include/cryptopp/*.h - -$(CP) libcryptopp.a $(PREFIX)/lib - -$(CHMOD) 644 $(PREFIX)/lib/libcryptopp.a - -$(CP) cryptest.exe $(PREFIX)/bin - -$(CHMOD) 755 $(PREFIX)/bin/cryptest.exe -ifneq ($(IS_DARWIN),0) - -$(CP) libcryptopp.dylib $(PREFIX)/lib - -$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.dylib -else - -$(CP) libcryptopp.so $(PREFIX)/lib - -$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.so -endif - -.PHONY: remove uninstall -remove uninstall: - -$(RM) -r $(PREFIX)/include/cryptopp - -$(RM) $(PREFIX)/lib/libcryptopp.a - -$(RM) $(PREFIX)/bin/cryptest.exe -ifneq ($(IS_DARWIN),0) - -$(RM) $(PREFIX)/lib/libcryptopp.dylib -else - -$(RM) $(PREFIX)/lib/libcryptopp.so -endif - -libcryptopp.a: public_service | $(LIBOBJS) - $(AR) $(ARFLAGS) $@ $(LIBOBJS) - $(RANLIB) $@ - -libcryptopp.so: public_service | $(LIBOBJS) - $(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBJS) $(LDFLAGS) $(LDLIBS) - -cryptest.exe: public_service | libcryptopp.a $(TESTOBJS) - $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS) - -adhoc.cpp: adhoc.cpp.proto -ifeq ($(wildcard adhoc.cpp),) - cp adhoc.cpp.proto adhoc.cpp -else - touch adhoc.cpp -endif - -# Include dependencies, if present. You must issue `make deps` to create them. -ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps) --include GNUmakefile.deps -endif # Dependencies - -%.o : %.cpp - $(CXX) $(CXXFLAGS) -c $< - -GNUmakefile.deps: - $(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps - -# Warn of potential configurations issues. This will go away after 5.6.3 -UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h) -NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h) -COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h) -.PHONY: public_service -public_service: -ifneq ($(UNALIGNED_ACCESS),0) - $(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.) -endif -ifneq ($(NO_INIT_PRIORITY),0) - $(info WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.) -endif -ifneq ($(COMPATIBILITY_562),0) - $(info WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.) -endif -ifneq (x$(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),x000) - $(info WARNING: You should make these changes in config.h, and not CXXFLAGS.) - $(info WARNING: You can 'mv config.recommend config.h', but it breaks versioning.) - $(info WARNING: See http://cryptopp.com/wiki/config.h for more details.) - $(info ) -endif diff --git a/external/crypto++-5.6.3/Install.txt b/external/crypto++-5.6.3/Install.txt deleted file mode 100644 index 9a116b38c..000000000 --- a/external/crypto++-5.6.3/Install.txt +++ /dev/null @@ -1,169 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Building the Library -* Installing the Library -* Makefile Targets -* DataDir Patch -* Dynamic Analysis -* Acceptance Testing -* Reporting problems - -INTRODUCTION ------------- - -Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. It was written and placed in public domain by Wei Dai. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at https://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt. - -These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. On BSD you will likely have to use `gmake` to build the library. On Linux, OS X, Solaris and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions. - -Crypto++ uses a GNU makefile, which combines configuration and a non-anemic make. You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. Please pay particular attention to CRYPTOPP_NO_UNALIGNED_DATA_ACCESS in config.h. - -Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use Cmake, and does not use Boost. - - -BUILDING THE LIBRARY --------------------- - -In general, all you should have to do is open a terminal, and then: - - make - make test - sudo make install - -The command above builds the static library and cryptest.exe program. If you want to build the shared object, then issue: - - make static dynamic cryptest.exe - -Or: - - make libcryptopp.a libcryptopp.so cryptest.exe - - -If you would like to use a different compiler, the set CXX: - - export CXX=/opt/intel/bin/icpc - make - -If you want to build using C++11, then: - - make CXXFLAGS="-std=c++11" - -Or: - - CXXFLAGS="-std=c++11" - make - -LLVM's libc++ is also supported, so you can: - - CXXFLAGS="-std=c++11 -stdlib=libc++" - make - - -INSTALLING THE LIBRARY ----------------------- - -To install the library into a user selected directory, perform: - - make install PREFIX=/usr/local - -During install, the makefile copies cryptest.exe into $PREFIX/bin, copies headers into $PREFIX/include/cryptopp, and copies libraries into $PREFIX/lib. If you only built a static or dynamic version of the library, then only one library is copied. The install recipe does not fail if the static library or shared object is not built. - -PREFIX is non-standard, but its retained for historical purposes. The makefile also responds to `prefix=`. - -There are some open issues installing the library because cryptest.exe is not sympathetic to path changes of of its test vectors and test data. See the DataDir patch below to fix it. - - -MAKEFILE TARGETS ----------------- - -The following are some of the targets provided by the GNU makefile. - -`make` invokes the default rule, which builds the Crypto++ static library and test harness. They are called `libcryptopp.a` and `cryptest.exe`, respectively. `cryptest.exe` links against `libcryptopp.a`, so the static library is a prerequisite for the target. - -`make libcryptopp.a` and `make static` build the static version of the library. - -`make libcryptopp.so` and `make dynamic` build the dynamic version of the library. On Mac OS X, the recipe builds `libcryptopp.dylib` instead. - -`make cryptest.exe` builds the library test harness. - -`make test` and `make check` are the same recipe and invoke the test harness with the the validation option. That is, it executes `cryptest.exe v`. - -`make install` installs the library. By default, the makefile copies into `/usr`. On OpenBSD, `make install` uses `/usr/local` by default because C++ headers should not be placed with the system headers. - -`make clean` cleans most transient and temporary objects. - -`make disclean` cleans most objects that are not part of the original distribution. - -`make dist` and `make zip` build s ZIP file that is suitable for distribution. - - -DATADIR PATCH -------------- - -The library offers a DataDir patch to help with post-installation issues regarding the location of the test vectors and test data. Its a patch provided by the community, so it must be applied manually. To acquire the patch, see http://www.cryptopp.com/wiki/DataDir. - - -DYNAMIC ANALYSIS ----------------- - -The Crypto++ embraces tools like Undefined Behavior sanitizer (UBsan), Address sanitizer (Asan) and Valgrind. Both Clang 3.2 and above and GCC 4.8 and above provide sanitizers. Please check with your distribution on how to install the compiler with its sanitizer libraries (they are sometimes a separate install item). - -UBsan and Asan are mutually exclusive options, so you can perform only one of these at a time: - - make ubsan - ./cryptest.exe v 2>&1 | egrep "(error|FAILED)" - ./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)" - -Or: - - make asan - ./cryptest.exe v 2>&1 | egrep "(error|FAILED)" - ./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)" - -If you experience self test failures or see reports of undefined behavior, then you should ensure CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is defined in config.h. CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined due to historical purposes. - -If you experience failures under Asan, then gather more information with: - - ./cryptest.exe v 2>&1 | asan_symbolize - -If you moved Crypto++ such that the paths have changed, then perform: - - ./cryptest.exe v 2>&1 | sed "s///g" | asan_symbolize - - -ACCEPTANCE TESTING ------------------- - -Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture. - -The first gate is code review and discussion of proposed patches. Git commits often cross reference a User Group discussions. - -Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves. - -Third, the code must pass cleanly though GCC and Clang's Undefined Behavior sanitizer (UBsan) and Address sanitizer (Asan) with CRYPTOPP_NO_UNALIGNED_DATA_ACCESS defined in config.h. See DYNAMIC ANALYSIS above on how to execute them. - -Fourth, the test harness provides a "validation" option which performs basic system checks (like endianess and word sizes) and exercises algorithms (like AES and SHA). You run the validation suite as shown below. The tail of the output should indicate 0 failed tests. - - ./cryptest.exe v - ... - - All tests passed! - Test ended at Sun Jul 26 02:10:57 2015 - Seed used was: 1437891055 - -Fifth, the test harness provides a "test vector" option which uses many known test vectors, even those published by other people (like Brian Gladman for AES). You run the test vectors as shown below. The tail of the output should indicate 0 failed tests. - - ./cryptest.exe tv all - ... - - Testing SymmetricCipher algorithm MARS/ECB. - ................. - Tests complete. Total tests = 4094. Failed tests = 0. - -REPORTING PROBLEMS ------------------- - -Dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at https://groups.google.com/forum/#!forum/cryptopp-users. - -Also see http://www.cryptopp.com/wiki/Bug_Report. diff --git a/external/crypto++-5.6.3/License.txt b/external/crypto++-5.6.3/License.txt deleted file mode 100644 index c5d3f34b1..000000000 --- a/external/crypto++-5.6.3/License.txt +++ /dev/null @@ -1,51 +0,0 @@ -Compilation Copyright (c) 1995-2013 by Wei Dai. All rights reserved. -This copyright applies only to this software distribution package -as a compilation, and does not imply a copyright on any particular -file in the package. - -All individual files in this compilation are placed in the public domain by -Wei Dai and other contributors. - -I would like to thank the following authors for placing their works into -the public domain: - -Joan Daemen - 3way.cpp -Leonard Janke - cast.cpp, seal.cpp -Steve Reid - cast.cpp -Phil Karn - des.cpp -Andrew M. Kuchling - md2.cpp, md4.cpp -Colin Plumb - md5.cpp -Seal Woods - rc6.cpp -Chris Morgan - rijndael.cpp -Paulo Baretto - rijndael.cpp, skipjack.cpp, square.cpp -Richard De Moliner - safer.cpp -Matthew Skala - twofish.cpp -Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp -Ronny Van Keer - sha3.cpp - -The Crypto++ Library (as a compilation) is currently licensed under the Boost -Software License 1.0 (http://www.boost.org/users/license.html). - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/external/crypto++-5.6.3/Readme.txt b/external/crypto++-5.6.3/Readme.txt deleted file mode 100644 index f76d282cc..000000000 --- a/external/crypto++-5.6.3/Readme.txt +++ /dev/null @@ -1,499 +0,0 @@ -Crypto++: a C++ Class Library of Cryptographic Schemes -Version 5.6.3 - NOV/20/2015 - -Crypto++ Library is a free C++ class library of cryptographic schemes. -Currently the library contains the following algorithms: - - algorithm type name - - authenticated encryption schemes GCM, CCM, EAX - - high speed stream ciphers Panama, Sosemanuk, Salsa20, XSalsa20 - - AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent, - CAST-256 - - IDEA, Triple-DES (DES-EDE2 and DES-EDE3), - other block ciphers Camellia, SEED, RC5, Blowfish, TEA, XTEA, - Skipjack, SHACAL-2 - - block cipher modes of operation ECB, CBC, CBC ciphertext stealing (CTS), - CFB, OFB, counter mode (CTR) - - message authentication codes VMAC, HMAC, GMAC, CMAC, CBC-MAC, DMAC, - Two-Track-MAC - - SHA-1, SHA-2 (SHA-224, SHA-256, SHA-384, and - hash functions SHA-512), SHA-3, Tiger, WHIRLPOOL, RIPEMD-128, - RIPEMD-256, RIPEMD-160, RIPEMD-320 - - RSA, DSA, ElGamal, Nyberg-Rueppel (NR), - public-key cryptography Rabin-Williams (RW), LUC, LUCELG, - DLIES (variants of DHAES), ESIGN - - padding schemes for public-key PKCS#1 v2.0, OAEP, PSS, PSSR, IEEE P1363 - systems EMSA2 and EMSA5 - - Diffie-Hellman (DH), Unified Diffie-Hellman - key agreement schemes (DH2), Menezes-Qu-Vanstone (MQV), LUCDIF, - XTR-DH - - elliptic curve cryptography ECDSA, ECNR, ECIES, ECDH, ECMQV - - insecure or obsolescent MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL -algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2, - compatibility and historical SAFER, 3-WAY, GOST, SHARK, CAST-128, Square - value - -Other features include: - - * pseudo random number generators (PRNG): ANSI X9.17 appendix C, RandomPool - * password based key derivation functions: PBKDF1 and PBKDF2 from PKCS #5, - PBKDF from PKCS #12 appendix B - * Shamir's secret sharing scheme and Rabin's information dispersal algorithm - (IDA) - * fast multi-precision integer (bignum) and polynomial operations - * finite field arithmetics, including GF(p) and GF(2^n) - * prime number generation and verification - * useful non-cryptographic algorithms - + DEFLATE (RFC 1951) compression/decompression with gzip (RFC 1952) and - zlib (RFC 1950) format support - + hex, base-32, and base-64 coding/decoding - + 32-bit CRC and Adler32 checksum - * class wrappers for these operating system features (optional): - + high resolution timers on Windows, Unix, and Mac OS - + Berkeley and Windows style sockets - + Windows named pipes - + /dev/random, /dev/urandom, /dev/srandom - + Microsoft's CryptGenRandom on Windows - * A high level interface for most of the above, using a filter/pipeline - metaphor - * benchmarks and validation testing - * x86, x86-64 (x64), MMX, and SSE2 assembly code for the most commonly used - algorithms, with run-time CPU feature detection and code selection - * some versions are available in FIPS 140-2 validated form - -You are welcome to use it for any purpose without paying me, but see -License.txt for the fine print. - -The following compilers are supported for this release. Please visit -http://www.cryptopp.com the most up to date build instructions and porting notes. - - * MSVC 6.0 - 2015 - * GCC 3.3 - 5.2 - * C++Builder 2010 - * Intel C++ Compiler 9 - 16.0 - * Sun Studio 12u1, Express 11/08, Express 06/10 - -*** Important Usage Notes *** - -1. If a constructor for A takes a pointer to an object B (except primitive -types such as int and char), then A owns B and will delete B at A's -destruction. If a constructor for A takes a reference to an object B, -then the caller retains ownership of B and should not destroy it until -A no longer needs it. - -2. Crypto++ is thread safe at the class level. This means you can use -Crypto++ safely in a multithreaded application, but you must provide -synchronization when multiple threads access a common Crypto++ object. - -*** MSVC-Specific Information *** - -On Windows, Crypto++ can be compiled into 3 forms: a static library -including all algorithms, a DLL with only FIPS Approved algorithms, and -a static library with only algorithms not in the DLL. -(FIPS Approved means Approved according to the FIPS 140-2 standard.) -The DLL may be used by itself, or it may be used together with the second -form of the static library. MSVC project files are included to build -all three forms, and sample applications using each of the three forms -are also included. - -To compile Crypto++ with MSVC, open the "cryptest.dsw" (for MSVC 6 and MSVC .NET -2003) or "cryptest.sln" (for MSVC 2005 - 2010) workspace file and build one or -more of the following projects: - -cryptopp - This builds the DLL. Please note that if you wish to use Crypto++ - as a FIPS validated module, you must use a pre-built DLL that has undergone - the FIPS validation process instead of building your own. -dlltest - This builds a sample application that only uses the DLL. -cryptest Non-DLL-Import Configuration - This builds the full static library - along with a full test driver. -cryptest DLL-Import Configuration - This builds a static library containing - only algorithms not in the DLL, along with a full test driver that uses - both the DLL and the static library. - -To use the Crypto++ DLL in your application, #include "dll.h" before including -any other Crypto++ header files, and place the DLL in the same directory as -your .exe file. dll.h includes the line #pragma comment(lib, "cryptopp") -so you don't have to explicitly list the import library in your project -settings. To use a static library form of Crypto++, make the "cryptlib" -project a dependency of your application project, or specify it as -an additional library to link with in your project settings. -In either case you should check the compiler options to -make sure that the library and your application are using the same C++ -run-time libraries and calling conventions. - -*** DLL Memory Management *** - -Because it's possible for the Crypto++ DLL to delete objects allocated -by the calling application, they must use the same C++ memory heap. Three -methods are provided to achieve this. -1. The calling application can tell Crypto++ what heap to use. This method - is required when the calling application uses a non-standard heap. -2. Crypto++ can tell the calling application what heap to use. This method - is required when the calling application uses a statically linked C++ Run - Time Library. (Method 1 does not work in this case because the Crypto++ DLL - is initialized before the calling application's heap is initialized.) -3. Crypto++ can automatically use the heap provided by the calling application's - dynamically linked C++ Run Time Library. The calling application must - make sure that the dynamically linked C++ Run Time Library is initialized - before Crypto++ is loaded. (At this time it is not clear if it is possible - to control the order in which DLLs are initialized on Windows 9x machines, - so it might be best to avoid using this method.) - -When Crypto++ attaches to a new process, it searches all modules loaded -into the process space for exported functions "GetNewAndDeleteForCryptoPP" -and "SetNewAndDeleteFromCryptoPP". If one of these functions is found, -Crypto++ uses methods 1 or 2, respectively, by calling the function. -Otherwise, method 3 is used. - -*** GCC-Specific Information *** - -A makefile is included for you to compile Crypto++ with GCC. Make sure -you are using GNU Make and GNU ld. The make process will produce two files, -libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the validation -suite. - -*** Documentation and Support *** - -Crypto++ is documented through inline comments in header files, which are -processed through Doxygen to produce an HTML reference manual. You can find -a link to the manual from http://www.cryptopp.com. Also at that site is -the Crypto++ FAQ, which you should browse through before attempting to -use this library, because it will likely answer many of questions that -may come up. - -If you run into any problems, please try the Crypto++ mailing list. -The subscription information and the list archive are available on -http://www.cryptopp.com. You can also email me directly by visiting -http://www.weidai.com, but you will probably get a faster response through -the mailing list. - -*** History *** - -1.0 - First public release. Withdrawn at the request of RSA DSI. - - included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA, - MD5, RC4, RC5, RSA, SHA, WAKE, secret sharing, DEFLATE compression - - had a serious bug in the RSA key generation code. - -1.1 - Removed RSA, RC4, RC5 - - Disabled calls to RSAREF's non-public functions - - Minor bugs fixed - -2.0 - a completely new, faster multiprecision integer class - - added MD5-MAC, HAVAL, 3-WAY, TEA, SAFER, LUC, Rabin, BlumGoldwasser, - elliptic curve algorithms - - added the Lucas strong probable primality test - - ElGamal encryption and signature schemes modified to avoid weaknesses - - Diamond changed to Diamond2 because of key schedule weakness - - fixed bug in WAKE key setup - - SHS class renamed to SHA - - lots of miscellaneous optimizations - -2.1 - added Tiger, HMAC, GOST, RIPE-MD160, LUCELG, LUCDIF, XOR-MAC, - OAEP, PSSR, SHARK - - added precomputation to DH, ElGamal, DSA, and elliptic curve algorithms - - added back RC5 and a new RSA - - optimizations in elliptic curves over GF(p) - - changed Rabin to use OAEP and PSSR - - changed many classes to allow copy constructors to work correctly - - improved exception generation and handling - -2.2 - added SEAL, CAST-128, Square - - fixed bug in HAVAL (padding problem) - - fixed bug in triple-DES (decryption order was reversed) - - fixed bug in RC5 (couldn't handle key length not a multiple of 4) - - changed HMAC to conform to RFC-2104 (which is not compatible - with the original HMAC) - - changed secret sharing and information dispersal to use GF(2^32) - instead of GF(65521) - - removed zero knowledge prover/verifier for graph isomorphism - - removed several utility classes in favor of the C++ standard library - -2.3 - ported to EGCS - - fixed incomplete workaround of min/max conflict in MSVC - -3.0 - placed all names into the "CryptoPP" namespace - - added MD2, RC2, RC6, MARS, RW, DH2, MQV, ECDHC, CBC-CTS - - added abstract base classes PK_SimpleKeyAgreementDomain and - PK_AuthenticatedKeyAgreementDomain - - changed DH and LUCDIF to implement the PK_SimpleKeyAgreementDomain - interface and to perform domain parameter and key validation - - changed interfaces of PK_Signer and PK_Verifier to sign and verify - messages instead of message digests - - changed OAEP to conform to PKCS#1 v2.0 - - changed benchmark code to produce HTML tables as output - - changed PSSR to track IEEE P1363a - - renamed ElGamalSignature to NR and changed it to track IEEE P1363 - - renamed ECKEP to ECMQVC and changed it to track IEEE P1363 - - renamed several other classes for clarity - - removed support for calling RSAREF - - removed option to compile old SHA (SHA-0) - - removed option not to throw exceptions - -3.1 - added ARC4, Rijndael, Twofish, Serpent, CBC-MAC, DMAC - - added interface for querying supported key lengths of symmetric ciphers - and MACs - - added sample code for RSA signature and verification - - changed CBC-CTS to be compatible with RFC 2040 - - updated SEAL to version 3.0 of the cipher specification - - optimized multiprecision squaring and elliptic curves over GF(p) - - fixed bug in MARS key setup - - fixed bug with attaching objects to Deflator - -3.2 - added DES-XEX3, ECDSA, DefaultEncryptorWithMAC - - renamed DES-EDE to DES-EDE2 and TripleDES to DES-EDE3 - - optimized ARC4 - - generalized DSA to allow keys longer than 1024 bits - - fixed bugs in GF2N and ModularArithmetic that can cause calculation errors - - fixed crashing bug in Inflator when given invalid inputs - - fixed endian bug in Serpent - - fixed padding bug in Tiger - -4.0 - added Skipjack, CAST-256, Panama, SHA-2 (SHA-256, SHA-384, and SHA-512), - and XTR-DH - - added a faster variant of Rabin's Information Dispersal Algorithm (IDA) - - added class wrappers for these operating system features: - - high resolution timers on Windows, Unix, and MacOS - - Berkeley and Windows style sockets - - Windows named pipes - - /dev/random and /dev/urandom on Linux and FreeBSD - - Microsoft's CryptGenRandom on Windows - - added support for SEC 1 elliptic curve key format and compressed points - - added support for X.509 public key format (subjectPublicKeyInfo) for - RSA, DSA, and elliptic curve schemes - - added support for DER and OpenPGP signature format for DSA - - added support for ZLIB compressed data format (RFC 1950) - - changed elliptic curve encryption to use ECIES (as defined in SEC 1) - - changed MARS key schedule to reflect the latest specification - - changed BufferedTransformation interface to support multiple channels - and messages - - changed CAST and SHA-1 implementations to use public domain source code - - fixed bug in StringSource - - optmized multi-precision integer code for better performance - -4.1 - added more support for the recommended elliptic curve parameters in SEC 2 - - added Panama MAC, MARC4 - - added IV stealing feature to CTS mode - - added support for PKCS #8 private key format for RSA, DSA, and elliptic - curve schemes - - changed Deflate, MD5, Rijndael, and Twofish to use public domain code - - fixed a bug with flushing compressed streams - - fixed a bug with decompressing stored blocks - - fixed a bug with EC point decompression using non-trinomial basis - - fixed a bug in NetworkSource::GeneralPump() - - fixed a performance issue with EC over GF(p) decryption - - fixed syntax to allow GCC to compile without -fpermissive - - relaxed some restrictions in the license - -4.2 - added support for longer HMAC keys - - added MD4 (which is not secure so use for compatibility purposes only) - - added compatibility fixes/workarounds for STLport 4.5, GCC 3.0.2, - and MSVC 7.0 - - changed MD2 to use public domain code - - fixed a bug with decompressing multiple messages with the same object - - fixed a bug in CBC-MAC with MACing multiple messages with the same object - - fixed a bug in RC5 and RC6 with zero-length keys - - fixed a bug in Adler32 where incorrect checksum may be generated - -5.0 - added ESIGN, DLIES, WAKE-OFB, PBKDF1 and PBKDF2 from PKCS #5 - - added key validation for encryption and signature public/private keys - - renamed StreamCipher interface to SymmetricCipher, which is now implemented - by both stream ciphers and block cipher modes including ECB and CBC - - added keying interfaces to support resetting of keys and IVs without - having to destroy and recreate objects - - changed filter interface to support non-blocking input/output - - changed SocketSource and SocketSink to use overlapped I/O on Microsoft Windows - - grouped related classes inside structs to help templates, for example - AESEncryption and AESDecryption are now AES::Encryption and AES::Decryption - - where possible, typedefs have been added to improve backwards - compatibility when the CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY macro is defined - - changed Serpent, HAVAL and IDEA to use public domain code - - implemented SSE2 optimizations for Integer operations - - fixed a bug in HMAC::TruncatedFinal() - - fixed SKIPJACK byte ordering following NIST clarification dated 5/9/02 - -5.01 - added known answer test for X9.17 RNG in FIPS 140 power-up self test - - submitted to NIST/CSE, but not publicly released - -5.02 - changed EDC test to MAC integrity check using HMAC/SHA1 - - improved performance of integrity check - - added blinding to defend against RSA timing attack - -5.03 - created DLL version of Crypto++ for FIPS 140-2 validation - - fixed vulnerabilities in GetNextIV for CTR and OFB modes - -5.0.4 - Removed DES, SHA-256, SHA-384, SHA-512 from DLL - -5.1 - added PSS padding and changed PSSR to track IEEE P1363a draft standard - - added blinding for RSA and Rabin to defend against timing attacks - on decryption operations - - changed signing and decryption APIs to support the above - - changed WaitObjectContainer to allow waiting for more than 64 - objects at a time on Win32 platforms - - fixed a bug in CBC and ECB modes with processing non-aligned data - - fixed standard conformance bugs in DLIES (DHAES mode) and RW/EMSA2 - signature scheme (these fixes are not backwards compatible) - - fixed a number of compiler warnings, minor bugs, and portability problems - - removed Sapphire - -5.2 - merged in changes for 5.01 - 5.0.4 - - added support for using encoding parameters and key derivation parameters - with public key encryption (implemented by OAEP and DL/ECIES) - - added Camellia, SHACAL-2, Two-Track-MAC, Whirlpool, RIPEMD-320, - RIPEMD-128, RIPEMD-256, Base-32 coding, FIPS variant of CFB mode - - added ThreadUserTimer for timing thread CPU usage - - added option for password-based key derivation functions - to iterate until a mimimum elapsed thread CPU time is reached - - added option (on by default) for DEFLATE compression to detect - uncompressible files and process them more quickly - - improved compatibility and performance on 64-bit platforms, - including Alpha, IA-64, x86-64, PPC64, Sparc64, and MIPS64 - - fixed ONE_AND_ZEROS_PADDING to use 0x80 instead 0x01 as padding. - - fixed encoding/decoding of PKCS #8 privateKeyInfo to properly - handle optional attributes - -5.2.1 - fixed bug in the "dlltest" DLL testing program - - fixed compiling with STLport using VC .NET - - fixed compiling with -fPIC using GCC - - fixed compiling with -msse2 on systems without memalign() - - fixed inability to instantiate PanamaMAC - - fixed problems with inline documentation - -5.2.2 - added SHA-224 - - put SHA-256, SHA-384, SHA-512, RSASSA-PSS into DLL - -5.2.3 - fixed issues with FIPS algorithm test vectors - - put RSASSA-ISO into DLL - -5.3 - ported to MSVC 2005 with support for x86-64 - - added defense against AES timing attacks, and more AES test vectors - - changed StaticAlgorithmName() of Rijndael to "AES", CTR to "CTR" - -5.4 - added Salsa20 - - updated Whirlpool to version 3.0 - - ported to GCC 4.1, Sun C++ 5.8, and Borland C++Builder 2006 - -5.5 - added VMAC and Sosemanuk (with x86-64 and SSE2 assembly) - - improved speed of integer arithmetic, AES, SHA-512, Tiger, Salsa20, - Whirlpool, and PANAMA cipher using assembly (x86-64, MMX, SSE2) - - optimized Camellia and added defense against timing attacks - - updated benchmarks code to show cycles per byte and to time key/IV setup - - started using OpenMP for increased multi-core speed - - enabled GCC optimization flags by default in GNUmakefile - - added blinding and computational error checking for RW signing - - changed RandomPool, X917RNG, GetNextIV, DSA/NR/ECDSA/ECNR to reduce - the risk of reusing random numbers and IVs after virtual machine state - rollback - - changed default FIPS mode RNG from AutoSeededX917RNG to - AutoSeededX917RNG - - fixed PANAMA cipher interface to accept 256-bit key and 256-bit IV - - moved MD2, MD4, MD5, PanamaHash, ARC4, WAKE_CFB into the namespace "Weak" - - removed HAVAL, MD5-MAC, XMAC - -5.5.1 - fixed VMAC validation failure on 32-bit big-endian machines - -5.5.2 - ported x64 assembly language code for AES, Salsa20, Sosemanuk, and Panama - to MSVC 2005 (using MASM since MSVC doesn't support inline assembly on x64) - - fixed Salsa20 initialization crash on non-SSE2 machines - - fixed Whirlpool crash on Pentium 2 machines - - fixed possible branch prediction analysis (BPA) vulnerability in - MontgomeryReduce(), which may affect security of RSA, RW, LUC - - fixed link error with MSVC 2003 when using "debug DLL" form of runtime library - - fixed crash in SSE2_Add on P4 machines when compiled with - MSVC 6.0 SP5 with Processor Pack - - ported to MSVC 2008, GCC 4.2, Sun CC 5.9, Intel C++ Compiler 10.0, - and Borland C++Builder 2007 - -5.6.0 - added AuthenticatedSymmetricCipher interface class and Filter wrappers - - added CCM, GCM (with SSE2 assembly), EAX, CMAC, XSalsa20, and SEED - - added support for variable length IVs - - added OIDs for Brainpool elliptic curve parameters - - improved AES and SHA-256 speed on x86 and x64 - - changed BlockTransformation interface to no longer assume data alignment - - fixed incorrect VMAC computation on message lengths - that are >64 mod 128 (x86 assembly version is not affected) - - fixed compiler error in vmac.cpp on x86 with GCC -fPIC - - fixed run-time validation error on x86-64 with GCC 4.3.2 -O2 - - fixed HashFilter bug when putMessage=true - - fixed AES-CTR data alignment bug that causes incorrect encryption on ARM - - removed WORD64_AVAILABLE; compiler support for 64-bit int is now required - - ported to GCC 4.3, C++Builder 2009, Sun CC 5.10, Intel C++ Compiler 11 - -5.6.1 - added support for AES-NI and CLMUL instruction sets in AES and GMAC/GCM - - removed WAKE-CFB - - fixed several bugs in the SHA-256 x86/x64 assembly code: - * incorrect hash on non-SSE2 x86 machines on non-aligned input - * incorrect hash on x86 machines when input crosses 0x80000000 - * incorrect hash on x64 when compiled with GCC with optimizations enabled - - fixed bugs in AES x86 and x64 assembly causing crashes in some MSVC build configurations - - switched to a public domain implementation of MARS - - ported to MSVC 2010, GCC 4.5.1, Sun Studio 12u1, C++Builder 2010, Intel C++ Compiler 11.1 - - renamed the MSVC DLL project to "cryptopp" for compatibility with MSVC 2010 - -5.6.2 - changed license to Boost Software License 1.0 - - added SHA-3 (Keccak) - - updated DSA to FIPS 186-3 (see DSA2 class) - - fixed Blowfish minimum keylength to be 4 bytes (32 bits) - - fixed Salsa validation failure when compiling with GCC 4.6 - - fixed infinite recursion when on x64, assembly disabled, and no AESNI - - ported to MSVC 2012, GCC 4.7, Clang 3.2, Solaris Studio 12.3, Intel C++ Compiler 13.0 - -5.6.3 - maintenance release, honored API/ABI/Versioning requirements - - expanded processes to include community and its input - - fixed CVE-2015-2141 - - cleared most Undefined Behavior Sanitizer (UBsan) findings - - cleared all Address Sanitizer (Asan) findings - - cleared all Valgrind findings - - cleared all Coverity findings - - cleared all Enterprise Analysis (/analyze) findings - - cleared most GCC warnings with -Wall - - cleared most Clang warnings with -Wall - - cleared most MSVC warnings with /W4 - - added -fPIC 64-bit builds. Off by default for i386 - - added HKDF class from RFC 5868 - - switched to member_ptr due to C++ 11 warnings for auto_ptr - - initialization of C++ static objects, off by default - * GCC and init_priotirty/constructor attributes - * MSVC and init_seg(lib) - * CRYPTOPP_INIT_PRIORITY disabled by default, but available - - improved OS X support - - improved GNUmakefile support for Testing and QA - - added self tests for additional Testing and QA - - added cryptest.sh for systematic Testing and QA - - added GNU Gold linker support - - added Visual Studio 2010 solution and project files in vs2010.zip - - added Clang integrated assembler support - - unconditionally define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS for Makefile - target 'ubsan' and at -O3 due to GCC vectorization on x86 and x86_64 - - workaround ARMEL/GCC 5.2 bug and failed self test - - fixed crash in MQV due to GCC 4.9+ and inlining - - fixed hang in SHA due to GCC 4.9+ and inlining - - fixed missing rdtables::Te under VS with ALIGNED_DATA_ACCESS - - fixed S/390 and big endian feature detection - - fixed S/390 and int128_t/uint128_t detection - - fixed X32 (ILP32) feature detection - - removed _CRT_SECURE_NO_DEPRECATE for Microsoft platforms - - utilized bound checking interfaces from ISO/IEC TR 24772 when available - - improved ARM, ARM64, MIPS, MIPS64, S/390 and X32 (ILP32) support - - introduced CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - - added additional Doxygen-based documentation - - ported to MSVC 2015, Xcode 7.2, GCC 5.2, Clang 3.7, Intel C++ 16.00 - -5.7 - nearly identical to 5.6.3 - - minor breaks to the ABI and API - - cleared remaining Undefined Behavior Sanitizer (UBsan) findings - - cleared remaining GCC and Visual Studio warnings - - removed CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - -Written by Wei Dai and the Crypto++ Project diff --git a/external/crypto++-5.6.3/TestData/3desval.dat b/external/crypto++-5.6.3/TestData/3desval.dat deleted file mode 100644 index 1d5883ed8..000000000 --- a/external/crypto++-5.6.3/TestData/3desval.dat +++ /dev/null @@ -1,3 +0,0 @@ -0123456789abcdeffedcba9876543210 0123456789abcde7 7f1d0a77826b8aff -0123456789abcdeffedcba987654321089abcdef01234567 0123456789abcde7 de0b7c06ae5e0ed5 -0123456789ABCDEF01010101010101011011121314151617 94DBE082549A14EF 9011121314151617 diff --git a/external/crypto++-5.6.3/TestData/3wayval.dat b/external/crypto++-5.6.3/TestData/3wayval.dat deleted file mode 100644 index 51bb6c164..000000000 --- a/external/crypto++-5.6.3/TestData/3wayval.dat +++ /dev/null @@ -1,5 +0,0 @@ -000000000000000000000000 000000010000000100000001 4059c76e83ae9dc4ad21ecf7 -000000060000000500000004 000000030000000200000001 d2f05b5ed6144138cab920cd -def01234456789abbcdef012 234567899abcdef001234567 0aa55dbb9cdddb6d7cdb76b2 -d2f05b5ed6144138cab920cd 4059c76e83ae9dc4ad21ecf7 478ea8716b13f17c15b155ed - diff --git a/external/crypto++-5.6.3/TestData/camellia.dat b/external/crypto++-5.6.3/TestData/camellia.dat deleted file mode 100644 index c4fcc1259..000000000 --- a/external/crypto++-5.6.3/TestData/camellia.dat +++ /dev/null @@ -1,45 +0,0 @@ -0123456789ABCDEFFEDCBA9876543210 0123456789ABCDEFFEDCBA9876543210 67673138549669730857065648EABE43 -80000000000000000000000000000000 00000000000000000000000000000000 6C227F749319A3AA7DA235A9BBA05A2C -00000000000000000000000000000001 00000000000000000000000000000000 41E0E6DC2DDEC65D8B8120E60977B82D -00000000000000000000000000000000 80000000000000000000000000000000 07923A39EB0A817D1C4D87BDB82D1F1C -00000000000000000000000000000000 00000000000000000000000000000001 F5574ACC3148DFCB9015200631024DF9 -00000000000000000000000000000000 00000000000000000000000000000000 3D028025B156327C17F762C1F2CBCA71 -01010101010101010101010101010101 01010101010101010101010101010101 637084CB1120D6F25DB618893040AA27 -02020202020202020202020202020202 02020202020202020202020202020202 612834AAC9EF906BAEAA076E1C75179D -04040404040404040404040404040404 04040404040404040404040404040404 B24FAF8A579E4EFE986571FB2F68B5B4 -08080808080808080808080808080808 08080808080808080808080808080808 3E5CAFBB70545AABB1109293A1C44C14 -10101010101010101010101010101010 10101010101010101010101010101010 E1FA5FD3F40B766BBE3DF469AF41B420 -20202020202020202020202020202020 20202020202020202020202020202020 7E724027BB2F591C63254D936FCC4B43 -40404040404040404040404040404040 40404040404040404040404040404040 538ADCBE104A3483B3C2A3D8CE72FBD6 -80808080808080808080808080808080 80808080808080808080808080808080 AA7627F70F6B54C217C3EF232D362459 -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 25DD9EB9DD67FBC6E8431F56F4FBE651 -0123456789ABCDEFFEDCBA98765432100011223344556677 0123456789ABCDEFFEDCBA9876543210 B4993401B3E996F84EE5CEE7D79B09B9 -800000000000000000000000000000000000000000000000 00000000000000000000000000000000 1B6220D365C2176C1D41A5826520FCA1 -000000000000000000000000000000000000000000000001 00000000000000000000000000000000 E37577F71E0E643C4D3F55219ABA1394 -000000000000000000000000000000000000000000000000 80000000000000000000000000000000 3EB6CC5618EFC98455B5992050D474E7 -000000000000000000000000000000000000000000000000 00000000000000000000000000000001 BA9AE89FDDCE4B51131E17C4D65CE587 -000000000000000000000000000000000000000000000000 00000000000000000000000000000000 56E1E129CA5C02C7F9AC6AFDEF86ADC3 -010101010101010101010101010101010101010101010101 01010101010101010101010101010101 8F764397C10BE84BA876CEEFA4225BFF -020202020202020202020202020202020202020202020202 02020202020202020202020202020202 60B00674BFD444D07B5A19851E6151CD -040404040404040404040404040404040404040404040404 04040404040404040404040404040404 81B26FF4F6B4377CC555873504B3A38B -080808080808080808080808080808080808080808080808 08080808080808080808080808080808 A2AA1C6693DC2B70D75C9B39B9B214D0 -101010101010101010101010101010101010101010101010 10101010101010101010101010101010 A907BFDAEEF8C81D05855235E8D3BE08 -202020202020202020202020202020202020202020202020 20202020202020202020202020202020 87F8EA30332036F17CEAC0097CE33BC1 -404040404040404040404040404040404040404040404040 40404040404040404040404040404040 A2C32EA499E41A248565253BACC11E3B -808080808080808080808080808080808080808080808080 80808080808080808080808080808080 F602BA7F515B082983B8F7A27F92408F -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3F8D5676F51CE23DC3BDB627F8B3883E -0123456789ABCDEFFEDCBA987654321000112233445566778899AABBCCDDEEFF 0123456789ABCDEFFEDCBA9876543210 9ACC237DFF16D76C20EF7C919E3A7509 -8000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 2136FABDA091DFB5171B94B8EFBB5D08 -0000000000000000000000000000000000000000000000000000000000000001 00000000000000000000000000000000 AFCD38B195E0A736304E89B9AE3019D3 -0000000000000000000000000000000000000000000000000000000000000000 80000000000000000000000000000000 B0C6B88AEA518AB09E847248E91B1B9D -0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000001 9CDB269B5D293BC5DB9C55B057D9B591 -0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 396154111ADEFC500CF6E5C99038BC17 -0101010101010101010101010101010101010101010101010101010101010101 01010101010101010101010101010101 438D0C2E7E86869B56EBA23B66086A01 -0202020202020202020202020202020202020202020202020202020202020202 02020202020202020202020202020202 D4F553BFA794F55EF3B7A578629F6DEA -0404040404040404040404040404040404040404040404040404040404040404 04040404040404040404040404040404 5E858730ABC9823A93CA4CAB67F0B423 -0808080808080808080808080808080808080808080808080808080808080808 08080808080808080808080808080808 F9A9C1540AE1B314DBEDF9A49054DC9D -1010101010101010101010101010101010101010101010101010101010101010 10101010101010101010101010101010 6693FC130669F194F81E8D175194DDA2 -2020202020202020202020202020202020202020202020202020202020202020 20202020202020202020202020202020 F3E1FDA6B9C8314799F4654C29F1C690 -4040404040404040404040404040404040404040404040404040404040404040 40404040404040404040404040404040 4A30476F1141FBF303ED63FCD3CB0536 -8080808080808080808080808080808080808080808080808080808080808080 80808080808080808080808080808080 0C765AA494E048FC8BB23139F2124CB6 -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 4F05F28CA23EEAE205B67B1C95CD5280 diff --git a/external/crypto++-5.6.3/TestData/cast128v.dat b/external/crypto++-5.6.3/TestData/cast128v.dat deleted file mode 100644 index 4445305b1..000000000 --- a/external/crypto++-5.6.3/TestData/cast128v.dat +++ /dev/null @@ -1,11 +0,0 @@ -01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A -01 23 45 67 89 AB CD EF -23 8B 4F E5 84 7E 44 B2 - -01 23 45 67 12 34 56 78 23 45 -01 23 45 67 89 AB CD EF -EB 6A 71 1A 2C 02 27 1B - -01 23 45 67 12 -01 23 45 67 89 AB CD EF -7A C8 16 D1 6E 9B 30 2E diff --git a/external/crypto++-5.6.3/TestData/cast256v.dat b/external/crypto++-5.6.3/TestData/cast256v.dat deleted file mode 100644 index 65a15dc26..000000000 --- a/external/crypto++-5.6.3/TestData/cast256v.dat +++ /dev/null @@ -1,11 +0,0 @@ -2342bb9efa38542c0af75647f29f615d -00000000000000000000000000000000 -c842a08972b43d20836c91d1b7530f6b - -2342bb9efa38542cbed0ac83940ac298bac77a7717942863 -00000000000000000000000000000000 -1b386c0210dcadcbdd0e41aa08a7a7e8 - -2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604 -00000000000000000000000000000000 -4f6a2038286897b9c9870136553317fa diff --git a/external/crypto++-5.6.3/TestData/descert.dat b/external/crypto++-5.6.3/TestData/descert.dat deleted file mode 100644 index 5d3ddc7d3..000000000 --- a/external/crypto++-5.6.3/TestData/descert.dat +++ /dev/null @@ -1,171 +0,0 @@ -0101010101010101 95F8A5E5DD31D900 8000000000000000 -0101010101010101 DD7F121CA5015619 4000000000000000 -0101010101010101 2E8653104F3834EA 2000000000000000 -0101010101010101 4BD388FF6CD81D4F 1000000000000000 -0101010101010101 20B9E767B2FB1456 0800000000000000 -0101010101010101 55579380D77138EF 0400000000000000 -0101010101010101 6CC5DEFAAF04512F 0200000000000000 -0101010101010101 0D9F279BA5D87260 0100000000000000 -0101010101010101 D9031B0271BD5A0A 0080000000000000 -0101010101010101 424250B37C3DD951 0040000000000000 -0101010101010101 B8061B7ECD9A21E5 0020000000000000 -0101010101010101 F15D0F286B65BD28 0010000000000000 -0101010101010101 ADD0CC8D6E5DEBA1 0008000000000000 -0101010101010101 E6D5F82752AD63D1 0004000000000000 -0101010101010101 ECBFE3BD3F591A5E 0002000000000000 -0101010101010101 F356834379D165CD 0001000000000000 -0101010101010101 2B9F982F20037FA9 0000800000000000 -0101010101010101 889DE068A16F0BE6 0000400000000000 -0101010101010101 E19E275D846A1298 0000200000000000 -0101010101010101 329A8ED523D71AEC 0000100000000000 -0101010101010101 E7FCE22557D23C97 0000080000000000 -0101010101010101 12A9F5817FF2D65D 0000040000000000 -0101010101010101 A484C3AD38DC9C19 0000020000000000 -0101010101010101 FBE00A8A1EF8AD72 0000010000000000 -0101010101010101 750D079407521363 0000008000000000 -0101010101010101 64FEED9C724C2FAF 0000004000000000 -0101010101010101 F02B263B328E2B60 0000002000000000 -0101010101010101 9D64555A9A10B852 0000001000000000 -0101010101010101 D106FF0BED5255D7 0000000800000000 -0101010101010101 E1652C6B138C64A5 0000000400000000 -0101010101010101 E428581186EC8F46 0000000200000000 -0101010101010101 AEB5F5EDE22D1A36 0000000100000000 -0101010101010101 E943D7568AEC0C5C 0000000080000000 -0101010101010101 DF98C8276F54B04B 0000000040000000 -0101010101010101 B160E4680F6C696F 0000000020000000 -0101010101010101 FA0752B07D9C4AB8 0000000010000000 -0101010101010101 CA3A2B036DBC8502 0000000008000000 -0101010101010101 5E0905517BB59BCF 0000000004000000 -0101010101010101 814EEB3B91D90726 0000000002000000 -0101010101010101 4D49DB1532919C9F 0000000001000000 -0101010101010101 25EB5FC3F8CF0621 0000000000800000 -0101010101010101 AB6A20C0620D1C6F 0000000000400000 -0101010101010101 79E90DBC98F92CCA 0000000000200000 -0101010101010101 866ECEDD8072BB0E 0000000000100000 -0101010101010101 8B54536F2F3E64A8 0000000000080000 -0101010101010101 EA51D3975595B86B 0000000000040000 -0101010101010101 CAFFC6AC4542DE31 0000000000020000 -0101010101010101 8DD45A2DDF90796C 0000000000010000 -0101010101010101 1029D55E880EC2D0 0000000000008000 -0101010101010101 5D86CB23639DBEA9 0000000000004000 -0101010101010101 1D1CA853AE7C0C5F 0000000000002000 -0101010101010101 CE332329248F3228 0000000000001000 -0101010101010101 8405D1ABE24FB942 0000000000000800 -0101010101010101 E643D78090CA4207 0000000000000400 -0101010101010101 48221B9937748A23 0000000000000200 -0101010101010101 DD7C0BBD61FAFD54 0000000000000100 -0101010101010101 2FBC291A570DB5C4 0000000000000080 -0101010101010101 E07C30D7E4E26E12 0000000000000040 -0101010101010101 0953E2258E8E90A1 0000000000000020 -0101010101010101 5B711BC4CEEBF2EE 0000000000000010 -0101010101010101 CC083F1E6D9E85F6 0000000000000008 -0101010101010101 D2FD8867D50D2DFE 0000000000000004 -0101010101010101 06E7EA22CE92708F 0000000000000002 -0101010101010101 166B40B44ABA4BD6 0000000000000001 -8001010101010101 0000000000000000 95A8D72813DAA94D -4001010101010101 0000000000000000 0EEC1487DD8C26D5 -2001010101010101 0000000000000000 7AD16FFB79C45926 -1001010101010101 0000000000000000 D3746294CA6A6CF3 -0801010101010101 0000000000000000 809F5F873C1FD761 -0401010101010101 0000000000000000 C02FAFFEC989D1FC -0201010101010101 0000000000000000 4615AA1D33E72F10 -0180010101010101 0000000000000000 2055123350C00858 -0140010101010101 0000000000000000 DF3B99D6577397C8 -0120010101010101 0000000000000000 31FE17369B5288C9 -0110010101010101 0000000000000000 DFDD3CC64DAE1642 -0108010101010101 0000000000000000 178C83CE2B399D94 -0104010101010101 0000000000000000 50F636324A9B7F80 -0102010101010101 0000000000000000 A8468EE3BC18F06D -0101800101010101 0000000000000000 A2DC9E92FD3CDE92 -0101400101010101 0000000000000000 CAC09F797D031287 -0101200101010101 0000000000000000 90BA680B22AEB525 -0101100101010101 0000000000000000 CE7A24F350E280B6 -0101080101010101 0000000000000000 882BFF0AA01A0B87 -0101040101010101 0000000000000000 25610288924511C2 -0101020101010101 0000000000000000 C71516C29C75D170 -0101018001010101 0000000000000000 5199C29A52C9F059 -0101014001010101 0000000000000000 C22F0A294A71F29F -0101012001010101 0000000000000000 EE371483714C02EA -0101011001010101 0000000000000000 A81FBD448F9E522F -0101010801010101 0000000000000000 4F644C92E192DFED -0101010401010101 0000000000000000 1AFA9A66A6DF92AE -0101010201010101 0000000000000000 B3C1CC715CB879D8 -0101010180010101 0000000000000000 19D032E64AB0BD8B -0101010140010101 0000000000000000 3CFAA7A7DC8720DC -0101010120010101 0000000000000000 B7265F7F447AC6F3 -0101010110010101 0000000000000000 9DB73B3C0D163F54 -0101010108010101 0000000000000000 8181B65BABF4A975 -0101010104010101 0000000000000000 93C9B64042EAA240 -0101010102010101 0000000000000000 5570530829705592 -0101010101800101 0000000000000000 8638809E878787A0 -0101010101400101 0000000000000000 41B9A79AF79AC208 -0101010101200101 0000000000000000 7A9BE42F2009A892 -0101010101100101 0000000000000000 29038D56BA6D2745 -0101010101080101 0000000000000000 5495C6ABF1E5DF51 -0101010101040101 0000000000000000 AE13DBD561488933 -0101010101020101 0000000000000000 024D1FFA8904E389 -0101010101018001 0000000000000000 D1399712F99BF02E -0101010101014001 0000000000000000 14C1D7C1CFFEC79E -0101010101012001 0000000000000000 1DE5279DAE3BED6F -0101010101011001 0000000000000000 E941A33F85501303 -0101010101010801 0000000000000000 DA99DBBC9A03F379 -0101010101010401 0000000000000000 B7FC92F91D8E92E9 -0101010101010201 0000000000000000 AE8E5CAA3CA04E85 -0101010101010180 0000000000000000 9CC62DF43B6EED74 -0101010101010140 0000000000000000 D863DBB5C59A91A0 -0101010101010120 0000000000000000 A1AB2190545B91D7 -0101010101010110 0000000000000000 0875041E64C570F7 -0101010101010108 0000000000000000 5A594528BEBEF1CC -0101010101010104 0000000000000000 FCDB3291DE21F0C0 -0101010101010102 0000000000000000 869EFD7F9F265A09 -1046913489980131 0000000000000000 88D55E54F54C97B4 -1007103489988020 0000000000000000 0C0CC00C83EA48FD -10071034C8980120 0000000000000000 83BC8EF3A6570183 -1046103489988020 0000000000000000 DF725DCAD94EA2E9 -1086911519190101 0000000000000000 E652B53B550BE8B0 -1086911519580101 0000000000000000 AF527120C485CBB0 -5107B01519580101 0000000000000000 0F04CE393DB926D5 -1007B01519190101 0000000000000000 C9F00FFC74079067 -3107915498080101 0000000000000000 7CFD82A593252B4E -3107919498080101 0000000000000000 CB49A2F9E91363E3 -10079115B9080140 0000000000000000 00B588BE70D23F56 -3107911598090140 0000000000000000 406A9A6AB43399AE -1007D01589980101 0000000000000000 6CB773611DCA9ADA -9107911589980101 0000000000000000 67FD21C17DBB5D70 -9107D01589190101 0000000000000000 9592CB4110430787 -1007D01598980120 0000000000000000 A6B7FF68A318DDD3 -1007940498190101 0000000000000000 4D102196C914CA16 -0107910491190401 0000000000000000 2DFA9F4573594965 -0107910491190101 0000000000000000 B46604816C0E0774 -0107940491190401 0000000000000000 6E7E6221A4F34E87 -19079210981A0101 0000000000000000 AA85E74643233199 -1007911998190801 0000000000000000 2E5A19DB4D1962D6 -10079119981A0801 0000000000000000 23A866A809D30894 -1007921098190101 0000000000000000 D812D961F017D320 -100791159819010B 0000000000000000 055605816E58608F -1004801598190101 0000000000000000 ABD88E8B1B7716F1 -1004801598190102 0000000000000000 537AC95BE69DA1E1 -1004801598190108 0000000000000000 AED0F6AE3C25CDD8 -1002911598100104 0000000000000000 B3E35A5EE53E7B8D -1002911598190104 0000000000000000 61C79C71921A2EF8 -1002911598100201 0000000000000000 E2F5728F0995013C -1002911698100101 0000000000000000 1AEAC39A61F0A464 -7CA110454A1A6E57 01A1D6D039776742 690F5B0D9A26939B -0131D9619DC1376E 5CD54CA83DEF57DA 7A389D10354BD271 -07A1133E4A0B2686 0248D43806F67172 868EBB51CAB4599A -3849674C2602319E 51454B582DDF440A 7178876E01F19B2A -04B915BA43FEB5B6 42FD443059577FA2 AF37FB421F8C4095 -0113B970FD34F2CE 059B5E0851CF143A 86A560F10EC6D85B -0170F175468FB5E6 0756D8E0774761D2 0CD3DA020021DC09 -43297FAD38E373FE 762514B829BF486A EA676B2CB7DB2B7A -07A7137045DA2A16 3BDD119049372802 DFD64A815CAF1A0F -04689104C2FD3B2F 26955F6835AF609A 5C513C9C4886C088 -37D06BB516CB7546 164D5E404F275232 0A2AEEAE3FF4AB77 -1F08260D1AC2465E 6B056E18759F5CCA EF1BF03E5DFA575A -584023641ABA6176 004BD6EF09176062 88BF0DB6D70DEE56 -025816164629B007 480D39006EE762F2 A1F9915541020B56 -49793EBC79B3258F 437540C8698F3CFA 6FBF1CAFCFFD0556 -4FB05E1515AB73A7 072D43A077075292 2F22E49BAB7CA1AC -49E95D6D4CA229BF 02FE55778117F12A 5A6B612CC26CCE4A -018310DC409B26D6 1D9D5C5018F728C2 5F4C038ED12B2E41 -1C587F1C13924FEF 305532286D6F295A 63FAC0D034D9F793 diff --git a/external/crypto++-5.6.3/TestData/dh1024.dat b/external/crypto++-5.6.3/TestData/dh1024.dat deleted file mode 100644 index 86a955182..000000000 --- a/external/crypto++-5.6.3/TestData/dh1024.dat +++ /dev/null @@ -1 +0,0 @@ -30818702818100DA9A18547FF03B385CC16508C173A7EF4EB61CB40EF8FEF3B31F145051676166BCDC3FE6B799FC394D08C26385F9413F896E09117E46209D6923602683CEA100924A6EE695281775C619DAA94EA8CB3691B4275B0183F1D39639EBC92995FE645D6C1BC28D409E585549BBD2C5DCDD6C208B04EADD8B7A6D997F72CBAD88390F020102 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dh2048.dat b/external/crypto++-5.6.3/TestData/dh2048.dat deleted file mode 100644 index bd5255fa0..000000000 --- a/external/crypto++-5.6.3/TestData/dh2048.dat +++ /dev/null @@ -1 +0,0 @@ -308201080282010100EB60DBD494AAFBCD2EAC6A36DB8E7DD4A2A64512A5BBB15B9BFB581C7C1CAFB647D4612973C3770C2166D75EEA695F67EA8261557591DB78BCF5A886AA5294F3AEE4D25B57C8EE8C7FE8DBF70C132CD7FFCB6F89426F807F552C5DAE2FB1F329E340094E4B30D8EF6265AB4D350E9837B151C86AC524DE4E1FC04746C668BE318275E420D51AEDDFBDF887D435CDEEF6AC81293DB45287132F8236A43AD8F4D6642D7CA6732DA06A1DE008259008C9D74403B68ADAC788CF8AB5BEFFC310DCCCD32901D1F290E5B7A993D2CF6A652AF81B6DA0FD2E70678D1AE086150E41444522F20621195AD2A1F0975652B4AF7DE5261A9FD46B9EA8B443641F3BBA695B9B020103 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dlie1024.dat b/external/crypto++-5.6.3/TestData/dlie1024.dat deleted file mode 100644 index 892128b31..000000000 --- a/external/crypto++-5.6.3/TestData/dlie1024.dat +++ /dev/null @@ -1 +0,0 @@ -308201370201003082011706072A8648CE3804013082010A02818100D4EC6B7A18416519C76766726B3D2D5F054D107B30E97691B15EB0DCDF452B77F10E12C14450AB107BE349C2DF3A2DBD9D844A24ABA21B328D568E8EC6B959E70BADE5C49879AE4447F643360523469B55AFDC459B45634F657AA79918772F2BA9508ACD43C95C16650A1251B8173EBA1B9B59FE8C57F6240EA49A4FE8855CEF0281806A7635BD0C20B28CE3B3B339359E96AF82A6883D9874BB48D8AF586E6FA295BBF8870960A22855883DF1A4E16F9D16DECEC2251255D10D9946AB4747635CACF385D6F2E24C3CD72223FB219B0291A34DAAD7EE22CDA2B1A7B2BD53CC8C3B9795D4A84566A1E4AE0B32850928DC0B9F5D0DCDACFF462BFB1207524D27F442AE77020102041702150C9C14EEFA749DCE9A2A4B7065768767BA48BBB62F \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dlie2048.dat b/external/crypto++-5.6.3/TestData/dlie2048.dat deleted file mode 100644 index 06351c7a8..000000000 --- a/external/crypto++-5.6.3/TestData/dlie2048.dat +++ /dev/null @@ -1 +0,0 @@ -308202410201003082021906072A8648CE3804013082020C0282010100A8E87254E7F56CB5857786364ACC39F2A0F79FFF8ED6C62C64EE45FC1C775CDDBFD9CBCEF8262DBD2CECE4E5AFECA239B9B4B7D3CBA228366500F5B2203CA6C0CB0AB6698F73921B4831BA598DFA8268A07368A64774C77808AB7CB7978F839304B10567F8C9C34F8DBDB66BB928EDE6327773AA6C20A8F4E9C2AE0C66A0516E057BBC87760CF39270726F1863260CD5ADDAF366318E7029851A6F85B2349DF29629319A3662354DBCAD0789D02AC6BD804C06523900166501041963BD7EFFE0069694A54F4542172A29B1F09D26E3F052AE5274A898058BE549650BC2066DDFDB84D582E6503AF42BCB2B674F2A2A77C54678FD622FFCA2D9718BF8B0525AEF028201005474392A73FAB65AC2BBC31B25661CF9507BCFFFC76B6316327722FE0E3BAE6EDFECE5E77C1316DE96767272D7F6511CDCDA5BE9E5D1141B32807AD9101E536065855B34C7B9C90DA418DD2CC6FD41345039B45323BA63BC0455BE5BCBC7C1C9825882B3FC64E1A7C6DEDB35DC9476F3193BB9D53610547A74E15706335028B702BDDE43BB0679C93839378C3193066AD6ED79B318C73814C28D37C2D91A4EF94B1498CD1B311AA6DE5683C4E815635EC02603291C800B3280820CB1DEBF7FF0034B4A52A7A2A10B9514D8F84E9371F82957293A544C02C5F2A4B285E10336EFEDC26AC173281D7A15E595B3A795153BE2A33C7EB117FE516CB8C5FC58292D77020102041F021D031D7EC405D3E11D031B7B66DF9EFFCC5173B9B1639E4EC920731484EE \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dsa1024.dat b/external/crypto++-5.6.3/TestData/dsa1024.dat deleted file mode 100644 index 8e5912027..000000000 --- a/external/crypto++-5.6.3/TestData/dsa1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dsa1024b.dat b/external/crypto++-5.6.3/TestData/dsa1024b.dat deleted file mode 100644 index edfb808a0..000000000 --- a/external/crypto++-5.6.3/TestData/dsa1024b.dat +++ /dev/null @@ -1 +0,0 @@ -308201B73082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0381850002818100D30312B7179661DA4691EDE39A71CB961199CD792C50AED6EA7E1A24C53590B6BCD92F26509D3372B2849A17C99C0962FBE4A2606CA37E6DF10244805363450FFAA24A7C274DF0B5D24AE7F31A8319FD2AA6E98AC6E7E3364E7AEDE575A9993609B0DFA387084141EA0B5B2D59B6DE718C0DAB4F86BC59F0DBE8602AED933494 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/dsa512.dat b/external/crypto++-5.6.3/TestData/dsa512.dat deleted file mode 100644 index 0d63cfdb6..000000000 --- a/external/crypto++-5.6.3/TestData/dsa512.dat +++ /dev/null @@ -1 +0,0 @@ -3081C60201003081A806072A8648CE38040130819C0241008DF2A494492276AA3D25759BB06869CBEAC0D83AFB8D0CF7CBB8324F0D7882E5D0762FC5B7210EAFC2E9ADAC32AB7AAC49693DFBF83724C2EC0736EE31C80291021500C773218C737EC8EE993B4F2DED30F48EDACE915F0240626D027839EA0A13413163A55B4CB500299D5522956CEFCB3BFF10F399CE2C2E71CB9DE5FA24BABF58E5B79521925C9CC42E9F6F464B088CC572AF53E6D78802041602142070B3223DBA372FDE1C0FFC7B2E3B498B260614 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/elgc1024.dat b/external/crypto++-5.6.3/TestData/elgc1024.dat deleted file mode 100644 index 37518b6fb..000000000 --- a/external/crypto++-5.6.3/TestData/elgc1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082018E028181008B333697371663F8869E3EC80A414E46BBAFE41F6D40E754A01ADA60FE7D12ACD16DE311C4115293114F6B92A54195909276380F04BCD4ED5CD993ED7F516DF7A752B928E5035E0D3A1A979A1CDE8387734338793C02001D59B662D4FC8F2BF0EABB1F553F9F46F57E74BCABCBA4E458812DB601FCD04609D435317181236B9702010202818038FBC56751763146BC107ECC59E9BAD3852EBC38799B41B40EF5745810BCF9DCC6D569B7E61063EA358B0DF2A194910029B72A9CFD11AD240681D3F976EDCB18D79C0530AB2944DC1E314C2B520BE23066C802754C19BF2EC15DE0439E2663383CEA5163DC857B6A5F91079F54FB47C9B33F23A9EB6B3FCBA8581524B3EC5C75028181008B333697371663F8869E3EC80A414E46BBAFE41F6D40E754A01ADA60FE7D12ACD16DE311C4115293114F6B92A54195909276380F04BCD4ED5CD993ED7F516DF7A752B928E5035E0D3A1A979A1CDE8387734338793C02001D59B662D4FC8F2BF0EABB1F553F9F46F57E74BC7F3EC6725F2FC0A6155ADCA43CEE7319E623824852 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/esig1023.dat b/external/crypto++-5.6.3/TestData/esig1023.dat deleted file mode 100644 index 4e43ad462..000000000 --- a/external/crypto++-5.6.3/TestData/esig1023.dat +++ /dev/null @@ -1 +0,0 @@ -3081E00281807040653BA4FCD5C66E3318B31E82654C5A62957F68D2EE6AE10BD6678D7A14EEF8EBF0C85F28FE22056C12B2A2DD4E9C897EB2FF06D57DB03B872C049ED2806DC3E4D86F2947D134065AC642F233F95FBCB55C533274FA91FFDC0CEB9E71B8795B71A977C7956001FC19E28DE18A80B20E4AE8F775B952CEEA0DEFEAE8E93D7F020120022B1EC74E9FC5EEA090E8DDF4BDB64861C7DC3F8EC7E64286EC2FE39DA55B4763C582DB48146521BDEF0146D5022B1E559EB15755298408E4E4C6F4791BF075C7A8C9B3C7F5B7FA3E8C322BA0A160C09A9DB6BBC4974BE0F877 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/esig1536.dat b/external/crypto++-5.6.3/TestData/esig1536.dat deleted file mode 100644 index 8e10d134c..000000000 --- a/external/crypto++-5.6.3/TestData/esig1536.dat +++ /dev/null @@ -1 +0,0 @@ -3082014D0281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD52D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D64CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D4116CE5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1F93193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB020120024100FAF0F292EE96D4F449024F86C0A104E0633C722586EC00AD33E0234629825D2081BA337597889CAC55DC6BEBDD8F13FE3AA2133D6371601A37D195DA7BC45EF3024100EBE16F88887A425AA08E271467CC2220DC44012AB24ED4FF3512A96E8CB600C8BBCB771459FF0EE63D4B6786952A83A7143A775073F0A1D69B6D0B5817755673 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/esig2046.dat b/external/crypto++-5.6.3/TestData/esig2046.dat deleted file mode 100644 index 1c318540a..000000000 --- a/external/crypto++-5.6.3/TestData/esig2046.dat +++ /dev/null @@ -1 +0,0 @@ -308201B70282010028B1F9CDF87EF6D74F3AC2EA83C17CE376215FB2B3B4817145F1A137FB86B0F7BF0F9BA1BDCF7CC15DF1884DD1B150A983279B90F7A1E4392CB3C16390771DA5668E68621C3898DF66BD254F3787ECFB64B3435E707D5C237A6C09F407D8CD618CC3BBFBAB3DEBA38A0D1A88B2A4E09AE32FF2064EF1896348D5B83047EC2E079D85662EED4A66FBB9C159A617EE3C333BAED66989740F54C3CB336C0EF71130786E70648F2698F4F4192DA06C1578FDB065F8E320EFB63049E4BA664F215924B3E89F69131C5987F357C54593BE173A7AED2D37BE69F90CB574EF83AD49145EB15950FADE9E848DA83BC2CACBEDCAFC4A3B31BFFBBFC4DD03B8E47A218A51410201200256033F9C3F8BDDC021503A687BEC90438F38FF9C0E4C050DD95E46BACA370F478B843611A94BC37B5E838AABFD4ECCCE757BAC967DF8A7DD219B3A71A4DA64D54AB367622B7EB9B4282E898755F02036E91D2A12C81F41025603DB3DE2AE2B52889148C98D68F2B7606B0E5112E60E6A6FF5FD98E5D74143C000B43BEC77082F17C1EF4C82127010B12438D498AAFE8521E21EE6391627D464B54D1BE31F57FFF18C27EC38F08093EA65139A61A2C1 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/gostval.dat b/external/crypto++-5.6.3/TestData/gostval.dat deleted file mode 100644 index f89c98bde..000000000 --- a/external/crypto++-5.6.3/TestData/gostval.dat +++ /dev/null @@ -1,23 +0,0 @@ -BE5EC2006CFF9DCF52354959F1FF0CBFE95061B5A648C10387069C25997C0672 -0DF82802B741A292 07F9027DF7F7DF89 - -B385272AC8D72A5A8B344BC80363AC4D09BF58F41F540624CBCB8FDCF55307D7 -1354EE9C0A11CD4C 4FB50536F960A7B1 - -AEE02F609A35660E4097E546FD3026B032CD107C7D459977ADF489BEF2652262 -6693D492C4B0CC39 670034AC0FA811B5 - -320E9D8422165D58911DFC7D8BBB1F81B0ECD924023BF94D9DF7DCF7801240E0 -99E2D13080928D79 8118FF9D3B3CFE7D - -C9F703BBBFC63691BFA3B7B87EA8FD5E8E8EF384EF733F1A61AEF68C8FFA265F -D1E787749C72814C A083826A790D3E0C - -728FEE32F04B4C654AD7F607D71C660C2C2670D7C999713233149A1C0C17A1F0 -D4C05323A4F7A7B5 4D1F2E6B0D9DE2CE - -35FC96402209500FCFDEF5352D1ABB038FE33FC0D9D58512E56370B22BAA133B -8742D9A05F6A3AF6 2F3BB84879D11E52 - -D416F630BE65B7FE150656183370E07018234EE5DA3D89C4CE9152A03E5BFB77 -F86506DA04E41CB8 96F0A5C77A04F5CE diff --git a/external/crypto++-5.6.3/TestData/ideaval.dat b/external/crypto++-5.6.3/TestData/ideaval.dat deleted file mode 100644 index f7cd6fe11..000000000 --- a/external/crypto++-5.6.3/TestData/ideaval.dat +++ /dev/null @@ -1,11 +0,0 @@ -00010002000300040005000600070008 0000000100020003 11FBED2B01986DE5 -00010002000300040005000600070008 0102030405060708 540E5FEA18C2F8B1 -00010002000300040005000600070008 0019324B647D96AF 9F0A0AB6E10CED78 -00010002000300040005000600070008 F5202D5B9C671B08 CF18FD7355E2C5C5 -00010002000300040005000600070008 FAE6D2BEAA96826E 85DF52005608193D -00010002000300040005000600070008 0A141E28323C4650 2F7DE750212FB734 -00010002000300040005000600070008 050A0F14191E2328 7B7314925DE59C09 -0005000A000F00140019001E00230028 0102030405060708 3EC04780BEFF6E20 -3A984E2000195DB32EE501C8C47CEA60 0102030405060708 97BCD8200780DA86 -006400C8012C019001F4025802BC0320 05320A6414C819FA 65BE87E7A2538AED -9D4075C103BC322AFB03E7BE6AB30006 0808080808080808 F5DB1AC45E5EF9F9 diff --git a/external/crypto++-5.6.3/TestData/luc1024.dat b/external/crypto++-5.6.3/TestData/luc1024.dat deleted file mode 100644 index f81dea0c6..000000000 --- a/external/crypto++-5.6.3/TestData/luc1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082015202010002818100B7FE59813AF3A5DA48144EF03E5D229E3CFB55B0E3CEB63F9F973AC8655651409C3B36BBBE83698516F42A2E0FDC87DD83541697249D67FB5A91FA73470089C4997667811283CF22C74856F1E71129DB70FB23620A60E532B7931B7F93C0B9AA6B9D60E87529002BF2204B743773F501F6C370D067C7B22F6AD9DC07E8097347020111024100CFEA6177386C04D1668C984C39A7F889B36BB2B3BED2C7B83241D267F8D2038529AEB56D82CDE43264168873375C8D1F0897666CCC3F617C2F6B52E5143303C7024100E28BAB645993166EE1A984967AE8839EA41685F1E6392DBEB83EE6CA85A54396505DBD4E5C9024BAFCF27AD24D571DC6A3795CE7F0432669BCE742AF8FAF1481024078C6F402C266595B4F85098370528C2C0309BE93F6C45FC049F6AD987471A979FE215CC41455AA85F5A5B664F59E2F8E33C97C211698D14AD05FC65044F99510 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/luc2048.dat b/external/crypto++-5.6.3/TestData/luc2048.dat deleted file mode 100644 index a4b3cefb8..000000000 --- a/external/crypto++-5.6.3/TestData/luc2048.dat +++ /dev/null @@ -1 +0,0 @@ -308202960201000282010100EF8E1C8C8FB330A26C2449F1A50F7BD457D131C66D3194ECA20CE06138CC95CBE32E1DF910E13FF2D74823363286E3461E4BA3037EA32D4728F262C2364692E5948B8577F651292D72EF42445C2AAF11A526D2235DCE172A6E762EB86178BB5B4A06B8736567DB1525C8BDEB7242C81CC9090F5EF7CFC193FABEA3E5B5407E7DFDDF2D557487C65302148969F28DEC68AC3166FD52D44F1DE2EA74451A4BA0508F09E2F4AB85D89E7D68EEE4E8F9BD5A4858BAE8BF36E3A31FF06DDECDD40AE70932ECD09B65617B3208FF203EFBB0D822CDC1887EF343EBECBB762FA9C5D9F9339C80C96D6F3D8E4F7298FF6C94581C3CBC21C8CA94015F2E48400C0556B70502011102818100FDAD5D856662FC0284BEEF8470DC328B3B853F5819F037EBC786EB0225FD5C45B5BF99073F6E6CE31E4D1BC31105A4BAABA3BEC3C28F40E5912E7D3D6E6BE6178164E52F615C65FED1AE61D9D8F858282AF3C59C25A650A9CA72DD2105D95219CFEFEDDEB067647FDBABB659FBF2FF82F33C1A3A8BA73FB5F3D0C5509DFD38FF02818100F1BFA4A7A9506E020F9A57019F4326AE3D974DE9CCEF9BCA284B313DE287378411BDF1C9A1859D9165604EFF2EB1C9A685C0B317A08CF50E5F45AF570EE2C79B35BEA60B38109B4A450E87811CB10D6873F50726248055FE645C5C74FD0482F22CB541D77ED93F8B44CA72C9F550331C516BD061816325F9EF543C4995832BFB0281805184D4DC8796329003CF0EDC79048A12C4C78A1F44D8DE37A5939776A4E19CAA1ADBC4B78BE72EF23F1A5EFFF7377439138ED19D166285D1325CE6C2A7CFA182BDD7B82B2AB63A041C80B17A4D78161C240EDB2D6A494BEB27D28168E02DAE83C50C01EE8384E31111B756DA9B5423A6817F9078E8A750D0DE2CE62CF223601D \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucc1024.dat b/external/crypto++-5.6.3/TestData/lucc1024.dat deleted file mode 100644 index 4366892c1..000000000 --- a/external/crypto++-5.6.3/TestData/lucc1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082013F0201003082011706072A8648CE3804013082010A02818100E16B572E39DB4D90689753D09CEA97B9CAE9C0AF04203AE5BC7FC985B85D5BB50B1EDEA30CAAD003B455640FEEA79E342F3E8CFF6761051B38D6931A2B0FD0DF8E2210E7DA74CAC5DC1A79D80CD8C0F9FC09D81BAEC94E2F3663F25B0140DF6B3D5AD04CBA27BCF24A92963319FB992E39544370FD28642FE07EB17EDA4D47B902818070B5AB971CEDA6C8344BA9E84E754BDCE574E05782101D72DE3FE4C2DC2EADDA858F6F5186556801DA2AB207F753CF1A179F467FB3B0828D9C6B498D1587E86FC7110873ED3A6562EE0D3CEC066C607CFE04EC0DD764A7179B31F92D80A06FB59EAD68265D13DE7925494B198CFDCC971CAA21B87E943217F03F58BF6D26A3DD020107041F021D03BDAFBB087B5A628730212217B01F15B303A0133D6AF4FC3CAF7286A8 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucc512.dat b/external/crypto++-5.6.3/TestData/lucc512.dat deleted file mode 100644 index 9c2cf1aba..000000000 --- a/external/crypto++-5.6.3/TestData/lucc512.dat +++ /dev/null @@ -1 +0,0 @@ -3081B302010030819406072A8648CE380401308188024100B89A4AD4826B8FDDBFE3A6C0F5C8F805B7093AFF9BB2BD697C7D113C236BAC99ABF69000E169575CA2A2DDCDD1C7D9D06C63DCCC880121D933DCF598DD85C52102405C4D256A4135C7EEDFF1D3607AE47C02DB849D7FCDD95EB4BE3E889E11B5D64CD5FB480070B4ABAE51516EE6E8E3ECE83631EE66440090EC99EE7ACC6EC2E291020107041702150268EA4C567B18D0E35B1DA9D517CE5D359CD06779 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucd1024.dat b/external/crypto++-5.6.3/TestData/lucd1024.dat deleted file mode 100644 index 7c2c79f74..000000000 --- a/external/crypto++-5.6.3/TestData/lucd1024.dat +++ /dev/null @@ -1,4 +0,0 @@ -30818702818100EE9C91E2C1D8B0AB999B3F32B3115A36AA95A36B23CC8507D2340FA21EAAF6F6EB -1B900839CD9F8AFBFC155467F91FD8917DD46EAC55A266B246DFFFEDDDA79D674F77884D34709DB3 -452C2C1E2578CCC0CCA91C504039C52762F23F2A391A58B2CAD2DB05666DDF5B9E3C1AC33DB487B7 -70C82B7E7DCDEE4381562FCEE427FD02010A diff --git a/external/crypto++-5.6.3/TestData/lucd512.dat b/external/crypto++-5.6.3/TestData/lucd512.dat deleted file mode 100644 index 9c97005b1..000000000 --- a/external/crypto++-5.6.3/TestData/lucd512.dat +++ /dev/null @@ -1,2 +0,0 @@ -3046024100C339D027E5812ED5D9DE044F3697D0273625E5EA9EC4EF3FB89ADBFA9CD1FBF4D8C0EC -1118C44609F499EF644EEAECE2F38B3F67FAC81A075F31A60B5757A87D020109 diff --git a/external/crypto++-5.6.3/TestData/lucs1024.dat b/external/crypto++-5.6.3/TestData/lucs1024.dat deleted file mode 100644 index 13931998c..000000000 --- a/external/crypto++-5.6.3/TestData/lucs1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082015B0201003082013306072A8648CE3804013082012602818100D57B7B758DC8041CE6CFC57DFE0AAA33FC8FEC48BEEA37562AD13359236FFFF6EED3CEB3A7BBC4269A384ED9A296160F12BC666066548E28201CE293B1791F951C8D2C5965696D82B336EFADCF1E0D619EDA43DBB86415BF3EE6F721C0AB17E770EA7B2360A054D3E4E878647245FCF87B2335098303004CDDC2B9DCDA57DB51021D034E48F160EC5855CCCD9F995988AD1B554AD1B591E64283E91A07D151028180017324ADC1F93CF002FA2B0619C60F897CDED488E457685625E1565377483C0FA4A7FD1CAE848C727E76654434CE3CCAF81EC6E6AAA156EEBBEA095F642FD0DA2D043996ACC14A1B1A6110B19C094638E29890B89AF5812E97C5F96F33B1FD7415079947994442295CA34447807662FB70621F069A98AE274D01B2777BF4E97E041F021D00F9F02A2BC1930F1AC93198F3D532BC937941D7C9A1E16F0EB932476E \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/lucs512.dat b/external/crypto++-5.6.3/TestData/lucs512.dat deleted file mode 100644 index f8fd288b0..000000000 --- a/external/crypto++-5.6.3/TestData/lucs512.dat +++ /dev/null @@ -1 +0,0 @@ -3081C70201003081A806072A8648CE38040130819C024100E64283E91A07D10F557B7B758DC8041CE6CFC57DFE0AAA33FC8FEC48BEEA37562AD13359236FFFF6EED3FB921690D2FD1339F8E1DD406EED70D7EE3085E3AADD02150F4E48F160EC5855CCCD9F995988AD1B554AD1B5F3024062503DFB092F0FD0D8BBD90B50A834A6BD5B0995BCFC1CC8C8C83103AA6837F3FBFF3E042E1B25E36963DB2FCFD7AD24A6626E65A1F6EECBB399F5CE73659F29041702150450A037413E9A711E601318AF21D32A498C0C501E \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/marsval.dat b/external/crypto++-5.6.3/TestData/marsval.dat deleted file mode 100644 index 661872fc3..000000000 --- a/external/crypto++-5.6.3/TestData/marsval.dat +++ /dev/null @@ -1,9 +0,0 @@ -00000000000000000000000000000000 00000000000000000000000000000000 DCC07B8DFB0738D6E30A22DFCF27E886 -00000000000000000000000000000000 DCC07B8DFB0738D6E30A22DFCF27E886 33CAFFBDDC7F1DDA0F9C15FA2F30E2FF -CB14A1776ABBC1CDAFE7243DEF2CEA02 F94512A9B42D034EC4792204D708A69B 225DA2CB64B73F79069F21A5E3CB8522 -86EDF4DA31824CABEF6A4637C40B0BAB 4DF955AD5B398D66408D620A2B27E1A9 A4B737340AE6D2CAFD930BA97D86129F -000000000000000000000000000000000000000000000000 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 97778747D60E425C2B4202599DB856FB -D158860838874D9500000000000000000000000000000000 93A953A82C10411DD158860838874D95 4FA0E5F64893131712F01408D233E9F7 -791739A58B04581A93A953A82C10411DD158860838874D95 6761C42D3E6142D2A84FBFADB383158F F706BC0FD97E28B6F1AF4E17D8755FFF -0000000000000000000000000000000000000000000000000000000000000000 62E45B4CF3477F1DD65063729D9ABA8F 0F4B897EA014D21FBC20F1054A42F719 -FBA167983E7AEF22317CE28C02AAE1A3E8E5CC3CEDBEA82A99DBC39AD65E7227 1344ABA4D3C44708A8A72116D4F49384 458335D95EA42A9F4DCCD41AECC2390D diff --git a/external/crypto++-5.6.3/TestData/mqv1024.dat b/external/crypto++-5.6.3/TestData/mqv1024.dat deleted file mode 100644 index 415377ac6..000000000 --- a/external/crypto++-5.6.3/TestData/mqv1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082011E028181009A21FC66469293103CEF66960B17880F905C738DB692B7481922FC2D454D14067C6BFC158B93FCC1B8D128D4D86D893082F8A3592238EE8B693B6245F26F55968D7D13752D6BFBA271E8E36E11482815D887BB9F6B600E820E7E2AF2EE6ECDBC1CB35B12A4EF48A8907C090482DE7D49B751BB3A50F78BE29506114BC85D3A6102150C896422EC558A74B883BA85E2F10D4A58F28D2B09028180350C4BB19C0A9B224E5E1BACCC1B1952A97628021B4673831C851C3280F06D3EFA73DAE27E5D4E4A0499E0B2B9A369649E883A1F260EF250B5CCF3E3C922332B210EEA07D3BF92210BA7A7374A30DDDE3D1B3D575B77CD36B001EAE4A2A3BFAFF12FCE74F3330B30ACF6DCFF580ECBFB5B00FD5DD2B8EA9DB09C7E1C7100BD67 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/mqv2048.dat b/external/crypto++-5.6.3/TestData/mqv2048.dat deleted file mode 100644 index ef3245669..000000000 --- a/external/crypto++-5.6.3/TestData/mqv2048.dat +++ /dev/null @@ -1 +0,0 @@ -308202280282010100A5C07CE5BF0894C0BA8752F4D9A6D0BF6556D325B618A655CCFE3EEC85B56D47DBDF5A9A5C8588AE6F4C44BBCB339E869A21BE057A243DC797B912C547FBA359C4FC9965C72278370AB6C0DD246197A8D83A08C69425786482D1744C41FBB3C36BEA5963C05B0778AAEF9230C3E2E12072268038E5ADB6433542F94D8C25A6A1785E4D2D97AF119F2139E69AECA46F11B344785A0B1B280CF8D678AB9627780271A350A9B15B92E105F14733C5F15C1753F7C48A645FAAAC1BFA266B5AD6F7C46350465DA31150ABB10FF63FD6C01C849DFCD5645C5D1AF8B967372449DF90D02177E12439BD36A1EED1FAEDB8166927F755B71A5368CC27CD00AB5CF04601E7021D03134944D9AA15697107F48AC5621A1531649AD5EE8EEC1D1F282B5481028201003468652FBB1E3C7F2FBB99A89EA14FB9205F534943034CDE9D9CC57A790D9713EC7B21032EAA8ED2B24FFABD612EDADFC9265964C753AE276380294D4D16C63389A4C392A0058EF1549F6C0D13C4A09759C67650A51F7362B38C61AF2942A6004BB8C3CD4C489E66DE1567E2306821788A519727CD27945DBC5778AC6E8B1DFC05573D76DF9E9AA4F1CE657A2A07BEF833091614C0A6065507BD51099C54148327903626DE6D01FEC9A7F5F9A901C90E219D452C2E2A90AA2303A52776EF174CC85C1AA4F28924B1DFF3E3C5538D820A422374DCFB0D14D620AE282A72416C6506F02D3ED1E6208F66B9DB49294D8D605D7D146BB6A970211289B1BE7AB12531 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/nr1024.dat b/external/crypto++-5.6.3/TestData/nr1024.dat deleted file mode 100644 index 6778ccfb2..000000000 --- a/external/crypto++-5.6.3/TestData/nr1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082014C0201003082012C06072A8648CE3804013082011F02818100F89F4EBE58E222B517D218D615BDC00611501CD18417886BD3FCBD22578C4611B1E8C06EB0FE9D473A5589BC277AA58C1979DC2869B728D78EC38B4C044A790A60314E7BD3DFDC0BBD8B770A9271D7D048F3E13C73866D096C7304782125847C70EDD721B36F1C379CF7CCEE0A728DD66336ED5F93E8A1BD3EDB22C8761EB987021526A578AB11C3A0812A636D24D120BE544B7973E4D302818100BF927ACE4D175A44622494E37F9552E97B74303321FFEF9B76CDECB14F7D612608DDFEA77C04A8FCACCF7F16CB01AE05AD5EDB65C3B9A380D720F34C7D96C8817E2EFF7D0049EE149DF61C52D7C80271206155CDAEBC8A7F4A8DCE5196E3C18FD5EDF11A394C43A5D59BC65D976817438CA0A7F01713548F61355E976DE75E1E04170215247B2531CFF01D1B1665F0CFD2A836446798353330 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/nr2048.dat b/external/crypto++-5.6.3/TestData/nr2048.dat deleted file mode 100644 index d9f11f169..000000000 --- a/external/crypto++-5.6.3/TestData/nr2048.dat +++ /dev/null @@ -1 +0,0 @@ -3082025D0201003082023506072A8648CE38040130820228028201010083C69F32A1F3A67B201D7A92BA204281681DAAD29F50BD866D70A2E01438653B18602AFE606AA925389381682EC0E2CE5D5D366793917879860799ECEDDB4831ED4A4E76D9C34FFDD0BC786588F00E8A19705B997C4298F9CAF9AEE46E0A5677AA1240DC141BD78A8720A829F64C912FA3D961ADE698C5344F18FE4CE70CF7B94F45258C6A9553830FFB80B6BB7E1C510D4526C1904C1D6E2F1B8C1CA6499DBD291438717131804FA2F5F42E5C06293D6DA493C88A38EBC6A6DCF40B2BAB0BF7C7FA0F9C070F1C48FD12CA2B7337E9C58EB9AFDAC6FEEAB0BD62415B26D405D6BF47F11D70B1740BC398A76BE70723A829082EB548D35F4D78E4E015DAD12D5B021D083118E4DC11622CB53E7E4D7634BFBDE45A2D8F8B097A251803505315028201005BAC6CBFE089F75274A532564735786477478F19BE099AB38E0F843393D6D81964CBCFF4B68C5DA2614F06BB844672288F0A65216954990051BA691CA6796AFAAE91A79350F53D9DF3CC688387306EFFDCEF70A14A672E2103B8C861523703157D05DF6EB42DCD81506C88300ED8D8ED40D41AB6D669D309C976B84D82C8D18747578358CBA1EF4B00118B0DEEF11409DD8CB0D83399A33E10C18249574FA2242AE4241CD789C891FEC1C63771EE4517274493240EDAAC44AEDC42F318A5122B052244DFA9A282B8D94BC4BAB360D44E4D0204F8D28817B5B6F808047C92032AA94926D697CFA2FC211FAAE26A5F1FC2B1EB03DA68AD5E01EAC489FB64A66EA3041F021D042ADA16929DA18A7A3C8FDCDD8FC46A6D8AAB79FF33D60E2BF09DEF4F \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rabi1024.dat b/external/crypto++-5.6.3/TestData/rabi1024.dat deleted file mode 100644 index ef8413750..000000000 --- a/external/crypto++-5.6.3/TestData/rabi1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082015202818100D132EDB1360E31D7B8DD84BB03111FDE0243FFE4031ED12B440E7FF36A634E57772EC81FFDC065607494717C6E16A5AB642283553442CC22569535C7A20E3D1C3E2B3747B26E9856D4A13D0325DC116DAAF8554B000321A753E5CFA730CA60F3E3FE2CA9750C6734A2A113AD4A76B6DAC5E199AB55F34CE6984BF56F6DFAC51D020105020102024100F90CBF726FA70ACB5074BD8E79932B74E9949057B627ABB29F41E5057AE699A03BC240EBB9637E956ABC0B6A20F633F78168A908086E2011FC5D030B9B94B51B024100D7097ACACD8BF8ED641A7D8A17A23F8FB385B92B760EEEB9A1233E1D25892F742315DE23DA0751F24EAE4C0C5B696D0AA0D16EAE94194193DC89D479A9626A2702403B5475CD2A7F519EF08433407826D89983C104AF1E74B44B79B31770149D224089300F828E0DF4CBC864BDB394C0F32CCF055F7B2B8872BF0B5F148020637B9C \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rabi2048.dat b/external/crypto++-5.6.3/TestData/rabi2048.dat deleted file mode 100644 index cb638ef7f..000000000 --- a/external/crypto++-5.6.3/TestData/rabi2048.dat +++ /dev/null @@ -1 +0,0 @@ -308202970282010100B8F2A74040753A7706CB98B80DD9EE33FB7969FCA65A2025E96853267AEF80ABB184FE463B9475F5166307FAFA988F6CA4BBC7122E9555755191AA408BAF4464221394342104ED2762EEA4FED8B5CDB4234442AB979A487446AB37C4A4FD67C259EB942E28B50DD54F3AA14447931821291D4C21BB8BD58C41302F3E1D2E6FF84F84AACEC02196282C492E0354985A66EBA50B1903EDF70D98BD9837E694876505760C58C186F0B5F6500711500297956C9825EBDCCF90633239484F9A3572271D3CD585BFC195BED0D5FFCABE785B25BFF6ACFF2B7C125D54B26CFEF60B1B077B2F953960DAEB57F102B6A1E30AA88B643090BC4D8971077C1B54EA61E4E45102011302010D02818100D02603BBFDB55F1063DFCEBB4CA32F551330E0F2901D87DF2A395EF6AF340F6352CE3514FCE85705652DC6BD401CD0D5D13855B124DA172D5183A7474B85B683AA03382775F3D8DC600F33E696246F9F2134E2DA061923F47B85A923EBB375B07DE3B43EE4FD71D3E24B4B416DAE6E4C2B6D32A9B45BF04296AECAD60C33DA0702818100E3773B5D8B828BEA922392100C54CDF41D0CD26B4C34A64F483B7975AB35920DA0E3F6AE238E72E26F8A498D9AD0C4A75C52F25421E1E2E3865ADD1A0FCEA4DE932DBE6EBEFA689494855B11714B960F57C5102C0E8876D253ABA8C2D6A511DBC0F30589A0FBE66AD6BCEFDFC4F67F8347726A52736274B7F744ECACFF6198E702818100BF84B25DB607930F80ED57C7AF89E7604B7E8E0D341C9C4A0C94FFE6D4B38810553B1E92F7BF9651D3D0149A9188E1FFD1FB86753A327ABC6169AF92271E7204A2C76488FBC781984BA99C3C48C8A799054DA34A201743C3064B4609831B35FBA2B8B1BC67FFD0C685DBA92FE688AD51D1F161C06EC0B9E0D0E187863BFBBEC0 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rc2val.dat b/external/crypto++-5.6.3/TestData/rc2val.dat deleted file mode 100644 index b4f82a312..000000000 --- a/external/crypto++-5.6.3/TestData/rc2val.dat +++ /dev/null @@ -1,48 +0,0 @@ -08 -3F -00000000 00000000 -00000000 00000000 -ebb773f9 93278eff - -08 -40 -ffffffff ffffffff -ffffffff ffffffff -278b27e4 2e2f0d49 - -08 -40 -30000000 00000000 -10000000 00000001 -30649edf 9be7d2c2 - -01 -40 -88 -00000000 00000000 -61a8a244 adacccf0 - -07 -40 -88bca90e 90875a -00000000 00000000 -6ccf4308 974c267f - -10 -40 -88bca90e 90875a7f 0f79c384 627bafb2 -00000000 00000000 -1a807d27 2bbe5db1 - -10 -80 -88bca90e 90875a7f 0f79c384 627bafb2 -00000000 00000000 -2269552a b0f85ca6 - -21 -81 -88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 - c42fceb0 be255daf 1e -00000000 00000000 -5b78d3a4 3dfff1f1 diff --git a/external/crypto++-5.6.3/TestData/rc5val.dat b/external/crypto++-5.6.3/TestData/rc5val.dat deleted file mode 100644 index ea2b617fa..000000000 --- a/external/crypto++-5.6.3/TestData/rc5val.dat +++ /dev/null @@ -1,5 +0,0 @@ -00000000000000000000000000000000 0000000000000000 21A5DBEE154B8F6D -915F4619BE41B2516355A50110A9CE91 21A5DBEE154B8F6D F7C013AC5B2B8952 -783348E75AEB0F2FD7B169BB8DC16787 F7C013AC5B2B8952 2F42B3B70369FC92 -DC49DB1375A5584F6485B413B5F12BAF 2F42B3B70369FC92 65C178B284D197CC -5269F149D41BA0152497574D7F153125 65C178B284D197CC EB44E415DA319824 diff --git a/external/crypto++-5.6.3/TestData/rc6val.dat b/external/crypto++-5.6.3/TestData/rc6val.dat deleted file mode 100644 index 3efa3c9f2..000000000 --- a/external/crypto++-5.6.3/TestData/rc6val.dat +++ /dev/null @@ -1,17 +0,0 @@ -00000000000000000000000000000000 - 00000000000000000000000000000000 8FC3A53656B1F778C129DF4E9848A41E - -0123456789ABCDEF0112233445566778 - 02132435465768798A9BACBDCEDFE0F1 524E192F4715C6231F51F6367EA43F18 - -000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000 6cd61bcb190b30384e8a3f168690ae82 - -0123456789abcdef0112233445566778899aabbccddeeff0 - 02132435465768798a9bacbdcedfe0f1 688329d019e505041e52e92af95291d4 - -0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000 8f5fbd0510d15fa893fa3fda6e857ec2 - -0123456789abcdef0112233445566778899aabbccddeeff01032547698badcfe - 02132435465768798a9bacbdcedfe0f1 c8241816f0d7e48920ad16a1674e5d48 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rijndael.dat b/external/crypto++-5.6.3/TestData/rijndael.dat deleted file mode 100644 index c3e43f047..000000000 --- a/external/crypto++-5.6.3/TestData/rijndael.dat +++ /dev/null @@ -1,9 +0,0 @@ -000102030405060708090A0B0C0D0E0F 000102030405060708090A0B0C0D0E0F 0A940BB5416EF045F1C39458C653EA5A -00010203050607080A0B0C0D0F101112 506812A45F08C889B97F5980038B8359 D8F532538289EF7D06B506A4FD5BE9C9 -14151617191A1B1C1E1F202123242526 5C6D71CA30DE8B8B00549984D2EC7D4B 59AB30F4D4EE6E4FF9907EF65B1FB68C -28292A2B2D2E2F30323334353738393A 53F3F4C64F8616E4E7C56199F48F21F6 BF1ED2FCB2AF3FD41443B56D85025CB1 -00010203050607080A0B0C0D0F10111214151617191A1B1C 2D33EEF2C0430A8A9EBF45E809C40BB6 DFF4945E0336DF4C1C56BC700EFF837F -1E1F20212324252628292A2B2D2E2F30323334353738393A 6AA375D1FA155A61FB72353E0A5A8756 B6FDDEF4752765E347D5D2DC196D1252 -3C3D3E3F41424344464748494B4C4D4E5051525355565758 BC3736518B9490DCB8ED60EB26758ED4 D23684E3D963B3AFCF1A114ACA90CBD6 -00010203050607080A0B0C0D0F10111214151617191A1B1C1E1F202123242526 834EADFCCAC7E1B30664B1ABA44815AB 1946DABF6A03A2A2C3D0B05080AED6FC -28292A2B2D2E2F30323334353738393A3C3D3E3F41424344464748494B4C4D4E D9DC4DBA3021B05D67C0518F72B62BF1 5ED301D747D3CC715445EBDEC62F2FB4 diff --git a/external/crypto++-5.6.3/TestData/rsa1024.dat b/external/crypto++-5.6.3/TestData/rsa1024.dat deleted file mode 100644 index 70fb17246..000000000 --- a/external/crypto++-5.6.3/TestData/rsa1024.dat +++ /dev/null @@ -1,32 +0,0 @@ -30820274020100300D06092A864886F70D010101 -05000482025E3082025A02010002818100A39D4F -72D1BCFF65A47545C2897C0464CE9181E8703421 -2EC04407C4C24D569AA20C58B8138C85E17510BC -6B861CADA9034C3ECE3B050B546E97D2BDC07A07 -CF8A612F7D3646739633041893EF18C411264E45 -C9E033A1BD5EE5FA02D95E9A9ADA2D0C6DF480E3 -2FA3FCE02889798455CE53F084AAB4C5549266F7 -CE8C77DF1D0201110281800E6FC33ED64561D443 -378627C0D63C9F7BA36D584622B7A23E241ECD98 -AC78952C6A804C7A320BD020EAE372E62FB4F853 -1D50D5F6261796823A929845B06A19B35A5227CB -C819852A9CBE588CC2D1CEE07F426D13C2BF2FCA -1C99FDEEFDFE387859E2B3F654E85A71481A71E9 -D5256583B1200F29C1AA0F437CFDC2AEAF218102 -4100D5DDB104AD074F6C1B8192D9AC8AED4DE05C -F5C6509490DA8CCFC91FDF7B3A1323E03894DCAA -B2587716D652A56904F86244E10C1B8FA597C389 -2591C55DBD65024100C3D930B583B8AD9A349218 -795C988CF0004F09DA04FFEF6FDF7CB4FA654F74 -B262521FE185693CD6290A337589F62CDEECE24E -CCB5E79865275540F3B603FB59024064A48F89BA -D6437E2B0FCCA2AB8CABE86995285D5318BCA315 -167CC3B47639726B3C56DCA41417B128FBB026E4 -6DA7FC6A7AC441EEDA2FCEF29AE480D5594A1102 -40228FBD4D355CD35772B05EAC014818DF0F1D01 -BD0FF0EE04AEF7E3B3B7867E015CA514AF53C746 -F89DD49FAB5494DABDED9159332F28DEA8705A56 -C198974A79024100D1DCA40FBD19036F0E2A9438 -7D03C090DDF0A677CDE0B8634A81F247752A355E -C1CEA2482A4887767145C2BA703C9C10228FDA1E -BB2EBEA73D23AA9C34182179 diff --git a/external/crypto++-5.6.3/TestData/rsa2048.dat b/external/crypto++-5.6.3/TestData/rsa2048.dat deleted file mode 100644 index 83200c275..000000000 --- a/external/crypto++-5.6.3/TestData/rsa2048.dat +++ /dev/null @@ -1,61 +0,0 @@ -308204BB020100300D06092A864886F70D010101 -0500048204A5308204A10201000282010100BB25 -80EB6B368287A0A3BDDF6AAA9EDA2EEF15D92C5F -E0B1C21473175C39B685A6FB0B0DB611092C19B4 -FA3CA5BB20F311E35B2E1097F48B077DF7684BEB -9A34EB78C7B5F02ADFAEA3F3A66F1EF91B0C47DE -68F0501F80A7E9603F794E928949F152C049A011 -D7E58C72F9303781E4FE7129DD7B87B5448D440A -62CE8E9C801F245039E2724A9C37CB17457950B7 -B3C4C9BE4D17A29EFC1EA1EF464FBD21DABE9F10 -ED0EB132405D68E4304008083BB675DA97CB6219 -147A1EB93D38A9C4023540F871272A85B45447B3 -6DE9A708E412CD31B1CB6470E4A37CBEA6000F36 -632DF86FD3C34466C63BD80F1350E4DD5081597F -F34F94F07AE6430DCC0563B1F7CF020111028201 -00034D763A5DC03580E33616ED5ABABA855B2E62 -4495DD8D002009656B5473772C85F55F10CE81CE -77BE31E04657410B1F6535B4CF1E6914E152F4AB -84DA2FD409F81BBB3DF0A96A58EACC9501F60162 -5C1356BF97D139C78A7E18496708EA7DE7B47266 -C81363B3FF888085E7403A028901FF3BA04C2EDE -930EC0EFAC4DCF8FD054C1119562A1C7CA455D79 -36CB95A16CE611ABC97918961DE6720CE171CC69 -A590E9A041EC1DAC6FDCF2E04946C100E03DEFCA -29FF480C926CD48589EB832D4476CF38AB320754 -D97BE77FDB9E5F2DCA1A2ABBC33D0790FE8C22CF -694BB8E0265733A5A17CC5D07DB54515DC80216A -A23A43EB12783888FF424EDB26FAF7DCB9028181 -00EB4C87F67AEA3F2047BF9DF61947DF2BA7E1C1 -64A03A8E3ED5F3BC6CDEE99FC6251C6A28F9502F -0A4B5A0CFA8038A12A2270AAE2C9342EDBA207CE -0F170B6D07550670CFEAE730B9411E66CD2D485F -3FC3E9C5348D32C768F68A53C756E66BE0FAC7E8 -FDC9FBE22644961782DA5DDC19D75B64D2E8B660 -052DDC95AD186633E902818100CB9C7830223B78 -FC28A6D2B77C50C3D389F32FC4DEF33341741205 -5102F8D852663DB44E1EA5E5E58A71D30D33C168 -E94855D79CC19CC7DFBAFBDFF7710490064A1375 -1CD75466219956B9D4C0AF0CC13E7D075F54E6AF -8CD67FBE3F4AB90425B039410686A168421E2E24 -FF0319D9D3F1C685BB650BC7B5BD12090CBDC392 -F702818060E3470B238DA185C330C89282E15BE4 -CCA84092D89094ECB2736BB45BC99C2469A249D4 -A2E4C8134C34237634CC06206888BED5DA60C800 -158ABE4272E6964E502FD41960B98C888439B1DC -039645567DD8BA9D2B14E8B2BFDE9AF7BA5EE120 -674341D1E9C211D385A736DB871796DD76CB47A2 -239663C5E5B52E9291937EC902818053D704500E -187D1C8935A20F514E6EC08418D76F2EA060663E -DA3E6CA6DEEFA97564B3A7B2444F9AC08938C933 -6DC1C9782358C8137CCAC5893A8965E33E1D2FC4 -262129FE4FEDD1997E10488B935F9ADD7EC6CCE6 -B957581C167B83791F01B52A71ED99467EB27593 -F4E20EA6EC86DECCF7643E1A8C614AD561C77DB7 -8CC40B02818100AF950A287679E6C55020400E8A -AD0642DB1C11D9AD5AE85F1B6FD2829D869453C9 -F67C0210D0847A4BD47C57FAECD9BE540BD66989 -E6C43F62D725B3D841B4F1DB7C28A722337358C8 -D1CD55F5CA6E31FAD6F827756BA074944D345C8D -2FCE759F4244B948D06F5AC863DEAAEF279B2F69 -955ADAD1F39DEA9DA028B94EF22F11 diff --git a/external/crypto++-5.6.3/TestData/rsa400pb.dat b/external/crypto++-5.6.3/TestData/rsa400pb.dat deleted file mode 100644 index ccbc6ae2c..000000000 --- a/external/crypto++-5.6.3/TestData/rsa400pb.dat +++ /dev/null @@ -1,10 +0,0 @@ -30 4c 30 0d 06 09 2a 86 -48 86 f7 0d 01 01 01 05 -00 03 3b 00 30 38 02 33 -00 a3 07 9a 90 df 0d fd -72 ac 09 0c cc 2a 78 b8 -74 13 13 3e 40 75 9c 98 -fa f8 20 4f 35 8a 0b 26 -3c 67 70 e7 83 a9 3b 69 -71 b7 37 79 d2 71 7b e8 -34 77 cf 02 01 03 diff --git a/external/crypto++-5.6.3/TestData/rsa400pv.dat b/external/crypto++-5.6.3/TestData/rsa400pv.dat deleted file mode 100644 index 2a7312341..000000000 --- a/external/crypto++-5.6.3/TestData/rsa400pv.dat +++ /dev/null @@ -1,41 +0,0 @@ - 30 81 fb - 02 01 00 - 02 - 33 00 a3 07 9a 90 df 0d - fd 72 ac 09 0c cc 2a 78 - b8 74 13 13 3e 40 75 9c - 98 fa f8 20 4f 35 8a 0b - 26 3c 67 70 e7 83 a9 3b - 69 71 b7 37 79 d2 71 7b - e8 34 77 cf - 02 01 03 - 02 - 32 6c af bc 60 94 b3 fe - 4c 72 b0 b3 32 c6 fb 25 - a2 b7 62 29 80 4e 68 65 - fc a4 5a 74 df 0f 8f b8 - 41 3b 52 c0 d0 e5 3d 9b - 59 0f f1 9b e7 9f 49 dd - 21 e5 eb - 02 1a 00 cf 20 - 35 02 8b 9d 86 98 40 b4 - 16 66 b4 2e 92 ea 0d a3 - b4 32 04 b5 cf ce 91 - 02 - 1a 00 c9 7f b1 f0 27 f4 - 53 f6 34 12 33 ea aa d1 - d9 35 3f 6c 42 d0 88 66 - b1 d0 5f - 02 1a 00 8a 15 - 78 ac 5d 13 af 10 2b 22 - b9 99 cd 74 61 f1 5e 6d - 22 cc 03 23 df df 0b - 02 - 1a 00 86 55 21 4a c5 4d - 8d 4e cd 61 77 f1 c7 36 - 90 ce 2a 48 2c 8b 05 99 - cb e0 3f - 02 1a 00 83 ef - ef b8 a9 a4 0d 1d b6 ed - 98 ad 84 ed 13 35 dc c1 - 08 f3 22 d0 57 cf 8d \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rsa512a.dat b/external/crypto++-5.6.3/TestData/rsa512a.dat deleted file mode 100644 index e7edefae7..000000000 --- a/external/crypto++-5.6.3/TestData/rsa512a.dat +++ /dev/null @@ -1,35 +0,0 @@ -30 82 01 50 - 02 01 00 - 30 0d - 06 09 - 2a 86 48 86 f7 0d 01 01 01 - 05 00 - 04 82 01 3a - 30 82 01 36 - 02 01 00 - 02 40 - 0a 66 79 1d c6 98 81 68 de 7a b7 74 19 bb 7f b0 - c0 01 c6 27 10 27 00 75 14 29 42 e1 9a 8d 8c 51 - d0 53 b3 e3 78 2a 1d e5 dc 5a f4 eb e9 94 68 17 - 01 14 a1 df e6 7c dc 9a 9a f5 5d 65 56 20 bb ab - 02 03 01 00 01 - 02 40 - 01 23 c5 b6 1b a3 6e db 1d 36 79 90 41 99 a8 9e - a8 0c 09 b9 12 2e 14 00 c0 9a dc f7 78 46 76 d0 - 1d 23 35 6a 7d 44 d6 bd 8b d5 0e 94 bf c7 23 fa - 87 d8 86 2b 75 17 76 91 c1 1d 75 76 92 df 88 81 - 02 20 - 33 d4 84 45 c8 59 e5 23 40 de 70 4b cd da 06 5f - bb 40 58 d7 40 bd 1d 67 d2 9e 9c 14 6c 11 cf 61 - 02 20 - 33 5e 84 08 86 6b 0f d3 8d c7 00 2d 3f 97 2c 67 - 38 9a 65 d5 d8 30 65 66 d5 c4 f2 a5 aa 52 62 8b - 02 20 - 04 5e c9 00 71 52 53 25 d3 d4 6d b7 96 95 e9 af - ac c4 52 39 64 36 0e 02 b1 19 ba a3 66 31 62 41 - 02 20 - 15 eb 32 73 60 c7 b6 0d 12 e5 e2 d1 6b dc d9 79 - 81 d1 7f ba 6b 70 db 13 b2 0b 43 6e 24 ea da 59 - 02 20 - 2c a6 36 6d 72 78 1d fa 24 d3 4a 9a 24 cb c2 ae - 92 7a 99 58 af 42 65 63 ff 63 fb 11 65 8a 46 1d diff --git a/external/crypto++-5.6.3/TestData/rw1024.dat b/external/crypto++-5.6.3/TestData/rw1024.dat deleted file mode 100644 index dcd0209bd..000000000 --- a/external/crypto++-5.6.3/TestData/rw1024.dat +++ /dev/null @@ -1 +0,0 @@ -3082014D02818100BECF1F40456801F6965E603BEBB61F530F0B17BBCB00E3A8866EB9BC84AE3892A4CB040280F568FC650B1734014CA78A200D5E4AB394CBB75C0034DCC47643E6F576A39F850C5F4528048165B084C82E9BA6BA4CFBCB3980F1EB47EC2C348EF52A6225A85AF743DFCEF5CD4583EB0B9C0DA77ABEBEB5BCC513D81BD768B579AD024100F06CA9C1FBE20EE2440F3AB2F9A9787D820943EAF59B6B8D103CFAB1C2F595DDC99D05DC73F9D1DB780B6F8B26CF87E58EB870DD983A2515600DF80C3EBB7B1B024100CB2B9BDEB0D508E21E646C86D836442FC16910D68C8D1D18BB1327899A506C16C1162E93EA7C2CB576B750AEAB152255D5AB22632025CFFAD927A070CBAEA2D7024100C90A853BEC7C25D773FDDB95C11CEF9BB3F487953773F07E42DB9D011325AE2725663478FB7F0EC1A5608280D9656BF3B9F463FF8B23F1CA1B543508D51826E2 \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/rw2048.dat b/external/crypto++-5.6.3/TestData/rw2048.dat deleted file mode 100644 index 5547c88b1..000000000 --- a/external/crypto++-5.6.3/TestData/rw2048.dat +++ /dev/null @@ -1 +0,0 @@ -3082029002820101008F2975B4DA54179A6C81764DB9E6B50AD925C91568DFE2C245DF9103AF39370BD5F25CD26BF6E41B6FEB0E24473BBFAE89343BC20743057B056BD2189C01258650567A3EC24040EED7EEAF94B77BDD39529807D1FCF5FF4A90E6B42BA58FF1FDCDACF981C641B8F077ABBB41BEFD53CCABF06745CD009A7F9DFAA61ED03F11466E4B5370DFA18C7DFEA1689B60F98012CDE9131FE86F74BFC6B93AC449DA73A2366EA2AE2233AFFBFF0CDE1899B1F852C179639B31CEE11991AA8D46DB5067B0C5FFB3D913612668F0C43CA134B11875F271C0BC8722AF4AD6CC93A43CE165EF31C1EB542ECC7CA1A38BFDF66F3A2175E4EA7159E168FFE3A549535B90C7BBDD02818100C5CEBA84E8B7C20BAA6F450000803F15C1160EB7E0875EBBC15F11DC7E3CAFE55973234FF4C74589406D2950B0C236ABE1B5A5B70D55C035F45D87AF089847C0E2A2DEF23EA4CC19FB5419DF43577523248BEF80B94C59F7342C717F12DE68FEEADAD97BA2DD436834D8559D0A7A31D6F9D9480F852C285EFC75BCA8AF32590302818100B947440D272629155C2B3E0E62B76124281155F7A189650D36C8F7D742F7DBC571ADDCC582ED2ED283C2E8A1CD8C996D3D8A50F33C56581285C5016A16DEDA533715DF519CAB7777F3DCB9F5335552F315B44FF8126DFDDF60B66850AA8FD108ED3A248D18E7473D7967F0F15C740C67476A75273DA254AE5C7B94FB059DD19F0281801EE99173837363981E0988DE22B2E36BFC9713EDC8454BF1CB764D767DFDA985B9DBAA346C0C39B1A9F83D849502AFDD80AE33F588C114BC4DE5FA949125FF56908F8C66CDFF6BF601F1CBF463B0C807DEABB1290C358FC0433ED74EBA074CB211C4D75538ED017F497C9722D8C3D3E082BB4A8A92D5768B5D5963BBDB1DB24D \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/saferval.dat b/external/crypto++-5.6.3/TestData/saferval.dat deleted file mode 100644 index cdcad06fd..000000000 --- a/external/crypto++-5.6.3/TestData/saferval.dat +++ /dev/null @@ -1,16 +0,0 @@ -0000000000000000 0000000000000000 032808C90EE7AB7F -0000000000000000 0102030405060708 7D28038633B92EB4 -0102030405060708 1011121314151617 71E5CF7F083A59C5 -0102030405060708 18191A1B1C1D1E1F 356F702CC7FA8161 -08070605040302010807060504030201 5051525354555657 38E64DBF6E0F896E -08070605040302010807060504030201 58595A5B5C5D5E5F 7D8F014A902480FE -01020304050607080807060504030201 6061626364656667 113511C22E7936DF -01020304050607080807060504030201 68696A6B6C6D6E6F 9EEB2D17C0581437 -0000000000000001 7071727374757677 9ABE2C85BE2D7614 -0000000000000001 78797A7B7C7D7E7F EBC4A9C6C25CF215 -0102030405060708 8081828384858687 54E72BA2D744C566 -0102030405060708 88898A8B8C8D8E8F 57F55D0F7EB6F8FE -00000000000000010000000000000001 9091929394959697 9EAA4DF1E0EFF445 -00000000000000010000000000000001 98999A9B9C9D9E9F 4CC14838399E532D -01020304050607080000000000000000 A0A1A2A3A4A5A6A7 41246B65F1DC6AFA -00000000000000000102030405060708 A0A1A2A3A4A5A6A7 5CBD77B03626FE3B diff --git a/external/crypto++-5.6.3/TestData/serpentv.dat b/external/crypto++-5.6.3/TestData/serpentv.dat deleted file mode 100644 index bccbf3734..000000000 --- a/external/crypto++-5.6.3/TestData/serpentv.dat +++ /dev/null @@ -1,12 +0,0 @@ -00000000000000000000000000000000 d29d576fcea3a3a7ed9099f29273d78e b2288b968ae8b08648d1ce9606fd992d -00000000000000000000000000000000 d29d576fcea3a3a7ed9099f26d8c2871 563a8403ff5309d62370b1dcf5a11edd -ffeeddccbbaa99887766554433221100 1032547698badcfeefcdab8967452301 d5baa00a4bb9d8a7c981c8dc90d89d92 -ffeeddccbbaa99887766554433221100 145f0b8b663176b95dcab7e9dcd5cc24 1032547698badcfeefcdab8967452301 -80000000000000000000000000000000 00000000000000000000000000000000 264E5481EFF42A4606ABDA06C0BFDA3D -000000000000000000000000000000000000000000000000 d29d576fceaba3a7ed9899f2927bd78e 130e353e1037c22405e8faefb2c3c3e9 -8899aabbccddeeffffeeddccbbaa99887766554433221100 1032547698badcfeefcdab8967452301 da860842b720802bf404a4c71034879a -8899aabbccddeeffffeeddccbbaa99887766554433221100 b2696bd0d98c17953e4239225d27202c 1032547698badcfeefcdab8967452301 -000102030405060708090A0B0C0D0E0F1011121314151617 4528CACCB954D450655E8CFD71CBFAC7 00112233445566778899AABBCCDDEEFF -0000000000000000000000000000000000000000000000000000000000000000 92074732d84e1841a013a0034c52bf50 81c4eb7b8ad9a8d0f2aa5d7bd626b560 -00112233445566778899aabbccddeeffffeeddccbbaa99887766554433221100 1032547698badcfeefcdab8967452301 93df9a3cafe387bd999eebe393a17fca -000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F 3DA46FFA6F4D6F30CD258333E5A61369 00112233445566778899AABBCCDDEEFF \ No newline at end of file diff --git a/external/crypto++-5.6.3/TestData/shacal2v.dat b/external/crypto++-5.6.3/TestData/shacal2v.dat deleted file mode 100644 index 169b55f0f..000000000 --- a/external/crypto++-5.6.3/TestData/shacal2v.dat +++ /dev/null @@ -1,14 +0,0 @@ -80000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 361AB6322FA9E7A7BB23818D839E01BDDAFDF47305426EDD297AEDB9F6202BAE -00000000000000000000000000000001 0000000000000000000000000000000000000000000000000000000000000000 7308AEC23D25A231B26448AFE78D5047804C5011B9B5F95C16DF2670551F0001 -00000000000000000000000000000000 8000000000000000000000000000000000000000000000000000000000000000 2CAE7C0460EE2FC3200923A1B6C2ABEEA746C8B44F6C3FB941BD3AF02A3E6E3E -00000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000001 45D43E9288738C5AD1A683D8DE59CEDD22D666A2B7078EB1301B532A272D570B -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 7CA51614425C3BA8CE54DD2FC2020AE7B6E574D198136D0FAE7E26CCBF0BE7A6 -01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 0101010101010101010101010101010101010101010101010101010101010101 C4B7C6A9738C77EE28F7E685C8358E0AF88FB6D23955EE6DF49FE3F5DA16F826 -02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 0202020202020202020202020202020202020202020202020202020202020202 CD108DD9EC1000B79C75AA3DCC88F913E6F52773853035A5C44F3245B134CBFF -04040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404 0404040404040404040404040404040404040404040404040404040404040404 6AA777340200C1B65AB25193A8BB267C233DAC7E1B3C523D406FC5B567B7B586 -08080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808 0808080808080808080808080808080808080808080808080808080808080808 A23BE32D37FA4054EC45D6A9CC643AF9124EDAA4AD9ABC7FAAB449D39D11B128 -10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010 F64819DFBEBE0A6DB650E7072CE28EA606586418B317785FF0AD44212A84C82C -20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 2020202020202020202020202020202020202020202020202020202020202020 E267D6113C27170A3EE6DF496E801A6131BBD3444365D7C03791E25610F1A0E4 -40404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040 4040404040404040404040404040404040404040404040404040404040404040 C97909916EE86FFDCE8A92903046109B53F788A53039434DF1A394DAD6F697A2 -80808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 8080808080808080808080808080808080808080808080808080808080808080 C3C1CD5F3060B3EC4E6ABC0818B68449E1750FB482368C8F3305270E16F98735 -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 0598127BAF11706F77402000D730C54A0B84C868A98C6CA4D7F3C0FA06A78B7A diff --git a/external/crypto++-5.6.3/TestData/sharkval.dat b/external/crypto++-5.6.3/TestData/sharkval.dat deleted file mode 100644 index 637387a9f..000000000 --- a/external/crypto++-5.6.3/TestData/sharkval.dat +++ /dev/null @@ -1,7 +0,0 @@ -00000000000000000000000000000000 0000000000000000 214BCF4E7716420A -000102030405060708090A0B0C0D0E0F 0000000000000000 C76C696289898137 -000102030405060708090A0B0C0D0E0F C76C696289898137 077A4A59FAEEEA4D -915F4619BE41B2516355A50110A9CE91 21A5DBEE154B8F6D 6FF33B98F448E95A -783348E75AEB0F2FD7B169BB8DC16787 F7C013AC5B2B8952 E5E554ABE9CED2D2 -DC49DB1375A5584F6485B413B5F12BAF 2F42B3B70369FC92 9AE068313F343A7A -5269F149D41BA0152497574D7F153125 65C178B284D197CC D3F111A282F17F29 diff --git a/external/crypto++-5.6.3/TestData/skipjack.dat b/external/crypto++-5.6.3/TestData/skipjack.dat deleted file mode 100644 index 6991a1e0d..000000000 --- a/external/crypto++-5.6.3/TestData/skipjack.dat +++ /dev/null @@ -1 +0,0 @@ -11223344556677889900 aabbccdd00112233 00d3127ae2ca8725 diff --git a/external/crypto++-5.6.3/TestData/squareva.dat b/external/crypto++-5.6.3/TestData/squareva.dat deleted file mode 100644 index 4eddd1a0b..000000000 --- a/external/crypto++-5.6.3/TestData/squareva.dat +++ /dev/null @@ -1,8 +0,0 @@ -00000000000000000000000000000000 00000000000000000000000000000000 3C00428F8ABBC0B84F057CC19C26F8CF -000102030405060708090A0B0C0D0E0F 00000000000000000000000000000000 FF596FA668BFC3014200AE01E2BBA0A0 -000102030405060708090A0B0C0D0E0F 000102030405060708090A0B0C0D0E0F 7C3491D94994E70F0EC2E7A5CCB5A14F -000102030405060708090A0B0C0D0E0F C76C696289898137077A4A59FAEEEA4D 88C6FF4B92604C6E66656B02DDAF9F40 -915F4619BE41B2516355A50110A9CE91 21A5DBEE154B8F6D6FF33B98F448E95A 3388801F66E7FCC0BCE522A23A4F0C7F -783348E75AEB0F2FD7B169BB8DC16787 F7C013AC5B2B8952E5E554ABE9CED2D2 A1C0E9215141343DEC2B556942C92BDE -DC49DB1375A5584F6485B413B5F12BAF 2F42B3B70369FC929AE068313F343A7A 3FBE6811B998CDF3E50ABDE2F3C075E3 -5269F149D41BA0152497574D7F153125 65C178B284D197CCD3F111A282F17F29 D7B7209E0879744C782809B6D2E0B1B0 diff --git a/external/crypto++-5.6.3/TestData/twofishv.dat b/external/crypto++-5.6.3/TestData/twofishv.dat deleted file mode 100644 index 54fbc379c..000000000 --- a/external/crypto++-5.6.3/TestData/twofishv.dat +++ /dev/null @@ -1,9 +0,0 @@ -00000000000000000000000000000000 00000000000000000000000000000000 9F589F5CF6122C32B6BFEC2F2AE8C35A -00000000000000000000000000000000 9F589F5CF6122C32B6BFEC2F2AE8C35A D491DB16E7B1C39E86CB086B789F5419 -9F589F5CF6122C32B6BFEC2F2AE8C35A D491DB16E7B1C39E86CB086B789F5419 019F9809DE1711858FAAC3A3BA20FBC3 -D491DB16E7B1C39E86CB086B789F5419 019F9809DE1711858FAAC3A3BA20FBC3 6363977DE839486297E661C6C9D668EB -000000000000000000000000000000000000000000000000 00000000000000000000000000000000 EFA71F788965BD4453F860178FC19101 -EFA71F788965BD4453F860178FC191010000000000000000 88B2B2706B105E36B446BB6D731A1E88 39DA69D6BA4997D585B6DC073CA341B2 -88B2B2706B105E36B446BB6D731A1E88EFA71F788965BD44 39DA69D6BA4997D585B6DC073CA341B2 182B02D81497EA45F9DAACDC29193A65 -0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 57FF739D4DC92C1BD7FC01700CC8216F -D43BB7556EA32E46F2A282B7D45B4E0D57FF739D4DC92C1BD7FC01700CC8216F 90AFE91BB288544F2C32DC239B2635E6 6CB4561C40BF0A9705931CB6D408E7FA diff --git a/external/crypto++-5.6.3/TestData/usage.dat b/external/crypto++-5.6.3/TestData/usage.dat deleted file mode 100644 index 7830f0c35..000000000 --- a/external/crypto++-5.6.3/TestData/usage.dat +++ /dev/null @@ -1,81 +0,0 @@ -Test Driver for Crypto++(R) Library, a C++ Class Library of Cryptographic Schemes - -- To generate an RSA key - cryptest g - -- To encrypt and decrypt a string using RSA - cryptest r - -- To sign a file using RSA - cryptest rs privatekeyfile messagefile signaturefile - -- To verify a signature of a file using RSA - cryptest rv publickeyfile messagefile signaturefile - -- To digest a file using several hash functions in parallel - cryptest m file - -- To encrypt and decrypt a string using DES-EDE in CBC mode - cryptest t - -- To encrypt or decrypt a file - cryptest e|d input output - -- To secret share a file (shares will be named file.000, file.001, etc) - cryptest ss threshold number-of-shares file - -- To reconstruct a secret-shared file - cryptest sr file share1 share2 [....] - (number of shares given must be equal to threshold) - -- To information disperse a file (shares will be named file.000, file.001, etc) - cryptest id threshold number-of-shares file - -- To reconstruct an information-dispersed file - cryptest ir file share1 share2 [....] - (number of shares given must be equal to threshold) - -- To gzip a file - cryptest z compression-level input output - -- To gunzip a file - cryptest u input output - -- To encrypt a file with AES in CTR mode - cryptest ae input output - -- To base64 encode a file - cryptest e64 input output - -- To base64 decode a file - cryptest d64 input output - -- To hex encode a file - cryptest e16 input output - -- To hex decode a file - cryptest d16 input output - -- To forward a TCP connection - cryptest ft source-port destination-host destination-port - -- To run the FIPS 140-2 sample application - cryptest fips - -- To generate 100000 random files using FIPS Approved X.917 RNG - cryptest fips-rand - -- To run Maurer's randomness test on a file - cryptest mt input - -- To run a test script (available in TestVectors subdirectory) - cryptest tv filename - -- To run validation tests - cryptest v - -- To display version number - cryptest V - -- To run benchmarks - cryptest b [time allocated for each benchmark in seconds] [frequency of CPU in gigahertz] diff --git a/external/crypto++-5.6.3/TestData/xtrdh171.dat b/external/crypto++-5.6.3/TestData/xtrdh171.dat deleted file mode 100644 index c75ff48d8..000000000 --- a/external/crypto++-5.6.3/TestData/xtrdh171.dat +++ /dev/null @@ -1,3 +0,0 @@ -305F02160559DCD66A95A57249A15BAD6B431BF2CD58615B901D02153365CFA0D3B1B6577B2DB243 -DDE45EDB91C18B0F5F0216032F4EBA0911B3D0B14F6F1292A74DFFD4A8FCF22C1802160211CB3EDA -809FA0FF8C3A8AE691EC4C95A06A3395CF diff --git a/external/crypto++-5.6.3/TestData/xtrdh342.dat b/external/crypto++-5.6.3/TestData/xtrdh342.dat deleted file mode 100644 index ce67aaaf7..000000000 --- a/external/crypto++-5.6.3/TestData/xtrdh342.dat +++ /dev/null @@ -1,5 +0,0 @@ -3081A6022B28E3FED51D3D861D962B0A16A92ACDB380ADAFB478CA555004C3AF387F853F9DE9921C -7DCB40098D25C757021D03094844F135A3A50049A848C3FC02412FCBED6040FB1BDE99A4D93E3B02 -2B13F411960B85F9B031A247E072046892B1EE6C95A47242A839F8E24B96B88F37B4BDA2C6D253BC -0AAF29F1022B0D2AFE639D324E558B2B312E435E03957769D745C881D259DDFD2F48F9C08F82ECCF -F4E7ADD47C705896D0 diff --git a/external/crypto++-5.6.3/TestVectors/Readme.txt b/external/crypto++-5.6.3/TestVectors/Readme.txt deleted file mode 100644 index b0b0aa1b1..000000000 --- a/external/crypto++-5.6.3/TestVectors/Readme.txt +++ /dev/null @@ -1,76 +0,0 @@ -Test Data Format - -A test data file is an ASCII text file composed of sections separated by -blank lines. Each section is stand-alone and independent of other -sections that may be in the same file, and contains one or more tests. - -A section is composed of a sequence of fields. Each field is one or more -lines composed of a field name, followed by a colon (":"), followed by a -field body. All but the last line of a field must end with a backslash -("\"). If any line contains a hash mark ("#"), the hash mark and -everything after it on the same line is not considered part of the field -body. - -Each section must contain fields named AlgorithmType, Name, Source, and -Test. The presence and semantics of other fields depend on the algorithm -being tested and the tests to be run. - -Each section may contain more than one test and therefore more than one -field named Test. In that case the order of the fields is significant. A -test should always use the last field with any given name that occurs -before the Test field. - -Data Types - -int - small integer (less than 2^32) in decimal representation -string - human readable string -encoded string - can be one of the following - - quoted string: "message" means "message" without the quotes - or terminating '\0' - - hex encoded string: 0x74657374 or 74657374 means "test" - - repeated string: r100 "message" to repeat "message" 100 times, or - r256 0x0011 to repeat 0x0011 256 times - -Field Types - -AlgorithmType - string, for example "Signature", "AsymmetricCipher", -"SymmetricCipher", "MAC", "MessageDigest", or "KeyFactory" -Name - string, an algorithm name from SCAN -Test - string, identifies the test to run -Source - string, text explaining where the test data came from -Comment - string, other comments about the test data -KeyFormat - string, specifies the key format. "Component" here means -each component of the key or key pair is specified separately as a name, -value pair, with the names depending on the algorithm being tested. -Otherwise the value names "Key", or "PublicKey" and "PrivateKey" are -used. -Key - encoded string -PublicKey - encoded string -PrivateKey - encoded string -Message - encoded string, message to be signed or verified -Signature - encoded string, signature to be verified or compared -with -Plaintext - encoded string -Ciphertext - encoded string -Header - encoded string -Footer - encoded string -DerivedKey - encoded string -DerivedLength - encoded string -Digest - encoded string -TruncatedSize - int, size of truncated digest in bytes -Seek - int, seek location for random access ciphers -(more to come here) - -Possible Tests - -KeyPairValidAndConsistent - public and private keys are both valid and -consistent with each other -PublicKeyInvalid - public key validation should not pass -PrivateKeyInvalid - private key validation should not pass -Verify - signature/digest/MAC verification should pass -VerifyTruncated - truncated digest/MAC verification should pass -NotVerify - signature/digest/MAC verification should not pass -DeterministicSign - sign message using given seed, and the resulting -signature should be equal to the given signature -DecryptMatch - ciphertext decrypts to plaintext -(more to come here) diff --git a/external/crypto++-5.6.3/TestVectors/aes.txt b/external/crypto++-5.6.3/TestVectors/aes.txt deleted file mode 100644 index 5f967f426..000000000 --- a/external/crypto++-5.6.3/TestVectors/aes.txt +++ /dev/null @@ -1,241 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: AES/ECB -Source: NIST Special Publication 800-38A -Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 -Comment: F.1.1 ECB-AES128.Encrypt -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 3ad77bb40d7a3660a89ecaf32466ef97 f5d3d58503b9699de785895a96fdbaaf 43b1cd7f598ece23881b00e3ed030688 7b0c785e27e8ad3f8223207104725dd4 -Test: Encrypt -Comment: F.1.3 ECB-AES192.Encrypt -Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b -Ciphertext: bd334f1d6e45f25ff712a214571fa5cc 974104846d0ad3ad7734ecb3ecee4eef ef7afd2270e2e60adce0ba2face6444e 9a4b41ba738d6c72fb16691603c18e0e -Test: Encrypt -Comment: F.1.5 ECB-AES256.Encrypt -Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 -Ciphertext: f3eed1bdb5d2a03c064b5a7e3db181f8 591ccb10d410ed26dc5ba74a31362870 b6ed21b99ca6f4f9f153e7b1beafed1d 23304b7a39f9f3ff067d8d8f9e24ecc7 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/ECB -Source: Generated by Crypto++ 5.6.1 -Comment: long test vector -Plaintext: r8 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c371000 -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 84C6CBDC2B5A39985774B23BAB066A6AF8CB66C08E4F058E5D3E7C351EA845CEC7B209210EE7EFD38269628687F21CB9BCEA349DC0418ADBA2BF2364DF4DB1A11AD84CF6A422CE95C37B2CF81196245CD857D0B954B83985C1888230F3C301847AAF714253EF768C17E89E4F5513DBD5BEE1266A2B2D7063CE3D0BA8716252C5BCBB9922CD46F374B52FDFF1FEBF155FF4AFEE18788999BC74234A3FFBA7B2858BB2552F172E56EC47456878440ABB5ADAE49941C1E43616AC5D6E31A011611B829F6A77BE1F50754F81F35D24ED89FDE804B17363F9A81C3F12AE067FDD41A2984912CAE1926C5FB3AC18E541FA4AD1E171888E61428F2A8F2E981AE16D0D4E41D33E5E675F446DAE0F454FC4CA056F41F3CC4744A9E948428B2280F96663B7230C09692503C95B3E34F8DE8DF23157F45BDF689B258D994D9E6CE5D4DD6BDB96763CCC41DBBE57A4778D5A9E90226D614C335E44CA8AB41EFEA898BC170C65412F77194A43A1305EF23AC70B059E6E047796EF518D7696BC3DAD5E2634F92DD1C90D206A2B6D3A7CE88668BEAD64614E9000ACFBA79EB3601606214E21E08F14CE77E36BB66FE4A0FCD2A21BCAA2391A9C2016AC3BC7CDF1438EB6DD26696644583E2B0A0C68629D736F6723DF66859CF80B4E5B5C5BF03F334D65C48DB3B2660E2CE33B510FD60C912B85D16AEE7CDBFDF6285B0A77BAE07D987F9CE172A548E6BF0A30CF099AA82BE0A25E0E8919 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/CBC -Source: NIST Special Publication 800-38A -IV: 000102030405060708090a0b0c0d0e0f -Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 -Comment: F.2.1 CBC-AES128.Encrypt -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 7649abac8119b246cee98e9b12e9197d 5086cb9b507219ee95db113a917678b2 73bed6b8e3c1743b7116e69e22229516 3ff1caa1681fac09120eca307586e1a7 -Test: Encrypt -Comment: F.2.3 CBC-AES192.Encrypt -Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b -Ciphertext: 4f021db243bc633d7178183a9fa071e8 b4d9ada9ad7dedf4e5e738763f69145a 571b242012fb7ae07fa9baac3df102e0 08b0e27988598881d920a9e64f5615cd -Test: Encrypt -Comment: F.2.5 CBC-AES256.Encrypt -Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 -Ciphertext: f58c4c04d6e5f1ba779eabfb5f7bfbd6 9cfc4e967edb808d679f777bc6702c7d 39f23369a9d9bacfa530e26304231461 b2eb05e2c39be9fcda6c19078c6a9d1b -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/CBC -Source: RFC 3602 -Comment: Case 1: Encrypting 16 bytes (1 block) using AES-CBC with 128-bit key -Key : 0x06a9214036b8a15b512e03d534120006 -IV : 0x3dafba429d9eb430b422da802c9fac41 -Plaintext : "Single block msg" -Ciphertext: 0xe353779c1079aeb82708942dbe77181a -Test: Encrypt -Comment: Case 2: Encrypting 32 bytes (2 blocks) using AES-CBC with 128-bit key -Key : 0xc286696d887c9aa0611bbb3e2025a45a -IV : 0x562e17996d093d28ddb3ba695a2e6f58 -Plaintext : 0x000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f -Ciphertext: 0xd296cd94c2cccf8a3a863028b5e1dc0a 7586602d253cfff91b8266bea6d61ab1 -Test: Encrypt -Comment: Case 3: Encrypting 48 bytes (3 blocks) using AES-CBC with 128-bit key -Key : 0x6c3ea0477630ce21a2ce334aa746c2cd -IV : 0xc782dc4c098c66cbd9cd27d825682c81 -Plaintext : "This is a 48-byte message (exactly 3 AES blocks)" -Ciphertext: 0xd0a02b3836451753d493665d33f0e886 2dea54cdb293abc7506939276772f8d5 021c19216bad525c8579695d83ba2684 -Test: Encrypt -Comment: Case 4: Encrypting 64 bytes (4 blocks) using AES-CBC with 128-bit key -Key : 0x56e47a38c5598974bc46903dba290349 -IV : 0x8ce82eefbea0da3c44699ed7db51b7d9 -Plaintext : 0xa0a1a2a3a4a5a6a7a8a9aaabacadaeaf b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf -Ciphertext: 0xc30e32ffedc0774e6aff6af0869f71aa 0f3af07a9a31a9c684db207eb0ef8e4e 35907aa632c3ffdf868bb7b29d3d46ad 83ce9f9a102ee99d49a53e87f4c3da55 -Test: Encrypt - - -AlgorithmType: SymmetricCipher -Name: AES/CBC -Source: Generated by Crypto++ 5.6.1 -Comment: long test vector -IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: r8 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c371000 -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 6544CCA076C4D67C1A69DD7E504C6586FBD22912505E187D8628E19FA067D6C339D078E3032B8596DA74BB0E23434F83E153D5ACD5DEF7D264F58EC685317BF50C93430791718D6E09CCC4804FFE4EEB5C6AD8E9B5DFD456EDE81081627A97FC2FAE9F1955377D7774E68EAB541B20CE3C915185BCA208EE08428C400043F2DC90B0390756762C9271946FCE214B9576F74399E466DAC48C6DD10B420F302941DCC27D55CF1FB59D71954950CAD893FFFA70970D128C77BFA34F3C84B0B64A01194A086ACDD9847D6B91B7F870D0E7591CA07F0B407005F1473C37A648F6E18044336F30418BA43FD7AA5B5BAE01A0E33B1EDA4487730F043E202DE44CB901BD3AED13D790D05F325C414831EB601BD918678C1B8E116877CE1167F87204B49619D323713F95C04CA9621FDCF44BD21C5E36A299C486C8FC0D3043EDFF424B9A7AA5500DC3BD7BF6FAB256E6B45B458058DC933F1FF8C5E841BFC7F405761E14B12B48C1C108F33BF8D65BB8DBB9ED7E92398E779333730F4C68922AA76409E842E76B649B981B8269186220ACFF9DFA198D62CBF4CFA0FE05C1427CE63A345A61FE460D14EF25D7A89E2E228B415757B4E4110B6AFA7D85D48C3BCF184FDD7366F06D9E3D29896B0D3C0D83FCFA881E6EC5F29B0294628EDFF284E58B7BE19D37A6B28D70DC0F165A4B60CE5536D76D1A71849C36B0837E4E5082A05208CEEB320C57F0F5B86DC3CAAC8A32DEA9552D -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/CFB -Source: NIST Special Publication 800-38A -IV: 000102030405060708090a0b0c0d0e0f -Plaintext: 6bc1bee22e409f96e93d7e117393172aae2d8 -FeedbackSize: 1 -Comment: F.3.7 CFB8-AES128.Encrypt -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 3b79424c9c0dd436bace9e0ed4586a4f32b9 -Test: Encrypt -Comment: F.3.9 CFB8-AES192.Encrypt -Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b -Ciphertext: cda2521ef0a905ca44cd057cbf0d47a0678a -Test: Encrypt -Comment: F.3.11 CFB8-AES256.Encrypt -Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 -Ciphertext: dc1f1a8520a64db55fcc8ac554844e889700 -Test: Encrypt -Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 -FeedbackSize: 16 -Comment: F.3.13 CFB128-AES128.Encrypt -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 3b3fd92eb72dad20333449f8e83cfb4a c8a64537a0b3a93fcde3cdad9f1ce58b 26751f67a3cbb140b1808cf187a4f4df c04b05357c5d1c0eeac4c66f9ff7f2e6 -Test: Encrypt -Comment: F.3.15 CFB128-AES192.Encrypt -Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b -Ciphertext: cdc80d6fddf18cab34c25909c99a4174 67ce7f7f81173621961a2b70171d3d7a 2e1e8a1dd59b88b1c8e60fed1efac4c9 c05f9f9ca9834fa042ae8fba584b09ff -Test: Encrypt -Comment: F.3.17 CFB128-AES256.Encrypt -Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 -Ciphertext: dc7e84bfda79164b7ecd8486985d3860 39ffed143b28b1c832113c6331e5407b df10132415e54b92a13ed0a8267ae2f9 75a385741ab9cef82031623d55b1e471 -Test: Encrypt - - -AlgorithmType: SymmetricCipher -Name: AES/CFB -Source: Generated by Crypto++ 5.6.1 -Comment: long test vector with odd length -IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: ECE71ECD7A4E3C2F643B2B0BFBED32F365C96D626048D13C65962ED08445B5EE74B11203E24C0ACCD3CC13F39963632D8F4B8F8BB16B7901373C32FFD27472957A8448E414A26BB10CAE9BCFBF332BA677D59C0CCD4CCE5B34298E2B1F3250092CF602B5476922D9FA13D4AE9F54841D889FE71D67A79315A621BDAECB2FD3F1ECDAB0DC9FBDFB85AE1633038A44E15DEF1B6DDBC4AB47BB128E1C2DE8A17FD1107D8587CE96088709E17DA23DE6993973A43DFB59801A9691B7EBF5565C4FF842F5132E99288FA4CE3E6CE9333DEE052212E71EF08C5E2E385A787F1567C0CD05A4D11BF40CA19B8D49A231AA55CDE1B8C531C9FCD3B9C70AABD65372E582FCE7528B6BD8F89AA6489B1F085AE024D5A964CAEC4F3F5726CBACDB5D8429F6741FE102BC27E10724C30A64A7D3ED11F6FF41908920A1326793C7C7EDDDD2F79D8A3CE804AE53E59E43B2E0E69AF69A79D7A97A12C0A1AC7331369FCE4072879AA998CD1DC6296CB02D4B97803F1F3713F922796148E2263AFA6A72CF30C3C00297ABF2AD2D559AC4D0011A839FAAA261BB17966E80FF243B65B6209C2732F294F33936A3B8FE7C9BEBE50686BBE7F0FDCF9E24281242B10844037D9AB8A342B954B69E6456243CC13959E1B014A1389BA69B9C4E1C0869C7FE3292ED72FCF183B216F7F5EB5A7CD0A2493BCA160AE6142F4CF03110CA4782CA6C8ED558CA8AF4B14ADC4C368FF0C0CD014F7E117F56D797EF45294C8D3BCED9D5D4E3FA60592031E2925ABA72DFE5AC1D88081DB6CF68DCB256A822CE891AD12F5BB34F39CE974F7D23C0B7AB3BF12D854DA60617EB5E479A9740E00A1DCA267A3D1D212F25A06B83106CBD624CC745ACB31E0EA774F6E0D765D6134F74A3AF5B3846649C14539B7C01B484C54F71B2C5016C2EA57B16472145511130D79E23271151F370DB8A626DB218F73FF0ABFE066E2782696F6984923AA074AEA9E059AEC18F50D4E03F4B17BAD856E6C962604A02 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/OFB -Source: NIST Special Publication 800-38A -IV: 000102030405060708090a0b0c0d0e0f -Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 -Comment: F.4.1 OFB-AES128.Encrypt -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 3b3fd92eb72dad20333449f8e83cfb4a 7789508d16918f03f53c52dac54ed825 9740051e9c5fecf64344f7a82260edcc 304c6528f659c77866a510d9c1d6ae5e -Test: Encrypt -Comment: F.4.3 OFB-AES192.Encrypt -Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b -Ciphertext: cdc80d6fddf18cab34c25909c99a4174 fcc28b8d4c63837c09e81700c1100401 8d9a9aeac0f6596f559c6d4daf59a5f2 6d9f200857ca6c3e9cac524bd9acc92a -Test: Encrypt -Comment: F.4.5 OFB-AES256.Encrypt -Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 -Ciphertext: dc7e84bfda79164b7ecd8486985d3860 4febdc6740d20b3ac88f6ad82a4fb08d 71ab47a086e86eedf39d1c5bba97c408 0126141d67f37be8538f5a8be740e484 -Test: Encrypt - - -AlgorithmType: SymmetricCipher -Name: AES/OFB -Source: Generated by Crypto++ 5.6.1 -Comment: long test vector with odd length -IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: ECE71ECD7A4E3C2F643B2B0BFBED32F3B3D63D91F8B99D5EA9D0AA2D977A8675EDD972802EB60B3D8FA629EF94358D46861CF60D9F89F481632F937182C78E49D53D132260CFC3A80943E0FD169C6091FF4BBBBDEC35F4A31DDB61AFA087750D6CFCF86DAB13330125D60A2732E43A2AF3E47ABE4824C5B17DD747F267149A321ADA13409D51D4FC685ADA6789D5785FCA5EF199FD96A03879B4147C4936CC32DE864520C98DD55408CA8ED4AF1BE1F133ED53CA9FF58E6862D3E900AE66EEF75272B547BBC8919CE5503981684FEBA088F5E73BF272C820656CC9627FB4E4FC3A92A6B815CAC558B3257614AA9BB2CF2409D3633B6570EEF67A9343502D2B528078E561782917D977E6F76B13CD6526512D3D4C803BBB58E54EED5B4057EAF85DE83A7EC53FACBCA7E03EB7E027910C8DA25B75BE33B41C0C594DF6D781E821193963C9F658D380A460561B2F0C9C3D7639A4E4EE2DA87653DA86FAD6D5280857CEC28CC40D082C81C672D9B36CD169A6803ACA4C8DAAD77953B296FBAF480FA146F8B41DCBD487A368851A207C90228DBF7BAEEB38F23F98520E52145D809DB530D3E690C2A91B8367B815C4FFC0AE7171582169D6A7FD073A1F9DE1182FC98D1D5B3E39B44E054218B80091333D5B751C0530BADF4361C5A95CB26634AE788F7B6D2CCA543FDE48172A24E4D991F9262CFB8ED09FFE4E1506DA6478EF879847F8CE44569A9AC66E124CEE5944D2DC87742CA1B598B3C7D54662F8A5783A0C6689C949C54E148C2C88DFBA4F10F0234BA62E4DDEA30F5AD3D209829CCB73C22141D56050FB75E0E7D1B822F6FFC6AB92E8DB12A5C6B62064B692F8B118CC38F0436433B5370CE5A79D09A7081703EEA59F64B7361AA50476DD2F7074CA37C51935DCBC78A806F92C1186033070D5C3FABACAAE39CB7FBA0654D13413E94F6E9FDDB7D2D4EC1985CCF2E2011C186BD0C16AA95A0C7FDDF1B36490780EB646EEB7B0B377E970FD7D2E9A06 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/CTR -Source: NIST Special Publication 800-38A -IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: 6bc1bee22e409f96e93d7e117393172a ae2d8a571e03ac9c9eb76fac45af8e51 30c81c46a35ce411e5fbc1191a0a52ef f69f2445df4f9b17ad2b417be66c3710 -Comment: F.5.1 CTR-AES128.Encrypt -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: 874d6191b620e3261bef6864990db6ce 9806f66b7970fdff8617187bb9fffdff 5ae4df3edbd5d35e5b4f09020db03eab 1e031dda2fbe03d1792170a0f3009cee -Test: Encrypt -Comment: F.5.3 CTR-AES192.Encrypt -Key: 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b -Ciphertext: 1abc932417521ca24f2b0459fe7e6e0b 090339ec0aa6faefd5ccc2c6f4ce8e94 1e36b26bd1ebc670d1bd1d665620abf7 4f78a7f6d29809585a97daec58c6b050 -Test: Encrypt -Comment: F.5.5 CTR-AES256.Encrypt -Key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 -Ciphertext: 601ec313775789a5b7a7f504bbf3d228 f443e3ca4d62b59aca84e990cacaf5c5 2b0930daa23de94ce87017ba2d84988d dfc9c58db67aada613c2dd08457941a6 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/CTR -Source: RFC 3686 -#Test Vector #1: Encrypting 16 octets using AES-CTR with 128-bit key -Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E -Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 -IV: 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 01 -Ciphertext : E4 09 5D 4F B7 A7 B3 79 2D 61 75 A3 26 13 11 B8 -Test: Encrypt -#Test Vector #2: Encrypting 32 octets using AES-CTR with 128-bit key -Key : 7E 24 06 78 17 FA E0 D7 43 D6 CE 1F 32 53 91 63 -Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F -IV: 00 6C B6 DB C0 54 3B 59 DA 48 D9 0B 00 00 00 01 -Ciphertext : 51 04 A1 06 16 8A 72 D9 79 0D 41 EE 8E DA D3 88 EB 2E 1E FC 46 DA 57 C8 FC E6 30 DF 91 41 BE 28 -Test: Encrypt -#Test Vector #3: Encrypting 36 octets using AES-CTR with 128-bit key -Key : 76 91 BE 03 5E 50 20 A8 AC 6E 61 85 29 F9 A0 DC -Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 -IV: 00 E0 01 7B 27 77 7F 3F 4A 17 86 F0 00 00 00 01 -Ciphertext : C1 CF 48 A8 9F 2F FD D9 CF 46 52 E9 EF DB 72 D7 45 40 A4 2B DE 6D 78 36 D5 9A 5C EA AE F3 10 53 25 B2 07 2F -Test: Encrypt -#Test Vector #4: Encrypting 16 octets using AES-CTR with 192-bit key -Key : 16 AF 5B 14 5F C9 F5 79 C1 75 F9 3E 3B FB 0E ED 86 3D 06 CC FD B7 85 15 -Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 -IV: 00 00 00 48 36 73 3C 14 7D 6D 93 CB 00 00 00 01 -Ciphertext : 4B 55 38 4F E2 59 C9 C8 4E 79 35 A0 03 CB E9 28 -Test: Encrypt -#Test Vector #5: Encrypting 32 octets using AES-CTR with 192-bit key -Key : 7C 5C B2 40 1B 3D C3 3C 19 E7 34 08 19 E0 F6 9C 67 8C 3D B8 E6 F6 A9 1A -Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F -IV: 00 96 B0 3B 02 0C 6E AD C2 CB 50 0D 00 00 00 01 -Ciphertext : 45 32 43 FC 60 9B 23 32 7E DF AA FA 71 31 CD 9F 84 90 70 1C 5A D4 A7 9C FC 1F E0 FF 42 F4 FB 00 -Test: Encrypt -#Test Vector #6: Encrypting 36 octets using AES-CTR with 192-bit key -Key : 02 BF 39 1E E8 EC B1 59 B9 59 61 7B 09 65 27 9B F5 9B 60 A7 86 D3 E0 FE -Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 -IV: 00 07 BD FD 5C BD 60 27 8D CC 09 12 00 00 00 01 -Ciphertext : 96 89 3F C5 5E 5C 72 2F 54 0B 7D D1 DD F7 E7 58 D2 88 BC 95 C6 91 65 88 45 36 C8 11 66 2F 21 88 AB EE 09 35 -Test: Encrypt -#Test Vector #7: Encrypting 16 octets using AES-CTR with 256-bit key -Key : 77 6B EF F2 85 1D B0 6F 4C 8A 05 42 C8 69 6F 6C 6A 81 AF 1E EC 96 B4 D3 7F C1 D6 89 E6 C1 C1 04 -Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 -IV: 00 00 00 60 DB 56 72 C9 7A A8 F0 B2 00 00 00 01 -Ciphertext : 14 5A D0 1D BF 82 4E C7 56 08 63 DC 71 E3 E0 C0 -Test: Encrypt -#Test Vector #8: Encrypting 32 octets using AES-CTR with 256-bit key -Key : F6 D6 6D 6B D5 2D 59 BB 07 96 36 58 79 EF F8 86 C6 6D D5 1A 5B 6A 99 74 4B 50 59 0C 87 A2 38 84 -Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F -IV: 00 FA AC 24 C1 58 5E F1 5A 43 D8 75 00 00 00 01 -Ciphertext : F0 5E 23 1B 38 94 61 2C 49 EE 00 0B 80 4E B2 A9 B8 30 6B 50 8F 83 9D 6A 55 30 83 1D 93 44 AF 1C -Test: Encrypt -#Test Vector #9: Encrypting 36 octets using AES-CTR with 256-bit key -Key : FF 7A 61 7C E6 91 48 E4 F1 72 6E 2F 43 58 1D E2 AA 62 D9 F8 05 53 2E DF F1 EE D6 87 FB 54 15 3D -Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 -IV: 00 1C C5 B7 51 A5 1D 70 A1 C1 11 48 00 00 00 01 -Ciphertext : EB 6C 52 82 1D 0B BB F7 CE 75 94 46 2A CA 4F AA B4 07 DF 86 65 69 FD 07 F4 8C C0 B5 83 D6 07 1F 1E C0 E6 B8 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: AES/CTR -Source: Generated by Crypto++ 5.6.1 -Comment: long test vector with odd length -IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: ECE71ECD7A4E3C2F643B2B0BFBED32F31C8551B6306D52CF843EC0B85015DC203B1C0B643E2A6BABAF5133DA0EA06616076AA6BBB52ED75DC3A71A9A6E8AC7C9A00D2C39AA68BF4E6FFED9AAEE5AD6914FB3EA77C7B61FF6BF564F2F1225ACB4B5889CB1559888A5817849C382E168482F75381F63868C468E4D1583B1FE71DD808CB94D8150AAB9D530A0FC17CDE748E95545D8A033B2F61F1954D0C0226168022E1CD7E031C57D048AC560F152960F47705E174D956D4BB53AE80BFFCD1BD569ED8EFFA223C00558B702405F33E6E0EDB2D9B0C148A1441CC80D6ABBCE785AA1B9DAB7CB8832F1B12D2EE60EE2DFCA37942CA1724E5602B7B70525AC9662028A22DB234676615DB474538CBC8D197F38C88BCC4F9E8D207538CA18DE5F095420A2E4D5868CEBB8B34A9377DC52D119790B65210F1B346F5E00D9BD00A8847048913D80726B9B745D565E6284B986DBAEA997FFC5A0DE5051527D44B2C1266DBC9130A6EB15F37A0F00B6286D6678CA651C07743BD37F2E8F6A94F5ED8C63428AE4883A9695183807E104BC335C64FEAAC40A605913DF98FF44E0801B31A968CCE5DCAFADE1E017FA711E05FF5A54BFA1999C2C463F97A3A66B30211BD306C8911C98F8EE5EF47A54746A4D16B7C7424A6954B4FC3BCF1A41BDE8A19CE1027AE86A320D0E5E7D3C7E50CFD0C4665B811D86C313F09ADE5B4DBE017231859881E5873E9EDB2011CF5920D2F7277C4DE1AC430A1849F0B870A69ABE701B6D0B5123E5FF53395409177CF84BF41EC33C5E4BCC2CF29258DC7C260471AABDA49FDE62915758EE4E578D0F7698E6456BC144573739D5D508CC76B389359D2A0ECB5B7EE5FCB4C3151D5AF7C71819EA3DD5F36C7B27E551FD2373D07FFDC76A13FC4B10A6F29A83D6F465ACB6960671EACF21A3E1CB4411C4DAA0C2A87DAED28AEE60B7EC0258A9AF125F2DDC80B9877EFE0F372D9B832C786770A84EA1A07CB6E1A9907D651BBD0EFDEF2AFFC3 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/all.txt b/external/crypto++-5.6.3/TestVectors/all.txt deleted file mode 100644 index e6e3d7bbf..000000000 --- a/external/crypto++-5.6.3/TestVectors/all.txt +++ /dev/null @@ -1,32 +0,0 @@ -AlgorithmType: FileList -Name: all.txt collection -Test: TestVectors/tea.txt -Test: TestVectors/wake.txt -Test: TestVectors/camellia.txt -Test: TestVectors/shacal2.txt -Test: TestVectors/ttmac.txt -Test: TestVectors/whrlpool.txt -Test: TestVectors/dlies.txt -Test: TestVectors/dsa.txt -Test: TestVectors/dsa_1363.txt -Test: TestVectors/esign.txt -Test: TestVectors/hmac.txt -Test: TestVectors/nr.txt -Test: TestVectors/rsa_oaep.txt -Test: TestVectors/rsa_pkcs1_1_5.txt -Test: TestVectors/rsa_pss.txt -Test: TestVectors/rw.txt -Test: TestVectors/seal.txt -Test: TestVectors/sha.txt -Test: TestVectors/sha3.txt -Test: TestVectors/panama.txt -Test: TestVectors/aes.txt -Test: TestVectors/salsa.txt -Test: TestVectors/vmac.txt -Test: TestVectors/sosemanuk.txt -Test: TestVectors/ccm.txt -Test: TestVectors/gcm.txt -Test: TestVectors/cmac.txt -Test: TestVectors/eax.txt -Test: TestVectors/mars.txt -Test: TestVectors/hkdf.txt diff --git a/external/crypto++-5.6.3/TestVectors/camellia.txt b/external/crypto++-5.6.3/TestVectors/camellia.txt deleted file mode 100644 index f88d05b7c..000000000 --- a/external/crypto++-5.6.3/TestVectors/camellia.txt +++ /dev/null @@ -1,8646 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: Camellia/ECB -Source: NESSIE submission -Comment: Tests with 128-bit keys -Comment: Set 1, vector 0 -Key: 80000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6C227F749319A3AA7DA235A9BBA05A2C -Test: Encrypt -Comment: Set 1, vector 1 -Key: 40000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F04D51E45E70FB6DEE0D16A204FBBA16 -Test: Encrypt -Comment: Set 1, vector 2 -Key: 20000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: ED44242E619F8C32EAA2D3641DA47EA4 -Test: Encrypt -Comment: Set 1, vector 3 -Key: 10000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AC640BBBF84CD3B8E8258BF66C210AE2 -Test: Encrypt -Comment: Set 1, vector 4 -Key: 08000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8A42BDA76C84B8960B23530100AFB748 -Test: Encrypt -Comment: Set 1, vector 5 -Key: 04000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1D20D15F3EE21EE6051803ADF83E31D7 -Test: Encrypt -Comment: Set 1, vector 6 -Key: 02000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6896B2FB85D26A243BB5697F6A764307 -Test: Encrypt -Comment: Set 1, vector 7 -Key: 01000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 43A865A61E1117008372932EA9CE8BB2 -Test: Encrypt -Comment: Set 1, vector 8 -Key: 00800000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CB5ECC200DDE8E9076A8AEA2250F49E4 -Test: Encrypt -Comment: Set 1, vector 9 -Key: 00400000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0B2A489718DC0B0E11F11C1D3913F4A8 -Test: Encrypt -Comment: Set 1, vector 10 -Key: 00200000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1D28A0A70B3C72ADC5B77487AD442873 -Test: Encrypt -Comment: Set 1, vector 11 -Key: 00100000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 26D344959095765A3DD6986B656F353D -Test: Encrypt -Comment: Set 1, vector 12 -Key: 00080000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 048248D32A74DB80DAF5642417F7832A -Test: Encrypt -Comment: Set 1, vector 13 -Key: 00040000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 44D400F8752F16B20DB95A959917B650 -Test: Encrypt -Comment: Set 1, vector 14 -Key: 00020000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E885DD9B2794459B2133BC84B59C2DED -Test: Encrypt -Comment: Set 1, vector 15 -Key: 00010000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 89D6E4182FD0DD7E4038710F597DD242 -Test: Encrypt -Comment: Set 1, vector 16 -Key: 00008000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7FE5BA5FF1D0EB81132A3DA0CD8E829D -Test: Encrypt -Comment: Set 1, vector 17 -Key: 00004000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 470FEDAAA6FFFCBC48AF8B3859B1E45F -Test: Encrypt -Comment: Set 1, vector 18 -Key: 00002000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B6FA2D9F41110E6914890AF888C36091 -Test: Encrypt -Comment: Set 1, vector 19 -Key: 00001000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 46D2C0FD0C3A4D2B5CA6BA5E14382DCA -Test: Encrypt -Comment: Set 1, vector 20 -Key: 00000800000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 730D700DCC5AB632DD9D92C6D1C18E5A -Test: Encrypt -Comment: Set 1, vector 21 -Key: 00000400000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 067D56D80AF5D2F24D84F518B8FC7920 -Test: Encrypt -Comment: Set 1, vector 22 -Key: 00000200000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 027F6EE9F54534E4C21F9263B68BAEA0 -Test: Encrypt -Comment: Set 1, vector 23 -Key: 00000100000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D115CB2324E8FDA3576DEE57E49CC315 -Test: Encrypt -Comment: Set 1, vector 24 -Key: 00000080000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0976DB57B27E4136743E58BCECFBC056 -Test: Encrypt -Comment: Set 1, vector 25 -Key: 00000040000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0C889DF89972EB42DB2BD2AAC335CCC8 -Test: Encrypt -Comment: Set 1, vector 26 -Key: 00000020000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CB6B80177047A3B2AC290A41B94174EF -Test: Encrypt -Comment: Set 1, vector 27 -Key: 00000010000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F816631F8FBC54ECDC1AB5323FF8424E -Test: Encrypt -Comment: Set 1, vector 28 -Key: 00000008000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 40CB64DF57D2A6BBCBD82DFCC749707D -Test: Encrypt -Comment: Set 1, vector 29 -Key: 00000004000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 885BD3C2DD560765B11F5A2D238E9F9A -Test: Encrypt -Comment: Set 1, vector 30 -Key: 00000002000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 877AAEF064555DE89C99B7C5A1326C62 -Test: Encrypt -Comment: Set 1, vector 31 -Key: 00000001000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AA4FBBE7A02020F5D81030E0EF7A460D -Test: Encrypt -Comment: Set 1, vector 32 -Key: 00000000800000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AA2759BC215E49F26008206F6F65B7AC -Test: Encrypt -Comment: Set 1, vector 33 -Key: 00000000400000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 419A8069C3D531475FF7F29AE049D57C -Test: Encrypt -Comment: Set 1, vector 34 -Key: 00000000200000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 455588067DB9088130C861F5BE9E15BF -Test: Encrypt -Comment: Set 1, vector 35 -Key: 00000000100000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FDD6967ADA65ED3E20718C451AE5AE34 -Test: Encrypt -Comment: Set 1, vector 36 -Key: 00000000080000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1C74228D2A82248CD29800B64BEFF97A -Test: Encrypt -Comment: Set 1, vector 37 -Key: 00000000040000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4B88B7FFB32B05840BE7B497377AFDAA -Test: Encrypt -Comment: Set 1, vector 38 -Key: 00000000020000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4D4EC4C728524DA2F366FC272AB2666A -Test: Encrypt -Comment: Set 1, vector 39 -Key: 00000000010000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4FA8A27ED16BF36FA296D8AB2B423C77 -Test: Encrypt -Comment: Set 1, vector 40 -Key: 00000000008000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 943B9D570D371A3D823B680BBDA9477D -Test: Encrypt -Comment: Set 1, vector 41 -Key: 00000000004000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DCC390F5E1CAADBE061D02929473D084 -Test: Encrypt -Comment: Set 1, vector 42 -Key: 00000000002000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9655F00C4A5C40DF401A3FF806575834 -Test: Encrypt -Comment: Set 1, vector 43 -Key: 00000000001000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FCC9F6B36DE6DD6AA578AD0B59DF5996 -Test: Encrypt -Comment: Set 1, vector 44 -Key: 00000000000800000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F573FF52ACAA16609E5B3C3C7353DA75 -Test: Encrypt -Comment: Set 1, vector 45 -Key: 00000000000400000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 203EF49006A7FC856FF7A7A3B953D999 -Test: Encrypt -Comment: Set 1, vector 46 -Key: 00000000000200000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 16659E823D942E99C83926C4055D896D -Test: Encrypt -Comment: Set 1, vector 47 -Key: 00000000000100000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 139D5DB9EF0119F4E5D11256C5ECB8B0 -Test: Encrypt -Comment: Set 1, vector 48 -Key: 00000000000080000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 63FB244962CCE915425EF1B31DE6AAE2 -Test: Encrypt -Comment: Set 1, vector 49 -Key: 00000000000040000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6F771C2DC848A106E907A990DABA0272 -Test: Encrypt -Comment: Set 1, vector 50 -Key: 00000000000020000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CFA1F114CF0D9C7DAD301B833962ABF2 -Test: Encrypt -Comment: Set 1, vector 51 -Key: 00000000000010000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 58A3BE61DA53D0AA8F33DE95E6F38A3F -Test: Encrypt -Comment: Set 1, vector 52 -Key: 00000000000008000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2FE96FCB3D845B568AE804B217F3498F -Test: Encrypt -Comment: Set 1, vector 53 -Key: 00000000000004000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FD74EB6621127D58FA44BA3E6EE7835D -Test: Encrypt -Comment: Set 1, vector 54 -Key: 00000000000002000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 834C0C5D8D88EE63C989AA1E66F4E18C -Test: Encrypt -Comment: Set 1, vector 55 -Key: 00000000000001000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FEF8E0097B9EB5CE6DE710F5742F7E4F -Test: Encrypt -Comment: Set 1, vector 56 -Key: 00000000000000800000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 75FCC55F284311B81D967618C2D35700 -Test: Encrypt -Comment: Set 1, vector 57 -Key: 00000000000000400000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 91AE4E35623A7F10383BF7448F1F74AD -Test: Encrypt -Comment: Set 1, vector 58 -Key: 00000000000000200000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8928B2B6967BA1B4230AA1EBA49D1A08 -Test: Encrypt -Comment: Set 1, vector 59 -Key: 00000000000000100000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 707EA08174ED5C0AD0A74363B403F02D -Test: Encrypt -Comment: Set 1, vector 60 -Key: 00000000000000080000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7C0C13410DDE30C0AD3565FFAA33E8AD -Test: Encrypt -Comment: Set 1, vector 61 -Key: 00000000000000040000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 56DA72C545C490A749C66BCC5D90AACD -Test: Encrypt -Comment: Set 1, vector 62 -Key: 00000000000000020000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2CC0CF6E2AAA7916AF636B1546BA1179 -Test: Encrypt -Comment: Set 1, vector 63 -Key: 00000000000000010000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A19FE617883D409B1F78882E0D5EF39C -Test: Encrypt -Comment: Set 1, vector 64 -Key: 00000000000000008000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2B8586BBB979CFFAC5A76C25D77C1E2C -Test: Encrypt -Comment: Set 1, vector 65 -Key: 00000000000000004000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5A08C9B5A2940E3ACD1086867E3E4733 -Test: Encrypt -Comment: Set 1, vector 66 -Key: 00000000000000002000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7443F1072833BFC8AA38CBF6963CF880 -Test: Encrypt -Comment: Set 1, vector 67 -Key: 00000000000000001000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6809A1F2D2B5367D5E8442E7972BD1D4 -Test: Encrypt -Comment: Set 1, vector 68 -Key: 00000000000000000800000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A61D4FE41D5DBB7A6BCE5984502CD767 -Test: Encrypt -Comment: Set 1, vector 69 -Key: 00000000000000000400000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 30D86F43B81F4D2098A4D43AB2637549 -Test: Encrypt -Comment: Set 1, vector 70 -Key: 00000000000000000200000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5B16E9033FA40BF141D3EE73FF7E2564 -Test: Encrypt -Comment: Set 1, vector 71 -Key: 00000000000000000100000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 15574EF70C880682DBFBD93FAE8023F6 -Test: Encrypt -Comment: Set 1, vector 72 -Key: 00000000000000000080000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0D8D220DB69B15FFE2001B3F42E910EA -Test: Encrypt -Comment: Set 1, vector 73 -Key: 00000000000000000040000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 030AB24DA9E4ADD4E350E692077A948C -Test: Encrypt -Comment: Set 1, vector 74 -Key: 00000000000000000020000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7F6509A9FD8525126BFB69AFE8624A96 -Test: Encrypt -Comment: Set 1, vector 75 -Key: 00000000000000000010000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9600EB0B7E38A5ABEBBDADD3DFC70298 -Test: Encrypt -Comment: Set 1, vector 76 -Key: 00000000000000000008000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3CF0F71B4687AAABEB9FA8CDE00B17D7 -Test: Encrypt -Comment: Set 1, vector 77 -Key: 00000000000000000004000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8B1C549A655C0041D866B7875A2736CB -Test: Encrypt -Comment: Set 1, vector 78 -Key: 00000000000000000002000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8F507233FBC9E1DBF716FB4C828DBF06 -Test: Encrypt -Comment: Set 1, vector 79 -Key: 00000000000000000001000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 14A45A121DC8996020C29A040FE8E52D -Test: Encrypt -Comment: Set 1, vector 80 -Key: 00000000000000000000800000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 32390FB6FC15BB4B37D1CD8817BAEB09 -Test: Encrypt -Comment: Set 1, vector 81 -Key: 00000000000000000000400000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9E61986F3F4C31132D436CCFCF751043 -Test: Encrypt -Comment: Set 1, vector 82 -Key: 00000000000000000000200000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 24E63FAD370974C60330F7C3071938F1 -Test: Encrypt -Comment: Set 1, vector 83 -Key: 00000000000000000000100000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3CE71D4E9F2F7EF9A6F9F2548C5489CC -Test: Encrypt -Comment: Set 1, vector 84 -Key: 00000000000000000000080000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E42436B8E076A00600DFD67B8C427DB1 -Test: Encrypt -Comment: Set 1, vector 85 -Key: 00000000000000000000040000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5C2577FA8104DCC58ACE852B4D11FE24 -Test: Encrypt -Comment: Set 1, vector 86 -Key: 00000000000000000000020000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 12FC9DD7132B3BB346C53FD193531638 -Test: Encrypt -Comment: Set 1, vector 87 -Key: 00000000000000000000010000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5D91F775E26599F26B21F9FB1F67DA38 -Test: Encrypt -Comment: Set 1, vector 88 -Key: 00000000000000000000008000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D4B3683AA62D2EF0331A960A0BF01A29 -Test: Encrypt -Comment: Set 1, vector 89 -Key: 00000000000000000000004000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EE32582D35DDF3A82142ED18FEE38014 -Test: Encrypt -Comment: Set 1, vector 90 -Key: 00000000000000000000002000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 148632AE69514D5776DA4AF38E1AE4FD -Test: Encrypt -Comment: Set 1, vector 91 -Key: 00000000000000000000001000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 30A3EE1AA1CA17B128DAAF06AF9025BD -Test: Encrypt -Comment: Set 1, vector 92 -Key: 00000000000000000000000800000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 88D82D9E508CBFB392E47E524BB33019 -Test: Encrypt -Comment: Set 1, vector 93 -Key: 00000000000000000000000400000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0C20870A9FC751F6E41F92305B7C4D92 -Test: Encrypt -Comment: Set 1, vector 94 -Key: 00000000000000000000000200000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6A4EDE5FD13F3676C1BCF8B73AB273CB -Test: Encrypt -Comment: Set 1, vector 95 -Key: 00000000000000000000000100000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5A62CE50EA837CA4FD0F7304D1572D22 -Test: Encrypt -Comment: Set 1, vector 96 -Key: 00000000000000000000000080000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 84DB8599B48ED4F39E872F13F7FCDF0B -Test: Encrypt -Comment: Set 1, vector 97 -Key: 00000000000000000000000040000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CDD25F8276411E892035C9703C7588EE -Test: Encrypt -Comment: Set 1, vector 98 -Key: 00000000000000000000000020000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 73BCFB16436B5C52CD4BC9629F75C5C8 -Test: Encrypt -Comment: Set 1, vector 99 -Key: 00000000000000000000000010000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 03752D935029B09699C29CA5C6E79553 -Test: Encrypt -Comment: Set 1, vector 100 -Key: 00000000000000000000000008000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EF439A1B86698409E91D992BDB3F54E5 -Test: Encrypt -Comment: Set 1, vector 101 -Key: 00000000000000000000000004000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2A34BDE7EC74221BFF58B251E54F089F -Test: Encrypt -Comment: Set 1, vector 102 -Key: 00000000000000000000000002000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 35FBB78716B78FB57F96BC8A5D869B72 -Test: Encrypt -Comment: Set 1, vector 103 -Key: 00000000000000000000000001000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AC3A7363DFB6C3F06CCCA1A46F44A5F8 -Test: Encrypt -Comment: Set 1, vector 104 -Key: 00000000000000000000000000800000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4895E1B7E54CA168CE42E3994D564B62 -Test: Encrypt -Comment: Set 1, vector 105 -Key: 00000000000000000000000000400000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E98956EFC457FE8AA103DB303A3B1DF1 -Test: Encrypt -Comment: Set 1, vector 106 -Key: 00000000000000000000000000200000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 276646992D6E752A649183DB05073422 -Test: Encrypt -Comment: Set 1, vector 107 -Key: 00000000000000000000000000100000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 82F36DE401E21D01A476A163A92F4B16 -Test: Encrypt -Comment: Set 1, vector 108 -Key: 00000000000000000000000000080000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E54DD90800B92153C314F8B1590B17E5 -Test: Encrypt -Comment: Set 1, vector 109 -Key: 00000000000000000000000000040000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F4A146DFB33405EC6B8F37AEB10F5198 -Test: Encrypt -Comment: Set 1, vector 110 -Key: 00000000000000000000000000020000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C332ADBC2D44FA1A1A4F7C8EAE2CED29 -Test: Encrypt -Comment: Set 1, vector 111 -Key: 00000000000000000000000000010000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 21AA542624DA9F2363404CE42BC2BAEF -Test: Encrypt -Comment: Set 1, vector 112 -Key: 00000000000000000000000000008000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E101DBEF627038AE819441D133AEE068 -Test: Encrypt -Comment: Set 1, vector 113 -Key: 00000000000000000000000000004000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7A9B635E6AA5D273DE697747FE6BB08E -Test: Encrypt -Comment: Set 1, vector 114 -Key: 00000000000000000000000000002000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0541AA347D36F03D9177FC91398874DB -Test: Encrypt -Comment: Set 1, vector 115 -Key: 00000000000000000000000000001000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BE27D6FE099AB98BF07A74A1ABF5C945 -Test: Encrypt -Comment: Set 1, vector 116 -Key: 00000000000000000000000000000800 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 472ACD81A6626822E220F431C4491704 -Test: Encrypt -Comment: Set 1, vector 117 -Key: 00000000000000000000000000000400 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2D5152F19E29AD7D5823CDCA188E0CD8 -Test: Encrypt -Comment: Set 1, vector 118 -Key: 00000000000000000000000000000200 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 875C90B3669DF8F4867B6769689656E7 -Test: Encrypt -Comment: Set 1, vector 119 -Key: 00000000000000000000000000000100 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 59641CA52EEBC2C229930CE42529277F -Test: Encrypt -Comment: Set 1, vector 120 -Key: 00000000000000000000000000000080 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A3B4D666AC56C284D40DC27FDB0F787C -Test: Encrypt -Comment: Set 1, vector 121 -Key: 00000000000000000000000000000040 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0511D526FC5F255F51F1914B4B12AD84 -Test: Encrypt -Comment: Set 1, vector 122 -Key: 00000000000000000000000000000020 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2D14332989F629DA4720ECC916B4DAF0 -Test: Encrypt -Comment: Set 1, vector 123 -Key: 00000000000000000000000000000010 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C44EAC8457E2F17E9BC86EB4C436E8DB -Test: Encrypt -Comment: Set 1, vector 124 -Key: 00000000000000000000000000000008 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 022F3EB45AAA39F785FF80B6A3006BF6 -Test: Encrypt -Comment: Set 1, vector 125 -Key: 00000000000000000000000000000004 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B8A714C8F8427767B384B0E2F6BAF619 -Test: Encrypt -Comment: Set 1, vector 126 -Key: 00000000000000000000000000000002 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 01F745A7C09FECD3497F087BD52A9A0F -Test: Encrypt -Comment: Set 1, vector 127 -Key: 00000000000000000000000000000001 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 41E0E6DC2DDEC65D8B8120E60977B82D -Test: Encrypt -Comment: Set 2, vector 0 -Key: 00000000000000000000000000000000 -Plaintext: 80000000000000000000000000000000 -Ciphertext: 07923A39EB0A817D1C4D87BDB82D1F1C -Test: Encrypt -Comment: Set 2, vector 1 -Key: 00000000000000000000000000000000 -Plaintext: 40000000000000000000000000000000 -Ciphertext: 48CD6419809672D2349260D89A08D3D3 -Test: Encrypt -Comment: Set 2, vector 2 -Key: 00000000000000000000000000000000 -Plaintext: 20000000000000000000000000000000 -Ciphertext: D07493CCB2E95CE0B4945A05ACC97D82 -Test: Encrypt -Comment: Set 2, vector 3 -Key: 00000000000000000000000000000000 -Plaintext: 10000000000000000000000000000000 -Ciphertext: 5DBE1EAC9F7080A88DBED7F6DA101448 -Test: Encrypt -Comment: Set 2, vector 4 -Key: 00000000000000000000000000000000 -Plaintext: 08000000000000000000000000000000 -Ciphertext: F01EE477D199DF2701027034B229622F -Test: Encrypt -Comment: Set 2, vector 5 -Key: 00000000000000000000000000000000 -Plaintext: 04000000000000000000000000000000 -Ciphertext: C841587ABD9A912E563774CB569D051E -Test: Encrypt -Comment: Set 2, vector 6 -Key: 00000000000000000000000000000000 -Plaintext: 02000000000000000000000000000000 -Ciphertext: 1D9BC0C04546F0915C8CCD11391A455C -Test: Encrypt -Comment: Set 2, vector 7 -Key: 00000000000000000000000000000000 -Plaintext: 01000000000000000000000000000000 -Ciphertext: 05E6EBB4BA167F5C479CEFF3152F943B -Test: Encrypt -Comment: Set 2, vector 8 -Key: 00000000000000000000000000000000 -Plaintext: 00800000000000000000000000000000 -Ciphertext: 93211E0F788845B9FC0E4551FFE92AC9 -Test: Encrypt -Comment: Set 2, vector 9 -Key: 00000000000000000000000000000000 -Plaintext: 00400000000000000000000000000000 -Ciphertext: B6D35701CD8FADDE383BBE8E6B70BAF7 -Test: Encrypt -Comment: Set 2, vector 10 -Key: 00000000000000000000000000000000 -Plaintext: 00200000000000000000000000000000 -Ciphertext: 8358F9F4EBCFEE348CB30551ACB151A0 -Test: Encrypt -Comment: Set 2, vector 11 -Key: 00000000000000000000000000000000 -Plaintext: 00100000000000000000000000000000 -Ciphertext: D57516EB5AD93C523E40521BF447AFCE -Test: Encrypt -Comment: Set 2, vector 12 -Key: 00000000000000000000000000000000 -Plaintext: 00080000000000000000000000000000 -Ciphertext: 66B2534C279C439133F52E5AD8B439A9 -Test: Encrypt -Comment: Set 2, vector 13 -Key: 00000000000000000000000000000000 -Plaintext: 00040000000000000000000000000000 -Ciphertext: A71C69184A9F63C2992A5F18F77C1FE9 -Test: Encrypt -Comment: Set 2, vector 14 -Key: 00000000000000000000000000000000 -Plaintext: 00020000000000000000000000000000 -Ciphertext: 1ADCBE49AEACB9ECEBBD492B10E82C7B -Test: Encrypt -Comment: Set 2, vector 15 -Key: 00000000000000000000000000000000 -Plaintext: 00010000000000000000000000000000 -Ciphertext: 27E3BCFB227C5561DB6CF7FC30387036 -Test: Encrypt -Comment: Set 2, vector 16 -Key: 00000000000000000000000000000000 -Plaintext: 00008000000000000000000000000000 -Ciphertext: F4AE20365CC9D06B0CAE6B695ED2CEC1 -Test: Encrypt -Comment: Set 2, vector 17 -Key: 00000000000000000000000000000000 -Plaintext: 00004000000000000000000000000000 -Ciphertext: 3DD682F0B641ED32AD3D43EA2A0456E4 -Test: Encrypt -Comment: Set 2, vector 18 -Key: 00000000000000000000000000000000 -Plaintext: 00002000000000000000000000000000 -Ciphertext: 6E5D14A95ECC290B509EA6B673652E3A -Test: Encrypt -Comment: Set 2, vector 19 -Key: 00000000000000000000000000000000 -Plaintext: 00001000000000000000000000000000 -Ciphertext: F1CDF0F8D7B3FFD95422D7CC0CF40B7B -Test: Encrypt -Comment: Set 2, vector 20 -Key: 00000000000000000000000000000000 -Plaintext: 00000800000000000000000000000000 -Ciphertext: A9253D459A34C385A1F1B2CFFA3935C5 -Test: Encrypt -Comment: Set 2, vector 21 -Key: 00000000000000000000000000000000 -Plaintext: 00000400000000000000000000000000 -Ciphertext: 291024D99FF09A47A1DEE45BA700AE52 -Test: Encrypt -Comment: Set 2, vector 22 -Key: 00000000000000000000000000000000 -Plaintext: 00000200000000000000000000000000 -Ciphertext: 49241D9459B277187BB10081C60361C0 -Test: Encrypt -Comment: Set 2, vector 23 -Key: 00000000000000000000000000000000 -Plaintext: 00000100000000000000000000000000 -Ciphertext: AD9BA365CC4DD5553D2D9FE303841D88 -Test: Encrypt -Comment: Set 2, vector 24 -Key: 00000000000000000000000000000000 -Plaintext: 00000080000000000000000000000000 -Ciphertext: C2ECA616664A249DC622CC11196B4AE1 -Test: Encrypt -Comment: Set 2, vector 25 -Key: 00000000000000000000000000000000 -Plaintext: 00000040000000000000000000000000 -Ciphertext: 6E1A2D4794BB0DC08777A0BC7523E70E -Test: Encrypt -Comment: Set 2, vector 26 -Key: 00000000000000000000000000000000 -Plaintext: 00000020000000000000000000000000 -Ciphertext: 6DB1F0CF59656BDD235E82B8CEF0BE8E -Test: Encrypt -Comment: Set 2, vector 27 -Key: 00000000000000000000000000000000 -Plaintext: 00000010000000000000000000000000 -Ciphertext: 52F239C5EAF401EBDC54D2F011FF4B6A -Test: Encrypt -Comment: Set 2, vector 28 -Key: 00000000000000000000000000000000 -Plaintext: 00000008000000000000000000000000 -Ciphertext: 6B58A08F648414B67FD6847D2AA51CBF -Test: Encrypt -Comment: Set 2, vector 29 -Key: 00000000000000000000000000000000 -Plaintext: 00000004000000000000000000000000 -Ciphertext: 2959DD5367885A75EB48053CF3251A36 -Test: Encrypt -Comment: Set 2, vector 30 -Key: 00000000000000000000000000000000 -Plaintext: 00000002000000000000000000000000 -Ciphertext: 630B292E3B88EF641CDFD531E206605E -Test: Encrypt -Comment: Set 2, vector 31 -Key: 00000000000000000000000000000000 -Plaintext: 00000001000000000000000000000000 -Ciphertext: 4BBB88EF82B70593FCC56AFD91540FDB -Test: Encrypt -Comment: Set 2, vector 32 -Key: 00000000000000000000000000000000 -Plaintext: 00000000800000000000000000000000 -Ciphertext: 0A13055B118A45C606999257BD191426 -Test: Encrypt -Comment: Set 2, vector 33 -Key: 00000000000000000000000000000000 -Plaintext: 00000000400000000000000000000000 -Ciphertext: 5CF8E5C9F15D7E4F865020224853EB77 -Test: Encrypt -Comment: Set 2, vector 34 -Key: 00000000000000000000000000000000 -Plaintext: 00000000200000000000000000000000 -Ciphertext: 3898805042C7A4315C5EE51AF2DE47E2 -Test: Encrypt -Comment: Set 2, vector 35 -Key: 00000000000000000000000000000000 -Plaintext: 00000000100000000000000000000000 -Ciphertext: 8D3F96372E87CBB0B375425B3A10B9E7 -Test: Encrypt -Comment: Set 2, vector 36 -Key: 00000000000000000000000000000000 -Plaintext: 00000000080000000000000000000000 -Ciphertext: 4D9510A378BD784A70A66BCC75B7D3C8 -Test: Encrypt -Comment: Set 2, vector 37 -Key: 00000000000000000000000000000000 -Plaintext: 00000000040000000000000000000000 -Ciphertext: 70DB1902D37CFBDFB98F7C516F79D416 -Test: Encrypt -Comment: Set 2, vector 38 -Key: 00000000000000000000000000000000 -Plaintext: 00000000020000000000000000000000 -Ciphertext: 383C6C2AABEF7FDE25CD470BF774A331 -Test: Encrypt -Comment: Set 2, vector 39 -Key: 00000000000000000000000000000000 -Plaintext: 00000000010000000000000000000000 -Ciphertext: 47CBCB5288349B1A15DC9F81FBEE6B8F -Test: Encrypt -Comment: Set 2, vector 40 -Key: 00000000000000000000000000000000 -Plaintext: 00000000008000000000000000000000 -Ciphertext: 21DA34D4468EEB13AED95DAE0FF48310 -Test: Encrypt -Comment: Set 2, vector 41 -Key: 00000000000000000000000000000000 -Plaintext: 00000000004000000000000000000000 -Ciphertext: 021C9A8E6BD36FBD036411E5D852A80F -Test: Encrypt -Comment: Set 2, vector 42 -Key: 00000000000000000000000000000000 -Plaintext: 00000000002000000000000000000000 -Ciphertext: 6A459E2F839AF60ACDE83774D0BB5574 -Test: Encrypt -Comment: Set 2, vector 43 -Key: 00000000000000000000000000000000 -Plaintext: 00000000001000000000000000000000 -Ciphertext: C19255121F1B933CAE09E58AEC0E9977 -Test: Encrypt -Comment: Set 2, vector 44 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000800000000000000000000 -Ciphertext: 7BA949E27B2BE148A6B801F9305F43D5 -Test: Encrypt -Comment: Set 2, vector 45 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000400000000000000000000 -Ciphertext: E8CEB1026BCF7BCEA32E8A380EA76DB7 -Test: Encrypt -Comment: Set 2, vector 46 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000200000000000000000000 -Ciphertext: 63F97747ED56A8F521B20CC65F6F9465 -Test: Encrypt -Comment: Set 2, vector 47 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000100000000000000000000 -Ciphertext: 2091CFDC629819106188424AC694F75B -Test: Encrypt -Comment: Set 2, vector 48 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000080000000000000000000 -Ciphertext: A91BDF8E8B88407942423CCE000527C4 -Test: Encrypt -Comment: Set 2, vector 49 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000040000000000000000000 -Ciphertext: 73F9B44B9635A3FD683DBF8D49E9825B -Test: Encrypt -Comment: Set 2, vector 50 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000020000000000000000000 -Ciphertext: 9DC64B2133FAD5069FD9A7CC2FFFD1CC -Test: Encrypt -Comment: Set 2, vector 51 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000010000000000000000000 -Ciphertext: 28240F81FEC36B71E13F1FEA7A7641E3 -Test: Encrypt -Comment: Set 2, vector 52 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000008000000000000000000 -Ciphertext: 20DD39FEE96CD2EFF972872A692B28FD -Test: Encrypt -Comment: Set 2, vector 53 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000004000000000000000000 -Ciphertext: 47A9E40483EC1925B635E47E964E8E93 -Test: Encrypt -Comment: Set 2, vector 54 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000002000000000000000000 -Ciphertext: 9C0EBD822C49FB3D853DF5B315A87BA0 -Test: Encrypt -Comment: Set 2, vector 55 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000001000000000000000000 -Ciphertext: C18D813FDB45A594C6DC24E5A1F6CE32 -Test: Encrypt -Comment: Set 2, vector 56 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000800000000000000000 -Ciphertext: 7E5467FF245ECF80CB55C2D8E91F0711 -Test: Encrypt -Comment: Set 2, vector 57 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000400000000000000000 -Ciphertext: 394D4365B77954FDEA4145FCF7A7A041 -Test: Encrypt -Comment: Set 2, vector 58 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000200000000000000000 -Ciphertext: B1D8311A492ED11F11E57B29221610C4 -Test: Encrypt -Comment: Set 2, vector 59 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000100000000000000000 -Ciphertext: E5FBB947A63AEA90163AF04AD6951EF8 -Test: Encrypt -Comment: Set 2, vector 60 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000080000000000000000 -Ciphertext: CA0627DDF580F0E7D59562825C9D0492 -Test: Encrypt -Comment: Set 2, vector 61 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000040000000000000000 -Ciphertext: EF98FFD1AED295AAE1860F0274C8F555 -Test: Encrypt -Comment: Set 2, vector 62 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000020000000000000000 -Ciphertext: 8C698E5CFFF08FACE10C2DC5FF1E2A81 -Test: Encrypt -Comment: Set 2, vector 63 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000010000000000000000 -Ciphertext: 35A7767E02032C35B5CE1A6F49C57C28 -Test: Encrypt -Comment: Set 2, vector 64 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000008000000000000000 -Ciphertext: AB36F8734E76EBA306CF00D6763D90B0 -Test: Encrypt -Comment: Set 2, vector 65 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000004000000000000000 -Ciphertext: E854EB66D4EC66889B5E6CD4F44A5806 -Test: Encrypt -Comment: Set 2, vector 66 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000002000000000000000 -Ciphertext: 15B66DF1455ACD640B8716BCF5DB2D69 -Test: Encrypt -Comment: Set 2, vector 67 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000001000000000000000 -Ciphertext: 4C57AB5333E5C2D4B7E30A007E449F48 -Test: Encrypt -Comment: Set 2, vector 68 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000800000000000000 -Ciphertext: BA3E7FF28EB38EA09D8DB1440A9A3552 -Test: Encrypt -Comment: Set 2, vector 69 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000400000000000000 -Ciphertext: 64E60227AFD80C40C70186CC94804C1A -Test: Encrypt -Comment: Set 2, vector 70 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000200000000000000 -Ciphertext: CEB4423C20B4C91C2551F6FC227C9514 -Test: Encrypt -Comment: Set 2, vector 71 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000100000000000000 -Ciphertext: F736894B843EF32DA28576DE500D448C -Test: Encrypt -Comment: Set 2, vector 72 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000080000000000000 -Ciphertext: 58FDA98B678D15053D4B6C060368108C -Test: Encrypt -Comment: Set 2, vector 73 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000040000000000000 -Ciphertext: E28CAE384E578F47657755EBCD97996C -Test: Encrypt -Comment: Set 2, vector 74 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000020000000000000 -Ciphertext: 0A64617BD4B5B166668240D105B7B6A2 -Test: Encrypt -Comment: Set 2, vector 75 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000010000000000000 -Ciphertext: 4BD090C7E3D365B5EA80F19B4798881E -Test: Encrypt -Comment: Set 2, vector 76 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000008000000000000 -Ciphertext: BC7B6CB9BFF4F72973BB2CD20A512C06 -Test: Encrypt -Comment: Set 2, vector 77 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000004000000000000 -Ciphertext: 4C7ADDC5C867594E9EE75F0AA6AB9C23 -Test: Encrypt -Comment: Set 2, vector 78 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000002000000000000 -Ciphertext: 1FBD05C71A36691AC6566A5298101D53 -Test: Encrypt -Comment: Set 2, vector 79 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000001000000000000 -Ciphertext: 42D7D6B1F499D412F8793972BD968DA2 -Test: Encrypt -Comment: Set 2, vector 80 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000800000000000 -Ciphertext: 260EC86E2786FC68824576B934F32814 -Test: Encrypt -Comment: Set 2, vector 81 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000400000000000 -Ciphertext: 576C26DFD7046F9357F34BEA7DFB26A0 -Test: Encrypt -Comment: Set 2, vector 82 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000200000000000 -Ciphertext: 6D55E54BFB6F927174A02294C95E0F8F -Test: Encrypt -Comment: Set 2, vector 83 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000100000000000 -Ciphertext: 1A6CE91DD458229C7675A34950D10E23 -Test: Encrypt -Comment: Set 2, vector 84 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000080000000000 -Ciphertext: DAD0D5E7E000652825AA34D228EA8D8F -Test: Encrypt -Comment: Set 2, vector 85 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000040000000000 -Ciphertext: E68013F48D75EAD2BBC0B0BDA5E690BF -Test: Encrypt -Comment: Set 2, vector 86 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000020000000000 -Ciphertext: A07D92312FBAE37BFE8A834210AE4F9C -Test: Encrypt -Comment: Set 2, vector 87 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000010000000000 -Ciphertext: 6EEE5F8544CD7D456366EB448813989A -Test: Encrypt -Comment: Set 2, vector 88 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000008000000000 -Ciphertext: F8E5C7FF4B79D7ABE8BFA2DD148820A8 -Test: Encrypt -Comment: Set 2, vector 89 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000004000000000 -Ciphertext: C6349D75C7472BBD66F95B3A07C79C91 -Test: Encrypt -Comment: Set 2, vector 90 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000002000000000 -Ciphertext: B85713C12D8658951CD1AD21C74D2CD2 -Test: Encrypt -Comment: Set 2, vector 91 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000001000000000 -Ciphertext: 907AA00B9F7D47A97623FB55BA911F29 -Test: Encrypt -Comment: Set 2, vector 92 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000800000000 -Ciphertext: DC3CD0ED23D11776FAB43A2A6A8F3557 -Test: Encrypt -Comment: Set 2, vector 93 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000400000000 -Ciphertext: 4BFE58A8FD69179C14765B09AB70B705 -Test: Encrypt -Comment: Set 2, vector 94 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000200000000 -Ciphertext: A23996E0EA67EC280356E5F77130A551 -Test: Encrypt -Comment: Set 2, vector 95 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000100000000 -Ciphertext: CDEADE859B3AACD273CCA85A3E2E45F2 -Test: Encrypt -Comment: Set 2, vector 96 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000080000000 -Ciphertext: E0FC78489857D84DA03F40CE97147174 -Test: Encrypt -Comment: Set 2, vector 97 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000040000000 -Ciphertext: 7615EA6351F6BB12855E8579C6995D8E -Test: Encrypt -Comment: Set 2, vector 98 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000020000000 -Ciphertext: 13E184344FE28C2E70ED0E4D0A8037F9 -Test: Encrypt -Comment: Set 2, vector 99 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000010000000 -Ciphertext: A5FE395F568482B87BC3EB208C81C942 -Test: Encrypt -Comment: Set 2, vector 100 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000008000000 -Ciphertext: B3103E11AF06C85565823F8CAA3159F6 -Test: Encrypt -Comment: Set 2, vector 101 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000004000000 -Ciphertext: 7EBC2234D271B89C519C396985300030 -Test: Encrypt -Comment: Set 2, vector 102 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000002000000 -Ciphertext: 0661D338F2E0C939BA1687820A768467 -Test: Encrypt -Comment: Set 2, vector 103 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000001000000 -Ciphertext: EC2B42667C0195A90715499617884DA5 -Test: Encrypt -Comment: Set 2, vector 104 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000800000 -Ciphertext: AE077BA19D24E7188DDD3682FF196892 -Test: Encrypt -Comment: Set 2, vector 105 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000400000 -Ciphertext: 98823C24B9C65A66073C7952DC2B4B5E -Test: Encrypt -Comment: Set 2, vector 106 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000200000 -Ciphertext: 6AB58432CBB3C2F503DA2D16796CC297 -Test: Encrypt -Comment: Set 2, vector 107 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000100000 -Ciphertext: EEB5EBB3A53E4196C2F22BC1A4DDF5E8 -Test: Encrypt -Comment: Set 2, vector 108 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000080000 -Ciphertext: 33DC40AC5FDC126D38878416AF6C0FA6 -Test: Encrypt -Comment: Set 2, vector 109 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000040000 -Ciphertext: 38EDDC08E18B4AD982CEA921D2765A9A -Test: Encrypt -Comment: Set 2, vector 110 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000020000 -Ciphertext: 7D6BEA038E9347C642E18631660A9558 -Test: Encrypt -Comment: Set 2, vector 111 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000010000 -Ciphertext: FDA57921A473B5EE3700AD5ADF035019 -Test: Encrypt -Comment: Set 2, vector 112 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000008000 -Ciphertext: 699B4812E200337E9C1D2C397F0DFE4E -Test: Encrypt -Comment: Set 2, vector 113 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000004000 -Ciphertext: 7A1EADF68B0807145D6C414852DECFC8 -Test: Encrypt -Comment: Set 2, vector 114 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000002000 -Ciphertext: 1645FFAA8AD76689C01DA8C40882781F -Test: Encrypt -Comment: Set 2, vector 115 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000001000 -Ciphertext: BA0C053BE702FA62FC66D8FEB12FC97E -Test: Encrypt -Comment: Set 2, vector 116 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000800 -Ciphertext: 841FD8AF69CF2C31F7D4D7B6959662B5 -Test: Encrypt -Comment: Set 2, vector 117 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000400 -Ciphertext: F675D59BDB33231861268F539829DA0B -Test: Encrypt -Comment: Set 2, vector 118 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000200 -Ciphertext: A4967F45ABB4E8C7DC5E3806680F35E0 -Test: Encrypt -Comment: Set 2, vector 119 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000100 -Ciphertext: 4D7E08081CC82F92ABA7C58C99F8343F -Test: Encrypt -Comment: Set 2, vector 120 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000080 -Ciphertext: 9AEFDB287C119B82353612B60ECCBFD8 -Test: Encrypt -Comment: Set 2, vector 121 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000040 -Ciphertext: 979BB6A1553A17592A86E78DF144A699 -Test: Encrypt -Comment: Set 2, vector 122 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000020 -Ciphertext: A6FA8CAB06FD2E5BF3A858983C01757A -Test: Encrypt -Comment: Set 2, vector 123 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000010 -Ciphertext: BE8511254C31E25420B91D6FEF1710ED -Test: Encrypt -Comment: Set 2, vector 124 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000008 -Ciphertext: F589A908D18A21894971C0433581E1A5 -Test: Encrypt -Comment: Set 2, vector 125 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000004 -Ciphertext: 4237585130E7C9F715235EB1D8C94DE7 -Test: Encrypt -Comment: Set 2, vector 126 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000002 -Ciphertext: DEFE3E0B5C54C94B4F2A0F5A46F6210D -Test: Encrypt -Comment: Set 2, vector 127 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000001 -Ciphertext: F5574ACC3148DFCB9015200631024DF9 -Test: Encrypt -Comment: Set 3, vector 0 -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3D028025B156327C17F762C1F2CBCA71 -Test: Encrypt -Comment: Set 3, vector 1 -Key: 01010101010101010101010101010101 -Plaintext: 01010101010101010101010101010101 -Ciphertext: 637084CB1120D6F25DB618893040AA27 -Test: Encrypt -Comment: Set 3, vector 2 -Key: 02020202020202020202020202020202 -Plaintext: 02020202020202020202020202020202 -Ciphertext: 612834AAC9EF906BAEAA076E1C75179D -Test: Encrypt -Comment: Set 3, vector 3 -Key: 03030303030303030303030303030303 -Plaintext: 03030303030303030303030303030303 -Ciphertext: AECEE4C59E91366360923654C17140A9 -Test: Encrypt -Comment: Set 3, vector 4 -Key: 04040404040404040404040404040404 -Plaintext: 04040404040404040404040404040404 -Ciphertext: B24FAF8A579E4EFE986571FB2F68B5B4 -Test: Encrypt -Comment: Set 3, vector 5 -Key: 05050505050505050505050505050505 -Plaintext: 05050505050505050505050505050505 -Ciphertext: C102E40B5E584CF6AA16108D93DA26E3 -Test: Encrypt -Comment: Set 3, vector 6 -Key: 06060606060606060606060606060606 -Plaintext: 06060606060606060606060606060606 -Ciphertext: 962F98098E6CEA968FA568C5A32ADA50 -Test: Encrypt -Comment: Set 3, vector 7 -Key: 07070707070707070707070707070707 -Plaintext: 07070707070707070707070707070707 -Ciphertext: 27E9AB0117A37D228B77B29B38B3836F -Test: Encrypt -Comment: Set 3, vector 8 -Key: 08080808080808080808080808080808 -Plaintext: 08080808080808080808080808080808 -Ciphertext: 3E5CAFBB70545AABB1109293A1C44C14 -Test: Encrypt -Comment: Set 3, vector 9 -Key: 09090909090909090909090909090909 -Plaintext: 09090909090909090909090909090909 -Ciphertext: E4AC7417ECB8B2871B0EF12CECD20F46 -Test: Encrypt -Comment: Set 3, vector 10 -Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Ciphertext: B29D18DD34C1CC00257838F1B8BD43DB -Test: Encrypt -Comment: Set 3, vector 11 -Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Ciphertext: FC1094A0A2850499D874B6DDC1EBA0B7 -Test: Encrypt -Comment: Set 3, vector 12 -Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Ciphertext: AD062A5D53BB0478F17DA5528839F9FF -Test: Encrypt -Comment: Set 3, vector 13 -Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Ciphertext: 2C9DFEC27363BD0E651CC91FC05FDADF -Test: Encrypt -Comment: Set 3, vector 14 -Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Ciphertext: 487C72BD251D4566AE6119A70A95B79F -Test: Encrypt -Comment: Set 3, vector 15 -Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Ciphertext: 18CE9F8E752F787051CB8E407EB16C12 -Test: Encrypt -Comment: Set 3, vector 16 -Key: 10101010101010101010101010101010 -Plaintext: 10101010101010101010101010101010 -Ciphertext: E1FA5FD3F40B766BBE3DF469AF41B420 -Test: Encrypt -Comment: Set 3, vector 17 -Key: 11111111111111111111111111111111 -Plaintext: 11111111111111111111111111111111 -Ciphertext: 09628EDC6CD69F4F85483DC37633F732 -Test: Encrypt -Comment: Set 3, vector 18 -Key: 12121212121212121212121212121212 -Plaintext: 12121212121212121212121212121212 -Ciphertext: 2E6C94A96F6744C4E8D4146B4ECCD815 -Test: Encrypt -Comment: Set 3, vector 19 -Key: 13131313131313131313131313131313 -Plaintext: 13131313131313131313131313131313 -Ciphertext: 800996B5B363ACAB3FB8982F9BBE767F -Test: Encrypt -Comment: Set 3, vector 20 -Key: 14141414141414141414141414141414 -Plaintext: 14141414141414141414141414141414 -Ciphertext: C254C27642167B8FF363EAAD41A165A8 -Test: Encrypt -Comment: Set 3, vector 21 -Key: 15151515151515151515151515151515 -Plaintext: 15151515151515151515151515151515 -Ciphertext: 0B43A548CFFE916BAD7AB58B5F51B1E2 -Test: Encrypt -Comment: Set 3, vector 22 -Key: 16161616161616161616161616161616 -Plaintext: 16161616161616161616161616161616 -Ciphertext: 6C753853277756B8E0578FDC371A8738 -Test: Encrypt -Comment: Set 3, vector 23 -Key: 17171717171717171717171717171717 -Plaintext: 17171717171717171717171717171717 -Ciphertext: A278A500B02D8B2C7E829F1816872B1A -Test: Encrypt -Comment: Set 3, vector 24 -Key: 18181818181818181818181818181818 -Plaintext: 18181818181818181818181818181818 -Ciphertext: 67DD5353E13CDD51FC52716BC6BAB258 -Test: Encrypt -Comment: Set 3, vector 25 -Key: 19191919191919191919191919191919 -Plaintext: 19191919191919191919191919191919 -Ciphertext: 1B2DF65083662590F49719D7721D7C61 -Test: Encrypt -Comment: Set 3, vector 26 -Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Ciphertext: B12E384030DE7B77866E758FB251CCFF -Test: Encrypt -Comment: Set 3, vector 27 -Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Ciphertext: C37B3145C36FE5B95AC1392BEB81C9D8 -Test: Encrypt -Comment: Set 3, vector 28 -Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Ciphertext: 5C25502EF79A5792DEE9359EDF7BA8BC -Test: Encrypt -Comment: Set 3, vector 29 -Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Ciphertext: F0D899AEF42F226605E6A61A650F00A1 -Test: Encrypt -Comment: Set 3, vector 30 -Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Ciphertext: 12096937A3474FE4D87C77581C09380B -Test: Encrypt -Comment: Set 3, vector 31 -Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Ciphertext: CFC3A30819A45111983ABBF16CC61E9A -Test: Encrypt -Comment: Set 3, vector 32 -Key: 20202020202020202020202020202020 -Plaintext: 20202020202020202020202020202020 -Ciphertext: 7E724027BB2F591C63254D936FCC4B43 -Test: Encrypt -Comment: Set 3, vector 33 -Key: 21212121212121212121212121212121 -Plaintext: 21212121212121212121212121212121 -Ciphertext: FC9893DACCE806419957685270D5BF13 -Test: Encrypt -Comment: Set 3, vector 34 -Key: 22222222222222222222222222222222 -Plaintext: 22222222222222222222222222222222 -Ciphertext: F6C372A2AE2C03D7A9E0597DBEDFE961 -Test: Encrypt -Comment: Set 3, vector 35 -Key: 23232323232323232323232323232323 -Plaintext: 23232323232323232323232323232323 -Ciphertext: 4EE3CD585BD7A498DE93DDE42FDCBE73 -Test: Encrypt -Comment: Set 3, vector 36 -Key: 24242424242424242424242424242424 -Plaintext: 24242424242424242424242424242424 -Ciphertext: 71D0FFA714D70B5A3CDCE26BC91D93EE -Test: Encrypt -Comment: Set 3, vector 37 -Key: 25252525252525252525252525252525 -Plaintext: 25252525252525252525252525252525 -Ciphertext: 918EB6A7FA54EE795DE68EB5C0011BFD -Test: Encrypt -Comment: Set 3, vector 38 -Key: 26262626262626262626262626262626 -Plaintext: 26262626262626262626262626262626 -Ciphertext: 3A3DBFD37FB057816485BA948034E25E -Test: Encrypt -Comment: Set 3, vector 39 -Key: 27272727272727272727272727272727 -Plaintext: 27272727272727272727272727272727 -Ciphertext: 1FAD9F63890CF5475F3557B83924427C -Test: Encrypt -Comment: Set 3, vector 40 -Key: 28282828282828282828282828282828 -Plaintext: 28282828282828282828282828282828 -Ciphertext: 63F70DD87B9D63FC79628DECC6F34605 -Test: Encrypt -Comment: Set 3, vector 41 -Key: 29292929292929292929292929292929 -Plaintext: 29292929292929292929292929292929 -Ciphertext: D8FE7DF75B51024B69BDAB4844233CBB -Test: Encrypt -Comment: Set 3, vector 42 -Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Ciphertext: D927B8DB454BEECFEE2F89ACD2D26F1A -Test: Encrypt -Comment: Set 3, vector 43 -Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Ciphertext: 958B7CFABED67123D21541083FA90EB8 -Test: Encrypt -Comment: Set 3, vector 44 -Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Ciphertext: 2F220AA3BB400736F3D0295E3C6D9052 -Test: Encrypt -Comment: Set 3, vector 45 -Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Ciphertext: A14F57CE4D9EA4C5E282108DF8FDE00E -Test: Encrypt -Comment: Set 3, vector 46 -Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Ciphertext: 23E437F93E0BE22B4C54BC187D70BCC1 -Test: Encrypt -Comment: Set 3, vector 47 -Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Ciphertext: 615B6706E39E4A55EA8BFA4EFB8EBAEA -Test: Encrypt -Comment: Set 3, vector 48 -Key: 30303030303030303030303030303030 -Plaintext: 30303030303030303030303030303030 -Ciphertext: 5354CC9F7CAA08298C9A8AD471B39235 -Test: Encrypt -Comment: Set 3, vector 49 -Key: 31313131313131313131313131313131 -Plaintext: 31313131313131313131313131313131 -Ciphertext: DA2512B115E748580B7D198BFF01A537 -Test: Encrypt -Comment: Set 3, vector 50 -Key: 32323232323232323232323232323232 -Plaintext: 32323232323232323232323232323232 -Ciphertext: AEF890FCDEC04BFB0C4724558688810B -Test: Encrypt -Comment: Set 3, vector 51 -Key: 33333333333333333333333333333333 -Plaintext: 33333333333333333333333333333333 -Ciphertext: AEC153899584F8B9FC9836B86A40BA4A -Test: Encrypt -Comment: Set 3, vector 52 -Key: 34343434343434343434343434343434 -Plaintext: 34343434343434343434343434343434 -Ciphertext: E86D0DBEBD69030C0654656E0D348A8E -Test: Encrypt -Comment: Set 3, vector 53 -Key: 35353535353535353535353535353535 -Plaintext: 35353535353535353535353535353535 -Ciphertext: 3EFFEE758220F7138D31564D5CDA82EF -Test: Encrypt -Comment: Set 3, vector 54 -Key: 36363636363636363636363636363636 -Plaintext: 36363636363636363636363636363636 -Ciphertext: A0A57A825008700B246CEE9821803321 -Test: Encrypt -Comment: Set 3, vector 55 -Key: 37373737373737373737373737373737 -Plaintext: 37373737373737373737373737373737 -Ciphertext: 318692397CD421D958D142299AE24E5E -Test: Encrypt -Comment: Set 3, vector 56 -Key: 38383838383838383838383838383838 -Plaintext: 38383838383838383838383838383838 -Ciphertext: 1B949505033DB5554BBBBBB9488970DE -Test: Encrypt -Comment: Set 3, vector 57 -Key: 39393939393939393939393939393939 -Plaintext: 39393939393939393939393939393939 -Ciphertext: 20600DB3471001F93837F8EB50F7EB2B -Test: Encrypt -Comment: Set 3, vector 58 -Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Ciphertext: 004C126190B7D20ADCA7331EA26AC487 -Test: Encrypt -Comment: Set 3, vector 59 -Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Ciphertext: 7F535656FE3113A61D21BE216365D9FD -Test: Encrypt -Comment: Set 3, vector 60 -Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Ciphertext: A7DA48E8AD71B1DC583A895A8CC85FF2 -Test: Encrypt -Comment: Set 3, vector 61 -Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Ciphertext: 02E8CB85E9DDEDFAB4D9DB7106C6C38F -Test: Encrypt -Comment: Set 3, vector 62 -Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Ciphertext: 44ACE8B20DF2DBA70C0287362D51ED5C -Test: Encrypt -Comment: Set 3, vector 63 -Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Ciphertext: 8ABDD80D977FAF208FDFC69AA70E9810 -Test: Encrypt -Comment: Set 3, vector 64 -Key: 40404040404040404040404040404040 -Plaintext: 40404040404040404040404040404040 -Ciphertext: 538ADCBE104A3483B3C2A3D8CE72FBD6 -Test: Encrypt -Comment: Set 3, vector 65 -Key: 41414141414141414141414141414141 -Plaintext: 41414141414141414141414141414141 -Ciphertext: 7F757894F1A04645BCB523E925A937C7 -Test: Encrypt -Comment: Set 3, vector 66 -Key: 42424242424242424242424242424242 -Plaintext: 42424242424242424242424242424242 -Ciphertext: FA4304C7D16E164E000461B2550207B1 -Test: Encrypt -Comment: Set 3, vector 67 -Key: 43434343434343434343434343434343 -Plaintext: 43434343434343434343434343434343 -Ciphertext: 5B8E43BF0CACBCB80933B4061F9702B2 -Test: Encrypt -Comment: Set 3, vector 68 -Key: 44444444444444444444444444444444 -Plaintext: 44444444444444444444444444444444 -Ciphertext: 4DB11630D8CD9390797EE30EE9A25CB3 -Test: Encrypt -Comment: Set 3, vector 69 -Key: 45454545454545454545454545454545 -Plaintext: 45454545454545454545454545454545 -Ciphertext: 61150375D22621E9DD7AB45227E4ADC1 -Test: Encrypt -Comment: Set 3, vector 70 -Key: 46464646464646464646464646464646 -Plaintext: 46464646464646464646464646464646 -Ciphertext: 825AA0A2275496EA00BE2C75982EC24E -Test: Encrypt -Comment: Set 3, vector 71 -Key: 47474747474747474747474747474747 -Plaintext: 47474747474747474747474747474747 -Ciphertext: 1EA3F70E26F079CE37801787B5F3655C -Test: Encrypt -Comment: Set 3, vector 72 -Key: 48484848484848484848484848484848 -Plaintext: 48484848484848484848484848484848 -Ciphertext: F46E712267A6CA8DA8AC044A4E3ADC69 -Test: Encrypt -Comment: Set 3, vector 73 -Key: 49494949494949494949494949494949 -Plaintext: 49494949494949494949494949494949 -Ciphertext: 00FCF96BD11DB90E045B948C2658FC07 -Test: Encrypt -Comment: Set 3, vector 74 -Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Ciphertext: 08E264CCDA07442DD6FB5BC8AF05A9C1 -Test: Encrypt -Comment: Set 3, vector 75 -Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Ciphertext: 35C189E86440D125B0CAF6C62CA0E4F9 -Test: Encrypt -Comment: Set 3, vector 76 -Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Ciphertext: 7FC2F545C0DE78664218F4F635CC8D10 -Test: Encrypt -Comment: Set 3, vector 77 -Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Ciphertext: 9DC067581AD80555C6E46C6594A626F5 -Test: Encrypt -Comment: Set 3, vector 78 -Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Ciphertext: D33A3E8035B42D76A483BE06B62054A6 -Test: Encrypt -Comment: Set 3, vector 79 -Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Ciphertext: 7CA26FD5D6DB7EAA785FCCA1E2854910 -Test: Encrypt -Comment: Set 3, vector 80 -Key: 50505050505050505050505050505050 -Plaintext: 50505050505050505050505050505050 -Ciphertext: E9A672BD5401539C1C8F2AB21A83B26B -Test: Encrypt -Comment: Set 3, vector 81 -Key: 51515151515151515151515151515151 -Plaintext: 51515151515151515151515151515151 -Ciphertext: 2948CB8989780E74BA525CC2FDDC42CF -Test: Encrypt -Comment: Set 3, vector 82 -Key: 52525252525252525252525252525252 -Plaintext: 52525252525252525252525252525252 -Ciphertext: A3A8308145C318D42F4E8310DF6D97E0 -Test: Encrypt -Comment: Set 3, vector 83 -Key: 53535353535353535353535353535353 -Plaintext: 53535353535353535353535353535353 -Ciphertext: 1757125D19851062D7782A2200A813E9 -Test: Encrypt -Comment: Set 3, vector 84 -Key: 54545454545454545454545454545454 -Plaintext: 54545454545454545454545454545454 -Ciphertext: 9BC4FC94FF7A09F9D4C23A3BDEAF498E -Test: Encrypt -Comment: Set 3, vector 85 -Key: 55555555555555555555555555555555 -Plaintext: 55555555555555555555555555555555 -Ciphertext: B36C8A8DC251A4D08B38160011498AB2 -Test: Encrypt -Comment: Set 3, vector 86 -Key: 56565656565656565656565656565656 -Plaintext: 56565656565656565656565656565656 -Ciphertext: 6C6058C8D5F2A32E31988239C4A657F1 -Test: Encrypt -Comment: Set 3, vector 87 -Key: 57575757575757575757575757575757 -Plaintext: 57575757575757575757575757575757 -Ciphertext: B8B914785FD465FB0F83FE4A676C3A6B -Test: Encrypt -Comment: Set 3, vector 88 -Key: 58585858585858585858585858585858 -Plaintext: 58585858585858585858585858585858 -Ciphertext: 00BBEEC24412F8A2C4291B5F1F32E662 -Test: Encrypt -Comment: Set 3, vector 89 -Key: 59595959595959595959595959595959 -Plaintext: 59595959595959595959595959595959 -Ciphertext: AF8353C84504526068884176D45CC8A0 -Test: Encrypt -Comment: Set 3, vector 90 -Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Ciphertext: F84DF1519736174F6F23B4CC3FC939F1 -Test: Encrypt -Comment: Set 3, vector 91 -Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Ciphertext: 320326E1024C9156B0E4C483065F0D94 -Test: Encrypt -Comment: Set 3, vector 92 -Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Ciphertext: 80AFE13AEC30894E8B772E73F367A148 -Test: Encrypt -Comment: Set 3, vector 93 -Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Ciphertext: 5F0D8BE9294D27DB7E6CD4D4F8A08D48 -Test: Encrypt -Comment: Set 3, vector 94 -Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Ciphertext: B6D8E7EF37171F6271AC274411E26867 -Test: Encrypt -Comment: Set 3, vector 95 -Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Ciphertext: 23DEBDDF60703AE0F8E9337C73C6FDC3 -Test: Encrypt -Comment: Set 3, vector 96 -Key: 60606060606060606060606060606060 -Plaintext: 60606060606060606060606060606060 -Ciphertext: D03B4696B0DCC56C37F7038747BEF222 -Test: Encrypt -Comment: Set 3, vector 97 -Key: 61616161616161616161616161616161 -Plaintext: 61616161616161616161616161616161 -Ciphertext: 201E6A1FA7898892DA1D3148766F7939 -Test: Encrypt -Comment: Set 3, vector 98 -Key: 62626262626262626262626262626262 -Plaintext: 62626262626262626262626262626262 -Ciphertext: D9643DBC3C373D300DB5AC3E699F7DDE -Test: Encrypt -Comment: Set 3, vector 99 -Key: 63636363636363636363636363636363 -Plaintext: 63636363636363636363636363636363 -Ciphertext: 1B04DAF08A764C09DFFE140403F4EC5D -Test: Encrypt -Comment: Set 3, vector 100 -Key: 64646464646464646464646464646464 -Plaintext: 64646464646464646464646464646464 -Ciphertext: 0510AA045E35862885AEEB1752328032 -Test: Encrypt -Comment: Set 3, vector 101 -Key: 65656565656565656565656565656565 -Plaintext: 65656565656565656565656565656565 -Ciphertext: 894E5FE4164A0B9CC2C50D95F18329E6 -Test: Encrypt -Comment: Set 3, vector 102 -Key: 66666666666666666666666666666666 -Plaintext: 66666666666666666666666666666666 -Ciphertext: 99D16D251893E474CD8A18C10798D418 -Test: Encrypt -Comment: Set 3, vector 103 -Key: 67676767676767676767676767676767 -Plaintext: 67676767676767676767676767676767 -Ciphertext: B41A0DEEA15FCB419E00318752503FA8 -Test: Encrypt -Comment: Set 3, vector 104 -Key: 68686868686868686868686868686868 -Plaintext: 68686868686868686868686868686868 -Ciphertext: 8BDDFBD29844F3EED1E02FB76628E877 -Test: Encrypt -Comment: Set 3, vector 105 -Key: 69696969696969696969696969696969 -Plaintext: 69696969696969696969696969696969 -Ciphertext: E71C41B95412E2ED6BC6B5693BC445E5 -Test: Encrypt -Comment: Set 3, vector 106 -Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Ciphertext: 566E5667E9BDDCE13F3B6DE0DEF06305 -Test: Encrypt -Comment: Set 3, vector 107 -Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Ciphertext: 49372FDCE8DC81E45A9E6FBFB8952F76 -Test: Encrypt -Comment: Set 3, vector 108 -Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Ciphertext: 034EAB9E0E881ABF0C4F9B7933E7F1B2 -Test: Encrypt -Comment: Set 3, vector 109 -Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Ciphertext: 56FFE171E45816C5808380530F3F9F23 -Test: Encrypt -Comment: Set 3, vector 110 -Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Ciphertext: 5FE59EE65A0321F3B09A1748CF18CC02 -Test: Encrypt -Comment: Set 3, vector 111 -Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Ciphertext: 8C13790203280B652614D224178C4289 -Test: Encrypt -Comment: Set 3, vector 112 -Key: 70707070707070707070707070707070 -Plaintext: 70707070707070707070707070707070 -Ciphertext: 52D7C5111B52E5356C8EF2B629BA6166 -Test: Encrypt -Comment: Set 3, vector 113 -Key: 71717171717171717171717171717171 -Plaintext: 71717171717171717171717171717171 -Ciphertext: 4FB997235548FB5C202A1514FF408068 -Test: Encrypt -Comment: Set 3, vector 114 -Key: 72727272727272727272727272727272 -Plaintext: 72727272727272727272727272727272 -Ciphertext: 8DDE9345FEDAB8D8D2DE5E2577756F16 -Test: Encrypt -Comment: Set 3, vector 115 -Key: 73737373737373737373737373737373 -Plaintext: 73737373737373737373737373737373 -Ciphertext: C1B39136F69B2044C30E38023EB6E7D2 -Test: Encrypt -Comment: Set 3, vector 116 -Key: 74747474747474747474747474747474 -Plaintext: 74747474747474747474747474747474 -Ciphertext: 6032D1B3844BEA4ACE81142A013C42BC -Test: Encrypt -Comment: Set 3, vector 117 -Key: 75757575757575757575757575757575 -Plaintext: 75757575757575757575757575757575 -Ciphertext: 985A9D8DDE048107368028AA24F5D70B -Test: Encrypt -Comment: Set 3, vector 118 -Key: 76767676767676767676767676767676 -Plaintext: 76767676767676767676767676767676 -Ciphertext: 5343E03D587A538475BB92F23E96FDF8 -Test: Encrypt -Comment: Set 3, vector 119 -Key: 77777777777777777777777777777777 -Plaintext: 77777777777777777777777777777777 -Ciphertext: 98253AF78B8DA7E5AE98E7B4E9FA74F9 -Test: Encrypt -Comment: Set 3, vector 120 -Key: 78787878787878787878787878787878 -Plaintext: 78787878787878787878787878787878 -Ciphertext: 8404DDA01CC702790B8B31408205E128 -Test: Encrypt -Comment: Set 3, vector 121 -Key: 79797979797979797979797979797979 -Plaintext: 79797979797979797979797979797979 -Ciphertext: C782C96911F30723AB90E3A0BA59B808 -Test: Encrypt -Comment: Set 3, vector 122 -Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Ciphertext: 471270191B1BB659804CEAE818793167 -Test: Encrypt -Comment: Set 3, vector 123 -Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Ciphertext: 2B27BBF7E47DA05F72EED52D038A3241 -Test: Encrypt -Comment: Set 3, vector 124 -Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Ciphertext: 0BD3B3F3F6F404B6B7C6D436605640B7 -Test: Encrypt -Comment: Set 3, vector 125 -Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Ciphertext: 74578268B9D9AD5D9819E51CA288F81D -Test: Encrypt -Comment: Set 3, vector 126 -Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Ciphertext: A77A67CC08111CE41B817176859675B5 -Test: Encrypt -Comment: Set 3, vector 127 -Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Ciphertext: 9BE99EFDAF9CCCB4D879173EA2197FEF -Test: Encrypt -Comment: Set 3, vector 128 -Key: 80808080808080808080808080808080 -Plaintext: 80808080808080808080808080808080 -Ciphertext: AA7627F70F6B54C217C3EF232D362459 -Test: Encrypt -Comment: Set 3, vector 129 -Key: 81818181818181818181818181818181 -Plaintext: 81818181818181818181818181818181 -Ciphertext: EE41F8DC661C2A8B95667CB1F908367A -Test: Encrypt -Comment: Set 3, vector 130 -Key: 82828282828282828282828282828282 -Plaintext: 82828282828282828282828282828282 -Ciphertext: AF2D71AC4D7E482E8134A65F2841101A -Test: Encrypt -Comment: Set 3, vector 131 -Key: 83838383838383838383838383838383 -Plaintext: 83838383838383838383838383838383 -Ciphertext: 98CFCAA37D3B1825C55FA94825BBC91A -Test: Encrypt -Comment: Set 3, vector 132 -Key: 84848484848484848484848484848484 -Plaintext: 84848484848484848484848484848484 -Ciphertext: 2ACFCBC772417EBD445F8B272857578C -Test: Encrypt -Comment: Set 3, vector 133 -Key: 85858585858585858585858585858585 -Plaintext: 85858585858585858585858585858585 -Ciphertext: 424DE49A69767A539E26581A19CD4F17 -Test: Encrypt -Comment: Set 3, vector 134 -Key: 86868686868686868686868686868686 -Plaintext: 86868686868686868686868686868686 -Ciphertext: F25ED7239B234E58AE40F7612E3CE6BA -Test: Encrypt -Comment: Set 3, vector 135 -Key: 87878787878787878787878787878787 -Plaintext: 87878787878787878787878787878787 -Ciphertext: 4BF44DBA1E6E80DE3554F7EEF0621EBF -Test: Encrypt -Comment: Set 3, vector 136 -Key: 88888888888888888888888888888888 -Plaintext: 88888888888888888888888888888888 -Ciphertext: 6B87409975816BC8480985D079B08594 -Test: Encrypt -Comment: Set 3, vector 137 -Key: 89898989898989898989898989898989 -Plaintext: 89898989898989898989898989898989 -Ciphertext: D026A866DD55C02EE77DF1E93405A751 -Test: Encrypt -Comment: Set 3, vector 138 -Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Ciphertext: A45F7212DD04352DEF319D58922C44CE -Test: Encrypt -Comment: Set 3, vector 139 -Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Ciphertext: 4600AD219EE97A7BFF629D8F6E337C79 -Test: Encrypt -Comment: Set 3, vector 140 -Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Ciphertext: A26CEFEC7612A89E8543503A678D921F -Test: Encrypt -Comment: Set 3, vector 141 -Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Ciphertext: 5CA126B9342723816C82AC1D41F97EFB -Test: Encrypt -Comment: Set 3, vector 142 -Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Ciphertext: 76DC82C091F5691C35E8735EB901B788 -Test: Encrypt -Comment: Set 3, vector 143 -Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Ciphertext: 2F8AA5E8D7D90B3E7FCC20128F462AAD -Test: Encrypt -Comment: Set 3, vector 144 -Key: 90909090909090909090909090909090 -Plaintext: 90909090909090909090909090909090 -Ciphertext: 67B8B189FCD886FD2160005C93D9F3B2 -Test: Encrypt -Comment: Set 3, vector 145 -Key: 91919191919191919191919191919191 -Plaintext: 91919191919191919191919191919191 -Ciphertext: 8DFBD0B7D8B614E15B56571A6A5B443D -Test: Encrypt -Comment: Set 3, vector 146 -Key: 92929292929292929292929292929292 -Plaintext: 92929292929292929292929292929292 -Ciphertext: F10DA9ABD28359461A3BB271C2037D1A -Test: Encrypt -Comment: Set 3, vector 147 -Key: 93939393939393939393939393939393 -Plaintext: 93939393939393939393939393939393 -Ciphertext: 5A53C6ADF38E807BC03CC53193133CDE -Test: Encrypt -Comment: Set 3, vector 148 -Key: 94949494949494949494949494949494 -Plaintext: 94949494949494949494949494949494 -Ciphertext: 298AF9909A89241F34DB6BF6ACC6A909 -Test: Encrypt -Comment: Set 3, vector 149 -Key: 95959595959595959595959595959595 -Plaintext: 95959595959595959595959595959595 -Ciphertext: DAA5C134BDD34A775DEC219F6DE219BE -Test: Encrypt -Comment: Set 3, vector 150 -Key: 96969696969696969696969696969696 -Plaintext: 96969696969696969696969696969696 -Ciphertext: 2514903F8ABA0F65CA22C8AD82FF2574 -Test: Encrypt -Comment: Set 3, vector 151 -Key: 97979797979797979797979797979797 -Plaintext: 97979797979797979797979797979797 -Ciphertext: 11696CB06D2F97B1A2CB380E2887AB7E -Test: Encrypt -Comment: Set 3, vector 152 -Key: 98989898989898989898989898989898 -Plaintext: 98989898989898989898989898989898 -Ciphertext: E70BAE913D953A66AC35DE9CAA6D205D -Test: Encrypt -Comment: Set 3, vector 153 -Key: 99999999999999999999999999999999 -Plaintext: 99999999999999999999999999999999 -Ciphertext: 20BC3C8F4E81EEA320189E6063017706 -Test: Encrypt -Comment: Set 3, vector 154 -Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Ciphertext: 53A956A32B4B532F5E9BE8C94278EC57 -Test: Encrypt -Comment: Set 3, vector 155 -Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Ciphertext: 2562236E541426B29A4232E592237CAD -Test: Encrypt -Comment: Set 3, vector 156 -Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Ciphertext: 0F8A9DEDA85B0A1CF7487C6ED823B869 -Test: Encrypt -Comment: Set 3, vector 157 -Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Ciphertext: 8917CF4F1A25A500440CF0665BB517A0 -Test: Encrypt -Comment: Set 3, vector 158 -Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Ciphertext: F5C065F3821FA664724BF6AFF1039430 -Test: Encrypt -Comment: Set 3, vector 159 -Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Ciphertext: F5D5131F0D2F4859EC38F8999A93E74D -Test: Encrypt -Comment: Set 3, vector 160 -Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Ciphertext: 9A02DF44F2194E94B7E34F1DCC234685 -Test: Encrypt -Comment: Set 3, vector 161 -Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Ciphertext: 59491E467432E6147EAFE37BCD93DA01 -Test: Encrypt -Comment: Set 3, vector 162 -Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Ciphertext: 4D0B317CE4AE577CF87B225C53DDF352 -Test: Encrypt -Comment: Set 3, vector 163 -Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Ciphertext: 73E082DC996995BDDD1F5544326D56D6 -Test: Encrypt -Comment: Set 3, vector 164 -Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Ciphertext: 46C5C6E23A72C9DF410EF979F93CF266 -Test: Encrypt -Comment: Set 3, vector 165 -Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Ciphertext: 1F55093C234648C5C9C781E8C9FD42C4 -Test: Encrypt -Comment: Set 3, vector 166 -Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Ciphertext: BFA2702CF3DAE25705D1DE1CCDBDC49E -Test: Encrypt -Comment: Set 3, vector 167 -Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Ciphertext: 3223365425C1ADE87FF766AB048D9ADB -Test: Encrypt -Comment: Set 3, vector 168 -Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Ciphertext: 5449889254C565DF3ADDFB7A86A93DA9 -Test: Encrypt -Comment: Set 3, vector 169 -Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Ciphertext: 7D21880CCA919B0CE3917A8C598025FA -Test: Encrypt -Comment: Set 3, vector 170 -Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Ciphertext: 5EE203A6739E822A54D9678B604EFD4F -Test: Encrypt -Comment: Set 3, vector 171 -Key: ABABABABABABABABABABABABABABABAB -Plaintext: ABABABABABABABABABABABABABABABAB -Ciphertext: 07038EFBEFDE2228F79A6B526306483A -Test: Encrypt -Comment: Set 3, vector 172 -Key: ACACACACACACACACACACACACACACACAC -Plaintext: ACACACACACACACACACACACACACACACAC -Ciphertext: 78447EBF959FFBD120283CE319FF6005 -Test: Encrypt -Comment: Set 3, vector 173 -Key: ADADADADADADADADADADADADADADADAD -Plaintext: ADADADADADADADADADADADADADADADAD -Ciphertext: 76769D40A286F0FD1C1C6F8895000DE8 -Test: Encrypt -Comment: Set 3, vector 174 -Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Ciphertext: 7E163343CA44FADFAFDE5386CC111437 -Test: Encrypt -Comment: Set 3, vector 175 -Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Ciphertext: 4B1E7FE684222BF783142B5DC396F61D -Test: Encrypt -Comment: Set 3, vector 176 -Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Ciphertext: 4ECF97472658AC941EC99B255CF95535 -Test: Encrypt -Comment: Set 3, vector 177 -Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Ciphertext: 23EE9DF24C8DC126A04586EFF27DBEAC -Test: Encrypt -Comment: Set 3, vector 178 -Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Ciphertext: 4B06EE28B7769C4318D509F91D691F39 -Test: Encrypt -Comment: Set 3, vector 179 -Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Ciphertext: 51994EF8283D1D29711F602A7ACDA3CA -Test: Encrypt -Comment: Set 3, vector 180 -Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Ciphertext: DCBFBE6BE3234BBB61EA68218C89D098 -Test: Encrypt -Comment: Set 3, vector 181 -Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Ciphertext: B84BFA0883546D912BD14807253F8892 -Test: Encrypt -Comment: Set 3, vector 182 -Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Ciphertext: 90C1745C0DB97E70BA362CF2C1D376DF -Test: Encrypt -Comment: Set 3, vector 183 -Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Ciphertext: 064743C2E8293C1B7619F6E6DEC13B04 -Test: Encrypt -Comment: Set 3, vector 184 -Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Ciphertext: 38D913C68ABEE287368CBA38D8FE9F0D -Test: Encrypt -Comment: Set 3, vector 185 -Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Ciphertext: B2279D520B33258B7DB221ECDD3C4EBB -Test: Encrypt -Comment: Set 3, vector 186 -Key: BABABABABABABABABABABABABABABABA -Plaintext: BABABABABABABABABABABABABABABABA -Ciphertext: 8AD710DDAE51BE6D4BE7ABC5443B7F9B -Test: Encrypt -Comment: Set 3, vector 187 -Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Ciphertext: 246BA7624BBF83702764CC1B214A0691 -Test: Encrypt -Comment: Set 3, vector 188 -Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Ciphertext: 80E0360B03FA048A892CD47BD7FE948A -Test: Encrypt -Comment: Set 3, vector 189 -Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Ciphertext: 09D5D35BB6DBAE0CC9982D6955EAA01C -Test: Encrypt -Comment: Set 3, vector 190 -Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Ciphertext: EEBDCE2BDE1F25A40184B9C57DD4E49D -Test: Encrypt -Comment: Set 3, vector 191 -Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Ciphertext: 22706CFCCD2B0BB15ED30E373FA4E945 -Test: Encrypt -Comment: Set 3, vector 192 -Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Ciphertext: D2A4EEACB5F41D12908DD1E069EC14DC -Test: Encrypt -Comment: Set 3, vector 193 -Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Ciphertext: E78F614BC7F53C9298098DFEE8ADFB09 -Test: Encrypt -Comment: Set 3, vector 194 -Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Ciphertext: B53E3865A8B28A36EF3A505102A6329D -Test: Encrypt -Comment: Set 3, vector 195 -Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Ciphertext: 9B32AA8673DFFC47CF8C9B35DDE08DD3 -Test: Encrypt -Comment: Set 3, vector 196 -Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Ciphertext: CE70E7257E6C8686C7407E22ACB3E94B -Test: Encrypt -Comment: Set 3, vector 197 -Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Ciphertext: 677DB939CA272D717DB4B03EFB70F988 -Test: Encrypt -Comment: Set 3, vector 198 -Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Ciphertext: 6582B069058FA86898A3B12B617C27FD -Test: Encrypt -Comment: Set 3, vector 199 -Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Ciphertext: 4DFB68486ECF9833FCE74BD663E20768 -Test: Encrypt -Comment: Set 3, vector 200 -Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Ciphertext: 6A3840D2780BABD68A73FAC89C4E8D91 -Test: Encrypt -Comment: Set 3, vector 201 -Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Ciphertext: 44C79926D7EAB9DE5A2B95472A79A7BC -Test: Encrypt -Comment: Set 3, vector 202 -Key: CACACACACACACACACACACACACACACACA -Plaintext: CACACACACACACACACACACACACACACACA -Ciphertext: 3813E774EE9EFA8FDB2646E607B2A434 -Test: Encrypt -Comment: Set 3, vector 203 -Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Ciphertext: FCA748E6AE5678A047E806F8FF103A65 -Test: Encrypt -Comment: Set 3, vector 204 -Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Ciphertext: 3E3CC9CBE6952AB968FBBEE0C08BF667 -Test: Encrypt -Comment: Set 3, vector 205 -Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Ciphertext: 4FFF3EDC7BCB70E7846DCC4688F9CB3A -Test: Encrypt -Comment: Set 3, vector 206 -Key: CECECECECECECECECECECECECECECECE -Plaintext: CECECECECECECECECECECECECECECECE -Ciphertext: 5728481E82E0DC1631EC611F63B9DD3C -Test: Encrypt -Comment: Set 3, vector 207 -Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Ciphertext: 182BB0D3C52E56248FDA1D343844891D -Test: Encrypt -Comment: Set 3, vector 208 -Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Ciphertext: 6B984FC45D0352F3336E7895ECB6DE0E -Test: Encrypt -Comment: Set 3, vector 209 -Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Ciphertext: 8DD24A1B23D845E7A6C6D416C7C5B595 -Test: Encrypt -Comment: Set 3, vector 210 -Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Ciphertext: 4F4D69B4563373962007945C3197806C -Test: Encrypt -Comment: Set 3, vector 211 -Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Ciphertext: DD333390213EB632A51EAE0334A5AEA2 -Test: Encrypt -Comment: Set 3, vector 212 -Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Ciphertext: D352ACE83BF6A3BC39EA10D751853009 -Test: Encrypt -Comment: Set 3, vector 213 -Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Ciphertext: F2E118276BFCCF6DCDD47E1EAB919BDC -Test: Encrypt -Comment: Set 3, vector 214 -Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Ciphertext: 688E877D8B69050F2736D0768571E9A0 -Test: Encrypt -Comment: Set 3, vector 215 -Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Ciphertext: DE6F098E56985B7DCFEC52C897F2E735 -Test: Encrypt -Comment: Set 3, vector 216 -Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Ciphertext: 398FA1FE47E3971DA3F9DFD479C9B1AA -Test: Encrypt -Comment: Set 3, vector 217 -Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Ciphertext: 6F17B7D7C899B48DAEAD1E90F22AB180 -Test: Encrypt -Comment: Set 3, vector 218 -Key: DADADADADADADADADADADADADADADADA -Plaintext: DADADADADADADADADADADADADADADADA -Ciphertext: D39EBBA5B742F15FCB75D6E656BBF2DA -Test: Encrypt -Comment: Set 3, vector 219 -Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Ciphertext: 1C6D82247D0BAB18B52CA5293A2C1050 -Test: Encrypt -Comment: Set 3, vector 220 -Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Ciphertext: B54F248DF57060E40A6A2FA4688C7082 -Test: Encrypt -Comment: Set 3, vector 221 -Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Ciphertext: 1BB5EB8732CBAB2E3FC334FAAB8BBFBC -Test: Encrypt -Comment: Set 3, vector 222 -Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Ciphertext: 3734B4B21B50C4740B90FD863EF8627B -Test: Encrypt -Comment: Set 3, vector 223 -Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Ciphertext: E22E22E60F981D64B7CB341F12F2B362 -Test: Encrypt -Comment: Set 3, vector 224 -Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Ciphertext: A2A40EB448D87E39B20460E8CB07515A -Test: Encrypt -Comment: Set 3, vector 225 -Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Ciphertext: 88E6AC929D4D7858015B35D509882C5C -Test: Encrypt -Comment: Set 3, vector 226 -Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Ciphertext: FFE4B3B5D0E8229F5428FA2945DBD5EE -Test: Encrypt -Comment: Set 3, vector 227 -Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Ciphertext: FCD5F897398A7796A0DAA1809CA7D870 -Test: Encrypt -Comment: Set 3, vector 228 -Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Ciphertext: 7F3556B18EC8F04D953DCD27549AF1FC -Test: Encrypt -Comment: Set 3, vector 229 -Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Ciphertext: 4433546A8E63AE841CD78B074ED0B91F -Test: Encrypt -Comment: Set 3, vector 230 -Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Ciphertext: 2E04671C718BD6C3D115DB2D827A6669 -Test: Encrypt -Comment: Set 3, vector 231 -Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Ciphertext: AAE7DA4B977F5EED28F9AF01F8FD47B4 -Test: Encrypt -Comment: Set 3, vector 232 -Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Ciphertext: 84AD8F52D51BD3D8E4D8318AF6DB9786 -Test: Encrypt -Comment: Set 3, vector 233 -Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Ciphertext: 95EFA65090BD603A1F65A21A43104F79 -Test: Encrypt -Comment: Set 3, vector 234 -Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Ciphertext: 1B83F51E157BBA004CC5BD05986017C8 -Test: Encrypt -Comment: Set 3, vector 235 -Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Ciphertext: A0C37A641126D5801C4259DFD38E8E8A -Test: Encrypt -Comment: Set 3, vector 236 -Key: ECECECECECECECECECECECECECECECEC -Plaintext: ECECECECECECECECECECECECECECECEC -Ciphertext: 3153A212C2E4727C1032223134342B31 -Test: Encrypt -Comment: Set 3, vector 237 -Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Ciphertext: C680D98CAF4409CF31BABCF67352E1D5 -Test: Encrypt -Comment: Set 3, vector 238 -Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Ciphertext: A7FC85C8459274B836B6F0CBED80AF49 -Test: Encrypt -Comment: Set 3, vector 239 -Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Ciphertext: 5CA8B8A4B8AF15A6184259831B18BBB5 -Test: Encrypt -Comment: Set 3, vector 240 -Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Ciphertext: F118089963B9AB37776B10B0D4CCEBA4 -Test: Encrypt -Comment: Set 3, vector 241 -Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Ciphertext: C233B864E78E9EC272112A34FF7AADBA -Test: Encrypt -Comment: Set 3, vector 242 -Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Ciphertext: 2B1C503E7F755A47CC4C57BEB4135B46 -Test: Encrypt -Comment: Set 3, vector 243 -Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Ciphertext: 60D8177BE1044FC5F46DA2B3CAA33102 -Test: Encrypt -Comment: Set 3, vector 244 -Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Ciphertext: BA1CBC06977ECE57C5CBC12D99324E00 -Test: Encrypt -Comment: Set 3, vector 245 -Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Ciphertext: 01C8561E24A32F53FBAF8864AEE803E3 -Test: Encrypt -Comment: Set 3, vector 246 -Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Ciphertext: 797ECFA429014F26B9E62D58B4C1B84E -Test: Encrypt -Comment: Set 3, vector 247 -Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Ciphertext: 6AD7FA698A7F3EA8AE13B1DF537BF6EA -Test: Encrypt -Comment: Set 3, vector 248 -Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Ciphertext: 49157343BE8B8ED4E59C1AEC3CAB1B94 -Test: Encrypt -Comment: Set 3, vector 249 -Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Ciphertext: D33C742DEA4A2C64983766E3068EC200 -Test: Encrypt -Comment: Set 3, vector 250 -Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Ciphertext: 66AE1EAFB45091982E40000BADE002C9 -Test: Encrypt -Comment: Set 3, vector 251 -Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Ciphertext: B6614B0FF5924D0C1EB2C461560BFC01 -Test: Encrypt -Comment: Set 3, vector 252 -Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Ciphertext: 5B4DFBE2BB7666425A858C4769D8DAD0 -Test: Encrypt -Comment: Set 3, vector 253 -Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Ciphertext: 2F142B9044DEC39915ED9347E7B0ED1E -Test: Encrypt -Comment: Set 3, vector 254 -Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Ciphertext: 17E02528D6655CEA7BE6B8548FC2DA65 -Test: Encrypt -Comment: Set 3, vector 255 -Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Ciphertext: 25DD9EB9DD67FBC6E8431F56F4FBE651 -Test: Encrypt -Comment: Tests with 192-bit keys -Comment: Set 1, vector 0 -Key: 800000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1B6220D365C2176C1D41A5826520FCA1 -Test: Encrypt -Comment: Set 1, vector 1 -Key: 400000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0F6DAEEA95CFC8925F23AFA932DF489B -Test: Encrypt -Comment: Set 1, vector 2 -Key: 200000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7330199225AD384F8DD39582D61389BB -Test: Encrypt -Comment: Set 1, vector 3 -Key: 100000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2CC5A47D5C62F70634E27BA332D37D53 -Test: Encrypt -Comment: Set 1, vector 4 -Key: 080000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CDF1D23AB15E20AE8E9A2FE380920897 -Test: Encrypt -Comment: Set 1, vector 5 -Key: 040000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CE995A8AF1FD7E0F5FA07ED654841EEE -Test: Encrypt -Comment: Set 1, vector 6 -Key: 020000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0678BA4335E44354363005F278AF83A4 -Test: Encrypt -Comment: Set 1, vector 7 -Key: 010000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6162ED593434D738B44D642254066FB4 -Test: Encrypt -Comment: Set 1, vector 8 -Key: 008000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F7F146E61396EC9AB9F7D04BFA6D37F5 -Test: Encrypt -Comment: Set 1, vector 9 -Key: 004000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8BF96FE41906AF2CC702726B963E56A6 -Test: Encrypt -Comment: Set 1, vector 10 -Key: 002000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B164168F7D6BADBCCBE19B2BCF4EAA91 -Test: Encrypt -Comment: Set 1, vector 11 -Key: 001000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5A81508260797F7BCFD4E0DB62F5E3A7 -Test: Encrypt -Comment: Set 1, vector 12 -Key: 000800000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 36641169D53E61CB32B97B98C37DF262 -Test: Encrypt -Comment: Set 1, vector 13 -Key: 000400000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EFFEC137ECEE5D439F8B21ACE1D863F8 -Test: Encrypt -Comment: Set 1, vector 14 -Key: 000200000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7462DEB8C153EECB6C78CE690E764B53 -Test: Encrypt -Comment: Set 1, vector 15 -Key: 000100000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 34F873BD3D6FF62B18C3778B123B15C5 -Test: Encrypt -Comment: Set 1, vector 16 -Key: 000080000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9850C8E08F952EE1D173B1A4A78686F5 -Test: Encrypt -Comment: Set 1, vector 17 -Key: 000040000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3285534795E8547B68580343DC5BF330 -Test: Encrypt -Comment: Set 1, vector 18 -Key: 000020000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E0495AA72CB3C27233850F3192254232 -Test: Encrypt -Comment: Set 1, vector 19 -Key: 000010000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 33ED350E83B7FE34E74C22A883EC6728 -Test: Encrypt -Comment: Set 1, vector 20 -Key: 000008000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 912D73428CBA7F631AE577854C111C91 -Test: Encrypt -Comment: Set 1, vector 21 -Key: 000004000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 76E747DC49B25D8E6EBE5DE83980AB57 -Test: Encrypt -Comment: Set 1, vector 22 -Key: 000002000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 82A2ED3BE0371C98C176AA7E7DF9FF8D -Test: Encrypt -Comment: Set 1, vector 23 -Key: 000001000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 96282A04DD3405294F9714B396D5219A -Test: Encrypt -Comment: Set 1, vector 24 -Key: 000000800000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 86ECD349003006A6DE29D4AAC1ACE296 -Test: Encrypt -Comment: Set 1, vector 25 -Key: 000000400000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7A9A9F2BBEA203ECE7C9F531B6D41B6A -Test: Encrypt -Comment: Set 1, vector 26 -Key: 000000200000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BA5FE8CD976DEA118728C2950D325042 -Test: Encrypt -Comment: Set 1, vector 27 -Key: 000000100000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 46F29ADE35C839AE69454CB0C9EEBF71 -Test: Encrypt -Comment: Set 1, vector 28 -Key: 000000080000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E5B83E23535FC32DD8153C46EC894FAD -Test: Encrypt -Comment: Set 1, vector 29 -Key: 000000040000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 877CC6280A8E7740F710AEA535DADFD4 -Test: Encrypt -Comment: Set 1, vector 30 -Key: 000000020000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 284D6EEC89721D40BDCFD260AF4FF052 -Test: Encrypt -Comment: Set 1, vector 31 -Key: 000000010000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6482ED6C71B60F1ED92B9913B5EAF6B3 -Test: Encrypt -Comment: Set 1, vector 32 -Key: 000000008000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 30135C97C9C23C8C64612D6BB813AD61 -Test: Encrypt -Comment: Set 1, vector 33 -Key: 000000004000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 336F70CF867920BBC00699CA8DBDF6DA -Test: Encrypt -Comment: Set 1, vector 34 -Key: 000000002000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3F4003C9600469670DE0B1B20ED5F33D -Test: Encrypt -Comment: Set 1, vector 35 -Key: 000000001000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9D5FFEDF7166F74DCAF2D643E2934ABE -Test: Encrypt -Comment: Set 1, vector 36 -Key: 000000000800000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9BFAC0EEB78A21F006DB6847CC7D7929 -Test: Encrypt -Comment: Set 1, vector 37 -Key: 000000000400000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B64332DC813BE982897C1E14DA808F5D -Test: Encrypt -Comment: Set 1, vector 38 -Key: 000000000200000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AB8FCEB76C37E5FE5737DA4382F14347 -Test: Encrypt -Comment: Set 1, vector 39 -Key: 000000000100000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C9C121859975147145AF6CAE313BA00D -Test: Encrypt -Comment: Set 1, vector 40 -Key: 000000000080000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9B1307BF36B6FF5BA4AD9C6574B63955 -Test: Encrypt -Comment: Set 1, vector 41 -Key: 000000000040000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8842C3EBB26C1863440D52DC3B26414B -Test: Encrypt -Comment: Set 1, vector 42 -Key: 000000000020000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: ADEADD3E035D591B2197D5B9C9B06ADA -Test: Encrypt -Comment: Set 1, vector 43 -Key: 000000000010000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4F36AD57F9BA5FB6624E504D0FC2DC93 -Test: Encrypt -Comment: Set 1, vector 44 -Key: 000000000008000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 92A364EEB2D964949210C7FF14BAE7B5 -Test: Encrypt -Comment: Set 1, vector 45 -Key: 000000000004000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EA027B9653456B8A41910FE19A90FD50 -Test: Encrypt -Comment: Set 1, vector 46 -Key: 000000000002000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 254A41CA04427C9E87F65BB52A0ACF74 -Test: Encrypt -Comment: Set 1, vector 47 -Key: 000000000001000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F935FD318C08AC6CD57A028384FA447B -Test: Encrypt -Comment: Set 1, vector 48 -Key: 000000000000800000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E5BA10850CBCFF8F42FEC0E658685096 -Test: Encrypt -Comment: Set 1, vector 49 -Key: 000000000000400000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6F145C7015923CE515D78CEF0157CCC6 -Test: Encrypt -Comment: Set 1, vector 50 -Key: 000000000000200000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3A6FCA03EA6DBF6996FD2CE99EC17C31 -Test: Encrypt -Comment: Set 1, vector 51 -Key: 000000000000100000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 21E2ED82498B110EAEAD90F1BBEA03A6 -Test: Encrypt -Comment: Set 1, vector 52 -Key: 000000000000080000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6B16ED3CBADC3151323891C373C43DFB -Test: Encrypt -Comment: Set 1, vector 53 -Key: 000000000000040000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B621A20E0CA41620C2A483154DB6102C -Test: Encrypt -Comment: Set 1, vector 54 -Key: 000000000000020000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8C754011BD3B87AA1EB3607B98E6CE86 -Test: Encrypt -Comment: Set 1, vector 55 -Key: 000000000000010000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FEEE2DFBA1DD3DBF4017B13833117816 -Test: Encrypt -Comment: Set 1, vector 56 -Key: 000000000000008000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 62A9C6CC76519FCF8FAD9EED0552CEB3 -Test: Encrypt -Comment: Set 1, vector 57 -Key: 000000000000004000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FF822FAFB79035AB813246BA5234D675 -Test: Encrypt -Comment: Set 1, vector 58 -Key: 000000000000002000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F3E17F2406DF31E7074DF97B062396B9 -Test: Encrypt -Comment: Set 1, vector 59 -Key: 000000000000001000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3F4F81B3573B6756ADD3005087EDE501 -Test: Encrypt -Comment: Set 1, vector 60 -Key: 000000000000000800000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 65A03A1A1C44191B73D576B7C75B5C32 -Test: Encrypt -Comment: Set 1, vector 61 -Key: 000000000000000400000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B08EBB2097DA76C34E2D8A869DCD3D7D -Test: Encrypt -Comment: Set 1, vector 62 -Key: 000000000000000200000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BA7B88E1B1FCFA03C3DBB2EDE047F5DC -Test: Encrypt -Comment: Set 1, vector 63 -Key: 000000000000000100000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1B3CB3884C12691CC66202EDB0838106 -Test: Encrypt -Comment: Set 1, vector 64 -Key: 000000000000000080000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4A85BE25546958B1E91801A35C7386E2 -Test: Encrypt -Comment: Set 1, vector 65 -Key: 000000000000000040000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F14CAACDD919872396DBCDCBEF9A384C -Test: Encrypt -Comment: Set 1, vector 66 -Key: 000000000000000020000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 23B0D4FC870309DFEF7AFC04C46AF26A -Test: Encrypt -Comment: Set 1, vector 67 -Key: 000000000000000010000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C93604723C3DBBC66AFF87AB1864C76C -Test: Encrypt -Comment: Set 1, vector 68 -Key: 000000000000000008000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6C14E822857BA0983AAC42995D973092 -Test: Encrypt -Comment: Set 1, vector 69 -Key: 000000000000000004000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 700AFEA175DBEAE688F90B8D32990560 -Test: Encrypt -Comment: Set 1, vector 70 -Key: 000000000000000002000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 54AE9EFA09FC70A852212752B83AF1F2 -Test: Encrypt -Comment: Set 1, vector 71 -Key: 000000000000000001000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2474EF8E660333FC9763E137DDB1AA1F -Test: Encrypt -Comment: Set 1, vector 72 -Key: 000000000000000000800000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E52ECE1281186644B6A2228A89BD2304 -Test: Encrypt -Comment: Set 1, vector 73 -Key: 000000000000000000400000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 610A02ECEC1B5BA0C6EC7CE8D6197722 -Test: Encrypt -Comment: Set 1, vector 74 -Key: 000000000000000000200000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8A8AB3DA5CE37E1D68B496F110E4F941 -Test: Encrypt -Comment: Set 1, vector 75 -Key: 000000000000000000100000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6961F3A7E6550753C55E4C03FA7869E9 -Test: Encrypt -Comment: Set 1, vector 76 -Key: 000000000000000000080000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D8F149C207FAD4480BA2FC609BEB4471 -Test: Encrypt -Comment: Set 1, vector 77 -Key: 000000000000000000040000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DE9DC95336F2088935881DD57C0A4B98 -Test: Encrypt -Comment: Set 1, vector 78 -Key: 000000000000000000020000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DC4EA3B0F76439DB8847FE61C1A64F7A -Test: Encrypt -Comment: Set 1, vector 79 -Key: 000000000000000000010000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 21D4802EB72232AD2B0B46C50C98445B -Test: Encrypt -Comment: Set 1, vector 80 -Key: 000000000000000000008000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D6C32522B546BAC316E5F3A07F83FFE6 -Test: Encrypt -Comment: Set 1, vector 81 -Key: 000000000000000000004000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4B07B02C86B579A0C68D916DF8A1EB76 -Test: Encrypt -Comment: Set 1, vector 82 -Key: 000000000000000000002000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 060B15735C978DF9F4F3ED503B95D6C3 -Test: Encrypt -Comment: Set 1, vector 83 -Key: 000000000000000000001000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3040B3C9C560C968FE14664E3496D5D1 -Test: Encrypt -Comment: Set 1, vector 84 -Key: 000000000000000000000800000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8971CFB236598BBD46E47E172B0690F7 -Test: Encrypt -Comment: Set 1, vector 85 -Key: 000000000000000000000400000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8D7FAB4985A0BAC4CAEE341972D49CF4 -Test: Encrypt -Comment: Set 1, vector 86 -Key: 000000000000000000000200000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: ED29003D83CB7D7747C17A8691323021 -Test: Encrypt -Comment: Set 1, vector 87 -Key: 000000000000000000000100000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 98EBFDA32C99438F0A549B7BFAAC0635 -Test: Encrypt -Comment: Set 1, vector 88 -Key: 000000000000000000000080000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A59AB8EAF03BCDFD7CB0A9650E59F27B -Test: Encrypt -Comment: Set 1, vector 89 -Key: 000000000000000000000040000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 71422297CE93952D46FFC27530D6255D -Test: Encrypt -Comment: Set 1, vector 90 -Key: 000000000000000000000020000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 519E2607543C3AFE49190EBCA12ADBBC -Test: Encrypt -Comment: Set 1, vector 91 -Key: 000000000000000000000010000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8989C908C50E008E70EA5B897DC3544C -Test: Encrypt -Comment: Set 1, vector 92 -Key: 000000000000000000000008000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 981C174277F29F8DD06E1D4C97D9816F -Test: Encrypt -Comment: Set 1, vector 93 -Key: 000000000000000000000004000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0279DEC16A532E160AA5B4FF7682F696 -Test: Encrypt -Comment: Set 1, vector 94 -Key: 000000000000000000000002000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C3BFFB31FCB0A61188DE9AA606CB286C -Test: Encrypt -Comment: Set 1, vector 95 -Key: 000000000000000000000001000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5C1C4966B387A41D52F83BBF322D25DF -Test: Encrypt -Comment: Set 1, vector 96 -Key: 000000000000000000000000800000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6602ECC6AF62EF1EB4D17E2487A64F7A -Test: Encrypt -Comment: Set 1, vector 97 -Key: 000000000000000000000000400000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2DA725366BD7774BA235183CC9B273B4 -Test: Encrypt -Comment: Set 1, vector 98 -Key: 000000000000000000000000200000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 71B29CF87C313F0B89B75251EFC4FF7F -Test: Encrypt -Comment: Set 1, vector 99 -Key: 000000000000000000000000100000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4D9BDBCBA04C54AEAA7F48470428ECA2 -Test: Encrypt -Comment: Set 1, vector 100 -Key: 000000000000000000000000080000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C6BC53A3C6D6C8A6F12B97B151BFBB3F -Test: Encrypt -Comment: Set 1, vector 101 -Key: 000000000000000000000000040000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FD3E8D6732BBC2AA13F03F9AB0BCEC14 -Test: Encrypt -Comment: Set 1, vector 102 -Key: 000000000000000000000000020000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7D5ED8FEF289FF7F8953278E0A0297A1 -Test: Encrypt -Comment: Set 1, vector 103 -Key: 000000000000000000000000010000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 84A20023EF5E31771802E8A2FFBA485B -Test: Encrypt -Comment: Set 1, vector 104 -Key: 000000000000000000000000008000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7BD6E573AE79F0FA9FE38ECF6011D756 -Test: Encrypt -Comment: Set 1, vector 105 -Key: 000000000000000000000000004000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EB58EA6B6DE1282A7BB9EA1A2254A542 -Test: Encrypt -Comment: Set 1, vector 106 -Key: 000000000000000000000000002000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 30A697E325C4D3BEC8E69A2DAD2AE5BB -Test: Encrypt -Comment: Set 1, vector 107 -Key: 000000000000000000000000001000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3205F6FEAA38500AC74BE66FEDF3231E -Test: Encrypt -Comment: Set 1, vector 108 -Key: 000000000000000000000000000800000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 83C007676041E81B836886ABED807A71 -Test: Encrypt -Comment: Set 1, vector 109 -Key: 000000000000000000000000000400000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 24B33B3138855437CC11D3792A1FD00F -Test: Encrypt -Comment: Set 1, vector 110 -Key: 000000000000000000000000000200000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 26324D7E2C055366910464699D73608A -Test: Encrypt -Comment: Set 1, vector 111 -Key: 000000000000000000000000000100000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F9A94A959AE7CD2A9D5FB7274703906B -Test: Encrypt -Comment: Set 1, vector 112 -Key: 000000000000000000000000000080000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AD13D85E47EFC76B67ED25791E119A5C -Test: Encrypt -Comment: Set 1, vector 113 -Key: 000000000000000000000000000040000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5FB689176B296F2E579FC69A18FA07EB -Test: Encrypt -Comment: Set 1, vector 114 -Key: 000000000000000000000000000020000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 936DFBA0A052A299C195F34A66C0CEDF -Test: Encrypt -Comment: Set 1, vector 115 -Key: 000000000000000000000000000010000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 486C03278BB30F26D25AE0D6348C9491 -Test: Encrypt -Comment: Set 1, vector 116 -Key: 000000000000000000000000000008000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FCE14E6CE2073B5E8D1572A1EC1BD502 -Test: Encrypt -Comment: Set 1, vector 117 -Key: 000000000000000000000000000004000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5F15B8A64EDBF0E55C3B8BB67BC9B2E1 -Test: Encrypt -Comment: Set 1, vector 118 -Key: 000000000000000000000000000002000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7BDC738A342891C7BE06E87E12F71418 -Test: Encrypt -Comment: Set 1, vector 119 -Key: 000000000000000000000000000001000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 31C6FEDABBC8C8AD64C27505F02BC7CC -Test: Encrypt -Comment: Set 1, vector 120 -Key: 000000000000000000000000000000800000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 33CCD97EB8C3C06B7BCD16659E1F9837 -Test: Encrypt -Comment: Set 1, vector 121 -Key: 000000000000000000000000000000400000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 12C3089895D4A1C1D03DB0071F88AB1B -Test: Encrypt -Comment: Set 1, vector 122 -Key: 000000000000000000000000000000200000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8EB4796C7F7C3B0858750EBE3BAA335C -Test: Encrypt -Comment: Set 1, vector 123 -Key: 000000000000000000000000000000100000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 67169AF324151E92C6B7C31687B83783 -Test: Encrypt -Comment: Set 1, vector 124 -Key: 000000000000000000000000000000080000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AB0E10564D41594B55CE3D5B088D93B4 -Test: Encrypt -Comment: Set 1, vector 125 -Key: 000000000000000000000000000000040000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 45228986B08E63728239ADC9C249E475 -Test: Encrypt -Comment: Set 1, vector 126 -Key: 000000000000000000000000000000020000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CA7E48D5A4CD15984CA9EF99EC789EFD -Test: Encrypt -Comment: Set 1, vector 127 -Key: 000000000000000000000000000000010000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B4DD56FF85F7ABBEB9E0F5AE6B0E491D -Test: Encrypt -Comment: Set 1, vector 128 -Key: 000000000000000000000000000000008000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 044BE36D2F5A3D0FEA74443538F55393 -Test: Encrypt -Comment: Set 1, vector 129 -Key: 000000000000000000000000000000004000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 531EC401FB7C3BFADF64BB08E0DD9992 -Test: Encrypt -Comment: Set 1, vector 130 -Key: 000000000000000000000000000000002000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EA8D6B6963EC2267050F8CF5D1D1D939 -Test: Encrypt -Comment: Set 1, vector 131 -Key: 000000000000000000000000000000001000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CF5D7F27462FF7415D4E5ECBAEE0797C -Test: Encrypt -Comment: Set 1, vector 132 -Key: 000000000000000000000000000000000800000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DF28B8322D4B8606FF3EFF09D39697B0 -Test: Encrypt -Comment: Set 1, vector 133 -Key: 000000000000000000000000000000000400000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 956EF889AAB218E21FAF8E9CC2AE41F9 -Test: Encrypt -Comment: Set 1, vector 134 -Key: 000000000000000000000000000000000200000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AD0CF3C46F420E96B876DD55515B4B80 -Test: Encrypt -Comment: Set 1, vector 135 -Key: 000000000000000000000000000000000100000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EC8620D3B9B456633AD174573CF82ABD -Test: Encrypt -Comment: Set 1, vector 136 -Key: 000000000000000000000000000000000080000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A7CC6C810C1433B8D130594A48A36F69 -Test: Encrypt -Comment: Set 1, vector 137 -Key: 000000000000000000000000000000000040000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B02C5AF13D523A2A62E9F3829F9E3364 -Test: Encrypt -Comment: Set 1, vector 138 -Key: 000000000000000000000000000000000020000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5AC8368EC6150F08CC2C44DBA8A9D84F -Test: Encrypt -Comment: Set 1, vector 139 -Key: 000000000000000000000000000000000010000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3BD51735D6087217EEF17B40750D701F -Test: Encrypt -Comment: Set 1, vector 140 -Key: 000000000000000000000000000000000008000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 330CC76A5529364B08F722C6206214E7 -Test: Encrypt -Comment: Set 1, vector 141 -Key: 000000000000000000000000000000000004000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 13CA2152CB81267D8429670A8D983592 -Test: Encrypt -Comment: Set 1, vector 142 -Key: 000000000000000000000000000000000002000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3943D67CE79CB8519EB9A5D1021988ED -Test: Encrypt -Comment: Set 1, vector 143 -Key: 000000000000000000000000000000000001000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 642858D825E8640718ABE6174BD04A32 -Test: Encrypt -Comment: Set 1, vector 144 -Key: 000000000000000000000000000000000000800000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F22616DE88A4CCBF97CF2DB709237EC7 -Test: Encrypt -Comment: Set 1, vector 145 -Key: 000000000000000000000000000000000000400000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B90D7F6BF0D9FC11A01F2B33194806DB -Test: Encrypt -Comment: Set 1, vector 146 -Key: 000000000000000000000000000000000000200000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C161D350DC897B210D0D0CE8CE78F4B4 -Test: Encrypt -Comment: Set 1, vector 147 -Key: 000000000000000000000000000000000000100000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 66E46482150E7CF9BCBE60AF7BCA6892 -Test: Encrypt -Comment: Set 1, vector 148 -Key: 000000000000000000000000000000000000080000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B17C912E085D8854F220555EB0FA89BD -Test: Encrypt -Comment: Set 1, vector 149 -Key: 000000000000000000000000000000000000040000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6FD6A99633FBD3A6D238CADF37824AD2 -Test: Encrypt -Comment: Set 1, vector 150 -Key: 000000000000000000000000000000000000020000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9DE6D76D9A7E4AAB7A58EECE0E153D73 -Test: Encrypt -Comment: Set 1, vector 151 -Key: 000000000000000000000000000000000000010000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B4716A7DB10E3B8D1475C7EFB929F93A -Test: Encrypt -Comment: Set 1, vector 152 -Key: 000000000000000000000000000000000000008000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3D0F65F16AD143FB2FABDF4DFE621398 -Test: Encrypt -Comment: Set 1, vector 153 -Key: 000000000000000000000000000000000000004000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 249F1415D963DE146F4141C200B81D1D -Test: Encrypt -Comment: Set 1, vector 154 -Key: 000000000000000000000000000000000000002000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 454CD7040ED3851C3894F6259CE0D3FE -Test: Encrypt -Comment: Set 1, vector 155 -Key: 000000000000000000000000000000000000001000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4D613EE6FA78A573ECBE989A64193E0C -Test: Encrypt -Comment: Set 1, vector 156 -Key: 000000000000000000000000000000000000000800000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B39384E429291B9C22005BC9B3FF2DEF -Test: Encrypt -Comment: Set 1, vector 157 -Key: 000000000000000000000000000000000000000400000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 957D0B27740C952E45DB97C8814F49C0 -Test: Encrypt -Comment: Set 1, vector 158 -Key: 000000000000000000000000000000000000000200000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2879F58F238865D877D8C276CA9E9102 -Test: Encrypt -Comment: Set 1, vector 159 -Key: 000000000000000000000000000000000000000100000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EA5B920037608FC9D51F39488D4666F7 -Test: Encrypt -Comment: Set 1, vector 160 -Key: 000000000000000000000000000000000000000080000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7659A705ABCA25205078541E713088BC -Test: Encrypt -Comment: Set 1, vector 161 -Key: 000000000000000000000000000000000000000040000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 47E340BB8BF2E8E1015BEFB68C7B1100 -Test: Encrypt -Comment: Set 1, vector 162 -Key: 000000000000000000000000000000000000000020000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 777E3E572CA33076B2CB34226CC70158 -Test: Encrypt -Comment: Set 1, vector 163 -Key: 000000000000000000000000000000000000000010000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1FEC7C6719C7CA2E9A981851C5CEE204 -Test: Encrypt -Comment: Set 1, vector 164 -Key: 000000000000000000000000000000000000000008000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9AF07DABE083EFDA75708A36AEB74CAF -Test: Encrypt -Comment: Set 1, vector 165 -Key: 000000000000000000000000000000000000000004000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5D1482F8EF9CB18911BB7F78BC3B89FC -Test: Encrypt -Comment: Set 1, vector 166 -Key: 000000000000000000000000000000000000000002000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5242753E01D470DD8C2B73A986BA009F -Test: Encrypt -Comment: Set 1, vector 167 -Key: 000000000000000000000000000000000000000001000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 83AE5BC112B73AB7978D13DD534B770B -Test: Encrypt -Comment: Set 1, vector 168 -Key: 000000000000000000000000000000000000000000800000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 848EB7330A82B91D36FBEFF6E6CE1347 -Test: Encrypt -Comment: Set 1, vector 169 -Key: 000000000000000000000000000000000000000000400000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F1B14465EFFD3E14DD1BAC6E0FA4E5BD -Test: Encrypt -Comment: Set 1, vector 170 -Key: 000000000000000000000000000000000000000000200000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5ACD25AA05AFD21F43F6A51709FD0B6A -Test: Encrypt -Comment: Set 1, vector 171 -Key: 000000000000000000000000000000000000000000100000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 12321AEFA53F1503E3A473F729388CBD -Test: Encrypt -Comment: Set 1, vector 172 -Key: 000000000000000000000000000000000000000000080000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1602DBA20E2ACFDDCC78390B473B322B -Test: Encrypt -Comment: Set 1, vector 173 -Key: 000000000000000000000000000000000000000000040000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 14C1853C3CF3CDFCE3799D5C130138EC -Test: Encrypt -Comment: Set 1, vector 174 -Key: 000000000000000000000000000000000000000000020000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DC17F9E8236350BDC285F9B2F88F670F -Test: Encrypt -Comment: Set 1, vector 175 -Key: 000000000000000000000000000000000000000000010000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: ABA03FEE8133DD4ED9B8194B643E20CE -Test: Encrypt -Comment: Set 1, vector 176 -Key: 000000000000000000000000000000000000000000008000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5822E80530C7CECCE4F56CF1691B386F -Test: Encrypt -Comment: Set 1, vector 177 -Key: 000000000000000000000000000000000000000000004000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 25CFA6F1B9BE5E14DFAF87A44B3B2E3D -Test: Encrypt -Comment: Set 1, vector 178 -Key: 000000000000000000000000000000000000000000002000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5ED866CBC298B4DEE46C1A02F958F1F5 -Test: Encrypt -Comment: Set 1, vector 179 -Key: 000000000000000000000000000000000000000000001000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BD2B63C026EB0E58D26ED16D2ED64A3E -Test: Encrypt -Comment: Set 1, vector 180 -Key: 000000000000000000000000000000000000000000000800 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9FFCFF9CF9E1483BC7971888246AF9FE -Test: Encrypt -Comment: Set 1, vector 181 -Key: 000000000000000000000000000000000000000000000400 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 367C409AEE218E02DEAC8751698BA1B8 -Test: Encrypt -Comment: Set 1, vector 182 -Key: 000000000000000000000000000000000000000000000200 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 248E3A3C0360B44C512A9AC3CAAEC21B -Test: Encrypt -Comment: Set 1, vector 183 -Key: 000000000000000000000000000000000000000000000100 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 49B47C542CA396260B53A34372985612 -Test: Encrypt -Comment: Set 1, vector 184 -Key: 000000000000000000000000000000000000000000000080 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CE35FDBDBE086EA8A501A4571925A95F -Test: Encrypt -Comment: Set 1, vector 185 -Key: 000000000000000000000000000000000000000000000040 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 873442FAE891B0767220742B84A32A4E -Test: Encrypt -Comment: Set 1, vector 186 -Key: 000000000000000000000000000000000000000000000020 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2C90E17AD13E4E84686BC5B369F0FA8F -Test: Encrypt -Comment: Set 1, vector 187 -Key: 000000000000000000000000000000000000000000000010 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0E7AAAA67D8593A9DFC55083B48B381A -Test: Encrypt -Comment: Set 1, vector 188 -Key: 000000000000000000000000000000000000000000000008 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1D8B58EE529AB17B10AC15D0E6E7ECB2 -Test: Encrypt -Comment: Set 1, vector 189 -Key: 000000000000000000000000000000000000000000000004 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1C10FAC725B905AD93B6F4B2430A8D18 -Test: Encrypt -Comment: Set 1, vector 190 -Key: 000000000000000000000000000000000000000000000002 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D36CF625EE94AB029CD23253C77C0E15 -Test: Encrypt -Comment: Set 1, vector 191 -Key: 000000000000000000000000000000000000000000000001 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E37577F71E0E643C4D3F55219ABA1394 -Test: Encrypt -Comment: Set 2, vector 0 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 80000000000000000000000000000000 -Ciphertext: 3EB6CC5618EFC98455B5992050D474E7 -Test: Encrypt -Comment: Set 2, vector 1 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 40000000000000000000000000000000 -Ciphertext: A2C645044CBC74DE5A4A161C6B2E98B9 -Test: Encrypt -Comment: Set 2, vector 2 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 20000000000000000000000000000000 -Ciphertext: 36A9A8C164BD90D4972AB1BE56C96A0B -Test: Encrypt -Comment: Set 2, vector 3 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 10000000000000000000000000000000 -Ciphertext: 38965592D728F9B765140C0A36A1BCCD -Test: Encrypt -Comment: Set 2, vector 4 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 08000000000000000000000000000000 -Ciphertext: 94CDECA78E10827914A49B5AE7F15643 -Test: Encrypt -Comment: Set 2, vector 5 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 04000000000000000000000000000000 -Ciphertext: 11C0DF672B45CDCD311EB86A7560EDA1 -Test: Encrypt -Comment: Set 2, vector 6 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 02000000000000000000000000000000 -Ciphertext: 030CAA9B8DE6F8AB88882F9596D9B1B4 -Test: Encrypt -Comment: Set 2, vector 7 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 01000000000000000000000000000000 -Ciphertext: FA02C8D1CDDD08B1FE3650DBD8E43C4F -Test: Encrypt -Comment: Set 2, vector 8 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00800000000000000000000000000000 -Ciphertext: 10ACEC25736340600D712338357C7FD4 -Test: Encrypt -Comment: Set 2, vector 9 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00400000000000000000000000000000 -Ciphertext: BBEF172E9E18679C6546EA2D9357BDD1 -Test: Encrypt -Comment: Set 2, vector 10 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00200000000000000000000000000000 -Ciphertext: 707CF6F582F5921765DBC6E1C79C45B6 -Test: Encrypt -Comment: Set 2, vector 11 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00100000000000000000000000000000 -Ciphertext: 3E9206A85F9FE99CD5538FA196E58147 -Test: Encrypt -Comment: Set 2, vector 12 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00080000000000000000000000000000 -Ciphertext: 6758B118659E9BB40BB7DC8C3D15ECEC -Test: Encrypt -Comment: Set 2, vector 13 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00040000000000000000000000000000 -Ciphertext: 9BCA6C88B928C1B0F57F99866583A9BC -Test: Encrypt -Comment: Set 2, vector 14 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00020000000000000000000000000000 -Ciphertext: 53D60CF8CA0B41B3991EF892917FA26F -Test: Encrypt -Comment: Set 2, vector 15 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00010000000000000000000000000000 -Ciphertext: 49E438685E189FB95791C655FBF40B3B -Test: Encrypt -Comment: Set 2, vector 16 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00008000000000000000000000000000 -Ciphertext: 6BFE6661C074077EF95DC499CA30A6B9 -Test: Encrypt -Comment: Set 2, vector 17 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00004000000000000000000000000000 -Ciphertext: FE82A6754DD56ACBD1895F8257597B74 -Test: Encrypt -Comment: Set 2, vector 18 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00002000000000000000000000000000 -Ciphertext: AF4551CFCEAEF2AEE1933C4AB5F036F5 -Test: Encrypt -Comment: Set 2, vector 19 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00001000000000000000000000000000 -Ciphertext: 5175E53EA4CA77E085363B2948B77B17 -Test: Encrypt -Comment: Set 2, vector 20 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000800000000000000000000000000 -Ciphertext: 19F544B2B2AAE4AF00DE2853F83349A5 -Test: Encrypt -Comment: Set 2, vector 21 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000400000000000000000000000000 -Ciphertext: 45A4379AC855738F6FEE3AFFBB2D839F -Test: Encrypt -Comment: Set 2, vector 22 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000200000000000000000000000000 -Ciphertext: 73A390407DD07D4ABEB299A5051A8DD1 -Test: Encrypt -Comment: Set 2, vector 23 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000100000000000000000000000000 -Ciphertext: 923B1E3525217E5C7A41CE3BCAE7C083 -Test: Encrypt -Comment: Set 2, vector 24 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000080000000000000000000000000 -Ciphertext: F58098D6E68E975C922B05354C0E2094 -Test: Encrypt -Comment: Set 2, vector 25 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000040000000000000000000000000 -Ciphertext: 371631601CE2BED9B7706FA4254BBAE5 -Test: Encrypt -Comment: Set 2, vector 26 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000020000000000000000000000000 -Ciphertext: 794F34CD64B44095BAB5C470B36E60BE -Test: Encrypt -Comment: Set 2, vector 27 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000010000000000000000000000000 -Ciphertext: 1A4CE8CBFEDB4F64B1A64D926B9BE3A1 -Test: Encrypt -Comment: Set 2, vector 28 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000008000000000000000000000000 -Ciphertext: 11C391C85F8FCF72EB03E1C4CC40B529 -Test: Encrypt -Comment: Set 2, vector 29 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000004000000000000000000000000 -Ciphertext: 9D8ADDC48EC36BB449234C7C06BEDC0F -Test: Encrypt -Comment: Set 2, vector 30 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000002000000000000000000000000 -Ciphertext: 952A1FAD7FAEA148FA31B50C244CF5C4 -Test: Encrypt -Comment: Set 2, vector 31 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000001000000000000000000000000 -Ciphertext: 613E5E9BBBF1B9943B3B5CBD3E69C98F -Test: Encrypt -Comment: Set 2, vector 32 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000800000000000000000000000 -Ciphertext: 5ABF9CB600BB50DB64211DE2DEAEEDBA -Test: Encrypt -Comment: Set 2, vector 33 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000400000000000000000000000 -Ciphertext: 14697658FDA5B1F14C3303F5951CAE70 -Test: Encrypt -Comment: Set 2, vector 34 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000200000000000000000000000 -Ciphertext: 2A29179C05F2F5F5909A34130B92BB25 -Test: Encrypt -Comment: Set 2, vector 35 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000100000000000000000000000 -Ciphertext: 60A9DAB8068CC085F3B9853D0C1FCF07 -Test: Encrypt -Comment: Set 2, vector 36 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000080000000000000000000000 -Ciphertext: D625356ACCE7B9F874754AE52FD1C7BF -Test: Encrypt -Comment: Set 2, vector 37 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000040000000000000000000000 -Ciphertext: 31196A29DAA0A41E982819C26AF0567A -Test: Encrypt -Comment: Set 2, vector 38 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000020000000000000000000000 -Ciphertext: D1763FC019D77CC930BFF2A56F7C9364 -Test: Encrypt -Comment: Set 2, vector 39 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000010000000000000000000000 -Ciphertext: BBC9D3C96666B01D0C33CC067ADDA228 -Test: Encrypt -Comment: Set 2, vector 40 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000008000000000000000000000 -Ciphertext: 4FC9284574F433DD6C5ADEAB6DC64A06 -Test: Encrypt -Comment: Set 2, vector 41 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000004000000000000000000000 -Ciphertext: 7176B9E3628380ADDCF02493DB254B01 -Test: Encrypt -Comment: Set 2, vector 42 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000002000000000000000000000 -Ciphertext: C6B124A17B3AB55A983DC2B6E8253FF1 -Test: Encrypt -Comment: Set 2, vector 43 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000001000000000000000000000 -Ciphertext: 5853A6B6AB0FC47DEBA33526B628DF6E -Test: Encrypt -Comment: Set 2, vector 44 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000800000000000000000000 -Ciphertext: 416945C1D1902238C42955CFF166D705 -Test: Encrypt -Comment: Set 2, vector 45 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000400000000000000000000 -Ciphertext: 2478F40DC7B7FA98E59DA21F1D2140F9 -Test: Encrypt -Comment: Set 2, vector 46 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000200000000000000000000 -Ciphertext: 6A912316499FBECA17D1683EAF79FDC9 -Test: Encrypt -Comment: Set 2, vector 47 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000100000000000000000000 -Ciphertext: 8A41DB2271FD345BC1DDE61A427E4E3E -Test: Encrypt -Comment: Set 2, vector 48 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000080000000000000000000 -Ciphertext: B6C62C6A14D2276C8FE8D1062C1E8080 -Test: Encrypt -Comment: Set 2, vector 49 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000040000000000000000000 -Ciphertext: D23F90169810210A45BD9B8681B24C34 -Test: Encrypt -Comment: Set 2, vector 50 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000020000000000000000000 -Ciphertext: EDB2A77815A074B50D88C6C2B15AF814 -Test: Encrypt -Comment: Set 2, vector 51 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000010000000000000000000 -Ciphertext: 2D6D81C8FDD2C7D5B98317488846969D -Test: Encrypt -Comment: Set 2, vector 52 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000008000000000000000000 -Ciphertext: 92F2805613A82EE25568B32ED7550DCC -Test: Encrypt -Comment: Set 2, vector 53 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000004000000000000000000 -Ciphertext: E321480A1DE5F36040F1FD170F24802B -Test: Encrypt -Comment: Set 2, vector 54 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000002000000000000000000 -Ciphertext: 3188FFADE35652067E6E2228130762D6 -Test: Encrypt -Comment: Set 2, vector 55 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000001000000000000000000 -Ciphertext: B3A3A43D68A82EC54B5D437346375584 -Test: Encrypt -Comment: Set 2, vector 56 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000800000000000000000 -Ciphertext: 023ECF3BD9FEB4891366ABE45EC1728B -Test: Encrypt -Comment: Set 2, vector 57 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000400000000000000000 -Ciphertext: 50D8160676748E1718A030F4F512C1C2 -Test: Encrypt -Comment: Set 2, vector 58 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000200000000000000000 -Ciphertext: 30DF20541978D9C96D43D609DEF39C00 -Test: Encrypt -Comment: Set 2, vector 59 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000100000000000000000 -Ciphertext: BA1AA1682750C0CEB2A87E1A46A7CE0E -Test: Encrypt -Comment: Set 2, vector 60 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000080000000000000000 -Ciphertext: 03AC8261D8F98C90B9CE9C9E47A39AA5 -Test: Encrypt -Comment: Set 2, vector 61 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000040000000000000000 -Ciphertext: 4C6C2FDC2693F2A43EAEB180AD8190F8 -Test: Encrypt -Comment: Set 2, vector 62 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000020000000000000000 -Ciphertext: B65D2C8CEE12BB4FA127356632CB0ECA -Test: Encrypt -Comment: Set 2, vector 63 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000010000000000000000 -Ciphertext: 6D785867F379BCE03580ED9DE83C0EFD -Test: Encrypt -Comment: Set 2, vector 64 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000008000000000000000 -Ciphertext: D2B25B3EECB454DCE070D11C408D73B2 -Test: Encrypt -Comment: Set 2, vector 65 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000004000000000000000 -Ciphertext: 8035FF5E625955D6328F570D53188C0C -Test: Encrypt -Comment: Set 2, vector 66 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000002000000000000000 -Ciphertext: A8BECF868B0D964E04012BE5F8121A9C -Test: Encrypt -Comment: Set 2, vector 67 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000001000000000000000 -Ciphertext: AA76DF2E83C0D31ECFE66A62E16A91D3 -Test: Encrypt -Comment: Set 2, vector 68 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000800000000000000 -Ciphertext: BAA324177EA5AF61ADBD27F594297278 -Test: Encrypt -Comment: Set 2, vector 69 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000400000000000000 -Ciphertext: 40BBEB33938AFA9BD566991B53B0FDA7 -Test: Encrypt -Comment: Set 2, vector 70 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000200000000000000 -Ciphertext: 6F58204780BEA9102506C477CBB3C8FE -Test: Encrypt -Comment: Set 2, vector 71 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000100000000000000 -Ciphertext: D296BCA9261A3410E47FA289BD70B955 -Test: Encrypt -Comment: Set 2, vector 72 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000080000000000000 -Ciphertext: 4C57FB4234A64462C6D441A782723777 -Test: Encrypt -Comment: Set 2, vector 73 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000040000000000000 -Ciphertext: 33478DE51DBDA949E17CB82373DAF866 -Test: Encrypt -Comment: Set 2, vector 74 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000020000000000000 -Ciphertext: 7CC11B9A6A9E2CE13D3596686C624AF0 -Test: Encrypt -Comment: Set 2, vector 75 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000010000000000000 -Ciphertext: 0C55ACA2BDA80E8F84A3879FF077802A -Test: Encrypt -Comment: Set 2, vector 76 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000008000000000000 -Ciphertext: 885B84843BADC6501CBDCBEA4386AB7F -Test: Encrypt -Comment: Set 2, vector 77 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000004000000000000 -Ciphertext: DCF23815FEF1697B0618E205B637648A -Test: Encrypt -Comment: Set 2, vector 78 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000002000000000000 -Ciphertext: BF5EBE09157E65743AAD033473B0DFED -Test: Encrypt -Comment: Set 2, vector 79 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000001000000000000 -Ciphertext: 1E9E5E1032307B75915E9BD48205FEB8 -Test: Encrypt -Comment: Set 2, vector 80 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000800000000000 -Ciphertext: 0EB8AC09A10303A7CE9762C1B029F0E0 -Test: Encrypt -Comment: Set 2, vector 81 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000400000000000 -Ciphertext: 2A42627713BFC603A88AD1D66292B80C -Test: Encrypt -Comment: Set 2, vector 82 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000200000000000 -Ciphertext: D7E9512485B9E5E409FB51E26D269795 -Test: Encrypt -Comment: Set 2, vector 83 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000100000000000 -Ciphertext: 57CC59F8B92D73E1B38EEE405A8EC12F -Test: Encrypt -Comment: Set 2, vector 84 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000080000000000 -Ciphertext: 161783F5FFC9A383E36B80A2032A71F1 -Test: Encrypt -Comment: Set 2, vector 85 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000040000000000 -Ciphertext: F5B24CE20FFD8702AC63F9C844BC5730 -Test: Encrypt -Comment: Set 2, vector 86 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000020000000000 -Ciphertext: 440930601D4013076587D882A1958280 -Test: Encrypt -Comment: Set 2, vector 87 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000010000000000 -Ciphertext: AEA4C3F9E520651C5FE38B915423843F -Test: Encrypt -Comment: Set 2, vector 88 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000008000000000 -Ciphertext: E300D7417C4F547DBCD5FC84E3833A7B -Test: Encrypt -Comment: Set 2, vector 89 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000004000000000 -Ciphertext: 5543860CE9247B38E8D0E7B216C0B5A5 -Test: Encrypt -Comment: Set 2, vector 90 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000002000000000 -Ciphertext: C20449053BF90C899899EE02794DB3C5 -Test: Encrypt -Comment: Set 2, vector 91 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000001000000000 -Ciphertext: AC0CB3B34AC32244CF196AE49E94D380 -Test: Encrypt -Comment: Set 2, vector 92 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000800000000 -Ciphertext: 0CDF3F25852287E3BAFAF490DE18D125 -Test: Encrypt -Comment: Set 2, vector 93 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000400000000 -Ciphertext: 583BB44512CE75268F72E6BC6682901B -Test: Encrypt -Comment: Set 2, vector 94 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000200000000 -Ciphertext: 217140522F0C505FDAC4BFDE6E9D9A81 -Test: Encrypt -Comment: Set 2, vector 95 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000100000000 -Ciphertext: CFA59EB13DDD780A2EAEF89E83737C9A -Test: Encrypt -Comment: Set 2, vector 96 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000080000000 -Ciphertext: 75E473CCD4D116426753B44900D919A6 -Test: Encrypt -Comment: Set 2, vector 97 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000040000000 -Ciphertext: E15E4627F7F8A3F09424D3D5CAC1C777 -Test: Encrypt -Comment: Set 2, vector 98 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000020000000 -Ciphertext: B83E20A23802D8755A2E850242B64EEF -Test: Encrypt -Comment: Set 2, vector 99 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000010000000 -Ciphertext: E6790AF3911360F28FD17886DD311F88 -Test: Encrypt -Comment: Set 2, vector 100 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000008000000 -Ciphertext: 0A6304DF33E409C8A21E1C19187183FF -Test: Encrypt -Comment: Set 2, vector 101 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000004000000 -Ciphertext: 51966561DA7ED5F30130B55CD108B5BE -Test: Encrypt -Comment: Set 2, vector 102 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000002000000 -Ciphertext: 0ECA40693BF4CB41FDD15BCFD8C9D9B9 -Test: Encrypt -Comment: Set 2, vector 103 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000001000000 -Ciphertext: 8731B42742ADBA2D89C9BA90EBD4E42A -Test: Encrypt -Comment: Set 2, vector 104 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000800000 -Ciphertext: BE4C6C18AA231E9BB13909242CC92EE3 -Test: Encrypt -Comment: Set 2, vector 105 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000400000 -Ciphertext: 39AC45537E9AFDC6C8BDD4204039A218 -Test: Encrypt -Comment: Set 2, vector 106 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000200000 -Ciphertext: AEA354F16E1E8EECEB5A98D88418B1A0 -Test: Encrypt -Comment: Set 2, vector 107 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000100000 -Ciphertext: 4F5D37D7D0DC7714E62BE4A0331DB07B -Test: Encrypt -Comment: Set 2, vector 108 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000080000 -Ciphertext: 9603F03C3CAA8C2F0ECFBA1374891007 -Test: Encrypt -Comment: Set 2, vector 109 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000040000 -Ciphertext: C58768944996884B46A8FFDDB9AB87EF -Test: Encrypt -Comment: Set 2, vector 110 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000020000 -Ciphertext: 3BCCF2396A97FC1C0CFFFB6ED41716DB -Test: Encrypt -Comment: Set 2, vector 111 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000010000 -Ciphertext: DC299278DCA45AC1B6B08ED4B62D9BC9 -Test: Encrypt -Comment: Set 2, vector 112 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000008000 -Ciphertext: E195AECA31E10241BD0EC4AC5418A25D -Test: Encrypt -Comment: Set 2, vector 113 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000004000 -Ciphertext: B397A4983ED647A0EB806ACDFE7BCB34 -Test: Encrypt -Comment: Set 2, vector 114 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000002000 -Ciphertext: BC8F7224B0447E8A1CF0F5506A060F3C -Test: Encrypt -Comment: Set 2, vector 115 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000001000 -Ciphertext: FFD3ED02E7F64A5D6B37A9DC5E531646 -Test: Encrypt -Comment: Set 2, vector 116 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000800 -Ciphertext: BC6019EB208B7AF8EFA6AE7B4CA0556B -Test: Encrypt -Comment: Set 2, vector 117 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000400 -Ciphertext: D2915AE2779F8F70E17CE953C6C1A380 -Test: Encrypt -Comment: Set 2, vector 118 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000200 -Ciphertext: B2AA4B1ED2285C9DA4088B6E9681C690 -Test: Encrypt -Comment: Set 2, vector 119 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000100 -Ciphertext: BE0D64EA88A3FF27C8DFCE13F13A4E1F -Test: Encrypt -Comment: Set 2, vector 120 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000080 -Ciphertext: D7629F1DD395A985AF9497F6ACB4EDA1 -Test: Encrypt -Comment: Set 2, vector 121 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000040 -Ciphertext: 33FDF72DA1D8815DE2DBE81D97DDC6F8 -Test: Encrypt -Comment: Set 2, vector 122 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000020 -Ciphertext: D35742045F3DF8D184D6CC58EB9DE323 -Test: Encrypt -Comment: Set 2, vector 123 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000010 -Ciphertext: DE6469D10C044ED53CFEB523C8DF34A2 -Test: Encrypt -Comment: Set 2, vector 124 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000008 -Ciphertext: 2FAEAC3A41CCEABA8140BDA9C7AC7740 -Test: Encrypt -Comment: Set 2, vector 125 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000004 -Ciphertext: 7BA6691787BF0C526F3697E2ED659B0D -Test: Encrypt -Comment: Set 2, vector 126 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000002 -Ciphertext: 8F9C0AA2549714C88BB2665E8AF86D41 -Test: Encrypt -Comment: Set 2, vector 127 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000001 -Ciphertext: BA9AE89FDDCE4B51131E17C4D65CE587 -Test: Encrypt -Comment: Set 3, vector 0 -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 56E1E129CA5C02C7F9AC6AFDEF86ADC3 -Test: Encrypt -Comment: Set 3, vector 1 -Key: 010101010101010101010101010101010101010101010101 -Plaintext: 01010101010101010101010101010101 -Ciphertext: 8F764397C10BE84BA876CEEFA4225BFF -Test: Encrypt -Comment: Set 3, vector 2 -Key: 020202020202020202020202020202020202020202020202 -Plaintext: 02020202020202020202020202020202 -Ciphertext: 60B00674BFD444D07B5A19851E6151CD -Test: Encrypt -Comment: Set 3, vector 3 -Key: 030303030303030303030303030303030303030303030303 -Plaintext: 03030303030303030303030303030303 -Ciphertext: CF431D70E25D5450B9979C52E4ECF590 -Test: Encrypt -Comment: Set 3, vector 4 -Key: 040404040404040404040404040404040404040404040404 -Plaintext: 04040404040404040404040404040404 -Ciphertext: 81B26FF4F6B4377CC555873504B3A38B -Test: Encrypt -Comment: Set 3, vector 5 -Key: 050505050505050505050505050505050505050505050505 -Plaintext: 05050505050505050505050505050505 -Ciphertext: 8C864C445E6B9312E6F3843C53BF7870 -Test: Encrypt -Comment: Set 3, vector 6 -Key: 060606060606060606060606060606060606060606060606 -Plaintext: 06060606060606060606060606060606 -Ciphertext: 28C1EABB23C2A04E7A37BB0EF42D45A2 -Test: Encrypt -Comment: Set 3, vector 7 -Key: 070707070707070707070707070707070707070707070707 -Plaintext: 07070707070707070707070707070707 -Ciphertext: 0068C08827CBD904A3C0AF89A35CD8E6 -Test: Encrypt -Comment: Set 3, vector 8 -Key: 080808080808080808080808080808080808080808080808 -Plaintext: 08080808080808080808080808080808 -Ciphertext: A2AA1C6693DC2B70D75C9B39B9B214D0 -Test: Encrypt -Comment: Set 3, vector 9 -Key: 090909090909090909090909090909090909090909090909 -Plaintext: 09090909090909090909090909090909 -Ciphertext: 0423A756A133734C66944536033B978C -Test: Encrypt -Comment: Set 3, vector 10 -Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Ciphertext: 279B7FA09352F4194B2C33089267BD2E -Test: Encrypt -Comment: Set 3, vector 11 -Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Ciphertext: 7788EEE46AC2927434A93D3B5D295DF3 -Test: Encrypt -Comment: Set 3, vector 12 -Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Ciphertext: 3A2D0C1F30AE1E50A61102D2DF5BEAE5 -Test: Encrypt -Comment: Set 3, vector 13 -Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Ciphertext: 320FB708B47319484538CD73F8773526 -Test: Encrypt -Comment: Set 3, vector 14 -Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Ciphertext: 6213EB688C8CDA5152A65BFC007BCAEA -Test: Encrypt -Comment: Set 3, vector 15 -Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Ciphertext: D1904ACDB021DDCCCBE436CA7B5A4264 -Test: Encrypt -Comment: Set 3, vector 16 -Key: 101010101010101010101010101010101010101010101010 -Plaintext: 10101010101010101010101010101010 -Ciphertext: A907BFDAEEF8C81D05855235E8D3BE08 -Test: Encrypt -Comment: Set 3, vector 17 -Key: 111111111111111111111111111111111111111111111111 -Plaintext: 11111111111111111111111111111111 -Ciphertext: DB23D9326A998A4CB06AE04A8C592217 -Test: Encrypt -Comment: Set 3, vector 18 -Key: 121212121212121212121212121212121212121212121212 -Plaintext: 12121212121212121212121212121212 -Ciphertext: 472427C234EAE3082E84F493C9559792 -Test: Encrypt -Comment: Set 3, vector 19 -Key: 131313131313131313131313131313131313131313131313 -Plaintext: 13131313131313131313131313131313 -Ciphertext: EE4E318D27820F691BD3BDA9617561A0 -Test: Encrypt -Comment: Set 3, vector 20 -Key: 141414141414141414141414141414141414141414141414 -Plaintext: 14141414141414141414141414141414 -Ciphertext: 221E909D7B259C098480DBDE71BCF9BF -Test: Encrypt -Comment: Set 3, vector 21 -Key: 151515151515151515151515151515151515151515151515 -Plaintext: 15151515151515151515151515151515 -Ciphertext: 8702C6A150F2DD2E1736F09518C1A267 -Test: Encrypt -Comment: Set 3, vector 22 -Key: 161616161616161616161616161616161616161616161616 -Plaintext: 16161616161616161616161616161616 -Ciphertext: 7E8DAEBBA15C7B9705B501998F61CC6E -Test: Encrypt -Comment: Set 3, vector 23 -Key: 171717171717171717171717171717171717171717171717 -Plaintext: 17171717171717171717171717171717 -Ciphertext: 3DD555C7277FA156330D05CD621394D5 -Test: Encrypt -Comment: Set 3, vector 24 -Key: 181818181818181818181818181818181818181818181818 -Plaintext: 18181818181818181818181818181818 -Ciphertext: E5575CDC315F1C244441E6D1DE25ED20 -Test: Encrypt -Comment: Set 3, vector 25 -Key: 191919191919191919191919191919191919191919191919 -Plaintext: 19191919191919191919191919191919 -Ciphertext: 434859EB42087F83B9849DC23ABB7C1D -Test: Encrypt -Comment: Set 3, vector 26 -Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Ciphertext: 1EA1A5CC662DCA0B56B2BBF560A1B032 -Test: Encrypt -Comment: Set 3, vector 27 -Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Ciphertext: A3AC0CD9342242A72005F8E6DBF50DE8 -Test: Encrypt -Comment: Set 3, vector 28 -Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Ciphertext: AF6251A285EBEA9408315822F2072D86 -Test: Encrypt -Comment: Set 3, vector 29 -Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Ciphertext: FA084220DB82A88E6D7B6E7849550183 -Test: Encrypt -Comment: Set 3, vector 30 -Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Ciphertext: E7AABEAA3F669E0D963A19C3BDE43676 -Test: Encrypt -Comment: Set 3, vector 31 -Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Ciphertext: ED7C11A689A72FF834A777013DBEC50A -Test: Encrypt -Comment: Set 3, vector 32 -Key: 202020202020202020202020202020202020202020202020 -Plaintext: 20202020202020202020202020202020 -Ciphertext: 87F8EA30332036F17CEAC0097CE33BC1 -Test: Encrypt -Comment: Set 3, vector 33 -Key: 212121212121212121212121212121212121212121212121 -Plaintext: 21212121212121212121212121212121 -Ciphertext: E83CC178B21703D1BDFA0A1350A587F3 -Test: Encrypt -Comment: Set 3, vector 34 -Key: 222222222222222222222222222222222222222222222222 -Plaintext: 22222222222222222222222222222222 -Ciphertext: 581CF260A93B67E27BBA6D6D68C645B6 -Test: Encrypt -Comment: Set 3, vector 35 -Key: 232323232323232323232323232323232323232323232323 -Plaintext: 23232323232323232323232323232323 -Ciphertext: D7155FD4BABA5DAA1E0576BAF4BB3BDE -Test: Encrypt -Comment: Set 3, vector 36 -Key: 242424242424242424242424242424242424242424242424 -Plaintext: 24242424242424242424242424242424 -Ciphertext: 0C2382377892DC0CA4B1C7753CDB2753 -Test: Encrypt -Comment: Set 3, vector 37 -Key: 252525252525252525252525252525252525252525252525 -Plaintext: 25252525252525252525252525252525 -Ciphertext: 9E568ACFE44E1926BE207D25107EBD90 -Test: Encrypt -Comment: Set 3, vector 38 -Key: 262626262626262626262626262626262626262626262626 -Plaintext: 26262626262626262626262626262626 -Ciphertext: 1F9C7FEF0BA7D4C38555B957FA9FDAC8 -Test: Encrypt -Comment: Set 3, vector 39 -Key: 272727272727272727272727272727272727272727272727 -Plaintext: 27272727272727272727272727272727 -Ciphertext: 2C00730AAB18247D4F79C8BA0107E759 -Test: Encrypt -Comment: Set 3, vector 40 -Key: 282828282828282828282828282828282828282828282828 -Plaintext: 28282828282828282828282828282828 -Ciphertext: 26150BB68C5529903D3624CB8F36D717 -Test: Encrypt -Comment: Set 3, vector 41 -Key: 292929292929292929292929292929292929292929292929 -Plaintext: 29292929292929292929292929292929 -Ciphertext: C6F9CD75F9DC3DF5C945E028038660AB -Test: Encrypt -Comment: Set 3, vector 42 -Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Ciphertext: 9D90F692A1149E3E7F19BE419038F42F -Test: Encrypt -Comment: Set 3, vector 43 -Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Ciphertext: 9981F6F8C071F4CAF3E25884B8749FD3 -Test: Encrypt -Comment: Set 3, vector 44 -Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Ciphertext: 62957FC449C78B7EABA9C41B335F731E -Test: Encrypt -Comment: Set 3, vector 45 -Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Ciphertext: 265E17BD08B2E34BC879D5BC801D1217 -Test: Encrypt -Comment: Set 3, vector 46 -Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Ciphertext: 55BBE8CE99907AC77D4F009EABA6B8D9 -Test: Encrypt -Comment: Set 3, vector 47 -Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Ciphertext: EECB495C2F81243857D0A1A8919F9C7E -Test: Encrypt -Comment: Set 3, vector 48 -Key: 303030303030303030303030303030303030303030303030 -Plaintext: 30303030303030303030303030303030 -Ciphertext: E3BA996DF81895C86E30500CE9F7ED01 -Test: Encrypt -Comment: Set 3, vector 49 -Key: 313131313131313131313131313131313131313131313131 -Plaintext: 31313131313131313131313131313131 -Ciphertext: E507914B7CDDB2A3A915EB5663CE43CE -Test: Encrypt -Comment: Set 3, vector 50 -Key: 323232323232323232323232323232323232323232323232 -Plaintext: 32323232323232323232323232323232 -Ciphertext: AA2E53FC2D073DE62554691F507B23FF -Test: Encrypt -Comment: Set 3, vector 51 -Key: 333333333333333333333333333333333333333333333333 -Plaintext: 33333333333333333333333333333333 -Ciphertext: 875707D7E4FA8028D878DFB8338160FF -Test: Encrypt -Comment: Set 3, vector 52 -Key: 343434343434343434343434343434343434343434343434 -Plaintext: 34343434343434343434343434343434 -Ciphertext: 1158285A6787F8B6500E9FB046D88FB7 -Test: Encrypt -Comment: Set 3, vector 53 -Key: 353535353535353535353535353535353535353535353535 -Plaintext: 35353535353535353535353535353535 -Ciphertext: 6BFF4FB554ADD3F4321E6BA6029CD48A -Test: Encrypt -Comment: Set 3, vector 54 -Key: 363636363636363636363636363636363636363636363636 -Plaintext: 36363636363636363636363636363636 -Ciphertext: 8F2077CE672419A3AE15CA8800D5ACF8 -Test: Encrypt -Comment: Set 3, vector 55 -Key: 373737373737373737373737373737373737373737373737 -Plaintext: 37373737373737373737373737373737 -Ciphertext: 80ECE69E3EEBD391FCAEA8B3B38578D9 -Test: Encrypt -Comment: Set 3, vector 56 -Key: 383838383838383838383838383838383838383838383838 -Plaintext: 38383838383838383838383838383838 -Ciphertext: A23A2ADDE21BDB44EF99072331FA8EAB -Test: Encrypt -Comment: Set 3, vector 57 -Key: 393939393939393939393939393939393939393939393939 -Plaintext: 39393939393939393939393939393939 -Ciphertext: 8E41065415264354D4DC276F6ED582B9 -Test: Encrypt -Comment: Set 3, vector 58 -Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Ciphertext: D591D51BA578836C7D3945991FD0184A -Test: Encrypt -Comment: Set 3, vector 59 -Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Ciphertext: B88105C11F9FFCA9037E1F90FAE1C61E -Test: Encrypt -Comment: Set 3, vector 60 -Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Ciphertext: F8A1A047994B4363028BC1B3B6339954 -Test: Encrypt -Comment: Set 3, vector 61 -Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Ciphertext: EFB57CEA359E1F9F68729B156BEBDCB8 -Test: Encrypt -Comment: Set 3, vector 62 -Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Ciphertext: 2323D15570873D4E5616CDDC466B1D34 -Test: Encrypt -Comment: Set 3, vector 63 -Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Ciphertext: 842C7B6C67BB38B508558058531B37FE -Test: Encrypt -Comment: Set 3, vector 64 -Key: 404040404040404040404040404040404040404040404040 -Plaintext: 40404040404040404040404040404040 -Ciphertext: A2C32EA499E41A248565253BACC11E3B -Test: Encrypt -Comment: Set 3, vector 65 -Key: 414141414141414141414141414141414141414141414141 -Plaintext: 41414141414141414141414141414141 -Ciphertext: CF72033A0BA3E03A8B1E336F85100489 -Test: Encrypt -Comment: Set 3, vector 66 -Key: 424242424242424242424242424242424242424242424242 -Plaintext: 42424242424242424242424242424242 -Ciphertext: 0A194208C1B722A5719C14231EE4C532 -Test: Encrypt -Comment: Set 3, vector 67 -Key: 434343434343434343434343434343434343434343434343 -Plaintext: 43434343434343434343434343434343 -Ciphertext: 7365018F7A2564165EC162F948C4824A -Test: Encrypt -Comment: Set 3, vector 68 -Key: 444444444444444444444444444444444444444444444444 -Plaintext: 44444444444444444444444444444444 -Ciphertext: 20AC87CE21C47D99D6D2202B0C62E52D -Test: Encrypt -Comment: Set 3, vector 69 -Key: 454545454545454545454545454545454545454545454545 -Plaintext: 45454545454545454545454545454545 -Ciphertext: 72D32F7C4D03529C7DBF6865E36E7C84 -Test: Encrypt -Comment: Set 3, vector 70 -Key: 464646464646464646464646464646464646464646464646 -Plaintext: 46464646464646464646464646464646 -Ciphertext: 18E88EF941A7D1793B8D545323CCBD7E -Test: Encrypt -Comment: Set 3, vector 71 -Key: 474747474747474747474747474747474747474747474747 -Plaintext: 47474747474747474747474747474747 -Ciphertext: C87B12CD28646842FCE0C8658EA8A6C9 -Test: Encrypt -Comment: Set 3, vector 72 -Key: 484848484848484848484848484848484848484848484848 -Plaintext: 48484848484848484848484848484848 -Ciphertext: 03347AC4B4D0AE9C208B1B12802E6562 -Test: Encrypt -Comment: Set 3, vector 73 -Key: 494949494949494949494949494949494949494949494949 -Plaintext: 49494949494949494949494949494949 -Ciphertext: A5F9E726E53A74C9CF59E7CBBCE507D1 -Test: Encrypt -Comment: Set 3, vector 74 -Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Ciphertext: 228C852461BBB0BB12B3F9192311DFDD -Test: Encrypt -Comment: Set 3, vector 75 -Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Ciphertext: DFD5B30B1401FBE49EA0C725E64B91A3 -Test: Encrypt -Comment: Set 3, vector 76 -Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Ciphertext: 38D59DD18C98488451070B28F91A15C0 -Test: Encrypt -Comment: Set 3, vector 77 -Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Ciphertext: E6A73709A37C7B00484BD54EED3A6128 -Test: Encrypt -Comment: Set 3, vector 78 -Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Ciphertext: 12A6AD3ED9A3BA4FBA285B64D4823706 -Test: Encrypt -Comment: Set 3, vector 79 -Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Ciphertext: CCB3FFAD253207DFB312A8B4FE0F390D -Test: Encrypt -Comment: Set 3, vector 80 -Key: 505050505050505050505050505050505050505050505050 -Plaintext: 50505050505050505050505050505050 -Ciphertext: A1C7DFA83502CE5558242F83CC12BF82 -Test: Encrypt -Comment: Set 3, vector 81 -Key: 515151515151515151515151515151515151515151515151 -Plaintext: 51515151515151515151515151515151 -Ciphertext: C9C8FCD1E4E482AF47555FEA823DE62A -Test: Encrypt -Comment: Set 3, vector 82 -Key: 525252525252525252525252525252525252525252525252 -Plaintext: 52525252525252525252525252525252 -Ciphertext: 5F9DD3265B6B043BF4CE8E11A3DAE4E1 -Test: Encrypt -Comment: Set 3, vector 83 -Key: 535353535353535353535353535353535353535353535353 -Plaintext: 53535353535353535353535353535353 -Ciphertext: 79D02BFAD35C67C8586694A068662F1D -Test: Encrypt -Comment: Set 3, vector 84 -Key: 545454545454545454545454545454545454545454545454 -Plaintext: 54545454545454545454545454545454 -Ciphertext: 361AC03A4827F590A5DDE28A5FFF723A -Test: Encrypt -Comment: Set 3, vector 85 -Key: 555555555555555555555555555555555555555555555555 -Plaintext: 55555555555555555555555555555555 -Ciphertext: 1758AC2E8DDE2126621AEB5759FC93D0 -Test: Encrypt -Comment: Set 3, vector 86 -Key: 565656565656565656565656565656565656565656565656 -Plaintext: 56565656565656565656565656565656 -Ciphertext: 14422A052A86DC0033B70F77D46A7E3C -Test: Encrypt -Comment: Set 3, vector 87 -Key: 575757575757575757575757575757575757575757575757 -Plaintext: 57575757575757575757575757575757 -Ciphertext: 154457A732BC11F0A4C43BEC607B9B91 -Test: Encrypt -Comment: Set 3, vector 88 -Key: 585858585858585858585858585858585858585858585858 -Plaintext: 58585858585858585858585858585858 -Ciphertext: 789BBC53CBE8A7D6119F61C8DC5DAEAB -Test: Encrypt -Comment: Set 3, vector 89 -Key: 595959595959595959595959595959595959595959595959 -Plaintext: 59595959595959595959595959595959 -Ciphertext: 6F8CDA92BF849BE59858544689DA2ACE -Test: Encrypt -Comment: Set 3, vector 90 -Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Ciphertext: CCA696D494AF8877C0753106D5AD07A6 -Test: Encrypt -Comment: Set 3, vector 91 -Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Ciphertext: E76884CA9F00DCF95BBB15C5FBB26D1C -Test: Encrypt -Comment: Set 3, vector 92 -Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Ciphertext: CD3FA7BC9EC9EC0B0CF4F5A82A98550E -Test: Encrypt -Comment: Set 3, vector 93 -Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Ciphertext: BC2FB535DC0D8C86682E32AC3761F299 -Test: Encrypt -Comment: Set 3, vector 94 -Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Ciphertext: AB19152E1788D8B2878357484832BB27 -Test: Encrypt -Comment: Set 3, vector 95 -Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Ciphertext: 87D1D7E297CED2C6606A171794FE1BB2 -Test: Encrypt -Comment: Set 3, vector 96 -Key: 606060606060606060606060606060606060606060606060 -Plaintext: 60606060606060606060606060606060 -Ciphertext: 6BF6F1728474F1050F712A0FF3F59319 -Test: Encrypt -Comment: Set 3, vector 97 -Key: 616161616161616161616161616161616161616161616161 -Plaintext: 61616161616161616161616161616161 -Ciphertext: 46646FF0ED8A8EDB395BA4B3DC97A35F -Test: Encrypt -Comment: Set 3, vector 98 -Key: 626262626262626262626262626262626262626262626262 -Plaintext: 62626262626262626262626262626262 -Ciphertext: F558C5F67CDF59374F5426D5846A622E -Test: Encrypt -Comment: Set 3, vector 99 -Key: 636363636363636363636363636363636363636363636363 -Plaintext: 63636363636363636363636363636363 -Ciphertext: E06CC0A3436C80F5F0271ACFC8F535D3 -Test: Encrypt -Comment: Set 3, vector 100 -Key: 646464646464646464646464646464646464646464646464 -Plaintext: 64646464646464646464646464646464 -Ciphertext: 903AA2EA9F99C3CCDD1EF1CD906FC800 -Test: Encrypt -Comment: Set 3, vector 101 -Key: 656565656565656565656565656565656565656565656565 -Plaintext: 65656565656565656565656565656565 -Ciphertext: EAE1010E86CF45476CEB180E78608841 -Test: Encrypt -Comment: Set 3, vector 102 -Key: 666666666666666666666666666666666666666666666666 -Plaintext: 66666666666666666666666666666666 -Ciphertext: 341F33B7FB7C5807BFB4C2C497565817 -Test: Encrypt -Comment: Set 3, vector 103 -Key: 676767676767676767676767676767676767676767676767 -Plaintext: 67676767676767676767676767676767 -Ciphertext: 4DA345AB1B3F7575F8D01BED5C17AF26 -Test: Encrypt -Comment: Set 3, vector 104 -Key: 686868686868686868686868686868686868686868686868 -Plaintext: 68686868686868686868686868686868 -Ciphertext: 1613C2DE21E7082312BF414C88310FAB -Test: Encrypt -Comment: Set 3, vector 105 -Key: 696969696969696969696969696969696969696969696969 -Plaintext: 69696969696969696969696969696969 -Ciphertext: 474D73001BD4BF9A9B79CFF79198E2F3 -Test: Encrypt -Comment: Set 3, vector 106 -Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Ciphertext: 9C487E0BFB6FE07C521C663D03F175CF -Test: Encrypt -Comment: Set 3, vector 107 -Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Ciphertext: 39F5672BEFCFCC072F292D47AD481DC7 -Test: Encrypt -Comment: Set 3, vector 108 -Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Ciphertext: D9B86F02C3CB07CEF53834924A01DF14 -Test: Encrypt -Comment: Set 3, vector 109 -Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Ciphertext: B42C9F4A33C5425FB20425889ECFFB9D -Test: Encrypt -Comment: Set 3, vector 110 -Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Ciphertext: 832D535E3B4C40113C82AE10A7E1B78A -Test: Encrypt -Comment: Set 3, vector 111 -Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Ciphertext: E9A8F63AAF1B1FFF05CFEB7E22E519DF -Test: Encrypt -Comment: Set 3, vector 112 -Key: 707070707070707070707070707070707070707070707070 -Plaintext: 70707070707070707070707070707070 -Ciphertext: C61B4EF13F07576701B1018AC9F01863 -Test: Encrypt -Comment: Set 3, vector 113 -Key: 717171717171717171717171717171717171717171717171 -Plaintext: 71717171717171717171717171717171 -Ciphertext: B098DBE07C3528931F14D40AC9F99ACC -Test: Encrypt -Comment: Set 3, vector 114 -Key: 727272727272727272727272727272727272727272727272 -Plaintext: 72727272727272727272727272727272 -Ciphertext: 3FCC0182E96BC01863EB161967D6482A -Test: Encrypt -Comment: Set 3, vector 115 -Key: 737373737373737373737373737373737373737373737373 -Plaintext: 73737373737373737373737373737373 -Ciphertext: D8F20E80F4AC4666066B0E3F1966C8DA -Test: Encrypt -Comment: Set 3, vector 116 -Key: 747474747474747474747474747474747474747474747474 -Plaintext: 74747474747474747474747474747474 -Ciphertext: 4E96D8CC1A34E3C38C37B5339CF26A5D -Test: Encrypt -Comment: Set 3, vector 117 -Key: 757575757575757575757575757575757575757575757575 -Plaintext: 75757575757575757575757575757575 -Ciphertext: 266EDB14B89857636C0F8E8C7D2FACD8 -Test: Encrypt -Comment: Set 3, vector 118 -Key: 767676767676767676767676767676767676767676767676 -Plaintext: 76767676767676767676767676767676 -Ciphertext: 1D060BD61CFA82764CE4DF283FCB2278 -Test: Encrypt -Comment: Set 3, vector 119 -Key: 777777777777777777777777777777777777777777777777 -Plaintext: 77777777777777777777777777777777 -Ciphertext: 4734355A933BFC1F2918CDF1A4E2BAAE -Test: Encrypt -Comment: Set 3, vector 120 -Key: 787878787878787878787878787878787878787878787878 -Plaintext: 78787878787878787878787878787878 -Ciphertext: DADBACBB42FEB35635A8DEBBFA93F5BA -Test: Encrypt -Comment: Set 3, vector 121 -Key: 797979797979797979797979797979797979797979797979 -Plaintext: 79797979797979797979797979797979 -Ciphertext: 8BB5C2E0B44B986EF523870C41721B7D -Test: Encrypt -Comment: Set 3, vector 122 -Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Ciphertext: F66844E5DC500F43FF95E05965BAFD63 -Test: Encrypt -Comment: Set 3, vector 123 -Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Ciphertext: ECC75A2BE7E27481907621A1796DC821 -Test: Encrypt -Comment: Set 3, vector 124 -Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Ciphertext: D195666137F49B67F80EBC8C3ED824BF -Test: Encrypt -Comment: Set 3, vector 125 -Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Ciphertext: 2F1ACC482BE5DEFD3EC1AD1F3A064A60 -Test: Encrypt -Comment: Set 3, vector 126 -Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Ciphertext: 5FDDFA05A7F72D294DC386260DC59009 -Test: Encrypt -Comment: Set 3, vector 127 -Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Ciphertext: FE94D733BABEB5A5382C2816311E515E -Test: Encrypt -Comment: Set 3, vector 128 -Key: 808080808080808080808080808080808080808080808080 -Plaintext: 80808080808080808080808080808080 -Ciphertext: F602BA7F515B082983B8F7A27F92408F -Test: Encrypt -Comment: Set 3, vector 129 -Key: 818181818181818181818181818181818181818181818181 -Plaintext: 81818181818181818181818181818181 -Ciphertext: 48E95062B889D83CC72767E303329710 -Test: Encrypt -Comment: Set 3, vector 130 -Key: 828282828282828282828282828282828282828282828282 -Plaintext: 82828282828282828282828282828282 -Ciphertext: 0D98319B8ED1E612F063591AAFA95962 -Test: Encrypt -Comment: Set 3, vector 131 -Key: 838383838383838383838383838383838383838383838383 -Plaintext: 83838383838383838383838383838383 -Ciphertext: 6D987B21F8072C09514C711819BDF42D -Test: Encrypt -Comment: Set 3, vector 132 -Key: 848484848484848484848484848484848484848484848484 -Plaintext: 84848484848484848484848484848484 -Ciphertext: 56C6CA23BC6A52C9967D70C6471A0788 -Test: Encrypt -Comment: Set 3, vector 133 -Key: 858585858585858585858585858585858585858585858585 -Plaintext: 85858585858585858585858585858585 -Ciphertext: 03C1004551B9B74D96CC3F9F7D11B04A -Test: Encrypt -Comment: Set 3, vector 134 -Key: 868686868686868686868686868686868686868686868686 -Plaintext: 86868686868686868686868686868686 -Ciphertext: 6356481250E8D52A0D922985BB2BED27 -Test: Encrypt -Comment: Set 3, vector 135 -Key: 878787878787878787878787878787878787878787878787 -Plaintext: 87878787878787878787878787878787 -Ciphertext: BC51A66892A956F44BF75168E935720E -Test: Encrypt -Comment: Set 3, vector 136 -Key: 888888888888888888888888888888888888888888888888 -Plaintext: 88888888888888888888888888888888 -Ciphertext: 73FAAAFB0517BD4D459A250E2CA4F017 -Test: Encrypt -Comment: Set 3, vector 137 -Key: 898989898989898989898989898989898989898989898989 -Plaintext: 89898989898989898989898989898989 -Ciphertext: 160C7D6510CCEB35318629FFFE1E8BA7 -Test: Encrypt -Comment: Set 3, vector 138 -Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Ciphertext: 785ECC6F1A9415EBB05A4990786865A5 -Test: Encrypt -Comment: Set 3, vector 139 -Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Ciphertext: 210498B4AC4D909CC7D6DAD6B8851C1A -Test: Encrypt -Comment: Set 3, vector 140 -Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Ciphertext: 7094C31A06ED2AA0B3B63C210DEB96E2 -Test: Encrypt -Comment: Set 3, vector 141 -Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Ciphertext: F8426DAE3B7C3FF568456EB4D4EB623B -Test: Encrypt -Comment: Set 3, vector 142 -Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Ciphertext: 090487421369DED8EAC9812B544A29BE -Test: Encrypt -Comment: Set 3, vector 143 -Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Ciphertext: 1AFA1FC5ECA8EAD74F9FE9B67993CB6F -Test: Encrypt -Comment: Set 3, vector 144 -Key: 909090909090909090909090909090909090909090909090 -Plaintext: 90909090909090909090909090909090 -Ciphertext: 38124FCE77189341DE7B225951CDE6E9 -Test: Encrypt -Comment: Set 3, vector 145 -Key: 919191919191919191919191919191919191919191919191 -Plaintext: 91919191919191919191919191919191 -Ciphertext: 059A775350A44BB880A750B32B19E179 -Test: Encrypt -Comment: Set 3, vector 146 -Key: 929292929292929292929292929292929292929292929292 -Plaintext: 92929292929292929292929292929292 -Ciphertext: 7CFA631E8BABF7DEE00DAB0754C385DD -Test: Encrypt -Comment: Set 3, vector 147 -Key: 939393939393939393939393939393939393939393939393 -Plaintext: 93939393939393939393939393939393 -Ciphertext: 0632ED71BA440232DECE4F1B38F94323 -Test: Encrypt -Comment: Set 3, vector 148 -Key: 949494949494949494949494949494949494949494949494 -Plaintext: 94949494949494949494949494949494 -Ciphertext: D049FF03ACF47C866A4209E7588E0CFA -Test: Encrypt -Comment: Set 3, vector 149 -Key: 959595959595959595959595959595959595959595959595 -Plaintext: 95959595959595959595959595959595 -Ciphertext: 910408E331C64A71D50A149DFD50C242 -Test: Encrypt -Comment: Set 3, vector 150 -Key: 969696969696969696969696969696969696969696969696 -Plaintext: 96969696969696969696969696969696 -Ciphertext: 0829C2DD4AF8F06C30978A0199A43C3C -Test: Encrypt -Comment: Set 3, vector 151 -Key: 979797979797979797979797979797979797979797979797 -Plaintext: 97979797979797979797979797979797 -Ciphertext: C70D286C18D2A0EA5D16FEB97F35DE6F -Test: Encrypt -Comment: Set 3, vector 152 -Key: 989898989898989898989898989898989898989898989898 -Plaintext: 98989898989898989898989898989898 -Ciphertext: A220CD3CD177BDD73D44B6D4A7A9ED0E -Test: Encrypt -Comment: Set 3, vector 153 -Key: 999999999999999999999999999999999999999999999999 -Plaintext: 99999999999999999999999999999999 -Ciphertext: 74EC1A68010A0D5FA9688F1552E70EF5 -Test: Encrypt -Comment: Set 3, vector 154 -Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Ciphertext: C1C0EE9EEA079CCE8544BA9940963720 -Test: Encrypt -Comment: Set 3, vector 155 -Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Ciphertext: 500418F7142C273CCADBDAD8831619D2 -Test: Encrypt -Comment: Set 3, vector 156 -Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Ciphertext: 703A0223D3ABA658C531F9BE03F6E842 -Test: Encrypt -Comment: Set 3, vector 157 -Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Ciphertext: EBC65558CD43197D87CFF645FDBA1661 -Test: Encrypt -Comment: Set 3, vector 158 -Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Ciphertext: 6F6E140E44934DA754F008EB5597BDA3 -Test: Encrypt -Comment: Set 3, vector 159 -Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Ciphertext: 3D533A98B85CDD624541956E348ACBD3 -Test: Encrypt -Comment: Set 3, vector 160 -Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Ciphertext: 13833D60F1D247019258C457E9F2292A -Test: Encrypt -Comment: Set 3, vector 161 -Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Ciphertext: FC13CECE4F5E2467427582595EDB6B87 -Test: Encrypt -Comment: Set 3, vector 162 -Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Ciphertext: 2772A4E636F01514949D47B037825AF9 -Test: Encrypt -Comment: Set 3, vector 163 -Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Ciphertext: F13DC1CCF105212AF8BC4F73F0AEF272 -Test: Encrypt -Comment: Set 3, vector 164 -Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Ciphertext: A6EB0CABBBA03DB1B2425E6FC559B06A -Test: Encrypt -Comment: Set 3, vector 165 -Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Ciphertext: 32222D875D9E73DE72848EA88AC9B259 -Test: Encrypt -Comment: Set 3, vector 166 -Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Ciphertext: 7DA6BC64D1E71FFE2D24C1A2FF7405BF -Test: Encrypt -Comment: Set 3, vector 167 -Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Ciphertext: AD5129092054880300AFCF09A2921DAF -Test: Encrypt -Comment: Set 3, vector 168 -Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Ciphertext: FCF2E0AA207754597C8C00A4615B5B5B -Test: Encrypt -Comment: Set 3, vector 169 -Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Ciphertext: 83D1475128C93C79BFE2AC9DA7E5D7BC -Test: Encrypt -Comment: Set 3, vector 170 -Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Ciphertext: 9BA09846E13568B746B7D6A43364915F -Test: Encrypt -Comment: Set 3, vector 171 -Key: ABABABABABABABABABABABABABABABABABABABABABABABAB -Plaintext: ABABABABABABABABABABABABABABABAB -Ciphertext: 387BDB77D285F9E59CB88CD830CB31E2 -Test: Encrypt -Comment: Set 3, vector 172 -Key: ACACACACACACACACACACACACACACACACACACACACACACACAC -Plaintext: ACACACACACACACACACACACACACACACAC -Ciphertext: 82BFCC439310DD5DC411CCD4451E789B -Test: Encrypt -Comment: Set 3, vector 173 -Key: ADADADADADADADADADADADADADADADADADADADADADADADAD -Plaintext: ADADADADADADADADADADADADADADADAD -Ciphertext: 34C4240853DA191DF1D63E83401CE0E2 -Test: Encrypt -Comment: Set 3, vector 174 -Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Ciphertext: B3CE3C38C10A667F5FD67BC8B7037283 -Test: Encrypt -Comment: Set 3, vector 175 -Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Ciphertext: BEF04E726DC1D5D1D4AB0A025CFDFD7D -Test: Encrypt -Comment: Set 3, vector 176 -Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Ciphertext: 725D70D564E78095739EA7980B481056 -Test: Encrypt -Comment: Set 3, vector 177 -Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Ciphertext: CAB9293C9E3A82D40E85558F9DA488C1 -Test: Encrypt -Comment: Set 3, vector 178 -Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Ciphertext: B433CACA5FF9F5AADB6BAFB7D4BE81FC -Test: Encrypt -Comment: Set 3, vector 179 -Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Ciphertext: 3910F153098B638696101E04022A7849 -Test: Encrypt -Comment: Set 3, vector 180 -Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Ciphertext: 1D7FF785CFC6AF98C5C81CDA2ABC9816 -Test: Encrypt -Comment: Set 3, vector 181 -Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Ciphertext: 4A30C5521BAC28E5942808CB536376C7 -Test: Encrypt -Comment: Set 3, vector 182 -Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Ciphertext: 17B908EF18EB7703DDB667C7A8DBA777 -Test: Encrypt -Comment: Set 3, vector 183 -Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Ciphertext: 3222E0228F29C9F27467CB7047838E39 -Test: Encrypt -Comment: Set 3, vector 184 -Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Ciphertext: E422497D1FD54DF8F9CEE11548D77303 -Test: Encrypt -Comment: Set 3, vector 185 -Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Ciphertext: B26A00606A375B1A64B7F0C333D81A50 -Test: Encrypt -Comment: Set 3, vector 186 -Key: BABABABABABABABABABABABABABABABABABABABABABABABA -Plaintext: BABABABABABABABABABABABABABABABA -Ciphertext: D5032B06E290F6B76327E47E519F8F6D -Test: Encrypt -Comment: Set 3, vector 187 -Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Ciphertext: 2CED7355B82DF3B88C4417149FFA1783 -Test: Encrypt -Comment: Set 3, vector 188 -Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Ciphertext: FC7B4D95C62CA6D33862D56768EA9A1A -Test: Encrypt -Comment: Set 3, vector 189 -Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Ciphertext: 375A9C1E1FCFA6F2369306D966F82156 -Test: Encrypt -Comment: Set 3, vector 190 -Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Ciphertext: BA4C218D8691D5D9CE15ECCC75C75D8B -Test: Encrypt -Comment: Set 3, vector 191 -Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Ciphertext: 4D5C53279B76A6F74195C65F09DF85D9 -Test: Encrypt -Comment: Set 3, vector 192 -Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Ciphertext: 75CF5E6B3B0BFFF2290A5E58A85CF994 -Test: Encrypt -Comment: Set 3, vector 193 -Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Ciphertext: 3482A5C83234E75CB443E09BA17EE3A0 -Test: Encrypt -Comment: Set 3, vector 194 -Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Ciphertext: DA592D849C1BFBBEF5C3D0D8DA0F4B9A -Test: Encrypt -Comment: Set 3, vector 195 -Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Ciphertext: 6656047376A76ED53FFF8C5DE1B6F886 -Test: Encrypt -Comment: Set 3, vector 196 -Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Ciphertext: F86FD06864804515B17B453F8A42A44D -Test: Encrypt -Comment: Set 3, vector 197 -Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Ciphertext: E57CD8E81BBF5B42446A7880B32A9A2F -Test: Encrypt -Comment: Set 3, vector 198 -Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Ciphertext: A17219F7DEFF2985BDFADD62A6854947 -Test: Encrypt -Comment: Set 3, vector 199 -Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Ciphertext: FF288A92FB408DA875531D163CE0105A -Test: Encrypt -Comment: Set 3, vector 200 -Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Ciphertext: 11828CD066FD12620DFA16358CF1A705 -Test: Encrypt -Comment: Set 3, vector 201 -Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Ciphertext: 6FA5DCBD14D2520E7F8147EDBEBBEAEE -Test: Encrypt -Comment: Set 3, vector 202 -Key: CACACACACACACACACACACACACACACACACACACACACACACACA -Plaintext: CACACACACACACACACACACACACACACACA -Ciphertext: F365CE3849AFB23AF3B62D7CFF80B19B -Test: Encrypt -Comment: Set 3, vector 203 -Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Ciphertext: 74BE047CAAE10D095B3BDA14016EA262 -Test: Encrypt -Comment: Set 3, vector 204 -Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Ciphertext: DC7A7D66AD1ABF1C7AA28891BE685AB5 -Test: Encrypt -Comment: Set 3, vector 205 -Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Ciphertext: 8BED9C5BAD5C4A4AFB41CDFD7E88BB97 -Test: Encrypt -Comment: Set 3, vector 206 -Key: CECECECECECECECECECECECECECECECECECECECECECECECE -Plaintext: CECECECECECECECECECECECECECECECE -Ciphertext: 915FF93DC6A3984F11AB60BD2AA3DC61 -Test: Encrypt -Comment: Set 3, vector 207 -Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Ciphertext: 43DFEEBBFB3692763752E6EA8931A9B8 -Test: Encrypt -Comment: Set 3, vector 208 -Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Ciphertext: 2BB966115263DF2296C5D23E02D9C335 -Test: Encrypt -Comment: Set 3, vector 209 -Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Ciphertext: FCCA1E3616236F0D5A1A9D035A35049D -Test: Encrypt -Comment: Set 3, vector 210 -Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Ciphertext: 2E7246518C923B2AE23C61C99D7E6CE7 -Test: Encrypt -Comment: Set 3, vector 211 -Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Ciphertext: 8D19232494905BAF83F4230395C8E09B -Test: Encrypt -Comment: Set 3, vector 212 -Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Ciphertext: 6BC0BBCC76A7F8DF2A03BAB1CDE47FB6 -Test: Encrypt -Comment: Set 3, vector 213 -Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Ciphertext: BD3D30B62DC0B0FEED0CC760879DB806 -Test: Encrypt -Comment: Set 3, vector 214 -Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Ciphertext: 647388D8E6A9C8D09828041F4E338D47 -Test: Encrypt -Comment: Set 3, vector 215 -Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Ciphertext: 4861CFC3FDDC434F2742E45B97FBB270 -Test: Encrypt -Comment: Set 3, vector 216 -Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Ciphertext: 4426BC1C3990A5DE10760D0C10A3BB9A -Test: Encrypt -Comment: Set 3, vector 217 -Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Ciphertext: 805211D0BD914F07AB1579EF9E3827EE -Test: Encrypt -Comment: Set 3, vector 218 -Key: DADADADADADADADADADADADADADADADADADADADADADADADA -Plaintext: DADADADADADADADADADADADADADADADA -Ciphertext: 519DB5AA8DA219224EDA77F77B96C135 -Test: Encrypt -Comment: Set 3, vector 219 -Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Ciphertext: 7A96F769BF260E6D91A070BA7766D3E3 -Test: Encrypt -Comment: Set 3, vector 220 -Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Ciphertext: 902222F1779476A44CEEDACEDA72B3EC -Test: Encrypt -Comment: Set 3, vector 221 -Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Ciphertext: 99859E56FE0DAB67CDE755E4790ED51D -Test: Encrypt -Comment: Set 3, vector 222 -Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Ciphertext: C2F4EE121941873763F302ECE6D8DF9E -Test: Encrypt -Comment: Set 3, vector 223 -Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Ciphertext: FE1E93DBF071E2280130E169C9E5254A -Test: Encrypt -Comment: Set 3, vector 224 -Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Ciphertext: 58F45B5E30D9DE7038EC405B601521AB -Test: Encrypt -Comment: Set 3, vector 225 -Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Ciphertext: 8783BD662F65899EF61E113B7CC6505D -Test: Encrypt -Comment: Set 3, vector 226 -Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Ciphertext: A3F6BBB2C3403F433203E0E18DB3E4C0 -Test: Encrypt -Comment: Set 3, vector 227 -Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Ciphertext: D3EE663795362A0D2E7A8DB784F95A33 -Test: Encrypt -Comment: Set 3, vector 228 -Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Ciphertext: 1B75895E7FCEEEA5ECA62E14F77ECF6A -Test: Encrypt -Comment: Set 3, vector 229 -Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Ciphertext: 5040525E4F3B78D2036539C1C463A48B -Test: Encrypt -Comment: Set 3, vector 230 -Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Ciphertext: A48E63494241AEACB0EF7B18A431E50D -Test: Encrypt -Comment: Set 3, vector 231 -Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Ciphertext: 9DAF4DBBBC81465BC4270129C522ABCB -Test: Encrypt -Comment: Set 3, vector 232 -Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Ciphertext: 20B118C870AF1A85C683C60A31ED24E4 -Test: Encrypt -Comment: Set 3, vector 233 -Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Ciphertext: 52FF30830000A72FA2CB030539550F06 -Test: Encrypt -Comment: Set 3, vector 234 -Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Ciphertext: 797ED3DB1B9A4BF4122EA0FF667BC36D -Test: Encrypt -Comment: Set 3, vector 235 -Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Ciphertext: 708CE40FC810F5E84B6EE8FC2E0A46FA -Test: Encrypt -Comment: Set 3, vector 236 -Key: ECECECECECECECECECECECECECECECECECECECECECECECEC -Plaintext: ECECECECECECECECECECECECECECECEC -Ciphertext: 0BA7446B1D3D803BB80CDE94E096E79C -Test: Encrypt -Comment: Set 3, vector 237 -Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Ciphertext: 6B0E95AED4DC9E923EDF3DDD5BAEEA0C -Test: Encrypt -Comment: Set 3, vector 238 -Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Ciphertext: DE45D435FD6F8A240AD8DCE5A4BD8CC3 -Test: Encrypt -Comment: Set 3, vector 239 -Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Ciphertext: 8823002161D635ADA686D85B087F3022 -Test: Encrypt -Comment: Set 3, vector 240 -Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Ciphertext: C00F367B98CC819F5F6ADADEA8513DD8 -Test: Encrypt -Comment: Set 3, vector 241 -Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Ciphertext: 9C25269FB7FA889FBD9E55AAD4C92DE0 -Test: Encrypt -Comment: Set 3, vector 242 -Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Ciphertext: 5DD1D60A62B551FFA18CFF8263C5FCE4 -Test: Encrypt -Comment: Set 3, vector 243 -Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Ciphertext: D183A9113393C1EEC7170331C65D2547 -Test: Encrypt -Comment: Set 3, vector 244 -Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Ciphertext: FADF9E4AF6C1D7A6965D5DBA03194F18 -Test: Encrypt -Comment: Set 3, vector 245 -Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Ciphertext: F2E9E5BE04D7B47B93D2B81DBCDA8BF3 -Test: Encrypt -Comment: Set 3, vector 246 -Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Ciphertext: 7A04D513A59636ECA8A8608F10F21910 -Test: Encrypt -Comment: Set 3, vector 247 -Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Ciphertext: 659552FCEF0E90F77050CF3902A22475 -Test: Encrypt -Comment: Set 3, vector 248 -Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Ciphertext: F81709C989061D4439BDD47E71DBB457 -Test: Encrypt -Comment: Set 3, vector 249 -Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Ciphertext: E05425C950E298F31FC6751375B48B66 -Test: Encrypt -Comment: Set 3, vector 250 -Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Ciphertext: 6E90B365BEBAFA5C49DC4D6AB1593F94 -Test: Encrypt -Comment: Set 3, vector 251 -Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Ciphertext: B2469C08D0F878579E162E8ACC5EF802 -Test: Encrypt -Comment: Set 3, vector 252 -Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Ciphertext: C1DCAB694C7FDBEC88C6FC2597EAC180 -Test: Encrypt -Comment: Set 3, vector 253 -Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Ciphertext: 6651FFBD3C30A496D072493A519D44D9 -Test: Encrypt -Comment: Set 3, vector 254 -Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Ciphertext: A2F5A98929658AF4A9700B9923DAF014 -Test: Encrypt -Comment: Set 3, vector 255 -Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Ciphertext: 3F8D5676F51CE23DC3BDB627F8B3883E -Test: Encrypt -Comment: Tests with 256-bit keys -Comment: Set 1, vector 0 -Key: 8000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2136FABDA091DFB5171B94B8EFBB5D08 -Test: Encrypt -Comment: Set 1, vector 1 -Key: 4000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6EBC4F33B3EADA5DBF25130F3D02CD34 -Test: Encrypt -Comment: Set 1, vector 2 -Key: 2000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3A7BCDC53A1F02EF20C79CFCE107D38B -Test: Encrypt -Comment: Set 1, vector 3 -Key: 1000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 88A96052B61C5A621EE9A6316A42ED4A -Test: Encrypt -Comment: Set 1, vector 4 -Key: 0800000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CBD7A2D8354B2DA972A0950BDFFF2CBD -Test: Encrypt -Comment: Set 1, vector 5 -Key: 0400000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 690BEB5FBEA12A4861E826F568E9F8F3 -Test: Encrypt -Comment: Set 1, vector 6 -Key: 0200000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 799A6FA3B78846E424F41370654ABD6F -Test: Encrypt -Comment: Set 1, vector 7 -Key: 0100000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DD7E24E12F391C5FEDE40136F8DE3731 -Test: Encrypt -Comment: Set 1, vector 8 -Key: 0080000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F7412D526E9244574F9933F602595385 -Test: Encrypt -Comment: Set 1, vector 9 -Key: 0040000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FD9D0174A83BEC3E7E1C3372CB5E7C9B -Test: Encrypt -Comment: Set 1, vector 10 -Key: 0020000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FCA62D360A7DFE54DB8D53819A407E71 -Test: Encrypt -Comment: Set 1, vector 11 -Key: 0010000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AC821C68913DCE3E74A20DB8E902CC4C -Test: Encrypt -Comment: Set 1, vector 12 -Key: 0008000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 80633F6CB8F10863E0A7FDE4C35D50E9 -Test: Encrypt -Comment: Set 1, vector 13 -Key: 0004000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D417D1D94869EE2364FCE869C0C1114E -Test: Encrypt -Comment: Set 1, vector 14 -Key: 0002000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0FA96DCEA2ACB849490CD5A1488A2FD9 -Test: Encrypt -Comment: Set 1, vector 15 -Key: 0001000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3E99BCB51CAEB9147DCF8643771D1C83 -Test: Encrypt -Comment: Set 1, vector 16 -Key: 0000800000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 25EA413BBC3C2579D3F7CBFD9E378091 -Test: Encrypt -Comment: Set 1, vector 17 -Key: 0000400000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C0433C1AD2E468FC679988CFBFCA5CD4 -Test: Encrypt -Comment: Set 1, vector 18 -Key: 0000200000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 05108B7D7C2871D9DE1F22232CF6966B -Test: Encrypt -Comment: Set 1, vector 19 -Key: 0000100000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8ABE085B75333946450F2D1D162E8650 -Test: Encrypt -Comment: Set 1, vector 20 -Key: 0000080000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 487A9C50152B44F5B009D8682EA1FD22 -Test: Encrypt -Comment: Set 1, vector 21 -Key: 0000040000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 739207A812F142B545798BA85170AF25 -Test: Encrypt -Comment: Set 1, vector 22 -Key: 0000020000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E40B90A5840591FEC98A24B23E73892B -Test: Encrypt -Comment: Set 1, vector 23 -Key: 0000010000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0258BFB0DC942F6A9139D3C00EBBEB35 -Test: Encrypt -Comment: Set 1, vector 24 -Key: 0000008000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 650CD6035752320B8252F44AEEBEC9E4 -Test: Encrypt -Comment: Set 1, vector 25 -Key: 0000004000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FABFFBB7028B53E0BB88E3E4462ACF0D -Test: Encrypt -Comment: Set 1, vector 26 -Key: 0000002000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C48D3416904896E2F2307EA26FB8CF1C -Test: Encrypt -Comment: Set 1, vector 27 -Key: 0000001000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2237452352F488F1DA3F1619FC6A7F85 -Test: Encrypt -Comment: Set 1, vector 28 -Key: 0000000800000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D3E6ECF4A3F70E672AABEE0C2ECA3960 -Test: Encrypt -Comment: Set 1, vector 29 -Key: 0000000400000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7A3EFC8AC6A82E8AEF377D8D96D8E830 -Test: Encrypt -Comment: Set 1, vector 30 -Key: 0000000200000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7278F0441F5AA34C0B7CDB076B453225 -Test: Encrypt -Comment: Set 1, vector 31 -Key: 0000000100000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 382E61EAC044E2151906F936CC9D33AE -Test: Encrypt -Comment: Set 1, vector 32 -Key: 0000000080000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C51147F4AD33C35647DF7E856C2965D4 -Test: Encrypt -Comment: Set 1, vector 33 -Key: 0000000040000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DAFE261154ADF63EA3F75B1253A9F77C -Test: Encrypt -Comment: Set 1, vector 34 -Key: 0000000020000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B1A0B0E765C1D0379CA538ED0EFB9649 -Test: Encrypt -Comment: Set 1, vector 35 -Key: 0000000010000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 78F7D01D7795ACA0846CCE835E71FBC2 -Test: Encrypt -Comment: Set 1, vector 36 -Key: 0000000008000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E001A545AC71F53D3AD99C84D7F5B062 -Test: Encrypt -Comment: Set 1, vector 37 -Key: 0000000004000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 58E3907C56BF5ADFDBAE61C172B8F488 -Test: Encrypt -Comment: Set 1, vector 38 -Key: 0000000002000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 16F77C9515B473167BD7ABA7C97B1CCA -Test: Encrypt -Comment: Set 1, vector 39 -Key: 0000000001000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4BC9F687C7757CDF5A5E94D69E5EA173 -Test: Encrypt -Comment: Set 1, vector 40 -Key: 0000000000800000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 804261A34F26A87694F70C35F338989D -Test: Encrypt -Comment: Set 1, vector 41 -Key: 0000000000400000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E8D8BF002738D7067CD06437C4459365 -Test: Encrypt -Comment: Set 1, vector 42 -Key: 0000000000200000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E131137F7EA2AEAB37F72AF3644FFCCE -Test: Encrypt -Comment: Set 1, vector 43 -Key: 0000000000100000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 542A1FD5CB4BE8485FA83AA14FAAD4A8 -Test: Encrypt -Comment: Set 1, vector 44 -Key: 0000000000080000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BEC6C8C1A9E5E7982A990B8F9BA0ADE3 -Test: Encrypt -Comment: Set 1, vector 45 -Key: 0000000000040000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DE55BE1AA823A9F7474C65BD50D55095 -Test: Encrypt -Comment: Set 1, vector 46 -Key: 0000000000020000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D67CC199AF361A07A0DBD8F6700A4744 -Test: Encrypt -Comment: Set 1, vector 47 -Key: 0000000000010000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DBAD180017184EF80D398D8D22AAC4A1 -Test: Encrypt -Comment: Set 1, vector 48 -Key: 0000000000008000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 27E68691F10EEFD1B594682DC3EF65A5 -Test: Encrypt -Comment: Set 1, vector 49 -Key: 0000000000004000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6D4EF0587B948AD62B703D3D7CCEA229 -Test: Encrypt -Comment: Set 1, vector 50 -Key: 0000000000002000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C0F443758F239E3A3E31E6F93AD4766B -Test: Encrypt -Comment: Set 1, vector 51 -Key: 0000000000001000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BEB5CB1D8EB3A9EA795A4B43CA1567A9 -Test: Encrypt -Comment: Set 1, vector 52 -Key: 0000000000000800000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D89A97957F1979C63459A385E21B4A84 -Test: Encrypt -Comment: Set 1, vector 53 -Key: 0000000000000400000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 39A6615147FF571F2FABAD5BE9800A10 -Test: Encrypt -Comment: Set 1, vector 54 -Key: 0000000000000200000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E18B0CB1980124504B46A46A6F4273F3 -Test: Encrypt -Comment: Set 1, vector 55 -Key: 0000000000000100000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1E13C8034ED53FD4E3F433E1CF4B5CE1 -Test: Encrypt -Comment: Set 1, vector 56 -Key: 0000000000000080000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 71FA53EAADBA0C9BCF86A3071408966D -Test: Encrypt -Comment: Set 1, vector 57 -Key: 0000000000000040000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E50502EC84BB024C7466FE225C7FD8BA -Test: Encrypt -Comment: Set 1, vector 58 -Key: 0000000000000020000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DEB33581D79C9D4294E315998377BCBF -Test: Encrypt -Comment: Set 1, vector 59 -Key: 0000000000000010000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A713C2503CE44A04C9108FA160659945 -Test: Encrypt -Comment: Set 1, vector 60 -Key: 0000000000000008000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 520E9E8DB8A67601B02E369916FAB8CC -Test: Encrypt -Comment: Set 1, vector 61 -Key: 0000000000000004000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8FDC11B74D17D79C6B2DFF2D6A561258 -Test: Encrypt -Comment: Set 1, vector 62 -Key: 0000000000000002000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3EA497AD2FC8F2587EFAA7D49121F26C -Test: Encrypt -Comment: Set 1, vector 63 -Key: 0000000000000001000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3340905F7413C979E5AED11D71B9294E -Test: Encrypt -Comment: Set 1, vector 64 -Key: 0000000000000000800000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 067FAC22E16205FF209B1760ABDE0565 -Test: Encrypt -Comment: Set 1, vector 65 -Key: 0000000000000000400000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BECA010BAB7BDD7E8A8084DA9853A0F4 -Test: Encrypt -Comment: Set 1, vector 66 -Key: 0000000000000000200000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 146F5A4A7B2880F5AF57333C7F129028 -Test: Encrypt -Comment: Set 1, vector 67 -Key: 0000000000000000100000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F773C1BD724955109A8B4EA3DA1C2197 -Test: Encrypt -Comment: Set 1, vector 68 -Key: 0000000000000000080000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B427EFAC8C656AB6F4DF7F420A177B8E -Test: Encrypt -Comment: Set 1, vector 69 -Key: 0000000000000000040000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B3D1BDB29010DB5FC81B66E2F7189D54 -Test: Encrypt -Comment: Set 1, vector 70 -Key: 0000000000000000020000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 676EEA415693F303ACF5CD84C50816AB -Test: Encrypt -Comment: Set 1, vector 71 -Key: 0000000000000000010000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BA21C564E52961DEB4B3A3CA9E0B70EF -Test: Encrypt -Comment: Set 1, vector 72 -Key: 0000000000000000008000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A60FB5DBD17EA92E303492E3F54D0BF2 -Test: Encrypt -Comment: Set 1, vector 73 -Key: 0000000000000000004000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F4F5A0540107D66F32FB289B14EF4299 -Test: Encrypt -Comment: Set 1, vector 74 -Key: 0000000000000000002000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8D9B4A19F391175CF7DA42FEF313EDD8 -Test: Encrypt -Comment: Set 1, vector 75 -Key: 0000000000000000001000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B0AFAB0183A9FC69DA8BBE9B8FAF653A -Test: Encrypt -Comment: Set 1, vector 76 -Key: 0000000000000000000800000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 68FFD91FD5AD1F1AC176D639694FEA29 -Test: Encrypt -Comment: Set 1, vector 77 -Key: 0000000000000000000400000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 97EC38070014494A2E97EFE354BA2865 -Test: Encrypt -Comment: Set 1, vector 78 -Key: 0000000000000000000200000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E3EC51F889C63AD2C708F22AFC42D18C -Test: Encrypt -Comment: Set 1, vector 79 -Key: 0000000000000000000100000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8CC5BDB49037DC1D3D8DADFA0B8ECD96 -Test: Encrypt -Comment: Set 1, vector 80 -Key: 0000000000000000000080000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 14F5C3D75BA0397D7436E1479F78435B -Test: Encrypt -Comment: Set 1, vector 81 -Key: 0000000000000000000040000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FF3B01851C8254967E4DFAA2A0F0C057 -Test: Encrypt -Comment: Set 1, vector 82 -Key: 0000000000000000000020000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B8C8E9AFF66FFEC9D0342FF297A543B1 -Test: Encrypt -Comment: Set 1, vector 83 -Key: 0000000000000000000010000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A95A113F088FFE17A79050C46377545E -Test: Encrypt -Comment: Set 1, vector 84 -Key: 0000000000000000000008000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EA4C3AFA65016D057EC1DFDD0411ED06 -Test: Encrypt -Comment: Set 1, vector 85 -Key: 0000000000000000000004000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7D535C84DFAD692D0F89AB73C1F42F60 -Test: Encrypt -Comment: Set 1, vector 86 -Key: 0000000000000000000002000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E857DF0CEBAB1E03CB9AF73CBF9C19D1 -Test: Encrypt -Comment: Set 1, vector 87 -Key: 0000000000000000000001000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7A59BCF6FAC80379EB7E8E2EFAB147D4 -Test: Encrypt -Comment: Set 1, vector 88 -Key: 0000000000000000000000800000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 43EF17F87BAF7536DDE734F885C4CE85 -Test: Encrypt -Comment: Set 1, vector 89 -Key: 0000000000000000000000400000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2B71CE14089741A1EF1E99DC9E22E739 -Test: Encrypt -Comment: Set 1, vector 90 -Key: 0000000000000000000000200000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9283885622781998186B7DACBFF68ED2 -Test: Encrypt -Comment: Set 1, vector 91 -Key: 0000000000000000000000100000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 756A184F392D8C821479EFF930338C0A -Test: Encrypt -Comment: Set 1, vector 92 -Key: 0000000000000000000000080000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CE848D49BB76CA30B607C9539793DA41 -Test: Encrypt -Comment: Set 1, vector 93 -Key: 0000000000000000000000040000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 50F2D5238991EEA9654C8895AFC0AC37 -Test: Encrypt -Comment: Set 1, vector 94 -Key: 0000000000000000000000020000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 561564103E13F4CBB58A9E096DB1958B -Test: Encrypt -Comment: Set 1, vector 95 -Key: 0000000000000000000000010000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EF2BB05AC6868C15D66D956BD580D467 -Test: Encrypt -Comment: Set 1, vector 96 -Key: 0000000000000000000000008000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C7B1A5A3A201DF25FD97A47B1FC3569E -Test: Encrypt -Comment: Set 1, vector 97 -Key: 0000000000000000000000004000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0A1873FF47B38095CF6A8BABF3901FF2 -Test: Encrypt -Comment: Set 1, vector 98 -Key: 0000000000000000000000002000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A96F8F977DC45ABF55518EA10C598E10 -Test: Encrypt -Comment: Set 1, vector 99 -Key: 0000000000000000000000001000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 778C644278689EC0577BDDB2154AE635 -Test: Encrypt -Comment: Set 1, vector 100 -Key: 0000000000000000000000000800000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DEF97DBCF02648E7BCE6A368F7F34C14 -Test: Encrypt -Comment: Set 1, vector 101 -Key: 0000000000000000000000000400000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 71B85362022D53AF03A17870D8F66614 -Test: Encrypt -Comment: Set 1, vector 102 -Key: 0000000000000000000000000200000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3593FC550A2950C2EF94F6E8F6E90BB3 -Test: Encrypt -Comment: Set 1, vector 103 -Key: 0000000000000000000000000100000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 29E64004DBF1E7833A7CD82EDACD932A -Test: Encrypt -Comment: Set 1, vector 104 -Key: 0000000000000000000000000080000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 715E700DF74A8680F04A48B18AEDB99C -Test: Encrypt -Comment: Set 1, vector 105 -Key: 0000000000000000000000000040000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 72E3288FFB02D1100F84FA605855D812 -Test: Encrypt -Comment: Set 1, vector 106 -Key: 0000000000000000000000000020000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9021082D3C4CB202936FD76F1392446B -Test: Encrypt -Comment: Set 1, vector 107 -Key: 0000000000000000000000000010000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1552BD181EE0FB914558053F2662F9AE -Test: Encrypt -Comment: Set 1, vector 108 -Key: 0000000000000000000000000008000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 599D87052322E19141057F0EF3C47508 -Test: Encrypt -Comment: Set 1, vector 109 -Key: 0000000000000000000000000004000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 505AC03CEB2ECA1C9D411B4A1CF2011C -Test: Encrypt -Comment: Set 1, vector 110 -Key: 0000000000000000000000000002000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DD639574D8FFCD24EA68B2243C5AA7D6 -Test: Encrypt -Comment: Set 1, vector 111 -Key: 0000000000000000000000000001000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 45F5371B714D2652BA4AD083EDB65BEE -Test: Encrypt -Comment: Set 1, vector 112 -Key: 0000000000000000000000000000800000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DEAB9C368B21FE41E709554340E87C0B -Test: Encrypt -Comment: Set 1, vector 113 -Key: 0000000000000000000000000000400000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3A981045526766BD13943F11CE917AF9 -Test: Encrypt -Comment: Set 1, vector 114 -Key: 0000000000000000000000000000200000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 35CDF30A485CE21F0D005EE0C2BCF315 -Test: Encrypt -Comment: Set 1, vector 115 -Key: 0000000000000000000000000000100000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F561A8C91820252580317385F8336305 -Test: Encrypt -Comment: Set 1, vector 116 -Key: 0000000000000000000000000000080000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0789680D27735220798079572BF4ECF6 -Test: Encrypt -Comment: Set 1, vector 117 -Key: 0000000000000000000000000000040000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B4F16729D7AB16C9AE44FB61291920DE -Test: Encrypt -Comment: Set 1, vector 118 -Key: 0000000000000000000000000000020000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FB83BF9B1D983CA7FB3718E22D9A2155 -Test: Encrypt -Comment: Set 1, vector 119 -Key: 0000000000000000000000000000010000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CEC5C5D13E59508D3DA431F1479730F3 -Test: Encrypt -Comment: Set 1, vector 120 -Key: 0000000000000000000000000000008000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 09BEA932E60A4AD34271FF11A2B2AA02 -Test: Encrypt -Comment: Set 1, vector 121 -Key: 0000000000000000000000000000004000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B102F72FD89452C0CD1C6897071F903E -Test: Encrypt -Comment: Set 1, vector 122 -Key: 0000000000000000000000000000002000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A469F9411F0A3A6E1A8076416C6B55CB -Test: Encrypt -Comment: Set 1, vector 123 -Key: 0000000000000000000000000000001000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6C3F88FCB538699547A1CF07A529993F -Test: Encrypt -Comment: Set 1, vector 124 -Key: 0000000000000000000000000000000800000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 493E8CC2A63534632A6456ED47BF233C -Test: Encrypt -Comment: Set 1, vector 125 -Key: 0000000000000000000000000000000400000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1FD81E905F7055C4B04DB1F9718A6861 -Test: Encrypt -Comment: Set 1, vector 126 -Key: 0000000000000000000000000000000200000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B22882E01D7A1BF2D7F0E3BFBFC87156 -Test: Encrypt -Comment: Set 1, vector 127 -Key: 0000000000000000000000000000000100000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 86C9822E849322FB00DF89233D33935D -Test: Encrypt -Comment: Set 1, vector 128 -Key: 0000000000000000000000000000000080000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 12012E8E028D0D3D8DC00847130D424C -Test: Encrypt -Comment: Set 1, vector 129 -Key: 0000000000000000000000000000000040000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 182A96CC3BF10035B9DB292D1399F993 -Test: Encrypt -Comment: Set 1, vector 130 -Key: 0000000000000000000000000000000020000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 91E0E6991989D1FC4CBD754E4E7D0590 -Test: Encrypt -Comment: Set 1, vector 131 -Key: 0000000000000000000000000000000010000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F3EFC4E6F207E370C8CAE39408C4BF1B -Test: Encrypt -Comment: Set 1, vector 132 -Key: 0000000000000000000000000000000008000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AA767AB2EC6FA2FA183DAF9C0F3BAE5E -Test: Encrypt -Comment: Set 1, vector 133 -Key: 0000000000000000000000000000000004000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: D1FF11F4D1AEEAAE01A115081AF886EF -Test: Encrypt -Comment: Set 1, vector 134 -Key: 0000000000000000000000000000000002000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5390139711090B56B28338FEA98FCC82 -Test: Encrypt -Comment: Set 1, vector 135 -Key: 0000000000000000000000000000000001000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 13E693CCF6EBF0E6061B92B7ED0B95B6 -Test: Encrypt -Comment: Set 1, vector 136 -Key: 0000000000000000000000000000000000800000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 588FB2F95861D3C427669C68D04ADB25 -Test: Encrypt -Comment: Set 1, vector 137 -Key: 0000000000000000000000000000000000400000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F472ECDF8DEBC416313AAF7C8AAFB43E -Test: Encrypt -Comment: Set 1, vector 138 -Key: 0000000000000000000000000000000000200000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EAA654BE38E857941A921C70AC7FC7CE -Test: Encrypt -Comment: Set 1, vector 139 -Key: 0000000000000000000000000000000000100000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F2A4E47AE80CDF506B9513C510EA0954 -Test: Encrypt -Comment: Set 1, vector 140 -Key: 0000000000000000000000000000000000080000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F08EC7ED8FBB99F175A990C3E4DECB6B -Test: Encrypt -Comment: Set 1, vector 141 -Key: 0000000000000000000000000000000000040000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5C767BC584CA3653EDE27CD8B209A0AD -Test: Encrypt -Comment: Set 1, vector 142 -Key: 0000000000000000000000000000000000020000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AFF9A8BA92A40B2BF42FDB4089B1F9CC -Test: Encrypt -Comment: Set 1, vector 143 -Key: 0000000000000000000000000000000000010000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BFC1E9198BBE22266712EB1ECB17D748 -Test: Encrypt -Comment: Set 1, vector 144 -Key: 0000000000000000000000000000000000008000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 235184136A29208BD041E60BCB9F7464 -Test: Encrypt -Comment: Set 1, vector 145 -Key: 0000000000000000000000000000000000004000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 83DC48F9177C5C94CBC22E83A2B76829 -Test: Encrypt -Comment: Set 1, vector 146 -Key: 0000000000000000000000000000000000002000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 72CD31ACB7A1A459E4D27C1F26039FA7 -Test: Encrypt -Comment: Set 1, vector 147 -Key: 0000000000000000000000000000000000001000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 139AC4734C3136FD9982FCC7A569B9D3 -Test: Encrypt -Comment: Set 1, vector 148 -Key: 0000000000000000000000000000000000000800000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 12FFA3EF4346F4C57A03A36F9938B251 -Test: Encrypt -Comment: Set 1, vector 149 -Key: 0000000000000000000000000000000000000400000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 43DDB100CE22E5553CF4DCF814BF3CAC -Test: Encrypt -Comment: Set 1, vector 150 -Key: 0000000000000000000000000000000000000200000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: ABDADF4C948BB61C0A917885ADE4C7C5 -Test: Encrypt -Comment: Set 1, vector 151 -Key: 0000000000000000000000000000000000000100000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 197391E089DE173B522DDD8CBEEC3118 -Test: Encrypt -Comment: Set 1, vector 152 -Key: 0000000000000000000000000000000000000080000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 43FBE8BF2728C55C9368D01E40C1CF96 -Test: Encrypt -Comment: Set 1, vector 153 -Key: 0000000000000000000000000000000000000040000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0F5DE5F67EC84F2CB253A0BC48991C71 -Test: Encrypt -Comment: Set 1, vector 154 -Key: 0000000000000000000000000000000000000020000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 52BA4666B972EAE3D2E960D7372D3C48 -Test: Encrypt -Comment: Set 1, vector 155 -Key: 0000000000000000000000000000000000000010000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0735AE765BC079A93B451D873FA93702 -Test: Encrypt -Comment: Set 1, vector 156 -Key: 0000000000000000000000000000000000000008000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 89D988508A4569E2232F72412AE50B65 -Test: Encrypt -Comment: Set 1, vector 157 -Key: 0000000000000000000000000000000000000004000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BCF0EE2403BC9344030C0FF065B6FD88 -Test: Encrypt -Comment: Set 1, vector 158 -Key: 0000000000000000000000000000000000000002000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 25D76D36F3376D6FD835BA012C7DD2E5 -Test: Encrypt -Comment: Set 1, vector 159 -Key: 0000000000000000000000000000000000000001000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EF364A31E8551732D4B2098281D4E2C9 -Test: Encrypt -Comment: Set 1, vector 160 -Key: 0000000000000000000000000000000000000000800000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 64B1F927C0A7315EA60BC5F2A0DCCFE2 -Test: Encrypt -Comment: Set 1, vector 161 -Key: 0000000000000000000000000000000000000000400000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CA99E0EDFA0E121F27659346BCDCC443 -Test: Encrypt -Comment: Set 1, vector 162 -Key: 0000000000000000000000000000000000000000200000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1816D9D23D1069BC6DEC195F60994C05 -Test: Encrypt -Comment: Set 1, vector 163 -Key: 0000000000000000000000000000000000000000100000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9819575F6890E093091378AED0612051 -Test: Encrypt -Comment: Set 1, vector 164 -Key: 0000000000000000000000000000000000000000080000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 41903DE72A486B823842FBA2840E265C -Test: Encrypt -Comment: Set 1, vector 165 -Key: 0000000000000000000000000000000000000000040000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 30651D416912A01EDEC4290D34B4A605 -Test: Encrypt -Comment: Set 1, vector 166 -Key: 0000000000000000000000000000000000000000020000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0949AD8AB2E85995686D6D495ABA1028 -Test: Encrypt -Comment: Set 1, vector 167 -Key: 0000000000000000000000000000000000000000010000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3789C2D08E122BE204662FE9A0FDF77A -Test: Encrypt -Comment: Set 1, vector 168 -Key: 0000000000000000000000000000000000000000008000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A0C66EE031FF045123475E6F5FA64F57 -Test: Encrypt -Comment: Set 1, vector 169 -Key: 0000000000000000000000000000000000000000004000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1BACCDD314AF39124709013C94CAD1AC -Test: Encrypt -Comment: Set 1, vector 170 -Key: 0000000000000000000000000000000000000000002000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2FB5DF5527A8E06AED03D683EDF14E9A -Test: Encrypt -Comment: Set 1, vector 171 -Key: 0000000000000000000000000000000000000000001000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FF2C61AD63CDA6207605C18C888B383D -Test: Encrypt -Comment: Set 1, vector 172 -Key: 0000000000000000000000000000000000000000000800000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 71CE4A5B48671AB9A6561B7109FB8345 -Test: Encrypt -Comment: Set 1, vector 173 -Key: 0000000000000000000000000000000000000000000400000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 37299C12377E9CB8DF5FE730DFFCB5CA -Test: Encrypt -Comment: Set 1, vector 174 -Key: 0000000000000000000000000000000000000000000200000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C5454350A7CB0EC5CA3932A3948F48BC -Test: Encrypt -Comment: Set 1, vector 175 -Key: 0000000000000000000000000000000000000000000100000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8AB40D09FFBD0C82E9091FC80D2A63C9 -Test: Encrypt -Comment: Set 1, vector 176 -Key: 0000000000000000000000000000000000000000000080000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9CB3FE43EAE3DC7AC4F97E609FDE9F10 -Test: Encrypt -Comment: Set 1, vector 177 -Key: 0000000000000000000000000000000000000000000040000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 51369DC689B25C3AC593B578BAEA046E -Test: Encrypt -Comment: Set 1, vector 178 -Key: 0000000000000000000000000000000000000000000020000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 13D9D885A24AE8B859F239890DF438C9 -Test: Encrypt -Comment: Set 1, vector 179 -Key: 0000000000000000000000000000000000000000000010000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CEACAE376290D5C62D2DAE422CA6E5C0 -Test: Encrypt -Comment: Set 1, vector 180 -Key: 0000000000000000000000000000000000000000000008000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6AE17D621F97B62F4571AB165CE0A11F -Test: Encrypt -Comment: Set 1, vector 181 -Key: 0000000000000000000000000000000000000000000004000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C91318F8FD17E9BC656E639A0D648B3A -Test: Encrypt -Comment: Set 1, vector 182 -Key: 0000000000000000000000000000000000000000000002000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BFF1BC1C935E40FB0C20DED5985F1910 -Test: Encrypt -Comment: Set 1, vector 183 -Key: 0000000000000000000000000000000000000000000001000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 96F0B387F487BBDD5227B595A506F963 -Test: Encrypt -Comment: Set 1, vector 184 -Key: 0000000000000000000000000000000000000000000000800000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 62265B7EFB73A77205ECBBFD166B3EAE -Test: Encrypt -Comment: Set 1, vector 185 -Key: 0000000000000000000000000000000000000000000000400000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 016E8F3087757E8F576B19A58D356FB6 -Test: Encrypt -Comment: Set 1, vector 186 -Key: 0000000000000000000000000000000000000000000000200000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 456FAF632EA07797CEC23DC6553988F9 -Test: Encrypt -Comment: Set 1, vector 187 -Key: 0000000000000000000000000000000000000000000000100000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 147694E2231FA00D6B62D3E51CC8201D -Test: Encrypt -Comment: Set 1, vector 188 -Key: 0000000000000000000000000000000000000000000000080000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2299D31F3D747838C65FE7C6C0C59214 -Test: Encrypt -Comment: Set 1, vector 189 -Key: 0000000000000000000000000000000000000000000000040000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: C5A669612A23E4F7551D79650071E040 -Test: Encrypt -Comment: Set 1, vector 190 -Key: 0000000000000000000000000000000000000000000000020000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F0A32D722EDFD2BA628C781DACD5FC50 -Test: Encrypt -Comment: Set 1, vector 191 -Key: 0000000000000000000000000000000000000000000000010000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 422C8E2A0DFF095E40654CB2B7176A9B -Test: Encrypt -Comment: Set 1, vector 192 -Key: 0000000000000000000000000000000000000000000000008000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 99DEF168961D4AB9E63157E60F76399C -Test: Encrypt -Comment: Set 1, vector 193 -Key: 0000000000000000000000000000000000000000000000004000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 49C92ACC622A00BCFF7DFDCABF33CB4C -Test: Encrypt -Comment: Set 1, vector 194 -Key: 0000000000000000000000000000000000000000000000002000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 517117A096B2EE66D4BEF2D1EE570CE7 -Test: Encrypt -Comment: Set 1, vector 195 -Key: 0000000000000000000000000000000000000000000000001000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9DAECC0E82559BC2CDB8A01AB30BA605 -Test: Encrypt -Comment: Set 1, vector 196 -Key: 0000000000000000000000000000000000000000000000000800000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 50B2882928DAB54488413ABA5743535E -Test: Encrypt -Comment: Set 1, vector 197 -Key: 0000000000000000000000000000000000000000000000000400000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E6725F73ED920F473E1442ABEC7DB722 -Test: Encrypt -Comment: Set 1, vector 198 -Key: 0000000000000000000000000000000000000000000000000200000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CB4F06002C5864E40C80F97157452575 -Test: Encrypt -Comment: Set 1, vector 199 -Key: 0000000000000000000000000000000000000000000000000100000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8DF72D7C8AE547F2AA3E9AFAAD1D62F0 -Test: Encrypt -Comment: Set 1, vector 200 -Key: 0000000000000000000000000000000000000000000000000080000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0DA429E486F5ED9460B7C54460B0A699 -Test: Encrypt -Comment: Set 1, vector 201 -Key: 0000000000000000000000000000000000000000000000000040000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 24832DB462328D93306C6714E100ADAB -Test: Encrypt -Comment: Set 1, vector 202 -Key: 0000000000000000000000000000000000000000000000000020000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3170D82FEC3D2A58C7D2F28BAC4C7809 -Test: Encrypt -Comment: Set 1, vector 203 -Key: 0000000000000000000000000000000000000000000000000010000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 638A46425AEA9C808AC752EE69F56822 -Test: Encrypt -Comment: Set 1, vector 204 -Key: 0000000000000000000000000000000000000000000000000008000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F98954D90C5E3DB2EEC8A86078D70763 -Test: Encrypt -Comment: Set 1, vector 205 -Key: 0000000000000000000000000000000000000000000000000004000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8D5868451617FB145B8F7F91712A7AA0 -Test: Encrypt -Comment: Set 1, vector 206 -Key: 0000000000000000000000000000000000000000000000000002000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2292BA337A4F465E0DFB85DAAC266AE6 -Test: Encrypt -Comment: Set 1, vector 207 -Key: 0000000000000000000000000000000000000000000000000001000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F2560D5063A2F928D699005012A0C839 -Test: Encrypt -Comment: Set 1, vector 208 -Key: 0000000000000000000000000000000000000000000000000000800000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 44968AEABB2852075F83FB942E05099D -Test: Encrypt -Comment: Set 1, vector 209 -Key: 0000000000000000000000000000000000000000000000000000400000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EB339742AB40B5627A7CB60D4F54DD2E -Test: Encrypt -Comment: Set 1, vector 210 -Key: 0000000000000000000000000000000000000000000000000000200000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9AAA6FC3BBDE523E9FCD9D5C0255F912 -Test: Encrypt -Comment: Set 1, vector 211 -Key: 0000000000000000000000000000000000000000000000000000100000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E6E25CBAFF57F4C6056706FD13E6A2E3 -Test: Encrypt -Comment: Set 1, vector 212 -Key: 0000000000000000000000000000000000000000000000000000080000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 8A9628166922E8EC6FC28F5E847B9C71 -Test: Encrypt -Comment: Set 1, vector 213 -Key: 0000000000000000000000000000000000000000000000000000040000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 97CF8FF5D1337DA8602F8AB6C0224AF7 -Test: Encrypt -Comment: Set 1, vector 214 -Key: 0000000000000000000000000000000000000000000000000000020000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DDBBE09A93364599E9233969ADBEBA63 -Test: Encrypt -Comment: Set 1, vector 215 -Key: 0000000000000000000000000000000000000000000000000000010000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: E772954B9DA3DA8A005582C4E9E5B6FA -Test: Encrypt -Comment: Set 1, vector 216 -Key: 0000000000000000000000000000000000000000000000000000008000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 507DFD30F7EEF807F994B298D487FDE6 -Test: Encrypt -Comment: Set 1, vector 217 -Key: 0000000000000000000000000000000000000000000000000000004000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6FF09F69AED61F091F92503547A19B68 -Test: Encrypt -Comment: Set 1, vector 218 -Key: 0000000000000000000000000000000000000000000000000000002000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 1141E6BB725E09640DD6971F4EF1A886 -Test: Encrypt -Comment: Set 1, vector 219 -Key: 0000000000000000000000000000000000000000000000000000001000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9C0E8061BA0361B730D24675EF128705 -Test: Encrypt -Comment: Set 1, vector 220 -Key: 0000000000000000000000000000000000000000000000000000000800000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7D0137240D0D3D086198E83BC0CF22D0 -Test: Encrypt -Comment: Set 1, vector 221 -Key: 0000000000000000000000000000000000000000000000000000000400000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: BC4460FF55EBFAA1171B0CE249830281 -Test: Encrypt -Comment: Set 1, vector 222 -Key: 0000000000000000000000000000000000000000000000000000000200000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CDBE93ADCF1867B952FB82C42DF60CFD -Test: Encrypt -Comment: Set 1, vector 223 -Key: 0000000000000000000000000000000000000000000000000000000100000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 007AA375E4402B8A5657C01259AF3D49 -Test: Encrypt -Comment: Set 1, vector 224 -Key: 0000000000000000000000000000000000000000000000000000000080000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: F5C2B13998E5687C773017C14EB01FE4 -Test: Encrypt -Comment: Set 1, vector 225 -Key: 0000000000000000000000000000000000000000000000000000000040000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0AE71BFDD72FBC4576305E4B0807E17C -Test: Encrypt -Comment: Set 1, vector 226 -Key: 0000000000000000000000000000000000000000000000000000000020000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 35FB1CE6CB7449DF115D3AC6BA656439 -Test: Encrypt -Comment: Set 1, vector 227 -Key: 0000000000000000000000000000000000000000000000000000000010000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6D64CEC5D9D74BD40FBC0BE69C70B777 -Test: Encrypt -Comment: Set 1, vector 228 -Key: 0000000000000000000000000000000000000000000000000000000008000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7257851ACD3E3E3AE50048973C3A2AE8 -Test: Encrypt -Comment: Set 1, vector 229 -Key: 0000000000000000000000000000000000000000000000000000000004000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 50852661D5BD7960412B29A86F549619 -Test: Encrypt -Comment: Set 1, vector 230 -Key: 0000000000000000000000000000000000000000000000000000000002000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CDF3561D971D40521CD46BAE98F5867A -Test: Encrypt -Comment: Set 1, vector 231 -Key: 0000000000000000000000000000000000000000000000000000000001000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FA3C84185B9ABF9887DD501B3B0F52D3 -Test: Encrypt -Comment: Set 1, vector 232 -Key: 0000000000000000000000000000000000000000000000000000000000800000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 40A5B434F81574733D00F25511109E08 -Test: Encrypt -Comment: Set 1, vector 233 -Key: 0000000000000000000000000000000000000000000000000000000000400000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DA0D248315C527572F1673BDE26A475E -Test: Encrypt -Comment: Set 1, vector 234 -Key: 0000000000000000000000000000000000000000000000000000000000200000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0F8366D8EFB9AB63B0299F278C55CFB4 -Test: Encrypt -Comment: Set 1, vector 235 -Key: 0000000000000000000000000000000000000000000000000000000000100000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 25A089C523CD153EC094862B5923F492 -Test: Encrypt -Comment: Set 1, vector 236 -Key: 0000000000000000000000000000000000000000000000000000000000080000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7268A4628C6A0BE6A8391ABE70986176 -Test: Encrypt -Comment: Set 1, vector 237 -Key: 0000000000000000000000000000000000000000000000000000000000040000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7C11E6478CC688FE707454DF4AB5B666 -Test: Encrypt -Comment: Set 1, vector 238 -Key: 0000000000000000000000000000000000000000000000000000000000020000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 7601B6EBD5CE578973E949C21BFA8CAA -Test: Encrypt -Comment: Set 1, vector 239 -Key: 0000000000000000000000000000000000000000000000000000000000010000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0FCE9CCDF89F2EB139DBEB09B55375D5 -Test: Encrypt -Comment: Set 1, vector 240 -Key: 0000000000000000000000000000000000000000000000000000000000008000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AAABFDD9E28A3ADCA1212F3D7F53A269 -Test: Encrypt -Comment: Set 1, vector 241 -Key: 0000000000000000000000000000000000000000000000000000000000004000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: FC6B4304423917E41677768BD7A8D402 -Test: Encrypt -Comment: Set 1, vector 242 -Key: 0000000000000000000000000000000000000000000000000000000000002000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2AA3239D19ADBA9A4190E3653875C589 -Test: Encrypt -Comment: Set 1, vector 243 -Key: 0000000000000000000000000000000000000000000000000000000000001000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 4F4AB0DB2F3D3EA1E5FCBF99651485DC -Test: Encrypt -Comment: Set 1, vector 244 -Key: 0000000000000000000000000000000000000000000000000000000000000800 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B542CEF08D13E300B282CE6A74C51C96 -Test: Encrypt -Comment: Set 1, vector 245 -Key: 0000000000000000000000000000000000000000000000000000000000000400 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 9955E16433B0D58BFC4B35EE9F44734C -Test: Encrypt -Comment: Set 1, vector 246 -Key: 0000000000000000000000000000000000000000000000000000000000000200 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 5027A7DDC6F99A112E45D3090C7C3465 -Test: Encrypt -Comment: Set 1, vector 247 -Key: 0000000000000000000000000000000000000000000000000000000000000100 -Plaintext: 00000000000000000000000000000000 -Ciphertext: CB14EBD24FC63194495FACFFB5C3A07B -Test: Encrypt -Comment: Set 1, vector 248 -Key: 0000000000000000000000000000000000000000000000000000000000000080 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 2BCBE64545A08F59178242452566B997 -Test: Encrypt -Comment: Set 1, vector 249 -Key: 0000000000000000000000000000000000000000000000000000000000000040 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DE428FF12360A0C8FAE73E9D8E6A0657 -Test: Encrypt -Comment: Set 1, vector 250 -Key: 0000000000000000000000000000000000000000000000000000000000000020 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 6425603FCB0F088D87D3AC7078C7014C -Test: Encrypt -Comment: Set 1, vector 251 -Key: 0000000000000000000000000000000000000000000000000000000000000010 -Plaintext: 00000000000000000000000000000000 -Ciphertext: A837813C9436F4C48C45B6C85A4EAF84 -Test: Encrypt -Comment: Set 1, vector 252 -Key: 0000000000000000000000000000000000000000000000000000000000000008 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B95F9010E694BA44B812D6A7A59E027A -Test: Encrypt -Comment: Set 1, vector 253 -Key: 0000000000000000000000000000000000000000000000000000000000000004 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DF2746A2D9ED707DCC686BB64B77C9DD -Test: Encrypt -Comment: Set 1, vector 254 -Key: 0000000000000000000000000000000000000000000000000000000000000002 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 40DD304C3FC8FEF5D7D08FD467E018F6 -Test: Encrypt -Comment: Set 1, vector 255 -Key: 0000000000000000000000000000000000000000000000000000000000000001 -Plaintext: 00000000000000000000000000000000 -Ciphertext: AFCD38B195E0A736304E89B9AE3019D3 -Test: Encrypt -Comment: Set 2, vector 0 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 80000000000000000000000000000000 -Ciphertext: B0C6B88AEA518AB09E847248E91B1B9D -Test: Encrypt -Comment: Set 2, vector 1 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 40000000000000000000000000000000 -Ciphertext: B8D7684E35FA1DB15BDCEE7A48659858 -Test: Encrypt -Comment: Set 2, vector 2 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 20000000000000000000000000000000 -Ciphertext: F0CAD59AF92FBB79F36951E697492750 -Test: Encrypt -Comment: Set 2, vector 3 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 10000000000000000000000000000000 -Ciphertext: 117100F6635389560DC4A2DA24EBA70F -Test: Encrypt -Comment: Set 2, vector 4 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 08000000000000000000000000000000 -Ciphertext: DBDD62355553019ED84C35886421E532 -Test: Encrypt -Comment: Set 2, vector 5 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 04000000000000000000000000000000 -Ciphertext: 9CB8D04FA506F19848F7B9110518BFC8 -Test: Encrypt -Comment: Set 2, vector 6 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 02000000000000000000000000000000 -Ciphertext: E4308E253BC3444D293500701BA82C6A -Test: Encrypt -Comment: Set 2, vector 7 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 01000000000000000000000000000000 -Ciphertext: EA2FAE53F7F30C0170A20E95A068503E -Test: Encrypt -Comment: Set 2, vector 8 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00800000000000000000000000000000 -Ciphertext: 14B14839EA221880B2C64D1FE000B93D -Test: Encrypt -Comment: Set 2, vector 9 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00400000000000000000000000000000 -Ciphertext: A5CFC075B342D5101AACC334E73058BB -Test: Encrypt -Comment: Set 2, vector 10 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00200000000000000000000000000000 -Ciphertext: 477EA56B2EBAD0F8AC5E1936866560FF -Test: Encrypt -Comment: Set 2, vector 11 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00100000000000000000000000000000 -Ciphertext: 107E8598418404196EC59F63E45B7F6D -Test: Encrypt -Comment: Set 2, vector 12 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00080000000000000000000000000000 -Ciphertext: FF6A891E7C1C074A68FEC291928FDD8D -Test: Encrypt -Comment: Set 2, vector 13 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00040000000000000000000000000000 -Ciphertext: F64C250A13F45D377ADB7545B2B157A9 -Test: Encrypt -Comment: Set 2, vector 14 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00020000000000000000000000000000 -Ciphertext: FAD0F252086F11C830C65B63197CBC38 -Test: Encrypt -Comment: Set 2, vector 15 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00010000000000000000000000000000 -Ciphertext: 9DCB89B209441F02AD0D25C6AB826629 -Test: Encrypt -Comment: Set 2, vector 16 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00008000000000000000000000000000 -Ciphertext: E62E4ED4E4F34EDC563710D960E09D4C -Test: Encrypt -Comment: Set 2, vector 17 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00004000000000000000000000000000 -Ciphertext: 98A1B926BA06895C3F2E84CCBACBC356 -Test: Encrypt -Comment: Set 2, vector 18 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00002000000000000000000000000000 -Ciphertext: 29BE0BE4DB7F4D196718AEA38F3B0BFD -Test: Encrypt -Comment: Set 2, vector 19 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00001000000000000000000000000000 -Ciphertext: F670C4EBECBA0B43E71F6D752BFD4854 -Test: Encrypt -Comment: Set 2, vector 20 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000800000000000000000000000000 -Ciphertext: 7D7666B4484CDB7E3605468E093A787C -Test: Encrypt -Comment: Set 2, vector 21 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000400000000000000000000000000 -Ciphertext: 562D06B181C091DA6C43642AE99460C6 -Test: Encrypt -Comment: Set 2, vector 22 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000200000000000000000000000000 -Ciphertext: AB0EFB5975E6186B7D76BC9672453488 -Test: Encrypt -Comment: Set 2, vector 23 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000100000000000000000000000000 -Ciphertext: 10C0756538E7BFF88D19AE2B1F7B859A -Test: Encrypt -Comment: Set 2, vector 24 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000080000000000000000000000000 -Ciphertext: AF7FCD5248F8C72F1695AA05DD1CADE0 -Test: Encrypt -Comment: Set 2, vector 25 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000040000000000000000000000000 -Ciphertext: 9841E555655609A75D7BE20B8A90EF1E -Test: Encrypt -Comment: Set 2, vector 26 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000020000000000000000000000000 -Ciphertext: 27F9546E6A1B7464780000561783569C -Test: Encrypt -Comment: Set 2, vector 27 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000010000000000000000000000000 -Ciphertext: 8671D935D7A8354EECB7288803D42D7A -Test: Encrypt -Comment: Set 2, vector 28 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000008000000000000000000000000 -Ciphertext: 0DA44F508DEBC6F044394624FCEB8EBE -Test: Encrypt -Comment: Set 2, vector 29 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000004000000000000000000000000 -Ciphertext: AB137369BE6D93FBB18006BDB236EC09 -Test: Encrypt -Comment: Set 2, vector 30 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000002000000000000000000000000 -Ciphertext: EB90C4E597A7E1779FFA260886E26F75 -Test: Encrypt -Comment: Set 2, vector 31 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000001000000000000000000000000 -Ciphertext: 618CF3588D5C128EAF252616230E08F7 -Test: Encrypt -Comment: Set 2, vector 32 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000800000000000000000000000 -Ciphertext: 98DC4DB49D197AB9152D12B9DE2D73CA -Test: Encrypt -Comment: Set 2, vector 33 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000400000000000000000000000 -Ciphertext: 5BDDE24B15702A35E1F140C57D206443 -Test: Encrypt -Comment: Set 2, vector 34 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000200000000000000000000000 -Ciphertext: CF755809882BED8BA2F9F1A4ED296A2B -Test: Encrypt -Comment: Set 2, vector 35 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000100000000000000000000000 -Ciphertext: F1A8DBB999538AE89D16F92A7F4D1DF1 -Test: Encrypt -Comment: Set 2, vector 36 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000080000000000000000000000 -Ciphertext: 775222FDDAAECB81CF675C4E0B98179E -Test: Encrypt -Comment: Set 2, vector 37 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000040000000000000000000000 -Ciphertext: 12A648CADCD153C760A965826683119A -Test: Encrypt -Comment: Set 2, vector 38 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000020000000000000000000000 -Ciphertext: 0503FB10AB241E7CF45D8CDEEE474335 -Test: Encrypt -Comment: Set 2, vector 39 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000010000000000000000000000 -Ciphertext: 3D299C0070CBBD831B802690B8E7CA24 -Test: Encrypt -Comment: Set 2, vector 40 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000008000000000000000000000 -Ciphertext: 33105BD4D11D66753DC34D128BEFE3F4 -Test: Encrypt -Comment: Set 2, vector 41 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000004000000000000000000000 -Ciphertext: 5EFCE2B4B987C0F77D27B44836881682 -Test: Encrypt -Comment: Set 2, vector 42 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000002000000000000000000000 -Ciphertext: 7835449454128035D7F0EA99E327577B -Test: Encrypt -Comment: Set 2, vector 43 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000001000000000000000000000 -Ciphertext: 27BEDDA0601BE35122FB1D272D73AB3E -Test: Encrypt -Comment: Set 2, vector 44 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000800000000000000000000 -Ciphertext: 54C3F99FF48E318CC515EDE75800C4B3 -Test: Encrypt -Comment: Set 2, vector 45 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000400000000000000000000 -Ciphertext: C627C329F8E48299F6FDB23B9DBEA0BB -Test: Encrypt -Comment: Set 2, vector 46 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000200000000000000000000 -Ciphertext: 1B6578F9E23BD8C1845A02431C5F9AA3 -Test: Encrypt -Comment: Set 2, vector 47 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000100000000000000000000 -Ciphertext: 6DB2FB8C0B9344D0547C0FF1292020C6 -Test: Encrypt -Comment: Set 2, vector 48 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000080000000000000000000 -Ciphertext: 4FAD9B2C37C131493FBEF53581FA4F83 -Test: Encrypt -Comment: Set 2, vector 49 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000040000000000000000000 -Ciphertext: 47502A01E93D2C87BD5584F6AFD3D99D -Test: Encrypt -Comment: Set 2, vector 50 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000020000000000000000000 -Ciphertext: 056E1C6F651BFE50271B3B7A18E76D84 -Test: Encrypt -Comment: Set 2, vector 51 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000010000000000000000000 -Ciphertext: 5632BAF6627B3D96AD4E06FA6A561F55 -Test: Encrypt -Comment: Set 2, vector 52 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000008000000000000000000 -Ciphertext: E29807CAACDFA2D41A7D9E91FA7FD8EB -Test: Encrypt -Comment: Set 2, vector 53 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000004000000000000000000 -Ciphertext: 81DD44BB5D1822DEE605F9E6FF01D7B3 -Test: Encrypt -Comment: Set 2, vector 54 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000002000000000000000000 -Ciphertext: 5C3649925E47D7FF96482A8FBD9666FD -Test: Encrypt -Comment: Set 2, vector 55 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000001000000000000000000 -Ciphertext: 695415A836E66E737887845EC08A1ADB -Test: Encrypt -Comment: Set 2, vector 56 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000800000000000000000 -Ciphertext: F5416BCE292D9E2CEA5D1CC70BBAEED1 -Test: Encrypt -Comment: Set 2, vector 57 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000400000000000000000 -Ciphertext: 7AEC4F1388FC29C47F7FED74ADDE8485 -Test: Encrypt -Comment: Set 2, vector 58 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000200000000000000000 -Ciphertext: 82A9F1A6CE08BC4876E649D8A8EA7EB6 -Test: Encrypt -Comment: Set 2, vector 59 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000100000000000000000 -Ciphertext: B6296C88ADF1A792908B065EEB04BFC2 -Test: Encrypt -Comment: Set 2, vector 60 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000080000000000000000 -Ciphertext: E766A39AECCA40BDBFBE6FF3FA292913 -Test: Encrypt -Comment: Set 2, vector 61 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000040000000000000000 -Ciphertext: C6D081454EA00D83C23B5A62C84359E1 -Test: Encrypt -Comment: Set 2, vector 62 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000020000000000000000 -Ciphertext: 85D259A79CCA80484504D1603F7A8F53 -Test: Encrypt -Comment: Set 2, vector 63 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000010000000000000000 -Ciphertext: D8291FA1C6DC250078824B2D0A20883F -Test: Encrypt -Comment: Set 2, vector 64 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000008000000000000000 -Ciphertext: 95387CB74C48FFBD1F8D64A6CC45E074 -Test: Encrypt -Comment: Set 2, vector 65 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000004000000000000000 -Ciphertext: A17F975F538F56CDF629B516011DE837 -Test: Encrypt -Comment: Set 2, vector 66 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000002000000000000000 -Ciphertext: B50B615A1654C6E1CB6AB33716C097FE -Test: Encrypt -Comment: Set 2, vector 67 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000001000000000000000 -Ciphertext: 7BBB2CBB874DF6C8B821DA7FB0F9011B -Test: Encrypt -Comment: Set 2, vector 68 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000800000000000000 -Ciphertext: E9EFE074D096A275E47CD2E6206DF6A1 -Test: Encrypt -Comment: Set 2, vector 69 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000400000000000000 -Ciphertext: 88F2F8D5A836406AE8BBB98C65BBDA55 -Test: Encrypt -Comment: Set 2, vector 70 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000200000000000000 -Ciphertext: F64620D8D87585A3EF038B9AD58F5EA0 -Test: Encrypt -Comment: Set 2, vector 71 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000100000000000000 -Ciphertext: 694438EC141C8ED5F2F898B4554A298F -Test: Encrypt -Comment: Set 2, vector 72 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000080000000000000 -Ciphertext: 3E6226EC7726A1EE5F5FA9B18CCE8C44 -Test: Encrypt -Comment: Set 2, vector 73 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000040000000000000 -Ciphertext: 8AB6949E79911647800B9E87362AB97A -Test: Encrypt -Comment: Set 2, vector 74 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000020000000000000 -Ciphertext: 093C5CF24EDAF7F9F1C8A80DE4FF50A9 -Test: Encrypt -Comment: Set 2, vector 75 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000010000000000000 -Ciphertext: 28A36E50061F19E240351ED0E378CBF4 -Test: Encrypt -Comment: Set 2, vector 76 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000008000000000000 -Ciphertext: B93BB36CB88BF26EA79198652AA51D3C -Test: Encrypt -Comment: Set 2, vector 77 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000004000000000000 -Ciphertext: DE4948083D044FAC9BCA6DA8CD67B8A6 -Test: Encrypt -Comment: Set 2, vector 78 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000002000000000000 -Ciphertext: 6E778B5BDA6CA118117E47470D080D3C -Test: Encrypt -Comment: Set 2, vector 79 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000001000000000000 -Ciphertext: 0A9107324DA32B4281D032A3487EF875 -Test: Encrypt -Comment: Set 2, vector 80 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000800000000000 -Ciphertext: 18ED5635312D71ABD123CCE779D4D68A -Test: Encrypt -Comment: Set 2, vector 81 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000400000000000 -Ciphertext: 2E3C63F95C4BC1F944BAB06DEDC9AA8E -Test: Encrypt -Comment: Set 2, vector 82 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000200000000000 -Ciphertext: ACCC869EF07004C8C3C709083BE7BA2F -Test: Encrypt -Comment: Set 2, vector 83 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000100000000000 -Ciphertext: DF60B34FB1A59147CC1FB049C1578206 -Test: Encrypt -Comment: Set 2, vector 84 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000080000000000 -Ciphertext: 4228DC636C08E41021054AA0E1E2227A -Test: Encrypt -Comment: Set 2, vector 85 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000040000000000 -Ciphertext: 7CE27F66EFD735FFD6B3E1738C50495B -Test: Encrypt -Comment: Set 2, vector 86 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000020000000000 -Ciphertext: F8E74B33A9CDE351DA0BBC06D69093D7 -Test: Encrypt -Comment: Set 2, vector 87 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000010000000000 -Ciphertext: AE0D22A5B37B8DC5D81CC641EED334D0 -Test: Encrypt -Comment: Set 2, vector 88 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000008000000000 -Ciphertext: C181C6CA5E163743458B9167A0B6A16A -Test: Encrypt -Comment: Set 2, vector 89 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000004000000000 -Ciphertext: 5171F4F6095E4B276CFBA1F07223FBE6 -Test: Encrypt -Comment: Set 2, vector 90 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000002000000000 -Ciphertext: 2732F4D3A8C9D1D8D493840D6E0B864F -Test: Encrypt -Comment: Set 2, vector 91 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000001000000000 -Ciphertext: 3EF04E0059A061D973532CA5C1DFBE7B -Test: Encrypt -Comment: Set 2, vector 92 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000800000000 -Ciphertext: 6D9A8F23579E4978EBAA87B5ADEB77E5 -Test: Encrypt -Comment: Set 2, vector 93 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000400000000 -Ciphertext: BBD08873CC44BA4253C0C41FEEB7F124 -Test: Encrypt -Comment: Set 2, vector 94 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000200000000 -Ciphertext: 72E4B2437CBD283F3809CE686F6A591E -Test: Encrypt -Comment: Set 2, vector 95 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000100000000 -Ciphertext: 6E5580514B92512B1BF4B1B987B9AA1B -Test: Encrypt -Comment: Set 2, vector 96 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000080000000 -Ciphertext: 5EF5D0C5BCBDCB604D3A083B68CE0FA3 -Test: Encrypt -Comment: Set 2, vector 97 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000040000000 -Ciphertext: 9D991FDD723AD2182777A15CA0E0F665 -Test: Encrypt -Comment: Set 2, vector 98 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000020000000 -Ciphertext: 24440626EFC8F86BEA7DE78085AB8A22 -Test: Encrypt -Comment: Set 2, vector 99 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000010000000 -Ciphertext: 17C3630D62D13C1E826C0FCCBD74A864 -Test: Encrypt -Comment: Set 2, vector 100 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000008000000 -Ciphertext: 4CF5AB86A56AB134A7FE46CCE3F9FCE9 -Test: Encrypt -Comment: Set 2, vector 101 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000004000000 -Ciphertext: 3E6B9C0388F6D9B8F458F30221907607 -Test: Encrypt -Comment: Set 2, vector 102 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000002000000 -Ciphertext: AD9C926B8A5CD98EEE88200617E59958 -Test: Encrypt -Comment: Set 2, vector 103 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000001000000 -Ciphertext: AFF8AED5E075E02AF720CA4BF0028B3B -Test: Encrypt -Comment: Set 2, vector 104 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000800000 -Ciphertext: D90EAFF909202BB209BB3BB8C7F9A954 -Test: Encrypt -Comment: Set 2, vector 105 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000400000 -Ciphertext: 2C709B00E6A22F00F64A7D8EE341853F -Test: Encrypt -Comment: Set 2, vector 106 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000200000 -Ciphertext: CCEC598F0D9F0BF201B2F487136D54A4 -Test: Encrypt -Comment: Set 2, vector 107 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000100000 -Ciphertext: 73B2883A0A166AAE1BF14E60A5195FA3 -Test: Encrypt -Comment: Set 2, vector 108 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000080000 -Ciphertext: E676867BD9AD5EF915143388496779D7 -Test: Encrypt -Comment: Set 2, vector 109 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000040000 -Ciphertext: CDCB73D1BFCFD4BE7F1DAA9B1C6A4055 -Test: Encrypt -Comment: Set 2, vector 110 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000020000 -Ciphertext: 02A3A5C89DAA24CD2C517F7A73286A89 -Test: Encrypt -Comment: Set 2, vector 111 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000010000 -Ciphertext: C0FA2AC9E92EE58C2DD12D6D43AB7035 -Test: Encrypt -Comment: Set 2, vector 112 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000008000 -Ciphertext: EDC2CB1F7291353BDBF2385519E6AE16 -Test: Encrypt -Comment: Set 2, vector 113 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000004000 -Ciphertext: B4B62D16D197A98CD3B978812B9D9884 -Test: Encrypt -Comment: Set 2, vector 114 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000002000 -Ciphertext: 5CDFC95A529A905101CEA26BC1B891ED -Test: Encrypt -Comment: Set 2, vector 115 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000001000 -Ciphertext: CC7150CD3650B98363296C7C4ED368D1 -Test: Encrypt -Comment: Set 2, vector 116 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000800 -Ciphertext: CC57706B0C6526B8E25A5DBD32EACBDB -Test: Encrypt -Comment: Set 2, vector 117 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000400 -Ciphertext: 30D30456AD98B182D64C649648F6AEC9 -Test: Encrypt -Comment: Set 2, vector 118 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000200 -Ciphertext: D7E9DA7F631938EB649A08AF82FBD75F -Test: Encrypt -Comment: Set 2, vector 119 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000100 -Ciphertext: B8DA2AF6600B07895B5D0FFAF4991469 -Test: Encrypt -Comment: Set 2, vector 120 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000080 -Ciphertext: 0F6F64F930BA6C178943322B98114599 -Test: Encrypt -Comment: Set 2, vector 121 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000040 -Ciphertext: 8B1F247802E47C91BEE2AA34ECFD7A01 -Test: Encrypt -Comment: Set 2, vector 122 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000020 -Ciphertext: 7A6985778D3A66E97F23E01F0D0E45E7 -Test: Encrypt -Comment: Set 2, vector 123 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000010 -Ciphertext: BA664AC39855518DFDEE10D1B3111FAE -Test: Encrypt -Comment: Set 2, vector 124 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000008 -Ciphertext: 7C92854D801A1648F65CA81813DDBF83 -Test: Encrypt -Comment: Set 2, vector 125 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000004 -Ciphertext: 6A3F25AAB7E92D9CF378E5D9C040F26B -Test: Encrypt -Comment: Set 2, vector 126 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000002 -Ciphertext: 3D4B2CDE666761BA5DFB305178E667FB -Test: Encrypt -Comment: Set 2, vector 127 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000001 -Ciphertext: 9CDB269B5D293BC5DB9C55B057D9B591 -Test: Encrypt -Comment: Set 3, vector 0 -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 396154111ADEFC500CF6E5C99038BC17 -Test: Encrypt -Comment: Set 3, vector 1 -Key: 0101010101010101010101010101010101010101010101010101010101010101 -Plaintext: 01010101010101010101010101010101 -Ciphertext: 438D0C2E7E86869B56EBA23B66086A01 -Test: Encrypt -Comment: Set 3, vector 2 -Key: 0202020202020202020202020202020202020202020202020202020202020202 -Plaintext: 02020202020202020202020202020202 -Ciphertext: D4F553BFA794F55EF3B7A578629F6DEA -Test: Encrypt -Comment: Set 3, vector 3 -Key: 0303030303030303030303030303030303030303030303030303030303030303 -Plaintext: 03030303030303030303030303030303 -Ciphertext: B1EB06630CF3E25AEF18FA34709232F7 -Test: Encrypt -Comment: Set 3, vector 4 -Key: 0404040404040404040404040404040404040404040404040404040404040404 -Plaintext: 04040404040404040404040404040404 -Ciphertext: 5E858730ABC9823A93CA4CAB67F0B423 -Test: Encrypt -Comment: Set 3, vector 5 -Key: 0505050505050505050505050505050505050505050505050505050505050505 -Plaintext: 05050505050505050505050505050505 -Ciphertext: 9FC988D43FE3712CF6D2DB552FE3C80F -Test: Encrypt -Comment: Set 3, vector 6 -Key: 0606060606060606060606060606060606060606060606060606060606060606 -Plaintext: 06060606060606060606060606060606 -Ciphertext: 6109500D59414C9974D15818A2BA6DD0 -Test: Encrypt -Comment: Set 3, vector 7 -Key: 0707070707070707070707070707070707070707070707070707070707070707 -Plaintext: 07070707070707070707070707070707 -Ciphertext: 5F6BF9AC53A680EACAE7583A8933DA8E -Test: Encrypt -Comment: Set 3, vector 8 -Key: 0808080808080808080808080808080808080808080808080808080808080808 -Plaintext: 08080808080808080808080808080808 -Ciphertext: F9A9C1540AE1B314DBEDF9A49054DC9D -Test: Encrypt -Comment: Set 3, vector 9 -Key: 0909090909090909090909090909090909090909090909090909090909090909 -Plaintext: 09090909090909090909090909090909 -Ciphertext: 6D66755ACDB9D90BEC599A0BC0C7BF48 -Test: Encrypt -Comment: Set 3, vector 10 -Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Ciphertext: 5527F328AF93C2D5CCC80AF7A3E8DF3D -Test: Encrypt -Comment: Set 3, vector 11 -Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Ciphertext: 27AA99F8E6EA08D8E8D5A528EE4774B6 -Test: Encrypt -Comment: Set 3, vector 12 -Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Ciphertext: 46F7D660A22232F5E3664EF355098CE4 -Test: Encrypt -Comment: Set 3, vector 13 -Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Ciphertext: BDC0AEC72B53B747AB5C7BD62062826A -Test: Encrypt -Comment: Set 3, vector 14 -Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Ciphertext: A0CAB391DC8BFF0281F3E1C70C1CE33B -Test: Encrypt -Comment: Set 3, vector 15 -Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Ciphertext: 5CBFB3E894AE1428549CCF777A9F0A73 -Test: Encrypt -Comment: Set 3, vector 16 -Key: 1010101010101010101010101010101010101010101010101010101010101010 -Plaintext: 10101010101010101010101010101010 -Ciphertext: 6693FC130669F194F81E8D175194DDA2 -Test: Encrypt -Comment: Set 3, vector 17 -Key: 1111111111111111111111111111111111111111111111111111111111111111 -Plaintext: 11111111111111111111111111111111 -Ciphertext: A6A72472F8C04329C0E2FB56982A33C7 -Test: Encrypt -Comment: Set 3, vector 18 -Key: 1212121212121212121212121212121212121212121212121212121212121212 -Plaintext: 12121212121212121212121212121212 -Ciphertext: 6321875C5F89CCE16C6FF5E85E759C9A -Test: Encrypt -Comment: Set 3, vector 19 -Key: 1313131313131313131313131313131313131313131313131313131313131313 -Plaintext: 13131313131313131313131313131313 -Ciphertext: 8819C97D05C91A23062E9851F07EF6F7 -Test: Encrypt -Comment: Set 3, vector 20 -Key: 1414141414141414141414141414141414141414141414141414141414141414 -Plaintext: 14141414141414141414141414141414 -Ciphertext: F894FEB12164BB32AC846DD9530604CE -Test: Encrypt -Comment: Set 3, vector 21 -Key: 1515151515151515151515151515151515151515151515151515151515151515 -Plaintext: 15151515151515151515151515151515 -Ciphertext: 61B02392CD3F571B35C862E703DB2053 -Test: Encrypt -Comment: Set 3, vector 22 -Key: 1616161616161616161616161616161616161616161616161616161616161616 -Plaintext: 16161616161616161616161616161616 -Ciphertext: 6269E137F8480D555D1B24F392162DBA -Test: Encrypt -Comment: Set 3, vector 23 -Key: 1717171717171717171717171717171717171717171717171717171717171717 -Plaintext: 17171717171717171717171717171717 -Ciphertext: B6662F56AA3D23DE1DFDE165B2D63FA0 -Test: Encrypt -Comment: Set 3, vector 24 -Key: 1818181818181818181818181818181818181818181818181818181818181818 -Plaintext: 18181818181818181818181818181818 -Ciphertext: C8271ACE969013EE2C9EF1512FFABAE5 -Test: Encrypt -Comment: Set 3, vector 25 -Key: 1919191919191919191919191919191919191919191919191919191919191919 -Plaintext: 19191919191919191919191919191919 -Ciphertext: 6982E764E750CDF3E5F9C4E40A5DFE28 -Test: Encrypt -Comment: Set 3, vector 26 -Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Ciphertext: 23172E86AF4A140A78CB1DC776270FFF -Test: Encrypt -Comment: Set 3, vector 27 -Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Ciphertext: BA0BD958FC1DE142EC40326B2C315AA5 -Test: Encrypt -Comment: Set 3, vector 28 -Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Ciphertext: 7FB2B8A4B95CBFB74BFD5F7A5641261C -Test: Encrypt -Comment: Set 3, vector 29 -Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Ciphertext: 56B261D89F8978041E2602DF97386BF7 -Test: Encrypt -Comment: Set 3, vector 30 -Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Ciphertext: A2D74F5148C84C1F990290E17DD3EDFA -Test: Encrypt -Comment: Set 3, vector 31 -Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Ciphertext: 7D8BC76F1D941FC3C7E4C6F17AC03FF4 -Test: Encrypt -Comment: Set 3, vector 32 -Key: 2020202020202020202020202020202020202020202020202020202020202020 -Plaintext: 20202020202020202020202020202020 -Ciphertext: F3E1FDA6B9C8314799F4654C29F1C690 -Test: Encrypt -Comment: Set 3, vector 33 -Key: 2121212121212121212121212121212121212121212121212121212121212121 -Plaintext: 21212121212121212121212121212121 -Ciphertext: 9BB8499B8631F6211D22DE555010E482 -Test: Encrypt -Comment: Set 3, vector 34 -Key: 2222222222222222222222222222222222222222222222222222222222222222 -Plaintext: 22222222222222222222222222222222 -Ciphertext: B098D857086ABC425B437BD63E8A53D2 -Test: Encrypt -Comment: Set 3, vector 35 -Key: 2323232323232323232323232323232323232323232323232323232323232323 -Plaintext: 23232323232323232323232323232323 -Ciphertext: F157E2B1298A205C7EF526F3E3196BF4 -Test: Encrypt -Comment: Set 3, vector 36 -Key: 2424242424242424242424242424242424242424242424242424242424242424 -Plaintext: 24242424242424242424242424242424 -Ciphertext: 91FE4F664ED2FE0097D8B95703694BBE -Test: Encrypt -Comment: Set 3, vector 37 -Key: 2525252525252525252525252525252525252525252525252525252525252525 -Plaintext: 25252525252525252525252525252525 -Ciphertext: 742EF3C2DC4490F7D1BDB3031137B6C1 -Test: Encrypt -Comment: Set 3, vector 38 -Key: 2626262626262626262626262626262626262626262626262626262626262626 -Plaintext: 26262626262626262626262626262626 -Ciphertext: 79302D9C8DBBBDAD7B8D8B9E7A60E42D -Test: Encrypt -Comment: Set 3, vector 39 -Key: 2727272727272727272727272727272727272727272727272727272727272727 -Plaintext: 27272727272727272727272727272727 -Ciphertext: 4F4DA48026B809452E7FFB1C3DAFBD99 -Test: Encrypt -Comment: Set 3, vector 40 -Key: 2828282828282828282828282828282828282828282828282828282828282828 -Plaintext: 28282828282828282828282828282828 -Ciphertext: 6D9DF175ED0DAFE550619CF8362B98E8 -Test: Encrypt -Comment: Set 3, vector 41 -Key: 2929292929292929292929292929292929292929292929292929292929292929 -Plaintext: 29292929292929292929292929292929 -Ciphertext: 5D4A406E3C89612AA89A9D38A80ECFEF -Test: Encrypt -Comment: Set 3, vector 42 -Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Ciphertext: 51CE933AD1EB3117A129788D3D0B815A -Test: Encrypt -Comment: Set 3, vector 43 -Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Ciphertext: DD39326230AC02767866ADE07AED1DAA -Test: Encrypt -Comment: Set 3, vector 44 -Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Ciphertext: DC493BAD40D435273B18026DE5412278 -Test: Encrypt -Comment: Set 3, vector 45 -Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Ciphertext: 8A61E9750E1DAC58C92F5E243CA7465B -Test: Encrypt -Comment: Set 3, vector 46 -Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Ciphertext: 57A7641E6A7B61A86AFD7A23578DFBC5 -Test: Encrypt -Comment: Set 3, vector 47 -Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Ciphertext: 019A8F9D38B4B92B077D08B025C15550 -Test: Encrypt -Comment: Set 3, vector 48 -Key: 3030303030303030303030303030303030303030303030303030303030303030 -Plaintext: 30303030303030303030303030303030 -Ciphertext: 9F6EEA9C215C273135C53A3F4208469E -Test: Encrypt -Comment: Set 3, vector 49 -Key: 3131313131313131313131313131313131313131313131313131313131313131 -Plaintext: 31313131313131313131313131313131 -Ciphertext: 7BF3D63D790CAB57EA8354B10FEBDE18 -Test: Encrypt -Comment: Set 3, vector 50 -Key: 3232323232323232323232323232323232323232323232323232323232323232 -Plaintext: 32323232323232323232323232323232 -Ciphertext: AB30751ED4052A1D916E50C4073DFCB5 -Test: Encrypt -Comment: Set 3, vector 51 -Key: 3333333333333333333333333333333333333333333333333333333333333333 -Plaintext: 33333333333333333333333333333333 -Ciphertext: C39180F205BBA8BEE9832BF56FCC75C0 -Test: Encrypt -Comment: Set 3, vector 52 -Key: 3434343434343434343434343434343434343434343434343434343434343434 -Plaintext: 34343434343434343434343434343434 -Ciphertext: 3BEDE5E09CB9CCFC8BE38F8378D49AE9 -Test: Encrypt -Comment: Set 3, vector 53 -Key: 3535353535353535353535353535353535353535353535353535353535353535 -Plaintext: 35353535353535353535353535353535 -Ciphertext: 448AE4ADF7070A8B8C4AB0FE7277E8D7 -Test: Encrypt -Comment: Set 3, vector 54 -Key: 3636363636363636363636363636363636363636363636363636363636363636 -Plaintext: 36363636363636363636363636363636 -Ciphertext: 095A361F2243FC39F4ECD94A5AC0F94A -Test: Encrypt -Comment: Set 3, vector 55 -Key: 3737373737373737373737373737373737373737373737373737373737373737 -Plaintext: 37373737373737373737373737373737 -Ciphertext: AD77D7D2A7F3AF5732CE5A51E83D7025 -Test: Encrypt -Comment: Set 3, vector 56 -Key: 3838383838383838383838383838383838383838383838383838383838383838 -Plaintext: 38383838383838383838383838383838 -Ciphertext: 930DA09C18DF5F6D072AA662CC8F7751 -Test: Encrypt -Comment: Set 3, vector 57 -Key: 3939393939393939393939393939393939393939393939393939393939393939 -Plaintext: 39393939393939393939393939393939 -Ciphertext: F3B3871B66FE8A1FA4AE2150EC8B7060 -Test: Encrypt -Comment: Set 3, vector 58 -Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Ciphertext: 62DD93CFA7EFC223A822A6F754B6298D -Test: Encrypt -Comment: Set 3, vector 59 -Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Ciphertext: C86A0377B3C45C2B1896829D7B0610F3 -Test: Encrypt -Comment: Set 3, vector 60 -Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Ciphertext: 8CCFC961EBAB55C0ECB1B10EDEDD9C61 -Test: Encrypt -Comment: Set 3, vector 61 -Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Ciphertext: D828E857BDBD6192300764A2084E0680 -Test: Encrypt -Comment: Set 3, vector 62 -Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Ciphertext: 24C0DC84D72EA678201534CE8DC22A45 -Test: Encrypt -Comment: Set 3, vector 63 -Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Ciphertext: D65F340A25D35E5D0B08C63FA44F9898 -Test: Encrypt -Comment: Set 3, vector 64 -Key: 4040404040404040404040404040404040404040404040404040404040404040 -Plaintext: 40404040404040404040404040404040 -Ciphertext: 4A30476F1141FBF303ED63FCD3CB0536 -Test: Encrypt -Comment: Set 3, vector 65 -Key: 4141414141414141414141414141414141414141414141414141414141414141 -Plaintext: 41414141414141414141414141414141 -Ciphertext: 78246080B38B5283960E0253E2FF6A5E -Test: Encrypt -Comment: Set 3, vector 66 -Key: 4242424242424242424242424242424242424242424242424242424242424242 -Plaintext: 42424242424242424242424242424242 -Ciphertext: 475E8388EE3D3EE111DD0E816B244DD2 -Test: Encrypt -Comment: Set 3, vector 67 -Key: 4343434343434343434343434343434343434343434343434343434343434343 -Plaintext: 43434343434343434343434343434343 -Ciphertext: D40D3FECE8B05875F2FCD23526CCD6B2 -Test: Encrypt -Comment: Set 3, vector 68 -Key: 4444444444444444444444444444444444444444444444444444444444444444 -Plaintext: 44444444444444444444444444444444 -Ciphertext: CD9846E1B120482E6B6D71C4F5D704FE -Test: Encrypt -Comment: Set 3, vector 69 -Key: 4545454545454545454545454545454545454545454545454545454545454545 -Plaintext: 45454545454545454545454545454545 -Ciphertext: E707C35474257CE52617B5889ECB974B -Test: Encrypt -Comment: Set 3, vector 70 -Key: 4646464646464646464646464646464646464646464646464646464646464646 -Plaintext: 46464646464646464646464646464646 -Ciphertext: 9A79D57FD89D938F4B4CACA52E8CB544 -Test: Encrypt -Comment: Set 3, vector 71 -Key: 4747474747474747474747474747474747474747474747474747474747474747 -Plaintext: 47474747474747474747474747474747 -Ciphertext: 34F9B98AC130F7E7B123ECBF8910735C -Test: Encrypt -Comment: Set 3, vector 72 -Key: 4848484848484848484848484848484848484848484848484848484848484848 -Plaintext: 48484848484848484848484848484848 -Ciphertext: BF75CC83FE76E8A15981DA738E5A8513 -Test: Encrypt -Comment: Set 3, vector 73 -Key: 4949494949494949494949494949494949494949494949494949494949494949 -Plaintext: 49494949494949494949494949494949 -Ciphertext: 4A452EFBE634441444FB50641CB2EFC1 -Test: Encrypt -Comment: Set 3, vector 74 -Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Ciphertext: 3D5ED11F0C81E81BAB97B7148D67BA55 -Test: Encrypt -Comment: Set 3, vector 75 -Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Ciphertext: DBBAE78B177C27954DEDBAD5D98E7BEE -Test: Encrypt -Comment: Set 3, vector 76 -Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Ciphertext: F52D16EFC5DE991430F6E7D13983DEB8 -Test: Encrypt -Comment: Set 3, vector 77 -Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Ciphertext: B6C98EBC320B3BDD927C2FE57F8180B5 -Test: Encrypt -Comment: Set 3, vector 78 -Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Ciphertext: D510C35680C9B958C81599F3665FBEC1 -Test: Encrypt -Comment: Set 3, vector 79 -Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Ciphertext: 72DAD08BF510CDFEEC76FEAB908829B4 -Test: Encrypt -Comment: Set 3, vector 80 -Key: 5050505050505050505050505050505050505050505050505050505050505050 -Plaintext: 50505050505050505050505050505050 -Ciphertext: AC7B447EDB38F935469309E766BCB1F6 -Test: Encrypt -Comment: Set 3, vector 81 -Key: 5151515151515151515151515151515151515151515151515151515151515151 -Plaintext: 51515151515151515151515151515151 -Ciphertext: 18B937F666BF580F9CDB60A935427459 -Test: Encrypt -Comment: Set 3, vector 82 -Key: 5252525252525252525252525252525252525252525252525252525252525252 -Plaintext: 52525252525252525252525252525252 -Ciphertext: 6A08B38202685E610CA9584725D6092A -Test: Encrypt -Comment: Set 3, vector 83 -Key: 5353535353535353535353535353535353535353535353535353535353535353 -Plaintext: 53535353535353535353535353535353 -Ciphertext: 1CA09E9C14C2A833A7B7ACB1C9C12AC1 -Test: Encrypt -Comment: Set 3, vector 84 -Key: 5454545454545454545454545454545454545454545454545454545454545454 -Plaintext: 54545454545454545454545454545454 -Ciphertext: 8AB7ED64FE477B7D9A6B5B5056EA1E02 -Test: Encrypt -Comment: Set 3, vector 85 -Key: 5555555555555555555555555555555555555555555555555555555555555555 -Plaintext: 55555555555555555555555555555555 -Ciphertext: D610D6199D4FE03ED09AD568664F709A -Test: Encrypt -Comment: Set 3, vector 86 -Key: 5656565656565656565656565656565656565656565656565656565656565656 -Plaintext: 56565656565656565656565656565656 -Ciphertext: D400C1E6109F04AE50C1C341BA4E3175 -Test: Encrypt -Comment: Set 3, vector 87 -Key: 5757575757575757575757575757575757575757575757575757575757575757 -Plaintext: 57575757575757575757575757575757 -Ciphertext: DF888CBB7DBD8DE3F0BE6C6EDC72060F -Test: Encrypt -Comment: Set 3, vector 88 -Key: 5858585858585858585858585858585858585858585858585858585858585858 -Plaintext: 58585858585858585858585858585858 -Ciphertext: 9C3B100466C63AA93D420EDF54381BF4 -Test: Encrypt -Comment: Set 3, vector 89 -Key: 5959595959595959595959595959595959595959595959595959595959595959 -Plaintext: 59595959595959595959595959595959 -Ciphertext: 0BE794F0233BE9A7DB7C41A1CA4BA7E3 -Test: Encrypt -Comment: Set 3, vector 90 -Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Ciphertext: 2C8D04D6B9DA81D07174729A07F25BB9 -Test: Encrypt -Comment: Set 3, vector 91 -Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Ciphertext: FFCEB69835E2E5EF4C867CE28540F91F -Test: Encrypt -Comment: Set 3, vector 92 -Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Ciphertext: A7F7F8437918BEFF5DCFCFB366CDFABD -Test: Encrypt -Comment: Set 3, vector 93 -Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Ciphertext: 14C9736F407AE78D7D3ED18B875B940D -Test: Encrypt -Comment: Set 3, vector 94 -Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Ciphertext: 1668A0C6A5734B98D9D641E0B6FAD80C -Test: Encrypt -Comment: Set 3, vector 95 -Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Ciphertext: DA8775267C9722BA743A085F8591F06D -Test: Encrypt -Comment: Set 3, vector 96 -Key: 6060606060606060606060606060606060606060606060606060606060606060 -Plaintext: 60606060606060606060606060606060 -Ciphertext: 5F8172C28603C80206C276E0979EA40E -Test: Encrypt -Comment: Set 3, vector 97 -Key: 6161616161616161616161616161616161616161616161616161616161616161 -Plaintext: 61616161616161616161616161616161 -Ciphertext: E4938D0078D29E0247BF2EA0C1FCB85F -Test: Encrypt -Comment: Set 3, vector 98 -Key: 6262626262626262626262626262626262626262626262626262626262626262 -Plaintext: 62626262626262626262626262626262 -Ciphertext: A48FEE4F9FA4597303C2CF92061304A1 -Test: Encrypt -Comment: Set 3, vector 99 -Key: 6363636363636363636363636363636363636363636363636363636363636363 -Plaintext: 63636363636363636363636363636363 -Ciphertext: 3C8F6CF66C73684DDB09D1AA57CD0950 -Test: Encrypt -Comment: Set 3, vector 100 -Key: 6464646464646464646464646464646464646464646464646464646464646464 -Plaintext: 64646464646464646464646464646464 -Ciphertext: B3D9EE0337253E9C4027FEA938AB399C -Test: Encrypt -Comment: Set 3, vector 101 -Key: 6565656565656565656565656565656565656565656565656565656565656565 -Plaintext: 65656565656565656565656565656565 -Ciphertext: 3BE933A85E5997573077903CEB481AFA -Test: Encrypt -Comment: Set 3, vector 102 -Key: 6666666666666666666666666666666666666666666666666666666666666666 -Plaintext: 66666666666666666666666666666666 -Ciphertext: 06AFED96C6E7130EB3311D81CCE69F9C -Test: Encrypt -Comment: Set 3, vector 103 -Key: 6767676767676767676767676767676767676767676767676767676767676767 -Plaintext: 67676767676767676767676767676767 -Ciphertext: 183C3606139211F90F4849E93DB7DDEE -Test: Encrypt -Comment: Set 3, vector 104 -Key: 6868686868686868686868686868686868686868686868686868686868686868 -Plaintext: 68686868686868686868686868686868 -Ciphertext: 217C34184950DE7B43E46EE4BE88A9BE -Test: Encrypt -Comment: Set 3, vector 105 -Key: 6969696969696969696969696969696969696969696969696969696969696969 -Plaintext: 69696969696969696969696969696969 -Ciphertext: CA447ED204F2A4B2ED6B82E3926967B1 -Test: Encrypt -Comment: Set 3, vector 106 -Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Ciphertext: B447F4BEBA7D88A5C62E5F9C316A4523 -Test: Encrypt -Comment: Set 3, vector 107 -Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Ciphertext: DEDF599C54D0009795303013CD933B49 -Test: Encrypt -Comment: Set 3, vector 108 -Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Ciphertext: B06280650C77C83AF3D71874AE00D3DA -Test: Encrypt -Comment: Set 3, vector 109 -Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Ciphertext: 1BB5B9E9C7DC8AD690F5FC217B7B53C1 -Test: Encrypt -Comment: Set 3, vector 110 -Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Ciphertext: FEECFCF0C172C6152F33E4DEE206EBCF -Test: Encrypt -Comment: Set 3, vector 111 -Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Ciphertext: FA4C7EA42C425F37588CD273320940C9 -Test: Encrypt -Comment: Set 3, vector 112 -Key: 7070707070707070707070707070707070707070707070707070707070707070 -Plaintext: 70707070707070707070707070707070 -Ciphertext: 563AE5884FC374C4E45B96A6431E51E3 -Test: Encrypt -Comment: Set 3, vector 113 -Key: 7171717171717171717171717171717171717171717171717171717171717171 -Plaintext: 71717171717171717171717171717171 -Ciphertext: 0669E609578A33DBE637C5B86C7F425D -Test: Encrypt -Comment: Set 3, vector 114 -Key: 7272727272727272727272727272727272727272727272727272727272727272 -Plaintext: 72727272727272727272727272727272 -Ciphertext: B2AD99D3941924DDD2A73C4725A08EC3 -Test: Encrypt -Comment: Set 3, vector 115 -Key: 7373737373737373737373737373737373737373737373737373737373737373 -Plaintext: 73737373737373737373737373737373 -Ciphertext: 72C8239B5F4E5319EE05B6E39C9BD336 -Test: Encrypt -Comment: Set 3, vector 116 -Key: 7474747474747474747474747474747474747474747474747474747474747474 -Plaintext: 74747474747474747474747474747474 -Ciphertext: BAD014C4B0A5734AA48E7E80A42E80AF -Test: Encrypt -Comment: Set 3, vector 117 -Key: 7575757575757575757575757575757575757575757575757575757575757575 -Plaintext: 75757575757575757575757575757575 -Ciphertext: BBE294CDB3582B3C1F61ACD43A0E5DB5 -Test: Encrypt -Comment: Set 3, vector 118 -Key: 7676767676767676767676767676767676767676767676767676767676767676 -Plaintext: 76767676767676767676767676767676 -Ciphertext: C231DC35D38F5857BD3449D3E0A1EF1F -Test: Encrypt -Comment: Set 3, vector 119 -Key: 7777777777777777777777777777777777777777777777777777777777777777 -Plaintext: 77777777777777777777777777777777 -Ciphertext: B19E0BACBF3EC295AA6F99B0817B99F3 -Test: Encrypt -Comment: Set 3, vector 120 -Key: 7878787878787878787878787878787878787878787878787878787878787878 -Plaintext: 78787878787878787878787878787878 -Ciphertext: 0E81D1133E74F1A9425237377890584C -Test: Encrypt -Comment: Set 3, vector 121 -Key: 7979797979797979797979797979797979797979797979797979797979797979 -Plaintext: 79797979797979797979797979797979 -Ciphertext: E1149AA17A8B6499E0FA5C45F05D6582 -Test: Encrypt -Comment: Set 3, vector 122 -Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Ciphertext: D9208954D8D28335E6F45FFB9D1B92D4 -Test: Encrypt -Comment: Set 3, vector 123 -Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Ciphertext: DFABDB0594208A2902703E85C4A657FF -Test: Encrypt -Comment: Set 3, vector 124 -Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Ciphertext: E05B6C6E90E852229BF0EFDC4FEB851E -Test: Encrypt -Comment: Set 3, vector 125 -Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Ciphertext: 6834CCFDC940452CF40A0866009E58CC -Test: Encrypt -Comment: Set 3, vector 126 -Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Ciphertext: 91449066A1966246636D9085E02002B0 -Test: Encrypt -Comment: Set 3, vector 127 -Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Ciphertext: 235C2D836B2025CCCDAE4B26264132E2 -Test: Encrypt -Comment: Set 3, vector 128 -Key: 8080808080808080808080808080808080808080808080808080808080808080 -Plaintext: 80808080808080808080808080808080 -Ciphertext: 0C765AA494E048FC8BB23139F2124CB6 -Test: Encrypt -Comment: Set 3, vector 129 -Key: 8181818181818181818181818181818181818181818181818181818181818181 -Plaintext: 81818181818181818181818181818181 -Ciphertext: ED970D660C84642D0EAFF188F55CC33C -Test: Encrypt -Comment: Set 3, vector 130 -Key: 8282828282828282828282828282828282828282828282828282828282828282 -Plaintext: 82828282828282828282828282828282 -Ciphertext: E124EB4A8BE05CA633238DD69E81E057 -Test: Encrypt -Comment: Set 3, vector 131 -Key: 8383838383838383838383838383838383838383838383838383838383838383 -Plaintext: 83838383838383838383838383838383 -Ciphertext: 4653FBDD6CA7C13CE2DF31B1279B3D5A -Test: Encrypt -Comment: Set 3, vector 132 -Key: 8484848484848484848484848484848484848484848484848484848484848484 -Plaintext: 84848484848484848484848484848484 -Ciphertext: 2D4D87CFB763C3974CEBF6AE1C6269D4 -Test: Encrypt -Comment: Set 3, vector 133 -Key: 8585858585858585858585858585858585858585858585858585858585858585 -Plaintext: 85858585858585858585858585858585 -Ciphertext: F153B13F57F1AE16186EF3B1E98549B8 -Test: Encrypt -Comment: Set 3, vector 134 -Key: 8686868686868686868686868686868686868686868686868686868686868686 -Plaintext: 86868686868686868686868686868686 -Ciphertext: 5451DB2B141B894B4892C7F12BE3F389 -Test: Encrypt -Comment: Set 3, vector 135 -Key: 8787878787878787878787878787878787878787878787878787878787878787 -Plaintext: 87878787878787878787878787878787 -Ciphertext: 61B2185653CFF14EE873DBD3CB663E79 -Test: Encrypt -Comment: Set 3, vector 136 -Key: 8888888888888888888888888888888888888888888888888888888888888888 -Plaintext: 88888888888888888888888888888888 -Ciphertext: C17ACB243808B86349D4176EECF602DF -Test: Encrypt -Comment: Set 3, vector 137 -Key: 8989898989898989898989898989898989898989898989898989898989898989 -Plaintext: 89898989898989898989898989898989 -Ciphertext: 6FCE3ED2207D58A5976FE8B20B247275 -Test: Encrypt -Comment: Set 3, vector 138 -Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Ciphertext: 403F73CC70C7F9A5E96CD77D61140961 -Test: Encrypt -Comment: Set 3, vector 139 -Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Ciphertext: DE2B34DECB33550C97D6C074032F3333 -Test: Encrypt -Comment: Set 3, vector 140 -Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Ciphertext: FB395AE4F537F8FB7C98BAD54BDB86A0 -Test: Encrypt -Comment: Set 3, vector 141 -Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Ciphertext: 258E83BB639D0BEDE648F3AF96CC8E75 -Test: Encrypt -Comment: Set 3, vector 142 -Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Ciphertext: A1B5E73720E43FA0871EAAE245B55A0E -Test: Encrypt -Comment: Set 3, vector 143 -Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Ciphertext: 774A9ABE1FAB9E3B85A91C0F86758B0E -Test: Encrypt -Comment: Set 3, vector 144 -Key: 9090909090909090909090909090909090909090909090909090909090909090 -Plaintext: 90909090909090909090909090909090 -Ciphertext: 0A6EC1CF2056076933259AE6A337B185 -Test: Encrypt -Comment: Set 3, vector 145 -Key: 9191919191919191919191919191919191919191919191919191919191919191 -Plaintext: 91919191919191919191919191919191 -Ciphertext: C96729F87D62104F941DC21448756F95 -Test: Encrypt -Comment: Set 3, vector 146 -Key: 9292929292929292929292929292929292929292929292929292929292929292 -Plaintext: 92929292929292929292929292929292 -Ciphertext: 1CB85A610C2250A78143A31BB1C19094 -Test: Encrypt -Comment: Set 3, vector 147 -Key: 9393939393939393939393939393939393939393939393939393939393939393 -Plaintext: 93939393939393939393939393939393 -Ciphertext: 16194ABEDEA340C6D57E4C4F50640FBE -Test: Encrypt -Comment: Set 3, vector 148 -Key: 9494949494949494949494949494949494949494949494949494949494949494 -Plaintext: 94949494949494949494949494949494 -Ciphertext: 379A5A54C198FB03178EE841D67F3502 -Test: Encrypt -Comment: Set 3, vector 149 -Key: 9595959595959595959595959595959595959595959595959595959595959595 -Plaintext: 95959595959595959595959595959595 -Ciphertext: A25119AD8A0F6654ECDB2696CF4F8225 -Test: Encrypt -Comment: Set 3, vector 150 -Key: 9696969696969696969696969696969696969696969696969696969696969696 -Plaintext: 96969696969696969696969696969696 -Ciphertext: 264B7FAAD26DEC203D0DE29CE4F0F45B -Test: Encrypt -Comment: Set 3, vector 151 -Key: 9797979797979797979797979797979797979797979797979797979797979797 -Plaintext: 97979797979797979797979797979797 -Ciphertext: 2EBD2A2CD16284D206D81ACF18122E2E -Test: Encrypt -Comment: Set 3, vector 152 -Key: 9898989898989898989898989898989898989898989898989898989898989898 -Plaintext: 98989898989898989898989898989898 -Ciphertext: 25FB2B75B6915C0543412DF9EBD20FC3 -Test: Encrypt -Comment: Set 3, vector 153 -Key: 9999999999999999999999999999999999999999999999999999999999999999 -Plaintext: 99999999999999999999999999999999 -Ciphertext: 21B89B53845A828E0A14F4AE45940284 -Test: Encrypt -Comment: Set 3, vector 154 -Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Ciphertext: 4CE809A241E8E59E231F2D00BE0EA285 -Test: Encrypt -Comment: Set 3, vector 155 -Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Ciphertext: F914E06D9F7889DC71974DFF104F94D4 -Test: Encrypt -Comment: Set 3, vector 156 -Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Ciphertext: AF08BADB48FF961FD5EB663FA3766FC6 -Test: Encrypt -Comment: Set 3, vector 157 -Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Ciphertext: 05DDDE95AE659D6BBBD2B4E394399B53 -Test: Encrypt -Comment: Set 3, vector 158 -Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Ciphertext: 25E6FE1C89F811D827BDF8D4E977071C -Test: Encrypt -Comment: Set 3, vector 159 -Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Ciphertext: 3D00A9143A1829D05F787A904C48C75B -Test: Encrypt -Comment: Set 3, vector 160 -Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Ciphertext: 391DF944B0E0BCB84483AF5C4F34D754 -Test: Encrypt -Comment: Set 3, vector 161 -Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Ciphertext: BB2D2E556210A7C0EBA3165F63A74967 -Test: Encrypt -Comment: Set 3, vector 162 -Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Ciphertext: A1B0BB24291B259AC4A1CDE9A3B817C9 -Test: Encrypt -Comment: Set 3, vector 163 -Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Ciphertext: 6F798763B6ED7F8BB234D2CA78D026DC -Test: Encrypt -Comment: Set 3, vector 164 -Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Ciphertext: 038443760056AB3D23BC70ECE6FB4397 -Test: Encrypt -Comment: Set 3, vector 165 -Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Ciphertext: C75ECE40A7AE9BB38F604615C873EF02 -Test: Encrypt -Comment: Set 3, vector 166 -Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Ciphertext: 2D308C2078842EDBBB35ABCA3F41E467 -Test: Encrypt -Comment: Set 3, vector 167 -Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Ciphertext: 393C0E3350B3219DD8FD851C48E28C63 -Test: Encrypt -Comment: Set 3, vector 168 -Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Ciphertext: 964BD4A28DB1434570E27FB3AD880398 -Test: Encrypt -Comment: Set 3, vector 169 -Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Ciphertext: B668D17C027B550C0C22BDE151EB6EB1 -Test: Encrypt -Comment: Set 3, vector 170 -Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Ciphertext: E14186F8205957B243CE522C16453621 -Test: Encrypt -Comment: Set 3, vector 171 -Key: ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB -Plaintext: ABABABABABABABABABABABABABABABAB -Ciphertext: 0E352BEB6B6BCAFDAE61BBE86F8F1D0E -Test: Encrypt -Comment: Set 3, vector 172 -Key: ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC -Plaintext: ACACACACACACACACACACACACACACACAC -Ciphertext: 4BCF038D9458EAAA3D279CCAC3F5D693 -Test: Encrypt -Comment: Set 3, vector 173 -Key: ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD -Plaintext: ADADADADADADADADADADADADADADADAD -Ciphertext: D5EF17646A481C3B79AAB3C08B4F1611 -Test: Encrypt -Comment: Set 3, vector 174 -Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Ciphertext: 37642DA589775C2FFA40A7274E9D56E2 -Test: Encrypt -Comment: Set 3, vector 175 -Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Ciphertext: F829FA6B756F1B1D16B49CB7C8AFFA22 -Test: Encrypt -Comment: Set 3, vector 176 -Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Ciphertext: 6FE1450D48D611031E81C70478DB5326 -Test: Encrypt -Comment: Set 3, vector 177 -Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Ciphertext: 68C5ECE7F525F69DABF63288533C5C60 -Test: Encrypt -Comment: Set 3, vector 178 -Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Ciphertext: 5DF627500627E59A5BAB5D30B6C93219 -Test: Encrypt -Comment: Set 3, vector 179 -Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Ciphertext: AD3A4AC8F666C0FCA5D7995783D0986D -Test: Encrypt -Comment: Set 3, vector 180 -Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Ciphertext: A3AEE54D09357B187622109296534F88 -Test: Encrypt -Comment: Set 3, vector 181 -Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Ciphertext: 7D1D9A73DB386A717862C4F5089970E1 -Test: Encrypt -Comment: Set 3, vector 182 -Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Ciphertext: 916347935FBD0D868A0127D602B91BD5 -Test: Encrypt -Comment: Set 3, vector 183 -Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Ciphertext: 4F167893651993D9150ED9E0B780BF82 -Test: Encrypt -Comment: Set 3, vector 184 -Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Ciphertext: 488352470ACF9361F22FAC1B3ED67003 -Test: Encrypt -Comment: Set 3, vector 185 -Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Ciphertext: 4BBD307FCDE0F89C9A663A0F9C9358C5 -Test: Encrypt -Comment: Set 3, vector 186 -Key: BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA -Plaintext: BABABABABABABABABABABABABABABABA -Ciphertext: E402E706D262078113D6626E7071589E -Test: Encrypt -Comment: Set 3, vector 187 -Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Ciphertext: 422D6FA4519F2E72420685CD4ED2CC8E -Test: Encrypt -Comment: Set 3, vector 188 -Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Ciphertext: 6D14CC5F618DF7E0B2210F6C5DD62C92 -Test: Encrypt -Comment: Set 3, vector 189 -Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Ciphertext: 5CC4A5E81F7D7EC528C150437AC2B027 -Test: Encrypt -Comment: Set 3, vector 190 -Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Ciphertext: B3BE0F996494323504946446EDE489FC -Test: Encrypt -Comment: Set 3, vector 191 -Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Ciphertext: ABC7DB10FE04BEE94F5887E539C1D235 -Test: Encrypt -Comment: Set 3, vector 192 -Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Ciphertext: B18BE6FB1D04E76F21C0678A4333D255 -Test: Encrypt -Comment: Set 3, vector 193 -Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Ciphertext: FC5802BAFEDC03088BBA0A5F22402968 -Test: Encrypt -Comment: Set 3, vector 194 -Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Ciphertext: 8EA96801643AE7BF649EAC22812214D5 -Test: Encrypt -Comment: Set 3, vector 195 -Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Ciphertext: F7683FCDDC2BB0BCFD1350F8E3D76602 -Test: Encrypt -Comment: Set 3, vector 196 -Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Ciphertext: 08D0345431AE120CAD6C6D4275E00CA8 -Test: Encrypt -Comment: Set 3, vector 197 -Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Ciphertext: 7CD50A623DA79EC84D61CD7FBDBA4153 -Test: Encrypt -Comment: Set 3, vector 198 -Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Ciphertext: 42ACA2B048E5C58D8F004F0E8A2C6DEF -Test: Encrypt -Comment: Set 3, vector 199 -Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Ciphertext: E03AD353225F76121D130740C75B839B -Test: Encrypt -Comment: Set 3, vector 200 -Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Ciphertext: 26807D0A6D6330A77804B4B1AE84432B -Test: Encrypt -Comment: Set 3, vector 201 -Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Ciphertext: 864CE880AE89660474F64B93AF4CE043 -Test: Encrypt -Comment: Set 3, vector 202 -Key: CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA -Plaintext: CACACACACACACACACACACACACACACACA -Ciphertext: 82EAD2C033986CAC1F4C3EEEEA1D1892 -Test: Encrypt -Comment: Set 3, vector 203 -Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Ciphertext: 53F1A5C39DD062DF8D133B3A0FB3DA02 -Test: Encrypt -Comment: Set 3, vector 204 -Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Ciphertext: E913208594B288125EEAE0EFEC764D39 -Test: Encrypt -Comment: Set 3, vector 205 -Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Ciphertext: 7DAE4BD638A36A794A73E9B945BEF4D4 -Test: Encrypt -Comment: Set 3, vector 206 -Key: CECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECE -Plaintext: CECECECECECECECECECECECECECECECE -Ciphertext: 04E8155E3E81C261D3A9D4A800182A62 -Test: Encrypt -Comment: Set 3, vector 207 -Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Ciphertext: F466172A8C4C7854F59388474098F441 -Test: Encrypt -Comment: Set 3, vector 208 -Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Ciphertext: E95DBB0B366E77D7BC1BF206B95DAEBA -Test: Encrypt -Comment: Set 3, vector 209 -Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Ciphertext: 76490E6DD8380855E26BCACF8746978F -Test: Encrypt -Comment: Set 3, vector 210 -Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Ciphertext: 3C3B73C8FBDA8CAE5E0D7D0070735DA1 -Test: Encrypt -Comment: Set 3, vector 211 -Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Ciphertext: B039EBC9C48828C3913A3BC346CAEAE3 -Test: Encrypt -Comment: Set 3, vector 212 -Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Ciphertext: 0AFCC6A58BD3ADB2C0B2A1586C9FA8DE -Test: Encrypt -Comment: Set 3, vector 213 -Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Ciphertext: C2187D0E74CE2307BC4DF249EA6E57F1 -Test: Encrypt -Comment: Set 3, vector 214 -Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Ciphertext: F3F4AEA2492106A45C12D0029F58ACE1 -Test: Encrypt -Comment: Set 3, vector 215 -Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Ciphertext: 3FFADF96B37B67D62D71387C52C41AE9 -Test: Encrypt -Comment: Set 3, vector 216 -Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Ciphertext: 4C1644AD69F7D0D3A1E2B4B0E7F0A592 -Test: Encrypt -Comment: Set 3, vector 217 -Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Ciphertext: 68FD6F6592AE5BD9245FA959FE1CA849 -Test: Encrypt -Comment: Set 3, vector 218 -Key: DADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADA -Plaintext: DADADADADADADADADADADADADADADADA -Ciphertext: 7AB97B70C2CCC7D0D1AA7A6D8B7C48CA -Test: Encrypt -Comment: Set 3, vector 219 -Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Ciphertext: 961BF9E037E303B9B494C2EE063FC4CC -Test: Encrypt -Comment: Set 3, vector 220 -Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Ciphertext: 0FBF042B227603DB4A1CC8EE62E93DF3 -Test: Encrypt -Comment: Set 3, vector 221 -Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Ciphertext: 71360ED44C9FAF8F1139D31252A35F49 -Test: Encrypt -Comment: Set 3, vector 222 -Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Ciphertext: 5E806BD29351AE456549E73B8DDC0026 -Test: Encrypt -Comment: Set 3, vector 223 -Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Ciphertext: C7908A288B86C1C4FCE5A8A59457EFD3 -Test: Encrypt -Comment: Set 3, vector 224 -Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Ciphertext: AAC45B53F6292082B93F949BD77E5776 -Test: Encrypt -Comment: Set 3, vector 225 -Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Ciphertext: 231150ED4D85B4217B3EFC3E71A522C6 -Test: Encrypt -Comment: Set 3, vector 226 -Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Ciphertext: 639D9C5EEC8D9569C6DF24630CA8257D -Test: Encrypt -Comment: Set 3, vector 227 -Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Ciphertext: 0E7F8C538946D87A01AD49A8CC981B58 -Test: Encrypt -Comment: Set 3, vector 228 -Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Ciphertext: 09A293907E499502D78569230D3F1A97 -Test: Encrypt -Comment: Set 3, vector 229 -Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Ciphertext: ACF67CC086E386DA064EDBF97F7E889A -Test: Encrypt -Comment: Set 3, vector 230 -Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Ciphertext: E7C44DB1A9FCAC410253A7E2674C54F6 -Test: Encrypt -Comment: Set 3, vector 231 -Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Ciphertext: B99BA33ECB86DA790FF0CC4F0D41A065 -Test: Encrypt -Comment: Set 3, vector 232 -Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Ciphertext: 73405114FDBDB81B1A54C4EFED1BB3FE -Test: Encrypt -Comment: Set 3, vector 233 -Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Ciphertext: 80152E139834B3CC01EBF7E6417C5537 -Test: Encrypt -Comment: Set 3, vector 234 -Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Ciphertext: 05CE579D4804FF3C7874571730D81CEC -Test: Encrypt -Comment: Set 3, vector 235 -Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Ciphertext: F984801E7A806A130325E152DF60012E -Test: Encrypt -Comment: Set 3, vector 236 -Key: ECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECEC -Plaintext: ECECECECECECECECECECECECECECECEC -Ciphertext: 92CBB121474A307505425B4DD1B7F803 -Test: Encrypt -Comment: Set 3, vector 237 -Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Ciphertext: 2DEB2F282D60EFCDB300EADB15C798D8 -Test: Encrypt -Comment: Set 3, vector 238 -Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Ciphertext: 0F4D7D59B535E29D315D2A5C7BFE4973 -Test: Encrypt -Comment: Set 3, vector 239 -Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Ciphertext: 61E391F7C29B5AD705121CF9559E5C04 -Test: Encrypt -Comment: Set 3, vector 240 -Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Ciphertext: 65BCBE179D19A5BCF12D141A21E0F7A8 -Test: Encrypt -Comment: Set 3, vector 241 -Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Ciphertext: FDB75C659B72AE81E51204CFCB86E631 -Test: Encrypt -Comment: Set 3, vector 242 -Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Ciphertext: 5643ED3A3679B9E33E21CD0F95580877 -Test: Encrypt -Comment: Set 3, vector 243 -Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Ciphertext: 618EFEB4C6E4270B81FF7DE786E68420 -Test: Encrypt -Comment: Set 3, vector 244 -Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Ciphertext: 75A2A9CC91F006059CA873E5D73C2CCC -Test: Encrypt -Comment: Set 3, vector 245 -Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Ciphertext: B55840B5001D1875C29A56EDFDE10E55 -Test: Encrypt -Comment: Set 3, vector 246 -Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Ciphertext: 6DD9BDEA7EC0E622DE8B83460BDEA719 -Test: Encrypt -Comment: Set 3, vector 247 -Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Ciphertext: D164075BD4CDC95288D896C7CC98285D -Test: Encrypt -Comment: Set 3, vector 248 -Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Ciphertext: 8420071C55241802D88FB7AF17EBE43F -Test: Encrypt -Comment: Set 3, vector 249 -Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Ciphertext: 03D1D5646E4B2B8A924AB242E485C5D1 -Test: Encrypt -Comment: Set 3, vector 250 -Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Ciphertext: 29106DFB63F4CD6EF5D82CF07C0DBB3A -Test: Encrypt -Comment: Set 3, vector 251 -Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Ciphertext: E9DC1CDD5011E00E0C5699201E1EA002 -Test: Encrypt -Comment: Set 3, vector 252 -Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Ciphertext: 8006C8BD5B210F2FC5B3538F66A6BE0B -Test: Encrypt -Comment: Set 3, vector 253 -Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Ciphertext: 2C6386229480E806D0CD21CDA0EA6B53 -Test: Encrypt -Comment: Set 3, vector 254 -Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Ciphertext: ACDBB0F5A00E3CF63A89D9C09B44A058 -Test: Encrypt -Comment: Set 3, vector 255 -Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Ciphertext: 4F05F28CA23EEAE205B67B1C95CD5280 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/ccm.txt b/external/crypto++-5.6.3/TestVectors/ccm.txt deleted file mode 100644 index 165350b95..000000000 --- a/external/crypto++-5.6.3/TestVectors/ccm.txt +++ /dev/null @@ -1,240 +0,0 @@ -AlgorithmType: AuthenticatedSymmetricCipher -Name: AES/CCM -Source: aes-modes-src-07-10-08/Testvals/ccm.1, Basic Tests for CCM (compiled by B. R. Gladman) -Key: 404142434445464748494a4b4c4d4e4f -IV: 10111213141516 -Header: 0001020304050607 -Plaintext: 20212223 -Ciphertext: 7162015b -MAC: 4dac255d -Test: Encrypt -Key: 404142434445464748494a4b4c4d4e4f -IV: 1011121314151617 -Header: 000102030405060708090a0b0c0d0e0f -Plaintext: 202122232425262728292a2b2c2d2e2f -Ciphertext: d2a1f0e051ea5f62081a7792073d593d -MAC: 1fc64fbfaccd -Test: Encrypt -Key: 404142434445464748494a4b4c4d4e4f -IV: 101112131415161718191a1b -Header: 000102030405060708090a0b0c0d0e0f10111213 -Plaintext: 202122232425262728292a2b2c2d2e2f3031323334353637 -Ciphertext: e3b201a9f5b71a7a9b1ceaeccd97e70b6176aad9a4428aa5 -MAC: 484392fbc1b09951 -Test: Encrypt -Key: 404142434445464748494a4b4c4d4e4f -IV: 101112131415161718191a1b1c -Header: r256 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f -Ciphertext: 69915dad1e84c6376a68c2967e4dab615ae0fd1faec44cc484828529463ccf72 -MAC: b4ac6bec93e8598e7f0dadbcea5b -Test: Encrypt -Key: c97c1f67ce371185514a8a19f2bdd52f -IV: 005030f1844408b5039776e70c -Header: 08400fd2e128a57c5030f1844408abaea5b8fcba0000 -Plaintext: f8ba1a55d02f85ae967bb62fb6cda8eb7e78a050 -Ciphertext: f3d0a2fe9a3dbf2342a643e43246e80c3c04d019 -MAC: 7845ce0b16f97623 -Test: Encrypt -Key: 8f7a053fa577a5597529272097a603d5 -IV: 00eec1762c88de31f3cbba97ea -Header: 08c0ea100c846850eec1762c88deaf2ee9f46a070000 -Plaintext: 83a0634b5ed7627eb9df225e05740342de194117 -Ciphertext: 814b6965d05bf2b2ed38d4beb069fe82714a610b -MAC: 542fbf8da06aa4ae -Test: Encrypt -Key: 40cfb7a62e88013bd6d3affcc191041e -IV: 00b6a88adf36912fdca0f3a5ae -Header: 88c0d9577df763c8b6a88adf3691dc4a8bca94dd00000000 -Plaintext: 2c1bd036831c95496c5f4dbf3d559e72de802a18 -Ciphertext: 89d8580340b626a0b6d4d013bf18f291b89646c8 -MAC: fd1f1f61a9fb4bb3 -Test: Encrypt -Key: 8c89a2ebc96c7602707fcf24b32d3833 -IV: 078ef822734701f670a55a0fe3 -Header: 88c2712a9ddf11db8ef82273470159140dd646a200000700 -Plaintext: 4fad2b1c290fa5ebd872fbc3f3a074898f8b2fbb -Ciphertext: 9d59b15f371448c230f4d739052e13ab3b1a7b10 -MAC: 31fc88004f35ee3d -Test: Encrypt -Key: a574d5143bb25efddeff30122fdfd066 -IV: 0bf351946bc96ba7ffe03c0e37 -Header: 88c245dec69a7480f351946bc96be276fbe6c12700000b00 -Plaintext: 28969b954f263a8018a9ef70a8b051462481922e -Ciphertext: eb4ae4956a801da9624b7e0c18b23e615ec03af6 -MAC: ce0c3be197d305eb -Test: Encrypt -Key: f71eea4e1f58804b9717230ad0614641 -IV: 0dbff943b9f9a66b81eca48989 -Header: 88425af28430fdabbff943b9f9a6ab1d98c7fe7300000d00 -Plaintext: abfda22d3a0bfc9cc1fc079363c2fca143e6eb1d -Ciphertext: 9a709b60a39d40b1dfb612e18b5f114badb6cc86 -MAC: 309a8d5c466bbb71 -Test: Encrypt -Key: 1bdb34980e038124a1db1a892bec366a -IV: 00efec952016915eec4073e723 -Header: 08419b50f4fd56f6efec9520169183570c4ccdee0000 -Plaintext: 98beca86f4b38da20cfdf24724c58eb835665339 -Ciphertext: 12c537ebf3ab584ef1fef9a1f3547a8c13b3225a -MAC: 2d0957ecfabe95b9 -Test: Encrypt -Key: 6eac1bf54bd54edb2321754303024c71 -IV: 0aca3f3aae60c4cefd996eccdd -Header: 88c1552d5f72bb70ca3f3aae60c48ba9b5f82c2f00000a00 -Plaintext: 57cb5c0e5fcd885e9a4239e9b9cad60d64375979 -Ciphertext: 4bf281ef8ec7739f91591b97a87dc14b3fa17462 -MAC: 6dba8ef7f08087dd -Test: Encrypt -Key: 494b501e194675971a48d08c5bc353cb -IV: 0aa4ad6d319985ba82e93437b3 -Header: 88c19afb798b8a4ba4ad6d319985bc429e8f0afa00000a00 -Plaintext: 25a98f9c1bd9c93cf383ab9d98152d76cb4a32c6 -Ciphertext: 561a0d068eac2eadb0c57fe2d0a6cc7398b6ddbf -MAC: cfe438cbea61fa9a -Test: Encrypt -Key: 489e49bc3cfe3fce3895820e872ee1a3 -IV: 0053f869fe279acf1d3e75fea9 -Header: 084340ec29fa759b53f869fe279af0f9f8a65416000052bfd2703d24 -Plaintext: 7f91f2472d7a121c9cdd4b6c9080675a1020aa00 -Ciphertext: 25df5173835e4fba23bc05a253885ebed3ac4871 -MAC: c868a725552c5565 -Test: Encrypt -Key: 02be5c4545672a07e4e314d70f1f9e85 -IV: 0d347ceb9aabffd2d6596e55d4 -Header: 88c3298c0baa9190347ceb9aabffd83d4886e5c20000e29d524ae1960d00 -Plaintext: f9a812e4a28af7f3714d4bf6622e5932f2184509 -Ciphertext: 6315500f924295cd3eafbdc3e151b1df46465b71 -MAC: 681fdee8513c62dc -Test: Encrypt -Key: 77077ed79453e4a18d60438cc6484d6e -IV: 00d8ac5a7ec44450b01e77fd8e -Header: 0843aa288b8435bcd8ac5a7ec444e8b46250538b0000e81402c2ee11 -Plaintext: 431981a2336d02f8cb8448d5428916be95293537 -Ciphertext: cf71b2ccbd590b20800792f359ed1cfd74d800b4 -MAC: fd0f41f426bb8f30 -Test: Encrypt -Source: aes-modes-src-07-10-08/Testvals/ccm.2, Vectors for IEEE P1619.1 CCM Mode -Header: -Key: 0000000000000000000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: c1944044c8e7aa95d2de9513c7f3dd8c -MAC: 4b0a3e5e51f151eb0ffae7c43d010fdb -Test: Encrypt -Plaintext: -Ciphertext: -Key: 0000000000000000000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -Header: 00000000000000000000000000000000 -MAC: 904704e89fb216443cb9d584911fc3c2 -Test: Encrypt -Key: 0000000000000000000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -Header: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: c1944044c8e7aa95d2de9513c7f3dd8c -MAC: 87314e9c1fa01abe6a6415943dc38521 -Test: Encrypt -Header: -Key: fb7615b23d80891dd470980bc79584c8b2fb64ce60978f4d17fce45a49e830b7 -IV: dbd1a3636024b7b402da7d6f -Plaintext: a845348ec8c5b5f126f50e76fefd1b1e -Ciphertext: cc881261c6a7fa72b96a1739176b277f -MAC: 3472e1145f2c0cbe146349062cf0e423 -Test: Encrypt -Key: 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f -IV: 101112131415161718191a1b -Header: 000102030405060708090a0b0c0d0e0f10111213 -Plaintext: 202122232425262728292a2b2c2d2e2f3031323334353637 -Ciphertext: 04f883aeb3bd0730eaf50bb6de4fa2212034e4e41b0e75e5 -MAC: 9bba3f3a107f3239bd63902923f80371 -Test: Encrypt -Key: 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f -IV: 101112131415161718191a1b -Header: r256 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f -Ciphertext: 04f883aeb3bd0730eaf50bb6de4fa2212034e4e41b0e75e577f6bf2422c0f6d2 -MAC: 3376d2cf256ef613c56454cbb5265834 -Test: Encrypt -Key: 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f -IV: 101112131415161718191a1b -Header: 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f -Plaintext: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f 606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Ciphertext: 24d8a38e939d2710cad52b96fe6f82010014c4c43b2e55c557d69f0402e0d6f2 06c53d6cbd3f1c3c6de5dcdcad9fb74f25741dea741149fe4278a0cc24741e86 58cc0523b8d7838c60fb1de4b7c3941f5b26dea9322aa29656ec37ac18a9b108 a6f38b7917f5a9c398838b22afbd17252e96694a9e6237964a0eae21c0a6e152 15a0e82022926be97268249599e456e05029c3ebc07d78fc5b4a0862e04e68c2 9514c7bdafc4b52e04833bf30622e4eb42504a44a9dcbc774752de7bb82891ad 1eba9dc3281422a8aba8654268d3d9c81705f4c5a531ef856df5609a159af738 eb753423ed2001b8f20c23725f2bef18c409f7e52132341f27cb8f0e79894dd9 -MAC: ebb1fa9d28ccfe21bdfea7e6d91e0bab -Test: Encrypt -Key: fb7615b23d80891dd470980bc79584c8b2fb64ce6097878d17fce45a49e830b7 -IV: dbd1a3636024b7b402da7d6f -Header: 36 -Plaintext: a9 -Ciphertext: 9d -MAC: 3261b1cf931431e99a32806738ecbd2a -Test: Encrypt -Key: f8d476cfd646ea6c2384cb1c27d6195dfef1a9f37b9c8d21a79c21f8cb90d289 -IV: dbd1a3636024b7b402da7d6f -Header: 7bd859a247961a21823b380e9fe8b65082ba61d3 -Plaintext: 90ae61cf7baebd4cade494c54a29ae70269aec71 -Ciphertext: 6c05313e45dc8ec10bea6c670bd94f31569386a6 -MAC: 8f3829e8e76ee23c04f566189e63c686 -Test: Encrypt -Source: RFC 3610 -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 03 02 01 00 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 -Plaintext: 08 09 0A 0B 0C 0D 0E 0F\ - 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E -Ciphertext: 58 8C 97 9A 61 C6 63 D2\ - F0 66 D0 C2 C0 F9 89 80 6D 5F 6B 61 DA C3 84 -MAC: 17 E8 D1 2C FD F9 26 E0 -Test: Encrypt -MAC: 17 E8 D1 2C FD F9 26 00 -Test: NotVerify -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 04 03 02 01 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 -Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F -Ciphertext: 72 C9 1A 36 E1 35 F8 CF 29 1C A8 94 08 5C 87 E3 CC 15 C4 39 C9 E4 3A 3B -MAC: A0 91 D5 6E 10 40 09 16 -Test: Encrypt -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 05 04 03 02 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 -Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 -Ciphertext: 51 B1 E5 F4 4A 19 7D 1D A4 6B 0F 8E 2D 28 2A E8 71 E8 38 BB 64 DA 85 96 57 -MAC: 4A DA A7 6F BD 9F B0 C5 -Test: Encrypt -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 06 05 04 03 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 08 09 0A 0B -Plaintext: 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E -Ciphertext: A2 8C 68 65 93 9A 9A 79 FA AA 5C 4C 2A 9D 4A 91 CD AC 8C -MAC: 96 C8 61 B9 C9 E6 1E F1 -Test: Encrypt -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 07 06 05 04 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 08 09 0A 0B -Plaintext: 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F -Ciphertext: DC F1 FB 7B 5D 9E 23 FB 9D 4E 13 12 53 65 8A D8 6E BD CA 3E -MAC: 51 E8 3F 07 7D 9C 2D 93 -Test: Encrypt -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 08 07 06 05 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 08 09 0A 0B -Plaintext: 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 -Ciphertext: 6F C1 B0 11 F0 06 56 8B 51 71 A4 2D 95 3D 46 9B 25 70 A4 BD 87 -MAC: 40 5A 04 43 AC 91 CB 94 -Test: Encrypt -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 09 08 07 06 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 -Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E -Ciphertext: 01 35 D1 B2 C9 5F 41 D5 D1 D4 FE C1 85 D1 66 B8 09 4E 99 9D FE D9 6C -MAC: 04 8C 56 60 2C 97 AC BB 74 90 -Test: Encrypt -Key: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -IV: 00 00 00 0A 09 08 07 A0 A1 A2 A3 A4 A5 -Header: 00 01 02 03 04 05 06 07 -Plaintext: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F -Ciphertext: 7B 75 39 9A C0 83 1D D2 F0 BB D7 58 79 A2 FD 8F 6C AE 6B 6C D9 B7 DB 24 -MAC: C1 7B 44 33 F4 34 96 3F 34 B4 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/cmac.txt b/external/crypto++-5.6.3/TestVectors/cmac.txt deleted file mode 100644 index b00ba34e4..000000000 --- a/external/crypto++-5.6.3/TestVectors/cmac.txt +++ /dev/null @@ -1,38 +0,0 @@ -AlgorithmType: MAC -Name: CMAC(AES) -Source: RFC 4493 -Key: 2b7e1516 28aed2a6 abf71588 09cf4f3c -Message: -MAC: bb1d6929 e9593728 7fa37d12 9b756746 -Test: Verify -Message: 6bc1bee2 2e409f96 e93d7e11 7393172a -MAC: 070a16b4 6b4d4144 f79bdd9d d04a287c -Test: Verify -Message: 6bc1bee2 2e409f96 e93d7e11 7393172a ae2d8a57 1e03ac9c 9eb76fac 45af8e51 30c81c46 a35ce411 -MAC: dfa66747 de9ae630 30ca3261 1497c827 -Test: Verify -Message: 6bc1bee2 2e409f96 e93d7e11 7393172a ae2d8a57 1e03ac9c 9eb76fac 45af8e51 30c81c46 a35ce411 e5fbc119 1a0a52ef f69f2445 df4f9b17 ad2b417b e66c3710 -MAC: 51f0bebf 7e3b9d92 fc497417 79363cfe -Test: Verify -MAC: 51f0bebf 7e3b9d92 fc497417 79363cff -Test: NotVerify - -AlgorithmType: MAC -Name: CMAC(DES-EDE3) -Source: http://csrc.nist.gov/groups/STM/cavp/documents/mac/cmactestvectors.zip -Key: f8fba7b9b3e9d68a 2f70bfd304d32a15 9e13453e0d16928a -Message: -MAC: eb61515b -Test: VerifyTruncated -Key: 344a6732dc5e5431 e98a4f7c323dc1c4 6b0275dc150e68e9 -Message: 25db0710fb165d316e7c32dd25648ed0 -MAC: 862f0e2b -Test: VerifyTruncated -Key: 20ae32c49bab3bf8 f86bb66173fb54d5 3e700868c46bc291 -Message: 582bd9c8c36ec815d0a9 -MAC: 0d62f14f -Test: VerifyTruncated -Key: 62232501b9e9c1b5 54209d7c075d2c31 73a2f289a84c49ce -Message: adaf4bfffab79ffb60b94647faac634929c56e694052881881e60b1149b6 -MAC: a05674f2c905d153 -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/dlies.txt b/external/crypto++-5.6.3/TestVectors/dlies.txt deleted file mode 100644 index aa711552c..000000000 --- a/external/crypto++-5.6.3/TestVectors/dlies.txt +++ /dev/null @@ -1,542 +0,0 @@ -AlgorithmType: AsymmetricCipher -Name: DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES) -Source: generated by Wei Dai using Crypto++ 5.1 -Comment: keys are encoded as DSA keys, with OID id-dsa -KeyFormat: DER -Comment: 1024-bit DLIES key -PrivateKey: \ - 308201370201003082011706072a8648ce3804013082010a02818100ba3ed941\ - 10332be99b77a345da72a33146ca960498a6fc2e0e207fdeaadf69c3e5650df7\ - 3255475854900b75af7f6aac021de687a1c166ecb2ab6ec6b9da82ad4fb0f48a\ - 966a2b968406e18ba50947d7ee3bb1f13511cb4dde191f0ade1933d089c5e82a\ - b8d283943d85ef0102e173abf2635aeac2f84cfc9ec6c4e8f3fbc4130281805d\ - 1f6ca0881995f4cdbbd1a2ed395198a3654b024c537e1707103fef556fb4e1f2\ - b286fb992aa3ac2a4805bad7bfb556010ef343d0e0b3765955b7635ced4156a7\ - d87a454b3515cb420370c5d284a3ebf71dd8f89a88e5a6ef0c8f856f0c99e844\ - e2f4155c6941ca1ec2f7808170b9d5f931ad75617c267e4f63627479fde20902\ - 01030417021501fdc788cd93f07dba3af2de42ae5aa3ede219919d -PublicKey: \ - 308201a23082011706072a8648ce3804013082010a02818100ba3ed94110332b\ - e99b77a345da72a33146ca960498a6fc2e0e207fdeaadf69c3e5650df7325547\ - 5854900b75af7f6aac021de687a1c166ecb2ab6ec6b9da82ad4fb0f48a966a2b\ - 968406e18ba50947d7ee3bb1f13511cb4dde191f0ade1933d089c5e82ab8d283\ - 943d85ef0102e173abf2635aeac2f84cfc9ec6c4e8f3fbc4130281805d1f6ca0\ - 881995f4cdbbd1a2ed395198a3654b024c537e1707103fef556fb4e1f2b286fb\ - 992aa3ac2a4805bad7bfb556010ef343d0e0b3765955b7635ced4156a7d87a45\ - 4b3515cb420370c5d284a3ebf71dd8f89a88e5a6ef0c8f856f0c99e844e2f415\ - 5c6941ca1ec2f7808170b9d5f931ad75617c267e4f63627479fde20902010303\ - 81840002818029eaa5b193357c200e0d42f374d4c003c633c77f4778fe40ad0b\ - d035b87ae5da4e74110ec2b15eefe1bd8b9357534c85328382946d314e15b79f\ - 7b854227012dfaac9bd862e73a5630e01327b36319765a3eb1434e108ef6421c\ - 659e3f9223966759611429b3c86ed9937563efbfad8bfedcfa92db3d7d2157fe\ - 2c8a33f08636 -Test: KeyPairValidAndConsistent -Plaintext: 76 -Ciphertext: B11D906CC5A8E71CA8962A8CC0AC4CAFF2DA00DC130C370F42D11FCF5C37DE046EBC07C7D457CA351CE456A043695D14ED055ADAD2B58BE0DF992685EF8B0D21597A43D7B3D9634A077CB70C4590CD73C20FAAACBC5649413EECA0C7B3CBF469E531299398F61496C51FE9FFE48AE9FE6034F104EFC562DE9529C776B86ADD4025AD6B0C3687B012F92C7B9E82F794E4FBE247D644 -Test: DecryptMatch -Plaintext: 89338CE80AFB62E9577A310E40311BB3F77F -Ciphertext: 8A33B0E212DB8155CA796B472F55CD77267C9106229B6055141EA3AAAE42AD27249D90E70F892B0CDC80D29D3D586A5CA6FE67D4BB44C58B03496708F80681125DCEF983B7453B1E4F927438BD2E3E506C1951E9F19BA70F9B687012440CD75C0BB78BDCFAB22AF535D3E2670ABD1F4D44ED95F3360536612B1A7DF35E2A88F66BD6E8C813EB9DC89D93A85C9A0BA13E4862B91171B681E64A0750197C6467B22566BC640E11 -Test: DecryptMatch -Plaintext: 0835455ABD53E6FB11ED9B0C00485D3C6845DB -Ciphertext: A81181517BD270B0D921AF735052898932008DF00D501EDE0D2D564871D61A6A837776E8D7C7F9B0E5F9181C1FC68BC430F30ABB1A64D62B444C0AC5AAE588B4481AEF08B38E466155F10CA04C8202F281186016AE35212A2C7815A22DB2750ABD526D285BDBC598672BFB52E95CE33A0D3E5DCF4CF5F46224CFBB85297F3AB170C8B9478994E32D9A21A452B095D3D902E92C7E444A3307FDD7256FE49341142E5FF7A616475A -Test: DecryptMatch -Plaintext: 1EBED48EC47B6987091C52BC -Ciphertext: 1DF446FF43AAAAAC8E3F7D70C912E2D45AB832BCA3D0FBD17AF864B9EA878C45B9E2902804171A739A0552BB7CE0CD46DC16343714CC9C2E71AE26304885EEEB242665814DD9E33C480ABA214755D5449F16CD8870D1AB3A8E64E45E463AB3F4D3031FA3ECD395B61B372602665FCF218D9C51E8C791FA1E5BCC2916EFBB482E1814632CDF0F1852EE4943D9652DAA4E1F3B22F17F57F51D52A0997BED5B04ED -Test: DecryptMatch -Plaintext: 65D8 -Ciphertext: 4385797FD38AD5DFBB4F613BC87637B0051501E57699A5880E235DB7A6994A04A1613D0C8E07E36AFD08F2E47D018951B22E7625DA647AA1A0791DB3B2FA794610892D9A3D3F173CF95277B4B1EB92579A229510B67E171CB5BBA8B3AA732047BA038816A30124AF1C4C57CA80E93AACCC8EC70BCF7867914E7DE2C403568F9778F8DBEAF08FDB9F48452054C9735DC84F012DF8FE17 -Test: DecryptMatch -Plaintext: F86D8ED91E9934125DA6E9B4E97545C83A -Ciphertext: 13B0AE03AB532D5E31C9384B4E726A9AC73583CFBB0643EC322E3D2D45D9358CAF745B0541C136E8AA2220C42CEC9E1ED174886475538732AA6D6417DA89FA411AEDEADCD9F15D25D27D0AE252F77E888470AE696D5805CE8CCCB40B45D4AA835E97C7BF2CD6A2B4FEC6FCF858606CE4695DCE998C518360068ED028FC882478BF96096D92C166899EB51778BC4B7DA1BA8C4B6CEBA1139F17CEE484EA104A0325420A3D56 -Test: DecryptMatch -Comment: 1025-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b028181015dd79808\ - 07a15e557e3a39466eb2987828c536a871d4fc7f3723d52f8145a0d10d996295\ - 64aca54fd567c0509ef3c428fac68d916551e77a5ca0ed6d9f12cc96262b1f11\ - 49f398ef9f0f17fc0ed92bb917f890d1e6a4f62b91a7978d0aa1bf53b89805c1\ - 06ebebd0924cb99a4168a38dad65238236d4d166d38a3dfd5359ec5f02818100\ - aeebcc0403d0af2abf1d1ca337594c3c14629b5438ea7e3f9b91ea97c0a2d068\ - 86ccb14ab25652a7eab3e0284f79e2147d6346c8b2a8f3bd2e5076b6cf89664b\ - 13158f88a4f9cc77cf878bfe076c95dc8bfc4868f3527b15c8d3cbc68550dfa9\ - dc4c02e08375f5e849265ccd20b451c6d6b291c11b6a68b369c51efea9acf62f\ - 020102041702150f514282f489098f1df0c7be02ccbb3f23bed00376 -PublicKey: \ - 308201a43082011806072a8648ce3804013082010b028181015dd7980807a15e\ - 557e3a39466eb2987828c536a871d4fc7f3723d52f8145a0d10d99629564aca5\ - 4fd567c0509ef3c428fac68d916551e77a5ca0ed6d9f12cc96262b1f1149f398\ - ef9f0f17fc0ed92bb917f890d1e6a4f62b91a7978d0aa1bf53b89805c106ebeb\ - d0924cb99a4168a38dad65238236d4d166d38a3dfd5359ec5f02818100aeebcc\ - 0403d0af2abf1d1ca337594c3c14629b5438ea7e3f9b91ea97c0a2d06886ccb1\ - 4ab25652a7eab3e0284f79e2147d6346c8b2a8f3bd2e5076b6cf89664b13158f\ - 88a4f9cc77cf878bfe076c95dc8bfc4868f3527b15c8d3cbc68550dfa9dc4c02\ - e08375f5e849265ccd20b451c6d6b291c11b6a68b369c51efea9acf62f020102\ - 038185000281810107143658b98a3725010d3631a3f4f7448cb967ac0118e4ca\ - 8fc8871eb4fb872d55c52d93a4f21eed98b6499db74315956a268f38a288958b\ - f7c4d548662c668669d69375e0cb710ff3a1a9f43e49add1f7ae58b836b6444e\ - 419e40474c27066cb03aae8132e65f3fead0109307ab1c7f0254eb14e9d76639\ - 1a66ca1ba442b425 -Test: KeyPairValidAndConsistent -Plaintext: 256F07E0D37D69BE542BD17FA98CE4CFC3DA849B -Ciphertext: 01269CE30DE12430904CEC9D8B91A6D8860B4F8D37FCE7DBDCE8FA18AC521684F4C1CD5C38BF3B42C259033CD36A53F0376A0CDD801979CF1B76ADD72AFDD27830BD85B373C4D451B84926ABA34012EB98331F0B81CCF8E801ACCDEE88A35DF60EFADABA1F395250A15463203FDCCEDAB7DD6CD1271B38A5E0946F8D189B225E8A307D198AC5E4EB33BCF26A02C0C602AA14592AEA01452E4F8AE46E7A032BABD1BA8ACB0919F2EA18 -Test: DecryptMatch -Plaintext: A992 -Ciphertext: 007822B0BDF45CC5B15102B5E21F7656C8896E98FAD6C2AF6CD55D0DB90B7A6B05E36D260C7A5C070526813290BCA722959B9B9BF00041B4B7F3E3EAFA9B5376A1E02944EDA55B99202601AE6D402D56617B56B28BAC1B405016053CDC78AB4D372B0D58E7380D50F1CD0E31B8CB77FD2F6BA3E7A436A5B35552B9974EA5AB30AC0C4989E34F5FD7D272417FF2094B97119BEB2C73C68B -Test: DecryptMatch -Plaintext: 1D20C118C894EFDC67DAC33E56179C5D262C83 -Ciphertext: 001587AFEC265C244875371B680521FF93F0B1196901A7D580785B62A257B1736C86D1D9E59A31E62F53B92B209B45A7952776C6AC839243B0BBF3A059E6CEE99B120BBD45922B4E813DDE0F5793A42B3AF2DDDAA357136A010519D884589A1F9912110020A8C16E9B91C753EB8842B3224FE9C9A22AE2B82251CFF7799E78885B0B67B27DAAC6A7B58013C31115C2B8C0C0176BC2A7B96A299CC75693B4F2138B2B4053CB5320D5 -Test: DecryptMatch -Plaintext: 83BC82A4F7A4DFC96CD7798BAC52254CD6E9 -Ciphertext: 0085E83465997BFED9CAE63B04B0419578D0BD85B1A65285E5537F4367E5E7E11DD8762BD3335916A13B8CF9D5BC651E762458E9879363B06748BEA0CA86D32CBC4F1B0C0BF67E616B872A64F7356241CD052944F6594A570522EF2BCC53D90E3326D2ECFA036C46256D9B678C93BE5877749AF8FF8FEDB6E1E17B67C7B6C6098D0C71D5B2AB503AFD7739ABCC8DE67DAC056AFE99D8A107230BA88C282FB8FD46E9E9E2C6874A -Test: DecryptMatch -Plaintext: 157597899A950A32 -Ciphertext: 013623199FFDD0D4689A4C50A9FEA3C2250D0C73F209F33BF3EF13E6035976D6F3EAFBA3D83A3862E4B6DFC7581EA43B62F49BC85392B7EAB854F92DA8DD5921A6A4C42777E89004EB7E6D479BD028F758171C324168DC0814369C6BCD8471D9620C4E9BED785A220EF9C0DCF1201311A16C51341E0551043C6EAB45E04A81C9280633F58621D8D3492864FFF6A39EDC48450ABFE0C7AABAEB9A86CFFD -Test: DecryptMatch -Plaintext: CDE651 -Ciphertext: 0040308CCDAB105426597D84A64665200A93208713004DB38594C490F7B85F08ADB67BBE47B7FB7BBDA435A6B6A2CA0B4CBE0FDCBD4FF078FD052213CBCAA4580D1C7962A3505DAA9BEA2957718AB36D061E61B9DEB3D7DD726975C6E7FD79AADBF649F5ABE51AC384E967D3CDAFD9EAA18EEB69774961E439F54844FA22DA1B6892E86471DAE6F7E74CACC944123234826621C7634AE34E -Test: DecryptMatch -Comment: 1026-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b028181031e7d8589\ - b9fa11e77204b8c1b27ad66b39863978d26912a65de306dcb32a0c7c96bb431d\ - c4a14204a8f01a65b0fe56a4d016716914c21576f10d63dac5f49287636519ac\ - f9be56c9f58eeb90ba3240d4cce26f647bfd86360cf0f6b8ff609ae2ef736558\ - 155a1498adf4e92dc90f34169123a5fcd8ddfc763c81658a4d08383702818101\ - 8f3ec2c4dcfd08f3b9025c60d93d6b359cc31cbc693489532ef1836e5995063e\ - 4b5da18ee250a10254780d32d87f2b52680b38b48a610abb7886b1ed62fa4943\ - b1b28cd67cdf2b64fac775c85d19206a667137b23dfec31b06787b5c7fb04d71\ - 77b9b2ac0aad0a4c56fa7496e4879a0b4891d2fe6c6efe3b1e40b2c526841c1b\ - 020102041702151fa3003b00efad22ecc26c5115e6d036d13d3b2f7e -PublicKey: \ - 308201a33082011806072a8648ce3804013082010b028181031e7d8589b9fa11\ - e77204b8c1b27ad66b39863978d26912a65de306dcb32a0c7c96bb431dc4a142\ - 04a8f01a65b0fe56a4d016716914c21576f10d63dac5f49287636519acf9be56\ - c9f58eeb90ba3240d4cce26f647bfd86360cf0f6b8ff609ae2ef736558155a14\ - 98adf4e92dc90f34169123a5fcd8ddfc763c81658a4d083837028181018f3ec2\ - c4dcfd08f3b9025c60d93d6b359cc31cbc693489532ef1836e5995063e4b5da1\ - 8ee250a10254780d32d87f2b52680b38b48a610abb7886b1ed62fa4943b1b28c\ - d67cdf2b64fac775c85d19206a667137b23dfec31b06787b5c7fb04d7177b9b2\ - ac0aad0a4c56fa7496e4879a0b4891d2fe6c6efe3b1e40b2c526841c1b020102\ - 038184000281802c6360e6e3eba6da6efb5bce8d07a99e42949b68b3c2900583\ - c2eb34498081c7212d8dc95a631d63edeafc625f8faf063e57b41d7b662ba9c1\ - a99b3f2506fdf5e59116a0e93e7e94aab55691abae75eaac9637a713949360a4\ - 5f6908f23ba5503d4760bcd6f7abceb8351a66bb14fae05f03b1494e7ef4154c\ - 99a9cb6a9bfe12 -Test: KeyPairValidAndConsistent -Plaintext: DEC85711F12C0D1D6C26797E91B0F39B37 -Ciphertext: 0215D75DD99B8A59DEA3FBA9B0F8A621EFFBFD831E9543749B04B495147CE9B56D519EE71BDF56D86FD1D9C1AE8BC1D7F29DC469A05221E4A31C726971731CF627E63FAB269FC92DEDDFF3319819373F299D55F4CABE08DADF29A7C60E9B4E2806899371B93A853F828EC4312D94CFDADFDEF2037D9C1FCE21A3E451006AC542E1BC36D3C33AEAC0D1666C26AA886F4C118836EDCA7C5A428E407C4ACD62A885C03202230FA6 -Test: DecryptMatch -Plaintext: 0E665CD2CF75C2E6E24908448F29E9A198EF -Ciphertext: 00A4583FF3A9451C6F8970E53D95EC74F41F709F5156B4FC9C698B1E43C7B5F3230D5417AED2C7447455009CE8381A30BE400EC15BBB1D7BCB9461E593D416421157541479FE1DCEAAE635728C68C58D260337A25D0CF9FA291D84E9E1DF4FF96822CA1F05CDD247AD14E5AFB231A0AF0F2E79FB9A0528CA2FE9431724C0AC9F0A2ABCED9A20EC1203DE2A835D90EA5FB1447EC722456B6F4C75D0645CEC5BECCE35B79FF3071A -Test: DecryptMatch -Plaintext: BE2A -Ciphertext: 02823CB4ABD598FC5D36300306460886BBECFAE6F56E02708A96EFB27EF7E3D8F08442FC819EAB1DC35CC70A074984A149F209EB285C6064DDDBC7781CEF7358F384D592BFC75D346A6D97D8524CB35060A35E3B3145199F4968677FA22BB468DBFF63E3E366D778B3042D5858699D9FE5D6F53D0CB084E107111B572AE9B933B94FF37F2681DC50CDED2714668375DA90787CF0144F1B -Test: DecryptMatch -Plaintext: 20D57B7E074BFFF8F54AF3E69C9B632253B3B5C0 -Ciphertext: 00D18C24BF39CD527455737B4B214BADDE99B070181C1E4729CC7B6EAC82298417FFAE7BDA1F41A7D74D6969BF9CAF3A7F9EC9397DB75F5E53D0282F793D601A28E8B3CA8730CD9D7A0ABA338E2DB3EB5314321EEBA2F16C8072DA6AD9A887AA5AED0EC5EF3DC7E5726626511F8F23B0BA4D83BA358DF0951B07399C7515349E3DE2938D2AA53AB11A4D1C07213E091CD3FB6453AF7DFB6799D45DA44B060F7BF5ACA5A25B3892BBB6 -Test: DecryptMatch -Plaintext: CC47935F7976 -Ciphertext: 02366250DE032B147BCEABCB576ED39F4993251D25010FAEEB41BDDA4301B890063247EEDC041539488E70B977091BF581033EE6EF75C224C8046EE3E7D2330383A30BA07FF33D10F07FF6E1EE20FA4D112CAB1BF457B50DC301DE5C6DBFACE227903379A41DC4D92517A547968D3F147D6435C3DF6A3D0D13635360716CBAC322EBD295593865C3A117050059FBEC83D112C5C3727377EBA7778A -Test: DecryptMatch -Plaintext: 3A370FAFD82869FEC40117 -Ciphertext: 026AE53843D3EFE36D8E52D9FD55DC6F0A0F51584BF81529914DAB6E380A6C9716828A7254307440B6A0CD16BF0D9D713939AE7F6C4D82D5AA70F33C9531E4071B9CB415C7622A23DBF4C81820BE04272874549F081B57D40B27BC1879BF134A2CF5D15203D326F9F97BCAC8606082A50A755CAE6FE2B72060EB1E0B72EF5AFAE8A823B3F0F91877C931CA64A06F3888DD4E2C823B3FCF529407255BE2AAD36A -Test: DecryptMatch -Comment: 1027-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b028181072c45d24e\ - de76df2a03270413d8ab37645c8d6301ea76bb6cedea97142df7aa422b83043f\ - 8cfd8874dd684f47138433f5832c83c8c811d3c6d477b088006381ffb066402c\ - 951670f1927b1b67883451202f456bdb975d8bb2cde9b43c178ecfe788a0a0ab\ - df2cbfc700fbb97ef71e52221bc054fbd3cf8c04175e4841a45b89cf02818103\ - 9622e9276f3b6f9501938209ec559bb22e46b180f53b5db676f54b8a16fbd521\ - 15c1821fc67ec43a6eb427a389c219fac19641e46408e9e36a3bd8440031c0ff\ - d83320164a8b3878c93d8db3c41a289017a2b5edcbaec5d966f4da1e0bc767f3\ - c4505055ef965fe3807ddcbf7b8f29110de02a7de9e7c6020baf2420d22dc4e7\ - 0201020417021506533f6f0886a8a44137598adb93aeee548c9af303 -PublicKey: \ - 308201a43082011806072a8648ce3804013082010b028181072c45d24ede76df\ - 2a03270413d8ab37645c8d6301ea76bb6cedea97142df7aa422b83043f8cfd88\ - 74dd684f47138433f5832c83c8c811d3c6d477b088006381ffb066402c951670\ - f1927b1b67883451202f456bdb975d8bb2cde9b43c178ecfe788a0a0abdf2cbf\ - c700fbb97ef71e52221bc054fbd3cf8c04175e4841a45b89cf028181039622e9\ - 276f3b6f9501938209ec559bb22e46b180f53b5db676f54b8a16fbd52115c182\ - 1fc67ec43a6eb427a389c219fac19641e46408e9e36a3bd8440031c0ffd83320\ - 164a8b3878c93d8db3c41a289017a2b5edcbaec5d966f4da1e0bc767f3c45050\ - 55ef965fe3807ddcbf7b8f29110de02a7de9e7c6020baf2420d22dc4e7020102\ - 03818500028181056bf5dcced97da0ddd23c1f1294f97431e323f9719fc9bed6\ - 352d08a88ceb13a06b559b8ef7dc04c5a04a761a9631aa1000f32f885fb0de56\ - 505524ae89462079631f438284c8e5225c021d7731087ec0aad11aba9bba95de\ - 03f5c99ac228861a3ee6a7b47617cec687a58255321694b923e63ed247e65ff1\ - 4c279bec5282bc1b -Test: KeyPairValidAndConsistent -Plaintext: D391B4F3B53EB9B035C3AB1E3C6E -Ciphertext: 05D90F9892F6DD3DC3654130CAA312D2287D9E57607C301BE58607BB19FC78D67F2082C907FACA819A0D946AD16B46FE1E7264BE7D25D4EAB4F80D136E89EE7BC53B65CC1692581E3ABFA3C15482A6FEEB607AD1765897E67BCEDAED0E03FDE18E05330A99BEBB8710C77E7735CBB747EB507FE1EC04F239E964B509A4FEE8463478E28BF5338AE016DED9FE6B2DDBD3FDE467C45F0FA619E039FEF085D2F1544EA3CD -Test: DecryptMatch -Plaintext: 28 -Ciphertext: 066BBCB2D9E474A2C6CD514663BDA7AECA1F79136A00C1F9BDBAEDE344872093E67102307C96BF824999D86543121CC3D99B5CC4B511153A42E8A1569D063C27788E105858AF8EEB0766FAD9E0EDEFAEFFC733BE6824644CEE03AEE5FF15860CB3CBF4A46F95988D5E010FB844F944628043C830E575964EC36E2C38326C771085D796F2C22C0969E58665626415463A3CA1F56C357B -Test: DecryptMatch -Plaintext: D2C349F40A24230689EA15736C3AEFB1588A -Ciphertext: 019A66A4ADFED556BBD1E58728A3B7A3631458DCF677BB155DA989827C2240A586783D8C5DB98E266C39FCDF6FB016BBB25D53A6B30F3BC9D1109CB908B54F1932335F3DFC2C80847D94D13C5933953EA1D212107AB42189536171069621403681CAAB2A13EEAEC847193FA6A0234FA8F107E2C1747425584EBB4F4D702E29A3A09580E25B34413208009F9643327A636DF622B7F0267D3169A64646F301C584F64066801383ED -Test: DecryptMatch -Plaintext: 85D75863811C6F574222B577 -Ciphertext: 02C6FFDB38965F3061C736E633B497192862677CB247A37C5FA1FEB4F2C021EA94C65AD9506C73C2E98ADF0F340DAFAD2BF6F6CC906C93655594D093D4B0F6867755013C25ED0AD75DC9A04DD0666E6340BDD6C1E748479F3D64129F76B5BAB37D26319287EC9D65CE9E2243D4CCC7BCEA4065623C4D388A7BD779941EE541DD29E070F7356ED1A1ADAE947D79F8421FA717F933F08CBB8B699B551F1EFF75B8F5 -Test: DecryptMatch -Plaintext: DD07A91D32C26D3258AA4ABBD82E81 -Ciphertext: 05669E0777B003CC2EBE9BF3981160806A8B416A2DEAB4058497C5AF6A5C8F8D1ADF1225CC6FF7D292320E9C98CEDA144862FB4E32EE11AD9CC76A5C85FAE56A2567E6C9D168586F288CF4D525C94FF9F0ED6C3DBD08787768B90F8CD776520EFB920E61FB0E4463BE8D5AAE2683D31F392229A9554E0977BF25BCBBAAC7BB4FCCB009630D0203451A7A2AF847BA60AA0CE8C4D656DBED02353B92025925E1A0A6DF490F -Test: DecryptMatch -Plaintext: 0AA6B9FB846D1230F521F2624127 -Ciphertext: 01A9D56F1547728782D4F80BB0EBC8890BAEFE994900F41D56094F4734ABA2BB371060B2A69C6B7BC8944358519D141FC277E1195B3A78F7068731C3AF3C604A062A0D551397CD804168B7F400F786BC5CC3F912457AEAD56873AEF1A2378F34E953E240C20FFD7DDA229D4C020BDC68684A53C0AB3ACF9B44581353C60CE9854E3451645A604BB7AB3EB44088A07F59CE0FEB6454CC5A83BE5E939B317D4D8537CAFA -Test: DecryptMatch -Comment: 1028-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b0281810cb31a78b6\ - 6dafe2dd020483aec0cad421e4a3df2a81b827009dd74f5ef0468fc508477190\ - f628033471ee2d56f913d45a94a8ad1582b29785a7ead06c88ce73812e653797\ - 921d3c4a8fba91c1423d6609e85625b2f41494546500237151958b13d1cc0f90\ - 586b0233290d052a18c2aa3ec2bdc32adb4676cbeb30309e330b823702818106\ - 598d3c5b36d7f16e810241d760656a10f251ef9540dc13804eeba7af782347e2\ - 8423b8c87b14019a38f716ab7c89ea2d4a54568ac1594bc2d3f56836446739c0\ - 97329bcbc90e9e2547dd48e0a11eb304f42b12d97a0a4a2a328011b8a8cac589\ - e8e607c82c358119948682950c61551f615ee1956da33b65f598184f1985c11b\ - 020102041702151c0cefd22a713385985cacb5fe84cd40e724ce9587 -PublicKey: \ - 308201a43082011806072a8648ce3804013082010b0281810cb31a78b66dafe2\ - dd020483aec0cad421e4a3df2a81b827009dd74f5ef0468fc508477190f62803\ - 3471ee2d56f913d45a94a8ad1582b29785a7ead06c88ce73812e653797921d3c\ - 4a8fba91c1423d6609e85625b2f41494546500237151958b13d1cc0f90586b02\ - 33290d052a18c2aa3ec2bdc32adb4676cbeb30309e330b823702818106598d3c\ - 5b36d7f16e810241d760656a10f251ef9540dc13804eeba7af782347e28423b8\ - c87b14019a38f716ab7c89ea2d4a54568ac1594bc2d3f56836446739c097329b\ - cbc90e9e2547dd48e0a11eb304f42b12d97a0a4a2a328011b8a8cac589e8e607\ - c82c358119948682950c61551f615ee1956da33b65f598184f1985c11b020102\ - 038185000281810aacd80676c540b97f74d2a94c2f389795c9f696d2a1fa934d\ - 20e93d49d0099d9312552e6e310da5d97cef87c9a5a4c47e7acd195293b09adf\ - db8e0cac95139446aba60fd625d17eaa102c7c26568b34891edb38226f949656\ - 44a9d52ff299cd007ab3dbc15779d4388431a66774ffaae5c6be04526b28c620\ - ac97e8618cb09d46 -Test: KeyPairValidAndConsistent -Plaintext: -Ciphertext: 0194C64DEB9CB401573730A29359456F4E9528347ED80F24E5AEC4441E896E38047EF95AAD9AD7A25AED6CC89FD95CAAEF27F3C814C26FE43F6D65288D87E372A204D1A66C3BCF0346CE89E9D2D7646E90BACB9A85022ACFEF8903C72A663BAED9A346E1A6B2B2FCF70E239EE70A34385F8C76CDD121F6B190085BAB3300E6B811906CE38AC740FE88A3DF8DCA1C6DF73A03236D51 -Test: DecryptMatch -Plaintext: 9498EB7300 -Ciphertext: 0A38C373F6A96D87528D2D55F6391A9E801252A65F622F36A130ABD140E1858024E31F247C3BC8C07D9500CBE7A8A3D6C0670AF0FA14D020DC54B201E657C233F8031DF990AE801077D4D3AD9B861F4C32D36FFB9E8BD5E2651169BC4560CC7FD02159929AA50882F8B4C8508BB98F6BE8A6A7C0E21A2A81AF781447ABEC85C170F3F6256C3B6C5E2D3A01BB5EA8B502D37561C06F1DA536BD59 -Test: DecryptMatch -Plaintext: F07FFAC9794BD8D528F750D50C05 -Ciphertext: 03DAF7F6C2BEBF8D0B380EB71BD8BEE9D649AD7647DF6DE4CBCE00D0363E31F11E0DC0331409863E3C069EE3F975E7F623B55D7F4690C7419C5AD97EB52BBC0212D3FF0A83A031591A31481116B2CD232A9C86A20EA40BD13A53BB73E644A6C7DC1E6C767756E7235538E9D5B155B3173416E99F121E96E02034C6DB9129489A050740F603DEFF96EF1D99E7EB4A32083D0D946670B1AEF30E1E38D3F076D6BCB57255 -Test: DecryptMatch -Plaintext: 85916A46E0965C69C4773C7DF9AF -Ciphertext: 053D29F0878C68FF55FFC8E6E0E03044AE23B79588034F0236A49A5B6D00EFE8C564D2D29ACB61FE49C0E984EFC3A48A96EAF22AF3032D8D0FD3B3BB16A0157C161F2B3D3DF802FDD6B61899212F44493383DDDEA8B2463BACD0C5E1F4F9E4063DE5E52032E7DA8B79E04C5F03144CD710ADA74506CEC2D448BEA0F2B59AB63FCC443BBE920748E122DDD6123BDDAE484DBD02088817D999FDF80D5ED4B308AF4C2DCC -Test: DecryptMatch -Plaintext: EB632C72F563174E680961BCF26EC7 -Ciphertext: 0BBE666C02191F668A2DB000646A14385A8E9199BD887913BA587DA4C683535801853186673AD7C43EFA5B65902559BA5345EFA111E0514D461C1B1EFFAE58708EE6C17F1758EBED31F0B3206B0EC1B4BEB2EF911C589E25CDC3B0020C47119B5F33EA2FB7C332CA6B1FDA2F350A4CB0D6844637F2CCA71EFB036C7400957AE093B21BE90E30A8672847C9BA5266EBBF9D62341F67A4D09FFA196A817DD2F5EE1A9654EC -Test: DecryptMatch -Plaintext: 42B5D2DB89374231 -Ciphertext: 0085B6894D887B59393F9D7365411DF239BE1104FD86CC63A52C990A84FC4660FF9B60CF0641E44A8224C169A9FD1B35EAF78008E34F14B5311CB5D725096D9DE92F35BE6E71E3AC3E3B3D68BDD5351A5AF93F0B3BCDB00B9B126D8DA07E5F42107181F9580CCD0D6F086C94177FD48ECFAE3FCF2F26D64940D749E8A964275290A247AF700210500517BEB2175326F4CD3016AB175B352F9BD3289079 -Test: DecryptMatch -Comment: 1029-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b0281811b02fc18f7\ - ba0ae7f84ebcaf319294fa2bad52e47e1926267ad38b2f1b2566145bbc190cb5\ - c39a8d6229eb238d3742bbd234b0f28eac92363a31ac96c5b08eaeb1963de59a\ - 3b2d0295c0266a7da4ca92b64f96c497f262e98df7f20ec55814b8441acfb639\ - 7abf9c4e42ab9bd6dda6ae180b12e12ead68672f9d56b98ee40e2b630281810d\ - 817e0c7bdd0573fc275e5798c94a7d15d6a9723f0c93133d69c5978d92b30a2d\ - de0c865ae1cd46b114f591c69ba15de91a58794756491b1d18d64b62d8475758\ - cb1ef2cd1d96814ae013353ed265495b27cb624bf93174c6fbf90762ac0a5c22\ - 0d67db1cbd5fce272155cdeb6ed3570c0589709756b43397ceab5cc7720715b1\ - 020103041702152c7c60166a1bfebb17831e65b8e1f61f3ef9ed9ff7 -PublicKey: \ - 308201a43082011806072a8648ce3804013082010b0281811b02fc18f7ba0ae7\ - f84ebcaf319294fa2bad52e47e1926267ad38b2f1b2566145bbc190cb5c39a8d\ - 6229eb238d3742bbd234b0f28eac92363a31ac96c5b08eaeb1963de59a3b2d02\ - 95c0266a7da4ca92b64f96c497f262e98df7f20ec55814b8441acfb6397abf9c\ - 4e42ab9bd6dda6ae180b12e12ead68672f9d56b98ee40e2b630281810d817e0c\ - 7bdd0573fc275e5798c94a7d15d6a9723f0c93133d69c5978d92b30a2dde0c86\ - 5ae1cd46b114f591c69ba15de91a58794756491b1d18d64b62d8475758cb1ef2\ - cd1d96814ae013353ed265495b27cb624bf93174c6fbf90762ac0a5c220d67db\ - 1cbd5fce272155cdeb6ed3570c0589709756b43397ceab5cc7720715b1020103\ - 038185000281810e6e9c7b74e33a1f4683ddfa35509c39a75b75c10f438efad0\ - 82caad08a7418990983150a9a5ffe3f8e340443dfbabf82fe060da487f94afdd\ - 1e713d491b983fc4fb69d4405a12e356808c5cf6a7bd397c1a5637ba8e168b7e\ - d3f549a9f39f343e8fe3992706e782a1dde5c5e9e6a950f7d980835c1bc1742d\ - c2840cb2e61086d7 -Test: KeyPairValidAndConsistent -Plaintext: 03C57B87 -Ciphertext: 1440C6776914314A1DA161EAA41D52B283E2C0B487C801CEC33DCDB639F579F69D12FD029C994A311913EB6869C7A5659EE8BD9F5D7225BBB2EB77CF6F3D24A5E9866BD2CC50E593EC5CEBA4A96C59FE8B98B5EE2121E5892F2436F98B5C4E4A12077A1A64F1FCEB783D05453A657BB91909637063813CC00754402DE24F4AD6C0D9D4C15B7F4E485AF3538D391CF5993A59F6D1FE6C76E2A7 -Test: DecryptMatch -Plaintext: C5598C0FE0D90B10E7125079E2EDA32E531C2EBF -Ciphertext: 129FC863B70BB82C1C59EE2DA37FF3909F1DAB4B55D9727EE0CA3311BE5797F93446ACA0409CBFA848A90756D2598B6ECA56F6341C6E9F716A62380CB5D47400CF392A5441DA5AD2C1D066F894942837EA7B6237D7BE2E94FFE0A106148C2B7B9AF624242A945BF3B217D89FDBB070FA5940C1C899AD83AF1F865DEADFF0F4E48A7E00BF7AC5625F6E32F8B01394AE90284AFA061AF6DD61ECA1B8FA77CBC172573A9938332D7AEE41 -Test: DecryptMatch -Plaintext: -Ciphertext: 068117F2BCF29C72CDA3F4560A2165B7DB7C29314EFEC8D110425D5AA02F35C0F9A2304A0554C097944EF3A615BD70F5461E6549C319AC1207B100FEF022410C46284CEA9CA103685A18EC944DEA0BAE8E06D2489A3E2D1D9B255F192677664CA6FF44130C28CDE1FD437E85396503DFF305BA2D64E8BF9C75B00CA1595A1AED2C60865C0DF03F408EF95517E70552B2D5A8C190DC -Test: DecryptMatch -Plaintext: 8DDB5FC737283E5B -Ciphertext: 0B3E0CE51E1D3AE240EB34787DB5D49D6786B3BCC29C37EF8B9155F342C4D226CE1D07F7BAE09DFF7E8CD89915E1312F43540A26F03D918BF56B07E6D07A96870362643092F24FBCC6A2DE62F637B5F5F807E430DAF9B7AFE1890143591BBA035538FB419BE4CBADFCED5EB8BE2471B39CFCFBB2BA854C9E0F52E67524ECB80F9FBB3173D2A18C9F4C43F4E20866428A9256AB8AD199BA0BAD55A18896 -Test: DecryptMatch -Plaintext: -Ciphertext: 197D4DC43B0716191F926DC806A1B707ABD6684735144AFE07E0EAEEDD9BB3C89B9D0076859DACE6FFF9E2685592ECB010909910DCA50D2FB1B15EB9B9CFF4F71250D807EDDC2EFB2033BDFD93FD10E117683E3E4E8A5D3308572D4852954BD51251279A79092E3DCB95F1FCEC8310931933F47998DDB61438478CD80864F08D3370C863BE6E7E1CD22E38BC512D9A160478814057 -Test: DecryptMatch -Plaintext: 53AC983CEE599A17261C53 -Ciphertext: 0E31EAACA9E8A86ACEFD1CB817869F48EAB342EAD0DAFE17B848CA9CB72B92567987B929F655B8D601EB1384BE380C8E4BA8B4E274F724F02FC5C00479C308813A3963E2D8AC88ACE92AEB00AB024A4EC5560857310E03009752B86793B356DA344B4AEF01F3ACCD9CBFBE399D0016260C006FCA5443359EA1E012D43921B8D2B8CFD31B94972ECE9C0031420238C76514635E9B40F17D9AF25A1009DB75E4C0 -Test: DecryptMatch -Comment: 1030-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b02818127b35992d0\ - 8edcc7aaa6ca70365afa8ffacb4a9bef0ea348e27414c2100b81827fbf1abd3f\ - 14150bb5d85ab13b2aca21304365f150511a68c90f4a4eac0bfef0c548e3076b\ - 30a24929c4482f42f2b03ce122b3a251e685a3fe3dbb539932bf8d2b117b1b08\ - dbceb78c84966270657164fe6f20c6d27dca270dd4417f843fdfb23302818113\ - d9acc968476e63d55365381b2d7d47fd65a54df78751a4713a0a610805c0c13f\ - df8d5e9f8a0a85daec2d589d9565109821b2f8a8288d346487a5275605ff7862\ - a47183b598512494e22417a179581e709159d128f342d1ff1edda9cc995fc695\ - 88bd8d846de75bc6424b313832b8b27f379063693ee51386ea20bfc21fefd919\ - 0201030417021513560b35fe90d01a106b1e6ccba4cec953421d48cb -PublicKey: \ - 308201a43082011806072a8648ce3804013082010b02818127b35992d08edcc7\ - aaa6ca70365afa8ffacb4a9bef0ea348e27414c2100b81827fbf1abd3f14150b\ - b5d85ab13b2aca21304365f150511a68c90f4a4eac0bfef0c548e3076b30a249\ - 29c4482f42f2b03ce122b3a251e685a3fe3dbb539932bf8d2b117b1b08dbceb7\ - 8c84966270657164fe6f20c6d27dca270dd4417f843fdfb23302818113d9acc9\ - 68476e63d55365381b2d7d47fd65a54df78751a4713a0a610805c0c13fdf8d5e\ - 9f8a0a85daec2d589d9565109821b2f8a8288d346487a5275605ff7862a47183\ - b598512494e22417a179581e709159d128f342d1ff1edda9cc995fc69588bd8d\ - 846de75bc6424b313832b8b27f379063693ee51386ea20bfc21fefd919020103\ - 0381850002818117f468e3d38f1198556447bc16fb6c6ffe98b31f9042e59602\ - c71286db3e0780601e47372e6eb4a570f2059a7a87ee4471eaf94bcf23e34017\ - 5a377333d39dc64b7eaefcc065bef4a92d0d10acbba71082852c2014d9d3eb2f\ - 8583947c2cbf52865730d2b9511ed8a68367e4d89eca4589b836889cd424485c\ - 9305bc0386b16619 -Test: KeyPairValidAndConsistent -Plaintext: 4424 -Ciphertext: 0C570D0317363DB43DEB295D49A3BC937116F2ECAC9226415952CE634679272B7041A4B806164F12E87A0050AC2D60D393F845965CB3A56FF0CF28D31CFA0285015452C59949E3D96C5C6D1DBE38F6EE98E2C93357E6C036053DF920C7CA5E2EA1617AE44434A347FCE426C55295172ADDE9CAC3AEF2C6D6AB2C8F0FAB1B146FF1A10D5EC2191C99D6418519443EEE2A198BFD159BCC63 -Test: DecryptMatch -Plaintext: 5092C5D9FA398EE31AE27C97 -Ciphertext: 196476CA0E6622569F233780EE0C449C2CAAD3819B348D01B4DE5425EBCDEAEA739C6D9CCACE4DDF06520E83C94D237AFD46A4EFED635112CC78534E2FA6046ED6C06806EA8F4B9F3FC3F87DC55F63B9E14F9ABD82E9CC80A298DB281C9F690391F5B064880CF35C5A0BC7537DE9F65DEB2467FAB5CE8F41529A5B06BFA6B587ED661849BC7388277AE7F7E5EFA3F2526E503ECB106B718275BF32C4F83278CA30 -Test: DecryptMatch -Plaintext: 89BB350DC43CB3 -Ciphertext: 13844D63B45821E8704A9C1F6E9166B5EB7FD98DE5369E5DBB9DECE506EE467294282B5B174EF2F81B6766A3616AC5A974F06D9C47163C69668F4C1C78F8A6716A4EC28A6AE25F615A838B9C747EE857AA2AC92DEDC575AC568A78E8A86EF78D55EDB88707F7B6D558E8A760095BE8BCD066FC57396E67C9D8654245676DAE9FC4BC9D578496CA450B35E179410A5DB443C2026FFF0E5F7E54821E39 -Test: DecryptMatch -Plaintext: -Ciphertext: 040E084ED4A1C135C8867BAFF219A0092855E1E9FC96F38277E16B96986FDEABDC22F3B02CC53B655369DDE3356EA6FE49B77C8EAA49815CD5B1DFDC6E7D0AF6AA985483345BBA8A251F1EC7658DF708C8EED8AB6B953393C03BA2EEDB8B6391D921C9EAD2AA61DBE724B15C9C664EC4EFF83A535E46BF768FD519B043DBF46A36FA03921224281A826F6F43DEA6DF38749D600317 -Test: DecryptMatch -Plaintext: BB296D4FF04AE0171F1F24AE -Ciphertext: 0AA9A85958D9F1BB06E3DB48DACC842534915A7E42715057BD33523EE756F62AD973E37128BB8031358A1DC583F40598B74F079AD667C037D4BE89938233BFE1C167EFE764724F97F2EA42479FB455B1166AAB26A43440867ACE77472CCB13643D5BC9532F68C5368825BF225DF49E2D3BD023447A795AFFE927A796C70E5D6359537A9CE2B4B9323D7FE208540CC32447940ACD91F4718FC7A7CAD45A524B6DA6 -Test: DecryptMatch -Plaintext: 87A2C6B33856C6A096EE -Ciphertext: 12D17080AD0E7FD426E02B6A90736AB4B566F31E937B2D3E642D663D6ABFEB903FC9C4763AE492191E0C15B264CEF321DC8747C590F751A9BA2825D9250F72BA85EEB45B1F1D7B2BA972455DCE7DAE6CBD7B5BFBFB88FCEF52910F9B28D3DCD6BB5D479BBFC73896C3D1C44AB387989DE4D77855F6B8C7A8C12969D51DC6B10BA15C2B19E91A55BD5542853EC6F8F13260E8774C706958B1C9866114FADA1D -Test: DecryptMatch -Comment: 1031-bit DLIES key -PrivateKey: \ - 308201380201003082011806072a8648ce3804013082010b0281814ff13b3664\ - f5c527c36120159d9b9a82054f9ade6866b379e13d03e76cb63b25731132d5f7\ - ec6e95186ed83c793b5d63189dac30c6e6a655605f885fe73d2ae5433c80e660\ - c5d985ad6d12783082861829355c25cd7a7ff84b3033cb7fb530a7baa4000830\ - 2c1eb24b866cf467f570e782bceee66e15585f70b0633965c870530302818127\ - f89d9b327ae293e1b0900acecdcd4102a7cd6f343359bcf09e81f3b65b1d92b9\ - 88996afbf6374a8c376c1e3c9daeb18c4ed6186373532ab02fc42ff39e9572a1\ - 9e40733062ecc2d6b6893c1841430c149aae12e6bd3ffc259819e5bfda9853dd\ - 52000418160f5925c3367a33fab873c15e7773370aac2fb858319cb2e4382981\ - 020103041702150910a291c216ca5f944c5f3eaaa1535c3b8a1f0b15 -PublicKey: \ - 308201a43082011806072a8648ce3804013082010b0281814ff13b3664f5c527\ - c36120159d9b9a82054f9ade6866b379e13d03e76cb63b25731132d5f7ec6e95\ - 186ed83c793b5d63189dac30c6e6a655605f885fe73d2ae5433c80e660c5d985\ - ad6d12783082861829355c25cd7a7ff84b3033cb7fb530a7baa40008302c1eb2\ - 4b866cf467f570e782bceee66e15585f70b0633965c870530302818127f89d9b\ - 327ae293e1b0900acecdcd4102a7cd6f343359bcf09e81f3b65b1d92b988996a\ - fbf6374a8c376c1e3c9daeb18c4ed6186373532ab02fc42ff39e9572a19e4073\ - 3062ecc2d6b6893c1841430c149aae12e6bd3ffc259819e5bfda9853dd520004\ - 18160f5925c3367a33fab873c15e7773370aac2fb858319cb2e4382981020103\ - 038185000281812e9a62ec280cf5ee7d09e5e5675b67a4c325c7565a1129c079\ - 095d0f078e7b8a5b3c947c21c022f01c0b9267a45fdd9f267e63c7f674a02d39\ - 6fc59a960d7991d2e3552d01deb2784f26ec4c9355c0df0497271cb583d157db\ - 90b0634180578ac85005143dda75a33a127df96639e275cee8fe9c02db62d2ed\ - 879f3caae11d6e00 -Test: KeyPairValidAndConsistent -Plaintext: 1FBE21CDBCEBA28625584CB1EA0D9627A919A6CA -Ciphertext: 2CFC251CB2A397880EFD0077D9CEF817A6D69EB6278CD82998C5988DD18D6ED15FC8CAFD1611DE58BB46BA8A87013C7BBD4A8DCFC454F13DB282BBBD4E1594E6AF17AB6219E91D7354EB88515007B58BF0D8FF4BD4C387FF6E02BF81455803E6A936F25245863F1580F00ADFA4BDE052BEC72739B88042CF99480AB6F4489F9C8B9319828A000FDDC4D1A6E49868E3B39DBF7DCDADD9B882B755E330C762FCC023EBBCBD0330D28DB6 -Test: DecryptMatch -Plaintext: DCF33FA5BEDFDD93DA -Ciphertext: 14BA927F10262B134AC43F6787EAEC3546C17EFE3F6D54AD2A245A0EE732B749B7312521372F21716E1DE29AF8FB329C25ADEDE2DADE3A455235DAC6C1F347C2A052893DBA6511C3760384935D68C7808D23CB194E6A19F579782B22C3D8880736BECE89FD75E7E69022E9B2500E5A044105B832C9BFC5F18A807889B401E61A9888276B31FD299D604AEA85091578D41E5B36D66C4510F4B147C5E59615 -Test: DecryptMatch -Plaintext: 217B0E -Ciphertext: 37B50EFF3A3FDA419988CA44CCA3AE95F465A18C89CE2DF025F565DAF0F833E198DAEEB46517FBDE47AA3D5DC5039B873A31D0DEE1EBC63F3E97C0A63CC05A8F877FE70EB7F6198C088FF35C1C369616D3EACB013F295F764146A5AAA2D21CD36B9DA4490CF1B37D379ED7713B955C3B0581650B5C7F4F5B8F45B89B94DC364D3340414B491C29AAF2E197AD6F59B0DD687F2E60F8826169 -Test: DecryptMatch -Plaintext: 36DA002D110CD632A9969DC42409B478A3AD3B -Ciphertext: 37126F749ACDF2B6BF667DE9635CC0BBD61753B30931C847B612936C1AE122D6F0E409B4E9454852540C5FD8DD3DA8BA4026FBE8CC8449CA0071409DB47165907202DC078E5A8F6B0E9C8D3497A2D02F53DC3A47389C1B3778EDDEE980055BC4B7EBAC0B95C0CC4783A4B202CE127FA0D7B65B252492A1847FAA9D1ABE893376917BCD46DB4FFADC06C880AD848683B874F7CDFBF0E4BD87AFC39303C512C44EF58B510702C1129C -Test: DecryptMatch -Plaintext: FAFD -Ciphertext: 0F63F22B7817F2449388E0422C6122200D76BA8D4CEDE63DE950ED26768E6779BA0A238C8C3F2CC5C87C7926F1247A7067E27245423EEEFABCDB606976BA2FD9977320F903733FB57D02620682820B1AEE165604410157C5ECFAB7090EE83638A99E4CA36CA0879D3C14856A3417690A52F14F33CC50FE44503FC47F2D90C096C03F62A85D88891E9568911AF61DF916C3677DCF152FD3 -Test: DecryptMatch -Plaintext: 9E9145E890FEEADC706AE1 -Ciphertext: 0B60A14F132D21E47E2FA20633DE43694EC0394115DB297C1B68D1A7EE7722B6AF5D149A2EF5D0EA05761C0FABCF8C0862AF320E9D273AE743717F78A46F15B640C87F4AD0C25865EA3453B0FB59D997E41A31B6C1669F14639E2F70F7D4324B8729A26C8869D97B432740F7CE28A74EFFC82AD7EF172A02AC678C13235BA2C6EF79143D189838E1F101385BD7098AE3B5B78A80964D5C0A3D7DBA7FD7328BE8 -Test: DecryptMatch -Comment: 1032-bit DLIES key -PrivateKey: \ - 308201390201003082011906072a8648ce3804013082010c02818200b98458f5\ - ada1f23f4ae8a3a519c27fde91efd1f201e386aa6119749aaf6ed389079ae49c\ - c76317f81f14164673e8f0be00edd4db4792d446e7bf84b30200626b442af3f7\ - c9a6ee6fb0f95807e62fa5b2d171a4b326cd60c82b20d63ef00b408ea337f50f\ - a51f07549dc4f9a660842724566b94d6e2a58980d2d20281ce6c327643028181\ - 5cc22c7ad6d0f91fa57451d28ce13fef48f7e8f900f1c355308cba4d57b769c4\ - 83cd724e63b18bfc0f8a0b2339f4785f0076ea6da3c96a2373dfc25981003135\ - a21579fbe4d37737d87cac03f317d2d968b8d2599366b06415906b1f7805a047\ - 519bfa87d28f83aa4ee27cd3304213922b35ca6b7152c4c069690140e736193b\ - 210201030417021534999c0e7b17cc3c110cff71571e8d4708c3122a1a -PublicKey: \ - 308201a53082011906072a8648ce3804013082010c02818200b98458f5ada1f2\ - 3f4ae8a3a519c27fde91efd1f201e386aa6119749aaf6ed389079ae49cc76317\ - f81f14164673e8f0be00edd4db4792d446e7bf84b30200626b442af3f7c9a6ee\ - 6fb0f95807e62fa5b2d171a4b326cd60c82b20d63ef00b408ea337f50fa51f07\ - 549dc4f9a660842724566b94d6e2a58980d2d20281ce6c3276430281815cc22c\ - 7ad6d0f91fa57451d28ce13fef48f7e8f900f1c355308cba4d57b769c483cd72\ - 4e63b18bfc0f8a0b2339f4785f0076ea6da3c96a2373dfc25981003135a21579\ - fbe4d37737d87cac03f317d2d968b8d2599366b06415906b1f7805a047519bfa\ - 87d28f83aa4ee27cd3304213922b35ca6b7152c4c069690140e736193b210201\ - 03038185000281813c42dc88e1e15b9a737bfd64b96a7448983da5242a6cf43e\ - 1cc72e8886db723b681c291f772bfe33de5ba735404581c839341969a691c199\ - 229c2849c1c8c80396837c71d711ce34129d3006aef9d16cac504543c6e570bc\ - 3d730d5cd35d8a375edacf591b2837f9a705d63dd62754365d13c103961161dd\ - 984d89792985ad688f -Test: KeyPairValidAndConsistent -Plaintext: 23 -Ciphertext: 0BE692E3384A784AD01D80A65D22B48449AFC0281B36085B0D8FA03574B4BAD05F754D6FFB8E3F4B4BFE60FC7EA2BC1F11253505C753BEFB1D3BDA0084E6CC1FD82454A601F1C0ADB52B3FFC4895D36542FE0139465B490102C7B6A75C9273B737536DD122CC8C3EA0F32900C82C45B0FEE97D995AC5B4345A8899DD6888D1E814BB5A1141A86E636D31FA05689ABA512DE869D12BB4 -Test: DecryptMatch -Plaintext: 4F571384FD52A9041C8F3094 -Ciphertext: AB7942750662F0FA422F4628B558938545FBF7C749995B4D5B32BBF392292FD1B4EF02E5A2EEF6874BCA9F0D4CBCB92D684CDA821829850BD4CAE110E78E42909CF069B54B4BC7D742E113E57C85BCF54AA5CAE1005516BADA834A857315DD6C3DEF4AEBBBF6CB4AE217107E16E83F884B2933EE618F22C45B78092B2EFF7D5C33DB7D89FED4E134921DFD9DA999FB8AFBFD094D77BD887D2C86AACC401A621905 -Test: DecryptMatch -Plaintext: E421A467654B3B88C93C8E5384FE2B85D4E340 -Ciphertext: 7485B8E5360BC1383FCE1C586E126D5DE89FF1CA7CC8146C37A1E6582A564C4588984915CCE9635EA6ED434C80CAE138FBC1EB15D16B294AC1E59CDE544E4DFBF276D30A7F51461C2B7E7F076222DE6AC534DC47E015BA85062694FD78DC37E9460C10FDAF2C61FC7EE0669E99793A657543B881B50B0D3916E395A959EF55B02DB8E7B4C5B5B653AE2D11CCE639342C8C77C667625116D9E6B6C6AE822CDDF2AA503EC3FAD53D80 -Test: DecryptMatch -Plaintext: 3D6C941B1F03E5C9A4 -Ciphertext: 684AA8D2AD35D2775BC30794A078CFC931096A37D472FE511F72B03B33E87AB1E7B958C3447AF6285AC379379E0D1F1BEC535E4032E186573742A75C1B42BDC52F679DCA13B2B9E67CC73461084DE1777FAAED93C7C1E4A6B19473EDF6A57CD88C076574A356748D501A05AF66A136E908993A0A70538FEB03109C62A41540EB4E166596887B4860E3AB0BF9C1AFD02C67D4BFF28BAECD31D1CEB207A245 -Test: DecryptMatch -Plaintext: -Ciphertext: 111C252A9E64FB777F09AF6AEF9C4210B9644C3A66D5528C631D5348E30B146A6225783DE1FB796DBAB3A901E37818B5AE49BF1F8CC0A6C8909D2DB06D651CB08009A25E13A89653DBBA5959674E37BD72039D4E7BFFB3A2395DF8C36164C3FA71334DBFF2FACA090F1C349BF68443838A0D893B9B498D3B6CC86646F935D5ADED81967A387506688B6478492129534F3A651C9985 -Test: DecryptMatch -Plaintext: DE5F0B92C45A0C1530 -Ciphertext: AE6BAEF52B43EE88AEA7796D667D044887407ED07E7618358243A0108514FE9793EB28EB42B4BA2F28F6687FE7973FB8DBF825541010F1BC1FC7350CBEC0B055C0C71FF2C4D2634582C966C1CFD3449AF8AC956BEC3EE797F7E81E589450EA13C1A8C99116E05E49F4BB87C9B95EFDBEB35B21C36711CEC8A1ECF3E4F194251563F88C056749B835FC19A7CD560FEC785207DD14D43C6104D83BB05F1DA1 -Test: DecryptMatch -Comment: 1536-bit DLIES key -PrivateKey: \ - 308201bb0201003082019706072a8648ce3804013082018a0281c100f9566c8d\ - 687a5ead7c780617d3ed37b4afc46582e9fc0d75ae217fb506f5c2024c2a0e6d\ - 7e042544235b4de63047a33940d772721e895f9d4e92790bef0d3668ec7f6cad\ - e7f9b18049b33efa773c83e97b35ef7ebf18934b48dd4700a48c1f76ffc20684\ - 521bad52834086ccdf1e3d5c9128fef52f6a9444d8e9944d49e5ab411f46b63b\ - 290b7fdc8f48fab24c2059510bb7247e0930d5043802522d67f2b69ac18b82bd\ - 0229e53bf6769fe83c469188d600e6afa6686bd9725afb9ce39bbd9f0281c07c\ - ab3646b43d2f56be3c030be9f69bda57e232c174fe06bad710bfda837ae10126\ - 150736bf0212a211ada6f31823d19ca06bb9390f44afcea7493c85f7869b3476\ - 3fb656f3fcd8c024d99f7d3b9e41f4bd9af7bf5f8c49a5a46ea38052460fbb7f\ - e10342290dd6a941a043666f8f1eae48947f7a97b54a226c74ca26a4f2d5a08f\ - a35b1d9485bfee47a47d5926102ca885db923f04986a821c012916b3f95b4d60\ - c5c15e8114f29dfb3b4ff41e2348c46b007357d33435ecb92d7dce71cddecf02\ - 0102041b02191d78b208d09b23e859be7e79ca76e612d8e5ac75a5ca02c506 -PublicKey: \ - 308202623082019706072a8648ce3804013082018a0281c100f9566c8d687a5e\ - ad7c780617d3ed37b4afc46582e9fc0d75ae217fb506f5c2024c2a0e6d7e0425\ - 44235b4de63047a33940d772721e895f9d4e92790bef0d3668ec7f6cade7f9b1\ - 8049b33efa773c83e97b35ef7ebf18934b48dd4700a48c1f76ffc20684521bad\ - 52834086ccdf1e3d5c9128fef52f6a9444d8e9944d49e5ab411f46b63b290b7f\ - dc8f48fab24c2059510bb7247e0930d5043802522d67f2b69ac18b82bd0229e5\ - 3bf6769fe83c469188d600e6afa6686bd9725afb9ce39bbd9f0281c07cab3646\ - b43d2f56be3c030be9f69bda57e232c174fe06bad710bfda837ae10126150736\ - bf0212a211ada6f31823d19ca06bb9390f44afcea7493c85f7869b34763fb656\ - f3fcd8c024d99f7d3b9e41f4bd9af7bf5f8c49a5a46ea38052460fbb7fe10342\ - 290dd6a941a043666f8f1eae48947f7a97b54a226c74ca26a4f2d5a08fa35b1d\ - 9485bfee47a47d5926102ca885db923f04986a821c012916b3f95b4d60c5c15e\ - 8114f29dfb3b4ff41e2348c46b007357d33435ecb92d7dce71cddecf02010203\ - 81c4000281c07a5b4ddf442b2cd7fd925be84f2ef4c4032d61c5a55c5949b30a\ - 765cd4d5d4566af37ffa7f814f51bdd71c3e5575c6fd0203f14d3ded4e14baa8\ - 2747a6437d35ebc81e2035bfb0e04087fb5fe449163377d47b045b680b394962\ - 20b3138e85f6d24e06f955ec7a1b785ce34c2926cda441bfc86ba2f44a489a41\ - ee1740ab5ec3daf6d2c598e1d143654c05ce61792b47ac92c8d6ba0711419e41\ - 221743b768eeec2601f66d277fba154a62dc996537a0caccfa313cc9fde0194c\ - 05493aab1f07 -Test: KeyPairValidAndConsistent -Plaintext: 9302C420D137C310 -Ciphertext: EEF64A81C754B2EF543A19549AC0FF3F44E4B548284ABAA1E5F1EB704B0D246749D7F1CEF7B20A5226384DBE8FB596101591BE2B53E9909EE3723CB70A385FC2DAF6CE15629EBA21E7F26223B0A2428D8931CBB4F1B281E318A540F38A809C8BAD92D10FDD63305DBBE972E6CB973FC4F2FDF0BB9CC37FC42C7AD76E8DE3FA91E5E79B09796652BFCD62A28A59D9A97759032A0A78E0E1B081DF212A15AA44E35DE9E291EDA499DDB631486C029D56052246C9E37FF24EE9E86465B3B55BC4BAD77B9AC873B6F36EA65892B202E320756540009C81B9C6747BDAF40E -Test: DecryptMatch -Plaintext: 9FD4F26B7317BBD1B235 -Ciphertext: 514DB5C63AD9707197B4F0B2A30CDA18369B963E62F7ABBA1E030E08D3DE4E6C17D4BD7CB8097C2E641FBB0AED6A9FE7FBEAAC1C6B85BB3570D0E86FF6105B9F8C9B562A4EFE4AE3AECA26978C514129006D22C108B1C8A0FA55864EED3D3F81643AAFE36DF1CBC3B4E1B1AD6D5E0612214938A55114589B97286A7EE5B04E39254696DA91453027F07346984423FE2784DEA9375C236E6640504B5BCAC32062836E5BE1695CE73285CD77CE9717FA38E080C28C2959D9E32A589C04ACE5E52970ED49BE34703AD6B9F024DDA176C631EF5EE76833B427E233A5DAEC4328 -Test: DecryptMatch -Plaintext: 337D8BDD32 -Ciphertext: A4EFBF2151DAC683F0C51D60A647151A1EA0C0DAA8CF3497D7116439E6AEEC62A36D06F89AB2F1886FB9F62403E3DA8D6F67F66DA2436EE20FFBADD698DF87EF40470749C0BE0414A7AE4D2755459F8A17F6C7D8920236400313D7846532C391A0A4D99C26C556772E2D3C74E0119C4CEC7EF224488BFEBA017A910E5FD167B4486E436F7481DC5A46F3FF0536193C75A857DC53C5242C11AB911BD21926462C5060BB89F71D99FDEAD3D16B1E21E0D0791B59ED0F49871F744B13F23EF5028C238B895532F90B0ABE9912644EC079604939A0CF519BA9D185 -Test: DecryptMatch -Plaintext: 25549A5AE844ABEAA694E3F6 -Ciphertext: E2B30DD7781DB7EE7B2EE3FEB77F7360A6069396D8BF1DFD85D5429DA5A156677679085D612D0FCCA0979C97E924E77C43D3702940DBB556A5BB6EA33D650E078B1CDF8E5F76DA6591D0AFF4389A3A982A9AC581BFF393B35D36894E407AA56B493C2F7C4CBB75AEC72394AC4F8A99089702F3AEDB2FC7486F5CD01691C3C8F8FF3E951CEC70A4E172B763124BE1D9F96DBBFBA8FA0EBD1A71067A20F68DA6AAAE849880DD7F88901DF051715E240BF0F5B49EEFE35B9B0ED2B69757111080DCE2E2A933CFBE8FB9E6E9A2C2C75E0A4228D06689796AB919EF80405CBF648137 -Test: DecryptMatch -Plaintext: 5E61EB24085019F4A76893517C0A13 -Ciphertext: B13E45F9288FD2C5C0FEE230D1A09DE376ADADB5A4330F33BEC04C6F14C4A1CF3789B976F402F11611AB8345B2EB1069CFEE1E2F482A02A0ED9A3B9D94EB78C7BD7222ECD48A598E34D1F0B6205331CB20E0B2C6C146FB29CC11BAD5CA06BCA3EE39DD536FF330663A817ADECCC284B92F6AE3EB75B00316992BEF8A955EBB4DDE2CEF504E9298AC243C00FDB64B6AE96FD7B2135E6BCEFA7CBFEE135A650AA3D8CD095D1C9156232DCFE1904BC4CCE58B455CEFDDEC1D201B07ED4F999D6281AE21C2008525DB24BEA2D9FDAC1BFEADC3E6E6B1181F1A55A75976C565BC28F177CF02 -Test: DecryptMatch -Plaintext: 87 -Ciphertext: 174E5CFE167D4F6FB9A8FCC0FBEFC12864745900F5A18EA92282C8B6689EF53BBB87B30FC21DB101D93E9FFCED05538EDAB59F9FA07FB176407651DD0C4CD8269B1DBB70F24C8177EC6E16294CF5E87A3070A077B1CE84B612C3E3B1D4FD60D732C4D2CAEF5AC442A358AD0F323E60F58FC8B29894F3EAD3AE0DB8FD08BEBCCD4220CEE6B7C43A5E769D1F890A6B6505EE7FCDC7E399FE5321C2792D7AE094D13EC493CC0911B3EDBA6DAA037E2EA0CD3642784FFF2CB1BE04E5B12AC9D2871F016D8BCCE6DF25C1C04D912CBE707FD4DB0F9E89C4 -Test: DecryptMatch -Comment: 2048-bit DLIES key -PrivateKey: \ - 308202400201003082021906072a8648ce3804013082020c028201010096411b\ - e93e733637e91b1d74f808f4c9c528293e3123ac1d3d2f94c462ff38d0cd2fde\ - c0eb03bc5e54b6df41e9bbe9127a1b3a7f47cfb513340664829ffae26f832b48\ - e2d660d10e4debc1bfb412f331ab7b2f88c0d31fb587ed5c5256e0ebf7da698a\ - fd3cfa0443af91bab8c539376fcbad72bfa6985b6e64250e6b546b07a4575b08\ - 449d383b5650083c637d2452e7d1b9227adfd328ce473bb4374fa31e0ad52e56\ - 7feff6a9c4842d24d069e7babb35313ad63ca5d33d572bb309689a571e9ffe25\ - 38816bd7bde7bb11c10752e6a842751f594f50cf4b8111f387134e30c6c03ba6\ - 40be7cd5b6574c0d0b571a98fcdc292070595dcf6e8d034cc0ef92e8ef028201\ - 004b208df49f399b1bf48d8eba7c047a64e294149f1891d60e9e97ca62317f9c\ - 686697ef607581de2f2a5b6fa0f4ddf4893d0d9d3fa3e7da899a0332414ffd71\ - 37c195a4716b30688726f5e0dfda097998d5bd97c460698fdac3f6ae292b7075\ - fbed34c57e9e7d0221d7c8dd5c629c9bb7e5d6b95fd34c2db732128735aa3583\ - d22bad84224e9c1dab28041e31be922973e8dc913d6fe99467239dda1ba7d18f\ - 056a972b3ff7fb54e24216926834f3dd5d9a989d6b1e52e99eab95d984b44d2b\ - 8f4fff129c40b5ebdef3dd88e083a97354213a8faca7a867a5c088f9c389a718\ - 63601dd3205f3e6adb2ba60685ab8d4c7e6e1490382caee7b74681a66077c974\ - 77020102041e021c614682228a4bea799d01008a4bca099e7cf7711d7914a81c\ - 39d2407f -PublicKey: \ - 308203263082021906072a8648ce3804013082020c028201010096411be93e73\ - 3637e91b1d74f808f4c9c528293e3123ac1d3d2f94c462ff38d0cd2fdec0eb03\ - bc5e54b6df41e9bbe9127a1b3a7f47cfb513340664829ffae26f832b48e2d660\ - d10e4debc1bfb412f331ab7b2f88c0d31fb587ed5c5256e0ebf7da698afd3cfa\ - 0443af91bab8c539376fcbad72bfa6985b6e64250e6b546b07a4575b08449d38\ - 3b5650083c637d2452e7d1b9227adfd328ce473bb4374fa31e0ad52e567feff6\ - a9c4842d24d069e7babb35313ad63ca5d33d572bb309689a571e9ffe2538816b\ - d7bde7bb11c10752e6a842751f594f50cf4b8111f387134e30c6c03ba640be7c\ - d5b6574c0d0b571a98fcdc292070595dcf6e8d034cc0ef92e8ef028201004b20\ - 8df49f399b1bf48d8eba7c047a64e294149f1891d60e9e97ca62317f9c686697\ - ef607581de2f2a5b6fa0f4ddf4893d0d9d3fa3e7da899a0332414ffd7137c195\ - a4716b30688726f5e0dfda097998d5bd97c460698fdac3f6ae292b7075fbed34\ - c57e9e7d0221d7c8dd5c629c9bb7e5d6b95fd34c2db732128735aa3583d22bad\ - 84224e9c1dab28041e31be922973e8dc913d6fe99467239dda1ba7d18f056a97\ - 2b3ff7fb54e24216926834f3dd5d9a989d6b1e52e99eab95d984b44d2b8f4fff\ - 129c40b5ebdef3dd88e083a97354213a8faca7a867a5c088f9c389a71863601d\ - d3205f3e6adb2ba60685ab8d4c7e6e1490382caee7b74681a66077c974770201\ - 020382010500028201001eb30132e415358b7d3f726b93e2eeb083fe7add7abb\ - 6ca352c9e09b365e5768ce032ee52d59f1c65311045c490c42c36ae08cd0264a\ - 26199aeec8c3a8882a363397b4d7e0b6c4abc407f27847be0e8477993069a1a3\ - a3fe68093e09ce55bbedf97c91e741ad2eceb7a0f4be6ff87f68deb03c5280d4\ - 8fdf4900485bf5ca20257b176f58fcee1f0451b3716862488b0642bcd76654ec\ - 4874512538976967a545cdc208a0050f26e541ca70343f653222e6df7aaa07cb\ - cf354a5ab910eb8447382d7f512c440982ab37a402c87d2888eecb35c636ba6c\ - 84a5cce917f234fc7f8d9167167e30f2840407e13751f1944f6aceae3f5a7025\ - 36723c1d88c8c04981e4 -Test: KeyPairValidAndConsistent -Plaintext: 5EE1 -Ciphertext: 73279829369404A1B68D5E86FF334259936133CB04C9186CFF733972054918C3285EE907C2863DEE872252BF03EC9FB088B8DCE6D69D78C6BCD6B3FF87E683C6CF3CA05FA6AF0C068D964BE01030A3AB4E19575811D141A59CFBC9D3558E48CB771D88CB1E0E6C7ABED041077D24005E337AFCFE8531569FE56E2CE97C40693C071409888AE46DAC8BD739AE0E1C392586917FE07A66F7D3AAF0DDC398117B594481D0D5CD19C8708DAED6338EAA552564C31F9548FFC7E5C641FDA95B252EF637C6CF708979948A3E6B4F37A9ADCD60BDD841F3B0945CFF55E2F13468EC71C550CC2AD48E7E1FB444F132AADB1EF2A7C5A22450D0E0CFE9E37D999B4794B5A594A4EB7ED406DB24ED541E575B9F2756545DDD34F6DB -Test: DecryptMatch -Plaintext: 0252EE2E1C603017 -Ciphertext: 0E742D794904D05C0F0B6F60E9655337F8C110F289C6E4A0D6FBA6A2A8EB0FBB566A7F9B9862175C7A00A8205E8C8012366023FD8DDB6EB713DEF86917233DC5D16C2822707230169C183FD3A714806220D7DBA735C4F747A23E4131CE12C5572BD5E659F967A8B7DAD0EB6138D1BB569C6F04EAD79F9A6301609697F73F6FD8CCE934FAC6FC138B4C552E211FB1CC242805C035815F462D0291537DE10632141ED0A7C22439C7270AF0A6244C073CE9E2654FED918C86697988B0B341C5EAD2CD6DE75EAFDB1DFFCC5FE465E8D8C9A34D5B7F0E9DDE62204FD12EE2F99435DD58F3254268F8E6CFFADEA9205DDFCC943004887C405859866A0A40456A6C50B57FCED319AE0EC92B9069F765013436FC9A0253481CBE12B707A2B20D -Test: DecryptMatch -Plaintext: 01AE -Ciphertext: 6AB2E26D99942CEEE4844632355BB3B7713DF000DA11099D4E1BF9EDD1781A9396032E9D96BA0DF21B309A9CABCE9AE3D022C33A931183DEC5A3721EA5CEB39C18935A43E3B0BC153E4469AEB604D031A0084BE5927478AF8EA652D0A4AF455BDC57EDF26E2C6F9A01C91F29984C11D3C60313A53D8AC65D9FA504742868AD3D313506EB4FDD0E9799B111F3041F4C0547BBB06BF7DB20D18B427BCA1BA5099821A5F0997EF08C319B851F0C88B4814CAC7BAA4290B3182738C37B6ABFC2C4770A633F70E6FA4FA53AB286384FFC2AF9B64DECBE12C8EEB97862F76296D13D889E864418056420DCCD0DF9B76FB32FA6BDEE149585F427F133972DB7281D91D6E78B6BC46151901179D186CAAC784D6271023FD6E84B -Test: DecryptMatch -Plaintext: D52A1E0E3253FE281A9471 -Ciphertext: 63F60818E399024073EAF02A7A419229EA4E2FA4126C910AE7D31DE7EB6C9502752F5B7241F2A133E9D71C1A75E23A6F5DBE36C1B661935B0F20123BF434153B1F81BBDE278611C9FAF9F56BE8C78116823AC5B5F355B88A82AD6A73D2B63BECFC7D3B39DB2A6B393E23826235AB76653EDF65DD7A94BD27E221E9D511041340FE83A27F7B26CCF3FA40B2BD786BB9D67D2BCED415F2F76D116E8F3EDC953B8A327D2846F247D91626F643F8DB800F5E1DF0CDAE2369AA8969A938E0BB5A44F0A9C0BBC7D15A34DAF4713531A7B6B59CCCA2282952B16A7E1A1D1CD47D8B2AC6A88BC6A85E692FED89BB3D1F16AC2A922836152059433A29F786F2386A74DD6F555CC8D06C890A4A93E9FE88CEB078333A631E9E3EED0610F0A17F2A4F8DAF -Test: DecryptMatch -Plaintext: 53 -Ciphertext: 7F820C0C9A5709C6026E58446623B5D4B323BACE54724F456684526BD1966A360944227D04824B3C9BAF19A602EBAD25B8047FB6BF9997EBDE6B854140C032481F1479E4B994FC5A2DE8128375099A7A0024AE1CB985D73BB2B806B20E0751EA154BE2A70ECBCA49335BA57694DF1E0EA4566304B8DF4BBFE5AA41D0B767AE1679BDDE70F95E1C0C7E06F4A635F987E2858407BCA2133C3EC5620D58F1AB7FE1426B615959009A4706797FE4060E1C690DA373E48D6BA684F69E981DEE5DB9A58C504DED4D4CA6CD9B776DA03E55DEBA97E541A300465FFC68C5417A10ACED061023ADE00FEED4099180948F26F10D2F9470978469F67AE1092100C16D8FC4104DD1E711CF67D5842DE4102869E96E817F9C9FF520 -Test: DecryptMatch -Plaintext: CEA6026338 -Ciphertext: 13D877F0F00D01125447982639AC82AACF30FA0573001DD809C72D0F811138088C6D6D0569E63AB001CEB0339BFB90F7B71F339CA2F75859920370C622C0C4930B79B99DAC0560C763A1162AB46F58D1409E25301AE6D70DD4FA64984FE894DAD2B6401F8864580132664DDC2A57D1AF8AAE43C2759780C8587475F21275D61765251DA8FE91921703DC8DD279DFF4260D8AFE69257BB43EC609DA30DC33526D66E46365F399AA04F34FA7BA6469CA964AD6F2299233424E7342F1BF493C0BBB31FA1C713543D758219AB0F73B9C24F4699415F96C32E2A700669FCAE7EA6921F96288723ECEDF9677EF35702C8C0B71AC27A57624A7667580A2FBFF72818B2BCBA3589DCB686486FDDB50E29E75EBC8AD3DEDC8B741AF80F7 -Test: DecryptMatch diff --git a/external/crypto++-5.6.3/TestVectors/dsa.txt b/external/crypto++-5.6.3/TestVectors/dsa.txt deleted file mode 100644 index 22d5e8fde..000000000 --- a/external/crypto++-5.6.3/TestVectors/dsa.txt +++ /dev/null @@ -1,397 +0,0 @@ -AlgorithmType: Signature -Name: DSA/SHA-1 -ModulusSize: 1024 -Test: GenerateKey -Source: sent by CygnaCom during Crypto++ 5.0 FIPS 140-2 evaluation -KeyFormat: Component -Modulus: 8fbb9edf2fd2834b1a9fe97c25999fbc381ae165d932aa521592c2cdcb4318bfb99a2408f118ea874b73704e2cc557fc89a01ecfb5bc412951e86613b0b2fad2389e81ef42f79705fcdc87a9b9dcb1afb44c37d971aeffc1c859be367457ea19d71f22bcaa29752f15242f59b295125e9e01ab582887fa869e4b0f4a308167a7 -SubgroupOrder: cd6c675f1d22c771e7f59020ca0e94078950df9b -SubgroupGenerator: 7b473ffda9ed6e10f85177ac05f43ec666dc6d42310151053ae83369de9f9b331232cbc83bef31166e19b111e46e57703fc6666ac9a571ff053e18f3c2fbc4c2f32521750a941981a55379a2fe13bc78c6a3787f44dea397af63a7ce432704657feb57295ab9711ac7070ca5b7344bcaaedfd8bbddecd8de9c67e7cffa2fa20d -PublicElement: 64f31bc4d5b42622b41326361fb0d67f9feb364b34be67f6b2e4dc1f928fc70e6fe42cd9cd6ce3dc40113e7b4742d4af6fbe04d962adc5238d4d95b7bb67f0ec6592e966517d0a34137a45dc82ebe282c904750e1aa31b62c919b250d4d8ef922b0b0574cb2ccf1b451d7facd075e77fa532626602b32fee6fb334e1c2911388 -Test: PublicKeyValid -Message: 699c4211bcba049ac8d73c37fc3d02241f70b8ccbd6a1225d813664bcd043660847dfba3dca434cf5600afb60036171ea402bfdc3279ae2f6b7deb5fd0810a96ca7ff7ff1a36021d84a92b6db7d4b03f80b1d5d2306cf3af4be2c448725fedd09399cd5d4fe8853cabc84895fb91e4400c7591e691bafa5cd0398a3c8d18f8c5 -Signature: c0aa11b2571acf6fb78dd85148d97ae04877ea1a05d27ab73783ba4efa3a4b7f110cc44c7ba2c842 -Test: Verify -Message: f5373216e55156d66524e39dd8a345cc519edd8cee2b7cdb755222d42ef8f843000e8b69cffa4b0c154543c3bf871b804a904b5e1ed8a1ad2a29f63bc28b2ce5b5706c5fb2219e40dd682951ad7fed1709397d9ea36fa18894ad0c57391e5af74db54d8f479d4989f6e40de05b63b4a9c7f0ebe535c87485ea36dcbf4b897890 -Signature: 33e28ca5be57567a880c52451ec72f27d25b6e26c38216900ef17f0c307fd7614b399ff5febfd7e6 -Test: Verify -Message: 92fe48a60045104207970b674f800f67cabbba0dbc8d1d120b64a4ddc9b149800003f9efbd6446825ff84fae21d4ed00e61d1f5b4562b872d53b4788ba2247677091889fd75ddd017f52075b3610e275d025ce4c366c608eb2a64a567a5688287ae2cd3066e72db701dc0ce6a7eb46bf210c9f59aa646e5c3ddd86bc210665ba -Signature: 95616a85b6d9ff3c9af7264cbbf8b9cdb71404eec47fa7c91291fb93ddd8b0327df74cfae6698e0d -Test: Verify -Message: 18b8baa09b84cf8ec77a1d34d68b0971fa71016ad5b71838350ce9d114c8aa34d0bf8fd9a747615876845f58b2fb55bba757fb08f176901838b7b7042f87924fcf2a1c50d1c7cce36ab768514b0f277cd86b0a4fa7fe7c653cd729f803751b0d8f8f1cde121d47871caaf0f598deb70c0447e718f0671576ba04f68488ab80c5 -Signature: 23c6fde5fd9a2478d99c3abaa61363d90b2c161e847be181af07276e376ce4f76db56dfc3a1f2425 -Test: Verify -Message: 598660449d62f60b1e0581b0c493803d3ba5cb49a5c5d5917f2a41d6d1b6a8f69a2ea94e7bb8334fa29a0f5ffa32b1f291313fe9491ce32ac3044e8188848db77afd10f17a0ef84b5b56a1b5076d700df021de7ebaeec51827c0eab042ecccfacf6bace5f35add3820b04e6a443e55c632ecbec05032149182d52e1a57e4fef8 -Signature: 2c07790afcaf89768f1d1492345510d937e65bca5621811e1b705651a861be1f88f52090036cc1ce -Test: Verify -Message: e37395964c3c1f7b37c99c2f56070cf9672de2f7cf63bc6778ae6532e81f09baa23cb7e5c2af1c6ad32e7e5bf4aaf7f42cbbf4a20a4bed578182660d02f22799db04b8b2cfa31f41f727ddebd88326ddc6b361d77860e07cedd6e1d87e28c53244a28f14ad6fa099598cb1f73bec114ceded21ad53fa0d6d7482ccaa951a5b1e -Signature: 58697e6dad83ddfe43817e5534535ecd78a985d3928e271212165dec4e76c8025d531ee84ba8caf3 -Test: Verify -Message: 24976d350993351696b33cf2db5440303d5a722cc2d25eeb9ccf1e20f57ec060fa8bf4a22ab9fafbe0bdcb971f5b86fb9ec41e79142e42f4c6b58dd54e71ef4eadd95cce9458b3c5ef2df19ab38896e9e9e35801fb9e079e3fdec0e3c1a7559b5638fdb1dea738edd9bd06f12d144873366f76bc0f5a83621f030d42e857cac0 -Signature: 7488f2ca5fe2bec2c7a83e73407411c9e89bf8cd594d4a03a736423ebd913c2b98a21e445bdf70f6 -Test: NotVerify -Message: 430cde2feba0256295b6366211252174a29c9bd2b8e6db8fe97fb9ce35580a247be8364a37741b077e9f275d3b34b1f2ab3397c2171b1e04d177065972aced3c5201e6a648ef5900a3ab1e4f69f2d59bcf1488a0f84485b8f21e7508ef7ac1eac070269b97ac9726fef3539012f647450557a6c2d4fac685448d3e32235a3e06 -Signature: 7500d2fe4b2943b4da93490d3bac5c344bb18eb550975ead0e461ec33485e11714b4ceab478644b0 -Test: Verify -Message: 81bd412f4f9c8f8b7885d9fec9b013be8246d4284121dc9c2fbfe59a6987af1db141463855cf96ef6031325800b961f2378a6a46c65722bc565ab3c0e993ae15814354790fa8217a9efa9a98c0a6599c39c95638ebf077e0010f5be860bf63df4abc032a559e47e58bd8a9f6e3ee1173e0fb2d378762f4bf87d4764aa483e631 -Signature: 37cb9d9adb92a7e74365f9e4c4857a88a6fabd200d955dc76333b0ea9c1b2f05fee9117c79b10d09 -Test: Verify -Message: 84652beae6fec221ab800bf6303f17a47a84278a1274a2b11f40569bc58ff34ebe28c5a138e4b1c7eed4731989ae1728397db5038f8970c59e84b16353f8a1b411ede5c290de9e50f7de9fab3807f1b6ad238530f09e384900ac0c6591b6a530b30b03e2a8c47ed4fff80744f5219e650cce0eaaed8bf0547b0edf3a39a3f8d9 -Signature: 194a79f399087d977a29a3eab308670b7b133acf4e8b43068639e0e5e37d7ed305e32b85e30a0a22 -Test: Verify -Message: 9cdf6e966c37794c7b3dd6234e76d715099128caff3d03917a4a96a2c703b19386cab41830f5b8ffe9e9fd6b88759450e4714d2f6298e413bca267cc13a5ea6c38ae6fff379b0f8e253b6e562ca95f45d4e6d3b694b6076e99bdeed7d5d9dc7b4bc275c49ae0d5f2c86c015d51cb8eed702790d7ad50c59aa8d203392456dfba -Signature: 7b427233d9e49dbfd8ff2a7814dd99cbd4533d67155696b215d593d5ac3989c8927850601c0d453d -Test: Verify -Message: df577c9f2370b362f86a928e40106d7b0a511d5d8ec619776b82d57e1f195b4bc7f328c619d2490e9fa2b6ed3681ef7cc60fd51343f7cb74e5be0d37a3cb5078f6b89bc0ccd86532ca09f0f7c6bbe5eb85413088b1571e131ef5b6063e5355bfe23d8d6733993f24f036f682ead7871fbd7fe796d0ff4dae90be88c4e8c9a276 -Signature: 39a7efc692685eed0c3cea8838c026b39367c6f446a16258906787af9447329ab99e821eba53cb89 -Test: Verify -Message: 91042eb63d47c10f678bec836f98630e13e707b29c98b28d47b1443cf699e97018d4aecfd500440e7f11134c35c982b1d97b86473500691869fadc89974840f7d2ca319045565573a0fb630bc87576a8bff09460d1027a2500e3ab28b2eeb86d995dd1afe3418c76a4c0f5778094d72c9dc04ab4c8947eede6e3c6cf9d83e80c -Signature: a813d89e3de90f1ce1b77a7d6c629e8f83296aefb8bfe1194f914797d08b53fb59cb9186935dc10e -Test: Verify -Message: e644b9a45009da8248611de174b5613dfb4aafc0a772740c38f1ff480bb23e69ecabb5c2380dbfcf37b1093eb8bf4c3feea04a0d8b270cbd1bfb5a46a2487bd279a62e446649e80afb6b502431f6f97544765f4ad13f24282edb8bdb0ab635bc460d1c421314cdcc4c66eaad16b3e078b6a4e48eb21234e62b688c1d7a56e6be -Signature: 4e4fbbd84fc44f0ecd6c163fa292cd96051ca51764fb5626f8ecbd8470faf6ae5d79c731d9a3497e -Test: NotVerify -Message: d30ac577ac767ce6eee34ccfe09f0278f2faf8d28f657cb424ca7f53712b7f040f7eb63643c784ab02771af64405693a8eca4a21ba22ee1b09c189d96c533a0910583e53283e5693ffc076593d7eaf9e79de5ec9002296e2e4cacc15492cc26beb52b5c4f414ca17fd77b6ee6245ad1ccbec8ec2f89c4c81cc9ca0019deeeda3 -Signature: 4ee3704d4bff39aff0efded0930cf28ff7641f089280f1d0e38a186075e91d73a5b1e7d028340fe5 -Test: Verify -Message: 82bb8073af3e53b8ae158f342c4cae3c039dc830703bf0e893dacf5d280284948596bbd0d3a00cf8915f96464693dc328507df9e27607d43c426095b74102c90c494fc24fbaf5a628ef29146e1ce2c684020182f1e00fb338cc6d4f2fd5ed3b739ce7bc89e05f6cf9fe6b88b769558b72c01ab3accb22291e3d5667a3c8532e3 -Signature: 0b0b366b23090265e75752fdcde1a7d76113653246e0da762e25012cceb13859313e469f4dc31680 -Test: Verify -Message: 12da3a70153655976cba8144f67dc21719410fd136aa69ab4cc11df9eaa955005ba0e5140d3955f643d82a6cfc6e7a222376afc1f8309b4dbe1dbdc4a6bcd2f5fc839f9e9020fec967f12768a3c14130b0c529b3b0d682c129f1fd00eeeceac94b7a0046746269ca30fc1171c2ed30f9182416df371436bde63376e49ab2b635 -Signature: b43f325f82eb07dd2cb3a03a022e8c89216e820da743c216ec6eec5bf445f12b2d326d52e38b90ab -Test: Verify -Message: 45a2799fb193f3adbef66b8035318c5f7eb3610dfc64dbd1a84b87c0f082884ed257db1435c4cce38711b30b9dc8f4e5c7d936a7330ee36984b2e172b37d8ec925c401f80ede802305d93d4ae85e56dbf3e20c7b1c0f4216b17238253465893f773f63e3f4bb07846fa781d6cfcea858382658226e3eeff166e306702e1271c9 -Signature: 238f01011e1b3e7d027af353e06e2138f5a40ffd3d7a78d55c95ea3b94ad82b8ed58c308f7db5ef3 -Test: Verify -Message: 6cff32791fa0d15947fdedf67508fee334d1739512e15ce3ecdb5ac17f56c43e2cf51bbb0bc8b06d34e894164a4dc0ff48f3863a902d3716314916e278667de7bb914ea061279d3c36679b57ee56c6f4f7d84fbe830bcb80d6e71ee2cd15a565b00ca3a13972eebfe4b2da3279d966bad8b7a69a0533701873ed4a36951b94b0 -Signature: c9194d5ca3dbb424faae51f66377836a93bc55ab1d481e5eb9663c7033329d82c13af868f4a24efd -Test: Verify -Message: 37a363f2ebaa01fd1ed7902a4804c8fa46845b63d82b947e59a23073c0e97da2d72db113bbcc8d2095a6336197a744d83a923d5eb610134dc1f80d6f8de1e327fce615de26b88db10dea78599f79615aed9b906fabcaa236e8106a180e94077b1c65462c23863a07003b19e858935ad7d9360d6fae717a8f4480fd443c1a21f7 -Signature: 9ca210249d306006ecffd384f87c4dfcb1d466e005d877c2508475bf0074c4c6fffad6e123bd5dab -Test: Verify -Message: d3b14dfc79ab30cae8e40dcda6bafd6434741e6ab1b9e0d2cd4e8d80f10f176aac3126ef61b662772f31fe4d21bc85b99737e961f5c2c9e28a7d02aac27f7a19901529d8163c687997617e509f576890719ae9aab1c3d3e3524b9434c384036655d56d6ef035db06f7eaa68e78843e22981437fc3eb2950bff2e59d54a154b8a -Signature: 30cffe077d2330f111eaff346634237473feb83cc522a5d20c75db7b4c90c4e21583e1cec8e00f29 -Test: NotVerify -Message: 69d5980a58474652bf27388ea6041f9e0fe688ea95f59fa745682c69bcb1c7ea82e75f19a773eb669cff6e4d549b31219b323c1bb62d16a33c65bfdd344feb77706280b229cc51afdc571dfc6495c35f5953c8e1a83d0b1e73cec7cd2b7bca8beb20f4ec18abf2c437073cb20f4b4def00232255a27ff6b3a17b3b50d88fdcbd -Signature: 18eeda64cc75f18f58d43ce6b95eb3918a521bfb40c1745a38f985d294caf2d86879528678881191 -Test: NotVerify -Message: e0ac66b23eabe745886613c4698c79478f484a43f8dc444e7e7ee215a673c29ba56a56b4b41bcfc1962046ad66132d28a6eaf623858f028c71c3cc4bdd34567d54ddd4f0bf9f97dff31e3def7edd1769b39cdbbaf3f28b283e27a5d7fb548cfc04be365ff66f1717b7164e8148210f83cd1951ffda3db89a0062c5af980a3c8e -Signature: 6db33727b795d286a69ddebadd6e09c527bcb1ee596915b6fc950549beed350fda40a4c1f52c6a34 -Test: Verify -Message: f9cec4d6e1f2c2285dfb17d3ec5d16edec0da9b05ad12d62cbcd8f84ab4ba73eb6cad40ab44ad9a079d7f8221c544d89778a6d50df713f5f25bd1a3acdac1f6a8d0fd92c0a971459ce62fb958dc675bc995dc189a3515088b3e9e33f6b54e59978b60b9359712a2954b55883b54b475c4a9ddeb31c0a19b66f6922ebfcdbb0a1 -Signature: 947428406add226d1dd8db3245d00617b152921404ee5ab8d4e840c87d26073cc4d144a0b51e19a5 -Test: Verify -Message: 966d6fa1ea1ae8d344037a48420d6379278133fbc0c25450974fd9105bf988398f652ad373c511c830d2eb02470dc7c63b3865507d0fc3b0994ce4e4a0dae337d55839d99bd14bbf9eba37be412de0e348653815c77acdee4b5d97d646170062c03e35ec3cb8ac73e8b3f6b40ae5c78aa7014383757a8bc4037c881f2727f772 -Signature: 63137ff0730f28235e87cd5122d22a973035869332ec538d5be6e2c9c0db94f3c012ae4abf3af9fd -Test: Verify -Message: 43a8f0b5992db54d1d65acbf72780493d1af881fe95f9f14f61b834f201ac1df16e5f252eb46b845306efc2b5365655d38b71c63155dbf8193e9a48623f64fd19ecf36a4205fb4ad26594bd2e6a81e3cee19aea80147d4ea2fc700c23395b0e411bf3342f050a09c357f114be21925492e2cb58564f5d666010c0f9e09cedc31 -Signature: 1bf8e80c8183d00907ce80e74989d84815db85dd1654a6d49f74c020a83e8bc931a178ce18056f57 -Test: Verify -Message: c4aaf1632b1438752e9790c89cff4773932d3fab0ef710bcaf41794bcf5c0ccac49e1a3c7143dd2b1484e4e74cf6c4006925fd06f9702a8090276e2ad7e41b74d727a3378835c4ba9533efe5727efac4a14d073f4089b418d7ec8526605a8ed0987c65cc85a3471948dc893b254f41b7d0dd36cefafa057d1cc796b58374bfd7 -Signature: 5fa8964b471c76211e2743c4d993e793dfa7239dc84a19bb3fdad2162a8c98a2434c94213f3a163d -Test: Verify -Message: 739d44364282b7bc61c62188d07e0ef12b907960a740f1764ff8ed7981586c04a47ed0ef2b97fc7dcfa6adc508941762cd79c05f8d2aa15d6e037a06c5f676b7d6d40069cddbe4e0fc81aa18578030ed2d22860929cf0f1389d4d5159d762c2f82378b7a2067a73f62efd159b55a91e8c3248438714773f01704b57fffefc7c3 -Signature: 1b61d79c6b33e3c3394fff6efd641405652033690d7219da8475faaabce3e395bc720d70c60e12f0 -Test: Verify -Message: fc205229f11c877b617739d9ac191773c207ac714c5e2a061a917ad2cde4827ec628b5924eb8e19a06b4357a927d920e8171130580e8dfffc06f2ee5a4449a89af12a87faeed963b2291676cf0d72d984c7997f8e207ba96472924a5a0161f21915542a769b33e978b85e7681f20814bfb964d03ccb25404893674cb1954a87d -Signature: 283d55c038d4270e71ae39db618390f17675478b704764d1fe352550054076f4461eb6da6174dd17 -Test: Verify -Message: c343029ce5d70a70251b50cc5e784126dd65e35080940f450d5cf435d567c9ce8a9dd2cd5d5096c55ba95f2f0952f2b33f6490b642942d24259aef7f62e2ea29b4771bee372ca2d5c30c4428850421c1e0cfb2978323068acb1a3d6b5be34550f9a9d416acc3a637141ef8ce09e845e7787f400d7a99120eb5b4d611f8c051db -Signature: 0cdabb09213e0f09cf01e0329bba5661753950fc92e681173a6eb46c02d00224b50ebca62a248faa -Test: Verify -Message: 5e126ef683f3b61a39065574bece4ad82dbf4d34495f40cb899dd2b163717588ddb683795244ac758252a3adde0a0950126e9984d26a96a7e93b72c780ffbf60ac9d5b553cd8d831c1af2a9edef79426d13cd42942d48e204c45f611cadac252e3804f81d8e612c40dd5423e56cdc3d285e1561b31d400acc875b885d73854d5 -Signature: 01dde9613b9ce3c29b3503c19c13f863f27ab71bc0844476b3860ac891f9ce374aea6c24f517b8ab -Test: Verify -Message: f799a6b5a7bf7c32847fc243cbe0166f5244a377c43682c41b75530e6342174fade751e751885d10692e10858b11926ec626788fdfe925b2cd6d625272a13c899ce41e3c3ccc2f84e533ef6088840d9a6e448bf777e415a291c59ddb7b8d3cdcbca9450bde23ab67f0a6952c3bcf3fc944b6140502bc0a6d60983d00f69dcf1e -Signature: 0fc64023e095044c9d2d003a555e2da7aa5daf413896cd4e7ac774ecbaa0e4ece8e8ccfa053ab62e -Test: Verify -Message: ae0424ff8fb19e8842828a3cd51c93e1123e0c4ce9f9fbbc1b326979295be9ad7c6e6783d62b337ef8924e1b95a3f4aa77546a6af0d409e483ff8b89d422958fcdf0860912c47f45a819b36be047f0538a806ea6580bd83990bf99a6f6c2682cf98316c91df69796a80f50639082a093a5b9b139fb1580739a692b0769b47b3d -Signature: 6fbe751842e02a3fc3726a5d8298d1a7adb799a02d897597f4c459d28e9e25cf447b8cdf50001d21 -Test: Verify -Message: fc5837b228cd6c963b52cabd227cf61b5a1e6ccb4baff71ae4f971da7904bce5d94201efb3fc28912bfc9894b87c307a414f8653784e5fbe76056e3d989f51bf990fca68f0813aa36c00646a0e685fd5278fdce1b2af9a83f41726ed5212d82072180bb396339ce235b5a5dadb187b434335e50fb2aa9f829685108260354721 -Signature: 5bb80b35dad17648220dbe980a660effaddd7c43ad3584318e835c355dd7bf2f5510091389c42914 -Test: Verify -Message: 689eec3b665d72447abe64d4ddd79b7b73cd171bd22fa8689395e0a3d9793997205583d449fe912be240246ababb1859a5fdcdf48ce1d9ebb928ec58615503c073ced04ca0306948abf231ddf33e040b3e0ca7eac8816e218b872fa7d1ad67b9f841ab1c85ab52956d0c61a69f18b78ad5317a739dc6c102a2ea82084038bf7c -Signature: 3cb07367288036891a8861931e5b2104734a6e7e70ffaa32a49032b968805dd0bfc9f1989da22b12 -Test: Verify -Message: bc4828ec0810c7a43cbf028dced7a5890803681f86238a28f296aebeffc7f561a4fa5d6c9a595ab7193ab38eceb39fd220601f6ea5739efddffec8b93b7da7a74ba705014376fde4b375e33a844a57ea3583a43f56a55f9745723c4d287b34e82be7d584fb82e98183094b6be6b4052abd05ae6b92d0034d9d8cc550bdd8d27b -Signature: 67b214ed56ba44ced95d3d9e8c25c99331e3e973a3099e524473ccc8d4256f4ff7de9674a369cb57 -Test: Verify -PublicElement: 19b80e6f0132bd24dc0f26acc6a30445c4deb4fe7394440ce1ea0039d9c8137ec962e54b09d4383989baa288129e551e027477965ba1dbca0b6d586e482325f09a0fb16236d7b4ac3a3bb822a7a329aefeb91936f4b8cae38fd1e369db4f3f97421277533724d27e39248de3618a662c4b757cbbea2e3d805116d3e9d0ab3547 -Test: PublicKeyValid -Message: ceba9387e7ba8d55f8010aa2e8ed7de2c8310df67951e1c49c5fad18baf47dbbb571c2d26f779a79b8a564a07d9184252f097432728b0cda080212effcc3052612c8266e6f2bc88e85e6dafd42cab20679bd1b1d9038a27b6b001e0199237e4cbe37d81441ceaeca363d82728d8f9ebe7dc41d6c2b4f3ee19fcfea07e90c8364 -Signature: 84d8e940de14bfb65b8c0e0999e296a1d3c51f18b8bd79c57d826d9d200a6e38e52490722c6ee201 -Test: Verify -Message: 7b9058ef673b23e5b6a3d97784b898e0d912c990449be876b77b768da6443ba95b5fc1849db70e0482a4a1cf901aaf111b129e8dda38c3e2ccd758204a03c18b6d0500aea30b76a48c11dca21b0a82c9ea54c62bdd5bd71bfb8bacba897c3fbf68590f86b191d55c8ec285095ce2899fffb03983845a9eb9fe6f68749a082ddd -Signature: 7d07f3033c1c841466eeb641ad899ee247757ca067ab38f6f698ad0cce5f26517da7bc51b8e630fa -Test: Verify -Message: 2404a0e4c5ff8fa11c40f9932c8bfd3bac118eee53085c8e658cff857eb56b029ffa907876c65054f258a7fd07e01512bfd850df82a02820a65dbafb3a13d9380f01b9c3093ddd64a49044bcc994cf84d30cf602dd84accc4f2a8fc1a8eb55458ed173bc139c0f494aa028c80ade040a0166da50fdecc00a77aad8d16175b7a2 -Signature: 793e491940787f4e76495575616901c1c77d023342569cb8bc96efcfbc9746b3f51c31e29b221b02 -Test: Verify -Message: 5c311c167d2e3ebc19fbf7ab1c619d8ac1611152527a953d2137eaecc6fdaed79c13f4fa76f224bea7cf162531676a3a4c0a2ab81beba3f9aaa681222b122a8d724a5c77aef60aeb69df73eec3b384eceb157063dee88dce64dd72d4473b4fb2d6ee8de59bd3a61d5843465e48dea37894991aaa130a0b9246f3f659940ed61c -Signature: 7f76e9d084a9afd5c390271261b316cbd1095e710d1b7e4503188c99b8a8d851b130ad240e31f0c3 -Test: NotVerify -Message: 9dc221be2ab612b2ce6c7fc8b739af7fe740e9601f3201d3094a2444a488e076f52c7727ec7665e5949d2f307f0e6ed171e71c7a4cb21f9f3c661494239b5de7470e6d003a5553f80ae385b6aa3fef50a0803ca1f10d64264a93761e6f47a8e2e95e9c82ecc9f5a186361a930e434ab5cc05e10ce5b9e9218bc9e41b6203d81e -Signature: 332a2daa48681410763f13c3b127516c861bf1f187504d8b3bb1bd11ecbf9a9821f18466c10f1859 -Test: Verify -Message: e4354b9c9bd98d62fe629486b6856c96f34d2fa2460200c5c25746f454d32a065f8153049bdbe1b32ff4a8600de6aeeb8f7be7174f1f2f114c06893e3a9997492927596d5bc92a005f96f8417209c36316af59d9f41450e4eff0445b8a8e52ba7d7ed56e927b6060c59ffcc09bc5a313c33ffc80ecba5957e56deee2fc895471 -Signature: 65c2fd8a2635d6942b4b833682b29637eff64d80ac5ba18491bdc26d1c34d70a2c4b680900347d1d -Test: Verify -Message: a090ca3eecf8677a7699f42b16428445a3cbe74981efd6436d66620185469e959b9c8c0dbb464672fa136dff821ed7a2db6874b97bb5810691a9f1f30f22180df6d89abae633943ee56c08ee6fe88eb3bfd139c25df7c899e8e60e3d2647a3b3497cccbd8477a9d7cfdb9d71f657036ee83f0fdc3e6b01f60a559157e36e9781 -Signature: 19b4876e4043fe5f5a58e70b1560b0942ff4fdba842266a6653a6aa1550b91f4ba85a3b676a3659b -Test: Verify -Message: 8e2ecbfb35ae99dd004f2305cb2fe98c81edcccc13372e86b98f4e526d5dde4da43ae6fd4f7cdd8812fd0516c43107832767cf49e95faaaddb0e9f2a70ad0b1b790880ac1f05df022172b3a94f14d13f47ee2e5f70cf01d0341f19ef82ea805a832e51de9b61d7a3a346e89665f280175919a0e59f9e69463d5b757a9a2d7662 -Signature: 6d67367aa1caef2722c125a30e9e08ef7dad05a015893ec3c395c35d81944fe2db2a660e4e60913e -Test: Verify -Message: 6d3ba912c4bc10feb611e15965fe814bb2d5e5de67705a1ca46e8e6a8cb2e3243018f57abb7a698bdfe3f9c08012bd6aa033bc9f8bd9b351433f24b12ec0a3c3fe945c42e1cce9b6eb9153d4c099661686ea3a9b0ad3ff4131280800a2bd1b8ab125f7218fac27b8b092064d7d8a13863c73788a3c56d52344a051113ea1e3b1 -Signature: c56d1aa9f30790bec01fc07e5816fc6f44ab659898a959ecb061b4347e7f2be6f2df97ba33043a00 -Test: Verify -Message: cf2010dec81c60bbe408df2bf20f465d259a5a8d2f7920ce9c566318705c69950423f1281edf713f50ca8eda93cedbdc2378d6929d192081573efd7500520cc6799247edf3323e4849cd902aa013aa273daec49ea6741887fcd4657e987aa511e5450a467e6c3f7088ebdc3451342ad729141aca81e3807843f0944e712bab0c -Signature: a6640671721cb21d86265e30cabbc09ba20cf6081b4a5c7928ab3a53d4e291bf6049e8bf8418f6d6 -Test: Verify -Message: 4b00e4324ff7fbeb0fc48a6c83de82d52da1bcd1eb6669cffbe2bd824fc1d7971383f4b67d96d5bcd4b56e36c480d021e05d58e0788e197f9e93882773c267e1b725f38f919451289b143633316ed687fb131041b930d7064e0de47a10ac9a014f9e39b5232847a87b973c5b63e16d7f957d3aea43847cdd24092975bdb5496f -Signature: ab2f5b0d5237ec1b7e6297700a7c06647a526cb069c8162c513100008fe0dc37d4a8c9639ac94cb0 -Test: Verify -Message: 20f18b1eb4ccf98fa68c10d680f1536bd5c7c3307cb13ede0e3717afa213f74dc8b8f4fbc324ef020ce7335e03744baaf8a824495a9964d63ea00ace13a9467ca4ba9b264fc2337684a4822b81841f004c51dfdcf193333cfd77c4de3a184db0ad10b8f8ce3f7cc407da369470b88647c8d92d43b73864e942d37f388ff7c3c0 -Signature: ae23d943a56fc60ef381a2a5c056d24e472e9e906e4af1bcc91a27800b99b7cbbae8d4fc303ada82 -Test: Verify -Message: c9db3284c5b9a283f38da98655485939d5662045b325ccae3207df72838a1660f22634364f8814fe9f0eeeaa0483e9efea1ce25f74b37bca264268d6d3a3f6dcc986dc063cb347a7f08220db2b97a060dae317b302d8f86e6aec29e287518af0a8f2c32d62b153363ee0d650a2fe9744fdb3567a370e5a5458fdbbce770de953 -Signature: 06bd46f7ec091697c86e82497dc184139a988e3b9adee67ce3d87d739871fb1cdcef9dc6de421615 -Test: Verify -Message: e2e5fc81619b215141e12ea9544184e5ebabcb3834e96dbad2464fb5be7bd22c5dda0aade2be3d59e732a03147e04da33f3c8854c4f23330278e8fb0e76b356bd7de54e071a22c827987cb05d65708e8ac09bd43be2948d304874443881f84bd874852b1c421e6e52f3929bdb77eabcd6c68e29dda66a4bba189e807596fb93b -Signature: c86708f91828158b1c129e48ccc6adfdccf4997e8eb2214c24fd4bf4edd8ac1f3411d77ec65321c2 -Test: Verify -Message: b9a5127b9995a063f3422d3069a4b22ff9b7816e01ceeb3f933733f1fc11b3ca8f694d49b79c159a3ce93c59d555408befc452dabd54071181fd43d8196863b1cc0caa32568fee84335c841c298068b919cbb19e06233412662b7815a916da6408c501af8f2885196ed3dbf17cdf84af0c047632f5f4ca39dcfaa81fc5d370db -Signature: 0461b5dfdcfa1f9be6e7528478e2785903f0b8990f2354209554aeedd246d231567b06c5f81e0842 -Test: Verify -Message: 38da1e2a517a87304f85291a67e7a7ea0e637e797fa1a122707b58ac10845b7d44da2afe232eaf49b011171ad781edf4aab47992dc2358927eda5d5df9ffa75a4da2035389c484278aaa60b1f7630ef97d979e9a48935873c2929892904ee95dc9c7610279533c2256e7bcb9c1a4405100a5a367ba08d81db43bc322cb885adf -Signature: 3e7f697603dd770218ff55f027a8fc980763b6b9bbe84a766e0e55fc7c23e4f734d28f67fd73e14c -Test: Verify -Message: e431f4fc91ec6111098c5de4532c76bdd3ab9a42e92c6c10e7ccc69539a38f31cffdbe8dcedaaf3b78a3a68f592fa1bcb4f663332d94bd38b8811fc7c10f60a69da5cacb303a6af0e0159675bac3bf76e459782d43ebc7896c4dac0fd009f0f224a0306e0f06296a1858454ecee06722394bf4e88129223adda68528bf87d74c -Signature: 2b2111694dd96095c76bd18fbce8f720ddcffe6c8d9c194e880b0abfa44bcaee6b97addc84c519de -Test: NotVerify -Message: 2f3e3407e1c3e585d3f87ecdf8ee45321c8d46ed84410565c7e282c1ece573acc5c2bd688ba53416bb5894433070bfb782b7397b9edae229a653f2780b993a07e887996aa20bbd73be101bc203ad318fd18efbb7c0a3b4057c08cfc3e03535825167c0255d4ef73495f80c60a8fd1352c1ec85b822f6f59201da10baa310dbb2 -Signature: 88ed45212439c0cb86f513026b72002cdae6317544b95fcf4dd1eeaf460edb6f5891080272a3b31c -Test: Verify -Message: b3b7c629f3f5e85b35f7b95d9757a8dd980a2acc68fd9f1b74ee82af328cd5a62ad2ccce45a1b8625a9c3706f6499a066c6597cb1e88309f0afae3a298d4130ca25bb6a5c5994181e73dd00109b59a074e8a95794cfb65f993dd8be27cb2cb863409dea709155933f391dd4466d38058562f7ccd8c8f17a02850d267775fd58c -Signature: b2101fe80d5d71592eae972be0cb7f67e0fc2950bf60fb12b91a1a63d9f4747c1d92d2712cc33300 -Test: Verify -Message: cbf84e9aefa950d9c997dcb571a50e25c09c7ba40e730a1c28e112109621b4090b057b442c3e339a86ea07afc95fde5f4a37f765b99cc34e1fd5039d1b1122405d74d5336360f17273058c25da2b5807633f3c181a9d3483421d6ad294e09550bb5c93bf0ca6423b8affa46e1aa232f603cd8113a90e13958ad080057925c612 -Signature: bb80dfc840147d79654ed993f5266da74985e2225e7f5d61266fb1caa2deb06fa3bebd930122cfe4 -Test: Verify -Message: 3f1ba8edcc9ff1dfe2c25c860202f927af2188fe5bde071b8fef797c5f42f96c0d75001bfc94f37ed912f06a040adaec45b6a3ebac30d901c96974960d67de3f80c34456a5621cdaab73f788d5a9893b2bbaf68162185f7f09efad07f6609df7f0fb0cd59e8284a8b0dd08194c591dcbbb2519f7540fb04ca97bbc06f1a44d4d -Signature: 06c8b4f82b1e5429a07857ad5a1753f1d7cb43b345bd935a1f203ca2e69fcbd2321b295b1ed3c2a2 -Test: Verify -Message: d0b56cf1a2bf4845544090bc5440efaf864b8ba6205a03e5cbffac3af8d50d067f28988a7fe0ab7472b3c7aa8f8b0f5664350432b44c80168f65f0bfb07cd6e11b9f7e70f7d9ff2ca961766b33047f2bcbd0f458bf02e95a8932e8e22ebd69f6dc73953bc3823d8333a21597f8833546f374d1aefa5438c9f1be0b3c2970c05d -Signature: 035b9d105cbcce5d24fc186ff52ca07663ca774e057e6de4f5cba8df8b24cbd361df4878c6ebd3c8 -Test: Verify -Message: 82f8b357919acf5ac548e01bbe97782acc131a157d1b616364ff6dd32c5993d1dea9453a6f343e518e1ef301abc636554b632d368cdc7363f3ec8cb67e768e95e6260eb7354a491989ef9440274005b0c31b63ac0ef54c3081efa52d6939470433a8e745fa9346a94ff39b4e47ba3d31cb7495f11c1c44c2a54190b0055a1416 -Signature: a4e3cd2cbd2151d2033d0a56fa7d388af1e050efbc23bdd5fd17061234244d0a9511b84525e719bc -Test: Verify -Message: 5e5dc7a9fad7608fa377eee0d126a5377bfc0b9c11cd19b3b7f88f25c36c984f78fb9f2a05e3707bb99a933b88dae649c4ed794e143aaff1b911923d02b3764f0da5d244bf375b61064f62854e7b6fcc42371f85c57b3b562f891aaeccf5396c93f518cd23ea579b032f12941b2279186e71b4181aa7f63b91f7df51194718fd -Signature: a96a7dffb16216ec93857df38b10fc73c4792e61055a3d5c2aea3e5193113b7d0bfd81f6c3b0d01c -Test: NotVerify -Message: 9f8215298027d29e4128e75b86e6343bdebfd7f0f60bf417ff57c49a5ce1e14b9154d0be68c5cf6765ede1f56ca818eeb1af228be19217d68ef98202e01cad0b7a7f328eabf3bfebd6ca2999245ab4c968b4a13e52a6f96cd8ef99d0e1c17f8f347d5352a1aa39616e36d6fe04f1a104db476cc0a33e3210b4b022bab7c9ed0f -Signature: 7956b42cf6762bfa1d84425dbde83554a598caeb6e3298db6c225befa59a9840faab00f16b662ca5 -Test: Verify -Message: c196e14d01a2abd6dc046801d766e076cae2539afa2ab5597af92c35c4bbcd8f9378923503069f2dec6fb6c17ba1f7cc1355dd4363417607c881e2e9e5430ffe80b2b326a0258ad7e589d22f270c043a530cd480823f6bd35a23e357aaa804d2411c3d360f58e66c7f29b56314017e5942df2f698f7c0b56eab727964b4222a2 -Signature: caee28fd1cc548ceeb7141e3255c6043751425f2c344e1ddfe08ee2d42ae77391ed03f9baa195aef -Test: Verify -Message: 7d8df5288388272a7473d757c078a6de15994fe827c215d0bf2f6aa50701e1e2141c566cb5445bcd7b78e6b0098d399c9d0f12f5df541530eae276569803ebbc13a7d101997a9d488f4686b7c98b7130185c1c4f157c8fa42ebac032ee8a852891e5c0dec862c513c9950f659aa824129f39c5ee63735ba4a36f9e31a1cd889d -Signature: 75bb8dd4118b861c56c6a56bf00f194b9296bb677ea7ca4f5cda2855253f880473d5aaa8196c39b3 -Test: Verify -Message: fca73579a6d91eabb3401ed9b9145c2bc94a7066a85eba514a62046a95485bca536c2a5678659828970d253c9fce805fda30ab5527a0514a7783677b867b0325dbf979ae0303bc120947f3913a615a9717695ceb9ac1ef1cae1d2f29e9d33e6f8c655bd8bd4c41420307c22e0365a4aa790fbc80795849a0e84993cb36e8c482 -Signature: bb488822df803c1b8b424169ebc82e4638af6d567a7d2adfeaff0861631adc4c602a95a7ea8a0c00 -Test: Verify -Message: 2e5dd807911f65df6c7b71c9727137156df8fe02af3c1e19bb1d51cb35e43d4e07483eb5d5a1784ea46b1d41c6fefc66088c4b661f5bb5165044a710606dd893bb43179de8ba59472cc902617d20744eab2cd621ca4e26f8e2578299da47b24ca247faf8a0e41f815e8eb8617150b785acd1376a868c8878c94c799e7debe530 -Signature: 02bd342623b4f7cadbd88af72c8ccfb29f85042d4d2d6853d6a7769f2ed879fbed85cc6c7440fcd3 -Test: Verify -Message: fd149580b4d7b1e3799006d6c37974de79658e074d2d1cf4585ed124f7204986e569464099642cbde21cbaf5c16d0a01872dccde2f96bf81fef7711c599b37b0e6fa6fd3e71ff5c4d359e4ac36258e37cb5bbe53d7992d48c8ed42f90fc60e793a1d88d156e00510849ffb94da79f7987d49dcfffc0e5d60ef98bd52d07ac6f9 -Signature: 52c97e4fd456b9a2141afde95fc0ebf4ee2a509f274e31f5a6ee2730194eb09532d7c12583b2413f -Test: Verify -Message: d1197e08ba9f4654452e42783e664e3c7ad5cd9de2565149c0aa8d5a49547d576cb9d369da79a5da560856d33e91c2565b0cae7ae59e6ee7da31d891815469b93954b621879c168e5f4a8e84b313fd3d3a5989eb828b493039bc33dab88749e3d12200a9dac0f16afa2dc303b3a557e9b0f53668d1d5381b748477ad07a573ce -Signature: 41b31f1faac06a781ce424ab9ec6cff44f1e015bc7237a3019af5d73774a0b60345b6ed2293b7fa3 -Test: Verify -Message: 78cb9e8764eae88cc7bcfecb525617286955348da2e9c0958124677a7285334108c0ee2475d0b3404940d6806fb5f7c965c06166bbe3a9b7cfe18316c74be80acf4766af95a4c765011ce6b839e8cd90d58a139a60d675f60f42b421c570ae2647fac001bb7d5b5367e8e44da806d2d6324a03ff87db5ea9b9e0af75630dbfed -Signature: 62a367ef341b27a22c1ecb52dcfc34180902479129796872ce1b0cdbb678fcb0df10b1f37da5ac9f -Test: Verify -Message: f0e673b363e13da716f3288bf4b4993d6ff109e72a28529ce9453a2eb69b3d5256249ff7ebfdb3e3ea1d659040550e46c08d7979d03d3165552a0ee8db63ffa0097b19454508e148a35cd6ad14834226cc7d4371f3bc14f391e1a196b3b44be0e361f854c7fa5f0d18299399c635cd1469387e86eb9f947e74e20dee9785ba4a -Signature: bd8054b1502e66908555110fc569ac6ddccdea0285a04c81b9ed46ff160a26eedfeb4a8255147239 -Test: NotVerify -Message: dcbaca556bcbfcc70d2164b348b037467071dc423c11a549aad8d06716ddbee49668724899a84daebf96084efb29f246e7bb6ca967bba2ca82948bca7dde246039c4e8e8cfb593af694f197d6488e164a41f46c8364250b02d81af4cb6f2f9c67da6254d454c4860c3248e58bb277c395d7564bae2fe299263753405f972b7af -Signature: cc52d6498a412d0b801d243e37a0291644135294bb91fd182f3458c59e60725b21436a401d534497 -Test: Verify -Message: 901bc4215934ede2f6835d615c38953a95cd48bc09a249a30edcb412b37f5cd4c9ca75d433d383da706382886614579471a97647acaed5377f511241697fe0c90f42b735865abca8dd1beefcef86930267abe2fd143ef25c6f79e2b86a314a0e7b3ce23ee90271c35661f9b58ec721fc8f8ae2d6d88b768cf70c7e704dce721b -Signature: 69fe1c37cddc2db194719f80d9db24c60618f5e99cda4d645d1be7c3c4ba192c5d8606dc9c2cdc61 -Test: Verify -Message: e524024ea5f5ef7baaf30efbfadbffd9ca00ccd03d91c23a612e8d3c67ab933023239253c4417cb0d5cb934c7370c193d0d23a03e8d75417832da6766c1c605df090eb4a9966c1ea2cf68e45e0e28828e11f0bd305417ae4ce0b5283a0378fcf438243899cfb75ffa88e383cbacc0c6ef5fd7a970c68ea7839e1c8bb7c94d760 -Signature: 41bfc6a00915f9a7e24e0d4a7a1220aa0c0f3127b0286f8333c9b002a4acba9673717ffb09368caa -Test: Verify -PublicElement: 1dd203bc368c505fafbc02d560b4b9f003d93be0f78a11fe60e94c406890ce920be3fab9d9ffe84b80f3fdb9071dc602d7c8165fb62e346847b3918d450b3dcccb4bcff0ab98e3052ae36d1a65caa37c7187bb620c5147870ef676091f5199be871dce4fcda065da9f3568fa70edd637450acaa7e42f128b6a3a0519d86784d4 -Test: PublicKeyValid -Message: 691699d5c945a8508a41c3c83f768406a904e3bcad75c75e76becc40e67857f0435fd8d61f0b5f0b88ee6276718fcd2d60064b0b5ab7d48d0c5377f23b0c69936d174f80d968c95c8ca93f7bde7cef3914f2379e574c202fd5f12c1735af62774136970acfd2fefdf068f20e5cb403e31dc140ad7caac5fd298f84e6aeda5855 -Signature: 9c2687d271c475a3ca252997642f12c2494e6e1612ca7c28dcebefb178a72071de741a27699cbb58 -Test: Verify -Message: ad15c247a6d92417670bb015e2c56b2170d449feaea127d898600517e37d88639f43b0f80ecfd52cbf34e83deff0e860208fa308fb9eaf7463d2a87cdb79ab9c1a221341ed8973544dc5d405c0b530d9f5a72ff69a4b20af81d83b4bf47c151b560a65bbfbdff6a74915ec020fec3ba325746462458072a12ac8351de75dbef7 -Signature: 3edf3214d7492ead518c21641cdeeaf11955cf2c9fd41dd6990a3d93b5b996dc65b4480102910be6 -Test: Verify -Message: fe8aa91c3ff17c55cfeb6ca7d7934f00e1ea15bb63b4fb9d8a94f410486b559ea1eebfb131865289026c0f7e8d058e780e7be2ac0d9dca9929f91942283868ad3cbafa9c9872ef8a3303ade9dc1c8b9b7f11c0afb6ba8b5d9391a444ac07e4e2682730548a6eab50fbe91c60dc909d61cce2853b76c398e25f926e8def8f2136 -Signature: 454f59ad954b584350b19484ee93f3fac35e5a21025acec86b4d2cedb998a838f9c3d801acf7ff52 -Test: Verify -Message: 53bd313ad31f55de5bf21a35c1a6291bca8e6e0b206736489726884da107c1770fd273f10a707fe051af70d0b5521b5fd25d75280f9fb5f2d880aa1a1b0c5e3e0140ec2bee959f09bccb4cc633f7f2c0ccd08fb6a73645f0ca04aeae9c177ccea19f55c277a5eeb212dd66ed34aee5963080758bdf452099e34a4bdf1b405280 -Signature: 7408d817a92cce7b17409ca4a522ee8d2a05bc6ab21cfaa6c48819dde84f86090139f18c389ec906 -Test: Verify -Message: 8d67b965319d7ea31ecc8f7538b0042c8175e4de45b0eb7d869b9e3aaa918d1964cae8d5e05846f63261b131009ef5006f152a824c137f957c6c4a31a6f64d081e444b5c159fcc20004b2c5245f8ea982d862f1906fd9d9f98cd5beaca425e57954bf9b22a6ca8585f00199160b47c2c93410c5ccb69ded3b135ea1d706d573e -Signature: 3c2251163492bf6e777793020a5010959d84a258b28ebc211aeffb54f4f99500f88cf0b2eee180ca -Test: NotVerify -Message: 8fa0b50bd675f973a529cb90f5a7be4302794ed969f31dda80a16e0ef6efe2d1ac177399d350aec5463535a82a7374d6c4b7a3ae9ad7fd28cd3f3fe0b69e6363c0d29eba861297352d5bea7a031cddcd582561a29dcd4c60bc63d678b7d751a683a92d8727132c5c1172e11db8fb6fc2789b80cdaa2e841b03e52ced2ff12632 -Signature: 4d6e667824358fe066bf44377146bf2f5f2d92d2adc0aa673fc3912c3ae67bf8d0c529fb1c25776d -Test: Verify -Message: 17aeab19d1ee54e4aaaa66144a82f1a348dc53f8f1fa9d1b575c44389e580c5883f8315b2d14d83838b1b679009800f12b3a92c179c4638ad07e28f4836a475fe21900e908d0d6a0e0dc44097a339ed18d4c45d24c400f496e22f556789bffb54dca6dbbf95b2794bae667bb508aa4bb86cac22401a779d049ff035715250ad1 -Signature: 570867e6fd129769612e82d31a833ddfbb9a07833815df754b1db1c729e7a85fa4bee867dbcd42ce -Test: Verify -Message: cbdcecd18c9984a189ddd576261b6aebaf3030639731cd79ef7a3faa2af4b9420fa6bb84ff7f701d69624ccb8b73e6496ba1137f157444e81618224339ab687d81c300de67436173556028bd62eff59850f1896dc3611d9cc43c052476d28695174df4383a7f107c43f0a0a4232750af5539c98719900f6ef0fe20a65802cb60 -Signature: bed7f5866b9ec24dc7f0ec818262aa7a2197926c314a353cfdb5d11c7e57685ddc0c1863b7915521 -Test: Verify -Message: e8cac9ce0ef12933d72bb5ec654590ae24739b0b378f75d32293d3acb85902ef4791b9c603032484b0072f45944210c79ca21787cd9dba1feea5dcdf74ef5dabae66e81531eaf9bb86ce2de21390ce5347da9f760abae4ad641eb5f46c9385b6733feef2721cbf8eb27748fbbaa8e40b7d13c80fc55f0c35daf6f82078bd90c9 -Signature: 35dc7ce798a62cf86653c31306ee9dc5a8ffef2a8c086ebe25b001f990e5f511f780ad9d7eeed027 -Test: Verify -Message: 95f01262b79dfb8fc98a0217a661456a8b97042d6dd524499daae53a9a70e096377c44dcee8a528083671634dce0677820eb21640f14a2b4a22b8316e32c98b10f6f2af6e91073aa61a15b34660f722408d22e05d359666567b50e225c8434f655203c46620958279c914bb1fbc65e897ba4a2a96f7c697325a0fff6bb50ae7f -Signature: 9e75e572e76eca4859c954248a01d31921da32e371ecee37eb40aa9c13ca2e65961359e4466e9e72 -Test: Verify -Message: 64414cf10d118df7436add5cbd54ba23e8af55f7f79d44a22b1369ce64ba21fce90cb1c274acee4981062d07d9276ab859debca30814f90b5969a5f3bd1120176ced102775ed0d4604a58cc3f42e0e179540891fbf8d179a1760dde6a1763ef7861d4298288b41e66481d30a2620fd36330b94e333bff649fe2fea1e28a3d493 -Signature: 212c24985e37ee89e71cbe6d6012b89fa181db569227db91fc0b6f557f377e380cc56c271f7cb77f -Test: Verify -Message: 8dcf3f1d21a4d1e15238b6db0e89798e66cc62b60e7d0eee15a550a2e56b47387ddec07aee02cd471418a77a9733c21b22f82ec5e1b4365741a533dfe382b1c3e24cc6314659aecac89eab8ac93c1cfb8d4edc9abcf2de891b95067786844acd32b0091b21c2abc2e65f7be29bbdc1862066230e954c3edd1a0e8044c68a49af -Signature: 7add75db81ef8d210f6dad09da3d11381324430bc473f003495c0288a42fd93957dfa5321bdc3d82 -Test: Verify -Message: 0ee654428677f6fd59e6cdcd1406dae8f753dcbca966a88e1db8ab5abf9bbde6e47528287040f8dac93f865cfd023fca2f9dba5d4725fa07da6b004a57fc955a73595573d773007c096afddd9987309e8c78fdc10dca9de053aca00bcde3c3dc9508f5dc1409a41bf1e04c0a408d429ce85abe9d554f285260f3a4527b46e0a4 -Signature: ccfd740744131a05fbfebb26edf96572d3475d6441c042287c109e0aaa4e9db694d074889cb55dfc -Test: Verify -Message: 1a21fb1ded7d167c9a590c8bfc4abc10ab1aab159476b834d9d91e24ebb8aa84e5ee3ee72c6b87214519fbd2f70f1630a2fad519dec7735857966237e8db8d46f6d6cd6b0f36aa2bc4095337c4e7e03a3a60c6e268a29b2d846f0cf6d33e1cbf04b09fc1cf37f631ce010cd59b2b91c82b2376896b5ea94b193c1278e438ce87 -Signature: a07b8566ada6bbd54b5fc36b4a3b698cbf60c1ee912a5197ba6e98bd4777a884d6bc66022020de8f -Test: Verify -Message: ffc7c4abcca3dae4c21b311e6fb51da2262e53dd491ed515d6cd216d34549a1c40f836ea93c36aec17645380c949258bd0fbd9f2bfb9135727585115615a5a7e9a4ee6541f678a86eb60e72c6e8f14c4a04848af4675cce784732002a42f6c6c25812be108c8132956c74718f6c0c0c5adcff80a7689d93c05d5e62c960aa95e -Signature: 60b09ca0f393d3398635c5075d114429b6cdc8bcc7e66888f49148be9a9f96edc5014b106de6afe6 -Test: Verify -Message: 88fb1d5c4fe552db3d7213c906f74702fc102d41cfe636138ac123fbcbce5fe743319fd36e4eb8bc9355c0c7fe0c69b27de19a7c182f4e5016d0b2b82de57aff08e284e7ffdcb18c1217009826cbeba9843706ff8fe9d66ac64bf073fa7253cad02307f07927f625b1d10994f6cd87bd0b2aac23acab8638934a1485ab0ea11e -Signature: a4e8a3e21168f000ced52e3a35573fb6ba82eaa164813969ad388163d2cb861f472e7cbee985e0e1 -Test: Verify -Message: 4593c65d5e569a3d1369a916c8e6d4f541080dc192e7e51447745056d5b7bc1c404852c00e0d8b406d32f75ca06e4aecaf74a87f4fb7323a0f63d1efc598427c38e963670f15bcb7fa0451151f05a724c747141d49954caf37562916c8c4ba7a866c908a38e7445912d74d781b240055e078e8d457f9492b1646ef03b5b43ccd -Signature: 8c8e17b621fc67bbf36704f2356e7755d960fce3a52357c84b778376dcca9f92c91b9be575daf7b0 -Test: Verify -Message: 6180fb71de61a23cbe0d4383386e0170da515bbd67512b41ef03e0bc2d63fbdf257fc89ffe625fbb1d43da8c84efd80d6974322a1a0ffd4d1158c02753acf7bc0edbc8b2721304dacf0d6100f176f6efb9a0f8c8fd69b385a16cccc9f667b5ea52ed7141f14c8ab10cc1507638db532f012d232fc6384700d7977b39ce6c2f82 -Signature: 4156c005b5e099e4cae1d24a4ef35ae0749e4cdeade8929a74ef00f4f57e18c864ae6a376d8bdb55 -Test: Verify -Message: e52be63c5733b8e9860af61ee50f73e7f679522cd72f31af10ec93469c938e5b35d0b7a1e4f14b18c9039f442831caa9b659908b22ef92e4e617b4a54ffecf32ca7a981872e2d011d72fae3a11538a9306d9cbb7f8bf12de5291a710b3c625ab3b5f621816bea1ca48c4fb78b82f0b9b7e32d92a71560994ec9145ffe1a4e7c0 -Signature: b07e9d17a45cc2ceeb1fde1299ba0d6b3bcbe7dcc50e823d12ae5d86972fc6e21d499d38120d7638 -Test: Verify -Message: 1b223eeb3cebfc1575b37c5eba339ca55ab86c9300a64fcfe94d4f6467f1c06f9714190d5f060f84abb0f3b0e89d4db0c04abad218af03bd480d7fdd9afaab1405ab079e2a82334590d84ac71c0c7f85d4ccf76dd5a3e62992c4ec894f15b22edd7fc0789775a2b29dc33c7d5099697a0ed7db3b2f9b2f6c40084f3e7e590d15 -Signature: 199d5f32d2645a1d46ef1cb3ecb15a34eab59b9a8c3cbf5810966097bb9c280e812c22ac298e156a -Test: Verify -Message: 7296f7fd229c0893a84a5b7ee87a034416e5ae1edf1e7416d6c9df5f20213cf564aa2175ed32403f220e6aca2893e747d5d3f579d8999ed427a7bfd5aa2f55a1258f0be16b5102dcc163e0d790931baa504e87a3b1991ea00b501067089f0b498fbeccf8f4f1e7a55fbfd35d7a7239a55fcf7d55c0178eb2583eebcf936af626 -Signature: 5e2044f956599ab077c91e0f9f9408dfd3c458c61fe6edfab105b1f711919c0b43bbb7557252b193 -Test: Verify -Message: 7279097dcfe09b8615d3275b713dced645da08ef435fe783c5e888676fa3daad07bb933594886f78b6f4ab914530c28d2e9967f48ae5c398ff92f09d5c90b6c9702d850d2b42b355f89cf68d5aad25f4c5742ba5bfaa4c62372e9ca425b3bce164a8d81dcc67deb494a20066e60b6da3c4434b191a06f87c249482950362658e -Signature: c2b345d1c28a149215db60952dac2854103f0260bd4994a0b35394474ab82958d7ceb406f6285f4c -Test: Verify -Message: 7c9b50842db0de693441a2c13323de1369e251c07cd49c41877ff69b672d142642ce53805a0e28cd11b7ca313c491e8facd7e382fa241e9d93ffc8df05dcb67a89b4cac6d01e587f12aedb47558ed958fb5b14898f43f284d15c2f46ff47c1d866050b4c2a1947fa52df2dfc172ce9e86d273ccdd368f070584f82c8eea60bb7 -Signature: 363c61fe40b4c0a4f06908df5c46d8a9c98dee71cd1c56f8d7a16c081712cb1b8c92cfd00464a3e7 -Test: Verify -Message: 0bf43670b5fe01cb48e75a19b519f324451ccbb3d85d8ef15c41311b906aca6efb48ad5027e4cdbd23e951f538f47564ea1da4d133c6d4cbfba32151db0aadc1137db703c975faf58471481ae93f677fb48a2ceffaa5d6579d97ad7c1067dbdb4da98ae01349404c659777e04093804f9b7b9a63a5934e6e3a340df4a7180d96 -Signature: bbefc869907609019f4a85294aa854961e51c4884c235f4cdf85c4c3e0ff34069183ebf0ef50bb9f -Test: Verify -Message: 419ff761987d7257a0bc8817abb4077986972726e6ac93f311cab67ac91747fa7d021871b37f1bf8b082b55e6bbf4709b1a0fa099986cc7d2b44d82b4cd9ea5bec6e43f47490a9da6aafb38767d753e83bada47a5eacf6a59aa11758f665e4e6e7db1121b22a35b5253b19c7767542ce7bb7bcb10c972922b6da0b3aa1334e56 -Signature: 29becc5afb5ea31a71b4169b91f9594d0819de2d409e4c0c3bfe8e2ea53e98dc1ad4a72f3e3081b9 -Test: NotVerify -Message: 31c4c31942471dd6583810807472b62ce7cbbddbac7de47f08d7bb4b6024973f5adcd3f4380a4ea571fd227f9133a22a53829698fc88ba0dfa55746fbe58d6d0d687d43a4fd3c7ba4acb21afdd8f72542df89c8cc90553ee4989d8112713f619dd1e3d82407a7d2c1cfa87a8115f20c1ad84454ecbcca6382bc95dc6532eef31 -Signature: 3c999e56f7ba49e48cb72c76bb7848d4562aa96dbb8c5a3adc19533b00cb2a421fa107b0b956452d -Test: Verify -Message: 64a5d78514c2e26b011e7bca8ae480a2770cb50b03bb6fac29db817c30fb6bb87a68c225898ddb885288bb62c70e43f19f8198646850d15dd08ee5ad30d6d34b595e1395a4593dcb3493f8c98e4825055d454dc87f4249b1537e3067469c869e9cbda24d7cdf602d3f760876fa497fd5498facb15f492d9f4be23c238d05dbaa -Signature: c3a0e8c6df40bb4d672d2438f4f770c141054f1e0b6cd25a0f9d0de138d6c8eb028ae0b23dbd2720 -Test: Verify -Message: c4d9d647a62a699ce00ac9c55b2197a796fd1e8e2120f2d75a50cadf671a9c2c74a8f7db2ec5a549802e81058d1c95f6ee0e78c92ddce79e82f9a3f3cc088ad0d3a2f934bd6661c0ce4327a26402c2c432171036bca8f8da13df464ed36dc31f5a5f942b4a25d55741e07673d8ec556adaae9caec69f5ee387996dca72617e71 -Signature: 1145693d535af4e7b13ed5801c2539db279007dca94800d15c4f2d184c71cf793feab7e46c52121b -Test: Verify -Message: 9981198067ce9d394f53f1233ee06b86075ed7d61142c04f3e54fdcf1ea280f454bf5b76494113c6107a2ae89a76e78e1b356876bc2aeb0582f459257e5b145b368e022d539bdab38d2fae7cd490baa4c1d86b333c74b3b86edd8c25e995cbee1664275ddfd489399eea969746277b00d0c0f8c5e919b09eda88af89b7473ce2 -Signature: 57f2c2fd72f077ef67ceaf46d99753bf796a4712a018b08a786d4c40136256ac0a8618db7dd1eb28 -Test: Verify -Message: bfcbe3e18f4423b9f21b33fadb4763c2e4221126f11b6c79099e6bd9714008000a2fc249edda520144dcacf16c2e3929488e540ee82a03a65c92f723d2dcc6aff61967778bf8eefa46b98a94eb55bc45aaecd9c7bc6fc3d13a8ee4a53de46be03c61cb82a2f8703cae8bc4fa901362b1c2149a6aa440258f5b6a2a76ebae712c -Signature: 5c141ab2f4ee5a513c4ee7e9a5e770f294859b1f6551d44ed78029dbbebe181a73e2726f1b553022 -Test: Verify -Message: 839331e55e6928503c36c0530394dea50f46f78d7bd8fea1ae7894c02a136b4e91b3fbaff91869067196b42fd32e22fbcdf0eaab2b9023af6747ec9f73eddd7bc555ae1fa4e8260ab2844750ba97b8ddbc7773ec3705afc6b68310c09eb20d6f362fa22ef71038d316bad1ae500678c2f594e847386e7c60b6e157194499d4a4 -Signature: 0ad3d7f5ea209ad35ba4a0a17e16483c50f5e4953a692ea71730d7c5c4c13feed38ed90759aa2e86 -Test: Verify -Message: d4fdc830db8cef7540b6b3ab242cfe3bb59004a3f3c61b60a37cda1890fc7108093249ae98f9dcb7ffaad62b79e76dd72fa4fdfbf878e8355523aeadac5f4882c5ecc97583d638d5e309a8aa3a189925ab4a9348e7e601d129c14b6d7005381bff4383dd13bcbba6e4ec6081df583bfe229afee237aa1d0e156eecb05485f9a9 -Signature: 189c08e378bc9feb81891706f80a9fcd1f10725564e3814342937391e39f8830eaed6702b8579e3d -Test: NotVerify -Message: 3fb043ac04c26a1d06fa3f3638e0ab0a218b5a74c36243f4ce1278c606d02b44f1d1027ec6069c17931c6463adb495be5de08e2fc8de583e1f187513085bebd04d579130c4589a607e445f1e33d57110ee17df67f524c4b4fb1f150a896fa955aa3d8afbd6307bb12168c99fa4b957b72c29e45222aca00dba1eefe460827d8c -Signature: 65ab093718776e0b945e5fa24014468ee40422b3688c00beb21593dd4785c90b350e9471a5dff538 -Test: Verify -Message: 155f0682c1d481571fd2d93a6bd70e5e2a6fee3702270f03d7b40d9c2c65057eb8c6521448968747d5ebac49e5a4be9f270f616d49dce8061d4287b4ed6fd7c41c368bd6fef47163f9c3ac8fdce330317f657e209c19a2c1eeba6ace8858e86877072a609cc638c2c3b24fa3086c5d2d6cc7bde8b3b6344b80762c83b4f73082 -Signature: 90e0b86567a2b176a74a817d52009c2bb553eb9ac3694f997c5f70ca3936b6d57f1908868ffc7518 -Test: Verify -Message: 4b03e4a77dd910d51e6c170faa228f3d5c258c96bc44cc986a0d244629292ca62ff8277aab6d353e982bbc62c1e113c815e371812d0916c41ccdb83076a03043a38c651b6511796ba83933c18afdadf6abdc3ef6b6baaab230f6896280d0f50040f97801c37c3456e7cd54a31c2eb3bfb54bcc6c6e0de2583fc270536071d3d3 -Signature: 999adeab789df72dab3c86e115140d0dbb4905adbebe59a1995fbc73fc678a8ca89d7b6cb644569f -Test: Verify -Message: a59d6636f5dc1fbe82ec2df71a90657f5ccbbcf1af6e69157de03b45b42e3c227f53877942c96770d450b1f500fd64683e877e87aece219a56ace7e19d01823b07f9981733a1dea012aa7324697c7fc68a7e0c654fa524cb573b2c1a84f18074b52850eac17cbba7b4932a5e4d24eef1b84b1d62880ba9fff824c2ca63186f26 -Signature: 30f81281e18c995d53f02e6d04eb988bb0b8bd3f1af1a7c8447c704f06d7379dae2ccf95ec13edd9 -Test: NotVerify - -AlgorithmType: Signature -Name: DSA/SHA-224 -Source: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf -KeyFormat: Component -Modulus: C196BA05 AC29E1F9 C3C72D56 DFFC6154 A033F147 7AC88EC3 7F09BE6C 5BB95F51 C296DD20 D1A28A06 7CCC4D43 16A4BD1D CA55ED10 66D438C3 5AEBAABF 57E7DAE4 28782A95 ECA1C143 DB701FD4 8533A3C1 8F0FE235 57EA7AE6 19ECACC7 E0B51652 A8776D02 A425567D ED36EABD 90CA33A1 E8D988F0 BBB92D02 D1D20290 113BB562 CE1FC856 EEB7CDD9 2D33EEA6 F410859B 179E7E78 9A8F75F6 45FAE2E1 36D252BF FAFF8952 8945C1AB E705A38D BC2D364A ADE99BE0 D0AAD82E 53201214 96DC65B3 930E3804 7294FF87 7831A16D 5228418D E8AB275D 7D75651C EFED65F7 8AFC3EA7 FE4D79B3 5F62A040 2A111759 9ADAC7B2 69A59F35 3CF450E6 982D3B17 02D9CA83 -SubgroupOrder: 90EAF4D1 AF0708B1 B612FF35 E0A2997E B9E9D263 C9CE6595 28945C0D -SubgroupGenerator: A59A749A 11242C58 C894E9E5 A91804E8 FA0AC64B 56288F8D 47D51B1E DC4D6544 4FECA011 1D78F35F C9FDD4CB 1F1B79A3 BA9CBEE8 3A3F8110 12503C81 17F98E50 48B089E3 87AF6949 BF8784EB D9EF4587 6F2E6A5A 495BE64B 6E770409 494B7FEE 1DBB1E4B 2BC2A53D 4F893D41 8B715959 2E4FFFDF 6969E91D 770DAEBD 0B5CB14C 00AD68EC 7DC1E574 5EA55C70 6C4A1C5C 88964E34 D09DEB75 3AD418C1 AD0F4FDF D049A955 E5D78491 C0B7A2F1 575A008C CD727AB3 76DB6E69 5515B05B D412F5B8 C2F4C77E E10DA48A BD53F5DD 498927EE 7B692BBB CDA2FB23 A516C5B4 533D7398 0B2A3B60 E384ED20 0AE21B40 D273651A D6060C13 D97FD69A A13C5611 A51B9085 -PrivateExponent: 00D0F09E D3E2568F 6CADF922 4117DA2A EC5A4300 E009DE13 66023E17 -PublicElement: 70035C9A 3B225B25 8F16741F 3941FBF0 6F3D056C D7BD8646 04CBB5EE 9DD85304 EE8E8E4A BD5E9032 11DDF25C E1490755 10ACE166 970AFDC7 DF552B72 44F342FA 02F7A621 405B7549 09D757F9 7290E1FE 5036E904 CF593446 0C046D95 659821E1 597ED9F2 B1F0E208 63A6BBD0 CE74DACB A5D8C68A 90B29C21 57CDEDB8 2EC12B81 EE3068F9 BF5F7F34 6ECA41ED 174CCCD7 D154FA4F 42F80FFE 1BF46AE9 D8125DEB 5B4BA08A 72BDD865 96DBEDDC 9550FDD6 50C58F5A E5133509 A702F79A 31ECB490 F7A3C558 1631F7C5 BE4FF7F9 E9F27FA3 90E47347 AD118350 9FED6FCF 198BA9A7 1AB3335B 4F38BE8D 15496A00 B6DC2263 E20A5F6B 662320A3 A1EC033A A61E3B68 -Test: KeyPairValidAndConsistent -Message: "abc" -Signature: 4400138D 05F9639C AF54A583 CAAF25D2 B76D0C3E AD752CE1 7DBC85FE 874D4F12 CB13B617 32D39844 5698CFA9 D92381D9 38AA57EE 2C9327B3 -Test: Verify -Signature: 5400138D 05F9639C AF54A583 CAAF25D2 B76D0C3E AD752CE1 7DBC85FE 874D4F12 CB13B617 32D39844 5698CFA9 D92381D9 38AA57EE 2C9327B3 -Test: NotVerify -ModulusSize: 2048 -SlowTest: 1 -Test: GenerateKey - -AlgorithmType: Signature -Name: DSA/SHA-256 -Source: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf -KeyFormat: Component -Modulus: F56C2A7D 366E3EBD EAA1891F D2A0D099 436438A6 73FED4D7 5F594959 CFFEBCA7 BE0FC72E 4FE67D91 D801CBA0 693AC4ED 9E411B41 D19E2FD1 699C4390 AD27D94C 69C0B143 F1DC8893 2CFE2310 C8864120 47BD9B1C 7A67F8A2 59091326 27F51A0C 866877E6 72E55534 2BDF9355 347DBD43 B47156B2 C20BAD9D 2B071BC2 FDCF9757 F75C168C 5D9FC431 31BE162A 0756D1BD EC2CA0EB 0E3B018A 8B38D3EF 2487782A EB9FBF99 D8B30499 C55E4F61 E5C7DCEE 2A2BB55B D7F75FCD F00E48F2 E8356BDB 59D86114 028F67B8 E07B1277 44778AFF 1CF1399A 4D679D92 FDE7D941 C5C85C5D 7BFF91BA 69F9489D 531D1EBF A727CFDA 651390F8 021719FA 9F7216CE B177BD75 -SubgroupOrder: C24ED361 870B61E0 D367F008 F99F8A1F 75525889 C89DB1B6 73C45AF5 867CB467 -SubgroupGenerator: 8DC6CC81 4CAE4A1C 05A3E186 A6FE27EA BA8CDB13 3FDCE14A 963A92E8 09790CBA 096EAA26 140550C1 29FA2B98 C16E8423 6AA33BF9 19CD6F58 7E048C52 666576DB 6E925C6C BE9B9EC5 C16020F9 A44C9F1C 8F7A8E61 1C1F6EC2 513EA6AA 0B8D0F72 FED73CA3 7DF240DB 57BBB274 31D61869 7B9E771B 0B301D5D F0595542 5061A30D C6D33BB6 D2A32BD0 A75A0A71 D2184F50 6372ABF8 4A56AEEE A8EB693B F29A6403 45FA1298 A16E8542 1B2208D0 0068A5A4 2915F82C F0B858C8 FA39D43D 704B6927 E0B2F916 304E86FB 6A1B487F 07D8139E 428BB096 C6D67A76 EC0B8D4E F274B8A2 CF556D27 9AD267CC EF5AF477 AFED029F 485B5597 739F5D02 40F67C2D 948A6279 -PrivateExponent: 0CAF2EF5 47EC49C4 F3A6FE6D F4223A17 4D01F2C1 15D49A6F 73437C29 A2A8458C -PublicElement: 2828003D 7C747199 143C370F DD07A286 1524514A CC57F63F 80C38C20 87C6B795 B62DE1C2 24BF8D1D 1424E60C E3F5AE3F 76C754A2 464AF292 286D873A 7A30B7EA CBBC75AA FDE7191D 9157598C DB0B60E0 C5AA3F6E BE425500 C611957D BF5ED354 90714A42 811FDCDE B19AF2AB 30BEADFF 2907931C EE7F3B55 532CFFAE B371F84F 01347630 EB227A41 9B1F3F55 8BC8A509 D64A765D 8987D493 B007C441 2C297CAF 41566E26 FAEE4751 37EC781A 0DC088A2 6C8804A9 8C23140E 7C936281 864B9957 1EE95C41 6AA38CEE BB41FDBF F1EB1D1D C97B63CE 13552576 27C8B0FD 840DDB20 ED35BE92 F08C49AE A5613957 D7E5C7A6 D5A5834B 4CB069E0 831753EC F65BA02B -Test: KeyPairValidAndConsistent -Message: "abc" -Signature: 315C875D CD4850E9 48B8AC42 824E9483 A32D5BA5 ABE0681B 9B9448D4 44F2BE3C 89718D12 E54A8D9E D066E4A5 5F7ED5A2 229CD23B 9A3CEE78 F83ED6AA 61F6BCB9 -Test: Verify -Signature: 415C875D CD4850E9 48B8AC42 824E9483 A32D5BA5 ABE0681B 9B9448D4 44F2BE3C 89718D12 E54A8D9E D066E4A5 5F7ED5A2 229CD23B 9A3CEE78 F83ED6AA 61F6BCB9 -Test: NotVerify -ModulusSize: 2048 -SubgroupOrderSize: 256 -SlowTest: 1 -Test: GenerateKey - -AlgorithmType: Signature -Name: DSA/SHA-256 -Source: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf -KeyFormat: Component -Modulus: 90066455 B5CFC38F 9CAA4A48 B4281F29 2C260FEE F01FD610 37E56258 A7795A1C 7AD46076 982CE6BB 956936C6 AB4DCFE0 5E678458 6940CA54 4B9B2140 E1EB523F 009D20A7 E7880E4E 5BFA690F 1B9004A2 7811CD99 04AF7042 0EEFD6EA 11EF7DA1 29F58835 FF56B89F AA637BC9 AC2EFAAB 90340222 9F491D8D 3485261C D068699B 6BA58A1D DBBEF6DB 51E8FE34 E8A78E54 2D7BA351 C21EA8D8 F1D29F5D 5D159394 87E27F44 16B0CA63 2C59EFD1 B1EB6651 1A5A0FBF 615B766C 5862D0BD 8A3FE7A0 E0DA0FB2 FE1FCB19 E8F9996A 8EA0FCCD E5381752 38FC8B0E E6F29AF7 F642773E BE8CD540 2415A014 51A84047 6B2FCEB0 E388D30D 4B376C37 FE401C2A 2C2F941D AD179C54 0C1C8CE0 30D460C4 D983BE9A B0B20F69 144C1AE1 3F9383EA 1C08504F B0BF3215 03EFE434 88310DD8 DC77EC5B 8349B8BF E97C2C56 0EA878DE 87C11E3D 597F1FEA 742D73EE C7F37BE4 3949EF1A 0D15C3F3 E3FC0A83 35617055 AC91328E C22B50FC 15B941D3 D1624CD8 8BC25F3E 941FDDC6 20068958 1BFEC416 B4B2CB73 -SubgroupOrder: CFA0478A 54717B08 CE64805B 76E5B142 49A77A48 38469DF7 F7DC987E FCCFB11D -SubgroupGenerator: 5E5CBA99 2E0A680D 885EB903 AEA78E4A 45A46910 3D448EDE 3B7ACCC5 4D521E37 F84A4BDD 5B06B097 0CC2D2BB B715F7B8 2846F9A0 C393914C 792E6A92 3E2117AB 805276A9 75AADB52 61D91673 EA9AAFFE ECBFA618 3DFCB5D3 B7332AA1 9275AFA1 F8EC0B60 FB6F66CC 23AE4870 791D5982 AAD1AA94 85FD8F4A 60126FEB 2CF05DB8 A7F0F09B 3397F393 7F2E90B9 E5B9C9B6 EFEF642B C48351C4 6FB171B9 BFA9EF17 A961CE96 C7E7A7CC 3D3D03DF AD1078BA 21DA4251 98F07D24 81622BCE 45969D9C 4D6063D7 2AB7A0F0 8B2F49A7 CC6AF335 E08C4720 E31476B6 7299E231 F8BD90B3 9AC3AE3B E0C6B6CA CEF8289A 2E2873D5 8E51E029 CAFBD55E 6841489A B66B5B4B 9BA6E2F7 84660896 AFF387D9 2844CCB8 B6947549 6DE19DA2 E58259B0 90489AC8 E62363CD F82CFD8E F2A427AB CD65750B 506F56DD E3B98856 7A88126B 914D7828 E2B63A6D 7ED0747E C59E0E0A 23CE7D8A 74C1D2C2 A7AFB6A2 9799620F 00E11C33 787F7DED 3B30E1A2 2D09F1FB DA1ABBBF BF25CAE0 5A13F812 E34563F9 9410E73B -PrivateExponent: 3ABC1587 297CE7B9 EA1AD665 1CF2BC4D 7F92ED25 CABC8553 F567D1B4 0EBB8764 -PublicElement: 8B891C86 92D3DE87 5879390F 2698B26F BECCA6B0 75535DCE 6B0C8625 77F9FA0D EF6074E7 A7624121 224A5958 96ABD4CD A56B2CEF B942E025 D2A4282F FAA98A48 CDB47E1A 6FCB5CFB 393EF35A F9DF9131 02BB303C 2B5C36C3 F8FC04ED 7B8B69FE FE0CF3E1 FC05CFA7 13B3435B 2656E913 BA8874AE A9F93600 6AEB448B CD005D18 EC3562A3 3D04CF25 C8D3D698 44343442 FA3DB7DE 618C5E2D A064573E 61E6D558 1BFB694A 23AC87FD 5B52D62E 954E1376 DB8DDB52 4FFC0D46 9DF97879 2EE44173 8E5DB05A 7DC43E94 C11A2E7A 4FBE3830 71FA36D2 A7EC8A93 88FE1C4F 79888A99 D3B61056 97C2556B 79BB4D7E 781CEBB3 D4866AD8 25A5E830 84607228 9FDBC941 FA679CA8 2F5F78B7 461B2404 DB883D21 5F4E0676 CF549395 0AC55916 97BFEA8D 1EE6EC01 6B89BA51 CAFB5F9C 84C989FA 117375E9 4578F28B E0B34CE0 545DA462 66FD77F6 2D8F2CEE 92AB7701 2AFEBC11 008985A8 21CD2D97 8C7E6FE7 499D1AAF 8DE632C2 1BB48CA5 CBF9F310 98FD3FD3 854C49A6 5D920174 4AACE540 354974F9 -Test: KeyPairValidAndConsistent -Message: "abc" -Signature: 5F184E64 5A38BE8F B4A6871B 6503A9D1 2924C7AB E04B7141 0066C2EC A6E3BE3E 91EB0C7B A3D4B9B6 0B825C3D 9F2CADA8 A2C9D772 3267B033 CBCDCF88 03DB9C18 -Test: Verify -Signature: 5F184E64 5A38BE8F B4A6871B 6503A9D1 2924C7AB E04B7141 0066C2EC A6E3BE3E 91EB0C7B A3D4B9B6 0B825C3D 9F2CADA8 A2C9D772 3267B033 CBCDCF88 03DB9C19 -Test: NotVerify -ModulusSize: 3072 -SlowTest: 1 -Test: GenerateKey diff --git a/external/crypto++-5.6.3/TestVectors/dsa_1363.txt b/external/crypto++-5.6.3/TestVectors/dsa_1363.txt deleted file mode 100644 index 712e5ea69..000000000 --- a/external/crypto++-5.6.3/TestVectors/dsa_1363.txt +++ /dev/null @@ -1,553 +0,0 @@ -AlgorithmType: Signature -Name: DSA-1363/EMSA1(SHA-1) -Source: generated by Wei Dai using Crypto++ 5.0 -KeyFormat: DER -Comment: 1024-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f02818100bd670f79\ - b0cde98a84fd97e54d5d5c81525a016d222a3986dd7af3f32cde8a9f6564e43a\ - 559a0c9f8bad36cc25330548b347ac158a345631fa90f7b873c36effae2f7823\ - 227a3f580b5dd18304d5932751e743e922eebfbb4289c389d9019c36f96c6b81\ - fffbf20be062182104e3c4b7d02b872d9a21e0fb5f10ded64420951b021509b2\ - 940496d6d9a43bb7ec642c57b302e59b3a515502818100a1c379ba91fe1f9d52\ - 83807b809c698bce4aee6f405f4de8c46becf33c08a63bc5f8088f75b5b6bcfb\ - 0847ccbdee700e4e698652317bbd7a3056404c541136d7332c2b835ef0d1508e\ - f57b437de60675f20f75df0483f242ddeb57efacd180418790f4dec0a8250593\ - ba36f17316580d50db1383ea93a21247650a2e04af904d041702150355dc8843\ - 45c08fb399b23b161831e94dbe61571e -PublicKey: \ - 308201b73082012c06072a8648ce3804013082011f02818100bd670f79b0cde9\ - 8a84fd97e54d5d5c81525a016d222a3986dd7af3f32cde8a9f6564e43a559a0c\ - 9f8bad36cc25330548b347ac158a345631fa90f7b873c36effae2f7823227a3f\ - 580b5dd18304d5932751e743e922eebfbb4289c389d9019c36f96c6b81fffbf2\ - 0be062182104e3c4b7d02b872d9a21e0fb5f10ded64420951b021509b2940496\ - d6d9a43bb7ec642c57b302e59b3a515502818100a1c379ba91fe1f9d5283807b\ - 809c698bce4aee6f405f4de8c46becf33c08a63bc5f8088f75b5b6bcfb0847cc\ - bdee700e4e698652317bbd7a3056404c541136d7332c2b835ef0d1508ef57b43\ - 7de60675f20f75df0483f242ddeb57efacd180418790f4dec0a8250593ba36f1\ - 7316580d50db1383ea93a21247650a2e04af904d03818400028180255cf6b0a3\ - 3f80cab614eafd5f7b2a6d83b3eafe27cd97b77ae70c7b966707d823f0e6aaaa\ - 41dc005aaefd3a0c269e60a665d2642f5d631ff1a3b8701bc06be9c44ab7367f\ - 77fefeec4c5959cd07e50d74a05af60b059ad3fc75249ecf44774b88b46860d9\ - c3fa35d033bcfc7b0b2d48dc180d192d4918cddff4f7ebcdaaa198 -Test: KeyPairValidAndConsistent -Message: 66B92E1E2C44B80F7BFA -Signature: 06418D4F24A8059553951CA062BBD6E0833ED1745608E1158CA4B8F8FE1CD2AF087B5EEE08FCA0D7A63C -Test: Verify -Message: 973266BB0A492248082A -Signature: 02BA236FE800EECABB85698A76B5485865454B3016010755F0E1BF7CE26FB62BE4FD01141F5CA4144811 -Test: Verify -Message: 9A6D079ED0CA9D8B40E8 -Signature: 045BA3DB16E6B910DC89A2D26096625F757D62077D049886B85EBC7500884B4DDD1898BC52746C54F68D -Test: Verify -Message: AA34DCE67BCDAC927DA6 -Signature: 0835C94121313842ABF04D4960E711D1F0904612BC09840989EEAFF2071522B75957DEAC801574BD22EB -Test: Verify -Message: 4EDAC08816AFDBF284DA -Signature: 08E1574E5299C910694D17075136F41EBD558D1B1805CAA3B6E98DCCC3702F286E76BBD29435CA2CEA5C -Test: Verify -Message: D82F2E903230962B8174 -Signature: 0366F1AE94FD2CDEBA4EE879BB8923F0E49CFB921008E6A5C7457E88811D46DC7F297D6A96E909268244 -Test: Verify -Comment: 1025-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f028181017310bf02\ - d70ef2cee45d1cc47ec8ce8cabdd6bf32a560975a42ef057bf9dfd553bc9368d\ - db154a55d855edaa755e69f511a4c69ba78571cc4b14ddbb0f32a4a9c56c2863\ - 05aa21ec4e35de7390747477b3bd574e7b87cbebde2f665703137a1172350ad2\ - f48a0884d076ada9db82f104e6b0ad86693cd4adbd0067639102fcf102150b39\ - 49dadf3196f08bca0606f06443afce2fb1d02f028181015f0f6d1729ef2af723\ - c00e36450a04c7e7681d65b74a6417a53b3eb6036989eff8e0ab11a7ec3ce234\ - 0b7c7a92e1a977aee52555c06c12c4cc28496ddc2598feeb7539ce90d3888e21\ - f61d7f14746cf67d9fed373afd97e2483700e300ed9da25e7200b363a4727ad2\ - 01194b36ea5f816cf83488c3e527d3a5515870d2da63d6041702150696b0f255\ - 468b7ac18e11632f208ca86383a46724 -PublicKey: \ - 308201b73082012c06072a8648ce3804013082011f028181017310bf02d70ef2\ - cee45d1cc47ec8ce8cabdd6bf32a560975a42ef057bf9dfd553bc9368ddb154a\ - 55d855edaa755e69f511a4c69ba78571cc4b14ddbb0f32a4a9c56c286305aa21\ - ec4e35de7390747477b3bd574e7b87cbebde2f665703137a1172350ad2f48a08\ - 84d076ada9db82f104e6b0ad86693cd4adbd0067639102fcf102150b3949dadf\ - 3196f08bca0606f06443afce2fb1d02f028181015f0f6d1729ef2af723c00e36\ - 450a04c7e7681d65b74a6417a53b3eb6036989eff8e0ab11a7ec3ce2340b7c7a\ - 92e1a977aee52555c06c12c4cc28496ddc2598feeb7539ce90d3888e21f61d7f\ - 14746cf67d9fed373afd97e2483700e300ed9da25e7200b363a4727ad201194b\ - 36ea5f816cf83488c3e527d3a5515870d2da63d60381840002818045bf83e62f\ - 50190374b23de5e4a1d0278e9e8e6c8335577d62e80662a380c206e326819c50\ - 82d321dfda1f905fa5a3ead9a2dc769885a27b1fd6a133185dc5a7876a76ab0a\ - 09fe02b7071a924169e4d2d2a67e67ed3628800134183b962c0b313463aa154e\ - 6437d644e025ab234e63d19c129842a61c5e5ea5a06466c858c81c -Test: KeyPairValidAndConsistent -Message: 2F585D0CE4FA1CD93880 -Signature: 0643ABF8D3C2F4BAB02CF79D698948A1A416BEC05D00F33CC3D41CA9117E6CD99E5DCBBD4425DA12E98E -Test: Verify -Message: 4F09A1F217B8393199EE -Signature: 052DE620B5628EECCF7C56410CAC2B72A5AD1B5A67072ABF369453BC28A386ACD5939C9985C09338FD03 -Test: Verify -Message: 03D7110A753B008A76A0 -Signature: 01D44D16B5FDFB8C39AACEA72391A889EECBFFB5E701EB8F46E4FAB96326F73E0CC698E1F66C32FE5C2E -Test: Verify -Message: 129F4781D417671F886D -Signature: 00CE142CE967BA951B9DE26DEFB5B341CB49247C1308515315449B5533ED469B6470C4E3A3751E35E7BB -Test: Verify -Message: 3E1594F559D1248D1112 -Signature: 07B192657E256B60567BF6EB399D8A2DE8FFF7AE8A031A655BEC911A82049155CDB4F2A76A8004AE646D -Test: Verify -Message: D6F0354F1B6B253B6997 -Signature: 07FE18E0C00F6AC3CBCB95874AB66A98E34DF74F37059178C920C5D13CE173B8D2832310B9587940F6D9 -Test: Verify -Comment: 1026-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f0281810250988282\ - 17d00108030801e5f135fc6fd3010be39e49060a96addc8a081198803402c4b4\ - 6e4ce0750fcbab8cf084c7ca8cae09f1b5482d336fa3af47b96791d02d8143e2\ - 74b1325f2213e17f9384c805f479e52a3117cf84869d395f1bc025c918484478\ - d2da1880d32bc519f4e6b2fd2d46958795550ce1765f725626f3fc17021536bb\ - 68cd95dab195f14c4534283e7ea50b00cc31a302818100e2782ad6992f4b7e88\ - 787b4d616744b60e095575a177569c4a069e311e38b7240c43343367e23574c3\ - 0e4d9f05afe1fbe61423bab715915c4ccf28aa0ed2f52b092b86c8ec1f9d4795\ - d6e91c88ba41297625c11a9e1f4f182da13cf51e541038a1266bf32b2dd81ecd\ - 84bb80be8fdf97689942e944b7fbb6981e00cd680ee25f041702152db270c284\ - 328353f979cad99f4133c53acaa6ee71 -PublicKey: \ - 308201b83082012c06072a8648ce3804013082011f028181025098828217d001\ - 08030801e5f135fc6fd3010be39e49060a96addc8a081198803402c4b46e4ce0\ - 750fcbab8cf084c7ca8cae09f1b5482d336fa3af47b96791d02d8143e274b132\ - 5f2213e17f9384c805f479e52a3117cf84869d395f1bc025c918484478d2da18\ - 80d32bc519f4e6b2fd2d46958795550ce1765f725626f3fc17021536bb68cd95\ - dab195f14c4534283e7ea50b00cc31a302818100e2782ad6992f4b7e88787b4d\ - 616744b60e095575a177569c4a069e311e38b7240c43343367e23574c30e4d9f\ - 05afe1fbe61423bab715915c4ccf28aa0ed2f52b092b86c8ec1f9d4795d6e91c\ - 88ba41297625c11a9e1f4f182da13cf51e541038a1266bf32b2dd81ecd84bb80\ - be8fdf97689942e944b7fbb6981e00cd680ee25f038185000281810179b283f6\ - 7868aeded3a0c5633d0e6c18fad77174e2c89c03452593d05e77a9fb029c0ccb\ - 2b6f2328e79c286ee392713f12d9d45578348383b81d11b0e0f7e89965a7785d\ - 5ab64ea25bb73e8acaa8e84cb9897985015757a48c0b1dac3a6a606fe671ea07\ - 3ec434a46f227b8d4b02a46fbba2f6c6216736d669f55778d81004d8 -Test: KeyPairValidAndConsistent -Message: 7E4F2ED4E79062778A2D -Signature: 03DF91D560884BAA90258F0F78A7AB61F9A4A5CF3D363E8DE2EAAB389B9492C2B80C44509BF2372BDEE0 -Test: Verify -Message: A0E35846B5CF1B5BF560 -Signature: 21DF9C60877B6D7F531AAF1C39122779436029685109B2D736A45F51A80099041AA5F118D7D6025AD30E -Test: Verify -Message: 3B138785EFC6F520EAE0 -Signature: 10A38520BAC07202DD1CB5A9C88B15B9579B9A1344025E4C4B9D1BC3AAA8C97AA90121D52E42E59A0A99 -Test: Verify -Message: 0F6BE2AA764B485145D4 -Signature: 0233267173F284737B68D15A500D23F3C86988E3DB28DD55AE3DFEAAA7251D354CB44315D6024CBE3E36 -Test: Verify -Message: 6CD9FBD23EA58826FB04 -Signature: 15A1B0DDA6BDB62D96AC557E3F1F24DCAD0C51EF3523B01EA2A8FD93761D0E4D070BA6352A81F31B776A -Test: Verify -Message: 473A82649565109E9E89 -Signature: 1FE31C3A3EF6F57DE2586A5F2EBD48A5C707092D230E1D217EE0A752EFD9ACA8BF0B9EE9424184B8F8F2 -Test: Verify -Comment: 1027-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f028181055402a8ab\ - e9cda3072ca8601d68032651feb0335856e57f8f8d4ec949098a6459151cefee\ - f91b7aa733668c8cf0e9b96c93c61f3528d4036daa6565646f65d74c4552817d\ - f7e5fb1cc421cfd885e27bb811ad227e81b3fa02f7a00bf01ee6e23fb5572a75\ - f8f29b58bd5f7db435e8a92a923f15d50f34213d29816921bf195b2d0215291d\ - 0ba731a4303070504d8b9615640a5e1345e00f028181051c9d0270b69ceef82a\ - f5aed5f91dc88d585096609d835d03d39cf3ce74f5a3402d4e8e192455493da6\ - 1cc58ee6f54dd941172be3d7642169cbc52273f4b725f1d6c820c3333336c64d\ - 32fb6238121b3ccb7c71b847764946bb0887a44ca9de802cda62efa9dda57375\ - 1084225353f11ed837f3dc25de8374b6fdbfb6e313e46d0417021513b27094d9\ - a5a3a9704cebdbe890da325fa26ad555 -PublicKey: \ - 308201b83082012c06072a8648ce3804013082011f028181055402a8abe9cda3\ - 072ca8601d68032651feb0335856e57f8f8d4ec949098a6459151cefeef91b7a\ - a733668c8cf0e9b96c93c61f3528d4036daa6565646f65d74c4552817df7e5fb\ - 1cc421cfd885e27bb811ad227e81b3fa02f7a00bf01ee6e23fb5572a75f8f29b\ - 58bd5f7db435e8a92a923f15d50f34213d29816921bf195b2d0215291d0ba731\ - a4303070504d8b9615640a5e1345e00f028181051c9d0270b69ceef82af5aed5\ - f91dc88d585096609d835d03d39cf3ce74f5a3402d4e8e192455493da61cc58e\ - e6f54dd941172be3d7642169cbc52273f4b725f1d6c820c3333336c64d32fb62\ - 38121b3ccb7c71b847764946bb0887a44ca9de802cda62efa9dda57375108422\ - 5353f11ed837f3dc25de8374b6fdbfb6e313e46d0381850002818103b06b9909\ - 7cd7145c7d7782b02e247a4741f3c7f39233627f17e13ebff89a18cad6a454c3\ - f32f7ef2910384030da71ae47e1c3fa79c2141dad107f8e715e47fb0bb626baa\ - fc35db769852ebbec2d339c3c3d5f2287cfdd20b3b78ea4607086c42558ae463\ - 7eddd6a74bc1072d0f34d9c0130cbc9e84f537e7ce50df502d17b5c3 -Test: KeyPairValidAndConsistent -Message: AE6DCD9535AEEE3ECC89 -Signature: 1BB090DC4573AA79F34181020C4D5B582BBA67062C23E5DD6913CE91482A05716784BA680F7F4AC1684B -Test: Verify -Message: C83A14EAC016D659F9FE -Signature: 182AC27BC4B77B145BF90E73A2CEEC5325941507F925279DF5B6280664CE82248348C3EDC59DCD428B64 -Test: Verify -Message: 745E02041EB487D16CE6 -Signature: 13C4F9AC03EA094CF7F60B96CAAA29053706E93DEC1024EAA1606E13B2C3062F2D6082846D29E6E60829 -Test: Verify -Message: 62F019655A83501FC4E7 -Signature: 077E19089B0BB32A7B21B0D27218C6E1F14AD432181BB76FF5E7EC35EC01CA47595F4C7ABB8ABD6064A9 -Test: Verify -Message: 351D37A4B5046E885EAA -Signature: 21962B09FF030A41251AD592F8D2AF24144B3AC713245AF18BE28F192FD29326D91F12A76A01477C8788 -Test: Verify -Message: 4073D33915F595F4FF9D -Signature: 1F4CF158E806AFE59139E2A9840BCEF79237800C521E49B7DBDF9830C86E7653FC716B43224EA00C883F -Test: Verify -Comment: 1028-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f0281810abdeff64b\ - 6f28256e4562109bffed29cb5aa95d89cc0ec95da0e773dbff3467c271bbb1e1\ - fbb6af058517fdacdf26b5919674c625eced6317d8631c063f43b3ade2cd633d\ - 554913339071d6ebed5fd665fc5dd7d47b80721a976c3b14fbd253f0f988c354\ - 725289f2897df0a15985c92b2d4da8d087870c251c72d979b8304d5102152368\ - e2b864b250ad45406391e7eeaa3d27cd053c2b02818107c325695dfe315a77ad\ - 7b42f0d18f9d4821b5c153fee7385877602fa54477bb8c0639d2438f34352b97\ - c22d02a7295d2b53d5286a01caa919d6283614690624240af922675ccd4a0534\ - ec336cb79cde31b02b5988cc5a53ca17790d67d803a27bb927b9c59bdc6ac794\ - 175e285cafdece6778ab19a0b444747fee20d5bf929e70041702150771305163\ - 506b2b83bd5279935df1b5fcf180b004 -PublicKey: \ - 308201b83082012c06072a8648ce3804013082011f0281810abdeff64b6f2825\ - 6e4562109bffed29cb5aa95d89cc0ec95da0e773dbff3467c271bbb1e1fbb6af\ - 058517fdacdf26b5919674c625eced6317d8631c063f43b3ade2cd633d554913\ - 339071d6ebed5fd665fc5dd7d47b80721a976c3b14fbd253f0f988c354725289\ - f2897df0a15985c92b2d4da8d087870c251c72d979b8304d5102152368e2b864\ - b250ad45406391e7eeaa3d27cd053c2b02818107c325695dfe315a77ad7b42f0\ - d18f9d4821b5c153fee7385877602fa54477bb8c0639d2438f34352b97c22d02\ - a7295d2b53d5286a01caa919d6283614690624240af922675ccd4a0534ec336c\ - b79cde31b02b5988cc5a53ca17790d67d803a27bb927b9c59bdc6ac794175e28\ - 5cafdece6778ab19a0b444747fee20d5bf929e7003818500028181043e4ae624\ - 4408879264fe6b859b578218705b9a45af22efded27141b7f090cbcbe42dcf48\ - 1df3e41b13920ae02b694eaa6bfd62f2d3c5d677b8c4ce783cbe2789e088b044\ - 89ef535ad4a517351c8835cf128f7ec677a1b1dbe3ae9cc4198ddb6e1cef8e97\ - 8c0725f5063797bc43eb9ae496286cccbad5d4e026e9edb997d2f918 -Test: KeyPairValidAndConsistent -Message: 4867852C83F181CDD010 -Signature: 1D0F4F49AFA0448163604847C9308A824ECE928E05066D47892256DB725FCB31F93F38B9E02C71E100EE -Test: Verify -Message: DA6493C86D6B62C5961C -Signature: 1BB4A8A1B8D81EEE9AB291C49F688F27D2191EA51B15A5DA66A6367D931DAB338E595C80E70CEE4BB644 -Test: Verify -Message: AE2C1136BFE966794A6C -Signature: 02AFAB91234D08FCEC22E57AB5718FBF41A86D2469012F8476BFCF4EA4E03D9F7A6E467ABDD0B5626784 -Test: Verify -Message: B20160E0442E726BE749 -Signature: 140A45F4933F05807A533628962E42A8BEFAF5977917F2A8D8706B8BE83EE6B6CEBCC951553B4E3203B5 -Test: Verify -Message: 3638935C4492F5CA42F2 -Signature: 234F78EF68343E77710E17285E47994AB599F3646315C37B8CC01CF6BE9C803D6B81B232DE9171DA7967 -Test: Verify -Message: DFB674CA6E0FDC0CBE99 -Signature: 1DF9B1B9F78F5FCCCCC5F698EDDBC8EB28C0F4D10002A052284AA4FBA601D3047E3AA97F8CF73731A44B -Test: Verify -Comment: 1029-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f0281811d0f176b67\ - 99b36724c92954c38d0288fa95400c2b14e064f76a6338fccaebca8d978b93bb\ - 76507bc150a50f9fe799fffe12ae2875b13ac1084ffcfde9f62b86185a72f04f\ - f80538d6eac177edc98d61a517b1275bcf4b57aa262e1702d623bc344db7e562\ - 1c949a9b12e9936e88fae9b200a1f8ad5b40ec8220aa301267f38dd702153357\ - 536531dec150be0ef8747f69ea30d987ff7df1028181067dd80dbc6b41f58d08\ - f077a9a3dcbfe12a62065fe6b4691c457f506b56dcab0433b3aad6ef96250163\ - 3d0f3947b491a1317e7e6b632f062c53104d609c9222b056f08a0c83662a7074\ - 4331fd09b2b42fb0768e52da27e92732106fbd41ec737373fd080b56b543d808\ - d49eeb6e1bb0a8619b1edee8fb8295dc042423f684af8a041702152dcdc00a86\ - ecc2a60ebfa6660a83af1d7c3e570b85 -PublicKey: \ - 308201b83082012c06072a8648ce3804013082011f0281811d0f176b6799b367\ - 24c92954c38d0288fa95400c2b14e064f76a6338fccaebca8d978b93bb76507b\ - c150a50f9fe799fffe12ae2875b13ac1084ffcfde9f62b86185a72f04ff80538\ - d6eac177edc98d61a517b1275bcf4b57aa262e1702d623bc344db7e5621c949a\ - 9b12e9936e88fae9b200a1f8ad5b40ec8220aa301267f38dd702153357536531\ - dec150be0ef8747f69ea30d987ff7df1028181067dd80dbc6b41f58d08f077a9\ - a3dcbfe12a62065fe6b4691c457f506b56dcab0433b3aad6ef962501633d0f39\ - 47b491a1317e7e6b632f062c53104d609c9222b056f08a0c83662a70744331fd\ - 09b2b42fb0768e52da27e92732106fbd41ec737373fd080b56b543d808d49eeb\ - 6e1bb0a8619b1edee8fb8295dc042423f684af8a0381850002818113834f0fa1\ - f42abf7dbd264cb7d2eb5798da8972df67f517c62d7ae5070fd588d61db62e49\ - 2f9654833e876ed5737df35069f5ee01a45de881d8f5e68ec52ad9ef32780e8c\ - 453a5f1e38cc17bc5cd061a3c122080f6e1b82d31877e8b08f634f497bd90b06\ - 824eaa0416c64104ce5622c272673d0dedb836ac7d47e0cea0673902 -Test: KeyPairValidAndConsistent -Message: 1E34034C47FE533F8FF5 -Signature: 04E171B845E602A871CD5DACA5738BC4585A452A86108D03D70C3D2D605FAE90DB8D339AADB692EB1ABE -Test: Verify -Message: 53D2CA23AF7DF95634F0 -Signature: 1327D4C32DFB874EA2104A9B30EAF288C7016146D1217C237E0201482E483EBC7F0A713748547F9B6B21 -Test: Verify -Message: 0F056E08AE77B3B30F33 -Signature: 1B4A688745F3D86B0D8A5D97FFA0E31C322EFAAD0A0FCD907B2D49EB8150539E81FF29341EC34440425C -Test: Verify -Message: F08C80E8FD38A3867B76 -Signature: 0972705B5E84A8BA57226C770CCB0ECDEBC816EA162FCB3BA5B3C235105EA75F379EE84187E27A86D21D -Test: Verify -Message: 6D392690B92B3E75020F -Signature: 185968475C67C936CB152F76E80EE22FB82A27ED120C5C0ADB2D750D2C38F0A9671EBFEC2815F675C24C -Test: Verify -Message: 10AE0E091A267641FACF -Signature: 1AC3C2010BFB10CA6889120A23F984FE0D4CF79D1B07578217E5A3C68EDF05006C1F3F1BFB3848E4ECE5 -Test: Verify -Comment: 1030-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f0281812a32d68d31\ - 248024053bf628a94404b9a49d91ade4d7a45b071e93292a7f8c2661d9165f0a\ - b85491d4b0dc67d335fa7d7dd172cb17193390a55eb000aa97e2b8ed3ee64b73\ - aa43ea9b8979132c2d966ab03c42cc14782c96e4284ee1136b8515007ed1b1a5\ - 708b5e8d81304fa651edc715918e2299cfe9016dfec5f454d907f59f021527c7\ - 996c1d3729c4cf1de06529e5619771e27ad9eb0281810d87a4b01385da7f43b6\ - 277933c5f0dc8072dcacd5252e1b29f588114a7ac56e377050aa8174b5dda400\ - f043234e4a746442792734dc80274a00a3676101be94759fc2630b9a85896648\ - 8b12611d03d0b31e7243e124497a754544cee1db10bb0a81cf0b2a68045b76fe\ - 935f641c666fdc788a2b968c6668c669115756b961d9fe04170215091155581e\ - cb7a0a792ba95c772d9382298bfdfa6f -PublicKey: \ - 308201b83082012c06072a8648ce3804013082011f0281812a32d68d31248024\ - 053bf628a94404b9a49d91ade4d7a45b071e93292a7f8c2661d9165f0ab85491\ - d4b0dc67d335fa7d7dd172cb17193390a55eb000aa97e2b8ed3ee64b73aa43ea\ - 9b8979132c2d966ab03c42cc14782c96e4284ee1136b8515007ed1b1a5708b5e\ - 8d81304fa651edc715918e2299cfe9016dfec5f454d907f59f021527c7996c1d\ - 3729c4cf1de06529e5619771e27ad9eb0281810d87a4b01385da7f43b6277933\ - c5f0dc8072dcacd5252e1b29f588114a7ac56e377050aa8174b5dda400f04323\ - 4e4a746442792734dc80274a00a3676101be94759fc2630b9a858966488b1261\ - 1d03d0b31e7243e124497a754544cee1db10bb0a81cf0b2a68045b76fe935f64\ - 1c666fdc788a2b968c6668c669115756b961d9fe038185000281810d7d22c931\ - 422fc46505887559a51490c2e367cdb40242cdbaeb23024693fd5c68f6a3307c\ - a34b224457d5aa610b90eca3b39905481daaba7151318f09f974ad664546d14c\ - 87f797e38139ee1e07adba9c775e07b7f7b3edba87d886920d6b2cef5f084359\ - 566b0a3b8b940a65b9ad93fd7ccd1354cdcee3c43c6bd315180498ad -Test: KeyPairValidAndConsistent -Message: 23EEE1D0EA8950B8F322 -Signature: 1800356929B316D1E4FA886CAE0CAD56E32506522D0B8440BB7695D522F31CD87079BEA4CA9F18ED4288 -Test: Verify -Message: 13FA6F2816FB83190A21 -Signature: 207830C2DE87296BC39CD21630F26228F00CF60BC3150CBC82CFA9006534A6C5E354AA281C434A8C2077 -Test: Verify -Message: D071CCC0C6E4CAE82E5A -Signature: 054C9C0C30C6B73AAB9E54C11D4EFC82BD6E8680932501D78A58EE305930E72ACD3BB2565023455DEAEA -Test: Verify -Message: 22CE83F4803BF3EA2C48 -Signature: 07065A6F5C9A086CB83F2F113895730C1B2FE0DCD90FD6AA887B066D685D3DD6C3C0D95CB8C8A48FBFF1 -Test: Verify -Message: 7A927EC7BB9CA16C1B0A -Signature: 24BF344DC7B25F831428078AC0D929A72A29160B6205A1BD4B1B2C5BD8BEFCB650DE23652701DDD4F4EF -Test: Verify -Message: 9591B069993E10BC0B84 -Signature: 0E6E6BF91BBC9FB91FCD3CE32907F5B6AB5E88928C1E3BC92649EDFDFE672AFB654C765F2758DE4BD78F -Test: Verify -Comment: 1031-bit DSA key -PrivateKey: \ - 3082014c0201003082012c06072a8648ce3804013082011f0281814d58515f7b\ - 41c4fc87e4fcefe5cf6d84b2d74a9d6f498ae9605fcbf1c59217422001a272ef\ - 91dbd09e7af5ee54126dd4fc44bb1ed624d0dd5dafb984d52781140bba40600c\ - bd4752d2c32b43253efee57af6964c339570edb24195502e6d424b84bed65ac9\ - 8c6fc52ec90e40a525f1863a53f2fbe2a0a133342eff4337f26ceb93021526f8\ - 6a81a6bb530c2f9b63e3690e95a0894575f4450281811e24828adb4ebf2becdb\ - dcadf6706631293ad6566803d12479f04a7bb20b6086fe81df164f8bd02c5f41\ - 8c1140d143f11a71170b42d0753c952bfff951b9ca4204868375efaa4afad50b\ - 75787e41c5ab9ce8adcbccecd3716f350bb8aaeca9b6098bd0002d789e1f7db9\ - c19d9045499877b93ecb4e7c64808b742063bbecf60e29041702150e61a054ee\ - 6510734a80f67a54d8c4151c957ef16f -PublicKey: \ - 308201b83082012c06072a8648ce3804013082011f0281814d58515f7b41c4fc\ - 87e4fcefe5cf6d84b2d74a9d6f498ae9605fcbf1c59217422001a272ef91dbd0\ - 9e7af5ee54126dd4fc44bb1ed624d0dd5dafb984d52781140bba40600cbd4752\ - d2c32b43253efee57af6964c339570edb24195502e6d424b84bed65ac98c6fc5\ - 2ec90e40a525f1863a53f2fbe2a0a133342eff4337f26ceb93021526f86a81a6\ - bb530c2f9b63e3690e95a0894575f4450281811e24828adb4ebf2becdbdcadf6\ - 706631293ad6566803d12479f04a7bb20b6086fe81df164f8bd02c5f418c1140\ - d143f11a71170b42d0753c952bfff951b9ca4204868375efaa4afad50b75787e\ - 41c5ab9ce8adcbccecd3716f350bb8aaeca9b6098bd0002d789e1f7db9c19d90\ - 45499877b93ecb4e7c64808b742063bbecf60e290381850002818119b50f1eea\ - 45bfaa22352a38f3c3b86d6f670747ac2fd94359608e25f2bb9f602506bc3572\ - 45deeb4c3c702d435c557da4f4a9fd37330a75547c91681fdbb51f286adb498d\ - 1e489e89b2e6a4eb9ff30222c51fefbeac7435f629f536ac2d6b87664d80e5c9\ - 7398cf489a1d1ca217f7f21ea8e409f938378875cf5f528162e3bc07 -Test: KeyPairValidAndConsistent -Message: B4B3C8FBE82013228A21 -Signature: 0E08FE696A4C70B16A127CAE8C61E5B38B7A1F34402584D1F21F71016054E820E3B1BB866309D93A7DA5 -Test: Verify -Message: 17D2D18302173E2CE992 -Signature: 0203C3869E15F8847B58BD158CB746433AA05F201317C0541908ACD5EA78A02D1FAB79380619199CC5B8 -Test: Verify -Message: 8032AE177D6DF38C7E27 -Signature: 1F436F5BC73A3402221B539F1D7CCBD4C3AE948418216122809E062ACF5D6086546FCBB293B4C7510CBD -Test: Verify -Message: 768640A60A3C62E02428 -Signature: 0A5D52C534A9BF1175247538638077489537025975254955F8A96B0CA2E7985D5D6E3DD54EE298C90100 -Test: Verify -Message: B0999CA45B77ED63639D -Signature: 144DDD0C1BE6D96FC3AFFA240FCD6D2AD0748C848F0C8A25AE8AC2E55A38DE9DBBAFF90CF464547365E2 -Test: Verify -Message: 587EDB968FA82C12C930 -Signature: 01FC4F6F98898F3639E8D93E7C2E6F3945120AD19D15EA13EDC96BED7E73A7D5D161217F1C67F3048BE3 -Test: Verify -Comment: 1032-bit DSA key -PrivateKey: \ - 3082014e0201003082012e06072a8648ce3804013082012102818200d551680a\ - 62ebf98f0ed8930cc5b12de86d0a0c29a0d7e5524c24672a25428833f4c19ac8\ - 83ead22efcc0c6823f2e942c17adb7ab763ff2c7cc2698fa8b6448e514d4628b\ - 197721bdaec780e126ac80ac83f24fef5c154f7690ceba903748be5212e3180e\ - a718ca7a71a49dee939bf9bc5b7845c9648d074587ccd3724493b91f0902152e\ - 802b5369c3f1ddfa789bf8f2ad2e048ced3bf35502818200a9aebee7d29f90b0\ - 81afc4d496a6a78210e918bb57a8a21c5995586c0bf20f7a56bb10a97e05a3a7\ - 23e7db64612b12bb591b1fe7d2e46be8c96a7b2ce7c66076aeded938775ae222\ - 3900adaf52a93f52d62173c82d4b67388c85d4c1127e1edf4643cf09f5375b60\ - c19316c4f8f8fd7daea1d8b44a2d03e97c2741537f63d86b4a041702150f66e0\ - 4c5a75d3eac03d744e5432f23e3aea066a63 -PublicKey: \ - 308201ba3082012e06072a8648ce3804013082012102818200d551680a62ebf9\ - 8f0ed8930cc5b12de86d0a0c29a0d7e5524c24672a25428833f4c19ac883ead2\ - 2efcc0c6823f2e942c17adb7ab763ff2c7cc2698fa8b6448e514d4628b197721\ - bdaec780e126ac80ac83f24fef5c154f7690ceba903748be5212e3180ea718ca\ - 7a71a49dee939bf9bc5b7845c9648d074587ccd3724493b91f0902152e802b53\ - 69c3f1ddfa789bf8f2ad2e048ced3bf35502818200a9aebee7d29f90b081afc4\ - d496a6a78210e918bb57a8a21c5995586c0bf20f7a56bb10a97e05a3a723e7db\ - 64612b12bb591b1fe7d2e46be8c96a7b2ce7c66076aeded938775ae2223900ad\ - af52a93f52d62173c82d4b67388c85d4c1127e1edf4643cf09f5375b60c19316\ - c4f8f8fd7daea1d8b44a2d03e97c2741537f63d86b4a038185000281812640c1\ - 88055329f0b44aaf80f82f7fc7f0e421031834dfbd1fb6d6af6ab3e1c173c901\ - 370a4ce2793c1b88d12f764c58ff064905da9c5001f679c7508972f237bccca5\ - 6524787466a7c9c2d6bb6392963008ed1a3e4cf3b13e66086bce3a4ca04d8cab\ - cf0cadb4c403c7d02a858460d04350e730289cb5adf200b5fdf1198168b5 -Test: KeyPairValidAndConsistent -Message: 909068BEFFA43331FDC7 -Signature: 2CCCFF8A67073E5DF643B61A5AE7A5BC216FE267E713B9005F69797B44ECD33BA5DD87461B5C72C50390 -Test: Verify -Message: AC8AFC7A1D9105539E10 -Signature: 0A2BEB58D806EECDDCBD590EBE4AE5AE7BDA326EA0072ADB9FA6A6FEBF40488C80690A2B1DF141BACF91 -Test: Verify -Message: 310E40311BB3F77F9483 -Signature: 28726153B52FE75F1FAA4C97124EE042065D2C90B50B43F885FC45C42C3ED9BDC4EC2D36A2799A041C67 -Test: Verify -Message: 35455ABD53E6FB11ED9B -Signature: 15B3D6ACA9EAD5AA1501ED201335AF9B46657A4CBF00D19328018D82624D4BD9B22D645429B385DADBCA -Test: Verify -Message: 95FFA73B52F0D06A0C1E -Signature: 2904FA8F78B6DF0D15A08714C8F86B97532A9D13B617EC03F329DA20E42816CCF45DBACB432B1F5011C8 -Test: Verify -Message: 1E9934125DA6E9B4E975 -Signature: 1666A3B9DBE26F2AE3F9BF7CBF47989D87AF82F580147BEC8350E21D4DB0691074F63B85A3A7D8E82A8D -Test: Verify -Comment: 1536-bit DSA key -PrivateKey: \ - 308201d4020100308201b006072a8648ce380401308201a30281c100fada6e4b\ - ecef964a85caf9e129639a5616ac000dbac59bd50b84bc8d464114079c34c5b5\ - 8d7d40027faaf037c6a649c527cb002d3a716bdef62b6c94d7a47a8b65c2ebac\ - 05da09e40cdc417024cccba267a98f4eb69701a276b4f117662b566605c36054\ - e7f015d2e5f81331e5666ec17ebf71907788b40cbcea0f24aaffb029ef5c25c5\ - 5ae998f28a2ddb091d262c32ad324f4e64c7b4b50a19e9d92f6d8024188627cf\ - 5ce68674e7ec7da38fd6cf4ec29a6ce2f17e3188d8ef6b0e50d77d5b0219232c\ - f9bee9d56c8bd8252d1edb59d99c40cf32d07d9e5a48930281c100f028143e3f\ - 9d1317aafb814215ffda9c584da8943e96212c90a082c3d2f335e8a6b64d1c89\ - 0aa2224ebf158bec2b6fe6bad236417acd517a4907331e0be0dd0b801218ac27\ - 0acdd45579290be1b94bc418b8f82c651d82a19d2f0e1cbb0fbc0f054d95150a\ - f96f9a7488010787a799c544883ff76a4e3092f2ca9aa9000cecb88dda343c97\ - 2c8192a83820727b1945c1a270cf913ab932457e8e6e207d06cd0efdf265b762\ - b9fa15c9a14633af17204ba2b755ed1b3b421ac596a2a04e64be43041b02191d\ - 4cedc87d55eea31bd702139b90be08d58692a1f97628a01b -PublicKey: \ - 3082027c308201b006072a8648ce380401308201a30281c100fada6e4becef96\ - 4a85caf9e129639a5616ac000dbac59bd50b84bc8d464114079c34c5b58d7d40\ - 027faaf037c6a649c527cb002d3a716bdef62b6c94d7a47a8b65c2ebac05da09\ - e40cdc417024cccba267a98f4eb69701a276b4f117662b566605c36054e7f015\ - d2e5f81331e5666ec17ebf71907788b40cbcea0f24aaffb029ef5c25c55ae998\ - f28a2ddb091d262c32ad324f4e64c7b4b50a19e9d92f6d8024188627cf5ce686\ - 74e7ec7da38fd6cf4ec29a6ce2f17e3188d8ef6b0e50d77d5b0219232cf9bee9\ - d56c8bd8252d1edb59d99c40cf32d07d9e5a48930281c100f028143e3f9d1317\ - aafb814215ffda9c584da8943e96212c90a082c3d2f335e8a6b64d1c890aa222\ - 4ebf158bec2b6fe6bad236417acd517a4907331e0be0dd0b801218ac270acdd4\ - 5579290be1b94bc418b8f82c651d82a19d2f0e1cbb0fbc0f054d95150af96f9a\ - 7488010787a799c544883ff76a4e3092f2ca9aa9000cecb88dda343c972c8192\ - a83820727b1945c1a270cf913ab932457e8e6e207d06cd0efdf265b762b9fa15\ - c9a14633af17204ba2b755ed1b3b421ac596a2a04e64be430381c5000281c100\ - 819c8cedb9c014aa577e9046b90795accbebe81bef68b1b5c37c68cb357e1a5f\ - f92761bc26cb0953956b6c0aec05acfc9d1a27c50789793b13d9eaf2361760c9\ - 7a7d86e7d922f4809a5d2d01448e938190bbc24c150e03ef8305365ddbf5ca19\ - 6857314e3b3023f8ddc9d209bd7dad1ee763e7003fd1b0c53057d2e9acadd23a\ - a18f83d20143bc41a2dfa4a164c82621fc0f800052ec01bec7c99c66fe20ec57\ - 67e6fbbe8810cd5aa75eff3d8a4cb53e1259ebcfebcc2fcf21ba7f3589cd525a -Test: KeyPairValidAndConsistent -Message: 9F6DC301DF53FE22CAC0 -Signature: 15B22111FEFA4AC1E53F2FEC346559E3613BB94F7BB3E2B7551D8B982FA10C38E7F182834DFC7391155FFA42AB945A29E118 -Test: Verify -Message: 2D7B5B9A27EAB468331E -Signature: 029EEA97097FE926DD09821284BCA3F45750B1F8102380D20100596D914DBF6BEFBE1B7A938E3AA5D656B6FD99E8EEE7C606 -Test: Verify -Message: F552FCBBA04FFCCC5CB6 -Signature: 115DE3CC1553CD5E4D40CCED80146DB1D76C10D992AACBCBCB05375C5FDA9F65B9A19DF7E51E6A36A3F2830AEA433AFD4F8B -Test: Verify -Message: 0D52B894153A4BB74068 -Signature: 0F6B8CC28D82E22B9B87D62CFF5C7B2289BB2F8008C42F105B2322CF95BC6D443A9D89A292F482490D94693A44DDF7AC4BD3 -Test: Verify -Message: 294442E103CC0CBA32A6 -Signature: 0FBD8768A18C2B28CE95775AD734157C34C1C3961C1DBBAFDD0A3E92A312A7925AFC9F7F4760FB0C56B42A2042C6B8B37C0E -Test: Verify -Message: E993D8FE1E6F6C3914ED -Signature: 0559D66BAC906C607BBA769AAFEB93E9AEC55FDD4597E432870CDC8A3DF9778301A0B218C886F6B08A414C51BD2F8214201A -Test: Verify -Comment: 2048-bit DSA key -PrivateKey: \ - 3082025d0201003082023506072a8648ce3804013082022802820101009a0886\ - 5d2bc9e0cf03d2500b2a08402bb9dc953d5fcd73f04be61236efc0998a8f012f\ - 00e52f7a6e91e81b88a4c9f985a2da523cbe7caff08cae44963d2035eda72e1f\ - 31f82c8d64c86e686899d53c0200282f407ceb1507db480f1db223606a57466c\ - f60fe9fc5f7ea7d5fd82ed3ab2cf5e35491dfaef0aa2e10fbfa3cdfeb5ebf65e\ - 4dfc2837e1f6399db06cc2e0420c7b14a4c0d483b742ca58b31fec9f26a64e9b\ - fcaa82334e644f4b954e2a9c7eeae096b8864ecd223ead3bcf9e8c1f68f6678f\ - accdb7f26d8f33d8a5fb0cb156cc7daf4a96ec2b730c0d7f666d699f7345a37d\ - dc1ccdea6d8f439ddb23de04a941b246bc257b0aef544a8e868bc8444f021d03\ - f35f80fcd896f03eda9ff07f2e35295384c4f3b8f8c4821369ab541702820100\ - 75c5d8c8f72302d92be3bf486b8648330ff86954de5e6e83efef624a277574c1\ - 6757684d3874ee303fa08343fe82dae484e5dda6781280b434c4090044cc7ff9\ - b6e962594d3ca069815c0f0b6bfd25215a419420d0ef8a1595c6eb1b44a719b4\ - 0131081f75cc15cb09a5d5a029c8546230c30b4af2d4a9f4374c93a095c83b59\ - 4b1774d635d4aee965f1d094469f7bbf8bdc93216a6b8a6c5753b48962335bf2\ - 092aa583c897878c8a7ce61186b592b05d2aea710b673d5994cedb5f117fdb6b\ - 8ad4d89f443c4eb662b428a34a7522c69794cc0274f3eba837e90da86acbc707\ - 4ee3a0b029d970efa48b3d582b740ae0e585d175a5f63a385f8b6b8878b44e1a\ - 041f021d0212c34d3d17b96a899548ebf43bb886676acebd2f040f5b33a4e88d\ - 2d -PublicKey: \ - 308203423082023506072a8648ce3804013082022802820101009a08865d2bc9\ - e0cf03d2500b2a08402bb9dc953d5fcd73f04be61236efc0998a8f012f00e52f\ - 7a6e91e81b88a4c9f985a2da523cbe7caff08cae44963d2035eda72e1f31f82c\ - 8d64c86e686899d53c0200282f407ceb1507db480f1db223606a57466cf60fe9\ - fc5f7ea7d5fd82ed3ab2cf5e35491dfaef0aa2e10fbfa3cdfeb5ebf65e4dfc28\ - 37e1f6399db06cc2e0420c7b14a4c0d483b742ca58b31fec9f26a64e9bfcaa82\ - 334e644f4b954e2a9c7eeae096b8864ecd223ead3bcf9e8c1f68f6678faccdb7\ - f26d8f33d8a5fb0cb156cc7daf4a96ec2b730c0d7f666d699f7345a37ddc1ccd\ - ea6d8f439ddb23de04a941b246bc257b0aef544a8e868bc8444f021d03f35f80\ - fcd896f03eda9ff07f2e35295384c4f3b8f8c4821369ab54170282010075c5d8\ - c8f72302d92be3bf486b8648330ff86954de5e6e83efef624a277574c1675768\ - 4d3874ee303fa08343fe82dae484e5dda6781280b434c4090044cc7ff9b6e962\ - 594d3ca069815c0f0b6bfd25215a419420d0ef8a1595c6eb1b44a719b4013108\ - 1f75cc15cb09a5d5a029c8546230c30b4af2d4a9f4374c93a095c83b594b1774\ - d635d4aee965f1d094469f7bbf8bdc93216a6b8a6c5753b48962335bf2092aa5\ - 83c897878c8a7ce61186b592b05d2aea710b673d5994cedb5f117fdb6b8ad4d8\ - 9f443c4eb662b428a34a7522c69794cc0274f3eba837e90da86acbc7074ee3a0\ - b029d970efa48b3d582b740ae0e585d175a5f63a385f8b6b8878b44e1a038201\ - 050002820100267f9c3ff3ee3cbc0f9e94dc7e6837e1ff65175e967987b90b9a\ - ea7eef1de6e4c342bebb5dbd0c4e2f6514f2d487857a146dda6cfdbc8b56ed25\ - 4cd65754d84dd21a271cd15fc656274725643728b41ce3f0e6872b6dfb4c289e\ - 03f9b903880ce3d7d745dfbb641c8c42ec0bfb6951ca2611fd877c32248c9725\ - 2bdb42d7bd65ebc50653dff389526c546d1e6ebaf6bd8b3298c01935901b7efb\ - 288b78730d89fba7f46f2a642aee0dbc93aa29c190b201acf89d4f8ba28f3e3f\ - 54a1c5a48294dda908f904afb7db398682c809ce13abd49279221d5b40ad7621\ - 6bad7ca256d718d3552344c481b20da5aac3e637fb7edeaf7960b532ef761376\ - 489f02fa8c10 -Test: KeyPairValidAndConsistent -Message: 5F3914F7AE0F6C76D152 -Signature: 03D30B7EAADDCB384CECDBB7541DFE57187242C836A6C72AF6C2525E1A01DB97DF3F41156089162FAFC87361F2F28E55616A50633637FB13EFE3 -Test: Verify -Message: 769583D4E7EAD14C137A -Signature: 01DC2815FD4918B8D314526066A03AD6593C8CED9E1ED04252B1BBA59D019F1C965028DA88BF4DB35AEDBA2C3C963B7933E5C07C590EF78BDFA1 -Test: Verify -Message: 6441D5239F50C71DE0F5 -Signature: 013F6D395DE56832F72F17F7F7572BB6DD1C48BADCBDEA91F0A634486E034B617DA8F5AB5E6F78C691313F822C599B6400A0A119A5DA330C6830 -Test: Verify -Message: F1C2D4F7C3ECDF2C17B7 -Signature: 006441A8B3517613F950BC1C84504082C0C3EA10CC08DCC1DA22E05480036D78345B17244F0DE41DA8342AF3441489CF9880BAA01BF2745CAB3A -Test: Verify -Message: 752A1F2B8D9A717A882F -Signature: 0127027984402F5B8C7DB1B7666FFA787548E4200D26B9D3B20EA9B4370298A9BDC901F324844613E8B5F34F2BFE40D9E6513D0E207B5105A9B1 -Test: Verify -Message: 666DC6B1E871026EDE56 -Signature: 03E87B55A7E81318B6B7057C901F8E3DC564053C1EA08B1F1FD965453803F21C20CE7FCCF606FB1328EC987666E87AF16ABE6B42DB854BFAA019 -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/eax.txt b/external/crypto++-5.6.3/TestVectors/eax.txt deleted file mode 100644 index b6fe641fe..000000000 --- a/external/crypto++-5.6.3/TestVectors/eax.txt +++ /dev/null @@ -1,75 +0,0 @@ -AlgorithmType: AuthenticatedSymmetricCipher -Name: AES/EAX -Source: http://www.cs.ucdavis.edu/~rogaway/papers/eax.pdf -Plaintext: -Key: 233952DEE4D5ED5F9B9C6D6FF80FF478 -IV: 62EC67F9C3A4A407FCB2A8C49031A8B3 -Header: 6BFB914FD07EAE6B -Ciphertext: E037830E8389F27B025A2D6527E79D01 -Test: Encrypt -Plaintext: F7FB -Key: 91945D3F4DCBEE0BF45EF52255F095A4 -IV: BECAF043B0A23D843194BA972C66DEBD -Header: FA3BFD4806EB53FA -Ciphertext: 19DD5C4C9331049D0BDAB0277408F67967E5 -Test: Encrypt -Plaintext: 1A47CB4933 -Key: 01F74AD64077F2E704C0F60ADA3DD523 -IV: 70C3DB4F0D26368400A10ED05D2BFF5E -Header: 234A3463C1264AC6 -Ciphertext: D851D5BAE03A59F238A23E39199DC9266626C40F80 -Test: Encrypt -Plaintext: 481C9E39B1 -Key: D07CF6CBB7F313BDDE66B727AFD3C5E8 -IV: 8408DFFF3C1A2B1292DC199E46B7D617 -Header: 33CCE2EABFF5A79D -Ciphertext: 632A9D131AD4C168A4225D8E1FF755939974A7BEDE -Test: Encrypt -Plaintext: 40D0C07DA5E4 -Key: 35B6D0580005BBC12B0587124557D2C2 -IV: FDB6B06676EEDC5C61D74276E1F8E816 -Header: AEB96EAEBE2970E9 -Ciphertext: 071DFE16C675CB0677E536F73AFE6A14B74EE49844DD -Test: Encrypt -Plaintext: 4DE3B35C3FC039245BD1FB7D -Key: BD8E6E11475E60B268784C38C62FEB22 -IV: 6EAC5C93072D8E8513F750935E46DA1B -Header: D4482D1CA78DCE0F -Ciphertext: 835BB4F15D743E350E728414ABB8644FD6CCB86947C5E10590210A4F -Test: Encrypt -Plaintext: 8B0A79306C9CE7ED99DAE4F87F8DD61636 -Key: 7C77D6E813BED5AC98BAA417477A2E7D -IV: 1A8C98DCD73D38393B2BF1569DEEFC19 -Header: 65D2017990D62528 -Ciphertext: 02083E3979DA014812F59F11D52630DA30137327D10649B0AA6E1C181DB617D7F2 -Test: Encrypt -Plaintext: 1BDA122BCE8A8DBAF1877D962B8592DD2D56 -Key: 5FFF20CAFAB119CA2FC73549E20F5B0D -IV: DDE59B97D722156D4D9AFF2BC7559826 -Header: 54B9F04E6A09189A -Ciphertext: 2EC47B2C4954A489AFC7BA4897EDCDAE8CC33B60450599BD02C96382902AEF7F832A -Test: Encrypt -Plaintext: 6CF36720872B8513F6EAB1A8A44438D5EF11 -Key: A4A4782BCFFD3EC5E7EF6D8C34A56123 -IV: B781FCF2F75FA5A8DE97A9CA48E522EC -Header: 899A175897561D7E -Ciphertext: 0DE18FD0FDD91E7AF19F1D8EE8733938B1E8E7F6D2231618102FDB7FE55FF1991700 -Test: Encrypt -Plaintext: CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7 -Key: 8395FCF1E95BEBD697BD010BC766AAC3 -IV: 22E7ADD93CFC6393C57EC0B3C17D6B44 -Header: 126735FCC320D25A -Ciphertext: CB8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E -Test: Encrypt -Plaintext: CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7 -Key: 8395FCF1E95BEBD697BD010BC766AAC3 -IV: 22E7ADD93CFC6393C57EC0B3C17D6B44 -Header: 126735FCC320D25A -Ciphertext: CB8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E -Test: Encrypt -Plaintext: CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7 -Key: 8395FCF1E95BEBD697BD010BC766AAC3 -IV: 22E7ADD93CFC6393C57EC0B3C17D6B44 -Header: 126735FCC320D25A -Ciphertext: 0B8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E -Test: NotVerify diff --git a/external/crypto++-5.6.3/TestVectors/esign.txt b/external/crypto++-5.6.3/TestVectors/esign.txt deleted file mode 100644 index 637067172..000000000 --- a/external/crypto++-5.6.3/TestVectors/esign.txt +++ /dev/null @@ -1,93 +0,0 @@ -AlgorithmType: Signature -Name: ESIGN/EMSA5-MGF1(SHA-1) -Source: Crypto++ 5.0 test vectors, generated by Wei Dai -Comment: 1536-bit key -KeyFormat: DER -PrivateKey: \ - 3082014D0281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD\ - 52D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D\ - 64CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D411\ - 6CE5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1\ - F93193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB\ - 020120024100FAF0F292EE96D4F449024F86C0A104E0633C722586EC00AD33E0234629825D2081BA\ - 337597889CAC55DC6BEBDD8F13FE3AA2133D6371601A37D195DA7BC45EF3024100EBE16F88887A42\ - 5AA08E271467CC2220DC44012AB24ED4FF3512A96E8CB600C8BBCB771459FF0EE63D4B6786952A83\ - A7143A775073F0A1D69B6D0B5817755673 -PublicKey: \ - 3081C70281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD52\ - D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D64\ - CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D4116C\ - E5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1F9\ - 3193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB02\ - 0120 -Test: KeyPairValidAndConsistent -Message: "test" -Signature: \ - A3E32065DEDAE7EC05C1BFCD25797D99CDD5739D9DF3A4AA9AA45AC8233D0D37FEBC763FF184F659\ - 14914F0C341BAE9A5C2E2E38087877CBDC3C7EA034445B0F67D9352A79471A523771DB1267C1B6C6\ - 6673B3402ED6F21A840AB67B0FEB8B88AB33DDE4832190632D512AB16FABA75CFD7799F2E1EF671A\ - 7402370EED0A06ADF41565B8E1D145AE3919B4FF5DF1457BE0FE72ED11928F61414F0200F2766F7C\ - 79A2E552205D975EFE39AE2110FB35F480814113DDE85FCA1E4FF89BB268FB28 -Test: Verify -Message: "test1" -Test: NotVerify - -AlgorithmType: Signature -Name: ESIGN/EMSA5-MGF1(SHA-1) -Source: http://www.nttmcl.com/sec/Esign/esign_emsa5_data_ntt.txt, \ - ESIGN ( IFSSA-ESIGN-EMSA5 ) Test Vector No.1-3 ( 1152 bits ) -KeyFormat: Component -Prime1: ec8b4bdc9a56ae7b60619814ec45d617246063b5aac39c286f7c82ec2824c245001b678217a7cf178979c7270eb510db -Prime2: e7b1c3ae3494d0ac7b6868a53a5fe3ba19471437c54b25699e8c348a003e5e1d4c6d244d4f6a78f260c98fc54795a6a3 -Modulus: c5d0b8fac0cc6acc9d52c61200b541f7b4f8ff9f1bda97e0ebf78a3df768ba70ade59306d6ae65655bff7c6a94518c91e43dc0003b6f8730acc244799bdacb1e5070c6ea3089ea83bd5ef0a533adf3d9d63c0e88ce74545cfb21213fc33813fd913c6a6cf84b5adabc7d74751e9945521ac76a790bba95ad48d9d3fb2fbc4b0ed2ddee7d5ea6aa61633eccdac6381fab -PublicExponent: 0400 -Test: KeyPairValidAndConsistent -Message: 86f28c1cb5e640548309b85dc6e64c1a -Signature: 348dc9a0943b1e2ba7ef501cbe970a023b37ca4019b9a5cb35ffc3bcdb28dcbd4193d7817d418bbaf291d97a1eeb918a03ee65caa7ad26c24f9ef807c8798ade5b70d7328cd36ac0844bf63f511bb63067e8236d084cf8af68e88155ea94b978aab6bd0339c55d976434423fc779d549779e81f528d028c7343e060544410e528814fb0874417d1eedf38d6db4b97dd6 -Test: Verify -Message: 2fd87bfa6c8a965c9e1aaa8e3574202b -Signature: 561ad8bd11270c71f00af0e0cf256d858c757e8b55b9c4d6fb6bf71598ab59352992656348c1ff1ccda14fb7c5c3b53be49727c07422b78ffc380eeb03be7bdf07b279337af8a1eb7c5bdb725b33a82926b6afb7a1fff0750cc2532c6f96e28d7f1e621cf222b42bb850312f1a5fb7d99acd1c6f6d2347a121dd478374d6a40a7b0cd42e430f01b926135fc8d850366a -Test: Verify -Message: 888330ef1dc1588d578badde35c98d1e -Signature: 915d64d7b9b811fe8b58eaff4c2bf9ce2ad886eef95b28093f8c21f4ca950fdb2f6e77f97d0f2f8158445347f5b3ce33e082f3b5204522e15614d1891078d9557796726b5555cbd8d5489638ecf4738257dea70175fe27de54b1f45c0a96c229bd59260bebfb241e8eacb8a1a23b9a9a79b6d1f52cfed8cca2f1968e37d76c435ad1acd44131ef2c5f5e4ea8a33aee4e -Test: Verify - -AlgorithmType: Signature -Name: ESIGN/EMSA5-MGF1(SHA-1) -Source: http://www.nttmcl.com/sec/Esign/esign_emsa5_data_ntt.txt, \ - ESIGN ( IFSSA-ESIGN-EMSA5 ) Test Vector No.4-6 ( 1152 bits ) -KeyFormat: Component -Prime1: d64dac2fb3506111bbac11a04e138d2d6f32df119f2f259065cf5785a46aaf404ad887f0a310b36be4a3a1a33c8a054f -Prime2: d1158628ed1e0695c02a821ab8590f59fc1a3fb1e19ee192ab789e9d963766d78f55cfef9bf58c0c774a32d8a8943955 -Modulus: 92855120174c4a115bf525fa1f2ebf68d8328162149a5a6751b2512584eab7e5582d38d0e5029e01ece85a484030bb884a29121d8924f0195b22842b16436cd36c33bbe843e1cf7a585e89894b14595641d081a3077d667096df251bd93c86ebd94e0d555601794fa66fa2bcea920287c19922bed486a4f631390d1e36cc3635b509cb14c44d50313919a6cbb75eff35 -PublicExponent: 0400 -Test: KeyPairValidAndConsistent -Message: 16a3632339c463e243a4909f8a3810a8 -Signature: 7d8790ee852a4f3ba8bb3fa0f6fc30c29b6bc2bc538195826544138dcb92500122148ac2cf0dc77dd37182c2267a73317ce5b2ae26db79204abe0e10c7212ba8de99fdc5cf498f7ee689588541fb78291afb9b65242f725a4aa32b119957b4314a58b4239a0235b9b1a8a6efbaa3601961d4b0730a6d9e5659f20105931d473daf3d378b39b7f3f01516d72ade9ef68a -Test: Verify -Message: ef8bcad6c164a86b0e0a3c011d556744 -Signature: 6ce6024f64a7f04a0fe29b65cf2ec2ac49d9f90078a77db8bc260d3cfef233165a90b29d5787218b4d05a0e9321f2e802a8ed6d1a4201feb982a5d06bef051d60436d8c61a249432e662e625806526075f02b60d198142b96b67a4ac31d0071a1f971dae5a6a1b6db177591edfe80f7e51c7335441490f05f214b5a1aec94de572e3ec11ef4bebeb42f27037d38a186f -Test: Verify -Message: 29023889c79230c1c479820c5ff2e006 -Signature: 85f0b648ee0f6d30a18666e2da8bcda319ede91ca18e018548e2a1c21b0e0049b91528eba4da3be4551b26c4e59e6aba25312874f2320eaf7c94c541e17fb16fb0d9d9928ea526b0fc0c0fb2d12e425a5917e4039a5366585327bc3456107ff31c889c5e04259457dfe65952dc43cd35f4ca689272769096b9583bbffad4a057673f938fa7192bbca44598cf5600e3eb -Test: Verify - -AlgorithmType: Signature -Name: ESIGN/EMSA5-MGF1(SHA-1) -Source: http://www.nttmcl.com/sec/Esign/esign_emsa5_data_ntt.txt, \ - ESIGN ( IFSSA-ESIGN-EMSA5 ) Test Vector No.7-9 ( 1152 bits ) -KeyFormat: Component -Prime1: fd5708b30e8ee342bacaeb01c0d3baa91a833dacff2878c7df62e04a65afe770acdcefeaf8a72a5809387e5ed97756ef -Prime2: fa335563d5da151e3ab025f3b77d3f1eaf4a0d431012e79b12ca8ec433d347bd9a2b5179f2ed332a19ea2cad694c97dd -Modulus: f5072ba25e7df2c0e0a0abde031dda9534a493396ab895e6132abc90f993535ce55d6395e1fd548371228decc1cfefa9737344243ddb1eccbbc22d68571617afb23638c3f0222a84b0a8c9889ab934aa84cc92e14d972670db6d2105bbd0212c1843ff0ccbae19535ac01cf02ad98aa941fce32fac874cea7f1f83969fbaf025fb562a087efb4652210d45279312da7d -PublicExponent: 0400 -Test: KeyPairValidAndConsistent -Message: abbf5c71245af5d272e627ec845e9ed4 -Signature: b75e2869c052df20d6c008dd911a5bd752d5a23ee42ae47def37f76f6b2d5f04eb8d9b0783c502e0abd30bc567a6672292c3a6736fe8d4034fad857456cd599259d09f42f1d4c64d244fd149f6316f0b763be0de4f9da7f9649a76b984fe2ae99293d406904a9df59d28cc8a58b7ad0029657a47ac0e28d6353287df1ea8feef2fbb65d86425e80487420c1c9c1bda7e -Test: Verify -Message: cf2c943bc4c23175b43ba128c75339d1 -Signature: 64616eb627bf49c2a5a183479a66b7dae12cd1a0982baa0cc12329f594196b9de47909e6b5cf4653bfccdeeb5478fd88c31c197c9adc335a84ec58664ce5fc55c7b2f17b0f32ffac4ff3f3b4ddb3ce125ab7e43efc0be6ae8357895ab5f118a4ec71b57cc1b252373fecd4a1f404ed295f2d97868e3737fdd6fdf124bc2f1e083b57d5c237db775d429d08d5b5ced857 -Test: Verify -Message: 4d011f09f665d5f4a12595900e3827ec -Signature: 1911d3df18bdd9907b69ce6b655086c952c92d826bbef199fb1e0dcb7209a1b28d0a03beabc9e7d8df052febe26f691ff808caaac697c3005d524f3da8c700bf620aa37fd0793b3f22c6a488d733336d040642e0767755391951a754a1111345b912b4c0228ab154eb4baac0383a54023bd7c7ea2ed4bb894444b80d7e5f18407f51c3af858b9fa9198190b4b540fce8 -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/gcm.txt b/external/crypto++-5.6.3/TestVectors/gcm.txt deleted file mode 100644 index bef02679f..000000000 --- a/external/crypto++-5.6.3/TestVectors/gcm.txt +++ /dev/null @@ -1,168 +0,0 @@ -AlgorithmType: AuthenticatedSymmetricCipher -Name: AES/GCM -Source: aes-modes-src-07-10-08/Testvals/gcm.1, Basic Tests for GCM (compiled by B. R. Gladman) -Key: 00000000000000000000000000000000 -IV: 000000000000000000000000 -MAC: 00000000000000000000000000000000 -Test: NotVerify -Key: 00000000000000000000000000000000 -IV: 000000000000000000000000 -MAC: 58e2fccefa7e3061367f1d57a4e7455a -Test: Encrypt -Key: 00000000000000000000000000000000 -IV: 000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 0388dace60b6a392f328c2b971b2fe78 -MAC: ab6e47d42cec13bdf53a67b21257bddf -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308 -IV: cafebabefacedbaddecaf888 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 -Ciphertext: 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e 21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985 -MAC: 4d5c2af327cd64a62cf35abd2ba6fab4 -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308 -IV: cafebabefacedbaddecaf888 -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e 21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091 -MAC: 5bc94fbc3221a5db94fae95ae7121a47 -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308 -IV: cafebabefacedbad -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c7423 73806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598 -MAC: 3612d2e79e3b0785561be14aaca2fccb -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308 -IV: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728 c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca7 01e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5 -MAC: 619cc5aefffe0bfa462af43c1699d050 -Test: Encrypt -Header: -Plaintext: -Ciphertext: -Key: 000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -MAC: cd33b28ac773f74ba00ed1f312572435 -Test: Encrypt -Key: 000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 98e7247c07f0fe411c267e4384b0f600 -MAC: 2ff58d80033927ab8ef4d4587514f0fb -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c -IV: cafebabefacedbaddecaf888 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 -Ciphertext: 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c 7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256 -MAC: 9924a7c8587336bfb118024db8674a14 -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c -IV: cafebabefacedbaddecaf888 -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c 7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710 -MAC: 2519498e80f1478f37ba55bd6d27618c -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c -IV: cafebabefacedbad -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057 fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7 -MAC: 65dcc57fcf623a24094fcca40d3533f8 -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c -IV: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728 c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e45 81e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373b -MAC: dcf566ff291c25bbb8568fc3d376a6d9 -Test: Encrypt -Header: -Plaintext: -Ciphertext: -Key: 0000000000000000000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -MAC: 530f8afbc74536b9a963b4f1c4cb738b -Test: Encrypt -Key: 0000000000000000000000000000000000000000000000000000000000000000 -IV: 000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: cea7403d4d606b6e074ec5d3baf39d18 -MAC: d0d1c8a799996bf0265b98b5d48ab919 -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 -IV: cafebabefacedbaddecaf888 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 -Ciphertext: 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa 8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad -MAC: b094dac5d93471bdec1a502270e3cc6c -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 -IV: cafebabefacedbaddecaf888 -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa 8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662 -MAC: 76fc6ece0f4e1768cddf8853bb2d551b -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 -IV: cafebabefacedbad -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0 feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f -MAC: 3a337dbf46a792c45e454913fe2ea8f2 -Test: Encrypt -Key: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308 -IV: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728 c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b -Header: feedfacedeadbeeffeedfacedeadbeefabaddad2 -Plaintext: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a72 1c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 -Ciphertext: 5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf4 0fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3f -MAC: a44a8266ee1c8eb0c8b5d4cf5ae9f19a -Test: Encrypt -Header: -Plaintext: -Ciphertext: -Key: 00000000000000000000000000000000 -IV: 000000000000000000000000 -Plaintext: 000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f 505152535455565758595a5b5c5d5e5f 606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf -Ciphertext: 0389d8cd64b3a595fb21c8b27dbff077 e784b8b85d5e4f34efe493e48896dfff 002333026a56b2fd08a09c87fcbe85cf f97c902a25bb1f4a43478687f5feb6cd ca9f3fc6ecab732627386ee2996a4cde c5e91f48c293c6a87774b950aeb1d7bf 62321a0d76006297b2d06623cf6e4fb1 433494c3326b0ae914120085a195413f 5e3278e4107d7b08dd2107405610e67d 83ed5b5ba0b591e9e46b1029f5f6936f fdb0e788fc09f60d861a0b3e1ab6294a 76ebdf6663421ef7dd6c1bc448dfcdb7 a0c38bae72fa627ed327f2b46fcec25a 77ee5fd7e3354788643c0d7df15075d5 -MAC: 6b385f3012eafda4189da7ad3b6eafbf -Test: Encrypt -Key: 00000000000000000000000000000000 -IV: 000000000000000000000000 -Plaintext: 000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f 505152535455565758595a5b5c5d5e5f 606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf -Ciphertext: 0389d8cd64b3a595fb21c8b27dbff077 e784b8b85d5e4f34efe493e48896dfff 002333026a56b2fd08a09c87fcbe85cf f97c902a25bb1f4a43478687f5feb6cd ca9f3fc6ecab732627386ee2996a4cde c5e91f48c293c6a87774b950aeb1d7bf 62321a0d76006297b2d06623cf6e4fb1 433494c3326b0ae914120085a195413f 5e3278e4107d7b08dd2107405610e67d 83ed5b5ba0b591e9e46b1029f5f6936f fdb0e788fc09f60d861a0b3e1ab6294a 76ebdf6663421ef7dd6c1bc448dfcdb7 a0c38bae72fa627ed327f2b46fcec25a 77ee5fd7e3354788643c0d7df15075d5 -MAC: 6b385f3012eafda4189da7ad3b6eafbf -Test: Encrypt - -AlgorithmType: AuthenticatedSymmetricCipher -Name: AES/GCM -Source: Generated by Crypto++ 5.6.1 -Comment: long test vector with odd length -IV: f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -Plaintext: r11 006bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 -Key: 2b7e151628aed2a6abf7158809cf4f3c -Ciphertext: BD70C168B0D4371B0A85B4B5D65D92569B17 \ -F9A3D0A25B9F608E2C34621CF4D37357845431E04E585CDAAD7527BF8A2426DEEF451320C78D5EF0 \ -9F5B11A8B8C700CD329A3D4CDED92C20F6BF28CB3627681C5B0AF2B5692CC7EC9049008ACBBD127A \ -9CD8DEF00425697E0BCF67E05AEE70EA1A5D7EE95E3B88FBAF3C196AAAECB73E09BDF057AF701A02 \ -42394BCC104FF4F75F15D287325FCFFDB7E7FF3A939A80A6A3A9D7570E6EF6AD0BBE6E291338938D \ -2FEBBC7D5EE95CD73E752ACD48915DCAE0A0807E6F4B2ADADBD945667318264EF7D8C2ECC0B8FB67 \ -A43614C5F5EA51CADD4AEE91DC371A7FC5A3B4581D1D9DD99608CD2BB0338F82933C19F5B8EBAD6B \ -BA583835FBD29136302BAC163F86CA9E3E6F3B5BFDEFAB3E4B019190AE2EBC0B71034EA9BF882879 \ -139FFE76DD997F6729425F3D5C5392762C245769D18CC963C92211B71F564203AFBF68626C083303 \ -1D449B02DFA5C0F09FAFCE951FE35F4AD8122AB682A4AF28931113F75615E12DB05DD9247973F1C6 \ -057666848C13EDE41192F38948366D468D84CAF896EFF724082D2BAB2376E2813B41A014999B0EE7 \ -377758715D9554926AB3514EEB96A0ABD501D94A05692D858190D5AD307CEB6E6C8A63841A8257BE \ -C2527C4B937840AA51292E15834AB801F0275A6A4B1B6E969B7A7FCE217D6F823CDE1760F847E8F4 \ -6CBDE152A24F2319EC2A7089D2954259D30332089FF928034391D1B0B8AFD7C8A5D4F8E0DAB5883C \ -A7D581F78E4848DC3B01E5F2A5C01BA8910D0F144BC494E29450271174B866868EE8DC6B0DD396ED \ -9D72F83DE3BB6DE6FEBC64178961E011D0D746C2CE3A0FBD05CDF8FA79AC03E94C88368BD903E142 \ -7FCFC30C9D100E220B4CB9B7BA242DA49D334E930B6C4EB877D1DF2C0F8CF4AF7813E2F295929707 \ -19846FC52A47FCE6E71DC5E58FC5F49C91BDE56B7A2A68CFA994D6BFA5357A8403A2B37C69A6A0A4 \ -35E4AB4C9E450473AF0CDFDBCC238A2DD7 -MAC: 4FEA89D75727E82B3A9F9EEB5E217A3E -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/hkdf.txt b/external/crypto++-5.6.3/TestVectors/hkdf.txt deleted file mode 100644 index 09af373ec..000000000 --- a/external/crypto++-5.6.3/TestVectors/hkdf.txt +++ /dev/null @@ -1,175 +0,0 @@ -AlgorithmType: KDF -Name: HKDF(SHA-1) -Source: RFC 5689 -Comment: Test Case 4 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b -Salt: 0x000102030405060708090a0b0c -Info: 0xf0f1f2f3f4f5f6f7f8f9 -DerivedKeyLength: 42 -DerivedKey: 0x085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-1) -Source: RFC 5689 -Comment: Test Case 5 -Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f -Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf -Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -DerivedKeyLength: 82 -DerivedKey: 0x0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-1) -Source: RFC 5689 -Comment: Test Case 6 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: "" -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0x0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-1) -Source: RFC 5689 -Comment: Test Case 7 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Salt: "" -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0x2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-256) -Source: RFC 5689 -Comment: Test Case 1 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: 0x000102030405060708090a0b0c -Info: 0xf0f1f2f3f4f5f6f7f8f9 -DerivedKeyLength: 42 -DerivedKey: 0x3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-256) -Source: RFC 5689 -Comment: Test Case 2 -Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f -Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf -Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -DerivedKeyLength: 82 -DerivedKey: 0xb11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-256) -Source: RFC 5689 -Comment: Test Case 3 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: "" -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0x8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-512) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 8 (Mirror Tests 1 and 4) -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: 0x000102030405060708090a0b0c -Info: 0xf0f1f2f3f4f5f6f7f8f9 -DerivedKeyLength: 42 -DerivedKey: 0x832390086CDA71FB47625BB5CEB168E4C8E26A1A16ED34D9FC7FE92C1481579338DA362CB8D9F925D7CB -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-512) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 9 (Mirror Tests 2 and 5) -Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f -Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf -Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -DerivedKeyLength: 82 -DerivedKey: 0xCE6C97192805B346E6161E821ED165673B84F400A2B514B2FE23D84CD189DDF1B695B48CBD1C8388441137B3CE28F16AA64BA33BA466B24DF6CFCB021ECFF235F6A2056CE3AF1DE44D572097A8505D9E7A93 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-512) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 10 (Mirror Test 3 and 6) -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: "" -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0xF5FA02B18298A72A8C23898A8703472C6EB179DC204C03425C970E3B164BF90FFF22D04836D0E2343BAC -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-512) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 11 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Salt: "" -Info: -DerivedKeyLength: 42 -DerivedKey: 0x1407D46013D98BC6DECEFCFEE55F0F90B0C7F63D68EB1A80EAF07E953CFC0A3A5240A155D6E4DAA965BB -Test: Verify - -AlgorithmType: KDF -Name: HKDF(SHA-512) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 12 (Mirror Tests 3 and 6) -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: "" -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0xF5FA02B18298A72A8C23898A8703472C6EB179DC204C03425C970E3B164BF90FFF22D04836D0E2343BAC -Test: Verify - -AlgorithmType: KDF -Name: HKDF(Whirlpool) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 13 (Mirror Tests 1 and 4) -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: 0x000102030405060708090a0b0c -Info: 0xf0f1f2f3f4f5f6f7f8f9 -DerivedKeyLength: 42 -DerivedKey: 0x0D29F74CCD8640F44B0DD9638111C1B5766EFED752AF358109E2E7C9CD4A28EF2F90B2AD461FBA0744D4 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(Whirlpool) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 14 (Mirror Tests 2 and 5) -Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f -Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf -Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff -DerivedKeyLength: 82 -DerivedKey: 0x4EBE4FE2DCCEC42661699500BE279A993FED90351E19373B3926FAA3A410700B2BBF77E254CF1451AE6068D64A0904D966F4FF25498445A501B88F50D21E3A68A890E09445DC5886DD00E7F4F7C58A512170 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(Whirlpool) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 15 (Mirror Tests 3 and 6) -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Salt: "" -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0x110632D0F7AEFAC31771FC66C22BB3462614B81E4B04BA7F2B662E0BD694F56458615F9A9CB56C57ECF2 -Test: Verify - -AlgorithmType: KDF -Name: HKDF(Whirlpool) -Source: Generated by Crypto++ 5.6.3 -Comment: Test Case 16 (Mirror Test 7) -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Salt: r64 0x00 -Info: "" -DerivedKeyLength: 42 -DerivedKey: 0x4089286EBFB23DD8A02F0C9DAA35D538EB09CD0A8CBAB203F39083AA3E0BD313E6F91E64F21A187510B0 -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/hmac.txt b/external/crypto++-5.6.3/TestVectors/hmac.txt deleted file mode 100644 index 2a604bba6..000000000 --- a/external/crypto++-5.6.3/TestVectors/hmac.txt +++ /dev/null @@ -1,281 +0,0 @@ -AlgorithmType: MAC -Name: HMAC(MD5) -Source: RFC 2202 -Comment: Test Case 1 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: 0x9294727a3638bb1c13f48ef8158bfc9d -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: 0x750c783e6ab0b503eaa86e310a5db738 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: 0x56be34521d144c88dbb8c733f0e8b3f6 -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: 0x697eaf0aca3a3aea3a75164746ffaa79 -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: 0x56461ef2342edc00f9bab995690efd4c -Test: Verify -MAC: 0x56461ef2342edc00f9bab995 -#TruncatedSize: 12 -Test: VerifyTruncated -Comment: Test Case 6 -Key: r80 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 0x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd -Test: Verify -Comment: Test Case 7 -Key: r80 0xaa -Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" -MAC: 0x6f630fad67cda0ee1fb1f562db3aa53e -Test: Verify - -AlgorithmType: MAC -Name: HMAC(SHA-1) -Source: RFC 2202 -Comment: Test Case 1 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: 0xb617318655057264e28bc0b6fb378c8ef146be00 -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: 0x125d7342b9ac11cd91a39af48aa17b4f63f175d3 -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: 0x4c9007f4026250c6bc8414f9bf50c86c2d7235da -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: 0x4c1a03424b55e07fe7f27be1d58bb9324a9a5a04 -Test: Verify -MAC: 0x4c1a03424b55e07fe7f27be1 -#TruncatedSize: 12 -Test: VerifyTruncated -Comment: Test Case 6 -Key: r80 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 0xaa4ae5e15272d00e95705637ce8a3b55ed402112 -Test: Verify -Comment: Test Case 7 -Key: r80 0xaa -Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" -MAC: 0xe8e99d0f45237d786d6bbaa7965c7808bbff1a91 -Test: Verify - -AlgorithmType: MAC -Name: HMAC(RIPEMD-160) -Source: RFC 2286 -Comment: Test Case 1 -Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: 0x24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668 -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: 0xdda6c0213a485a9e24f4742064a7f033b43c4069 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: 0xb0b105360de759960ab4f35298e116e295d8e7c1 -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: 0xd5ca862f4d21d5e610e18b4cf1beb97a4365ecf4 -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: 0x7619693978f91d90539ae786500ff3d8e0518e39 -Test: Verify -MAC: 0x7619693978f91d90539ae786 -#TruncatedSize: 12 -Test: VerifyTruncated -Comment: Test Case 6 -Key: r80 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 0x6466ca07ac5eac29e1bd523e5ada7605b791fd8b -Test: Verify -Comment: Test Case 7 -Key: r80 0xaa -Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" -MAC: 0x69ea60798d71616cce5fd0871e23754cd75d5a0a -Test: Verify - -AlgorithmType: MAC -Name: HMAC(SHA-224) -Source: RFC 4231 -Comment: Test Case 1 -Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: 0x896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22 -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: 0xa30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: 0x7fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333ea -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: 0x6c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5a -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: 0x0e2aea68a90c8d37c988bcdb9fca6fa8 -Test: VerifyTruncated -Comment: Test Case 6 -Key: r131 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 0x95e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870e -Test: Verify -Comment: Test Case 7 -Key: r131 0xaa -Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") -MAC: 0x3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1 -Test: Verify - -AlgorithmType: MAC -Name: HMAC(SHA-256) -Source: RFC 4231 -Comment: Test Case 1 -Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7 -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: 773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: 82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: a3b6167473100ee06e0c796c2955552b -Test: VerifyTruncated -Comment: Test Case 6 -Key: r131 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54 -Test: Verify -Comment: Test Case 7 -Key: r131 0xaa -Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") -MAC: 9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2 -Test: Verify - -AlgorithmType: MAC -Name: HMAC(SHA-384) -Source: RFC 4231 -Comment: Test Case 1 -Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6 -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: 88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27 -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: 3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffb -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: 3abf34c3503b2a23a46efc619baef897 -Test: VerifyTruncated -Comment: Test Case 6 -Key: r131 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952 -Test: Verify -Comment: Test Case 7 -Key: r131 0xaa -Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") -MAC: 6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e -Test: Verify - -AlgorithmType: MAC -Name: HMAC(SHA-512) -Source: RFC 4231 -Comment: Test Case 1 -Key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b -Message: "Hi There" -MAC: 87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854 -Test: Verify -Comment: Test Case 2 -Key: "Jefe" -Message: "what do ya want for nothing?" -MAC: 164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737 -Test: Verify -Comment: Test Case 3 -Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Message: r50 0xdd -MAC: fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb -Test: Verify -Comment: Test Case 4 -Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819 -Message: r50 0xcd -MAC: b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd -Test: Verify -Comment: Test Case 5 -Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c -Message: "Test With Truncation" -MAC: 415fad6271580a531d4179bc891d87a6 -Test: VerifyTruncated -Comment: Test Case 6 -Key: r131 0xaa -Message: "Test Using Larger Than Block-Size Key - Hash Key First" -MAC: 80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598 -Test: Verify -Comment: Test Case 7 -Key: r131 0xaa -Message: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.") -MAC: e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58 -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/mars.txt b/external/crypto++-5.6.3/TestVectors/mars.txt deleted file mode 100644 index 01530e073..000000000 --- a/external/crypto++-5.6.3/TestVectors/mars.txt +++ /dev/null @@ -1,66 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: MARS/ECB -Key: 80000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: B3E2AD5608AC1B6733A7CB4FDF8F9952 -Test: Encrypt -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: DCC07B8DFB0738D6E30A22DFCF27E886 -Test: Encrypt -Key: 00000000000000000000000000000000 -Plaintext: DCC07B8DFB0738D6E30A22DFCF27E886 -Ciphertext: 33CAFFBDDC7F1DDA0F9C15FA2F30E2FF -Test: Encrypt -Key: CB14A1776ABBC1CDAFE7243DEF2CEA02 -Plaintext: F94512A9B42D034EC4792204D708A69B -Ciphertext: 225DA2CB64B73F79069F21A5E3CB8522 -Test: Encrypt -Key: 86EDF4DA31824CABEF6A4637C40B0BAB -Plaintext: 4DF955AD5B398D66408D620A2B27E1A9 -Ciphertext: A4B737340AE6D2CAFD930BA97D86129F -Test: Encrypt -Key: 000000000000000000000000000000000000000000000000 -Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Ciphertext: 97778747D60E425C2B4202599DB856FB -Test: Encrypt -Key: D158860838874D9500000000000000000000000000000000 -Plaintext: 93A953A82C10411DD158860838874D95 -Ciphertext: 4FA0E5F64893131712F01408D233E9F7 -Test: Encrypt -Key: 791739A58B04581A93A953A82C10411DD158860838874D95 -Plaintext: 6761C42D3E6142D2A84FBFADB383158F -Ciphertext: F706BC0FD97E28B6F1AF4E17D8755FFF -Test: Encrypt -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 62E45B4CF3477F1DD65063729D9ABA8F -Ciphertext: 0F4B897EA014D21FBC20F1054A42F719 -Test: Encrypt -Key: FBA167983E7AEF22317CE28C02AAE1A3E8E5CC3CEDBEA82A99DBC39AD65E7227 -Plaintext: 1344ABA4D3C44708A8A72116D4F49384 -Ciphertext: 458335D95EA42A9F4DCCD41AECC2390D -Test: Encrypt -Key: 00000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 3FE24DC09173D15F4616A849D396F7E3 -Test: EncryptionMCT -Key: 00000000000000000000000000000000 -Plaintext: 24BD3D2FC6FEE152D1D64545E2230584 -Ciphertext: 00000000000000000000000000000000 -Test: DecryptionMCT -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: 34EC834E2F30741ECB476DA7E9662BBD -Test: EncryptionMCT -Key: 000000000000000000000000000000000000000000000000 -Plaintext: 7F27C3397A8CEEF1BDF859459690FEA8 -Ciphertext: 00000000000000000000000000000000 -Test: DecryptionMCT -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 00000000000000000000000000000000 -Ciphertext: EDE145C10E279501D921C5E3B04420A6 -Test: EncryptionMCT -Key: 0000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 95615ADB0DDF6613A5E84F849AC8C00D -Ciphertext: 00000000000000000000000000000000 -Test: DecryptionMCT diff --git a/external/crypto++-5.6.3/TestVectors/nr.txt b/external/crypto++-5.6.3/TestVectors/nr.txt deleted file mode 100644 index f08bb6ac5..000000000 --- a/external/crypto++-5.6.3/TestVectors/nr.txt +++ /dev/null @@ -1,615 +0,0 @@ -AlgorithmType: Signature -Name: NR(1363)/EMSA1(SHA-1) -Source: generated by Wei Dai using Crypto++ 5.0 -Comment: 1024-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 09b2940496d6d9a43bb7ec642c57b302e59b3a5155 -SubgroupGenerator: \ - a1c379ba91fe1f9d5283807b809c698bce4aee6f405f4de8c46becf33c08a63b\ - c5f8088f75b5b6bcfb0847ccbdee700e4e698652317bbd7a3056404c541136d7\ - 332c2b835ef0d1508ef57b437de60675f20f75df0483f242ddeb57efacd18041\ - 8790f4dec0a8250593ba36f17316580d50db1383ea93a21247650a2e04af904d -Modulus: \ - bd670f79b0cde98a84fd97e54d5d5c81525a016d222a3986dd7af3f32cde8a9f\ - 6564e43a559a0c9f8bad36cc25330548b347ac158a345631fa90f7b873c36eff\ - ae2f7823227a3f580b5dd18304d5932751e743e922eebfbb4289c389d9019c36\ - f96c6b81fffbf20be062182104e3c4b7d02b872d9a21e0fb5f10ded64420951b -PrivateExponent: \ - 0355dc884345c08fb399b23b161831e94dbe61571e -PublicElement: \ - 255cf6b0a33f80cab614eafd5f7b2a6d83b3eafe27cd97b77ae70c7b966707d8\ - 23f0e6aaaa41dc005aaefd3a0c269e60a665d2642f5d631ff1a3b8701bc06be9\ - c44ab7367f77fefeec4c5959cd07e50d74a05af60b059ad3fc75249ecf44774b\ - 88b46860d9c3fa35d033bcfc7b0b2d48dc180d192d4918cddff4f7ebcdaaa198 -Test: KeyPairValidAndConsistent -Message: 66B92E1E2C44B80F7BFA -Signature: \ - 06e7586b76d5a8270155cce2d3ff4495237eed29a101eb1341fce0b43d95397b\ - 053d93772b0a9cf3117b -Test: Verify -Message: 973266BB0A492248082A -Signature: \ - 02de44ed2233f0f11dcf567217d2089ec039a211bf000d42e04900a66ce45c58\ - 526a97d7f4cfba29e43d -Test: Verify -Message: 9A6D079ED0CA9D8B40E8 -Signature: \ - 04f59dbb2712926b3bc1d3c428f16203f3443f88db0669adda94dcb54e1fff71\ - fb51bb603e7adff13f84 -Test: Verify -Message: AA34DCE67BCDAC927DA6 -Signature: \ - 08ad21bf9d0cc598a214329d3544685d39487988bb01aced68ad0a4831affbff\ - 3b14df6c0f4ac4d2e967 -Test: Verify -Message: 4EDAC08816AFDBF284DA -Signature: \ - 09a9d5aa9bd1b6b61fe8825128c8e52a6213692b2504c8c6951299b5ca51b03d\ - ea0a5e56f9a7c4cd44f7 -Test: Verify -Message: D82F2E903230962B8174 -Signature: \ - 0441c8d089e690a7fab391de07073326d443a0d9d806a3997ac1641175310890\ - 1e55582a582541330539 -Test: Verify -Comment: 1025-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 0b3949dadf3196f08bca0606f06443afce2fb1d02f -SubgroupGenerator: \ - 015f0f6d1729ef2af723c00e36450a04c7e7681d65b74a6417a53b3eb6036989\ - eff8e0ab11a7ec3ce2340b7c7a92e1a977aee52555c06c12c4cc28496ddc2598\ - feeb7539ce90d3888e21f61d7f14746cf67d9fed373afd97e2483700e300ed9d\ - a25e7200b363a4727ad201194b36ea5f816cf83488c3e527d3a5515870d2da63\ - d6 -Modulus: \ - 017310bf02d70ef2cee45d1cc47ec8ce8cabdd6bf32a560975a42ef057bf9dfd\ - 553bc9368ddb154a55d855edaa755e69f511a4c69ba78571cc4b14ddbb0f32a4\ - a9c56c286305aa21ec4e35de7390747477b3bd574e7b87cbebde2f665703137a\ - 1172350ad2f48a0884d076ada9db82f104e6b0ad86693cd4adbd0067639102fc\ - f1 -PrivateExponent: \ - 0696b0f255468b7ac18e11632f208ca86383a46724 -PublicElement: \ - 45bf83e62f50190374b23de5e4a1d0278e9e8e6c8335577d62e80662a380c206\ - e326819c5082d321dfda1f905fa5a3ead9a2dc769885a27b1fd6a133185dc5a7\ - 876a76ab0a09fe02b7071a924169e4d2d2a67e67ed3628800134183b962c0b31\ - 3463aa154e6437d644e025ab234e63d19c129842a61c5e5ea5a06466c858c81c -Test: KeyPairValidAndConsistent -Message: 2F585D0CE4FA1CD93880 -Signature: \ - 06586d8a703cdc27200d5261853f50effa8ebbdfc905f5becb68b81eca506992\ - 50fb54e46d557c6095dd -Test: Verify -Message: 4F09A1F217B8393199EE -Signature: \ - 0622cd33b1d715829d8fae104759ed449f95becb5e03d36f5578fd6a2951d2e6\ - 26cfce85ba6563990d64 -Test: Verify -Message: 03D7110A753B008A76A0 -Signature: \ - 02925630b4c80e604fc1d8680bfd0e3d878e22b3a30ab8b10da7fc38816a8c5f\ - 1e06927c68f9d3db60d9 -Test: Verify -Message: 129F4781D417671F886D -Signature: \ - 016c2c4ce845b4d412828cbb8a396d080c7eb93bcb01f7010410198c8bac96df\ - 8ab8761cebdb7d87f3a2 -Test: Verify -Message: 3E1594F559D1248D1112 -Signature: \ - 080bab68c62be86ab2c1bfd0edf10387a7cd66b69f054e254218e01f650e4e8c\ - 6bfa10054e367893e59e -Test: Verify -Message: D6F0354F1B6B253B6997 -Signature: \ - 08755c7e8012e8160db75c6160686351e5c577207f01602b4dda2fa56b864374\ - 703c83bb323c7bb34f5f -Test: Verify -Comment: 1026-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 36bb68cd95dab195f14c4534283e7ea50b00cc31a3 -SubgroupGenerator: \ - e2782ad6992f4b7e88787b4d616744b60e095575a177569c4a069e311e38b724\ - 0c43343367e23574c30e4d9f05afe1fbe61423bab715915c4ccf28aa0ed2f52b\ - 092b86c8ec1f9d4795d6e91c88ba41297625c11a9e1f4f182da13cf51e541038\ - a1266bf32b2dd81ecd84bb80be8fdf97689942e944b7fbb6981e00cd680ee25f -Modulus: \ - 025098828217d00108030801e5f135fc6fd3010be39e49060a96addc8a081198\ - 803402c4b46e4ce0750fcbab8cf084c7ca8cae09f1b5482d336fa3af47b96791\ - d02d8143e274b1325f2213e17f9384c805f479e52a3117cf84869d395f1bc025\ - c918484478d2da1880d32bc519f4e6b2fd2d46958795550ce1765f725626f3fc\ - 17 -PrivateExponent: \ - 2db270c284328353f979cad99f4133c53acaa6ee71 -PublicElement: \ - 0179b283f67868aeded3a0c5633d0e6c18fad77174e2c89c03452593d05e77a9\ - fb029c0ccb2b6f2328e79c286ee392713f12d9d45578348383b81d11b0e0f7e8\ - 9965a7785d5ab64ea25bb73e8acaa8e84cb9897985015757a48c0b1dac3a6a60\ - 6fe671ea073ec434a46f227b8d4b02a46fbba2f6c6216736d669f55778d81004\ - d8 -Test: KeyPairValidAndConsistent -Message: 7E4F2ED4E79062778A2D -Signature: \ - 03f523873462ee1513833e2853c3b62e30c5c1cc3224f1a42dc154fa84ecce04\ - 487069530d76e0574a38 -Test: Verify -Message: A0E35846B5CF1B5BF560 -Signature: \ - 2264285d75a55c431a7adb9347bc07d58efbeb1dd9354d01b0b86f2875f8dec0\ - 294d20289d39369c5afa -Test: Verify -Message: 3B138785EFC6F520EAE0 -Signature: \ - 116e45961ca73f3ccf08b35f94877fef88772cf0fa2ab196c85a91104d8fbde6\ - 65b7032b2fb4011a88cc -Test: Verify -Message: 0F6BE2AA764B485145D4 -Signature: \ - 027ad753bde13c7f2fcd7571e5558f8af756cdb9463237fb0e285cb633cc86be\ - 1b410188d701f6ca83c6 -Test: Verify -Message: 6CD9FBD23EA58826FB04 -Signature: \ - 1651decd376899104e3fdbe40ab2d9bfd3c8577f3b092b66e3760678ecb3fc35\ - 23a59107e0bdccb76a73 -Test: Verify -Message: 473A82649565109E9E89 -Signature: \ - 2045ef56d92f89a214d76cca6b591068ac5f0d008c121ec4e5c4c1e8ca9b67cd\ - bb5ecc776a23b6d54ba5 -Test: Verify -Comment: 1027-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 291d0ba731a4303070504d8b9615640a5e1345e00f -SubgroupGenerator: \ - 051c9d0270b69ceef82af5aed5f91dc88d585096609d835d03d39cf3ce74f5a3\ - 402d4e8e192455493da61cc58ee6f54dd941172be3d7642169cbc52273f4b725\ - f1d6c820c3333336c64d32fb6238121b3ccb7c71b847764946bb0887a44ca9de\ - 802cda62efa9dda573751084225353f11ed837f3dc25de8374b6fdbfb6e313e4\ - 6d -Modulus: \ - 055402a8abe9cda3072ca8601d68032651feb0335856e57f8f8d4ec949098a64\ - 59151cefeef91b7aa733668c8cf0e9b96c93c61f3528d4036daa6565646f65d7\ - 4c4552817df7e5fb1cc421cfd885e27bb811ad227e81b3fa02f7a00bf01ee6e2\ - 3fb5572a75f8f29b58bd5f7db435e8a92a923f15d50f34213d29816921bf195b\ - 2d -PrivateExponent: \ - 13b27094d9a5a3a9704cebdbe890da325fa26ad555 -PublicElement: \ - 03b06b99097cd7145c7d7782b02e247a4741f3c7f39233627f17e13ebff89a18\ - cad6a454c3f32f7ef2910384030da71ae47e1c3fa79c2141dad107f8e715e47f\ - b0bb626baafc35db769852ebbec2d339c3c3d5f2287cfdd20b3b78ea4607086c\ - 42558ae4637eddd6a74bc1072d0f34d9c0130cbc9e84f537e7ce50df502d17b5\ - c3 -Test: KeyPairValidAndConsistent -Message: AE6DCD9535AEEE3ECC89 -Signature: \ - 1c6794878aabf07cf9f59b685d4a3a6e51c9135dc101a4a6a62c95a20902e2fa\ - 23db7d15293f595f86ab -Test: Verify -Message: C83A14EAC016D659F9FE -Signature: \ - 18ed4812925dca6a9c30e2e3566433e202be2d305414e1e6583905ad845cbc63\ - 2049804932aac79b858c -Test: Verify -Message: 745E02041EB487D16CE6 -Signature: \ - 13d4ef1de59ef0fe9bc4ecc6d382908642f6f5793e255b819e25ed124f7fa574\ - d91fc2e9b258f0514b15 -Test: Verify -Message: 62F019655A83501FC4E7 -Signature: \ - 07f797768984ecc792f366ece16f5102aec2aac6d31fdaf3972839cac2c99a2b\ - f5b347c887d37943383c -Test: Verify -Message: 351D37A4B5046E885EAA -Signature: \ - 22064cd5179ff1551dbf73c5220e17a9dfa1aa8f7f22f44a6c70f13c6d0a21f8\ - 7e53278251037a6cdc5e -Test: Verify -Message: 4073D33915F595F4FF9D -Signature: \ - 1f902ea2c9521b8c7f11619d35dd22a4667e2eb89a017194bb68ec0a9df762c9\ - 377c1c075b5f09566048 -Test: Verify -Comment: 1028-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 2368e2b864b250ad45406391e7eeaa3d27cd053c2b -SubgroupGenerator: \ - 07c325695dfe315a77ad7b42f0d18f9d4821b5c153fee7385877602fa54477bb\ - 8c0639d2438f34352b97c22d02a7295d2b53d5286a01caa919d6283614690624\ - 240af922675ccd4a0534ec336cb79cde31b02b5988cc5a53ca17790d67d803a2\ - 7bb927b9c59bdc6ac794175e285cafdece6778ab19a0b444747fee20d5bf929e\ - 70 -Modulus: \ - 0abdeff64b6f28256e4562109bffed29cb5aa95d89cc0ec95da0e773dbff3467\ - c271bbb1e1fbb6af058517fdacdf26b5919674c625eced6317d8631c063f43b3\ - ade2cd633d554913339071d6ebed5fd665fc5dd7d47b80721a976c3b14fbd253\ - f0f988c354725289f2897df0a15985c92b2d4da8d087870c251c72d979b8304d\ - 51 -PrivateExponent: \ - 0771305163506b2b83bd5279935df1b5fcf180b004 -PublicElement: \ - 043e4ae6244408879264fe6b859b578218705b9a45af22efded27141b7f090cb\ - cbe42dcf481df3e41b13920ae02b694eaa6bfd62f2d3c5d677b8c4ce783cbe27\ - 89e088b04489ef535ad4a517351c8835cf128f7ec677a1b1dbe3ae9cc4198ddb\ - 6e1cef8e978c0725f5063797bc43eb9ae496286cccbad5d4e026e9edb997d2f9\ - 18 -Test: KeyPairValidAndConsistent -Message: 4867852C83F181CDD010 -Signature: \ - 1db6a5661b20c9289428c3b9ebf65d5a8f757f3a3b1eb15dfaf0c8cefc891954\ - b48279eb45910a141ec3 -Test: Verify -Message: DA6493C86D6B62C5961C -Signature: \ - 1c05300a56319ba4a8ace1206f5f37b5bbefc9d80a171a57b6da3c02aa1f3079\ - 70583c008f073996d932 -Test: Verify -Message: AE2C1136BFE966794A6C -Signature: \ - 02dfd79eb18f3a862b11a5d199a7db1dc53580ade90517a7739cbd8ab1849c44\ - 54ba17a69b8d03ecc4f9 -Test: Verify -Message: B20160E0442E726BE749 -Signature: \ - 14c0cf809174d39f1324b7dd0d6d1fb3be5b5577c10048b12def39772fa60cd5\ - a9d2cca9075f12e5a3c1 -Test: Verify -Message: 3638935C4492F5CA42F2 -Signature: \ - 0081d7216636bc6fb9bc7a637a377ebf4f9048826e0360c8faf03dd28c4ee4a4\ - da82689259f140b3d918 -Test: Verify -Message: DFB674CA6E0FDC0CBE99 -Signature: \ - 1e3e21aa3dcccddb8cf3e360631fc36956263951ff18fec553531252b4dbe753\ - 6ed5fc62897d51500c38 -Test: Verify -Comment: 1029-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 3357536531dec150be0ef8747f69ea30d987ff7df1 -SubgroupGenerator: \ - 067dd80dbc6b41f58d08f077a9a3dcbfe12a62065fe6b4691c457f506b56dcab\ - 0433b3aad6ef962501633d0f3947b491a1317e7e6b632f062c53104d609c9222\ - b056f08a0c83662a70744331fd09b2b42fb0768e52da27e92732106fbd41ec73\ - 7373fd080b56b543d808d49eeb6e1bb0a8619b1edee8fb8295dc042423f684af\ - 8a -Modulus: \ - 1d0f176b6799b36724c92954c38d0288fa95400c2b14e064f76a6338fccaebca\ - 8d978b93bb76507bc150a50f9fe799fffe12ae2875b13ac1084ffcfde9f62b86\ - 185a72f04ff80538d6eac177edc98d61a517b1275bcf4b57aa262e1702d623bc\ - 344db7e5621c949a9b12e9936e88fae9b200a1f8ad5b40ec8220aa301267f38d\ - d7 -PrivateExponent: \ - 2dcdc00a86ecc2a60ebfa6660a83af1d7c3e570b85 -PublicElement: \ - 13834f0fa1f42abf7dbd264cb7d2eb5798da8972df67f517c62d7ae5070fd588\ - d61db62e492f9654833e876ed5737df35069f5ee01a45de881d8f5e68ec52ad9\ - ef32780e8c453a5f1e38cc17bc5cd061a3c122080f6e1b82d31877e8b08f634f\ - 497bd90b06824eaa0416c64104ce5622c272673d0dedb836ac7d47e0cea06739\ - 02 -Test: KeyPairValidAndConsistent -Message: 1E34034C47FE533F8FF5 -Signature: \ - 05c110848feacc9ac762ffa14943f9ce9a111777de0502d9f364ad9b2df4e1a8\ - 17bc15a602579b3a6a25 -Test: Verify -Message: 53D2CA23AF7DF95634F0 -Signature: \ - 14009997efeb3fd246956e44b5b0e48581ac5f414613b41fe5842c85b031ab8a\ - e68f66f8e1f1f9fc1d74 -Test: Verify -Message: 0F056E08AE77B3B30F33 -Signature: \ - 1beedf85b426d36a657f422ab9a9132986eaf415332816d33d70c726c3066158\ - c6481fd00503ffb65518 -Test: Verify -Message: F08C80E8FD38A3867B76 -Signature: \ - 0a23b8d8f920cfb0dec93725e4972080445647c54227fb987dd9f80fab446c75\ - 1c2594276168aa68f318 -Test: Verify -Message: 6D392690B92B3E75020F -Signature: \ - 18668f59c6974dad551a89bec5cacf0bf8617e8f43052eb97d7a1b12411b27b7\ - 4248b3d1f5070823e951 -Test: Verify -Message: 10AE0E091A267641FACF -Signature: \ - 1b3d10f74fdaed3d4d61fedfa3f6ad3a37c0cf6687166a312d5b280724c3545d\ - 225e1fe0639cfb1113d6 -Test: Verify -Comment: 1030-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 27c7996c1d3729c4cf1de06529e5619771e27ad9eb -SubgroupGenerator: \ - 0d87a4b01385da7f43b6277933c5f0dc8072dcacd5252e1b29f588114a7ac56e\ - 377050aa8174b5dda400f043234e4a746442792734dc80274a00a3676101be94\ - 759fc2630b9a858966488b12611d03d0b31e7243e124497a754544cee1db10bb\ - 0a81cf0b2a68045b76fe935f641c666fdc788a2b968c6668c669115756b961d9\ - fe -Modulus: \ - 2a32d68d31248024053bf628a94404b9a49d91ade4d7a45b071e93292a7f8c26\ - 61d9165f0ab85491d4b0dc67d335fa7d7dd172cb17193390a55eb000aa97e2b8\ - ed3ee64b73aa43ea9b8979132c2d966ab03c42cc14782c96e4284ee1136b8515\ - 007ed1b1a5708b5e8d81304fa651edc715918e2299cfe9016dfec5f454d907f5\ - 9f -PrivateExponent: \ - 091155581ecb7a0a792ba95c772d9382298bfdfa6f -PublicElement: \ - 0d7d22c931422fc46505887559a51490c2e367cdb40242cdbaeb23024693fd5c\ - 68f6a3307ca34b224457d5aa610b90eca3b39905481daaba7151318f09f974ad\ - 664546d14c87f797e38139ee1e07adba9c775e07b7f7b3edba87d886920d6b2c\ - ef5f084359566b0a3b8b940a65b9ad93fd7ccd1354cdcee3c43c6bd315180498\ - ad -Test: KeyPairValidAndConsistent -Message: 23EEE1D0EA8950B8F322 -Signature: \ - 18fe1a5f61c4946810e82a1e30fb6c87ce4ad9cebb1ae27eebfa8779fe292b2a\ - 451be3506bb65519dfd0 -Test: Verify -Message: 13FA6F2816FB83190A21 -Signature: \ - 2161a5be85f7ffe806df00f4bd50915e4b0674e7591f1c0902153823f881bc7b\ - 3f093d92bf86b74b5b3e -Test: Verify -Message: D071CCC0C6E4CAE82E5A -Signature: \ - 059158b2cf143f38eb8c51088dd79bf45990e596c8026fa3de5e668368b9d8d7\ - fe9ffdbdecf66aaf02bb -Test: Verify -Message: 22CE83F4803BF3EA2C48 -Signature: \ - 073b56d72a5b706455cfdcbf85b75ee45c40e96dd21a5460542ade665e51a85c\ - 510315a50307c2bbdb2d -Test: Verify -Message: 7A927EC7BB9CA16C1B0A -Signature: \ - 254c7525aad9b4b3807b3900a963fbf42f9ff2144820ea69abe5ba2c80613510\ - e1429ebc726fd0a87a4c -Test: Verify -Message: 9591B069993E10BC0B84 -Signature: \ - 0ed4210e5e4f2f9546ea181c4a61d062a1158810071905b180dbf070b480f436\ - 0b1f66065ecf111741cf -Test: Verify -Comment: 1031-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 26f86a81a6bb530c2f9b63e3690e95a0894575f445 -SubgroupGenerator: \ - 1e24828adb4ebf2becdbdcadf6706631293ad6566803d12479f04a7bb20b6086\ - fe81df164f8bd02c5f418c1140d143f11a71170b42d0753c952bfff951b9ca42\ - 04868375efaa4afad50b75787e41c5ab9ce8adcbccecd3716f350bb8aaeca9b6\ - 098bd0002d789e1f7db9c19d9045499877b93ecb4e7c64808b742063bbecf60e\ - 29 -Modulus: \ - 4d58515f7b41c4fc87e4fcefe5cf6d84b2d74a9d6f498ae9605fcbf1c5921742\ - 2001a272ef91dbd09e7af5ee54126dd4fc44bb1ed624d0dd5dafb984d5278114\ - 0bba40600cbd4752d2c32b43253efee57af6964c339570edb24195502e6d424b\ - 84bed65ac98c6fc52ec90e40a525f1863a53f2fbe2a0a133342eff4337f26ceb\ - 93 -PrivateExponent: \ - 0e61a054ee6510734a80f67a54d8c4151c957ef16f -PublicElement: \ - 19b50f1eea45bfaa22352a38f3c3b86d6f670747ac2fd94359608e25f2bb9f60\ - 2506bc357245deeb4c3c702d435c557da4f4a9fd37330a75547c91681fdbb51f\ - 286adb498d1e489e89b2e6a4eb9ff30222c51fefbeac7435f629f536ac2d6b87\ - 664d80e5c97398cf489a1d1ca217f7f21ea8e409f938378875cf5f528162e3bc\ - 07 -Test: KeyPairValidAndConsistent -Message: B4B3C8FBE82013228A21 -Signature: \ - 0e1003dd216194ded89f7d10b35a266ca7587d8cfb06a1fe3dd43f07dea4a6d6\ - acaa1477f2552c9b3114 -Test: Verify -Message: 17D2D18302173E2CE992 -Signature: \ - 027b40cd9a159257a57efae3a657399a3b6d8b06f707ba3a323abc383a93f919\ - 1246c38c03b028be05df -Test: Verify -Message: 8032AE177D6DF38C7E27 -Signature: \ - 1f5e3d759e3b832f5a6c57b055764ff5b8ad942dd819610ef94cfec296cd1b56\ - 4fd0b18bfa08c3645db3 -Test: Verify -Message: 768640A60A3C62E02428 -Signature: \ - 0abe2dfabc81ab677d2cbd781ef9768325a5d6d15a22f41b32972bd67058e617\ - e28c7e0dfbaae535d655 -Test: Verify -Message: B0999CA45B77ED63639D -Signature: \ - 1525539cd207d5f6f915eb2731b6451e38e11e0a031d7e420e0bb95d6616d8ef\ - 35d20eb43c111f8f9ca1 -Test: Verify -Message: 587EDB968FA82C12C930 -Signature: \ - 024ed20dc19a07e00158aa2fe9cb6353f0112b8fab0e6775667115e1c92e5eb4\ - 29876c12ed48e996f4f7 -Test: Verify -Comment: 1032-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 2e802b5369c3f1ddfa789bf8f2ad2e048ced3bf355 -SubgroupGenerator: \ - a9aebee7d29f90b081afc4d496a6a78210e918bb57a8a21c5995586c0bf20f7a\ - 56bb10a97e05a3a723e7db64612b12bb591b1fe7d2e46be8c96a7b2ce7c66076\ - aeded938775ae2223900adaf52a93f52d62173c82d4b67388c85d4c1127e1edf\ - 4643cf09f5375b60c19316c4f8f8fd7daea1d8b44a2d03e97c2741537f63d86b\ - 4a -Modulus: \ - d551680a62ebf98f0ed8930cc5b12de86d0a0c29a0d7e5524c24672a25428833\ - f4c19ac883ead22efcc0c6823f2e942c17adb7ab763ff2c7cc2698fa8b6448e5\ - 14d4628b197721bdaec780e126ac80ac83f24fef5c154f7690ceba903748be52\ - 12e3180ea718ca7a71a49dee939bf9bc5b7845c9648d074587ccd3724493b91f\ - 09 -PrivateExponent: \ - 0f66e04c5a75d3eac03d744e5432f23e3aea066a63 -PublicElement: \ - 2640c188055329f0b44aaf80f82f7fc7f0e421031834dfbd1fb6d6af6ab3e1c1\ - 73c901370a4ce2793c1b88d12f764c58ff064905da9c5001f679c7508972f237\ - bccca56524787466a7c9c2d6bb6392963008ed1a3e4cf3b13e66086bce3a4ca0\ - 4d8cabcf0cadb4c403c7d02a858460d04350e730289cb5adf200b5fdf1198168\ - b5 -Test: KeyPairValidAndConsistent -Message: 909068BEFFA43331FDC7 -Signature: \ - 2d557d8fae420880640dd9f60a524db48980c80d8b0179dd3c1892f02e87c9f6\ - a04a8aa731be05aaffef -Test: Verify -Message: AC8AFC7A1D9105539E10 -Signature: \ - 0ae7f23328453fdb03c090c09ee69d787ee7dfaccd047445b1026a9a7cacdd1f\ - 91455db7299538817894 -Test: Verify -Message: 310E40311BB3F77F9483 -Signature: \ - 28a8d8de06dc0011b044d19a163d350535d6ca91a023c9687557690ddf102d8c\ - 7558246ced311f2fc444 -Test: Verify -Message: 35455ABD53E6FB11ED9B -Signature: \ - 162156e476cba65e767b4db942bb35cdc6293cf4360f1801a215bb2c726c22af\ - f3a711d3c6473f1eb985 -Test: Verify -Message: 95FFA73B52F0D06A0C1E -Signature: \ - 29bf4f13e6aff528aa1b060c2baed865c442e0472422b4bd485aa5ba2a09ad0d\ - 732637bb3ee520f6bc0b -Test: Verify -Message: 1E9934125DA6E9B4E975 -Signature: \ - 1674975d0a97e799d113ff9cad06b7f70a33f5ca5f1916cee07b525270284fbb\ - 1c0428666987ad7e2116 -Test: Verify -Comment: 1536-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 232cf9bee9d56c8bd8252d1edb59d99c40cf32d07d9e5a4893 -SubgroupGenerator: \ - f028143e3f9d1317aafb814215ffda9c584da8943e96212c90a082c3d2f335e8\ - a6b64d1c890aa2224ebf158bec2b6fe6bad236417acd517a4907331e0be0dd0b\ - 801218ac270acdd45579290be1b94bc418b8f82c651d82a19d2f0e1cbb0fbc0f\ - 054d95150af96f9a7488010787a799c544883ff76a4e3092f2ca9aa9000cecb8\ - 8dda343c972c8192a83820727b1945c1a270cf913ab932457e8e6e207d06cd0e\ - fdf265b762b9fa15c9a14633af17204ba2b755ed1b3b421ac596a2a04e64be43 -Modulus: \ - fada6e4becef964a85caf9e129639a5616ac000dbac59bd50b84bc8d46411407\ - 9c34c5b58d7d40027faaf037c6a649c527cb002d3a716bdef62b6c94d7a47a8b\ - 65c2ebac05da09e40cdc417024cccba267a98f4eb69701a276b4f117662b5666\ - 05c36054e7f015d2e5f81331e5666ec17ebf71907788b40cbcea0f24aaffb029\ - ef5c25c55ae998f28a2ddb091d262c32ad324f4e64c7b4b50a19e9d92f6d8024\ - 188627cf5ce68674e7ec7da38fd6cf4ec29a6ce2f17e3188d8ef6b0e50d77d5b -PrivateExponent: \ - 1d4cedc87d55eea31bd702139b90be08d58692a1f97628a01b -PublicElement: \ - 819c8cedb9c014aa577e9046b90795accbebe81bef68b1b5c37c68cb357e1a5f\ - f92761bc26cb0953956b6c0aec05acfc9d1a27c50789793b13d9eaf2361760c9\ - 7a7d86e7d922f4809a5d2d01448e938190bbc24c150e03ef8305365ddbf5ca19\ - 6857314e3b3023f8ddc9d209bd7dad1ee763e7003fd1b0c53057d2e9acadd23a\ - a18f83d20143bc41a2dfa4a164c82621fc0f800052ec01bec7c99c66fe20ec57\ - 67e6fbbe8810cd5aa75eff3d8a4cb53e1259ebcfebcc2fcf21ba7f3589cd525a -Test: KeyPairValidAndConsistent -Message: 9F6DC301DF53FE22CAC0 -Signature: \ - 15b22111ffa1b733979cd9d8944b1291ce09468ccbd05040de0f83023c8fe083\ - 734ec39a542011643e448b01429c4bae06d1 -Test: Verify -Message: 2D7B5B9A27EAB468331E -Signature: \ - 029eea970a049ffcb4c6117c97d181bec7a27557ceb88d422b2212ca36238380\ - 87cd52d2445f539c9c03705ba4b485f56e19 -Test: Verify -Message: F552FCBBA04FFCCC5CB6 -Signature: \ - 115de3cc15d9a066c00fed43f583f6a9c984d4b8f4c93c3d72094a4b04dda506\ - 7d460c3d1ae33ba66ceaac676256c1e73001 -Test: Verify -Message: 0D52B894153A4BB74068 -Signature: \ - 0f6b8cc28e2068a3fe14d220177793daf3512ba6942e9d16ef1571fa34926c27\ - edd1bfa94723a663425f5c2d01eaddaa972e -Test: Verify -Message: 294442E103CC0CBA32A6 -Signature: \ - 0fbd8768a1b3025c0d0d309cc448320e086318772bb9485a5a0a2afa1eb2afb2\ - d1818aa7b1c55b9dc424e654524278f0ddbc -Test: Verify -Message: E993D8FE1E6F6C3914ED -Signature: \ - 0559d66bad3a51520bbb85827a257ab09dfa33938127c69bf40f08339b2f2251\ - c0e50b63d2a4d05225dea7f58f67de3071e9 -Test: Verify -Comment: 2048-bit NR key -KeyFormat: Component -SubgroupOrder: \ - 03f35f80fcd896f03eda9ff07f2e35295384c4f3b8f8c4821369ab5417 -SubgroupGenerator: \ - 75c5d8c8f72302d92be3bf486b8648330ff86954de5e6e83efef624a277574c1\ - 6757684d3874ee303fa08343fe82dae484e5dda6781280b434c4090044cc7ff9\ - b6e962594d3ca069815c0f0b6bfd25215a419420d0ef8a1595c6eb1b44a719b4\ - 0131081f75cc15cb09a5d5a029c8546230c30b4af2d4a9f4374c93a095c83b59\ - 4b1774d635d4aee965f1d094469f7bbf8bdc93216a6b8a6c5753b48962335bf2\ - 092aa583c897878c8a7ce61186b592b05d2aea710b673d5994cedb5f117fdb6b\ - 8ad4d89f443c4eb662b428a34a7522c69794cc0274f3eba837e90da86acbc707\ - 4ee3a0b029d970efa48b3d582b740ae0e585d175a5f63a385f8b6b8878b44e1a -Modulus: \ - 9a08865d2bc9e0cf03d2500b2a08402bb9dc953d5fcd73f04be61236efc0998a\ - 8f012f00e52f7a6e91e81b88a4c9f985a2da523cbe7caff08cae44963d2035ed\ - a72e1f31f82c8d64c86e686899d53c0200282f407ceb1507db480f1db223606a\ - 57466cf60fe9fc5f7ea7d5fd82ed3ab2cf5e35491dfaef0aa2e10fbfa3cdfeb5\ - ebf65e4dfc2837e1f6399db06cc2e0420c7b14a4c0d483b742ca58b31fec9f26\ - a64e9bfcaa82334e644f4b954e2a9c7eeae096b8864ecd223ead3bcf9e8c1f68\ - f6678faccdb7f26d8f33d8a5fb0cb156cc7daf4a96ec2b730c0d7f666d699f73\ - 45a37ddc1ccdea6d8f439ddb23de04a941b246bc257b0aef544a8e868bc8444f -PrivateExponent: \ - 0212c34d3d17b96a899548ebf43bb886676acebd2f040f5b33a4e88d2d -PublicElement: \ - 267f9c3ff3ee3cbc0f9e94dc7e6837e1ff65175e967987b90b9aea7eef1de6e4\ - c342bebb5dbd0c4e2f6514f2d487857a146dda6cfdbc8b56ed254cd65754d84d\ - d21a271cd15fc656274725643728b41ce3f0e6872b6dfb4c289e03f9b903880c\ - e3d7d745dfbb641c8c42ec0bfb6951ca2611fd877c32248c97252bdb42d7bd65\ - ebc50653dff389526c546d1e6ebaf6bd8b3298c01935901b7efb288b78730d89\ - fba7f46f2a642aee0dbc93aa29c190b201acf89d4f8ba28f3e3f54a1c5a48294\ - dda908f904afb7db398682c809ce13abd49279221d5b40ad76216bad7ca256d7\ - 18d3552344c481b20da5aac3e637fb7edeaf7960b532ef761376489f02fa8c10 -Test: KeyPairValidAndConsistent -Message: 5F3914F7AE0F6C76D152 -Signature: \ - 03d30b7eaaddcb384dce378f806e88d646419bbedbc2c0c5cae32f3c3b02e0e1\ - a3c3ab04b31e2c25db713db539a65c9419a846aea88aaa707cb4 -Test: Verify -Message: 769583D4E7EAD14C137A -Signature: \ - 01dc2815fd4918b8d3bd1743f5ab4546313b1fa8044b4737b2c485eeb0016bcc\ - cc084be064b6a8934a28011167eebbc33513ce609aa206810aa1 -Test: Verify -Message: 6441D5239F50C71DE0F5 -Signature: \ - 013f6d395de56832f82ee813b574002c36e551aaeffbb28ddebb84da7f01ff6f\ - 4c3d0f3519d548e2ec1a0b36f12ac1e4fedc83071bbbbce024a6 -Test: Verify -Message: F1C2D4F7C3ECDF2C17B7 -Signature: \ - 006441a8b3517613f9a8c2e7a89c492e7f49300d901ad01b92167c1fce02453d\ - 52b69dc1fc6532e792ad6366eae7fb14de3ad3f6f3132b0519fc -Test: Verify -Message: 752A1F2B8D9A717A882F -Signature: \ - 0127027984402f5b8cc069decc1bd611f0bb59c6eee86da7d334e3f8b903c5f3\ - 02c65aaf16a837963bf772931235f81e963e4d692699dfd4f7e1 -Test: Verify -Message: 666DC6B1E871026EDE56 -Signature: \ - 03e87b55a7e81318b7599da3fa8f18d46253b6546814fd1ae19318820100c297\ - 4de2624da0d54ca27e7fe3477913a6df35bf925de3f3d9a06849 -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/panama.txt b/external/crypto++-5.6.3/TestVectors/panama.txt deleted file mode 100644 index bd4d4ee3d..000000000 --- a/external/crypto++-5.6.3/TestVectors/panama.txt +++ /dev/null @@ -1,76 +0,0 @@ -AlgorithmType: MessageDigest -Name: Panama-LE -Source: Panama reference implementation -Message: "" -Digest: aa0cc954d757d7ac7779ca3342334ca471abd47d5952ac91ed837ecd5b16922b -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -Digest: 5f5ca355b90ac622b0aa7e654ef5f27e9e75111415b48b8afe3add1c6b89cba1 -Test: Verify -Source: generated by Crypto++ 5.2.1 -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: af9c66fb6058e2232a5dfba063ee14b0f86f0e334e165812559435464dd9bb60 -Test: Verify - -AlgorithmType: MessageDigest -Name: Panama-BE -Source: Panama reference implementation -Message: "" -Digest: e81aa04523532dd7267e5c5bc3ba0e289837a62ba032350351980e960a84b0af -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -Digest: 8fa7dadce0110f979a0b795e76b2c25628d8bda88747758149c42e3bc13f85bc -Test: Verify -Source: generated by Crypto++ 5.2.1 -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: cb34f0937e8d870d3bd7ff6311765f2c229a6c2154e4db119538db5159437cab -Test: Verify - -AlgorithmType: MAC -Name: Panama-LE -Source: modified from Panama hash test vectors -Key: "" -Message: "" -MAC: aa0cc954d757d7ac7779ca3342334ca471abd47d5952ac91ed837ecd5b16922b -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -MAC: 5f5ca355b90ac622b0aa7e654ef5f27e9e75111415b48b8afe3add1c6b89cba1 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -MAC: af9c66fb6058e2232a5dfba063ee14b0f86f0e334e165812559435464dd9bb60 -Test: Verify -Key: "The " -Message: "quick brown fox jumps over the lazy dog" -MAC: 5f5ca355b90ac622b0aa7e654ef5f27e9e75111415b48b8afe3add1c6b89cba1 -Test: Verify - -AlgorithmType: MAC -Name: Panama-BE -Source: modified from Panama hash test vectors -Key: "" -Message: "" -MAC: e81aa04523532dd7267e5c5bc3ba0e289837a62ba032350351980e960a84b0af -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -MAC: 8fa7dadce0110f979a0b795e76b2c25628d8bda88747758149c42e3bc13f85bc -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -MAC: cb34f0937e8d870d3bd7ff6311765f2c229a6c2154e4db119538db5159437cab -Test: Verify -Key: "The " -Message: "quick brown fox jumps over the lazy dog" -MAC: 8fa7dadce0110f979a0b795e76b2c25628d8bda88747758149c42e3bc13f85bc -Test: Verify - -AlgorithmType: SymmetricCipher -Source: generated by Crypto++ 5.2.1 -Key: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -IV: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -Name: Panama-LE -Plaintext: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -Ciphertext: F07F5FF2CCD01A0A7D44ACD6D239C2AF0DA1FF35275BAF5DFA6E09411B79D8B9 -Test: Encrypt -Name: Panama-BE -Plaintext: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -Ciphertext: E12E2F6BA41AE832D888DA9FA6863BC37C0E996F190A1711330322D37BD98CA4 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/rsa_oaep.txt b/external/crypto++-5.6.3/TestVectors/rsa_oaep.txt deleted file mode 100644 index 4e4cdd39b..000000000 --- a/external/crypto++-5.6.3/TestVectors/rsa_oaep.txt +++ /dev/null @@ -1,1765 +0,0 @@ -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 1: A 1024-bit RSA Key Pair -Modulus: \ -a8 b3 b2 84 af 8e b5 0b 38 70 34 a8 60 f1 46 c4 \ -91 9f 31 87 63 cd 6c 55 98 c8 ae 48 11 a1 e0 ab \ -c4 c7 e0 b0 82 d6 93 a5 e7 fc ed 67 5c f4 66 85 \ -12 77 2c 0c bc 64 a7 42 c6 c6 30 f5 33 c8 cc 72 \ -f6 2a e8 33 c4 0b f2 58 42 e9 84 bb 78 bd bf 97 \ -c0 10 7d 55 bd b6 62 f5 c4 e0 fa b9 84 5c b5 14 \ -8e f7 39 2d d3 aa ff 93 ae 1e 6b 66 7b b3 d4 24 \ -76 16 d4 f5 ba 10 d4 cf d2 26 de 88 d3 9f 16 fb -PublicExponent: 01 00 01 -PrivateExponent: \ -53 33 9c fd b7 9f c8 46 6a 65 5c 73 16 ac a8 5c \ -55 fd 8f 6d d8 98 fd af 11 95 17 ef 4f 52 e8 fd \ -8e 25 8d f9 3f ee 18 0f a0 e4 ab 29 69 3c d8 3b \ -15 2a 55 3d 4a c4 d1 81 2b 8b 9f a5 af 0e 7f 55 \ -fe 73 04 df 41 57 09 26 f3 31 1f 15 c4 d6 5a 73 \ -2c 48 31 16 ee 3d 3d 2d 0a f3 54 9a d9 bf 7c bf \ -b7 8a d8 84 f8 4d 5b eb 04 72 4d c7 36 9b 31 de \ -f3 7d 0c f5 39 e9 cf cd d3 de 65 37 29 ea d5 d1 -Prime1: \ -d3 27 37 e7 26 7f fe 13 41 b2 d5 c0 d1 50 a8 1b \ -58 6f b3 13 2b ed 2f 8d 52 62 86 4a 9c b9 f3 0a \ -f3 8b e4 48 59 8d 41 3a 17 2e fb 80 2c 21 ac f1 \ -c1 1c 52 0c 2f 26 a4 71 dc ad 21 2e ac 7c a3 9d -Prime2: \ -cc 88 53 d1 d5 4d a6 30 fa c0 04 f4 71 f2 81 c7 \ -b8 98 2d 82 24 a4 90 ed be b3 3d 3e 3d 5c c9 3c \ -47 65 70 3d 1d d7 91 64 2f 1f 11 6a 0d d8 52 be \ -24 19 b2 af 72 bf e9 a0 30 e8 60 b0 28 8b 5d 77 -ModPrime1PrivateExponent: \ -0e 12 bf 17 18 e9 ce f5 59 9b a1 c3 88 2f e8 04 \ -6a 90 87 4e ef ce 8f 2c cc 20 e4 f2 74 1f b0 a3 \ -3a 38 48 ae c9 c9 30 5f be cb d2 d7 68 19 96 7d \ -46 71 ac c6 43 1e 40 37 96 8d b3 78 78 e6 95 c1 -ModPrime2PrivateExponent: \ -95 29 7b 0f 95 a2 fa 67 d0 07 07 d6 09 df d4 fc \ -05 c8 9d af c2 ef 6d 6e a5 5b ec 77 1e a3 33 73 \ -4d 92 51 e7 90 82 ec da 86 6e fe f1 3c 45 9e 1a \ -63 13 86 b7 e3 54 c8 99 f5 f1 12 ca 85 d7 15 83 -MultiplicativeInverseOfPrime2ModPrime1: \ -4f 45 6c 50 24 93 bd c0 ed 2a b7 56 a3 a6 ed 4d \ -67 35 2a 69 7d 42 16 e9 32 12 b1 27 a6 3d 54 11 \ -ce 6f a9 8d 5d be fd 73 26 3e 37 28 14 27 43 81 \ -81 66 ed 7d d6 36 87 dd 2a 8c a1 d2 f4 fb d8 e1 -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 1.1 -Plaintext: \ -66 28 19 4e 12 07 3d b0 3b a9 4c da 9e f9 53 23 \ -97 d5 0d ba 79 b9 87 00 4a fe fe 34 -Seed: # not used yet\ -18 b7 76 ea 21 06 9d 69 77 6a 33 e9 6b ad 48 e1 \ -dd a0 a5 ef -Ciphertext: \ -35 4f e6 7b 4a 12 6d 5d 35 fe 36 c7 77 79 1a 3f \ -7b a1 3d ef 48 4e 2d 39 08 af f7 22 fa d4 68 fb \ -21 69 6d e9 5d 0b e9 11 c2 d3 17 4f 8a fc c2 01 \ -03 5f 7b 6d 8e 69 40 2d e5 45 16 18 c2 1a 53 5f \ -a9 d7 bf c5 b8 dd 9f c2 43 f8 cf 92 7d b3 13 22 \ -d6 e8 81 ea a9 1a 99 61 70 e6 57 a0 5a 26 64 26 \ -d9 8c 88 00 3f 84 77 c1 22 70 94 a0 d9 fa 1e 8c \ -40 24 30 9c e1 ec cc b5 21 00 35 d4 7a c7 2e 8a -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 1.2 -Plaintext: \ -75 0c 40 47 f5 47 e8 e4 14 11 85 65 23 29 8a c9\ -ba e2 45 ef af 13 97 fb e5 6f 9d d5 -Seed: # not used yet\ -0c c7 42 ce 4a 9b 7f 32 f9 51 bc b2 51 ef d9 25\ -fe 4f e3 5f -Ciphertext: \ -64 0d b1 ac c5 8e 05 68 fe 54 07 e5 f9 b7 01 df\ -f8 c3 c9 1e 71 6c 53 6f c7 fc ec 6c b5 b7 1c 11\ -65 98 8d 4a 27 9e 15 77 d7 30 fc 7a 29 93 2e 3f\ -00 c8 15 15 23 6d 8d 8e 31 01 7a 7a 09 df 43 52\ -d9 04 cd eb 79 aa 58 3a dc c3 1e a6 98 a4 c0 52\ -83 da ba 90 89 be 54 91 f6 7c 1a 4e e4 8d c7 4b\ -bb e6 64 3a ef 84 66 79 b4 cb 39 5a 35 2d 5e d1\ -15 91 2d f6 96 ff e0 70 29 32 94 6d 71 49 2b 44 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 1.3 -Plaintext: \ -d9 4a e0 83 2e 64 45 ce 42 33 1c b0 6d 53 1a 82\ -b1 db 4b aa d3 0f 74 6d c9 16 df 24 d4 e3 c2 45\ -1f ff 59 a6 42 3e b0 e1 d0 2d 4f e6 46 cf 69 9d\ -fd 81 8c 6e 97 b0 51 -Seed: # not used yet\ -25 14 df 46 95 75 5a 67 b2 88 ea f4 90 5c 36 ee\ -c6 6f d2 fd -Ciphertext: \ -42 37 36 ed 03 5f 60 26 af 27 6c 35 c0 b3 74 1b\ -36 5e 5f 76 ca 09 1b 4e 8c 29 e2 f0 be fe e6 03\ -59 5a a8 32 2d 60 2d 2e 62 5e 95 eb 81 b2 f1 c9\ -72 4e 82 2e ca 76 db 86 18 cf 09 c5 34 35 03 a4\ -36 08 35 b5 90 3b c6 37 e3 87 9f b0 5e 0e f3 26\ -85 d5 ae c5 06 7c d7 cc 96 fe 4b 26 70 b6 ea c3\ -06 6b 1f cf 56 86 b6 85 89 aa fb 7d 62 9b 02 d8\ -f8 62 5c a3 83 36 24 d4 80 0f b0 81 b1 cf 94 eb -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 1.4 -Plaintext: \ -52 e6 50 d9 8e 7f 2a 04 8b 4f 86 85 21 53 b9 7e\ -01 dd 31 6f 34 6a 19 f6 7a 85 -Seed: # not used yet\ -c4 43 5a 3e 1a 18 a6 8b 68 20 43 62 90 a3 7c ef\ -b8 5d b3 fb -Ciphertext: \ -45 ea d4 ca 55 1e 66 2c 98 00 f1 ac a8 28 3b 05\ -25 e6 ab ae 30 be 4b 4a ba 76 2f a4 0f d3 d3 8e\ -22 ab ef c6 97 94 f6 eb bb c0 5d db b1 12 16 24\ -7d 2f 41 2f d0 fb a8 7c 6e 3a cd 88 88 13 64 6f\ -d0 e4 8e 78 52 04 f9 c3 f7 3d 6d 82 39 56 27 22\ -dd dd 87 71 fe c4 8b 83 a3 1e e6 f5 92 c4 cf d4\ -bc 88 17 4f 3b 13 a1 12 aa e3 b9 f7 b8 0e 0f c6\ -f7 25 5b a8 80 dc 7d 80 21 e2 2a d6 a8 5f 07 55 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 1.5 -Plaintext: \ -8d a8 9f d9 e5 f9 74 a2 9f ef fb 46 2b 49 18 0f\ -6c f9 e8 02 -Seed: # not used yet\ -b3 18 c4 2d f3 be 0f 83 fe a8 23 f5 a7 b4 7e d5\ -e4 25 a3 b5 -Ciphertext: \ -36 f6 e3 4d 94 a8 d3 4d aa cb a3 3a 21 39 d0 0a\ -d8 5a 93 45 a8 60 51 e7 30 71 62 00 56 b9 20 e2\ -19 00 58 55 a2 13 a0 f2 38 97 cd cd 73 1b 45 25\ -7c 77 7f e9 08 20 2b ef dd 0b 58 38 6b 12 44 ea\ -0c f5 39 a0 5d 5d 10 32 9d a4 4e 13 03 0f d7 60\ -dc d6 44 cf ef 20 94 d1 91 0d 3f 43 3e 1c 7c 6d\ -d1 8b c1 f2 df 7f 64 3d 66 2f b9 dd 37 ea d9 05\ -91 90 f4 fa 66 ca 39 e8 69 c4 eb 44 9c bd c4 39 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 1.6 -Plaintext: \ -26 52 10 50 84 42 71 -Seed: # not used yet\ -e4 ec 09 82 c2 33 6f 3a 67 7f 6a 35 61 74 eb 0c\ -e8 87 ab c2 -Ciphertext: \ -42 ce e2 61 7b 1e ce a4 db 3f 48 29 38 6f bd 61\ -da fb f0 38 e1 80 d8 37 c9 63 66 df 24 c0 97 b4\ -ab 0f ac 6b df 59 0d 82 1c 9f 10 64 2e 68 1a d0\ -5b 8d 78 b3 78 c0 f4 6c e2 fa d6 3f 74 e0 ad 3d\ -f0 6b 07 5d 7e b5 f5 63 6f 8d 40 3b 90 59 ca 76\ -1b 5c 62 bb 52 aa 45 00 2e a7 0b aa ce 08 de d2\ -43 b9 d8 cb d6 2a 68 ad e2 65 83 2b 56 56 4e 43\ -a6 fa 42 ed 19 9a 09 97 69 74 2d f1 53 9e 82 55 -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 2: A 1025-bit RSA Key Pair -Modulus: \ -01 94 7c 7f ce 90 42 5f 47 27 9e 70 85 1f 25 d5\ -e6 23 16 fe 8a 1d f1 93 71 e3 e6 28 e2 60 54 3e\ -49 01 ef 60 81 f6 8c 0b 81 41 19 0d 2a e8 da ba\ -7d 12 50 ec 6d b6 36 e9 44 ec 37 22 87 7c 7c 1d\ -0a 67 f1 4b 16 94 c5 f0 37 94 51 a4 3e 49 a3 2d\ -de 83 67 0b 73 da 91 a1 c9 9b c2 3b 43 6a 60 05\ -5c 61 0f 0b af 99 c1 a0 79 56 5b 95 a3 f1 52 66\ -32 d1 d4 da 60 f2 0e da 25 e6 53 c4 f0 02 76 6f\ -45 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -08 23 f2 0f ad b5 da 89 08 8a 9d 00 89 3e 21 fa\ -4a 1b 11 fb c9 3c 64 a3 be 0b aa ea 97 fb 3b 93\ -c3 ff 71 37 04 c1 9c 96 3c 1d 10 7a ae 99 05 47\ -39 f7 9e 02 e1 86 de 86 f8 7a 6d de fe a6 d8 cc\ -d1 d3 c8 1a 47 bf a7 25 5b e2 06 01 a4 a4 b2 f0\ -8a 16 7b 5e 27 9d 71 5b 1b 45 5b dd 7e ab 24 59\ -41 d9 76 8b 9a ce fb 3c cd a5 95 2d a3 ce e7 25\ -25 b4 50 16 63 a8 ee 15 c9 e9 92 d9 24 62 fe 39 -Prime1: \ -01 59 db de 04 a3 3e f0 6f b6 08 b8 0b 19 0f 4d\ -3e 22 bc c1 3a c8 e4 a0 81 03 3a bf a4 16 ed b0\ -b3 38 aa 08 b5 73 09 ea 5a 52 40 e7 dc 6e 54 37\ -8c 69 41 4c 31 d9 7d db 1f 40 6d b3 76 9c c4 1a\ -43 -Prime2: \ -01 2b 65 2f 30 40 3b 38 b4 09 95 fd 6f f4 1a 1a\ -cc 8a da 70 37 32 36 b7 20 2d 39 b2 ee 30 cf b4\ -6d b0 95 11 f6 f3 07 cc 61 cc 21 60 6c 18 a7 5b\ -8a 62 f8 22 df 03 1b a0 df 0d af d5 50 6f 56 8b\ -d7 -ModPrime1PrivateExponent: \ -43 6e f5 08 de 73 65 19 c2 da 4c 58 0d 98 c8 2c\ -b7 45 2a 3f b5 ef ad c3 b9 c7 78 9a 1b c6 58 4f\ -79 5a dd bb d3 24 39 c7 46 86 55 2e cb 6c 2c 30\ -7a 4d 3a f7 f5 39 ee c1 57 24 8c 7b 31 f1 a2 55 -ModPrime2PrivateExponent: \ -01 2b 15 a8 9f 3d fb 2b 39 07 3e 73 f0 2b dd 0c\ -1a 7b 37 9d d4 35 f0 5c dd e2 ef f9 e4 62 94 8b\ -7c ec 62 ee 90 50 d5 e0 81 6e 07 85 a8 56 b4 91\ -08 dc b7 5f 36 83 87 4d 1c a6 32 9a 19 01 30 66\ -ff -MultiplicativeInverseOfPrime2ModPrime1: \ -02 70 db 17 d5 91 4b 01 8d 76 11 8b 24 38 9a 73\ -50 ec 83 6b 00 63 a2 17 21 23 6f d8 ed b6 d8 9b\ -51 e7 ee b8 7b 61 1b 71 32 cb 7e a7 35 6c 23 15\ -1c 1e 77 51 50 7c 78 6d 9e e1 79 41 70 a8 c8 e8 -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 2.1 -Plaintext: \ -8f f0 0c aa 60 5c 70 28 30 63 4d 9a 6c 3d 42 c6\ -52 b5 8c f1 d9 2f ec 57 0b ee e7 -Seed: # not used yet\ -8c 40 7b 5e c2 89 9e 50 99 c5 3e 8c e7 93 bf 94\ -e7 1b 17 82 -Ciphertext: \ -01 81 af 89 22 b9 fc b4 d7 9d 92 eb e1 98 15 99\ -2f c0 c1 43 9d 8b cd 49 13 98 a0 f4 ad 3a 32 9a\ -5b d9 38 55 60 db 53 26 83 c8 b7 da 04 e4 b1 2a\ -ed 6a ac df 47 1c 34 c9 cd a8 91 ad dc c2 df 34\ -56 65 3a a6 38 2e 9a e5 9b 54 45 52 57 eb 09 9d\ -56 2b be 10 45 3f 2b 6d 13 c5 9c 02 e1 0f 1f 8a\ -bb 5d a0 d0 57 09 32 da cf 2d 09 01 db 72 9d 0f\ -ef cc 05 4e 70 96 8e a5 40 c8 1b 04 bc ae fe 72\ -0e -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 2.2 -Plaintext: \ -2d -Seed: # not used yet\ -b6 00 cf 3c 2e 50 6d 7f 16 77 8c 91 0d 3a 8b 00\ -3e ee 61 d5 -Ciphertext: \ -01 87 59 ff 1d f6 3b 27 92 41 05 62 31 44 16 a8\ -ae af 2a c6 34 b4 6f 94 0a b8 2d 64 db f1 65 ee\ -e3 30 11 da 74 9d 4b ab 6e 2f cd 18 12 9c 9e 49\ -27 7d 84 53 11 2b 42 9a 22 2a 84 71 b0 70 99 39\ -98 e7 58 86 1c 4d 3f 6d 74 9d 91 c4 29 0d 33 2c\ -7a 4a b3 f7 ea 35 ff 3a 07 d4 97 c9 55 ff 0f fc\ -95 00 6b 62 c6 d2 96 81 0d 9b fa b0 24 19 6c 79\ -34 01 2c 2d f9 78 ef 29 9a ba 23 99 40 cb a1 02\ -45 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 2.3 -Plaintext: \ -74 fc 88 c5 1b c9 0f 77 af 9d 5e 9a 4a 70 13 3d\ -4b 4e 0b 34 da 3c 37 c7 ef 8e -Seed: # not used yet\ -a7 37 68 ae ea a9 1f 9d 8c 1e d6 f9 d2 b6 34 67\ -f0 7c ca e3 -Ciphertext: \ -01 88 02 ba b0 4c 60 32 5e 81 c4 96 23 11 f2 be\ -7c 2a dc e9 30 41 a0 07 19 c8 8f 95 75 75 f2 c7\ -9f 1b 7b c8 ce d1 15 c7 06 b3 11 c0 8a 2d 98 6c\ -a3 b6 a9 33 6b 14 7c 29 c6 f2 29 40 9d de c6 51\ -bd 1f dd 5a 0b 7f 61 0c 99 37 fd b4 a3 a7 62 36\ -4b 8b 32 06 b4 ea 48 5f d0 98 d0 8f 63 d4 aa 8b\ -b2 69 7d 02 7b 75 0c 32 d7 f7 4e af 51 80 d2 e9\ -b6 6b 17 cb 2f a5 55 23 bc 28 0d a1 0d 14 be 20\ -53 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 2.4 -Plaintext: \ -a7 eb 2a 50 36 93 1d 27 d4 e8 91 32 6d 99 69 2f\ -fa dd a9 bf 7e fd 3e 34 e6 22 c4 ad c0 85 f7 21\ -df e8 85 07 2c 78 a2 03 b1 51 73 9b e5 40 fa 8c\ -15 3a 10 f0 0a -Seed: # not used yet\ -9a 7b 3b 0e 70 8b d9 6f 81 90 ec ab 4f b9 b2 b3\ -80 5a 81 56 -Ciphertext: \ -00 a4 57 8c bc 17 63 18 a6 38 fb a7 d0 1d f1 57\ -46 af 44 d4 f6 cd 96 d7 e7 c4 95 cb f4 25 b0 9c\ -64 9d 32 bf 88 6d a4 8f ba f9 89 a2 11 71 87 ca\ -fb 1f b5 80 31 76 90 e3 cc d4 46 92 0b 7a f8 2b\ -31 db 58 04 d8 7d 01 51 4a cb fa 91 56 e7 82 f8\ -67 f6 be d9 44 9e 0e 9a 2c 09 bc ec c6 aa 08 76\ -36 96 5e 34 b3 ec 76 6f 2f e2 e4 30 18 a2 fd de\ -b1 40 61 6a 0e 9d 82 e5 33 10 24 ee 06 52 fc 76\ -41 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 2.5 -Plaintext: \ -2e f2 b0 66 f8 54 c3 3f 3b dc bb 59 94 a4 35 e7\ -3d 6c 6c -Seed: # not used yet\ -eb 3c eb bc 4a dc 16 bb 48 e8 8c 8a ec 0e 34 af\ -7f 42 7f d3 -Ciphertext: \ -00 eb c5 f5 fd a7 7c fd ad 3c 83 64 1a 90 25 e7\ -7d 72 d8 a6 fb 33 a8 10 f5 95 0f 8d 74 c7 3e 8d\ -93 1e 86 34 d8 6a b1 24 62 56 ae 07 b6 00 5b 71\ -b7 f2 fb 98 35 12 18 33 1c e6 9b 8f fb dc 9d a0\ -8b bc 9c 70 4f 87 6d eb 9d f9 fc 2e c0 65 ca d8\ -7f 90 90 b0 7a cc 17 aa 7f 99 7b 27 ac a4 88 06\ -e8 97 f7 71 d9 51 41 fe 45 26 d8 a5 30 1b 67 86\ -27 ef ab 70 7f d4 0f be bd 6e 79 2a 25 61 3e 7a\ -ec -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 2.6 -Plaintext: \ -8a 7f b3 44 c8 b6 cb 2c f2 ef 1f 64 3f 9a 32 18\ -f6 e1 9b ba 89 c0 -Seed: # not used yet\ -4c 45 cf 4d 57 c9 8e 3d 6d 20 95 ad c5 1c 48 9e\ -b5 0d ff 84 -Ciphertext: \ -01 08 39 ec 20 c2 7b 90 52 e5 5b ef b9 b7 7e 6f\ -c2 6e 90 75 d7 a5 43 78 c6 46 ab df 51 e4 45 bd\ -57 15 de 81 78 9f 56 f1 80 3d 91 70 76 4a 9e 93\ -cb 78 79 86 94 02 3e e7 39 3c e0 4b c5 d8 f8 c5\ -a5 2c 17 1d 43 83 7e 3a ca 62 f6 09 eb 0a a5 ff\ -b0 96 0e f0 41 98 dd 75 4f 57 f7 fb e6 ab f7 65\ -cf 11 8b 4c a4 43 b2 3b 5a ab 26 6f 95 23 26 ac\ -45 81 10 06 44 32 5f 8b 72 1a cd 5d 04 ff 14 ef\ -3a -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 3: A 1026-bit RSA Key Pair -Modulus: \ -02 b5 8f ec 03 9a 86 07 00 a4 d7 b6 46 2f 93 e6\ -cd d4 91 16 1d dd 74 f4 e8 10 b4 0e 3c 16 52 00\ -6a 5c 27 7b 27 74 c1 13 05 a4 cb ab 5a 78 ef a5\ -7e 17 a8 6d f7 a3 fa 36 fc 4b 1d 22 49 f2 2e c7\ -c2 dd 6a 46 32 32 ac ce a9 06 d6 6e be 80 b5 70\ -4b 10 72 9d a6 f8 33 23 4a bb 5e fd d4 a2 92 cb\ -fa d3 3b 4d 33 fa 7a 14 b8 c3 97 b5 6e 3a cd 21\ -20 34 28 b7 7c df a3 3a 6d a7 06 b3 d8 b0 fc 43\ -e9 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -15 b4 8a 5b 56 83 a9 46 70 e2 3b 57 18 f8 14 fa\ -0e 13 f8 50 38 f5 07 11 18 2c ba 61 51 05 81 f3\ -d2 2c 7e 23 2e f9 37 e2 2e 55 1d 68 b8 6e 2f 8c\ -b1 aa d8 be 2e 48 8f 5d f7 ef d2 79 e3 f5 68 d4\ -ea f3 6f 80 cf 71 41 ac e6 0f cc 91 13 fb 6c 4a\ -84 1f d5 0b bc 7c 51 2f fc be ff 21 48 7a a8 11\ -eb 3c a8 c6 20 05 34 6a 86 de 86 bf a1 d8 a9 48\ -fd 3f 34 8c 22 ea ad f3 33 c3 ce 6c e1 32 08 fd -Prime1: \ -01 bf 01 d2 16 d7 35 95 cf 02 70 c2 be b7 8d 40\ -a0 d8 44 7d 31 da 91 9a 98 3f 7e ea 78 1b 77 d8\ -5f e3 71 b3 e9 37 3e 7b 69 21 7d 31 50 a0 2d 89\ -58 de 7f ad 9d 55 51 60 95 8b 44 54 12 7e 0e 7e\ -af -Prime2: \ -01 8d 33 99 65 81 66 db 38 29 81 6d 7b 29 54 16\ -75 9e 9c 91 98 7f 5b 2d 8a ec d6 3b 04 b4 8b d7\ -b2 fc f2 29 bb 7f 8a 6d c8 8b a1 3d d2 e3 9a d5\ -5b 6d 1a 06 16 07 08 f9 70 0b e8 0b 8f d3 74 4c\ -e7 -ModPrime1PrivateExponent: \ -06 c0 a2 49 d2 0a 6f 2e e7 5c 88 b4 94 d5 3f 6a\ -ae 99 aa 42 7c 88 c2 8b 16 3a 76 94 45 e5 f3 90\ -cf 40 c2 74 fd 6e a6 32 9a 5c e7 c7 ce 03 a2 15\ -83 96 ee 2a 78 45 78 6e 09 e2 88 5a 97 28 e4 e5 -ModPrime2PrivateExponent: \ -d1 d2 7c 29 fe dd 92 d8 6c 34 8e dd 0c cb fa c1\ -4f 74 6e 05 1c e1 d1 81 1d f3 5d 61 f2 ee 1c 97\ -d4 bf 28 04 80 2f 64 27 18 7b a8 e9 0a 8a f4 42\ -43 b4 07 9b 03 44 5e 60 2e 29 fa 51 93 e6 4f e9 -MultiplicativeInverseOfPrime2ModPrime1: \ -8c b2 f7 56 bd 89 41 b1 d3 b7 70 e5 ad 31 ee 37\ -3b 28 ac da 69 ff 9b 6f 40 fe 57 8b 9f 1a fb 85\ -83 6f 96 27 d3 7a cf f7 3c 27 79 e6 34 bb 26 01\ -1c 2c 8f 7f 33 61 ae 2a 9e a6 5e d6 89 e3 63 9a -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 3.1 -Plaintext: \ -08 78 20 b5 69 e8 fa 8d -Seed: # not used yet\ -8c ed 6b 19 62 90 80 57 90 e9 09 07 40 15 e6 a2\ -0b 0c 48 94 -Ciphertext: \ -02 6a 04 85 d9 6a eb d9 6b 43 82 08 50 99 b9 62\ -e6 a2 bd ec 3d 90 c8 db 62 5e 14 37 2d e8 5e 2d\ -5b 7b aa b6 5c 8f af 91 bb 55 04 fb 49 5a fc e5\ -c9 88 b3 f6 a5 2e 20 e1 d6 cb d3 56 6c 5c d1 f2\ -b8 31 8b b5 42 cc 0e a2 5c 4a ab 99 32 af a2 07\ -60 ea dd ec 78 43 96 a0 7e a0 ef 24 d4 e6 f4 d3\ -7e 50 52 a7 a3 1e 14 6a a4 80 a1 11 bb e9 26 40\ -13 07 e0 0f 41 00 33 84 2b 6d 82 fe 5c e4 df ae\ -80 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 3.2 -Plaintext: \ -46 53 ac af 17 19 60 b0 1f 52 a7 be 63 a3 ab 21\ -dc 36 8e c4 3b 50 d8 2e c3 78 1e 04 -Seed: # not used yet\ -b4 29 1d 65 67 55 08 48 cc 15 69 67 c8 09 ba ab\ -6c a5 07 f0 -Ciphertext: \ -02 4d b8 9c 78 02 98 9b e0 78 38 47 86 30 84 94\ -1b f2 09 d7 61 98 7e 38 f9 7c b5 f6 f1 bc 88 da\ -72 a5 0b 73 eb af 11 c8 79 c4 f9 5d f3 7b 85 0b\ -8f 65 d7 62 2e 25 b1 b8 89 e8 0f e8 0b ac a2 06\ -9d 6e 0e 1d 82 99 53 fc 45 90 69 de 98 ea 97 98\ -b4 51 e5 57 e9 9a bf 8f e3 d9 cc f9 09 6e bb f3\ -e5 25 5d 3b 4e 1c 6d 2e ca df 06 7a 35 9e ea 86\ -40 5a cd 47 d5 e1 65 51 7c ca fd 47 d6 db ee 4b\ -f5 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 3.3 -Plaintext: \ -d9 4c d0 e0 8f a4 04 ed 89 -Seed: # not used yet\ -ce 89 28 f6 05 95 58 25 40 08 ba dd 97 94 fa dc\ -d2 fd 1f 65 -Ciphertext: \ -02 39 bc e6 81 03 24 41 52 88 77 d6 d1 c8 bb 28\ -aa 3b c9 7f 1d f5 84 56 36 18 99 57 97 68 38 44\ -ca 86 66 47 32 f4 be d7 a0 aa b0 83 aa ab fb 72\ -38 f5 82 e3 09 58 c2 02 4e 44 e5 70 43 b9 79 50\ -fd 54 3d a9 77 c9 0c dd e5 33 7d 61 84 42 f9 9e\ -60 d7 78 3a b5 9c e6 dd 9d 69 c4 7a d1 e9 62 be\ -c2 2d 05 89 5c ff 8d 3f 64 ed 52 61 d9 2b 26 78\ -51 03 93 48 49 90 ba 3f 7f 06 81 8a e6 ff ce 8a\ -3a -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 3.4 -Plaintext: \ -6c c6 41 b6 b6 1e 6f 96 39 74 da d2 3a 90 13 28\ -4e f1 -Seed: # not used yet\ -6e 29 79 f5 2d 68 14 a5 7d 83 b0 90 05 48 88 f1\ -19 a5 b9 a3 -Ciphertext: \ -02 99 4c 62 af d7 6f 49 8b a1 fd 2c f6 42 85 7f\ -ca 81 f4 37 3c b0 8f 1c ba ee 6f 02 5c 3b 51 2b\ -42 c3 e8 77 91 13 47 66 48 03 9d be 04 93 f9 24\ -62 92 fa c2 89 50 60 0e 7c 0f 32 ed f9 c8 1b 9d\ -ec 45 c3 bd e0 cc 8d 88 47 59 01 69 90 7b 7d c5\ -99 1c eb 29 bb 07 14 d6 13 d9 6d f0 f1 2e c5 d8\ -d3 50 7c 8e e7 ae 78 dd 83 f2 16 fa 61 de 10 03\ -63 ac a4 8a 7e 91 4a e9 f4 2d df be 94 3b 09 d9\ -a0 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 3.5 -Plaintext: \ -df 51 51 83 2b 61 f4 f2 58 91 fb 41 72 f3 28 d2\ -ed df 83 71 ff cf db e9 97 93 92 95 f3 0e ca 69\ -18 01 7c fd a1 15 3b f7 a6 af 87 59 32 23 -Seed: # not used yet\ -2d 76 0b fe 38 c5 9d e3 4c dc 8b 8c 78 a3 8e 66\ -28 4a 2d 27 -Ciphertext: \ -01 62 04 2f f6 96 95 92 a6 16 70 31 81 1a 23 98\ -34 ce 63 8a bf 54 fe c8 b9 94 78 12 2a fe 2e e6\ -7f 8c 5b 18 b0 33 98 05 bf db c5 a4 e6 72 0b 37\ -c5 9c fb a9 42 46 4c 59 7f f5 32 a1 19 82 15 45\ -fd 2e 59 b1 14 e6 1d af 71 82 05 29 f5 02 9c f5\ -24 95 43 27 c3 4e c5 e6 f5 ba 7e fc c4 de 94 3a\ -b8 ad 4e d7 87 b1 45 43 29 f7 0d b7 98 a3 a8 f4\ -d9 2f 82 74 e2 b2 94 8a de 62 7c e8 ee 33 e4 3c\ -60 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 3.6 -Plaintext: \ -3c 3b ad 89 3c 54 4a 6d 52 0a b0 22 31 91 88 c8\ -d5 04 b7 a7 88 b8 50 90 3b 85 97 2e aa 18 55 2e\ -11 34 a7 ad 60 98 82 62 54 ff 7a b6 72 b3 d8 eb\ -31 58 fa c6 d4 cb ae f1 -Seed: # not used yet\ -f1 74 77 9c 5f d3 cf e0 07 ba dc b7 a3 6c 9b 55\ -bf cf bf 0e -Ciphertext: \ -00 11 20 51 e7 5d 06 49 43 bc 44 78 07 5e 43 48\ -2f d5 9c ee 06 79 de 68 93 ee c3 a9 43 da a4 90\ -b9 69 1c 93 df c0 46 4b 66 23 b9 f3 db d3 e7 00\ -83 26 4f 03 4b 37 4f 74 16 4e 1a 00 76 37 25 e5\ -74 74 4b a0 b9 db 83 43 4f 31 df 96 f6 e2 a2 6f\ -6d 8e ba 34 8b d4 68 6c 22 38 ac 07 c3 7a ac 37\ -85 d1 c7 ee a2 f8 19 fd 91 49 17 98 ed 8e 9c ef\ -5e 43 b7 81 b0 e0 27 6e 37 c4 3f f9 49 2d 00 57\ -30 -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 4: A 1027-bit RSA Key Pair -Modulus: \ -05 12 40 b6 cc 00 04 fa 48 d0 13 46 71 c0 78 c7\ -c8 de c3 b3 e2 f2 5b c2 56 44 67 33 9d b3 88 53\ -d0 6b 85 ee a5 b2 de 35 3b ff 42 ac 2e 46 bc 97\ -fa e6 ac 96 18 da 95 37 a5 c8 f5 53 c1 e3 57 62\ -59 91 d6 10 8d cd 78 85 fb 3a 25 41 3f 53 ef ca\ -d9 48 cb 35 cd 9b 9a e9 c1 c6 76 26 d1 13 d5 7d\ -de 4c 5b ea 76 bb 5b b7 de 96 c0 0d 07 37 2e 96\ -85 a6 d7 5c f9 d2 39 fa 14 8d 70 93 1b 5f 3f b0\ -39 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -04 11 ff ca 3b 7c a5 e9 e9 be 7f e3 8a 85 10 5e\ -35 38 96 db 05 c5 79 6a ec d2 a7 25 16 1e b3 65\ -1c 86 29 a9 b8 62 b9 04 d7 b0 c7 b3 7f 8c b5 a1\ -c2 b5 40 01 01 8a 00 a1 eb 2c af e4 ee 4e 94 92\ -c3 48 bc 2b ed ab 4b 9e bb f0 64 e8 ef f3 22 b9\ -00 9f 8e ec 65 39 05 f4 0d f8 8a 3c dc 49 d4 56\ -7f 75 62 7d 41 ac a6 24 12 9b 46 a0 b7 c6 98 e5\ -e6 5f 2b 7b a1 02 c7 49 a1 01 35 b6 54 0d 04 01 -Prime1: \ -02 74 58 c1 9e c1 63 69 19 e7 36 c9 af 25 d6 09\ -a5 1b 8f 56 1d 19 c6 bf 69 43 dd 1e e1 ab 8a 4a\ -3f 23 21 00 bd 40 b8 8d ec c6 ba 23 55 48 b6 ef\ -79 2a 11 c9 de 82 3d 0a 79 22 c7 09 5b 6e ba 57\ -01 -Prime2: \ -02 10 ee 9b 33 ab 61 71 6e 27 d2 51 bd 46 5f 4b\ -35 a1 a2 32 e2 da 00 90 1c 29 4b f2 23 50 ce 49\ -0d 09 9f 64 2b 53 75 61 2d b6 3b a1 f2 03 86 49\ -2b f0 4d 34 b3 c2 2b ce b9 09 d1 34 41 b5 3b 51\ -39 -ModPrime1PrivateExponent: \ -39 fa 02 8b 82 6e 88 c1 12 1b 75 0a 8b 24 2f a9\ -a3 5c 5b 66 bd fd 1f a6 37 d3 cc 48 a8 4a 4f 45\ -7a 19 4e 77 27 e4 9f 7b cc 6e 5a 5a 41 26 57 fc\ -47 0c 73 22 eb c3 74 16 ef 45 8c 30 7a 8c 09 01 -ModPrime2PrivateExponent: \ -01 5d 99 a8 41 95 94 39 79 fa 9e 1b e2 c3 c1 b6\ -9f 43 2f 46 fd 03 e4 7d 5b ef bb bf d6 b1 d1 37\ -1d 83 ef b3 30 a3 e0 20 94 2b 2f ed 11 5e 5d 02\ -be 24 fd 92 c9 01 9d 1c ec d6 dd 4c f1 e5 4c c8\ -99 -MultiplicativeInverseOfPrime2ModPrime1: \ -01 f0 b7 01 51 70 b3 f5 e4 22 23 ba 30 30 1c 41\ -a6 d8 7c bb 70 e3 0c b7 d3 c6 7d 25 47 3d b1 f6\ -cb f0 3e 3f 91 26 e3 e9 79 68 27 9a 86 5b 2c 2b\ -42 65 24 cf c5 2a 68 3d 31 ed 30 eb 98 4b e4 12\ -ba -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 4.1 -Plaintext: \ -4a 86 60 95 34 ee 43 4a 6c bc a3 f7 e9 62 e7 6d\ -45 5e 32 64 c1 9f 60 5f 6e 5f f6 13 7c 65 c5 6d\ -7f b3 44 cd 52 bc 93 37 4f 3d 16 6c 9f 0c 6f 9c\ -50 6b ad 19 33 09 72 d2 -Seed: # not used yet\ -1c ac 19 ce 99 3d ef 55 f9 82 03 f6 85 28 96 c9\ -5c cc a1 f3 -Ciphertext: \ -04 cc e1 96 14 84 5e 09 41 52 a3 fe 18 e5 4e 33\ -30 c4 4e 5e fb c6 4a e1 68 86 cb 18 69 01 4c c5\ -78 1b 1f 8f 9e 04 53 84 d0 11 2a 13 5c a0 d1 2e\ -9c 88 a8 e4 06 34 16 de aa e3 84 4f 60 d6 e9 6f\ -e1 55 14 5f 45 25 b9 a3 44 31 ca 37 66 18 0f 70\ -e1 5a 5e 5d 8e 8b 1a 51 6f f8 70 60 9f 13 f8 96\ -93 5c ed 18 82 79 a5 8e d1 3d 07 11 42 77 d7 5c\ -65 68 60 7e 0a b0 92 fd 80 3a 22 3e 4a 8e e0 b1\ -a8 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 4.2 -Plaintext: \ -b0 ad c4 f3 fe 11 da 59 ce 99 27 73 d9 05 99 43\ -c0 30 46 49 7e e9 d9 f9 a0 6d f1 16 6d b4 6d 98\ -f5 8d 27 ec 07 4c 02 ee e6 cb e2 44 9c 8b 9f c5\ -08 0c 5c 3f 44 33 09 25 12 ec 46 aa 79 37 43 c8 -Seed: # not used yet\ -f5 45 d5 89 75 85 e3 db 71 aa 0c b8 da 76 c5 1d\ -03 2a e9 63 -Ciphertext: \ -00 97 b6 98 c6 16 56 45 b3 03 48 6f bf 5a 2a 44\ -79 c0 ee 85 88 9b 54 1a 6f 0b 85 8d 6b 65 97 b1\ -3b 85 4e b4 f8 39 af 03 39 9a 80 d7 9b da 65 78\ -c8 41 f9 0d 64 57 15 b2 80 d3 71 43 99 2d d1 86\ -c8 0b 94 9b 77 5c ae 97 37 0e 4e c9 74 43 13 6c\ -6d a4 84 e9 70 ff db 13 23 a2 08 47 82 1d 3b 18\ -38 1d e1 3b b4 9a ae a6 65 30 c4 a4 b8 27 1f 3e\ -ae 17 2c d3 66 e0 7e 66 36 f1 01 9d 2a 28 ae d1\ -5e -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 4.3 -Plaintext: \ -bf 6d 42 e7 01 70 7b 1d 02 06 b0 c8 b4 5a 1c 72\ -64 1f f1 28 89 21 9a 82 bd ea 96 5b 5e 79 a9 6b\ -0d 01 63 ed 9d 57 8e c9 ad a2 0f 2f bc f1 ea 3c\ -40 89 d8 34 19 ba 81 b0 c6 0f 36 06 da 99 -Seed: # not used yet\ -ad 99 7f ee f7 30 d6 ea 7b e6 0d 0d c5 2e 72 ea\ -cb fd d2 75 -Ciphertext: \ -03 01 f9 35 e9 c4 7a bc b4 8a cb be 09 89 5d 9f\ -59 71 af 14 83 9d a4 ff 95 41 7e e4 53 d1 fd 77\ -31 90 72 bb 72 97 e1 b5 5d 75 61 cd 9d 1b b2 4c\ -1a 9a 37 c6 19 86 43 08 24 28 04 87 9d 86 eb d0\ -01 dc e5 18 39 75 e1 50 69 89 b7 0e 5a 83 43 41\ -54 d5 cb fd 6a 24 78 7e 60 eb 0c 65 8d 2a c1 93\ -30 2d 11 92 c6 e6 22 d4 a1 2a d4 b5 39 23 bc a2\ -46 df 31 c6 39 5e 37 70 2c 6a 78 ae 08 1f b9 d0\ -65 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 4.4 -Plaintext: \ -fb 2e f1 12 f5 e7 66 eb 94 01 92 97 93 47 94 f7\ -be 2f 6f c1 c5 8e -Seed: # not used yet\ -13 64 54 df 57 30 f7 3c 80 7a 7e 40 d8 c1 a3 12\ -ac 5b 9d d3 -Ciphertext: \ -02 d1 10 ad 30 af b7 27 be b6 91 dd 0c f1 7d 0a\ -f1 a1 e7 fa 0c c0 40 ec 1a 4b a2 6a 42 c5 9d 0a\ -79 6a 2e 22 c8 f3 57 cc c9 8b 65 19 ac eb 68 2e\ -94 5e 62 cb 73 46 14 a5 29 40 7c d4 52 be e3 e4\ -4f ec e8 42 3c c1 9e 55 54 8b 8b 99 4b 84 9c 7e\ -cd e4 93 3e 76 03 7e 1d 0c e4 42 75 b0 87 10 c6\ -8e 43 01 30 b9 29 73 0e d7 7e 09 b0 15 64 2c 55\ -93 f0 4e 4f fb 94 10 79 81 02 a8 e9 6f fd fe 11\ -e4 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 4.5 -Plaintext: \ -28 cc d4 47 bb 9e 85 16 6d ab b9 e5 b7 d1 ad ad\ -c4 b9 d3 9f 20 4e 96 d5 e4 40 ce 9a d9 28 bc 1c\ -22 84 -Seed: # not used yet\ -bc a8 05 7f 82 4b 2e a2 57 f2 86 14 07 ee f6 3d\ -33 20 86 81 -Ciphertext: \ -00 db b8 a7 43 9d 90 ef d9 19 a3 77 c5 4f ae 8f\ -e1 1e c5 8c 3b 85 83 62 e2 3a d1 b8 a4 43 10 79\ -90 66 b9 93 47 aa 52 56 91 d2 ad c5 8d 9b 06 e3\ -4f 28 8c 17 03 90 c5 f0 e1 1c 0a a3 64 59 59 f1\ -8e e7 9e 8f 2b e8 d7 ac 5c 23 d0 61 f1 8d d7 4b\ -8c 5f 2a 58 fc b5 eb 0c 54 f9 9f 01 a8 32 47 56\ -82 92 53 65 83 34 09 48 d7 a8 c9 7c 4a cd 1e 98\ -d1 e2 9d c3 20 e9 7a 26 05 32 a8 aa 7a 75 8a 1e\ -c2 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 4.6 -Plaintext: \ -f2 22 42 75 1e c6 b1 -Seed: # not used yet\ -2e 7e 1e 17 f6 47 b5 dd d0 33 e1 54 72 f9 0f 68\ -12 f3 ac 4e -Ciphertext: \ -00 a5 ff a4 76 8c 8b be ca ee 2d b7 7e 8f 2e ec\ -99 59 59 33 54 55 20 83 5e 5b a7 db 94 93 d3 e1\ -7c dd ef e6 a5 f5 67 62 44 71 90 8d b4 e2 d8 3a\ -0f be e6 06 08 fc 84 04 95 03 b2 23 4a 07 dc 83\ -b2 7b 22 84 7a d8 92 0f f4 2f 67 4e f7 9b 76 28\ -0b 00 23 3d 2b 51 b8 cb 27 03 a9 d4 2b fb c8 25\ -0c 96 ec 32 c0 51 e5 7f 1b 4b a5 28 db 89 c3 7e\ -4c 54 e2 7e 6e 64 ac 69 63 5a e8 87 d9 54 16 19\ -a9 -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 5: A 1028-bit RSA Key Pair -Modulus: \ -0a ad f3 f9 c1 25 e5 d8 91 f3 1a c4 48 e9 93 de\ -fe 58 0f 80 2b 45 f9 d7 f2 2b a5 02 1e 9c 47 57\ -6b 5a 1e 68 03 1b a9 db 4e 6d ab e4 d9 6a 1d 6f\ -3d 26 72 68 cf f4 08 00 5f 11 8e fc ad b9 98 88\ -d1 c2 34 46 71 66 b2 a2 b8 49 a0 5a 88 9c 06 0a\ -c0 da 0c 5f ae 8b 55 f3 09 ba 62 e7 03 74 2f a0\ -32 6f 2d 10 b0 11 02 14 89 ff 49 77 70 19 0d 89\ -5f d3 9f 52 29 3c 39 ef d7 3a 69 8b da b9 f1 0e\ -d9 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -02 56 eb 4c ba 70 67 f2 d2 be 54 0d cd ff 45 82\ -a3 6b 7d 31 d1 c9 09 9b b2 14 b7 98 48 46 6a 26\ -8f 80 f5 8a 49 ac 04 c0 e3 64 89 34 a0 20 6c 04\ -53 7c 19 b2 36 64 3a 60 82 73 21 44 df 75 fa 21\ -75 88 f7 94 68 2b e8 91 68 27 6d c7 26 c5 c0 cb\ -db 84 d3 1b bf 26 d0 a4 3a f4 95 71 7f 7d 52 8a\ -cf ee 34 15 61 f6 ff 3c ae 05 c5 78 f8 47 0d 96\ -82 f9 c0 d0 72 f9 f6 06 8b 56 d5 88 0f 68 2b e2\ -c5 -Prime1: \ -03 b0 d3 96 2f 6d 17 54 9c bf ca 11 29 43 48 dc\ -f0 e7 e3 9f 8c 2b c6 82 4f 21 64 b6 06 d6 87 86\ -0d ae 1e 63 23 93 cf ed f5 13 22 82 29 06 9e 2f\ -60 e4 ac d7 e6 33 a4 36 06 3f 82 38 5f 48 99 37\ -07 -Prime2: \ -02 e4 c3 2e 2f 51 72 69 b7 07 23 09 f0 0c 0e 31\ -36 5f 7c e2 8b 23 6b 82 91 2d f2 39 ab f3 95 72\ -cf 0e d6 04 b0 29 82 e5 35 64 c5 2d 6a 05 39 7d\ -e5 c0 52 a2 fd dc 14 1e f7 18 98 36 34 6a eb 33\ -1f -ModPrime1PrivateExponent: \ -01 e8 4b 11 9d 25 16 1f a6 7b 00 25 6a 5b d9 b6\ -45 d2 b2 32 ec b0 5b 01 51 80 02 9a 88 62 2a dc\ -3f 09 b3 ae ac de 61 61 ab 7c de 22 c2 ad 26 e7\ -79 7d f5 4e 07 2c bd 3b 26 73 80 0b 3e 43 38 db\ -d5 -ModPrime2PrivateExponent: \ -eb 90 aa 1a 40 13 5b 4c ea 07 19 7c ed c8 81 9b\ -e1 e7 cb ff 25 47 66 21 16 f4 65 a4 a9 f4 87 ab\ -12 f3 ba 4f ef 13 82 22 65 a6 52 97 d9 8b 7b de\ -d9 37 2e 3f fe 81 a3 8b 3e 96 00 fe d0 55 75 4f -MultiplicativeInverseOfPrime2ModPrime1: \ -01 2f 7f 81 38 f9 40 40 62 eb 85 a4 29 24 52 0b\ -38 f5 bb 88 6a 01 96 f4 8b b8 dc ea 60 fd 92 cc\ -02 7f 18 e7 81 58 a3 4a 5c 5d 5f 86 0a 0f 6c 04\ -07 1a 7d 01 31 2c 06 50 62 f1 eb 48 b7 9d 1c 83\ -cb -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 5.1 -Plaintext: \ -af 71 a9 01 e3 a6 1d 31 32 f0 fc 1f db 47 4f 9e\ -a6 57 92 57 ff c2 4d 16 41 70 14 5b 3d bd e8 -Seed: # not used yet\ -44 c9 2e 28 3f 77 b9 49 9c 60 3d 96 36 60 c8 7d\ -2f 93 94 61 -Ciphertext: \ -03 60 46 a4 a4 7d 9e d3 ba 9a 89 13 9c 10 50 38\ -eb 74 92 b0 5a 5d 68 bf d5 3a cc ff 45 97 f7 a6\ -86 51 b4 7b 4a 46 27 d9 27 e4 85 ee d7 b4 56 64\ -20 e8 b4 09 87 9e 5d 60 6e ae 25 1d 22 a5 df 79\ -9f 79 20 bf c1 17 b9 92 57 2a 53 b1 26 31 46 bc\ -ea 03 38 5c c5 e8 53 c9 a1 01 c8 c3 e1 bd a3 1a\ -51 98 07 49 6c 6c b5 e5 ef b4 08 82 3a 35 2b 8f\ -a0 66 1f b6 64 ef ad d5 93 de b9 9f ff 5e d0 00\ -e5 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 5.2 -Plaintext: \ -a3 b8 44 a0 82 39 a8 ac 41 60 5a f1 7a 6c fd a4\ -d3 50 13 65 85 90 3a 41 7a 79 26 87 60 51 9a 4b\ -4a c3 30 3e c7 3f 0f 87 cf b3 23 99 -Seed: # not used yet\ -cb 28 f5 86 06 59 fc ee e4 9c 3e ea fc e6 25 a7\ -08 03 bd 32 -Ciphertext: \ -03 d6 eb 65 4e dc e6 15 bc 59 f4 55 26 5e d4 e5\ -a1 82 23 cb b9 be 4e 40 69 b4 73 80 4d 5d e9 6f\ -54 dc aa a6 03 d0 49 c5 d9 4a a1 47 0d fc d2 25\ -40 66 b7 c7 b6 1f f1 f6 f6 77 0e 32 15 c5 13 99\ -fd 4e 34 ec 50 82 bc 48 f0 89 84 0a d0 43 54 ae\ -66 dc 0f 1b d1 8e 46 1a 33 cc 12 58 b4 43 a2 83\ -7a 6d f2 67 59 aa 23 02 33 49 86 f8 73 80 c9 cc\ -9d 53 be 9f 99 60 5d 2c 9a 97 da 7b 09 15 a4 a7\ -ad -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 5.3 -Plaintext: \ -30 8b 0e cb d2 c7 6c b7 7f c6 f7 0c 5e dd 23 3f\ -d2 f2 09 29 d6 29 f0 26 95 3b b6 2a 8f 4a 3a 31\ -4b de 19 5d e8 5b 5f 81 6d a2 aa b0 74 d2 6c b6\ -ac dd f3 23 ae 3b 9c 67 8a c3 cf 12 fb dd e7 -Seed: # not used yet\ -22 85 f4 0d 77 04 82 f9 a9 ef a2 c7 2c b3 ac 55\ -71 6d c0 ca -Ciphertext: \ -07 70 95 21 81 64 9f 9f 9f 07 ff 62 6f f3 a2 2c\ -35 c4 62 44 3d 90 5d 45 6a 9f d0 bf f4 3c ac 2c\ -a7 a9 f5 54 e9 47 8b 9a cc 3a c8 38 b0 20 40 ff\ -d3 e1 84 7d e2 e4 25 39 29 f9 dd 9e e4 04 43 25\ -a9 b0 5c ab b8 08 b2 ee 84 0d 34 e1 5d 10 5a 3f\ -1f 7b 27 69 5a 1a 07 a2 d7 3f e0 8e ca aa 3c 9c\ -9d 4d 5a 89 ff 89 0d 54 72 7d 7a e4 0c 0e c1 a8\ -dd 86 16 5d 8e e2 c6 36 81 41 01 6a 48 b5 5b 69\ -67 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 5.4 -Plaintext: \ -15 c5 b9 ee 11 85 -Seed: # not used yet\ -49 fa 45 d3 a7 8d d1 0d fd 57 73 99 d1 eb 00 af\ -7e ed 55 13 -Ciphertext: \ -08 12 b7 67 68 eb cb 64 2d 04 02 58 e5 f4 44 1a\ -01 85 21 bd 96 68 7e 6c 5e 89 9f cd 6c 17 58 8f\ -f5 9a 82 cc 8a e0 3a 4b 45 b3 12 99 af 17 88 c3\ -29 f7 dc d2 85 f8 cf 4c ed 82 60 6b 97 61 26 71\ -a4 5b ed ca 13 34 42 14 4d 16 17 d1 14 f8 02 85\ -7f 0f 9d 73 97 51 c5 7a 3f 9e e4 00 91 2c 61 e2\ -e6 99 2b e0 31 a4 3d d4 8f a6 ba 14 ee f7 c4 22\ -b5 ed c4 e7 af a0 4f dd 38 f4 02 d1 c8 bb 71 9a\ -bf -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 5.5 -Plaintext: \ -21 02 6e 68 00 c7 fa 72 8f ca ab a0 d1 96 ae 28\ -d7 a2 ac 4f fd 8a bc e7 94 f0 98 5f 60 c8 a6 73\ -72 77 36 5d 3f ea 11 db 89 23 a2 02 9a -Seed: # not used yet\ -f0 28 74 13 23 4c c5 03 47 24 a0 94 c4 58 6b 87\ -af f1 33 fc -Ciphertext: \ -07 b6 0e 14 ec 95 4b fd 29 e6 0d 00 47 e7 89 f5\ -1d 57 18 6c 63 58 99 03 30 67 93 ce d3 f6 82 41\ -c7 43 52 9a ba 6a 63 74 f9 2e 19 e0 16 3e fa 33\ -69 7e 19 6f 76 61 df aa a4 7a ac 6b de 5e 51 de\ -b5 07 c7 2c 58 9a 2c a1 69 3d 96 b1 46 03 81 24\ -9b 2c db 9e ac 44 76 9f 24 89 c5 d3 d2 f9 9f 0e\ -e3 c7 ee 5b f6 4a 5a c7 9c 42 bd 43 3f 14 9b e8\ -cb 59 54 83 61 64 05 95 51 3c 97 af 7b c2 50 97\ -23 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 5.6 -Plaintext: \ -54 1e 37 b6 8b 6c 88 72 b8 4c 02 -Seed: # not used yet\ -d9 fb a4 5c 96 f2 1e 6e 26 d2 9e b2 cd cb 65 85\ -be 9c b3 41 -Ciphertext: \ -08 c3 6d 4d da 33 42 3b 2e d6 83 0d 85 f6 41 1b\ -a1 dc f4 70 a1 fa e0 eb ef ee 7c 08 9f 25 6c ef\ -74 cb 96 ea 69 c3 8f 60 f3 9a be e4 41 29 bc b4\ -c9 2d e7 f7 97 62 3b 20 07 4e 3d 9c 28 99 70 1e\ -d9 07 1e 1e fa 0b dd 84 d4 c3 e5 13 03 02 d8 f0\ -24 0b ab a4 b8 4a 71 cc 03 2f 22 35 a5 ff 0f ae\ -27 7c 3e 8f 91 12 be f4 4c 9a e2 0d 17 5f c9 a4\ -05 8b fc 93 0b a3 1b 02 e2 e4 f4 44 48 37 10 f2\ -4a -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 6: A 1029-bit RSA Key Pair -Modulus: \ -12 b1 7f 6d ad 2e cd 19 ff 46 dc 13 f7 86 0f 09\ -e0 e0 cf b6 77 b3 8a 52 59 23 05 ce af 02 2c 16\ -6d b9 0d 04 ac 29 e3 3f 7d d1 2d 9f af 66 e0 81\ -6b b6 3e ad 26 7c c7 d4 6c 17 c3 7b e2 14 bc a2\ -a2 2d 72 3a 64 e4 44 07 43 6b 6f c9 65 72 9a ef\ -c2 55 4f 37 6c d5 dc ea 68 29 37 80 a6 2b f3 9d\ -00 29 48 5a 16 0b bb 9e 5d c0 97 2d 21 a5 04 f5\ -2e 5e e0 28 aa 41 63 32 f5 10 b2 e9 cf f5 f7 22\ -af -PublicExponent: \ -01 00 01 -PrivateExponent: \ -02 95 ec a3 56 06 18 36 95 59 ce cd 30 3a a9 cf\ -da fc 1d 9f 06 95 9d f7 5f fe f9 29 aa 89 69 61\ -bc d1 90 dc 69 97 ed a7 f5 96 3e 72 4d 07 b4 dc\ -11 f3 06 5e 5a e9 7d 96 83 51 12 28 0b 90 84 bb\ -14 f2 a2 1e bd 4e 88 9d 41 b9 c4 13 2e c1 95 6f\ -ca b8 bb 2f ed 05 75 88 49 36 52 2c 5f f7 d3 32\ -61 90 48 24 e7 ca de e4 e0 bb 37 2d 24 57 cf 78\ -e2 bd 12 86 22 8f f8 3f 10 73 1c e6 3c 90 cf f3\ -f9 -Prime1: \ -04 a6 ce 8b 73 58 df a6 9b dc f7 42 61 70 05 af\ -b5 38 5f 5f 3a 58 a2 4e f7 4a 22 a8 c0 5c b7 cc\ -38 eb d4 cc 9d 9a 9d 78 9a 62 cd 0f 60 f0 cb 94\ -1d 34 23 c9 69 2e fa 4f e3 ad ff 29 0c 47 49 a3\ -8b -Prime2: \ -04 04 c9 a8 03 37 1f ed b4 c5 be 39 f3 c0 0b 00\ -9e 5e 08 a6 3b e1 e4 00 35 cd ac a5 01 1c c7 01\ -cf 7e eb cb 99 f0 ff e1 7c fd 0a 4b f7 be fd 2d\ -d5 36 ac 94 6d b7 97 fd bc 4a be 8f 29 34 9b 91\ -ed -ModPrime1PrivateExponent: \ -03 96 1c 8f 76 0a a2 bd 51 54 c7 aa fd 77 22 5b\ -3b ac d0 13 9a e7 b5 94 8e a3 31 1f cc d8 6f b9\ -5c 75 af a7 67 28 4b 9b 2d e5 59 57 2f 15 d8 d0\ -44 c7 eb 83 a1 be 5f ad f2 cc 37 7c 0d 84 75 29\ -4b -ModPrime2PrivateExponent: \ -02 21 97 e0 66 74 21 96 aa bc 03 fa 2f ee b4 e7\ -0b 15 cb 78 7d 61 7a cd 31 bb 75 c7 bc 23 4a d7\ -06 f7 c4 8d 21 82 d1 f0 ff 9c 22 8d cf 41 96 7b\ -6c 0b a6 d2 c0 ad 11 0a 1b 85 78 31 ec 24 5e 2c\ -b1 -MultiplicativeInverseOfPrime2ModPrime1: \ -04 01 c4 c0 c5 3d 45 db db 5e 9d 96 d0 fe cf 42\ -75 df 09 74 bc 4a 07 36 b4 a7 4c 32 69 05 3e fb\ -68 6a ce 24 06 e2 2c 9e 05 8d db 4a e5 40 62 7a\ -e2 fd b0 82 61 e8 e7 e4 bc bc 99 4d aa fa 30 5c\ -45 -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 6.1 -Plaintext: \ -40 46 ca 8b aa 33 47 ca 27 f4 9e 0d 81 f9 cc 1d\ -71 be 9b a5 17 d4 -Seed: # not used yet\ -dd 0f 6c fe 41 5e 88 e5 a4 69 a5 1f bb a6 df d4\ -0a db 43 84 -Ciphertext: \ -06 30 ee bc d2 85 6c 24 f7 98 80 6e 41 f9 e6 73\ -45 ed a9 ce da 38 6a cc 9f ac ae a1 ee ed 06 ac\ -e5 83 70 97 18 d9 d1 69 fa df 41 4d 5c 76 f9 29\ -96 83 3e f3 05 b7 5b 1e 4b 95 f6 62 a2 0f ae dc\ -3b ae 0c 48 27 a8 bf 8a 88 ed bd 57 ec 20 3a 27\ -a8 41 f0 2e 43 a6 15 ba b1 a8 ca c0 70 1d e3 4d\ -eb de f6 2a 08 80 89 b5 5e c3 6e a7 52 2f d3 ec\ -8d 06 b6 a0 73 e6 df 83 31 53 bc 0a ef d9 3b d1\ -a3 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 6.2 -Plaintext: \ -5c c7 2c 60 23 1d f0 3b 3d 40 f9 b5 79 31 bc 31\ -10 9f 97 25 27 f2 8b 19 e7 48 0c 72 88 cb 3c 92\ -b2 25 12 21 4e 4b e6 c9 14 79 2d da bd f5 7f aa\ -8a a7 -Seed: # not used yet\ -8d 14 bd 94 6a 13 51 14 8f 5c ae 2e d9 a0 c6 53\ -e8 5e bd 85 -Ciphertext: \ -0e bc 37 37 61 73 a4 fd 2f 89 cc 55 c2 ca 62 b2\ -6b 11 d5 1c 3c 7c e4 9e 88 45 f7 4e 76 07 31 7c\ -43 6b c8 d2 3b 96 67 df eb 9d 08 72 34 b4 7b c6\ -83 71 75 ae 5c 05 59 f6 b8 1d 7d 22 41 6d 3e 50\ -f4 ac 53 3d 8f 08 12 f2 db 9e 79 1f e9 c7 75 ac\ -8b 6a d0 f5 35 ad 9c eb 23 a4 a0 20 14 c5 8a b3\ -f8 d3 16 14 99 a2 60 f3 93 48 e7 14 ae 2a 1d 34\ -43 20 8f d8 b7 22 cc fd fb 39 3e 98 01 1f 99 e6\ -3f -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 6.3 -Plaintext: \ -b2 0e 65 13 03 09 2f 4b cc b4 30 70 c0 f8 6d 23\ -04 93 62 ed 96 64 2f c5 63 2c 27 db 4a 52 e3 d8\ -31 f2 ab 06 8b 23 b1 49 87 9c 00 2f 6b f3 fe ee\ -97 59 11 12 56 2c -Seed: # not used yet\ -6c 07 5b c4 55 20 f1 65 c0 bf 5e a4 c5 df 19 1b\ -c9 ef 0e 44 -Ciphertext: \ -0a 98 bf 10 93 61 93 94 43 6c f6 8d 8f 38 e2 f1\ -58 fd e8 ea 54 f3 43 5f 23 9b 8d 06 b8 32 18 44\ -20 24 76 ae ed 96 00 94 92 48 0c e3 a8 d7 05 49\ -8c 4c 8c 68 f0 15 01 dc 81 db 60 8f 60 08 73 50\ -c8 c3 b0 bd 2e 9e f6 a8 14 58 b7 c8 01 b8 9f 2e\ -4f e9 9d 49 00 ba 6a 4b 5e 5a 96 d8 65 dc 67 6c\ -77 55 92 87 94 13 0d 62 80 a8 16 0a 19 0f 2d f3\ -ea 7c f9 aa 02 71 d8 8e 9e 69 05 ec f1 c5 15 2d\ -65 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 6.4 -Plaintext: \ -68 4e 30 38 c5 c0 41 f7 -Seed: # not used yet\ -3b bc 3b d6 63 7d fe 12 84 69 01 02 9b f5 b0 c0\ -71 03 43 9c -Ciphertext: \ -00 8e 7a 67 ca cf b5 c4 e2 4b ec 7d ee 14 91 17\ -f1 95 98 ce 8c 45 80 8f ef 88 c6 08 ff 9c d6 e6\ -95 26 3b 9a 3c 0a d4 b8 ba 4c 95 23 8e 96 a8 42\ -2b 85 35 62 9c 8d 53 82 37 44 79 ad 13 fa 39 97\ -4b 24 2f 9a 75 9e ea f9 c8 3a d5 a8 ca 18 94 0a\ -01 62 ba 75 58 76 df 26 3f 4b d5 0c 65 25 c5 60\ -90 26 7c 1f 0e 09 ce 08 99 a0 cf 35 9e 88 12 0a\ -bd 9b f8 93 44 5b 3c ae 77 d3 60 73 59 ae 9a 52\ -f8 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 6.5 -Plaintext: \ -32 48 8c b2 62 d0 41 d6 e4 dd 35 f9 87 bf 3c a6\ -96 db 1f 06 ac 29 a4 46 93 -Seed: # not used yet\ -b4 6b 41 89 3e 8b ef 32 6f 67 59 38 3a 83 07 1d\ -ae 7f ca bc -Ciphertext: \ -00 00 34 74 41 6c 7b 68 bd f9 61 c3 85 73 79 44\ -d7 f1 f4 0c b3 95 34 3c 69 3c c0 b4 fe 63 b3 1f\ -ed f1 ea ee ac 9c cc 06 78 b3 1d c3 2e 09 77 48\ -95 14 c4 f0 90 85 f6 29 8a 96 53 f0 1a ea 40 45\ -ff 58 2e e8 87 be 26 ae 57 5b 73 ee f7 f3 77 49\ -21 e3 75 a3 d1 9a dd a0 ca 31 aa 18 49 88 7c 1f\ -42 ca c9 67 7f 7a 2f 4e 92 3f 6e 5a 86 8b 38 c0\ -84 ef 18 75 94 dc 9f 7f 04 8f ea 2e 02 95 53 84\ -ab -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 6.6 -Plaintext: \ -50 ba 14 be 84 62 72 02 79 c3 06 ba -Seed: # not used yet\ -0a 24 03 31 2a 41 e3 d5 2f 06 0f bc 13 a6 7d e5\ -cf 76 09 a7 -Ciphertext: \ -0a 02 6d da 5f c8 78 5f 7b d9 bf 75 32 7b 63 e8\ -5e 2c 0f de e5 da db 65 eb dc ac 9a e1 de 95 c9\ -2c 67 2a b4 33 aa 7a 8e 69 ce 6a 6d 88 97 fa c4\ -ac 4a 54 de 84 1a e5 e5 bb ce 76 87 87 9d 79 63\ -4c ea 7a 30 68 40 65 c7 14 d5 24 09 b9 28 25 6b\ -bf 53 ea bc d5 23 1e b7 25 95 04 53 73 99 bd 29\ -16 4b 72 6d 33 a4 6d a7 01 36 0a 41 68 a0 91 cc\ -ab 72 d4 4a 62 fe d2 46 c0 ff ea 5b 13 48 ab 54\ -70 -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 7: A 1030-bit RSA Key Pair -Modulus: \ -31 11 79 f0 bc fc 9b 9d 3c a3 15 d0 0e f3 0d 7b\ -dd 3a 2c fa e9 91 1b fe dc b9 48 b3 a4 78 2d 07\ -32 b6 ab 44 aa 4b f0 37 41 a6 44 dc 01 be c3 e6\ -9b 01 a0 33 e6 75 d8 ac d7 c4 92 5c 6b 1a ec 31\ -19 05 1d fd 89 76 2d 21 5d 45 47 5f fc b5 9f 90\ -81 48 62 3f 37 17 71 56 f6 ae 86 dd 7a 7c 5f 43\ -dc 1e 1f 90 82 54 05 8a 28 4a 5f 06 c0 02 17 93\ -a8 7f 1a c5 fe ff 7d ca ee 69 c5 e5 1a 37 89 e3\ -73 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -07 0c fc ff 2f eb 82 76 e2 74 32 c4 5d fe e4 8f\ -49 b7 91 7d 65 30 e1 f0 ca 34 60 f3 2e 02 76 17\ -44 87 c5 6e 22 a4 5d 25 00 d7 77 54 95 21 9d 7d\ -16 5a 9c f3 bd 92 c3 2a f9 a9 8d 8d c9 cc 29 68\ -00 ad c9 4a 0a 54 fb 40 f3 42 91 bf 84 ee 8e a1\ -2b 6f 10 93 59 c6 d3 54 2a 50 f9 c7 67 f5 cf ff\ -05 a6 81 c2 e6 56 fb 77 ca aa db 4b e9 46 8d 8a\ -bc d4 df 98 f5 8e 86 d2 05 3f a1 34 9f 74 8e 21\ -b1 -Prime1: \ -07 49 26 2c 11 1c d4 70 ec 25 66 e6 b3 73 2f c0\ -93 29 46 9a a1 90 71 d3 b9 c0 19 06 51 4c 6f 1d\ -26 ba a1 4b ea b0 97 1c 8b 7e 61 1a 4f 79 00 9d\ -6f ea 77 69 28 ca 25 28 5b 0d e3 64 3d 1a 3f 8c\ -71 -Prime2: \ -06 bc 1e 50 e9 6c 02 bf 63 6e 9e ea 8b 89 9b be\ -bf 76 51 de 77 dd 47 4c 3e 9b c2 3b ad 81 82 b6\ -19 04 c7 d9 7d fb eb fb 1e 00 10 88 78 b6 e6 7e\ -41 53 91 d6 79 42 c2 b2 bf 9b 44 35 f8 8b 0c b0\ -23 -ModPrime1PrivateExponent: \ -03 bc 7e a7 f0 aa b1 43 ab c6 ce 8b 97 11 86 36\ -a3 01 72 e4 cf e0 2c 8f a0 dd a3 b7 ba af 90 f8\ -09 29 82 98 55 25 f4 88 bd fc b4 bd 72 6e 22 63\ -9a c6 4a 30 92 ab 7f fc bf 1d 53 34 cf a5 0b 5b\ -f1 -ModPrime2PrivateExponent: \ -02 62 a6 aa 29 c2 a3 c6 7d c5 34 6c 06 38 1a fd\ -98 7a a3 cc 93 cf bf ec f5 4f dd 9f 9d 78 7d 7f\ -59 a5 23 d3 98 97 9d a1 37 a2 f6 38 1f e9 48 01\ -f7 c9 4d a2 15 18 dc 34 cb 40 87 0c 46 97 99 4a\ -d9 -MultiplicativeInverseOfPrime2ModPrime1: \ -64 9d 4c 17 b6 ee 17 21 e7 72 d0 38 9a 55 9c 3d\ -3c df 95 50 d4 57 c4 6b 03 7b 74 64 1b 1d 52 16\ -6a f8 a2 13 c8 39 62 06 cd fb a4 42 2f 18 d6 f6\ -1d bc b5 d2 14 c9 71 bf 48 2a eb 97 6a 73 70 c2 -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 7.1 -Plaintext: \ -47 aa e9 09 -Seed: # not used yet\ -43 dd 09 a0 7f f4 ca c7 1c aa 46 32 ee 5e 1c 1d\ -ae e4 cd 8f -Ciphertext: \ -16 88 e4 ce 77 94 bb a6 cb 70 14 16 9e cd 55 9c\ -ed e2 a3 0b 56 a5 2b 68 d9 fe 18 cf 19 73 ef 97\ -b2 a0 31 53 95 1c 75 5f 62 94 aa 49 ad bd b5 58\ -45 ab 68 75 fb 39 86 c9 3e cf 92 79 62 84 0d 28\ -2f 9e 54 ce 8b 69 0f 7c 0c b8 bb d7 34 40 d9 57\ -1d 1b 16 cd 92 60 f9 ea b4 78 3c c4 82 e5 22 3d\ -c6 09 73 87 17 83 ec 27 b0 ae 0f d4 77 32 cb c2\ -86 a1 73 fc 92 b0 0f b4 ba 68 24 64 7c d9 3c 85\ -c1 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 7.2 -Plaintext: \ -1d 9b 2e 22 23 d9 bc 13 bf b9 f1 62 ce 73 5d b4\ -8b a7 c6 8f 68 22 a0 a1 a7 b6 ae 16 58 34 e7 -Seed: # not used yet\ -3a 9c 3c ec 7b 84 f9 bd 3a de cb c6 73 ec 99 d5\ -4b 22 bc 9b -Ciphertext: \ -10 52 ed 39 7b 2e 01 e1 d0 ee 1c 50 bf 24 36 3f\ -95 e5 04 f4 a0 34 34 a0 8f d8 22 57 4e d6 b9 73\ -6e db b5 f3 90 db 10 32 14 79 a8 a1 39 35 0e 2b\ -d4 97 7c 37 78 ef 33 1f 3e 78 ae 11 8b 26 84 51\ -f2 0a 2f 01 d4 71 f5 d5 3c 56 69 37 17 1b 2d bc\ -2d 4b de 45 9a 57 99 f0 37 2d 65 74 23 9b 23 23\ -d2 45 d0 bb 81 c2 86 b6 3c 89 a3 61 01 73 37 e4\ -90 2f 88 a4 67 f4 c7 f2 44 bf d5 ab 46 43 7f f3\ -b6 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 7.3 -Plaintext: \ -d9 76 fc -Seed: # not used yet\ -76 a7 5e 5b 61 57 a5 56 cf 88 84 bb 2e 45 c2 93\ -dd 54 5c f5 -Ciphertext: \ -21 55 cd 84 3f f2 4a 4e e8 ba db 76 94 26 00 28\ -a4 90 81 3b a8 b3 69 a4 cb f1 06 ec 14 8e 52 98\ -70 7f 59 65 be 7d 10 1c 10 49 ea 85 84 c2 4c d6\ -34 55 ad 9c 10 4d 68 62 82 d3 fb 80 3a 4c 11 c1\ -c2 e9 b9 1c 71 78 80 1d 1b 66 40 f0 03 f5 72 8d\ -f0 07 b8 a4 cc c9 2b ce 05 e4 1a 27 27 8d 7c 85\ -01 8c 52 41 43 13 a5 07 77 89 00 1d 4f 01 91 0b\ -72 aa d0 5d 22 0a a1 4a 58 73 3a 74 89 bc 54 55\ -6b -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 7.4 -Plaintext: \ -d4 73 86 23 df 22 3a a4 38 43 df 84 67 53 4c 41\ -d0 13 e0 c8 03 c6 24 e2 63 66 6b 23 9b de 40 a5\ -f2 9a eb 8d e7 9e 3d aa 61 dd 03 70 f4 9b d4 b0\ -13 83 4b 98 21 2a ef 6b 1c 5e e3 73 b3 cb -Seed: # not used yet\ -78 66 31 4a 6a d6 f2 b2 50 a3 59 41 db 28 f5 86\ -4b 58 58 59 -Ciphertext: \ -0a b1 4c 37 3a eb 7d 43 28 d0 aa ad 8c 09 4d 88\ -b9 eb 09 8b 95 f2 10 54 a2 90 82 52 2b e7 c2 7a\ -31 28 78 b6 37 91 7e 3d 81 9e 6c 3c 56 8d b5 d8\ -43 80 2b 06 d5 1d 9e 98 a2 be 0b f4 0c 03 14 23\ -b0 0e df bf f8 32 0e fb 91 71 bd 20 44 65 3a 4c\ -b9 c5 12 2f 6c 65 e8 3c da 2e c3 c1 26 02 7a 9c\ -1a 56 ba 87 4d 0f ea 23 f3 80 b8 2c f2 40 b8 cf\ -54 00 04 75 8c 4c 77 d9 34 15 7a 74 f3 fc 12 bf\ -ac -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 7.5 -Plaintext: \ -bb 47 23 1c a5 ea 1d 3a d4 6c 99 34 5d 9a 8a 61 -Seed: # not used yet\ -b2 16 6e d4 72 d5 8d b1 0c ab 2c 6b 00 0c cc f1\ -0a 7d c5 09 -Ciphertext: \ -02 83 87 a3 18 27 74 34 79 8b 4d 97 f4 60 06 8d\ -f5 29 8f ab a5 04 1b a1 17 61 a1 cb 73 16 b2 41\ -84 11 4e c5 00 25 7e 25 89 ed 3b 60 7a 1e bb e9\ -7a 6c c2 e0 2b f1 b6 81 f4 23 12 a3 3b 7a 77 d8\ -e7 85 5c 4a 6d e0 3e 3c 04 64 3f 78 6b 91 a2 64\ -a0 d6 80 5e 2c ea 91 e6 81 77 eb 7a 64 d9 25 5e\ -4f 27 e7 13 b7 cc ec 00 dc 20 0e bd 21 c2 ea 2b\ -b8 90 fe ae 49 42 df 94 1d c3 f9 78 90 ed 34 74\ -78 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 7.6 -Plaintext: \ -21 84 82 70 95 d3 5c 3f 86 f6 00 e8 e5 97 54 01\ -32 96 -Seed: # not used yet\ -52 67 3b de 2c a1 66 c2 aa 46 13 1a c1 dc 80 8d\ -67 d7 d3 b1 -Ciphertext: \ -14 c6 78 a9 4a d6 05 25 ef 39 e9 59 b2 f3 ba 5c\ -09 7a 94 ff 91 2b 67 db ac e8 05 35 c1 87 ab d4\ -7d 07 54 20 b1 87 21 52 bb a0 8f 7f c3 1f 31 3b\ -bf 92 73 c9 12 fc 4c 01 49 a9 b0 cf b7 98 07 e3\ -46 eb 33 20 69 61 1b ec 0f f9 bc d1 68 f1 f7 c3\ -3e 77 31 3c ea 45 4b 94 e2 54 9e ec f0 02 e2 ac\ -f7 f6 f2 d2 84 5d 4f e0 aa b2 e5 a9 2d df 68 c4\ -80 ae 11 24 79 35 d1 f6 25 74 84 22 16 ae 67 41\ -15 -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 8: A 1031-bit RSA Key Pair -Modulus: \ -5b df 0e 30 d3 21 dd a5 14 7f 88 24 08 fa 69 19\ -54 80 df 8f 80 d3 f6 e8 bf 58 18 50 4f 36 42 7c\ -a9 b1 f5 54 0b 9c 65 a8 f6 97 4c f8 44 7a 24 4d\ -92 80 20 1b b4 9f cb be 63 78 d1 94 4c d2 27 e2\ -30 f9 6e 3d 10 f8 19 dc ef 27 6c 64 a0 0b 2a 4b\ -67 01 e7 d0 1d e5 fa bd e3 b1 e9 a0 df 82 f4 63\ -13 59 cd 22 66 96 47 fb b1 71 72 46 13 4e d7 b4\ -97 cf ff bd c4 2b 59 c7 3a 96 ed 90 16 62 12 df\ -f7 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -0f 7d 1e 9e 5a aa 25 fd 13 e4 a0 66 3a e1 44 e0\ -d1 5f 5c d1 8b cd b0 9d f2 cc 7e 64 e3 c5 e9 15\ -ad 62 64 53 04 16 1d 09 8c 71 5b b7 ab 8b d0 1d\ -07 ea f3 fe d7 c7 ed 08 af 2a 8a 62 ef 44 ab 16\ -b3 20 e1 4a f7 2a 48 f9 6a fe 26 2a 0a e4 cf 65\ -e6 35 e9 10 79 0c d4 ee 5c ea 76 8a 4b 26 39 f7\ -e6 f6 77 b3 f0 bb 6b e3 2b 75 74 7d 89 09 03 6f\ -02 64 f5 8d 40 1c db a1 31 71 61 57 a7 5e cf 63\ -31 -Prime1: \ -0a 02 ef 84 48 d9 fa d8 bb d0 d0 04 c8 c2 aa 97\ -51 ef 97 21 c1 b0 d0 32 36 a5 4b 0d f9 47 cb ae\ -d5 a2 55 ee 9e 8e 20 d4 91 ea 17 23 fe 09 47 04\ -a9 76 2e 88 af d1 6e bb 59 94 41 2c a9 66 dc 4f\ -9f -Prime2: \ -09 2d 36 2e 7e d3 a0 bf d9 e9 fd 0e 6c 03 01 b6\ -df 29 15 9c f5 0c c8 3b 9b 0c f4 d6 ee a7 1a 61\ -e0 02 b4 6e 0a e9 f2 de 62 d2 5b 5d 74 52 d4 98\ -b8 1c 9a c6 fc 58 59 3d 4c 3f b4 f5 d7 2d fb b0\ -a9 -ModPrime1PrivateExponent: \ -07 c7 14 10 af 10 39 62 db 36 74 04 e3 7a e8 50\ -ba a4 e9 c2 9d d9 21 45 81 52 94 a6 7c 7d 1c 6d\ -ed 26 3a a0 30 a9 b6 33 ae 50 30 3e 14 03 5d 1a\ -f0 14 12 3e ba 68 78 20 30 8d 8e bc 85 b6 95 7d\ -7d -ModPrime2PrivateExponent: \ -ae 2c 75 38 0c 02 c0 16 ad 05 89 1b 33 01 de 88\ -1f 28 ae 11 71 18 2b 6b 2c 83 be a7 c5 15 ec a9\ -ca 29 8c 7b 1c ab 58 17 a5 97 06 8f c8 50 60 de\ -4d a8 a0 16 37 8a ae 43 c7 f9 67 bc c3 79 04 b9 -MultiplicativeInverseOfPrime2ModPrime1: \ -05 98 d1 05 9e 3a da 4f 63 20 75 2c 09 d8 05 ff\ -7d 1f 1a e0 d0 17 ae ee e9 ce fa 0d 7d d7 ff 77\ -5e 44 b5 78 32 2f 64 05 d6 21 1d a1 95 19 66 6a\ -a8 7f dc 4c d8 c8 8f 6b 6e 3d 67 e9 61 dc bb a3\ -d0 -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 8.1 -Plaintext: \ -05 0b 75 5e 5e 68 80 f7 b9 e9 d6 92 a7 4c 37 aa\ -e4 49 b3 1b fe a6 de ff 83 74 7a 89 7f 6c 2c 82\ -5b b1 ad bf 85 0a 3c 96 99 4b 5d e5 b3 3c bc 7d\ -4a 17 91 3a 79 67 -Seed: # not used yet\ -77 06 ff ca 1e cf b1 eb ee 2a 55 e5 c6 e2 4c d2\ -79 7a 41 25 -Ciphertext: \ -09 b3 68 3d 8a 2e b0 fb 29 5b 62 ed 1f b9 29 0b\ -71 44 57 b7 82 53 19 f4 64 78 72 af 88 9b 30 40\ -94 72 02 0a d1 29 12 bf 19 b1 1d 48 19 f4 96 14\ -82 4f fd 84 d0 9c 0a 17 e7 d1 73 09 d1 29 19 79\ -04 10 aa 29 95 69 9f 6a 86 db e3 24 2b 5a cc 23\ -af 45 69 10 80 d6 b1 ae 81 0f b3 e3 05 70 87 f0\ -97 00 92 ce 00 be 95 62 ff 40 53 b6 26 2c e0 ca\ -a9 3e 13 72 3d 2e 3a 5b a0 75 d4 5f 0d 61 b5 4b\ -61 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 8.2 -Plaintext: \ -4e b6 8d cd 93 ca 9b 19 df 11 1b d4 36 08 f5 57\ -02 6f e4 aa 1d 5c fa c2 27 a3 eb 5a b9 54 8c 18\ -a0 6d de d2 3f 81 82 59 86 b2 fc d7 11 09 ec ef\ -7e ff 88 87 3f 07 5c 2a a0 c4 69 f6 9c 92 bc -Seed: # not used yet\ -a3 71 7d a1 43 b4 dc ff bc 74 26 65 a8 fa 95 05\ -85 54 83 43 -Ciphertext: \ -2e cf 15 c9 7c 5a 15 b1 47 6a e9 86 b3 71 b5 7a\ -24 28 4f 4a 16 2a 8d 0c 81 82 e7 90 5e 79 22 56\ -f1 81 2b a5 f8 3f 1f 7a 13 0e 42 dc c0 22 32 84\ -4e dc 14 a3 1a 68 ee 97 ae 56 4a 38 3a 34 11 65\ -64 24 c5 f6 2d db 64 60 93 c3 67 be 1f cd a4 26\ -cf 00 a0 6d 8a cb 7e 57 77 6f bb d8 55 ac 3d f5\ -06 fc 16 b1 d7 c3 f2 11 0f 3d 80 68 e9 1e 18 63\ -63 83 1c 84 09 68 0d 8d a9 ec d8 cf 1f a2 0e e3\ -9d -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 8.3 -Plaintext: \ -86 04 ac 56 32 8c 1a b5 ad 91 78 61 -Seed: # not used yet\ -ee 06 20 90 73 cc a0 26 bb 26 4e 51 85 bf 8c 68\ -b7 73 9f 86 -Ciphertext: \ -4b c8 91 30 a5 b2 da bb 7c 2f cf 90 eb 5d 0e af\ -9e 68 1b 71 46 a3 8f 31 73 a3 d9 cf ec 52 ea 9e\ -0a 41 93 2e 64 8a 9d 69 34 4c 50 da 76 3f 51 a0\ -3c 95 76 21 31 e8 05 22 54 dc d2 24 8c ba 40 fd\ -31 66 77 86 ce 05 a2 b7 b5 31 ac 9d ac 9e d5 84\ -a5 9b 67 7c 1a 8a ed 8c 5d 15 d6 8c 05 56 9e 2b\ -e7 80 bf 7d b6 38 fd 2b fd 2a 85 ab 27 68 60 f3\ -77 73 38 fc a9 89 ff d7 43 d1 3e e0 8e 0c a9 89\ -3f -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 8.4 -Plaintext: \ -fd da 5f bf 6e c3 61 a9 d9 a4 ac 68 af 21 6a 06\ -86 f4 38 b1 e0 e5 c3 6b 95 5f 74 e1 07 f3 9c 0d\ -dd cc -Seed: # not used yet\ -99 0a d5 73 dc 48 a9 73 23 5b 6d 82 54 36 18 f2\ -e9 55 10 5d -Ciphertext: \ -2e 45 68 47 d8 fc 36 ff 01 47 d6 99 35 94 b9 39\ -72 27 d5 77 75 2c 79 d0 f9 04 fc b0 39 d4 d8 12\ -fe a6 05 a7 b5 74 dd 82 ca 78 6f 93 75 23 48 43\ -8e e9 f5 b5 45 49 85 d5 f0 e1 69 9e 3e 7a d1 75\ -a3 2e 15 f0 3d eb 04 2a b9 fe 1d d9 db 1b b8 6f\ -8c 08 9c cb 45 e7 ef 0c 5e e7 ca 9b 72 90 ca 6b\ -15 be d4 70 39 78 8a 8a 93 ff 83 e0 e8 d6 24 4c\ -71 00 63 62 de ef 69 b6 f4 16 fb 3c 68 43 83 fb\ -d0 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 8.5 -Plaintext: \ -4a 5f 49 14 be e2 5d e3 c6 93 41 de 07 -Seed: # not used yet\ -ec c6 3b 28 f0 75 6f 22 f5 2a c8 e6 ec 12 51 a6\ -ec 30 47 18 -Ciphertext: \ -1f b9 35 6f d5 c4 b1 79 6d b2 eb f7 d0 d3 93 cc\ -81 0a df 61 45 de fc 2f ce 71 4f 79 d9 38 00 d5\ -e2 ac 21 1e a8 bb ec ca 4b 65 4b 94 c3 b1 8b 30\ -dd 57 6c e3 4d c9 54 36 ef 57 a0 94 15 64 59 23\ -35 9a 5d 7b 41 71 ef 22 c2 46 70 f1 b2 29 d3 60\ -3e 91 f7 66 71 b7 df 97 e7 31 7c 97 73 44 76 d5\ -f3 d1 7d 21 cf 82 b5 ba 9f 83 df 2e 58 8d 36 98\ -4f d1 b5 84 46 8b d2 3b 2e 87 5f 32 f6 89 53 f7\ -b2 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 8.6 -Plaintext: \ -8e 07 d6 6f 7b 88 0a 72 56 3a bc d3 f3 50 92 bc\ -33 40 9f b7 f8 8f 24 72 be -Seed: # not used yet\ -39 25 c7 1b 36 2d 40 a0 a6 de 42 14 55 79 ba 1e\ -7d d4 59 fc -Ciphertext: \ -3a fd 9c 66 00 14 7b 21 79 8d 81 8c 65 5a 0f 4c\ -92 12 db 26 d0 b0 df dc 2a 75 94 cc b3 d2 2f 5b\ -f1 d7 c3 e1 12 cd 73 fc 7d 50 9c 7a 8b af dd 3c\ -27 4d 13 99 00 9f 96 09 ec 4b e6 47 7e 45 3f 07\ -5a a3 3d b3 82 87 0c 1c 34 09 ae f3 92 d7 38 6a\ -e3 a6 96 b9 9a 94 b4 da 05 89 44 7e 95 5d 16 c9\ -8b 17 60 2a 59 bd 73 62 79 fc d8 fb 28 0c 44 62\ -d5 90 bf a9 bf 13 fe d5 70 ea fd e9 73 30 a2 c2\ -10 -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 9: A 1536-bit RSA Key Pair -Modulus: \ -cf 2c d4 1e 34 ca 3a 72 8e a5 cb 8a ff 64 c3 6d\ -27 bd ef 53 64 e3 36 fd 68 d3 12 3c 5a 19 6a 8c\ -28 70 13 e8 53 d5 15 6d 58 d1 51 95 45 20 fb 4f\ -6d 7b 17 ab b6 81 77 65 90 9c 57 61 19 65 9d 90\ -2b 19 06 ed 8a 2b 10 c1 55 c2 4d 12 45 28 da b9\ -ee ae 37 9b ea c6 6e 4a 41 17 86 dc b8 fd 00 62\ -eb c0 30 de 12 19 a0 4c 2a 8c 1b 7d d3 13 1e 4d\ -6b 6c ae e2 e3 1a 5e d4 1a c1 50 9b 2e f1 ee 2a\ -b1 83 64 be 56 8c a9 41 c2 5e cc 84 ff 9d 64 3b\ -5e c1 aa ae 10 2a 20 d7 3f 47 9b 78 0f d6 da 91\ -07 52 12 d9 ea c0 3a 06 74 d8 99 eb a2 e4 31 f4\ -c4 4b 61 5b 6b a2 23 2b d4 b3 3b ae d7 3d 62 5d -PublicExponent: \ -01 00 01 -PrivateExponent: \ -19 8c 14 1e 23 71 5a 92 bc cf 6a 11 9a 5b c1 13\ -89 46 8d 28 11 f5 48 d7 27 e1 7b 4a b0 eb 98 6d\ -6f 21 1e fb 53 b7 1f 7c cb ea 87 ee 69 c7 5e e6\ -15 00 8c 53 32 de b5 2b f3 90 ab df bf e3 7d 72\ -05 36 81 59 b2 63 8c 1d e3 26 e2 1d 22 25 1f 0f\ -b5 84 8b 3b f1 50 05 d2 a7 43 30 f0 af e9 16 ee\ -62 cc c1 34 4d 1d 83 a7 09 e6 06 76 27 38 40 f7\ -f3 77 42 4a 5e 0a 4d a7 5f 01 b3 1f f7 68 19 cf\ -9c bf dd 21 52 43 c3 91 7c 03 ef 38 19 93 12 e5\ -67 b3 bf 7a ed 3a b4 57 f3 71 ef 8a 14 23 f4 5b\ -68 c6 e2 82 ec 11 1b ba 28 33 b9 87 fd 69 fa d8\ -3b c1 b8 c6 13 c5 e1 ea 16 c1 1e d1 25 ea 7e c1 -Prime1: \ -fc 8d 6c 04 be c4 eb 9a 81 92 ca 79 00 cb e5 36\ -e2 e8 b5 19 de cf 33 b2 45 97 98 c6 90 9d f4 f1\ -76 db 7d 23 19 0f c7 2b 88 65 a7 18 af 89 5f 1b\ -cd 91 45 29 80 27 42 3b 60 5e 70 a4 7c f5 83 90\ -a8 c3 e8 8f c8 c4 8e 8b 32 e3 da 21 0d fb e3 e8\ -81 ea 56 74 b6 a3 48 c2 1e 93 f9 e5 5e a6 5e fd -Prime2: \ -d2 00 d4 5e 78 8a ac ea 60 6a 40 1d 04 60 f8 7d\ -d5 c1 02 7e 12 dc 1a 0d 75 86 e8 93 9d 9c f7 89\ -b4 0f 51 ac 04 42 96 1d e7 d2 1c c2 1e 05 c8 31\ -55 c1 f2 aa 91 93 38 7c fd f9 56 cb 48 d1 53 ba\ -27 04 06 f9 bb ba 53 7d 49 87 d9 e2 f9 94 2d 7a\ -14 cb ff fe a7 4f ec dd a9 28 d2 3e 25 9f 5e e1 -ModPrime1PrivateExponent: \ -db 16 80 2f 79 a2 f0 d4 5f 35 8d 69 fd 33 e4 4b\ -81 fa e8 28 62 2e 93 a5 42 53 e9 97 d0 1b 07 43\ -75 9d a0 e8 12 b4 aa 4e 6c 8b ea b2 32 8d 54 31\ -95 5a 41 8a 67 ff 26 a8 c5 c8 07 a5 da 35 4e 05\ -ef 31 cc 8c f7 58 f4 63 73 29 50 b0 3e 26 57 26\ -fb 94 e3 9d 6a 57 2a 26 24 4a b0 8d b7 57 52 ad -ModPrime2PrivateExponent: \ -a0 a3 17 cf e7 df 14 23 f8 7a 6d ee 84 51 f4 e2\ -b4 a6 7e 54 97 f2 9b 4f 1e 4e 83 0b 9f ad d9 40\ -11 67 02 6f 55 96 e5 a3 9c 97 81 7e 0f 5f 16 e2\ -7e 19 ec 99 02 e0 1d 7e a6 fb 9a a3 c7 60 af ee\ -1e 38 1b 69 de 6a c9 c0 75 85 a0 6a d9 c4 ba 00\ -bf 75 c8 ad 2f a8 98 a4 79 e8 0a e2 94 fe d2 a1 -MultiplicativeInverseOfPrime2ModPrime1: \ -0b 21 f3 35 c3 53 34 2e b4 4c 3a a2 44 45 78 0c\ -2d 65 5b 94 01 74 ca e3 8c 7c 8a 4e 64 93 c0 ba\ -9f d3 03 74 82 67 b0 83 b9 a7 a6 cb 61 e4 2d b3\ -62 b8 c9 89 6d b7 06 4e 02 ad 5a e6 15 87 da 15\ -b4 64 9c 90 59 49 09 fe b3 7d bc b6 54 be b7 26\ -8e c8 01 e5 a8 b4 aa 39 11 be bd 88 54 2f 05 be -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 9.1 -Plaintext: \ -f7 35 fd 55 ba 92 59 2c 3b 52 b8 f9 c4 f6 9a aa\ -1c be f8 fe 88 ad d0 95 59 54 12 46 7f 9c f4 ec\ -0b 89 6c 59 ed a1 62 10 e7 54 9c 8a bb 10 cd bc\ -21 a1 2e c9 b6 b5 b8 fd 2f 10 39 9e b6 -Seed: # not used yet\ -8e c9 65 f1 34 a3 ec 99 31 e9 2a 1c a0 dc 81 69\ -d5 ea 70 5c -Ciphertext: \ -26 7b cd 11 8a ca b1 fc 8b a8 1c 85 d7 30 03 cb\ -86 10 fa 55 c1 d9 7d a8 d4 8a 7c 7f 06 89 6a 4d\ -b7 51 aa 28 42 55 b9 d3 6a d6 5f 37 65 3d 82 9f\ -1b 37 f9 7b 80 01 94 25 45 b2 fc 2c 55 a7 37 6c\ -a7 a1 be 4b 17 60 c8 e0 5a 33 e5 aa 25 26 b8 d9\ -8e 31 70 88 e7 83 4c 75 5b 2a 59 b1 26 31 a1 82\ -c0 5d 5d 43 ab 17 79 26 4f 84 56 f5 15 ce 57 df\ -df 51 2d 54 93 da b7 b7 33 8d c4 b7 d7 8d b9 c0\ -91 ac 3b af 53 7a 69 fc 7f 54 9d 97 9f 0e ff 9a\ -94 fd a4 16 9b d4 d1 d1 9a 69 c9 9e 33 c3 b5 54\ -90 d5 01 b3 9b 1e da e1 18 ff 67 93 a1 53 26 15\ -84 d3 a5 f3 9f 6e 68 2e 3d 17 c8 cd 12 61 fa 72 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 9.2 -Plaintext: \ -81 b9 06 60 50 15 a6 3a ab e4 2d df 11 e1 97 89\ -12 f5 40 4c 74 74 b2 6d ce 3e d4 82 bf 96 1e cc\ -81 8b f4 20 c5 46 59 -Seed: # not used yet\ -ec b1 b8 b2 5f a5 0c da b0 8e 56 04 28 67 f4 af\ -58 26 d1 6c -Ciphertext: \ -93 ac 9f 06 71 ec 29 ac bb 44 4e ff c1 a5 74 13\ -51 d6 0f db 0e 39 3f bf 75 4a cf 0d e4 97 61 a1\ -48 41 df 77 72 e9 bc 82 77 39 66 a1 58 4c 4d 72\ -ba ea 00 11 8f 83 f3 5c ca 6e 53 7c bd 4d 81 1f\ -55 83 b2 97 83 d8 a6 d9 4c d3 1b e7 0d 6f 52 6c\ -10 ff 09 c6 fa 7c e0 69 79 5a 3f cd 05 11 fd 5f\ -cb 56 4b cc 80 ea 9c 78 f3 8b 80 01 25 39 d8 a4\ -dd f6 fe 81 e9 cd db 7f 50 db bb bc c7 e5 d8 60\ -97 cc f4 ec 49 18 9f b8 bf 31 8b e6 d5 a0 71 5d\ -51 6b 49 af 19 12 58 cd 32 dc 83 3c e6 eb 46 73\ -c0 3a 19 bb ac e8 8c c5 48 95 f6 36 cc 0c 1e c8\ -90 96 d1 1c e2 35 a2 65 ca 17 64 23 2a 68 9a e8 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 9.3 -Plaintext: \ -fd 32 64 29 df 9b 89 0e 09 b5 4b 18 b8 f3 4f 1e\ -24 -Seed: # not used yet\ -e8 9b b0 32 c6 ce 62 2c bd b5 3b c9 46 60 14 ea\ -77 f7 77 c0 -Ciphertext: \ -81 eb dd 95 05 4b 0c 82 2e f9 ad 76 93 f5 a8 7a\ -df b4 b4 c4 ce 70 df 2d f8 4e d4 9c 04 da 58 ba\ -5f c2 0a 19 e1 a6 e8 b7 a3 90 0b 22 79 6d c4 e8\ -69 ee 6b 42 79 2d 15 a8 ec eb 56 c0 9c 69 91 4e\ -81 3c ea 8f 69 31 e4 b8 ed 6f 42 1a f2 98 d5 95\ -c9 7f 47 89 c7 ca a6 12 c7 ef 36 09 84 c2 1b 93\ -ed c5 40 10 68 b5 af 4c 78 a8 77 1b 98 4d 53 b8\ -ea 8a df 2f 6a 7d 4a 0b a7 6c 75 e1 dd 9f 65 8f\ -20 de d4 a4 60 71 d4 6d 77 91 b5 68 03 d8 fe a7\ -f0 b0 f8 e4 1a e3 f0 93 83 a6 f9 58 5f e7 75 3e\ -aa ff d2 bf 94 56 31 08 be ec c2 07 bb b5 35 f5\ -fc c7 05 f0 dd e9 f7 08 c6 2f 49 a9 c9 03 71 d3 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 9.4 -Plaintext: \ -f1 45 9b 5f 0c 92 f0 1a 0f 72 3a 2e 56 62 48 4d\ -8f 8c 0a 20 fc 29 da d6 ac d4 3b b5 f3 ef fd f4\ -e1 b6 3e 07 fd fe 66 28 d0 d7 4c a1 9b f2 d6 9e\ -4a 0a bf 86 d2 93 92 5a 79 67 72 f8 08 8e -Seed: # not used yet\ -60 6f 3b 99 c0 b9 cc d7 71 ea a2 9e a0 e4 c8 84\ -f3 18 9c cc -Ciphertext: \ -bc c3 5f 94 cd e6 6c b1 13 66 25 d6 25 b9 44 32\ -a3 5b 22 f3 d2 fa 11 a6 13 ff 0f ca 5b d5 7f 87\ -b9 02 cc dc 1c d0 ae bc b0 71 5e e8 69 d1 d1 fe\ -39 5f 67 93 00 3f 5e ca 46 50 59 c8 86 60 d4 46\ -ff 5f 08 18 55 20 22 55 7e 38 c0 8a 67 ea d9 91\ -26 22 54 f1 06 82 97 5e c5 63 97 76 85 37 f4 97\ -7a f6 d5 f6 aa ce b7 fb 25 de c5 93 72 30 23 1f\ -d8 97 8a f4 91 19 a2 9f 29 e4 24 ab 82 72 b4 75\ -62 79 2d 5c 94 f7 74 b8 82 9d 0b 0d 9f 1a 8c 9e\ -dd f3 75 74 d5 fa 24 8e ef a9 c5 27 1f c5 ec 25\ -79 c8 1b dd 61 b4 10 fa 61 fe 36 e4 24 22 1c 11\ -3a dd b2 75 66 4c 80 1d 34 ca 8c 63 51 e4 a8 58 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 9.5 -Plaintext: \ -53 e6 e8 c7 29 d6 f9 c3 19 dd 31 7e 74 b0 db 8e\ -4c cc a2 5f 3c 83 05 74 6e 13 7a c6 3a 63 ef 37\ -39 e7 b5 95 ab b9 6e 8d 55 e5 4f 7b d4 1a b4 33\ -37 8f fb 91 1d -Seed: # not used yet\ -fc bc 42 14 02 e9 ec ab c6 08 2a fa 40 ba 5f 26\ -52 2c 84 0e -Ciphertext: \ -23 2a fb c9 27 fa 08 c2 f6 a2 7b 87 d4 a5 cb 09\ -c0 7d c2 6f ae 73 d7 3a 90 55 88 39 f4 fd 66 d2\ -81 b8 7e c7 34 bc e2 37 ba 16 66 98 ed 82 91 06\ -a7 de 69 42 cd 6c dc e7 8f ed 8d 2e 4d 81 42 8e\ -66 49 0d 03 62 64 ce f9 2a f9 41 d3 e3 50 55 fe\ -39 81 e1 4d 29 cb b9 a4 f6 74 73 06 3b ae c7 9a\ -11 79 f5 a1 7c 9c 18 32 f2 83 8f d7 d5 e5 9b b9\ -65 9d 56 dc e8 a0 19 ed ef 1b b3 ac cc 69 7c c6\ -cc 7a 77 8f 60 a0 64 c7 f6 f5 d5 29 c6 21 02 62\ -e0 03 de 58 3e 81 e3 16 7b 89 97 1f b8 c0 e1 5d\ -44 ff fe f8 9b 53 d8 d6 4d d7 97 d1 59 b5 6d 2b\ -08 ea 53 07 ea 12 c2 41 bd 58 d4 ee 27 8a 1f 2e -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 9.6 -Plaintext: \ -b6 b2 8e a2 19 8d 0c 10 08 bc 64 -Seed: # not used yet\ -23 aa de 0e 1e 08 bb 9b 9a 78 d2 30 2a 52 f9 c2\ -1b 2e 1b a2 -Ciphertext: \ -43 8c c7 dc 08 a6 8d a2 49 e4 25 05 f8 57 3b a6\ -0e 2c 27 73 d5 b2 90 f4 cf 9d ff 71 8e 84 20 81\ -c3 83 e6 70 24 a0 f2 95 94 ea 98 7b 9d 25 e4 b7\ -38 f2 85 97 0d 19 5a bb 3a 8c 80 54 e3 d7 9d 6b\ -9c 9a 83 27 ba 59 6f 12 59 e2 71 26 67 47 66 90\ -7d 8d 58 2f f3 a8 47 61 54 92 9a db 1e 6d 12 35\ -b2 cc b4 ec 8f 66 3b a9 cc 67 0a 92 be bd 85 3c\ -8d bf 69 c6 43 6d 01 6f 61 ad d8 36 e9 47 32 45\ -04 34 20 7f 9f d4 c4 3d ec 2a 12 a9 58 ef a0 1e\ -fe 26 69 89 9b 5e 60 4c 25 5c 55 fb 71 66 de 55\ -89 e3 69 59 7b b0 91 68 c0 6d d5 db 17 7e 06 a1\ -74 0e b2 d5 c8 2f ae ca 6d 92 fc ee 99 31 ba 9f -Test: DecryptMatch - -AlgorithmType: AsymmetricCipher -Name: RSA/OAEP-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 10: A 2048-bit RSA Key Pair -Modulus: \ -ae 45 ed 56 01 ce c6 b8 cc 05 f8 03 93 5c 67 4d\ -db e0 d7 5c 4c 09 fd 79 51 fc 6b 0c ae c3 13 a8\ -df 39 97 0c 51 8b ff ba 5e d6 8f 3f 0d 7f 22 a4\ -02 9d 41 3f 1a e0 7e 4e be 9e 41 77 ce 23 e7 f5\ -40 4b 56 9e 4e e1 bd cf 3c 1f b0 3e f1 13 80 2d\ -4f 85 5e b9 b5 13 4b 5a 7c 80 85 ad ca e6 fa 2f\ -a1 41 7e c3 76 3b e1 71 b0 c6 2b 76 0e de 23 c1\ -2a d9 2b 98 08 84 c6 41 f5 a8 fa c2 6b da d4 a0\ -33 81 a2 2f e1 b7 54 88 50 94 c8 25 06 d4 01 9a\ -53 5a 28 6a fe b2 71 bb 9b a5 92 de 18 dc f6 00\ -c2 ae ea e5 6e 02 f7 cf 79 fc 14 cf 3b dc 7c d8\ -4f eb bb f9 50 ca 90 30 4b 22 19 a7 aa 06 3a ef\ -a2 c3 c1 98 0e 56 0c d6 4a fe 77 95 85 b6 10 76\ -57 b9 57 85 7e fd e6 01 09 88 ab 7d e4 17 fc 88\ -d8 f3 84 c4 e6 e7 2c 3f 94 3e 0c 31 c0 c4 a5 cc\ -36 f8 79 d8 a3 ac 9d 7d 59 86 0e aa da 6b 83 bb -PublicExponent: \ -01 00 01 -PrivateExponent: \ -05 6b 04 21 6f e5 f3 54 ac 77 25 0a 4b 6b 0c 85\ -25 a8 5c 59 b0 bd 80 c5 64 50 a2 2d 5f 43 8e 59\ -6a 33 3a a8 75 e2 91 dd 43 f4 8c b8 8b 9d 5f c0\ -d4 99 f9 fc d1 c3 97 f9 af c0 70 cd 9e 39 8c 8d\ -19 e6 1d b7 c7 41 0a 6b 26 75 df bf 5d 34 5b 80\ -4d 20 1a dd 50 2d 5c e2 df cb 09 1c e9 99 7b be\ -be 57 30 6f 38 3e 4d 58 81 03 f0 36 f7 e8 5d 19\ -34 d1 52 a3 23 e4 a8 db 45 1d 6f 4a 5b 1b 0f 10\ -2c c1 50 e0 2f ee e2 b8 8d ea 4a d4 c1 ba cc b2\ -4d 84 07 2d 14 e1 d2 4a 67 71 f7 40 8e e3 05 64\ -fb 86 d4 39 3a 34 bc f0 b7 88 50 1d 19 33 03 f1\ -3a 22 84 b0 01 f0 f6 49 ea f7 93 28 d4 ac 5c 43\ -0a b4 41 49 20 a9 46 0e d1 b7 bc 40 ec 65 3e 87\ -6d 09 ab c5 09 ae 45 b5 25 19 01 16 a0 c2 61 01\ -84 82 98 50 9c 1c 3b f3 a4 83 e7 27 40 54 e1 5e\ -97 07 50 36 e9 89 f6 09 32 80 7b 52 57 75 1e 79 -Prime1: \ -ec f5 ae cd 1e 55 15 ff fa cb d7 5a 28 16 c6 eb\ -f4 90 18 cd fb 46 38 e1 85 d6 6a 73 96 b6 f8 09\ -0f 80 18 c7 fd 95 cc 34 b8 57 dc 17 f0 cc 65 16\ -bb 13 46 ab 4d 58 2c ad ad 7b 41 03 35 23 87 b7\ -03 38 d0 84 04 7c 9d 95 39 b6 49 62 04 b3 dd 6e\ -a4 42 49 92 07 be c0 1f 96 42 87 ff 63 36 c3 98\ -46 58 33 68 46 f5 6e 46 86 18 81 c1 02 33 d2 17\ -6b f1 5a 5e 96 dd c7 80 bc 86 8a a7 7d 3c e7 69 -Prime2: \ -bc 46 c4 64 fc 6a c4 ca 78 3b 0e b0 8a 3c 84 1b\ -77 2f 7e 9b 2f 28 ba bd 58 8a e8 85 e1 a0 c6 1e\ -48 58 a0 fb 25 ac 29 99 90 f3 5b e8 51 64 c2 59\ -ba 11 75 cd d7 19 27 07 13 51 84 99 2b 6c 29 b7\ -46 dd 0d 2c ab e1 42 83 5f 7d 14 8c c1 61 52 4b\ -4a 09 94 6d 48 b8 28 47 3f 1c e7 6b 6c b6 88 6c\ -34 5c 03 e0 5f 41 d5 1b 5c 3a 90 a3 f2 40 73 c7\ -d7 4a 4f e2 5d 9c f2 1c 75 96 0f 3f c3 86 31 83 -ModPrime1PrivateExponent: \ -c7 35 64 57 1d 00 fb 15 d0 8a 3d e9 95 7a 50 91\ -5d 71 26 e9 44 2d ac f4 2b c8 2e 86 2e 56 73 ff\ -6a 00 8e d4 d2 e3 74 61 7d f8 9f 17 a1 60 b4 3b\ -7f da 9c b6 b6 b7 42 18 60 98 15 f7 d4 5c a2 63\ -c1 59 aa 32 d2 72 d1 27 fa f4 bc 8c a2 d7 73 78\ -e8 ae b1 9b 0a d7 da 3c b3 de 0a e7 31 49 80 f6\ -2b 6d 4b 0a 87 5d 1d f0 3c 1b ae 39 cc d8 33 ef\ -6c d7 e2 d9 52 8b f0 84 d1 f9 69 e7 94 e9 f6 c1 -ModPrime2PrivateExponent: \ -26 58 b3 7f 6d f9 c1 03 0b e1 db 68 11 7f a9 d8\ -7e 39 ea 2b 69 3b 7e 6d 3a 2f 70 94 74 13 ee c6\ -14 2e 18 fb 8d fc b6 ac 54 5d 7c 86 a0 ad 48 f8\ -45 71 70 f0 ef b2 6b c4 81 26 c5 3e fd 1d 16 92\ -01 98 dc 2a 11 07 dc 28 2d b6 a8 0c d3 06 23 60\ -ba 3f a1 3f 70 e4 31 2f f1 a6 cd 6b 8f c4 cd 9c\ -5c 3d b1 7c 6d 6a 57 21 2f 73 ae 29 f6 19 32 7b\ -ad 59 b1 53 85 85 85 ba 4e 28 b6 0a 62 a4 5e 49 -MultiplicativeInverseOfPrime2ModPrime1: \ -6f 38 52 6b 39 25 08 55 34 ef 3e 41 5a 83 6e de\ -8b 86 15 8a 2c 7c bf ec cb 0b d8 34 30 4f ec 68\ -3b a8 d4 f4 79 c4 33 d4 34 16 e6 32 69 62 3c ea\ -10 07 76 d8 5a ff 40 1d 3f ff 61 0e e6 54 11 ce\ -3b 13 63 d6 3a 97 09 ee de 42 64 7c ea 56 14 93\ -d5 45 70 a8 79 c1 86 82 cd 97 71 0b 96 20 5e c3\ -11 17 d7 3b 5f 36 22 3f ad d6 e8 ba 90 dd 7c 0e\ -e6 1d 44 e1 63 25 1e 20 c7 f6 6e b3 05 11 7c b8 -Test: KeyPairValidAndConsistent -Comment: RSAES-OAEP Encryption Example 10.1 -Plaintext: \ -8b ba 6b f8 2a 6c 0f 86 d5 f1 75 6e 97 95 68 70\ -b0 89 53 b0 6b 4e b2 05 bc 16 94 ee -Seed: # not used yet\ -47 e1 ab 71 19 fe e5 6c 95 ee 5e aa d8 6f 40 d0\ -aa 63 bd 33 -Ciphertext: \ -53 ea 5d c0 8c d2 60 fb 3b 85 85 67 28 7f a9 15\ -52 c3 0b 2f eb fb a2 13 f0 ae 87 70 2d 06 8d 19\ -ba b0 7f e5 74 52 3d fb 42 13 9d 68 c3 c5 af ee\ -e0 bf e4 cb 79 69 cb f3 82 b8 04 d6 e6 13 96 14\ -4e 2d 0e 60 74 1f 89 93 c3 01 4b 58 b9 b1 95 7a\ -8b ab cd 23 af 85 4f 4c 35 6f b1 66 2a a7 2b fc\ -c7 e5 86 55 9d c4 28 0d 16 0c 12 67 85 a7 23 eb\ -ee be ff 71 f1 15 94 44 0a ae f8 7d 10 79 3a 87\ -74 a2 39 d4 a0 4c 87 fe 14 67 b9 da f8 52 08 ec\ -6c 72 55 79 4a 96 cc 29 14 2f 9a 8b d4 18 e3 c1\ -fd 67 34 4b 0c d0 82 9d f3 b2 be c6 02 53 19 62\ -93 c6 b3 4d 3f 75 d3 2f 21 3d d4 5c 62 73 d5 05\ -ad f4 cc ed 10 57 cb 75 8f c2 6a ee fa 44 12 55\ -ed 4e 64 c1 99 ee 07 5e 7f 16 64 61 82 fd b4 64\ -73 9b 68 ab 5d af f0 e6 3e 95 52 01 68 24 f0 54\ -bf 4d 3c 8c 90 a9 7b b6 b6 55 32 84 eb 42 9f cc -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 10.2 -Plaintext: \ -e6 ad 18 1f 05 3b 58 a9 04 f2 45 75 10 37 3e 57 -Seed: # not used yet\ -6d 17 f5 b4 c1 ff ac 35 1d 19 5b f7 b0 9d 09 f0\ -9a 40 79 cf -Ciphertext: \ -a2 b1 a4 30 a9 d6 57 e2 fa 1c 2b b5 ed 43 ff b2\ -5c 05 a3 08 fe 90 93 c0 10 31 79 5f 58 74 40 01\ -10 82 8a e5 8f b9 b5 81 ce 9d dd d3 e5 49 ae 04\ -a0 98 54 59 bd e6 c6 26 59 4e 7b 05 dc 42 78 b2\ -a1 46 5c 13 68 40 88 23 c8 5e 96 dc 66 c3 a3 09\ -83 c6 39 66 4f c4 56 9a 37 fe 21 e5 a1 95 b5 77\ -6e ed 2d f8 d8 d3 61 af 68 6e 75 02 29 bb d6 63\ -f1 61 86 8a 50 61 5e 0c 33 7b ec 0c a3 5f ec 0b\ -b1 9c 36 eb 2e 0b bc c0 58 2f a1 d9 3a ac db 06\ -10 63 f5 9f 2c e1 ee 43 60 5e 5d 89 ec a1 83 d2\ -ac df e9 f8 10 11 02 2a d3 b4 3a 3d d4 17 da c9\ -4b 4e 11 ea 81 b1 92 96 6e 96 6b 18 20 82 e7 19\ -64 60 7b 4f 80 02 f3 62 99 84 4a 11 f2 ae 0f ae\ -ac 2e ae 70 f8 f4 f9 80 88 ac dc d0 ac 55 6e 9f\ -cc c5 11 52 19 08 fa d2 6f 04 c6 42 01 45 03 05\ -77 87 58 b0 53 8b f8 b5 bb 14 4a 82 8e 62 97 95 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 10.3 -Plaintext: \ -51 0a 2c f6 0e 86 6f a2 34 05 53 c9 4e a3 9f bc\ -25 63 11 e8 3e 94 45 4b 41 24 -Seed: # not used yet\ -38 53 87 51 4d ec cc 7c 74 0d d8 cd f9 da ee 49\ -a1 cb fd 54 -Ciphertext: \ -98 86 c3 e6 76 4a 8b 9a 84 e8 41 48 eb d8 c3 b1\ -aa 80 50 38 1a 78 f6 68 71 4c 16 d9 cf d2 a6 ed\ -c5 69 79 c5 35 d9 de e3 b4 4b 85 c1 8b e8 92 89\ -92 37 17 11 47 22 16 d9 5d da 98 d2 ee 83 47 c9\ -b1 4d ff df f8 4a a4 8d 25 ac 06 f7 d7 e6 53 98\ -ac 96 7b 1c e9 09 25 f6 7d ce 04 9b 7f 81 2d b0\ -74 29 97 a7 4d 44 fe 81 db e0 e7 a3 fe af 2e 5c\ -40 af 88 8d 55 0d db be 3b c2 06 57 a2 95 43 f8\ -fc 29 13 b9 bd 1a 61 b2 ab 22 56 ec 40 9b bd 7d\ -c0 d1 77 17 ea 25 c4 3f 42 ed 27 df 87 38 bf 4a\ -fc 67 66 ff 7a ff 08 59 55 5e e2 83 92 0f 4c 8a\ -63 c4 a7 34 0c ba fd dc 33 9e cd b4 b0 51 50 02\ -f9 6c 93 2b 5b 79 16 7a f6 99 c0 ad 3f cc fd f0\ -f4 4e 85 a7 02 62 bf 2e 18 fe 34 b8 50 58 99 75\ -e8 67 ff 96 9d 48 ea bf 21 22 71 54 6c dc 05 a6\ -9e cb 52 6e 52 87 0c 83 6f 30 7b d7 98 78 0e de -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 10.4 -Plaintext: \ -bc dd 19 0d a3 b7 d3 00 df 9a 06 e2 2c aa e2 a7\ -5f 10 c9 1f f6 67 b7 c1 6b de 8b 53 06 4a 26 49\ -a9 40 45 c9 -Seed: # not used yet\ -5c ac a6 a0 f7 64 16 1a 96 84 f8 5d 92 b6 e0 ef\ -37 ca 8b 65 -Ciphertext: \ -63 18 e9 fb 5c 0d 05 e5 30 7e 16 83 43 6e 90 32\ -93 ac 46 42 35 8a aa 22 3d 71 63 01 3a ba 87 e2\ -df da 8e 60 c6 86 0e 29 a1 e9 26 86 16 3e a0 b9\ -17 5f 32 9c a3 b1 31 a1 ed d3 a7 77 59 a8 b9 7b\ -ad 6a 4f 8f 43 96 f2 8c f6 f3 9c a5 81 12 e4 81\ -60 d6 e2 03 da a5 85 6f 3a ca 5f fe d5 77 af 49\ -94 08 e3 df d2 33 e3 e6 04 db e3 4a 9c 4c 90 82\ -de 65 52 7c ac 63 31 d2 9d c8 0e 05 08 a0 fa 71\ -22 e7 f3 29 f6 cc a5 cf a3 4d 4d 1d a4 17 80 54\ -57 e0 08 be c5 49 e4 78 ff 9e 12 a7 63 c4 77 d1\ -5b bb 78 f5 b6 9b d5 78 30 fc 2c 4e d6 86 d7 9b\ -c7 2a 95 d8 5f 88 13 4c 6b 0a fe 56 a8 cc fb c8\ -55 82 8b b3 39 bd 17 90 9c f1 d7 0d e3 33 5a e0\ -70 39 09 3e 60 6d 65 53 65 de 65 50 b8 72 cd 6d\ -e1 d4 40 ee 03 1b 61 94 5f 62 9a d8 a3 53 b0 d4\ -09 39 e9 6a 3c 45 0d 2a 8d 5e ee 9f 67 80 93 c8 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 10.5 -Plaintext: \ -a7 dd 6c 7d c2 4b 46 f9 dd 5f 1e 91 ad a4 c3 b3\ -df 94 7e 87 72 32 a9 -Seed: # not used yet\ -95 bc a9 e3 85 98 94 b3 dd 86 9f a7 ec d5 bb c6\ -40 1b f3 e4 -Ciphertext: \ -75 29 08 72 cc fd 4a 45 05 66 0d 65 1f 56 da 6d\ -aa 09 ca 13 01 d8 90 63 2f 6a 99 2f 3d 56 5c ee\ -46 4a fd ed 40 ed 3b 5b e9 35 67 14 ea 5a a7 65\ -5f 4a 13 66 c2 f1 7c 72 8f 6f 2c 5a 5d 1f 8e 28\ -42 9b c4 e6 f8 f2 cf f8 da 8d c0 e0 a9 80 8e 45\ -fd 09 ea 2f a4 0c b2 b6 ce 6f ff f5 c0 e1 59 d1\ -1b 68 d9 0a 85 f7 b8 4e 10 3b 09 e6 82 66 64 80\ -c6 57 50 5c 09 29 25 94 68 a3 14 78 6d 74 ea b1\ -31 57 3c f2 34 bf 57 db 7d 9e 66 cc 67 48 19 2e\ -00 2d c0 de ea 93 05 85 f0 83 1f dc d9 bc 33 d5\ -1f 79 ed 2f fc 16 bc f4 d5 98 12 fc eb ca a3 f9\ -06 9b 0e 44 56 86 d6 44 c2 5c cf 63 b4 56 ee 5f\ -a6 ff e9 6f 19 cd f7 51 fe d9 ea f3 59 57 75 4d\ -bf 4b fe a5 21 6a a1 84 4d c5 07 cb 2d 08 0e 72\ -2e ba 15 03 08 c2 b5 ff 11 93 62 0f 17 66 ec f4\ -48 1b af b9 43 bd 29 28 77 f2 13 6c a4 94 ab a0 -Test: DecryptMatch -Comment: RSAES-OAEP Encryption Example 10.6 -Plaintext: \ -ea f1 a7 3a 1b 0c 46 09 53 7d e6 9c d9 22 8b bc\ -fb 9a 8c a8 c6 c3 ef af 05 6f e4 a7 f4 63 4e d0\ -0b 7c 39 ec 69 22 d7 b8 ea 2c 04 eb ac -Seed: # not used yet\ -9f 47 dd f4 2e 97 ee a8 56 a9 bd bc 71 4e b3 ac\ -22 f6 eb 32 -Ciphertext: \ -2d 20 7a 73 43 2a 8f b4 c0 30 51 b3 f7 3b 28 a6\ -17 64 09 8d fa 34 c4 7a 20 99 5f 81 15 aa 68 16\ -67 9b 55 7e 82 db ee 58 49 08 c6 e6 97 82 d7 de\ -b3 4d bd 65 af 06 3d 57 fc a7 6a 5f d0 69 49 2f\ -d6 06 8d 99 84 d2 09 35 05 65 a6 2e 5c 77 f2 30\ -38 c1 2c b1 0c 66 34 70 9b 54 7c 46 f6 b4 a7 09\ -bd 85 ca 12 2d 74 46 5e f9 77 62 c2 97 63 e0 6d\ -bc 7a 9e 73 8c 78 bf ca 01 02 dc 5e 79 d6 5b 97\ -3f 28 24 0c aa b2 e1 61 a7 8b 57 d2 62 45 7e d8\ -19 5d 53 e3 c7 ae 9d a0 21 88 3c 6d b7 c2 4a fd\ -d2 32 2e ac 97 2a d3 c3 54 c5 fc ef 1e 14 6c 3a\ -02 90 fb 67 ad f0 07 06 6e 00 42 8d 2c ec 18 ce\ -58 f9 32 86 98 de fe f4 b2 eb 5e c7 69 18 fd e1\ -c1 98 cb b3 8b 7a fc 67 62 6a 9a ef ec 43 22 bf\ -d9 0d 25 63 48 1c 9a 22 1f 78 c8 27 2c 82 d1 b6\ -2a b9 14 e1 c6 9f 6a f6 ef 30 ca 52 60 db 4a 46 -Test: DecryptMatch diff --git a/external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt b/external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt deleted file mode 100644 index 2272b7c46..000000000 --- a/external/crypto++-5.6.3/TestVectors/rsa_pkcs1_1_5.txt +++ /dev/null @@ -1,89 +0,0 @@ -AlgorithmType: Signature -Name: RSA/PKCS1-1.5(MD2) -KeyFormat: DER -Source: http://www.rsasecurity.com/rsalabs/pkcs/index.html, \ - Some Examples of the PKCS Standards -PrivateKey: \ - 30 82 01 50\ - 02 01 00 #version = 0\ - 30 0d #privateKeyAlgorithmIdentifier\ - 06 09 #algorithm = rsaEncryption\ - 2a 86 48 86 f7 0d 01 01 01\ - 05 00 #parameters = NULL\ - 04 82 01 3a #privateKey = RSAPrivateKey encoding\ - 30 82 01 36\ - 02 01 00 #version = 0\ - 02 40 #modulus = n\ - 0a 66 79 1d c6 98 81 68 de 7a b7 74 19 bb 7f b0\ - c0 01 c6 27 10 27 00 75 14 29 42 e1 9a 8d 8c 51\ - d0 53 b3 e3 78 2a 1d e5 dc 5a f4 eb e9 94 68 17\ - 01 14 a1 df e6 7c dc 9a 9a f5 5d 65 56 20 bb ab\ - 02 03 01 00 01 #publicExponent = e\ - 02 40 #privateExponent = d\ - 01 23 c5 b6 1b a3 6e db 1d 36 79 90 41 99 a8 9e\ - a8 0c 09 b9 12 2e 14 00 c0 9a dc f7 78 46 76 d0\ - 1d 23 35 6a 7d 44 d6 bd 8b d5 0e 94 bf c7 23 fa\ - 87 d8 86 2b 75 17 76 91 c1 1d 75 76 92 df 88 81\ - 02 20 #prime1 = p\ - 33 d4 84 45 c8 59 e5 23 40 de 70 4b cd da 06 5f\ - bb 40 58 d7 40 bd 1d 67 d2 9e 9c 14 6c 11 cf 61\ - 02 20 #prime2 = q\ - 33 5e 84 08 86 6b 0f d3 8d c7 00 2d 3f 97 2c 67\ - 38 9a 65 d5 d8 30 65 66 d5 c4 f2 a5 aa 52 62 8b\ - 02 20 #exponent1 = d mod p-1\ - 04 5e c9 00 71 52 53 25 d3 d4 6d b7 96 95 e9 af\ - ac c4 52 39 64 36 0e 02 b1 19 ba a3 66 31 62 41\ - 02 20 #exponent2 = d mod q-1\ - 15 eb 32 73 60 c7 b6 0d 12 e5 e2 d1 6b dc d9 79\ - 81 d1 7f ba 6b 70 db 13 b2 0b 43 6e 24 ea da 59\ - 02 20 #coefficient = q-1 mod p\ - 2c a6 36 6d 72 78 1d fa 24 d3 4a 9a 24 cb c2 ae\ - 92 7a 99 58 af 42 65 63 ff 63 fb 11 65 8a 46 1d -PublicKey: \ - 30 5b #subjectPublicKeyInfo\ - 30 0d #algorithm\ - 06 09 #algorithm = rsaEncryption\ - 2a 86 48 86 f7 0d 01 01 01\ - 05 00 #parameters = NULL\ - 03 4a #subjectPublicKey = RSAPublicKey encoding\ - 00\ - 30 47\ - 02 40 #modulus = n\ - 0a 66 79 1d c6 98 81 68 de 7a b7 74 19 bb 7f b0\ - c0 01 c6 27 10 27 00 75 14 29 42 e1 9a 8d 8c 51\ - d0 53 b3 e3 78 2a 1d e5 dc 5a f4 eb e9 94 68 17\ - 01 14 a1 df e6 7c dc 9a 9a f5 5d 65 56 20 bb ab\ - 02 03 01 00 01 #publicExponent = e -Test: KeyPairValidAndConsistent -Message: # "Everyone gets Friday off."\ - 45 76 65 72 79 6f 6e 65 20 67 65 74 73 20 46 72 69 64 61 79 20 6f 66 66 2e -Signature: \ - 05fa6a812fc7df8bf4f2542509e03e84\ - 6e11b9c620be2009efb440efbcc66921\ - 6994ac04f341b57d05202d428fb2a27b\ - 5c77dfd9b15bfc3d559353503410c1e1 -Test: Verify -Name: RSA/PKCS1-1.5(SHA-1) -Source: generated by Wei Dai using Crypto++ 5.0 -Signature: 0610761F95FFD1B8F29DA34212947EC2AA0E358866A722F03CC3C41487ADC604A48FF54F5C6BEDB9FB7BD59F82D6E55D8F3174BA361B2214B2D74E8825E04E81 -Test: Verify -Message: 00 -Test: NotVerify - -AlgorithmType: Signature -Name: RSA/PKCS1-1.5(SHA-1) -Source: http://islab.oregonstate.edu/emails/pkcs-tng-02/0152 -KeyFormat: Component -Modulus: A885B6F851A8079AB8A281DB0297148511EE0D8C07C0D4AE6D6FED461488E0D41E3FF8F281B06A3240B5007A5C2AB4FB6BE8AF88F119DB998368DDDC9710ABED -PublicExponent: 010001 -PrivateExponent: 2B259D2CA3DF851EE891F6F4678BDDFD9A131C95D3305C63D2723B4A5B9C960F5EC8BB7DCDDBEBD8B6A38767D64AD451E9383E0891E4EE7506100481F2B49323 -Prime1: D7103CD676E39824E2BE50B8E6533FE7CB7484348E283802AD2B8D00C80D19DF -Prime2: C89996DC169CEB3F227958275968804D4BE9FC4012C3219662F1A438C9950BB3 -ModPrime1PrivateExponent: 5D8EA4C8AF83A70634D5920C3DB66D908AC3AF57A597FD75BC9BBB856181C185 -ModPrime2PrivateExponent: C598E54DAEC8ABC1E907769A6C2BD01653ED0C9960E1EDB7E186FDA922883A99 -MultiplicativeInverseOfPrime2ModPrime1: 7C6F27B5B51B78AD80FB36E700990CF307866F2943124CBD93D97C137794C104 -Test: KeyPairValidAndConsistent -Source: generated by Wei Dai using Crypto++ 5.0 -Message: 74657374 # "test" -Signature: A7E00CE4391F914D82158D9B732759808E25A1C6383FE87A5199157650D4296CF612E9FF809E686A0AF328238306E79965F6D0138138829D9A1A22764306F6CE -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/rsa_pss.txt b/external/crypto++-5.6.3/TestVectors/rsa_pss.txt deleted file mode 100644 index 1b5fc9c82..000000000 --- a/external/crypto++-5.6.3/TestVectors/rsa_pss.txt +++ /dev/null @@ -1,2083 +0,0 @@ -AlgorithmType: Signature -Name: RSA/PSS-MGF1(SHA-1) -Source: http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/, PKCS #1 test vectors -KeyFormat: Component -Comment: Example 1: A 1024-bit RSA Key Pair -Modulus: \ -a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1\ -56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91\ -d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3\ -94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df\ -d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77\ -c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1\ -05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4\ -ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -33 a5 04 2a 90 b2 7d 4f 54 51 ca 9b bb d0 b4 47\ -71 a1 01 af 88 43 40 ae f9 88 5f 2a 4b be 92 e8\ -94 a7 24 ac 3c 56 8c 8f 97 85 3a d0 7c 02 66 c8\ -c6 a3 ca 09 29 f1 e8 f1 12 31 88 44 29 fc 4d 9a\ -e5 5f ee 89 6a 10 ce 70 7c 3e d7 e7 34 e4 47 27\ -a3 95 74 50 1a 53 26 83 10 9c 2a ba ca ba 28 3c\ -31 b4 bd 2f 53 c3 ee 37 e3 52 ce e3 4f 9e 50 3b\ -d8 0c 06 22 ad 79 c6 dc ee 88 35 47 c6 a3 b3 25 -Prime1: \ -e7 e8 94 27 20 a8 77 51 72 73 a3 56 05 3e a2 a1\ -bc 0c 94 aa 72 d5 5c 6e 86 29 6b 2d fc 96 79 48\ -c0 a7 2c bc cc a7 ea cb 35 70 6e 09 a1 df 55 a1\ -53 5b d9 b3 cc 34 16 0b 3b 6d cd 3e da 8e 64 43 -Prime2: \ -b6 9d ca 1c f7 d4 d7 ec 81 e7 5b 90 fc ca 87 4a\ -bc de 12 3f d2 70 01 80 aa 90 47 9b 6e 48 de 8d\ -67 ed 24 f9 f1 9d 85 ba 27 58 74 f5 42 cd 20 dc\ -72 3e 69 63 36 4a 1f 94 25 45 2b 26 9a 67 99 fd -ModPrime1PrivateExponent: \ -28 fa 13 93 86 55 be 1f 8a 15 9c ba ca 5a 72 ea\ -19 0c 30 08 9e 19 cd 27 4a 55 6f 36 c4 f6 e1 9f\ -55 4b 34 c0 77 79 04 27 bb dd 8d d3 ed e2 44 83\ -28 f3 85 d8 1b 30 e8 e4 3b 2f ff a0 27 86 19 79 -ModPrime2PrivateExponent: \ -1a 8b 38 f3 98 fa 71 20 49 89 8d 7f b7 9e e0 a7\ -76 68 79 12 99 cd fa 09 ef c0 e5 07 ac b2 1e d7\ -43 01 ef 5b fd 48 be 45 5e ae b6 e1 67 82 55 82\ -75 80 a8 e4 e8 e1 41 51 d1 51 0a 82 a3 f2 e7 29 -MultiplicativeInverseOfPrime2ModPrime1: \ -27 15 6a ba 41 26 d2 4a 81 f3 a5 28 cb fb 27 f5\ -68 86 f8 40 a9 f6 e8 6e 17 a4 4b 94 fe 93 19 58\ -4b 8e 22 fd de 1e 5a 2e 3b d8 aa 5b a8 d8 58 41\ -94 eb 21 90 ac f8 32 b8 47 f1 3a 3d 24 a7 9f 4d -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 1.1 -Message: \ -cd c8 7d a2 23 d7 86 df 3b 45 e0 bb bc 72 13 26\ -d1 ee 2a f8 06 cc 31 54 75 cc 6f 0d 9c 66 e1 b6\ -23 71 d4 5c e2 39 2e 1a c9 28 44 c3 10 10 2f 15\ -6a 0d 8d 52 c1 f4 c4 0b a3 aa 65 09 57 86 cb 76\ -97 57 a6 56 3b a9 58 fe d0 bc c9 84 e8 b5 17 a3\ -d5 f5 15 b2 3b 8a 41 e7 4a a8 67 69 3f 90 df b0\ -61 a6 e8 6d fa ae e6 44 72 c0 0e 5f 20 94 57 29\ -cb eb e7 7f 06 ce 78 e0 8f 40 98 fb a4 1f 9d 61\ -93 c0 31 7e 8b 60 d4 b6 08 4a cb 42 d2 9e 38 08\ -a3 bc 37 2d 85 e3 31 17 0f cb f7 cc 72 d0 b7 1c\ -29 66 48 b3 a4 d1 0f 41 62 95 d0 80 7a a6 25 ca\ -b2 74 4f d9 ea 8f d2 23 c4 25 37 02 98 28 bd 16\ -be 02 54 6f 13 0f d2 e3 3b 93 6d 26 76 e0 8a ed\ -1b 73 31 8b 75 0a 01 67 d0 -Salt: \ -de e9 59 c7 e0 64 11 36 14 20 ff 80 18 5e d5 7f\ -3e 67 76 af -Signature: \ -90 74 30 8f b5 98 e9 70 1b 22 94 38 8e 52 f9 71\ -fa ac 2b 60 a5 14 5a f1 85 df 52 87 b5 ed 28 87\ -e5 7c e7 fd 44 dc 86 34 e4 07 c8 e0 e4 36 0b c2\ -26 f3 ec 22 7f 9d 9e 54 63 8e 8d 31 f5 05 12 15\ -df 6e bb 9c 2f 95 79 aa 77 59 8a 38 f9 14 b5 b9\ -c1 bd 83 c4 e2 f9 f3 82 a0 d0 aa 35 42 ff ee 65\ -98 4a 60 1b c6 9e b2 8d eb 27 dc a1 2c 82 c2 d4\ -c3 f6 6c d5 00 f1 ff 2b 99 4d 8a 4e 30 cb b3 3c -Test: Verify -Comment: RSASSA-PSS Signature Example 1.2 -Message: \ -85 13 84 cd fe 81 9c 22 ed 6c 4c cb 30 da eb 5c\ -f0 59 bc 8e 11 66 b7 e3 53 0c 4c 23 3e 2b 5f 8f\ -71 a1 cc a5 82 d4 3e cc 72 b1 bc a1 6d fc 70 13\ -22 6b 9e -Salt: \ -ef 28 69 fa 40 c3 46 cb 18 3d ab 3d 7b ff c9 8f\ -d5 6d f4 2d -Signature: \ -3e f7 f4 6e 83 1b f9 2b 32 27 41 42 a5 85 ff ce\ -fb dc a7 b3 2a e9 0d 10 fb 0f 0c 72 99 84 f0 4e\ -f2 9a 9d f0 78 07 75 ce 43 73 9b 97 83 83 90 db\ -0a 55 05 e6 3d e9 27 02 8d 9d 29 b2 19 ca 2c 45\ -17 83 25 58 a5 5d 69 4a 6d 25 b9 da b6 60 03 c4\ -cc cd 90 78 02 19 3b e5 17 0d 26 14 7d 37 b9 35\ -90 24 1b e5 1c 25 05 5f 47 ef 62 75 2c fb e2 14\ -18 fa fe 98 c2 2c 4d 4d 47 72 4f db 56 69 e8 43 -Test: Verify -Comment: RSASSA-PSS Signature Example 1.3 -Message: \ -a4 b1 59 94 17 61 c4 0c 6a 82 f2 b8 0d 1b 94 f5\ -aa 26 54 fd 17 e1 2d 58 88 64 67 9b 54 cd 04 ef\ -8b d0 30 12 be 8d c3 7f 4b 83 af 79 63 fa ff 0d\ -fa 22 54 77 43 7c 48 01 7f f2 be 81 91 cf 39 55\ -fc 07 35 6e ab 3f 32 2f 7f 62 0e 21 d2 54 e5 db\ -43 24 27 9f e0 67 e0 91 0e 2e 81 ca 2c ab 31 c7\ -45 e6 7a 54 05 8e b5 0d 99 3c db 9e d0 b4 d0 29\ -c0 6d 21 a9 4c a6 61 c3 ce 27 fa e1 d6 cb 20 f4\ -56 4d 66 ce 47 67 58 3d 0e 5f 06 02 15 b5 90 17\ -be 85 ea 84 89 39 12 7b d8 c9 c4 d4 7b 51 05 6c\ -03 1c f3 36 f1 7c 99 80 f3 b8 f5 b9 b6 87 8e 8b\ -79 7a a4 3b 88 26 84 33 3e 17 89 3f e9 ca a6 aa\ -29 9f 7e d1 a1 8e e2 c5 48 64 b7 b2 b9 9b 72 61\ -8f b0 25 74 d1 39 ef 50 f0 19 c9 ee f4 16 97 13\ -38 e7 d4 70 -Salt: \ -71 0b 9c 47 47 d8 00 d4 de 87 f1 2a fd ce 6d f1\ -81 07 cc 77 -Signature: \ -66 60 26 fb a7 1b d3 e7 cf 13 15 7c c2 c5 1a 8e\ -4a a6 84 af 97 78 f9 18 49 f3 43 35 d1 41 c0 01\ -54 c4 19 76 21 f9 62 4a 67 5b 5a bc 22 ee 7d 5b\ -aa ff aa e1 c9 ba ca 2c c3 73 b3 f3 3e 78 e6 14\ -3c 39 5a 91 aa 7f ac a6 64 eb 73 3a fd 14 d8 82\ -72 59 d9 9a 75 50 fa ca 50 1e f2 b0 4e 33 c2 3a\ -a5 1f 4b 9e 82 82 ef db 72 8c c0 ab 09 40 5a 91\ -60 7c 63 69 96 1b c8 27 0d 2d 4f 39 fc e6 12 b1 -Test: Verify -Comment: RSASSA-PSS Signature Example 1.4 -Message: \ -bc 65 67 47 fa 9e af b3 f0 -Salt: \ -05 6f 00 98 5d e1 4d 8e f5 ce a9 e8 2f 8c 27 be\ -f7 20 33 5e -Signature: \ -46 09 79 3b 23 e9 d0 93 62 dc 21 bb 47 da 0b 4f\ -3a 76 22 64 9a 47 d4 64 01 9b 9a ea fe 53 35 9c\ -17 8c 91 cd 58 ba 6b cb 78 be 03 46 a7 bc 63 7f\ -4b 87 3d 4b ab 38 ee 66 1f 19 96 34 c5 47 a1 ad\ -84 42 e0 3d a0 15 b1 36 e5 43 f7 ab 07 c0 c1 3e\ -42 25 b8 de 8c ce 25 d4 f6 eb 84 00 f8 1f 7e 18\ -33 b7 ee 6e 33 4d 37 09 64 ca 79 fd b8 72 b4 d7\ -52 23 b5 ee b0 81 01 59 1f b5 32 d1 55 a6 de 87 -Test: Verify -Comment: RSASSA-PSS Signature Example 1.5 -Message: \ -b4 55 81 54 7e 54 27 77 0c 76 8e 8b 82 b7 55 64\ -e0 ea 4e 9c 32 59 4d 6b ff 70 65 44 de 0a 87 76\ -c7 a8 0b 45 76 55 0e ee 1b 2a ca bc 7e 8b 7d 3e\ -f7 bb 5b 03 e4 62 c1 10 47 ea dd 00 62 9a e5 75\ -48 0a c1 47 0f e0 46 f1 3a 2b f5 af 17 92 1d c4\ -b0 aa 8b 02 be e6 33 49 11 65 1d 7f 85 25 d1 0f\ -32 b5 1d 33 be 52 0d 3d df 5a 70 99 55 a3 df e7\ -82 83 b9 e0 ab 54 04 6d 15 0c 17 7f 03 7f dc cc\ -5b e4 ea 5f 68 b5 e5 a3 8c 9d 7e dc cc c4 97 5f\ -45 5a 69 09 b4 -Salt: \ -80 e7 0f f8 6a 08 de 3e c6 09 72 b3 9b 4f bf dc\ -ea 67 ae 8e -Signature: \ -1d 2a ad 22 1c a4 d3 1d df 13 50 92 39 01 93 98\ -e3 d1 4b 32 dc 34 dc 5a f4 ae ae a3 c0 95 af 73\ -47 9c f0 a4 5e 56 29 63 5a 53 a0 18 37 76 15 b1\ -6c b9 b1 3b 3e 09 d6 71 eb 71 e3 87 b8 54 5c 59\ -60 da 5a 64 77 6e 76 8e 82 b2 c9 35 83 bf 10 4c\ -3f db 23 51 2b 7b 4e 89 f6 33 dd 00 63 a5 30 db\ -45 24 b0 1c 3f 38 4c 09 31 0e 31 5a 79 dc d3 d6\ -84 02 2a 7f 31 c8 65 a6 64 e3 16 97 8b 75 9f ad -Test: Verify -Comment: RSASSA-PSS Signature Example 1.6 -Message: \ -10 aa e9 a0 ab 0b 59 5d 08 41 20 7b 70 0d 48 d7\ -5f ae dd e3 b7 75 cd 6b 4c c8 8a e0 6e 46 94 ec\ -74 ba 18 f8 52 0d 4f 5e a6 9c bb e7 cc 2b eb a4\ -3e fd c1 02 15 ac 4e b3 2d c3 02 a1 f5 3d c6 c4\ -35 22 67 e7 93 6c fe bf 7c 8d 67 03 57 84 a3 90\ -9f a8 59 c7 b7 b5 9b 8e 39 c5 c2 34 9f 18 86 b7\ -05 a3 02 67 d4 02 f7 48 6a b4 f5 8c ad 5d 69 ad\ -b1 7a b8 cd 0c e1 ca f5 02 5a f4 ae 24 b1 fb 87\ -94 c6 07 0c c0 9a 51 e2 f9 91 13 11 e3 87 7d 00\ -44 c7 1c 57 a9 93 39 50 08 80 6b 72 3a c3 83 73\ -d3 95 48 18 18 52 8c 1e 70 53 73 92 82 05 35 29\ -51 0e 93 5c d0 fa 77 b8 fa 53 cc 2d 47 4b d4 fb\ -3c c5 c6 72 d6 ff dc 90 a0 0f 98 48 71 2c 4b cf\ -e4 6c 60 57 36 59 b1 1e 64 57 e8 61 f0 f6 04 b6\ -13 8d 14 4f 8c e4 e2 da 73 -Salt: \ -a8 ab 69 dd 80 1f 00 74 c2 a1 fc 60 64 98 36 c6\ -16 d9 96 81 -Signature: \ -2a 34 f6 12 5e 1f 6b 0b f9 71 e8 4f bd 41 c6 32\ -be 8f 2c 2a ce 7d e8 b6 92 6e 31 ff 93 e9 af 98\ -7f bc 06 e5 1e 9b e1 4f 51 98 f9 1f 3f 95 3b d6\ -7d a6 0a 9d f5 97 64 c3 dc 0f e0 8e 1c be f0 b7\ -5f 86 8d 10 ad 3f ba 74 9f ef 59 fb 6d ac 46 a0\ -d6 e5 04 36 93 31 58 6f 58 e4 62 8f 39 aa 27 89\ -82 54 3b c0 ee b5 37 dc 61 95 80 19 b3 94 fb 27\ -3f 21 58 58 a0 a0 1a c4 d6 50 b9 55 c6 7f 4c 58 -Test: Verify -Comment: Example 2: A 1025-bit RSA Key Pair -Modulus: \ -01 d4 0c 1b cf 97 a6 8a e7 cd bd 8a 7b f3 e3 4f\ -a1 9d cc a4 ef 75 a4 74 54 37 5f 94 51 4d 88 fe\ -d0 06 fb 82 9f 84 19 ff 87 d6 31 5d a6 8a 1f f3\ -a0 93 8e 9a bb 34 64 01 1c 30 3a d9 91 99 cf 0c\ -7c 7a 8b 47 7d ce 82 9e 88 44 f6 25 b1 15 e5 e9\ -c4 a5 9c f8 f8 11 3b 68 34 33 6a 2f d2 68 9b 47\ -2c bb 5e 5c ab e6 74 35 0c 59 b6 c1 7e 17 68 74\ -fb 42 f8 fc 3d 17 6a 01 7e dc 61 fd 32 6c 4b 33\ -c9 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -02 7d 14 7e 46 73 05 73 77 fd 1e a2 01 56 57 72\ -17 6a 7d c3 83 58 d3 76 04 56 85 a2 e7 87 c2 3c\ -15 57 6b c1 6b 9f 44 44 02 d6 bf c5 d9 8a 3e 88\ -ea 13 ef 67 c3 53 ec a0 c0 dd ba 92 55 bd 7b 8b\ -b5 0a 64 4a fd fd 1d d5 16 95 b2 52 d2 2e 73 18\ -d1 b6 68 7a 1c 10 ff 75 54 5f 3d b0 fe 60 2d 5f\ -2b 7f 29 4e 36 01 ea b7 b9 d1 ce cd 76 7f 64 69\ -2e 3e 53 6c a2 84 6c b0 c2 dd 48 6a 39 fa 75 b1 -Prime1: \ -01 66 01 e9 26 a0 f8 c9 e2 6e ca b7 69 ea 65 a5\ -e7 c5 2c c9 e0 80 ef 51 94 57 c6 44 da 68 91 c5\ -a1 04 d3 ea 79 55 92 9a 22 e7 c6 8a 7a f9 fc ad\ -77 7c 3c cc 2b 9e 3d 36 50 bc e4 04 39 9b 7e 59\ -d1 -Prime2: \ -01 4e af a1 d4 d0 18 4d a7 e3 1f 87 7d 12 81 dd\ -da 62 56 64 86 9e 83 79 e6 7a d3 b7 5e ae 74 a5\ -80 e9 82 7a bd 6e b7 a0 02 cb 54 11 f5 26 67 97\ -76 8f b8 e9 5a e4 0e 3e 8a 01 f3 5f f8 9e 56 c0\ -79 -ModPrime1PrivateExponent: \ -e2 47 cc e5 04 93 9b 8f 0a 36 09 0d e2 00 93 87\ -55 e2 44 4b 29 53 9a 7d a7 a9 02 f6 05 68 35 c0\ -db 7b 52 55 94 97 cf e2 c6 1a 80 86 d0 21 3c 47\ -2c 78 85 18 00 b1 71 f6 40 1d e2 e9 c2 75 6f 31 -ModPrime2PrivateExponent: \ -b1 2f ba 75 78 55 e5 86 e4 6f 64 c3 8a 70 c6 8b\ -3f 54 8d 93 d7 87 b3 99 99 9d 4c 8f 0b bd 25 81\ -c2 1e 19 ed 00 18 a6 d5 d3 df 86 42 4b 3a bc ad\ -40 19 9d 31 49 5b 61 30 9f 27 c1 bf 55 d4 87 c1 -MultiplicativeInverseOfPrime2ModPrime1: \ -56 4b 1e 1f a0 03 bd a9 1e 89 09 04 25 aa c0 5b\ -91 da 9e e2 50 61 e7 62 8d 5f 51 30 4a 84 99 2f\ -dc 33 76 2b d3 78 a5 9f 03 0a 33 4d 53 2b d0 da\ -e8 f2 98 ea 9e d8 44 63 6a d5 fb 8c bd c0 3c ad -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 2.1 -Message: \ -da ba 03 20 66 26 3f ae db 65 98 48 11 52 78 a5\ -2c 44 fa a3 a7 6f 37 51 5e d3 36 32 10 72 c4 0a\ -9d 9b 53 bc 05 01 40 78 ad f5 20 87 51 46 aa e7\ -0f f0 60 22 6d cb 7b 1f 1f c2 7e 93 60 -Salt: \ -57 bf 16 0b cb 02 bb 1d c7 28 0c f0 45 85 30 b7\ -d2 83 2f f7 -Signature: \ -01 4c 5b a5 33 83 28 cc c6 e7 a9 0b f1 c0 ab 3f\ -d6 06 ff 47 96 d3 c1 2e 4b 63 9e d9 13 6a 5f ec\ -6c 16 d8 88 4b dd 99 cf dc 52 14 56 b0 74 2b 73\ -68 68 cf 90 de 09 9a db 8d 5f fd 1d ef f3 9b a4\ -00 7a b7 46 ce fd b2 2d 7d f0 e2 25 f5 46 27 dc\ -65 46 61 31 72 1b 90 af 44 53 63 a8 35 8b 9f 60\ -76 42 f7 8f ab 0a b0 f4 3b 71 68 d6 4b ae 70 d8\ -82 78 48 d8 ef 1e 42 1c 57 54 dd f4 2c 25 89 b5\ -b3 -Test: Verify -Comment: RSASSA-PSS Signature Example 2.2 -Message: \ -e4 f8 60 1a 8a 6d a1 be 34 44 7c 09 59 c0 58 57\ -0c 36 68 cf d5 1d d5 f9 cc d6 ad 44 11 fe 82 13\ -48 6d 78 a6 c4 9f 93 ef c2 ca 22 88 ce bc 2b 9b\ -60 bd 04 b1 e2 20 d8 6e 3d 48 48 d7 09 d0 32 d1\ -e8 c6 a0 70 c6 af 9a 49 9f cf 95 35 4b 14 ba 61\ -27 c7 39 de 1b b0 fd 16 43 1e 46 93 8a ec 0c f8\ -ad 9e b7 2e 83 2a 70 35 de 9b 78 07 bd c0 ed 8b\ -68 eb 0f 5a c2 21 6b e4 0c e9 20 c0 db 0e dd d3\ -86 0e d7 88 ef ac ca ca 50 2d 8f 2b d6 d1 a7 c1\ -f4 1f f4 6f 16 81 c8 f1 f8 18 e9 c4 f6 d9 1a 0c\ -78 03 cc c6 3d 76 a6 54 4d 84 3e 08 4e 36 3b 8a\ -cc 55 aa 53 17 33 ed b5 de e5 b5 19 6e 9f 03 e8\ -b7 31 b3 77 64 28 d9 e4 57 fe 3f bc b3 db 72 74\ -44 2d 78 58 90 e9 cb 08 54 b6 44 4d ac e7 91 d7\ -27 3d e1 88 97 19 33 8a 77 fe -Salt: \ -7f 6d d3 59 e6 04 e6 08 70 e8 98 e4 7b 19 bf 2e\ -5a 7b 2a 90 -Signature: \ -01 09 91 65 6c ca 18 2b 7f 29 d2 db c0 07 e7 ae\ -0f ec 15 8e b6 75 9c b9 c4 5c 5f f8 7c 76 35 dd\ -46 d1 50 88 2f 4d e1 e9 ae 65 e7 f7 d9 01 8f 68\ -36 95 4a 47 c0 a8 1a 8a 6b 6f 83 f2 94 4d 60 81\ -b1 aa 7c 75 9b 25 4b 2c 34 b6 91 da 67 cc 02 26\ -e2 0b 2f 18 b4 22 12 76 1d cd 4b 90 8a 62 b3 71\ -b5 91 8c 57 42 af 4b 53 7e 29 69 17 67 4f b9 14\ -19 47 61 62 1c c1 9a 41 f6 fb 95 3f bc bb 64 9d\ -ea -Test: Verify -Comment: RSASSA-PSS Signature Example 2.3 -Message: \ -52 a1 d9 6c 8a c3 9e 41 e4 55 80 98 01 b9 27 a5\ -b4 45 c1 0d 90 2a 0d cd 38 50 d2 2a 66 d2 bb 07\ -03 e6 7d 58 67 11 45 95 aa bf 5a 7a eb 5a 8f 87\ -03 4b bb 30 e1 3c fd 48 17 a9 be 76 23 00 23 60\ -6d 02 86 a3 fa f8 a4 d2 2b 72 8e c5 18 07 9f 9e\ -64 52 6e 3a 0c c7 94 1a a3 38 c4 37 99 7c 68 0c\ -ca c6 7c 66 bf a1 -Salt: \ -fc a8 62 06 8b ce 22 46 72 4b 70 8a 05 19 da 17\ -e6 48 68 8c -Signature: \ -00 7f 00 30 01 8f 53 cd c7 1f 23 d0 36 59 fd e5\ -4d 42 41 f7 58 a7 50 b4 2f 18 5f 87 57 85 20 c3\ -07 42 af d8 43 59 b6 e6 e8 d3 ed 95 9d c6 fe 48\ -6b ed c8 e2 cf 00 1f 63 a7 ab e1 62 56 a1 b8 4d\ -f0 d2 49 fc 05 d3 19 4c e5 f0 91 27 42 db bf 80\ -dd 17 4f 6c 51 f6 ba d7 f1 6c f3 36 4e ba 09 5a\ -06 26 7d c3 79 38 03 ac 75 26 ae be 0a 47 5d 38\ -b8 c2 24 7a b5 1c 48 98 df 70 47 dc 6a df 52 c6\ -c4 -Test: Verify -Comment: RSASSA-PSS Signature Example 2.4 -Message: \ -a7 18 2c 83 ac 18 be 65 70 a1 06 aa 9d 5c 4e 3d\ -bb d4 af ae b0 c6 0c 4a 23 e1 96 9d 79 ff -Salt: \ -80 70 ef 2d e9 45 c0 23 87 68 4b a0 d3 30 96 73\ -22 35 d4 40 -Signature: \ -00 9c d2 f4 ed be 23 e1 23 46 ae 8c 76 dd 9a d3\ -23 0a 62 07 61 41 f1 6c 15 2b a1 85 13 a4 8e f6\ -f0 10 e0 e3 7f d3 df 10 a1 ec 62 9a 0c b5 a3 b5\ -d2 89 30 07 29 8c 30 93 6a 95 90 3b 6b a8 55 55\ -d9 ec 36 73 a0 61 08 fd 62 a2 fd a5 6d 1c e2 e8\ -5c 4d b6 b2 4a 81 ca 3b 49 6c 36 d4 fd 06 eb 7c\ -91 66 d8 e9 48 77 c4 2b ea 62 2b 3b fe 92 51 fd\ -c2 1d 8d 53 71 ba da d7 8a 48 82 14 79 63 35 b4\ -0b -Test: Verify -Comment: RSASSA-PSS Signature Example 2.5 -Message: \ -86 a8 3d 4a 72 ee 93 2a 4f 56 30 af 65 79 a3 86\ -b7 8f e8 89 99 e0 ab d2 d4 90 34 a4 bf c8 54 dd\ -94 f1 09 4e 2e 8c d7 a1 79 d1 95 88 e4 ae fc 1b\ -1b d2 5e 95 e3 dd 46 1f -Salt: \ -17 63 9a 4e 88 d7 22 c4 fc a2 4d 07 9a 8b 29 c3\ -24 33 b0 c9 -Signature: \ -00 ec 43 08 24 93 1e bd 3b aa 43 03 4d ae 98 ba\ -64 6b 8c 36 01 3d 16 71 c3 cf 1c f8 26 0c 37 4b\ -19 f8 e1 cc 8d 96 50 12 40 5e 7e 9b f7 37 86 12\ -df cc 85 fc e1 2c da 11 f9 50 bd 0b a8 87 67 40\ -43 6c 1d 25 95 a6 4a 1b 32 ef cf b7 4a 21 c8 73\ -b3 cc 33 aa f4 e3 dc 39 53 de 67 f0 67 4c 04 53\ -b4 fd 9f 60 44 06 d4 41 b8 16 09 8c b1 06 fe 34\ -72 bc 25 1f 81 5f 59 db 2e 43 78 a3 ad dc 18 1e\ -cf -Test: Verify -Comment: RSASSA-PSS Signature Example 2.6 -Message: \ -04 9f 91 54 d8 71 ac 4a 7c 7a b4 53 25 ba 75 45\ -a1 ed 08 f7 05 25 b2 66 7c f1 -Salt: \ -37 81 0d ef 10 55 ed 92 2b 06 3d f7 98 de 5d 0a\ -ab f8 86 ee -Signature: \ -00 47 5b 16 48 f8 14 a8 dc 0a bd c3 7b 55 27 f5\ -43 b6 66 bb 6e 39 d3 0e 5b 49 d3 b8 76 dc cc 58\ -ea c1 4e 32 a2 d5 5c 26 16 01 44 56 ad 2f 24 6f\ -c8 e3 d5 60 da 3d df 37 9a 1c 0b d2 00 f1 02 21\ -df 07 8c 21 9a 15 1b c8 d4 ec 9d 2f c2 56 44 67\ -81 10 14 ef 15 d8 ea 01 c2 eb bf f8 c2 c8 ef ab\ -38 09 6e 55 fc be 32 85 c7 aa 55 88 51 25 4f af\ -fa 92 c1 c7 2b 78 75 86 63 ef 45 82 84 31 39 d7\ -a6 -Test: Verify -Comment: Example 3: A 1026-bit RSA Key Pair -Modulus: \ -02 f2 46 ef 45 1e d3 ee bb 9a 31 02 00 cc 25 85\ -9c 04 8e 4b e7 98 30 29 91 11 2e b6 8c e6 db 67\ -4e 28 0d a2 1f ed ed 1a e7 48 80 ca 52 2b 18 db\ -24 93 85 01 28 27 c5 15 f0 e4 66 a1 ff a6 91 d9\ -81 70 57 4e 9d 0e ad b0 87 58 6c a4 89 33 da 3c\ -c9 53 d9 5b d0 ed 50 de 10 dd cb 67 36 10 7d 6c\ -83 1c 7f 66 3e 83 3c a4 c0 97 e7 00 ce 0f b9 45\ -f8 8f b8 5f e8 e5 a7 73 17 25 65 b9 14 a4 71 a4\ -43 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -65 14 51 73 3b 56 de 5a c0 a6 89 a4 ae b6 e6 89\ -4a 69 01 4e 07 6c 88 dd 7a 66 7e ab 32 32 bb cc\ -d2 fc 44 ba 2f a9 c3 1d b4 6f 21 ed d1 fd b2 3c\ -5c 12 8a 5d a5 ba b9 1e 7f 95 2b 67 75 9c 7c ff\ -70 54 15 ac 9f a0 90 7c 7c a6 17 8f 66 8f b9 48\ -d8 69 da 4c c3 b7 35 6f 40 08 df d5 44 9d 32 ee\ -02 d9 a4 77 eb 69 fc 29 26 6e 5d 90 70 51 23 75\ -a5 0f bb cc 27 e2 38 ad 98 42 5f 6e bb f8 89 91 -Prime1: \ -01 bd 36 e1 8e ce 4b 0f db 2e 9c 9d 54 8b d1 a7\ -d6 e2 c2 1c 6f dc 35 07 4a 1d 05 b1 c6 c8 b3 d5\ -58 ea 26 39 c9 a9 a4 21 68 01 69 31 72 52 55 8b\ -d1 48 ad 21 5a ac 55 0e 2d cf 12 a8 2d 0e bf e8\ -53 -Prime2: \ -01 b1 b6 56 ad 86 d8 e1 9d 5d c8 62 92 b3 a1 92\ -fd f6 e0 dd 37 87 7b ad 14 82 2f a0 01 90 ca b2\ -65 f9 0d 3f 02 05 7b 6f 54 d6 ec b1 44 91 e5 ad\ -ea ce bc 48 bf 0e bd 2a 2a d2 6d 40 2e 54 f6 16\ -51 -ModPrime1PrivateExponent: \ -1f 27 79 fd 2e 3e 5e 6b ae 05 53 95 18 fb a0 cd\ -0e ad 1a a4 51 3a 7c ba 18 f1 cf 10 e3 f6 81 95\ -69 3d 27 8a 0f 0e e7 2f 89 f9 bc 76 0d 80 e2 f9\ -d0 26 1d 51 65 01 c6 ae 39 f1 4a 47 6c e2 cc f5 -ModPrime2PrivateExponent: \ -01 1a 0d 36 79 4b 04 a8 54 aa b4 b2 46 2d 43 9a\ -50 46 c9 1d 94 0b 2b c6 f7 5b 62 95 6f ef 35 a2\ -a6 e6 3c 53 09 81 7f 30 7b bf f9 d5 9e 7e 33 1b\ -d3 63 f6 d6 68 49 b1 83 46 ad ea 16 9f 0a e9 ae\ -c1 -MultiplicativeInverseOfPrime2ModPrime1: \ -0b 30 f0 ec f5 58 75 2f b3 a6 ce 4b a2 b8 c6 75\ -f6 59 eb a6 c3 76 58 5a 1b 39 71 2d 03 8a e3 d2\ -b4 6f cb 41 8a e1 5d 09 05 da 64 40 e1 51 3a 30\ -b9 b7 d6 66 8f bc 5e 88 e5 ab 7a 17 5e 73 ba 35 -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 3.1 -Message: \ -59 4b 37 33 3b bb 2c 84 52 4a 87 c1 a0 1f 75 fc\ -ec 0e 32 56 f1 08 e3 8d ca 36 d7 0d 00 57 -Salt: \ -f3 1a d6 c8 cf 89 df 78 ed 77 fe ac bc c2 f8 b0\ -a8 e4 cf aa -Signature: \ -00 88 b1 35 fb 17 94 b6 b9 6c 4a 3e 67 81 97 f8\ -ca c5 2b 64 b2 fe 90 7d 6f 27 de 76 11 24 96 4a\ -99 a0 1a 88 27 40 ec fa ed 6c 01 a4 74 64 bb 05\ -18 23 13 c0 13 38 a8 cd 09 72 14 cd 68 ca 10 3b\ -d5 7d 3b c9 e8 16 21 3e 61 d7 84 f1 82 46 7a bf\ -8a 01 cf 25 3e 99 a1 56 ea a8 e3 e1 f9 0e 3c 6e\ -4e 3a a2 d8 3e d0 34 5b 89 fa fc 9c 26 07 7c 14\ -b6 ac 51 45 4f a2 6e 44 6e 3a 2f 15 3b 2b 16 79\ -7f -Test: Verify -Comment: RSASSA-PSS Signature Example 3.2 -Message: \ -8b 76 95 28 88 4a 0d 1f fd 09 0c f1 02 99 3e 79\ -6d ad cf bd dd 38 e4 4f f6 32 4c a4 51 -Salt: \ -fc f9 f0 e1 f1 99 a3 d1 d0 da 68 1c 5b 86 06 fc\ -64 29 39 f7 -Signature: \ -02 a5 f0 a8 58 a0 86 4a 4f 65 01 7a 7d 69 45 4f\ -3f 97 3a 29 99 83 9b 7b bc 48 bf 78 64 11 69 17\ -95 56 f5 95 fa 41 f6 ff 18 e2 86 c2 78 30 79 bc\ -09 10 ee 9c c3 4f 49 ba 68 11 24 f9 23 df a8 8f\ -42 61 41 a3 68 a5 f5 a9 30 c6 28 c2 c3 c2 00 e1\ -8a 76 44 72 1a 0c be c6 dd 3f 62 79 bd e3 e8 f2\ -be 5e 2d 4e e5 6f 97 e7 ce af 33 05 4b e7 04 2b\ -d9 1a 63 bb 09 f8 97 bd 41 e8 11 97 de e9 9b 11\ -af -Test: Verify -Comment: RSASSA-PSS Signature Example 3.3 -Message: \ -1a bd ba 48 9c 5a da 2f 99 5e d1 6f 19 d5 a9 4d\ -9e 6e c3 4a 8d 84 f8 45 57 d2 6e 5e f9 b0 2b 22\ -88 7e 3f 9a 4b 69 0a d1 14 92 09 c2 0c 61 43 1f\ -0c 01 7c 36 c2 65 7b 35 d7 b0 7d 3f 5a d8 70 85\ -07 a9 c1 b8 31 df 83 5a 56 f8 31 07 18 14 ea 5d\ -3d 8d 8f 6a de 40 cb a3 8b 42 db 7a 2d 3d 7a 29\ -c8 f0 a7 9a 78 38 cf 58 a9 75 7f a2 fe 4c 40 df\ -9b aa 19 3b fc 6f 92 b1 23 ad 57 b0 7a ce 3e 6a\ -c0 68 c9 f1 06 af d9 ee b0 3b 4f 37 c2 5d bf bc\ -fb 30 71 f6 f9 77 17 66 d0 72 f3 bb 07 0a f6 60\ -55 32 97 3a e2 50 51 -Salt: \ -98 6e 7c 43 db b6 71 bd 41 b9 a7 f4 b6 af c8 0e\ -80 5f 24 23 -Signature: \ -02 44 bc d1 c8 c1 69 55 73 6c 80 3b e4 01 27 2e\ -18 cb 99 08 11 b1 4f 72 db 96 41 24 d5 fa 76 06\ -49 cb b5 7a fb 87 55 db b6 2b f5 1f 46 6c f2 3a\ -0a 16 07 57 6e 98 3d 77 8f ce ff a9 2d f7 54 8a\ -ea 8e a4 ec ad 2c 29 dd 9f 95 bc 07 fe 91 ec f8\ -be e2 55 bf e8 76 2f d7 69 0a a9 bf a4 fa 08 49\ -ef 72 8c 2c 42 c4 53 23 64 52 2d f2 ab 7f 9f 8a\ -03 b6 3f 7a 49 91 75 82 86 68 f5 ef 5a 29 e3 80\ -2c -Test: Verify -Comment: RSASSA-PSS Signature Example 3.4 -Message: \ -8f b4 31 f5 ee 79 2b 6c 2a c7 db 53 cc 42 86 55\ -ae b3 2d 03 f4 e8 89 c5 c2 5d e6 83 c4 61 b5 3a\ -cf 89 f9 f8 d3 aa bd f6 b9 f0 c2 a1 de 12 e1 5b\ -49 ed b3 91 9a 65 2f e9 49 1c 25 a7 fc e1 f7 22\ -c2 54 36 08 b6 9d c3 75 ec -Salt: \ -f8 31 2d 9c 8e ea 13 ec 0a 4c 7b 98 12 0c 87 50\ -90 87 c4 78 -Signature: \ -01 96 f1 2a 00 5b 98 12 9c 8d f1 3c 4c b1 6f 8a\ -a8 87 d3 c4 0d 96 df 3a 88 e7 53 2e f3 9c d9 92\ -f2 73 ab c3 70 bc 1b e6 f0 97 cf eb bf 01 18 fd\ -9e f4 b9 27 15 5f 3d f2 2b 90 4d 90 70 2d 1f 7b\ -a7 a5 2b ed 8b 89 42 f4 12 cd 7b d6 76 c9 d1 8e\ -17 03 91 dc d3 45 c0 6a 73 09 64 b3 f3 0b cc e0\ -bb 20 ba 10 6f 9a b0 ee b3 9c f8 a6 60 7f 75 c0\ -34 7f 0a f7 9f 16 af a0 81 d2 c9 2d 1e e6 f8 36\ -b8 -Test: Verify -Comment: RSASSA-PSS Signature Example 3.5 -Message: \ -fe f4 16 1d fa af 9c 52 95 05 1d fc 1f f3 81 0c\ -8c 9e c2 e8 66 f7 07 54 22 c8 ec 42 16 a9 c4 ff\ -49 42 7d 48 3c ae 10 c8 53 4a 41 b2 fd 15 fe e0\ -69 60 ec 6f b3 f7 a7 e9 4a 2f 8a 2e 3e 43 dc 4a\ -40 57 6c 30 97 ac 95 3b 1d e8 6f 0b 4e d3 6d 64\ -4f 23 ae 14 42 55 29 62 24 64 ca 0c bf 0b 17 41\ -34 72 38 15 7f ab 59 e4 de 55 24 09 6d 62 ba ec\ -63 ac 64 -Salt: \ -50 32 7e fe c6 29 2f 98 01 9f c6 7a 2a 66 38 56\ -3e 9b 6e 2d -Signature: \ -02 1e ca 3a b4 89 22 64 ec 22 41 1a 75 2d 92 22\ -10 76 d4 e0 1c 0e 6f 0d de 9a fd 26 ba 5a cf 6d\ -73 9e f9 87 54 5d 16 68 3e 56 74 c9 e7 0f 1d e6\ -49 d7 e6 1d 48 d0 ca eb 4f b4 d8 b2 4f ba 84 a6\ -e3 10 8f ee 7d 07 05 97 32 66 ac 52 4b 4a d2 80\ -f7 ae 17 dc 59 d9 6d 33 51 58 6b 5a 3b db 89 5d\ -1e 1f 78 20 ac 61 35 d8 75 34 80 99 83 82 ba 32\ -b7 34 95 59 60 8c 38 74 52 90 a8 5e f4 e9 f9 bd\ -83 -Test: Verify -Comment: RSASSA-PSS Signature Example 3.6 -Message: \ -ef d2 37 bb 09 8a 44 3a ee b2 bf 6c 3f 8c 81 b8\ -c0 1b 7f cb 3f eb -Salt: \ -b0 de 3f c2 5b 65 f5 af 96 b1 d5 cc 3b 27 d0 c6\ -05 30 87 b3 -Signature: \ -01 2f af ec 86 2f 56 e9 e9 2f 60 ab 0c 77 82 4f\ -42 99 a0 ca 73 4e d2 6e 06 44 d5 d2 22 c7 f0 bd\ -e0 39 64 f8 e7 0a 5c b6 5e d4 4e 44 d5 6a e0 ed\ -f1 ff 86 ca 03 2c c5 dd 44 04 db b7 6a b8 54 58\ -6c 44 ee d8 33 6d 08 d4 57 ce 6c 03 69 3b 45 c0\ -f1 ef ef 93 62 4b 95 b8 ec 16 9c 61 6d 20 e5 53\ -8e bc 0b 67 37 a6 f8 2b 4b c0 57 09 24 fc 6b 35\ -75 9a 33 48 42 62 79 f8 b3 d7 74 4e 2d 22 24 26\ -ce -Test: Verify -Comment: Example 4: A 1027-bit RSA Key Pair -Modulus: \ -05 4a db 78 86 44 7e fe 6f 57 e0 36 8f 06 cf 52\ -b0 a3 37 07 60 d1 61 ce f1 26 b9 1b e7 f8 9c 42\ -1b 62 a6 ec 1d a3 c3 11 d7 5e d5 0e 0a b5 ff f3\ -fd 33 8a cc 3a a8 a4 e7 7e e2 63 69 ac b8 1b a9\ -00 fa 83 f5 30 0c f9 bb 6c 53 ad 1d c8 a1 78 b8\ -15 db 42 35 a9 a9 da 0c 06 de 4e 61 5e a1 27 7c\ -e5 59 e9 c1 08 de 58 c1 4a 81 aa 77 f5 a6 f8 d1\ -33 54 94 49 88 48 c8 b9 59 40 74 0b e7 bf 7c 37\ -05 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -fa 04 1f 8c d9 69 7c ee d3 8e c8 ca a2 75 52 3b\ -4d d7 2b 09 a3 01 d3 54 1d 72 f5 d3 1c 05 cb ce\ -2d 69 83 b3 61 83 af 10 69 0b d4 6c 46 13 1e 35\ -78 94 31 a5 56 77 1d d0 04 9b 57 46 1b f0 60 c1\ -f6 84 72 e8 a6 7c 25 f3 57 e5 b6 b4 73 8f a5 41\ -a7 30 34 6b 4a 07 64 9a 2d fa 80 6a 69 c9 75 b6\ -ab a6 46 78 ac c7 f5 91 3e 89 c6 22 f2 d8 ab b1\ -e3 e3 25 54 e3 9d f9 4b a6 0c 00 2e 38 7d 90 11 -Prime1: \ -02 92 32 33 6d 28 38 94 5d ba 9d d7 72 3f 4e 62\ -4a 05 f7 37 5b 92 7a 87 ab e6 a8 93 a1 65 8f d4\ -9f 47 f6 c7 b0 fa 59 6c 65 fa 68 a2 3f 0a b4 32\ -96 2d 18 d4 34 3b d6 fd 67 1a 5e a8 d1 48 41 39\ -95 -Prime2: \ -02 0e f5 ef e7 c5 39 4a ed 22 72 f7 e8 1a 74 f4\ -c0 2d 14 58 94 cb 1b 3c ab 23 a9 a0 71 0a 2a fc\ -7e 33 29 ac bb 74 3d 01 f6 80 c4 d0 2a fb 4c 8f\ -de 7e 20 93 08 11 bb 2b 99 57 88 b5 e8 72 c2 0b\ -b1 -ModPrime1PrivateExponent: \ -02 6e 7e 28 01 0e cf 24 12 d9 52 3a d7 04 64 7f\ -b4 fe 9b 66 b1 a6 81 58 1b 0e 15 55 3a 89 b1 54\ -28 28 89 8f 27 24 3e ba b4 5f f5 e1 ac b9 d4 df\ -1b 05 1f bc 62 82 4d bc 6f 6c 93 26 1a 78 b9 a7\ -59 -ModPrime2PrivateExponent: \ -01 2d dc c8 6e f6 55 99 8c 39 dd ae 11 71 86 69\ -e5 e4 6c f1 49 5b 07 e1 3b 10 14 cd 69 b3 af 68\ -30 4a d2 a6 b6 43 21 e7 8b f3 bb ca 9b b4 94 e9\ -1d 45 17 17 e2 d9 75 64 c6 54 94 65 d0 20 5c f4\ -21 -MultiplicativeInverseOfPrime2ModPrime1: \ -01 06 00 c4 c2 18 47 45 9f e5 76 70 3e 2e be ca\ -e8 a5 09 4e e6 3f 53 6b f4 ac 68 d3 c1 3e 5e 4f\ -12 ac 5c c1 0a b6 a2 d0 5a 19 92 14 d1 82 47 47\ -d5 51 90 96 36 b7 74 c2 2c ac 0b 83 75 99 ab cc\ -75 -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 4.1 -Message: \ -9f b0 3b 82 7c 82 17 d9 -Salt: \ -ed 7c 98 c9 5f 30 97 4f be 4f bd dc f0 f2 8d 60\ -21 c0 e9 1d -Signature: \ -03 23 d5 b7 bf 20 ba 45 39 28 9a e4 52 ae 42 97\ -08 0f ef f4 51 84 23 ff 48 11 a8 17 83 7e 7d 82\ -f1 83 6c df ab 54 51 4f f0 88 7b dd ee bf 40 bf\ -99 b0 47 ab c3 ec fa 6a 37 a3 ef 00 f4 a0 c4 a8\ -8a ae 09 04 b7 45 c8 46 c4 10 7e 87 97 72 3e 8a\ -c8 10 d9 e3 d9 5d fa 30 ff 49 66 f4 d7 5d 13 76\ -8d 20 85 7f 2b 14 06 f2 64 cf e7 5e 27 d7 65 2f\ -4b 5e d3 57 5f 28 a7 02 f8 c4 ed 9c f9 b2 d4 49\ -48 -Test: Verify -Comment: RSASSA-PSS Signature Example 4.2 -Message: \ -0c a2 ad 77 79 7e ce 86 de 5b f7 68 75 0d db 5e\ -d6 a3 11 6a d9 9b bd 17 ed f7 f7 82 f0 db 1c d0\ -5b 0f 67 74 68 c5 ea 42 0d c1 16 b1 0e 80 d1 10\ -de 2b 04 61 ea 14 a3 8b e6 86 20 39 2e 7e 89 3c\ -b4 ea 93 93 fb 88 6c 20 ff 79 06 42 30 5b f3 02\ -00 38 92 e5 4d f9 f6 67 50 9d c5 39 20 df 58 3f\ -50 a3 dd 61 ab b6 fa b7 5d 60 03 77 e3 83 e6 ac\ -a6 71 0e ee a2 71 56 e0 67 52 c9 4c e2 5a e9 9f\ -cb f8 59 2d be 2d 7e 27 45 3c b4 4d e0 71 00 eb\ -b1 a2 a1 98 11 a4 78 ad be ab 27 0f 94 e8 fe 36\ -9d 90 b3 ca 61 2f 9f -Salt: \ -22 d7 1d 54 36 3a 42 17 aa 55 11 3f 05 9b 33 84\ -e3 e5 7e 44 -Signature: \ -04 9d 01 85 84 5a 26 4d 28 fe b1 e6 9e da ec 09\ -06 09 e8 e4 6d 93 ab b3 83 71 ce 51 f4 aa 65 a5\ -99 bd aa a8 1d 24 fb a6 6a 08 a1 16 cb 64 4f 3f\ -1e 65 3d 95 c8 9d b8 bb d5 da ac 27 09 c8 98 40\ -00 17 84 10 a7 c6 aa 86 67 dd c3 8c 74 1f 71 0e\ -c8 66 5a a9 05 2b e9 29 d4 e3 b1 67 82 c1 66 21\ -14 c5 41 4b b0 35 34 55 c3 92 fc 28 f3 db 59 05\ -4b 5f 36 5c 49 e1 d1 56 f8 76 ee 10 cb 4f d7 05\ -98 -Test: Verify -Comment: RSASSA-PSS Signature Example 4.3 -Message: \ -28 80 62 af c0 8f cd b7 c5 f8 65 0b 29 83 73 00\ -46 1d d5 67 6c 17 a2 0a 3c 8f b5 14 89 49 e3 f7\ -3d 66 b3 ae 82 c7 24 0e 27 c5 b3 ec 43 28 ee 7d\ -6d df 6a 6a 0c 9b 5b 15 bc da 19 6a 9d 0c 76 b1\ -19 d5 34 d8 5a bd 12 39 62 d5 83 b7 6c e9 d1 80\ -bc e1 ca -Salt: \ -4a f8 70 fb c6 51 60 12 ca 91 6c 70 ba 86 2a c7\ -e8 24 36 17 -Signature: \ -03 fb c4 10 a2 ce d5 95 00 fb 99 f9 e2 af 27 81\ -ad a7 4e 13 14 56 24 60 27 82 e2 99 48 13 ee fc\ -a0 51 9e cd 25 3b 85 5f b6 26 a9 0d 77 1e ae 02\ -8b 0c 47 a1 99 cb d9 f8 e3 26 97 34 af 41 63 59\ -90 90 71 3a 3f a9 10 fa 09 60 65 27 21 43 2b 97\ -10 36 a7 18 1a 2b c0 ca b4 3b 0b 59 8b c6 21 74\ -61 d7 db 30 5f f7 e9 54 c5 b5 bb 23 1c 39 e7 91\ -af 6b cf a7 6b 14 7b 08 13 21 f7 26 41 48 2a 2a\ -ad -Test: Verify -Comment: RSASSA-PSS Signature Example 4.4 -Message: \ -6f 4f 9a b9 50 11 99 ce f5 5c 6c f4 08 fe 7b 36\ -c5 57 c4 9d 42 0a 47 63 d2 46 3c 8a d4 4b 3c fc\ -5b e2 74 2c 0e 7d 9b 0f 66 08 f0 8c 7f 47 b6 93\ -ee -Salt: \ -40 d2 e1 80 fa e1 ea c4 39 c1 90 b5 6c 2c 0e 14\ -dd f9 a2 26 -Signature: \ -04 86 64 4b c6 6b f7 5d 28 33 5a 61 79 b1 08 51\ -f4 3f 09 bd ed 9f ac 1a f3 32 52 bb 99 53 ba 42\ -98 cd 64 66 b2 75 39 a7 0a da a3 f8 9b 3d b3 c7\ -4a b6 35 d1 22 f4 ee 7c e5 57 a6 1e 59 b8 2f fb\ -78 66 30 e5 f9 db 53 c7 7d 9a 0c 12 fa b5 95 8d\ -4c 2c e7 da a8 07 cd 89 ba 2c c7 fc d0 2f f4 70\ -ca 67 b2 29 fc ce 81 4c 85 2c 73 cc 93 be a3 5b\ -e6 84 59 ce 47 8e 9d 46 55 d1 21 c8 47 2f 37 1d\ -4f -Test: Verify -Comment: RSASSA-PSS Signature Example 4.5 -Message: \ -e1 7d 20 38 5d 50 19 55 82 3c 3f 66 62 54 c1 d3\ -dd 36 ad 51 68 b8 f1 8d 28 6f dc f6 7a 7d ad 94\ -09 70 85 fa b7 ed 86 fe 21 42 a2 87 71 71 79 97\ -ef 1a 7a 08 88 4e fc 39 35 6d 76 07 7a af 82 45\ -9a 7f ad 45 84 88 75 f2 81 9b 09 89 37 fe 92 3b\ -cc 9d c4 42 d7 2d 75 4d 81 20 25 09 0c 9b c0 3d\ -b3 08 0c 13 8d d6 3b 35 5d 0b 4b 85 d6 68 8a c1\ -9f 4d e1 50 84 a0 ba 4e 37 3b 93 ef 4a 55 50 96\ -69 19 15 dc 23 c0 0e 95 4c de b2 0a 47 cd 55 d1\ -6c 3d 86 81 d4 6e d7 f2 ed 5e a4 27 95 be 17 ba\ -ed 25 f0 f4 d1 13 b3 63 6a dd d5 85 f1 6a 8b 5a\ -ec 0c 8f a9 c5 f0 3c bf 3b 9b 73 -Salt: \ -24 97 dc 2b 46 15 df ae 5a 66 3d 49 ff d5 6b f7\ -ef c1 13 04 -Signature: \ -02 2a 80 04 53 53 90 4c b3 0c bb 54 2d 7d 49 90\ -42 1a 6e ec 16 a8 02 9a 84 22 ad fd 22 d6 af f8\ -c4 cc 02 94 af 11 0a 0c 06 7e c8 6a 7d 36 41 34\ -45 9b b1 ae 8f f8 36 d5 a8 a2 57 98 40 99 6b 32\ -0b 19 f1 3a 13 fa d3 78 d9 31 a6 56 25 da e2 73\ -9f 0c 53 67 0b 35 d9 d3 cb ac 08 e7 33 e4 ec 2b\ -83 af 4b 91 96 d6 3e 7c 4f f1 dd ea e2 a1 22 79\ -1a 12 5b fe a8 de b0 de 8c cf 1f 4f fa f6 e6 fb\ -0a -Test: Verify -Comment: RSASSA-PSS Signature Example 4.6 -Message: \ -af bc 19 d4 79 24 90 18 fd f4 e0 9f 61 87 26 44\ -04 95 de 11 dd ee e3 88 72 d7 75 fc ea 74 a2 38\ -96 b5 34 3c 9c 38 d4 6a f0 db a2 24 d0 47 58 0c\ -c6 0a 65 e9 39 1c f9 b5 9b 36 a8 60 59 8d 4e 82\ -16 72 2f 99 3b 91 cf ae 87 bc 25 5a f8 9a 6a 19\ -9b ca 4a 39 1e ad bc 3a 24 90 3c 0b d6 67 36 8f\ -6b e7 8e 3f ea bf b4 ff d4 63 12 27 63 74 0f fb\ -be fe ab 9a 25 56 4b c5 d1 c2 4c 93 e4 22 f7 50\ -73 e2 ad 72 bf 45 b1 0d f0 0b 52 a1 47 12 8e 73\ -fe e3 3f a3 f0 57 7d 77 f8 0f bc 2d f1 be d3 13\ -29 0c 12 77 7f 50 -Salt: \ -a3 34 db 6f ae bf 11 08 1a 04 f8 7c 2d 62 1c de\ -c7 93 0b 9b -Signature: \ -00 93 8d cb 6d 58 30 46 06 5f 69 c7 8d a7 a1 f1\ -75 70 66 a7 fa 75 12 5a 9d 29 29 f0 b7 9a 60 b6\ -27 b0 82 f1 1f 5b 19 6f 28 eb 9d aa 6f 21 c0 5e\ -51 40 f6 ae f1 73 7d 20 23 07 5c 05 ec f0 4a 02\ -8c 68 6a 2a b3 e7 d5 a0 66 4f 29 5c e1 29 95 e8\ -90 90 8b 6a d2 1f 08 39 eb 65 b7 03 93 a7 b5 af\ -d9 87 1d e0 ca a0 ce de c5 b8 19 62 67 56 20 9d\ -13 ab 1e 7b b9 54 6a 26 ff 37 e9 a5 1a f9 fd 56\ -2e -Test: Verify -Comment: Example 5: A 1028-bit RSA Key Pair -Modulus: \ -0d 10 f6 61 f2 99 40 f5 ed 39 aa 26 09 66 de b4\ -78 43 67 9d 2b 6f b2 5b 3d e3 70 f3 ac 7c 19 91\ -63 91 fd 25 fb 52 7e bf a6 a4 b4 df 45 a1 75 9d\ -99 6c 4b b4 eb d1 88 28 c4 4f c5 2d 01 91 87 17\ -40 52 5f 47 a4 b0 cc 8d a3 25 ed 8a a6 76 b0 d0\ -f6 26 e0 a7 7f 07 69 21 70 ac ac 80 82 f4 2f aa\ -7d c7 cd 12 3e 73 0e 31 a8 79 85 20 4c ab cb e6\ -67 0d 43 a2 dd 2b 2d de f5 e0 53 92 fc 21 3b c5\ -07 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -03 ce 08 b1 04 ff f3 96 a9 79 bd 3e 4e 46 92 5b\ -63 19 dd b6 3a cb cf d8 19 f1 7d 16 b8 07 7b 3a\ -87 10 1f f3 4b 77 fe 48 b8 b2 05 a9 6e 91 51 ba\ -8e ce a6 4d 0c ce 7b 23 c3 e6 a6 b8 30 58 bc 49\ -da e8 16 ae 73 6d b5 a4 70 8e 2a d4 35 23 2b 56\ -7f 90 96 ce 59 ff 28 06 1e 79 ab 1c 02 d7 17 e6\ -b2 3c ea 6d b8 eb 51 92 fa 7c 1e ab 22 7d ba 74\ -62 1c 45 60 18 96 ee f1 37 92 c8 44 0b eb 15 aa\ -c1 -Prime1: \ -03 f2 f3 31 f4 14 2d 4f 24 b4 3a a1 02 79 a8 96\ -52 d4 e7 53 72 21 a1 a7 b2 a2 5d eb 55 1e 5d e9\ -ac 49 74 11 c2 27 a9 4e 45 f9 1c 2d 1c 13 cc 04\ -6c f4 ce 14 e3 2d 05 87 34 21 0d 44 a8 7e e1 b7\ -3f -Prime2: \ -03 4f 09 0d 73 b5 58 03 03 0c f0 36 1a 5d 80 81\ -bf b7 9f 85 15 23 fe ac 0a 21 24 d0 8d 40 13 ff\ -08 48 77 71 a8 70 d0 47 9d c0 68 6c 62 f7 71 8d\ -fe cf 02 4b 17 c9 26 76 78 05 91 71 33 9c c0 08\ -39 -ModPrime1PrivateExponent: \ -02 aa 66 3a db f5 1a b8 87 a0 18 cb 42 6e 78 bc\ -2f e1 82 dc b2 f7 bc b5 04 41 d1 7f df 0f 06 79\ -8b 50 71 c6 e2 f5 fe b4 d5 4a d8 18 23 11 c1 ef\ -62 d4 c4 9f 18 d1 f5 1f 54 b2 d2 cf fb a4 da 1b\ -e5 -ModPrime2PrivateExponent: \ -02 bb e7 06 07 8b 5c 0b 39 15 12 d4 11 db 1b 19\ -9b 5a 56 64 b8 40 42 ea d3 7f e9 94 ae 72 b9 53\ -2d fb fb 3e 9e 69 81 a0 fb b8 06 51 31 41 b7 c2\ -16 3f e5 6c 39 5e 4b fa ee 57 e3 83 3f 9b 91 8d\ -f9 -MultiplicativeInverseOfPrime2ModPrime1: \ -02 42 b6 cd 00 d3 0a 76 7a ee 9a 89 8e ad 45 3c\ -8e ae a6 3d 50 0b 7d 1e 00 71 3e da e5 1c e3 6b\ -23 b6 64 df 26 e6 3e 26 6e c8 f7 6e 6e 63 ed 1b\ -a4 1e b0 33 b1 20 f7 ea 52 12 ae 21 a9 8f bc 16 -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 5.1 -Message: \ -30 c7 d5 57 45 8b 43 6d ec fd c1 4d 06 cb 7b 96\ -b0 67 18 c4 8d 7d e5 74 82 a8 68 ae 7f 06 58 70\ -a6 21 65 06 d1 1b 77 93 23 df df 04 6c f5 77 51\ -29 13 4b 4d 56 89 e4 d9 c0 ce 1e 12 d7 d4 b0 6c\ -b5 fc 58 20 de cf a4 1b af 59 bf 25 7b 32 f0 25\ -b7 67 9b 44 5b 94 99 c9 25 55 14 58 85 99 2f 1b\ -76 f8 48 91 ee 4d 3b e0 f5 15 0f d5 90 1e 3a 4c\ -8e d4 3f d3 6b 61 d0 22 e6 5a d5 00 8d bf 33 29\ -3c 22 bf bf d0 73 21 f0 f1 d5 fa 9f df 00 14 c2\ -fc b0 35 8a ad 0e 35 4b 0d 29 -Salt: \ -08 1b 23 3b 43 56 77 50 bd 6e 78 f3 96 a8 8b 9f\ -6a 44 51 51 -Signature: \ -0b a3 73 f7 6e 09 21 b7 0a 8f bf e6 22 f0 bf 77\ -b2 8a 3d b9 8e 36 10 51 c3 d7 cb 92 ad 04 52 91\ -5a 4d e9 c0 17 22 f6 82 3e eb 6a df 7e 0c a8 29\ -0f 5d e3 e5 49 89 0a c2 a3 c5 95 0a b2 17 ba 58\ -59 08 94 95 2d e9 6f 8d f1 11 b2 57 52 15 da 6c\ -16 15 90 c7 45 be 61 24 76 ee 57 8e d3 84 ab 33\ -e3 ec e9 74 81 a2 52 f5 c7 9a 98 b5 53 2a e0 0c\ -dd 62 f2 ec c0 cd 1b ae fe 80 d8 0b 96 21 93 ec\ -1d -Test: Verify -Comment: RSASSA-PSS Signature Example 5.2 -Message: \ -e7 b3 2e 15 56 ea 1b 27 95 04 6a c6 97 39 d2 2a\ -c8 96 6b f1 1c 11 6f 61 4b 16 67 40 e9 6b 90 65\ -3e 57 50 94 5f cf 77 21 86 c0 37 90 a0 7f da 32\ -3e 1a 61 91 6b 06 ee 21 57 db 3d ff 80 d6 7d 5e\ -39 a5 3a e2 68 c8 f0 9e d9 9a 73 20 05 b0 bc 6a\ -04 af 4e 08 d5 7a 00 e7 20 1b 30 60 ef aa db 73\ -11 3b fc 08 7f d8 37 09 3a a2 52 35 b8 c1 49 f5\ -62 15 f0 31 c2 4a d5 bd e7 f2 99 60 df 7d 52 40\ -70 f7 44 9c 6f 78 50 84 be 1a 0f 73 30 47 f3 36\ -f9 15 47 38 67 45 47 db 02 a9 f4 4d fc 6e 60 30\ -10 81 e1 ce 99 84 7f 3b 5b 60 1f f0 6b 4d 57 76\ -a9 74 0b 9a a0 d3 40 58 fd 3b 90 6e 4f 78 59 df\ -b0 7d 71 73 e5 e6 f6 35 0a da c2 1f 27 b2 30 74\ -69 -Salt: \ -bd 0c e1 95 49 d0 70 01 20 cb e5 10 77 db bb b0\ -0a 8d 8b 09 -Signature: \ -08 18 0d e8 25 e4 b8 b0 14 a3 2d a8 ba 76 15 55\ -92 12 04 f2 f9 0d 5f 24 b7 12 90 8f f8 4f 3e 22\ -0a d1 79 97 c0 dd 6e 70 66 30 ba 3e 84 ad d4 d5\ -e7 ab 00 4e 58 07 4b 54 97 09 56 5d 43 ad 9e 97\ -b5 a7 a1 a2 9e 85 b9 f9 0f 4a af cd f5 83 21 de\ -8c 59 74 ef 9a bf 2d 52 6f 33 c0 f2 f8 2e 95 d1\ -58 ea 6b 81 f1 73 6d b8 d1 af 3d 6a c6 a8 3b 32\ -d1 8b ae 0f f1 b2 fe 27 de 4c 76 ed 8c 79 80 a3\ -4e -Test: Verify -Comment: RSASSA-PSS Signature Example 5.3 -Message: \ -8d 83 96 e3 65 07 fe 1e f6 a1 90 17 54 8e 0c 71\ -66 74 c2 fe c2 33 ad b2 f7 75 66 5e c4 1f 2b d0\ -ba 39 6b 06 1a 9d aa 7e 86 6f 7c 23 fd 35 31 95\ -43 00 a3 42 f9 24 53 5e a1 49 8c 48 f6 c8 79 93\ -28 65 fc 02 00 0c 52 87 23 b7 ad 03 35 74 5b 51\ -20 9a 0a fe d9 32 af 8f 08 87 c2 19 00 4d 2a bd\ -89 4e a9 25 59 ee 31 98 af 3a 73 4f e9 b9 63 8c\ -26 3a 72 8a d9 5a 5a e8 ce 3e b1 58 39 f3 aa 78\ -52 bb 39 07 06 e7 76 0e 43 a7 12 91 a2 e3 f8 27\ -23 7d ed a8 51 87 4c 51 76 65 f5 45 f2 72 38 df\ -86 55 7f 37 5d 09 cc d8 bd 15 d8 cc f6 1f 5d 78\ -ca 5c 7f 5c de 78 2e 6b f5 d0 05 70 56 d4 ba d9\ -8b 3d 2f 95 75 e8 24 ab 7a 33 ff 57 b0 ac 10 0a\ -b0 d6 ea d7 aa 0b 50 f6 e4 d3 e5 ec 0b 96 6b -Salt: \ -81 57 79 a9 1b 3a 8b d0 49 bf 2a eb 92 01 42 77\ -22 22 c9 ca -Signature: \ -05 e0 fd bd f6 f7 56 ef 73 31 85 cc fa 8c ed 2e\ -b6 d0 29 d9 d5 6e 35 56 1b 5d b8 e7 02 57 ee 6f\ -d0 19 d2 f0 bb f6 69 fe 9b 98 21 e7 8d f6 d4 1e\ -31 60 8d 58 28 0f 31 8e e3 4f 55 99 41 c8 df 13\ -28 75 74 ba c0 00 b7 e5 8d c4 f4 14 ba 49 fb 12\ -7f 9d 0f 89 36 63 8c 76 e8 53 56 c9 94 f7 97 50\ -f7 fa 3c f4 fd 48 2d f7 5e 3f b9 97 8c d0 61 f7\ -ab b1 75 72 e6 e6 3e 0b de 12 cb dc f1 8c 68 b9\ -79 -Test: Verify -Comment: RSASSA-PSS Signature Example 5.4 -Message: \ -32 8c 65 9e 0a 64 37 43 3c ce b7 3c 14 -Salt: \ -9a ec 4a 74 80 d5 bb c4 29 20 d7 ca 23 5d b6 74\ -98 9c 9a ac -Signature: \ -0b c9 89 85 3b c2 ea 86 87 32 71 ce 18 3a 92 3a\ -b6 5e 8a 53 10 0e 6d f5 d8 7a 24 c4 19 4e b7 97\ -81 3e e2 a1 87 c0 97 dd 87 2d 59 1d a6 0c 56 86\ -05 dd 7e 74 2d 5a f4 e3 3b 11 67 8c cb 63 90 32\ -04 a3 d0 80 b0 90 2c 89 ab a8 86 8f 00 9c 0f 1c\ -0c b8 58 10 bb dd 29 12 1a bb 84 71 ff 2d 39 e4\ -9f d9 2d 56 c6 55 c8 e0 37 ad 18 fa fb dc 92 c9\ -58 63 f7 f6 1e a9 ef a2 8f ea 40 13 69 d1 9d ae\ -a1 -Test: Verify -Comment: RSASSA-PSS Signature Example 5.5 -Message: \ -f3 7b 96 23 79 a4 7d 41 5a 37 6e ec 89 73 15 0b\ -cb 34 ed d5 ab 65 40 41 b6 14 30 56 0c 21 44 58\ -2b a1 33 c8 67 d8 52 d6 b8 e2 33 21 90 13 02 ec\ -b4 5b 09 ec 88 b1 52 71 78 fa 04 32 63 f3 06 7d\ -9f fe 97 30 32 a9 9f 4c b0 8a d2 c7 e0 a2 45 6c\ -dd 57 a7 df 56 fe 60 53 52 7a 5a eb 67 d7 e5 52\ -06 3c 1c a9 7b 1b ef fa 7b 39 e9 97 ca f2 78 78\ -ea 0f 62 cb eb c8 c2 1d f4 c8 89 a2 02 85 1e 94\ -90 88 49 0c 24 9b 6e 9a cf 1d 80 63 f5 be 23 43\ -98 9b f9 5c 4d a0 1a 2b e7 8b 4a b6 b3 78 01 5b\ -c3 79 57 f7 69 48 b5 e5 8e 44 0c 28 45 3d 40 d7\ -cf d5 7e 7d 69 06 00 47 4a b5 e7 59 73 b1 ea 0c\ -5f 1e 45 d1 41 90 af e2 f4 eb 6d 3b df 71 f1 d2\ -f8 bb 15 6a 1c 29 5d 04 aa eb 9d 68 9d ce 79 ed\ -62 bc 44 3e -Salt: \ -e2 0c 1e 98 78 51 2c 39 97 0f 58 37 5e 15 49 a6\ -8b 64 f3 1d -Signature: \ -0a ef a9 43 b6 98 b9 60 9e df 89 8a d2 27 44 ac\ -28 dc 23 94 97 ce a3 69 cb bd 84 f6 5c 95 c0 ad\ -77 6b 59 47 40 16 4b 59 a7 39 c6 ff 7c 2f 07 c7\ -c0 77 a8 6d 95 23 8f e5 1e 1f cf 33 57 4a 4a e0\ -68 4b 42 a3 f6 bf 67 7d 91 82 0c a8 98 74 46 7b\ -2c 23 ad d7 79 69 c8 07 17 43 0d 0e fc 1d 36 95\ -89 2c e8 55 cb 7f 70 11 63 0f 4d f2 6d ef 8d df\ -36 fc 23 90 5f 57 fa 62 43 a4 85 c7 70 d5 68 1f\ -cd -Test: Verify -Comment: RSASSA-PSS Signature Example 5.6 -Message: \ -c6 10 3c 33 0c 1e f7 18 c1 41 e4 7b 8f a8 59 be\ -4d 5b 96 25 9e 7d 14 20 70 ec d4 85 83 9d ba 5a\ -83 69 c1 7c 11 14 03 5e 53 2d 19 5c 74 f4 4a 04\ -76 a2 d3 e8 a4 da 21 00 16 ca ce d0 e3 67 cb 86\ -77 10 a4 b5 aa 2d f2 b8 e5 da f5 fd c6 47 80 7d\ -4d 5e bb 6c 56 b9 76 3c cd ae 4d ea 33 08 eb 0a\ -c2 a8 95 01 cb 20 9d 26 39 fa 5b f8 7c e7 90 74\ -7d 3c b2 d2 95 e8 45 64 f2 f6 37 82 4f 0c 13 02\ -81 29 b0 aa 4a 42 2d 16 22 82 -Salt: \ -23 29 1e 4a 33 07 e8 bb b7 76 62 3a b3 4e 4a 5f\ -4c c8 a8 db -Signature: \ -02 80 2d cc fa 8d fa f5 27 9b f0 b4 a2 9b a1 b1\ -57 61 1f ae aa f4 19 b8 91 9d 15 94 19 00 c1 33\ -9e 7e 92 e6 fa e5 62 c5 3e 6c c8 e8 41 04 b1 10\ -bc e0 3a d1 85 25 e3 c4 9a 0e ad ad 5d 3f 28 f2\ -44 a8 ed 89 ed ba fb b6 86 27 7c fa 8a e9 09 71\ -4d 6b 28 f4 bf 8e 29 3a a0 4c 41 ef e7 c0 a8 12\ -66 d5 c0 61 e2 57 5b e0 32 aa 46 46 74 ff 71 62\ -62 19 bd 74 cc 45 f0 e7 ed 4e 3f f9 6e ee 75 8e\ -8f -Test: Verify -Comment: Example 6: A 1029-bit RSA Key Pair -Modulus: \ -16 4c a3 1c ff 60 9f 3a 0e 71 01 b0 39 f2 e4 fe\ -6d d3 75 19 ab 98 59 8d 17 9e 17 49 96 59 80 71\ -f4 7d 3a 04 55 91 58 d7 be 37 3c f1 aa 53 f0 aa\ -6e f0 90 39 e5 67 8c 2a 4c 63 90 05 14 c8 c4 f8\ -aa ed 5d e1 2a 5f 10 b0 9c 31 1a f8 c0 ff b5 b7\ -a2 97 f2 ef c6 3b 8d 6b 05 10 93 1f 0b 98 e4 8b\ -f5 fc 6e c4 e7 b8 db 1f fa eb 08 c3 8e 02 ad b8\ -f0 3a 48 22 9c 99 e9 69 43 1f 61 cb 8c 4d c6 98\ -d1 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -03 b6 64 ee 3b 75 66 72 3f c6 ea f2 8a bb 43 0a\ -39 80 f1 12 6c 81 de 8a d7 09 ea b3 9a c9 dc d0\ -b1 55 0b 37 29 d8 70 68 e9 52 00 9d f5 44 53 4c\ -1f 50 82 9a 78 f4 59 1e b8 fd 57 14 04 26 a6 bb\ -04 05 b6 a6 f5 1a 57 d9 26 7b 7b bc 65 33 91 a6\ -99 a2 a9 0d ac 8a e2 26 bc c6 0f a8 cd 93 4c 73\ -c7 b0 3b 1f 6b 81 81 58 63 18 38 a8 61 2e 6e 6e\ -a9 2b e2 4f 83 24 fa f5 b1 fd 85 87 22 52 67 ba\ -6f -Prime1: \ -04 f0 54 8c 96 26 ab 1e bf 12 44 93 47 41 d9 9a\ -06 22 0e fa 2a 58 56 aa 0e 75 73 0b 2e c9 6a dc\ -86 be 89 4f a2 80 3b 53 a5 e8 5d 27 6a cb d2 9a\ -b8 23 f8 0a 73 91 bb 54 a5 05 16 72 fb 04 ee b5\ -43 -Prime2: \ -04 83 e0 ae 47 91 55 87 74 3f f3 45 36 2b 55 5d\ -39 62 d9 8b b6 f1 5f 84 8b 4c 92 b1 77 1c a8 ed\ -10 7d 8d 3e e6 5e c4 45 17 dd 0f aa 48 1a 38 7e\ -90 2f 7a 2e 74 7c 26 9e 7e a4 44 80 bc 53 8b 8e\ -5b -ModPrime1PrivateExponent: \ -03 a8 e8 ae a9 92 0c 1a a3 b2 f0 d8 46 e4 b8 50\ -d8 1c a3 06 a5 1c 83 54 4f 94 9f 64 f9 0d cf 3f\ -8e 26 61 f0 7e 56 12 20 a1 80 38 8f be 27 3e 70\ -e2 e5 dc a8 3a 0e 13 48 dd 64 90 c7 31 d6 ec e1\ -ab -ModPrime2PrivateExponent: \ -01 35 bd cd b6 0b f2 19 7c 43 6e d3 4b 32 cd 8b\ -4f c7 77 78 83 2b a7 67 03 55 1f b2 42 b3 01 69\ -95 93 af 77 fd 8f c3 94 a8 52 6a d2 3c c4 1a 03\ -80 6b d8 97 fe 4b 0e a6 46 55 8a ad dc c9 9e 8a\ -25 -MultiplicativeInverseOfPrime2ModPrime1: \ -03 04 c0 3d 9c 73 65 03 a9 84 ab bd 9b a2 23 01\ -40 7c 4a 2a b1 dd 85 76 64 81 b6 0d 45 40 11 52\ -e6 92 be 14 f4 12 1d 9a a3 fd 6e 0b 4d 1d 3a 97\ -35 38 a3 1d 42 ee 6e 1e 5e f6 20 23 1a 2b ba f3\ -5f -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 6.1 -Message: \ -0a 20 b7 74 ad dc 2f a5 12 45 ed 7c b9 da 60 9e\ -50 ca c6 63 6a 52 54 3f 97 45 8e ed 73 40 f8 d5\ -3f fc 64 91 8f 94 90 78 ee 03 ef 60 d4 2b 5f ec\ -24 60 50 bd 55 05 cd 8c b5 97 ba d3 c4 e7 13 b0\ -ef 30 64 4e 76 ad ab b0 de 01 a1 56 1e fb 25 51\ -58 c7 4f c8 01 e6 e9 19 e5 81 b4 6f 0f 0d dd 08\ -e4 f3 4c 78 10 b5 ed 83 18 f9 1d 7c 8c -Salt: \ -5b 4e a2 ef 62 9c c2 2f 3b 53 8e 01 69 04 b4 7b\ -1e 40 bf d5 -Signature: \ -04 c0 cf ac ec 04 e5 ba db ec e1 59 a5 a1 10 3f\ -69 b3 f3 2b a5 93 cb 4c c4 b1 b7 ab 45 59 16 a9\ -6a 27 cd 26 78 ea 0f 46 ba 37 f7 fc 9c 86 32 5f\ -29 73 3b 38 9f 1d 97 f4 3e 72 01 c0 f3 48 fc 45\ -fe 42 89 23 35 36 2e ee 01 8b 5b 16 1f 2f 93 93\ -03 12 25 c7 13 01 2a 57 6b c8 8e 23 05 24 89 86\ -8d 90 10 cb f0 33 ec c5 68 e8 bc 15 2b dc 59 d5\ -60 e4 12 91 91 5d 28 56 52 08 e2 2a ee c9 ef 85\ -d1 -Test: Verify -Comment: RSASSA-PSS Signature Example 6.2 -Message: \ -2a af f6 63 1f 62 1c e6 15 76 0a 9e bc e9 4b b3\ -33 07 7a d8 64 88 c8 61 d4 b7 6d 29 c1 f4 87 46\ -c6 11 ae 1e 03 ce d4 44 5d 7c fa 1f e5 f6 2e 1b\ -3f 08 45 2b de 3b 6e f8 19 73 ba fb b5 7f 97 bc\ -ee f8 73 98 53 95 b8 26 05 89 aa 88 cb 7d b5 0a\ -b4 69 26 2e 55 1b dc d9 a5 6f 27 5a 0a c4 fe 48\ -47 00 c3 5f 3d bf 2b 46 9e de 86 47 41 b8 6f a5\ -91 72 a3 60 ba 95 a0 2e 13 9b e5 0d df b7 cf 0b\ -42 fa ea bb fb ba a8 6a 44 97 69 9c 4f 2d fd 5b\ -08 40 6a f7 e1 41 44 42 7c 25 3e c0 ef a2 0e af\ -9a 8b e8 cd 49 ce 1f 1b c4 e9 3e 61 9c f2 aa 8e\ -d4 fb 39 bc 85 90 d0 f7 b9 64 88 f7 31 7a c9 ab\ -f7 be e4 e3 a0 e7 15 -Salt: \ -83 14 6a 9e 78 27 22 c2 8b 01 4f 98 b4 26 7b da\ -2a c9 50 4f -Signature: \ -0a 23 14 25 0c f5 2b 6e 4e 90 8d e5 b3 56 46 bc\ -aa 24 36 1d a8 16 0f b0 f9 25 75 90 ab 3a ce 42\ -b0 dc 3e 77 ad 2d b7 c2 03 a2 0b d9 52 fb b5 6b\ -15 67 04 6e cf aa 93 3d 7b 10 00 c3 de 9f f0 5b\ -7d 98 9b a4 6f d4 3b c4 c2 d0 a3 98 6b 7f fa 13\ -47 1d 37 eb 5b 47 d6 47 07 bd 29 0c fd 6a 9f 39\ -3a d0 8e c1 e3 bd 71 bb 57 92 61 50 35 cd af 2d\ -89 29 ae d3 be 09 83 79 37 7e 77 7c e7 9a aa 47\ -73 -Test: Verify -Comment: RSASSA-PSS Signature Example 6.3 -Message: \ -0f 61 95 d0 4a 6e 6f c7 e2 c9 60 0d bf 84 0c 39\ -ea 8d 4d 62 4f d5 35 07 01 6b 0e 26 85 8a 5e 0a\ -ec d7 ad a5 43 ae 5c 0a b3 a6 25 99 cb a0 a5 4e\ -6b f4 46 e2 62 f9 89 97 8f 9d df 5e 9a 41 -Salt: \ -a8 7b 8a ed 07 d7 b8 e2 da f1 4d dc a4 ac 68 c4\ -d0 aa bf f8 -Signature: \ -08 6d f6 b5 00 09 8c 12 0f 24 ff 84 23 f7 27 d9\ -c6 1a 5c 90 07 d3 b6 a3 1c e7 cf 8f 3c be c1 a2\ -6b b2 0e 2b d4 a0 46 79 32 99 e0 3e 37 a2 1b 40\ -19 4f b0 45 f9 0b 18 bf 20 a4 79 92 cc d7 99 cf\ -9c 05 9c 29 9c 05 26 85 49 54 aa de 8a 6a d9 d9\ -7e c9 1a 11 45 38 3f 42 46 8b 23 1f 4d 72 f2 37\ -06 d9 85 3c 3f a4 3c e8 ac e8 bf e7 48 49 87 a1\ -ec 6a 16 c8 da f8 1f 7c 8b f4 27 74 70 7a 9d f4\ -56 -Test: Verify -Comment: RSASSA-PSS Signature Example 6.4 -Message: \ -33 7d 25 fe 98 10 eb ca 0d e4 d4 65 8d 3c eb 8e\ -0f e4 c0 66 ab a3 bc c4 8b 10 5d 3b f7 e0 25 7d\ -44 fe ce a6 59 6f 4d 0c 59 a0 84 02 83 36 78 f7\ -06 20 f9 13 8d fe b7 de d9 05 e4 a6 d5 f0 5c 47\ -3d 55 93 66 52 e2 a5 df 43 c0 cf da 7b ac af 30\ -87 f4 52 4b 06 cf 42 15 7d 01 53 97 39 f7 fd de\ -c9 d5 81 25 df 31 a3 2e ab 06 c1 9b 71 f1 d5 bf -Salt: \ -a3 79 32 f8 a7 49 4a 94 2d 6f 76 74 38 e7 24 d6\ -d0 c0 ef 18 -Signature: \ -0b 5b 11 ad 54 98 63 ff a9 c5 1a 14 a1 10 6c 2a\ -72 cc 8b 64 6e 5c 72 62 50 97 86 10 5a 98 47 76\ -53 4c a9 b5 4c 1c c6 4b f2 d5 a4 4f d7 e8 a6 9d\ -b6 99 d5 ea 52 08 7a 47 48 fd 2a bc 1a fe d1 e5\ -d6 f7 c8 90 25 53 0b da a2 21 3d 7e 03 0f a5 5d\ -f6 f3 4b cf 1c e4 6d 2e df 4e 3a e4 f3 b0 18 91\ -a0 68 c9 e3 a4 4b bc 43 13 3e da d6 ec b9 f3 54\ -00 c4 25 2a 57 62 d6 57 44 b9 9c b9 f4 c5 59 32\ -9f -Test: Verify -Comment: RSASSA-PSS Signature Example 6.5 -Message: \ -84 ec 50 2b 07 2e 82 87 78 9d 8f 92 35 82 9e a3\ -b1 87 af d4 d4 c7 85 61 1b da 5f 9e b3 cb 96 71\ -7e fa 70 07 22 7f 1c 08 cb cb 97 2e 66 72 35 e0\ -fb 7d 43 1a 65 70 32 6d 2e cc e3 5a db 37 3d c7\ -53 b3 be 5f 82 9b 89 17 54 93 19 3f ab 16 ba db\ -41 37 1b 3a ac 0a e6 70 07 6f 24 be f4 20 c1 35\ -ad d7 ce e8 d3 5f bc 94 4d 79 fa fb 9e 30 7a 13\ -b0 f5 56 cb 65 4a 06 f9 73 ed 22 67 23 30 19 7e\ -f5 a7 48 bf 82 6a 5d b2 38 3a 25 36 4b 68 6b 93\ -72 bb 23 39 ae b1 ac 9e 98 89 32 7d 01 6f 16 70\ -77 6d b0 62 01 ad bd ca f8 a5 e3 b7 4e 10 8b 73 -Salt: \ -7b 79 0c 1d 62 f7 b8 4e 94 df 6a f2 89 17 cf 57\ -10 18 11 0e -Signature: \ -02 d7 1f a9 b5 3e 46 54 fe fb 7f 08 38 5c f6 b0\ -ae 3a 81 79 42 eb f6 6c 35 ac 67 f0 b0 69 95 2a\ -3c e9 c7 e1 f1 b0 2e 48 0a 95 00 83 6d e5 d6 4c\ -db 7e cd e0 45 42 f7 a7 99 88 78 7e 24 c2 ba 05\ -f5 fd 48 2c 02 3e d5 c3 0e 04 83 9d c4 4b ed 2a\ -3a 3a 4f ee 01 11 3c 89 1a 47 d3 2e b8 02 5c 28\ -cb 05 0b 5c db 57 6c 70 fe 76 ef 52 34 05 c0 84\ -17 fa f3 50 b0 37 a4 3c 37 93 39 fc b1 8d 3a 35\ -6b -Test: Verify -Comment: RSASSA-PSS Signature Example 6.6 -Message: \ -99 06 d8 9f 97 a9 fd ed d3 cc d8 24 db 68 73 26\ -f3 0f 00 aa 25 a7 fc a2 af cb 3b 0f 86 cd 41 e7\ -3f 0e 8f f7 d2 d8 3f 59 e2 8e d3 1a 5a 0d 55 15\ -23 37 4d e2 2e 4c 7e 8f f5 68 b3 86 ee 3d c4 11\ -63 f1 0b f6 7b b0 06 26 1c 90 82 f9 af 90 bf 1d\ -90 49 a6 b9 fa e7 1c 7f 84 fb e6 e5 5f 02 78 9d\ -e7 74 f2 30 f1 15 02 6a 4b 4e 96 c5 5b 04 a9 5d\ -a3 aa cb b2 ce ce 8f 81 76 4a 1f 1c 99 51 54 11\ -08 7c f7 d3 4a ed ed 09 32 c1 83 -Salt: \ -fb be 05 90 25 b6 9b 89 fb 14 ae 22 89 e7 aa af\ -e6 0c 0f cd -Signature: \ -0a 40 a1 6e 2f e2 b3 8d 1d f9 05 46 16 7c f9 46\ -9c 9e 3c 36 81 a3 44 2b 4b 2c 2f 58 1d eb 38 5c\ -e9 9f c6 18 8b b0 2a 84 1d 56 e7 6d 30 18 91 e2\ -45 60 55 0f cc 2a 26 b5 5f 4c cb 26 d8 37 d3 50\ -a1 54 bc ac a8 39 2d 98 fa 67 95 9e 97 27 b7 8c\ -ad 03 26 9f 56 96 8f c5 6b 68 bd 67 99 26 d8 3c\ -c9 cb 21 55 50 64 5c cd a3 1c 76 0f f3 58 88 94\ -3d 2d 8a 1d 35 1e 81 e5 d0 7b 86 18 2e 75 10 81\ -ef -Test: Verify -Comment: Example 7: A 1030-bit RSA Key Pair -Modulus: \ -37 c9 da 4a 66 c8 c4 08 b8 da 27 d0 c9 d7 9f 8c\ -cb 1e af c1 d2 fe 48 74 6d 94 0b 7c 4e f5 de e1\ -8a d1 26 47 ce fa a0 c4 b3 18 8b 22 1c 51 53 86\ -75 9b 93 f0 20 24 b2 5a b9 24 2f 83 57 d8 f3 fd\ -49 64 0e e5 e6 43 ea f6 c6 4d ee fa 70 89 72 7c\ -8f f0 39 93 33 39 15 c6 ef 21 bf 59 75 b6 e5 0d\ -11 8b 51 00 8e c3 3e 9f 01 a0 a5 45 a1 0a 83 6a\ -43 dd bc a9 d8 b5 c5 d3 54 80 22 d7 06 4e a2 9a\ -b3 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -3b ed 99 90 52 d9 57 bc 06 d6 51 ee f6 e3 a9 80\ -94 b1 62 1b d3 8b 54 49 bd 6c 4a ea 3d e7 e0 84\ -67 9a 44 84 de d2 5b e0 f0 82 6c f3 37 78 25 41\ -4b 14 d4 d6 1d b1 4d e6 26 fb b8 0e 5f 4f ae c9\ -56 f9 a0 a2 d2 4f 99 57 63 80 f0 84 eb 62 e4 6a\ -57 d5 54 27 8b 53 56 26 19 3c e0 20 60 57 5e b6\ -6c 57 98 d3 6f 6c 5d 40 fb 00 d8 09 b4 2a 73 10\ -2c 1c 74 ee 95 bd 71 42 0f ff ef 63 18 b5 2c 29 -Prime1: \ -07 ee fb 42 4b 0e 3a 40 e4 20 8e e5 af b2 80 b2\ -23 17 30 81 14 dd e0 b4 b6 4f 73 01 84 ec 68 da\ -6c e2 86 7a 9f 48 ed 77 26 d5 e2 61 4e d0 4a 54\ -10 73 6c 8c 71 4e e7 02 47 42 98 c6 29 2a f0 75\ -35 -Prime2: \ -07 08 30 db f9 47 ea c0 22 8d e2 63 14 b5 9b 66\ -99 4c c6 0e 83 60 e7 5d 38 76 29 8f 8f 8a 7d 14\ -1d a0 64 e5 ca 02 6a 97 3e 28 f2 54 73 8c ee 66\ -9c 72 1b 03 4c b5 f8 e2 44 da dd 7c d1 e1 59 d5\ -47 -ModPrime1PrivateExponent: \ -05 24 d2 0c 3d 95 cf f7 5a f2 31 34 83 22 7d 87\ -02 71 7a a5 76 de 15 5f 96 05 15 50 1a db 1d 70\ -e1 c0 4d e9 1b 75 b1 61 db f0 39 83 56 12 7e de\ -da 7b bc 19 a3 2d c1 62 1c c9 f5 3c 26 5d 0c e3\ -31 -ModPrime2PrivateExponent: \ -05 f9 84 a1 f2 3c 93 8d 6a 0e 89 72 4b cf 3d d9\ -3f 99 46 92 60 37 fe 7c 6b 13 a2 9e 52 84 85 5f\ -89 08 95 91 d4 40 97 56 27 bf 5c 9e 3a 8b 5c a7\ -9c 77 2a d2 73 e4 0d 32 1a f4 a6 c9 7d fd ed 78\ -d3 -MultiplicativeInverseOfPrime2ModPrime1: \ -dd d9 18 ad ad a2 9d ca b9 81 ff 9a cb a4 25 70\ -23 c0 9a 38 01 cc ce 09 8c e2 68 f8 55 d0 df 57\ -0c d6 e7 b9 b1 4b d9 a5 a9 25 4c bc 31 5b e6 f8\ -ba 1e 25 46 dd d5 69 c5 ea 19 ee d8 35 3b de 5e -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 7.1 -Message: \ -9e ad 0e 01 94 56 40 67 4e b4 1c ad 43 5e 23 74\ -ea ef a8 ad 71 97 d9 79 13 c4 49 57 d8 d8 3f 40\ -d7 6e e6 0e 39 bf 9c 0f 9e af 30 21 42 1a 07 4d\ -1a de 96 2c 6e 9d 3d c3 bb 17 4f e4 df e6 52 b0\ -91 15 49 5b 8f d2 79 41 74 02 0a 06 02 b5 ca 51\ -84 8c fc 96 ce 5e b5 7f c0 a2 ad c1 dd a3 6a 7c\ -c4 52 64 1a 14 91 1b 37 e4 5b fa 11 da a5 c7 ec\ -db 74 f6 d0 10 0d 1d 3e 39 e7 52 80 0e 20 33 97\ -de 02 33 07 7b 9a 88 85 55 37 fa e9 27 f9 24 38\ -0d 78 0f 98 e1 8d cf f3 9c 5e a7 41 b1 7d 6f dd\ -18 85 bc 9d 58 14 82 d7 71 ce b5 62 d7 8a 8b f8\ -8f 0c 75 b1 13 63 e5 e3 6c d4 79 ce b0 54 5f 9d\ -a8 42 03 e0 e6 e5 08 37 5c c9 e8 44 b8 8b 7a c7\ -a0 a2 01 ea 0f 1b ee 9a 2c 57 79 20 ca 02 c0 1b\ -9d 83 20 e9 74 a5 6f 4e fb 57 63 b9 62 55 ab bf\ -80 37 bf 18 02 cf 01 8f 56 37 94 93 e5 69 a9 -Salt: \ -b7 86 7a 59 95 8c b5 43 28 f8 77 5e 65 46 ec 06\ -d2 7e aa 50 -Signature: \ -18 7f 39 07 23 c8 90 25 91 f0 15 4b ae 6d 4e cb\ -ff e0 67 f0 e8 b7 95 47 6e a4 f4 d5 1c cc 81 05\ -20 bb 3c a9 bc a7 d0 b1 f2 ea 8a 17 d8 73 fa 27\ -57 0a cd 64 2e 38 08 56 1c b9 e9 75 cc fd 80 b2\ -3d c5 77 1c db 33 06 a5 f2 31 59 da cb d3 aa 2d\ -b9 3d 46 d7 66 e0 9e d1 5d 90 0a d8 97 a8 d2 74\ -dc 26 b4 7e 99 4a 27 e9 7e 22 68 a7 66 53 3a e4\ -b5 e4 2a 2f ca f7 55 c1 c4 79 4b 29 4c 60 55 58\ -23 -Test: Verify -Comment: RSASSA-PSS Signature Example 7.2 -Message: \ -8d 80 d2 d0 8d bd 19 c1 54 df 3f 14 67 3a 14 bd\ -03 73 52 31 f2 4e 86 bf 15 3d 0e 69 e7 4c bf f7\ -b1 83 6e 66 4d e8 3f 68 01 24 37 0f c0 f9 6c 9b\ -65 c0 7a 36 6b 64 4c 4a b3 -Salt: \ -0c 09 58 22 66 df 08 63 10 82 1b a7 e1 8d f6 4d\ -fe e6 de 09 -Signature: \ -10 fd 89 76 8a 60 a6 77 88 ab b5 85 6a 78 7c 85\ -61 f3 ed cf 9a 83 e8 98 f7 dc 87 ab 8c ce 79 42\ -9b 43 e5 69 06 94 1a 88 61 94 f1 37 e5 91 fe 7c\ -33 95 55 36 1f bb e1 f2 4f eb 2d 4b cd b8 06 01\ -f3 09 6b c9 13 2d ee a6 0a e1 30 82 f4 4f 9a d4\ -1c d6 28 93 6a 4d 51 17 6e 42 fc 59 cb 76 db 81\ -5c e5 ab 4d b9 9a 10 4a af ea 68 f5 d3 30 32 9e\ -bf 25 8d 4e de 16 06 4b d1 d0 03 93 d5 e1 57 0e\ -b8 -Test: Verify -Comment: RSASSA-PSS Signature Example 7.3 -Message: \ -80 84 05 cd fc 1a 58 b9 bb 03 97 c7 20 72 2a 81\ -ff fb 76 27 8f 33 59 17 ef 9c 47 38 14 b3 e0 16\ -ba 29 73 cd 27 65 f8 f3 f8 2d 6c c3 8a a7 f8 55\ -18 27 fe 8d 1e 38 84 b7 e6 1c 94 68 3b 8f 82 f1\ -84 3b da e2 25 7e ee c9 81 2a d4 c2 cf 28 3c 34\ -e0 b0 ae 0f e3 cb 99 0c f8 8f 2e f9 -Salt: \ -28 03 9d cf e1 06 d3 b8 29 66 11 25 8c 4a 56 65\ -1c 9e 92 dd -Signature: \ -2b 31 fd e9 98 59 b9 77 aa 09 58 6d 8e 27 46 62\ -b2 5a 2a 64 06 40 b4 57 f5 94 05 1c b1 e7 f7 a9\ -11 86 54 55 24 29 26 cf 88 fe 80 df a3 a7 5b a9\ -68 98 44 a1 1e 63 4a 82 b0 75 af bd 69 c1 2a 0d\ -f9 d2 5f 84 ad 49 45 df 3d c8 fe 90 c3 ce fd f2\ -6e 95 f0 53 43 04 b5 bd ba 20 d3 e5 64 0a 2e bf\ -b8 98 aa c3 5a e4 0f 26 fc e5 56 3c 2f 9f 24 f3\ -04 2a f7 6f 3c 70 72 d6 87 bb fb 95 9a 88 46 0a\ -f1 -Test: Verify -Comment: RSASSA-PSS Signature Example 7.4 -Message: \ -f3 37 b9 ba d9 37 de 22 a1 a0 52 df f1 11 34 a8\ -ce 26 97 62 02 98 19 39 b9 1e 07 15 ae 5e 60 96\ -49 da 1a df ce f3 f4 cc a5 9b 23 83 60 e7 d1 e4\ -96 c7 bf 4b 20 4b 5a cf f9 bb d6 16 6a 1d 87 a3\ -6e f2 24 73 73 75 10 39 f8 a8 00 b8 39 98 07 b3\ -a8 5f 44 89 34 97 c0 d0 5f b7 01 7b 82 22 81 52\ -de 6f 25 e6 11 6d cc 75 03 c7 86 c8 75 c2 8f 3a\ -a6 07 e9 4a b0 f1 98 63 ab 1b 50 73 77 0b 0c d5\ -f5 33 ac de 30 c6 fb 95 3c f3 da 68 02 64 e3 0f\ -c1 1b ff 9a 19 bf fa b4 77 9b 62 23 c3 fb 3f e0\ -f7 1a ba de 4e b7 c0 9c 41 e2 4c 22 d2 3f a1 48\ -e6 a1 73 fe b6 39 84 d1 bc 6e e3 a0 2d 91 5b 75\ -2c ea f9 2a 30 15 ec eb 38 ca 58 6c 68 01 b3 7c\ -34 ce fb 2c ff 25 ea 23 c0 86 62 dc ab 26 a7 a9\ -3a 28 5d 05 d3 04 4c -Salt: \ -a7 78 21 eb bb ef 24 62 8e 4e 12 e1 d0 ea 96 de\ -39 8f 7b 0f -Signature: \ -32 c7 ca 38 ff 26 94 9a 15 00 0c 4b a0 4b 2b 13\ -b3 5a 38 10 e5 68 18 4d 7e ca ba a1 66 b7 ff ab\ -dd f2 b6 cf 4b a0 71 24 92 37 90 f2 e5 b1 a5 be\ -04 0a ea 36 fe 13 2e c1 30 e1 f1 05 67 98 2d 17\ -ac 3e 89 b8 d2 6c 30 94 03 4e 76 2d 2e 03 12 64\ -f0 11 70 be ec b3 d1 43 9e 05 84 6f 25 45 83 67\ -a7 d9 c0 20 60 44 46 72 67 1e 64 e8 77 86 45 59\ -ca 19 b2 07 4d 58 8a 28 1b 58 04 d2 37 72 fb be\ -19 -Test: Verify -Comment: RSASSA-PSS Signature Example 7.5 -Message: \ -45 01 3c eb af d9 60 b2 55 47 6a 8e 25 98 b9 aa\ -32 ef be 6d c1 f3 4f 4a 49 8d 8c f5 a2 b4 54 8d\ -08 c5 5d 5f 95 f7 bc c9 61 91 63 05 6f 2d 58 b5\ -2f a0 32 -Salt: \ -9d 5a d8 eb 45 21 34 b6 5d c3 a9 8b 6a 73 b5 f7\ -41 60 9c d6 -Signature: \ -07 eb 65 1d 75 f1 b5 2b c2 63 b2 e1 98 33 6e 99\ -fb eb c4 f3 32 04 9a 92 2a 10 81 56 07 ee 2d 98\ -9d b3 a4 49 5b 7d cc d3 8f 58 a2 11 fb 7e 19 31\ -71 a3 d8 91 13 24 37 eb ca 44 f3 18 b2 80 50 9e\ -52 b5 fa 98 fc ce 82 05 d9 69 7c 8e e4 b7 ff 59\ -d4 c5 9c 79 03 8a 19 70 bd 2a 0d 45 1e cd c5 ef\ -11 d9 97 9c 9d 35 f8 c7 0a 61 63 71 76 07 89 0d\ -58 6a 7c 6d c0 1c 79 f8 6a 8f 28 e8 52 35 f8 c2\ -f1 -Test: Verify -Comment: RSASSA-PSS Signature Example 7.6 -Message: \ -23 58 09 70 86 c8 99 32 3e 75 d9 c9 0d 0c 09 f1\ -2d 9d 54 ed fb df 70 a9 c2 eb 5a 04 d8 f3 6b 9b\ -2b df 2a ab e0 a5 bd a1 96 89 37 f9 d6 eb d3 b6\ -b2 57 ef b3 13 6d 41 31 f9 ac b5 9b 85 e2 60 2c\ -2a 3f cd c8 35 49 4a 1f 4e 5e c1 8b 22 6c 80 23\ -2b 36 a7 5a 45 fd f0 9a 7e a9 e9 8e fb de 14 50\ -d1 19 4b f1 2e 15 a4 c5 f9 eb 5c 0b ce 52 69 e0\ -c3 b2 8c fa b6 55 d8 1a 61 a2 0b 4b e2 f5 44 59\ -bb 25 a0 db 94 c5 22 18 be 10 9a 74 26 de 83 01\ -44 24 78 9a aa 90 e5 05 6e 63 2a 69 81 15 e2 82\ -c1 a5 64 10 f2 6c 20 72 f1 93 48 1a 9d cd 88 05\ -72 00 5e 64 f4 08 2e cf -Salt: \ -3f 2e fc 59 58 80 a7 d4 7f cf 3c ba 04 98 3e a5\ -4c 4b 73 fb -Signature: \ -18 da 3c dc fe 79 bf b7 7f d9 c3 2f 37 7a d3 99\ -14 6f 0a 8e 81 06 20 23 32 71 a6 e3 ed 32 48 90\ -3f 5c dc 92 dc 79 b5 5d 3e 11 61 5a a0 56 a7 95\ -85 37 92 a3 99 8c 34 9c a5 c4 57 e8 ca 7d 29 d7\ -96 aa 24 f8 34 91 70 9b ef cf b1 51 0e a5 13 c9\ -28 29 a3 f0 0b 10 4f 65 56 34 f3 20 75 2e 13 0e\ -c0 cc f6 75 4f f8 93 db 30 29 32 bb 02 5e b6 0e\ -87 82 25 98 fc 61 9e 0e 98 17 37 a9 a4 c4 15 2d\ -33 -Test: Verify -Comment: Example 8: A 1031-bit RSA Key Pair -Modulus: \ -49 53 70 a1 fb 18 54 3c 16 d3 63 1e 31 63 25 5d\ -f6 2b e6 ee e8 90 d5 f2 55 09 e4 f7 78 a8 ea 6f\ -bb bc df 85 df f6 4e 0d 97 20 03 ab 36 81 fb ba\ -6d d4 1f d5 41 82 9b 2e 58 2d e9 f2 a4 a4 e0 a2\ -d0 90 0b ef 47 53 db 3c ee 0e e0 6c 7d fa e8 b1\ -d5 3b 59 53 21 8f 9c ce ea 69 5b 08 66 8e de aa\ -dc ed 94 63 b1 d7 90 d5 eb f2 7e 91 15 b4 6c ad\ -4d 9a 2b 8e fa b0 56 1b 08 10 34 47 39 ad a0 73\ -3f -PublicExponent: \ -01 00 01 -PrivateExponent: \ -6c 66 ff e9 89 80 c3 8f cd ea b5 15 98 98 83 61\ -65 f4 b4 b8 17 c4 f6 a8 d4 86 ee 4e a9 13 0f e9\ -b9 09 2b d1 36 d1 84 f9 5f 50 4a 60 7e ac 56 58\ -46 d2 fd d6 59 7a 89 67 c7 39 6e f9 5a 6e ee bb\ -45 78 a6 43 96 6d ca 4d 8e e3 de 84 2d e6 32 79\ -c6 18 15 9c 1a b5 4a 89 43 7b 6a 61 20 e4 93 0a\ -fb 52 a4 ba 6c ed 8a 49 47 ac 64 b3 0a 34 97 cb\ -e7 01 c2 d6 26 6d 51 72 19 ad 0e c6 d3 47 db e9 -Prime1: \ -08 da d7 f1 13 63 fa a6 23 d5 d6 d5 e8 a3 19 32\ -8d 82 19 0d 71 27 d2 84 6c 43 9b 0a b7 26 19 b0\ -a4 3a 95 32 0e 4e c3 4f c3 a9 ce a8 76 42 23 05\ -bd 76 c5 ba 7b e9 e2 f4 10 c8 06 06 45 a1 d2 9e\ -db -Prime2: \ -08 47 e7 32 37 6f c7 90 0f 89 8e a8 2e b2 b0 fc\ -41 85 65 fd ae 62 f7 d9 ec 4c e2 21 7b 97 99 0d\ -d2 72 db 15 7f 99 f6 3c 0d cb b9 fb ac db d4 c4\ -da db 6d f6 77 56 35 8c a4 17 48 25 b4 8f 49 70\ -6d -ModPrime1PrivateExponent: \ -05 c2 a8 3c 12 4b 36 21 a2 aa 57 ea 2c 3e fe 03\ -5e ff 45 60 f3 3d de bb 7a da b8 1f ce 69 a0 c8\ -c2 ed c1 65 20 dd a8 3d 59 a2 3b e8 67 96 3a c6\ -5f 2c c7 10 bb cf b9 6e e1 03 de b7 71 d1 05 fd\ -85 -ModPrime2PrivateExponent: \ -04 ca e8 aa 0d 9f aa 16 5c 87 b6 82 ec 14 0b 8e\ -d3 b5 0b 24 59 4b 7a 3b 2c 22 0b 36 69 bb 81 9f\ -98 4f 55 31 0a 1a e7 82 36 51 d4 a0 2e 99 44 79\ -72 59 51 39 36 34 34 e5 e3 0a 7e 7d 24 15 51 e1\ -b9 -MultiplicativeInverseOfPrime2ModPrime1: \ -07 d3 e4 7b f6 86 60 0b 11 ac 28 3c e8 8d bb 3f\ -60 51 e8 ef d0 46 80 e4 4c 17 1e f5 31 b8 0b 2b\ -7c 39 fc 76 63 20 e2 cf 15 d8 d9 98 20 e9 6f f3\ -0d c6 96 91 83 9c 4b 40 d7 b0 6e 45 30 7d c9 1f\ -3f -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 8.1 -Message: \ -81 33 2f 4b e6 29 48 41 5e a1 d8 99 79 2e ea cf\ -6c 6e 1d b1 da 8b e1 3b 5c ea 41 db 2f ed 46 70\ -92 e1 ff 39 89 14 c7 14 25 97 75 f5 95 f8 54 7f\ -73 56 92 a5 75 e6 92 3a f7 8f 22 c6 99 7d db 90\ -fb 6f 72 d7 bb 0d d5 74 4a 31 de cd 3d c3 68 58\ -49 83 6e d3 4a ec 59 63 04 ad 11 84 3c 4f 88 48\ -9f 20 97 35 f5 fb 7f da f7 ce c8 ad dc 58 18 16\ -8f 88 0a cb f4 90 d5 10 05 b7 a8 e8 4e 43 e5 42\ -87 97 75 71 dd 99 ee a4 b1 61 eb 2d f1 f5 10 8f\ -12 a4 14 2a 83 32 2e db 05 a7 54 87 a3 43 5c 9a\ -78 ce 53 ed 93 bc 55 08 57 d7 a9 fb -Salt: \ -1d 65 49 1d 79 c8 64 b3 73 00 9b e6 f6 f2 46 7b\ -ac 4c 78 fa -Signature: \ -02 62 ac 25 4b fa 77 f3 c1 ac a2 2c 51 79 f8 f0\ -40 42 2b 3c 5b af d4 0a 8f 21 cf 0f a5 a6 67 cc\ -d5 99 3d 42 db af b4 09 c5 20 e2 5f ce 2b 1e e1\ -e7 16 57 7f 1e fa 17 f3 da 28 05 2f 40 f0 41 9b\ -23 10 6d 78 45 aa f0 11 25 b6 98 e7 a4 df e9 2d\ -39 67 bb 00 c4 d0 d3 5b a3 55 2a b9 a8 b3 ee f0\ -7c 7f ec db c5 42 4a c4 db 1e 20 cb 37 d0 b2 74\ -47 69 94 0e a9 07 e1 7f bb ca 67 3b 20 52 23 80\ -c5 -Test: Verify -Comment: RSASSA-PSS Signature Example 8.2 -Message: \ -e2 f9 6e af 0e 05 e7 ba 32 6e cc a0 ba 7f d2 f7\ -c0 23 56 f3 ce de 9d 0f aa bf 4f cc 8e 60 a9 73\ -e5 59 5f d9 ea 08 -Salt: \ -43 5c 09 8a a9 90 9e b2 37 7f 12 48 b0 91 b6 89\ -87 ff 18 38 -Signature: \ -27 07 b9 ad 51 15 c5 8c 94 e9 32 e8 ec 0a 28 0f\ -56 33 9e 44 a1 b5 8d 4d dc ff 2f 31 2e 5f 34 dc\ -fe 39 e8 9c 6a 94 dc ee 86 db bd ae 5b 79 ba 4e\ -08 19 a9 e7 bf d9 d9 82 e7 ee 6c 86 ee 68 39 6e\ -8b 3a 14 c9 c8 f3 4b 17 8e b7 41 f9 d3 f1 21 10\ -9b f5 c8 17 2f ad a2 e7 68 f9 ea 14 33 03 2c 00\ -4a 8a a0 7e b9 90 00 0a 48 dc 94 c8 ba c8 aa be\ -2b 09 b1 aa 46 c0 a2 aa 0e 12 f6 3f bb a7 75 ba\ -7e -Test: Verify -Comment: RSASSA-PSS Signature Example 8.3 -Message: \ -e3 5c 6e d9 8f 64 a6 d5 a6 48 fc ab 8a db 16 33\ -1d b3 2e 5d 15 c7 4a 40 ed f9 4c 3d c4 a4 de 79\ -2d 19 08 89 f2 0f 1e 24 ed 12 05 4a 6b 28 79 8f\ -cb 42 d1 c5 48 76 9b 73 4c 96 37 31 42 09 2a ed\ -27 76 03 f4 73 8d f4 dc 14 46 58 6d 0e c6 4d a4\ -fb 60 53 6d b2 ae 17 fc 7e 3c 04 bb fb bb d9 07\ -bf 11 7c 08 63 6f a1 6f 95 f5 1a 62 16 93 4d 3e\ -34 f8 50 30 f1 7b bb c5 ba 69 14 40 58 af f0 81\ -e0 b1 9c f0 3c 17 19 5c 5e 88 8b a5 8f 6f e0 a0\ -2e 5c 3b da 97 19 a7 -Salt: \ -c6 eb be 76 df 0c 4a ea 32 c4 74 17 5b 2f 13 68\ -62 d0 45 29 -Signature: \ -2a d2 05 09 d7 8c f2 6d 1b 6c 40 61 46 08 6e 4b\ -0c 91 a9 1c 2b d1 64 c8 7b 96 6b 8f aa 42 aa 0c\ -a4 46 02 23 23 ba 4b 1a 1b 89 70 6d 7f 4c 3b e5\ -7d 7b 69 70 2d 16 8a b5 95 5e e2 90 35 6b 8c 4a\ -29 ed 46 7d 54 7e c2 3c ba df 28 6c cb 58 63 c6\ -67 9d a4 67 fc 93 24 a1 51 c7 ec 55 aa c6 db 40\ -84 f8 27 26 82 5c fe 1a a4 21 bc 64 04 9f b4 2f\ -23 14 8f 9c 25 b2 dc 30 04 37 c3 8d 42 8a a7 5f\ -96 -Test: Verify -Comment: RSASSA-PSS Signature Example 8.4 -Message: \ -db c5 f7 50 a7 a1 4b e2 b9 3e 83 8d 18 d1 4a 86\ -95 e5 2e 8a dd 9c 0a c7 33 b8 f5 6d 27 47 e5 29\ -a0 cc a5 32 dd 49 b9 02 ae fe d5 14 44 7f 9e 81\ -d1 61 95 c2 85 38 68 cb 9b 30 f7 d0 d4 95 c6 9d\ -01 b5 c5 d5 0b 27 04 5d b3 86 6c 23 24 a4 4a 11\ -0b 17 17 74 6d e4 57 d1 c8 c4 5c 3c d2 a9 29 70\ -c3 d5 96 32 05 5d 4c 98 a4 1d 6e 99 e2 a3 dd d5\ -f7 f9 97 9a b3 cd 18 f3 75 05 d2 51 41 de 2a 1b\ -ff 17 b3 a7 dc e9 41 9e cc 38 5c f1 1d 72 84 0f\ -19 95 3f d0 50 92 51 f6 ca fd e2 89 3d 0e 75 c7\ -81 ba 7a 50 12 ca 40 1a 4f a9 9e 04 b3 c3 24 9f\ -92 6d 5a fe 82 cc 87 da b2 2c 3c 1b 10 5d e4 8e\ -34 ac e9 c9 12 4e 59 59 7a c7 eb f8 -Salt: \ -02 1f dc c6 eb b5 e1 9b 1c b1 6e 9c 67 f2 76 81\ -65 7f e2 0a -Signature: \ -1e 24 e6 e5 86 28 e5 17 50 44 a9 eb 6d 83 7d 48\ -af 12 60 b0 52 0e 87 32 7d e7 89 7e e4 d5 b9 f0\ -df 0b e3 e0 9e d4 de a8 c1 45 4f f3 42 3b b0 8e\ -17 93 24 5a 9d f8 bf 6a b3 96 8c 8e dd c3 b5 32\ -85 71 c7 7f 09 1c c5 78 57 69 12 df eb d1 64 b9\ -de 54 54 fe 0b e1 c1 f6 38 5b 32 83 60 ce 67 ec\ -7a 05 f6 e3 0e b4 5c 17 c4 8a c7 00 41 d2 ca b6\ -7f 0a 2a e7 aa fd cc 8d 24 5e a3 44 2a 63 00 cc\ -c7 -Test: Verify -Comment: RSASSA-PSS Signature Example 8.5 -Message: \ -04 dc 25 1b e7 2e 88 e5 72 34 85 b6 38 3a 63 7e\ -2f ef e0 76 60 c5 19 a5 60 b8 bc 18 bd ed b8 6e\ -ae 23 64 ea 53 ba 9d ca 6e b3 d2 e7 d6 b8 06 af\ -42 b3 e8 7f 29 1b 4a 88 81 d5 bf 57 2c c9 a8 5e\ -19 c8 6a cb 28 f0 98 f9 da 03 83 c5 66 d3 c0 f5\ -8c fd 8f 39 5d cf 60 2e 5c d4 0e 8c 71 83 f7 14\ -99 6e 22 97 ef -Salt: \ -c5 58 d7 16 7c bb 45 08 ad a0 42 97 1e 71 b1 37\ -7e ea 42 69 -Signature: \ -33 34 1b a3 57 6a 13 0a 50 e2 a5 cf 86 79 22 43\ -88 d5 69 3f 5a cc c2 35 ac 95 ad d6 8e 5e b1 ee\ -c3 16 66 d0 ca 7a 1c da 6f 70 a1 aa 76 2c 05 75\ -2a 51 95 0c db 8a f3 c5 37 9f 18 cf e6 b5 bc 55\ -a4 64 82 26 a1 5e 91 2e f1 9a d7 7a de ea 91 1d\ -67 cf ef d6 9b a4 3f a4 11 91 35 ff 64 21 17 ba\ -98 5a 7e 01 00 32 5e 95 19 f1 ca 6a 92 16 bd a0\ -55 b5 78 50 15 29 11 25 e9 0d cd 07 a2 ca 96 73\ -ee -Test: Verify -Comment: RSASSA-PSS Signature Example 8.6 -Message: \ -0e a3 7d f9 a6 fe a4 a8 b6 10 37 3c 24 cf 39 0c\ -20 fa 6e 21 35 c4 00 c8 a3 4f 5c 18 3a 7e 8e a4\ -c9 ae 09 0e d3 17 59 f4 2d c7 77 19 cc a4 00 ec\ -dc c5 17 ac fc 7a c6 90 26 75 b2 ef 30 c5 09 66\ -5f 33 21 48 2f c6 9a 9f b5 70 d1 5e 01 c8 45 d0\ -d8 e5 0d 2a 24 cb f1 cf 0e 71 49 75 a5 db 7b 18\ -d9 e9 e9 cb 91 b5 cb 16 86 90 60 ed 18 b7 b5 62\ -45 50 3f 0c af 90 35 2b 8d e8 1c b5 a1 d9 c6 33\ -60 92 f0 cd -Salt: \ -76 fd 4e 64 fd c9 8e b9 27 a0 40 3e 35 a0 84 e7\ -6b a9 f9 2a -Signature: \ -1e d1 d8 48 fb 1e db 44 12 9b d9 b3 54 79 5a f9\ -7a 06 9a 7a 00 d0 15 10 48 59 3e 0c 72 c3 51 7f\ -f9 ff 2a 41 d0 cb 5a 0a c8 60 d7 36 a1 99 70 4f\ -7c b6 a5 39 86 a8 8b bd 8a bc c0 07 6a 2c e8 47\ -88 00 31 52 5d 44 9d a2 ac 78 35 63 74 c5 36 e3\ -43 fa a7 cb a4 2a 5a aa 65 06 08 77 91 c0 6a 8e\ -98 93 35 ae d1 9b fa b2 d5 e6 7e 27 fb 0c 28 75\ -af 89 6c 21 b6 e8 e7 30 9d 04 e4 f6 72 7e 69 46\ -3e -Test: Verify -Comment: Example 9: A 1536-bit RSA Key Pair -Modulus: \ -e6 bd 69 2a c9 66 45 79 04 03 fd d0 f5 be b8 b9\ -bf 92 ed 10 00 7f c3 65 04 64 19 dd 06 c0 5c 5b\ -5b 2f 48 ec f9 89 e4 ce 26 91 09 97 9c bb 40 b4\ -a0 ad 24 d2 24 83 d1 ee 31 5a d4 cc b1 53 42 68\ -35 26 91 c5 24 f6 dd 8e 6c 29 d2 24 cf 24 69 73\ -ae c8 6c 5b f6 b1 40 1a 85 0d 1b 9a d1 bb 8c bc\ -ec 47 b0 6f 0f 8c 7f 45 d3 fc 8f 31 92 99 c5 43\ -3d db c2 b3 05 3b 47 de d2 ec d4 a4 ca ef d6 14\ -83 3d c8 bb 62 2f 31 7e d0 76 b8 05 7f e8 de 3f\ -84 48 0a d5 e8 3e 4a 61 90 4a 4f 24 8f b3 97 02\ -73 57 e1 d3 0e 46 31 39 81 5c 6f d4 fd 5a c5 b8\ -17 2a 45 23 0e cb 63 18 a0 4f 14 55 d8 4e 5a 8b -PublicExponent: \ -01 00 01 -PrivateExponent: \ -6a 7f d8 4f b8 5f ad 07 3b 34 40 6d b7 4f 8d 61\ -a6 ab c1 21 96 a9 61 dd 79 56 5e 9d a6 e5 18 7b\ -ce 2d 98 02 50 f7 35 95 75 35 92 70 d9 15 90 bb\ -0e 42 7c 71 46 0b 55 d5 14 10 b1 91 bc f3 09 fe\ -a1 31 a9 2c 8e 70 27 38 fa 71 9f 1e 00 41 f5 2e\ -40 e9 1f 22 9f 4d 96 a1 e6 f1 72 e1 55 96 b4 51\ -0a 6d ae c2 61 05 f2 be bc 53 31 6b 87 bd f2 13\ -11 66 60 70 e8 df ee 69 d5 2c 71 a9 76 ca ae 79\ -c7 2b 68 d2 85 80 dc 68 6d 9f 51 29 d2 25 f8 2b\ -3d 61 55 13 a8 82 b3 db 91 41 6b 48 ce 08 88 82\ -13 e3 7e eb 9a f8 00 d8 1c ab 32 8c e4 20 68 99\ -03 c0 0c 7b 5f d3 1b 75 50 3a 6d 41 96 84 d6 29 -Prime1: \ -f8 eb 97 e9 8d f1 26 64 ee fd b7 61 59 6a 69 dd\ -cd 0e 76 da ec e6 ed 4b f5 a1 b5 0a c0 86 f7 92\ -8a 4d 2f 87 26 a7 7e 51 5b 74 da 41 98 8f 22 0b\ -1c c8 7a a1 fc 81 0c e9 9a 82 f2 d1 ce 82 1e dc\ -ed 79 4c 69 41 f4 2c 7a 1a 0b 8c 4d 28 c7 5e c6\ -0b 65 22 79 f6 15 4a 76 2a ed 16 5d 47 de e3 67 -Prime2: \ -ed 4d 71 d0 a6 e2 4b 93 c2 e5 f6 b4 bb e0 5f 5f\ -b0 af a0 42 d2 04 fe 33 78 d3 65 c2 f2 88 b6 a8\ -da d7 ef e4 5d 15 3e ef 40 ca cc 7b 81 ff 93 40\ -02 d1 08 99 4b 94 a5 e4 72 8c d9 c9 63 37 5a e4\ -99 65 bd a5 5c bf 0e fe d8 d6 55 3b 40 27 f2 d8\ -62 08 a6 e6 b4 89 c1 76 12 80 92 d6 29 e4 9d 3d -ModPrime1PrivateExponent: \ -2b b6 8b dd fb 0c 4f 56 c8 55 8b ff af 89 2d 80\ -43 03 78 41 e7 fa 81 cf a6 1a 38 c5 e3 9b 90 1c\ -8e e7 11 22 a5 da 22 27 bd 6c de eb 48 14 52 c1\ -2a d3 d6 1d 5e 4f 77 6a 0a b5 56 59 1b ef e3 e5\ -9e 5a 7f dd b8 34 5e 1f 2f 35 b9 f4 ce e5 7c 32\ -41 4c 08 6a ec 99 3e 93 53 e4 80 d9 ee c6 28 9f -ModPrime2PrivateExponent: \ -4f f8 97 70 9f ad 07 97 46 49 45 78 e7 0f d8 54\ -61 30 ee ab 56 27 c4 9b 08 0f 05 ee 4a d9 f3 e4\ -b7 cb a9 d6 a5 df f1 13 a4 1c 34 09 33 68 33 f1\ -90 81 6d 8a 6b c4 2e 9b ec 56 b7 56 7d 0f 3c 9c\ -69 6d b6 19 b2 45 d9 01 dd 85 6d b7 c8 09 2e 77\ -e9 a1 cc cd 56 ee 4d ba 42 c5 fd b6 1a ec 26 69 -MultiplicativeInverseOfPrime2ModPrime1: \ -77 b9 d1 13 7b 50 40 4a 98 27 29 31 6e fa fc 7d\ -fe 66 d3 4e 5a 18 26 00 d5 f3 0a 0a 85 12 05 1c\ -56 0d 08 1d 4d 0a 18 35 ec 3d 25 a6 0f 4e 4d 6a\ -a9 48 b2 bf 3d bb 5b 12 4c bb c3 48 92 55 a3 a9\ -48 37 2f 69 78 49 67 45 f9 43 e1 db 4f 18 38 2c\ -ea a5 05 df c6 57 57 bb 3f 85 7a 58 dc e5 21 56 -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 9.1 -Message: \ -a8 8e 26 58 55 e9 d7 ca 36 c6 87 95 f0 b3 1b 59\ -1c d6 58 7c 71 d0 60 a0 b3 f7 f3 ea ef 43 79 59\ -22 02 8b c2 b6 ad 46 7c fc 2d 7f 65 9c 53 85 aa\ -70 ba 36 72 cd de 4c fe 49 70 cc 79 04 60 1b 27\ -88 72 bf 51 32 1c 4a 97 2f 3c 95 57 0f 34 45 d4\ -f5 79 80 e0 f2 0d f5 48 46 e6 a5 2c 66 8f 12 88\ -c0 3f 95 00 6e a3 2f 56 2d 40 d5 2a f9 fe b3 2f\ -0f a0 6d b6 5b 58 8a 23 7b 34 e5 92 d5 5c f9 79\ -f9 03 a6 42 ef 64 d2 ed 54 2a a8 c7 7d c1 dd 76\ -2f 45 a5 93 03 ed 75 e5 41 ca 27 1e 2b 60 ca 70\ -9e 44 fa 06 61 13 1e 8d 5d 41 63 fd 8d 39 85 66\ -ce 26 de 87 30 e7 2f 9c ca 73 76 41 c2 44 15 94\ -20 63 70 28 df 0a 18 07 9d 62 08 ea 8b 47 11 a2\ -c7 50 f5 -Salt: \ -c0 a4 25 31 3d f8 d7 56 4b d2 43 4d 31 15 23 d5\ -25 7e ed 80 -Signature: \ -58 61 07 22 6c 3c e0 13 a7 c8 f0 4d 1a 6a 29 59\ -bb 4b 8e 20 5b a4 3a 27 b5 0f 12 41 11 bc 35 ef\ -58 9b 03 9f 59 32 18 7c b6 96 d7 d9 a3 2c 0c 38\ -30 0a 5c dd a4 83 4b 62 d2 eb 24 0a f3 3f 79 d1\ -3d fb f0 95 bf 59 9e 0d 96 86 94 8c 19 64 74 7b\ -67 e8 9c 9a ba 5c d8 50 16 23 6f 56 6c c5 80 2c\ -b1 3e ad 51 bc 7c a6 be f3 b9 4d cb db b1 d5 70\ -46 97 71 df 0e 00 b1 a8 a0 67 77 47 2d 23 16 27\ -9e da e8 64 74 66 8d 4e 1e ff f9 5f 1d e6 1c 60\ -20 da 32 ae 92 bb f1 65 20 fe f3 cf 4d 88 f6 11\ -21 f2 4b bd 9f e9 1b 59 ca f1 23 5b 2a 93 ff 81\ -fc 40 3a dd f4 eb de a8 49 34 a9 cd af 8e 1a 9e -Test: Verify -Comment: RSASSA-PSS Signature Example 9.2 -Message: \ -c8 c9 c6 af 04 ac da 41 4d 22 7e f2 3e 08 20 c3\ -73 2c 50 0d c8 72 75 e9 5b 0d 09 54 13 99 3c 26\ -58 bc 1d 98 85 81 ba 87 9c 2d 20 1f 14 cb 88 ce\ -d1 53 a0 19 69 a7 bf 0a 7b e7 9c 84 c1 48 6b c1\ -2b 3f a6 c5 98 71 b6 82 7c 8c e2 53 ca 5f ef a8\ -a8 c6 90 bf 32 6e 8e 37 cd b9 6d 90 a8 2e ba b6\ -9f 86 35 0e 18 22 e8 bd 53 6a 2e -Salt: \ -b3 07 c4 3b 48 50 a8 da c2 f1 5f 32 e3 78 39 ef\ -8c 5c 0e 91 -Signature: \ -80 b6 d6 43 25 52 09 f0 a4 56 76 38 97 ac 9e d2\ -59 d4 59 b4 9c 28 87 e5 88 2e cb 44 34 cf d6 6d\ -d7 e1 69 93 75 38 1e 51 cd 7f 55 4f 2c 27 17 04\ -b3 99 d4 2b 4b e2 54 0a 0e ca 61 95 1f 55 26 7f\ -7c 28 78 c1 22 84 2d ad b2 8b 01 bd 5f 8c 02 5f\ -7e 22 84 18 a6 73 c0 3d 6b c0 c7 36 d0 a2 95 46\ -bd 67 f7 86 d9 d6 92 cc ea 77 8d 71 d9 8c 20 63\ -b7 a7 10 92 18 7a 4d 35 af 10 81 11 d8 3e 83 ea\ -e4 6c 46 aa 34 27 7e 06 04 45 89 90 37 88 f1 d5\ -e7 ce e2 5f b4 85 e9 29 49 11 88 14 d6 f2 c3 ee\ -36 14 89 01 6f 32 7f b5 bc 51 7e b5 04 70 bf fa\ -1a fa 5f 4c e9 aa 0c e5 b8 ee 19 bf 55 01 b9 58 -Test: Verify -Comment: RSASSA-PSS Signature Example 9.3 -Message: \ -0a fa d4 2c cd 4f c6 06 54 a5 50 02 d2 28 f5 2a\ -4a 5f e0 3b 8b bb 08 ca 82 da ca 55 8b 44 db e1\ -26 6e 50 c0 e7 45 a3 6d 9d 29 04 e3 40 8a bc d1\ -fd 56 99 94 06 3f 4a 75 cc 72 f2 fe e2 a0 cd 89\ -3a 43 af 1c 5b 8b 48 7d f0 a7 16 10 02 4e 4f 6d\ -df 9f 28 ad 08 13 c1 aa b9 1b cb 3c 90 64 d5 ff\ -74 2d ef fe a6 57 09 41 39 36 9e 5e a6 f4 a9 63\ -19 a5 cc 82 24 14 5b 54 50 62 75 8f ef d1 fe 34\ -09 ae 16 92 59 c6 cd fd 6b 5f 29 58 e3 14 fa ec\ -be 69 d2 ca ce 58 ee 55 17 9a b9 b3 e6 d1 ec c1\ -4a 55 7c 5f eb e9 88 59 52 64 fc 5d a1 c5 71 46\ -2e ca 79 8a 18 a1 a4 94 0c da b4 a3 e9 20 09 cc\ -d4 2e 1e 94 7b 13 14 e3 22 38 a2 de ce 7d 23 a8\ -9b 5b 30 c7 51 fd 0a 4a 43 0d 2c 54 85 94 -Salt: \ -9a 2b 00 7e 80 97 8b bb 19 2c 35 4e b7 da 9a ed\ -fc 74 db f5 -Signature: \ -48 44 08 f3 89 8c d5 f5 34 83 f8 08 19 ef bf 27\ -08 c3 4d 27 a8 b2 a6 fa e8 b3 22 f9 24 02 37 f9\ -81 81 7a ca 18 46 f1 08 4d aa 6d 7c 07 95 f6 e5\ -bf 1a f5 9c 38 e1 85 84 37 ce 1f 7e c4 19 b9 8c\ -87 36 ad f6 dd 9a 00 b1 80 6d 2b d3 ad 0a 73 77\ -5e 05 f5 2d fe f3 a5 9a b4 b0 81 43 f0 df 05 cd\ -1a d9 d0 4b ec ec a6 da a4 a2 12 98 03 e2 00 cb\ -c7 77 87 ca f4 c1 d0 66 3a 6c 59 87 b6 05 95 20\ -19 78 2c af 2e c1 42 6d 68 fb 94 ed 1d 4b e8 16\ -a7 ed 08 1b 77 e6 ab 33 0b 3f fc 07 38 20 fe cd\ -e3 72 7f cb e2 95 ee 61 a0 50 a3 43 65 86 37 c3\ -fd 65 9c fb 63 73 6d e3 2d 9f 90 d3 c2 f6 3e ca -Test: Verify -Comment: RSASSA-PSS Signature Example 9.4 -Message: \ -1d fd 43 b4 6c 93 db 82 62 9b da e2 bd 0a 12 b8\ -82 ea 04 c3 b4 65 f5 cf 93 02 3f 01 05 96 26 db\ -be 99 f2 6b b1 be 94 9d dd d1 6d c7 f3 de bb 19\ -a1 94 62 7f 0b 22 44 34 df 7d 87 00 e9 e9 8b 06\ -e3 60 c1 2f db e3 d1 9f 51 c9 68 4e b9 08 9e cb\ -b0 a2 f0 45 03 99 d3 f5 9e ac 72 94 08 5d 04 4f\ -53 93 c6 ce 73 74 23 d8 b8 6c 41 53 70 d3 89 e3\ -0b 9f 0a 3c 02 d2 5d 00 82 e8 ad 6f 3f 1e f2 4a\ -45 c3 cf 82 b3 83 36 70 63 a4 d4 61 3e 42 64 f0\ -1b 2d ac 2e 5a a4 20 43 f8 fb 5f 69 fa 87 1d 14\ -fb 27 3e 76 7a 53 1c 40 f0 2f 34 3b c2 fb 45 a0\ -c7 e0 f6 be 25 61 92 3a 77 21 1d 66 a6 e2 db b4\ -3c 36 63 50 be ae 22 da 3a c2 c1 f5 07 70 96 fc\ -b5 c4 bf 25 5f 75 74 35 1a e0 b1 e1 f0 36 32 81\ -7c 08 56 d4 a8 ba 97 af bd c8 b8 58 55 40 2b c5\ -69 26 fc ec 20 9f 9e a8 -Salt: \ -70 f3 82 bd df 4d 5d 2d d8 8b 3b c7 b7 30 8b e6\ -32 b8 40 45 -Signature: \ -84 eb eb 48 1b e5 98 45 b4 64 68 ba fb 47 1c 01\ -12 e0 2b 23 5d 84 b5 d9 11 cb d1 92 6e e5 07 4a\ -e0 42 44 95 cb 20 e8 23 08 b8 eb b6 5f 41 9a 03\ -fb 40 e7 2b 78 98 1d 88 aa d1 43 05 36 85 17 2c\ -97 b2 9c 8b 7b f0 ae 73 b5 b2 26 3c 40 3d a0 ed\ -2f 80 ff 74 50 af 78 28 eb 8b 86 f0 02 8b d2 a8\ -b1 76 a4 d2 28 cc ce a1 83 94 f2 38 b0 9f f7 58\ -cc 00 bc 04 30 11 52 35 57 42 f2 82 b5 4e 66 3a\ -91 9e 70 9d 8d a2 4a de 55 00 a7 b9 aa 50 22 6e\ -0c a5 29 23 e6 c2 d8 60 ec 50 ff 48 0f a5 74 77\ -e8 2b 05 65 f4 37 9f 79 c7 72 d5 c2 da 80 af 9f\ -bf 32 5e ce 6f c2 0b 00 96 16 14 be e8 9a 18 3e -Test: Verify -Comment: RSASSA-PSS Signature Example 9.5 -Message: \ -1b dc 6e 7c 98 fb 8c f5 4e 9b 09 7b 66 a8 31 e9\ -cf e5 2d 9d 48 88 44 8e e4 b0 97 80 93 ba 1d 7d\ -73 ae 78 b3 a6 2b a4 ad 95 cd 28 9c cb 9e 00 52\ -26 bb 3d 17 8b cc aa 82 1f b0 44 a4 e2 1e e9 76\ -96 c1 4d 06 78 c9 4c 2d ae 93 b0 ad 73 92 22 18\ -55 3d aa 7e 44 eb e5 77 25 a7 a4 5c c7 2b 9b 21\ -38 a6 b1 7c 8d b4 11 ce 82 79 ee 12 41 af f0 a8\ -be c6 f7 7f 87 ed b0 c6 9c b2 72 36 e3 43 5a 80\ -0b 19 2e 4f 11 e5 19 e3 fe 30 fc 30 ea cc ca 4f\ -bb 41 76 90 29 bf 70 8e 81 7a 9e 68 38 05 be 67\ -fa 10 09 84 68 3b 74 83 8e 3b cf fa 79 36 6e ed\ -1d 48 1c 76 72 91 18 83 8f 31 ba 8a 04 8a 93 c1\ -be 44 24 59 8e 8d f6 32 8b 7a 77 88 0a 3f 9c 7e\ -2e 8d fc a8 eb 5a 26 fb 86 bd c5 56 d4 2b be 01\ -d9 fa 6e d8 06 46 49 1c 93 41 -Salt: \ -d6 89 25 7a 86 ef fa 68 21 2c 5e 0c 61 9e ca 29\ -5f b9 1b 67 -Signature: \ -82 10 2d f8 cb 91 e7 17 99 19 a0 4d 26 d3 35 d6\ -4f bc 2f 87 2c 44 83 39 43 24 1d e8 45 48 10 27\ -4c df 3d b5 f4 2d 42 3d b1 52 af 71 35 f7 01 42\ -0e 39 b4 94 a6 7c bf d1 9f 91 19 da 23 3a 23 da\ -5c 64 39 b5 ba 0d 2b c3 73 ee e3 50 70 01 37 8d\ -4a 40 73 85 6b 7f e2 ab a0 b5 ee 93 b2 7f 4a fe\ -c7 d4 d1 20 92 1c 83 f6 06 76 5b 02 c1 9e 4d 6a\ -1a 3b 95 fa 4c 42 29 51 be 4f 52 13 10 77 ef 17\ -17 97 29 cd df bd b5 69 50 db ac ee fe 78 cb 16\ -64 0a 09 9e a5 6d 24 38 9e ef 10 f8 fe cb 31 ba\ -3e a3 b2 27 c0 a8 66 98 bb 89 e3 e9 36 39 05 bf\ -22 77 7b 2a 3a a5 21 b6 5b 4c ef 76 d8 3b de 4c -Test: Verify -Comment: RSASSA-PSS Signature Example 9.6 -Message: \ -88 c7 a9 f1 36 04 01 d9 0e 53 b1 01 b6 1c 53 25\ -c3 c7 5d b1 b4 11 fb eb 8e 83 0b 75 e9 6b 56 67\ -0a d2 45 40 4e 16 79 35 44 ee 35 4b c6 13 a9 0c\ -c9 84 87 15 a7 3d b5 89 3e 7f 6d 27 98 15 c0 c1\ -de 83 ef 8e 29 56 e3 a5 6e d2 6a 88 8d 7a 9c dc\ -d0 42 f4 b1 6b 7f a5 1e f1 a0 57 36 62 d1 6a 30\ -2d 0e c5 b2 85 d2 e0 3a d9 65 29 c8 7b 3d 37 4d\ -b3 72 d9 5b 24 43 d0 61 b6 b1 a3 50 ba 87 80 7e\ -d0 83 af d1 eb 05 c3 f5 2f 4e ba 5e d2 22 77 14\ -fd b5 0b 9d 9d 9d d6 81 4f 62 f6 27 2f cd 5c db\ -ce 7a 9e f7 97 -Salt: \ -c2 5f 13 bf 67 d0 81 67 1a 04 81 a1 f1 82 0d 61\ -3b ba 22 76 -Signature: \ -a7 fd b0 d2 59 16 5c a2 c8 8d 00 bb f1 02 8a 86\ -7d 33 76 99 d0 61 19 3b 17 a9 64 8e 14 cc bb aa\ -de ac aa cd ec 81 5e 75 71 29 4e bb 8a 11 7a f2\ -05 fa 07 8b 47 b0 71 2c 19 9e 3a d0 51 35 c5 04\ -c2 4b 81 70 51 15 74 08 02 48 79 92 ff d5 11 d4\ -af c6 b8 54 49 1e b3 f0 dd 52 31 39 54 2f f1 5c\ -31 01 ee 85 54 35 17 c6 a3 c7 94 17 c6 7e 2d d9\ -aa 74 1e 9a 29 b0 6d cb 59 3c 23 36 b3 67 0a e3\ -af ba c7 c3 e7 6e 21 54 73 e8 66 e3 38 ca 24 4d\ -e0 0b 62 62 4d 6b 94 26 82 2c ea e9 f8 cc 46 08\ -95 f4 12 50 07 3f d4 5c 5a 1e 7b 42 5c 20 4a 42\ -3a 69 91 59 f6 90 3e 71 0b 37 a7 bb 2b c8 04 9f -Test: Verify -Comment: Example 10: A 2048-bit RSA Key Pair -Modulus: \ -a5 dd 86 7a c4 cb 02 f9 0b 94 57 d4 8c 14 a7 70\ -ef 99 1c 56 c3 9c 0e c6 5f d1 1a fa 89 37 ce a5\ -7b 9b e7 ac 73 b4 5c 00 17 61 5b 82 d6 22 e3 18\ -75 3b 60 27 c0 fd 15 7b e1 2f 80 90 fe e2 a7 ad\ -cd 0e ef 75 9f 88 ba 49 97 c7 a4 2d 58 c9 aa 12\ -cb 99 ae 00 1f e5 21 c1 3b b5 43 14 45 a8 d5 ae\ -4f 5e 4c 7e 94 8a c2 27 d3 60 40 71 f2 0e 57 7e\ -90 5f be b1 5d fa f0 6d 1d e5 ae 62 53 d6 3a 6a\ -21 20 b3 1a 5d a5 da bc 95 50 60 0e 20 f2 7d 37\ -39 e2 62 79 25 fe a3 cc 50 9f 21 df f0 4e 6e ea\ -45 49 c5 40 d6 80 9f f9 30 7e ed e9 1f ff 58 73\ -3d 83 85 a2 37 d6 d3 70 5a 33 e3 91 90 09 92 07\ -0d f7 ad f1 35 7c f7 e3 70 0c e3 66 7d e8 3f 17\ -b8 df 17 78 db 38 1d ce 09 cb 4a d0 58 a5 11 00\ -1a 73 81 98 ee 27 cf 55 a1 3b 75 45 39 90 65 82\ -ec 8b 17 4b d5 8d 5d 1f 3d 76 7c 61 37 21 ae 05 -PublicExponent: \ -01 00 01 -PrivateExponent: \ -2d 2f f5 67 b3 fe 74 e0 61 91 b7 fd ed 6d e1 12\ -29 0c 67 06 92 43 0d 59 69 18 40 47 da 23 4c 96\ -93 de ed 16 73 ed 42 95 39 c9 69 d3 72 c0 4d 6b\ -47 e0 f5 b8 ce e0 84 3e 5c 22 83 5d bd 3b 05 a0\ -99 79 84 ae 60 58 b1 1b c4 90 7c bf 67 ed 84 fa\ -9a e2 52 df b0 d0 cd 49 e6 18 e3 5d fd fe 59 bc\ -a3 dd d6 6c 33 ce bb c7 7a d4 41 aa 69 5e 13 e3\ -24 b5 18 f0 1c 60 f5 a8 5c 99 4a d1 79 f2 a6 b5\ -fb e9 34 02 b1 17 67 be 01 bf 07 34 44 d6 ba 1d\ -d2 bc a5 bd 07 4d 4a 5f ae 35 31 ad 13 03 d8 4b\ -30 d8 97 31 8c bb ba 04 e0 3c 2e 66 de 6d 91 f8\ -2f 96 ea 1d 4b b5 4a 5a ae 10 2d 59 46 57 f5 c9\ -78 95 53 51 2b 29 6d ea 29 d8 02 31 96 35 7e 3e\ -3a 6e 95 8f 39 e3 c2 34 40 38 ea 60 4b 31 ed c6\ -f0 f7 ff 6e 71 81 a5 7c 92 82 6a 26 8f 86 76 8e\ -96 f8 78 56 2f c7 1d 85 d6 9e 44 86 12 f7 04 8f -Prime1: \ -cf d5 02 83 fe ee b9 7f 6f 08 d7 3c bc 7b 38 36\ -f8 2b bc d4 99 47 9f 5e 6f 76 fd fc b8 b3 8c 4f\ -71 dc 9e 88 bd 6a 6f 76 37 1a fd 65 d2 af 18 62\ -b3 2a fb 34 a9 5f 71 b8 b1 32 04 3f fe be 3a 95\ -2b af 75 92 44 81 48 c0 3f 9c 69 b1 d6 8e 4c e5\ -cf 32 c8 6b af 46 fe d3 01 ca 1a b4 03 06 9b 32\ -f4 56 b9 1f 71 89 8a b0 81 cd 8c 42 52 ef 52 71\ -91 5c 97 94 b8 f2 95 85 1d a7 51 0f 99 cb 73 eb -Prime2: \ -cc 4e 90 d2 a1 b3 a0 65 d3 b2 d1 f5 a8 fc e3 1b\ -54 44 75 66 4e ab 56 1d 29 71 b9 9f b7 be f8 44\ -e8 ec 1f 36 0b 8c 2a c8 35 96 92 97 1e a6 a3 8f\ -72 3f cc 21 1f 5d bc b1 77 a0 fd ac 51 64 a1 d4\ -ff 7f bb 4e 82 99 86 35 3c b9 83 65 9a 14 8c dd\ -42 0c 7d 31 ba 38 22 ea 90 a3 2b e4 6c 03 0e 8c\ -17 e1 fa 0a d3 78 59 e0 6b 0a a6 fa 3b 21 6d 9c\ -be 6c 0e 22 33 97 69 c0 a6 15 91 3e 5d a7 19 cf -ModPrime1PrivateExponent: \ -1c 2d 1f c3 2f 6b c4 00 4f d8 5d fd e0 fb bf 9a\ -4c 38 f9 c7 c4 e4 1d ea 1a a8 82 34 a2 01 cd 92\ -f3 b7 da 52 65 83 a9 8a d8 5b b3 60 fb 98 3b 71\ -1e 23 44 9d 56 1d 17 78 d7 a5 15 48 6b cb f4 7b\ -46 c9 e9 e1 a3 a1 f7 70 00 ef be b0 9a 8a fe 47\ -e5 b8 57 cd a9 9c b1 6d 7f ff 9b 71 2e 3b d6 0c\ -a9 6d 9c 79 73 d6 16 d4 69 34 a9 c0 50 28 1c 00\ -43 99 ce ff 1d b7 dd a7 87 66 a8 a9 b9 cb 08 73 -ModPrime2PrivateExponent: \ -cb 3b 3c 04 ca a5 8c 60 be 7d 9b 2d eb b3 e3 96\ -43 f4 f5 73 97 be 08 23 6a 1e 9e af aa 70 65 36\ -e7 1c 3a cf e0 1c c6 51 f2 3c 9e 05 85 8f ee 13\ -bb 6a 8a fc 47 df 4e dc 9a 4b a3 0b ce cb 73 d0\ -15 78 52 32 7e e7 89 01 5c 2e 8d ee 7b 9f 05 a0\ -f3 1a c9 4e b6 17 31 64 74 0c 5c 95 14 7c d5 f3\ -b5 ae 2c b4 a8 37 87 f0 1d 8a b3 1f 27 c2 d0 ee\ -a2 dd 8a 11 ab 90 6a ba 20 7c 43 c6 ee 12 53 31 -MultiplicativeInverseOfPrime2ModPrime1: \ -12 f6 b2 cf 13 74 a7 36 fa d0 56 16 05 0f 96 ab\ -4b 61 d1 17 7c 7f 9d 52 5a 29 f3 d1 80 e7 76 67\ -e9 9d 99 ab f0 52 5d 07 58 66 0f 37 52 65 5b 0f\ -25 b8 df 84 31 d9 a8 ff 77 c1 6c 12 a0 a5 12 2a\ -9f 0b f7 cf d5 a2 66 a3 5c 15 9f 99 12 08 b9 03\ -16 ff 44 4f 3e 0b 6b d0 e9 3b 8a 7a 24 48 e9 57\ -e3 dd a6 cf cf 22 66 b1 06 01 3a c4 68 08 d3 b3\ -88 7b 3b 00 34 4b aa c9 53 0b 4c e7 08 fc 32 b6 -Test: KeyPairValidAndConsistent -Comment: RSASSA-PSS Signature Example 10.1 -Message: \ -88 31 77 e5 12 6b 9b e2 d9 a9 68 03 27 d5 37 0c\ -6f 26 86 1f 58 20 c4 3d a6 7a 3a d6 09 -Salt: \ -04 e2 15 ee 6f f9 34 b9 da 70 d7 73 0c 87 34 ab\ -fc ec de 89 -Signature: \ -82 c2 b1 60 09 3b 8a a3 c0 f7 52 2b 19 f8 73 54\ -06 6c 77 84 7a bf 2a 9f ce 54 2d 0e 84 e9 20 c5\ -af b4 9f fd fd ac e1 65 60 ee 94 a1 36 96 01 14\ -8e ba d7 a0 e1 51 cf 16 33 17 91 a5 72 7d 05 f2\ -1e 74 e7 eb 81 14 40 20 69 35 d7 44 76 5a 15 e7\ -9f 01 5c b6 6c 53 2c 87 a6 a0 59 61 c8 bf ad 74\ -1a 9a 66 57 02 28 94 39 3e 72 23 73 97 96 c0 2a\ -77 45 5d 0f 55 5b 0e c0 1d df 25 9b 62 07 fd 0f\ -d5 76 14 ce f1 a5 57 3b aa ff 4e c0 00 69 95 16\ -59 b8 5f 24 30 0a 25 16 0c a8 52 2d c6 e6 72 7e\ -57 d0 19 d7 e6 36 29 b8 fe 5e 89 e2 5c c1 5b eb\ -3a 64 75 77 55 92 99 28 0b 9b 28 f7 9b 04 09 00\ -0b e2 5b bd 96 40 8b a3 b4 3c c4 86 18 4d d1 c8\ -e6 25 53 fa 1a f4 04 0f 60 66 3d e7 f5 e4 9c 04\ -38 8e 25 7f 1c e8 9c 95 da b4 8a 31 5d 9b 66 b1\ -b7 62 82 33 87 6f f2 38 52 30 d0 70 d0 7e 16 66 -Comment: RSASSA-PSS Signature Example 10.2 -Message: \ -dd 67 0a 01 46 58 68 ad c9 3f 26 13 19 57 a5 0c\ -52 fb 77 7c db aa 30 89 2c 9e 12 36 11 64 ec 13\ -97 9d 43 04 81 18 e4 44 5d b8 7b ee 58 dd 98 7b\ -34 25 d0 20 71 d8 db ae 80 70 8b 03 9d bb 64 db\ -d1 de 56 57 d9 fe d0 c1 18 a5 41 43 74 2e 0f f3\ -c8 7f 74 e4 58 57 64 7a f3 f7 9e b0 a1 4c 9d 75\ -ea 9a 1a 04 b7 cf 47 8a 89 7a 70 8f d9 88 f4 8e\ -80 1e db 0b 70 39 df 8c 23 bb 3c 56 f4 e8 21 ac -Salt: \ -8b 2b dd 4b 40 fa f5 45 c7 78 dd f9 bc 1a 49 cb\ -57 f9 b7 1b -Signature: \ -14 ae 35 d9 dd 06 ba 92 f7 f3 b8 97 97 8a ed 7c\ -d4 bf 5f f0 b5 85 a4 0b d4 6c e1 b4 2c d2 70 30\ -53 bb 90 44 d6 4e 81 3d 8f 96 db 2d d7 00 7d 10\ -11 8f 6f 8f 84 96 09 7a d7 5e 1f f6 92 34 1b 28\ -92 ad 55 a6 33 a1 c5 5e 7f 0a 0a d5 9a 0e 20 3a\ -5b 82 78 ae c5 4d d8 62 2e 28 31 d8 71 74 f8 ca\ -ff 43 ee 6c 46 44 53 45 d8 4a 59 65 9b fb 92 ec\ -d4 c8 18 66 86 95 f3 47 06 f6 68 28 a8 99 59 63\ -7f 2b f3 e3 25 1c 24 bd ba 4d 4b 76 49 da 00 22\ -21 8b 11 9c 84 e7 9a 65 27 ec 5b 8a 5f 86 1c 15\ -99 52 e2 3e c0 5e 1e 71 73 46 fa ef e8 b1 68 68\ -25 bd 2b 26 2f b2 53 10 66 c0 de 09 ac de 2e 42\ -31 69 07 28 b5 d8 5e 11 5a 2f 6b 92 b7 9c 25 ab\ -c9 bd 93 99 ff 8b cf 82 5a 52 ea 1f 56 ea 76 dd\ -26 f4 3b aa fa 18 bf a9 2a 50 4c bd 35 69 9e 26\ -d1 dc c5 a2 88 73 85 f3 c6 32 32 f0 6f 32 44 c3 -Comment: RSASSA-PSS Signature Example 10.3 -Message: \ -48 b2 b6 a5 7a 63 c8 4c ea 85 9d 65 c6 68 28 4b\ -08 d9 6b dc aa be 25 2d b0 e4 a9 6c b1 ba c6 01\ -93 41 db 6f be fb 8d 10 6b 0e 90 ed a6 bc c6 c6\ -26 2f 37 e7 ea 9c 7e 5d 22 6b d7 df 85 ec 5e 71\ -ef ff 2f 54 c5 db 57 7f f7 29 ff 91 b8 42 49 1d\ -e2 74 1d 0c 63 16 07 df 58 6b 90 5b 23 b9 1a f1\ -3d a1 23 04 bf 83 ec a8 a7 3e 87 1f f9 db -Salt: \ -4e 96 fc 1b 39 8f 92 b4 46 71 01 0c 0d c3 ef d6\ -e2 0c 2d 73 -Signature: \ -6e 3e 4d 7b 6b 15 d2 fb 46 01 3b 89 00 aa 5b bb\ -39 39 cf 2c 09 57 17 98 70 42 02 6e e6 2c 74 c5\ -4c ff d5 d7 d5 7e fb bf 95 0a 0f 5c 57 4f a0 9d\ -3f c1 c9 f5 13 b0 5b 4f f5 0d d8 df 7e df a2 01\ -02 85 4c 35 e5 92 18 01 19 a7 0c e5 b0 85 18 2a\ -a0 2d 9e a2 aa 90 d1 df 03 f2 da ae 88 5b a2 f5\ -d0 5a fd ac 97 47 6f 06 b9 3b 5b c9 4a 1a 80 aa\ -91 16 c4 d6 15 f3 33 b0 98 89 2b 25 ff ac e2 66\ -f5 db 5a 5a 3b cc 10 a8 24 ed 55 aa d3 5b 72 78\ -34 fb 8c 07 da 28 fc f4 16 a5 d9 b2 22 4f 1f 8b\ -44 2b 36 f9 1e 45 6f de a2 d7 cf e3 36 72 68 de\ -03 07 a4 c7 4e 92 41 59 ed 33 39 3d 5e 06 55 53\ -1c 77 32 7b 89 82 1b de df 88 01 61 c7 8c d4 19\ -6b 54 19 f7 ac c3 f1 3e 5e bf 16 1b 6e 7c 67 24\ -71 6c a3 3b 85 c2 e2 56 40 19 2a c2 85 96 51 d5\ -0b de 7e b9 76 e5 1c ec 82 8b 98 b6 56 3b 86 bb -Comment: RSASSA-PSS Signature Example 10.4 -Message: \ -0b 87 77 c7 f8 39 ba f0 a6 4b bb db c5 ce 79 75\ -5c 57 a2 05 b8 45 c1 74 e2 d2 e9 05 46 a0 89 c4\ -e6 ec 8a df fa 23 a7 ea 97 ba e6 b6 5d 78 2b 82\ -db 5d 2b 5a 56 d2 2a 29 a0 5e 7c 44 33 e2 b8 2a\ -62 1a bb a9 0a dd 05 ce 39 3f c4 8a 84 05 42 45\ -1a -Salt: \ -c7 cd 69 8d 84 b6 51 28 d8 83 5e 3a 8b 1e b0 e0\ -1c b5 41 ec -Signature: \ -34 04 7f f9 6c 4d c0 dc 90 b2 d4 ff 59 a1 a3 61\ -a4 75 4b 25 5d 2e e0 af 7d 8b f8 7c 9b c9 e7 dd\ -ee de 33 93 4c 63 ca 1c 0e 3d 26 2c b1 45 ef 93\ -2a 1f 2c 0a 99 7a a6 a3 4f 8e ae e7 47 7d 82 cc\ -f0 90 95 a6 b8 ac ad 38 d4 ee c9 fb 7e ab 7a d0\ -2d a1 d1 1d 8e 54 c1 82 5e 55 bf 58 c2 a2 32 34\ -b9 02 be 12 4f 9e 90 38 a8 f6 8f a4 5d ab 72 f6\ -6e 09 45 bf 1d 8b ac c9 04 4c 6f 07 09 8c 9f ce\ -c5 8a 3a ab 10 0c 80 51 78 15 5f 03 0a 12 4c 45\ -0e 5a cb da 47 d0 e4 f1 0b 80 a2 3f 80 3e 77 4d\ -02 3b 00 15 c2 0b 9f 9b be 7c 91 29 63 38 d5 ec\ -b4 71 ca fb 03 20 07 b6 7a 60 be 5f 69 50 4a 9f\ -01 ab b3 cb 46 7b 26 0e 2b ce 86 0b e8 d9 5b f9\ -2c 0c 8e 14 96 ed 1e 52 85 93 a4 ab b6 df 46 2d\ -de 8a 09 68 df fe 46 83 11 68 57 a2 32 f5 eb f6\ -c8 5b e2 38 74 5a d0 f3 8f 76 7a 5f db f4 86 fb -Comment: RSASSA-PSS Signature Example 10.5 -Message: \ -f1 03 6e 00 8e 71 e9 64 da dc 92 19 ed 30 e1 7f\ -06 b4 b6 8a 95 5c 16 b3 12 b1 ed df 02 8b 74 97\ -6b ed 6b 3f 6a 63 d4 e7 78 59 24 3c 9c cc dc 98\ -01 65 23 ab b0 24 83 b3 55 91 c3 3a ad 81 21 3b\ -b7 c7 bb 1a 47 0a ab c1 0d 44 25 6c 4d 45 59 d9\ -16 -Salt: \ -ef a8 bf f9 62 12 b2 f4 a3 f3 71 a1 0d 57 41 52\ -65 5f 5d fb -Signature: \ -7e 09 35 ea 18 f4 d6 c1 d1 7c e8 2e b2 b3 83 6c\ -55 b3 84 58 9c e1 9d fe 74 33 63 ac 99 48 d1 f3\ -46 b7 bf dd fe 92 ef d7 8a db 21 fa ef c8 9a de\ -42 b1 0f 37 40 03 fe 12 2e 67 42 9a 1c b8 cb d1\ -f8 d9 01 45 64 c4 4d 12 01 16 f4 99 0f 1a 6e 38\ -77 4c 19 4b d1 b8 21 32 86 b0 77 b0 49 9d 2e 7b\ -3f 43 4a b1 22 89 c5 56 68 4d ee d7 81 31 93 4b\ -b3 dd 65 37 23 6f 7c 6f 3d cb 09 d4 76 be 07 72\ -1e 37 e1 ce ed 9b 2f 7b 40 68 87 bd 53 15 73 05\ -e1 c8 b4 f8 4d 73 3b c1 e1 86 fe 06 cc 59 b6 ed\ -b8 f4 bd 7f fe fd f4 f7 ba 9c fb 9d 57 06 89 b5\ -a1 a4 10 9a 74 6a 69 08 93 db 37 99 25 5a 0c b9\ -21 5d 2d 1c d4 90 59 0e 95 2e 8c 87 86 aa 00 11\ -26 52 52 47 0c 04 1d fb c3 ee c7 c3 cb f7 1c 24\ -86 9d 11 5c 0c b4 a9 56 f5 6d 53 0b 80 ab 58 9a\ -cf ef c6 90 75 1d df 36 e8 d3 83 f8 3c ed d2 cc -Comment: RSASSA-PSS Signature Example 10.6 -Message: \ -25 f1 08 95 a8 77 16 c1 37 45 0b b9 51 9d fa a1\ -f2 07 fa a9 42 ea 88 ab f7 1e 9c 17 98 00 85 b5\ -55 ae ba b7 62 64 ae 2a 3a b9 3c 2d 12 98 11 91\ -dd ac 6f b5 94 9e b3 6a ee 3c 5d a9 40 f0 07 52\ -c9 16 d9 46 08 fa 7d 97 ba 6a 29 15 b6 88 f2 03\ -23 d4 e9 d9 68 01 d8 9a 72 ab 58 92 dc 21 17 c0\ -74 34 fc f9 72 e0 58 cf 8c 41 ca 4b 4f f5 54 f7\ -d5 06 8a d3 15 5f ce d0 f3 12 5b c0 4f 91 93 37\ -8a 8f 5c 4c 3b 8c b4 dd 6d 1c c6 9d 30 ec ca 6e\ -aa 51 e3 6a 05 73 0e 9e 34 2e 85 5b af 09 9d ef\ -b8 af d7 -Salt: \ -ad 8b 15 23 70 36 46 22 4b 66 0b 55 08 85 91 7c\ -a2 d1 df 28 -Signature: \ -6d 3b 5b 87 f6 7e a6 57 af 21 f7 54 41 97 7d 21\ -80 f9 1b 2c 5f 69 2d e8 29 55 69 6a 68 67 30 d9\ -b9 77 8d 97 07 58 cc b2 60 71 c2 20 9f fb d6 12\ -5b e2 e9 6e a8 1b 67 cb 9b 93 08 23 9f da 17 f7\ -b2 b6 4e cd a0 96 b6 b9 35 64 0a 5a 1c b4 2a 91\ -55 b1 c9 ef 7a 63 3a 02 c5 9f 0d 6e e5 9b 85 2c\ -43 b3 50 29 e7 3c 94 0f f0 41 0e 8f 11 4e ed 46\ -bb d0 fa e1 65 e4 2b e2 52 8a 40 1c 3b 28 fd 81\ -8e f3 23 2d ca 9f 4d 2a 0f 51 66 ec 59 c4 23 96\ -d6 c1 1d bc 12 15 a5 6f a1 71 69 db 95 75 34 3e\ -f3 4f 9d e3 2a 49 cd c3 17 49 22 f2 29 c2 3e 18\ -e4 5d f9 35 31 19 ec 43 19 ce dc e7 a1 7c 64 08\ -8c 1f 6f 52 be 29 63 41 00 b3 91 9d 38 f3 d1 ed\ -94 e6 89 1e 66 a7 3b 8f b8 49 f5 87 4d f5 94 59\ -e2 98 c7 bb ce 2e ee 78 2a 19 5a a6 6f e2 d0 73\ -2b 25 e5 95 f5 7d 3e 06 1b 1f c3 e4 06 3b f9 8f -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/rw.txt b/external/crypto++-5.6.3/TestVectors/rw.txt deleted file mode 100644 index 2d932d07d..000000000 --- a/external/crypto++-5.6.3/TestVectors/rw.txt +++ /dev/null @@ -1,166 +0,0 @@ -AlgorithmType: Signature -Name: RW/EMSA2(SHA-1) -Source: generated by Wei Dai using Crypto++ 5.1 -Comment: 1024-bit RW key -KeyFormat: Component -Modulus: \ - e5eb47bc1f82db3001faaeabc5bbe71b7d307b431889ac10255262281ec5f5af\ - 8a790bd7bbec5efffa442cf2c3fd5ca4778763b9d15aeac0b9b71bdb13da8272\ - 7f4967ac685975f8ff05a763c864d100b7cc1142102aa2dd343ea1a0ab530255\ - 195c3a6400ecab7b27eff9b01ef6d37381fa6fb5401347f195354396772e8285 -Prime1: \ - ef86dd7af3f32cde8a9f6564e43a559a0c9f8bad36cc25330548b347ac158a34\ - 5631fa90f7b873c36effae2f7823227a3f580b5dd18304d5932751e743e9281b -Prime2: \ - f5bb4289c389d9019c36f96c6b81fffbf20be0620c6343e2b800aefb1b55a330\ - 8cc1402da7a2a558579a2a5146b30cb08e3f20b501081248f2f1de36cdfce9df -MultiplicativeInverseOfPrime2ModPrime1: \ - 88813a3d50b7c301948ee1985db19c9fd33a47c78c977024745e10483d9cc4f0\ - f573597ce564a91421d1d7457bc45a971f7d8b31403298da77799b57cf9a76de -PublicExponent: 02 -Test: KeyPairValidAndConsistent -Message: 2CA039854B55688740E3 -Signature: 1AF029CBEC9C692CE5096E73E4E9A52EC9A28D207A5511CCEC7681E5E3D867A4AE2E22DE4909D89196A272F1B50DE6FA3248BCA334D46E0D57171A790B6F4697E7BA7047DB79DECD47BD21995243DEBBF25915DDBC93C45875C14DE953792257C5C6825C905AFF40109C8CC7E793123D47AC1B5B6304A436CFA9BEEC8E0054E7 -Test: Verify -Message: 2A51DF4AF88613D91A37 -Signature: 6FF18F4471E1A8F850C910A181A9F28E69AACD8E8126969605E000A853197541AF9047E5D17315BF062B9CD8DF91196F0343285D9E31D5C72560C156782B6D0E5AF8F06D7DCDD8CABEC01B2438C168C40C21F6A8794648361BD2AEE13573A49ECA07A7EED97C0B9C5B1E508869E4CFD5FE1771924B1CF5A4BFF7D4379E5CD59F -Test: Verify -Message: 1CF8DDD95D780A89D7CF -Signature: 539C266B0313E0E256ED98EEF13E6AE64CED90C160A4999B3D47CBDA5285DAB0E0678C0E079CE9B8EB23E10EDFACFC19A80EEBB8F38ED5B5D6C8A988AB8CEC40A5A5BA102F75586167EAB6D5BF0CE8FF30C656895800F6F1B37D69FBBAF9055F7505DBEB537C0F986A1B5F0270DC12A640FFCB626F9763FDCFEFA1208C104003 -Test: Verify -Message: 2119A954F1AC0F3DCDB2 -Signature: 60C3CCF4F086B15B7F850B445F384333F7AE5A4B5EDE2820C7233239E1B86D6E4B4FCA4F50B087CE1DF17DA5D62672A17F2CF87A2875BBD9B138CAF6863821D6A4D553E9EB64C9254A8F9A6B960E57E39069D65E3F561AA1FA91643D42FEEFB9270D34AB0861DEA1E234EA587F580503D46A1989D413DAC2FFE0FC4CA663CE68 -Test: Verify -Message: F6959926E6D9D37D8BC0 -Signature: 249E1066542618CE0D236A7174708F801E7AB257931E9967A65C483ED66FB58598F99B6664AF0EAE221E2A6B271D7D17875ED02BF7FE35AA0786023858521CB79FEE0D134D9DDA609B0270FC9804BB6BF74AD90AE11EB339353533DC0D5A69E6B8758212B86024ED563767EA5D9B59655E0B8CC21244F720BA4ED663BF668E3A -Test: Verify -Message: 7A4C634DE6F16315BD5F -Signature: 308A5D65224201BED626CC83FB901EC84874EE03B2E7AB4E752EDBDE024C754E3CC9841CA062100A8843DE9183354B4E0596E8C68F1605828287884F0F9BA6968FC7A9F0CA09418A8485B90465E5D3F96CE4995A5FC7A6E5ABD9CC06BB8A2C3C8109F72EAE67FB4C108852C881CA645B3C5586F27F12FF3028ADE56E32AD9434 -Test: Verify -Comment: 1032-bit RW key -KeyFormat: Component -Modulus: \ - b660eb18786256c993ebc6dcb5892eac342f6d91229b73dc5d04f1afb9bb0dd4\ - eb0b48895f514b4c9afeaf86e91226f2299126d37528ce374e89cc312c06f47c\ - 81112bf5ca60ffc33b98318e04a17627269f1af461b6cb40f3be03b0113fb2d8\ - 404e154c7191306b36fd3efa73c784ad9189115d0bb1bd82b850d000e7cc8d20\ - 35 -Prime1: \ - 0bc31c063f43b3ade2cd633d554913339071d6ebed5fd665fc5dd7d47b80721a\ - 976c3b14fbd253f0f988c354725289f2897d7fb62c5c74af7d597a1e22aafba1\ - d3 -Prime2: \ - 0f816bf0add559afda38b008e4087f6a38b575c56fff453056eaaab3381c9552\ - 0969546f954d458d48e44850938b1db471cf4b40afc47e067fb5bce67ba98be8\ - d7 -MultiplicativeInverseOfPrime2ModPrime1: \ - 0b684eeec75b3e24e2d9947341b3f462258628af6f0b881396c887fe26a3408c\ - 40b13370710c82dd4a021a87bbaab5c0fc96cb1d015a783a764a8ab7b002903d\ - 21 -PublicExponent: 02 -Test: KeyPairValidAndConsistent -Message: EF0F1D56F4E5D587C212 -Signature: 3E544FEBB6623F5D392003B729FE2BFC20E2CB3ECAC22734DFCA55150254E616A41C5E54CE3B50FBC2FE2363EE9AF9B15C70615497B0A458F8AB6D850992EEEB56D65F87EA1BD6E2B4B7E40A0F5E1635C7DDB17110C61039CF712D3524C9C2C1F35D9163BE5C70276F46634514BE16EC09602782E88FE74EAEB2F50CBB0E3B5C4A -Test: Verify -Message: 2C9EA313EACF2C5DA43A -Signature: 1FEFF88814BB53E447E1E955AC8F1AF597C15C3866033E337AFBAB8627306F2EC1276621FF2176C89323CE32EA20F6AEC2CC271F1ED749408B2A3E43A23A44D6A3F38DCDDCAB696B239110AA7ECF12C6681B0E97E6FFF1B72F4F6D796BF82B9450AB8B3D28CA9D220BDF84ACCEA1DA5EDA0B470C3A82BBDD77B4C2723297608BD4 -Test: Verify -Message: EC5CC4228C3C70EE8F35 -Signature: 228BAA85062F10DCC9D99A23D340BC4B9E463D8AB86A6781A6D2143564303E2DC78772BF68449BE1E2711A68D5A15CF04A23573FB3870454308F583BBB5F2467069EF1395431E70F91BD56D846DC8DB2E88AB3D26A9770660B87A76D6C3575DE512BAFA8A0B901AD15B7D8E8BE2F176A182D16A9609F19A4298416245873175805 -Test: Verify -Message: D81F0C6F2D3D60EE19FE -Signature: 17EAA0C18178CD45A2B9100997F682E5F02BE09FBE4D8F345033951345CE98C8B3F13F2CA2A950CE7BDCBF83DBB700890E1F0B863D04C3ADB298F546A8F09F4DA4EF0DC6E7317207CB3CF691114E55D9EAA11C53BE55F7C214F62E6B0460DFA60C55B16EB55B29C9DBB908266C1BDBB03AD651EFB91905B142D852DCA0C4E3BBEE -Test: Verify -Message: FEF5EE07C74118DA30B9 -Signature: 2637E16E2599B6EC2F4728C73D3B29F483C2B881F1E1969C426027605EF080E9B17D258D5E1EBC6472A2501E04CF19C144537FCB38A1DA00D948EBD39FA11322D9230B62E2C12AEDB366BD85A2089588A8D52E941FD986D89828A342B83438A960B6FD87E9AD025AD75A692AA9DFEA873A9467B42D84879E85C5D11EFAB347FBED -Test: Verify -Message: 0B9554FFE4F6ADAB2C76 -Signature: 095952F24D9FBEF3A93A932865F4BDBB522CF24EBE153CE4BBB24CF301A1C7B51FE47B94F8F8B211CBC5A926FF6BAF9A6BBF7E15975D2DCCB95EF01AB7E641687870B0D01FC18B6B16FE17D3FC82931FBBCD4FD18C7F9588CEE8491876D72F98F2E7EEA90C12907210D6859053ADC7178B87BF8B4826954D6986FE761E71E1B7EA -Test: Verify -Comment: 1536-bit RW key -KeyFormat: Component -Modulus: \ - 9f8f8ab78ad635c71c9ef0fce9d4a958a9013ed69fcd67c385722668d4357c32\ - 3732c78179eaa17984531ba570aa0721a1e228957b1008010f1a2d6c42e09847\ - 9ffeaff9bbfeb3c8e101f968fc7ac74cfba210f76a6da160e65934d216368763\ - 8f59e414dc6f0448c0b4052c90f7dc565d32acae5da04e3e157dca184aba8362\ - bb28a2da6915d51d65f54fbeee69104a5a1b2304b87230c504b126dcf1c377cf\ - 1777b93be6903b50a44f054ae233b7cc24f950ded467cb8ffbdb17e7b6937605 -Prime1: \ - d0505c510a3b38a139d6d139818b04251d6ca46c2e717cfafbeebcd5fff8ae62\ - de4698e3241784f05e8c86f0f996db77259ebaac6983f092853639f619b75701\ - e562408cc1f5c543cada21fc26af36905b10a0df5b111efd754666bb3db4be63 -Prime2: \ - c41623ccb51e2474eb3dc5c2ef42cfd320a285ef7aefc1d1edcd5f566549cb79\ - 7285f01c89b9f749ca506b717c2a45b708fec2e7d611c5eee6af0a6d61219c7d\ - cab18961e98eea3b7797c61a75aed21d411de4fcf4a009a8238a832dd6e41277 -MultiplicativeInverseOfPrime2ModPrime1: \ - bc1ceeed917217387ead12254cfc183f82c79709499f510ce093d6d28bc1bf2b\ - fabc3d86d64a1c807605bd57f9ec533745d6e359270885c3eb7a36a02dff7137\ - 9bd453bf3fdc282afa2295d5e393f1c2c74edcbd2374c7740e8135ef0b8af258 -PublicExponent: 02 -Test: KeyPairValidAndConsistent -Message: 400AEF79EDBCEA796D71 -Signature: 15EB5A68CBCB0D6313BB2D14436237A716AC3159B059FBC29931933DB802D6925C01BDC6D90DD0DA25980F1C8199AB9CD3FD105A63D13B5C0101A0430455334492038FBE029BF4EE61F8A2F88D2A6D5424DE7C0CC314B5EA4F867B35224D574463BDE78B71904033C1455484865EB80AE1C2A7D1C229CD0A4D49C0F06A26E264AD42ACAA131F8C0C5EA4DC9EB5BD349D1EE12B3F91F4B9F2DABC3BCF0E216D4A34A3541169955BE45289CECE16DA6BC5352FF31D66538F64308D6FBB9C7DDE72 -Test: Verify -Message: 63F64BFAD5B830682F44 -Signature: 1003E58A73B018FF9F0F66D3BE9A8DD9D83097A0EB216AEEAA75B63C150AAE9E8BE2A5DE426D18FBC56865F4C9CA51A9BB6E99B70C59B7995246A1F4327C9E4A69517131DA66DDE98AE5D8355527D1C5E4D83CC7ED7B3B1F404F6FDF731DA615974F0777CD22C1E6FAA3569D1141900734C7F3262FE7B9ED291A934DE81A06EBF258F7159DE842737A32DAEC79EFE211C2739D3F5859CB9A633D2A16D78C347790241925C3E776F04B5D5F1900A7B48645DF16DC6F9E8C990AEFEE22FA1DA496 -Test: Verify -Message: B6AAE87E8D469A16A335 -Signature: 368EE32DDF9D5526E50B1645473DB79CE4B0EF3801F3DF050E8B6B10DFAA600A505FD1C91CAE1CD8CB8FA7BC2F81EDFEE7E74DCF7BDA9ED4FF87C39650E8A473672FD012A6A57C5DC44FFBBDA4A5DECD099A32791CEDC6170C8B367080792713041350D2483B27924822DD886A36EE575A3CD6C097162F758F5628D3EA301050AC848F0ACAEDAB8AD34D436E418AA53618AFAFC3168B7CFA641B1A88C86007FD1EDD8FE1D1A94FCE59B548DA3D8FE313A0A97719E19C857560763EFF1682CC14 -Test: Verify -Message: DB0F126516E3EDFF3D7C -Signature: 42076C3F6976EF4BBEAFEF0B4F7A8198CACE6F73436C59DF212474C94D00B0501C359CAB8950EB8937E8458964C817926A3181EED64EAB3A5274A9B3114406F62A62C51F4EDBEEF3BD948C21578996236D6D477B2701DD5A4818B08F5D4740CD23064798C3406133D0758D51717DB4575117DE887733D1E7170AA0845A81535444A962F2003A46361E8A8A1914DA6732C37334320F155E90E18D9E2A921034BEC81395AF69D61E22FEF90BC4F9127914B536BD2477552166C11F139519129864 -Test: Verify -Message: A58B1E5E98C44A8680BD -Signature: 100B8692C7A09EFB585A63B5D636EABFE9DDFE50D5235B11BDFD818D1810893B327ACC3B78942900C8F7498BDC1D2FB44330ADD3FEBC709046D8028F38AA7DCC768558E7D6469EDA306C0FCAE001C7B01544C80043864761355888C13960DD53BBD7854F2FBB7D9DE021BAD69769418712B6335A8C63143329363C65CB4170AA0C040559136EA9C19A6793024AF77BCF3EE793CAEDF07FD8A8E2C9C29B5F225F399BBA177D070314E319359394DB999D866A48D591EE8C662BA6394E396300FE -Test: Verify -Message: 7AF0498714B0D93AB959 -Signature: 35A959E3717468552590C26FA92009C3866955A1D14405AD33D3FA745D7591521A323BA031070B1FB60A1B6FE0C7198FC14EA41CE62EB6EB060FD073E816C9C85BB6251BF5235567E12951778A61D87F117137C347DE56337FBF9A3360D49330A98248233719FF862F83F772AC887F035820579F406D221191F4535ABA37401FF6E28216EC06AB8832D9AB3EAE4E1D3D780A1FA46883A79B657A7027597BCE4F21744CFC3704A449A204D3790F668E2EB710D5CF031BAA58359D35DDF92455D7 -Test: Verify -Comment: 2048-bit RW key -KeyFormat: Component -Modulus: \ - b6dee7375bf4385043b3cc2ac5cacbc14ad11a17574738dd2bd84d2d1e6c74e1\ - 6066c2a5c35bc3b87839858afb5ee5e8abfab408f38772866f6f833f39fab248\ - 3a2c34ed55ad7098f9f63d4ec70b7950f02daaaab10781a0008f993c4027e381\ - 6bfd45c52f59452a7b28873513dce415a84fc8bc06601567f91ec41647da2304\ - 5b6e01e24516724acc02947ad5aa2dba4d952bc4f49d18ada0b0f7cc5d488814\ - b921c0bc2b33d8828d80130df7d79b0992cec40d3bc7217d4a4dff3699345e44\ - dac968575194845aa7b60dcf3c712d9b0a384824c3579b40dba265457d50f69f\ - 02a140884d89b7fdee9f0a787e76a37c58c92cf2d3818c72097d41b3faa7aa95 -Prime1: \ - fa880a456f9c205a26e02c3357536531dec150be0ef8747f69ea30d987ff7dd8\ - 9e9a1075ebd39f04fa495bd26d8408a8de69113a9fbb52f20713d1d046a76b47\ - 8cf77c46454a7afda2ef418f63faf67c947d898bca109f3275999e8f2e60e2c0\ - eec133ff69e71a2d396632670b52d8ea03f7589d8144ab580b1d3e60efa1280b -Prime2: \ - badcc718dd2d761c4893c4831d56ada30fc5c7c148d473bedf7615b7e821b92f\ - 319676ce278349f1309fb3d264c1a22bde71b221354c7a4d31117b3ec3c9d480\ - 2e0a26bd8ec05d28b6502c65f35c687af7f8396b963ed029a2c5ae38dd7c5c96\ - 2a953c113c0f590957ab19a6e2afda6db84f22c0c31ae243debd2920fbe9fbdf -MultiplicativeInverseOfPrime2ModPrime1: \ - 48a56f93e044a8211861da6bde9ab61265c63e168e507b56cd6e6e5f4de57c2f\ - 5c0b626462d6c06790cf561fa12a350dc0c08767f2717914183fac90db36495a\ - 91c0e9c0fbcfef19c85075b3b744fc378a9f2045cd7fd144ecd39bd1a59f1483\ - 10f6982efb3ffe502b279c4c0cb2a7f9ef64ca8f38690c486afb5f659cf7f838 -PublicExponent: 02 -Test: KeyPairValidAndConsistent -Message: 00AA5515CDAE5CD0F0DC -Signature: 30EECA6B48D796552F5A6A3C11F28D730FA077422CAAB34FDEB879AE0F71DF21330E2F3BE5BF3A8CA372EBCD3DFA7C81B3398C31B0972D0B857926CB39732351AACEB8276D52B9D82F9C245FA0F1CF49E785A2BC00FF27FBCF777F84D05BEF17FCC0505820B029AC8F0CE17D2469372CE47E1428BB941004FE170EF87163E07298EFFCC1BFA7E7CB1F572C340CAA075A5962A15B69CE937BC7EFB492F501FC88CBF0119C351C8498782091EF6EFB19120195E5FF51DF86F90E90FAEB225AA2EE43AB4E8358101C0348C7E3859B9DEBA19464C74B74AC48A0B73FC8D2E7F8033E86208F0792B6E5B6DE36C99DEF604949811D1671EF6B0A4781B4E7A0A72AD855 -Test: Verify -Message: B8E2FB9EAE22FB2C0021 -Signature: 416D33F8C213CF81F805F54FC1D4E7C6A588A0965F1C9CAEEA1D41452E20935AAF2D30F957584B56621035430212A428E27A2F687CA9DBB596C19864AE692EF7BBA730F3D70CC2DDE15AB71E1E350C0C316EFA1A831ACD1441598B112482487DF72F58ED318182C7CD0906FE39C5655BF1313F29A15D60A6178CBF600C7FBFF8994840ED649C3C4026A463B3EA39C692B7D112B128BE49E1E32D4A7FF8D4513283D8DCD9CCB8FB7300BE0BDD4C44DAA2F7049B3AD83437093E623442AC69B48911CDA21E95E0775041F67F6E6AE01DCE646AEC20908E7C1B693600FE41ABA85AC0C778641E46C419083E41773C749DB3E1BD8FD764E271860D2D7F8E11BD6AB3 -Test: Verify -Message: 8C8C306A629373BAE647 -Signature: 0E9A00045FFD399D9DA9D0D7E543CF9FFD098BC23E72DD7763A64F22C7F0479CE866E31438B8F7DE31A18F35AF419BED6C67BE1540614D3310DD24F019E14FCC3AF73743F4C143D4B79CDF35C752A300F0A8251CCFF4AAF18785C533A7DF1A20AFE6770DEBD1B8BA2C83B2E345A04F833CD173E998FF9840C2F8A370FFDCFF5FD95CBD71B25FC9972192470FD145975344F64C2F6D68CB3513F48F9FC070021BEE8F6A4282D098C44DF655CE415E89B97994AE3ABE85986C7EE0AC348EF2A4F52D102EA80836E77E81AD3678803E53C83CF2F30D2D4950FB6B038CCB3F2690A9381EB34D6C09E88C090AB05E28047DC490EB8A1282FEB38E82FB0B18309284C4 -Test: Verify -Message: 15E7B7B7ED0F176B6799 -Signature: 39FF4B5FA50AE498F3C91A655E6865840D1FC401EE02DBC8460A59DEB8816E6680F712B7BAF8D4DC11A3B54BF906BE698306F0449BB43F3F223B944D930A1A3C718E8A9E2EEDEC5A07AB817C26A80CC2A2EE2846A597EAB8A999D38DB98490166F2574524038BBDF24B4E4622C843210C6B94987638C6976562EA9727385B152614C18349BD54AD95DE33D5354954B505E5259CCDA47E3CECEF3154F6E5481E536BAB568146A0BFCB66573714A7BA7ABE0385115720687F33D9C6EF6BB60272F1272CF349990E3A2FBCCE180B730792101089B164AE5A001F5263F7493AF148D6E0953E311AD12E4202D35F96DD30885663B5101F9B05675FCD2FCC4FCC4DDFF -Test: Verify -Message: B36724C92954C38D0288 -Signature: 3C8CD3614555568BBECA99174B7B203D0BC6FABE9E6FFE0C41EB4D9A2C601D2393CA1E01B7D7E99337758AC914C9F151311E5AE6708DAF1D8C825DA471652C6E13A8FE5802D7AE097BFC899A4EC8CA235B5982B9058C53AAD52823ACF692290EB8823C126635AB0BBF101C2B3149AB16183FA2DBB049DDB99C5E83723E4D4693CA3A08588AA868C677D42ABDAA6586EF192391D276C5E5AF0763ACCA6293F06250C51FDC2AD369CD44EB5F654E98761C881DDEC08E795FFB229B20522349B0714059E18B7B23A48875EAB12ED3F0A011D3A985DD7384B0046F39FA6C1A331F3D4C5125100BA58666935C68A7A10849D9C74850BAB82AE15EC950A283F3E7DAD8 -Test: Verify -Message: FA95400C2B14E064F76A -Signature: 3F67F9DBEB88E6AD057BEDC3D97030555A908867EC578A6CA572137CB61C21036AADE6DDC5592EC7CCB6B263E51B4C886A51904C858040E493D64B9ACE5BAA50C4A66D04ACCDFE0039D8541C4363DEFFCF93BDF5F5CC1FB64855D956B5EFD42D4C9B96B9CBAA97A32F02AAB307674E53404E6836DB5C96B59572ADBFD1113B87608ACE6D0898CB02E35575CC28D38A9FF8C1C4AD36BAA991DEFAB533F0A6C9C2F0F0815F1D659ED576E5DB18494A54B6817D9E34A134F3B9A0F1E8C77FC204B6EE087C0445A7036C935117E338D092F6E1FF4DF7605525C409456A5195233A176B29B2FD8FB2808D0412FCA0541B2BB6800BD8BB9DC9DC25230166071E8D961E -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/salsa.txt b/external/crypto++-5.6.3/TestVectors/salsa.txt deleted file mode 100644 index b00ff9617..000000000 --- a/external/crypto++-5.6.3/TestVectors/salsa.txt +++ /dev/null @@ -1,463 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: Salsa20 -Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/verified.test-vectors?rev=161&view=markup -Comment: Set 1, vector# 0 -Key: 80000000000000000000000000000000 -IV: 0000000000000000 -Plaintext: r16 00000000 -Seek: 0 -Ciphertext: 4DFA5E481DA23EA09A31022050859936DA52FCEE218005164F267CB65F5CFD7F2B4F97E0FF16924A52DF269515110A07F9E460BC65EF95DA58F740B7D1DBB0AA -Test: Encrypt -Seek: 448 -Ciphertext: B375703739DACED4DD4059FD71C3C47FC2F9939670FAD4A46066ADCC6A5645783308B90FFB72BE04A6B147CBE38CC0C3B9267C296A92A7C69873F9F263BE9703 -Test: Encrypt -Seek: 192 -Plaintext: r32 00000000 -Ciphertext: DA9C1581F429E0A00F7D67E23B730676783B262E8EB43A25F55FB90B3E753AEF8C6713EC66C51881111593CCB3E8CB8F8DE124080501EEEB389C4BCB6977CF95\ -7D5789631EB4554400E1E025935DFA7B3E9039D61BDC58A8697D36815BF1985CEFDF7AE112E5BB81E37ECF0616CE7147FC08A93A367E08631F23C03B00A8DA2F -Test: Encrypt -Comment: Set 3, vector#243 -Key: F3F4F5F6F7F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F101112 -IV: 0000000000000000 -Plaintext: r16 00000000 -Seek: 0 -Ciphertext: B4C0AFA503BE7FC29A62058166D56F8F5D27DC246F75B9AD8760C8C39DFD87492D3B76D5D9637F009EADA14458A52DFB09815337E72672681DDDC24633750D83 -Test: Encrypt -Seek: 448 -Ciphertext: 5A5FB5C8F0AFEA471F0318A4A2792F7AA5C67B6D6E0F0DDB79961C34E3A564BA2EECE78D9AFF45E510FEAB1030B102D39DFCECB77F5798F7D2793C0AB09C7A04 -Test: Encrypt -Seek: 192 -Plaintext: r32 00000000 -Ciphertext: DBBA0683DF48C335A9802EEF0252256354C9F763C3FDE19131A6BB7B85040624B1D6CD4BF66D16F7482236C8602A6D58505EEDCCA0B77AED574AB583115124B9\ -F0C5F98BAE05E019764EF6B65E0694A904CB9EC9C10C297B1AB1A6052365BB78E55D3C6CB9F06184BA7D425A92E7E987757FC5D9AFD7082418DD64125CA6F2B6 -Test: Encrypt -Comment: Set 6, vector# 3 -Seek: 0 -Key: 0F62B5085BAE0154A7FA4DA0F34699EC3F92E5388BDE3184D72A7DD02376C91C -IV: 288FF65DC42B92F9 -Plaintext: r131072 00 -CiphertextXorDigest: E00EBCCD70D69152725F9987982178A2E2E139C7BCBE04CA8A0E99E318D9AB76F988C8549F75ADD790BA4F81C176DA653C1A043F11A958E169B6D2319F4EEC1A -Test: EncryptXorDigest -AlgorithmType: SymmetricCipher -Name: Salsa20 -Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/reduced/12-rounds/verified.test-vectors?rev=210&view=auto -Comment: Set 1, vector# 0 -Rounds: 12 -Key: 80000000000000000000000000000000 -IV: 0000000000000000 -Plaintext: r64 00 -Seek: 0 -Ciphertext: FC207DBFC76C5E1774961E7A5AAD09069B2225AC1CE0FE7A0CE77003E7E5BDF8B31AF821000813E6C56B8C1771D6EE7039B2FBD0A68E8AD70A3944B677937897 -Test: Encrypt -Seek: 192 -Ciphertext: 4B62A4881FA1AF9560586510D5527ED48A51ECAFA4DECEEBBDDC10E9918D44AB26B10C0A31ED242F146C72940C6E9C3753F641DA84E9F68B4F9E76B6C48CA5AC -Test: Encrypt -Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/reduced/8-rounds/verified.test-vectors?rev=210&view=auto -Comment: Set 1, vector# 0 -Rounds: 8 -Key: 80000000000000000000000000000000 -IV: 0000000000000000 -Plaintext: r64 00 -Seek: 0 -Ciphertext: A9C9F888AB552A2D1BBFF9F36BEBEB337A8B4B107C75B63BAE26CB9A235BBA9D784F38BEFC3ADF4CD3E266687EA7B9F09BA650AE81EAC6063AE31FF12218DDC5 -Test: Encrypt -Seek: 192 -Ciphertext: BB5B6BB2CC8B8A0222DCCC1753ED4AEB23377ACCBD5D4C0B69A8A03BB115EF71871BC10559080ACA7C68F0DEF32A80DDBAF497259BB76A3853A7183B51CC4B9F -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: XSalsa20 -Source: created by Wei Dai using naclcrypto-20090308 -Key: 1b27556473e985d462cd51197a9a46c76009549eac6474f206c4ee0844f68389 -IV: 69696ee955b62b73cd62bda875fc73d68219e0036b7a0b37 -Plaintext: r139 00 -Ciphertext: \ -eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880\ -309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e55855796\ -25337bd3ab619d615760d8c5b224a85b1d0efe0eb8a7ee163abb0376529fcc09\ -bab506c618e13ce777d82c3ae9d1a6f972d4160287cbfe60bf2130fc0a6ff604\ -9d0a5c8a82f429231f0080 -Key: a6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff88030 -IV: 9e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c -Plaintext: 093c5e5585579625337bd3ab619d615760d8c5b224a85b1d0efe0eb8a7ee163abb0376529fcc09bab506c618e13ce777d82c3ae9d1a6f972d4160287cbfe60bf2130fc0a6ff6049d0a5c8a82f429231f008082e845d7e189d37f9ed2b464e6b919e6523a8c1210bd52a02a4c3fe406d3085f5068d1909eeeca6369abc981a42e87fe665583f0ab85ae71f6f84f528e6b397af86f6917d9754b7320dbdc2fea81496f2732f532ac78c4e9c6cfb18f8e9bdf74622eb126141416776971a84f94d156beaf67aecbf2ad412e76e66e8fad7633f5b6d7f3d64b5c6c69ce29003c6024465ae3b89be78e915d88b4b5621d -Ciphertext: b2af688e7d8fc4b508c05cc39dd583d6714322c64d7f3e63147aede2d9534934b04ff6f337b031815cd094bdbc6d7a92077dce709412286822ef0737ee47f6b7ffa22f9d53f11dd2b0a3bb9fc01d9a88f9d53c26e9365c2c3c063bc4840bfc812e4b80463e69d179530b25c158f543191cff993106511aa036043bbc75866ab7e34afc57e2cce4934a5faae6eabe4f221770183dd060467827c27a354159a081275a291f69d946d6fe28ed0b9ce08206cf484925a51b9498dbde178ddd3ae91a8581b91682d860f840782f6eea49dbb9bd721501d2c67122dea3b7283848c5f13e0c0de876bd227a856e4de593a3 -Test: Encrypt -IV: b2af688e7d8fc4b508c05cc39dd583d6714322c64d7f3e63 -Ciphertext: 418078fe843f5984dd3c7975d1ff51af4dceda640999aaa3c28618ae286ca15051cb4d55f9da22a213ef14a2b905b52c99a557854c7f2a6d6ed6f69c1c6649f3fb67b8628468029b3367920c2e1148aa1f3b9c695cb1426f09ce84045842946e0454e41ab1edb32cae4b95669de4e2ccaf00ba86ffeae6a9c5fce4153baddb0d8998a600537a9649939cb7d7a9c4e8cbca0fab77963abd516699879de0b1971dc7328668111ff5b77c253b9e6346d1a2ce6e390cd736156ad7f44b339cfb141f00e7a766c06e130b0c31d88980d2ad8814a2d641599162ab8af25d93067f06a49637eaf6523806b8fa07d56628bb -Test: Resync -Key: 9e1da239d155f52ad37f75c7368a536668b051952923ad44f57e75ab588e475a -IV: af06f17859dffa799891c4288f6635b5c5a45eee9017fd72 -Plaintext: feac9d54fc8c115ae247d9a7e919dd76cfcbc72d32cae4944860817cbdfb8c04e6b1df76a16517cd33ccf1acda9206389e9e318f5966c093cfb3ec2d9ee2de856437ed581f552f26ac2907609df8c613b9e33d44bfc21ff79153e9ef81a9d66cc317857f752cc175fd8891fefebb7d041e6517c3162d197e2112837d3bc4104312ad35b75ea686e7c70d4ec04746b52ff09c421451459fb59f -Ciphertext: 2c261a2f4e61a62e1b27689916bf03453fcbc97bb2af6f329391ef063b5a219bf984d07d70f602d85f6db61474e9d9f5a2deecb4fcd90184d16f3b5b5e168ee03ea8c93f3933a22bc3d1a5ae8c2d8b02757c87c073409052a2a8a41e7f487e041f9a49a0997b540e18621cad3a24f0a56d9b19227929057ab3ba950f6274b121f193e32e06e5388781a1cb57317c0ba6305e910961d01002f0 -Test: Encrypt -IV: 2c261a2f4e61a62e1b27689916bf03453fcbc97bb2af6f32 -Ciphertext: 7030af4a9db8a6b95f55f962efefcc60d8ceb0d5d920e808cebd8cf6f31542d227a67c9db8888cfcb9410ae357f8a3da06a608a93b7fd5513978c6b8b837f6ecaafd3366495cdd3ab719d9d4c2ac74d6ea2eb117f30369ea62727fa6dc7982f668fa3bf44c9da8e70ff8c18b07d63aa01afe1311bdafc457d06c69aaea0dfbb1fc89d1574ad1e7be8b459d4cf36bdd88db0363219652089c50 -Test: Resync -Key: d5c7f6797b7e7e9c1d7fd2610b2abf2bc5a7885fb3ff78092fb3abe8986d35e2 -IV: 744e17312b27969d826444640e9c4a378ae334f185369c95 -Plaintext: 7758298c628eb3a4b6963c5445ef66971222be5d1a4ad839715d1188071739b77cc6e05d5410f963a64167629757 -Ciphertext: 27b8cfe81416a76301fd1eec6a4d99675069b2da2776c360db1bdfea7c0aa613913e10f7a60fec04d11e65f2d64e -Test: Encrypt -IV: 27b8cfe81416a76301fd1eec6a4d99675069b2da2776c360 -Ciphertext: ed158a1dd07f4316d403af3e6977afaac8205d678b38fa5928c61e366ff27003143d5d20482a2ea76a50756225a4 -Test: Resync -Key: 737d7811ce96472efed12258b78122f11deaec8759ccbd71eac6bbefa627785c -IV: 6fb2ee3dda6dbd12f1274f126701ec75c35c86607adb3edd -Plaintext: 501325fb2645264864df11faa17bbd58312b77cad3d94ac8fb8542f0eb653ad73d7fce932bb874cb89ac39fc47f8267cf0f0c209f204b2d8578a3bdf461cb6a271a468bebaccd9685014ccbc9a73618c6a5e778a21cc8416c60ad24ddc417a130d53eda6dfbfe47d09170a7be1a708b7b5f3ad464310be36d9a2a95dc39e83d38667e842eb6411e8a23712297b165f690c2d7ca1b1346e3c1fccf5cafd4f8be0 -Ciphertext: 6724c372d2e9074da5e27a6c54b2d703dc1d4c9b1f8d90f00c122e692ace7700eadca942544507f1375b6581d5a8fb39981c1c0e6e1ff2140b082e9ec016fce141d5199647d43b0b68bfd0fea5e00f468962c7384dd6129aea6a3fdfe75abb210ed5607cef8fa0e152833d5ac37d52e557b91098a322e76a45bbbcf4899e790618aa3f4c2e5e0fc3de93269a577d77a5502e8ea02f717b1dd2df1ec69d8b61ca -Test: Encrypt -IV: 6724c372d2e9074da5e27a6c54b2d703dc1d4c9b1f8d90f0 -Ciphertext: cfb653dd50a04a8580847d5bb98dc15e27c60f5a70da635718ba6d589f47935ed476fc960ffaf3b8750a59171b1434429a977ba878aea7ace8dd083a9238585112591165d0948a86e89e6118d572aa85667cceffd78a60baa5a152dc5e29bdd93f7389edde1541eec2f3aac38ea2bfc812f73de7e2e7b1322468f823a2c7c16e30fe9283894ac057da5c45a67f4988b4edafeb51c1b4a51a849d188b15838552 -Test: Resync -Key: 760158da09f89bbab2c99e6997f9523a95fcef10239bcca2573b7105f6898d34 -IV: 43636b2cc346fc8b7c85a19bf507bdc3dafe953b88c69dba -Plaintext: d30a6d42dff49f0ed039a306bae9dec8d9e88366cc19e8c3642fd58fa0794ebf8029d949730339b0823a51f0f49f0d2c71f1051c1e0e2c86941f172789cdb1b0107413e70f982ff9761877bb526ef1c3eb1106a948d60ef21bd35d32cfd64f89b79ed63ecc5cca56246af736766f285d8e6b0da9cb1cd21020223ffacc5a32 -Ciphertext: c815b6b79b64f9369aec8dce8c753df8a50f2bc97c70ce2f014db33a65ac5816bac9e30ac08bdded308c65cb87e28e2e71b677dc25c5a6499c1553555daf1f55270a56959dffa0c66f24e0af00951ec4bb59ccc3a6c5f52e0981647e53e439313a52c40fa7004c855b6e6eb25b212a138e843a9ba46edb2a039ee82a263abe -Test: Encrypt -IV: c815b6b79b64f9369aec8dce8c753df8a50f2bc97c70ce2f -Ciphertext: ab7204ab4f995c2d87376c3586f0261250907ab2c25e2d232f10f51f0f3a3f11ff704ba188a508301fb9d5f7e4d55070631ecd2e3be5d79d4fa67f4f4acb3879afc2dc18c09446489b79dd3043f74027e9a24a54d8babe757c9a3470a95cb7b7b093331e32534b337d697046f7349bcfa89036b3cf50ecfc6f1e61300a49b6 -Test: Resync -Key: 27ba7e81e7edd4e71be53c07ce8e633138f287e155c7fa9e84c4ad804b7fa1b9 -IV: ea05f4ebcd2fb6b000da0612861ba54ff5c176fb601391aa -Plaintext: e09ff5d2cb050d69b2d42494bde5825238c756d6991d99d7a20d1ef0b83c371c89872690b2fc11d5369f4fc4971b6d3d6c078aef9b0f05c0e61ab89c025168054defeb03fef633858700c58b1262ce011300012673e893e44901dc18eee3105699c44c805897bdaf776af1833162a21a -Ciphertext: a23e7ef93c5d0667c96d9e404dcbe6be62026fa98f7a3ff9ba5d458643a16a1cef7272dc6097a9b52f35983557c77a11b314b4f7d5dc2cca15ee47616f861873cbfed1d32372171a61e38e447f3cf362b3abbb2ed4170d89dcb28187b7bfd206a3e026f084a7e0ed63d319de6bc9afc0 -Test: Encrypt -IV: a23e7ef93c5d0667c96d9e404dcbe6be62026fa98f7a3ff9 -Ciphertext: 5c77efcb16097df824bd58cd3498e07af1c761740b5539929115e2caf3bc10eed2a16254a4306f4e20827247900276ce887362990c070c0f79e15987473b7ad240e7a9f8e6e3f020fb337438cc3c8b81c4cdbfbdd7b543b13a48a4959744f3efcb99a939c0599ce32f816d12c2b47a2f -Test: Resync -Key: 6799d76e5ffb5b4920bc2768bafd3f8c16554e65efcf9a16f4683a7a06927c11 -IV: 61ab951921e54ff06d9b77f313a4e49df7a057d5fd627989 -Plaintext: 472766 -Ciphertext: 8fd7df -Test: Encrypt -IV: 8fd7dfcb16097df824bd58cd3498e07af1c761740b553992 -Ciphertext: 85e098 -Test: Resync -Key: f68238c08365bb293d26980a606488d09c2f109edafa0bbae9937b5cc219a49c -IV: 5190b51e9b708624820b5abdf4e40fad1fb950ad1adc2d26 -Plaintext: 47ec6b1f73c4b7ff5274a0bfd7f45f864812c85a12fbcb3c2cf8a3e90cf66ccf2eacb521e748363c77f52eb426ae57a0c6c78f75af71284569e79d1a92f949a9d69c4efc0b69902f1e36d7562765543e2d3942d9f6ff5948d8a312cff72c1afd9ea3088aff7640bfd265f7a9946e606abc77bcedae6bddc75a0dba0bd917d73e3bd1268f727e0096345da1ed25cf553ea7a98fea6b6f285732de37431561ee1b3064887fbcbd71935e02 -Ciphertext: 36160e88d3500529ba4edba17bc24d8cfaca9a0680b3b1fc97cf03f3675b7ac301c883a68c071bc54acdd3b63af4a2d72f985e51f9d60a4c7fd481af10b2fc75e252fdee7ea6b6453190617dcc6e2fe1cd56585fc2f0b0e97c5c3f8ad7eb4f31bc4890c03882aac24cc53acc1982296526690a220271c2f6e326750d3fbda5d5b63512c831f67830f59ac49aae330b3e0e02c9ea0091d19841f1b0e13d69c9fbfe8a12d6f30bb734d9d2 -Test: Encrypt -IV: 36160e88d3500529ba4edba17bc24d8cfaca9a0680b3b1fc -Ciphertext: f003b213737415a81894a3d3d8fe4e4434d4df2b253d60c44609bdc0414cedf8bae297ecdb1d0b92393dd6dd7027b555388ac8a66308082fc6327ad94ad96223003de15c48a06e9cd99b5561e7fc5949c6ba8cf11d6ba1374ec32062caef541e7252d168781aab4c637793433b3998c5a5013fd35c336600a02765ddbf52b97ae80dbfbbe55e43c6bd5f746a1c2df4c80611c76a90308c47b2807876249d6d3c507a1a96c2bbb8242ccd -Test: Resync -Key: 45b2bd0de4ed9293ec3e26c4840faaf64b7d619d51e9d7a2c7e36c83d584c3df -IV: 546c8c5d6be8f90952cab3f36d7c1957baaa7a59abe3d7e5 -Plaintext: 5007c8cd5b3c40e17d7fe423a87ae0ced86bec1c39dc07a25772f3e96dabd56cd3fd7319f6c9654925f2d87087a700e1b130da796895d1c9b9acd62b266144067d373ed51e787498b03c52faad16bb3826fa511b0ed2a19a8663f5ba2d6ea7c38e7212e9697d91486c49d8a000b9a1935d6a7ff7ef23e720a45855481440463b4ac8c4f6e7062adc1f1e1e25d3d65a31812f58a71160 -Ciphertext: 8eacfba568898b10c0957a7d44100685e8763a71a69a8d16bc7b3f88085bb9a2f09642e4d09a9f0ad09d0aad66b22610c8bd02ff6679bb92c2c026a216bf425c6be35fb8dae7ff0c72b0efd6a18037c70eed0ca90062a49a3c97fdc90a8f9c2ea536bfdc41918a7582c9927fae47efaa3dc87967b7887dee1bf071734c7665901d9105dae2fdf66b4918e51d8f4a48c60d19fbfbbcba -Test: Encrypt -IV: 8eacfba568898b10c0957a7d44100685e8763a71a69a8d16 -Ciphertext: f17808cf21dba4762ced5fcc264f615a4619d8d5ee3278dbdacf14a799f8ee5f8a38a7fd9d262b336e51a8790c90fb8f0b63a49edae81f9a200ad73d9ed5ce6257524b506d7a219013e3e44a1f2a264b7f7f121e5d4765d0bdfe4a36fc51e48ee21e9dcbc3dc2541405bbdb90490fd786b942a07786094fc990be21e5b746d522cad26269a76c85134ee654f33485807fc28cf87ac37 -Test: Resync -Key: fe559c9a282beb40814d016d6bfcb2c0c0d8bf077b1110b8703a3ce39d70e0e1 -IV: b076200cc7011259805e18b304092754002723ebec5d6200 -Plaintext: 6db65b9ec8b114a944137c821fd606be75478d928366d5284096cdef782fcff7e8f59cb8ffcda979757902c5ffa6bc477ceaa4cb5d5ea76f94d91e833f823a6bc78f1055dfa6a97bea8965c1cde67a668e001257334a585727d9e0f7c1a06e88d3d25a4e6d9096c968bf138e116a3ebeffd4bb4808adb1fd698164ba0a35c709a47f16f1f4435a2345a9194a00b95abd51851d505809a6077da9baca5831afff31578c487ee68f2767974a98a7e803aac788da98319c4ea8eaa3d394855651f484cef543f537e35158ee29 -Ciphertext: 4dce9c8f97a028051b0727f34e1b9ef21f06f0760f36e71713204027902090ba2bb6b13436ee778d9f50530efbd7a32b0d41443f58ccaee781c7b716d3a96fdec0e3764ed7959f34c3941278591ea033b5cbadc0f1916032e9bebbd1a8395b83fb63b1454bd775bd20b3a2a96f951246ac14daf68166ba62f6cbff8bd121ac9498ff8852fd2be975df52b5daef3829d18eda42e715022dcbf930d0a789ee6a146c2c7088c35773c63c06b4af4559856ac199ced86863e4294707825337c5857970eb7fddeb263781309011 -Test: Encrypt -IV: 4dce9c8f97a028051b0727f34e1b9ef21f06f0760f36e717 -Ciphertext: 534f5151319c299d7356be2275ed2137fab66742797370b511e5150dcf7bc75c06d5249e8e8bd7c16e563cc7d99368a7a7f47f811a2ae2b632c73e9f49641bf9954d4df19c2778221d780f799806757738b327e6aeebab6bb22137f8b994c1e08baff75bb2774576bce2deb599817fc7a69860c538efffe91439f4714e4629b00a25b5b1a6be8aa7da2be33bad953481926e0067a70d4ff1a7bd0111e605ef6a2d66fa7af43d746c24a5d464dd6f75773aa9b65bbdfad9b82fe80f182b144cea9211d0b2472de873008509 -Test: Resync -Key: 0ae10012d7e56614b03dcc89b14bae9242ffe630f3d7e35ce8bbb97bbc2c92c3 -IV: f96b025d6cf46a8a12ac2af1e2aef1fb83590adadaa5c5ea -Plaintext: ea0f354e96f12bc72bbaa3d12b4a8ed879b042f0689878f46b651cc4116d6f78409b11430b3aaa30b2076891e8e1fa528f2fd169ed93dc9f84e24409eec2101daf4d057be2492d11de640cbd7b355ad29fb70400fffd7cd6d425abeeb732a0eaa4330af4c656252c4173deab653eb85c58462d7ab0f35fd12b613d29d473d330310dc323d3c66348bbdbb68a326324657cae7b77a9e34358f2cec50c85609e73056856796e3be8d62b6e2fe9f953 -Ciphertext: e8abd48924b54e5b80866be7d4ebe5cf4274cafff08b39cb2d40a8f0b472398aedc776e0793812fbf1f60078635d2ed86b15efcdba60411ee23b07233592a44ec31b1013ce8964236675f8f183aef885e864f2a72edf4215b5338fa2b54653dfa1a8c55ce5d95cc605b9b311527f2e3463ffbec78a9d1d65dabad2f338769c9f43f133a791a11c7eca9af0b771a4ac32963dc8f631a2c11217ac6e1b9430c1aae1ceebe22703f429998a8fb8c641 -Test: Encrypt -IV: e8abd48924b54e5b80866be7d4ebe5cf4274cafff08b39cb -Ciphertext: e8c59b616dd10474930c432422d23d8df8dee1c626def1278eb6c9828435c0c8a98aea9d350752a78cf0cf1de7973436605f22b0d40b9059d777c55c8fd02cd9dbab6888161ed28979c64b700d7ea48038edf36af21078713f844f5f23a4f271aad3562ed2cd773de622fff2f0b5785672760a7064e5415c76ffec522eb1225868345e89a9fcbb4f12c1176b01550fe7a74f750dc43d6fa4718c33ba99b0084c7a1a8e245c8566056296aabe13af -Test: Resync -Key: 082c539bc5b20f97d767cd3f229eda80b2adc4fe49c86329b5cd6250a9877450 -IV: 845543502e8b64912d8f2c8d9fffb3c69365686587c08d0c -Plaintext: a96bb7e910281a6dfad7c8a9c370674f0ceec1ad8d4f0de32f9ae4a23ed329e3d6bc708f876640a229153ac0e7281a8188dd77695138f01cda5f41d5215fd5c6bdd46d982cb73b1efe2997970a9fdbdb1e768d7e5db712068d8ba1af6067b5753495e23e6e1963af012f9c7ce450bf2de619d3d59542fb55f3 -Ciphertext: 835da74fc6de08cbda277a7966a07c8dcd627e7b17adde6d930b6581e3124b8baad096f693991fedb1572930601fc7709541839b8e3ffd5f033d2060d999c6c6e3048276613e648000acb5212cc632a916afce290e20ebdf612d08a6aa4c79a74b070d3f872a861f8dc6bb07614db515d363349d3a8e3336a3 -Test: Encrypt -IV: 835da74fc6de08cbda277a7966a07c8dcd627e7b17adde6d -Ciphertext: a91f3039c37f753857510f121cbbab8f942b41a4d04815729361268c84abed9fd3dd2c0a84ea5dc3cab46245f720d8f0fd81ce4c7837aae561186f66ae70db9e5c2238f1b417b0ab001eada16d1f9bcc2ed74d335fe8da60bebd8b1c4ae4c51d8c46eec7d1fd575a5824bced85b02bfcb1e11d5686471b2791 -Test: Resync -Key: 3d02bff3375d403027356b94f514203737ee9a85d2052db3e4e5a217c259d18a -IV: 74216c95031895f48c1dba651555ebfa3ca326a755237025 -Plaintext: 0d4b0f54fd09ae39baa5fa4baccf2e6682e61b257e01f42b8f -Ciphertext: 16c4006c28365190411eb1593814cf15e74c22238f210afc3d -Test: Encrypt -IV: 16c4006c28365190411eb1593814cf15e74c22238f210afc -Ciphertext: c86458ffa23d50437f3385ea7d3fbae5cdc1df7a14658b8316 -Test: Resync -Key: ad1a5c47688874e6663a0f3fa16fa7efb7ecadc175c468e5432914bdb480ffc6 -IV: e489eed440f1aae1fac8fb7a9825635454f8f8f1f52e2fcc -Plaintext: aa6c1e53580f03a9abb73bfdadedfecada4c6b0ebe020ef10db745e54ba861caf65f0e40dfc520203bb54d29e0a8f78f16b3f1aa525d6bfa33c54726e59988cfbec78056 -Ciphertext: 02fe84ce81e178e7aabdd3ba925a766c3c24756eefae33942af75e8b464556b5997e616f3f2dfc7fce91848afd79912d9fb55201b5813a5a074d2c0d4292c1fd441807c5 -Test: Encrypt -IV: 02fe84ce81e178e7aabdd3ba925a766c3c24756eefae3394 -Ciphertext: 5526b8ff95272e95ad298c30f9f165353ecf0f68aa2943476ec53c386cf07c465b677be13d01279779965dda94d23fe9452dc4934e344c2ee0f6f5e32efc2b3f79630492 -Test: Resync -Key: 053a02bedd6368c1fb8afc7a1b199f7f7ea2220c9a4b642a6850091c9d20ab9c -IV: c713eea5c26dad75ad3f52451e003a9cb0d649f917c89dde -Plaintext: 8f0a8a164760426567e388840276de3f95cb5e3fadc6ed3f3e4fe8bc169d9388804dcb94b6587dbb66cb0bd5f87b8e98b52af37ba290629b858e0e2aa7378047a26602 -Ciphertext: 516710e59843e6fbd4f25d0d8ca0ec0d47d39d125e9dad987e0518d49107014cb0ae405e30c2eb3794750bca142ce95e290cf95abe15e822823e2e7d3ab21bc8fbd445 -Test: Encrypt -IV: 516710e59843e6fbd4f25d0d8ca0ec0d47d39d125e9dad98 -Ciphertext: aadb7c36647ded09fca7587edfa9bbe81911925fa8996330c8e7b77601075e5f94404db9f82c67e2cd39d1649062d4c30cf23bc28f9ddd6d5b9ec586a7de7f8ef45560 -Test: Resync -Key: 5b14ab0fbed4c58952548a6cb1e0000cf4481421f41288ea0aa84add9f7deb96 -IV: 54bf52b911231b952ba1a6af8e45b1c5a29d97e2abad7c83 -Plaintext: 37fb44a675978b560ff9a4a87011d6f3ad2d37a2c3815b45a3c0e6d1b1d8b1784cd468927c2ee39e1dccd4765e1c3d676a335be1ccd6900a45f5d41a317648315d8a8c24adc64eb285f6aeba05b9029586353d303f17a807658b9ff790474e1737bd5fdc604aeff8dfcaf1427dcc3aacbb0256badcd183ed75a2dc52452f87d3c1ed2aa583472b0ab91cda20614e9b6fdbda3b49b098c95823cc72d8e5b717f2314b0324e9ce -Ciphertext: ae6deb5d6ce43d4b09d0e6b1c0e9f46157bcd8ab50eaa3197ff9fa2bf7af649eb52c68544fd3adfe6b1eb316f1f23538d470c30dbfec7e57b60cbcd096c782e7736b669199c8253e70214cf2a098fda8eac5da79a9496a3aae754d03b17c6d70d1027f42bf7f95ce3d1d9c338854e158fcc803e4d6262fb639521e47116ef78a7a437ca9427ba645cd646832feab822a208278e45e93e118d780b988d65397eddfd7a819526e -Test: Encrypt -IV: ae6deb5d6ce43d4b09d0e6b1c0e9f46157bcd8ab50eaa319 -Ciphertext: 89e9c51abd31d6156b96c4e82ef0dfe5c376bd6324750fdbc46e5ae63897323c816fb5bb8e6bf4335853e512cc334dbbfecccfe4e5c8fe8289963ee7127f3ac56bc26b7bd4f0d1e0afb06bde930e7587eedf07995d5052bbff5453147c1555a7c8534111295bb5ab9e89645cc330ae3e0d9294c9e7d6d841579e93aefeaed879f8e8299459a3c07e3c9dee497360510668c5246970ad39077e8d8935b0d885f11d2f06dee0d7 -Test: Resync -Key: d74636e3413a88d85f322ca80fb0bd650bd0bf0134e2329160b69609cd58a4b0 -IV: efb606aa1d9d9f0f465eaa7f8165f1ac09f5cb46fecf2a57 -Plaintext: f85471b75f6ec81abac2799ec09e98e280b2ffd64ca285e5a0109cfb31ffab2d617b2c2952a2a8a788fc0da2af7f530758f74f1ab56391ab5ff2adbcc5be2d6c7f49fbe8118104c6ff9a23c6dfe52f57954e6a69dcee5db06f514f4a0a572a9a8525d961dae72269b987189d465df6107119c7fa790853e063cba0fab7800ca932e258880fd74c33c784675bedad0e7c09e9cc4d63dd5e9713d5d4a0196e6b562226ac31b4f57c04f90a181973737ddc7e80f364112a9fbb435ebdbcabf7d490ce52 -Ciphertext: b2b795fe6c1d4c83c1327e015a67d4465fd8e32813575cbab263e20ef05864d2dc17e0e4eb81436adfe9f638dcc1c8d78f6b0306baf938e5d2ab0b3e05e735cc6fff2d6e02e3d60484bea7c7a8e13e23197fea7b04d47d48f4a4e5944174539492800d3ef51e2ee5e4c8a0bdf050c2dd3dd74fce5e7e5c37364f7547a11480a3063b9a0a157b15b10a5a954de2731ced055aa2e2767f0891d4329c426f3808ee867bed0dc75b5922b7cfb895700fda016105a4c7b7f0bb90f029f6bbcb04ac36ac16 -Test: Encrypt -IV: b2b795fe6c1d4c83c1327e015a67d4465fd8e32813575cba -Ciphertext: 0a8a907dc7f30f6f68eec465ead25768383956a304aa32e4ccea6e3756cbb19f2751e3b68339ade1499004a88170e44620529d3c568cb1e014c16548830dfbce1b47a2dcdd28e59bb0daf5908c5ff51817bd119fe33bda07d63e93a3522685eb101d912b02d093780d10884959ae4a49e2fb7fca51b81394f09314879a41f6dc2f4a7dc34e88da4747a5a1fc15dcb207d13222f08f91f079eafbded0d6036325f607ff29ff2fc7635e8c3767d61a3b7814227d6a2798d623bfdf674604e4e9e03529 -Test: Resync -Key: ea060c72f6e0080fd4a9a2131c9d684902415cab34fce4e52d62273e3c385f37 -IV: 5826043957a27509423fdd82f34935928a4b23a84ede72c8 -Plaintext: 20ae58dbf5c20225c35518711a86a19a61d5ba47ab17e8c5fa9658333d40ed31bffb79cde927c36baf61ed8df37acac330f64471bd91d90bfafa72dc8cdb6ed95ec6610cd6e8f2859255216a3eb4b573410d5644a40e4f0fa785d556304489c0023a1991eb0d01b5 -Ciphertext: 6025c4d5bcc769cc3e67b88340b4101690eb283654c761f8a0af360926313129f16d1c9358ecbaf66acd85787c7c1f52a953bc05e91d43bf3d94d341bffc5913435fb3a8e6264ccd1c355472929a140fe30a22689b055082c70395e0b070a3f0967ab36848cdf3d9 -Test: Encrypt -IV: 6025c4d5bcc769cc3e67b88340b4101690eb283654c761f8 -Ciphertext: a420fde6c359342819ed9c07853c594c0098fd2a3c8da24713dbd12261b528e43af7dd52ddf1a1b553d08c20b0ab399c38a067fb115368c990d9e839735c8427aa885eacb5c2900d1d04afdd3d35793f11c78dd826c5d09351f39823a13976eaa5a49b0bdb054043 -Test: Resync -Key: 115aaaa3a3827fb05175412dc6478747d7c128ce2637b6afdfe3213f7b0b6991 -IV: f8cbe32bdb4c8eac3a571f186ef683b9eb902302ff7ac746 -Plaintext: b09472fbdaa3e4bdb7b04c8819fb3257f764154d09cea22e9a67b40f7e601a97c469811773d2733eb4ab0da6249f237d4c063012fd06714a726b24a512daa7e287d39818980a6720abc45f10aab7d71da318244507b5a9d0aeae76ec5efd3b5ce167c38196744d13b07a14805ee49dc4421e0c59d559e8518a9911682ce1d2b307ccba48dd98c003103421ae6253c6a2476dda5d11cb3d5e7d6dc2c02499d5731095ee89f77c7d4ef27231fd6e9e854d1ed84b0b47bc4794e68e055e1d83d75ab527a53ebefa4d363f952562ac1aa47635296d55e2d5d1b8e214c95445bd586c7f82b31839ff78a60f0063 -Ciphertext: 50c5e2584d473a696c797ff1668137e331bcd9a1ecd5c146422a9140de87c10996d407c5eb8335b5bdb7a9b1613ccc198d5157c6f89d409e1ce7958605d68d442e1b10179c13e12ec33f98d676ae4be95ac7a82786402b1491918a6526e9676037d04fa7aebfd9afd39f6d10dc663877ebbb67aa82c6089529218db9622bd0af7e722e72265e25524d827da8eea6d7e0daf94c516ba24ecca2d820959c0dc939252158903d97139f6fcd81752deb3e9108fc62178bf54797c428e0887d1849fb5004c3b76f0d466afffd47f5066d6dfcbe4782319738e90fa19de6b99861bfc9e8112df4573bb38b1b9e35 -Test: Encrypt -IV: 50c5e2584d473a696c797ff1668137e331bcd9a1ecd5c146 -Ciphertext: 280303c6467f6badc300961c549c33f249c6d2df0596a459383b4c995b296854dea2072d04e46cd47c3380c4be6f6456e8759a5ab2025bd20ae6d116b0bba77b4f03aaa118c73e50f48755a89474c4380e8bbecffc4d6c84514711094ef67c2ed8b81a07c2afa41a19709e69d0bea22067eb3ce3618d80066f9c9f333eea1a624cc4d4dbfb0134004d1d6d295751c7a134cfd29cc85045734e2a4400c261cca16bca4c7e4622837eeed6ddc64c0999347248081aedd3f4d911ad5c92aa491b05510adcb0bcd7c0711a964f176775f11d8b00d9e4264afbb4d6b6a81760d964ca495485895ebba1dd1d2bf9 -Test: Resync -Key: da4147528d2e7862009aa772051e60e309721eeef4b4bcd7f98ae8d0561960b3 -IV: b625057bd07c1385fc08bdc14d735e5832dce5aa0045d9e4 -Plaintext: 6db3a848beb8a6e9670ed91427364c9b042d000a14eb2ac4c6097625e20b2e8eb367c156f927262d2251974d5953f17d00b4ed6b4d93513a19ee6b4f1a159bec8ff94151a7bdd6074d12d343fd852fa69a26302a11caf57417e950723c5a5e795de4cb6523fede7af6b6cb68f41931a1eebea6079e8018fe4116e7b03df7 -Ciphertext: 399c5bf3b894e3dcb5881fdcd927d8cf4ececa5140b2425df5cb2cb993b6901f736e94fb847de41b7c32ae990510402ce5e99a34b5acbb3b5aefbe55be4707025ffcfd6605b6ebeffca3c1ed3c42cba900eb5f14c195e5c574eae67e7355b780403e44ebc91f81fb04f95759f78999fe619d5b8f9fb2185c0e14cadfa8dd -Test: Encrypt -IV: 399c5bf3b894e3dcb5881fdcd927d8cf4ececa5140b2425d -Ciphertext: ebb1d4ebb394e185fddd72fad5efa8434465a9ce758fbdae25cdc6b1278b2e137f5afa706c5a8e95684fcf6645c6c2f67f698621c7d6c7f1899be12e2f6c9e480315c12f02405b8bcf45f4a715eeb72f12e0fef15740734747764e698ee88d05ab30028c9ee237a48b50c8fc453b7d370daad88e57a572a9cb8091526861 -Test: Resync -Key: d61f8e75dc9295dc029292764f3ed08dfb6fd725cae4b0e47aceecaefcf654d8 -IV: a6046a92ad15e9f9d8027ff39bfbf534d46fec35bc9cd94f -Plaintext: c11f014781804645ca22ca213a5558a038090341f3f70aa1df0bf135fb8d0184d77783b519c9c2b2b0b748880a85bab986de7a37a4a11bcbb5c0c87676d7808fd41abbfd0d7a11a7c545405a4ae42f60baa22ccee6de0272e79610c7b885b70ba9bf027657abae393cc8f56735faab9f6fbe36e7a4d99ce15cdac24223880bfb5865ac7acf01ea833098fb148406e6 -Ciphertext: f3b2a1188c33e96124f383b8b75dcacbf782f728eaf436db05551ae2be1a77f09c9ea009d8651329d0a812580d1e11d0f64c44e245bf30dd9c8033b72d0e5049131063c5fc2a3f219e6c1bd993c8961cc174eebb655574dd45b73d0d804f5190f92e385dfd7c2a4ff430ed6dabd41db040aca8ece7f11de796478026f48337f763cf69aef12609384f0ae72ee38c8c -Test: Encrypt -IV: f3b2a1188c33e96124f383b8b75dcacbf782f728eaf436db -Ciphertext: a9b213db6c8e161687e1b63f32a806f15aa8b3ee60cd37d7d437f90b446c3361d37893b702dfe774e5e5ce486399cd408fbf6ca1005768bf7825130c061e43f6077080438514f1a8ecdc6ff7cc264122b1a55c849c76328e833667326f23670590b77f2bfb9a666bcc4c44c16efd6c506c37ec62de8e5365ee894670ac4264b807a8455d8df05ba45af51ff1fee343 -Test: Resync -Key: 0f2850f98634181f49e53bf49d2f822fbf75e5f77c6cd7487541c514a4101ce7 -IV: d6defb4e74c327d89123bdc1d1c6d2fce6b745079bc2c9ef -Plaintext: a064bd9bdab0ee26530c2d26be556cd67295180bca445dfc87954bc51b28a21b606a229cf5a41fa104c51c3f32003a65064ff73e66691e4d2b1a22d236232be18677d54aba7ad49edcc9284897a7f88945513460166e5dfd7650959c05328abc0a7e95c352dbc227ca17 -Ciphertext: 51de41664070aec657612a57641c0c83ae14f5b3b25b25d916e0cdfae1c1bd21f7b47d9ab02b6841e115394cad58a568c1d7c2559a1d3fcd9cb4b25529d26e475ae313e6487538d16376a6b24e5cf27d2dbf4c83bd18996594f60549f34a8683b04d05198893a816adbb -Test: Encrypt -IV: 51de41664070aec657612a57641c0c83ae14f5b3b25b25d9 -Ciphertext: b5f57b5f00d2bf5f48828a4e793997e6d12b0f14953f5b1634cba91867776f75d2d2d247799a46080372046518416c60a07a65b2aa1318238597c320360a279e7633045bc43cf41bf9d366eafc7613b090a41fd8db3f684afc03d96c82a40b46e2994438febf268020c4 -Test: Resync -Key: 5cf680e8a11eb005d03fdc3d4ec0e129e6aceb47262dee6c452a5b8b0ef1b450 -IV: 6a6920ddba39b5a2640976ca10c97bf308a8cdd70ea98260 -Plaintext: 1f322b31f5f577a596b0fbe567864c7ce2973b41f924205defe08e2866b7fb5c1814d664d33957614e91668bb15d9848ffb93dc08c1f74c5f5e1f88148d1a1a7ad47395b75834de4988adfbf7e58a38157544c2be5b913152c1d00 -Ciphertext: 64d6c9ca4db201d95afc0dce28f6e47d51c2856ccbbc8f4c2e2bd2d834aca165dedd117b0be9a7dcd21eb22b508f4ecd0236075b064a0ced23e324b18b2bf2cda1c4416f78c740e51ce687cd37842be368fc4e6ba7cb312d89ea7a -Test: Encrypt -IV: 64d6c9ca4db201d95afc0dce28f6e47d51c2856ccbbc8f4c -Ciphertext: 9f4090fc504efc0f6bb5f76ac9881e1379da9f700737d86e9636714debc5c4eb3276fcff90bf71c32a71e06c199b3431475ab77410e83a7eba158723efb383a5437731a136758aaf7d39f0def719b0dd46798d9d53a30cd1b91eb3 -Test: Resync -Key: 9d27327495159927d0dd93e258908590343a57f6583e0d8aca07070ce41fd37a -IV: a01d1d7d1d43de5fcd60277f84dd8b93d08d480a77961f71 -Plaintext: e2ce8d1f9ee9329c3599e1880b9e6cb75d52e86f48ca89b829d4d7ca16d3e1b496b8b46097501793cdf6764ffd44b44013c7aadbf0ccfa4eab012529373a9022480f58877332b81f3c703ca80a77f429d944d5a877d89c6f64214c9ea6d3a098d9057d519354cfbb71a4bcddaee65de22e4d782ef0065952b891c9494d8a509e86d08ca31594015d3c31931d417cd048e59945d42ab74983434d14ef4e078f30ec2fe9ceb7e247d557b1d2593ab35896082c1c218dd73a868bc5cae74862b898395681234b20fa1ae9cab6a49b94bcc38a3a4a91cefc7745d094d9d8cab730cda4079705e4afd0f5e401 -Ciphertext: 94e0d546dbdcedd76e26629484ffd9b67b9c15f61b07df7ef0efce41270bdc9039ffad321c5b2d2847f6f4d5d105676fde08b8c47df248850dee1272d51feb42d503e58d67b61fff0a20abd999a5ad5942676aca3f31ce08614106fb692ae230c2a74339eb38c074bb59cf5ab42fcc428a0d629c12fbc3d845e84ed76c3f774e92c1109be12f00aa8ebd2a137a914e655081e6e60176cc98e849165d9d93235c605c8562f51bb407aeb8f330692d6245297817eebd32fa2ee96520b560e37019e9aadaea40f25ac4c5446fe93c5b39fc90152f088a5a936ba4efb10db7f246143f2cd151b1f1155e05a8 -Test: Encrypt -IV: 94e0d546dbdcedd76e26629484ffd9b67b9c15f61b07df7e -Ciphertext: 33203e910f56c5e1a63f3a801fdd772dfd1c3b0f3e012772bf0796337d95f4562c349f65557e76dc0aadb982d1aa3a3a865db36418bd1efcae36095fdb3ad68e1df72622d45d5336224caeb237adf9c19b02e23a1b9d4b32a5b6f39595a93d495a74cceeb4254e0b75f54277b80b153f62c8b5bdccae8d3ce24d8ee258f6d4ec6d631f6d1c8e8daa049d33076bea38acc5fda4a8822a16a693c936b340eb7951cd1ab0f7f58206252b0ebe46c77214dc86db136f8e170fc402f31e1c7ef9bc409b19260e4164c145aca28846ead4dc91783bcb1bd914a23d7bdf83745cb74c7ba66eca45457c53f42280 -Test: Resync -Key: b1a6c9bc9870d808a81612d0f4b335cbfd8b305150a6140627df06d9f8b24c0e -IV: 7313e9e505147d4a4c2023259ba01197169bac01af0d5bb0 -Plaintext: 479d7baf87a385c781f0dee6e51ee4f94eb2ee3e93bdbb3f402b0252496225d4118511ff893f4ddebcd31149920e259006cc7353ec5a95da4bc61ee6863282edc341afe9541d44958c2855b6714625ed2fde62db387e114fe837bbecee398351d187e0c93e0a0618f9d923504dd662c11e43af794e7ac7c99816c180ccfe1779bd2dd476ed68eb1736f421922fdc6696 -Ciphertext: 30a86c8b6a55670856e6d1b31d59602e05819022f12df1c67294fa138d65d5fd9f5e9192ad09604e08005537832d07ad5f4743bdbf137b7e18b8811066c7e411291fffc6e6ab55744789a225f15086173495279a4c628ffe4b1f8bb4d886bf74ada7d783b143edda1675ca9493ac1da04ae62584ce41c8a2c4f9fae79d94363bcf79c343e51ce5694c639bdbd8405781 -Test: Encrypt -IV: 30a86c8b6a55670856e6d1b31d59602e05819022f12df1c6 -Ciphertext: 33c313c0da87030169b7da6963644cdd257891b14fc1e4387d35faadc39279cca215e7079ec4272bc259e6499b0cb6dd52c6dff5965c7ddc9e951ac5c0056b4065a6f8eb5cc8e5373633a4aa3aa1736a67be11ef63c3418b1fe57730d6cce0f40e5bf02e61f6aae1404a813fd2a2a870960833be71dc73bff4a98718d64cb146a2ca5d41fcba85a56fa3d0413d0a807b -Test: Resync -Key: 4f9f97fd4ba7db6365f5fec9fde4e752c8bbde48a7ea986b878302e4cc8af9d5 -IV: 05788b5db4e3711eca900a2bfe6f78de44e98a70362504d7 -Plaintext: eb50b1e352f3fae6921fa7884c99365411928a2ffa33e3106768a773246c31cb0bca5cc166819b3b05819017f06c8b8932607db6d66d58d6a2f7356e4666ff7bec3a2223c12777fa54d9ed1dc139d9512c52e1e53762badc7e6f8da576afd940fb4a29d89e76fcdc93e515d69a6ca9efe5d053b7600b458b6719852ec4ad3c59d0b0a69971ac6ae53118c186f2d1a57e350ac3c8ad7d4e087c8f32816462f0506122fc01caa8c93aeebf0edf0c8e1cb726bfc861 -Ciphertext: c63f829e84c1c9709c49780a445bbf0dd441acc5304e0433ce0cd70af3fe98d36bd9e6fab17e6e8b50fda157e3ce9d2a928e8c234dd1700999047db4a28ea40a9657172a471f962d872a1d3342c12965aa1f1484e760979181ec8fde5472f509f76748fb4557b9b73fd517f70b20795caa1cd19e4dd5ac65e8f4cdb65a4ad60e0dd64407dc5232a5a893ace71acb35700fe059bb641497a2db63caf083942b7fe530092e90014bc5b6f889710ba3fc50d086fc32 -Test: Encrypt -IV: c63f829e84c1c9709c49780a445bbf0dd441acc5304e0433 -Ciphertext: 625aa1ac285ed59cb4b17da0ddb32a772eaf95181d0587fa92be22d1f5b65e403de9c0caa3301aa569ef9396c4cd06cffb602d5b5e6d2238712e74de51b0620733e1ba802038de3735b2a08951cbf17759f90cb0c4c4eb6a1acf147b54b7ac7372bafa4377fe7510d06a9c4ed6f972a669e270610a7084b61d4b52d2931803b805440b3d5e333ccdb0f3e7c0d013f068b2b402680a83210d71051da3529299343813150fb0f26ec053a8dac9993568e9b0c703ed -Test: Resync -Key: eee68b65fafe9a5bf2f9f92512a716e5af3740efea15e596f4ea0b5aef23550a -IV: 4d312f84330a107250b68c0b1df417ef713615b704d99b71 -Plaintext: 95ccd08ed2ab0fb87f55786f1f10d33c7713bef4435c3699b13982235ed040c9d9cb1b1f335cac0faf8654812f6874408bf20b129558a2c342c07c7f42a30700b374d18b91d881fc0f153f4ec1a55633a92d637212a11d122a9a1eb085439ea1226ea7124e8bd1c644a1996fa6369dedcacd5c766d7dc9a8c8682c5729ccf4d59433ba8e1569fe826089995414afd576ffb9686a30725fb9e5d7 -Ciphertext: 6c832a8147658a1741af29b0f558fa3773c81429f91a5cef270f7154988f97d4b28549604909f726a8a6e89d625089ea387b2725861963480424d9835d7e2fea93a5bd3bf86c7827fb22e7a68efea1a05c45f9606d4ab7add687d9418ba60517cecb3503287fbc5b2c9f0f9b5faa991337b394dfac7514dc38ffe019a1e7c74e5ad23f4e3bddb74ffc8a81f521d0b6044f98238f7c2a38ab14c0 -Test: Encrypt -IV: 6c832a8147658a1741af29b0f558fa3773c81429f91a5cef -Ciphertext: 7e1ef21dad49405e2fc86c50bf045eb14c65e58acb64e210af9ad8ebb5679021721312b96514d8681fa9d52c01c83f7d871401ec345a334648e0fc2ca294ced407ff98f1d1bc4afd83bb325072a5367d9a014092bc99699713bf84587fe2ee998bf8df35aacf61a96be157bddfd52e5b5a1d4a2e3bb109502e608f286aa8f0d5f67b4072ad9b60971ee8cf9fe966015260e61802f19f4bc8a29c -Test: Resync -Key: 188fbb5bea95b5101e056b93d8890c68e1328966089ebf424defa1bcb96e88ff -IV: b51304a0194bbb2490fced46fd0f39c3e87ea5196ca67ce3 -Plaintext: cd78c7c8f308addbd9acb6352d1b5b8a6ddee8a6f51401556e612d4c18960d152e6973381f45b19693e8ab6643424f01e9ab27de29f4ea16465d95674f7c939b -Ciphertext: 81a468948c618db0de96ad5cdd8b577c8253df097128cea4ffc7044f3eefa1b486b9159545fe135ea8a862fefa015f663febbd9b9527cba516551949013e9601 -Test: Encrypt -IV: 81a468948c618db0de96ad5cdd8b577c8253df097128cea4 -Ciphertext: 0510193beecfda67addf420e9c52130dbc8883cbe27d3e013207dc0ef3ff4e0b92e9ea2a2b644ffbab55c942acd63ddb7f1cff8d51d27b0a7d2853584dcc0bd5 -Test: Resync -Key: 2fb88c256a737eacf97ce4e1d13f1e20e8b2426f19076d7901bf6696f38a81b4 -IV: 12a82872b47b2c5b73cbb38904a08d283701eba289c057b0 -Plaintext: 3caae8a0c99f38cb7b2e45ea91dd5dc1331f0efff9f69a5dab0164693e986ba0da48a84321f618cc7e4b4e4d66acd8a71b69e23dbfbc6bca0c4ae279f3583b08705100adb7a4aecc0d72955a7305f4e7e2765b0a1bebea9d7e044e360d44b402f01357dc9a3e83fb46b48a683c1ad450a255bf45fe801db33414d985fd3a337c857d370ddd05c3313ae2eee0c8cb1d12a2fb650ea6e4851f2ca27badaf36dede18a9f8a62a502f6c2ff94d591cc27438e7215ce6e6abf76c22190b7201763cbc8d3a2be1f366f69eca6e5386883f56bd1c -Ciphertext: d446cbadf5afb1f21d7748a5973e8650d1dbdceaf5b837cdecf972bd091734a71ee1692fca675f4972d1e8db716873a03f9a5516f409982316cdc9f66ca0a8018dd055af0086397a86cf7574253d53fabd3aeefdc54dc2eae48b5b61a31dfb8db6531d2185034b81f745a3b88fa11453df073343de8bbd35a45f9cdff45b52e5352081f1f1a003a58200a4aefe27c87e930b77b8dc5b0882dc848437892e1902d126813e31ee27526d947bad5e8f9cf16a302da1a8f3883e3c9b257091e708ad58f4e716bb49e660cbf1f6fa709d64857f -Test: Encrypt -IV: d446cbadf5afb1f21d7748a5973e8650d1dbdceaf5b837cd -Ciphertext: 4125c6831bd2d39c1b1a2e12c505ca077fede7c553d486ae9a87ca3232d27974fb35c9a18a6315e5feafbffa943e52e9c46aa0eff6bce2f2dbf703c641ac570a92551f8a6e9aee14e8bc433b36e06bbefb0a292279f688e5d06dcdf317eded20f9dab8fab19298b146e1555b772d9f9c95e920356282ae691436a8505051190bd840b234fde486726dabec5e0755f4335b8ff4e30c30bd4f473a6af3fa3e7542f2b720784da760753938a682e86cf7ee18c5b5f7f515ff0380134d375e434934508f7cdd7602ffe2039a376d443c048103 -Test: Resync -Key: 7066fe1125429407b653fd090262bed2a3f7f3be2fa8f160f3344f327b1e53da -IV: beec3787c335739fa5d7ad15b85b7e3e7c9438367434872a -Plaintext: 9dad7f5ca1 -Ciphertext: 014a1f27cc -Test: Encrypt -IV: 014a1f27ccd2d39c1b1a2e12c505ca077fede7c553d486ae -Ciphertext: 20539f2d9f -Test: Resync -Key: 3154d3f5bb56b00b34a255425057e99ed9effd1cb0168d16157fd769ddc665ba -IV: f7f9f18f9648f6dc06ac643ea77f1493a9fea3390a98bb0c -Plaintext: 80a488703cf316be904ac8394437ea02ae2c027b7880ebec58416429ea060db543839d781d82a0fa209077e4b1 -Ciphertext: a07abc8ef3641cf33179296ca401bb291a9547d3e6d1b0886ac31d26d2f3281a6a568cc042593132a3cc1082be -Test: Encrypt -IV: a07abc8ef3641cf33179296ca401bb291a9547d3e6d1b088 -Ciphertext: 27ff7646fa8c6b98b1a732841e1596caba7b87eb40508ef0f8ef390aa5e36c0296ba84b686701d5e3d34b16508 -Test: Resync -Key: 81426f03ae1578d8ec1407827db18640d9d90d2bb773971f4ef14f859bc19e06 -IV: 479961f75954ed4f8024108cdb149ca3fd53e6a239a01e86 -Plaintext: 9cd08cf58e13e94e02c9a40269875392251353223f5329412e2a5e34328ea18c414d4c730b4e1c0bc140953f4ecf4ffc8aec963e59305d4d -Ciphertext: db3ea5b5fdc9671ec56b3f1cecbb2a552b0ea4ce9be508863f3dfb3238d4fb91b896727357fe454a08114200ea7226787fd2ab154d53eac8 -Test: Encrypt -IV: db3ea5b5fdc9671ec56b3f1cecbb2a552b0ea4ce9be50886 -Ciphertext: a887b52b3e97e6c899e1d68e57f283633ec9392438d17fb645702ae3b0ae0aad3a7c6eff0baff9f5357328307f628f470891884c264973fd -Test: Resync -Key: b3c260036b79cd3345e04cbee474dfea3a7c773db2ccb29d4c36a1b8c8b252e7 -IV: 1277840fe82046c024e6f4f53b4ff761c7c9bd1fea6c855a -Plaintext: 6a6dac1bc93b9b5c0dde0d1e6a534914dc2a6d51e6f8af3e9d42b88bedc2173782a2314b33f795cc2e4536829871d77186168f5461d18130581664586256 -Ciphertext: ff5e71022c6522998a2d10843fda170796a70d186e5fca2afcf529c6d075c5212c793fb322c1675d0bd3cc6b18f2715678812e81a8727a2d6ac1158eacf6 -Test: Encrypt -IV: ff5e71022c6522998a2d10843fda170796a70d186e5fca2a -Ciphertext: 7e8b5b4d250c13e38b5dcaa5532295e649ab3669fa594cf30eb81a54b25b3fed4f35be97afe4a2a37b7404acb41ad31d737fa9f272e1c57b3754830b4823 -Test: Resync -Key: 14fabd52e0fff9dae88d54815d82a56c4d4a660db5f214288cec1982e56fae81 -IV: 55b8328a312dff104c7f0720af0b7624f9281731b9f5f4b6 -Plaintext: 71bfc290baeeb0380732aa4312982c0dd0cc06cf2ee53adb0ae61c64228b80c073e7687ad3d3f888151b4066f415b62cf851d2987a3c816255ac40b62f453f350da8c4e1ec6dd0985e721b45a063381e997f629a7fbcd44fead19adc289f58f104fd37ec93a35305ba6fa44844d22e80a853e6db1d466ba2ad09ee2d30b3f47dd01b4d7b5d498cffd934cd3e005dc91e9e951951d5b937b319de0a7ba23c7918b1d74d3551b6500d39e6d626fa9cac8ec4e744713a93d5edc8413e2fba1d3b9b0f70509e38a66a2a2d70c510b57e15ac0c4b2aa7c5d6eb088fcdf6cbfef2c6dad19d7f17437cd261636c6d -Ciphertext: 7fc8bc27994031b3c35632590a15607ccaf1be15c542eea5b71ea1f7fa3abee79cb1281a00adb05e6fee4e65e8cba616a5789629d8fc617fae9bde9d92f6c8779374b1cd32a8e9277d0cb052c7658b3ab24ee1e55e5dd88a76266e9fb5661f576000968a9af71a3edb59ef3974e76aceb41c3de2fcb204a0022f302316eb01a0a8d74378599a7f72987e9abbd6f1a8af152ee89455840584010da73b01bbd7b01093a8c38049dc7a5ee0ee80daa98de46803ed75d0a97083ca328e7642a07e1c037346a280a856a64bba53b050272b7ba9742ef62aa89e34500f0efd7bce800bcac91981556a878d102ceb -Test: Encrypt -IV: 7fc8bc27994031b3c35632590a15607ccaf1be15c542eea5 -Ciphertext: bfd5908a43916afa5e2709b2e43ac62f406a4e677b855d70b216ae92cd444fa47f5568558c3cedece54e8b436e904e927175b455d96672a8cbdb4316b9e48a704216e30e9955ae7107f9f7770768bfd3ce71416bd337710bdf4e8789c8537a37f7c995c616a437ee406ca20c8f333a7c2f84ef87dac8c32f5b9678e344645bd356dbff32089fd195d982d3bb94b06b5b232580b492cb754659df62c9b5186b26bc2485409ff95bdc0c1c4c80bfaae878abebd373b159507b5894c5a9f8402447559b5aa7c3b491b97adf202847d0f74605a2502b193b6440a6b1765d538e38a2206630dfda4123fbbe4da6 -Test: Resync -Key: 75fe951556aae3d6ee93670241b7adac6907fd9285dbdf165834fa0cbf741b00 -IV: fff3e1ebb2e48520be552d2f0b617291c42a946f38804243 -Plaintext: 2b56b7dfaf5969d84a88aaa10dd12682f15d8a9a942deb6eba04a9a7ff38f2d0a947b414cbf7f1fca82d74b4ef98880368ba58ab7da98e8d6a6c46cc47cf0536961920e46095627b73737ea19e393c2f19d1f252ddd74b8fe050d95d21004b8997678eb565db0e369cb8bd326942e634a20845c61265da8a21448357f3eb -Ciphertext: 4b3bbef56b4400b130f8df0ab25bb28ece9160c430417060e48e691e6cc4ba119b0c34f5e76d4f1b7963785b4c6a9fb0b42c9f4eed92f8d0989710456c7f8d228fb26359f6e2549439ff5610dacaeb1df4f43a39cb3802ab1c87ce73f731ab1127ea9c2e82fb372be407a8c2b1af40398b33582e842ef0862f120a96c75b -Test: Encrypt -IV: 4b3bbef56b4400b130f8df0ab25bb28ece9160c430417060 -Ciphertext: 76c77925fc94b86624decfd2014fa505a6343054ae55c5be6d12c43018944b5d1c2aa08b9c11ae00d0c8779e70f220ffa59847969e54228d89b4351471fcdb9f0f76f18fcb896983d09dc5e8d9ee666f5abcb4d9e7bebbba824092c65646c3bee46d07609057e44b36dedfc02ce576506aa1274d550afc57d973fbd60294 -Test: Resync -Key: ea7bcb7f8712f9aa149a311d906dbcba443319f68a441a68a263c7bd0fe10fbc -IV: 620e57a9ce4b3d438c968e603f3c1518ab70be5b7bbecc62 -Plaintext: e40ef8606c72444fd3feeb1873f7ccdd3900760af66c269ad1ee6bf1e4546b1a556d4a90f6397527b270021c226dad5353a142c22963bb818548c3ed504965b2e6eb9744a15ca3c00fef2835d34592b90cc4bef8be904987dfc35e92f835ba15f054ceb760ad903d56c65854fd21f6a03ce9f8f16c04ef7ad9507b5cfa4b373eb544f2bc61bc16e371db087fb7bb749463c16f75 -Ciphertext: a31ae696ac9d66241bf9c826a381c4610de7f6416b153d7f8cc17484f1eeb63b2bc25d7c9b8a486e3e8eed6d34b4604ab5dbca373a80c29d50f416bb4ffb8485bfc6f7b61328f7c708360cf93370b7224b7cba075becafeb5cb62938b396dcc789900d8cb8315ceb460a753f20baabb4c6f61526a012e305c28bcb59fed20565ad1afce39f98b354b67a33daa8425479a07c0dd0 -Test: Encrypt -IV: a31ae696ac9d66241bf9c826a381c4610de7f6416b153d7f -Ciphertext: be217c97aca7ee0c1be18f1d93ccdd0f26d751bbbc36ca29f12bbf4afe83bbf7a749d325aad3b6af4913dbb83b09ade5ec79d88b755f7b2ba63df6ec458627c83e28e4742bd49396f19463bd597902de42ac46ba675d2f0c9db8d39dcc56a5e9233264be90cfed284302b965ab0f0748dcadcd02354c1f81d640a359b8ee5aa58a1908de1356031432b6f12e22ae9ee9f847f0a0 -Test: Resync -Key: 017f97c643425ef0ce5c0a6a0c6dd67aa6181e6aed360adcb103bba88773e1b1 -IV: 8189c8cd17a945196321cb6147cf483d785eacbea352fe3e -Plaintext: 145a3d3ac4c5b57d68d26a1ddabc71289929b6dbf317acbb3d83313c9e4861fa9d9679de974e4f7eea83129cb8f4221df16cdf545e000e087735cb37cb321d097b7b2f4874b74af6a6da9c429b1e62d418066bdff5ea0ed7c3 -Ciphertext: 90551d5f8ebaa8c1aeb52d893ddec3e9cb95f77b8bd5f6d0b3f8a3fae5fd8d9c1e42a96360e8e7e6cc9b7711ee1d61b4d67e6c2d682215c59a72778756dcc3fa93068889219579b2a1ddd85b0e69880913cd2e9be47b93ea70 -Test: Encrypt -IV: 90551d5f8ebaa8c1aeb52d893ddec3e9cb95f77b8bd5f6d0 -Ciphertext: ef58a8589c2996e1fd990d7ec412353edcef7dff079ae0ffbf430f3a479818352647fd8640a518575a3210fa45f7df5bd63532273d54c442ff02918aa79176c137cfea1a6ae167464183ae716a0f6057be891537059ac3322b -Test: Resync -Key: e9a7e6aba47b1d9c1df629c6920ded6894b85d3e7fd211bbcc7a9335e5cbf7bb -IV: af86ca3a196464931fd579bff601c9fe7fcc7a10d7778d22 -Plaintext: ee681bb5ecd15201f433a8f89871109aff85ed5a4a16a7ffe032fff60f1acca78cee6532f7740be05438da05933c8d29fc880533d589f6029291cd0a965113e042b27734968784f871f9e9e6c2a7342bc01fba3ef666aa0e018957169f2213f492acd0d2ab82dec47d8afe7a6bedee72d0c5c7ac0d86d0af5238da822ad4e6346cf2ac76faa64d34051a91659009976d140534a4f2a80f2758a912eed692b62bda4a46649fe58563707478746c77d658f481ebf90c2cd5ff3276fa8dc36739084640e319282d74479084a15838b9822056e900f2050d0f48ed52a3a3ffbdfe3a1831 -Ciphertext: b049fa161f19691f3bfa783327d2663eb8b7f188b301b17336f68630d8e001349f659428fd29359c15e95aa3f5a9f46a92d214e0085ab661b511831d00fb6f496e171b8c139def92be2ad8f6d94c2fde48f9d77ea338b920b2d8d6ad380ce761faf170bbc05128e65149b29d32aeec45e2882362dd2d0e3c7cf9634b9f52c578cb2e1d51b5aad6447f4d1860b1a1f1b7e45bcc002a5f4f03dd7116216414b0be23876b35ffb58f466a4087c992340437e89b12151a7d8f1af04aed585f5feee36f60c1b0e19251c7587e8590e7b6bae774f3ba5f3be2d726c8da4da3824debffedc3 -Test: Encrypt -IV: b049fa161f19691f3bfa783327d2663eb8b7f188b301b173 -Ciphertext: 7cc5bceb953ed1acf44c3a448a15f07c4e4db33f863bbc2368acfe699cd18f0580e3ff8545b946c15dd0f5c15e355fc4a10e340035e91c60b757cb69bbee8d2a22b20066b15929bf3506f2b271326509552b6430f4b82cf9b38ae83124f9b448dbbe049d7b3a98bf25678a72965f9656df149bc068e4cbea8573befef8c70b32d1dae7dc9b74601db95866dc7b5a3b307ac6ab9d09f3c55b6aaeb34c8b0e77c724666a4cea694ee90129568a46bb0f8380d8bac4f6151e84d357f32488ef8d62a08cb02255de04612bec676db471ea2199b9e86fb8ad89b259c0d1ac487cd95a5430 -Test: Resync -Key: af768581d5e401b02de76e6986de0bedbfb7130b9014727194c1d3f02c747fd0 -IV: c4568db83cf9eed0c05629951afa4fe5b72c055d89421efa -Plaintext: b34095f5b7660a03edb3e2277dcd3241270c9a7b890cd682214ff979b725148b1d836346ad84bd776ad748f6fb063c15fb763ca5005e9af95840f2677c1904090a19d83dcbf1011a48c23b620eda573b4a61bb8b86fbb7260090ff6f788a9dc27b5c95c3a3ebff1dc6f72446a23740179bf4dcb0169624d1ce2bf17c79dfaa35c7e12e313488919adf7e56f2d61cad070c164797b9d2dbaf5b954b56fd43e15b61f2cddde618bff31ad545ff163f2482024388ec470329835a8deb0f230760 -Ciphertext: 5b132bc08ec5bb09b5c92587a661c25ec54b8f65a581ab5f788c97c959e39cfb93032c6f63a489deac9eacb0b1a40b14ed152077fdc7b8b6dd5f94501d319d1f5cdfac56dbbedf8a5430843ca36507a363d5694e277ad8c0dcd0c0bd729bbe4b64823acff976f39973ae2d3eaa415f32db86a207f3220054306d99558e27ced2a683699a65d13eb67abb38230137de63c5c758a2149a773d403442cb826d70064c57aa4a778cb3e00a36cc4ebba6ec83dc178a7e4a3fb07c22b77a9c00e889 -Test: Encrypt -IV: 5b132bc08ec5bb09b5c92587a661c25ec54b8f65a581ab5f -Ciphertext: 907a2c78d9e0064b600c1d20985b6268b48cb8e7af87f615f8c298316b186ef64470b1c3c05f46096697d84ac390a3d2e37cb2306b718e7c48fb624bb1c5b3855951444f83e0433e26bbe2e05d8ad375633447a9f1c0856e35c6996c4fe4a477f503a47818ccd364b099b8d640ff2540f892e6a8e915a90b96b3ec13ec18e81a5c5e9f6054e6c90b49892e22ad1f0911a33740fe0719845f5428b0911b220ccec09a73cd8a790afe1ad4b76480c5e7718755fd2c29ea2f5f3cd7608ecb7bbb -Test: Resync -Key: 215f4b041d68a316d29cbea833a9d4170c32c5ea0aa34e90b4381e642f74231b -IV: 0b9e85d8e3d62b0c5b45ef1ead0b180348c0c82b2325beb2 -Plaintext: 68a7cfb070a3ffbb5a1456ff96703d56f84fbf74d92573368def92bde3b49dc9cf8ea87dd8a51d4c12cd9b4e1d20d5939a20b86bdb9fe5c76a10bef983c871c559741ac89155eb6d1a226c2a371c03f3bdf2b4bc -Ciphertext: 68d6236f9df3727c9a457609c0b59e393864855160b1e2074257f72d8b122c99fda40d6092cc96c8134823ab93545a6f8b43e8efca9502b5db2ecb86af5798b45639dc41b34df49782388cad7d1826d9d165b79f -Test: Encrypt -IV: 68d6236f9df3727c9a457609c0b59e393864855160b1e207 -Ciphertext: ab148bbc10bdb9a086c2c94c641225bdd8bca6f04d11a7cc5ba7eb728f1fd84522d3861a648ccae4e03f34162058f560028680d986c4a71e5369a312af02d135684b348b2cf42df1ab7ca841d474b3b51b8b52bf -Test: Resync -Key: 2ecbb5a282ee515b3226952d11d0579607f653a708d18920d18dc5106f76074f -IV: 53f67a3bada58382426b7d2142c327c7a9fa75a8634463c7 -Plaintext: 0878ed1298af132502bb5144066d26042e4a2990 -Ciphertext: f8ef2dc3ffca9dfa4d006bd9d3c00d7517fe0971 -Test: Encrypt -IV: f8ef2dc3ffca9dfa4d006bd9d3c00d7517fe09714d11a7cc -Ciphertext: 488bfbb9058907da6218b81138c26f306b3e214c -Test: Resync -Key: 473ee670e4b93e070c69e4c9f9d1a1808aca67c02dc9b8250034b9a19f0a306f -IV: c7bc3457a0d5b3384ff35ac10c8b09a114b09ad8e3d1ef6b -Plaintext: 09ba3c2aa122ee53878bf46711922fc946d67085ff68c3c5f07da6749194737b715bdfd4d052366fc6761c5aad4931808033b620f7e47d3c6bb65e355d66f4f577ee42a1881a853acfa6e710673b72ba15cc169333aef8fc63635ae5a7af8154d19409f57121d6580d10796585236812bdee04346084c9a831aea5d4be2ea248a90b9d71fb00823c2fdb522ff00e7482bd9d178766ad26807d963002104d3e42d2 -Ciphertext: 12fa7fe0fa0791d6a1ccb22f025563a9f61b1dbaf825bb59ae7523b531da1d720b816f42c12adeebe8171309aa65a5357d46e719e260af1ed2eb2096ab59a00f08671acf0e3a4ca67843641a5d9be4e2c00f8da7d37349f2560dabd133dab9dfe2ff6f3c087099ebcd2c4420b6485a8e810392310a8dfb61eb850ae70680882e98d8c97c1c922e6358c0ff3a6cb6df77f0ff86f4b2697c698c0440305d3ff03c1e -Test: Encrypt -IV: 12fa7fe0fa0791d6a1ccb22f025563a9f61b1dbaf825bb59 -Ciphertext: b069c6b32e99129d65d0e17dc92106edb3949710ea7f84638137073b706d790f4c57db477f4f40161c029f1663ca17fa6ffbe8f6d1e10d94718cc7cb75549307c2e3da305bd33263d7f80d8da26ddeeecb95a241f0d0dd636ca54f7129ee35bd49c707c52aff4a6fb5f520575d693949b8a1ece03cf093663c86b8cf97c89b87fc76cf76d9dce6791c499208fcf7a2b7e868f625a940b5721bee984bf3ba0925cd -Test: Resync -Key: 95d049394412ccaaa002264f391f2448837b9a9eaeeec49ae73f21c3bfb83016 -IV: deb9499a1b4043f0c116133700eae22ea61f45ffad305c03 -Plaintext: fba6e561dbb8d9d3dca1b6073d29103b758c463c5ad756920f66dcfe88fe0e4fc21b6aa382b6b96ef5785d51bf4c6b2375f7ca4494e711a34fef708ec09dd10311d312f7aaef6828f112ffa786263f1f9507ecd5fc3a80bc3fa75c17d272ef1c7cac66097a46df791d0d61a22a68dc4217f7ce54abbf7d4fd3fcedfb4d92c4a87657e15aa3417b62 -Ciphertext: a081927e375175dc84df664d824c351c9417614523e0c30d9fc5b6ab5aadcbd9d3a2fc28cfd7c11a807dfbcfdc7d28a54a5c44e52f6e9806a1c08a5fb06f322d22a91f5aa5097b9cb12ac29d5bdbbf8312fcde98b79c6cae3a26c9828874f9c8e2b072b6c1c70f15a1b6464c722fe183fb1367e03bb3991d8de30396aafe160b4669462ace11bf46 -Test: Encrypt -IV: a081927e375175dc84df664d824c351c9417614523e0c30d -Ciphertext: 2629e5e9e550bcb2d80ad3134a2ceaa80ebc96a68d4cb9b0bfc1e78b8b9b06b6ee34e242a174f65f2c74688b740aa9d52f14e900436c020c10b860f7cc8063dffa9b5baf2202a8ca05a3b52bea40bf7dc3c9444989f33e2ff0cc841742df284ea75c6dcfc9a2eee78dd9ce6b29255979b4abd333ed1ed92d19661850d42ca425a30d3aaf95a201d3 -Test: Resync -Key: 9a1831352b9bd922b41cde1ad94b40b3c2f622ffdd633d03f5638d2ca01b892a -IV: 4539205c887f099743e9ebd3aa4ef88ca7eb0a957a1cf8a2 -Plaintext: b4a37464a37b3691c7fe66a81572f535d780925b3b28dbc85b574edc2b6753278994fbcdac780c6f09e153fcd8a2ffb6e873c440dabcbd081e7bb35098c29dc97248dae7781dbc3b00d7c097c75a2f3cc88bf6dd1989 -Ciphertext: abc902e1dc5c4e5d858597347ebf523cfa233ffa1c38b7d8e8df8cb5dc75f08e74cc7077352efccdd18e39820bf03a39ae1aa56b3f07d92b148b26d6214d710167004b338c1f9868b6932b3d999e60f84ec839dc09cd -Test: Encrypt -IV: abc902e1dc5c4e5d858597347ebf523cfa233ffa1c38b7d8 -Ciphertext: 7b2d46034c39cf770b075dbf8eaaa19492e51e451d1ba97a0f4a71c466dea5dfa1d506ff3c7cb90fe276dfd73a6c0ce88e0df56ec0429872dbcae451dd19d2f3e58ac420e83c97909dce9673e7785cf3a11df9a0b062 -Test: Resync -Key: beed63202b4bb586cadbbb8b6893bc6ca2c07217a3b9275b499245aaace55383 -IV: d22603bfe4fe47187d969fce3aefe24beafb9337ef886980 -Plaintext: 375fe2819168ed3a1bfa7f46e037af06f202f1927b78606a46a35f41e23806817a4151872a5738ba76fc6bc736208124d2da5aaa952276125eb5ee95ab9668a7e773a2c429acf296979436ab21bf8bd77f31ab3023bd7fdbe28b93fe92ddabf0bdb1d990d628bf43942d728cddd330c8b79ab6a270877b789a714095074823637880bb380ad826c3a5ec6fd46c0e2b5887dbcfb101fd84 -Ciphertext: a9b65651c6b7b3a6322c21538d9732f2f31beabe4e94c288aff4cc0bd18dea04f15215343a07e16eda6eb535a04f0fa6100bbafd8fb7e89ed087e662cd5537ed321351d19b56a6dc4a8cf50078f7bc9bb9d2982a0ffc8d24e1814935a9ca38edc6b04105a8ac488437946af107e1bf0838db8ec4066646692fc61b9d94d09a83d63913838c1e88ef6845de6b32e261ae972a6b70e72d6e -Test: Encrypt -IV: a9b65651c6b7b3a6322c21538d9732f2f31beabe4e94c288 -Ciphertext: 685c9adf5239c2f521ac91e3a335267b34ce2aad1760f8771c51ac8c48ae1b93938ae2fa2f988b7c87a43c8cd4a97b5e65c2d11aa878c69349308922bf63dff3a5579d549d22c0028a336aac48bdba88cd9654e37746d2728ddf653c7eed0b0404df6f5a4342d0d7e1df8841da0a249313e105e2863d63fbed1ee621ef5e57f48753dbe3d2fc08d15b5244bdf0369c1741fe92fe3b677e -Test: Resync -Key: 8d4b9a4e7e3107c54a75a7c74b93ddf9c44adeffb07a503a05d6a5f287244808 -IV: 7abba4d58cf460f394f80bc9a080a355961c4a2511f50947 -Plaintext: ed3eccc8be0e5ae6d90eed3b15357050171716c7ae56bc9ef7224db5740257361b83aec0d8c7dc7a9e1df44e0f3fd1b8275bb6c5d6fb8d172df4918f39bab0323a5fa7c4a98aef3a482394882daf5403767f639c0d651f01b9b294d511876c4c3c471f7b684900c54cbbc1143d8aa690d7ab98a41fd9236c31692b7d2406beab5202e1b617ee43a6b9c8324404c4862e5fc0301ba8ac7d7b65df1eb36bf038c85e51a03f1b38a6fa74b0163657eebe640343b83a94ef09308ea3f98cc30ad9 -Ciphertext: 5cf10e20d44ba83ba4b201c7176846976b1a10a98d37f006a9b1ba01b4c81db6e97514d0dad76855d95483f3765b26ecb5f8403f8bd65a79cdc220bbc39a35538dfc757431c20b22cc825633a9af1be926f1072b38d2e89dcc903f2d257592ca97520c869abd4f2ec41b10adf0a2f7c56296975869dbc3a2e1465d32b7781991747ad3d141fb0c343419b76c5ce4facfc257f666c1dd020bdc8f189aea79d5c77e63f42da60510ba86ec2b1c934b90d77793b5951faf1c94b5e3ce38d869b0 -Test: Encrypt -IV: 5cf10e20d44ba83ba4b201c7176846976b1a10a98d37f006 -Ciphertext: e23e817a9c4c2740922734bbe3cc5fad938020ed34c0fe401d4da9cee010d4d1056b71d28856ea327d495c643d819d2d4ba6d97820909a7ac222b892aac4ab130610fbe29311f28432303af69d3dbd3a696fb35582aef9b7040a7e85f6c48d31a3d0c3f1cddb5251bc01a5ce0ace8c95882228ddf7c57aaf1890d70b899631a09af5f4130b436a69ab8623e0260cadebad595ba3d27da5df9e62544876d4daa3fe7af8ba8bdbb7246af0289903d69928c43a1c720b948e2d5a0e8b0d062fca -Test: Resync -Key: 39efc9016ceab203c0e172a335d7dc2916ff577f168904648dce170abf5d21ba -IV: e4e0a36fd930f726ff81007cc919ba0da8aacb5abab72394 -Plaintext: c1229356fb463b251270dae5bfe6772135af17b0624454edee3490ae95616c8b4efaab8a6b6f2a83b083d4ef19a86950c6b570d9000e94255087ecaeb56fead57eb8c51ef71fc802f9fd9d14f462fb5568d4206815e7f3473442b5f9ccc730fbf86a45a008f2b784d14791dcda532578e3ba17a0a3733bd518e15d2a65eb6c79a2130d988db4ee07f1f557a9a08aaa77f28744cf928829c940f70ec541a07b2646f4860fbda22f95cd20018deb68159aec40a889e534dd071a076b46d29a3445c8cebdf2ae0ea6ca7ecdfd203e5941581db5a84e66828f2c3e1b -Ciphertext: c885db1a0c9211392f2cf3cd655170409d53fa559acc66faf0f75766b4501ce80b739f51b985ab10ebcaae7adc2b58c1315ded28b77a2c1c1e3bb65b7d9866827a8b4a39f316222bf0522f3c4cd1ab367c6135cd1b104fcaf4cc746e12d3c72a5cf781d487e1a297d83822c6b68c1b5a9a9505a9b64963d64b2d50ef487057aec172cd070533c400fe0d83f79f4affb1be18fd9429d5dda1ed35c71d674fe98788e3b488bb3b5a781fb6689f8732aa8e4674a5df2643b03a332fdc3d5e10bee7014753a745b4e7bd2b579b8885955d8141fca840204da3eeceef -Test: Encrypt -IV: c885db1a0c9211392f2cf3cd655170409d53fa559acc66fa -Ciphertext: a65f1a87049667811331f8305128b6c06fc3becedae1661dcbac3a627d27cf80429687178b1ff1577cc99bee4b311c480dc3053a74fa523660e9af670d852a032e69b65bb2af61af8a2db4d3aad0a4b27ee74bc2203ac502d188975463f050e3369259d676881b1b318a1cd26094923d2c6fb15c0b522952c176c3cbc01252a4d64f875aea09a9295957be06209ae896410f5665422df60dc4038dc9ad1a45f16350bb433054b9a14061b5eed9cde905ea59f15bd1f58811dd4df49531138431e9d57a8a9adbd4d4fa472077ccf40a2a61affb82242db08f3d27 -Test: Resync -Key: 3070f0db09c523507d36404dac79038a393e9f0e3cf5f870b16d2a06da68dcd3 -IV: 4afe87bf79eb938d786ba54c26fd6d7e62261eeae8b62202 -Plaintext: f4ea120b47d15466ade07df0f2ff508759d9cb1035ceeab43920e9094fa50b868673b07173557d4b994b1e9d35078c1c7369df6b6adb2ec0e6bfd280fea8ac31db44beb0c2a4ddc6198957bd0592e3e587d304863b893ff8eee0efc70ced5d712651c3e9dd1a0de0480fd8cccbae4c50dccbacb83dcdc3e2cef7dbc645f0af468163fb0e015ef48ad74694dfbce2db8430a6e91645fd16adbb72e21a0fbaedf5ecff829cea9cbc22f82902748aa52da5ce903d9f2bde77efef5fa3970c720e89f25dd05157247bf0de2d2129c3f856238d4fad -Ciphertext: 46f396f0d2d54189968bf56b5b2f35588c3ad851e00fac6507598f3ea0193a586c00b18677811cc305b0261d9aebbb9c0485a5800c940aa4f09c4fbdede12553824c429c7954e0b8dad889203d292517b98a64e8d7a37c1364eb0934751323d9b9f8498f50d729e977fb742880222f22ac5d7bfebe6905a4c344d82027398a70c334635792deb0f20b83861b05e731f5627aee17df20413c79957556e66a970085e9ad40a73d9a964381584976c6f111619a916fbb5f5d305df862d5a56bac9ff9b436f31c85f34ff890b5ad3299eda2b8642d -Test: Encrypt -IV: 46f396f0d2d54189968bf56b5b2f35588c3ad851e00fac65 -Ciphertext: 358a8f5e5c6fe93c3d6d7d2f90f5973ba2c0cf7c4579c92a52d1ce6203ddd90188d3e36ff7cbe94e7adb4ec7596e89edcf3a94dba1fe64eeb24e8bec5fed2ef6faa4f0d16faf5853e8f69ee0ca0e048658507bd155bfa13d487c3b994f3a1b8871996eedc2d899d9d79ecd8ff968000b863337dc04d9ad8d05696659f8a1cae880e471621ea13ec42d163eecfdf9cd07bf0b10d6f4634ff16d26c700c88831efc82ac0abd0269b93e302422cfc2dc4088e28bc22ed6c06c9b51774bf3aa4088a6a18fa3d3608f9927837efc3382b25a7ab873c -Test: Resync diff --git a/external/crypto++-5.6.3/TestVectors/seal.txt b/external/crypto++-5.6.3/TestVectors/seal.txt deleted file mode 100644 index a1ca35f41..000000000 --- a/external/crypto++-5.6.3/TestVectors/seal.txt +++ /dev/null @@ -1,137 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: SEAL-3.0-BE -Source: generated by Crypto++ 5.2 -Comment: verified against partial ciphertext from 1997 SEAL paper by Rogaway and Coppersmith -Key: 67452301efcdab8998badcfe10325476c3d2e1f0 -IV: 013577af -Plaintext: r1024 00000000 -Ciphertext: \ -37a005959b84c49ca4be1e050673530f5fb097fdf6a13fbd6c2cdecd81fdee7c\ -2abdc3e764209aff00a12283ef675085c1634b53289059e6a7ab5ed9480c01eb\ -4c64569a8dce2a23feed0ef58f6f5ac3f74145127dbcaec4bcb6b1a459bdc287\ -58ba0523f721c3e154433dc7353f02ef487b07ad309ef5e44e6cc19026f5fd57\ -07cc32ec12b9c01fe0c58beb2fe73ea79e24093f05911663a76b21beab18cede\ -17275c54d18fcd3e4cf32279347b22f8751119fb56d92f55d511e4ecc1334085\ -e74934455a2daec3f1821c54b4cb809053b8d837de4186600afedf8bd72dd56e\ -223745c19f76edba01e9b5346666d01f677fbd68fa5010fd7db8b06829a90da0\ -e81b84756a70946a6c05e16d225a2e11af586bb1c5b1d21f5349f8e5e3ee41f4\ -232d554954d1bc86064754b86c1dc92d7a9de30086d8eb4a7c86db9c380f13b9\ -52e11c5b89f1be0a6b52c6e7a053da7359c5fd7f50c70232d86aff08c5ff1746\ -d3bd074d79ad6fc657e0cbbe5d02c4fce55d3c31fef4642ed738f751430f2f1c\ -f6e453ef6edeb9540cec52c697d4864201e141e06c3ddf5aaa64a1a984247e96\ -d2cf1e7fb2bc239919369f4a0bf9d111d0d8be64afae86214d5f62e64f25e8f1\ -3e12680ec170ad6234cbbda938df53cc17a12afea1eb4005122a65cb42bedb76\ -edf029db910fc81b81f3dd28341fed4064ce37648548e5852d4aebb7923016f9\ -afcb07ae7bc11800e217a0062f0b53ffa8d471aa78ca6a13b7f5647189106773\ -0a311d6fe4ff57f05f9a58aa742696b6cbb3ec539da0c2aadd6a60d2a33c26d5\ -8a343448ed912aafb98568c6ae1cb1efaeafd81a6e3e7c450f8e2be4c6cc18f9\ -5e8a1c6c59190a2798e912a614c1e7d0f7e74b1baf8e5682f5442f998b24fa86\ -d1e5f673002e2c92db8ebf7abb1c9d267a9763f4bd54f7bbf07c4466dac0bf3f\ -faf5666a43a52f0812e76df5f9d4da8ed1bc6d4ab29b34718facb4bebc11e907\ -fe9b0e3937de7769fc5b0cc52b3e50d57e02b9b4022949aaf3698bc58f696073\ -ec972a425caee9700864d3d166130ee09d51320b9d51bc9b4aa575c789786242\ -0698d9e1f6426fd141a32c9f55c24e5149e274983035ac1c44833b0179aed63e\ -a2b2b61afa54700155e55c7c343412584f7b0fe73d63c5ad88718dde3000ac1d\ -b4050ae2610032e6b389eec48952a1a2ed0016e525ccd9616706caba89ed07d5\ -4f15ecfaabbc91b7c82c5904bc0f83d44888997faa11fe8fa7333cb8c5b16e31\ -52233c80fbc9f71d9ee8fefa50d67a7e45b93d3469ba4078bb1ed5859e7a8e62\ -b26bacf538507fa6bd43e18d67d7aaf27baaa68d233ca392ce33e257d5ddf3fa\ -ef6a951430d686f65ee9afaf6aee0677b41098922b41fba202ef05a27d614612\ -5daebeb147d617c8df42dba0b91dfbf8ab5805ee9877e495881035fbb7342c24\ -e24f3b85c88671184152ab0d395a9a81afab3bf93bea49cb23ee6bd1c9fb84e6\ -4ecd462f60119ceeae7f1d2150bd36fe7ef2782b0fd12b55df119a517103d489\ -0a739b715d3d33e2ae9fe659df4bc0136c0b243538eaa8f9b813043d66ae15c8\ -261c94c0072afc802668b3151ad1c0ab0f034eb3e8f2fce0c9fbc8f68404fb93\ -a1cd11f4eb9a5eeb9117462ea602ae41fbfe0074323e56e15deb04d41f3510cd\ -1df417f759f4c2bee72bab88833e7d3d9837801f16901ee12581588fa7037f74\ -073b2166405d79098098fb196cc4b1733e45796fa7fc977cbd23853e5943b2ad\ -e154856565a455189198f6ba50b9cc6fda0c309a413ccc746bc8261fd6b060f0\ -5cfcc82894125b3f1e0b0c47257fd838cf295aa13102724163a9fc2598fe8572\ -d0bf844518dccc1ee16eb8e4c9935b78fb969b7c3104091079079a7688f1e833\ -0335f63eabfdd3224a506bae4ea3022a8a4959f4fa410ad7111488a39e3c1cd7\ -a28ce83255de2c4477fe62f660af3b7ba049240aa5212e4e9fffd8b66fd51b17\ -0bdf6c7e7214361a7efdceae86878f49716c0859ce2e24979bae82d98025720e\ -06d7904c9646f1b1058b1a7c93ee4fd728c4f19051adf2ca30f4d54cf65be23a\ -7198e5be5765c018bbc1d2344fa8d1aa908cb8f789ea793c6c60d9a7ba9eebcf\ -7aee50a54810cbe3b632144956a157c220e33a232c169cc9ae64d6aa3560a185\ -fc2d94f15b389eebad8d07662c2be6d6349ece8ef88aea27d430ec9512ff1bc0\ -c5560862fa4a833af750d968e9fb545e3879571ec021735761da937e294820c6\ -585ae00e8023f48a4e1f392217df763a09e540ca615188345512179f8889902f\ -38c626ea3a333fc367818b058dbb8d6aa474ff3438b2de2b32822fdb93f77618\ -83b89223e0e616c885fa3414905d098d82a5359f629ed11589974393cfaf4695\ -da7ee36346d088a6ea6ef21ad6245da8de9956fcefc930c4e2759b596e3f98d9\ -2483b2bd82b74269caae2014f796ffcfe5db58759f0cd4e527b16f989d9cbab7\ -f20282ee2e666cc19ad64aa7a36193ff248002c762280a98f3ad2bf07b32f26b\ -eff5a5586d967d844aba69f7297bb1e28075273f39aa6e7c6c7308728da8ad30\ -31a2d20ebe99940732f93d0440b6e3b481774b69eb76179496350983031c2611\ -a27d885d91ac37debc02512edd06e1d10061325c5e04269c0c14942d10f03f83\ -06ef173d645478d79c74990a82df4b13f2754f273227f96988c25bedaf392534\ -69d73d642305f8058ce4713f65a36b822cd98da3fd805c4408d18dde4ee8e794\ -72e38f8683edbbfdce8d085e005407666eefba25d8c3368c6cb656a699b30736\ -31b8024eb6859019feb76bdb5a0d7f17c92a37fe6bcd14630c1a62bdde1e41b5\ -e9ab7306183a16c31554821ad44229ebce2e552f9a09fd1607dec8c92a1e893a\ -b80c331cdc7860093503cedfd44b3403b3501415916303baef0c68d12efa7c54\ -a11af3a7df5d23df98cfba907dafad0a8989c710d4602fc75f663fb16039d94e\ -f860f358bbf05ac9c34865141030513c4cda32e9b777d9fd9e4ebdc1ad0b24f6\ -799f815e29b8e2259f94b0215b94b349938556736d3ed578cdcea9024d71f174\ -376f05b3c203cc56476dd92d07ecf7e283cc181225a2b690eeaf3cffd35bbda9\ -c4ed0456661e2e39f6be537d2446f65cae13a6dea668b04f8f223601629cd3d1\ -1b75180dfea19435bae5e0622c5005371d4198b8dc1e0c40adbbe08d3651d345\ -4d68507f7f0b56d4bf2a328bb68854064699d0a38d7468ef64ddb4139644fabb\ -d21ad79b5f28a5612e445dc5673b2038e3f7dcf17a12ab32da214fb28500ea79\ -00491554da45661a03e2a878d1006d4fba8e22a7e5dded9b02fb8b5e6d166aad\ -43f8ef3eec4a7050a0304d46cc0be3ec97f0bdd137eea7c001bd8519101ff3af\ -76d1d7710c22c5b0a69c10df3493283254f5afa2ce4b3959d3be512e6ddb78da\ -30cc0a338d675c8fc3fcbbd313b696c660a85fa13ec9fa13ac8e8dbce8335575\ -608d5962ecb516b9ac186206e1ffb971924e9301e6fc220d0769ea1cd954e2fd\ -dc591ea026e369509d427ad062b81ca5e8873432a0d7a031b7f26702840fbb5e\ -5e9e6c8794dbec841822ca92aea2a22709182a3cda136b7b3569d85be6213817\ -06b2852b7de3e20907739958726334ad0c2c3b7327d0060b3f6cd319bf6666e0\ -9de3ee588abb948a6df37d5ac2b18c82d63ca0a0dcc6f1c1e2ae609999f60738\ -714df767fbf14b12b7a002ce0dad86f8adf777ff7ccc9b08180faa0d96b44023\ -3ca5398525eaaa9afba9e0ea4f2cfbf5a3e868f99ddc1a86ee36baf2ab56f9b0\ -b1ff1ff591033e579847267b9557217e0991d2c90e61f7e58321d9bdaba96c9c\ -63e9d3924f0a8c7ac6d4fc94d74d7bc1a96aafad76fca0fa4017d76f00f5cb5e\ -96058fafb57caf07cbcf665fea359cfa2cd4084796e3ea2ccf30bbe6e8f7efea\ -60190fcf2700d1d27b80ff53d8071aeee1ed8708617c92d821f83c9a7ea90c72\ -f19a58e9179cbed5f4f86a80c28e0fbc3fac50d5eea3117df747ab076044f1ef\ -61c7bb95ab31ca2f4f6e61d19e906230694158df40a72fb748dd79d0fd0617b7\ -24b23c6d0569d170731ee07dfd637820f10fbe860a179f2a24775b1f27a2e528\ -a5808d13cc3f995d2cf0c4a832915e19bd6293bfae8eeabcf85de223c4dea84f\ -0d095815cd34ab885d6c50816bf8fd07d4e58aa8c8fbf34344fc3279c1efa142\ -68471ff263f121bc501439c9fe1ae45c946b348a00535ae451d17f3edcecea67\ -5a7dde387813246bb8312147163f813159413fd550e00204c441b0eaf4d12c79\ -520a3d3bd75b00e20a5284457fc3999ac7ce1f1202e5bd651047c74eac7ff92d\ -7f214d6583304f6dda309a01230198b1e656c9707f2f27663c1855771af7f449\ -0e3f3f8da53f0492654a3c40d15620e2fd2a68658ecaa8fb5601775a393878a3\ -110d75e6b968db8eb81c2ecba5852b2eaf7f9b8967b60f92ee4af138a5e777b7\ -aad802e39d7237a17b4a79d9a467a4be1be5121de907400ee5586f0f94bed1db\ -35dcd7995ec93b49b0f6dc7a1e3e4cc0ad1945e60dbe0d24948eb94ddbc45e20\ -fe0bea593df4e6d38647fb623df65f6fbd1e36f318decf77824abd6bdf95eb8f\ -a5f29b650f36b77a305bf9c15b034a7ce1f482ccba079171a6476863a70bf49f\ -cc488177e461837c64d5f5419ae0a344010df2d6edb170b1461ef27024199b15\ -44144dc327eb225f1ee99ab4f07bf2f934042f2df86252c4058212b2e5cf35dd\ -14df206c1dba5445d41f211911e1053813a09e7fea3d5de5cac92acfe36b3ef6\ -8d4767c52a31c8ccba0eaa85874892d813ae601db1ffd5cd42ec1e98534056e2\ -753b5fa30f993016b787de9620a1242986370e005ff4495315c2b1aedb59a32e\ -47be953ea41f15fbe7a115d10328f67e59c538948ceef3f4a338a030ad198b2f\ -c89f067b336f28085a4ca061a38ae6190de48981de1c942ea83a9143b1faf94c\ -2f462a9de5d14b915bfc52e916d16f11cf59a28a3d933fedb48ac06b7cdd29a0\ -720ed851863bafe7a149f403881afe46b940ca37c29b7e49a730b28404179449\ -73274553b70fb11da65acc1c5420677288c624e67542f230da340d1e9b8dc5a1\ -90b69bf5e67e77929250a802f07cdf0716db567209774367aae32e0c1e90928f\ -61c43eaa372f1e9ec70aa0dd506734d23825213edaf184a24a1bb128811db664\ -783cb27cac1edd074d79d1259f84da9e0e5c75923a4dbfaa8a6283dd2279ba69\ -bcd1d78970d7a54a0d31c44071cbf05527010e2ff808cadefd74d906a8ad8c32\ -a01845d3ad78bc6ed96a688dfff171d80d931409d94c83da2bc54ad9790e9a6b\ -a5093384850090a961572f6fdb929a1a6baa98c015e95b0a6da10de04b8471c1\ -aeac19b6c887c1c81dad641d55ab1a29250d14dc41a042f83eb8a6bddcb662a9\ -3e00cf6adaed95cb52b36692f43a8e9b85ba7723d70e5ada851a16fe102ee1c6\ -d3bf8be1634ade9fa6b44626c734788b3aed0c287ab7e80ae5fc1451ddb037c0\ -f729309209226022f13e6f8aa592445db33bb1f29101e0df15db15df0bab6411\ -5bc12f0bbf430551473dbd274db2eea9905eab75f290ecbd903b675f1ad9ac2f\ -2196d00139e7671ac8b95a8cc8e244511d481863b509e5bb7573b6ce49cf0fc9\ -53de75523ca31a64012d11bb7f60f1f67b199a4f2013f6ea3808e2639eb5f263\ -1c19568bcf36071235de8ae7b2d5815e2e0a2e81098a6b4d6179e29ed0a92bdf\ -585a2905f0496ba58eb3d740efa54b664d1a6134fed9fede636504aa691e08e4 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/seed.txt b/external/crypto++-5.6.3/TestVectors/seed.txt deleted file mode 100644 index 983fc3da1..000000000 --- a/external/crypto++-5.6.3/TestVectors/seed.txt +++ /dev/null @@ -1,19 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: SEED/ECB -Source: RFC 4269 -Key: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -Plaintext: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F -Ciphertext: 5E BA C6 E0 05 4E 16 68 19 AF F1 CC 6D 34 6C DB -Test: Encrypt -Key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F -Plaintext: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -Ciphertext: C1 1F 22 F2 01 40 50 50 84 48 35 97 E4 37 0F 43 -Test: Encrypt -Key: 47 06 48 08 51 E6 1B E8 5D 74 BF B3 FD 95 61 85 -Plaintext: 83 A2 F8 A2 88 64 1F B9 A4 E9 A5 CC 2F 13 1C 7D -Ciphertext: EE 54 D1 3E BC AE 70 6D 22 6B C3 14 2C D4 0D 4A -Test: Encrypt -Key: 28 DB C3 BC 49 FF D8 7D CF A5 09 B1 1D 42 2B E7 -Plaintext: B4 1E 6B E2 EB A8 4A 14 8E 2E ED 84 59 3C 5E C7 -Ciphertext: 9B 9B 7B FC D1 81 3C B9 5D 0B 36 18 F4 0F 51 22 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/sha.txt b/external/crypto++-5.6.3/TestVectors/sha.txt deleted file mode 100644 index 7980daa40..000000000 --- a/external/crypto++-5.6.3/TestVectors/sha.txt +++ /dev/null @@ -1,59 +0,0 @@ -AlgorithmType: MessageDigest -Name: SHA-1 -Message: "abc" -Digest: A9993E364706816ABA3E25717850C26C9CD0D89D -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: 84983E441C3BD26EBAAE4AA1F95129E5E54670F1 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: 34AA973CD4C4DAA4F61EEB2BDBAD27316534016F -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-224 -Message: "abc" -Digest: 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: 75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: 20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67 -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-256 -Message: "abc" -Digest: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-384 -Message: "abc" -Digest: cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7 -Test: Verify -Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" -Digest: 09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: 9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b07b8b3dc38ecc4ebae97ddd87f3d8985 -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-512 -Message: "abc" -Digest: ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f -Test: Verify -Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" -Digest: 8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/sha3.txt b/external/crypto++-5.6.3/TestVectors/sha3.txt deleted file mode 100644 index 4ee8dec06..000000000 --- a/external/crypto++-5.6.3/TestVectors/sha3.txt +++ /dev/null @@ -1,861 +0,0 @@ -AlgorithmType: MessageDigest -Name: SHA-3-224 -Message: "" -Digest: f71837502ba8e108 37bdd8d365adb855 91895602fc552b48 b7390abd -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -Digest: 310aee6b30c47350576ac2873fa89fd190cdc488442f3ef654cf23fe -Test: Verify -Message: "The quick brown fox jumps over the lazy dog." -Digest: c59d4eaeac728671c635ff645014e2afa935bebffdb5fbd207ffdeab -Test: Verify -Message: "abc" -Digest: c30411768506ebe1c2871b1ee2e87d38df342317300a9b97a95ec6a8 -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: e51faa2b4655150b931ee8d700dc202f763ca5f962c529eae55012b6 -Test: Verify -Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" -Digest: 344298994b1b06873eae2ce739c425c47291a2e24189e01b524f88dc -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: 19f9167be2a04c43 abd0ed554788101b 9c339031acc8e146 8531303f -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-3-256 -Message: "" -Digest: c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -Digest: 4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15 -Test: Verify -Message: "The quick brown fox jumps over the lazy dog." -Digest: 578951e24efd62a3d63a86f7cd19aaa53c898fe287d2552133220370240b572d -Test: Verify -Message: "abc" -Digest: 4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: 45d3b367a6904e6e8d502ee04999a7c27647f91fa845d456525fd352ae3d7371 -Test: Verify -Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" -Digest: f519747ed599024f3882238e5ab43960132572b7345fbeb9a90769dafd21ad67 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: fadae6b49f129bbb 812be8407b7b2894 f34aecf6dbd1f9b0 f0c7e9853098fc96 -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-3-384 -Message: "" -Digest: 2c23146a63a29acf99e73b88f8c24eaa7dc60aa771780ccc006afbfa8fe2479b2dd2b21362337441ac12b515911957ff -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -Digest: 283990fa9d5fb731d786c5bbee94ea4db4910f18c62c03d173fc0a5e494422e8a0b3da7574dae7fa0baf005e504063b3 -Test: Verify -Message: "The quick brown fox jumps over the lazy dog." -Digest: 9ad8e17325408eddb6edee6147f13856ad819bb7532668b605a24a2d958f88bd5c169e56dc4b2f89ffd325f6006d820b -Test: Verify -Message: "abc" -Digest: f7df1165f033337be098e7d288ad6a2f74409d7a60b49c36642218de161b1f99f8c681e4afaf31a34db29fb763e3c28e -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: b41e8896428f1bcbb51e17abd6acc98052a3502e0d5bf7fa1af949b4d3c855e7c4dc2c390326b3f3e74c7b1e2b9a3657 -Test: Verify -Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" -Digest: cc063f34685135368b34f7449108f6d10fa727b09d696ec5331771da46a923b6c34dbd1d4f77e595689c1f3800681c28 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: 0c8324e1ebc18282 2c5e2a086cac07c2 fe00e3bce61d01ba 8ad6b71780e2dec5 fb89e5ae90cb593e 57bc6258fdd94e17 -Test: Verify - -AlgorithmType: MessageDigest -Name: SHA-3-512 -Message: "" -Digest: 0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e -Test: Verify -Message: "The quick brown fox jumps over the lazy dog" -Digest: d135bb84d0439dbac432247ee573a23ea7d3c9deb2a968eb31d47c4fb45f1ef4422d6c531b5b9bd6f449ebcc449ea94d0a8f05f62130fda612da53c79659f609 -Test: Verify -Message: "The quick brown fox jumps over the lazy dog." -Digest: ab7192d2b11f51c7dd744e7b3441febf397ca07bf812cceae122ca4ded6387889064f8db9230f173f6d1ab6e24b6e50f065b039f799f5592360a6558eb52d760 -Test: Verify -Message: "abc" -Digest: 18587dc2ea106b9a 1563e32b3312421c a164c7f1f07bc922 a9c83d77cea3a1e5 d0c6991073902537 2dc14ac964262937 9540c17e2a65b19d 77aa511a9d00bb96 -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -Digest: 6aa6d3669597df6d 5a007b00d09c2079 5b5c4218234e1698 a944757a488ecdc0 9965435d97ca32c3 cfed7201ff30e070 cd947f1fc12b9d92 14c467d342bcba5d -Test: Verify -Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" -Digest: ac2fb35251825d3a a48468a9948c0a91 b8256f6d97d8fa41 60faff2dd9dfcc24 f3f1db7a983dad13 d53439ccac0b37e2 4037e7b95f80f59f 37a2f683c4ba4682 -Test: Verify -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -Digest: 5cf53f2e556be5a6 24425ede23d0e8b2 c7814b4ba0e4e09c bbf3c2fac7056f61 e048fc341262875e bc58a5183fea6514 47124370c1ebf4d6 c89bc9a7731063bb -Test: Verify -Source: ShortMsgKAT_512.txt from http://keccak.noekeon.org/KeccakKAT-3.zip -Message: CC -Digest: 8630C13CBD066EA74BBE7FE468FEC1DEE10EDC1254FB4C1B7C5FD69B646E44160B8CE01D05A0908CA790DFB080F4B513BC3B6225ECE7A810371441A5AC666EB9 -Test: Verify -Message: 41FB -Digest: 551DA6236F8B96FCE9F97F1190E901324F0B45E06DBBB5CDB8355D6ED1DC34B3F0EAE7DCB68622FF232FA3CECE0D4616CDEB3931F93803662A28DF1CD535B731 -Test: Verify -Message: 1F877C -Digest: EB7F2A98E00AF37D964F7D8C44C1FB6E114D8EE21A7B976AE736539EFDC1E3FE43BECEF5015171E6DA30168CAE99A82C53FA99042774EF982C01626A540F08C0 -Test: Verify -Message: C1ECFDFC -Digest: 952D4C0A6F0EF5CE438C52E3EDD345EA00F91CF5DA8097C1168A16069E958FC05BAD90A0C5FB4DD9EC28E84B226B94A847D6BB89235692EF4C9712F0C7030FAE -Test: Verify -Message: 21F134AC57 -Digest: 2E76D93AFFD62B92FC4F29CB83EFBE4BA21D88426AA7F075BFC20960EA258787898172E17045AF43AB1FE445532BE0185FBEA84D9BE788B05F14DBF4856A5254 -Test: Verify -Message: C6F50BB74E29 -Digest: 40FA8074E1E509B206448FBE757D9494B9B51E8D6E674A67F53C11EF92E96C3EA08B95EBD4172B020010CD6CF29539A34D6BFA002A2042787AA8D879A0F5B54C -Test: Verify -Message: 119713CC83EEEF -Digest: D1116786A3C1EA46A8F22D82ABB4C5D06DC0691B2E747AC9726D0B290E6959F7B23428519A656B237695E56403855EC4C98DB0CF87F31B6CEABF2B9B8589B713 -Test: Verify -Message: 4A4F202484512526 -Digest: F326C7C126DDC277922760FEEF77C9BAB6FB5D3430F652593703D7C5E30135CD0B0575257509A624184330D6AB1F508A666391B5D4690426B4E05301891DF897 -Test: Verify -Message: 1F66AB4185ED9B6375 -Digest: 1F5B8A6E8D94F5E2535D46842B9CED467C39C2DB323963D3F3D937E9DDA76FBC17072DDA2AB4771CD7A645145A2AEC1B5749BF9EFE0CDE006CC3EF8936438E0D -Test: Verify -Message: EED7422227613B6F53C9 -Digest: 2AEEE7A720C030A820CD7BAA8570D72CB90B7A238C38C358676358A7AE9A5CF26635B2320D61C1284899E654F0BFDD0A3A9C343FFBD11838B57465E6C3AD3A57 -Test: Verify -Message: EAEED5CDFFD89DECE455F1 -Digest: 7B1C1BEF3B4DEB4B4812C81A6E7B3F2C66FA95157FA3B9D2959DC56B8ADD100170D3C8D1745FD230A31F89FA17889C4C58946B5D746E47B71ED0394B66D1BDB2 -Test: Verify -Message: 5BE43C90F22902E4FE8ED2D3 -Digest: EE41401AF509D6FC0944CD4A0BB29D2DCE0DCC862606E669E31381E5D6CECB463143645D696D14E40169CDC71C75686D6E8732B432092626421CC6CC196F80BF -Test: Verify -Message: A746273228122F381C3B46E4F1 -Digest: 9B53B410B9F5DCE90A77244DB407A3D0F4898D112D0044A8F66AF933E26666DE63EBD2A4322D8FE525AB354CE9676B6A14D0CE6B3D24E6CD5832BEA0C5153CEF -Test: Verify -Message: 3C5871CD619C69A63B540EB5A625 -Digest: 2B53FE6583FC24EE8A63801067E4D3BD6E6934EF16BC822FC3A69F4EE13A404D9A3CE2BB4A12C77382BFDE4D843F87FD06ED8AECC234A3A24CEDFE60BFC06933 -Test: Verify -Message: FA22874BCC068879E8EF11A69F0722 -Digest: 80946CA68E8C16A9667CD8339D1C5B00F1E0D401D0ECC79458754794838F3AE2949A8CC5FE5584033BCA9C5BE62C7C08F402EF02F727CEFA43BBD374C2A67C52 -Test: Verify -Message: 52A608AB21CCDD8A4457A57EDE782176 -Digest: 4B39D3DA5BCDF4D9B769015995644311C14C435BF72B1009D6DD71B01A63B97CFB596418E8E42342D117E07471A8914314BA7B0E264DADF0CEA381868CBD43D1 -Test: Verify -Message: 82E192E4043DDCD12ECF52969D0F807EED -Digest: C37C9DC2E20D8E2F0AE588D7D45A807CCFA000FC948AC42A8ED63BB14F318FC3D4B963F7305980E6A0FD2316B55B63142373B1A29002264855C716C5C9F17F4C -Test: Verify -Message: 75683DCB556140C522543BB6E9098B21A21E -Digest: 9073C62555E6095F17DF71AD02BABB9100288633898489B21C906A3190875BAEACCC83BE80ABD11466FEC371BA2C4623D07F0131DEFAEC13A8C732A9F8417163 -Test: Verify -Message: 06E4EFE45035E61FAAF4287B4D8D1F12CA97E5 -Digest: 23E9352856718E1E2D68A21D56D93117CED7628E984FF04ED8C0CB9B10539E4EDE284F94FA71BF4B83BBB493435FD6BE26EDDB09DEAC39680E6B05ACC87B8C4E -Test: Verify -Message: E26193989D06568FE688E75540AEA06747D9F851 -Digest: 909D753426B1DEE09FC474F18CF810D5D5AADBF8A09AF495BF6C22ACA0C673021BFC5D2AD94F50B24E1569E956694B21CF2CC8B4F3C7EE4CF195E4424CC415DD -Test: Verify -Message: D8DC8FDEFBDCE9D44E4CBAFE78447BAE3B5436102A -Digest: 046C6019FC4D628AE0DA7092F9910F269B853D3B57052039AD1375C665405F9FD79D57579F42C4FFF249BB85AE65113A9F4276CEDE73E9CCB0C24753935A006E -Test: Verify -Message: 57085FD7E14216AB102D8317B0CB338A786D5FC32D8F -Digest: 51C909A6528949BADDAF1BA0B154EA9C33FDE5074359505B76D4B7ED54352DD893D40B142A5F802F378CBA7B8C3782ECF2A048542BE6C5936822214846A8D5E4 -Test: Verify -Message: A05404DF5DBB57697E2C16FA29DEFAC8AB3560D6126FA0 -Digest: EFC8917E1247742A2D4EC29AFEDDF1E6ECE377B3D8AC6E58C9851CE9C99BD599ADEBFED657BAACD1793FC91B04DF2957BF6F1888869286002DC4AD9AC7F76793 -Test: Verify -Message: AECBB02759F7433D6FCB06963C74061CD83B5B3FFA6F13C6 -Digest: FCEF88BCC7EF70D8C3973429AC5139155F9BA643B431013F1817ECD2FF3AB287880F9EA54DF7503CB3F73D7CF2B87D2E9BDBD203378FAE74CA4BD2667A4AA706 -Test: Verify -Message: AAFDC9243D3D4A096558A360CC27C8D862F0BE73DB5E88AA55 -Digest: 470BDD8D709875C8E6F88591B97D6486C5F03B54BFC905757483E013F63A6C56984D4518D45C2D2298EADB44AF3A0C35A76B573D452F5747844D3AD8F84A2E85 -Test: Verify -Message: 7BC84867F6F9E9FDC3E1046CAE3A52C77ED485860EE260E30B15 -Digest: 429FD438B390AD0224028975467EC228F9ADCDE71E1738005E3717C58F727AA2B7C61780BF0C5F8B766CC6D34551D87D22A130B8C215614204E607AA82FF8469 -Test: Verify -Message: FAC523575A99EC48279A7A459E98FF901918A475034327EFB55843 -Digest: 790A010AEB6F13E019A1DC35574B1219E74FF5DB6FBD8746733664FFDBCFE1CC6E8AB39117E3244C4FA3C0A962C9F50030AEF88E193E7E0D4C4747345F30CB54 -Test: Verify -Message: 0F8B2D8FCFD9D68CFFC17CCFB117709B53D26462A3F346FB7C79B85E -Digest: AAF7A391600270F7B5A2A3BBC7474AC4154EBEAC03A790A57FDAD96CEA2D043C9FA5F6916790B92F8032D668ED9A07112DC5B2373EC816AABCA6F577CE60415E -Test: Verify -Message: A963C3E895FF5A0BE4824400518D81412F875FA50521E26E85EAC90C04 -Digest: 3E2880A974E50F98BD6CC0F9D769AF348CE3B7E8FA38CF0CA2DA5FD704C9C0E57D5500BEA3CB7477927F9C394AA3F9BBC01824350291B9A0A0CBF094BB37DA55 -Test: Verify -Message: 03A18688B10CC0EDF83ADF0A84808A9718383C4070C6C4F295098699AC2C -Digest: 48E55E0340F20466881A732AA88459AD4BCDEF364C3BD045AE099F953D89F15957AEF204265C3915BA42FE4235196BE3D0F564676227C3C0DEACFBAF68F9E717 -Test: Verify -Message: 84FB51B517DF6C5ACCB5D022F8F28DA09B10232D42320FFC32DBECC3835B29 -Digest: 9D8098D8D6EDBBAA2BCFC6FB2F89C3EAC67FEC25CDFE75AA7BD570A648E8C8945FF2EC280F6DCF73386109155C5BBC444C707BB42EAB873F5F7476657B1BC1A8 -Test: Verify -Message: 9F2FCC7C90DE090D6B87CD7E9718C1EA6CB21118FC2D5DE9F97E5DB6AC1E9C10 -Digest: 1EAFEDCE7292BA73B80AE6151745F43AC95BFC9F31694D422473ABCA2E69D695CB6544DB65506078CB20DBE0762F84AA6AFD14A60AB597955BE73F3F5C50F7A8 -Test: Verify -Message: DE8F1B3FAA4B7040ED4563C3B8E598253178E87E4D0DF75E4FF2F2DEDD5A0BE046 -Digest: 9A7688E31AAF40C15575FC58C6B39267AAD3722E696E518A9945CF7F7C0FEA84CB3CB2E9F0384A6B5DC671ADE7FB4D2B27011173F3EEEAF17CB451CF26542031 -Test: Verify -Message: 62F154EC394D0BC757D045C798C8B87A00E0655D0481A7D2D9FB58D93AEDC676B5A0 -Digest: ADA5CA5630660003C4D16149F235FAEB78132F7F773A631F820CC5C654B08EAB4206BB4EA1389D1CF74D3B60B86E484C90C817CDB5DD5DBF327163B4646F7213 -Test: Verify -Message: B2DCFE9FF19E2B23CE7DA2A4207D3E5EC7C6112A8A22AEC9675A886378E14E5BFBAD4E -Digest: 71A0801D32587980B09963A0F547B8B6EE3BADE224671BF44F12E3DA4F21778BAC37FCC73EF45FEE1C96688BAF9020F487B1A16E3AC91B504845D6FBA879134F -Test: Verify -Message: 47F5697AC8C31409C0868827347A613A3562041C633CF1F1F86865A576E02835ED2C2492 -Digest: EBA678B7A0E5669DC7FA5ECA5D5F19FE625E113E5028DA5EFB138923CD444757B06078E0BA064B36C72CA2187AB9DD31DDA6F24668F46C32F8EC21AC59AAFA24 -Test: Verify -Message: 512A6D292E67ECB2FE486BFE92660953A75484FF4C4F2ECA2B0AF0EDCDD4339C6B2EE4E542 -Digest: 12DF92D889D7BA0DF05BCD02D9DE58C97F4813126967FF78BDF759C66C4CBE9DF68AB31A0256C776730BB25DEECF91F0997868AC8BB86DF7A0FC110CB0A4DE5D -Test: Verify -Message: 973CF2B4DCF0BFA872B41194CB05BB4E16760A1840D8343301802576197EC19E2A1493D8F4FB -Digest: B8C7CE2BE4CB32C140E75B75474248C1DD77D19B0CBCA31A3ECC2A35C532E4FA3ED4ABBCDA27AA68A9DDA06B245443E5903A65652A94ED3AF15065D3E7736E47 -Test: Verify -Message: 80BEEBCD2E3F8A9451D4499961C9731AE667CDC24EA020CE3B9AA4BBC0A7F79E30A934467DA4B0 -Digest: A0AE9DFB56831FE4A3223C501B697BD8243C471E8343ACFD37A6B587FEAC74571C23DEEBC9B94A540A02F1B1E2251E01229C9D58C4279F155D5566FB18E81295 -Test: Verify -Message: 7ABAA12EC2A7347674E444140AE0FB659D08E1C66DECD8D6EAE925FA451D65F3C0308E29446B8ED3 -Digest: 631E7847124A70FE6EB293A44A25C50600B5E7E975CA9FAB5AE64AB86C7E42C912DD6EC093F01A8DEBC6E1F5E487AF97DC3FD6C53002765050BE963FFCD4D989 -Test: Verify -Message: C88DEE9927679B8AF422ABCBACF283B904FF31E1CAC58C7819809F65D5807D46723B20F67BA610C2B7 -Digest: B989263BB4E0424F95FDC9A49C83A3769FBF31DCEDDA7E005AB5F22F43D2718DEBD39085971F7EB7822C9FA0F67F776CEC4E35A9A8B8C835EF4E9EBDA1922E4D -Test: Verify -Message: 01E43FE350FCEC450EC9B102053E6B5D56E09896E0DDD9074FE138E6038210270C834CE6EADC2BB86BF6 -Digest: FF6ADCB9E1546798D396DB78452DF1A375B65EE3D54FCC915A8CA3DA693E24931999B0FC8A4EB92F6FF85E42BB4CFD9CE7D7863EEE709C9EF37642B696174474 -Test: Verify -Message: 337023370A48B62EE43546F17C4EF2BF8D7ECD1D49F90BAB604B839C2E6E5BD21540D29BA27AB8E309A4B7 -Digest: 1051B7FF77274B784E7FB7823E756F0C4355047E489775BBEDAA7CE5A75EFAC331492C016CE02EB2BE8BA2FE6B735B9A1484E73AC06DE573C5D0B4A58822A36A -Test: Verify -Message: 6892540F964C8C74BD2DB02C0AD884510CB38AFD4438AF31FC912756F3EFEC6B32B58EBC38FC2A6B913596A8 -Digest: 5639A2824297CA099ECF2A81EEF1753F6314CB663D860F05A39E3E801FF82060BBA10628E2C0D9E0A84DD05ED637FC0B65BA03BB66E46FB256F2A5B28D3F41D2 -Test: Verify -Message: F5961DFD2B1FFFFDA4FFBF30560C165BFEDAB8CE0BE525845DEB8DC61004B7DB38467205F5DCFB34A2ACFE96C0 -Digest: 97F9D642507E6DD179D56F4B815E92D0D486826F273EC711B8F9CB76AFC79F900816FDBC13DD3A59FBECBA1F3B6953F879F27C8987B24C6FF8557A2C834076B9 -Test: Verify -Message: CA061A2EB6CEED8881CE2057172D869D73A1951E63D57261384B80CEB5451E77B06CF0F5A0EA15CA907EE1C27EBA -Digest: AFEF2AF5A01B89BE190A0E6E796AA51F1F8C356772C6FC7731F08AAB8BD81AEE1287C70D564F4F169E37B07F28202A85F468281B4CDC1273CF61EB30E3BDCEE1 -Test: Verify -Message: 1743A77251D69242750C4F1140532CD3C33F9B5CCDF7514E8584D4A5F9FBD730BCF84D0D4726364B9BF95AB251D9BB -Digest: F467CCA67C387FFC9F1B173A084C451095D01AD0BF3953AC103A76F0F1BC86167305A926A941A53417F1611A505AAA205BCFCCBFD343465DAD8A6C1E80609A9D -Test: Verify -Message: D8FABA1F5194C4DB5F176FABFFF856924EF627A37CD08CF55608BBA8F1E324D7C7F157298EABC4DCE7D89CE5162499F9 -Digest: 4B389A2A0DF5E295EA9444F2739B5492F290C4467B0B4CDC1CC9ED2CEFA7A9E527E0627CDAF0BDA58F17D13F94AF7D2DEFF6FC5D53DD9157674475527FBB4F86 -Test: Verify -Message: BE9684BE70340860373C9C482BA517E899FC81BAAA12E5C6D7727975D1D41BA8BEF788CDB5CF4606C9C1C7F61AED59F97D -Digest: 6590FFFB7311AB7DAB370FB518CCC19BAA9AF7C84179ADB002F8FACD3C44AF2830A84DF1E2C2402368CC36614A6EA22903063E57D00EC511A46A9A03FE3819F7 -Test: Verify -Message: 7E15D2B9EA74CA60F66C8DFAB377D9198B7B16DEB6A1BA0EA3C7EE2042F89D3786E779CF053C77785AA9E692F821F14A7F51 -Digest: 895796B2A0824C55F030D82E794925C38D8459F38CF848519F120FF6A9D5A03EBF006C3EA5021E8F3B3408FF12F01BCDDF7A085BA0A9A58944FEC1F554836DF8 -Test: Verify -Message: 9A219BE43713BD578015E9FDA66C0F2D83CAC563B776AB9F38F3E4F7EF229CB443304FBA401EFB2BDBD7ECE939102298651C86 -Digest: E4BBD54BFB99D345471F8AB94271B4B748F5CE70C21C28AE6559E03EE7890A2C814043E624A6BD2944350756B37FA8208FC7473A67B310CEEBC17D965ED688B2 -Test: Verify -Message: C8F2B693BD0D75EF99CAEBDC22ADF4088A95A3542F637203E283BBC3268780E787D68D28CC3897452F6A22AA8573CCEBF245972A -Digest: 80D862AD05428A299213E65B50310463FD22C505E693DD4719E0A120EEAA35C5FC1608A08D22E2CCDDECA49878BC26ABE55A3C9A546347439A942ED0C1A6A23E -Test: Verify -Message: EC0F99711016C6A2A07AD80D16427506CE6F441059FD269442BAAA28C6CA037B22EEAC49D5D894C0BF66219F2C08E9D0E8AB21DE52 -Digest: 021B3B392DECCB9075559F88C0C229026A2048CEF8EEB2D4F94803DCF2DA0A73E004D7F14E9FD662670B59229AB3883C340F4E3A8C42624CCB90BEC1156F95D4 -Test: Verify -Message: 0DC45181337CA32A8222FE7A3BF42FC9F89744259CFF653504D6051FE84B1A7FFD20CB47D4696CE212A686BB9BE9A8AB1C697B6D6A33 -Digest: 97BF33A5254C8ACA27486428440B1034AAAFAC8B498ECB830C2581DC68518079B65FB0C595997693DDB8D68D9564EA98DC43CD287E2E018DB7DFAAAA205C547A -Test: Verify -Message: DE286BA4206E8B005714F80FB1CDFAEBDE91D29F84603E4A3EBC04686F99A46C9E880B96C574825582E8812A26E5A857FFC6579F63742F -Digest: C05FD9C3FA73F80956FF1C3B89160EB520CA640E201B3FE5E6E296220E81B59D530476010D3784CA08692B8C716A3BE982B37450A96D30A401D3BA3C390D9DE3 -Test: Verify -Message: EEBCC18057252CBF3F9C070F1A73213356D5D4BC19AC2A411EC8CDEEE7A571E2E20EAF61FD0C33A0FFEB297DDB77A97F0A415347DB66BCAF -Digest: B980E657C13726DBADB6570EA3A9E633869CADB798EB35C482697A04CB712F1C1E8C5D0BD67E43E52DA294E82D5E80A695A74A3D27C0C672ADCFE2C928859A6D -Test: Verify -Message: 416B5CDC9FE951BD361BD7ABFC120A5054758EBA88FDD68FD84E39D3B09AC25497D36B43CBE7B85A6A3CEBDA8DB4E5549C3EE51BB6FCB6AC1E -Digest: 6ADFC561835FDDD70A9FEB57C513165D12AEB3283F0DD7774DD58852DA9E969ABDAF20DD44856FA60E11BDFA2DBB7E3347669FFF7A57A8D8D37431C2B309972D -Test: Verify -Message: 5C5FAF66F32E0F8311C32E8DA8284A4ED60891A5A7E50FB2956B3CBAA79FC66CA376460E100415401FC2B8518C64502F187EA14BFC9503759705 -Digest: 0E7459BDC857B949CC59A9C649B9625268BF9A11EA81EEEFA4ECDD410E2F6FD2C78289C01365F99034FF8FA8C115DDCEBEFA26A8D6468F5030E641745950061E -Test: Verify -Message: 7167E1E02BE1A7CA69D788666F823AE4EEF39271F3C26A5CF7CEE05BCA83161066DC2E217B330DF821103799DF6D74810EED363ADC4AB99F36046A -Digest: 2A8CE9DF40879B24DADF61C9131F694E5531ADE6B7AB071CA10ABDD3C2E4A22C868A52986A329F880137EE76109770927D2658E63EB486D880290AC0782CF5BF -Test: Verify -Message: 2FDA311DBBA27321C5329510FAE6948F03210B76D43E7448D1689A063877B6D14C4F6D0EAA96C150051371F7DD8A4119F7DA5C483CC3E6723C01FB7D -Digest: A83CE5A6A58376D57DB4C58DA1B46C131FF1BF8FF2DE5E8617FB37E5098398EDB53F9888B8752A8AFF19178F2F6BD7A33FD36C59E4A631906280907FC1C5AB07 -Test: Verify -Message: 95D1474A5AAB5D2422ACA6E481187833A6212BD2D0F91451A67DD786DFC91DFED51B35F47E1DEB8A8AB4B9CB67B70179CC26F553AE7B569969CE151B8D -Digest: 9EBFCEA2DB1676EEE6B103119543C6049DEBD8FB8F1E01A5AB5B348E2919E14C8CFE8E542F2AB747B0FD4A4C3EEE4019BB046E24BFE2091FB9C65DCA527B71AD -Test: Verify -Message: C71BD7941F41DF044A2927A8FF55B4B467C33D089F0988AA253D294ADDBDB32530C0D4208B10D9959823F0C0F0734684006DF79F7099870F6BF53211A88D -Digest: 97B08BE7653E9DF1B5AFA459EA750A3AC9BF3577BCC7E5344FC861184880926DEF354E4C65B20EC66C47B7AFFD3E7493958BAB0A90724D3D8DD9E1D561FA60C2 -Test: Verify -Message: F57C64006D9EA761892E145C99DF1B24640883DA79D9ED5262859DCDA8C3C32E05B03D984F1AB4A230242AB6B78D368DC5AAA1E6D3498D53371E84B0C1D4BA -Digest: EF8AAF08159BBCB88EFAC49A33A5248B7ED0544960D8DD54D748A91C0D84C69F308BB54CB5EC97D3F81CDF76E68E0320815B93F2A00942F2168CBC18E8377708 -Test: Verify -Message: E926AE8B0AF6E53176DBFFCC2A6B88C6BD765F939D3D178A9BDE9EF3AA131C61E31C1E42CDFAF4B4DCDE579A37E150EFBEF5555B4C1CB40439D835A724E2FAE7 -Digest: C0A4D8DCA967772DBF6E5508C913E7BEBA1B749A2B1AC963D0676E6F1DCD4EBAA3F909EF87DD849882DC8253347A5F6520B5B9F510973F443976455F923CFCB9 -Test: Verify -Message: 16E8B3D8F988E9BB04DE9C96F2627811C973CE4A5296B4772CA3EEFEB80A652BDF21F50DF79F32DB23F9F73D393B2D57D9A0297F7A2F2E79CFDA39FA393DF1AC00 -Digest: CF03C946EB7022F60FB5439462AC22684E47EAACBFFE19B797760B4A24A5238BE9D90E17D40EA6FE7B2885CEF7DFB8BB489401CAA94F2DD6E04592E33E76B9D1 -Test: Verify -Message: FC424EEB27C18A11C01F39C555D8B78A805B88DBA1DC2A42ED5E2C0EC737FF68B2456D80EB85E11714FA3F8EABFB906D3C17964CB4F5E76B29C1765DB03D91BE37FC -Digest: 2C35F1A57A17CB29403A2B40FC307BDE10BA8F7FEC7B94E1E42EB4EEB952AAD00EC46A26646CD51DB0C6B238189D7D470E21C29BF8710423CB5602CAB75E29E7 -Test: Verify -Message: ABE3472B54E72734BDBA7D9158736464251C4F21B33FBBC92D7FAC9A35C4E3322FF01D2380CBAA4EF8FB07D21A2128B7B9F5B6D9F34E13F39C7FFC2E72E47888599BA5 -Digest: 505E6E607C90C57BBE7CE52BB42DF3D90BC32DE554025730C84ED0F89A0132885D7A40FADFF7A4B01DE4D29735AEFE0E0469F4F172B62A0DABA889E152308FC4 -Test: Verify -Message: 36F9F0A65F2CA498D739B944D6EFF3DA5EBBA57E7D9C41598A2B0E4380F3CF4B479EC2348D015FFE6256273511154AFCF3B4B4BF09D6C4744FDD0F62D75079D440706B05 -Digest: 7BE2C95413C589EC5AD69F8D80BFE9F26540D5C1832C7A49A31A8F5655D9CE8B47D97C69CCCD693C211904142A5403DA7AD09FBDB825698FE201988FCCCD2BB2 -Test: Verify -Message: ABC87763CAE1CA98BD8C5B82CABA54AC83286F87E9610128AE4DE68AC95DF5E329C360717BD349F26B872528492CA7C94C2C1E1EF56B74DBB65C2AC351981FDB31D06C77A4 -Digest: 8AAC9201D76DF13424A32552F04390E499B6168711B70C875789DDAA9B115F8B8259A60D17835E2587F8901C3CA782DA9AFB28BA87B9FCBE05A47A42F48FCD48 -Test: Verify -Message: 94F7CA8E1A54234C6D53CC734BB3D3150C8BA8C5F880EAB8D25FED13793A9701EBE320509286FD8E422E931D99C98DA4DF7E70AE447BAB8CFFD92382D8A77760A259FC4FBD72 -Digest: AA52587D84586317028FB7D3C20892E0288BFE2FEABD76D7F89155FFE9CCBF1A09FA0FFB0553E83F79AE58BD30A35FA54892B6ABA0093A012427DDAB71CDF819 -Test: Verify -Message: 13BD2811F6ED2B6F04FF3895ACEED7BEF8DCD45EB121791BC194A0F806206BFFC3B9281C2B308B1A729CE008119DD3066E9378ACDCC50A98A82E20738800B6CDDBE5FE9694AD6D -Digest: 48FC282F37A3E1FB5DF4D2DA1F7197EC899AE573CA08DF550E61EE847EEB1D24C074FF46BCAEE224EC7D8CEA4256154F0C4D434E682834F6D827BFBDF75112F5 -Test: Verify -Message: 1EED9CBA179A009EC2EC5508773DD305477CA117E6D569E66B5F64C6BC64801CE25A8424CE4A26D575B8A6FB10EAD3FD1992EDDDEEC2EBE7150DC98F63ADC3237EF57B91397AA8A7 -Digest: 6B4B0F126863552A6F40F45E295DC79B9BA2A88EA7C3B2F607AC1A8431A97844C2A7B664443FB23C05739DF5494FE9824DB80B7F3E67872142F17E2C5544E1EF -Test: Verify -Message: BA5B67B5EC3A3FFAE2C19DD8176A2EF75C0CD903725D45C9CB7009A900C0B0CA7A2967A95AE68269A6DBF8466C7B6844A1D608AC661F7EFF00538E323DB5F2C644B78B2D48DE1A08AA -Digest: 7EEC7B730056B1BD4F6FFC186FB45591E50CD93CF6E4FC958889F82D3F32C5C74D03A4BCF7D2754298F134698AF4559B0E29BAAA365CC00DB0D51D407179C56D -Test: Verify -Message: 0EFA26AC5673167DCACAB860932ED612F65FF49B80FA9AE65465E5542CB62075DF1C5AE54FBA4DB807BE25B070033EFA223BDD5B1D3C94C6E1909C02B620D4B1B3A6C9FED24D70749604 -Digest: 79CB925ACA072EBB3B49A9D0E59BB07DD1C223C1F26C91768B929472C51B977F85C6CEEB54BCE89CF9FF6155D7FE8091540F1348CE9592A6403F92105477870E -Test: Verify -Message: BBFD933D1FD7BF594AC7F435277DC17D8D5A5B8E4D13D96D2F64E771ABBD51A5A8AEA741BECCBDDB177BCEA05243EBD003CFDEAE877CCA4DA94605B67691919D8B033F77D384CA01593C1B -Digest: B5D1ED8F039044BCFEF41E99B2F564F45991B329B503FC91FA29D2408512F8711E9DB66F8AE172164650545AE9E3DB32AA369EC47E81A77111276E6CA38E4D92 -Test: Verify -Message: 90078999FD3C35B8AFBF4066CBDE335891365F0FC75C1286CDD88FA51FAB94F9B8DEF7C9AC582A5DBCD95817AFB7D1B48F63704E19C2BAA4DF347F48D4A6D603013C23F1E9611D595EBAC37C -Digest: 782C008A9EE3DDA0A182267185C995A2AF737BA8CB2F6179F2CDF52505F8D933E712FC4E56D10E175EC8CDD62DE6529CE1F078BFA0DC7A5284F8C565182F85D9 -Test: Verify -Message: 64105ECA863515C20E7CFBAA0A0B8809046164F374D691CDBD6508AAABC1819F9AC84B52BAFC1B0FE7CDDBC554B608C01C8904C669D8DB316A0953A4C68ECE324EC5A49FFDB59A1BD6A292AA0E -Digest: 91A0241EDA8CA597CBB0F703AB7DBAAF859CFF77B20401AD46230CE3B2BEEF6685775DE37576014D8DA1BA672D47AAD95FB53C590B650634CEBB43A175738569 -Test: Verify -Message: D4654BE288B9F3B711C2D02015978A8CC57471D5680A092AA534F7372C71CEAAB725A383C4FCF4D8DEAA57FCA3CE056F312961ECCF9B86F14981BA5BED6AB5B4498E1F6C82C6CAE6FC14845B3C8A -Digest: 00B02DBCB7A3BC117701F2F159FC4492923C437D3369833A9BD09E78E260D48D37168D36C49777B2E68E6FE9846106A6AB8768C3971FAB31FD922AACB87D1CAC -Test: Verify -Message: 12D9394888305AC96E65F2BF0E1B18C29C90FE9D714DD59F651F52B88B3008C588435548066EA2FC4C101118C91F32556224A540DE6EFDDBCA296EF1FB00341F5B01FECFC146BDB251B3BDAD556CD2 -Digest: 3DEDF819B357DFAB1C7092ABD872A1554DD0962E9944EEF9F7F8BCE830F2D74F1D9BA2B748BBC6EE0B7600BE8CB0FFCB79924D9F51CDB9B06BD6FD37F3050229 -Test: Verify -Message: 871A0D7A5F36C3DA1DFCE57ACD8AB8487C274FAD336BC137EBD6FF4658B547C1DCFAB65F037AA58F35EF16AFF4ABE77BA61F65826F7BE681B5B6D5A1EA8085E2AE9CD5CF0991878A311B549A6D6AF230 -Digest: 5FBE194557B0426F96BA60712176DF073EAFE04F2A50515455412EA3D80C116758AD952598F48031612181D82A16EFE4668FFB3BCCE9563A772FE416FF6DB3B3 -Test: Verify -Message: E90B4FFEF4D457BC7711FF4AA72231CA25AF6B2E206F8BF859D8758B89A7CD36105DB2538D06DA83BAD5F663BA11A5F6F61F236FD5F8D53C5E89F183A3CEC615B50C7C681E773D109FF7491B5CC22296C5 -Digest: 2E8AB1619859C11473DC7C474CE8B0AE44B1C38417816FD95B9E0614F31E51EBB1DD16D1CBB584C4EBD28AA99F4A68E09DFE3AD462487F2608124B7528293045 -Test: Verify -Message: E728DE62D75856500C4C77A428612CD804F30C3F10D36FB219C5CA0AA30726AB190E5F3F279E0733D77E7267C17BE27D21650A9A4D1E32F649627638DBADA9702C7CA303269ED14014B2F3CF8B894EAC8554 -Digest: DB2D182BDBAC6AC866537E24712332CAE74DC3D36168982E4453DD6E009658345255013BC0A54FCA17AEEDCC4BEB79BDEE192CFAB516D24591C8699F7C758179 -Test: Verify -Message: 6348F229E7B1DF3B770C77544E5166E081850FA1C6C88169DB74C76E42EB983FACB276AD6A0D1FA7B50D3E3B6FCD799EC97470920A7ABED47D288FF883E24CA21C7F8016B93BB9B9E078BDB9703D2B781B616E -Digest: 90A2C05F7001D985B587A046B488BF4ED29D75CC03A745731B5B0CE51BB86387C4CE34018A6D906EB7BEB41A09AFE9FEDD99AACC41B4556F75229C8688C7FCA2 -Test: Verify -Message: 4B127FDE5DE733A1680C2790363627E63AC8A3F1B4707D982CAEA258655D9BF18F89AFE54127482BA01E08845594B671306A025C9A5C5B6F93B0A39522DC877437BE5C2436CBF300CE7AB6747934FCFC30AEAAF6 -Digest: EA3991C4A8A5F0146402DE4AE235054C78A48DCA340A7D4AD8753995F82347ECFC0054D64EB4F20ABC4F415C54701CBC61A7B239A7C221B833D9EA9F94B154E8 -Test: Verify -Message: 08461F006CFF4CC64B752C957287E5A0FAABC05C9BFF89D23FD902D324C79903B48FCB8F8F4B01F3E4DDB483593D25F000386698F5ADE7FAADE9615FDC50D32785EA51D49894E45BAA3DC707E224688C6408B68B11 -Digest: 1313023B753ED1727F13CC67A64B989A8BF6548324DF9854D8D5A963ED3D860257FE6522B9C6D6CB1BCADF322C985601BA36F7E67110192094AA8F9869A458A8 -Test: Verify -Message: 68C8F8849B120E6E0C9969A5866AF591A829B92F33CD9A4A3196957A148C49138E1E2F5C7619A6D5EDEBE995ACD81EC8BB9C7B9CFCA678D081EA9E25A75D39DB04E18D475920CE828B94E72241F24DB72546B352A0E4 -Digest: 9BCA2A1A5546A11275BF42F0B48492868359C78D94785A0EE12DC1C3D70A8E97EB462148FAED1FFA4DAB0E91519BD36C0C5C5FE7CFCFF3E180680318E1FCF75B -Test: Verify -Message: B8D56472954E31FB54E28FCA743F84D8DC34891CB564C64B08F7B71636DEBD64CA1EDBDBA7FC5C3E40049CE982BBA8C7E0703034E331384695E9DE76B5104F2FBC4535ECBEEBC33BC27F29F18F6F27E8023B0FBB6F563C -Digest: 8492F5E621E82FDBFF1976B1BEECFF7D137805B5736AB49216122A95396B863A0481212B6DABA8B05E29E287BB0E2F588F86407C84DBFB894E6ACFC6F6B2E571 -Test: Verify -Message: 0D58AC665FA84342E60CEFEE31B1A4EACDB092F122DFC68309077AED1F3E528F578859EE9E4CEFB4A728E946324927B675CD4F4AC84F64DB3DACFE850C1DD18744C74CECCD9FE4DC214085108F404EAB6D8F452B5442A47D -Digest: EEBE4EC0FE3E0266527F4D9F57A017637EAB92377D82B15856A55A22B008DF67F27AA5AC04E1DEEEB2C819CE41DB07DBF6DCAF17A192A4371A1E92BADF1E6389 -Test: Verify -Message: 1755E2D2E5D1C1B0156456B539753FF416651D44698E87002DCF61DCFA2B4E72F264D9AD591DF1FDEE7B41B2EB00283C5AEBB3411323B672EAA145C5125185104F20F335804B02325B6DEA65603F349F4D5D8B782DD3469CCD -Digest: 9E36E6291BC2296CB4BA71109CEDCC2A3F0B4F1AE5E5406DC4B3E594551D5C70E6F814D2C9B8413103EF07535886B4AC518AAF7AED64ABED7A5B0A26F7171425 -Test: Verify -Message: B180DE1A611111EE7584BA2C4B020598CD574AC77E404E853D15A101C6F5A2E5C801D7D85DC95286A1804C870BB9F00FD4DCB03AA8328275158819DCAD7253F3E3D237AEAA7979268A5DB1C6CE08A9EC7C2579783C8AFC1F91A7 -Digest: F1089483A00B2601BE9C16469A090EFC49FCB70E62AC0FFEA2D1E508083CD5D41DCF2DAAE1E0EAC217859E5FEADDCB782AC471C01D7266136185D37B568E9606 -Test: Verify -Message: CF3583CBDFD4CBC17063B1E7D90B02F0E6E2EE05F99D77E24E560392535E47E05077157F96813544A17046914F9EFB64762A23CF7A49FE52A0A4C01C630CFE8727B81FB99A89FF7CC11DCA5173057E0417B8FE7A9EFBA6D95C555F -Digest: D063EA794CFD2ED9248665A6084A7B99051C1051E41B7D9DCB1537A1C79CBA6DEB4D844C6A618E43C7CA020D16976999684FEB084616F707209F75C4BD584D86 -Test: Verify -Message: 072FC02340EF99115BAD72F92C01E4C093B9599F6CFC45CB380EE686CB5EB019E806AB9BD55E634AB10AA62A9510CC0672CD3EDDB589C7DF2B67FCD3329F61B1A4441ECA87A33C8F55DA4FBBAD5CF2B2527B8E983BB31A2FADEC7523 -Digest: 424A86D746C87C85DABD1DAE298A488E4CA2183DE692D1D01C4B7994EE5124F9004BEA84933C311CC38EA6F604A7769EE178E1EC160A9891C42C462A13A62286 -Test: Verify -Message: 76EECF956A52649F877528146DE33DF249CD800E21830F65E90F0F25CA9D6540FDE40603230ECA6760F1139C7F268DEBA2060631EEA92B1FFF05F93FD5572FBE29579ECD48BC3A8D6C2EB4A6B26E38D6C5FBF2C08044AEEA470A8F2F26 -Digest: A9403C26A96DE2C3D359EE29F3FD1C581154852D19AD12884B79E7082D2DA22EC83553BABA2BDFF2A2FA15947A8E6ACD5F5D113EC091BFD1962A0A10401D2C98 -Test: Verify -Message: 7ADC0B6693E61C269F278E6944A5A2D8300981E40022F839AC644387BFAC9086650085C2CDC585FEA47B9D2E52D65A2B29A7DC370401EF5D60DD0D21F9E2B90FAE919319B14B8C5565B0423CEFB827D5F1203302A9D01523498A4DB10374 -Digest: 3D23632EE4C2D4F4118A02A677B5A32427C72BA54899BA2E6CCD22EC3DEFE0FCB052E3F83D35786CEA2080EED148A0A94628E735202E6B2809994C5F5BDAFDD6 -Test: Verify -Message: E1FFFA9826CCE8B86BCCEFB8794E48C46CDF372013F782ECED1E378269B7BE2B7BF51374092261AE120E822BE685F2E7A83664BCFBE38FE8633F24E633FFE1988E1BC5ACF59A587079A57A910BDA60060E85B5F5B6F776F0529639D9CCE4BD -Digest: D8FA886884CE577A7282DECEACF4786E7C68FC69B141137FF5DC7CB3C5F8ABC845716DD27397E8BD5CE245107A984A3F8B21F19F99ED40118621DC85303A30B4 -Test: Verify -Message: 69F9ABBA65592EE01DB4DCE52DBAB90B08FC04193602792EE4DAA263033D59081587B09BBE49D0B49C9825D22840B2FF5D9C5155F975F8F2C2E7A90C75D2E4A8040FE39F63BBAFB403D9E28CC3B86E04E394A9C9E8065BD3C85FA9F0C7891600 -Digest: C768CD313602FABB2193F9EDBF667B4CDABD57D5FF60BDC22BA7BAD5319EA04E7CBEC5D4B4C4560AD52609FDD22750B618951796376ED41B2A8EAFFDD9927722 -Test: Verify -Message: 38A10A352CA5AEDFA8E19C64787D8E9C3A75DBF3B8674BFAB29B5DBFC15A63D10FAE66CD1A6E6D2452D557967EAAD89A4C98449787B0B3164CA5B717A93F24EB0B506CEB70CBBCB8D72B2A72993F909AAD92F044E0B5A2C9AC9CB16A0CA2F81F49 -Digest: 8562CE9399806623B2695712266AF3D4C14F77D2449143379246962C22398C813544A7DEE4C4847F09D3CBE437349B7FC6738AC97075B5DD9E2ADD6ECAA610F4 -Test: Verify -Message: 6D8C6E449BC13634F115749C248C17CD148B72157A2C37BF8969EA83B4D6BA8C0EE2711C28EE11495F43049596520CE436004B026B6C1F7292B9C436B055CBB72D530D860D1276A1502A5140E3C3F54A93663E4D20EDEC32D284E25564F624955B52 -Digest: 99ADE7B13E8E79AEA6ED01A25E10E401CD1D055884575EAB3E66B2294F03F8D5DBF72AB1AE39103189383EBFD2E43258510C124A894A793B206FAC752C035789 -Test: Verify -Message: 6EFCBCAF451C129DBE00B9CEF0C3749D3EE9D41C7BD500ADE40CDC65DEDBBBADB885A5B14B32A0C0D087825201E303288A733842FA7E599C0C514E078F05C821C7A4498B01C40032E9F1872A1C925FA17CE253E8935E4C3C71282242CB716B2089CCC1 -Digest: D12831BA39DBCD41F56BC7FC071BDAABFB6E7572D08B2FDA3BDDFC6FA5662F4BDBFA431CA2E38B18172709072E50120DB6BE93E86CB4ACE3C11DD0E1F3F5C712 -Test: Verify -Message: 433C5303131624C0021D868A30825475E8D0BD3052A022180398F4CA4423B98214B6BEAAC21C8807A2C33F8C93BD42B092CC1B06CEDF3224D5ED1EC29784444F22E08A55AA58542B524B02CD3D5D5F6907AFE71C5D7462224A3F9D9E53E7E0846DCBB4CE -Digest: 527D28E341E6B14F4684ADB4B824C496C6482E51149565D3D17226828884306B51D6148A72622C2B75F5D3510B799D8BDC03EAEDE453676A6EC8FE03A1AD0EAB -Test: Verify -Message: A873E0C67CA639026B6683008F7AA6324D4979550E9BCE064CA1E1FB97A30B147A24F3F666C0A72D71348EDE701CF2D17E2253C34D1EC3B647DBCEF2F879F4EB881C4830B791378C901EB725EA5C172316C6D606E0AF7DF4DF7F76E490CD30B2BADF45685F -Digest: CACDCF8BF855040E9795C422069D8E37B6286066A2197A320BD934061F66995227BE6B85FD928B834D3CA45E1AC3844D9DC66D61581E7799CCFDE008639AB3DD -Test: Verify -Message: 006917B64F9DCDF1D2D87C8A6173B64F6587168E80FAA80F82D84F60301E561E312D9FBCE62F39A6FB476E01E925F26BCC91DE621449BE6504C504830AAE394096C8FC7694651051365D4EE9070101EC9B68086F2EA8F8AB7B811EA8AD934D5C9B62C60A4771 -Digest: F454A953501E191A12A80C7A5398F081CEF738E25D48B076A52F77FB09EF0BC2325116020BB06C2C585DA9F115BD9D8F13B50E8E1FB1664450FAE690B7783400 -Test: Verify -Message: F13C972C52CB3CC4A4DF28C97F2DF11CE089B815466BE88863243EB318C2ADB1A417CB1041308598541720197B9B1CB5BA2318BD5574D1DF2174AF14884149BA9B2F446D609DF240CE335599957B8EC80876D9A085AE084907BC5961B20BF5F6CA58D5DAB38ADB -Digest: 5F968CC6ECF71C588A3C3BA68858BBFF96861F66C0733FD61FA91A479A49618DF22D9490219DF8008DC78840AE022C5D41AF2B890D0214E562DA8DF0CB3F8522 -Test: Verify -Message: E35780EB9799AD4C77535D4DDB683CF33EF367715327CF4C4A58ED9CBDCDD486F669F80189D549A9364FA82A51A52654EC721BB3AAB95DCEB4A86A6AFA93826DB923517E928F33E3FBA850D45660EF83B9876ACCAFA2A9987A254B137C6E140A21691E1069413848 -Digest: E7149461F9CD00B71C216C50041B3EDA9707D7360D4C21740C44C212256A31DA398FE09708E450EA4E2826B7EC20BEF76CD2FBD9D096AF6F77F84ABC2E4FB093 -Test: Verify -Message: 64EC021C9585E01FFE6D31BB50D44C79B6993D72678163DB474947A053674619D158016ADB243F5C8D50AA92F50AB36E579FF2DABB780A2B529370DAA299207CFBCDD3A9A25006D19C4F1FE33E4B1EAEC315D8C6EE1E730623FD1941875B924EB57D6D0C2EDC4E78D6 -Digest: 77097413CAA5A2D38259D47EC078871FA09EE5614D4C14FEB7A95C921C0AAE93B8737A6DC89E57693BE8A0710206664B80B657A1079605A0FF9664BBCB0722D6 -Test: Verify -Message: 5954BAB512CF327D66B5D9F296180080402624AD7628506B555EEA8382562324CF452FBA4A2130DE3E165D11831A270D9CB97CE8C2D32A96F50D71600BB4CA268CF98E90D6496B0A6619A5A8C63DB6D8A0634DFC6C7EC8EA9C006B6C456F1B20CD19E781AF20454AC880 -Digest: 55D8E5202360D7D5841419362F864CC900E11C582FD0CAB2FF5F1680F6CE927B5379E27A335EBAFE1286B9D4A172AB761A36EADE60F10468EAC4CEAFBF63C7CC -Test: Verify -Message: 03D9F92B2C565709A568724A0AFF90F8F347F43B02338F94A03ED32E6F33666FF5802DA4C81BDCE0D0E86C04AFD4EDC2FC8B4141C2975B6F07639B1994C973D9A9AFCE3D9D365862003498513BFA166D2629E314D97441667B007414E739D7FEBF0FE3C32C17AA188A8683 -Digest: EFFB03B497ADD6230A0ED99122EA868138644AB81E861491E526FAE37C39872CA731804A0004599849478A787BC7FCE21903ED551D7DB881D2A2C367B6168547 -Test: Verify -Message: F31E8B4F9E0621D531D22A380BE5D9ABD56FAEC53CBD39B1FAB230EA67184440E5B1D15457BD25F56204FA917FA48E669016CB48C1FFC1E1E45274B3B47379E00A43843CF8601A5551411EC12503E5AAC43D8676A1B2297EC7A0800DBFEE04292E937F21C005F17411473041 -Digest: A2269A6EF2EA8F1CF8BC3394D27657B0DB996C55E7C47784C0B451202FC5279679D79E06F8DBAA9A63665FD0E914D13C6E056EA006DAAF4CB61D2629468E3D25 -Test: Verify -Message: 758EA3FEA738973DB0B8BE7E599BBEF4519373D6E6DCD7195EA885FC991D896762992759C2A09002912FB08E0CB5B76F49162AEB8CF87B172CF3AD190253DF612F77B1F0C532E3B5FC99C2D31F8F65011695A087A35EE4EEE5E334C369D8EE5D29F695815D866DA99DF3F79403 -Digest: 5A2970D5EC346A8E4E1D5D1E57DC22F6875DDF1CE3626B49A91109E0DE991033E932F883B6A795016D5014E268304ABE2F7577505AAB00956911781F075D113A -Test: Verify -Message: 47C6E0C2B74948465921868804F0F7BD50DD323583DC784F998A93CD1CA4C6EF84D41DC81C2C40F34B5BEE6A93867B3BDBA0052C5F59E6F3657918C382E771D33109122CC8BB0E1E53C4E3D13B43CE44970F5E0C079D2AD7D7A3549CD75760C21BB15B447589E86E8D76B1E9CED2 -Digest: 2B4356A64DF31936B27F4530F076EE73E71E4E48ABDE04FF1F548E0727F4A5810B71874187FD96ED510D0D6886AF11960A0B3BAD1EE75DDA4CDC148E162EDAE9 -Test: Verify -Message: F690A132AB46B28EDFA6479283D6444E371C6459108AFD9C35DBD235E0B6B6FF4C4EA58E7554BD002460433B2164CA51E868F7947D7D7A0D792E4ABF0BE5F450853CC40D85485B2B8857EA31B5EA6E4CCFA2F3A7EF3380066D7D8979FDAC618AAD3D7E886DEA4F005AE4AD05E5065F -Digest: EDCB59984267BB00402A78F2CA345EF2494956172E10927EE63AFF23D0C834BCA50C47CDBFFD8995036307E9ED4B143E853450367D0E14AFC8490073653CD850 -Test: Verify -Message: 58D6A99BC6458824B256916770A8417040721CCCFD4B79EACD8B65A3767CE5BA7E74104C985AC56B8CC9AEBD16FEBD4CDA5ADB130B0FF2329CC8D611EB14DAC268A2F9E633C99DE33997FEA41C52A7C5E1317D5B5DAED35EBA7D5A60E45D1FA7EAABC35F5C2B0A0F2379231953322C4E -Digest: D0B453FBE709C69125DC8FE9E8AE9245211612970373B454F8656A755E8435B321DD3A980FA28719641747E254DC42C9BF012B4D6DBD7ED13020A83B44C504AA -Test: Verify -Message: BEFAB574396D7F8B6705E2D5B58B2C1C820BB24E3F4BAE3E8FBCD36DBF734EE14E5D6AB972AEDD3540235466E825850EE4C512EA9795ABFD33F330D9FD7F79E62BBB63A6EA85DE15BEAEEA6F8D204A28956059E2632D11861DFB0E65BC07AC8A159388D5C3277E227286F65FF5E5B5AEC1 -Digest: FE97C011E525110E03149FAC4179891AFCB6304E1CFD9D84CB7389755554EE723571D76B80B9333A695884192340B3FE022D4A233B7AA8E8C7686745CFE75E67 -Test: Verify -Message: 8E58144FA9179D686478622CE450C748260C95D1BA43B8F9B59ABECA8D93488DA73463EF40198B4D16FB0B0707201347E0506FF19D01BEA0F42B8AF9E71A1F1BD168781069D4D338FDEF00BF419FBB003031DF671F4A37979564F69282DE9C65407847DD0DA505AB1641C02DEA4F0D834986 -Digest: 1BC4AC8D979CA62A7FC81C710CEDF65AF56C9B652EEC356AA92DA924D370FDEBDF076F91BA4FE1EC5CD78FC4C8885EA4304BA2E8E64944AB4BF4D1B3D7DEE745 -Test: Verify -Message: B55C10EAE0EC684C16D13463F29291BF26C82E2FA0422A99C71DB4AF14DD9C7F33EDA52FD73D017CC0F2DBE734D831F0D820D06D5F89DACC485739144F8CFD4799223B1AFF9031A105CB6A029BA71E6E5867D85A554991C38DF3C9EF8C1E1E9A7630BE61CAABCA69280C399C1FB7A12D12AEFC -Digest: 76E970E9449D868067CD23B1A202CBDC99693FF6FA74BA644EC41CBF8FD139CB0F5D1106FCD6C871C315FF41C3EAF99C636288F0FCF6A40B480CB881D87E098F -Test: Verify -Message: 2EEEA693F585F4ED6F6F8865BBAE47A6908AECD7C429E4BEC4F0DE1D0CA0183FA201A0CB14A529B7D7AC0E6FF6607A3243EE9FB11BCF3E2304FE75FFCDDD6C5C2E2A4CD45F63C962D010645058D36571404A6D2B4F44755434D76998E83409C3205AA1615DB44057DB991231D2CB42624574F545 -Digest: 871666B230C5AD75B96D63BE22870621C68FD0899655BA7DC0E0E5299915AF252C226DD7217601D3A6880D55EE5A20B10820E21C74F730EEA9D47FE26DEBE006 -Test: Verify -Message: DAB11DC0B047DB0420A585F56C42D93175562852428499F66A0DB811FCDDDAB2F7CDFFED1543E5FB72110B64686BC7B6887A538AD44C050F1E42631BC4EC8A9F2A047163D822A38989EE4AAB01B4C1F161B062D873B1CFA388FD301514F62224157B9BEF423C7783B7AAC8D30D65CD1BBA8D689C2D -Digest: 7E3EF62552B28A2B18A71CEEF2DD8659C8BDF291385AD02FED353775E01594F27CC28CC78663E17CB8B39FD4EA48D494AD0BD7AEE9277EC9B21E46523812736E -Test: Verify -Message: 42E99A2F80AEE0E001279A2434F731E01D34A44B1A8101726921C0590C30F3120EB83059F325E894A5AC959DCA71CE2214799916424E859D27D789437B9D27240BF8C35ADBAFCECC322B48AA205B293962D858652ABACBD588BCF6CBC388D0993BD622F96ED54614C25B6A9AA527589EAAFFCF17DDF7 -Digest: 0B87F6EBAA293FF79C873820846C0FCC943E3A83BD8111931FF03FF3B0BF785C961CA84CF3FD40E0D831DBAEA595498FC12DA88CC507DE720A35C01D73FC9595 -Test: Verify -Message: 3C9B46450C0F2CAE8E3823F8BDB4277F31B744CE2EB17054BDDC6DFF36AF7F49FB8A2320CC3BDF8E0A2EA29AD3A55DE1165D219ADEDDB5175253E2D1489E9B6FDD02E2C3D3A4B54D60E3A47334C37913C5695378A669E9B72DEC32AF5434F93F46176EBF044C4784467C700470D0C0B40C8A088C815816 -Digest: 681BABBD2E351501C285812E06F20940FD865516CF028B4787D1FFCCD0D537705E8E9B73C608D5A8DC4F08EEE0902AC12936DDB8C7B29228C6AAF8D0B909C30D -Test: Verify -Message: D1E654B77CB155F5C77971A64DF9E5D34C26A3CAD6C7F6B300D39DEB1910094691ADAA095BE4BA5D86690A976428635D5526F3E946F7DC3BD4DBC78999E653441187A81F9ADCD5A3C5F254BC8256B0158F54673DCC1232F6E918EBFC6C51CE67EAEB042D9F57EEC4BFE910E169AF78B3DE48D137DF4F2840 -Digest: C46D2262F186421D07FD740F922306D99B1E3826F6A32486BE5A91DC298F177F50915E17EB4EA2E45494C501736CEFB0E22ACD989DA41AC7BB7BE56B04BFB5E1 -Test: Verify -Message: 626F68C18A69A6590159A9C46BE03D5965698F2DAC3DE779B878B3D9C421E0F21B955A16C715C1EC1E22CE3EB645B8B4F263F60660EA3028981EEBD6C8C3A367285B691C8EE56944A7CD1217997E1D9C21620B536BDBD5DE8925FF71DEC6FBC06624AB6B21E329813DE90D1E572DFB89A18120C3F606355D25 -Digest: 0B3DBC770332823E686470D842104D3B3C1452F64F1BCC71C5F3FAD1C0D93F21EFBD48D73C7D4909227B06B06D54057A74E03C36D9C106EBA79411F1E6E1CFFE -Test: Verify -Message: 651A6FB3C4B80C7C68C6011675E6094EB56ABF5FC3057324EBC6477825061F9F27E7A94633ABD1FA598A746E4A577CAF524C52EC1788471F92B8C37F23795CA19D559D446CAB16CBCDCE90B79FA1026CEE77BF4AB1B503C5B94C2256AD75B3EAC6FD5DCB96ACA4B03A834BFB4E9AF988CECBF2AE597CB9097940 -Digest: CA46276B0DC2EC4424BB7136EAE1AF207BD6E5CD833691C7D37B2CAEAF4F484B96A3476FC25FEB206AD37CF975383DD522CA0CC6200A3867FEE7F178D6953FEF -Test: Verify -Message: 8AAF072FCE8A2D96BC10B3C91C809EE93072FB205CA7F10ABD82ECD82CF040B1BC49EA13D1857815C0E99781DE3ADBB5443CE1C897E55188CEAF221AA9681638DE05AE1B322938F46BCE51543B57ECDB4C266272259D1798DE13BE90E10EFEC2D07484D9B21A3870E2AA9E06C21AA2D0C9CF420080A80A91DEE16F -Digest: 815B44668BF3751A3392940FCA54C1E3E4EF5227B052332AFE6EB7A10AC8AD6438CE8A0277AA14BCC41590F6D6A10B6B1BABE6BB4F8D777EA576D634B0BE41C0 -Test: Verify -Message: 53F918FD00B1701BD504F8CDEA803ACCA21AC18C564AB90C2A17DA592C7D69688F6580575395551E8CD33E0FEF08CA6ED4588D4D140B3E44C032355DF1C531564D7F4835753344345A6781E11CD5E095B73DF5F82C8AE3AD00877936896671E947CC52E2B29DCD463D90A0C9929128DA222B5A211450BBC0E02448E2 -Digest: F47799A8547FC9C07D0F808029E7335607D72224BE286E118657BD13A2C51D0374426D9EEB7693BDE5EC6181574C1404DF29BF96941862BA1A0A9A5903319498 -Test: Verify -Message: A64599B8A61B5CCEC9E67AED69447459C8DA3D1EC6C7C7C82A7428B9B584FA67E90F68E2C00FBBED4613666E5168DA4A16F395F7A3C3832B3B134BFC9CBAA95D2A0FE252F44AC6681EB6D40AB91C1D0282FED6701C57463D3C5F2BB8C6A7301FB4576AA3B5F15510DB8956FF77478C26A7C09BEA7B398CFC83503F538E -Digest: 8A0AE12A9E797FB7BD46CBB910076A32873BFFCB9AD98B4FC37316AED681EC49C65ABBB9586405FF96CC80DA4BB8FA73BE1BA9E737595B2307CF369D61BAF59C -Test: Verify -Message: 0E3AB0E054739B00CDB6A87BD12CAE024B54CB5E550E6C425360C2E87E59401F5EC24EF0314855F0F56C47695D56A7FB1417693AF2A1ED5291F2FEE95F75EED54A1B1C2E81226FBFF6F63ADE584911C71967A8EB70933BC3F5D15BC91B5C2644D9516D3C3A8C154EE48E118BD1442C043C7A0DBA5AC5B1D5360AAE5B9065 -Digest: A3C6D58872BAFDEDFDD50C0309089240D6977D4D3D59FB3F2BE133C57D2DFCFCC7C027296F74FE58B2A9A6CB7E5D70088934D051CBA57001FE27965CFA071A6F -Test: Verify -Message: A62FC595B4096E6336E53FCDFC8D1CC175D71DAC9D750A6133D23199EAAC288207944CEA6B16D27631915B4619F743DA2E30A0C00BBDB1BBB35AB852EF3B9AEC6B0A8DCC6E9E1ABAA3AD62AC0A6C5DE765DE2C3711B769E3FDE44A74016FFF82AC46FA8F1797D3B2A726B696E3DEA5530439ACEE3A45C2A51BC32DD055650B -Digest: 11E0E521B55F02BEFC7207C06444FCC0C16DCF6F34962921B709A322F35E2193477B0DFA21F213F209705FF3958531A75D94346075FEB29A288B62E2315AE270 -Test: Verify -Message: 2B6DB7CED8665EBE9DEB080295218426BDAA7C6DA9ADD2088932CDFFBAA1C14129BCCDD70F369EFB149285858D2B1D155D14DE2FDB680A8B027284055182A0CAE275234CC9C92863C1B4AB66F304CF0621CD54565F5BFF461D3B461BD40DF28198E3732501B4860EADD503D26D6E69338F4E0456E9E9BAF3D827AE685FB1D817 -Digest: AEBBA57C8ED5AF6EC93F4AA45772FF5167B7EA88DFA71364F37D8FC5FDB7DC3B2C8331A08023F21D110B7D821E2DC7E860826235E7E6291912AC521384747354 -Test: Verify -Message: 10DB509B2CDCABA6C062AE33BE48116A29EB18E390E1BBADA5CA0A2718AFBCD23431440106594893043CC7F2625281BF7DE2655880966A23705F0C5155C2F5CCA9F2C2142E96D0A2E763B70686CD421B5DB812DACED0C6D65035FDE558E94F26B3E6DDE5BD13980CC80292B723013BD033284584BFF27657871B0CF07A849F4AE2 -Digest: 2DF1E09540B53A17222DAB66275CEBECEB1F8A5DB26B0C41F955FA0549F3367E82299E0CD673958AF7DFA04D741AA63BA2C1AD351764DC9228D215F22C24CA58 -Test: Verify -Message: 9334DE60C997BDA6086101A6314F64E4458F5FF9450C509DF006E8C547983C651CA97879175AABA0C539E82D05C1E02C480975CBB30118121061B1EBAC4F8D9A3781E2DB6B18042E01ECF9017A64A0E57447EC7FCBE6A7F82585F7403EE2223D52D37B4BF426428613D6B4257980972A0ACAB508A7620C1CB28EB4E9D30FC41361EC -Digest: 8299CFCEA5F00C93A5EB8A84A13628A68B26796D53FB6A986C95B0B1C248920FB946D8AF98343D14EFC74A4611C53CCC27C5F14C7237AF28364346CA5CD70D1A -Test: Verify -Message: E88AB086891693AA535CEB20E64C7AB97C7DD3548F3786339897A5F0C39031549CA870166E477743CCFBE016B4428D89738E426F5FFE81626137F17AECFF61B72DBEE2DC20961880CFE281DFAB5EE38B1921881450E16032DE5E4D55AD8D4FCA609721B0692BAC79BE5A06E177FE8C80C0C83519FB3347DE9F43D5561CB8107B9B5EDC -Digest: AF57BEA357FCBA0579C4204C0F8DFF181BC8A473014BAE78DF76069DE478B2F2A390327A65BDD24BE926551C78F70B0D5F1C8F4B970997D557F06336A315A749 -Test: Verify -Message: FD19E01A83EB6EC810B94582CB8FBFA2FCB992B53684FB748D2264F020D3B960CB1D6B8C348C2B54A9FCEA72330C2AAA9A24ECDB00C436ABC702361A82BB8828B85369B8C72ECE0082FE06557163899C2A0EFA466C33C04343A839417057399A63A3929BE1EE4805D6CE3E5D0D0967FE9004696A5663F4CAC9179006A2CEB75542D75D68 -Digest: B299E421061EF26C32BB4F50EE669D05FEB2CCBA3297289C30E6434057B3EA7F617BBBF7A5555328FC291F794987577F458350DF99AF3A5778300BE0BD80164F -Test: Verify -Message: 59AE20B6F7E0B3C7A989AFB28324A40FCA25D8651CF1F46AE383EF6D8441587AA1C04C3E3BF88E8131CE6145CFB8973D961E8432B202FA5AF3E09D625FAAD825BC19DA9B5C6C20D02ABDA2FCC58B5BD3FE507BF201263F30543819510C12BC23E2DDB4F711D087A86EDB1B355313363A2DE996B891025E147036087401CCF3CA7815BF3C49 -Digest: CBDFB0D0E720F87259DD0D0B4E9C5319E7F88AAEF7F7AB2FA1CA639AFA0160822F96B3C357A4894CE53CD713FAB23AD052E8565FA3B3A523CB9CE39A6BD535CC -Test: Verify -Message: 77EE804B9F3295AB2362798B72B0A1B2D3291DCEB8139896355830F34B3B328561531F8079B79A6E9980705150866402FDC176C05897E359A6CB1A7AB067383EB497182A7E5AEF7038E4C96D133B2782917417E391535B5E1B51F47D8ED7E4D4025FE98DC87B9C1622614BFF3D1029E68E372DE719803857CA52067CDDAAD958951CB2068CC6 -Digest: 059A181C83A22BFF0AA9BAA22D872BDF23CBE341032CF0BF57997A4A1924D24FBAE9DCA14B6D290692B6A6B6344CBE531734F58AD0224C6E39BD1E87F870AAD6 -Test: Verify -Message: B771D5CEF5D1A41A93D15643D7181D2A2EF0A8E84D91812F20ED21F147BEF732BF3A60EF4067C3734B85BC8CD471780F10DC9E8291B58339A677B960218F71E793F2797AEA349406512829065D37BB55EA796FA4F56FD8896B49B2CD19B43215AD967C712B24E5032D065232E02C127409D2ED4146B9D75D763D52DB98D949D3B0FED6A8052FBB -Digest: 9EDEEB10EE1B7BB8F16A280D8CC3EDA5E909C554419DDC523B69ECEDF2ADF3B3C9BC66FEF365342471C458126F083A3B8E7C0C9D9D77E9F90196B71F9AADF492 -Test: Verify -Message: B32D95B0B9AAD2A8816DE6D06D1F86008505BD8C14124F6E9A163B5A2ADE55F835D0EC3880EF50700D3B25E42CC0AF050CCD1BE5E555B23087E04D7BF9813622780C7313A1954F8740B6EE2D3F71F768DD417F520482BD3A08D4F222B4EE9DBD015447B33507DD50F3AB4247C5DE9A8ABD62A8DECEA01E3B87C8B927F5B08BEB37674C6F8E380C04 -Digest: A6054FFC3D81591BE964C4B004A3A21142365B59EE98B2873D488293F93A8D7154BF72100012C60D3C9418F6AF8EA66372CB4703F5F6381DE6D4B9B98CFF1E90 -Test: Verify -Message: 04410E31082A47584B406F051398A6ABE74E4DA59BB6F85E6B49E8A1F7F2CA00DFBA5462C2CD2BFDE8B64FB21D70C083F11318B56A52D03B81CAC5EEC29EB31BD0078B6156786DA3D6D8C33098C5C47BB67AC64DB14165AF65B44544D806DDE5F487D5373C7F9792C299E9686B7E5821E7C8E2458315B996B5677D926DAC57B3F22DA873C601016A0D -Digest: B0E54A12FDBA0738898F1BBF0BA81F81DE77648D8D14C20BDD5D90F300D382E069F5DBA7EEC6B23168B008B9F39C2B93FD742A5902A5E02728F57712D6A61D4E -Test: Verify -Message: 8B81E9BADDE026F14D95C019977024C9E13DB7A5CD21F9E9FC491D716164BBACDC7060D882615D411438AEA056C340CDF977788F6E17D118DE55026855F93270472D1FD18B9E7E812BAE107E0DFDE7063301B71F6CFE4E225CAB3B232905A56E994F08EE2891BA922D49C3DAFEB75F7C69750CB67D822C96176C46BD8A29F1701373FB09A1A6E3C7158F -Digest: 3CE96077EB17C6A9C95A9A477748876C6451098DBEA2B3261E6D75B64A988E1C75D7EAC73BC2402AFC726543E2A5BDB76689C0931FF762818DD2D3FE57A50FA9 -Test: Verify -Message: FA6EED24DA6666A22208146B19A532C2EC9BA94F09F1DEF1E7FC13C399A48E41ACC2A589D099276296348F396253B57CB0E40291BD282773656B6E0D8BEA1CDA084A3738816A840485FCF3FB307F777FA5FEAC48695C2AF4769720258C77943FB4556C362D9CBA8BF103AEB9034BAA8EA8BFB9C4F8E6742CE0D52C49EA8E974F339612E830E9E7A9C29065 -Digest: C9ACD6D98A349512B952D151ED501562F04EA4BB4B8965812510B9B842531A2B41A0108AC129CF9C9517BE790921DF64AD1DFC0B93DDBA3415EEBAF0DA72F6A0 -Test: Verify -Message: 9BB4AF1B4F09C071CE3CAFA92E4EB73CE8A6F5D82A85733440368DEE4EB1CBC7B55AC150773B6FE47DBE036C45582ED67E23F4C74585DAB509DF1B83610564545642B2B1EC463E18048FC23477C6B2AA035594ECD33791AF6AF4CBC2A1166ABA8D628C57E707F0B0E8707CAF91CD44BDB915E0296E0190D56D33D8DDE10B5B60377838973C1D943C22ED335E -Digest: 26B4E5C4FA85CB33359450E7F7158FB6A0739984565E9D9EBE6AD65B118296E9C1098C11541C871EB1B89853F1FA73AD8702EBF4FC9BE4D0AB057E4391DF964E -Test: Verify -Message: 2167F02118CC62043E9091A647CADBED95611A521FE0D64E8518F16C808AB297725598AE296880A773607A798F7C3CFCE80D251EBEC6885015F9ABF7EAABAE46798F82CB5926DE5C23F44A3F9F9534B3C6F405B5364C2F8A8BDC5CA49C749BED8CE4BA48897062AE8424CA6DDE5F55C0E42A95D1E292CA54FB46A84FBC9CD87F2D0C9E7448DE3043AE22FDD229 -Digest: 913BBA5C0C13CC49D8310014CF5AF1B63BA3D5DB8A27699FCFC573688F0E826FB5A7B5D10D3A1DE693AA66E08C0915E7278F61B5FA30F1263B134F016F74841F -Test: Verify -Message: 94B7FA0BC1C44E949B1D7617D31B4720CBE7CA57C6FA4F4094D4761567E389ECC64F6968E4064DF70DF836A47D0C713336B5028B35930D29EB7A7F9A5AF9AD5CF441745BAEC9BB014CEEFF5A41BA5C1CE085FEB980BAB9CF79F2158E03EF7E63E29C38D7816A84D4F71E0F548B7FC316085AE38A060FF9B8DEC36F91AD9EBC0A5B6C338CBB8F6659D342A24368CF -Digest: E5D53E81866283179012D9239340B0CBFB8D7AEBCE0C824DC6653A652BB1B54E0883991BE2C3E39AD111A7B24E95DAF6F7D9A379D884D64F9C2AFD645E1DB5E2 -Test: Verify -Message: EA40E83CB18B3A242C1ECC6CCD0B7853A439DAB2C569CFC6DC38A19F5C90ACBF76AEF9EA3742FF3B54EF7D36EB7CE4FF1C9AB3BC119CFF6BE93C03E208783335C0AB8137BE5B10CDC66FF3F89A1BDDC6A1EED74F504CBE7290690BB295A872B9E3FE2CEE9E6C67C41DB8EFD7D863CF10F840FE618E7936DA3DCA5CA6DF933F24F6954BA0801A1294CD8D7E66DFAFEC -Digest: 5DA83B7E221933CD67FA2AF8C9934DB74CE822212C99E0EE01F5220B4FE1E9B0388E42E328A1D174E6368F5773853042543A9B493A94B625980B73DF3F3FCCBB -Test: Verify -Message: 157D5B7E4507F66D9A267476D33831E7BB768D4D04CC3438DA12F9010263EA5FCAFBDE2579DB2F6B58F911D593D5F79FB05FE3596E3FA80FF2F761D1B0E57080055C118C53E53CDB63055261D7C9B2B39BD90ACC32520CBBDBDA2C4FD8856DBCEE173132A2679198DAF83007A9B5C51511AE49766C792A29520388444EBEFE28256FB33D4260439CBA73A9479EE00C63 -Digest: 72DE9184BEB5C6A37EA2C395734D0D5412991A57CFFCC13FF9B5FA0F2046EE87C61811FE8EF2470239D5066C220173DE5EBE41885ED8ACAE397FB395E6CA9AEE -Test: Verify -Message: 836B34B515476F613FE447A4E0C3F3B8F20910AC89A3977055C960D2D5D2B72BD8ACC715A9035321B86703A411DDE0466D58A59769672AA60AD587B8481DE4BBA552A1645779789501EC53D540B904821F32B0BD1855B04E4848F9F8CFE9EBD8911BE95781A759D7AD9724A7102DBE576776B7C632BC39B9B5E19057E226552A5994C1DBB3B5C7871A11F5537011044C53 -Digest: B678FA7655584970DEDBBC73A16D7840935B104D06DCB468DDD9814D6CF443FA6F9245824DBFF3AB5FFFEF24B29CB2978796F37E7B49B1682D59F79E3C169E81 -Test: Verify -Message: CC7784A4912A7AB5AD3620AAB29BA87077CD3CB83636ADC9F3DC94F51EDF521B2161EF108F21A0A298557981C0E53CE6CED45BDF782C1EF200D29BAB81DD6460586964EDAB7CEBDBBEC75FD7925060F7DA2B853B2B089588FA0F8C16EC6498B14C55DCEE335CB3A91D698E4D393AB8E8EAC0825F8ADEBEEE196DF41205C011674E53426CAA453F8DE1CBB57932B0B741D4C6 -Digest: 66C64D5B0585DD8C40BECD456E4B0188061AE8059F03E79FE04C40925442BA93B052F52087B30BDBFD4816BBD148696D4FA6C61F216253D7AC178B39EC44C770 -Test: Verify -Message: 7639B461FFF270B2455AC1D1AFCE782944AEA5E9087EB4A39EB96BB5C3BAAF0E868C8526D3404F9405E79E77BFAC5FFB89BF1957B523E17D341D7323C302EA7083872DD5E8705694ACDDA36D5A1B895AAA16ECA6104C82688532C8BFE1790B5DC9F4EC5FE95BAED37E1D287BE710431F1E5E8EE105BC42ED37D74B1E55984BF1C09FE6A1FA13EF3B96FAEAED6A2A1950A12153 -Digest: A7BD506DB9C0509AD47413AF4B0E3948B47C18278F15F5B19FBB0B76E2C1C1F19DB9438528EB6D87B0B4A509567DB39F32641E2944365780914296CF3E48CECF -Test: Verify -Message: EB6513FC61B30CFBA58D4D7E80F94D14589090CF1D80B1DF2E68088DC6104959BA0D583D585E9578AB0AEC0CF36C48435EB52ED9AB4BBCE7A5ABE679C97AE2DBE35E8CC1D45B06DDA3CF418665C57CBEE4BBB47FA4CAF78F4EE656FEC237FE4EEBBAFA206E1EF2BD0EE4AE71BD0E9B2F54F91DAADF1FEBFD7032381D636B733DCB3BF76FB14E23AFF1F68ED3DBCF75C9B99C6F26 -Digest: 2E681F9DDBD7C77EAB0D225E2AD1F72256BE239DF25933BCD6CEDD757269B35E2A5352B3298A4CDA0542FF7D3ADD2B0CF42F10FBE05A67C8763D54A78A43AEA7 -Test: Verify -Message: 1594D74BF5DDE444265D4C04DAD9721FF3E34CBF622DAF341FE16B96431F6C4DF1F760D34F296EB97D98D560AD5286FEC4DCE1724F20B54FD7DF51D4BF137ADD656C80546FB1BF516D62EE82BAA992910EF4CC18B70F3F8698276FCFB44E0EC546C2C39CFD8EE91034FF9303058B4252462F86C823EB15BF481E6B79CC3A02218595B3658E8B37382BD5048EAED5FD02C37944E73B -Digest: FD9BE24763F682043243525E5E0780534A82AD5E83B65EB4ACAF5353313A4CC7C5EEA9DA141DE570232CB4126287E5C77657CA8D6A16B5BE53F470343E722FD6 -Test: Verify -Message: 4CFA1278903026F66FEDD41374558BE1B585D03C5C55DAC94361DF286D4BD39C7CB8037ED3B267B07C346626449D0CC5B0DD2CF221F7E4C3449A4BE99985D2D5E67BFF2923357DDEAB5ABCB4619F3A3A57B2CF928A022EB27676C6CF805689004FCA4D41EA6C2D0A4789C7605F7BB838DD883B3AD3E6027E775BCF262881428099C7FFF95B14C095EA130E0B9938A5E22FC52650F591 -Digest: 14EA33BB33FDF0426E0DFB12DE1C613BA97141454C8971BCCE25C6D87A6C2403CCFAD1E8A6C15754C3CC5AC1718B7F7F1EC003C1B98D70968C5DBB95540B4A17 -Test: Verify -Message: D3E65CB92CFA79662F6AF493D696A07CCF32AAADCCEFF06E73E8D9F6F909209E66715D6E978788C49EFB9087B170ECF3AA86D2D4D1A065AE0EFC8924F365D676B3CB9E2BEC918FD96D0B43DEE83727C9A93BF56CA2B2E59ADBA85696546A815067FC7A78039629D4948D157E7B0D826D1BF8E81237BAB7321312FDAA4D521744F988DB6FDF04549D0FDCA393D639C729AF716E9C8BBA48 -Digest: 3B4B395514E0CAB04FC9F9D6C358006CE06C93831E8948FB9BD2A863F3FA064E78EB57C76DD2D058D09AB3D105C28C2DACAEBD4A473F1FA023053CC15366082F -Test: Verify -Message: 842CC583504539622D7F71E7E31863A2B885C56A0BA62DB4C2A3F2FD12E79660DC7205CA29A0DC0A87DB4DC62EE47A41DB36B9DDB3293B9AC4BAAE7DF5C6E7201E17F717AB56E12CAD476BE49608AD2D50309E7D48D2D8DE4FA58AC3CFEAFEEE48C0A9EEC88498E3EFC51F54D300D828DDDCCB9D0B06DD021A29CF5CB5B2506915BEB8A11998B8B886E0F9B7A80E97D91A7D01270F9A7717 -Digest: 2D7D28C4311E0424D71E7F9D267A2E048AA175455FCB724CF0B13DEBF448B59B0F28265B0F010F4E4F4065004904A7C2687A5A1B30AB593BC44F698DFF5DDE33 -Test: Verify -Message: 6C4B0A0719573E57248661E98FEBE326571F9A1CA813D3638531AE28B4860F23C3A3A8AC1C250034A660E2D71E16D3ACC4BF9CE215C6F15B1C0FC7E77D3D27157E66DA9CEEC9258F8F2BF9E02B4AC93793DD6E29E307EDE3695A0DF63CBDC0FC66FB770813EB149CA2A916911BEE4902C47C7802E69E405FE3C04CEB5522792A5503FA829F707272226621F7C488A7698C0D69AA561BE9F378 -Digest: CB665EC69ABD75743C8713034E9E41736F8C1CE2C77A8518E50388C411E6284D9AADCD4D3BD5A9EB74672325E41E8A67ACF380D1E8A61684F0E501F5663A031D -Test: Verify -Message: 51B7DBB7CE2FFEB427A91CCFE5218FD40F9E0B7E24756D4C47CD55606008BDC27D16400933906FD9F30EFFDD4880022D081155342AF3FB6CD53672AB7FB5B3A3BCBE47BE1FD3A2278CAE8A5FD61C1433F7D350675DD21803746CADCA574130F01200024C6340AB0CC2CF74F2234669F34E9009EF2EB94823D62B31407F4BA46F1A1EEC41641E84D77727B59E746B8A671BEF936F05BE820759FA -Digest: 4515A104FC68094D244B234D9DC06A0243B71D419D29A95C46E3CBA6F51E121ABE049B34535DB3CCBF2AD68D83FC36331F615B3E33DEB39A3381DFBCB798FE4D -Test: Verify -Message: 83599D93F5561E821BD01A472386BC2FF4EFBD4AED60D5821E84AAE74D8071029810F5E286F8F17651CD27DA07B1EB4382F754CD1C95268783AD09220F5502840370D494BEB17124220F6AFCE91EC8A0F55231F9652433E5CE3489B727716CF4AEBA7DCDA20CD29AA9A859201253F948DD94395ABA9E3852BD1D60DDA7AE5DC045B283DA006E1CBAD83CC13292A315DB5553305C628DD091146597 -Digest: CEE3E60A49F7CAED9387F3EA699524C4CCAFD37C1A7E60D2F0AB037720649F108CCE8769F70B0C5D049359EEB821022F17C4B5F646B750E3070558EC127057F1 -Test: Verify -Message: 2BE9BF526C9D5A75D565DD11EF63B979D068659C7F026C08BEA4AF161D85A462D80E45040E91F4165C074C43AC661380311A8CBED59CC8E4C4518E80CD2C78AB1CABF66BFF83EAB3A80148550307310950D034A6286C93A1ECE8929E6385C5E3BB6EA8A7C0FB6D6332E320E71CC4EB462A2A62E2BFE08F0CCAD93E61BEDB5DD0B786A728AB666F07E0576D189C92BF9FB20DCA49AC2D3956D47385E2 -Digest: E6ED6F060906D1A772F47E83907507F88A151DE401ED79ACB56BE57C2596792DC0BC5A9DC1045E37C6A31DA1C36200214E4F5698AA2754EEB2CAECFC03BEC39D -Test: Verify -Message: CA76D3A12595A817682617006848675547D3E8F50C2210F9AF906C0E7CE50B4460186FE70457A9E879E79FD4D1A688C70A347361C847BA0DD6AA52936EAF8E58A1BE2F5C1C704E20146D366AEB3853BED9DE9BEFE9569AC8AAEA37A9FB7139A1A1A7D5C748605A8DEFB297869EBEDD71D615A5DA23496D11E11ABBB126B206FA0A7797EE7DE117986012D0362DCEF775C2FE145ADA6BDA1CCB326BF644 -Digest: 9ED4EEE87F56AE2741E8E4D65623E4D1FA3AA111F64A85F66E99093BAED990FE1D788D6A4BE1A72A6615281EB45E1B6FB60AFEFDD93987F794084BDA962FAC7F -Test: Verify -Message: F76B85DC67421025D64E93096D1D712B7BAF7FB001716F02D33B2160C2C882C310EF13A576B1C2D30EF8F78EF8D2F465007109AAD93F74CB9E7D7BEF7C9590E8AF3B267C89C15DB238138C45833C98CC4A471A7802723EF4C744A853CF80A0C2568DD4ED58A2C9644806F42104CEE53628E5BDF7B63B0B338E931E31B87C24B146C6D040605567CEEF5960DF9E022CB469D4C787F4CBA3C544A1AC91F95F -Digest: 23139BDD84E9F43A6CC615F0F036199328D39807BEC9E786D4251B83B30800F9DBE8EDC0B910FCD9D9F204C2DDD4D3B92BC26A0CFAABE764BFB90A1444733CD0 -Test: Verify -Message: 25B8C9C032EA6BCD733FFC8718FBB2A503A4EA8F71DEA1176189F694304F0FF68E862A8197B839957549EF243A5279FC2646BD4C009B6D1EDEBF24738197ABB4C992F6B1DC9BA891F570879ACCD5A6B18691A93C7D0A8D38F95B639C1DAEB48C4C2F15CCF5B9D508F8333C32DE78781B41850F261B855C4BEBCC125A380C54D501C5D3BD07E6B52102116088E53D76583B0161E2A58D0778F091206AABD5A1 -Digest: EC69397000AED63CB7E86B4FB0BFD3DCEE8A6F6A1CFE01A324DA13484B73599FCD37AD392662D4C41D90BACA66BE4D6E3424EFD35D7FF4CB07CBDFBEBDDB7B50 -Test: Verify -Message: 21CFDC2A7CCB7F331B3D2EEFFF37E48AD9FA9C788C3F3C200E0173D99963E1CBCA93623B264E920394AE48BB4C3A5BB96FFBC8F0E53F30E22956ADABC2765F57FB761E147ECBF8567533DB6E50C8A1F894310A94EDF806DD8CA6A0E141C0FA7C9FAE6C6AE65F18C93A8529E6E5B553BF55F25BE2E80A9882BD37F145FECBEB3D447A3C4E46C21524CC55CDD62F521AB92A8BA72B897996C49BB273198B7B1C9E -Digest: 2EA3EA00E6E9305CED0FC160E004265221306A2BE9613474126825AA3C3170AE07E5EA42F6B74F0B2C1BD2A6CD4D26EB1E04C67C9A4AFEFC1DD0CB57C2A9F4C7 -Test: Verify -Message: 4E452BA42127DCC956EF4F8F35DD68CB225FB73B5BC7E1EC5A898BBA2931563E74FAFF3B67314F241EC49F4A7061E3BD0213AE826BAB380F1F14FAAB8B0EFDDD5FD1BB49373853A08F30553D5A55CCBBB8153DE4704F29CA2BDEEF0419468E05DD51557CCC80C0A96190BBCC4D77ECFF21C66BDF486459D427F986410F883A80A5BCC32C20F0478BB9A97A126FC5F95451E40F292A4614930D054C851ACD019CCF -Digest: 6A7ADDB28F4F2C23CF0C264579FBA5F892E010689F837B84D006D91402FBFE9BA44B9126F8B5DE1EC6BBE194A3E3854235056A09901D18E8D6F1727DD430212A -Test: Verify -Message: FA85671DF7DADF99A6FFEE97A3AB9991671F5629195049880497487867A6C446B60087FAC9A0F2FCC8E3B24E97E42345B93B5F7D3691829D3F8CCD4BB36411B85FC2328EB0C51CB3151F70860AD3246CE0623A8DC8B3C49F958F8690F8E3860E71EB2B1479A5CEA0B3F8BEFD87ACAF5362435EAECCB52F38617BC6C5C2C6E269EAD1FBD69E941D4AD2012DA2C5B21BCFBF98E4A77AB2AF1F3FDA3233F046D38F1DC8 -Digest: 2C0EE8A165BF88C44C8601C6372E522DA9ECF42544DCDC098698F50DF8E70EB7440CAB2953BB490CD2A5E0887BEEAE3482192DA95E5098D3B318F16FC08D1E1E -Test: Verify -Message: E90847AE6797FBC0B6B36D6E588C0A743D725788CA50B6D792352EA8294F5BA654A15366B8E1B288D84F5178240827975A763BC45C7B0430E8A559DF4488505E009C63DA994F1403F407958203CEBB6E37D89C94A5EACF6039A327F6C4DBBC7A2A307D976AA39E41AF6537243FC218DFA6AB4DD817B6A397DF5CA69107A9198799ED248641B63B42CB4C29BFDD7975AC96EDFC274AC562D0474C60347A078CE4C25E88 -Digest: DDD4FF117231ECA0445EADA7C7F1D84686520DAA70E160C87DBBB3FB32BB9E2F4CC53DB5413D4E88DE18A0118570318BD6D0E5264D779339AC6F4F4A95546A53 -Test: Verify -Message: F6D5C2B6C93954FC627602C00C4CA9A7D3ED12B27173F0B2C9B0E4A5939398A665E67E69D0B12FB7E4CEB253E8083D1CEB724AC07F009F094E42F2D6F2129489E846EAFF0700A8D4453EF453A3EDDC18F408C77A83275617FABC4EA3A2833AA73406C0E966276079D38E8E38539A70E194CC5513AAA457C699383FD1900B1E72BDFB835D1FD321B37BA80549B078A49EA08152869A918CA57F5B54ED71E4FD3AC5C06729 -Digest: A9744EFA42887DF292FC09DFEB885F1E801855DED09DC2F97CBFCBD019751878619DA1BC9573201C7CC050E2AA1D453E951366D81C188D329B3CB861C1D78F92 -Test: Verify -Message: CF8562B1BED89892D67DDAAF3DEEB28246456E972326DBCDB5CF3FB289ACA01E68DA5D59896E3A6165358B071B304D6AB3D018944BE5049D5E0E2BB819ACF67A6006111089E6767132D72DD85BEDDCBB2D64496DB0CC92955AB4C6234F1EEA24F2D51483F2E209E4589BF9519FAC51B4D061E801125E605F8093BB6997BC163D551596FE4AB7CFAE8FB9A90F6980480CE0C229FD1675409BD788354DAF316240CFE0AF93EB -Digest: 89CAE46246EFEDAD1147EB1868C23A6BE54F6BAC75F0C98A9AEFC6BF3CCB89AE012F2E88A9C838B55E57B232CB3C80BC3C2E9FB3FC9768C6226E93284E208BF2 -Test: Verify -Message: 2ACE31ABB0A2E3267944D2F75E1559985DB7354C6E605F18DC8470423FCA30B7331D9B33C4A4326783D1CAAE1B4F07060EFF978E4746BF0C7E30CD61040BD5EC2746B29863EB7F103EBDA614C4291A805B6A4C8214230564A0557BC7102E0BD3ED23719252F7435D64D210EE2AAFC585BE903FA41E1968C50FD5D5367926DF7A05E3A42CF07E656FF92DE73B036CF8B19898C0CB34557C0C12C2D8B84E91181AF467BC75A9D1 -Digest: E80A63FAF248AE762D13887AFE8E1954F97327EDD9641CE563F4148F9796669827B3A12B06EBD710D4171B86E21BC13360A541845354E0F4934E6FBBD7ACBF2D -Test: Verify -Message: 0D8D09AED19F1013969CE5E7EB92F83A209AE76BE31C754844EA9116CEB39A22EBB6003017BBCF26555FA6624185187DB8F0CB3564B8B1C06BF685D47F3286EDA20B83358F599D2044BBF0583FAB8D78F854FE0A596183230C5EF8E54426750EAF2CC4E29D3BDD037E734D863C2BD9789B4C243096138F7672C232314EFFDFC6513427E2DA76916B5248933BE312EB5DDE4CF70804FB258AC5FB82D58D08177AC6F4756017FFF5 -Digest: 09C10C4818A6821C170D6780D006F7E853E30FE2D9A4E96545673704EC0A1A3E356375715994E1AC1D8CB0E56DBDB2F77DC558ED228FB56EE62217E63455FD0B -Test: Verify -Message: C3236B73DEB7662BF3F3DAA58F137B358BA610560EF7455785A9BEFDB035A066E90704F929BD9689CEF0CE3BDA5ACF4480BCEB8D09D10B098AD8500D9B6071DFC3A14AF6C77511D81E3AA8844986C3BEA6F469F9E02194C92868CD5F51646256798FF0424954C1434BDFED9FACB390B07D342E992936E0F88BFD0E884A0DDB679D0547CCDEC6384285A45429D115AC7D235A717242021D1DC35641F5F0A48E8445DBA58E6CB2C8EA -Digest: D1CAB5979EB7F53C97DCA5D725D8B33008906D7759FD3EBB8401EE2FFF01DB895495A0A062D47F251BC3FC13988607C6798969D213C941EFC152E7DB1DA68E72 -Test: Verify -Message: B39FEB8283EADC63E8184B51DF5AE3FD41AAC8A963BB0BE1CD08AA5867D8D910C669221E73243360646F6553D1CA05A84E8DC0DE05B6419EC349CA994480193D01C92525F3FB3DCEFB08AFC6D26947BDBBFD85193F53B50609C6140905C53A6686B58E53A319A57B962331EDE98149AF3DE3118A819DA4D76706A0424B4E1D2910B0ED26AF61D150EBCB46595D4266A0BD7F651BA47D0C7F179CA28545007D92E8419D48FDFBD744CE -Digest: 96AD163869AE2FFDB89B96F4DC700ECE27D1F4DAAFBC5FB81A8E9513C6EA5E2B6A8BCCF4E49A294AF326F872740661629AB780581155810E492424C24F8D1DD3 -Test: Verify -Message: A983D54F503803E8C7999F4EDBBE82E9084F422143A932DDDDC47A17B0B7564A7F37A99D0786E99476428D29E29D3C197A72BFAB1342C12A0FC4787FD7017D7A6174049EA43B5779169EF7472BDBBD941DCB82FC73AAC45A8A94C9F2BD3477F61FD3B796F02A1B8264A214C6FEA74B7051B226C722099EC7883A462B83B6AFDD4009248B8A237F605FE5A08FE7D8B45321421EBBA67BD70A0B00DDBF94BAAB7F359D5D1EEA105F28DCFB -Digest: FD2E7A6E11E5D00278099EAF403054D617ACAC5BD3D0A4908191782C89F9217A3F0118BC2B284FDBCE803F66B78DD795EB18DC16BA85E19CB6393DC56C06ECCA -Test: Verify -Message: E4D1C1897A0A866CE564635B74222F9696BF2C7F640DD78D7E2ACA66E1B61C642BB03EA7536AAE597811E9BF4A7B453EDE31F97B46A5F0EF51A071A2B3918DF16B152519AE3776F9F1EDAB4C2A377C3292E96408359D3613844D5EB393000283D5AD3401A318B12FD1474B8612F2BB50FB6A8B9E023A54D7DDE28C43D6D8854C8D9D1155935C199811DBFC87E9E0072E90EB88681CC7529714F8FB8A2C9D88567ADFB974EE205A9BF7B848 -Digest: AE53776D969A9B285641998A9F2C70CA71856C956A3C430A32A1E03A8E08D544F16511A27CFA59F6B8275A2357F8EFA6544B1CD0C00A9460F47954A146429E49 -Test: Verify -Message: B10C59723E3DCADD6D75DF87D0A1580E73133A9B7D00CB95EC19F5547027323BE75158B11F80B6E142C6A78531886D9047B08E551E75E6261E79785366D7024BD7CD9CF322D9BE7D57FB661069F2481C7BB759CD71B4B36CA2BC2DF6D3A328FAEBDB995A9794A8D72155ED551A1F87C80BF6059B43FC764900B18A1C2441F7487743CF84E565F61F8DD2ECE6B6CCC9444049197AAAF53E926FBEE3BFCA8BE588EC77F29D211BE89DE18B15F6 -Digest: D4748C8E17F4117BF2BF71557ABB559247552126C36192C5DF5C6C3E307D879B703C3FCD7099DDAB243E2F1D5AE5066990A7B38D3F2CD7FB115AA6D135E7261D -Test: Verify -Message: DB11F609BABA7B0CA634926B1DD539C8CBADA24967D7ADD4D9876F77C2D80C0F4DCEFBD7121548373582705CCA2495BD2A43716FE64ED26D059CFB566B3364BD49EE0717BDD9810DD14D8FAD80DBBDC4CAFB37CC60FB0FE2A80FB4541B8CA9D59DCE457738A9D3D8F641AF8C3FD6DA162DC16FC01AAC527A4A0255B4D231C0BE50F44F0DB0B713AF03D968FE7F0F61ED0824C55C4B5265548FEBD6AAD5C5EEDF63EFE793489C39B8FD29D104CE -Digest: D8FF0481A63890F0E5A536EBBA2F253FA2CFA19C0F353587AF4BDC3190E4F8F54D17D665E8B2011121D444BFADFFF3E192D97FA03B849D63F36DB20F4CF88A74 -Test: Verify -Message: BEBD4F1A84FC8B15E4452A54BD02D69E304B7F32616AADD90537937106AE4E28DE9D8AAB02D19BC3E2FDE1D651559E296453E4DBA94370A14DBBB2D1D4E2022302EE90E208321EFCD8528AD89E46DC839EA9DF618EA8394A6BFF308E7726BAE0C19BCD4BE52DA6258E2EF4E96AA21244429F49EF5CB486D7FF35CAC1BACB7E95711944BCCB2AB34700D42D1EB38B5D536B947348A458EDE3DC6BD6EC547B1B0CAE5B257BE36A7124E1060C170FFA -Digest: 52D771B5016C6B1B93D3BF6A13F718A7B4741D528798609308B54CEA6037862D923751FDDCE10580A7D6431BF208DF17C1B825F7C7401CCBD6D806B744241ACF -Test: Verify -Message: 5ACA56A03A13784BDC3289D9364F79E2A85C12276B49B92DB0ADAA4F206D5028F213F678C3510E111F9DC4C1C1F8B6ACB17A6413AA227607C515C62A733817BA5E762CC6748E7E0D6872C984D723C9BB3B117EB8963185300A80BFA65CDE495D70A46C44858605FCCBED086C2B45CEF963D33294DBE9706B13AF22F1B7C4CD5A001CFEC251FBA18E722C6E1C4B1166918B4F6F48A98B64B3C07FC86A6B17A6D0480AB79D4E6415B520F1C484D675B1 -Digest: 36D472A8AE13D1E70E1FD275117FFE34063BEFCCF6706FAB0816E1B81F7FE7F2DDB2A122F1F52C9950644659430F81BCEDAD5D833DF4814CF60AE6C542CC4478 -Test: Verify -Message: A5AAD0E4646A32C85CFCAC73F02FC5300F1982FABB2F2179E28303E447854094CDFC854310E5C0F60993CEFF54D84D6B46323D930ADB07C17599B35B505F09E784BCA5985E0172257797FB53649E2E9723EFD16865C31B5C3D5113B58BB0BFC8920FABDDA086D7537E66D709D050BD14D0C960873F156FAD5B3D3840CDFCDC9BE6AF519DB262A27F40896AB25CC39F96984D650611C0D5A3080D5B3A1BF186ABD42956588B3B58CD948970D298776060 -Digest: E504AD7F33D65B8D3487B28805D478778C901C0AFF5F889AE95E2919B4F431A80116A8993469E822895F3C21A41D67AFDA93A5B29B6250F76335A76FE8919274 -Test: Verify -Message: 06CBBE67E94A978203EAD6C057A1A5B098478B4B4CBEF5A97E93C8E42F5572713575FC2A884531D7622F8F879387A859A80F10EF02708CD8F7413AB385AFC357678B9578C0EBF641EF076A1A30F1F75379E9DCB2A885BDD295905EE80C0168A62A9597D10CF12DD2D8CEE46645C7E5A141F6E0E23AA482ABE5661C16E69EF1E28371E2E236C359BA4E92C25626A7B7FF13F6EA4AE906E1CFE163E91719B1F750A96CBDE5FBC953D9E576CD216AFC90323A -Digest: 1DCA53BE0A34114447D1C1443B92B69DFDED705956EAE60BBAB39178CCB11F526A302AAE83720652EF4C5DD450A3647DF7B77C4664717D935B4F5B20F206FEFE -Test: Verify -Message: F1C528CF7739874707D4D8AD5B98F7C77169DE0B57188DF233B2DC8A5B31EDA5DB4291DD9F68E6BAD37B8D7F6C9C0044B3BF74BBC3D7D1798E138709B0D75E7C593D3CCCDC1B20C7174B4E692ADD820ACE262D45CCFAE2077E878796347168060A162ECCA8C38C1A88350BD63BB539134F700FD4ADDD5959E255337DAA06BC86358FABCBEFDFB5BC889783D843C08AADC6C4F6C36F65F156E851C9A0F917E4A367B5AD93D874812A1DE6A7B93CD53AD97232 -Digest: CB1B03B180E04021E0099050EB6B7EB9092C5BD5C445E9D31EE39C724F038E9F619A96D3A2812CA7F208FEB2D074C3F817262F7504705623E635B9F273E37A59 -Test: Verify -Message: 9D9F3A7ECD51B41F6572FD0D0881E30390DFB780991DAE7DB3B47619134718E6F987810E542619DFAA7B505C76B7350C6432D8BF1CFEBDF1069B90A35F0D04CBDF130B0DFC7875F4A4E62CDB8E525AADD7CE842520A482AC18F09442D78305FE85A74E39E760A4837482ED2F437DD13B2EC1042AFCF9DECDC3E877E50FF4106AD10A525230D11920324A81094DA31DEAB6476AA42F20C84843CFC1C58545EE80352BDD3740DD6A16792AE2D86F11641BB717C2 -Digest: F0482F098B93624BCDE1AAB58097198649A8DC84421826D1C1011AD41B948384C8ED5A97C64C134B38A0075812A35F9CE3CB200972C2ECDFC408714139B9BFF0 -Test: Verify -Message: 5179888724819FBAD3AFA927D3577796660E6A81C52D98E9303261D5A4A83232F6F758934D50AA83FF9E20A5926DFEBAAC49529D006EB923C5AE5048ED544EC471ED7191EDF46363383824F915769B3E688094C682B02151E5EE01E510B431C8865AFF8B6B6F2F59CB6D129DA79E97C6D2B8FA6C6DA3F603199D2D1BCAB547682A81CD6CF65F6551121391D78BCC23B5BD0E922EC6D8BF97C952E84DD28AEF909ABA31EDB903B28FBFC33B7703CD996215A11238 -Digest: A3188426CEA0C18CB638BCC45C4337C40BE41F6E03CD2D7C4FEE26025C5CA281CFBB3AD1554D45EDC2EB03E2EBE3DE02F57D36D5B6A88A3C61A6AAEDE62180D0 -Test: Verify -Message: 576EF3520D30B7A4899B8C0D5E359E45C5189ADD100E43BE429A02FB3DE5FF4F8FD0E79D9663ACCA72CD29C94582B19292A557C5B1315297D168FBB54E9E2ECD13809C2B5FCE998EDC6570545E1499DBE7FB74D47CD7F35823B212B05BF3F5A79CAA34224FDD670D335FCB106F5D92C3946F44D3AFCBAE2E41AC554D8E6759F332B76BE89A0324AA12C5482D1EA3EE89DED4936F3E3C080436F539FA137E74C6D3389BDF5A45074C47BC7B20B0948407A66D855E2F -Digest: 0B14693E6320668D64EBB3BF6EEB81AAFCDB7320ECDE80A245786D1B0A808A15C717DC8E8813BF64BF4AA57C29C33E913D6CE1879E52E1919FB83E4A208EDAA4 -Test: Verify -Message: 0DF2152FA4F4357C8741529DD77E783925D3D76E95BAFA2B542A2C33F3D1D117D159CF473F82310356FEE4C90A9E505E70F8F24859656368BA09381FA245EB6C3D763F3093F0C89B972E66B53D59406D9F01AEA07F8B3B615CAC4EE4D05F542E7D0DAB45D67CCCCD3A606CCBEB31EA1FA7005BA07176E60DAB7D78F6810EF086F42F08E595F0EC217372B98970CC6321576D92CE38F7C397A403BADA1548D205C343AC09DECA86325373C3B76D9F32028FEA8EB32515 -Digest: A9ABC3F554C1E717935D28C28E7C26AA9DC5BD6D7B02ED7DC6AFE21A0EA027A8801AE076F2872D08635EE81420711862EDC4E448C85513289438B3C8BE456B5B -Test: Verify -Message: 3E15350D87D6EBB5C8AD99D42515CFE17980933C7A8F6B8BBBF0A63728CEFAAD2052623C0BD5931839112A48633FB3C2004E0749C87A41B26A8B48945539D1FF41A4B269462FD199BFECD45374756F55A9116E92093AC99451AEFB2AF9FD32D6D7F5FBC7F7A540D5097C096EBC3B3A721541DE073A1CC02F7FB0FB1B9327FB0B1218CA49C9487AB5396622A13AE546C97ABDEF6B56380DDA7012A8384091B6656D0AB272D363CEA78163FF765CDD13AB1738B940D16CAE -Digest: 04DD83D20F58E854D857F24720C50A4B5F83DBC8CABD460D379417CD4813772AA85591B90462F34DB3FAA4DCAE335FB1252BF41162E24975A0DBD308C41A4A6B -Test: Verify -Message: C38D6B0B757CB552BE40940ECE0009EF3B0B59307C1451686F1A22702922800D58BCE7A636C1727EE547C01B214779E898FC0E560F8AE7F61BEF4D75EAA696B921FD6B735D171535E9EDD267C192B99880C87997711002009095D8A7A437E258104A41A505E5EF71E5613DDD2008195F0C574E6BA3FE40099CFA116E5F1A2FA8A6DA04BADCB4E2D5D0DE31FDC4800891C45781A0AAC7C907B56D631FCA5CE8B2CDE620D11D1777ED9FA603541DE794DDC5758FCD5FAD78C0 -Digest: CE76B25C928CB75C09C0674E8FCD22089654182CD3D84B85CC44B186A8B1A7CC1BB66F389DA6D744A24A7B02BF5C85542D1BA8EF0DB4A86D2FC394471B396519 -Test: Verify -Message: 8D2DE3F0B37A6385C90739805B170057F091CD0C7A0BC951540F26A5A75B3E694631BB64C7635EED316F51318E9D8DE13C70A2ABA04A14836855F35E480528B776D0A1E8A23B547C8B8D6A0D09B241D3BE9377160CCA4E6793D00A515DC2992CB7FC741DACA171431DA99CCE6F7789F129E2AC5CF65B40D703035CD2185BB936C82002DAF8CBC27A7A9E554B06196630446A6F0A14BA155ED26D95BD627B7205C072D02B60DB0FD7E49EA058C2E0BA202DAFF0DE91E845CF79 -Digest: 02D1671981C2E85D0455EE85F41B8E9C32B1C80221DD432B8BCB5FCEFE0996F32FE9FC3EEB3F1F557AE1632750B92D05239AF857C42D59A3DAEB9629E1158BEC -Test: Verify -Message: C464BBDAD275C50DCD983B65AD1019B9FF85A1E71C807F3204BB2C921DC31FBCD8C5FC45868AE9EF85B6C9B83BBA2A5A822201ED68586EC5EC27FB2857A5D1A2D09D09115F22DCC39FE61F5E1BA0FF6E8B4ACB4C6DA748BE7F3F0839739394FF7FA8E39F7F7E84A33C3866875C01BCB1263C9405D91908E9E0B50E7459FABB63D8C6BBB73D8E3483C099B55BC30FF092FF68B6ADEDFD477D63570C9F5515847F36E24BA0B705557130CEC57EBAD1D0B31A378E91894EE26E3A04 -Digest: 6B8BC6211FE5001E07B7D20E0C49D314211E3893A39DA241B8839BB3A494F9A2FD8561009D22CCA1330A69362B386E715F1DBE6291DBEECFADF196DA47E53198 -Test: Verify -Message: 8B8D68BB8A75732FE272815A68A1C9C5AA31B41DEDC8493E76525D1D013D33CEBD9E21A5BB95DB2616976A8C07FCF411F5F6BC6F7E0B57ACA78CC2790A6F9B898858AC9C79B165FF24E66677531E39F572BE5D81EB3264524181115F32780257BFB9AEEC6AF12AF28E587CAC068A1A2953B59AD680F4C245B2E3EC36F59940D37E1D3DB38E13EDB29B5C0F404F6FF87F80FC8BE7A225FF22FBB9C8B6B1D7330C57840D24BC75B06B80D30DAD6806544D510AF6C4785E823AC3E0B8 -Digest: D00E919DAFFF3D5E51AD3A3046F5E59D64B69CBCDA223CB28BC370201D2C722BAE74DFE0086B0EB47BDCB62FABEE870C3340D46E55D8CFEDF2DD3CED8A8DB3F2 -Test: Verify -Message: 6B018710446F368E7421F1BC0CCF562D9C1843846BC8D98D1C9BF7D9D6FCB48BFC3BF83B36D44C4FA93430AF75CD190BDE36A7F92F867F58A803900DF8018150384D85D82132F123006AC2AEBA58E02A037FE6AFBD65ECA7C44977DD3DC74F48B6E7A1BFD5CC4DCF24E4D52E92BD4455848E4928B0EAC8B7476FE3CC03E862AA4DFF4470DBFED6DE48E410F25096487ECFC32A27277F3F5023B2725ADE461B1355889554A8836C9CF53BD767F5737D55184EEA1AB3F53EDD0976C485 -Digest: CF63F28F107A509A416F9A92C4E4DB4DBF00FB52C2E16D8BB9694E09F9142A904C34E1E960BD97B8CFB2C53E7660C79B841D1565CDAB83293234026A23A56D12 -Test: Verify -Message: C9534A24714BD4BE37C88A3DA1082EDA7CABD154C309D7BD670DCCD95AA535594463058A29F79031D6ECAA9F675D1211E9359BE82669A79C855EA8D89DD38C2C761DDD0EC0CE9E97597432E9A1BEAE062CDD71EDFDFD464119BE9E69D18A7A7FD7CE0E2106F0C8B0ABF4715E2CA48EF9F454DC203C96656653B727083513F8EFB86E49C513BB758B3B052FE21F1C05BB33C37129D6CC81F1AEF6ADC45B0E8827A830FE545CF57D0955802C117D23CCB55EA28F95C0D8C2F9C5A242B33F -Digest: F21B8D45B6A857CE663C074C18CC54D914CDD5EB0D968E6153A5F70069345D205DDF4370EC473FC80B05F937D014C0A464582CB4A73B1B72041C5C99F576A41E -Test: Verify -Message: 07906C87297B867ABF4576E9F3CC7F82F22B154AFCBF293B9319F1B0584DA6A40C27B32E0B1B7F412C4F1B82480E70A9235B12EC27090A5A33175A2BB28D8ADC475CEFE33F7803F8CE27967217381F02E67A3B4F84A71F1C5228E0C2AD971373F6F672624FCEA8D1A9F85170FAD30FA0BBD25035C3B41A6175D467998BD1215F6F3866F53847F9CF68EF3E2FBB54BC994DE2302B829C5EEA68EC441FCBAFD7D16AE4FE9FFF98BF00E5BC2AD54DD91FF9FDA4DD77B6C754A91955D1FBAAD0 -Digest: 92287F42AB1A2123669C4D35F18257D3A536445F0E4D2C801E99F8529CD9E2A79205982C280C7A6CDDDEF24CE960EC6CA9A35F590AEEBC40448C389E915FC4E0 -Test: Verify -Message: 588E94B9054ABC2189DF69B8BA34341B77CDD528E7860E5DEFCAA79B0C9A452AD4B82AA306BE84536EB7CEDCBE058D7B84A6AEF826B028B8A0271B69AC3605A9635EA9F5EA0AA700F3EB7835BC54611B922964300C953EFE7491E3677C2CEBE0822E956CD16433B02C68C4A23252C3F9E151A416B4963257B783E038F6B4D5C9F110F871652C7A649A7BCEDCBCCC6F2D0725BB903CC196BA76C76AA9F10A190B1D1168993BAA9FFC96A1655216773458BEC72B0E39C9F2C121378FEAB4E76A -Digest: 74A9D8F9F72908C7502D1C41212CD86CF4344721A6F02D390346F2BAEC6E6137421E6516C3235443BC2337B3A77630712A12F11B7BA24B2D7085499BA74BCB90 -Test: Verify -Message: 08959A7E4BAAE874928813364071194E2939772F20DB7C3157078987C557C2A6D5ABE68D520EEF3DC491692E1E21BCD880ADEBF63BB4213B50897FA005256ED41B5690F78F52855C8D9168A4B666FCE2DA2B456D7A7E7C17AB5F2FB1EE90B79E698712E963715983FD07641AE4B4E9DC73203FAC1AE11FA1F8C7941FCC82EAB247ADDB56E2638447E9D609E610B60CE086656AAEBF1DA3C8A231D7D94E2FD0AFE46B391FF14A72EAEB3F44AD4DF85866DEF43D4781A0B3578BC996C87970B132 -Digest: 7432861132E6894BB6AE5115398198317E12CC73C0C5DFC61CB189FF5AA9FB0D62224CBB1BFA8B105784405718E6F8E15E041DAD80D11AE507B33C15C6CAC824 -Test: Verify -Message: CB2A234F45E2ECD5863895A451D389A369AAB99CFEF0D5C9FFCA1E6E63F763B5C14FB9B478313C8E8C0EFEB3AC9500CF5FD93791B789E67EAC12FD038E2547CC8E0FC9DB591F33A1E4907C64A922DDA23EC9827310B306098554A4A78F050262DB5B545B159E1FF1DCA6EB734B872343B842C57EAFCFDA8405EEDBB48EF32E99696D135979235C3A05364E371C2D76F1902F1D83146DF9495C0A6C57D7BF9EE77E80F9787AEE27BE1FE126CDC9EF893A4A7DCBBC367E40FE4E1EE90B42EA25AF01 -Digest: 6AF4FF4C423051E3306ACE812E5CFA85532B73DEEF0DFE601D2630632389D0FAB2A109214D32508D2391775665B87A94D1DF29DB1214CB48DEC10DBD3D8CF591 -Test: Verify -Message: D16BEADF02AB1D4DC6F88B8C4554C51E866DF830B89C06E786A5F8757E8909310AF51C840EFE8D20B35331F4355D80F73295974653DDD620CDDE4730FB6C8D0D2DCB2B45D92D4FBDB567C0A3E86BD1A8A795AF26FBF29FC6C65941CDDB090FF7CD230AC5268AB4606FCCBA9EDED0A2B5D014EE0C34F0B2881AC036E24E151BE89EEB6CD9A7A790AFCCFF234D7CB11B99EBF58CD0C589F20BDAC4F9F0E28F75E3E04E5B3DEBCE607A496D848D67FA7B49132C71B878FD5557E082A18ECA1FBDA94D4B -Digest: 4648D263B608CF28CA65B28A361EBB00E0784C65AB1D55C46A785737B6C8D83DD52E3367D898921EA36DADA42D893800D0BFCF86554CDF5E7630D60A2E8EE29F -Test: Verify -Message: 8F65F6BC59A85705016E2BAE7FE57980DE3127E5AB275F573D334F73F8603106EC3553016608EF2DD6E69B24BE0B7113BF6A760BA6E9CE1C48F9E186012CF96A1D4849D75DF5BB8315387FD78E9E153E76F8BA7EC6C8849810F59FB4BB9B004318210B37F1299526866F44059E017E22E96CBE418699D014C6EA01C9F0038B10299884DBEC3199BB05ADC94E955A1533219C1115FED0E5F21228B071F40DD57C4240D98D37B73E412FE0FA4703120D7C0C67972ED233E5DEB300A22605472FA3A3BA86 -Digest: DBD3732440010595AB26F84EFEB07732227A7B7B52D6FF339C7FF1B6442249202AE33A0AEF5167F5B0474D74A5B50CDB033D6C5C72894A3686FE6ECB36E357F3 -Test: Verify -Message: 84891E52E0D451813210C3FD635B39A03A6B7A7317B221A7ABC270DFA946C42669AACBBBDF801E1584F330E28C729847EA14152BD637B3D0F2B38B4BD5BF9C791C58806281103A3EABBAEDE5E711E539E6A8B2CF297CF351C078B4FA8F7F35CF61BEBF8814BF248A01D41E86C5715EA40C63F7375379A7EB1D78F27622FB468AB784AAABA4E534A6DFD1DF6FA15511341E725ED2E87F98737CCB7B6A6DFAE416477472B046BF1811187D151BFA9F7B2BF9ACDB23A3BE507CDF14CFDF517D2CB5FB9E4AB6 -Digest: C24D4054110889290CBC40B82AD8599229D8E86E4CE76BDDBBB6F5386223512C9D7E00973C706442B2C80EDD20904067AF8E4E681AECBFADC6AA15A2EBFE7DDD -Test: Verify -Message: FDD7A9433A3B4AFABD7A3A5E3457E56DEBF78E84B7A0B0CA0E8C6D53BD0C2DAE31B2700C6128334F43981BE3B213B1D7A118D59C7E6B6493A86F866A1635C12859CFB9AD17460A77B4522A5C1883C3D6ACC86E6162667EC414E9A104AA892053A2B1D72165A855BACD8FAF8034A5DD9B716F47A0818C09BB6BAF22AA503C06B4CA261F557761989D2AFBD88B6A678AD128AF68672107D0F1FC73C5CA740459297B3292B281E93BCEB761BDE7221C3A55708E5EC84472CDDCAA84ECF23723CC0991355C6280 -Digest: 4A6404D278A0BA70488C18D7D1861CDE26FD57D66A9AFFE74F1E646E616003A52FE42520504AC4ACE5CA6665CF9155F44ECAA05D55F80FE9794ADE17871C5728 -Test: Verify -Message: 70A40BFBEF92277A1AAD72F6B79D0177197C4EBD432668CFEC05D099ACCB651062B5DFF156C0B27336687A94B26679CFDD9DAF7AD204338DD9C4D14114033A5C225BD11F217B5F4732DA167EE3F939262D4043FC9CBA92303B7B5E96AEA12ADDA64859DF4B86E9EE0B58E39091E6B188B408AC94E1294A8911245EE361E60E601EFF58D1D37639F3753BEC80EBB4EFDE25817436076623FC65415FE51D1B0280366D12C554D86743F3C3B6572E400361A60726131441BA493A83FBE9AFDA90F7AF1AE717238D -Digest: FFFD1B1E31377DFF00B492295BCCC735733B021F47BB4AFBA6549EA6C1BA3832E8587099AD0CC216AF5899AC683EB7C246871E21C30FEEF9BCEEDFC78D0C966C -Test: Verify -Message: 74356E449F4BF8644F77B14F4D67CB6BD9C1F5AE357621D5B8147E562B65C66585CAF2E491B48529A01A34D226D436959153815380D5689E30B35357CDAC6E08D3F2B0E88E200600D62BD9F5EAF488DF86A4470EA227006182E44809009868C4C280C43D7D64A5268FA719074960087B3A6ABC837882F882C837834535929389A12B2C78187E2EA07EF8B8EEF27DC85002C3AE35F1A50BEE6A1C48BA7E175F3316670B27983472AA6A61EED0A683A39EE323080620EA44A9F74411AE5CE99030528F9AB49C79F2 -Digest: 33C8F40E1BD1EB1A3A70D2071D27460EF0F6B2D3ECE373743842D6B928F3771E4B7446A9ECFBBF552C064F6B26095401097581C38B95E9551119A1FDCB3D58E7 -Test: Verify -Message: 8C3798E51BC68482D7337D3ABB75DC9FFE860714A9AD73551E120059860DDE24AB87327222B64CF774415A70F724CDF270DE3FE47DDA07B61C9EF2A3551F45A5584860248FABDE676E1CD75F6355AA3EAEABE3B51DC813D9FB2EAA4F0F1D9F834D7CAD9C7C695AE84B329385BC0BEF895B9F1EDF44A03D4B410CC23A79A6B62E4F346A5E8DD851C2857995DDBF5B2D717AEB847310E1F6A46AC3D26A7F9B44985AF656D2B7C9406E8A9E8F47DCB4EF6B83CAACF9AEFB6118BFCFF7E44BEF6937EBDDC89186839B77 -Digest: 2A11CB6921EA662A39DDEE7982E3CF5B317195661D5505AD04D11EE23E178ED65F3E06A7F096F4EAF1FF6A09239CF5A0A39DC9F4C92AF63FDF7211E1CF467653 -Test: Verify -Message: FA56BF730C4F8395875189C10C4FB251605757A8FECC31F9737E3C2503B02608E6731E85D7A38393C67DE516B85304824BFB135E33BF22B3A23B913BF6ACD2B7AB85198B8187B2BCD454D5E3318CACB32FD6261C31AE7F6C54EF6A7A2A4C9F3ECB81CE3555D4F0AD466DD4C108A90399D70041997C3B25345A9653F3C9A6711AB1B91D6A9D2216442DA2C973CBD685EE7643BFD77327A2F7AE9CB283620A08716DFB462E5C1D65432CA9D56A90E811443CD1ECB8F0DE179C9CB48BA4F6FEC360C66F252F6E64EDC96B -Digest: 9196BBBD194541FFEE7EDBAB970738BDD3AADBD6B73D1C85B580AFAC1232AE8077F743CE8B5B6F2B418B5134CCCD4F83645E8631885B14FBBCB909A9836C374C -Test: Verify -Message: B6134F9C3E91DD8000740D009DD806240811D51AB1546A974BCB18D344642BAA5CD5903AF84D58EC5BA17301D5EC0F10CCD0509CBB3FD3FFF9172D193AF0F782252FD1338C7244D40E0E42362275B22D01C4C3389F19DD69BDF958EBE28E31A4FFE2B5F18A87831CFB7095F58A87C9FA21DB72BA269379B2DC2384B3DA953C7925761FED324620ACEA435E52B424A7723F6A2357374157A34CD8252351C25A1B232826CEFE1BD3E70FFC15A31E7C0598219D7F00436294D11891B82497BC78AA5363892A2495DF8C1EEF -Digest: 1959CAE3600F128F72E1821C337D841B14CBBFEF3A6D22286F18BDFC3EF63528C11BFFA841A6D2208AFEB5664D524DE83090AB0DB07CD47EF52F4D2EAA8454CE -Test: Verify -Message: C941CDB9C28AB0A791F2E5C8E8BB52850626AA89205BEC3A7E22682313D198B1FA33FC7295381354858758AE6C8EC6FAC3245C6E454D16FA2F51C4166FAB51DF272858F2D603770C40987F64442D487AF49CD5C3991CE858EA2A60DAB6A65A34414965933973AC2457089E359160B7CDEDC42F29E10A91921785F6B7224EE0B349393CDCFF6151B50B377D609559923D0984CDA6000829B916AB6896693EF6A2199B3C22F7DC5500A15B8258420E314C222BC000BC4E5413E6DD82C993F8330F5C6D1BE4BC79F08A1A0A46 -Digest: A913DDC5BB089C121FF093BE529225148DF787D48F4F61699EFF9FC2910282A898A81A38D66BE9B06428D6466A614CA822A872C1C2C4D503D434D3B1D6942102 -Test: Verify -Message: 4499EFFFAC4BCEA52747EFD1E4F20B73E48758BE915C88A1FFE5299B0B005837A46B2F20A9CB3C6E64A9E3C564A27C0F1C6AD1960373036EC5BFE1A8FC6A435C2185ED0F114C50E8B3E4C7ED96B06A036819C9463E864A58D6286F785E32A804443A56AF0B4DF6ABC57ED5C2B185DDEE8489EA080DEEEE66AA33C2E6DAB36251C402682B6824821F998C32163164298E1FAFD31BABBCFFB594C91888C6219079D907FDB438ED89529D6D96212FD55ABE20399DBEFD342248507436931CDEAD496EB6E4A80358ACC78647D043 -Digest: F10B91564AD93D734743281949BACEF065A6432A455236F1BF798DE9AEC6CCAC9B8D373B07C5ACFBD676EF21E4A3A9E0F7C38E8756D177D0A5C283D520844B4D -Test: Verify -Message: EECBB8FDFA4DA62170FD06727F697D81F83F601FF61E478105D3CB7502F2C89BF3E8F56EDD469D049807A38882A7EEFBC85FC9A950952E9FA84B8AFEBD3CE782D4DA598002827B1EB98882EA1F0A8F7AA9CE013A6E9BC462FB66C8D4A18DA21401E1B93356EB12F3725B6DB1684F2300A98B9A119E5D27FF704AFFB618E12708E77E6E5F34139A5A41131FD1D6336C272A8FC37080F041C71341BEE6AB550CB4A20A6DDB6A8E0299F2B14BC730C54B8B1C1C487B494BDCCFD3A53535AB2F231590BF2C4062FD2AD58F906A2D0D -Digest: EF26A1BAF33D4DE047BDD2CE34736E042ECD33AA569FFC0CB81ECFA66E9F87DA8D025ECBA24BCB187E4201046FB99A02DFA6F1BF88EC2B88DE216CF759FAC41D -Test: Verify -Message: E64F3E4ACE5C8418D65FEC2BC5D2A303DD458034736E3B0DF719098BE7A206DEAF52D6BA82316CAF330EF852375188CDE2B39CC94AA449578A7E2A8E3F5A9D68E816B8D16889FBC0EBF0939D04F63033AE9AE2BDAB73B88C26D6BD25EE460EE1EF58FB0AFA92CC539F8C76D3D097E7A6A63EBB9B5887EDF3CF076028C5BBD5B9DB3211371AD3FE121D4E9BF44229F4E1ECF5A0F9F0EBA4D5CEB72878AB22C3F0EB5A625323AC66F7061F4A81FAC834471E0C59553F108475FE290D43E6A055AE3EE46FB67422F814A68C4BE3E8C9 -Digest: F8E079A6DC5A6A7E7F32FF7E8015D1B26D43B54F166F2111CFB2B1EB238CABEE58630EF845E0DB00DDF1D800AD67CE7B2B658B42118CC15C8EF3BC9FB252DB64 -Test: Verify -Message: D2CB2D733033F9E91395312808383CC4F0CA974E87EC68400D52E96B3FA6984AC58D9AD0938DDE5A973008D818C49607D9DE2284E7618F1B8AED8372FBD52ED54557AF4220FAC09DFA8443011699B97D743F8F2B1AEF3537EBB45DCC9E13DFB438428EE190A4EFDB3CAEB7F3933117BF63ABDC7E57BEB4171C7E1AD260AB0587806C4D137B6316B50ABC9CCE0DFF3ACADA47BBB86BE777E617BBE578FF4519844DB360E0A96C6701290E76BB95D26F0F804C8A4F2717EAC4E7DE9F2CFF3BBC55A17E776C0D02856032A6CD10AD2838 -Digest: A5BFAA52499A688D9C8D3DDC0BA06DECDF3829BE5D444ACFA412F4C6E863F4786BE9935805310734E4F0AFFE05558999807408E97E100FADD0C93FF160F8B11B -Test: Verify -Message: F2998955613DD414CC111DF5CE30A995BB792E260B0E37A5B1D942FE90171A4AC2F66D4928D7AD377F4D0554CBF4C523D21F6E5F379D6F4B028CDCB9B1758D3B39663242FF3CB6EDE6A36A6F05DB3BC41E0D861B384B6DEC58BB096D0A422FD542DF175E1BE1571FB52AE66F2D86A2F6824A8CFAACBAC4A7492AD0433EEB15454AF8F312B3B2A577750E3EFBD370E8A8CAC1582581971FBA3BA4BD0D76E718DACF8433D33A59D287F8CC92234E7A271041B526E389EFB0E40B6A18B3AAF658E82ED1C78631FD23B4C3EB27C3FAEC8685 -Digest: CCEA9FCF1AD93270AC4690E96B875122C5B5EC20D2CC27079CBF893126C44E0208A8BFA139057D72BD2638059EC8DA8A720499AF9D4C117F86799D7515DFC6E0 -Test: Verify -Message: 447797E2899B72A356BA55BF4DF3ACCA6CDB1041EB477BD1834A9F9ACBC340A294D729F2F97DF3A610BE0FF15EDB9C6D5DB41644B9874360140FC64F52AA03F0286C8A640670067A84E017926A70438DB1BB361DEFEE7317021425F8821DEF26D1EFD77FC853B818545D055ADC9284796E583C76E6FE74C9AC2587AA46AA8F8804F2FEB5836CC4B3ABABAB8429A5783E17D5999F32242EB59EF30CD7ADABC16D72DBDB097623047C98989F88D14EAF02A7212BE16EC2D07981AAA99949DDF89ECD90333A77BC4E1988A82ABF7C7CAF3291 -Digest: 2EFC5DFE028A35503A25BDF8B2164D86CA7496B7C5DED09C5D414B6977ADBB4A6988AB9939D1EC65F46BCC99C1DCD5F19E035D8D3DC387361200E4DA80C80671 -Test: Verify -Message: 9F2C18ADE9B380C784E170FB763E9AA205F64303067EB1BCEA93DF5DAC4BF5A2E00B78195F808DF24FC76E26CB7BE31DC35F0844CDED1567BBA29858CFFC97FB29010331B01D6A3FB3159CC1B973D255DA9843E34A0A4061CABDB9ED37F241BFABB3C20D32743F4026B59A4CCC385A2301F83C0B0A190B0F2D01ACB8F0D41111E10F2F4E149379275599A52DC089B35FDD5234B0CFB7B6D8AEBD563CA1FA653C5C021DFD6F5920E6F18BFAFDBECBF0AB00281333ED50B9A999549C1C8F8C63D7626C48322E9791D5FF72294049BDE91E73F8 -Digest: E80D7A934FDAF17DB8DBB1DC6C42E90E139211C2F599890C06B15D6248FDBE682D77D4E05F26D72852F7492BCE118CE7C36950BD2C50F9699BB47D89C3115377 -Test: Verify -Message: AE159F3FA33619002AE6BCCE8CBBDD7D28E5ED9D61534595C4C9F43C402A9BB31F3B301CBFD4A43CE4C24CD5C9849CC6259ECA90E2A79E01FFBAC07BA0E147FA42676A1D668570E0396387B5BCD599E8E66AAED1B8A191C5A47547F61373021FA6DEADCB55363D233C24440F2C73DBB519F7C9FA5A8962EFD5F6252C0407F190DFEFAD707F3C7007D69FF36B8489A5B6B7C557E79DD4F50C06511F599F56C896B35C917B63BA35C6FF8092BAF7D1658E77FC95D8A6A43EEB4C01F33F03877F92774BE89C1114DD531C011E53A34DC248A2F0E6 -Digest: C414B29FD07720F46C351F5C80BE2094E95D13AD97BDD1F7C5207B695693CD5E1E0169B1AA2E271115BD5171FEC51D04B71E3E7CE1618FBFEB382F56F65F7EFF -Test: Verify -Message: 3B8E97C5FFC2D6A40FA7DE7FCEFC90F3B12C940E7AB415321E29EE692DFAC799B009C99DCDDB708FCE5A178C5C35EE2B8617143EDC4C40B4D313661F49ABDD93CEA79D117518805496FE6ACF292C4C2A1F76B403A97D7C399DAF85B46AD84E16246C67D6836757BDE336C290D5D401E6C1386AB32797AF6BB251E9B2D8FE754C47482B72E0B394EAB76916126FD68EA7D65EB93D59F5B4C5AC40F7C3B37E7F3694F29424C24AF8C8F0EF59CD9DBF1D28E0E10F799A6F78CAD1D45B9DB3D7DEE4A7059ABE99182714983B9C9D44D7F5643596D4F3 -Digest: A4679A4CBEE6292203BAFBA8913245F30E046ABA6C0937B407C00B73D17D8D696690EE25BA1B39DEB3DB93525A8FBCFD88173BA9C7A65B4406D0550BA9B6CC07 -Test: Verify -Message: 3434EC31B10FAFDBFEEC0DD6BD94E80F7BA9DCA19EF075F7EB017512AF66D6A4BCF7D16BA0819A1892A6372F9B35BCC7CA8155EE19E8428BC22D214856ED5FA9374C3C09BDE169602CC219679F65A1566FC7316F4CC3B631A18FB4449FA6AFA16A3DB2BC4212EFF539C67CF184680826535589C7111D73BFFCE431B4C40492E763D9279560AAA38EB2DC14A212D723F994A1FE656FF4DD14551CE4E7C621B2AA5604A10001B2878A897A28A08095C325E10A26D2FB1A75BFD64C250309BB55A44F23BBAC0D5516A1C687D3B41EF2FBBF9CC56D4739 -Digest: 5F49D6594DA939987D1906294B33A037F63C79E078531DFA7E6CE67279D4D5DBEB650FF8690F23B63B7E9C48EA8791B80FDB34EF66DCF0CEFE45842ECFF4AD1D -Test: Verify -Message: 7C7953D81C8D208FD1C97681D48F49DD003456DE60475B84070EF4847C333B74575B1FC8D2A186964485A3B8634FEAA3595AAA1A2F4595A7D6B6153563DEE31BBAC443C8A33EED6D5D956A980A68366C2527B550EE950250DFB691EACBD5D56AE14B970668BE174C89DF2FEA43AE52F13142639C884FD62A3683C0C3792F0F24AB1318BCB27E21F4737FAB62C77EA38BC8FD1CF41F7DAB64C13FEBE7152BF5BB7AB5A78F5346D43CC741CB6F72B7B8980F268B68BF62ABDFB1577A52438FE14B591498CC95F071228460C7C5D5CEB4A7BDE588E7F21C -Digest: B77FB79669EA52C738E58A9EF3ED1501BBE7974478AFB5A8BED44549D6232FF8D7AA9EEEAF02F6755327951093243110D7BCFC0E51299DB793856B57A77E8420 -Test: Verify -Message: 7A6A4F4FDC59A1D223381AE5AF498D74B7252ECF59E389E49130C7EAEE626E7BD9897EFFD92017F4CCDE66B0440462CDEDFD352D8153E6A4C8D7A0812F701CC737B5178C2556F07111200EB627DBC299CAA792DFA58F35935299FA3A3519E9B03166DFFA159103FFA35E8577F7C0A86C6B46FE13DB8E2CDD9DCFBA85BDDDCCE0A7A8E155F81F712D8E9FE646153D3D22C811BD39F830433B2213DD46301941B59293FD0A33E2B63ADBD95239BC01315C46FDB678875B3C81E053A40F581CFBEC24A1404B1671A1B88A6D06120229518FB13A74CA0AC5AE -Digest: CACA0FF43107F730A7FBE6869FBA5AF1E626C96303BE3BC95155164199C88922194511B24C48911186F647CA246427F2CE7BA747271CD8D7C5E1D127C21F1EAA -Test: Verify -Message: D9FAA14CEBE9B7DE551B6C0765409A33938562013B5E8E0E1E0A6418DF7399D0A6A771FB81C3CA9BD3BB8E2951B0BC792525A294EBD1083688806FE5E7F1E17FD4E3A41D00C89E8FCF4A363CAEDB1ACB558E3D562F1302B3D83BB886ED27B76033798131DAB05B4217381EAAA7BA15EC820BB5C13B516DD640EAEC5A27D05FDFCA0F35B3A5312146806B4C0275BCD0AAA3B2017F346975DB566F9B4D137F4EE10644C2A2DA66DEECA5342E236495C3C6280528BFD32E90AF4CD9BB908F34012B52B4BC56D48CC8A6B59BAB014988EABD12E1A0A1C2E170E7 -Digest: E5106B2A0D49D6D1E13E3323232101CEA5DA71CAA24E70EFCAC57E0CCF156CDF4C2492B03CE0E13437018DAB76B9C989883BEA69E849F33BB937A397B84ADA6A -Test: Verify -Message: 2D8427433D0C61F2D96CFE80CF1E932265A191365C3B61AAA3D6DCC039F6BA2AD52A6A8CC30FC10F705E6B7705105977FA496C1C708A277A124304F1FC40911E7441D1B5E77B951AAD7B01FD5DB1B377D165B05BBF898042E39660CAF8B279FE5229D1A8DB86C0999ED65E53D01CCBC4B43173CCF992B3A14586F6BA42F5FE30AFA8AE40C5DF29966F9346DA5F8B35F16A1DE3AB6DE0F477D8D8660918060E88B9B9E9CA6A4207033B87A812DBF5544D39E4882010F82B6CE005F8E8FF6FE3C3806BC2B73C2B83AFB704345629304F9F86358712E9FAE3CA3E -Digest: FAEE462E4BCED12AD54D3757D644396ED9203037741661AEA32BCCADAE568C4BDC925EDA76610E964FBE3FB26B33BC0BC123DDF9B528715317CE5C92E00AC96F -Test: Verify -Message: 5E19D97887FCAAC0387E22C6F803C34A3DACD2604172433F7A8A7A526CA4A2A1271ECFC5D5D7BE5AC0D85D921095350DFC65997D443C21C8094E0A3FEFD2961BCB94AED03291AE310CCDA75D8ACE4BC7D89E7D3E5D1650BDA5D668B8B50BFC8E608E184F4D3A9A2BADC4FF5F07E0C0BC8A9F2E0B2A26FD6D8C550008FAAAB75FD71AF2A424BEC9A7CD9D83FAD4C8E9319115656A8717D3B523A68FF8004258B9990ED362308461804BA3E3A7E92D8F2FFAE5C2FBA55BA5A3C27C0A2F71BD711D2FE1799C2ADB31B200035481E9EE5C4ADF2AB9C0FA50B23975CF -Digest: FBE25B43E540104A3AADE897838C63511928AF5ADD4F952F1E6D4C39E70C923DF191FAA36F46B21F827D9B437996FF7206F73337CF20C6B0DB748A707455B420 -Test: Verify -Message: C8E976AB4638909387CE3B8D4E510C3230E5690E02C45093B1D297910ABC481E56EEA0F296F98379DFC9080AF69E73B2399D1C143BEE80AE1328162CE1BA7F6A8374679B20AACD380EB4E61382C99998704D62701AFA914F9A2705CDB065885F50D086C3EB5753700C387118BB142F3E6DA1E988DFB31AC75D7368931E45D1391A274B22F83CEB072F9BCABC0B216685BFD789F5023971024B1878A205442522F9EA7D8797A4102A3DF41703768251FD5E017C85D1200A464118AA35654E7CA39F3C375B8EF8CBE7534DBC64BC20BEFB417CF60EC92F63D9EE7397 -Digest: 0A41A004573E0A983FE9C93BD57439A20C8F99B800A60D4A07117E8D9B25C0EE38BAB3CDB6FC9216B8E07F0CCDD028C418EF97B6D7E15DECDE7425497644E2E4 -Test: Verify -Message: 7145FA124B7429A1FC2231237A949BA7201BCC1822D3272DE005B682398196C25F7E5CC2F289FBF44415F699CB7FE6757791B1443410234AE061EDF623359E2B4E32C19BF88450432DD01CAA5EB16A1DC378F391CA5E3C4E5F356728BDDD4975DB7C890DA8BBC84CC73FF244394D0D48954978765E4A00B593F70F2CA082673A261ED88DBCEF1127728D8CD89BC2C597E9102CED6010F65FA75A14EBE467FA57CE3BD4948B6867D74A9DF5C0EC6F530CBF2EE61CE6F06BC8F2864DFF5583776B31DF8C7FFCB61428A56BF7BD37188B4A5123BBF338393AF46EDA85E6 -Digest: FF081507F979F69C6743E42EE758858713B570CB48FF85EF0D728C4E1BB5456D035E498C05EA4CEBD820E134BB252AC76BA4949A4FAD76871A9972AE2FCCCEEA -Test: Verify -Message: 7FDFADCC9D29BAD23AE038C6C65CDA1AEF757221B8872ED3D75FF8DF7DA0627D266E224E812C39F7983E4558BFD0A1F2BEF3FEB56BA09120EF762917B9C093867948547AEE98600D10D87B20106878A8D22C64378BF634F7F75900C03986B077B0BF8B740A82447B61B99FEE5376C5EB6680EC9E3088F0BDD0C56883413D60C1357D3C811950E5890E7600103C916341B80C743C6A852B7B4FB60C3BA21F3BC15B8382437A68454779CF3CD7F9F90CCC8EF28D0B706535B1E4108EB5627BB45D719CB046839AEE311CA1ABDC8319E050D67972CB35A6B1601B25DBF487 -Digest: 03444AE8319EBD121E7707B9CDFD1FDFD52F3D6B3D4BCB2748AF421A3C8666C22D8C0D8A096767B1CD16A8D54738C5F67A6F9D48C90827BE71691A42BE87108B -Test: Verify -Message: 988638219FD3095421F826F56E4F09E356296B628C3CE6930C9F2E758FD1A80C8273F2F61E4DAAE65C4F110D3E7CA0965AC7D24E34C0DC4BA2D6FF0BF5BBE93B3585F354D7543CB542A1AA54674D375077F2D360A8F4D42F3DB131C3B7AB7306267BA107659864A90C8C909460A73621D1F5D9D3FD95BEB19B23DB1CB6C0D0FBA91D36891529B8BD8263CAA1BAB56A4AFFAED44962DF096D8D5B1EB845EF31188B3E10F1AF811A13F156BEB7A288AAE593EBD1471B624AA1A7C6ADF01E2200B3D72D88A3AED3100C88231E41EFC376906F0B580DC895F080FDA5741DB1CB -Digest: 5EE0A4459724037B7318815A80147C172D6C8F8874C9A0057706FB3E300FE936815F07672E6447B771DE699DFADF345C3BB5974CF019315FADD5534DFF6A079C -Test: Verify -Message: 5AAB62756D307A669D146ABA988D9074C5A159B3DE85151A819B117CA1FF6597F6156E80FDD28C9C3176835164D37DA7DA11D94E09ADD770B68A6E081CD22CA0C004BFE7CD283BF43A588DA91F509B27A6584C474A4A2F3EE0F1F56447379240A5AB1FB77FDCA49B305F07BA86B62756FB9EFB4FC225C86845F026EA542076B91A0BC2CDD136E122C659BE259D98E5841DF4C2F60330D4D8CDEE7BF1A0A244524EECC68FF2AEF5BF0069C9E87A11C6E519DE1A4062A10C83837388F7EF58598A3846F49D499682B683C4A062B421594FAFBC1383C943BA83BDEF515EFCF10D -Digest: 54085A2F9C327E5D8EE225EFF5BD2C2837E44E8057CF1691E6202050079D26851061C4DA8D88FC19237E5B658950E66866E92019D9E425E2416240A59D25A6CF -Test: Verify -Message: 47B8216AA0FBB5D67966F2E82C17C07AA2D6327E96FCD83E3DE7333689F3EE79994A1BF45082C4D725ED8D41205CB5BCDF5C341F77FACB1DA46A5B9B2CBC49EADF786BCD881F371A95FA17DF73F606519AEA0FF79D5A11427B98EE7F13A5C00637E2854134691059839121FEA9ABE2CD1BCBBBF27C74CAF3678E05BFB1C949897EA01F56FFA4DAFBE8644611685C617A3206C7A7036E4AC816799F693DAFE7F19F303CE4EBA09D21E03610201BFC665B72400A547A1E00FA9B7AD8D84F84B34AEF118515E74DEF11B9188BD1E1F97D9A12C30132EC2806339BDADACDA2FD8B78 -Digest: 3EA49B6ABD39CDF04BCCD648FB7E1F8AE3DAE9D3E3A5EAB9CE29BE356DEFBBBEB1BB93AE40D31CC1F011DCC6C6AC85B102F2654E2DBBAC47333BCDB4758A1A28 -Test: Verify -Message: 8CFF1F67FE53C098896D9136389BD8881816CCAB34862BB67A656E3D98896F3CE6FFD4DA73975809FCDF9666760D6E561C55238B205D8049C1CEDEEF374D1735DAA533147BFA960B2CCE4A4F254176BB4D1BD1E89654432B8DBE1A135C42115B394B024856A2A83DC85D6782BE4B444239567CCEC4B184D4548EAE3FF6A192F343292BA2E32A0F267F31CC26719EB85245D415FB897AC2DA433EE91A99424C9D7F1766A44171D1651001C38FC79294ACCC68CEB5665D36218454D3BA169AE058A831338C17743603F81EE173BFC0927464F9BD728DEE94C6AEAB7AAE6EE3A627E8 -Digest: B3851790CA47575DBF988F82C3B501DC8390A8E8598698166167567A0332913CCC8868584DB4ACFB2C9DC0F0A6833292F4DCEDC47CF003217689BC2422B53B93 -Test: Verify -Message: EACD07971CFF9B9939903F8C1D8CBB5D4DB1B548A85D04E037514A583604E787F32992BF2111B97AC5E8A938233552731321522AB5E8583561260B7D13EBEEF785B23A41FD8576A6DA764A8ED6D822D4957A545D5244756C18AA80E1AAD4D1F9C20D259DEE1711E2CC8FD013169FB7CC4CE38B362F8E0936AE9198B7E838DCEA4F7A5B9429BB3F6BBCF2DC92565E3676C1C5E6EB3DD2A0F86AA23EDD3D0891F197447692794B3DFA269611AD97F72B795602B4FDB198F3FD3EB41B415064256E345E8D8C51C555DC8A21904A9B0F1AD0EFFAB7786AAC2DA3B196507E9F33CA356427 -Digest: A710CB26C632F289504CD0039BA6AB9B4D3524C52B286D466E2F8939F8684E3F18DCA298A2BA67EB710997B7BB10AE279438B9B4868D0ADB248F282BB440A130 -Test: Verify -Message: 23AC4E9A42C6EF45C3336CE6DFC2FF7DE8884CD23DC912FEF0F7756C09D335C189F3AD3A23697ABDA851A81881A0C8CCAFC980AB2C702564C2BE15FE4C4B9F10DFB2248D0D0CB2E2887FD4598A1D4ACDA897944A2FFC580FF92719C95CF2AA42DC584674CB5A9BC5765B9D6DDF5789791D15F8DD925AA12BFFAFBCE60827B490BB7DF3DDA6F2A143C8BF96ABC903D83D59A791E2D62814A89B8080A28060568CF24A80AE61179FE84E0FFAD00388178CB6A617D37EFD54CC01970A4A41D1A8D3DDCE46EDBBA4AB7C90AD565398D376F431189CE8C1C33E132FEAE6A8CD17A61C630012 -Digest: 8F677A8089052B47BE60C0BB7666E403A5DAA5E28A2B632F2E496C587F1FDCA0EE33D9E78DAA4EF575B13389748B8C24110053B0B96A082C06C3F80EBE8DE976 -Test: Verify -Message: 0172DF732282C9D488669C358E3492260CBE91C95CFBC1E3FEA6C4B0EC129B45F242ACE09F152FC6234E1BEE8AAB8CD56E8B486E1DCBA9C05407C2F95DA8D8F1C0AF78EE2ED82A3A79EC0CB0709396EE62AADB84F8A4EE8A7CCCA3C1EE84E302A09EA802204AFECF04097E67D0F8E8A9D2651126C0A598A37081E42D168B0AE8A71951C524259E4E2054E535B779679BDADE566FE55700858618E626B4A0FAF895BCCE9011504A49E05FD56127EAE3D1F8917AFB548ECADABDA1020111FEC9314C413498A360B08640549A22CB23C731ACE743252A8227A0D2689D4C6001606678DFB921 -Digest: CE631E6F2C2DC5738C0FA958571773B58AF130B94824331419EE57E2691CE5F29DB3D8FE456CD1E7CDC07F6105FA1B6FD729C2B419008CCD889169C3385DB1B9 -Test: Verify -Message: 3875B9240CF3E0A8B59C658540F26A701CF188496E2C2174788B126FD29402D6A75453BA0635284D08835F40051A2A9683DC92AFB9383719191231170379BA6F4ADC816FECBB0F9C446B785BF520796841E58878B73C58D3EBB097CE4761FDEABE15DE2F319DFBAF1742CDEB389559C788131A6793E193856661376C81CE9568DA19AA6925B47FFD77A43C7A0E758C37D69254909FF0FBD415EF8EB937BCD49F91468B49974C07DC819ABD67395DB0E05874FF83DDDAB895344ABD0E7111B2DF9E58D76D85AD98106B36295826BE04D435615595605E4B4BB824B33C4AFEB5E7BB0D19F909 -Digest: FFF677BB58909C158EA677BE704253505B106AF934F639ABFEC63BD0C63097AA4BF032FE924149DD991D335E1C44C0220E4D13CBC41B6A98FB5A05FAA3FE15B3 -Test: Verify -Message: 747CC1A59FEFBA94A9C75BA866C30DC5C1CB0C0F8E9361D98484956DD5D1A40F6184AFBE3DAC9F76028D1CAECCFBF69199C6CE2B4C092A3F4D2A56FE5A33A00757F4D7DEE5DFB0524311A97AE0668A47971B95766E2F6DD48C3F57841F91F04A00AD5EA70F2D479A2620DC5CD78EAAB3A3B011719B7E78D19DDF70D9423798AF77517EBC55392FCD01FC600D8D466B9E7A7A85BF33F9CC5419E9BD874DDFD60981150DDAF8D7FEBAA4374F0872A5628D318000311E2F5655365AD4D407C20E5C04DF17A222E7DEEC79C5AB1116D8572F91CD06E1CCC7CED53736FC867FD49ECEBE6BF8082E8A -Digest: 451EE587226C99989F5EC10050983B1FD661228A4AB48618F1D1173C94FAC39ECFD3C26C16653633B26097E31A0F2213B4F1153A57CB48A70D2AF1ADEB1BBC06 -Test: Verify -Message: 57AF971FCCAEC97435DC2EC9EF0429BCEDC6B647729EA168858A6E49AC1071E706F4A5A645CA14E8C7746D65511620682C906C8B86EC901F3DDED4167B3F00B06CBFAC6AEE3728051B3E5FF10B4F9ED8BD0B8DA94303C833755B3CA3AEDDF0B54BC8D6632138B5D25BAB03D17B3458A9D782108006F5BB7DE75B5C0BA854B423D8BB801E701E99DC4FEAAD59BC1C7112453B04D33EA3635639FB802C73C2B71D58A56BBD671B18FE34ED2E3DCA38827D63FDB1D4FB3285405004B2B3E26081A8FF08CD6D2B08F8E7B7E90A2AB1ED7A41B1D0128522C2F8BFF56A7FE67969422CE839A9D4608F03 -Digest: F9D6AD8686125E71FE0856E806D68BA97EF123443938D28283387F33E3AC6E2A7DE042A3EE5F7994C1EECC5B6F22CBAE1349CAB2FB7A0A0125EC2320320858D4 -Test: Verify -Message: 04E16DEDC1227902BAAF332D3D08923601BDD64F573FAA1BB7201918CFE16B1E10151DAE875DA0C0D63C59C3DD050C4C6A874011B018421AFC4623AB0381831B2DA2A8BA42C96E4F70864AC44E106F94311051E74C77C1291BF5DB9539E69567BF6A11CF6932BBBAD33F8946BF5814C066D851633D1A513510039B349939BFD42B858C21827C8FF05F1D09B1B0765DC78A135B5CA4DFBA0801BCADDFA175623C8B647EACFB4444B85A44F73890607D06D507A4F8393658788669F6EF4DEB58D08C50CA0756D5E2F49D1A7AD73E0F0B3D3B5F090ACF622B1878C59133E4A848E05153592EA81C6FBF -Digest: F26F3268FD620FC476A49AAC3ED1580864934A2F6BA881ED8C8FB757AAAA64BCDF501E1913DE600BBEF6F12C949FEA8FD68C645086D5E30C9253588FFBD19BE5 -Test: Verify -Message: 7C815C384EEE0F288ECE27CCED52A01603127B079C007378BC5D1E6C5E9E6D1C735723ACBBD5801AC49854B2B569D4472D33F40BBB8882956245C366DC3582D71696A97A4E19557E41E54DEE482A14229005F93AFD2C4A7D8614D10A97A9DFA07F7CD946FA45263063DDD29DB8F9E34DB60DAA32684F0072EA2A9426ECEBFA5239FB67F29C18CBAA2AF6ED4BF4283936823AC1790164FEC5457A9CBA7C767CA59392D94CAB7448F50EB34E9A93A80027471CE59736F099C886DEA1AB4CBA4D89F5FC7AE2F21CCD27F611ECA4626B2D08DC22382E92C1EFB2F6AFDC8FDC3D2172604F5035C46B8197D3 -Digest: 080845D6FD22A00B30FA01A4B4F81FDC7B46CA4C6A676AD5863A9DBF6611BA97F24FB59BB5BAC4E376B3B8B3357166782876B701273FF351BC8C5805532767D4 -Test: Verify -Message: E29D505158DBDD937D9E3D2145658EE6F5992A2FC790F4F608D9CDB44A091D5B94B88E81FAC4FDF5C49442F13B911C55886469629551189EAFF62488F1A479B7DB11A1560E198DDCCCCF50159093425FF7F1CB8D1D1246D0978764087D6BAC257026B090EFAE8CEC5F22B6F21C59ACE1AC7386F5B8837CA6A12B6FBF5534DD0560EF05CA78104D3B943DDB220FEAEC89AA5E692A00F822A2AB9A2FE60350D75E7BE16FF2526DC643872502D01F42F188ABED0A6E9A6F5FD0D1CE7D5755C9FFA66B0AF0B20BD806F08E06156690D81AC811778CA3DAC2C249B96002017FCE93E507E3B953ACF99964B847 -Digest: 2678A8715FC7E538522DD7608D769508B63017D9EB6CC48F1CB07D14E741066936C8316BF3211E09F62611E140DDD14A07F97F9F372E99C084FFE289EB302BD8 -Test: Verify -Message: D85588696F576E65ECA0155F395F0CFACD83F36A99111ED5768DF2D116D2121E32357BA4F54EDE927F189F297D3A97FAD4E9A0F5B41D8D89DD7FE20156799C2B7B6BF9C957BA0D6763F5C3BC5129747BBB53652B49290CFF1C87E2CDF2C4B95D8AAEE09BC8FBFA6883E62D237885810491BFC101F1D8C636E3D0EDE838AD05C207A3DF4FAD76452979EB99F29AFAECEDD1C63B8D36CF378454A1BB67A741C77AC6B6B3F95F4F02B64DABC15438613EA49750DF42EE90101F115AA9ABB9FF64324DDE9DABBB01054E1BD6B4BCDC7930A44C2300D87CA78C06924D0323AD7887E46C90E8C4D100ACD9EED21E -Digest: AA03EB09417435DA9E6E7803F3B6EAB66FAA3D59CC622950D61F9B962B69145AC2255CD752CB9607742092697B1A79D124817AE26421E61D1176764832ED354C -Test: Verify -Message: 3A12F8508B40C32C74492B66323375DCFE49184C78F73179F3314B79E63376B8AC683F5A51F1534BD729B02B04D002F55CBD8E8FC9B5EC1EA6BBE6A0D0E7431518E6BA45D124035F9D3DCE0A8BB7BF1430A9F657E0B4EA9F20EB20C786A58181A1E20A96F1628F8728A13BDF7A4B4B32FC8AA7054CC4881AE7FA19AFA65C6C3EE1B3ADE3192AF42054A8A911B8EC1826865D46D93F1E7C5E2B7813C92A506E53886F3D4701BB93D2A681AD109C845904BB861AF8AF0646B6E399B38B614051D34F6842563A0F37EC00CB3D865FC5D746C4987DE2A65071100883A2A9C7A2BFE1E2DD603D9EA24DC7C5FD06BE -Digest: D3012F2FB56845B258D7598C0BBB2C97D53B602DEAE9326DC3678B2228454A1E29F28848ED140C70BE85CDEA9F99A8DC347DEABD46D362ED1AFB231146A0255D -Test: Verify -Message: 1861EDCE46FA5AD17E1FF1DEAE084DEC580F97D0A67885DFE834B9DFAC1AE076742CE9E267512CA51F6DF5A455AF0C5FD6ABF94ACEA103A3370C354485A7846FB84F3AC7C2904B5B2FBF227002CE512133BB7E1C4E50057BFD1E44DB33C7CDB969A99E284B184F50A14B068A1FC5009D9B298DBE92239572A7627AAC02ABE8F3E3B473417F36D4D2505D16B7577F4526C9D94A270A2DFE450D06DA8F6FA956879A0A55CFE99E742EA555EA477BA3E9B44CCD508C375423611AF92E55345DC215779B2D5119EBA49C71D49B9FE3F1569FA24E5CA3E332D042422A8B8158D3EC66A80012976F31FFDF305F0C9C5E -Digest: B50C896F2CDF7F105DE751FF6CF664E592FAB752D652B06898B9B288052DF22F721AD87E702AF043E6B1E88929850CBD5698A9172C3932400B2538E401A6F081 -Test: Verify -Message: 08D0FFDE3A6E4EF65608EA672E4830C12943D7187CCFF08F4941CFC13E545F3B9C7AD5EEBBE2B01642B486CAF855C2C73F58C1E4E3391DA8E2D63D96E15FD84953AE5C231911B00AD6050CD7AAFDAAC9B0F663AE6AAB45519D0F5391A541707D479034E73A6AD805AE3598096AF078F1393301493D663DD71F83869CA27BA508B7E91E81E128C1716DC3ACFE3084B2201E04CF8006617EECF1B640474A5D45CFDE9F4D3EF92D6D055B909892194D8A8218DB6D8203A84261D200D71473D7488F3427416B6896C137D455F231071CACBC86E0415AB88AEC841D96B7B8AF41E05BB461A40645BF176601F1E760DE5F -Digest: A34A2F27C32F993A7E7007867733547481293C391255FFD0E5CCBE91E1CC749B13525AF6ADFA0C2D1D64BF87DD65B996ADA9111C5DF55BFF8A5742E54B8444F6 -Test: Verify -Message: D782ABB72A5BE3392757BE02D3E45BE6E2099D6F000D042C8A543F50ED6EBC055A7F133B0DD8E9BC348536EDCAAE2E12EC18E8837DF7A1B3C87EC46D50C241DEE820FD586197552DC20BEEA50F445A07A38F1768A39E2B2FF05DDDEDF751F1DEF612D2E4D810DAA3A0CC904516F9A43AF660315385178A529E51F8AAE141808C8BC5D7B60CAC26BB984AC1890D0436EF780426C547E94A7B08F01ACBFC4A3825EAE04F520A9016F2FB8BF5165ED12736FC71E36A49A73614739EAA3EC834069B1B40F1350C2B3AB885C02C640B9F7686ED5F99527E41CFCD796FE4C256C9173186C226169FF257954EBDA81C0E5F99 -Digest: DD5F4B167175D9566DCA6C5B1B54A33D02EFD02E25E23BB6FB02D878A4415E5E8682C209BEAC04E9882A272D01E8EB435CAA5BCD74FC825C6B9082D041DFF333 -Test: Verify -Message: 5FCE8109A358570E40983E1184E541833BB9091E280F258CFB144387B05D190E431CB19BAA67273BA0C58ABE91308E1844DCD0B3678BAA42F335F2FA05267A0240B3C718A5942B3B3E3BFA98A55C25A1466E8D7A603722CB2BBF03AFA54CD769A99F310735EE5A05DAE2C22D397BD95635F58C48A67F90E1B73AAFCD3F82117F0166657838691005B18DA6F341D6E90FC1CDB352B30FAE45D348294E501B63252DE14740F2B85AE5299DDEC3172DE8B6D0BA219A20A23BB5E10FF434D39DB3F583305E9F5C039D98569E377B75A70AB837D1DF269B8A4B566F40BB91B577455FD3C356C914FA06B9A7CE24C7317A172D -Digest: A43AE5DAD936697564AE1BD9B8624C5C31CC36607322AF40E253F10C285467AFD0D08252D2BAD76EFA52E4775C9C26761ABE38212855A80112FE02623FBF0A13 -Test: Verify -Message: 6172F1971A6E1E4E6170AFBAD95D5FEC99BF69B24B674BC17DD78011615E502DE6F56B86B1A71D3F4348087218AC7B7D09302993BE272E4A591968AEF18A1262D665610D1070EE91CC8DA36E1F841A69A7A682C580E836941D21D909A3AFC1F0B963E1CA5AB193E124A1A53DF1C587470E5881FB54DAE1B0D840F0C8F9D1B04C645BA1041C7D8DBF22030A623AA15638B3D99A2C400FF76F3252079AF88D2B37F35EE66C1AD7801A28D3D388AC450B97D5F0F79E4541755356B3B1A5696B023F39AB7AB5F28DF4202936BC97393B93BC915CB159EA1BD7A0A414CB4B7A1AC3AF68F50D79F0C9C7314E750F7D02FAA58BFA -Digest: A5AC23D4A0D533CB9D8A68873F5CB749228458D43CE6BD0536C8733777B5E6E3F28FD36BFFE69002A0777BA74FEF22DE3FAC4C818B4842816C6094496F968555 -Test: Verify -Message: 5668ECD99DFBE215C4118398AC9C9EAF1A1433FAB4CCDD3968064752B625EA944731F75D48A27D047D67547F14DD0FFAA55FA5E29F7AF0D161D85EAFC4F2029B717C918EAB9D304543290BDBA7158B68020C0BA4E079BC95B5BC0FC044A992B94B4CCD3BD66D0EABB5DBBAB904D62E00752C4E3B0091D773BCF4C14B4377DA3EFFF824B1CB2FA01B32D1E46C909E626ED2DAE920F4C7DBEB635BC754FACBD8D49BEBA3F23C1C41CCBFCD0EE0C114E69737F5597C0BF1D859F0C767E18002AE8E39C26261FFDE2920D3D0BAF0E906138696CFE5B7E32B600F45DF3AAA39932F3A7DF95B60FA8712A2271FCAF3911CE7B511B1 -Digest: 07F3BCACF5F78816D515CEDF1CBBA4FFC58D83AA8687B0E7252FAAB43E7F59A7FF7415727ADDF9A22560ADB5755A2C6DF8C7E6DCACEB53106A714D807AAADBF3 -Test: Verify -Message: 03D625488354DF30E3F875A68EDFCF340E8366A8E1AB67F9D5C5486A96829DFAC0578289082B2A62117E1CF418B43B90E0ADC881FC6AE8105C888E9ECD21AEA1C9AE1A4038DFD17378FED71D02AE492087D7CDCD98F746855227967CB1AB4714261EE3BEAD3F4DB118329D3EBEF4BC48A875C19BA763966DA0EBEA800E01B2F50B00E9DD4CACA6DCB314D00184EF71EA2391D760C950710DB4A70F9212FFC54861F9DC752CE18867B8AD0C48DF8466EF7231E7AC567F0EB55099E622EBB86CB237520190A61C66AD34F1F4E289CB3282AE3EAAC6152ED24D2C92BAE5A7658252A53C49B7B02DFE54FDB2E90074B6CF310AC661 -Digest: 13A592B73EDE487036C8816BD6FC6CDC04DC6133409A6EE990584160518F9EF573264CF04D38A3BA75D150F4F026F6DF8936E13C8F4F3ECC9ECBC43FDFC488A4 -Test: Verify -Message: 2EDC282FFB90B97118DD03AAA03B145F363905E3CBD2D50ECD692B37BF000185C651D3E9726C690D3773EC1E48510E42B17742B0B0377E7DE6B8F55E00A8A4DB4740CEE6DB0830529DD19617501DC1E9359AA3BCF147E0A76B3AB70C4984C13E339E6806BB35E683AF8527093670859F3D8A0FC7D493BCBA6BB12B5F65E71E705CA5D6C948D66ED3D730B26DB395B3447737C26FAD089AA0AD0E306CB28BF0ACF106F89AF3745F0EC72D534968CCA543CD2CA50C94B1456743254E358C1317C07A07BF2B0ECA438A709367FAFC89A57239028FC5FECFD53B8EF958EF10EE0608B7F5CB9923AD97058EC067700CC746C127A61EE3 -Digest: C2FB590AB74E230B8FE159892F94DE04EF7ADAA02B918D4994F996538D257F5A80C9B3BE8F410170B0C5CAC3F507401220881C5E08D8BF0A13247170D39085BC -Test: Verify -Message: 90B28A6AA1FE533915BCB8E81ED6CACDC10962B7FF82474F845EEB86977600CF70B07BA8E3796141EE340E3FCE842A38A50AFBE90301A3BDCC591F2E7D9DE53E495525560B908C892439990A2CA2679C5539FFDF636777AD9C1CDEF809CDA9E8DCDB451ABB9E9C17EFA4379ABD24B182BD981CAFC792640A183B61694301D04C5B3EAAD694A6BD4CC06EF5DA8FA23B4FA2A64559C5A68397930079D250C51BCF00E2B16A6C49171433B0AADFD80231276560B80458DD77089B7A1BBCC9E7E4B9F881EACD6C92C4318348A13F4914EB27115A1CFC5D16D7FD94954C3532EFACA2CAB025103B2D02C6FD71DA3A77F417D7932685888A -Digest: 02951596A13A1A41188A4A1D6346F7EAFB60A2051EA67C63237D1A9B79EC4733F33ECEC223DEDD946B78387B6F2DF5E9AB6AF7DFBABAF80F4FCC94FA087275E8 -Test: Verify -Message: 2969447D175490F2AA9BB055014DBEF2E6854C95F8D60950BFE8C0BE8DE254C26B2D31B9E4DE9C68C9ADF49E4EE9B1C2850967F29F5D08738483B417BB96B2A56F0C8ACA632B552059C59AAC3F61F7B45C966B75F1D9931FF4E596406378CEE91AAA726A3A84C33F37E9CDBE626B5745A0B06064A8A8D56E53AAF102D23DD9DF0A3FDF7A638509A6761A33FA42FA8DDBD8E16159C93008B53765019C3F0E9F10B144CE2AC57F5D7297F9C9949E4FF68B70D339F87501CE8550B772F32C6DA8AD2CE2100A895D8B08FA1EEAD7C376B407709703C510B50F87E73E43F8E7348F87C3832A547EF2BBE5799ABEDCF5E1F372EA809233F006 -Digest: 5AA4E32F0EA3E853929BF64ACC9565A01300BC007063B939F6DBBE9CAE0545EA95FBCAC32575AA0727EE4D937071E6B3BE74E23FE76FD63EC05C7F7D8A407AF0 -Test: Verify -Message: 721645633A44A2C78B19024EAECF58575AB23C27190833C26875DC0F0D50B46AEA9C343D82EA7D5B3E50EC700545C615DAEAEA64726A0F05607576DCD396D812B03FB6551C641087856D050B10E6A4D5577B82A98AFB89CEE8594C9DC19E79FEFF0382FCFD127F1B803A4B9946F4AC9A4378E1E6E041B1389A53E3450CD32D9D2941B0CBABDB50DA8EA2513145164C3AB6BCBD251C448D2D4B087AC57A59C2285D564F16DA4ED5E607ED979592146FFB0EF3F3DB308FB342DF5EB5924A48256FC763141A278814C82D6D6348577545870AE3A83C7230AC02A1540FE1798F7EF09E335A865A2AE0949B21E4F748FB8A51F44750E213A8FB -Digest: 495B2AA2103159D9A937E9DD56B059ACA98A5E3CB7B59BB690DEDC00C692E9D7A18614A73D12E07634B209CC630D1818B09F1076A941FF80474493E3D42B9812 -Test: Verify -Message: 6B860D39725A14B498BB714574B4D37CA787404768F64C648B1751B353AC92BAC2C3A28EA909FDF0423336401A02E63EC24325300D823B6864BB701F9D7C7A1F8EC9D0AE3584AA6DD62EA1997CD831B4BABD9A4DA50932D4EFDA745C61E4130890E156AEE6113716DAF95764222A91187DB2EFFEA49D5D0596102D619BD26A616BBFDA8335505FBB0D90B4C180D1A2335B91538E1668F9F9642790B4E55F9CAB0FE2BDD2935D001EE6419ABAB5457880D0DBFF20ED8758F4C20FE759EFB33141CF0E892587FE8187E5FBC57786B7E8B089612C936DFC03D27EFBBE7C8673F1606BD51D5FF386F4A7AB68EDF59F385EB1291F117BFE717399 -Digest: 217B5A985BED80008274470E254443238C5AEACBC7EE2289F0E63B7AFE6D0F395E2361FD6D9DC33B4F54F03FF56F6B264976161D80091788EE9D262F147A35FC -Test: Verify -Message: 6A01830AF3889A25183244DECB508BD01253D5B508AB490D3124AFBF42626B2E70894E9B562B288D0A2450CFACF14A0DDAE5C04716E5A0082C33981F6037D23D5E045EE1EF2283FB8B6378A914C5D9441627A722C282FF452E25A7EA608D69CEE4393A0725D17963D0342684F255496D8A18C2961145315130549311FC07F0312FB78E6077334F87EAA873BEE8AA95698996EB21375EB2B4EF53C14401207DEB4568398E5DD9A7CF97E8C9663E23334B46912F8344C19EFCF8C2BA6F04325F1A27E062B62A58D0766FC6DB4D2C6A1928604B0175D872D16B7908EBC041761187CC785526C2A3873FEAC3A642BB39F5351550AF9770C328AF7B -Digest: 293C551E753BBA7F314DCB93A0FAD94F3F5DEE6ED45D765A708E6FD277601F03F6C905D7E1EAEAEC513CBBBD672B817F6D60FBF02C20167D7F4B7B84AFEEB3F6 -Test: Verify -Message: B3C5E74B69933C2533106C563B4CA20238F2B6E675E8681E34A389894785BDADE59652D4A73D80A5C85BD454FD1E9FFDAD1C3815F5038E9EF432AAC5C3C4FE840CC370CF86580A6011778BBEDAF511A51B56D1A2EB68394AA299E26DA9ADA6A2F39B9FAFF7FBA457689B9C1A577B2A1E505FDF75C7A0A64B1DF81B3A356001BF0DF4E02A1FC59F651C9D585EC6224BB279C6BEBA2966E8882D68376081B987468E7AED1EF90EBD090AE825795CDCA1B4F09A979C8DFC21A48D8A53CDBB26C4DB547FC06EFE2F9850EDD2685A4661CB4911F165D4B63EF25B87D0A96D3DFF6AB0758999AAD214D07BD4F133A6734FDE445FE474711B69A98F7E2B -Digest: 89FE6314A0246EFF3BFD07A95FE239BD5071467F53799175B226DAF6C3DB618CAD4CA1C1AF64BF5793F03254F560E6335BEAAA86BCB9E961F214B2AE97B47AF0 -Test: Verify -Message: 83AF34279CCB5430FEBEC07A81950D30F4B66F484826AFEE7456F0071A51E1BBC55570B5CC7EC6F9309C17BF5BEFDD7C6BA6E968CF218A2B34BD5CF927AB846E38A40BBD81759E9E33381016A755F699DF35D660007B5EADF292FEEFB735207EBF70B5BD17834F7BFA0E16CB219AD4AF524AB1EA37334AA66435E5D397FC0A065C411EBBCE32C240B90476D307CE802EC82C1C49BC1BEC48C0675EC2A6C6F3ED3E5B741D13437095707C565E10D8A20B8C20468FF9514FCF31B4249CD82DCEE58C0A2AF538B291A87E3390D737191A07484A5D3F3FB8C8F15CE056E5E5F8FEBE5E1FB59D6740980AA06CA8A0C20F5712B4CDE5D032E92AB89F0AE1 -Digest: 7690F703E894EE22D4DFF55A7F8D5021D5F17B729F95A59C4D55CFB225C67BE105F2E7CDF56D140E566648E9E9C39BBED96F985A6DAE1F21D8BA500F7FD40EDF -Test: Verify -Message: A7ED84749CCC56BB1DFBA57119D279D412B8A986886D810F067AF349E8749E9EA746A60B03742636C464FC1EE233ACC52C1983914692B64309EDFDF29F1AB912EC3E8DA074D3F1D231511F5756F0B6EEAD3E89A6A88FE330A10FACE267BFFBFC3E3090C7FD9A850561F363AD75EA881E7244F80FF55802D5EF7A1A4E7B89FCFA80F16DF54D1B056EE637E6964B9E0FFD15B6196BDD7DB270C56B47251485348E49813B4EB9ED122A01B3EA45AD5E1A929DF61D5C0F3E77E1FDC356B63883A60E9CBB9FC3E00C2F32DBD469659883F690C6772E335F617BC33F161D6F6984252EE12E62B6000AC5231E0C9BC65BE223D8DFD94C5004A101AF9FD6C0FB -Digest: 65E415C7958A47FCA9EED3846FD1283AFEB38E5130F57ECD99DCB21BEDDA856E3B5FB9F839E579C5EA386EACA8CDC0A9549EAAF6EC452DD6CB5212B709BF5C59 -Test: Verify -Message: A6FE30DCFCDA1A329E82AB50E32B5F50EB25C873C5D2305860A835AECEE6264AA36A47429922C4B8B3AFD00DA16035830EDB897831C4E7B00F2C23FC0B15FDC30D85FB70C30C431C638E1A25B51CAF1D7E8B050B7F89BFB30F59F0F20FECFF3D639ABC4255B3868FC45DD81E47EB12AB40F2AAC735DF5D1DC1AD997CEFC4D836B854CEE9AC02900036F3867FE0D84AFFF37BDE3308C2206C62C4743375094108877C73B87B2546FE05EA137BEDFC06A2796274099A0D554DA8F7D7223A48CBF31B7DECAA1EBC8B145763E3673168C1B1B715C1CD99ECD3DDB238B06049885ECAD9347C2436DFF32C771F34A38587A44A82C5D3D137A03CAA27E66C8FF6 -Digest: D6542A2F0654B9B874A627D3D53764A65B1DF2C0CEC3BCD0B4B088FAA1095E54F1799757C4371F8D544E298D600E21E11B2F90D295712621231A09C58B05A704 -Test: Verify -Message: 83167FF53704C3AA19E9FB3303539759C46DD4091A52DDAE9AD86408B69335989E61414BC20AB4D01220E35241EFF5C9522B079FBA597674C8D716FE441E566110B6211531CECCF8FD06BC8E511D00785E57788ED9A1C5C73524F01830D2E1148C92D0EDC97113E3B7B5CD3049627ABDB8B39DD4D6890E0EE91993F92B03354A88F52251C546E64434D9C3D74544F23FB93E5A2D2F1FB15545B4E1367C97335B0291944C8B730AD3D4789273FA44FB98D78A36C3C3764ABEEAC7C569C1E43A352E5B770C3504F87090DEE075A1C4C85C0C39CF421BDCC615F9EFF6CB4FE6468004AECE5F30E1ECC6DB22AD9939BB2B0CCC96521DFBF4AE008B5B46BC006E -Digest: EC983E787628B94C87FFF8D57D2D058667D12F5AF458BCE79BB7844FB41D9C55920F593C8D8730EB8D54FF1D51CD8AD2F1C2A0F7D6B299A21266744E47D142B2 -Test: Verify -Message: 3A3A819C48EFDE2AD914FBF00E18AB6BC4F14513AB27D0C178A188B61431E7F5623CB66B23346775D386B50E982C493ADBBFC54B9A3CD383382336A1A0B2150A15358F336D03AE18F666C7573D55C4FD181C29E6CCFDE63EA35F0ADF5885CFC0A3D84A2B2E4DD24496DB789E663170CEF74798AA1BBCD4574EA0BBA40489D764B2F83AADC66B148B4A0CD95246C127D5871C4F11418690A5DDF01246A0C80A43C70088B6183639DCFDA4125BD113A8F49EE23ED306FAAC576C3FB0C1E256671D817FC2534A52F5B439F72E424DE376F4C565CCA82307DD9EF76DA5B7C4EB7E085172E328807C02D011FFBF33785378D79DC266F6A5BE6BB0E4A92ECEEBAEB1 -Digest: 81950E7096D31D4F22E3DB71CAC725BF59E81AF54C7CA9E6AEEE71C010FC5467466312A01AA5C137CFB140646941556796F612C9351268737C7E9A2B9631D1FA -Test: Verify diff --git a/external/crypto++-5.6.3/TestVectors/shacal2.txt b/external/crypto++-5.6.3/TestVectors/shacal2.txt deleted file mode 100644 index 19a3d86ed..000000000 --- a/external/crypto++-5.6.3/TestVectors/shacal2.txt +++ /dev/null @@ -1,5123 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: SHACAL-2/ECB -Source: NESSIE submission -Comment: Set 1, vector 0 -Key: 80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 361AB6322FA9E7A7BB23818D839E01BDDAFDF47305426EDD297AEDB9F6202BAE -Test: Encrypt -Comment: Set 1, vector 1 -Key: 40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F3BAF53E5301E08813F8BE6F651BB19E9722151FF15063BA42A6FEF7CF3BF3D7 -Test: Encrypt -Comment: Set 1, vector 2 -Key: 20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E485005217441B60EE5B48EE8AF924B268B6B952D7F593E6102AC83D7DA72838 -Test: Encrypt -Comment: Set 1, vector 3 -Key: 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AE70E355CB7E26FF12421F46CDAD5CB98367FE0E86CC234EDF97481765CD1AD9 -Test: Encrypt -Comment: Set 1, vector 4 -Key: 08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 00CECD0B01311F881018E7A20BCE169766C089D91FF161346C4E1BD122EA199F -Test: Encrypt -Comment: Set 1, vector 5 -Key: 04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 47A879CB6785AD37119C450CD50E9A36FE318FA8E7B6C6E0FA963430122F33CD -Test: Encrypt -Comment: Set 1, vector 6 -Key: 02000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CF3D53B9F9F7CA2C66738A4C09CEA9212C056F525BDC26F263FBA1B482EDF503 -Test: Encrypt -Comment: Set 1, vector 7 -Key: 01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A274D404E83E82817389A2CB7B528C792A0E80DE879A5A67DE633B0B7DD57B7B -Test: Encrypt -Comment: Set 1, vector 8 -Key: 00800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 09B3AB9332301D4E3C239D192A4221AFD43F6829A705D396FA96BDE1E716BC38 -Test: Encrypt -Comment: Set 1, vector 9 -Key: 00400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D3B9AB867A6868C4400D200979055C8F9E3A6BFB40D1F9E376B9EC89223D7050 -Test: Encrypt -Comment: Set 1, vector 10 -Key: 00200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4F27041481DCF574586CD6D5B72F2E806B0DBC351FEEA624112897A8A64CDBA9 -Test: Encrypt -Comment: Set 1, vector 11 -Key: 00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 77CEC8EA64BB7FAE966D030FE4CF318C318DBEBAEB896F31FAA3C9CBA0AE125D -Test: Encrypt -Comment: Set 1, vector 12 -Key: 00080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E6F96E0217B8BDC6BBF30CB91C05325F493EB076E505FC6469AAA2BBB3A8A60B -Test: Encrypt -Comment: Set 1, vector 13 -Key: 00040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: ED949C1CFC555EC7192464AE86EC0334AD1198C2DBA36DB38CDF7160C950D474 -Test: Encrypt -Comment: Set 1, vector 14 -Key: 00020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 41EB01CC3875F31A6C8D7008C958BBB164813C59435B01879199979FC4762B26 -Test: Encrypt -Comment: Set 1, vector 15 -Key: 00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CCE7C4F96A665DDD23F39A78A3C7898E5F945FE908F1707DBED08BA6BCA3A58E -Test: Encrypt -Comment: Set 1, vector 16 -Key: 00008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5FDBD5741AB5BC53E8C75F4497E37D5BE92B89D2424A11BBF189449AE005E2E8 -Test: Encrypt -Comment: Set 1, vector 17 -Key: 00004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E6C00B21A5B89F4FE9251E53E7AFE30D6C8721678BF842575EEE185E85632778 -Test: Encrypt -Comment: Set 1, vector 18 -Key: 00002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FC19871F6E933014D92721D77BDF4E0EF528A325D5DC979536D6C46457CA066F -Test: Encrypt -Comment: Set 1, vector 19 -Key: 00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A195202A93364212B989EB2C667EE05881657AD95FB6B3EE62DD21EB73347E56 -Test: Encrypt -Comment: Set 1, vector 20 -Key: 00000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A25B4FB9B4F8418514A1A04078DFBDF73B83B936A887AD6B1B672F1C2AF128CF -Test: Encrypt -Comment: Set 1, vector 21 -Key: 00000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: ACB2AB0F22068D36C160D668ED300DCF32C66FB8447594878DE1B1A83B414E13 -Test: Encrypt -Comment: Set 1, vector 22 -Key: 00000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A5AD217E39C9B40A921B4E52B1B47649C72631E7A99FE4897A92CD1A65BF8BFF -Test: Encrypt -Comment: Set 1, vector 23 -Key: 00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1185C198ABA5AD97F5DF7850284CD5E34BBE5E0EEC3CE4ACC4FC0A3CE3FA3BEE -Test: Encrypt -Comment: Set 1, vector 24 -Key: 00000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7AC85AA2C5A9A219B8E437C65913738628EE442F56BD57292C8A1B36026B6664 -Test: Encrypt -Comment: Set 1, vector 25 -Key: 00000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6140F926FA90F091603D23A4876A3A5598890CB1F2FDE64E43C50630BE4101D2 -Test: Encrypt -Comment: Set 1, vector 26 -Key: 00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 365135682290CB40D83228B3F26FD63266EED9C72DAC991510FEFA9B56466E8F -Test: Encrypt -Comment: Set 1, vector 27 -Key: 00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 928EED2E262D9E398ADA06151ADFB35F34018114E97414C75E390C8EDA8D2440 -Test: Encrypt -Comment: Set 1, vector 28 -Key: 00000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E362280E66204F47E8FB782D18522AA3E1D527C15EBA88E76DB5AF44E156BB45 -Test: Encrypt -Comment: Set 1, vector 29 -Key: 00000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 807E3938AF9C9F0233FDA70B0E26028B390101F238ECFBD53EAE8E2D86552DBF -Test: Encrypt -Comment: Set 1, vector 30 -Key: 00000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E7D3FA388C4E07ADD32E188BD09264A2BD19F0F7EC5712AC05C47B49C7FD6651 -Test: Encrypt -Comment: Set 1, vector 31 -Key: 00000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 891CFD4A18F35239FD4463DE95FE9CAF4569AC82766E457315C123FB5FE6A397 -Test: Encrypt -Comment: Set 1, vector 32 -Key: 00000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5C8E12B2572ED949494B324383806FD61B7CF0479DEB5D62028E83B7091BB039 -Test: Encrypt -Comment: Set 1, vector 33 -Key: 00000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6F071D68C107B19B9949A6B7AF2C79EDC40FBA9BD07674AB3B1DB8CDE0A9637D -Test: Encrypt -Comment: Set 1, vector 34 -Key: 00000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FD720D4ECFB7B68BA48C52E2F69FE268773D73B41723AA51127895B14C516F34 -Test: Encrypt -Comment: Set 1, vector 35 -Key: 00000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0D3D7DEB1F8742BB22C4A3FB88C7C07CDCC8165ECF624C95FD8838D90D465B0D -Test: Encrypt -Comment: Set 1, vector 36 -Key: 00000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 06A524998D1FEA6AF6E4015B9A16B7A447F50AE0A8902E6E3308D3B47E98C4F1 -Test: Encrypt -Comment: Set 1, vector 37 -Key: 00000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9FBDF43AB1294164BC968E113673BB11195AE39267BF2537F0E429E3C10B5D2F -Test: Encrypt -Comment: Set 1, vector 38 -Key: 00000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 81C4C7F2144555C888D876787EE62BC03EBB57093DB3DDE806918707684C8C52 -Test: Encrypt -Comment: Set 1, vector 39 -Key: 00000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F62E7B237C98C5727D4F267AE17932AAC4DAEF0CAF4C02176B4CBB902ED164D1 -Test: Encrypt -Comment: Set 1, vector 40 -Key: 00000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 99CAD86B7E78D9B2ED9DA56F27C9AECB49CBFFC287930CEBC1BF06EA94541E9B -Test: Encrypt -Comment: Set 1, vector 41 -Key: 00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: ED1F4429D5C36B2C16D598A2CE52D9C84E9DE7CD0B4899E47ADCB999CAEDB0CA -Test: Encrypt -Comment: Set 1, vector 42 -Key: 00000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3FEF41084D9CFF6111C40F9656C46D3892323465630B0C1D082255222847D9D0 -Test: Encrypt -Comment: Set 1, vector 43 -Key: 00000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AB7D2B41135ED54EC7AB11C67D20BC35F0C8652D209D675AAB3A33FA264C9380 -Test: Encrypt -Comment: Set 1, vector 44 -Key: 00000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1208F63F213F1A55127900FFBFEB0569B693376D9310C9A9E36EA1DE22CB5A59 -Test: Encrypt -Comment: Set 1, vector 45 -Key: 00000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 10C38678BC2465923063E41B4339D96F3DC5A64CA77A9C9C132D75BC4EC517F1 -Test: Encrypt -Comment: Set 1, vector 46 -Key: 00000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5342519F1181700EDC380133226AE072971AC1AC6DF72440FD817C9ACB862E68 -Test: Encrypt -Comment: Set 1, vector 47 -Key: 00000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 09D02729C71C6E5E852272B853E87C1BAB5E522875E5D8063501ECE10315B4D6 -Test: Encrypt -Comment: Set 1, vector 48 -Key: 00000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 33D7D4F58BDD14244621A960A076573892ABDDBEF36109289A3E8A4EC536E95F -Test: Encrypt -Comment: Set 1, vector 49 -Key: 00000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 81A4590D64E2140414B913AC73BECEC19CAC798C313196007E39EF4F75C7DDB5 -Test: Encrypt -Comment: Set 1, vector 50 -Key: 00000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 942ED16EC4A9D72D74ABFB7E79CDE840997DD2AD83C9DDFAD02528A9A7E0AAC3 -Test: Encrypt -Comment: Set 1, vector 51 -Key: 00000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8376BF03EAE71EF035E18903AC0CC2CCC93610C48050DB096BE758743234CD63 -Test: Encrypt -Comment: Set 1, vector 52 -Key: 00000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B5613234B5F9D1201A9A581D59BD744B8E59728E5E330B74CBF03B9E81C950E0 -Test: Encrypt -Comment: Set 1, vector 53 -Key: 00000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4750E864B881A2764EC508D0DD4AF06B7B1B123FDCCCA141A74DEAF28070B408 -Test: Encrypt -Comment: Set 1, vector 54 -Key: 00000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B3F29EE6BDF09A16C4EA8C1539CD033B17706436FC40DEBD95DA70BF05BF1856 -Test: Encrypt -Comment: Set 1, vector 55 -Key: 00000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3A91B7730E3FE044B75E75B9BB09BC1550AD5AC9F495AFFB524FAD90A51112D5 -Test: Encrypt -Comment: Set 1, vector 56 -Key: 00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D262DF12E3D8DA99A9F7F011D607905DCBE9AB03C317E81E4BCD076F3C55EBB2 -Test: Encrypt -Comment: Set 1, vector 57 -Key: 00000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 827BD4A79FD82594F645A02F9546906ADCBFF47E2F2D0D0DAF89A200389A5E00 -Test: Encrypt -Comment: Set 1, vector 58 -Key: 00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E83B866B294780E36058CBCB62BC3C509604F9EB9A44F1CFAFD50F248359A106 -Test: Encrypt -Comment: Set 1, vector 59 -Key: 00000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8695B4BC5DC6528183B94D5257DC668DCAA0E5A855B76555B65FCCF941A8CCAC -Test: Encrypt -Comment: Set 1, vector 60 -Key: 00000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3B5D549F736D15CFD0F39A42CB1ACBEA370ADAA9EBC7C012AF2E30463DF98E03 -Test: Encrypt -Comment: Set 1, vector 61 -Key: 00000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1C29F7919784BDF30E566B75DBA4C911FC48C1CD7F845406B86DA540B71C572E -Test: Encrypt -Comment: Set 1, vector 62 -Key: 00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D530E5B30338589A6AE67E0C1E2C57AF02CCEFF84705BC4AAD0D93375E7F2DAB -Test: Encrypt -Comment: Set 1, vector 63 -Key: 00000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AE92CD3DA2022DC9C91E381DA62D8FFA646FD02A1A5A3249AEAD35B729C48329 -Test: Encrypt -Comment: Set 1, vector 64 -Key: 00000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 111318C5C6DAE45DF4FAFF404AE2140300DBBF9361E926900F3ED7F731385A52 -Test: Encrypt -Comment: Set 1, vector 65 -Key: 00000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AA0DAA9A0025B5B3243367C7FC22F56F65A52B3CEEA060825C1FD2813953BEF8 -Test: Encrypt -Comment: Set 1, vector 66 -Key: 00000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 11EA951B966D0B3DF0D6AA00059281E6944CBB9921F84209265938CCE91F4910 -Test: Encrypt -Comment: Set 1, vector 67 -Key: 00000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DFDE0D41A657B700DADED5F9CB341481A0183AC1BB51291E8719F77251B478F6 -Test: Encrypt -Comment: Set 1, vector 68 -Key: 00000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A8A42F8E3C2BD71D415EF9FBDBB9DA86B32CFC24EBDADC656B7BFF17FC8BE365 -Test: Encrypt -Comment: Set 1, vector 69 -Key: 00000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1755CB48D8057669C488DF3A2296651F3FB64AA173DC6FCBD2C1113A084679C1 -Test: Encrypt -Comment: Set 1, vector 70 -Key: 00000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CEFD04E10B318145993C0AF4B4A64F623BCE0E04CE04E6D3DDE14EC6DFC0CDEE -Test: Encrypt -Comment: Set 1, vector 71 -Key: 00000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D9C83924493AE365C6369317A4393F904D530C1D30B2FD1A2E4126D0A532A743 -Test: Encrypt -Comment: Set 1, vector 72 -Key: 00000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9B8FC0A924382EBD28AA3F6871B17E1BA9C94418FC3533B446C2DE8C188EABB6 -Test: Encrypt -Comment: Set 1, vector 73 -Key: 00000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F91346BFBC0E05A4076B8CD5640E9DD278D4A7755A6D870565AC2A7E60A7F5AE -Test: Encrypt -Comment: Set 1, vector 74 -Key: 00000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 58D205808D4A580FF8111B9EF06BEE613D51E3B2E026B296F5E9F8520C7319FE -Test: Encrypt -Comment: Set 1, vector 75 -Key: 00000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 15D0C54FC35621B206A4A50EC3DADCEDFE4CCA17C9C5396A18901099A3389086 -Test: Encrypt -Comment: Set 1, vector 76 -Key: 00000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 48DE43EC8F644BCCFF61A52D93BEDEEBA38C71C196203A4A5AD9145416EFF31E -Test: Encrypt -Comment: Set 1, vector 77 -Key: 00000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 253057DA247A8D7A1B4A23E87B67D49669ADE1FE5EF32E08058F2DA6E82D1C25 -Test: Encrypt -Comment: Set 1, vector 78 -Key: 00000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6494B08A0B0CE628E34EC6D7EFBC436687D242131974789ECF20911C0CF16839 -Test: Encrypt -Comment: Set 1, vector 79 -Key: 00000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5088AC91D68173FE292A64D04D9A8083535649D44D7F00F23F389810F5F2528E -Test: Encrypt -Comment: Set 1, vector 80 -Key: 00000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FFF5D0D5296B0C3553DD43C429F51AF844EB6100E373A6A7A16B79A73392AC58 -Test: Encrypt -Comment: Set 1, vector 81 -Key: 00000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4A805BF70CBBAC2FACF405789FE96C4EF097D36F6982B843246C353E77539863 -Test: Encrypt -Comment: Set 1, vector 82 -Key: 00000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5F5F6828D3D2FDF24B4AC2F1F4080F40E9564CD8F9BAFC34E5567F96E2F057BA -Test: Encrypt -Comment: Set 1, vector 83 -Key: 00000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5BFAD855773EF036BAE365C18B6C5784E8BD4673514B0499E7ACFA38F7832927 -Test: Encrypt -Comment: Set 1, vector 84 -Key: 00000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B38604950FA73165F940D4DB527D09CD0B233276CD3808B5CADCCB9FA859AEEB -Test: Encrypt -Comment: Set 1, vector 85 -Key: 00000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B96570996489A74726A70C02CD55FB9D4C3ADE0B69FAE7C37899E3D560A5132F -Test: Encrypt -Comment: Set 1, vector 86 -Key: 00000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0B8612F83912A9EF1082E9D08C772738908BCCD20DE47D64ACA1500633163479 -Test: Encrypt -Comment: Set 1, vector 87 -Key: 00000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CCC75B4A84D08B14495AA8349B0AF79480FF6D0695561710AA16739A54504E58 -Test: Encrypt -Comment: Set 1, vector 88 -Key: 00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BC3F95A0CB0DCAEDB78E3D6E855267E34F3168C436774E28035D144406E803DA -Test: Encrypt -Comment: Set 1, vector 89 -Key: 00000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BD0A34B0509EFA39D9D091577FC4296F563AF5F3AF9E030FCC3661C0BD82738E -Test: Encrypt -Comment: Set 1, vector 90 -Key: 00000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: EC82DA0C15A50EB98E97532C509DBAC9C392DB79ADDC139F9ADC6091708CD726 -Test: Encrypt -Comment: Set 1, vector 91 -Key: 00000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7F164D165F7585E8306E38D44211325D0C6C177C523F13F69DB39DFEDF5BFD3F -Test: Encrypt -Comment: Set 1, vector 92 -Key: 00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 73F36AF678E74D413BE851E77F5E55DE1DD92D5237DBAE75E3AB6364D1F181DF -Test: Encrypt -Comment: Set 1, vector 93 -Key: 00000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BE25140C4E7804B22390822501718BE09E7F494594EBD2BCB35A36AC2F0CA095 -Test: Encrypt -Comment: Set 1, vector 94 -Key: 00000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 33171A271100D5CC5CF651ABF60977CD15B718863213DC243CAFA6CA86041094 -Test: Encrypt -Comment: Set 1, vector 95 -Key: 00000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 323FF7A80198298E438C833032CE609D4E6C5C107C9069E8B216080DE5C0880D -Test: Encrypt -Comment: Set 1, vector 96 -Key: 00000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D8FB3E266B96E48524159A3BE04CC85B3DB70F2FE649A01259E4FCCBCD3E7BAF -Test: Encrypt -Comment: Set 1, vector 97 -Key: 00000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 88B2171E37F3E861B6A69397BCC46044EABBC424E3359D11C96A62CB33F6C56C -Test: Encrypt -Comment: Set 1, vector 98 -Key: 00000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 96168ED95200986AFF506D3C2F043DFE03356345C52AD205BDC91423C6079824 -Test: Encrypt -Comment: Set 1, vector 99 -Key: 00000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4FDE2AD110847B5F4F2BD20CE5047913B12A682D119D9A8C8395B9958771FC22 -Test: Encrypt -Comment: Set 1, vector 100 -Key: 00000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F703282E54592A5617E10618027BB67F639E43A90767150D8B7F5E83054B3CBD -Test: Encrypt -Comment: Set 1, vector 101 -Key: 00000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6673138D1A64DD26CDD2F62CAB0BAB2318DE17507BAA307A189EC4997F9C3F89 -Test: Encrypt -Comment: Set 1, vector 102 -Key: 00000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 328B2F4069F398422D78E359F19938B8BFBC9E073C2162A0829265CFD48B89CA -Test: Encrypt -Comment: Set 1, vector 103 -Key: 00000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 02B14A28344C4164DDF0EDB594D581AE847FC0090EE6B933B8B8B91EAE90F5B3 -Test: Encrypt -Comment: Set 1, vector 104 -Key: 00000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 506221E93DBCBA6787757CCBBB0D5CDE9D06CFE3A23A8942A13C5B3849B2D2B9 -Test: Encrypt -Comment: Set 1, vector 105 -Key: 00000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 53A01AD91AE1C7F0DCBE19CF701A895E03FD866F77ABC7B174B327A0576D7719 -Test: Encrypt -Comment: Set 1, vector 106 -Key: 00000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B27AB67ACB784CB231A76D05B2539F0146F5C2F330987DE2C91AEAF8511DB9D1 -Test: Encrypt -Comment: Set 1, vector 107 -Key: 00000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 682263AAD3FF0B227983D20CB8A8B572427A2EE1B85A7FBB0961C722A7DE70CE -Test: Encrypt -Comment: Set 1, vector 108 -Key: 00000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E8AA0C754FBFB2BAF1025C8C13101552FA32E4031843E3DC56D2D819476CBFA6 -Test: Encrypt -Comment: Set 1, vector 109 -Key: 00000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7952391AEB6094458B28B543B9A5AC1DDB0CB18AEB431BE7CC7A4D45CCBEBEB0 -Test: Encrypt -Comment: Set 1, vector 110 -Key: 00000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 138599B1B9406E932D6229A4FFD959EE02E626022342FF233269A00DA1F58384 -Test: Encrypt -Comment: Set 1, vector 111 -Key: 00000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 87FA25FEBEFB539BFA46F9FAF8D62DB8E3C126D7409813A3B2FFC760FF19D390 -Test: Encrypt -Comment: Set 1, vector 112 -Key: 00000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 943B778E6053E3CBC59E9423A6D8AE678D369D5E27AB56D668DAD944D0A238F4 -Test: Encrypt -Comment: Set 1, vector 113 -Key: 00000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 00D31AA7620BEE29169C62966C53058F05709CD7C6A6584AFA80D7B2B7D9414C -Test: Encrypt -Comment: Set 1, vector 114 -Key: 00000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9A6DD9EAE3286D48A7548C0A8A4CE8FFFB61B362C95C897DCD1CB1D8BBF76DEB -Test: Encrypt -Comment: Set 1, vector 115 -Key: 00000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8231E89C8C74641DA6CD862B98B5DE749D6751B44361B763DF888F3D2312FAD5 -Test: Encrypt -Comment: Set 1, vector 116 -Key: 00000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AEE13BA9322E1089262CEB199FD96E8A3C1E29142C6542961CA0B70782A4FD65 -Test: Encrypt -Comment: Set 1, vector 117 -Key: 00000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 89EEFABFFF030B563CAA5965CFF0372E0518BA1BF9A6E07D279C20AF3D52B9E5 -Test: Encrypt -Comment: Set 1, vector 118 -Key: 00000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9EB46332AE8F271D9613A5FD1D6E1B06ED7A553C874A44A6F3A0615D46AA079D -Test: Encrypt -Comment: Set 1, vector 119 -Key: 00000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FDB79EB3D755AC9338093917F84742BB1D62197D9730AEFCBAA9B3A4CEEC0B5E -Test: Encrypt -Comment: Set 1, vector 120 -Key: 00000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 64D439442C3FB4B580E0C7BC212F5589B395F6D100AA8165E4599A34F288D31D -Test: Encrypt -Comment: Set 1, vector 121 -Key: 00000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 09F8A382936078076F496A14B7BFD77CF4E549171FBDD8106AD0C2F87FD9C151 -Test: Encrypt -Comment: Set 1, vector 122 -Key: 00000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AEB59849B6291FC1B8917642088608C4B9EE364C8C1FAE502F1ECD5BFACBC96A -Test: Encrypt -Comment: Set 1, vector 123 -Key: 00000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 006136B68224BF8BF47C0298FE7E2A4B72964A6C9F36EB709C452F0319B6A104 -Test: Encrypt -Comment: Set 1, vector 124 -Key: 00000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 55912F44A9A3493CF0A4DEF2F77978ECE0868ABF30BBAB15A96AFE15575AA90A -Test: Encrypt -Comment: Set 1, vector 125 -Key: 00000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 81BA612B664481588AB16246226CC1B59A08A7FE0FD64B0111C67C4BF344D2C7 -Test: Encrypt -Comment: Set 1, vector 126 -Key: 00000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6B7930B1609C35095BE581F8F73709A65781DC1D49381411F6474CEBE6D16182 -Test: Encrypt -Comment: Set 1, vector 127 -Key: 00000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7308AEC23D25A231B26448AFE78D5047804C5011B9B5F95C16DF2670551F0001 -Test: Encrypt -Comment: Set 1, vector 128 -Key: 00000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FBE855BD6540594E2D90566E7A30F57516EE170817B66C2468615D5D3D5DF03B -Test: Encrypt -Comment: Set 1, vector 129 -Key: 00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B072D598869D6EFCC8856A2B4686EF05A37DDB3F26DFEDA2F9C406B7250801F5 -Test: Encrypt -Comment: Set 1, vector 130 -Key: 00000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0CF58B2665B889C06836E699DC2B4C615106541987229D686D43614D3BFC290B -Test: Encrypt -Comment: Set 1, vector 131 -Key: 00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F591E78CE6A8A375CBF821D222A49C862A461DC52C74065BA6349598CC7CB6EC -Test: Encrypt -Comment: Set 1, vector 132 -Key: 00000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A32B883113DE96B7AFD4ABE8E1703C8D724397542527E27F0CA32C89332980D9 -Test: Encrypt -Comment: Set 1, vector 133 -Key: 00000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9B2C992F4CA0E70E0DDB03400AD24C4F20AD5F32940537B33F375C7979968537 -Test: Encrypt -Comment: Set 1, vector 134 -Key: 00000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0DDEEEBC428F117B094FD27B614F6BDFEC0D71D61F8F93F9A09E0443F2FEB659 -Test: Encrypt -Comment: Set 1, vector 135 -Key: 00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D58740E259B1C9A5DADD2FA5FFB768ACECD0DA6FE40D7D59F3CF6FCD4838FEDA -Test: Encrypt -Comment: Set 1, vector 136 -Key: 00000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E6F318C17501C28164BE9CA692E92D4CF4835E2778B126E9841CA0F132CCAA61 -Test: Encrypt -Comment: Set 1, vector 137 -Key: 00000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3776A0BB5880EB65386F20D11BCF308C2DA3B010F7E2DAF3FB8B55B523E7CBC3 -Test: Encrypt -Comment: Set 1, vector 138 -Key: 00000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3926539CFD76BB79E50A571D75AA51B94864A79CA5DCAF6CE451FC068E487625 -Test: Encrypt -Comment: Set 1, vector 139 -Key: 00000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A8D9B6254BCD0BC32CA3ECF7A7A80882DDC178F47D8E91F760883D589D94F45C -Test: Encrypt -Comment: Set 1, vector 140 -Key: 00000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A2C3810606AD6AAAA571C8A783A686E9F713D0A1238C3E621347622C569C7BB6 -Test: Encrypt -Comment: Set 1, vector 141 -Key: 00000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 902FF7C8DA5B1D171603F48C02E72B611C40E4B15F06BF4A7DB914AAA7E63036 -Test: Encrypt -Comment: Set 1, vector 142 -Key: 00000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 55AAAB17A700544B1384EA512146F65A2F871C30F8EF7AB84DD96E004E924403 -Test: Encrypt -Comment: Set 1, vector 143 -Key: 00000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E9F049D8DD032202BC5E16F061B0449AEFD91845A4786A045E35739826E283AE -Test: Encrypt -Comment: Set 1, vector 144 -Key: 00000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6347929B2B5B6634C2674CC4AD3B04B321F7404101E79259A35053E552369548 -Test: Encrypt -Comment: Set 1, vector 145 -Key: 00000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3C8D318014177555818122F69A95BED7A175464310A9B53DD4AF3C5887970D39 -Test: Encrypt -Comment: Set 1, vector 146 -Key: 00000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A3CE794DEA39A03EB4337395E3713ACA02E15148CC9302083E9F2FD55A921BF5 -Test: Encrypt -Comment: Set 1, vector 147 -Key: 00000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2EE444D85842D41D9AEFBB7ECE34EEB71720AFB04498F9B4CFB87C10AC842D3A -Test: Encrypt -Comment: Set 1, vector 148 -Key: 00000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0050EF8A2E0EAC79CD1BCC82F52F04410DA08263A320DA47B500DD72FBAA3487 -Test: Encrypt -Comment: Set 1, vector 149 -Key: 00000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 51721D61A2032DB004C8B83F7509B045A5190892FBC5AEB9BAA4B27D7969C791 -Test: Encrypt -Comment: Set 1, vector 150 -Key: 00000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 016D3D0A0C9B1EA97A12AB7BFA23BD4A973D5F10C06581A6DA92668BF3B4026E -Test: Encrypt -Comment: Set 1, vector 151 -Key: 00000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 687DAF7B782EB92EE2F8812ABA81A1F8EC353797544602A8EF2D2D6C1AC7EB48 -Test: Encrypt -Comment: Set 1, vector 152 -Key: 00000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 538008D0A4465A705313E0A03DE02BDFF7D9F0F0226F630DAFEA5434D9ADD7EE -Test: Encrypt -Comment: Set 1, vector 153 -Key: 00000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2F65E608EF3E4C202C347ADDB9733132350A7AC9E544C5D7D76F9527DB3640AE -Test: Encrypt -Comment: Set 1, vector 154 -Key: 00000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1EF33EF878790A6E16E18377C474700E6AF64C0C56F5FE8E7A1A83D990BB7B9B -Test: Encrypt -Comment: Set 1, vector 155 -Key: 00000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3369751D8735C5B82164E9FDFAA8B224AA4BD3FC2CD3DC48C60A1C290AE189BD -Test: Encrypt -Comment: Set 1, vector 156 -Key: 00000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 428F02228A58756A94871F5DCB37F54AD21345ABEDECB6D12630E51ADF4D6128 -Test: Encrypt -Comment: Set 1, vector 157 -Key: 00000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 521221AE0F51055948753BAC7A30394DA0F3DCB485364AB512E62D9CDC24FE48 -Test: Encrypt -Comment: Set 1, vector 158 -Key: 00000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7E44783F40C4A3EBB40E5D4E22A9BECAD3008D8B1AE64929B666664D8D8680D9 -Test: Encrypt -Comment: Set 1, vector 159 -Key: 00000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 48F54AE18072D2E58922EB0B14E4C32CD72807BF436A01164B0B5027ADCE6121 -Test: Encrypt -Comment: Set 1, vector 160 -Key: 00000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 671E9014ABC8FBBA21A307FAFF3FC7C89231ACA932F58C2D79DA323F80B3F87B -Test: Encrypt -Comment: Set 1, vector 161 -Key: 00000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4473A8EF3585DDC8AB5858DB58FD87FA42E724D2374D7888FCFA66D82B30145A -Test: Encrypt -Comment: Set 1, vector 162 -Key: 00000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A4AD8D6A847FF420E96E1E592852FC7B362F1E0DBBE417B0CFC80C1200C5BB97 -Test: Encrypt -Comment: Set 1, vector 163 -Key: 00000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B10D378FB56687BDDE7462A91FD0C42C773097765AC4C332B5007D1D47670EE0 -Test: Encrypt -Comment: Set 1, vector 164 -Key: 00000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 788D00A54C0A6FB10067E08B8F2C60B4DBA05B58D3C8CEEABE49C2FD2FD7D6C2 -Test: Encrypt -Comment: Set 1, vector 165 -Key: 00000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CC54D8465F9529077237703DF4DC136FCD7A9D2FF3B89FF0D226EA3B234B6113 -Test: Encrypt -Comment: Set 1, vector 166 -Key: 00000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A0DAF3D3568FA9134C9C1B6EC5137B72715271DEC644F1268FDFA88A89989371 -Test: Encrypt -Comment: Set 1, vector 167 -Key: 00000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0BBCCB3D83D7B6D3AA96AD5687C4895CD990146E293733A649B4D7EC48E9A93C -Test: Encrypt -Comment: Set 1, vector 168 -Key: 00000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DDF8388BA3EA8FDC869D54D38D6BFE47FB7C5B6D81B3D80AE8B7DE00F4581EC1 -Test: Encrypt -Comment: Set 1, vector 169 -Key: 00000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FF4F175CADFA435B31D5766FE6FE73B88B33BF5A87D79A2B47FCEB6BFE6E39AF -Test: Encrypt -Comment: Set 1, vector 170 -Key: 00000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9B28804310814CF3C9782CB23FAB7FE19D5BDA5E9553F23E7876A6426316365C -Test: Encrypt -Comment: Set 1, vector 171 -Key: 00000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 94831F56AC794746628AF8A0684ABFE6A1113EB5B95939A8223D5C0C08BF52FD -Test: Encrypt -Comment: Set 1, vector 172 -Key: 00000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 689C2CAC1FC6999B8BA48B767A995871D80AB561FADF20D8613274CFFD00BF32 -Test: Encrypt -Comment: Set 1, vector 173 -Key: 00000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4CC4412727B69CE43E6B85D89F03DAC6982CF867FB98801DA1F0E8720123699E -Test: Encrypt -Comment: Set 1, vector 174 -Key: 00000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8160A24A68E81E4A839E1C16086983BE98652856CC621B3F7612A8B1324FA33E -Test: Encrypt -Comment: Set 1, vector 175 -Key: 00000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 024B19F8BE7203D9E5589AB96B86BD68A488D7994813D0231C835637B9E59A64 -Test: Encrypt -Comment: Set 1, vector 176 -Key: 00000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 954714BFD736CB391604E77367C2875EF291C02EED35B6DD6A20D58FBADAFB84 -Test: Encrypt -Comment: Set 1, vector 177 -Key: 00000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6E95756FEA083B4AB4E624B5CFB00E31CAEA9C03CE4A1F51104BF6E7A86495F3 -Test: Encrypt -Comment: Set 1, vector 178 -Key: 00000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 93176B234B0A25F30649FD3172F75F181CD47C75D795FCFD5A537F18B101B24D -Test: Encrypt -Comment: Set 1, vector 179 -Key: 00000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 51637CD02F79DA935C5A317C1F8AC79E47E255E4A83F3F04DBA2998DF5118D39 -Test: Encrypt -Comment: Set 1, vector 180 -Key: 00000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 15C15F38B0CDEC62A426CF4AED25096DCCF1B2C7CF49A223F4D3ED7E06CAD2D7 -Test: Encrypt -Comment: Set 1, vector 181 -Key: 00000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 14520B3D7B8734A8D4E07CAB93744560D60FE7C9122C97F2ADB97D811074D225 -Test: Encrypt -Comment: Set 1, vector 182 -Key: 00000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F16ED0E9813C694563BF3557D73085C8761642B6B003291B31C681D3A9421E73 -Test: Encrypt -Comment: Set 1, vector 183 -Key: 00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BD3B03B8DF1994DDD3BE4509BB2B4AED0F7D0F7638102C58B15ED9DC9FAD5261 -Test: Encrypt -Comment: Set 1, vector 184 -Key: 00000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 45813D3ABF443D14B8519A10BA667F16C2EC757B309B978E26FFE56EE0BA00B1 -Test: Encrypt -Comment: Set 1, vector 185 -Key: 00000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A13D32CA09C34BBA16813BE8F4D56AF772B67327C7CDE0756B3D5CECEF2BCD2D -Test: Encrypt -Comment: Set 1, vector 186 -Key: 00000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: EC7D07D6F3AD0351131F15816F8044CBB1592324F62903B9DD6180D88E09EF07 -Test: Encrypt -Comment: Set 1, vector 187 -Key: 00000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 873F46936C8CC3A23CCA3EA3288CA070CC41F128296FCE6E7AAD2B7381BBAEBB -Test: Encrypt -Comment: Set 1, vector 188 -Key: 00000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0AF0BB23EFCF86B273A27D84435F53F9984183E4C0D2F69945E79BAC8674C3A5 -Test: Encrypt -Comment: Set 1, vector 189 -Key: 00000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7B9A8CD1942564414FE5C1237B680970A306CCB0CF73F1123D2E823D084F3126 -Test: Encrypt -Comment: Set 1, vector 190 -Key: 00000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C21A4ABA37069F7173A704B16C2DB945301BD4B08D3202BCBCA4AF8E5BA8A963 -Test: Encrypt -Comment: Set 1, vector 191 -Key: 00000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5B2F725ECF531E569AC6B69408259547B9B054CAAA20B6727FE7654FAE4386D2 -Test: Encrypt -Comment: Set 1, vector 192 -Key: 00000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 58E6E58AD73C9DA9A19CBCBCB6E89B44951781A027D5C5CBEAABD95D55BE1CDF -Test: Encrypt -Comment: Set 1, vector 193 -Key: 00000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8F076E12AB23D9CABFD006D16E1D554AB367CE88B3FDD44717824387DC9D4B43 -Test: Encrypt -Comment: Set 1, vector 194 -Key: 00000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C5A351191F18886099542CE6B3025D6F0F4EF8A9A1C804803166BC2699D4B3C2 -Test: Encrypt -Comment: Set 1, vector 195 -Key: 00000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 39BF10576DBE0BA332EF36C38CD96F4F0043B8A0C6CCCCD3521F169821CC4C0E -Test: Encrypt -Comment: Set 1, vector 196 -Key: 00000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 12EC53C9420154F7D5334D4BF94BE3B4CCB044FDF56B4A92E245F016BBE9C057 -Test: Encrypt -Comment: Set 1, vector 197 -Key: 00000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 569D436AFFBB65451ECFDDDC7BABD5608BC183E9437F30B5058C505158BCE7EE -Test: Encrypt -Comment: Set 1, vector 198 -Key: 00000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4E53AA49C4A8E0A00FA51E3DBE4D6BD6ABC1505C2E3FDADAC282BBDF5987E075 -Test: Encrypt -Comment: Set 1, vector 199 -Key: 00000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E0BF45509232C9F66517F057FB01C2E0E08906842B59DA4980413F629388C088 -Test: Encrypt -Comment: Set 1, vector 200 -Key: 00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CC5A42F9BBCD1A5BE0D8EAC69A184E1693AE5F1C9FDAA05B8CB5330D5D63A2C0 -Test: Encrypt -Comment: Set 1, vector 201 -Key: 00000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4247A5AA925AEAF29EA9FCC3C942DC47FB1A13213B302FE0C6F33243C631D2A0 -Test: Encrypt -Comment: Set 1, vector 202 -Key: 00000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DAC043890BB61728CFC30E3A860BFF9474DE05CA104C242BAF498344470319B5 -Test: Encrypt -Comment: Set 1, vector 203 -Key: 00000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 214703F986092730BDF01020A825628FD06CD22C9F385CE14BBB2738A38A1E94 -Test: Encrypt -Comment: Set 1, vector 204 -Key: 00000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AD3EED667396E27E4EF749BE1BC2D222380AA5C070B7246EB3A8249D9003BE1E -Test: Encrypt -Comment: Set 1, vector 205 -Key: 00000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 57B33C626E776BAAB8D655DD93125D49BFE92177BB63AA9902A44E4CC6F90666 -Test: Encrypt -Comment: Set 1, vector 206 -Key: 00000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3ABEB777D6240D198677B50B14545714D71D2F46885513688406B201F689C3BD -Test: Encrypt -Comment: Set 1, vector 207 -Key: 00000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0B9E5A4358BCD0CA1AF306274CA676B515499878D2ACA0AD7865139D36910018 -Test: Encrypt -Comment: Set 1, vector 208 -Key: 00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9EAB0FE92E1B83FAE87EF6369BD0EED91D10DCFC5810FA0188D06929CF927422 -Test: Encrypt -Comment: Set 1, vector 209 -Key: 00000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BC205D90F13A69AA6C45979861B1E5737A69C61F726D252F773E528276B9F1B7 -Test: Encrypt -Comment: Set 1, vector 210 -Key: 00000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CEB885427DF7C988804E7C2401BD703CBB8F3D3D50AFD6CE9F56D32F802F8219 -Test: Encrypt -Comment: Set 1, vector 211 -Key: 00000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C61CE53D0A5E771E6AC98830D496079A34ECE8967D737D0EBE393E7549679BA3 -Test: Encrypt -Comment: Set 1, vector 212 -Key: 00000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 842F934F9C3E9690F3AABC753B6C27F7F3EF7B199ABFDA287686F35E2884A2F5 -Test: Encrypt -Comment: Set 1, vector 213 -Key: 00000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: EE357FEC92355A11FDCE30B089E4F5918A90025832DB3562C762A8421F3B6625 -Test: Encrypt -Comment: Set 1, vector 214 -Key: 00000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C9CC50B7CB29557DCDC64C995B24D2E0E8AD8FBB4906A8DF06D67A69B1AAB8A6 -Test: Encrypt -Comment: Set 1, vector 215 -Key: 00000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D6DE0F6B51BCBDA8D44D7EEA5F91C85B78F42B6612A35662CE3AB3043E87701D -Test: Encrypt -Comment: Set 1, vector 216 -Key: 00000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E3F3E3A5317DCBE044E1A97CAD714449DF0F8E9C319F5C12C19917B2F47F1FD7 -Test: Encrypt -Comment: Set 1, vector 217 -Key: 00000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3A1A26993055B3B30BA84236212646D2622680117D2813316223EDFFA1BBB22B -Test: Encrypt -Comment: Set 1, vector 218 -Key: 00000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 192EE13F6909D98437E8F424DE7DC873D82330DE64B379F3F8985658B00033DA -Test: Encrypt -Comment: Set 1, vector 219 -Key: 00000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DEB92C0159D40548317AEAF996819352F43CB1E487885A0851234A43E4C5CB2F -Test: Encrypt -Comment: Set 1, vector 220 -Key: 00000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C671DF68881157258EF58E7C7E712351FC9D743A2C4ECAAC9D3ABE98F9701B3C -Test: Encrypt -Comment: Set 1, vector 221 -Key: 00000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7A8BA935035DFE8F1DE34EA373FB60E147E6D5572686212BF95B6E0C115D15B8 -Test: Encrypt -Comment: Set 1, vector 222 -Key: 00000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AA95483043360A3CCD5E98C8D5088F9F7154DA3E36F517C459F03B94EA8B5DCF -Test: Encrypt -Comment: Set 1, vector 223 -Key: 00000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F716EF1B45585282C50AD6EB1EAD2D19AFBF57235E5D56A015882C55EECC2044 -Test: Encrypt -Comment: Set 1, vector 224 -Key: 00000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CECA215484E90CE7AF49BED4B5F84543D05CE120973EE8510E0A410FA391BE3F -Test: Encrypt -Comment: Set 1, vector 225 -Key: 00000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5AF45DB110A67D0CC49D1A1BB5765ACDDD6482BD88664A4A511BEB8DCDDC08B3 -Test: Encrypt -Comment: Set 1, vector 226 -Key: 00000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E0AFCA91B3CCF0A0C4E332C4F75BC17E5956B0F3A438F0B0ACA0E9B08DA9A1C0 -Test: Encrypt -Comment: Set 1, vector 227 -Key: 00000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C559C00EB5C49F2321975A264F855C291DB8FF942FC4617193236318D55DA27A -Test: Encrypt -Comment: Set 1, vector 228 -Key: 00000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 88BCDD04989FE085F888A57176463662C57DC70DD3888F427B68BD5A36C3297A -Test: Encrypt -Comment: Set 1, vector 229 -Key: 00000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3C6302F9C2C8997C41FA0F0187B9E19D14FC2196A001D39F56BF5200E76D4F66 -Test: Encrypt -Comment: Set 1, vector 230 -Key: 00000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 641DA3FF9CC2C5AD625FD131D91E1AE5AD3088DF404384BD885917FD1AFDB9AB -Test: Encrypt -Comment: Set 1, vector 231 -Key: 00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1A05DEF28E631857C796D665FA66F8A4743F9A340904EC1C084AB022E63E3A0A -Test: Encrypt -Comment: Set 1, vector 232 -Key: 00000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 04DF8F3469AFEA2F63ECA1FA64FC18F1E42B42F7666BDCBFE6CC1C68614D85A7 -Test: Encrypt -Comment: Set 1, vector 233 -Key: 00000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 21AA974CF45CF84383024A8E7D3427BCD9A0A4F4B2AA83FA44911615B2D9A27E -Test: Encrypt -Comment: Set 1, vector 234 -Key: 00000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 74533E9973B565E0B7F9DB65A63B70BC5840EE4E1B6D927033CC1F733BD78AD1 -Test: Encrypt -Comment: Set 1, vector 235 -Key: 00000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E818E22E590974A00FBF40C1A1DD100F5C2E3A76C594D129DDE0C9119CC1A836 -Test: Encrypt -Comment: Set 1, vector 236 -Key: 00000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 00BEF3BB9263863455A8736A114E7DF13C903D6D9FE065FED48E6634EE9B9156 -Test: Encrypt -Comment: Set 1, vector 237 -Key: 00000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A0D418EAA61D8B6234D8B07D4652F61EDA48B00764E124DE5D7545973E4BFB0D -Test: Encrypt -Comment: Set 1, vector 238 -Key: 00000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 21472EDC58EB9D2EDE5D8A24DE18784500420820C388408E2D09C8935D3208CA -Test: Encrypt -Comment: Set 1, vector 239 -Key: 00000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 278849105940CFDF61AB8DF9A37427A24BD452C244988E7CE85B8FF94A913F71 -Test: Encrypt -Comment: Set 1, vector 240 -Key: 00000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7B35DC73EBA6408C2486D59ADA0A17B89ADC10E405E029E51B8FA7096704DF23 -Test: Encrypt -Comment: Set 1, vector 241 -Key: 00000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D81FC2305382B4110925F4EEEE6C93C3356B30F4E083B47C0FFB429DC8A317A5 -Test: Encrypt -Comment: Set 1, vector 242 -Key: 00000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B1CC26F822DAA8B4EF2DC5C08792C21A985D285697C9BC49E038331996F2DE35 -Test: Encrypt -Comment: Set 1, vector 243 -Key: 00000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 565635B8CF39652AD3F94F9658FBF2310A08DC25975102D9E0A658574E5437C6 -Test: Encrypt -Comment: Set 1, vector 244 -Key: 00000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3A9E77725182484E375528415C99C9BB2795A0841FD9F7E7D2DDE20A6CD71C04 -Test: Encrypt -Comment: Set 1, vector 245 -Key: 00000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BD3F45893A96EF8C218B3C22079E64BF847F3C41D87F1AC68E62B32E5A59D350 -Test: Encrypt -Comment: Set 1, vector 246 -Key: 00000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 44BBB67723B8FC5778D18FFA60F1A7DF16F2A4583BA07E3B2A9A4286765AF743 -Test: Encrypt -Comment: Set 1, vector 247 -Key: 00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 06198963CE32DC41A3869CB3893E1602D21EA64DD206C2DEA9FA79F756260BF8 -Test: Encrypt -Comment: Set 1, vector 248 -Key: 00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 82EA3EC56648E3152D541EA5EA76F9C1D12A373D5183CFFDBC49C0FCE25AC9BA -Test: Encrypt -Comment: Set 1, vector 249 -Key: 00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2D6F44E5104C9A6B28DA5731FE95AD5ED73051B4D405FCB77D2845A3306CD9EA -Test: Encrypt -Comment: Set 1, vector 250 -Key: 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 360DF8BA5BA3F245E4751C6B1D81CCCC7160D6DE8CB12B496DEF04A78B0D3DD6 -Test: Encrypt -Comment: Set 1, vector 251 -Key: 00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BE0B2DE97E0528C5A135A81F2DA7431C8BF01A456411CB826F1205A9E57A44D2 -Test: Encrypt -Comment: Set 1, vector 252 -Key: 00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4CC729EFC23033F244182FBAE629ABF4386CDB279C6394C7CC914724604D8736 -Test: Encrypt -Comment: Set 1, vector 253 -Key: 00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BA44E9372A4EDC847FE6601F0DDBCF40864B2BB5C4EFF9B3038F7EAD6672907B -Test: Encrypt -Comment: Set 1, vector 254 -Key: 00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DF3109ACA9E8546F5140E6705EDD69EB5512F0C5B3567D6EE132700820839B77 -Test: Encrypt -Comment: Set 1, vector 255 -Key: 00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D909866F49103120A46CD4F2A98B2A2169E3E9AE7BB5AD36CEBD675F62B73018 -Test: Encrypt -Comment: Set 1, vector 256 -Key: 00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 63081A9DE55FA28CFF0089A3D4A52568BFC0D3A172B1750180A91BA12EC3E38A -Test: Encrypt -Comment: Set 1, vector 257 -Key: 00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7FBD9ADE476739C69CF906B611639D554ECF25BA26AC87A11EF30856DE890D28 -Test: Encrypt -Comment: Set 1, vector 258 -Key: 00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 495FB031327D3AE9CCA3F449E73571539EF9FD88589B5C3142F5A4461CAFF9F1 -Test: Encrypt -Comment: Set 1, vector 259 -Key: 00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1E958BF17F89DD463B49BDE9B05D01DC2557DC4CE072C24D0527E45BA1C8026C -Test: Encrypt -Comment: Set 1, vector 260 -Key: 00000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 92093F21E7CFDCD81765E71ED960121F84C6FE1CDA50B00592ED0DB9A8808FFA -Test: Encrypt -Comment: Set 1, vector 261 -Key: 00000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 122E0C5E19B0636ADE10F1A14FF4CA69EC426B4F311C109F6B137BEE274B1912 -Test: Encrypt -Comment: Set 1, vector 262 -Key: 00000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2CE82AD1BF9BDA86355188CF5605CEAB73E98BC617CDC3D5C8598F11BA96F6A5 -Test: Encrypt -Comment: Set 1, vector 263 -Key: 00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B14A656DB71E54DF9D443E899417FF4F79E033106AA34D8669EEF0E9918FF4C7 -Test: Encrypt -Comment: Set 1, vector 264 -Key: 00000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 47ECD5C02C3D702FC36817981781B1A4593E240773121F763EB788D46E990C5C -Test: Encrypt -Comment: Set 1, vector 265 -Key: 00000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 91B74FC5E6FC8C6C30F33CE83BC0055190373FC589C0516F248227531C6B853F -Test: Encrypt -Comment: Set 1, vector 266 -Key: 00000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AC8F0393E6D8881EFF753E7CE47EC441106AFE1315E712BB439F2F2DD4318670 -Test: Encrypt -Comment: Set 1, vector 267 -Key: 00000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5765316B484E3091FB5135ECD4A5356293BD87512688EF14C719B61857767E1C -Test: Encrypt -Comment: Set 1, vector 268 -Key: 00000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FAD76A9798E8DD194095DACF92F83779DEDA70C413033DADEE55B4C94B98B426 -Test: Encrypt -Comment: Set 1, vector 269 -Key: 00000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 87F337C9D5763F38C679C5EB9A67F72B4581487ABC5ADCD5BABF4C71B5EB6F7C -Test: Encrypt -Comment: Set 1, vector 270 -Key: 00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 526B4C3E3FE096F47D32A403A7D20EE269A42F68939B2FA8254A1812D9EC6069 -Test: Encrypt -Comment: Set 1, vector 271 -Key: 00000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 342C0D2D0A5048DC98F2E8CDBB84CC610E30BEBC12F7572CB416CBFCFA24039D -Test: Encrypt -Comment: Set 1, vector 272 -Key: 00000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 47D03635744E2D917F799F77A7E09E6F064CE224A4A1D507090DBE200DBD022A -Test: Encrypt -Comment: Set 1, vector 273 -Key: 00000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0DCE2CCCD9628DD4F6552A020B9447D35DEEFCFE5D8CDD8223AB3BA9090D8141 -Test: Encrypt -Comment: Set 1, vector 274 -Key: 00000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AC5622C3DDECDB0A46F796596ED595926B2783E6A884D18517F7344CCAB3A2C0 -Test: Encrypt -Comment: Set 1, vector 275 -Key: 00000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 80E59C358DC6F0B5749FEAF45A9BE7F884842839EE6B47024083F52A8636C2A6 -Test: Encrypt -Comment: Set 1, vector 276 -Key: 00000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8E57504AD8F6DA6D8633D413362E961A6D69B18FA1B501DB846080A5A9C9C700 -Test: Encrypt -Comment: Set 1, vector 277 -Key: 00000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4956C679E9B58DDE2185BB018A7D6C61C918FA0AA9D6102E7DEF1183DB768FB1 -Test: Encrypt -Comment: Set 1, vector 278 -Key: 00000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2C25F9CD0DB2444EE43D0AD2C3AF0303D1487528F45AFD346617D164F80635B9 -Test: Encrypt -Comment: Set 1, vector 279 -Key: 00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5292E96CB2110AD3FD231C5B2BCD1A8986333787664D1A551B9B750B2AA39A11 -Test: Encrypt -Comment: Set 1, vector 280 -Key: 00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D189129077C79106AEACA4E3463FD0650AC493ED981DC252531C072F18E1E292 -Test: Encrypt -Comment: Set 1, vector 281 -Key: 00000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F9490DB8BAE36E28E73419D1D57869D760D772DC8752D1DE948262755B4ED503 -Test: Encrypt -Comment: Set 1, vector 282 -Key: 00000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 994EB2D9BE7C9FD547426F295F15DE3BC8F4A2B3955C7028ED890B1DE0FBE21C -Test: Encrypt -Comment: Set 1, vector 283 -Key: 00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 464BFD1EB42B595AEF9700C7C4C184A2132B5F1E85625592E48A233FA7840EC3 -Test: Encrypt -Comment: Set 1, vector 284 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A097C32D58D5A932AC9DBEE942DCCE547222E37E97DC3B29A63AAF118D5B01CF -Test: Encrypt -Comment: Set 1, vector 285 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D3D13CC4379D2817B8CF8E06312FC727A3BA3C58F96E478E4EC5BC7BAEDDCDE4 -Test: Encrypt -Comment: Set 1, vector 286 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 577C709C26BD52547BD7C0D3F9CDEBEC0F266178905C4C067B75A01D799EF910 -Test: Encrypt -Comment: Set 1, vector 287 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 08FCEF6A263916C53AEBB6CCD2623E7BA3C38C871C5A8B64106308B74A7AE1B6 -Test: Encrypt -Comment: Set 1, vector 288 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A22F794F4913B2B1CD930FA26EC219081F297DE4EC808771C9B375782F891D67 -Test: Encrypt -Comment: Set 1, vector 289 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 52F2C9714DAD06FCF5FD8962131D33952A6D68C2A90B8C08C3AB86B09A2C77C5 -Test: Encrypt -Comment: Set 1, vector 290 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 60BDED5533E692A9F073AAED43A5D5A81378E73A953514ACD5B0997B61848E3E -Test: Encrypt -Comment: Set 1, vector 291 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 38921BE2443A8101FBB44BCB4C5B87AB5026AA34C78B7FCDE07E102E142B6162 -Test: Encrypt -Comment: Set 1, vector 292 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D49C075CC20268EE889A10E27F2D4EAA99A1764F765621FE97687ECB6067E5AA -Test: Encrypt -Comment: Set 1, vector 293 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 50FC6782B3285D35117C0FA81039A7F264FC4EB492F3B86A233D45F2834F153A -Test: Encrypt -Comment: Set 1, vector 294 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1CC0B39D670A88D424F5D40B2F9256AF3736689BD82F0EB315AC9056F7EC63A0 -Test: Encrypt -Comment: Set 1, vector 295 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CF66C3CD4B08CB0E4D25186BF84BE3AAAB1C435F07D12593AD001F70894030FE -Test: Encrypt -Comment: Set 1, vector 296 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 352572656D0EB6E0CE604C1A913ED733D465A480504B61B0F9BBA77122FD20D3 -Test: Encrypt -Comment: Set 1, vector 297 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 096E9F34E6E277EDB994954C3705F6904452001D3A3E799A1D0230D430E207D7 -Test: Encrypt -Comment: Set 1, vector 298 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 277BC612F90A6D0735B86168C021098F134D1627D0FEF38607038415D1BADF84 -Test: Encrypt -Comment: Set 1, vector 299 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2376E2CE884AEC093E22A3C119D573609225FD5DC9B3EB7602C340D1AB51BDF2 -Test: Encrypt -Comment: Set 1, vector 300 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3EE2E39ADB49F92D09D55ACC817B5B2F22FB202951AEFB6DE8998D2932145669 -Test: Encrypt -Comment: Set 1, vector 301 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E508313113570BBB5A1E63F46AB52B57ED0676A061936F093961D34409F1B962 -Test: Encrypt -Comment: Set 1, vector 302 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 198A9A0A5B04AE936CB19E02A5B2A254A2DD5A4D71F6C676C0A826CD261CE8C0 -Test: Encrypt -Comment: Set 1, vector 303 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: EFEB9C3D34865B89275EFB9DCE1929697FC9E68ED9E9E32E2CF267DE57388E77 -Test: Encrypt -Comment: Set 1, vector 304 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 61016E27DF83D9DE642AE01D7D56C4BFE881C8BDEDD15C503BDC28D3F7107754 -Test: Encrypt -Comment: Set 1, vector 305 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2FB5FDEC05BD94EF5A7F0DEA7A368F7C2B26ABC5789FEAE7B7B6A5E6C364041C -Test: Encrypt -Comment: Set 1, vector 306 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F765AE08A03CF705D4BE6A6AF8A34CDE7A14F599B2CB7E2FCF2770F0CFD4F7AC -Test: Encrypt -Comment: Set 1, vector 307 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D38105C4DE4742F16E6AE7C1C3C85A515DA8BC758456E4B5D64C0539B76D473B -Test: Encrypt -Comment: Set 1, vector 308 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BFE3A705729C82DDE1297DF492A8F8ABAFBF2F436830B3716FC206D6931BBFEF -Test: Encrypt -Comment: Set 1, vector 309 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B81E7CB312AC5FF0A1795FCD4AD8B3D84FE6C8B796584DE794B7E230823E6AF0 -Test: Encrypt -Comment: Set 1, vector 310 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 605C8D477420CF7D8218CB8A6B3624700BADE8D1384B04995F3C942DE38ABA6D -Test: Encrypt -Comment: Set 1, vector 311 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 87A3F6DC69A7675F27CD00D7A84251366CCCA92775D680EBEBB48B92A5781D7E -Test: Encrypt -Comment: Set 1, vector 312 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 71625BD75BF6A89C643553D382B325EDACCFB4BF5F1617DED0C44BAB96A9F72D -Test: Encrypt -Comment: Set 1, vector 313 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: ADF64E64C1A8D854C421F5AA8CCBE789F3643B0D769A2CDC68D7C3AC85FDB634 -Test: Encrypt -Comment: Set 1, vector 314 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3C1AB3A3A85B1EEAA057557DBB59FC28479B38BEE67F4CDA0CD49880DC15ED0F -Test: Encrypt -Comment: Set 1, vector 315 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 026071B93A8B85F000539539626BBF664273EA701B63D487208962F8CC14F1DA -Test: Encrypt -Comment: Set 1, vector 316 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 61EC580BC31488BD8993C9B9D6B430BEBAE04F9807F199808CF05B0B4F083F9A -Test: Encrypt -Comment: Set 1, vector 317 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DF9093A33937B0B3ACAEAC1840C8E1358CC90FB0B6C0834D4CE4F442830127B7 -Test: Encrypt -Comment: Set 1, vector 318 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5683A2E768F9E105E9ABF7B71DE48833367D19E961D9D95577D2C4E48716EE9E -Test: Encrypt -Comment: Set 1, vector 319 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1D33978B4B75C10ACB850BBD98BB2CCB31F7D6F561E34AABAEB929C2F7762219 -Test: Encrypt -Comment: Set 1, vector 320 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6197C557619E4B791888DFD695B4BF55B7F72258968E26B9B74A6A3814267DD2 -Test: Encrypt -Comment: Set 1, vector 321 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9AD5C65433732C4ABF08BAE9015692F509775FC0450677CB1E76A060974B8807 -Test: Encrypt -Comment: Set 1, vector 322 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 44AA2FB88757EA695083CE00105D5B77C2DCE04EE1315D99040A1495E97EEB42 -Test: Encrypt -Comment: Set 1, vector 323 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9C637BA9B011A62B15BE522D6C514092358222CDB01A2A35B895B1E57DF1303B -Test: Encrypt -Comment: Set 1, vector 324 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 21774A71C07FC295C4BF477A512445B2AC9AFD6619DCF0124CBD735BC823F945 -Test: Encrypt -Comment: Set 1, vector 325 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3D74A1E781FEE340DD9D912F6A681F85C0EF78BAE81D3E50A5DB8A311057DCB3 -Test: Encrypt -Comment: Set 1, vector 326 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5B851E24E32EEB5BFAB09D26E86BBE4DA23C43C8E88635413516825D1F56DC43 -Test: Encrypt -Comment: Set 1, vector 327 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E79FAFD3076C0F879222F86A0671104F350B115A6AC107F5C66BB673CB047948 -Test: Encrypt -Comment: Set 1, vector 328 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5E8EBDFCEF4F70640695CF76FE7912F5E77F55095F0A3EC15CE692AED2C7312E -Test: Encrypt -Comment: Set 1, vector 329 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 99EC9D6724631EBC582C22B1B002C8F63B386EF1A96A9E4D162F698F3EC13944 -Test: Encrypt -Comment: Set 1, vector 330 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9DCF4937F7E089B09AF8F441538E2577E315212AA56EB20209F040BE602509C3 -Test: Encrypt -Comment: Set 1, vector 331 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 063CE595D4EEC463726FDB74E5254B5AFB965D2729D02F1890E70E33C4C7AE49 -Test: Encrypt -Comment: Set 1, vector 332 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 18F5B3F2F2B54FF37C354F3181228FBAA7D337791671988801C19333165EAD35 -Test: Encrypt -Comment: Set 1, vector 333 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 912671C8099032B1C0AE139D8F029B153B22B999DC30170DAAE3904CBDEFF083 -Test: Encrypt -Comment: Set 1, vector 334 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CAE46BA93F81E1AD26A8FACE45566E162B8F4CAE831B4B80F93D2A809D3C557D -Test: Encrypt -Comment: Set 1, vector 335 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 31708CCF07D82433A61053273FBC5543BAA1A73B836624FF092361E55631531D -Test: Encrypt -Comment: Set 1, vector 336 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B5F46BFA7B367DCE7998428525483F775D8F5F1A8DB9F7E3EB848F887283028A -Test: Encrypt -Comment: Set 1, vector 337 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1D1B9489F66B8FDC1902C02CE15E94727352C2F6A302C12A6F9672BC44014F6F -Test: Encrypt -Comment: Set 1, vector 338 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8EDD86FA2225D954B3F9F57A0433ED692E99F7ED55EF0A8D112468AEA58717A2 -Test: Encrypt -Comment: Set 1, vector 339 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6F1414CBA350BB5DF73F7B23FCC0859BC2F081374BD4FBA7571DEC9343BD939A -Test: Encrypt -Comment: Set 1, vector 340 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 84535A21BFDE843B9E70AEEC9E5EB915FCEFF57449B7872142AA0669EFF250BF -Test: Encrypt -Comment: Set 1, vector 341 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C4CC653F5CFA6C13C4693967D4CD1398B8808982F0C1D6D9B4CC9A6FCAF41E8B -Test: Encrypt -Comment: Set 1, vector 342 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0949688EEF8CFBB88589CAB3EF58912A2C413E413EF122BB7F4C0E17BF723E71 -Test: Encrypt -Comment: Set 1, vector 343 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AFF2976C45A69940BB88C71381DAEDD767BAF454331FCC5666624EB052CE05CD -Test: Encrypt -Comment: Set 1, vector 344 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A7D73428AA840EFCBFF0C856409C9B19CBDC19BE376EBC75DFC008A6BC9EAB37 -Test: Encrypt -Comment: Set 1, vector 345 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3C59AA18035D96933FB938DE0331DBE42DA57B539A77D660DBFA12B62611760A -Test: Encrypt -Comment: Set 1, vector 346 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1F982024A86CEBEF27F0D19765907131C5EA1385761E92C7432D55A118AF2FD0 -Test: Encrypt -Comment: Set 1, vector 347 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5D5CE5B2BCEC679BEE0B894E4E0FD2E5ABD345D8F8061A02BD4B1873C3A9B612 -Test: Encrypt -Comment: Set 1, vector 348 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 54C62940FC9BD4D96A0D19CE92F6880B5F45A422DF0400E868020ED5B42BC287 -Test: Encrypt -Comment: Set 1, vector 349 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6A7B7E894CB7FE3A0153B5CC6E78351A07AEC726CCAF93A2C426C83760974035 -Test: Encrypt -Comment: Set 1, vector 350 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D2DAC7485B1818A7A2976F164C80AB5FE47B7CBDA4048000D09DAC65857A8387 -Test: Encrypt -Comment: Set 1, vector 351 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7C545CC73456F1C1B06C5B5A05A9659F5D30A4D78E9D85C29A38735BEF098E0E -Test: Encrypt -Comment: Set 1, vector 352 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7E3FA28ABB96C7CFAC0DFAFA5BF2E469D75ECF690FA876F3307D851D3CF0AAC4 -Test: Encrypt -Comment: Set 1, vector 353 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 46FFBA6995D7D6A2B58AB5F995AE3A305CB0385242428FD092FE777556AB05B5 -Test: Encrypt -Comment: Set 1, vector 354 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 052E5126AEDA420CC39EEF255B816BD475DBD36635B090D04C43410F40236BE2 -Test: Encrypt -Comment: Set 1, vector 355 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 80BBBFF3EB0CE3976503A85240226D7FE177B4F30C753F081D7E1F3F8F0FC176 -Test: Encrypt -Comment: Set 1, vector 356 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4A748837D0A7950876ABC89127A6D6FE5B646C7FE9DF8005CBBC3832DFE488EF -Test: Encrypt -Comment: Set 1, vector 357 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 84F35DFA249674C24E6DFB3947E3F3475817DF9548B301D4741B79EF9D26629A -Test: Encrypt -Comment: Set 1, vector 358 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BEC48DE878DD3533F3614B3A0A4BDF5FB34DBA96AE94508FC0D3927032CC6E61 -Test: Encrypt -Comment: Set 1, vector 359 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 80DDDED6AF53DB0459359FE311F32C5DFE85F281C45365BEA7A2D6BA8A2D5EA9 -Test: Encrypt -Comment: Set 1, vector 360 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 43BA1E833A673FB760B13DA40C509EBB7170CA05E7BD2728A7FDA0EB8E3020B8 -Test: Encrypt -Comment: Set 1, vector 361 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 917FDDD2206E751DBAD9BD2EAA3E1FDD7C6CFC7782367B563DE6E116D0E4A3B9 -Test: Encrypt -Comment: Set 1, vector 362 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3AD03FD2841A7C8E8BA49100FCA794DAAF29995A9CDCC6D4F868914C890C3BFC -Test: Encrypt -Comment: Set 1, vector 363 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 79A9305A48A10F739B06EBD24DAACBF5289ED6A83415021DB1CAAB542E417DDB -Test: Encrypt -Comment: Set 1, vector 364 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 195DA96825A0F6B94A71E2EDD934FB184F375EEF66411567815A4A6E966CAC0C -Test: Encrypt -Comment: Set 1, vector 365 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 513239A738978DE007138E83F5CD13A0A9BE374CF61B09021767CAE284D5510E -Test: Encrypt -Comment: Set 1, vector 366 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6BC70608C85D884873CDE727CF2B8A4E9563DA58242C907A3E87C2608AC0F1F7 -Test: Encrypt -Comment: Set 1, vector 367 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F47D47E5D0013BF10141C7BF92642E4CCCF8020347B59F1FAB145849EEF0A2E1 -Test: Encrypt -Comment: Set 1, vector 368 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 879D4097A300F6575BC2021F218E9AE9FED113AF9B4FC9179C621244A9E2A090 -Test: Encrypt -Comment: Set 1, vector 369 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 91EF2BE82D9080A366AC7C4344E457E5F46DA5BD54DD50C97D2910D1478BFA21 -Test: Encrypt -Comment: Set 1, vector 370 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0EED2315EF9B9278CCAD8EE2E33493F5A4FDAE31EC1DA863C017E8AEB77C2867 -Test: Encrypt -Comment: Set 1, vector 371 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FE80FF0F839BE1F911A21C97B36D439ED66F9965293890D98D8A3A98F2CFAE1D -Test: Encrypt -Comment: Set 1, vector 372 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4E241C22B26385E268F868E37873C36B173625048DAAE4ADE3C2E09D856A8AE9 -Test: Encrypt -Comment: Set 1, vector 373 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 71DA83DEC321D3160433BD8E2C2345921A6505444C9B1949B4D6CE400F1FBDBB -Test: Encrypt -Comment: Set 1, vector 374 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 21FF7AA748E96269211F129671E4F7A25BC55D92A144B7BEEB75F445FDCCDDB3 -Test: Encrypt -Comment: Set 1, vector 375 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 070290F0A10324414DCFD323822ABD2256ADDA0913FEDC70EA53F3F88EEB7AB2 -Test: Encrypt -Comment: Set 1, vector 376 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A112192AEDC7824247A9239BE92E45928416D086FEA09D4370DDFE862493AF4E -Test: Encrypt -Comment: Set 1, vector 377 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B0CD1E1BF87C1C63C455C8A285DF739A85706A587CDF0726C4615590DD25BDDE -Test: Encrypt -Comment: Set 1, vector 378 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F5EBFED2EF7706C5DEF09E94641FDA500100F500E431C601C879CC65CE260DF6 -Test: Encrypt -Comment: Set 1, vector 379 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 02CA5B7EAA7F906B706DD5B13A6C121927EAE22FB51C7259A781A916C5906E7D -Test: Encrypt -Comment: Set 1, vector 380 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 10569B20052606FEEB9956C2882702477F1D48F82B09C0BE1C97C3150F5F7D1F -Test: Encrypt -Comment: Set 1, vector 381 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 95C649C5B1ADCE59BE93F701C01D815D7A32D151179FC1B6610B3A2A98EE1295 -Test: Encrypt -Comment: Set 1, vector 382 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7E1DD644C151A0C1055E0AEB7A9DBE80BE09CCDE6C69797D00E7B391A6311D1D -Test: Encrypt -Comment: Set 1, vector 383 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6A82511AEBE5A82B6392CCA180B10F77FF0C14A7CF8CED894E1C8EDF9BAB29DA -Test: Encrypt -Comment: Set 1, vector 384 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AD05B4B2F644469BCCD1BE1D028B1FB26F270088E56D8B73364F958730B0C9D7 -Test: Encrypt -Comment: Set 1, vector 385 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8B4110E53906CBD07EC61AC8DC8C97C475085AE6AE6418C45CAD7495B2C2F4A9 -Test: Encrypt -Comment: Set 1, vector 386 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FC44F97B9B3791B98D941B460C585BC7A485024F2B15370605FA64BEB36F10F6 -Test: Encrypt -Comment: Set 1, vector 387 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 95E1B79F255E9E477D756B0123F22397C723D63F3D6AC710A1647E5D6229AC25 -Test: Encrypt -Comment: Set 1, vector 388 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 523D59EEA567CAE613403BE8C8769E9E375F290D7FA2DFF64C9B41120E96F0C0 -Test: Encrypt -Comment: Set 1, vector 389 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DCD843BF9123A86C9938CB833C815217E37325B4ECF9A43E8E878ED2CDB257E3 -Test: Encrypt -Comment: Set 1, vector 390 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4D737BB7B6B2EA155FA64CAA9124588594AD9D3239B03A0B5F1A1670EF37C309 -Test: Encrypt -Comment: Set 1, vector 391 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D884858B07B3ADC2AB0067E24CEF443AF6D3CB691C7D3EDDFAF672763DF6991F -Test: Encrypt -Comment: Set 1, vector 392 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 24923E668BA92F02D0545738A1F3A81AD3EACC6F3E65A3C6879FEB3D55C3BEF5 -Test: Encrypt -Comment: Set 1, vector 393 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 98006EC6FFEE6DC3FE9D53FC632D1D82E8DC5BCB0BE0BBF1782701F858934432 -Test: Encrypt -Comment: Set 1, vector 394 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1C7CD45E2FDF746F2F6B7FCE3510DD14CAC7420FDA6BC9C6D3287E894D2B9EF5 -Test: Encrypt -Comment: Set 1, vector 395 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DF1B2CD5A9A7ADC85A257882E53150F9B3BAD4B5EFEEE8B4B212F8FB08F11194 -Test: Encrypt -Comment: Set 1, vector 396 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5DF3202330B96E2C8D45284BC1D8CC34C076B18600495EC43F847D09B9AB08C2 -Test: Encrypt -Comment: Set 1, vector 397 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CEE878EA6317D3B4E2CC695FCCC5EE04B7415B735F2D11B9A8891293D5D5E818 -Test: Encrypt -Comment: Set 1, vector 398 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3753BC3550155B6880CF1AAE6365FA5EA4F277B4E01FD26133A5C69F5620AC9F -Test: Encrypt -Comment: Set 1, vector 399 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8FF623E4246D8B7D14904BFB478256CA55EBD9E383B672A91D512AFD606BA629 -Test: Encrypt -Comment: Set 1, vector 400 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C823B856B5E462FAD71A1D9C8F02CE1FE48650BD53BD620D021ADB1C53C21B84 -Test: Encrypt -Comment: Set 1, vector 401 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 22D0CD94534D8DCC359095D77008069E57851298103A13ACB50BF6FA778CB9A3 -Test: Encrypt -Comment: Set 1, vector 402 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 413F7657C9E46D928AE307FE794D1B10FEEB433D7F829C66118E155227F811BD -Test: Encrypt -Comment: Set 1, vector 403 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 12A9E9ABCC1916594307C982852A6750FFD5D9DCFDA261EC54C2D465BBB0FB64 -Test: Encrypt -Comment: Set 1, vector 404 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: EEB4897AEABADA871D368A00748CB437801933D78A14687EDDB3D526BBC2BFF7 -Test: Encrypt -Comment: Set 1, vector 405 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2444A95492348F7AB5C8EFE89839C6491833EF227637640F8199262DA70E5406 -Test: Encrypt -Comment: Set 1, vector 406 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CD0F1C806CE40D9901A04A23B52BBCFF51D20E964BA2ADCFE9AEE7CC8FE4A3B5 -Test: Encrypt -Comment: Set 1, vector 407 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 30E58CD115B75139A5D2ECC5253F6467FDEF4DFA307D11132570F90E657BC254 -Test: Encrypt -Comment: Set 1, vector 408 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 563FF22D971BDFACD7A90EDE80F076126CB16A759FDE6DB83E0DEE71CA48F33F -Test: Encrypt -Comment: Set 1, vector 409 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D235A2277B7D3A772C3D092D2E3D92248865EFED8C2577D3D087C5BE84891667 -Test: Encrypt -Comment: Set 1, vector 410 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3CD74A025D1C2044875FE1D97351608E0203CE65F2EB283633505AFDC3C6393B -Test: Encrypt -Comment: Set 1, vector 411 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FDAAE4CA8FD698D4330AD8217D40C8368AE9A825BE3359CB881FA74315ADA4DD -Test: Encrypt -Comment: Set 1, vector 412 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A9BBBED3051D1EB40AA806CF6505EBB4A0D3BAE671AFA03BD2586B01ECC6B9AD -Test: Encrypt -Comment: Set 1, vector 413 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 468AC86525069F4A9F1F7036BB2FC3D042296707B9FE8328C9514DA52FCBBCC2 -Test: Encrypt -Comment: Set 1, vector 414 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 96498A45E45E26AA2A1DD58E7374BCDA71420627B332F94FE98E045251B432C0 -Test: Encrypt -Comment: Set 1, vector 415 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 36FB6B4DAE5EDE9971BC2F5A353A3D5954961D9C8F7D38063A9F8556881F1E1B -Test: Encrypt -Comment: Set 1, vector 416 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4206BEA972707980637FCD2B990F2B8EAE3243C9178487047B1A9BE2C7F6225C -Test: Encrypt -Comment: Set 1, vector 417 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BF2763F46F4EF8CF40E42B6E4F161785D3478BDD1EA0BFAB30763B98BBC64720 -Test: Encrypt -Comment: Set 1, vector 418 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E7B97A297B534B1842528055982B7C382CFFDD161D69725789BF0CC35339D0A8 -Test: Encrypt -Comment: Set 1, vector 419 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F8E68E206729EDF06C9379DC6F87891FFB6D5DD75A040D4F0E17BDF28308E6E0 -Test: Encrypt -Comment: Set 1, vector 420 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DA69958998715C7517B9864E3A81F5960A48E9071FEB047084683D95A8532751 -Test: Encrypt -Comment: Set 1, vector 421 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 99456A498166535817F3DD3B47696CC74777ADE25DFA5CB5A3DF1A47DBCF0F17 -Test: Encrypt -Comment: Set 1, vector 422 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: D2D061B7FEDCA0663FE8F738042D1CE7D0EFB3BCED73977087FAB06192A361C1 -Test: Encrypt -Comment: Set 1, vector 423 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: ABF4E053FD99A777A5C95F057A1D8D3BC433D212220FE2BD5074C7E7B4AAA636 -Test: Encrypt -Comment: Set 1, vector 424 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 335F971AF070B59191F61547DC555F2AD86B263B23AAD53A80D6DA0C8A73C6BB -Test: Encrypt -Comment: Set 1, vector 425 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C2EE398458AD869FCFB5DBAD16CB66F2CDEBE8D9D2C0FC4B258553D7D648E281 -Test: Encrypt -Comment: Set 1, vector 426 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 659BDB67C3BB43D43CF53EF14411F9B5B2B3C8C9B961087622BF1F0412596D81 -Test: Encrypt -Comment: Set 1, vector 427 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 21E2DA7422F753B1B625D95BFE5FD1C52CB5DFEDF0F2662EF17416E44F671525 -Test: Encrypt -Comment: Set 1, vector 428 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C14725058665DCF8D701BB4A3DD5490DDA85E2754D9B233C008B5FC3559837B0 -Test: Encrypt -Comment: Set 1, vector 429 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BF0D7F94DF1C7CA59CAF588BEDB316CB4E31A578B76C1E5213EB663C0E850F97 -Test: Encrypt -Comment: Set 1, vector 430 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C81ABCB56C58DB2D5A329C6777091857DA4A5CBCB9D05AD6B0D4A2D4E915A7F4 -Test: Encrypt -Comment: Set 1, vector 431 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F9D7611F502D0CED242909E032173BAF5A43DAF7009F53E25E109D7F4FEF9981 -Test: Encrypt -Comment: Set 1, vector 432 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4EC0E7F808A10BFD4676E5CCA67E1D48806F346B702B2827810487EE56907C71 -Test: Encrypt -Comment: Set 1, vector 433 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 34C183C96FE5D9D2B4ED564EE9726551B27E1AF24848B5D711503E88BECBE458 -Test: Encrypt -Comment: Set 1, vector 434 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3E5EA6B326751B501C91C4A575B0ED6AEA9D60A14908187ACB3FC145B5468131 -Test: Encrypt -Comment: Set 1, vector 435 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DA3904568BC8844CB594F44FE13F5D663B55EE6995D2232A999D591F2FCE7812 -Test: Encrypt -Comment: Set 1, vector 436 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9293ED1C3C5B1A91B54A43BC63603F2EAD345EF9A7D3E69BD955EF1B8D36FD13 -Test: Encrypt -Comment: Set 1, vector 437 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 65C5CE0CC96FA6085A23EF00299B6D8518673DC9B8BF764DB595A8A7F8E940C7 -Test: Encrypt -Comment: Set 1, vector 438 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: EF95E25669CF4079F8BA728F41BD115F2913D8CFE0116C86032CD133E4787011 -Test: Encrypt -Comment: Set 1, vector 439 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7860315B44671B93718FEAB94BBCEE6B1006354914A90C3BF2DA1B6FA62F48AB -Test: Encrypt -Comment: Set 1, vector 440 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2AA9968D7011FB1F33B97DAD01C2708A6826C030AFCCA35B222B2E47C89F14E1 -Test: Encrypt -Comment: Set 1, vector 441 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CA9DD4F0771447B9AD0664DDA2921192568C2012246CCF5E95CD6CF3FBC44DCA -Test: Encrypt -Comment: Set 1, vector 442 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 38D51B18372FD7E7A617D7BCBCC658CB16014B05ECA242AF52B40AEDF6952DE4 -Test: Encrypt -Comment: Set 1, vector 443 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 640D035CFD65FE70D089866A53F21D00F86FDB1CEE2880F9FA7D382D424978A1 -Test: Encrypt -Comment: Set 1, vector 444 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B41B62EC90FA9CC037F1BC74AEED25226917DD3B2B2E5C11EC6AE7601CF3F0E2 -Test: Encrypt -Comment: Set 1, vector 445 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A4340A36C7E640C83D2401AAE6F9F103BC9B568EF5B7F67663E64B820974B235 -Test: Encrypt -Comment: Set 1, vector 446 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CAEF6FE59B0C05DDFE4F233412A185038077B7138EE9BA5FF4815C63C2BE84D2 -Test: Encrypt -Comment: Set 1, vector 447 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F5D76FAAF12F566711DAAAC0E1F71260354FBA7BC0DBC34D7A2B6FE8E19DC672 -Test: Encrypt -Comment: Set 1, vector 448 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DB1B22D80BD5BEA8D3F5F445E296FF3506C98C6FAE617D6C8DD943BC535AF864 -Test: Encrypt -Comment: Set 1, vector 449 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DA02BA2C706095D3EB008EFFEB5E501FFF78B59EC34CBCAF0D7CE82268CCAFBA -Test: Encrypt -Comment: Set 1, vector 450 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F878759262E5C2BA6CBC2091406D4045F876767C475582965B185DC9437ADD1E -Test: Encrypt -Comment: Set 1, vector 451 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: CA268715277F1CABC2062D4EDFD667759829782F793715199EE172917DA35C5D -Test: Encrypt -Comment: Set 1, vector 452 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 01BACD8388BF42064C8E927B3629C0DA82A0FEC4883EC068DC48483C43512BC5 -Test: Encrypt -Comment: Set 1, vector 453 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3D782388FD4ECBFEBBD49F2FBCF80A687E4CC0B8FEF51F097DEB679F49CB8B06 -Test: Encrypt -Comment: Set 1, vector 454 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 392E11AF1FD4A97ED260B680930C95DF26679260EAE0C025C405CDCDBC8E810D -Test: Encrypt -Comment: Set 1, vector 455 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 10E6AA6CAA90220E6D8963837D9EC3D46F8E9679379345282573753F2093E0F2 -Test: Encrypt -Comment: Set 1, vector 456 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E3EF5E9644294206A5707EF83C54E5EF5F4DB9841383C3EB767DEA722E9B7D0E -Test: Encrypt -Comment: Set 1, vector 457 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0EDD01B5FE46475139F14371B548B58C5E33830D6EA6864BFBAB36D25345F8F3 -Test: Encrypt -Comment: Set 1, vector 458 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7DB72BFBC00A04E38DD4B9F2EA5C0114D19B2956EB959BEAD3E29DFB9BFC9A2A -Test: Encrypt -Comment: Set 1, vector 459 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7DB561AF481CC8B010BFD18A0216E2554888BBDD4E90B00476809B48601C9306 -Test: Encrypt -Comment: Set 1, vector 460 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 4EAB74E6D12574BCDEF95BC0CAD67C7E04B24472431607EBAD5F915F1116C9CB -Test: Encrypt -Comment: Set 1, vector 461 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5A48DE560FA1ABF0F85BFF9A0A1928020A6C51AD3FE7C1392C2A875401DE62F0 -Test: Encrypt -Comment: Set 1, vector 462 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 074956F37AF065DBEDB2D68C602A4B65B7D614F8A0B284539E234B307CFDC495 -Test: Encrypt -Comment: Set 1, vector 463 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9BB4837A582A5CB30579DABEEC41ACCB3786AA9BE52DDC88065BE0FFD33917EC -Test: Encrypt -Comment: Set 1, vector 464 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E1E690D74FC254D1D2A8238096285CC100013E8A8BB55FE92F6DF69DB217773E -Test: Encrypt -Comment: Set 1, vector 465 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: DFE35C2BC6ADFEBE4D9E8F84160AD6315CA43F0F022DDC629106E008F29C81AE -Test: Encrypt -Comment: Set 1, vector 466 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 8106B2FE206F9F8738BEC324B531E6943F00B20EC35DEADCB508197EEEBA5473 -Test: Encrypt -Comment: Set 1, vector 467 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E46E36293B659E73FAA1722AF29651621598FF2E92694C99F7BB0C792B93BAB2 -Test: Encrypt -Comment: Set 1, vector 468 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F3CAB9F84AF81A06F9F350C345B44E053C8F1EE36D62159B4993950BB76D0948 -Test: Encrypt -Comment: Set 1, vector 469 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E3381C1644BBBB29290D30F15C96956BF4AEFE443FBDA0DB3EF2CEE7081D1DB3 -Test: Encrypt -Comment: Set 1, vector 470 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A4DD97D2710285907527C4FAE5676774D937FEC609F8489A16384568FAAA699F -Test: Encrypt -Comment: Set 1, vector 471 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 43C608E43584C631E620672EB0A92707C396ACC12CBCE0810A28F7EA3491E0A3 -Test: Encrypt -Comment: Set 1, vector 472 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A1DC3C2AE54BB2FA291913562F05E021AF361E422D39C89D8CFDBE4B672B63ED -Test: Encrypt -Comment: Set 1, vector 473 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 890CB43DA15A1D69A10EA9322B8C14D61AD537462439A735472CEF9428C8A2D9 -Test: Encrypt -Comment: Set 1, vector 474 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9119548582EB7EA7F4AA1B224A6825B786F316EAA7AAA18B61B56D64AA4CBA29 -Test: Encrypt -Comment: Set 1, vector 475 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 574DD7CA20662ECBC730FA7CE314094E427FB8250E0F636894B650DA35A7F0CE -Test: Encrypt -Comment: Set 1, vector 476 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 3575DEA861D0F97DA32438DB834020996820BE85EAE5ED15A7983A31C7669C70 -Test: Encrypt -Comment: Set 1, vector 477 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 27EA06CBD196073357F1F790191D14796FE2BEFBE18B8C48D7566528B3DDA4C6 -Test: Encrypt -Comment: Set 1, vector 478 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 11B190730F6EDE90C8B3FEE01E722ADDD21BEB4324A358F86F524E4B7F7AF975 -Test: Encrypt -Comment: Set 1, vector 479 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 07E3CDB5130D8FF7A2A31335AD478FEF10805E266C00646CFBBEE81F2B3C1711 -Test: Encrypt -Comment: Set 1, vector 480 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A0ED0FFEEBCBF4066EE550E63065B08569B92BCC938002A5469ABD1C397233A0 -Test: Encrypt -Comment: Set 1, vector 481 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2C9CDE299A4C507EC03C617EACE2358E76BC1AD338FE5A66A9105F18788A8836 -Test: Encrypt -Comment: Set 1, vector 482 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5163F9C4ECECD047E83BDF1D6EE233487646A96FE43B4B08C41324FD8ECB271B -Test: Encrypt -Comment: Set 1, vector 483 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: AA2AE4BF506AB3D7607A29C3EF90B4C7933EE58ED3AB3720817FE3C611A850AC -Test: Encrypt -Comment: Set 1, vector 484 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B04B4C802D91D9ADE76EBAFCDBA0A96A8A83DAEB7069370D6E901A42291EB8C6 -Test: Encrypt -Comment: Set 1, vector 485 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 91A99BC40CF38388B4AA77798D720653492CCED5230382ED587A305A2A1A6BCF -Test: Encrypt -Comment: Set 1, vector 486 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 91FB386F3B9AF82F93836005CBD9ED6727B9BBF1F669EAE6D06DA6D04D1AC082 -Test: Encrypt -Comment: Set 1, vector 487 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 01F8956120BF068AE7241BB96FF086C2D67547B549A8743FC0569978F201678E -Test: Encrypt -Comment: Set 1, vector 488 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A8C562A616F918A669A29C0724B76E3D04B125E0AB5A09E8CE60F54E4816EC90 -Test: Encrypt -Comment: Set 1, vector 489 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B41D3BC188419DC929D611197D17FB4D29B78CD7FBC03B904219DD8A2FEE210C -Test: Encrypt -Comment: Set 1, vector 490 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B119861B67AFE45C0134E2336CAC90BAFD1EB94C557EBA6DFDCBE69367B37981 -Test: Encrypt -Comment: Set 1, vector 491 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A2317FD4C041AF4D87C46FC684FBEE8DB65E4D43E5EA74237988A7EB67404656 -Test: Encrypt -Comment: Set 1, vector 492 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 641794C292A1A590F909D01F175E012671AEBF1E432295AED662E74C1EEA5DD4 -Test: Encrypt -Comment: Set 1, vector 493 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7984AC47362281DF446BE46AEC5D9A94B842F6F5BCCB01FD564318A49F94042C -Test: Encrypt -Comment: Set 1, vector 494 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 74F84174C9E2EBBEE396727DBB1C9CFAE2809D802F7E7CF8F7515FA3A629ED98 -Test: Encrypt -Comment: Set 1, vector 495 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7A9E862E27444A492C91CA2EE5E93369FEB74BB881AAC74F895D97E61500FA99 -Test: Encrypt -Comment: Set 1, vector 496 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 638E347CEC7121A668AF985E56F7F3934D852FCF53283B767BAC213337AAE99A -Test: Encrypt -Comment: Set 1, vector 497 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 45DC398895DA1B415708B4BC8B7EF133849E0E8E99945AE4D9C894FDF6D2815D -Test: Encrypt -Comment: Set 1, vector 498 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 1ACF1203B698FE2E3375E251EBBC05D387FECABDE6A9194DF5195F3FBF1E3502 -Test: Encrypt -Comment: Set 1, vector 499 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F6A064BDC6EE0777B09CC1A0154F28AD282D4D6E48F9DE11CA083B8A9F454891 -Test: Encrypt -Comment: Set 1, vector 500 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: FE68FB721E181EA8A62CDD3CA0278C6EB1344DF07E73676D3F0DC501D99721C3 -Test: Encrypt -Comment: Set 1, vector 501 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 72923AD92EF01BDB90B9639DD411E4540CE0F531A0AE401547FBA03CB850B63A -Test: Encrypt -Comment: Set 1, vector 502 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0B1D0F485A4DE59658FE61F1F0010D9EF5A2BA97624CC3687D94EE4335777138 -Test: Encrypt -Comment: Set 1, vector 503 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7423264FBF5EA94BA461BD80B2518B1CAF3757CF5BAB4511144637F5DC917168 -Test: Encrypt -Comment: Set 1, vector 504 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 589FADA29BEA438C12CA96241AA492FCFED48C1C1C05C16C88CD7A8B46E16A0D -Test: Encrypt -Comment: Set 1, vector 505 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 319B5D23945A98C9480E6460CBCB86A8B36038A28500A36182B228060713F58B -Test: Encrypt -Comment: Set 1, vector 506 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: B81B723D3E18A074078B7D041E55B9B130953ECF70BF773273A28E11238651A5 -Test: Encrypt -Comment: Set 1, vector 507 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E660AC40BC4700D4CE85AA43A2A39A24D0F255E64A9251D7442AEFB6EDFD43A8 -Test: Encrypt -Comment: Set 1, vector 508 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: C27914CB70EA29C06B321E4F61730CE6679A342733738BE72C97EED40802EC17 -Test: Encrypt -Comment: Set 1, vector 509 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 764B78FA0EC12E017D9F7C69FF53FA8FA00E7185888F36DBC3CA9A10A6122FBA -Test: Encrypt -Comment: Set 1, vector 510 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E2F9F554823B38D2099DD27E0AD6AD69BE137626840B41B7CF081D7881C47CC7 -Test: Encrypt -Comment: Set 1, vector 511 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 403E453BBAF997A75C4517B588431C75BCF01208B378A4F4FBB138217A9CA4A2 -Test: Encrypt -Comment: Set 2, vector 0 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 8000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2CAE7C0460EE2FC3200923A1B6C2ABEEA746C8B44F6C3FB941BD3AF02A3E6E3E -Test: Encrypt -Comment: Set 2, vector 1 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 4000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 45FAAFBEE792EA704EE3D08CFA9D9F5CF93FEB3443E0049DE5898A48F5A3D92B -Test: Encrypt -Comment: Set 2, vector 2 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 2000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 720F072E7796310AC1BDDD3714581EB95896723DA3E61E0892B43F65A4153965 -Test: Encrypt -Comment: Set 2, vector 3 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 1000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5E6671D1F792673D63940E69D78A3471B3C150707DA72E6C25CBD2C4DA2B9778 -Test: Encrypt -Comment: Set 2, vector 4 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0800000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 2E96F027C2B62ED2D2EE692A992ACAB827D16FDA71DD98109A645E4094923D3B -Test: Encrypt -Comment: Set 2, vector 5 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0400000000000000000000000000000000000000000000000000000000000000 -Ciphertext: A38D7F334B21394B28A29FC9CBC68AD9F2AE85E7434D1C2F57AAA4C1A49DB759 -Test: Encrypt -Comment: Set 2, vector 6 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0200000000000000000000000000000000000000000000000000000000000000 -Ciphertext: F67B5037CE9193023095D43DE312523F99E6CBCDF43EC00A947284496E311DD6 -Test: Encrypt -Comment: Set 2, vector 7 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0100000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7DC030A91C39EC8558AC10044AF79D4CCA92BBC8093B3A2456E26350E35EEBDA -Test: Encrypt -Comment: Set 2, vector 8 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0080000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 99260425AA126953E04A3D959F9153404521EC64C3B35E61EEBA67AAD2C1295A -Test: Encrypt -Comment: Set 2, vector 9 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0040000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 65C380354899581B2B40EDDF40A0695FB608DCDD11C6B0C2CA6BB427DB1D2A9D -Test: Encrypt -Comment: Set 2, vector 10 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0020000000000000000000000000000000000000000000000000000000000000 -Ciphertext: BBD1C4488D41FB1B096E835AD29FC3DC5B97496BA638625D78B99C5ABBDFA13A -Test: Encrypt -Comment: Set 2, vector 11 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0010000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7AFDEE496D690233ED0717E2D92DE3A102FDF902E51E69FFCE244B84A69CA826 -Test: Encrypt -Comment: Set 2, vector 12 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0008000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 06D8C3E7AAC698D143013B364BD7ABC4E4EB6BA82BBAB2A4A0B486E70E24592C -Test: Encrypt -Comment: Set 2, vector 13 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0004000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 727A8BF64932039C3409ED31CFC0171651BA69D551E8073A4BD1D35F31F52336 -Test: Encrypt -Comment: Set 2, vector 14 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0002000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 9EE7CA05C4161860014BEA89FB2DED90B4F0B362AD67789C6045C9C71310A8AA -Test: Encrypt -Comment: Set 2, vector 15 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0001000000000000000000000000000000000000000000000000000000000000 -Ciphertext: E924224559E43960EC44165CAD471CFED381B279B3EA4AF96BDB071BE987DA0D -Test: Encrypt -Comment: Set 2, vector 16 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000800000000000000000000000000000000000000000000000000000000000 -Ciphertext: FF189222046B5F4FB491CDC9A98130D772629F3EF44A06894268C507C25061AF -Test: Encrypt -Comment: Set 2, vector 17 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000400000000000000000000000000000000000000000000000000000000000 -Ciphertext: 6B053BA7765F2A62595A1E83444B52FCF16C8BBBEB21B437E6FC8C5F03B3673F -Test: Encrypt -Comment: Set 2, vector 18 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000200000000000000000000000000000000000000000000000000000000000 -Ciphertext: 0FB836DC6BCDA1C2955CC7A6F25E72C5FFFDE1075D820217157051FB5BD3D3EF -Test: Encrypt -Comment: Set 2, vector 19 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000100000000000000000000000000000000000000000000000000000000000 -Ciphertext: 200EBC8B8217D9A6895253F9366543027E5F493DBA1A5AD4FC7AB66FB806308E -Test: Encrypt -Comment: Set 2, vector 20 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000080000000000000000000000000000000000000000000000000000000000 -Ciphertext: 45B33F2465C674941B7E26C5986E42F6814A71323B420E401DCC8DA200FC3C08 -Test: Encrypt -Comment: Set 2, vector 21 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000040000000000000000000000000000000000000000000000000000000000 -Ciphertext: D2BF0A074053A01A227DC439311BF8BD696203995285A3A2CD3674A0CC6A65B2 -Test: Encrypt -Comment: Set 2, vector 22 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000020000000000000000000000000000000000000000000000000000000000 -Ciphertext: 5FFFAB58BA2CB27AE92E10F36F99A8EFEDF9DE2446A9C2E82E48F22FB1ED8C5D -Test: Encrypt -Comment: Set 2, vector 23 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000010000000000000000000000000000000000000000000000000000000000 -Ciphertext: 835A1BD7A3688BA0F7C572417A06FCCBCE0A69C7FCDF10C8BCF4469AE80DF11E -Test: Encrypt -Comment: Set 2, vector 24 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000008000000000000000000000000000000000000000000000000000000000 -Ciphertext: 559D1BECB3DBBE40A7E31C66D97D292821B934818172553FC1CE68AD8E6A741F -Test: Encrypt -Comment: Set 2, vector 25 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000004000000000000000000000000000000000000000000000000000000000 -Ciphertext: D962BE9A9C4F8DDA6F0EC42DB8B48FA14A1E91E639BD85FF26A2543D9FDFA9A9 -Test: Encrypt -Comment: Set 2, vector 26 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000002000000000000000000000000000000000000000000000000000000000 -Ciphertext: 588B2319C62ED25ECEAB7C327B212F5FCD5D89DE8A85AA3713BF332CF5F715DF -Test: Encrypt -Comment: Set 2, vector 27 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000001000000000000000000000000000000000000000000000000000000000 -Ciphertext: 67EDE571C64AFF87D7AE5294E64F1709F920A10D278E1629FC8B2BE7EF5ABE0D -Test: Encrypt -Comment: Set 2, vector 28 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000800000000000000000000000000000000000000000000000000000000 -Ciphertext: 60D9E58A6828847F9644DC165EB508B5A2BC67219B969B605B3CFAE109C9CE47 -Test: Encrypt -Comment: Set 2, vector 29 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000400000000000000000000000000000000000000000000000000000000 -Ciphertext: 5A0C538CB78F13404BF8D8AF5C43A17F04AD0D35DAD45F88E26B9D1C204B5AFB -Test: Encrypt -Comment: Set 2, vector 30 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000200000000000000000000000000000000000000000000000000000000 -Ciphertext: 724EE8B7D7BCAC2587C42D92FFCDF7EDFF91F06AD43ED353F332E1FAC3B70F5F -Test: Encrypt -Comment: Set 2, vector 31 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000100000000000000000000000000000000000000000000000000000000 -Ciphertext: D50F11DACBF340C1315419D1983028DCED83F8350FE50DA4F9554DFA641E99E1 -Test: Encrypt -Comment: Set 2, vector 32 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000080000000000000000000000000000000000000000000000000000000 -Ciphertext: 9460ACD1B739015ED197B2659353AAC465339FAD9D1AFB845A337630332C1C55 -Test: Encrypt -Comment: Set 2, vector 33 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000040000000000000000000000000000000000000000000000000000000 -Ciphertext: 7D7A56F8A89463C4CE519B96854200C6E05703651CE3ACD5549B59D0B9788B93 -Test: Encrypt -Comment: Set 2, vector 34 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000020000000000000000000000000000000000000000000000000000000 -Ciphertext: D07E4F830ADF1DE4886C614CDB6B3D988884293AE65A63B3E9886A8727C022B2 -Test: Encrypt -Comment: Set 2, vector 35 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000010000000000000000000000000000000000000000000000000000000 -Ciphertext: 56CCEC1812B3B83086208DBF0C98119DC1CAE316E91B09F4F6F36BDCF73F8873 -Test: Encrypt -Comment: Set 2, vector 36 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000008000000000000000000000000000000000000000000000000000000 -Ciphertext: E8C3012B0EEB2D18DEA4C06BAC2906DF858BFB8A4D86D6841C02A9E45B2D0455 -Test: Encrypt -Comment: Set 2, vector 37 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000004000000000000000000000000000000000000000000000000000000 -Ciphertext: E10FB90CB2F5F830763FCEFA386A8E70052AB8994A55DC95FEDF8B71E11D2636 -Test: Encrypt -Comment: Set 2, vector 38 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000002000000000000000000000000000000000000000000000000000000 -Ciphertext: 848DFB81A0D4D13A40F9119AB77A3B6D2B96E76396B39984739FDF31ADBC376F -Test: Encrypt -Comment: Set 2, vector 39 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000001000000000000000000000000000000000000000000000000000000 -Ciphertext: 61068A490E20E07686D8A77B81718A3214508E3FE3DA6A6BBAA8ABD67B98623F -Test: Encrypt -Comment: Set 2, vector 40 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000800000000000000000000000000000000000000000000000000000 -Ciphertext: 9197E2A5212260324CA6E6FA0BBA56B4E5D9934C8B9E42D9F43E901C0994082C -Test: Encrypt -Comment: Set 2, vector 41 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000400000000000000000000000000000000000000000000000000000 -Ciphertext: E9DC3C1445CBFF1B863CF3FB6B338B4EC29F2C083E65A4BBCC2F1FAC22CCA8DD -Test: Encrypt -Comment: Set 2, vector 42 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000200000000000000000000000000000000000000000000000000000 -Ciphertext: 80039358C99E64A255D5E4E334C830FFEC8E0CBF2EB6030DE7DCE1A938821938 -Test: Encrypt -Comment: Set 2, vector 43 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000100000000000000000000000000000000000000000000000000000 -Ciphertext: E508D93429BBE95EE38672A2F653841701F391C68235391367F16415C2C84ADC -Test: Encrypt -Comment: Set 2, vector 44 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000080000000000000000000000000000000000000000000000000000 -Ciphertext: 710463874DF68B8930CC5CD6A00ABA2BCE27352997F2582EF472ED5F5AFE75A8 -Test: Encrypt -Comment: Set 2, vector 45 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000040000000000000000000000000000000000000000000000000000 -Ciphertext: E90AD04D26F4FF6D25D193CD2C34A2E1C6A1E570CCC705B873CACC94E61F79A7 -Test: Encrypt -Comment: Set 2, vector 46 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000020000000000000000000000000000000000000000000000000000 -Ciphertext: 8E19B69D55C9A2B2CCEACB50EC8007F39C81A0F261A8568D1298967C132BB790 -Test: Encrypt -Comment: Set 2, vector 47 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000010000000000000000000000000000000000000000000000000000 -Ciphertext: 4051E2FA9032676DC6E11CE947C64C9A0C0FC262AA41F40FA0C4093D1E4FA924 -Test: Encrypt -Comment: Set 2, vector 48 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000008000000000000000000000000000000000000000000000000000 -Ciphertext: 5DA6F415CCDF1A2D3335A0BEBB879D88CB9C871744111004C0E5AA6D27EB0311 -Test: Encrypt -Comment: Set 2, vector 49 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000004000000000000000000000000000000000000000000000000000 -Ciphertext: 684C24EC1DD06F6B565890190BE1F8BC7F4537CF5F9CF038ECB6D1D86164503A -Test: Encrypt -Comment: Set 2, vector 50 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000002000000000000000000000000000000000000000000000000000 -Ciphertext: 6D259C132726524987D4FD96C1ECD943D6B87BB98C61C4FFE41E282EC82F246A -Test: Encrypt -Comment: Set 2, vector 51 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000001000000000000000000000000000000000000000000000000000 -Ciphertext: 14707F80CC43E4E6321362B0ACFF84FE57E9D477B56637D01CAA09B232D726C5 -Test: Encrypt -Comment: Set 2, vector 52 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000800000000000000000000000000000000000000000000000000 -Ciphertext: FE98609B71F9CD65CD377C98BC4117EC8708E58D15361F9CAC02C64F0452B80D -Test: Encrypt -Comment: Set 2, vector 53 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000400000000000000000000000000000000000000000000000000 -Ciphertext: 1B78E77F935EBA86B28C9B37818245E2865AF84A73C9DAA735E42E6009AA07F3 -Test: Encrypt -Comment: Set 2, vector 54 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000200000000000000000000000000000000000000000000000000 -Ciphertext: F354ADD75ED9E121B1BFAD9483C6825AEF57BAA2DF08B519640E022E196B313F -Test: Encrypt -Comment: Set 2, vector 55 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000100000000000000000000000000000000000000000000000000 -Ciphertext: 7E0D7DCC0642CD5BF0C39460C4C183E5F321BCAB5EEA0AC7021E1AECE423E2A9 -Test: Encrypt -Comment: Set 2, vector 56 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000080000000000000000000000000000000000000000000000000 -Ciphertext: D1CCBD3EEA6ACF918569BEC2C900723B4359CA19C58E32ED65FDCBAA30A41C98 -Test: Encrypt -Comment: Set 2, vector 57 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000040000000000000000000000000000000000000000000000000 -Ciphertext: 361246D37645483C6D13C6500326694A0D577604CDF7CD36586B6C7F96FBE077 -Test: Encrypt -Comment: Set 2, vector 58 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000020000000000000000000000000000000000000000000000000 -Ciphertext: 0BC890CF369C233EDB99A51CEC75BFF60FB36BFB3EC15F253054F8865CB16DFF -Test: Encrypt -Comment: Set 2, vector 59 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000010000000000000000000000000000000000000000000000000 -Ciphertext: B5ED5183A00C882F8D213AFCE35C14E940407B7C2A8C9A5A19F289AED42DFAD7 -Test: Encrypt -Comment: Set 2, vector 60 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000008000000000000000000000000000000000000000000000000 -Ciphertext: 22B4EA3A5718D6CEE4EA78725F5BAC735C539C343D7B45121EDDA22CA39D9413 -Test: Encrypt -Comment: Set 2, vector 61 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000004000000000000000000000000000000000000000000000000 -Ciphertext: 94ECEC21BC3426C7214F266B6442F85B6AE765BD6206A951B2AA14505D19FBCA -Test: Encrypt -Comment: Set 2, vector 62 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000002000000000000000000000000000000000000000000000000 -Ciphertext: EF77932A5749126D65BD88330C18D91EDBB7FB53D7B3B675EE148EFC893559B9 -Test: Encrypt -Comment: Set 2, vector 63 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000001000000000000000000000000000000000000000000000000 -Ciphertext: BB9E132DC5DE8035433FBEAC46395E861BDA17A4892FFE6BD1B10D6B4D6AE0F3 -Test: Encrypt -Comment: Set 2, vector 64 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000800000000000000000000000000000000000000000000000 -Ciphertext: 7B536CF871F7FF406AD640683F405F0E14D72E77CDD2AB091D9A8E169155CE24 -Test: Encrypt -Comment: Set 2, vector 65 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000400000000000000000000000000000000000000000000000 -Ciphertext: 2417835AB4BD0A1D3439310480224C52796F3DB3536419F51A09551DFD4A6799 -Test: Encrypt -Comment: Set 2, vector 66 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000200000000000000000000000000000000000000000000000 -Ciphertext: 8E49C9819DFF2DEFCD8DF3E9EA910F79A9A932F43E4B763D6988CC0924C20544 -Test: Encrypt -Comment: Set 2, vector 67 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000100000000000000000000000000000000000000000000000 -Ciphertext: 1D364FDEFCB51560E4408CF25FC05E7698235D271E725590533CE24E3F3EC1EE -Test: Encrypt -Comment: Set 2, vector 68 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000080000000000000000000000000000000000000000000000 -Ciphertext: F1C0422AC64E4D566E799ADA6CE33B59C31051C55ED2212841460CE330F2763E -Test: Encrypt -Comment: Set 2, vector 69 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000040000000000000000000000000000000000000000000000 -Ciphertext: FA90883588183011F2748ADBC5217BA38CF6787FFD8BFCBEA06ADE193B1313C5 -Test: Encrypt -Comment: Set 2, vector 70 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000020000000000000000000000000000000000000000000000 -Ciphertext: 84EE69F947AEAAA0F1F2DA8C1508733D31F62FEBCF7085C68DEA5A602A566EBF -Test: Encrypt -Comment: Set 2, vector 71 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000010000000000000000000000000000000000000000000000 -Ciphertext: 260C06AB73B581E29C34FEE05363F532D4C693B5E8025291FC99C48F9CFCEFF8 -Test: Encrypt -Comment: Set 2, vector 72 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000008000000000000000000000000000000000000000000000 -Ciphertext: 98184C744C6A24B329A7827CE0F5B30AE709493A22F9064D1C3F7FED046D1C2A -Test: Encrypt -Comment: Set 2, vector 73 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000004000000000000000000000000000000000000000000000 -Ciphertext: 3CCDF1C3103B356E7A460410D91F1F00F749EB96F3E89F91248FB5E0949806EF -Test: Encrypt -Comment: Set 2, vector 74 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000002000000000000000000000000000000000000000000000 -Ciphertext: 49AB6245E93A6CF84BF66A7451D134535362CB8A8CE2E47012BF8B4EF02894D4 -Test: Encrypt -Comment: Set 2, vector 75 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000001000000000000000000000000000000000000000000000 -Ciphertext: 7A92C7BB97CB99AD15EA9DA3A629031901840D23EA4227C699944882E2E8F3CC -Test: Encrypt -Comment: Set 2, vector 76 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000800000000000000000000000000000000000000000000 -Ciphertext: 00FC7EBE56FCB696D9606FBBEEA6955871B7A03CDCAAE25DFC47D06145371AD3 -Test: Encrypt -Comment: Set 2, vector 77 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000400000000000000000000000000000000000000000000 -Ciphertext: FFF7327A979B527486052C1B99DECCFCC5E680D39613DE4107E8A04980DDFD70 -Test: Encrypt -Comment: Set 2, vector 78 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000200000000000000000000000000000000000000000000 -Ciphertext: 1E950B49D7D446867ED48272D220BCCC35B104A76A107880FB37D8AE55E69F58 -Test: Encrypt -Comment: Set 2, vector 79 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000100000000000000000000000000000000000000000000 -Ciphertext: 3B97EDED4E70497DAE02FD51E10AB26888096D2D182A7BC7EE55B6F3243E0144 -Test: Encrypt -Comment: Set 2, vector 80 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000080000000000000000000000000000000000000000000 -Ciphertext: 94414A0116665FFD8D1589B050A1663DBA15463206DA4E6A735B58FA7B4AA7ED -Test: Encrypt -Comment: Set 2, vector 81 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000040000000000000000000000000000000000000000000 -Ciphertext: D586FFCBBF32561B9659306068DD31C2A1FBC8DDF99CF0BDAB3DCC0664B403C7 -Test: Encrypt -Comment: Set 2, vector 82 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000020000000000000000000000000000000000000000000 -Ciphertext: 061E17DB1EAF9884C940B8C72E884C8D9D46819FDDF6724239168DDBEE170B9B -Test: Encrypt -Comment: Set 2, vector 83 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000010000000000000000000000000000000000000000000 -Ciphertext: D70F322E45E1D64B3D91249E9DE766DB7EF9084120C13D0215F31A6DE2E791C6 -Test: Encrypt -Comment: Set 2, vector 84 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000008000000000000000000000000000000000000000000 -Ciphertext: 5018967FCA5E67F24DCCE2190D24CD3E24A0B709B70DC38F1A4B4FE39CDCD2E5 -Test: Encrypt -Comment: Set 2, vector 85 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000004000000000000000000000000000000000000000000 -Ciphertext: 9108A0540D8D02658268185F06DFF6F2248681D0D9F9F4C6658942FC27C68246 -Test: Encrypt -Comment: Set 2, vector 86 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000002000000000000000000000000000000000000000000 -Ciphertext: 6595E74A5943DFE1A3FC19ADEBF190CDEC4C2EA0B7CCC6364E0AF7222CCEAA46 -Test: Encrypt -Comment: Set 2, vector 87 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000001000000000000000000000000000000000000000000 -Ciphertext: 5F156FB20AFD4BC0E4E4B2BA7700A38FFCAF9229E3CBA8C99915B692A76ACDEA -Test: Encrypt -Comment: Set 2, vector 88 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000800000000000000000000000000000000000000000 -Ciphertext: F0584D66033584791BED0EB67D2A73AA918E0F88F08683DC1F67DB7DD3375326 -Test: Encrypt -Comment: Set 2, vector 89 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000400000000000000000000000000000000000000000 -Ciphertext: 5EB0956E3DA8ECFC571D5BD1C4EF430FBB10117C6684B8530B6552B812780EBF -Test: Encrypt -Comment: Set 2, vector 90 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000200000000000000000000000000000000000000000 -Ciphertext: E8C8CB56ED63B5BA16DD833CC9C7AC77E425C284FFD547E8F9FE10410CA02FF3 -Test: Encrypt -Comment: Set 2, vector 91 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000100000000000000000000000000000000000000000 -Ciphertext: 68704A278A231ED468C1F0CFF43A4FC61253EACBE2BDCE1ED86D89F43263016D -Test: Encrypt -Comment: Set 2, vector 92 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000080000000000000000000000000000000000000000 -Ciphertext: CA16F899842EE79CBAC4D7CD67172C7DD537E6EA21D48C15B0B34B29BF87E79B -Test: Encrypt -Comment: Set 2, vector 93 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000040000000000000000000000000000000000000000 -Ciphertext: 9E6E7B31FF5D4D5C7D1C264273A27DA542BFCC6116B7DFDEF6332690B7304BDD -Test: Encrypt -Comment: Set 2, vector 94 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000020000000000000000000000000000000000000000 -Ciphertext: FE466983DED41AFB1908DF12A5532054C6DB320F0ECBDCE7610BBE2A07AA7F68 -Test: Encrypt -Comment: Set 2, vector 95 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000010000000000000000000000000000000000000000 -Ciphertext: D2D93C1B66FD710F8B72564A44ACA93995938FEE7C38DE482C9586E3413EB40C -Test: Encrypt -Comment: Set 2, vector 96 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000008000000000000000000000000000000000000000 -Ciphertext: 6623F853780833A60B60E6467CFA3D3D000228F2C8334F8B00CFE119133D41C7 -Test: Encrypt -Comment: Set 2, vector 97 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000004000000000000000000000000000000000000000 -Ciphertext: 1CED4727527E1C3107A89E77645241D240F3F113AC2BF8319E5D8EFF68997595 -Test: Encrypt -Comment: Set 2, vector 98 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000002000000000000000000000000000000000000000 -Ciphertext: FA450B3D8A7C03B643DF6EC70867D0502AE20235335AF5932A7016D71A6059A4 -Test: Encrypt -Comment: Set 2, vector 99 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000001000000000000000000000000000000000000000 -Ciphertext: A6F76AB74CE44538579369F5367B826C4EA72EB6EE08A0CFE1272EB435FDFEFC -Test: Encrypt -Comment: Set 2, vector 100 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000800000000000000000000000000000000000000 -Ciphertext: 8108B48A62A0E0CD58B066C10613E2B589CFB0BCEF4EB58BBF8C88E84A2CD258 -Test: Encrypt -Comment: Set 2, vector 101 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000400000000000000000000000000000000000000 -Ciphertext: F335D10835B018414786D30923663B77B2E0CA65423B96BFA885B9797138CF4F -Test: Encrypt -Comment: Set 2, vector 102 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000200000000000000000000000000000000000000 -Ciphertext: 87D8E75FEDA12025B9517BBF8421E837872E8978E48DA51BB8B8574C04731091 -Test: Encrypt -Comment: Set 2, vector 103 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000100000000000000000000000000000000000000 -Ciphertext: B8A50E6EDFF9711C6064812423F5DC5D77970BE65B545C042A02BACB30A4CD6F -Test: Encrypt -Comment: Set 2, vector 104 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000080000000000000000000000000000000000000 -Ciphertext: EB98815E5A9337DF35F98D7CF27183EC8423D5F9D145326638B864E0F994DD7D -Test: Encrypt -Comment: Set 2, vector 105 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000040000000000000000000000000000000000000 -Ciphertext: 3E5DDB36ABD739986483DE7A9EEF2468461A02B55CAA24100394442F0946F337 -Test: Encrypt -Comment: Set 2, vector 106 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000020000000000000000000000000000000000000 -Ciphertext: 809F726C3BB19BD09D4412B64777085D968ED4E612286008C4BAC69F671E7E31 -Test: Encrypt -Comment: Set 2, vector 107 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000010000000000000000000000000000000000000 -Ciphertext: 28F2EE8D382DF1AB0CF82B93C7A09B87180E8D19C35657302EFE1B1C4CA11ED4 -Test: Encrypt -Comment: Set 2, vector 108 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000008000000000000000000000000000000000000 -Ciphertext: 76E6887FC464215C9576BB233F5A3A7D98CA73F9B2D06E3BB81BC34AF02C8CE9 -Test: Encrypt -Comment: Set 2, vector 109 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000004000000000000000000000000000000000000 -Ciphertext: E8CEF712D7AF841C4FE7800CB04C27E25BDB41BECFA894588F73776CAAE2A0FA -Test: Encrypt -Comment: Set 2, vector 110 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000002000000000000000000000000000000000000 -Ciphertext: 868D3A678A216D01A765046E2991A21F9626493063AFE771E3369E5DA2BA7E9B -Test: Encrypt -Comment: Set 2, vector 111 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000001000000000000000000000000000000000000 -Ciphertext: D6465061FA1B143E1F6A3FCC1601D2D9FAEEF995C457E9EE301A27E8139D1AFE -Test: Encrypt -Comment: Set 2, vector 112 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000800000000000000000000000000000000000 -Ciphertext: B42BB57D2F25612AAB33EF3213D6D210D9831502A1C4D51C4E72148CBB9893D1 -Test: Encrypt -Comment: Set 2, vector 113 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000400000000000000000000000000000000000 -Ciphertext: CE0EC3C44BFAABE6E18B3506E01199B0F2E0BCA4EA6C29D367EDDD0E83A1C65F -Test: Encrypt -Comment: Set 2, vector 114 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000200000000000000000000000000000000000 -Ciphertext: 627101F50E134D6F33EF70AF0E32A3AF7C3237E3A5D99319719F175DD0392383 -Test: Encrypt -Comment: Set 2, vector 115 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000100000000000000000000000000000000000 -Ciphertext: CBCC83BE624059BD8B950BCF486AFBC342CF3575EBA6950FB39C03DB4822EDD9 -Test: Encrypt -Comment: Set 2, vector 116 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000080000000000000000000000000000000000 -Ciphertext: 5EAD7961798903C315DD89BE57105FEA164CA06A4ECDBB5CB10B76711C3E49A0 -Test: Encrypt -Comment: Set 2, vector 117 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000040000000000000000000000000000000000 -Ciphertext: 69169E6E11EAC935E12E6E30EFCEDD7236EAED9C5E1E3B215CD7167AB88B199D -Test: Encrypt -Comment: Set 2, vector 118 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000020000000000000000000000000000000000 -Ciphertext: 5B08F07728399920CA30DC57CE94CAE85A44530033B2AE6BB7F8E29D7934C437 -Test: Encrypt -Comment: Set 2, vector 119 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000010000000000000000000000000000000000 -Ciphertext: 8FAD35B4FBC3BBAB2F4BF00D8A1651BE3FD77085AC5E6C7F6E2EDF5048F86068 -Test: Encrypt -Comment: Set 2, vector 120 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000008000000000000000000000000000000000 -Ciphertext: 71B22D911D9E754A76EC052CD7DC503CDE9A16E9043A04CFA244D8EB19FC21AA -Test: Encrypt -Comment: Set 2, vector 121 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000004000000000000000000000000000000000 -Ciphertext: 062A10B7F5E3E8D7F3FC2C14E10EC9CA947A8FDC0EBC01E3A127BAFE689D6577 -Test: Encrypt -Comment: Set 2, vector 122 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000002000000000000000000000000000000000 -Ciphertext: 0FC375F0F68567F1827C7218132B434E84DA6377DB50AB330E8D9BD2754BD1B8 -Test: Encrypt -Comment: Set 2, vector 123 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000001000000000000000000000000000000000 -Ciphertext: 0E4C1117D462EEBCF5FCD7AC9807AF40C403910421CD19A4634B1C86113EB387 -Test: Encrypt -Comment: Set 2, vector 124 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000800000000000000000000000000000000 -Ciphertext: A9DB2CD2A23780D8BC5A2567961BCA24A41531157D4A229046B47DE48CAE0FDD -Test: Encrypt -Comment: Set 2, vector 125 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000400000000000000000000000000000000 -Ciphertext: 7195678F00F98B00706E7C497E5FA2BC648EDA00B4B7DFAC6234C8232DF8E071 -Test: Encrypt -Comment: Set 2, vector 126 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000200000000000000000000000000000000 -Ciphertext: E5C1970C7C0B8E7E1BF871219486359C2E5037BE6E8E637BDB9F11051FB36A16 -Test: Encrypt -Comment: Set 2, vector 127 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000100000000000000000000000000000000 -Ciphertext: 2426496DC3B09404B609157E2273D526C3E6909B82F65527B42ABDD6348CF602 -Test: Encrypt -Comment: Set 2, vector 128 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000080000000000000000000000000000000 -Ciphertext: F9870238947E1575AF11D14D12E593163B98BA12E79F05563CBFFBCFB23FDC38 -Test: Encrypt -Comment: Set 2, vector 129 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000040000000000000000000000000000000 -Ciphertext: 2B1E410ACE9E8875F965A29D90773B68CAC452AE98CEB5922B7BAD936ACC421B -Test: Encrypt -Comment: Set 2, vector 130 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000020000000000000000000000000000000 -Ciphertext: 180285A7AD7DD8FFD619970804F0FDB9706D5F5C467F815D0B1A455DED9D9300 -Test: Encrypt -Comment: Set 2, vector 131 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000010000000000000000000000000000000 -Ciphertext: BAEB5C1C68D72F1AE4735F6B75CDF9265E4F6F55DA934C4F118A3728AA2BC0D5 -Test: Encrypt -Comment: Set 2, vector 132 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000008000000000000000000000000000000 -Ciphertext: 9DEBFCC984F55E97C0064335C8A4B7489B7BDD75560EA51982114FCE4D481032 -Test: Encrypt -Comment: Set 2, vector 133 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000004000000000000000000000000000000 -Ciphertext: DF3B0B54DF4D1814A6F46B8F8B37E27AE8B9EC54B97BF9C523F1EC713EDDFFEE -Test: Encrypt -Comment: Set 2, vector 134 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000002000000000000000000000000000000 -Ciphertext: 37AA04C74A1E8ED165BC1B4C97265A32B5579D9B2A7B7C883A98B616D5C24FAE -Test: Encrypt -Comment: Set 2, vector 135 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000001000000000000000000000000000000 -Ciphertext: 83815356746186AE4CC327AB3A8CE04EF66ABD32D44D7089F1D7E301BFE006D6 -Test: Encrypt -Comment: Set 2, vector 136 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000800000000000000000000000000000 -Ciphertext: 2C6C7878E099F55653CA784A0BE4C9EC6201AFDCF99CDDC1ED862D4FE88CFDC8 -Test: Encrypt -Comment: Set 2, vector 137 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000400000000000000000000000000000 -Ciphertext: 424804513D38537C024955F2CCB29BECFD801FC06CD8EC5DE353872F0B50616F -Test: Encrypt -Comment: Set 2, vector 138 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000200000000000000000000000000000 -Ciphertext: 48C31A55ED4716825D43FF671C01A86CDD792AABF78703ADC58F5FD65B3C0DE1 -Test: Encrypt -Comment: Set 2, vector 139 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000100000000000000000000000000000 -Ciphertext: BF99E4263F2C512CDE33A91E04FACA55052444E40FF79F09716FC06D24FDDE1D -Test: Encrypt -Comment: Set 2, vector 140 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000080000000000000000000000000000 -Ciphertext: 1A40488BA16A5D0AE6381018F15ABF95C78FB05867E3D7E213CAD7BA3DC9EA3B -Test: Encrypt -Comment: Set 2, vector 141 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000040000000000000000000000000000 -Ciphertext: BEAD8979A1A485959C3E9C8BF9CCF7CF850EB205296E1E8FF8BCAFBB011FF21D -Test: Encrypt -Comment: Set 2, vector 142 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000020000000000000000000000000000 -Ciphertext: A8EDCC85F5A941B4434BD4DAD5E39EEAD102DA25BBB2C3D143572AC7425ED819 -Test: Encrypt -Comment: Set 2, vector 143 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000010000000000000000000000000000 -Ciphertext: 631126B3A837AA4C999EFE6A687BBA58751464A6395670213C8445CC8409C33F -Test: Encrypt -Comment: Set 2, vector 144 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000008000000000000000000000000000 -Ciphertext: CA4A5FD3A3D2DA973E16C0A849E374C5A293351A66415B45107BD228CB842B19 -Test: Encrypt -Comment: Set 2, vector 145 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000004000000000000000000000000000 -Ciphertext: A61FDF733DDEC4C3AE51BE778BDD6E34BED64449ABCA7A718EAA513A2A5A9014 -Test: Encrypt -Comment: Set 2, vector 146 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000002000000000000000000000000000 -Ciphertext: 2C632530E7FCD550B5F9D14E21409AFD07C7E1FBF04B3B3FEC8C61AC8A1591ED -Test: Encrypt -Comment: Set 2, vector 147 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000001000000000000000000000000000 -Ciphertext: B2D97A1D343D3D5E1A7E444BA6E57D2E5ED42E02F719ECA22BA47E796AB37B18 -Test: Encrypt -Comment: Set 2, vector 148 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000800000000000000000000000000 -Ciphertext: AC515AAC675C2C3E46A8F77578189149327413CF40B48E16BF83D3500C2B1355 -Test: Encrypt -Comment: Set 2, vector 149 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000400000000000000000000000000 -Ciphertext: C8ADC6079B92459A8E975FFFE2352A90629CF9E8D53630536D9EBC7DAC4C467E -Test: Encrypt -Comment: Set 2, vector 150 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000200000000000000000000000000 -Ciphertext: 97B2C40964B25AE5CBD092E36B37A3BB4520570A9920034C584C66600D3857D9 -Test: Encrypt -Comment: Set 2, vector 151 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000100000000000000000000000000 -Ciphertext: 99A017D3829CEFE10DDD33D33F53EA470A2A74A35ED3BED8B7E9D6EF3B790153 -Test: Encrypt -Comment: Set 2, vector 152 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000080000000000000000000000000 -Ciphertext: 6141854199F9E01CFE4A35DF918B805985ACC8F8A7456FFBF91D27D4E85E4C49 -Test: Encrypt -Comment: Set 2, vector 153 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000040000000000000000000000000 -Ciphertext: 28BC7571E7C921B31BC2D7BF55853C2CC5B815B39471907DAE152F685791378B -Test: Encrypt -Comment: Set 2, vector 154 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000020000000000000000000000000 -Ciphertext: AD751D4D9D635900C22B6166328ECD85FB4A1610D055793BF04A83CB6F5F02DB -Test: Encrypt -Comment: Set 2, vector 155 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000010000000000000000000000000 -Ciphertext: 8670009356A0A3BD402CF218664826C05BE1651C6E606C011967F8F9C3835017 -Test: Encrypt -Comment: Set 2, vector 156 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000008000000000000000000000000 -Ciphertext: 6CE35F565BC4F38D73116267C49D345B7B19D57D5C90136CAF512F76AF47FAAD -Test: Encrypt -Comment: Set 2, vector 157 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000004000000000000000000000000 -Ciphertext: FD0DF28AFE47414F99219AD120F33DCA6F8756B2264349911041B0AEC9D77A43 -Test: Encrypt -Comment: Set 2, vector 158 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000002000000000000000000000000 -Ciphertext: 49CE284D7A18A0608E5E3768286E919DE97DD81B369AB0A012AD7BDC491DED1A -Test: Encrypt -Comment: Set 2, vector 159 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000001000000000000000000000000 -Ciphertext: 12B27FEC757A809C68F670698E5CB40E762855022FC12DE2332DB9814FC6E5E2 -Test: Encrypt -Comment: Set 2, vector 160 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000800000000000000000000000 -Ciphertext: 53074884476D09C729F35C3906046C2DCBA7F12BF59CDD3CE73ABF91847C6369 -Test: Encrypt -Comment: Set 2, vector 161 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000400000000000000000000000 -Ciphertext: D29E3C55DD3D867D7263D2C961FDB6A97B8D827AB73A20479ACB06DF992AEC24 -Test: Encrypt -Comment: Set 2, vector 162 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000200000000000000000000000 -Ciphertext: 4BE421463C6F2CC8118A50684EB5FC98323EA27F03D4B98EC05727BA0FFA40E8 -Test: Encrypt -Comment: Set 2, vector 163 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000100000000000000000000000 -Ciphertext: A96EC7F07298F9D86A811D0110D60E65C80F3E913B575831A5E8533932196B24 -Test: Encrypt -Comment: Set 2, vector 164 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000080000000000000000000000 -Ciphertext: F12B579997BA4203D8A0FF36181E4C1B50C703FE32CF18D9BF84355BC404D135 -Test: Encrypt -Comment: Set 2, vector 165 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000040000000000000000000000 -Ciphertext: 35EBB3FE5FACC9B9D321E82A73C344CA05D0E73372579349A1F365DEA0105292 -Test: Encrypt -Comment: Set 2, vector 166 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000020000000000000000000000 -Ciphertext: 0F1F0518D57ADC91D810B5899EB7EE7900D05AD8AD2960FE07893F30859B636F -Test: Encrypt -Comment: Set 2, vector 167 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000010000000000000000000000 -Ciphertext: A6CAF97EF17BEFDCF3412D7F45F72C1F1726198ED3B5CD905DF9078DCD70F882 -Test: Encrypt -Comment: Set 2, vector 168 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000008000000000000000000000 -Ciphertext: E287019353E8C71C62178B3AF7A3ECA210D79F803F43C09B6C08F295367A30CA -Test: Encrypt -Comment: Set 2, vector 169 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000004000000000000000000000 -Ciphertext: CF7A7ECEA347875A7B9191BF9FFDC3FB53512052FA42370E39BF5D906EE82D4E -Test: Encrypt -Comment: Set 2, vector 170 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000002000000000000000000000 -Ciphertext: 7E362B5B5ED5CAB9A518320E498FDB915BFD72BB5C588495AC49FC2D5CEC2134 -Test: Encrypt -Comment: Set 2, vector 171 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000001000000000000000000000 -Ciphertext: 69254195C6A9A4D334F8F0558A6C9635EB8A397E5AB672E81DC194AFA5C3A8B7 -Test: Encrypt -Comment: Set 2, vector 172 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000800000000000000000000 -Ciphertext: 3934A6BA3DE9885771111CBA59D50EC684F8F612AAAE3E511C0A211D972723C4 -Test: Encrypt -Comment: Set 2, vector 173 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000400000000000000000000 -Ciphertext: BCEE40ADD3CFDE924F58786640A56A68FE83615EDD82873DF6908057AF39F74A -Test: Encrypt -Comment: Set 2, vector 174 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000200000000000000000000 -Ciphertext: 70F4E0381A989C486A45FAE5B108373E950843EE48DC2A43E7AA625BF3AC9838 -Test: Encrypt -Comment: Set 2, vector 175 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000100000000000000000000 -Ciphertext: FAED24C44DE7F447CD1169F4D8D734E55154B73F79B31AD1CD310C7F5529433A -Test: Encrypt -Comment: Set 2, vector 176 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000080000000000000000000 -Ciphertext: 887BA60DED98C75DADDC1CD0824E7E6C76D947617A919A3B870B489CD1B7F6B2 -Test: Encrypt -Comment: Set 2, vector 177 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000040000000000000000000 -Ciphertext: 33D833FFDB7BEB6BBAB4DDACA6784B88C4B76A49641AA01BC980AB31084F4351 -Test: Encrypt -Comment: Set 2, vector 178 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000020000000000000000000 -Ciphertext: 8CDEF08AB44C2CB2AB5EC94437E501A96999B30C045A79DE99E220595B95DA2F -Test: Encrypt -Comment: Set 2, vector 179 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000010000000000000000000 -Ciphertext: 029247C8EC0610E7F5B49FA4191E99CDECBC1E44DF123270901A57DE8ED64850 -Test: Encrypt -Comment: Set 2, vector 180 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000008000000000000000000 -Ciphertext: 08487E1E53C677CA34640459BDBF7C53247DD54624B9C2156A59F24A818A258E -Test: Encrypt -Comment: Set 2, vector 181 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000004000000000000000000 -Ciphertext: 2C7C0444738DB202D9236CF00E1B75F579E18CAD4341093675F66732746F8060 -Test: Encrypt -Comment: Set 2, vector 182 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000002000000000000000000 -Ciphertext: F493AF90C19A9EA6460AE35418D4857236D678B570352665092854CFF9FB684E -Test: Encrypt -Comment: Set 2, vector 183 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000001000000000000000000 -Ciphertext: 4575CF8865954F9FDCC9C2F7A41BFD52B1C770E2C7609151E41D9B1D0489500C -Test: Encrypt -Comment: Set 2, vector 184 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000800000000000000000 -Ciphertext: BA0606FA831D4EF759CF457F88B0EEDFDF13BD3ABF72547456052C877B9E3A3B -Test: Encrypt -Comment: Set 2, vector 185 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000400000000000000000 -Ciphertext: 10E979D310CAD332AA3DC860EF69B2BBD96E817BFB93393AD4D8B141C0A301E4 -Test: Encrypt -Comment: Set 2, vector 186 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000200000000000000000 -Ciphertext: B46DE2A7729FAF7CEE978353D4392EA23FE1BB36732D101377C603125125FE62 -Test: Encrypt -Comment: Set 2, vector 187 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000100000000000000000 -Ciphertext: F03E1B911C1EDD769CAD59A744FAD47CB5E19502C1E7F4F0B3197101F3B673C1 -Test: Encrypt -Comment: Set 2, vector 188 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000080000000000000000 -Ciphertext: A9128F8B0C1809095597110471DD7F10040AE71626E8C694BA529B4C9E1353A2 -Test: Encrypt -Comment: Set 2, vector 189 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000040000000000000000 -Ciphertext: B9EDCD81B2CFB461C1FC554ED71CCC958AF4B2B726C011173F4058C40211C496 -Test: Encrypt -Comment: Set 2, vector 190 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000020000000000000000 -Ciphertext: 400F0635E34B796116E3752A0EDA47C3ABC19641DDD60427B4CE3AA8700CEA8E -Test: Encrypt -Comment: Set 2, vector 191 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000010000000000000000 -Ciphertext: 0E526F1012B80F22F946FD51D776187DEFD554B1F5806102E7DD9277FE06B826 -Test: Encrypt -Comment: Set 2, vector 192 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000008000000000000000 -Ciphertext: 1FC0DA71F72D08CDD0F59120C4A88E793869A2C598BAB97C92D6C63C0FAEADA9 -Test: Encrypt -Comment: Set 2, vector 193 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000004000000000000000 -Ciphertext: C493FDECD4D49D5FC6D8590C70BEAAD97EB7694244201CA4CF1732E03D7A4251 -Test: Encrypt -Comment: Set 2, vector 194 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000002000000000000000 -Ciphertext: C532BFE04C6CA7E8B4ABFF9E8BD9C676CBC9AA78FEF4A2DC5CC907742B3ED64F -Test: Encrypt -Comment: Set 2, vector 195 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000001000000000000000 -Ciphertext: 5C8F3ECB07F0264162A9C01A6BB2BC5CF3C7B9ED315803BF86A72406C2655242 -Test: Encrypt -Comment: Set 2, vector 196 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000800000000000000 -Ciphertext: 8C13C039C13DF9C8D821D33E85AFE93EEAFCFC2A2F06D85B3BDE2743FC37AD3F -Test: Encrypt -Comment: Set 2, vector 197 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000400000000000000 -Ciphertext: 3D990835001730714D0880420F57041E37A7FAF1FCA991AA38C409C80F2DC61F -Test: Encrypt -Comment: Set 2, vector 198 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000200000000000000 -Ciphertext: EC44357D4F18EBE148B47AB546D6A5F3E08F8F6C9E2B8B6B99FF303814BF43BA -Test: Encrypt -Comment: Set 2, vector 199 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000100000000000000 -Ciphertext: 00C3B30C81FBC65B9E12C8D6429104FDF40D322D47A59E637FC8CE749725BDCC -Test: Encrypt -Comment: Set 2, vector 200 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000080000000000000 -Ciphertext: 6136C065D96E7F18AB296F86AF04BB264A6DA61DEA7C5413C9131B7EBE551B88 -Test: Encrypt -Comment: Set 2, vector 201 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000040000000000000 -Ciphertext: 2A363A08CAD79DF6A3F2DF5D842B14935C5D09C9D6C78C4989ADCB018A735A5D -Test: Encrypt -Comment: Set 2, vector 202 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000020000000000000 -Ciphertext: B25955B31CC449A42502D1AB61D699DE558BA2C7825BA06B17B239851E575880 -Test: Encrypt -Comment: Set 2, vector 203 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000010000000000000 -Ciphertext: CBE2FD81D74436E167D6A5CF8F7DC07338885146351483E4474CD213D853A6FE -Test: Encrypt -Comment: Set 2, vector 204 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000008000000000000 -Ciphertext: 66DE9DCBF2B85FF944EDD40B3D81F5F8699DB1982C045667FDE9A499A7777DD6 -Test: Encrypt -Comment: Set 2, vector 205 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000004000000000000 -Ciphertext: D940E3F69C42E847312E473E362FD609BE7780D99DAC30F8F095D58EFDC58D59 -Test: Encrypt -Comment: Set 2, vector 206 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000002000000000000 -Ciphertext: 60FBA04239A8C312E10C7773673E94678CB1E13B069759AF304C56CCA6F490DD -Test: Encrypt -Comment: Set 2, vector 207 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000001000000000000 -Ciphertext: D67E081F763F322BA82FA01E184C355A65DE8028E47BF0DB5FCAEDA8C2593F02 -Test: Encrypt -Comment: Set 2, vector 208 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000800000000000 -Ciphertext: 434868F9A6086D0F9218E02CB9534E9EEE88B90C6174A4306B0D0843A35CFDFD -Test: Encrypt -Comment: Set 2, vector 209 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000400000000000 -Ciphertext: B6CCB5899745E29FEE7870B22C2F989D84C98C4510DEA892666E187CDEF77E1A -Test: Encrypt -Comment: Set 2, vector 210 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000200000000000 -Ciphertext: E798F9255A21E0ECDC4BA638F0BF03BAA0AD7810844837582193D7FB3E11B5DF -Test: Encrypt -Comment: Set 2, vector 211 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000100000000000 -Ciphertext: 9BAE51C5C4DF9E55570EF0FE5F2C6AC0CF9FD953E65CD07ED12378BD5A0F2911 -Test: Encrypt -Comment: Set 2, vector 212 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000080000000000 -Ciphertext: 95ECC45EEDD4537D6A7D54D60A64CBFB6728982441C7EE10B7A84A80B51EE171 -Test: Encrypt -Comment: Set 2, vector 213 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000040000000000 -Ciphertext: D8D77750B38E522216DA0A1A9DB7C56788E504708A2048B66946FB83C1981FCB -Test: Encrypt -Comment: Set 2, vector 214 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000020000000000 -Ciphertext: 0CAA8435D051798DB289708EC6CC4C98F0018AB7F068FA0E40443A1F227002CD -Test: Encrypt -Comment: Set 2, vector 215 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000010000000000 -Ciphertext: 5410408C0306460E6033543669A26A63F7C7BBDFEF4273C9BAD8AC472EDAFB67 -Test: Encrypt -Comment: Set 2, vector 216 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000008000000000 -Ciphertext: DD3A0F7B61D056015B54A329882E942ECA3C5C3F64ACFE71E3255A8F53E1AD73 -Test: Encrypt -Comment: Set 2, vector 217 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000004000000000 -Ciphertext: 80A70BE4CC4C61C0F7F501E8068C75CEA78DC11A224D0C47C09D20361C99CF00 -Test: Encrypt -Comment: Set 2, vector 218 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000002000000000 -Ciphertext: BEF3417464A46BBD2B7E9FB967F4FBF406C2B5B9C8B076B770C199C003786A40 -Test: Encrypt -Comment: Set 2, vector 219 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000001000000000 -Ciphertext: C1756ADF6EEF9837B43C4B032B17A79C3A583EE37981CC495CA95893F34218A6 -Test: Encrypt -Comment: Set 2, vector 220 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000800000000 -Ciphertext: 90273FCA31968871BE3D5C76AFCB47D9ECC31A48B87988FD359E93AFF6815F4D -Test: Encrypt -Comment: Set 2, vector 221 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000400000000 -Ciphertext: D0A5F666F7A819EF8BA114C1872158179731F6989997E13AFD73DB252E5CD2A2 -Test: Encrypt -Comment: Set 2, vector 222 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000200000000 -Ciphertext: D4E3DA34C47E5A86A723ED5B9F615B283E4CD54E9F2ED9EAA98A7AB8DE41B14C -Test: Encrypt -Comment: Set 2, vector 223 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000100000000 -Ciphertext: 547227D086EBB538F5836B8E1E65601209AEB6DFD1C450C014C559D879D71862 -Test: Encrypt -Comment: Set 2, vector 224 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000080000000 -Ciphertext: 9E52F033EFE0762ED108095BDF6CD8A89F8E1028F0D3D9B39B601C1084F95F74 -Test: Encrypt -Comment: Set 2, vector 225 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000040000000 -Ciphertext: A049C5B9BD63EBEB23B34EA2F27813D29EDC044E2486D709AC7D2C731557066B -Test: Encrypt -Comment: Set 2, vector 226 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000020000000 -Ciphertext: 1A9CDD2A99C5ED7FB2A6A1870230B0BD6890567E0E4439E248548DF25CB6126E -Test: Encrypt -Comment: Set 2, vector 227 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000010000000 -Ciphertext: 41F2CDA0EFE97BCE8689CF33201B4E57E0600BBB1F274DF3D589915F8EA5C372 -Test: Encrypt -Comment: Set 2, vector 228 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000008000000 -Ciphertext: 1F4712D7AB6D127ABDA90DA977CFC60B44F84859AE4B705851CF687E01E1E250 -Test: Encrypt -Comment: Set 2, vector 229 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000004000000 -Ciphertext: DC93D915CBBC140EDB08B34406F71B4CD38274E92DE8FAF355D274AE7929BC28 -Test: Encrypt -Comment: Set 2, vector 230 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000002000000 -Ciphertext: D2D9A648EDAF9339D7EE52419CC33C42E4CA91AA670D14B78952F41F889122E5 -Test: Encrypt -Comment: Set 2, vector 231 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000001000000 -Ciphertext: F34BA77405D00CAFC3E6786CDB26263C10CDC4D6AFAEDF4C26566A51DB82F5F9 -Test: Encrypt -Comment: Set 2, vector 232 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000800000 -Ciphertext: 21A7EAD6D95FC7AB788206CEA15A25CC4AEB69BAA96C78D5E2851DDBA25523F0 -Test: Encrypt -Comment: Set 2, vector 233 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000400000 -Ciphertext: 822BC3900195E6F224805E77B2460A65FA1A11CFD473F1DFA65351CBB4EFDFEB -Test: Encrypt -Comment: Set 2, vector 234 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000200000 -Ciphertext: 648A71BE1E77866181F980B37690D5C8A37DF29BB2EBC3A41665CD0CCC2E8EF8 -Test: Encrypt -Comment: Set 2, vector 235 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000100000 -Ciphertext: 808E32C933955FF7C8D6F1A4C6754CB3B7311612CFF846D02C81B712C78EB63E -Test: Encrypt -Comment: Set 2, vector 236 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000080000 -Ciphertext: E074251CC7C5BFFCE2CA45933206B2EE8864156A4626C03EA030B71F8BD454BE -Test: Encrypt -Comment: Set 2, vector 237 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000040000 -Ciphertext: 72EBE213A06F63603B49A750808F348FF7C9E4EC72884FDA7C58968EC5A25EED -Test: Encrypt -Comment: Set 2, vector 238 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000020000 -Ciphertext: 20618612C2AF418DE3E185AF7973D508DC31DE1E9D9FB4FDF9E95FD592F567EF -Test: Encrypt -Comment: Set 2, vector 239 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000010000 -Ciphertext: F94C66D4884A657BF0A6A6EA31A90A07F193F55465575FF1BF8DE68F3441BF4E -Test: Encrypt -Comment: Set 2, vector 240 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000008000 -Ciphertext: 9636DCAB40FB991FC330D8EFD671FF83BAA0C9E33D7A146D5E7ADC53592B605F -Test: Encrypt -Comment: Set 2, vector 241 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000004000 -Ciphertext: FC21689B5F46A011ECFE1E314E03ED7105BAC620193714B2290087C17FB763B6 -Test: Encrypt -Comment: Set 2, vector 242 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000002000 -Ciphertext: ABD2583E0FCC95122FDC700AF9B1FDA50D91E752E19BE9D2EE4F5E22033D53C6 -Test: Encrypt -Comment: Set 2, vector 243 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000001000 -Ciphertext: 3501CD56EE5EA39AB32F38371E5C2CF6EEEB9DA82D210A8D88AE8F29917AE9F4 -Test: Encrypt -Comment: Set 2, vector 244 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000800 -Ciphertext: 7559A2AA6CBFA8A181565EDDDE323DB80CE740545FFEE13B4851980AD2451E24 -Test: Encrypt -Comment: Set 2, vector 245 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000400 -Ciphertext: CEF6DBFD1FBCCBB587BD748D6CC992F8EF671A829E2D6AD73D1DC1C1B2A9E8DD -Test: Encrypt -Comment: Set 2, vector 246 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000200 -Ciphertext: 46FBBCD26A1F879746BDF4FF7804A5C105F621837ABCF94F17123B700A58A08A -Test: Encrypt -Comment: Set 2, vector 247 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000100 -Ciphertext: 0B10D2DA0E0FB6F067D641FF7F8C9C8FF4E2D689450787B7136ADF38DC1F2948 -Test: Encrypt -Comment: Set 2, vector 248 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000080 -Ciphertext: 4492E09E73459BF74417FC0D7190DA719A891C9CAE14801944FFB24912E377A8 -Test: Encrypt -Comment: Set 2, vector 249 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000040 -Ciphertext: 76D72C3D3AF6F2FF6AFBC0C1A553E6F8171D81D6BB1CB3C3A6C43ED826A88FAA -Test: Encrypt -Comment: Set 2, vector 250 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000020 -Ciphertext: D912041134584B69AC01938EC88913DBCFF7CDBE93CDF7443BD465F1B2E3F7F5 -Test: Encrypt -Comment: Set 2, vector 251 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000010 -Ciphertext: F0883EB64A5345CC9A0055D4E882D199EFFC334C05B53BC4132AC1A51BA39A9F -Test: Encrypt -Comment: Set 2, vector 252 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000008 -Ciphertext: 276246B0D93A4E6FF05832F51D2BF60641B63594EB90A1E08A7D98C6DDAE1461 -Test: Encrypt -Comment: Set 2, vector 253 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000004 -Ciphertext: 6AA2B04BF65F4213583CED5347537123DC3BE0703209170D1D34B0B8A66C1C58 -Test: Encrypt -Comment: Set 2, vector 254 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000002 -Ciphertext: DC438414927E453DBFD91DC60C635EE4273A9921A134DB513AB2BBDBAE64A9AD -Test: Encrypt -Comment: Set 2, vector 255 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000001 -Ciphertext: 45D43E9288738C5AD1A683D8DE59CEDD22D666A2B7078EB1301B532A272D570B -Test: Encrypt -Comment: Set 3, vector 0 -Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Plaintext: 0000000000000000000000000000000000000000000000000000000000000000 -Ciphertext: 7CA51614425C3BA8CE54DD2FC2020AE7B6E574D198136D0FAE7E26CCBF0BE7A6 -Test: Encrypt -Comment: Set 3, vector 1 -Key: 01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 -Plaintext: 0101010101010101010101010101010101010101010101010101010101010101 -Ciphertext: C4B7C6A9738C77EE28F7E685C8358E0AF88FB6D23955EE6DF49FE3F5DA16F826 -Test: Encrypt -Comment: Set 3, vector 2 -Key: 02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 -Plaintext: 0202020202020202020202020202020202020202020202020202020202020202 -Ciphertext: CD108DD9EC1000B79C75AA3DCC88F913E6F52773853035A5C44F3245B134CBFF -Test: Encrypt -Comment: Set 3, vector 3 -Key: 03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303 -Plaintext: 0303030303030303030303030303030303030303030303030303030303030303 -Ciphertext: E8F9DE8F066B675AE90C919FC4981603485BBB92382D8C844CAF707973D5276D -Test: Encrypt -Comment: Set 3, vector 4 -Key: 04040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404 -Plaintext: 0404040404040404040404040404040404040404040404040404040404040404 -Ciphertext: 6AA777340200C1B65AB25193A8BB267C233DAC7E1B3C523D406FC5B567B7B586 -Test: Encrypt -Comment: Set 3, vector 5 -Key: 05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 -Plaintext: 0505050505050505050505050505050505050505050505050505050505050505 -Ciphertext: 6B14A9C454143376DBDC3C93FB8096B09C01456B0B55412FD9692CD7CB587069 -Test: Encrypt -Comment: Set 3, vector 6 -Key: 06060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606 -Plaintext: 0606060606060606060606060606060606060606060606060606060606060606 -Ciphertext: 3FED53DEF4FBC1D012B36562132AB40049818DA4E62E86716DE5EF70790B0D6A -Test: Encrypt -Comment: Set 3, vector 7 -Key: 07070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707 -Plaintext: 0707070707070707070707070707070707070707070707070707070707070707 -Ciphertext: 7A428F7A6841BC8F0E99335C5021C413D2639321DC8D9F280A2F0EF4B420A212 -Test: Encrypt -Comment: Set 3, vector 8 -Key: 08080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808 -Plaintext: 0808080808080808080808080808080808080808080808080808080808080808 -Ciphertext: A23BE32D37FA4054EC45D6A9CC643AF9124EDAA4AD9ABC7FAAB449D39D11B128 -Test: Encrypt -Comment: Set 3, vector 9 -Key: 09090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909 -Plaintext: 0909090909090909090909090909090909090909090909090909090909090909 -Ciphertext: 972195D6756F7D3A4D13BF49BFBCE7D164460355150C297A41CCC6AA9F31C5D6 -Test: Encrypt -Comment: Set 3, vector 10 -Key: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Plaintext: 0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A -Ciphertext: 2AA722C58EBDB7701225BA9C3B1F7C946D57DEDC74FEDDB637EB14E27A0F0CC9 -Test: Encrypt -Comment: Set 3, vector 11 -Key: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Plaintext: 0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B -Ciphertext: 1C9A0420B9F6EF013FB3ADB4F20C862B61702BA479276E3187322B33D4B128C2 -Test: Encrypt -Comment: Set 3, vector 12 -Key: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Plaintext: 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C -Ciphertext: 666CC3862BAACADA4D35A9079D52438FB3B4416C9938397E61D48066B6476068 -Test: Encrypt -Comment: Set 3, vector 13 -Key: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Plaintext: 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D -Ciphertext: DB94504EF884901FAA5778199329A2DCC9AA50A4453172CE8ADE11BFE54234E9 -Test: Encrypt -Comment: Set 3, vector 14 -Key: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Plaintext: 0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E -Ciphertext: DF0B4204DB7E0924BD2931C131E6DFEB013A5844F717DF7A2DEF86FBC2125DA6 -Test: Encrypt -Comment: Set 3, vector 15 -Key: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Plaintext: 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F -Ciphertext: D7C2D4257254E7A05657047B43B65AB778C9E6ACDE53F14000FDFC346CEE4BA6 -Test: Encrypt -Comment: Set 3, vector 16 -Key: 10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 -Plaintext: 1010101010101010101010101010101010101010101010101010101010101010 -Ciphertext: F64819DFBEBE0A6DB650E7072CE28EA606586418B317785FF0AD44212A84C82C -Test: Encrypt -Comment: Set 3, vector 17 -Key: 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -Plaintext: 1111111111111111111111111111111111111111111111111111111111111111 -Ciphertext: 155B7E6FFCC0AA874E22494545374E97C08A3D1B1045A0F35FFC54B2842D02A4 -Test: Encrypt -Comment: Set 3, vector 18 -Key: 12121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212 -Plaintext: 1212121212121212121212121212121212121212121212121212121212121212 -Ciphertext: FEE12FD9E87DCB4FE5C5249E3EAEDA0514F6A4826C1A5ABC87E22B95D4A84851 -Test: Encrypt -Comment: Set 3, vector 19 -Key: 13131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313 -Plaintext: 1313131313131313131313131313131313131313131313131313131313131313 -Ciphertext: 1DA785C2A2CEFED459474EE5401F5B795F6ED468DBB924CFFCF65EF465DE9534 -Test: Encrypt -Comment: Set 3, vector 20 -Key: 14141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414 -Plaintext: 1414141414141414141414141414141414141414141414141414141414141414 -Ciphertext: 4434A4D83273B06B64AF4ED1D70EEAD50DBFC44C5931A7B7B98FF9F514B229E9 -Test: Encrypt -Comment: Set 3, vector 21 -Key: 15151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515 -Plaintext: 1515151515151515151515151515151515151515151515151515151515151515 -Ciphertext: 1AB982A6C64C2C42D05F9FB8ED9BE0EEB5B48CEE8EAB0250D98D43157E999EDC -Test: Encrypt -Comment: Set 3, vector 22 -Key: 16161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616 -Plaintext: 1616161616161616161616161616161616161616161616161616161616161616 -Ciphertext: 83291A3265ACAB71E5CCCF0281A433579F39AE6C2FB7CB7528D7F820158177FF -Test: Encrypt -Comment: Set 3, vector 23 -Key: 17171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717 -Plaintext: 1717171717171717171717171717171717171717171717171717171717171717 -Ciphertext: 90F1FF9F69854321CFC6D0A4541CCDF73C1A1DC737D96FB76F0DDD0BB0097BBA -Test: Encrypt -Comment: Set 3, vector 24 -Key: 18181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818 -Plaintext: 1818181818181818181818181818181818181818181818181818181818181818 -Ciphertext: ABF9813765AFBEA9BF26026716294D5C5B309243339ECC9F21CEADE6E7083266 -Test: Encrypt -Comment: Set 3, vector 25 -Key: 19191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919 -Plaintext: 1919191919191919191919191919191919191919191919191919191919191919 -Ciphertext: 7B5C8222D85392E82E703ADFB0FF02DBD2297791B84E26A3A1ED12309247D064 -Test: Encrypt -Comment: Set 3, vector 26 -Key: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Plaintext: 1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A -Ciphertext: 227355246FCC9106FA5572475E8C466F1140CD75A8A84DFCD2B0908392914FD7 -Test: Encrypt -Comment: Set 3, vector 27 -Key: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Plaintext: 1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B -Ciphertext: E5E5A887FA888691FF93014C2E368DC10775A447A5EF4B632A089DA82D245BE3 -Test: Encrypt -Comment: Set 3, vector 28 -Key: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Plaintext: 1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C -Ciphertext: BA417FC94107761C0969EF6EA7DDC74E5F85CAB61E2271CEB6D9C98B139F4576 -Test: Encrypt -Comment: Set 3, vector 29 -Key: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Plaintext: 1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D -Ciphertext: F3B85912DF6950B9AE28CE08E456D494E0C949A36FA102540C51827AEC9168AB -Test: Encrypt -Comment: Set 3, vector 30 -Key: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Plaintext: 1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E -Ciphertext: 1AC0ED993D24366380522B05F97B6FC64B199241A1D556B992632AEE400F0494 -Test: Encrypt -Comment: Set 3, vector 31 -Key: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Plaintext: 1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F -Ciphertext: 3550CD591130231B0F01F6860B699715B98B9497B4035C7323000D67C5F0B1B7 -Test: Encrypt -Comment: Set 3, vector 32 -Key: 20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 -Plaintext: 2020202020202020202020202020202020202020202020202020202020202020 -Ciphertext: E267D6113C27170A3EE6DF496E801A6131BBD3444365D7C03791E25610F1A0E4 -Test: Encrypt -Comment: Set 3, vector 33 -Key: 21212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121 -Plaintext: 2121212121212121212121212121212121212121212121212121212121212121 -Ciphertext: 3D71B778381E70BCC1A7B8411208225FC922857E862FC17312E3782CEA289B15 -Test: Encrypt -Comment: Set 3, vector 34 -Key: 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -Plaintext: 2222222222222222222222222222222222222222222222222222222222222222 -Ciphertext: 16B41DE00DBF29B96CC59E246DE3188B786E097394E9EEE2250169AE00306FD8 -Test: Encrypt -Comment: Set 3, vector 35 -Key: 23232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323 -Plaintext: 2323232323232323232323232323232323232323232323232323232323232323 -Ciphertext: 99DDE88C9F26D270B3C507A25FE49955A0FEA6C8FEBAD133842DA1CE730EEB7F -Test: Encrypt -Comment: Set 3, vector 36 -Key: 24242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424 -Plaintext: 2424242424242424242424242424242424242424242424242424242424242424 -Ciphertext: 9766D3F9E73987EE10A20605C8338C0759A7024CF2DF549DE5084EC4902C550A -Test: Encrypt -Comment: Set 3, vector 37 -Key: 25252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525 -Plaintext: 2525252525252525252525252525252525252525252525252525252525252525 -Ciphertext: 0FFD89849C8EC5A46B8F43C799ED305AF602C73E810FC729A8C9BB0F5C55CD54 -Test: Encrypt -Comment: Set 3, vector 38 -Key: 26262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626 -Plaintext: 2626262626262626262626262626262626262626262626262626262626262626 -Ciphertext: 91956E101CE4546623A5BE49811F167476CB568972CEBF7A59EB27DA524A0C6B -Test: Encrypt -Comment: Set 3, vector 39 -Key: 27272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 -Plaintext: 2727272727272727272727272727272727272727272727272727272727272727 -Ciphertext: 7DEC5ECE0D590EE3E099C07F2DD6A6A9C71632D277803FD007275B93369ABED0 -Test: Encrypt -Comment: Set 3, vector 40 -Key: 28282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828 -Plaintext: 2828282828282828282828282828282828282828282828282828282828282828 -Ciphertext: 039C192AFC54EFDE1ED3610B0E9F95AA08D7CDC6AE71A66B5C508E4D14C038CF -Test: Encrypt -Comment: Set 3, vector 41 -Key: 29292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929 -Plaintext: 2929292929292929292929292929292929292929292929292929292929292929 -Ciphertext: D558F8F4562BD8FE816FABF621556C8416C6FD00209028DF978F8915CC093E16 -Test: Encrypt -Comment: Set 3, vector 42 -Key: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Plaintext: 2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A -Ciphertext: 1AE21791ED4B610DD693012518759D6E9C1BBF206482EEA43470F02B493CFFB8 -Test: Encrypt -Comment: Set 3, vector 43 -Key: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Plaintext: 2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B -Ciphertext: 34F2112E8FBD1B373BA8400B05321F658FDFE0DC87C1304C36766DE71840A4DF -Test: Encrypt -Comment: Set 3, vector 44 -Key: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Plaintext: 2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C -Ciphertext: DBF9B56BBF2E50DF321CA687F8BE0E6222E7DF52B4A142174058CC119D9EC0DA -Test: Encrypt -Comment: Set 3, vector 45 -Key: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Plaintext: 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D -Ciphertext: 8B2757374F778FE0B30D11AD7116CE37E2AB858A4E1C50D1115B6E328F3635F5 -Test: Encrypt -Comment: Set 3, vector 46 -Key: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Plaintext: 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E -Ciphertext: 06588A873366FAA47323C9A098A759718DFB0E310C91A4E38B42CC56A0757811 -Test: Encrypt -Comment: Set 3, vector 47 -Key: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Plaintext: 2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F -Ciphertext: 7B861B18E3F322D8000BDDCBCE3B50405AA923375568F16AE84411E91DB879C3 -Test: Encrypt -Comment: Set 3, vector 48 -Key: 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030 -Plaintext: 3030303030303030303030303030303030303030303030303030303030303030 -Ciphertext: 170F74A4D692C302551EE17CD544D65185112D2A5E812D203B36FC39BF1DA9C7 -Test: Encrypt -Comment: Set 3, vector 49 -Key: 31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 -Plaintext: 3131313131313131313131313131313131313131313131313131313131313131 -Ciphertext: 0178F59DDAB05A4DFAF66FD406170E08227096EF9712CB481A26EBD82F470D7A -Test: Encrypt -Comment: Set 3, vector 50 -Key: 32323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232 -Plaintext: 3232323232323232323232323232323232323232323232323232323232323232 -Ciphertext: 8BAC479F3A92DF71F973AA457E19D75FB0F1A0FE68FF440A86154721BCC345D4 -Test: Encrypt -Comment: Set 3, vector 51 -Key: 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 -Plaintext: 3333333333333333333333333333333333333333333333333333333333333333 -Ciphertext: EB50A10C7A0ED9960CDE0C3EDB899A6B67324B1EE23DE4BB13F60D187C3CBA35 -Test: Encrypt -Comment: Set 3, vector 52 -Key: 34343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434 -Plaintext: 3434343434343434343434343434343434343434343434343434343434343434 -Ciphertext: 00AA782AC61FD06DC781E3C5662C65BD1043EC28D056C98F07074DA7C11C1E1F -Test: Encrypt -Comment: Set 3, vector 53 -Key: 35353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535 -Plaintext: 3535353535353535353535353535353535353535353535353535353535353535 -Ciphertext: 23B9F2F26CFC51ECC6DD1AFE614C2DAE8348DA033F9B67AEAA87B71F5377D95D -Test: Encrypt -Comment: Set 3, vector 54 -Key: 36363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636 -Plaintext: 3636363636363636363636363636363636363636363636363636363636363636 -Ciphertext: 9655D4B1CBEF855401274C3339C16DB9B5A9651F60579CFE8554B6EE25DCCA0E -Test: Encrypt -Comment: Set 3, vector 55 -Key: 37373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737 -Plaintext: 3737373737373737373737373737373737373737373737373737373737373737 -Ciphertext: E072ED2DAD79B07C48B50ED31E02FD9705562525D49DBF45DACCFDF35D5A6965 -Test: Encrypt -Comment: Set 3, vector 56 -Key: 38383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838 -Plaintext: 3838383838383838383838383838383838383838383838383838383838383838 -Ciphertext: 287638BAE945B88A95029155BC47D033B5C5C4C191F079C234C6E97683FFABA0 -Test: Encrypt -Comment: Set 3, vector 57 -Key: 39393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939 -Plaintext: 3939393939393939393939393939393939393939393939393939393939393939 -Ciphertext: 500CD3B02BF6FA8C66D1ADE0CE43B325A759CD3426096084A261F054D798F885 -Test: Encrypt -Comment: Set 3, vector 58 -Key: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Plaintext: 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A -Ciphertext: 17614BAB583F2DCF809A2AEE973A4875251B571525521B3A8C47303450B6301F -Test: Encrypt -Comment: Set 3, vector 59 -Key: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Plaintext: 3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B -Ciphertext: 978C8DFD9AC74FF670CC8B31EDC8EC15DDBC2854375ED9BA07BB0F7B96C70BB3 -Test: Encrypt -Comment: Set 3, vector 60 -Key: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Plaintext: 3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C -Ciphertext: 994CA36F6230C7DB63CAD61342FAB3F155C361DAD458FC457AD09ACCAB2EB43F -Test: Encrypt -Comment: Set 3, vector 61 -Key: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Plaintext: 3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D -Ciphertext: AC06659932208AC1DD5F07448A7407232F1410CDAC92F7C5305C4043C559345F -Test: Encrypt -Comment: Set 3, vector 62 -Key: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Plaintext: 3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E -Ciphertext: B55616F0743A29655FEC468CD30C8C65F7925327665670BA9E41A2E09C05C63B -Test: Encrypt -Comment: Set 3, vector 63 -Key: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Plaintext: 3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F -Ciphertext: 78F4852712C3547547A114E73F52C6128EDD3F29E0B2C938D6F9F69AF2303FD2 -Test: Encrypt -Comment: Set 3, vector 64 -Key: 40404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040 -Plaintext: 4040404040404040404040404040404040404040404040404040404040404040 -Ciphertext: C97909916EE86FFDCE8A92903046109B53F788A53039434DF1A394DAD6F697A2 -Test: Encrypt -Comment: Set 3, vector 65 -Key: 41414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141 -Plaintext: 4141414141414141414141414141414141414141414141414141414141414141 -Ciphertext: C3FD3C59D37D44AF9EE6B87AC0939A4A4B2FBAAC23E80E72B1CAC352FE30A8E2 -Test: Encrypt -Comment: Set 3, vector 66 -Key: 42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 -Plaintext: 4242424242424242424242424242424242424242424242424242424242424242 -Ciphertext: 94C70F7654479BC9DA9854129F57F3E69C31B63900A404F577AF1C83CD96E5D6 -Test: Encrypt -Comment: Set 3, vector 67 -Key: 43434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343 -Plaintext: 4343434343434343434343434343434343434343434343434343434343434343 -Ciphertext: 71DD024E9CE700B373A275AA870A68B5DAD9E47D38BC18F34073319041A1CADF -Test: Encrypt -Comment: Set 3, vector 68 -Key: 44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 -Plaintext: 4444444444444444444444444444444444444444444444444444444444444444 -Ciphertext: 274D101B2BD0E7CAFC9E5559DC68567DC8975056B84573C4294D78513B7406D8 -Test: Encrypt -Comment: Set 3, vector 69 -Key: 45454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545 -Plaintext: 4545454545454545454545454545454545454545454545454545454545454545 -Ciphertext: 8DCE5B5C376E42F11A322D8CBCEB8C0AE1EC24F3C65D72B326708FEAF13E3B51 -Test: Encrypt -Comment: Set 3, vector 70 -Key: 46464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646 -Plaintext: 4646464646464646464646464646464646464646464646464646464646464646 -Ciphertext: D62D3BA9BBD23F4424EB929AE7A4CD83A70FA7EFD2E6CCFED23E1176AFDB69CD -Test: Encrypt -Comment: Set 3, vector 71 -Key: 47474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747 -Plaintext: 4747474747474747474747474747474747474747474747474747474747474747 -Ciphertext: FE7670925FEA3AAE1F039590EA230C094C3E434BF1350B12D4EA26E48A6EF7F0 -Test: Encrypt -Comment: Set 3, vector 72 -Key: 48484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848 -Plaintext: 4848484848484848484848484848484848484848484848484848484848484848 -Ciphertext: 3A57E728BFA31AA36C8E4ED38A34B465BA233AD066225F31651C93B870AAFE6D -Test: Encrypt -Comment: Set 3, vector 73 -Key: 49494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949 -Plaintext: 4949494949494949494949494949494949494949494949494949494949494949 -Ciphertext: 3B56014035A28EA6F2F2B09429FED7FC0F5B76D5458F1EB4F3AAA7E7F6610C65 -Test: Encrypt -Comment: Set 3, vector 74 -Key: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Plaintext: 4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A -Ciphertext: 2D28A28ECABAC61B540CD933BE43AF16F11429EDE8E7B62121CD853054363730 -Test: Encrypt -Comment: Set 3, vector 75 -Key: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Plaintext: 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B -Ciphertext: D8A892E3C24C6A2EB8446B3737A0E3AA1478811B819FFD3440B5307185906518 -Test: Encrypt -Comment: Set 3, vector 76 -Key: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Plaintext: 4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C -Ciphertext: 798AD5E43127299B61247059F508268CDBA78B46D4FD28C200AE1052C52294E7 -Test: Encrypt -Comment: Set 3, vector 77 -Key: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Plaintext: 4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D -Ciphertext: 63F43065BA1F262D950219D71B9CD5FA78D6798BCAA981FE3391FF8EA735E4C7 -Test: Encrypt -Comment: Set 3, vector 78 -Key: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Plaintext: 4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E -Ciphertext: E8E461EB5FD98011A37765ECA336B080D58B35C636AD6F423893EE768913255C -Test: Encrypt -Comment: Set 3, vector 79 -Key: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Plaintext: 4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F -Ciphertext: 7348E30FFC0C4F5569B6490622A34FB015C364944553582355887BC472279E8D -Test: Encrypt -Comment: Set 3, vector 80 -Key: 50505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050 -Plaintext: 5050505050505050505050505050505050505050505050505050505050505050 -Ciphertext: BE28CB05EEEEDA8FD8971E9970ECBCA25856F66E95AC8B987C69F04BE3276CD7 -Test: Encrypt -Comment: Set 3, vector 81 -Key: 51515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151 -Plaintext: 5151515151515151515151515151515151515151515151515151515151515151 -Ciphertext: 5D336C5E34D4EB95CFAB87C542C72A748AA45E7F77D841A738017927C7908804 -Test: Encrypt -Comment: Set 3, vector 82 -Key: 52525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252 -Plaintext: 5252525252525252525252525252525252525252525252525252525252525252 -Ciphertext: 2942A594A7964F41460EB6037DDE2C28FFBFFB3C21F7EFF43F06632DA980ED8B -Test: Encrypt -Comment: Set 3, vector 83 -Key: 53535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353 -Plaintext: 5353535353535353535353535353535353535353535353535353535353535353 -Ciphertext: 1C0F7A4E3147BC7F8150D8144ED31D0054FF15414E5DBF289BFEC160D22684AC -Test: Encrypt -Comment: Set 3, vector 84 -Key: 54545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454 -Plaintext: 5454545454545454545454545454545454545454545454545454545454545454 -Ciphertext: 7931C7B9D78CB50610B1BEF596268B94446FCDA44C3EE7CEE53121AC519C4001 -Test: Encrypt -Comment: Set 3, vector 85 -Key: 55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -Plaintext: 5555555555555555555555555555555555555555555555555555555555555555 -Ciphertext: F4E331C357C603EE5ED5547D75B54631A68D7CD74C5075198D0FC38E5661F556 -Test: Encrypt -Comment: Set 3, vector 86 -Key: 56565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656 -Plaintext: 5656565656565656565656565656565656565656565656565656565656565656 -Ciphertext: 378C2887958E31971E8F59C882730E48407E4DA9C26D4C76B672CD53202AB1B8 -Test: Encrypt -Comment: Set 3, vector 87 -Key: 57575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757 -Plaintext: 5757575757575757575757575757575757575757575757575757575757575757 -Ciphertext: DBE68FE249F4A8D36E1CB49DBE20ED58649CCC502F85895875C1FE82269219DA -Test: Encrypt -Comment: Set 3, vector 88 -Key: 58585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858 -Plaintext: 5858585858585858585858585858585858585858585858585858585858585858 -Ciphertext: 103BD780F3B382C4B28E6E1CB41CBEE22CC1BB64E4A0147D658EDA96A6E7FEAB -Test: Encrypt -Comment: Set 3, vector 89 -Key: 59595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959 -Plaintext: 5959595959595959595959595959595959595959595959595959595959595959 -Ciphertext: 382EF838282E0F4BA729083542BB8CB48AB874FF568DFDA56AFC4ED266DD3243 -Test: Encrypt -Comment: Set 3, vector 90 -Key: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Plaintext: 5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A -Ciphertext: 088665DE8F9DC9298DEF4164C12526597F56859AAC2C96A95645A06014BA689A -Test: Encrypt -Comment: Set 3, vector 91 -Key: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Plaintext: 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B -Ciphertext: EC988946646A1B2DCC7EDEC4FCAB11BF29055A226F4C75D28F9DFB8D2EB5C9B6 -Test: Encrypt -Comment: Set 3, vector 92 -Key: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Plaintext: 5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C -Ciphertext: B77221CE7F68292BD4E3A55E8EC7BD1FC68B1B6B02F1008586248833C1089F5C -Test: Encrypt -Comment: Set 3, vector 93 -Key: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Plaintext: 5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D -Ciphertext: B3E4AA5DE6D25A6237FDD97540191D669C64E54A7D3C544E949489355AFC82B5 -Test: Encrypt -Comment: Set 3, vector 94 -Key: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Plaintext: 5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E -Ciphertext: AAA6FA046AC4270B22A742C4C29445EB38511E5048414886EBF39523B7EAF76A -Test: Encrypt -Comment: Set 3, vector 95 -Key: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Plaintext: 5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F -Ciphertext: 4D23440171778573BE7B515C68FA99D0426A32111CA493337E7C55280A90F697 -Test: Encrypt -Comment: Set 3, vector 96 -Key: 60606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060 -Plaintext: 6060606060606060606060606060606060606060606060606060606060606060 -Ciphertext: 8EE711FB281CBAA99917C85F0623B68E2EDAFEFCC3B1B841883D71BA6683568A -Test: Encrypt -Comment: Set 3, vector 97 -Key: 61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 -Plaintext: 6161616161616161616161616161616161616161616161616161616161616161 -Ciphertext: EC29DAE53DB4475F8900311F425FE60CB834A82F2A6A2DB4810F95F4D6991B84 -Test: Encrypt -Comment: Set 3, vector 98 -Key: 62626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 -Plaintext: 6262626262626262626262626262626262626262626262626262626262626262 -Ciphertext: 91E58DDE741553572B5D6F3DAD25953906424FF217497226746A25C0CE1C7D0F -Test: Encrypt -Comment: Set 3, vector 99 -Key: 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 -Plaintext: 6363636363636363636363636363636363636363636363636363636363636363 -Ciphertext: B6EC4D9421AB011D4EEDBC32B289E45AC44CAEB1DC5FAEA752DFFA0137325067 -Test: Encrypt -Comment: Set 3, vector 100 -Key: 64646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464 -Plaintext: 6464646464646464646464646464646464646464646464646464646464646464 -Ciphertext: D9CB13EA06CADF09AC446F9B09553FFE3BF4F1152997B171C03E609D4BD60ADB -Test: Encrypt -Comment: Set 3, vector 101 -Key: 65656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 -Plaintext: 6565656565656565656565656565656565656565656565656565656565656565 -Ciphertext: 2D07CA161326ED154D9E3FF650963557EC369A91ABB0D49FC1F32AEF39A3B12E -Test: Encrypt -Comment: Set 3, vector 102 -Key: 66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 -Plaintext: 6666666666666666666666666666666666666666666666666666666666666666 -Ciphertext: 28E8B606EE621D2C5B865B8208C7BD40C3596931CE3FF8FA5AD7EB8EE4480E95 -Test: Encrypt -Comment: Set 3, vector 103 -Key: 67676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767 -Plaintext: 6767676767676767676767676767676767676767676767676767676767676767 -Ciphertext: 9B9B3A23DA29539DA1E9BAA20449750EC192CE14A5063E1A2FFAF5039A665754 -Test: Encrypt -Comment: Set 3, vector 104 -Key: 68686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868 -Plaintext: 6868686868686868686868686868686868686868686868686868686868686868 -Ciphertext: D770E305A9C2D257759D8AE9E70C408D1CB090F976BBAFF3A56730A78BA8BF4F -Test: Encrypt -Comment: Set 3, vector 105 -Key: 69696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969 -Plaintext: 6969696969696969696969696969696969696969696969696969696969696969 -Ciphertext: 453988B10DFD852D1AFD11E96C50024571CCB0F19E7C3C4981F8B8BDCD11F720 -Test: Encrypt -Comment: Set 3, vector 106 -Key: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Plaintext: 6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A -Ciphertext: 17DFD98CB5C24610DD631C4E2749A679D68F854F21AABE8BF67605A256452AD8 -Test: Encrypt -Comment: Set 3, vector 107 -Key: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Plaintext: 6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B -Ciphertext: DA260145EC80E19C18685540AC71FA460DD4427168E37BC6E0F967D90C306FBB -Test: Encrypt -Comment: Set 3, vector 108 -Key: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Plaintext: 6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C -Ciphertext: 2AC246E2E384ECCC4BC69CE82EDB51C05DD864642F1E9A572DA6043DD1D56DF0 -Test: Encrypt -Comment: Set 3, vector 109 -Key: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Plaintext: 6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D -Ciphertext: D1A06B820071CC4122F0B0797A294F31922E26703CDEF15A6D8F511CDBD8BD3F -Test: Encrypt -Comment: Set 3, vector 110 -Key: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Plaintext: 6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E -Ciphertext: C8D23274A1FF6AEBDF0BA70FBA7A895277B1CC8040F8FB2814195E3A7E85BD01 -Test: Encrypt -Comment: Set 3, vector 111 -Key: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Plaintext: 6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F -Ciphertext: E0133DC7960953BABC7BFBA52E88DCF86EBD979D6D63EB19466EEADEDEDEEBB3 -Test: Encrypt -Comment: Set 3, vector 112 -Key: 70707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070 -Plaintext: 7070707070707070707070707070707070707070707070707070707070707070 -Ciphertext: A1A9527766EE54D566D97E7A0763A5AECE86F2816411AC2066439D6BDF02FEA7 -Test: Encrypt -Comment: Set 3, vector 113 -Key: 71717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171 -Plaintext: 7171717171717171717171717171717171717171717171717171717171717171 -Ciphertext: E1833EF5C2BA2EF192642164F0F2C02A7334EF5AEA37E9DD56D17AE6CB031004 -Test: Encrypt -Comment: Set 3, vector 114 -Key: 72727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272 -Plaintext: 7272727272727272727272727272727272727272727272727272727272727272 -Ciphertext: DD2CC0EECAA7E5364376FA73E12C64A0C42FB9FC7E94EFF0B22A051D6EDFE905 -Test: Encrypt -Comment: Set 3, vector 115 -Key: 73737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373 -Plaintext: 7373737373737373737373737373737373737373737373737373737373737373 -Ciphertext: 9A72F15B911E6A50A32EEEDF83B62B628E37ED403085180571DEBEA2F37CF49F -Test: Encrypt -Comment: Set 3, vector 116 -Key: 74747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474 -Plaintext: 7474747474747474747474747474747474747474747474747474747474747474 -Ciphertext: CD83CE7861EE8259A9C29BC3870EA1BF629ECD31F2E18F0BC12221F239207457 -Test: Encrypt -Comment: Set 3, vector 117 -Key: 75757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575 -Plaintext: 7575757575757575757575757575757575757575757575757575757575757575 -Ciphertext: 7B4218C5AEA4EEFE17E2AB110D8B63A947F21D5210162F6283EDDF00900CEE27 -Test: Encrypt -Comment: Set 3, vector 118 -Key: 76767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676 -Plaintext: 7676767676767676767676767676767676767676767676767676767676767676 -Ciphertext: 935DE2010B112937A233E7CB1023FB9D3C46D7C688A478A94F86AD3919FD2728 -Test: Encrypt -Comment: Set 3, vector 119 -Key: 77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 -Plaintext: 7777777777777777777777777777777777777777777777777777777777777777 -Ciphertext: 416A91A68A520732E672ACB5A36599D9A99901F013CC460D9C2FB16AAB45996E -Test: Encrypt -Comment: Set 3, vector 120 -Key: 78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 -Plaintext: 7878787878787878787878787878787878787878787878787878787878787878 -Ciphertext: FD066F9C65CD3D61B43F5DA44F7B94C85541DC5E09D52B044DA963699C39FDA0 -Test: Encrypt -Comment: Set 3, vector 121 -Key: 79797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979 -Plaintext: 7979797979797979797979797979797979797979797979797979797979797979 -Ciphertext: 63937A7953E453B6E48539FACBD1BC489E03D209DB188837C5A09BA458FFFB92 -Test: Encrypt -Comment: Set 3, vector 122 -Key: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Plaintext: 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A -Ciphertext: 68F9EA0F87112633611052A45BBF32B7069079EDB16A928CD2AA16BE464178E3 -Test: Encrypt -Comment: Set 3, vector 123 -Key: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Plaintext: 7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B -Ciphertext: 874D5ED6C8052C3B4AB830626A195F508DDA15388BA75B3D957B26BC134C9B30 -Test: Encrypt -Comment: Set 3, vector 124 -Key: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Plaintext: 7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C -Ciphertext: EC3EA8DC433E39B85E4C4D68AC6A854A1B943D99EB2E9A018EA27DC1874CA867 -Test: Encrypt -Comment: Set 3, vector 125 -Key: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Plaintext: 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D -Ciphertext: 9CE2298362F1F234A73BECA011EC31B4BC7E143D87B4F118CDADE6AB8D1ED783 -Test: Encrypt -Comment: Set 3, vector 126 -Key: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Plaintext: 7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E -Ciphertext: 27973D9B510ED9C612CC770FC1AE25EE21B1A9616CB64617EDA477939BE98D04 -Test: Encrypt -Comment: Set 3, vector 127 -Key: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Plaintext: 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F -Ciphertext: 82A0EB8C058E727EBD6032F0F77EE693342C97BD44E9538032652B1CA10403DE -Test: Encrypt -Comment: Set 3, vector 128 -Key: 80808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 -Plaintext: 8080808080808080808080808080808080808080808080808080808080808080 -Ciphertext: C3C1CD5F3060B3EC4E6ABC0818B68449E1750FB482368C8F3305270E16F98735 -Test: Encrypt -Comment: Set 3, vector 129 -Key: 81818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181 -Plaintext: 8181818181818181818181818181818181818181818181818181818181818181 -Ciphertext: 26381852C68B646D80E53C958855293BDC6FAAA85C5F9CAAACABE7B8077E4F7A -Test: Encrypt -Comment: Set 3, vector 130 -Key: 82828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282 -Plaintext: 8282828282828282828282828282828282828282828282828282828282828282 -Ciphertext: E2EA924898ED40FBD8C633706AD7D698392DF1EF33A10FDFCBE51B58C3AE0668 -Test: Encrypt -Comment: Set 3, vector 131 -Key: 83838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383838383 -Plaintext: 8383838383838383838383838383838383838383838383838383838383838383 -Ciphertext: 15CBDDA36707819D0C7694AAD46B2345BDEFC9D4F26F03A4BF860CE46F7BB53A -Test: Encrypt -Comment: Set 3, vector 132 -Key: 84848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484848484 -Plaintext: 8484848484848484848484848484848484848484848484848484848484848484 -Ciphertext: F96318A42737AB884FAA82BBB7025063E9A25C5957F52A7342E0C03A1A64273C -Test: Encrypt -Comment: Set 3, vector 133 -Key: 85858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585 -Plaintext: 8585858585858585858585858585858585858585858585858585858585858585 -Ciphertext: 7813FEB148D103075C80ACDFC95E2437A560D9B2E6C910E3A59805338E498907 -Test: Encrypt -Comment: Set 3, vector 134 -Key: 86868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686 -Plaintext: 8686868686868686868686868686868686868686868686868686868686868686 -Ciphertext: C7E9D5FE3BA11096AB77E715DFF0D2EB67E9136F0393CD004A7E994B3F994FA4 -Test: Encrypt -Comment: Set 3, vector 135 -Key: 87878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787 -Plaintext: 8787878787878787878787878787878787878787878787878787878787878787 -Ciphertext: F7D2DD8DF86A0E985CF6E83AA5922A548C83856D88C2C9D49EA962C9E6497949 -Test: Encrypt -Comment: Set 3, vector 136 -Key: 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 -Plaintext: 8888888888888888888888888888888888888888888888888888888888888888 -Ciphertext: C64887C6573E3D7F286C0353188FC93F05321C0C949ACDCB0237725576BCF77B -Test: Encrypt -Comment: Set 3, vector 137 -Key: 89898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989 -Plaintext: 8989898989898989898989898989898989898989898989898989898989898989 -Ciphertext: 77FB97C9C953BE6BD58044FB1E095BB5E3F4B3A51DAFE6F2F7ADED0FB707921F -Test: Encrypt -Comment: Set 3, vector 138 -Key: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Plaintext: 8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A -Ciphertext: 22DE5F20955357BA1BF70E4D6DA436CCDE28C228031E4A413882C918EF8082D1 -Test: Encrypt -Comment: Set 3, vector 139 -Key: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Plaintext: 8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B -Ciphertext: 146FF5907A3C58593C3FD3EB7498C4426CCE04DD0DA9138954BB97AAC821D87F -Test: Encrypt -Comment: Set 3, vector 140 -Key: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Plaintext: 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C -Ciphertext: 474ADC5855C87504A7C859409E25154D94B05A925F1D9989AE653B5511710BD7 -Test: Encrypt -Comment: Set 3, vector 141 -Key: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Plaintext: 8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D -Ciphertext: 959B1090C1FF59998C100814E95E40EF94C6F2B7ED0425C78391192CFFFFA465 -Test: Encrypt -Comment: Set 3, vector 142 -Key: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Plaintext: 8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E -Ciphertext: 9DA473108FFCECB228F8809860CDA316F4E1FAC5ADC39BB0373F01DCEBCBF271 -Test: Encrypt -Comment: Set 3, vector 143 -Key: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Plaintext: 8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F -Ciphertext: 905FD0302F9F3C4296E15F94EDD72A8F9F4E9E4068F068099CAAE7247235847E -Test: Encrypt -Comment: Set 3, vector 144 -Key: 90909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090 -Plaintext: 9090909090909090909090909090909090909090909090909090909090909090 -Ciphertext: B63B82FB4B4961E4800FD13CAF145BEBF3625822AF7F5D3ACF2A4506471C636D -Test: Encrypt -Comment: Set 3, vector 145 -Key: 91919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191 -Plaintext: 9191919191919191919191919191919191919191919191919191919191919191 -Ciphertext: 63AA9822C7A5A6777D03F901E3BAF91FD566553C88835EF06DB9A983212288BF -Test: Encrypt -Comment: Set 3, vector 146 -Key: 92929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292 -Plaintext: 9292929292929292929292929292929292929292929292929292929292929292 -Ciphertext: 5417F10E4028BDE0F741114632E2090A1E6C83ACB1D03EA98D18D003838B4F0A -Test: Encrypt -Comment: Set 3, vector 147 -Key: 93939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393 -Plaintext: 9393939393939393939393939393939393939393939393939393939393939393 -Ciphertext: FD2C478FB17EE8520149E8A242BB07E0B32929536B191AC6DBCE05891C5E4BFC -Test: Encrypt -Comment: Set 3, vector 148 -Key: 94949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494 -Plaintext: 9494949494949494949494949494949494949494949494949494949494949494 -Ciphertext: 6A36A092BC0F029B60D40440F141EF0DC21A241547359FB618E9243C39AE3D7C -Test: Encrypt -Comment: Set 3, vector 149 -Key: 95959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595959595 -Plaintext: 9595959595959595959595959595959595959595959595959595959595959595 -Ciphertext: 605BC400A0FEE12092D369142E4D20C3A4F3D7623254BF9E242766946FC47ED1 -Test: Encrypt -Comment: Set 3, vector 150 -Key: 96969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696 -Plaintext: 9696969696969696969696969696969696969696969696969696969696969696 -Ciphertext: 6A5FA33652F946D7C93A56D15B5D3807401C667A9757495341F78526D58659D2 -Test: Encrypt -Comment: Set 3, vector 151 -Key: 97979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797 -Plaintext: 9797979797979797979797979797979797979797979797979797979797979797 -Ciphertext: 5C6AC175B74B9F7F7D6371A90B1F35E1276628DF6A82B0ECE38590C88B7B8DCA -Test: Encrypt -Comment: Set 3, vector 152 -Key: 98989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898 -Plaintext: 9898989898989898989898989898989898989898989898989898989898989898 -Ciphertext: 67BB4E7818FBE6CFAB113C1B2EC797E3164432BFF708450312422D5AEC70A8A8 -Test: Encrypt -Comment: Set 3, vector 153 -Key: 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -Plaintext: 9999999999999999999999999999999999999999999999999999999999999999 -Ciphertext: BFDA13CA82E73FBF62B6F1BB7181916CE7FD7DC7608EB958A8246346DFBB04E9 -Test: Encrypt -Comment: Set 3, vector 154 -Key: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Plaintext: 9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A -Ciphertext: C30F3EF137BF7718F76C7E4D2366A48E7C3CE53735BBF8B56CD51609A23AC06C -Test: Encrypt -Comment: Set 3, vector 155 -Key: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Plaintext: 9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B -Ciphertext: D73795A681B4FBE858703C15D60299682F64C800E691D223C4BE51012DA4D3DA -Test: Encrypt -Comment: Set 3, vector 156 -Key: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Plaintext: 9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C -Ciphertext: 885A096C820E01E48E1A5F75DB0A007C2A96B66FCAB38AE80CF92DD8B6A35F6F -Test: Encrypt -Comment: Set 3, vector 157 -Key: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Plaintext: 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D -Ciphertext: 8FBDD4939C31026305C575F1FDCED3DBAE320C56CF064E9F19B44A43898BFD5C -Test: Encrypt -Comment: Set 3, vector 158 -Key: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Plaintext: 9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E -Ciphertext: 2D9EC00B081BC1512EC11A0B8B898639415AEEA3270C4B49E4B47C601AB85875 -Test: Encrypt -Comment: Set 3, vector 159 -Key: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Plaintext: 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F -Ciphertext: 59565FB9888519C77E9C4E86D72AD86205AB55488D5ED0B9A388FB2D301C4400 -Test: Encrypt -Comment: Set 3, vector 160 -Key: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Plaintext: A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 -Ciphertext: 32D6CAA3D5E0A5D3CCD0FD8F2105CFF662FC4052FE348C2DFD0BC3EEFF3AB700 -Test: Encrypt -Comment: Set 3, vector 161 -Key: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Plaintext: A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1 -Ciphertext: 7C3276EA6BB6FDDDEC8B901C45978B7D4D34AACE9F2D02F7D7F5826A89809DE9 -Test: Encrypt -Comment: Set 3, vector 162 -Key: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Plaintext: A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 -Ciphertext: C5ABC33559D828DD1464264F94D46A8519B4CE47EAA0EC9BF0504C876AC85451 -Test: Encrypt -Comment: Set 3, vector 163 -Key: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Plaintext: A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3 -Ciphertext: E63050ADB9F2789F91A192E089883D7346DD42DE4C654E1D4B72C77D6C09FDB0 -Test: Encrypt -Comment: Set 3, vector 164 -Key: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Plaintext: A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4 -Ciphertext: E7C58AF118E1DFD2A279DE640EDEF02FB4F3C78D778D145ECC6B2C4CCD065229 -Test: Encrypt -Comment: Set 3, vector 165 -Key: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Plaintext: A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5 -Ciphertext: 278D8C11ACFDB851131432B3E19C409F940F93E0F6CB49D076C62E70B9C27095 -Test: Encrypt -Comment: Set 3, vector 166 -Key: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Plaintext: A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6 -Ciphertext: D4839B5679FCA83189BB8C3681E83BAC871A02F297578855034E915F4EF04C12 -Test: Encrypt -Comment: Set 3, vector 167 -Key: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Plaintext: A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7 -Ciphertext: 91AFF6474168F1D113E3DC66E620CF2F7283CE84F5FDDECC7E79CC005859C1BA -Test: Encrypt -Comment: Set 3, vector 168 -Key: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Plaintext: A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8A8 -Ciphertext: 1374026DD442B1C1E0BA34570240F6A9E99781C8307A1544A9D3C91857C7E6E1 -Test: Encrypt -Comment: Set 3, vector 169 -Key: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Plaintext: A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9A9 -Ciphertext: C95E8163D47755E25E8A4BA1FDFF46E016F080F13A794FD21251CE238F28C52E -Test: Encrypt -Comment: Set 3, vector 170 -Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Plaintext: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -Ciphertext: 5DA751854BEEDB19D767A09E2BD9C12D15E51A4409A1F70574496D0A0DA767F9 -Test: Encrypt -Comment: Set 3, vector 171 -Key: ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB -Plaintext: ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB -Ciphertext: C1A0ADDB98DA358D8F40CDB8FA427770D6BD5705D81A804A9BA27FFAE8790BD1 -Test: Encrypt -Comment: Set 3, vector 172 -Key: ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC -Plaintext: ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC -Ciphertext: 604830D513CB29E0E89A36EAB97FFDFC0855AE212F9DDAB62ABE7572CBCEBFC5 -Test: Encrypt -Comment: Set 3, vector 173 -Key: ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD -Plaintext: ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD -Ciphertext: 0DB5075E0B9727D439ED88030D31B532B61556D206220CAE70A7B42EE4C5F72E -Test: Encrypt -Comment: Set 3, vector 174 -Key: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Plaintext: AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE -Ciphertext: A5167DC20ED3B1894B10C6AA754FDCF9FC1418439D9CA80C40974E9CB7630A12 -Test: Encrypt -Comment: Set 3, vector 175 -Key: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Plaintext: AFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAF -Ciphertext: 1A90CCEA061A2FB58E4D1F363B6CEEC26BFB55F4F140A18991C8EF50E8DFB306 -Test: Encrypt -Comment: Set 3, vector 176 -Key: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Plaintext: B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0 -Ciphertext: 5CED17D75543C21AA1E020D4B084DB86A77BC445C7E77DA54DC6D786A0976A09 -Test: Encrypt -Comment: Set 3, vector 177 -Key: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Plaintext: B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1 -Ciphertext: BB28F1F9496ED578276F99F3A2D4657566DC2CDDDCF00AE44555DA614C64E54E -Test: Encrypt -Comment: Set 3, vector 178 -Key: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Plaintext: B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2 -Ciphertext: 30C28BF86BEAEBB25F4A667FB2B9C183B85B456527EB49B44AA4EA825A44E026 -Test: Encrypt -Comment: Set 3, vector 179 -Key: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Plaintext: B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3 -Ciphertext: C2B0DEB4BC6C28869675FB75D2C2081396601B1FA823185D2D9EDE0730BBEAEA -Test: Encrypt -Comment: Set 3, vector 180 -Key: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Plaintext: B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4 -Ciphertext: B3EDC667C3FD03CE50D05877C8A78C330F809DF5F8F7FB11968A3664C77CA78B -Test: Encrypt -Comment: Set 3, vector 181 -Key: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Plaintext: B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 -Ciphertext: BC2FCF90C52B883CAC3F0A673FA093EEB48952F4DE50A9288464B84A920A1316 -Test: Encrypt -Comment: Set 3, vector 182 -Key: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Plaintext: B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6 -Ciphertext: 30BCF4063A59823CE94B14B6B65F1B4DBEED8FB30832765B5186F4B834DBEA89 -Test: Encrypt -Comment: Set 3, vector 183 -Key: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Plaintext: B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7B7 -Ciphertext: 51B4C7E8F697FACC24294A2CEB404C4BEC0CA41C76A6B50A824800EA4464C796 -Test: Encrypt -Comment: Set 3, vector 184 -Key: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Plaintext: B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8B8 -Ciphertext: 2CCFF61604C0881CCC6A69B885878D6D07CEA7DAB31719D89DC4ECB0063DF5D2 -Test: Encrypt -Comment: Set 3, vector 185 -Key: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Plaintext: B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9B9 -Ciphertext: 87998D9F16DC018B5DBD42A2E0C26D3774C2A41986E2D0A1504CE37B6EE71688 -Test: Encrypt -Comment: Set 3, vector 186 -Key: BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA -Plaintext: BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA -Ciphertext: D774451BB82A62A4C7708D0194F6C129C483CEFD182BAADF5A35EB77892F317A -Test: Encrypt -Comment: Set 3, vector 187 -Key: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Plaintext: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB -Ciphertext: B88CE3DF52572A1A1C8253E05D789BBF204E2CFC7A00389429F4C6B428EF8CD6 -Test: Encrypt -Comment: Set 3, vector 188 -Key: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Plaintext: BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC -Ciphertext: B854E538E6674A1831F635AA6650A0A4D0730A9A4B12511509EFD49E34D57D62 -Test: Encrypt -Comment: Set 3, vector 189 -Key: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Plaintext: BDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBD -Ciphertext: A69EF2348FEEF1EA09A2B29A6D977092ECD522A62EE906FA47624C92A872EB17 -Test: Encrypt -Comment: Set 3, vector 190 -Key: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Plaintext: BEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBE -Ciphertext: A1AE0CBC3B5200F1D8AE165EE42D45F6CE8C4FF448F8127B6D9AB4936FC76CA8 -Test: Encrypt -Comment: Set 3, vector 191 -Key: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Plaintext: BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF -Ciphertext: 91948E36B83E21FF8A5EEDAA48E50E3A292A3B68D20657FA7E11F50BC7A12205 -Test: Encrypt -Comment: Set 3, vector 192 -Key: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Plaintext: C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 -Ciphertext: 56CD17219224C3103E3E3E5CABAB6C1E78DEA9AD27613E8D62901FFA31500BFF -Test: Encrypt -Comment: Set 3, vector 193 -Key: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Plaintext: C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1 -Ciphertext: 2E8FE5CAB2448B194387B160E9141E7D1B879BA1580B3D393B55436608EA2735 -Test: Encrypt -Comment: Set 3, vector 194 -Key: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Plaintext: C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2 -Ciphertext: 5DD74E1155DD90840C702145DF6912754FB74B47625EA4C5382326681DB3390E -Test: Encrypt -Comment: Set 3, vector 195 -Key: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Plaintext: C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 -Ciphertext: 3A9F5962554037DCB1FA2AD04BFC0BF79699941500D5F9841320C6D8601310A2 -Test: Encrypt -Comment: Set 3, vector 196 -Key: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Plaintext: C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4 -Ciphertext: BB0F5B68087BBA51DBB700BA1860CC3D0A587E54D57F4014DE4E48E58E529F87 -Test: Encrypt -Comment: Set 3, vector 197 -Key: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Plaintext: C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 -Ciphertext: 8384025D801AB8EC4D4416F5B7E862B6D9AC9E4AEE334C35FD0296B1402E4975 -Test: Encrypt -Comment: Set 3, vector 198 -Key: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Plaintext: C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6 -Ciphertext: BE3057511C5D0E51315D89671BB4E57E7B590EC3ECE8A14D728248ED8F5107BB -Test: Encrypt -Comment: Set 3, vector 199 -Key: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Plaintext: C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7C7 -Ciphertext: 18882618837D15B0B6BD77E1F37470EC58155A2788BDD9D91AEBD16B29A92A1B -Test: Encrypt -Comment: Set 3, vector 200 -Key: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Plaintext: C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8 -Ciphertext: 8FAFDDC7E04C1AF3BBE8428222DCA59D2EF8C9E0213430492ECAB7B414987FEF -Test: Encrypt -Comment: Set 3, vector 201 -Key: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Plaintext: C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9 -Ciphertext: 4D687992D4F9F515FE451AC967CBF75F906D637C3C261758E263A0DA0DEF69C2 -Test: Encrypt -Comment: Set 3, vector 202 -Key: CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA -Plaintext: CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA -Ciphertext: 9DDC94BFF87FDBAFDB0AB9DC17D3649231300E5E6270600856722324DC9CA39A -Test: Encrypt -Comment: Set 3, vector 203 -Key: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Plaintext: CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB -Ciphertext: 86E9CCD90D7B902D23D82C085B1F886402DBD2D19C5A81A32F318C98C6E2A98A -Test: Encrypt -Comment: Set 3, vector 204 -Key: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Plaintext: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -Ciphertext: 164FCD7D1FFE12FF1FDEE6384145EF546A5CD98C22817A5205FF2C2E18339779 -Test: Encrypt -Comment: Set 3, vector 205 -Key: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Plaintext: CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD -Ciphertext: 4579935A483BAC6B4CCD8C25BCC9E6DEAF46EA8B53F8B5E37CC436EAB85A1330 -Test: Encrypt -Comment: Set 3, vector 206 -Key: CECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECE -Plaintext: CECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECE -Ciphertext: E5F810DF5B215F559E76EF925F2B795915A7B03A6F7019FAC8E9127A7CE93F09 -Test: Encrypt -Comment: Set 3, vector 207 -Key: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Plaintext: CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCF -Ciphertext: 2EA0892E2B2F29A63526B37DECD18E31DC970A60E60A4D8414A5BD0D2D5491EF -Test: Encrypt -Comment: Set 3, vector 208 -Key: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Plaintext: D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0 -Ciphertext: 900F155E80A716199EB062827CDDDC4DA857550BA1C265A46D47BE4024706F40 -Test: Encrypt -Comment: Set 3, vector 209 -Key: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Plaintext: D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1 -Ciphertext: 5B495546838A97D8DF4B9CA95EF8350210A3ECAB81469678EBDE1E5846C1F42D -Test: Encrypt -Comment: Set 3, vector 210 -Key: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Plaintext: D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 -Ciphertext: 60E7E367347BC3F4091CE34CCA288C8AFC6375ED8F4394D904FD8489280D50F1 -Test: Encrypt -Comment: Set 3, vector 211 -Key: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Plaintext: D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3 -Ciphertext: F215EED91D35B7BA649F05C3D1E2B254CB1215588AB78DF54F3CA221AB4A3F1B -Test: Encrypt -Comment: Set 3, vector 212 -Key: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Plaintext: D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4 -Ciphertext: 6441A445D808842C6185B81ACBC5AF86386C54C79026BFC21C1DB5111362AA15 -Test: Encrypt -Comment: Set 3, vector 213 -Key: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Plaintext: D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5D5 -Ciphertext: 4EE459EDAC1FE0CB08E80C8C13FCE8C44CBFECF7A7F9F14C15B5A92BB7F34E71 -Test: Encrypt -Comment: Set 3, vector 214 -Key: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Plaintext: D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6 -Ciphertext: 78826499B0F2F402E6DA3CACA36EA35492B7BD2A4D84575D0432E16368E78808 -Test: Encrypt -Comment: Set 3, vector 215 -Key: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Plaintext: D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7 -Ciphertext: BDFBCAE2761BEF6A411156AE01A63F9321EE969C56043F2A44C5D3D4BB017BC0 -Test: Encrypt -Comment: Set 3, vector 216 -Key: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Plaintext: D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8D8 -Ciphertext: 926F2CD84035F9070C3506E6D7245FEA9A845F2D355785BB17E1D3C34FA81228 -Test: Encrypt -Comment: Set 3, vector 217 -Key: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Plaintext: D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9 -Ciphertext: 6C5F6B1C746967142D55FA3769A9417D5A44875D364DB4412B4F9EB254D9BB89 -Test: Encrypt -Comment: Set 3, vector 218 -Key: DADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADA -Plaintext: DADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADA -Ciphertext: 8329A1E54D9F45DB4E8CE6F1B481C3EE00D5511B52B3CDADCBD562A9F1B35770 -Test: Encrypt -Comment: Set 3, vector 219 -Key: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Plaintext: DBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDBDB -Ciphertext: 7A7FEEDEF1950F1A60529743163406CAF167097358377E0650CF0BB35CD783F6 -Test: Encrypt -Comment: Set 3, vector 220 -Key: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Plaintext: DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC -Ciphertext: C52CFB15D2F53156701AE4951AA46BCFC872252447BB14E1CE19CAC074926984 -Test: Encrypt -Comment: Set 3, vector 221 -Key: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Plaintext: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD -Ciphertext: 79DFF8DC12ABCEC71E7FAE55ABC8C374135ECE2D52834BC77B860252B756D54A -Test: Encrypt -Comment: Set 3, vector 222 -Key: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Plaintext: DEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDE -Ciphertext: 62963B66E680BD5602EC86DB7267E15CB1FF6EA698B54EBA661D125400C7F2DD -Test: Encrypt -Comment: Set 3, vector 223 -Key: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Plaintext: DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDF -Ciphertext: 0C2E76743ACC9CC0525D6E2C519D12C369CFA9E27F13068F98D2F32FAD7220CB -Test: Encrypt -Comment: Set 3, vector 224 -Key: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Plaintext: E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 -Ciphertext: B464640E72C30DF092A5BB00F34568A7C04B8620265EDA53F19F3A06164AF980 -Test: Encrypt -Comment: Set 3, vector 225 -Key: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Plaintext: E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1E1 -Ciphertext: 3725215E79F1FE3DC64B4316449FF98EB52D03330BFC848CD83A407475AADA3A -Test: Encrypt -Comment: Set 3, vector 226 -Key: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Plaintext: E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2 -Ciphertext: BA273F544C5076D523CC75F90E315A39E465D2B25434E6577FE629F27061BBA4 -Test: Encrypt -Comment: Set 3, vector 227 -Key: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Plaintext: E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3E3 -Ciphertext: 472161A0F42E64BD0FE6D448996C370E2C3A56BDE16B378EAA31740551121B4E -Test: Encrypt -Comment: Set 3, vector 228 -Key: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Plaintext: E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4 -Ciphertext: EA089A10A597504D057E1F03064C9465C1A707C9472A7C0DBAD6978F5BB83A46 -Test: Encrypt -Comment: Set 3, vector 229 -Key: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Plaintext: E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5E5 -Ciphertext: E91B3433426F88FA31A05E17906E55EA1D803ADFE080C51FBD98290CBF427BEF -Test: Encrypt -Comment: Set 3, vector 230 -Key: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Plaintext: E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6 -Ciphertext: 747C4999D0256384349A5FB132DE1AAD4D7FC48507FEC206B80ED429AF7FDBDB -Test: Encrypt -Comment: Set 3, vector 231 -Key: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Plaintext: E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7 -Ciphertext: 3F8058A1A9B7B0A9C31B4670EEAA6988BF2D41E9B3417EF899EF12CBBC9C77DE -Test: Encrypt -Comment: Set 3, vector 232 -Key: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Plaintext: E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 -Ciphertext: 9DA431EC0DADDEC4A76B3830B20AA03D346AD09691FB98FC0E9A8987F7B70EDF -Test: Encrypt -Comment: Set 3, vector 233 -Key: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Plaintext: E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9E9 -Ciphertext: 63BF528E184A43EF807DC9169BDB9CD7B63EE144478A4735EC2EE3A5A7EE460A -Test: Encrypt -Comment: Set 3, vector 234 -Key: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Plaintext: EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA -Ciphertext: 73DC5F8AFA9493AD7767D15A36E7741044EFC225136B4972DC5294E80071A64D -Test: Encrypt -Comment: Set 3, vector 235 -Key: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Plaintext: EBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEBEB -Ciphertext: 7EEE75D690458A604D20CD21ED64B228F0C3563DB8FB925341FC02845B6E06BA -Test: Encrypt -Comment: Set 3, vector 236 -Key: ECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECEC -Plaintext: ECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECECEC -Ciphertext: AA4D9E1A0157AC347DC7A1997718944427BD579DC18B94F181390E8C36A1305C -Test: Encrypt -Comment: Set 3, vector 237 -Key: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Plaintext: EDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDEDED -Ciphertext: 1695BC5C3D63F4B0E0BC3225F00BB0B8E8D29F3DC09584353E11510002E2BE53 -Test: Encrypt -Comment: Set 3, vector 238 -Key: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Plaintext: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -Ciphertext: C68C7A2FBDA419A515AE816480490BFB2A72A4B6534A19A8D8C6C85FAA949567 -Test: Encrypt -Comment: Set 3, vector 239 -Key: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Plaintext: EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF -Ciphertext: 5F45E7F72A64C66269F83714A88A0701561C3E7AF33BB48887D4439F5DE4A82D -Test: Encrypt -Comment: Set 3, vector 240 -Key: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Plaintext: F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -Ciphertext: AD49A5C8EB06256147F02301FB47710E915B5A8FC3219C0D56A19382977119FC -Test: Encrypt -Comment: Set 3, vector 241 -Key: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Plaintext: F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1 -Ciphertext: 2387AF70EE04E7F25277E81081B044EA24090D503CE8F64997BB610C762D8F6F -Test: Encrypt -Comment: Set 3, vector 242 -Key: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Plaintext: F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2 -Ciphertext: B5D496DD36BA0B47832C170A53760CE5E47B1FF5C28848F5F7A1827E94BC73CB -Test: Encrypt -Comment: Set 3, vector 243 -Key: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Plaintext: F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3 -Ciphertext: 77978F2EAB7E8B6B32C9293B83F51419785A0CD276276CB417ACA806A456A6AE -Test: Encrypt -Comment: Set 3, vector 244 -Key: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Plaintext: F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4 -Ciphertext: E3CBD41F80B27C9A684D7C7C27BBCA9FD59E5E81E93B7BC5BFDF66722EF68EEE -Test: Encrypt -Comment: Set 3, vector 245 -Key: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Plaintext: F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5 -Ciphertext: 4482F0C362CB423104CAA26E1415B0B7519E1189624D313E65D324C6DC95F516 -Test: Encrypt -Comment: Set 3, vector 246 -Key: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Plaintext: F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6 -Ciphertext: CD72EE9A6919348595286348C7E488DB3648458688F72BAD994B26FE6999E676 -Test: Encrypt -Comment: Set 3, vector 247 -Key: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Plaintext: F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7 -Ciphertext: 03EF38F91710AE8BCC8B9193F6A55A7C90C66300D20EDCF5B4946F3B38BEF6C5 -Test: Encrypt -Comment: Set 3, vector 248 -Key: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Plaintext: F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -Ciphertext: B67638D30578AB2319FE275D0B833B50D7ABF01E8760F566D0D441D8EAFDF8AA -Test: Encrypt -Comment: Set 3, vector 249 -Key: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Plaintext: F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 -Ciphertext: 98B05FF6042436505C7163415E187E09F10C3B1A86FA4B458CE1EF31022F5D16 -Test: Encrypt -Comment: Set 3, vector 250 -Key: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Plaintext: FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFAFA -Ciphertext: B670A350A2CF0478412307EF00F97F8B30175CDB7593FF4686BD614B41444342 -Test: Encrypt -Comment: Set 3, vector 251 -Key: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Plaintext: FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFB -Ciphertext: D7FD492E6302265C24FAB910AA1335C29D53406147E853F7604F4AF1A9407E83 -Test: Encrypt -Comment: Set 3, vector 252 -Key: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Plaintext: FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -Ciphertext: 28926789363A4306E2C75FD1D8FDF0FE6B62FDB2AFAEDDA6F47A565C2781968B -Test: Encrypt -Comment: Set 3, vector 253 -Key: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Plaintext: FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD -Ciphertext: 813C816CD4B18F20BD06E2E93CFAA717EBB6554B556CC33D67530608A9BF100F -Test: Encrypt -Comment: Set 3, vector 254 -Key: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Plaintext: FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE -Ciphertext: 5DC15C83E7C4F5AAF8D8482ED1E443271B28B59288783DBCDDEC3544E3368A6E -Test: Encrypt -Comment: Set 3, vector 255 -Key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Plaintext: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -Ciphertext: 0598127BAF11706F77402000D730C54A0B84C868A98C6CA4D7F3C0FA06A78B7A -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/sosemanuk.txt b/external/crypto++-5.6.3/TestVectors/sosemanuk.txt deleted file mode 100644 index 435d89bec..000000000 --- a/external/crypto++-5.6.3/TestVectors/sosemanuk.txt +++ /dev/null @@ -1,25 +0,0 @@ -AlgorithmType: SymmetricCipher -Source: Sosemanuk reference implementation, compiled with -DSOSEMANUK_VECTOR -Key: A7C083FEB7 -IV: 00112233445566778899AABBCCDDEEFF -Name: Sosemanuk -Plaintext: r160 00 -Ciphertext: \ - FE 81 D2 16 2C 9A 10 0D 04 89 5C 45 4A 77 51 5B\ - BE 6A 43 1A 93 5C B9 0E 22 21 EB B7 EF 50 23 28\ - 94 35 39 49 2E FF 63 10 C8 71 05 4C 28 89 CC 72\ - 8F 82 E8 6B 1A FF F4 33 4B 61 27 A1 3A 15 5C 75\ - 15 16 30 BD 48 2E B6 73 FF 5D B4 77 FA 6C 53 EB\ - E1 A4 EC 38 C2 3C 54 00 C3 15 45 5D 93 A2 AC ED\ - 95 98 60 47 27 FA 34 0D 5F 2A 8B D7 57 B7 78 33\ - F7 4B D2 BC 04 93 13 C8 06 16 B4 A0 62 68 AE 35\ - 0D B9 2E EC 4F A5 6C 17 13 74 A6 7A 80 C0 06 D0\ - EA D0 48 CE 7B 64 0F 17 D3 D5 A6 2D 1F 25 1C 21 -Test: Encrypt -Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/sosemanuk/unverified.test-vectors?rev=189&view=auto -Comment: Set 6, vector# 3 -Key: 0F62B5085BAE0154A7FA4DA0F34699EC3F92E5388BDE3184D72A7DD02376C91C -IV: 288FF65DC42B92F960C72E95FC63CA31 -Plaintext: r131072 00 -CiphertextXorDigest: CC09FB7405DD54BBF09407B1D2033FBBAC53F388DD387A46F2B8FCFF692A7838353523A621A55D08DA0CA5348AE96D8B0D6A028F309982EF6628054D01B9A368 -Test: EncryptXorDigest diff --git a/external/crypto++-5.6.3/TestVectors/tea.txt b/external/crypto++-5.6.3/TestVectors/tea.txt deleted file mode 100644 index dc46d3fc4..000000000 --- a/external/crypto++-5.6.3/TestVectors/tea.txt +++ /dev/null @@ -1,711 +0,0 @@ -AlgorithmType: SymmetricCipher -Name: TEA/ECB -Source: http://www.cix.co.uk/~klockstone/teavect.htm -Comment: test 1 -Plaintext: 00000000 00000000 -Key: 00000000 00000000 00000000 00000000 -Ciphertext: 41ea3a0a 94baa940 -Test: Encrypt -Comment: test 2 -Plaintext: 94baa940 00000000 -Key: 00000000 00000000 00000000 41ea3a0a -Ciphertext: 4e8e7829 7d8236d8 -Test: Encrypt -Comment: test 3 -Plaintext: 7d8236d8 00000000 -Key: 00000000 00000000 41ea3a0a 4e8e7829 -Ciphertext: c88ba95e e7edac02 -Test: Encrypt -Comment: test 4 -Plaintext: e7edac02 00000000 -Key: 00000000 41ea3a0a 4e8e7829 c88ba95e -Ciphertext: b84e28af b6b62088 -Test: Encrypt -Comment: test 5 -Plaintext: b6b62088 00000000 -Key: 41ea3a0a 4e8e7829 c88ba95e b84e28af -Ciphertext: a0a47295 8fadf3b3 -Test: Encrypt -Comment: test 6 -Plaintext: 8fadf3b3 41ea3a0a -Key: 4e8e7829 c88ba95e b84e28af a0a47295 -Ciphertext: ed650698 cf9f2b79 -Test: Encrypt -Comment: test 7 -Plaintext: cf9f2b79 4e8e7829 -Key: c88ba95e b84e28af a0a47295 ed650698 -Ciphertext: 1024eea0 6220ae1c -Test: Encrypt -Comment: test 8 -Plaintext: 6220ae1c c88ba95e -Key: b84e28af a0a47295 ed650698 1024eea0 -Ciphertext: 5ddf75d9 7a4ce68f -Test: Encrypt -Comment: test 9 -Plaintext: 7a4ce68f b84e28af -Key: a0a47295 ed650698 1024eea0 5ddf75d9 -Ciphertext: f1be9d1e 8dd4a984 -Test: Encrypt -Comment: test 10 -Plaintext: 8dd4a984 a0a47295 -Key: ed650698 1024eea0 5ddf75d9 f1be9d1e -Ciphertext: d32c758c 092dabad -Test: Encrypt -Comment: test 11 -Plaintext: 092dabad ed650698 -Key: 1024eea0 5ddf75d9 f1be9d1e d32c758c -Ciphertext: bdb43728 f7183fc0 -Test: Encrypt -Comment: test 12 -Plaintext: f7183fc0 1024eea0 -Key: 5ddf75d9 f1be9d1e d32c758c bdb43728 -Ciphertext: a9c3801a d9dcfb4e -Test: Encrypt -Comment: test 13 -Plaintext: d9dcfb4e 5ddf75d9 -Key: f1be9d1e d32c758c bdb43728 a9c3801a -Ciphertext: 32a1e654 a9df917c -Test: Encrypt -Comment: test 14 -Plaintext: a9df917c f1be9d1e -Key: d32c758c bdb43728 a9c3801a 32a1e654 -Ciphertext: 08b63bb9 b20bd3e8 -Test: Encrypt -Comment: test 15 -Plaintext: b20bd3e8 d32c758c -Key: bdb43728 a9c3801a 32a1e654 08b63bb9 -Ciphertext: 21410574 cc4264c6 -Test: Encrypt -Comment: test 16 -Plaintext: cc4264c6 bdb43728 -Key: a9c3801a 32a1e654 08b63bb9 21410574 -Ciphertext: 4ec5d2e2 5ada1d89 -Test: Encrypt -Comment: test 17 -Plaintext: 5ada1d89 a9c3801a -Key: 32a1e654 08b63bb9 21410574 4ec5d2e2 -Ciphertext: dd46249e 28aa0b4b -Test: Encrypt -Comment: test 18 -Plaintext: 28aa0b4b 32a1e654 -Key: 08b63bb9 21410574 4ec5d2e2 dd46249e -Ciphertext: 2486dcba a713df03 -Test: Encrypt -Comment: test 19 -Plaintext: a713df03 08b63bb9 -Key: 21410574 4ec5d2e2 dd46249e 2486dcba -Ciphertext: b7c7af9d 1acb6cab -Test: Encrypt -Comment: test 20 -Plaintext: 1acb6cab 21410574 -Key: 4ec5d2e2 dd46249e 2486dcba b7c7af9d -Ciphertext: 8cc0400a 9aa49fbb -Test: Encrypt -Comment: test 21 -Plaintext: 9aa49fbb 4ec5d2e2 -Key: dd46249e 2486dcba b7c7af9d 8cc0400a -Ciphertext: 9c241876 6cbc8c66 -Test: Encrypt -Comment: test 22 -Plaintext: 6cbc8c66 dd46249e -Key: 2486dcba b7c7af9d 8cc0400a 9c241876 -Ciphertext: b59c5d45 a90066f9 -Test: Encrypt -Comment: test 23 -Plaintext: a90066f9 2486dcba -Key: b7c7af9d 8cc0400a 9c241876 b59c5d45 -Ciphertext: b765a1b3 64b37eb0 -Test: Encrypt -Comment: test 24 -Plaintext: 64b37eb0 b7c7af9d -Key: 8cc0400a 9c241876 b59c5d45 b765a1b3 -Ciphertext: 7b172fac f5ab4933 -Test: Encrypt -Comment: test 25 -Plaintext: f5ab4933 8cc0400a -Key: 9c241876 b59c5d45 b765a1b3 7b172fac -Ciphertext: fe48f4fb ada404b1 -Test: Encrypt -Comment: test 26 -Plaintext: ada404b1 9c241876 -Key: b59c5d45 b765a1b3 7b172fac fe48f4fb -Ciphertext: c5294093 c1d53e3d -Test: Encrypt -Comment: test 27 -Plaintext: c1d53e3d b59c5d45 -Key: b765a1b3 7b172fac fe48f4fb c5294093 -Ciphertext: 759ca8e2 77a96649 -Test: Encrypt -Comment: test 28 -Plaintext: 77a96649 b765a1b3 -Key: 7b172fac fe48f4fb c5294093 759ca8e2 -Ciphertext: 69c53e0f 3e979807 -Test: Encrypt -Comment: test 29 -Plaintext: 3e979807 7b172fac -Key: fe48f4fb c5294093 759ca8e2 69c53e0f -Ciphertext: 60388ada a21fa8e8 -Test: Encrypt -Comment: test 30 -Plaintext: a21fa8e8 fe48f4fb -Key: c5294093 759ca8e2 69c53e0f 60388ada -Ciphertext: df70a1f5 ac4aa407 -Test: Encrypt -Comment: test 31 -Plaintext: ac4aa407 c5294093 -Key: 759ca8e2 69c53e0f 60388ada df70a1f5 -Ciphertext: d9cb4e09 92636233 -Test: Encrypt -Comment: test 32 -Plaintext: 92636233 759ca8e2 -Key: 69c53e0f 60388ada df70a1f5 d9cb4e09 -Ciphertext: 7d2c6c57 7a6adb4d -Test: Encrypt -Comment: test 33 -Plaintext: 7a6adb4d 69c53e0f -Key: 60388ada df70a1f5 d9cb4e09 7d2c6c57 -Ciphertext: 44b71215 cf25368a -Test: Encrypt -Comment: test 34 -Plaintext: cf25368a 60388ada -Key: df70a1f5 d9cb4e09 7d2c6c57 44b71215 -Ciphertext: c10105a1 ef781a18 -Test: Encrypt -Comment: test 35 -Plaintext: ef781a18 df70a1f5 -Key: d9cb4e09 7d2c6c57 44b71215 c10105a1 -Ciphertext: bfdb29fa 9ece39b6 -Test: Encrypt -Comment: test 36 -Plaintext: 9ece39b6 d9cb4e09 -Key: 7d2c6c57 44b71215 c10105a1 bfdb29fa -Ciphertext: 9b0b256d dc04574c -Test: Encrypt -Comment: test 37 -Plaintext: dc04574c 7d2c6c57 -Key: 44b71215 c10105a1 bfdb29fa 9b0b256d -Ciphertext: f8295142 8c022711 -Test: Encrypt -Comment: test 38 -Plaintext: 8c022711 44b71215 -Key: c10105a1 bfdb29fa 9b0b256d f8295142 -Ciphertext: 61341d1c 3a85f2f0 -Test: Encrypt -Comment: test 39 -Plaintext: 3a85f2f0 c10105a1 -Key: bfdb29fa 9b0b256d f8295142 61341d1c -Ciphertext: f6a0d30c ad230209 -Test: Encrypt -Comment: test 40 -Plaintext: ad230209 bfdb29fa -Key: 9b0b256d f8295142 61341d1c f6a0d30c -Ciphertext: 3de21a3f aa0cf5c9 -Test: Encrypt -Comment: test 41 -Plaintext: aa0cf5c9 9b0b256d -Key: f8295142 61341d1c f6a0d30c 3de21a3f -Ciphertext: a7e307c6 bd52d939 -Test: Encrypt -Comment: test 42 -Plaintext: bd52d939 f8295142 -Key: 61341d1c f6a0d30c 3de21a3f a7e307c6 -Ciphertext: 017bc3a7 66fd8c77 -Test: Encrypt -Comment: test 43 -Plaintext: 66fd8c77 61341d1c -Key: f6a0d30c 3de21a3f a7e307c6 017bc3a7 -Ciphertext: d8f8fc86 d01b5761 -Test: Encrypt -Comment: test 44 -Plaintext: d01b5761 f6a0d30c -Key: 3de21a3f a7e307c6 017bc3a7 d8f8fc86 -Ciphertext: e186c41a 5e6e5a4d -Test: Encrypt -Comment: test 45 -Plaintext: 5e6e5a4d 3de21a3f -Key: a7e307c6 017bc3a7 d8f8fc86 e186c41a -Ciphertext: 4368d224 dbb4e677 -Test: Encrypt -Comment: test 46 -Plaintext: dbb4e677 a7e307c6 -Key: 017bc3a7 d8f8fc86 e186c41a 4368d224 -Ciphertext: 9bd0321e 84096523 -Test: Encrypt -Comment: test 47 -Plaintext: 84096523 017bc3a7 -Key: d8f8fc86 e186c41a 4368d224 9bd0321e -Ciphertext: b7c56d5b 97c65866 -Test: Encrypt -Comment: test 48 -Plaintext: 97c65866 d8f8fc86 -Key: e186c41a 4368d224 9bd0321e b7c56d5b -Ciphertext: 63a1bfac 5a5d7ca2 -Test: Encrypt -Comment: test 49 -Plaintext: 5a5d7ca2 e186c41a -Key: 4368d224 9bd0321e b7c56d5b 63a1bfac -Ciphertext: 91f56dff 7281794f -Test: Encrypt -Comment: test 50 -Plaintext: 7281794f 4368d224 -Key: 9bd0321e b7c56d5b 63a1bfac 91f56dff -Ciphertext: e4c63780 019aedf7 -Test: Encrypt -Comment: test 51 -Plaintext: 019aedf7 9bd0321e -Key: b7c56d5b 63a1bfac 91f56dff e4c63780 -Ciphertext: a9fb56e7 35f4aeca -Test: Encrypt -Comment: test 52 -Plaintext: 35f4aeca b7c56d5b -Key: 63a1bfac 91f56dff e4c63780 a9fb56e7 -Ciphertext: a6537187 f0f1ba93 -Test: Encrypt -Comment: test 53 -Plaintext: f0f1ba93 63a1bfac -Key: 91f56dff e4c63780 a9fb56e7 a6537187 -Ciphertext: cc960eda e44c6b8f -Test: Encrypt -Comment: test 54 -Plaintext: e44c6b8f 91f56dff -Key: e4c63780 a9fb56e7 a6537187 cc960eda -Ciphertext: e12f106d 4f1152d0 -Test: Encrypt -Comment: test 55 -Plaintext: 4f1152d0 e4c63780 -Key: a9fb56e7 a6537187 cc960eda e12f106d -Ciphertext: 556ad853 f79992fd -Test: Encrypt -Comment: test 56 -Plaintext: f79992fd a9fb56e7 -Key: a6537187 cc960eda e12f106d 556ad853 -Ciphertext: 78e8e265 128df6ad -Test: Encrypt -Comment: test 57 -Plaintext: 128df6ad a6537187 -Key: cc960eda e12f106d 556ad853 78e8e265 -Ciphertext: f23892aa 288cb926 -Test: Encrypt -Comment: test 58 -Plaintext: 288cb926 cc960eda -Key: e12f106d 556ad853 78e8e265 f23892aa -Ciphertext: 1d115839 6a117fca -Test: Encrypt -Comment: test 59 -Plaintext: 6a117fca e12f106d -Key: 556ad853 78e8e265 f23892aa 1d115839 -Ciphertext: cf899635 5b087e34 -Test: Encrypt -Comment: test 60 -Plaintext: 5b087e34 556ad853 -Key: 78e8e265 f23892aa 1d115839 cf899635 -Ciphertext: 5c60bff2 e68d88c2 -Test: Encrypt -Comment: test 61 -Plaintext: e68d88c2 78e8e265 -Key: f23892aa 1d115839 cf899635 5c60bff2 -Ciphertext: 7072d01c bffeb50a -Test: Encrypt -Comment: test 62 -Plaintext: bffeb50a f23892aa -Key: 1d115839 cf899635 5c60bff2 7072d01c -Ciphertext: 4513c5eb 9c99ae9e -Test: Encrypt -Comment: test 63 -Plaintext: 9c99ae9e 1d115839 -Key: cf899635 5c60bff2 7072d01c 4513c5eb -Ciphertext: 8f3a38ab 80d9c4ad -Test: Encrypt -Comment: test 64 -Plaintext: 80d9c4ad cf899635 -Key: 5c60bff2 7072d01c 4513c5eb 8f3a38ab -Ciphertext: 2bb0f1b3 c023ed11 -Test: Encrypt - -AlgorithmType: SymmetricCipher -Name: XTEA/ECB -Source: http://www.cix.co.uk/~klockstone/teavect.htm -Comment: test 1 -Plaintext: 00000000 00000000 -Key: 00000000 00000000 00000000 00000000 -Rounds: 1 -Ciphertext: 00000000 9e3779b9 -Test: Encrypt -Comment: test 2 -Plaintext: 9e3779b9 00000000 -Key: 00000000 00000000 00000000 00000000 -Rounds: 2 -Ciphertext: ec01a1de aaa0256d -Test: Encrypt -Comment: test 3 -Plaintext: aaa0256d 00000000 -Key: 00000000 00000000 00000000 ec01a1de -Rounds: 3 -Ciphertext: 114f6d74 a39e590c -Test: Encrypt -Comment: test 4 -Plaintext: a39e590c 00000000 -Key: 00000000 00000000 ec01a1de 114f6d74 -Rounds: 4 -Ciphertext: bc3a7de2 4e238eb9 -Test: Encrypt -Comment: test 5 -Plaintext: 4e238eb9 00000000 -Key: 00000000 ec01a1de 114f6d74 bc3a7de2 -Rounds: 5 -Ciphertext: 845846cf 2f36d07f -Test: Encrypt -Comment: test 6 -Plaintext: 2f36d07f 00000000 -Key: ec01a1de 114f6d74 bc3a7de2 845846cf -Rounds: 6 -Ciphertext: 2794a127 4f3e4b6a -Test: Encrypt -Comment: test 7 -Plaintext: 4f3e4b6a ec01a1de -Key: 114f6d74 bc3a7de2 845846cf 2794a127 -Rounds: 7 -Ciphertext: 6b8ea8b8 d99e66c3 -Test: Encrypt -Comment: test 8 -Plaintext: d99e66c3 114f6d74 -Key: bc3a7de2 845846cf 2794a127 6b8ea8b8 -Rounds: 8 -Ciphertext: 31c5fa6c 241756d6 -Test: Encrypt -Comment: test 9 -Plaintext: 241756d6 bc3a7de2 -Key: 845846cf 2794a127 6b8ea8b8 31c5fa6c -Rounds: 9 -Ciphertext: 4a581696 1fd58a6b -Test: Encrypt -Comment: test 10 -Plaintext: 1fd58a6b 845846cf -Key: 2794a127 6b8ea8b8 31c5fa6c 4a581696 -Rounds: 10 -Ciphertext: dfcd0451 df8822cd -Test: Encrypt -Comment: test 11 -Plaintext: df8822cd 2794a127 -Key: 6b8ea8b8 31c5fa6c 4a581696 dfcd0451 -Rounds: 11 -Ciphertext: 3ad1ff17 f465776c -Test: Encrypt -Comment: test 12 -Plaintext: f465776c 6b8ea8b8 -Key: 31c5fa6c 4a581696 dfcd0451 3ad1ff17 -Rounds: 12 -Ciphertext: 6a1d78c8 4d30bdb9 -Test: Encrypt -Comment: test 13 -Plaintext: 4d30bdb9 31c5fa6c -Key: 4a581696 dfcd0451 3ad1ff17 6a1d78c8 -Rounds: 13 -Ciphertext: 08c86d67 f6ef939b -Test: Encrypt -Comment: test 14 -Plaintext: f6ef939b 4a581696 -Key: dfcd0451 3ad1ff17 6a1d78c8 08c86d67 -Rounds: 14 -Ciphertext: 2a65bfbe f733428c -Test: Encrypt -Comment: test 15 -Plaintext: f733428c dfcd0451 -Key: 3ad1ff17 6a1d78c8 08c86d67 2a65bfbe -Rounds: 15 -Ciphertext: b4bd6e46 40672bcc -Test: Encrypt -Comment: test 16 -Plaintext: 40672bcc 3ad1ff17 -Key: 6a1d78c8 08c86d67 2a65bfbe b4bd6e46 -Rounds: 16 -Ciphertext: 1d8e6992 9a478905 -Test: Encrypt -Comment: test 17 -Plaintext: 9a478905 6a1d78c8 -Key: 08c86d67 2a65bfbe b4bd6e46 1d8e6992 -Rounds: 17 -Ciphertext: f8994ada 80dee76a -Test: Encrypt -Comment: test 18 -Plaintext: 80dee76a 08c86d67 -Key: 2a65bfbe b4bd6e46 1d8e6992 f8994ada -Rounds: 18 -Ciphertext: 0997e6ed cdfef370 -Test: Encrypt -Comment: test 19 -Plaintext: cdfef370 2a65bfbe -Key: b4bd6e46 1d8e6992 f8994ada 0997e6ed -Rounds: 19 -Ciphertext: ece50553 10b76c66 -Test: Encrypt -Comment: test 20 -Plaintext: 10b76c66 b4bd6e46 -Key: 1d8e6992 f8994ada 0997e6ed ece50553 -Rounds: 20 -Ciphertext: a6d39c7b dce1a473 -Test: Encrypt -Comment: test 21 -Plaintext: dce1a473 1d8e6992 -Key: f8994ada 0997e6ed ece50553 a6d39c7b -Rounds: 21 -Ciphertext: 21d06fb7 fbb98544 -Test: Encrypt -Comment: test 22 -Plaintext: fbb98544 f8994ada -Key: 0997e6ed ece50553 a6d39c7b 21d06fb7 -Rounds: 22 -Ciphertext: 72cdd36c e1115fb6 -Test: Encrypt -Comment: test 23 -Plaintext: e1115fb6 0997e6ed -Key: ece50553 a6d39c7b 21d06fb7 72cdd36c -Rounds: 23 -Ciphertext: 25bc6eb3 e4c28ab7 -Test: Encrypt -Comment: test 24 -Plaintext: e4c28ab7 ece50553 -Key: a6d39c7b 21d06fb7 72cdd36c 25bc6eb3 -Rounds: 24 -Ciphertext: 4932a288 78020b9e -Test: Encrypt -Comment: test 25 -Plaintext: 78020b9e a6d39c7b -Key: 21d06fb7 72cdd36c 25bc6eb3 4932a288 -Rounds: 25 -Ciphertext: 25285da1 b66c4459 -Test: Encrypt -Comment: test 26 -Plaintext: b66c4459 21d06fb7 -Key: 72cdd36c 25bc6eb3 4932a288 25285da1 -Rounds: 26 -Ciphertext: 39b0155c f227ab20 -Test: Encrypt -Comment: test 27 -Plaintext: f227ab20 72cdd36c -Key: 25bc6eb3 4932a288 25285da1 39b0155c -Rounds: 27 -Ciphertext: 547571aa f38f1e39 -Test: Encrypt -Comment: test 28 -Plaintext: f38f1e39 25bc6eb3 -Key: 4932a288 25285da1 39b0155c 547571aa -Rounds: 28 -Ciphertext: 27f917b1 e5796aee -Test: Encrypt -Comment: test 29 -Plaintext: e5796aee 4932a288 -Key: 25285da1 39b0155c 547571aa 27f917b1 -Rounds: 29 -Ciphertext: c1da8993 670f9fd2 -Test: Encrypt -Comment: test 30 -Plaintext: 670f9fd2 25285da1 -Key: 39b0155c 547571aa 27f917b1 c1da8993 -Rounds: 30 -Ciphertext: 60e2acaa d0a60db4 -Test: Encrypt -Comment: test 31 -Plaintext: d0a60db4 39b0155c -Key: 547571aa 27f917b1 c1da8993 60e2acaa -Rounds: 31 -Ciphertext: a6eb923d af20a390 -Test: Encrypt -Comment: test 32 -Plaintext: af20a390 547571aa -Key: 27f917b1 c1da8993 60e2acaa a6eb923d -Rounds: 32 -Ciphertext: d26428af 0a202283 -Test: Encrypt -Comment: test 33 -Plaintext: 0a202283 27f917b1 -Key: c1da8993 60e2acaa a6eb923d d26428af -Rounds: 33 -Ciphertext: 1c03ceb9 96e9f2d3 -Test: Encrypt -Comment: test 34 -Plaintext: 96e9f2d3 c1da8993 -Key: 60e2acaa a6eb923d d26428af 1c03ceb9 -Rounds: 34 -Ciphertext: e260b3c1 bbd7dff0 -Test: Encrypt -Comment: test 35 -Plaintext: bbd7dff0 60e2acaa -Key: a6eb923d d26428af 1c03ceb9 e260b3c1 -Rounds: 35 -Ciphertext: d33073f9 12841b97 -Test: Encrypt -Comment: test 36 -Plaintext: 12841b97 a6eb923d -Key: d26428af 1c03ceb9 e260b3c1 d33073f9 -Rounds: 36 -Ciphertext: 17b7ea05 1d723f18 -Test: Encrypt -Comment: test 37 -Plaintext: 1d723f18 d26428af -Key: 1c03ceb9 e260b3c1 d33073f9 17b7ea05 -Rounds: 37 -Ciphertext: 9f571045 31e849b9 -Test: Encrypt -Comment: test 38 -Plaintext: 31e849b9 1c03ceb9 -Key: e260b3c1 d33073f9 17b7ea05 9f571045 -Rounds: 38 -Ciphertext: 288351d2 bd0a0054 -Test: Encrypt -Comment: test 39 -Plaintext: bd0a0054 e260b3c1 -Key: d33073f9 17b7ea05 9f571045 288351d2 -Rounds: 39 -Ciphertext: 9236883a 2bd13143 -Test: Encrypt -Comment: test 40 -Plaintext: 2bd13143 d33073f9 -Key: 17b7ea05 9f571045 288351d2 9236883a -Rounds: 40 -Ciphertext: e91dcf23 7c3fd716 -Test: Encrypt -Comment: test 41 -Plaintext: 7c3fd716 17b7ea05 -Key: 9f571045 288351d2 9236883a e91dcf23 -Rounds: 41 -Ciphertext: 5c8ff51e c3abe43d -Test: Encrypt -Comment: test 42 -Plaintext: c3abe43d 9f571045 -Key: 288351d2 9236883a e91dcf23 5c8ff51e -Rounds: 42 -Ciphertext: 446e9f7c ecb0eb4d -Test: Encrypt -Comment: test 43 -Plaintext: ecb0eb4d 288351d2 -Key: 9236883a e91dcf23 5c8ff51e 446e9f7c -Rounds: 43 -Ciphertext: 86455f77 ffc74050 -Test: Encrypt -Comment: test 44 -Plaintext: ffc74050 9236883a -Key: e91dcf23 5c8ff51e 446e9f7c 86455f77 -Rounds: 44 -Ciphertext: ae85d873 e21ef8d3 -Test: Encrypt -Comment: test 45 -Plaintext: e21ef8d3 e91dcf23 -Key: 5c8ff51e 446e9f7c 86455f77 ae85d873 -Rounds: 45 -Ciphertext: cf411a68 18dce768 -Test: Encrypt -Comment: test 46 -Plaintext: 18dce768 5c8ff51e -Key: 446e9f7c 86455f77 ae85d873 cf411a68 -Rounds: 46 -Ciphertext: 4ef68794 07d2b1b3 -Test: Encrypt -Comment: test 47 -Plaintext: 07d2b1b3 446e9f7c -Key: 86455f77 ae85d873 cf411a68 4ef68794 -Rounds: 47 -Ciphertext: d75a1925 07476976 -Test: Encrypt -Comment: test 48 -Plaintext: 07476976 86455f77 -Key: ae85d873 cf411a68 4ef68794 d75a1925 -Rounds: 48 -Ciphertext: 909d29cb 16b37e1b -Test: Encrypt -Comment: test 49 -Plaintext: 16b37e1b ae85d873 -Key: cf411a68 4ef68794 d75a1925 909d29cb -Rounds: 49 -Ciphertext: e05578cd bd40cd0c -Test: Encrypt -Comment: test 50 -Plaintext: bd40cd0c cf411a68 -Key: 4ef68794 d75a1925 909d29cb e05578cd -Rounds: 50 -Ciphertext: 988b50e5 adf1b74c -Test: Encrypt -Comment: test 51 -Plaintext: adf1b74c 4ef68794 -Key: d75a1925 909d29cb e05578cd 988b50e5 -Rounds: 51 -Ciphertext: 90699d3d d2333c19 -Test: Encrypt -Comment: test 52 -Plaintext: d2333c19 d75a1925 -Key: 909d29cb e05578cd 988b50e5 90699d3d -Rounds: 52 -Ciphertext: a119eb2e 3488c65b -Test: Encrypt -Comment: test 53 -Plaintext: 3488c65b 909d29cb -Key: e05578cd 988b50e5 90699d3d a119eb2e -Rounds: 53 -Ciphertext: e4c43e62 e9c4894b -Test: Encrypt -Comment: test 54 -Plaintext: e9c4894b e05578cd -Key: 988b50e5 90699d3d a119eb2e e4c43e62 -Rounds: 54 -Ciphertext: e1aec3f2 1976c384 -Test: Encrypt -Comment: test 55 -Plaintext: 1976c384 988b50e5 -Key: 90699d3d a119eb2e e4c43e62 e1aec3f2 -Rounds: 55 -Ciphertext: 1b7b0e2b 0b392b46 -Test: Encrypt -Comment: test 56 -Plaintext: 0b392b46 90699d3d -Key: a119eb2e e4c43e62 e1aec3f2 1b7b0e2b -Rounds: 56 -Ciphertext: 1a6ffc0c 600f2ee0 -Test: Encrypt -Comment: test 57 -Plaintext: 600f2ee0 a119eb2e -Key: e4c43e62 e1aec3f2 1b7b0e2b 1a6ffc0c -Rounds: 57 -Ciphertext: 82ccc9d3 94ba3d77 -Test: Encrypt -Comment: test 58 -Plaintext: 94ba3d77 e4c43e62 -Key: e1aec3f2 1b7b0e2b 1a6ffc0c 82ccc9d3 -Rounds: 58 -Ciphertext: 38b5ebd1 c56af77e -Test: Encrypt -Comment: test 59 -Plaintext: c56af77e e1aec3f2 -Key: 1b7b0e2b 1a6ffc0c 82ccc9d3 38b5ebd1 -Rounds: 59 -Ciphertext: f5571f9d fe136a04 -Test: Encrypt -Comment: test 60 -Plaintext: fe136a04 1b7b0e2b -Key: 1a6ffc0c 82ccc9d3 38b5ebd1 f5571f9d -Rounds: 60 -Ciphertext: 62ee209f 08550367 -Test: Encrypt -Comment: test 61 -Plaintext: 08550367 1a6ffc0c -Key: 82ccc9d3 38b5ebd1 f5571f9d 62ee209f -Rounds: 61 -Ciphertext: 069b7afc b0fcde91 -Test: Encrypt -Comment: test 62 -Plaintext: b0fcde91 82ccc9d3 -Key: 38b5ebd1 f5571f9d 62ee209f 069b7afc -Rounds: 62 -Ciphertext: 376a8936 11b9c087 -Test: Encrypt -Comment: test 63 -Plaintext: 11b9c087 38b5ebd1 -Key: f5571f9d 62ee209f 069b7afc 376a8936 -Rounds: 63 -Ciphertext: cdc9e923 2e6c1fe7 -Test: Encrypt -Comment: test 64 -Plaintext: 2e6c1fe7 f5571f9d -Key: 62ee209f 069b7afc 376a8936 cdc9e923 -Rounds: 64 -Ciphertext: 7a01cbc9 b03d6068 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/ttmac.txt b/external/crypto++-5.6.3/TestVectors/ttmac.txt deleted file mode 100644 index ec2e683f0..000000000 --- a/external/crypto++-5.6.3/TestVectors/ttmac.txt +++ /dev/null @@ -1,40 +0,0 @@ -AlgorithmType: MAC -Name: Two-Track-MAC -Source: NESSIE submission -Comment: Key for all test cases -Key: 00112233445566778899aabbccddeeff01234567 -Comment: Test Case 1 -Message: "" -MAC: 2dec8ed4a0fd712ed9fbf2ab466ec2df21215e4a -Test: Verify -Comment: Test Case 2 -Message: "a" -MAC: 5893e3e6e306704dd77ad6e6ed432cde321a7756 -Test: Verify -Comment: Test Case 3 -Message: "abc" -MAC: 70bfd1029797a5c16da5b557a1f0b2779b78497e -Test: Verify -Comment: Test Case 4 -Message: "message digest" -MAC: 8289f4f19ffe4f2af737de4bd71c829d93a972fa -Test: Verify -Comment: Test Case 5 -Message: "abcdefghijklmnopqrstuvwxyz" -MAC: 2186ca09c5533198b7371f245273504ca92bae60 -Test: Verify -Comment: Test Case 6 -Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -MAC: 8a7bf77aef62a2578497a27c0d6518a429e7c14d -Test: Verify -Comment: Test Case 7 -Message: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" -MAC: 54bac392a886806d169556fcbb6789b54fb364fb -Test: Verify -Comment: Test Case 8 -Message: r8 "1234567890" -MAC: 0ced2c9f8f0d9d03981ab5c8184bac43dd54c484 -Test: Verify -Comment: Test Case 9 -Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -MAC: 27b3aedb5df8b629f0142194daa3846e1895f3d2 diff --git a/external/crypto++-5.6.3/TestVectors/vmac.txt b/external/crypto++-5.6.3/TestVectors/vmac.txt deleted file mode 100644 index 1d983cd95..000000000 --- a/external/crypto++-5.6.3/TestVectors/vmac.txt +++ /dev/null @@ -1,77 +0,0 @@ -AlgorithmType: MAC -Name: VMAC(AES)-64 -Source: http://www.fastcrypto.org/vmac/draft-krovetz-vmac-01.txt -Key: "abcdefghijklmnop" -IV: "bcdefghi" -Message: "" -MAC: 2576BE1C56D8B81B -Test: Verify -Message: "abc" -MAC: 2D376CF5B1813CE5 -Test: Verify -Message: r16 "abc" -MAC: E8421F61D573D298 -Test: Verify -Message: r100 "abc" -MAC: 4492DF6C5CAC1BBE -Test: Verify -Message: r1000000 "abc" -MAC: 09BA597DD7601113 -Test: Verify -Message: r42 "abc" "ab" -MAC: D638B73921F184DE -Test: Verify -Message: r170 "abc" "ab" -MAC: 9DA310281E6FD0A0 -Test: Verify -Message: r65 "a" -MAC: 90 ea 57 cb 51 bc 92 a3 -Test: Verify -Message: r129 "a" -MAC: 86 34 83 87 d1 3d 82 33 -Test: Verify -Message: r65 "abc" -MAC: E86A86EC77A8BF61 -Test: Verify -Message: "abc" -MAC: 2D376CF5B1813CE0 -Test: NotVerify - -AlgorithmType: MAC -Name: VMAC(AES)-128 -Source: http://www.fastcrypto.org/vmac/draft-krovetz-vmac-01.txt -Key: "abcdefghijklmnop" -IV: "bcdefghi" -Message: "" -MAC: 472766C70F74ED23481D6D7DE4E80DAC -Test: Verify -Message: "abc" -MAC: 4EE815A06A1D71EDD36FC75D51188A42 -Test: Verify -Message: r16 "abc" -MAC: 09F2C80C8E1007A0C12FAE19FE4504AE -Test: Verify -Message: r100 "abc" -MAC: 66438817154850C61D8A412164803BCB -Test: Verify -Message: r1000000 "abc" -MAC: 2B6B02288FFC461B75485DE893C629DC -Test: Verify -Message: r42 "abc" "ab" -MAC: F7E95FE3DA8DB9E6BB973E65D0B4CEA5 -Test: Verify -Message: r170 "abc" "ab" -MAC: BF53B8D2D70C05A85880C2E21CAF1299 -Test: Verify -Message: r65 "a" -MAC: b2 9b 00 76 0a 58 c7 ab 92 d6 60 24 d6 9c 1b 92 -Test: Verify -Message: r129 "a" -MAC: a7 e5 2c 32 89 d9 b7 3b 53 57 6f 05 95 85 ee 79 -Test: Verify -Message: r65 "abc" -MAC: 0A1B2F973044F469F405917E45010334 -Test: Verify -Message: "abc" -MAC: 4EE815A06A1D71EDD36FC75D51188A40 -Test: NotVerify diff --git a/external/crypto++-5.6.3/TestVectors/wake.txt b/external/crypto++-5.6.3/TestVectors/wake.txt deleted file mode 100644 index 2dd80a2a1..000000000 --- a/external/crypto++-5.6.3/TestVectors/wake.txt +++ /dev/null @@ -1,10 +0,0 @@ -AlgorithmType: SymmetricCipher -Source: Generated by Crypto++ 5.6.1 -Key: r2 00112233445566778899AABBCCDDEEFF -Plaintext: r80 00 r80 01 -Name: WAKE-OFB-LE -Ciphertext: FFEEDDCCDF42B9D4939C351568AB4888BD9264CA66CF7F7885141F6934F3F390F1987B8609B733919DC5F73F7BED93ECDCD4F35FF32828553B8AFAD113DDA6565932553D9143AA886AE859167327F3C260434E6C90A0895FD33E6B6412526521FA0B12F4ECEE3E8F4F96DCF70907AAFB5E29C40FC10EB70A4970736E98DF98C615AC844A46FB8E4AEBBBF599DF7B73930B94776C6C8757BE51B34E71E9B514AE -Test: Encrypt -Name: WAKE-OFB-BE -Ciphertext: CCDDEEFFD4B942DF15359C938848AB68CA6492BD787FCF66691F148590F3F334867B98F19133B7093FF7C59DEC93ED7B5FF3D4DC552828F3D1FA8A3B56A6DD133D55325988AA43911659E86AC2F327736C4E43605F89A090646B3ED321655212F4120BFA8F3EEEECF7DC964FFBAA07090FC4295E0AB70EC16E737049C698DF984A84AC154A8EFB4699F5BBEB93737BDF6C77940BBE57876C714EB351AE14B5E9 -Test: Encrypt diff --git a/external/crypto++-5.6.3/TestVectors/whrlpool.txt b/external/crypto++-5.6.3/TestVectors/whrlpool.txt deleted file mode 100644 index 9a4df8bbe..000000000 --- a/external/crypto++-5.6.3/TestVectors/whrlpool.txt +++ /dev/null @@ -1,39 +0,0 @@ -AlgorithmType: MessageDigest -Name: Whirlpool -Source: ISO test vectors in http://planeta.terra.com.br/informatica/paulobarreto/whirlpool.zip -Message: "" -Digest: 19FA61D75522A466 9B44E39C1D2E1726 C530232130D407F8 9AFEE0964997F7A7\ - 3E83BE698B288FEB CF88E3E03C4F0757 EA8964E59B63D937 08B138CC42A66EB3 -Test: Verify -Message: "a" -Digest: 8ACA2602792AEC6F 11A67206531FB7D7 F0DFF59413145E69 73C45001D0087B42\ - D11BC645413AEFF6 3A42391A39145A59 1A92200D560195E5 3B478584FDAE231A -Test: Verify -Message: "abc" -Digest: 4E2448A4C6F486BB 16B6562C73B4020B F3043E3A731BCE72 1AE1B303D97E6D4C\ - 7181EEBDB6C57E27 7D0E34957114CBD6 C797FC9D95D8B582 D225292076D4EEF5 -Test: Verify -Message: "message digest" -Digest: 378C84A4126E2DC6 E56DCC7458377AAC 838D00032230F53C E1F5700C0FFB4D3B\ - 8421557659EF55C1 06B4B52AC5A4AAA6 92ED920052838F33 62E86DBD37A8903E -Test: Verify -Message: "abcdefghijklmnopqrstuvwxyz" -Digest: F1D754662636FFE9 2C82EBB9212A484A 8D38631EAD4238F5 442EE13B8054E41B\ - 08BF2A9251C30B6A 0B8AAE86177AB4A6 F68F673E7207865D 5D9819A3DBA4EB3B -Test: Verify -Message: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" -Digest: DC37E008CF9EE69B F11F00ED9ABA2690 1DD7C28CDEC066CC 6AF42E40F82F3A1E\ - 08EBA26629129D8F B7CB57211B9281A6 5517CC879D7B9621 42C65F5A7AF01467 -Test: Verify -Message: r8 "1234567890" -Digest: 466EF18BABB0154D 25B9D38A6414F5C0 8784372BCCB204D6 549C4AFADB601429\ - 4D5BD8DF2A6C44E5 38CD047B2681A51A 2C60481E88C5A20B 2C2A80CF3A9A083B -Test: Verify -Message: "abcdbcdecdefdefgefghfghighijhijk" -Digest: 2A987EA40F917061 F5D6F0A0E4644F48 8A7A5A52DEEE6562 07C562F988E95C69\ - 16BDC8031BC5BE1B 7B947639FE050B56 939BAAA0ADFF9AE6 745B7B181C3BE3FD -Test: Verify -Message: r1000000 "a" -Digest: 0C99005BEB57EFF5 0A7CF005560DDF5D 29057FD86B20BFD6 2DECA0F1CCEA4AF5\ - 1FC15490EDDC47AF 32BB2B66C34FF9AD 8C6008AD677F7712 6953B226E4ED8B01 -Test: Verify diff --git a/external/crypto++-5.6.3/adhoc.cpp.proto b/external/crypto++-5.6.3/adhoc.cpp.proto deleted file mode 100644 index f2502259d..000000000 --- a/external/crypto++-5.6.3/adhoc.cpp.proto +++ /dev/null @@ -1,23 +0,0 @@ -#include "config.h" -#include - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100 4189 4996) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunused-variable" -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -extern int (*AdhocTest)(int argc, char *argv[]); - -int MyAdhocTest(int argc, char *argv[]) -{ - CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv); - return 0; -} - -static int s_i = (AdhocTest = &MyAdhocTest, 0); diff --git a/external/crypto++-5.6.3/adler32.cpp b/external/crypto++-5.6.3/adler32.cpp deleted file mode 100644 index 4b3cdb630..000000000 --- a/external/crypto++-5.6.3/adler32.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// adler32.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "adler32.h" - -NAMESPACE_BEGIN(CryptoPP) - -void Adler32::Update(const byte *input, size_t length) -{ - const unsigned long BASE = 65521; - - unsigned long s1 = m_s1; - unsigned long s2 = m_s2; - - if (length % 8 != 0) - { - do - { - s1 += *input++; - s2 += s1; - length--; - } while (length % 8 != 0); - - if (s1 >= BASE) - s1 -= BASE; - s2 %= BASE; - } - - while (length > 0) - { - s1 += input[0]; s2 += s1; - s1 += input[1]; s2 += s1; - s1 += input[2]; s2 += s1; - s1 += input[3]; s2 += s1; - s1 += input[4]; s2 += s1; - s1 += input[5]; s2 += s1; - s1 += input[6]; s2 += s1; - s1 += input[7]; s2 += s1; - - length -= 8; - input += 8; - - if (s1 >= BASE) - s1 -= BASE; - if (length % 0x8000 == 0) - s2 %= BASE; - } - - assert(s1 < BASE); - assert(s2 < BASE); - - m_s1 = (word16)s1; - m_s2 = (word16)s2; -} - -void Adler32::TruncatedFinal(byte *hash, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - switch (size) - { - default: - hash[3] = byte(m_s1); - // fall through - case 3: - hash[2] = byte(m_s1 >> 8); - // fall through - case 2: - hash[1] = byte(m_s2); - // fall through - case 1: - hash[0] = byte(m_s2 >> 8); - // fall through - case 0: - ;; - // fall through - } - - Reset(); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/adler32.h b/external/crypto++-5.6.3/adler32.h deleted file mode 100644 index e538b5a1e..000000000 --- a/external/crypto++-5.6.3/adler32.h +++ /dev/null @@ -1,34 +0,0 @@ -// adler32.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile adler32.h -//! \brief Class file for ADLER-32 checksum calculations - -#ifndef CRYPTOPP_ADLER32_H -#define CRYPTOPP_ADLER32_H - -#include "cryptlib.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! ADLER-32 checksum calculations -class Adler32 : public HashTransformation -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 4) - Adler32() {Reset();} - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *hash, size_t size); - unsigned int DigestSize() const {return DIGESTSIZE;} - static const char * StaticAlgorithmName() {return "Adler32";} - std::string AlgorithmName() const {return StaticAlgorithmName();} - -private: - void Reset() {m_s1 = 1; m_s2 = 0;} - - word16 m_s1, m_s2; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/aes.h b/external/crypto++-5.6.3/aes.h deleted file mode 100644 index 6a5355348..000000000 --- a/external/crypto++-5.6.3/aes.h +++ /dev/null @@ -1,21 +0,0 @@ -// aes.h - written and placed in the public domain by Wei Dai - -//! \file -//! \brief Class file for the AES cipher (Rijndael) - -#ifndef CRYPTOPP_AES_H -#define CRYPTOPP_AES_H - -#include "rijndael.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! AES winner, announced on 10/2/2000 -DOCUMENTED_TYPEDEF(Rijndael, AES); - -typedef RijndaelEncryption AESEncryption; -typedef RijndaelDecryption AESDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/algebra.cpp b/external/crypto++-5.6.3/algebra.cpp deleted file mode 100644 index d577af550..000000000 --- a/external/crypto++-5.6.3/algebra.cpp +++ /dev/null @@ -1,341 +0,0 @@ -// algebra.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_ALGEBRA_CPP // SunCC workaround: compiler could cause this file to be included twice -#define CRYPTOPP_ALGEBRA_CPP - -#include "algebra.h" -#include "integer.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -template const T& AbstractGroup::Double(const Element &a) const -{ - return this->Add(a, a); -} - -template const T& AbstractGroup::Subtract(const Element &a, const Element &b) const -{ - // make copy of a in case Inverse() overwrites it - Element a1(a); - return this->Add(a1, Inverse(b)); -} - -template T& AbstractGroup::Accumulate(Element &a, const Element &b) const -{ - return a = this->Add(a, b); -} - -template T& AbstractGroup::Reduce(Element &a, const Element &b) const -{ - return a = this->Subtract(a, b); -} - -template const T& AbstractRing::Square(const Element &a) const -{ - return this->Multiply(a, a); -} - -template const T& AbstractRing::Divide(const Element &a, const Element &b) const -{ - // make copy of a in case MultiplicativeInverse() overwrites it - Element a1(a); - return this->Multiply(a1, this->MultiplicativeInverse(b)); -} - -template const T& AbstractEuclideanDomain::Mod(const Element &a, const Element &b) const -{ - Element q; - this->DivisionAlgorithm(result, q, a, b); - return result; -} - -template const T& AbstractEuclideanDomain::Gcd(const Element &a, const Element &b) const -{ - Element g[3]={b, a}; - unsigned int i0=0, i1=1, i2=2; - - while (!this->Equal(g[i1], this->Identity())) - { - g[i2] = this->Mod(g[i0], g[i1]); - unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; - } - - return result = g[i0]; -} - -template const typename QuotientRing::Element& QuotientRing::MultiplicativeInverse(const Element &a) const -{ - Element g[3]={m_modulus, a}; - Element v[3]={m_domain.Identity(), m_domain.MultiplicativeIdentity()}; - Element y; - unsigned int i0=0, i1=1, i2=2; - - while (!this->Equal(g[i1], this->Identity())) - { - // y = g[i0] / g[i1]; - // g[i2] = g[i0] % g[i1]; - m_domain.DivisionAlgorithm(g[i2], y, g[i0], g[i1]); - // v[i2] = v[i0] - (v[i1] * y); - v[i2] = m_domain.Subtract(v[i0], m_domain.Multiply(v[i1], y)); - unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; - } - - return m_domain.IsUnit(g[i0]) ? m_domain.Divide(v[i0], g[i0]) : m_domain.Identity(); -} - -template T AbstractGroup::ScalarMultiply(const Element &base, const Integer &exponent) const -{ - Element result; - this->SimultaneousMultiply(&result, base, &exponent, 1); - return result; -} - -template T AbstractGroup::CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const -{ - const unsigned expLen = STDMAX(e1.BitCount(), e2.BitCount()); - if (expLen==0) - return this->Identity(); - - const unsigned w = (expLen <= 46 ? 1 : (expLen <= 260 ? 2 : 3)); - const unsigned tableSize = 1< powerTable(tableSize << w); - - powerTable[1] = x; - powerTable[tableSize] = y; - if (w==1) - powerTable[3] = this->Add(x,y); - else - { - powerTable[2] = this->Double(x); - powerTable[2*tableSize] = this->Double(y); - - unsigned i, j; - - for (i=3; i=0; i--) - { - power1 = 2*power1 + e1.GetBit(i); - power2 = 2*power2 + e2.GetBit(i); - - if (i==0 || 2*power1 >= tableSize || 2*power2 >= tableSize) - { - unsigned squaresBefore = prevPosition-i; - unsigned squaresAfter = 0; - prevPosition = i; - while ((power1 || power2) && power1%2 == 0 && power2%2==0) - { - power1 /= 2; - power2 /= 2; - squaresBefore--; - squaresAfter++; - } - if (firstTime) - { - result = powerTable[(power2<Double(result); - if (power1 || power2) - Accumulate(result, powerTable[(power2<Double(result); - power1 = power2 = 0; - } - } - return result; -} - -template Element GeneralCascadeMultiplication(const AbstractGroup &group, Iterator begin, Iterator end) -{ - if (end-begin == 1) - return group.ScalarMultiply(begin->base, begin->exponent); - else if (end-begin == 2) - return group.CascadeScalarMultiply(begin->base, begin->exponent, (begin+1)->base, (begin+1)->exponent); - else - { - Integer q, t; - Iterator last = end; - --last; - - std::make_heap(begin, end); - std::pop_heap(begin, end); - - while (!!begin->exponent) - { - // last->exponent is largest exponent, begin->exponent is next largest - t = last->exponent; - Integer::Divide(last->exponent, q, t, begin->exponent); - - if (q == Integer::One()) - group.Accumulate(begin->base, last->base); // avoid overhead of ScalarMultiply() - else - group.Accumulate(begin->base, group.ScalarMultiply(last->base, q)); - - std::push_heap(begin, end); - std::pop_heap(begin, end); - } - - return group.ScalarMultiply(last->base, last->exponent); - } -} - -struct WindowSlider -{ - WindowSlider(const Integer &expIn, bool fastNegate, unsigned int windowSizeIn=0) - : exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn), windowBegin(0), expWindow(0) - , fastNegate(fastNegate), negateNext(false), firstTime(true), finished(false) - { - if (windowSize == 0) - { - unsigned int expLen = exp.BitCount(); - windowSize = expLen <= 17 ? 1 : (expLen <= 24 ? 2 : (expLen <= 70 ? 3 : (expLen <= 197 ? 4 : (expLen <= 539 ? 5 : (expLen <= 1434 ? 6 : 7))))); - } - windowModulus <<= windowSize; - } - - void FindNextWindow() - { - unsigned int expLen = exp.WordCount() * WORD_BITS; - unsigned int skipCount = firstTime ? 0 : windowSize; - firstTime = false; - while (!exp.GetBit(skipCount)) - { - if (skipCount >= expLen) - { - finished = true; - return; - } - skipCount++; - } - - exp >>= skipCount; - windowBegin += skipCount; - expWindow = word32(exp % (word(1) << windowSize)); - - if (fastNegate && exp.GetBit(windowSize)) - { - negateNext = true; - expWindow = (word32(1) << windowSize) - expWindow; - exp += windowModulus; - } - else - negateNext = false; - } - - Integer exp, windowModulus; - unsigned int windowSize, windowBegin; - word32 expWindow; - bool fastNegate, negateNext, firstTime, finished; -}; - -template -void AbstractGroup::SimultaneousMultiply(T *results, const T &base, const Integer *expBegin, unsigned int expCount) const -{ - std::vector > buckets(expCount); - std::vector exponents; - exponents.reserve(expCount); - unsigned int i; - - for (i=0; iNotNegative()); - exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0)); - exponents[i].FindNextWindow(); - buckets[i].resize(1<<(exponents[i].windowSize-1), Identity()); - } - - unsigned int expBitPosition = 0; - Element g = base; - bool notDone = true; - - while (notDone) - { - notDone = false; - for (i=0; i 1) - { - for (int j = (int)buckets[i].size()-2; j >= 1; j--) - { - Accumulate(buckets[i][j], buckets[i][j+1]); - Accumulate(r, buckets[i][j]); - } - Accumulate(buckets[i][0], buckets[i][1]); - r = Add(Double(r), buckets[i][0]); - } - } -} - -template T AbstractRing::Exponentiate(const Element &base, const Integer &exponent) const -{ - Element result; - SimultaneousExponentiate(&result, base, &exponent, 1); - return result; -} - -template T AbstractRing::CascadeExponentiate(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const -{ - return MultiplicativeGroup().AbstractGroup::CascadeScalarMultiply(x, e1, y, e2); -} - -template Element GeneralCascadeExponentiation(const AbstractRing &ring, Iterator begin, Iterator end) -{ - return GeneralCascadeMultiplication(ring.MultiplicativeGroup(), begin, end); -} - -template -void AbstractRing::SimultaneousExponentiate(T *results, const T &base, const Integer *exponents, unsigned int expCount) const -{ - MultiplicativeGroup().AbstractGroup::SimultaneousMultiply(results, base, exponents, expCount); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/algebra.h b/external/crypto++-5.6.3/algebra.h deleted file mode 100644 index d21941618..000000000 --- a/external/crypto++-5.6.3/algebra.h +++ /dev/null @@ -1,295 +0,0 @@ -// algebra.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile algebra.h -//! \brief Classes for performing mathematics over different fields - -#ifndef CRYPTOPP_ALGEBRA_H -#define CRYPTOPP_ALGEBRA_H - -#include "config.h" -#include "misc.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -class Integer; - -// "const Element&" returned by member functions are references -// to internal data members. Since each object may have only -// one such data member for holding results, the following code -// will produce incorrect results: -// abcd = group.Add(group.Add(a,b), group.Add(c,d)); -// But this should be fine: -// abcd = group.Add(a, group.Add(b, group.Add(c,d)); - -//! Abstract Group -template class CRYPTOPP_NO_VTABLE AbstractGroup -{ -public: - typedef T Element; - - virtual ~AbstractGroup() {} - - virtual bool Equal(const Element &a, const Element &b) const =0; - virtual const Element& Identity() const =0; - virtual const Element& Add(const Element &a, const Element &b) const =0; - virtual const Element& Inverse(const Element &a) const =0; - virtual bool InversionIsFast() const {return false;} - - virtual const Element& Double(const Element &a) const; - virtual const Element& Subtract(const Element &a, const Element &b) const; - virtual Element& Accumulate(Element &a, const Element &b) const; - virtual Element& Reduce(Element &a, const Element &b) const; - - virtual Element ScalarMultiply(const Element &a, const Integer &e) const; - virtual Element CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const; - - virtual void SimultaneousMultiply(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; -}; - -//! Abstract Ring -template class CRYPTOPP_NO_VTABLE AbstractRing : public AbstractGroup -{ -public: - typedef T Element; - - AbstractRing() {m_mg.m_pRing = this;} - AbstractRing(const AbstractRing &source) - {CRYPTOPP_UNUSED(source); m_mg.m_pRing = this;} - AbstractRing& operator=(const AbstractRing &source) - {CRYPTOPP_UNUSED(source); return *this;} - - virtual bool IsUnit(const Element &a) const =0; - virtual const Element& MultiplicativeIdentity() const =0; - virtual const Element& Multiply(const Element &a, const Element &b) const =0; - virtual const Element& MultiplicativeInverse(const Element &a) const =0; - - virtual const Element& Square(const Element &a) const; - virtual const Element& Divide(const Element &a, const Element &b) const; - - virtual Element Exponentiate(const Element &a, const Integer &e) const; - virtual Element CascadeExponentiate(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const; - - virtual void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; - - virtual const AbstractGroup& MultiplicativeGroup() const - {return m_mg;} - -private: - class MultiplicativeGroupT : public AbstractGroup - { - public: - const AbstractRing& GetRing() const - {return *m_pRing;} - - bool Equal(const Element &a, const Element &b) const - {return GetRing().Equal(a, b);} - - const Element& Identity() const - {return GetRing().MultiplicativeIdentity();} - - const Element& Add(const Element &a, const Element &b) const - {return GetRing().Multiply(a, b);} - - Element& Accumulate(Element &a, const Element &b) const - {return a = GetRing().Multiply(a, b);} - - const Element& Inverse(const Element &a) const - {return GetRing().MultiplicativeInverse(a);} - - const Element& Subtract(const Element &a, const Element &b) const - {return GetRing().Divide(a, b);} - - Element& Reduce(Element &a, const Element &b) const - {return a = GetRing().Divide(a, b);} - - const Element& Double(const Element &a) const - {return GetRing().Square(a);} - - Element ScalarMultiply(const Element &a, const Integer &e) const - {return GetRing().Exponentiate(a, e);} - - Element CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const - {return GetRing().CascadeExponentiate(x, e1, y, e2);} - - void SimultaneousMultiply(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const - {GetRing().SimultaneousExponentiate(results, base, exponents, exponentsCount);} - - const AbstractRing *m_pRing; - }; - - MultiplicativeGroupT m_mg; -}; - -// ******************************************************** - -//! Base and Exponent -template -struct BaseAndExponent -{ -public: - BaseAndExponent() {} - BaseAndExponent(const T &base, const E &exponent) : base(base), exponent(exponent) {} - bool operator<(const BaseAndExponent &rhs) const {return exponent < rhs.exponent;} - T base; - E exponent; -}; - -// VC60 workaround: incomplete member template support -template - Element GeneralCascadeMultiplication(const AbstractGroup &group, Iterator begin, Iterator end); -template - Element GeneralCascadeExponentiation(const AbstractRing &ring, Iterator begin, Iterator end); - -// ******************************************************** - -//! Abstract Euclidean Domain -template class CRYPTOPP_NO_VTABLE AbstractEuclideanDomain : public AbstractRing -{ -public: - typedef T Element; - - virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a, const Element &d) const =0; - - virtual const Element& Mod(const Element &a, const Element &b) const =0; - virtual const Element& Gcd(const Element &a, const Element &b) const; - -protected: - mutable Element result; -}; - -// ******************************************************** - -//! EuclideanDomainOf -template class EuclideanDomainOf : public AbstractEuclideanDomain -{ -public: - typedef T Element; - - EuclideanDomainOf() {} - - bool Equal(const Element &a, const Element &b) const - {return a==b;} - - const Element& Identity() const - {return Element::Zero();} - - const Element& Add(const Element &a, const Element &b) const - {return result = a+b;} - - Element& Accumulate(Element &a, const Element &b) const - {return a+=b;} - - const Element& Inverse(const Element &a) const - {return result = -a;} - - const Element& Subtract(const Element &a, const Element &b) const - {return result = a-b;} - - Element& Reduce(Element &a, const Element &b) const - {return a-=b;} - - const Element& Double(const Element &a) const - {return result = a.Doubled();} - - const Element& MultiplicativeIdentity() const - {return Element::One();} - - const Element& Multiply(const Element &a, const Element &b) const - {return result = a*b;} - - const Element& Square(const Element &a) const - {return result = a.Squared();} - - bool IsUnit(const Element &a) const - {return a.IsUnit();} - - const Element& MultiplicativeInverse(const Element &a) const - {return result = a.MultiplicativeInverse();} - - const Element& Divide(const Element &a, const Element &b) const - {return result = a/b;} - - const Element& Mod(const Element &a, const Element &b) const - {return result = a%b;} - - void DivisionAlgorithm(Element &r, Element &q, const Element &a, const Element &d) const - {Element::Divide(r, q, a, d);} - - bool operator==(const EuclideanDomainOf &rhs) const - {CRYPTOPP_UNUSED(rhs); return true;} - -private: - mutable Element result; -}; - -//! Quotient Ring -template class QuotientRing : public AbstractRing -{ -public: - typedef T EuclideanDomain; - typedef typename T::Element Element; - - QuotientRing(const EuclideanDomain &domain, const Element &modulus) - : m_domain(domain), m_modulus(modulus) {} - - const EuclideanDomain & GetDomain() const - {return m_domain;} - - const Element& GetModulus() const - {return m_modulus;} - - bool Equal(const Element &a, const Element &b) const - {return m_domain.Equal(m_domain.Mod(m_domain.Subtract(a, b), m_modulus), m_domain.Identity());} - - const Element& Identity() const - {return m_domain.Identity();} - - const Element& Add(const Element &a, const Element &b) const - {return m_domain.Add(a, b);} - - Element& Accumulate(Element &a, const Element &b) const - {return m_domain.Accumulate(a, b);} - - const Element& Inverse(const Element &a) const - {return m_domain.Inverse(a);} - - const Element& Subtract(const Element &a, const Element &b) const - {return m_domain.Subtract(a, b);} - - Element& Reduce(Element &a, const Element &b) const - {return m_domain.Reduce(a, b);} - - const Element& Double(const Element &a) const - {return m_domain.Double(a);} - - bool IsUnit(const Element &a) const - {return m_domain.IsUnit(m_domain.Gcd(a, m_modulus));} - - const Element& MultiplicativeIdentity() const - {return m_domain.MultiplicativeIdentity();} - - const Element& Multiply(const Element &a, const Element &b) const - {return m_domain.Mod(m_domain.Multiply(a, b), m_modulus);} - - const Element& Square(const Element &a) const - {return m_domain.Mod(m_domain.Square(a), m_modulus);} - - const Element& MultiplicativeInverse(const Element &a) const; - - bool operator==(const QuotientRing &rhs) const - {return m_domain == rhs.m_domain && m_modulus == rhs.m_modulus;} - -protected: - EuclideanDomain m_domain; - Element m_modulus; -}; - -NAMESPACE_END - -#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#include "algebra.cpp" -#endif - -#endif diff --git a/external/crypto++-5.6.3/algparam.cpp b/external/crypto++-5.6.3/algparam.cpp deleted file mode 100644 index 1acee1dd7..000000000 --- a/external/crypto++-5.6.3/algparam.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// algparam.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "algparam.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -PAssignIntToInteger g_pAssignIntToInteger = NULL; - -bool CombinedNameValuePairs::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - if (strcmp(name, "ValueNames") == 0) - return m_pairs1.GetVoidValue(name, valueType, pValue) && m_pairs2.GetVoidValue(name, valueType, pValue); - else - return m_pairs1.GetVoidValue(name, valueType, pValue) || m_pairs2.GetVoidValue(name, valueType, pValue); -} - -void AlgorithmParametersBase::operator=(const AlgorithmParametersBase &rhs) -{ - CRYPTOPP_UNUSED(rhs); - assert(false); -} - -bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - if (strcmp(name, "ValueNames") == 0) - { - NameValuePairs::ThrowIfTypeMismatch(name, typeid(std::string), valueType); - if (m_next.get()) - m_next->GetVoidValue(name, valueType, pValue); - (*reinterpret_cast(pValue) += m_name) += ";"; - return true; - } - else if (strcmp(name, m_name) == 0) - { - AssignValue(name, valueType, pValue); - m_used = true; - return true; - } - else if (m_next.get()) - return m_next->GetVoidValue(name, valueType, pValue); - else - return false; -} - -AlgorithmParameters::AlgorithmParameters() - : m_defaultThrowIfNotUsed(true) -{ -} - -AlgorithmParameters::AlgorithmParameters(const AlgorithmParameters &x) - : m_defaultThrowIfNotUsed(x.m_defaultThrowIfNotUsed) -{ - m_next.reset(const_cast(x).m_next.release()); -} - -AlgorithmParameters & AlgorithmParameters::operator=(const AlgorithmParameters &x) -{ - m_next.reset(const_cast(x).m_next.release()); - return *this; -} - -bool AlgorithmParameters::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - if (m_next.get()) - return m_next->GetVoidValue(name, valueType, pValue); - else - return false; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/algparam.h b/external/crypto++-5.6.3/algparam.h deleted file mode 100644 index d821551d0..000000000 --- a/external/crypto++-5.6.3/algparam.h +++ /dev/null @@ -1,511 +0,0 @@ -// algparam.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile algparam.h -//! \brief Classes for working with NameValuePairs - - -#ifndef CRYPTOPP_ALGPARAM_H -#define CRYPTOPP_ALGPARAM_H - -#include "cryptlib.h" -#include "config.h" - -// TODO: fix 6011 when the API/ABI can change -#if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(push) -# pragma warning(disable: 6011 28193) -#endif - -#include "smartptr.h" -#include "secblock.h" -#include "integer.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! used to pass byte array input as part of a NameValuePairs object -/*! the deepCopy option is used when the NameValuePairs object can't - keep a copy of the data available */ -class ConstByteArrayParameter -{ -public: - ConstByteArrayParameter(const char *data = NULL, bool deepCopy = false) - : m_deepCopy(false), m_data(NULL), m_size(0) - { - Assign((const byte *)data, data ? strlen(data) : 0, deepCopy); - } - ConstByteArrayParameter(const byte *data, size_t size, bool deepCopy = false) - : m_deepCopy(false), m_data(NULL), m_size(0) - { - Assign(data, size, deepCopy); - } - template ConstByteArrayParameter(const T &string, bool deepCopy = false) - : m_deepCopy(false), m_data(NULL), m_size(0) - { - CRYPTOPP_COMPILE_ASSERT(sizeof(CPP_TYPENAME T::value_type) == 1); - Assign((const byte *)string.data(), string.size(), deepCopy); - } - - void Assign(const byte *data, size_t size, bool deepCopy) - { - // This fires, which means: no data with a size, or data with no size. - // assert((data && size) || !(data || size)); - if (deepCopy) - m_block.Assign(data, size); - else - { - m_data = data; - m_size = size; - } - m_deepCopy = deepCopy; - } - - const byte *begin() const {return m_deepCopy ? m_block.begin() : m_data;} - const byte *end() const {return m_deepCopy ? m_block.end() : m_data + m_size;} - size_t size() const {return m_deepCopy ? m_block.size() : m_size;} - -private: - bool m_deepCopy; - const byte *m_data; - size_t m_size; - SecByteBlock m_block; -}; - -class ByteArrayParameter -{ -public: - ByteArrayParameter(byte *data = NULL, unsigned int size = 0) - : m_data(data), m_size(size) {} - ByteArrayParameter(SecByteBlock &block) - : m_data(block.begin()), m_size(block.size()) {} - - byte *begin() const {return m_data;} - byte *end() const {return m_data + m_size;} - size_t size() const {return m_size;} - -private: - byte *m_data; - size_t m_size; -}; - -class CRYPTOPP_DLL CombinedNameValuePairs : public NameValuePairs -{ -public: - CombinedNameValuePairs(const NameValuePairs &pairs1, const NameValuePairs &pairs2) - : m_pairs1(pairs1), m_pairs2(pairs2) {} - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - -private: - const NameValuePairs &m_pairs1, &m_pairs2; -}; - -template -class GetValueHelperClass -{ -public: - GetValueHelperClass(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst) - : m_pObject(pObject), m_name(name), m_valueType(&valueType), m_pValue(pValue), m_found(false), m_getValueNames(false) - { - if (strcmp(m_name, "ValueNames") == 0) - { - m_found = m_getValueNames = true; - NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(std::string), *m_valueType); - if (searchFirst) - searchFirst->GetVoidValue(m_name, valueType, pValue); - if (typeid(T) != typeid(BASE)) - pObject->BASE::GetVoidValue(m_name, valueType, pValue); - ((*reinterpret_cast(m_pValue) += "ThisPointer:") += typeid(T).name()) += ';'; - } - - if (!m_found && strncmp(m_name, "ThisPointer:", 12) == 0 && strcmp(m_name+12, typeid(T).name()) == 0) - { - NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T *), *m_valueType); - *reinterpret_cast(pValue) = pObject; - m_found = true; - return; - } - - if (!m_found && searchFirst) - m_found = searchFirst->GetVoidValue(m_name, valueType, pValue); - - if (!m_found && typeid(T) != typeid(BASE)) - m_found = pObject->BASE::GetVoidValue(m_name, valueType, pValue); - } - - operator bool() const {return m_found;} - - template - GetValueHelperClass & operator()(const char *name, const R & (T::*pm)() const) - { - if (m_getValueNames) - (*reinterpret_cast(m_pValue) += name) += ";"; - if (!m_found && strcmp(name, m_name) == 0) - { - NameValuePairs::ThrowIfTypeMismatch(name, typeid(R), *m_valueType); - *reinterpret_cast(m_pValue) = (m_pObject->*pm)(); - m_found = true; - } - return *this; - } - - GetValueHelperClass &Assignable() - { -#ifndef __INTEL_COMPILER // ICL 9.1 workaround: Intel compiler copies the vTable pointer for some reason - if (m_getValueNames) - ((*reinterpret_cast(m_pValue) += "ThisObject:") += typeid(T).name()) += ';'; - if (!m_found && strncmp(m_name, "ThisObject:", 11) == 0 && strcmp(m_name+11, typeid(T).name()) == 0) - { - NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T), *m_valueType); - *reinterpret_cast(m_pValue) = *m_pObject; - m_found = true; - } -#endif - return *this; - } - -private: - const T *m_pObject; - const char *m_name; - const std::type_info *m_valueType; - void *m_pValue; - bool m_found, m_getValueNames; -}; - -template -GetValueHelperClass GetValueHelper(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst=NULL, BASE *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - return GetValueHelperClass(pObject, name, valueType, pValue, searchFirst); -} - -template -GetValueHelperClass GetValueHelper(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst=NULL) -{ - return GetValueHelperClass(pObject, name, valueType, pValue, searchFirst); -} - -// ******************************************************** - -// VC60 workaround -#if defined(_MSC_VER) && (_MSC_VER < 1300) -template -R Hack_DefaultValueFromConstReferenceType(const R &) -{ - return R(); -} - -template -bool Hack_GetValueIntoConstReference(const NameValuePairs &source, const char *name, const R &value) -{ - return source.GetValue(name, const_cast(value)); -} - -template -class AssignFromHelperClass -{ -public: - AssignFromHelperClass(T *pObject, const NameValuePairs &source) - : m_pObject(pObject), m_source(source), m_done(false) - { - if (source.GetThisObject(*pObject)) - m_done = true; - else if (typeid(BASE) != typeid(T)) - pObject->BASE::AssignFrom(source); - } - - template - AssignFromHelperClass & operator()(const char *name, void (T::*pm)(R)) // VC60 workaround: "const R &" here causes compiler error - { - if (!m_done) - { - R value = Hack_DefaultValueFromConstReferenceType(reinterpret_cast(*(int *)NULL)); - if (!Hack_GetValueIntoConstReference(m_source, name, value)) - throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name + "'"); - (m_pObject->*pm)(value); - } - return *this; - } - - template - AssignFromHelperClass & operator()(const char *name1, const char *name2, void (T::*pm)(R, S)) // VC60 workaround: "const R &" here causes compiler error - { - if (!m_done) - { - R value1 = Hack_DefaultValueFromConstReferenceType(reinterpret_cast(*(int *)NULL)); - if (!Hack_GetValueIntoConstReference(m_source, name1, value1)) - throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name1 + "'"); - S value2 = Hack_DefaultValueFromConstReferenceType(reinterpret_cast(*(int *)NULL)); - if (!Hack_GetValueIntoConstReference(m_source, name2, value2)) - throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name2 + "'"); - (m_pObject->*pm)(value1, value2); - } - return *this; - } - -private: - T *m_pObject; - const NameValuePairs &m_source; - bool m_done; -}; -#else -template -class AssignFromHelperClass -{ -public: - AssignFromHelperClass(T *pObject, const NameValuePairs &source) - : m_pObject(pObject), m_source(source), m_done(false) - { - if (source.GetThisObject(*pObject)) - m_done = true; - else if (typeid(BASE) != typeid(T)) - pObject->BASE::AssignFrom(source); - } - - template - AssignFromHelperClass & operator()(const char *name, void (T::*pm)(const R&)) - { - if (!m_done) - { - R value; - if (!m_source.GetValue(name, value)) - throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name + "'"); - (m_pObject->*pm)(value); - } - return *this; - } - - template - AssignFromHelperClass & operator()(const char *name1, const char *name2, void (T::*pm)(const R&, const S&)) - { - if (!m_done) - { - R value1; - if (!m_source.GetValue(name1, value1)) - throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name1 + "'"); - S value2; - if (!m_source.GetValue(name2, value2)) - throw InvalidArgument(std::string(typeid(T).name()) + ": Missing required parameter '" + name2 + "'"); - (m_pObject->*pm)(value1, value2); - } - return *this; - } - -private: - T *m_pObject; - const NameValuePairs &m_source; - bool m_done; -}; -#endif - -template -AssignFromHelperClass AssignFromHelper(T *pObject, const NameValuePairs &source, BASE *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - return AssignFromHelperClass(pObject, source); -} - -template -AssignFromHelperClass AssignFromHelper(T *pObject, const NameValuePairs &source) -{ - return AssignFromHelperClass(pObject, source); -} - -// ******************************************************** - -// to allow the linker to discard Integer code if not needed. -typedef bool (CRYPTOPP_API * PAssignIntToInteger)(const std::type_info &valueType, void *pInteger, const void *pInt); -CRYPTOPP_DLL extern PAssignIntToInteger g_pAssignIntToInteger; - -CRYPTOPP_DLL const std::type_info & CRYPTOPP_API IntegerTypeId(); - -class CRYPTOPP_DLL AlgorithmParametersBase -{ -public: - class ParameterNotUsed : public Exception - { - public: - ParameterNotUsed(const char *name) : Exception(OTHER_ERROR, std::string("AlgorithmParametersBase: parameter \"") + name + "\" not used") {} - }; - - // this is actually a move, not a copy - AlgorithmParametersBase(const AlgorithmParametersBase &x) - : m_name(x.m_name), m_throwIfNotUsed(x.m_throwIfNotUsed), m_used(x.m_used) - { - m_next.reset(const_cast(x).m_next.release()); - x.m_used = true; - } - - AlgorithmParametersBase(const char *name, bool throwIfNotUsed) - : m_name(name), m_throwIfNotUsed(throwIfNotUsed), m_used(false) {} - - virtual ~AlgorithmParametersBase() CRYPTOPP_THROW - { -#if defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) - if (!std::uncaught_exception()) -#elif defined(CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE) - if (!std::uncaught_exceptions()) -#else - try -#endif - { - if (m_throwIfNotUsed && !m_used) - throw ParameterNotUsed(m_name); - } -#if !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE) - catch(const Exception&) - { - } -#endif - } - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - -protected: - friend class AlgorithmParameters; - void operator=(const AlgorithmParametersBase& rhs); // assignment not allowed, declare this for VC60 - - virtual void AssignValue(const char *name, const std::type_info &valueType, void *pValue) const =0; - - //VALVE: Our debug allocator doesn't implement placement new, and this function is never - // actually called. - //virtual void MoveInto(void *p) const =0; // not really const - - const char *m_name; - bool m_throwIfNotUsed; - mutable bool m_used; - member_ptr m_next; -}; - -template -class AlgorithmParametersTemplate : public AlgorithmParametersBase -{ -public: - AlgorithmParametersTemplate(const char *name, const T &value, bool throwIfNotUsed) - : AlgorithmParametersBase(name, throwIfNotUsed), m_value(value) - { - } - - void AssignValue(const char *name, const std::type_info &valueType, void *pValue) const - { - // special case for retrieving an Integer parameter when an int was passed in - if (!(g_pAssignIntToInteger != NULL && typeid(T) == typeid(int) && g_pAssignIntToInteger(valueType, pValue, &m_value))) - { - NameValuePairs::ThrowIfTypeMismatch(name, typeid(T), valueType); - *reinterpret_cast(pValue) = m_value; - } - } - - //VALVE: Our debug allocator doesn't implement placement new, and this function is never - // actually called. - //void MoveInto(void *buffer) const - //{ - // AlgorithmParametersTemplate* p = new(buffer) AlgorithmParametersTemplate(*this); - // CRYPTOPP_UNUSED(p); // silence warning - //} - -protected: - T m_value; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate; -CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate; -CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate; - -//! \class AlgorithmParameters -//! \brief An object that implements NameValuePairs -//! \tparam T the class or type -//! \param name the name of the object or value to retrieve -//! \param value reference to a variable that receives the value -//! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed -//! \note throwIfNotUsed is ignored if using a compiler that does not support std::uncaught_exception(), -//! such as MSVC 7.0 and earlier. -//! \note A NameValuePairs object containing an arbitrary number of name value pairs may be constructed by -//! repeatedly using operator() on the object returned by MakeParameters, for example: -//!
-//!     AlgorithmParameters parameters = MakeParameters(name1, value1)(name2, value2)(name3, value3);
-//!   
-class CRYPTOPP_DLL AlgorithmParameters : public NameValuePairs -{ -public: - AlgorithmParameters(); - -#ifdef __BORLANDC__ - template - AlgorithmParameters(const char *name, const T &value, bool throwIfNotUsed=true) - : m_next(new AlgorithmParametersTemplate(name, value, throwIfNotUsed)) - , m_defaultThrowIfNotUsed(throwIfNotUsed) - { - } -#endif - - AlgorithmParameters(const AlgorithmParameters &x); - - AlgorithmParameters & operator=(const AlgorithmParameters &x); - - //! \tparam T the class or type - //! \param name the name of the object or value to retrieve - //! \param value reference to a variable that receives the value - //! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed - template - AlgorithmParameters & operator()(const char *name, const T &value, bool throwIfNotUsed) - { - member_ptr p(new AlgorithmParametersTemplate(name, value, throwIfNotUsed)); - p->m_next.reset(m_next.release()); - m_next.reset(p.release()); - m_defaultThrowIfNotUsed = throwIfNotUsed; - return *this; - } - - //! \brief Appends a NameValuePair to a collection of NameValuePairs - //! \tparam T the class or type - //! \param name the name of the object or value to retrieve - //! \param value reference to a variable that receives the value - template - AlgorithmParameters & operator()(const char *name, const T &value) - { - return operator()(name, value, m_defaultThrowIfNotUsed); - } - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - -protected: - member_ptr m_next; - bool m_defaultThrowIfNotUsed; -}; - -//! \brief Create an object that implements NameValuePairs -//! \tparam T the class or type -//! \param name the name of the object or value to retrieve -//! \param value reference to a variable that receives the value -//! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed -//! \note throwIfNotUsed is ignored if using a compiler that does not support std::uncaught_exception(), -//! such as MSVC 7.0 and earlier. -//! \note A NameValuePairs object containing an arbitrary number of name value pairs may be constructed by -//! repeatedly using \p operator() on the object returned by \p MakeParameters, for example: -//!
-//!     AlgorithmParameters parameters = MakeParameters(name1, value1)(name2, value2)(name3, value3);
-//!   
-#ifdef __BORLANDC__ -typedef AlgorithmParameters MakeParameters; -#else -template -AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed = true) -{ - return AlgorithmParameters()(name, value, throwIfNotUsed); -} -#endif - -#define CRYPTOPP_GET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Get##name) -#define CRYPTOPP_SET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Set##name) -#define CRYPTOPP_SET_FUNCTION_ENTRY2(name1, name2) (Name::name1(), Name::name2(), &ThisClass::Set##name1##And##name2) - -// TODO: fix 6011 when the API/ABI can change -#if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(pop) -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/arc4.cpp b/external/crypto++-5.6.3/arc4.cpp deleted file mode 100644 index ae41ad0e3..000000000 --- a/external/crypto++-5.6.3/arc4.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// arc4.cpp - written and placed in the public domain by Wei Dai - -// The ARC4 algorithm was first revealed in an anonymous email to the -// cypherpunks mailing list. This file originally contained some -// code copied from this email. The code has since been rewritten in order -// to clarify the copyright status of this file. It should now be -// completely in the public domain. - -#include "pch.h" -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -#include "arc4.h" - -NAMESPACE_BEGIN(CryptoPP) -namespace Weak1 { - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void ARC4_TestInstantiations() -{ - ARC4 x; -} -#endif - -ARC4_Base::~ARC4_Base() -{ - m_x = m_y = 0; -} - -void ARC4_Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(keyLen); - - m_x = 1; - m_y = 0; - - unsigned int i; - for (i=0; i<256; i++) - m_state[i] = byte(i); - - unsigned int keyIndex = 0, stateIndex = 0; - for (i=0; i<256; i++) - { - unsigned int a = m_state[i]; - stateIndex += key[keyIndex] + a; - stateIndex &= 0xff; - m_state[i] = m_state[stateIndex]; - m_state[stateIndex] = byte(a); - if (++keyIndex >= keyLen) - keyIndex = 0; - } - - int discardBytes = params.GetIntValueWithDefault("DiscardBytes", GetDefaultDiscardBytes()); - DiscardBytes(discardBytes); -} - -template -static inline unsigned int MakeByte(T &x, T &y, byte *s) -{ - unsigned int a = s[x]; - y = byte((y+a) & 0xff); - unsigned int b = s[y]; - s[x] = byte(b); - s[y] = byte(a); - x = byte((x+1) & 0xff); - return s[(a+b) & 0xff]; -} - -void ARC4_Base::GenerateBlock(byte *output, size_t size) -{ - while (size--) - *output++ = static_cast(MakeByte(m_x, m_y, m_state)); -} - -void ARC4_Base::ProcessData(byte *outString, const byte *inString, size_t length) -{ - if (length == 0) - return; - - byte *const s = m_state; - unsigned int x = m_x; - unsigned int y = m_y; - - if (inString == outString) - { - do - { - *outString++ ^= MakeByte(x, y, s); - } while (--length); - } - else - { - do - { - *outString++ = *inString++ ^ byte(MakeByte(x, y, s)); - } - while(--length); - } - - m_x = byte(x); - m_y = byte(y); -} - -void ARC4_Base::DiscardBytes(size_t length) -{ - if (length == 0) - return; - - byte *const s = m_state; - unsigned int x = m_x; - unsigned int y = m_y; - - do - { - MakeByte(x, y, s); - } - while(--length); - - m_x = byte(x); - m_y = byte(y); -} - -} -NAMESPACE_END diff --git a/external/crypto++-5.6.3/arc4.h b/external/crypto++-5.6.3/arc4.h deleted file mode 100644 index 4e0d1c87c..000000000 --- a/external/crypto++-5.6.3/arc4.h +++ /dev/null @@ -1,83 +0,0 @@ -// arc4.h - written and placed in the public domain by Wei Dai - -//! \file arc4.h -//! \brief Classes for ARC4 cipher - -#ifndef CRYPTOPP_ARC4_H -#define CRYPTOPP_ARC4_H - -#include "cryptlib.h" -#include "strciphr.h" -#include "secblock.h" -#include "smartptr.h" - -NAMESPACE_BEGIN(CryptoPP) - -namespace Weak1 { - -//! \class ARC4_Base -//! \brief Class specific methods used to operate the cipher. -//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions -class CRYPTOPP_NO_VTABLE ARC4_Base : public VariableKeyLength<16, 1, 256>, public RandomNumberGenerator, public SymmetricCipher, public SymmetricCipherDocumentation -{ -public: - ~ARC4_Base(); - - static const char *StaticAlgorithmName() {return "ARC4";} - - void GenerateBlock(byte *output, size_t size); - void DiscardBytes(size_t n); - - void ProcessData(byte *outString, const byte *inString, size_t length); - - bool IsRandomAccess() const {return false;} - bool IsSelfInverting() const {return true;} - bool IsForwardTransformation() const {return true;} - - typedef SymmetricCipherFinal Encryption; - typedef SymmetricCipherFinal Decryption; - -protected: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - virtual unsigned int GetDefaultDiscardBytes() const {return 0;} - - FixedSizeSecBlock m_state; - byte m_x, m_y; -}; - -//! Alleged RC4 -DOCUMENTED_TYPEDEF(SymmetricCipherFinal, ARC4) - -//! \class MARC4_Base -//! \brief Class specific methods used to operate the cipher. -//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions -//! \details MARC4 discards the first 256 bytes of keystream, which may be weaker than the rest -class CRYPTOPP_NO_VTABLE MARC4_Base : public ARC4_Base -{ -public: - static const char *StaticAlgorithmName() {return "MARC4";} - - typedef SymmetricCipherFinal Encryption; - typedef SymmetricCipherFinal Decryption; - -protected: - unsigned int GetDefaultDiscardBytes() const {return 256;} -}; - -DOCUMENTED_TYPEDEF(SymmetricCipherFinal, MARC4) - -} -#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 -namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak -#else -using namespace Weak1; // import Weak1 into CryptoPP with warning -#ifdef __GNUC__ -#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." -#else -#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") -#endif -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/argnames.h b/external/crypto++-5.6.3/argnames.h deleted file mode 100644 index 4c4dc2d0c..000000000 --- a/external/crypto++-5.6.3/argnames.h +++ /dev/null @@ -1,88 +0,0 @@ -// argnames.h - written and placed in the public domain by Wei Dai - -//! \file argnames.h -//! \brief Standard names for retrieving values by name when working with \p NameValuePairs - -#ifndef CRYPTOPP_ARGNAMES_H -#define CRYPTOPP_ARGNAMES_H - -#include "cryptlib.h" - -NAMESPACE_BEGIN(CryptoPP) - -DOCUMENTED_NAMESPACE_BEGIN(Name) - -#define CRYPTOPP_DEFINE_NAME_STRING(name) inline const char *name() {return #name;} - -CRYPTOPP_DEFINE_NAME_STRING(ValueNames) //!< string, a list of value names with a semicolon (';') after each name -CRYPTOPP_DEFINE_NAME_STRING(Version) //!< int -CRYPTOPP_DEFINE_NAME_STRING(Seed) //!< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(Key) //!< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(IV) //!< ConstByteArrayParameter, also accepts const byte * for backwards compatibility -CRYPTOPP_DEFINE_NAME_STRING(StolenIV) //!< byte * -CRYPTOPP_DEFINE_NAME_STRING(Rounds) //!< int -CRYPTOPP_DEFINE_NAME_STRING(FeedbackSize) //!< int -CRYPTOPP_DEFINE_NAME_STRING(WordSize) //!< int, in bytes -CRYPTOPP_DEFINE_NAME_STRING(BlockSize) //!< int, in bytes -CRYPTOPP_DEFINE_NAME_STRING(EffectiveKeyLength) //!< int, in bits -CRYPTOPP_DEFINE_NAME_STRING(KeySize) //!< int, in bits -CRYPTOPP_DEFINE_NAME_STRING(ModulusSize) //!< int, in bits -CRYPTOPP_DEFINE_NAME_STRING(SubgroupOrderSize) //!< int, in bits -CRYPTOPP_DEFINE_NAME_STRING(PrivateExponentSize)//!< int, in bits -CRYPTOPP_DEFINE_NAME_STRING(Modulus) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(PublicExponent) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(PrivateExponent) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(PublicElement) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(SubgroupOrder) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(Cofactor) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(SubgroupGenerator) //!< Integer, ECP::Point, or EC2N::Point -CRYPTOPP_DEFINE_NAME_STRING(Curve) //!< ECP or EC2N -CRYPTOPP_DEFINE_NAME_STRING(GroupOID) //!< OID -CRYPTOPP_DEFINE_NAME_STRING(PointerToPrimeSelector) //!< const PrimeSelector * -CRYPTOPP_DEFINE_NAME_STRING(Prime1) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(Prime2) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(ModPrime1PrivateExponent) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(ModPrime2PrivateExponent) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(MultiplicativeInverseOfPrime2ModPrime1) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(QuadraticResidueModPrime1) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(QuadraticResidueModPrime2) //!< Integer -CRYPTOPP_DEFINE_NAME_STRING(PutMessage) //!< bool -CRYPTOPP_DEFINE_NAME_STRING(TruncatedDigestSize) //!< int -CRYPTOPP_DEFINE_NAME_STRING(BlockPaddingScheme) //!< StreamTransformationFilter::BlockPaddingScheme -CRYPTOPP_DEFINE_NAME_STRING(HashVerificationFilterFlags) //!< word32 -CRYPTOPP_DEFINE_NAME_STRING(AuthenticatedDecryptionFilterFlags) //!< word32 -CRYPTOPP_DEFINE_NAME_STRING(SignatureVerificationFilterFlags) //!< word32 -CRYPTOPP_DEFINE_NAME_STRING(InputBuffer) //!< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(OutputBuffer) //!< ByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(InputFileName) //!< const char * -CRYPTOPP_DEFINE_NAME_STRING(InputFileNameWide) //!< const wchar_t * -CRYPTOPP_DEFINE_NAME_STRING(InputStreamPointer) //!< std::istream * -CRYPTOPP_DEFINE_NAME_STRING(InputBinaryMode) //!< bool -CRYPTOPP_DEFINE_NAME_STRING(OutputFileName) //!< const char * -CRYPTOPP_DEFINE_NAME_STRING(OutputFileNameWide) //!< const wchar_t * -CRYPTOPP_DEFINE_NAME_STRING(OutputStreamPointer) //!< std::ostream * -CRYPTOPP_DEFINE_NAME_STRING(OutputBinaryMode) //!< bool -CRYPTOPP_DEFINE_NAME_STRING(EncodingParameters) //!< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(KeyDerivationParameters) //!< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(Separator) //< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(Terminator) //< ConstByteArrayParameter -CRYPTOPP_DEFINE_NAME_STRING(Uppercase) //< bool -CRYPTOPP_DEFINE_NAME_STRING(GroupSize) //< int -CRYPTOPP_DEFINE_NAME_STRING(Pad) //< bool -CRYPTOPP_DEFINE_NAME_STRING(PaddingByte) //< byte -CRYPTOPP_DEFINE_NAME_STRING(Log2Base) //< int -CRYPTOPP_DEFINE_NAME_STRING(EncodingLookupArray) //< const byte * -CRYPTOPP_DEFINE_NAME_STRING(DecodingLookupArray) //< const byte * -CRYPTOPP_DEFINE_NAME_STRING(InsertLineBreaks) //< bool -CRYPTOPP_DEFINE_NAME_STRING(MaxLineLength) //< int -CRYPTOPP_DEFINE_NAME_STRING(DigestSize) //!< int, in bytes -CRYPTOPP_DEFINE_NAME_STRING(L1KeyLength) //!< int, in bytes -CRYPTOPP_DEFINE_NAME_STRING(TableSize) //!< int, in bytes -CRYPTOPP_DEFINE_NAME_STRING(Blinding) //!< bool, timing attack mitigations, ON by default -CRYPTOPP_DEFINE_NAME_STRING(DerivedKey) //!< ByteArrayParameter, key derivation, derived key -CRYPTOPP_DEFINE_NAME_STRING(DerivedKeyLength) //!< int, key derivation, derived key length in bytes -DOCUMENTED_NAMESPACE_END - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/asn.cpp b/external/crypto++-5.6.3/asn.cpp deleted file mode 100644 index 736040683..000000000 --- a/external/crypto++-5.6.3/asn.cpp +++ /dev/null @@ -1,606 +0,0 @@ -// asn.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "asn.h" - -#include -#include - -NAMESPACE_BEGIN(CryptoPP) -USING_NAMESPACE(std) - -/// DER Length -size_t DERLengthEncode(BufferedTransformation &bt, lword length) -{ - size_t i=0; - if (length <= 0x7f) - { - bt.Put(byte(length)); - i++; - } - else - { - bt.Put(byte(BytePrecision(length) | 0x80)); - i++; - for (int j=BytePrecision(length); j; --j) - { - bt.Put(byte(length >> (j-1)*8)); - i++; - } - } - return i; -} - -bool BERLengthDecode(BufferedTransformation &bt, lword &length, bool &definiteLength) -{ - byte b; - - if (!bt.Get(b)) - return false; - - if (!(b & 0x80)) - { - definiteLength = true; - length = b; - } - else - { - unsigned int lengthBytes = b & 0x7f; - - if (lengthBytes == 0) - { - definiteLength = false; - return true; - } - - definiteLength = true; - length = 0; - while (lengthBytes--) - { - if (length >> (8*(sizeof(length)-1))) - BERDecodeError(); // length about to overflow - - if (!bt.Get(b)) - return false; - - length = (length << 8) | b; - } - } - return true; -} - -bool BERLengthDecode(BufferedTransformation &bt, size_t &length) -{ - lword lw = 0; - bool definiteLength; - if (!BERLengthDecode(bt, lw, definiteLength)) - BERDecodeError(); - if (!SafeConvert(lw, length)) - BERDecodeError(); - return definiteLength; -} - -void DEREncodeNull(BufferedTransformation &out) -{ - out.Put(TAG_NULL); - out.Put(0); -} - -void BERDecodeNull(BufferedTransformation &in) -{ - byte b; - if (!in.Get(b) || b != TAG_NULL) - BERDecodeError(); - size_t length; - if (!BERLengthDecode(in, length) || length != 0) - BERDecodeError(); -} - -/// ASN Strings -size_t DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t strLen) -{ - bt.Put(OCTET_STRING); - size_t lengthBytes = DERLengthEncode(bt, strLen); - bt.Put(str, strLen); - return 1+lengthBytes+strLen; -} - -size_t DEREncodeOctetString(BufferedTransformation &bt, const SecByteBlock &str) -{ - return DEREncodeOctetString(bt, str.begin(), str.size()); -} - -size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str) -{ - byte b; - if (!bt.Get(b) || b != OCTET_STRING) - BERDecodeError(); - - size_t bc; - if (!BERLengthDecode(bt, bc)) - BERDecodeError(); - - str.New(bc); - if (bc != bt.Get(str, bc)) - BERDecodeError(); - return bc; -} - -size_t BERDecodeOctetString(BufferedTransformation &bt, BufferedTransformation &str) -{ - byte b; - if (!bt.Get(b) || b != OCTET_STRING) - BERDecodeError(); - - size_t bc; - if (!BERLengthDecode(bt, bc)) - BERDecodeError(); - - bt.TransferTo(str, bc); - return bc; -} - -size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag) -{ - bt.Put(asnTag); - size_t lengthBytes = DERLengthEncode(bt, str.size()); - bt.Put((const byte *)str.data(), str.size()); - return 1+lengthBytes+str.size(); -} - -size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag) -{ - byte b; - if (!bt.Get(b) || b != asnTag) - BERDecodeError(); - - size_t bc; - if (!BERLengthDecode(bt, bc)) - BERDecodeError(); - - SecByteBlock temp(bc); - if (bc != bt.Get(temp, bc)) - BERDecodeError(); - str.assign((char *)temp.begin(), bc); - return bc; -} - -/// ASN BitString -size_t DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits) -{ - bt.Put(BIT_STRING); - size_t lengthBytes = DERLengthEncode(bt, strLen+1); - bt.Put((byte)unusedBits); - bt.Put(str, strLen); - return 2+lengthBytes+strLen; -} - -size_t BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigned int &unusedBits) -{ - byte b; - if (!bt.Get(b) || b != BIT_STRING) - BERDecodeError(); - - size_t bc; - if (!BERLengthDecode(bt, bc)) - BERDecodeError(); - - byte unused; - if (!bt.Get(unused)) - BERDecodeError(); - unusedBits = unused; - str.resize(bc-1); - if ((bc-1) != bt.Get(str, bc-1)) - BERDecodeError(); - return bc-1; -} - -void DERReencode(BufferedTransformation &source, BufferedTransformation &dest) -{ - byte tag; - source.Peek(tag); - BERGeneralDecoder decoder(source, tag); - DERGeneralEncoder encoder(dest, tag); - if (decoder.IsDefiniteLength()) - decoder.TransferTo(encoder, decoder.RemainingLength()); - else - { - while (!decoder.EndReached()) - DERReencode(decoder, encoder); - } - decoder.MessageEnd(); - encoder.MessageEnd(); -} - -void OID::EncodeValue(BufferedTransformation &bt, word32 v) -{ - for (unsigned int i=RoundUpToMultipleOf(STDMAX(7U,BitPrecision(v)), 7U)-7; i != 0; i-=7) - bt.Put((byte)(0x80 | ((v >> i) & 0x7f))); - bt.Put((byte)(v & 0x7f)); -} - -size_t OID::DecodeValue(BufferedTransformation &bt, word32 &v) -{ - byte b; - size_t i=0; - v = 0; - while (true) - { - if (!bt.Get(b)) - BERDecodeError(); - i++; - if (v >> (8*sizeof(v)-7)) // v about to overflow - BERDecodeError(); - v <<= 7; - v += b & 0x7f; - if (!(b & 0x80)) - return i; - } -} - -void OID::DEREncode(BufferedTransformation &bt) const -{ - assert(m_values.size() >= 2); - ByteQueue temp; - temp.Put(byte(m_values[0] * 40 + m_values[1])); - for (size_t i=2; i 0) - { - word32 v; - size_t valueLen = DecodeValue(bt, v); - if (valueLen > length) - BERDecodeError(); - m_values.push_back(v); - length -= valueLen; - } -} - -void OID::BERDecodeAndCheck(BufferedTransformation &bt) const -{ - OID oid(bt); - if (*this != oid) - BERDecodeError(); -} - -inline BufferedTransformation & EncodedObjectFilter::CurrentTarget() -{ - if (m_flags & PUT_OBJECTS) - return *AttachedTransformation(); - else - return TheBitBucket(); -} - -void EncodedObjectFilter::Put(const byte *inString, size_t length) -{ - if (m_nCurrentObject == m_nObjects) - { - AttachedTransformation()->Put(inString, length); - return; - } - - LazyPutter lazyPutter(m_queue, inString, length); - - while (m_queue.AnyRetrievable()) - { - switch (m_state) - { - case IDENTIFIER: - if (!m_queue.Get(m_id)) - return; - m_queue.TransferTo(CurrentTarget(), 1); - m_state = LENGTH; // fall through - case LENGTH: - { - byte b; - if (m_level > 0 && m_id == 0 && m_queue.Peek(b) && b == 0) - { - m_queue.TransferTo(CurrentTarget(), 1); - m_level--; - m_state = IDENTIFIER; - break; - } - ByteQueue::Walker walker(m_queue); - bool definiteLength; - if (!BERLengthDecode(walker, m_lengthRemaining, definiteLength)) - return; - m_queue.TransferTo(CurrentTarget(), walker.GetCurrentPosition()); - if (!((m_id & CONSTRUCTED) || definiteLength)) - BERDecodeError(); - if (!definiteLength) - { - if (!(m_id & CONSTRUCTED)) - BERDecodeError(); - m_level++; - m_state = IDENTIFIER; - break; - } - m_state = BODY; // fall through - } - case BODY: - m_lengthRemaining -= m_queue.TransferTo(CurrentTarget(), m_lengthRemaining); - - if (m_lengthRemaining == 0) - m_state = IDENTIFIER; - - case TAIL: // silence warnings - case ALL_DONE: - default: ;; - } - - if (m_state == IDENTIFIER && m_level == 0) - { - // just finished processing a level 0 object - ++m_nCurrentObject; - - if (m_flags & PUT_MESSANGE_END_AFTER_EACH_OBJECT) - AttachedTransformation()->MessageEnd(); - - if (m_nCurrentObject == m_nObjects) - { - if (m_flags & PUT_MESSANGE_END_AFTER_ALL_OBJECTS) - AttachedTransformation()->MessageEnd(); - - if (m_flags & PUT_MESSANGE_SERIES_END_AFTER_ALL_OBJECTS) - AttachedTransformation()->MessageSeriesEnd(); - - m_queue.TransferAllTo(*AttachedTransformation()); - return; - } - } - } -} - -BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag) - : m_inQueue(inQueue), m_finished(false) -{ - Init(asnTag); -} - -BERGeneralDecoder::BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag) - : m_inQueue(inQueue), m_finished(false) -{ - Init(asnTag); -} - -void BERGeneralDecoder::Init(byte asnTag) -{ - byte b; - if (!m_inQueue.Get(b) || b != asnTag) - BERDecodeError(); - - if (!BERLengthDecode(m_inQueue, m_length, m_definiteLength)) - BERDecodeError(); - - if (!m_definiteLength && !(asnTag & CONSTRUCTED)) - BERDecodeError(); // cannot be primitive and have indefinite length -} - -BERGeneralDecoder::~BERGeneralDecoder() -{ - try // avoid throwing in constructor - { - if (!m_finished) - MessageEnd(); - } - catch (const Exception&) - { - assert(0); - } -} - -bool BERGeneralDecoder::EndReached() const -{ - if (m_definiteLength) - return m_length == 0; - else - { // check end-of-content octets - word16 i; - return (m_inQueue.PeekWord16(i)==2 && i==0); - } -} - -byte BERGeneralDecoder::PeekByte() const -{ - byte b; - if (!Peek(b)) - BERDecodeError(); - return b; -} - -void BERGeneralDecoder::CheckByte(byte check) -{ - byte b; - if (!Get(b) || b != check) - BERDecodeError(); -} - -void BERGeneralDecoder::MessageEnd() -{ - m_finished = true; - if (m_definiteLength) - { - if (m_length != 0) - BERDecodeError(); - } - else - { // remove end-of-content octets - word16 i; - if (m_inQueue.GetWord16(i) != 2 || i != 0) - BERDecodeError(); - } -} - -size_t BERGeneralDecoder::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - if (m_definiteLength && transferBytes > m_length) - transferBytes = m_length; - size_t blockedBytes = m_inQueue.TransferTo2(target, transferBytes, channel, blocking); - ReduceLength(transferBytes); - return blockedBytes; -} - -size_t BERGeneralDecoder::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - if (m_definiteLength) - end = STDMIN(m_length, end); - return m_inQueue.CopyRangeTo2(target, begin, end, channel, blocking); -} - -lword BERGeneralDecoder::ReduceLength(lword delta) -{ - if (m_definiteLength) - { - if (m_length < delta) - BERDecodeError(); - m_length -= delta; - } - return delta; -} - -DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag) - : ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag) -{ -} - -// TODO: GCC (and likely other compilers) identify this as a copy constructor; and not a constructor. -// We have to wait until Crypto++ 6.0 to fix it becuase the signature change breaks versioning. -DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag) - : ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag) -{ -} - -DERGeneralEncoder::~DERGeneralEncoder() -{ - try // avoid throwing in constructor - { - if (!m_finished) - MessageEnd(); - } - catch (const Exception&) - { - assert(0); - } -} - -void DERGeneralEncoder::MessageEnd() -{ - m_finished = true; - lword length = CurrentSize(); - m_outQueue.Put(m_asnTag); - DERLengthEncode(m_outQueue, length); - TransferTo(m_outQueue); -} - -// ************************************************************* - -void X509PublicKey::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder subjectPublicKeyInfo(bt); - BERSequenceDecoder algorithm(subjectPublicKeyInfo); - GetAlgorithmID().BERDecodeAndCheck(algorithm); - bool parametersPresent = algorithm.EndReached() ? false : BERDecodeAlgorithmParameters(algorithm); - algorithm.MessageEnd(); - - BERGeneralDecoder subjectPublicKey(subjectPublicKeyInfo, BIT_STRING); - subjectPublicKey.CheckByte(0); // unused bits - BERDecodePublicKey(subjectPublicKey, parametersPresent, (size_t)subjectPublicKey.RemainingLength()); - subjectPublicKey.MessageEnd(); - subjectPublicKeyInfo.MessageEnd(); -} - -void X509PublicKey::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder subjectPublicKeyInfo(bt); - - DERSequenceEncoder algorithm(subjectPublicKeyInfo); - GetAlgorithmID().DEREncode(algorithm); - DEREncodeAlgorithmParameters(algorithm); - algorithm.MessageEnd(); - - DERGeneralEncoder subjectPublicKey(subjectPublicKeyInfo, BIT_STRING); - subjectPublicKey.Put(0); // unused bits - DEREncodePublicKey(subjectPublicKey); - subjectPublicKey.MessageEnd(); - - subjectPublicKeyInfo.MessageEnd(); -} - -void PKCS8PrivateKey::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder privateKeyInfo(bt); - word32 version; - BERDecodeUnsigned(privateKeyInfo, version, INTEGER, 0, 0); // check version - - BERSequenceDecoder algorithm(privateKeyInfo); - GetAlgorithmID().BERDecodeAndCheck(algorithm); - bool parametersPresent = algorithm.EndReached() ? false : BERDecodeAlgorithmParameters(algorithm); - algorithm.MessageEnd(); - - BERGeneralDecoder octetString(privateKeyInfo, OCTET_STRING); - BERDecodePrivateKey(octetString, parametersPresent, (size_t)privateKeyInfo.RemainingLength()); - octetString.MessageEnd(); - - if (!privateKeyInfo.EndReached()) - BERDecodeOptionalAttributes(privateKeyInfo); - privateKeyInfo.MessageEnd(); -} - -void PKCS8PrivateKey::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder privateKeyInfo(bt); - DEREncodeUnsigned(privateKeyInfo, 0); // version - - DERSequenceEncoder algorithm(privateKeyInfo); - GetAlgorithmID().DEREncode(algorithm); - DEREncodeAlgorithmParameters(algorithm); - algorithm.MessageEnd(); - - DERGeneralEncoder octetString(privateKeyInfo, OCTET_STRING); - DEREncodePrivateKey(octetString); - octetString.MessageEnd(); - - DEREncodeOptionalAttributes(privateKeyInfo); - privateKeyInfo.MessageEnd(); -} - -void PKCS8PrivateKey::BERDecodeOptionalAttributes(BufferedTransformation &bt) -{ - DERReencode(bt, m_optionalAttributes); -} - -void PKCS8PrivateKey::DEREncodeOptionalAttributes(BufferedTransformation &bt) const -{ - m_optionalAttributes.CopyTo(bt); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/asn.h b/external/crypto++-5.6.3/asn.h deleted file mode 100644 index cb440100f..000000000 --- a/external/crypto++-5.6.3/asn.h +++ /dev/null @@ -1,389 +0,0 @@ -// asn.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile asn.h -//! \brief Classes and functions for working with ANS.1 objects - -#ifndef CRYPTOPP_ASN_H -#define CRYPTOPP_ASN_H - -#include "cryptlib.h" -#include "filters.h" -#include "smartptr.h" -#include "stdcpp.h" -#include "queue.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -// these tags and flags are not complete -enum ASNTag -{ - BOOLEAN = 0x01, - INTEGER = 0x02, - BIT_STRING = 0x03, - OCTET_STRING = 0x04, - TAG_NULL = 0x05, - OBJECT_IDENTIFIER = 0x06, - OBJECT_DESCRIPTOR = 0x07, - EXTERNAL = 0x08, - REAL = 0x09, - ENUMERATED = 0x0a, - UTF8_STRING = 0x0c, - SEQUENCE = 0x10, - SET = 0x11, - NUMERIC_STRING = 0x12, - PRINTABLE_STRING = 0x13, - T61_STRING = 0x14, - VIDEOTEXT_STRING = 0x15, - IA5_STRING = 0x16, - UTC_TIME = 0x17, - GENERALIZED_TIME = 0x18, - GRAPHIC_STRING = 0x19, - VISIBLE_STRING = 0x1a, - GENERAL_STRING = 0x1b -}; - -enum ASNIdFlag -{ - UNIVERSAL = 0x00, -// DATA = 0x01, -// HEADER = 0x02, - CONSTRUCTED = 0x20, - APPLICATION = 0x40, - CONTEXT_SPECIFIC = 0x80, - PRIVATE = 0xc0 -}; - -inline void BERDecodeError() {throw BERDecodeErr();} - -class CRYPTOPP_DLL UnknownOID : public BERDecodeErr -{ -public: - UnknownOID() : BERDecodeErr("BER decode error: unknown object identifier") {} - UnknownOID(const char *err) : BERDecodeErr(err) {} -}; - -// unsigned int DERLengthEncode(unsigned int length, byte *output=0); -CRYPTOPP_DLL size_t CRYPTOPP_API DERLengthEncode(BufferedTransformation &out, lword length); -// returns false if indefinite length -CRYPTOPP_DLL bool CRYPTOPP_API BERLengthDecode(BufferedTransformation &in, size_t &length); - -CRYPTOPP_DLL void CRYPTOPP_API DEREncodeNull(BufferedTransformation &out); -CRYPTOPP_DLL void CRYPTOPP_API BERDecodeNull(BufferedTransformation &in); - -CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &out, const byte *str, size_t strLen); -CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &out, const SecByteBlock &str); -CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &in, SecByteBlock &str); -CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &in, BufferedTransformation &str); - -// for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING -CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &out, const std::string &str, byte asnTag); -CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeTextString(BufferedTransformation &in, std::string &str, byte asnTag); - -CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeBitString(BufferedTransformation &out, const byte *str, size_t strLen, unsigned int unusedBits=0); -CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeBitString(BufferedTransformation &in, SecByteBlock &str, unsigned int &unusedBits); - -// BER decode from source and DER reencode into dest -CRYPTOPP_DLL void CRYPTOPP_API DERReencode(BufferedTransformation &source, BufferedTransformation &dest); - -//! Object Identifier -class CRYPTOPP_DLL OID -{ -public: - OID() {} - OID(word32 v) : m_values(1, v) {} - OID(BufferedTransformation &bt) {BERDecode(bt);} - - inline OID & operator+=(word32 rhs) {m_values.push_back(rhs); return *this;} - - void DEREncode(BufferedTransformation &bt) const; - void BERDecode(BufferedTransformation &bt); - - // throw BERDecodeErr() if decoded value doesn't equal this OID - void BERDecodeAndCheck(BufferedTransformation &bt) const; - - std::vector m_values; - -private: - static void EncodeValue(BufferedTransformation &bt, word32 v); - static size_t DecodeValue(BufferedTransformation &bt, word32 &v); -}; - -class EncodedObjectFilter : public Filter -{ -public: - enum Flag {PUT_OBJECTS=1, PUT_MESSANGE_END_AFTER_EACH_OBJECT=2, PUT_MESSANGE_END_AFTER_ALL_OBJECTS=4, PUT_MESSANGE_SERIES_END_AFTER_ALL_OBJECTS=8}; - EncodedObjectFilter(BufferedTransformation *attachment = NULL, unsigned int nObjects = 1, word32 flags = 0); - - void Put(const byte *inString, size_t length); - - unsigned int GetNumberOfCompletedObjects() const {return m_nCurrentObject;} - unsigned long GetPositionOfObject(unsigned int i) const {return m_positions[i];} - -private: - BufferedTransformation & CurrentTarget(); - - word32 m_flags; - unsigned int m_nObjects, m_nCurrentObject, m_level; - std::vector m_positions; - ByteQueue m_queue; - enum State {IDENTIFIER, LENGTH, BODY, TAIL, ALL_DONE} m_state; - byte m_id; - lword m_lengthRemaining; -}; - -//! BER General Decoder -class CRYPTOPP_DLL BERGeneralDecoder : public Store -{ -public: - explicit BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag); - explicit BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag); - ~BERGeneralDecoder(); - - bool IsDefiniteLength() const {return m_definiteLength;} - lword RemainingLength() const {assert(m_definiteLength); return m_length;} - bool EndReached() const; - byte PeekByte() const; - void CheckByte(byte b); - - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - - // call this to denote end of sequence - void MessageEnd(); - -protected: - BufferedTransformation &m_inQueue; - bool m_finished, m_definiteLength; - lword m_length; - -private: - void Init(byte asnTag); - void StoreInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters); assert(false);} - lword ReduceLength(lword delta); -}; - -// GCC (and likely other compilers) identify the explicit DERGeneralEncoder as a copy constructor; -// and not a constructor. We had to remove the default asnTag value to point the compiler in the -// proper direction. We did not break the library or versioning based on the output of -// `nm --demangle libcryptopp.a | grep DERGeneralEncoder::DERGeneralEncoder | grep -v " U "`. - -//! DER General Encoder -class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue -{ -public: -#if defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) - explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED); - explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED); -#else - explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/); - explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/); -#endif - ~DERGeneralEncoder(); - - // call this to denote end of sequence - void MessageEnd(); - -private: - BufferedTransformation &m_outQueue; - bool m_finished; - - byte m_asnTag; -}; - -//! BER Sequence Decoder -class CRYPTOPP_DLL BERSequenceDecoder : public BERGeneralDecoder -{ -public: - explicit BERSequenceDecoder(BufferedTransformation &inQueue, byte asnTag = SEQUENCE | CONSTRUCTED) - : BERGeneralDecoder(inQueue, asnTag) {} - explicit BERSequenceDecoder(BERSequenceDecoder &inQueue, byte asnTag = SEQUENCE | CONSTRUCTED) - : BERGeneralDecoder(inQueue, asnTag) {} -}; - -//! DER Sequence Encoder -class CRYPTOPP_DLL DERSequenceEncoder : public DERGeneralEncoder -{ -public: - explicit DERSequenceEncoder(BufferedTransformation &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED) - : DERGeneralEncoder(outQueue, asnTag) {} - explicit DERSequenceEncoder(DERSequenceEncoder &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED) - : DERGeneralEncoder(outQueue, asnTag) {} -}; - -//! BER Set Decoder -class CRYPTOPP_DLL BERSetDecoder : public BERGeneralDecoder -{ -public: - explicit BERSetDecoder(BufferedTransformation &inQueue, byte asnTag = SET | CONSTRUCTED) - : BERGeneralDecoder(inQueue, asnTag) {} - explicit BERSetDecoder(BERSetDecoder &inQueue, byte asnTag = SET | CONSTRUCTED) - : BERGeneralDecoder(inQueue, asnTag) {} -}; - -//! DER Set Encoder -class CRYPTOPP_DLL DERSetEncoder : public DERGeneralEncoder -{ -public: - explicit DERSetEncoder(BufferedTransformation &outQueue, byte asnTag = SET | CONSTRUCTED) - : DERGeneralEncoder(outQueue, asnTag) {} - explicit DERSetEncoder(DERSetEncoder &outQueue, byte asnTag = SET | CONSTRUCTED) - : DERGeneralEncoder(outQueue, asnTag) {} -}; - -template -class ASNOptional : public member_ptr -{ -public: - void BERDecode(BERSequenceDecoder &seqDecoder, byte tag, byte mask = ~CONSTRUCTED) - { - byte b; - if (seqDecoder.Peek(b) && (b & mask) == tag) - reset(new T(seqDecoder)); - } - void DEREncode(BufferedTransformation &out) - { - if (this->get() != NULL) - this->get()->DEREncode(out); - } -}; - -//! _ -template -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ASN1CryptoMaterial : public ASN1Object, public BASE -{ -public: - void Save(BufferedTransformation &bt) const - {BEREncode(bt);} - void Load(BufferedTransformation &bt) - {BERDecode(bt);} -}; - -//! encodes/decodes subjectPublicKeyInfo -class CRYPTOPP_DLL X509PublicKey : public ASN1CryptoMaterial -{ -public: - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - virtual OID GetAlgorithmID() const =0; - virtual bool BERDecodeAlgorithmParameters(BufferedTransformation &bt) - {BERDecodeNull(bt); return false;} - virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const - {DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1 - - //! decode subjectPublicKey part of subjectPublicKeyInfo, without the BIT STRING header - virtual void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size) =0; - //! encode subjectPublicKey part of subjectPublicKeyInfo, without the BIT STRING header - virtual void DEREncodePublicKey(BufferedTransformation &bt) const =0; -}; - -//! encodes/decodes privateKeyInfo -class CRYPTOPP_DLL PKCS8PrivateKey : public ASN1CryptoMaterial -{ -public: - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - virtual OID GetAlgorithmID() const =0; - virtual bool BERDecodeAlgorithmParameters(BufferedTransformation &bt) - {BERDecodeNull(bt); return false;} - virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const - {DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1 - - //! decode privateKey part of privateKeyInfo, without the OCTET STRING header - virtual void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size) =0; - //! encode privateKey part of privateKeyInfo, without the OCTET STRING header - virtual void DEREncodePrivateKey(BufferedTransformation &bt) const =0; - - //! decode optional attributes including context-specific tag - /*! /note default implementation stores attributes to be output in DEREncodeOptionalAttributes */ - virtual void BERDecodeOptionalAttributes(BufferedTransformation &bt); - //! encode optional attributes including context-specific tag - virtual void DEREncodeOptionalAttributes(BufferedTransformation &bt) const; - -protected: - ByteQueue m_optionalAttributes; -}; - -// ******************************************************** - -//! DER Encode Unsigned -/*! for INTEGER, BOOLEAN, and ENUM */ -template -size_t DEREncodeUnsigned(BufferedTransformation &out, T w, byte asnTag = INTEGER) -{ - byte buf[sizeof(w)+1]; - unsigned int bc; - if (asnTag == BOOLEAN) - { - buf[sizeof(w)] = w ? 0xff : 0; - bc = 1; - } - else - { - buf[0] = 0; - for (unsigned int i=0; i> (sizeof(w)-1-i)*8); - bc = sizeof(w); - while (bc > 1 && buf[sizeof(w)+1-bc] == 0) - --bc; - if (buf[sizeof(w)+1-bc] & 0x80) - ++bc; - } - out.Put(asnTag); - size_t lengthBytes = DERLengthEncode(out, bc); - out.Put(buf+sizeof(w)+1-bc, bc); - return 1+lengthBytes+bc; -} - -//! BER Decode Unsigned -template -void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER, - T minValue = 0, T maxValue = ((std::numeric_limits::max)())) -{ - byte b; - if (!in.Get(b) || b != asnTag) - BERDecodeError(); - - size_t bc; - bool definite = BERLengthDecode(in, bc); - if (!definite) - BERDecodeError(); - - SecByteBlock buf(bc); - - if (bc != in.Get(buf, bc)) - BERDecodeError(); - - const byte *ptr = buf; - while (bc > sizeof(w) && *ptr == 0) - { - bc--; - ptr++; - } - if (bc > sizeof(w)) - BERDecodeError(); - - w = 0; - for (unsigned int i=0; i maxValue) - BERDecodeError(); -} - -inline bool operator==(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs) - {return lhs.m_values == rhs.m_values;} -inline bool operator!=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs) - {return lhs.m_values != rhs.m_values;} -inline bool operator<(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs) - {return std::lexicographical_compare(lhs.m_values.begin(), lhs.m_values.end(), rhs.m_values.begin(), rhs.m_values.end());} -inline ::CryptoPP::OID operator+(const ::CryptoPP::OID &lhs, unsigned long rhs) - {return ::CryptoPP::OID(lhs)+=rhs;} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/authenc.cpp b/external/crypto++-5.6.3/authenc.cpp deleted file mode 100644 index f93662efb..000000000 --- a/external/crypto++-5.6.3/authenc.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// authenc.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "authenc.h" - -NAMESPACE_BEGIN(CryptoPP) - -void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_t len) -{ - unsigned int blockSize = AuthenticationBlockSize(); - unsigned int &num = m_bufferedDataLength; - byte* data = m_buffer.begin(); - - if (num != 0) // process left over data - { - if (num+len >= blockSize) - { - memcpy(data+num, input, blockSize-num); - AuthenticateBlocks(data, blockSize); - input += (blockSize-num); - len -= (blockSize-num); - num = 0; - // drop through and do the rest - } - else - { - memcpy(data+num, input, len); - num += (unsigned int)len; - return; - } - } - - // now process the input data in blocks of blockSize bytes and save the leftovers to m_data - if (len >= blockSize) - { - size_t leftOver = AuthenticateBlocks(input, len); - input += (len - leftOver); - len = leftOver; - } - - memcpy(data, input, len); - num = (unsigned int)len; -} - -void AuthenticatedSymmetricCipherBase::SetKey(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) -{ - m_bufferedDataLength = 0; - m_state = State_Start; - - SetKeyWithoutResync(userKey, keylength, params); - m_state = State_KeySet; - - size_t length; - const byte *iv = GetIVAndThrowIfInvalid(params, length); - if (iv) - Resynchronize(iv, (int)length); -} - -void AuthenticatedSymmetricCipherBase::Resynchronize(const byte *iv, int length) -{ - if (m_state < State_KeySet) - throw BadState(AlgorithmName(), "Resynchronize", "key is set"); - - m_bufferedDataLength = 0; - m_totalHeaderLength = m_totalMessageLength = m_totalFooterLength = 0; - m_state = State_KeySet; - - Resync(iv, this->ThrowIfInvalidIVLength(length)); - m_state = State_IVSet; -} - -void AuthenticatedSymmetricCipherBase::Update(const byte *input, size_t length) -{ - if (length == 0) - return; - - switch (m_state) - { - case State_Start: - case State_KeySet: - throw BadState(AlgorithmName(), "Update", "setting key and IV"); - case State_IVSet: - AuthenticateData(input, length); - m_totalHeaderLength += length; - break; - case State_AuthUntransformed: - case State_AuthTransformed: - AuthenticateLastConfidentialBlock(); - m_bufferedDataLength = 0; - m_state = State_AuthFooter; - // fall through - case State_AuthFooter: - AuthenticateData(input, length); - m_totalFooterLength += length; - break; - default: - assert(false); - } -} - -void AuthenticatedSymmetricCipherBase::ProcessData(byte *outString, const byte *inString, size_t length) -{ - m_totalMessageLength += length; - if (m_state >= State_IVSet && m_totalMessageLength > MaxMessageLength()) - throw InvalidArgument(AlgorithmName() + ": message length exceeds maximum"); - -reswitch: - switch (m_state) - { - case State_Start: - case State_KeySet: - throw BadState(AlgorithmName(), "ProcessData", "setting key and IV"); - case State_AuthFooter: - throw BadState(AlgorithmName(), "ProcessData was called after footer input has started"); - case State_IVSet: - AuthenticateLastHeaderBlock(); - m_bufferedDataLength = 0; - m_state = AuthenticationIsOnPlaintext()==IsForwardTransformation() ? State_AuthUntransformed : State_AuthTransformed; - goto reswitch; - case State_AuthUntransformed: - AuthenticateData(inString, length); - AccessSymmetricCipher().ProcessData(outString, inString, length); - break; - case State_AuthTransformed: - AccessSymmetricCipher().ProcessData(outString, inString, length); - AuthenticateData(outString, length); - break; - default: - assert(false); - } -} - -void AuthenticatedSymmetricCipherBase::TruncatedFinal(byte *mac, size_t macSize) -{ - if (m_totalHeaderLength > MaxHeaderLength()) - throw InvalidArgument(AlgorithmName() + ": header length of " + IntToString(m_totalHeaderLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength())); - - if (m_totalFooterLength > MaxFooterLength()) - { - if (MaxFooterLength() == 0) - throw InvalidArgument(AlgorithmName() + ": additional authenticated data (AAD) cannot be input after data to be encrypted or decrypted"); - else - throw InvalidArgument(AlgorithmName() + ": footer length of " + IntToString(m_totalFooterLength) + " exceeds the maximum of " + IntToString(MaxFooterLength())); - } - - switch (m_state) - { - case State_Start: - case State_KeySet: - throw BadState(AlgorithmName(), "TruncatedFinal", "setting key and IV"); - - case State_IVSet: - AuthenticateLastHeaderBlock(); - m_bufferedDataLength = 0; - // fall through - - case State_AuthUntransformed: - case State_AuthTransformed: - AuthenticateLastConfidentialBlock(); - m_bufferedDataLength = 0; - // fall through - - case State_AuthFooter: - AuthenticateLastFooterBlock(mac, macSize); - m_bufferedDataLength = 0; - break; - - default: - assert(false); - } - - m_state = State_KeySet; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/authenc.h b/external/crypto++-5.6.3/authenc.h deleted file mode 100644 index 116892203..000000000 --- a/external/crypto++-5.6.3/authenc.h +++ /dev/null @@ -1,57 +0,0 @@ -// authenc.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile authenc.h -//! \brief Base classes for working with authenticated encryption modes of encryption - -#ifndef CRYPTOPP_AUTHENC_H -#define CRYPTOPP_AUTHENC_H - -#include "cryptlib.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class AuthenticatedSymmetricCipherBase -//! \brief -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipherBase : public AuthenticatedSymmetricCipher -{ -public: - AuthenticatedSymmetricCipherBase() : m_state(State_Start), m_bufferedDataLength(0), - m_totalHeaderLength(0), m_totalMessageLength(0), m_totalFooterLength(0) {} - - bool IsRandomAccess() const {return false;} - bool IsSelfInverting() const {return true;} - void UncheckedSetKey(const byte *,unsigned int,const CryptoPP::NameValuePairs &) {assert(false);} - - void SetKey(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); - void Restart() {if (m_state > State_KeySet) m_state = State_KeySet;} - void Resynchronize(const byte *iv, int length=-1); - void Update(const byte *input, size_t length); - void ProcessData(byte *outString, const byte *inString, size_t length); - void TruncatedFinal(byte *mac, size_t macSize); - -protected: - void AuthenticateData(const byte *data, size_t len); - const SymmetricCipher & GetSymmetricCipher() const {return const_cast(this)->AccessSymmetricCipher();}; - - virtual SymmetricCipher & AccessSymmetricCipher() =0; - virtual bool AuthenticationIsOnPlaintext() const =0; - virtual unsigned int AuthenticationBlockSize() const =0; - virtual void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) =0; - virtual void Resync(const byte *iv, size_t len) =0; - virtual size_t AuthenticateBlocks(const byte *data, size_t len) =0; - virtual void AuthenticateLastHeaderBlock() =0; - virtual void AuthenticateLastConfidentialBlock() {} - virtual void AuthenticateLastFooterBlock(byte *mac, size_t macSize) =0; - - enum State {State_Start, State_KeySet, State_IVSet, State_AuthUntransformed, State_AuthTransformed, State_AuthFooter}; - State m_state; - unsigned int m_bufferedDataLength; - lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength; - AlignedSecByteBlock m_buffer; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/base32.cpp b/external/crypto++-5.6.3/base32.cpp deleted file mode 100644 index 0568f0729..000000000 --- a/external/crypto++-5.6.3/base32.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// base32.cpp - written and placed in the public domain by Frank Palazzolo, based on hex.cpp by Wei Dai - -#include "pch.h" -#include "base32.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const byte s_vecUpper[] = "ABCDEFGHIJKMNPQRSTUVWXYZ23456789"; -static const byte s_vecLower[] = "abcdefghijkmnpqrstuvwxyz23456789"; - -void Base32Encoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true); - m_filter->Initialize(CombinedNameValuePairs( - parameters, - MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 5, true))); -} - -void Base32Decoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - BaseN_Decoder::Initialize(CombinedNameValuePairs( - parameters, - MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 5, true))); -} - -const int *Base32Decoder::GetDefaultDecodingLookupArray() -{ - static volatile bool s_initialized = false; - static int s_array[256]; - - if (!s_initialized) - { - InitializeDecodingLookupArray(s_array, s_vecUpper, 32, true); - s_initialized = true; - } - return s_array; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/base32.h b/external/crypto++-5.6.3/base32.h deleted file mode 100644 index dc7d384ca..000000000 --- a/external/crypto++-5.6.3/base32.h +++ /dev/null @@ -1,70 +0,0 @@ -// base32.h - written and placed in the public domain by Wei Dai - -//! \file -//! \brief Classes for Base32Encoder and Base32Decoder - -#ifndef CRYPTOPP_BASE32_H -#define CRYPTOPP_BASE32_H - -#include "cryptlib.h" -#include "basecode.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class Base32Encoder -//! \brief Base32 encodes data -//! \details Converts data to base32. The default code is based on draft-ietf-idn-dude-02.txt. -//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. -class Base32Encoder : public SimpleProxyFilter -{ -public: - //! \brief Construct a Base32Encoder - //! \param attachment a BufferedTrasformation to attach to this object - //! \param uppercase a flag indicating uppercase output - //! \param groupSize the size of the grouping - //! \param separator the separator to use between groups - //! \param terminator the terminator appeand after processing - //! \details Base32Encoder() constructs a default encoder. The constructor lacks fields for padding and - //! line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it. - //! \sa IsolatedInitialize() for an example of modifying a Base32Encoder after construction. - Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "") - : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) - { - IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator))); - } - - //! \brief Initialize or reinitialize this object, without signal propagation - //! \param parameters a set of NameValuePairs used to initialize this object - //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable - //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached - //! transformations. If initialization should be propagated, then use the Initialize() function. - //! \details The following code modifies the padding and line break parameters for an encoder: - //!
-	//!     Base32Encoder encoder;
-	//!     AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
-	//!     encoder.IsolatedInitialize(params);
-	//!   
- void IsolatedInitialize(const NameValuePairs ¶meters); -}; - -//! \class Base32Decoder -//! \brief Base32 decodes data -//! \details Decode base32 data. The default code is based on draft-ietf-idn-dude-02.txt -//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. -class Base32Decoder : public BaseN_Decoder -{ -public: - //! \brief Construct a Base32Decoder - //! \param attachment a BufferedTrasformation to attach to this object - Base32Decoder(BufferedTransformation *attachment = NULL) - : BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {} - - void IsolatedInitialize(const NameValuePairs ¶meters); - -private: - static const int * CRYPTOPP_API GetDefaultDecodingLookupArray(); -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/base64.cpp b/external/crypto++-5.6.3/base64.cpp deleted file mode 100644 index 49c11f910..000000000 --- a/external/crypto++-5.6.3/base64.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// base64.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "base64.h" - -NAMESPACE_BEGIN(CryptoPP) - -// Base64 -static const byte s_stdVec[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -// Base64URL -static const byte s_urlVec[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; -static const byte s_padding = '='; - -void Base64Encoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - bool insertLineBreaks = parameters.GetValueWithDefault(Name::InsertLineBreaks(), true); - int maxLineLength = parameters.GetIntValueWithDefault(Name::MaxLineLength(), 72); - - const char *lineBreak = insertLineBreaks ? "\n" : ""; - - m_filter->Initialize(CombinedNameValuePairs( - parameters, - MakeParameters(Name::EncodingLookupArray(), &s_stdVec[0], false) - (Name::PaddingByte(), s_padding) - (Name::GroupSize(), insertLineBreaks ? maxLineLength : 0) - (Name::Separator(), ConstByteArrayParameter(lineBreak)) - (Name::Terminator(), ConstByteArrayParameter(lineBreak)) - (Name::Log2Base(), 6, true))); -} - -void Base64URLEncoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - bool insertLineBreaks = parameters.GetValueWithDefault(Name::InsertLineBreaks(), true); - int maxLineLength = parameters.GetIntValueWithDefault(Name::MaxLineLength(), 72); - - const char *lineBreak = insertLineBreaks ? "\n" : ""; - - m_filter->Initialize(CombinedNameValuePairs( - parameters, - MakeParameters(Name::EncodingLookupArray(), &s_urlVec[0], false) - (Name::PaddingByte(), s_padding) - (Name::GroupSize(), insertLineBreaks ? maxLineLength : 0) - (Name::Separator(), ConstByteArrayParameter(lineBreak)) - (Name::Terminator(), ConstByteArrayParameter(lineBreak)) - (Name::Log2Base(), 6, true))); -} - -const int *Base64Decoder::GetDecodingLookupArray() -{ - static volatile bool s_initialized = false; - static int s_array[256]; - - if (!s_initialized) - { - InitializeDecodingLookupArray(s_array, s_stdVec, 64, false); - s_initialized = true; - } - return s_array; -} - -const int *Base64URLDecoder::GetDecodingLookupArray() -{ - static volatile bool s_initialized = false; - static int s_array[256]; - - if (!s_initialized) - { - InitializeDecodingLookupArray(s_array, s_urlVec, 64, false); - s_initialized = true; - } - return s_array; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/base64.h b/external/crypto++-5.6.3/base64.h deleted file mode 100644 index 8376353e8..000000000 --- a/external/crypto++-5.6.3/base64.h +++ /dev/null @@ -1,135 +0,0 @@ -// base64.h - written and placed in the public domain by Wei Dai - -//! \file base64.h -//! \brief Classes for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder - -#ifndef CRYPTOPP_BASE64_H -#define CRYPTOPP_BASE64_H - -#include "cryptlib.h" -#include "basecode.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class Base64Encoder -//! \brief Base64 encodes data -//! \details Base64 encodes data per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-4) -//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. -class Base64Encoder : public SimpleProxyFilter -{ -public: - //! \brief Construct a Base64Encoder - //! \param attachment a BufferedTrasformation to attach to this object - //! \param insertLineBreaks a BufferedTrasformation to attach to this object - //! \param maxLineLength the lenght of a line if line breaks are used - //! \details Base64Encoder() constructs a default encoder. The constructor lacks parameters for padding. - //! You must use IsolatedInitialize() to modify the Base64Encoder after construction. - //! \sa IsolatedInitialize() for an example of modifying a Base64Encoder after construction. - Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72) - : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) - { - IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength)); - } - - //! \brief Initialize or reinitialize this object, without signal propagation - //! \param parameters a set of NameValuePairs used to initialize this object - //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable - //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached - //! transformations. If initialization should be propagated, then use the Initialize() function. - //! \details The following code modifies the padding and line break parameters for an encoder: - //!
-	//!     Base64Encoder encoder;
-	//!     AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
-	//!     encoder.IsolatedInitialize(params);
-	//!   
- void IsolatedInitialize(const NameValuePairs ¶meters); -}; - -//! \class Base64Decoder -//! \brief Base64 decodes data -//! \details Base64 decodes data per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-4) -//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. -class Base64Decoder : public BaseN_Decoder -{ -public: - //! \brief Construct a Base64Decoder - //! \param attachment a BufferedTrasformation to attach to this object - Base64Decoder(BufferedTransformation *attachment = NULL) - : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {} - - //! \brief Initialize or reinitialize this object, without signal propagation - //! \param parameters a set of NameValuePairs used to initialize this object - //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable - //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on - //! attached transformations. If initialization should be propagated, then use the Initialize() function. - void IsolatedInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters);} - -private: - static const int * CRYPTOPP_API GetDecodingLookupArray(); -}; - -//! \class Base64URLEncoder -//! \brief Base64 encodes data using a web safe alphabet -//! \details Base64 encodes data using a web safe alphabet per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-5) -//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. -class Base64URLEncoder : public SimpleProxyFilter -{ -public: - //! \brief Construct a Base64URLEncoder - //! \param attachment a BufferedTrasformation to attach to this object - //! \param insertLineBreaks a BufferedTrasformation to attach to this object - //! \param maxLineLength the lenght of a line if line breaks are used - //! \details Base64URLEncoder() constructs a default encoder. The constructor ignores insertLineBreaks - //! and maxLineLength because the web and URL safe specifications don't use them. They are present - //! in the constructor for API compatibility with Base64Encoder (drop-in replacement). The - //! constructor also disables padding on the encoder for the same reason. - //! \details If you need line breaks or padding, then you must use IsolatedInitialize() to set them - //! after constructing a Base64URLEncoder. - //! \sa IsolatedInitialize() for an example of modifying a Base64URLEncoder after construction. - Base64URLEncoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = false, int maxLineLength = -1) - : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) - { - CRYPTOPP_UNUSED(insertLineBreaks), CRYPTOPP_UNUSED(maxLineLength); - IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false)); - } - - //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable - //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached - //! transformations. If initialization should be propagated, then use the Initialize() function. - //! \details The following code modifies the padding and line break parameters for an encoder: - //!
-	//!     Base64URLEncoder encoder;
-	//!     AlgorithmParameters params = MakeParameters(Name::Pad(), true)(Name::InsertLineBreaks(), true);
-	//!     encoder.IsolatedInitialize(params);
-	//!   
- void IsolatedInitialize(const NameValuePairs ¶meters); -}; - -//! \class Base64URLDecoder -//! \brief Base64 decodes data using a web safe alphabet -//! \details Base64 decodes data using a web safe alphabet per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-5) -//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter. -class Base64URLDecoder : public BaseN_Decoder -{ -public: - //! \brief Construct a Base64URLDecoder - //! \param attachment a BufferedTrasformation to attach to this object - Base64URLDecoder(BufferedTransformation *attachment = NULL) - : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {} - - //! \brief Initialize or reinitialize this object, without signal propagation - //! \param parameters a set of NameValuePairs used to initialize this object - //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable - //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on - //! attached transformations. If initialization should be propagated, then use the Initialize() function. - void IsolatedInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters);} - -private: - static const int * CRYPTOPP_API GetDecodingLookupArray(); -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/basecode.cpp b/external/crypto++-5.6.3/basecode.cpp deleted file mode 100644 index 14c4ef014..000000000 --- a/external/crypto++-5.6.3/basecode.cpp +++ /dev/null @@ -1,247 +0,0 @@ -// basecode.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunused-value" -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "basecode.h" -#include "fltrimpl.h" -#include - -NAMESPACE_BEGIN(CryptoPP) - -void BaseN_Encoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - parameters.GetRequiredParameter("BaseN_Encoder", Name::EncodingLookupArray(), m_alphabet); - - parameters.GetRequiredIntParameter("BaseN_Encoder", Name::Log2Base(), m_bitsPerChar); - if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8) - throw InvalidArgument("BaseN_Encoder: Log2Base must be between 1 and 7 inclusive"); - - byte padding; - bool pad; - if (parameters.GetValue(Name::PaddingByte(), padding)) - pad = parameters.GetValueWithDefault(Name::Pad(), true); - else - pad = false; - m_padding = pad ? padding : -1; - - m_bytePos = m_bitPos = 0; - - int i = 8; - while (i%m_bitsPerChar != 0) - i += 8; - m_outputBlockSize = i/m_bitsPerChar; - - m_outBuf.New(m_outputBlockSize); -} - -size_t BaseN_Encoder::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - FILTER_BEGIN; - while (m_inputPosition < length) - { - if (m_bytePos == 0) - memset(m_outBuf, 0, m_outputBlockSize); - - { - unsigned int b = begin[m_inputPosition++], bitsLeftInSource = 8; - while (true) - { - assert(m_bitPos < m_bitsPerChar); - unsigned int bitsLeftInTarget = m_bitsPerChar-m_bitPos; - m_outBuf[m_bytePos] |= b >> (8-bitsLeftInTarget); - if (bitsLeftInSource >= bitsLeftInTarget) - { - m_bitPos = 0; - ++m_bytePos; - bitsLeftInSource -= bitsLeftInTarget; - if (bitsLeftInSource == 0) - break; - b <<= bitsLeftInTarget; - b &= 0xff; - } - else - { - m_bitPos += bitsLeftInSource; - break; - } - } - } - - assert(m_bytePos <= m_outputBlockSize); - if (m_bytePos == m_outputBlockSize) - { - int i; - for (i=0; i 0) - ++m_bytePos; - - int i; - for (i=0; i 0) - { - memset(m_outBuf+m_bytePos, m_padding, m_outputBlockSize-m_bytePos); - m_bytePos = m_outputBlockSize; - } - FILTER_OUTPUT(2, m_outBuf, m_bytePos, messageEnd); - m_bytePos = m_bitPos = 0; - } - FILTER_END_NO_MESSAGE_END; -} - -void BaseN_Decoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - parameters.GetRequiredParameter("BaseN_Decoder", Name::DecodingLookupArray(), m_lookup); - - parameters.GetRequiredIntParameter("BaseN_Decoder", Name::Log2Base(), m_bitsPerChar); - if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8) - throw InvalidArgument("BaseN_Decoder: Log2Base must be between 1 and 7 inclusive"); - - m_bytePos = m_bitPos = 0; - - int i = m_bitsPerChar; - while (i%8 != 0) - i += m_bitsPerChar; - m_outputBlockSize = i/8; - - m_outBuf.New(m_outputBlockSize); -} - -size_t BaseN_Decoder::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - FILTER_BEGIN; - while (m_inputPosition < length) - { - unsigned int value; - value = m_lookup[begin[m_inputPosition++]]; - if (value >= 256) - continue; - - if (m_bytePos == 0 && m_bitPos == 0) - memset(m_outBuf, 0, m_outputBlockSize); - - { - int newBitPos = m_bitPos + m_bitsPerChar; - if (newBitPos <= 8) - m_outBuf[m_bytePos] |= value << (8-newBitPos); - else - { - m_outBuf[m_bytePos] |= value >> (newBitPos-8); - m_outBuf[m_bytePos+1] |= value << (16-newBitPos); - } - - m_bitPos = newBitPos; - while (m_bitPos >= 8) - { - m_bitPos -= 8; - ++m_bytePos; - } - } - - if (m_bytePos == m_outputBlockSize) - { - FILTER_OUTPUT(1, m_outBuf, m_outputBlockSize, 0); - m_bytePos = m_bitPos = 0; - } - } - if (messageEnd) - { - FILTER_OUTPUT(2, m_outBuf, m_bytePos, messageEnd); - m_bytePos = m_bitPos = 0; - } - FILTER_END_NO_MESSAGE_END; -} - -void BaseN_Decoder::InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive) -{ - std::fill(lookup, lookup+256, -1); - - for (unsigned int i=0; i -{ -public: - //! \brief Construct a BaseN_Encoder - //! \param attachment a BufferedTransformation to attach to this object - BaseN_Encoder(BufferedTransformation *attachment=NULL) - : m_alphabet(NULL), m_padding(0), m_bitsPerChar(0) - , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) - {Detach(attachment);} - - //! \brief Construct a BaseN_Encoder - //! \param alphabet table of ASCII characters to use as the alphabet - //! \param log2base the log2base - //! \param attachment a BufferedTransformation to attach to this object - //! \param padding the character to use as padding - //! \pre log2base must be between 1 and 7 inclusive - //! \throws InvalidArgument if log2base is not between 1 and 7 - BaseN_Encoder(const byte *alphabet, int log2base, BufferedTransformation *attachment=NULL, int padding=-1) - : m_alphabet(NULL), m_padding(0), m_bitsPerChar(0) - , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) - { - Detach(attachment); - IsolatedInitialize(MakeParameters(Name::EncodingLookupArray(), alphabet) - (Name::Log2Base(), log2base) - (Name::Pad(), padding != -1) - (Name::PaddingByte(), byte(padding))); - } - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); - -private: - const byte *m_alphabet; - int m_padding, m_bitsPerChar, m_outputBlockSize; - int m_bytePos, m_bitPos; - SecByteBlock m_outBuf; -}; - -//! \class BaseN_Decoder -//! \brief Decoder for bases that are a power of 2 -class CRYPTOPP_DLL BaseN_Decoder : public Unflushable -{ -public: - //! \brief Construct a BaseN_Decoder - //! \param attachment a BufferedTransformation to attach to this object - //! \details padding is set to -1, which means use default padding. If not - //! required, then the value must be set via IsolatedInitialize(). - BaseN_Decoder(BufferedTransformation *attachment=NULL) - : m_lookup(0), m_padding(0), m_bitsPerChar(0) - , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) - {Detach(attachment);} - - //! \brief Construct a BaseN_Decoder - //! \param lookup table of values - //! \param log2base the log2base - //! \param attachment a BufferedTransformation to attach to this object - //! \details log2base is the exponent (like 5 in 25), and not - //! the number of elements (like 32). - //! \details padding is set to -1, which means use default padding. If not - //! required, then the value must be set via IsolatedInitialize(). - BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULL) - : m_lookup(0), m_padding(0), m_bitsPerChar(0) - , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) - { - Detach(attachment); - IsolatedInitialize(MakeParameters(Name::DecodingLookupArray(), lookup)(Name::Log2Base(), log2base)); - } - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); - - //! \brief Intializes BaseN lookup array - //! \param lookup table of values - //! \param alphabet table of ASCII characters - //! \param base the base for the encoder - //! \param caseInsensitive flag indicating whether the alpabet is case sensitivie - //! \pre COUNTOF(lookup) == 256 - //! \pre COUNTOF(alphabet) == base - //! \details Internally, the function sets the first 256 elements in the lookup table to - // their value from the alphabet array or -1. base is the number of element (like 32), - //! and not an exponent (like 5 in 25) - static void CRYPTOPP_API InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive); - -private: - const int *m_lookup; - int m_padding, m_bitsPerChar, m_outputBlockSize; - int m_bytePos, m_bitPos; - SecByteBlock m_outBuf; -}; - -//! \class Grouper -//! \brief Filter that breaks input stream into groups of fixed size -class CRYPTOPP_DLL Grouper : public Bufferless -{ -public: - //! \brief Construct a Grouper - //! \param attachment a BufferedTransformation to attach to this object - Grouper(BufferedTransformation *attachment=NULL) - : m_groupSize(0), m_counter(0) {Detach(attachment);} - - //! \brief Construct a Grouper - //! \param groupSize the size of the grouping - //! \param separator the separator to use between groups - //! \param terminator the terminator appeand after processing - //! \param attachment a BufferedTransformation to attach to this object - Grouper(int groupSize, const std::string &separator, const std::string &terminator, BufferedTransformation *attachment=NULL) - : m_groupSize(0), m_counter(0) - { - Detach(attachment); - IsolatedInitialize(MakeParameters(Name::GroupSize(), groupSize) - (Name::Separator(), ConstByteArrayParameter(separator)) - (Name::Terminator(), ConstByteArrayParameter(terminator))); - } - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); - -private: - SecByteBlock m_separator, m_terminator; - size_t m_groupSize, m_counter; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/bench.cpp b/external/crypto++-5.6.3/bench.cpp deleted file mode 100644 index c038f3213..000000000 --- a/external/crypto++-5.6.3/bench.cpp +++ /dev/null @@ -1,399 +0,0 @@ -// bench.cpp - written and placed in the public domain by Wei Dai - -#include "cryptlib.h" -#include "bench.h" -#include "validate.h" - -#include "aes.h" -#include "blumshub.h" -#include "files.h" -#include "filters.h" -#include "hex.h" -#include "modes.h" -#include "factory.h" -#include "smartptr.h" -#include "cpu.h" - -#include -#include -#include -#include -#include - -// These are noisy enoguh due to test.cpp. Turn them off here. -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -#ifdef CLOCKS_PER_SEC -const double CLOCK_TICKS_PER_SECOND = (double)CLOCKS_PER_SEC; -#elif defined(CLK_TCK) -const double CLOCK_TICKS_PER_SECOND = (double)CLK_TCK; -#else -const double CLOCK_TICKS_PER_SECOND = 1000000.0; -#endif - -double logtotal = 0.0, g_allocatedTime = 0, g_hertz = 0; -unsigned int logcount = 0; - -static const byte defaultKey[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -void OutputResultBytes(const char *name, double length, double timeTaken) -{ - // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) - std::ostringstream out; - out.copyfmt(cout); - - // Coverity finding - if (length < 0.0000000001f) length = 0.000001f; - if (timeTaken < 0.0000000001f) timeTaken = 0.000001f; - - double mbs = length / timeTaken / (1024*1024); - out << "\n" << name; -// out << "" << setprecision(3) << length / (1024*1024); - out << setiosflags(ios::fixed); -// out << "" << setprecision(3) << timeTaken; - out << "" << setprecision(0) << setiosflags(ios::fixed) << mbs; - if (g_hertz) - out << "" << setprecision(1) << setiosflags(ios::fixed) << timeTaken * g_hertz / length; - logtotal += log(mbs); - logcount++; - - cout << out.str(); -} - -void OutputResultKeying(double iterations, double timeTaken) -{ - // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) - std::ostringstream out; - out.copyfmt(cout); - - // Coverity finding - if (iterations < 0.0000000001f) iterations = 0.000001f; - if (timeTaken < 0.0000000001f) timeTaken = 0.000001f; - - out << "" << setprecision(3) << setiosflags(ios::fixed) << (1000*1000*timeTaken/iterations); - if (g_hertz) - out << "" << setprecision(0) << setiosflags(ios::fixed) << timeTaken * g_hertz / iterations; - - cout << out.str(); -} - -void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken) -{ - // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) - std::ostringstream out; - out.copyfmt(cout); - - // Coverity finding - if (!iterations) iterations++; - if (timeTaken < 0.0000000001f) timeTaken = 0.000001f; - - out << "\n" << name << " " << operation << (pc ? " with precomputation" : ""); - out << "" << setprecision(2) << setiosflags(ios::fixed) << (1000*timeTaken/iterations); - if (g_hertz) - out << "" << setprecision(2) << setiosflags(ios::fixed) << timeTaken * g_hertz / iterations / 1000000; - - logtotal += log(iterations/timeTaken); - logcount++; - - cout << out.str(); -} - -/* -void BenchMark(const char *name, BlockTransformation &cipher, double timeTotal) -{ - const int BUF_SIZE = RoundUpToMultipleOf(2048U, cipher.OptimalNumberOfParallelBlocks() * cipher.BlockSize()); - AlignedSecByteBlock buf(BUF_SIZE); - const int nBlocks = BUF_SIZE / cipher.BlockSize(); - clock_t start = clock(); - - unsigned long i=0, blocks=1; - double timeTaken; - do - { - blocks *= 2; - for (; i(cipher), timeTotal); -} - -void BenchMark(const char *name, HashTransformation &ht, double timeTotal) -{ - const int BUF_SIZE=2048U; - AlignedSecByteBlock buf(BUF_SIZE); - GlobalRNG().GenerateBlock(buf, BUF_SIZE); - clock_t start = clock(); - - unsigned long i=0, blocks=1; - double timeTaken; - do - { - blocks *= 2; - for (; i -void BenchMarkByName2(const char *factoryName, size_t keyLength = 0, const char *displayName=NULL, const NameValuePairs ¶ms = g_nullNameValuePairs, T_FactoryOutput *x=NULL, T_Interface *y=NULL) -{ - CRYPTOPP_UNUSED(x), CRYPTOPP_UNUSED(y), CRYPTOPP_UNUSED(params); - - std::string name(factoryName ? factoryName : ""); - member_ptr obj(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - - if (!keyLength) - keyLength = obj->DefaultKeyLength(); - - if (displayName) - name = displayName; - else if (keyLength) - name += " (" + IntToString(keyLength * 8) + "-bit key)"; - - obj->SetKey(defaultKey, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false))); - BenchMark(name.c_str(), *static_cast(obj.get()), g_allocatedTime); - BenchMarkKeying(*obj, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false))); -} - -//VC60 workaround: compiler bug triggered without the extra dummy parameters -template -void BenchMarkByName(const char *factoryName, size_t keyLength = 0, const char *displayName=NULL, const NameValuePairs ¶ms = g_nullNameValuePairs, T_FactoryOutput *x=NULL) -{ - CRYPTOPP_UNUSED(x), CRYPTOPP_UNUSED(params); - - BenchMarkByName2(factoryName, keyLength, displayName, params, x, x); -} - -template -void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NULL, const NameValuePairs ¶ms = g_nullNameValuePairs, T *x=NULL) -{ - CRYPTOPP_UNUSED(x), CRYPTOPP_UNUSED(params); - - std::string name = factoryName; - if (displayName) - name = displayName; - - member_ptr obj(ObjectFactoryRegistry::Registry().CreateObject(factoryName)); - BenchMark(name.c_str(), *obj, g_allocatedTime); -} - -void BenchmarkAll(double t, double hertz) -{ -#if 1 - logtotal = 0; - logcount = 0; - g_allocatedTime = t; - g_hertz = hertz; - - const char *cpb, *cpk; - if (g_hertz) - { - cpb = "Cycles Per Byte"; - cpk = "Cycles to
Setup Key and IV"; - cout << "CPU frequency of the test platform is " << g_hertz << " Hz.\n"; - } - else - { - cpb = cpk = ""; - cout << "CPU frequency of the test platform was not provided.\n"; - } - - cout << "" << endl; - cout << ""; -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasCLMUL()) - BenchMarkByName2("AES/GCM", 0, "AES/GCM"); - else -#endif - { - BenchMarkByName2("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048)); - BenchMarkByName2("AES/GCM", 0, "AES/GCM (64K tables)", MakeParameters(Name::TableSize(), 64*1024)); - } - BenchMarkByName2("AES/CCM"); - BenchMarkByName2("AES/EAX"); - - cout << "\n"; -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasCLMUL()) - BenchMarkByName2("AES/GCM", 0, "GMAC(AES)"); - else -#endif - { - BenchMarkByName2("AES/GCM", 0, "GMAC(AES) (2K tables)", MakeParameters(Name::TableSize(), 2048)); - BenchMarkByName2("AES/GCM", 0, "GMAC(AES) (64K tables)", MakeParameters(Name::TableSize(), 64*1024)); - } - BenchMarkByName("VMAC(AES)-64"); - BenchMarkByName("VMAC(AES)-128"); - BenchMarkByName("HMAC(SHA-1)"); - BenchMarkByName("Two-Track-MAC"); - BenchMarkByName("CMAC(AES)"); - BenchMarkByName("DMAC(AES)"); - - cout << "\n"; - BenchMarkByNameKeyLess("CRC32"); - BenchMarkByNameKeyLess("Adler32"); - BenchMarkByNameKeyLess("MD5"); - BenchMarkByNameKeyLess("SHA-1"); - BenchMarkByNameKeyLess("SHA-256"); - BenchMarkByNameKeyLess("SHA-512"); - BenchMarkByNameKeyLess("SHA-3-224"); - BenchMarkByNameKeyLess("SHA-3-256"); - BenchMarkByNameKeyLess("SHA-3-384"); - BenchMarkByNameKeyLess("SHA-3-512"); - BenchMarkByNameKeyLess("Tiger"); - BenchMarkByNameKeyLess("Whirlpool"); - BenchMarkByNameKeyLess("RIPEMD-160"); - BenchMarkByNameKeyLess("RIPEMD-320"); - BenchMarkByNameKeyLess("RIPEMD-128"); - BenchMarkByNameKeyLess("RIPEMD-256"); - - cout << "\n"; - BenchMarkByName("Panama-LE"); - BenchMarkByName("Panama-BE"); - BenchMarkByName("Salsa20"); - BenchMarkByName("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12)); - BenchMarkByName("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8)); - BenchMarkByName("Sosemanuk"); - BenchMarkByName("MARC4"); - BenchMarkByName("SEAL-3.0-LE"); - BenchMarkByName("WAKE-OFB-LE"); - - cout << "\n"; - BenchMarkByName("AES/CTR", 16); - BenchMarkByName("AES/CTR", 24); - BenchMarkByName("AES/CTR", 32); - BenchMarkByName("AES/CBC", 16); - BenchMarkByName("AES/CBC", 24); - BenchMarkByName("AES/CBC", 32); - BenchMarkByName("AES/OFB", 16); - BenchMarkByName("AES/CFB", 16); - BenchMarkByName("AES/ECB", 16); - BenchMarkByName("Camellia/CTR", 16); - BenchMarkByName("Camellia/CTR", 32); - BenchMarkByName("Twofish/CTR"); - BenchMarkByName("Serpent/CTR"); - BenchMarkByName("CAST-256/CTR"); - BenchMarkByName("RC6/CTR"); - BenchMarkByName("MARS/CTR"); - BenchMarkByName("SHACAL-2/CTR", 16); - BenchMarkByName("SHACAL-2/CTR", 64); - BenchMarkByName("DES/CTR"); - BenchMarkByName("DES-XEX3/CTR"); - BenchMarkByName("DES-EDE3/CTR"); - BenchMarkByName("IDEA/CTR"); - BenchMarkByName("RC5/CTR", 0, "RC5 (r=16)"); - BenchMarkByName("Blowfish/CTR"); - BenchMarkByName("TEA/CTR"); - BenchMarkByName("XTEA/CTR"); - BenchMarkByName("CAST-128/CTR"); - BenchMarkByName("SKIPJACK/CTR"); - BenchMarkByName("SEED/CTR", 0, "SEED/CTR (1/2 K table)"); - cout << "
AlgorithmMiB/Second" << cpb << "Microseconds to
Setup Key and IV" << cpk << endl; - - cout << "\n
" << endl; - - BenchmarkAll2(t, hertz); - cout << "Throughput Geometric Average: " << setiosflags(ios::fixed) << exp(logtotal/(logcount ? logcount : 1)) << endl; - -// Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55 -#if (CRYPTOPP_MSC_VERSION >= 1400) - tm localTime = {}; - char timeBuf[64]; - errno_t err; - - const time_t endTime = time(NULL); - err = localtime_s(&localTime, &endTime); - assert(err == 0); - err = asctime_s(timeBuf, sizeof(timeBuf), &localTime); - assert(err == 0); - - cout << "\nTest ended at " << timeBuf; -#else - const time_t endTime = time(NULL); - cout << "\nTest ended at " << asctime(localtime(&endTime)); -#endif -#endif -} diff --git a/external/crypto++-5.6.3/bench.h b/external/crypto++-5.6.3/bench.h deleted file mode 100644 index 5dfb6d4b3..000000000 --- a/external/crypto++-5.6.3/bench.h +++ /dev/null @@ -1,13 +0,0 @@ -// bench.h - written and placed in the public domain by Wei Dai - -#ifndef CRYPTOPP_BENCH_H -#define CRYPTOPP_BENCH_H - -#include "cryptlib.h" - -extern const double CLOCK_TICKS_PER_SECOND; - -void BenchmarkAll(double t, double hertz); -void BenchmarkAll2(double t, double hertz); - -#endif diff --git a/external/crypto++-5.6.3/bench2.cpp b/external/crypto++-5.6.3/bench2.cpp deleted file mode 100644 index b40d42ff6..000000000 --- a/external/crypto++-5.6.3/bench2.cpp +++ /dev/null @@ -1,337 +0,0 @@ -// bench2.cpp - written and placed in the public domain by Wei Dai - -#include "cryptlib.h" -#include "pubkey.h" -#include "gfpcrypt.h" -#include "eccrypto.h" -#include "bench.h" -#include "validate.h" - -#include "files.h" -#include "filters.h" -#include "hex.h" -#include "rsa.h" -#include "nr.h" -#include "dsa.h" -#include "luc.h" -#include "rw.h" -#include "eccrypto.h" -#include "ecp.h" -#include "ec2n.h" -#include "asn.h" -#include "dh.h" -#include "mqv.h" -#include "xtrcrypt.h" -#include "esign.h" -#include "pssr.h" -#include "oids.h" -#include "randpool.h" - -#include -#include -#include -#include - -// These are noisy enoguh due to test.cpp. Turn them off here. -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken); - -void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc=false) -{ - unsigned int len = 16; - SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len)); - GlobalRNG().GenerateBlock(plaintext, len); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) - key.Encrypt(GlobalRNG(), plaintext, len, ciphertext); - - OutputResultOperations(name, "Encryption", pc, i, timeTaken); - - if (!pc && key.GetMaterial().SupportsPrecomputation()) - { - key.AccessMaterial().Precompute(16); - BenchMarkEncryption(name, key, timeTotal, true); - } -} - -void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal) -{ - unsigned int len = 16; - SecByteBlock ciphertext(pub.CiphertextLength(len)); - SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size())); - GlobalRNG().GenerateBlock(plaintext, len); - pub.Encrypt(GlobalRNG(), plaintext, len, ciphertext); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) - priv.Decrypt(GlobalRNG(), ciphertext, ciphertext.size(), plaintext); - - OutputResultOperations(name, "Decryption", false, i, timeTaken); -} - -void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false) -{ - unsigned int len = 16; - AlignedSecByteBlock message(len), signature(key.SignatureLength()); - GlobalRNG().GenerateBlock(message, len); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) - key.SignMessage(GlobalRNG(), message, len, signature); - - OutputResultOperations(name, "Signature", pc, i, timeTaken); - - if (!pc && key.GetMaterial().SupportsPrecomputation()) - { - key.AccessMaterial().Precompute(16); - BenchMarkSigning(name, key, timeTotal, true); - } -} - -void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false) -{ - unsigned int len = 16; - AlignedSecByteBlock message(len), signature(pub.SignatureLength()); - GlobalRNG().GenerateBlock(message, len); - priv.SignMessage(GlobalRNG(), message, len, signature); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) - { - // The return value is ignored because we are interested in throughput - bool unused = pub.VerifyMessage(message, len, signature, signature.size()); - CRYPTOPP_UNUSED(unused); - } - - OutputResultOperations(name, "Verification", pc, i, timeTaken); - - if (!pc && pub.GetMaterial().SupportsPrecomputation()) - { - pub.AccessMaterial().Precompute(16); - BenchMarkVerification(name, priv, pub, timeTotal, true); - } -} - -void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false) -{ - SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength()); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) - d.GenerateKeyPair(GlobalRNG(), priv, pub); - - OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken); - - if (!pc && d.GetMaterial().SupportsPrecomputation()) - { - d.AccessMaterial().Precompute(16); - BenchMarkKeyGen(name, d, timeTotal, true); - } -} - -void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false) -{ - SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength()); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) - d.GenerateEphemeralKeyPair(GlobalRNG(), priv, pub); - - OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken); - - if (!pc && d.GetMaterial().SupportsPrecomputation()) - { - d.AccessMaterial().Precompute(16); - BenchMarkKeyGen(name, d, timeTotal, true); - } -} - -void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false) -{ - SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength()); - SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength()); - d.GenerateKeyPair(GlobalRNG(), priv1, pub1); - d.GenerateKeyPair(GlobalRNG(), priv2, pub2); - SecByteBlock val(d.AgreedValueLength()); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2) - { - d.Agree(val, priv1, pub2); - d.Agree(val, priv2, pub1); - } - - OutputResultOperations(name, "Key Agreement", pc, i, timeTaken); -} - -void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false) -{ - SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength()); - SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength()); - SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength()); - SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength()); - d.GenerateStaticKeyPair(GlobalRNG(), spriv1, spub1); - d.GenerateStaticKeyPair(GlobalRNG(), spriv2, spub2); - d.GenerateEphemeralKeyPair(GlobalRNG(), epriv1, epub1); - d.GenerateEphemeralKeyPair(GlobalRNG(), epriv2, epub2); - SecByteBlock val(d.AgreedValueLength()); - - const clock_t start = clock(); - unsigned int i; - double timeTaken; - for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2) - { - d.Agree(val, spriv1, epriv1, spub2, epub2); - d.Agree(val, spriv2, epriv2, spub1, epub1); - } - - OutputResultOperations(name, "Key Agreement", pc, i, timeTaken); -} - -//VC60 workaround: compiler bug triggered without the extra dummy parameters -template -void BenchMarkCrypto(const char *filename, const char *name, double timeTotal, SCHEME *x=NULL) -{ - CRYPTOPP_UNUSED(x); - - FileSource f(filename, true, new HexDecoder()); - typename SCHEME::Decryptor priv(f); - typename SCHEME::Encryptor pub(priv); - BenchMarkEncryption(name, pub, timeTotal); - BenchMarkDecryption(name, priv, pub, timeTotal); -} - -//VC60 workaround: compiler bug triggered without the extra dummy parameters -template -void BenchMarkSignature(const char *filename, const char *name, double timeTotal, SCHEME *x=NULL) -{ - CRYPTOPP_UNUSED(x); - - FileSource f(filename, true, new HexDecoder()); - typename SCHEME::Signer priv(f); - typename SCHEME::Verifier pub(priv); - BenchMarkSigning(name, priv, timeTotal); - BenchMarkVerification(name, priv, pub, timeTotal); -} - -//VC60 workaround: compiler bug triggered without the extra dummy parameters -template -void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal, D *x=NULL) -{ - CRYPTOPP_UNUSED(x); - - FileSource f(filename, true, new HexDecoder()); - D d(f); - BenchMarkKeyGen(name, d, timeTotal); - BenchMarkAgreement(name, d, timeTotal); -} - -extern double g_hertz; - -void BenchmarkAll2(double t, double hertz) -{ - g_hertz = hertz; - - cout << "" << endl; - cout << ""; - BenchMarkCrypto > >("TestData/rsa1024.dat", "RSA 1024", t); - BenchMarkCrypto > >("TestData/luc1024.dat", "LUC 1024", t); - BenchMarkCrypto >("TestData/dlie1024.dat", "DLIES 1024", t); - BenchMarkCrypto >("TestData/lucc512.dat", "LUCELG 512", t); - - cout << "\n"; - BenchMarkCrypto > >("TestData/rsa2048.dat", "RSA 2048", t); - BenchMarkCrypto > >("TestData/luc2048.dat", "LUC 2048", t); - BenchMarkCrypto >("TestData/dlie2048.dat", "DLIES 2048", t); - BenchMarkCrypto >("TestData/lucc1024.dat", "LUCELG 1024", t); - - cout << "\n"; - BenchMarkSignature >("TestData/rsa1024.dat", "RSA 1024", t); - BenchMarkSignature >("TestData/rw1024.dat", "RW 1024", t); - BenchMarkSignature >("TestData/luc1024.dat", "LUC 1024", t); - BenchMarkSignature >("TestData/nr1024.dat", "NR 1024", t); - BenchMarkSignature("TestData/dsa1024.dat", "DSA 1024", t); - BenchMarkSignature >("TestData/lucs512.dat", "LUC-HMP 512", t); - BenchMarkSignature >("TestData/esig1023.dat", "ESIGN 1023", t); - BenchMarkSignature >("TestData/esig1536.dat", "ESIGN 1536", t); - - cout << "\n"; - BenchMarkSignature >("TestData/rsa2048.dat", "RSA 2048", t); - BenchMarkSignature >("TestData/rw2048.dat", "RW 2048", t); - BenchMarkSignature >("TestData/luc2048.dat", "LUC 2048", t); - BenchMarkSignature >("TestData/nr2048.dat", "NR 2048", t); - BenchMarkSignature >("TestData/lucs1024.dat", "LUC-HMP 1024", t); - BenchMarkSignature >("TestData/esig2046.dat", "ESIGN 2046", t); - - cout << "\n"; - BenchMarkKeyAgreement("TestData/xtrdh171.dat", "XTR-DH 171", t); - BenchMarkKeyAgreement("TestData/xtrdh342.dat", "XTR-DH 342", t); - BenchMarkKeyAgreement("TestData/dh1024.dat", "DH 1024", t); - BenchMarkKeyAgreement("TestData/dh2048.dat", "DH 2048", t); - BenchMarkKeyAgreement("TestData/lucd512.dat", "LUCDIF 512", t); - BenchMarkKeyAgreement("TestData/lucd1024.dat", "LUCDIF 1024", t); - BenchMarkKeyAgreement("TestData/mqv1024.dat", "MQV 1024", t); - BenchMarkKeyAgreement("TestData/mqv2048.dat", "MQV 2048", t); - - cout << "\n"; - { - ECIES::Decryptor cpriv(GlobalRNG(), ASN1::secp256k1()); - ECIES::Encryptor cpub(cpriv); - ECDSA::Signer spriv(cpriv); - ECDSA::Verifier spub(spriv); - ECDH::Domain ecdhc(ASN1::secp256k1()); - ECMQV::Domain ecmqvc(ASN1::secp256k1()); - - BenchMarkEncryption("ECIES over GF(p) 256", cpub, t); - BenchMarkDecryption("ECIES over GF(p) 256", cpriv, cpub, t); - BenchMarkSigning("ECDSA over GF(p) 256", spriv, t); - BenchMarkVerification("ECDSA over GF(p) 256", spriv, spub, t); - BenchMarkKeyGen("ECDHC over GF(p) 256", ecdhc, t); - BenchMarkAgreement("ECDHC over GF(p) 256", ecdhc, t); - BenchMarkKeyGen("ECMQVC over GF(p) 256", ecmqvc, t); - BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t); - } - - cout << "" << endl; - { - ECIES::Decryptor cpriv(GlobalRNG(), ASN1::sect233r1()); - ECIES::Encryptor cpub(cpriv); - ECDSA::Signer spriv(cpriv); - ECDSA::Verifier spub(spriv); - ECDH::Domain ecdhc(ASN1::sect233r1()); - ECMQV::Domain ecmqvc(ASN1::sect233r1()); - - BenchMarkEncryption("ECIES over GF(2^n) 233", cpub, t); - BenchMarkDecryption("ECIES over GF(2^n) 233", cpriv, cpub, t); - BenchMarkSigning("ECDSA over GF(2^n) 233", spriv, t); - BenchMarkVerification("ECDSA over GF(2^n) 233", spriv, spub, t); - BenchMarkKeyGen("ECDHC over GF(2^n) 233", ecdhc, t); - BenchMarkAgreement("ECDHC over GF(2^n) 233", ecdhc, t); - BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t); - BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t); - } - cout << "
OperationMilliseconds/Operation" << (g_hertz ? "Megacycles/Operation" : "") << endl; - - cout << "\n
" << endl; -} diff --git a/external/crypto++-5.6.3/bfinit.cpp b/external/crypto++-5.6.3/bfinit.cpp deleted file mode 100644 index 714570aaa..000000000 --- a/external/crypto++-5.6.3/bfinit.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include "pch.h" -#include "blowfish.h" - -NAMESPACE_BEGIN(CryptoPP) - -const word32 Blowfish::Base::p_init[Blowfish::ROUNDS+2] = -{ - 608135816U, 2242054355U, 320440878U, 57701188U, - 2752067618U, 698298832U, 137296536U, 3964562569U, - 1160258022U, 953160567U, 3193202383U, 887688300U, - 3232508343U, 3380367581U, 1065670069U, 3041331479U, - 2450970073U, 2306472731U -} ; - -const word32 Blowfish::Base::s_init[4*256] = { - 3509652390U, 2564797868U, 805139163U, 3491422135U, - 3101798381U, 1780907670U, 3128725573U, 4046225305U, - 614570311U, 3012652279U, 134345442U, 2240740374U, - 1667834072U, 1901547113U, 2757295779U, 4103290238U, - 227898511U, 1921955416U, 1904987480U, 2182433518U, - 2069144605U, 3260701109U, 2620446009U, 720527379U, - 3318853667U, 677414384U, 3393288472U, 3101374703U, - 2390351024U, 1614419982U, 1822297739U, 2954791486U, - 3608508353U, 3174124327U, 2024746970U, 1432378464U, - 3864339955U, 2857741204U, 1464375394U, 1676153920U, - 1439316330U, 715854006U, 3033291828U, 289532110U, - 2706671279U, 2087905683U, 3018724369U, 1668267050U, - 732546397U, 1947742710U, 3462151702U, 2609353502U, - 2950085171U, 1814351708U, 2050118529U, 680887927U, - 999245976U, 1800124847U, 3300911131U, 1713906067U, - 1641548236U, 4213287313U, 1216130144U, 1575780402U, - 4018429277U, 3917837745U, 3693486850U, 3949271944U, - 596196993U, 3549867205U, 258830323U, 2213823033U, - 772490370U, 2760122372U, 1774776394U, 2652871518U, - 566650946U, 4142492826U, 1728879713U, 2882767088U, - 1783734482U, 3629395816U, 2517608232U, 2874225571U, - 1861159788U, 326777828U, 3124490320U, 2130389656U, - 2716951837U, 967770486U, 1724537150U, 2185432712U, - 2364442137U, 1164943284U, 2105845187U, 998989502U, - 3765401048U, 2244026483U, 1075463327U, 1455516326U, - 1322494562U, 910128902U, 469688178U, 1117454909U, - 936433444U, 3490320968U, 3675253459U, 1240580251U, - 122909385U, 2157517691U, 634681816U, 4142456567U, - 3825094682U, 3061402683U, 2540495037U, 79693498U, - 3249098678U, 1084186820U, 1583128258U, 426386531U, - 1761308591U, 1047286709U, 322548459U, 995290223U, - 1845252383U, 2603652396U, 3431023940U, 2942221577U, - 3202600964U, 3727903485U, 1712269319U, 422464435U, - 3234572375U, 1170764815U, 3523960633U, 3117677531U, - 1434042557U, 442511882U, 3600875718U, 1076654713U, - 1738483198U, 4213154764U, 2393238008U, 3677496056U, - 1014306527U, 4251020053U, 793779912U, 2902807211U, - 842905082U, 4246964064U, 1395751752U, 1040244610U, - 2656851899U, 3396308128U, 445077038U, 3742853595U, - 3577915638U, 679411651U, 2892444358U, 2354009459U, - 1767581616U, 3150600392U, 3791627101U, 3102740896U, - 284835224U, 4246832056U, 1258075500U, 768725851U, - 2589189241U, 3069724005U, 3532540348U, 1274779536U, - 3789419226U, 2764799539U, 1660621633U, 3471099624U, - 4011903706U, 913787905U, 3497959166U, 737222580U, - 2514213453U, 2928710040U, 3937242737U, 1804850592U, - 3499020752U, 2949064160U, 2386320175U, 2390070455U, - 2415321851U, 4061277028U, 2290661394U, 2416832540U, - 1336762016U, 1754252060U, 3520065937U, 3014181293U, - 791618072U, 3188594551U, 3933548030U, 2332172193U, - 3852520463U, 3043980520U, 413987798U, 3465142937U, - 3030929376U, 4245938359U, 2093235073U, 3534596313U, - 375366246U, 2157278981U, 2479649556U, 555357303U, - 3870105701U, 2008414854U, 3344188149U, 4221384143U, - 3956125452U, 2067696032U, 3594591187U, 2921233993U, - 2428461U, 544322398U, 577241275U, 1471733935U, - 610547355U, 4027169054U, 1432588573U, 1507829418U, - 2025931657U, 3646575487U, 545086370U, 48609733U, - 2200306550U, 1653985193U, 298326376U, 1316178497U, - 3007786442U, 2064951626U, 458293330U, 2589141269U, - 3591329599U, 3164325604U, 727753846U, 2179363840U, - 146436021U, 1461446943U, 4069977195U, 705550613U, - 3059967265U, 3887724982U, 4281599278U, 3313849956U, - 1404054877U, 2845806497U, 146425753U, 1854211946U, - - 1266315497U, 3048417604U, 3681880366U, 3289982499U, - 2909710000U, 1235738493U, 2632868024U, 2414719590U, - 3970600049U, 1771706367U, 1449415276U, 3266420449U, - 422970021U, 1963543593U, 2690192192U, 3826793022U, - 1062508698U, 1531092325U, 1804592342U, 2583117782U, - 2714934279U, 4024971509U, 1294809318U, 4028980673U, - 1289560198U, 2221992742U, 1669523910U, 35572830U, - 157838143U, 1052438473U, 1016535060U, 1802137761U, - 1753167236U, 1386275462U, 3080475397U, 2857371447U, - 1040679964U, 2145300060U, 2390574316U, 1461121720U, - 2956646967U, 4031777805U, 4028374788U, 33600511U, - 2920084762U, 1018524850U, 629373528U, 3691585981U, - 3515945977U, 2091462646U, 2486323059U, 586499841U, - 988145025U, 935516892U, 3367335476U, 2599673255U, - 2839830854U, 265290510U, 3972581182U, 2759138881U, - 3795373465U, 1005194799U, 847297441U, 406762289U, - 1314163512U, 1332590856U, 1866599683U, 4127851711U, - 750260880U, 613907577U, 1450815602U, 3165620655U, - 3734664991U, 3650291728U, 3012275730U, 3704569646U, - 1427272223U, 778793252U, 1343938022U, 2676280711U, - 2052605720U, 1946737175U, 3164576444U, 3914038668U, - 3967478842U, 3682934266U, 1661551462U, 3294938066U, - 4011595847U, 840292616U, 3712170807U, 616741398U, - 312560963U, 711312465U, 1351876610U, 322626781U, - 1910503582U, 271666773U, 2175563734U, 1594956187U, - 70604529U, 3617834859U, 1007753275U, 1495573769U, - 4069517037U, 2549218298U, 2663038764U, 504708206U, - 2263041392U, 3941167025U, 2249088522U, 1514023603U, - 1998579484U, 1312622330U, 694541497U, 2582060303U, - 2151582166U, 1382467621U, 776784248U, 2618340202U, - 3323268794U, 2497899128U, 2784771155U, 503983604U, - 4076293799U, 907881277U, 423175695U, 432175456U, - 1378068232U, 4145222326U, 3954048622U, 3938656102U, - 3820766613U, 2793130115U, 2977904593U, 26017576U, - 3274890735U, 3194772133U, 1700274565U, 1756076034U, - 4006520079U, 3677328699U, 720338349U, 1533947780U, - 354530856U, 688349552U, 3973924725U, 1637815568U, - 332179504U, 3949051286U, 53804574U, 2852348879U, - 3044236432U, 1282449977U, 3583942155U, 3416972820U, - 4006381244U, 1617046695U, 2628476075U, 3002303598U, - 1686838959U, 431878346U, 2686675385U, 1700445008U, - 1080580658U, 1009431731U, 832498133U, 3223435511U, - 2605976345U, 2271191193U, 2516031870U, 1648197032U, - 4164389018U, 2548247927U, 300782431U, 375919233U, - 238389289U, 3353747414U, 2531188641U, 2019080857U, - 1475708069U, 455242339U, 2609103871U, 448939670U, - 3451063019U, 1395535956U, 2413381860U, 1841049896U, - 1491858159U, 885456874U, 4264095073U, 4001119347U, - 1565136089U, 3898914787U, 1108368660U, 540939232U, - 1173283510U, 2745871338U, 3681308437U, 4207628240U, - 3343053890U, 4016749493U, 1699691293U, 1103962373U, - 3625875870U, 2256883143U, 3830138730U, 1031889488U, - 3479347698U, 1535977030U, 4236805024U, 3251091107U, - 2132092099U, 1774941330U, 1199868427U, 1452454533U, - 157007616U, 2904115357U, 342012276U, 595725824U, - 1480756522U, 206960106U, 497939518U, 591360097U, - 863170706U, 2375253569U, 3596610801U, 1814182875U, - 2094937945U, 3421402208U, 1082520231U, 3463918190U, - 2785509508U, 435703966U, 3908032597U, 1641649973U, - 2842273706U, 3305899714U, 1510255612U, 2148256476U, - 2655287854U, 3276092548U, 4258621189U, 236887753U, - 3681803219U, 274041037U, 1734335097U, 3815195456U, - 3317970021U, 1899903192U, 1026095262U, 4050517792U, - 356393447U, 2410691914U, 3873677099U, 3682840055U, - - 3913112168U, 2491498743U, 4132185628U, 2489919796U, - 1091903735U, 1979897079U, 3170134830U, 3567386728U, - 3557303409U, 857797738U, 1136121015U, 1342202287U, - 507115054U, 2535736646U, 337727348U, 3213592640U, - 1301675037U, 2528481711U, 1895095763U, 1721773893U, - 3216771564U, 62756741U, 2142006736U, 835421444U, - 2531993523U, 1442658625U, 3659876326U, 2882144922U, - 676362277U, 1392781812U, 170690266U, 3921047035U, - 1759253602U, 3611846912U, 1745797284U, 664899054U, - 1329594018U, 3901205900U, 3045908486U, 2062866102U, - 2865634940U, 3543621612U, 3464012697U, 1080764994U, - 553557557U, 3656615353U, 3996768171U, 991055499U, - 499776247U, 1265440854U, 648242737U, 3940784050U, - 980351604U, 3713745714U, 1749149687U, 3396870395U, - 4211799374U, 3640570775U, 1161844396U, 3125318951U, - 1431517754U, 545492359U, 4268468663U, 3499529547U, - 1437099964U, 2702547544U, 3433638243U, 2581715763U, - 2787789398U, 1060185593U, 1593081372U, 2418618748U, - 4260947970U, 69676912U, 2159744348U, 86519011U, - 2512459080U, 3838209314U, 1220612927U, 3339683548U, - 133810670U, 1090789135U, 1078426020U, 1569222167U, - 845107691U, 3583754449U, 4072456591U, 1091646820U, - 628848692U, 1613405280U, 3757631651U, 526609435U, - 236106946U, 48312990U, 2942717905U, 3402727701U, - 1797494240U, 859738849U, 992217954U, 4005476642U, - 2243076622U, 3870952857U, 3732016268U, 765654824U, - 3490871365U, 2511836413U, 1685915746U, 3888969200U, - 1414112111U, 2273134842U, 3281911079U, 4080962846U, - 172450625U, 2569994100U, 980381355U, 4109958455U, - 2819808352U, 2716589560U, 2568741196U, 3681446669U, - 3329971472U, 1835478071U, 660984891U, 3704678404U, - 4045999559U, 3422617507U, 3040415634U, 1762651403U, - 1719377915U, 3470491036U, 2693910283U, 3642056355U, - 3138596744U, 1364962596U, 2073328063U, 1983633131U, - 926494387U, 3423689081U, 2150032023U, 4096667949U, - 1749200295U, 3328846651U, 309677260U, 2016342300U, - 1779581495U, 3079819751U, 111262694U, 1274766160U, - 443224088U, 298511866U, 1025883608U, 3806446537U, - 1145181785U, 168956806U, 3641502830U, 3584813610U, - 1689216846U, 3666258015U, 3200248200U, 1692713982U, - 2646376535U, 4042768518U, 1618508792U, 1610833997U, - 3523052358U, 4130873264U, 2001055236U, 3610705100U, - 2202168115U, 4028541809U, 2961195399U, 1006657119U, - 2006996926U, 3186142756U, 1430667929U, 3210227297U, - 1314452623U, 4074634658U, 4101304120U, 2273951170U, - 1399257539U, 3367210612U, 3027628629U, 1190975929U, - 2062231137U, 2333990788U, 2221543033U, 2438960610U, - 1181637006U, 548689776U, 2362791313U, 3372408396U, - 3104550113U, 3145860560U, 296247880U, 1970579870U, - 3078560182U, 3769228297U, 1714227617U, 3291629107U, - 3898220290U, 166772364U, 1251581989U, 493813264U, - 448347421U, 195405023U, 2709975567U, 677966185U, - 3703036547U, 1463355134U, 2715995803U, 1338867538U, - 1343315457U, 2802222074U, 2684532164U, 233230375U, - 2599980071U, 2000651841U, 3277868038U, 1638401717U, - 4028070440U, 3237316320U, 6314154U, 819756386U, - 300326615U, 590932579U, 1405279636U, 3267499572U, - 3150704214U, 2428286686U, 3959192993U, 3461946742U, - 1862657033U, 1266418056U, 963775037U, 2089974820U, - 2263052895U, 1917689273U, 448879540U, 3550394620U, - 3981727096U, 150775221U, 3627908307U, 1303187396U, - 508620638U, 2975983352U, 2726630617U, 1817252668U, - 1876281319U, 1457606340U, 908771278U, 3720792119U, - 3617206836U, 2455994898U, 1729034894U, 1080033504U, - - 976866871U, 3556439503U, 2881648439U, 1522871579U, - 1555064734U, 1336096578U, 3548522304U, 2579274686U, - 3574697629U, 3205460757U, 3593280638U, 3338716283U, - 3079412587U, 564236357U, 2993598910U, 1781952180U, - 1464380207U, 3163844217U, 3332601554U, 1699332808U, - 1393555694U, 1183702653U, 3581086237U, 1288719814U, - 691649499U, 2847557200U, 2895455976U, 3193889540U, - 2717570544U, 1781354906U, 1676643554U, 2592534050U, - 3230253752U, 1126444790U, 2770207658U, 2633158820U, - 2210423226U, 2615765581U, 2414155088U, 3127139286U, - 673620729U, 2805611233U, 1269405062U, 4015350505U, - 3341807571U, 4149409754U, 1057255273U, 2012875353U, - 2162469141U, 2276492801U, 2601117357U, 993977747U, - 3918593370U, 2654263191U, 753973209U, 36408145U, - 2530585658U, 25011837U, 3520020182U, 2088578344U, - 530523599U, 2918365339U, 1524020338U, 1518925132U, - 3760827505U, 3759777254U, 1202760957U, 3985898139U, - 3906192525U, 674977740U, 4174734889U, 2031300136U, - 2019492241U, 3983892565U, 4153806404U, 3822280332U, - 352677332U, 2297720250U, 60907813U, 90501309U, - 3286998549U, 1016092578U, 2535922412U, 2839152426U, - 457141659U, 509813237U, 4120667899U, 652014361U, - 1966332200U, 2975202805U, 55981186U, 2327461051U, - 676427537U, 3255491064U, 2882294119U, 3433927263U, - 1307055953U, 942726286U, 933058658U, 2468411793U, - 3933900994U, 4215176142U, 1361170020U, 2001714738U, - 2830558078U, 3274259782U, 1222529897U, 1679025792U, - 2729314320U, 3714953764U, 1770335741U, 151462246U, - 3013232138U, 1682292957U, 1483529935U, 471910574U, - 1539241949U, 458788160U, 3436315007U, 1807016891U, - 3718408830U, 978976581U, 1043663428U, 3165965781U, - 1927990952U, 4200891579U, 2372276910U, 3208408903U, - 3533431907U, 1412390302U, 2931980059U, 4132332400U, - 1947078029U, 3881505623U, 4168226417U, 2941484381U, - 1077988104U, 1320477388U, 886195818U, 18198404U, - 3786409000U, 2509781533U, 112762804U, 3463356488U, - 1866414978U, 891333506U, 18488651U, 661792760U, - 1628790961U, 3885187036U, 3141171499U, 876946877U, - 2693282273U, 1372485963U, 791857591U, 2686433993U, - 3759982718U, 3167212022U, 3472953795U, 2716379847U, - 445679433U, 3561995674U, 3504004811U, 3574258232U, - 54117162U, 3331405415U, 2381918588U, 3769707343U, - 4154350007U, 1140177722U, 4074052095U, 668550556U, - 3214352940U, 367459370U, 261225585U, 2610173221U, - 4209349473U, 3468074219U, 3265815641U, 314222801U, - 3066103646U, 3808782860U, 282218597U, 3406013506U, - 3773591054U, 379116347U, 1285071038U, 846784868U, - 2669647154U, 3771962079U, 3550491691U, 2305946142U, - 453669953U, 1268987020U, 3317592352U, 3279303384U, - 3744833421U, 2610507566U, 3859509063U, 266596637U, - 3847019092U, 517658769U, 3462560207U, 3443424879U, - 370717030U, 4247526661U, 2224018117U, 4143653529U, - 4112773975U, 2788324899U, 2477274417U, 1456262402U, - 2901442914U, 1517677493U, 1846949527U, 2295493580U, - 3734397586U, 2176403920U, 1280348187U, 1908823572U, - 3871786941U, 846861322U, 1172426758U, 3287448474U, - 3383383037U, 1655181056U, 3139813346U, 901632758U, - 1897031941U, 2986607138U, 3066810236U, 3447102507U, - 1393639104U, 373351379U, 950779232U, 625454576U, - 3124240540U, 4148612726U, 2007998917U, 544563296U, - 2244738638U, 2330496472U, 2058025392U, 1291430526U, - 424198748U, 50039436U, 29584100U, 3605783033U, - 2429876329U, 2791104160U, 1057563949U, 3255363231U, - 3075367218U, 3463963227U, 1469046755U, 985887462U -}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/blowfish.cpp b/external/crypto++-5.6.3/blowfish.cpp deleted file mode 100644 index aaa637cca..000000000 --- a/external/crypto++-5.6.3/blowfish.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// blowfish.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "blowfish.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &) -{ - AssertValidKeyLength(keylength); - - unsigned i, j=0, k; - word32 data, dspace[2] = {0, 0}; - - memcpy(pbox, p_init, sizeof(p_init)); - memcpy(sbox, s_init, sizeof(s_init)); - - // Xor key string into encryption key vector - for (i=0 ; i Block; - - word32 left, right; - Block::Get(inBlock)(left)(right); - - const word32 *const s=sbox; - const word32 *p=pbox; - - left ^= p[0]; - - for (unsigned i=0; i, public VariableKeyLength<16, 4, 56>, public FixedRounds<16> -{ - static const char *StaticAlgorithmName() {return "Blowfish";} -}; - -// Blowfish - -//! \class Blowfish -//! \brief Provides Blowfish encryption and decryption -class Blowfish : public Blowfish_Info, public BlockCipherDocumentation -{ - //! \class Base - //! \brief Class specific implementation and overrides used to operate the cipher. - //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - void UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs ¶ms); - - private: - void crypt_block(const word32 in[2], word32 out[2]) const; - - static const word32 p_init[ROUNDS+2]; - static const word32 s_init[4*256]; - - FixedSizeSecBlock pbox; - FixedSizeSecBlock sbox; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef Blowfish::Encryption BlowfishEncryption; -typedef Blowfish::Decryption BlowfishDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/blumshub.cpp b/external/crypto++-5.6.3/blumshub.cpp deleted file mode 100644 index ce63a67a7..000000000 --- a/external/crypto++-5.6.3/blumshub.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// blumshub.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "blumshub.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -PublicBlumBlumShub::PublicBlumBlumShub(const Integer &n, const Integer &seed) - : modn(n), - current(modn.Square(modn.Square(seed))), - maxBits(BitPrecision(n.BitCount())-1), - bitsLeft(maxBits) -{ -} - -unsigned int PublicBlumBlumShub::GenerateBit() -{ - if (bitsLeft==0) - { - current = modn.Square(current); - bitsLeft = maxBits; - } - - return current.GetBit(--bitsLeft); -} - -byte PublicBlumBlumShub::GenerateByte() -{ - byte b=0; - for (int i=0; i<8; i++) - b = byte((b << 1) | PublicBlumBlumShub::GenerateBit()); - return b; -} - -void PublicBlumBlumShub::GenerateBlock(byte *output, size_t size) -{ - while (size--) - *output++ = PublicBlumBlumShub::GenerateByte(); -} - -void PublicBlumBlumShub::ProcessData(byte *outString, const byte *inString, size_t length) -{ - while (length--) - *outString++ = *inString++ ^ PublicBlumBlumShub::GenerateByte(); -} - -BlumBlumShub::BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed) - : PublicBlumBlumShub(p*q, seed), - p(p), q(q), - x0(modn.Square(seed)) -{ -} - -void BlumBlumShub::Seek(lword index) -{ - Integer i(Integer::POSITIVE, index); - i *= 8; - Integer e = a_exp_b_mod_c (2, i / maxBits + 1, (p-1)*(q-1)); - current = modn.Exponentiate(x0, e); - bitsLeft = maxBits - i % maxBits; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/blumshub.h b/external/crypto++-5.6.3/blumshub.h deleted file mode 100644 index b82c5bbe0..000000000 --- a/external/crypto++-5.6.3/blumshub.h +++ /dev/null @@ -1,63 +0,0 @@ -// blumshub.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile blumshub.h -//! \brief Classes for Blum Blum Shub generator - -#ifndef CRYPTOPP_BLUMSHUB_H -#define CRYPTOPP_BLUMSHUB_H - -#include "cryptlib.h" -#include "modarith.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! BlumBlumShub without factorization of the modulus -class PublicBlumBlumShub : public RandomNumberGenerator, - public StreamTransformation -{ -public: - PublicBlumBlumShub(const Integer &n, const Integer &seed); - - unsigned int GenerateBit(); - byte GenerateByte(); - void GenerateBlock(byte *output, size_t size); - void ProcessData(byte *outString, const byte *inString, size_t length); - - bool IsSelfInverting() const {return true;} - bool IsForwardTransformation() const {return true;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PublicBlumBlumShub() {} -#endif - -protected: - ModularArithmetic modn; - Integer current; - word maxBits, bitsLeft; -}; - -//! BlumBlumShub with factorization of the modulus -class BlumBlumShub : public PublicBlumBlumShub -{ -public: - // Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long, - // seed is the secret key and should be about as big as p*q - BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed); - - bool IsRandomAccess() const {return true;} - void Seek(lword index); - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~BlumBlumShub() {} -#endif - -protected: - const Integer p, q; - const Integer x0; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/build.sh b/external/crypto++-5.6.3/build.sh deleted file mode 100644 index 56124431b..000000000 --- a/external/crypto++-5.6.3/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -# Make the 32-bit and 64-bit versions of crypto++ -ISX86=1 ISX64=0 make clean -ISX86=1 ISX64=0 make -j12 -ISX86=1 ISX64=1 make clean -ISX86=1 ISX64=1 make -j12 - -# Make the steamcmd version of crypto++ -STEAMCMD=1 ISX86=1 ISX64=0 make clean -STEAMCMD=1 ISX86=1 ISX64=0 make -j12 - diff --git a/external/crypto++-5.6.3/camellia.cpp b/external/crypto++-5.6.3/camellia.cpp deleted file mode 100644 index 84473b872..000000000 --- a/external/crypto++-5.6.3/camellia.cpp +++ /dev/null @@ -1,532 +0,0 @@ -// camellia.cpp - by Kevin Springle, 2003 -// This code is hereby placed in the public domain. - -/* -Optimisations and defense against timing attacks added in Jan 2007 by Wei Dai. - -The first 2 rounds and the last round seem especially vulnerable to timing -attacks. The protection is similar to what was implemented for Rijndael. -See comments at top of rijndael.cpp for more details. -*/ - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4456) -# if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(disable: 6246) -# endif -#endif - -#include "camellia.h" -#include "misc.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -// round implementation that uses a small table for protection against timing attacks -#define SLOW_ROUND(lh, ll, rh, rl, kh, kl) { \ - word32 zr = ll ^ kl; \ - word32 zl = lh ^ kh; \ - zr= rotlFixed(s1[GETBYTE(zr, 3)], 1) | \ - (rotrFixed(s1[GETBYTE(zr, 2)], 1) << 24) | \ - (s1[rotlFixed(CRYPTOPP_GET_BYTE_AS_BYTE(zr, 1),1)] << 16) | \ - (s1[GETBYTE(zr, 0)] << 8); \ - zl= (s1[GETBYTE(zl, 3)] << 24) | \ - (rotlFixed(s1[GETBYTE(zl, 2)], 1) << 16) | \ - (rotrFixed(s1[GETBYTE(zl, 1)], 1) << 8) | \ - s1[rotlFixed(CRYPTOPP_GET_BYTE_AS_BYTE(zl, 0), 1)]; \ - zl ^= zr; \ - zr = zl ^ rotlFixed(zr, 8); \ - zl = zr ^ rotrFixed(zl, 8); \ - rh ^= rotlFixed(zr, 16); \ - rh ^= zl; \ - rl ^= rotlFixed(zl, 8); \ - } - -// normal round - same output as above but using larger tables for faster speed -#define ROUND(lh, ll, rh, rl, kh, kl) { \ - word32 th = lh ^ kh; \ - word32 tl = ll ^ kl; \ - word32 d = SP[0][GETBYTE(tl,0)] ^ SP[1][GETBYTE(tl,3)] ^ SP[2][GETBYTE(tl,2)] ^ SP[3][GETBYTE(tl,1)]; \ - word32 u = SP[0][GETBYTE(th,3)] ^ SP[1][GETBYTE(th,2)] ^ SP[2][GETBYTE(th,1)] ^ SP[3][GETBYTE(th,0)]; \ - d ^= u; \ - rh ^= d; \ - rl ^= d; \ - rl ^= rotrFixed(u, 8);} - -#define DOUBLE_ROUND(lh, ll, rh, rl, k0, k1, k2, k3) \ - ROUND(lh, ll, rh, rl, k0, k1) \ - ROUND(rh, rl, lh, ll, k2, k3) - -#ifdef IS_LITTLE_ENDIAN -#define EFI(i) (1-(i)) -#else -#define EFI(i) (i) -#endif - -void Camellia::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs &) -{ - m_rounds = (keylen >= 24) ? 4 : 3; - unsigned int kslen = (8 * m_rounds + 2); - m_key.New(kslen*2); - word32 *ks32 = m_key.data(); - int m=0, a=0; - if (!IsForwardTransformation()) - m = -1, a = kslen-1; - - word32 kl0, kl1, kl2, kl3; - GetBlock getBlock(key); - getBlock(kl0)(kl1)(kl2)(kl3); - word32 k0=kl0, k1=kl1, k2=kl2, k3=kl3; - -#define CALC_ADDR2(base, i, j) ((byte *)(base)+8*(i)+4*(j)+((-16*(i))&m)) -#define CALC_ADDR(base, i) CALC_ADDR2(base, i, 0) - -#if 1 - word64 kwl, kwr; - ks32 += 2*a; -#define PREPARE_KS_ROUNDS \ - kwl = (word64(k0) << 32) | k1; \ - kwr = (word64(k2) << 32) | k3 -#define KS_ROUND_0(i) \ - *(word64*)CALC_ADDR(ks32, i+EFI(0)) = kwl; \ - *(word64*)CALC_ADDR(ks32, i+EFI(1)) = kwr -#define KS_ROUND(i, r, which) \ - if (which & (1<> (64 - (r%64))); \ - if (which & (1<64))) *(word64*)CALC_ADDR(ks32, i+EFI(r>64)) = (kwl << (r%64)) | (kwr >> (64 - (r%64))) -#else - // SSE2 version is 30% faster on Intel Core 2. Doesn't seem worth the hassle of maintenance, but left here - // #if'd out in case someone needs it. - __m128i kw, kw2; - __m128i *ks128 = (__m128i *)ks32+a/2; - ks32 += 2*a; -#define PREPARE_KS_ROUNDS \ - kw = _mm_set_epi32(k0, k1, k2, k3); \ - if (m) kw2 = kw, kw = _mm_shuffle_epi32(kw, _MM_SHUFFLE(1, 0, 3, 2)); \ - else kw2 = _mm_shuffle_epi32(kw, _MM_SHUFFLE(1, 0, 3, 2)) -#define KS_ROUND_0(i) \ - _mm_store_si128((__m128i *)CALC_ADDR(ks128, i), kw) -#define KS_ROUND(i, r, which) { \ - __m128i temp; \ - if (r<64 && (which!=1 || m)) temp = _mm_or_si128(_mm_slli_epi64(kw, r%64), _mm_srli_epi64(kw2, 64-r%64)); \ - else temp = _mm_or_si128(_mm_slli_epi64(kw2, r%64), _mm_srli_epi64(kw, 64-r%64)); \ - if (which & 2) _mm_store_si128((__m128i *)CALC_ADDR(ks128, i), temp); \ - else _mm_storel_epi64((__m128i*)CALC_ADDR(ks32, i+EFI(0)), temp); \ - } -#endif - - if (keylen == 16) - { - // KL - PREPARE_KS_ROUNDS; - KS_ROUND_0(0); - KS_ROUND(4, 15, 3); - KS_ROUND(10, 45, 3); - KS_ROUND(12, 60, 2); - KS_ROUND(16, 77, 3); - KS_ROUND(18, 94, 3); - KS_ROUND(22, 111, 3); - - // KA - k0=kl0, k1=kl1, k2=kl2, k3=kl3; - DOUBLE_ROUND(k0, k1, k2, k3, 0xA09E667Ful, 0x3BCC908Bul, 0xB67AE858ul, 0x4CAA73B2ul); - k0^=kl0, k1^=kl1, k2^=kl2, k3^=kl3; - DOUBLE_ROUND(k0, k1, k2, k3, 0xC6EF372Ful, 0xE94F82BEul, 0x54FF53A5ul, 0xF1D36F1Cul); - - PREPARE_KS_ROUNDS; - KS_ROUND_0(2); - KS_ROUND(6, 15, 3); - KS_ROUND(8, 30, 3); - KS_ROUND(12, 45, 1); - KS_ROUND(14, 60, 3); - KS_ROUND(20, 94, 3); - KS_ROUND(24, 47, 3); - } - else - { - // KL - PREPARE_KS_ROUNDS; - KS_ROUND_0(0); - KS_ROUND(12, 45, 3); - KS_ROUND(16, 60, 3); - KS_ROUND(22, 77, 3); - KS_ROUND(30, 111, 3); - - // KR - word32 kr0, kr1, kr2, kr3; - GetBlock(key+16)(kr0)(kr1); - if (keylen == 24) - kr2 = ~kr0, kr3 = ~kr1; - else - GetBlock(key+24)(kr2)(kr3); - k0=kr0, k1=kr1, k2=kr2, k3=kr3; - - PREPARE_KS_ROUNDS; - KS_ROUND(4, 15, 3); - KS_ROUND(8, 30, 3); - KS_ROUND(18, 60, 3); - KS_ROUND(26, 94, 3); - - // KA - k0^=kl0, k1^=kl1, k2^=kl2, k3^=kl3; - DOUBLE_ROUND(k0, k1, k2, k3, 0xA09E667Ful, 0x3BCC908Bul, 0xB67AE858ul, 0x4CAA73B2ul); - k0^=kl0, k1^=kl1, k2^=kl2, k3^=kl3; - DOUBLE_ROUND(k0, k1, k2, k3, 0xC6EF372Ful, 0xE94F82BEul, 0x54FF53A5ul, 0xF1D36F1Cul); - - PREPARE_KS_ROUNDS; - KS_ROUND(6, 15, 3); - KS_ROUND(14, 45, 3); - KS_ROUND(24, 77, 3); - KS_ROUND(28, 94, 3); - - // KB - k0^=kr0, k1^=kr1, k2^=kr2, k3^=kr3; - DOUBLE_ROUND(k0, k1, k2, k3, 0x10E527FAul, 0xDE682D1Dul, 0xB05688C2ul, 0xB3E6C1FDul); - - PREPARE_KS_ROUNDS; - KS_ROUND_0(2); - KS_ROUND(10, 30, 3); - KS_ROUND(20, 60, 3); - KS_ROUND(32, 47, 3); - } -} - -void Camellia::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ -#define KS(i, j) ks[i*4 + EFI(j/2)*2 + EFI(j%2)] - -#define FL(klh, kll, krh, krl) \ - ll ^= rotlFixed(lh & klh, 1); \ - lh ^= (ll | kll); \ - rh ^= (rl | krl); \ - rl ^= rotlFixed(rh & krh, 1); - - word32 lh, ll, rh, rl; - typedef BlockGetAndPut Block; - Block::Get(inBlock)(lh)(ll)(rh)(rl); - const word32 *ks = m_key.data(); - lh ^= KS(0,0); - ll ^= KS(0,1); - rh ^= KS(0,2); - rl ^= KS(0,3); - - // timing attack countermeasure. see comments at top for more details - const int cacheLineSize = GetCacheLineSize(); - unsigned int i; - word32 u = 0; - for (i=0; i<256; i+=cacheLineSize) - u &= *(const word32 *)(s1+i); - u &= *(const word32 *)(s1+252); - lh |= u; ll |= u; - - SLOW_ROUND(lh, ll, rh, rl, KS(1,0), KS(1,1)) - SLOW_ROUND(rh, rl, lh, ll, KS(1,2), KS(1,3)) - for (i = m_rounds-1; i > 0; --i) - { - DOUBLE_ROUND(lh, ll, rh, rl, KS(2,0), KS(2,1), KS(2,2), KS(2,3)) - DOUBLE_ROUND(lh, ll, rh, rl, KS(3,0), KS(3,1), KS(3,2), KS(3,3)) - FL(KS(4,0), KS(4,1), KS(4,2), KS(4,3)); - DOUBLE_ROUND(lh, ll, rh, rl, KS(5,0), KS(5,1), KS(5,2), KS(5,3)) - ks += 16; - } - DOUBLE_ROUND(lh, ll, rh, rl, KS(2,0), KS(2,1), KS(2,2), KS(2,3)) - ROUND(lh, ll, rh, rl, KS(3,0), KS(3,1)) - SLOW_ROUND(rh, rl, lh, ll, KS(3,2), KS(3,3)) - lh ^= KS(4,0); - ll ^= KS(4,1); - rh ^= KS(4,2); - rl ^= KS(4,3); - Block::Put(xorBlock, outBlock)(rh)(rl)(lh)(ll); -} - -// The Camellia s-boxes - -const byte Camellia::Base::s1[256] = -{ - 112,130,44,236,179,39,192,229,228,133,87,53,234,12,174,65, - 35,239,107,147,69,25,165,33,237,14,79,78,29,101,146,189, - 134,184,175,143,124,235,31,206,62,48,220,95,94,197,11,26, - 166,225,57,202,213,71,93,61,217,1,90,214,81,86,108,77, - 139,13,154,102,251,204,176,45,116,18,43,32,240,177,132,153, - 223,76,203,194,52,126,118,5,109,183,169,49,209,23,4,215, - 20,88,58,97,222,27,17,28,50,15,156,22,83,24,242,34, - 254,68,207,178,195,181,122,145,36,8,232,168,96,252,105,80, - 170,208,160,125,161,137,98,151,84,91,30,149,224,255,100,210, - 16,196,0,72,163,247,117,219,138,3,230,218,9,63,221,148, - 135,92,131,2,205,74,144,51,115,103,246,243,157,127,191,226, - 82,155,216,38,200,55,198,59,129,150,111,75,19,190,99,46, - 233,121,167,140,159,110,188,142,41,245,249,182,47,253,180,89, - 120,152,6,106,231,70,113,186,212,37,171,66,136,162,141,250, - 114,7,185,85,248,238,172,10,54,73,42,104,60,56,241,164, - 64,40,211,123,187,201,67,193,21,227,173,244,119,199,128,158 -}; - -const word32 Camellia::Base::SP[4][256] = { - { - 0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, - 0xb3b3b300, 0x27272700, 0xc0c0c000, 0xe5e5e500, - 0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, - 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, - 0x23232300, 0xefefef00, 0x6b6b6b00, 0x93939300, - 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100, - 0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, - 0x1d1d1d00, 0x65656500, 0x92929200, 0xbdbdbd00, - 0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, - 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00, - 0x3e3e3e00, 0x30303000, 0xdcdcdc00, 0x5f5f5f00, - 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00, - 0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, - 0xd5d5d500, 0x47474700, 0x5d5d5d00, 0x3d3d3d00, - 0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, - 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00, - 0x8b8b8b00, 0x0d0d0d00, 0x9a9a9a00, 0x66666600, - 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00, - 0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, - 0xf0f0f000, 0xb1b1b100, 0x84848400, 0x99999900, - 0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, - 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500, - 0x6d6d6d00, 0xb7b7b700, 0xa9a9a900, 0x31313100, - 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700, - 0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, - 0xdedede00, 0x1b1b1b00, 0x11111100, 0x1c1c1c00, - 0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, - 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200, - 0xfefefe00, 0x44444400, 0xcfcfcf00, 0xb2b2b200, - 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100, - 0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, - 0x60606000, 0xfcfcfc00, 0x69696900, 0x50505000, - 0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, - 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700, - 0x54545400, 0x5b5b5b00, 0x1e1e1e00, 0x95959500, - 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200, - 0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, - 0xa3a3a300, 0xf7f7f700, 0x75757500, 0xdbdbdb00, - 0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, - 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400, - 0x87878700, 0x5c5c5c00, 0x83838300, 0x02020200, - 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300, - 0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, - 0x9d9d9d00, 0x7f7f7f00, 0xbfbfbf00, 0xe2e2e200, - 0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, - 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00, - 0x81818100, 0x96969600, 0x6f6f6f00, 0x4b4b4b00, - 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00, - 0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, - 0x9f9f9f00, 0x6e6e6e00, 0xbcbcbc00, 0x8e8e8e00, - 0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, - 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900, - 0x78787800, 0x98989800, 0x06060600, 0x6a6a6a00, - 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00, - 0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, - 0x88888800, 0xa2a2a200, 0x8d8d8d00, 0xfafafa00, - 0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, - 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00, - 0x36363600, 0x49494900, 0x2a2a2a00, 0x68686800, - 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400, - 0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, - 0xbbbbbb00, 0xc9c9c900, 0x43434300, 0xc1c1c100, - 0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, - 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00 - }, - { - 0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, - 0x00676767, 0x004e4e4e, 0x00818181, 0x00cbcbcb, - 0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, - 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282, - 0x00464646, 0x00dfdfdf, 0x00d6d6d6, 0x00272727, - 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242, - 0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, - 0x003a3a3a, 0x00cacaca, 0x00252525, 0x007b7b7b, - 0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, - 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d, - 0x007c7c7c, 0x00606060, 0x00b9b9b9, 0x00bebebe, - 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434, - 0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, - 0x00ababab, 0x008e8e8e, 0x00bababa, 0x007a7a7a, - 0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, - 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a, - 0x00171717, 0x001a1a1a, 0x00353535, 0x00cccccc, - 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a, - 0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, - 0x00e1e1e1, 0x00636363, 0x00090909, 0x00333333, - 0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, - 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a, - 0x00dadada, 0x006f6f6f, 0x00535353, 0x00626262, - 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf, - 0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, - 0x00bdbdbd, 0x00363636, 0x00222222, 0x00383838, - 0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, - 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444, - 0x00fdfdfd, 0x00888888, 0x009f9f9f, 0x00656565, - 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323, - 0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, - 0x00c0c0c0, 0x00f9f9f9, 0x00d2d2d2, 0x00a0a0a0, - 0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, - 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f, - 0x00a8a8a8, 0x00b6b6b6, 0x003c3c3c, 0x002b2b2b, - 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5, - 0x00202020, 0x00898989, 0x00000000, 0x00909090, - 0x00474747, 0x00efefef, 0x00eaeaea, 0x00b7b7b7, - 0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, - 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929, - 0x000f0f0f, 0x00b8b8b8, 0x00070707, 0x00040404, - 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666, - 0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, - 0x003b3b3b, 0x00fefefe, 0x007f7f7f, 0x00c5c5c5, - 0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, - 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676, - 0x00030303, 0x002d2d2d, 0x00dedede, 0x00969696, - 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c, - 0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, - 0x003f3f3f, 0x00dcdcdc, 0x00797979, 0x001d1d1d, - 0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, - 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2, - 0x00f0f0f0, 0x00313131, 0x000c0c0c, 0x00d4d4d4, - 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575, - 0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, - 0x00111111, 0x00454545, 0x001b1b1b, 0x00f5f5f5, - 0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, - 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414, - 0x006c6c6c, 0x00929292, 0x00545454, 0x00d0d0d0, - 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949, - 0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, - 0x00777777, 0x00939393, 0x00868686, 0x00838383, - 0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, - 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d - }, - { - 0x38003838, 0x41004141, 0x16001616, 0x76007676, - 0xd900d9d9, 0x93009393, 0x60006060, 0xf200f2f2, - 0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, - 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0, - 0x91009191, 0xf700f7f7, 0xb500b5b5, 0xc900c9c9, - 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090, - 0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, - 0x8e008e8e, 0xb200b2b2, 0x49004949, 0xde00dede, - 0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, - 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767, - 0x1f001f1f, 0x18001818, 0x6e006e6e, 0xaf00afaf, - 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d, - 0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, - 0xea00eaea, 0xa300a3a3, 0xae00aeae, 0x9e009e9e, - 0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, - 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6, - 0xc500c5c5, 0x86008686, 0x4d004d4d, 0x33003333, - 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696, - 0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, - 0x78007878, 0xd800d8d8, 0x42004242, 0xcc00cccc, - 0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, - 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282, - 0xb600b6b6, 0xdb00dbdb, 0xd400d4d4, 0x98009898, - 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb, - 0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, - 0x6f006f6f, 0x8d008d8d, 0x88008888, 0x0e000e0e, - 0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, - 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111, - 0x7f007f7f, 0x22002222, 0xe700e7e7, 0x59005959, - 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8, - 0x12001212, 0x04000404, 0x74007474, 0x54005454, - 0x30003030, 0x7e007e7e, 0xb400b4b4, 0x28002828, - 0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, - 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb, - 0x2a002a2a, 0xad00adad, 0x0f000f0f, 0xca00caca, - 0x70007070, 0xff00ffff, 0x32003232, 0x69006969, - 0x08000808, 0x62006262, 0x00000000, 0x24002424, - 0xd100d1d1, 0xfb00fbfb, 0xba00baba, 0xed00eded, - 0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, - 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a, - 0xc300c3c3, 0x2e002e2e, 0xc100c1c1, 0x01000101, - 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999, - 0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, - 0xce00cece, 0xbf00bfbf, 0xdf00dfdf, 0x71007171, - 0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, - 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d, - 0xc000c0c0, 0x4b004b4b, 0xb700b7b7, 0xa500a5a5, - 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717, - 0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, - 0xcf00cfcf, 0x37003737, 0x5e005e5e, 0x47004747, - 0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, - 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac, - 0x3c003c3c, 0x4c004c4c, 0x03000303, 0x35003535, - 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d, - 0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, - 0x44004444, 0x51005151, 0xc600c6c6, 0x7d007d7d, - 0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, - 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505, - 0x1b001b1b, 0xa400a4a4, 0x15001515, 0x34003434, - 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252, - 0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, - 0xdd00dddd, 0xe400e4e4, 0xa100a1a1, 0xe000e0e0, - 0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, - 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f - }, - { - 0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, - 0xe4e400e4, 0x57570057, 0xeaea00ea, 0xaeae00ae, - 0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, - 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092, - 0x86860086, 0xafaf00af, 0x7c7c007c, 0x1f1f001f, - 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b, - 0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, - 0xd9d900d9, 0x5a5a005a, 0x51510051, 0x6c6c006c, - 0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, - 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084, - 0xdfdf00df, 0xcbcb00cb, 0x34340034, 0x76760076, - 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004, - 0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, - 0x32320032, 0x9c9c009c, 0x53530053, 0xf2f200f2, - 0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, - 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069, - 0xaaaa00aa, 0xa0a000a0, 0xa1a100a1, 0x62620062, - 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064, - 0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, - 0x8a8a008a, 0xe6e600e6, 0x09090009, 0xdddd00dd, - 0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, - 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf, - 0x52520052, 0xd8d800d8, 0xc8c800c8, 0xc6c600c6, - 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063, - 0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, - 0x29290029, 0xf9f900f9, 0x2f2f002f, 0xb4b400b4, - 0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, - 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d, - 0x72720072, 0xb9b900b9, 0xf8f800f8, 0xacac00ac, - 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1, - 0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, - 0x15150015, 0xadad00ad, 0x77770077, 0x80800080, - 0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, - 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041, - 0xefef00ef, 0x93930093, 0x19190019, 0x21210021, - 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd, - 0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, - 0x30300030, 0x5f5f005f, 0xc5c500c5, 0x1a1a001a, - 0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, - 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d, - 0x0d0d000d, 0x66660066, 0xcccc00cc, 0x2d2d002d, - 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099, - 0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, - 0xb7b700b7, 0x31310031, 0x17170017, 0xd7d700d7, - 0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, - 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022, - 0x44440044, 0xb2b200b2, 0xb5b500b5, 0x91910091, - 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050, - 0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, - 0x5b5b005b, 0x95950095, 0xffff00ff, 0xd2d200d2, - 0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, - 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094, - 0x5c5c005c, 0x02020002, 0x4a4a004a, 0x33330033, - 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2, - 0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, - 0x96960096, 0x4b4b004b, 0xbebe00be, 0x2e2e002e, - 0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, - 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059, - 0x98980098, 0x6a6a006a, 0x46460046, 0xbaba00ba, - 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa, - 0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, - 0x49490049, 0x68680068, 0x38380038, 0xa4a400a4, - 0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, - 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e - }}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/camellia.h b/external/crypto++-5.6.3/camellia.h deleted file mode 100644 index 69b2651c6..000000000 --- a/external/crypto++-5.6.3/camellia.h +++ /dev/null @@ -1,48 +0,0 @@ -// camellia.h - written and placed in the public domain by Wei Dai - -//! \file camellia.h -//! \brief Classes for the Cameliia block cipher - -#ifndef CRYPTOPP_CAMELLIA_H -#define CRYPTOPP_CAMELLIA_H - -#include "config.h" -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8> -{ - static const char *StaticAlgorithmName() {return "Camellia";} -}; - -/// Camellia -class Camellia : public Camellia_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - protected: - static const byte s1[256]; - static const word32 SP[4][256]; - - unsigned int m_rounds; - SecBlock m_key; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef Camellia::Encryption CamelliaEncryption; -typedef Camellia::Decryption CamelliaDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/cast.cpp b/external/crypto++-5.6.3/cast.cpp deleted file mode 100644 index ef0a5efdb..000000000 --- a/external/crypto++-5.6.3/cast.cpp +++ /dev/null @@ -1,296 +0,0 @@ -// cast.cpp - written and placed in the public domain by Wei Dai and Leonard Janke -// based on Steve Reid's public domain cast.c - -#include "pch.h" -#include "cast.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -/* Macros to access 8-bit bytes out of a 32-bit word */ -#define U8a(x) GETBYTE(x,3) -#define U8b(x) GETBYTE(x,2) -#define U8c(x) GETBYTE(x,1) -#define U8d(x) GETBYTE(x,0) - -/* CAST uses three different round functions */ -#define f1(l, r, km, kr) \ - t = rotlVariable(km + r, kr); \ - l ^= ((S[0][U8a(t)] ^ S[1][U8b(t)]) - \ - S[2][U8c(t)]) + S[3][U8d(t)]; -#define f2(l, r, km, kr) \ - t = rotlVariable(km ^ r, kr); \ - l ^= ((S[0][U8a(t)] - S[1][U8b(t)]) + \ - S[2][U8c(t)]) ^ S[3][U8d(t)]; -#define f3(l, r, km, kr) \ - t = rotlVariable(km - r, kr); \ - l ^= ((S[0][U8a(t)] + S[1][U8b(t)]) ^ \ - S[2][U8c(t)]) - S[3][U8d(t)]; - -#define F1(l, r, i, j) f1(l, r, K[i], K[i+j]) -#define F2(l, r, i, j) f2(l, r, K[i], K[i+j]) -#define F3(l, r, i, j) f3(l, r, K[i], K[i+j]) - -typedef BlockGetAndPut Block; - -void CAST128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 t, l, r; - - /* Get inblock into l,r */ - Block::Get(inBlock)(l)(r); - /* Do the work */ - F1(l, r, 0, 16); - F2(r, l, 1, 16); - F3(l, r, 2, 16); - F1(r, l, 3, 16); - F2(l, r, 4, 16); - F3(r, l, 5, 16); - F1(l, r, 6, 16); - F2(r, l, 7, 16); - F3(l, r, 8, 16); - F1(r, l, 9, 16); - F2(l, r, 10, 16); - F3(r, l, 11, 16); - /* Only do full 16 rounds if key length > 80 bits */ - if (!reduced) { - F1(l, r, 12, 16); - F2(r, l, 13, 16); - F3(l, r, 14, 16); - F1(r, l, 15, 16); - } - /* Put l,r into outblock */ - Block::Put(xorBlock, outBlock)(r)(l); -} - -void CAST128::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 t, l, r; - - /* Get inblock into l,r */ - Block::Get(inBlock)(r)(l); - /* Only do full 16 rounds if key length > 80 bits */ - if (!reduced) { - F1(r, l, 15, 16); - F3(l, r, 14, 16); - F2(r, l, 13, 16); - F1(l, r, 12, 16); - } - F3(r, l, 11, 16); - F2(l, r, 10, 16); - F1(r, l, 9, 16); - F3(l, r, 8, 16); - F2(r, l, 7, 16); - F1(l, r, 6, 16); - F3(r, l, 5, 16); - F2(l, r, 4, 16); - F1(r, l, 3, 16); - F3(l, r, 2, 16); - F2(r, l, 1, 16); - F1(l, r, 0, 16); - /* Put l,r into outblock */ - Block::Put(xorBlock, outBlock)(l)(r); - /* Wipe clean */ - t = l = r = 0; -} - -void CAST128::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) -{ - AssertValidKeyLength(keylength); - - reduced = (keylength <= 10); - - word32 X[4], Z[4]; - GetUserKey(BIG_ENDIAN_ORDER, X, 4, userKey, keylength); - -#define x(i) GETBYTE(X[i/4], 3-i%4) -#define z(i) GETBYTE(Z[i/4], 3-i%4) - - unsigned int i; - for (i=0; i<=16; i+=16) - { - // this part is copied directly from RFC 2144 (with some search and replace) by Wei Dai - Z[0] = X[0] ^ S[4][x(0xD)] ^ S[5][x(0xF)] ^ S[6][x(0xC)] ^ S[7][x(0xE)] ^ S[6][x(0x8)]; - Z[1] = X[2] ^ S[4][z(0x0)] ^ S[5][z(0x2)] ^ S[6][z(0x1)] ^ S[7][z(0x3)] ^ S[7][x(0xA)]; - Z[2] = X[3] ^ S[4][z(0x7)] ^ S[5][z(0x6)] ^ S[6][z(0x5)] ^ S[7][z(0x4)] ^ S[4][x(0x9)]; - Z[3] = X[1] ^ S[4][z(0xA)] ^ S[5][z(0x9)] ^ S[6][z(0xB)] ^ S[7][z(0x8)] ^ S[5][x(0xB)]; - K[i+0] = S[4][z(0x8)] ^ S[5][z(0x9)] ^ S[6][z(0x7)] ^ S[7][z(0x6)] ^ S[4][z(0x2)]; - K[i+1] = S[4][z(0xA)] ^ S[5][z(0xB)] ^ S[6][z(0x5)] ^ S[7][z(0x4)] ^ S[5][z(0x6)]; - K[i+2] = S[4][z(0xC)] ^ S[5][z(0xD)] ^ S[6][z(0x3)] ^ S[7][z(0x2)] ^ S[6][z(0x9)]; - K[i+3] = S[4][z(0xE)] ^ S[5][z(0xF)] ^ S[6][z(0x1)] ^ S[7][z(0x0)] ^ S[7][z(0xC)]; - X[0] = Z[2] ^ S[4][z(0x5)] ^ S[5][z(0x7)] ^ S[6][z(0x4)] ^ S[7][z(0x6)] ^ S[6][z(0x0)]; - X[1] = Z[0] ^ S[4][x(0x0)] ^ S[5][x(0x2)] ^ S[6][x(0x1)] ^ S[7][x(0x3)] ^ S[7][z(0x2)]; - X[2] = Z[1] ^ S[4][x(0x7)] ^ S[5][x(0x6)] ^ S[6][x(0x5)] ^ S[7][x(0x4)] ^ S[4][z(0x1)]; - X[3] = Z[3] ^ S[4][x(0xA)] ^ S[5][x(0x9)] ^ S[6][x(0xB)] ^ S[7][x(0x8)] ^ S[5][z(0x3)]; - K[i+4] = S[4][x(0x3)] ^ S[5][x(0x2)] ^ S[6][x(0xC)] ^ S[7][x(0xD)] ^ S[4][x(0x8)]; - K[i+5] = S[4][x(0x1)] ^ S[5][x(0x0)] ^ S[6][x(0xE)] ^ S[7][x(0xF)] ^ S[5][x(0xD)]; - K[i+6] = S[4][x(0x7)] ^ S[5][x(0x6)] ^ S[6][x(0x8)] ^ S[7][x(0x9)] ^ S[6][x(0x3)]; - K[i+7] = S[4][x(0x5)] ^ S[5][x(0x4)] ^ S[6][x(0xA)] ^ S[7][x(0xB)] ^ S[7][x(0x7)]; - Z[0] = X[0] ^ S[4][x(0xD)] ^ S[5][x(0xF)] ^ S[6][x(0xC)] ^ S[7][x(0xE)] ^ S[6][x(0x8)]; - Z[1] = X[2] ^ S[4][z(0x0)] ^ S[5][z(0x2)] ^ S[6][z(0x1)] ^ S[7][z(0x3)] ^ S[7][x(0xA)]; - Z[2] = X[3] ^ S[4][z(0x7)] ^ S[5][z(0x6)] ^ S[6][z(0x5)] ^ S[7][z(0x4)] ^ S[4][x(0x9)]; - Z[3] = X[1] ^ S[4][z(0xA)] ^ S[5][z(0x9)] ^ S[6][z(0xB)] ^ S[7][z(0x8)] ^ S[5][x(0xB)]; - K[i+8] = S[4][z(0x3)] ^ S[5][z(0x2)] ^ S[6][z(0xC)] ^ S[7][z(0xD)] ^ S[4][z(0x9)]; - K[i+9] = S[4][z(0x1)] ^ S[5][z(0x0)] ^ S[6][z(0xE)] ^ S[7][z(0xF)] ^ S[5][z(0xC)]; - K[i+10] = S[4][z(0x7)] ^ S[5][z(0x6)] ^ S[6][z(0x8)] ^ S[7][z(0x9)] ^ S[6][z(0x2)]; - K[i+11] = S[4][z(0x5)] ^ S[5][z(0x4)] ^ S[6][z(0xA)] ^ S[7][z(0xB)] ^ S[7][z(0x6)]; - X[0] = Z[2] ^ S[4][z(0x5)] ^ S[5][z(0x7)] ^ S[6][z(0x4)] ^ S[7][z(0x6)] ^ S[6][z(0x0)]; - X[1] = Z[0] ^ S[4][x(0x0)] ^ S[5][x(0x2)] ^ S[6][x(0x1)] ^ S[7][x(0x3)] ^ S[7][z(0x2)]; - X[2] = Z[1] ^ S[4][x(0x7)] ^ S[5][x(0x6)] ^ S[6][x(0x5)] ^ S[7][x(0x4)] ^ S[4][z(0x1)]; - X[3] = Z[3] ^ S[4][x(0xA)] ^ S[5][x(0x9)] ^ S[6][x(0xB)] ^ S[7][x(0x8)] ^ S[5][z(0x3)]; - K[i+12] = S[4][x(0x8)] ^ S[5][x(0x9)] ^ S[6][x(0x7)] ^ S[7][x(0x6)] ^ S[4][x(0x3)]; - K[i+13] = S[4][x(0xA)] ^ S[5][x(0xB)] ^ S[6][x(0x5)] ^ S[7][x(0x4)] ^ S[5][x(0x7)]; - K[i+14] = S[4][x(0xC)] ^ S[5][x(0xD)] ^ S[6][x(0x3)] ^ S[7][x(0x2)] ^ S[6][x(0x8)]; - K[i+15] = S[4][x(0xE)] ^ S[5][x(0xF)] ^ S[6][x(0x1)] ^ S[7][x(0x0)] ^ S[7][x(0xD)]; - } - - for (i=16; i<32; i++) - K[i] &= 0x1f; -} - -// The following CAST-256 implementation was contributed by Leonard Janke - -const word32 CAST256::Base::t_m[8][24]={ -{ 0x5a827999, 0xd151d6a1, 0x482133a9, 0xbef090b1, 0x35bfedb9, 0xac8f4ac1, - 0x235ea7c9, 0x9a2e04d1, 0x10fd61d9, 0x87ccbee1, 0xfe9c1be9, 0x756b78f1, - 0xec3ad5f9, 0x630a3301, 0xd9d99009, 0x50a8ed11, 0xc7784a19, 0x3e47a721, - 0xb5170429, 0x2be66131, 0xa2b5be39, 0x19851b41, 0x90547849, 0x0723d551}, -{ 0xc95c653a, 0x402bc242, 0xb6fb1f4a, 0x2dca7c52, 0xa499d95a, 0x1b693662, - 0x9238936a, 0x0907f072, 0x7fd74d7a, 0xf6a6aa82, 0x6d76078a, 0xe4456492, - 0x5b14c19a, 0xd1e41ea2, 0x48b37baa, 0xbf82d8b2, 0x365235ba, 0xad2192c2, - 0x23f0efca, 0x9ac04cd2, 0x118fa9da, 0x885f06e2, 0xff2e63ea, 0x75fdc0f2}, -{ 0x383650db, 0xaf05ade3, 0x25d50aeb, 0x9ca467f3, 0x1373c4fb, 0x8a432203, - 0x01127f0b, 0x77e1dc13, 0xeeb1391b, 0x65809623, 0xdc4ff32b, 0x531f5033, - 0xc9eead3b, 0x40be0a43, 0xb78d674b, 0x2e5cc453, 0xa52c215b, 0x1bfb7e63, - 0x92cadb6b, 0x099a3873, 0x8069957b, 0xf738f283, 0x6e084f8b, 0xe4d7ac93}, -{ 0xa7103c7c, 0x1ddf9984, 0x94aef68c, 0x0b7e5394, 0x824db09c, 0xf91d0da4, - 0x6fec6aac, 0xe6bbc7b4, 0x5d8b24bc, 0xd45a81c4, 0x4b29decc, 0xc1f93bd4, - 0x38c898dc, 0xaf97f5e4, 0x266752ec, 0x9d36aff4, 0x14060cfc, 0x8ad56a04, - 0x01a4c70c, 0x78742414, 0xef43811c, 0x6612de24, 0xdce23b2c, 0x53b19834}, -{ 0x15ea281d, 0x8cb98525, 0x0388e22d, 0x7a583f35, 0xf1279c3d, 0x67f6f945, - 0xdec6564d, 0x5595b355, 0xcc65105d, 0x43346d65, 0xba03ca6d, 0x30d32775, - 0xa7a2847d, 0x1e71e185, 0x95413e8d, 0x0c109b95, 0x82dff89d, 0xf9af55a5, - 0x707eb2ad, 0xe74e0fb5, 0x5e1d6cbd, 0xd4ecc9c5, 0x4bbc26cd, 0xc28b83d5}, -{ 0x84c413be, 0xfb9370c6, 0x7262cdce, 0xe9322ad6, 0x600187de, 0xd6d0e4e6, - 0x4da041ee, 0xc46f9ef6, 0x3b3efbfe, 0xb20e5906, 0x28ddb60e, 0x9fad1316, - 0x167c701e, 0x8d4bcd26, 0x041b2a2e, 0x7aea8736, 0xf1b9e43e, 0x68894146, - 0xdf589e4e, 0x5627fb56, 0xccf7585e, 0x43c6b566, 0xba96126e, 0x31656f76}, -{ 0xf39dff5f, 0x6a6d5c67, 0xe13cb96f, 0x580c1677, 0xcedb737f, 0x45aad087, - 0xbc7a2d8f, 0x33498a97, 0xaa18e79f, 0x20e844a7, 0x97b7a1af, 0x0e86feb7, - 0x85565bbf, 0xfc25b8c7, 0x72f515cf, 0xe9c472d7, 0x6093cfdf, 0xd7632ce7, - 0x4e3289ef, 0xc501e6f7, 0x3bd143ff, 0xb2a0a107, 0x296ffe0f, 0xa03f5b17}, -{ 0x6277eb00, 0xd9474808, 0x5016a510, 0xc6e60218, 0x3db55f20, 0xb484bc28, - 0x2b541930, 0xa2237638, 0x18f2d340, 0x8fc23048, 0x06918d50, 0x7d60ea58, - 0xf4304760, 0x6affa468, 0xe1cf0170, 0x589e5e78, 0xcf6dbb80, 0x463d1888, - 0xbd0c7590, 0x33dbd298, 0xaaab2fa0, 0x217a8ca8, 0x9849e9b0, 0x0f1946b8} -}; - -const unsigned int CAST256::Base::t_r[8][24]={ - {19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11, 19, 27, 3, 11}, - {4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28, 4, 12, 20, 28}, - {21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13, 21, 29, 5, 13}, - {6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30, 6, 14, 22, 30}, - {23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15, 23, 31, 7, 15}, - {8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0, 8, 16, 24, 0}, - {25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17, 25, 1, 9, 17}, - {10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2, 10, 18, 26, 2} -}; - -#define Q(i) \ - F1(block[2],block[3],8*i+4,-4); \ - F2(block[1],block[2],8*i+5,-4); \ - F3(block[0],block[1],8*i+6,-4); \ - F1(block[3],block[0],8*i+7,-4); - -#define QBar(i) \ - F1(block[3],block[0],8*i+7,-4); \ - F3(block[0],block[1],8*i+6,-4); \ - F2(block[1],block[2],8*i+5,-4); \ - F1(block[2],block[3],8*i+4,-4); - -/* CAST256's encrypt/decrypt functions are identical except for the order that -the keys are used */ - -void CAST256::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 t, block[4]; - Block::Get(inBlock)(block[0])(block[1])(block[2])(block[3]); - - // Perform 6 forward quad rounds - Q(0); - Q(1); - Q(2); - Q(3); - Q(4); - Q(5); - - // Perform 6 reverse quad rounds - QBar(6); - QBar(7); - QBar(8); - QBar(9); - QBar(10); - QBar(11); - - Block::Put(xorBlock, outBlock)(block[0])(block[1])(block[2])(block[3]); -} - -/* Set up a CAST-256 key */ - -void CAST256::Base::Omega(int i, word32 kappa[8]) -{ - word32 t; - - f1(kappa[6],kappa[7],t_m[0][i],t_r[0][i]); - f2(kappa[5],kappa[6],t_m[1][i],t_r[1][i]); - f3(kappa[4],kappa[5],t_m[2][i],t_r[2][i]); - f1(kappa[3],kappa[4],t_m[3][i],t_r[3][i]); - f2(kappa[2],kappa[3],t_m[4][i],t_r[4][i]); - f3(kappa[1],kappa[2],t_m[5][i],t_r[5][i]); - f1(kappa[0],kappa[1],t_m[6][i],t_r[6][i]); - f2(kappa[7],kappa[0],t_m[7][i],t_r[7][i]); -} - -void CAST256::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) -{ - AssertValidKeyLength(keylength); - - word32 kappa[8]; - GetUserKey(BIG_ENDIAN_ORDER, kappa, 8, userKey, keylength); - - for(int i=0; i<12; ++i) - { - Omega(2*i,kappa); - Omega(2*i+1,kappa); - - K[8*i]=kappa[0] & 31; - K[8*i+1]=kappa[2] & 31; - K[8*i+2]=kappa[4] & 31; - K[8*i+3]=kappa[6] & 31; - K[8*i+4]=kappa[7]; - K[8*i+5]=kappa[5]; - K[8*i+6]=kappa[3]; - K[8*i+7]=kappa[1]; - } - - if (!IsForwardTransformation()) - { - for(int j=0; j<6; ++j) - { - for(int i=0; i<4; ++i) - { - int i1=8*j+i; - int i2=8*(11-j)+i; - - assert(i1, public VariableKeyLength<16, 5, 16> -{ - static const char *StaticAlgorithmName() {return "CAST-128";} -}; - -/// CAST-128 -class CAST128 : public CAST128_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - bool reduced; - FixedSizeSecBlock K; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -//! algorithm info -struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32> -{ - static const char *StaticAlgorithmName() {return "CAST-256";} -}; - -//! CAST-256 -class CAST256 : public CAST256_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - protected: - static const word32 t_m[8][24]; - static const unsigned int t_r[8][24]; - - static void Omega(int i, word32 kappa[8]); - - FixedSizeSecBlock K; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef CAST128::Encryption CAST128Encryption; -typedef CAST128::Decryption CAST128Decryption; - -typedef CAST256::Encryption CAST256Encryption; -typedef CAST256::Decryption CAST256Decryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/casts.cpp b/external/crypto++-5.6.3/casts.cpp deleted file mode 100644 index 16fa2b13f..000000000 --- a/external/crypto++-5.6.3/casts.cpp +++ /dev/null @@ -1,545 +0,0 @@ -#include "pch.h" -#include "cast.h" - -NAMESPACE_BEGIN(CryptoPP) - -// CAST S-boxes - -const word32 CAST::S[8][256] = { -{ - 0x30FB40D4UL, 0x9FA0FF0BUL, 0x6BECCD2FUL, 0x3F258C7AUL, - 0x1E213F2FUL, 0x9C004DD3UL, 0x6003E540UL, 0xCF9FC949UL, - 0xBFD4AF27UL, 0x88BBBDB5UL, 0xE2034090UL, 0x98D09675UL, - 0x6E63A0E0UL, 0x15C361D2UL, 0xC2E7661DUL, 0x22D4FF8EUL, - 0x28683B6FUL, 0xC07FD059UL, 0xFF2379C8UL, 0x775F50E2UL, - 0x43C340D3UL, 0xDF2F8656UL, 0x887CA41AUL, 0xA2D2BD2DUL, - 0xA1C9E0D6UL, 0x346C4819UL, 0x61B76D87UL, 0x22540F2FUL, - 0x2ABE32E1UL, 0xAA54166BUL, 0x22568E3AUL, 0xA2D341D0UL, - 0x66DB40C8UL, 0xA784392FUL, 0x004DFF2FUL, 0x2DB9D2DEUL, - 0x97943FACUL, 0x4A97C1D8UL, 0x527644B7UL, 0xB5F437A7UL, - 0xB82CBAEFUL, 0xD751D159UL, 0x6FF7F0EDUL, 0x5A097A1FUL, - 0x827B68D0UL, 0x90ECF52EUL, 0x22B0C054UL, 0xBC8E5935UL, - 0x4B6D2F7FUL, 0x50BB64A2UL, 0xD2664910UL, 0xBEE5812DUL, - 0xB7332290UL, 0xE93B159FUL, 0xB48EE411UL, 0x4BFF345DUL, - 0xFD45C240UL, 0xAD31973FUL, 0xC4F6D02EUL, 0x55FC8165UL, - 0xD5B1CAADUL, 0xA1AC2DAEUL, 0xA2D4B76DUL, 0xC19B0C50UL, - 0x882240F2UL, 0x0C6E4F38UL, 0xA4E4BFD7UL, 0x4F5BA272UL, - 0x564C1D2FUL, 0xC59C5319UL, 0xB949E354UL, 0xB04669FEUL, - 0xB1B6AB8AUL, 0xC71358DDUL, 0x6385C545UL, 0x110F935DUL, - 0x57538AD5UL, 0x6A390493UL, 0xE63D37E0UL, 0x2A54F6B3UL, - 0x3A787D5FUL, 0x6276A0B5UL, 0x19A6FCDFUL, 0x7A42206AUL, - 0x29F9D4D5UL, 0xF61B1891UL, 0xBB72275EUL, 0xAA508167UL, - 0x38901091UL, 0xC6B505EBUL, 0x84C7CB8CUL, 0x2AD75A0FUL, - 0x874A1427UL, 0xA2D1936BUL, 0x2AD286AFUL, 0xAA56D291UL, - 0xD7894360UL, 0x425C750DUL, 0x93B39E26UL, 0x187184C9UL, - 0x6C00B32DUL, 0x73E2BB14UL, 0xA0BEBC3CUL, 0x54623779UL, - 0x64459EABUL, 0x3F328B82UL, 0x7718CF82UL, 0x59A2CEA6UL, - 0x04EE002EUL, 0x89FE78E6UL, 0x3FAB0950UL, 0x325FF6C2UL, - 0x81383F05UL, 0x6963C5C8UL, 0x76CB5AD6UL, 0xD49974C9UL, - 0xCA180DCFUL, 0x380782D5UL, 0xC7FA5CF6UL, 0x8AC31511UL, - 0x35E79E13UL, 0x47DA91D0UL, 0xF40F9086UL, 0xA7E2419EUL, - 0x31366241UL, 0x051EF495UL, 0xAA573B04UL, 0x4A805D8DUL, - 0x548300D0UL, 0x00322A3CUL, 0xBF64CDDFUL, 0xBA57A68EUL, - 0x75C6372BUL, 0x50AFD341UL, 0xA7C13275UL, 0x915A0BF5UL, - 0x6B54BFABUL, 0x2B0B1426UL, 0xAB4CC9D7UL, 0x449CCD82UL, - 0xF7FBF265UL, 0xAB85C5F3UL, 0x1B55DB94UL, 0xAAD4E324UL, - 0xCFA4BD3FUL, 0x2DEAA3E2UL, 0x9E204D02UL, 0xC8BD25ACUL, - 0xEADF55B3UL, 0xD5BD9E98UL, 0xE31231B2UL, 0x2AD5AD6CUL, - 0x954329DEUL, 0xADBE4528UL, 0xD8710F69UL, 0xAA51C90FUL, - 0xAA786BF6UL, 0x22513F1EUL, 0xAA51A79BUL, 0x2AD344CCUL, - 0x7B5A41F0UL, 0xD37CFBADUL, 0x1B069505UL, 0x41ECE491UL, - 0xB4C332E6UL, 0x032268D4UL, 0xC9600ACCUL, 0xCE387E6DUL, - 0xBF6BB16CUL, 0x6A70FB78UL, 0x0D03D9C9UL, 0xD4DF39DEUL, - 0xE01063DAUL, 0x4736F464UL, 0x5AD328D8UL, 0xB347CC96UL, - 0x75BB0FC3UL, 0x98511BFBUL, 0x4FFBCC35UL, 0xB58BCF6AUL, - 0xE11F0ABCUL, 0xBFC5FE4AUL, 0xA70AEC10UL, 0xAC39570AUL, - 0x3F04442FUL, 0x6188B153UL, 0xE0397A2EUL, 0x5727CB79UL, - 0x9CEB418FUL, 0x1CACD68DUL, 0x2AD37C96UL, 0x0175CB9DUL, - 0xC69DFF09UL, 0xC75B65F0UL, 0xD9DB40D8UL, 0xEC0E7779UL, - 0x4744EAD4UL, 0xB11C3274UL, 0xDD24CB9EUL, 0x7E1C54BDUL, - 0xF01144F9UL, 0xD2240EB1UL, 0x9675B3FDUL, 0xA3AC3755UL, - 0xD47C27AFUL, 0x51C85F4DUL, 0x56907596UL, 0xA5BB15E6UL, - 0x580304F0UL, 0xCA042CF1UL, 0x011A37EAUL, 0x8DBFAADBUL, - 0x35BA3E4AUL, 0x3526FFA0UL, 0xC37B4D09UL, 0xBC306ED9UL, - 0x98A52666UL, 0x5648F725UL, 0xFF5E569DUL, 0x0CED63D0UL, - 0x7C63B2CFUL, 0x700B45E1UL, 0xD5EA50F1UL, 0x85A92872UL, - 0xAF1FBDA7UL, 0xD4234870UL, 0xA7870BF3UL, 0x2D3B4D79UL, - 0x42E04198UL, 0x0CD0EDE7UL, 0x26470DB8UL, 0xF881814CUL, - 0x474D6AD7UL, 0x7C0C5E5CUL, 0xD1231959UL, 0x381B7298UL, - 0xF5D2F4DBUL, 0xAB838653UL, 0x6E2F1E23UL, 0x83719C9EUL, - 0xBD91E046UL, 0x9A56456EUL, 0xDC39200CUL, 0x20C8C571UL, - 0x962BDA1CUL, 0xE1E696FFUL, 0xB141AB08UL, 0x7CCA89B9UL, - 0x1A69E783UL, 0x02CC4843UL, 0xA2F7C579UL, 0x429EF47DUL, - 0x427B169CUL, 0x5AC9F049UL, 0xDD8F0F00UL, 0x5C8165BFUL -}, - -{ - 0x1F201094UL, 0xEF0BA75BUL, 0x69E3CF7EUL, 0x393F4380UL, - 0xFE61CF7AUL, 0xEEC5207AUL, 0x55889C94UL, 0x72FC0651UL, - 0xADA7EF79UL, 0x4E1D7235UL, 0xD55A63CEUL, 0xDE0436BAUL, - 0x99C430EFUL, 0x5F0C0794UL, 0x18DCDB7DUL, 0xA1D6EFF3UL, - 0xA0B52F7BUL, 0x59E83605UL, 0xEE15B094UL, 0xE9FFD909UL, - 0xDC440086UL, 0xEF944459UL, 0xBA83CCB3UL, 0xE0C3CDFBUL, - 0xD1DA4181UL, 0x3B092AB1UL, 0xF997F1C1UL, 0xA5E6CF7BUL, - 0x01420DDBUL, 0xE4E7EF5BUL, 0x25A1FF41UL, 0xE180F806UL, - 0x1FC41080UL, 0x179BEE7AUL, 0xD37AC6A9UL, 0xFE5830A4UL, - 0x98DE8B7FUL, 0x77E83F4EUL, 0x79929269UL, 0x24FA9F7BUL, - 0xE113C85BUL, 0xACC40083UL, 0xD7503525UL, 0xF7EA615FUL, - 0x62143154UL, 0x0D554B63UL, 0x5D681121UL, 0xC866C359UL, - 0x3D63CF73UL, 0xCEE234C0UL, 0xD4D87E87UL, 0x5C672B21UL, - 0x071F6181UL, 0x39F7627FUL, 0x361E3084UL, 0xE4EB573BUL, - 0x602F64A4UL, 0xD63ACD9CUL, 0x1BBC4635UL, 0x9E81032DUL, - 0x2701F50CUL, 0x99847AB4UL, 0xA0E3DF79UL, 0xBA6CF38CUL, - 0x10843094UL, 0x2537A95EUL, 0xF46F6FFEUL, 0xA1FF3B1FUL, - 0x208CFB6AUL, 0x8F458C74UL, 0xD9E0A227UL, 0x4EC73A34UL, - 0xFC884F69UL, 0x3E4DE8DFUL, 0xEF0E0088UL, 0x3559648DUL, - 0x8A45388CUL, 0x1D804366UL, 0x721D9BFDUL, 0xA58684BBUL, - 0xE8256333UL, 0x844E8212UL, 0x128D8098UL, 0xFED33FB4UL, - 0xCE280AE1UL, 0x27E19BA5UL, 0xD5A6C252UL, 0xE49754BDUL, - 0xC5D655DDUL, 0xEB667064UL, 0x77840B4DUL, 0xA1B6A801UL, - 0x84DB26A9UL, 0xE0B56714UL, 0x21F043B7UL, 0xE5D05860UL, - 0x54F03084UL, 0x066FF472UL, 0xA31AA153UL, 0xDADC4755UL, - 0xB5625DBFUL, 0x68561BE6UL, 0x83CA6B94UL, 0x2D6ED23BUL, - 0xECCF01DBUL, 0xA6D3D0BAUL, 0xB6803D5CUL, 0xAF77A709UL, - 0x33B4A34CUL, 0x397BC8D6UL, 0x5EE22B95UL, 0x5F0E5304UL, - 0x81ED6F61UL, 0x20E74364UL, 0xB45E1378UL, 0xDE18639BUL, - 0x881CA122UL, 0xB96726D1UL, 0x8049A7E8UL, 0x22B7DA7BUL, - 0x5E552D25UL, 0x5272D237UL, 0x79D2951CUL, 0xC60D894CUL, - 0x488CB402UL, 0x1BA4FE5BUL, 0xA4B09F6BUL, 0x1CA815CFUL, - 0xA20C3005UL, 0x8871DF63UL, 0xB9DE2FCBUL, 0x0CC6C9E9UL, - 0x0BEEFF53UL, 0xE3214517UL, 0xB4542835UL, 0x9F63293CUL, - 0xEE41E729UL, 0x6E1D2D7CUL, 0x50045286UL, 0x1E6685F3UL, - 0xF33401C6UL, 0x30A22C95UL, 0x31A70850UL, 0x60930F13UL, - 0x73F98417UL, 0xA1269859UL, 0xEC645C44UL, 0x52C877A9UL, - 0xCDFF33A6UL, 0xA02B1741UL, 0x7CBAD9A2UL, 0x2180036FUL, - 0x50D99C08UL, 0xCB3F4861UL, 0xC26BD765UL, 0x64A3F6ABUL, - 0x80342676UL, 0x25A75E7BUL, 0xE4E6D1FCUL, 0x20C710E6UL, - 0xCDF0B680UL, 0x17844D3BUL, 0x31EEF84DUL, 0x7E0824E4UL, - 0x2CCB49EBUL, 0x846A3BAEUL, 0x8FF77888UL, 0xEE5D60F6UL, - 0x7AF75673UL, 0x2FDD5CDBUL, 0xA11631C1UL, 0x30F66F43UL, - 0xB3FAEC54UL, 0x157FD7FAUL, 0xEF8579CCUL, 0xD152DE58UL, - 0xDB2FFD5EUL, 0x8F32CE19UL, 0x306AF97AUL, 0x02F03EF8UL, - 0x99319AD5UL, 0xC242FA0FUL, 0xA7E3EBB0UL, 0xC68E4906UL, - 0xB8DA230CUL, 0x80823028UL, 0xDCDEF3C8UL, 0xD35FB171UL, - 0x088A1BC8UL, 0xBEC0C560UL, 0x61A3C9E8UL, 0xBCA8F54DUL, - 0xC72FEFFAUL, 0x22822E99UL, 0x82C570B4UL, 0xD8D94E89UL, - 0x8B1C34BCUL, 0x301E16E6UL, 0x273BE979UL, 0xB0FFEAA6UL, - 0x61D9B8C6UL, 0x00B24869UL, 0xB7FFCE3FUL, 0x08DC283BUL, - 0x43DAF65AUL, 0xF7E19798UL, 0x7619B72FUL, 0x8F1C9BA4UL, - 0xDC8637A0UL, 0x16A7D3B1UL, 0x9FC393B7UL, 0xA7136EEBUL, - 0xC6BCC63EUL, 0x1A513742UL, 0xEF6828BCUL, 0x520365D6UL, - 0x2D6A77ABUL, 0x3527ED4BUL, 0x821FD216UL, 0x095C6E2EUL, - 0xDB92F2FBUL, 0x5EEA29CBUL, 0x145892F5UL, 0x91584F7FUL, - 0x5483697BUL, 0x2667A8CCUL, 0x85196048UL, 0x8C4BACEAUL, - 0x833860D4UL, 0x0D23E0F9UL, 0x6C387E8AUL, 0x0AE6D249UL, - 0xB284600CUL, 0xD835731DUL, 0xDCB1C647UL, 0xAC4C56EAUL, - 0x3EBD81B3UL, 0x230EABB0UL, 0x6438BC87UL, 0xF0B5B1FAUL, - 0x8F5EA2B3UL, 0xFC184642UL, 0x0A036B7AUL, 0x4FB089BDUL, - 0x649DA589UL, 0xA345415EUL, 0x5C038323UL, 0x3E5D3BB9UL, - 0x43D79572UL, 0x7E6DD07CUL, 0x06DFDF1EUL, 0x6C6CC4EFUL, - 0x7160A539UL, 0x73BFBE70UL, 0x83877605UL, 0x4523ECF1UL -}, - -{ - 0x8DEFC240UL, 0x25FA5D9FUL, 0xEB903DBFUL, 0xE810C907UL, - 0x47607FFFUL, 0x369FE44BUL, 0x8C1FC644UL, 0xAECECA90UL, - 0xBEB1F9BFUL, 0xEEFBCAEAUL, 0xE8CF1950UL, 0x51DF07AEUL, - 0x920E8806UL, 0xF0AD0548UL, 0xE13C8D83UL, 0x927010D5UL, - 0x11107D9FUL, 0x07647DB9UL, 0xB2E3E4D4UL, 0x3D4F285EUL, - 0xB9AFA820UL, 0xFADE82E0UL, 0xA067268BUL, 0x8272792EUL, - 0x553FB2C0UL, 0x489AE22BUL, 0xD4EF9794UL, 0x125E3FBCUL, - 0x21FFFCEEUL, 0x825B1BFDUL, 0x9255C5EDUL, 0x1257A240UL, - 0x4E1A8302UL, 0xBAE07FFFUL, 0x528246E7UL, 0x8E57140EUL, - 0x3373F7BFUL, 0x8C9F8188UL, 0xA6FC4EE8UL, 0xC982B5A5UL, - 0xA8C01DB7UL, 0x579FC264UL, 0x67094F31UL, 0xF2BD3F5FUL, - 0x40FFF7C1UL, 0x1FB78DFCUL, 0x8E6BD2C1UL, 0x437BE59BUL, - 0x99B03DBFUL, 0xB5DBC64BUL, 0x638DC0E6UL, 0x55819D99UL, - 0xA197C81CUL, 0x4A012D6EUL, 0xC5884A28UL, 0xCCC36F71UL, - 0xB843C213UL, 0x6C0743F1UL, 0x8309893CUL, 0x0FEDDD5FUL, - 0x2F7FE850UL, 0xD7C07F7EUL, 0x02507FBFUL, 0x5AFB9A04UL, - 0xA747D2D0UL, 0x1651192EUL, 0xAF70BF3EUL, 0x58C31380UL, - 0x5F98302EUL, 0x727CC3C4UL, 0x0A0FB402UL, 0x0F7FEF82UL, - 0x8C96FDADUL, 0x5D2C2AAEUL, 0x8EE99A49UL, 0x50DA88B8UL, - 0x8427F4A0UL, 0x1EAC5790UL, 0x796FB449UL, 0x8252DC15UL, - 0xEFBD7D9BUL, 0xA672597DUL, 0xADA840D8UL, 0x45F54504UL, - 0xFA5D7403UL, 0xE83EC305UL, 0x4F91751AUL, 0x925669C2UL, - 0x23EFE941UL, 0xA903F12EUL, 0x60270DF2UL, 0x0276E4B6UL, - 0x94FD6574UL, 0x927985B2UL, 0x8276DBCBUL, 0x02778176UL, - 0xF8AF918DUL, 0x4E48F79EUL, 0x8F616DDFUL, 0xE29D840EUL, - 0x842F7D83UL, 0x340CE5C8UL, 0x96BBB682UL, 0x93B4B148UL, - 0xEF303CABUL, 0x984FAF28UL, 0x779FAF9BUL, 0x92DC560DUL, - 0x224D1E20UL, 0x8437AA88UL, 0x7D29DC96UL, 0x2756D3DCUL, - 0x8B907CEEUL, 0xB51FD240UL, 0xE7C07CE3UL, 0xE566B4A1UL, - 0xC3E9615EUL, 0x3CF8209DUL, 0x6094D1E3UL, 0xCD9CA341UL, - 0x5C76460EUL, 0x00EA983BUL, 0xD4D67881UL, 0xFD47572CUL, - 0xF76CEDD9UL, 0xBDA8229CUL, 0x127DADAAUL, 0x438A074EUL, - 0x1F97C090UL, 0x081BDB8AUL, 0x93A07EBEUL, 0xB938CA15UL, - 0x97B03CFFUL, 0x3DC2C0F8UL, 0x8D1AB2ECUL, 0x64380E51UL, - 0x68CC7BFBUL, 0xD90F2788UL, 0x12490181UL, 0x5DE5FFD4UL, - 0xDD7EF86AUL, 0x76A2E214UL, 0xB9A40368UL, 0x925D958FUL, - 0x4B39FFFAUL, 0xBA39AEE9UL, 0xA4FFD30BUL, 0xFAF7933BUL, - 0x6D498623UL, 0x193CBCFAUL, 0x27627545UL, 0x825CF47AUL, - 0x61BD8BA0UL, 0xD11E42D1UL, 0xCEAD04F4UL, 0x127EA392UL, - 0x10428DB7UL, 0x8272A972UL, 0x9270C4A8UL, 0x127DE50BUL, - 0x285BA1C8UL, 0x3C62F44FUL, 0x35C0EAA5UL, 0xE805D231UL, - 0x428929FBUL, 0xB4FCDF82UL, 0x4FB66A53UL, 0x0E7DC15BUL, - 0x1F081FABUL, 0x108618AEUL, 0xFCFD086DUL, 0xF9FF2889UL, - 0x694BCC11UL, 0x236A5CAEUL, 0x12DECA4DUL, 0x2C3F8CC5UL, - 0xD2D02DFEUL, 0xF8EF5896UL, 0xE4CF52DAUL, 0x95155B67UL, - 0x494A488CUL, 0xB9B6A80CUL, 0x5C8F82BCUL, 0x89D36B45UL, - 0x3A609437UL, 0xEC00C9A9UL, 0x44715253UL, 0x0A874B49UL, - 0xD773BC40UL, 0x7C34671CUL, 0x02717EF6UL, 0x4FEB5536UL, - 0xA2D02FFFUL, 0xD2BF60C4UL, 0xD43F03C0UL, 0x50B4EF6DUL, - 0x07478CD1UL, 0x006E1888UL, 0xA2E53F55UL, 0xB9E6D4BCUL, - 0xA2048016UL, 0x97573833UL, 0xD7207D67UL, 0xDE0F8F3DUL, - 0x72F87B33UL, 0xABCC4F33UL, 0x7688C55DUL, 0x7B00A6B0UL, - 0x947B0001UL, 0x570075D2UL, 0xF9BB88F8UL, 0x8942019EUL, - 0x4264A5FFUL, 0x856302E0UL, 0x72DBD92BUL, 0xEE971B69UL, - 0x6EA22FDEUL, 0x5F08AE2BUL, 0xAF7A616DUL, 0xE5C98767UL, - 0xCF1FEBD2UL, 0x61EFC8C2UL, 0xF1AC2571UL, 0xCC8239C2UL, - 0x67214CB8UL, 0xB1E583D1UL, 0xB7DC3E62UL, 0x7F10BDCEUL, - 0xF90A5C38UL, 0x0FF0443DUL, 0x606E6DC6UL, 0x60543A49UL, - 0x5727C148UL, 0x2BE98A1DUL, 0x8AB41738UL, 0x20E1BE24UL, - 0xAF96DA0FUL, 0x68458425UL, 0x99833BE5UL, 0x600D457DUL, - 0x282F9350UL, 0x8334B362UL, 0xD91D1120UL, 0x2B6D8DA0UL, - 0x642B1E31UL, 0x9C305A00UL, 0x52BCE688UL, 0x1B03588AUL, - 0xF7BAEFD5UL, 0x4142ED9CUL, 0xA4315C11UL, 0x83323EC5UL, - 0xDFEF4636UL, 0xA133C501UL, 0xE9D3531CUL, 0xEE353783UL -}, - -{ - 0x9DB30420UL, 0x1FB6E9DEUL, 0xA7BE7BEFUL, 0xD273A298UL, - 0x4A4F7BDBUL, 0x64AD8C57UL, 0x85510443UL, 0xFA020ED1UL, - 0x7E287AFFUL, 0xE60FB663UL, 0x095F35A1UL, 0x79EBF120UL, - 0xFD059D43UL, 0x6497B7B1UL, 0xF3641F63UL, 0x241E4ADFUL, - 0x28147F5FUL, 0x4FA2B8CDUL, 0xC9430040UL, 0x0CC32220UL, - 0xFDD30B30UL, 0xC0A5374FUL, 0x1D2D00D9UL, 0x24147B15UL, - 0xEE4D111AUL, 0x0FCA5167UL, 0x71FF904CUL, 0x2D195FFEUL, - 0x1A05645FUL, 0x0C13FEFEUL, 0x081B08CAUL, 0x05170121UL, - 0x80530100UL, 0xE83E5EFEUL, 0xAC9AF4F8UL, 0x7FE72701UL, - 0xD2B8EE5FUL, 0x06DF4261UL, 0xBB9E9B8AUL, 0x7293EA25UL, - 0xCE84FFDFUL, 0xF5718801UL, 0x3DD64B04UL, 0xA26F263BUL, - 0x7ED48400UL, 0x547EEBE6UL, 0x446D4CA0UL, 0x6CF3D6F5UL, - 0x2649ABDFUL, 0xAEA0C7F5UL, 0x36338CC1UL, 0x503F7E93UL, - 0xD3772061UL, 0x11B638E1UL, 0x72500E03UL, 0xF80EB2BBUL, - 0xABE0502EUL, 0xEC8D77DEUL, 0x57971E81UL, 0xE14F6746UL, - 0xC9335400UL, 0x6920318FUL, 0x081DBB99UL, 0xFFC304A5UL, - 0x4D351805UL, 0x7F3D5CE3UL, 0xA6C866C6UL, 0x5D5BCCA9UL, - 0xDAEC6FEAUL, 0x9F926F91UL, 0x9F46222FUL, 0x3991467DUL, - 0xA5BF6D8EUL, 0x1143C44FUL, 0x43958302UL, 0xD0214EEBUL, - 0x022083B8UL, 0x3FB6180CUL, 0x18F8931EUL, 0x281658E6UL, - 0x26486E3EUL, 0x8BD78A70UL, 0x7477E4C1UL, 0xB506E07CUL, - 0xF32D0A25UL, 0x79098B02UL, 0xE4EABB81UL, 0x28123B23UL, - 0x69DEAD38UL, 0x1574CA16UL, 0xDF871B62UL, 0x211C40B7UL, - 0xA51A9EF9UL, 0x0014377BUL, 0x041E8AC8UL, 0x09114003UL, - 0xBD59E4D2UL, 0xE3D156D5UL, 0x4FE876D5UL, 0x2F91A340UL, - 0x557BE8DEUL, 0x00EAE4A7UL, 0x0CE5C2ECUL, 0x4DB4BBA6UL, - 0xE756BDFFUL, 0xDD3369ACUL, 0xEC17B035UL, 0x06572327UL, - 0x99AFC8B0UL, 0x56C8C391UL, 0x6B65811CUL, 0x5E146119UL, - 0x6E85CB75UL, 0xBE07C002UL, 0xC2325577UL, 0x893FF4ECUL, - 0x5BBFC92DUL, 0xD0EC3B25UL, 0xB7801AB7UL, 0x8D6D3B24UL, - 0x20C763EFUL, 0xC366A5FCUL, 0x9C382880UL, 0x0ACE3205UL, - 0xAAC9548AUL, 0xECA1D7C7UL, 0x041AFA32UL, 0x1D16625AUL, - 0x6701902CUL, 0x9B757A54UL, 0x31D477F7UL, 0x9126B031UL, - 0x36CC6FDBUL, 0xC70B8B46UL, 0xD9E66A48UL, 0x56E55A79UL, - 0x026A4CEBUL, 0x52437EFFUL, 0x2F8F76B4UL, 0x0DF980A5UL, - 0x8674CDE3UL, 0xEDDA04EBUL, 0x17A9BE04UL, 0x2C18F4DFUL, - 0xB7747F9DUL, 0xAB2AF7B4UL, 0xEFC34D20UL, 0x2E096B7CUL, - 0x1741A254UL, 0xE5B6A035UL, 0x213D42F6UL, 0x2C1C7C26UL, - 0x61C2F50FUL, 0x6552DAF9UL, 0xD2C231F8UL, 0x25130F69UL, - 0xD8167FA2UL, 0x0418F2C8UL, 0x001A96A6UL, 0x0D1526ABUL, - 0x63315C21UL, 0x5E0A72ECUL, 0x49BAFEFDUL, 0x187908D9UL, - 0x8D0DBD86UL, 0x311170A7UL, 0x3E9B640CUL, 0xCC3E10D7UL, - 0xD5CAD3B6UL, 0x0CAEC388UL, 0xF73001E1UL, 0x6C728AFFUL, - 0x71EAE2A1UL, 0x1F9AF36EUL, 0xCFCBD12FUL, 0xC1DE8417UL, - 0xAC07BE6BUL, 0xCB44A1D8UL, 0x8B9B0F56UL, 0x013988C3UL, - 0xB1C52FCAUL, 0xB4BE31CDUL, 0xD8782806UL, 0x12A3A4E2UL, - 0x6F7DE532UL, 0x58FD7EB6UL, 0xD01EE900UL, 0x24ADFFC2UL, - 0xF4990FC5UL, 0x9711AAC5UL, 0x001D7B95UL, 0x82E5E7D2UL, - 0x109873F6UL, 0x00613096UL, 0xC32D9521UL, 0xADA121FFUL, - 0x29908415UL, 0x7FBB977FUL, 0xAF9EB3DBUL, 0x29C9ED2AUL, - 0x5CE2A465UL, 0xA730F32CUL, 0xD0AA3FE8UL, 0x8A5CC091UL, - 0xD49E2CE7UL, 0x0CE454A9UL, 0xD60ACD86UL, 0x015F1919UL, - 0x77079103UL, 0xDEA03AF6UL, 0x78A8565EUL, 0xDEE356DFUL, - 0x21F05CBEUL, 0x8B75E387UL, 0xB3C50651UL, 0xB8A5C3EFUL, - 0xD8EEB6D2UL, 0xE523BE77UL, 0xC2154529UL, 0x2F69EFDFUL, - 0xAFE67AFBUL, 0xF470C4B2UL, 0xF3E0EB5BUL, 0xD6CC9876UL, - 0x39E4460CUL, 0x1FDA8538UL, 0x1987832FUL, 0xCA007367UL, - 0xA99144F8UL, 0x296B299EUL, 0x492FC295UL, 0x9266BEABUL, - 0xB5676E69UL, 0x9BD3DDDAUL, 0xDF7E052FUL, 0xDB25701CUL, - 0x1B5E51EEUL, 0xF65324E6UL, 0x6AFCE36CUL, 0x0316CC04UL, - 0x8644213EUL, 0xB7DC59D0UL, 0x7965291FUL, 0xCCD6FD43UL, - 0x41823979UL, 0x932BCDF6UL, 0xB657C34DUL, 0x4EDFD282UL, - 0x7AE5290CUL, 0x3CB9536BUL, 0x851E20FEUL, 0x9833557EUL, - 0x13ECF0B0UL, 0xD3FFB372UL, 0x3F85C5C1UL, 0x0AEF7ED2UL -}, - -{ - 0x7EC90C04UL, 0x2C6E74B9UL, 0x9B0E66DFUL, 0xA6337911UL, - 0xB86A7FFFUL, 0x1DD358F5UL, 0x44DD9D44UL, 0x1731167FUL, - 0x08FBF1FAUL, 0xE7F511CCUL, 0xD2051B00UL, 0x735ABA00UL, - 0x2AB722D8UL, 0x386381CBUL, 0xACF6243AUL, 0x69BEFD7AUL, - 0xE6A2E77FUL, 0xF0C720CDUL, 0xC4494816UL, 0xCCF5C180UL, - 0x38851640UL, 0x15B0A848UL, 0xE68B18CBUL, 0x4CAADEFFUL, - 0x5F480A01UL, 0x0412B2AAUL, 0x259814FCUL, 0x41D0EFE2UL, - 0x4E40B48DUL, 0x248EB6FBUL, 0x8DBA1CFEUL, 0x41A99B02UL, - 0x1A550A04UL, 0xBA8F65CBUL, 0x7251F4E7UL, 0x95A51725UL, - 0xC106ECD7UL, 0x97A5980AUL, 0xC539B9AAUL, 0x4D79FE6AUL, - 0xF2F3F763UL, 0x68AF8040UL, 0xED0C9E56UL, 0x11B4958BUL, - 0xE1EB5A88UL, 0x8709E6B0UL, 0xD7E07156UL, 0x4E29FEA7UL, - 0x6366E52DUL, 0x02D1C000UL, 0xC4AC8E05UL, 0x9377F571UL, - 0x0C05372AUL, 0x578535F2UL, 0x2261BE02UL, 0xD642A0C9UL, - 0xDF13A280UL, 0x74B55BD2UL, 0x682199C0UL, 0xD421E5ECUL, - 0x53FB3CE8UL, 0xC8ADEDB3UL, 0x28A87FC9UL, 0x3D959981UL, - 0x5C1FF900UL, 0xFE38D399UL, 0x0C4EFF0BUL, 0x062407EAUL, - 0xAA2F4FB1UL, 0x4FB96976UL, 0x90C79505UL, 0xB0A8A774UL, - 0xEF55A1FFUL, 0xE59CA2C2UL, 0xA6B62D27UL, 0xE66A4263UL, - 0xDF65001FUL, 0x0EC50966UL, 0xDFDD55BCUL, 0x29DE0655UL, - 0x911E739AUL, 0x17AF8975UL, 0x32C7911CUL, 0x89F89468UL, - 0x0D01E980UL, 0x524755F4UL, 0x03B63CC9UL, 0x0CC844B2UL, - 0xBCF3F0AAUL, 0x87AC36E9UL, 0xE53A7426UL, 0x01B3D82BUL, - 0x1A9E7449UL, 0x64EE2D7EUL, 0xCDDBB1DAUL, 0x01C94910UL, - 0xB868BF80UL, 0x0D26F3FDUL, 0x9342EDE7UL, 0x04A5C284UL, - 0x636737B6UL, 0x50F5B616UL, 0xF24766E3UL, 0x8ECA36C1UL, - 0x136E05DBUL, 0xFEF18391UL, 0xFB887A37UL, 0xD6E7F7D4UL, - 0xC7FB7DC9UL, 0x3063FCDFUL, 0xB6F589DEUL, 0xEC2941DAUL, - 0x26E46695UL, 0xB7566419UL, 0xF654EFC5UL, 0xD08D58B7UL, - 0x48925401UL, 0xC1BACB7FUL, 0xE5FF550FUL, 0xB6083049UL, - 0x5BB5D0E8UL, 0x87D72E5AUL, 0xAB6A6EE1UL, 0x223A66CEUL, - 0xC62BF3CDUL, 0x9E0885F9UL, 0x68CB3E47UL, 0x086C010FUL, - 0xA21DE820UL, 0xD18B69DEUL, 0xF3F65777UL, 0xFA02C3F6UL, - 0x407EDAC3UL, 0xCBB3D550UL, 0x1793084DUL, 0xB0D70EBAUL, - 0x0AB378D5UL, 0xD951FB0CUL, 0xDED7DA56UL, 0x4124BBE4UL, - 0x94CA0B56UL, 0x0F5755D1UL, 0xE0E1E56EUL, 0x6184B5BEUL, - 0x580A249FUL, 0x94F74BC0UL, 0xE327888EUL, 0x9F7B5561UL, - 0xC3DC0280UL, 0x05687715UL, 0x646C6BD7UL, 0x44904DB3UL, - 0x66B4F0A3UL, 0xC0F1648AUL, 0x697ED5AFUL, 0x49E92FF6UL, - 0x309E374FUL, 0x2CB6356AUL, 0x85808573UL, 0x4991F840UL, - 0x76F0AE02UL, 0x083BE84DUL, 0x28421C9AUL, 0x44489406UL, - 0x736E4CB8UL, 0xC1092910UL, 0x8BC95FC6UL, 0x7D869CF4UL, - 0x134F616FUL, 0x2E77118DUL, 0xB31B2BE1UL, 0xAA90B472UL, - 0x3CA5D717UL, 0x7D161BBAUL, 0x9CAD9010UL, 0xAF462BA2UL, - 0x9FE459D2UL, 0x45D34559UL, 0xD9F2DA13UL, 0xDBC65487UL, - 0xF3E4F94EUL, 0x176D486FUL, 0x097C13EAUL, 0x631DA5C7UL, - 0x445F7382UL, 0x175683F4UL, 0xCDC66A97UL, 0x70BE0288UL, - 0xB3CDCF72UL, 0x6E5DD2F3UL, 0x20936079UL, 0x459B80A5UL, - 0xBE60E2DBUL, 0xA9C23101UL, 0xEBA5315CUL, 0x224E42F2UL, - 0x1C5C1572UL, 0xF6721B2CUL, 0x1AD2FFF3UL, 0x8C25404EUL, - 0x324ED72FUL, 0x4067B7FDUL, 0x0523138EUL, 0x5CA3BC78UL, - 0xDC0FD66EUL, 0x75922283UL, 0x784D6B17UL, 0x58EBB16EUL, - 0x44094F85UL, 0x3F481D87UL, 0xFCFEAE7BUL, 0x77B5FF76UL, - 0x8C2302BFUL, 0xAAF47556UL, 0x5F46B02AUL, 0x2B092801UL, - 0x3D38F5F7UL, 0x0CA81F36UL, 0x52AF4A8AUL, 0x66D5E7C0UL, - 0xDF3B0874UL, 0x95055110UL, 0x1B5AD7A8UL, 0xF61ED5ADUL, - 0x6CF6E479UL, 0x20758184UL, 0xD0CEFA65UL, 0x88F7BE58UL, - 0x4A046826UL, 0x0FF6F8F3UL, 0xA09C7F70UL, 0x5346ABA0UL, - 0x5CE96C28UL, 0xE176EDA3UL, 0x6BAC307FUL, 0x376829D2UL, - 0x85360FA9UL, 0x17E3FE2AUL, 0x24B79767UL, 0xF5A96B20UL, - 0xD6CD2595UL, 0x68FF1EBFUL, 0x7555442CUL, 0xF19F06BEUL, - 0xF9E0659AUL, 0xEEB9491DUL, 0x34010718UL, 0xBB30CAB8UL, - 0xE822FE15UL, 0x88570983UL, 0x750E6249UL, 0xDA627E55UL, - 0x5E76FFA8UL, 0xB1534546UL, 0x6D47DE08UL, 0xEFE9E7D4UL -}, - -{ - 0xF6FA8F9DUL, 0x2CAC6CE1UL, 0x4CA34867UL, 0xE2337F7CUL, - 0x95DB08E7UL, 0x016843B4UL, 0xECED5CBCUL, 0x325553ACUL, - 0xBF9F0960UL, 0xDFA1E2EDUL, 0x83F0579DUL, 0x63ED86B9UL, - 0x1AB6A6B8UL, 0xDE5EBE39UL, 0xF38FF732UL, 0x8989B138UL, - 0x33F14961UL, 0xC01937BDUL, 0xF506C6DAUL, 0xE4625E7EUL, - 0xA308EA99UL, 0x4E23E33CUL, 0x79CBD7CCUL, 0x48A14367UL, - 0xA3149619UL, 0xFEC94BD5UL, 0xA114174AUL, 0xEAA01866UL, - 0xA084DB2DUL, 0x09A8486FUL, 0xA888614AUL, 0x2900AF98UL, - 0x01665991UL, 0xE1992863UL, 0xC8F30C60UL, 0x2E78EF3CUL, - 0xD0D51932UL, 0xCF0FEC14UL, 0xF7CA07D2UL, 0xD0A82072UL, - 0xFD41197EUL, 0x9305A6B0UL, 0xE86BE3DAUL, 0x74BED3CDUL, - 0x372DA53CUL, 0x4C7F4448UL, 0xDAB5D440UL, 0x6DBA0EC3UL, - 0x083919A7UL, 0x9FBAEED9UL, 0x49DBCFB0UL, 0x4E670C53UL, - 0x5C3D9C01UL, 0x64BDB941UL, 0x2C0E636AUL, 0xBA7DD9CDUL, - 0xEA6F7388UL, 0xE70BC762UL, 0x35F29ADBUL, 0x5C4CDD8DUL, - 0xF0D48D8CUL, 0xB88153E2UL, 0x08A19866UL, 0x1AE2EAC8UL, - 0x284CAF89UL, 0xAA928223UL, 0x9334BE53UL, 0x3B3A21BFUL, - 0x16434BE3UL, 0x9AEA3906UL, 0xEFE8C36EUL, 0xF890CDD9UL, - 0x80226DAEUL, 0xC340A4A3UL, 0xDF7E9C09UL, 0xA694A807UL, - 0x5B7C5ECCUL, 0x221DB3A6UL, 0x9A69A02FUL, 0x68818A54UL, - 0xCEB2296FUL, 0x53C0843AUL, 0xFE893655UL, 0x25BFE68AUL, - 0xB4628ABCUL, 0xCF222EBFUL, 0x25AC6F48UL, 0xA9A99387UL, - 0x53BDDB65UL, 0xE76FFBE7UL, 0xE967FD78UL, 0x0BA93563UL, - 0x8E342BC1UL, 0xE8A11BE9UL, 0x4980740DUL, 0xC8087DFCUL, - 0x8DE4BF99UL, 0xA11101A0UL, 0x7FD37975UL, 0xDA5A26C0UL, - 0xE81F994FUL, 0x9528CD89UL, 0xFD339FEDUL, 0xB87834BFUL, - 0x5F04456DUL, 0x22258698UL, 0xC9C4C83BUL, 0x2DC156BEUL, - 0x4F628DAAUL, 0x57F55EC5UL, 0xE2220ABEUL, 0xD2916EBFUL, - 0x4EC75B95UL, 0x24F2C3C0UL, 0x42D15D99UL, 0xCD0D7FA0UL, - 0x7B6E27FFUL, 0xA8DC8AF0UL, 0x7345C106UL, 0xF41E232FUL, - 0x35162386UL, 0xE6EA8926UL, 0x3333B094UL, 0x157EC6F2UL, - 0x372B74AFUL, 0x692573E4UL, 0xE9A9D848UL, 0xF3160289UL, - 0x3A62EF1DUL, 0xA787E238UL, 0xF3A5F676UL, 0x74364853UL, - 0x20951063UL, 0x4576698DUL, 0xB6FAD407UL, 0x592AF950UL, - 0x36F73523UL, 0x4CFB6E87UL, 0x7DA4CEC0UL, 0x6C152DAAUL, - 0xCB0396A8UL, 0xC50DFE5DUL, 0xFCD707ABUL, 0x0921C42FUL, - 0x89DFF0BBUL, 0x5FE2BE78UL, 0x448F4F33UL, 0x754613C9UL, - 0x2B05D08DUL, 0x48B9D585UL, 0xDC049441UL, 0xC8098F9BUL, - 0x7DEDE786UL, 0xC39A3373UL, 0x42410005UL, 0x6A091751UL, - 0x0EF3C8A6UL, 0x890072D6UL, 0x28207682UL, 0xA9A9F7BEUL, - 0xBF32679DUL, 0xD45B5B75UL, 0xB353FD00UL, 0xCBB0E358UL, - 0x830F220AUL, 0x1F8FB214UL, 0xD372CF08UL, 0xCC3C4A13UL, - 0x8CF63166UL, 0x061C87BEUL, 0x88C98F88UL, 0x6062E397UL, - 0x47CF8E7AUL, 0xB6C85283UL, 0x3CC2ACFBUL, 0x3FC06976UL, - 0x4E8F0252UL, 0x64D8314DUL, 0xDA3870E3UL, 0x1E665459UL, - 0xC10908F0UL, 0x513021A5UL, 0x6C5B68B7UL, 0x822F8AA0UL, - 0x3007CD3EUL, 0x74719EEFUL, 0xDC872681UL, 0x073340D4UL, - 0x7E432FD9UL, 0x0C5EC241UL, 0x8809286CUL, 0xF592D891UL, - 0x08A930F6UL, 0x957EF305UL, 0xB7FBFFBDUL, 0xC266E96FUL, - 0x6FE4AC98UL, 0xB173ECC0UL, 0xBC60B42AUL, 0x953498DAUL, - 0xFBA1AE12UL, 0x2D4BD736UL, 0x0F25FAABUL, 0xA4F3FCEBUL, - 0xE2969123UL, 0x257F0C3DUL, 0x9348AF49UL, 0x361400BCUL, - 0xE8816F4AUL, 0x3814F200UL, 0xA3F94043UL, 0x9C7A54C2UL, - 0xBC704F57UL, 0xDA41E7F9UL, 0xC25AD33AUL, 0x54F4A084UL, - 0xB17F5505UL, 0x59357CBEUL, 0xEDBD15C8UL, 0x7F97C5ABUL, - 0xBA5AC7B5UL, 0xB6F6DEAFUL, 0x3A479C3AUL, 0x5302DA25UL, - 0x653D7E6AUL, 0x54268D49UL, 0x51A477EAUL, 0x5017D55BUL, - 0xD7D25D88UL, 0x44136C76UL, 0x0404A8C8UL, 0xB8E5A121UL, - 0xB81A928AUL, 0x60ED5869UL, 0x97C55B96UL, 0xEAEC991BUL, - 0x29935913UL, 0x01FDB7F1UL, 0x088E8DFAUL, 0x9AB6F6F5UL, - 0x3B4CBF9FUL, 0x4A5DE3ABUL, 0xE6051D35UL, 0xA0E1D855UL, - 0xD36B4CF1UL, 0xF544EDEBUL, 0xB0E93524UL, 0xBEBB8FBDUL, - 0xA2D762CFUL, 0x49C92F54UL, 0x38B5F331UL, 0x7128A454UL, - 0x48392905UL, 0xA65B1DB8UL, 0x851C97BDUL, 0xD675CF2FUL -}, - -{ - 0x85E04019UL, 0x332BF567UL, 0x662DBFFFUL, 0xCFC65693UL, - 0x2A8D7F6FUL, 0xAB9BC912UL, 0xDE6008A1UL, 0x2028DA1FUL, - 0x0227BCE7UL, 0x4D642916UL, 0x18FAC300UL, 0x50F18B82UL, - 0x2CB2CB11UL, 0xB232E75CUL, 0x4B3695F2UL, 0xB28707DEUL, - 0xA05FBCF6UL, 0xCD4181E9UL, 0xE150210CUL, 0xE24EF1BDUL, - 0xB168C381UL, 0xFDE4E789UL, 0x5C79B0D8UL, 0x1E8BFD43UL, - 0x4D495001UL, 0x38BE4341UL, 0x913CEE1DUL, 0x92A79C3FUL, - 0x089766BEUL, 0xBAEEADF4UL, 0x1286BECFUL, 0xB6EACB19UL, - 0x2660C200UL, 0x7565BDE4UL, 0x64241F7AUL, 0x8248DCA9UL, - 0xC3B3AD66UL, 0x28136086UL, 0x0BD8DFA8UL, 0x356D1CF2UL, - 0x107789BEUL, 0xB3B2E9CEUL, 0x0502AA8FUL, 0x0BC0351EUL, - 0x166BF52AUL, 0xEB12FF82UL, 0xE3486911UL, 0xD34D7516UL, - 0x4E7B3AFFUL, 0x5F43671BUL, 0x9CF6E037UL, 0x4981AC83UL, - 0x334266CEUL, 0x8C9341B7UL, 0xD0D854C0UL, 0xCB3A6C88UL, - 0x47BC2829UL, 0x4725BA37UL, 0xA66AD22BUL, 0x7AD61F1EUL, - 0x0C5CBAFAUL, 0x4437F107UL, 0xB6E79962UL, 0x42D2D816UL, - 0x0A961288UL, 0xE1A5C06EUL, 0x13749E67UL, 0x72FC081AUL, - 0xB1D139F7UL, 0xF9583745UL, 0xCF19DF58UL, 0xBEC3F756UL, - 0xC06EBA30UL, 0x07211B24UL, 0x45C28829UL, 0xC95E317FUL, - 0xBC8EC511UL, 0x38BC46E9UL, 0xC6E6FA14UL, 0xBAE8584AUL, - 0xAD4EBC46UL, 0x468F508BUL, 0x7829435FUL, 0xF124183BUL, - 0x821DBA9FUL, 0xAFF60FF4UL, 0xEA2C4E6DUL, 0x16E39264UL, - 0x92544A8BUL, 0x009B4FC3UL, 0xABA68CEDUL, 0x9AC96F78UL, - 0x06A5B79AUL, 0xB2856E6EUL, 0x1AEC3CA9UL, 0xBE838688UL, - 0x0E0804E9UL, 0x55F1BE56UL, 0xE7E5363BUL, 0xB3A1F25DUL, - 0xF7DEBB85UL, 0x61FE033CUL, 0x16746233UL, 0x3C034C28UL, - 0xDA6D0C74UL, 0x79AAC56CUL, 0x3CE4E1ADUL, 0x51F0C802UL, - 0x98F8F35AUL, 0x1626A49FUL, 0xEED82B29UL, 0x1D382FE3UL, - 0x0C4FB99AUL, 0xBB325778UL, 0x3EC6D97BUL, 0x6E77A6A9UL, - 0xCB658B5CUL, 0xD45230C7UL, 0x2BD1408BUL, 0x60C03EB7UL, - 0xB9068D78UL, 0xA33754F4UL, 0xF430C87DUL, 0xC8A71302UL, - 0xB96D8C32UL, 0xEBD4E7BEUL, 0xBE8B9D2DUL, 0x7979FB06UL, - 0xE7225308UL, 0x8B75CF77UL, 0x11EF8DA4UL, 0xE083C858UL, - 0x8D6B786FUL, 0x5A6317A6UL, 0xFA5CF7A0UL, 0x5DDA0033UL, - 0xF28EBFB0UL, 0xF5B9C310UL, 0xA0EAC280UL, 0x08B9767AUL, - 0xA3D9D2B0UL, 0x79D34217UL, 0x021A718DUL, 0x9AC6336AUL, - 0x2711FD60UL, 0x438050E3UL, 0x069908A8UL, 0x3D7FEDC4UL, - 0x826D2BEFUL, 0x4EEB8476UL, 0x488DCF25UL, 0x36C9D566UL, - 0x28E74E41UL, 0xC2610ACAUL, 0x3D49A9CFUL, 0xBAE3B9DFUL, - 0xB65F8DE6UL, 0x92AEAF64UL, 0x3AC7D5E6UL, 0x9EA80509UL, - 0xF22B017DUL, 0xA4173F70UL, 0xDD1E16C3UL, 0x15E0D7F9UL, - 0x50B1B887UL, 0x2B9F4FD5UL, 0x625ABA82UL, 0x6A017962UL, - 0x2EC01B9CUL, 0x15488AA9UL, 0xD716E740UL, 0x40055A2CUL, - 0x93D29A22UL, 0xE32DBF9AUL, 0x058745B9UL, 0x3453DC1EUL, - 0xD699296EUL, 0x496CFF6FUL, 0x1C9F4986UL, 0xDFE2ED07UL, - 0xB87242D1UL, 0x19DE7EAEUL, 0x053E561AUL, 0x15AD6F8CUL, - 0x66626C1CUL, 0x7154C24CUL, 0xEA082B2AUL, 0x93EB2939UL, - 0x17DCB0F0UL, 0x58D4F2AEUL, 0x9EA294FBUL, 0x52CF564CUL, - 0x9883FE66UL, 0x2EC40581UL, 0x763953C3UL, 0x01D6692EUL, - 0xD3A0C108UL, 0xA1E7160EUL, 0xE4F2DFA6UL, 0x693ED285UL, - 0x74904698UL, 0x4C2B0EDDUL, 0x4F757656UL, 0x5D393378UL, - 0xA132234FUL, 0x3D321C5DUL, 0xC3F5E194UL, 0x4B269301UL, - 0xC79F022FUL, 0x3C997E7EUL, 0x5E4F9504UL, 0x3FFAFBBDUL, - 0x76F7AD0EUL, 0x296693F4UL, 0x3D1FCE6FUL, 0xC61E45BEUL, - 0xD3B5AB34UL, 0xF72BF9B7UL, 0x1B0434C0UL, 0x4E72B567UL, - 0x5592A33DUL, 0xB5229301UL, 0xCFD2A87FUL, 0x60AEB767UL, - 0x1814386BUL, 0x30BCC33DUL, 0x38A0C07DUL, 0xFD1606F2UL, - 0xC363519BUL, 0x589DD390UL, 0x5479F8E6UL, 0x1CB8D647UL, - 0x97FD61A9UL, 0xEA7759F4UL, 0x2D57539DUL, 0x569A58CFUL, - 0xE84E63ADUL, 0x462E1B78UL, 0x6580F87EUL, 0xF3817914UL, - 0x91DA55F4UL, 0x40A230F3UL, 0xD1988F35UL, 0xB6E318D2UL, - 0x3FFA50BCUL, 0x3D40F021UL, 0xC3C0BDAEUL, 0x4958C24CUL, - 0x518F36B2UL, 0x84B1D370UL, 0x0FEDCE83UL, 0x878DDADAUL, - 0xF2A279C7UL, 0x94E01BE8UL, 0x90716F4BUL, 0x954B8AA3UL -}, - -{ - 0xE216300DUL, 0xBBDDFFFCUL, 0xA7EBDABDUL, 0x35648095UL, - 0x7789F8B7UL, 0xE6C1121BUL, 0x0E241600UL, 0x052CE8B5UL, - 0x11A9CFB0UL, 0xE5952F11UL, 0xECE7990AUL, 0x9386D174UL, - 0x2A42931CUL, 0x76E38111UL, 0xB12DEF3AUL, 0x37DDDDFCUL, - 0xDE9ADEB1UL, 0x0A0CC32CUL, 0xBE197029UL, 0x84A00940UL, - 0xBB243A0FUL, 0xB4D137CFUL, 0xB44E79F0UL, 0x049EEDFDUL, - 0x0B15A15DUL, 0x480D3168UL, 0x8BBBDE5AUL, 0x669DED42UL, - 0xC7ECE831UL, 0x3F8F95E7UL, 0x72DF191BUL, 0x7580330DUL, - 0x94074251UL, 0x5C7DCDFAUL, 0xABBE6D63UL, 0xAA402164UL, - 0xB301D40AUL, 0x02E7D1CAUL, 0x53571DAEUL, 0x7A3182A2UL, - 0x12A8DDECUL, 0xFDAA335DUL, 0x176F43E8UL, 0x71FB46D4UL, - 0x38129022UL, 0xCE949AD4UL, 0xB84769ADUL, 0x965BD862UL, - 0x82F3D055UL, 0x66FB9767UL, 0x15B80B4EUL, 0x1D5B47A0UL, - 0x4CFDE06FUL, 0xC28EC4B8UL, 0x57E8726EUL, 0x647A78FCUL, - 0x99865D44UL, 0x608BD593UL, 0x6C200E03UL, 0x39DC5FF6UL, - 0x5D0B00A3UL, 0xAE63AFF2UL, 0x7E8BD632UL, 0x70108C0CUL, - 0xBBD35049UL, 0x2998DF04UL, 0x980CF42AUL, 0x9B6DF491UL, - 0x9E7EDD53UL, 0x06918548UL, 0x58CB7E07UL, 0x3B74EF2EUL, - 0x522FFFB1UL, 0xD24708CCUL, 0x1C7E27CDUL, 0xA4EB215BUL, - 0x3CF1D2E2UL, 0x19B47A38UL, 0x424F7618UL, 0x35856039UL, - 0x9D17DEE7UL, 0x27EB35E6UL, 0xC9AFF67BUL, 0x36BAF5B8UL, - 0x09C467CDUL, 0xC18910B1UL, 0xE11DBF7BUL, 0x06CD1AF8UL, - 0x7170C608UL, 0x2D5E3354UL, 0xD4DE495AUL, 0x64C6D006UL, - 0xBCC0C62CUL, 0x3DD00DB3UL, 0x708F8F34UL, 0x77D51B42UL, - 0x264F620FUL, 0x24B8D2BFUL, 0x15C1B79EUL, 0x46A52564UL, - 0xF8D7E54EUL, 0x3E378160UL, 0x7895CDA5UL, 0x859C15A5UL, - 0xE6459788UL, 0xC37BC75FUL, 0xDB07BA0CUL, 0x0676A3ABUL, - 0x7F229B1EUL, 0x31842E7BUL, 0x24259FD7UL, 0xF8BEF472UL, - 0x835FFCB8UL, 0x6DF4C1F2UL, 0x96F5B195UL, 0xFD0AF0FCUL, - 0xB0FE134CUL, 0xE2506D3DUL, 0x4F9B12EAUL, 0xF215F225UL, - 0xA223736FUL, 0x9FB4C428UL, 0x25D04979UL, 0x34C713F8UL, - 0xC4618187UL, 0xEA7A6E98UL, 0x7CD16EFCUL, 0x1436876CUL, - 0xF1544107UL, 0xBEDEEE14UL, 0x56E9AF27UL, 0xA04AA441UL, - 0x3CF7C899UL, 0x92ECBAE6UL, 0xDD67016DUL, 0x151682EBUL, - 0xA842EEDFUL, 0xFDBA60B4UL, 0xF1907B75UL, 0x20E3030FUL, - 0x24D8C29EUL, 0xE139673BUL, 0xEFA63FB8UL, 0x71873054UL, - 0xB6F2CF3BUL, 0x9F326442UL, 0xCB15A4CCUL, 0xB01A4504UL, - 0xF1E47D8DUL, 0x844A1BE5UL, 0xBAE7DFDCUL, 0x42CBDA70UL, - 0xCD7DAE0AUL, 0x57E85B7AUL, 0xD53F5AF6UL, 0x20CF4D8CUL, - 0xCEA4D428UL, 0x79D130A4UL, 0x3486EBFBUL, 0x33D3CDDCUL, - 0x77853B53UL, 0x37EFFCB5UL, 0xC5068778UL, 0xE580B3E6UL, - 0x4E68B8F4UL, 0xC5C8B37EUL, 0x0D809EA2UL, 0x398FEB7CUL, - 0x132A4F94UL, 0x43B7950EUL, 0x2FEE7D1CUL, 0x223613BDUL, - 0xDD06CAA2UL, 0x37DF932BUL, 0xC4248289UL, 0xACF3EBC3UL, - 0x5715F6B7UL, 0xEF3478DDUL, 0xF267616FUL, 0xC148CBE4UL, - 0x9052815EUL, 0x5E410FABUL, 0xB48A2465UL, 0x2EDA7FA4UL, - 0xE87B40E4UL, 0xE98EA084UL, 0x5889E9E1UL, 0xEFD390FCUL, - 0xDD07D35BUL, 0xDB485694UL, 0x38D7E5B2UL, 0x57720101UL, - 0x730EDEBCUL, 0x5B643113UL, 0x94917E4FUL, 0x503C2FBAUL, - 0x646F1282UL, 0x7523D24AUL, 0xE0779695UL, 0xF9C17A8FUL, - 0x7A5B2121UL, 0xD187B896UL, 0x29263A4DUL, 0xBA510CDFUL, - 0x81F47C9FUL, 0xAD1163EDUL, 0xEA7B5965UL, 0x1A00726EUL, - 0x11403092UL, 0x00DA6D77UL, 0x4A0CDD61UL, 0xAD1F4603UL, - 0x605BDFB0UL, 0x9EEDC364UL, 0x22EBE6A8UL, 0xCEE7D28AUL, - 0xA0E736A0UL, 0x5564A6B9UL, 0x10853209UL, 0xC7EB8F37UL, - 0x2DE705CAUL, 0x8951570FUL, 0xDF09822BUL, 0xBD691A6CUL, - 0xAA12E4F2UL, 0x87451C0FUL, 0xE0F6A27AUL, 0x3ADA4819UL, - 0x4CF1764FUL, 0x0D771C2BUL, 0x67CDB156UL, 0x350D8384UL, - 0x5938FA0FUL, 0x42399EF3UL, 0x36997B07UL, 0x0E84093DUL, - 0x4AA93E61UL, 0x8360D87BUL, 0x1FA98B0CUL, 0x1149382CUL, - 0xE97625A5UL, 0x0614D1B7UL, 0x0E25244BUL, 0x0C768347UL, - 0x589E8D82UL, 0x0D2059D1UL, 0xA466BB1EUL, 0xF8DA0A82UL, - 0x04F19130UL, 0xBA6E4EC0UL, 0x99265164UL, 0x1EE7230DUL, - 0x50B2AD80UL, 0xEAEE6801UL, 0x8DB2A283UL, 0xEA8BF59EUL -}}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/cbcmac.cpp b/external/crypto++-5.6.3/cbcmac.cpp deleted file mode 100644 index 6b0e8858e..000000000 --- a/external/crypto++-5.6.3/cbcmac.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "cbcmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -void CBC_MAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) -{ - AccessCipher().SetKey(key, length, params); - m_reg.CleanNew(AccessCipher().BlockSize()); - m_counter = 0; -} - -void CBC_MAC_Base::Update(const byte *input, size_t length) -{ - unsigned int blockSize = AccessCipher().BlockSize(); - - while (m_counter && length) - { - m_reg[m_counter++] ^= *input++; - if (m_counter == blockSize) - ProcessBuf(); - length--; - } - - if (length >= blockSize) - { - size_t leftOver = AccessCipher().AdvancedProcessBlocks(m_reg, input, m_reg, length, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); - input += (length - leftOver); - length = leftOver; - } - - while (length--) - { - m_reg[m_counter++] ^= *input++; - if (m_counter == blockSize) - ProcessBuf(); - } -} - -void CBC_MAC_Base::TruncatedFinal(byte *mac, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - if (m_counter) - ProcessBuf(); - - memcpy(mac, m_reg, size); - memset(m_reg, 0, AccessCipher().BlockSize()); -} - -void CBC_MAC_Base::ProcessBuf() -{ - AccessCipher().ProcessBlock(m_reg); - m_counter = 0; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/cbcmac.h b/external/crypto++-5.6.3/cbcmac.h deleted file mode 100644 index 38c75b727..000000000 --- a/external/crypto++-5.6.3/cbcmac.h +++ /dev/null @@ -1,56 +0,0 @@ -// cbcmac.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile cbcmac.h -//! \brief Classes for CBC MAC - -#ifndef CRYPTOPP_CBCMAC_H -#define CRYPTOPP_CBCMAC_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_MAC_Base : public MessageAuthenticationCode -{ -public: - CBC_MAC_Base() : m_counter(0) {} - - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *mac, size_t size); - unsigned int DigestSize() const {return const_cast(this)->AccessCipher().BlockSize();} - -protected: - virtual BlockCipher & AccessCipher() =0; - -private: - void ProcessBuf(); - SecByteBlock m_reg; - unsigned int m_counter; -}; - -//! CBC-MAC -/*! Compatible with FIPS 113. T should be a class derived from BlockCipherDocumentation. - Secure only for fixed length messages. For variable length messages use CMAC or DMAC. -*/ -template -class CBC_MAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs -{ -public: - CBC_MAC() {} - CBC_MAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH) - {this->SetKey(key, length);} - - static std::string StaticAlgorithmName() {return std::string("CBC-MAC(") + T::StaticAlgorithmName() + ")";} - -private: - BlockCipher & AccessCipher() {return m_cipher;} - typename T::Encryption m_cipher; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ccm.cpp b/external/crypto++-5.6.3/ccm.cpp deleted file mode 100644 index b3d3b7c5d..000000000 --- a/external/crypto++-5.6.3/ccm.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// ccm.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "ccm.h" - -NAMESPACE_BEGIN(CryptoPP) - -void CCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) -{ - BlockCipher &blockCipher = AccessBlockCipher(); - - blockCipher.SetKey(userKey, keylength, params); - - if (blockCipher.BlockSize() != REQUIRED_BLOCKSIZE) - throw InvalidArgument(AlgorithmName() + ": block size of underlying block cipher is not 16"); - - m_digestSize = params.GetIntValueWithDefault(Name::DigestSize(), DefaultDigestSize()); - if (m_digestSize % 2 > 0 || m_digestSize < 4 || m_digestSize > 16) - throw InvalidArgument(AlgorithmName() + ": DigestSize must be 4, 6, 8, 10, 12, 14, or 16"); - - m_buffer.Grow(2*REQUIRED_BLOCKSIZE); - m_L = 8; -} - -void CCM_Base::Resync(const byte *iv, size_t len) -{ - BlockCipher &cipher = AccessBlockCipher(); - - m_L = REQUIRED_BLOCKSIZE-1-(int)len; - assert(m_L >= 2); - if (m_L > 8) - m_L = 8; - - m_buffer[0] = byte(m_L-1); // flag - memcpy(m_buffer+1, iv, len); - memset(m_buffer+1+len, 0, REQUIRED_BLOCKSIZE-1-len); - - if (m_state >= State_IVSet) - m_ctr.Resynchronize(m_buffer, REQUIRED_BLOCKSIZE); - else - m_ctr.SetCipherWithIV(cipher, m_buffer); - - m_ctr.Seek(REQUIRED_BLOCKSIZE); - m_aadLength = 0; - m_messageLength = 0; -} - -void CCM_Base::UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword /*footerLength*/) -{ - if (m_state != State_IVSet) - throw BadState(AlgorithmName(), "SpecifyDataLengths", "or after State_IVSet"); - - m_aadLength = headerLength; - m_messageLength = messageLength; - - byte *cbcBuffer = CBC_Buffer(); - const BlockCipher &cipher = GetBlockCipher(); - - cbcBuffer[0] = byte(64*(headerLength>0) + 8*((m_digestSize-2)/2) + (m_L-1)); // flag - PutWord(true, BIG_ENDIAN_ORDER, cbcBuffer+REQUIRED_BLOCKSIZE-8, m_messageLength); - memcpy(cbcBuffer+1, m_buffer+1, REQUIRED_BLOCKSIZE-1-m_L); - cipher.ProcessBlock(cbcBuffer); - - if (headerLength>0) - { - assert(m_bufferedDataLength == 0); - - if (headerLength < ((1<<16) - (1<<8))) - { - PutWord(true, BIG_ENDIAN_ORDER, m_buffer, (word16)headerLength); - m_bufferedDataLength = 2; - } - else if (headerLength < (W64LIT(1)<<32)) - { - m_buffer[0] = 0xff; - m_buffer[1] = 0xfe; - PutWord(false, BIG_ENDIAN_ORDER, m_buffer+2, (word32)headerLength); - m_bufferedDataLength = 6; - } - else - { - m_buffer[0] = 0xff; - m_buffer[1] = 0xff; - PutWord(false, BIG_ENDIAN_ORDER, m_buffer+2, headerLength); - m_bufferedDataLength = 10; - } - } -} - -size_t CCM_Base::AuthenticateBlocks(const byte *data, size_t len) -{ - byte *cbcBuffer = CBC_Buffer(); - const BlockCipher &cipher = GetBlockCipher(); - return cipher.AdvancedProcessBlocks(cbcBuffer, data, cbcBuffer, len, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); -} - -void CCM_Base::AuthenticateLastHeaderBlock() -{ - byte *cbcBuffer = CBC_Buffer(); - const BlockCipher &cipher = GetBlockCipher(); - - if (m_aadLength != m_totalHeaderLength) - throw InvalidArgument(AlgorithmName() + ": header length doesn't match that given in SpecifyDataLengths"); - - if (m_bufferedDataLength > 0) - { - xorbuf(cbcBuffer, m_buffer, m_bufferedDataLength); - cipher.ProcessBlock(cbcBuffer); - m_bufferedDataLength = 0; - } -} - -void CCM_Base::AuthenticateLastConfidentialBlock() -{ - byte *cbcBuffer = CBC_Buffer(); - const BlockCipher &cipher = GetBlockCipher(); - - if (m_messageLength != m_totalMessageLength) - throw InvalidArgument(AlgorithmName() + ": message length doesn't match that given in SpecifyDataLengths"); - - if (m_bufferedDataLength > 0) - { - xorbuf(cbcBuffer, m_buffer, m_bufferedDataLength); - cipher.ProcessBlock(cbcBuffer); - m_bufferedDataLength = 0; - } -} - -void CCM_Base::AuthenticateLastFooterBlock(byte *mac, size_t macSize) -{ - m_ctr.Seek(0); - m_ctr.ProcessData(mac, CBC_Buffer(), macSize); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ccm.h b/external/crypto++-5.6.3/ccm.h deleted file mode 100644 index d90c3b02f..000000000 --- a/external/crypto++-5.6.3/ccm.h +++ /dev/null @@ -1,106 +0,0 @@ -// ccm.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile ccm.h -//! \brief CCM block cipher mode of operation - -#ifndef CRYPTOPP_CCM_H -#define CRYPTOPP_CCM_H - -#include "authenc.h" -#include "modes.h" - -NAMESPACE_BEGIN(CryptoPP) - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CCM_Base : public AuthenticatedSymmetricCipherBase -{ -public: - CCM_Base() - : m_digestSize(0), m_L(0), m_messageLength(0), m_aadLength(0) {} - - // AuthenticatedSymmetricCipher - std::string AlgorithmName() const - {return GetBlockCipher().AlgorithmName() + std::string("/CCM");} - size_t MinKeyLength() const - {return GetBlockCipher().MinKeyLength();} - size_t MaxKeyLength() const - {return GetBlockCipher().MaxKeyLength();} - size_t DefaultKeyLength() const - {return GetBlockCipher().DefaultKeyLength();} - size_t GetValidKeyLength(size_t n) const - {return GetBlockCipher().GetValidKeyLength(n);} - bool IsValidKeyLength(size_t n) const - {return GetBlockCipher().IsValidKeyLength(n);} - unsigned int OptimalDataAlignment() const - {return GetBlockCipher().OptimalDataAlignment();} - IV_Requirement IVRequirement() const - {return UNIQUE_IV;} - unsigned int IVSize() const - {return 8;} - unsigned int MinIVLength() const - {return 7;} - unsigned int MaxIVLength() const - {return 13;} - unsigned int DigestSize() const - {return m_digestSize;} - lword MaxHeaderLength() const - {return W64LIT(0)-1;} - lword MaxMessageLength() const - {return m_L<8 ? (W64LIT(1)<<(8*m_L))-1 : W64LIT(0)-1;} - bool NeedsPrespecifiedDataLengths() const - {return true;} - void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength); - -protected: - // AuthenticatedSymmetricCipherBase - bool AuthenticationIsOnPlaintext() const - {return true;} - unsigned int AuthenticationBlockSize() const - {return GetBlockCipher().BlockSize();} - void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); - void Resync(const byte *iv, size_t len); - size_t AuthenticateBlocks(const byte *data, size_t len); - void AuthenticateLastHeaderBlock(); - void AuthenticateLastConfidentialBlock(); - void AuthenticateLastFooterBlock(byte *mac, size_t macSize); - SymmetricCipher & AccessSymmetricCipher() {return m_ctr;} - - virtual BlockCipher & AccessBlockCipher() =0; - virtual int DefaultDigestSize() const =0; - - const BlockCipher & GetBlockCipher() const {return const_cast(this)->AccessBlockCipher();}; - byte *CBC_Buffer() {return m_buffer+REQUIRED_BLOCKSIZE;} - - enum {REQUIRED_BLOCKSIZE = 16}; - int m_digestSize, m_L; - word64 m_messageLength, m_aadLength; - CTR_Mode_ExternalCipher::Encryption m_ctr; -}; - -template -class CCM_Final : public CCM_Base -{ -public: - static std::string StaticAlgorithmName() - {return T_BlockCipher::StaticAlgorithmName() + std::string("/CCM");} - bool IsForwardTransformation() const - {return T_IsEncryption;} - -private: - BlockCipher & AccessBlockCipher() {return m_cipher;} - int DefaultDigestSize() const {return T_DefaultDigestSize;} - typename T_BlockCipher::Encryption m_cipher; -}; - -/// CCM -//! \brief CCM mode of operation -template -struct CCM : public AuthenticatedSymmetricCipherDocumentation -{ - typedef CCM_Final Encryption; - typedef CCM_Final Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/channels.cpp b/external/crypto++-5.6.3/channels.cpp deleted file mode 100644 index a17068d97..000000000 --- a/external/crypto++-5.6.3/channels.cpp +++ /dev/null @@ -1,312 +0,0 @@ -// channels.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "cryptlib.h" -#include "channels.h" - -NAMESPACE_BEGIN(CryptoPP) -USING_NAMESPACE(std) - -#if 0 -void MessageSwitch::AddDefaultRoute(BufferedTransformation &destination, const std::string &channel) -{ - m_defaultRoutes.push_back(Route(&destination, channel)); -} - -void MessageSwitch::AddRoute(unsigned int begin, unsigned int end, BufferedTransformation &destination, const std::string &channel) -{ - RangeRoute route(begin, end, Route(&destination, channel)); - RouteList::iterator it = upper_bound(m_routes.begin(), m_routes.end(), route); - m_routes.insert(it, route); -} - -/* -class MessageRouteIterator -{ -public: - typedef MessageSwitch::RouteList::const_iterator RouteIterator; - typedef MessageSwitch::DefaultRouteList::const_iterator DefaultIterator; - - bool m_useDefault; - RouteIterator m_itRouteCurrent, m_itRouteEnd; - DefaultIterator m_itDefaultCurrent, m_itDefaultEnd; - - MessageRouteIterator(MessageSwitch &ms, const std::string &channel) - : m_channel(channel) - { - pair range = cs.m_routeMap.equal_range(channel); - if (range.first == range.second) - { - m_useDefault = true; - m_itListCurrent = cs.m_defaultRoutes.begin(); - m_itListEnd = cs.m_defaultRoutes.end(); - } - else - { - m_useDefault = false; - m_itMapCurrent = range.first; - m_itMapEnd = range.second; - } - } - - bool End() const - { - return m_useDefault ? m_itListCurrent == m_itListEnd : m_itMapCurrent == m_itMapEnd; - } - - void Next() - { - if (m_useDefault) - ++m_itListCurrent; - else - ++m_itMapCurrent; - } - - BufferedTransformation & Destination() - { - return m_useDefault ? *m_itListCurrent->first : *m_itMapCurrent->second.first; - } - - const std::string & Message() - { - if (m_useDefault) - return m_itListCurrent->second.get() ? *m_itListCurrent->second.get() : m_channel; - else - return m_itMapCurrent->second.second; - } -}; - -void MessageSwitch::Put(byte inByte); -void MessageSwitch::Put(const byte *inString, unsigned int length); - -void MessageSwitch::Flush(bool completeFlush, int propagation=-1); -void MessageSwitch::MessageEnd(int propagation=-1); -void MessageSwitch::PutMessageEnd(const byte *inString, unsigned int length, int propagation=-1); -void MessageSwitch::MessageSeriesEnd(int propagation=-1); -*/ -#endif - - -// -// ChannelRouteIterator -////////////////////////// - -void ChannelRouteIterator::Reset(const std::string &channel) -{ - m_channel = channel; - pair range = m_cs.m_routeMap.equal_range(channel); - if (range.first == range.second) - { - m_useDefault = true; - m_itListCurrent = m_cs.m_defaultRoutes.begin(); - m_itListEnd = m_cs.m_defaultRoutes.end(); - } - else - { - m_useDefault = false; - m_itMapCurrent = range.first; - m_itMapEnd = range.second; - } -} - -bool ChannelRouteIterator::End() const -{ - return m_useDefault ? m_itListCurrent == m_itListEnd : m_itMapCurrent == m_itMapEnd; -} - -void ChannelRouteIterator::Next() -{ - if (m_useDefault) - ++m_itListCurrent; - else - ++m_itMapCurrent; -} - -BufferedTransformation & ChannelRouteIterator::Destination() -{ - return m_useDefault ? *m_itListCurrent->first : *m_itMapCurrent->second.first; -} - -const std::string & ChannelRouteIterator::Channel() -{ - if (m_useDefault) - return m_itListCurrent->second.get() ? *m_itListCurrent->second.get() : m_channel; - else - return m_itMapCurrent->second.second; -} - - -// -// ChannelSwitch -/////////////////// - -size_t ChannelSwitch::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (m_blocked) - { - m_blocked = false; - goto WasBlocked; - } - - m_it.Reset(channel); - - while (!m_it.End()) - { -WasBlocked: - if (m_it.Destination().ChannelPut2(m_it.Channel(), begin, length, messageEnd, blocking)) - { - m_blocked = true; - return 1; - } - - m_it.Next(); - } - - return 0; -} - -void ChannelSwitch::IsolatedInitialize(const NameValuePairs& parameters) -{ - CRYPTOPP_UNUSED(parameters); - m_routeMap.clear(); - m_defaultRoutes.clear(); - m_blocked = false; -} - -bool ChannelSwitch::ChannelFlush(const std::string &channel, bool completeFlush, int propagation, bool blocking) -{ - if (m_blocked) - { - m_blocked = false; - goto WasBlocked; - } - - m_it.Reset(channel); - - while (!m_it.End()) - { - WasBlocked: - if (m_it.Destination().ChannelFlush(m_it.Channel(), completeFlush, propagation, blocking)) - { - m_blocked = true; - return true; - } - - m_it.Next(); - } - - return false; -} - -bool ChannelSwitch::ChannelMessageSeriesEnd(const std::string &channel, int propagation, bool blocking) -{ - CRYPTOPP_UNUSED(blocking); - if (m_blocked) - { - m_blocked = false; - goto WasBlocked; - } - - m_it.Reset(channel); - - while (!m_it.End()) - { - WasBlocked: - if (m_it.Destination().ChannelMessageSeriesEnd(m_it.Channel(), propagation)) - { - m_blocked = true; - return true; - } - - m_it.Next(); - } - - return false; -} - -byte * ChannelSwitch::ChannelCreatePutSpace(const std::string &channel, size_t &size) -{ - m_it.Reset(channel); - if (!m_it.End()) - { - BufferedTransformation &target = m_it.Destination(); - const std::string &ch = m_it.Channel(); - m_it.Next(); - if (m_it.End()) // there is only one target channel - return target.ChannelCreatePutSpace(ch, size); - } - size = 0; - return NULL; -} - -size_t ChannelSwitch::ChannelPutModifiable2(const std::string &channel, byte *inString, size_t length, int messageEnd, bool blocking) -{ - ChannelRouteIterator it(*this); - it.Reset(channel); - - if (!it.End()) - { - BufferedTransformation &target = it.Destination(); - const std::string &targetChannel = it.Channel(); - it.Next(); - if (it.End()) // there is only one target channel - return target.ChannelPutModifiable2(targetChannel, inString, length, messageEnd, blocking); - } - - return ChannelPut2(channel, inString, length, messageEnd, blocking); -} - -void ChannelSwitch::AddDefaultRoute(BufferedTransformation &destination) -{ - m_defaultRoutes.push_back(DefaultRoute(&destination, value_ptr(NULL))); -} - -void ChannelSwitch::RemoveDefaultRoute(BufferedTransformation &destination) -{ - for (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it) - if (it->first == &destination && !it->second.get()) - { - m_defaultRoutes.erase(it); - break; - } -} - -void ChannelSwitch::AddDefaultRoute(BufferedTransformation &destination, const std::string &outChannel) -{ - m_defaultRoutes.push_back(DefaultRoute(&destination, outChannel)); -} - -void ChannelSwitch::RemoveDefaultRoute(BufferedTransformation &destination, const std::string &outChannel) -{ - for (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it) - if (it->first == &destination && (it->second.get() && *it->second == outChannel)) - { - m_defaultRoutes.erase(it); - break; - } -} - -void ChannelSwitch::AddRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel) -{ - m_routeMap.insert(RouteMap::value_type(inChannel, Route(&destination, outChannel))); -} - -void ChannelSwitch::RemoveRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel) -{ - typedef ChannelSwitch::RouteMap::iterator MapIterator; - pair range = m_routeMap.equal_range(inChannel); - - for (MapIterator it = range.first; it != range.second; ++it) - if (it->second.first == &destination && it->second.second == outChannel) - { - m_routeMap.erase(it); - break; - } -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/channels.h b/external/crypto++-5.6.3/channels.h deleted file mode 100644 index 00a8354b1..000000000 --- a/external/crypto++-5.6.3/channels.h +++ /dev/null @@ -1,134 +0,0 @@ -// channels.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile channels.h -//! \brief Classes for multiple named channels - -#ifndef CRYPTOPP_CHANNELS_H -#define CRYPTOPP_CHANNELS_H - -#include "cryptlib.h" -#include "simple.h" -#include "smartptr.h" -#include "stdcpp.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if 0 -//! Route input on default channel to different and/or multiple channels based on message sequence number -class MessageSwitch : public Sink -{ -public: - void AddDefaultRoute(BufferedTransformation &destination, const std::string &channel); - void AddRoute(unsigned int begin, unsigned int end, BufferedTransformation &destination, const std::string &channel); - - void Put(byte inByte); - void Put(const byte *inString, unsigned int length); - - void Flush(bool completeFlush, int propagation=-1); - void MessageEnd(int propagation=-1); - void PutMessageEnd(const byte *inString, unsigned int length, int propagation=-1); - void MessageSeriesEnd(int propagation=-1); - -private: - typedef std::pair Route; - struct RangeRoute - { - RangeRoute(unsigned int begin, unsigned int end, const Route &route) - : begin(begin), end(end), route(route) {} - bool operator<(const RangeRoute &rhs) const {return begin < rhs.begin;} - unsigned int begin, end; - Route route; - }; - - typedef std::list RouteList; - typedef std::list DefaultRouteList; - - RouteList m_routes; - DefaultRouteList m_defaultRoutes; - unsigned int m_nCurrentMessage; -}; -#endif - -class ChannelSwitchTypedefs -{ -public: - typedef std::pair Route; - typedef std::multimap RouteMap; - - typedef std::pair > DefaultRoute; - typedef std::list DefaultRouteList; - - // SunCC workaround: can't use const_iterator here - typedef RouteMap::iterator MapIterator; - typedef DefaultRouteList::iterator ListIterator; -}; - -class ChannelSwitch; - -class ChannelRouteIterator : public ChannelSwitchTypedefs -{ -public: - ChannelRouteIterator(ChannelSwitch &cs) : m_cs(cs), m_useDefault(false) {} - - void Reset(const std::string &channel); - bool End() const; - void Next(); - BufferedTransformation & Destination(); - const std::string & Channel(); - - ChannelSwitch& m_cs; - std::string m_channel; - bool m_useDefault; - MapIterator m_itMapCurrent, m_itMapEnd; - ListIterator m_itListCurrent, m_itListEnd; - -protected: - // Hide this to see if we break something... - ChannelRouteIterator(); -}; - -//! Route input to different and/or multiple channels based on channel ID -class CRYPTOPP_DLL ChannelSwitch : public Multichannel, public ChannelSwitchTypedefs -{ -public: - ChannelSwitch() : m_it(*this), m_blocked(false) {} - ChannelSwitch(BufferedTransformation &destination) : m_it(*this), m_blocked(false) - { - AddDefaultRoute(destination); - } - ChannelSwitch(BufferedTransformation &destination, const std::string &outChannel) : m_it(*this), m_blocked(false) - { - AddDefaultRoute(destination, outChannel); - } - - void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); - - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); - size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking); - - bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true); - bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); - - byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); - - void AddDefaultRoute(BufferedTransformation &destination); - void RemoveDefaultRoute(BufferedTransformation &destination); - void AddDefaultRoute(BufferedTransformation &destination, const std::string &outChannel); - void RemoveDefaultRoute(BufferedTransformation &destination, const std::string &outChannel); - void AddRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel); - void RemoveRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel); - -private: - RouteMap m_routeMap; - DefaultRouteList m_defaultRoutes; - - ChannelRouteIterator m_it; - bool m_blocked; - - friend class ChannelRouteIterator; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/clean-vs.cmd b/external/crypto++-5.6.3/clean-vs.cmd deleted file mode 100644 index 0bc90de81..000000000 --- a/external/crypto++-5.6.3/clean-vs.cmd +++ /dev/null @@ -1,48 +0,0 @@ -@echo OFF -REM set THIS_DIR=%~dp0 -set THIS_DIR=. - -attrib -R -A -S -H "%THIS_DIR%\*.aps" -attrib -R -A -S -H "%THIS_DIR%\*.ncb" -attrib -R -A -S -H "%THIS_DIR%\*.suo" -attrib -R -A -S -H "%THIS_DIR%\*.sdf" -attrib -R -A -S -H "%THIS_DIR%\*.user" - -del "%THIS_DIR%\*.aps" /q -del "%THIS_DIR%\*.ncb" /q -del "%THIS_DIR%\*.suo" /q -del "%THIS_DIR%\*.sdf" /q -del "%THIS_DIR%\cryptlib.user" /q -del "%THIS_DIR%\cryptdll.user" /q -del "%THIS_DIR%\dlltest.user" /q -del "%THIS_DIR%\adhoc.cpp" /q -del "%THIS_DIR%\cryptopp.mac.done" /q -del "%THIS_DIR%\adhoc.cpp.copied" /q - -REM New Visual Studio 2005 and VC 6.0 -del "%THIS_DIR%\cryptlib.vcproj" /q -del "%THIS_DIR%\cryptest.vcproj" /q -del "%THIS_DIR%\cryptdll.vcproj" /q -del "%THIS_DIR%\dlltest.vcproj" /q -del "%THIS_DIR%\cryptopp.vcproj" /q -del "%THIS_DIR%\cryptlib.dsp" /q -del "%THIS_DIR%\cryptest.dsp" /q -del "%THIS_DIR%\cryptdll.dsp" /q -del "%THIS_DIR%\dlltest.dsp" /q -del "%THIS_DIR%\cryptest.dsw" /q - -REM Visual Studio build artifacts -rmdir /Q /S "%THIS_DIR%\Debug\" -rmdir /Q /S "%THIS_DIR%\Release\" -rmdir /Q /S "%THIS_DIR%\Win32\" -rmdir /Q /S "%THIS_DIR%\x64\" -rmdir /Q /S "%THIS_DIR%\ipch\" -rmdir /Q /S "%THIS_DIR%\.vs\" - -REM Visual Studio VCUpgrade artifacts -del "%THIS_DIR%\*.old" /q -del "%THIS_DIR%\UpgradeLog.htm" /q -del "%THIS_DIR%\UpgradeLog.XML" /q -rmdir /Q /S "%THIS_DIR%\_UpgradeReport_Files\" -rmdir /Q /S "%THIS_DIR%\Backup\" - diff --git a/external/crypto++-5.6.3/cmac.cpp b/external/crypto++-5.6.3/cmac.cpp deleted file mode 100644 index 62ae6c91b..000000000 --- a/external/crypto++-5.6.3/cmac.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// cmac.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "cmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -static void MulU(byte *k, unsigned int length) -{ - byte carry = 0; - - for (int i=length-1; i>=1; i-=2) - { - byte carry2 = k[i] >> 7; - k[i] += k[i] + carry; - carry = k[i-1] >> 7; - k[i-1] += k[i-1] + carry2; - } - - if (carry) - { - switch (length) - { - case 8: - k[7] ^= 0x1b; - break; - case 16: - k[15] ^= 0x87; - break; - case 32: - k[30] ^= 4; - k[31] ^= 0x23; - break; - default: - throw InvalidArgument("CMAC: " + IntToString(length) + " is not a supported cipher block size"); - } - } -} - -void CMAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) -{ - BlockCipher &cipher = AccessCipher(); - unsigned int blockSize = cipher.BlockSize(); - - cipher.SetKey(key, length, params); - m_reg.CleanNew(3*blockSize); - m_counter = 0; - - cipher.ProcessBlock(m_reg, m_reg+blockSize); - MulU(m_reg+blockSize, blockSize); - memcpy(m_reg+2*blockSize, m_reg+blockSize, blockSize); - MulU(m_reg+2*blockSize, blockSize); -} - -void CMAC_Base::Update(const byte *input, size_t length) -{ - assert((input && length) || !(input || length)); - if (!length) - return; - - BlockCipher &cipher = AccessCipher(); - unsigned int blockSize = cipher.BlockSize(); - - if (m_counter > 0) - { - const unsigned int len = UnsignedMin(blockSize - m_counter, length); - if (len) - { - xorbuf(m_reg+m_counter, input, len); - length -= len; - input += len; - m_counter += len; - } - - if (m_counter == blockSize && length > 0) - { - cipher.ProcessBlock(m_reg); - m_counter = 0; - } - } - - if (length > blockSize) - { - assert(m_counter == 0); - size_t leftOver = 1 + cipher.AdvancedProcessBlocks(m_reg, input, m_reg, length-1, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); - input += (length - leftOver); - length = leftOver; - } - - if (length > 0) - { - assert(m_counter + length <= blockSize); - xorbuf(m_reg+m_counter, input, length); - m_counter += (unsigned int)length; - } - - assert(m_counter > 0); -} - -void CMAC_Base::TruncatedFinal(byte *mac, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - BlockCipher &cipher = AccessCipher(); - unsigned int blockSize = cipher.BlockSize(); - - if (m_counter < blockSize) - { - m_reg[m_counter] ^= 0x80; - cipher.AdvancedProcessBlocks(m_reg, m_reg+2*blockSize, m_reg, blockSize, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); - } - else - cipher.AdvancedProcessBlocks(m_reg, m_reg+blockSize, m_reg, blockSize, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); - - memcpy(mac, m_reg, size); - - m_counter = 0; - memset(m_reg, 0, blockSize); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/cmac.h b/external/crypto++-5.6.3/cmac.h deleted file mode 100644 index b7027a60d..000000000 --- a/external/crypto++-5.6.3/cmac.h +++ /dev/null @@ -1,58 +0,0 @@ -// cmac.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile cmac.h -//! \brief Classes for CMAC message authentication code - -#ifndef CRYPTOPP_CMAC_H -#define CRYPTOPP_CMAC_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode -{ -public: - CMAC_Base() : m_counter(0) {} - - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *mac, size_t size); - unsigned int DigestSize() const {return GetCipher().BlockSize();} - unsigned int OptimalBlockSize() const {return GetCipher().BlockSize();} - unsigned int OptimalDataAlignment() const {return GetCipher().OptimalDataAlignment();} - -protected: - friend class EAX_Base; - - const BlockCipher & GetCipher() const {return const_cast(this)->AccessCipher();} - virtual BlockCipher & AccessCipher() =0; - - void ProcessBuf(); - SecByteBlock m_reg; - unsigned int m_counter; -}; - -/// CMAC -/*! Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32 */ -template -class CMAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs -{ -public: - CMAC() {} - CMAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH) - {this->SetKey(key, length);} - - static std::string StaticAlgorithmName() {return std::string("CMAC(") + T::StaticAlgorithmName() + ")";} - -private: - BlockCipher & AccessCipher() {return m_cipher;} - typename T::Encryption m_cipher; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/config.h b/external/crypto++-5.6.3/config.h deleted file mode 100644 index 8ddd11220..000000000 --- a/external/crypto++-5.6.3/config.h +++ /dev/null @@ -1,715 +0,0 @@ -// config.h - written and placed in the public domain by Wei Dai - -//! \file config.h -//! \brief Library configuration file - -#ifndef CRYPTOPP_CONFIG_H -#define CRYPTOPP_CONFIG_H - -// ***************** Important Settings ******************** - -// define this if running on a big-endian CPU -#if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__))) -# define IS_BIG_ENDIAN -#endif - -// define this if running on a little-endian CPU -// big endian will be assumed if IS_LITTLE_ENDIAN is not defined -#ifndef IS_BIG_ENDIAN -# define IS_LITTLE_ENDIAN -#endif - -// Sanity checks. Some processors have more than big-, little- and bi-endian modes. PDP mode, where order results in "4312", should -// raise red flags immediately. Additionally, mis-classified machines, like (previosuly) S/390, should raise red flags immediately. -#if defined(IS_BIG_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) -# error "IS_BIG_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_BIG_ENDIAN__" -#endif -#if defined(IS_LITTLE_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) -# error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__" -#endif - -// define this if you want to disable all OS-dependent features, -// such as sockets and OS-provided random number generators -// #define NO_OS_DEPENDENCE - -// Define this to use features provided by Microsoft's CryptoAPI. -// Currently the only feature used is random number generation. -// This macro will be ignored if NO_OS_DEPENDENCE is defined. -#define USE_MS_CRYPTOAPI - -// Define this to ensure C/C++ standard compliance and respect for GCC aliasing rules and other alignment fodder. If you -// experience a break with GCC at -O3, you should try this first. Guard it in case its set on the command line (and it differs). -#ifndef CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -// # define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -#endif - -// ***************** Less Important Settings *************** - -// Library version -#define CRYPTOPP_VERSION 563 - -// define this to retain (as much as possible) old deprecated function and class names -// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - -// define this to retain (as much as possible) ABI and binary compatibility with Crypto++ 5.6.2. -// Also see https://cryptopp.com/wiki/Config.h#Avoid_MAINTAIN_BACKWARDS_COMPATIBILITY -#if (CRYPTOPP_VERSION <= 600) -# if !defined(CRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562) && !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) -# define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -# endif -#endif - -// Define this if you want or need the library's memcpy_s and memmove_s. -// See http://github.com/weidai11/cryptopp/issues/28. -// #if !defined(CRYPTOPP_WANT_SECURE_LIB) -// # define CRYPTOPP_WANT_SECURE_LIB -// #endif - -// File system code to write to GZIP archive. -#if !defined(GZIP_OS_CODE) -# define GZIP_OS_CODE 0 -#endif - -// Try this if your CPU has 256K internal cache or a slow multiply instruction -// and you want a (possibly) faster IDEA implementation using log tables -// #define IDEA_LARGECACHE - -// Define this if, for the linear congruential RNG, you want to use -// the original constants as specified in S.K. Park and K.W. Miller's -// CACM paper. -// #define LCRNG_ORIGINAL_NUMBERS - -// choose which style of sockets to wrap (mostly useful for MinGW which has both) -#if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) -# define PREFER_BERKELEY_STYLE_SOCKETS -#endif - -// #if !defined(NO_WINDOWS_STYLE_SOCKETS) && !defined(PREFER_WINDOWS_STYLE_SOCKETS) -// # define PREFER_WINDOWS_STYLE_SOCKETS -// #endif - -// set the name of Rijndael cipher, was "Rijndael" before version 5.3 -#define CRYPTOPP_RIJNDAEL_NAME "AES" - -// CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects. -// Under GCC, the library uses init_priority attribute in the range -// [CRYPTOPP_INIT_PRIORITY, CRYPTOPP_INIT_PRIORITY+100]. Under Windows, -// CRYPTOPP_INIT_PRIORITY enlists "#pragma init_seg(lib)". -// #define CRYPTOPP_INIT_PRIORITY 250 - -// CRYPTOPP_USER_PRIORITY is for other libraries and user code that is using Crypto++ -// and managing C++ static object creation. It is guaranteed not to conflict with -// values used by (or would be used by) the Crypto++ library. -#if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) -# define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) -#else -# define CRYPTOPP_USER_PRIORITY 250 -#endif - -// ***************** Important Settings Again ******************** -// But the defaults should be ok. - -// namespace support is now required -#ifdef NO_NAMESPACE -# error namespace support is now required -#endif - -// Define this to workaround a Microsoft CryptoAPI bug where -// each call to CryptAcquireContext causes a 100 KB memory leak. -// Defining this will cause Crypto++ to make only one call to CryptAcquireContext. -// VALVE: This only applies to Windows 95 and older, we don't need it. -//#define WORKAROUND_MS_BUG_Q258000 - -#ifdef CRYPTOPP_DOXYGEN_PROCESSING -// Document the namespce exists. Put it here before CryptoPP is undefined below. -//! \namespace CryptoPP -//! \brief Crypto++ library namespace -//! \details Nearly all classes are located in the CryptoPP namespace. Within -//! the namespace, there are two additional namespaces. -//!
    -//!
  • Name - namespace for names used with \p NameValuePairs and documented in argnames.h -//!
  • Weak - namespace for weak and wounded algorithms, like ARC4, MD5 and Pananma -//!
-namespace CryptoPP { } -// Bring in the symbols fund in the weak namespace; and fold Weak1 into Weak -# define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -# define Weak1 Weak -// Avoid putting "CryptoPP::" in front of everything in Doxygen output -# define CryptoPP -# define NAMESPACE_BEGIN(x) -# define NAMESPACE_END -// Get Doxygen to generate better documentation for these typedefs -# define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; -// Make "protected" "private" so the functions and members are not documented -# define protected private -#else -# define NAMESPACE_BEGIN(x) namespace x { -# define NAMESPACE_END } -# define DOCUMENTED_TYPEDEF(x, y) typedef x y; -#endif -#define ANONYMOUS_NAMESPACE_BEGIN namespace { -#define ANONYMOUS_NAMESPACE_END } -#define USING_NAMESPACE(x) using namespace x; -#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { -#define DOCUMENTED_NAMESPACE_END } - -// What is the type of the third parameter to bind? -// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int. -// Unfortunately there is no way to tell whether or not socklen_t is defined. -// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile. -#ifndef TYPE_OF_SOCKLEN_T -# if defined(_WIN32) || defined(__CYGWIN__) -# define TYPE_OF_SOCKLEN_T int -# else -# define TYPE_OF_SOCKLEN_T ::socklen_t -# endif -#endif - -#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) -# define __USE_W32_SOCKETS -#endif - -typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs - -NAMESPACE_BEGIN(CryptoPP) - -typedef unsigned short word16; -typedef unsigned int word32; - -#if defined(_MSC_VER) || defined(__BORLANDC__) - typedef unsigned __int64 word64; - #define W64LIT(x) x##ui64 -#else - typedef unsigned long long word64; - #define W64LIT(x) x##ULL -#endif - -// define large word type, used for file offsets and such -typedef word64 lword; -const lword LWORD_MAX = W64LIT(0xffffffffffffffff); - -#ifdef __GNUC__ - #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#endif - -// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7 -#if defined(__clang__ ) && !defined(__apple_build_version__) - #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#elif defined(__clang__ ) && defined(__apple_build_version__) - #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#endif - -#ifdef _MSC_VER - #define CRYPTOPP_MSC_VERSION (_MSC_VER) -#endif - -// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}" -#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) - #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 -#endif - -// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 -// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes. -#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) - #define CRYPTOPP_DISABLE_INTEL_ASM 1 -#endif - -// define hword, word, and dword. these are used for multiprecision integer arithmetic -// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx -#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1000) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__)) - typedef word32 hword; - typedef word64 word; -#else - #define CRYPTOPP_NATIVE_DWORD_AVAILABLE - #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) - #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && (CRYPTOPP_GCC_VERSION >= 30400) - // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3 - // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4 - #define CRYPTOPP_WORD128_AVAILABLE - typedef word32 hword; - typedef word64 word; - typedef __uint128_t dword; - typedef __uint128_t word128; - #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) - // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. - #define CRYPTOPP_WORD128_AVAILABLE - typedef word32 hword; - typedef word64 word; - typedef __uint128_t dword; - typedef __uint128_t word128; - #else - // if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results - typedef word16 hword; - typedef word32 word; - typedef word64 dword; - #endif - #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) - // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. - #define CRYPTOPP_WORD128_AVAILABLE - typedef word32 hword; - typedef word64 word; - typedef __uint128_t dword; - typedef __uint128_t word128; - #else - // being here means the native register size is probably 32 bits or less - #define CRYPTOPP_BOOL_SLOW_WORD64 1 - typedef word16 hword; - typedef word32 word; - typedef word64 dword; - #endif -#endif -#ifndef CRYPTOPP_BOOL_SLOW_WORD64 - #define CRYPTOPP_BOOL_SLOW_WORD64 0 -#endif - -// Produce a compiler error. It can be commented out, but you may not get the benefit of the fastest integers. -#if (__SIZEOF_INT128__ >= 16) && !defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(__aarch64__) -# error "An int128_t and uint128_t are available, but CRYPTOPP_WORD128_AVAILABLE is not defined" -#endif - -const unsigned int WORD_SIZE = sizeof(word); -const unsigned int WORD_BITS = WORD_SIZE * 8; - -NAMESPACE_END - -#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE - // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks. - // Also see http://stackoverflow.com/questions/794632/programmatically-get-the-cache-line-size. - #if defined(_M_X64) || defined(__x86_64__) || (__ILP32__ >= 1) - #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 - #else - // L1 cache line size is 32 on Pentium III and earlier - #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 - #endif -#endif - -#if defined(_MSC_VER) - #if _MSC_VER == 1200 - #include - #endif - #if _MSC_VER > 1200 || defined(_mm_free) - #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later - #else - #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack - #endif -#endif - -#ifndef CRYPTOPP_ALIGN_DATA - #if defined(CRYPTOPP_MSVC6PP_OR_LATER) - #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) - #elif defined(__GNUC__) - #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) - #else - #define CRYPTOPP_ALIGN_DATA(x) - #endif -#endif - -#ifndef CRYPTOPP_SECTION_ALIGN16 -#if defined(__GNUC__) && !defined(__APPLE__) - // the alignment attribute doesn't seem to work without this section attribute when -fdata-sections is turned on - #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16"))) - #else - #define CRYPTOPP_SECTION_ALIGN16 - #endif -#endif - -#if defined(_MSC_VER) || defined(__fastcall) - #define CRYPTOPP_FASTCALL __fastcall -#else - #define CRYPTOPP_FASTCALL -#endif - -// VC60 workaround: it doesn't allow typename in some places -#if defined(_MSC_VER) && (_MSC_VER < 1300) -#define CPP_TYPENAME -#else -#define CPP_TYPENAME typename -#endif - -// VC60 workaround: can't cast unsigned __int64 to float or double -#if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER) -#define CRYPTOPP_VC6_INT64 (__int64) -#else -#define CRYPTOPP_VC6_INT64 -#endif - -#ifdef _MSC_VER -#define CRYPTOPP_NO_VTABLE __declspec(novtable) -#else -#define CRYPTOPP_NO_VTABLE -#endif - -#ifdef _MSC_VER - // 4127: conditional expression is constant - // 4231: nonstandard extension used : 'extern' before template explicit instantiation - // 4250: dominance - // 4251: member needs to have dll-interface - // 4275: base needs to have dll-interface - // 4505: unreferenced local function - // 4512: assignment operator not generated - // 4660: explicitly instantiating a class that's already implicitly instantiated - // 4661: no suitable definition provided for explicit template instantiation request - // 4786: identifer was truncated in debug information - // 4355: 'this' : used in base member initializer list - // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation -# pragma warning(disable: 4127 4231 4250 4251 4275 4505 4512 4660 4661 4786 4355 4910) - // Security related, possible defects - // http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx -# pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) -#endif - -#ifdef __BORLANDC__ -// 8037: non-const function called for const object. needed to work around BCB2006 bug -# pragma warn -8037 -#endif - -// [GCC Bug 53431] "C++ preprocessor ignores #pragma GCC diagnostic". Clang honors it. -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunknown-pragmas" -# pragma GCC diagnostic ignored "-Wunused-function" -#endif - -#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) -#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION -#endif - -#if !defined(CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION) && (defined(_MSC_VER) && _MSC_VER >= 1900) -#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION -#define CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE -#endif - -#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION -#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE -#endif - -#ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings -#define CRYPTOPP_DISABLE_ASM -#define CRYPTOPP_DISABLE_SSE2 -#endif - -// Apple's Clang prior to 5.0 cannot handle SSE2 (and Apple does not use LLVM Clang numbering...) -#if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) -# define CRYPTOPP_DISABLE_ASM -#endif - -#if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) - // C++Builder 2010 does not allow "call label" where label is defined within inline assembly - #define CRYPTOPP_X86_ASM_AVAILABLE - - #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) - #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 - #else - #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 - #endif - - // SSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed. - // GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version. Also see the output of - // `gcc -dM -E -march=native - < /dev/null | grep -i SSE` for preprocessor defines available. - #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__) || defined(__SSE3__)) - #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1 - #else - #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 - #endif -#endif - -#if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) - #define CRYPTOPP_X64_MASM_AVAILABLE -#endif - -#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) - #define CRYPTOPP_X64_ASM_AVAILABLE -#endif - -#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__)) - #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1 -#else - #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 -#endif - -#if !defined(CRYPTOPP_DISABLE_SSSE3) && !defined(CRYPTOPP_DISABLE_AESNI) && CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && (CRYPTOPP_GCC_VERSION >= 40400 || _MSC_FULL_VER >= 150030729 || __INTEL_COMPILER >= 1110 || defined(__AES__)) - #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1 -#else - #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0 -#endif - -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) - #define CRYPTOPP_BOOL_ALIGN16 1 -#else - #define CRYPTOPP_BOOL_ALIGN16 0 -#endif - -// how to allocate 16-byte aligned memory (for SSE2) -#if defined(CRYPTOPP_MSVC6PP_OR_LATER) - #define CRYPTOPP_MM_MALLOC_AVAILABLE -#elif defined(__APPLE__) - #define CRYPTOPP_APPLE_MALLOC_AVAILABLE -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) - #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 -#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) - #define CRYPTOPP_MEMALIGN_AVAILABLE -#else - #define CRYPTOPP_NO_ALIGNED_ALLOC -#endif - -// Apple always provides 16-byte aligned, and tells us to use calloc -// http://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html - -// how to disable inlining -#if defined(_MSC_VER) && _MSC_VER >= 1300 -# define CRYPTOPP_NOINLINE_DOTDOTDOT -# define CRYPTOPP_NOINLINE __declspec(noinline) -#elif defined(__GNUC__) -# define CRYPTOPP_NOINLINE_DOTDOTDOT -# define CRYPTOPP_NOINLINE __attribute__((noinline)) -#else -# define CRYPTOPP_NOINLINE_DOTDOTDOT ... -# define CRYPTOPP_NOINLINE -#endif - -// how to declare class constants -#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) -# define CRYPTOPP_CONSTANT(x) enum {x}; -#else -# define CRYPTOPP_CONSTANT(x) static const int x; -#endif - -// Linux provides X32, which is 32-bit integers, longs and pointers on x86_64 using the full x86_64 register set. -// Detect via __ILP32__ (http://wiki.debian.org/X32Port). Both GCC and Clang provide the preprocessor macro. -#if ((__ILP32__ >= 1) || (_ILP32 >= 1)) && !__i386__ - #define CRYPTOPP_BOOL_X32 1 -#else - #define CRYPTOPP_BOOL_X32 0 -#endif - -// see http://predef.sourceforge.net/prearch.html -// VALVE: Added !defined(_M_X64) because our build helpfully defines both _M_X64 and __i386__. -#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !defined(_M_X64) && !CRYPTOPP_BOOL_X32 - #define CRYPTOPP_BOOL_X86 1 -#else - #define CRYPTOPP_BOOL_X86 0 -#endif - -#if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 - #define CRYPTOPP_BOOL_X64 1 -#else - #define CRYPTOPP_BOOL_X64 0 -#endif - -// Undo the ASM and Intrinsic related defines due to X32. -#if CRYPTOPP_BOOL_X32 -# undef CRYPTOPP_BOOL_X64 -# undef CRYPTOPP_X64_ASM_AVAILABLE -# undef CRYPTOPP_X64_MASM_AVAILABLE -#endif - -#if !defined(CRYPTOPP_NO_UNALIGNED_DATA_ACCESS) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) -#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || defined(__powerpc__) || (__ARM_FEATURE_UNALIGNED >= 1)) - #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -#endif -#endif - -// ***************** determine availability of OS features ******************** - -#ifndef NO_OS_DEPENDENCE - -#if defined(_WIN32) || defined(__CYGWIN__) -#define CRYPTOPP_WIN32_AVAILABLE -#endif - -#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) -#define CRYPTOPP_UNIX_AVAILABLE -#endif - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -#define CRYPTOPP_BSD_AVAILABLE -#endif - -#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) -# define HIGHRES_TIMER_AVAILABLE -#endif - -#ifdef CRYPTOPP_UNIX_AVAILABLE -# define HAS_BERKELEY_STYLE_SOCKETS -#endif - -#ifdef CRYPTOPP_WIN32_AVAILABLE -# define HAS_WINDOWS_STYLE_SOCKETS -#endif - -#if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS)) -# define SOCKETS_AVAILABLE -#endif - -#if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) -# define USE_WINDOWS_STYLE_SOCKETS -#else -# define USE_BERKELEY_STYLE_SOCKETS -#endif - -#if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) -# define WINDOWS_PIPES_AVAILABLE -#endif - -#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI) -# define NONBLOCKING_RNG_AVAILABLE -# define OS_RNG_AVAILABLE -#endif - -#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) -# define NONBLOCKING_RNG_AVAILABLE -# define BLOCKING_RNG_AVAILABLE -# define OS_RNG_AVAILABLE -# define HAS_PTHREADS -# define THREADS_AVAILABLE -#endif - -#ifdef CRYPTOPP_WIN32_AVAILABLE -# define HAS_WINTHREADS -# define THREADS_AVAILABLE -#endif - -#endif // NO_OS_DEPENDENCE - -// ***************** DLL related ******************** - -#if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) - -#ifdef CRYPTOPP_EXPORTS -#define CRYPTOPP_IS_DLL -#define CRYPTOPP_DLL __declspec(dllexport) -#elif defined(CRYPTOPP_IMPORTS) -#define CRYPTOPP_IS_DLL -#define CRYPTOPP_DLL __declspec(dllimport) -#else -#define CRYPTOPP_DLL -#endif - -#define CRYPTOPP_API __cdecl - -#else // not CRYPTOPP_WIN32_AVAILABLE - -#define CRYPTOPP_DLL -#define CRYPTOPP_API - -#endif // CRYPTOPP_WIN32_AVAILABLE - -#if defined(__MWERKS__) -#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL -#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) -#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL -#else -#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL -#endif - -#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) -#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL -#else -#define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS -#endif - -#if defined(__MWERKS__) -#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class -#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) -#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class -#else -#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class -#endif - -#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) -#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class -#else -#define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS -#endif - -// ************** Unused variable *************** - -// Portable way to suppress warnings. -// Moved from misc.h due to circular depenedencies. -#define CRYPTOPP_UNUSED(x) ((void)x) - -// ***************** C++11 related ******************** - -// Visual Studio began at VS2010, http://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx. -// Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler -// GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html -// Clang and C++11 language features, http://clang.llvm.org/cxx_status.html -#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) -# define CRYPTOPP_CXX11 1 -#endif - -// Hack ahead. Apple's standard library does not have C++'s unique_ptr in C++11. We can't -// test for unique_ptr directly because some of the non-Apple Clangs on OS X fail the same -// way. However, modern standard libraries have , so we test for it instead. -// Thanks to Jonathan Wakely for devising the clever test for modern/ancient versions. -// TODO: test under Xcode 3, where g++ is really g++. -#if defined(__APPLE__) && defined(__clang__) -# if !(defined(__has_include) && __has_include()) -# undef CRYPTOPP_CXX11 -# endif -#endif - -// C++11 or C++14 is available -#if defined(CRYPTOPP_CXX11) - -// alignof/alignas: MS at VS2013 (19.00); GCC at 4.8; Clang at 3.3; and Intel 15.0. -#if (CRYPTOPP_MSC_VERSION >= 1900) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -#elif defined(__clang__) -# if __has_feature(cxx_alignof) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -# endif -#elif (CRYPTOPP_GCC_VERSION >= 40800) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -#endif // alignof/alignas - -// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; and Intel 14.0. -#if (CRYPTOPP_MSC_VERSION >= 1900) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -#elif defined(__clang__) -# if __has_feature(cxx_noexcept) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -# endif -#elif (CRYPTOPP_GCC_VERSION >= 40600) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -#endif // noexcept compilers - -// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; and Intel 12.1. -#if (CRYPTOPP_MSC_VERSION >= 1800) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1210) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -#elif defined(__clang__) -# if __has_feature(cxx_variadic_templates) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -# endif -#elif (CRYPTOPP_GCC_VERSION >= 40300) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -#endif // variadic templates - -// TODO: Emplacement, R-values and Move semantics -// Needed because we are catching warnings with GCC and MSC - -#endif // CRYPTOPP_CXX11 - -#if defined(CRYPTOPP_CXX11_NOEXCEPT) -# define CRYPTOPP_THROW noexcept(false) -# define CRYPTOPP_NO_THROW noexcept(true) -#else -# define CRYPTOPP_THROW -# define CRYPTOPP_NO_THROW -#endif // CRYPTOPP_CXX11_NOEXCEPT - -// OK to comment the following out, but please report it so we can fix it. -#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTIONS_AVAILABLE) -# error "std::uncaught_exception is not available. This is likely a configuration error." -#endif - -#endif diff --git a/external/crypto++-5.6.3/config.recommend b/external/crypto++-5.6.3/config.recommend deleted file mode 100644 index f30f9a26c..000000000 --- a/external/crypto++-5.6.3/config.recommend +++ /dev/null @@ -1,708 +0,0 @@ -// config.h - written and placed in the public domain by Wei Dai - -//! \file config.h -//! \brief Library configuration file - -#ifndef CRYPTOPP_CONFIG_H -#define CRYPTOPP_CONFIG_H - -// ***************** Important Settings ******************** - -// define this if running on a big-endian CPU -#if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__))) -# define IS_BIG_ENDIAN -#endif - -// define this if running on a little-endian CPU -// big endian will be assumed if IS_LITTLE_ENDIAN is not defined -#ifndef IS_BIG_ENDIAN -# define IS_LITTLE_ENDIAN -#endif - -// Sanity checks. Some processors have more than big-, little- and bi-endian modes. PDP mode, where order results in "4312", should -// raise red flags immediately. Additionally, mis-classified machines, like (previosuly) S/390, should raise red flags immediately. -#if defined(IS_BIG_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) -# error "IS_BIG_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_BIG_ENDIAN__" -#endif -#if defined(IS_LITTLE_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) -# error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__" -#endif - -// define this if you want to disable all OS-dependent features, -// such as sockets and OS-provided random number generators -// #define NO_OS_DEPENDENCE - -// Define this to use features provided by Microsoft's CryptoAPI. -// Currently the only feature used is random number generation. -// This macro will be ignored if NO_OS_DEPENDENCE is defined. -#define USE_MS_CRYPTOAPI - -// Define this to ensure C/C++ standard compliance and respect for GCC aliasing rules and other alignment fodder. If you -// experience a break with GCC at -O3, you should try this first. Guard it in case its set on the command line (and it differs). -#ifndef CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -# define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -#endif - -// ***************** Less Important Settings *************** - -// Library version -#define CRYPTOPP_VERSION 563 - -// define this to retain (as much as possible) old deprecated function and class names -// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - -// define this to retain (as much as possible) ABI and binary compatibility with Crypto++ 5.6.2. -// Also see https://cryptopp.com/wiki/Config.h#Avoid_MAINTAIN_BACKWARDS_COMPATIBILITY -#if (CRYPTOPP_VERSION <= 600) -# if !defined(CRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562) && !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) -// # define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -# endif -#endif - -// Define this if you want or need the library's memcpy_s and memmove_s. -// See http://github.com/weidai11/cryptopp/issues/28. -// #if !defined(CRYPTOPP_WANT_SECURE_LIB) -// # define CRYPTOPP_WANT_SECURE_LIB -// #endif - -// File system code to write to GZIP archive. -#if !defined(GZIP_OS_CODE) -# define GZIP_OS_CODE 0 -#endif - -// Try this if your CPU has 256K internal cache or a slow multiply instruction -// and you want a (possibly) faster IDEA implementation using log tables -// #define IDEA_LARGECACHE - -// Define this if, for the linear congruential RNG, you want to use -// the original constants as specified in S.K. Park and K.W. Miller's -// CACM paper. -// #define LCRNG_ORIGINAL_NUMBERS - -// choose which style of sockets to wrap (mostly useful for MinGW which has both) -#if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) -# define PREFER_BERKELEY_STYLE_SOCKETS -#endif - -// #if !defined(NO_WINDOWS_STYLE_SOCKETS) && !defined(PREFER_WINDOWS_STYLE_SOCKETS) -// # define PREFER_WINDOWS_STYLE_SOCKETS -// #endif - -// set the name of Rijndael cipher, was "Rijndael" before version 5.3 -#define CRYPTOPP_RIJNDAEL_NAME "AES" - -// CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects. -// Under GCC, the library uses init_priority attribute in the range -// [CRYPTOPP_INIT_PRIORITY, CRYPTOPP_INIT_PRIORITY+100]. Under Windows, -// CRYPTOPP_INIT_PRIORITY enlists "#pragma init_seg(lib)". -#define CRYPTOPP_INIT_PRIORITY 250 - -// CRYPTOPP_USER_PRIORITY is for other libraries and user code that is using Crypto++ -// and managing C++ static object creation. It is guaranteed not to conflict with -// values used by (or would be used by) the Crypto++ library. -#if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) -# define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) -#else -# define CRYPTOPP_USER_PRIORITY 250 -#endif - -// ***************** Important Settings Again ******************** -// But the defaults should be ok. - -// namespace support is now required -#ifdef NO_NAMESPACE -# error namespace support is now required -#endif - -// Define this to workaround a Microsoft CryptoAPI bug where -// each call to CryptAcquireContext causes a 100 KB memory leak. -// Defining this will cause Crypto++ to make only one call to CryptAcquireContext. -#define WORKAROUND_MS_BUG_Q258000 - -#ifdef CRYPTOPP_DOXYGEN_PROCESSING -// Document the namespce exists. Put it here before CryptoPP is undefined below. -//! \namespace CryptoPP -//! \brief Crypto++ library namespace -//! \details Nearly all classes are located in the CryptoPP namespace. Within -//! the namespace, there are two additional namespaces. -//!
    -//!
  • Name - namespace for names used with \p NameValuePairs and documented in argnames.h -//!
  • Weak - namespace for weak and wounded algorithms, like ARC4, MD5 and Pananma -//!
-namespace CryptoPP { } -// Bring in the symbols fund in the weak namespace; and fold Weak1 into Weak -# define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -# define Weak1 Weak -// Avoid putting "CryptoPP::" in front of everything in Doxygen output -# define CryptoPP -# define NAMESPACE_BEGIN(x) -# define NAMESPACE_END -// Get Doxygen to generate better documentation for these typedefs -# define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; -// Make "protected" "private" so the functions and members are not documented -# define protected private -#else -# define NAMESPACE_BEGIN(x) namespace x { -# define NAMESPACE_END } -# define DOCUMENTED_TYPEDEF(x, y) typedef x y; -#endif -#define ANONYMOUS_NAMESPACE_BEGIN namespace { -#define ANONYMOUS_NAMESPACE_END } -#define USING_NAMESPACE(x) using namespace x; -#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { -#define DOCUMENTED_NAMESPACE_END } - -// What is the type of the third parameter to bind? -// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int. -// Unfortunately there is no way to tell whether or not socklen_t is defined. -// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile. -#ifndef TYPE_OF_SOCKLEN_T -# if defined(_WIN32) || defined(__CYGWIN__) -# define TYPE_OF_SOCKLEN_T int -# else -# define TYPE_OF_SOCKLEN_T ::socklen_t -# endif -#endif - -#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) -# define __USE_W32_SOCKETS -#endif - -typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs - -NAMESPACE_BEGIN(CryptoPP) - -typedef unsigned short word16; -typedef unsigned int word32; - -#if defined(_MSC_VER) || defined(__BORLANDC__) - typedef unsigned __int64 word64; - #define W64LIT(x) x##ui64 -#else - typedef unsigned long long word64; - #define W64LIT(x) x##ULL -#endif - -// define large word type, used for file offsets and such -typedef word64 lword; -const lword LWORD_MAX = W64LIT(0xffffffffffffffff); - -#ifdef __GNUC__ - #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#endif - -// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7 -#if defined(__clang__ ) && !defined(__apple_build_version__) - #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#elif defined(__clang__ ) && defined(__apple_build_version__) - #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#endif - -#ifdef _MSC_VER - #define CRYPTOPP_MSC_VERSION (_MSC_VER) -#endif - -// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}" -#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) - #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 -#endif - -// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 -// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes. -#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) - #define CRYPTOPP_DISABLE_INTEL_ASM 1 -#endif - -// define hword, word, and dword. these are used for multiprecision integer arithmetic -// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx -#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1000) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__)) - typedef word32 hword; - typedef word64 word; -#else - #define CRYPTOPP_NATIVE_DWORD_AVAILABLE - #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) - #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && (CRYPTOPP_GCC_VERSION >= 30400) - // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3 - // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4 - #define CRYPTOPP_WORD128_AVAILABLE - typedef word32 hword; - typedef word64 word; - typedef __uint128_t dword; - typedef __uint128_t word128; - #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) - // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. - #define CRYPTOPP_WORD128_AVAILABLE - typedef word32 hword; - typedef word64 word; - typedef __uint128_t dword; - typedef __uint128_t word128; - #else - // if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results - typedef word16 hword; - typedef word32 word; - typedef word64 dword; - #endif - #elif defined(__GNUC__) && (__SIZEOF_INT128__ >= 16) - // Detect availabliltiy of int128_t and uint128_t in preprocessor, http://gcc.gnu.org/ml/gcc-help/2015-08/msg00185.html. - #define CRYPTOPP_WORD128_AVAILABLE - typedef word32 hword; - typedef word64 word; - typedef __uint128_t dword; - typedef __uint128_t word128; - #else - // being here means the native register size is probably 32 bits or less - #define CRYPTOPP_BOOL_SLOW_WORD64 1 - typedef word16 hword; - typedef word32 word; - typedef word64 dword; - #endif -#endif -#ifndef CRYPTOPP_BOOL_SLOW_WORD64 - #define CRYPTOPP_BOOL_SLOW_WORD64 0 -#endif - -// Produce a compiler error. It can be commented out, but you may not get the benefit of the fastest integers. -#if (__SIZEOF_INT128__ >= 16) && !defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(__aarch64__) -# error "An int128_t and uint128_t are available, but CRYPTOPP_WORD128_AVAILABLE is not defined" -#endif - -const unsigned int WORD_SIZE = sizeof(word); -const unsigned int WORD_BITS = WORD_SIZE * 8; - -NAMESPACE_END - -#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE - // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks. - // Also see http://stackoverflow.com/questions/794632/programmatically-get-the-cache-line-size. - #if defined(_M_X64) || defined(__x86_64__) || (__ILP32__ >= 1) - #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 - #else - // L1 cache line size is 32 on Pentium III and earlier - #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 - #endif -#endif - -#if defined(_MSC_VER) - #if _MSC_VER == 1200 - #include - #endif - #if _MSC_VER > 1200 || defined(_mm_free) - #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later - #else - #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack - #endif -#endif - -#ifndef CRYPTOPP_ALIGN_DATA - #if defined(CRYPTOPP_MSVC6PP_OR_LATER) - #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) - #elif defined(__GNUC__) - #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) - #else - #define CRYPTOPP_ALIGN_DATA(x) - #endif -#endif - -#ifndef CRYPTOPP_SECTION_ALIGN16 -#if defined(__GNUC__) && !defined(__APPLE__) - // the alignment attribute doesn't seem to work without this section attribute when -fdata-sections is turned on - #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16"))) - #else - #define CRYPTOPP_SECTION_ALIGN16 - #endif -#endif - -#if defined(_MSC_VER) || defined(__fastcall) - #define CRYPTOPP_FASTCALL __fastcall -#else - #define CRYPTOPP_FASTCALL -#endif - -// VC60 workaround: it doesn't allow typename in some places -#if defined(_MSC_VER) && (_MSC_VER < 1300) -#define CPP_TYPENAME -#else -#define CPP_TYPENAME typename -#endif - -// VC60 workaround: can't cast unsigned __int64 to float or double -#if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER) -#define CRYPTOPP_VC6_INT64 (__int64) -#else -#define CRYPTOPP_VC6_INT64 -#endif - -#ifdef _MSC_VER -#define CRYPTOPP_NO_VTABLE __declspec(novtable) -#else -#define CRYPTOPP_NO_VTABLE -#endif - -#ifdef _MSC_VER - // 4127: conditional expression is constant - // 4231: nonstandard extension used : 'extern' before template explicit instantiation - // 4250: dominance - // 4251: member needs to have dll-interface - // 4275: base needs to have dll-interface - // 4505: unreferenced local function - // 4512: assignment operator not generated - // 4660: explicitly instantiating a class that's already implicitly instantiated - // 4661: no suitable definition provided for explicit template instantiation request - // 4786: identifer was truncated in debug information - // 4355: 'this' : used in base member initializer list - // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation -# pragma warning(disable: 4127 4231 4250 4251 4275 4505 4512 4660 4661 4786 4355 4910) - // Security related, possible defects - // http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx -# pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) -#endif - -#ifdef __BORLANDC__ -// 8037: non-const function called for const object. needed to work around BCB2006 bug -# pragma warn -8037 -#endif - -// [GCC Bug 53431] "C++ preprocessor ignores #pragma GCC diagnostic". Clang honors it. -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunknown-pragmas" -# pragma GCC diagnostic ignored "-Wunused-function" -#endif - -#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) -#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION -#endif - -#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION -#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE -#endif - -#ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings -#define CRYPTOPP_DISABLE_ASM -#define CRYPTOPP_DISABLE_SSE2 -#endif - -// Apple's Clang prior to 5.0 cannot handle SSE2 (and Apple does not use LLVM Clang numbering...) -#if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) -# define CRYPTOPP_DISABLE_ASM -#endif - -#if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) - // C++Builder 2010 does not allow "call label" where label is defined within inline assembly - #define CRYPTOPP_X86_ASM_AVAILABLE - - #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) - #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 - #else - #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 - #endif - - // SSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed. - // GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version. Also see the output of - // `gcc -dM -E -march=native - < /dev/null | grep -i SSE` for preprocessor defines available. - #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__) || defined(__SSE3__)) - #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1 - #else - #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 - #endif -#endif - -#if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) - #define CRYPTOPP_X64_MASM_AVAILABLE -#endif - -#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) - #define CRYPTOPP_X64_ASM_AVAILABLE -#endif - -#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__)) - #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1 -#else - #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 -#endif - -#if !defined(CRYPTOPP_DISABLE_SSSE3) && !defined(CRYPTOPP_DISABLE_AESNI) && CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && (CRYPTOPP_GCC_VERSION >= 40400 || _MSC_FULL_VER >= 150030729 || __INTEL_COMPILER >= 1110 || defined(__AES__)) - #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1 -#else - #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0 -#endif - -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) - #define CRYPTOPP_BOOL_ALIGN16 1 -#else - #define CRYPTOPP_BOOL_ALIGN16 0 -#endif - -// how to allocate 16-byte aligned memory (for SSE2) -#if defined(CRYPTOPP_MSVC6PP_OR_LATER) - #define CRYPTOPP_MM_MALLOC_AVAILABLE -#elif defined(__APPLE__) - #define CRYPTOPP_APPLE_MALLOC_AVAILABLE -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) - #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 -#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) - #define CRYPTOPP_MEMALIGN_AVAILABLE -#else - #define CRYPTOPP_NO_ALIGNED_ALLOC -#endif - -// Apple always provides 16-byte aligned, and tells us to use calloc -// http://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html - -// how to disable inlining -#if defined(_MSC_VER) && _MSC_VER >= 1300 -# define CRYPTOPP_NOINLINE_DOTDOTDOT -# define CRYPTOPP_NOINLINE __declspec(noinline) -#elif defined(__GNUC__) -# define CRYPTOPP_NOINLINE_DOTDOTDOT -# define CRYPTOPP_NOINLINE __attribute__((noinline)) -#else -# define CRYPTOPP_NOINLINE_DOTDOTDOT ... -# define CRYPTOPP_NOINLINE -#endif - -// how to declare class constants -#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) -# define CRYPTOPP_CONSTANT(x) enum {x}; -#else -# define CRYPTOPP_CONSTANT(x) static const int x; -#endif - -// Linux provides X32, which is 32-bit integers, longs and pointers on x86_64 using the full x86_64 register set. -// Detect via __ILP32__ (http://wiki.debian.org/X32Port). Both GCC and Clang provide the preprocessor macro. -#if ((__ILP32__ >= 1) || (_ILP32 >= 1)) - #define CRYPTOPP_BOOL_X32 1 -#else - #define CRYPTOPP_BOOL_X32 0 -#endif - -// see http://predef.sourceforge.net/prearch.html -#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !CRYPTOPP_BOOL_X32 - #define CRYPTOPP_BOOL_X86 1 -#else - #define CRYPTOPP_BOOL_X86 0 -#endif - -#if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 - #define CRYPTOPP_BOOL_X64 1 -#else - #define CRYPTOPP_BOOL_X64 0 -#endif - -// Undo the ASM and Intrinsic related defines due to X32. -#if CRYPTOPP_BOOL_X32 -# undef CRYPTOPP_BOOL_X64 -# undef CRYPTOPP_X64_ASM_AVAILABLE -# undef CRYPTOPP_X64_MASM_AVAILABLE -#endif - -#if !defined(CRYPTOPP_NO_UNALIGNED_DATA_ACCESS) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) -#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || defined(__powerpc__) || (__ARM_FEATURE_UNALIGNED >= 1)) - #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -#endif -#endif - -// ***************** determine availability of OS features ******************** - -#ifndef NO_OS_DEPENDENCE - -#if defined(_WIN32) || defined(__CYGWIN__) -#define CRYPTOPP_WIN32_AVAILABLE -#endif - -#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) -#define CRYPTOPP_UNIX_AVAILABLE -#endif - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -#define CRYPTOPP_BSD_AVAILABLE -#endif - -#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) -# define HIGHRES_TIMER_AVAILABLE -#endif - -#ifdef CRYPTOPP_UNIX_AVAILABLE -# define HAS_BERKELEY_STYLE_SOCKETS -#endif - -#ifdef CRYPTOPP_WIN32_AVAILABLE -# define HAS_WINDOWS_STYLE_SOCKETS -#endif - -#if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS)) -# define SOCKETS_AVAILABLE -#endif - -#if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) -# define USE_WINDOWS_STYLE_SOCKETS -#else -# define USE_BERKELEY_STYLE_SOCKETS -#endif - -#if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) -# define WINDOWS_PIPES_AVAILABLE -#endif - -#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI) -# define NONBLOCKING_RNG_AVAILABLE -# define OS_RNG_AVAILABLE -#endif - -#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) -# define NONBLOCKING_RNG_AVAILABLE -# define BLOCKING_RNG_AVAILABLE -# define OS_RNG_AVAILABLE -# define HAS_PTHREADS -# define THREADS_AVAILABLE -#endif - -#ifdef CRYPTOPP_WIN32_AVAILABLE -# define HAS_WINTHREADS -# define THREADS_AVAILABLE -#endif - -#endif // NO_OS_DEPENDENCE - -// ***************** DLL related ******************** - -#if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) - -#ifdef CRYPTOPP_EXPORTS -#define CRYPTOPP_IS_DLL -#define CRYPTOPP_DLL __declspec(dllexport) -#elif defined(CRYPTOPP_IMPORTS) -#define CRYPTOPP_IS_DLL -#define CRYPTOPP_DLL __declspec(dllimport) -#else -#define CRYPTOPP_DLL -#endif - -#define CRYPTOPP_API __cdecl - -#else // not CRYPTOPP_WIN32_AVAILABLE - -#define CRYPTOPP_DLL -#define CRYPTOPP_API - -#endif // CRYPTOPP_WIN32_AVAILABLE - -#if defined(__MWERKS__) -#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL -#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) -#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL -#else -#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL -#endif - -#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) -#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL -#else -#define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS -#endif - -#if defined(__MWERKS__) -#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class -#elif defined(__BORLANDC__) || defined(__SUNPRO_CC) -#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class -#else -#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class -#endif - -#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) -#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class -#else -#define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS -#endif - -// ************** Unused variable *************** - -// Portable way to suppress warnings. -// Moved from misc.h due to circular depenedencies. -#define CRYPTOPP_UNUSED(x) ((void)x) - -// ***************** C++11 related ******************** - -// Visual Studio began at VS2010, http://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx. -// Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler -// GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html -// Clang and C++11 language features, http://clang.llvm.org/cxx_status.html -#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) -# define CRYPTOPP_CXX11 1 -#endif - -// Hack ahead. Apple's standard library does not have C++'s unique_ptr in C++11. We can't -// test for unique_ptr directly because some of the non-Apple Clangs on OS X fail the same -// way. However, modern standard libraries have , so we test for it instead. -// Thanks to Jonathan Wakely for devising the clever test for modern/ancient versions. -// TODO: test under Xcode 3, where g++ is really g++. -#if defined(__APPLE__) && defined(__clang__) -# if !(defined(__has_include) && __has_include()) -# undef CRYPTOPP_CXX11 -# endif -#endif - -// C++11 or C++14 is available -#if defined(CRYPTOPP_CXX11) - -// alignof/alignas: MS at VS2013 (19.00); GCC at 4.8; Clang at 3.3; and Intel 15.0. -#if (CRYPTOPP_MSC_VERSION >= 1900) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -#elif defined(__clang__) -# if __has_feature(cxx_alignof) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -# endif -#elif (CRYPTOPP_GCC_VERSION >= 40800) -# define CRYPTOPP_CXX11_ALIGNAS 1 -# define CRYPTOPP_CXX11_ALIGNOF 1 -#endif // alignof/alignas - -// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; and Intel 14.0. -#if (CRYPTOPP_MSC_VERSION >= 1900) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -#elif defined(__clang__) -# if __has_feature(cxx_noexcept) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -# endif -#elif (CRYPTOPP_GCC_VERSION >= 40600) -# define CRYPTOPP_CXX11_NOEXCEPT 1 -#endif // noexcept compilers - -// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; and Intel 12.1. -#if (CRYPTOPP_MSC_VERSION >= 1800) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1210) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -#elif defined(__clang__) -# if __has_feature(cxx_variadic_templates) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -# endif -#elif (CRYPTOPP_GCC_VERSION >= 40300) -# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 -#endif // variadic templates - -// TODO: Emplacement, R-values and Move semantics -// Needed because we are catching warnings with GCC and MSC - -#endif // CRYPTOPP_CXX11 - -#if defined(CRYPTOPP_CXX11_NOEXCEPT) -# define CRYPTOPP_THROW noexcept(false) -# define CRYPTOPP_NO_THROW noexcept(true) -#else -# define CRYPTOPP_THROW -# define CRYPTOPP_NO_THROW -#endif // CRYPTOPP_CXX11_NOEXCEPT - -// OK to comment the following out, but please report it so we can fix it. -#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) -# error "std::uncaught_exception is not available. This is likely a configuration error." -#endif - -#endif diff --git a/external/crypto++-5.6.3/cpu.cpp b/external/crypto++-5.6.3/cpu.cpp deleted file mode 100644 index 9219e44ad..000000000 --- a/external/crypto++-5.6.3/cpu.cpp +++ /dev/null @@ -1,268 +0,0 @@ -// cpu.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#ifndef EXCEPTION_EXECUTE_HANDLER -# define EXCEPTION_EXECUTE_HANDLER 1 -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "cpu.h" -#include "misc.h" -#include - -#ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY -#include -#include -#endif - -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE -#include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#ifdef CRYPTOPP_CPUID_AVAILABLE - -#if _MSC_VER >= 1400 && CRYPTOPP_BOOL_X64 - -bool CpuId(word32 input, word32 output[4]) -{ - __cpuid((int *)output, input); - return true; -} - -#elif defined(__APPLE__) // VALVE edit for cpuid intrinsic on OSX - -#include -bool CpuId(word32 input, word32 output[4]) -{ - __cpuid( input, output[0], output[1], output[2], output[3] ); - return true; -} - -#else - -#ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY -extern "C" { -typedef void (*SigHandler)(int); - -static jmp_buf s_jmpNoCPUID; -static void SigIllHandlerCPUID(int) -{ - longjmp(s_jmpNoCPUID, 1); -} - -static jmp_buf s_jmpNoSSE2; -static void SigIllHandlerSSE2(int) -{ - longjmp(s_jmpNoSSE2, 1); -} -} -#endif - -bool CpuId(word32 input, word32 output[4]) -{ -#if defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) - __try - { - __asm - { - mov eax, input - mov ecx, 0 - cpuid - mov edi, output - mov [edi], eax - mov [edi+4], ebx - mov [edi+8], ecx - mov [edi+12], edx - } - } - // GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION - __except (EXCEPTION_EXECUTE_HANDLER) - { - return false; - } - - // function 0 returns the highest basic function understood in EAX - if(input == 0) - return !!output[0]; - - return true; -#else - // longjmp and clobber warnings. Volatile is required. - // http://github.com/weidai11/cryptopp/issues/24 - // http://stackoverflow.com/q/7721854 - volatile bool result = true; - - SigHandler oldHandler = signal(SIGILL, SigIllHandlerCPUID); - if (oldHandler == SIG_ERR) - result = false; - - if (setjmp(s_jmpNoCPUID)) - result = false; - else - { - asm volatile - ( - // save ebx in case -fPIC is being used - // TODO: this might need an early clobber on EDI. -# if CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 - "pushq %%rbx; cpuid; mov %%ebx, %%edi; popq %%rbx" -# else - "push %%ebx; cpuid; mov %%ebx, %%edi; pop %%ebx" -# endif - : "=a" (output[0]), "=D" (output[1]), "=c" (output[2]), "=d" (output[3]) - : "a" (input), "c" (0) - ); - } - - signal(SIGILL, oldHandler); - return result; -#endif -} - -#endif - -static bool TrySSE2() -{ -#if CRYPTOPP_BOOL_X64 - return true; -#elif defined(__APPLE__) // VALVE edit - assume SSE2 on Mac targets - return true; -#elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) - __try - { -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - AS2(por xmm0, xmm0) // executing SSE2 instruction -#elif CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE - __m128i x = _mm_setzero_si128(); - return _mm_cvtsi128_si32(x) == 0; -#endif - } - // GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION - __except (EXCEPTION_EXECUTE_HANDLER) - { - return false; - } - return true; -#else - // longjmp and clobber warnings. Volatile is required. - // http://github.com/weidai11/cryptopp/issues/24 - // http://stackoverflow.com/q/7721854 - volatile bool result = true; - - SigHandler oldHandler = signal(SIGILL, SigIllHandlerSSE2); - if (oldHandler == SIG_ERR) - return false; - - if (setjmp(s_jmpNoSSE2)) - result = true; - else - { -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - __asm __volatile ("por %xmm0, %xmm0"); -#elif CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE - __m128i x = _mm_setzero_si128(); - result = _mm_cvtsi128_si32(x) == 0; -#endif - } - - signal(SIGILL, oldHandler); - return result; -#endif -} - -bool g_x86DetectionDone = false; -bool g_hasMMX = false, g_hasISSE = false, g_hasSSE2 = false, g_hasSSSE3 = false, g_hasAESNI = false, g_hasCLMUL = false, g_isP4 = false, g_hasRDRAND = false, g_hasRDSEED = false; -word32 g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE; - -// MacPorts/GCC does not provide constructor(priority). Apple/GCC and Fink/GCC do provide it. -#define HAVE_GCC_CONSTRUCTOR1 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && ((CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 300)) && !(MACPORTS_GCC_COMPILER > 0)) -#define HAVE_GCC_CONSTRUCTOR0 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0)) - -static inline bool IsIntel(const word32 output[4]) -{ - // This is the "GenuineIntel" string - return (output[1] /*EBX*/ == 0x756e6547) && - (output[2] /*ECX*/ == 0x6c65746e) && - (output[3] /*EDX*/ == 0x49656e69); -} - -static inline bool IsAMD(const word32 output[4]) -{ - // This is the "AuthenticAMD" string - return (output[1] /*EBX*/ == 0x68747541) && - (output[2] /*ECX*/ == 0x69746E65) && - (output[3] /*EDX*/ == 0x444D4163); -} - -#if HAVE_GCC_CONSTRUCTOR1 -void __attribute__ ((constructor (CRYPTOPP_INIT_PRIORITY + 50))) DetectX86Features() -#elif HAVE_GCC_CONSTRUCTOR0 -void __attribute__ ((constructor)) DetectX86Features() -#else -void DetectX86Features() -#endif -{ - word32 cpuid[4], cpuid1[4]; - if (!CpuId(0, cpuid)) - return; - if (!CpuId(1, cpuid1)) - return; - - g_hasMMX = (cpuid1[3] & (1 << 23)) != 0; - if ((cpuid1[3] & (1 << 26)) != 0) - g_hasSSE2 = TrySSE2(); - g_hasSSSE3 = g_hasSSE2 && (cpuid1[2] & (1<<9)); - g_hasAESNI = g_hasSSE2 && (cpuid1[2] & (1<<25)); - g_hasCLMUL = g_hasSSE2 && (cpuid1[2] & (1<<1)); - - if ((cpuid1[3] & (1 << 25)) != 0) - g_hasISSE = true; - else - { - word32 cpuid2[4]; - CpuId(0x080000000, cpuid2); - if (cpuid2[0] >= 0x080000001) - { - CpuId(0x080000001, cpuid2); - g_hasISSE = (cpuid2[3] & (1 << 22)) != 0; - } - } - - static const unsigned int RDRAND_FLAG = (1 << 30); - static const unsigned int RDSEED_FLAG = (1 << 18); - if (IsIntel(cpuid)) - { - g_isP4 = ((cpuid1[0] >> 8) & 0xf) == 0xf; - g_cacheLineSize = 8 * GETBYTE(cpuid1[1], 1); - g_hasRDRAND = !!(cpuid1[2] /*ECX*/ & RDRAND_FLAG); - - if (cpuid[0] /*EAX*/ >= 7) - { - word32 cpuid3[4]; - if (CpuId(7, cpuid3)) - g_hasRDSEED = !!(cpuid3[1] /*EBX*/ & RDSEED_FLAG); - } - } - else if (IsAMD(cpuid)) - { - CpuId(0x80000005, cpuid); - g_cacheLineSize = GETBYTE(cpuid[2], 0); - g_hasRDRAND = !!(cpuid[2] /*ECX*/ & RDRAND_FLAG); - } - - if (!g_cacheLineSize) - g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE; - - *((volatile bool*)&g_x86DetectionDone) = true; -} - -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/cpu.h b/external/crypto++-5.6.3/cpu.h deleted file mode 100644 index a9c0139dc..000000000 --- a/external/crypto++-5.6.3/cpu.h +++ /dev/null @@ -1,413 +0,0 @@ -// cpu.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile cpu.h -//! \brief Classes, functions, intrinsics and features for X86, X32 nd X64 assembly - -#ifndef CRYPTOPP_CPU_H -#define CRYPTOPP_CPU_H - -#include "config.h" - -#ifdef CRYPTOPP_GENERATE_X64_MASM - -#define CRYPTOPP_X86_ASM_AVAILABLE -#define CRYPTOPP_BOOL_X64 1 -#define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 -#define NAMESPACE_END - -#else - -# if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE -# include -# endif - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE -#if !defined(__GNUC__) || defined(__SSSE3__) || defined(__INTEL_COMPILER) -#include -#else -NAMESPACE_BEGIN(CryptoPP) -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_shuffle_epi8 (__m128i a, __m128i b) -{ - asm ("pshufb %1, %0" : "+x"(a) : "xm"(b)); - return a; -} -NAMESPACE_END -#endif // tmmintrin.h -#if !defined(__GNUC__) || defined(__SSE4_1__) || defined(__INTEL_COMPILER) -#include -#else -NAMESPACE_BEGIN(CryptoPP) -__inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_extract_epi32 (__m128i a, const int i) -{ - int r; - asm ("pextrd %2, %1, %0" : "=rm"(r) : "x"(a), "i"(i)); - return r; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_insert_epi32 (__m128i a, int b, const int i) -{ - asm ("pinsrd %2, %1, %0" : "+x"(a) : "rm"(b), "i"(i)); - return a; -} -NAMESPACE_END -#endif // smmintrin.h -#if !defined(__GNUC__) || (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) -#include -#else -NAMESPACE_BEGIN(CryptoPP) -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_clmulepi64_si128 (__m128i a, __m128i b, const int i) -{ - asm ("pclmulqdq %2, %1, %0" : "+x"(a) : "xm"(b), "i"(i)); - return a; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_aeskeygenassist_si128 (__m128i a, const int i) -{ - __m128i r; - asm ("aeskeygenassist %2, %1, %0" : "=x"(r) : "xm"(a), "i"(i)); - return r; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_aesimc_si128 (__m128i a) -{ - __m128i r; - asm ("aesimc %1, %0" : "=x"(r) : "xm"(a)); - return r; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_aesenc_si128 (__m128i a, __m128i b) -{ - asm ("aesenc %1, %0" : "+x"(a) : "xm"(b)); - return a; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_aesenclast_si128 (__m128i a, __m128i b) -{ - asm ("aesenclast %1, %0" : "+x"(a) : "xm"(b)); - return a; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_aesdec_si128 (__m128i a, __m128i b) -{ - asm ("aesdec %1, %0" : "+x"(a) : "xm"(b)); - return a; -} -__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_mm_aesdeclast_si128 (__m128i a, __m128i b) -{ - asm ("aesdeclast %1, %0" : "+x"(a) : "xm"(b)); - return a; -} -NAMESPACE_END -#endif // wmmintrin.h -#endif // CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - -NAMESPACE_BEGIN(CryptoPP) - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 - -#define CRYPTOPP_CPUID_AVAILABLE - -// these should not be used directly -extern CRYPTOPP_DLL bool g_x86DetectionDone; -extern CRYPTOPP_DLL bool g_hasMMX; -extern CRYPTOPP_DLL bool g_hasISSE; -extern CRYPTOPP_DLL bool g_hasSSE2; -extern CRYPTOPP_DLL bool g_hasSSSE3; -extern CRYPTOPP_DLL bool g_hasAESNI; -extern CRYPTOPP_DLL bool g_hasCLMUL; -extern CRYPTOPP_DLL bool g_isP4; -extern CRYPTOPP_DLL bool g_hasRDRAND; -extern CRYPTOPP_DLL bool g_hasRDSEED; -extern CRYPTOPP_DLL word32 g_cacheLineSize; - -CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features(); -CRYPTOPP_DLL bool CRYPTOPP_API CpuId(word32 input, word32 output[4]); - -inline bool HasMMX() -{ -#if CRYPTOPP_BOOL_X64 - return true; -#else - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasMMX; -#endif -} - -inline bool HasISSE() -{ -#if CRYPTOPP_BOOL_X64 - return true; -#else - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasISSE; -#endif -} - -inline bool HasSSE2() -{ -#if CRYPTOPP_BOOL_X64 - return true; -#else - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasSSE2; -#endif -} - -inline bool HasSSSE3() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasSSSE3; -} - -inline bool HasAESNI() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasAESNI; -} - -inline bool HasCLMUL() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasCLMUL; -} - -inline bool IsP4() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_isP4; -} - -inline bool HasRDRAND() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasRDRAND; -} - -inline bool HasRDSEED() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_hasRDSEED; -} - -inline int GetCacheLineSize() -{ - if (!g_x86DetectionDone) - DetectX86Features(); - return g_cacheLineSize; -} - -#else - -inline int GetCacheLineSize() -{ - return CRYPTOPP_L1_CACHE_LINE_SIZE; -} - -#endif - -#endif - -#ifdef CRYPTOPP_GENERATE_X64_MASM - #define AS1(x) x*newline* - #define AS2(x, y) x, y*newline* - #define AS3(x, y, z) x, y, z*newline* - #define ASS(x, y, a, b, c, d) x, y, a*64+b*16+c*4+d*newline* - #define ASL(x) label##x:*newline* - #define ASJ(x, y, z) x label##y*newline* - #define ASC(x, y) x label##y*newline* - #define AS_HEX(y) 0##y##h -#elif defined(_MSC_VER) || defined(__BORLANDC__) - #define CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY - #define AS1(x) __asm {x} - #define AS2(x, y) __asm {x, y} - #define AS3(x, y, z) __asm {x, y, z} - #define ASS(x, y, a, b, c, d) __asm {x, y, (a)*64+(b)*16+(c)*4+(d)} - #define ASL(x) __asm {label##x:} - #define ASJ(x, y, z) __asm {x label##y} - #define ASC(x, y) __asm {x label##y} - #define CRYPTOPP_NAKED __declspec(naked) - #define AS_HEX(y) 0x##y -#else - #define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY - -#if defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) - #define NEW_LINE "\n" - #define INTEL_PREFIX ".intel_syntax;" - #define INTEL_NOPREFIX ".intel_syntax;" - #define ATT_PREFIX ".att_syntax;" - #define ATT_NOPREFIX ".att_syntax;" -#else - #define NEW_LINE - #define INTEL_PREFIX ".intel_syntax prefix;" - #define INTEL_NOPREFIX ".intel_syntax noprefix;" - #define ATT_PREFIX ".att_syntax prefix;" - #define ATT_NOPREFIX ".att_syntax noprefix;" -#endif - - // define these in two steps to allow arguments to be expanded - #define GNU_AS1(x) #x ";" NEW_LINE - #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE - #define GNU_AS3(x, y, z) #x ", " #y ", " #z ";" NEW_LINE - #define GNU_ASL(x) "\n" #x ":" NEW_LINE - #define GNU_ASJ(x, y, z) #x " " #y #z ";" NEW_LINE - #define AS1(x) GNU_AS1(x) - #define AS2(x, y) GNU_AS2(x, y) - #define AS3(x, y, z) GNU_AS3(x, y, z) - #define ASS(x, y, a, b, c, d) #x ", " #y ", " #a "*64+" #b "*16+" #c "*4+" #d ";" - #define ASL(x) GNU_ASL(x) - #define ASJ(x, y, z) GNU_ASJ(x, y, z) - #define ASC(x, y) #x " " #y ";" - #define CRYPTOPP_NAKED - #define AS_HEX(y) 0x##y -#endif - -#define IF0(y) -#define IF1(y) y - -#ifdef CRYPTOPP_GENERATE_X64_MASM -#define ASM_MOD(x, y) ((x) MOD (y)) -#define XMMWORD_PTR XMMWORD PTR -#else -// GNU assembler doesn't seem to have mod operator -#define ASM_MOD(x, y) ((x)-((x)/(y))*(y)) -// GAS 2.15 doesn't support XMMWORD PTR. it seems necessary only for MASM -#define XMMWORD_PTR -#endif - -#if CRYPTOPP_BOOL_X86 - #define AS_REG_1 ecx - #define AS_REG_2 edx - #define AS_REG_3 esi - #define AS_REG_4 edi - #define AS_REG_5 eax - #define AS_REG_6 ebx - #define AS_REG_7 ebp - #define AS_REG_1d ecx - #define AS_REG_2d edx - #define AS_REG_3d esi - #define AS_REG_4d edi - #define AS_REG_5d eax - #define AS_REG_6d ebx - #define AS_REG_7d ebp - #define WORD_SZ 4 - #define WORD_REG(x) e##x - #define WORD_PTR DWORD PTR - #define AS_PUSH_IF86(x) AS1(push e##x) - #define AS_POP_IF86(x) AS1(pop e##x) - #define AS_JCXZ jecxz -#elif CRYPTOPP_BOOL_X32 - #define AS_REG_1 ecx - #define AS_REG_2 edx - #define AS_REG_3 r8d - #define AS_REG_4 r9d - #define AS_REG_5 eax - #define AS_REG_6 r10d - #define AS_REG_7 r11d - #define AS_REG_1d ecx - #define AS_REG_2d edx - #define AS_REG_3d r8d - #define AS_REG_4d r9d - #define AS_REG_5d eax - #define AS_REG_6d r10d - #define AS_REG_7d r11d - #define WORD_SZ 4 - #define WORD_REG(x) e##x - #define WORD_PTR DWORD PTR - #define AS_PUSH_IF86(x) AS1(push r##x) - #define AS_POP_IF86(x) AS1(pop r##x) - #define AS_JCXZ jecxz -#elif CRYPTOPP_BOOL_X64 - #ifdef CRYPTOPP_GENERATE_X64_MASM - #define AS_REG_1 rcx - #define AS_REG_2 rdx - #define AS_REG_3 r8 - #define AS_REG_4 r9 - #define AS_REG_5 rax - #define AS_REG_6 r10 - #define AS_REG_7 r11 - #define AS_REG_1d ecx - #define AS_REG_2d edx - #define AS_REG_3d r8d - #define AS_REG_4d r9d - #define AS_REG_5d eax - #define AS_REG_6d r10d - #define AS_REG_7d r11d - #else - #define AS_REG_1 rdi - #define AS_REG_2 rsi - #define AS_REG_3 rdx - #define AS_REG_4 rcx - #define AS_REG_5 r8 - #define AS_REG_6 r9 - #define AS_REG_7 r10 - #define AS_REG_1d edi - #define AS_REG_2d esi - #define AS_REG_3d edx - #define AS_REG_4d ecx - #define AS_REG_5d r8d - #define AS_REG_6d r9d - #define AS_REG_7d r10d - #endif - #define WORD_SZ 8 - #define WORD_REG(x) r##x - #define WORD_PTR QWORD PTR - #define AS_PUSH_IF86(x) - #define AS_POP_IF86(x) - #define AS_JCXZ jrcxz -#endif - -// helper macro for stream cipher output -#define AS_XMM_OUTPUT4(labelPrefix, inputPtr, outputPtr, x0, x1, x2, x3, t, p0, p1, p2, p3, increment)\ - AS2( test inputPtr, inputPtr)\ - ASC( jz, labelPrefix##3)\ - AS2( test inputPtr, 15)\ - ASC( jnz, labelPrefix##7)\ - AS2( pxor xmm##x0, [inputPtr+p0*16])\ - AS2( pxor xmm##x1, [inputPtr+p1*16])\ - AS2( pxor xmm##x2, [inputPtr+p2*16])\ - AS2( pxor xmm##x3, [inputPtr+p3*16])\ - AS2( add inputPtr, increment*16)\ - ASC( jmp, labelPrefix##3)\ - ASL(labelPrefix##7)\ - AS2( movdqu xmm##t, [inputPtr+p0*16])\ - AS2( pxor xmm##x0, xmm##t)\ - AS2( movdqu xmm##t, [inputPtr+p1*16])\ - AS2( pxor xmm##x1, xmm##t)\ - AS2( movdqu xmm##t, [inputPtr+p2*16])\ - AS2( pxor xmm##x2, xmm##t)\ - AS2( movdqu xmm##t, [inputPtr+p3*16])\ - AS2( pxor xmm##x3, xmm##t)\ - AS2( add inputPtr, increment*16)\ - ASL(labelPrefix##3)\ - AS2( test outputPtr, 15)\ - ASC( jnz, labelPrefix##8)\ - AS2( movdqa [outputPtr+p0*16], xmm##x0)\ - AS2( movdqa [outputPtr+p1*16], xmm##x1)\ - AS2( movdqa [outputPtr+p2*16], xmm##x2)\ - AS2( movdqa [outputPtr+p3*16], xmm##x3)\ - ASC( jmp, labelPrefix##9)\ - ASL(labelPrefix##8)\ - AS2( movdqu [outputPtr+p0*16], xmm##x0)\ - AS2( movdqu [outputPtr+p1*16], xmm##x1)\ - AS2( movdqu [outputPtr+p2*16], xmm##x2)\ - AS2( movdqu [outputPtr+p3*16], xmm##x3)\ - ASL(labelPrefix##9)\ - AS2( add outputPtr, increment*16) - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/crc.cpp b/external/crypto++-5.6.3/crc.cpp deleted file mode 100644 index 10c25c257..000000000 --- a/external/crypto++-5.6.3/crc.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// crc.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "crc.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -/* Table of CRC-32's of all single byte values (made by makecrc.c) */ -const word32 CRC32::m_tab[] = { -#ifdef IS_LITTLE_ENDIAN - 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, - 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, - 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, - 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, - 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, - 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, - 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, - 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, - 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, - 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, - 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, - 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, - 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, - 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, - 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, - 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, - 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, - 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, - 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, - 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, - 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, - 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, - 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, - 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, - 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, - 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, - 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, - 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, - 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, - 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, - 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, - 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, - 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, - 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, - 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, - 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, - 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, - 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, - 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, - 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, - 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, - 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, - 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, - 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, - 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, - 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, - 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, - 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, - 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, - 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, - 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, - 0x2d02ef8dL -#else - 0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L, - 0x8ff46a70L, 0x35a563e9L, 0xa395649eL, 0x3288db0eL, 0xa4b8dc79L, - 0x1ee9d5e0L, 0x88d9d297L, 0x2b4cb609L, 0xbd7cb17eL, 0x072db8e7L, - 0x911dbf90L, 0x6410b71dL, 0xf220b06aL, 0x4871b9f3L, 0xde41be84L, - 0x7dd4da1aL, 0xebe4dd6dL, 0x51b5d4f4L, 0xc785d383L, 0x56986c13L, - 0xc0a86b64L, 0x7af962fdL, 0xecc9658aL, 0x4f5c0114L, 0xd96c0663L, - 0x633d0ffaL, 0xf50d088dL, 0xc8206e3bL, 0x5e10694cL, 0xe44160d5L, - 0x727167a2L, 0xd1e4033cL, 0x47d4044bL, 0xfd850dd2L, 0x6bb50aa5L, - 0xfaa8b535L, 0x6c98b242L, 0xd6c9bbdbL, 0x40f9bcacL, 0xe36cd832L, - 0x755cdf45L, 0xcf0dd6dcL, 0x593dd1abL, 0xac30d926L, 0x3a00de51L, - 0x8051d7c8L, 0x1661d0bfL, 0xb5f4b421L, 0x23c4b356L, 0x9995bacfL, - 0x0fa5bdb8L, 0x9eb80228L, 0x0888055fL, 0xb2d90cc6L, 0x24e90bb1L, - 0x877c6f2fL, 0x114c6858L, 0xab1d61c1L, 0x3d2d66b6L, 0x9041dc76L, - 0x0671db01L, 0xbc20d298L, 0x2a10d5efL, 0x8985b171L, 0x1fb5b606L, - 0xa5e4bf9fL, 0x33d4b8e8L, 0xa2c90778L, 0x34f9000fL, 0x8ea80996L, - 0x18980ee1L, 0xbb0d6a7fL, 0x2d3d6d08L, 0x976c6491L, 0x015c63e6L, - 0xf4516b6bL, 0x62616c1cL, 0xd8306585L, 0x4e0062f2L, 0xed95066cL, - 0x7ba5011bL, 0xc1f40882L, 0x57c40ff5L, 0xc6d9b065L, 0x50e9b712L, - 0xeab8be8bL, 0x7c88b9fcL, 0xdf1ddd62L, 0x492dda15L, 0xf37cd38cL, - 0x654cd4fbL, 0x5861b24dL, 0xce51b53aL, 0x7400bca3L, 0xe230bbd4L, - 0x41a5df4aL, 0xd795d83dL, 0x6dc4d1a4L, 0xfbf4d6d3L, 0x6ae96943L, - 0xfcd96e34L, 0x468867adL, 0xd0b860daL, 0x732d0444L, 0xe51d0333L, - 0x5f4c0aaaL, 0xc97c0dddL, 0x3c710550L, 0xaa410227L, 0x10100bbeL, - 0x86200cc9L, 0x25b56857L, 0xb3856f20L, 0x09d466b9L, 0x9fe461ceL, - 0x0ef9de5eL, 0x98c9d929L, 0x2298d0b0L, 0xb4a8d7c7L, 0x173db359L, - 0x810db42eL, 0x3b5cbdb7L, 0xad6cbac0L, 0x2083b8edL, 0xb6b3bf9aL, - 0x0ce2b603L, 0x9ad2b174L, 0x3947d5eaL, 0xaf77d29dL, 0x1526db04L, - 0x8316dc73L, 0x120b63e3L, 0x843b6494L, 0x3e6a6d0dL, 0xa85a6a7aL, - 0x0bcf0ee4L, 0x9dff0993L, 0x27ae000aL, 0xb19e077dL, 0x44930ff0L, - 0xd2a30887L, 0x68f2011eL, 0xfec20669L, 0x5d5762f7L, 0xcb676580L, - 0x71366c19L, 0xe7066b6eL, 0x761bd4feL, 0xe02bd389L, 0x5a7ada10L, - 0xcc4add67L, 0x6fdfb9f9L, 0xf9efbe8eL, 0x43beb717L, 0xd58eb060L, - 0xe8a3d6d6L, 0x7e93d1a1L, 0xc4c2d838L, 0x52f2df4fL, 0xf167bbd1L, - 0x6757bca6L, 0xdd06b53fL, 0x4b36b248L, 0xda2b0dd8L, 0x4c1b0aafL, - 0xf64a0336L, 0x607a0441L, 0xc3ef60dfL, 0x55df67a8L, 0xef8e6e31L, - 0x79be6946L, 0x8cb361cbL, 0x1a8366bcL, 0xa0d26f25L, 0x36e26852L, - 0x95770cccL, 0x03470bbbL, 0xb9160222L, 0x2f260555L, 0xbe3bbac5L, - 0x280bbdb2L, 0x925ab42bL, 0x046ab35cL, 0xa7ffd7c2L, 0x31cfd0b5L, - 0x8b9ed92cL, 0x1daede5bL, 0xb0c2649bL, 0x26f263ecL, 0x9ca36a75L, - 0x0a936d02L, 0xa906099cL, 0x3f360eebL, 0x85670772L, 0x13570005L, - 0x824abf95L, 0x147ab8e2L, 0xae2bb17bL, 0x381bb60cL, 0x9b8ed292L, - 0x0dbed5e5L, 0xb7efdc7cL, 0x21dfdb0bL, 0xd4d2d386L, 0x42e2d4f1L, - 0xf8b3dd68L, 0x6e83da1fL, 0xcd16be81L, 0x5b26b9f6L, 0xe177b06fL, - 0x7747b718L, 0xe65a0888L, 0x706a0fffL, 0xca3b0666L, 0x5c0b0111L, - 0xff9e658fL, 0x69ae62f8L, 0xd3ff6b61L, 0x45cf6c16L, 0x78e20aa0L, - 0xeed20dd7L, 0x5483044eL, 0xc2b30339L, 0x612667a7L, 0xf71660d0L, - 0x4d476949L, 0xdb776e3eL, 0x4a6ad1aeL, 0xdc5ad6d9L, 0x660bdf40L, - 0xf03bd837L, 0x53aebca9L, 0xc59ebbdeL, 0x7fcfb247L, 0xe9ffb530L, - 0x1cf2bdbdL, 0x8ac2bacaL, 0x3093b353L, 0xa6a3b424L, 0x0536d0baL, - 0x9306d7cdL, 0x2957de54L, 0xbf67d923L, 0x2e7a66b3L, 0xb84a61c4L, - 0x021b685dL, 0x942b6f2aL, 0x37be0bb4L, 0xa18e0cc3L, 0x1bdf055aL, - 0x8def022dL -#endif -}; - -CRC32::CRC32() -{ - Reset(); -} - -void CRC32::Update(const byte *s, size_t n) -{ - word32 crc = m_crc; - - for(; !IsAligned(s) && n > 0; n--) - crc = m_tab[CRC32_INDEX(crc) ^ *s++] ^ CRC32_SHIFTED(crc); - - while (n >= 4) - { - crc ^= *(const word32 *)s; - crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); - crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); - crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); - crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc); - n -= 4; - s += 4; - } - - while (n--) - crc = m_tab[CRC32_INDEX(crc) ^ *s++] ^ CRC32_SHIFTED(crc); - - m_crc = crc; -} - -void CRC32::TruncatedFinal(byte *hash, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - m_crc ^= CRC32_NEGL; - for (size_t i=0; i> 8) -#else -#define CRC32_INDEX(c) (c >> 24) -#define CRC32_SHIFTED(c) (c << 8) -#endif - -//! CRC Checksum Calculation -class CRC32 : public HashTransformation -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 4) - CRC32(); - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *hash, size_t size); - unsigned int DigestSize() const {return DIGESTSIZE;} - static const char * StaticAlgorithmName() {return "CRC32";} - std::string AlgorithmName() const {return StaticAlgorithmName();} - - void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);} - byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];} - -private: - void Reset() {m_crc = CRC32_NEGL;} - - static const word32 m_tab[256]; - word32 m_crc; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/cryptdll.dsp b/external/crypto++-5.6.3/cryptdll.dsp deleted file mode 100644 index 868241421..000000000 --- a/external/crypto++-5.6.3/cryptdll.dsp +++ /dev/null @@ -1,606 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cryptdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=cryptdll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cryptdll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cryptdll.mak" CFG="cryptdll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cryptdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "cryptdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cryptdll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptdll___Win32_Release" -# PROP BASE Intermediate_Dir "cryptdll___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "DLL_Release" -# PROP Intermediate_Dir "DLL_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTDLL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /G5 /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTOPP_EXPORTS" /D CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1 /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /Zm200 /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /dll /machine:I386 -# ADD LINK32 advapi32.lib /nologo /base:"0x42900000" /dll /map /debug /machine:I386 /out:"DLL_Release/cryptopp.dll" /opt:ref -# SUBTRACT LINK32 /pdb:none -# Begin Custom Build -OutDir=.\DLL_Release -TargetPath=.\DLL_Release\cryptopp.dll -InputPath=.\DLL_Release\cryptopp.dll -SOURCE="$(InputPath)" - -"$(OutDir)\cryptopp.mac.done" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - CTRelease\cryptest mac_dll $(TargetPath) - echo mac done > $(OutDir)\cryptopp.mac.done - -# End Custom Build - -!ELSEIF "$(CFG)" == "cryptdll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptdll___Win32_Debug" -# PROP BASE Intermediate_Dir "cryptdll___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DLL_Debug" -# PROP Intermediate_Dir "DLL_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTDLL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /G5 /MTd /W3 /Gm /GR /GX /Zi /Oi /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRYPTOPP_EXPORTS" /D CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1 /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /GZ /Zm200 /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib /nologo /base:"0x42900000" /dll /incremental:no /debug /machine:I386 /out:"DLL_Debug/cryptopp.dll" /opt:ref -# SUBTRACT LINK32 /pdb:none -# Begin Custom Build -OutDir=.\DLL_Debug -TargetPath=.\DLL_Debug\cryptopp.dll -InputPath=.\DLL_Debug\cryptopp.dll -SOURCE="$(InputPath)" - -"$(OutDir)\cryptopp.mac.done" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - CTDebug\cryptest mac_dll $(TargetPath) - echo mac done > $(OutDir)\cryptopp.mac.done - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "cryptdll - Win32 Release" -# Name "cryptdll - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\algebra.cpp -# End Source File -# Begin Source File - -SOURCE=.\algparam.cpp -# End Source File -# Begin Source File - -SOURCE=.\asn.cpp -# End Source File -# Begin Source File - -SOURCE=.\authenc.cpp -# End Source File -# Begin Source File - -SOURCE=.\basecode.cpp -# End Source File -# Begin Source File - -SOURCE=.\cbcmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\ccm.cpp -# End Source File -# Begin Source File - -SOURCE=.\channels.cpp -# End Source File -# Begin Source File - -SOURCE=.\cmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\cpu.cpp -# End Source File -# Begin Source File - -SOURCE=.\cryptlib.cpp -# End Source File -# Begin Source File - -SOURCE=.\des.cpp -# End Source File -# Begin Source File - -SOURCE=.\dessp.cpp -# End Source File -# Begin Source File - -SOURCE=.\dh.cpp -# End Source File -# Begin Source File - -SOURCE=.\dll.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=.\dsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\ec2n.cpp -# End Source File -# Begin Source File - -SOURCE=.\eccrypto.cpp -# End Source File -# Begin Source File - -SOURCE=.\ecp.cpp -# End Source File -# Begin Source File - -SOURCE=.\emsa2.cpp -# End Source File -# Begin Source File - -SOURCE=.\eprecomp.cpp -# End Source File -# Begin Source File - -SOURCE=.\files.cpp -# End Source File -# Begin Source File - -SOURCE=.\filters.cpp -# End Source File -# Begin Source File - -SOURCE=.\fips140.cpp -# End Source File -# Begin Source File - -SOURCE=.\fipstest.cpp -# End Source File -# Begin Source File - -SOURCE=.\gcm.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf2n.cpp -# End Source File -# Begin Source File - -SOURCE=.\gfpcrypt.cpp -# End Source File -# Begin Source File - -SOURCE=.\hex.cpp -# End Source File -# Begin Source File - -SOURCE=.\hmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\hrtimer.cpp -# End Source File -# Begin Source File - -SOURCE=.\integer.cpp -# End Source File -# Begin Source File - -SOURCE=.\iterhash.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=.\misc.cpp -# End Source File -# Begin Source File - -SOURCE=.\modes.cpp -# End Source File -# Begin Source File - -SOURCE=.\mqueue.cpp -# End Source File -# Begin Source File - -SOURCE=.\nbtheory.cpp -# End Source File -# Begin Source File - -SOURCE=.\oaep.cpp -# End Source File -# Begin Source File - -SOURCE=.\osrng.cpp -# End Source File -# Begin Source File - -SOURCE=.\pch.cpp -# ADD CPP /Yc"pch.h" -# End Source File -# Begin Source File - -SOURCE=.\pkcspad.cpp -# End Source File -# Begin Source File - -SOURCE=.\pssr.cpp -# End Source File -# Begin Source File - -SOURCE=.\pubkey.cpp -# End Source File -# Begin Source File - -SOURCE=.\queue.cpp -# End Source File -# Begin Source File - -SOURCE=.\randpool.cpp -# End Source File -# Begin Source File - -SOURCE=.\rdtables.cpp -# End Source File -# Begin Source File - -SOURCE=.\rijndael.cpp -# End Source File -# Begin Source File - -SOURCE=.\rng.cpp -# End Source File -# Begin Source File - -SOURCE=.\rsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\rw.cpp -# End Source File -# Begin Source File - -SOURCE=.\sha.cpp -# End Source File -# Begin Source File - -SOURCE=.\sha3.cpp -# End Source File -# Begin Source File - -SOURCE=.\simple.cpp -# End Source File -# Begin Source File - -SOURCE=.\skipjack.cpp -# End Source File -# Begin Source File - -SOURCE=.\strciphr.cpp -# End Source File -# Begin Source File - -SOURCE=.\trdlocal.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\aes.h -# End Source File -# Begin Source File - -SOURCE=.\algebra.h -# End Source File -# Begin Source File - -SOURCE=.\algparam.h -# End Source File -# Begin Source File - -SOURCE=.\argnames.h -# End Source File -# Begin Source File - -SOURCE=.\asn.h -# End Source File -# Begin Source File - -SOURCE=.\authenc.h -# End Source File -# Begin Source File - -SOURCE=.\basecode.h -# End Source File -# Begin Source File - -SOURCE=.\cbcmac.h -# End Source File -# Begin Source File - -SOURCE=.\ccm.h -# End Source File -# Begin Source File - -SOURCE=.\channels.h -# End Source File -# Begin Source File - -SOURCE=.\cmac.h -# End Source File -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=.\cryptlib.h -# End Source File -# Begin Source File - -SOURCE=.\des.h -# End Source File -# Begin Source File - -SOURCE=.\dh.h -# End Source File -# Begin Source File - -SOURCE=.\dll.h -# End Source File -# Begin Source File - -SOURCE=.\dsa.h -# End Source File -# Begin Source File - -SOURCE=.\ec2n.h -# End Source File -# Begin Source File - -SOURCE=.\eccrypto.h -# End Source File -# Begin Source File - -SOURCE=.\ecp.h -# End Source File -# Begin Source File - -SOURCE=.\eprecomp.h -# End Source File -# Begin Source File - -SOURCE=.\files.h -# End Source File -# Begin Source File - -SOURCE=.\filters.h -# End Source File -# Begin Source File - -SOURCE=.\fips140.h -# End Source File -# Begin Source File - -SOURCE=.\fltrimpl.h -# End Source File -# Begin Source File - -SOURCE=.\gcm.h -# End Source File -# Begin Source File - -SOURCE=.\gf2n.h -# End Source File -# Begin Source File - -SOURCE=.\gfpcrypt.h -# End Source File -# Begin Source File - -SOURCE=.\hex.h -# End Source File -# Begin Source File - -SOURCE=.\hkdf.h -# End Source File -# Begin Source File - -SOURCE=.\hmac.h -# End Source File -# Begin Source File - -SOURCE=.\integer.h -# End Source File -# Begin Source File - -SOURCE=.\iterhash.h -# End Source File -# Begin Source File - -SOURCE=.\mdc.h -# End Source File -# Begin Source File - -SOURCE=.\misc.h -# End Source File -# Begin Source File - -SOURCE=.\modarith.h -# End Source File -# Begin Source File - -SOURCE=.\modes.h -# End Source File -# Begin Source File - -SOURCE=.\modexppc.h -# End Source File -# Begin Source File - -SOURCE=.\mqueue.h -# End Source File -# Begin Source File - -SOURCE=.\mqv.h -# End Source File -# Begin Source File - -SOURCE=.\nbtheory.h -# End Source File -# Begin Source File - -SOURCE=.\oaep.h -# End Source File -# Begin Source File - -SOURCE=.\oids.h -# End Source File -# Begin Source File - -SOURCE=.\osrng.h -# End Source File -# Begin Source File - -SOURCE=.\pch.h -# End Source File -# Begin Source File - -SOURCE=.\pkcspad.h -# End Source File -# Begin Source File - -SOURCE=.\pubkey.h -# End Source File -# Begin Source File - -SOURCE=.\queue.h -# End Source File -# Begin Source File - -SOURCE=.\randpool.h -# End Source File -# Begin Source File - -SOURCE=.\rijndael.h -# End Source File -# Begin Source File - -SOURCE=.\rng.h -# End Source File -# Begin Source File - -SOURCE=.\rsa.h -# End Source File -# Begin Source File - -SOURCE=.\secblock.h -# End Source File -# Begin Source File - -SOURCE=.\seckey.h -# End Source File -# Begin Source File - -SOURCE=.\sha.h -# End Source File -# Begin Source File - -SOURCE=.\sha3.h -# End Source File -# Begin Source File - -SOURCE=.\simple.h -# End Source File -# Begin Source File - -SOURCE=.\skipjack.h -# End Source File -# Begin Source File - -SOURCE=.\smartptr.h -# End Source File -# Begin Source File - -SOURCE=.\stdcpp.h -# End Source File -# Begin Source File - -SOURCE=.\strciphr.h -# End Source File -# Begin Source File - -SOURCE=.\trdlocal.h -# End Source File -# Begin Source File - -SOURCE=.\words.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\cryptopp.rc -# End Source File -# End Target -# End Project diff --git a/external/crypto++-5.6.3/cryptdll.vcproj b/external/crypto++-5.6.3/cryptdll.vcproj deleted file mode 100644 index 18744face..000000000 --- a/external/crypto++-5.6.3/cryptdll.vcproj +++ /dev/null @@ -1,2639 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/external/crypto++-5.6.3/cryptest.dsp b/external/crypto++-5.6.3/cryptest.dsp deleted file mode 100644 index 4e3f2721e..000000000 --- a/external/crypto++-5.6.3/cryptest.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cryptest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=cryptest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cryptest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cryptest.mak" CFG="cryptest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cryptest - Win32 DLL-Import Release" (based on "Win32 (x86) Console Application") -!MESSAGE "cryptest - Win32 DLL-Import Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "cryptest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "cryptest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cryptest - Win32 DLL-Import Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptest___Win32_FIPS_140_Release" -# PROP BASE Intermediate_Dir "cryptest___Win32_FIPS_140_Release" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "CT_DLL_Import_Release" -# PROP Intermediate_Dir "CT_DLL_Import_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c -# ADD CPP /nologo /G5 /Gz /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "CRYPTOPP_IMPORTS" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm400 /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /OPT:NOWIN98 -# ADD LINK32 Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"DLL_Release/cryptest.exe" /libpath:"DLL_Release" /OPT:NOWIN98 /OPT:REF /OPT:ICF -# SUBTRACT LINK32 /pdb:none /incremental:yes -# Begin Special Build Tool -SOURCE="$(InputPath)" -PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build it yourself using the cryptdll project, or echo obtain a pre-built, FIPS 140-2 validated DLL. If you build it yourself echo the resulting DLL will not be considered FIPS validated echo unless it undergoes FIPS validation. -# End Special Build Tool - -!ELSEIF "$(CFG)" == "cryptest - Win32 DLL-Import Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptest___Win32_FIPS_140_Debug" -# PROP BASE Intermediate_Dir "cryptest___Win32_FIPS_140_Debug" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "CT_DLL_Import_Debug" -# PROP Intermediate_Dir "CT_DLL_Import_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c -# ADD CPP /nologo /G5 /Gz /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "CRYPTOPP_IMPORTS" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm400 /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /OPT:NOWIN98 -# ADD LINK32 Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"DLL_Debug/cryptest.exe" /pdbtype:sept /libpath:"DLL_Debug" /OPT:NOWIN98 -# Begin Special Build Tool -SOURCE="$(InputPath)" -PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build it yourself using the cryptdll project, or echo obtain a pre-built, FIPS 140-2 validated DLL. If you build it yourself echo the resulting DLL will not be considered FIPS validated echo unless it undergoes FIPS validation. -# End Special Build Tool - -!ELSEIF "$(CFG)" == "cryptest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptes0" -# PROP BASE Intermediate_Dir "cryptes0" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "CTRelease" -# PROP Intermediate_Dir "CTRelease" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /YX /FD /Zm400 /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 advapi32.lib Ws2_32.lib /nologo /subsystem:console /map /debug /machine:I386 /OPT:NOWIN98 /OPT:REF /OPT:ICF -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "cryptest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptes1" -# PROP BASE Intermediate_Dir "cryptes1" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "CTDebug" -# PROP Intermediate_Dir "CTDebug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /YX /FD /Zm400 /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /OPT:NOWIN98 -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "cryptest - Win32 DLL-Import Release" -# Name "cryptest - Win32 DLL-Import Debug" -# Name "cryptest - Win32 Release" -# Name "cryptest - Win32 Debug" -# Begin Group "Source Code" - -# PROP Default_Filter ".cpp;.h" -# Begin Source File - -SOURCE=.\adhoc.cpp -# End Source File -# Begin Source File - -SOURCE=.\bench.cpp -# End Source File -# Begin Source File - -SOURCE=.\bench.h -# End Source File -# Begin Source File - -SOURCE=.\bench2.cpp -# End Source File -# Begin Source File - -SOURCE=.\datatest.cpp -# End Source File -# Begin Source File - -SOURCE=.\dlltest.cpp -# End Source File -# Begin Source File - -SOURCE=.\fipsalgt.cpp -# End Source File -# Begin Source File - -SOURCE=.\regtest.cpp -# End Source File -# Begin Source File - -SOURCE=.\test.cpp -# End Source File -# Begin Source File - -SOURCE=.\validat1.cpp -# End Source File -# Begin Source File - -SOURCE=.\validat2.cpp -# End Source File -# Begin Source File - -SOURCE=.\validat3.cpp -# End Source File -# Begin Source File - -SOURCE=.\validate.h -# End Source File -# End Group -# End Target -# End Project diff --git a/external/crypto++-5.6.3/cryptest.dsw b/external/crypto++-5.6.3/cryptest.dsw deleted file mode 100644 index 40c0adc80..000000000 --- a/external/crypto++-5.6.3/cryptest.dsw +++ /dev/null @@ -1,74 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "cryptdll"=.\cryptdll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name cryptest - End Project Dependency -}}} - -############################################################################### - -Project: "cryptest"=.\cryptest.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name cryptlib - End Project Dependency -}}} - -############################################################################### - -Project: "cryptlib"=.\cryptlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dlltest"=.\dlltest.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name cryptdll - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/external/crypto++-5.6.3/cryptest.sh b/external/crypto++-5.6.3/cryptest.sh deleted file mode 100644 index b4321601f..000000000 --- a/external/crypto++-5.6.3/cryptest.sh +++ /dev/null @@ -1,839 +0,0 @@ -#!/bin/bash - -# cryptest.sh - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. -# Copyright assigned to Crypto++ project. - -# This is a test script that can be used on some Linux/Unix/Apple machines -# to automate building the library and running the self test with various -# combinations of flags, options, and conditions. - -# Everything is tee'd into cryptest-result.txt. Change it to suite your taste. You -# should be able to use `egrep -a "(Error|error|FAILED|Illegal)" cryptest-result.txt` -# to quickly find errors and failures. - -# Set to suite your taste -TEST_RESULTS=cryptest-result.txt -BENCHMARK_RESULTS=cryptest-bench.txt -WARN_TEST_RESULTS=cryptest-warn-result.txt - -# Respect user's preferred flags, but filter the stuff we expliclty test -#if [ ! -z "CXXFLAGS" ]; then -# ADD_CXXFLAGS=$(echo "$CXXFLAGS" | sed 's/\(-DDEBUG\|-DNDEBUG\|-O[0-9]\|-Os\|-Og\|-fsanitize=address\|-fsanitize=undefined\|-DDCRYPTOPP_NO_UNALIGNED_DATA_ACCESS\|-DDCRYPTOPP_NO_UNALIGNED_DATA_ACCESS\|-DDCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562\)//g') -#else\ -# ADD_CXXFLAGS="" -#fi - -# I can't seem to get the expression to work in sed on Apple. It returns the original CXXFLAGS. -# If you want to test with additional flags, then put them in ADD_CXXFLAGS below. -# ADD_CXXFLAGS="-mrdrnd -mrdseed" -ADD_CXXFLAGS="" - -IS_DARWIN=$(uname -s | grep -i -c darwin) -IS_LINUX=$(uname -s | grep -i -c linux) -IS_CYGWIN=$(uname -s | grep -i -c cygwin) -IS_MINGW=$(uname -s | grep -i -c mingw) -IS_OPENBSD=$(uname -s | grep -i -c openbsd) - -# We need to use the C++ compiler to determine if c++11 is available. Otherwise -# a mis-detection occurs on Mac OS X 10.9 and above. Below, we use the same -# Implicit Variables as make. Also see -# https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html -if [ -z "$CXX" ]; then - if [ "$IS_DARWIN" -ne "0" ]; then - CXX=c++ - else - # Linux, MinGW, Cygwin and fallback ... - CXX=g++ - fi -fi - -# Fixup -if [ "$CXX" == "gcc" ]; then - CXX=g++ -fi - -# Fixup -if [ "$IS_OPENBSD" -ne "0" ]; then - MAKE=gmake -else - MAKE=make -fi - -if [ -z "$TMP" ]; then - TMP=/tmp -fi - -# Use the compiler driver, and not cpp, to tell us if the flag is consumed. -$CXX -x c++ -dM -E -std=c++11 - < /dev/null > /dev/null 2>&1 -if [ "$?" -eq "0" ]; then - HAVE_CXX11=1 -else - HAVE_CXX11=0 -fi - -# OpenBSD 5.7 and OS X 10.5 cannot consume -std=c++03 -$CXX -x c++ -dM -E -std=c++03 - < /dev/null > /dev/null 2>&1 -if [ "$?" -eq "0" ]; then - HAVE_CXX03=1 -else - HAVE_CXX03=0 -fi - -# Set to 0 if you don't have UBsan -$CXX -x c++ -fsanitize=undefined adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1 -if [ "$?" -eq "0" ]; then - HAVE_UBSAN=1 -else - HAVE_UBSAN=0 -fi - -# Fixup... -if [ "$IS_CYGWIN" -ne "0" ] || [ "$IS_MINGW" -ne "0" ]; then - HAVE_UBSAN=0 -fi - -# Set to 0 if you don't have Asan -$CXX -x c++ -fsanitize=undefined adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1 -if [ "$?" -eq "0" ]; then - HAVE_ASAN=1 -else - HAVE_ASAN=0 -fi - -# Fixup... -if [ "$IS_CYGWIN" -ne "0" ] || [ "$IS_MINGW" -ne "0" ]; then - HAVE_ASAN=0 -fi - -#Final fixups for compilers liek GCC on ARM64 -if [ "$HAVE_UBSAN" -eq "0" ] || [ "$HAVE_ASAN" -eq "0" ]; then - HAVE_UBAN=0 - HAVE_ASAN=0 -fi - -# Set to 0 if you don't have Valgrind. Valgrind tests take a long time... -HAVE_VALGRIND=$(which valgrind 2>&1 | grep -v "no valgrind" | grep -i -c valgrind) - -# Echo back to ensure something is not missed. -echo -echo "HAVE_CXX03: $HAVE_CXX03" -echo "HAVE_CXX11: $HAVE_CXX11" -echo "HAVE_ASAN: $HAVE_ASAN" -echo "HAVE_UBSAN: $HAVE_UBSAN" - -if [ "$HAVE_VALGRIND" -ne "0" ]; then - echo "HAVE_VALGRIND: $HAVE_VALGRIND" -fi -if [ "$IS_DARWIN" -ne "0" ]; then - echo "IS_DARWIN: $IS_DARWIN" - unset MallocScribble MallocPreScribble MallocGuardEdges -fi -if [ "$IS_LINUX" -ne "0" ]; then - echo "IS_LINUX: $IS_LINUX" -fi -if [ "$IS_CYGWIN" -ne "0" ]; then - echo "IS_CYGWIN: $IS_CYGWIN" -fi -if [ "$IS_MINGW" -ne "0" ]; then - echo "IS_MINGW: $IS_MINGW" -fi - -echo "User CXXFLAGS: $CXXFLAGS" -echo "Retained CXXFLAGS: $ADD_CXXFLAGS" -echo "Compiler:" $($CXX --version | head -1) - -TEST_BEGIN=$(date) -echo -echo "Start time: $TEST_BEGIN" - -############################################ -############################################ - -# Remove previous test results -rm -f "$TEST_RESULTS" > /dev/null 2>&1 -touch "$TEST_RESULTS" - -rm -f "$BENCHMARK_RESULTS" > /dev/null 2>&1 -touch "$BENCHMARK_RESULTS" - -rm -f "$WARN_RESULTS" > /dev/null 2>&1 -touch "$WARN_RESULTS" - -############################################ -# Basic debug build -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, default CXXFLAGS" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -O2" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Basic release build -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, default CXXFLAGS" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Basic debug build, DISABLE_ASM -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, default CXXFLAGS, DISABLE_ASM" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -O2 -DCRYPTOPP_DISABLE_ASM" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Basic release build, DISABLE_ASM -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, default CXXFLAGS, DISABLE_ASM" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_DISABLE_ASM" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# c++03 debug build -if [ "$HAVE_CXX03" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: debug, c++03" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# c++03 release build -if [ "$HAVE_CXX03" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: release, c++03" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# c++11 debug build -if [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: debug, c++11" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# c++11 release build -if [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: release, c++11" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Debug build, all backwards compatibility. -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, MAINTAIN_BACKWARDS_COMPATIBILITY" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -O2 -DCRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build, all backwards compatibility. -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, MAINTAIN_BACKWARDS_COMPATIBILITY" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Debug build, init_priority -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, INIT_PRIORITY" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -O1 -DCRYPTOPP_INIT_PRIORITY=250 $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build, init_priority -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, INIT_PRIORITY" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_INIT_PRIORITY=250 $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build, no unaligned data access -# This test will not be needed in Crypto++ 5.7 and above -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, NO_UNALIGNED_DATA_ACCESS" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build, no backwards compatibility with Crypto++ 5.6.2. -# This test will not be needed in Crypto++ 5.7 and above -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, NO_BACKWARDS_COMPATIBILITY_562" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Debug build, OS Independence -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, NO_OS_DEPENDENCE" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -O1 -DNO_OS_DEPENDENCE $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build, OS Independence -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, NO_OS_DEPENDENCE" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O2 -DNO_OS_DEPENDENCE $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Debug build at -O3 -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, -O3 optimizations" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -O3 $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build at -O3 -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, -O3 optimizations" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -O3 $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Debug build at -Os -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: debug, -Os optimizations" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DDEBUG -g2 -Os $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Release build at -Os -echo -echo "************************************" | tee -a "$TEST_RESULTS" -echo "Testing: release, -Os optimizations" | tee -a "$TEST_RESULTS" -echo - -unset CXXFLAGS -"$MAKE" clean > /dev/null 2>&1 -export CXXFLAGS="-DNDEBUG -g2 -Os $ADD_CXXFLAGS" -"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" -./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - -############################################ -# Debug build, UBSan, c++03 -if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_UBSAN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: debug, c++03, UBsan" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DDEBUG -g2 -O1 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" ubsan | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Release build, UBSan, c++03 -if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_UBSAN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: release, c++03, UBsan" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" ubsan | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Debug build, Asan, c++03 -if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_ASAN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: debug, c++03, Asan" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DDEBUG -g2 -O1 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" asan | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Release build, Asan, c++03 -if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_ASAN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: release, c++03, Asan" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" asan | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Release build, UBSan, c++11 -if [ "$HAVE_CXX11" -ne "0" ] && [ "$HAVE_UBSAN" -ne "0" ]; then - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: c++11, UBsan" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" ubsan | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Release build, Asan, c++11 -if [ "$HAVE_CXX11" -ne "0" ] && [ "$HAVE_ASAN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: c++11, Asan" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" asan | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -# For Darwin, we need to test both -stdlib=libstdc++ (GNU) and -# -stdlib=libc++ (LLVM) crossed with -std=c++03 and -std=c++11. - -############################################ -# Darwin, c++03, libc++ -if [ "$HAVE_CXX03" -ne "0" ] && [ "$IS_DARWIN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Darwin, c++03, libc++ (LLVM)" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 -stdlib=libc++ $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Darwin, c++03, libstdc++ -if [ "$HAVE_CXX03" -ne "0" ] && [ "$IS_DARWIN" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Darwin, c++03, libstdc++ (GNU)" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 -stdlib=libstdc++ $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Darwin, c++11, libc++ -if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Darwin, c++11, libc++ (LLVM)" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -stdlib=libc++ $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Darwin, c++11, libstdc++ -if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Darwin, c++11, libstdc++ (GNU)" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -stdlib=libstdc++ $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Darwin, c++03, Malloc Guards -if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX03" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Darwin, c++03, Malloc Guards" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - - export MallocScribble=1 - export MallocPreScribble=1 - export MallocGuardEdges=1 - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - unset MallocScribble MallocPreScribble MallocGuardEdges -fi - -############################################ -# Darwin, c++11, Malloc Guards -if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Darwin, c++11, Malloc Guards" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - - export MallocScribble=1 - export MallocPreScribble=1 - export MallocGuardEdges=1 - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - unset MallocScribble MallocPreScribble MallocGuardEdges -fi - -# Try to locate a Xcode compiler for testing under Darwin -XCODE_COMPILER=$(find /Applications/Xcode*.app/Contents/Developer -name clang++ | head -1) - -############################################ -# Xcode compiler -if [ "$IS_DARWIN" -ne "0" ] && [ -z "$XCODE_COMPILER" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Xcode Clang compiler" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - expot CXX="$XCODE_COMPILER" - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Benchmarks, c++03 -if [ "$HAVE_CXX03" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Benchmarks, c++03" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -O3 -std=c++03 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe b 3 2.4+1e9 2>&1 | tee -a "$BENCHMARK_RESULTS" -fi - -############################################ -# Benchmarks, c++11 -if [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Benchmarks, c++11" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -O3 -std=c++11 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe b 3 2.4+1e9 2>&1 | tee -a "$BENCHMARK_RESULTS" -fi - -# For Cygwin, we need to test both PREFER_BERKELEY_STYLE_SOCKETS -# and PREFER_WINDOWS_STYLE_SOCKETS - -############################################ -# MinGW and PREFER_BERKELEY_STYLE_SOCKETS -if [ "$IS_MINGW" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: MinGW, PREFER_BERKELEY_STYLE_SOCKETS" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -DPREFER_BERKELEY_STYLE_SOCKETS -DNO_WINDOWS_STYLE_SOCKETS $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# MinGW and PREFER_WINDOWS_STYLE_SOCKETS -if [ "$IS_MINGW" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: MinGW, PREFER_WINDOWS_STYLE_SOCKETS" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -DPREFER_WINDOWS_STYLE_SOCKETS -DNO_BERKELEY_STYLE_SOCKETS $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Valgrind, c++03. Requires -O1 for accurate results -if [ "$HAVE_CXX03" -ne "0" ] && [ "$HAVE_VALGRIND" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Valgrind, c++03" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -std=c++03 -g3 -O1 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - valgrind --track-origins=yes ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - valgrind --track-origins=yes ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -# Valgrind, c++11. Requires -O1 for accurate results -if [ "$HAVE_VALGRIND" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Valgrind, c++11" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -std=c++11 -g3 -O1 $ADD_CXXFLAGS" - "$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - valgrind --track-origins=yes ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - valgrind --track-origins=yes ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" -fi - -############################################ -############################################ - -if [ "$CXX" == "g++" ] && [ "$HAVE_CXX11" -ne "0" ]; then - - ############################################ - # Basic debug build - echo - echo "************************************" | tee -a "$WARN_TEST_RESULTS" - echo "Testing: debug, c++11, elevated warnings" | tee -a "$WARN_TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas" - "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_TEST_RESULTS" - - ############################################ - # Basic release build - echo - echo "************************************" | tee -a "$WARN_TEST_RESULTS" - echo "Testing: release, c++11, elevated warnings" | tee -a "$WARN_TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas" - "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_TEST_RESULTS" -fi - -############################################ -############################################ - -TEST_END=$(date) - -echo "************************************************" | tee -a "$TEST_RESULTS" -echo "************************************************" | tee -a "$TEST_RESULTS" -echo | tee -a "$TEST_RESULTS" - -echo "Testing started: $TEST_BEGIN" | tee -a "$TEST_RESULTS" -echo "Testing finished: $TEST_END" | tee -a "$TEST_RESULTS" -echo | tee -a "$TEST_RESULTS" - -COUNT=$(grep -a "Testing: " cryptest-result.txt | wc -l) -if [ "$COUNT" -eq "0" ]; then - echo "No configurations tested" | tee -a "$TEST_RESULTS" -else - echo "$COUNT configurations tested" | tee -a "$TEST_RESULTS" -fi -echo | tee -a "$TEST_RESULTS" - -# "FAILED" is from Crypto++ -# "Error" is from the GNU assembler -# "error" is from the sanitizers -# "Illegal", "0 errors" and "suppressed errors" are from Valgrind. -COUNT=$(egrep -a '(Error|error|FAILED|Illegal)' cryptest-result.txt | egrep -v "( 0 errors|suppressed errors|memory error detector)" | wc -l) -if [ "$COUNT" -eq "0" ]; then - echo "No failures detected" | tee -a "$TEST_RESULTS" -else - echo "$COUNT errors detected" | tee -a "$TEST_RESULTS" - echo - egrep -an "(Error|error|FAILED|Illegal)" cryptest-result.txt -fi -echo | tee -a "$TEST_RESULTS" - -echo "************************************************" | tee -a "$TEST_RESULTS" -echo "************************************************" | tee -a "$TEST_RESULTS" diff --git a/external/crypto++-5.6.3/cryptest.vcproj b/external/crypto++-5.6.3/cryptest.vcproj deleted file mode 100644 index c688284c6..000000000 --- a/external/crypto++-5.6.3/cryptest.vcproj +++ /dev/null @@ -1,1711 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/external/crypto++-5.6.3/cryptest_bds.bdsgroup b/external/crypto++-5.6.3/cryptest_bds.bdsgroup deleted file mode 100644 index 32d85c637..000000000 --- a/external/crypto++-5.6.3/cryptest_bds.bdsgroup +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - cryptest_bds.bdsproj - cryptlib_bds.bdsproj - cryptest_bds.exe cryptlib_bds.lib - - - - - - - - diff --git a/external/crypto++-5.6.3/cryptest_bds.bdsproj b/external/crypto++-5.6.3/cryptest_bds.bdsproj deleted file mode 100644 index 39751de01..000000000 --- a/external/crypto++-5.6.3/cryptest_bds.bdsproj +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - cryptest_bds.bpf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - - - v - - True - . - D:\cvs\c5\Debug_Build\cryptest_bds.exe - - - - - False - - False - - True - False - - - Delphi 1.0 Compatibility Components - Borland C++Builder Internet Explorer 5 Components Package - - - - - - - - - - - diff --git a/external/crypto++-5.6.3/cryptest_bds.bpf b/external/crypto++-5.6.3/cryptest_bds.bpf deleted file mode 100644 index fa1ed3b86..000000000 --- a/external/crypto++-5.6.3/cryptest_bds.bpf +++ /dev/null @@ -1,5 +0,0 @@ -This file is used by the project manager only and should be treated like the project file - -To add a file to this project use the Project menu 'Add to Project' - -main \ No newline at end of file diff --git a/external/crypto++-5.6.3/cryptlib.cpp b/external/crypto++-5.6.3/cryptlib.cpp deleted file mode 100644 index 77ed314d4..000000000 --- a/external/crypto++-5.6.3/cryptlib.cpp +++ /dev/null @@ -1,949 +0,0 @@ -// cryptlib.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4127 4189 4459) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunused-value" -# pragma GCC diagnostic ignored "-Wunused-variable" -# pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "cryptlib.h" -#include "misc.h" -#include "filters.h" -#include "algparam.h" -#include "fips140.h" -#include "argnames.h" -#include "fltrimpl.h" -#include "trdlocal.h" -#include "osrng.h" -#include "secblock.h" -#include "smartptr.h" - -// http://www.cygwin.com/faq.html#faq.api.winsock -#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && defined(PREFER_WINDOWS_STYLE_SOCKETS) -# error Cygwin does not support Windows style sockets. See http://www.cygwin.com/faq.html#faq.api.winsock -#endif - -// MacPorts/GCC does not provide init_priority(priority). Apple/GCC and Fink/GCC do provide it. -#define HAVE_GCC_INIT_PRIORITY (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0)) -#define HAVE_MSC_INIT_PRIORITY (_MSC_VER && (CRYPTOPP_INIT_PRIORITY > 0)) - -NAMESPACE_BEGIN(CryptoPP) - -CRYPTOPP_COMPILE_ASSERT(sizeof(byte) == 1); -CRYPTOPP_COMPILE_ASSERT(sizeof(word16) == 2); -CRYPTOPP_COMPILE_ASSERT(sizeof(word32) == 4); -CRYPTOPP_COMPILE_ASSERT(sizeof(word64) == 8); -#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE -CRYPTOPP_COMPILE_ASSERT(sizeof(dword) == 2*sizeof(word)); -#endif - -#if HAVE_GCC_INIT_PRIORITY -CRYPTOPP_COMPILE_ASSERT(CRYPTOPP_INIT_PRIORITY >= 101); -const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))); -const std::string AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 26))) = "AAD"; -const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; -#elif HAVE_MSC_INIT_PRIORITY -#pragma warning(disable: 4073) -#pragma init_seg(lib) -const std::string DEFAULT_CHANNEL; -const std::string AAD_CHANNEL = "AAD"; -const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; -#pragma warning(default: 4073) -#else -// VALVE, changed DEFAULT_CHANNEL to a basic type from std::string -//const std::string DEFAULT_CHANNEL; -const char * DEFAULT_CHANNEL = ""; -const std::string AAD_CHANNEL = "AAD"; -const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; -#endif - -class NullNameValuePairs : public NameValuePairs -{ -public: - NullNameValuePairs() {} - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - {CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue); return false;} -}; - -// VALVE: Our debug allocator doesn't much care for global objects like this, it registers them -// as a memory leak during validation. So make them const. -//#if HAVE_GCC_INIT_PRIORITY -//const simple_ptr s_pNullNameValuePairs __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 30))) = new NullNameValuePairs; -//const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p; -//#else -//const simple_ptr s_pNullNameValuePairs(new NullNameValuePairs); -//const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p; -//#endif - -const NullNameValuePairs s_NullNameValuePairs; -const NameValuePairs &g_nullNameValuePairs = s_NullNameValuePairs; - -BufferedTransformation & TheBitBucket() -{ - static BitBucket bitBucket; - return bitBucket; -} - -Algorithm::Algorithm(bool checkSelfTestStatus) -{ - if (checkSelfTestStatus && FIPS_140_2_ComplianceEnabled()) - { - if (GetPowerUpSelfTestStatus() == POWER_UP_SELF_TEST_NOT_DONE && !PowerUpSelfTestInProgressOnThisThread()) - throw SelfTestFailure("Cryptographic algorithms are disabled before the power-up self tests are performed."); - - if (GetPowerUpSelfTestStatus() == POWER_UP_SELF_TEST_FAILED) - throw SelfTestFailure("Cryptographic algorithms are disabled after a power-up self test failed."); - } -} - -void SimpleKeyingInterface::SetKey(const byte *key, size_t length, const NameValuePairs ¶ms) -{ - this->ThrowIfInvalidKeyLength(length); - this->UncheckedSetKey(key, (unsigned int)length, params); -} - -void SimpleKeyingInterface::SetKeyWithRounds(const byte *key, size_t length, int rounds) -{ - SetKey(key, length, MakeParameters(Name::Rounds(), rounds)); -} - -void SimpleKeyingInterface::SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength) -{ - SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, ivLength))); -} - -void SimpleKeyingInterface::ThrowIfInvalidKeyLength(size_t length) -{ - if (!IsValidKeyLength(length)) - throw InvalidKeyLength(GetAlgorithm().AlgorithmName(), length); -} - -void SimpleKeyingInterface::ThrowIfResynchronizable() -{ - if (IsResynchronizable()) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": this object requires an IV"); -} - -void SimpleKeyingInterface::ThrowIfInvalidIV(const byte *iv) -{ - if (!iv && IVRequirement() == UNPREDICTABLE_RANDOM_IV) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": this object cannot use a null IV"); -} - -size_t SimpleKeyingInterface::ThrowIfInvalidIVLength(int size) -{ - if (size < 0) - return IVSize(); - else if ((size_t)size < MinIVLength()) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": IV length " + IntToString(size) + " is less than the minimum of " + IntToString(MinIVLength())); - else if ((size_t)size > MaxIVLength()) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": IV length " + IntToString(size) + " exceeds the maximum of " + IntToString(MaxIVLength())); - else - return size; -} - -const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size) -{ - ConstByteArrayParameter ivWithLength; - const byte *iv; - bool found = false; - - try {found = params.GetValue(Name::IV(), ivWithLength);} - catch (const NameValuePairs::ValueTypeMismatch &) {} - - if (found) - { - iv = ivWithLength.begin(); - ThrowIfInvalidIV(iv); - size = ThrowIfInvalidIVLength((int)ivWithLength.size()); - return iv; - } - else if (params.GetValue(Name::IV(), iv)) - { - ThrowIfInvalidIV(iv); - size = IVSize(); - return iv; - } - else - { - ThrowIfResynchronizable(); - size = 0; - return NULL; - } -} - -void SimpleKeyingInterface::GetNextIV(RandomNumberGenerator &rng, byte *IV) -{ - rng.GenerateBlock(IV, IVSize()); -} - -size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const -{ - assert(inBlocks); - assert(outBlocks); - assert(length); - - size_t blockSize = BlockSize(); - size_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncrementInOutPointers)) ? 0 : blockSize; - size_t xorIncrement = xorBlocks ? blockSize : 0; - size_t outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : blockSize; - - if (flags & BT_ReverseDirection) - { - assert(length % blockSize == 0); - inBlocks += length - blockSize; - xorBlocks += length - blockSize; - outBlocks += length - blockSize; - inIncrement = 0-inIncrement; - xorIncrement = 0-xorIncrement; - outIncrement = 0-outIncrement; - } - - while (length >= blockSize) - { - if (flags & BT_XorInput) - { - // Coverity finding. However, xorBlocks is never NULL if BT_XorInput. - assert(xorBlocks); -#if defined(__COVERITY__) - if (xorBlocks) -#endif - xorbuf(outBlocks, xorBlocks, inBlocks, blockSize); - ProcessBlock(outBlocks); - } - else - { - // xorBlocks can be NULL. See, for example, ECB_OneWay::ProcessData. - ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks); - } - - if (flags & BT_InBlockIsCounter) - const_cast(inBlocks)[blockSize-1]++; - inBlocks += inIncrement; - outBlocks += outIncrement; - xorBlocks += xorIncrement; - length -= blockSize; - } - - return length; -} - -unsigned int BlockTransformation::OptimalDataAlignment() const -{ - return GetAlignmentOf(); -} - -unsigned int StreamTransformation::OptimalDataAlignment() const -{ - return GetAlignmentOf(); -} - -unsigned int HashTransformation::OptimalDataAlignment() const -{ - return GetAlignmentOf(); -} - -void StreamTransformation::ProcessLastBlock(byte *outString, const byte *inString, size_t length) -{ - assert(MinLastBlockSize() == 0); // this function should be overriden otherwise - - if (length == MandatoryBlockSize()) - ProcessData(outString, inString, length); - else if (length != 0) - throw NotImplemented(AlgorithmName() + ": this object does't support a special last block"); -} - -void AuthenticatedSymmetricCipher::SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength) -{ - if (headerLength > MaxHeaderLength()) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": header length " + IntToString(headerLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength())); - - if (messageLength > MaxMessageLength()) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": message length " + IntToString(messageLength) + " exceeds the maximum of " + IntToString(MaxMessageLength())); - - if (footerLength > MaxFooterLength()) - throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": footer length " + IntToString(footerLength) + " exceeds the maximum of " + IntToString(MaxFooterLength())); - - UncheckedSpecifyDataLengths(headerLength, messageLength, footerLength); -} - -void AuthenticatedSymmetricCipher::EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength) -{ - Resynchronize(iv, ivLength); - SpecifyDataLengths(headerLength, messageLength); - Update(header, headerLength); - ProcessString(ciphertext, message, messageLength); - TruncatedFinal(mac, macSize); -} - -bool AuthenticatedSymmetricCipher::DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *ciphertext, size_t ciphertextLength) -{ - Resynchronize(iv, ivLength); - SpecifyDataLengths(headerLength, ciphertextLength); - Update(header, headerLength); - ProcessString(message, ciphertext, ciphertextLength); - return TruncatedVerify(mac, macLength); -} - -unsigned int RandomNumberGenerator::GenerateBit() -{ - return GenerateByte() & 1; -} - -byte RandomNumberGenerator::GenerateByte() -{ - byte b; - GenerateBlock(&b, 1); - return b; -} - -word32 RandomNumberGenerator::GenerateWord32(word32 min, word32 max) -{ - const word32 range = max-min; - const int maxBits = BitPrecision(range); - - word32 value; - - do - { - GenerateBlock((byte *)&value, sizeof(value)); - value = Crop(value, maxBits); - } while (value > range); - - return value+min; -} - -// Stack recursion below... GenerateIntoBufferedTransformation calls GenerateBlock, -// and GenerateBlock calls GenerateIntoBufferedTransformation. Ad infinitum. Also -// see https://github.com/weidai11/cryptopp/issues/38. -// -// According to Wei, RandomNumberGenerator is an interface, and it should not -// be instantiable. Its now spilt milk, and we are going to assert it in Debug -// builds to alert the programmer and throw in Release builds. Developers have -// a reference implementation in case its needed. If a programmer -// unintentionally lands here, then they should ensure use of a -// RandomNumberGenerator pointer or reference so polymorphism can provide the -// proper runtime dispatching. - -void RandomNumberGenerator::GenerateBlock(byte *output, size_t size) -{ - CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); - -#if 0 - // This breaks AutoSeededX917RNG generators. - throw NotImplemented("RandomNumberGenerator: GenerateBlock not implemented"); -#endif - - ArraySink s(output, size); - GenerateIntoBufferedTransformation(s, DEFAULT_CHANNEL, size); -} - -void RandomNumberGenerator::DiscardBytes(size_t n) -{ - GenerateIntoBufferedTransformation(TheBitBucket(), DEFAULT_CHANNEL, n); -} - -void RandomNumberGenerator::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length) -{ - FixedSizeSecBlock buffer; - while (length) - { - size_t len = UnsignedMin(buffer.size(), length); - GenerateBlock(buffer, len); - size_t rem = target.ChannelPut(channel, buffer, len); - CRYPTOPP_UNUSED(rem); assert(rem == 0); - length -= len; - } -} - -//! \class ClassNullRNG -//! \brief Random Number Generator that does not produce random numbers -//! \details ClassNullRNG can be used for functions that require a RandomNumberGenerator -//! but don't actually use it. The class throws NotImplemented when a generation function is called. -//! \sa NullRNG() -class ClassNullRNG : public RandomNumberGenerator -{ -public: - //! \brief The name of the generator - //! \returns the string \a NullRNGs - std::string AlgorithmName() const {return "NullRNG";} - -#if defined(CRYPTOPP_DOXYGEN_PROCESSING) - //! \brief An implementation that throws NotImplemented - byte GenerateByte () {} - //! \brief An implementation that throws NotImplemented - unsigned int GenerateBit () {} - //! \brief An implementation that throws NotImplemented - word32 GenerateWord32 (word32 min, word32 max) {} -#endif - - //! \brief An implementation that throws NotImplemented - void GenerateBlock(byte *output, size_t size) - { - CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(size); - throw NotImplemented("NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes"); - } - -#if defined(CRYPTOPP_DOXYGEN_PROCESSING) - //! \brief An implementation that throws NotImplemented - void GenerateIntoBufferedTransformation (BufferedTransformation &target, const std::string &channel, lword length) {} - //! \brief An implementation that throws NotImplemented - void IncorporateEntropy (const byte *input, size_t length) {} - //! \brief An implementation that returns \p false - bool CanIncorporateEntropy () const {} - //! \brief An implementation that does nothing - void DiscardBytes (size_t n) {} - //! \brief An implementation that does nothing - void Shuffle (IT begin, IT end) {} - -private: - Clonable* Clone () const { return NULL; } -#endif -}; - -RandomNumberGenerator & NullRNG() -{ - static ClassNullRNG s_nullRNG; - return s_nullRNG; -} - -bool HashTransformation::TruncatedVerify(const byte *digestIn, size_t digestLength) -{ - ThrowIfInvalidTruncatedSize(digestLength); - SecByteBlock digest(digestLength); - TruncatedFinal(digest, digestLength); - return VerifyBufsEqual(digest, digestIn, digestLength); -} - -void HashTransformation::ThrowIfInvalidTruncatedSize(size_t size) const -{ - if (size > DigestSize()) - throw InvalidArgument("HashTransformation: can't truncate a " + IntToString(DigestSize()) + " byte digest to " + IntToString(size) + " bytes"); -} - -unsigned int BufferedTransformation::GetMaxWaitObjectCount() const -{ - const BufferedTransformation *t = AttachedTransformation(); - return t ? t->GetMaxWaitObjectCount() : 0; -} - -void BufferedTransformation::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - BufferedTransformation *t = AttachedTransformation(); - if (t) - t->GetWaitObjects(container, callStack); // reduce clutter by not adding to stack here -} - -void BufferedTransformation::Initialize(const NameValuePairs ¶meters, int propagation) -{ - CRYPTOPP_UNUSED(propagation); - assert(!AttachedTransformation()); - IsolatedInitialize(parameters); -} - -bool BufferedTransformation::Flush(bool hardFlush, int propagation, bool blocking) -{ - CRYPTOPP_UNUSED(propagation); - assert(!AttachedTransformation()); - return IsolatedFlush(hardFlush, blocking); -} - -bool BufferedTransformation::MessageSeriesEnd(int propagation, bool blocking) -{ - CRYPTOPP_UNUSED(propagation); - assert(!AttachedTransformation()); - return IsolatedMessageSeriesEnd(blocking); -} - -byte * BufferedTransformation::ChannelCreatePutSpace(const std::string &channel, size_t &size) -{ - if (channel.empty()) - return CreatePutSpace(size); - else - throw NoChannelSupport(AlgorithmName()); -} - -size_t BufferedTransformation::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (channel.empty()) - return Put2(begin, length, messageEnd, blocking); - else - throw NoChannelSupport(AlgorithmName()); -} - -size_t BufferedTransformation::ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (channel.empty()) - return PutModifiable2(begin, length, messageEnd, blocking); - else - return ChannelPut2(channel, begin, length, messageEnd, blocking); -} - -bool BufferedTransformation::ChannelFlush(const std::string &channel, bool completeFlush, int propagation, bool blocking) -{ - if (channel.empty()) - return Flush(completeFlush, propagation, blocking); - else - throw NoChannelSupport(AlgorithmName()); -} - -bool BufferedTransformation::ChannelMessageSeriesEnd(const std::string &channel, int propagation, bool blocking) -{ - if (channel.empty()) - return MessageSeriesEnd(propagation, blocking); - else - throw NoChannelSupport(AlgorithmName()); -} - -lword BufferedTransformation::MaxRetrievable() const -{ - if (AttachedTransformation()) - return AttachedTransformation()->MaxRetrievable(); - else - return CopyTo(TheBitBucket()); -} - -bool BufferedTransformation::AnyRetrievable() const -{ - if (AttachedTransformation()) - return AttachedTransformation()->AnyRetrievable(); - else - { - byte b; - return Peek(b) != 0; - } -} - -size_t BufferedTransformation::Get(byte &outByte) -{ - if (AttachedTransformation()) - return AttachedTransformation()->Get(outByte); - else - return Get(&outByte, 1); -} - -size_t BufferedTransformation::Get(byte *outString, size_t getMax) -{ - if (AttachedTransformation()) - return AttachedTransformation()->Get(outString, getMax); - else - { - ArraySink arraySink(outString, getMax); - return (size_t)TransferTo(arraySink, getMax); - } -} - -size_t BufferedTransformation::Peek(byte &outByte) const -{ - if (AttachedTransformation()) - return AttachedTransformation()->Peek(outByte); - else - return Peek(&outByte, 1); -} - -size_t BufferedTransformation::Peek(byte *outString, size_t peekMax) const -{ - if (AttachedTransformation()) - return AttachedTransformation()->Peek(outString, peekMax); - else - { - ArraySink arraySink(outString, peekMax); - return (size_t)CopyTo(arraySink, peekMax); - } -} - -lword BufferedTransformation::Skip(lword skipMax) -{ - if (AttachedTransformation()) - return AttachedTransformation()->Skip(skipMax); - else - return TransferTo(TheBitBucket(), skipMax); -} - -lword BufferedTransformation::TotalBytesRetrievable() const -{ - if (AttachedTransformation()) - return AttachedTransformation()->TotalBytesRetrievable(); - else - return MaxRetrievable(); -} - -unsigned int BufferedTransformation::NumberOfMessages() const -{ - if (AttachedTransformation()) - return AttachedTransformation()->NumberOfMessages(); - else - return CopyMessagesTo(TheBitBucket()); -} - -bool BufferedTransformation::AnyMessages() const -{ - if (AttachedTransformation()) - return AttachedTransformation()->AnyMessages(); - else - return NumberOfMessages() != 0; -} - -bool BufferedTransformation::GetNextMessage() -{ - if (AttachedTransformation()) - return AttachedTransformation()->GetNextMessage(); - else - { - assert(!AnyMessages()); - return false; - } -} - -unsigned int BufferedTransformation::SkipMessages(unsigned int count) -{ - if (AttachedTransformation()) - return AttachedTransformation()->SkipMessages(count); - else - return TransferMessagesTo(TheBitBucket(), count); -} - -size_t BufferedTransformation::TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel, bool blocking) -{ - if (AttachedTransformation()) - return AttachedTransformation()->TransferMessagesTo2(target, messageCount, channel, blocking); - else - { - unsigned int maxMessages = messageCount; - for (messageCount=0; messageCount < maxMessages && AnyMessages(); messageCount++) - { - size_t blockedBytes; - lword transferredBytes; - - while (AnyRetrievable()) - { - transferredBytes = LWORD_MAX; - blockedBytes = TransferTo2(target, transferredBytes, channel, blocking); - if (blockedBytes > 0) - return blockedBytes; - } - - if (target.ChannelMessageEnd(channel, GetAutoSignalPropagation(), blocking)) - return 1; - - bool result = GetNextMessage(); - CRYPTOPP_UNUSED(result); assert(result); - } - return 0; - } -} - -unsigned int BufferedTransformation::CopyMessagesTo(BufferedTransformation &target, unsigned int count, const std::string &channel) const -{ - if (AttachedTransformation()) - return AttachedTransformation()->CopyMessagesTo(target, count, channel); - else - return 0; -} - -void BufferedTransformation::SkipAll() -{ - if (AttachedTransformation()) - AttachedTransformation()->SkipAll(); - else - { - while (SkipMessages()) {} - while (Skip()) {} - } -} - -size_t BufferedTransformation::TransferAllTo2(BufferedTransformation &target, const std::string &channel, bool blocking) -{ - if (AttachedTransformation()) - return AttachedTransformation()->TransferAllTo2(target, channel, blocking); - else - { - assert(!NumberOfMessageSeries()); - - unsigned int messageCount; - do - { - messageCount = UINT_MAX; - size_t blockedBytes = TransferMessagesTo2(target, messageCount, channel, blocking); - if (blockedBytes) - return blockedBytes; - } - while (messageCount != 0); - - lword byteCount; - do - { - byteCount = ULONG_MAX; - size_t blockedBytes = TransferTo2(target, byteCount, channel, blocking); - if (blockedBytes) - return blockedBytes; - } - while (byteCount != 0); - - return 0; - } -} - -void BufferedTransformation::CopyAllTo(BufferedTransformation &target, const std::string &channel) const -{ - if (AttachedTransformation()) - AttachedTransformation()->CopyAllTo(target, channel); - else - { - assert(!NumberOfMessageSeries()); - while (CopyMessagesTo(target, UINT_MAX, channel)) {} - } -} - -void BufferedTransformation::SetRetrievalChannel(const std::string &channel) -{ - if (AttachedTransformation()) - AttachedTransformation()->SetRetrievalChannel(channel); -} - -size_t BufferedTransformation::ChannelPutWord16(const std::string &channel, word16 value, ByteOrder order, bool blocking) -{ - PutWord(false, order, m_buf, value); - return ChannelPut(channel, m_buf, 2, blocking); -} - -size_t BufferedTransformation::ChannelPutWord32(const std::string &channel, word32 value, ByteOrder order, bool blocking) -{ - PutWord(false, order, m_buf, value); - return ChannelPut(channel, m_buf, 4, blocking); -} - -size_t BufferedTransformation::PutWord16(word16 value, ByteOrder order, bool blocking) -{ - return ChannelPutWord16(DEFAULT_CHANNEL, value, order, blocking); -} - -size_t BufferedTransformation::PutWord32(word32 value, ByteOrder order, bool blocking) -{ - return ChannelPutWord32(DEFAULT_CHANNEL, value, order, blocking); -} - -size_t BufferedTransformation::PeekWord16(word16 &value, ByteOrder order) const -{ - byte buf[2] = {0, 0}; - size_t len = Peek(buf, 2); - - if (order) - value = (buf[0] << 8) | buf[1]; - else - value = (buf[1] << 8) | buf[0]; - - return len; -} - -size_t BufferedTransformation::PeekWord32(word32 &value, ByteOrder order) const -{ - byte buf[4] = {0, 0, 0, 0}; - size_t len = Peek(buf, 4); - - if (order) - value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf [3]; - else - value = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf [0]; - - return len; -} - -size_t BufferedTransformation::GetWord16(word16 &value, ByteOrder order) -{ - return (size_t)Skip(PeekWord16(value, order)); -} - -size_t BufferedTransformation::GetWord32(word32 &value, ByteOrder order) -{ - return (size_t)Skip(PeekWord32(value, order)); -} - -void BufferedTransformation::Attach(BufferedTransformation *newOut) -{ - if (AttachedTransformation() && AttachedTransformation()->Attachable()) - AttachedTransformation()->Attach(newOut); - else - Detach(newOut); -} - -void GeneratableCryptoMaterial::GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize) -{ - GenerateRandom(rng, MakeParameters("KeySize", (int)keySize)); -} - -class PK_DefaultEncryptionFilter : public Unflushable -{ -public: - PK_DefaultEncryptionFilter(RandomNumberGenerator &rng, const PK_Encryptor &encryptor, BufferedTransformation *attachment, const NameValuePairs ¶meters) - : m_rng(rng), m_encryptor(encryptor), m_parameters(parameters) - { - Detach(attachment); - } - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - { - FILTER_BEGIN; - m_plaintextQueue.Put(inString, length); - - if (messageEnd) - { - { - size_t plaintextLength; - if (!SafeConvert(m_plaintextQueue.CurrentSize(), plaintextLength)) - throw InvalidArgument("PK_DefaultEncryptionFilter: plaintext too long"); - size_t ciphertextLength = m_encryptor.CiphertextLength(plaintextLength); - - SecByteBlock plaintext(plaintextLength); - m_plaintextQueue.Get(plaintext, plaintextLength); - m_ciphertext.resize(ciphertextLength); - m_encryptor.Encrypt(m_rng, plaintext, plaintextLength, m_ciphertext, m_parameters); - } - - FILTER_OUTPUT(1, m_ciphertext, m_ciphertext.size(), messageEnd); - } - FILTER_END_NO_MESSAGE_END; - } - - RandomNumberGenerator &m_rng; - const PK_Encryptor &m_encryptor; - const NameValuePairs &m_parameters; - ByteQueue m_plaintextQueue; - SecByteBlock m_ciphertext; -}; - -BufferedTransformation * PK_Encryptor::CreateEncryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment, const NameValuePairs ¶meters) const -{ - return new PK_DefaultEncryptionFilter(rng, *this, attachment, parameters); -} - -class PK_DefaultDecryptionFilter : public Unflushable -{ -public: - PK_DefaultDecryptionFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment, const NameValuePairs ¶meters) - : m_rng(rng), m_decryptor(decryptor), m_parameters(parameters) - { - Detach(attachment); - } - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - { - FILTER_BEGIN; - m_ciphertextQueue.Put(inString, length); - - if (messageEnd) - { - { - size_t ciphertextLength; - if (!SafeConvert(m_ciphertextQueue.CurrentSize(), ciphertextLength)) - throw InvalidArgument("PK_DefaultDecryptionFilter: ciphertext too long"); - size_t maxPlaintextLength = m_decryptor.MaxPlaintextLength(ciphertextLength); - - SecByteBlock ciphertext(ciphertextLength); - m_ciphertextQueue.Get(ciphertext, ciphertextLength); - m_plaintext.resize(maxPlaintextLength); - m_result = m_decryptor.Decrypt(m_rng, ciphertext, ciphertextLength, m_plaintext, m_parameters); - if (!m_result.isValidCoding) - throw InvalidCiphertext(m_decryptor.AlgorithmName() + ": invalid ciphertext"); - } - - FILTER_OUTPUT(1, m_plaintext, m_result.messageLength, messageEnd); - } - FILTER_END_NO_MESSAGE_END; - } - - RandomNumberGenerator &m_rng; - const PK_Decryptor &m_decryptor; - const NameValuePairs &m_parameters; - ByteQueue m_ciphertextQueue; - SecByteBlock m_plaintext; - DecodingResult m_result; -}; - -BufferedTransformation * PK_Decryptor::CreateDecryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment, const NameValuePairs ¶meters) const -{ - return new PK_DefaultDecryptionFilter(rng, *this, attachment, parameters); -} - -size_t PK_Signer::Sign(RandomNumberGenerator &rng, PK_MessageAccumulator *messageAccumulator, byte *signature) const -{ - member_ptr m(messageAccumulator); - return SignAndRestart(rng, *m, signature, false); -} - -size_t PK_Signer::SignMessage(RandomNumberGenerator &rng, const byte *message, size_t messageLen, byte *signature) const -{ - member_ptr m(NewSignatureAccumulator(rng)); - m->Update(message, messageLen); - return SignAndRestart(rng, *m, signature, false); -} - -size_t PK_Signer::SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, - const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const -{ - member_ptr m(NewSignatureAccumulator(rng)); - InputRecoverableMessage(*m, recoverableMessage, recoverableMessageLength); - m->Update(nonrecoverableMessage, nonrecoverableMessageLength); - return SignAndRestart(rng, *m, signature, false); -} - -bool PK_Verifier::Verify(PK_MessageAccumulator *messageAccumulator) const -{ - member_ptr m(messageAccumulator); - return VerifyAndRestart(*m); -} - -bool PK_Verifier::VerifyMessage(const byte *message, size_t messageLen, const byte *signature, size_t signatureLength) const -{ - member_ptr m(NewVerificationAccumulator()); - InputSignature(*m, signature, signatureLength); - m->Update(message, messageLen); - return VerifyAndRestart(*m); -} - -DecodingResult PK_Verifier::Recover(byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const -{ - member_ptr m(messageAccumulator); - return RecoverAndRestart(recoveredMessage, *m); -} - -DecodingResult PK_Verifier::RecoverMessage(byte *recoveredMessage, - const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, - const byte *signature, size_t signatureLength) const -{ - member_ptr m(NewVerificationAccumulator()); - InputSignature(*m, signature, signatureLength); - m->Update(nonrecoverableMessage, nonrecoverableMessageLength); - return RecoverAndRestart(recoveredMessage, *m); -} - -void SimpleKeyAgreementDomain::GenerateKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const -{ - GeneratePrivateKey(rng, privateKey); - GeneratePublicKey(rng, privateKey, publicKey); -} - -void AuthenticatedKeyAgreementDomain::GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const -{ - GenerateStaticPrivateKey(rng, privateKey); - GenerateStaticPublicKey(rng, privateKey, publicKey); -} - -void AuthenticatedKeyAgreementDomain::GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const -{ - GenerateEphemeralPrivateKey(rng, privateKey); - GenerateEphemeralPublicKey(rng, privateKey, publicKey); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/cryptlib.dsp b/external/crypto++-5.6.3/cryptlib.dsp deleted file mode 100644 index 6c5f4ea93..000000000 --- a/external/crypto++-5.6.3/cryptlib.dsp +++ /dev/null @@ -1,1216 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cryptlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=cryptlib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cryptlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cryptlib.mak" CFG="cryptlib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cryptlib - Win32 DLL-Import Release" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 DLL-Import Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptlib___Win32_FIPS_140_Release" -# PROP BASE Intermediate_Dir "cryptlib___Win32_FIPS_140_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "DLL_Import_Release" -# PROP Intermediate_Dir "DLL_Import_Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c -# ADD CPP /nologo /G5 /Gz /MT /W3 /GR /GX /Zi /O2 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /Zm400 /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 DLL-Import Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptlib___Win32_FIPS_140_Debug" -# PROP BASE Intermediate_Dir "cryptlib___Win32_FIPS_140_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DLL_Import_Debug" -# PROP Intermediate_Dir "DLL_Import_Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c -# ADD CPP /nologo /G5 /Gz /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /Zm400 /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptlib" -# PROP BASE Intermediate_Dir "cryptlib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GR /GX /Zi /O2 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /Zm400 /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptli0" -# PROP BASE Intermediate_Dir "cryptli0" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /GR /GX /Zi /Oi /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /Zm400 /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "cryptlib - Win32 DLL-Import Release" -# Name "cryptlib - Win32 DLL-Import Debug" -# Name "cryptlib - Win32 Release" -# Name "cryptlib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".cpp" -# Begin Source File - -SOURCE=.\3way.cpp -# End Source File -# Begin Source File - -SOURCE=.\adhoc.cpp.proto - -!IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release" - -# Begin Custom Build -InputPath=.\adhoc.cpp.proto - -"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp - echo: >> adhoc.cpp.copied - -# End Custom Build - -!ELSEIF "$(CFG)" == "cryptlib - Win32 DLL-Import Debug" - -# Begin Custom Build -InputPath=.\adhoc.cpp.proto - -"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp - echo: >> adhoc.cpp.copied - -# End Custom Build - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Release" - -# Begin Custom Build -InputPath=.\adhoc.cpp.proto - -"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp - echo: >> adhoc.cpp.copied - -# End Custom Build - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\adhoc.cpp.proto - -"adhoc.cpp.copied" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if not exist adhoc.cpp copy "$(InputPath)" adhoc.cpp - echo: >> adhoc.cpp.copied - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\adler32.cpp -# End Source File -# Begin Source File - -SOURCE=.\algebra.cpp -# End Source File -# Begin Source File - -SOURCE=.\algparam.cpp -# End Source File -# Begin Source File - -SOURCE=.\arc4.cpp -# End Source File -# Begin Source File - -SOURCE=.\asn.cpp -# End Source File -# Begin Source File - -SOURCE=.\authenc.cpp -# End Source File -# Begin Source File - -SOURCE=.\base32.cpp -# End Source File -# Begin Source File - -SOURCE=.\base64.cpp -# End Source File -# Begin Source File - -SOURCE=.\basecode.cpp -# End Source File -# Begin Source File - -SOURCE=.\bfinit.cpp -# End Source File -# Begin Source File - -SOURCE=.\blowfish.cpp -# End Source File -# Begin Source File - -SOURCE=.\blumshub.cpp -# End Source File -# Begin Source File - -SOURCE=.\camellia.cpp -# End Source File -# Begin Source File - -SOURCE=.\cast.cpp -# End Source File -# Begin Source File - -SOURCE=.\casts.cpp -# End Source File -# Begin Source File - -SOURCE=.\cbcmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\ccm.cpp -# End Source File -# Begin Source File - -SOURCE=.\channels.cpp -# End Source File -# Begin Source File - -SOURCE=.\cmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\cpu.cpp -# End Source File -# Begin Source File - -SOURCE=.\crc.cpp -# End Source File -# Begin Source File - -SOURCE=.\cryptlib.cpp -# End Source File -# Begin Source File - -SOURCE=.\default.cpp -# End Source File -# Begin Source File - -SOURCE=.\des.cpp -# End Source File -# Begin Source File - -SOURCE=.\dessp.cpp -# End Source File -# Begin Source File - -SOURCE=.\dh.cpp -# End Source File -# Begin Source File - -SOURCE=.\dh2.cpp -# End Source File -# Begin Source File - -SOURCE=.\dll.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=.\dsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\eax.cpp -# End Source File -# Begin Source File - -SOURCE=.\ec2n.cpp -# End Source File -# Begin Source File - -SOURCE=.\eccrypto.cpp -# End Source File -# Begin Source File - -SOURCE=.\ecp.cpp -# End Source File -# Begin Source File - -SOURCE=.\elgamal.cpp -# End Source File -# Begin Source File - -SOURCE=.\emsa2.cpp -# End Source File -# Begin Source File - -SOURCE=.\eprecomp.cpp -# End Source File -# Begin Source File - -SOURCE=.\esign.cpp -# End Source File -# Begin Source File - -SOURCE=.\files.cpp -# End Source File -# Begin Source File - -SOURCE=.\filters.cpp -# End Source File -# Begin Source File - -SOURCE=.\fips140.cpp -# End Source File -# Begin Source File - -SOURCE=.\fipstest.cpp -# End Source File -# Begin Source File - -SOURCE=.\gcm.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf256.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf2_32.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf2n.cpp -# End Source File -# Begin Source File - -SOURCE=.\gfpcrypt.cpp -# End Source File -# Begin Source File - -SOURCE=.\gost.cpp -# End Source File -# Begin Source File - -SOURCE=.\gzip.cpp -# End Source File -# Begin Source File - -SOURCE=.\hex.cpp -# End Source File -# Begin Source File - -SOURCE=.\hmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\hrtimer.cpp -# End Source File -# Begin Source File - -SOURCE=.\ida.cpp -# End Source File -# Begin Source File - -SOURCE=.\idea.cpp -# End Source File -# Begin Source File - -SOURCE=.\integer.cpp -# End Source File -# Begin Source File - -SOURCE=.\iterhash.cpp -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=.\luc.cpp -# End Source File -# Begin Source File - -SOURCE=.\mars.cpp -# End Source File -# Begin Source File - -SOURCE=.\marss.cpp -# End Source File -# Begin Source File - -SOURCE=.\md2.cpp -# End Source File -# Begin Source File - -SOURCE=.\md4.cpp -# End Source File -# Begin Source File - -SOURCE=.\md5.cpp -# End Source File -# Begin Source File - -SOURCE=.\misc.cpp -# End Source File -# Begin Source File - -SOURCE=.\modes.cpp -# End Source File -# Begin Source File - -SOURCE=.\mqueue.cpp -# End Source File -# Begin Source File - -SOURCE=.\mqv.cpp -# End Source File -# Begin Source File - -SOURCE=.\nbtheory.cpp -# End Source File -# Begin Source File - -SOURCE=.\network.cpp -# End Source File -# Begin Source File - -SOURCE=.\oaep.cpp -# End Source File -# Begin Source File - -SOURCE=.\osrng.cpp -# End Source File -# Begin Source File - -SOURCE=.\panama.cpp -# End Source File -# Begin Source File - -SOURCE=.\pch.cpp -# ADD CPP /Yc"pch.h" -# End Source File -# Begin Source File - -SOURCE=.\pkcspad.cpp -# End Source File -# Begin Source File - -SOURCE=.\polynomi.cpp -# End Source File -# Begin Source File - -SOURCE=.\pssr.cpp -# End Source File -# Begin Source File - -SOURCE=.\pubkey.cpp -# End Source File -# Begin Source File - -SOURCE=.\queue.cpp -# End Source File -# Begin Source File - -SOURCE=.\rabin.cpp -# End Source File -# Begin Source File - -SOURCE=.\randpool.cpp -# End Source File -# Begin Source File - -SOURCE=.\rc2.cpp -# End Source File -# Begin Source File - -SOURCE=.\rc5.cpp -# End Source File -# Begin Source File - -SOURCE=.\rc6.cpp -# End Source File -# Begin Source File - -SOURCE=.\rdtables.cpp -# End Source File -# Begin Source File - -SOURCE=.\rijndael.cpp -# End Source File -# Begin Source File - -SOURCE=.\ripemd.cpp -# End Source File -# Begin Source File - -SOURCE=.\rng.cpp -# End Source File -# Begin Source File - -SOURCE=.\rsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\rw.cpp -# End Source File -# Begin Source File - -SOURCE=.\safer.cpp -# End Source File -# Begin Source File - -SOURCE=.\salsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\seal.cpp -# End Source File -# Begin Source File - -SOURCE=.\seed.cpp -# End Source File -# Begin Source File - -SOURCE=.\serpent.cpp -# End Source File -# Begin Source File - -SOURCE=.\sha.cpp -# End Source File -# Begin Source File - -SOURCE=.\sha3.cpp -# End Source File -# Begin Source File - -SOURCE=.\shacal2.cpp -# End Source File -# Begin Source File - -SOURCE=.\shark.cpp -# End Source File -# Begin Source File - -SOURCE=.\sharkbox.cpp -# End Source File -# Begin Source File - -SOURCE=.\simple.cpp -# End Source File -# Begin Source File - -SOURCE=.\skipjack.cpp -# End Source File -# Begin Source File - -SOURCE=.\socketft.cpp -# End Source File -# Begin Source File - -SOURCE=.\sosemanuk.cpp -# End Source File -# Begin Source File - -SOURCE=.\square.cpp -# End Source File -# Begin Source File - -SOURCE=.\squaretb.cpp -# End Source File -# Begin Source File - -SOURCE=.\strciphr.cpp -# End Source File -# Begin Source File - -SOURCE=.\tea.cpp -# End Source File -# Begin Source File - -SOURCE=.\tftables.cpp -# End Source File -# Begin Source File - -SOURCE=.\tiger.cpp -# End Source File -# Begin Source File - -SOURCE=.\tigertab.cpp -# End Source File -# Begin Source File - -SOURCE=.\trdlocal.cpp -# End Source File -# Begin Source File - -SOURCE=.\ttmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\twofish.cpp -# End Source File -# Begin Source File - -SOURCE=.\vmac.cpp -# End Source File -# Begin Source File - -SOURCE=.\wait.cpp -# End Source File -# Begin Source File - -SOURCE=.\wake.cpp -# End Source File -# Begin Source File - -SOURCE=.\whrlpool.cpp -# End Source File -# Begin Source File - -SOURCE=.\winpipes.cpp -# End Source File -# Begin Source File - -SOURCE=.\xtr.cpp -# End Source File -# Begin Source File - -SOURCE=.\xtrcrypt.cpp -# End Source File -# Begin Source File - -SOURCE=.\zdeflate.cpp -# End Source File -# Begin Source File - -SOURCE=.\zinflate.cpp -# End Source File -# Begin Source File - -SOURCE=.\zlib.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".;.h" -# Begin Source File - -SOURCE=.\3way.h -# End Source File -# Begin Source File - -SOURCE=.\adler32.h -# End Source File -# Begin Source File - -SOURCE=.\aes.h -# End Source File -# Begin Source File - -SOURCE=.\algebra.h -# End Source File -# Begin Source File - -SOURCE=.\algparam.h -# End Source File -# Begin Source File - -SOURCE=.\arc4.h -# End Source File -# Begin Source File - -SOURCE=.\argnames.h -# End Source File -# Begin Source File - -SOURCE=.\asn.h -# End Source File -# Begin Source File - -SOURCE=.\authenc.h -# End Source File -# Begin Source File - -SOURCE=.\base32.h -# End Source File -# Begin Source File - -SOURCE=.\base64.h -# End Source File -# Begin Source File - -SOURCE=.\basecode.h -# End Source File -# Begin Source File - -SOURCE=.\blowfish.h -# End Source File -# Begin Source File - -SOURCE=.\blumshub.h -# End Source File -# Begin Source File - -SOURCE=.\camellia.h -# End Source File -# Begin Source File - -SOURCE=.\cast.h -# End Source File -# Begin Source File - -SOURCE=.\cbcmac.h -# End Source File -# Begin Source File - -SOURCE=.\ccm.h -# End Source File -# Begin Source File - -SOURCE=.\channels.h -# End Source File -# Begin Source File - -SOURCE=.\cmac.h -# End Source File -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=.\crc.h -# End Source File -# Begin Source File - -SOURCE=.\cryptlib.h -# End Source File -# Begin Source File - -SOURCE=.\default.h -# End Source File -# Begin Source File - -SOURCE=.\des.h -# End Source File -# Begin Source File - -SOURCE=.\dh.h -# End Source File -# Begin Source File - -SOURCE=.\dh2.h -# End Source File -# Begin Source File - -SOURCE=.\dmac.h -# End Source File -# Begin Source File - -SOURCE=.\dsa.h -# End Source File -# Begin Source File - -SOURCE=.\dword.h -# End Source File -# Begin Source File - -SOURCE=.\eax.h -# End Source File -# Begin Source File - -SOURCE=.\ec2n.h -# End Source File -# Begin Source File - -SOURCE=.\eccrypto.h -# End Source File -# Begin Source File - -SOURCE=.\ecp.h -# End Source File -# Begin Source File - -SOURCE=.\elgamal.h -# End Source File -# Begin Source File - -SOURCE=.\emsa2.h -# End Source File -# Begin Source File - -SOURCE=.\eprecomp.h -# End Source File -# Begin Source File - -SOURCE=.\esign.h -# End Source File -# Begin Source File - -SOURCE=.\factory.h -# End Source File -# Begin Source File - -SOURCE=.\files.h -# End Source File -# Begin Source File - -SOURCE=.\filters.h -# End Source File -# Begin Source File - -SOURCE=.\fips140.h -# End Source File -# Begin Source File - -SOURCE=.\fltrimpl.h -# End Source File -# Begin Source File - -SOURCE=.\gcm.h -# End Source File -# Begin Source File - -SOURCE=.\gf256.h -# End Source File -# Begin Source File - -SOURCE=.\gf2_32.h -# End Source File -# Begin Source File - -SOURCE=.\gf2n.h -# End Source File -# Begin Source File - -SOURCE=.\gfpcrypt.h -# End Source File -# Begin Source File - -SOURCE=.\gost.h -# End Source File -# Begin Source File - -SOURCE=.\gzip.h -# End Source File -# Begin Source File - -SOURCE=.\hex.h -# End Source File -# Begin Source File - -SOURCE=.\hkdf.h -# End Source File -# Begin Source File - -SOURCE=.\hmac.h -# End Source File -# Begin Source File - -SOURCE=.\hrtimer.h -# End Source File -# Begin Source File - -SOURCE=.\ida.h -# End Source File -# Begin Source File - -SOURCE=.\idea.h -# End Source File -# Begin Source File - -SOURCE=.\integer.h -# End Source File -# Begin Source File - -SOURCE=.\iterhash.h -# End Source File -# Begin Source File - -SOURCE=.\lubyrack.h -# End Source File -# Begin Source File - -SOURCE=.\luc.h -# End Source File -# Begin Source File - -SOURCE=.\mars.h -# End Source File -# Begin Source File - -SOURCE=.\md2.h -# End Source File -# Begin Source File - -SOURCE=.\md4.h -# End Source File -# Begin Source File - -SOURCE=.\md5.h -# End Source File -# Begin Source File - -SOURCE=.\mdc.h -# End Source File -# Begin Source File - -SOURCE=.\misc.h -# End Source File -# Begin Source File - -SOURCE=.\modarith.h -# End Source File -# Begin Source File - -SOURCE=.\modes.h -# End Source File -# Begin Source File - -SOURCE=.\modexppc.h -# End Source File -# Begin Source File - -SOURCE=.\mqueue.h -# End Source File -# Begin Source File - -SOURCE=.\mqv.h -# End Source File -# Begin Source File - -SOURCE=.\nbtheory.h -# End Source File -# Begin Source File - -SOURCE=.\network.h -# End Source File -# Begin Source File - -SOURCE=.\nr.h -# End Source File -# Begin Source File - -SOURCE=.\oaep.h -# End Source File -# Begin Source File - -SOURCE=.\oids.h -# End Source File -# Begin Source File - -SOURCE=.\osrng.h -# End Source File -# Begin Source File - -SOURCE=.\panama.h -# End Source File -# Begin Source File - -SOURCE=.\pch.h -# End Source File -# Begin Source File - -SOURCE=.\pkcspad.h -# End Source File -# Begin Source File - -SOURCE=.\polynomi.h -# End Source File -# Begin Source File - -SOURCE=.\pssr.h -# End Source File -# Begin Source File - -SOURCE=.\pubkey.h -# End Source File -# Begin Source File - -SOURCE=.\pwdbased.h -# End Source File -# Begin Source File - -SOURCE=.\queue.h -# End Source File -# Begin Source File - -SOURCE=.\rabin.h -# End Source File -# Begin Source File - -SOURCE=.\randpool.h -# End Source File -# Begin Source File - -SOURCE=.\rc2.h -# End Source File -# Begin Source File - -SOURCE=.\rc5.h -# End Source File -# Begin Source File - -SOURCE=.\rc6.h -# End Source File -# Begin Source File - -SOURCE=.\rijndael.h -# End Source File -# Begin Source File - -SOURCE=.\ripemd.h -# End Source File -# Begin Source File - -SOURCE=.\rng.h -# End Source File -# Begin Source File - -SOURCE=.\rsa.h -# End Source File -# Begin Source File - -SOURCE=.\rw.h -# End Source File -# Begin Source File - -SOURCE=.\safer.h -# End Source File -# Begin Source File - -SOURCE=.\salsa.h -# End Source File -# Begin Source File - -SOURCE=.\seal.h -# End Source File -# Begin Source File - -SOURCE=.\secblock.h -# End Source File -# Begin Source File - -SOURCE=.\seckey.h -# End Source File -# Begin Source File - -SOURCE=.\seed.h -# End Source File -# Begin Source File - -SOURCE=.\serpent.h -# End Source File -# Begin Source File - -SOURCE=.\sha.h -# End Source File -# Begin Source File - -SOURCE=.\sha3.h -# End Source File -# Begin Source File - -SOURCE=.\shacal2.h -# End Source File -# Begin Source File - -SOURCE=.\shark.h -# End Source File -# Begin Source File - -SOURCE=.\simple.h -# End Source File -# Begin Source File - -SOURCE=.\skipjack.h -# End Source File -# Begin Source File - -SOURCE=.\smartptr.h -# End Source File -# Begin Source File - -SOURCE=.\socketft.h -# End Source File -# Begin Source File - -SOURCE=.\square.h -# End Source File -# Begin Source File - -SOURCE=.\strciphr.h -# End Source File -# Begin Source File - -SOURCE=.\tea.h -# End Source File -# Begin Source File - -SOURCE=.\tiger.h -# End Source File -# Begin Source File - -SOURCE=.\trdlocal.h -# End Source File -# Begin Source File - -SOURCE=.\trunhash.h -# End Source File -# Begin Source File - -SOURCE=.\ttmac.h -# End Source File -# Begin Source File - -SOURCE=.\twofish.h -# End Source File -# Begin Source File - -SOURCE=.\wait.h -# End Source File -# Begin Source File - -SOURCE=.\wake.h -# End Source File -# Begin Source File - -SOURCE=.\whrlpool.h -# End Source File -# Begin Source File - -SOURCE=.\winpipes.h -# End Source File -# Begin Source File - -SOURCE=.\words.h -# End Source File -# Begin Source File - -SOURCE=.\xtr.h -# End Source File -# Begin Source File - -SOURCE=.\xtrcrypt.h -# End Source File -# Begin Source File - -SOURCE=.\zdeflate.h -# End Source File -# Begin Source File - -SOURCE=.\zinflate.h -# End Source File -# Begin Source File - -SOURCE=.\zlib.h -# End Source File -# End Group -# Begin Group "Miscellaneous" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\Doxyfile -# End Source File -# Begin Source File - -SOURCE=.\GNUmakefile -# End Source File -# Begin Source File - -SOURCE=.\license.txt -# End Source File -# Begin Source File - -SOURCE=.\readme.txt -# End Source File -# End Group -# End Target -# End Project diff --git a/external/crypto++-5.6.3/cryptlib.h b/external/crypto++-5.6.3/cryptlib.h deleted file mode 100644 index 633cc640d..000000000 --- a/external/crypto++-5.6.3/cryptlib.h +++ /dev/null @@ -1,2667 +0,0 @@ -// cryptlib.h - written and placed in the public domain by Wei Dai - -//! \file cryptlib.h -//! \brief Abstract base classes that provide a uniform interface to this library. - -/*! \mainpage Crypto++ Library 5.6.3 API Reference -
-
Abstract Base Classes
- cryptlib.h -
Authenticated Encryption Modes
- CCM, EAX, \ref GCM "GCM (2K tables)", \ref GCM "GCM (64K tables)" -
Block Ciphers
- \ref Rijndael "AES", Weak::ARC4, Blowfish, BTEA, Camellia, CAST128, CAST256, DES, \ref DES_EDE2 "2-key Triple-DES", \ref DES_EDE3 "3-key Triple-DES", - \ref DES_XEX3 "DESX", GOST, IDEA, \ref LR "Luby-Rackoff", MARS, RC2, RC5, RC6, \ref SAFER_K "SAFER-K", \ref SAFER_SK "SAFER-SK", SEED, Serpent, - \ref SHACAL2 "SHACAL-2", SHARK, SKIPJACK, -Square, TEA, \ref ThreeWay "3-Way", Twofish, XTEA -
Stream Ciphers
- \ref Panama "Panama-LE", \ref Panama "Panama-BE", Salsa20, \ref SEAL "SEAL-LE", \ref SEAL "SEAL-BE", WAKE, XSalsa20 -
Hash Functions
- SHA1, SHA224, SHA256, SHA384, SHA512, \ref SHA3 "SHA-3", Tiger, Whirlpool, RIPEMD160, RIPEMD320, RIPEMD128, RIPEMD256, Weak::MD2, Weak::MD4, Weak::MD5 -
Non-Cryptographic Checksums
- CRC32, Adler32 -
Message Authentication Codes
- VMAC, HMAC, CBC_MAC, CMAC, DMAC, TTMAC, \ref GCM "GCM (GMAC)" -
Random Number Generators
- NullRNG(), LC_RNG, RandomPool, BlockingRng, NonblockingRng, AutoSeededRandomPool, AutoSeededX917RNG, - \ref MersenneTwister "MersenneTwister (MT19937 and MT19937-AR)", RDRAND, RDSEED -
Key Derivation and Password-based Cryptography
- HKDF, \ref PKCS12_PBKDF "PBKDF (PKCS #12)", \ref PKCS5_PBKDF1 "PBKDF-1 (PKCS #5)", \ref PKCS5_PBKDF2_HMAC "PBKDF-2/HMAC (PKCS #5)" -
Public Key Cryptosystems
- DLIES, ECIES, LUCES, RSAES, RabinES, LUC_IES -
Public Key Signature Schemes
- DSA2, GDSA, ECDSA, NR, ECNR, LUCSS, RSASS, RSASS_ISO, RabinSS, RWSS, ESIGN -
Key Agreement
- DH, DH2, MQV, ECDH, ECMQV, XTR_DH -
Algebraic Structures
- Integer, PolynomialMod2, PolynomialOver, RingOfPolynomialsOver, - ModularArithmetic, MontgomeryRepresentation, GFP2_ONB, GF2NP, GF256, GF2_32, EC2N, ECP -
Secret Sharing and Information Dispersal
- SecretSharing, SecretRecovery, InformationDispersal, InformationRecovery -
Compression
- Deflator, Inflator, Gzip, Gunzip, ZlibCompressor, ZlibDecompressor -
Input Source Classes
- StringSource, ArraySource, FileSource, SocketSource, WindowsPipeSource, RandomNumberSource -
Output Sink Classes
- StringSinkTemplate, StringSink, ArraySink, FileSink, SocketSink, WindowsPipeSink, RandomNumberSink -
Filter Wrappers
- StreamTransformationFilter, HashFilter, HashVerificationFilter, SignerFilter, SignatureVerificationFilter -
Binary to Text Encoders and Decoders
- HexEncoder, HexDecoder, Base64Encoder, Base64Decoder, Base64URLEncoder, Base64URLDecoder, Base32Encoder, Base32Decoder -
Wrappers for OS features
- Timer, Socket, WindowsHandle, ThreadLocalStorage, ThreadUserTimer -
FIPS 140 validated cryptography
- fips140.h -
- -In the DLL version of Crypto++, only the following implementation class are available. -
-
Block Ciphers
- AES, \ref DES_EDE2 "2-key Triple-DES", \ref DES_EDE3 "3-key Triple-DES", SKIPJACK -
Cipher Modes (replace template parameter BC with one of the block ciphers above)
- \ref ECB_Mode "ECB_Mode", \ref CTR_Mode "CTR_Mode", \ref CBC_Mode "CBC_Mode", \ref CFB_FIPS_Mode "CFB_FIPS_Mode", \ref OFB_Mode "OFB_Mode", \ref GCM "GCM" -
Hash Functions
- SHA1, SHA224, SHA256, SHA384, SHA512 -
Public Key Signature Schemes (replace template parameter H with one of the hash functions above)
- RSASS\, RSASS\, RSASS_ISO\, RWSS\, DSA, ECDSA\, ECDSA\ -
Message Authentication Codes (replace template parameter H with one of the hash functions above)
- HMAC\, CBC_MAC\, CBC_MAC\, GCM\ -
Random Number Generators
- DefaultAutoSeededRNG (AutoSeededX917RNG\) -
Key Agreement
- DH, DH2 -
Public Key Cryptosystems
- RSAES\ \> -
- -

This reference manual is a work in progress. Some classes are lack detailed descriptions. -

Click here to download a zip archive containing this manual. -

Thanks to Ryan Phillips for providing the Doxygen configuration file -and getting us started on the manual. -*/ - -#ifndef CRYPTOPP_CRYPTLIB_H -#define CRYPTOPP_CRYPTLIB_H - -#include "config.h" -#include "stdcpp.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4127 4189 4702) -#endif - -NAMESPACE_BEGIN(CryptoPP) - -// forward declarations -class Integer; -class RandomNumberGenerator; -class BufferedTransformation; - -//! \brief Specifies a direction for a cipher to operate -enum CipherDir {ENCRYPTION, DECRYPTION}; - -//! \brief Represents infinite time -const unsigned long INFINITE_TIME = ULONG_MAX; - -// VC60 workaround: using enums as template parameters causes problems -//! \brief Converts a typename to an enumerated value -template -struct EnumToType -{ - static ENUM_TYPE ToEnum() {return (ENUM_TYPE)VALUE;} -}; - -//! \brief Provides the byte ordering -enum ByteOrder {LITTLE_ENDIAN_ORDER = 0, BIG_ENDIAN_ORDER = 1}; -//! \typedef Provides a constant for LittleEndian -typedef EnumToType LittleEndian; -//! \typedef Provides a constant for BigEndian -typedef EnumToType BigEndian; - -//! \class Exception -//! \brief Base class for all exceptions thrown by Crypto++ -class CRYPTOPP_DLL Exception : public std::exception -{ -public: - //! error types - enum ErrorType { - //! \brief A method was called which was not implemented - NOT_IMPLEMENTED, - //! \brief An invalid argument was detected - INVALID_ARGUMENT, - //! \brief BufferedTransformation received a Flush(true) signal but can't flush buffers - CANNOT_FLUSH, - //! \brief Data integerity check, such as CRC or MAC, failed - DATA_INTEGRITY_CHECK_FAILED, - //! \brief Input data was received that did not conform to expected format - INVALID_DATA_FORMAT, - //! \brief Error reading from input device or writing to output device - IO_ERROR, - //! \brief Some other error occurred not belong to any of the above categories - OTHER_ERROR - }; - - //! \brief Construct a new Exception - explicit Exception(ErrorType errorType, const std::string &s) : m_errorType(errorType), m_what(s) {} - virtual ~Exception() throw() {} - - //! \brief Retrieves a C-string describing the exception - const char *what() const throw() {return (m_what.c_str());} - //! \brief Retrieves a string describing the exception - const std::string &GetWhat() const {return m_what;} - //! \brief Sets the error string for the exception - void SetWhat(const std::string &s) {m_what = s;} - //! \brief Retrieves the error type for the exception - ErrorType GetErrorType() const {return m_errorType;} - //! \brief Sets the error type for the exceptions - void SetErrorType(ErrorType errorType) {m_errorType = errorType;} - -private: - ErrorType m_errorType; - std::string m_what; -}; - -//! \brief An invalid argument was detected -class CRYPTOPP_DLL InvalidArgument : public Exception -{ -public: - explicit InvalidArgument(const std::string &s) : Exception(INVALID_ARGUMENT, s) {} -}; - -//! \brief Input data was received that did not conform to expected format -class CRYPTOPP_DLL InvalidDataFormat : public Exception -{ -public: - explicit InvalidDataFormat(const std::string &s) : Exception(INVALID_DATA_FORMAT, s) {} -}; - -//! \brief A decryption filter encountered invalid ciphertext -class CRYPTOPP_DLL InvalidCiphertext : public InvalidDataFormat -{ -public: - explicit InvalidCiphertext(const std::string &s) : InvalidDataFormat(s) {} -}; - -//! \brief A method was called which was not implemented -class CRYPTOPP_DLL NotImplemented : public Exception -{ -public: - explicit NotImplemented(const std::string &s) : Exception(NOT_IMPLEMENTED, s) {} -}; - -//! \brief Flush(true) was called but it can't completely flush its buffers -class CRYPTOPP_DLL CannotFlush : public Exception -{ -public: - explicit CannotFlush(const std::string &s) : Exception(CANNOT_FLUSH, s) {} -}; - -//! \brief The operating system reported an error -class CRYPTOPP_DLL OS_Error : public Exception -{ -public: - OS_Error(ErrorType errorType, const std::string &s, const std::string& operation, int errorCode) - : Exception(errorType, s), m_operation(operation), m_errorCode(errorCode) {} - ~OS_Error() throw() {} - - //! \brief Retrieve the operating system API that reported the error - const std::string & GetOperation() const {return m_operation;} - //! \brief Retrieve the error code returned by the operating system - int GetErrorCode() const {return m_errorCode;} - -protected: - std::string m_operation; - int m_errorCode; -}; - -//! \class DecodingResult -//! \brief Returns a decoding results -struct CRYPTOPP_DLL DecodingResult -{ - //! \brief Constructs a DecodingResult - //! \details isValidCoding is initialized to false and messageLength is initialized to 0. - explicit DecodingResult() : isValidCoding(false), messageLength(0) {} - //! \brief Constructs a DecodingResult - //! \param len the message length - //! \details isValidCoding is initialized to true. - explicit DecodingResult(size_t len) : isValidCoding(true), messageLength(len) {} - - //! \brief Compare two DecodingResult - //! \param rhs the other DecodingResult - //! \returns true if both isValidCoding and messageLength are equal, false otherwise - bool operator==(const DecodingResult &rhs) const {return isValidCoding == rhs.isValidCoding && messageLength == rhs.messageLength;} - //! \brief Compare two DecodingResult - //! \param rhs the other DecodingResult - //! \returns true if either isValidCoding or messageLength is \a not equal, false otherwise - //! \details Returns !operator==(rhs). - bool operator!=(const DecodingResult &rhs) const {return !operator==(rhs);} - - //! \brief Flag to indicate the decoding is valid - bool isValidCoding; - //! \brief Recovered message length if isValidCoding is true, undefined otherwise - size_t messageLength; - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - operator size_t() const {return isValidCoding ? messageLength : 0;} -#endif -}; - -//! \class NameValuePairs -//! \brief Interface for retrieving values given their names -//! \details This class is used to safely pass a variable number of arbitrarily typed arguments to functions -//! and to read values from keys and crypto parameters. -//! \details To obtain an object that implements NameValuePairs for the purpose of parameter -//! passing, use the MakeParameters() function. -//! \details To get a value from NameValuePairs, you need to know the name and the type of the value. -//! Call GetValueNames() on a NameValuePairs object to obtain a list of value names that it supports. -//! then look at the Name namespace documentation to see what the type of each value is, or -//! alternatively, call GetIntValue() with the value name, and if the type is not int, a -//! ValueTypeMismatch exception will be thrown and you can get the actual type from the exception object. -class CRYPTOPP_NO_VTABLE NameValuePairs -{ -public: - virtual ~NameValuePairs() {} - - //! \class ValueTypeMismatch - //! \brief Thrown when an unexpected type is encountered - //! \details Exception thrown when trying to retrieve a value using a different type than expected - class CRYPTOPP_DLL ValueTypeMismatch : public InvalidArgument - { - public: - //! \brief Construct a ValueTypeMismatch - //! \param name the name of the value - //! \param stored the \a actual type of the value stored - //! \param retrieving the \a presumed type of the value retrieved - ValueTypeMismatch(const std::string &name, const std::type_info &stored, const std::type_info &retrieving) - : InvalidArgument("NameValuePairs: type mismatch for '" + name + "', stored '" + stored.name() + "', trying to retrieve '" + retrieving.name() + "'") - , m_stored(stored), m_retrieving(retrieving) {} - - //! \brief Provides the stored type - //! \returns the C++ mangled name of the type - const std::type_info & GetStoredTypeInfo() const {return m_stored;} - - //! \brief Provides the retrieveing type - //! \returns the C++ mangled name of the type - const std::type_info & GetRetrievingTypeInfo() const {return m_retrieving;} - - private: - const std::type_info &m_stored; - const std::type_info &m_retrieving; - }; - - //! \brief Get a copy of this object or subobject - //! \tparam T class or type - //! \param object reference to a variable that receives the value - template - bool GetThisObject(T &object) const - { - return GetValue((std::string("ThisObject:")+typeid(T).name()).c_str(), object); - } - - //! \brief Get a pointer to this object - //! \tparam T class or type - //! \param ptr reference to a pointer to a variable that receives the value - template - bool GetThisPointer(T *&ptr) const - { - return GetValue((std::string("ThisPointer:")+typeid(T).name()).c_str(), ptr); - } - - //! \brief Get a named value - //! \tparam T class or type - //! \param name the name of the object or value to retrieve - //! \param value reference to a variable that receives the value - //! \returns true if the value was retrieved, false otherwise - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - template - bool GetValue(const char *name, T &value) const - { - return GetVoidValue(name, typeid(T), &value); - } - - //! \brief Get a named value - //! \tparam T class or type - //! \param name the name of the object or value to retrieve - //! \param defaultValue the default value of the class or type if it does not exist - //! \returns the object or value - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - template - T GetValueWithDefault(const char *name, T defaultValue) const - { - T value; - bool result = GetValue(name, value); - // No assert... this recovers from failure - if (result) {return value;} - return defaultValue; - } - - //! \brief Get a list of value names that can be retrieved - //! \returns a list of names available to retrieve - //! \details the items in the list are delimited with a colon. - CRYPTOPP_DLL std::string GetValueNames() const - {std::string result; GetValue("ValueNames", result); return result;} - - //! \brief Get a named value with type int - //! \param name the name of the value to retrieve - //! \param value the value retrieved upon success - //! \returns true if an int value was retrieved, false otherwise - //! \details GetIntValue() is used to ensure we don't accidentally try to get an - //! unsigned int or some other type when we mean int (which is the most common case) - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - CRYPTOPP_DLL bool GetIntValue(const char *name, int &value) const - {return GetValue(name, value);} - - //! \brief Get a named value with type int, with default - //! \param name the name of the value to retrieve - //! \param defaultValue the default value if the name does not exist - //! \returns the value retrieved on success or the default value - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const - {return GetValueWithDefault(name, defaultValue);} - - //! \brief Ensures an expected name and type is present - //! \param name the name of the value - //! \param stored the type that was stored for the name - //! \param retrieving the type that is being retrieved for the name - //! \throws ValueTypeMismatch - //! \details ThrowIfTypeMismatch() effectively performs a type safety check. - //! stored and retrieving are C++ mangled names for the type. - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - CRYPTOPP_DLL static void CRYPTOPP_API ThrowIfTypeMismatch(const char *name, const std::type_info &stored, const std::type_info &retrieving) - {if (stored != retrieving) throw ValueTypeMismatch(name, stored, retrieving);} - - //! \brief Retrieves a required name/value pair - //! \tparam T class or type - //! \param className the name of the class - //! \param name the name of the value - //! \param value reference to a variable to receive the value - //! \throws InvalidArgument - //! \details GetRequiredParameter() throws InvalidArgument if the name - //! is not present or not of the expected type T. - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - template - void GetRequiredParameter(const char *className, const char *name, T &value) const - { - if (!GetValue(name, value)) - throw InvalidArgument(std::string(className) + ": missing required parameter '" + name + "'"); - } - - //! \brief Retrieves a required name/value pair - //! \param className the name of the class - //! \param name the name of the value - //! \param value reference to a variable to receive the value - //! \throws InvalidArgument - //! \details GetRequiredParameter() throws InvalidArgument if the name - //! is not present or not of the expected type T. - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - CRYPTOPP_DLL void GetRequiredIntParameter(const char *className, const char *name, int &value) const - { - if (!GetIntValue(name, value)) - throw InvalidArgument(std::string(className) + ": missing required parameter '" + name + "'"); - } - - //! \brief Get a named value - //! \param name the name of the object or value to retrieve - //! \param valueType reference to a variable that receives the value - //! \param pValue void pointer to a variable that receives the value - //! \returns true if the value was retrieved, false otherwise - //! \details GetVoidValue() retrives the value of name if it exists. - //! \note GetVoidValue() is an internal function and should be implemented - //! by derived classes. Users should use one of the other functions instead. - //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), - //! GetRequiredParameter() and GetRequiredIntParameter() - CRYPTOPP_DLL virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0; -}; - -#if CRYPTOPP_DOXYGEN_PROCESSING - -//! \brief Namespace containing value name definitions. -//! \details Name is part of the CryptoPP namespace. -//! \details The semantics of value names, types are: -//!

-//!     ThisObject:ClassName (ClassName, copy of this object or a subobject)
-//!     ThisPointer:ClassName (const ClassName *, pointer to this object or a subobject)
-//! 
-DOCUMENTED_NAMESPACE_BEGIN(Name) -// more names defined in argnames.h -DOCUMENTED_NAMESPACE_END - -//! \brief Namespace containing weak and wounded algorithms. -//! \details Weak is part of the CryptoPP namespace. Schemes and algorithms are moved into Weak -//! when their security level is reduced to an unacceptable value by contemporary standards. -DOCUMENTED_NAMESPACE_BEGIN(Weak) -// weak and wounded algorithms -DOCUMENTED_NAMESPACE_END -#endif - -//! \brief An empty set of name-value pairs -extern CRYPTOPP_DLL const NameValuePairs &g_nullNameValuePairs; - -// ******************************************************** - -//! \class Clonable -//! \brief Interface for cloning objects -//! \note this is \a not implemented by most classes -//! \sa ClonableImpl, NotCopyable -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Clonable -{ -public: - virtual ~Clonable() {} - - //! \brief Copies this object - //! \returns a copy of this object - //! \throws NotImplemented - //! \note this is \a not implemented by most classes - //! \sa NotCopyable - virtual Clonable* Clone() const {throw NotImplemented("Clone() is not implemented yet.");} // TODO: make this =0 -}; - -//! \class Algorithm -//! \brief Interface for all crypto algorithms -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Algorithm : public Clonable -{ -public: - //! \brief Interface for all crypto algorithms - //! \param checkSelfTestStatus determines whether the object can proceed if the self - //! tests have not been run or failed. - //! \details When FIPS 140-2 compliance is enabled and checkSelfTestStatus == true, - //! this constructor throws SelfTestFailure if the self test hasn't been run or fails. - //! \details FIPS 140-2 compliance is disabled by default. It is only used by certain - //! versions of the library when the library is built as a DLL on Windows. Also see - //! CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 in config.h. - Algorithm(bool checkSelfTestStatus = true); - - //! \brief Provides the name of this algorithm - //! \returns the standard algorithm name - //! \details The standard algorithm name can be a name like \a AES or \a AES/GCM. Some algorithms - //! do not have standard names yet. For example, there is no standard algorithm name for - //! Shoup's ECIES. - //! \note AlgorithmName is not universally implemented yet - virtual std::string AlgorithmName() const {return "unknown";} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~Algorithm() {} -#endif -}; - -//! \class SimpleKeyingInterface -//! Interface for algorithms that take byte strings as keys -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyingInterface -{ -public: - virtual ~SimpleKeyingInterface() {} - - //! \brief Returns smallest valid key length in bytes - virtual size_t MinKeyLength() const =0; - //! \brief Returns largest valid key length in bytes - virtual size_t MaxKeyLength() const =0; - //! \brief Returns default (recommended) key length in bytes - virtual size_t DefaultKeyLength() const =0; - - //! \brief - //! \returns the smallest valid key length in bytes that is greater than or equal to min(n, GetMaxKeyLength()) - virtual size_t GetValidKeyLength(size_t n) const =0; - - //! \brief Returns whether keylength is a valid key length - //! \details Internally the function calls GetValidKeyLength() - virtual bool IsValidKeyLength(size_t keylength) const - {return keylength == GetValidKeyLength(keylength);} - - //! \brief Sets or reset the key of this object - //! \param key the key to use when keying the object - //! \param length the size of the key, in bytes - //! \param params additional initialization parameters that cannot be passed - //! directly through the constructor - virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms = g_nullNameValuePairs); - - //! \brief Sets or reset the key of this object - //! \param key the key to use when keying the object - //! \param length the size of the key, in bytes - //! \param rounds the number of rounds to apply the transformation function, - //! if applicable - //! \details SetKeyWithRounds calls SetKey with an NameValuePairs - //! object that just specifies rounds. rounds is an integer parameter, - //! and -1 means use the default number of rounds. - void SetKeyWithRounds(const byte *key, size_t length, int rounds); - - //! \brief Sets or reset the key of this object - //! \param key the key to use when keying the object - //! \param length the size of the key, in bytes - //! \param iv the intiialization vector to use when keying the object - //! \param ivLength the size of the iv, in bytes - //! \details SetKeyWithIV calls SetKey with an NameValuePairs object - //! that just specifies iv. iv is a byte buffer with size ivLength. - void SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength); - - //! \brief Sets or reset the key of this object - //! \param key the key to use when keying the object - //! \param length the size of the key, in bytes - //! \param iv the intiialization vector to use when keying the object - //! \details SetKeyWithIV calls SetKey with an NameValuePairs object - //! that just specifies iv. iv is a byte buffer, and it must have - //! a size IVSize. - void SetKeyWithIV(const byte *key, size_t length, const byte *iv) - {SetKeyWithIV(key, length, iv, IVSize());} - - //! \brief Provides IV requirements as an enumerated value. - enum IV_Requirement { - //! \brief The IV must be unique - UNIQUE_IV = 0, - //! \brief The IV must be random - RANDOM_IV, - //! \brief The IV must be unpredictable - UNPREDICTABLE_RANDOM_IV, - //! \brief The IV is set by the object - INTERNALLY_GENERATED_IV, - //! \brief The object does not use an IV - NOT_RESYNCHRONIZABLE - }; - - //! returns the minimal requirement for secure IVs - virtual IV_Requirement IVRequirement() const =0; - - //! returns whether the object can be resynchronized (i.e. supports initialization vectors) - /*! If this function returns true, and no IV is passed to SetKey() and CanUseStructuredIVs()==true, an IV of all 0's will be assumed. */ - bool IsResynchronizable() const {return IVRequirement() < NOT_RESYNCHRONIZABLE;} - //! returns whether the object can use random IVs (in addition to ones returned by GetNextIV) - bool CanUseRandomIVs() const {return IVRequirement() <= UNPREDICTABLE_RANDOM_IV;} - //! returns whether the object can use random but possibly predictable IVs (in addition to ones returned by GetNextIV) - bool CanUsePredictableIVs() const {return IVRequirement() <= RANDOM_IV;} - //! returns whether the object can use structured IVs, for example a counter (in addition to ones returned by GetNextIV) - bool CanUseStructuredIVs() const {return IVRequirement() <= UNIQUE_IV;} - - //! \brief Returns length of the IV accepted by this object - //! \details The default implementation throws NotImplemented - virtual unsigned int IVSize() const - {throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");} - //! returns default length of IVs accepted by this object - unsigned int DefaultIVLength() const {return IVSize();} - //! returns minimal length of IVs accepted by this object - virtual unsigned int MinIVLength() const {return IVSize();} - //! returns maximal length of IVs accepted by this object - virtual unsigned int MaxIVLength() const {return IVSize();} - //! resynchronize with an IV. ivLength=-1 means use IVSize() - virtual void Resynchronize(const byte *iv, int ivLength=-1) { - CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(ivLength); - throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization"); - } - - //! \brief Gets a secure IV for the next message - //! \param rng a RandomNumberGenerator to produce keying material - //! \param iv a block of bytes to receive the IV - //! \details This method should be called after you finish encrypting one message and are ready - //! to start the next one. After calling it, you must call SetKey() or Resynchronize() - //! before using this object again. - //! \details key must be at least IVSize() in length. - //! \note This method is not implemented on decryption objects. - virtual void GetNextIV(RandomNumberGenerator &rng, byte *iv); - -protected: - //! \brief Returns the base class Algorithm - //! \returns the base class Algorithm - virtual const Algorithm & GetAlgorithm() const =0; - - //! \brief Sets the key for this object without performing parameter validation - //! \param key a byte buffer used to key the cipher - //! \param length the length of the byte buffer - //! \param params additional parameters passed as NameValuePairs - //! \details key must be at least DEFAULT_KEYLENGTH in length. - virtual void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) =0; - - //! \brief Validates the key length - //! \param length the size of the keying material, in bytes - //! \throws InvalidKeyLength if the key length is invalid - void ThrowIfInvalidKeyLength(size_t length); - - //! \brief Validates the object - //! \throws InvalidArgument if the IV is present - //! \details Internally, the default implementation calls IsResynchronizable() and throws - //! InvalidArgument if the function returns true. - //! \note called when no IV is passed - void ThrowIfResynchronizable(); - - //! \brief Validates the IV - //! \param iv the IV with a length of IVSize, in bytes - //! \throws InvalidArgument on failure - //! \details Internally, the default implementation checks the iv. If iv is not NULL, - //! then the function succeeds. If iv is NULL, then IVRequirement is checked against - //! UNPREDICTABLE_RANDOM_IV. If IVRequirement is UNPREDICTABLE_RANDOM_IV, then - //! then the function succeeds. Otherwise, an exception is thrown. - void ThrowIfInvalidIV(const byte *iv); - - //! \brief Validates the IV length - //! \param length the size of the IV, in bytes - //! \throws InvalidArgument if the number of rounds are invalid - size_t ThrowIfInvalidIVLength(int length); - - //! \brief retrieves and validates the IV - //! \param params NameValuePairs with the IV supplied as a ConstByteArrayParameter - //! \param size the length of the IV, in bytes - //! \returns a pointer to the first byte of the IV - //! \throws InvalidArgument if the number of rounds are invalid - const byte * GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size); - - //! \brief Validates the key length - //! \param length the size of the keying material, in bytes - inline void AssertValidKeyLength(size_t length) const - {CRYPTOPP_UNUSED(length); assert(IsValidKeyLength(length));} -}; - -//! \brief Interface for the data processing part of block ciphers -//! \details Classes derived from BlockTransformation are block ciphers -//! in ECB mode (for example the DES::Encryption class), which are stateless. -//! These classes should not be used directly, but only in combination with -//! a mode class (see CipherModeDocumentation in modes.h). -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockTransformation : public Algorithm -{ -public: - //! \brief Encrypt or decrypt a block - //! \param inBlock the input message before processing - //! \param outBlock the output message after processing - //! \param xorBlock an optional XOR mask - //! \details ProcessAndXorBlock encrypts or decrypts inBlock, xor with xorBlock, and write to outBlock. - //! \details The size of the block is determined by the block cipher and its documentation. Use - //! BLOCKSIZE at compile time, or BlockSize() at runtime. - //! \note The message can be transformed in-place, or the buffers must \a not overlap - //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize() - virtual void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0; - - //! \brief Encrypt or decrypt a block - //! \param inBlock the input message before processing - //! \param outBlock the output message after processing - //! \details ProcessBlock encrypts or decrypts inBlock and write to outBlock. - //! \details The size of the block is determined by the block cipher and its documentation. - //! Use BLOCKSIZE at compile time, or BlockSize() at runtime. - //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize() - //! \note The message can be transformed in-place, or the buffers must \a not overlap - void ProcessBlock(const byte *inBlock, byte *outBlock) const - {ProcessAndXorBlock(inBlock, NULL, outBlock);} - - //! \brief Encrypt or decrypt a block in place - //! \param inoutBlock the input message before processing - //! \details ProcessBlock encrypts or decrypts inoutBlock in-place. - //! \details The size of the block is determined by the block cipher and its documentation. - //! Use BLOCKSIZE at compile time, or BlockSize() at runtime. - //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize() - void ProcessBlock(byte *inoutBlock) const - {ProcessAndXorBlock(inoutBlock, NULL, inoutBlock);} - - //! Provides the block size of the cipher - //! \returns the block size of the cipher, in bytes - virtual unsigned int BlockSize() const =0; - - //! \brief Provides input and output data alignment for optimal performance. - //! \returns the input data alignment that provides optimal performance - virtual unsigned int OptimalDataAlignment() const; - - //! returns true if this is a permutation (i.e. there is an inverse transformation) - virtual bool IsPermutation() const {return true;} - - //! \brief Determines if the cipher is being operated in its forward direction - //! \returns true if DIR is ENCRYPTION, false otherwise - //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() - virtual bool IsForwardTransformation() const =0; - - //! \brief Determines the number of blocks that can be processed in parallel - //! \return the number of blocks that can be processed in parallel, for bit-slicing implementations - //! \details Bit-slicing is often used to improve throughput and minimize timing attacks. - virtual unsigned int OptimalNumberOfParallelBlocks() const {return 1;} - - //! \brief Bit flags that control AdvancedProcessBlocks() behavior - enum FlagsForAdvancedProcessBlocks { - //! \brief inBlock is a counter - BT_InBlockIsCounter=1, - //! \brief should not modify block pointers - BT_DontIncrementInOutPointers=2, - //! \brief - BT_XorInput=4, - //! \brief perform the transformation in reverse - BT_ReverseDirection=8, - //! \brief - BT_AllowParallel=16}; - - //! \brief Encrypt and xor multiple blocks using additional flags - //! \param inBlocks the input message before processing - //! \param xorBlocks an optional XOR mask - //! \param outBlocks the output message after processing - //! \param length the size of the blocks, in bytes - //! \param flags additional flags to control processing - //! \details Encrypt and xor multiple blocks according to FlagsForAdvancedProcessBlocks flags. - //! \note If BT_InBlockIsCounter is set, then the last byte of inBlocks may be modified. - virtual size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const; - - //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() - inline CipherDir GetCipherDirection() const {return IsForwardTransformation() ? ENCRYPTION : DECRYPTION;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~BlockTransformation() {} -#endif -}; - -//! \class StreamTransformation -//! \brief Interface for the data processing portion of stream ciphers -//! \sa StreamTransformationFilter() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE StreamTransformation : public Algorithm -{ -public: - //! \brief Provides a reference to this object - //! \returns A reference to this object - //! \details Useful for passing a temporary object to a function that takes a non-const reference - StreamTransformation& Ref() {return *this;} - - //! \brief Provides the mandatory block size of the cipher - //! \returns The block size of the cipher if input must be processed in blocks, 1 otherwise - virtual unsigned int MandatoryBlockSize() const {return 1;} - - //! \brief Provides the input block size most efficient for this cipher. - //! \returns The input block size that is most efficient for the cipher - //! \details The base class implemnetation returns MandatoryBlockSize(). - //! \note Optimal input length is - //! n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0. - virtual unsigned int OptimalBlockSize() const {return MandatoryBlockSize();} - - //! \brief Provides the number of bytes used in the current block when processing at optimal block size. - //! \returns the number of bytes used in the current block when processing at the optimal block size - virtual unsigned int GetOptimalBlockSizeUsed() const {return 0;} - - //! \brief Provides input and output data alignment for optimal performance. - //! \returns the input data alignment that provides optimal performance - virtual unsigned int OptimalDataAlignment() const; - - //! \brief Encrypt or decrypt an array of bytes - //! \param outString the output byte buffer - //! \param inString the input byte buffer - //! \param length the size of the input and output byte buffers, in bytes - //! \details Either inString == outString, or they must not overlap. - virtual void ProcessData(byte *outString, const byte *inString, size_t length) =0; - - //! \brief Encrypt or decrypt the last block of data - //! \param outString the output byte buffer - //! \param inString the input byte buffer - //! \param length the size of the input and output byte buffers, in bytes - //! ProcessLastBlock is used when the last block of data is special. - //! Currently the only use of this function is CBC-CTS mode. - virtual void ProcessLastBlock(byte *outString, const byte *inString, size_t length); - - //! returns the minimum size of the last block, 0 indicating the last block is not special - virtual unsigned int MinLastBlockSize() const {return 0;} - - //! \brief Encrypt or decrypt a string of bytes - //! \param inoutString the string to process - //! \param length the size of the inoutString, in bytes - //! \details Internally, the base class implementation calls ProcessData(). - inline void ProcessString(byte *inoutString, size_t length) - {ProcessData(inoutString, inoutString, length);} - - //! \brief Encrypt or decrypt a string of bytes - //! \param outString the output string to process - //! \param inString the input string to process - //! \param length the size of the input and output strings, in bytes - //! \details Internally, the base class implementation calls ProcessData(). - inline void ProcessString(byte *outString, const byte *inString, size_t length) - {ProcessData(outString, inString, length);} - - //! \brief Encrypt or decrypt a byte - //! \param input the input byte to process - //! \details Internally, the base class implementation calls ProcessData() with a size of 1. - inline byte ProcessByte(byte input) - {ProcessData(&input, &input, 1); return input;} - - //! \brief Determines whether the cipher supports random access - //! \returns true if the cipher supports random access, false otherwise - virtual bool IsRandomAccess() const =0; - - //! \brief Seek to an absolute position - //! \param pos position to seek - //! \throws NotImplemented - //! \details The base class implementation throws NotImplemented. The function - //! asserts IsRandomAccess() in debug builds. - virtual void Seek(lword pos) - { - CRYPTOPP_UNUSED(pos); - assert(!IsRandomAccess()); - throw NotImplemented("StreamTransformation: this object doesn't support random access"); - } - - //! \brief Determines whether the cipher is self-inverting - //! \returns true if the cipher is self-inverting, false otherwise - //! \details IsSelfInverting determines whether this transformation is - //! self-inverting (e.g. xor with a keystream). - virtual bool IsSelfInverting() const =0; - - //! \brief Determines if the cipher is being operated in its forward direction - //! \returns true if DIR is ENCRYPTION, false otherwise - //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() - virtual bool IsForwardTransformation() const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~StreamTransformation() {} -#endif -}; - -//! \class HashTransformation -//! \brief Interface for hash functions and data processing part of MACs -//! \details HashTransformation objects are stateful. They are created in an initial state, -//! change state as Update() is called, and return to the initial -//! state when Final() is called. This interface allows a large message to -//! be hashed in pieces by calling Update() on each piece followed by -//! calling Final(). -//! \sa HashFilter(), HashVerificationFilter() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HashTransformation : public Algorithm -{ -public: - //! \brief Provides a reference to this object - //! \returns A reference to this object - //! \details Useful for passing a temporary object to a function that takes a non-const reference - HashTransformation& Ref() {return *this;} - - //! \brief Updates a hash with additional input - //! \param input the additional input as a buffer - //! \param length the size of the buffer, in bytes - virtual void Update(const byte *input, size_t length) =0; - - //! \brief Request space which can be written into by the caller - //! \param size the requested size of the buffer - //! \details The purpose of this method is to help avoid extra memory allocations. - //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made, - //! size is the requested size of the buffer. When the call returns, size is the size of - //! the array returned to the caller. - //! \details The base class implementation sets size to 0 and returns NULL. - //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of - virtual byte * CreateUpdateSpace(size_t &size) {size=0; return NULL;} - - //! \brief Computes the hash of the current message - //! \param digest a pointer to the buffer to receive the hash - //! \details digest must be equal to (or greater than) DigestSize(). Final() restarts the - //! hash for a new message. - virtual void Final(byte *digest) - {TruncatedFinal(digest, DigestSize());} - - //! \brief Restart the hash - //! \details Discards the current state, and restart for a new message - virtual void Restart() - {TruncatedFinal(NULL, 0);} - - //! Provides the digest size of the hash - //! \returns the digest size of the hash. - //! \details Calls to Final() require a buffer that is equal to (or greater than) DigestSize(). - virtual unsigned int DigestSize() const =0; - - //! Provides the tag size of the hash - //! \returns the tag size of the hash. - //! \details Same as DigestSize(). - unsigned int TagSize() const {return DigestSize();} - - //! \brief Provides the block size of the compression function - //! \returns the block size of the compression function, in bytes - //! \details BlockSize() will return 0 if the hash is not block based. For example, - //! SHA3 is a recursive hash (not an iterative hash), and it does not have a block size. - virtual unsigned int BlockSize() const {return 0;} - - //! \brief Provides the input block size most efficient for this hash. - //! \returns The input block size that is most efficient for the cipher - //! \details The base class implemnetation returns MandatoryBlockSize(). - //! \note Optimal input length is - //! n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0. - virtual unsigned int OptimalBlockSize() const {return 1;} - - //! \brief Provides input and output data alignment for optimal performance - //! \returns the input data alignment that provides optimal performance - virtual unsigned int OptimalDataAlignment() const; - - //! \brief Updates the hash with additional input and computes the hash of the current message - //! \param digest a pointer to the buffer to receive the hash - //! \param input the additional input as a buffer - //! \param length the size of the buffer, in bytes - //! \details Use this if your input is in one piece and you don't want to call Update() - //! and Final() separately - //! \details CalculateDigest() restarts the hash for the next nmessage. - virtual void CalculateDigest(byte *digest, const byte *input, size_t length) - {Update(input, length); Final(digest);} - - //! \brief Verifies the hash of the current message - //! \param digest a pointer to the buffer of an \a existing hash - //! \returns \p true if the existing hash matches the computed hash, \p false otherwise - //! \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize() - //! \details Calls to Verify() require a buffer that is equal to (or greater than) DigestSize(). - //! \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is - //! a constant time comparison function. digestLength cannot exceed DigestSize(). - //! \details Verify() restarts the hash for the next nmessage. - virtual bool Verify(const byte *digest) - {return TruncatedVerify(digest, DigestSize());} - - //! \brief Updates the hash with additional input and verifies the hash of the current message - //! \param digest a pointer to the buffer of an \a existing hash - //! \param input the additional input as a buffer - //! \param length the size of the buffer, in bytes - //! \returns \p true if the existing hash matches the computed hash, \p false otherwise - //! \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize() - //! \details Use this if your input is in one piece and you don't want to call Update() - //! and Verify() separately - //! \details VerifyDigest() performs a bitwise compare on the buffers using VerifyBufsEqual(), - //! which is a constant time comparison function. digestLength cannot exceed DigestSize(). - //! \details VerifyDigest() restarts the hash for the next nmessage. - virtual bool VerifyDigest(const byte *digest, const byte *input, size_t length) - {Update(input, length); return Verify(digest);} - - //! \brief Computes the hash of the current message - //! \param digest a pointer to the buffer to receive the hash - //! \param digestSize the size of the truncated digest, in bytes - //! \details TruncatedFinal() call Final() and then copies digestSize bytes to digest - //! \details TruncatedFinal() restarts the hash for the next nmessage. - virtual void TruncatedFinal(byte *digest, size_t digestSize) =0; - - //! \brief Updates the hash with additional input and computes the hash of the current message - //! \param digest a pointer to the buffer to receive the hash - //! \param digestSize the length of the truncated hash, in bytes - //! \param input the additional input as a buffer - //! \param length the size of the buffer, in bytes - //! \details Use this if your input is in one piece and you don't want to call Update() - //! and CalculateDigest() separately. - //! \details CalculateTruncatedDigest() restarts the hash for the next nmessage. - virtual void CalculateTruncatedDigest(byte *digest, size_t digestSize, const byte *input, size_t length) - {Update(input, length); TruncatedFinal(digest, digestSize);} - - //! \brief Verifies the hash of the current message - //! \param digest a pointer to the buffer of an \a existing hash - //! \param digestLength the size of the truncated hash, in bytes - //! \returns \p true if the existing hash matches the computed hash, \p false otherwise - //! \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize() - //! \details TruncatedVerify() is a truncated version of Verify(). It can operate on a - //! buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize(). - //! \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is - //! a constant time comparison function. digestLength cannot exceed DigestSize(). - //! \details TruncatedVerify() restarts the hash for the next nmessage. - virtual bool TruncatedVerify(const byte *digest, size_t digestLength); - - //! \brief Updates the hash with additional input and verifies the hash of the current message - //! \param digest a pointer to the buffer of an \a existing hash - //! \param digestLength the size of the truncated hash, in bytes - //! \param input the additional input as a buffer - //! \param length the size of the buffer, in bytes - //! \returns \p true if the existing hash matches the computed hash, \p false otherwise - //! \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize() - //! \details Use this if your input is in one piece and you don't want to call Update() - //! and TruncatedVerify() separately. - //! \details VerifyTruncatedDigest() is a truncated version of VerifyDigest(). It can operate - //! on a buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize(). - //! \details VerifyTruncatedDigest() restarts the hash for the next nmessage. - virtual bool VerifyTruncatedDigest(const byte *digest, size_t digestLength, const byte *input, size_t length) - {Update(input, length); return TruncatedVerify(digest, digestLength);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~HashTransformation() {} -#endif - -protected: - //! \brief Exception thrown when the truncated digest size is greater than DigestSize() - void ThrowIfInvalidTruncatedSize(size_t size) const; -}; - -typedef HashTransformation HashFunction; - -//! \brief Interface for one direction (encryption or decryption) of a block cipher -/*! \note These objects usually should not be used directly. See BlockTransformation for more details. */ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockCipher : public SimpleKeyingInterface, public BlockTransformation -{ -protected: - const Algorithm & GetAlgorithm() const {return *this;} -}; - -//! \brief Interface for one direction (encryption or decryption) of a stream cipher or cipher mode -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SymmetricCipher : public SimpleKeyingInterface, public StreamTransformation -{ -protected: - const Algorithm & GetAlgorithm() const {return *this;} -}; - -//! \brief Interface for message authentication codes -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE MessageAuthenticationCode : public SimpleKeyingInterface, public HashTransformation -{ -protected: - const Algorithm & GetAlgorithm() const {return *this;} -}; - -//! \brief Interface for one direction (encryption or decryption) of a stream cipher or block cipher mode with authentication -/*! The StreamTransformation part of this interface is used to encrypt/decrypt the data, and the MessageAuthenticationCode part of this - interface is used to input additional authenticated data (AAD, which is MAC'ed but not encrypted), and to generate/verify the MAC. */ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipher : public MessageAuthenticationCode, public StreamTransformation -{ -public: - //! this indicates that a member function was called in the wrong state, for example trying to encrypt a message before having set the key or IV - class BadState : public Exception - { - public: - explicit BadState(const std::string &name, const char *message) : Exception(OTHER_ERROR, name + ": " + message) {} - explicit BadState(const std::string &name, const char *function, const char *state) : Exception(OTHER_ERROR, name + ": " + function + " was called before " + state) {} - }; - - //! the maximum length of AAD that can be input before the encrypted data - virtual lword MaxHeaderLength() const =0; - //! the maximum length of encrypted data - virtual lword MaxMessageLength() const =0; - //! the maximum length of AAD that can be input after the encrypted data - virtual lword MaxFooterLength() const {return 0;} - //! if this function returns true, SpecifyDataLengths() must be called before attempting to input data - /*! This is the case for some schemes, such as CCM. */ - virtual bool NeedsPrespecifiedDataLengths() const {return false;} - //! this function only needs to be called if NeedsPrespecifiedDataLengths() returns true - void SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength=0); - //! encrypt and generate MAC in one call. will truncate MAC if macSize < TagSize() - virtual void EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength); - //! decrypt and verify MAC in one call, returning true iff MAC is valid. will assume MAC is truncated if macLength < TagSize() - virtual bool DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *ciphertext, size_t ciphertextLength); - - // redeclare this to avoid compiler ambiguity errors - virtual std::string AlgorithmName() const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~AuthenticatedSymmetricCipher() {} -#endif - -protected: - const Algorithm & GetAlgorithm() const - {return *static_cast(this);} - virtual void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength) - {CRYPTOPP_UNUSED(headerLength); CRYPTOPP_UNUSED(messageLength); CRYPTOPP_UNUSED(footerLength);} -}; - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY -typedef SymmetricCipher StreamCipher; -#endif - -//! \class RandomNumberGenerator -//! \brief Interface for random number generators -//! \details The library provides a number of random number generators, from software based to hardware based generators. -//! \details All generated values are uniformly distributed over the range specified. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomNumberGenerator : public Algorithm -{ -public: - //! \brief Update RNG state with additional unpredictable values - //! \param input the entropy to add to the generator - //! \param length the size of the input buffer - //! \throws NotImplemented - //! \details A generator may or may not accept additional entropy. Call CanIncorporateEntropy() to test for the - //! ability to use additional entropy. - //! \details If a derived class does not override IncorporateEntropy(), then the base class throws - //! NotImplemented. - virtual void IncorporateEntropy(const byte *input, size_t length) - { - CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length); - throw NotImplemented("RandomNumberGenerator: IncorporateEntropy not implemented"); - } - - //! \brief Determines if a generator can accept additional entropy - //! \returns true if IncorporateEntropy() is implemented - virtual bool CanIncorporateEntropy() const {return false;} - - //! \brief Generate new random byte and return it - //! \returns a random 8-bit byte - //! \details Default implementation calls GenerateBlock() with one byte. - //! \details All generated values are uniformly distributed over the range specified within the - //! the contraints of a particular generator. - virtual byte GenerateByte(); - - //! \brief Generate new random bit and return it - //! \returns a random bit - //! \details The default implementation calls GenerateByte() and return its lowest bit. - //! \details All generated values are uniformly distributed over the range specified within the - //! the contraints of a particular generator. - virtual unsigned int GenerateBit(); - - //! \brief Generate a random 32 bit word in the range min to max, inclusive - //! \param min the lower bound of the range - //! \param max the upper bound of the range - //! \returns a random 32-bit word - //! \details The default implementation calls Crop() on the difference between max and - //! min, and then returns the result added to min. - //! \details All generated values are uniformly distributed over the range specified within the - //! the contraints of a particular generator. - virtual word32 GenerateWord32(word32 min=0, word32 max=0xffffffffUL); - - //! \brief Generate random array of bytes - //! \param output the byte buffer - //! \param size the length of the buffer, in bytes - //! \details All generated values are uniformly distributed over the range specified within the - //! the contraints of a particular generator. - //! \note A derived generator \a must override either GenerateBlock() or - //! GenerateIntoBufferedTransformation(). They can override both, or have one call the other. - virtual void GenerateBlock(byte *output, size_t size); - - //! \brief Generate random bytes into a BufferedTransformation - //! \param target the BufferedTransformation object which receives the bytes - //! \param channel the channel on which the bytes should be pumped - //! \param length the number of bytes to generate - //! \details The default implementation calls GenerateBlock() and pumps the result into - //! the DEFAULT_CHANNEL of the target. - //! \details All generated values are uniformly distributed over the range specified within the - //! the contraints of a particular generator. - //! \note A derived generator \a must override either GenerateBlock() or - //! GenerateIntoBufferedTransformation(). They can override both, or have one call the other. - virtual void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length); - - //! \brief Generate and discard n bytes - //! \param n the number of bytes to generate and discard - virtual void DiscardBytes(size_t n); - - //! \brief Randomly shuffle the specified array - //! \param begin an iterator to the first element in the array - //! \param end an iterator beyond the last element in the array - //! \details The resulting permutation is uniformly distributed. - template void Shuffle(IT begin, IT end) - { - // TODO: What happens if there are more than 2^32 elements? - for (; begin != end; ++begin) - std::iter_swap(begin, begin + GenerateWord32(0, end-begin-1)); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~RandomNumberGenerator() {} -#endif - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - byte GetByte() {return GenerateByte();} - unsigned int GetBit() {return GenerateBit();} - word32 GetLong(word32 a=0, word32 b=0xffffffffL) {return GenerateWord32(a, b);} - word16 GetShort(word16 a=0, word16 b=0xffff) {return (word16)GenerateWord32(a, b);} - void GetBlock(byte *output, size_t size) {GenerateBlock(output, size);} -#endif - -}; - -//! \brief Random Number Generator that does not produce random numbers -//! \returns reference that can be passed to functions that require a RandomNumberGenerator -//! \details NullRNG() returns a reference that can be passed to functions that require a -//! RandomNumberGenerator but don't actually use it. The NullRNG() throws NotImplemented -//! when a generation function is called. -//! \sa ClassNullRNG -CRYPTOPP_DLL RandomNumberGenerator & CRYPTOPP_API NullRNG(); - -//! \class WaitObjectContainer -class WaitObjectContainer; -//! \class CallStack -class CallStack; - -//! \brief Interface for objects that can be waited on. -class CRYPTOPP_NO_VTABLE Waitable -{ -public: - virtual ~Waitable() {} - - //! \brief Maximum number of wait objects that this object can return - virtual unsigned int GetMaxWaitObjectCount() const =0; - - //! \brief Retrieves waitable objects - //! \param container the wait container to receive the references to the objects. - //! \param callStack CallStack object used to select waitable objects - //! \details GetWaitObjects is usually called in one of two ways. First, it can - //! be called like something.GetWaitObjects(c, CallStack("my func after X", 0));. - //! Second, if in an outer GetWaitObjects() method that itself takes a callStack - //! parameter, it can be called like - //! innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));. - virtual void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) =0; - - //! wait on this object - /*! same as creating an empty container, calling GetWaitObjects(), and calling Wait() on the container */ - bool Wait(unsigned long milliseconds, CallStack const& callStack); -}; - -//! \brief Default channel for BufferedTransformation -//! \details DEFAULT_CHANNEL is equal to an empty string -// VALVE, don't use a real object here as a global, make it a basic type so construction -// order doesn't screw us (Alfred) -//extern CRYPTOPP_DLL const std::string DEFAULT_CHANNEL; -extern CRYPTOPP_DLL const char *DEFAULT_CHANNEL; - -//! \brief Channel for additional authenticated data -//! \details AAD_CHANNEL is equal to "AAD" -extern CRYPTOPP_DLL const std::string AAD_CHANNEL; - -//! \brief Interface for buffered transformations -//! \details BufferedTransformation is a generalization of BlockTransformation, -//! StreamTransformation and HashTransformation. -//! \details A buffered transformation is an object that takes a stream of bytes as input (this may -//! be done in stages), does some computation on them, and then places the result into an internal -//! buffer for later retrieval. Any partial result already in the output buffer is not modified -//! by further input. -//! \details If a method takes a "blocking" parameter, and you pass false for it, then the method -//! will return before all input has been processed if the input cannot be processed without waiting -//! (for network buffers to become available, for example). In this case the method will return true -//! or a non-zero integer value. When this happens you must continue to call the method with the same -//! parameters until it returns false or zero, before calling any other method on it or attached -//! /p BufferedTransformation. The integer return value in this case is approximately -//! the number of bytes left to be processed, and can be used to implement a progress bar. -//! \details For functions that take a "propagation" parameter, propagation != 0 means pass on -//! the signal to attached BufferedTransformation objects, with propagation decremented at each -//! step until it reaches 0. -1 means unlimited propagation. -//! \details \a All of the retrieval functions, like Get() and GetWord32(), return the actual -//! number of bytes retrieved, which is the lesser of the request number and MaxRetrievable(). -//! \details \a Most of the input functions, like Put() and PutWord32(), return the number of -//! bytes remaining to be processed. A 0 value means all bytes were processed, and a non-0 value -//! means bytes remain to be processed. -//! \nosubgrouping -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm, public Waitable -{ -public: - // placed up here for CW8 - static const std::string &NULL_CHANNEL; // same as DEFAULT_CHANNEL, for backwards compatibility - - BufferedTransformation() : Algorithm(false) {} - - //! \brief Provides a reference to this object - //! \returns A reference to this object - //! \details Useful for passing a temporary object to a function that takes a non-const reference - BufferedTransformation& Ref() {return *this;} - - //! \name INPUT - //@{ - - //! \brief Input a byte for processing - //! \param inByte the 8-bit byte (octet) to be processed. - //! \param blocking specifies whether the object should block when processing input. - //! \returns the number of bytes that remain in the block (i.e., bytes not processed) - //! \details Put(byte) calls Put(byte*, size_t). - size_t Put(byte inByte, bool blocking=true) - {return Put(&inByte, 1, blocking);} - - //! \brief Input a byte buffer for processing - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param blocking specifies whether the object should block when processing input - //! \returns the number of bytes that remain in the block (i.e., bytes not processed) - //! \details Internally, Put() calls Put2(). - size_t Put(const byte *inString, size_t length, bool blocking=true) - {return Put2(inString, length, 0, blocking);} - - //! Input a 16-bit word for processing. - //! \param value the 16-bit value to be processed - //! \param order the ByteOrder in which the word should be processed - //! \param blocking specifies whether the object should block when processing input - //! \returns the number of bytes that remain in the block (i.e., bytes not processed) - size_t PutWord16(word16 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); - - //! Input a 32-bit word for processing. - //! \param value the 32-bit value to be processed. - //! \param order the ByteOrder in which the word should be processed. - //! \param blocking specifies whether the object should block when processing input. - //! \returns the number of bytes that remain in the block (i.e., bytes not processed) - size_t PutWord32(word32 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); - - //! \brief Request space which can be written into by the caller - //! \param size the requested size of the buffer - //! \details The purpose of this method is to help avoid extra memory allocations. - //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made, - //! size is the requested size of the buffer. When the call returns, size is the size of - //! the array returned to the caller. - //! \details The base class implementation sets size to 0 and returns NULL. - //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of - //! an ArraySink, the pointer to the array is returned and the size is remaining size. - virtual byte * CreatePutSpace(size_t &size) - {size=0; return NULL;} - - //! \brief Determines whether input can be modifed by the callee - //! \returns true if input can be modified, false otherwise - //! \details The base class implementation returns false. - virtual bool CanModifyInput() const - {return false;} - - //! \brief Input multiple bytes that may be modified by callee. - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param blocking specifies whether the object should block when processing input - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed - size_t PutModifiable(byte *inString, size_t length, bool blocking=true) - {return PutModifiable2(inString, length, 0, blocking);} - - //! \brief Signals the end of messages to the object - //! \param propagation the number of attached transformations the MessageEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - bool MessageEnd(int propagation=-1, bool blocking=true) - {return !!Put2(NULL, 0, propagation < 0 ? -1 : propagation+1, blocking);} - - //! \brief Input multiple bytes for processing and signal the end of a message - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param propagation the number of attached transformations the MessageEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \details Internally, PutMessageEnd() calls Put2() with a modified propagation to - //! ensure all attached transformations finish processing the message. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - size_t PutMessageEnd(const byte *inString, size_t length, int propagation=-1, bool blocking=true) - {return Put2(inString, length, propagation < 0 ? -1 : propagation+1, blocking);} - - //! \brief Input multiple bytes for processing - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one - //! \param blocking specifies whether the object should block when processing input - //! \details Derived classes must implement Put2(). - virtual size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) =0; - - //! \brief Input multiple bytes that may be modified by callee. - //! \param inString the byte buffer to process. - //! \param length the size of the string, in bytes. - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one. - //! \param blocking specifies whether the object should block when processing input. - //! \details Internally, PutModifiable2() calls Put2(). - virtual size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking) - {return Put2(inString, length, messageEnd, blocking);} - - //! \brief thrown by objects that have not implemented nonblocking input processing - struct BlockingInputOnly : public NotImplemented - {BlockingInputOnly(const std::string &s) : NotImplemented(s + ": Nonblocking input is not implemented by this object.") {}}; - //@} - - //! \name WAITING - //@{ - //! \brief Retrieves the maximum number of waitable objects - unsigned int GetMaxWaitObjectCount() const; - - //! \brief Retrieves waitable objects - //! \param container the wait container to receive the references to the objects - //! \param callStack CallStack object used to select waitable objects - //! \details GetWaitObjects is usually called in one of two ways. First, it can - //! be called like something.GetWaitObjects(c, CallStack("my func after X", 0));. - //! Second, if in an outer GetWaitObjects() method that itself takes a callStack - //! parameter, it can be called like - //! innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));. - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - //@} // WAITING - - //! \name SIGNALS - //@{ - - //! \brief Initialize or reinitialize this object, without signal propagation - //! \param parameters a set of NameValuePairs used to initialize this object - //! \throws NotImplemented - //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable - //! number of arbitrarily typed arguments. The function avoids the need for multiple constuctors providing - //! all possible combintations of configurable parameters. - //! \details IsolatedInitialize() does not call Initialize() on attached transformations. If initialization - //! should be propagated, then use the Initialize() function. - //! \details Setting propagation to -1 means unlimited propagation. - //! \details If a derived class does not override IsolatedInitialize(), then the base class throws - //! NotImplemented. - virtual void IsolatedInitialize(const NameValuePairs ¶meters) { - CRYPTOPP_UNUSED(parameters); - throw NotImplemented("BufferedTransformation: this object can't be reinitialized"); - } - - //! \brief Flushes data buffered by this object, without signal propagation - //! \param hardFlush indicates whether all data should be flushed - //! \param blocking specifies whether the object should block when processing input - //! \note hardFlush must be used with care - virtual bool IsolatedFlush(bool hardFlush, bool blocking) =0; - - //! \brief Marks the end of a series of messages, without signal propagation - //! \param blocking specifies whether the object should block when completing the processing on - //! the current series of messages - virtual bool IsolatedMessageSeriesEnd(bool blocking) - {CRYPTOPP_UNUSED(blocking); return false;} - - //! \brief Initialize or reinitialize this object, with signal propagation - //! \param parameters a set of NameValuePairs used to initialize or reinitialize this object - //! and attached transformations - //! \param propagation the number of attached transformations the Initialize() signal should be passed - //! \details Initialize() is used to initialize or reinitialize an object using a variable number of - //! arbitrarily typed arguments. The function avoids the need for multiple constuctors providing - //! all possible combintations of configurable parameters. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1); - - //! \brief Flush buffered input and/or output, with signal propagation - //! \param hardFlush is used to indicate whether all data should be flushed - //! \param propagation the number of attached transformations the Flush() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - //! \note Hard flushes must be used with care. It means try to process and output everything, even if - //! there may not be enough data to complete the action. For example, hard flushing a HexDecoder - //! would cause an error if you do it after inputing an odd number of hex encoded characters. - //! \note For some types of filters, like ZlibDecompressor, hard flushes can only - //! be done at "synchronization points". These synchronization points are positions in the data - //! stream that are created by hard flushes on the corresponding reverse filters, in this - //! example ZlibCompressor. This is useful when zlib compressed data is moved across a - //! network in packets and compression state is preserved across packets, as in the SSH2 protocol. - virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true); - - //! \brief Marks the end of a series of messages, with signal propagation - //! \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \details Each object that receives the signal will perform its processing, decrement - //! propagation, and then pass the signal on to attached transformations if the value is not 0. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - //! \note There should be a MessageEnd() immediately before MessageSeriesEnd(). - virtual bool MessageSeriesEnd(int propagation=-1, bool blocking=true); - - //! \brief Set propagation of automatically generated and transferred signals - //! \param propagation then new value - //! \details Setting propagation to 0 means do not automaticly generate signals. Setting - //! propagation to -1 means unlimited propagation. - virtual void SetAutoSignalPropagation(int propagation) - {CRYPTOPP_UNUSED(propagation);} - - //! \brief Retrieve automatic signal propagation value - virtual int GetAutoSignalPropagation() const {return 0;} -public: - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - void Close() {MessageEnd();} -#endif - //@} - - //! \name RETRIEVAL OF ONE MESSAGE - //@{ - - //! \brief Provides the number of bytes ready for retrieval - //! \returns the number of bytes ready for retrieval - //! \details All retrieval functions return the actual number of bytes retrieved, which is - //! the lesser of the request number and MaxRetrievable() - virtual lword MaxRetrievable() const; - - //! \brief Determines whether bytes are ready for retrieval - //! \returns true if bytes are available for retrieval, false otherwise - virtual bool AnyRetrievable() const; - - //! \brief Retrieve a 8-bit byte - //! \param outByte the 8-bit value to be retrieved - //! \returns the number of bytes consumed during the call. - //! \details Use the return value of Get to detect short reads. - virtual size_t Get(byte &outByte); - - //! \brief Retrieve a block of bytes - //! \param outString a block of bytes - //! \param getMax the number of bytes to Get - //! \returns the number of bytes consumed during the call. - //! \details Use the return value of Get to detect short reads. - virtual size_t Get(byte *outString, size_t getMax); - - //! \brief Peek a 8-bit byte - //! \param outByte the 8-bit value to be retrieved - //! \returns the number of bytes read during the call. - //! \details Peek does not remove bytes from the object. Use the return value of - //! Get to detect short reads. - virtual size_t Peek(byte &outByte) const; - - //! \brief Peek a block of bytes - //! \param outString a block of bytes - //! \param peekMax the number of bytes to Peek - //! \returns the number of bytes read during the call. - //! \details Peek does not remove bytes from the object. Use the return value of - //! Get to detect short reads. - virtual size_t Peek(byte *outString, size_t peekMax) const; - - //! \brief Retrieve a 16-bit word - //! \param value the 16-bit value to be retrieved - //! \param order the ByteOrder in which the word should be retrieved - //! \returns the number of bytes consumed during the call. - //! \details Use the return value of GetWord16 to detect short reads. - size_t GetWord16(word16 &value, ByteOrder order=BIG_ENDIAN_ORDER); - - //! \brief Retrieve a 32-bit word - //! \param value the 32-bit value to be retrieved - //! \param order the ByteOrder in which the word should be retrieved - //! \returns the number of bytes consumed during the call. - //! \details Use the return value of GetWord16 to detect short reads. - size_t GetWord32(word32 &value, ByteOrder order=BIG_ENDIAN_ORDER); - - //! \brief Peek a 16-bit word - //! \param value the 16-bit value to be retrieved - //! \param order the ByteOrder in which the word should be retrieved - //! \returns the number of bytes consumed during the call. - //! \details Peek does not consume bytes in the stream. Use the return value - //! of GetWord16 to detect short reads. - size_t PeekWord16(word16 &value, ByteOrder order=BIG_ENDIAN_ORDER) const; - - //! \brief Peek a 32-bit word - //! \param value the 32-bit value to be retrieved - //! \param order the ByteOrder in which the word should be retrieved - //! \returns the number of bytes consumed during the call. - //! \details Peek does not consume bytes in the stream. Use the return value - //! of GetWord16 to detect short reads. - size_t PeekWord32(word32 &value, ByteOrder order=BIG_ENDIAN_ORDER) const; - - //! move transferMax bytes of the buffered output to target as input - - //! \brief Transfer bytes from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param transferMax the number of bytes to transfer - //! \param channel the channel on which the transfer should occur - //! \returns the number of bytes transferred during the call. - //! \details TransferTo removes bytes from this object and moves them to the destination. - //! \details The function always returns transferMax. If an accurate count is needed, then use TransferTo2. - lword TransferTo(BufferedTransformation &target, lword transferMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) - {TransferTo2(target, transferMax, channel); return transferMax;} - - //! \brief Discard skipMax bytes from the output buffer - //! \param skipMax the number of bytes to discard - //! \details Skip always returns skipMax. - virtual lword Skip(lword skipMax=LWORD_MAX); - - //! copy copyMax bytes of the buffered output to target as input - - //! \brief Copy bytes from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param copyMax the number of bytes to copy - //! \param channel the channel on which the transfer should occur - //! \returns the number of bytes copied during the call. - //! \details CopyTo copies bytes from this object to the destination. The bytes are not removed from this object. - //! \details The function always returns copyMax. If an accurate count is needed, then use CopyRangeTo2. - lword CopyTo(BufferedTransformation &target, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const - {return CopyRangeTo(target, 0, copyMax, channel);} - - //! \brief Copy bytes from this object using an index to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param position the 0-based index of the byte stream to begin the copying - //! \param copyMax the number of bytes to copy - //! \param channel the channel on which the transfer should occur - //! \returns the number of bytes copied during the call. - //! \details CopyTo copies bytes from this object to the destination. The bytes remain in this - //! object. Copying begins at the index position in the current stream, and not from an absolute - //! position in the stream. - //! \details The function returns the new position in the stream after transferring the bytes starting at the index. - lword CopyRangeTo(BufferedTransformation &target, lword position, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const - {lword i = position; CopyRangeTo2(target, i, i+copyMax, channel); return i-position;} - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - unsigned long MaxRetrieveable() const {return MaxRetrievable();} -#endif - //@} - - //! \name RETRIEVAL OF MULTIPLE MESSAGES - //@{ - - //! \brief Provides the number of bytes ready for retrieval - //! \returns the number of bytes ready for retrieval - virtual lword TotalBytesRetrievable() const; - - //! \brief Provides the number of meesages processed by this object - //! \returns the number of meesages processed by this object - //! \details NumberOfMessages returns number of times MessageEnd() has been - //! received minus messages retrieved or skipped - virtual unsigned int NumberOfMessages() const; - - //! \brief Determines if any messages are available for retrieval - //! \returns true if NumberOfMessages() > 0, false otherwise - //! \details AnyMessages returns true if NumberOfMessages() > 0 - virtual bool AnyMessages() const; - - //! \brief Start retrieving the next message - //! \returns true if a message is ready for retrieval - //! \details GetNextMessage() returns true if a message is ready for retrieval; false - //! if no more messages exist or this message is not completely retrieved. - virtual bool GetNextMessage(); - - //! \brief Skip a number of meessages - //! \returns 0 if the requested number of messages was skipped, non-0 otherwise - //! \details SkipMessages() skips count number of messages. If there is an AttachedTransformation() - //! then SkipMessages() is called on the attached transformation. If there is no attached - //! transformation, then count number of messages are sent to TheBitBucket() using TransferMessagesTo(). - virtual unsigned int SkipMessages(unsigned int count=UINT_MAX); - - //! \brief Transfer messages from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param count the number of messages to transfer - //! \param channel the channel on which the transfer should occur - //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) - //! \details TransferMessagesTo2 removes messages from this object and moves them to the destination. - //! If all bytes are not transferred for a message, then processing stops and the number of remaining - //! bytes is returned. TransferMessagesTo() does not proceed to the next message. - //! \details A return value of 0 indicates all messages were successfully transferred. - unsigned int TransferMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) - {TransferMessagesTo2(target, count, channel); return count;} - - //! \brief Copies messages from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param count the number of messages to transfer - //! \param channel the channel on which the transfer should occur - //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) - //! \details CopyMessagesTo copies messages from this object and copies them to the destination. - //! If all bytes are not transferred for a message, then processing stops and the number of remaining - //! bytes is returned. CopyMessagesTo() does not proceed to the next message. - //! \details A return value of 0 indicates all messages were successfully copied. - unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const; - - //! - virtual void SkipAll(); - //! - void TransferAllTo(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL) - {TransferAllTo2(target, channel);} - //! - void CopyAllTo(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL) const; - - virtual bool GetNextMessageSeries() {return false;} - virtual unsigned int NumberOfMessagesInThisSeries() const {return NumberOfMessages();} - virtual unsigned int NumberOfMessageSeries() const {return 0;} - //@} - - //! \name NON-BLOCKING TRANSFER OF OUTPUT - //@{ - - // upon return, byteCount contains number of bytes that have finished being transfered, - // and returns the number of bytes left in the current transfer block - - //! \brief Transfer bytes from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param byteCount the number of bytes to transfer - //! \param channel the channel on which the transfer should occur - //! \param blocking specifies whether the object should block when processing input - //! \returns the number of bytes that remain in the transfer block (i.e., bytes not transferred) - //! \details TransferTo removes bytes from this object and moves them to the destination. - //! Transfer begins at the index position in the current stream, and not from an absolute - //! position in the stream. - //! \details byteCount is an \a IN and \a OUT parameter. When the call is made, - //! byteCount is the requested size of the transfer. When the call returns, byteCount is - //! the number of bytes that were transferred. - virtual size_t TransferTo2(BufferedTransformation &target, lword &byteCount, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) =0; - - // upon return, begin contains the start position of data yet to be finished copying, - // and returns the number of bytes left in the current transfer block - - //! \brief Copy bytes from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param begin the 0-based index of the first byte to copy in the stream - //! \param end the 0-based index of the last byte to copy in the stream - //! \param channel the channel on which the transfer should occur - //! \param blocking specifies whether the object should block when processing input - //! \returns the number of bytes that remain in the copy block (i.e., bytes not copied) - //! \details CopyRangeTo2 copies bytes from this object to the destination. The bytes are not - //! removed from this object. Copying begins at the index position in the current stream, and - //! not from an absolute position in the stream. - //! \details begin is an \a IN and \a OUT parameter. When the call is made, begin is the - //! starting position of the copy. When the call returns, begin is the position of the first - //! byte that was \a not copied (which may be different tahn end). begin can be used for - //! subsequent calls to CopyRangeTo2. - virtual size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const =0; - - // upon return, messageCount contains number of messages that have finished being transfered, - // and returns the number of bytes left in the current transfer block - - //! \brief Transfer messages from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param messageCount the number of messages to transfer - //! \param channel the channel on which the transfer should occur - //! \param blocking specifies whether the object should block when processing input - //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) - //! \details TransferMessagesTo2 removes messages from this object and moves them to the destination. - size_t TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - - // returns the number of bytes left in the current transfer block - - //! \brief Transfer all bytes from this object to another BufferedTransformation - //! \param target the destination BufferedTransformation - //! \param channel the channel on which the transfer should occur - //! \param blocking specifies whether the object should block when processing input - //! \returns the number of bytes that remain in the current transfer block (i.e., bytes not transferred) - //! \details TransferMessagesTo2 removes messages from this object and moves them to the destination. - size_t TransferAllTo2(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - //@} - - //! \name CHANNELS - //@{ - //! \brief Exception thrown when a filter does not support named channels - struct NoChannelSupport : public NotImplemented - {NoChannelSupport(const std::string &name) : NotImplemented(name + ": this object doesn't support multiple channels") {}}; - //! \brief Exception thrown when a filter does not recognize a named channel - struct InvalidChannelName : public InvalidArgument - {InvalidChannelName(const std::string &name, const std::string &channel) : InvalidArgument(name + ": unexpected channel name \"" + channel + "\"") {}}; - - //! \brief Input a byte for processing on a channel - //! \param channel the channel to process the data. - //! \param inByte the 8-bit byte (octet) to be processed. - //! \param blocking specifies whether the object should block when processing input. - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - size_t ChannelPut(const std::string &channel, byte inByte, bool blocking=true) - {return ChannelPut(channel, &inByte, 1, blocking);} - - //! \brief Input a byte buffer for processing on a channel - //! \param channel the channel to process the data - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param blocking specifies whether the object should block when processing input - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - size_t ChannelPut(const std::string &channel, const byte *inString, size_t length, bool blocking=true) - {return ChannelPut2(channel, inString, length, 0, blocking);} - - //! \brief Input multiple bytes that may be modified by callee on a channel - //! \param channel the channel to process the data. - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param blocking specifies whether the object should block when processing input - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - size_t ChannelPutModifiable(const std::string &channel, byte *inString, size_t length, bool blocking=true) - {return ChannelPutModifiable2(channel, inString, length, 0, blocking);} - - //! \brief Input a 16-bit word for processing on a channel. - //! \param channel the channel to process the data. - //! \param value the 16-bit value to be processed. - //! \param order the ByteOrder in which the word should be processed. - //! \param blocking specifies whether the object should block when processing input. - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - size_t ChannelPutWord16(const std::string &channel, word16 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); - - //! \brief Input a 32-bit word for processing on a channel. - //! \param channel the channel to process the data. - //! \param value the 32-bit value to be processed. - //! \param order the ByteOrder in which the word should be processed. - //! \param blocking specifies whether the object should block when processing input. - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - size_t ChannelPutWord32(const std::string &channel, word32 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true); - - //! \brief Signal the end of a message - //! \param channel the channel to process the data. - //! \param propagation the number of attached transformations the ChannelMessageEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - bool ChannelMessageEnd(const std::string &channel, int propagation=-1, bool blocking=true) - {return !!ChannelPut2(channel, NULL, 0, propagation < 0 ? -1 : propagation+1, blocking);} - - //! \brief Input multiple bytes for processing and signal the end of a message - //! \param channel the channel to process the data. - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param propagation the number of attached transformations the ChannelPutMessageEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - size_t ChannelPutMessageEnd(const std::string &channel, const byte *inString, size_t length, int propagation=-1, bool blocking=true) - {return ChannelPut2(channel, inString, length, propagation < 0 ? -1 : propagation+1, blocking);} - - //! \brief Request space which can be written into by the caller - //! \param channel the channel to process the data - //! \param size the requested size of the buffer - //! \details The purpose of this method is to help avoid extra memory allocations. - //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made, - //! size is the requested size of the buffer. When the call returns, size is the size of - //! the array returned to the caller. - //! \details The base class implementation sets size to 0 and returns NULL. - //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of - //! an ArraySink, the pointer to the array is returned and the size is remaining size. - virtual byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); - - //! \brief Input multiple bytes for processing on a channel. - //! \param channel the channel to process the data. - //! \param inString the byte buffer to process. - //! \param length the size of the string, in bytes. - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one. - //! \param blocking specifies whether the object should block when processing input. - virtual size_t ChannelPut2(const std::string &channel, const byte *inString, size_t length, int messageEnd, bool blocking); - - //! \brief Input multiple bytes that may be modified by callee on a channel - //! \param channel the channel to process the data - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one - //! \param blocking specifies whether the object should block when processing input - virtual size_t ChannelPutModifiable2(const std::string &channel, byte *inString, size_t length, int messageEnd, bool blocking); - - //! \brief Flush buffered input and/or output on a channel - //! \param channel the channel to flush the data - //! \param hardFlush is used to indicate whether all data should be flushed - //! \param propagation the number of attached transformations the ChannelFlush() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true); - - //! \brief Marks the end of a series of messages on a channel - //! \param channel the channel to signal the end of a series of messages - //! \param propagation the number of attached transformations the ChannelMessageSeriesEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \details Each object that receives the signal will perform its processing, decrement - //! propagation, and then pass the signal on to attached transformations if the value is not 0. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - //! \note There should be a MessageEnd() immediately before MessageSeriesEnd(). - virtual bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); - - //! \brief Sets the default retrieval channel - //! \param channel the channel to signal the end of a series of messages - //! \note this function may not be implemented in all objects that should support it. - virtual void SetRetrievalChannel(const std::string &channel); - //@} - - //! \name ATTACHMENT - /*! Some BufferedTransformation objects (e.g. Filter objects) - allow other BufferedTransformation objects to be attached. When - this is done, the first object instead of buffering its output, - sends that output to the attached object as input. The entire - attachment chain is deleted when the anchor object is destructed. - */ - //@{ - //! \brief Determines whether the object allows attachment - //! \returns true if the object allows an attachment, false otherwise - //! \details Sources and Filters will return true, while Sinks and other objects will return false. - virtual bool Attachable() {return false;} - - //! \brief Returns the object immediately attached to this object - //! \details AttachedTransformation returns NULL if there is no attachment - virtual BufferedTransformation *AttachedTransformation() {assert(!Attachable()); return 0;} - - //! \brief Returns the object immediately attached to this object - //! \details AttachedTransformation returns NULL if there is no attachment - virtual const BufferedTransformation *AttachedTransformation() const - {return const_cast(this)->AttachedTransformation();} - - //! \brief Delete the current attachment chain and attach a new one - //! \param newAttachment the new BufferedTransformation to attach - //! \throws NotImplemented - //! \details Detach delete the current attachment chain and replace it with an optional newAttachment - //! \details If a derived class does not override Detach, then the base class throws - //! NotImplemented. - virtual void Detach(BufferedTransformation *newAttachment = 0) { - CRYPTOPP_UNUSED(newAttachment); assert(!Attachable()); - throw NotImplemented("BufferedTransformation: this object is not attachable"); - } - - //! \brief Add newAttachment to the end of attachment chain - //! \param newAttachment the attachment to add to the end of the chain - - virtual void Attach(BufferedTransformation *newAttachment); - //@} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~BufferedTransformation() {} -#endif - -protected: - //! \brief Decrements the propagation count while clamping at 0 - //! \returns the decremented propagation or 0 - static int DecrementPropagation(int propagation) - {return propagation != 0 ? propagation - 1 : 0;} - -private: - byte m_buf[4]; // for ChannelPutWord16 and ChannelPutWord32, to ensure buffer isn't deallocated before non-blocking operation completes -}; - -//! \brief An input discarding BufferedTransformation -//! \returns a reference to a BufferedTransformation object that discards all input -CRYPTOPP_DLL BufferedTransformation & TheBitBucket(); - -//! \class CryptoMaterial -//! \brief Interface for crypto material, such as public and private keys, and crypto parameters -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoMaterial : public NameValuePairs -{ -public: - //! exception thrown when invalid crypto material is detected - class CRYPTOPP_DLL InvalidMaterial : public InvalidDataFormat - { - public: - explicit InvalidMaterial(const std::string &s) : InvalidDataFormat(s) {} - }; - - //! \brief Assign values to this object - /*! \details This function can be used to create a public key from a private key. */ - virtual void AssignFrom(const NameValuePairs &source) =0; - - //! \brief Check this object for errors - //! \param rng a RandomNumberGenerator for objects which use randomized testing - //! \param level the level of thoroughness - //! \returns true if the tests succeed, false otherwise - //! \details There are four levels of thoroughness: - //!
    - //!
  • 0 - using this object won't cause a crash or exception - //!
  • 1 - this object will probably function, and encrypt, sign, other operations correctly - //!
  • 2 - ensure this object will function correctly, and perform reasonable security checks - //!
  • 3 - perform reasonable security checks, and do checks that may take a long time - //!
- //! \details Level 0 does not require a RandomNumberGenerator. A NullRNG() can be used for level 0. - //! \details Level 1 may not check for weak keys and such. - //! \details Levels 2 and 3 are recommended. - virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0; - - //! \brief Check this object for errors - //! \param rng a RandomNumberGenerator for objects which use randomized testing - //! \param level the level of thoroughness - //! \throws InvalidMaterial - //! \details Internally, ThrowIfInvalid() calls Validate() and throws InvalidMaterial if validation fails. - virtual void ThrowIfInvalid(RandomNumberGenerator &rng, unsigned int level) const - {if (!Validate(rng, level)) throw InvalidMaterial("CryptoMaterial: this object contains invalid values");} - - //! \brief Saves a key to a BufferedTransformation - //! \param bt the destination BufferedTransformation - //! \throws NotImplemented - //! \details Save writes the material to a BufferedTransformation. - //! \details If the material is a key, then the key is written with ASN.1 DER encoding. The key - //! includes an object identifier with an algorthm id, like a subjectPublicKeyInfo. - //! \details A "raw" key without the "key info" can be saved using a key's DEREncode method. - //! \details If a derived class does not override Save, then the base class throws - //! NotImplemented. - virtual void Save(BufferedTransformation &bt) const - {CRYPTOPP_UNUSED(bt); throw NotImplemented("CryptoMaterial: this object does not support saving");} - - //! \brief Loads a key from a BufferedTransformation - //! \param bt the source BufferedTransformation - //! \throws KeyingErr - //! \details Load attempts to read material from a BufferedTransformation. If the - //! material is a key that was generated outside the library, then the following - //! usually applies: - //!
    - //!
  • the key should be ASN.1 BER encoded - //!
  • the key should be a "key info" - //!
- //! \details "key info" means the key should have an object identifier with an algorthm id, - //! like a subjectPublicKeyInfo. - //! \details To read a "raw" key without the "key info", then call the key's BERDecode method. - //! \note Load generally does not check that the key is valid. Call Validate(), if needed. - virtual void Load(BufferedTransformation &bt) - {CRYPTOPP_UNUSED(bt); throw NotImplemented("CryptoMaterial: this object does not support loading");} - - //! \brief Determines whether the object supports precomputation - //! \returns true if the object supports precomputation, false otherwise - virtual bool SupportsPrecomputation() const {return false;} - - //! \brief Perform precomputation - //! \param precomputationStorage the suggested number of objects for the precompute table - //! \throws NotImplemented - //! \details The exact semantics of Precompute() varies, but it typically means calculate - //! a table of n objects that can be used later to speed up computation. - //! \details If a derived class does not override Precompute, then the base class throws - //! NotImplemented. - virtual void Precompute(unsigned int precomputationStorage) { - CRYPTOPP_UNUSED(precomputationStorage); assert(!SupportsPrecomputation()); - throw NotImplemented("CryptoMaterial: this object does not support precomputation"); - } - - //! retrieve previously saved precomputation - virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation) - {CRYPTOPP_UNUSED(storedPrecomputation); assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");} - //! save precomputation for later use - virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const - {CRYPTOPP_UNUSED(storedPrecomputation); assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");} - - // for internal library use - void DoQuickSanityCheck() const {ThrowIfInvalid(NullRNG(), 0);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~CryptoMaterial() {} -#endif - -#if (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) - // Sun Studio 11/CC 5.8 workaround: it generates incorrect code when casting to an empty virtual base class - char m_sunCCworkaround; -#endif -}; - -//! \class GeneratableCryptoMaterial -//! \brief Interface for generatable crypto material, such as private keys and crypto parameters -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE GeneratableCryptoMaterial : virtual public CryptoMaterial -{ -public: - - //! \brief Generate a random key or crypto parameters - //! \param rng a RandomNumberGenerator to produce keying material - //! \param params additional initialization parameters - //! \throws KeyingErr if a key can't be generated or algorithm parameters are invalid - //! \details If a derived class does not override GenerateRandom, then the base class throws - //! NotImplemented. - virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs) { - CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(params); - throw NotImplemented("GeneratableCryptoMaterial: this object does not support key/parameter generation"); - } - - //! \brief Generate a random key or crypto parameters - //! \param rng a RandomNumberGenerator to produce keying material - //! \param keySize the size of the key, in bits - //! \throws KeyingErr if a key can't be generated or algorithm parameters are invalid - //! \details GenerateRandomWithKeySize calls GenerateRandom with a NameValuePairs - //! object with only "KeySize" - void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize); - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~GeneratableCryptoMaterial() {} -#endif -}; - -//! \brief Interface for public keys - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKey : virtual public CryptoMaterial -{ -}; - -//! \brief Interface for private keys - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKey : public GeneratableCryptoMaterial -{ -}; - -//! \brief Interface for crypto prameters - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoParameters : public GeneratableCryptoMaterial -{ -}; - -//! \brief Interface for asymmetric algorithms - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AsymmetricAlgorithm : public Algorithm -{ -public: - //! returns a reference to the crypto material used by this object - virtual CryptoMaterial & AccessMaterial() =0; - //! returns a const reference to the crypto material used by this object - virtual const CryptoMaterial & GetMaterial() const =0; - - //! for backwards compatibility, calls AccessMaterial().Load(bt) - void BERDecode(BufferedTransformation &bt) - {AccessMaterial().Load(bt);} - //! for backwards compatibility, calls GetMaterial().Save(bt) - void DEREncode(BufferedTransformation &bt) const - {GetMaterial().Save(bt);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~AsymmetricAlgorithm() {} -#endif -}; - -//! \brief Interface for asymmetric algorithms using public keys - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKeyAlgorithm : public AsymmetricAlgorithm -{ -public: - // VC60 workaround: no co-variant return type - CryptoMaterial & AccessMaterial() {return AccessPublicKey();} - const CryptoMaterial & GetMaterial() const {return GetPublicKey();} - - virtual PublicKey & AccessPublicKey() =0; - virtual const PublicKey & GetPublicKey() const {return const_cast(this)->AccessPublicKey();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PublicKeyAlgorithm() {} -#endif -}; - -//! \brief Interface for asymmetric algorithms using private keys - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKeyAlgorithm : public AsymmetricAlgorithm -{ -public: - CryptoMaterial & AccessMaterial() {return AccessPrivateKey();} - const CryptoMaterial & GetMaterial() const {return GetPrivateKey();} - - virtual PrivateKey & AccessPrivateKey() =0; - virtual const PrivateKey & GetPrivateKey() const {return const_cast(this)->AccessPrivateKey();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PrivateKeyAlgorithm() {} -#endif -}; - -//! \brief Interface for key agreement algorithms - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE KeyAgreementAlgorithm : public AsymmetricAlgorithm -{ -public: - CryptoMaterial & AccessMaterial() {return AccessCryptoParameters();} - const CryptoMaterial & GetMaterial() const {return GetCryptoParameters();} - - virtual CryptoParameters & AccessCryptoParameters() =0; - virtual const CryptoParameters & GetCryptoParameters() const {return const_cast(this)->AccessCryptoParameters();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~KeyAgreementAlgorithm() {} -#endif -}; - -//! \brief Interface for public-key encryptors and decryptors - -/*! This class provides an interface common to encryptors and decryptors - for querying their plaintext and ciphertext lengths. -*/ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_CryptoSystem -{ -public: - virtual ~PK_CryptoSystem() {} - - //! maximum length of plaintext for a given ciphertext length - /*! \note This function returns 0 if ciphertextLength is not valid (too long or too short). */ - virtual size_t MaxPlaintextLength(size_t ciphertextLength) const =0; - - //! calculate length of ciphertext given length of plaintext - /*! \note This function returns 0 if plaintextLength is not valid (too long). */ - virtual size_t CiphertextLength(size_t plaintextLength) const =0; - - //! this object supports the use of the parameter with the given name - /*! some possible parameter names: EncodingParameters, KeyDerivationParameters */ - virtual bool ParameterSupported(const char *name) const =0; - - //! return fixed ciphertext length, if one exists, otherwise return 0 - /*! \note "Fixed" here means length of ciphertext does not depend on length of plaintext. - It usually does depend on the key length. */ - virtual size_t FixedCiphertextLength() const {return 0;} - - //! return maximum plaintext length given the fixed ciphertext length, if one exists, otherwise return 0 - virtual size_t FixedMaxPlaintextLength() const {return 0;} - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - size_t MaxPlainTextLength(size_t cipherTextLength) const {return MaxPlaintextLength(cipherTextLength);} - size_t CipherTextLength(size_t plainTextLength) const {return CiphertextLength(plainTextLength);} -#endif -}; - -//! \class PK_Encryptor -//! \brief Interface for public-key encryptors -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Encryptor : public PK_CryptoSystem, public PublicKeyAlgorithm -{ -public: - //! \brief Exception thrown when trying to encrypt plaintext of invalid length - class CRYPTOPP_DLL InvalidPlaintextLength : public Exception - { - public: - InvalidPlaintextLength() : Exception(OTHER_ERROR, "PK_Encryptor: invalid plaintext length") {} - }; - - //! \brief Encrypt a byte string - //! \param rng a RandomNumberGenerator derived class - //! \param plaintext the plaintext byte buffer - //! \param plaintextLength the size of the plaintext byte buffer - //! \param ciphertext a byte buffer to hold the encrypted string - //! \param parameters additional configuration options - //! \pre CiphertextLength(plaintextLength) != 0 ensures the plaintext isn't too large - //! \pre COUNTOF(ciphertext) == CiphertextLength(plaintextLength) ensures the output - //! byte buffer is large enough. - //! \sa PK_Decryptor - virtual void Encrypt(RandomNumberGenerator &rng, - const byte *plaintext, size_t plaintextLength, - byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const =0; - - //! \brief Create a new encryption filter - //! \note The caller is responsible for deleting the returned pointer. - //! \note Encoding parameters should be passed in the "EP" channel. - virtual BufferedTransformation * CreateEncryptionFilter(RandomNumberGenerator &rng, - BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters = g_nullNameValuePairs) const; -}; - -//! \class PK_Decryptor -//! \brief Interface for public-key decryptors -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Decryptor : public PK_CryptoSystem, public PrivateKeyAlgorithm -{ -public: - //! \brief Decrypt a byte string - //! \param rng a RandomNumberGenerator derived class - //! \param ciphertext the encrypted byte buffer - //! \param ciphertextLength the size of the encrypted byte buffer - //! \param plaintext a byte buffer to hold the decrypted string - //! \param parameters additional configuration options - //! \returns the result of the decryption operation - //! \pre COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output - //! byte buffer is large enough - //! \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength - //! is valid and holds the the actual length of the plaintext recovered. - //! on success. The result is undefined if decryption failed. If DecodingResult::isValidCoding - //! is false, then DecodingResult::messageLength is undefined. - //! \sa PK_Encryptor - virtual DecodingResult Decrypt(RandomNumberGenerator &rng, - const byte *ciphertext, size_t ciphertextLength, - byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const =0; - - //! create a new decryption filter - /*! \note caller is responsible for deleting the returned pointer - */ - virtual BufferedTransformation * CreateDecryptionFilter(RandomNumberGenerator &rng, - BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters = g_nullNameValuePairs) const; - - //! decrypt a fixed size ciphertext - DecodingResult FixedLengthDecrypt(RandomNumberGenerator &rng, const byte *ciphertext, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const - {return Decrypt(rng, ciphertext, FixedCiphertextLength(), plaintext, parameters);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PK_Decryptor() {} -#endif -}; - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY -typedef PK_CryptoSystem PK_FixedLengthCryptoSystem; -typedef PK_Encryptor PK_FixedLengthEncryptor; -typedef PK_Decryptor PK_FixedLengthDecryptor; -#endif - -//! \brief Interface for public-key signers and verifiers - -/*! This class provides an interface common to signers and verifiers - for querying scheme properties. -*/ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_SignatureScheme -{ -public: - //! invalid key exception, may be thrown by any function in this class if the private or public key has a length that can't be used - class CRYPTOPP_DLL InvalidKeyLength : public Exception - { - public: - InvalidKeyLength(const std::string &message) : Exception(OTHER_ERROR, message) {} - }; - - //! key too short exception, may be thrown by any function in this class if the private or public key is too short to sign or verify anything - class CRYPTOPP_DLL KeyTooShort : public InvalidKeyLength - { - public: - KeyTooShort() : InvalidKeyLength("PK_Signer: key too short for this signature scheme") {} - }; - - virtual ~PK_SignatureScheme() {} - - //! signature length if it only depends on the key, otherwise 0 - virtual size_t SignatureLength() const =0; - - //! maximum signature length produced for a given length of recoverable message part - virtual size_t MaxSignatureLength(size_t recoverablePartLength = 0) const - {CRYPTOPP_UNUSED(recoverablePartLength); return SignatureLength();} - - //! length of longest message that can be recovered, or 0 if this signature scheme does not support message recovery - virtual size_t MaxRecoverableLength() const =0; - - //! length of longest message that can be recovered from a signature of given length, or 0 if this signature scheme does not support message recovery - virtual size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const =0; - - //! requires a random number generator to sign - /*! if this returns false, NullRNG() can be passed to functions that take RandomNumberGenerator & */ - virtual bool IsProbabilistic() const =0; - - //! whether or not a non-recoverable message part can be signed - virtual bool AllowNonrecoverablePart() const =0; - - //! if this function returns true, during verification you must input the signature before the message, otherwise you can input it at anytime */ - virtual bool SignatureUpfront() const {return false;} - - //! whether you must input the recoverable part before the non-recoverable part during signing - virtual bool RecoverablePartFirst() const =0; -}; - -//! \brief Interface for accumulating messages to be signed or verified -/*! Only Update() should be called - on this class. No other functions inherited from HashTransformation should be called. -*/ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulator : public HashTransformation -{ -public: - //! should not be called on PK_MessageAccumulator - unsigned int DigestSize() const - {throw NotImplemented("PK_MessageAccumulator: DigestSize() should not be called");} - - //! should not be called on PK_MessageAccumulator - void TruncatedFinal(byte *digest, size_t digestSize) - { - CRYPTOPP_UNUSED(digest); CRYPTOPP_UNUSED(digestSize); - throw NotImplemented("PK_MessageAccumulator: TruncatedFinal() should not be called"); - } -}; - -//! \brief Interface for public-key signers - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Signer : public PK_SignatureScheme, public PrivateKeyAlgorithm -{ -public: - //! create a new HashTransformation to accumulate the message to be signed - virtual PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const =0; - - virtual void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const =0; - - //! sign and delete messageAccumulator (even in case of exception thrown) - /*! \pre size of signature == MaxSignatureLength() - \returns actual signature length - */ - virtual size_t Sign(RandomNumberGenerator &rng, PK_MessageAccumulator *messageAccumulator, byte *signature) const; - - //! sign and restart messageAccumulator - /*! \pre size of signature == MaxSignatureLength() - \returns actual signature length - */ - virtual size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const =0; - - //! sign a message - /*! \pre size of signature == MaxSignatureLength() - \returns actual signature length - */ - virtual size_t SignMessage(RandomNumberGenerator &rng, const byte *message, size_t messageLen, byte *signature) const; - - //! sign a recoverable message - /*! \pre size of signature == MaxSignatureLength(recoverableMessageLength) - \returns actual signature length - */ - virtual size_t SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, - const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PK_Signer() {} -#endif -}; - -//! \brief Interface for public-key signature verifiers -/*! The Recover* functions throw NotImplemented if the signature scheme does not support - message recovery. - The Verify* functions throw InvalidDataFormat if the scheme does support message - recovery and the signature contains a non-empty recoverable message part. The - Recovery* functions should be used in that case. -*/ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Verifier : public PK_SignatureScheme, public PublicKeyAlgorithm -{ -public: - //! create a new HashTransformation to accumulate the message to be verified - virtual PK_MessageAccumulator * NewVerificationAccumulator() const =0; - - //! input signature into a message accumulator - virtual void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const =0; - - //! check whether messageAccumulator contains a valid signature and message, and delete messageAccumulator (even in case of exception thrown) - virtual bool Verify(PK_MessageAccumulator *messageAccumulator) const; - - //! check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator - virtual bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const =0; - - //! check whether input signature is a valid signature for input message - virtual bool VerifyMessage(const byte *message, size_t messageLen, - const byte *signature, size_t signatureLength) const; - - //! recover a message from its signature - /*! \pre size of recoveredMessage == MaxRecoverableLengthFromSignatureLength(signatureLength) - */ - virtual DecodingResult Recover(byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const; - - //! recover a message from its signature - /*! \pre size of recoveredMessage == MaxRecoverableLengthFromSignatureLength(signatureLength) - */ - virtual DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const =0; - - //! recover a message from its signature - /*! \pre size of recoveredMessage == MaxRecoverableLengthFromSignatureLength(signatureLength) - */ - virtual DecodingResult RecoverMessage(byte *recoveredMessage, - const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, - const byte *signature, size_t signatureLength) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PK_Verifier() {} -#endif -}; - -//! \brief Interface for domains of simple key agreement protocols - -/*! A key agreement domain is a set of parameters that must be shared - by two parties in a key agreement protocol, along with the algorithms - for generating key pairs and deriving agreed values. -*/ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyAgreementDomain : public KeyAgreementAlgorithm -{ -public: - //! return length of agreed value produced - virtual unsigned int AgreedValueLength() const =0; - //! return length of private keys in this domain - virtual unsigned int PrivateKeyLength() const =0; - //! return length of public keys in this domain - virtual unsigned int PublicKeyLength() const =0; - //! generate private key - /*! \pre size of privateKey == PrivateKeyLength() */ - virtual void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0; - //! generate public key - /*! re size of publicKey == PublicKeyLength() */ - virtual void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0; - //! generate private/public key pair - /*! \note equivalent to calling GeneratePrivateKey() and then GeneratePublicKey() */ - virtual void GenerateKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const; - //! derive agreed value from your private key and couterparty's public key, return false in case of failure - /*! \note If you have previously validated the public key, use validateOtherPublicKey=false to save time. - re size of agreedValue == AgreedValueLength() - \pre length of privateKey == PrivateKeyLength() - \pre length of otherPublicKey == PublicKeyLength() - */ - virtual bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~SimpleKeyAgreementDomain() {} -#endif - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - bool ValidateDomainParameters(RandomNumberGenerator &rng) const - {return GetCryptoParameters().Validate(rng, 2);} -#endif -}; - -//! \brief Interface for domains of authenticated key agreement protocols - -/*! In an authenticated key agreement protocol, each party has two - key pairs. The long-lived key pair is called the static key pair, - and the short-lived key pair is called the ephemeral key pair. -*/ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedKeyAgreementDomain : public KeyAgreementAlgorithm -{ -public: - //! return length of agreed value produced - virtual unsigned int AgreedValueLength() const =0; - - //! return length of static private keys in this domain - virtual unsigned int StaticPrivateKeyLength() const =0; - //! return length of static public keys in this domain - virtual unsigned int StaticPublicKeyLength() const =0; - //! generate static private key - /*! \pre size of privateKey == PrivateStaticKeyLength() */ - virtual void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0; - //! generate static public key - /*! re size of publicKey == PublicStaticKeyLength() */ - virtual void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0; - //! generate private/public key pair - /*! \note equivalent to calling GenerateStaticPrivateKey() and then GenerateStaticPublicKey() */ - virtual void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const; - - //! return length of ephemeral private keys in this domain - virtual unsigned int EphemeralPrivateKeyLength() const =0; - //! return length of ephemeral public keys in this domain - virtual unsigned int EphemeralPublicKeyLength() const =0; - //! \brief Generate ephemeral private key - //! \pre size of privateKey == PrivateEphemeralKeyLength() - virtual void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0; - //! \brief Generate ephemeral public key - //! \pre size of publicKey == PublicEphemeralKeyLength() - virtual void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0; - //! \brief Generate private/public key pair - /*! \note equivalent to calling GenerateEphemeralPrivateKey() and then GenerateEphemeralPublicKey() */ - virtual void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const; - - //! \brief Derive agreed value - //! \returns true upon success, false in case of failure - //! \details Agree() derives an agreed value from your private keys and couterparty's public keys - //! \details The ephemeral public key will always be validated. If you have previously validated the - //! static public key, use validateStaticOtherPublicKey=false to save time. - //! \pre size of agreedValue == AgreedValueLength() - //! \pre length of staticPrivateKey == StaticPrivateKeyLength() - //! \pre length of ephemeralPrivateKey == EphemeralPrivateKeyLength() - //! \pre length of staticOtherPublicKey == StaticPublicKeyLength() - //! \pre length of ephemeralOtherPublicKey == EphemeralPublicKeyLength() - virtual bool Agree(byte *agreedValue, - const byte *staticPrivateKey, const byte *ephemeralPrivateKey, - const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, - bool validateStaticOtherPublicKey=true) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~AuthenticatedKeyAgreementDomain() {} -#endif - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - bool ValidateDomainParameters(RandomNumberGenerator &rng) const - {return GetCryptoParameters().Validate(rng, 2);} -#endif -}; - -// interface for password authenticated key agreement protocols, not implemented yet -#if 0 -//! \brief Interface for protocol sessions -/*! The methods should be called in the following order: - - InitializeSession(rng, parameters); // or call initialize method in derived class - while (true) - { - if (OutgoingMessageAvailable()) - { - length = GetOutgoingMessageLength(); - GetOutgoingMessage(message); - ; // send outgoing message - } - - if (LastMessageProcessed()) - break; - - ; // receive incoming message - ProcessIncomingMessage(message); - } - ; // call methods in derived class to obtain result of protocol session -*/ -class ProtocolSession -{ -public: - //! exception thrown when an invalid protocol message is processed - class ProtocolError : public Exception - { - public: - ProtocolError(ErrorType errorType, const std::string &s) : Exception(errorType, s) {} - }; - - //! exception thrown when a function is called unexpectedly - /*! for example calling ProcessIncomingMessage() when ProcessedLastMessage() == true */ - class UnexpectedMethodCall : public Exception - { - public: - UnexpectedMethodCall(const std::string &s) : Exception(OTHER_ERROR, s) {} - }; - - ProtocolSession() : m_rng(NULL), m_throwOnProtocolError(true), m_validState(false) {} - virtual ~ProtocolSession() {} - - virtual void InitializeSession(RandomNumberGenerator &rng, const NameValuePairs ¶meters) =0; - - bool GetThrowOnProtocolError() const {return m_throwOnProtocolError;} - void SetThrowOnProtocolError(bool throwOnProtocolError) {m_throwOnProtocolError = throwOnProtocolError;} - - bool HasValidState() const {return m_validState;} - - virtual bool OutgoingMessageAvailable() const =0; - virtual unsigned int GetOutgoingMessageLength() const =0; - virtual void GetOutgoingMessage(byte *message) =0; - - virtual bool LastMessageProcessed() const =0; - virtual void ProcessIncomingMessage(const byte *message, unsigned int messageLength) =0; - -protected: - void HandleProtocolError(Exception::ErrorType errorType, const std::string &s) const; - void CheckAndHandleInvalidState() const; - void SetValidState(bool valid) {m_validState = valid;} - - RandomNumberGenerator *m_rng; - -private: - bool m_throwOnProtocolError, m_validState; -}; - -class KeyAgreementSession : public ProtocolSession -{ -public: - virtual unsigned int GetAgreedValueLength() const =0; - virtual void GetAgreedValue(byte *agreedValue) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~KeyAgreementSession() {} -#endif -}; - -class PasswordAuthenticatedKeyAgreementSession : public KeyAgreementSession -{ -public: - void InitializePasswordAuthenticatedKeyAgreementSession(RandomNumberGenerator &rng, - const byte *myId, unsigned int myIdLength, - const byte *counterPartyId, unsigned int counterPartyIdLength, - const byte *passwordOrVerifier, unsigned int passwordOrVerifierLength); - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PasswordAuthenticatedKeyAgreementSession() {} -#endif -}; - -class PasswordAuthenticatedKeyAgreementDomain : public KeyAgreementAlgorithm -{ -public: - //! return whether the domain parameters stored in this object are valid - virtual bool ValidateDomainParameters(RandomNumberGenerator &rng) const - {return GetCryptoParameters().Validate(rng, 2);} - - virtual unsigned int GetPasswordVerifierLength(const byte *password, unsigned int passwordLength) const =0; - virtual void GeneratePasswordVerifier(RandomNumberGenerator &rng, const byte *userId, unsigned int userIdLength, const byte *password, unsigned int passwordLength, byte *verifier) const =0; - - enum RoleFlags {CLIENT=1, SERVER=2, INITIATOR=4, RESPONDER=8}; - - virtual bool IsValidRole(unsigned int role) =0; - virtual PasswordAuthenticatedKeyAgreementSession * CreateProtocolSession(unsigned int role) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PasswordAuthenticatedKeyAgreementDomain() {} -#endif -}; -#endif - -//! \brief Exception thrown when an ASN1 BER decoing error is encountered -class CRYPTOPP_DLL BERDecodeErr : public InvalidArgument -{ -public: - BERDecodeErr() : InvalidArgument("BER decode error") {} - BERDecodeErr(const std::string &s) : InvalidArgument(s) {} -}; - -//! \brief Interface for encoding and decoding ASN1 objects -//! \details Each class that derives from ASN1Object should provide a serialization format -//! that controls subobject layout. Most of the time the serialization format is -//! taken from a standard, like P1363 or an RFC. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ASN1Object -{ -public: - virtual ~ASN1Object() {} - - //! \brief Decode this object from a BufferedTransformation - //! \param bt BufferedTransformation object - //! \details Uses Basic Encoding Rules (BER) - virtual void BERDecode(BufferedTransformation &bt) =0; - - //! \brief Encode this object into a BufferedTransformation - //! \param bt BufferedTransformation object - //! \details Uses Distinguished Encoding Rules (DER) - virtual void DEREncode(BufferedTransformation &bt) const =0; - - //! \brief Encode this object into a BufferedTransformation - //! \param bt BufferedTransformation object - //! \details Uses Basic Encoding Rules (BER). - //! \details This may be useful if DEREncode() would be too inefficient. - virtual void BEREncode(BufferedTransformation &bt) const {DEREncode(bt);} -}; - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY -typedef PK_SignatureScheme PK_SignatureSystem; -typedef SimpleKeyAgreementDomain PK_SimpleKeyAgreementDomain; -typedef AuthenticatedKeyAgreementDomain PK_AuthenticatedKeyAgreementDomain; -#endif - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/cryptlib.vcproj b/external/crypto++-5.6.3/cryptlib.vcproj deleted file mode 100644 index 6750bb23e..000000000 --- a/external/crypto++-5.6.3/cryptlib.vcproj +++ /dev/null @@ -1,9653 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/external/crypto++-5.6.3/cryptlib_bds.bdsproj b/external/crypto++-5.6.3/cryptlib_bds.bdsproj deleted file mode 100644 index fd2e8886f..000000000 --- a/external/crypto++-5.6.3/cryptlib_bds.bdsproj +++ /dev/null @@ -1,378 +0,0 @@ - - - - - - - - - - - - cryptlib_bds.cpp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - - - - - False - - - - - - - False - - False - - True - False - - - - - - - - - - - diff --git a/external/crypto++-5.6.3/cryptlib_bds.cpp b/external/crypto++-5.6.3/cryptlib_bds.cpp deleted file mode 100644 index 7724a9f17..000000000 --- a/external/crypto++-5.6.3/cryptlib_bds.cpp +++ /dev/null @@ -1,10 +0,0 @@ -//--------------------------------------------------------------------------- - -/* -#include -#pragma hdrstop -*/ -#define Library - -// To add a file to the library use the Project menu 'Add to Project'. - diff --git a/external/crypto++-5.6.3/cryptodisablewarnings.h b/external/crypto++-5.6.3/cryptodisablewarnings.h deleted file mode 100644 index 9c16ffc50..000000000 --- a/external/crypto++-5.6.3/cryptodisablewarnings.h +++ /dev/null @@ -1,30 +0,0 @@ -// turn off warnings that get generated when building Crypto++ in our environment - -#ifdef _WIN32 -#pragma warning( disable : 4100 ) // Warning C4100: unreferenced formal parameter -#pragma warning( disable : 4127 ) // Warning C4127: conditional expression is constant -#pragma warning( disable : 4189 ) // Warning C4189: local variable is initialized but not referenced -#pragma warning( disable : 4231 ) // Warning C4231: nonstandard extension used -#pragma warning( disable : 4244 ) // Warning C4244: conversion from 'unsigned int' to 'byte', possible loss of data -#pragma warning( disable : 4245 ) // Warning C4245: conversion from 'int' to 'DWORD', signed/unsigned mismatch -#pragma warning( disable : 4250 ) // Warning C4250: inherits via dominance -#pragma warning( disable : 4267 ) // Warning C4267: 'argument' : conversion, possible loss of data -#pragma warning( disable : 4297 ) // Warning C4267: function assumed not to throw an exception but does -#pragma warning( disable : 4355 ) // Warning C4355: 'this' : used in base member initializer list -#pragma warning( disable : 4389 ) // Warning C4389: signed/unsigned mismatch -#pragma warning( disable : 4505 ) // Warning C4505: unreferenced local function has been removed -#pragma warning( disable : 4511 ) // Warning C4511: copy constructor could not be generated -#pragma warning( disable : 4512 ) // Warning C4512: assignment operator could not be generated -#pragma warning( disable : 4516 ) // Warning C4516: access-declarations are deprecated; member using-declarations provide a better alternative -#pragma warning( disable : 4661 ) // Warning C4661: no suitable definition provided for explicit template instantiation request -#pragma warning( disable : 4701 ) // Warning C4701: local variable may be used without having been initialized -#pragma warning( disable : 4702 ) // Warning C4702: unreachable code -#pragma warning( disable : 4706 ) // Warning C4706: assignment within conditional expression -#endif // _WIN32 - -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) -#pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wextra" -#pragma GCC diagnostic ignored "-Wtype-limits" -#endif diff --git a/external/crypto++-5.6.3/cryptopopdisablewarnings.h b/external/crypto++-5.6.3/cryptopopdisablewarnings.h deleted file mode 100644 index ce0edbcc3..000000000 --- a/external/crypto++-5.6.3/cryptopopdisablewarnings.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifdef _WIN32 -#pragma warning( pop ) -#endif - -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) -#pragma GCC diagnostic pop -#endif - -//#include "tier0/memdbgon.h" diff --git a/external/crypto++-5.6.3/cryptopp.rc b/external/crypto++-5.6.3/cryptopp.rc deleted file mode 100644 index 808b66435..000000000 --- a/external/crypto++-5.6.3/cryptopp.rc +++ /dev/null @@ -1,104 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "windows.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,6,3,0 - PRODUCTVERSION 5,6,3,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "free crypto library, more information available at www.cryptopp.com" - VALUE "CompanyName", "Wei Dai" - VALUE "FileDescription", "Crypto++® Library DLL" - VALUE "FileVersion", "5, 6, 3, 0" - VALUE "InternalName", "cryptopp" - VALUE "LegalCopyright", "Copyright © 1995-2015 by Wei Dai" - VALUE "LegalTrademarks", "Crypto++®" - VALUE "OriginalFilename", "cryptopp.dll" - VALUE "ProductName", "Crypto++® Library" - VALUE "ProductVersion", "5, 6, 3, 0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""windows.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/external/crypto++-5.6.3/cryptopp563.diff b/external/crypto++-5.6.3/cryptopp563.diff deleted file mode 100644 index e69de29bb..000000000 diff --git a/external/crypto++-5.6.3/cryptopushdisablewarnings.h b/external/crypto++-5.6.3/cryptopushdisablewarnings.h deleted file mode 100644 index 6e9728461..000000000 --- a/external/crypto++-5.6.3/cryptopushdisablewarnings.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef _WIN32 -#pragma warning( push ) -#endif // _WIN32 - -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) -#pragma GCC diagnostic push -#endif - -#include "cryptodisablewarnings.h" -//#include "tier0/memdbgoff.h" - diff --git a/external/crypto++-5.6.3/datatest.cpp b/external/crypto++-5.6.3/datatest.cpp deleted file mode 100644 index 851444b91..000000000 --- a/external/crypto++-5.6.3/datatest.cpp +++ /dev/null @@ -1,813 +0,0 @@ -// datatest.cpp - written and placed in the public domain by Wei Dai - -#define CRYPTOPP_DEFAULT_NO_DLL -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 - -#include "cryptlib.h" -#include "factory.h" -#include "integer.h" -#include "filters.h" -#include "hex.h" -#include "randpool.h" -#include "files.h" -#include "trunhash.h" -#include "queue.h" -#include "smartptr.h" -#include "validate.h" -#include "hkdf.h" -#include "stdcpp.h" -#include - -// Aggressive stack checking with VS2005 SP1 and above. -#if (CRYPTOPP_MSC_VERSION >= 1410) -# pragma strict_gs_check (on) -#endif - -#if defined(__COVERITY__) -extern "C" void __coverity_tainted_data_sanitize__(void *); -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -typedef std::map TestData; -static bool s_thorough = false; - -class TestFailure : public Exception -{ -public: - TestFailure() : Exception(OTHER_ERROR, "Validation test failed") {} -}; - -static const TestData *s_currentTestData = NULL; - -static void OutputTestData(const TestData &v) -{ - for (TestData::const_iterator i = v.begin(); i != v.end(); ++i) - { - cerr << i->first << ": " << i->second << endl; - } -} - -static void SignalTestFailure() -{ - OutputTestData(*s_currentTestData); - throw TestFailure(); -} - -static void SignalTestError() -{ - OutputTestData(*s_currentTestData); - throw Exception(Exception::OTHER_ERROR, "Unexpected error during validation test"); -} - -bool DataExists(const TestData &data, const char *name) -{ - TestData::const_iterator i = data.find(name); - return (i != data.end()); -} - -const std::string & GetRequiredDatum(const TestData &data, const char *name) -{ - TestData::const_iterator i = data.find(name); - if (i == data.end()) - SignalTestError(); - return i->second; -} - -void RandomizedTransfer(BufferedTransformation &source, BufferedTransformation &target, bool finish, const std::string &channel=DEFAULT_CHANNEL) -{ - while (source.MaxRetrievable() > (finish ? 0 : 4096)) - { - byte buf[4096+64]; - size_t start = GlobalRNG().GenerateWord32(0, 63); - size_t len = GlobalRNG().GenerateWord32(1, UnsignedMin(4096U, 3*source.MaxRetrievable()/2)); - len = source.Get(buf+start, len); - target.ChannelPut(channel, buf+start, len); - } -} - -void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransformation &target) -{ - std::string s1 = GetRequiredDatum(data, name), s2; - ByteQueue q; - - while (!s1.empty()) - { - while (s1[0] == ' ') - { - s1 = s1.substr(1); - if (s1.empty()) - goto end; // avoid invalid read if s1 is empty - } - - int repeat = 1; - if (s1[0] == 'r') - { - repeat = atoi(s1.c_str()+1); - s1 = s1.substr(s1.find(' ')+1); - } - - s2 = ""; // MSVC 6 doesn't have clear(); - - if (s1[0] == '\"') - { - s2 = s1.substr(1, s1.find('\"', 1)-1); - s1 = s1.substr(s2.length() + 2); - } - else if (s1.substr(0, 2) == "0x") - { - StringSource(s1.substr(2, s1.find(' ')), true, new HexDecoder(new StringSink(s2))); - s1 = s1.substr(STDMIN(s1.find(' '), s1.length())); - } - else - { - StringSource(s1.substr(0, s1.find(' ')), true, new HexDecoder(new StringSink(s2))); - s1 = s1.substr(STDMIN(s1.find(' '), s1.length())); - } - - while (repeat--) - { - q.Put((const byte *)s2.data(), s2.size()); - RandomizedTransfer(q, target, false); - } - } - -end: - RandomizedTransfer(q, target, true); -} - -std::string GetDecodedDatum(const TestData &data, const char *name) -{ - std::string s; - PutDecodedDatumInto(data, name, StringSink(s).Ref()); - return s; -} - -std::string GetOptionalDecodedDatum(const TestData &data, const char *name) -{ - std::string s; - if (DataExists(data, name)) - PutDecodedDatumInto(data, name, StringSink(s).Ref()); - return s; -} - -class TestDataNameValuePairs : public NameValuePairs -{ -public: - TestDataNameValuePairs(const TestData &data) : m_data(data) {} - - virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - TestData::const_iterator i = m_data.find(name); - if (i == m_data.end()) - { - if (std::string(name) == Name::DigestSize() && valueType == typeid(int)) - { - i = m_data.find("MAC"); - if (i == m_data.end()) - i = m_data.find("Digest"); - if (i == m_data.end()) - return false; - - m_temp.resize(0); - PutDecodedDatumInto(m_data, i->first.c_str(), StringSink(m_temp).Ref()); - *reinterpret_cast(pValue) = (int)m_temp.size(); - return true; - } - else - return false; - } - - const std::string &value = i->second; - - if (valueType == typeid(int)) - *reinterpret_cast(pValue) = atoi(value.c_str()); - else if (valueType == typeid(Integer)) - *reinterpret_cast(pValue) = Integer((std::string(value) + "h").c_str()); - else if (valueType == typeid(ConstByteArrayParameter)) - { - m_temp.resize(0); - PutDecodedDatumInto(m_data, name, StringSink(m_temp).Ref()); - reinterpret_cast(pValue)->Assign((const byte *)m_temp.data(), m_temp.size(), false); - } - else - throw ValueTypeMismatch(name, typeid(std::string), valueType); - - return true; - } - -private: - const TestData &m_data; - mutable std::string m_temp; -}; - -void TestKeyPairValidAndConsistent(CryptoMaterial &pub, const CryptoMaterial &priv) -{ - // "!!" converts between bool <-> integral. - if (!pub.Validate(GlobalRNG(), 2U+!!s_thorough)) - SignalTestFailure(); - if (!priv.Validate(GlobalRNG(), 2U+!!s_thorough)) - SignalTestFailure(); - - ByteQueue bq1, bq2; - pub.Save(bq1); - pub.AssignFrom(priv); - pub.Save(bq2); - if (bq1 != bq2) - SignalTestFailure(); -} - -void TestSignatureScheme(TestData &v) -{ - std::string name = GetRequiredDatum(v, "Name"); - std::string test = GetRequiredDatum(v, "Test"); - - member_ptr signer(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - member_ptr verifier(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - - TestDataNameValuePairs pairs(v); - - if (test == "GenerateKey") - { - signer->AccessPrivateKey().GenerateRandom(GlobalRNG(), pairs); - verifier->AccessPublicKey().AssignFrom(signer->AccessPrivateKey()); - } - else - { - std::string keyFormat = GetRequiredDatum(v, "KeyFormat"); - - if (keyFormat == "DER") - verifier->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PublicKey")).Ref()); - else if (keyFormat == "Component") - verifier->AccessMaterial().AssignFrom(pairs); - - if (test == "Verify" || test == "NotVerify") - { - VerifierFilter verifierFilter(*verifier, NULL, VerifierFilter::SIGNATURE_AT_BEGIN); - PutDecodedDatumInto(v, "Signature", verifierFilter); - PutDecodedDatumInto(v, "Message", verifierFilter); - verifierFilter.MessageEnd(); - if (verifierFilter.GetLastResult() == (test == "NotVerify")) - SignalTestFailure(); - return; - } - else if (test == "PublicKeyValid") - { - if (!verifier->GetMaterial().Validate(GlobalRNG(), 3)) - SignalTestFailure(); - return; - } - - if (keyFormat == "DER") - signer->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PrivateKey")).Ref()); - else if (keyFormat == "Component") - signer->AccessMaterial().AssignFrom(pairs); - } - - if (test == "GenerateKey" || test == "KeyPairValidAndConsistent") - { - TestKeyPairValidAndConsistent(verifier->AccessMaterial(), signer->GetMaterial()); - VerifierFilter verifierFilter(*verifier, NULL, VerifierFilter::THROW_EXCEPTION); - verifierFilter.Put((const byte *)"abc", 3); - StringSource ss("abc", true, new SignerFilter(GlobalRNG(), *signer, new Redirector(verifierFilter))); - } - else if (test == "Sign") - { - SignerFilter f(GlobalRNG(), *signer, new HexEncoder(new FileSink(cout))); - StringSource ss(GetDecodedDatum(v, "Message"), true, new Redirector(f)); - SignalTestFailure(); - } - else if (test == "DeterministicSign") - { - SignalTestError(); - assert(false); // TODO: implement - } - else if (test == "RandomSign") - { - SignalTestError(); - assert(false); // TODO: implement - } - else - { - SignalTestError(); - assert(false); - } -} - -void TestAsymmetricCipher(TestData &v) -{ - std::string name = GetRequiredDatum(v, "Name"); - std::string test = GetRequiredDatum(v, "Test"); - - member_ptr encryptor(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - member_ptr decryptor(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - - std::string keyFormat = GetRequiredDatum(v, "KeyFormat"); - - if (keyFormat == "DER") - { - decryptor->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PrivateKey")).Ref()); - encryptor->AccessMaterial().Load(StringStore(GetDecodedDatum(v, "PublicKey")).Ref()); - } - else if (keyFormat == "Component") - { - TestDataNameValuePairs pairs(v); - decryptor->AccessMaterial().AssignFrom(pairs); - encryptor->AccessMaterial().AssignFrom(pairs); - } - - if (test == "DecryptMatch") - { - std::string decrypted, expected = GetDecodedDatum(v, "Plaintext"); - StringSource ss(GetDecodedDatum(v, "Ciphertext"), true, new PK_DecryptorFilter(GlobalRNG(), *decryptor, new StringSink(decrypted))); - if (decrypted != expected) - SignalTestFailure(); - } - else if (test == "KeyPairValidAndConsistent") - { - TestKeyPairValidAndConsistent(encryptor->AccessMaterial(), decryptor->GetMaterial()); - } - else - { - SignalTestError(); - assert(false); - } -} - -void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters) -{ - std::string name = GetRequiredDatum(v, "Name"); - std::string test = GetRequiredDatum(v, "Test"); - - std::string key = GetDecodedDatum(v, "Key"); - std::string plaintext = GetDecodedDatum(v, "Plaintext"); - - TestDataNameValuePairs testDataPairs(v); - CombinedNameValuePairs pairs(overrideParameters, testDataPairs); - - if (test == "Encrypt" || test == "EncryptXorDigest" || test == "Resync" || test == "EncryptionMCT" || test == "DecryptionMCT") - { - static member_ptr encryptor, decryptor; - static std::string lastName; - - if (name != lastName) - { - encryptor.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - decryptor.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - lastName = name; - } - - ConstByteArrayParameter iv; - if (pairs.GetValue(Name::IV(), iv) && iv.size() != encryptor->IVSize()) - SignalTestFailure(); - - if (test == "Resync") - { - encryptor->Resynchronize(iv.begin(), (int)iv.size()); - decryptor->Resynchronize(iv.begin(), (int)iv.size()); - } - else - { - encryptor->SetKey((const byte *)key.data(), key.size(), pairs); - decryptor->SetKey((const byte *)key.data(), key.size(), pairs); - } - - int seek = pairs.GetIntValueWithDefault("Seek", 0); - if (seek) - { - encryptor->Seek(seek); - decryptor->Seek(seek); - } - - std::string encrypted, xorDigest, ciphertext, ciphertextXorDigest; - if (test == "EncryptionMCT" || test == "DecryptionMCT") - { - SymmetricCipher *cipher = encryptor.get(); - SecByteBlock buf((byte *)plaintext.data(), plaintext.size()), keybuf((byte *)key.data(), key.size()); - - if (test == "DecryptionMCT") - { - cipher = decryptor.get(); - ciphertext = GetDecodedDatum(v, "Ciphertext"); - buf.Assign((byte *)ciphertext.data(), ciphertext.size()); - } - - for (int i=0; i<400; i++) - { - encrypted.reserve(10000 * plaintext.size()); - for (int j=0; j<10000; j++) - { - cipher->ProcessString(buf.begin(), buf.size()); - encrypted.append((char *)buf.begin(), buf.size()); - } - - encrypted.erase(0, encrypted.size() - keybuf.size()); - xorbuf(keybuf.begin(), (const byte *)encrypted.data(), keybuf.size()); - cipher->SetKey(keybuf, keybuf.size()); - } - encrypted.assign((char *)buf.begin(), buf.size()); - ciphertext = GetDecodedDatum(v, test == "EncryptionMCT" ? "Ciphertext" : "Plaintext"); - if (encrypted != ciphertext) - { - std::cout << "incorrectly encrypted: "; - StringSource xx(encrypted, false, new HexEncoder(new FileSink(std::cout))); - xx.Pump(256); xx.Flush(false); - std::cout << "\n"; - SignalTestFailure(); - } - return; - } - - StreamTransformationFilter encFilter(*encryptor, new StringSink(encrypted), StreamTransformationFilter::NO_PADDING); - RandomizedTransfer(StringStore(plaintext).Ref(), encFilter, true); - encFilter.MessageEnd(); - /*{ - std::string z; - encryptor->Seek(seek); - StringSource ss(plaintext, false, new StreamTransformationFilter(*encryptor, new StringSink(z), StreamTransformationFilter::NO_PADDING)); - while (ss.Pump(64)) {} - ss.PumpAll(); - for (int i=0; i asc1, asc2; - asc1.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - asc2.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - asc1->SetKey((const byte *)key.data(), key.size(), pairs); - asc2->SetKey((const byte *)key.data(), key.size(), pairs); - - std::string encrypted, decrypted; - AuthenticatedEncryptionFilter ef(*asc1, new StringSink(encrypted)); - bool macAtBegin = !mac.empty() && !GlobalRNG().GenerateBit(); // test both ways randomly - AuthenticatedDecryptionFilter df(*asc2, new StringSink(decrypted), macAtBegin ? AuthenticatedDecryptionFilter::MAC_AT_BEGIN : 0); - - if (asc1->NeedsPrespecifiedDataLengths()) - { - asc1->SpecifyDataLengths(header.size(), plaintext.size(), footer.size()); - asc2->SpecifyDataLengths(header.size(), plaintext.size(), footer.size()); - } - - StringStore sh(header), sp(plaintext), sc(ciphertext), sf(footer), sm(mac); - - if (macAtBegin) - RandomizedTransfer(sm, df, true); - sh.CopyTo(df, LWORD_MAX, AAD_CHANNEL); - RandomizedTransfer(sc, df, true); - sf.CopyTo(df, LWORD_MAX, AAD_CHANNEL); - if (!macAtBegin) - RandomizedTransfer(sm, df, true); - df.MessageEnd(); - - RandomizedTransfer(sh, ef, true, AAD_CHANNEL); - RandomizedTransfer(sp, ef, true); - RandomizedTransfer(sf, ef, true, AAD_CHANNEL); - ef.MessageEnd(); - - if (test == "Encrypt" && encrypted != ciphertext+mac) - { - std::cout << "incorrectly encrypted: "; - StringSource xx(encrypted, false, new HexEncoder(new FileSink(std::cout))); - xx.Pump(2048); xx.Flush(false); - std::cout << "\n"; - SignalTestFailure(); - } - if (test == "Encrypt" && decrypted != plaintext) - { - std::cout << "incorrectly decrypted: "; - StringSource xx(decrypted, false, new HexEncoder(new FileSink(std::cout))); - xx.Pump(256); xx.Flush(false); - std::cout << "\n"; - SignalTestFailure(); - } - - if (ciphertext.size()+mac.size()-plaintext.size() != asc1->DigestSize()) - { - std::cout << "bad MAC size\n"; - SignalTestFailure(); - } - if (df.GetLastResult() != (test == "Encrypt")) - { - std::cout << "MAC incorrectly verified\n"; - SignalTestFailure(); - } - } - else - { - std::cout << "unexpected test name\n"; - SignalTestError(); - } -} - -void TestDigestOrMAC(TestData &v, bool testDigest) -{ - std::string name = GetRequiredDatum(v, "Name"); - std::string test = GetRequiredDatum(v, "Test"); - const char *digestName = testDigest ? "Digest" : "MAC"; - - member_ptr mac; - member_ptr hash; - HashTransformation *pHash = NULL; - - TestDataNameValuePairs pairs(v); - - if (testDigest) - { - hash.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - pHash = hash.get(); - } - else - { - mac.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - pHash = mac.get(); - std::string key = GetDecodedDatum(v, "Key"); - mac->SetKey((const byte *)key.c_str(), key.size(), pairs); - } - - if (test == "Verify" || test == "VerifyTruncated" || test == "NotVerify") - { - int digestSize = -1; - if (test == "VerifyTruncated") - digestSize = pairs.GetIntValueWithDefault(Name::DigestSize(), digestSize); - HashVerificationFilter verifierFilter(*pHash, NULL, HashVerificationFilter::HASH_AT_BEGIN, digestSize); - PutDecodedDatumInto(v, digestName, verifierFilter); - PutDecodedDatumInto(v, "Message", verifierFilter); - verifierFilter.MessageEnd(); - if (verifierFilter.GetLastResult() == (test == "NotVerify")) - SignalTestFailure(); - } - else - { - SignalTestError(); - assert(false); - } -} - -void TestKeyDerivationFunction(TestData &v) -{ - std::string name = GetRequiredDatum(v, "Name"); - std::string test = GetRequiredDatum(v, "Test"); - - if(test == "Skip") return; - assert(test == "Verify"); - - std::string key = GetDecodedDatum(v, "Key"); - std::string salt = GetDecodedDatum(v, "Salt"); - std::string info = GetDecodedDatum(v, "Info"); - std::string derived = GetDecodedDatum(v, "DerivedKey"); - std::string t = GetDecodedDatum(v, "DerivedKeyLength"); - - TestDataNameValuePairs pairs(v); - unsigned int length = pairs.GetIntValueWithDefault(Name::DerivedKeyLength(), (int)derived.size()); - - member_ptr kdf; - kdf.reset(ObjectFactoryRegistry::Registry().CreateObject(name.c_str())); - - std::string calc; calc.resize(length); - unsigned int ret = kdf->DeriveKey(reinterpret_cast(&calc[0]), calc.size(), - reinterpret_cast(key.data()), key.size(), - reinterpret_cast(salt.data()), salt.size(), - reinterpret_cast(info.data()), info.size()); - - if(calc != derived || ret != length) - SignalTestFailure(); -} - -bool GetField(std::istream &is, std::string &name, std::string &value) -{ - name.resize(0); // GCC workaround: 2.95.3 doesn't have clear() - is >> name; - -#if defined(__COVERITY__) - // The datafile being read is in /usr/share, and it protected by filesystem ACLs - // __coverity_tainted_data_sanitize__(reinterpret_cast(&name)); -#endif - - if (name.empty()) - return false; - - if (name[name.size()-1] != ':') - { - char c; - is >> skipws >> c; - if (c != ':') - SignalTestError(); - } - else - name.erase(name.size()-1); - - while (is.peek() == ' ') - is.ignore(1); - - // VC60 workaround: getline bug - char buffer[128]; - value.resize(0); // GCC workaround: 2.95.3 doesn't have clear() - bool continueLine; - - do - { - do - { - is.get(buffer, sizeof(buffer)); - value += buffer; - } - while (buffer[0] != 0); - is.clear(); - is.ignore(); - - if (!value.empty() && value[value.size()-1] == '\r') - value.resize(value.size()-1); - - if (!value.empty() && value[value.size()-1] == '\\') - { - value.resize(value.size()-1); - continueLine = true; - } - else - continueLine = false; - - std::string::size_type i = value.find('#'); - if (i != std::string::npos) - value.erase(i); - } - while (continueLine); - - return true; -} - -void OutputPair(const NameValuePairs &v, const char *name) -{ - Integer x; - bool b = v.GetValue(name, x); - CRYPTOPP_UNUSED(b); assert(b); - cout << name << ": \\\n "; - x.Encode(HexEncoder(new FileSink(cout), false, 64, "\\\n ").Ref(), x.MinEncodedSize()); - cout << endl; -} - -void OutputNameValuePairs(const NameValuePairs &v) -{ - std::string names = v.GetValueNames(); - string::size_type i = 0; - while (i < names.size()) - { - string::size_type j = names.find_first_of (';', i); - - if (j == string::npos) - return; - else - { - std::string name = names.substr(i, j-i); - if (name.find(':') == string::npos) - OutputPair(v, name.c_str()); - } - - i = j + 1; - } -} - -void TestDataFile(const std::string &filename, const NameValuePairs &overrideParameters, unsigned int &totalTests, unsigned int &failedTests) -{ - std::ifstream file(filename.c_str()); - if (!file.good()) - throw Exception(Exception::OTHER_ERROR, "Can not open file " + filename + " for reading"); - TestData v; - s_currentTestData = &v; - std::string name, value, lastAlgName; - - while (file) - { - while (file.peek() == '#') - file.ignore(std::numeric_limits::max(), '\n'); - - if (file.peek() == '\n' || file.peek() == '\r') - v.clear(); - - if (!GetField(file, name, value)) - break; - v[name] = value; - - if (name == "Test" && (s_thorough || v["SlowTest"] != "1")) - { - bool failed = true; - std::string algType = GetRequiredDatum(v, "AlgorithmType"); - - if (lastAlgName != GetRequiredDatum(v, "Name")) - { - lastAlgName = GetRequiredDatum(v, "Name"); - cout << "\nTesting " << algType.c_str() << " algorithm " << lastAlgName.c_str() << ".\n"; - } - - try - { - if (algType == "Signature") - TestSignatureScheme(v); - else if (algType == "SymmetricCipher") - TestSymmetricCipher(v, overrideParameters); - else if (algType == "AuthenticatedSymmetricCipher") - TestAuthenticatedSymmetricCipher(v, overrideParameters); - else if (algType == "AsymmetricCipher") - TestAsymmetricCipher(v); - else if (algType == "MessageDigest") - TestDigestOrMAC(v, true); - else if (algType == "MAC") - TestDigestOrMAC(v, false); - else if (algType == "KDF") - TestKeyDerivationFunction(v); - else if (algType == "FileList") - TestDataFile(GetRequiredDatum(v, "Test"), g_nullNameValuePairs, totalTests, failedTests); - else - SignalTestError(); - failed = false; - } - catch (TestFailure &) - { - cout << "\nTest failed.\n"; - } - catch (CryptoPP::Exception &e) - { - cout << "\nCryptoPP::Exception caught: " << e.what() << endl; - } - catch (std::exception &e) - { - cout << "\nstd::exception caught: " << e.what() << endl; - } - - if (failed) - { - cout << "Skipping to next test.\n"; - failedTests++; - } - else - cout << "." << flush; - - totalTests++; - } - } -} - -bool RunTestDataFile(const char *filename, const NameValuePairs &overrideParameters, bool thorough) -{ - s_thorough = thorough; - unsigned int totalTests = 0, failedTests = 0; - TestDataFile(filename, overrideParameters, totalTests, failedTests); - cout << dec << "\nTests complete. Total tests = " << totalTests << ". Failed tests = " << failedTests << ".\n"; - if (failedTests != 0) - cout << "SOME TESTS FAILED!\n"; - return failedTests == 0; -} diff --git a/external/crypto++-5.6.3/default.cpp b/external/crypto++-5.6.3/default.cpp deleted file mode 100644 index 4b667a30e..000000000 --- a/external/crypto++-5.6.3/default.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// default.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4127 4189) -#endif - -#include "cryptlib.h" -#include "filters.h" -#include "smartptr.h" -#include "default.h" -#include "queue.h" - -#include -#include - -NAMESPACE_BEGIN(CryptoPP) - -static const unsigned int MASH_ITERATIONS = 200; -static const unsigned int SALTLENGTH = 8; -static const unsigned int BLOCKSIZE = DefaultBlockCipher::Encryption::BLOCKSIZE; -static const unsigned int KEYLENGTH = DefaultBlockCipher::Encryption::DEFAULT_KEYLENGTH; - -// The purpose of this function Mash() is to take an arbitrary length input -// string and *deterministicly* produce an arbitrary length output string such -// that (1) it looks random, (2) no information about the input is -// deducible from it, and (3) it contains as much entropy as it can hold, or -// the amount of entropy in the input string, whichever is smaller. - -static void Mash(const byte *in, size_t inLen, byte *out, size_t outLen, int iterations) -{ - if (BytePrecision(outLen) > 2) - throw InvalidArgument("Mash: output legnth too large"); - - size_t bufSize = RoundUpToMultipleOf(outLen, (size_t)DefaultHashModule::DIGESTSIZE); - byte b[2]; - SecByteBlock buf(bufSize); - SecByteBlock outBuf(bufSize); - DefaultHashModule hash; - - unsigned int i; - for(i=0; i> 8); - b[1] = (byte) i; - hash.Update(b, 2); - hash.Update(in, inLen); - hash.Final(outBuf+i); - } - - while (iterations-- > 1) - { - memcpy(buf, outBuf, bufSize); - for (i=0; i> 8); - b[1] = (byte) i; - hash.Update(b, 2); - hash.Update(buf, bufSize); - hash.Final(outBuf+i); - } - } - - memcpy(out, outBuf, outLen); -} - -static void GenerateKeyIV(const byte *passphrase, size_t passphraseLength, const byte *salt, size_t saltLength, byte *key, byte *IV) -{ - SecByteBlock temp(passphraseLength+saltLength); - memcpy(temp, passphrase, passphraseLength); - memcpy(temp+passphraseLength, salt, saltLength); - SecByteBlock keyIV(KEYLENGTH+BLOCKSIZE); - Mash(temp, passphraseLength + saltLength, keyIV, KEYLENGTH+BLOCKSIZE, MASH_ITERATIONS); - memcpy(key, keyIV, KEYLENGTH); - memcpy(IV, keyIV+KEYLENGTH, BLOCKSIZE); -} - -// ******************************************************** - -DefaultEncryptor::DefaultEncryptor(const char *passphrase, BufferedTransformation *attachment) - : ProxyFilter(NULL, 0, 0, attachment), m_passphrase((const byte *)passphrase, strlen(passphrase)) -{ -} - -DefaultEncryptor::DefaultEncryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment) - : ProxyFilter(NULL, 0, 0, attachment), m_passphrase(passphrase, passphraseLength) -{ -} - - -void DefaultEncryptor::FirstPut(const byte *) -{ - // VC60 workaround: __LINE__ expansion bug - CRYPTOPP_COMPILE_ASSERT_INSTANCE(SALTLENGTH <= DefaultHashModule::DIGESTSIZE, 1); - CRYPTOPP_COMPILE_ASSERT_INSTANCE(BLOCKSIZE <= DefaultHashModule::DIGESTSIZE, 2); - - SecByteBlock salt(DefaultHashModule::DIGESTSIZE), keyCheck(DefaultHashModule::DIGESTSIZE); - DefaultHashModule hash; - - // use hash(passphrase | time | clock) as salt - hash.Update(m_passphrase, m_passphrase.size()); - time_t t=time(0); - hash.Update((byte *)&t, sizeof(t)); - clock_t c=clock(); - hash.Update((byte *)&c, sizeof(c)); - hash.Final(salt); - - // use hash(passphrase | salt) as key check - hash.Update(m_passphrase, m_passphrase.size()); - hash.Update(salt, SALTLENGTH); - hash.Final(keyCheck); - - AttachedTransformation()->Put(salt, SALTLENGTH); - - // mash passphrase and salt together into key and IV - SecByteBlock key(KEYLENGTH); - SecByteBlock IV(BLOCKSIZE); - GenerateKeyIV(m_passphrase, m_passphrase.size(), salt, SALTLENGTH, key, IV); - - m_cipher.SetKeyWithIV(key, key.size(), IV); - SetFilter(new StreamTransformationFilter(m_cipher)); - - m_filter->Put(keyCheck, BLOCKSIZE); -} - -void DefaultEncryptor::LastPut(const byte *inString, size_t length) -{ - CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); - m_filter->MessageEnd(); -} - -// ******************************************************** - -DefaultDecryptor::DefaultDecryptor(const char *p, BufferedTransformation *attachment, bool throwException) - : ProxyFilter(NULL, SALTLENGTH+BLOCKSIZE, 0, attachment) - , m_state(WAITING_FOR_KEYCHECK) - , m_passphrase((const byte *)p, strlen(p)) - , m_throwException(throwException) -{ -} - -DefaultDecryptor::DefaultDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment, bool throwException) - : ProxyFilter(NULL, SALTLENGTH+BLOCKSIZE, 0, attachment) - , m_state(WAITING_FOR_KEYCHECK) - , m_passphrase(passphrase, passphraseLength) - , m_throwException(throwException) -{ -} - -void DefaultDecryptor::FirstPut(const byte *inString) -{ - CheckKey(inString, inString+SALTLENGTH); -} - -void DefaultDecryptor::LastPut(const byte *inString, size_t length) -{ - CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); - if (m_filter.get() == NULL) - { - m_state = KEY_BAD; - if (m_throwException) - throw KeyBadErr(); - } - else - { - m_filter->MessageEnd(); - m_state = WAITING_FOR_KEYCHECK; - } -} - -void DefaultDecryptor::CheckKey(const byte *salt, const byte *keyCheck) -{ - SecByteBlock check(STDMAX((unsigned int)2*BLOCKSIZE, (unsigned int)DefaultHashModule::DIGESTSIZE)); - - DefaultHashModule hash; - hash.Update(m_passphrase, m_passphrase.size()); - hash.Update(salt, SALTLENGTH); - hash.Final(check); - - SecByteBlock key(KEYLENGTH); - SecByteBlock IV(BLOCKSIZE); - GenerateKeyIV(m_passphrase, m_passphrase.size(), salt, SALTLENGTH, key, IV); - - m_cipher.SetKeyWithIV(key, key.size(), IV); - member_ptr decryptor(new StreamTransformationFilter(m_cipher)); - - decryptor->Put(keyCheck, BLOCKSIZE); - decryptor->ForceNextPut(); - decryptor->Get(check+BLOCKSIZE, BLOCKSIZE); - - SetFilter(decryptor.release()); - - if (!VerifyBufsEqual(check, check+BLOCKSIZE, BLOCKSIZE)) - { - m_state = KEY_BAD; - if (m_throwException) - throw KeyBadErr(); - } - else - m_state = KEY_GOOD; -} - -// ******************************************************** - -static DefaultMAC * NewDefaultEncryptorMAC(const byte *passphrase, size_t passphraseLength) -{ - size_t macKeyLength = DefaultMAC::StaticGetValidKeyLength(16); - SecByteBlock macKey(macKeyLength); - // since the MAC is encrypted there is no reason to mash the passphrase for many iterations - Mash(passphrase, passphraseLength, macKey, macKeyLength, 1); - return new DefaultMAC(macKey, macKeyLength); -} - -DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment) - : ProxyFilter(NULL, 0, 0, attachment) - , m_mac(NewDefaultEncryptorMAC((const byte *)passphrase, strlen(passphrase))) -{ - SetFilter(new HashFilter(*m_mac, new DefaultEncryptor(passphrase), true)); -} - -DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment) - : ProxyFilter(NULL, 0, 0, attachment) - , m_mac(NewDefaultEncryptorMAC(passphrase, passphraseLength)) -{ - SetFilter(new HashFilter(*m_mac, new DefaultEncryptor(passphrase, passphraseLength), true)); -} - -void DefaultEncryptorWithMAC::LastPut(const byte *inString, size_t length) -{ - CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); - m_filter->MessageEnd(); -} - -// ******************************************************** - -DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment, bool throwException) - : ProxyFilter(NULL, 0, 0, attachment) - , m_mac(NewDefaultEncryptorMAC((const byte *)passphrase, strlen(passphrase))) - , m_throwException(throwException) -{ - SetFilter(new DefaultDecryptor(passphrase, m_hashVerifier=new HashVerifier(*m_mac, NULL, HashVerifier::PUT_MESSAGE), throwException)); -} - -DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment, bool throwException) - : ProxyFilter(NULL, 0, 0, attachment) - , m_mac(NewDefaultEncryptorMAC(passphrase, passphraseLength)) - , m_throwException(throwException) -{ - SetFilter(new DefaultDecryptor(passphrase, passphraseLength, m_hashVerifier=new HashVerifier(*m_mac, NULL, HashVerifier::PUT_MESSAGE), throwException)); -} - -DefaultDecryptor::State DefaultDecryptorWithMAC::CurrentState() const -{ - return static_cast(m_filter.get())->CurrentState(); -} - -bool DefaultDecryptorWithMAC::CheckLastMAC() const -{ - return m_hashVerifier->GetLastResult(); -} - -void DefaultDecryptorWithMAC::LastPut(const byte *inString, size_t length) -{ - CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); - m_filter->MessageEnd(); - if (m_throwException && !CheckLastMAC()) - throw MACBadErr(); -} - -NAMESPACE_END - diff --git a/external/crypto++-5.6.3/default.h b/external/crypto++-5.6.3/default.h deleted file mode 100644 index 6829fb03b..000000000 --- a/external/crypto++-5.6.3/default.h +++ /dev/null @@ -1,201 +0,0 @@ -// default.h - written and placed in the public domain by Wei Dai - -//! \file default.h -//! \brief Classes for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC - -#ifndef CRYPTOPP_DEFAULT_H -#define CRYPTOPP_DEFAULT_H - -#include "sha.h" -#include "hmac.h" -#include "des.h" -#include "modes.h" -#include "filters.h" -#include "smartptr.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \brief Default block cipher for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC -typedef DES_EDE2 DefaultBlockCipher; -//! \brief Default hash for use with DefaultEncryptorWithMAC and DefaultDecryptorWithMAC -typedef SHA DefaultHashModule; -//! \brief Default HMAC for use withDefaultEncryptorWithMAC and DefaultDecryptorWithMAC -typedef HMAC DefaultMAC; - -//! \class DefaultEncryptor -//! \brief Password-Based Encryptor using TripleDES -//! \details The class uses 2-key TripleDES (DES_EDE2) for encryption, which only -//! provides about 80-bits of security. -class DefaultEncryptor : public ProxyFilter -{ -public: - //! \brief Construct a DefaultEncryptor - //! \param passphrase a C-String password - //! \param attachment a BufferedTransformation to attach to this object - DefaultEncryptor(const char *passphrase, BufferedTransformation *attachment = NULL); - - //! \brief Construct a DefaultEncryptor - //! \param passphrase a byte string password - //! \param passphraseLength the length of the byte string password - //! \param attachment a BufferedTransformation to attach to this object - DefaultEncryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL); - -protected: - void FirstPut(const byte *); - void LastPut(const byte *inString, size_t length); - -private: - SecByteBlock m_passphrase; - CBC_Mode::Encryption m_cipher; - -#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) -} __attribute__((deprecated ("DefaultEncryptor will be changing in the near future because the algorithms are no longer secure"))); -#elif (CRYPTOPP_GCC_VERSION) -} __attribute__((deprecated)); -#else -}; -#endif - -//! \class DefaultDecryptor -//! \brief Password-Based Decryptor using TripleDES -//! \details The class uses 2-key TripleDES (DES_EDE2) for encryption, which only -//! provides about 80-bits of security. -class DefaultDecryptor : public ProxyFilter -{ -public: - //! \brief Constructs a DefaultDecryptor - //! \param passphrase a C-String password - //! \param attachment a BufferedTransformation to attach to this object - //! \param throwException a flag specifiying whether an Exception should be thrown on error - DefaultDecryptor(const char *passphrase, BufferedTransformation *attachment = NULL, bool throwException=true); - - //! \brief Constructs a DefaultDecryptor - //! \param passphrase a byte string password - //! \param passphraseLength the length of the byte string password - //! \param attachment a BufferedTransformation to attach to this object - //! \param throwException a flag specifiying whether an Exception should be thrown on error - DefaultDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL, bool throwException=true); - - class Err : public Exception - { - public: - Err(const std::string &s) - : Exception(DATA_INTEGRITY_CHECK_FAILED, s) {} - }; - class KeyBadErr : public Err {public: KeyBadErr() : Err("DefaultDecryptor: cannot decrypt message with this passphrase") {}}; - - enum State {WAITING_FOR_KEYCHECK, KEY_GOOD, KEY_BAD}; - State CurrentState() const {return m_state;} - -protected: - void FirstPut(const byte *inString); - void LastPut(const byte *inString, size_t length); - - State m_state; - -private: - void CheckKey(const byte *salt, const byte *keyCheck); - - SecByteBlock m_passphrase; - CBC_Mode::Decryption m_cipher; - member_ptr m_decryptor; - bool m_throwException; - -#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) -} __attribute__((deprecated ("DefaultDecryptor will be changing in the near future because the algorithms are no longer secure"))); -#elif (CRYPTOPP_GCC_VERSION) -} __attribute__((deprecated)); -#else -}; -#endif - -//! \class DefaultEncryptorWithMAC -//! \brief Password-Based encryptor using TripleDES and HMAC/SHA-1 -//! \details DefaultEncryptorWithMAC uses a non-standard mashup function called Mash() to derive key -//! bits from the password. The class also uses 2-key TripleDES (DES_EDE2) for encryption, which only -//! provides about 80-bits of security. -//! \details The purpose of the function Mash() is to take an arbitrary length input string and -//! *deterministicly* produce an arbitrary length output string such that (1) it looks random, -//! (2) no information about the input is deducible from it, and (3) it contains as much entropy -//! as it can hold, or the amount of entropy in the input string, whichever is smaller. -class DefaultEncryptorWithMAC : public ProxyFilter -{ -public: - //! \brief Constructs a DefaultEncryptorWithMAC - //! \param passphrase a C-String password - //! \param attachment a BufferedTransformation to attach to this object - DefaultEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULL); - - //! \brief Constructs a DefaultEncryptorWithMAC - //! \param passphrase a byte string password - //! \param passphraseLength the length of the byte string password - //! \param attachment a BufferedTransformation to attach to this object - DefaultEncryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL); - -protected: - void FirstPut(const byte *inString) {CRYPTOPP_UNUSED(inString);} - void LastPut(const byte *inString, size_t length); - -private: - member_ptr m_mac; - -#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) -} __attribute__((deprecated ("DefaultEncryptorWithMAC will be changing in the near future because the algorithms are no longer secure"))); -#elif (CRYPTOPP_GCC_VERSION) -} __attribute__((deprecated)); -#else -}; -#endif - -//! \class DefaultDecryptorWithMAC -//! \brief Password-Based decryptor using TripleDES and HMAC/SHA-1 -//! \details DefaultDecryptorWithMAC uses a non-standard mashup function called Mash() to derive key -//! bits from the password. The class also uses 2-key TripleDES (DES_EDE2) for encryption, which only -//! provides about 80-bits of security. -//! \details The purpose of the function Mash() is to take an arbitrary length input string and -//! *deterministicly* produce an arbitrary length output string such that (1) it looks random, -//! (2) no information about the input is deducible from it, and (3) it contains as much entropy -//! as it can hold, or the amount of entropy in the input string, whichever is smaller. -class DefaultDecryptorWithMAC : public ProxyFilter -{ -public: - //! \class MACBadErr - //! \brief Excpetion thrown when an incorrect MAC is encountered - class MACBadErr : public DefaultDecryptor::Err {public: MACBadErr() : DefaultDecryptor::Err("DefaultDecryptorWithMAC: MAC check failed") {}}; - - //! \brief Constructs a DefaultDecryptor - //! \param passphrase a C-String password - //! \param attachment a BufferedTransformation to attach to this object - //! \param throwException a flag specifiying whether an Exception should be thrown on error - DefaultDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULL, bool throwException=true); - - //! \brief Constructs a DefaultDecryptor - //! \param passphrase a byte string password - //! \param passphraseLength the length of the byte string password - //! \param attachment a BufferedTransformation to attach to this object - //! \param throwException a flag specifiying whether an Exception should be thrown on error - DefaultDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULL, bool throwException=true); - - DefaultDecryptor::State CurrentState() const; - bool CheckLastMAC() const; - -protected: - void FirstPut(const byte *inString) {CRYPTOPP_UNUSED(inString);} - void LastPut(const byte *inString, size_t length); - -private: - member_ptr m_mac; - HashVerifier *m_hashVerifier; - bool m_throwException; - -#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) -} __attribute__((deprecated ("DefaultDecryptorWithMAC will be changing in the near future because the algorithms are no longer secure"))); -#elif (CRYPTOPP_GCC_VERSION) -} __attribute__((deprecated)); -#else -}; -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/des.cpp b/external/crypto++-5.6.3/des.cpp deleted file mode 100644 index d563327a3..000000000 --- a/external/crypto++-5.6.3/des.cpp +++ /dev/null @@ -1,453 +0,0 @@ -// des.cpp - modified by Wei Dai from Phil Karn's des.c -// The original code and all modifications are in the public domain. - -/* - * This is a major rewrite of my old public domain DES code written - * circa 1987, which in turn borrowed heavily from Jim Gillogly's 1977 - * public domain code. I pretty much kept my key scheduling code, but - * the actual encrypt/decrypt routines are taken from from Richard - * Outerbridge's DES code as printed in Schneier's "Applied Cryptography." - * - * This code is in the public domain. I would appreciate bug reports and - * enhancements. - * - * Phil Karn KA9Q, karn@unix.ka9q.ampr.org, August 1994. - */ - -#include "pch.h" -#include "misc.h" -#include "des.h" - -NAMESPACE_BEGIN(CryptoPP) - -typedef BlockGetAndPut Block; - -// Richard Outerbridge's initial permutation algorithm -/* -inline void IPERM(word32 &left, word32 &right) -{ - word32 work; - - work = ((left >> 4) ^ right) & 0x0f0f0f0f; - right ^= work; - left ^= work << 4; - work = ((left >> 16) ^ right) & 0xffff; - right ^= work; - left ^= work << 16; - work = ((right >> 2) ^ left) & 0x33333333; - left ^= work; - right ^= (work << 2); - work = ((right >> 8) ^ left) & 0xff00ff; - left ^= work; - right ^= (work << 8); - right = rotl(right, 1); - work = (left ^ right) & 0xaaaaaaaa; - left ^= work; - right ^= work; - left = rotl(left, 1); -} -inline void FPERM(word32 &left, word32 &right) -{ - word32 work; - - right = rotr(right, 1); - work = (left ^ right) & 0xaaaaaaaa; - left ^= work; - right ^= work; - left = rotr(left, 1); - work = ((left >> 8) ^ right) & 0xff00ff; - right ^= work; - left ^= work << 8; - work = ((left >> 2) ^ right) & 0x33333333; - right ^= work; - left ^= work << 2; - work = ((right >> 16) ^ left) & 0xffff; - left ^= work; - right ^= work << 16; - work = ((right >> 4) ^ left) & 0x0f0f0f0f; - left ^= work; - right ^= work << 4; -} -*/ - -// Wei Dai's modification to Richard Outerbridge's initial permutation -// algorithm, this one is faster if you have access to rotate instructions -// (like in MSVC) -static inline void IPERM(word32 &left, word32 &right) -{ - word32 work; - - right = rotlFixed(right, 4U); - work = (left ^ right) & 0xf0f0f0f0; - left ^= work; - right = rotrFixed(right^work, 20U); - work = (left ^ right) & 0xffff0000; - left ^= work; - right = rotrFixed(right^work, 18U); - work = (left ^ right) & 0x33333333; - left ^= work; - right = rotrFixed(right^work, 6U); - work = (left ^ right) & 0x00ff00ff; - left ^= work; - right = rotlFixed(right^work, 9U); - work = (left ^ right) & 0xaaaaaaaa; - left = rotlFixed(left^work, 1U); - right ^= work; -} - -static inline void FPERM(word32 &left, word32 &right) -{ - word32 work; - - right = rotrFixed(right, 1U); - work = (left ^ right) & 0xaaaaaaaa; - right ^= work; - left = rotrFixed(left^work, 9U); - work = (left ^ right) & 0x00ff00ff; - right ^= work; - left = rotlFixed(left^work, 6U); - work = (left ^ right) & 0x33333333; - right ^= work; - left = rotlFixed(left^work, 18U); - work = (left ^ right) & 0xffff0000; - right ^= work; - left = rotlFixed(left^work, 20U); - work = (left ^ right) & 0xf0f0f0f0; - right ^= work; - left = rotrFixed(left^work, 4U); -} - -void DES::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - RawSetKey(GetCipherDirection(), userKey); -} - -#ifndef CRYPTOPP_IMPORTS - -/* Tables defined in the Data Encryption Standard documents - * Three of these tables, the initial permutation, the final - * permutation and the expansion operator, are regular enough that - * for speed, we hard-code them. They're here for reference only. - * Also, the S and P boxes are used by a separate program, gensp.c, - * to build the combined SP box, Spbox[]. They're also here just - * for reference. - */ -#ifdef notdef -/* initial permutation IP */ -static byte ip[] = { - 58, 50, 42, 34, 26, 18, 10, 2, - 60, 52, 44, 36, 28, 20, 12, 4, - 62, 54, 46, 38, 30, 22, 14, 6, - 64, 56, 48, 40, 32, 24, 16, 8, - 57, 49, 41, 33, 25, 17, 9, 1, - 59, 51, 43, 35, 27, 19, 11, 3, - 61, 53, 45, 37, 29, 21, 13, 5, - 63, 55, 47, 39, 31, 23, 15, 7 -}; - -/* final permutation IP^-1 */ -static byte fp[] = { - 40, 8, 48, 16, 56, 24, 64, 32, - 39, 7, 47, 15, 55, 23, 63, 31, - 38, 6, 46, 14, 54, 22, 62, 30, - 37, 5, 45, 13, 53, 21, 61, 29, - 36, 4, 44, 12, 52, 20, 60, 28, - 35, 3, 43, 11, 51, 19, 59, 27, - 34, 2, 42, 10, 50, 18, 58, 26, - 33, 1, 41, 9, 49, 17, 57, 25 -}; -/* expansion operation matrix */ -static byte ei[] = { - 32, 1, 2, 3, 4, 5, - 4, 5, 6, 7, 8, 9, - 8, 9, 10, 11, 12, 13, - 12, 13, 14, 15, 16, 17, - 16, 17, 18, 19, 20, 21, - 20, 21, 22, 23, 24, 25, - 24, 25, 26, 27, 28, 29, - 28, 29, 30, 31, 32, 1 -}; -/* The (in)famous S-boxes */ -static byte sbox[8][64] = { - /* S1 */ - 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, - 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, - 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, - 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13, - - /* S2 */ - 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, - 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, - 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, - 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9, - - /* S3 */ - 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, - 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, - 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, - 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12, - - /* S4 */ - 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, - 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, - 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, - 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14, - - /* S5 */ - 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, - 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, - 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, - 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3, - - /* S6 */ - 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, - 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, - 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, - 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13, - - /* S7 */ - 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, - 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, - 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, - 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12, - - /* S8 */ - 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, - 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, - 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, - 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 -}; - -/* 32-bit permutation function P used on the output of the S-boxes */ -static byte p32i[] = { - 16, 7, 20, 21, - 29, 12, 28, 17, - 1, 15, 23, 26, - 5, 18, 31, 10, - 2, 8, 24, 14, - 32, 27, 3, 9, - 19, 13, 30, 6, - 22, 11, 4, 25 -}; -#endif - -/* permuted choice table (key) */ -static const byte pc1[] = { - 57, 49, 41, 33, 25, 17, 9, - 1, 58, 50, 42, 34, 26, 18, - 10, 2, 59, 51, 43, 35, 27, - 19, 11, 3, 60, 52, 44, 36, - - 63, 55, 47, 39, 31, 23, 15, - 7, 62, 54, 46, 38, 30, 22, - 14, 6, 61, 53, 45, 37, 29, - 21, 13, 5, 28, 20, 12, 4 -}; - -/* number left rotations of pc1 */ -static const byte totrot[] = { - 1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 -}; - -/* permuted choice key (table) */ -static const byte pc2[] = { - 14, 17, 11, 24, 1, 5, - 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, - 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, - 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, - 46, 42, 50, 36, 29, 32 -}; - -/* End of DES-defined tables */ - -/* bit 0 is left-most in byte */ -static const int bytebit[] = { - 0200,0100,040,020,010,04,02,01 -}; - -/* Set key (initialize key schedule array) */ -void RawDES::RawSetKey(CipherDir dir, const byte *key) -{ -#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) -# define register /* Define to nothing for C++11 and above */ -#endif - - SecByteBlock buffer(56+56+8); - byte *const pc1m=buffer; /* place to modify pc1 into */ - byte *const pcr=pc1m+56; /* place to rotate pc1 into */ - byte *const ks=pcr+56; - register int i,j,l; - int m; - - for (j=0; j<56; j++) { /* convert pc1 to bits of key */ - l=pc1[j]-1; /* integer bit location */ - m = l & 07; /* find bit */ - pc1m[j]=(key[l>>3] & /* find which key byte l is in */ - bytebit[m]) /* and which bit of that byte */ - ? 1 : 0; /* and store 1-bit result */ - } - for (i=0; i<16; i++) { /* key chunk for each iteration */ - memset(ks,0,8); /* Clear key schedule */ - for (j=0; j<56; j++) /* rotate pc1 the right amount */ - pcr[j] = pc1m[(l=j+totrot[i])<(j<28? 28 : 56) ? l: l-28]; - /* rotate left and right halves independently */ - for (j=0; j<48; j++){ /* select bits individually */ - /* check bit that goes to ks[j] */ - if (pcr[pc2[j]-1]){ - /* mask it in if it's there */ - l= j % 6; - ks[j/6] |= bytebit[l] >> 2; - } - } - /* Now convert to odd/even interleaved form for use in F */ - k[2*i] = ((word32)ks[0] << 24) - | ((word32)ks[2] << 16) - | ((word32)ks[4] << 8) - | ((word32)ks[6]); - k[2*i+1] = ((word32)ks[1] << 24) - | ((word32)ks[3] << 16) - | ((word32)ks[5] << 8) - | ((word32)ks[7]); - } - - if (dir==DECRYPTION) // reverse key schedule order - for (i=0; i<16; i+=2) - { - std::swap(k[i], k[32-2-i]); - std::swap(k[i+1], k[32-1-i]); - } -} - -void RawDES::RawProcessBlock(word32 &l_, word32 &r_) const -{ - word32 l = l_, r = r_; - const word32 *kptr=k; - - for (unsigned i=0; i<8; i++) - { - word32 work = rotrFixed(r, 4U) ^ kptr[4*i+0]; - l ^= Spbox[6][(work) & 0x3f] - ^ Spbox[4][(work >> 8) & 0x3f] - ^ Spbox[2][(work >> 16) & 0x3f] - ^ Spbox[0][(work >> 24) & 0x3f]; - work = r ^ kptr[4*i+1]; - l ^= Spbox[7][(work) & 0x3f] - ^ Spbox[5][(work >> 8) & 0x3f] - ^ Spbox[3][(work >> 16) & 0x3f] - ^ Spbox[1][(work >> 24) & 0x3f]; - - work = rotrFixed(l, 4U) ^ kptr[4*i+2]; - r ^= Spbox[6][(work) & 0x3f] - ^ Spbox[4][(work >> 8) & 0x3f] - ^ Spbox[2][(work >> 16) & 0x3f] - ^ Spbox[0][(work >> 24) & 0x3f]; - work = l ^ kptr[4*i+3]; - r ^= Spbox[7][(work) & 0x3f] - ^ Spbox[5][(work >> 8) & 0x3f] - ^ Spbox[3][(work >> 16) & 0x3f] - ^ Spbox[1][(work >> 24) & 0x3f]; - } - - l_ = l; r_ = r; -} - -void DES_EDE2::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - m_des1.RawSetKey(GetCipherDirection(), userKey); - m_des2.RawSetKey(ReverseCipherDir(GetCipherDirection()), userKey+8); -} - -void DES_EDE2::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 l,r; - Block::Get(inBlock)(l)(r); - IPERM(l,r); - m_des1.RawProcessBlock(l, r); - m_des2.RawProcessBlock(r, l); - m_des1.RawProcessBlock(l, r); - FPERM(l,r); - Block::Put(xorBlock, outBlock)(r)(l); -} - -void DES_EDE3::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - m_des1.RawSetKey(GetCipherDirection(), userKey + (IsForwardTransformation() ? 0 : 16)); - m_des2.RawSetKey(ReverseCipherDir(GetCipherDirection()), userKey + 8); - m_des3.RawSetKey(GetCipherDirection(), userKey + (IsForwardTransformation() ? 16 : 0)); -} - -void DES_EDE3::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 l,r; - Block::Get(inBlock)(l)(r); - IPERM(l,r); - m_des1.RawProcessBlock(l, r); - m_des2.RawProcessBlock(r, l); - m_des3.RawProcessBlock(l, r); - FPERM(l,r); - Block::Put(xorBlock, outBlock)(r)(l); -} - -#endif // #ifndef CRYPTOPP_IMPORTS - -static inline bool CheckParity(byte b) -{ - unsigned int a = b ^ (b >> 4); - return ((a ^ (a>>1) ^ (a>>2) ^ (a>>3)) & 1) == 1; -} - -bool DES::CheckKeyParityBits(const byte *key) -{ - for (unsigned int i=0; i<8; i++) - if (!CheckParity(key[i])) - return false; - return true; -} - -void DES::CorrectKeyParityBits(byte *key) -{ - for (unsigned int i=0; i<8; i++) - if (!CheckParity(key[i])) - key[i] ^= 1; -} - -// Encrypt or decrypt a block of data in ECB mode -void DES::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 l,r; - Block::Get(inBlock)(l)(r); - IPERM(l,r); - RawProcessBlock(l, r); - FPERM(l,r); - Block::Put(xorBlock, outBlock)(r)(l); -} - -void DES_XEX3::Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - if (!m_des.get()) - m_des.reset(new DES::Encryption); - - memcpy(m_x1, key + (IsForwardTransformation() ? 0 : 16), BLOCKSIZE); - m_des->RawSetKey(GetCipherDirection(), key + 8); - memcpy(m_x3, key + (IsForwardTransformation() ? 16 : 0), BLOCKSIZE); -} - -void DES_XEX3::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - xorbuf(outBlock, inBlock, m_x1, BLOCKSIZE); - m_des->ProcessAndXorBlock(outBlock, xorBlock, outBlock); - xorbuf(outBlock, m_x3, BLOCKSIZE); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/des.h b/external/crypto++-5.6.3/des.h deleted file mode 100644 index 55971e064..000000000 --- a/external/crypto++-5.6.3/des.h +++ /dev/null @@ -1,146 +0,0 @@ -// des.h - written and placed in the public domain by Wei Dai - -//! \file des.h -//! \brief Classes for DES, 2-key Triple-DES, 3-key Triple-DES and DESX - -#ifndef CRYPTOPP_DES_H -#define CRYPTOPP_DES_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -class CRYPTOPP_DLL RawDES -{ -public: - void RawSetKey(CipherDir direction, const byte *userKey); - void RawProcessBlock(word32 &l, word32 &r) const; - -protected: - static const word32 Spbox[8][64]; - - FixedSizeSecBlock k; -}; - -//! _ -struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8> -{ - // disable DES in DLL version by not exporting this function - static const char * StaticAlgorithmName() {return "DES";} -}; - -/// DES -/*! The DES implementation in Crypto++ ignores the parity bits - (the least significant bits of each byte) in the key. However - you can use CheckKeyParityBits() and CorrectKeyParityBits() to - check or correct the parity bits if you wish. */ -class DES : public DES_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl, public RawDES - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - //! check DES key parity bits - static bool CheckKeyParityBits(const byte *key); - //! correct DES key parity bits - static void CorrectKeyParityBits(byte *key); - - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -//! _ -struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16> -{ - CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE2";} -}; - -/// DES-EDE2 -class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - protected: - RawDES m_des1, m_des2; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -//! _ -struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> -{ - CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE3";} -}; - -/// DES-EDE3 -class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - protected: - RawDES m_des1, m_des2, m_des3; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -//! _ -struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> -{ - static const char *StaticAlgorithmName() {return "DES-XEX3";} -}; - -/// DES-XEX3, AKA DESX -class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - protected: - FixedSizeSecBlock m_x1, m_x3; - // VS2005 workaround: calling modules compiled with /clr gets unresolved external symbol DES::Base::ProcessAndXorBlock - // if we use DES::Encryption here directly without value_ptr. - value_ptr m_des; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef DES::Encryption DESEncryption; -typedef DES::Decryption DESDecryption; - -typedef DES_EDE2::Encryption DES_EDE2_Encryption; -typedef DES_EDE2::Decryption DES_EDE2_Decryption; - -typedef DES_EDE3::Encryption DES_EDE3_Encryption; -typedef DES_EDE3::Decryption DES_EDE3_Decryption; - -typedef DES_XEX3::Encryption DES_XEX3_Encryption; -typedef DES_XEX3::Decryption DES_XEX3_Decryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dessp.cpp b/external/crypto++-5.6.3/dessp.cpp deleted file mode 100644 index 49ed1d26d..000000000 --- a/external/crypto++-5.6.3/dessp.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// This file is mostly generated by Phil Karn's gensp.c - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "des.h" - -NAMESPACE_BEGIN(CryptoPP) - -// VC60 workaround: gives a C4786 warning without this function -// when runtime lib is set to multithread debug DLL -// even though warning 4786 is disabled! -void DES_VC60Workaround() -{ -} - -const word32 RawDES::Spbox[8][64] = { -{ -0x01010400,0x00000000,0x00010000,0x01010404, 0x01010004,0x00010404,0x00000004,0x00010000, -0x00000400,0x01010400,0x01010404,0x00000400, 0x01000404,0x01010004,0x01000000,0x00000004, -0x00000404,0x01000400,0x01000400,0x00010400, 0x00010400,0x01010000,0x01010000,0x01000404, -0x00010004,0x01000004,0x01000004,0x00010004, 0x00000000,0x00000404,0x00010404,0x01000000, -0x00010000,0x01010404,0x00000004,0x01010000, 0x01010400,0x01000000,0x01000000,0x00000400, -0x01010004,0x00010000,0x00010400,0x01000004, 0x00000400,0x00000004,0x01000404,0x00010404, -0x01010404,0x00010004,0x01010000,0x01000404, 0x01000004,0x00000404,0x00010404,0x01010400, -0x00000404,0x01000400,0x01000400,0x00000000, 0x00010004,0x00010400,0x00000000,0x01010004}, -{ -0x80108020,0x80008000,0x00008000,0x00108020, 0x00100000,0x00000020,0x80100020,0x80008020, -0x80000020,0x80108020,0x80108000,0x80000000, 0x80008000,0x00100000,0x00000020,0x80100020, -0x00108000,0x00100020,0x80008020,0x00000000, 0x80000000,0x00008000,0x00108020,0x80100000, -0x00100020,0x80000020,0x00000000,0x00108000, 0x00008020,0x80108000,0x80100000,0x00008020, -0x00000000,0x00108020,0x80100020,0x00100000, 0x80008020,0x80100000,0x80108000,0x00008000, -0x80100000,0x80008000,0x00000020,0x80108020, 0x00108020,0x00000020,0x00008000,0x80000000, -0x00008020,0x80108000,0x00100000,0x80000020, 0x00100020,0x80008020,0x80000020,0x00100020, -0x00108000,0x00000000,0x80008000,0x00008020, 0x80000000,0x80100020,0x80108020,0x00108000}, -{ -0x00000208,0x08020200,0x00000000,0x08020008, 0x08000200,0x00000000,0x00020208,0x08000200, -0x00020008,0x08000008,0x08000008,0x00020000, 0x08020208,0x00020008,0x08020000,0x00000208, -0x08000000,0x00000008,0x08020200,0x00000200, 0x00020200,0x08020000,0x08020008,0x00020208, -0x08000208,0x00020200,0x00020000,0x08000208, 0x00000008,0x08020208,0x00000200,0x08000000, -0x08020200,0x08000000,0x00020008,0x00000208, 0x00020000,0x08020200,0x08000200,0x00000000, -0x00000200,0x00020008,0x08020208,0x08000200, 0x08000008,0x00000200,0x00000000,0x08020008, -0x08000208,0x00020000,0x08000000,0x08020208, 0x00000008,0x00020208,0x00020200,0x08000008, -0x08020000,0x08000208,0x00000208,0x08020000, 0x00020208,0x00000008,0x08020008,0x00020200}, -{ -0x00802001,0x00002081,0x00002081,0x00000080, 0x00802080,0x00800081,0x00800001,0x00002001, -0x00000000,0x00802000,0x00802000,0x00802081, 0x00000081,0x00000000,0x00800080,0x00800001, -0x00000001,0x00002000,0x00800000,0x00802001, 0x00000080,0x00800000,0x00002001,0x00002080, -0x00800081,0x00000001,0x00002080,0x00800080, 0x00002000,0x00802080,0x00802081,0x00000081, -0x00800080,0x00800001,0x00802000,0x00802081, 0x00000081,0x00000000,0x00000000,0x00802000, -0x00002080,0x00800080,0x00800081,0x00000001, 0x00802001,0x00002081,0x00002081,0x00000080, -0x00802081,0x00000081,0x00000001,0x00002000, 0x00800001,0x00002001,0x00802080,0x00800081, -0x00002001,0x00002080,0x00800000,0x00802001, 0x00000080,0x00800000,0x00002000,0x00802080}, -{ -0x00000100,0x02080100,0x02080000,0x42000100, 0x00080000,0x00000100,0x40000000,0x02080000, -0x40080100,0x00080000,0x02000100,0x40080100, 0x42000100,0x42080000,0x00080100,0x40000000, -0x02000000,0x40080000,0x40080000,0x00000000, 0x40000100,0x42080100,0x42080100,0x02000100, -0x42080000,0x40000100,0x00000000,0x42000000, 0x02080100,0x02000000,0x42000000,0x00080100, -0x00080000,0x42000100,0x00000100,0x02000000, 0x40000000,0x02080000,0x42000100,0x40080100, -0x02000100,0x40000000,0x42080000,0x02080100, 0x40080100,0x00000100,0x02000000,0x42080000, -0x42080100,0x00080100,0x42000000,0x42080100, 0x02080000,0x00000000,0x40080000,0x42000000, -0x00080100,0x02000100,0x40000100,0x00080000, 0x00000000,0x40080000,0x02080100,0x40000100}, -{ -0x20000010,0x20400000,0x00004000,0x20404010, 0x20400000,0x00000010,0x20404010,0x00400000, -0x20004000,0x00404010,0x00400000,0x20000010, 0x00400010,0x20004000,0x20000000,0x00004010, -0x00000000,0x00400010,0x20004010,0x00004000, 0x00404000,0x20004010,0x00000010,0x20400010, -0x20400010,0x00000000,0x00404010,0x20404000, 0x00004010,0x00404000,0x20404000,0x20000000, -0x20004000,0x00000010,0x20400010,0x00404000, 0x20404010,0x00400000,0x00004010,0x20000010, -0x00400000,0x20004000,0x20000000,0x00004010, 0x20000010,0x20404010,0x00404000,0x20400000, -0x00404010,0x20404000,0x00000000,0x20400010, 0x00000010,0x00004000,0x20400000,0x00404010, -0x00004000,0x00400010,0x20004010,0x00000000, 0x20404000,0x20000000,0x00400010,0x20004010}, -{ -0x00200000,0x04200002,0x04000802,0x00000000, 0x00000800,0x04000802,0x00200802,0x04200800, -0x04200802,0x00200000,0x00000000,0x04000002, 0x00000002,0x04000000,0x04200002,0x00000802, -0x04000800,0x00200802,0x00200002,0x04000800, 0x04000002,0x04200000,0x04200800,0x00200002, -0x04200000,0x00000800,0x00000802,0x04200802, 0x00200800,0x00000002,0x04000000,0x00200800, -0x04000000,0x00200800,0x00200000,0x04000802, 0x04000802,0x04200002,0x04200002,0x00000002, -0x00200002,0x04000000,0x04000800,0x00200000, 0x04200800,0x00000802,0x00200802,0x04200800, -0x00000802,0x04000002,0x04200802,0x04200000, 0x00200800,0x00000000,0x00000002,0x04200802, -0x00000000,0x00200802,0x04200000,0x00000800, 0x04000002,0x04000800,0x00000800,0x00200002}, -{ -0x10001040,0x00001000,0x00040000,0x10041040, 0x10000000,0x10001040,0x00000040,0x10000000, -0x00040040,0x10040000,0x10041040,0x00041000, 0x10041000,0x00041040,0x00001000,0x00000040, -0x10040000,0x10000040,0x10001000,0x00001040, 0x00041000,0x00040040,0x10040040,0x10041000, -0x00001040,0x00000000,0x00000000,0x10040040, 0x10000040,0x10001000,0x00041040,0x00040000, -0x00041040,0x00040000,0x10041000,0x00001000, 0x00000040,0x10040040,0x00001000,0x00041040, -0x10001000,0x00000040,0x10000040,0x10040000, 0x10040040,0x10000000,0x00040000,0x10001040, -0x00000000,0x10041040,0x00040040,0x10000040, 0x10040000,0x10001000,0x10001040,0x00000000, -0x10041040,0x00041000,0x00041000,0x00001040, 0x00001040,0x00040040,0x10000000,0x10041000} -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dh.cpp b/external/crypto++-5.6.3/dh.cpp deleted file mode 100644 index 8f55ffa68..000000000 --- a/external/crypto++-5.6.3/dh.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// dh.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "dh.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void DH_TestInstantiations() -{ - DH dh1; - DH dh2(NullRNG(), 10); -} -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dh.h b/external/crypto++-5.6.3/dh.h deleted file mode 100644 index d0f9f3397..000000000 --- a/external/crypto++-5.6.3/dh.h +++ /dev/null @@ -1,107 +0,0 @@ -// dh.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile dh.h -//! \brief Classes for Diffie-Hellman key exchange - -#ifndef CRYPTOPP_DH_H -#define CRYPTOPP_DH_H - -#include "cryptlib.h" -#include "gfpcrypt.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! , -template -class DH_Domain : public DL_SimpleKeyAgreementDomainBase -{ - typedef DL_SimpleKeyAgreementDomainBase Base; - -public: - typedef GROUP_PARAMETERS GroupParameters; - typedef typename GroupParameters::Element Element; - typedef DL_KeyAgreementAlgorithm_DH DH_Algorithm; - typedef DH_Domain Domain; - - DH_Domain() {} - - DH_Domain(const GroupParameters ¶ms) - : m_groupParameters(params) {} - - DH_Domain(BufferedTransformation &bt) - {m_groupParameters.BERDecode(bt);} - - template - DH_Domain(RandomNumberGenerator &v1, const T2 &v2) - {m_groupParameters.Initialize(v1, v2);} - - template - DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3) - {m_groupParameters.Initialize(v1, v2, v3);} - - template - DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3, const T4 &v4) - {m_groupParameters.Initialize(v1, v2, v3, v4);} - - template - DH_Domain(const T1 &v1, const T2 &v2) - {m_groupParameters.Initialize(v1, v2);} - - template - DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3) - {m_groupParameters.Initialize(v1, v2, v3);} - - template - DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) - {m_groupParameters.Initialize(v1, v2, v3, v4);} - - const GroupParameters & GetGroupParameters() const {return m_groupParameters;} - GroupParameters & AccessGroupParameters() {return m_groupParameters;} - - void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const - { - Base::GeneratePublicKey(rng, privateKey, publicKey); - - if (FIPS_140_2_ComplianceEnabled()) - { - SecByteBlock privateKey2(this->PrivateKeyLength()); - this->GeneratePrivateKey(rng, privateKey2); - - SecByteBlock publicKey2(this->PublicKeyLength()); - Base::GeneratePublicKey(rng, privateKey2, publicKey2); - - SecByteBlock agreedValue(this->AgreedValueLength()), agreedValue2(this->AgreedValueLength()); - bool agreed1 = this->Agree(agreedValue, privateKey, publicKey2); - bool agreed2 = this->Agree(agreedValue2, privateKey2, publicKey); - - if (!agreed1 || !agreed2 || agreedValue != agreedValue2) - throw SelfTestFailure(this->AlgorithmName() + ": pairwise consistency test failed"); - } - } - - static std::string CRYPTOPP_API StaticAlgorithmName() - {return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();} - std::string AlgorithmName() const {return StaticAlgorithmName();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DH_Domain() {} -#endif - -private: - const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const - {return Singleton().Ref();} - DL_GroupParameters & AccessAbstractGroupParameters() - {return m_groupParameters;} - - GroupParameters m_groupParameters; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS DH_Domain; - -//! Diffie-Hellman in GF(p) with key validation -typedef DH_Domain DH; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dh2.cpp b/external/crypto++-5.6.3/dh2.cpp deleted file mode 100644 index e1a8afd70..000000000 --- a/external/crypto++-5.6.3/dh2.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// dh2.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "dh2.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void DH2_TestInstantiations() -{ - DH2 dh(*(SimpleKeyAgreementDomain*)NULL); -} -#endif - -bool DH2::Agree(byte *agreedValue, - const byte *staticSecretKey, const byte *ephemeralSecretKey, - const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, - bool validateStaticOtherPublicKey) const -{ - return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey) - && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/dh2.h b/external/crypto++-5.6.3/dh2.h deleted file mode 100644 index 28d48ab73..000000000 --- a/external/crypto++-5.6.3/dh2.h +++ /dev/null @@ -1,65 +0,0 @@ -// dh2.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile dh2.h -//! \brief Classes for Diffie-Hellman authenticated key exchange - -#ifndef CRYPTOPP_DH2_H -#define CRYPTOPP_DH2_H - -#include "cryptlib.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// Unified Diffie-Hellman -class DH2 : public AuthenticatedKeyAgreementDomain -{ -public: - DH2(SimpleKeyAgreementDomain &domain) - : d1(domain), d2(domain) {} - DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain) - : d1(staticDomain), d2(ephemeralDomain) {} - - CryptoParameters & AccessCryptoParameters() {return d1.AccessCryptoParameters();} - - unsigned int AgreedValueLength() const - {return d1.AgreedValueLength() + d2.AgreedValueLength();} - - unsigned int StaticPrivateKeyLength() const - {return d1.PrivateKeyLength();} - unsigned int StaticPublicKeyLength() const - {return d1.PublicKeyLength();} - void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const - {d1.GeneratePrivateKey(rng, privateKey);} - void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const - {d1.GeneratePublicKey(rng, privateKey, publicKey);} - void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const - {d1.GenerateKeyPair(rng, privateKey, publicKey);} - - unsigned int EphemeralPrivateKeyLength() const - {return d2.PrivateKeyLength();} - unsigned int EphemeralPublicKeyLength() const - {return d2.PublicKeyLength();} - void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const - {d2.GeneratePrivateKey(rng, privateKey);} - void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const - {d2.GeneratePublicKey(rng, privateKey, publicKey);} - void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const - {d2.GenerateKeyPair(rng, privateKey, publicKey);} - - bool Agree(byte *agreedValue, - const byte *staticPrivateKey, const byte *ephemeralPrivateKey, - const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, - bool validateStaticOtherPublicKey=true) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DH2() {} -#endif - -protected: - SimpleKeyAgreementDomain &d1, &d2; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dll.cpp b/external/crypto++-5.6.3/dll.cpp deleted file mode 100644 index 1b16d2aed..000000000 --- a/external/crypto++-5.6.3/dll.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// dll.cpp - written and placed in the public domain by Wei Dai - -#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#define CRYPTOPP_DEFAULT_NO_DLL - -#include "dll.h" -#include "config.h" - -// TODO: fix the C4589 warnings -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4589) -#endif - -#if CRYPTOPP_MSC_VERSION -# pragma warning(default: 4660) -#endif - -#if defined(CRYPTOPP_EXPORTS) && defined(CRYPTOPP_WIN32_AVAILABLE) -#include -#endif - -#ifndef CRYPTOPP_IMPORTS - -NAMESPACE_BEGIN(CryptoPP) - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x2d,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x04,0x05,0x00,0x04,0x1c}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0x04,0x20}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x41,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,0x05,0x00,0x04,0x30}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,0x05,0x00,0x04,0x40}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte EMSA2HashId::id = 0x33; -template<> const byte EMSA2HashId::id = 0x38; -template<> const byte EMSA2HashId::id = 0x34; -template<> const byte EMSA2HashId::id = 0x36; -template<> const byte EMSA2HashId::id = 0x35; - -NAMESPACE_END - -#endif - -#ifdef CRYPTOPP_EXPORTS - -USING_NAMESPACE(CryptoPP) - -#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) -using std::set_new_handler; -#endif - -static PNew s_pNew = NULL; -static PDelete s_pDelete = NULL; - -static void * New (size_t size) -{ - void *p; - while ((p = malloc(size)) == NULL) - CallNewHandler(); - - return p; -} - -// Cast from FARPROC to funcptr with args, http://stackoverflow.com/q/4192058/608639 -#pragma warning(disable: 4191) - -static void SetNewAndDeleteFunctionPointers() -{ - void *p = NULL; - HMODULE hModule = NULL; - MEMORY_BASIC_INFORMATION mbi; - - while (true) - { - VirtualQuery(p, &mbi, sizeof(mbi)); - - if (p >= (char *)mbi.BaseAddress + mbi.RegionSize) - break; - - p = (char *)mbi.BaseAddress + mbi.RegionSize; - - if (!mbi.AllocationBase || mbi.AllocationBase == hModule) - continue; - - hModule = HMODULE(mbi.AllocationBase); - PGetNewAndDelete pGetNewAndDelete = (PGetNewAndDelete)GetProcAddress(hModule, "GetNewAndDeleteForCryptoPP"); - if (pGetNewAndDelete) - { - pGetNewAndDelete(s_pNew, s_pDelete); - return; - } - - PSetNewAndDelete pSetNewAndDelete = (PSetNewAndDelete)GetProcAddress(hModule, "SetNewAndDeleteFromCryptoPP"); - if (pSetNewAndDelete) - { - s_pNew = &New; - s_pDelete = &free; - pSetNewAndDelete(s_pNew, s_pDelete, &set_new_handler); - return; - } - } - - // try getting these directly using mangled names of new and delete operators - - hModule = GetModuleHandle("msvcrtd"); - if (!hModule) - hModule = GetModuleHandle("msvcrt"); - if (hModule) - { - // 32-bit versions - s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPAXI@Z"); - s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPAX@Z"); - if (s_pNew && s_pDelete) - return; - - // 64-bit versions - s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPEAX_K@Z"); - s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPEAX@Z"); - if (s_pNew && s_pDelete) - return; - } - - OutputDebugString("Crypto++ was not able to obtain new and delete function pointers.\n"); - throw 0; -} - -// Cast from FARPROC to funcptr with args -#pragma warning(default: 4191) - -void * operator new (size_t size) -{ - if (!s_pNew) - SetNewAndDeleteFunctionPointers(); - - return s_pNew(size); -} - -void operator delete (void * p) -{ - s_pDelete(p); -} - -void * operator new [] (size_t size) -{ - return operator new (size); -} - -void operator delete [] (void * p) -{ - operator delete (p); -} - -#endif // #ifdef CRYPTOPP_EXPORTS diff --git a/external/crypto++-5.6.3/dll.h b/external/crypto++-5.6.3/dll.h deleted file mode 100644 index 09aa48a8f..000000000 --- a/external/crypto++-5.6.3/dll.h +++ /dev/null @@ -1,77 +0,0 @@ -// dll.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile dll.h -//! \brief Functions and definitions required for building the FIPS-140 DLL on Windows - -#ifndef CRYPTOPP_DLL_H -#define CRYPTOPP_DLL_H - -#if !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) && !defined(CRYPTOPP_DEFAULT_NO_DLL) -#ifdef CRYPTOPP_CONFIG_H -#error To use the DLL version of Crypto++, this file must be included before any other Crypto++ header files. -#endif -#define CRYPTOPP_IMPORTS -#endif - -#include "aes.h" -#include "cbcmac.h" -#include "ccm.h" -#include "cmac.h" -#include "channels.h" -#include "des.h" -#include "dh.h" -#include "dsa.h" -#include "ec2n.h" -#include "eccrypto.h" -#include "ecp.h" -#include "files.h" -#include "fips140.h" -#include "gcm.h" -#include "hex.h" -#include "hmac.h" -#include "modes.h" -#include "mqueue.h" -#include "nbtheory.h" -#include "osrng.h" -#include "pkcspad.h" -#include "pssr.h" -#include "randpool.h" -#include "rsa.h" -#include "rw.h" -#include "sha.h" -#include "skipjack.h" -#include "trdlocal.h" - -#ifdef CRYPTOPP_IMPORTS - -#ifdef _DLL -// cause CRT DLL to be initialized before Crypto++ so that we can use malloc and free during DllMain() -#ifdef NDEBUG -#pragma comment(lib, "msvcrt") -#else -#pragma comment(lib, "msvcrtd") -#endif -#endif - -#pragma comment(lib, "cryptopp") - -#endif // #ifdef CRYPTOPP_IMPORTS - -#include // for new_handler - -NAMESPACE_BEGIN(CryptoPP) - -#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) -using std::new_handler; -#endif - -typedef void * (CRYPTOPP_API * PNew)(size_t); -typedef void (CRYPTOPP_API * PDelete)(void *); -typedef void (CRYPTOPP_API * PGetNewAndDelete)(PNew &, PDelete &); -typedef new_handler (CRYPTOPP_API * PSetNewHandler)(new_handler); -typedef void (CRYPTOPP_API * PSetNewAndDelete)(PNew, PDelete, PSetNewHandler); - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dlltest.cpp b/external/crypto++-5.6.3/dlltest.cpp deleted file mode 100644 index 7469d2752..000000000 --- a/external/crypto++-5.6.3/dlltest.cpp +++ /dev/null @@ -1,207 +0,0 @@ -#ifndef CRYPTOPP_DLL_ONLY -# define CRYPTOPP_DEFAULT_NO_DLL -#endif - -#include "dll.h" -#include "cryptlib.h" -#include "filters.h" - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -void FIPS140_SampleApplication() -{ - if (!FIPS_140_2_ComplianceEnabled()) - { - cerr << "FIPS 140-2 compliance was turned off at compile time.\n"; - abort(); - } - - // check self test status - if (GetPowerUpSelfTestStatus() != POWER_UP_SELF_TEST_PASSED) - { - cerr << "Automatic power-up self test failed.\n"; - abort(); - } - cout << "0. Automatic power-up self test passed.\n"; - - // simulate a power-up self test error - SimulatePowerUpSelfTestFailure(); - try - { - // trying to use a crypto algorithm after power-up self test error will result in an exception - AES::Encryption aes; - - // should not be here - cerr << "Use of AES failed to cause an exception after power-up self test error.\n"; - abort(); - } - catch (SelfTestFailure &e) - { - cout << "1. Caught expected exception when simulating self test failure. Exception message follows: "; - cout << e.what() << endl; - } - - // clear the self test error state and redo power-up self test - DoDllPowerUpSelfTest(); - if (GetPowerUpSelfTestStatus() != POWER_UP_SELF_TEST_PASSED) - { - cerr << "Re-do power-up self test failed.\n"; - abort(); - } - cout << "2. Re-do power-up self test passed.\n"; - - // encrypt and decrypt - const byte key[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; - const byte iv[] = {0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}; - const byte plaintext[] = { // "Now is the time for all " without tailing 0 - 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, - 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, - 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20}; - byte ciphertext[24]; - byte decrypted[24]; - - CFB_FIPS_Mode::Encryption encryption_DES_EDE3_CFB; - encryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv); - encryption_DES_EDE3_CFB.ProcessString(ciphertext, plaintext, 24); - - CFB_FIPS_Mode::Decryption decryption_DES_EDE3_CFB; - decryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv); - decryption_DES_EDE3_CFB.ProcessString(decrypted, ciphertext, 24); - - if (memcmp(plaintext, decrypted, 24) != 0) - { - cerr << "DES-EDE3-CFB Encryption/decryption failed.\n"; - abort(); - } - cout << "3. DES-EDE3-CFB Encryption/decryption succeeded.\n"; - - // hash - const byte message[] = {'a', 'b', 'c'}; - const byte expectedDigest[] = {0xA9,0x99,0x3E,0x36,0x47,0x06,0x81,0x6A,0xBA,0x3E,0x25,0x71,0x78,0x50,0xC2,0x6C,0x9C,0xD0,0xD8,0x9D}; - byte digest[20]; - - SHA1 sha; - sha.Update(message, 3); - sha.Final(digest); - - if (memcmp(digest, expectedDigest, 20) != 0) - { - cerr << "SHA-1 hash failed.\n"; - abort(); - } - cout << "4. SHA-1 hash succeeded.\n"; - - // create auto-seeded X9.17 RNG object, if available -#ifdef OS_RNG_AVAILABLE - AutoSeededX917RNG rng; -#else - // this is used to allow this function to compile on platforms that don't have auto-seeded RNGs - RandomNumberGenerator &rng(NullRNG()); -#endif - - // generate DSA key - DSA::PrivateKey dsaPrivateKey; - dsaPrivateKey.GenerateRandomWithKeySize(rng, 1024); - DSA::PublicKey dsaPublicKey; - dsaPublicKey.AssignFrom(dsaPrivateKey); - if (!dsaPrivateKey.Validate(rng, 3) || !dsaPublicKey.Validate(rng, 3)) - { - cerr << "DSA key generation failed.\n"; - abort(); - } - cout << "5. DSA key generation succeeded.\n"; - - // encode DSA key - std::string encodedDsaPublicKey, encodedDsaPrivateKey; - dsaPublicKey.DEREncode(StringSink(encodedDsaPublicKey).Ref()); - dsaPrivateKey.DEREncode(StringSink(encodedDsaPrivateKey).Ref()); - - // decode DSA key - DSA::PrivateKey decodedDsaPrivateKey; - decodedDsaPrivateKey.BERDecode(StringStore(encodedDsaPrivateKey).Ref()); - DSA::PublicKey decodedDsaPublicKey; - decodedDsaPublicKey.BERDecode(StringStore(encodedDsaPublicKey).Ref()); - - if (!decodedDsaPrivateKey.Validate(rng, 3) || !decodedDsaPublicKey.Validate(rng, 3)) - { - cerr << "DSA key encode/decode failed.\n"; - abort(); - } - cout << "6. DSA key encode/decode succeeded.\n"; - - // sign and verify - byte signature[40]; - DSA::Signer signer(dsaPrivateKey); - assert(signer.SignatureLength() == 40); - signer.SignMessage(rng, message, 3, signature); - - DSA::Verifier verifier(dsaPublicKey); - if (!verifier.VerifyMessage(message, 3, signature, sizeof(signature))) - { - cerr << "DSA signature and verification failed.\n"; - abort(); - } - cout << "7. DSA signature and verification succeeded.\n"; - - - // try to verify an invalid signature - signature[0] ^= 1; - if (verifier.VerifyMessage(message, 3, signature, sizeof(signature))) - { - cerr << "DSA signature verification failed to detect bad signature.\n"; - abort(); - } - cout << "8. DSA signature verification successfully detected bad signature.\n"; - - // try to use an invalid key length - try - { - ECB_Mode::Encryption encryption_DES_EDE3_ECB; - encryption_DES_EDE3_ECB.SetKey(key, 5); - - // should not be here - cerr << "DES-EDE3 implementation did not detect use of invalid key length.\n"; - abort(); - } - catch (InvalidArgument &e) - { - cout << "9. Caught expected exception when using invalid key length. Exception message follows: "; - cout << e.what() << endl; - } - - cout << "\nFIPS 140-2 Sample Application completed normally.\n"; -} - -#ifdef CRYPTOPP_IMPORTS - -static PNew s_pNew = NULL; -static PDelete s_pDelete = NULL; - -extern "C" __declspec(dllexport) void __cdecl SetNewAndDeleteFromCryptoPP(PNew pNew, PDelete pDelete, PSetNewHandler pSetNewHandler) -{ - s_pNew = pNew; - s_pDelete = pDelete; -} - -void * __cdecl operator new (size_t size) -{ - return s_pNew(size); -} - -void __cdecl operator delete (void * p) -{ - s_pDelete(p); -} - -#endif - -#ifdef CRYPTOPP_DLL_ONLY - -int __cdecl main() -{ - FIPS140_SampleApplication(); - return 0; -} - -#endif diff --git a/external/crypto++-5.6.3/dlltest.dsp b/external/crypto++-5.6.3/dlltest.dsp deleted file mode 100644 index b8d08ea6b..000000000 --- a/external/crypto++-5.6.3/dlltest.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=dlltest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dlltest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dlltest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "dlltest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dlltest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "dlltest___Win32_Release" -# PROP BASE Intermediate_Dir "dlltest___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "dlltest___Win32_Release" -# PROP Intermediate_Dir "dlltest___Win32_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /Gz /MT /W3 /GR /GX /Zi /O1 /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "CRYPTOPP_DLL_ONLY" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /map /debug /machine:I386 /out:"DLL_Release/dlltest.exe" /libpath:"DLL_Release" - -!ELSEIF "$(CFG)" == "dlltest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "dlltest___Win32_Debug" -# PROP BASE Intermediate_Dir "dlltest___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "dlltest___Win32_Debug" -# PROP Intermediate_Dir "dlltest___Win32_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /Gz /MTd /W3 /Gm /GR /GX /Zi /Oi /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "CRYPTOPP_DLL_ONLY" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"DLL_Debug/dlltest.exe" /pdbtype:sept /libpath:"DLL_Debug" - -!ENDIF - -# Begin Target - -# Name "dlltest - Win32 Release" -# Name "dlltest - Win32 Debug" -# Begin Source File - -SOURCE=.\dlltest.cpp -# End Source File -# End Target -# End Project diff --git a/external/crypto++-5.6.3/dlltest.vcproj b/external/crypto++-5.6.3/dlltest.vcproj deleted file mode 100644 index 353aa1519..000000000 --- a/external/crypto++-5.6.3/dlltest.vcproj +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/external/crypto++-5.6.3/dmac.h b/external/crypto++-5.6.3/dmac.h deleted file mode 100644 index f0d88023c..000000000 --- a/external/crypto++-5.6.3/dmac.h +++ /dev/null @@ -1,99 +0,0 @@ -// dmac.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile dmac.h -//! \brief Classes for DMAC message authentication code - -#ifndef CRYPTOPP_DMAC_H -#define CRYPTOPP_DMAC_H - -#include "cbcmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -template -class CRYPTOPP_NO_VTABLE DMAC_Base : public SameKeyLengthAs, public MessageAuthenticationCode -{ -public: - static std::string StaticAlgorithmName() {return std::string("DMAC(") + T::StaticAlgorithmName() + ")";} - - CRYPTOPP_CONSTANT(DIGESTSIZE=T::BLOCKSIZE) - - DMAC_Base() : m_subkeylength(0), m_counter(0) {} - - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *mac, size_t size); - unsigned int DigestSize() const {return DIGESTSIZE;} - -private: - byte *GenerateSubKeys(const byte *key, size_t keylength); - - size_t m_subkeylength; - SecByteBlock m_subkeys; - CBC_MAC m_mac1; - typename T::Encryption m_f2; - unsigned int m_counter; -}; - -//! DMAC -/*! Based on "CBC MAC for Real-Time Data Sources" by Erez Petrank - and Charles Rackoff. T should be a class derived from BlockCipherDocumentation. -*/ -template -class DMAC : public MessageAuthenticationCodeFinal > -{ -public: - DMAC() {} - DMAC(const byte *key, size_t length=DMAC_Base::DEFAULT_KEYLENGTH) - {this->SetKey(key, length);} -}; - -template -void DMAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) -{ - m_subkeylength = T::StaticGetValidKeyLength(T::BLOCKSIZE); - m_subkeys.resize(2*UnsignedMin((unsigned int)T::BLOCKSIZE, m_subkeylength)); - m_mac1.SetKey(GenerateSubKeys(key, length), m_subkeylength, params); - m_f2.SetKey(m_subkeys+m_subkeys.size()/2, m_subkeylength, params); - m_counter = 0; - m_subkeys.resize(0); -} - -template -void DMAC_Base::Update(const byte *input, size_t length) -{ - m_mac1.Update(input, length); - m_counter = (unsigned int)((m_counter + length) % T::BLOCKSIZE); -} - -template -void DMAC_Base::TruncatedFinal(byte *mac, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - byte pad[T::BLOCKSIZE]; - byte padByte = byte(T::BLOCKSIZE-m_counter); - memset(pad, padByte, padByte); - m_mac1.Update(pad, padByte); - m_mac1.TruncatedFinal(mac, size); - m_f2.ProcessBlock(mac); - - m_counter = 0; // reset for next message -} - -template -byte *DMAC_Base::GenerateSubKeys(const byte *key, size_t keylength) -{ - typename T::Encryption cipher(key, keylength); - memset(m_subkeys, 0, m_subkeys.size()); - cipher.ProcessBlock(m_subkeys); - m_subkeys[m_subkeys.size()/2 + T::BLOCKSIZE - 1] = 1; - cipher.ProcessBlock(m_subkeys+m_subkeys.size()/2); - return m_subkeys; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dsa.cpp b/external/crypto++-5.6.3/dsa.cpp deleted file mode 100644 index 87cc7da2b..000000000 --- a/external/crypto++-5.6.3/dsa.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// dsa.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "dsa.h" -#include "asn.h" -#include "integer.h" -#include "filters.h" -#include "nbtheory.h" - -NAMESPACE_BEGIN(CryptoPP) - -size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat) -{ - Integer r, s; - StringStore store(signature, signatureLen); - ArraySink sink(buffer, bufferSize); - - switch (fromFormat) - { - case DSA_P1363: - r.Decode(store, signatureLen/2); - s.Decode(store, signatureLen/2); - break; - case DSA_DER: - { - BERSequenceDecoder seq(store); - r.BERDecode(seq); - s.BERDecode(seq); - seq.MessageEnd(); - break; - } - case DSA_OPENPGP: - r.OpenPGPDecode(store); - s.OpenPGPDecode(store); - break; - } - - switch (toFormat) - { - case DSA_P1363: - r.Encode(sink, bufferSize/2); - s.Encode(sink, bufferSize/2); - break; - case DSA_DER: - { - DERSequenceEncoder seq(sink); - r.DEREncode(seq); - s.DEREncode(seq); - seq.MessageEnd(); - break; - } - case DSA_OPENPGP: - r.OpenPGPEncode(sink); - s.OpenPGPEncode(sink); - break; - } - - return (size_t)sink.TotalPutLength(); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/dsa.h b/external/crypto++-5.6.3/dsa.h deleted file mode 100644 index 5e6ef305c..000000000 --- a/external/crypto++-5.6.3/dsa.h +++ /dev/null @@ -1,41 +0,0 @@ -// dsa.h - written and placed in the public domain by Wei Dai - -//! \file dsa.h -//! \brief Classes for the DSA signature algorithm - -#ifndef CRYPTOPP_DSA_H -#define CRYPTOPP_DSA_H - -#include "cryptlib.h" -#include "gfpcrypt.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \brief DSA Signature Format -//! \details The DSA signature format used by Crypto++ is as defined by IEEE P1363. -//! Java nad .Net use the DER format, and OpenPGP uses the OpenPGP format. -enum DSASignatureFormat { - //! \brief Crypto++ native signature encoding format - DSA_P1363, - //! \brief signature encoding format used by Java and .Net - DSA_DER, - //! \brief OpenPGP signature encoding format - DSA_OPENPGP -}; - -//! \brief Converts between signature encoding formats -//! \param buffer byte buffer for the converted signature encoding -//! \param bufferSize the length of the converted signature encoding buffer -//! \param toFormat the source signature format -//! \param signature byte buffer for the existing signature encoding -//! \param signatureLen the length of the existing signature encoding buffer -//! \param fromFormat the source signature format -//! \details This function converts between these formats, and returns length -//! of signature in the target format. If toFormat == DSA_P1363, then -//! bufferSize must equal publicKey.SignatureLength() -size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, - const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat); - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/eax.cpp b/external/crypto++-5.6.3/eax.cpp deleted file mode 100644 index 2728c9bcd..000000000 --- a/external/crypto++-5.6.3/eax.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// eax.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "eax.h" - -NAMESPACE_BEGIN(CryptoPP) - -void EAX_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) -{ - AccessMAC().SetKey(userKey, keylength, params); - m_buffer.New(2*AccessMAC().TagSize()); -} - -void EAX_Base::Resync(const byte *iv, size_t len) -{ - MessageAuthenticationCode &mac = AccessMAC(); - unsigned int blockSize = mac.TagSize(); - - memset(m_buffer, 0, blockSize); - mac.Update(m_buffer, blockSize); - mac.CalculateDigest(m_buffer+blockSize, iv, len); - - m_buffer[blockSize-1] = 1; - mac.Update(m_buffer, blockSize); - - m_ctr.SetCipherWithIV(AccessMAC().AccessCipher(), m_buffer+blockSize, blockSize); -} - -size_t EAX_Base::AuthenticateBlocks(const byte *data, size_t len) -{ - AccessMAC().Update(data, len); - return 0; -} - -void EAX_Base::AuthenticateLastHeaderBlock() -{ - assert(m_bufferedDataLength == 0); - MessageAuthenticationCode &mac = AccessMAC(); - unsigned int blockSize = mac.TagSize(); - - mac.Final(m_buffer); - xorbuf(m_buffer+blockSize, m_buffer, blockSize); - - memset(m_buffer, 0, blockSize); - m_buffer[blockSize-1] = 2; - mac.Update(m_buffer, blockSize); -} - -void EAX_Base::AuthenticateLastFooterBlock(byte *tag, size_t macSize) -{ - assert(m_bufferedDataLength == 0); - MessageAuthenticationCode &mac = AccessMAC(); - unsigned int blockSize = mac.TagSize(); - - mac.TruncatedFinal(m_buffer, macSize); - xorbuf(tag, m_buffer, m_buffer+blockSize, macSize); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/eax.h b/external/crypto++-5.6.3/eax.h deleted file mode 100644 index a5d707a1a..000000000 --- a/external/crypto++-5.6.3/eax.h +++ /dev/null @@ -1,112 +0,0 @@ -// eax.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile eax.h -//! \brief EAX block cipher mode of operation - -#ifndef CRYPTOPP_EAX_H -#define CRYPTOPP_EAX_H - -#include "authenc.h" -#include "modes.h" -#include "cmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class EAX_Base -//! \brief EAX block cipher mode of operation -//! \details Implementations and overrides in \p EAX_Base apply to both \p ENCRYPTION and \p DECRYPTION directions -class CRYPTOPP_NO_VTABLE EAX_Base : public AuthenticatedSymmetricCipherBase -{ -public: - // AuthenticatedSymmetricCipher - std::string AlgorithmName() const - {return GetMAC().GetCipher().AlgorithmName() + std::string("/EAX");} - size_t MinKeyLength() const - {return GetMAC().MinKeyLength();} - size_t MaxKeyLength() const - {return GetMAC().MaxKeyLength();} - size_t DefaultKeyLength() const - {return GetMAC().DefaultKeyLength();} - size_t GetValidKeyLength(size_t n) const - {return GetMAC().GetValidKeyLength(n);} - bool IsValidKeyLength(size_t n) const - {return GetMAC().IsValidKeyLength(n);} - unsigned int OptimalDataAlignment() const - {return GetMAC().OptimalDataAlignment();} - IV_Requirement IVRequirement() const - {return UNIQUE_IV;} - unsigned int IVSize() const - {return GetMAC().TagSize();} - unsigned int MinIVLength() const - {return 0;} - unsigned int MaxIVLength() const - {return UINT_MAX;} - unsigned int DigestSize() const - {return GetMAC().TagSize();} - lword MaxHeaderLength() const - {return LWORD_MAX;} - lword MaxMessageLength() const - {return LWORD_MAX;} - -protected: - // AuthenticatedSymmetricCipherBase - bool AuthenticationIsOnPlaintext() const - {return false;} - unsigned int AuthenticationBlockSize() const - {return 1;} - void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); - void Resync(const byte *iv, size_t len); - size_t AuthenticateBlocks(const byte *data, size_t len); - void AuthenticateLastHeaderBlock(); - void AuthenticateLastFooterBlock(byte *mac, size_t macSize); - SymmetricCipher & AccessSymmetricCipher() {return m_ctr;} - const CMAC_Base & GetMAC() const {return const_cast(this)->AccessMAC();} - virtual CMAC_Base & AccessMAC() =0; - - CTR_Mode_ExternalCipher::Encryption m_ctr; -}; - -//! \class EAX_Final -//! \brief Class specific methods used to operate the cipher. -//! \tparam T_BlockCipher block cipher -//! \tparam T_IsEncryption direction in which to operate the cipher -//! \details Implementations and overrides in \p GCM_Final apply to either -//! \p ENCRYPTION or \p DECRYPTION, depending on the template parameter \p T_IsEncryption. -//! \details \p EAX_Final does not use inner classes \p Enc and \p Dec. -template -class EAX_Final : public EAX_Base -{ -public: - static std::string StaticAlgorithmName() - {return T_BlockCipher::StaticAlgorithmName() + std::string("/EAX");} - bool IsForwardTransformation() const - {return T_IsEncryption;} - -private: - CMAC_Base & AccessMAC() {return m_cmac;} - CMAC m_cmac; -}; - -#ifdef EAX // EAX is defined to 11 on GCC 3.4.3, OpenSolaris 8.11 -#undef EAX -#endif - -//! \class EAX -//! \brief The EAX block cipher mode of operation -//! \details EAX is an Authenticated Encryption with Associated Data (AEAD) block -//! cipher mode of operation designed to simultaneously provide both authentication -//! and privacy of the message. -//! \tparam T_BlockCipher block cipher -//! \details \p EAX provides the \p Encryption and \p Decryption typedef. -//! \sa EAX at the Crypto Lounge -template -struct EAX : public AuthenticatedSymmetricCipherDocumentation -{ - typedef EAX_Final Encryption; - typedef EAX_Final Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ec2n.cpp b/external/crypto++-5.6.3/ec2n.cpp deleted file mode 100644 index a0096d722..000000000 --- a/external/crypto++-5.6.3/ec2n.cpp +++ /dev/null @@ -1,294 +0,0 @@ -// ec2n.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "ec2n.h" -#include "asn.h" -#include "integer.h" -#include "filters.h" -#include "algebra.cpp" -#include "eprecomp.cpp" - -NAMESPACE_BEGIN(CryptoPP) - -EC2N::EC2N(BufferedTransformation &bt) - : m_field(BERDecodeGF2NP(bt)) -{ - BERSequenceDecoder seq(bt); - m_field->BERDecodeElement(seq, m_a); - m_field->BERDecodeElement(seq, m_b); - // skip optional seed - if (!seq.EndReached()) - { - SecByteBlock seed; - unsigned int unused; - BERDecodeBitString(seq, seed, unused); - } - seq.MessageEnd(); -} - -void EC2N::DEREncode(BufferedTransformation &bt) const -{ - m_field->DEREncode(bt); - DERSequenceEncoder seq(bt); - m_field->DEREncodeElement(seq, m_a); - m_field->DEREncodeElement(seq, m_b); - seq.MessageEnd(); -} - -bool EC2N::DecodePoint(EC2N::Point &P, const byte *encodedPoint, size_t encodedPointLen) const -{ - StringStore store(encodedPoint, encodedPointLen); - return DecodePoint(P, store, encodedPointLen); -} - -bool EC2N::DecodePoint(EC2N::Point &P, BufferedTransformation &bt, size_t encodedPointLen) const -{ - byte type; - if (encodedPointLen < 1 || !bt.Get(type)) - return false; - - switch (type) - { - case 0: - P.identity = true; - return true; - case 2: - case 3: - { - if (encodedPointLen != EncodedPointSize(true)) - return false; - - P.identity = false; - P.x.Decode(bt, m_field->MaxElementByteLength()); - - if (P.x.IsZero()) - { - P.y = m_field->SquareRoot(m_b); - return true; - } - - FieldElement z = m_field->Square(P.x); - assert(P.x == m_field->SquareRoot(z)); - P.y = m_field->Divide(m_field->Add(m_field->Multiply(z, m_field->Add(P.x, m_a)), m_b), z); - assert(P.x == m_field->Subtract(m_field->Divide(m_field->Subtract(m_field->Multiply(P.y, z), m_b), z), m_a)); - z = m_field->SolveQuadraticEquation(P.y); - assert(m_field->Add(m_field->Square(z), z) == P.y); - z.SetCoefficient(0, type & 1); - - P.y = m_field->Multiply(z, P.x); - return true; - } - case 4: - { - if (encodedPointLen != EncodedPointSize(false)) - return false; - - unsigned int len = m_field->MaxElementByteLength(); - P.identity = false; - P.x.Decode(bt, len); - P.y.Decode(bt, len); - return true; - } - default: - return false; - } -} - -void EC2N::EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const -{ - if (P.identity) - NullStore().TransferTo(bt, EncodedPointSize(compressed)); - else if (compressed) - { - bt.Put(2 + (!P.x ? 0 : m_field->Divide(P.y, P.x).GetBit(0))); - P.x.Encode(bt, m_field->MaxElementByteLength()); - } - else - { - unsigned int len = m_field->MaxElementByteLength(); - bt.Put(4); // uncompressed - P.x.Encode(bt, len); - P.y.Encode(bt, len); - } -} - -void EC2N::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const -{ - ArraySink sink(encodedPoint, EncodedPointSize(compressed)); - EncodePoint(sink, P, compressed); - assert(sink.TotalPutLength() == EncodedPointSize(compressed)); -} - -EC2N::Point EC2N::BERDecodePoint(BufferedTransformation &bt) const -{ - SecByteBlock str; - BERDecodeOctetString(bt, str); - Point P; - if (!DecodePoint(P, str, str.size())) - BERDecodeError(); - return P; -} - -void EC2N::DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const -{ - SecByteBlock str(EncodedPointSize(compressed)); - EncodePoint(str, P, compressed); - DEREncodeOctetString(bt, str); -} - -bool EC2N::ValidateParameters(RandomNumberGenerator &rng, unsigned int level) const -{ - CRYPTOPP_UNUSED(rng); - bool pass = !!m_b; - pass = pass && m_a.CoefficientCount() <= m_field->MaxElementBitLength(); - pass = pass && m_b.CoefficientCount() <= m_field->MaxElementBitLength(); - - if (level >= 1) - pass = pass && m_field->GetModulus().IsIrreducible(); - - return pass; -} - -bool EC2N::VerifyPoint(const Point &P) const -{ - const FieldElement &x = P.x, &y = P.y; - return P.identity || - (x.CoefficientCount() <= m_field->MaxElementBitLength() - && y.CoefficientCount() <= m_field->MaxElementBitLength() - && !(((x+m_a)*x*x+m_b-(x+y)*y)%m_field->GetModulus())); -} - -bool EC2N::Equal(const Point &P, const Point &Q) const -{ - if (P.identity && Q.identity) - return true; - - if (P.identity && !Q.identity) - return false; - - if (!P.identity && Q.identity) - return false; - - return (m_field->Equal(P.x,Q.x) && m_field->Equal(P.y,Q.y)); -} - -const EC2N::Point& EC2N::Identity() const -{ - return Singleton().Ref(); -} - -const EC2N::Point& EC2N::Inverse(const Point &P) const -{ - if (P.identity) - return P; - else - { - m_R.identity = false; - m_R.y = m_field->Add(P.x, P.y); - m_R.x = P.x; - return m_R; - } -} - -const EC2N::Point& EC2N::Add(const Point &P, const Point &Q) const -{ - if (P.identity) return Q; - if (Q.identity) return P; - if (Equal(P, Q)) return Double(P); - if (m_field->Equal(P.x, Q.x) && m_field->Equal(P.y, m_field->Add(Q.x, Q.y))) return Identity(); - - FieldElement t = m_field->Add(P.y, Q.y); - t = m_field->Divide(t, m_field->Add(P.x, Q.x)); - FieldElement x = m_field->Square(t); - m_field->Accumulate(x, t); - m_field->Accumulate(x, Q.x); - m_field->Accumulate(x, m_a); - m_R.y = m_field->Add(P.y, m_field->Multiply(t, x)); - m_field->Accumulate(x, P.x); - m_field->Accumulate(m_R.y, x); - - m_R.x.swap(x); - m_R.identity = false; - return m_R; -} - -const EC2N::Point& EC2N::Double(const Point &P) const -{ - if (P.identity) return P; - if (!m_field->IsUnit(P.x)) return Identity(); - - FieldElement t = m_field->Divide(P.y, P.x); - m_field->Accumulate(t, P.x); - m_R.y = m_field->Square(P.x); - m_R.x = m_field->Square(t); - m_field->Accumulate(m_R.x, t); - m_field->Accumulate(m_R.x, m_a); - m_field->Accumulate(m_R.y, m_field->Multiply(t, m_R.x)); - m_field->Accumulate(m_R.y, m_R.x); - - m_R.identity = false; - return m_R; -} - -// ******************************************************** - -/* -EcPrecomputation& EcPrecomputation::operator=(const EcPrecomputation &rhs) -{ - m_ec = rhs.m_ec; - m_ep = rhs.m_ep; - m_ep.m_group = m_ec.get(); - return *this; -} - -void EcPrecomputation::SetCurveAndBase(const EC2N &ec, const EC2N::Point &base) -{ - m_ec.reset(new EC2N(ec)); - m_ep.SetGroupAndBase(*m_ec, base); -} - -void EcPrecomputation::Precompute(unsigned int maxExpBits, unsigned int storage) -{ - m_ep.Precompute(maxExpBits, storage); -} - -void EcPrecomputation::Load(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - word32 version; - BERDecodeUnsigned(seq, version, INTEGER, 1, 1); - m_ep.m_exponentBase.BERDecode(seq); - m_ep.m_windowSize = m_ep.m_exponentBase.BitCount() - 1; - m_ep.m_bases.clear(); - while (!seq.EndReached()) - m_ep.m_bases.push_back(m_ec->BERDecodePoint(seq)); - seq.MessageEnd(); -} - -void EcPrecomputation::Save(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - DEREncodeUnsigned(seq, 1); // version - m_ep.m_exponentBase.DEREncode(seq); - for (unsigned i=0; iDEREncodePoint(seq, m_ep.m_bases[i]); - seq.MessageEnd(); -} - -EC2N::Point EcPrecomputation::Exponentiate(const Integer &exponent) const -{ - return m_ep.Exponentiate(exponent); -} - -EC2N::Point EcPrecomputation::CascadeExponentiate(const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const -{ - return m_ep.CascadeExponentiate(exponent, static_cast &>(pc2).m_ep, exponent2); -} -*/ - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ec2n.h b/external/crypto++-5.6.3/ec2n.h deleted file mode 100644 index a49f4dbb3..000000000 --- a/external/crypto++-5.6.3/ec2n.h +++ /dev/null @@ -1,134 +0,0 @@ -// ec2n.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile ec2n.h -//! \brief Classes for Elliptic Curves over binary fields - - -#ifndef CRYPTOPP_EC2N_H -#define CRYPTOPP_EC2N_H - -#include "cryptlib.h" -#include "gf2n.h" -#include "integer.h" -#include "eprecomp.h" -#include "smartptr.h" -#include "pubkey.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Elliptic Curve Point -struct CRYPTOPP_DLL EC2NPoint -{ - EC2NPoint() : identity(true) {} - EC2NPoint(const PolynomialMod2 &x, const PolynomialMod2 &y) - : identity(false), x(x), y(y) {} - - bool operator==(const EC2NPoint &t) const - {return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);} - bool operator< (const EC2NPoint &t) const - {return identity ? !t.identity : (!t.identity && (x; - -//! Elliptic Curve over GF(2^n) -class CRYPTOPP_DLL EC2N : public AbstractGroup -{ -public: - typedef GF2NP Field; - typedef Field::Element FieldElement; - typedef EC2NPoint Point; - - EC2N() {} - EC2N(const Field &field, const Field::Element &a, const Field::Element &b) - : m_field(field), m_a(a), m_b(b) {} - // construct from BER encoded parameters - // this constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters - EC2N(BufferedTransformation &bt); - - // encode the fields fieldID and curve of the sequence ECParameters - void DEREncode(BufferedTransformation &bt) const; - - bool Equal(const Point &P, const Point &Q) const; - const Point& Identity() const; - const Point& Inverse(const Point &P) const; - bool InversionIsFast() const {return true;} - const Point& Add(const Point &P, const Point &Q) const; - const Point& Double(const Point &P) const; - - Point Multiply(const Integer &k, const Point &P) const - {return ScalarMultiply(P, k);} - Point CascadeMultiply(const Integer &k1, const Point &P, const Integer &k2, const Point &Q) const - {return CascadeScalarMultiply(P, k1, Q, k2);} - - bool ValidateParameters(RandomNumberGenerator &rng, unsigned int level=3) const; - bool VerifyPoint(const Point &P) const; - - unsigned int EncodedPointSize(bool compressed = false) const - {return 1 + (compressed?1:2)*m_field->MaxElementByteLength();} - // returns false if point is compressed and not valid (doesn't check if uncompressed) - bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const; - bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const; - void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const; - void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; - - Point BERDecodePoint(BufferedTransformation &bt) const; - void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; - - Integer FieldSize() const {return Integer::Power2(m_field->MaxElementBitLength());} - const Field & GetField() const {return *m_field;} - const FieldElement & GetA() const {return m_a;} - const FieldElement & GetB() const {return m_b;} - - bool operator==(const EC2N &rhs) const - {return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~EC2N() {} -#endif - -private: - clonable_ptr m_field; - FieldElement m_a, m_b; - mutable Point m_R; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation; - -template class EcPrecomputation; - -//! EC2N precomputation -template<> class EcPrecomputation : public DL_GroupPrecomputation -{ -public: - typedef EC2N EllipticCurve; - - // DL_GroupPrecomputation - const AbstractGroup & GetGroup() const {return m_ec;} - Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec.BERDecodePoint(bt);} - void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {m_ec.DEREncodePoint(bt, v, false);} - - // non-inherited - void SetCurve(const EC2N &ec) {m_ec = ec;} - const EC2N & GetCurve() const {return m_ec;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~EcPrecomputation() {} -#endif - -private: - EC2N m_ec; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/eccrypto.cpp b/external/crypto++-5.6.3/eccrypto.cpp deleted file mode 100644 index eab711d27..000000000 --- a/external/crypto++-5.6.3/eccrypto.cpp +++ /dev/null @@ -1,719 +0,0 @@ -// eccrypto.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4127 4189) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-function" -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "eccrypto.h" -#include "integer.h" -#include "nbtheory.h" -#include "filters.h" -#include "argnames.h" -#include "smartptr.h" -#include "oids.h" -#include "asn.h" -#include "hex.h" -#include "ec2n.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if 0 -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -static void ECDSA_TestInstantiations() -{ - ECDSA::Signer t1; - ECDSA::Verifier t2(t1); - ECNR::Signer t3; - ECNR::Verifier t4(t3); - ECIES::Encryptor t5; - ECIES::Decryptor t6; - ECDH::Domain t7; - ECMQV::Domain t8; -} -#endif -#endif - -// VC60 workaround: complains when these functions are put into an anonymous namespace -static Integer ConvertToInteger(const PolynomialMod2 &x) -{ - unsigned int l = x.ByteCount(); - SecByteBlock temp(l); - x.Encode(temp, l); - return Integer(temp, l); -} - -static inline Integer ConvertToInteger(const Integer &x) -{ - return x; -} - -static bool CheckMOVCondition(const Integer &q, const Integer &r) -{ - // see "Updated standards for validating elliptic curves", http://eprint.iacr.org/2007/343 - Integer t = 1; - unsigned int n = q.IsEven() ? 1 : q.BitCount(), m = r.BitCount(); - - for (unsigned int i=n; DiscreteLogWorkFactor(i) struct EcRecommendedParameters; - -template<> struct EcRecommendedParameters -{ - EcRecommendedParameters(const OID &oid, unsigned int t2, unsigned int t3, unsigned int t4, const char *a, const char *b, const char *g, const char *n, unsigned int h) - : oid(oid), t0(0), t1(0), t2(t2), t3(t3), t4(t4), a(a), b(b), g(g), n(n), h(h) {} - EcRecommendedParameters(const OID &oid, unsigned int t0, unsigned int t1, unsigned int t2, unsigned int t3, unsigned int t4, const char *a, const char *b, const char *g, const char *n, unsigned int h) - : oid(oid), t0(t0), t1(t1), t2(t2), t3(t3), t4(t4), a(a), b(b), g(g), n(n), h(h) {} - EC2N *NewEC() const - { - StringSource ssA(a, true, new HexDecoder); - StringSource ssB(b, true, new HexDecoder); - if (t0 == 0) - return new EC2N(GF2NT(t2, t3, t4), EC2N::FieldElement(ssA, (size_t)ssA.MaxRetrievable()), EC2N::FieldElement(ssB, (size_t)ssB.MaxRetrievable())); - else - return new EC2N(GF2NPP(t0, t1, t2, t3, t4), EC2N::FieldElement(ssA, (size_t)ssA.MaxRetrievable()), EC2N::FieldElement(ssB, (size_t)ssB.MaxRetrievable())); - }; - - OID oid; - unsigned int t0, t1, t2, t3, t4; - const char *a, *b, *g, *n; - unsigned int h; -}; - -template<> struct EcRecommendedParameters -{ - EcRecommendedParameters(const OID &oid, const char *p, const char *a, const char *b, const char *g, const char *n, unsigned int h) - : oid(oid), p(p), a(a), b(b), g(g), n(n), h(h) {} - ECP *NewEC() const - { - StringSource ssP(p, true, new HexDecoder); - StringSource ssA(a, true, new HexDecoder); - StringSource ssB(b, true, new HexDecoder); - return new ECP(Integer(ssP, (size_t)ssP.MaxRetrievable()), ECP::FieldElement(ssA, (size_t)ssA.MaxRetrievable()), ECP::FieldElement(ssB, (size_t)ssB.MaxRetrievable())); - }; - - OID oid; - const char *p; - const char *a, *b, *g, *n; - unsigned int h; -}; - -struct OIDLessThan -{ - template - inline bool operator()(const EcRecommendedParameters& a, const OID& b) {return a.oid < b;} - template - inline bool operator()(const OID& a, const EcRecommendedParameters& b) {return a < b.oid;} - template - inline bool operator()(const EcRecommendedParameters& a, const EcRecommendedParameters& b) {return a.oid < b.oid;} -}; - -static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) -{ - // this array must be sorted by OID - static const EcRecommendedParameters rec[] = { - EcRecommendedParameters(ASN1::sect163k1(), - 163, 7, 6, 3, 0, - "000000000000000000000000000000000000000001", - "000000000000000000000000000000000000000001", - "0402FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE80289070FB05D38FF58321F2E800536D538CCDAA3D9", - "04000000000000000000020108A2E0CC0D99F8A5EF", - 2), - EcRecommendedParameters(ASN1::sect163r1(), - 163, 7, 6, 3, 0, - "07B6882CAAEFA84F9554FF8428BD88E246D2782AE2", - "0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9", - "040369979697AB43897789566789567F787A7876A65400435EDB42EFAFB2989D51FEFCE3C80988F41FF883", - "03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B", - 2), - EcRecommendedParameters(ASN1::sect239k1(), - 239, 158, 0, - "000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000001", - "0429A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA", - "2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5", - 4), - EcRecommendedParameters(ASN1::sect113r1(), - 113, 9, 0, - "003088250CA6E7C7FE649CE85820F7", - "00E8BEE4D3E2260744188BE0E9C723", - "04009D73616F35F4AB1407D73562C10F00A52830277958EE84D1315ED31886", - "0100000000000000D9CCEC8A39E56F", - 2), - EcRecommendedParameters(ASN1::sect113r2(), - 113, 9, 0, - "00689918DBEC7E5A0DD6DFC0AA55C7", - "0095E9A9EC9B297BD4BF36E059184F", - "0401A57A6A7B26CA5EF52FCDB816479700B3ADC94ED1FE674C06E695BABA1D", - "010000000000000108789B2496AF93", - 2), - EcRecommendedParameters(ASN1::sect163r2(), - 163, 7, 6, 3, 0, - "000000000000000000000000000000000000000001", - "020A601907B8C953CA1481EB10512F78744A3205FD", - "0403F0EBA16286A2D57EA0991168D4994637E8343E3600D51FBC6C71A0094FA2CDD545B11C5C0C797324F1", - "040000000000000000000292FE77E70C12A4234C33", - 2), - EcRecommendedParameters(ASN1::sect283k1(), - 283, 12, 7, 5, 0, - "000000000000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000000000000001", - "040503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC245849283601CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259", - "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", - 4), - EcRecommendedParameters(ASN1::sect283r1(), - 283, 12, 7, 5, 0, - "000000000000000000000000000000000000000000000000000000000000000000000001", - "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5", - "0405F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B1205303676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4", - "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", - 2), - EcRecommendedParameters(ASN1::sect131r1(), - 131, 8, 3, 2, 0, - "07A11B09A76B562144418FF3FF8C2570B8", - "0217C05610884B63B9C6C7291678F9D341", - "040081BAF91FDF9833C40F9C181343638399078C6E7EA38C001F73C8134B1B4EF9E150", - "0400000000000000023123953A9464B54D", - 2), - EcRecommendedParameters(ASN1::sect131r2(), - 131, 8, 3, 2, 0, - "03E5A88919D7CAFCBF415F07C2176573B2", - "04B8266A46C55657AC734CE38F018F2192", - "040356DCD8F2F95031AD652D23951BB366A80648F06D867940A5366D9E265DE9EB240F", - "0400000000000000016954A233049BA98F", - 2), - EcRecommendedParameters(ASN1::sect193r1(), - 193, 15, 0, - "0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01", - "00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814", - "0401F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E10025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05", - "01000000000000000000000000C7F34A778F443ACC920EBA49", - 2), - EcRecommendedParameters(ASN1::sect193r2(), - 193, 15, 0, - "0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B", - "00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE", - "0400D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C", - "010000000000000000000000015AAB561B005413CCD4EE99D5", - 2), - EcRecommendedParameters(ASN1::sect233k1(), - 233, 74, 0, - "000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000001", - "04017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD612601DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3", - "8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", - 4), - EcRecommendedParameters(ASN1::sect233r1(), - 233, 74, 0, - "000000000000000000000000000000000000000000000000000000000001", - "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD", - "0400FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052", - "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", - 2), - EcRecommendedParameters(ASN1::sect409k1(), - 409, 87, 0, - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "040060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE902374601E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B", - "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", - 4), - EcRecommendedParameters(ASN1::sect409r1(), - 409, 87, 0, - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F", - "04015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A70061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706", - "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", - 2), - EcRecommendedParameters(ASN1::sect571k1(), - 571, 10, 5, 2, 0, - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "04026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C89720349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3", - "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", - 4), - EcRecommendedParameters(ASN1::sect571r1(), - 571, 10, 5, 2, 0, - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A", - "040303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B", - "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", - 2), - }; - begin = rec; - end = rec + sizeof(rec)/sizeof(rec[0]); -} - -static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) -{ - // this array must be sorted by OID - static const EcRecommendedParameters rec[] = { - EcRecommendedParameters(ASN1::secp192r1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", - "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1", - "04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811", - "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", - 1), - EcRecommendedParameters(ASN1::secp256r1(), - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", - "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B", - "046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", - "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", - 1), - EcRecommendedParameters(ASN1::brainpoolP160r1(), - "E95E4A5F737059DC60DFC7AD95B3D8139515620F", - "340E7BE2A280EB74E2BE61BADA745D97E8F7C300", - "1E589A8595423412134FAA2DBDEC95C8D8675E58", - "04BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC31667CB477A1A8EC338F94741669C976316DA6321", - "E95E4A5F737059DC60DF5991D45029409E60FC09", - 1), - EcRecommendedParameters(ASN1::brainpoolP192r1(), - "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297", - "6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF", - "469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9", - "04C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD614B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F", - "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1", - 1), - EcRecommendedParameters(ASN1::brainpoolP224r1(), - "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF", - "68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43", - "2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B", - "040D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD", - "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F", - 1), - EcRecommendedParameters(ASN1::brainpoolP256r1(), - "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", - "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", - "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", - "048BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", - "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", - 1), - EcRecommendedParameters(ASN1::brainpoolP320r1(), - "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27", - "3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4", - "520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6", - "0443BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E2061114FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1", - "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311", - 1), - EcRecommendedParameters(ASN1::brainpoolP384r1(), - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", - "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", - "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", - "041D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", - "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", - 1), - EcRecommendedParameters(ASN1::brainpoolP512r1(), - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", - "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", - "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", - "0481AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F8227DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", - "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", - 1), - EcRecommendedParameters(ASN1::secp112r1(), - "DB7C2ABF62E35E668076BEAD208B", - "DB7C2ABF62E35E668076BEAD2088", - "659EF8BA043916EEDE8911702B22", - "0409487239995A5EE76B55F9C2F098A89CE5AF8724C0A23E0E0FF77500", - "DB7C2ABF62E35E7628DFAC6561C5", - 1), - EcRecommendedParameters(ASN1::secp112r2(), - "DB7C2ABF62E35E668076BEAD208B", - "6127C24C05F38A0AAAF65C0EF02C", - "51DEF1815DB5ED74FCC34C85D709", - "044BA30AB5E892B4E1649DD0928643ADCD46F5882E3747DEF36E956E97", - "36DF0AAFD8B8D7597CA10520D04B", - 4), - EcRecommendedParameters(ASN1::secp160r1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC", - "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45", - "044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32", - "0100000000000000000001F4C8F927AED3CA752257", - 1), - EcRecommendedParameters(ASN1::secp160k1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", - "0000000000000000000000000000000000000000", - "0000000000000000000000000000000000000007", - "043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE", - "0100000000000000000001B8FA16DFAB9ACA16B6B3", - 1), - EcRecommendedParameters(ASN1::secp256k1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000007", - "0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", - 1), - EcRecommendedParameters(ASN1::secp128r1(), - "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", - "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC", - "E87579C11079F43DD824993C2CEE5ED3", - "04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83", - "FFFFFFFE0000000075A30D1B9038A115", - 1), - EcRecommendedParameters(ASN1::secp128r2(), - "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", - "D6031998D1B3BBFEBF59CC9BBFF9AEE1", - "5EEEFCA380D02919DC2C6558BB6D8A5D", - "047B6AA5D85E572983E6FB32A7CDEBC14027B6916A894D3AEE7106FE805FC34B44", - "3FFFFFFF7FFFFFFFBE0024720613B5A3", - 4), - EcRecommendedParameters(ASN1::secp160r2(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70", - "B4E134D3FB59EB8BAB57274904664D5AF50388BA", - "0452DCB034293A117E1F4FF11B30F7199D3144CE6DFEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E", - "0100000000000000000000351EE786A818F3A1A16B", - 1), - EcRecommendedParameters(ASN1::secp192k1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", - "000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000003", - "04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", - "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", - 1), - EcRecommendedParameters(ASN1::secp224k1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", - "00000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000005", - "04A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", - "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", - 1), - EcRecommendedParameters(ASN1::secp224r1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", - "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", - "04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", - 1), - EcRecommendedParameters(ASN1::secp384r1(), - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", - "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF", - "04AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F", - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", - 1), - EcRecommendedParameters(ASN1::secp521r1(), - "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", - "0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00", - "0400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650", - "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", - 1), - }; - begin = rec; - end = rec + sizeof(rec)/sizeof(rec[0]); -} - -template OID DL_GroupParameters_EC::GetNextRecommendedParametersOID(const OID &oid) -{ - const EcRecommendedParameters *begin, *end; - GetRecommendedParameters(begin, end); - const EcRecommendedParameters *it = std::upper_bound(begin, end, oid, OIDLessThan()); - return (it == end ? OID() : it->oid); -} - -template void DL_GroupParameters_EC::Initialize(const OID &oid) -{ - const EcRecommendedParameters *begin, *end; - GetRecommendedParameters(begin, end); - const EcRecommendedParameters *it = std::lower_bound(begin, end, oid, OIDLessThan()); - if (it == end || it->oid != oid) - throw UnknownOID(); - - const EcRecommendedParameters ¶m = *it; - m_oid = oid; - member_ptr ec(param.NewEC()); - this->m_groupPrecomputation.SetCurve(*ec); - - StringSource ssG(param.g, true, new HexDecoder); - Element G; - bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable()); - this->SetSubgroupGenerator(G); - - // TODO: this fails in practice. Should it throw? - CRYPTOPP_UNUSED(result); assert(result); - - StringSource ssN(param.n, true, new HexDecoder); - m_n.Decode(ssN, (size_t)ssN.MaxRetrievable()); - m_k = param.h; -} - -template -bool DL_GroupParameters_EC::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - if (strcmp(name, Name::GroupOID()) == 0) - { - if (m_oid.m_values.empty()) - return false; - - this->ThrowIfTypeMismatch(name, typeid(OID), valueType); - *reinterpret_cast(pValue) = m_oid; - return true; - } - else - return GetValueHelper >(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Curve); -} - -template -void DL_GroupParameters_EC::AssignFrom(const NameValuePairs &source) -{ - OID oid; - if (source.GetValue(Name::GroupOID(), oid)) - Initialize(oid); - else - { - EllipticCurve ec; - Point G; - Integer n; - - source.GetRequiredParameter("DL_GroupParameters_EC", Name::Curve(), ec); - source.GetRequiredParameter("DL_GroupParameters_EC", Name::SubgroupGenerator(), G); - source.GetRequiredParameter("DL_GroupParameters_EC", Name::SubgroupOrder(), n); - Integer k = source.GetValueWithDefault(Name::Cofactor(), Integer::Zero()); - - Initialize(ec, G, n, k); - } -} - -template -void DL_GroupParameters_EC::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - try - { - CRYPTOPP_UNUSED(rng); - AssignFrom(alg); - } - catch (InvalidArgument &) - { - throw NotImplemented("DL_GroupParameters_EC: curve generation is not implemented yet"); - } -} - -template -void DL_GroupParameters_EC::BERDecode(BufferedTransformation &bt) -{ - byte b; - if (!bt.Peek(b)) - BERDecodeError(); - if (b == OBJECT_IDENTIFIER) - Initialize(OID(bt)); - else - { - BERSequenceDecoder seq(bt); - word32 version; - BERDecodeUnsigned(seq, version, INTEGER, 1, 1); // check version - EllipticCurve ec(seq); - Point G = ec.BERDecodePoint(seq); - Integer n(seq); - Integer k; - bool cofactorPresent = !seq.EndReached(); - if (cofactorPresent) - k.BERDecode(seq); - else - k = Integer::Zero(); - seq.MessageEnd(); - - Initialize(ec, G, n, k); - } -} - -template -void DL_GroupParameters_EC::DEREncode(BufferedTransformation &bt) const -{ - if (m_encodeAsOID && !m_oid.m_values.empty()) - m_oid.DEREncode(bt); - else - { - DERSequenceEncoder seq(bt); - DEREncodeUnsigned(seq, 1); // version - GetCurve().DEREncode(seq); - GetCurve().DEREncodePoint(seq, this->GetSubgroupGenerator(), m_compress); - m_n.DEREncode(seq); - if (m_k.NotZero()) - m_k.DEREncode(seq); - seq.MessageEnd(); - } -} - -template -Integer DL_GroupParameters_EC::GetCofactor() const -{ - if (!m_k) - { - Integer q = GetCurve().FieldSize(); - Integer qSqrt = q.SquareRoot(); - m_k = (q+2*qSqrt+1)/m_n; - } - - return m_k; -} - -template -Integer DL_GroupParameters_EC::ConvertElementToInteger(const Element &element) const -{ - return ConvertToInteger(element.x); -}; - -template -bool DL_GroupParameters_EC::ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = GetCurve().ValidateParameters(rng, level); - - Integer q = GetCurve().FieldSize(); - pass = pass && m_n!=q; - - if (level >= 2) - { - Integer qSqrt = q.SquareRoot(); - pass = pass && m_n>4*qSqrt; - pass = pass && VerifyPrime(rng, m_n, level-2); - pass = pass && (m_k.IsZero() || m_k == (q+2*qSqrt+1)/m_n); - pass = pass && CheckMOVCondition(q, m_n); - } - - return pass; -} - -template -bool DL_GroupParameters_EC::ValidateElement(unsigned int level, const Element &g, const DL_FixedBasePrecomputation *gpc) const -{ - bool pass = !IsIdentity(g) && GetCurve().VerifyPoint(g); - if (level >= 1) - { - if (gpc) - pass = pass && gpc->Exponentiate(this->GetGroupPrecomputation(), Integer::One()) == g; - } - if (level >= 2 && pass) - { - const Integer &q = GetSubgroupOrder(); - Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : this->ExponentiateElement(g, q); - pass = pass && IsIdentity(gq); - } - return pass; -} - -template -void DL_GroupParameters_EC::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const -{ - GetCurve().SimultaneousMultiply(results, base, exponents, exponentsCount); -} - -template -CPP_TYPENAME DL_GroupParameters_EC::Element DL_GroupParameters_EC::MultiplyElements(const Element &a, const Element &b) const -{ - return GetCurve().Add(a, b); -} - -template -CPP_TYPENAME DL_GroupParameters_EC::Element DL_GroupParameters_EC::CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const -{ - return GetCurve().CascadeMultiply(exponent1, element1, exponent2, element2); -} - -template -OID DL_GroupParameters_EC::GetAlgorithmID() const -{ - return ASN1::id_ecPublicKey(); -} - -// ****************************************************************** - -template -void DL_PublicKey_EC::BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size) -{ - CRYPTOPP_UNUSED(parametersPresent); - - typename EC::Point P; - if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size)) - BERDecodeError(); - this->SetPublicElement(P); -} - -template -void DL_PublicKey_EC::DEREncodePublicKey(BufferedTransformation &bt) const -{ - this->GetGroupParameters().GetCurve().EncodePoint(bt, this->GetPublicElement(), this->GetGroupParameters().GetPointCompression()); -} - -// ****************************************************************** - -template -void DL_PrivateKey_EC::BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size) -{ - CRYPTOPP_UNUSED(size); - BERSequenceDecoder seq(bt); - word32 version; - BERDecodeUnsigned(seq, version, INTEGER, 1, 1); // check version - - BERGeneralDecoder dec(seq, OCTET_STRING); - if (!dec.IsDefiniteLength()) - BERDecodeError(); - Integer x; - x.Decode(dec, (size_t)dec.RemainingLength()); - dec.MessageEnd(); - if (!parametersPresent && seq.PeekByte() != (CONTEXT_SPECIFIC | CONSTRUCTED | 0)) - BERDecodeError(); - if (!seq.EndReached() && seq.PeekByte() == (CONTEXT_SPECIFIC | CONSTRUCTED | 0)) - { - BERGeneralDecoder parameters(seq, CONTEXT_SPECIFIC | CONSTRUCTED | 0); - this->AccessGroupParameters().BERDecode(parameters); - parameters.MessageEnd(); - } - if (!seq.EndReached()) - { - // skip over the public element - SecByteBlock subjectPublicKey; - unsigned int unusedBits; - BERGeneralDecoder publicKey(seq, CONTEXT_SPECIFIC | CONSTRUCTED | 1); - BERDecodeBitString(publicKey, subjectPublicKey, unusedBits); - publicKey.MessageEnd(); - Element Q; - if (!(unusedBits == 0 && this->GetGroupParameters().GetCurve().DecodePoint(Q, subjectPublicKey, subjectPublicKey.size()))) - BERDecodeError(); - } - seq.MessageEnd(); - - this->SetPrivateExponent(x); -} - -template -void DL_PrivateKey_EC::DEREncodePrivateKey(BufferedTransformation &bt) const -{ - DERSequenceEncoder privateKey(bt); - DEREncodeUnsigned(privateKey, 1); // version - // SEC 1 ver 1.0 says privateKey (m_d) has the same length as order of the curve - // this will be changed to order of base point in a future version - this->GetPrivateExponent().DEREncodeAsOctetString(privateKey, this->GetGroupParameters().GetSubgroupOrder().ByteCount()); - privateKey.MessageEnd(); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/eccrypto.h b/external/crypto++-5.6.3/eccrypto.h deleted file mode 100644 index 981f1cd9c..000000000 --- a/external/crypto++-5.6.3/eccrypto.h +++ /dev/null @@ -1,671 +0,0 @@ -// eccrypto.h - written and placed in the public domain by Wei Dai - -//! \file eccrypto.h -//! \brief Classes and functions for Elliptic Curves over prime and binary fields - -#ifndef CRYPTOPP_ECCRYPTO_H -#define CRYPTOPP_ECCRYPTO_H - -#include "config.h" -#include "cryptlib.h" -#include "pubkey.h" -#include "integer.h" -#include "asn.h" -#include "hmac.h" -#include "sha.h" -#include "gfpcrypt.h" -#include "dh.h" -#include "mqv.h" -#include "ecp.h" -#include "ec2n.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Elliptic Curve Parameters -/*! This class corresponds to the ASN.1 sequence of the same name - in ANSI X9.62 (also SEC 1). -*/ -template -class DL_GroupParameters_EC : public DL_GroupParametersImpl > -{ - typedef DL_GroupParameters_EC ThisClass; - -public: - typedef EC EllipticCurve; - typedef typename EllipticCurve::Point Point; - typedef Point Element; - typedef IncompatibleCofactorMultiplication DefaultCofactorOption; - - DL_GroupParameters_EC() : m_compress(false), m_encodeAsOID(false) {} - DL_GroupParameters_EC(const OID &oid) - : m_compress(false), m_encodeAsOID(false) {Initialize(oid);} - DL_GroupParameters_EC(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) - : m_compress(false), m_encodeAsOID(false) {Initialize(ec, G, n, k);} - DL_GroupParameters_EC(BufferedTransformation &bt) - : m_compress(false), m_encodeAsOID(false) {BERDecode(bt);} - - void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) - { - this->m_groupPrecomputation.SetCurve(ec); - this->SetSubgroupGenerator(G); - m_n = n; - m_k = k; - } - void Initialize(const OID &oid); - - // NameValuePairs - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // GeneratibleCryptoMaterial interface - //! this implementation doesn't actually generate a curve, it just initializes the parameters with existing values - /*! parameters: (Curve, SubgroupGenerator, SubgroupOrder, Cofactor (optional)), or (GroupOID) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - // DL_GroupParameters - const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return this->m_gpc;} - DL_FixedBasePrecomputation & AccessBasePrecomputation() {return this->m_gpc;} - const Integer & GetSubgroupOrder() const {return m_n;} - Integer GetCofactor() const; - bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; - bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation *precomp) const; - bool FastSubgroupCheckAvailable() const {return false;} - void EncodeElement(bool reversible, const Element &element, byte *encoded) const - { - if (reversible) - GetCurve().EncodePoint(encoded, element, m_compress); - else - element.x.Encode(encoded, GetEncodedElementSize(false)); - } - virtual unsigned int GetEncodedElementSize(bool reversible) const - { - if (reversible) - return GetCurve().EncodedPointSize(m_compress); - else - return GetCurve().GetField().MaxElementByteLength(); - } - Element DecodeElement(const byte *encoded, bool checkForGroupMembership) const - { - Point result; - if (!GetCurve().DecodePoint(result, encoded, GetEncodedElementSize(true))) - throw DL_BadElement(); - if (checkForGroupMembership && !ValidateElement(1, result, NULL)) - throw DL_BadElement(); - return result; - } - Integer ConvertElementToInteger(const Element &element) const; - Integer GetMaxExponent() const {return GetSubgroupOrder()-1;} - bool IsIdentity(const Element &element) const {return element.identity;} - void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; - static std::string CRYPTOPP_API StaticAlgorithmNamePrefix() {return "EC";} - - // ASN1Key - OID GetAlgorithmID() const; - - // used by MQV - Element MultiplyElements(const Element &a, const Element &b) const; - Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const; - - // non-inherited - - // enumerate OIDs for recommended parameters, use OID() to get first one - static OID CRYPTOPP_API GetNextRecommendedParametersOID(const OID &oid); - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - void SetPointCompression(bool compress) {m_compress = compress;} - bool GetPointCompression() const {return m_compress;} - - void SetEncodeAsOID(bool encodeAsOID) {m_encodeAsOID = encodeAsOID;} - bool GetEncodeAsOID() const {return m_encodeAsOID;} - - const EllipticCurve& GetCurve() const {return this->m_groupPrecomputation.GetCurve();} - - bool operator==(const ThisClass &rhs) const - {return this->m_groupPrecomputation.GetCurve() == rhs.m_groupPrecomputation.GetCurve() && this->m_gpc.GetBase(this->m_groupPrecomputation) == rhs.m_gpc.GetBase(rhs.m_groupPrecomputation);} - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - const Point& GetBasePoint() const {return this->GetSubgroupGenerator();} - const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();} - void LoadRecommendedParameters(const OID &oid) {Initialize(oid);} -#endif - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_EC() {} -#endif - -protected: - unsigned int FieldElementLength() const {return GetCurve().GetField().MaxElementByteLength();} - unsigned int ExponentLength() const {return m_n.ByteCount();} - - OID m_oid; // set if parameters loaded from a recommended curve - Integer m_n; // order of base point - mutable Integer m_k; // cofactor - mutable bool m_compress, m_encodeAsOID; // presentation details -}; - -//! EC public key -template -class DL_PublicKey_EC : public DL_PublicKeyImpl > -{ -public: - typedef typename EC::Point Element; - - void Initialize(const DL_GroupParameters_EC ¶ms, const Element &Q) - {this->AccessGroupParameters() = params; this->SetPublicElement(Q);} - void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q) - {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);} - - // X509PublicKey - void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size); - void DEREncodePublicKey(BufferedTransformation &bt) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PublicKey_EC() {} -#endif -}; - -//! EC private key -template -class DL_PrivateKey_EC : public DL_PrivateKeyImpl > -{ -public: - typedef typename EC::Point Element; - - void Initialize(const DL_GroupParameters_EC ¶ms, const Integer &x) - {this->AccessGroupParameters() = params; this->SetPrivateExponent(x);} - void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x) - {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);} - void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC ¶ms) - {this->GenerateRandom(rng, params);} - void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n) - {this->GenerateRandom(rng, DL_GroupParameters_EC(ec, G, n));} - - // PKCS8PrivateKey - void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size); - void DEREncodePrivateKey(BufferedTransformation &bt) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PrivateKey_EC() {} -#endif -}; - -//! Elliptic Curve Diffie-Hellman, AKA ECDH -template ::DefaultCofactorOption> -struct ECDH -{ - typedef DH_Domain, COFACTOR_OPTION> Domain; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECDH() {} -#endif -}; - -/// Elliptic Curve Menezes-Qu-Vanstone, AKA ECMQV -template ::DefaultCofactorOption> -struct ECMQV -{ - typedef MQV_Domain, COFACTOR_OPTION> Domain; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECMQV() {} -#endif -}; - -//! EC keys -template -struct DL_Keys_EC -{ - typedef DL_PublicKey_EC PublicKey; - typedef DL_PrivateKey_EC PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Keys_EC() {} -#endif -}; - -template -struct ECDSA; - -//! ECDSA keys -template -struct DL_Keys_ECDSA -{ - typedef DL_PublicKey_EC PublicKey; - typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA > PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Keys_ECDSA() {} -#endif -}; - -//! ECDSA algorithm -template -class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_ECDSA() {} -#endif -}; - -//! ECNR algorithm -template -class DL_Algorithm_ECNR : public DL_Algorithm_NR -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_ECNR() {} -#endif -}; - -//! ECDSA -template -struct ECDSA : public DL_SS, DL_Algorithm_ECDSA, DL_SignatureMessageEncodingMethod_DSA, H> -{ -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECDSA() {} -#endif -}; - -//! ECNR -template -struct ECNR : public DL_SS, DL_Algorithm_ECNR, DL_SignatureMessageEncodingMethod_NR, H> -{ -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECNR() {} -#endif -}; - -//! Elliptic Curve Integrated Encryption Scheme, AKA ECIES -/*! Default to (NoCofactorMultiplication and DHAES_MODE = false) for compatibilty with SEC1 and Crypto++ 4.2. - The combination of (IncompatibleCofactorMultiplication and DHAES_MODE = true) is recommended for best - efficiency and security. */ -template -struct ECIES - : public DL_ES< - DL_Keys_EC, - DL_KeyAgreementAlgorithm_DH, - DL_KeyDerivationAlgorithm_P1363 >, - DL_EncryptionAlgorithm_Xor, DHAES_MODE>, - ECIES > -{ - static std::string CRYPTOPP_API StaticAlgorithmName() {return "ECIES";} // TODO: fix this after name is standardized - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECIES() {} -#endif - -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 30000) -} __attribute__((deprecated ("ECIES will be changing in the near future due to (1) an implementation bug and (2) an interop issue."))); -#elif (CRYPTOPP_GCC_VERSION ) -} __attribute__((deprecated)); -#else -}; -#endif - -NAMESPACE_END - -#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#include "eccrypto.cpp" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; - -NAMESPACE_END - -#endif -#ifndef CRYPTOPP_ECCRYPTO_H -#define CRYPTOPP_ECCRYPTO_H - -/*! \file -*/ - -#include "cryptlib.h" -#include "pubkey.h" -#include "integer.h" -#include "asn.h" -#include "hmac.h" -#include "sha.h" -#include "gfpcrypt.h" -#include "dh.h" -#include "mqv.h" -#include "ecp.h" -#include "ec2n.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Elliptic Curve Parameters -/*! This class corresponds to the ASN.1 sequence of the same name - in ANSI X9.62 (also SEC 1). -*/ -template -class DL_GroupParameters_EC : public DL_GroupParametersImpl > -{ - typedef DL_GroupParameters_EC ThisClass; - -public: - typedef EC EllipticCurve; - typedef typename EllipticCurve::Point Point; - typedef Point Element; - typedef IncompatibleCofactorMultiplication DefaultCofactorOption; - - DL_GroupParameters_EC() : m_compress(false), m_encodeAsOID(false) {} - DL_GroupParameters_EC(const OID &oid) - : m_compress(false), m_encodeAsOID(false) {Initialize(oid);} - DL_GroupParameters_EC(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) - : m_compress(false), m_encodeAsOID(false) {Initialize(ec, G, n, k);} - DL_GroupParameters_EC(BufferedTransformation &bt) - : m_compress(false), m_encodeAsOID(false) {BERDecode(bt);} - - void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero()) - { - this->m_groupPrecomputation.SetCurve(ec); - this->SetSubgroupGenerator(G); - m_n = n; - m_k = k; - } - void Initialize(const OID &oid); - - // NameValuePairs - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // GeneratibleCryptoMaterial interface - //! this implementation doesn't actually generate a curve, it just initializes the parameters with existing values - /*! parameters: (Curve, SubgroupGenerator, SubgroupOrder, Cofactor (optional)), or (GroupOID) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - // DL_GroupParameters - const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return this->m_gpc;} - DL_FixedBasePrecomputation & AccessBasePrecomputation() {return this->m_gpc;} - const Integer & GetSubgroupOrder() const {return m_n;} - Integer GetCofactor() const; - bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; - bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation *precomp) const; - bool FastSubgroupCheckAvailable() const {return false;} - void EncodeElement(bool reversible, const Element &element, byte *encoded) const - { - if (reversible) - GetCurve().EncodePoint(encoded, element, m_compress); - else - element.x.Encode(encoded, GetEncodedElementSize(false)); - } - virtual unsigned int GetEncodedElementSize(bool reversible) const - { - if (reversible) - return GetCurve().EncodedPointSize(m_compress); - else - return GetCurve().GetField().MaxElementByteLength(); - } - Element DecodeElement(const byte *encoded, bool checkForGroupMembership) const - { - Point result; - if (!GetCurve().DecodePoint(result, encoded, GetEncodedElementSize(true))) - throw DL_BadElement(); - if (checkForGroupMembership && !ValidateElement(1, result, NULL)) - throw DL_BadElement(); - return result; - } - Integer ConvertElementToInteger(const Element &element) const; - Integer GetMaxExponent() const {return GetSubgroupOrder()-1;} - bool IsIdentity(const Element &element) const {return element.identity;} - void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; - static std::string CRYPTOPP_API StaticAlgorithmNamePrefix() {return "EC";} - - // ASN1Key - OID GetAlgorithmID() const; - - // used by MQV - Element MultiplyElements(const Element &a, const Element &b) const; - Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const; - - // non-inherited - - // enumerate OIDs for recommended parameters, use OID() to get first one - static OID CRYPTOPP_API GetNextRecommendedParametersOID(const OID &oid); - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - void SetPointCompression(bool compress) {m_compress = compress;} - bool GetPointCompression() const {return m_compress;} - - void SetEncodeAsOID(bool encodeAsOID) {m_encodeAsOID = encodeAsOID;} - bool GetEncodeAsOID() const {return m_encodeAsOID;} - - const EllipticCurve& GetCurve() const {return this->m_groupPrecomputation.GetCurve();} - - bool operator==(const ThisClass &rhs) const - {return this->m_groupPrecomputation.GetCurve() == rhs.m_groupPrecomputation.GetCurve() && this->m_gpc.GetBase(this->m_groupPrecomputation) == rhs.m_gpc.GetBase(rhs.m_groupPrecomputation);} - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - const Point& GetBasePoint() const {return this->GetSubgroupGenerator();} - const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();} - void LoadRecommendedParameters(const OID &oid) {Initialize(oid);} -#endif - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_EC() {} -#endif - -protected: - unsigned int FieldElementLength() const {return GetCurve().GetField().MaxElementByteLength();} - unsigned int ExponentLength() const {return m_n.ByteCount();} - - OID m_oid; // set if parameters loaded from a recommended curve - Integer m_n; // order of base point - mutable Integer m_k; // cofactor - mutable bool m_compress, m_encodeAsOID; // presentation details -}; - -//! EC public key -template -class DL_PublicKey_EC : public DL_PublicKeyImpl > -{ -public: - typedef typename EC::Point Element; - - void Initialize(const DL_GroupParameters_EC ¶ms, const Element &Q) - {this->AccessGroupParameters() = params; this->SetPublicElement(Q);} - void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q) - {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);} - - // X509PublicKey - void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size); - void DEREncodePublicKey(BufferedTransformation &bt) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PublicKey_EC() {} -#endif -}; - -//! EC private key -template -class DL_PrivateKey_EC : public DL_PrivateKeyImpl > -{ -public: - typedef typename EC::Point Element; - - void Initialize(const DL_GroupParameters_EC ¶ms, const Integer &x) - {this->AccessGroupParameters() = params; this->SetPrivateExponent(x);} - void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x) - {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);} - void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC ¶ms) - {this->GenerateRandom(rng, params);} - void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n) - {this->GenerateRandom(rng, DL_GroupParameters_EC(ec, G, n));} - - // PKCS8PrivateKey - void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size); - void DEREncodePrivateKey(BufferedTransformation &bt) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PrivateKey_EC() {} -#endif -}; - -//! Elliptic Curve Diffie-Hellman, AKA ECDH -template ::DefaultCofactorOption> -struct ECDH -{ - typedef DH_Domain, COFACTOR_OPTION> Domain; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECDH() {} -#endif -}; - -/// Elliptic Curve Menezes-Qu-Vanstone, AKA ECMQV -template ::DefaultCofactorOption> -struct ECMQV -{ - typedef MQV_Domain, COFACTOR_OPTION> Domain; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECMQV() {} -#endif -}; - -//! EC keys -template -struct DL_Keys_EC -{ - typedef DL_PublicKey_EC PublicKey; - typedef DL_PrivateKey_EC PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Keys_EC() {} -#endif -}; - -template -struct ECDSA; - -//! ECDSA keys -template -struct DL_Keys_ECDSA -{ - typedef DL_PublicKey_EC PublicKey; - typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA > PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Keys_ECDSA() {} -#endif -}; - -//! ECDSA algorithm -template -class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_ECDSA() {} -#endif -}; - -//! ECNR algorithm -template -class DL_Algorithm_ECNR : public DL_Algorithm_NR -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_ECNR() {} -#endif -}; - -//! ECDSA -template -struct ECDSA : public DL_SS, DL_Algorithm_ECDSA, DL_SignatureMessageEncodingMethod_DSA, H> -{ -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECDSA() {} -#endif -}; - -//! ECNR -template -struct ECNR : public DL_SS, DL_Algorithm_ECNR, DL_SignatureMessageEncodingMethod_NR, H> -{ -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECNR() {} -#endif -}; - -//! Elliptic Curve Integrated Encryption Scheme, AKA ECIES -/*! Default to (NoCofactorMultiplication and DHAES_MODE = false) for compatibilty with SEC1 and Crypto++ 4.2. - The combination of (IncompatibleCofactorMultiplication and DHAES_MODE = true) is recommended for best - efficiency and security. */ -template -struct ECIES - : public DL_ES< - DL_Keys_EC, - DL_KeyAgreementAlgorithm_DH, - DL_KeyDerivationAlgorithm_P1363 >, - DL_EncryptionAlgorithm_Xor, DHAES_MODE>, - ECIES > -{ - static std::string CRYPTOPP_API StaticAlgorithmName() {return "ECIES";} // TODO: fix this after name is standardized - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECIES() {} -#endif - -#if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20800) -} __attribute__((deprecated ("ECIES will be changing in the near future due to (1) an implementation bug and (2) an interop issue"))); -#elif (CRYPTOPP_GCC_VERSION) -} __attribute__((deprecated)); -#else -}; -#endif - -NAMESPACE_END - -#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#include "eccrypto.cpp" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_EC; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA >; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ecp.cpp b/external/crypto++-5.6.3/ecp.cpp deleted file mode 100644 index 1df43a4ae..000000000 --- a/external/crypto++-5.6.3/ecp.cpp +++ /dev/null @@ -1,476 +0,0 @@ -// ecp.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "ecp.h" -#include "asn.h" -#include "integer.h" -#include "nbtheory.h" -#include "modarith.h" -#include "filters.h" -#include "algebra.cpp" - -NAMESPACE_BEGIN(CryptoPP) - -ANONYMOUS_NAMESPACE_BEGIN -static inline ECP::Point ToMontgomery(const ModularArithmetic &mr, const ECP::Point &P) -{ - return P.identity ? P : ECP::Point(mr.ConvertIn(P.x), mr.ConvertIn(P.y)); -} - -static inline ECP::Point FromMontgomery(const ModularArithmetic &mr, const ECP::Point &P) -{ - return P.identity ? P : ECP::Point(mr.ConvertOut(P.x), mr.ConvertOut(P.y)); -} -NAMESPACE_END - -ECP::ECP(const ECP &ecp, bool convertToMontgomeryRepresentation) -{ - if (convertToMontgomeryRepresentation && !ecp.GetField().IsMontgomeryRepresentation()) - { - m_fieldPtr.reset(new MontgomeryRepresentation(ecp.GetField().GetModulus())); - m_a = GetField().ConvertIn(ecp.m_a); - m_b = GetField().ConvertIn(ecp.m_b); - } - else - operator=(ecp); -} - -ECP::ECP(BufferedTransformation &bt) - : m_fieldPtr(new Field(bt)) -{ - BERSequenceDecoder seq(bt); - GetField().BERDecodeElement(seq, m_a); - GetField().BERDecodeElement(seq, m_b); - // skip optional seed - if (!seq.EndReached()) - { - SecByteBlock seed; - unsigned int unused; - BERDecodeBitString(seq, seed, unused); - } - seq.MessageEnd(); -} - -void ECP::DEREncode(BufferedTransformation &bt) const -{ - GetField().DEREncode(bt); - DERSequenceEncoder seq(bt); - GetField().DEREncodeElement(seq, m_a); - GetField().DEREncodeElement(seq, m_b); - seq.MessageEnd(); -} - -bool ECP::DecodePoint(ECP::Point &P, const byte *encodedPoint, size_t encodedPointLen) const -{ - StringStore store(encodedPoint, encodedPointLen); - return DecodePoint(P, store, encodedPointLen); -} - -bool ECP::DecodePoint(ECP::Point &P, BufferedTransformation &bt, size_t encodedPointLen) const -{ - byte type; - if (encodedPointLen < 1 || !bt.Get(type)) - return false; - - switch (type) - { - case 0: - P.identity = true; - return true; - case 2: - case 3: - { - if (encodedPointLen != EncodedPointSize(true)) - return false; - - Integer p = FieldSize(); - - P.identity = false; - P.x.Decode(bt, GetField().MaxElementByteLength()); - P.y = ((P.x*P.x+m_a)*P.x+m_b) % p; - - if (Jacobi(P.y, p) !=1) - return false; - - P.y = ModularSquareRoot(P.y, p); - - if ((type & 1) != P.y.GetBit(0)) - P.y = p-P.y; - - return true; - } - case 4: - { - if (encodedPointLen != EncodedPointSize(false)) - return false; - - unsigned int len = GetField().MaxElementByteLength(); - P.identity = false; - P.x.Decode(bt, len); - P.y.Decode(bt, len); - return true; - } - default: - return false; - } -} - -void ECP::EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const -{ - if (P.identity) - NullStore().TransferTo(bt, EncodedPointSize(compressed)); - else if (compressed) - { - bt.Put(2 + P.y.GetBit(0)); - P.x.Encode(bt, GetField().MaxElementByteLength()); - } - else - { - unsigned int len = GetField().MaxElementByteLength(); - bt.Put(4); // uncompressed - P.x.Encode(bt, len); - P.y.Encode(bt, len); - } -} - -void ECP::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const -{ - ArraySink sink(encodedPoint, EncodedPointSize(compressed)); - EncodePoint(sink, P, compressed); - assert(sink.TotalPutLength() == EncodedPointSize(compressed)); -} - -ECP::Point ECP::BERDecodePoint(BufferedTransformation &bt) const -{ - SecByteBlock str; - BERDecodeOctetString(bt, str); - Point P; - if (!DecodePoint(P, str, str.size())) - BERDecodeError(); - return P; -} - -void ECP::DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const -{ - SecByteBlock str(EncodedPointSize(compressed)); - EncodePoint(str, P, compressed); - DEREncodeOctetString(bt, str); -} - -bool ECP::ValidateParameters(RandomNumberGenerator &rng, unsigned int level) const -{ - Integer p = FieldSize(); - - bool pass = p.IsOdd(); - pass = pass && !m_a.IsNegative() && m_a

= 1) - pass = pass && ((4*m_a*m_a*m_a+27*m_b*m_b)%p).IsPositive(); - - if (level >= 2) - pass = pass && VerifyPrime(rng, p); - - return pass; -} - -bool ECP::VerifyPoint(const Point &P) const -{ - const FieldElement &x = P.x, &y = P.y; - Integer p = FieldSize(); - return P.identity || - (!x.IsNegative() && x

().Ref(); -} - -const ECP::Point& ECP::Inverse(const Point &P) const -{ - if (P.identity) - return P; - else - { - m_R.identity = false; - m_R.x = P.x; - m_R.y = GetField().Inverse(P.y); - return m_R; - } -} - -const ECP::Point& ECP::Add(const Point &P, const Point &Q) const -{ - if (P.identity) return Q; - if (Q.identity) return P; - if (GetField().Equal(P.x, Q.x)) - return GetField().Equal(P.y, Q.y) ? Double(P) : Identity(); - - FieldElement t = GetField().Subtract(Q.y, P.y); - t = GetField().Divide(t, GetField().Subtract(Q.x, P.x)); - FieldElement x = GetField().Subtract(GetField().Subtract(GetField().Square(t), P.x), Q.x); - m_R.y = GetField().Subtract(GetField().Multiply(t, GetField().Subtract(P.x, x)), P.y); - - m_R.x.swap(x); - m_R.identity = false; - return m_R; -} - -const ECP::Point& ECP::Double(const Point &P) const -{ - if (P.identity || P.y==GetField().Identity()) return Identity(); - - FieldElement t = GetField().Square(P.x); - t = GetField().Add(GetField().Add(GetField().Double(t), t), m_a); - t = GetField().Divide(t, GetField().Double(P.y)); - FieldElement x = GetField().Subtract(GetField().Subtract(GetField().Square(t), P.x), P.x); - m_R.y = GetField().Subtract(GetField().Multiply(t, GetField().Subtract(P.x, x)), P.y); - - m_R.x.swap(x); - m_R.identity = false; - return m_R; -} - -template void ParallelInvert(const AbstractRing &ring, Iterator begin, Iterator end) -{ - size_t n = end-begin; - if (n == 1) - *begin = ring.MultiplicativeInverse(*begin); - else if (n > 1) - { - std::vector vec((n+1)/2); - unsigned int i; - Iterator it; - - for (i=0, it=begin; i::iterator it) : it(it) {} - Integer& operator*() {return it->z;} - int operator-(ZIterator it2) {return int(it-it2.it);} - ZIterator operator+(int i) {return ZIterator(it+i);} - ZIterator& operator+=(int i) {it+=i; return *this;} - std::vector::iterator it; -}; - -ECP::Point ECP::ScalarMultiply(const Point &P, const Integer &k) const -{ - Element result; - if (k.BitCount() <= 5) - AbstractGroup::SimultaneousMultiply(&result, P, &k, 1); - else - ECP::SimultaneousMultiply(&result, P, &k, 1); - return result; -} - -void ECP::SimultaneousMultiply(ECP::Point *results, const ECP::Point &P, const Integer *expBegin, unsigned int expCount) const -{ - if (!GetField().IsMontgomeryRepresentation()) - { - ECP ecpmr(*this, true); - const ModularArithmetic &mr = ecpmr.GetField(); - ecpmr.SimultaneousMultiply(results, ToMontgomery(mr, P), expBegin, expCount); - for (unsigned int i=0; i bases; - std::vector exponents; - exponents.reserve(expCount); - std::vector > baseIndices(expCount); - std::vector > negateBase(expCount); - std::vector > exponentWindows(expCount); - unsigned int i; - - for (i=0; iNotNegative()); - exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 5)); - exponents[i].FindNextWindow(); - } - - unsigned int expBitPosition = 0; - bool notDone = true; - - while (notDone) - { - notDone = false; - bool baseAdded = false; - for (i=0; i > finalCascade; - for (i=0; i::CascadeScalarMultiply(P, k1, Q, k2); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ecp.h b/external/crypto++-5.6.3/ecp.h deleted file mode 100644 index ef15c6b03..000000000 --- a/external/crypto++-5.6.3/ecp.h +++ /dev/null @@ -1,145 +0,0 @@ -// ecp.h - written and placed in the public domain by Wei Dai - -//! \file ecp.h -//! \brief Classes for Elliptic Curves over prime fields - -#ifndef CRYPTOPP_ECP_H -#define CRYPTOPP_ECP_H - -#include "cryptlib.h" -#include "integer.h" -#include "modarith.h" -#include "eprecomp.h" -#include "smartptr.h" -#include "pubkey.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Elliptical Curve Point -struct CRYPTOPP_DLL ECPPoint -{ - ECPPoint() : identity(true) {} - ECPPoint(const Integer &x, const Integer &y) - : identity(false), x(x), y(y) {} - - bool operator==(const ECPPoint &t) const - {return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);} - bool operator< (const ECPPoint &t) const - {return identity ? !t.identity : (!t.identity && (x; - -//! Elliptic Curve over GF(p), where p is prime -class CRYPTOPP_DLL ECP : public AbstractGroup -{ -public: - typedef ModularArithmetic Field; - typedef Integer FieldElement; - typedef ECPPoint Point; - - ECP() {} - ECP(const ECP &ecp, bool convertToMontgomeryRepresentation = false); - ECP(const Integer &modulus, const FieldElement &a, const FieldElement &b) - : m_fieldPtr(new Field(modulus)), m_a(a.IsNegative() ? modulus+a : a), m_b(b) {} - // construct from BER encoded parameters - // this constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters - ECP(BufferedTransformation &bt); - - // encode the fields fieldID and curve of the sequence ECParameters - void DEREncode(BufferedTransformation &bt) const; - - bool Equal(const Point &P, const Point &Q) const; - const Point& Identity() const; - const Point& Inverse(const Point &P) const; - bool InversionIsFast() const {return true;} - const Point& Add(const Point &P, const Point &Q) const; - const Point& Double(const Point &P) const; - Point ScalarMultiply(const Point &P, const Integer &k) const; - Point CascadeScalarMultiply(const Point &P, const Integer &k1, const Point &Q, const Integer &k2) const; - void SimultaneousMultiply(Point *results, const Point &base, const Integer *exponents, unsigned int exponentsCount) const; - - Point Multiply(const Integer &k, const Point &P) const - {return ScalarMultiply(P, k);} - Point CascadeMultiply(const Integer &k1, const Point &P, const Integer &k2, const Point &Q) const - {return CascadeScalarMultiply(P, k1, Q, k2);} - - bool ValidateParameters(RandomNumberGenerator &rng, unsigned int level=3) const; - bool VerifyPoint(const Point &P) const; - - unsigned int EncodedPointSize(bool compressed = false) const - {return 1 + (compressed?1:2)*GetField().MaxElementByteLength();} - // returns false if point is compressed and not valid (doesn't check if uncompressed) - bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const; - bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const; - void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const; - void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; - - Point BERDecodePoint(BufferedTransformation &bt) const; - void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const; - - Integer FieldSize() const {return GetField().GetModulus();} - const Field & GetField() const {return *m_fieldPtr;} - const FieldElement & GetA() const {return m_a;} - const FieldElement & GetB() const {return m_b;} - - bool operator==(const ECP &rhs) const - {return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ECP() {} -#endif - -private: - clonable_ptr m_fieldPtr; - FieldElement m_a, m_b; - mutable Point m_R; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation; - -template class EcPrecomputation; - -//! ECP precomputation -template<> class EcPrecomputation : public DL_GroupPrecomputation -{ -public: - typedef ECP EllipticCurve; - - // DL_GroupPrecomputation - bool NeedConversions() const {return true;} - Element ConvertIn(const Element &P) const - {return P.identity ? P : ECP::Point(m_ec->GetField().ConvertIn(P.x), m_ec->GetField().ConvertIn(P.y));}; - Element ConvertOut(const Element &P) const - {return P.identity ? P : ECP::Point(m_ec->GetField().ConvertOut(P.x), m_ec->GetField().ConvertOut(P.y));} - const AbstractGroup & GetGroup() const {return *m_ec;} - Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec->BERDecodePoint(bt);} - void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {m_ec->DEREncodePoint(bt, v, false);} - - // non-inherited - void SetCurve(const ECP &ec) - { - m_ec.reset(new ECP(ec, true)); - m_ecOriginal = ec; - } - const ECP & GetCurve() const {return *m_ecOriginal;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~EcPrecomputation() {} -#endif - -private: - value_ptr m_ec, m_ecOriginal; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/elgamal.cpp b/external/crypto++-5.6.3/elgamal.cpp deleted file mode 100644 index c56f593de..000000000 --- a/external/crypto++-5.6.3/elgamal.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// elgamal.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "elgamal.h" -#include "asn.h" -#include "nbtheory.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void ElGamal_TestInstantiations() -{ - ElGamalEncryptor test1(1, 1, 1); - ElGamalDecryptor test2(NullRNG(), 123); - ElGamalEncryptor test3(test2); -} -#endif - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/elgamal.h b/external/crypto++-5.6.3/elgamal.h deleted file mode 100644 index 7152e0979..000000000 --- a/external/crypto++-5.6.3/elgamal.h +++ /dev/null @@ -1,144 +0,0 @@ -// elgamal.h - written and placed in the public domain by Wei Dai - -//! \file elgamal.h -//! \brief Classes and functions for ElGamal key agreement and encryption schemes - -#ifndef CRYPTOPP_ELGAMAL_H -#define CRYPTOPP_ELGAMAL_H - -#include "cryptlib.h" -#include "modexppc.h" -#include "integer.h" -#include "gfpcrypt.h" -#include "pubkey.h" -#include "dsa.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH, - public DL_KeyDerivationAlgorithm, - public DL_SymmetricEncryptionAlgorithm -{ -public: - void Derive(const DL_GroupParameters &groupParams, byte *derivedKey, size_t derivedLength, const Integer &agreedElement, const Integer &ephemeralPublicKey, const NameValuePairs &derivationParams) const - { - CRYPTOPP_UNUSED(groupParams), CRYPTOPP_UNUSED(ephemeralPublicKey), CRYPTOPP_UNUSED(derivationParams); - agreedElement.Encode(derivedKey, derivedLength); - } - - size_t GetSymmetricKeyLength(size_t plainTextLength) const - { - CRYPTOPP_UNUSED(plainTextLength); - return GetGroupParameters().GetModulus().ByteCount(); - } - - size_t GetSymmetricCiphertextLength(size_t plainTextLength) const - { - unsigned int len = GetGroupParameters().GetModulus().ByteCount(); - if (plainTextLength <= GetMaxSymmetricPlaintextLength(len)) - return len; - else - return 0; - } - - size_t GetMaxSymmetricPlaintextLength(size_t cipherTextLength) const - { - unsigned int len = GetGroupParameters().GetModulus().ByteCount(); - if (cipherTextLength == len) - return STDMIN(255U, len-3); - else - return 0; - } - - void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plainText, size_t plainTextLength, byte *cipherText, const NameValuePairs ¶meters) const - { - CRYPTOPP_UNUSED(parameters); - const Integer &p = GetGroupParameters().GetModulus(); - unsigned int modulusLen = p.ByteCount(); - - SecByteBlock block(modulusLen-1); - rng.GenerateBlock(block, modulusLen-2-plainTextLength); - memcpy(block+modulusLen-2-plainTextLength, plainText, plainTextLength); - block[modulusLen-2] = (byte)plainTextLength; - - a_times_b_mod_c(Integer(key, modulusLen), Integer(block, modulusLen-1), p).Encode(cipherText, modulusLen); - } - - DecodingResult SymmetricDecrypt(const byte *key, const byte *cipherText, size_t cipherTextLength, byte *plainText, const NameValuePairs ¶meters) const - { - CRYPTOPP_UNUSED(parameters); - const Integer &p = GetGroupParameters().GetModulus(); - unsigned int modulusLen = p.ByteCount(); - - if (cipherTextLength != modulusLen) - return DecodingResult(); - - Integer m = a_times_b_mod_c(Integer(cipherText, modulusLen), Integer(key, modulusLen).InverseMod(p), p); - - m.Encode(plainText, 1); - unsigned int plainTextLength = plainText[0]; - if (plainTextLength > GetMaxSymmetricPlaintextLength(modulusLen)) - return DecodingResult(); - m >>= 8; - m.Encode(plainText, plainTextLength); - return DecodingResult(plainTextLength); - } - - virtual const DL_GroupParameters_GFP & GetGroupParameters() const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ElGamalBase() {} -#endif -}; - -template -class ElGamalObjectImpl : public DL_ObjectImplBase, public ElGamalBase -{ -public: - size_t FixedMaxPlaintextLength() const {return this->MaxPlaintextLength(FixedCiphertextLength());} - size_t FixedCiphertextLength() const {return this->CiphertextLength(0);} - - const DL_GroupParameters_GFP & GetGroupParameters() const {return this->GetKey().GetGroupParameters();} - - DecodingResult FixedLengthDecrypt(RandomNumberGenerator &rng, const byte *cipherText, byte *plainText) const - {return Decrypt(rng, cipherText, FixedCiphertextLength(), plainText);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ElGamalObjectImpl() {} -#endif - -protected: - const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const {return *this;} - const DL_KeyDerivationAlgorithm & GetKeyDerivationAlgorithm() const {return *this;} - const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const {return *this;} -}; - -struct ElGamalKeys -{ - typedef DL_CryptoKeys_GFP::GroupParameters GroupParameters; - typedef DL_PrivateKey_GFP_OldFormat PrivateKey; - typedef DL_PublicKey_GFP_OldFormat PublicKey; -}; - -//! \class ElGamal -//! \brief ElGamal encryption scheme with non-standard padding -struct ElGamal -{ - typedef DL_CryptoSchemeOptions SchemeOptions; - - static const char * StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";} - - typedef SchemeOptions::GroupParameters GroupParameters; - //! implements PK_Encryptor interface - typedef PK_FinalTemplate, SchemeOptions, SchemeOptions::PublicKey> > Encryptor; - //! implements PK_Decryptor interface - typedef PK_FinalTemplate, SchemeOptions, SchemeOptions::PrivateKey> > Decryptor; -}; - -typedef ElGamal::Encryptor ElGamalEncryptor; -typedef ElGamal::Decryptor ElGamalDecryptor; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/emsa2.cpp b/external/crypto++-5.6.3/emsa2.cpp deleted file mode 100644 index 43263f25b..000000000 --- a/external/crypto++-5.6.3/emsa2.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// emsa2.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "emsa2.h" - -#ifndef CRYPTOPP_IMPORTS - -NAMESPACE_BEGIN(CryptoPP) - -void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator& /*rng*/, - const byte* recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength), CRYPTOPP_UNUSED(representativeBitLength); - assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); - - if (representativeBitLength % 8 != 7) - throw PK_SignatureScheme::InvalidKeyLength("EMSA2: EMSA2 requires a key length that is a multiple of 8"); - - size_t digestSize = hash.DigestSize(); - size_t representativeByteLength = BitsToBytes(representativeBitLength); - - representative[0] = messageEmpty ? 0x4b : 0x6b; - memset(representative+1, 0xbb, representativeByteLength-digestSize-4); // pad with 0xbb - byte *afterP2 = representative+representativeByteLength-digestSize-3; - afterP2[0] = 0xba; - hash.Final(afterP2+1); - representative[representativeByteLength-2] = *hashIdentifier.first; - representative[representativeByteLength-1] = 0xcc; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/emsa2.h b/external/crypto++-5.6.3/emsa2.h deleted file mode 100644 index d111bf1cb..000000000 --- a/external/crypto++-5.6.3/emsa2.h +++ /dev/null @@ -1,88 +0,0 @@ -// emsa2.h - written and placed in the public domain by Wei Dai - -//! \file emsa2.h -//! \brief Classes and functions for various padding schemes used in public key algorithms - -#ifndef CRYPTOPP_EMSA2_H -#define CRYPTOPP_EMSA2_H - -#include "cryptlib.h" -#include "pubkey.h" -#include "misc.h" - -#ifdef CRYPTOPP_IS_DLL -#include "sha.h" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -template class EMSA2HashId -{ -public: - static const byte id; -}; - -template -class EMSA2HashIdLookup : public BASE -{ -public: - struct HashIdentifierLookup - { - template struct HashIdentifierLookup2 - { - static HashIdentifier Lookup() - { - return HashIdentifier(&EMSA2HashId::id, 1); - } - }; - }; -}; - -// EMSA2HashId can be instantiated with the following classes. -class SHA1; -class RIPEMD160; -class RIPEMD128; -class SHA256; -class SHA384; -class SHA512; -class Whirlpool; -class SHA224; -// end of list - -#ifdef CRYPTOPP_IS_DLL -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -#endif - -//! _ -class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "EMSA2";} - - size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const - {CRYPTOPP_UNUSED(hashIdentifierLength); return 8*digestLength + 31;} - - void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; -}; - -//! EMSA2, for use with RWSS and RSA_ISO -/*! Only the following hash functions are supported by this signature standard: - \dontinclude emsa2.h - \skip EMSA2HashId can be instantiated - \until end of list -*/ -struct P1363_EMSA2 : public SignatureStandard -{ - typedef EMSA2Pad SignatureMessageEncodingMethod; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/eprecomp.cpp b/external/crypto++-5.6.3/eprecomp.cpp deleted file mode 100644 index c0d0c228f..000000000 --- a/external/crypto++-5.6.3/eprecomp.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// eprecomp.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "eprecomp.h" -#include "integer.h" -#include "asn.h" - -NAMESPACE_BEGIN(CryptoPP) - -template void DL_FixedBasePrecomputationImpl::SetBase(const DL_GroupPrecomputation &group, const Element &i_base) -{ - m_base = group.NeedConversions() ? group.ConvertIn(i_base) : i_base; - - if (m_bases.empty() || !(m_base == m_bases[0])) - { - m_bases.resize(1); - m_bases[0] = m_base; - } - - if (group.NeedConversions()) - m_base = i_base; -} - -template void DL_FixedBasePrecomputationImpl::Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage) -{ - assert(m_bases.size() > 0); - assert(storage <= maxExpBits); - - if (storage > 1) - { - m_windowSize = (maxExpBits+storage-1)/storage; - m_exponentBase = Integer::Power2(m_windowSize); - } - - m_bases.resize(storage); - for (unsigned i=1; i void DL_FixedBasePrecomputationImpl::Load(const DL_GroupPrecomputation &group, BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - word32 version; - BERDecodeUnsigned(seq, version, INTEGER, 1, 1); - m_exponentBase.BERDecode(seq); - m_windowSize = m_exponentBase.BitCount() - 1; - m_bases.clear(); - while (!seq.EndReached()) - m_bases.push_back(group.BERDecodeElement(seq)); - if (!m_bases.empty() && group.NeedConversions()) - m_base = group.ConvertOut(m_bases[0]); - seq.MessageEnd(); -} - -template void DL_FixedBasePrecomputationImpl::Save(const DL_GroupPrecomputation &group, BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - DEREncodeUnsigned(seq, 1); // version - m_exponentBase.DEREncode(seq); - for (unsigned i=0; i void DL_FixedBasePrecomputationImpl::PrepareCascade(const DL_GroupPrecomputation &i_group, std::vector > &eb, const Integer &exponent) const -{ - const AbstractGroup &group = i_group.GetGroup(); - - Integer r, q, e = exponent; - bool fastNegate = group.InversionIsFast() && m_windowSize > 1; - unsigned int i; - - for (i=0; i+1(group.Inverse(m_bases[i]), m_exponentBase - r)); - } - else - eb.push_back(BaseAndExponent(m_bases[i], r)); - } - eb.push_back(BaseAndExponent(m_bases[i], e)); -} - -template T DL_FixedBasePrecomputationImpl::Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const -{ - std::vector > eb; // array of segments of the exponent and precalculated bases - eb.reserve(m_bases.size()); - PrepareCascade(group, eb, exponent); - return group.ConvertOut(GeneralCascadeMultiplication(group.GetGroup(), eb.begin(), eb.end())); -} - -template T - DL_FixedBasePrecomputationImpl::CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, - const DL_FixedBasePrecomputation &i_pc2, const Integer &exponent2) const -{ - std::vector > eb; // array of segments of the exponent and precalculated bases - const DL_FixedBasePrecomputationImpl &pc2 = static_cast &>(i_pc2); - eb.reserve(m_bases.size() + pc2.m_bases.size()); - PrepareCascade(group, eb, exponent); - pc2.PrepareCascade(group, eb, exponent2); - return group.ConvertOut(GeneralCascadeMultiplication(group.GetGroup(), eb.begin(), eb.end())); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/eprecomp.h b/external/crypto++-5.6.3/eprecomp.h deleted file mode 100644 index 9de2a5369..000000000 --- a/external/crypto++-5.6.3/eprecomp.h +++ /dev/null @@ -1,93 +0,0 @@ -// eprecomp.h - written and placed in the public domain by Wei Dai - -//! \file eprecomp.h -//! \brief Classes for precomputation in a group - -#ifndef CRYPTOPP_EPRECOMP_H -#define CRYPTOPP_EPRECOMP_H - -#include "cryptlib.h" -#include "integer.h" -#include "algebra.h" -#include "stdcpp.h" - -NAMESPACE_BEGIN(CryptoPP) - -template -class DL_GroupPrecomputation -{ -public: - typedef T Element; - - virtual bool NeedConversions() const {return false;} - virtual Element ConvertIn(const Element &v) const {return v;} - virtual Element ConvertOut(const Element &v) const {return v;} - virtual const AbstractGroup & GetGroup() const =0; - virtual Element BERDecodeElement(BufferedTransformation &bt) const =0; - virtual void DEREncodeElement(BufferedTransformation &bt, const Element &P) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupPrecomputation() {} -#endif -}; - -template -class DL_FixedBasePrecomputation -{ -public: - typedef T Element; - - virtual bool IsInitialized() const =0; - virtual void SetBase(const DL_GroupPrecomputation &group, const Element &base) =0; - virtual const Element & GetBase(const DL_GroupPrecomputation &group) const =0; - virtual void Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage) =0; - virtual void Load(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) =0; - virtual void Save(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) const =0; - virtual Element Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const =0; - virtual Element CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_FixedBasePrecomputation() {} -#endif -}; - -template -class DL_FixedBasePrecomputationImpl : public DL_FixedBasePrecomputation -{ -public: - typedef T Element; - - DL_FixedBasePrecomputationImpl() : m_windowSize(0) {} - - // DL_FixedBasePrecomputation - bool IsInitialized() const - {return !m_bases.empty();} - void SetBase(const DL_GroupPrecomputation &group, const Element &base); - const Element & GetBase(const DL_GroupPrecomputation &group) const - {return group.NeedConversions() ? m_base : m_bases[0];} - void Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage); - void Load(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation); - void Save(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) const; - Element Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const; - Element CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_FixedBasePrecomputationImpl() {} -#endif - -private: - void PrepareCascade(const DL_GroupPrecomputation &group, std::vector > &eb, const Integer &exponent) const; - - Element m_base; - unsigned int m_windowSize; - Integer m_exponentBase; // what base to represent the exponent in - std::vector m_bases; // precalculated bases -}; - -NAMESPACE_END - -#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#include "eprecomp.cpp" -#endif - -#endif diff --git a/external/crypto++-5.6.3/esign.cpp b/external/crypto++-5.6.3/esign.cpp deleted file mode 100644 index 74afe5770..000000000 --- a/external/crypto++-5.6.3/esign.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// esign.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -// TODO: fix the C4589 warnings -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4589) -#endif - -#include "esign.h" -#include "modarith.h" -#include "integer.h" -#include "nbtheory.h" -#include "algparam.h" -#include "sha.h" -#include "asn.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void ESIGN_TestInstantiations() -{ - ESIGN::Verifier x1(1, 1); - ESIGN::Signer x2(NullRNG(), 1); - ESIGN::Verifier x3(x2); - ESIGN::Verifier x4(x2.GetKey()); - ESIGN::Verifier x5(x3); - ESIGN::Signer x6 = x2; - - x6 = x2; - x3 = ESIGN::Verifier(x2); - x4 = x2.GetKey(); -} -#endif - -void ESIGNFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - m_n.BERDecode(seq); - m_e.BERDecode(seq); - seq.MessageEnd(); -} - -void ESIGNFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_n.DEREncode(seq); - m_e.DEREncode(seq); - seq.MessageEnd(); -} - -Integer ESIGNFunction::ApplyFunction(const Integer &x) const -{ - DoQuickSanityCheck(); - return STDMIN(a_exp_b_mod_c(x, m_e, m_n) >> (2*GetK()+2), MaxImage()); -} - -bool ESIGNFunction::Validate(RandomNumberGenerator& rng, unsigned int level) const -{ - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level); - bool pass = true; - pass = pass && m_n > Integer::One() && m_n.IsOdd(); - pass = pass && m_e >= 8 && m_e < m_n; - return pass; -} - -bool ESIGNFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_GET_FUNCTION_ENTRY(PublicExponent) - ; -} - -void ESIGNFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_SET_FUNCTION_ENTRY(PublicExponent) - ; -} - -// ***************************************************************************** - -void InvertibleESIGNFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶m) -{ - int modulusSize = 1023*2; - param.GetIntValue("ModulusSize", modulusSize) || param.GetIntValue("KeySize", modulusSize); - - if (modulusSize < 24) - throw InvalidArgument("InvertibleESIGNFunction: specified modulus size is too small"); - - if (modulusSize % 3 != 0) - throw InvalidArgument("InvertibleESIGNFunction: modulus size must be divisible by 3"); - - m_e = param.GetValueWithDefault("PublicExponent", Integer(32)); - - if (m_e < 8) - throw InvalidArgument("InvertibleESIGNFunction: public exponents less than 8 may not be secure"); - - // VC70 workaround: putting these after primeParam causes overlapped stack allocation - ConstByteArrayParameter seedParam; - SecByteBlock seed; - - const Integer minP = Integer(204) << (modulusSize/3-8); - const Integer maxP = Integer::Power2(modulusSize/3)-1; - AlgorithmParameters primeParam = MakeParameters("Min", minP)("Max", maxP)("RandomNumberType", Integer::PRIME); - - if (param.GetValue("Seed", seedParam)) - { - seed.resize(seedParam.size() + 4); - memcpy(seed + 4, seedParam.begin(), seedParam.size()); - - PutWord(false, BIG_ENDIAN_ORDER, seed, (word32)0); - m_p.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("Seed", ConstByteArrayParameter(seed)))); - PutWord(false, BIG_ENDIAN_ORDER, seed, (word32)1); - m_q.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("Seed", ConstByteArrayParameter(seed)))); - } - else - { - m_p.GenerateRandom(rng, primeParam); - m_q.GenerateRandom(rng, primeParam); - } - - m_n = m_p * m_p * m_q; - - assert(m_n.BitCount() == (unsigned int)modulusSize); -} - -void InvertibleESIGNFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder privateKey(bt); - m_n.BERDecode(privateKey); - m_e.BERDecode(privateKey); - m_p.BERDecode(privateKey); - m_q.BERDecode(privateKey); - privateKey.MessageEnd(); -} - -void InvertibleESIGNFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder privateKey(bt); - m_n.DEREncode(privateKey); - m_e.DEREncode(privateKey); - m_p.DEREncode(privateKey); - m_q.DEREncode(privateKey); - privateKey.MessageEnd(); -} - -Integer InvertibleESIGNFunction::CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const -{ - DoQuickSanityCheck(); - - Integer pq = m_p * m_q; - Integer p2 = m_p * m_p; - Integer r, z, re, a, w0, w1; - - do - { - r.Randomize(rng, Integer::Zero(), pq); - z = x << (2*GetK()+2); - re = a_exp_b_mod_c(r, m_e, m_n); - a = (z - re) % m_n; - Integer::Divide(w1, w0, a, pq); - if (w1.NotZero()) - { - ++w0; - w1 = pq - w1; - } - } - while ((w1 >> (2*GetK()+1)).IsPositive()); - - ModularArithmetic modp(m_p); - Integer t = modp.Divide(w0 * r % m_p, m_e * re % m_p); - Integer s = r + t*pq; - assert(s < m_n); -#if 0 - using namespace std; - cout << "f = " << x << endl; - cout << "r = " << r << endl; - cout << "z = " << z << endl; - cout << "a = " << a << endl; - cout << "w0 = " << w0 << endl; - cout << "w1 = " << w1 << endl; - cout << "t = " << t << endl; - cout << "s = " << s << endl; -#endif - return s; -} - -bool InvertibleESIGNFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = ESIGNFunction::Validate(rng, level); - pass = pass && m_p > Integer::One() && m_p.IsOdd() && m_p < m_n; - pass = pass && m_q > Integer::One() && m_q.IsOdd() && m_q < m_n; - pass = pass && m_p.BitCount() == m_q.BitCount(); - if (level >= 1) - pass = pass && m_p * m_p * m_q == m_n; - if (level >= 2) - pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); - return pass; -} - -bool InvertibleESIGNFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) - ; -} - -void InvertibleESIGNFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) - ; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/esign.h b/external/crypto++-5.6.3/esign.h deleted file mode 100644 index 7ddbc8bb2..000000000 --- a/external/crypto++-5.6.3/esign.h +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef CRYPTOPP_ESIGN_H -#define CRYPTOPP_ESIGN_H - -/** \file - This file contains classes that implement the - ESIGN signature schemes as defined in IEEE P1363a. -*/ - -#include "cryptlib.h" -#include "pubkey.h" -#include "integer.h" -#include "asn.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class ESIGNFunction : public TrapdoorFunction, public ASN1CryptoMaterial -{ - typedef ESIGNFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &e) - {m_n = n; m_e = e;} - - // PublicKey - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - // CryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // TrapdoorFunction - Integer ApplyFunction(const Integer &x) const; - Integer PreimageBound() const {return m_n;} - Integer ImageBound() const {return Integer::Power2(GetK());} - - // non-derived - const Integer & GetModulus() const {return m_n;} - const Integer & GetPublicExponent() const {return m_e;} - - void SetModulus(const Integer &n) {m_n = n;} - void SetPublicExponent(const Integer &e) {m_e = e;} - -protected: - // Covertiy finding on overflow. The library allows small values for research purposes. - unsigned int GetK() const {return SaturatingSubtract(m_n.BitCount()/3, 1U);} - - Integer m_n, m_e; -}; - -//! _ -class InvertibleESIGNFunction : public ESIGNFunction, public RandomizedTrapdoorFunctionInverse, public PrivateKey -{ - typedef InvertibleESIGNFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q) - {m_n = n; m_e = e; m_p = p; m_q = q;} - // generate a random private key - void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits) - {GenerateRandomWithKeySize(rng, modulusBits);} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const; - - // GeneratibleCryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - /*! parameters: (ModulusSize) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - const Integer& GetPrime1() const {return m_p;} - const Integer& GetPrime2() const {return m_q;} - - void SetPrime1(const Integer &p) {m_p = p;} - void SetPrime2(const Integer &q) {m_q = q;} - -protected: - Integer m_p, m_q; -}; - -//! _ -template -class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod -{ -public: - static const char *StaticAlgorithmName() {return "EMSA5";} - - void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const - { - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); - CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); - SecByteBlock digest(hash.DigestSize()); - hash.Final(digest); - size_t representativeByteLength = BitsToBytes(representativeBitLength); - T mgf; - mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.size(), false); - if (representativeBitLength % 8 != 0) - representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); - } -}; - -//! EMSA5, for use with ESIGN -struct P1363_EMSA5 : public SignatureStandard -{ - typedef EMSA5Pad SignatureMessageEncodingMethod; -}; - -struct ESIGN_Keys -{ - static std::string StaticAlgorithmName() {return "ESIGN";} - typedef ESIGNFunction PublicKey; - typedef InvertibleESIGNFunction PrivateKey; -}; - -//! ESIGN, as defined in IEEE P1363a -template -struct ESIGN : public TF_SS -{ -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/factory.h b/external/crypto++-5.6.3/factory.h deleted file mode 100644 index cc2dd908a..000000000 --- a/external/crypto++-5.6.3/factory.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef CRYPTOPP_OBJFACT_H -#define CRYPTOPP_OBJFACT_H - -#include "cryptlib.h" -#include "misc.h" -#include "stdcpp.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -template -class ObjectFactory -{ -public: - virtual ~ObjectFactory () {} - virtual AbstractClass * CreateObject() const =0; -}; - -//! _ -template -class DefaultObjectFactory : public ObjectFactory -{ -public: - AbstractClass * CreateObject() const - { - return new ConcreteClass; - } -}; - -//! _ -template -class ObjectFactoryRegistry -{ -public: - class FactoryNotFound : public Exception - { - public: - FactoryNotFound(const char *name) : Exception(OTHER_ERROR, std::string("ObjectFactoryRegistry: could not find factory for algorithm ") + name) {} - }; - - ~ObjectFactoryRegistry() - { - for (CPP_TYPENAME Map::iterator i = m_map.begin(); i != m_map.end(); ++i) - { - delete (ObjectFactory *)i->second; - i->second = NULL; - } - } - - void RegisterFactory(const std::string &name, ObjectFactory *factory) - { - m_map[name] = factory; - } - - const ObjectFactory * GetFactory(const char *name) const - { - CPP_TYPENAME Map::const_iterator i = m_map.find(name); - return i == m_map.end() ? NULL : (ObjectFactory *)i->second; - } - - AbstractClass *CreateObject(const char *name) const - { - const ObjectFactory *factory = GetFactory(name); - if (!factory) - throw FactoryNotFound(name); - return factory->CreateObject(); - } - - // Return a vector containing the factory names. This is easier than returning an iterator. - // from Andrew Pitonyak - std::vector GetFactoryNames() const - { - std::vector names; - CPP_TYPENAME Map::const_iterator iter; - for (iter = m_map.begin(); iter != m_map.end(); ++iter) - names.push_back(iter->first); - return names; - } - - CRYPTOPP_NOINLINE static ObjectFactoryRegistry & Registry(CRYPTOPP_NOINLINE_DOTDOTDOT); - -private: - // use void * instead of ObjectFactory * to save code size - typedef std::map Map; - Map m_map; -}; - -template -ObjectFactoryRegistry & ObjectFactoryRegistry::Registry(CRYPTOPP_NOINLINE_DOTDOTDOT) -{ - static ObjectFactoryRegistry s_registry; - return s_registry; -} - -template -struct RegisterDefaultFactoryFor { -RegisterDefaultFactoryFor(const char *name=NULL) -{ - // BCB2006 workaround - std::string n = name ? std::string(name) : std::string(ConcreteClass::StaticAlgorithmName()); - ObjectFactoryRegistry::Registry(). - RegisterFactory(n, new DefaultObjectFactory); -}}; - -template -void RegisterAsymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - RegisterDefaultFactoryFor((const char *)name); - RegisterDefaultFactoryFor((const char *)name); -} - -template -void RegisterSignatureSchemeDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - RegisterDefaultFactoryFor((const char *)name); - RegisterDefaultFactoryFor((const char *)name); -} - -template -void RegisterSymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - RegisterDefaultFactoryFor((const char *)name); - RegisterDefaultFactoryFor((const char *)name); -} - -template -void RegisterAuthenticatedSymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - RegisterDefaultFactoryFor((const char *)name); - RegisterDefaultFactoryFor((const char *)name); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/files.cpp b/external/crypto++-5.6.3/files.cpp deleted file mode 100644 index 5818ea872..000000000 --- a/external/crypto++-5.6.3/files.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// files.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "files.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void Files_TestInstantiations() -{ - FileStore f0; - FileSource f1; - FileSink f2; -} -#endif - -void FileStore::StoreInitialize(const NameValuePairs ¶meters) -{ - m_waiting = false; - m_stream = NULL; - m_file.release(); - - const char *fileName = NULL; -#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 - const wchar_t *fileNameWide = NULL; - if (!parameters.GetValue(Name::InputFileNameWide(), fileNameWide)) -#endif - if (!parameters.GetValue(Name::InputFileName(), fileName)) - { - parameters.GetValue(Name::InputStreamPointer(), m_stream); - return; - } - - std::ios::openmode binary = parameters.GetValueWithDefault(Name::InputBinaryMode(), true) ? std::ios::binary : std::ios::openmode(0); - m_file.reset(new std::ifstream); -#ifdef CRYPTOPP_UNIX_AVAILABLE - std::string narrowed; - if (fileNameWide) - fileName = (narrowed = StringNarrow(fileNameWide)).c_str(); -#endif -#if _MSC_VER >= 1400 - if (fileNameWide) - { - m_file->open(fileNameWide, std::ios::in | binary); - if (!*m_file) - throw OpenErr(StringNarrow(fileNameWide, false)); - } -#endif - if (fileName) - { - m_file->open(fileName, std::ios::in | binary); - if (!*m_file) - throw OpenErr(fileName); - } - m_stream = m_file.get(); -} - -lword FileStore::MaxRetrievable() const -{ - if (!m_stream) - return 0; - - std::streampos current = m_stream->tellg(); - std::streampos end = m_stream->seekg(0, std::ios::end).tellg(); - m_stream->seekg(current); - return end-current; -} - -size_t FileStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - if (!m_stream) - { - transferBytes = 0; - return 0; - } - - lword size=transferBytes; - transferBytes = 0; - - if (m_waiting) - goto output; - - while (size && m_stream->good()) - { - { - size_t spaceSize = 1024; - m_space = HelpCreatePutSpace(target, channel, 1, UnsignedMin(size_t(SIZE_MAX), size), spaceSize); - - m_stream->read((char *)m_space, (unsigned int)STDMIN(size, (lword)spaceSize)); - } - m_len = (size_t)m_stream->gcount(); - size_t blockedBytes; -output: - blockedBytes = target.ChannelPutModifiable2(channel, m_space, m_len, 0, blocking); - m_waiting = blockedBytes > 0; - if (m_waiting) - return blockedBytes; - size -= m_len; - transferBytes += m_len; - } - - if (!m_stream->good() && !m_stream->eof()) - throw ReadErr(); - - return 0; -} - -size_t FileStore::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - if (!m_stream) - return 0; - - if (begin == 0 && end == 1) - { - int result = m_stream->peek(); - if (result == std::char_traits::eof()) - return 0; - else - { - size_t blockedBytes = target.ChannelPut(channel, byte(result), blocking); - begin += 1-blockedBytes; - return blockedBytes; - } - } - - // TODO: figure out what happens on cin - std::streampos current = m_stream->tellg(); - std::streampos endPosition = m_stream->seekg(0, std::ios::end).tellg(); - std::streampos newPosition = current + static_cast(begin); - - if (newPosition >= endPosition) - { - m_stream->seekg(current); - return 0; // don't try to seek beyond the end of file - } - m_stream->seekg(newPosition); - try - { - assert(!m_waiting); - lword copyMax = end-begin; - size_t blockedBytes = const_cast(this)->TransferTo2(target, copyMax, channel, blocking); - begin += copyMax; - if (blockedBytes) - { - const_cast(this)->m_waiting = false; - return blockedBytes; - } - } - catch(...) - { - m_stream->clear(); - m_stream->seekg(current); - throw; - } - m_stream->clear(); - m_stream->seekg(current); - - return 0; -} - -lword FileStore::Skip(lword skipMax) -{ - if (!m_stream) - return 0; - - lword oldPos = m_stream->tellg(); - std::istream::off_type offset; - if (!SafeConvert(skipMax, offset)) - throw InvalidArgument("FileStore: maximum seek offset exceeded"); - m_stream->seekg(offset, std::ios::cur); - return (lword)m_stream->tellg() - oldPos; -} - -void FileSink::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_stream = NULL; - m_file.release(); - - const char *fileName = NULL; -#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 - const wchar_t *fileNameWide = NULL; - if (!parameters.GetValue(Name::OutputFileNameWide(), fileNameWide)) -#endif - if (!parameters.GetValue(Name::OutputFileName(), fileName)) - { - parameters.GetValue(Name::OutputStreamPointer(), m_stream); - return; - } - - std::ios::openmode binary = parameters.GetValueWithDefault(Name::OutputBinaryMode(), true) ? std::ios::binary : std::ios::openmode(0); - m_file.reset(new std::ofstream); -#ifdef CRYPTOPP_UNIX_AVAILABLE - std::string narrowed; - if (fileNameWide) - fileName = (narrowed = StringNarrow(fileNameWide)).c_str(); -#elif (CRYPTOPP_MSC_VERSION >= 1400) - if (fileNameWide) - { - m_file->open(fileNameWide, std::ios::out | std::ios::trunc | binary); - if (!*m_file) - throw OpenErr(StringNarrow(fileNameWide, false)); - } -#endif - if (fileName) - { - m_file->open(fileName, std::ios::out | std::ios::trunc | binary); - if (!*m_file) - throw OpenErr(fileName); - } - m_stream = m_file.get(); -} - -bool FileSink::IsolatedFlush(bool hardFlush, bool blocking) -{ - CRYPTOPP_UNUSED(hardFlush), CRYPTOPP_UNUSED(blocking); - if (!m_stream) - throw Err("FileSink: output stream not opened"); - - m_stream->flush(); - if (!m_stream->good()) - throw WriteErr(); - - return false; -} - -size_t FileSink::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) -{ - CRYPTOPP_UNUSED(blocking); - if (!m_stream) - throw Err("FileSink: output stream not opened"); - - while (length > 0) - { - std::streamsize size; - if (!SafeConvert(length, size)) - size = ((std::numeric_limits::max)()); - m_stream->write((const char *)inString, size); - inString += size; - length -= (size_t)size; - } - - if (messageEnd) - m_stream->flush(); - - if (!m_stream->good()) - throw WriteErr(); - - return 0; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/files.h b/external/crypto++-5.6.3/files.h deleted file mode 100644 index d0c45746b..000000000 --- a/external/crypto++-5.6.3/files.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef CRYPTOPP_FILES_H -#define CRYPTOPP_FILES_H - -#include "cryptlib.h" -#include "filters.h" -#include "argnames.h" -#include "smartptr.h" - -#include -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! file-based implementation of Store interface -class CRYPTOPP_DLL FileStore : public Store, private FilterPutSpaceHelper, public NotCopyable -{ -public: - class Err : public Exception - { - public: - Err(const std::string &s) : Exception(IO_ERROR, s) {} - }; - class OpenErr : public Err {public: OpenErr(const std::string &filename) : Err("FileStore: error opening file for reading: " + filename) {}}; - class ReadErr : public Err {public: ReadErr() : Err("FileStore: error reading file") {}}; - - FileStore() : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) {} - FileStore(std::istream &in) : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) - {StoreInitialize(MakeParameters(Name::InputStreamPointer(), &in));} - FileStore(const char *filename) : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) - {StoreInitialize(MakeParameters(Name::InputFileName(), filename ? filename : ""));} -#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 - //! specify file with Unicode name. On non-Windows OS, this function assumes that setlocale() has been called. - FileStore(const wchar_t *filename) - {StoreInitialize(MakeParameters(Name::InputFileNameWide(), filename));} -#endif - - std::istream* GetStream() {return m_stream;} - - lword MaxRetrievable() const; - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - lword Skip(lword skipMax=ULONG_MAX); - -private: - void StoreInitialize(const NameValuePairs ¶meters); - - member_ptr m_file; - std::istream *m_stream; - byte *m_space; - size_t m_len; - bool m_waiting; -}; - -//! file-based implementation of Source interface -class CRYPTOPP_DLL FileSource : public SourceTemplate -{ -public: - typedef FileStore::Err Err; - typedef FileStore::OpenErr OpenErr; - typedef FileStore::ReadErr ReadErr; - - FileSource(BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) {} - FileSource(std::istream &in, bool pumpAll, BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters(Name::InputStreamPointer(), &in));} - FileSource(const char *filename, bool pumpAll, BufferedTransformation *attachment = NULL, bool binary=true) - : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters(Name::InputFileName(), filename)(Name::InputBinaryMode(), binary));} -#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 - //! specify file with Unicode name. On non-Windows OS, this function assumes that setlocale() has been called. - FileSource(const wchar_t *filename, bool pumpAll, BufferedTransformation *attachment = NULL, bool binary=true) - : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters(Name::InputFileNameWide(), filename)(Name::InputBinaryMode(), binary));} -#endif - - std::istream* GetStream() {return m_store.GetStream();} -}; - -//! file-based implementation of Sink interface -class CRYPTOPP_DLL FileSink : public Sink, public NotCopyable -{ -public: - class Err : public Exception - { - public: - Err(const std::string &s) : Exception(IO_ERROR, s) {} - }; - class OpenErr : public Err {public: OpenErr(const std::string &filename) : Err("FileSink: error opening file for writing: " + filename) {}}; - class WriteErr : public Err {public: WriteErr() : Err("FileSink: error writing file") {}}; - - FileSink() : m_stream(NULL) {} - FileSink(std::ostream &out) - {IsolatedInitialize(MakeParameters(Name::OutputStreamPointer(), &out));} - FileSink(const char *filename, bool binary=true) - {IsolatedInitialize(MakeParameters(Name::OutputFileName(), filename)(Name::OutputBinaryMode(), binary));} -#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 - //! specify file with Unicode name. On non-Windows OS, this function assumes that setlocale() has been called. - FileSink(const wchar_t *filename, bool binary=true) - {IsolatedInitialize(MakeParameters(Name::OutputFileNameWide(), filename)(Name::OutputBinaryMode(), binary));} -#endif - - std::ostream* GetStream() {return m_stream;} - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - bool IsolatedFlush(bool hardFlush, bool blocking); - -private: - member_ptr m_file; - std::ostream *m_stream; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/filters.cpp b/external/crypto++-5.6.3/filters.cpp deleted file mode 100644 index 280831521..000000000 --- a/external/crypto++-5.6.3/filters.cpp +++ /dev/null @@ -1,1168 +0,0 @@ -// filters.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100 4189) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunused-value" -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "filters.h" -#include "mqueue.h" -#include "fltrimpl.h" -#include "argnames.h" -#include "smartptr.h" -#include "stdcpp.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -Filter::Filter(BufferedTransformation *attachment) - : m_attachment(attachment), m_inputPosition(0), m_continueAt(0) -{ -} - -BufferedTransformation * Filter::NewDefaultAttachment() const -{ - return new MessageQueue; -} - -BufferedTransformation * Filter::AttachedTransformation() -{ - if (m_attachment.get() == NULL) - m_attachment.reset(NewDefaultAttachment()); - return m_attachment.get(); -} - -const BufferedTransformation *Filter::AttachedTransformation() const -{ - if (m_attachment.get() == NULL) - const_cast(this)->m_attachment.reset(NewDefaultAttachment()); - return m_attachment.get(); -} - -void Filter::Detach(BufferedTransformation *newOut) -{ - m_attachment.reset(newOut); -} - -void Filter::Insert(Filter *filter) -{ - filter->m_attachment.reset(m_attachment.release()); - m_attachment.reset(filter); -} - -size_t Filter::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - return AttachedTransformation()->CopyRangeTo2(target, begin, end, channel, blocking); -} - -size_t Filter::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - return AttachedTransformation()->TransferTo2(target, transferBytes, channel, blocking); -} - -void Filter::Initialize(const NameValuePairs ¶meters, int propagation) -{ - m_inputPosition = m_continueAt = 0; - IsolatedInitialize(parameters); - PropagateInitialize(parameters, propagation); -} - -bool Filter::Flush(bool hardFlush, int propagation, bool blocking) -{ - switch (m_continueAt) - { - case 0: - if (IsolatedFlush(hardFlush, blocking)) - return true; - // fall through - case 1: - if (OutputFlush(1, hardFlush, propagation, blocking)) - return true; - // fall through - default: ;; - } - return false; -} - -bool Filter::MessageSeriesEnd(int propagation, bool blocking) -{ - switch (m_continueAt) - { - case 0: - if (IsolatedMessageSeriesEnd(blocking)) - return true; - // fall through - case 1: - if (ShouldPropagateMessageSeriesEnd() && OutputMessageSeriesEnd(1, propagation, blocking)) - return true; - // fall through - default: ;; - } - return false; -} - -void Filter::PropagateInitialize(const NameValuePairs ¶meters, int propagation) -{ - if (propagation) - AttachedTransformation()->Initialize(parameters, propagation-1); -} - -size_t Filter::OutputModifiable(int outputSite, byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel) -{ - if (messageEnd) - messageEnd--; - size_t result = AttachedTransformation()->ChannelPutModifiable2(channel, inString, length, messageEnd, blocking); - m_continueAt = result ? outputSite : 0; - return result; -} - -size_t Filter::Output(int outputSite, const byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel) -{ - if (messageEnd) - messageEnd--; - size_t result = AttachedTransformation()->ChannelPut2(channel, inString, length, messageEnd, blocking); - m_continueAt = result ? outputSite : 0; - return result; -} - -bool Filter::OutputFlush(int outputSite, bool hardFlush, int propagation, bool blocking, const std::string &channel) -{ - if (propagation && AttachedTransformation()->ChannelFlush(channel, hardFlush, propagation-1, blocking)) - { - m_continueAt = outputSite; - return true; - } - m_continueAt = 0; - return false; -} - -bool Filter::OutputMessageSeriesEnd(int outputSite, int propagation, bool blocking, const std::string &channel) -{ - if (propagation && AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation-1, blocking)) - { - m_continueAt = outputSite; - return true; - } - m_continueAt = 0; - return false; -} - -// ************************************************************* - -void MeterFilter::ResetMeter() -{ - m_currentMessageBytes = m_totalBytes = m_currentSeriesMessages = m_totalMessages = m_totalMessageSeries = 0; - m_rangesToSkip.clear(); -} - -void MeterFilter::AddRangeToSkip(unsigned int message, lword position, lword size, bool sortNow) -{ - MessageRange r = {message, position, size}; - m_rangesToSkip.push_back(r); - if (sortNow) - std::sort(m_rangesToSkip.begin(), m_rangesToSkip.end()); -} - -size_t MeterFilter::PutMaybeModifiable(byte *begin, size_t length, int messageEnd, bool blocking, bool modifiable) -{ - if (!m_transparent) - return 0; - - size_t t; - FILTER_BEGIN; - - m_begin = begin; - m_length = length; - - while (m_length > 0 || messageEnd) - { - if (m_length > 0 && !m_rangesToSkip.empty() && m_rangesToSkip.front().message == m_totalMessages && m_currentMessageBytes + m_length > m_rangesToSkip.front().position) - { - FILTER_OUTPUT_MAYBE_MODIFIABLE(1, m_begin, t = (size_t)SaturatingSubtract(m_rangesToSkip.front().position, m_currentMessageBytes), false, modifiable); - - assert(t < m_length); - m_begin += t; - m_length -= t; - m_currentMessageBytes += t; - m_totalBytes += t; - - if (m_currentMessageBytes + m_length < m_rangesToSkip.front().position + m_rangesToSkip.front().size) - t = m_length; - else - { - t = (size_t)SaturatingSubtract(m_rangesToSkip.front().position + m_rangesToSkip.front().size, m_currentMessageBytes); - assert(t <= m_length); - m_rangesToSkip.pop_front(); - } - - m_begin += t; - m_length -= t; - m_currentMessageBytes += t; - m_totalBytes += t; - } - else - { - FILTER_OUTPUT_MAYBE_MODIFIABLE(2, m_begin, m_length, messageEnd, modifiable); - - m_currentMessageBytes += m_length; - m_totalBytes += m_length; - m_length = 0; - - if (messageEnd) - { - m_currentMessageBytes = 0; - m_currentSeriesMessages++; - m_totalMessages++; - messageEnd = false; - } - } - } - - FILTER_END_NO_MESSAGE_END; -} - -size_t MeterFilter::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - return PutMaybeModifiable(const_cast(begin), length, messageEnd, blocking, false); -} - -size_t MeterFilter::PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking) -{ - return PutMaybeModifiable(begin, length, messageEnd, blocking, true); -} - -bool MeterFilter::IsolatedMessageSeriesEnd(bool blocking) -{ - CRYPTOPP_UNUSED(blocking); - m_currentMessageBytes = 0; - m_currentSeriesMessages = 0; - m_totalMessageSeries++; - return false; -} - -// ************************************************************* - -void FilterWithBufferedInput::BlockQueue::ResetQueue(size_t blockSize, size_t maxBlocks) -{ - m_buffer.New(blockSize * maxBlocks); - m_blockSize = blockSize; - m_maxBlocks = maxBlocks; - m_size = 0; - m_begin = m_buffer; -} - -byte *FilterWithBufferedInput::BlockQueue::GetBlock() -{ - if (m_size >= m_blockSize) - { - byte *ptr = m_begin; - if ((m_begin+=m_blockSize) == m_buffer.end()) - m_begin = m_buffer; - m_size -= m_blockSize; - return ptr; - } - else - return NULL; -} - -byte *FilterWithBufferedInput::BlockQueue::GetContigousBlocks(size_t &numberOfBytes) -{ - numberOfBytes = STDMIN(numberOfBytes, STDMIN(size_t(m_buffer.end()-m_begin), m_size)); - byte *ptr = m_begin; - m_begin += numberOfBytes; - m_size -= numberOfBytes; - if (m_size == 0 || m_begin == m_buffer.end()) - m_begin = m_buffer; - return ptr; -} - -size_t FilterWithBufferedInput::BlockQueue::GetAll(byte *outString) -{ - // Avoid passing NULL pointer to memcpy - if (!outString) return 0; - - size_t size = m_size; - size_t numberOfBytes = m_maxBlocks*m_blockSize; - const byte *ptr = GetContigousBlocks(numberOfBytes); - memcpy(outString, ptr, numberOfBytes); - memcpy(outString+numberOfBytes, m_begin, m_size); - m_size = 0; - return size; -} - -void FilterWithBufferedInput::BlockQueue::Put(const byte *inString, size_t length) -{ - // Avoid passing NULL pointer to memcpy - if (!inString || !length) return; - - assert(m_size + length <= m_buffer.size()); - byte *end = (m_size < size_t(m_buffer.end()-m_begin)) ? m_begin + m_size : m_begin + m_size - m_buffer.size(); - size_t len = STDMIN(length, size_t(m_buffer.end()-end)); - memcpy(end, inString, len); - if (len < length) - memcpy(m_buffer, inString+len, length-len); - m_size += length; -} - -#if !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) -FilterWithBufferedInput::FilterWithBufferedInput() - : Filter(), m_firstSize(SIZE_MAX), m_blockSize(0), m_lastSize(SIZE_MAX), m_firstInputDone(false) -{ -} -#endif - -FilterWithBufferedInput::FilterWithBufferedInput(BufferedTransformation *attachment) - : Filter(attachment), m_firstSize(SIZE_MAX), m_blockSize(0), m_lastSize(SIZE_MAX), m_firstInputDone(false) -{ -} - -FilterWithBufferedInput::FilterWithBufferedInput(size_t firstSize, size_t blockSize, size_t lastSize, BufferedTransformation *attachment) - : Filter(attachment), m_firstSize(firstSize), m_blockSize(blockSize), m_lastSize(lastSize), m_firstInputDone(false) -{ - if (m_firstSize == SIZE_MAX || m_blockSize < 1 || m_lastSize == SIZE_MAX) - throw InvalidArgument("FilterWithBufferedInput: invalid buffer size"); - - m_queue.ResetQueue(1, m_firstSize); -} - -void FilterWithBufferedInput::IsolatedInitialize(const NameValuePairs ¶meters) -{ - InitializeDerivedAndReturnNewSizes(parameters, m_firstSize, m_blockSize, m_lastSize); - if (m_firstSize == SIZE_MAX || m_blockSize < 1 || m_lastSize == SIZE_MAX) - throw InvalidArgument("FilterWithBufferedInput: invalid buffer size"); - m_queue.ResetQueue(1, m_firstSize); - m_firstInputDone = false; -} - -bool FilterWithBufferedInput::IsolatedFlush(bool hardFlush, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("FilterWithBufferedInput"); - - if (hardFlush) - ForceNextPut(); - FlushDerived(); - - return false; -} - -size_t FilterWithBufferedInput::PutMaybeModifiable(byte *inString, size_t length, int messageEnd, bool blocking, bool modifiable) -{ - if (!blocking) - throw BlockingInputOnly("FilterWithBufferedInput"); - - if (length != 0) - { - size_t newLength = m_queue.CurrentSize() + length; - - if (!m_firstInputDone && newLength >= m_firstSize) - { - size_t len = m_firstSize - m_queue.CurrentSize(); - m_queue.Put(inString, len); - FirstPut(m_queue.GetContigousBlocks(m_firstSize)); - assert(m_queue.CurrentSize() == 0); - m_queue.ResetQueue(m_blockSize, (2*m_blockSize+m_lastSize-2)/m_blockSize); - - inString += len; - newLength -= m_firstSize; - m_firstInputDone = true; - } - - if (m_firstInputDone) - { - if (m_blockSize == 1) - { - while (newLength > m_lastSize && m_queue.CurrentSize() > 0) - { - size_t len = newLength - m_lastSize; - byte *ptr = m_queue.GetContigousBlocks(len); - NextPutModifiable(ptr, len); - newLength -= len; - } - - if (newLength > m_lastSize) - { - size_t len = newLength - m_lastSize; - NextPutMaybeModifiable(inString, len, modifiable); - inString += len; - newLength -= len; - } - } - else - { - while (newLength >= m_blockSize + m_lastSize && m_queue.CurrentSize() >= m_blockSize) - { - NextPutModifiable(m_queue.GetBlock(), m_blockSize); - newLength -= m_blockSize; - } - - if (newLength >= m_blockSize + m_lastSize && m_queue.CurrentSize() > 0) - { - assert(m_queue.CurrentSize() < m_blockSize); - size_t len = m_blockSize - m_queue.CurrentSize(); - m_queue.Put(inString, len); - inString += len; - NextPutModifiable(m_queue.GetBlock(), m_blockSize); - newLength -= m_blockSize; - } - - if (newLength >= m_blockSize + m_lastSize) - { - size_t len = RoundDownToMultipleOf(newLength - m_lastSize, m_blockSize); - NextPutMaybeModifiable(inString, len, modifiable); - inString += len; - newLength -= len; - } - } - } - - m_queue.Put(inString, newLength - m_queue.CurrentSize()); - } - - if (messageEnd) - { - if (!m_firstInputDone && m_firstSize==0) - FirstPut(NULL); - - SecByteBlock temp(m_queue.CurrentSize()); - m_queue.GetAll(temp); - LastPut(temp, temp.size()); - - m_firstInputDone = false; - m_queue.ResetQueue(1, m_firstSize); - - // Cast to void to supress Coverity finding - (void)Output(1, NULL, 0, messageEnd, blocking); - } - return 0; -} - -void FilterWithBufferedInput::ForceNextPut() -{ - if (!m_firstInputDone) - return; - - if (m_blockSize > 1) - { - while (m_queue.CurrentSize() >= m_blockSize) - NextPutModifiable(m_queue.GetBlock(), m_blockSize); - } - else - { - size_t len; - while ((len = m_queue.CurrentSize()) > 0) - NextPutModifiable(m_queue.GetContigousBlocks(len), len); - } -} - -void FilterWithBufferedInput::NextPutMultiple(const byte *inString, size_t length) -{ - assert(m_blockSize > 1); // m_blockSize = 1 should always override this function - while (length > 0) - { - assert(length >= m_blockSize); - NextPutSingle(inString); - inString += m_blockSize; - length -= m_blockSize; - } -} - -// ************************************************************* - -void Redirector::Initialize(const NameValuePairs ¶meters, int propagation) -{ - m_target = parameters.GetValueWithDefault("RedirectionTargetPointer", (BufferedTransformation*)NULL); - m_behavior = parameters.GetIntValueWithDefault("RedirectionBehavior", PASS_EVERYTHING); - - if (m_target && GetPassSignals()) - m_target->Initialize(parameters, propagation); -} - -// ************************************************************* - -ProxyFilter::ProxyFilter(BufferedTransformation *filter, size_t firstSize, size_t lastSize, BufferedTransformation *attachment) - : FilterWithBufferedInput(firstSize, 1, lastSize, attachment), m_filter(filter) -{ - if (m_filter.get()) - m_filter->Attach(new OutputProxy(*this, false)); -} - -bool ProxyFilter::IsolatedFlush(bool hardFlush, bool blocking) -{ - return m_filter.get() ? m_filter->Flush(hardFlush, -1, blocking) : false; -} - -void ProxyFilter::SetFilter(Filter *filter) -{ - m_filter.reset(filter); - if (filter) - { - OutputProxy *proxy; - member_ptr temp(proxy = new OutputProxy(*this, false)); - m_filter->TransferAllTo(*proxy); - m_filter->Attach(temp.release()); - } -} - -void ProxyFilter::NextPutMultiple(const byte *s, size_t len) -{ - if (m_filter.get()) - m_filter->Put(s, len); -} - -void ProxyFilter::NextPutModifiable(byte *s, size_t len) -{ - if (m_filter.get()) - m_filter->PutModifiable(s, len); -} - -// ************************************************************* - -void RandomNumberSink::IsolatedInitialize(const NameValuePairs ¶meters) -{ - parameters.GetRequiredParameter("RandomNumberSink", "RandomNumberGeneratorPointer", m_rng); -} - -size_t RandomNumberSink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); - m_rng->IncorporateEntropy(begin, length); - return 0; -} - -size_t ArraySink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); - - // Avoid passing NULL pointer to memcpy. Using memmove due to - // Valgrind finding on overlapping buffers. - size_t copied = 0; - if (m_buf && begin) - { - copied = STDMIN(length, SaturatingSubtract(m_size, m_total)); - memmove(m_buf+m_total, begin, copied); - } - m_total += copied; - return length - copied; -} - -byte * ArraySink::CreatePutSpace(size_t &size) -{ - size = SaturatingSubtract(m_size, m_total); - return m_buf + m_total; -} - -void ArraySink::IsolatedInitialize(const NameValuePairs ¶meters) -{ - ByteArrayParameter array; - if (!parameters.GetValue(Name::OutputBuffer(), array)) - throw InvalidArgument("ArraySink: missing OutputBuffer argument"); - m_buf = array.begin(); - m_size = array.size(); -} - -size_t ArrayXorSink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); - - // Avoid passing NULL pointer to xorbuf - size_t copied = 0; - if (m_buf && begin) - { - copied = STDMIN(length, SaturatingSubtract(m_size, m_total)); - xorbuf(m_buf+m_total, begin, copied); - } - m_total += copied; - return length - copied; -} - -// ************************************************************* - -StreamTransformationFilter::StreamTransformationFilter(StreamTransformation &c, BufferedTransformation *attachment, BlockPaddingScheme padding, bool allowAuthenticatedSymmetricCipher) - : FilterWithBufferedInput(attachment) - , m_cipher(c), m_padding(DEFAULT_PADDING), m_optimalBufferSize(0) -{ - assert(c.MinLastBlockSize() == 0 || c.MinLastBlockSize() > c.MandatoryBlockSize()); - - if (!allowAuthenticatedSymmetricCipher && dynamic_cast(&c) != 0) - throw InvalidArgument("StreamTransformationFilter: please use AuthenticatedEncryptionFilter and AuthenticatedDecryptionFilter for AuthenticatedSymmetricCipher"); - - IsolatedInitialize(MakeParameters(Name::BlockPaddingScheme(), padding)); -} - -size_t StreamTransformationFilter::LastBlockSize(StreamTransformation &c, BlockPaddingScheme padding) -{ - if (c.MinLastBlockSize() > 0) - return c.MinLastBlockSize(); - else if (c.MandatoryBlockSize() > 1 && !c.IsForwardTransformation() && padding != NO_PADDING && padding != ZEROS_PADDING) - return c.MandatoryBlockSize(); - else - return 0; -} - -void StreamTransformationFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) -{ - BlockPaddingScheme padding = parameters.GetValueWithDefault(Name::BlockPaddingScheme(), DEFAULT_PADDING); - bool isBlockCipher = (m_cipher.MandatoryBlockSize() > 1 && m_cipher.MinLastBlockSize() == 0); - - if (padding == DEFAULT_PADDING) - m_padding = isBlockCipher ? PKCS_PADDING : NO_PADDING; - else - m_padding = padding; - - if (!isBlockCipher && (m_padding == PKCS_PADDING || m_padding == ONE_AND_ZEROS_PADDING)) - throw InvalidArgument("StreamTransformationFilter: PKCS_PADDING and ONE_AND_ZEROS_PADDING cannot be used with " + m_cipher.AlgorithmName()); - - firstSize = 0; - blockSize = m_cipher.MandatoryBlockSize(); - lastSize = LastBlockSize(m_cipher, m_padding); -} - -void StreamTransformationFilter::FirstPut(const byte* inString) -{ - CRYPTOPP_UNUSED(inString); - m_optimalBufferSize = m_cipher.OptimalBlockSize(); - m_optimalBufferSize = (unsigned int)STDMAX(m_optimalBufferSize, RoundDownToMultipleOf(4096U, m_optimalBufferSize)); -} - -void StreamTransformationFilter::NextPutMultiple(const byte *inString, size_t length) -{ - if (!length) - return; - - size_t s = m_cipher.MandatoryBlockSize(); - - do - { - size_t len = m_optimalBufferSize; - byte *space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, s, length, len); - if (len < length) - { - if (len == m_optimalBufferSize) - len -= m_cipher.GetOptimalBlockSizeUsed(); - len = RoundDownToMultipleOf(len, s); - } - else - len = length; - m_cipher.ProcessString(space, inString, len); - AttachedTransformation()->PutModifiable(space, len); - inString += len; - length -= len; - } - while (length > 0); -} - -void StreamTransformationFilter::NextPutModifiable(byte *inString, size_t length) -{ - m_cipher.ProcessString(inString, length); - AttachedTransformation()->PutModifiable(inString, length); -} - -void StreamTransformationFilter::LastPut(const byte *inString, size_t length) -{ - byte *space = NULL; - - switch (m_padding) - { - case NO_PADDING: - case ZEROS_PADDING: - if (length > 0) - { - size_t minLastBlockSize = m_cipher.MinLastBlockSize(); - bool isForwardTransformation = m_cipher.IsForwardTransformation(); - - if (isForwardTransformation && m_padding == ZEROS_PADDING && (minLastBlockSize == 0 || length < minLastBlockSize)) - { - // do padding - size_t blockSize = STDMAX(minLastBlockSize, (size_t)m_cipher.MandatoryBlockSize()); - space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, blockSize); - if (inString) {memcpy(space, inString, length);} - memset(space + length, 0, blockSize - length); - m_cipher.ProcessLastBlock(space, space, blockSize); - AttachedTransformation()->Put(space, blockSize); - } - else - { - if (minLastBlockSize == 0) - { - if (isForwardTransformation) - throw InvalidDataFormat("StreamTransformationFilter: plaintext length is not a multiple of block size and NO_PADDING is specified"); - else - throw InvalidCiphertext("StreamTransformationFilter: ciphertext length is not a multiple of block size"); - } - - space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length, m_optimalBufferSize); - m_cipher.ProcessLastBlock(space, inString, length); - AttachedTransformation()->Put(space, length); - } - } - break; - - case PKCS_PADDING: - case ONE_AND_ZEROS_PADDING: - unsigned int s; - s = m_cipher.MandatoryBlockSize(); - assert(s > 1); - space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, s, m_optimalBufferSize); - if (m_cipher.IsForwardTransformation()) - { - assert(length < s); - if (inString) {memcpy(space, inString, length);} - if (m_padding == PKCS_PADDING) - { - assert(s < 256); - byte pad = byte(s-length); - memset(space+length, pad, s-length); - } - else - { - space[length] = 0x80; - memset(space+length+1, 0, s-length-1); - } - m_cipher.ProcessData(space, space, s); - AttachedTransformation()->Put(space, s); - } - else - { - if (length != s) - throw InvalidCiphertext("StreamTransformationFilter: ciphertext length is not a multiple of block size"); - m_cipher.ProcessData(space, inString, s); - if (m_padding == PKCS_PADDING) - { - byte pad = space[s-1]; - if (pad < 1 || pad > s || std::find_if(space+s-pad, space+s, std::bind2nd(std::not_equal_to(), pad)) != space+s) - throw InvalidCiphertext("StreamTransformationFilter: invalid PKCS #7 block padding found"); - length = s-pad; - } - else - { - while (length > 1 && space[length-1] == 0) - --length; - if (space[--length] != 0x80) - throw InvalidCiphertext("StreamTransformationFilter: invalid ones-and-zeros padding found"); - } - AttachedTransformation()->Put(space, length); - } - break; - - default: - assert(false); - } -} - -// ************************************************************* - -HashFilter::HashFilter(HashTransformation &hm, BufferedTransformation *attachment, bool putMessage, int truncatedDigestSize, const std::string &messagePutChannel, const std::string &hashPutChannel) - : m_hashModule(hm), m_putMessage(putMessage), m_digestSize(0), m_space(NULL) - , m_messagePutChannel(messagePutChannel), m_hashPutChannel(hashPutChannel) -{ - m_digestSize = truncatedDigestSize < 0 ? m_hashModule.DigestSize() : truncatedDigestSize; - Detach(attachment); -} - -void HashFilter::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_putMessage = parameters.GetValueWithDefault(Name::PutMessage(), false); - int s = parameters.GetIntValueWithDefault(Name::TruncatedDigestSize(), -1); - m_digestSize = s < 0 ? m_hashModule.DigestSize() : s; -} - -size_t HashFilter::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) -{ - FILTER_BEGIN; - if (m_putMessage) - FILTER_OUTPUT3(1, 0, inString, length, 0, m_messagePutChannel); - m_hashModule.Update(inString, length); - if (messageEnd) - { - { - size_t size; - m_space = HelpCreatePutSpace(*AttachedTransformation(), m_hashPutChannel, m_digestSize, m_digestSize, size = m_digestSize); - m_hashModule.TruncatedFinal(m_space, m_digestSize); - } - FILTER_OUTPUT3(2, 0, m_space, m_digestSize, messageEnd, m_hashPutChannel); - } - FILTER_END_NO_MESSAGE_END; -} - -// ************************************************************* - -HashVerificationFilter::HashVerificationFilter(HashTransformation &hm, BufferedTransformation *attachment, word32 flags, int truncatedDigestSize) - : FilterWithBufferedInput(attachment) - , m_hashModule(hm), m_flags(0), m_digestSize(0), m_verified(false) -{ - IsolatedInitialize(MakeParameters(Name::HashVerificationFilterFlags(), flags)(Name::TruncatedDigestSize(), truncatedDigestSize)); -} - -void HashVerificationFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) -{ - m_flags = parameters.GetValueWithDefault(Name::HashVerificationFilterFlags(), (word32)DEFAULT_FLAGS); - int s = parameters.GetIntValueWithDefault(Name::TruncatedDigestSize(), -1); - m_digestSize = s < 0 ? m_hashModule.DigestSize() : s; - m_verified = false; - firstSize = m_flags & HASH_AT_BEGIN ? m_digestSize : 0; - blockSize = 1; - lastSize = m_flags & HASH_AT_BEGIN ? 0 : m_digestSize; -} - -void HashVerificationFilter::FirstPut(const byte *inString) -{ - if (m_flags & HASH_AT_BEGIN) - { - m_expectedHash.New(m_digestSize); - if (inString) {memcpy(m_expectedHash, inString, m_expectedHash.size());} - if (m_flags & PUT_HASH) - AttachedTransformation()->Put(inString, m_expectedHash.size()); - } -} - -void HashVerificationFilter::NextPutMultiple(const byte *inString, size_t length) -{ - m_hashModule.Update(inString, length); - if (m_flags & PUT_MESSAGE) - AttachedTransformation()->Put(inString, length); -} - -void HashVerificationFilter::LastPut(const byte *inString, size_t length) -{ - if (m_flags & HASH_AT_BEGIN) - { - assert(length == 0); - m_verified = m_hashModule.TruncatedVerify(m_expectedHash, m_digestSize); - } - else - { - m_verified = (length==m_digestSize && m_hashModule.TruncatedVerify(inString, length)); - if (m_flags & PUT_HASH) - AttachedTransformation()->Put(inString, length); - } - - if (m_flags & PUT_RESULT) - AttachedTransformation()->Put(m_verified); - - if ((m_flags & THROW_EXCEPTION) && !m_verified) - throw HashVerificationFailed(); -} - -// ************************************************************* - -AuthenticatedEncryptionFilter::AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment, - bool putAAD, int truncatedDigestSize, const std::string &macChannel, BlockPaddingScheme padding) - : StreamTransformationFilter(c, attachment, padding, true) - , m_hf(c, new OutputProxy(*this, false), putAAD, truncatedDigestSize, AAD_CHANNEL, macChannel) -{ - assert(c.IsForwardTransformation()); -} - -void AuthenticatedEncryptionFilter::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_hf.IsolatedInitialize(parameters); - StreamTransformationFilter::IsolatedInitialize(parameters); -} - -byte * AuthenticatedEncryptionFilter::ChannelCreatePutSpace(const std::string &channel, size_t &size) -{ - if (channel.empty()) - return StreamTransformationFilter::CreatePutSpace(size); - - if (channel == AAD_CHANNEL) - return m_hf.CreatePutSpace(size); - - throw InvalidChannelName("AuthenticatedEncryptionFilter", channel); -} - -size_t AuthenticatedEncryptionFilter::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (channel.empty()) - return StreamTransformationFilter::Put2(begin, length, messageEnd, blocking); - - if (channel == AAD_CHANNEL) - return m_hf.Put2(begin, length, 0, blocking); - - throw InvalidChannelName("AuthenticatedEncryptionFilter", channel); -} - -void AuthenticatedEncryptionFilter::LastPut(const byte *inString, size_t length) -{ - StreamTransformationFilter::LastPut(inString, length); - m_hf.MessageEnd(); -} - -// ************************************************************* - -AuthenticatedDecryptionFilter::AuthenticatedDecryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment, word32 flags, int truncatedDigestSize, BlockPaddingScheme padding) - : FilterWithBufferedInput(attachment) - , m_hashVerifier(c, new OutputProxy(*this, false)) - , m_streamFilter(c, new OutputProxy(*this, false), padding, true) -{ - assert(!c.IsForwardTransformation() || c.IsSelfInverting()); - IsolatedInitialize(MakeParameters(Name::BlockPaddingScheme(), padding)(Name::AuthenticatedDecryptionFilterFlags(), flags)(Name::TruncatedDigestSize(), truncatedDigestSize)); -} - -void AuthenticatedDecryptionFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) -{ - word32 flags = parameters.GetValueWithDefault(Name::AuthenticatedDecryptionFilterFlags(), (word32)DEFAULT_FLAGS); - - m_hashVerifier.Initialize(CombinedNameValuePairs(parameters, MakeParameters(Name::HashVerificationFilterFlags(), flags))); - m_streamFilter.Initialize(parameters); - - firstSize = m_hashVerifier.m_firstSize; - blockSize = 1; - lastSize = m_hashVerifier.m_lastSize; -} - -byte * AuthenticatedDecryptionFilter::ChannelCreatePutSpace(const std::string &channel, size_t &size) -{ - if (channel.empty()) - return m_streamFilter.CreatePutSpace(size); - - if (channel == AAD_CHANNEL) - return m_hashVerifier.CreatePutSpace(size); - - throw InvalidChannelName("AuthenticatedDecryptionFilter", channel); -} - -size_t AuthenticatedDecryptionFilter::ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (channel.empty()) - { - if (m_lastSize > 0) - m_hashVerifier.ForceNextPut(); - return FilterWithBufferedInput::Put2(begin, length, messageEnd, blocking); - } - - if (channel == AAD_CHANNEL) - return m_hashVerifier.Put2(begin, length, 0, blocking); - - throw InvalidChannelName("AuthenticatedDecryptionFilter", channel); -} - -void AuthenticatedDecryptionFilter::FirstPut(const byte *inString) -{ - m_hashVerifier.Put(inString, m_firstSize); -} - -void AuthenticatedDecryptionFilter::NextPutMultiple(const byte *inString, size_t length) -{ - m_streamFilter.Put(inString, length); -} - -void AuthenticatedDecryptionFilter::LastPut(const byte *inString, size_t length) -{ - m_streamFilter.MessageEnd(); - m_hashVerifier.PutMessageEnd(inString, length); -} - -// ************************************************************* - -void SignerFilter::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_putMessage = parameters.GetValueWithDefault(Name::PutMessage(), false); - m_messageAccumulator.reset(m_signer.NewSignatureAccumulator(m_rng)); -} - -size_t SignerFilter::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) -{ - FILTER_BEGIN; - m_messageAccumulator->Update(inString, length); - if (m_putMessage) - FILTER_OUTPUT(1, inString, length, 0); - if (messageEnd) - { - m_buf.New(m_signer.SignatureLength()); - m_signer.Sign(m_rng, m_messageAccumulator.release(), m_buf); - FILTER_OUTPUT(2, m_buf, m_buf.size(), messageEnd); - m_messageAccumulator.reset(m_signer.NewSignatureAccumulator(m_rng)); - } - FILTER_END_NO_MESSAGE_END; -} - -SignatureVerificationFilter::SignatureVerificationFilter(const PK_Verifier &verifier, BufferedTransformation *attachment, word32 flags) - : FilterWithBufferedInput(attachment) - , m_verifier(verifier), m_flags(0), m_verified(0) -{ - IsolatedInitialize(MakeParameters(Name::SignatureVerificationFilterFlags(), flags)); -} - -void SignatureVerificationFilter::InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) -{ - m_flags = parameters.GetValueWithDefault(Name::SignatureVerificationFilterFlags(), (word32)DEFAULT_FLAGS); - m_messageAccumulator.reset(m_verifier.NewVerificationAccumulator()); - size_t size = m_verifier.SignatureLength(); - assert(size != 0); // TODO: handle recoverable signature scheme - m_verified = false; - firstSize = m_flags & SIGNATURE_AT_BEGIN ? size : 0; - blockSize = 1; - lastSize = m_flags & SIGNATURE_AT_BEGIN ? 0 : size; -} - -void SignatureVerificationFilter::FirstPut(const byte *inString) -{ - if (m_flags & SIGNATURE_AT_BEGIN) - { - if (m_verifier.SignatureUpfront()) - m_verifier.InputSignature(*m_messageAccumulator, inString, m_verifier.SignatureLength()); - else - { - m_signature.New(m_verifier.SignatureLength()); - if (inString) {memcpy(m_signature, inString, m_signature.size());} - } - - if (m_flags & PUT_SIGNATURE) - AttachedTransformation()->Put(inString, m_signature.size()); - } - else - { - assert(!m_verifier.SignatureUpfront()); - } -} - -void SignatureVerificationFilter::NextPutMultiple(const byte *inString, size_t length) -{ - m_messageAccumulator->Update(inString, length); - if (m_flags & PUT_MESSAGE) - AttachedTransformation()->Put(inString, length); -} - -void SignatureVerificationFilter::LastPut(const byte *inString, size_t length) -{ - if (m_flags & SIGNATURE_AT_BEGIN) - { - assert(length == 0); - m_verifier.InputSignature(*m_messageAccumulator, m_signature, m_signature.size()); - m_verified = m_verifier.VerifyAndRestart(*m_messageAccumulator); - } - else - { - m_verifier.InputSignature(*m_messageAccumulator, inString, length); - m_verified = m_verifier.VerifyAndRestart(*m_messageAccumulator); - if (m_flags & PUT_SIGNATURE) - AttachedTransformation()->Put(inString, length); - } - - if (m_flags & PUT_RESULT) - AttachedTransformation()->Put(m_verified); - - if ((m_flags & THROW_EXCEPTION) && !m_verified) - throw SignatureVerificationFailed(); -} - -// ************************************************************* - -size_t Source::PumpAll2(bool blocking) -{ - unsigned int messageCount = UINT_MAX; - do { - RETURN_IF_NONZERO(PumpMessages2(messageCount, blocking)); - } while(messageCount == UINT_MAX); - - return 0; -} - -bool Store::GetNextMessage() -{ - if (!m_messageEnd && !AnyRetrievable()) - { - m_messageEnd=true; - return true; - } - else - return false; -} - -unsigned int Store::CopyMessagesTo(BufferedTransformation &target, unsigned int count, const std::string &channel) const -{ - if (m_messageEnd || count == 0) - return 0; - else - { - CopyTo(target, ULONG_MAX, channel); - if (GetAutoSignalPropagation()) - target.ChannelMessageEnd(channel, GetAutoSignalPropagation()-1); - return 1; - } -} - -void StringStore::StoreInitialize(const NameValuePairs ¶meters) -{ - ConstByteArrayParameter array; - if (!parameters.GetValue(Name::InputBuffer(), array)) - throw InvalidArgument("StringStore: missing InputBuffer argument"); - m_store = array.begin(); - m_length = array.size(); - m_count = 0; -} - -size_t StringStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - lword position = 0; - size_t blockedBytes = CopyRangeTo2(target, position, transferBytes, channel, blocking); - m_count += (size_t)position; - transferBytes = position; - return blockedBytes; -} - -size_t StringStore::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - size_t i = UnsignedMin(m_length, m_count+begin); - size_t len = UnsignedMin(m_length-i, end-begin); - size_t blockedBytes = target.ChannelPut2(channel, m_store+i, len, 0, blocking); - if (!blockedBytes) - begin += len; - return blockedBytes; -} - -void RandomNumberStore::StoreInitialize(const NameValuePairs ¶meters) -{ - parameters.GetRequiredParameter("RandomNumberStore", "RandomNumberGeneratorPointer", m_rng); - int length; - parameters.GetRequiredIntParameter("RandomNumberStore", "RandomNumberStoreSize", length); - m_length = length; -} - -size_t RandomNumberStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - if (!blocking) - throw NotImplemented("RandomNumberStore: nonblocking transfer is not implemented by this object"); - - transferBytes = UnsignedMin(transferBytes, m_length - m_count); - m_rng->GenerateIntoBufferedTransformation(target, channel, transferBytes); - m_count += transferBytes; - - return 0; -} - -size_t NullStore::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - static const byte nullBytes[128] = {0}; - while (begin < end) - { - size_t len = (size_t)STDMIN(end-begin, lword(128)); - size_t blockedBytes = target.ChannelPut2(channel, nullBytes, len, 0, blocking); - if (blockedBytes) - return blockedBytes; - begin += len; - } - return 0; -} - -size_t NullStore::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - lword begin = 0; - size_t blockedBytes = NullStore::CopyRangeTo2(target, begin, transferBytes, channel, blocking); - transferBytes = begin; - m_size -= begin; - return blockedBytes; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/filters.h b/external/crypto++-5.6.3/filters.h deleted file mode 100644 index be9686697..000000000 --- a/external/crypto++-5.6.3/filters.h +++ /dev/null @@ -1,979 +0,0 @@ -// filters.h - written and placed in the public domain by Wei Dai - -//! \file filters.h -//! \brief Implementation of BufferedTransformation's attachment interface in cryptlib.h. -//! \nosubgrouping - -#ifndef CRYPTOPP_FILTERS_H -#define CRYPTOPP_FILTERS_H - -//! \file - -#include "cryptlib.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4127 4189) -#endif - -#include "cryptlib.h" -#include "simple.h" -#include "secblock.h" -#include "misc.h" -#include "smartptr.h" -#include "queue.h" -#include "algparam.h" -#include "stdcpp.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class Filter -//! \brief Implementation of BufferedTransformation's attachment interface -//! \details Filter is a cornerstone of the Pipeline trinitiy. Data flows from -//! Sources, through Filters, and then terminates in Sinks. The difference -//! between a Source and Filter is a Source \a pumps data, while a Filter does -//! not. The difference between a Filter and a Sink is a Filter allows an -//! attached transformation, while a Sink does not. -//! \details See the discussion of BufferedTransformation in cryptlib.h for -//! more details. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Filter : public BufferedTransformation, public NotCopyable -{ -public: - //! \brief Construct a Filter - //! \param attachment the filter's attached transformation - //! \details attachment can be \p NULL. - Filter(BufferedTransformation *attachment = NULL); - - //! \brief Determine if attachable - //! \returns \p true if the object allows attached transformations, \p false otherwise. - //! \note Source and Filter offer attached transformations; while Sink does not. - bool Attachable() {return true;} - - //! \brief Retrieve attached transformation - //! \returns pointer to a BufferedTransformation if there is an attached transformation, \p NULL otherwise. - BufferedTransformation *AttachedTransformation(); - - //! \brief Retrieve attached transformation - //! \returns pointer to a BufferedTransformation if there is an attached transformation, \p NULL otherwise. - const BufferedTransformation *AttachedTransformation() const; - - //! \brief Replace an attached transformation - //! \param newAttachment pointer to a new BufferedTransformation - //! \details newAttachment cab ne a single filter, a chain of filters or \p NULL. - //! Pass \p NULL to remove an existing BufferedTransformation or chain of filters - void Detach(BufferedTransformation *newAttachment = NULL); - - // See the documentation for BufferedTransformation in cryptlib.h - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - - // See the documentation for BufferedTransformation in cryptlib.h - void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1); - bool Flush(bool hardFlush, int propagation=-1, bool blocking=true); - bool MessageSeriesEnd(int propagation=-1, bool blocking=true); - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~Filter() {} -#endif - -protected: - virtual BufferedTransformation * NewDefaultAttachment() const; - void Insert(Filter *nextFilter); // insert filter after this one - - virtual bool ShouldPropagateMessageEnd() const {return true;} - virtual bool ShouldPropagateMessageSeriesEnd() const {return true;} - - void PropagateInitialize(const NameValuePairs ¶meters, int propagation); - - //! \brief Forward processed data on to attached transformation - //! \param outputSite unknown, system crash between keyboard and chair... - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one - //! \param blocking specifies whether the object should block when processing input - //! \param channel the channel to process the data - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed. - size_t Output(int outputSite, const byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL); - - //! \brief Output multiple bytes that may be modified by callee. - //! \param outputSite unknown, system crash between keyboard and chair... - //! \param inString the byte buffer to process - //! \param length the size of the string, in bytes - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one - //! \param blocking specifies whether the object should block when processing input - //! \param channel the channel to process the data - //! \returns 0 indicates all bytes were processed during the call. Non-0 indicates the - //! number of bytes that were \a not processed - size_t OutputModifiable(int outputSite, byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL); - - //! \brief Signals the end of messages to the object - //! \param outputSite unknown, system crash between keyboard and chair... - //! \param propagation the number of attached transformations the MessageEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \param channel the channel to process the data - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - bool OutputMessageEnd(int outputSite, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL); - - //! \brief Flush buffered input and/or output, with signal propagation - //! \param outputSite unknown, system crash between keyboard and chair... - //! \param hardFlush is used to indicate whether all data should be flushed - //! \param propagation the number of attached transformations the Flush() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \param channel the channel to process the data - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - //! \note Hard flushes must be used with care. It means try to process and output everything, even if - //! there may not be enough data to complete the action. For example, hard flushing a HexDecoder - //! would cause an error if you do it after inputing an odd number of hex encoded characters. - //! \note For some types of filters, like ZlibDecompressor, hard flushes can only - //! be done at "synchronization points". These synchronization points are positions in the data - //! stream that are created by hard flushes on the corresponding reverse filters, in this - //! example ZlibCompressor. This is useful when zlib compressed data is moved across a - //! network in packets and compression state is preserved across packets, as in the SSH2 protocol. - bool OutputFlush(int outputSite, bool hardFlush, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL); - - //! \brief Marks the end of a series of messages, with signal propagation - //! \param outputSite unknown, system crash between keyboard and chair... - //! \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed - //! \param blocking specifies whether the object should block when processing input - //! \param channel the channel to process the data - //! \details Each object that receives the signal will perform its processing, decrement - //! propagation, and then pass the signal on to attached transformations if the value is not 0. - //! \details propagation count includes this object. Setting propagation to 1 means this - //! object only. Setting propagation to -1 means unlimited propagation. - //! \note There should be a MessageEnd() immediately before MessageSeriesEnd(). - bool OutputMessageSeriesEnd(int outputSite, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL); - -private: - member_ptr m_attachment; - -protected: - size_t m_inputPosition; - int m_continueAt; -}; - -//! \struct FilterPutSpaceHelper - -struct CRYPTOPP_DLL FilterPutSpaceHelper -{ - // desiredSize is how much to ask target, bufferSize is how much to allocate in m_tempSpace - byte *HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t desiredSize, size_t &bufferSize) - { - assert(desiredSize >= minSize && bufferSize >= minSize); - if (m_tempSpace.size() < minSize) - { - byte *result = target.ChannelCreatePutSpace(channel, desiredSize); - if (desiredSize >= minSize) - { - bufferSize = desiredSize; - return result; - } - m_tempSpace.New(bufferSize); - } - - bufferSize = m_tempSpace.size(); - return m_tempSpace.begin(); - } - byte *HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize) - {return HelpCreatePutSpace(target, channel, minSize, minSize, minSize);} - byte *HelpCreatePutSpace(BufferedTransformation &target, const std::string &channel, size_t minSize, size_t bufferSize) - {return HelpCreatePutSpace(target, channel, minSize, minSize, bufferSize);} - SecByteBlock m_tempSpace; -}; - -//! measure how many byte and messages pass through, also serves as valve -class CRYPTOPP_DLL MeterFilter : public Bufferless -{ -public: - MeterFilter(BufferedTransformation *attachment=NULL, bool transparent=true) - : m_transparent(transparent), m_currentMessageBytes(0), m_totalBytes(0) - , m_currentSeriesMessages(0), m_totalMessages(0), m_totalMessageSeries(0) - , m_begin(NULL), m_length(0) {Detach(attachment); ResetMeter();} - - void SetTransparent(bool transparent) {m_transparent = transparent;} - void AddRangeToSkip(unsigned int message, lword position, lword size, bool sortNow = true); - void ResetMeter(); - void IsolatedInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters); ResetMeter();} - - lword GetCurrentMessageBytes() const {return m_currentMessageBytes;} - lword GetTotalBytes() {return m_totalBytes;} - unsigned int GetCurrentSeriesMessages() {return m_currentSeriesMessages;} - unsigned int GetTotalMessages() {return m_totalMessages;} - unsigned int GetTotalMessageSeries() {return m_totalMessageSeries;} - - byte * CreatePutSpace(size_t &size) - {return AttachedTransformation()->CreatePutSpace(size);} - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking); - bool IsolatedMessageSeriesEnd(bool blocking); - -private: - size_t PutMaybeModifiable(byte *inString, size_t length, int messageEnd, bool blocking, bool modifiable); - bool ShouldPropagateMessageEnd() const {return m_transparent;} - bool ShouldPropagateMessageSeriesEnd() const {return m_transparent;} - - struct MessageRange - { - inline bool operator<(const MessageRange &b) const // BCB2006 workaround: this has to be a member function - {return message < b.message || (message == b.message && position < b.position);} - unsigned int message; lword position; lword size; - }; - - bool m_transparent; - lword m_currentMessageBytes, m_totalBytes; - unsigned int m_currentSeriesMessages, m_totalMessages, m_totalMessageSeries; - std::deque m_rangesToSkip; - byte *m_begin; - size_t m_length; -}; - -//! _ -class CRYPTOPP_DLL TransparentFilter : public MeterFilter -{ -public: - TransparentFilter(BufferedTransformation *attachment=NULL) : MeterFilter(attachment, true) {} -}; - -//! _ -class CRYPTOPP_DLL OpaqueFilter : public MeterFilter -{ -public: - OpaqueFilter(BufferedTransformation *attachment=NULL) : MeterFilter(attachment, false) {} -}; - -/*! FilterWithBufferedInput divides up the input stream into - a first block, a number of middle blocks, and a last block. - First and last blocks are optional, and middle blocks may - be a stream instead (i.e. blockSize == 1). -*/ -class CRYPTOPP_DLL FilterWithBufferedInput : public Filter -{ -public: - -#if !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) - //! default FilterWithBufferedInput for temporaries - FilterWithBufferedInput(); -#endif - - //! construct a FilterWithBufferedInput with an attached transformation - FilterWithBufferedInput(BufferedTransformation *attachment); - //! firstSize and lastSize may be 0, blockSize must be at least 1 - FilterWithBufferedInput(size_t firstSize, size_t blockSize, size_t lastSize, BufferedTransformation *attachment); - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - { - return PutMaybeModifiable(const_cast(inString), length, messageEnd, blocking, false); - } - size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking) - { - return PutMaybeModifiable(inString, length, messageEnd, blocking, true); - } - /*! calls ForceNextPut() if hardFlush is true */ - bool IsolatedFlush(bool hardFlush, bool blocking); - - /*! The input buffer may contain more than blockSize bytes if lastSize != 0. - ForceNextPut() forces a call to NextPut() if this is the case. - */ - void ForceNextPut(); - -protected: - bool DidFirstPut() {return m_firstInputDone;} - - virtual void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize) - {CRYPTOPP_UNUSED(parameters); CRYPTOPP_UNUSED(firstSize); CRYPTOPP_UNUSED(blockSize); CRYPTOPP_UNUSED(lastSize); InitializeDerived(parameters);} - virtual void InitializeDerived(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters);} - // FirstPut() is called if (firstSize != 0 and totalLength >= firstSize) - // or (firstSize == 0 and (totalLength > 0 or a MessageEnd() is received)) - virtual void FirstPut(const byte *inString) =0; - // NextPut() is called if totalLength >= firstSize+blockSize+lastSize - virtual void NextPutSingle(const byte *inString) - {CRYPTOPP_UNUSED(inString); assert(false);} - // Same as NextPut() except length can be a multiple of blockSize - // Either NextPut() or NextPutMultiple() must be overriden - virtual void NextPutMultiple(const byte *inString, size_t length); - // Same as NextPutMultiple(), but inString can be modified - virtual void NextPutModifiable(byte *inString, size_t length) - {NextPutMultiple(inString, length);} - // LastPut() is always called - // if totalLength < firstSize then length == totalLength - // else if totalLength <= firstSize+lastSize then length == totalLength-firstSize - // else lastSize <= length < lastSize+blockSize - virtual void LastPut(const byte *inString, size_t length) =0; - virtual void FlushDerived() {} - -protected: - size_t PutMaybeModifiable(byte *begin, size_t length, int messageEnd, bool blocking, bool modifiable); - void NextPutMaybeModifiable(byte *inString, size_t length, bool modifiable) - { - if (modifiable) NextPutModifiable(inString, length); - else NextPutMultiple(inString, length); - } - - // This function should no longer be used, put this here to cause a compiler error - // if someone tries to override NextPut(). - virtual int NextPut(const byte *inString, size_t length) - {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); assert(false); return 0;} - - class BlockQueue - { - public: - void ResetQueue(size_t blockSize, size_t maxBlocks); - byte *GetBlock(); - byte *GetContigousBlocks(size_t &numberOfBytes); - size_t GetAll(byte *outString); - void Put(const byte *inString, size_t length); - size_t CurrentSize() const {return m_size;} - size_t MaxSize() const {return m_buffer.size();} - - private: - SecByteBlock m_buffer; - size_t m_blockSize, m_maxBlocks, m_size; - byte *m_begin; - }; - - size_t m_firstSize, m_blockSize, m_lastSize; - bool m_firstInputDone; - BlockQueue m_queue; -}; - -//! _ -class CRYPTOPP_DLL FilterWithInputQueue : public Filter -{ -public: - FilterWithInputQueue(BufferedTransformation *attachment=NULL) : Filter(attachment) {} - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - { - if (!blocking) - throw BlockingInputOnly("FilterWithInputQueue"); - - m_inQueue.Put(inString, length); - if (messageEnd) - { - IsolatedMessageEnd(blocking); - Output(0, NULL, 0, messageEnd, blocking); - } - return 0; - } - -protected: - virtual bool IsolatedMessageEnd(bool blocking) =0; - void IsolatedInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters); m_inQueue.Clear();} - - ByteQueue m_inQueue; -}; - -//! \struct BlockPaddingSchemeDef -//! \details Padding schemes used for block ciphers. -struct BlockPaddingSchemeDef -{ - //! \enum BlockPaddingScheme - //! \details Padding schemes used for block ciphers. - //! \details DEFAULT_PADDING means PKCS_PADDING if cipher.MandatoryBlockSize() > 1 && - //! cipher.MinLastBlockSize() == 0, which holds for ECB or CBC mode. Otherwise, - //! NO_PADDING for modes like OFB, CFB, CTR, CBC-CTS. - //! \sa Block Cipher Padding for - //! additional details. - enum BlockPaddingScheme { - //! \brief No padding added to a block - NO_PADDING, - //! \brief 0's padding added to a block - ZEROS_PADDING, - //! \brief PKCS #5 padding added to a block - PKCS_PADDING, - //! \brief 1 and 0's padding added to a block - ONE_AND_ZEROS_PADDING, - //! \brief Default padding acheme - DEFAULT_PADDING - }; -}; - -//! Filter Wrapper for StreamTransformation, optionally handling padding/unpadding when needed -class CRYPTOPP_DLL StreamTransformationFilter : public FilterWithBufferedInput, public BlockPaddingSchemeDef, private FilterPutSpaceHelper -{ -public: - StreamTransformationFilter(StreamTransformation &c, BufferedTransformation *attachment = NULL, BlockPaddingScheme padding = DEFAULT_PADDING, bool allowAuthenticatedSymmetricCipher = false); - - std::string AlgorithmName() const {return m_cipher.AlgorithmName();} - -protected: - void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); - void FirstPut(const byte *inString); - void NextPutMultiple(const byte *inString, size_t length); - void NextPutModifiable(byte *inString, size_t length); - void LastPut(const byte *inString, size_t length); - - static size_t LastBlockSize(StreamTransformation &c, BlockPaddingScheme padding); - - StreamTransformation &m_cipher; - BlockPaddingScheme m_padding; - unsigned int m_optimalBufferSize; -}; - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY -typedef StreamTransformationFilter StreamCipherFilter; -#endif - -//! Filter Wrapper for HashTransformation -class CRYPTOPP_DLL HashFilter : public Bufferless, private FilterPutSpaceHelper -{ -public: - HashFilter(HashTransformation &hm, BufferedTransformation *attachment = NULL, bool putMessage=false, int truncatedDigestSize=-1, const std::string &messagePutChannel=DEFAULT_CHANNEL, const std::string &hashPutChannel=DEFAULT_CHANNEL); - - std::string AlgorithmName() const {return m_hashModule.AlgorithmName();} - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - byte * CreatePutSpace(size_t &size) {return m_hashModule.CreateUpdateSpace(size);} - -private: - HashTransformation &m_hashModule; - bool m_putMessage; - unsigned int m_digestSize; - byte *m_space; - std::string m_messagePutChannel, m_hashPutChannel; -}; - -//! Filter Wrapper for HashTransformation -class CRYPTOPP_DLL HashVerificationFilter : public FilterWithBufferedInput -{ -public: - class HashVerificationFailed : public Exception - { - public: - HashVerificationFailed() - : Exception(DATA_INTEGRITY_CHECK_FAILED, "HashVerificationFilter: message hash or MAC not valid") {} - }; - - enum Flags {HASH_AT_END=0, HASH_AT_BEGIN=1, PUT_MESSAGE=2, PUT_HASH=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = HASH_AT_BEGIN | PUT_RESULT}; - HashVerificationFilter(HashTransformation &hm, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS, int truncatedDigestSize=-1); - - std::string AlgorithmName() const {return m_hashModule.AlgorithmName();} - bool GetLastResult() const {return m_verified;} - -protected: - void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); - void FirstPut(const byte *inString); - void NextPutMultiple(const byte *inString, size_t length); - void LastPut(const byte *inString, size_t length); - -private: - friend class AuthenticatedDecryptionFilter; - - HashTransformation &m_hashModule; - word32 m_flags; - unsigned int m_digestSize; - bool m_verified; - SecByteBlock m_expectedHash; -}; - -typedef HashVerificationFilter HashVerifier; // for backwards compatibility - -//! Filter wrapper for encrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpadding when needed -/*! Additional authenticated data should be given in channel "AAD". If putAAD is true, AAD will be Put() to the attached BufferedTransformation in channel "AAD". */ -class CRYPTOPP_DLL AuthenticatedEncryptionFilter : public StreamTransformationFilter -{ -public: - /*! See StreamTransformationFilter for documentation on BlockPaddingScheme */ - AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, bool putAAD=false, int truncatedDigestSize=-1, const std::string &macChannel=DEFAULT_CHANNEL, BlockPaddingScheme padding = DEFAULT_PADDING); - - void IsolatedInitialize(const NameValuePairs ¶meters); - byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); - void LastPut(const byte *inString, size_t length); - -protected: - HashFilter m_hf; -}; - -//! Filter wrapper for decrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpadding when needed -/*! Additional authenticated data should be given in channel "AAD". */ -class CRYPTOPP_DLL AuthenticatedDecryptionFilter : public FilterWithBufferedInput, public BlockPaddingSchemeDef -{ -public: - enum Flags {MAC_AT_END=0, MAC_AT_BEGIN=1, THROW_EXCEPTION=16, DEFAULT_FLAGS = THROW_EXCEPTION}; - - /*! See StreamTransformationFilter for documentation on BlockPaddingScheme */ - AuthenticatedDecryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS, int truncatedDigestSize=-1, BlockPaddingScheme padding = DEFAULT_PADDING); - - std::string AlgorithmName() const {return m_hashVerifier.AlgorithmName();} - byte * ChannelCreatePutSpace(const std::string &channel, size_t &size); - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); - bool GetLastResult() const {return m_hashVerifier.GetLastResult();} - -protected: - void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); - void FirstPut(const byte *inString); - void NextPutMultiple(const byte *inString, size_t length); - void LastPut(const byte *inString, size_t length); - - HashVerificationFilter m_hashVerifier; - StreamTransformationFilter m_streamFilter; -}; - -//! Filter Wrapper for PK_Signer -class CRYPTOPP_DLL SignerFilter : public Unflushable -{ -public: - SignerFilter(RandomNumberGenerator &rng, const PK_Signer &signer, BufferedTransformation *attachment = NULL, bool putMessage=false) - : m_rng(rng), m_signer(signer), m_messageAccumulator(signer.NewSignatureAccumulator(rng)), m_putMessage(putMessage) {Detach(attachment);} - - std::string AlgorithmName() const {return m_signer.AlgorithmName();} - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - -private: - RandomNumberGenerator &m_rng; - const PK_Signer &m_signer; - member_ptr m_messageAccumulator; - bool m_putMessage; - SecByteBlock m_buf; -}; - -//! Filter Wrapper for PK_Verifier -class CRYPTOPP_DLL SignatureVerificationFilter : public FilterWithBufferedInput -{ -public: - class SignatureVerificationFailed : public Exception - { - public: - SignatureVerificationFailed() - : Exception(DATA_INTEGRITY_CHECK_FAILED, "VerifierFilter: digital signature not valid") {} - }; - - enum Flags {SIGNATURE_AT_END=0, SIGNATURE_AT_BEGIN=1, PUT_MESSAGE=2, PUT_SIGNATURE=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = SIGNATURE_AT_BEGIN | PUT_RESULT}; - SignatureVerificationFilter(const PK_Verifier &verifier, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS); - - std::string AlgorithmName() const {return m_verifier.AlgorithmName();} - - bool GetLastResult() const {return m_verified;} - -protected: - void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize); - void FirstPut(const byte *inString); - void NextPutMultiple(const byte *inString, size_t length); - void LastPut(const byte *inString, size_t length); - -private: - const PK_Verifier &m_verifier; - member_ptr m_messageAccumulator; - word32 m_flags; - SecByteBlock m_signature; - bool m_verified; -}; - -typedef SignatureVerificationFilter VerifierFilter; // for backwards compatibility - -//! Redirect input to another BufferedTransformation without owning it -class CRYPTOPP_DLL Redirector : public CustomSignalPropagation -{ -public: - //! \brief Controls signal propagation behavior - enum Behavior - { - //! \brief Pass data only - DATA_ONLY = 0x00, - //! \brief Pass signals - PASS_SIGNALS = 0x01, - //! \brief Pass wait events - PASS_WAIT_OBJECTS = 0x02, - //! \brief Pass everything - //! \details PASS_EVERYTHING is default - PASS_EVERYTHING = PASS_SIGNALS | PASS_WAIT_OBJECTS - }; - - Redirector() : m_target(NULL), m_behavior(PASS_EVERYTHING) {} - Redirector(BufferedTransformation &target, Behavior behavior=PASS_EVERYTHING) - : m_target(&target), m_behavior(behavior) {} - - void Redirect(BufferedTransformation &target) {m_target = ⌖} - void StopRedirection() {m_target = NULL;} - - Behavior GetBehavior() {return (Behavior) m_behavior;} - void SetBehavior(Behavior behavior) {m_behavior=behavior;} - bool GetPassSignals() const {return (m_behavior & PASS_SIGNALS) != 0;} - void SetPassSignals(bool pass) { if (pass) m_behavior |= PASS_SIGNALS; else m_behavior &= ~(word32) PASS_SIGNALS; } - bool GetPassWaitObjects() const {return (m_behavior & PASS_WAIT_OBJECTS) != 0;} - void SetPassWaitObjects(bool pass) { if (pass) m_behavior |= PASS_WAIT_OBJECTS; else m_behavior &= ~(word32) PASS_WAIT_OBJECTS; } - - bool CanModifyInput() const - {return m_target ? m_target->CanModifyInput() : false;} - - void Initialize(const NameValuePairs ¶meters, int propagation); - byte * CreatePutSpace(size_t &size) - {return m_target ? m_target->CreatePutSpace(size) : (byte *)(size=0, NULL);} - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - {return m_target ? m_target->Put2(inString, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;} - bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) - {return m_target && GetPassSignals() ? m_target->Flush(hardFlush, propagation, blocking) : false;} - bool MessageSeriesEnd(int propagation=-1, bool blocking=true) - {return m_target && GetPassSignals() ? m_target->MessageSeriesEnd(propagation, blocking) : false;} - - byte * ChannelCreatePutSpace(const std::string &channel, size_t &size) - {return m_target ? m_target->ChannelCreatePutSpace(channel, size) : (byte *)(size=0, NULL);} - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) - {return m_target ? m_target->ChannelPut2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;} - size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) - {return m_target ? m_target->ChannelPutModifiable2(channel, begin, length, GetPassSignals() ? messageEnd : 0, blocking) : 0;} - bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true) - {return m_target && GetPassSignals() ? m_target->ChannelFlush(channel, completeFlush, propagation, blocking) : false;} - bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true) - {return m_target && GetPassSignals() ? m_target->ChannelMessageSeriesEnd(channel, propagation, blocking) : false;} - - unsigned int GetMaxWaitObjectCount() const - { return m_target && GetPassWaitObjects() ? m_target->GetMaxWaitObjectCount() : 0; } - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) - { if (m_target && GetPassWaitObjects()) m_target->GetWaitObjects(container, callStack); } - -private: - BufferedTransformation *m_target; - word32 m_behavior; -}; - -// Used By ProxyFilter -class CRYPTOPP_DLL OutputProxy : public CustomSignalPropagation -{ -public: - OutputProxy(BufferedTransformation &owner, bool passSignal) : m_owner(owner), m_passSignal(passSignal) {} - - bool GetPassSignal() const {return m_passSignal;} - void SetPassSignal(bool passSignal) {m_passSignal = passSignal;} - - byte * CreatePutSpace(size_t &size) - {return m_owner.AttachedTransformation()->CreatePutSpace(size);} - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - {return m_owner.AttachedTransformation()->Put2(inString, length, m_passSignal ? messageEnd : 0, blocking);} - size_t PutModifiable2(byte *begin, size_t length, int messageEnd, bool blocking) - {return m_owner.AttachedTransformation()->PutModifiable2(begin, length, m_passSignal ? messageEnd : 0, blocking);} - void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1) - {if (m_passSignal) m_owner.AttachedTransformation()->Initialize(parameters, propagation);} - bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) - {return m_passSignal ? m_owner.AttachedTransformation()->Flush(hardFlush, propagation, blocking) : false;} - bool MessageSeriesEnd(int propagation=-1, bool blocking=true) - {return m_passSignal ? m_owner.AttachedTransformation()->MessageSeriesEnd(propagation, blocking) : false;} - - byte * ChannelCreatePutSpace(const std::string &channel, size_t &size) - {return m_owner.AttachedTransformation()->ChannelCreatePutSpace(channel, size);} - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) - {return m_owner.AttachedTransformation()->ChannelPut2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);} - size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) - {return m_owner.AttachedTransformation()->ChannelPutModifiable2(channel, begin, length, m_passSignal ? messageEnd : 0, blocking);} - bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true) - {return m_passSignal ? m_owner.AttachedTransformation()->ChannelFlush(channel, completeFlush, propagation, blocking) : false;} - bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true) - {return m_passSignal ? m_owner.AttachedTransformation()->ChannelMessageSeriesEnd(channel, propagation, blocking) : false;} - -private: - BufferedTransformation &m_owner; - bool m_passSignal; -}; - -//! Base class for Filter classes that are proxies for a chain of other filters. -class CRYPTOPP_DLL ProxyFilter : public FilterWithBufferedInput -{ -public: - ProxyFilter(BufferedTransformation *filter, size_t firstSize, size_t lastSize, BufferedTransformation *attachment); - - bool IsolatedFlush(bool hardFlush, bool blocking); - - void SetFilter(Filter *filter); - void NextPutMultiple(const byte *s, size_t len); - void NextPutModifiable(byte *inString, size_t length); - -protected: - member_ptr m_filter; -}; - -//! simple proxy filter that doesn't modify the underlying filter's input or output -class CRYPTOPP_DLL SimpleProxyFilter : public ProxyFilter -{ -public: - SimpleProxyFilter(BufferedTransformation *filter, BufferedTransformation *attachment) - : ProxyFilter(filter, 0, 0, attachment) {} - - void FirstPut(const byte *) {} - void LastPut(const byte *, size_t) {m_filter->MessageEnd();} -}; - -//! proxy for the filter created by PK_Encryptor::CreateEncryptionFilter -/*! This class is here just to provide symmetry with VerifierFilter. */ -class CRYPTOPP_DLL PK_EncryptorFilter : public SimpleProxyFilter -{ -public: - PK_EncryptorFilter(RandomNumberGenerator &rng, const PK_Encryptor &encryptor, BufferedTransformation *attachment = NULL) - : SimpleProxyFilter(encryptor.CreateEncryptionFilter(rng), attachment) {} -}; - -//! proxy for the filter created by PK_Decryptor::CreateDecryptionFilter -/*! This class is here just to provide symmetry with SignerFilter. */ -class CRYPTOPP_DLL PK_DecryptorFilter : public SimpleProxyFilter -{ -public: - PK_DecryptorFilter(RandomNumberGenerator &rng, const PK_Decryptor &decryptor, BufferedTransformation *attachment = NULL) - : SimpleProxyFilter(decryptor.CreateDecryptionFilter(rng), attachment) {} -}; - -//! Append input to a string object -template -class StringSinkTemplate : public Bufferless -{ -public: - // VC60 workaround: no T::char_type - typedef typename T::traits_type::char_type char_type; - - StringSinkTemplate(T &output) - : m_output(&output) {assert(sizeof(output[0])==1);} - - void IsolatedInitialize(const NameValuePairs ¶meters) - {if (!parameters.GetValue("OutputStringPointer", m_output)) throw InvalidArgument("StringSink: OutputStringPointer not specified");} - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - { - CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); - if (length > 0) - { - typename T::size_type size = m_output->size(); - if (length < size && size + length > m_output->capacity()) - m_output->reserve(2*size); - m_output->append((const char_type *)inString, (const char_type *)inString+length); - } - return 0; - } - -private: - T *m_output; -}; - -//! Append input to an std::string -CRYPTOPP_DLL_TEMPLATE_CLASS StringSinkTemplate; -typedef StringSinkTemplate StringSink; - -//! incorporates input into RNG as additional entropy -class RandomNumberSink : public Bufferless -{ -public: - RandomNumberSink() - : m_rng(NULL) {} - - RandomNumberSink(RandomNumberGenerator &rng) - : m_rng(&rng) {} - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - -private: - RandomNumberGenerator *m_rng; -}; - -//! Copy input to a memory buffer -class CRYPTOPP_DLL ArraySink : public Bufferless -{ -public: - ArraySink(const NameValuePairs ¶meters = g_nullNameValuePairs) - : m_buf(NULL), m_size(0), m_total(0) {IsolatedInitialize(parameters);} - ArraySink(byte *buf, size_t size) - : m_buf(buf), m_size(size), m_total(0) {} - - size_t AvailableSize() {return SaturatingSubtract(m_size, m_total);} - lword TotalPutLength() {return m_total;} - - void IsolatedInitialize(const NameValuePairs ¶meters); - byte * CreatePutSpace(size_t &size); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - -protected: - byte *m_buf; - size_t m_size; - lword m_total; -}; - -//! Xor input to a memory buffer -class CRYPTOPP_DLL ArrayXorSink : public ArraySink -{ -public: - ArrayXorSink(byte *buf, size_t size) - : ArraySink(buf, size) {} - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - byte * CreatePutSpace(size_t &size) {return BufferedTransformation::CreatePutSpace(size);} -}; - -//! string-based implementation of Store interface -class StringStore : public Store -{ -public: - StringStore(const char *string = NULL) - {StoreInitialize(MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} - StringStore(const byte *string, size_t length) - {StoreInitialize(MakeParameters("InputBuffer", ConstByteArrayParameter(string, length)));} - template StringStore(const T &string) - {StoreInitialize(MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} - - CRYPTOPP_DLL size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - CRYPTOPP_DLL size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - -private: - CRYPTOPP_DLL void StoreInitialize(const NameValuePairs ¶meters); - - const byte *m_store; - size_t m_length, m_count; -}; - -//! RNG-based implementation of Source interface -class CRYPTOPP_DLL RandomNumberStore : public Store -{ -public: - RandomNumberStore() - : m_rng(NULL), m_length(0), m_count(0) {} - - RandomNumberStore(RandomNumberGenerator &rng, lword length) - : m_rng(&rng), m_length(length), m_count(0) {} - - bool AnyRetrievable() const {return MaxRetrievable() != 0;} - lword MaxRetrievable() const {return m_length-m_count;} - - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const - { - CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking); - throw NotImplemented("RandomNumberStore: CopyRangeTo2() is not supported by this store"); - } - -private: - void StoreInitialize(const NameValuePairs ¶meters); - - RandomNumberGenerator *m_rng; - lword m_length, m_count; -}; - -//! empty store -class CRYPTOPP_DLL NullStore : public Store -{ -public: - NullStore(lword size = ULONG_MAX) : m_size(size) {} - void StoreInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters);} - lword MaxRetrievable() const {return m_size;} - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - -private: - lword m_size; -}; - -//! \class Source -//! \brief Implementation of BufferedTransformation's attachment interface -//! \details Source is a cornerstone of the Pipeline trinitiy. Data flows from -//! Sources, through Filters, and then terminates in Sinks. The difference -//! between a Source and Filter is a Source \a pumps data, while a Filter does -//! not. The difference between a Filter and a Sink is a Filter allows an -//! attached transformation, while a Sink does not. -//! \details See the discussion of BufferedTransformation in cryptlib.h for -//! more details. -//! \sa Store and SourceTemplate -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Source : public InputRejecting -{ -public: - Source(BufferedTransformation *attachment = NULL) - {Source::Detach(attachment);} - - //! \name PIPELINE - //@{ - - lword Pump(lword pumpMax=size_t(SIZE_MAX)) - {Pump2(pumpMax); return pumpMax;} - unsigned int PumpMessages(unsigned int count=UINT_MAX) - {PumpMessages2(count); return count;} - void PumpAll() - {PumpAll2();} - virtual size_t Pump2(lword &byteCount, bool blocking=true) =0; - virtual size_t PumpMessages2(unsigned int &messageCount, bool blocking=true) =0; - virtual size_t PumpAll2(bool blocking=true); - virtual bool SourceExhausted() const =0; - - //@} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~Source() {} -#endif - -protected: - void SourceInitialize(bool pumpAll, const NameValuePairs ¶meters) - { - IsolatedInitialize(parameters); - if (pumpAll) - PumpAll(); - } -}; - -//! \class SourceTemplate -//! \brief Transform a Store into a Source -//! \tparam T the class or type -template -class SourceTemplate : public Source -{ -public: - SourceTemplate(BufferedTransformation *attachment) - : Source(attachment) {} - void IsolatedInitialize(const NameValuePairs ¶meters) - {m_store.IsolatedInitialize(parameters);} - size_t Pump2(lword &byteCount, bool blocking=true) - {return m_store.TransferTo2(*AttachedTransformation(), byteCount, DEFAULT_CHANNEL, blocking);} - size_t PumpMessages2(unsigned int &messageCount, bool blocking=true) - {return m_store.TransferMessagesTo2(*AttachedTransformation(), messageCount, DEFAULT_CHANNEL, blocking);} - size_t PumpAll2(bool blocking=true) - {return m_store.TransferAllTo2(*AttachedTransformation(), DEFAULT_CHANNEL, blocking);} - bool SourceExhausted() const - {return !m_store.AnyRetrievable() && !m_store.AnyMessages();} - void SetAutoSignalPropagation(int propagation) - {m_store.SetAutoSignalPropagation(propagation);} - int GetAutoSignalPropagation() const - {return m_store.GetAutoSignalPropagation();} - -protected: - T m_store; -}; - -//! \class SourceTemplate -//! \brief String-based implementation of the Source interface -class CRYPTOPP_DLL StringSource : public SourceTemplate -{ -public: - StringSource(BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) {} - //! zero terminated string as source - StringSource(const char *string, bool pumpAll, BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} - //! binary byte array as source - StringSource(const byte *string, size_t length, bool pumpAll, BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string, length)));} - //! std::string as source - StringSource(const std::string &string, bool pumpAll, BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));} -}; - -//! use the third constructor for an array source -typedef StringSource ArraySource; - -//! RNG-based implementation of Source interface -class CRYPTOPP_DLL RandomNumberSource : public SourceTemplate -{ -public: - RandomNumberSource(RandomNumberGenerator &rng, int length, bool pumpAll, BufferedTransformation *attachment = NULL) - : SourceTemplate(attachment) - {SourceInitialize(pumpAll, MakeParameters("RandomNumberGeneratorPointer", &rng)("RandomNumberStoreSize", length));} -}; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/fips140.cpp b/external/crypto++-5.6.3/fips140.cpp deleted file mode 100644 index 53151295a..000000000 --- a/external/crypto++-5.6.3/fips140.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// fips140.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "fips140.h" -#include "misc.h" -#include "trdlocal.h" // needs to be included last for cygwin - -NAMESPACE_BEGIN(CryptoPP) - -// Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during -// startup, random number generation, and key generation. These tests may affect performance. -#ifndef CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 -#define CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 0 -#endif - -#if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(THREADS_AVAILABLE)) -#error FIPS 140-2 compliance requires the availability of thread local storage. -#endif - -#if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(OS_RNG_AVAILABLE)) -#error FIPS 140-2 compliance requires the availability of OS provided RNG. -#endif - -PowerUpSelfTestStatus g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE; - -bool FIPS_140_2_ComplianceEnabled() -{ - return CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2; -} - -void SimulatePowerUpSelfTestFailure() -{ - g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED; -} - -PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus() -{ - return g_powerUpSelfTestStatus; -} - -#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 -ThreadLocalStorage & AccessPowerUpSelfTestInProgress() -{ - static ThreadLocalStorage selfTestInProgress; - return selfTestInProgress; -} -#endif - -bool PowerUpSelfTestInProgressOnThisThread() -{ -#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 - return AccessPowerUpSelfTestInProgress().GetValue() != NULL; -#else - assert(false); // should not be called - return false; -#endif -} - -void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress) -{ - CRYPTOPP_UNUSED(inProgress); -#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 - AccessPowerUpSelfTestInProgress().SetValue((void *)inProgress); -#endif -} - -void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor) -{ - CRYPTOPP_UNUSED(encryptor), CRYPTOPP_UNUSED(decryptor); -#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 - EncryptionPairwiseConsistencyTest(encryptor, decryptor); -#endif -} - -void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier) -{ - CRYPTOPP_UNUSED(signer), CRYPTOPP_UNUSED(verifier); -#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 - SignaturePairwiseConsistencyTest(signer, verifier); -#endif -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/fips140.h b/external/crypto++-5.6.3/fips140.h deleted file mode 100644 index 3a152627f..000000000 --- a/external/crypto++-5.6.3/fips140.h +++ /dev/null @@ -1,113 +0,0 @@ -// fips140.h - written and placed in the public domain by Wei Dai - -//! \file fips140.h -//! \brief Classes and functions for the FIPS 140-2 validated library -//! \details The FIPS validated library is only available on Windows as a DLL. Once compiled, -//! the library is always in FIPS mode contingent upon successful execution of -//! DoPowerUpSelfTest() or DoDllPowerUpSelfTest(). -//! \sa Visual Studio and -//! config.h on the Crypto++ wiki. - -#ifndef CRYPTOPP_FIPS140_H -#define CRYPTOPP_FIPS140_H - -#include "cryptlib.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class SelfTestFailure -//! Exception thrown when a crypto algorithm is used after a self test fails -//! \details The self tests for an algorithm are performed by Algortihm class -//! when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined. -class CRYPTOPP_DLL SelfTestFailure : public Exception -{ -public: - explicit SelfTestFailure(const std::string &s) : Exception(OTHER_ERROR, s) {} -}; - -//! \brief Determines whether the library provides FIPS validated cryptography -//! \returns true if FIPS 140-2 validated features were enabled at compile time. -//! \details true if FIPS 140-2 validated features were enabled at compile time, -//! false otherwise. -//! \note FIPS mode is enabled at compile time. A program or other module cannot -//! arbitrarily enter or exit the mode. -CRYPTOPP_DLL bool CRYPTOPP_API FIPS_140_2_ComplianceEnabled(); - -//! \brief Status of the power-up self test -enum PowerUpSelfTestStatus { - - //! \brief The self tests have not been performed. - POWER_UP_SELF_TEST_NOT_DONE, - //! \brief The self tests were executed via DoPowerUpSelfTest() or - //! DoDllPowerUpSelfTest(), but the result was failure. - POWER_UP_SELF_TEST_FAILED, - //! \brief The self tests were executed via DoPowerUpSelfTest() or - //! DoDllPowerUpSelfTest(), and the result was success. - POWER_UP_SELF_TEST_PASSED -}; - -//! \brief Performs the power-up self test -//! \param moduleFilename the fully qualified name of the module -//! \param expectedModuleMac the expected MAC of the components protected by the integrity check -//! \details Performs the power-up self test, and sets the self test status to -//! POWER_UP_SELF_TEST_PASSED or POWER_UP_SELF_TEST_FAILED. -//! \details The self tests for an algorithm are performed by the Algortihm class -//! when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined. -CRYPTOPP_DLL void CRYPTOPP_API DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac); - -//! \brief Performs the power-up self test on the DLL -//! \details Performs the power-up self test using the filename of this DLL and the -//! embedded module MAC, and sets the self test status to POWER_UP_SELF_TEST_PASSED or -//! POWER_UP_SELF_TEST_FAILED. -//! \details The self tests for an algorithm are performed by the Algortihm class -//! when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined. -CRYPTOPP_DLL void CRYPTOPP_API DoDllPowerUpSelfTest(); - -//! \brief Sets the power-up self test status to POWER_UP_SELF_TEST_FAILED -//! \details Sets the power-up self test status to POWER_UP_SELF_TEST_FAILED to simulate failure. -CRYPTOPP_DLL void CRYPTOPP_API SimulatePowerUpSelfTestFailure(); - -//! \brief Provides the current power-up self test status -//! \returns the current power-up self test status -CRYPTOPP_DLL PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus(); - -#ifndef CRYPTOPP_DOXYGEN_PROCESSING -typedef PowerUpSelfTestStatus (CRYPTOPP_API * PGetPowerUpSelfTestStatus)(); -#endif - -//! \brief Class object that calculates the MAC on the module -//! \returns the MAC for the module -CRYPTOPP_DLL MessageAuthenticationCode * CRYPTOPP_API NewIntegrityCheckingMAC(); - -//! \brief Verifies the MAC on the module -//! \param moduleFilename the fully qualified name of the module -//! \param expectedModuleMac the expected MAC of the components protected by the integrity check -//! \param pActualMac the actual MAC of the components calculated by the integrity check -//! \param pMacFileLocation the offest of the MAC in the PE/PE+ module -//! \returns true if the MAC is valid, false otherwise -CRYPTOPP_DLL bool CRYPTOPP_API IntegrityCheckModule(const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac = NULL, unsigned long *pMacFileLocation = NULL); - -#ifndef CRYPTOPP_DOXYGEN_PROCESSING -// this is used by Algorithm constructor to allow Algorithm objects to be constructed for the self test -bool PowerUpSelfTestInProgressOnThisThread(); - -void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress); - -void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier); -void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor); - -void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier); -void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor); -#endif - -//! \brief The placeholder used prior to embedding the actual MAC in the module. -//! \details After the DLL is built but before it is MAC'd, the string CRYPTOPP_DUMMY_DLL_MAC -//! is used as a placeholder for the actual MAC. A post-build step is performed which calculates -//! the MAC of the DLL and embeds it in the module. The actual MAC is written by the -//! cryptest.exe program using the mac_dll subcommand. -#define CRYPTOPP_DUMMY_DLL_MAC "MAC_51f34b8db820ae8" - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/fipsalgt.cpp b/external/crypto++-5.6.3/fipsalgt.cpp deleted file mode 100644 index c9a0cebcb..000000000 --- a/external/crypto++-5.6.3/fipsalgt.cpp +++ /dev/null @@ -1,1294 +0,0 @@ -// fipsalgt.cpp - written and placed in the public domain by Wei Dai - -// This file implements the various algorithm tests needed to pass FIPS 140 validation. -// They're preserved here (commented out) in case Crypto++ needs to be revalidated. - -#if 0 -#ifndef CRYPTOPP_IMPORTS -#define CRYPTOPP_DEFAULT_NO_DLL -#endif - -#include "dll.h" -#include "cryptlib.h" -#include "smartptr.h" -#include "filters.h" -#include "oids.h" - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -class LineBreakParser : public AutoSignaling > -{ -public: - LineBreakParser(BufferedTransformation *attachment=NULL, byte lineEnd='\n') - : m_lineEnd(lineEnd) {Detach(attachment);} - - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking) - { - if (!blocking) - throw BlockingInputOnly("LineBreakParser"); - - unsigned int i, last = 0; - for (i=0; iPut2(begin+last, i-last, GetAutoSignalPropagation(), blocking); - last = i+1; - } - } - if (last != i) - AttachedTransformation()->Put2(begin+last, i-last, 0, blocking); - - if (messageEnd && GetAutoSignalPropagation()) - { - AttachedTransformation()->MessageEnd(GetAutoSignalPropagation()-1, blocking); - AttachedTransformation()->MessageSeriesEnd(GetAutoSignalPropagation()-1, blocking); - } - - return 0; - } - -private: - byte m_lineEnd; -}; - -class TestDataParser : public Unflushable -{ -public: - enum DataType {OTHER, COUNT, KEY_T, IV, INPUT, OUTPUT}; - - TestDataParser(std::string algorithm, std::string test, std::string mode, unsigned int feedbackSize, bool encrypt, BufferedTransformation *attachment) - : m_algorithm(algorithm), m_test(test), m_mode(mode), m_feedbackSize(feedbackSize) - , m_firstLine(true), m_blankLineTransition(0) - { - Detach(attachment); - - m_typeToName[COUNT] = "COUNT"; - - m_nameToType["COUNT"] = COUNT; - m_nameToType["KEY"] = KEY_T; - m_nameToType["KEYs"] = KEY_T; - m_nameToType["key"] = KEY_T; - m_nameToType["Key"] = KEY_T; - m_nameToType["IV"] = IV; - m_nameToType["IV1"] = IV; - m_nameToType["CV"] = IV; - m_nameToType["CV1"] = IV; - m_nameToType["IB"] = IV; - m_nameToType["TEXT"] = INPUT; - m_nameToType["RESULT"] = OUTPUT; - m_nameToType["Msg"] = INPUT; - m_nameToType["Seed"] = INPUT; - m_nameToType["V"] = INPUT; - m_nameToType["DT"] = IV; - SetEncrypt(encrypt); - - if (m_algorithm == "DSA" || m_algorithm == "ECDSA") - { - if (m_test == "PKV") - m_trigger = "Qy"; - else if (m_test == "KeyPair") - m_trigger = "N"; - else if (m_test == "SigGen") - m_trigger = "Msg"; - else if (m_test == "SigVer") - m_trigger = "S"; - else if (m_test == "PQGGen") - m_trigger = "N"; - else if (m_test == "PQGVer") - m_trigger = "H"; - } - else if (m_algorithm == "HMAC") - m_trigger = "Msg"; - else if (m_algorithm == "SHA") - m_trigger = (m_test == "MONTE") ? "Seed" : "Msg"; - else if (m_algorithm == "RNG") - m_trigger = "V"; - else if (m_algorithm == "RSA") - m_trigger = (m_test == "Ver") ? "S" : "Msg"; - } - - void SetEncrypt(bool encrypt) - { - m_encrypt = encrypt; - if (encrypt) - { - m_nameToType["PLAINTEXT"] = INPUT; - m_nameToType["CIPHERTEXT"] = OUTPUT; - m_nameToType["PT"] = INPUT; - m_nameToType["CT"] = OUTPUT; - } - else - { - m_nameToType["PLAINTEXT"] = OUTPUT; - m_nameToType["CIPHERTEXT"] = INPUT; - m_nameToType["PT"] = OUTPUT; - m_nameToType["CT"] = INPUT; - } - - if (m_algorithm == "AES" || m_algorithm == "TDES") - { - if (encrypt) - { - m_trigger = "PLAINTEXT"; - m_typeToName[OUTPUT] = "CIPHERTEXT"; - } - else - { - m_trigger = "CIPHERTEXT"; - m_typeToName[OUTPUT] = "PLAINTEXT"; - } - m_count = 0; - } - } - -protected: - void OutputData(std::string &output, const std::string &key, const std::string &data) - { - output += key; - output += "= "; - output += data; - output += "\n"; - } - - void OutputData(std::string &output, const std::string &key, int data) - { - OutputData(output, key, IntToString(data)); - } - - void OutputData(std::string &output, const std::string &key, const SecByteBlock &data) - { - output += key; - output += "= "; - HexEncoder(new StringSink(output), false).Put(data, data.size()); - output += "\n"; - } - - void OutputData(std::string &output, const std::string &key, const Integer &data, int size=-1) - { - SecByteBlock s(size < 0 ? data.MinEncodedSize() : size); - data.Encode(s, s.size()); - OutputData(output, key, s); - } - - void OutputData(std::string &output, const std::string &key, const PolynomialMod2 &data, int size=-1) - { - SecByteBlock s(size < 0 ? data.MinEncodedSize() : size); - data.Encode(s, s.size()); - OutputData(output, key, s); - } - - void OutputData(std::string &output, DataType t, const std::string &data) - { - if (m_algorithm == "SKIPJACK") - { - if (m_test == "KAT") - { - if (t == OUTPUT) - output = m_line + data + "\n"; - } - else - { - if (t != COUNT) - { - output += m_typeToName[t]; - output += "="; - } - output += data; - output += t == OUTPUT ? "\n" : " "; - } - } - else if (m_algorithm == "TDES" && t == KEY_T && m_typeToName[KEY_T].empty()) - { - output += "KEY1 = "; - output += data.substr(0, 16); - output += "\nKEY2 = "; - output += data.size() > 16 ? data.substr(16, 16) : data.substr(0, 16); - output += "\nKEY3 = "; - output += data.size() > 32 ? data.substr(32, 16) : data.substr(0, 16); - output += "\n"; - } - else - { - output += m_typeToName[t]; - output += " = "; - output += data; - output += "\n"; - } - } - - void OutputData(std::string &output, DataType t, int i) - { - OutputData(output, t, IntToString(i)); - } - - void OutputData(std::string &output, DataType t, const SecByteBlock &data) - { - std::string hexData; - StringSource(data.begin(), data.size(), true, new HexEncoder(new StringSink(hexData), false)); - OutputData(output, t, hexData); - } - - void OutputGivenData(std::string &output, DataType t, bool optional = false) - { - if (m_data.find(m_typeToName[t]) == m_data.end()) - { - if (optional) - return; - throw Exception(Exception::OTHER_ERROR, "TestDataParser: key not found: " + m_typeToName[t]); - } - - OutputData(output, t, m_data[m_typeToName[t]]); - } - - template - BlockCipher * NewBT(T *) - { - if (!m_encrypt && (m_mode == "ECB" || m_mode == "CBC")) - return new typename T::Decryption; - else - return new typename T::Encryption; - } - - template - SymmetricCipher * NewMode(T *, BlockCipher &bt, const byte *iv) - { - if (!m_encrypt) - return new typename T::Decryption(bt, iv, m_feedbackSize/8); - else - return new typename T::Encryption(bt, iv, m_feedbackSize/8); - } - - static inline void Xor(SecByteBlock &z, const SecByteBlock &x, const SecByteBlock &y) - { - assert(x.size() == y.size()); - z.resize(x.size()); - xorbuf(z, x, y, x.size()); - } - - SecByteBlock UpdateKey(SecByteBlock key, const SecByteBlock *text) - { - unsigned int innerCount = (m_algorithm == "AES") ? 1000 : 10000; - int keySize = key.size(), blockSize = text[0].size(); - SecByteBlock x(keySize); - for (int k=0; k - void EC_KeyPair(string &output, int n, const OID &oid) - { - DL_GroupParameters_EC params(oid); - for (int i=0; i priv; - DL_PublicKey_EC pub; - priv.Initialize(m_rng, params); - priv.MakePublicKey(pub); - - OutputData(output, "d ", priv.GetPrivateExponent()); - OutputData(output, "Qx ", pub.GetPublicElement().x, params.GetCurve().GetField().MaxElementByteLength()); - OutputData(output, "Qy ", pub.GetPublicElement().y, params.GetCurve().GetField().MaxElementByteLength()); - } - } - - template - void EC_SigGen(string &output, const OID &oid) - { - DL_GroupParameters_EC params(oid); - typename ECDSA::PrivateKey priv; - typename ECDSA::PublicKey pub; - priv.Initialize(m_rng, params); - priv.MakePublicKey(pub); - - typename ECDSA::Signer signer(priv); - SecByteBlock sig(signer.SignatureLength()); - StringSource(m_data["Msg"], true, new HexDecoder(new SignerFilter(m_rng, signer, new ArraySink(sig, sig.size())))); - SecByteBlock R(sig, sig.size()/2), S(sig+sig.size()/2, sig.size()/2); - - OutputData(output, "Qx ", pub.GetPublicElement().x, params.GetCurve().GetField().MaxElementByteLength()); - OutputData(output, "Qy ", pub.GetPublicElement().y, params.GetCurve().GetField().MaxElementByteLength()); - OutputData(output, "R ", R); - OutputData(output, "S ", S); - } - - template - void EC_SigVer(string &output, const OID &oid) - { - SecByteBlock x(DecodeHex(m_data["Qx"])); - SecByteBlock y(DecodeHex(m_data["Qy"])); - Integer r((m_data["R"]+"h").c_str()); - Integer s((m_data["S"]+"h").c_str()); - - typename EC::FieldElement Qx(x, x.size()); - typename EC::FieldElement Qy(y, y.size()); - typename EC::Element Q(Qx, Qy); - - DL_GroupParameters_EC params(oid); - typename ECDSA::PublicKey pub; - pub.Initialize(params, Q); - typename ECDSA::Verifier verifier(pub); - - SecByteBlock sig(verifier.SignatureLength()); - r.Encode(sig, sig.size()/2); - s.Encode(sig+sig.size()/2, sig.size()/2); - - SignatureVerificationFilter filter(verifier); - filter.Put(sig, sig.size()); - StringSource(m_data["Msg"], true, new HexDecoder(new Redirector(filter, Redirector::DATA_ONLY))); - filter.MessageEnd(); - byte b; - filter.Get(b); - OutputData(output, "Result ", b ? "P" : "F"); - } - - template - static bool EC_PKV(RandomNumberGenerator &rng, const SecByteBlock &x, const SecByteBlock &y, const OID &oid) - { - typename EC::FieldElement Qx(x, x.size()); - typename EC::FieldElement Qy(y, y.size()); - typename EC::Element Q(Qx, Qy); - - DL_GroupParameters_EC params(oid); - typename ECDSA::PublicKey pub; - pub.Initialize(params, Q); - return pub.Validate(rng, 3); - } - - template - Result * CreateRSA2(const std::string &standard) - { - if (typeid(Result) == typeid(PK_Verifier)) - { - if (standard == "R") - return (Result *) new typename RSASS_ISO::Verifier; - else if (standard == "P") - return (Result *) new typename RSASS::Verifier; - else if (standard == "1") - return (Result *) new typename RSASS::Verifier; - } - else if (typeid(Result) == typeid(PK_Signer)) - { - if (standard == "R") - return (Result *) new typename RSASS_ISO::Signer; - else if (standard == "P") - return (Result *) new typename RSASS::Signer; - else if (standard == "1") - return (Result *) new typename RSASS::Signer; - } - - return NULL; - } - - template - Result * CreateRSA(const std::string &standard, const std::string &hash) - { - if (hash == "1") - return CreateRSA2(standard); - else if (hash == "224") - return CreateRSA2(standard); - else if (hash == "256") - return CreateRSA2(standard); - else if (hash == "384") - return CreateRSA2(standard); - else if (hash == "512") - return CreateRSA2(standard); - else - return NULL; - } - - virtual void DoTest() - { - std::string output; - - if (m_algorithm == "DSA") - { - if (m_test == "KeyPair") - { - DL_GroupParameters_DSA pqg; - int modLen = atol(m_bracketString.substr(6).c_str()); - pqg.GenerateRandomWithKeySize(m_rng, modLen); - - OutputData(output, "P ", pqg.GetModulus()); - OutputData(output, "Q ", pqg.GetSubgroupOrder()); - OutputData(output, "G ", pqg.GetSubgroupGenerator()); - - int n = atol(m_data["N"].c_str()); - for (int i=0; iPut((byte *)output.data(), output.size()); - output.resize(0); - } - } - else if (m_test == "PQGGen") - { - int n = atol(m_data["N"].c_str()); - for (int i=0; iPut((byte *)output.data(), output.size()); - output.resize(0); - } - } - else if (m_test == "SigGen") - { - std::string &encodedKey = m_data["PrivKey"]; - int modLen = atol(m_bracketString.substr(6).c_str()); - DSA::PrivateKey priv; - - if (!encodedKey.empty()) - { - StringStore s(encodedKey); - priv.BERDecode(s); - if (priv.GetGroupParameters().GetModulus().BitCount() != modLen) - encodedKey.clear(); - } - - if (encodedKey.empty()) - { - priv.Initialize(m_rng, modLen); - StringSink s(encodedKey); - priv.DEREncode(s); - OutputData(output, "P ", priv.GetGroupParameters().GetModulus()); - OutputData(output, "Q ", priv.GetGroupParameters().GetSubgroupOrder()); - OutputData(output, "G ", priv.GetGroupParameters().GetSubgroupGenerator()); - } - - DSA::Signer signer(priv); - DSA::Verifier pub(signer); - OutputData(output, "Msg ", m_data["Msg"]); - OutputData(output, "Y ", pub.GetKey().GetPublicElement()); - - SecByteBlock sig(signer.SignatureLength()); - StringSource(m_data["Msg"], true, new HexDecoder(new SignerFilter(m_rng, signer, new ArraySink(sig, sig.size())))); - SecByteBlock R(sig, sig.size()/2), S(sig+sig.size()/2, sig.size()/2); - OutputData(output, "R ", R); - OutputData(output, "S ", S); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - } - else if (m_test == "SigVer") - { - Integer p((m_data["P"] + "h").c_str()); - Integer q((m_data["Q"] + "h").c_str()); - Integer g((m_data["G"] + "h").c_str()); - Integer y((m_data["Y"] + "h").c_str()); - DSA::Verifier verifier(p, q, g, y); - - HexDecoder filter(new SignatureVerificationFilter(verifier)); - StringSource(m_data["R"], true, new Redirector(filter, Redirector::DATA_ONLY)); - StringSource(m_data["S"], true, new Redirector(filter, Redirector::DATA_ONLY)); - StringSource(m_data["Msg"], true, new Redirector(filter, Redirector::DATA_ONLY)); - filter.MessageEnd(); - byte b; - filter.Get(b); - OutputData(output, "Result ", b ? "P" : "F"); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - } - else if (m_test == "PQGVer") - { - Integer p((m_data["P"] + "h").c_str()); - Integer q((m_data["Q"] + "h").c_str()); - Integer g((m_data["G"] + "h").c_str()); - Integer h((m_data["H"] + "h").c_str()); - int c = atol(m_data["c"].c_str()); - SecByteBlock seed(m_data["Seed"].size()/2); - StringSource(m_data["Seed"], true, new HexDecoder(new ArraySink(seed, seed.size()))); - - Integer p1, q1; - bool result = DSA::GeneratePrimes(seed, seed.size()*8, c, p1, 1024, q1, true); - result = result && (p1 == p && q1 == q); - result = result && g == a_exp_b_mod_c(h, (p-1)/q, p); - - OutputData(output, "Result ", result ? "P" : "F"); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - } - - return; - } - - if (m_algorithm == "ECDSA") - { - std::map name2oid; - name2oid["P-192"] = ASN1::secp192r1(); - name2oid["P-224"] = ASN1::secp224r1(); - name2oid["P-256"] = ASN1::secp256r1(); - name2oid["P-384"] = ASN1::secp384r1(); - name2oid["P-521"] = ASN1::secp521r1(); - name2oid["K-163"] = ASN1::sect163k1(); - name2oid["K-233"] = ASN1::sect233k1(); - name2oid["K-283"] = ASN1::sect283k1(); - name2oid["K-409"] = ASN1::sect409k1(); - name2oid["K-571"] = ASN1::sect571k1(); - name2oid["B-163"] = ASN1::sect163r2(); - name2oid["B-233"] = ASN1::sect233r1(); - name2oid["B-283"] = ASN1::sect283r1(); - name2oid["B-409"] = ASN1::sect409r1(); - name2oid["B-571"] = ASN1::sect571r1(); - - if (m_test == "PKV") - { - bool pass; - if (m_bracketString[0] == 'P') - pass = EC_PKV(m_rng, DecodeHex(m_data["Qx"]), DecodeHex(m_data["Qy"]), name2oid[m_bracketString]); - else - pass = EC_PKV(m_rng, DecodeHex(m_data["Qx"]), DecodeHex(m_data["Qy"]), name2oid[m_bracketString]); - - OutputData(output, "Result ", pass ? "P" : "F"); - } - else if (m_test == "KeyPair") - { - if (m_bracketString[0] == 'P') - EC_KeyPair(output, atol(m_data["N"].c_str()), name2oid[m_bracketString]); - else - EC_KeyPair(output, atol(m_data["N"].c_str()), name2oid[m_bracketString]); - } - else if (m_test == "SigGen") - { - if (m_bracketString[0] == 'P') - EC_SigGen(output, name2oid[m_bracketString]); - else - EC_SigGen(output, name2oid[m_bracketString]); - } - else if (m_test == "SigVer") - { - if (m_bracketString[0] == 'P') - EC_SigVer(output, name2oid[m_bracketString]); - else - EC_SigVer(output, name2oid[m_bracketString]); - } - - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - return; - } - - if (m_algorithm == "RSA") - { - std::string shaAlg = m_data["SHAAlg"].substr(3); - - if (m_test == "Ver") - { - Integer n((m_data["n"] + "h").c_str()); - Integer e((m_data["e"] + "h").c_str()); - RSA::PublicKey pub; - pub.Initialize(n, e); - - member_ptr pV(CreateRSA(m_mode, shaAlg)); - pV->AccessMaterial().AssignFrom(pub); - - HexDecoder filter(new SignatureVerificationFilter(*pV)); - for (unsigned int i=m_data["S"].size(); iSignatureLength()*2; i++) - filter.Put('0'); - StringSource(m_data["S"], true, new Redirector(filter, Redirector::DATA_ONLY)); - StringSource(m_data["Msg"], true, new Redirector(filter, Redirector::DATA_ONLY)); - filter.MessageEnd(); - byte b; - filter.Get(b); - OutputData(output, "Result ", b ? "P" : "F"); - } - else - { - assert(m_test == "Gen"); - int modLen = atol(m_bracketString.substr(6).c_str()); - std::string &encodedKey = m_data["PrivKey"]; - RSA::PrivateKey priv; - - if (!encodedKey.empty()) - { - StringStore s(encodedKey); - priv.BERDecode(s); - if (priv.GetModulus().BitCount() != modLen) - encodedKey.clear(); - } - - if (encodedKey.empty()) - { - priv.Initialize(m_rng, modLen); - StringSink s(encodedKey); - priv.DEREncode(s); - OutputData(output, "n ", priv.GetModulus()); - OutputData(output, "e ", priv.GetPublicExponent(), modLen/8); - } - - member_ptr pS(CreateRSA(m_mode, shaAlg)); - pS->AccessMaterial().AssignFrom(priv); - - SecByteBlock sig(pS->SignatureLength()); - StringSource(m_data["Msg"], true, new HexDecoder(new SignerFilter(m_rng, *pS, new ArraySink(sig, sig.size())))); - OutputData(output, "SHAAlg ", m_data["SHAAlg"]); - OutputData(output, "Msg ", m_data["Msg"]); - OutputData(output, "S ", sig); - } - - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - return; - } - - if (m_algorithm == "SHA") - { - member_ptr pHF; - - if (m_mode == "1") - pHF.reset(new SHA1); - else if (m_mode == "224") - pHF.reset(new SHA224); - else if (m_mode == "256") - pHF.reset(new SHA256); - else if (m_mode == "384") - pHF.reset(new SHA384); - else if (m_mode == "512") - pHF.reset(new SHA512); - - if (m_test == "MONTE") - { - SecByteBlock seed = m_data2[INPUT]; - SecByteBlock MD[1003]; - int i,j; - - for (j=0; j<100; j++) - { - MD[0] = MD[1] = MD[2] = seed; - for (i=3; i<1003; i++) - { - SecByteBlock Mi = MD[i-3] + MD[i-2] + MD[i-1]; - MD[i].resize(pHF->DigestSize()); - pHF->CalculateDigest(MD[i], Mi, Mi.size()); - } - seed = MD[1002]; - OutputData(output, "COUNT ", j); - OutputData(output, "MD ", seed); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - } - } - else - { - SecByteBlock tag(pHF->DigestSize()); - SecByteBlock &msg(m_data2[INPUT]); - int len = atol(m_data["Len"].c_str()); - StringSource(msg.begin(), len/8, true, new HashFilter(*pHF, new ArraySink(tag, tag.size()))); - OutputData(output, "MD ", tag); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - } - return; - } - - SecByteBlock &key = m_data2[KEY_T]; - - if (m_algorithm == "TDES") - { - if (!m_data["KEY1"].empty()) - { - const std::string keys[3] = {m_data["KEY1"], m_data["KEY2"], m_data["KEY3"]}; - key.resize(24); - HexDecoder hexDec(new ArraySink(key, key.size())); - for (int i=0; i<3; i++) - hexDec.Put((byte *)keys[i].data(), keys[i].size()); - - if (keys[0] == keys[2]) - { - if (keys[0] == keys[1]) - key.resize(8); - else - key.resize(16); - } - else - key.resize(24); - } - } - - if (m_algorithm == "RNG") - { - key.resize(24); - StringSource(m_data["Key1"] + m_data["Key2"] + m_data["Key3"], true, new HexDecoder(new ArraySink(key, key.size()))); - - SecByteBlock seed(m_data2[INPUT]), dt(m_data2[IV]), r(8); - X917RNG rng(new DES_EDE3::Encryption(key, key.size()), seed, dt); - - if (m_test == "MCT") - { - for (int i=0; i<10000; i++) - rng.GenerateBlock(r, r.size()); - } - else - { - rng.GenerateBlock(r, r.size()); - } - - OutputData(output, "R ", r); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - return; - } - - if (m_algorithm == "HMAC") - { - member_ptr pMAC; - - if (m_bracketString == "L=20") - pMAC.reset(new HMAC); - else if (m_bracketString == "L=28") - pMAC.reset(new HMAC); - else if (m_bracketString == "L=32") - pMAC.reset(new HMAC); - else if (m_bracketString == "L=48") - pMAC.reset(new HMAC); - else if (m_bracketString == "L=64") - pMAC.reset(new HMAC); - else - throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected HMAC bracket string: " + m_bracketString); - - pMAC->SetKey(key, key.size()); - int Tlen = atol(m_data["Tlen"].c_str()); - SecByteBlock tag(Tlen); - StringSource(m_data["Msg"], true, new HexDecoder(new HashFilter(*pMAC, new ArraySink(tag, Tlen), false, Tlen))); - OutputData(output, "Mac ", tag); - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - return; - } - - member_ptr pBT; - if (m_algorithm == "DES") - pBT.reset(NewBT((DES*)0)); - else if (m_algorithm == "TDES") - { - if (key.size() == 8) - pBT.reset(NewBT((DES*)0)); - else if (key.size() == 16) - pBT.reset(NewBT((DES_EDE2*)0)); - else - pBT.reset(NewBT((DES_EDE3*)0)); - } - else if (m_algorithm == "SKIPJACK") - pBT.reset(NewBT((SKIPJACK*)0)); - else if (m_algorithm == "AES") - pBT.reset(NewBT((AES*)0)); - else - throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected algorithm: " + m_algorithm); - - if (!pBT->IsValidKeyLength(key.size())) - key.CleanNew(pBT->DefaultKeyLength()); // for Scbcvrct - pBT->SetKey(key.data(), key.size()); - - SecByteBlock &iv = m_data2[IV]; - if (iv.empty()) - iv.CleanNew(pBT->BlockSize()); - - member_ptr pCipher; - unsigned int K = m_feedbackSize; - - if (m_mode == "ECB") - pCipher.reset(NewMode((ECB_Mode_ExternalCipher*)0, *pBT, iv)); - else if (m_mode == "CBC") - pCipher.reset(NewMode((CBC_Mode_ExternalCipher*)0, *pBT, iv)); - else if (m_mode == "CFB") - pCipher.reset(NewMode((CFB_Mode_ExternalCipher*)0, *pBT, iv)); - else if (m_mode == "OFB") - pCipher.reset(NewMode((OFB_Mode_ExternalCipher*)0, *pBT, iv)); - else - throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected mode: " + m_mode); - - bool encrypt = m_encrypt; - - if (m_test == "MONTE") - { - SecByteBlock KEY[401]; - KEY[0] = key; - int keySize = key.size(); - int blockSize = pBT->BlockSize(); - - std::vector IB(10001), OB(10001), PT(10001), CT(10001), RESULT(10001), TXT(10001), CV(10001); - PT[0] = GetData("PLAINTEXT"); - CT[0] = GetData("CIPHERTEXT"); - CV[0] = IB[0] = iv; - TXT[0] = GetData("TEXT"); - - int outerCount = (m_algorithm == "AES") ? 100 : 400; - int innerCount = (m_algorithm == "AES") ? 1000 : 10000; - - for (int i=0; iSetKey(KEY[i], keySize); - - for (int j=0; jProcessBlock(IB[j], CT[j]); - PT[j+1] = CT[j]; - } - else - { - IB[j] = CT[j]; - PT[j].resize(blockSize); - pBT->ProcessBlock(IB[j], PT[j]); - CT[j+1] = PT[j]; - } - } - else if (m_mode == "OFB") - { - OB[j].resize(blockSize); - pBT->ProcessBlock(IB[j], OB[j]); - Xor(RESULT[j], OB[j], TXT[j]); - TXT[j+1] = IB[j]; - IB[j+1] = OB[j]; - } - else if (m_mode == "CBC") - { - if (encrypt) - { - Xor(IB[j], PT[j], CV[j]); - CT[j].resize(blockSize); - pBT->ProcessBlock(IB[j], CT[j]); - PT[j+1] = CV[j]; - CV[j+1] = CT[j]; - } - else - { - IB[j] = CT[j]; - OB[j].resize(blockSize); - pBT->ProcessBlock(IB[j], OB[j]); - Xor(PT[j], OB[j], CV[j]); - CV[j+1] = CT[j]; - CT[j+1] = PT[j]; - } - } - else if (m_mode == "CFB") - { - if (encrypt) - { - OB[j].resize(blockSize); - pBT->ProcessBlock(IB[j], OB[j]); - AssignLeftMostBits(CT[j], OB[j], K); - Xor(CT[j], CT[j], PT[j]); - AssignLeftMostBits(PT[j+1], IB[j], K); - IB[j+1].resize(blockSize); - memcpy(IB[j+1], IB[j]+K/8, blockSize-K/8); - memcpy(IB[j+1]+blockSize-K/8, CT[j], K/8); - } - else - { - OB[j].resize(blockSize); - pBT->ProcessBlock(IB[j], OB[j]); - AssignLeftMostBits(PT[j], OB[j], K); - Xor(PT[j], PT[j], CT[j]); - IB[j+1].resize(blockSize); - memcpy(IB[j+1], IB[j]+K/8, blockSize-K/8); - memcpy(IB[j+1]+blockSize-K/8, CT[j], K/8); - AssignLeftMostBits(CT[j+1], OB[j], K); - } - } - else - throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected mode: " + m_mode); - } - - OutputData(output, COUNT, IntToString(i)); - OutputData(output, KEY_T, KEY[i]); - if (m_mode == "CBC") - OutputData(output, IV, CV[0]); - if (m_mode == "OFB" || m_mode == "CFB") - OutputData(output, IV, IB[0]); - if (m_mode == "ECB" || m_mode == "CBC" || m_mode == "CFB") - { - if (encrypt) - { - OutputData(output, INPUT, PT[0]); - OutputData(output, OUTPUT, CT[innerCount-1]); - KEY[i+1] = UpdateKey(KEY[i], &CT[0]); - } - else - { - OutputData(output, INPUT, CT[0]); - OutputData(output, OUTPUT, PT[innerCount-1]); - KEY[i+1] = UpdateKey(KEY[i], &PT[0]); - } - PT[0] = PT[innerCount]; - IB[0] = IB[innerCount]; - CV[0] = CV[innerCount]; - CT[0] = CT[innerCount]; - } - else if (m_mode == "OFB") - { - OutputData(output, INPUT, TXT[0]); - OutputData(output, OUTPUT, RESULT[innerCount-1]); - KEY[i+1] = UpdateKey(KEY[i], &RESULT[0]); - Xor(TXT[0], TXT[0], IB[innerCount-1]); - IB[0] = OB[innerCount-1]; - } - output += "\n"; - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - } - } - else if (m_test == "MCT") - { - SecByteBlock KEY[101]; - KEY[0] = key; - int keySize = key.size(); - int blockSize = pBT->BlockSize(); - - SecByteBlock ivs[101], inputs[1001], outputs[1001]; - ivs[0] = iv; - inputs[0] = m_data2[INPUT]; - - for (int i=0; i<100; i++) - { - pCipher->SetKey(KEY[i], keySize, MakeParameters(Name::IV(), (const byte *)ivs[i])(Name::FeedbackSize(), (int)K/8, false)); - - for (int j=0; j<1000; j++) - { - outputs[j] = inputs[j]; - pCipher->ProcessString(outputs[j], outputs[j].size()); - if (K==8 && m_mode == "CFB") - { - if (j<16) - inputs[j+1].Assign(ivs[i]+j, 1); - else - inputs[j+1] = outputs[j-16]; - } - else if (m_mode == "ECB") - inputs[j+1] = outputs[j]; - else if (j == 0) - inputs[j+1] = ivs[i]; - else - inputs[j+1] = outputs[j-1]; - } - - if (m_algorithm == "AES") - OutputData(output, COUNT, m_count++); - OutputData(output, KEY_T, KEY[i]); - if (m_mode != "ECB") - OutputData(output, IV, ivs[i]); - OutputData(output, INPUT, inputs[0]); - OutputData(output, OUTPUT, outputs[999]); - output += "\n"; - AttachedTransformation()->Put((byte *)output.data(), output.size()); - output.resize(0); - - KEY[i+1] = UpdateKey(KEY[i], outputs); - ivs[i+1].CleanNew(pCipher->IVSize()); - ivs[i+1] = UpdateKey(ivs[i+1], outputs); - if (K==8 && m_mode == "CFB") - inputs[0] = outputs[999-16]; - else if (m_mode == "ECB") - inputs[0] = outputs[999]; - else - inputs[0] = outputs[998]; - } - } - else - { - assert(m_test == "KAT"); - - SecByteBlock &input = m_data2[INPUT]; - SecByteBlock result(input.size()); - member_ptr pFilter(new StreamTransformationFilter(*pCipher, new ArraySink(result, result.size()), StreamTransformationFilter::NO_PADDING)); - StringSource(input.data(), input.size(), true, pFilter.release()); - - OutputGivenData(output, COUNT, true); - OutputData(output, KEY_T, key); - OutputGivenData(output, IV, true); - OutputGivenData(output, INPUT); - OutputData(output, OUTPUT, result); - output += "\n"; - AttachedTransformation()->Put((byte *)output.data(), output.size()); - } - } - - std::vector Tokenize(const std::string &line) - { - std::vector result; - std::string s; - for (unsigned int i=0; i") - { - assert(m_test == "sha"); - m_bracketString = m_line.substr(2, m_line.size()-4); - m_line = m_line.substr(0, 13) + "Hashes") - copyLine = true; - - if (m_line == "Put((byte *)m_line.data(), m_line.size(), blocking); - return false; - } - - std::vector tokens = Tokenize(m_line); - - if (m_algorithm == "DSA" && m_test == "sha") - { - for (unsigned int i = 0; i < tokens.size(); i++) - { - if (tokens[i] == "^") - DoTest(); - else if (tokens[i] != "") - m_compactString.push_back(atol(tokens[i].c_str())); - } - } - else - { - if (!m_line.empty() && ((m_algorithm == "RSA" && m_test != "Gen") || m_algorithm == "RNG" || m_algorithm == "HMAC" || m_algorithm == "SHA" || (m_algorithm == "ECDSA" && m_test != "KeyPair") || (m_algorithm == "DSA" && (m_test == "PQGVer" || m_test == "SigVer")))) - { - // copy input to output - std::string output = m_line + '\n'; - AttachedTransformation()->Put((byte *)output.data(), output.size()); - } - - for (unsigned int i = 0; i < tokens.size(); i++) - { - if (m_firstLine && m_algorithm != "DSA") - { - if (tokens[i] == "Encrypt" || tokens[i] == "OFB") - SetEncrypt(true); - else if (tokens[i] == "Decrypt") - SetEncrypt(false); - else if (tokens[i] == "Modes") - m_test = "MONTE"; - } - else - { - if (tokens[i] != "=") - continue; - - if (i == 0) - throw Exception(Exception::OTHER_ERROR, "TestDataParser: unexpected data: " + m_line); - - const std::string &key = tokens[i-1]; - std::string &data = m_data[key]; - data = (tokens.size() > i+1) ? tokens[i+1] : ""; - DataType t = m_nameToType[key]; - m_typeToName[t] = key; - m_data2[t] = DecodeHex(data); - - if (key == m_trigger || (t == OUTPUT && !m_data2[INPUT].empty() && !isspace(m_line[0]))) - DoTest(); - } - } - } - - m_firstLine = false; - - return false; - } - - inline const SecByteBlock & GetData(const std::string &key) - { - return m_data2[m_nameToType[key]]; - } - - static SecByteBlock DecodeHex(const std::string &data) - { - SecByteBlock data2(data.size() / 2); - StringSource(data, true, new HexDecoder(new ArraySink(data2, data2.size()))); - return data2; - } - - std::string m_algorithm, m_test, m_mode, m_line, m_bracketString, m_trigger; - unsigned int m_feedbackSize, m_blankLineTransition; - bool m_encrypt, m_firstLine; - - typedef std::map NameToTypeMap; - NameToTypeMap m_nameToType; - typedef std::map TypeToNameMap; - TypeToNameMap m_typeToName; - - typedef std::map Map; - Map m_data; // raw data - typedef std::map Map2; - Map2 m_data2; - int m_count; - - AutoSeededX917RNG m_rng; - std::vector m_compactString; -}; - -int FIPS_140_AlgorithmTest(int argc, char **argv) -{ - argc--; - argv++; - - std::string algorithm = argv[1]; - std::string pathname = argv[2]; - unsigned int i = pathname.find_last_of("\\/"); - std::string filename = pathname.substr(i == std::string::npos ? 0 : i+1); - std::string dirname = pathname.substr(0, i); - - if (algorithm == "auto") - { - string algTable[] = {"AES", "ECDSA", "DSA", "HMAC", "RNG", "RSA", "TDES", "SKIPJACK", "SHA"}; // order is important here - for (i=0; i 3) - { - std::string outDir = argv[3]; - - if (outDir == "auto") - { - if (dirname.substr(dirname.size()-3) == "req") - outDir = dirname.substr(0, dirname.size()-3) + "resp"; - } - - if (*outDir.rbegin() != '\\' && *outDir.rbegin() != '/') - outDir += '/'; - std::string outPathname = outDir + filename.substr(0, filename.size() - 3) + "rsp"; - pSink = new FileSink(outPathname.c_str(), false); - } - else - pSink = new FileSink(cout); - - FileSource(pathname.c_str(), true, new LineBreakParser(new TestDataParser(algorithm, test, mode, feedbackSize, encrypt, pSink)), false); - } - catch (...) - { - cout << "file: " << filename << endl; - throw; - } - return 0; -} - -extern int (*AdhocTest)(int argc, char *argv[]); -static int s_i = (AdhocTest = &FIPS_140_AlgorithmTest, 0); -#endif diff --git a/external/crypto++-5.6.3/fipstest.cpp b/external/crypto++-5.6.3/fipstest.cpp deleted file mode 100644 index ead310fe9..000000000 --- a/external/crypto++-5.6.3/fipstest.cpp +++ /dev/null @@ -1,615 +0,0 @@ -// fipstest.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#define CRYPTOPP_DEFAULT_NO_DLL -#include "dll.h" -#include "cryptlib.h" -#include "filters.h" -#include "smartptr.h" -#include "misc.h" - -#ifdef CRYPTOPP_WIN32_AVAILABLE -#define _WIN32_WINNT 0x0400 -#include - -#if defined(_MSC_VER) && _MSC_VER >= 1400 -#ifdef _M_IX86 -#define _CRT_DEBUGGER_HOOK _crt_debugger_hook -#else -#define _CRT_DEBUGGER_HOOK __crt_debugger_hook -#endif -extern "C" {_CRTIMP void __cdecl _CRT_DEBUGGER_HOOK(int);} -#endif -#endif - -#include - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100) -#endif - -NAMESPACE_BEGIN(CryptoPP) - -extern PowerUpSelfTestStatus g_powerUpSelfTestStatus; -SecByteBlock g_actualMac; -unsigned long g_macFileLocation = 0; - -// use a random dummy string here, to be searched/replaced later with the real MAC -static const byte s_moduleMac[CryptoPP::HMAC::DIGESTSIZE] = CRYPTOPP_DUMMY_DLL_MAC; -CRYPTOPP_COMPILE_ASSERT(sizeof(s_moduleMac) == CryptoPP::SHA1::DIGESTSIZE); - -#ifdef CRYPTOPP_WIN32_AVAILABLE -static HMODULE s_hModule = NULL; -#endif - -const byte * CRYPTOPP_API GetActualMacAndLocation(unsigned int &macSize, unsigned int &fileLocation) -{ - macSize = (unsigned int)g_actualMac.size(); - fileLocation = g_macFileLocation; - return g_actualMac; -} - -void KnownAnswerTest(RandomNumberGenerator &rng, const char *output) -{ - EqualityComparisonFilter comparison; - - RandomNumberStore(rng, strlen(output)/2).TransferAllTo(comparison, "0"); - StringSource(output, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); - - comparison.ChannelMessageSeriesEnd("0"); - comparison.ChannelMessageSeriesEnd("1"); -} - -template -void X917RNG_KnownAnswerTest( - const char *key, - const char *seed, - const char *deterministicTimeVector, - const char *output, - CIPHER *dummy = NULL) -{ - CRYPTOPP_UNUSED(dummy); -#ifdef OS_RNG_AVAILABLE - std::string decodedKey, decodedSeed, decodedDeterministicTimeVector; - StringSource(key, true, new HexDecoder(new StringSink(decodedKey))); - StringSource(seed, true, new HexDecoder(new StringSink(decodedSeed))); - StringSource(deterministicTimeVector, true, new HexDecoder(new StringSink(decodedDeterministicTimeVector))); - - AutoSeededX917RNG rng(false, false); - rng.Reseed((const byte *)decodedKey.data(), decodedKey.size(), (const byte *)decodedSeed.data(), (const byte *)decodedDeterministicTimeVector.data()); - KnownAnswerTest(rng, output); -#else - throw 0; -#endif -} - -void KnownAnswerTest(StreamTransformation &encryption, StreamTransformation &decryption, const char *plaintext, const char *ciphertext) -{ - EqualityComparisonFilter comparison; - - StringSource(plaintext, true, new HexDecoder(new StreamTransformationFilter(encryption, new ChannelSwitch(comparison, "0"), StreamTransformationFilter::NO_PADDING))); - StringSource(ciphertext, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); - - StringSource(ciphertext, true, new HexDecoder(new StreamTransformationFilter(decryption, new ChannelSwitch(comparison, "0"), StreamTransformationFilter::NO_PADDING))); - StringSource(plaintext, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); - - comparison.ChannelMessageSeriesEnd("0"); - comparison.ChannelMessageSeriesEnd("1"); -} - -template -void SymmetricEncryptionKnownAnswerTest( - const char *key, - const char *hexIV, - const char *plaintext, - const char *ecb, - const char *cbc, - const char *cfb, - const char *ofb, - const char *ctr, - CIPHER *dummy = NULL) -{ - CRYPTOPP_UNUSED(dummy); - std::string decodedKey; - StringSource(key, true, new HexDecoder(new StringSink(decodedKey))); - - typename CIPHER::Encryption encryption((const byte *)decodedKey.data(), decodedKey.size()); - typename CIPHER::Decryption decryption((const byte *)decodedKey.data(), decodedKey.size()); - - SecByteBlock iv(encryption.BlockSize()); - StringSource(hexIV, true, new HexDecoder(new ArraySink(iv, iv.size()))); - - if (ecb) - KnownAnswerTest(ECB_Mode_ExternalCipher::Encryption(encryption).Ref(), ECB_Mode_ExternalCipher::Decryption(decryption).Ref(), plaintext, ecb); - if (cbc) - KnownAnswerTest(CBC_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CBC_Mode_ExternalCipher::Decryption(decryption, iv).Ref(), plaintext, cbc); - if (cfb) - KnownAnswerTest(CFB_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CFB_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, cfb); - if (ofb) - KnownAnswerTest(OFB_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), OFB_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, ofb); - if (ctr) - KnownAnswerTest(CTR_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CTR_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, ctr); -} - -void KnownAnswerTest(HashTransformation &hash, const char *message, const char *digest) -{ - EqualityComparisonFilter comparison; - StringSource(digest, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); - StringSource(message, true, new HashFilter(hash, new ChannelSwitch(comparison, "0"))); - - comparison.ChannelMessageSeriesEnd("0"); - comparison.ChannelMessageSeriesEnd("1"); -} - -template -void SecureHashKnownAnswerTest(const char *message, const char *digest, HASH *dummy = NULL) -{ - CRYPTOPP_UNUSED(dummy); - HASH hash; - KnownAnswerTest(hash, message, digest); -} - -template -void MAC_KnownAnswerTest(const char *key, const char *message, const char *digest, MAC *dummy = NULL) -{ - CRYPTOPP_UNUSED(dummy); - std::string decodedKey; - StringSource(key, true, new HexDecoder(new StringSink(decodedKey))); - - MAC mac((const byte *)decodedKey.data(), decodedKey.size()); - KnownAnswerTest(mac, message, digest); -} - -template -void SignatureKnownAnswerTest(const char *key, const char *message, const char *signature, SCHEME *dummy = NULL) -{ - typename SCHEME::Signer signer(StringSource(key, true, new HexDecoder).Ref()); - typename SCHEME::Verifier verifier(signer); - - CRYPTOPP_UNUSED(dummy); - RandomPool rng; - EqualityComparisonFilter comparison; - - StringSource(message, true, new SignerFilter(rng, signer, new ChannelSwitch(comparison, "0"))); - StringSource(signature, true, new HexDecoder(new ChannelSwitch(comparison, "1"))); - - comparison.ChannelMessageSeriesEnd("0"); - comparison.ChannelMessageSeriesEnd("1"); - - VerifierFilter verifierFilter(verifier, NULL, VerifierFilter::SIGNATURE_AT_BEGIN | VerifierFilter::THROW_EXCEPTION); - StringSource(signature, true, new HexDecoder(new Redirector(verifierFilter, Redirector::DATA_ONLY))); - StringSource(message, true, new Redirector(verifierFilter)); -} - -void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor) -{ - try - { - RandomPool rng; - const char *testMessage ="test message"; - std::string ciphertext, decrypted; - - StringSource( - testMessage, - true, - new PK_EncryptorFilter( - rng, - encryptor, - new StringSink(ciphertext))); - - if (ciphertext == testMessage) - throw 0; - - StringSource( - ciphertext, - true, - new PK_DecryptorFilter( - rng, - decryptor, - new StringSink(decrypted))); - - if (decrypted != testMessage) - throw 0; - } - catch (...) - { - throw SelfTestFailure(encryptor.AlgorithmName() + ": pairwise consistency test failed"); - } -} - -void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier) -{ - try - { - RandomPool rng; - - StringSource( - "test message", - true, - new SignerFilter( - rng, - signer, - new VerifierFilter(verifier, NULL, VerifierFilter::THROW_EXCEPTION), - true)); - } - catch (...) - { - throw SelfTestFailure(signer.AlgorithmName() + ": pairwise consistency test failed"); - } -} - -template -void SignaturePairwiseConsistencyTest(const char *key, SCHEME *dummy = NULL) -{ - typename SCHEME::Signer signer(StringSource(key, true, new HexDecoder).Ref()); - typename SCHEME::Verifier verifier(signer); - - CRYPTOPP_UNUSED(dummy); - SignaturePairwiseConsistencyTest(signer, verifier); -} - -MessageAuthenticationCode * NewIntegrityCheckingMAC() -{ - byte key[] = {0x47, 0x1E, 0x33, 0x96, 0x65, 0xB1, 0x6A, 0xED, 0x0B, 0xF8, 0x6B, 0xFD, 0x01, 0x65, 0x05, 0xCC}; - return new HMAC(key, sizeof(key)); -} - -bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac, unsigned long *pMacFileLocation) -{ - member_ptr mac(NewIntegrityCheckingMAC()); - unsigned int macSize = mac->DigestSize(); - - SecByteBlock tempMac; - SecByteBlock &actualMac = pActualMac ? *pActualMac : tempMac; - actualMac.resize(macSize); - - unsigned long tempLocation = 0; - unsigned long &macFileLocation = pMacFileLocation ? *pMacFileLocation : tempLocation; - macFileLocation = 0; - - MeterFilter verifier(new HashFilter(*mac, new ArraySink(actualMac, actualMac.size()))); -// MeterFilter verifier(new FileSink("c:\\dt.tmp")); - std::ifstream moduleStream; - -#ifdef CRYPTOPP_WIN32_AVAILABLE - HMODULE h = NULL; - { - char moduleFilenameBuf[MAX_PATH] = ""; - if (moduleFilename == NULL) - { -#if (_MSC_VER >= 1400 && !defined(_STLPORT_VERSION)) // ifstream doesn't support wide filename on other compilers - wchar_t wideModuleFilename[MAX_PATH]; - if (GetModuleFileNameW(s_hModule, wideModuleFilename, MAX_PATH) > 0) - { - moduleStream.open(wideModuleFilename, std::ios::in | std::ios::binary); - h = GetModuleHandleW(wideModuleFilename); - } - else -#endif - { - GetModuleFileNameA(s_hModule, moduleFilenameBuf, MAX_PATH); - moduleFilename = moduleFilenameBuf; - } - } -#endif - if (moduleFilename != NULL) - { - moduleStream.open(moduleFilename, std::ios::in | std::ios::binary); -#ifdef CRYPTOPP_WIN32_AVAILABLE - h = GetModuleHandleA(moduleFilename); - moduleFilename = NULL; - } -#endif - } - - if (!moduleStream) - { -#ifdef CRYPTOPP_WIN32_AVAILABLE - OutputDebugString("Crypto++ DLL integrity check failed. Cannot open file for reading."); -#endif - return false; - } - FileStore file(moduleStream); - -#ifdef CRYPTOPP_WIN32_AVAILABLE - // try to hash from memory first - const byte *memBase = (const byte *)h; - const IMAGE_DOS_HEADER *ph = (IMAGE_DOS_HEADER *)memBase; - const IMAGE_NT_HEADERS *phnt = (IMAGE_NT_HEADERS *)(memBase + ph->e_lfanew); - const IMAGE_SECTION_HEADER *phs = IMAGE_FIRST_SECTION(phnt); - DWORD nSections = phnt->FileHeader.NumberOfSections; - size_t currentFilePos = 0; - - size_t checksumPos = (byte *)&phnt->OptionalHeader.CheckSum - memBase; - size_t checksumSize = sizeof(phnt->OptionalHeader.CheckSum); - size_t certificateTableDirectoryPos = (byte *)&phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] - memBase; - size_t certificateTableDirectorySize = sizeof(phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]); - size_t certificateTablePos = phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].VirtualAddress; - size_t certificateTableSize = phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size; - - verifier.AddRangeToSkip(0, checksumPos, checksumSize); - verifier.AddRangeToSkip(0, certificateTableDirectoryPos, certificateTableDirectorySize); - verifier.AddRangeToSkip(0, certificateTablePos, certificateTableSize); - - while (nSections--) - { - switch (phs->Characteristics) - { - default: - break; - case IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ: - case IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ: - unsigned int sectionSize = STDMIN(phs->SizeOfRawData, phs->Misc.VirtualSize); - const byte *sectionMemStart = memBase + phs->VirtualAddress; - unsigned int sectionFileStart = phs->PointerToRawData; - size_t subSectionStart = 0, nextSubSectionStart; - - do - { - const byte *subSectionMemStart = sectionMemStart + subSectionStart; - size_t subSectionFileStart = sectionFileStart + subSectionStart; - size_t subSectionSize = sectionSize - subSectionStart; - nextSubSectionStart = 0; - - unsigned int entriesToReadFromDisk[] = {IMAGE_DIRECTORY_ENTRY_IMPORT, IMAGE_DIRECTORY_ENTRY_IAT}; - for (unsigned int i=0; iOptionalHeader.DataDirectory[entriesToReadFromDisk[i]]; - const byte *entryMemStart = memBase + entry.VirtualAddress; - if (subSectionMemStart <= entryMemStart && entryMemStart < subSectionMemStart + subSectionSize) - { - subSectionSize = entryMemStart - subSectionMemStart; - nextSubSectionStart = entryMemStart - sectionMemStart + entry.Size; - } - } - -#if defined(_MSC_VER) && _MSC_VER >= 1400 - // first byte of _CRT_DEBUGGER_HOOK gets modified in memory by the debugger invisibly, so read it from file - if (IsDebuggerPresent()) - { - if (subSectionMemStart <= (byte *)&_CRT_DEBUGGER_HOOK && (byte *)&_CRT_DEBUGGER_HOOK < subSectionMemStart + subSectionSize) - { - subSectionSize = (byte *)&_CRT_DEBUGGER_HOOK - subSectionMemStart; - nextSubSectionStart = (byte *)&_CRT_DEBUGGER_HOOK - sectionMemStart + 1; - } - } -#endif - - if (subSectionMemStart <= expectedModuleMac && expectedModuleMac < subSectionMemStart + subSectionSize) - { - // found stored MAC - macFileLocation = (unsigned long)(subSectionFileStart + (expectedModuleMac - subSectionMemStart)); - verifier.AddRangeToSkip(0, macFileLocation, macSize); - } - - file.TransferTo(verifier, subSectionFileStart - currentFilePos); - verifier.Put(subSectionMemStart, subSectionSize); - file.Skip(subSectionSize); - currentFilePos = subSectionFileStart + subSectionSize; - subSectionStart = nextSubSectionStart; - } while (nextSubSectionStart != 0); - } - phs++; - } -#endif - file.TransferAllTo(verifier); - -#ifdef CRYPTOPP_WIN32_AVAILABLE - // if that fails (could be caused by debug breakpoints or DLL base relocation modifying image in memory), - // hash from disk instead - if (!VerifyBufsEqual(expectedModuleMac, actualMac, macSize)) - { - OutputDebugString("In memory integrity check failed. This may be caused by debug breakpoints or DLL relocation.\n"); - moduleStream.clear(); - moduleStream.seekg(0); - verifier.Initialize(MakeParameters(Name::OutputBuffer(), ByteArrayParameter(actualMac, (unsigned int)actualMac.size()))); -// verifier.Initialize(MakeParameters(Name::OutputFileName(), (const char *)"c:\\dt2.tmp")); - verifier.AddRangeToSkip(0, checksumPos, checksumSize); - verifier.AddRangeToSkip(0, certificateTableDirectoryPos, certificateTableDirectorySize); - verifier.AddRangeToSkip(0, certificateTablePos, certificateTableSize); - verifier.AddRangeToSkip(0, macFileLocation, macSize); - FileStore(moduleStream).TransferAllTo(verifier); - } -#endif - - if (VerifyBufsEqual(expectedModuleMac, actualMac, macSize)) - return true; - -#ifdef CRYPTOPP_WIN32_AVAILABLE - std::string hexMac; - HexEncoder(new StringSink(hexMac)).PutMessageEnd(actualMac, actualMac.size()); - OutputDebugString((("Crypto++ DLL integrity check failed. Actual MAC is: " + hexMac) + "\n").c_str()); -#endif - return false; -} - -void DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac) -{ - g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE; - SetPowerUpSelfTestInProgressOnThisThread(true); - - try - { - if (FIPS_140_2_ComplianceEnabled() || expectedModuleMac != NULL) - { - if (!IntegrityCheckModule(moduleFilename, expectedModuleMac, &g_actualMac, &g_macFileLocation)) - throw 0; // throw here so we break in the debugger, this will be caught right away - } - - // algorithm tests - - X917RNG_KnownAnswerTest( - "2b7e151628aed2a6abf7158809cf4f3c", // key - "000102030405060708090a0b0c0d0e0f", // seed - "00000000000000000000000000000001", // time vector - "D176EDD27493B0395F4D10546232B0693DC7061C03C3A554F09CECF6F6B46D945A"); // output - - SymmetricEncryptionKnownAnswerTest( - "385D7189A5C3D485E1370AA5D408082B5CCCCB5E19F2D90E", - "C141B5FCCD28DC8A", - "6E1BD7C6120947A464A6AAB293A0F89A563D8D40D3461B68", - "64EAAD4ACBB9CEAD6C7615E7C7E4792FE587D91F20C7D2F4", - "6235A461AFD312973E3B4F7AA7D23E34E03371F8E8C376C9", - "E26BA806A59B0330DE40CA38E77A3E494BE2B212F6DD624B", - "E26BA806A59B03307DE2BCC25A08BA40A8BA335F5D604C62", - "E26BA806A59B03303C62C2EFF32D3ACDD5D5F35EBCC53371"); - - SymmetricEncryptionKnownAnswerTest( - "1555E5531C3A169B2D65", - "6EC9795701F49864", - "00AFA48E9621E52E8CBDA312660184EDDB1F33D9DACDA8DA", - "DBEC73562EFCAEB56204EB8AE9557EBF77473FBB52D17CD1", - "0C7B0B74E21F99B8F2C8DF37879F6C044967F42A796DCA8B", - "79FDDA9724E36CC2E023E9A5C717A8A8A7FDA465CADCBF63", - "79FDDA9724E36CC26CACBD83C1ABC06EAF5B249BE5B1E040", - "79FDDA9724E36CC211B0AEC607B95A96BCDA318440B82F49"); - - SymmetricEncryptionKnownAnswerTest( - "2b7e151628aed2a6abf7158809cf4f3c", - "000102030405060708090a0b0c0d0e0f", - "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710", // plaintext - "3ad77bb40d7a3660a89ecaf32466ef97f5d3d58503b9699de785895a96fdbaaf43b1cd7f598ece23881b00e3ed0306887b0c785e27e8ad3f8223207104725dd4", // ecb - "7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a7", // cbc - "3b3fd92eb72dad20333449f8e83cfb4ac8a64537a0b3a93fcde3cdad9f1ce58b26751f67a3cbb140b1808cf187a4f4dfc04b05357c5d1c0eeac4c66f9ff7f2e6", // cfb - "3b3fd92eb72dad20333449f8e83cfb4a7789508d16918f03f53c52dac54ed8259740051e9c5fecf64344f7a82260edcc304c6528f659c77866a510d9c1d6ae5e", // ofb - NULL); - - SymmetricEncryptionKnownAnswerTest( - "2b7e151628aed2a6abf7158809cf4f3c", - "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", - "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710", - NULL, - NULL, - NULL, - NULL, - "874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f3009cee"); // ctr - - - SecureHashKnownAnswerTest( - "abc", - "A9993E364706816ABA3E25717850C26C9CD0D89D"); - - SecureHashKnownAnswerTest( - "abc", - "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7"); - - SecureHashKnownAnswerTest( - "abc", - "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); - - SecureHashKnownAnswerTest( - "abc", - "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7"); - - SecureHashKnownAnswerTest( - "abc", - "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); - - MAC_KnownAnswerTest >( - "303132333435363738393a3b3c3d3e3f40414243", - "Sample #2", - "0922d3405faa3d194f82a45830737d5cc6c75d24"); - - const char *keyRSA1 = - "30820150020100300d06092a864886f70d01010105000482013a3082013602010002400a66791dc6988168de7ab77419bb7fb0" - "c001c62710270075142942e19a8d8c51d053b3e3782a1de5dc5af4ebe99468170114a1dfe67cdc9a9af55d655620bbab0203010001" - "02400123c5b61ba36edb1d3679904199a89ea80c09b9122e1400c09adcf7784676d01d23356a7d44d6bd8bd50e94bfc723fa" - "87d8862b75177691c11d757692df8881022033d48445c859e52340de704bcdda065fbb4058d740bd1d67d29e9c146c11cf61" - "0220335e8408866b0fd38dc7002d3f972c67389a65d5d8306566d5c4f2a5aa52628b0220045ec90071525325d3d46db79695e9af" - "acc4523964360e02b119baa366316241022015eb327360c7b60d12e5e2d16bdcd97981d17fba6b70db13b20b436e24eada590220" - "2ca6366d72781dfa24d34a9a24cbc2ae927a9958af426563ff63fb11658a461d"; - - const char *keyRSA2 = - "30820273020100300D06092A864886F70D01010105000482025D3082025902010002818100D40AF9" - "A2B713034249E5780056D70FC7DE75D76E44565AA6A6B8ED9646F3C19F9E254D72D7DE6E49DB2264" - "0C1D05AB9E2A5F901D8F3FE1F7AE02CEE2ECCE54A40ABAE55A004692752E70725AEEE7CDEA67628A" - "82A9239B4AB660C2BC56D9F01E90CBAAB9BF0FC8E17173CEFC5709A29391A7DDF3E0B758691AAF30" - "725B292F4F020111027F18C0BA087D082C45D75D3594E0767E4820818EB35612B80CEAB8C880ACA5" - "44B6876DFFEF85A576C0D45B551AFAA1FD63209CD745DF75C5A0F0B580296EA466CD0338207E4752" - "FF4E7DB724D8AE18CE5CF4153BB94C27869FBB50E64F02546E4B02997A0B8623E64017CC770759C6" - "695DB649EEFD829D688D441BCC4E7348F1024100EF86DD7AF3F32CDE8A9F6564E43A559A0C9F8BAD" - "36CC25330548B347AC158A345631FA90F7B873C36EFFAE2F7823227A3F580B5DD18304D5932751E7" - "43E9234F024100E2A039854B55688740E32A51DF4AF88613D91A371CF8DDD95D780A89D7CF2119A9" - "54F1AC0F3DCDB2F6959926E6D9D37D8BC07A4C634DE6F16315BD5F0DAC340102407ECEEDB9903572" - "1B76909F174BA6698DCA72953D957B22C0A871C8531EDE3A1BB52984A719BC010D1CA57A555DB83F" - "6DE54CBAB932AEC652F38D497A6F3F30CF024100854F30E4FF232E6DADB2CD99926855F484255AB7" - "01FBCDCB27EC426F33A7046972AA700ADBCA008763DF87440F52F4E070531AC385B55AAC1C2AE7DD" - "8F9278F1024100C313F4AF9E4A9DE1253C21080CE524251560C111550772FD08690F13FBE658342E" - "BD2D41C9DCB12374E871B1839E26CAE252E1AE3DAAD5F1EE1F42B4D0EE7581"; - - SignatureKnownAnswerTest >( - keyRSA1, - "Everyone gets Friday off.", - "0610761F95FFD1B8F29DA34212947EC2AA0E358866A722F03CC3C41487ADC604A48FF54F5C6BEDB9FB7BD59F82D6E55D8F3174BA361B2214B2D74E8825E04E81"); - - SignatureKnownAnswerTest >( - keyRSA2, - "test", - "32F6BA41C8930DE71EE67F2627172CC539EDE04267FDE03AC295E3C50311F26C3B275D3AF513AC96" - "8EE493BAB7DA3A754661D1A7C4A0D1A2B7EE8B313AACD8CB8BFBC5C15EFB0EF15C86A9334A1E87AD" - "291EB961B5CA0E84930429B28780816AA94F96FC2367B71E2D2E4866FA966795B147F00600E5207E" - "2F189C883B37477C"); - - SignaturePairwiseConsistencyTest( - "3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF"); - - SignaturePairwiseConsistencyTest >( - "302D020100301006072A8648CE3D020106052B8104000404163014020101040F0070337065E1E196980A9D00E37211"); - - SignaturePairwiseConsistencyTest >( - "3039020100301306072A8648CE3D020106082A8648CE3D030101041F301D02010104182BB8A13C8B867010BD9471D9E81FDB01ABD0538C64D6249A"); - - SignaturePairwiseConsistencyTest >(keyRSA1); - } - catch (...) - { - g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED; - goto done; - } - - g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_PASSED; - -done: - SetPowerUpSelfTestInProgressOnThisThread(false); - return; -} - -#ifdef CRYPTOPP_WIN32_AVAILABLE - -void DoDllPowerUpSelfTest() -{ - CryptoPP::DoPowerUpSelfTest(NULL, s_moduleMac); -} - -#else - -void DoDllPowerUpSelfTest() -{ - throw NotImplemented("DoDllPowerUpSelfTest() only available on Windows"); -} - -#endif // #ifdef CRYPTOPP_WIN32_AVAILABLE - -NAMESPACE_END - -#ifdef CRYPTOPP_WIN32_AVAILABLE - -// DllMain needs to be in the global namespace -BOOL APIENTRY DllMain(HANDLE hModule, - DWORD dwReason, - LPVOID /*lpReserved*/) -{ - if (dwReason == DLL_PROCESS_ATTACH) - { - CryptoPP::s_hModule = (HMODULE)hModule; - CryptoPP::DoDllPowerUpSelfTest(); - } - return TRUE; -} - -#endif // #ifdef CRYPTOPP_WIN32_AVAILABLE - -#endif // #ifndef CRYPTOPP_IMPORTS diff --git a/external/crypto++-5.6.3/fltrimpl.h b/external/crypto++-5.6.3/fltrimpl.h deleted file mode 100644 index 8b204d84b..000000000 --- a/external/crypto++-5.6.3/fltrimpl.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef CRYPTOPP_FLTRIMPL_H -#define CRYPTOPP_FLTRIMPL_H - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4100) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-value" -#endif - -#define FILTER_BEGIN \ - switch (m_continueAt) \ - { \ - case 0: \ - m_inputPosition = 0; - -#define FILTER_END_NO_MESSAGE_END_NO_RETURN \ - break; \ - default: \ - assert(false); \ - } - -#define FILTER_END_NO_MESSAGE_END \ - FILTER_END_NO_MESSAGE_END_NO_RETURN \ - return 0; - -/* -#define FILTER_END \ - case -1: \ - if (messageEnd && Output(-1, NULL, 0, messageEnd, blocking)) \ - return 1; \ - FILTER_END_NO_MESSAGE_END -*/ - -#define FILTER_OUTPUT3(site, statement, output, length, messageEnd, channel) \ - {\ - case site: \ - statement; \ - if (Output(site, output, length, messageEnd, blocking, channel)) \ - return STDMAX(size_t(1), length-m_inputPosition);\ - } - -#define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \ - FILTER_OUTPUT3(site, statement, output, length, messageEnd, DEFAULT_CHANNEL) - -#define FILTER_OUTPUT(site, output, length, messageEnd) \ - FILTER_OUTPUT2(site, 0, output, length, messageEnd) - -#define FILTER_OUTPUT_BYTE(site, output) \ - FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0) - -#define FILTER_OUTPUT2_MODIFIABLE(site, statement, output, length, messageEnd) \ - {\ - case site: \ - statement; \ - if (OutputModifiable(site, output, length, messageEnd, blocking)) \ - return STDMAX(size_t(1), length-m_inputPosition);\ - } - -#define FILTER_OUTPUT_MODIFIABLE(site, output, length, messageEnd) \ - FILTER_OUTPUT2_MODIFIABLE(site, 0, output, length, messageEnd) - -#define FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, statement, output, length, messageEnd, modifiable) \ - {\ - case site: \ - statement; \ - if (modifiable ? OutputModifiable(site, output, length, messageEnd, blocking) : Output(site, output, length, messageEnd, blocking)) \ - return STDMAX(size_t(1), length-m_inputPosition);\ - } - -#define FILTER_OUTPUT_MAYBE_MODIFIABLE(site, output, length, messageEnd, modifiable) \ - FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, 0, output, length, messageEnd, modifiable) - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic pop -#endif - -#endif diff --git a/external/crypto++-5.6.3/gcm.cpp b/external/crypto++-5.6.3/gcm.cpp deleted file mode 100644 index 59faecab7..000000000 --- a/external/crypto++-5.6.3/gcm.cpp +++ /dev/null @@ -1,864 +0,0 @@ -// gcm.cpp - written and placed in the public domain by Wei Dai - -// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM gcm.cpp" to generate MASM code - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4189) -#endif - -#ifndef CRYPTOPP_IMPORTS -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#include "gcm.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -word16 GCM_Base::s_reductionTable[256]; -volatile bool GCM_Base::s_reductionTableInitialized = false; - -void GCM_Base::GCTR::IncrementCounterBy256() -{ - IncrementCounterByOne(m_counterArray+BlockSize()-4, 3); -} - -#if 0 -// preserved for testing -void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c) -{ - word64 Z0=0, Z1=0, V0, V1; - - typedef BlockGetAndPut Block; - Block::Get(a)(V0)(V1); - - for (int i=0; i<16; i++) - { - for (int j=0x80; j!=0; j>>=1) - { - int x = b[i] & j; - Z0 ^= x ? V0 : 0; - Z1 ^= x ? V1 : 0; - x = (int)V1 & 1; - V1 = (V1>>1) | (V0<<63); - V0 = (V0>>1) ^ (x ? W64LIT(0xe1) << 56 : 0); - } - } - Block::Put(NULL, c)(Z0)(Z1); -} - -__m128i _mm_clmulepi64_si128(const __m128i &a, const __m128i &b, int i) -{ - word64 A[1] = {ByteReverse(((word64*)&a)[i&1])}; - word64 B[1] = {ByteReverse(((word64*)&b)[i>>4])}; - - PolynomialMod2 pa((byte *)A, 8); - PolynomialMod2 pb((byte *)B, 8); - PolynomialMod2 c = pa*pb; - - __m128i output; - for (int i=0; i<16; i++) - ((byte *)&output)[i] = c.GetByte(i); - return output; -} -#endif - -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -inline static void SSE2_Xor16(byte *a, const byte *b, const byte *c) -{ -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE - *(__m128i *)a = _mm_xor_si128(*(__m128i *)b, *(__m128i *)c); -#else - asm ("movdqa %1, %%xmm0; pxor %2, %%xmm0; movdqa %%xmm0, %0;" : "=m" (a[0]) : "m"(b[0]), "m"(c[0])); -#endif -} -#endif - -inline static void Xor16(byte *a, const byte *b, const byte *c) -{ - ((word64 *)a)[0] = ((word64 *)b)[0] ^ ((word64 *)c)[0]; - ((word64 *)a)[1] = ((word64 *)b)[1] ^ ((word64 *)c)[1]; -} - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE -static CRYPTOPP_ALIGN_DATA(16) const word64 s_clmulConstants64[] = { - W64LIT(0xe100000000000000), W64LIT(0xc200000000000000), - W64LIT(0x08090a0b0c0d0e0f), W64LIT(0x0001020304050607), - W64LIT(0x0001020304050607), W64LIT(0x08090a0b0c0d0e0f)}; -static const __m128i *s_clmulConstants = (const __m128i *)s_clmulConstants64; -static const unsigned int s_clmulTableSizeInBlocks = 8; - -inline __m128i CLMUL_Reduce(__m128i c0, __m128i c1, __m128i c2, const __m128i &r) -{ - /* - The polynomial to be reduced is c0 * x^128 + c1 * x^64 + c2. c0t below refers to the most - significant half of c0 as a polynomial, which, due to GCM's bit reflection, are in the - rightmost bit positions, and the lowest byte addresses. - - c1 ^= c0t * 0xc200000000000000 - c2t ^= c0t - t = shift (c1t ^ c0b) left 1 bit - c2 ^= t * 0xe100000000000000 - c2t ^= c1b - shift c2 left 1 bit and xor in lowest bit of c1t - */ -#if 0 // MSVC 2010 workaround: see http://connect.microsoft.com/VisualStudio/feedback/details/575301 - c2 = _mm_xor_si128(c2, _mm_move_epi64(c0)); -#else - c1 = _mm_xor_si128(c1, _mm_slli_si128(c0, 8)); -#endif - c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(c0, r, 0x10)); - c0 = _mm_srli_si128(c0, 8); - c0 = _mm_xor_si128(c0, c1); - c0 = _mm_slli_epi64(c0, 1); - c0 = _mm_clmulepi64_si128(c0, r, 0); - c2 = _mm_xor_si128(c2, c0); - c2 = _mm_xor_si128(c2, _mm_srli_si128(c1, 8)); - c1 = _mm_unpacklo_epi64(c1, c2); - c1 = _mm_srli_epi64(c1, 63); - c2 = _mm_slli_epi64(c2, 1); - return _mm_xor_si128(c2, c1); -} - -inline __m128i CLMUL_GF_Mul(const __m128i &x, const __m128i &h, const __m128i &r) -{ - __m128i c0 = _mm_clmulepi64_si128(x,h,0); - __m128i c1 = _mm_xor_si128(_mm_clmulepi64_si128(x,h,1), _mm_clmulepi64_si128(x,h,0x10)); - __m128i c2 = _mm_clmulepi64_si128(x,h,0x11); - - return CLMUL_Reduce(c0, c1, c2, r); -} -#endif - -void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) -{ - BlockCipher &blockCipher = AccessBlockCipher(); - blockCipher.SetKey(userKey, keylength, params); - - if (blockCipher.BlockSize() != REQUIRED_BLOCKSIZE) - throw InvalidArgument(AlgorithmName() + ": block size of underlying block cipher is not 16"); - - int tableSize, i, j, k; - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasCLMUL()) - { - // Avoid "parameter not used" error and suppress Coverity finding - (void)params.GetIntValue(Name::TableSize(), tableSize); - tableSize = s_clmulTableSizeInBlocks * REQUIRED_BLOCKSIZE; - } - else -#endif - { - if (params.GetIntValue(Name::TableSize(), tableSize)) - tableSize = (tableSize >= 64*1024) ? 64*1024 : 2*1024; - else - tableSize = (GetTablesOption() == GCM_64K_Tables) ? 64*1024 : 2*1024; - -#if defined(_MSC_VER) && (_MSC_VER >= 1300 && _MSC_VER < 1400) - // VC 2003 workaround: compiler generates bad code for 64K tables - tableSize = 2*1024; -#endif - } - - m_buffer.resize(3*REQUIRED_BLOCKSIZE + tableSize); - byte *table = MulTable(); - byte *hashKey = HashKey(); - memset(hashKey, 0, REQUIRED_BLOCKSIZE); - blockCipher.ProcessBlock(hashKey); - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasCLMUL()) - { - const __m128i r = s_clmulConstants[0]; - __m128i h0 = _mm_shuffle_epi8(_mm_load_si128((__m128i *)hashKey), s_clmulConstants[1]); - __m128i h = h0; - - for (i=0; i Block; - Block::Get(hashKey)(V0)(V1); - - if (tableSize == 64*1024) - { - for (i=0; i<128; i++) - { - k = i%8; - Block::Put(NULL, table+(i/8)*256*16+(size_t(1)<<(11-k)))(V0)(V1); - - int x = (int)V1 & 1; - V1 = (V1>>1) | (V0<<63); - V0 = (V0>>1) ^ (x ? W64LIT(0xe1) << 56 : 0); - } - - for (i=0; i<16; i++) - { - memset(table+i*256*16, 0, 16); -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - if (HasSSE2()) - for (j=2; j<=0x80; j*=2) - for (k=1; k>1) | (V0<<63); - V0 = (V0>>1) ^ (x ? W64LIT(0xe1) << 56 : 0); - } - - for (i=0; i<4; i++) - { - memset(table+i*256, 0, 16); - memset(table+1024+i*256, 0, 16); -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - if (HasSSE2()) - for (j=2; j<=8; j*=2) - for (k=1; k= HASH_BLOCKSIZE) - { - len = GCM_Base::AuthenticateBlocks(iv, len); - iv += (origLen - len); - } - - if (len > 0) - { - memcpy(m_buffer, iv, len); - memset(m_buffer+len, 0, HASH_BLOCKSIZE-len); - GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); - } - - PutBlock(NULL, m_buffer)(0)(origLen*8); - GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); - - ReverseHashBufferIfNeeded(); - } - - if (m_state >= State_IVSet) - m_ctr.Resynchronize(hashBuffer, REQUIRED_BLOCKSIZE); - else - m_ctr.SetCipherWithIV(cipher, hashBuffer); - - m_ctr.Seek(HASH_BLOCKSIZE); - - memset(hashBuffer, 0, HASH_BLOCKSIZE); -} - -unsigned int GCM_Base::OptimalDataAlignment() const -{ - return -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) - HasSSE2() ? 16 : -#endif - GetBlockCipher().OptimalDataAlignment(); -} - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code -#endif - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -void GCM_AuthenticateBlocks_2K(const byte *data, size_t blocks, word64 *hashBuffer, const word16 *reductionTable); -void GCM_AuthenticateBlocks_64K(const byte *data, size_t blocks, word64 *hashBuffer); -} -#endif - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) -{ -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasCLMUL()) - { - const __m128i *table = (const __m128i *)MulTable(); - __m128i x = _mm_load_si128((__m128i *)HashBuffer()); - const __m128i r = s_clmulConstants[0], bswapMask = s_clmulConstants[1], bswapMask2 = s_clmulConstants[2]; - - while (len >= 16) - { - size_t s = UnsignedMin(len/16, s_clmulTableSizeInBlocks), i=0; - __m128i d, d2 = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(data+(s-1)*16)), bswapMask2);; - __m128i c0 = _mm_setzero_si128(); - __m128i c1 = _mm_setzero_si128(); - __m128i c2 = _mm_setzero_si128(); - - while (true) - { - __m128i h0 = _mm_load_si128(table+i); - __m128i h1 = _mm_load_si128(table+i+1); - __m128i h01 = _mm_xor_si128(h0, h1); - - if (++i == s) - { - d = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)data), bswapMask); - d = _mm_xor_si128(d, x); - c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d, h0, 0)); - c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d, h1, 1)); - d = _mm_xor_si128(d, _mm_shuffle_epi32(d, _MM_SHUFFLE(1, 0, 3, 2))); - c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d, h01, 0)); - break; - } - - d = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(data+(s-i)*16-8)), bswapMask2); - c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d2, h0, 1)); - c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d, h1, 1)); - d2 = _mm_xor_si128(d2, d); - c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d2, h01, 1)); - - if (++i == s) - { - d = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)data), bswapMask); - d = _mm_xor_si128(d, x); - c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d, h0, 0x10)); - c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d, h1, 0x11)); - d = _mm_xor_si128(d, _mm_shuffle_epi32(d, _MM_SHUFFLE(1, 0, 3, 2))); - c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d, h01, 0x10)); - break; - } - - d2 = _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(data+(s-i)*16-8)), bswapMask); - c0 = _mm_xor_si128(c0, _mm_clmulepi64_si128(d, h0, 0x10)); - c2 = _mm_xor_si128(c2, _mm_clmulepi64_si128(d2, h1, 0x10)); - d = _mm_xor_si128(d, d2); - c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(d, h01, 0x10)); - } - data += s*16; - len -= s*16; - - c1 = _mm_xor_si128(_mm_xor_si128(c1, c0), c2); - x = CLMUL_Reduce(c0, c1, c2, r); - } - - _mm_store_si128((__m128i *)HashBuffer(), x); - return len; - } -#endif - - typedef BlockGetAndPut Block; - word64 *hashBuffer = (word64 *)HashBuffer(); - - switch (2*(m_buffer.size()>=64*1024) -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) - + HasSSE2() -#endif - ) - { - case 0: // non-SSE2 and 2K tables - { - byte *table = MulTable(); - word64 x0 = hashBuffer[0], x1 = hashBuffer[1]; - - do - { - word64 y0, y1, a0, a1, b0, b1, c0, c1, d0, d1; - Block::Get(data)(y0)(y1); - x0 ^= y0; - x1 ^= y1; - - data += HASH_BLOCKSIZE; - len -= HASH_BLOCKSIZE; - - #define READ_TABLE_WORD64_COMMON(a, b, c, d) *(word64 *)(table+(a*1024)+(b*256)+c+d*8) - - #ifdef IS_LITTLE_ENDIAN - #if CRYPTOPP_BOOL_SLOW_WORD64 - word32 z0 = (word32)x0; - word32 z1 = (word32)(x0>>32); - word32 z2 = (word32)x1; - word32 z3 = (word32)(x1>>32); - #define READ_TABLE_WORD64(a, b, c, d, e) READ_TABLE_WORD64_COMMON((d%2), c, (d?(z##c>>((d?d-1:0)*4))&0xf0:(z##c&0xf)<<4), e) - #else - #define READ_TABLE_WORD64(a, b, c, d, e) READ_TABLE_WORD64_COMMON((d%2), c, ((d+8*b)?(x##a>>(((d+8*b)?(d+8*b)-1:1)*4))&0xf0:(x##a&0xf)<<4), e) - #endif - #define GF_MOST_SIG_8BITS(a) (a##1 >> 7*8) - #define GF_SHIFT_8(a) a##1 = (a##1 << 8) ^ (a##0 >> 7*8); a##0 <<= 8; - #else - #define READ_TABLE_WORD64(a, b, c, d, e) READ_TABLE_WORD64_COMMON((1-d%2), c, ((15-d-8*b)?(x##a>>(((15-d-8*b)?(15-d-8*b)-1:0)*4))&0xf0:(x##a&0xf)<<4), e) - #define GF_MOST_SIG_8BITS(a) (a##1 & 0xff) - #define GF_SHIFT_8(a) a##1 = (a##1 >> 8) ^ (a##0 << 7*8); a##0 >>= 8; - #endif - - #define GF_MUL_32BY128(op, a, b, c) \ - a0 op READ_TABLE_WORD64(a, b, c, 0, 0) ^ READ_TABLE_WORD64(a, b, c, 1, 0);\ - a1 op READ_TABLE_WORD64(a, b, c, 0, 1) ^ READ_TABLE_WORD64(a, b, c, 1, 1);\ - b0 op READ_TABLE_WORD64(a, b, c, 2, 0) ^ READ_TABLE_WORD64(a, b, c, 3, 0);\ - b1 op READ_TABLE_WORD64(a, b, c, 2, 1) ^ READ_TABLE_WORD64(a, b, c, 3, 1);\ - c0 op READ_TABLE_WORD64(a, b, c, 4, 0) ^ READ_TABLE_WORD64(a, b, c, 5, 0);\ - c1 op READ_TABLE_WORD64(a, b, c, 4, 1) ^ READ_TABLE_WORD64(a, b, c, 5, 1);\ - d0 op READ_TABLE_WORD64(a, b, c, 6, 0) ^ READ_TABLE_WORD64(a, b, c, 7, 0);\ - d1 op READ_TABLE_WORD64(a, b, c, 6, 1) ^ READ_TABLE_WORD64(a, b, c, 7, 1);\ - - GF_MUL_32BY128(=, 0, 0, 0) - GF_MUL_32BY128(^=, 0, 1, 1) - GF_MUL_32BY128(^=, 1, 0, 2) - GF_MUL_32BY128(^=, 1, 1, 3) - - word32 r = (word32)s_reductionTable[GF_MOST_SIG_8BITS(d)] << 16; - GF_SHIFT_8(d) - c0 ^= d0; c1 ^= d1; - r ^= (word32)s_reductionTable[GF_MOST_SIG_8BITS(c)] << 8; - GF_SHIFT_8(c) - b0 ^= c0; b1 ^= c1; - r ^= s_reductionTable[GF_MOST_SIG_8BITS(b)]; - GF_SHIFT_8(b) - a0 ^= b0; a1 ^= b1; - a0 ^= ConditionalByteReverse(LITTLE_ENDIAN_ORDER, r); - x0 = a0; x1 = a1; - } - while (len >= HASH_BLOCKSIZE); - - hashBuffer[0] = x0; hashBuffer[1] = x1; - return len; - } - - case 2: // non-SSE2 and 64K tables - { - byte *table = MulTable(); - word64 x0 = hashBuffer[0], x1 = hashBuffer[1]; - - do - { - word64 y0, y1, a0, a1; - Block::Get(data)(y0)(y1); - x0 ^= y0; - x1 ^= y1; - - data += HASH_BLOCKSIZE; - len -= HASH_BLOCKSIZE; - - #undef READ_TABLE_WORD64_COMMON - #undef READ_TABLE_WORD64 - - #define READ_TABLE_WORD64_COMMON(a, c, d) *(word64 *)(table+(a)*256*16+(c)+(d)*8) - - #ifdef IS_LITTLE_ENDIAN - #if CRYPTOPP_BOOL_SLOW_WORD64 - word32 z0 = (word32)x0; - word32 z1 = (word32)(x0>>32); - word32 z2 = (word32)x1; - word32 z3 = (word32)(x1>>32); - #define READ_TABLE_WORD64(b, c, d, e) READ_TABLE_WORD64_COMMON(c*4+d, (d?(z##c>>((d?d:1)*8-4))&0xff0:(z##c&0xff)<<4), e) - #else - #define READ_TABLE_WORD64(b, c, d, e) READ_TABLE_WORD64_COMMON(c*4+d, ((d+4*(c%2))?(x##b>>(((d+4*(c%2))?(d+4*(c%2)):1)*8-4))&0xff0:(x##b&0xff)<<4), e) - #endif - #else - #define READ_TABLE_WORD64(b, c, d, e) READ_TABLE_WORD64_COMMON(c*4+d, ((7-d-4*(c%2))?(x##b>>(((7-d-4*(c%2))?(7-d-4*(c%2)):1)*8-4))&0xff0:(x##b&0xff)<<4), e) - #endif - - #define GF_MUL_8BY128(op, b, c, d) \ - a0 op READ_TABLE_WORD64(b, c, d, 0);\ - a1 op READ_TABLE_WORD64(b, c, d, 1);\ - - GF_MUL_8BY128(=, 0, 0, 0) - GF_MUL_8BY128(^=, 0, 0, 1) - GF_MUL_8BY128(^=, 0, 0, 2) - GF_MUL_8BY128(^=, 0, 0, 3) - GF_MUL_8BY128(^=, 0, 1, 0) - GF_MUL_8BY128(^=, 0, 1, 1) - GF_MUL_8BY128(^=, 0, 1, 2) - GF_MUL_8BY128(^=, 0, 1, 3) - GF_MUL_8BY128(^=, 1, 2, 0) - GF_MUL_8BY128(^=, 1, 2, 1) - GF_MUL_8BY128(^=, 1, 2, 2) - GF_MUL_8BY128(^=, 1, 2, 3) - GF_MUL_8BY128(^=, 1, 3, 0) - GF_MUL_8BY128(^=, 1, 3, 1) - GF_MUL_8BY128(^=, 1, 3, 2) - GF_MUL_8BY128(^=, 1, 3, 3) - - x0 = a0; x1 = a1; - } - while (len >= HASH_BLOCKSIZE); - - hashBuffer[0] = x0; hashBuffer[1] = x1; - return len; - } -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE - case 1: // SSE2 and 2K tables - GCM_AuthenticateBlocks_2K(data, len/16, hashBuffer, s_reductionTable); - return len % 16; - case 3: // SSE2 and 64K tables - GCM_AuthenticateBlocks_64K(data, len/16, hashBuffer); - return len % 16; -#endif - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - case 1: // SSE2 and 2K tables - { - #ifdef __GNUC__ - __asm__ __volatile__ - ( - INTEL_NOPREFIX - #elif defined(CRYPTOPP_GENERATE_X64_MASM) - ALIGN 8 - GCM_AuthenticateBlocks_2K PROC FRAME - rex_push_reg rsi - push_reg rdi - push_reg rbx - .endprolog - mov rsi, r8 - mov r11, r9 - #else - AS2( mov WORD_REG(cx), data ) - AS2( mov WORD_REG(dx), len ) - AS2( mov WORD_REG(si), hashBuffer ) - AS2( shr WORD_REG(dx), 4 ) - #endif - - #if CRYPTOPP_BOOL_X32 - AS1(push rbx) - AS1(push rbp) - #else - AS_PUSH_IF86( bx) - AS_PUSH_IF86( bp) - #endif - - #ifdef __GNUC__ - AS2( mov AS_REG_7, WORD_REG(di)) - #elif CRYPTOPP_BOOL_X86 - AS2( lea AS_REG_7, s_reductionTable) - #endif - - AS2( movdqa xmm0, [WORD_REG(si)] ) - - #define MUL_TABLE_0 WORD_REG(si) + 32 - #define MUL_TABLE_1 WORD_REG(si) + 32 + 1024 - #define RED_TABLE AS_REG_7 - - ASL(0) - AS2( movdqu xmm4, [WORD_REG(cx)] ) - AS2( pxor xmm0, xmm4 ) - - AS2( movd ebx, xmm0 ) - AS2( mov eax, AS_HEX(f0f0f0f0) ) - AS2( and eax, ebx ) - AS2( shl ebx, 4 ) - AS2( and ebx, AS_HEX(f0f0f0f0) ) - AS2( movzx edi, ah ) - AS2( movdqa xmm5, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) - AS2( movzx edi, al ) - AS2( movdqa xmm4, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) - AS2( shr eax, 16 ) - AS2( movzx edi, ah ) - AS2( movdqa xmm3, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) - AS2( movzx edi, al ) - AS2( movdqa xmm2, XMMWORD_PTR [MUL_TABLE_1 + WORD_REG(di)] ) - - #define SSE2_MUL_32BITS(i) \ - AS2( psrldq xmm0, 4 )\ - AS2( movd eax, xmm0 )\ - AS2( and eax, AS_HEX(f0f0f0f0) )\ - AS2( movzx edi, bh )\ - AS2( pxor xmm5, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ - AS2( movzx edi, bl )\ - AS2( pxor xmm4, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ - AS2( shr ebx, 16 )\ - AS2( movzx edi, bh )\ - AS2( pxor xmm3, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ - AS2( movzx edi, bl )\ - AS2( pxor xmm2, XMMWORD_PTR [MUL_TABLE_0 + (i-1)*256 + WORD_REG(di)] )\ - AS2( movd ebx, xmm0 )\ - AS2( shl ebx, 4 )\ - AS2( and ebx, AS_HEX(f0f0f0f0) )\ - AS2( movzx edi, ah )\ - AS2( pxor xmm5, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ - AS2( movzx edi, al )\ - AS2( pxor xmm4, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ - AS2( shr eax, 16 )\ - AS2( movzx edi, ah )\ - AS2( pxor xmm3, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ - AS2( movzx edi, al )\ - AS2( pxor xmm2, XMMWORD_PTR [MUL_TABLE_1 + i*256 + WORD_REG(di)] )\ - - SSE2_MUL_32BITS(1) - SSE2_MUL_32BITS(2) - SSE2_MUL_32BITS(3) - - AS2( movzx edi, bh ) - AS2( pxor xmm5, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) - AS2( movzx edi, bl ) - AS2( pxor xmm4, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) - AS2( shr ebx, 16 ) - AS2( movzx edi, bh ) - AS2( pxor xmm3, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) - AS2( movzx edi, bl ) - AS2( pxor xmm2, XMMWORD_PTR [MUL_TABLE_0 + 3*256 + WORD_REG(di)] ) - - AS2( movdqa xmm0, xmm3 ) - AS2( pslldq xmm3, 1 ) - AS2( pxor xmm2, xmm3 ) - AS2( movdqa xmm1, xmm2 ) - AS2( pslldq xmm2, 1 ) - AS2( pxor xmm5, xmm2 ) - - AS2( psrldq xmm0, 15 ) -#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) - AS2( movd edi, xmm0 ) -#elif defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) - AS2( mov WORD_REG(di), xmm0 ) -#else // GNU Assembler - AS2( movd WORD_REG(di), xmm0 ) -#endif - AS2( movzx eax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) - AS2( shl eax, 8 ) - - AS2( movdqa xmm0, xmm5 ) - AS2( pslldq xmm5, 1 ) - AS2( pxor xmm4, xmm5 ) - - AS2( psrldq xmm1, 15 ) -#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) - AS2( movd edi, xmm1 ) -#elif defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) - AS2( mov WORD_REG(di), xmm1 ) -#else - AS2( movd WORD_REG(di), xmm1 ) -#endif - AS2( xor ax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) - AS2( shl eax, 8 ) - - AS2( psrldq xmm0, 15 ) -#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) - AS2( movd edi, xmm0 ) -#elif defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) - AS2( mov WORD_REG(di), xmm0 ) -#else - AS2( movd WORD_REG(di), xmm0 ) -#endif - AS2( xor ax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) - - AS2( movd xmm0, eax ) - AS2( pxor xmm0, xmm4 ) - - AS2( add WORD_REG(cx), 16 ) - AS2( sub WORD_REG(dx), 1 ) - ASJ( jnz, 0, b ) - AS2( movdqa [WORD_REG(si)], xmm0 ) - - #if CRYPTOPP_BOOL_X32 - AS1(pop rbp) - AS1(pop rbx) - #else - AS_POP_IF86( bp) - AS_POP_IF86( bx) - #endif - - #ifdef __GNUC__ - ATT_PREFIX - : - : "c" (data), "d" (len/16), "S" (hashBuffer), "D" (s_reductionTable) - : "memory", "cc", "%eax" - #if CRYPTOPP_BOOL_X64 - , "%ebx", "%r11" - #endif - ); - #elif defined(CRYPTOPP_GENERATE_X64_MASM) - pop rbx - pop rdi - pop rsi - ret - GCM_AuthenticateBlocks_2K ENDP - #endif - - return len%16; - } - case 3: // SSE2 and 64K tables - { - #ifdef __GNUC__ - __asm__ __volatile__ - ( - INTEL_NOPREFIX - #elif defined(CRYPTOPP_GENERATE_X64_MASM) - ALIGN 8 - GCM_AuthenticateBlocks_64K PROC FRAME - rex_push_reg rsi - push_reg rdi - .endprolog - mov rsi, r8 - #else - AS2( mov WORD_REG(cx), data ) - AS2( mov WORD_REG(dx), len ) - AS2( mov WORD_REG(si), hashBuffer ) - AS2( shr WORD_REG(dx), 4 ) - #endif - - AS2( movdqa xmm0, [WORD_REG(si)] ) - - #undef MUL_TABLE - #define MUL_TABLE(i,j) WORD_REG(si) + 32 + (i*4+j)*256*16 - - ASL(1) - AS2( movdqu xmm1, [WORD_REG(cx)] ) - AS2( pxor xmm1, xmm0 ) - AS2( pxor xmm0, xmm0 ) - - #undef SSE2_MUL_32BITS - #define SSE2_MUL_32BITS(i) \ - AS2( movd eax, xmm1 )\ - AS2( psrldq xmm1, 4 )\ - AS2( movzx edi, al )\ - AS2( add WORD_REG(di), WORD_REG(di) )\ - AS2( pxor xmm0, [MUL_TABLE(i,0) + WORD_REG(di)*8] )\ - AS2( movzx edi, ah )\ - AS2( add WORD_REG(di), WORD_REG(di) )\ - AS2( pxor xmm0, [MUL_TABLE(i,1) + WORD_REG(di)*8] )\ - AS2( shr eax, 16 )\ - AS2( movzx edi, al )\ - AS2( add WORD_REG(di), WORD_REG(di) )\ - AS2( pxor xmm0, [MUL_TABLE(i,2) + WORD_REG(di)*8] )\ - AS2( movzx edi, ah )\ - AS2( add WORD_REG(di), WORD_REG(di) )\ - AS2( pxor xmm0, [MUL_TABLE(i,3) + WORD_REG(di)*8] )\ - - SSE2_MUL_32BITS(0) - SSE2_MUL_32BITS(1) - SSE2_MUL_32BITS(2) - SSE2_MUL_32BITS(3) - - AS2( add WORD_REG(cx), 16 ) - AS2( sub WORD_REG(dx), 1 ) - ASJ( jnz, 1, b ) - AS2( movdqa [WORD_REG(si)], xmm0 ) - - #ifdef __GNUC__ - ATT_PREFIX - : - : "c" (data), "d" (len/16), "S" (hashBuffer) - : "memory", "cc", "%edi", "%eax" - ); - #elif defined(CRYPTOPP_GENERATE_X64_MASM) - pop rdi - pop rsi - ret - GCM_AuthenticateBlocks_64K ENDP - #endif - - return len%16; - } -#endif -#ifndef CRYPTOPP_GENERATE_X64_MASM - } - - return len%16; -} - -void GCM_Base::AuthenticateLastHeaderBlock() -{ - if (m_bufferedDataLength > 0) - { - memset(m_buffer+m_bufferedDataLength, 0, HASH_BLOCKSIZE-m_bufferedDataLength); - m_bufferedDataLength = 0; - GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); - } -} - -void GCM_Base::AuthenticateLastConfidentialBlock() -{ - GCM_Base::AuthenticateLastHeaderBlock(); - PutBlock(NULL, m_buffer)(m_totalHeaderLength*8)(m_totalMessageLength*8); - GCM_Base::AuthenticateBlocks(m_buffer, HASH_BLOCKSIZE); -} - -void GCM_Base::AuthenticateLastFooterBlock(byte *mac, size_t macSize) -{ - m_ctr.Seek(0); - ReverseHashBufferIfNeeded(); - m_ctr.ProcessData(mac, HashBuffer(), macSize); -} - -NAMESPACE_END - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM -#endif diff --git a/external/crypto++-5.6.3/gcm.h b/external/crypto++-5.6.3/gcm.h deleted file mode 100644 index 2dd91c4d4..000000000 --- a/external/crypto++-5.6.3/gcm.h +++ /dev/null @@ -1,127 +0,0 @@ -// gcm.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile gcm.h -//! \brief GCM block cipher mode of operation - -#ifndef CRYPTOPP_GCM_H -#define CRYPTOPP_GCM_H - -#include "authenc.h" -#include "modes.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \enum GCM_TablesOption -//! \brief Use either 2K or 64K size tables. -enum GCM_TablesOption {GCM_2K_Tables, GCM_64K_Tables}; - -//! \class GCM_Base -//! \brief CCM block cipher mode of operation. -//! \details Implementations and overrides in \p GCM_Base apply to both \p ENCRYPTION and \p DECRYPTION directions -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE GCM_Base : public AuthenticatedSymmetricCipherBase -{ -public: - // AuthenticatedSymmetricCipher - std::string AlgorithmName() const - {return GetBlockCipher().AlgorithmName() + std::string("/GCM");} - size_t MinKeyLength() const - {return GetBlockCipher().MinKeyLength();} - size_t MaxKeyLength() const - {return GetBlockCipher().MaxKeyLength();} - size_t DefaultKeyLength() const - {return GetBlockCipher().DefaultKeyLength();} - size_t GetValidKeyLength(size_t n) const - {return GetBlockCipher().GetValidKeyLength(n);} - bool IsValidKeyLength(size_t n) const - {return GetBlockCipher().IsValidKeyLength(n);} - unsigned int OptimalDataAlignment() const; - IV_Requirement IVRequirement() const - {return UNIQUE_IV;} - unsigned int IVSize() const - {return 12;} - unsigned int MinIVLength() const - {return 1;} - unsigned int MaxIVLength() const - {return UINT_MAX;} // (W64LIT(1)<<61)-1 in the standard - unsigned int DigestSize() const - {return 16;} - lword MaxHeaderLength() const - {return (W64LIT(1)<<61)-1;} - lword MaxMessageLength() const - {return ((W64LIT(1)<<39)-256)/8;} - -protected: - // AuthenticatedSymmetricCipherBase - bool AuthenticationIsOnPlaintext() const - {return false;} - unsigned int AuthenticationBlockSize() const - {return HASH_BLOCKSIZE;} - void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms); - void Resync(const byte *iv, size_t len); - size_t AuthenticateBlocks(const byte *data, size_t len); - void AuthenticateLastHeaderBlock(); - void AuthenticateLastConfidentialBlock(); - void AuthenticateLastFooterBlock(byte *mac, size_t macSize); - SymmetricCipher & AccessSymmetricCipher() {return m_ctr;} - - virtual BlockCipher & AccessBlockCipher() =0; - virtual GCM_TablesOption GetTablesOption() const =0; - - const BlockCipher & GetBlockCipher() const {return const_cast(this)->AccessBlockCipher();}; - byte *HashBuffer() {return m_buffer+REQUIRED_BLOCKSIZE;} - byte *HashKey() {return m_buffer+2*REQUIRED_BLOCKSIZE;} - byte *MulTable() {return m_buffer+3*REQUIRED_BLOCKSIZE;} - inline void ReverseHashBufferIfNeeded(); - - class CRYPTOPP_DLL GCTR : public CTR_Mode_ExternalCipher::Encryption - { - protected: - void IncrementCounterBy256(); - }; - - GCTR m_ctr; - static word16 s_reductionTable[256]; - static volatile bool s_reductionTableInitialized; - enum {REQUIRED_BLOCKSIZE = 16, HASH_BLOCKSIZE = 16}; -}; - -//! \class GCM_Final -//! \brief Class specific methods used to operate the cipher. -//! \tparam T_BlockCipher block cipher -//! \tparam T_TablesOption table size, either \p GCM_2K_Tables or \p GCM_64K_Tables -//! \tparam T_IsEncryption direction in which to operate the cipher -//! \details Implementations and overrides in \p GCM_Final apply to either -//! \p ENCRYPTION or \p DECRYPTION, depending on the template parameter \p T_IsEncryption. -//! \details \p GCM_Final does not use inner classes \p Enc and \p Dec. -template -class GCM_Final : public GCM_Base -{ -public: - static std::string StaticAlgorithmName() - {return T_BlockCipher::StaticAlgorithmName() + std::string("/GCM");} - bool IsForwardTransformation() const - {return T_IsEncryption;} - -private: - GCM_TablesOption GetTablesOption() const {return T_TablesOption;} - BlockCipher & AccessBlockCipher() {return m_cipher;} - typename T_BlockCipher::Encryption m_cipher; -}; - -//! \class GCM -//! \brief The GCM mode of operation -//! \tparam T_BlockCipher block cipher -//! \tparam T_TablesOption table size, either \p GCM_2K_Tables or \p GCM_64K_Tables -//! \details \p GCM provides the \p Encryption and \p Decryption typedef. -//! \sa GCM at the Crypto Lounge -template -struct GCM : public AuthenticatedSymmetricCipherDocumentation -{ - typedef GCM_Final Encryption; - typedef GCM_Final Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/gf256.cpp b/external/crypto++-5.6.3/gf256.cpp deleted file mode 100644 index 72026d1e1..000000000 --- a/external/crypto++-5.6.3/gf256.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// gf256.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "gf256.h" - -NAMESPACE_BEGIN(CryptoPP) - -GF256::Element GF256::Multiply(Element a, Element b) const -{ - word result = 0, t = b; - - for (unsigned int i=0; i<8; i++) - { - result <<= 1; - if (result & 0x100) - result ^= m_modulus; - - t <<= 1; - if (t & 0x100) - result ^= a; - } - - return (GF256::Element) result; -} - -GF256::Element GF256::MultiplicativeInverse(Element a) const -{ - Element result = a; - for (int i=1; i<7; i++) - result = Multiply(Square(result), a); - return Square(result); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/gf256.h b/external/crypto++-5.6.3/gf256.h deleted file mode 100644 index 007fb00b2..000000000 --- a/external/crypto++-5.6.3/gf256.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef CRYPTOPP_GF256_H -#define CRYPTOPP_GF256_H - -#include "cryptlib.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! GF(256) with polynomial basis -class GF256 -{ -public: - typedef byte Element; - typedef int RandomizationParameter; - - GF256(byte modulus) : m_modulus(modulus) {} - - Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const - {CRYPTOPP_UNUSED(ignored); return rng.GenerateByte();} - - bool Equal(Element a, Element b) const - {return a==b;} - - Element Zero() const - {return 0;} - - Element Add(Element a, Element b) const - {return a^b;} - - Element& Accumulate(Element &a, Element b) const - {return a^=b;} - - Element Inverse(Element a) const - {return a;} - - Element Subtract(Element a, Element b) const - {return a^b;} - - Element& Reduce(Element &a, Element b) const - {return a^=b;} - - Element Double(Element a) const - {CRYPTOPP_UNUSED(a); return 0;} - - Element One() const - {return 1;} - - Element Multiply(Element a, Element b) const; - - Element Square(Element a) const - {return Multiply(a, a);} - - bool IsUnit(Element a) const - {return a != 0;} - - Element MultiplicativeInverse(Element a) const; - - Element Divide(Element a, Element b) const - {return Multiply(a, MultiplicativeInverse(b));} - -private: - word m_modulus; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/gf2_32.cpp b/external/crypto++-5.6.3/gf2_32.cpp deleted file mode 100644 index ae4874a40..000000000 --- a/external/crypto++-5.6.3/gf2_32.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// gf2_32.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "misc.h" -#include "gf2_32.h" - -NAMESPACE_BEGIN(CryptoPP) - -GF2_32::Element GF2_32::Multiply(Element a, Element b) const -{ - word32 table[4]; - table[0] = 0; - table[1] = m_modulus; - if (a & 0x80000000) - { - table[2] = m_modulus ^ (a<<1); - table[3] = a<<1; - } - else - { - table[2] = a<<1; - table[3] = m_modulus ^ (a<<1); - } - -#if CRYPTOPP_FAST_ROTATE(32) - b = rotrFixed(b, 30U); - word32 result = table[b&2]; - - for (int i=29; i>=0; --i) - { - b = rotlFixed(b, 1U); - result = (result<<1) ^ table[(b&2) + (result>>31)]; - } - - return (b&1) ? result ^ a : result; -#else - word32 result = table[(b>>30) & 2]; - - for (int i=29; i>=0; --i) - result = (result<<1) ^ table[((b>>i)&2) + (result>>31)]; - - return (b&1) ? result ^ a : result; -#endif -} - -GF2_32::Element GF2_32::MultiplicativeInverse(Element a) const -{ - if (a <= 1) // 1 is a special case - return a; - - // warning - don't try to adapt this algorithm for another situation - word32 g0=m_modulus, g1=a, g2=a; - word32 v0=0, v1=1, v2=1; - - assert(g1); - - while (!(g2 & 0x80000000)) - { - g2 <<= 1; - v2 <<= 1; - } - - g2 <<= 1; - v2 <<= 1; - - g0 ^= g2; - v0 ^= v2; - - while (g0 != 1) - { - if (g1 < g0 || ((g0^g1) < g0 && (g0^g1) < g1)) - { - assert(BitPrecision(g1) <= BitPrecision(g0)); - g2 = g1; - v2 = v1; - } - else - { - assert(BitPrecision(g1) > BitPrecision(g0)); - g2 = g0; g0 = g1; g1 = g2; - v2 = v0; v0 = v1; v1 = v2; - } - - while ((g0^g2) >= g2) - { - assert(BitPrecision(g0) > BitPrecision(g2)); - g2 <<= 1; - v2 <<= 1; - } - - assert(BitPrecision(g0) == BitPrecision(g2)); - g0 ^= g2; - v0 ^= v2; - } - - return v0; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/gf2_32.h b/external/crypto++-5.6.3/gf2_32.h deleted file mode 100644 index 32499b5be..000000000 --- a/external/crypto++-5.6.3/gf2_32.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef CRYPTOPP_GF2_32_H -#define CRYPTOPP_GF2_32_H - -#include "cryptlib.h" -#include "secblock.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! GF(2^32) with polynomial basis -class GF2_32 -{ -public: - typedef word32 Element; - typedef int RandomizationParameter; - - GF2_32(word32 modulus=0x0000008D) : m_modulus(modulus) {} - - Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const - {CRYPTOPP_UNUSED(ignored); return rng.GenerateWord32();} - - bool Equal(Element a, Element b) const - {return a==b;} - - Element Identity() const - {return 0;} - - Element Add(Element a, Element b) const - {return a^b;} - - Element& Accumulate(Element &a, Element b) const - {return a^=b;} - - Element Inverse(Element a) const - {return a;} - - Element Subtract(Element a, Element b) const - {return a^b;} - - Element& Reduce(Element &a, Element b) const - {return a^=b;} - - Element Double(Element a) const - {CRYPTOPP_UNUSED(a); return 0;} - - Element MultiplicativeIdentity() const - {return 1;} - - Element Multiply(Element a, Element b) const; - - Element Square(Element a) const - {return Multiply(a, a);} - - bool IsUnit(Element a) const - {return a != 0;} - - Element MultiplicativeInverse(Element a) const; - - Element Divide(Element a, Element b) const - {return Multiply(a, MultiplicativeInverse(b));} - -private: - word32 m_modulus; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/gf2n.cpp b/external/crypto++-5.6.3/gf2n.cpp deleted file mode 100644 index 044bf2fb1..000000000 --- a/external/crypto++-5.6.3/gf2n.cpp +++ /dev/null @@ -1,903 +0,0 @@ -// gf2n.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "cryptlib.h" -#include "algebra.h" -#include "randpool.h" -#include "filters.h" -#include "smartptr.h" -#include "words.h" -#include "misc.h" -#include "gf2n.h" -#include "asn.h" -#include "oids.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -PolynomialMod2::PolynomialMod2() -{ -} - -PolynomialMod2::PolynomialMod2(word value, size_t bitLength) - : reg(BitsToWords(bitLength)) -{ - assert(value==0 || reg.size()>0); - - if (reg.size() > 0) - { - reg[0] = value; - SetWords(reg+1, 0, reg.size()-1); - } -} - -PolynomialMod2::PolynomialMod2(const PolynomialMod2& t) - : reg(t.reg.size()) -{ - CopyWords(reg, t.reg, reg.size()); -} - -void PolynomialMod2::Randomize(RandomNumberGenerator &rng, size_t nbits) -{ - const size_t nbytes = nbits/8 + 1; - SecByteBlock buf(nbytes); - rng.GenerateBlock(buf, nbytes); - buf[0] = (byte)Crop(buf[0], nbits % 8); - Decode(buf, nbytes); -} - -PolynomialMod2 PolynomialMod2::AllOnes(size_t bitLength) -{ - PolynomialMod2 result((word)0, bitLength); - SetWords(result.reg, word(SIZE_MAX), result.reg.size()); - if (bitLength%WORD_BITS) - result.reg[result.reg.size()-1] = (word)Crop(result.reg[result.reg.size()-1], bitLength%WORD_BITS); - return result; -} - -void PolynomialMod2::SetBit(size_t n, int value) -{ - if (value) - { - reg.CleanGrow(n/WORD_BITS + 1); - reg[n/WORD_BITS] |= (word(1) << (n%WORD_BITS)); - } - else - { - if (n/WORD_BITS < reg.size()) - reg[n/WORD_BITS] &= ~(word(1) << (n%WORD_BITS)); - } -} - -byte PolynomialMod2::GetByte(size_t n) const -{ - if (n/WORD_SIZE >= reg.size()) - return 0; - else - return byte(reg[n/WORD_SIZE] >> ((n%WORD_SIZE)*8)); -} - -void PolynomialMod2::SetByte(size_t n, byte value) -{ - reg.CleanGrow(BytesToWords(n+1)); - reg[n/WORD_SIZE] &= ~(word(0xff) << 8*(n%WORD_SIZE)); - reg[n/WORD_SIZE] |= (word(value) << 8*(n%WORD_SIZE)); -} - -PolynomialMod2 PolynomialMod2::Monomial(size_t i) -{ - PolynomialMod2 r((word)0, i+1); - r.SetBit(i); - return r; -} - -PolynomialMod2 PolynomialMod2::Trinomial(size_t t0, size_t t1, size_t t2) -{ - PolynomialMod2 r((word)0, t0+1); - r.SetBit(t0); - r.SetBit(t1); - r.SetBit(t2); - return r; -} - -PolynomialMod2 PolynomialMod2::Pentanomial(size_t t0, size_t t1, size_t t2, size_t t3, size_t t4) -{ - PolynomialMod2 r((word)0, t0+1); - r.SetBit(t0); - r.SetBit(t1); - r.SetBit(t2); - r.SetBit(t3); - r.SetBit(t4); - return r; -} - -template -struct NewPolynomialMod2 -{ - PolynomialMod2 * operator()() const - { - return new PolynomialMod2(i); - } -}; - -const PolynomialMod2 &PolynomialMod2::Zero() -{ - return Singleton().Ref(); -} - -const PolynomialMod2 &PolynomialMod2::One() -{ - return Singleton >().Ref(); -} - -void PolynomialMod2::Decode(const byte *input, size_t inputLen) -{ - StringStore store(input, inputLen); - Decode(store, inputLen); -} - -void PolynomialMod2::Encode(byte *output, size_t outputLen) const -{ - ArraySink sink(output, outputLen); - Encode(sink, outputLen); -} - -void PolynomialMod2::Decode(BufferedTransformation &bt, size_t inputLen) -{ - reg.CleanNew(BytesToWords(inputLen)); - - for (size_t i=inputLen; i > 0; i--) - { - byte b; - bt.Get(b); - reg[(i-1)/WORD_SIZE] |= word(b) << ((i-1)%WORD_SIZE)*8; - } -} - -void PolynomialMod2::Encode(BufferedTransformation &bt, size_t outputLen) const -{ - for (size_t i=outputLen; i > 0; i--) - bt.Put(GetByte(i-1)); -} - -void PolynomialMod2::DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const -{ - DERGeneralEncoder enc(bt, OCTET_STRING); - Encode(enc, length); - enc.MessageEnd(); -} - -void PolynomialMod2::BERDecodeAsOctetString(BufferedTransformation &bt, size_t length) -{ - BERGeneralDecoder dec(bt, OCTET_STRING); - if (!dec.IsDefiniteLength() || dec.RemainingLength() != length) - BERDecodeError(); - Decode(dec, length); - dec.MessageEnd(); -} - -unsigned int PolynomialMod2::WordCount() const -{ - return (unsigned int)CountWords(reg, reg.size()); -} - -unsigned int PolynomialMod2::ByteCount() const -{ - unsigned wordCount = WordCount(); - if (wordCount) - return (wordCount-1)*WORD_SIZE + BytePrecision(reg[wordCount-1]); - else - return 0; -} - -unsigned int PolynomialMod2::BitCount() const -{ - unsigned wordCount = WordCount(); - if (wordCount) - return (wordCount-1)*WORD_BITS + BitPrecision(reg[wordCount-1]); - else - return 0; -} - -unsigned int PolynomialMod2::Parity() const -{ - unsigned i; - word temp=0; - for (i=0; i= reg.size()) - { - PolynomialMod2 result((word)0, b.reg.size()*WORD_BITS); - XorWords(result.reg, reg, b.reg, reg.size()); - CopyWords(result.reg+reg.size(), b.reg+reg.size(), b.reg.size()-reg.size()); - return result; - } - else - { - PolynomialMod2 result((word)0, reg.size()*WORD_BITS); - XorWords(result.reg, reg, b.reg, b.reg.size()); - CopyWords(result.reg+b.reg.size(), reg+b.reg.size(), reg.size()-b.reg.size()); - return result; - } -} - -PolynomialMod2 PolynomialMod2::And(const PolynomialMod2 &b) const -{ - PolynomialMod2 result((word)0, WORD_BITS*STDMIN(reg.size(), b.reg.size())); - AndWords(result.reg, reg, b.reg, result.reg.size()); - return result; -} - -PolynomialMod2 PolynomialMod2::Times(const PolynomialMod2 &b) const -{ - PolynomialMod2 result((word)0, BitCount() + b.BitCount()); - - for (int i=b.Degree(); i>=0; i--) - { - result <<= 1; - if (b[i]) - XorWords(result.reg, reg, reg.size()); - } - return result; -} - -PolynomialMod2 PolynomialMod2::Squared() const -{ - static const word map[16] = {0, 1, 4, 5, 16, 17, 20, 21, 64, 65, 68, 69, 80, 81, 84, 85}; - - PolynomialMod2 result((word)0, 2*reg.size()*WORD_BITS); - - for (unsigned i=0; i> (j/2)) % 16] << j; - - for (j=0; j> (j/2 + WORD_BITS/2)) % 16] << j; - } - - return result; -} - -void PolynomialMod2::Divide(PolynomialMod2 &remainder, PolynomialMod2 "ient, - const PolynomialMod2 ÷nd, const PolynomialMod2 &divisor) -{ - if (!divisor) - throw PolynomialMod2::DivideByZero(); - - int degree = divisor.Degree(); - remainder.reg.CleanNew(BitsToWords(degree+1)); - if (dividend.BitCount() >= divisor.BitCount()) - quotient.reg.CleanNew(BitsToWords(dividend.BitCount() - divisor.BitCount() + 1)); - else - quotient.reg.CleanNew(0); - - for (int i=dividend.Degree(); i>=0; i--) - { - remainder <<= 1; - remainder.reg[0] |= dividend[i]; - if (remainder[degree]) - { - remainder -= divisor; - quotient.SetBit(i); - } - } -} - -PolynomialMod2 PolynomialMod2::DividedBy(const PolynomialMod2 &b) const -{ - PolynomialMod2 remainder, quotient; - PolynomialMod2::Divide(remainder, quotient, *this, b); - return quotient; -} - -PolynomialMod2 PolynomialMod2::Modulo(const PolynomialMod2 &b) const -{ - PolynomialMod2 remainder, quotient; - PolynomialMod2::Divide(remainder, quotient, *this, b); - return remainder; -} - -PolynomialMod2& PolynomialMod2::operator<<=(unsigned int n) -{ -#if !defined(NDEBUG) - int x; CRYPTOPP_UNUSED(x); - assert(SafeConvert(n,x)); -#endif - - if (!reg.size()) - return *this; - - int i; - word u; - word carry=0; - word *r=reg; - - if (n==1) // special case code for most frequent case - { - i = (int)reg.size(); - while (i--) - { - u = *r; - *r = (u << 1) | carry; - carry = u >> (WORD_BITS-1); - r++; - } - - if (carry) - { - reg.Grow(reg.size()+1); - reg[reg.size()-1] = carry; - } - - return *this; - } - - const int shiftWords = n / WORD_BITS; - const int shiftBits = n % WORD_BITS; - - if (shiftBits) - { - i = (int)reg.size(); - while (i--) - { - u = *r; - *r = (u << shiftBits) | carry; - carry = u >> (WORD_BITS-shiftBits); - r++; - } - } - - if (carry) - { - // Thanks to Apatryda, http://github.com/weidai11/cryptopp/issues/64 - const size_t carryIndex = reg.size(); - reg.Grow(reg.size()+shiftWords+!!shiftBits); - reg[carryIndex] = carry; - } - else - reg.Grow(reg.size()+shiftWords); - - if (shiftWords) - { - for (i = (int)reg.size()-1; i>=shiftWords; i--) - reg[i] = reg[i-shiftWords]; - for (; i>=0; i--) - reg[i] = 0; - } - - return *this; -} - -PolynomialMod2& PolynomialMod2::operator>>=(unsigned int n) -{ - if (!reg.size()) - return *this; - - int shiftWords = n / WORD_BITS; - int shiftBits = n % WORD_BITS; - - size_t i; - word u; - word carry=0; - word *r=reg+reg.size()-1; - - if (shiftBits) - { - i = reg.size(); - while (i--) - { - u = *r; - *r = (u >> shiftBits) | carry; - carry = u << (WORD_BITS-shiftBits); - r--; - } - } - - if (shiftWords) - { - for (i=0; i>(unsigned int n) const -{ - PolynomialMod2 result(*this); - return result>>=n; -} - -bool PolynomialMod2::operator!() const -{ - for (unsigned i=0; i s(a.BitCount()/bits+1); - unsigned i; - - static const char upper[]="0123456789ABCDEF"; - static const char lower[]="0123456789abcdef"; - const char* vec = (out.flags() & std::ios::uppercase) ? upper : lower; - - for (i=0; i*bits < a.BitCount(); i++) - { - int digit=0; - for (int j=0; j().Gcd(a, b); -} - -PolynomialMod2 PolynomialMod2::InverseMod(const PolynomialMod2 &modulus) const -{ - typedef EuclideanDomainOf Domain; - return QuotientRing(Domain(), modulus).MultiplicativeInverse(*this); -} - -bool PolynomialMod2::IsIrreducible() const -{ - signed int d = Degree(); - if (d <= 0) - return false; - - PolynomialMod2 t(2), u(t); - for (int i=1; i<=d/2; i++) - { - u = u.Squared()%(*this); - if (!Gcd(u+t, *this).IsUnit()) - return false; - } - return true; -} - -// ******************************************************** - -GF2NP::GF2NP(const PolynomialMod2 &modulus) - : QuotientRing >(EuclideanDomainOf(), modulus), m(modulus.Degree()) -{ -} - -GF2NP::Element GF2NP::SquareRoot(const Element &a) const -{ - Element r = a; - for (unsigned int i=1; i t1 && t1 > t2 && t2==0); -} - -const GF2NT::Element& GF2NT::MultiplicativeInverse(const Element &a) const -{ - if (t0-t1 < WORD_BITS) - return GF2NP::MultiplicativeInverse(a); - - SecWordBlock T(m_modulus.reg.size() * 4); - word *b = T; - word *c = T+m_modulus.reg.size(); - word *f = T+2*m_modulus.reg.size(); - word *g = T+3*m_modulus.reg.size(); - size_t bcLen=1, fgLen=m_modulus.reg.size(); - unsigned int k=0; - - SetWords(T, 0, 3*m_modulus.reg.size()); - b[0]=1; - assert(a.reg.size() <= m_modulus.reg.size()); - CopyWords(f, a.reg, a.reg.size()); - CopyWords(g, m_modulus.reg, m_modulus.reg.size()); - - while (1) - { - word t=f[0]; - while (!t) - { - ShiftWordsRightByWords(f, fgLen, 1); - if (c[bcLen-1]) - bcLen++; - assert(bcLen <= m_modulus.reg.size()); - ShiftWordsLeftByWords(c, bcLen, 1); - k+=WORD_BITS; - t=f[0]; - } - - unsigned int i=0; - while (t%2 == 0) - { - t>>=1; - i++; - } - k+=i; - - if (t==1 && CountWords(f, fgLen)==1) - break; - - if (i==1) - { - ShiftWordsRightByBits(f, fgLen, 1); - t=ShiftWordsLeftByBits(c, bcLen, 1); - } - else - { - ShiftWordsRightByBits(f, fgLen, i); - t=ShiftWordsLeftByBits(c, bcLen, i); - } - if (t) - { - c[bcLen] = t; - bcLen++; - assert(bcLen <= m_modulus.reg.size()); - } - - if (f[fgLen-1]==0 && g[fgLen-1]==0) - fgLen--; - - if (f[fgLen-1] < g[fgLen-1]) - { - std::swap(f, g); - std::swap(b, c); - } - - XorWords(f, g, fgLen); - XorWords(b, c, bcLen); - } - - while (k >= WORD_BITS) - { - word temp = b[0]; - // right shift b - for (unsigned i=0; i+1> j) & 1) << ((t1 + j) & (sizeof(temp)*8-1)); - if (t1 < WORD_BITS) - for (unsigned int j=0; j> j) & 1) << (t1 + j); - else - b[t1/WORD_BITS-1] ^= temp << t1%WORD_BITS; - - if (t1 % WORD_BITS) - b[t1/WORD_BITS] ^= temp >> (WORD_BITS - t1%WORD_BITS); - - if (t0%WORD_BITS) - { - b[t0/WORD_BITS-1] ^= temp << t0%WORD_BITS; - b[t0/WORD_BITS] ^= temp >> (WORD_BITS - t0%WORD_BITS); - } - else - b[t0/WORD_BITS-1] ^= temp; - - k -= WORD_BITS; - } - - if (k) - { - word temp = b[0] << (WORD_BITS - k); - ShiftWordsRightByBits(b, BitsToWords(m), k); - - if (t1 < WORD_BITS) - { - for (unsigned int j=0; j> j) & 1) << (t1 + j); - } - } - else - { - b[t1/WORD_BITS-1] ^= temp << t1%WORD_BITS; - } - - if (t1 % WORD_BITS) - b[t1/WORD_BITS] ^= temp >> (WORD_BITS - t1%WORD_BITS); - - if (t0%WORD_BITS) - { - b[t0/WORD_BITS-1] ^= temp << t0%WORD_BITS; - b[t0/WORD_BITS] ^= temp >> (WORD_BITS - t0%WORD_BITS); - } - else - b[t0/WORD_BITS-1] ^= temp; - } - - CopyWords(result.reg.begin(), b, result.reg.size()); - return result; -} - -const GF2NT::Element& GF2NT::Multiply(const Element &a, const Element &b) const -{ - size_t aSize = STDMIN(a.reg.size(), result.reg.size()); - Element r((word)0, m); - - for (int i=m-1; i>=0; i--) - { - if (r[m-1]) - { - ShiftWordsLeftByBits(r.reg.begin(), r.reg.size(), 1); - XorWords(r.reg.begin(), m_modulus.reg, r.reg.size()); - } - else - ShiftWordsLeftByBits(r.reg.begin(), r.reg.size(), 1); - - if (b[i]) - XorWords(r.reg.begin(), a.reg, aSize); - } - - if (m%WORD_BITS) - r.reg.begin()[r.reg.size()-1] = (word)Crop(r.reg[r.reg.size()-1], m%WORD_BITS); - - CopyWords(result.reg.begin(), r.reg.begin(), result.reg.size()); - return result; -} - -const GF2NT::Element& GF2NT::Reduced(const Element &a) const -{ - if (t0-t1 < WORD_BITS) - return m_domain.Mod(a, m_modulus); - - SecWordBlock b(a.reg); - - size_t i; - for (i=b.size()-1; i>=BitsToWords(t0); i--) - { - word temp = b[i]; - - if (t0%WORD_BITS) - { - b[i-t0/WORD_BITS] ^= temp >> t0%WORD_BITS; - b[i-t0/WORD_BITS-1] ^= temp << (WORD_BITS - t0%WORD_BITS); - } - else - b[i-t0/WORD_BITS] ^= temp; - - if ((t0-t1)%WORD_BITS) - { - b[i-(t0-t1)/WORD_BITS] ^= temp >> (t0-t1)%WORD_BITS; - b[i-(t0-t1)/WORD_BITS-1] ^= temp << (WORD_BITS - (t0-t1)%WORD_BITS); - } - else - b[i-(t0-t1)/WORD_BITS] ^= temp; - } - - if (i==BitsToWords(t0)-1 && t0%WORD_BITS) - { - word mask = ((word)1<<(t0%WORD_BITS))-1; - word temp = b[i] & ~mask; - b[i] &= mask; - - b[i-t0/WORD_BITS] ^= temp >> t0%WORD_BITS; - - if ((t0-t1)%WORD_BITS) - { - b[i-(t0-t1)/WORD_BITS] ^= temp >> (t0-t1)%WORD_BITS; - if ((t0-t1)%WORD_BITS > t0%WORD_BITS) - b[i-(t0-t1)/WORD_BITS-1] ^= temp << (WORD_BITS - (t0-t1)%WORD_BITS); - else - assert(temp << (WORD_BITS - (t0-t1)%WORD_BITS) == 0); - } - else - b[i-(t0-t1)/WORD_BITS] ^= temp; - } - - SetWords(result.reg.begin(), 0, result.reg.size()); - CopyWords(result.reg.begin(), b, STDMIN(b.size(), result.reg.size())); - return result; -} - -void GF2NP::DEREncodeElement(BufferedTransformation &out, const Element &a) const -{ - a.DEREncodeAsOctetString(out, MaxElementByteLength()); -} - -void GF2NP::BERDecodeElement(BufferedTransformation &in, Element &a) const -{ - a.BERDecodeAsOctetString(in, MaxElementByteLength()); -} - -void GF2NT::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - ASN1::characteristic_two_field().DEREncode(seq); - DERSequenceEncoder parameters(seq); - DEREncodeUnsigned(parameters, m); - ASN1::tpBasis().DEREncode(parameters); - DEREncodeUnsigned(parameters, t1); - parameters.MessageEnd(); - seq.MessageEnd(); -} - -void GF2NPP::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - ASN1::characteristic_two_field().DEREncode(seq); - DERSequenceEncoder parameters(seq); - DEREncodeUnsigned(parameters, m); - ASN1::ppBasis().DEREncode(parameters); - DERSequenceEncoder pentanomial(parameters); - DEREncodeUnsigned(pentanomial, t3); - DEREncodeUnsigned(pentanomial, t2); - DEREncodeUnsigned(pentanomial, t1); - pentanomial.MessageEnd(); - parameters.MessageEnd(); - seq.MessageEnd(); -} - -GF2NP * BERDecodeGF2NP(BufferedTransformation &bt) -{ - member_ptr result; - - BERSequenceDecoder seq(bt); - if (OID(seq) != ASN1::characteristic_two_field()) - BERDecodeError(); - BERSequenceDecoder parameters(seq); - unsigned int m; - BERDecodeUnsigned(parameters, m); - OID oid(parameters); - if (oid == ASN1::tpBasis()) - { - unsigned int t1; - BERDecodeUnsigned(parameters, t1); - result.reset(new GF2NT(m, t1, 0)); - } - else if (oid == ASN1::ppBasis()) - { - unsigned int t1, t2, t3; - BERSequenceDecoder pentanomial(parameters); - BERDecodeUnsigned(pentanomial, t3); - BERDecodeUnsigned(pentanomial, t2); - BERDecodeUnsigned(pentanomial, t1); - pentanomial.MessageEnd(); - result.reset(new GF2NPP(m, t3, t2, t1, 0)); - } - else - { - BERDecodeError(); - return NULL; - } - parameters.MessageEnd(); - seq.MessageEnd(); - - return result.release(); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/gf2n.h b/external/crypto++-5.6.3/gf2n.h deleted file mode 100644 index 9616b9790..000000000 --- a/external/crypto++-5.6.3/gf2n.h +++ /dev/null @@ -1,370 +0,0 @@ -#ifndef CRYPTOPP_GF2N_H -#define CRYPTOPP_GF2N_H - -/*! \file */ - -#include "cryptlib.h" -#include "secblock.h" -#include "algebra.h" -#include "misc.h" -#include "asn.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! Polynomial with Coefficients in GF(2) -/*! \nosubgrouping */ -class CRYPTOPP_DLL PolynomialMod2 -{ -public: - //! \name ENUMS, EXCEPTIONS, and TYPEDEFS - //@{ - //! divide by zero exception - class DivideByZero : public Exception - { - public: - DivideByZero() : Exception(OTHER_ERROR, "PolynomialMod2: division by zero") {} - }; - - typedef unsigned int RandomizationParameter; - //@} - - //! \name CREATORS - //@{ - //! creates the zero polynomial - PolynomialMod2(); - //! copy constructor - PolynomialMod2(const PolynomialMod2& t); - - //! convert from word - /*! value should be encoded with the least significant bit as coefficient to x^0 - and most significant bit as coefficient to x^(WORD_BITS-1) - bitLength denotes how much memory to allocate initially - */ - PolynomialMod2(word value, size_t bitLength=WORD_BITS); - - //! convert from big-endian byte array - PolynomialMod2(const byte *encodedPoly, size_t byteCount) - {Decode(encodedPoly, byteCount);} - - //! convert from big-endian form stored in a BufferedTransformation - PolynomialMod2(BufferedTransformation &encodedPoly, size_t byteCount) - {Decode(encodedPoly, byteCount);} - - //! create a random polynomial uniformly distributed over all polynomials with degree less than bitcount - PolynomialMod2(RandomNumberGenerator &rng, size_t bitcount) - {Randomize(rng, bitcount);} - - //! return x^i - static PolynomialMod2 CRYPTOPP_API Monomial(size_t i); - //! return x^t0 + x^t1 + x^t2 - static PolynomialMod2 CRYPTOPP_API Trinomial(size_t t0, size_t t1, size_t t2); - //! return x^t0 + x^t1 + x^t2 + x^t3 + x^t4 - static PolynomialMod2 CRYPTOPP_API Pentanomial(size_t t0, size_t t1, size_t t2, size_t t3, size_t t4); - //! return x^(n-1) + ... + x + 1 - static PolynomialMod2 CRYPTOPP_API AllOnes(size_t n); - - //! - static const PolynomialMod2 & CRYPTOPP_API Zero(); - //! - static const PolynomialMod2 & CRYPTOPP_API One(); - //@} - - //! \name ENCODE/DECODE - //@{ - //! minimum number of bytes to encode this polynomial - /*! MinEncodedSize of 0 is 1 */ - unsigned int MinEncodedSize() const {return STDMAX(1U, ByteCount());} - - //! encode in big-endian format - /*! if outputLen < MinEncodedSize, the most significant bytes will be dropped - if outputLen > MinEncodedSize, the most significant bytes will be padded - */ - void Encode(byte *output, size_t outputLen) const; - //! - void Encode(BufferedTransformation &bt, size_t outputLen) const; - - //! - void Decode(const byte *input, size_t inputLen); - //! - //* Precondition: bt.MaxRetrievable() >= inputLen - void Decode(BufferedTransformation &bt, size_t inputLen); - - //! encode value as big-endian octet string - void DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const; - //! decode value as big-endian octet string - void BERDecodeAsOctetString(BufferedTransformation &bt, size_t length); - //@} - - //! \name ACCESSORS - //@{ - //! number of significant bits = Degree() + 1 - unsigned int BitCount() const; - //! number of significant bytes = ceiling(BitCount()/8) - unsigned int ByteCount() const; - //! number of significant words = ceiling(ByteCount()/sizeof(word)) - unsigned int WordCount() const; - - //! return the n-th bit, n=0 being the least significant bit - bool GetBit(size_t n) const {return GetCoefficient(n)!=0;} - //! return the n-th byte - byte GetByte(size_t n) const; - - //! the zero polynomial will return a degree of -1 - signed int Degree() const {return (signed int)(BitCount()-1U);} - //! degree + 1 - unsigned int CoefficientCount() const {return BitCount();} - //! return coefficient for x^i - int GetCoefficient(size_t i) const - {return (i/WORD_BITS < reg.size()) ? int(reg[i/WORD_BITS] >> (i % WORD_BITS)) & 1 : 0;} - //! return coefficient for x^i - int operator[](unsigned int i) const {return GetCoefficient(i);} - - //! - bool IsZero() const {return !*this;} - //! - bool Equals(const PolynomialMod2 &rhs) const; - //@} - - //! \name MANIPULATORS - //@{ - //! - PolynomialMod2& operator=(const PolynomialMod2& t); - //! - PolynomialMod2& operator&=(const PolynomialMod2& t); - //! - PolynomialMod2& operator^=(const PolynomialMod2& t); - //! - PolynomialMod2& operator+=(const PolynomialMod2& t) {return *this ^= t;} - //! - PolynomialMod2& operator-=(const PolynomialMod2& t) {return *this ^= t;} - //! - PolynomialMod2& operator*=(const PolynomialMod2& t); - //! - PolynomialMod2& operator/=(const PolynomialMod2& t); - //! - PolynomialMod2& operator%=(const PolynomialMod2& t); - //! - PolynomialMod2& operator<<=(unsigned int); - //! - PolynomialMod2& operator>>=(unsigned int); - - //! - void Randomize(RandomNumberGenerator &rng, size_t bitcount); - - //! - void SetBit(size_t i, int value = 1); - //! set the n-th byte to value - void SetByte(size_t n, byte value); - - //! - void SetCoefficient(size_t i, int value) {SetBit(i, value);} - - //! - void swap(PolynomialMod2 &a) {reg.swap(a.reg);} - //@} - - //! \name UNARY OPERATORS - //@{ - //! - bool operator!() const; - //! - PolynomialMod2 operator+() const {return *this;} - //! - PolynomialMod2 operator-() const {return *this;} - //@} - - //! \name BINARY OPERATORS - //@{ - //! - PolynomialMod2 And(const PolynomialMod2 &b) const; - //! - PolynomialMod2 Xor(const PolynomialMod2 &b) const; - //! - PolynomialMod2 Plus(const PolynomialMod2 &b) const {return Xor(b);} - //! - PolynomialMod2 Minus(const PolynomialMod2 &b) const {return Xor(b);} - //! - PolynomialMod2 Times(const PolynomialMod2 &b) const; - //! - PolynomialMod2 DividedBy(const PolynomialMod2 &b) const; - //! - PolynomialMod2 Modulo(const PolynomialMod2 &b) const; - - //! - PolynomialMod2 operator>>(unsigned int n) const; - //! - PolynomialMod2 operator<<(unsigned int n) const; - //@} - - //! \name OTHER ARITHMETIC FUNCTIONS - //@{ - //! sum modulo 2 of all coefficients - unsigned int Parity() const; - - //! check for irreducibility - bool IsIrreducible() const; - - //! is always zero since we're working modulo 2 - PolynomialMod2 Doubled() const {return Zero();} - //! - PolynomialMod2 Squared() const; - - //! only 1 is a unit - bool IsUnit() const {return Equals(One());} - //! return inverse if *this is a unit, otherwise return 0 - PolynomialMod2 MultiplicativeInverse() const {return IsUnit() ? One() : Zero();} - - //! greatest common divisor - static PolynomialMod2 CRYPTOPP_API Gcd(const PolynomialMod2 &a, const PolynomialMod2 &n); - //! calculate multiplicative inverse of *this mod n - PolynomialMod2 InverseMod(const PolynomialMod2 &) const; - - //! calculate r and q such that (a == d*q + r) && (deg(r) < deg(d)) - static void CRYPTOPP_API Divide(PolynomialMod2 &r, PolynomialMod2 &q, const PolynomialMod2 &a, const PolynomialMod2 &d); - //@} - - //! \name INPUT/OUTPUT - //@{ - //! - friend std::ostream& operator<<(std::ostream& out, const PolynomialMod2 &a); - //@} - -private: - friend class GF2NT; - - SecWordBlock reg; -}; - -//! -inline bool operator==(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) -{return a.Equals(b);} -//! -inline bool operator!=(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) -{return !(a==b);} -//! compares degree -inline bool operator> (const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) -{return a.Degree() > b.Degree();} -//! compares degree -inline bool operator>=(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) -{return a.Degree() >= b.Degree();} -//! compares degree -inline bool operator< (const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) -{return a.Degree() < b.Degree();} -//! compares degree -inline bool operator<=(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) -{return a.Degree() <= b.Degree();} -//! -inline CryptoPP::PolynomialMod2 operator&(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.And(b);} -//! -inline CryptoPP::PolynomialMod2 operator^(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Xor(b);} -//! -inline CryptoPP::PolynomialMod2 operator+(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Plus(b);} -//! -inline CryptoPP::PolynomialMod2 operator-(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Minus(b);} -//! -inline CryptoPP::PolynomialMod2 operator*(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Times(b);} -//! -inline CryptoPP::PolynomialMod2 operator/(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.DividedBy(b);} -//! -inline CryptoPP::PolynomialMod2 operator%(const CryptoPP::PolynomialMod2 &a, const CryptoPP::PolynomialMod2 &b) {return a.Modulo(b);} - -// CodeWarrior 8 workaround: put these template instantiations after overloaded operator declarations, -// but before the use of QuotientRing > for VC .NET 2003 -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup; -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing; -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain; -CRYPTOPP_DLL_TEMPLATE_CLASS EuclideanDomainOf; -CRYPTOPP_DLL_TEMPLATE_CLASS QuotientRing >; - -//! GF(2^n) with Polynomial Basis -class CRYPTOPP_DLL GF2NP : public QuotientRing > -{ -public: - GF2NP(const PolynomialMod2 &modulus); - - virtual GF2NP * Clone() const {return new GF2NP(*this);} - virtual void DEREncode(BufferedTransformation &bt) const - {CRYPTOPP_UNUSED(bt); assert(false);} // no ASN.1 syntax yet for general polynomial basis - - void DEREncodeElement(BufferedTransformation &out, const Element &a) const; - void BERDecodeElement(BufferedTransformation &in, Element &a) const; - - bool Equal(const Element &a, const Element &b) const - {assert(a.Degree() < m_modulus.Degree() && b.Degree() < m_modulus.Degree()); return a.Equals(b);} - - bool IsUnit(const Element &a) const - {assert(a.Degree() < m_modulus.Degree()); return !!a;} - - unsigned int MaxElementBitLength() const - {return m;} - - unsigned int MaxElementByteLength() const - {return (unsigned int)BitsToBytes(MaxElementBitLength());} - - Element SquareRoot(const Element &a) const; - - Element HalfTrace(const Element &a) const; - - // returns z such that z^2 + z == a - Element SolveQuadraticEquation(const Element &a) const; - -protected: - unsigned int m; -}; - -//! GF(2^n) with Trinomial Basis -class CRYPTOPP_DLL GF2NT : public GF2NP -{ -public: - // polynomial modulus = x^t0 + x^t1 + x^t2, t0 > t1 > t2 - GF2NT(unsigned int t0, unsigned int t1, unsigned int t2); - - GF2NP * Clone() const {return new GF2NT(*this);} - void DEREncode(BufferedTransformation &bt) const; - - const Element& Multiply(const Element &a, const Element &b) const; - - const Element& Square(const Element &a) const - {return Reduced(a.Squared());} - - const Element& MultiplicativeInverse(const Element &a) const; - -private: - const Element& Reduced(const Element &a) const; - - unsigned int t0, t1; - mutable PolynomialMod2 result; -}; - -//! GF(2^n) with Pentanomial Basis -class CRYPTOPP_DLL GF2NPP : public GF2NP -{ -public: - // polynomial modulus = x^t0 + x^t1 + x^t2 + x^t3 + x^t4, t0 > t1 > t2 > t3 > t4 - GF2NPP(unsigned int t0, unsigned int t1, unsigned int t2, unsigned int t3, unsigned int t4) - : GF2NP(PolynomialMod2::Pentanomial(t0, t1, t2, t3, t4)), t0(t0), t1(t1), t2(t2), t3(t3) {} - - GF2NP * Clone() const {return new GF2NPP(*this);} - void DEREncode(BufferedTransformation &bt) const; - -private: - unsigned int t0, t1, t2, t3; -}; - -// construct new GF2NP from the ASN.1 sequence Characteristic-two -CRYPTOPP_DLL GF2NP * CRYPTOPP_API BERDecodeGF2NP(BufferedTransformation &bt); - -NAMESPACE_END - -#ifndef __BORLANDC__ -NAMESPACE_BEGIN(std) -template<> inline void swap(CryptoPP::PolynomialMod2 &a, CryptoPP::PolynomialMod2 &b) -{ - a.swap(b); -} -NAMESPACE_END -#endif - -#endif diff --git a/external/crypto++-5.6.3/gfpcrypt.cpp b/external/crypto++-5.6.3/gfpcrypt.cpp deleted file mode 100644 index 127091bfd..000000000 --- a/external/crypto++-5.6.3/gfpcrypt.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// dsa.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -// TODO: fix the C4589 warnings -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4189 4589) -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "gfpcrypt.h" -#include "nbtheory.h" -#include "modarith.h" -#include "integer.h" -#include "asn.h" -#include "oids.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void TestInstantiations_gfpcrypt() -{ - GDSA::Signer test; - GDSA::Verifier test1; - DSA::Signer test5(NullRNG(), 100); - DSA::Signer test2(test5); - NR::Signer test3; - NR::Verifier test4; - DLIES<>::Encryptor test6; - DLIES<>::Decryptor test7; -} -#endif - -void DL_GroupParameters_DSA::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - Integer p, q, g; - - if (alg.GetValue("Modulus", p) && alg.GetValue("SubgroupGenerator", g)) - { - q = alg.GetValueWithDefault("SubgroupOrder", ComputeGroupOrder(p)/2); - Initialize(p, q, g); - } - else - { - int modulusSize = 1024, defaultSubgroupOrderSize; - alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); - - switch (modulusSize) - { - case 1024: - defaultSubgroupOrderSize = 160; - break; - case 2048: - defaultSubgroupOrderSize = 224; - break; - case 3072: - defaultSubgroupOrderSize = 256; - break; - default: - throw InvalidArgument("DSA: not a valid prime length"); - } - - DL_GroupParameters_GFP::GenerateRandom(rng, CombinedNameValuePairs(alg, MakeParameters(Name::SubgroupOrderSize(), defaultSubgroupOrderSize, false))); - } -} - -bool DL_GroupParameters_DSA::ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = DL_GroupParameters_GFP::ValidateGroup(rng, level); - int pSize = GetModulus().BitCount(), qSize = GetSubgroupOrder().BitCount(); - pass = pass && ((pSize==1024 && qSize==160) || (pSize==2048 && qSize==224) || (pSize==2048 && qSize==256) || (pSize==3072 && qSize==256)); - return pass; -} - -void DL_SignatureMessageEncodingMethod_DSA::ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); - CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); - assert(recoverableMessageLength == 0); - assert(hashIdentifier.second == 0); - - const size_t representativeByteLength = BitsToBytes(representativeBitLength); - const size_t digestSize = hash.DigestSize(); - const size_t paddingLength = SaturatingSubtract(representativeByteLength, digestSize); - - memset(representative, 0, paddingLength); - hash.TruncatedFinal(representative+paddingLength, STDMIN(representativeByteLength, digestSize)); - - if (digestSize*8 > representativeBitLength) - { - Integer h(representative, representativeByteLength); - h >>= representativeByteLength*8 - representativeBitLength; - h.Encode(representative, representativeByteLength); - } -} - -void DL_SignatureMessageEncodingMethod_NR::ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - CRYPTOPP_UNUSED(rng);CRYPTOPP_UNUSED(recoverableMessage); CRYPTOPP_UNUSED(recoverableMessageLength); - CRYPTOPP_UNUSED(hash); CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(messageEmpty); - CRYPTOPP_UNUSED(representative); CRYPTOPP_UNUSED(representativeBitLength); - - assert(recoverableMessageLength == 0); - assert(hashIdentifier.second == 0); - const size_t representativeByteLength = BitsToBytes(representativeBitLength); - const size_t digestSize = hash.DigestSize(); - const size_t paddingLength = SaturatingSubtract(representativeByteLength, digestSize); - - memset(representative, 0, paddingLength); - hash.TruncatedFinal(representative+paddingLength, STDMIN(representativeByteLength, digestSize)); - - if (digestSize*8 >= representativeBitLength) - { - Integer h(representative, representativeByteLength); - h >>= representativeByteLength*8 - representativeBitLength + 1; - h.Encode(representative, representativeByteLength); - } -} - -bool DL_GroupParameters_IntegerBased::ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const -{ - const Integer &p = GetModulus(), &q = GetSubgroupOrder(); - - bool pass = true; - pass = pass && p > Integer::One() && p.IsOdd(); - pass = pass && q > Integer::One() && q.IsOdd(); - - if (level >= 1) - pass = pass && GetCofactor() > Integer::One() && GetGroupOrder() % q == Integer::Zero(); - if (level >= 2) - pass = pass && VerifyPrime(rng, q, level-2) && VerifyPrime(rng, p, level-2); - - return pass; -} - -bool DL_GroupParameters_IntegerBased::ValidateElement(unsigned int level, const Integer &g, const DL_FixedBasePrecomputation *gpc) const -{ - const Integer &p = GetModulus(), &q = GetSubgroupOrder(); - - bool pass = true; - pass = pass && GetFieldType() == 1 ? g.IsPositive() : g.NotNegative(); - pass = pass && g < p && !IsIdentity(g); - - if (level >= 1) - { - if (gpc) - pass = pass && gpc->Exponentiate(GetGroupPrecomputation(), Integer::One()) == g; - } - if (level >= 2) - { - if (GetFieldType() == 2) - pass = pass && Jacobi(g*g-4, p)==-1; - - // verifying that Lucas((p+1)/2, w, p)==2 is omitted because it's too costly - // and at most 1 bit is leaked if it's false - bool fullValidate = (GetFieldType() == 2 && level >= 3) || !FastSubgroupCheckAvailable(); - - if (fullValidate && pass) - { - Integer gp = gpc ? gpc->Exponentiate(GetGroupPrecomputation(), q) : ExponentiateElement(g, q); - pass = pass && IsIdentity(gp); - } - else if (GetFieldType() == 1) - pass = pass && Jacobi(g, p) == 1; - } - - return pass; -} - -void DL_GroupParameters_IntegerBased::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - Integer p, q, g; - - if (alg.GetValue("Modulus", p) && alg.GetValue("SubgroupGenerator", g)) - { - q = alg.GetValueWithDefault("SubgroupOrder", ComputeGroupOrder(p)/2); - } - else - { - int modulusSize, subgroupOrderSize; - - if (!alg.GetIntValue("ModulusSize", modulusSize)) - modulusSize = alg.GetIntValueWithDefault("KeySize", 2048); - - if (!alg.GetIntValue("SubgroupOrderSize", subgroupOrderSize)) - subgroupOrderSize = GetDefaultSubgroupOrderSize(modulusSize); - - PrimeAndGenerator pg; - pg.Generate(GetFieldType() == 1 ? 1 : -1, rng, modulusSize, subgroupOrderSize); - p = pg.Prime(); - q = pg.SubPrime(); - g = pg.Generator(); - } - - Initialize(p, q, g); -} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -void DL_GroupParameters_IntegerBased::EncodeElement(bool reversible, const Element &element, byte *encoded) const -{ - CRYPTOPP_UNUSED(reversible); - element.Encode(encoded, GetModulus().ByteCount()); -} - -unsigned int DL_GroupParameters_IntegerBased::GetEncodedElementSize(bool reversible) const -{ - CRYPTOPP_UNUSED(reversible); - return GetModulus().ByteCount(); -} -#endif - -Integer DL_GroupParameters_IntegerBased::DecodeElement(const byte *encoded, bool checkForGroupMembership) const -{ - CRYPTOPP_UNUSED(checkForGroupMembership); - Integer g(encoded, GetModulus().ByteCount()); - if (!ValidateElement(1, g, NULL)) - throw DL_BadElement(); - return g; -} - -void DL_GroupParameters_IntegerBased::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder parameters(bt); - Integer p(parameters); - Integer q(parameters); - Integer g; - if (parameters.EndReached()) - { - g = q; - q = ComputeGroupOrder(p) / 2; - } - else - g.BERDecode(parameters); - parameters.MessageEnd(); - - SetModulusAndSubgroupGenerator(p, g); - SetSubgroupOrder(q); -} - -void DL_GroupParameters_IntegerBased::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder parameters(bt); - GetModulus().DEREncode(parameters); - m_q.DEREncode(parameters); - GetSubgroupGenerator().DEREncode(parameters); - parameters.MessageEnd(); -} - -bool DL_GroupParameters_IntegerBased::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper >(this, name, valueType, pValue) - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus); -} - -void DL_GroupParameters_IntegerBased::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY2(Modulus, SubgroupGenerator) - CRYPTOPP_SET_FUNCTION_ENTRY(SubgroupOrder) - ; -} - -OID DL_GroupParameters_IntegerBased::GetAlgorithmID() const -{ - return ASN1::id_dsa(); -} - -void DL_GroupParameters_GFP::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const -{ - ModularArithmetic ma(GetModulus()); - ma.SimultaneousExponentiate(results, base, exponents, exponentsCount); -} - -DL_GroupParameters_GFP::Element DL_GroupParameters_GFP::MultiplyElements(const Element &a, const Element &b) const -{ - return a_times_b_mod_c(a, b, GetModulus()); -} - -DL_GroupParameters_GFP::Element DL_GroupParameters_GFP::CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const -{ - ModularArithmetic ma(GetModulus()); - return ma.CascadeExponentiate(element1, exponent1, element2, exponent2); -} - -Integer DL_GroupParameters_IntegerBased::GetMaxExponent() const -{ - return STDMIN(GetSubgroupOrder()-1, Integer::Power2(2*DiscreteLogWorkFactor(GetFieldType()*GetModulus().BitCount()))); -} - -unsigned int DL_GroupParameters_IntegerBased::GetDefaultSubgroupOrderSize(unsigned int modulusSize) const -{ - return 2*DiscreteLogWorkFactor(GetFieldType()*modulusSize); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/gfpcrypt.h b/external/crypto++-5.6.3/gfpcrypt.h deleted file mode 100644 index 574813015..000000000 --- a/external/crypto++-5.6.3/gfpcrypt.h +++ /dev/null @@ -1,636 +0,0 @@ -#ifndef CRYPTOPP_GFPCRYPT_H -#define CRYPTOPP_GFPCRYPT_H - -/** \file - Implementation of schemes based on DL over GF(p) -*/ - -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4189) -#endif - -#include "cryptlib.h" -#include "pubkey.h" -#include "integer.h" -#include "modexppc.h" -#include "algparam.h" -#include "smartptr.h" -#include "sha.h" -#include "asn.h" -#include "hmac.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters; - -//! _ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBased : public ASN1CryptoMaterial > -{ - typedef DL_GroupParameters_IntegerBased ThisClass; - -public: - void Initialize(const DL_GroupParameters_IntegerBased ¶ms) - {Initialize(params.GetModulus(), params.GetSubgroupOrder(), params.GetSubgroupGenerator());} - void Initialize(RandomNumberGenerator &rng, unsigned int pbits) - {GenerateRandom(rng, MakeParameters("ModulusSize", (int)pbits));} - void Initialize(const Integer &p, const Integer &g) - {SetModulusAndSubgroupGenerator(p, g); SetSubgroupOrder(ComputeGroupOrder(p)/2);} - void Initialize(const Integer &p, const Integer &q, const Integer &g) - {SetModulusAndSubgroupGenerator(p, g); SetSubgroupOrder(q);} - - // ASN1Object interface - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - // GeneratibleCryptoMaterial interface - /*! parameters: (ModulusSize, SubgroupOrderSize (optional)) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // DL_GroupParameters - const Integer & GetSubgroupOrder() const {return m_q;} - Integer GetGroupOrder() const {return GetFieldType() == 1 ? GetModulus()-Integer::One() : GetModulus()+Integer::One();} - bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; - bool ValidateElement(unsigned int level, const Integer &element, const DL_FixedBasePrecomputation *precomp) const; - bool FastSubgroupCheckAvailable() const {return GetCofactor() == 2;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - // Cygwin i386 crash at -O3; see . - void EncodeElement(bool reversible, const Element &element, byte *encoded) const; - unsigned int GetEncodedElementSize(bool reversible) const; -#else - void EncodeElement(bool reversible, const Element &element, byte *encoded) const - {CRYPTOPP_UNUSED(reversible); element.Encode(encoded, GetModulus().ByteCount());} - unsigned int GetEncodedElementSize(bool reversible) const - {CRYPTOPP_UNUSED(reversible); return GetModulus().ByteCount();} -#endif - - Integer DecodeElement(const byte *encoded, bool checkForGroupMembership) const; - Integer ConvertElementToInteger(const Element &element) const - {return element;} - Integer GetMaxExponent() const; - static std::string CRYPTOPP_API StaticAlgorithmNamePrefix() {return "";} - - OID GetAlgorithmID() const; - - virtual const Integer & GetModulus() const =0; - virtual void SetModulusAndSubgroupGenerator(const Integer &p, const Integer &g) =0; - - void SetSubgroupOrder(const Integer &q) - {m_q = q; ParametersChanged();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_IntegerBased() {} -#endif - -protected: - Integer ComputeGroupOrder(const Integer &modulus) const - {return modulus-(GetFieldType() == 1 ? 1 : -1);} - - // GF(p) = 1, GF(p^2) = 2 - virtual int GetFieldType() const =0; - virtual unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const; - -private: - Integer m_q; -}; - -//! _ -template > -class CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBasedImpl : public DL_GroupParametersImpl -{ - typedef DL_GroupParameters_IntegerBasedImpl ThisClass; - -public: - typedef typename GROUP_PRECOMP::Element Element; - - // GeneratibleCryptoMaterial interface - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - {return GetValueHelper(this, name, valueType, pValue).Assignable();} - - void AssignFrom(const NameValuePairs &source) - {AssignFromHelper(this, source);} - - // DL_GroupParameters - const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return this->m_gpc;} - DL_FixedBasePrecomputation & AccessBasePrecomputation() {return this->m_gpc;} - - // IntegerGroupParameters - const Integer & GetModulus() const {return this->m_groupPrecomputation.GetModulus();} - const Integer & GetGenerator() const {return this->m_gpc.GetBase(this->GetGroupPrecomputation());} - - void SetModulusAndSubgroupGenerator(const Integer &p, const Integer &g) // these have to be set together - {this->m_groupPrecomputation.SetModulus(p); this->m_gpc.SetBase(this->GetGroupPrecomputation(), g); this->ParametersChanged();} - - // non-inherited - bool operator==(const DL_GroupParameters_IntegerBasedImpl &rhs) const - {return GetModulus() == rhs.GetModulus() && GetGenerator() == rhs.GetGenerator() && this->GetSubgroupOrder() == rhs.GetSubgroupOrder();} - bool operator!=(const DL_GroupParameters_IntegerBasedImpl &rhs) const - {return !operator==(rhs);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_IntegerBasedImpl() {} -#endif -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_IntegerBasedImpl; - -//! GF(p) group parameters -class CRYPTOPP_DLL DL_GroupParameters_GFP : public DL_GroupParameters_IntegerBasedImpl -{ -public: - // DL_GroupParameters - bool IsIdentity(const Integer &element) const {return element == Integer::One();} - void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; - - // NameValuePairs interface - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper(this, name, valueType, pValue).Assignable(); - } - - // used by MQV - Element MultiplyElements(const Element &a, const Element &b) const; - Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_GFP() {} -#endif - -protected: - int GetFieldType() const {return 1;} -}; - -//! GF(p) group parameters that default to same primes -class CRYPTOPP_DLL DL_GroupParameters_GFP_DefaultSafePrime : public DL_GroupParameters_GFP -{ -public: - typedef NoCofactorMultiplication DefaultCofactorOption; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_GFP_DefaultSafePrime() {} -#endif - -protected: - unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;} -}; - -//! GDSA algorithm -template -class DL_Algorithm_GDSA : public DL_ElgamalLikeSignatureAlgorithm -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "DSA-1363";} - - void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const - { - const Integer &q = params.GetSubgroupOrder(); - r %= q; - Integer kInv = k.InverseMod(q); - s = (kInv * (x*r + e)) % q; - assert(!!r && !!s); - } - - bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const - { - const Integer &q = params.GetSubgroupOrder(); - if (r>=q || r<1 || s>=q || s<1) - return false; - - Integer w = s.InverseMod(q); - Integer u1 = (e * w) % q; - Integer u2 = (r * w) % q; - // verify r == (g^u1 * y^u2 mod p) mod q - return r == params.ConvertElementToInteger(publicKey.CascadeExponentiateBaseAndPublicElement(u1, u2)) % q; - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_GDSA() {} -#endif -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA; - -//! NR algorithm -template -class DL_Algorithm_NR : public DL_ElgamalLikeSignatureAlgorithm -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "NR";} - - void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const - { - const Integer &q = params.GetSubgroupOrder(); - r = (r + e) % q; - s = (k - x*r) % q; - assert(!!r); - } - - bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const - { - const Integer &q = params.GetSubgroupOrder(); - if (r>=q || r<1 || s>=q) - return false; - - // check r == (m_g^s * m_y^r + m) mod m_q - return r == (params.ConvertElementToInteger(publicKey.CascadeExponentiateBaseAndPublicElement(s, r)) + e) % q; - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_NR() {} -#endif -}; - -/*! DSA public key format is defined in 7.3.3 of RFC 2459. The - private key format is defined in 12.9 of PKCS #11 v2.10. */ -template -class DL_PublicKey_GFP : public DL_PublicKeyImpl -{ -public: - void Initialize(const DL_GroupParameters_IntegerBased ¶ms, const Integer &y) - {this->AccessGroupParameters().Initialize(params); this->SetPublicElement(y);} - void Initialize(const Integer &p, const Integer &g, const Integer &y) - {this->AccessGroupParameters().Initialize(p, g); this->SetPublicElement(y);} - void Initialize(const Integer &p, const Integer &q, const Integer &g, const Integer &y) - {this->AccessGroupParameters().Initialize(p, q, g); this->SetPublicElement(y);} - - // X509PublicKey - void BERDecodePublicKey(BufferedTransformation &bt, bool, size_t) - {this->SetPublicElement(Integer(bt));} - void DEREncodePublicKey(BufferedTransformation &bt) const - {this->GetPublicElement().DEREncode(bt);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PublicKey_GFP() {} -#endif -}; - -//! DL private key (in GF(p) groups) -template -class DL_PrivateKey_GFP : public DL_PrivateKeyImpl -{ -public: - void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits) - {this->GenerateRandomWithKeySize(rng, modulusBits);} - void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &g) - {this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupGenerator", g));} - void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &q, const Integer &g) - {this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupOrder", q)("SubgroupGenerator", g));} - void Initialize(const DL_GroupParameters_IntegerBased ¶ms, const Integer &x) - {this->AccessGroupParameters().Initialize(params); this->SetPrivateExponent(x);} - void Initialize(const Integer &p, const Integer &g, const Integer &x) - {this->AccessGroupParameters().Initialize(p, g); this->SetPrivateExponent(x);} - void Initialize(const Integer &p, const Integer &q, const Integer &g, const Integer &x) - {this->AccessGroupParameters().Initialize(p, q, g); this->SetPrivateExponent(x);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PrivateKey_GFP() {} -#endif -}; - -//! DL signing/verification keys (in GF(p) groups) -struct DL_SignatureKeys_GFP -{ - typedef DL_GroupParameters_GFP GroupParameters; - typedef DL_PublicKey_GFP PublicKey; - typedef DL_PrivateKey_GFP PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_SignatureKeys_GFP() {} -#endif -}; - -//! DL encryption/decryption keys (in GF(p) groups) -struct DL_CryptoKeys_GFP -{ - typedef DL_GroupParameters_GFP_DefaultSafePrime GroupParameters; - typedef DL_PublicKey_GFP PublicKey; - typedef DL_PrivateKey_GFP PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_CryptoKeys_GFP() {} -#endif -}; - -//! provided for backwards compatibility, this class uses the old non-standard Crypto++ key format -template -class DL_PublicKey_GFP_OldFormat : public BASE -{ -public: - void BERDecode(BufferedTransformation &bt) - { - BERSequenceDecoder seq(bt); - Integer v1(seq); - Integer v2(seq); - Integer v3(seq); - - if (seq.EndReached()) - { - this->AccessGroupParameters().Initialize(v1, v1/2, v2); - this->SetPublicElement(v3); - } - else - { - Integer v4(seq); - this->AccessGroupParameters().Initialize(v1, v2, v3); - this->SetPublicElement(v4); - } - - seq.MessageEnd(); - } - - void DEREncode(BufferedTransformation &bt) const - { - DERSequenceEncoder seq(bt); - this->GetGroupParameters().GetModulus().DEREncode(seq); - if (this->GetGroupParameters().GetCofactor() != 2) - this->GetGroupParameters().GetSubgroupOrder().DEREncode(seq); - this->GetGroupParameters().GetGenerator().DEREncode(seq); - this->GetPublicElement().DEREncode(seq); - seq.MessageEnd(); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PublicKey_GFP_OldFormat() {} -#endif -}; - -//! provided for backwards compatibility, this class uses the old non-standard Crypto++ key format -template -class DL_PrivateKey_GFP_OldFormat : public BASE -{ -public: - void BERDecode(BufferedTransformation &bt) - { - BERSequenceDecoder seq(bt); - Integer v1(seq); - Integer v2(seq); - Integer v3(seq); - Integer v4(seq); - - if (seq.EndReached()) - { - this->AccessGroupParameters().Initialize(v1, v1/2, v2); - this->SetPrivateExponent(v4 % (v1/2)); // some old keys may have x >= q - } - else - { - Integer v5(seq); - this->AccessGroupParameters().Initialize(v1, v2, v3); - this->SetPrivateExponent(v5); - } - - seq.MessageEnd(); - } - - void DEREncode(BufferedTransformation &bt) const - { - DERSequenceEncoder seq(bt); - this->GetGroupParameters().GetModulus().DEREncode(seq); - if (this->GetGroupParameters().GetCofactor() != 2) - this->GetGroupParameters().GetSubgroupOrder().DEREncode(seq); - this->GetGroupParameters().GetGenerator().DEREncode(seq); - this->GetGroupParameters().ExponentiateBase(this->GetPrivateExponent()).DEREncode(seq); - this->GetPrivateExponent().DEREncode(seq); - seq.MessageEnd(); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PrivateKey_GFP_OldFormat() {} -#endif -}; - -//! DSA-1363 -template -struct GDSA : public DL_SS< - DL_SignatureKeys_GFP, - DL_Algorithm_GDSA, - DL_SignatureMessageEncodingMethod_DSA, - H> -{ -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~GDSA() {} -#endif -}; - -//! NR -template -struct NR : public DL_SS< - DL_SignatureKeys_GFP, - DL_Algorithm_NR, - DL_SignatureMessageEncodingMethod_NR, - H> -{ -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~NR() {} -#endif -}; - -//! DSA group parameters, these are GF(p) group parameters that are allowed by the DSA standard -class CRYPTOPP_DLL DL_GroupParameters_DSA : public DL_GroupParameters_GFP -{ -public: - /*! also checks that the lengths of p and q are allowed by the DSA standard */ - bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const; - /*! parameters: (ModulusSize), or (Modulus, SubgroupOrder, SubgroupGenerator) */ - /*! ModulusSize must be between DSA::MIN_PRIME_LENGTH and DSA::MAX_PRIME_LENGTH, and divisible by DSA::PRIME_LENGTH_MULTIPLE */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - static bool CRYPTOPP_API IsValidPrimeLength(unsigned int pbits) - {return pbits >= MIN_PRIME_LENGTH && pbits <= MAX_PRIME_LENGTH && pbits % PRIME_LENGTH_MULTIPLE == 0;} - - enum {MIN_PRIME_LENGTH = 1024, MAX_PRIME_LENGTH = 3072, PRIME_LENGTH_MULTIPLE = 1024}; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_DSA() {} -#endif -}; - -template -class DSA2; - -//! DSA keys -struct DL_Keys_DSA -{ - typedef DL_PublicKey_GFP PublicKey; - typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, DSA2 > PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Keys_DSA() {} -#endif -}; - -//! DSA, as specified in FIPS 186-3 -// class named DSA2 instead of DSA for backwards compatibility (DSA was a non-template class) -template -class DSA2 : public DL_SS< - DL_Keys_DSA, - DL_Algorithm_GDSA, - DL_SignatureMessageEncodingMethod_DSA, - H, - DSA2 > -{ -public: - static std::string CRYPTOPP_API StaticAlgorithmName() {return "DSA/" + (std::string)H::StaticAlgorithmName();} - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY - enum {MIN_PRIME_LENGTH = 1024, MAX_PRIME_LENGTH = 3072, PRIME_LENGTH_MULTIPLE = 1024}; -#endif - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DSA2() {} -#endif -}; - -//! DSA with SHA-1, typedef'd for backwards compatibility -typedef DSA2 DSA; - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_GFP; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_GFP; -CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest, DSA2 >; - -//! the XOR encryption method, for use with DL-based cryptosystems -template -class DL_EncryptionAlgorithm_Xor : public DL_SymmetricEncryptionAlgorithm -{ -public: - bool ParameterSupported(const char *name) const {return strcmp(name, Name::EncodingParameters()) == 0;} - size_t GetSymmetricKeyLength(size_t plaintextLength) const - {return plaintextLength + MAC::DEFAULT_KEYLENGTH;} - size_t GetSymmetricCiphertextLength(size_t plaintextLength) const - {return plaintextLength + MAC::DIGESTSIZE;} - size_t GetMaxSymmetricPlaintextLength(size_t ciphertextLength) const - {return (unsigned int)SaturatingSubtract(ciphertextLength, (unsigned int)MAC::DIGESTSIZE);} - void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const - { - CRYPTOPP_UNUSED(rng); - const byte *cipherKey = NULL, *macKey = NULL; - if (DHAES_MODE) - { - macKey = key; - cipherKey = key + MAC::DEFAULT_KEYLENGTH; - } - else - { - cipherKey = key; - macKey = key + plaintextLength; - } - - ConstByteArrayParameter encodingParameters; - parameters.GetValue(Name::EncodingParameters(), encodingParameters); - - if (plaintextLength) // Coverity finding - xorbuf(ciphertext, plaintext, cipherKey, plaintextLength); - - MAC mac(macKey); - mac.Update(ciphertext, plaintextLength); - mac.Update(encodingParameters.begin(), encodingParameters.size()); - if (DHAES_MODE) - { - byte L[8] = {0,0,0,0}; - PutWord(false, BIG_ENDIAN_ORDER, L+4, word32(encodingParameters.size())); - mac.Update(L, 8); - } - mac.Final(ciphertext + plaintextLength); - } - DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const - { - size_t plaintextLength = GetMaxSymmetricPlaintextLength(ciphertextLength); - const byte *cipherKey, *macKey; - if (DHAES_MODE) - { - macKey = key; - cipherKey = key + MAC::DEFAULT_KEYLENGTH; - } - else - { - cipherKey = key; - macKey = key + plaintextLength; - } - - ConstByteArrayParameter encodingParameters; - parameters.GetValue(Name::EncodingParameters(), encodingParameters); - - MAC mac(macKey); - mac.Update(ciphertext, plaintextLength); - mac.Update(encodingParameters.begin(), encodingParameters.size()); - if (DHAES_MODE) - { - byte L[8] = {0,0,0,0}; - PutWord(false, BIG_ENDIAN_ORDER, L+4, word32(encodingParameters.size())); - mac.Update(L, 8); - } - if (!mac.Verify(ciphertext + plaintextLength)) - return DecodingResult(); - - if (plaintextLength) // Coverity finding - xorbuf(plaintext, ciphertext, cipherKey, plaintextLength); - - return DecodingResult(plaintextLength); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_EncryptionAlgorithm_Xor() {} -#endif -}; - -//! _ -template -class DL_KeyDerivationAlgorithm_P1363 : public DL_KeyDerivationAlgorithm -{ -public: - bool ParameterSupported(const char *name) const {return strcmp(name, Name::KeyDerivationParameters()) == 0;} - void Derive(const DL_GroupParameters ¶ms, byte *derivedKey, size_t derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs ¶meters) const - { - SecByteBlock agreedSecret; - if (DHAES_MODE) - { - agreedSecret.New(params.GetEncodedElementSize(true) + params.GetEncodedElementSize(false)); - params.EncodeElement(true, ephemeralPublicKey, agreedSecret); - params.EncodeElement(false, agreedElement, agreedSecret + params.GetEncodedElementSize(true)); - } - else - { - agreedSecret.New(params.GetEncodedElementSize(false)); - params.EncodeElement(false, agreedElement, agreedSecret); - } - - ConstByteArrayParameter derivationParameters; - parameters.GetValue(Name::KeyDerivationParameters(), derivationParameters); - KDF::DeriveKey(derivedKey, derivedLength, agreedSecret, agreedSecret.size(), derivationParameters.begin(), derivationParameters.size()); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_KeyDerivationAlgorithm_P1363() {} -#endif -}; - -//! Discrete Log Integrated Encryption Scheme, AKA DLIES -template -struct DLIES - : public DL_ES< - DL_CryptoKeys_GFP, - DL_KeyAgreementAlgorithm_DH, - DL_KeyDerivationAlgorithm_P1363 >, - DL_EncryptionAlgorithm_Xor, DHAES_MODE>, - DLIES<> > -{ - static std::string CRYPTOPP_API StaticAlgorithmName() {return "DLIES";} // TODO: fix this after name is standardized - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DLIES() {} -#endif -}; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/gost.cpp b/external/crypto++-5.6.3/gost.cpp deleted file mode 100644 index bbd829752..000000000 --- a/external/crypto++-5.6.3/gost.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include "pch.h" -#include "gost.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -// these are the S-boxes given in Applied Cryptography 2nd Ed., p. 333 -const byte GOST::Base::sBox[8][16]={ - {4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3}, - {14, 11, 4, 12, 6, 13, 15, 10, 2, 3, 8, 1, 0, 7, 5, 9}, - {5, 8, 1, 13, 10, 3, 4, 2, 14, 15, 12, 7, 6, 0, 9, 11}, - {7, 13, 10, 1, 0, 8, 9, 15, 14, 4, 6, 12, 11, 2, 5, 3}, - {6, 12, 7, 1, 5, 15, 13, 8, 4, 10, 9, 14, 0, 3, 11, 2}, - {4, 11, 10, 0, 7, 2, 1, 13, 3, 6, 8, 5, 9, 12, 15, 14}, - {13, 11, 4, 1, 3, 15, 5, 9, 0, 10, 14, 7, 6, 8, 2, 12}, - {1, 15, 13, 0, 5, 7, 10, 4, 9, 2, 3, 14, 6, 11, 8, 12}}; - -/* // these are the S-boxes given in the GOST source code listing in Applied - // Cryptography 2nd Ed., p. 644. they appear to be from the DES S-boxes - {13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 }, - { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 }, - {12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 }, - { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 }, - { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 }, - {10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 }, - {15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 }, - {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }}; -*/ - -volatile bool GOST::Base::sTableCalculated = false; -word32 GOST::Base::sTable[4][256]; - -void GOST::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - PrecalculateSTable(); - - GetUserKey(LITTLE_ENDIAN_ORDER, key.begin(), 8, userKey, KEYLENGTH); -} - -void GOST::Base::PrecalculateSTable() -{ - if (!sTableCalculated) - { - for (unsigned i = 0; i < 4; i++) - for (unsigned j = 0; j < 256; j++) - { - word32 temp = sBox[2*i][j%16] | (sBox[2*i+1][j/16] << 4); - sTable[i][j] = rotlMod(temp, 11+8*i); - } - - sTableCalculated=true; - } -} - -#define f(x) ( t=x, \ - sTable[3][GETBYTE(t, 3)] ^ sTable[2][GETBYTE(t, 2)] \ - ^ sTable[1][GETBYTE(t, 1)] ^ sTable[0][GETBYTE(t, 0)] ) - -typedef BlockGetAndPut Block; - -void GOST::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 n1, n2, t; - - Block::Get(inBlock)(n1)(n2); - - for (unsigned int i=0; i<3; i++) - { - n2 ^= f(n1+key[0]); - n1 ^= f(n2+key[1]); - n2 ^= f(n1+key[2]); - n1 ^= f(n2+key[3]); - n2 ^= f(n1+key[4]); - n1 ^= f(n2+key[5]); - n2 ^= f(n1+key[6]); - n1 ^= f(n2+key[7]); - } - - n2 ^= f(n1+key[7]); - n1 ^= f(n2+key[6]); - n2 ^= f(n1+key[5]); - n1 ^= f(n2+key[4]); - n2 ^= f(n1+key[3]); - n1 ^= f(n2+key[2]); - n2 ^= f(n1+key[1]); - n1 ^= f(n2+key[0]); - - Block::Put(xorBlock, outBlock)(n2)(n1); -} - -void GOST::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 n1, n2, t; - - Block::Get(inBlock)(n1)(n2); - - n2 ^= f(n1+key[0]); - n1 ^= f(n2+key[1]); - n2 ^= f(n1+key[2]); - n1 ^= f(n2+key[3]); - n2 ^= f(n1+key[4]); - n1 ^= f(n2+key[5]); - n2 ^= f(n1+key[6]); - n1 ^= f(n2+key[7]); - - for (unsigned int i=0; i<3; i++) - { - n2 ^= f(n1+key[7]); - n1 ^= f(n2+key[6]); - n2 ^= f(n1+key[5]); - n1 ^= f(n2+key[4]); - n2 ^= f(n1+key[3]); - n1 ^= f(n2+key[2]); - n2 ^= f(n1+key[1]); - n1 ^= f(n2+key[0]); - } - - Block::Put(xorBlock, outBlock)(n2)(n1); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/gost.h b/external/crypto++-5.6.3/gost.h deleted file mode 100644 index f11f51ec5..000000000 --- a/external/crypto++-5.6.3/gost.h +++ /dev/null @@ -1,60 +0,0 @@ -// gost.h - written and placed in the public domain by Wei Dai - -//! \file gost.h -//! \brief Classes for the GIST block cipher - -#ifndef CRYPTOPP_GOST_H -#define CRYPTOPP_GOST_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32> -{ - static const char *StaticAlgorithmName() {return "GOST";} -}; - -/// GOST -class GOST : public GOST_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - static void PrecalculateSTable(); - - static const byte sBox[8][16]; - static volatile bool sTableCalculated; - static word32 sTable[4][256]; - - FixedSizeSecBlock key; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef GOST::Encryption GOSTEncryption; -typedef GOST::Decryption GOSTDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/gzip.cpp b/external/crypto++-5.6.3/gzip.cpp deleted file mode 100644 index 27ffd3c33..000000000 --- a/external/crypto++-5.6.3/gzip.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// gzip.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "gzip.h" - -NAMESPACE_BEGIN(CryptoPP) - -void Gzip::WritePrestreamHeader() -{ - m_totalLen = 0; - m_crc.Restart(); - - AttachedTransformation()->Put(MAGIC1); - AttachedTransformation()->Put(MAGIC2); - AttachedTransformation()->Put(DEFLATED); - AttachedTransformation()->Put(0); // general flag - AttachedTransformation()->PutWord32(0); // time stamp - byte extra = byte((GetDeflateLevel() == 1) ? FAST : ((GetDeflateLevel() == 9) ? SLOW : 0)); - AttachedTransformation()->Put(extra); - AttachedTransformation()->Put(GZIP_OS_CODE); -} - -void Gzip::ProcessUncompressedData(const byte *inString, size_t length) -{ - m_crc.Update(inString, length); - m_totalLen += (word32)length; -} - -void Gzip::WritePoststreamTail() -{ - SecByteBlock crc(4); - m_crc.Final(crc); - AttachedTransformation()->Put(crc, 4); - AttachedTransformation()->PutWord32(m_totalLen, LITTLE_ENDIAN_ORDER); -} - -// ************************************************************* - -Gunzip::Gunzip(BufferedTransformation *attachment, bool repeat, int propagation) - : Inflator(attachment, repeat, propagation), m_length(0) -{ -} - -void Gunzip::ProcessPrestreamHeader() -{ - m_length = 0; - m_crc.Restart(); - - byte buf[6]; - byte b, flags; - - if (m_inQueue.Get(buf, 2)!=2) throw HeaderErr(); - if (buf[0] != MAGIC1 || buf[1] != MAGIC2) throw HeaderErr(); - if (!m_inQueue.Skip(1)) throw HeaderErr(); // skip extra flags - if (!m_inQueue.Get(flags)) throw HeaderErr(); - if (flags & (ENCRYPTED | CONTINUED)) throw HeaderErr(); - if (m_inQueue.Skip(6)!=6) throw HeaderErr(); // Skip file time, extra flags and OS type - - if (flags & EXTRA_FIELDS) // skip extra fields - { - word16 length; - if (m_inQueue.GetWord16(length, LITTLE_ENDIAN_ORDER) != 2) throw HeaderErr(); - if (m_inQueue.Skip(length)!=length) throw HeaderErr(); - } - - if (flags & FILENAME) // skip filename - do - if(!m_inQueue.Get(b)) throw HeaderErr(); - while (b); - - if (flags & COMMENTS) // skip comments - do - if(!m_inQueue.Get(b)) throw HeaderErr(); - while (b); -} - -void Gunzip::ProcessDecompressedData(const byte *inString, size_t length) -{ - AttachedTransformation()->Put(inString, length); - m_crc.Update(inString, length); - m_length += (word32)length; -} - -void Gunzip::ProcessPoststreamTail() -{ - SecByteBlock crc(4); - if (m_inQueue.Get(crc, 4) != 4) - throw TailErr(); - if (!m_crc.Verify(crc)) - throw CrcErr(); - - word32 lengthCheck; - if (m_inQueue.GetWord32(lengthCheck, LITTLE_ENDIAN_ORDER) != 4) - throw TailErr(); - if (lengthCheck != m_length) - throw LengthErr(); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/gzip.h b/external/crypto++-5.6.3/gzip.h deleted file mode 100644 index 84a799000..000000000 --- a/external/crypto++-5.6.3/gzip.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef CRYPTOPP_GZIP_H -#define CRYPTOPP_GZIP_H - -#include "cryptlib.h" -#include "zdeflate.h" -#include "zinflate.h" -#include "crc.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// GZIP Compression (RFC 1952) -class Gzip : public Deflator -{ -public: - Gzip(BufferedTransformation *attachment=NULL, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true) - : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible), m_totalLen(0) {} - Gzip(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL) - : Deflator(parameters, attachment), m_totalLen(0) {} - -protected: - enum {MAGIC1=0x1f, MAGIC2=0x8b, // flags for the header - DEFLATED=8, FAST=4, SLOW=2}; - - void WritePrestreamHeader(); - void ProcessUncompressedData(const byte *string, size_t length); - void WritePoststreamTail(); - - word32 m_totalLen; - CRC32 m_crc; -}; - -//! \class Gunzip -//! \brief GZIP Decompression (RFC 1952) -class Gunzip : public Inflator -{ -public: - typedef Inflator::Err Err; - class HeaderErr : public Err {public: HeaderErr() : Err(INVALID_DATA_FORMAT, "Gunzip: header decoding error") {}}; - class TailErr : public Err {public: TailErr() : Err(INVALID_DATA_FORMAT, "Gunzip: tail too short") {}}; - class CrcErr : public Err {public: CrcErr() : Err(DATA_INTEGRITY_CHECK_FAILED, "Gunzip: CRC check error") {}}; - class LengthErr : public Err {public: LengthErr() : Err(DATA_INTEGRITY_CHECK_FAILED, "Gunzip: length check error") {}}; - - //! \brief Construct a Gunzip - //! \param attachment a \ BufferedTransformation to attach to this object - //! \param repeat decompress multiple compressed streams in series - //! \param autoSignalPropagation 0 to turn off MessageEnd signal - Gunzip(BufferedTransformation *attachment = NULL, bool repeat = false, int autoSignalPropagation = -1); - -protected: - enum { - //! \brief First header magic value - MAGIC1=0x1f, - //! \brief Second header magic value - MAGIC2=0x8b, - //! \brief Deflated flag - DEFLATED=8 - }; - - enum FLAG_MASKS { - CONTINUED=2, EXTRA_FIELDS=4, FILENAME=8, COMMENTS=16, ENCRYPTED=32}; - - unsigned int MaxPrestreamHeaderSize() const {return 1024;} - void ProcessPrestreamHeader(); - void ProcessDecompressedData(const byte *string, size_t length); - unsigned int MaxPoststreamTailSize() const {return 8;} - void ProcessPoststreamTail(); - - word32 m_length; - CRC32 m_crc; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/hex.cpp b/external/crypto++-5.6.3/hex.cpp deleted file mode 100644 index 5731df550..000000000 --- a/external/crypto++-5.6.3/hex.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// hex.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "hex.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const byte s_vecUpper[] = "0123456789ABCDEF"; -static const byte s_vecLower[] = "0123456789abcdef"; - -void HexEncoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true); - m_filter->Initialize(CombinedNameValuePairs( - parameters, - MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 4, true))); -} - -void HexDecoder::IsolatedInitialize(const NameValuePairs ¶meters) -{ - BaseN_Decoder::IsolatedInitialize(CombinedNameValuePairs( - parameters, - MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 4, true))); -} - -const int *HexDecoder::GetDefaultDecodingLookupArray() -{ - static volatile bool s_initialized = false; - static int s_array[256]; - - if (!s_initialized) - { - InitializeDecodingLookupArray(s_array, s_vecUpper, 16, true); - s_initialized = true; - } - return s_array; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/hex.h b/external/crypto++-5.6.3/hex.h deleted file mode 100644 index a9700648e..000000000 --- a/external/crypto++-5.6.3/hex.h +++ /dev/null @@ -1,42 +0,0 @@ -// hex.h - written and placed in the public domain by Wei Dai - -//! \file -//! \brief Classes for HexEncoder and HexDecoder - -#ifndef CRYPTOPP_HEX_H -#define CRYPTOPP_HEX_H - -#include "cryptlib.h" -#include "basecode.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Converts given data to base 16 -class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter -{ -public: - HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "") - : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) - { - IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator))); - } - - void IsolatedInitialize(const NameValuePairs ¶meters); -}; - -//! Decode base 16 data back to bytes -class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder -{ -public: - HexDecoder(BufferedTransformation *attachment = NULL) - : BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {} - - void IsolatedInitialize(const NameValuePairs ¶meters); - -private: - static const int * CRYPTOPP_API GetDefaultDecodingLookupArray(); -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/hkdf.h b/external/crypto++-5.6.3/hkdf.h deleted file mode 100644 index 3222bade3..000000000 --- a/external/crypto++-5.6.3/hkdf.h +++ /dev/null @@ -1,100 +0,0 @@ -// hkdf.h - written and placed in public domain by Jeffrey Walton. Copyright assigned to Crypto++ project. - -#ifndef CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H -#define CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H - -#include "cryptlib.h" -#include "hrtimer.h" -#include "secblock.h" -#include "hmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! abstract base class for key derivation function -class KeyDerivationFunction -{ -public: - //! maximum number of bytes which can be produced under a secuirty context - virtual size_t MaxDerivedKeyLength() const =0; - virtual bool Usesinfo() const =0; - //! derive a key from secret - virtual unsigned int DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte* info=NULL, size_t infoLen=0) const =0; - - virtual ~KeyDerivationFunction() {} -}; - -//! General, multipurpose KDF from RFC 5869. T should be a HashTransformation class -//! https://eprint.iacr.org/2010/264 and https://tools.ietf.org/html/rfc5869 -template -class HKDF : public KeyDerivationFunction -{ -public: - static const char* StaticAlgorithmName () { - static const std::string name(std::string("HKDF(") + std::string(T::StaticAlgorithmName()) + std::string(")")); - return name.c_str(); - } - size_t MaxDerivedKeyLength() const {return static_cast(T::DIGESTSIZE) * 255;} - bool Usesinfo() const {return true;} - unsigned int DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte* info, size_t infoLen) const; - -protected: - // If salt is missing (NULL), then use the NULL vector. Missing is different than EMPTY (0 length). The length - // of s_NullVector used depends on the Hash function. SHA-256 will use 32 bytes of s_NullVector. - typedef byte NullVectorType[T::DIGESTSIZE]; - static const NullVectorType& GetNullVector() { - static const NullVectorType s_NullVector = {0}; - return s_NullVector; - } -}; - -template -unsigned int HKDF::DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte* info, size_t infoLen) const -{ - static const size_t DIGEST_SIZE = static_cast(T::DIGESTSIZE); - const unsigned int req = static_cast(derivedLen); - - assert(secret && secretLen); - assert(derived && derivedLen); - assert(derivedLen <= MaxDerivedKeyLength()); - - if (derivedLen > MaxDerivedKeyLength()) - throw InvalidArgument("HKDF: derivedLen must be less than or equal to MaxDerivedKeyLength"); - - HMAC hmac; - FixedSizeSecBlock prk, buffer; - - // Extract - const byte* key = (salt ? salt : GetNullVector()); - const size_t klen = (salt ? saltLen : DIGEST_SIZE); - - hmac.SetKey(key, klen); - hmac.CalculateDigest(prk, secret, secretLen); - - // Expand - hmac.SetKey(prk.data(), prk.size()); - byte block = 0; - - while (derivedLen > 0) - { - if (block++) {hmac.Update(buffer, buffer.size());} - if (info && infoLen) {hmac.Update(info, infoLen);} - hmac.CalculateDigest(buffer, &block, 1); - -#if CRYPTOPP_MSC_VERSION - const size_t segmentLen = STDMIN(derivedLen, DIGEST_SIZE); - memcpy_s(derived, segmentLen, buffer, segmentLen); -#else - const size_t segmentLen = STDMIN(derivedLen, DIGEST_SIZE); - std::memcpy(derived, buffer, segmentLen); -#endif - - derived += segmentLen; - derivedLen -= segmentLen; - } - - return req; -} - -NAMESPACE_END - -#endif // CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H diff --git a/external/crypto++-5.6.3/hmac.cpp b/external/crypto++-5.6.3/hmac.cpp deleted file mode 100644 index d4a649c08..000000000 --- a/external/crypto++-5.6.3/hmac.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// hmac.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "hmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -void HMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) -{ - AssertValidKeyLength(keylength); - - Restart(); - - HashTransformation &hash = AccessHash(); - unsigned int blockSize = hash.BlockSize(); - - if (!blockSize) - throw InvalidArgument("HMAC: can only be used with a block-based hash function"); - - m_buf.resize(2*AccessHash().BlockSize() + AccessHash().DigestSize()); - - if (keylength <= blockSize) - memcpy(AccessIpad(), userKey, keylength); - else - { - AccessHash().CalculateDigest(AccessIpad(), userKey, keylength); - keylength = hash.DigestSize(); - } - - assert(keylength <= blockSize); - memset(AccessIpad()+keylength, 0, blockSize-keylength); - - for (unsigned int i=0; i, public MessageAuthenticationCode -{ -public: - HMAC_Base() : m_innerHashKeyed(false) {} - void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); - - void Restart(); - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *mac, size_t size); - unsigned int OptimalBlockSize() const {return const_cast(this)->AccessHash().OptimalBlockSize();} - unsigned int DigestSize() const {return const_cast(this)->AccessHash().DigestSize();} - -protected: - virtual HashTransformation & AccessHash() =0; - byte * AccessIpad() {return m_buf;} - byte * AccessOpad() {return m_buf + AccessHash().BlockSize();} - byte * AccessInnerHash() {return m_buf + 2*AccessHash().BlockSize();} - -private: - void KeyInnerHash(); - - SecByteBlock m_buf; - bool m_innerHashKeyed; -}; - -//! HMAC -/*! HMAC(K, text) = H(K XOR opad, H(K XOR ipad, text)) */ -template -class HMAC : public MessageAuthenticationCodeImpl > -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE=T::DIGESTSIZE) - CRYPTOPP_CONSTANT(BLOCKSIZE=T::BLOCKSIZE) - - HMAC() {} - HMAC(const byte *key, size_t length=HMAC_Base::DEFAULT_KEYLENGTH) - {this->SetKey(key, length);} - - static std::string StaticAlgorithmName() {return std::string("HMAC(") + T::StaticAlgorithmName() + ")";} - std::string AlgorithmName() const {return std::string("HMAC(") + m_hash.AlgorithmName() + ")";} - -private: - HashTransformation & AccessHash() {return m_hash;} - - T m_hash; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/hrtimer.cpp b/external/crypto++-5.6.3/hrtimer.cpp deleted file mode 100644 index 7d4beee7d..000000000 --- a/external/crypto++-5.6.3/hrtimer.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// hrtimer.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "hrtimer.h" -#include "misc.h" -#include // for NULL -#include - -#if defined(CRYPTOPP_WIN32_AVAILABLE) -#include -#elif defined(CRYPTOPP_UNIX_AVAILABLE) -#include -#include -#include -#endif - -#include - -NAMESPACE_BEGIN(CryptoPP) - -#ifndef CRYPTOPP_IMPORTS - -double TimerBase::ConvertTo(TimerWord t, Unit unit) -{ - static unsigned long unitsPerSecondTable[] = {1, 1000, 1000*1000, 1000*1000*1000}; - - // When 'unit' is an enum 'Unit', a Clang warning is generated. - assert(static_cast(unit) < COUNTOF(unitsPerSecondTable)); - return (double)CRYPTOPP_VC6_INT64 t * unitsPerSecondTable[unit] / CRYPTOPP_VC6_INT64 TicksPerSecond(); -} - -void TimerBase::StartTimer() -{ - m_last = m_start = GetCurrentTimerValue(); - m_started = true; -} - -double TimerBase::ElapsedTimeAsDouble() -{ - if (m_stuckAtZero) - return 0; - - if (m_started) - { - TimerWord now = GetCurrentTimerValue(); - if (m_last < now) // protect against OS bugs where time goes backwards - m_last = now; - return ConvertTo(m_last - m_start, m_timerUnit); - } - - StartTimer(); - return 0; -} - -unsigned long TimerBase::ElapsedTime() -{ - double elapsed = ElapsedTimeAsDouble(); - assert(elapsed <= ULONG_MAX); - return (unsigned long)elapsed; -} - -TimerWord Timer::GetCurrentTimerValue() -{ -#if defined(CRYPTOPP_WIN32_AVAILABLE) - // Use the first union member to avoid an uninitialized warning - LARGE_INTEGER now = {0,0}; - if (!QueryPerformanceCounter(&now)) - throw Exception(Exception::OTHER_ERROR, "Timer: QueryPerformanceCounter failed with error " + IntToString(GetLastError())); - return now.QuadPart; -#elif defined(CRYPTOPP_UNIX_AVAILABLE) - timeval now; - gettimeofday(&now, NULL); - return (TimerWord)now.tv_sec * 1000000 + now.tv_usec; -#else - // clock_t now; - return clock(); -#endif -} - -TimerWord Timer::TicksPerSecond() -{ -#if defined(CRYPTOPP_WIN32_AVAILABLE) - // Use the second union member to avoid an uninitialized warning - static LARGE_INTEGER freq = {0,0}; - if (freq.QuadPart == 0) - { - if (!QueryPerformanceFrequency(&freq)) - throw Exception(Exception::OTHER_ERROR, "Timer: QueryPerformanceFrequency failed with error " + IntToString(GetLastError())); - } - return freq.QuadPart; -#elif defined(CRYPTOPP_UNIX_AVAILABLE) - return 1000000; -#else - return CLOCKS_PER_SEC; -#endif -} - -#endif // #ifndef CRYPTOPP_IMPORTS - -TimerWord ThreadUserTimer::GetCurrentTimerValue() -{ -#if defined(CRYPTOPP_WIN32_AVAILABLE) - static bool getCurrentThreadImplemented = true; - if (getCurrentThreadImplemented) - { - FILETIME now, ignored; - if (!GetThreadTimes(GetCurrentThread(), &ignored, &ignored, &ignored, &now)) - { - DWORD lastError = GetLastError(); - if (lastError == ERROR_CALL_NOT_IMPLEMENTED) - { - getCurrentThreadImplemented = false; - goto GetCurrentThreadNotImplemented; - } - throw Exception(Exception::OTHER_ERROR, "ThreadUserTimer: GetThreadTimes failed with error " + IntToString(lastError)); - } - return now.dwLowDateTime + ((TimerWord)now.dwHighDateTime << 32); - } -GetCurrentThreadNotImplemented: - return (TimerWord)clock() * (10*1000*1000 / CLOCKS_PER_SEC); -#elif defined(CRYPTOPP_UNIX_AVAILABLE) - tms now; - times(&now); - return now.tms_utime; -#else - return clock(); -#endif -} - -TimerWord ThreadUserTimer::TicksPerSecond() -{ -#if defined(CRYPTOPP_WIN32_AVAILABLE) - return 10*1000*1000; -#elif defined(CRYPTOPP_UNIX_AVAILABLE) - static const long ticksPerSecond = sysconf(_SC_CLK_TCK); - return ticksPerSecond; -#else - return CLOCKS_PER_SEC; -#endif -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/hrtimer.h b/external/crypto++-5.6.3/hrtimer.h deleted file mode 100644 index b44221c1d..000000000 --- a/external/crypto++-5.6.3/hrtimer.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef CRYPTOPP_HRTIMER_H -#define CRYPTOPP_HRTIMER_H - -#include "config.h" -#ifndef HIGHRES_TIMER_AVAILABLE -#include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#ifdef HIGHRES_TIMER_AVAILABLE - typedef word64 TimerWord; -#else - typedef clock_t TimerWord; -#endif - -//! _ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TimerBase -{ -public: - enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS}; - TimerBase(Unit unit, bool stuckAtZero) - : m_timerUnit(unit), m_stuckAtZero(stuckAtZero), m_started(false) - , m_start(0), m_last(0) {} - - virtual TimerWord GetCurrentTimerValue() =0; // GetCurrentTime is a macro in MSVC 6.0 - virtual TimerWord TicksPerSecond() =0; // this is not the resolution, just a conversion factor into seconds - - void StartTimer(); - double ElapsedTimeAsDouble(); - unsigned long ElapsedTime(); - -private: - double ConvertTo(TimerWord t, Unit unit); - - Unit m_timerUnit; // HPUX workaround: m_unit is a system macro on HPUX - bool m_stuckAtZero, m_started; - TimerWord m_start, m_last; -}; - -//! measure CPU time spent executing instructions of this thread (if supported by OS) -/*! /note This only works correctly on Windows NT or later. On Unix it reports process time, and others wall clock time. -*/ -class ThreadUserTimer : public TimerBase -{ -public: - ThreadUserTimer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} - TimerWord GetCurrentTimerValue(); - TimerWord TicksPerSecond(); -}; - -//! high resolution timer -class CRYPTOPP_DLL Timer : public TimerBase -{ -public: - Timer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} - TimerWord GetCurrentTimerValue(); - TimerWord TicksPerSecond(); -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ida.cpp b/external/crypto++-5.6.3/ida.cpp deleted file mode 100644 index d031c8157..000000000 --- a/external/crypto++-5.6.3/ida.cpp +++ /dev/null @@ -1,423 +0,0 @@ -// ida.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#include "ida.h" -#include "algebra.h" -#include "gf2_32.h" -#include "polynomi.h" -#include "polynomi.cpp" - -#include - -ANONYMOUS_NAMESPACE_BEGIN -static const CryptoPP::GF2_32 field; -NAMESPACE_END - -NAMESPACE_BEGIN(CryptoPP) - -void RawIDA::IsolatedInitialize(const NameValuePairs ¶meters) -{ - if (!parameters.GetIntValue("RecoveryThreshold", m_threshold)) - throw InvalidArgument("RawIDA: missing RecoveryThreshold argument"); - - assert(m_threshold > 0); - if (m_threshold <= 0) - throw InvalidArgument("RawIDA: RecoveryThreshold must be greater than 0"); - - m_lastMapPosition = m_inputChannelMap.end(); - m_channelsReady = 0; - m_channelsFinished = 0; - m_w.New(m_threshold); - m_y.New(m_threshold); - m_inputQueues.reserve(m_threshold); - - m_outputChannelIds.clear(); - m_outputChannelIdStrings.clear(); - m_outputQueues.clear(); - - word32 outputChannelID; - if (parameters.GetValue("OutputChannelID", outputChannelID)) - AddOutputChannel(outputChannelID); - else - { - int nShares = parameters.GetIntValueWithDefault("NumberOfShares", m_threshold); - assert(nShares > 0); - if (nShares <= 0) {nShares = m_threshold;} - for (unsigned int i=0; i< (unsigned int)(nShares); i++) - AddOutputChannel(i); - } -} - -unsigned int RawIDA::InsertInputChannel(word32 channelId) -{ - if (m_lastMapPosition != m_inputChannelMap.end()) - { - if (m_lastMapPosition->first == channelId) - goto skipFind; - ++m_lastMapPosition; - if (m_lastMapPosition != m_inputChannelMap.end() && m_lastMapPosition->first == channelId) - goto skipFind; - } - m_lastMapPosition = m_inputChannelMap.find(channelId); - -skipFind: - if (m_lastMapPosition == m_inputChannelMap.end()) - { - if (m_inputChannelIds.size() == size_t(m_threshold)) - return m_threshold; - - m_lastMapPosition = m_inputChannelMap.insert(InputChannelMap::value_type(channelId, (unsigned int)m_inputChannelIds.size())).first; - m_inputQueues.push_back(MessageQueue()); - m_inputChannelIds.push_back(channelId); - - if (m_inputChannelIds.size() == size_t(m_threshold)) - PrepareInterpolation(); - } - return m_lastMapPosition->second; -} - -unsigned int RawIDA::LookupInputChannel(word32 channelId) const -{ - std::map::const_iterator it = m_inputChannelMap.find(channelId); - if (it == m_inputChannelMap.end()) - return m_threshold; - else - return it->second; -} - -void RawIDA::ChannelData(word32 channelId, const byte *inString, size_t length, bool messageEnd) -{ - int i = InsertInputChannel(channelId); - if (i < m_threshold) - { - lword size = m_inputQueues[i].MaxRetrievable(); - m_inputQueues[i].Put(inString, length); - if (size < 4 && size + length >= 4) - { - m_channelsReady++; - if (m_channelsReady == size_t(m_threshold)) - ProcessInputQueues(); - } - - if (messageEnd) - { - m_inputQueues[i].MessageEnd(); - if (m_inputQueues[i].NumberOfMessages() == 1) - { - m_channelsFinished++; - if (m_channelsFinished == size_t(m_threshold)) - { - m_channelsReady = 0; - for (i=0; i= m_v.size()) - { - m_v.resize(i+1); - m_outputToInput.resize(i+1); - } - - m_outputToInput[i] = LookupInputChannel(m_outputChannelIds[i]); - if (m_outputToInput[i] == size_t(m_threshold) && i * size_t(m_threshold) <= 1000*1000) - { - m_v[i].resize(m_threshold); - PrepareBulkPolynomialInterpolationAt(field, m_v[i].begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold); - } -} - -void RawIDA::AddOutputChannel(word32 channelId) -{ - m_outputChannelIds.push_back(channelId); - m_outputChannelIdStrings.push_back(WordToString(channelId)); - m_outputQueues.push_back(ByteQueue()); - if (m_inputChannelIds.size() == size_t(m_threshold)) - ComputeV((unsigned int)m_outputChannelIds.size() - 1); -} - -void RawIDA::PrepareInterpolation() -{ - assert(m_inputChannelIds.size() == size_t(m_threshold)); - PrepareBulkPolynomialInterpolation(field, m_w.begin(), &(m_inputChannelIds[0]), (unsigned int)(m_threshold)); - for (unsigned int i=0; i 0 : m_channelsReady == size_t(m_threshold)) - { - m_channelsReady = 0; - for (i=0; i 0 || queue.MaxRetrievable() >= 4; - } - - for (i=0; (unsigned int)i 0 && m_outputQueues[0].AnyRetrievable()) - FlushOutputQueues(); - - if (finished) - { - OutputMessageEnds(); - - m_channelsReady = 0; - m_channelsFinished = 0; - m_v.clear(); - - std::vector inputQueues; - std::vector inputChannelIds; - - inputQueues.swap(m_inputQueues); - inputChannelIds.swap(m_inputChannelIds); - m_inputChannelMap.clear(); - m_lastMapPosition = m_inputChannelMap.end(); - - for (i=0; iChannelMessageEnd(m_outputChannelIdStrings[i], GetAutoSignalPropagation()-1); - } -} - -// **************************************************************** - -void SecretSharing::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_pad = parameters.GetValueWithDefault("AddPadding", true); - m_ida.IsolatedInitialize(parameters); -} - -size_t SecretSharing::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("SecretSharing"); - - SecByteBlock buf(UnsignedMin(256, length)); - unsigned int threshold = m_ida.GetThreshold(); - while (length > 0) - { - size_t len = STDMIN(length, buf.size()); - m_ida.ChannelData(0xffffffff, begin, len, false); - for (unsigned int i=0; i 0) - SecretSharing::Put(0); - } - m_ida.ChannelData(0xffffffff, NULL, 0, true); - for (unsigned int i=0; iMessageEnd(GetAutoSignalPropagation()-1); -} - -// **************************************************************** - -void InformationDispersal::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_nextChannel = 0; - m_pad = parameters.GetValueWithDefault("AddPadding", true); - m_ida.IsolatedInitialize(parameters); -} - -size_t InformationDispersal::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("InformationDispersal"); - - while (length--) - { - m_ida.ChannelData(m_nextChannel, begin, 1, false); - begin++; - m_nextChannel++; - if (m_nextChannel == m_ida.GetThreshold()) - m_nextChannel = 0; - } - - if (messageEnd) - { - m_ida.SetAutoSignalPropagation(messageEnd-1); - if (m_pad) - InformationDispersal::Put(1); - for (word32 i=0; iMessageEnd(GetAutoSignalPropagation()-1); -} - -size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("PaddingRemover"); - - const byte *const end = begin + length; - - if (m_possiblePadding) - { - size_t len = std::find_if(begin, end, std::bind2nd(std::not_equal_to(), byte(0))) - begin; - m_zeroCount += len; - begin += len; - if (begin == end) - return 0; - - AttachedTransformation()->Put(1); - while (m_zeroCount--) - AttachedTransformation()->Put(0); - AttachedTransformation()->Put(*begin++); - m_possiblePadding = false; - } - -#if defined(_MSC_VER) && !defined(__MWERKS__) && (_MSC_VER <= 1300) - // VC60 and VC7 workaround: built-in reverse_iterator has two template parameters, Dinkumware only has one - typedef std::reverse_bidirectional_iterator RevIt; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator RevIt; -#else - typedef std::reverse_iterator RevIt; -#endif - const byte *x = std::find_if(RevIt(end), RevIt(begin), bind2nd(std::not_equal_to(), byte(0))).base(); - if (x != begin && *(x-1) == 1) - { - AttachedTransformation()->Put(begin, x-begin-1); - m_possiblePadding = true; - m_zeroCount = end - x; - } - else - AttachedTransformation()->Put(begin, end-begin); - - if (messageEnd) - { - m_possiblePadding = false; - Output(0, begin, length, messageEnd, blocking); - } - return 0; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/ida.h b/external/crypto++-5.6.3/ida.h deleted file mode 100644 index 3fd51e3dc..000000000 --- a/external/crypto++-5.6.3/ida.h +++ /dev/null @@ -1,161 +0,0 @@ -// ida.h - written and placed in the public domain by Wei Dai - -//! \file ida.h -//! \brief Classes for Information Dispersal Algorithm (IDA) - -#ifndef CRYPTOPP_IDA_H -#define CRYPTOPP_IDA_H - -#include "cryptlib.h" -#include "mqueue.h" -#include "filters.h" -#include "channels.h" -#include "secblock.h" -#include "stdcpp.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// base class for secret sharing and information dispersal -class RawIDA : public AutoSignaling > > -{ -public: - RawIDA(BufferedTransformation *attachment=NULL) - : m_threshold (0), m_channelsReady(0), m_channelsFinished(0) - {Detach(attachment);} - - unsigned int GetThreshold() const {return m_threshold;} - void AddOutputChannel(word32 channelId); - void ChannelData(word32 channelId, const byte *inString, size_t length, bool messageEnd); - lword InputBuffered(word32 channelId) const; - - void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) - { - if (!blocking) - throw BlockingInputOnly("RawIDA"); - ChannelData(StringToWord(channel), begin, length, messageEnd != 0); - return 0; - } - -protected: - virtual void FlushOutputQueues(); - virtual void OutputMessageEnds(); - - unsigned int InsertInputChannel(word32 channelId); - unsigned int LookupInputChannel(word32 channelId) const; - void ComputeV(unsigned int); - void PrepareInterpolation(); - void ProcessInputQueues(); - - typedef std::map InputChannelMap; - InputChannelMap m_inputChannelMap; - InputChannelMap::iterator m_lastMapPosition; - std::vector m_inputQueues; - std::vector m_inputChannelIds, m_outputChannelIds, m_outputToInput; - std::vector m_outputChannelIdStrings; - std::vector m_outputQueues; - int m_threshold; - unsigned int m_channelsReady, m_channelsFinished; - std::vector > m_v; - SecBlock m_u, m_w, m_y; -}; - -/// a variant of Shamir's Secret Sharing Algorithm -class SecretSharing : public CustomFlushPropagation -{ -public: - SecretSharing(RandomNumberGenerator &rng, int threshold, int nShares, BufferedTransformation *attachment=NULL, bool addPadding=true) - : m_rng(rng), m_ida(new OutputProxy(*this, true)) - { - Detach(attachment); - IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("NumberOfShares", nShares)("AddPadding", addPadding)); - } - - void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); - bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) {return m_ida.Flush(hardFlush, propagation, blocking);} - -protected: - RandomNumberGenerator &m_rng; - RawIDA m_ida; - bool m_pad; -}; - -/// a variant of Shamir's Secret Sharing Algorithm -class SecretRecovery : public RawIDA -{ -public: - SecretRecovery(int threshold, BufferedTransformation *attachment=NULL, bool removePadding=true) - : RawIDA(attachment) - {IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("RemovePadding", removePadding));} - - void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); - -protected: - void FlushOutputQueues(); - void OutputMessageEnds(); - - bool m_pad; -}; - -/// a variant of Rabin's Information Dispersal Algorithm -class InformationDispersal : public CustomFlushPropagation -{ -public: - InformationDispersal(int threshold, int nShares, BufferedTransformation *attachment=NULL, bool addPadding=true) - : m_ida(new OutputProxy(*this, true)), m_pad(false), m_nextChannel(0) - { - Detach(attachment); - IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("NumberOfShares", nShares)("AddPadding", addPadding)); - } - - void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); - bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) {return m_ida.Flush(hardFlush, propagation, blocking);} - -protected: - RawIDA m_ida; - bool m_pad; - unsigned int m_nextChannel; -}; - -/// a variant of Rabin's Information Dispersal Algorithm -class InformationRecovery : public RawIDA -{ -public: - InformationRecovery(int threshold, BufferedTransformation *attachment=NULL, bool removePadding=true) - : RawIDA(attachment), m_pad(false) - {IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("RemovePadding", removePadding));} - - void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs); - -protected: - void FlushOutputQueues(); - void OutputMessageEnds(); - - bool m_pad; - ByteQueue m_queue; -}; - -class PaddingRemover : public Unflushable -{ -public: - PaddingRemover(BufferedTransformation *attachment=NULL) - : m_possiblePadding(false), m_zeroCount(0) {Detach(attachment);} - - void IsolatedInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters); m_possiblePadding = false;} - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking); - - // GetPossiblePadding() == false at the end of a message indicates incorrect padding - bool GetPossiblePadding() const {return m_possiblePadding;} - -private: - bool m_possiblePadding; - lword m_zeroCount; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/idea.cpp b/external/crypto++-5.6.3/idea.cpp deleted file mode 100644 index bf5a2dde8..000000000 --- a/external/crypto++-5.6.3/idea.cpp +++ /dev/null @@ -1,193 +0,0 @@ -// idea.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "idea.h" -#include "misc.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const int IDEA_KEYLEN=(6*IDEA::ROUNDS+4); // key schedule length in # of word16s - -#define low16(x) ((x)&0xffff) // compiler should be able to optimize this away if word is 16 bits -#define high16(x) ((x)>>16) - -CRYPTOPP_COMPILE_ASSERT(sizeof(IDEA::Word) >= 2); - -// should use an inline function but macros are still faster in MSVC 4.0 -#define DirectMUL(a,b) \ -{ \ - assert(b <= 0xffff); \ - \ - word32 p=(word32)low16(a)*b; \ - \ - if (p) \ - { \ - p = low16(p) - high16(p); \ - a = (IDEA::Word)p - (IDEA::Word)high16(p); \ - } \ - else \ - a = 1-a-b; \ -} - -#ifdef IDEA_LARGECACHE -volatile bool IDEA::Base::tablesBuilt = false; -word16 IDEA::Base::log[0x10000]; -word16 IDEA::Base::antilog[0x10000]; - -void IDEA::Base::BuildLogTables() -{ - if (tablesBuilt) - return; - else - { - tablesBuilt = true; - - IDEA::Word x=1; - word32 i; - - for (i=0; i<0x10000; i++) - { - antilog[i] = (word16)x; - DirectMUL(x, 3); - } - - for (i=0; i<0x10000; i++) - log[antilog[i]] = (word16)i; - } -} - -void IDEA::Base::LookupKeyLogs() -{ - IDEA::Word* Z=key; - int r=ROUNDS; - do - { - Z[0] = log[Z[0]]; - Z[3] = log[Z[3]]; - Z[4] = log[Z[4]]; - Z[5] = log[Z[5]]; - Z+=6; - } while (--r); - Z[0] = log[Z[0]]; - Z[3] = log[Z[3]]; -} - -inline void IDEA::Base::LookupMUL(IDEA::Word &a, IDEA::Word b) -{ - a = antilog[low16(log[low16(a)]+b)]; -} -#endif // IDEA_LARGECACHE - -void IDEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - -#ifdef IDEA_LARGECACHE - BuildLogTables(); -#endif - - EnKey(userKey); - - if (!IsForwardTransformation()) - DeKey(); - -#ifdef IDEA_LARGECACHE - LookupKeyLogs(); -#endif -} - -void IDEA::Base::EnKey (const byte *userKey) -{ - unsigned int i; - - for (i=0; i<8; i++) - m_key[i] = ((IDEA::Word)userKey[2*i]<<8) | userKey[2*i+1]; - - for (; i> 7)); - } -} - -static IDEA::Word MulInv(IDEA::Word x) -{ - IDEA::Word y=x; - for (unsigned i=0; i<15; i++) - { - DirectMUL(y,low16(y)); - DirectMUL(y,x); - } - return low16(y); -} - -static inline IDEA::Word AddInv(IDEA::Word x) -{ - return low16(0-x); -} - -void IDEA::Base::DeKey() -{ - FixedSizeSecBlock tempkey; - size_t i; - - for (i=0; i0)]); - tempkey[i*6+2] = AddInv(m_key[(ROUNDS-i)*6+2-(i>0)]); - tempkey[i*6+3] = MulInv(m_key[(ROUNDS-i)*6+3]); - tempkey[i*6+4] = m_key[(ROUNDS-1-i)*6+4]; - tempkey[i*6+5] = m_key[(ROUNDS-1-i)*6+5]; - } - - tempkey[i*6+0] = MulInv(m_key[(ROUNDS-i)*6+0]); - tempkey[i*6+1] = AddInv(m_key[(ROUNDS-i)*6+1]); - tempkey[i*6+2] = AddInv(m_key[(ROUNDS-i)*6+2]); - tempkey[i*6+3] = MulInv(m_key[(ROUNDS-i)*6+3]); - - m_key = tempkey; -} - -#ifdef IDEA_LARGECACHE -#define MUL(a,b) LookupMUL(a,b) -#else -#define MUL(a,b) DirectMUL(a,b) -#endif - -void IDEA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - typedef BlockGetAndPut Block; - - const IDEA::Word *key = m_key; - IDEA::Word x0,x1,x2,x3,t0,t1; - Block::Get(inBlock)(x0)(x1)(x2)(x3); - - for (unsigned int i=0; i, public FixedKeyLength<16>, public FixedRounds<8> -{ - static const char *StaticAlgorithmName() {return "IDEA";} -}; - -/// IDEA -class IDEA : public IDEA_Info, public BlockCipherDocumentation -{ -public: // made public for internal purposes -#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - typedef word Word; -#else - typedef hword Word; -#endif - -private: - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - unsigned int OptimalDataAlignment() const {return 2;} - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - private: - void EnKey(const byte *); - void DeKey(); - FixedSizeSecBlock m_key; - - #ifdef IDEA_LARGECACHE - static inline void LookupMUL(word &a, word b); - void LookupKeyLogs(); - static void BuildLogTables(); - static volatile bool tablesBuilt; - static word16 log[0x10000], antilog[0x10000]; - #endif - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef IDEA::Encryption IDEAEncryption; -typedef IDEA::Decryption IDEADecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/integer.cpp b/external/crypto++-5.6.3/integer.cpp deleted file mode 100644 index 679a94eb5..000000000 --- a/external/crypto++-5.6.3/integer.cpp +++ /dev/null @@ -1,4404 +0,0 @@ -// integer.cpp - written and placed in the public domain by Wei Dai -// contains public domain code contributed by Alister Lee and Leonard Janke - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wunused" -# pragma GCC diagnostic ignored "-Wunused-but-set-variable" -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "integer.h" -#include "secblock.h" -#include "modarith.h" -#include "nbtheory.h" -#include "smartptr.h" -#include "algparam.h" -#include "filters.h" -#include "asn.h" -#include "oids.h" -#include "words.h" -#include "pubkey.h" // for P1363_KDF2 -#include "sha.h" -#include "cpu.h" -#include "misc.h" - -#include - -#if _MSC_VER >= 1400 - #include -#endif - -#ifdef __DECCXX - #include -#endif - -#ifdef CRYPTOPP_MSVC6_NO_PP - #pragma message("You do not seem to have the Visual C++ Processor Pack installed, so use of SSE2 instructions will be disabled.") -#endif - -// "Inline assembly operands don't work with .intel_syntax", -// http://llvm.org/bugs/show_bug.cgi?id=24232 -#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) -# undef CRYPTOPP_X86_ASM_AVAILABLE -# undef CRYPTOPP_X32_ASM_AVAILABLE -# undef CRYPTOPP_X64_ASM_AVAILABLE -# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE -# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 -# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 -#else -# define CRYPTOPP_INTEGER_SSE2 (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && CRYPTOPP_BOOL_X86) -#endif - -NAMESPACE_BEGIN(CryptoPP) - -// Debian QEMU/ARMEL issue in MultiplyTop; see http://github.com/weidai11/cryptopp/issues/31. -#if __ARMEL__ && (CRYPTOPP_GCC_VERSION >= 50200) && (CRYPTOPP_GCC_VERSION < 50300) && __OPTIMIZE__ -# define WORKAROUND_ARMEL_BUG 1 -#endif - -// Debian QEMU/ARM64 issue in Integer or ModularArithmetic; see http://github.com/weidai11/cryptopp/issues/61. -#if (__aarch64__ || __AARCH64EL__) && (CRYPTOPP_GCC_VERSION >= 50200) && (CRYPTOPP_GCC_VERSION < 50300) -# define WORKAROUND_ARM64_BUG 1 -#endif - -#if WORKAROUND_ARMEL_BUG -# pragma GCC push_options -# pragma GCC optimize("O1") -#endif - -#if WORKAROUND_ARM64_BUG -# pragma GCC push_options -# pragma GCC optimize("no-devirtualize") -#endif - -bool AssignIntToInteger(const std::type_info &valueType, void *pInteger, const void *pInt) -{ - if (valueType != typeid(Integer)) - return false; - *reinterpret_cast(pInteger) = *reinterpret_cast(pInt); - return true; -} - -inline static int Compare(const word *A, const word *B, size_t N) -{ - while (N--) - if (A[N] > B[N]) - return 1; - else if (A[N] < B[N]) - return -1; - - return 0; -} - -inline static int Increment(word *A, size_t N, word B=1) -{ - assert(N); - word t = A[0]; - A[0] = t+B; - if (A[0] >= t) - return 0; - for (unsigned i=1; i>(WORD_BITS-1)); d##0 = 2*d##0 + (c>>(WORD_BITS-1)); c *= 2; - #endif - #ifndef Acc2WordsBy2 - #define Acc2WordsBy2(a, b) a##0 += b##0; a##1 += a##0 < b##0; a##1 += b##1; - #endif - #define AddWithCarry(u, a, b) {word t = a+b; u##0 = t + u##1; u##1 = (ta) + (u##0>t);} - #define GetCarry(u) u##1 - #define GetBorrow(u) u##1 -#else - #define Declare2Words(x) dword x; - #if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) - #define MultiplyWords(p, a, b) p = __emulu(a, b); - #else - #define MultiplyWords(p, a, b) p = (dword)a*b; - #endif - #define AssignWord(a, b) a = b; - #define Add2WordsBy1(a, b, c) a = b + c; - #define Acc2WordsBy2(a, b) a += b; - #define LowWord(a) word(a) - #define HighWord(a) word(a>>WORD_BITS) - #define Double3Words(c, d) d = 2*d + (c>>(WORD_BITS-1)); c *= 2; - #define AddWithCarry(u, a, b) u = dword(a) + b + GetCarry(u); - #define SubtractWithBorrow(u, a, b) u = dword(a) - b - GetBorrow(u); - #define GetCarry(u) HighWord(u) - #define GetBorrow(u) word(u>>(WORD_BITS*2-1)) -#endif -#ifndef MulAcc - #define MulAcc(c, d, a, b) MultiplyWords(p, a, b); Acc2WordsBy1(p, c); c = LowWord(p); Acc2WordsBy1(d, HighWord(p)); -#endif -#ifndef Acc2WordsBy1 - #define Acc2WordsBy1(a, b) Add2WordsBy1(a, a, b) -#endif -#ifndef Acc3WordsBy2 - #define Acc3WordsBy2(c, d, e) Acc2WordsBy1(e, c); c = LowWord(e); Add2WordsBy1(e, d, HighWord(e)); -#endif - -class DWord -{ -public: - // Converity finding on default ctor. We've isntrumented the code, - // and cannot uncover a case where it affects a result. -#if (defined(__COVERITY__) || !defined(NDEBUG)) && defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE) - // Repeating pattern of 1010 for debug builds to break things... - DWord() : m_whole(0) {memset(&m_whole, 0xa, sizeof(m_whole));} -#elif (defined(__COVERITY__) || !defined(NDEBUG)) && !defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE) - // Repeating pattern of 1010 for debug builds to break things... - DWord() : m_halfs() {memset(&m_halfs, 0xa, sizeof(m_halfs));} -#else - DWord() {} -#endif - -#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - explicit DWord(word low) : m_whole(low) {} -#else - explicit DWord(word low) - { - m_halfs.low = low; - m_halfs.high = 0; - } -#endif - - DWord(word low, word high) - { - m_halfs.low = low; - m_halfs.high = high; - } - - static DWord Multiply(word a, word b) - { - DWord r; - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - r.m_whole = (dword)a * b; - #elif defined(MultiplyWordsLoHi) - MultiplyWordsLoHi(r.m_halfs.low, r.m_halfs.high, a, b); - #else - assert(0); - #endif - return r; - } - - static DWord MultiplyAndAdd(word a, word b, word c) - { - DWord r = Multiply(a, b); - return r += c; - } - - DWord & operator+=(word a) - { - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - m_whole = m_whole + a; - #else - m_halfs.low += a; - m_halfs.high += (m_halfs.low < a); - #endif - return *this; - } - - DWord operator+(word a) - { - DWord r; - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - r.m_whole = m_whole + a; - #else - r.m_halfs.low = m_halfs.low + a; - r.m_halfs.high = m_halfs.high + (r.m_halfs.low < a); - #endif - return r; - } - - DWord operator-(DWord a) - { - DWord r; - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - r.m_whole = m_whole - a.m_whole; - #else - r.m_halfs.low = m_halfs.low - a.m_halfs.low; - r.m_halfs.high = m_halfs.high - a.m_halfs.high - (r.m_halfs.low > m_halfs.low); - #endif - return r; - } - - DWord operator-(word a) - { - DWord r; - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - r.m_whole = m_whole - a; - #else - r.m_halfs.low = m_halfs.low - a; - r.m_halfs.high = m_halfs.high - (r.m_halfs.low > m_halfs.low); - #endif - return r; - } - - // returns quotient, which must fit in a word - word operator/(word divisor); - - word operator%(word a); - - bool operator!() const - { - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - return !m_whole; - #else - return !m_halfs.high && !m_halfs.low; - #endif - } - - word GetLowHalf() const {return m_halfs.low;} - word GetHighHalf() const {return m_halfs.high;} - word GetHighHalfAsBorrow() const {return 0-m_halfs.high;} - -private: - union - { - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - dword m_whole; - #endif - struct - { - #ifdef IS_LITTLE_ENDIAN - word low; - word high; - #else - word high; - word low; - #endif - } m_halfs; - }; -}; - -class Word -{ -public: - // Converity finding on default ctor. We've isntrumented the code, - // and cannot uncover a case where it affects a result. -#if defined(__COVERITY__) - Word() : m_whole(0) {} -#elif !defined(NDEBUG) - // Repeating pattern of 1010 for debug builds to break things... - Word() : m_whole(0) {memset(&m_whole, 0xa, sizeof(m_whole));} -#else - Word() {} -#endif - - Word(word value) : m_whole(value) {} - Word(hword low, hword high) : m_whole(low | (word(high) << (WORD_BITS/2))) {} - - static Word Multiply(hword a, hword b) - { - Word r; - r.m_whole = (word)a * b; - return r; - } - - Word operator-(Word a) - { - Word r; - r.m_whole = m_whole - a.m_whole; - return r; - } - - Word operator-(hword a) - { - Word r; - r.m_whole = m_whole - a; - return r; - } - - // returns quotient, which must fit in a word - hword operator/(hword divisor) - { - return hword(m_whole / divisor); - } - - bool operator!() const - { - return !m_whole; - } - - word GetWhole() const {return m_whole;} - hword GetLowHalf() const {return hword(m_whole);} - hword GetHighHalf() const {return hword(m_whole>>(WORD_BITS/2));} - hword GetHighHalfAsBorrow() const {return 0-hword(m_whole>>(WORD_BITS/2));} - -private: - word m_whole; -}; - -// do a 3 word by 2 word divide, returns quotient and leaves remainder in A -template -S DivideThreeWordsByTwo(S *A, S B0, S B1, D *dummy=NULL) -{ - CRYPTOPP_UNUSED(dummy); - - // assert {A[2],A[1]} < {B1,B0}, so quotient can fit in a S - assert(A[2] < B1 || (A[2]==B1 && A[1] < B0)); - - // estimate the quotient: do a 2 S by 1 S divide - S Q; - if (S(B1+1) == 0) - Q = A[2]; - else if (B1 > 0) - Q = D(A[1], A[2]) / S(B1+1); - else - Q = D(A[0], A[1]) / B0; - - // now subtract Q*B from A - D p = D::Multiply(B0, Q); - D u = (D) A[0] - p.GetLowHalf(); - A[0] = u.GetLowHalf(); - u = (D) A[1] - p.GetHighHalf() - u.GetHighHalfAsBorrow() - D::Multiply(B1, Q); - A[1] = u.GetLowHalf(); - A[2] += u.GetHighHalf(); - - // Q <= actual quotient, so fix it - while (A[2] || A[1] > B1 || (A[1]==B1 && A[0]>=B0)) - { - u = (D) A[0] - B0; - A[0] = u.GetLowHalf(); - u = (D) A[1] - B1 - u.GetHighHalfAsBorrow(); - A[1] = u.GetLowHalf(); - A[2] += u.GetHighHalf(); - Q++; - assert(Q); // shouldn't overflow - } - - return Q; -} - -// do a 4 word by 2 word divide, returns 2 word quotient in Q0 and Q1 -template -inline D DivideFourWordsByTwo(S *T, const D &Al, const D &Ah, const D &B) -{ - if (!B) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) - return D(Ah.GetLowHalf(), Ah.GetHighHalf()); - else - { - S Q[2]; - T[0] = Al.GetLowHalf(); - T[1] = Al.GetHighHalf(); - T[2] = Ah.GetLowHalf(); - T[3] = Ah.GetHighHalf(); - Q[1] = DivideThreeWordsByTwo(T+1, B.GetLowHalf(), B.GetHighHalf()); - Q[0] = DivideThreeWordsByTwo(T, B.GetLowHalf(), B.GetHighHalf()); - return D(Q[0], Q[1]); - } -} - -// returns quotient, which must fit in a word -inline word DWord::operator/(word a) -{ - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - return word(m_whole / a); - #else - hword r[4]; - return DivideFourWordsByTwo(r, m_halfs.low, m_halfs.high, a).GetWhole(); - #endif -} - -inline word DWord::operator%(word a) -{ - #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - return word(m_whole % a); - #else - if (a < (word(1) << (WORD_BITS/2))) - { - hword h = hword(a); - word r = m_halfs.high % h; - r = ((m_halfs.low >> (WORD_BITS/2)) + (r << (WORD_BITS/2))) % h; - return hword((hword(m_halfs.low) + (r << (WORD_BITS/2))) % h); - } - else - { - hword r[4]; - DivideFourWordsByTwo(r, m_halfs.low, m_halfs.high, a); - return Word(r[0], r[1]).GetWhole(); - } - #endif -} - -// ******************************************************** - -// Use some tricks to share assembly code between MSVC and GCC -#if defined(__GNUC__) - #define AddPrologue \ - int result; \ - __asm__ __volatile__ \ - ( \ - INTEL_NOPREFIX - #define AddEpilogue \ - ".att_syntax prefix;" \ - : "=a" (result)\ - : "d" (C), "a" (A), "D" (B), "c" (N) \ - : "%esi", "memory", "cc" \ - );\ - return result; - #define MulPrologue \ - __asm__ __volatile__ \ - ( \ - ".intel_syntax noprefix;" \ - AS1( push ebx) \ - AS2( mov ebx, edx) - #define MulEpilogue \ - AS1( pop ebx) \ - ".att_syntax prefix;" \ - : \ - : "d" (s_maskLow16), "c" (C), "a" (A), "D" (B) \ - : "%esi", "memory", "cc" \ - ); - #define SquPrologue MulPrologue - #define SquEpilogue \ - AS1( pop ebx) \ - ".att_syntax prefix;" \ - : \ - : "d" (s_maskLow16), "c" (C), "a" (A) \ - : "%esi", "%edi", "memory", "cc" \ - ); - #define TopPrologue MulPrologue - #define TopEpilogue \ - AS1( pop ebx) \ - ".att_syntax prefix;" \ - : \ - : "d" (s_maskLow16), "c" (C), "a" (A), "D" (B), "S" (L) \ - : "memory", "cc" \ - ); -#else - #define AddPrologue \ - __asm push edi \ - __asm push esi \ - __asm mov eax, [esp+12] \ - __asm mov edi, [esp+16] - #define AddEpilogue \ - __asm pop esi \ - __asm pop edi \ - __asm ret 8 -#if _MSC_VER < 1300 - #define SaveEBX __asm push ebx - #define RestoreEBX __asm pop ebx -#else - #define SaveEBX - #define RestoreEBX -#endif - #define SquPrologue \ - AS2( mov eax, A) \ - AS2( mov ecx, C) \ - SaveEBX \ - AS2( lea ebx, s_maskLow16) - #define MulPrologue \ - AS2( mov eax, A) \ - AS2( mov edi, B) \ - AS2( mov ecx, C) \ - SaveEBX \ - AS2( lea ebx, s_maskLow16) - #define TopPrologue \ - AS2( mov eax, A) \ - AS2( mov edi, B) \ - AS2( mov ecx, C) \ - AS2( mov esi, L) \ - SaveEBX \ - AS2( lea ebx, s_maskLow16) - #define SquEpilogue RestoreEBX - #define MulEpilogue RestoreEBX - #define TopEpilogue RestoreEBX -#endif - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -int Baseline_Add(size_t N, word *C, const word *A, const word *B); -int Baseline_Sub(size_t N, word *C, const word *A, const word *B); -} -#elif defined(CRYPTOPP_X64_ASM_AVAILABLE) && defined(__GNUC__) && defined(CRYPTOPP_WORD128_AVAILABLE) -int Baseline_Add(size_t N, word *C, const word *A, const word *B) -{ - word result; - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS1( neg %1) - ASJ( jz, 1, f) - AS2( mov %0,[%3+8*%1]) - AS2( add %0,[%4+8*%1]) - AS2( mov [%2+8*%1],%0) - ASL(0) - AS2( mov %0,[%3+8*%1+8]) - AS2( adc %0,[%4+8*%1+8]) - AS2( mov [%2+8*%1+8],%0) - AS2( lea %1,[%1+2]) - ASJ( jrcxz, 1, f) - AS2( mov %0,[%3+8*%1]) - AS2( adc %0,[%4+8*%1]) - AS2( mov [%2+8*%1],%0) - ASJ( jmp, 0, b) - ASL(1) - AS2( mov %0, 0) - AS2( adc %0, %0) - ATT_NOPREFIX - : "=&r" (result), "+c" (N) - : "r" (C+N), "r" (A+N), "r" (B+N) - : "memory", "cc" - ); - return (int)result; -} - -int Baseline_Sub(size_t N, word *C, const word *A, const word *B) -{ - word result; - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS1( neg %1) - ASJ( jz, 1, f) - AS2( mov %0,[%3+8*%1]) - AS2( sub %0,[%4+8*%1]) - AS2( mov [%2+8*%1],%0) - ASL(0) - AS2( mov %0,[%3+8*%1+8]) - AS2( sbb %0,[%4+8*%1+8]) - AS2( mov [%2+8*%1+8],%0) - AS2( lea %1,[%1+2]) - ASJ( jrcxz, 1, f) - AS2( mov %0,[%3+8*%1]) - AS2( sbb %0,[%4+8*%1]) - AS2( mov [%2+8*%1],%0) - ASJ( jmp, 0, b) - ASL(1) - AS2( mov %0, 0) - AS2( adc %0, %0) - ATT_NOPREFIX - : "=&r" (result), "+c" (N) - : "r" (C+N), "r" (A+N), "r" (B+N) - : "memory", "cc" - ); - return (int)result; -} -#elif defined(CRYPTOPP_X86_ASM_AVAILABLE) && CRYPTOPP_BOOL_X86 -CRYPTOPP_NAKED int CRYPTOPP_FASTCALL Baseline_Add(size_t N, word *C, const word *A, const word *B) -{ - AddPrologue - - // now: eax = A, edi = B, edx = C, ecx = N - AS2( lea eax, [eax+4*ecx]) - AS2( lea edi, [edi+4*ecx]) - AS2( lea edx, [edx+4*ecx]) - - AS1( neg ecx) // ecx is negative index - AS2( test ecx, 2) // this clears carry flag - ASJ( jz, 0, f) - AS2( sub ecx, 2) - ASJ( jmp, 1, f) - - ASL(0) - ASJ( jecxz, 2, f) // loop until ecx overflows and becomes zero - AS2( mov esi,[eax+4*ecx]) - AS2( adc esi,[edi+4*ecx]) - AS2( mov [edx+4*ecx],esi) - AS2( mov esi,[eax+4*ecx+4]) - AS2( adc esi,[edi+4*ecx+4]) - AS2( mov [edx+4*ecx+4],esi) - ASL(1) - AS2( mov esi,[eax+4*ecx+8]) - AS2( adc esi,[edi+4*ecx+8]) - AS2( mov [edx+4*ecx+8],esi) - AS2( mov esi,[eax+4*ecx+12]) - AS2( adc esi,[edi+4*ecx+12]) - AS2( mov [edx+4*ecx+12],esi) - - AS2( lea ecx,[ecx+4]) // advance index, avoid inc which causes slowdown on Intel Core 2 - ASJ( jmp, 0, b) - - ASL(2) - AS2( mov eax, 0) - AS1( setc al) // store carry into eax (return result register) - - AddEpilogue -} - -CRYPTOPP_NAKED int CRYPTOPP_FASTCALL Baseline_Sub(size_t N, word *C, const word *A, const word *B) -{ - AddPrologue - - // now: eax = A, edi = B, edx = C, ecx = N - AS2( lea eax, [eax+4*ecx]) - AS2( lea edi, [edi+4*ecx]) - AS2( lea edx, [edx+4*ecx]) - - AS1( neg ecx) // ecx is negative index - AS2( test ecx, 2) // this clears carry flag - ASJ( jz, 0, f) - AS2( sub ecx, 2) - ASJ( jmp, 1, f) - - ASL(0) - ASJ( jecxz, 2, f) // loop until ecx overflows and becomes zero - AS2( mov esi,[eax+4*ecx]) - AS2( sbb esi,[edi+4*ecx]) - AS2( mov [edx+4*ecx],esi) - AS2( mov esi,[eax+4*ecx+4]) - AS2( sbb esi,[edi+4*ecx+4]) - AS2( mov [edx+4*ecx+4],esi) - ASL(1) - AS2( mov esi,[eax+4*ecx+8]) - AS2( sbb esi,[edi+4*ecx+8]) - AS2( mov [edx+4*ecx+8],esi) - AS2( mov esi,[eax+4*ecx+12]) - AS2( sbb esi,[edi+4*ecx+12]) - AS2( mov [edx+4*ecx+12],esi) - - AS2( lea ecx,[ecx+4]) // advance index, avoid inc which causes slowdown on Intel Core 2 - ASJ( jmp, 0, b) - - ASL(2) - AS2( mov eax, 0) - AS1( setc al) // store carry into eax (return result register) - - AddEpilogue -} - -#if CRYPTOPP_INTEGER_SSE2 -CRYPTOPP_NAKED int CRYPTOPP_FASTCALL SSE2_Add(size_t N, word *C, const word *A, const word *B) -{ - AddPrologue - - // now: eax = A, edi = B, edx = C, ecx = N - AS2( lea eax, [eax+4*ecx]) - AS2( lea edi, [edi+4*ecx]) - AS2( lea edx, [edx+4*ecx]) - - AS1( neg ecx) // ecx is negative index - AS2( pxor mm2, mm2) - ASJ( jz, 2, f) - AS2( test ecx, 2) // this clears carry flag - ASJ( jz, 0, f) - AS2( sub ecx, 2) - ASJ( jmp, 1, f) - - ASL(0) - AS2( movd mm0, DWORD PTR [eax+4*ecx]) - AS2( movd mm1, DWORD PTR [edi+4*ecx]) - AS2( paddq mm0, mm1) - AS2( paddq mm2, mm0) - AS2( movd DWORD PTR [edx+4*ecx], mm2) - AS2( psrlq mm2, 32) - - AS2( movd mm0, DWORD PTR [eax+4*ecx+4]) - AS2( movd mm1, DWORD PTR [edi+4*ecx+4]) - AS2( paddq mm0, mm1) - AS2( paddq mm2, mm0) - AS2( movd DWORD PTR [edx+4*ecx+4], mm2) - AS2( psrlq mm2, 32) - - ASL(1) - AS2( movd mm0, DWORD PTR [eax+4*ecx+8]) - AS2( movd mm1, DWORD PTR [edi+4*ecx+8]) - AS2( paddq mm0, mm1) - AS2( paddq mm2, mm0) - AS2( movd DWORD PTR [edx+4*ecx+8], mm2) - AS2( psrlq mm2, 32) - - AS2( movd mm0, DWORD PTR [eax+4*ecx+12]) - AS2( movd mm1, DWORD PTR [edi+4*ecx+12]) - AS2( paddq mm0, mm1) - AS2( paddq mm2, mm0) - AS2( movd DWORD PTR [edx+4*ecx+12], mm2) - AS2( psrlq mm2, 32) - - AS2( add ecx, 4) - ASJ( jnz, 0, b) - - ASL(2) - AS2( movd eax, mm2) - AS1( emms) - - AddEpilogue -} -CRYPTOPP_NAKED int CRYPTOPP_FASTCALL SSE2_Sub(size_t N, word *C, const word *A, const word *B) -{ - AddPrologue - - // now: eax = A, edi = B, edx = C, ecx = N - AS2( lea eax, [eax+4*ecx]) - AS2( lea edi, [edi+4*ecx]) - AS2( lea edx, [edx+4*ecx]) - - AS1( neg ecx) // ecx is negative index - AS2( pxor mm2, mm2) - ASJ( jz, 2, f) - AS2( test ecx, 2) // this clears carry flag - ASJ( jz, 0, f) - AS2( sub ecx, 2) - ASJ( jmp, 1, f) - - ASL(0) - AS2( movd mm0, DWORD PTR [eax+4*ecx]) - AS2( movd mm1, DWORD PTR [edi+4*ecx]) - AS2( psubq mm0, mm1) - AS2( psubq mm0, mm2) - AS2( movd DWORD PTR [edx+4*ecx], mm0) - AS2( psrlq mm0, 63) - - AS2( movd mm2, DWORD PTR [eax+4*ecx+4]) - AS2( movd mm1, DWORD PTR [edi+4*ecx+4]) - AS2( psubq mm2, mm1) - AS2( psubq mm2, mm0) - AS2( movd DWORD PTR [edx+4*ecx+4], mm2) - AS2( psrlq mm2, 63) - - ASL(1) - AS2( movd mm0, DWORD PTR [eax+4*ecx+8]) - AS2( movd mm1, DWORD PTR [edi+4*ecx+8]) - AS2( psubq mm0, mm1) - AS2( psubq mm0, mm2) - AS2( movd DWORD PTR [edx+4*ecx+8], mm0) - AS2( psrlq mm0, 63) - - AS2( movd mm2, DWORD PTR [eax+4*ecx+12]) - AS2( movd mm1, DWORD PTR [edi+4*ecx+12]) - AS2( psubq mm2, mm1) - AS2( psubq mm2, mm0) - AS2( movd DWORD PTR [edx+4*ecx+12], mm2) - AS2( psrlq mm2, 63) - - AS2( add ecx, 4) - ASJ( jnz, 0, b) - - ASL(2) - AS2( movd eax, mm2) - AS1( emms) - - AddEpilogue -} -#endif // #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -#else -int CRYPTOPP_FASTCALL Baseline_Add(size_t N, word *C, const word *A, const word *B) -{ - assert (N%2 == 0); - - Declare2Words(u); - AssignWord(u, 0); - for (size_t i=0; i=2 && N%2==0); - - if (N <= s_recursionLimit) - s_pMul[N/4](R, A, B); - else - { - const size_t N2 = N/2; - - size_t AN2 = Compare(A0, A1, N2) > 0 ? 0 : N2; - Subtract(R0, A + AN2, A + (N2 ^ AN2), N2); - - size_t BN2 = Compare(B0, B1, N2) > 0 ? 0 : N2; - Subtract(R1, B + BN2, B + (N2 ^ BN2), N2); - - RecursiveMultiply(R2, T2, A1, B1, N2); - RecursiveMultiply(T0, T2, R0, R1, N2); - RecursiveMultiply(R0, T2, A0, B0, N2); - - // now T[01] holds (A1-A0)*(B0-B1), R[01] holds A0*B0, R[23] holds A1*B1 - - int c2 = Add(R2, R2, R1, N2); - int c3 = c2; - c2 += Add(R1, R2, R0, N2); - c3 += Add(R2, R2, R3, N2); - - if (AN2 == BN2) - c3 -= Subtract(R1, R1, T0, N); - else - c3 += Add(R1, R1, T0, N); - - c3 += Increment(R2, N2, c2); - assert (c3 >= 0 && c3 <= 2); - Increment(R3, N2, c3); - } -} - -// R[2*N] - result = A*A -// T[2*N] - temporary work space -// A[N] --- number to be squared - -void RecursiveSquare(word *R, word *T, const word *A, size_t N) -{ - assert(N && N%2==0); - - if (N <= s_recursionLimit) - s_pSqu[N/4](R, A); - else - { - const size_t N2 = N/2; - - RecursiveSquare(R0, T2, A0, N2); - RecursiveSquare(R2, T2, A1, N2); - RecursiveMultiply(T0, T2, A0, A1, N2); - - int carry = Add(R1, R1, T0, N); - carry += Add(R1, R1, T0, N); - Increment(R3, N2, carry); - } -} - -// R[N] - bottom half of A*B -// T[3*N/2] - temporary work space -// A[N] - multiplier -// B[N] - multiplicant - -void RecursiveMultiplyBottom(word *R, word *T, const word *A, const word *B, size_t N) -{ - assert(N>=2 && N%2==0); - - if (N <= s_recursionLimit) - s_pBot[N/4](R, A, B); - else - { - const size_t N2 = N/2; - - RecursiveMultiply(R, T, A0, B0, N2); - RecursiveMultiplyBottom(T0, T1, A1, B0, N2); - Add(R1, R1, T0, N2); - RecursiveMultiplyBottom(T0, T1, A0, B1, N2); - Add(R1, R1, T0, N2); - } -} - -// R[N] --- upper half of A*B -// T[2*N] - temporary work space -// L[N] --- lower half of A*B -// A[N] --- multiplier -// B[N] --- multiplicant - -void MultiplyTop(word *R, word *T, const word *L, const word *A, const word *B, size_t N) -{ - assert(N>=2 && N%2==0); - - if (N <= s_recursionLimit) - s_pTop[N/4](R, A, B, L[N-1]); - else - { - const size_t N2 = N/2; - - size_t AN2 = Compare(A0, A1, N2) > 0 ? 0 : N2; - Subtract(R0, A + AN2, A + (N2 ^ AN2), N2); - - size_t BN2 = Compare(B0, B1, N2) > 0 ? 0 : N2; - Subtract(R1, B + BN2, B + (N2 ^ BN2), N2); - - RecursiveMultiply(T0, T2, R0, R1, N2); - RecursiveMultiply(R0, T2, A1, B1, N2); - - // now T[01] holds (A1-A0)*(B0-B1) = A1*B0+A0*B1-A1*B1-A0*B0, R[01] holds A1*B1 - - int t, c3; - int c2 = Subtract(T2, L+N2, L, N2); - - if (AN2 == BN2) - { - c2 -= Add(T2, T2, T0, N2); - t = (Compare(T2, R0, N2) == -1); - c3 = t - Subtract(T2, T2, T1, N2); - } - else - { - c2 += Subtract(T2, T2, T0, N2); - t = (Compare(T2, R0, N2) == -1); - c3 = t + Add(T2, T2, T1, N2); - } - - c2 += t; - if (c2 >= 0) - c3 += Increment(T2, N2, c2); - else - c3 -= Decrement(T2, N2, -c2); - c3 += Add(R0, T2, R1, N2); - - assert (c3 >= 0 && c3 <= 2); - Increment(R1, N2, c3); - } -} - -inline void Multiply(word *R, word *T, const word *A, const word *B, size_t N) -{ - RecursiveMultiply(R, T, A, B, N); -} - -inline void Square(word *R, word *T, const word *A, size_t N) -{ - RecursiveSquare(R, T, A, N); -} - -inline void MultiplyBottom(word *R, word *T, const word *A, const word *B, size_t N) -{ - RecursiveMultiplyBottom(R, T, A, B, N); -} - -// R[NA+NB] - result = A*B -// T[NA+NB] - temporary work space -// A[NA] ---- multiplier -// B[NB] ---- multiplicant - -void AsymmetricMultiply(word *R, word *T, const word *A, size_t NA, const word *B, size_t NB) -{ - if (NA == NB) - { - if (A == B) - Square(R, T, A, NA); - else - Multiply(R, T, A, B, NA); - - return; - } - - if (NA > NB) - { - std::swap(A, B); - std::swap(NA, NB); - } - - assert(NB % NA == 0); - - if (NA==2 && !A[1]) - { - switch (A[0]) - { - case 0: - SetWords(R, 0, NB+2); - return; - case 1: - CopyWords(R, B, NB); - R[NB] = R[NB+1] = 0; - return; - default: - R[NB] = LinearMultiply(R, B, A[0], NB); - R[NB+1] = 0; - return; - } - } - - size_t i; - if ((NB/NA)%2 == 0) - { - Multiply(R, T, A, B, NA); - CopyWords(T+2*NA, R+NA, NA); - - for (i=2*NA; i=4); - -#define M0 M -#define M1 (M+N2) -#define V0 V -#define V1 (V+N2) - -#define X0 X -#define X1 (X+N2) -#define X2 (X+N) -#define X3 (X+N+N2) - - const size_t N2 = N/2; - Multiply(T0, T2, V0, X3, N2); - int c2 = Add(T0, T0, X0, N); - MultiplyBottom(T3, T2, T0, U, N2); - MultiplyTop(T2, R, T0, T3, M0, N2); - c2 -= Subtract(T2, T1, T2, N2); - Multiply(T0, R, T3, M1, N2); - c2 -= Subtract(T0, T2, T0, N2); - int c3 = -(int)Subtract(T1, X2, T1, N2); - Multiply(R0, T2, V1, X3, N2); - c3 += Add(R, R, T, N); - - if (c2>0) - c3 += Increment(R1, N2); - else if (c2<0) - c3 -= Decrement(R1, N2, -c2); - - assert(c3>=-1 && c3<=1); - if (c3>0) - Subtract(R, R, M, N); - else if (c3<0) - Add(R, R, M, N); - -#undef M0 -#undef M1 -#undef V0 -#undef V1 - -#undef X0 -#undef X1 -#undef X2 -#undef X3 -} - -#undef A0 -#undef A1 -#undef B0 -#undef B1 - -#undef T0 -#undef T1 -#undef T2 -#undef T3 - -#undef R0 -#undef R1 -#undef R2 -#undef R3 - -/* -// do a 3 word by 2 word divide, returns quotient and leaves remainder in A -static word SubatomicDivide(word *A, word B0, word B1) -{ - // assert {A[2],A[1]} < {B1,B0}, so quotient can fit in a word - assert(A[2] < B1 || (A[2]==B1 && A[1] < B0)); - - // estimate the quotient: do a 2 word by 1 word divide - word Q; - if (B1+1 == 0) - Q = A[2]; - else - Q = DWord(A[1], A[2]).DividedBy(B1+1); - - // now subtract Q*B from A - DWord p = DWord::Multiply(B0, Q); - DWord u = (DWord) A[0] - p.GetLowHalf(); - A[0] = u.GetLowHalf(); - u = (DWord) A[1] - p.GetHighHalf() - u.GetHighHalfAsBorrow() - DWord::Multiply(B1, Q); - A[1] = u.GetLowHalf(); - A[2] += u.GetHighHalf(); - - // Q <= actual quotient, so fix it - while (A[2] || A[1] > B1 || (A[1]==B1 && A[0]>=B0)) - { - u = (DWord) A[0] - B0; - A[0] = u.GetLowHalf(); - u = (DWord) A[1] - B1 - u.GetHighHalfAsBorrow(); - A[1] = u.GetLowHalf(); - A[2] += u.GetHighHalf(); - Q++; - assert(Q); // shouldn't overflow - } - - return Q; -} - -// do a 4 word by 2 word divide, returns 2 word quotient in Q0 and Q1 -static inline void AtomicDivide(word *Q, const word *A, const word *B) -{ - if (!B[0] && !B[1]) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) - { - Q[0] = A[2]; - Q[1] = A[3]; - } - else - { - word T[4]; - T[0] = A[0]; T[1] = A[1]; T[2] = A[2]; T[3] = A[3]; - Q[1] = SubatomicDivide(T+1, B[0], B[1]); - Q[0] = SubatomicDivide(T, B[0], B[1]); - -#ifndef NDEBUG - // multiply quotient and divisor and add remainder, make sure it equals dividend - assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0](T, DWord(A[0], A[1]), DWord(A[2], A[3]), DWord(B[0], B[1])); - Q[0] = q.GetLowHalf(); - Q[1] = q.GetHighHalf(); - -#ifndef NDEBUG - if (B[0] || B[1]) - { - // multiply quotient and divisor and add remainder, make sure it equals dividend - assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0]= 0) - { - R[N] -= Subtract(R, R, B, N); - Q[1] += (++Q[0]==0); - assert(Q[0] || Q[1]); // no overflow - } -} - -// R[NB] -------- remainder = A%B -// Q[NA-NB+2] --- quotient = A/B -// T[NA+3*(NB+2)] - temp work space -// A[NA] -------- dividend -// B[NB] -------- divisor - -void Divide(word *R, word *Q, word *T, const word *A, size_t NA, const word *B, size_t NB) -{ - assert(NA && NB && NA%2==0 && NB%2==0); - assert(B[NB-1] || B[NB-2]); - assert(NB <= NA); - - // set up temporary work space - word *const TA=T; - word *const TB=T+NA+2; - word *const TP=T+NA+2+NB; - - // copy B into TB and normalize it so that TB has highest bit set to 1 - unsigned shiftWords = (B[NB-1]==0); - TB[0] = TB[NB-1] = 0; - CopyWords(TB+shiftWords, B, NB-shiftWords); - unsigned shiftBits = WORD_BITS - BitPrecision(TB[NB-1]); - assert(shiftBits < WORD_BITS); - ShiftWordsLeftByBits(TB, NB, shiftBits); - - // copy A into TA and normalize it - TA[0] = TA[NA] = TA[NA+1] = 0; - CopyWords(TA+shiftWords, A, NA); - ShiftWordsLeftByBits(TA, NA+2, shiftBits); - - if (TA[NA+1]==0 && TA[NA] <= 1) - { - Q[NA-NB+1] = Q[NA-NB] = 0; - while (TA[NA] || Compare(TA+NA-NB, TB, NB) >= 0) - { - TA[NA] -= Subtract(TA+NA-NB, TA+NA-NB, TB, NB); - ++Q[NA-NB]; - } - } - else - { - NA+=2; - assert(Compare(TA+NA-NB, TB, NB) < 0); - } - - word BT[2]; - BT[0] = TB[NB-2] + 1; - BT[1] = TB[NB-1] + (BT[0]==0); - - // start reducing TA mod TB, 2 words at a time - for (size_t i=NA-2; i>=NB; i-=2) - { - AtomicDivide(Q+i-NB, TA+i-2, BT); - CorrectQuotientEstimate(TA+i-NB, TP, Q+i-NB, TB, NB); - } - - // copy TA into R, and denormalize it - CopyWords(R, TA+shiftWords, NB); - ShiftWordsRightByBits(R, NB, shiftBits); -} - -static inline size_t EvenWordCount(const word *X, size_t N) -{ - while (N && X[N-2]==0 && X[N-1]==0) - N-=2; - return N; -} - -// return k -// R[N] --- result = A^(-1) * 2^k mod M -// T[4*N] - temporary work space -// A[NA] -- number to take inverse of -// M[N] --- modulus - -unsigned int AlmostInverse(word *R, word *T, const word *A, size_t NA, const word *M, size_t N) -{ - assert(NA<=N && N && N%2==0); - - word *b = T; - word *c = T+N; - word *f = T+2*N; - word *g = T+3*N; - size_t bcLen=2, fgLen=EvenWordCount(M, N); - unsigned int k=0; - bool s=false; - - SetWords(T, 0, 3*N); - b[0]=1; - CopyWords(f, A, NA); - CopyWords(g, M, N); - - while (1) - { - word t=f[0]; - while (!t) - { - if (EvenWordCount(f, fgLen)==0) - { - SetWords(R, 0, N); - return 0; - } - - ShiftWordsRightByWords(f, fgLen, 1); - bcLen += 2 * (c[bcLen-1] != 0); - assert(bcLen <= N); - ShiftWordsLeftByWords(c, bcLen, 1); - k+=WORD_BITS; - t=f[0]; - } - - // t must be non-0; otherwise undefined. - unsigned int i = TrailingZeros(t); - t >>= i; - k += i; - - if (t==1 && f[1]==0 && EvenWordCount(f+2, fgLen-2)==0) - { - if (s) - Subtract(R, M, b, N); - else - CopyWords(R, b, N); - return k; - } - - ShiftWordsRightByBits(f, fgLen, i); - t = ShiftWordsLeftByBits(c, bcLen, i); - c[bcLen] += t; - bcLen += 2 * (t!=0); - assert(bcLen <= N); - - bool swap = Compare(f, g, fgLen)==-1; - ConditionalSwapPointers(swap, f, g); - ConditionalSwapPointers(swap, b, c); - s ^= swap; - - fgLen -= 2 * !(f[fgLen-2] | f[fgLen-1]); - - Subtract(f, f, g, fgLen); - t = Add(b, b, c, bcLen); - b[bcLen] += t; - bcLen += 2*t; - assert(bcLen <= N); - } -} - -// R[N] - result = A/(2^k) mod M -// A[N] - input -// M[N] - modulus - -void DivideByPower2Mod(word *R, const word *A, size_t k, const word *M, size_t N) -{ - CopyWords(R, A, N); - - while (k--) - { - if (R[0]%2==0) - ShiftWordsRightByBits(R, N, 1); - else - { - word carry = Add(R, R, M, N); - ShiftWordsRightByBits(R, N, 1); - R[N-1] += carry<<(WORD_BITS-1); - } - } -} - -// R[N] - result = A*(2^k) mod M -// A[N] - input -// M[N] - modulus - -void MultiplyByPower2Mod(word *R, const word *A, size_t k, const word *M, size_t N) -{ - CopyWords(R, A, N); - - while (k--) - if (ShiftWordsLeftByBits(R, N, 1) || Compare(R, M, N)>=0) - Subtract(R, R, M, N); -} - -// ****************************************************************** - -InitializeInteger::InitializeInteger() -{ - if (!g_pAssignIntToInteger) - { - SetFunctionPointers(); - g_pAssignIntToInteger = AssignIntToInteger; - } -} - -static const unsigned int RoundupSizeTable[] = {2, 2, 2, 4, 4, 8, 8, 8, 8}; - -static inline size_t RoundupSize(size_t n) -{ - if (n<=8) - return RoundupSizeTable[n]; - else if (n<=16) - return 16; - else if (n<=32) - return 32; - else if (n<=64) - return 64; - else return size_t(1) << BitPrecision(n-1); -} - -Integer::Integer() - : reg(2), sign(POSITIVE) -{ - reg[0] = reg[1] = 0; -} - -Integer::Integer(const Integer& t) - : reg(RoundupSize(t.WordCount())), sign(t.sign) -{ - CopyWords(reg, t.reg, reg.size()); -} - -Integer::Integer(Sign s, lword value) - : reg(2), sign(s) -{ - reg[0] = word(value); - reg[1] = word(SafeRightShift(value)); -} - -Integer::Integer(signed long value) - : reg(2) -{ - if (value >= 0) - sign = POSITIVE; - else - { - sign = NEGATIVE; - value = -value; - } - reg[0] = word(value); - reg[1] = word(SafeRightShift((unsigned long)value)); -} - -Integer::Integer(Sign s, word high, word low) - : reg(2), sign(s) -{ - reg[0] = low; - reg[1] = high; -} - -bool Integer::IsConvertableToLong() const -{ - if (ByteCount() > sizeof(long)) - return false; - - unsigned long value = (unsigned long)reg[0]; - value += SafeLeftShift((unsigned long)reg[1]); - - if (sign==POSITIVE) - return (signed long)value >= 0; - else - return -(signed long)value < 0; -} - -signed long Integer::ConvertToLong() const -{ - assert(IsConvertableToLong()); - - unsigned long value = (unsigned long)reg[0]; - value += SafeLeftShift((unsigned long)reg[1]); - return sign==POSITIVE ? value : -(signed long)value; -} - -Integer::Integer(BufferedTransformation &encodedInteger, size_t byteCount, Signedness s) -{ - Decode(encodedInteger, byteCount, s); -} - -Integer::Integer(const byte *encodedInteger, size_t byteCount, Signedness s) -{ - Decode(encodedInteger, byteCount, s); -} - -Integer::Integer(BufferedTransformation &bt) -{ - BERDecode(bt); -} - -Integer::Integer(RandomNumberGenerator &rng, size_t bitcount) -{ - Randomize(rng, bitcount); -} - -Integer::Integer(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType, const Integer &equiv, const Integer &mod) -{ - if (!Randomize(rng, min, max, rnType, equiv, mod)) - throw Integer::RandomNumberNotFound(); -} - -Integer Integer::Power2(size_t e) -{ - Integer r((word)0, BitsToWords(e+1)); - r.SetBit(e); - return r; -} - -template -struct NewInteger -{ - Integer * operator()() const - { - return new Integer(i); - } -}; - -const Integer &Integer::Zero() -{ - return Singleton().Ref(); -} - -const Integer &Integer::One() -{ - return Singleton >().Ref(); -} - -const Integer &Integer::Two() -{ - return Singleton >().Ref(); -} - -bool Integer::operator!() const -{ - return IsNegative() ? false : (reg[0]==0 && WordCount()==0); -} - -Integer& Integer::operator=(const Integer& t) -{ - if (this != &t) - { - if (reg.size() != t.reg.size() || t.reg[t.reg.size()/2] == 0) - reg.New(RoundupSize(t.WordCount())); - CopyWords(reg, t.reg, reg.size()); - sign = t.sign; - } - return *this; -} - -bool Integer::GetBit(size_t n) const -{ - if (n/WORD_BITS >= reg.size()) - return 0; - else - return bool((reg[n/WORD_BITS] >> (n % WORD_BITS)) & 1); -} - -void Integer::SetBit(size_t n, bool value) -{ - if (value) - { - reg.CleanGrow(RoundupSize(BitsToWords(n+1))); - reg[n/WORD_BITS] |= (word(1) << (n%WORD_BITS)); - } - else - { - if (n/WORD_BITS < reg.size()) - reg[n/WORD_BITS] &= ~(word(1) << (n%WORD_BITS)); - } -} - -byte Integer::GetByte(size_t n) const -{ - if (n/WORD_SIZE >= reg.size()) - return 0; - else - return byte(reg[n/WORD_SIZE] >> ((n%WORD_SIZE)*8)); -} - -void Integer::SetByte(size_t n, byte value) -{ - reg.CleanGrow(RoundupSize(BytesToWords(n+1))); - reg[n/WORD_SIZE] &= ~(word(0xff) << 8*(n%WORD_SIZE)); - reg[n/WORD_SIZE] |= (word(value) << 8*(n%WORD_SIZE)); -} - -lword Integer::GetBits(size_t i, size_t n) const -{ - lword v = 0; - assert(n <= sizeof(v)*8); - for (unsigned int j=0; j -static Integer StringToInteger(const T *str) -{ - int radix; - // GCC workaround - // std::char_traits::length() not defined in GCC 3.2 and STLport 4.5.3 - unsigned int length; - for (length = 0; str[length] != 0; length++) {} - - Integer v; - - if (length == 0) - return v; - - switch (str[length-1]) - { - case 'h': - case 'H': - radix=16; - break; - case 'o': - case 'O': - radix=8; - break; - case 'b': - case 'B': - radix=2; - break; - default: - radix=10; - } - - if (length > 2 && str[0] == '0' && str[1] == 'x') - radix = 16; - - for (unsigned i=0; i= '0' && str[i] <= '9') - digit = str[i] - '0'; - else if (str[i] >= 'A' && str[i] <= 'F') - digit = str[i] - 'A' + 10; - else if (str[i] >= 'a' && str[i] <= 'f') - digit = str[i] - 'a' + 10; - else - digit = radix; - - if (digit < radix) - { - v *= radix; - v += digit; - } - } - - if (str[0] == '-') - v.Negate(); - - return v; -} - -Integer::Integer(const char *str) - : reg(2), sign(POSITIVE) -{ - *this = StringToInteger(str); -} - -Integer::Integer(const wchar_t *str) - : reg(2), sign(POSITIVE) -{ - *this = StringToInteger(str); -} - -unsigned int Integer::WordCount() const -{ - return (unsigned int)CountWords(reg, reg.size()); -} - -unsigned int Integer::ByteCount() const -{ - unsigned wordCount = WordCount(); - if (wordCount) - return (wordCount-1)*WORD_SIZE + BytePrecision(reg[wordCount-1]); - else - return 0; -} - -unsigned int Integer::BitCount() const -{ - unsigned wordCount = WordCount(); - if (wordCount) - return (wordCount-1)*WORD_BITS + BitPrecision(reg[wordCount-1]); - else - return 0; -} - -void Integer::Decode(const byte *input, size_t inputLen, Signedness s) -{ - StringStore store(input, inputLen); - Decode(store, inputLen, s); -} - -void Integer::Decode(BufferedTransformation &bt, size_t inputLen, Signedness s) -{ - assert(bt.MaxRetrievable() >= inputLen); - - byte b; - bt.Peek(b); - sign = ((s==SIGNED) && (b & 0x80)) ? NEGATIVE : POSITIVE; - - while (inputLen>0 && (sign==POSITIVE ? b==0 : b==0xff)) - { - bt.Skip(1); - inputLen--; - bt.Peek(b); - } - - // The call to CleanNew is optimized away above -O0/-Og. - const size_t size = RoundupSize(BytesToWords(inputLen)); - reg.CleanNew(size); - - assert(reg.SizeInBytes() >= inputLen); - for (size_t i=inputLen; i > 0; i--) - { - bt.Get(b); - reg[(i-1)/WORD_SIZE] |= word(b) << ((i-1)%WORD_SIZE)*8; - } - - if (sign == NEGATIVE) - { - for (size_t i=inputLen; i 0; i--) - bt.Put(GetByte(i-1)); - } - else - { - // take two's complement of *this - Integer temp = Integer::Power2(8*STDMAX((size_t)ByteCount(), outputLen)) + *this; - temp.Encode(bt, outputLen, UNSIGNED); - } -} - -void Integer::DEREncode(BufferedTransformation &bt) const -{ - DERGeneralEncoder enc(bt, INTEGER); - Encode(enc, MinEncodedSize(SIGNED), SIGNED); - enc.MessageEnd(); -} - -void Integer::BERDecode(const byte *input, size_t len) -{ - StringStore store(input, len); - BERDecode(store); -} - -void Integer::BERDecode(BufferedTransformation &bt) -{ - BERGeneralDecoder dec(bt, INTEGER); - if (!dec.IsDefiniteLength() || dec.MaxRetrievable() < dec.RemainingLength()) - BERDecodeError(); - Decode(dec, (size_t)dec.RemainingLength(), SIGNED); - dec.MessageEnd(); -} - -void Integer::DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const -{ - DERGeneralEncoder enc(bt, OCTET_STRING); - Encode(enc, length); - enc.MessageEnd(); -} - -void Integer::BERDecodeAsOctetString(BufferedTransformation &bt, size_t length) -{ - BERGeneralDecoder dec(bt, OCTET_STRING); - if (!dec.IsDefiniteLength() || dec.RemainingLength() != length) - BERDecodeError(); - Decode(dec, length); - dec.MessageEnd(); -} - -size_t Integer::OpenPGPEncode(byte *output, size_t len) const -{ - ArraySink sink(output, len); - return OpenPGPEncode(sink); -} - -size_t Integer::OpenPGPEncode(BufferedTransformation &bt) const -{ - word16 bitCount = word16(BitCount()); - bt.PutWord16(bitCount); - size_t byteCount = BitsToBytes(bitCount); - Encode(bt, byteCount); - return 2 + byteCount; -} - -void Integer::OpenPGPDecode(const byte *input, size_t len) -{ - StringStore store(input, len); - OpenPGPDecode(store); -} - -void Integer::OpenPGPDecode(BufferedTransformation &bt) -{ - word16 bitCount; - if (bt.GetWord16(bitCount) != 2 || bt.MaxRetrievable() < BitsToBytes(bitCount)) - throw OpenPGPDecodeErr(); - Decode(bt, BitsToBytes(bitCount)); -} - -void Integer::Randomize(RandomNumberGenerator &rng, size_t nbits) -{ - const size_t nbytes = nbits/8 + 1; - SecByteBlock buf(nbytes); - rng.GenerateBlock(buf, nbytes); - if (nbytes) - buf[0] = (byte)Crop(buf[0], nbits % 8); - Decode(buf, nbytes, UNSIGNED); -} - -void Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max) -{ - if (min > max) - throw InvalidArgument("Integer: Min must be no greater than Max"); - - Integer range = max - min; - const unsigned int nbits = range.BitCount(); - - do - { - Randomize(rng, nbits); - } - while (*this > range); - - *this += min; -} - -bool Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType, const Integer &equiv, const Integer &mod) -{ - return GenerateRandomNoThrow(rng, MakeParameters("Min", min)("Max", max)("RandomNumberType", rnType)("EquivalentTo", equiv)("Mod", mod)); -} - -class KDF2_RNG : public RandomNumberGenerator -{ -public: - KDF2_RNG(const byte *seed, size_t seedSize) - : m_counter(0), m_counterAndSeed(seedSize + 4) - { - memcpy(m_counterAndSeed + 4, seed, seedSize); - } - - void GenerateBlock(byte *output, size_t size) - { - PutWord(false, BIG_ENDIAN_ORDER, m_counterAndSeed, m_counter); - ++m_counter; - P1363_KDF2::DeriveKey(output, size, m_counterAndSeed, m_counterAndSeed.size(), NULL, 0); - } - -private: - word32 m_counter; - SecByteBlock m_counterAndSeed; -}; - -bool Integer::GenerateRandomNoThrow(RandomNumberGenerator &i_rng, const NameValuePairs ¶ms) -{ - Integer min = params.GetValueWithDefault("Min", Integer::Zero()); - Integer max; - if (!params.GetValue("Max", max)) - { - int bitLength; - if (params.GetIntValue("BitLength", bitLength)) - max = Integer::Power2(bitLength); - else - throw InvalidArgument("Integer: missing Max argument"); - } - if (min > max) - throw InvalidArgument("Integer: Min must be no greater than Max"); - - Integer equiv = params.GetValueWithDefault("EquivalentTo", Integer::Zero()); - Integer mod = params.GetValueWithDefault("Mod", Integer::One()); - - if (equiv.IsNegative() || equiv >= mod) - throw InvalidArgument("Integer: invalid EquivalentTo and/or Mod argument"); - - Integer::RandomNumberType rnType = params.GetValueWithDefault("RandomNumberType", Integer::ANY); - - member_ptr kdf2Rng; - ConstByteArrayParameter seed; - if (params.GetValue(Name::Seed(), seed)) - { - ByteQueue bq; - DERSequenceEncoder seq(bq); - min.DEREncode(seq); - max.DEREncode(seq); - equiv.DEREncode(seq); - mod.DEREncode(seq); - DEREncodeUnsigned(seq, rnType); - DEREncodeOctetString(seq, seed.begin(), seed.size()); - seq.MessageEnd(); - - SecByteBlock finalSeed((size_t)bq.MaxRetrievable()); - bq.Get(finalSeed, finalSeed.size()); - kdf2Rng.reset(new KDF2_RNG(finalSeed.begin(), finalSeed.size())); - } - RandomNumberGenerator &rng = kdf2Rng.get() ? (RandomNumberGenerator &)*kdf2Rng : i_rng; - - switch (rnType) - { - case ANY: - if (mod == One()) - Randomize(rng, min, max); - else - { - Integer min1 = min + (equiv-min)%mod; - if (max < min1) - return false; - Randomize(rng, Zero(), (max - min1) / mod); - *this *= mod; - *this += min1; - } - return true; - - case PRIME: - { - const PrimeSelector *pSelector = params.GetValueWithDefault(Name::PointerToPrimeSelector(), (const PrimeSelector *)NULL); - - int i; - i = 0; - while (1) - { - if (++i==16) - { - // check if there are any suitable primes in [min, max] - Integer first = min; - if (FirstPrime(first, max, equiv, mod, pSelector)) - { - // if there is only one suitable prime, we're done - *this = first; - if (!FirstPrime(first, max, equiv, mod, pSelector)) - return true; - } - else - return false; - } - - Randomize(rng, min, max); - if (FirstPrime(*this, STDMIN(*this+mod*PrimeSearchInterval(max), max), equiv, mod, pSelector)) - return true; - } - } - - default: - throw InvalidArgument("Integer: invalid RandomNumberType argument"); - } -} - -std::istream& operator>>(std::istream& in, Integer &a) -{ - char c; - unsigned int length = 0; - SecBlock str(length + 16); - - std::ws(in); - - do - { - in.read(&c, 1); - str[length++] = c; - if (length >= str.size()) - str.Grow(length + 16); - } - while (in && (c=='-' || c=='x' || (c>='0' && c<='9') || (c>='a' && c<='f') || (c>='A' && c<='F') || c=='h' || c=='H' || c=='o' || c=='O' || c==',' || c=='.')); - - if (in.gcount()) - in.putback(c); - str[length-1] = '\0'; - a = Integer(str); - - return in; -} - -std::ostream& operator<<(std::ostream& out, const Integer &a) -{ - // Get relevant conversion specifications from ostream. - const long f = out.flags() & std::ios::basefield; // Get base digits. - int base, block; - char suffix; - switch(f) - { - case std::ios::oct : - base = 8; - block = 8; - suffix = 'o'; - break; - case std::ios::hex : - base = 16; - block = 4; - suffix = 'h'; - break; - default : - base = 10; - block = 3; - suffix = '.'; - } - - Integer temp1=a, temp2; - - if (a.IsNegative()) - { - out << '-'; - temp1.Negate(); - } - - if (!a) - out << '0'; - - static const char upper[]="0123456789ABCDEF"; - static const char lower[]="0123456789abcdef"; - - const char* vec = (out.flags() & std::ios::uppercase) ? upper : lower; - unsigned int i=0; - SecBlock s(a.BitCount() / (SaturatingSubtract1(BitPrecision(base),1U)) + 1); - - while (!!temp1) - { - word digit; - Integer::Divide(digit, temp2, temp1, base); - s[i++]=vec[digit]; - temp1.swap(temp2); - } - - while (i--) - { - out << s[i]; -// if (i && !(i%block)) -// out << ","; - } - - return out << suffix; -} - -Integer& Integer::operator++() -{ - if (NotNegative()) - { - if (Increment(reg, reg.size())) - { - reg.CleanGrow(2*reg.size()); - reg[reg.size()/2]=1; - } - } - else - { - word borrow = Decrement(reg, reg.size()); - assert(!borrow); - CRYPTOPP_UNUSED(borrow); - - if (WordCount()==0) - *this = Zero(); - } - return *this; -} - -Integer& Integer::operator--() -{ - if (IsNegative()) - { - if (Increment(reg, reg.size())) - { - reg.CleanGrow(2*reg.size()); - reg[reg.size()/2]=1; - } - } - else - { - if (Decrement(reg, reg.size())) - *this = -One(); - } - return *this; -} - -void PositiveAdd(Integer &sum, const Integer &a, const Integer& b) -{ - int carry; - if (a.reg.size() == b.reg.size()) - carry = Add(sum.reg, a.reg, b.reg, a.reg.size()); - else if (a.reg.size() > b.reg.size()) - { - carry = Add(sum.reg, a.reg, b.reg, b.reg.size()); - CopyWords(sum.reg+b.reg.size(), a.reg+b.reg.size(), a.reg.size()-b.reg.size()); - carry = Increment(sum.reg+b.reg.size(), a.reg.size()-b.reg.size(), carry); - } - else - { - carry = Add(sum.reg, a.reg, b.reg, a.reg.size()); - CopyWords(sum.reg+a.reg.size(), b.reg+a.reg.size(), b.reg.size()-a.reg.size()); - carry = Increment(sum.reg+a.reg.size(), b.reg.size()-a.reg.size(), carry); - } - - if (carry) - { - sum.reg.CleanGrow(2*sum.reg.size()); - sum.reg[sum.reg.size()/2] = 1; - } - sum.sign = Integer::POSITIVE; -} - -void PositiveSubtract(Integer &diff, const Integer &a, const Integer& b) -{ - unsigned aSize = a.WordCount(); - aSize += aSize%2; - unsigned bSize = b.WordCount(); - bSize += bSize%2; - - if (aSize == bSize) - { - if (Compare(a.reg, b.reg, aSize) >= 0) - { - Subtract(diff.reg, a.reg, b.reg, aSize); - diff.sign = Integer::POSITIVE; - } - else - { - Subtract(diff.reg, b.reg, a.reg, aSize); - diff.sign = Integer::NEGATIVE; - } - } - else if (aSize > bSize) - { - word borrow = Subtract(diff.reg, a.reg, b.reg, bSize); - CopyWords(diff.reg+bSize, a.reg+bSize, aSize-bSize); - borrow = Decrement(diff.reg+bSize, aSize-bSize, borrow); - assert(!borrow); - diff.sign = Integer::POSITIVE; - } - else - { - word borrow = Subtract(diff.reg, b.reg, a.reg, aSize); - CopyWords(diff.reg+aSize, b.reg+aSize, bSize-aSize); - borrow = Decrement(diff.reg+aSize, bSize-aSize, borrow); - assert(!borrow); - diff.sign = Integer::NEGATIVE; - } -} - -// MSVC .NET 2003 workaround -template inline const T& STDMAX2(const T& a, const T& b) -{ - return a < b ? b : a; -} - -Integer Integer::Plus(const Integer& b) const -{ - Integer sum((word)0, STDMAX2(reg.size(), b.reg.size())); - if (NotNegative()) - { - if (b.NotNegative()) - PositiveAdd(sum, *this, b); - else - PositiveSubtract(sum, *this, b); - } - else - { - if (b.NotNegative()) - PositiveSubtract(sum, b, *this); - else - { - PositiveAdd(sum, *this, b); - sum.sign = Integer::NEGATIVE; - } - } - return sum; -} - -Integer& Integer::operator+=(const Integer& t) -{ - reg.CleanGrow(t.reg.size()); - if (NotNegative()) - { - if (t.NotNegative()) - PositiveAdd(*this, *this, t); - else - PositiveSubtract(*this, *this, t); - } - else - { - if (t.NotNegative()) - PositiveSubtract(*this, t, *this); - else - { - PositiveAdd(*this, *this, t); - sign = Integer::NEGATIVE; - } - } - return *this; -} - -Integer Integer::Minus(const Integer& b) const -{ - Integer diff((word)0, STDMAX2(reg.size(), b.reg.size())); - if (NotNegative()) - { - if (b.NotNegative()) - PositiveSubtract(diff, *this, b); - else - PositiveAdd(diff, *this, b); - } - else - { - if (b.NotNegative()) - { - PositiveAdd(diff, *this, b); - diff.sign = Integer::NEGATIVE; - } - else - PositiveSubtract(diff, b, *this); - } - return diff; -} - -Integer& Integer::operator-=(const Integer& t) -{ - reg.CleanGrow(t.reg.size()); - if (NotNegative()) - { - if (t.NotNegative()) - PositiveSubtract(*this, *this, t); - else - PositiveAdd(*this, *this, t); - } - else - { - if (t.NotNegative()) - { - PositiveAdd(*this, *this, t); - sign = Integer::NEGATIVE; - } - else - PositiveSubtract(*this, t, *this); - } - return *this; -} - -Integer& Integer::operator<<=(size_t n) -{ - const size_t wordCount = WordCount(); - const size_t shiftWords = n / WORD_BITS; - const unsigned int shiftBits = (unsigned int)(n % WORD_BITS); - - reg.CleanGrow(RoundupSize(wordCount+BitsToWords(n))); - ShiftWordsLeftByWords(reg, wordCount + shiftWords, shiftWords); - ShiftWordsLeftByBits(reg+shiftWords, wordCount+BitsToWords(shiftBits), shiftBits); - return *this; -} - -Integer& Integer::operator>>=(size_t n) -{ - const size_t wordCount = WordCount(); - const size_t shiftWords = n / WORD_BITS; - const unsigned int shiftBits = (unsigned int)(n % WORD_BITS); - - ShiftWordsRightByWords(reg, wordCount, shiftWords); - if (wordCount > shiftWords) - ShiftWordsRightByBits(reg, wordCount-shiftWords, shiftBits); - if (IsNegative() && WordCount()==0) // avoid -0 - *this = Zero(); - return *this; -} - -void PositiveMultiply(Integer &product, const Integer &a, const Integer &b) -{ - size_t aSize = RoundupSize(a.WordCount()); - size_t bSize = RoundupSize(b.WordCount()); - - product.reg.CleanNew(RoundupSize(aSize+bSize)); - product.sign = Integer::POSITIVE; - - IntegerSecBlock workspace(aSize + bSize); - AsymmetricMultiply(product.reg, workspace, a.reg, aSize, b.reg, bSize); -} - -void Multiply(Integer &product, const Integer &a, const Integer &b) -{ - PositiveMultiply(product, a, b); - - if (a.NotNegative() != b.NotNegative()) - product.Negate(); -} - -Integer Integer::Times(const Integer &b) const -{ - Integer product; - Multiply(product, *this, b); - return product; -} - -/* -void PositiveDivide(Integer &remainder, Integer "ient, - const Integer ÷nd, const Integer &divisor) -{ - remainder.reg.CleanNew(divisor.reg.size()); - remainder.sign = Integer::POSITIVE; - quotient.reg.New(0); - quotient.sign = Integer::POSITIVE; - unsigned i=dividend.BitCount(); - while (i--) - { - word overflow = ShiftWordsLeftByBits(remainder.reg, remainder.reg.size(), 1); - remainder.reg[0] |= dividend[i]; - if (overflow || remainder >= divisor) - { - Subtract(remainder.reg, remainder.reg, divisor.reg, remainder.reg.size()); - quotient.SetBit(i); - } - } -} -*/ - -void PositiveDivide(Integer &remainder, Integer "ient, - const Integer &a, const Integer &b) -{ - unsigned aSize = a.WordCount(); - unsigned bSize = b.WordCount(); - - if (!bSize) - throw Integer::DivideByZero(); - - if (aSize < bSize) - { - remainder = a; - remainder.sign = Integer::POSITIVE; - quotient = Integer::Zero(); - return; - } - - aSize += aSize%2; // round up to next even number - bSize += bSize%2; - - remainder.reg.CleanNew(RoundupSize(bSize)); - remainder.sign = Integer::POSITIVE; - quotient.reg.CleanNew(RoundupSize(aSize-bSize+2)); - quotient.sign = Integer::POSITIVE; - - IntegerSecBlock T(aSize+3*(bSize+2)); - Divide(remainder.reg, quotient.reg, T, a.reg, aSize, b.reg, bSize); -} - -void Integer::Divide(Integer &remainder, Integer "ient, const Integer ÷nd, const Integer &divisor) -{ - PositiveDivide(remainder, quotient, dividend, divisor); - - if (dividend.IsNegative()) - { - quotient.Negate(); - if (remainder.NotZero()) - { - --quotient; - remainder = divisor.AbsoluteValue() - remainder; - } - } - - if (divisor.IsNegative()) - quotient.Negate(); -} - -void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, unsigned int n) -{ - q = a; - q >>= n; - - const size_t wordCount = BitsToWords(n); - if (wordCount <= a.WordCount()) - { - r.reg.resize(RoundupSize(wordCount)); - CopyWords(r.reg, a.reg, wordCount); - SetWords(r.reg+wordCount, 0, r.reg.size()-wordCount); - if (n % WORD_BITS != 0) - r.reg[wordCount-1] %= (word(1) << (n % WORD_BITS)); - } - else - { - r.reg.resize(RoundupSize(a.WordCount())); - CopyWords(r.reg, a.reg, r.reg.size()); - } - r.sign = POSITIVE; - - if (a.IsNegative() && r.NotZero()) - { - --q; - r = Power2(n) - r; - } -} - -Integer Integer::DividedBy(const Integer &b) const -{ - Integer remainder, quotient; - Integer::Divide(remainder, quotient, *this, b); - return quotient; -} - -Integer Integer::Modulo(const Integer &b) const -{ - Integer remainder, quotient; - Integer::Divide(remainder, quotient, *this, b); - return remainder; -} - -void Integer::Divide(word &remainder, Integer "ient, const Integer ÷nd, word divisor) -{ - if (!divisor) - throw Integer::DivideByZero(); - - assert(divisor); - - if ((divisor & (divisor-1)) == 0) // divisor is a power of 2 - { - quotient = dividend >> (BitPrecision(divisor)-1); - remainder = dividend.reg[0] & (divisor-1); - return; - } - - unsigned int i = dividend.WordCount(); - quotient.reg.CleanNew(RoundupSize(i)); - remainder = 0; - while (i--) - { - quotient.reg[i] = DWord(dividend.reg[i], remainder) / divisor; - remainder = DWord(dividend.reg[i], remainder) % divisor; - } - - if (dividend.NotNegative()) - quotient.sign = POSITIVE; - else - { - quotient.sign = NEGATIVE; - if (remainder) - { - --quotient; - remainder = divisor - remainder; - } - } -} - -Integer Integer::DividedBy(word b) const -{ - word remainder; - Integer quotient; - Integer::Divide(remainder, quotient, *this, b); - return quotient; -} - -word Integer::Modulo(word divisor) const -{ - if (!divisor) - throw Integer::DivideByZero(); - - assert(divisor); - - word remainder; - - if ((divisor & (divisor-1)) == 0) // divisor is a power of 2 - remainder = reg[0] & (divisor-1); - else - { - unsigned int i = WordCount(); - - if (divisor <= 5) - { - DWord sum(0, 0); - while (i--) - sum += reg[i]; - remainder = sum % divisor; - } - else - { - remainder = 0; - while (i--) - remainder = DWord(reg[i], remainder) % divisor; - } - } - - if (IsNegative() && remainder) - remainder = divisor - remainder; - - return remainder; -} - -void Integer::Negate() -{ - if (!!(*this)) // don't flip sign if *this==0 - sign = Sign(1-sign); -} - -int Integer::PositiveCompare(const Integer& t) const -{ - unsigned size = WordCount(), tSize = t.WordCount(); - - if (size == tSize) - return CryptoPP::Compare(reg, t.reg, size); - else - return size > tSize ? 1 : -1; -} - -int Integer::Compare(const Integer& t) const -{ - if (NotNegative()) - { - if (t.NotNegative()) - return PositiveCompare(t); - else - return 1; - } - else - { - if (t.NotNegative()) - return -1; - else - return -PositiveCompare(t); - } -} - -Integer Integer::SquareRoot() const -{ - if (!IsPositive()) - return Zero(); - - // overestimate square root - Integer x, y = Power2((BitCount()+1)/2); - assert(y*y >= *this); - - do - { - x = y; - y = (x + *this/x) >> 1; - } while (y().Gcd(a, b); -} - -Integer Integer::InverseMod(const Integer &m) const -{ - assert(m.NotNegative()); - - if (IsNegative()) - return Modulo(m).InverseMod(m); - - if (m.IsEven()) - { - if (!m || IsEven()) - return Zero(); // no inverse - if (*this == One()) - return One(); - - Integer u = m.Modulo(*this).InverseMod(*this); - return !u ? Zero() : (m*(*this-u)+1)/(*this); - } - - SecBlock T(m.reg.size() * 4); - Integer r((word)0, m.reg.size()); - unsigned k = AlmostInverse(r.reg, T, reg, reg.size(), m.reg, m.reg.size()); - DivideByPower2Mod(r.reg, r.reg, k, m.reg, m.reg.size()); - return r; -} - -word Integer::InverseMod(word mod) const -{ - word g0 = mod, g1 = *this % mod; - word v0 = 0, v1 = 1; - word y; - - while (g1) - { - if (g1 == 1) - return v1; - y = g0 / g1; - g0 = g0 % g1; - v0 += y * v1; - - if (!g0) - break; - if (g0 == 1) - return mod-v0; - y = g1 / g0; - g1 = g1 % g0; - v1 += y * v0; - } - return 0; -} - -// ******************************************************** - -ModularArithmetic::ModularArithmetic(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - OID oid(seq); - if (oid != ASN1::prime_field()) - BERDecodeError(); - m_modulus.BERDecode(seq); - seq.MessageEnd(); - m_result.reg.resize(m_modulus.reg.size()); -} - -void ModularArithmetic::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - ASN1::prime_field().DEREncode(seq); - m_modulus.DEREncode(seq); - seq.MessageEnd(); -} - -void ModularArithmetic::DEREncodeElement(BufferedTransformation &out, const Element &a) const -{ - a.DEREncodeAsOctetString(out, MaxElementByteLength()); -} - -void ModularArithmetic::BERDecodeElement(BufferedTransformation &in, Element &a) const -{ - a.BERDecodeAsOctetString(in, MaxElementByteLength()); -} - -const Integer& ModularArithmetic::Half(const Integer &a) const -{ - if (a.reg.size()==m_modulus.reg.size()) - { - CryptoPP::DivideByPower2Mod(m_result.reg.begin(), a.reg, 1, m_modulus.reg, a.reg.size()); - return m_result; - } - else - return m_result1 = (a.IsEven() ? (a >> 1) : ((a+m_modulus) >> 1)); -} - -const Integer& ModularArithmetic::Add(const Integer &a, const Integer &b) const -{ - if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) - { - if (CryptoPP::Add(m_result.reg.begin(), a.reg, b.reg, a.reg.size()) - || Compare(m_result.reg, m_modulus.reg, a.reg.size()) >= 0) - { - CryptoPP::Subtract(m_result.reg.begin(), m_result.reg, m_modulus.reg, a.reg.size()); - } - return m_result; - } - else - { - m_result1 = a+b; - if (m_result1 >= m_modulus) - m_result1 -= m_modulus; - return m_result1; - } -} - -Integer& ModularArithmetic::Accumulate(Integer &a, const Integer &b) const -{ - if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) - { - if (CryptoPP::Add(a.reg, a.reg, b.reg, a.reg.size()) - || Compare(a.reg, m_modulus.reg, a.reg.size()) >= 0) - { - CryptoPP::Subtract(a.reg, a.reg, m_modulus.reg, a.reg.size()); - } - } - else - { - a+=b; - if (a>=m_modulus) - a-=m_modulus; - } - - return a; -} - -const Integer& ModularArithmetic::Subtract(const Integer &a, const Integer &b) const -{ - if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) - { - if (CryptoPP::Subtract(m_result.reg.begin(), a.reg, b.reg, a.reg.size())) - CryptoPP::Add(m_result.reg.begin(), m_result.reg, m_modulus.reg, a.reg.size()); - return m_result; - } - else - { - m_result1 = a-b; - if (m_result1.IsNegative()) - m_result1 += m_modulus; - return m_result1; - } -} - -Integer& ModularArithmetic::Reduce(Integer &a, const Integer &b) const -{ - if (a.reg.size()==m_modulus.reg.size() && b.reg.size()==m_modulus.reg.size()) - { - if (CryptoPP::Subtract(a.reg, a.reg, b.reg, a.reg.size())) - CryptoPP::Add(a.reg, a.reg, m_modulus.reg, a.reg.size()); - } - else - { - a-=b; - if (a.IsNegative()) - a+=m_modulus; - } - - return a; -} - -const Integer& ModularArithmetic::Inverse(const Integer &a) const -{ - if (!a) - return a; - - CopyWords(m_result.reg.begin(), m_modulus.reg, m_modulus.reg.size()); - if (CryptoPP::Subtract(m_result.reg.begin(), m_result.reg, a.reg, a.reg.size())) - Decrement(m_result.reg.begin()+a.reg.size(), m_modulus.reg.size()-a.reg.size()); - - return m_result; -} - -Integer ModularArithmetic::CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const -{ - if (m_modulus.IsOdd()) - { - MontgomeryRepresentation dr(m_modulus); - return dr.ConvertOut(dr.CascadeExponentiate(dr.ConvertIn(x), e1, dr.ConvertIn(y), e2)); - } - else - return AbstractRing::CascadeExponentiate(x, e1, y, e2); -} - -void ModularArithmetic::SimultaneousExponentiate(Integer *results, const Integer &base, const Integer *exponents, unsigned int exponentsCount) const -{ - if (m_modulus.IsOdd()) - { - MontgomeryRepresentation dr(m_modulus); - dr.SimultaneousExponentiate(results, dr.ConvertIn(base), exponents, exponentsCount); - for (unsigned int i=0; i::SimultaneousExponentiate(results, base, exponents, exponentsCount); -} - -MontgomeryRepresentation::MontgomeryRepresentation(const Integer &m) // modulus must be odd - : ModularArithmetic(m), - m_u((word)0, m_modulus.reg.size()), - m_workspace(5*m_modulus.reg.size()) -{ - if (!m_modulus.IsOdd()) - throw InvalidArgument("MontgomeryRepresentation: Montgomery representation requires an odd modulus"); - - RecursiveInverseModPower2(m_u.reg, m_workspace, m_modulus.reg, m_modulus.reg.size()); -} - -const Integer& MontgomeryRepresentation::Multiply(const Integer &a, const Integer &b) const -{ - word *const T = m_workspace.begin(); - word *const R = m_result.reg.begin(); - const size_t N = m_modulus.reg.size(); - assert(a.reg.size()<=N && b.reg.size()<=N); - - AsymmetricMultiply(T, T+2*N, a.reg, a.reg.size(), b.reg, b.reg.size()); - SetWords(T+a.reg.size()+b.reg.size(), 0, 2*N-a.reg.size()-b.reg.size()); - MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); - return m_result; -} - -const Integer& MontgomeryRepresentation::Square(const Integer &a) const -{ - word *const T = m_workspace.begin(); - word *const R = m_result.reg.begin(); - const size_t N = m_modulus.reg.size(); - assert(a.reg.size()<=N); - - CryptoPP::Square(T, T+2*N, a.reg, a.reg.size()); - SetWords(T+2*a.reg.size(), 0, 2*N-2*a.reg.size()); - MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); - return m_result; -} - -Integer MontgomeryRepresentation::ConvertOut(const Integer &a) const -{ - word *const T = m_workspace.begin(); - word *const R = m_result.reg.begin(); - const size_t N = m_modulus.reg.size(); - assert(a.reg.size()<=N); - - CopyWords(T, a.reg, a.reg.size()); - SetWords(T+a.reg.size(), 0, 2*N-a.reg.size()); - MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); - return m_result; -} - -const Integer& MontgomeryRepresentation::MultiplicativeInverse(const Integer &a) const -{ -// return (EuclideanMultiplicativeInverse(a, modulus)<<(2*WORD_BITS*modulus.reg.size()))%modulus; - word *const T = m_workspace.begin(); - word *const R = m_result.reg.begin(); - const size_t N = m_modulus.reg.size(); - assert(a.reg.size()<=N); - - CopyWords(T, a.reg, a.reg.size()); - SetWords(T+a.reg.size(), 0, 2*N-a.reg.size()); - MontgomeryReduce(R, T+2*N, T, m_modulus.reg, m_u.reg, N); - unsigned k = AlmostInverse(R, T, R, N, m_modulus.reg, N); - -// cout << "k=" << k << " N*32=" << 32*N << endl; - - if (k>N*WORD_BITS) - DivideByPower2Mod(R, R, k-N*WORD_BITS, m_modulus.reg, N); - else - MultiplyByPower2Mod(R, R, N*WORD_BITS-k, m_modulus.reg, N); - - return m_result; -} - -// Specialization declared in misc.h to allow us to print integers -// with additional control options, like arbirary bases and uppercase. -template <> CRYPTOPP_DLL -std::string IntToString(Integer value, unsigned int base) -{ - // Hack... set the high bit for uppercase. Set the next bit fo a suffix. - static const unsigned int BIT_32 = (1U << 31); - const bool UPPER = !!(base & BIT_32); - static const unsigned int BIT_31 = (1U << 30); - const bool BASE = !!(base & BIT_31); - - const char CH = UPPER ? 'A' : 'a'; - base &= ~(BIT_32|BIT_31); - assert(base >= 2 && base <= 32); - - if (value == 0) - return "0"; - - bool negative = false, zero = false; - if (value.IsNegative()) - { - negative = true; - value.Negate(); - } - - if (!value) - zero = true; - - SecBlock s(value.BitCount() / (SaturatingSubtract1(BitPrecision(base),1U)) + 1); - Integer temp; - - unsigned int i=0; - while (!!value) - { - word digit; - Integer::Divide(digit, temp, value, word(base)); - s[i++]=char((digit < 10 ? '0' : (CH - 10)) + digit); - value.swap(temp); - } - - std::string result; - result.reserve(i+2); - - if (negative) - result += '-'; - - if (zero) - result += '0'; - - while (i--) - result += s[i]; - - if (BASE) - { - if (base == 10) - result += '.'; - else if (base == 16) - result += 'h'; - else if (base == 8) - result += 'o'; - else if (base == 2) - result += 'b'; - } - - return result; -} - -// Specialization declared in misc.h to avoid Coverity findings. -template <> CRYPTOPP_DLL -std::string IntToString(unsigned long long value, unsigned int base) -{ - // Hack... set the high bit for uppercase. - static const unsigned int HIGH_BIT = (1U << 31); - const char CH = !!(base & HIGH_BIT) ? 'A' : 'a'; - base &= ~HIGH_BIT; - - assert(base >= 2); - if (value == 0) - return "0"; - - std::string result; - while (value > 0) - { - unsigned long long digit = value % base; - result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result; - value /= base; - } - return result; -} - -NAMESPACE_END - -#if WORKAROUND_ARMEL_BUG -# pragma GCC pop_options -#endif - -#if WORKAROUND_ARM64_BUG -# pragma GCC pop_options -#endif - -#endif diff --git a/external/crypto++-5.6.3/integer.h b/external/crypto++-5.6.3/integer.h deleted file mode 100644 index afb7ff7d4..000000000 --- a/external/crypto++-5.6.3/integer.h +++ /dev/null @@ -1,570 +0,0 @@ -#ifndef CRYPTOPP_INTEGER_H -#define CRYPTOPP_INTEGER_H - -/** \file */ - -#include "cryptlib.h" -#include "secblock.h" -#include "stdcpp.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! \struct InitializeInteger -//! Performs static intialization of the Integer class -struct InitializeInteger -{ - InitializeInteger(); -}; - -typedef SecBlock > IntegerSecBlock; - -//! \brief Multiple precision integer with arithmetic operations -//! \details The Integer class can represent positive and negative integers -//! with absolute value less than (256**sizeof(word))(256**sizeof(int)). -//! \details Internally, the library uses a sign magnitude representation, and the class -//! has two data members. The first is a IntegerSecBlock (a SecBlock) and it i -//! used to hold the representation. The second is a Sign, and its is used to track -//! the sign of the Integer. -//! \nosubgrouping -class CRYPTOPP_DLL Integer : private InitializeInteger, public ASN1Object -{ -public: - //! \name ENUMS, EXCEPTIONS, and TYPEDEFS - //@{ - //! \brief Exception thrown when division by 0 is encountered - class DivideByZero : public Exception - { - public: - DivideByZero() : Exception(OTHER_ERROR, "Integer: division by zero") {} - }; - - //! \brief Exception thrown when a random number cannot be found that - //! satisfies the condition - class RandomNumberNotFound : public Exception - { - public: - RandomNumberNotFound() : Exception(OTHER_ERROR, "Integer: no integer satisfies the given parameters") {} - }; - - //! \enum Sign - //! \brief Used internally to represent the integer - //! \details Sign is used internally to represent the integer. It is also used in a few API functions. - //! \sa Signedness - enum Sign { - //! \brief the value is positive or 0 - POSITIVE=0, - //! \brief the value is negative - NEGATIVE=1}; - - //! \enum Signedness - //! \brief Used when importing and exporting integers - //! \details Signedness is usually used in API functions. - //! \sa Sign - enum Signedness { - //! \brief an unsigned value - UNSIGNED, - //! \brief a signed value - SIGNED}; - - //! \enum RandomNumberType - //! \brief Properties of a random integer - enum RandomNumberType { - //! \brief a number with no special properties - ANY, - //! \brief a number which is probabilistically prime - PRIME}; - //@} - - //! \name CREATORS - //@{ - //! \brief Creates the zero integer - Integer(); - - //! copy constructor - Integer(const Integer& t); - - //! \brief Convert from signed long - Integer(signed long value); - - //! \brief Convert from lword - //! \param sign enumeration indicating Sign - //! \param value the long word - Integer(Sign sign, lword value); - - //! \brief Convert from two words - //! \param sign enumeration indicating Sign - //! \param highWord the high word - //! \param lowWord the low word - Integer(Sign sign, word highWord, word lowWord); - - //! \brief Convert from a C-string - //! \param str C-string value - //! \details \p str can be in base 2, 8, 10, or 16. Base is determined by a case - //! insensitive suffix of 'h', 'o', or 'b'. No suffix means base 10. - explicit Integer(const char *str); - - //! \brief Convert from a wide C-string - //! \param str wide C-string value - //! \details \p str can be in base 2, 8, 10, or 16. Base is determined by a case - //! insensitive suffix of 'h', 'o', or 'b'. No suffix means base 10. - explicit Integer(const wchar_t *str); - - //! \brief Convert from a big-endian byte array - //! \param encodedInteger big-endian byte array - //! \param byteCount length of the byte array - //! \param sign enumeration indicating Signedness - Integer(const byte *encodedInteger, size_t byteCount, Signedness sign=UNSIGNED); - - //! \brief Convert from a big-endian array - //! \param bt BufferedTransformation object with big-endian byte array - //! \param byteCount length of the byte array - //! \param sign enumeration indicating Signedness - Integer(BufferedTransformation &bt, size_t byteCount, Signedness sign=UNSIGNED); - - //! \brief Convert from a BER encoded byte array - //! \param bt BufferedTransformation object with BER encoded byte array - explicit Integer(BufferedTransformation &bt); - - //! \brief Create a random integer - //! \param rng RandomNumberGenerator used to generate material - //! \param bitCount the number of bits in the resulting integer - //! \details The random integer created is uniformly distributed over [0, 2bitCount]. - Integer(RandomNumberGenerator &rng, size_t bitCount); - - //! \brief Integer representing 0 - //! \returns an Integer representing 0 - //! \details Zero() avoids calling constructors for frequently used integers - static const Integer & CRYPTOPP_API Zero(); - //! \brief Integer representing 1 - //! \returns an Integer representing 1 - //! \details One() avoids calling constructors for frequently used integers - static const Integer & CRYPTOPP_API One(); - //! \brief Integer representing 2 - //! \returns an Integer representing 2 - //! \details Two() avoids calling constructors for frequently used integers - static const Integer & CRYPTOPP_API Two(); - - //! \brief Create a random integer of special form - //! \param rng RandomNumberGenerator used to generate material - //! \param min the minimum value - //! \param max the maximum value - //! \param rnType RandomNumberType to specify the type - //! \param equiv the equivalence class based on the parameter \p mod - //! \param mod the modulus used to reduce the equivalence class - //! \throw RandomNumberNotFound if the set is empty. - //! \details Ideally, the random integer created should be uniformly distributed - //! over {x | min \<= x \<= max and \p x is of rnType and x \% mod == equiv}. - //! However the actual distribution may not be uniform because sequential - //! search is used to find an appropriate number from a random starting - //! point. - //! \details May return (with very small probability) a pseudoprime when a prime - //! is requested and max \> lastSmallPrime*lastSmallPrime. \p lastSmallPrime - //! is declared in nbtheory.h. - Integer(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType=ANY, const Integer &equiv=Zero(), const Integer &mod=One()); - - //! \brief Exponentiates to a power of 2 - //! \returns the Integer 2e - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - static Integer CRYPTOPP_API Power2(size_t e); - //@} - - //! \name ENCODE/DECODE - //@{ - //! \brief The minimum number of bytes to encode this integer - //! \param sign enumeration indicating Signedness - //! \note The MinEncodedSize() of 0 is 1. - size_t MinEncodedSize(Signedness sign=UNSIGNED) const; - - //! \brief Encode in big-endian format - //! \param output big-endian byte array - //! \param outputLen length of the byte array - //! \param sign enumeration indicating Signedness - //! \details Unsigned means encode absolute value, signed means encode two's complement if negative. - //! \details outputLen can be used to ensure an Integer is encoded to an exact size (rather than a - //! minimum size). An exact size is useful, for example, when encoding to a field element size. - void Encode(byte *output, size_t outputLen, Signedness sign=UNSIGNED) const; - - //! \brief Encode in big-endian format - //! \param bt BufferedTransformation object - //! \param outputLen length of the encoding - //! \param sign enumeration indicating Signedness - //! \details Unsigned means encode absolute value, signed means encode two's complement if negative. - //! \details outputLen can be used to ensure an Integer is encoded to an exact size (rather than a - //! minimum size). An exact size is useful, for example, when encoding to a field element size. - void Encode(BufferedTransformation &bt, size_t outputLen, Signedness sign=UNSIGNED) const; - - //! \brief Encode in DER format - //! \param bt BufferedTransformation object - //! \details Encodes the Integer using Distinguished Encoding Rules - //! The result is placed into a BufferedTransformation object - void DEREncode(BufferedTransformation &bt) const; - - //! encode absolute value as big-endian octet string - //! \param bt BufferedTransformation object - //! \param length the number of mytes to decode - void DEREncodeAsOctetString(BufferedTransformation &bt, size_t length) const; - - //! \brief Encode absolute value in OpenPGP format - //! \param output big-endian byte array - //! \param bufferSize length of the byte array - //! \returns length of the output - //! \details OpenPGPEncode places result into a BufferedTransformation object and returns the - //! number of bytes used for the encoding - size_t OpenPGPEncode(byte *output, size_t bufferSize) const; - - //! \brief Encode absolute value in OpenPGP format - //! \param bt BufferedTransformation object - //! \returns length of the output - //! \details OpenPGPEncode places result into a BufferedTransformation object and returns the - //! number of bytes used for the encoding - size_t OpenPGPEncode(BufferedTransformation &bt) const; - - //! \brief Decode from big-endian byte array - //! \param input big-endian byte array - //! \param inputLen length of the byte array - //! \param sign enumeration indicating Signedness - void Decode(const byte *input, size_t inputLen, Signedness sign=UNSIGNED); - - //! \brief Decode nonnegative value from big-endian byte array - //! \param bt BufferedTransformation object - //! \param inputLen length of the byte array - //! \param sign enumeration indicating Signedness - //! \note bt.MaxRetrievable() \>= inputLen. - void Decode(BufferedTransformation &bt, size_t inputLen, Signedness sign=UNSIGNED); - - //! \brief Decode from BER format - //! \param input big-endian byte array - //! \param inputLen length of the byte array - void BERDecode(const byte *input, size_t inputLen); - - //! \brief Decode from BER format - //! \param bt BufferedTransformation object - void BERDecode(BufferedTransformation &bt); - - //! \brief Decode nonnegative value from big-endian octet string - //! \param bt BufferedTransformation object - //! \param length length of the byte array - void BERDecodeAsOctetString(BufferedTransformation &bt, size_t length); - - //! \brief Exception thrown when an error is encountered decoding an OpenPGP integer - class OpenPGPDecodeErr : public Exception - { - public: - OpenPGPDecodeErr() : Exception(INVALID_DATA_FORMAT, "OpenPGP decode error") {} - }; - - //! \brief Decode from OpenPGP format - //! \param input big-endian byte array - //! \param inputLen length of the byte array - void OpenPGPDecode(const byte *input, size_t inputLen); - //! \brief Decode from OpenPGP format - //! \param bt BufferedTransformation object - void OpenPGPDecode(BufferedTransformation &bt); - //@} - - //! \name ACCESSORS - //@{ - //! return true if *this can be represented as a signed long - bool IsConvertableToLong() const; - //! return equivalent signed long if possible, otherwise undefined - signed long ConvertToLong() const; - - //! number of significant bits = floor(log2(abs(*this))) + 1 - unsigned int BitCount() const; - //! number of significant bytes = ceiling(BitCount()/8) - unsigned int ByteCount() const; - //! number of significant words = ceiling(ByteCount()/sizeof(word)) - unsigned int WordCount() const; - - //! return the i-th bit, i=0 being the least significant bit - bool GetBit(size_t i) const; - //! return the i-th byte - byte GetByte(size_t i) const; - //! return n lowest bits of *this >> i - lword GetBits(size_t i, size_t n) const; - - //! - bool IsZero() const {return !*this;} - //! - bool NotZero() const {return !IsZero();} - //! - bool IsNegative() const {return sign == NEGATIVE;} - //! - bool NotNegative() const {return !IsNegative();} - //! - bool IsPositive() const {return NotNegative() && NotZero();} - //! - bool NotPositive() const {return !IsPositive();} - //! - bool IsEven() const {return GetBit(0) == 0;} - //! - bool IsOdd() const {return GetBit(0) == 1;} - //@} - - //! \name MANIPULATORS - //@{ - //! - Integer& operator=(const Integer& t); - - //! - Integer& operator+=(const Integer& t); - //! - Integer& operator-=(const Integer& t); - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer& operator*=(const Integer& t) {return *this = Times(t);} - //! - Integer& operator/=(const Integer& t) {return *this = DividedBy(t);} - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer& operator%=(const Integer& t) {return *this = Modulo(t);} - //! - Integer& operator/=(word t) {return *this = DividedBy(t);} - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer& operator%=(word t) {return *this = Integer(POSITIVE, 0, Modulo(t));} - - //! - Integer& operator<<=(size_t); - //! - Integer& operator>>=(size_t); - - //! \brief Set this Integer to random integer - //! \param rng RandomNumberGenerator used to generate material - //! \param bitCount the number of bits in the resulting integer - //! \details The random integer created is uniformly distributed over [0, 2bitCount]. - void Randomize(RandomNumberGenerator &rng, size_t bitCount); - - //! \brief Set this Integer to random integer - //! \param rng RandomNumberGenerator used to generate material - //! \param min the minimum value - //! \param max the maximum value - //! \details The random integer created is uniformly distributed over [min, max]. - void Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max); - - //! \brief Set this Integer to random integer of special form - //! \param rng RandomNumberGenerator used to generate material - //! \param min the minimum value - //! \param max the maximum value - //! \param rnType RandomNumberType to specify the type - //! \param equiv the equivalence class based on the parameter \p mod - //! \param mod the modulus used to reduce the equivalence class - //! \throw RandomNumberNotFound if the set is empty. - //! \details Ideally, the random integer created should be uniformly distributed - //! over {x | min \<= x \<= max and \p x is of rnType and x \% mod == equiv}. - //! However the actual distribution may not be uniform because sequential - //! search is used to find an appropriate number from a random starting - //! point. - //! \details May return (with very small probability) a pseudoprime when a prime - //! is requested and max \> lastSmallPrime*lastSmallPrime. \p lastSmallPrime - //! is declared in nbtheory.h. - bool Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max, RandomNumberType rnType, const Integer &equiv=Zero(), const Integer &mod=One()); - - bool GenerateRandomNoThrow(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs); - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs) - { - if (!GenerateRandomNoThrow(rng, params)) - throw RandomNumberNotFound(); - } - - //! \brief Set the n-th bit to value - //! \details 0-based numbering. - void SetBit(size_t n, bool value=1); - - //! \brief Set the n-th byte to value - //! \details 0-based numbering. - void SetByte(size_t n, byte value); - - //! \brief Reverse the Sign of the Integer - void Negate(); - - //! \brief Sets the Integer to positive - void SetPositive() {sign = POSITIVE;} - - //! \brief Sets the Integer to negative - void SetNegative() {if (!!(*this)) sign = NEGATIVE;} - - //! \brief Swaps this Integer with another Integer - void swap(Integer &a); - //@} - - //! \name UNARY OPERATORS - //@{ - //! - bool operator!() const; - //! - Integer operator+() const {return *this;} - //! - Integer operator-() const; - //! - Integer& operator++(); - //! - Integer& operator--(); - //! - Integer operator++(int) {Integer temp = *this; ++*this; return temp;} - //! - Integer operator--(int) {Integer temp = *this; --*this; return temp;} - //@} - - //! \name BINARY OPERATORS - //@{ - //! \brief Perform signed comparison - //! \param a the Integer to comapre - //! \retval -1 if *this < a - //! \retval 0 if *this = a - //! \retval 1 if *this > a - int Compare(const Integer& a) const; - - //! - Integer Plus(const Integer &b) const; - //! - Integer Minus(const Integer &b) const; - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer Times(const Integer &b) const; - //! - Integer DividedBy(const Integer &b) const; - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer Modulo(const Integer &b) const; - //! - Integer DividedBy(word b) const; - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - word Modulo(word b) const; - - //! - Integer operator>>(size_t n) const {return Integer(*this)>>=n;} - //! - Integer operator<<(size_t n) const {return Integer(*this)<<=n;} - //@} - - //! \name OTHER ARITHMETIC FUNCTIONS - //@{ - //! - Integer AbsoluteValue() const; - //! - Integer Doubled() const {return Plus(*this);} - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer Squared() const {return Times(*this);} - //! extract square root, if negative return 0, else return floor of square root - Integer SquareRoot() const; - //! return whether this integer is a perfect square - bool IsSquare() const; - - //! is 1 or -1 - bool IsUnit() const; - //! return inverse if 1 or -1, otherwise return 0 - Integer MultiplicativeInverse() const; - - //! calculate r and q such that (a == d*q + r) && (0 <= r < abs(d)) - static void CRYPTOPP_API Divide(Integer &r, Integer &q, const Integer &a, const Integer &d); - //! use a faster division algorithm when divisor is short - static void CRYPTOPP_API Divide(word &r, Integer &q, const Integer &a, word d); - - //! returns same result as Divide(r, q, a, Power2(n)), but faster - static void CRYPTOPP_API DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, unsigned int n); - - //! greatest common divisor - static Integer CRYPTOPP_API Gcd(const Integer &a, const Integer &n); - //! calculate multiplicative inverse of *this mod n - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - Integer InverseMod(const Integer &n) const; - //! - //! \sa a_times_b_mod_c() and a_exp_b_mod_c() - word InverseMod(word n) const; - //@} - - //! \name INPUT/OUTPUT - //@{ - //! \brief Extraction operator - //! \param in a reference to a std::istream - //! \param a a reference to an Integer - //! \returns a reference to a std::istream reference - friend CRYPTOPP_DLL std::istream& CRYPTOPP_API operator>>(std::istream& in, Integer &a); - //! - //! \brief Insertion operator - //! \param out a reference to a std::ostream - //! \param a a constant reference to an Integer - //! \returns a reference to a std::ostream reference - //! \details The output integer responds to std::hex, std::oct, std::hex, std::upper and - //! std::lower. The output includes the suffix \a \b h (for hex), \a \b . (\a \b dot, for dec) - //! and \a \b o (for octal). There is currently no way to supress the suffix. - //! \details If you want to print an Integer without the suffix or using an arbitrary base, then - //! use IntToString(). - //! \sa IntToString - friend CRYPTOPP_DLL std::ostream& CRYPTOPP_API operator<<(std::ostream& out, const Integer &a); - //@} - -#ifndef CRYPTOPP_DOXYGEN_PROCESSING - //! modular multiplication - CRYPTOPP_DLL friend Integer CRYPTOPP_API a_times_b_mod_c(const Integer &x, const Integer& y, const Integer& m); - //! modular exponentiation - CRYPTOPP_DLL friend Integer CRYPTOPP_API a_exp_b_mod_c(const Integer &x, const Integer& e, const Integer& m); -#endif - -private: - - Integer(word value, size_t length); - int PositiveCompare(const Integer &t) const; - - IntegerSecBlock reg; - Sign sign; - -#ifndef CRYPTOPP_DOXYGEN_PROCESSING - friend class ModularArithmetic; - friend class MontgomeryRepresentation; - friend class HalfMontgomeryRepresentation; - - friend void PositiveAdd(Integer &sum, const Integer &a, const Integer &b); - friend void PositiveSubtract(Integer &diff, const Integer &a, const Integer &b); - friend void PositiveMultiply(Integer &product, const Integer &a, const Integer &b); - friend void PositiveDivide(Integer &remainder, Integer "ient, const Integer ÷nd, const Integer &divisor); -#endif -}; - -//! -inline bool operator==(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)==0;} -//! -inline bool operator!=(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)!=0;} -//! -inline bool operator> (const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)> 0;} -//! -inline bool operator>=(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)>=0;} -//! -inline bool operator< (const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)< 0;} -//! -inline bool operator<=(const CryptoPP::Integer& a, const CryptoPP::Integer& b) {return a.Compare(b)<=0;} -//! -inline CryptoPP::Integer operator+(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Plus(b);} -//! -inline CryptoPP::Integer operator-(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Minus(b);} -//! -//! \sa a_times_b_mod_c() and a_exp_b_mod_c() -inline CryptoPP::Integer operator*(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Times(b);} -//! -inline CryptoPP::Integer operator/(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.DividedBy(b);} -//! -//! \sa a_times_b_mod_c() and a_exp_b_mod_c() -inline CryptoPP::Integer operator%(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Modulo(b);} -//! -inline CryptoPP::Integer operator/(const CryptoPP::Integer &a, CryptoPP::word b) {return a.DividedBy(b);} -//! -//! \sa a_times_b_mod_c() and a_exp_b_mod_c() -inline CryptoPP::word operator%(const CryptoPP::Integer &a, CryptoPP::word b) {return a.Modulo(b);} - -NAMESPACE_END - -#ifndef __BORLANDC__ -NAMESPACE_BEGIN(std) -inline void swap(CryptoPP::Integer &a, CryptoPP::Integer &b) -{ - a.swap(b); -} -NAMESPACE_END -#endif - -#endif diff --git a/external/crypto++-5.6.3/iterhash.cpp b/external/crypto++-5.6.3/iterhash.cpp deleted file mode 100644 index 9116bc515..000000000 --- a/external/crypto++-5.6.3/iterhash.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// iterhash.cpp - written and placed in the public domain by Wei Dai - -#ifndef __GNUC__ -#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#endif - -#include "iterhash.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -template void IteratedHashBase::Update(const byte *input, size_t len) -{ - HashWordType oldCountLo = m_countLo, oldCountHi = m_countHi; - if ((m_countLo = oldCountLo + HashWordType(len)) < oldCountLo) - m_countHi++; // carry from low to high - m_countHi += (HashWordType)SafeRightShift<8*sizeof(HashWordType)>(len); - if (m_countHi < oldCountHi || SafeRightShift<2*8*sizeof(HashWordType)>(len) != 0) - throw HashInputTooLong(this->AlgorithmName()); - - const unsigned int blockSize = this->BlockSize(); - unsigned int num = ModPowerOf2(oldCountLo, blockSize); - - T* dataBuf = this->DataBuf(); - byte* data = (byte *)dataBuf; - assert(dataBuf && data); - - if (num != 0) // process left over data - { - if (num+len >= blockSize) - { - if (data && input) {memcpy(data+num, input, blockSize-num);} - HashBlock(dataBuf); - input += (blockSize-num); - len -= (blockSize-num); - num = 0; - // drop through and do the rest - } - else - { - if (data && input && len) {memcpy(data+num, input, len);} - return; - } - } - - // now process the input data in blocks of blockSize bytes and save the leftovers to m_data - if (len >= blockSize) - { - if (input == data) - { - assert(len == blockSize); - HashBlock(dataBuf); - return; - } - else if (IsAligned(input)) - { - size_t leftOver = HashMultipleBlocks((T *)input, len); - input += (len - leftOver); - len = leftOver; - } - else - do - { // copy input first if it's not aligned correctly - if (data && input) memcpy(data, input, blockSize); - HashBlock(dataBuf); - input+=blockSize; - len-=blockSize; - } while (len >= blockSize); - } - - if (data && input && len && data != input) - memcpy(data, input, len); -} - -template byte * IteratedHashBase::CreateUpdateSpace(size_t &size) -{ - unsigned int blockSize = this->BlockSize(); - unsigned int num = ModPowerOf2(m_countLo, blockSize); - size = blockSize - num; - return (byte *)DataBuf() + num; -} - -template size_t IteratedHashBase::HashMultipleBlocks(const T *input, size_t length) -{ - unsigned int blockSize = this->BlockSize(); - bool noReverse = NativeByteOrderIs(this->GetByteOrder()); - T* dataBuf = this->DataBuf(); - do - { - if (noReverse) - this->HashEndianCorrectedBlock(input); - else - { - ByteReverse(dataBuf, input, this->BlockSize()); - this->HashEndianCorrectedBlock(dataBuf); - } - - input += blockSize/sizeof(T); - length -= blockSize; - } - while (length >= blockSize); - return length; -} - -template void IteratedHashBase::PadLastBlock(unsigned int lastBlockSize, byte padFirst) -{ - unsigned int blockSize = this->BlockSize(); - unsigned int num = ModPowerOf2(m_countLo, blockSize); - T* dataBuf = this->DataBuf(); - byte* data = (byte *)dataBuf; - data[num++] = padFirst; - if (num <= lastBlockSize) - memset(data+num, 0, lastBlockSize-num); - else - { - memset(data+num, 0, blockSize-num); - HashBlock(dataBuf); - memset(data, 0, lastBlockSize); - } -} - -template void IteratedHashBase::Restart() -{ - m_countLo = m_countHi = 0; - Init(); -} - -template void IteratedHashBase::TruncatedFinal(byte *digest, size_t size) -{ - this->ThrowIfInvalidTruncatedSize(size); - - T* dataBuf = this->DataBuf(); - T* stateBuf = this->StateBuf(); - unsigned int blockSize = this->BlockSize(); - ByteOrder order = this->GetByteOrder(); - - PadLastBlock(blockSize - 2*sizeof(HashWordType)); - dataBuf[blockSize/sizeof(T)-2+order] = ConditionalByteReverse(order, this->GetBitCountLo()); - dataBuf[blockSize/sizeof(T)-1-order] = ConditionalByteReverse(order, this->GetBitCountHi()); - - HashBlock(dataBuf); - - if (IsAligned(digest) && size%sizeof(HashWordType)==0) - ConditionalByteReverse(order, (HashWordType *)digest, stateBuf, size); - else - { - ConditionalByteReverse(order, stateBuf, stateBuf, this->DigestSize()); - memcpy(digest, stateBuf, size); - } - - this->Restart(); // reinit for next use -} - -#ifdef __GNUC__ - template class IteratedHashBase; - template class IteratedHashBase; - - template class IteratedHashBase; - template class IteratedHashBase; -#endif - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/iterhash.h b/external/crypto++-5.6.3/iterhash.h deleted file mode 100644 index cce9e8211..000000000 --- a/external/crypto++-5.6.3/iterhash.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef CRYPTOPP_ITERHASH_H -#define CRYPTOPP_ITERHASH_H - -#include "cryptlib.h" -#include "secblock.h" -#include "misc.h" -#include "simple.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! exception thrown when trying to hash more data than is allowed by a hash function -class CRYPTOPP_DLL HashInputTooLong : public InvalidDataFormat -{ -public: - explicit HashInputTooLong(const std::string &alg) - : InvalidDataFormat("IteratedHashBase: input data exceeds maximum allowed by hash function " + alg) {} -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE IteratedHashBase : public BASE -{ -public: - typedef T HashWordType; - - IteratedHashBase() : m_countLo(0), m_countHi(0) {} - unsigned int OptimalBlockSize() const {return this->BlockSize();} - unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} - void Update(const byte *input, size_t length); - byte * CreateUpdateSpace(size_t &size); - void Restart(); - void TruncatedFinal(byte *digest, size_t size); - -protected: - inline T GetBitCountHi() const {return (m_countLo >> (8*sizeof(T)-3)) + (m_countHi << 3);} - inline T GetBitCountLo() const {return m_countLo << 3;} - - void PadLastBlock(unsigned int lastBlockSize, byte padFirst=0x80); - virtual void Init() =0; - - virtual ByteOrder GetByteOrder() const =0; - virtual void HashEndianCorrectedBlock(const HashWordType *data) =0; - virtual size_t HashMultipleBlocks(const T *input, size_t length); - void HashBlock(const HashWordType *input) {HashMultipleBlocks(input, this->BlockSize());} - - virtual T* DataBuf() =0; - virtual T* StateBuf() =0; - -private: - T m_countLo, m_countHi; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE IteratedHash : public IteratedHashBase -{ -public: - typedef T_Endianness ByteOrderClass; - typedef T_HashWordType HashWordType; - - CRYPTOPP_CONSTANT(BLOCKSIZE = T_BlockSize) - // BCB2006 workaround: can't use BLOCKSIZE here - CRYPTOPP_COMPILE_ASSERT((T_BlockSize & (T_BlockSize - 1)) == 0); // blockSize is a power of 2 - unsigned int BlockSize() const {return T_BlockSize;} - - ByteOrder GetByteOrder() const {return T_Endianness::ToEnum();} - - inline static void CorrectEndianess(HashWordType *out, const HashWordType *in, size_t byteCount) - { - ConditionalByteReverse(T_Endianness::ToEnum(), out, in, byteCount); - } - -protected: - T_HashWordType* DataBuf() {return this->m_data;} - FixedSizeSecBlock m_data; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE IteratedHashWithStaticTransform - : public ClonableImpl, T_Transform> > -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = T_DigestSize ? T_DigestSize : T_StateSize) - unsigned int DigestSize() const {return DIGESTSIZE;}; - -protected: - IteratedHashWithStaticTransform() {this->Init();} - void HashEndianCorrectedBlock(const T_HashWordType *data) {T_Transform::Transform(this->m_state, data);} - void Init() {T_Transform::InitState(this->m_state);} - - T_HashWordType* StateBuf() {return this->m_state;} - FixedSizeAlignedSecBlock m_state; -}; - -#ifndef __GNUC__ - CRYPTOPP_DLL_TEMPLATE_CLASS IteratedHashBase; - CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase; - - CRYPTOPP_DLL_TEMPLATE_CLASS IteratedHashBase; - CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase; -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/lubyrack.h b/external/crypto++-5.6.3/lubyrack.h deleted file mode 100644 index d69587a3c..000000000 --- a/external/crypto++-5.6.3/lubyrack.h +++ /dev/null @@ -1,142 +0,0 @@ -// lubyrack.h - written and placed in the public domain by Wei Dai - -//! \file lubyrack.h -//! \brief Classes for the Luby-Rackoff block cipher - -#ifndef CRYPTOPP_LUBYRACK_H -#define CRYPTOPP_LUBYRACK_H - -#include "simple.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -template struct DigestSizeDoubleWorkaround // VC60 workaround -{ - CRYPTOPP_CONSTANT(RESULT = 2*T::DIGESTSIZE) -}; - -//! algorithm info -template -struct LR_Info : public VariableKeyLength<16, 0, 2*(INT_MAX/2), 2>, public FixedBlockSize::RESULT> -{ - static std::string StaticAlgorithmName() {return std::string("LR/")+T::StaticAlgorithmName();} -}; - -//! Luby-Rackoff -template -class LR : public LR_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl > - { - public: - // VC60 workaround: have to define these functions within class definition - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) - { - this->AssertValidKeyLength(length); - - L = length/2; - buffer.New(2*S); - digest.New(S); - key.Assign(userKey, 2*L); - } - - protected: - CRYPTOPP_CONSTANT(S=T::DIGESTSIZE) - unsigned int L; // key length / 2 - SecByteBlock key; - - mutable T hm; - mutable SecByteBlock buffer, digest; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - -#define KL this->key -#define KR this->key+this->L -#define BL this->buffer -#define BR this->buffer+this->S -#define IL inBlock -#define IR inBlock+this->S -#define OL outBlock -#define OR outBlock+this->S - - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const - { - this->hm.Update(KL, this->L); - this->hm.Update(IL, this->S); - this->hm.Final(BR); - xorbuf(BR, IR, this->S); - - this->hm.Update(KR, this->L); - this->hm.Update(BR, this->S); - this->hm.Final(BL); - xorbuf(BL, IL, this->S); - - this->hm.Update(KL, this->L); - this->hm.Update(BL, this->S); - this->hm.Final(this->digest); - xorbuf(BR, this->digest, this->S); - - this->hm.Update(KR, this->L); - this->hm.Update(OR, this->S); - this->hm.Final(this->digest); - xorbuf(BL, this->digest, this->S); - - if (xorBlock) - xorbuf(outBlock, xorBlock, this->buffer, 2*this->S); - else - memcpy_s(outBlock, 2*this->S, this->buffer, 2*this->S); - } - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const - { - this->hm.Update(KR, this->L); - this->hm.Update(IR, this->S); - this->hm.Final(BL); - xorbuf(BL, IL, this->S); - - this->hm.Update(KL, this->L); - this->hm.Update(BL, this->S); - this->hm.Final(BR); - xorbuf(BR, IR, this->S); - - this->hm.Update(KR, this->L); - this->hm.Update(BR, this->S); - this->hm.Final(this->digest); - xorbuf(BL, this->digest, this->S); - - this->hm.Update(KL, this->L); - this->hm.Update(OL, this->S); - this->hm.Final(this->digest); - xorbuf(BR, this->digest, this->S); - - if (xorBlock) - xorbuf(outBlock, xorBlock, this->buffer, 2*this->S); - else - memcpy(outBlock, this->buffer, 2*this->S); - } -#undef KL -#undef KR -#undef BL -#undef BR -#undef IL -#undef IR -#undef OL -#undef OR - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/luc.cpp b/external/crypto++-5.6.3/luc.cpp deleted file mode 100644 index 27001be0b..000000000 --- a/external/crypto++-5.6.3/luc.cpp +++ /dev/null @@ -1,215 +0,0 @@ -// luc.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "luc.h" -#include "asn.h" -#include "sha.h" -#include "integer.h" -#include "nbtheory.h" -#include "algparam.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void LUC_TestInstantiations() -{ - LUC_HMP::Signer t1; - LUCFunction t2; - InvertibleLUCFunction t3; -} -#endif - -void DL_Algorithm_LUC_HMP::Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const -{ - const Integer &q = params.GetSubgroupOrder(); - r = params.ExponentiateBase(k); - s = (k + x*(r+e)) % q; -} - -bool DL_Algorithm_LUC_HMP::Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const -{ - const Integer p = params.GetGroupOrder()-1; - const Integer &q = params.GetSubgroupOrder(); - - Integer Vsg = params.ExponentiateBase(s); - Integer Vry = publicKey.ExponentiatePublicElement((r+e)%q); - return (Vsg*Vsg + Vry*Vry + r*r) % p == (Vsg * Vry * r + 4) % p; -} - -Integer DL_BasePrecomputation_LUC::Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const -{ - return Lucas(exponent, m_g, static_cast(group).GetModulus()); -} - -void DL_GroupParameters_LUC::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const -{ - for (unsigned int i=0; i Integer::One() && m_n.IsOdd(); - pass = pass && m_e > Integer::One() && m_e.IsOdd() && m_e < m_n; - return pass; -} - -bool LUCFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_GET_FUNCTION_ENTRY(PublicExponent) - ; -} - -void LUCFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_SET_FUNCTION_ENTRY(PublicExponent) - ; -} - -// ***************************************************************************** -// private key operations: - -class LUCPrimeSelector : public PrimeSelector -{ -public: - LUCPrimeSelector(const Integer &e) : m_e(e) {} - bool IsAcceptable(const Integer &candidate) const - { - return RelativelyPrime(m_e, candidate+1) && RelativelyPrime(m_e, candidate-1); - } - Integer m_e; -}; - -void InvertibleLUCFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - int modulusSize = 2048; - alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); - - if (modulusSize < 16) - throw InvalidArgument("InvertibleLUCFunction: specified modulus size is too small"); - - m_e = alg.GetValueWithDefault("PublicExponent", Integer(17)); - - if (m_e < 5 || m_e.IsEven()) - throw InvalidArgument("InvertibleLUCFunction: invalid public exponent"); - - LUCPrimeSelector selector(m_e); - AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) - ("PointerToPrimeSelector", selector.GetSelectorPointer()); - m_p.GenerateRandom(rng, primeParam); - m_q.GenerateRandom(rng, primeParam); - - m_n = m_p * m_q; - m_u = m_q.InverseMod(m_p); -} - -void InvertibleLUCFunction::Initialize(RandomNumberGenerator &rng, unsigned int keybits, const Integer &e) -{ - GenerateRandom(rng, MakeParameters("ModulusSize", (int)keybits)("PublicExponent", e)); -} - -void InvertibleLUCFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - - Integer version(seq); - if (!!version) // make sure version is 0 - BERDecodeError(); - - m_n.BERDecode(seq); - m_e.BERDecode(seq); - m_p.BERDecode(seq); - m_q.BERDecode(seq); - m_u.BERDecode(seq); - seq.MessageEnd(); -} - -void InvertibleLUCFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - - const byte version[] = {INTEGER, 1, 0}; - seq.Put(version, sizeof(version)); - m_n.DEREncode(seq); - m_e.DEREncode(seq); - m_p.DEREncode(seq); - m_q.DEREncode(seq); - m_u.DEREncode(seq); - seq.MessageEnd(); -} - -Integer InvertibleLUCFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const -{ - // not clear how to do blinding with LUC - CRYPTOPP_UNUSED(rng); - DoQuickSanityCheck(); - return InverseLucas(m_e, x, m_q, m_p, m_u); -} - -bool InvertibleLUCFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = LUCFunction::Validate(rng, level); - pass = pass && m_p > Integer::One() && m_p.IsOdd() && m_p < m_n; - pass = pass && m_q > Integer::One() && m_q.IsOdd() && m_q < m_n; - pass = pass && m_u.IsPositive() && m_u < m_p; - if (level >= 1) - { - pass = pass && m_p * m_q == m_n; - pass = pass && RelativelyPrime(m_e, m_p+1); - pass = pass && RelativelyPrime(m_e, m_p-1); - pass = pass && RelativelyPrime(m_e, m_q+1); - pass = pass && RelativelyPrime(m_e, m_q-1); - pass = pass && m_u * m_q % m_p == 1; - } - if (level >= 2) - pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); - return pass; -} - -bool InvertibleLUCFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -void InvertibleLUCFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/luc.h b/external/crypto++-5.6.3/luc.h deleted file mode 100644 index c2a6893c3..000000000 --- a/external/crypto++-5.6.3/luc.h +++ /dev/null @@ -1,305 +0,0 @@ -#ifndef CRYPTOPP_LUC_H -#define CRYPTOPP_LUC_H - -/** \file -*/ - -#include "cryptlib.h" -#include "gfpcrypt.h" -#include "integer.h" -#include "secblock.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4127 4189) -#endif - -#include "pkcspad.h" -#include "integer.h" -#include "oaep.h" -#include "dh.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! The LUC function. -/*! This class is here for historical and pedagogical interest. It has no - practical advantages over other trapdoor functions and probably shouldn't - be used in production software. The discrete log based LUC schemes - defined later in this .h file may be of more practical interest. -*/ -class LUCFunction : public TrapdoorFunction, public PublicKey -{ - typedef LUCFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &e) - {m_n = n; m_e = e;} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - Integer ApplyFunction(const Integer &x) const; - Integer PreimageBound() const {return m_n;} - Integer ImageBound() const {return m_n;} - - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // non-derived interface - const Integer & GetModulus() const {return m_n;} - const Integer & GetPublicExponent() const {return m_e;} - - void SetModulus(const Integer &n) {m_n = n;} - void SetPublicExponent(const Integer &e) {m_e = e;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~LUCFunction() {} -#endif - -protected: - Integer m_n, m_e; -}; - -//! _ -class InvertibleLUCFunction : public LUCFunction, public TrapdoorFunctionInverse, public PrivateKey -{ - typedef InvertibleLUCFunction ThisClass; - -public: - void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits, const Integer &eStart=17); - void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q, const Integer &u) - {m_n = n; m_e = e; m_p = p; m_q = q; m_u = u;} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; - - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - /*! parameters: (ModulusSize, PublicExponent (default 17)) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - // non-derived interface - const Integer& GetPrime1() const {return m_p;} - const Integer& GetPrime2() const {return m_q;} - const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} - - void SetPrime1(const Integer &p) {m_p = p;} - void SetPrime2(const Integer &q) {m_q = q;} - void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~InvertibleLUCFunction() {} -#endif - -protected: - Integer m_p, m_q, m_u; -}; - -struct LUC -{ - static std::string StaticAlgorithmName() {return "LUC";} - typedef LUCFunction PublicKey; - typedef InvertibleLUCFunction PrivateKey; -}; - -//! LUC cryptosystem -template -struct LUCES : public TF_ES -{ -}; - -//! LUC signature scheme with appendix -template -struct LUCSS : public TF_SS -{ -}; - -// analagous to the RSA schemes defined in PKCS #1 v2.0 -typedef LUCES >::Decryptor LUCES_OAEP_SHA_Decryptor; -typedef LUCES >::Encryptor LUCES_OAEP_SHA_Encryptor; - -typedef LUCSS::Signer LUCSSA_PKCS1v15_SHA_Signer; -typedef LUCSS::Verifier LUCSSA_PKCS1v15_SHA_Verifier; - -// ******************************************************** - -// no actual precomputation -class DL_GroupPrecomputation_LUC : public DL_GroupPrecomputation -{ -public: - const AbstractGroup & GetGroup() const {assert(false); throw 0;} - Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} - void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} - - // non-inherited - void SetModulus(const Integer &v) {m_p = v;} - const Integer & GetModulus() const {return m_p;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupPrecomputation_LUC() {} -#endif - -private: - Integer m_p; -}; - -//! _ -class DL_BasePrecomputation_LUC : public DL_FixedBasePrecomputation -{ -public: - // DL_FixedBasePrecomputation - bool IsInitialized() const {return m_g.NotZero();} - void SetBase(const DL_GroupPrecomputation &group, const Integer &base) - {CRYPTOPP_UNUSED(group); m_g = base;} - const Integer & GetBase(const DL_GroupPrecomputation &group) const - {CRYPTOPP_UNUSED(group); return m_g;} - void Precompute(const DL_GroupPrecomputation &group, unsigned int maxExpBits, unsigned int storage) - {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(maxExpBits); CRYPTOPP_UNUSED(storage);} - void Load(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) - {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);} - void Save(const DL_GroupPrecomputation &group, BufferedTransformation &storedPrecomputation) const - {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);} - Integer Exponentiate(const DL_GroupPrecomputation &group, const Integer &exponent) const; - Integer CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const - { - CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(exponent); CRYPTOPP_UNUSED(pc2); CRYPTOPP_UNUSED(exponent2); - // shouldn't be called - throw NotImplemented("DL_BasePrecomputation_LUC: CascadeExponentiate not implemented"); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_BasePrecomputation_LUC() {} -#endif - -private: - Integer m_g; -}; - -//! _ -class DL_GroupParameters_LUC : public DL_GroupParameters_IntegerBasedImpl -{ -public: - // DL_GroupParameters - bool IsIdentity(const Integer &element) const {return element == Integer::Two();} - void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; - Element MultiplyElements(const Element &a, const Element &b) const - { - CRYPTOPP_UNUSED(a); CRYPTOPP_UNUSED(b); - throw NotImplemented("LUC_GroupParameters: MultiplyElements can not be implemented"); - } - Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const - { - CRYPTOPP_UNUSED(element1); CRYPTOPP_UNUSED(exponent1); CRYPTOPP_UNUSED(element2); CRYPTOPP_UNUSED(exponent2); - throw NotImplemented("LUC_GroupParameters: MultiplyElements can not be implemented"); - } - - // NameValuePairs interface - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper(this, name, valueType, pValue).Assignable(); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_LUC() {} -#endif - -private: - int GetFieldType() const {return 2;} -}; - -//! _ -class DL_GroupParameters_LUC_DefaultSafePrime : public DL_GroupParameters_LUC -{ -public: - typedef NoCofactorMultiplication DefaultCofactorOption; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters_LUC_DefaultSafePrime() {} -#endif - -protected: - unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;} -}; - -//! _ -class DL_Algorithm_LUC_HMP : public DL_ElgamalLikeSignatureAlgorithm -{ -public: - static const char * StaticAlgorithmName() {return "LUC-HMP";} - - void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const; - bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const; - - size_t RLen(const DL_GroupParameters ¶ms) const - {return params.GetGroupOrder().ByteCount();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Algorithm_LUC_HMP() {} -#endif -}; - -//! _ -struct DL_SignatureKeys_LUC -{ - typedef DL_GroupParameters_LUC GroupParameters; - typedef DL_PublicKey_GFP PublicKey; - typedef DL_PrivateKey_GFP PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_SignatureKeys_LUC() {} -#endif -}; - -//! LUC-HMP, based on "Digital signature schemes based on Lucas functions" by Patrick Horster, Markus Michels, Holger Petersen -template -struct LUC_HMP : public DL_SS -{ -}; - -//! _ -struct DL_CryptoKeys_LUC -{ - typedef DL_GroupParameters_LUC_DefaultSafePrime GroupParameters; - typedef DL_PublicKey_GFP PublicKey; - typedef DL_PrivateKey_GFP PrivateKey; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_CryptoKeys_LUC() {} -#endif -}; - -//! LUC-IES -template -struct LUC_IES - : public DL_ES< - DL_CryptoKeys_LUC, - DL_KeyAgreementAlgorithm_DH, - DL_KeyDerivationAlgorithm_P1363 >, - DL_EncryptionAlgorithm_Xor, DHAES_MODE>, - LUC_IES<> > -{ - static std::string StaticAlgorithmName() {return "LUC-IES";} // non-standard name - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~LUC_IES() {} -#endif -}; - -// ******************************************************** - -//! LUC-DH -typedef DH_Domain LUC_DH; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/mars.cpp b/external/crypto++-5.6.3/mars.cpp deleted file mode 100644 index fe9b1186a..000000000 --- a/external/crypto++-5.6.3/mars.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// mars.cpp - written and placed in the public domain by Wei Dai - -// includes IBM's key setup "tweak" proposed in August 1999 (http://www.research.ibm.com/security/key-setup.txt) - -#include "pch.h" -#include "mars.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -void MARS::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - // Initialize T[] with the key data - FixedSizeSecBlock T; - GetUserKey(LITTLE_ENDIAN_ORDER, T.begin(), 15, userKey, length); - T[length/4] = length/4; - - for (unsigned int j=0; j<4; j++) // compute 10 words of K[] in each iteration - { - unsigned int i; - // Do linear transformation - for (i=0; i<15; i++) - T[i] = T[i] ^ rotlFixed(T[(i+8)%15] ^ T[(i+13)%15], 3) ^ (4*i+j); - - // Do four rounds of stirring - for (unsigned int k=0; k<4; k++) - for (i=0; i<15; i++) - T[i] = rotlFixed(T[i] + Sbox[T[(i+14)%15]%512], 9); - - // Store next 10 key words into K[] - for (i=0; i<10; i++) - m_k[10*j+i] = T[4*i%15]; - } - - // Modify multiplication key-words - for(unsigned int i = 5; i < 37; i += 2) - { - word32 m, w = m_k[i] | 3; - m = (~w ^ (w<<1)) & (~w ^ (w>>1)) & 0x7ffffffe; - m &= m>>1; m &= m>>2; m &= m>>4; - m |= m<<1; m |= m<<2; m |= m<<4; - m &= 0x7ffffffc; - w ^= rotlMod(Sbox[265 + (m_k[i] & 3)], m_k[i-1]) & m; - m_k[i] = w; - } -} - -#define S(a) Sbox[(a)&0x1ff] -#define S0(a) Sbox[(a)&0xff] -#define S1(a) Sbox[((a)&0xff) + 256] - -typedef BlockGetAndPut Block; - -void MARS::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - unsigned int i; - word32 a, b, c, d, l, m, r, t; - const word32 *k = m_k; - - Block::Get(inBlock)(a)(b)(c)(d); - - a += k[0]; b += k[1]; c += k[2]; d += k[3]; - - for (i=0; i<8; i++) - { - b = (b ^ S0(a)) + S1(a>>8); - c += S0(a>>16); - a = rotrFixed(a, 24); - d ^= S1(a); - a += (i%4==0) ? d : 0; - a += (i%4==1) ? b : 0; - t = a; a = b; b = c; c = d; d = t; - } - - for (i=0; i<16; i++) - { - t = rotlFixed(a, 13); - r = rotlFixed(t * k[2*i+5], 10); - m = a + k[2*i+4]; - l = rotlMod((S(m) ^ rotrFixed(r, 5) ^ r), r); - c += rotlMod(m, rotrFixed(r, 5)); - (i<8 ? b : d) += l; - (i<8 ? d : b) ^= r; - a = b; b = c; c = d; d = t; - } - - for (i=0; i<8; i++) - { - a -= (i%4==2) ? d : 0; - a -= (i%4==3) ? b : 0; - b ^= S1(a); - c -= S0(a>>24); - t = rotlFixed(a, 24); - d = (d - S1(a>>16)) ^ S0(t); - a = b; b = c; c = d; d = t; - } - - a -= k[36]; b -= k[37]; c -= k[38]; d -= k[39]; - - Block::Put(xorBlock, outBlock)(a)(b)(c)(d); -} - -void MARS::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - unsigned int i; - word32 a, b, c, d, l, m, r, t; - const word32 *k = m_k; - - Block::Get(inBlock)(d)(c)(b)(a); - - d += k[36]; c += k[37]; b += k[38]; a += k[39]; - - for (i=0; i<8; i++) - { - b = (b ^ S0(a)) + S1(a>>8); - c += S0(a>>16); - a = rotrFixed(a, 24); - d ^= S1(a); - a += (i%4==0) ? d : 0; - a += (i%4==1) ? b : 0; - t = a; a = b; b = c; c = d; d = t; - } - - for (i=0; i<16; i++) - { - t = rotrFixed(a, 13); - r = rotlFixed(a * k[35-2*i], 10); - m = t + k[34-2*i]; - l = rotlMod((S(m) ^ rotrFixed(r, 5) ^ r), r); - c -= rotlMod(m, rotrFixed(r, 5)); - (i<8 ? b : d) -= l; - (i<8 ? d : b) ^= r; - a = b; b = c; c = d; d = t; - } - - for (i=0; i<8; i++) - { - a -= (i%4==2) ? d : 0; - a -= (i%4==3) ? b : 0; - b ^= S1(a); - c -= S0(a>>24); - t = rotlFixed(a, 24); - d = (d - S1(a>>16)) ^ S0(t); - a = b; b = c; c = d; d = t; - } - - d -= k[0]; c -= k[1]; b -= k[2]; a -= k[3]; - - Block::Put(xorBlock, outBlock)(d)(c)(b)(a); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/mars.h b/external/crypto++-5.6.3/mars.h deleted file mode 100644 index 97fe893b9..000000000 --- a/external/crypto++-5.6.3/mars.h +++ /dev/null @@ -1,56 +0,0 @@ -// mars.h - written and placed in the public domain by Wei Dai - -//! \file mars.h -//! \brief Classes for the MARS block cipher (IBM AES submission) - -#ifndef CRYPTOPP_MARS_H -#define CRYPTOPP_MARS_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4> -{ - static const char *StaticAlgorithmName() {return "MARS";} -}; - -/// MARS -class MARS : public MARS_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - static const word32 Sbox[512]; - - FixedSizeSecBlock m_k; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef MARS::Encryption MARSEncryption; -typedef MARS::Decryption MARSDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/marss.cpp b/external/crypto++-5.6.3/marss.cpp deleted file mode 100644 index db1d51bf8..000000000 --- a/external/crypto++-5.6.3/marss.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// MARS S-Box - -#include "pch.h" -#include "mars.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -const word32 MARS::Base::Sbox[512] = { - 0x09d0c479, 0x28c8ffe0, 0x84aa6c39, 0x9dad7287, - 0x7dff9be3, 0xd4268361, 0xc96da1d4, 0x7974cc93, - 0x85d0582e, 0x2a4b5705, 0x1ca16a62, 0xc3bd279d, - 0x0f1f25e5, 0x5160372f, 0xc695c1fb, 0x4d7ff1e4, - 0xae5f6bf4, 0x0d72ee46, 0xff23de8a, 0xb1cf8e83, - 0xf14902e2, 0x3e981e42, 0x8bf53eb6, 0x7f4bf8ac, - 0x83631f83, 0x25970205, 0x76afe784, 0x3a7931d4, - 0x4f846450, 0x5c64c3f6, 0x210a5f18, 0xc6986a26, - 0x28f4e826, 0x3a60a81c, 0xd340a664, 0x7ea820c4, - 0x526687c5, 0x7eddd12b, 0x32a11d1d, 0x9c9ef086, - 0x80f6e831, 0xab6f04ad, 0x56fb9b53, 0x8b2e095c, - 0xb68556ae, 0xd2250b0d, 0x294a7721, 0xe21fb253, - 0xae136749, 0xe82aae86, 0x93365104, 0x99404a66, - 0x78a784dc, 0xb69ba84b, 0x04046793, 0x23db5c1e, - 0x46cae1d6, 0x2fe28134, 0x5a223942, 0x1863cd5b, - 0xc190c6e3, 0x07dfb846, 0x6eb88816, 0x2d0dcc4a, - 0xa4ccae59, 0x3798670d, 0xcbfa9493, 0x4f481d45, - 0xeafc8ca8, 0xdb1129d6, 0xb0449e20, 0x0f5407fb, - 0x6167d9a8, 0xd1f45763, 0x4daa96c3, 0x3bec5958, - 0xababa014, 0xb6ccd201, 0x38d6279f, 0x02682215, - 0x8f376cd5, 0x092c237e, 0xbfc56593, 0x32889d2c, - 0x854b3e95, 0x05bb9b43, 0x7dcd5dcd, 0xa02e926c, - 0xfae527e5, 0x36a1c330, 0x3412e1ae, 0xf257f462, - 0x3c4f1d71, 0x30a2e809, 0x68e5f551, 0x9c61ba44, - 0x5ded0ab8, 0x75ce09c8, 0x9654f93e, 0x698c0cca, - 0x243cb3e4, 0x2b062b97, 0x0f3b8d9e, 0x00e050df, - 0xfc5d6166, 0xe35f9288, 0xc079550d, 0x0591aee8, - 0x8e531e74, 0x75fe3578, 0x2f6d829a, 0xf60b21ae, - 0x95e8eb8d, 0x6699486b, 0x901d7d9b, 0xfd6d6e31, - 0x1090acef, 0xe0670dd8, 0xdab2e692, 0xcd6d4365, - 0xe5393514, 0x3af345f0, 0x6241fc4d, 0x460da3a3, - 0x7bcf3729, 0x8bf1d1e0, 0x14aac070, 0x1587ed55, - 0x3afd7d3e, 0xd2f29e01, 0x29a9d1f6, 0xefb10c53, - 0xcf3b870f, 0xb414935c, 0x664465ed, 0x024acac7, - 0x59a744c1, 0x1d2936a7, 0xdc580aa6, 0xcf574ca8, - 0x040a7a10, 0x6cd81807, 0x8a98be4c, 0xaccea063, - 0xc33e92b5, 0xd1e0e03d, 0xb322517e, 0x2092bd13, - 0x386b2c4a, 0x52e8dd58, 0x58656dfb, 0x50820371, - 0x41811896, 0xe337ef7e, 0xd39fb119, 0xc97f0df6, - 0x68fea01b, 0xa150a6e5, 0x55258962, 0xeb6ff41b, - 0xd7c9cd7a, 0xa619cd9e, 0xbcf09576, 0x2672c073, - 0xf003fb3c, 0x4ab7a50b, 0x1484126a, 0x487ba9b1, - 0xa64fc9c6, 0xf6957d49, 0x38b06a75, 0xdd805fcd, - 0x63d094cf, 0xf51c999e, 0x1aa4d343, 0xb8495294, - 0xce9f8e99, 0xbffcd770, 0xc7c275cc, 0x378453a7, - 0x7b21be33, 0x397f41bd, 0x4e94d131, 0x92cc1f98, - 0x5915ea51, 0x99f861b7, 0xc9980a88, 0x1d74fd5f, - 0xb0a495f8, 0x614deed0, 0xb5778eea, 0x5941792d, - 0xfa90c1f8, 0x33f824b4, 0xc4965372, 0x3ff6d550, - 0x4ca5fec0, 0x8630e964, 0x5b3fbbd6, 0x7da26a48, - 0xb203231a, 0x04297514, 0x2d639306, 0x2eb13149, - 0x16a45272, 0x532459a0, 0x8e5f4872, 0xf966c7d9, - 0x07128dc0, 0x0d44db62, 0xafc8d52d, 0x06316131, - 0xd838e7ce, 0x1bc41d00, 0x3a2e8c0f, 0xea83837e, - 0xb984737d, 0x13ba4891, 0xc4f8b949, 0xa6d6acb3, - 0xa215cdce, 0x8359838b, 0x6bd1aa31, 0xf579dd52, - 0x21b93f93, 0xf5176781, 0x187dfdde, 0xe94aeb76, - 0x2b38fd54, 0x431de1da, 0xab394825, 0x9ad3048f, - 0xdfea32aa, 0x659473e3, 0x623f7863, 0xf3346c59, - 0xab3ab685, 0x3346a90b, 0x6b56443e, 0xc6de01f8, - 0x8d421fc0, 0x9b0ed10c, 0x88f1a1e9, 0x54c1f029, - 0x7dead57b, 0x8d7ba426, 0x4cf5178a, 0x551a7cca, - 0x1a9a5f08, 0xfcd651b9, 0x25605182, 0xe11fc6c3, - 0xb6fd9676, 0x337b3027, 0xb7c8eb14, 0x9e5fd030, - 0x6b57e354, 0xad913cf7, 0x7e16688d, 0x58872a69, - 0x2c2fc7df, 0xe389ccc6, 0x30738df1, 0x0824a734, - 0xe1797a8b, 0xa4a8d57b, 0x5b5d193b, 0xc8a8309b, - 0x73f9a978, 0x73398d32, 0x0f59573e, 0xe9df2b03, - 0xe8a5b6c8, 0x848d0704, 0x98df93c2, 0x720a1dc3, - 0x684f259a, 0x943ba848, 0xa6370152, 0x863b5ea3, - 0xd17b978b, 0x6d9b58ef, 0x0a700dd4, 0xa73d36bf, - 0x8e6a0829, 0x8695bc14, 0xe35b3447, 0x933ac568, - 0x8894b022, 0x2f511c27, 0xddfbcc3c, 0x006662b6, - 0x117c83fe, 0x4e12b414, 0xc2bca766, 0x3a2fec10, - 0xf4562420, 0x55792e2a, 0x46f5d857, 0xceda25ce, - 0xc3601d3b, 0x6c00ab46, 0xefac9c28, 0xb3c35047, - 0x611dfee3, 0x257c3207, 0xfdd58482, 0x3b14d84f, - 0x23becb64, 0xa075f3a3, 0x088f8ead, 0x07adf158, - 0x7796943c, 0xfacabf3d, 0xc09730cd, 0xf7679969, - 0xda44e9ed, 0x2c854c12, 0x35935fa3, 0x2f057d9f, - 0x690624f8, 0x1cb0bafd, 0x7b0dbdc6, 0x810f23bb, - 0xfa929a1a, 0x6d969a17, 0x6742979b, 0x74ac7d05, - 0x010e65c4, 0x86a3d963, 0xf907b5a0, 0xd0042bd3, - 0x158d7d03, 0x287a8255, 0xbba8366f, 0x096edc33, - 0x21916a7b, 0x77b56b86, 0x951622f9, 0xa6c5e650, - 0x8cea17d1, 0xcd8c62bc, 0xa3d63433, 0x358a68fd, - 0x0f9b9d3c, 0xd6aa295b, 0xfe33384a, 0xc000738e, - 0xcd67eb2f, 0xe2eb6dc2, 0x97338b02, 0x06c9f246, - 0x419cf1ad, 0x2b83c045, 0x3723f18a, 0xcb5b3089, - 0x160bead7, 0x5d494656, 0x35f8a74b, 0x1e4e6c9e, - 0x000399bd, 0x67466880, 0xb4174831, 0xacf423b2, - 0xca815ab3, 0x5a6395e7, 0x302a67c5, 0x8bdb446b, - 0x108f8fa4, 0x10223eda, 0x92b8b48b, 0x7f38d0ee, - 0xab2701d4, 0x0262d415, 0xaf224a30, 0xb3d88aba, - 0xf8b2c3af, 0xdaf7ef70, 0xcc97d3b7, 0xe9614b6c, - 0x2baebff4, 0x70f687cf, 0x386c9156, 0xce092ee5, - 0x01e87da6, 0x6ce91e6a, 0xbb7bcc84, 0xc7922c20, - 0x9d3b71fd, 0x060e41c6, 0xd7590f15, 0x4e03bb47, - 0x183c198e, 0x63eeb240, 0x2ddbf49a, 0x6d5cba54, - 0x923750af, 0xf9e14236, 0x7838162b, 0x59726c72, - 0x81b66760, 0xbb2926c1, 0x48a0ce0d, 0xa6c0496d, - 0xad43507b, 0x718d496a, 0x9df057af, 0x44b1bde6, - 0x054356dc, 0xde7ced35, 0xd51a138b, 0x62088cc9, - 0x35830311, 0xc96efca2, 0x686f86ec, 0x8e77cb68, - 0x63e1d6b8, 0xc80f9778, 0x79c491fd, 0x1b4c67f2, - 0x72698d7d, 0x5e368c31, 0xf7d95e2e, 0xa1d3493f, - 0xdcd9433e, 0x896f1552, 0x4bc4ca7a, 0xa6d1baf4, - 0xa5a96dcc, 0x0bef8b46, 0xa169fda7, 0x74df40b7, - 0x4e208804, 0x9a756607, 0x038e87c8, 0x20211e44, - 0x8b7ad4bf, 0xc6403f35, 0x1848e36d, 0x80bdb038, - 0x1e62891c, 0x643d2107, 0xbf04d6f8, 0x21092c8c, - 0xf644f389, 0x0778404e, 0x7b78adb8, 0xa2c52d53, - 0x42157abe, 0xa2253e2e, 0x7bf3f4ae, 0x80f594f9, - 0x953194e7, 0x77eb92ed, 0xb3816930, 0xda8d9336, - 0xbf447469, 0xf26d9483, 0xee6faed5, 0x71371235, - 0xde425f73, 0xb4e59f43, 0x7dbe2d4e, 0x2d37b185, - 0x49dc9a63, 0x98c39d98, 0x1301c9a2, 0x389b1bbf, - 0x0c18588d, 0xa421c1ba, 0x7aa3865c, 0x71e08558, - 0x3c5cfcaa, 0x7d239ca4, 0x0297d9dd, 0xd7dc2830, - 0x4b37802b, 0x7428ab54, 0xaeee0347, 0x4b3fbb85, - 0x692f2f08, 0x134e578e, 0x36d9e0bf, 0xae8b5fcf, - 0xedb93ecf, 0x2b27248e, 0x170eb1ef, 0x7dc57fd6, - 0x1e760f16, 0xb1136601, 0x864e1b9b, 0xd7ea7319, - 0x3ab871bd, 0xcfa4d76f, 0xe31bd782, 0x0dbeb469, - 0xabb96061, 0x5370f85d, 0xffb07e37, 0xda30d0fb, - 0xebc977b6, 0x0b98b40f, 0x3a4d0fe6, 0xdf4fc26b, - 0x159cf22a, 0xc298d6e2, 0x2b78ef6a, 0x61a94ac0, - 0xab561187, 0x14eea0f0, 0xdf0d4164, 0x19af70ee -}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/md2.cpp b/external/crypto++-5.6.3/md2.cpp deleted file mode 100644 index e7b0a6bf8..000000000 --- a/external/crypto++-5.6.3/md2.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// md2.cpp - modified by Wei Dai from Andrew M. Kuchling's md2.c -// The original code and all modifications are in the public domain. - -// This is the original introductory comment: - -/* - * md2.c : MD2 hash algorithm. - * - * Part of the Python Cryptography Toolkit, version 1.1 - * - * Distribute and use freely; there are no restrictions on further - * dissemination and usage except those imposed by the laws of your - * country of residence. - * - */ - -#include "pch.h" -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -#include "md2.h" - -NAMESPACE_BEGIN(CryptoPP) -namespace Weak1 { - -MD2::MD2() - : m_X(48), m_C(16), m_buf(16) -{ - Init(); -} - -void MD2::Init() -{ - memset(m_X, 0, 48); - memset(m_C, 0, 16); - memset(m_buf, 0, 16); - m_count = 0; -} - -void MD2::Update(const byte *buf, size_t len) -{ - static const byte S[256] = { - 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, - 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, - 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, - 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, - 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, - 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, - 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, - 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, - 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, - 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, - 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, - 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, - 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, - 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, - 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, - 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, - 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, - 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 - }; - - while (len) - { - unsigned int L = UnsignedMin(16U-m_count, len); - memcpy(m_buf+m_count, buf, L); - m_count+=L; - buf+=L; - len-=L; - if (m_count==16) - { - byte t; - int i,j; - - m_count=0; - memcpy(m_X+16, m_buf, 16); - t=m_C[15]; - for(i=0; i<16; i++) - { - m_X[32+i]=m_X[16+i]^m_X[i]; - t=m_C[i]^=S[m_buf[i]^t]; - } - - t=0; - for(i=0; i<18; i++) - { - for(j=0; j<48; j+=8) - { - t=m_X[j+0]^=S[t]; - t=m_X[j+1]^=S[t]; - t=m_X[j+2]^=S[t]; - t=m_X[j+3]^=S[t]; - t=m_X[j+4]^=S[t]; - t=m_X[j+5]^=S[t]; - t=m_X[j+6]^=S[t]; - t=m_X[j+7]^=S[t]; - } - t = byte((t+i) & 0xFF); - } - } - } -} - -void MD2::TruncatedFinal(byte *hash, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - byte padding[16]; - word32 padlen; - unsigned int i; - - padlen= 16-m_count; - for(i=0; iMD2 -class MD2 : public HashTransformation -{ -public: - MD2(); - void Update(const byte *input, size_t length); - void TruncatedFinal(byte *hash, size_t size); - unsigned int DigestSize() const {return DIGESTSIZE;} - unsigned int BlockSize() const {return BLOCKSIZE;} - static const char * StaticAlgorithmName() {return "MD2";} - - CRYPTOPP_CONSTANT(DIGESTSIZE = 16) - CRYPTOPP_CONSTANT(BLOCKSIZE = 16) - -private: - void Transform(); - void Init(); - SecByteBlock m_X, m_C, m_buf; - unsigned int m_count; -}; - -} -#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 -namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak -#else -using namespace Weak1; // import Weak1 into CryptoPP with warning -#ifdef __GNUC__ -#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." -#else -#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") -#endif -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/md4.cpp b/external/crypto++-5.6.3/md4.cpp deleted file mode 100644 index 9ed639cb9..000000000 --- a/external/crypto++-5.6.3/md4.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// md4.cpp - modified by Wei Dai from Andrew M. Kuchling's md4.c -// The original code and all modifications are in the public domain. - -// This is the original introductory comment: - -/* - * md4.c : MD4 hash algorithm. - * - * Part of the Python Cryptography Toolkit, version 1.1 - * - * Distribute and use freely; there are no restrictions on further - * dissemination and usage except those imposed by the laws of your - * country of residence. - * - */ - -#include "pch.h" -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -#include "md4.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) -namespace Weak1 { - -void MD4::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xefcdab89L; - state[2] = 0x98badcfeL; - state[3] = 0x10325476L; -} - -void MD4::Transform (word32 *digest, const word32 *in) -{ -// #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - - word32 A, B, C, D; - - A=digest[0]; - B=digest[1]; - C=digest[2]; - D=digest[3]; - -#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+in[k],s); - function(A,B,C,D, 0, 3); - function(D,A,B,C, 1, 7); - function(C,D,A,B, 2,11); - function(B,C,D,A, 3,19); - function(A,B,C,D, 4, 3); - function(D,A,B,C, 5, 7); - function(C,D,A,B, 6,11); - function(B,C,D,A, 7,19); - function(A,B,C,D, 8, 3); - function(D,A,B,C, 9, 7); - function(C,D,A,B,10,11); - function(B,C,D,A,11,19); - function(A,B,C,D,12, 3); - function(D,A,B,C,13, 7); - function(C,D,A,B,14,11); - function(B,C,D,A,15,19); - -#undef function -#define function(a,b,c,d,k,s) a=rotlFixed(a+G(b,c,d)+in[k]+0x5a827999,s); - function(A,B,C,D, 0, 3); - function(D,A,B,C, 4, 5); - function(C,D,A,B, 8, 9); - function(B,C,D,A,12,13); - function(A,B,C,D, 1, 3); - function(D,A,B,C, 5, 5); - function(C,D,A,B, 9, 9); - function(B,C,D,A,13,13); - function(A,B,C,D, 2, 3); - function(D,A,B,C, 6, 5); - function(C,D,A,B,10, 9); - function(B,C,D,A,14,13); - function(A,B,C,D, 3, 3); - function(D,A,B,C, 7, 5); - function(C,D,A,B,11, 9); - function(B,C,D,A,15,13); - -#undef function -#define function(a,b,c,d,k,s) a=rotlFixed(a+H(b,c,d)+in[k]+0x6ed9eba1,s); - function(A,B,C,D, 0, 3); - function(D,A,B,C, 8, 9); - function(C,D,A,B, 4,11); - function(B,C,D,A,12,15); - function(A,B,C,D, 2, 3); - function(D,A,B,C,10, 9); - function(C,D,A,B, 6,11); - function(B,C,D,A,14,15); - function(A,B,C,D, 1, 3); - function(D,A,B,C, 9, 9); - function(C,D,A,B, 5,11); - function(B,C,D,A,13,15); - function(A,B,C,D, 3, 3); - function(D,A,B,C,11, 9); - function(C,D,A,B, 7,11); - function(B,C,D,A,15,15); - - digest[0]+=A; - digest[1]+=B; - digest[2]+=C; - digest[3]+=D; -} - -} -NAMESPACE_END diff --git a/external/crypto++-5.6.3/md4.h b/external/crypto++-5.6.3/md4.h deleted file mode 100644 index 53387003c..000000000 --- a/external/crypto++-5.6.3/md4.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef CRYPTOPP_MD4_H -#define CRYPTOPP_MD4_H - -#include "iterhash.h" - -NAMESPACE_BEGIN(CryptoPP) - -namespace Weak1 { - -//! MD4 -/*! \warning MD4 is considered insecure, and should not be used - unless you absolutely need it for compatibility. */ -class MD4 : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word32 *digest, const word32 *data); - static const char *StaticAlgorithmName() {return "MD4";} -}; - -} -#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 -namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak -#else -using namespace Weak1; // import Weak1 into CryptoPP with warning -#ifdef __GNUC__ -#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." -#else -#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") -#endif -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/md5.cpp b/external/crypto++-5.6.3/md5.cpp deleted file mode 100644 index e7c7ac871..000000000 --- a/external/crypto++-5.6.3/md5.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// md5.cpp - modified by Wei Dai from Colin Plumb's public domain md5.c -// any modifications are placed in the public domain - -#include "pch.h" -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 -#include "md5.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) -namespace Weak1 { - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void MD5_TestInstantiations() -{ - MD5 x; -} -#endif - -void MD5::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xefcdab89L; - state[2] = 0x98badcfeL; - state[3] = 0x10325476L; -} - -void MD5::Transform (word32 *digest, const word32 *in) -{ -// #define F1(x, y, z) (x & y | ~x & z) -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -#define MD5STEP(f, w, x, y, z, data, s) \ - w = rotlFixed(w + f(x, y, z) + data, s) + x - - word32 a, b, c, d; - - a=digest[0]; - b=digest[1]; - c=digest[2]; - d=digest[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - digest[0]+=a; - digest[1]+=b; - digest[2]+=c; - digest[3]+=d; -} - -} -NAMESPACE_END diff --git a/external/crypto++-5.6.3/md5.h b/external/crypto++-5.6.3/md5.h deleted file mode 100644 index 73ec5326c..000000000 --- a/external/crypto++-5.6.3/md5.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef CRYPTOPP_MD5_H -#define CRYPTOPP_MD5_H - -#include "iterhash.h" - -NAMESPACE_BEGIN(CryptoPP) - -namespace Weak1 { - -//! MD5 -class MD5 : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word32 *digest, const word32 *data); - static const char * StaticAlgorithmName() {return "MD5";} -}; - -} -#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 -namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak -#else -using namespace Weak1; // import Weak1 into CryptoPP with warning -#ifdef __GNUC__ -#warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." -#else -#pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") -#endif -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/mdc.h b/external/crypto++-5.6.3/mdc.h deleted file mode 100644 index e814cccca..000000000 --- a/external/crypto++-5.6.3/mdc.h +++ /dev/null @@ -1,73 +0,0 @@ - // mdc.h - written and placed in the public domain by Wei Dai - -#ifndef CRYPTOPP_MDC_H -#define CRYPTOPP_MDC_H - -/** \file -*/ - -#include "seckey.h" -#include "secblock.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -template -struct MDC_Info : public FixedBlockSize, public FixedKeyLength -{ - static std::string StaticAlgorithmName() {return std::string("MDC/")+T::StaticAlgorithmName();} -}; - -//! MDC -/*! a construction by Peter Gutmann to turn an iterated hash function into a PRF */ -template -class MDC : public MDC_Info -{ - class CRYPTOPP_NO_VTABLE Enc : public BlockCipherImpl > - { - typedef typename T::HashWordType HashWordType; - - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) - { - this->AssertValidKeyLength(length); - memcpy_s(m_key, m_key.size(), userKey, this->KEYLENGTH); - T::CorrectEndianess(Key(), Key(), this->KEYLENGTH); - } - - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const - { - T::CorrectEndianess(Buffer(), (HashWordType *)inBlock, this->BLOCKSIZE); - T::Transform(Buffer(), Key()); - if (xorBlock) - { - T::CorrectEndianess(Buffer(), Buffer(), this->BLOCKSIZE); - xorbuf(outBlock, xorBlock, m_buffer, this->BLOCKSIZE); - } - else - T::CorrectEndianess((HashWordType *)outBlock, Buffer(), this->BLOCKSIZE); - } - - bool IsPermutation() const {return false;} - - unsigned int OptimalDataAlignment() const {return sizeof(HashWordType);} - - private: - HashWordType *Key() {return (HashWordType *)m_key.data();} - const HashWordType *Key() const {return (const HashWordType *)m_key.data();} - HashWordType *Buffer() const {return (HashWordType *)m_buffer.data();} - - // VC60 workaround: bug triggered if using FixedSizeAllocatorWithCleanup - FixedSizeSecBlock::KEYLENGTH, AllocatorWithCleanup > m_key; - mutable FixedSizeSecBlock::BLOCKSIZE, AllocatorWithCleanup > m_buffer; - }; - -public: - //! use BlockCipher interface - typedef BlockCipherFinal Encryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/mersenne.h b/external/crypto++-5.6.3/mersenne.h deleted file mode 100644 index 1148e8bb8..000000000 --- a/external/crypto++-5.6.3/mersenne.h +++ /dev/null @@ -1,193 +0,0 @@ -// mersenne.h - written and placed in public domain by Jeffrey Walton. -// Copyright assigned to Crypto++ project. - -//! \file -//! \brief Class file for Mersenne Twister -//! \note Suitable for Monte Carlo simulations, and not cryptographic use - -#ifndef CRYPTOPP_MERSENNE_TWISTER_H -#define CRYPTOPP_MERSENNE_TWISTER_H - -#include "cryptlib.h" -#include "secblock.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class MersenneTwister -//! \brief Mersenne Twister class for Monte-Carlo simulations -//! \tparam K Magic constant -//! \tparam M Period parameter -//! \tparam N Size of the state vector -//! \tparam F Multiplier constant -//! \tparam S Sefault seed -//! \details Provides the MersenneTwister implementation. The class is a header-only implementation. -//! \warning MersenneTwister is suitable for simulations, where uniformaly distrubuted numbers are -//! required quickly. It should not be used for cryptographic purposes. -template -class MersenneTwister : public RandomNumberGenerator -{ -public: - //! \brief Construct a Mersenne Twister - //! \param seed 32-bit seed - //! \details Defaults to template parameter S due to changing algorithm - //! parameters over time - MersenneTwister(unsigned long seed = S) : m_seed(seed), m_idx(N) - { - m_state[0] = seed; - for (unsigned int i = 1; i < N+1; i++) - m_state[i] = word32(F * (m_state[i-1] ^ (m_state[i-1] >> 30)) + i); - } - - //! \brief Generate random array of bytes - //! \param output byte buffer - //! \param size length of the buffer, in bytes - //! \details Bytes are written to output in big endian order. If output length - //! is not a multiple of word32, then unused bytes are not accumulated for subsequent - //! calls to GenerateBlock. Rather, the unused tail bytes are discarded, and the - //! stream is continued at the next word32 boundary from the state array. - void GenerateBlock(byte *output, size_t size) - { - // Handle word32 size blocks - word32 temp; - for (size_t i=0; i < size/4; i++, output += 4) - { -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && defined(IS_LITTLE_ENDIAN) - *((word32*)output) = ByteReverse(NextMersenneWord()); -#elif defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) - *((word32*)output) = NextMersenneWord(); -#else - temp = NextMersenneWord(); - output[3] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 0); - output[2] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 1); - output[1] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 2); - output[0] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 3); -#endif - } - - // No tail bytes - if (size%4 == 0) - { - // Wipe temp - *((volatile word32*)&temp) = 0; - return; - } - - // Handle tail bytes - temp = NextMersenneWord(); - switch (size%4) - { - case 3: output[2] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 1); /* fall through */ - case 2: output[1] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 2); /* fall through */ - case 1: output[0] = CRYPTOPP_GET_BYTE_AS_BYTE(temp, 3); break; - - default: assert(0); ;; - } - - // Wipe temp - *((volatile word32*)&temp) = 0; - } - - //! \brief Generate a random 32-bit word in the range min to max, inclusive - //! \returns random 32-bit word in the range min to max, inclusive - //! \details If the 32-bit candidate is not within the range, then it is discarded - //! and a new candidate is used. - word32 GenerateWord32(word32 min=0, word32 max=0xffffffffL) - { - const word32 range = max-min; - if (range == 0xffffffffL) - return NextMersenneWord(); - - const int maxBits = BitPrecision(range); - word32 value; - - do{ - value = Crop(NextMersenneWord(), maxBits); - } while (value > range); - - return value+min; - } - - //! \brief Generate and discard n bytes - //! \param n the number of bytes to discard, rounded up to a word32 size - //! \details If n is not a multiple of word32, then unused bytes are - //! not accumulated for subsequent calls to GenerateBlock. Rather, the unused - //! tail bytes are discarded, and the stream is continued at the next - //! word32 boundary from the state array. - void DiscardBytes(size_t n) - { - for(size_t i=0; i < RoundUpToMultipleOf(n, 4U); i++) - NextMersenneWord(); - } - -protected: - - //! \brief Returns the next 32-bit word from the state array - //! \returns the next 32-bit word from the state array - //! \details fetches the next word frm the state array, performs bit operations on - //! it, and then returns the value to the caller. - word32 NextMersenneWord() - { - if (m_idx >= N) { Twist(); } - - word32 temp = m_state[m_idx++]; - - temp ^= (temp >> 11); - temp ^= (temp << 7) & 0x9D2C5680; // 0x9D2C5680 (2636928640) - temp ^= (temp << 15) & 0xEFC60000; // 0xEFC60000 (4022730752) - - return temp ^ (temp >> 18); - } - - //! \brief Performs the twist operaton on the state array - void Twist() - { - static const unsigned long magic[2]={0x0UL, K}; - word32 kk, temp; - - assert(N >= M); - for (kk=0;kk> 1) ^ magic[temp & 0x1UL]; - } - - for (;kk> 1) ^ magic[temp & 0x1UL]; - } - - temp = (m_state[N-1] & 0x80000000)|(m_state[0] & 0x7FFFFFFF); - m_state[N-1] = m_state[M-1] ^ (temp >> 1) ^ magic[temp & 0x1UL]; - - // Reset index - m_idx = 0; - - // Wipe temp - *((volatile word32*)&temp) = 0; - } - -private: - - //! \brief 32-bit word state array of size N - FixedSizeSecBlock m_state; - //! \brief the value used to seed the generator - unsigned int m_seed; - //! \brief the current index into the state array - unsigned int m_idx; -}; - -//! \brief Original MT19937 generator provided in the ACM paper. -//! \details Also see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf; uses 4537 as default initial seed. -typedef MersenneTwister<0x9908B0DF /*2567483615*/, 397, 624, 0x10DCD /*69069*/, 4537> MT19937; - -//! \brief Updated MT19937 generator adapted to provide an array for initialization. -//! \details Also see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html; uses 5489 as default initial seed. -//! \note Use this generator when interoperating with C++11's mt19937 class. -typedef MersenneTwister<0x9908B0DF /*2567483615*/, 397, 624, 0x6C078965 /*1812433253*/, 5489> MT19937ar; - -NAMESPACE_END - -#endif // CRYPTOPP_MERSENNE_TWISTER_H - \ No newline at end of file diff --git a/external/crypto++-5.6.3/misc.cpp b/external/crypto++-5.6.3/misc.cpp deleted file mode 100644 index 0289e9af6..000000000 --- a/external/crypto++-5.6.3/misc.cpp +++ /dev/null @@ -1,210 +0,0 @@ -// misc.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4189) -# if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(disable: 6237) -# endif -#endif - -#ifndef CRYPTOPP_IMPORTS - -#include "misc.h" -#include "words.h" -#include "words.h" -#include "stdcpp.h" -#include "integer.h" - -// for memalign -#if defined(CRYPTOPP_MEMALIGN_AVAILABLE) || defined(CRYPTOPP_MM_MALLOC_AVAILABLE) || defined(QNX) -# include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -void xorbuf(byte *buf, const byte *mask, size_t count) -{ - assert(buf != NULL); - assert(mask != NULL); - assert(count > 0); - - size_t i=0; - if (IsAligned(buf) && IsAligned(mask)) - { - if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) - { - for (i=0; i 0); - - size_t i=0; - if (IsAligned(output) && IsAligned(input) && IsAligned(mask)) - { - if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(output) && IsAligned(input) && IsAligned(mask)) - { - for (i=0; i 0); - - size_t i=0; - byte acc8 = 0; - - if (IsAligned(buf) && IsAligned(mask)) - { - word32 acc32 = 0; - if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned(buf) && IsAligned(mask)) - { - word64 acc64 = 0; - for (i=0; i>32); - } - - for (i=0; i>8) | byte(acc32>>16) | byte(acc32>>24); - } - - for (i=0; i= 1400) -# pragma warning(disable: 6326) -# endif -#endif - -#include "cryptlib.h" -#include "stdcpp.h" -#include "smartptr.h" - -#ifdef _MSC_VER - #if _MSC_VER >= 1400 - // VC2005 workaround: disable declarations that conflict with winnt.h - #define _interlockedbittestandset CRYPTOPP_DISABLED_INTRINSIC_1 - #define _interlockedbittestandreset CRYPTOPP_DISABLED_INTRINSIC_2 - #define _interlockedbittestandset64 CRYPTOPP_DISABLED_INTRINSIC_3 - #define _interlockedbittestandreset64 CRYPTOPP_DISABLED_INTRINSIC_4 - #include - #undef _interlockedbittestandset - #undef _interlockedbittestandreset - #undef _interlockedbittestandset64 - #undef _interlockedbittestandreset64 - #define CRYPTOPP_FAST_ROTATE(x) 1 - #elif _MSC_VER >= 1300 - #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64) - #else - #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) - #endif -#elif (defined(__MWERKS__) && TARGET_CPU_PPC) || \ - (defined(__GNUC__) && (defined(_ARCH_PWR2) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_ARCH_COM))) - #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) -#elif defined(__GNUC__) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86) // depend on GCC's peephole optimization to generate rotate instructions - #define CRYPTOPP_FAST_ROTATE(x) 1 -#else - #define CRYPTOPP_FAST_ROTATE(x) 0 -#endif - -#ifdef __BORLANDC__ -#include -#endif - -// !KLUDGE! @FD This gets confused and tries to include -// tier1/byteswap.h. We'll just fall back on the slower -// routines.//#if defined(__GNUC__) && defined(__linux__) -//#define CRYPTOPP_BYTESWAP_AVAILABLE -//#include -//#endif - -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -#if CRYPTOPP_DOXYGEN_PROCESSING -//! \brief The maximum value of a machine word -//! \details SIZE_MAX provides the maximum value of a machine word. The value is -//! \p 0xffffffff on 32-bit machines, and \p 0xffffffffffffffff on 64-bit machines. -//! Internally, SIZE_MAX is defined as __SIZE_MAX__ if __SIZE_MAX__ is defined. If not -//! defined, then SIZE_T_MAX is tried. If neither __SIZE_MAX__ nor SIZE_T_MAX is -//! is defined, the library uses std::numeric_limits::max(). The library -//! prefers __SIZE_MAX__ because its a constexpr that is optimized well -//! by all compilers. std::numeric_limits::max() is \a not a constexpr, -//! and it is \a not always optimized well. -# define SIZE_MAX ... -#else -// Its amazing portability problems still plague this simple concept in 2015. -// http://stackoverflow.com/questions/30472731/which-c-standard-header-defines-size-max -// Avoid NOMINMAX macro on Windows. http://support.microsoft.com/en-us/kb/143208 -#ifndef SIZE_MAX -# if defined(__SIZE_MAX__) -# define SIZE_MAX __SIZE_MAX__ -# elif defined(SIZE_T_MAX) -# define SIZE_MAX SIZE_T_MAX -# else -# define SIZE_MAX ((std::numeric_limits::max)()) -# endif -#endif - -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -NAMESPACE_BEGIN(CryptoPP) - -// Forward declaration for IntToString specialization -class Integer; - -// ************** compile-time assertion *************** - -#if CRYPTOPP_DOXYGEN_PROCESSING -//! \brief Compile time assertion -//! \param expr the expression to evaluate -//! \details Asserts the expression expr though a dummy struct. -#define CRYPTOPP_COMPILE_ASSERT(expr) ... -#else // CRYPTOPP_DOXYGEN_PROCESSING -template -struct CompileAssert -{ - static char dummy[2*b-1]; -}; -//! \endif - -#define CRYPTOPP_COMPILE_ASSERT(assertion) CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, __LINE__) -#if defined(CRYPTOPP_EXPORTS) || defined(CRYPTOPP_IMPORTS) -#define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) -#else -# if defined(__GNUC__) -# define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) \ - static CompileAssert<(assertion)> \ - CRYPTOPP_ASSERT_JOIN(cryptopp_assert_, instance) __attribute__ ((unused)) -# else -# define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) \ - static CompileAssert<(assertion)> \ - CRYPTOPP_ASSERT_JOIN(cryptopp_assert_, instance) -# endif // __GNUC__ -#endif -#define CRYPTOPP_ASSERT_JOIN(X, Y) CRYPTOPP_DO_ASSERT_JOIN(X, Y) -#define CRYPTOPP_DO_ASSERT_JOIN(X, Y) X##Y - -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -// ************** count elements in an array *************** - -#if CRYPTOPP_DOXYGEN_PROCESSING -//! \brief Counts elements in an array -//! \param arr an array of elements -//! \details COUNTOF counts elements in an array. On Windows COUNTOF(x) is deinfed -//! to _countof(x) to ensure correct results for pointers. Since the library code -//! is cross-platform, Windows will ensure the safety on non-Windows platforms. -//! \note COUNTOF does not produce correct results with pointers, and an array must be used. -//! The library ensures correct application of COUNTOF by enlisting _countof on Windows -//! platforms. Microsoft's _countof fails to compile using pointers. -# define COUNTOF(arr) -#else -// VS2005 added _countof -#ifndef COUNTOF -# if defined(_MSC_VER) && (_MSC_VER >= 1400) -# define COUNTOF(x) _countof(x) -# else -# define COUNTOF(x) (sizeof(x)/sizeof(x[0])) -# endif -#endif // COUNTOF -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -// ************** misc classes *************** - -#if !CRYPTOPP_DOXYGEN_PROCESSING -class CRYPTOPP_DLL Empty -{ -}; - -template -class CRYPTOPP_NO_VTABLE TwoBases : public BASE1, public BASE2 -{ -}; - -template -class CRYPTOPP_NO_VTABLE ThreeBases : public BASE1, public BASE2, public BASE3 -{ -}; -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -//! \class ObjectHolder -//! \tparam the class or type -//! \brief Uses encapsulation to hide an object in derived classes -//! \details The object T is declared as protected. -template -class ObjectHolder -{ -protected: - T m_object; -}; - -//! \class NotCopyable -//! \brief Ensures an object is not copyable -//! \details NotCopyable ensures an object is not copyable by making the -//! copy constructor and assignment operator private. Deleters are not -//! used under C++11. -//! \sa Clonable class -class NotCopyable -{ -public: - NotCopyable() {} -private: - NotCopyable(const NotCopyable &); - void operator=(const NotCopyable &); -}; - -//! \class NewObject -//! \brief An object factory function -//! \details NewObject overloads operator()(). -template -struct NewObject -{ - T* operator()() const {return new T;} -}; - -#if CRYPTOPP_DOXYGEN_PROCESSING -//! \brief A memory barrier -//! \details MEMORY_BARRIER attempts to ensure reads and writes are completed -//! in the absence of a language synchronization point. It is used by the -//! Singleton class if the compiler supports it. The use is provided at the -//! customary check points in a double-checked initialization. -//! \details Internally, MEMORY_BARRIER uses intrinsic(_ReadWriteBarrier), -//! _ReadWriteBarrier() or __asm__("" ::: "memory"). -#define MEMORY_BARRIER ... -#else -#if (_MSC_VER >= 1400) -# pragma intrinsic(_ReadWriteBarrier) -# define MEMORY_BARRIER() _ReadWriteBarrier() -#elif defined(__INTEL_COMPILER) -# define MEMORY_BARRIER() __memory_barrier() -#elif defined(__GNUC__) || defined(__clang__) -# define MEMORY_BARRIER() __asm__ __volatile__ ("" ::: "memory") -#else -# define MEMORY_BARRIER() -#endif -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -//! \brief Restricts the instantiation of a class to one static object without locks -//! \tparam T the class or type -//! \tparam F the object factory for T -//! \tparam instance the initiali instance count -//! \details This class safely initializes a static object in a multithreaded environment -//! without using locks (for portability). Note that if two threads call Ref() at the same -//! time, they may get back different references, and one object may end up being memory -//! leaked. This is by design. -template , int instance=0> -class Singleton -{ -public: - Singleton(F objectFactory = F()) : m_objectFactory(objectFactory) {} - - // prevent this function from being inlined - CRYPTOPP_NOINLINE const T & Ref(CRYPTOPP_NOINLINE_DOTDOTDOT) const; - -private: - F m_objectFactory; -}; - -//! \brief Return a reference to the inner Singleton object -//! \details Ref() is used to create the object using the object factory. The -//! object is only created once with the limitations discussed in the class documentation. -template -const T & Singleton::Ref(CRYPTOPP_NOINLINE_DOTDOTDOT) const -{ - static volatile simple_ptr s_pObject; - T *p = s_pObject.m_p; - MEMORY_BARRIER(); - - if (p) - return *p; - - T *newObject = m_objectFactory(); - p = s_pObject.m_p; - MEMORY_BARRIER(); - - if (p) - { - delete newObject; - return *p; - } - - s_pObject.m_p = newObject; - MEMORY_BARRIER(); - - return *newObject; -} - -// ************** misc functions *************** - -#if (!__STDC_WANT_SECURE_LIB__ && !defined(_MEMORY_S_DEFINED)) || defined(CRYPTOPP_WANT_SECURE_LIB) - -//! \brief Bounds checking replacement for memcpy() -//! \param dest pointer to the desination memory block -//! \param sizeInBytes the size of the desination memory block, in bytes -//! \param src pointer to the source memory block -//! \param count the size of the source memory block, in bytes -//! \throws InvalidArgument -//! \details ISO/IEC TR-24772 provides bounds checking interfaces for potentially -//! unsafe functions like memcpy(), strcpy() and memmove(). However, -//! not all standard libraries provides them, like Glibc. The library's -//! memcpy_s() is a near-drop in replacement. Its only a near-replacement -//! because the library's version throws an InvalidArgument on a bounds violation. -//! \details memcpy_s() and memmove_s() are guarded by __STDC_WANT_SECURE_LIB__. -//! If __STDC_WANT_SECURE_LIB__ is \a not defined or defined to 0, then the library -//! makes memcpy_s() and memmove_s() available. The library will also optionally -//! make the symbols available if CRYPTOPP_WANT_SECURE_LIB is defined. -//! CRYPTOPP_WANT_SECURE_LIB is in config.h, but it is disabled by default. -//! \details memcpy_s() will assert the pointers src and dest are not NULL -//! in debug builds. Passing NULL for either pointer is undefined behavior. -inline void memcpy_s(void *dest, size_t sizeInBytes, const void *src, size_t count) -{ - // Safer functions on Windows for C&A, http://github.com/weidai11/cryptopp/issues/55 - - // Pointers must be valid; otherwise undefined behavior - assert(dest != NULL); assert(src != NULL); - // Destination buffer must be large enough to satsify request - assert(sizeInBytes >= count); - if (count > sizeInBytes) - throw InvalidArgument("memcpy_s: buffer overflow"); - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4996) -# if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(disable: 6386) -# endif -#endif - memcpy(dest, src, count); -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif -} - -//! \brief Bounds checking replacement for memmove() -//! \param dest pointer to the desination memory block -//! \param sizeInBytes the size of the desination memory block, in bytes -//! \param src pointer to the source memory block -//! \param count the size of the source memory block, in bytes -//! \throws InvalidArgument -//! \details ISO/IEC TR-24772 provides bounds checking interfaces for potentially -//! unsafe functions like memcpy(), strcpy() and memmove(). However, -//! not all standard libraries provides them, like Glibc. The library's -//! memmove_s() is a near-drop in replacement. Its only a near-replacement -//! because the library's version throws an InvalidArgument on a bounds violation. -//! \details memcpy_s() and memmove_s() are guarded by __STDC_WANT_SECURE_LIB__. -//! If __STDC_WANT_SECURE_LIB__ is \a not defined or defined to 0, then the library -//! makes memcpy_s() and memmove_s() available. The library will also optionally -//! make the symbols available if CRYPTOPP_WANT_SECURE_LIB is defined. -//! CRYPTOPP_WANT_SECURE_LIB is in config.h, but it is disabled by default. -//! \details memmove_s() will assert the pointers src and dest are not NULL -//! in debug builds. Passing NULL for either pointer is undefined behavior. -inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t count) -{ - // Safer functions on Windows for C&A, http://github.com/weidai11/cryptopp/issues/55 - - // Pointers must be valid; otherwise undefined behavior - assert(dest != NULL); assert(src != NULL); - // Destination buffer must be large enough to satsify request - assert(sizeInBytes >= count); - if (count > sizeInBytes) - throw InvalidArgument("memmove_s: buffer overflow"); - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4996) -# if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(disable: 6386) -# endif -#endif - memmove(dest, src, count); -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif -} - -#if __BORLANDC__ >= 0x620 -// C++Builder 2010 workaround: can't use std::memcpy_s because it doesn't allow 0 lengths -# define memcpy_s CryptoPP::memcpy_s -# define memmove_s CryptoPP::memmove_s -#endif - -#endif // __STDC_WANT_SECURE_LIB__ - -//! \brief Memory block initializer and eraser that attempts to survive optimizations -//! \param ptr pointer to the memory block being written -//! \param value the integer value to write for each byte -//! \param num the size of the source memory block, in bytes -//! \details Internally the function calls memset with the value value, and receives the -//! return value from memset as a volatile pointer. -inline void * memset_z(void *ptr, int value, size_t num) -{ -// avoid extranous warning on GCC 4.3.2 Ubuntu 8.10 -#if CRYPTOPP_GCC_VERSION >= 30001 - if (__builtin_constant_p(num) && num==0) - return ptr; -#endif - volatile void* x = memset(ptr, value, num); - return const_cast(x); -} - -//! \brief Replacement function for std::min -//! \param a the first value -//! \param b the second value -//! \returns the minimum value based on a comparison of b \< a using operator\< -//! \details STDMIN was provided because the library could not use std::min or std::max in MSVC60 or Cygwin 1.1.0 -template inline const T& STDMIN(const T& a, const T& b) -{ - return b < a ? b : a; -} - -//! \brief Replacement function for std::max -//! \param a the first value -//! \param b the second value -//! \returns the minimum value based on a comparison of a \< b using operator\< -//! \details STDMAX was provided because the library could not use std::min or std::max in MSVC60 or Cygwin 1.1.0 -template inline const T& STDMAX(const T& a, const T& b) -{ - // can't use std::min or std::max in MSVC60 or Cygwin 1.1.0 - return a < b ? b : a; -} - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4389) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wsign-compare" -# if (CRYPTOPP_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 30000) -# pragma GCC diagnostic ignored "-Wtautological-compare" -# elif (CRYPTOPP_GCC_VERSION >= 40300) -# pragma GCC diagnostic ignored "-Wtype-limits" -# endif -#endif - -//! \brief Safe comparison of values that could be neagtive and incorrectly promoted -//! \param a the first value -//! \param b the second value -//! \returns the minimum value based on a comparison a and b using operator<. -//! \details The comparison b \< a is performed and the value returned is a's type T1. -template inline const T1 UnsignedMin(const T1& a, const T2& b) -{ - CRYPTOPP_COMPILE_ASSERT((sizeof(T1)<=sizeof(T2) && T2(-1)>0) || (sizeof(T1)>sizeof(T2) && T1(-1)>0)); - if (sizeof(T1)<=sizeof(T2)) - return b < (T2)a ? (T1)b : a; - else - return (T1)b < a ? (T1)b : a; -} - -//! \brief Tests whether a conversion from → to is safe to perform -//! \param from the first value -//! \param to the second value -//! \returns true if its safe to convert from into to, false otherwise. -template -inline bool SafeConvert(T1 from, T2 &to) -{ - to = (T2)from; - if (from != to || (from > 0) != (to > 0)) - return false; - return true; -} - -//! \brief Converts a value to a string -//! \param value the value to convert -//! \param base the base to use during the conversion -//! \returns the string representation of value in base. -template -std::string IntToString(T value, unsigned int base = 10) -{ - // Hack... set the high bit for uppercase. - static const unsigned int HIGH_BIT = (1U << 31); - const char CH = !!(base & HIGH_BIT) ? 'A' : 'a'; - base &= ~HIGH_BIT; - - assert(base >= 2); - if (value == 0) - return "0"; - - bool negate = false; - if (value < 0) - { - negate = true; - value = 0-value; // VC .NET does not like -a - } - std::string result; - while (value > 0) - { - T digit = value % base; - result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result; - value /= base; - } - if (negate) - result = "-" + result; - return result; -} - -//! \brief Converts an unsigned value to a string -//! \param value the value to convert -//! \param base the base to use during the conversion -//! \returns the string representation of value in base. -//! \details this template function specialization was added to suppress -//! Coverity findings on IntToString() with unsigned types. -template <> CRYPTOPP_DLL -std::string IntToString(unsigned long long value, unsigned int base); - -//! \brief Converts an Integer to a string -//! \param value the Integer to convert -//! \param base the base to use during the conversion -//! \returns the string representation of value in base. -//! \details This is a template specialization of IntToString(). Use it -//! like IntToString(): -//!

-//!   // Print integer in base 10
-//!   Integer n...
-//!   std::string s = IntToString(n, 10);
-//! 
-//! \details The string is presented with lowercase letters by default. A -//! hack is available to switch to uppercase letters without modifying -//! the function signature.sha -//!
-//!   // Print integer in base 10, uppercase letters
-//!   Integer n...
-//!   const unsigned int UPPER = (1 << 31);
-//!   std::string s = IntToString(n, (UPPER | 10));
-//! 
-template <> CRYPTOPP_DLL -std::string IntToString(Integer value, unsigned int base); - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic pop -#endif - -#define RETURN_IF_NONZERO(x) size_t returnedValue = x; if (returnedValue) return returnedValue - -// this version of the macro is fastest on Pentium 3 and Pentium 4 with MSVC 6 SP5 w/ Processor Pack -#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y))) -// these may be faster on other CPUs/compilers -// #define GETBYTE(x, y) (unsigned int)(((x)>>(8*(y)))&255) -// #define GETBYTE(x, y) (((byte *)&(x))[y]) - -#define CRYPTOPP_GET_BYTE_AS_BYTE(x, y) byte((x)>>(8*(y))) - -//! \brief Returns the parity of a value -//! \param value the value to provide the parity -//! \returns 1 if the number 1-bits in the value is odd, 0 otherwise -template -unsigned int Parity(T value) -{ - for (unsigned int i=8*sizeof(value)/2; i>0; i/=2) - value ^= value >> i; - return (unsigned int)value&1; -} - -//! \brief Returns the number of 8-bit bytes or octets required for a value -//! \param value the value to test -//! \returns the minimum number of 8-bit bytes or octets required to represent a value -template -unsigned int BytePrecision(const T &value) -{ - if (!value) - return 0; - - unsigned int l=0, h=8*sizeof(value); - while (h-l > 8) - { - unsigned int t = (l+h)/2; - if (value >> t) - l = t; - else - h = t; - } - - return h/8; -} - -//! \brief Returns the number of bits required for a value -//! \param value the value to test -//! \returns the maximum number of bits required to represent a value. -template -unsigned int BitPrecision(const T &value) -{ - if (!value) - return 0; - - unsigned int l=0, h=8*sizeof(value); - - while (h-l > 1) - { - unsigned int t = (l+h)/2; - if (value >> t) - l = t; - else - h = t; - } - - return h; -} - -//! Determines the number of trailing 0-bits in a value -//! \param v the 32-bit value to test -//! \returns the number of trailing 0-bits in v, starting at the least significant bit position -//! \details TrailingZeros returns the number of trailing 0-bits in v, starting at the least -//! significant bit position. The return value is undefined if there are no 1-bits set in the value v. -//! \note The function does \a not return 0 if no 1-bits are set because 0 collides with a 1-bit at the 0-th position. -inline unsigned int TrailingZeros(word32 v) -{ - assert(v != 0); -#if defined(__GNUC__) && CRYPTOPP_GCC_VERSION >= 30400 - return __builtin_ctz(v); -#elif defined(_MSC_VER) && _MSC_VER >= 1400 - unsigned long result; - _BitScanForward(&result, v); - return result; -#else - // from http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightMultLookup - static const int MultiplyDeBruijnBitPosition[32] = - { - 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, - 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 - }; - return MultiplyDeBruijnBitPosition[((word32)((v & -v) * 0x077CB531U)) >> 27]; -#endif -} - -//! Determines the number of trailing 0-bits in a value -//! \param v the 64-bit value to test -//! \returns the number of trailing 0-bits in v, starting at the least significant bit position -//! \details TrailingZeros returns the number of trailing 0-bits in v, starting at the least -//! significant bit position. The return value is undefined if there are no 1-bits set in the value v. -//! \note The function does \a not return 0 if no 1-bits are set because 0 collides with a 1-bit at the 0-th position. -inline unsigned int TrailingZeros(word64 v) -{ - assert(v != 0); -#if defined(__GNUC__) && CRYPTOPP_GCC_VERSION >= 30400 - return __builtin_ctzll(v); -#elif defined(_MSC_VER) && _MSC_VER >= 1400 && (defined(_M_X64) || defined(_M_IA64)) - unsigned long result; - _BitScanForward64(&result, v); - return result; -#else - return word32(v) ? TrailingZeros(word32(v)) : 32 + TrailingZeros(word32(v>>32)); -#endif -} - -//! \brief Truncates the value to the specified number of bits. -//! \param value the value to truncate or mask -//! \param bits the number of bits to truncate or mask -//! \returns the value truncated to the specified number of bits, starting at the least -//! significant bit position -//! \details This function masks the low-order bits of value and returns the result. The -//! mask is created with (1 << bits) - 1. -template -inline T Crop(T value, size_t bits) -{ - if (bits < 8*sizeof(value)) - return T(value & ((T(1) << bits) - 1)); - else - return value; -} - -//! \brief Returns the number of 8-bit bytes or octets required for the specified number of bits -//! \param bitCount the number of bits -//! \returns the minimum number of 8-bit bytes or octets required by bitCount -//! \details BitsToBytes is effectively a ceiling function based on 8-bit bytes. -inline size_t BitsToBytes(size_t bitCount) -{ - return ((bitCount+7)/(8)); -} - -//! \brief Returns the number of words required for the specified number of bytes -//! \param byteCount the number of bytes -//! \returns the minimum number of words required by byteCount -//! \details BytesToWords is effectively a ceiling function based on WORD_SIZE. -//! WORD_SIZE is defined in config.h -inline size_t BytesToWords(size_t byteCount) -{ - return ((byteCount+WORD_SIZE-1)/WORD_SIZE); -} - -//! \brief Returns the number of words required for the specified number of bits -//! \param bitCount the number of bits -//! \returns the minimum number of words required by bitCount -//! \details BitsToWords is effectively a ceiling function based on WORD_BITS. -//! WORD_BITS is defined in config.h -inline size_t BitsToWords(size_t bitCount) -{ - return ((bitCount+WORD_BITS-1)/(WORD_BITS)); -} - -//! \brief Returns the number of double words required for the specified number of bits -//! \param bitCount the number of bits -//! \returns the minimum number of double words required by bitCount -//! \details BitsToDwords is effectively a ceiling function based on 2*WORD_BITS. -//! WORD_BITS is defined in config.h -inline size_t BitsToDwords(size_t bitCount) -{ - return ((bitCount+2*WORD_BITS-1)/(2*WORD_BITS)); -} - -//! Performs an XOR of a buffer with a mask -//! \param buf the buffer to XOR with the mask -//! \param mask the mask to XOR with the buffer -//! \param count the size of the buffers, in bytes -//! \details The function effectively visits each element in the buffers and performs -//! buf[i] ^= mask[i]. buf and mask must be of equal size. -CRYPTOPP_DLL void CRYPTOPP_API xorbuf(byte *buf, const byte *mask, size_t count); - -//! Performs an XOR of an input buffer with a mask and stores the result in an output buffer -//! \param output the destination buffer -//! \param input the source buffer to XOR with the mask -//! \param mask the mask buffer to XOR with the input buffer -//! \param count the size of the buffers, in bytes -//! \details The function effectively visits each element in the buffers and performs -//! output[i] = input[i] ^ mask[i]. output, input and mask must be of equal size. -CRYPTOPP_DLL void CRYPTOPP_API xorbuf(byte *output, const byte *input, const byte *mask, size_t count); - -//! \brief Performs a near constant-time comparison of two equally sized buffers -//! \param buf1 the first buffer -//! \param buf2 the second buffer -//! \param count the size of the buffers, in bytes -//! \details The function effectively performs an XOR of the elements in two equally sized buffers -//! and retruns a result based on the XOR operation. The function is near constant-time because -//! CPU micro-code timings could affect the "constant-ness". Calling code is responsible for -//! mitigating timing attacks if the buffers are \a not equally sized. -CRYPTOPP_DLL bool CRYPTOPP_API VerifyBufsEqual(const byte *buf1, const byte *buf2, size_t count); - -//! \brief Tests whether a value is a power of 2 -//! \param value the value to test -//! \returns true if value is a power of 2, false otherwise -//! \details The function creates a mask of value - 1 and returns the result of -//! an AND operation compared to 0. If value is 0 or less than 0, then the function returns false. -template -inline bool IsPowerOf2(const T &value) -{ - return value > 0 && (value & (value-1)) == 0; -} - -//! \brief Tests whether the residue of a value is a power of 2 -//! \param a the value to test -//! \param b the value to use to reduce \a to its residue -//! \returns true if a\%b is a power of 2, false otherwise -//! \details The function effectively creates a mask of b - 1 and returns the result of an -//! AND operation compared to 0. b must be a power of 2 or the result is undefined. -template -inline T2 ModPowerOf2(const T1 &a, const T2 &b) -{ - assert(IsPowerOf2(b)); - return T2(a) & (b-1); -} - -//! \brief Rounds a value down to a multiple of a second value -//! \param n the value to reduce -//! \param m the value to reduce \n to to a multiple -//! \returns the possibly unmodified value \n -//! \details RoundDownToMultipleOf is effectively a floor function based on m. The function returns -//! the value n - n\%m. If n is a multiple of m, then the original value is returned. -template -inline T1 RoundDownToMultipleOf(const T1 &n, const T2 &m) -{ - if (IsPowerOf2(m)) - return n - ModPowerOf2(n, m); - else - return n - n%m; -} - -//! \brief Rounds a value up to a multiple of a second value -//! \param n the value to reduce -//! \param m the value to reduce \n to to a multiple -//! \returns the possibly unmodified value \n -//! \details RoundUpToMultipleOf is effectively a ceiling function based on m. The function -//! returns the value n + n\%m. If n is a multiple of m, then the original value is -//! returned. If the value n would overflow, then an InvalidArgument exception is thrown. -template -inline T1 RoundUpToMultipleOf(const T1 &n, const T2 &m) -{ - if (n > (SIZE_MAX/sizeof(T1))-m-1) - throw InvalidArgument("RoundUpToMultipleOf: integer overflow"); - return RoundDownToMultipleOf(T1(n+m-1), m); -} - -//! \brief Returns the minimum alignment requirements of a type -//! \param dummy an unused Visual C++ 6.0 workaround -//! \returns the minimum alignment requirements of a type, in bytes -//! \details Internally the function calls C++11's alignof if available. If not available, the -//! function uses compiler specific extensions such as __alignof and _alignof_. sizeof(T) -//! is used if the others are not available. In all cases, if CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -//! is defined, then the function returns 1. -template -inline unsigned int GetAlignmentOf(T *dummy=NULL) // VC60 workaround -{ -// GCC 4.6 (circa 2008) and above aggressively uses vectorization. -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) - if (sizeof(T) < 16) - return 1; -#endif - CRYPTOPP_UNUSED(dummy); -#if defined(CRYPTOPP_CXX11_ALIGNOF) - return alignof(T); -#elif (_MSC_VER >= 1300) - return __alignof(T); -#elif defined(__GNUC__) - return __alignof__(T); -#elif CRYPTOPP_BOOL_SLOW_WORD64 - return UnsignedMin(4U, sizeof(T)); -#else - return sizeof(T); -#endif -} - -//! \brief Determines whether ptr is aligned to a minimum value -//! \param ptr the pointer being checked for alignment -//! \param alignment the alignment value to test the pointer against -//! \returns true if ptr is aligned on at least align boundary -//! \details Internally the function tests whether alignment is 1. If so, the function returns true. -//! If not, then the function effectively performs a modular reduction and returns true if the residue is 0 -inline bool IsAlignedOn(const void *ptr, unsigned int alignment) -{ - return alignment==1 || (IsPowerOf2(alignment) ? ModPowerOf2((size_t)ptr, alignment) == 0 : (size_t)ptr % alignment == 0); -} - -//! \brief Determines whether ptr is minimally aligned -//! \param ptr the pointer to check for alignment -//! \param dummy an unused Visual C++ 6.0 workaround -//! \returns true if ptr follows native byte ordering, false otherwise -//! \details Internally the function calls IsAlignedOn with a second parameter of GetAlignmentOf -template -inline bool IsAligned(const void *ptr, T *dummy=NULL) // VC60 workaround -{ - CRYPTOPP_UNUSED(dummy); - return IsAlignedOn(ptr, GetAlignmentOf()); -} - -#if defined(IS_LITTLE_ENDIAN) - typedef LittleEndian NativeByteOrder; -#elif defined(IS_BIG_ENDIAN) - typedef BigEndian NativeByteOrder; -#else -# error "Unable to determine endian-ness" -#endif - -//! \brief Returns NativeByteOrder as an enumerated ByteOrder value -//! \returns LittleEndian if the native byte order is little-endian, and BigEndian if the - //! native byte order is big-endian -//! \details NativeByteOrder is a typedef depending on the platform. If IS_LITTLE_ENDIAN is - //! set in \headerfile config.h, then GetNativeByteOrder returns LittleEndian. If - //! IS_BIG_ENDIAN is set, then GetNativeByteOrder returns BigEndian. -//! \note There are other byte orders besides little- and big-endian, and they include bi-endian - //! and PDP-endian. If a system is neither little-endian nor big-endian, then a compile time error occurs. -inline ByteOrder GetNativeByteOrder() -{ - return NativeByteOrder::ToEnum(); -} - -//! \brief Determines whether order follows native byte ordering -//! \param order the ordering being tested against native byte ordering -//! \returns true if order follows native byte ordering, false otherwise -inline bool NativeByteOrderIs(ByteOrder order) -{ - return order == GetNativeByteOrder(); -} - -//! \brief Performs a saturating subtract clamped at 0 -//! \param a the minuend -//! \param b the subtrahend -//! \returns the difference produced by the saturating subtract -//! \details Saturating arithmetic restricts results to a fixed range. Results that are less than 0 are clamped at 0. -//! \details Use of saturating arithmetic in places can be advantageous because it can -//! avoid a branch by using an instruction like a conditional move (CMOVE). -template -inline T1 SaturatingSubtract(const T1 &a, const T2 &b) -{ - // Generated ASM of a typical clamp, http://gcc.gnu.org/ml/gcc-help/2014-10/msg00112.html - return T1((a > b) ? (a - b) : 0); -} - -//! \brief Performs a saturating subtract clamped at 1 -//! \param a the minuend -//! \param b the subtrahend -//! \returns the difference produced by the saturating subtract -//! \details Saturating arithmetic restricts results to a fixed range. Results that are less than 1 are clamped at 1. -//! \details Use of saturating arithmetic in places can be advantageous because it can -//! avoid a branch by using an instruction like a conditional move (CMOVE). -template -inline T1 SaturatingSubtract1(const T1 &a, const T2 &b) -{ - // Generated ASM of a typical clamp, http://gcc.gnu.org/ml/gcc-help/2014-10/msg00112.html - return T1((a > b) ? (a - b) : 1); -} - -//! \brief Returns the direction the cipher is being operated -//! \param obj the cipher object being queried -//! \returns /p ENCRYPTION if the cipher obj is being operated in its forward direction, -//! DECRYPTION otherwise -//! \details ciphers can be operated in a "forward" direction (encryption) and a "reverse" -//! direction (decryption). The operations do not have to be symmetric, meaning a second application -//! of the transformation does not necessariy return the original message. That is, E(D(m)) -//! may not equal E(E(m)); and D(E(m)) may not equal D(D(m)). -template -inline CipherDir GetCipherDir(const T &obj) -{ - return obj.IsForwardTransformation() ? ENCRYPTION : DECRYPTION; -} - -//! \brief Attempts to reclaim unused memory -//! \throws bad_alloc -//! \details In the normal course of running a program, a request for memory normally succeeds. If a -//! call to AlignedAllocate or UnalignedAllocate fails, then CallNewHandler is called in -//! an effort to recover. Internally, CallNewHandler calls set_new_handler(NULL) in an effort -//! to free memory. There is no guarantee CallNewHandler will be able to procure more memory so -//! an allocation succeeds. If the call to set_new_handler fails, then CallNewHandler throws -//! a bad_alloc exception. -CRYPTOPP_DLL void CRYPTOPP_API CallNewHandler(); - -//! \brief Performs an addition with carry on a block of bytes -//! \param inout the byte block -//! \param size the size of the block, in bytes -//! \details Performs an addition with carry by adding 1 on a block of bytes starting at the least -//! significant byte. Once carry is 0, the function terminates and returns to the caller. -//! \note The function is not constant time because it stops processing when the carry is 0. -inline void IncrementCounterByOne(byte *inout, unsigned int size) -{ - assert(inout != NULL); assert(size < INT_MAX); - for (int i=int(size-1), carry=1; i>=0 && carry; i--) - carry = !++inout[i]; -} - -//! \brief Performs an addition with carry on a block of bytes -//! \param output the destination block of bytes -//! \param input the source block of bytes -//! \param size the size of the block -//! \details Performs an addition with carry on a block of bytes starting at the least significant -//! byte. Once carry is 0, the remaining bytes from input are copied to output using memcpy. -//! \details The function is \a close to near-constant time because it operates on all the bytes in the blocks. -inline void IncrementCounterByOne(byte *output, const byte *input, unsigned int size) -{ - assert(output != NULL); assert(input != NULL); assert(size < INT_MAX); - - int i, carry; - for (i=int(size-1), carry=1; i>=0 && carry; i--) - carry = ((output[i] = input[i]+1) == 0); - memcpy_s(output, size, input, i+1); -} - -//! \brief Performs a branchless swap of values a and b if condition c is true -//! \param c the condition to perform the swap -//! \param a the first value -//! \param b the second value -template -inline void ConditionalSwap(bool c, T &a, T &b) -{ - T t = c * (a ^ b); - a ^= t; - b ^= t; -} - -//! \brief Performs a branchless swap of pointers a and b if condition c is true -//! \param c the condition to perform the swap -//! \param a the first pointer -//! \param b the second pointer -template -inline void ConditionalSwapPointers(bool c, T &a, T &b) -{ - ptrdiff_t t = size_t(c) * (a - b); - a -= t; - b += t; -} - -// see http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/protect-secrets.html -// and https://www.securecoding.cert.org/confluence/display/cplusplus/MSC06-CPP.+Be+aware+of+compiler+optimization+when+dealing+with+sensitive+data - -//! \brief Sets each element of an array to 0 -//! \param buf an array of elements -//! \param n the number of elements in the array -//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal -template -void SecureWipeBuffer(T *buf, size_t n) -{ - // GCC 4.3.2 on Cygwin optimizes away the first store if this loop is done in the forward direction - volatile T *p = buf+n; - while (n--) - *((volatile T*)(--p)) = 0; -} - -#if (_MSC_VER >= 1400 || defined(__GNUC__)) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86) - -//! \brief Sets each byte of an array to 0 -//! \param buf an array of bytes -//! \param n the number of elements in the array -//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal -template<> inline void SecureWipeBuffer(byte *buf, size_t n) -{ - volatile byte *p = buf; -#ifdef __GNUC__ - asm volatile("rep stosb" : "+c"(n), "+D"(p) : "a"(0) : "memory"); -#else - __stosb((byte *)(size_t)p, 0, n); -#endif -} - -//! \brief Sets each 16-bit element of an array to 0 -//! \param buf an array of 16-bit words -//! \param n the number of elements in the array -//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal -template<> inline void SecureWipeBuffer(word16 *buf, size_t n) -{ - volatile word16 *p = buf; -#ifdef __GNUC__ - asm volatile("rep stosw" : "+c"(n), "+D"(p) : "a"(0) : "memory"); -#else - __stosw((word16 *)(size_t)p, 0, n); -#endif -} - -//! \brief Sets each 32-bit element of an array to 0 -//! \param buf an array of 32-bit words -//! \param n the number of elements in the array -//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal -template<> inline void SecureWipeBuffer(word32 *buf, size_t n) -{ - volatile word32 *p = buf; -#ifdef __GNUC__ - asm volatile("rep stosl" : "+c"(n), "+D"(p) : "a"(0) : "memory"); -#else - __stosd((unsigned long *)(size_t)p, 0, n); -#endif -} - -//! \brief Sets each 64-bit element of an array to 0 -//! \param buf an array of 64-bit words -//! \param n the number of elements in the array -//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal -template<> inline void SecureWipeBuffer(word64 *buf, size_t n) -{ -#if CRYPTOPP_BOOL_X64 - volatile word64 *p = buf; -#ifdef __GNUC__ - asm volatile("rep stosq" : "+c"(n), "+D"(p) : "a"(0) : "memory"); -#else - __stosq((word64 *)(size_t)p, 0, n); -#endif -#else - SecureWipeBuffer((word32 *)buf, 2*n); -#endif -} - -#endif // #if (_MSC_VER >= 1400 || defined(__GNUC__)) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86) - -//! \brief Sets each element of an array to 0 -//! \param buf an array of elements -//! \param n the number of elements in the array -//! \details The operation is effectively a wipe or zeroization. The operation attempts to survive optimizations and dead code removal -template -inline void SecureWipeArray(T *buf, size_t n) -{ - if (sizeof(T) % 8 == 0 && GetAlignmentOf() % GetAlignmentOf() == 0) - SecureWipeBuffer((word64 *)buf, n * (sizeof(T)/8)); - else if (sizeof(T) % 4 == 0 && GetAlignmentOf() % GetAlignmentOf() == 0) - SecureWipeBuffer((word32 *)buf, n * (sizeof(T)/4)); - else if (sizeof(T) % 2 == 0 && GetAlignmentOf() % GetAlignmentOf() == 0) - SecureWipeBuffer((word16 *)buf, n * (sizeof(T)/2)); - else - SecureWipeBuffer((byte *)buf, n * sizeof(T)); -} - -//! \brief Converts a wide character C-string to a multibyte string -//! \param str a C-string consiting of wide characters -//! \param throwOnError specifies the function should throw an InvalidArgument exception on error -//! \returns str converted to a multibyte string or an empty string. -//! \details This function converts a wide string to a string using C++ wcstombs under the executing -//! thread's locale. A locale must be set before using this function, and it can be set with setlocale. -//! Upon success, the converted string is returned. Upon failure with throwOnError as false, the -//! function returns an empty string. Upon failure with throwOnError as true, the function throws -//! InvalidArgument exception. -//! \note If you try to convert, say, the Chinese character for "bone" from UTF-16 (0x9AA8) to UTF-8 -//! (0xE9 0xAA 0xA8), then you should ensure the locales are available. If the locales are not available, -//! then a 0x21 error is returned which eventually results in an InvalidArgument exception -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -static inline std::string StringNarrow(const wchar_t *str, bool throwOnError = true) -#else -static std::string StringNarrow(const wchar_t *str, bool throwOnError = true) -#endif -{ - assert(str); - std::string result; - - // Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55 -#if (CRYPTOPP_MSC_VERSION >= 1400) - size_t len=0, size = 0; - errno_t err = 0; - - //const wchar_t* ptr = str; - //while (*ptr++) len++; - len = wcslen(str)+1; - - err = wcstombs_s(&size, NULL, 0, str, len*sizeof(wchar_t)); - assert(err == 0); - if (err != 0) {goto CONVERSION_ERROR;} - - result.resize(size); - err = wcstombs_s(&size, &result[0], size, str, len*sizeof(wchar_t)); - assert(err == 0); - - if (err != 0) - { -CONVERSION_ERROR: - if (throwOnError) - throw InvalidArgument("StringNarrow: wcstombs_s() call failed with error " + IntToString(err)); - else - return std::string(); - } - - // The safe routine's size includes the NULL. - if (!result.empty() && result[size - 1] == '\0') - result.erase(size - 1); -#else - size_t size = wcstombs(NULL, str, 0); - assert(size != (size_t)-1); - if (size == (size_t)-1) {goto CONVERSION_ERROR;} - - result.resize(size); - size = wcstombs(&result[0], str, size); - assert(size != (size_t)-1); - - if (size == (size_t)-1) - { -CONVERSION_ERROR: - if (throwOnError) - throw InvalidArgument("StringNarrow: wcstombs() call failed"); - else - return std::string(); - } -#endif - - return result; -} - -#ifdef CRYPTOPP_DOXYGEN_PROCESSING - -//! \brief Allocates a buffer on 16-byte boundary -//! \param size the size of the buffer -//! \details AlignedAllocate is primarily used when the data will be proccessed by MMX and SSE2 -//! instructions. The assembly language routines rely on the alignment. If the alignment is not -//! respected, then a SIGBUS is generated under Unix and an EXCEPTION_DATATYPE_MISALIGNMENT -//! is generated under Windows. -//! \note AlignedAllocate and AlignedDeallocate are available when CRYPTOPP_BOOL_ALIGN16 is -//! defined. CRYPTOPP_BOOL_ALIGN16 is defined in config.h -CRYPTOPP_DLL void* CRYPTOPP_API AlignedAllocate(size_t size); - -//! \brief Frees a buffer allocated with AlignedAllocate -//! \param ptr the buffer to free -//! \note AlignedAllocate and AlignedDeallocate are available when CRYPTOPP_BOOL_ALIGN16 is -//! defined. CRYPTOPP_BOOL_ALIGN16 is defined in config.h -CRYPTOPP_DLL void CRYPTOPP_API AlignedDeallocate(void *ptr); - -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -#if CRYPTOPP_BOOL_ALIGN16 -CRYPTOPP_DLL void* CRYPTOPP_API AlignedAllocate(size_t size); -CRYPTOPP_DLL void CRYPTOPP_API AlignedDeallocate(void *ptr); -#endif // CRYPTOPP_BOOL_ALIGN16 - -//! \brief Allocates a buffer -//! \param size the size of the buffer -CRYPTOPP_DLL void * CRYPTOPP_API UnalignedAllocate(size_t size); - -//! \brief Frees a buffer allocated with UnalignedAllocate -//! \param ptr the buffer to free -CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(void *ptr); - -// ************** rotate functions *************** - -//! \brief Performs a left rotate -//! \param x the value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. -//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! Use rotlMod if the rotate amount y is outside the range. -//! \note rotlFixed attempts to enlist a rotate IMM instruction because its often faster -//! than a rotate REG. Immediate rotates can be up to three times faster than their register -//! counterparts. -template inline T rotlFixed(T x, unsigned int y) -{ - // Portable rotate that reduces to single instruction... - // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157, - // https://software.intel.com/en-us/forums/topic/580884 - // and https://llvm.org/bugs/show_bug.cgi?id=24226 - - static const unsigned int THIS_SIZE = sizeof(T)*8; - static const unsigned int MASK = THIS_SIZE-1; - - assert(y < THIS_SIZE); - return T((x<>(-y&MASK))); -} - -//! \brief Performs a right rotate -//! \param x the value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. -//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! Use rotrMod if the rotate amount y is outside the range. -//! \note rotrFixed attempts to enlist a rotate IMM instruction because its often faster -//! than a rotate REG. Immediate rotates can be up to three times faster than their register -//! counterparts. -template inline T rotrFixed(T x, unsigned int y) -{ - // Portable rotate that reduces to single instruction... - // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157, - // https://software.intel.com/en-us/forums/topic/580884 - // and https://llvm.org/bugs/show_bug.cgi?id=24226 - static const unsigned int THIS_SIZE = sizeof(T)*8; - static const unsigned int MASK = THIS_SIZE-1; - assert(y < THIS_SIZE); - return T((x >> y)|(x<<(-y&MASK))); -} - -//! \brief Performs a left rotate -//! \param x the value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. -//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! Use rotlMod if the rotate amount y is outside the range. -//! \note rotlVariable attempts to enlist a rotate IMM instruction because its often faster -//! than a rotate REG. Immediate rotates can be up to three times faster than their register -//! counterparts. -template inline T rotlVariable(T x, unsigned int y) -{ - static const unsigned int THIS_SIZE = sizeof(T)*8; - static const unsigned int MASK = THIS_SIZE-1; - assert(y < THIS_SIZE); - return T((x<>(-y&MASK))); -} - -//! \brief Performs a right rotate -//! \param x the value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. -//! \details y must be in the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! Use rotrMod if the rotate amount y is outside the range. -//! \note rotrVariable attempts to enlist a rotate IMM instruction because its often faster -//! than a rotate REG. Immediate rotates can be up to three times faster than their register -//! counterparts. -template inline T rotrVariable(T x, unsigned int y) -{ - static const unsigned int THIS_SIZE = sizeof(T)*8; - static const unsigned int MASK = THIS_SIZE-1; - assert(y < THIS_SIZE); - return T((x>>y)|(x<<(-y&MASK))); -} - -//! \brief Performs a left rotate -//! \param x the value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. -//! \details y is reduced to the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrVariable will use either rotate IMM or rotate REG. -template inline T rotlMod(T x, unsigned int y) -{ - static const unsigned int THIS_SIZE = sizeof(T)*8; - static const unsigned int MASK = THIS_SIZE-1; - return T((x<<(y&MASK))|(x>>(-y&MASK))); -} - -//! \brief Performs a right rotate -//! \param x the value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a portable C/C++ implementation. The value x to be rotated can be 8 to 64-bits. -//! \details y is reduced to the range [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrVariable will use either rotate IMM or rotate REG. -template inline T rotrMod(T x, unsigned int y) -{ - static const unsigned int THIS_SIZE = sizeof(T)*8; - static const unsigned int MASK = THIS_SIZE-1; - return T((x>>(y&MASK))|(x<<(-y&MASK))); -} - -#ifdef _MSC_VER - -//! \brief Performs a left rotate -//! \param x the 32-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile -//! . The value x to be rotated is 32-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotlFixed will assert in Debug builds if is outside the allowed range. -template<> inline word32 rotlFixed(word32 x, unsigned int y) -{ - // Uses Microsoft call, bound to C/C++ language rules. - assert(y < 8*sizeof(x)); - return y ? _lrotl(x, static_cast(y)) : x; -} - -//! \brief Performs a right rotate -//! \param x the 32-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile -//! . The value x to be rotated is 32-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrFixed will assert in Debug builds if is outside the allowed range. -template<> inline word32 rotrFixed(word32 x, unsigned int y) -{ - // Uses Microsoft call, bound to C/C++ language rules. - assert(y < 8*sizeof(x)); - return y ? _lrotr(x, static_cast(y)) : x; -} - -//! \brief Performs a left rotate -//! \param x the 32-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile -//! . The value x to be rotated is 32-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotlVariable will assert in Debug builds if is outside the allowed range. -template<> inline word32 rotlVariable(word32 x, unsigned int y) -{ - assert(y < 8*sizeof(x)); - return _lrotl(x, static_cast(y)); -} - -//! \brief Performs a right rotate -//! \param x the 32-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile -//! . The value x to be rotated is 32-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrVariable will assert in Debug builds if is outside the allowed range. -template<> inline word32 rotrVariable(word32 x, unsigned int y) -{ - assert(y < 8*sizeof(x)); - return _lrotr(x, static_cast(y)); -} - -//! \brief Performs a left rotate -//! \param x the 32-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile -//! . The value x to be rotated is 32-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -template<> inline word32 rotlMod(word32 x, unsigned int y) -{ - y %= 8*sizeof(x); - return _lrotl(x, static_cast(y)); -} - -//! \brief Performs a right rotate -//! \param x the 32-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile -//! . The value x to be rotated is 32-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -template<> inline word32 rotrMod(word32 x, unsigned int y) -{ - y %= 8*sizeof(x); - return _lrotr(x, static_cast(y)); -} - -#endif // #ifdef _MSC_VER - -#if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER) -// Intel C++ Compiler 10.0 calls a function instead of using the rotate instruction when using these instructions - -//! \brief Performs a left rotate -//! \param x the 64-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile -//! . The value x to be rotated is 64-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrFixed will assert in Debug builds if is outside the allowed range. -template<> inline word64 rotlFixed(word64 x, unsigned int y) -{ - // Uses Microsoft call, bound to C/C++ language rules. - assert(y < 8*sizeof(x)); - return y ? _rotl64(x, static_cast(y)) : x; -} - -//! \brief Performs a right rotate -//! \param x the 64-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile -//! . The value x to be rotated is 64-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrFixed will assert in Debug builds if is outside the allowed range. -template<> inline word64 rotrFixed(word64 x, unsigned int y) -{ - // Uses Microsoft call, bound to C/C++ language rules. - assert(y < 8*sizeof(x)); - return y ? _rotr64(x, static_cast(y)) : x; -} - -//! \brief Performs a left rotate -//! \param x the 64-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile -//! . The value x to be rotated is 64-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotlVariable will assert in Debug builds if is outside the allowed range. -template<> inline word64 rotlVariable(word64 x, unsigned int y) -{ - assert(y < 8*sizeof(x)); - return _rotl64(x, static_cast(y)); -} - -//! \brief Performs a right rotate -//! \param x the 64-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile -//! . The value x to be rotated is 64-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -//! \note rotrVariable will assert in Debug builds if is outside the allowed range. -template<> inline word64 rotrVariable(word64 x, unsigned int y) -{ - assert(y < 8*sizeof(x)); - return y ? _rotr64(x, static_cast(y)) : x; -} - -//! \brief Performs a left rotate -//! \param x the 64-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotl provided by \headerfile -//! . The value x to be rotated is 64-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -template<> inline word64 rotlMod(word64 x, unsigned int y) -{ - assert(y < 8*sizeof(x)); - return y ? _rotl64(x, static_cast(y)) : x; -} - -//! \brief Performs a right rotate -//! \param x the 64-bit value to rotate -//! \param y the number of bit positions to rotate the value -//! \details This is a Microsoft specific implementation using _lrotr provided by \headerfile -//! . The value x to be rotated is 64-bits. y must be in the range -//! [0, sizeof(T)*8 - 1] to avoid undefined behavior. -template<> inline word64 rotrMod(word64 x, unsigned int y) -{ - assert(y < 8*sizeof(x)); - return y ? _rotr64(x, static_cast(y)) : x; -} - -#endif // #if _MSC_VER >= 1310 - -#if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) -// Intel C++ Compiler 10.0 gives undefined externals with these - -template<> inline word16 rotlFixed(word16 x, unsigned int y) -{ - // Intrinsic, not bound to C/C++ language rules. - return _rotl16(x, static_cast(y)); -} - -template<> inline word16 rotrFixed(word16 x, unsigned int y) -{ - // Intrinsic, not bound to C/C++ language rules. - return _rotr16(x, static_cast(y)); -} - -template<> inline word16 rotlVariable(word16 x, unsigned int y) -{ - return _rotl16(x, static_cast(y)); -} - -template<> inline word16 rotrVariable(word16 x, unsigned int y) -{ - return _rotr16(x, static_cast(y)); -} - -template<> inline word16 rotlMod(word16 x, unsigned int y) -{ - return _rotl16(x, static_cast(y)); -} - -template<> inline word16 rotrMod(word16 x, unsigned int y) -{ - return _rotr16(x, static_cast(y)); -} - -template<> inline byte rotlFixed(byte x, unsigned int y) -{ - // Intrinsic, not bound to C/C++ language rules. - return _rotl8(x, static_cast(y)); -} - -template<> inline byte rotrFixed(byte x, unsigned int y) -{ - // Intrinsic, not bound to C/C++ language rules. - return _rotr8(x, static_cast(y)); -} - -template<> inline byte rotlVariable(byte x, unsigned int y) -{ - return _rotl8(x, static_cast(y)); -} - -template<> inline byte rotrVariable(byte x, unsigned int y) -{ - return _rotr8(x, static_cast(y)); -} - -template<> inline byte rotlMod(byte x, unsigned int y) -{ - return _rotl8(x, static_cast(y)); -} - -template<> inline byte rotrMod(byte x, unsigned int y) -{ - return _rotr8(x, static_cast(y)); -} - -#endif // #if _MSC_VER >= 1400 - -#if (defined(__MWERKS__) && TARGET_CPU_PPC) - -template<> inline word32 rotlFixed(word32 x, unsigned int y) -{ - assert(y < 32); - return y ? __rlwinm(x,y,0,31) : x; -} - -template<> inline word32 rotrFixed(word32 x, unsigned int y) -{ - assert(y < 32); - return y ? __rlwinm(x,32-y,0,31) : x; -} - -template<> inline word32 rotlVariable(word32 x, unsigned int y) -{ - assert(y < 32); - return (__rlwnm(x,y,0,31)); -} - -template<> inline word32 rotrVariable(word32 x, unsigned int y) -{ - assert(y < 32); - return (__rlwnm(x,32-y,0,31)); -} - -template<> inline word32 rotlMod(word32 x, unsigned int y) -{ - return (__rlwnm(x,y,0,31)); -} - -template<> inline word32 rotrMod(word32 x, unsigned int y) -{ - return (__rlwnm(x,32-y,0,31)); -} - -#endif // #if (defined(__MWERKS__) && TARGET_CPU_PPC) - -// ************** endian reversal *************** - -//! \brief Gets a byte from a value -//! \param order the ByteOrder of the value -//! \param value the value to retrieve the byte -//! \param index the location of the byte to retrieve -template -inline unsigned int GetByte(ByteOrder order, T value, unsigned int index) -{ - if (order == LITTLE_ENDIAN_ORDER) - return GETBYTE(value, index); - else - return GETBYTE(value, sizeof(T)-index-1); -} - -//! \brief Reverses bytes in a 8-bit value -//! \param value the 8-bit value to reverse -//! \note ByteReverse returns the value passed to it since there is nothing to reverse -inline byte ByteReverse(byte value) -{ - return value; -} - -//! \brief Reverses bytes in a 16-bit value -//! \brief Performs an endian reversal -//! \param value the 16-bit value to reverse -//! \details ByteReverse calls bswap if available. Otherwise the function performs a 8-bit rotate on the word16 -inline word16 ByteReverse(word16 value) -{ -#ifdef CRYPTOPP_BYTESWAP_AVAILABLE - return bswap_16(value); -#elif defined(_MSC_VER) && _MSC_VER >= 1300 - return _byteswap_ushort(value); -#else - return rotlFixed(value, 8U); -#endif -} - -//! \brief Reverses bytes in a 32-bit value -//! \brief Performs an endian reversal -//! \param value the 32-bit value to reverse -//! \details ByteReverse calls bswap if available. Otherwise the function uses a combination of rotates on the word32 -inline word32 ByteReverse(word32 value) -{ -#if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE) - __asm__ ("bswap %0" : "=r" (value) : "0" (value)); - return value; -#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE) - return bswap_32(value); -#elif defined(__MWERKS__) && TARGET_CPU_PPC - return (word32)__lwbrx(&value,0); -#elif _MSC_VER >= 1400 || (_MSC_VER >= 1300 && !defined(_DLL)) - return _byteswap_ulong(value); -#elif CRYPTOPP_FAST_ROTATE(32) - // 5 instructions with rotate instruction, 9 without - return (rotrFixed(value, 8U) & 0xff00ff00) | (rotlFixed(value, 8U) & 0x00ff00ff); -#else - // 6 instructions with rotate instruction, 8 without - value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); - return rotlFixed(value, 16U); -#endif -} - -//! \brief Reverses bytes in a 64-bit value -//! \brief Performs an endian reversal -//! \param value the 64-bit value to reverse -//! \details ByteReverse calls bswap if available. Otherwise the function uses a combination of rotates on the word64 -inline word64 ByteReverse(word64 value) -{ -#if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE) && defined(__x86_64__) - __asm__ ("bswap %0" : "=r" (value) : "0" (value)); - return value; -#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE) - return bswap_64(value); -#elif defined(_MSC_VER) && _MSC_VER >= 1300 - return _byteswap_uint64(value); -#elif CRYPTOPP_BOOL_SLOW_WORD64 - return (word64(ByteReverse(word32(value))) << 32) | ByteReverse(word32(value>>32)); -#else - value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | ((value & W64LIT(0x00FF00FF00FF00FF)) << 8); - value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | ((value & W64LIT(0x0000FFFF0000FFFF)) << 16); - return rotlFixed(value, 32U); -#endif -} - -//! \brief Reverses bits in a 8-bit value -//! \param value the 8-bit value to reverse -//! \details BitReverse performs a combination of shifts on the byte -inline byte BitReverse(byte value) -{ - value = ((value & 0xAA) >> 1) | ((value & 0x55) << 1); - value = ((value & 0xCC) >> 2) | ((value & 0x33) << 2); - return rotlFixed(value, 4U); -} - -//! \brief Reverses bits in a 16-bit value -//! \param value the 16-bit value to reverse -//! \details BitReverse performs a combination of shifts on the word16 -inline word16 BitReverse(word16 value) -{ - value = ((value & 0xAAAA) >> 1) | ((value & 0x5555) << 1); - value = ((value & 0xCCCC) >> 2) | ((value & 0x3333) << 2); - value = ((value & 0xF0F0) >> 4) | ((value & 0x0F0F) << 4); - return ByteReverse(value); -} - -//! \brief Reverses bits in a 32-bit value -//! \param value the 32-bit value to reverse -//! \details BitReverse performs a combination of shifts on the word32 -inline word32 BitReverse(word32 value) -{ - value = ((value & 0xAAAAAAAA) >> 1) | ((value & 0x55555555) << 1); - value = ((value & 0xCCCCCCCC) >> 2) | ((value & 0x33333333) << 2); - value = ((value & 0xF0F0F0F0) >> 4) | ((value & 0x0F0F0F0F) << 4); - return ByteReverse(value); -} - -//! \brief Reverses bits in a 64-bit value -//! \param value the 64-bit value to reverse -//! \details BitReverse performs a combination of shifts on the word64 -inline word64 BitReverse(word64 value) -{ -#if CRYPTOPP_BOOL_SLOW_WORD64 - return (word64(BitReverse(word32(value))) << 32) | BitReverse(word32(value>>32)); -#else - value = ((value & W64LIT(0xAAAAAAAAAAAAAAAA)) >> 1) | ((value & W64LIT(0x5555555555555555)) << 1); - value = ((value & W64LIT(0xCCCCCCCCCCCCCCCC)) >> 2) | ((value & W64LIT(0x3333333333333333)) << 2); - value = ((value & W64LIT(0xF0F0F0F0F0F0F0F0)) >> 4) | ((value & W64LIT(0x0F0F0F0F0F0F0F0F)) << 4); - return ByteReverse(value); -#endif -} - -//! \brief Reverses bits in a value -//! \param value the value to reverse -//! \details The template overload of BitReverse operates on signed and unsigned values. -//! Internally the size of T is checked, and then value is cast to a byte, -//! word16, word32 or word64. After the cast, the appropriate BitReverse -//! overload is called. -template -inline T BitReverse(T value) -{ - if (sizeof(T) == 1) - return (T)BitReverse((byte)value); - else if (sizeof(T) == 2) - return (T)BitReverse((word16)value); - else if (sizeof(T) == 4) - return (T)BitReverse((word32)value); - else - { - assert(sizeof(T) == 8); - return (T)BitReverse((word64)value); - } -} - -//! \brief Reverses bytes in a value depending upon endianess -//! \tparam T the class or type -//! \param order the ByteOrder the data is represented -//! \param value the value to conditionally reverse -//! \details Internally, the ConditionalByteReverse calls NativeByteOrderIs. -//! If order matches native byte order, then the original value is returned. -//! If not, then ByteReverse is called on the value before returning to the caller. -template -inline T ConditionalByteReverse(ByteOrder order, T value) -{ - return NativeByteOrderIs(order) ? value : ByteReverse(value); -} - -//! \brief Reverses bytes in an element among an array of elements -//! \tparam T the class or type -//! \param out the output array of elements -//! \param in the input array of elements -//! \param byteCount the byte count of the arrays -//! \details Internally, ByteReverse visits each element in the in array -//! calls ByteReverse on it, and writes the result to out. -//! \details ByteReverse does not process tail byes, or bytes that are -//! \a not part of a full element. If T is int (and int is 4 bytes), then -//! byteCount = 10 means only the first 8 bytes are reversed. -//! \note ByteReverse uses the number of bytes in the arrays, and not the count -//! of elements in the arrays. -template -void ByteReverse(T *out, const T *in, size_t byteCount) -{ - assert(byteCount % sizeof(T) == 0); - size_t count = byteCount/sizeof(T); - for (size_t i=0; ibyteCount = 10 means only the first 8 bytes are reversed. -//! \note ByteReverse uses the number of bytes in the arrays, and not the count -//! of elements in the arrays. -template -inline void ConditionalByteReverse(ByteOrder order, T *out, const T *in, size_t byteCount) -{ - if (!NativeByteOrderIs(order)) - ByteReverse(out, in, byteCount); - else if (in != out) - memcpy_s(out, byteCount, in, byteCount); -} - -template -inline void GetUserKey(ByteOrder order, T *out, size_t outlen, const byte *in, size_t inlen) -{ - const size_t U = sizeof(T); - assert(inlen <= outlen*U); - memcpy_s(out, outlen*U, in, inlen); - memset_z((byte *)out+inlen, 0, outlen*U-inlen); - ConditionalByteReverse(order, out, out, RoundUpToMultipleOf(inlen, U)); -} - -#ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -inline byte UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const byte *) -{ - CRYPTOPP_UNUSED(order); - return block[0]; -} - -inline word16 UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const word16 *) -{ - return (order == BIG_ENDIAN_ORDER) - ? block[1] | (block[0] << 8) - : block[0] | (block[1] << 8); -} - -inline word32 UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const word32 *) -{ - return (order == BIG_ENDIAN_ORDER) - ? word32(block[3]) | (word32(block[2]) << 8) | (word32(block[1]) << 16) | (word32(block[0]) << 24) - : word32(block[0]) | (word32(block[1]) << 8) | (word32(block[2]) << 16) | (word32(block[3]) << 24); -} - -inline word64 UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, const word64 *) -{ - return (order == BIG_ENDIAN_ORDER) - ? - (word64(block[7]) | - (word64(block[6]) << 8) | - (word64(block[5]) << 16) | - (word64(block[4]) << 24) | - (word64(block[3]) << 32) | - (word64(block[2]) << 40) | - (word64(block[1]) << 48) | - (word64(block[0]) << 56)) - : - (word64(block[0]) | - (word64(block[1]) << 8) | - (word64(block[2]) << 16) | - (word64(block[3]) << 24) | - (word64(block[4]) << 32) | - (word64(block[5]) << 40) | - (word64(block[6]) << 48) | - (word64(block[7]) << 56)); -} - -inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, byte value, const byte *xorBlock) -{ - CRYPTOPP_UNUSED(order); - block[0] = xorBlock ? (value ^ xorBlock[0]) : value; -} - -inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, word16 value, const byte *xorBlock) -{ - if (order == BIG_ENDIAN_ORDER) - { - if (xorBlock) - { - block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - } - else - { - block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - } - } - else - { - if (xorBlock) - { - block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - } - else - { - block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - } - } -} - -inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, word32 value, const byte *xorBlock) -{ - if (order == BIG_ENDIAN_ORDER) - { - if (xorBlock) - { - block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - } - else - { - block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - } - } - else - { - if (xorBlock) - { - block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - } - else - { - block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - } - } -} - -inline void UnalignedbyteNonTemplate(ByteOrder order, byte *block, word64 value, const byte *xorBlock) -{ - if (order == BIG_ENDIAN_ORDER) - { - if (xorBlock) - { - block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); - block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); - block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); - block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); - block[4] = xorBlock[4] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - block[5] = xorBlock[5] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[6] = xorBlock[6] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[7] = xorBlock[7] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - } - else - { - block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); - block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); - block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); - block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); - block[4] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - block[5] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[6] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[7] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - } - } - else - { - if (xorBlock) - { - block[0] = xorBlock[0] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - block[1] = xorBlock[1] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[2] = xorBlock[2] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[3] = xorBlock[3] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - block[4] = xorBlock[4] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); - block[5] = xorBlock[5] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); - block[6] = xorBlock[6] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); - block[7] = xorBlock[7] ^ CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); - } - else - { - block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0); - block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1); - block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2); - block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3); - block[4] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 4); - block[5] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 5); - block[6] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 6); - block[7] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 7); - } - } -} -#endif // #ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS - -template -inline T GetWord(bool assumeAligned, ByteOrder order, const byte *block) -{ -//#ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -// if (!assumeAligned) -// return UnalignedGetWordNonTemplate(order, block, (T*)NULL); -// assert(IsAligned(block)); -//#endif -// return ConditionalByteReverse(order, *reinterpret_cast(block)); - CRYPTOPP_UNUSED(assumeAligned); -#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS - return ConditionalByteReverse(order, *reinterpret_cast(block)); -#else - T temp; - memcpy(&temp, block, sizeof(T)); - return ConditionalByteReverse(order, temp); -#endif -} - -template -inline void GetWord(bool assumeAligned, ByteOrder order, T &result, const byte *block) -{ - result = GetWord(assumeAligned, order, block); -} - -template -inline void PutWord(bool assumeAligned, ByteOrder order, byte *block, T value, const byte *xorBlock = NULL) -{ -//#ifndef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -// if (!assumeAligned) -// return UnalignedbyteNonTemplate(order, block, value, xorBlock); -// assert(IsAligned(block)); -// assert(IsAligned(xorBlock)); -//#endif -// *reinterpret_cast(block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast(xorBlock) : 0); - CRYPTOPP_UNUSED(assumeAligned); -#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS - *reinterpret_cast(block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast(xorBlock) : 0); -#else - T t1, t2 = 0; - t1 = ConditionalByteReverse(order, value); - if (xorBlock) memcpy(&t2, xorBlock, sizeof(T)); - memmove(block, &(t1 ^= t2), sizeof(T)); -#endif -} - -template -class GetBlock -{ -public: - GetBlock(const void *block) - : m_block((const byte *)block) {} - - template - inline GetBlock & operator()(U &x) - { - CRYPTOPP_COMPILE_ASSERT(sizeof(U) >= sizeof(T)); - x = GetWord(A, B::ToEnum(), m_block); - m_block += sizeof(T); - return *this; - } - -private: - const byte *m_block; -}; - -template -class PutBlock -{ -public: - PutBlock(const void *xorBlock, void *block) - : m_xorBlock((const byte *)xorBlock), m_block((byte *)block) {} - - template - inline PutBlock & operator()(U x) - { - PutWord(A, B::ToEnum(), m_block, (T)x, m_xorBlock); - m_block += sizeof(T); - if (m_xorBlock) - m_xorBlock += sizeof(T); - return *this; - } - -private: - const byte *m_xorBlock; - byte *m_block; -}; - -template -struct BlockGetAndPut -{ - // function needed because of C++ grammatical ambiguity between expression-statements and declarations - static inline GetBlock Get(const void *block) {return GetBlock(block);} - typedef PutBlock Put; -}; - -template -std::string WordToString(T value, ByteOrder order = BIG_ENDIAN_ORDER) -{ - if (!NativeByteOrderIs(order)) - value = ByteReverse(value); - - return std::string((char *)&value, sizeof(value)); -} - -template -T StringToWord(const std::string &str, ByteOrder order = BIG_ENDIAN_ORDER) -{ - T value = 0; - memcpy_s(&value, sizeof(value), str.data(), UnsignedMin(str.size(), sizeof(value))); - return NativeByteOrderIs(order) ? value : ByteReverse(value); -} - -// ************** help remove warning on g++ *************** - -template struct SafeShifter; - -template<> struct SafeShifter -{ - template - static inline T RightShift(T value, unsigned int bits) - { - CRYPTOPP_UNUSED(value); CRYPTOPP_UNUSED(bits); - return 0; - } - - template - static inline T LeftShift(T value, unsigned int bits) - { - CRYPTOPP_UNUSED(value); CRYPTOPP_UNUSED(bits); - return 0; - } -}; - -template<> struct SafeShifter -{ - template - static inline T RightShift(T value, unsigned int bits) - { - return value >> bits; - } - - template - static inline T LeftShift(T value, unsigned int bits) - { - return value << bits; - } -}; - -template -inline T SafeRightShift(T value) -{ - return SafeShifter<(bits>=(8*sizeof(T)))>::RightShift(value, bits); -} - -template -inline T SafeLeftShift(T value) -{ - return SafeShifter<(bits>=(8*sizeof(T)))>::LeftShift(value, bits); -} - -// ************** use one buffer for multiple data members *************** - -#define CRYPTOPP_BLOCK_1(n, t, s) t* m_##n() {return (t *)(m_aggregate+0);} size_t SS1() {return sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_2(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS1());} size_t SS2() {return SS1()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_3(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS2());} size_t SS3() {return SS2()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_4(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS3());} size_t SS4() {return SS3()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_5(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS4());} size_t SS5() {return SS4()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_6(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS5());} size_t SS6() {return SS5()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_7(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS6());} size_t SS7() {return SS6()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCK_8(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS7());} size_t SS8() {return SS7()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);} -#define CRYPTOPP_BLOCKS_END(i) size_t SST() {return SS##i();} void AllocateBlocks() {m_aggregate.New(SST());} AlignedSecByteBlock m_aggregate; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/modarith.h b/external/crypto++-5.6.3/modarith.h deleted file mode 100644 index 01ee37c97..000000000 --- a/external/crypto++-5.6.3/modarith.h +++ /dev/null @@ -1,177 +0,0 @@ -// modarith.h - written and placed in the public domain by Wei Dai - -//! \file modarith.h -//! \brief Class file for performing modular arithmetic. - -#ifndef CRYPTOPP_MODARITH_H -#define CRYPTOPP_MODARITH_H - -// implementations are in integer.cpp - -#include "cryptlib.h" -#include "integer.h" -#include "algebra.h" -#include "secblock.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup; -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing; -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain; - -//! \class ModularArithmetic -//! \brief Ring of congruence classes modulo n -//! \note this implementation represents each congruence class as the smallest -//! non-negative integer in that class -class CRYPTOPP_DLL ModularArithmetic : public AbstractRing -{ -public: - - typedef int RandomizationParameter; - typedef Integer Element; - - ModularArithmetic(const Integer &modulus = Integer::One()) - : AbstractRing(), m_modulus(modulus), m_result((word)0, modulus.reg.size()) {} - ModularArithmetic(const ModularArithmetic &ma) - : AbstractRing(), m_modulus(ma.m_modulus), m_result((word)0, ma.m_modulus.reg.size()) {} - - ModularArithmetic(BufferedTransformation &bt); // construct from BER encoded parameters - - virtual ModularArithmetic * Clone() const {return new ModularArithmetic(*this);} - - void DEREncode(BufferedTransformation &bt) const; - - void DEREncodeElement(BufferedTransformation &out, const Element &a) const; - void BERDecodeElement(BufferedTransformation &in, Element &a) const; - - const Integer& GetModulus() const {return m_modulus;} - void SetModulus(const Integer &newModulus) - {m_modulus = newModulus; m_result.reg.resize(m_modulus.reg.size());} - - virtual bool IsMontgomeryRepresentation() const {return false;} - - virtual Integer ConvertIn(const Integer &a) const - {return a%m_modulus;} - - virtual Integer ConvertOut(const Integer &a) const - {return a;} - - const Integer& Half(const Integer &a) const; - - bool Equal(const Integer &a, const Integer &b) const - {return a==b;} - - const Integer& Identity() const - {return Integer::Zero();} - - const Integer& Add(const Integer &a, const Integer &b) const; - - Integer& Accumulate(Integer &a, const Integer &b) const; - - const Integer& Inverse(const Integer &a) const; - - const Integer& Subtract(const Integer &a, const Integer &b) const; - - Integer& Reduce(Integer &a, const Integer &b) const; - - const Integer& Double(const Integer &a) const - {return Add(a, a);} - - const Integer& MultiplicativeIdentity() const - {return Integer::One();} - - const Integer& Multiply(const Integer &a, const Integer &b) const - {return m_result1 = a*b%m_modulus;} - - const Integer& Square(const Integer &a) const - {return m_result1 = a.Squared()%m_modulus;} - - bool IsUnit(const Integer &a) const - {return Integer::Gcd(a, m_modulus).IsUnit();} - - const Integer& MultiplicativeInverse(const Integer &a) const - {return m_result1 = a.InverseMod(m_modulus);} - - const Integer& Divide(const Integer &a, const Integer &b) const - {return Multiply(a, MultiplicativeInverse(b));} - - Integer CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const; - - void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const; - - unsigned int MaxElementBitLength() const - {return (m_modulus-1).BitCount();} - - unsigned int MaxElementByteLength() const - {return (m_modulus-1).ByteCount();} - - Element RandomElement( RandomNumberGenerator &rng , const RandomizationParameter &ignore_for_now = 0 ) const - // left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct - { - CRYPTOPP_UNUSED(ignore_for_now); - return Element(rng, Integer::Zero(), m_modulus - Integer::One()) ; - } - - bool operator==(const ModularArithmetic &rhs) const - {return m_modulus == rhs.m_modulus;} - - static const RandomizationParameter DefaultRandomizationParameter ; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~ModularArithmetic() {} -#endif - -protected: - Integer m_modulus; - mutable Integer m_result, m_result1; - -}; - -// const ModularArithmetic::RandomizationParameter ModularArithmetic::DefaultRandomizationParameter = 0 ; - -//! \class MontgomeryRepresentation -//! \brief Performs modular arithmetic in Montgomery representation for increased speed -//! \details The Montgomery representation represents each congruence class [a] as -//! a*r%n, where r is a convenient power of 2. -class CRYPTOPP_DLL MontgomeryRepresentation : public ModularArithmetic -{ -public: - MontgomeryRepresentation(const Integer &modulus); // modulus must be odd - - virtual ModularArithmetic * Clone() const {return new MontgomeryRepresentation(*this);} - - bool IsMontgomeryRepresentation() const {return true;} - - Integer ConvertIn(const Integer &a) const - {return (a<<(WORD_BITS*m_modulus.reg.size()))%m_modulus;} - - Integer ConvertOut(const Integer &a) const; - - const Integer& MultiplicativeIdentity() const - {return m_result1 = Integer::Power2(WORD_BITS*m_modulus.reg.size())%m_modulus;} - - const Integer& Multiply(const Integer &a, const Integer &b) const; - - const Integer& Square(const Integer &a) const; - - const Integer& MultiplicativeInverse(const Integer &a) const; - - Integer CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const - {return AbstractRing::CascadeExponentiate(x, e1, y, e2);} - - void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const - {AbstractRing::SimultaneousExponentiate(results, base, exponents, exponentsCount);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~MontgomeryRepresentation() {} -#endif - -private: - Integer m_u; - mutable IntegerSecBlock m_workspace; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/modes.cpp b/external/crypto++-5.6.3/modes.cpp deleted file mode 100644 index 60fef0e6e..000000000 --- a/external/crypto++-5.6.3/modes.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// modes.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "modes.h" -#include "misc.h" - -#ifndef NDEBUG -#include "des.h" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void Modes_TestInstantiations() -{ - CFB_Mode::Encryption m0; - CFB_Mode::Decryption m1; - OFB_Mode::Encryption m2; - CTR_Mode::Encryption m3; - ECB_Mode::Encryption m4; - CBC_Mode::Encryption m5; -} -#endif - -// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -void CipherModeBase::ResizeBuffers() -{ - m_register.New(m_cipher->BlockSize()); -} -#endif - -void CFB_ModePolicy::Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount) -{ - assert(input); - assert(output); - assert(m_cipher->IsForwardTransformation()); // CFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt - assert(m_feedbackSize == BlockSize()); - - const unsigned int s = BlockSize(); - if (dir == ENCRYPTION) - { - m_cipher->ProcessAndXorBlock(m_register, input, output); - if (iterationCount > 1) - m_cipher->AdvancedProcessBlocks(output, input+s, output+s, (iterationCount-1)*s, 0); - memcpy(m_register, output+(iterationCount-1)*s, s); - } - else - { - memcpy(m_temp, input+(iterationCount-1)*s, s); // make copy first in case of in-place decryption - if (iterationCount > 1) - m_cipher->AdvancedProcessBlocks(input, input+s, output+s, (iterationCount-1)*s, BlockTransformation::BT_ReverseDirection); - m_cipher->ProcessAndXorBlock(m_register, input, output); - memcpy(m_register, m_temp, s); - } -} - -void CFB_ModePolicy::TransformRegister() -{ - assert(m_cipher->IsForwardTransformation()); // CFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt - m_cipher->ProcessBlock(m_register, m_temp); - unsigned int updateSize = BlockSize()-m_feedbackSize; - memmove_s(m_register, m_register.size(), m_register+m_feedbackSize, updateSize); - memcpy_s(m_register+updateSize, m_register.size()-updateSize, m_temp, m_feedbackSize); -} - -void CFB_ModePolicy::CipherResynchronize(const byte *iv, size_t length) -{ - assert(length == BlockSize()); - CopyOrZero(m_register, iv, length); - TransformRegister(); -} - -void CFB_ModePolicy::SetFeedbackSize(unsigned int feedbackSize) -{ - if (feedbackSize > BlockSize()) - throw InvalidArgument("CFB_Mode: invalid feedback size"); - m_feedbackSize = feedbackSize ? feedbackSize : BlockSize(); -} - -void CFB_ModePolicy::ResizeBuffers() -{ - CipherModeBase::ResizeBuffers(); - m_temp.New(BlockSize()); -} - -void OFB_ModePolicy::WriteKeystream(byte *keystreamBuffer, size_t iterationCount) -{ - assert(m_cipher->IsForwardTransformation()); // OFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt - unsigned int s = BlockSize(); - m_cipher->ProcessBlock(m_register, keystreamBuffer); - if (iterationCount > 1) - m_cipher->AdvancedProcessBlocks(keystreamBuffer, NULL, keystreamBuffer+s, s*(iterationCount-1), 0); - memcpy(m_register, keystreamBuffer+s*(iterationCount-1), s); -} - -void OFB_ModePolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); - assert(length == BlockSize()); - - CopyOrZero(m_register, iv, length); -} - -void CTR_ModePolicy::SeekToIteration(lword iterationCount) -{ - int carry=0; - for (int i=BlockSize()-1; i>=0; i--) - { - unsigned int sum = m_register[i] + byte(iterationCount) + carry; - m_counterArray[i] = (byte) sum; - carry = sum >> 8; - iterationCount >>= 8; - } -} - -void CTR_ModePolicy::IncrementCounterBy256() -{ - IncrementCounterByOne(m_counterArray, BlockSize()-1); -} - -void CTR_ModePolicy::OperateKeystream(KeystreamOperation /*operation*/, byte *output, const byte *input, size_t iterationCount) -{ - assert(m_cipher->IsForwardTransformation()); // CTR mode needs the "encrypt" direction of the underlying block cipher, even to decrypt - unsigned int s = BlockSize(); - unsigned int inputIncrement = input ? s : 0; - - while (iterationCount) - { - byte lsb = m_counterArray[s-1]; - size_t blocks = UnsignedMin(iterationCount, 256U-lsb); - m_cipher->AdvancedProcessBlocks(m_counterArray, input, output, blocks*s, BlockTransformation::BT_InBlockIsCounter|BlockTransformation::BT_AllowParallel); - if ((m_counterArray[s-1] = lsb + (byte)blocks) == 0) - IncrementCounterBy256(); - - output += blocks*s; - input += blocks*inputIncrement; - iterationCount -= blocks; - } -} - -void CTR_ModePolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); - assert(length == BlockSize()); - - CopyOrZero(m_register, iv, length); - m_counterArray = m_register; -} - -void BlockOrientedCipherModeBase::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) -{ - m_cipher->SetKey(key, length, params); - ResizeBuffers(); - if (IsResynchronizable()) - { - size_t ivLength; - const byte *iv = GetIVAndThrowIfInvalid(params, ivLength); - Resynchronize(iv, (int)ivLength); - } -} - -// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -void BlockOrientedCipherModeBase::ResizeBuffers() -{ - CipherModeBase::ResizeBuffers(); - m_buffer.New(BlockSize()); -} -#endif - -void ECB_OneWay::ProcessData(byte *outString, const byte *inString, size_t length) -{ - assert(length%BlockSize()==0); - m_cipher->AdvancedProcessBlocks(inString, NULL, outString, length, BlockTransformation::BT_AllowParallel); -} - -void CBC_Encryption::ProcessData(byte *outString, const byte *inString, size_t length) -{ - if (!length) - return; - assert(length%BlockSize()==0); - - unsigned int blockSize = BlockSize(); - m_cipher->AdvancedProcessBlocks(inString, m_register, outString, blockSize, BlockTransformation::BT_XorInput); - if (length > blockSize) - m_cipher->AdvancedProcessBlocks(inString+blockSize, outString, outString+blockSize, length-blockSize, BlockTransformation::BT_XorInput); - memcpy(m_register, outString + length - blockSize, blockSize); -} - -void CBC_CTS_Encryption::ProcessLastBlock(byte *outString, const byte *inString, size_t length) -{ - if (length <= BlockSize()) - { - if (!m_stolenIV) - throw InvalidArgument("CBC_Encryption: message is too short for ciphertext stealing"); - - // steal from IV - memcpy(outString, m_register, length); - outString = m_stolenIV; - } - else - { - // steal from next to last block - xorbuf(m_register, inString, BlockSize()); - m_cipher->ProcessBlock(m_register); - inString += BlockSize(); - length -= BlockSize(); - memcpy(outString+BlockSize(), m_register, length); - } - - // output last full ciphertext block - xorbuf(m_register, inString, length); - m_cipher->ProcessBlock(m_register); - memcpy(outString, m_register, BlockSize()); -} - -// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 -void CBC_Decryption::ResizeBuffers() -{ - BlockOrientedCipherModeBase::ResizeBuffers(); - m_temp.New(BlockSize()); -} -#endif - -void CBC_Decryption::ProcessData(byte *outString, const byte *inString, size_t length) -{ - if (!length) - return; - assert(length%BlockSize()==0); - - unsigned int blockSize = BlockSize(); - memcpy(m_temp, inString+length-blockSize, blockSize); // save copy now in case of in-place decryption - if (length > blockSize) - m_cipher->AdvancedProcessBlocks(inString+blockSize, inString, outString+blockSize, length-blockSize, BlockTransformation::BT_ReverseDirection|BlockTransformation::BT_AllowParallel); - m_cipher->ProcessAndXorBlock(inString, m_register, outString); - m_register.swap(m_temp); -} - -void CBC_CTS_Decryption::ProcessLastBlock(byte *outString, const byte *inString, size_t length) -{ - const byte *pn, *pn1; - bool stealIV = length <= BlockSize(); - - if (stealIV) - { - pn = inString; - pn1 = m_register; - } - else - { - pn = inString + BlockSize(); - pn1 = inString; - length -= BlockSize(); - } - - // decrypt last partial plaintext block - memcpy(m_temp, pn1, BlockSize()); - m_cipher->ProcessBlock(m_temp); - xorbuf(m_temp, pn, length); - - if (stealIV) - memcpy(outString, m_temp, length); - else - { - memcpy(outString+BlockSize(), m_temp, length); - // decrypt next to last plaintext block - memcpy(m_temp, pn, length); - m_cipher->ProcessBlock(m_temp); - xorbuf(outString, m_temp, m_register, BlockSize()); - } -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/modes.h b/external/crypto++-5.6.3/modes.h deleted file mode 100644 index 24c0e02e3..000000000 --- a/external/crypto++-5.6.3/modes.h +++ /dev/null @@ -1,459 +0,0 @@ -// modes.h - written and placed in the public domain by Wei Dai - -//! \file modes.h -//! \brief Class file for modes of operation. - -#ifndef CRYPTOPP_MODES_H -#define CRYPTOPP_MODES_H - -#include "cryptlib.h" -#include "secblock.h" -#include "misc.h" -#include "strciphr.h" -#include "argnames.h" -#include "algparam.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class CipherModeDocumentation -//! \brief Classes for operating block cipher modes of operation -//! \details Each class derived from this one defines two types, Encryption and Decryption, -//! both of which implement the SymmetricCipher interface. -//! For each mode there are two classes, one of which is a template class, -//! and the other one has a name that ends in "_ExternalCipher". -//! The "external cipher" mode objects hold a reference to the underlying block cipher, -//! instead of holding an instance of it. The reference must be passed in to the constructor. -//! For the "cipher holder" classes, the CIPHER template parameter should be a class -//! derived from BlockCipherDocumentation, for example DES or AES. -//! \details See NIST SP 800-38A for definitions of these modes. See -//! AuthenticatedSymmetricCipherDocumentation for authenticated encryption modes. -struct CipherModeDocumentation : public SymmetricCipherDocumentation -{ -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CipherModeBase : public SymmetricCipher -{ -public: - size_t MinKeyLength() const {return m_cipher->MinKeyLength();} - size_t MaxKeyLength() const {return m_cipher->MaxKeyLength();} - size_t DefaultKeyLength() const {return m_cipher->DefaultKeyLength();} - size_t GetValidKeyLength(size_t n) const {return m_cipher->GetValidKeyLength(n);} - bool IsValidKeyLength(size_t n) const {return m_cipher->IsValidKeyLength(n);} - - unsigned int OptimalDataAlignment() const {return m_cipher->OptimalDataAlignment();} - - unsigned int IVSize() const {return BlockSize();} - virtual IV_Requirement IVRequirement() const =0; - - void SetCipher(BlockCipher &cipher) - { - this->ThrowIfResynchronizable(); - this->m_cipher = &cipher; - this->ResizeBuffers(); - } - - void SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize = 0) - { - this->ThrowIfInvalidIV(iv); - this->m_cipher = &cipher; - this->ResizeBuffers(); - this->SetFeedbackSize(feedbackSize); - if (this->IsResynchronizable()) - this->Resynchronize(iv); - } - -protected: - CipherModeBase() : m_cipher(NULL) {} - inline unsigned int BlockSize() const {assert(m_register.size() > 0); return (unsigned int)m_register.size();} - virtual void SetFeedbackSize(unsigned int feedbackSize) - { - if (!(feedbackSize == 0 || feedbackSize == BlockSize())) - throw InvalidArgument("CipherModeBase: feedback size cannot be specified for this cipher mode"); - } - -// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual void ResizeBuffers(); -#else - virtual void ResizeBuffers() - { - m_register.New(m_cipher->BlockSize()); - } -#endif - - BlockCipher *m_cipher; - AlignedSecByteBlock m_register; -}; - -template -class CRYPTOPP_NO_VTABLE ModePolicyCommonTemplate : public CipherModeBase, public POLICY_INTERFACE -{ - unsigned int GetAlignment() const {return m_cipher->OptimalDataAlignment();} - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); -}; - -template -void ModePolicyCommonTemplate::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) -{ - m_cipher->SetKey(key, length, params); - ResizeBuffers(); - int feedbackSize = params.GetIntValueWithDefault(Name::FeedbackSize(), 0); - SetFeedbackSize(feedbackSize); -} - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_ModePolicy : public ModePolicyCommonTemplate -{ -public: - IV_Requirement IVRequirement() const {return RANDOM_IV;} - static const char * CRYPTOPP_API StaticAlgorithmName() {return "CFB";} - -protected: - unsigned int GetBytesPerIteration() const {return m_feedbackSize;} - byte * GetRegisterBegin() {return m_register + BlockSize() - m_feedbackSize;} - bool CanIterate() const {return m_feedbackSize == BlockSize();} - void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount); - void TransformRegister(); - void CipherResynchronize(const byte *iv, size_t length); - void SetFeedbackSize(unsigned int feedbackSize); - void ResizeBuffers(); - - SecByteBlock m_temp; - unsigned int m_feedbackSize; -}; - -inline void CopyOrZero(void *dest, const void *src, size_t s) -{ - if (src) - memcpy_s(dest, s, src, s); - else - memset(dest, 0, s); -} - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTemplate -{ -public: - bool CipherIsRandomAccess() const {return false;} - IV_Requirement IVRequirement() const {return UNIQUE_IV;} - static const char * CRYPTOPP_API StaticAlgorithmName() {return "OFB";} - -private: - unsigned int GetBytesPerIteration() const {return BlockSize();} - unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();} - void WriteKeystream(byte *keystreamBuffer, size_t iterationCount); - void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTemplate -{ -public: - bool CipherIsRandomAccess() const {return true;} - IV_Requirement IVRequirement() const {return RANDOM_IV;} - static const char * CRYPTOPP_API StaticAlgorithmName() {return "CTR";} - -protected: - virtual void IncrementCounterBy256(); - - unsigned int GetAlignment() const {return m_cipher->OptimalDataAlignment();} - unsigned int GetBytesPerIteration() const {return BlockSize();} - unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();} - void WriteKeystream(byte *buffer, size_t iterationCount) - {OperateKeystream(WRITE_KEYSTREAM, buffer, NULL, iterationCount);} - bool CanOperateKeystream() const {return true;} - void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); - void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); - void SeekToIteration(lword iterationCount); - - AlignedSecByteBlock m_counterArray; -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public CipherModeBase -{ -public: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - unsigned int MandatoryBlockSize() const {return BlockSize();} - bool IsRandomAccess() const {return false;} - bool IsSelfInverting() const {return false;} - bool IsForwardTransformation() const {return m_cipher->IsForwardTransformation();} - void Resynchronize(const byte *iv, int length=-1) {memcpy_s(m_register, m_register.size(), iv, ThrowIfInvalidIVLength(length));} - -protected: - bool RequireAlignedInput() const {return true;} - - // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - void ResizeBuffers(); -#else - void ResizeBuffers() - { - CipherModeBase::ResizeBuffers(); - m_buffer.New(BlockSize()); - } -#endif - - SecByteBlock m_buffer; -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ECB_OneWay : public BlockOrientedCipherModeBase -{ -public: - void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms = g_nullNameValuePairs) - {m_cipher->SetKey(key, length, params); BlockOrientedCipherModeBase::ResizeBuffers();} - IV_Requirement IVRequirement() const {return NOT_RESYNCHRONIZABLE;} - unsigned int OptimalBlockSize() const {return BlockSize() * m_cipher->OptimalNumberOfParallelBlocks();} - void ProcessData(byte *outString, const byte *inString, size_t length); - static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECB";} -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherModeBase -{ -public: - IV_Requirement IVRequirement() const {return UNPREDICTABLE_RANDOM_IV;} - bool RequireAlignedInput() const {return false;} - unsigned int MinLastBlockSize() const {return 0;} - static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC";} -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : public CBC_ModeBase -{ -public: - void ProcessData(byte *outString, const byte *inString, size_t length); -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Encryption : public CBC_Encryption -{ -public: - void SetStolenIV(byte *iv) {m_stolenIV = iv;} - unsigned int MinLastBlockSize() const {return BlockSize()+1;} - void ProcessLastBlock(byte *outString, const byte *inString, size_t length); - static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC/CTS";} - -protected: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) - { - CBC_Encryption::UncheckedSetKey(key, length, params); - m_stolenIV = params.GetValueWithDefault(Name::StolenIV(), (byte *)NULL); - } - - byte *m_stolenIV; -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Decryption : public CBC_ModeBase -{ -public: - void ProcessData(byte *outString, const byte *inString, size_t length); - -protected: - - // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46 -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - void ResizeBuffers(); -#else - void ResizeBuffers() - { - BlockOrientedCipherModeBase::ResizeBuffers(); - m_temp.New(BlockSize()); - } -#endif - - AlignedSecByteBlock m_temp; -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Decryption : public CBC_Decryption -{ -public: - unsigned int MinLastBlockSize() const {return BlockSize()+1;} - void ProcessLastBlock(byte *outString, const byte *inString, size_t length); -}; - -//! _ -template -class CipherModeFinalTemplate_CipherHolder : protected ObjectHolder, public AlgorithmImpl > -{ -public: - CipherModeFinalTemplate_CipherHolder() - { - this->m_cipher = &this->m_object; - this->ResizeBuffers(); - } - CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length) - { - this->m_cipher = &this->m_object; - this->SetKey(key, length); - } - CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length, const byte *iv) - { - this->m_cipher = &this->m_object; - this->SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, this->m_cipher->BlockSize()))); - } - CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length, const byte *iv, int feedbackSize) - { - this->m_cipher = &this->m_object; - this->SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, this->m_cipher->BlockSize()))(Name::FeedbackSize(), feedbackSize)); - } - - static std::string CRYPTOPP_API StaticAlgorithmName() - {return CIPHER::StaticAlgorithmName() + "/" + BASE::StaticAlgorithmName();} -}; - -//! \class CipherModeFinalTemplate_ExternalCipher -//! \tparam BASE CipherModeFinalTemplate_CipherHolder class -//! \brief OFB block cipher mode of operation. -template -class CipherModeFinalTemplate_ExternalCipher : public BASE -{ -public: - CipherModeFinalTemplate_ExternalCipher() {} - CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher) - {this->SetCipher(cipher);} - CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize = 0) - {this->SetCipherWithIV(cipher, iv, feedbackSize);} - - std::string AlgorithmName() const - {return (this->m_cipher ? this->m_cipher->AlgorithmName() + "/" : std::string("")) + BASE::StaticAlgorithmName();} -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS CFB_CipherTemplate >; -CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate >; -CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate >; - -//! \class CFB_Mode -//! \brief CFB block cipher mode of operation. -template -struct CFB_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder > > > Encryption; - typedef CipherModeFinalTemplate_CipherHolder > > > Decryption; -}; - -//! \class CFB_Mode_ExternalCipher -//! \brief CFB mode, external cipher. -struct CFB_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher > > > Encryption; - typedef CipherModeFinalTemplate_ExternalCipher > > > Decryption; -}; - -//! \class CFB_FIPS_Mode -//! \brief CFB block cipher mode of operation providing FIPS validated cryptography. -//! \details Requires full block plaintext according to FIPS 800-38A -template -struct CFB_FIPS_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder > > > > Encryption; - typedef CipherModeFinalTemplate_CipherHolder > > > > Decryption; -}; - -//! \class CFB_FIPS_Mode_ExternalCipher -//! \brief CFB mode, external cipher, providing FIPS validated cryptography. -//! \details Requires full block plaintext according to FIPS 800-38A -struct CFB_FIPS_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher > > > > Encryption; - typedef CipherModeFinalTemplate_ExternalCipher > > > > Decryption; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate >; - -//! \class OFB_Mode -//! \brief OFB block cipher mode of operation. -template -struct OFB_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder > > > Encryption; - typedef Encryption Decryption; -}; - -//! \class OFB_Mode_ExternalCipher -//! \brief OFB mode, external cipher. -struct OFB_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher > > > Encryption; - typedef Encryption Decryption; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate >; -CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher > > >; - -//! \class CTR_Mode -//! \brief CTR block cipher mode of operation. -template -struct CTR_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder > > > Encryption; - typedef Encryption Decryption; -}; - -//! \class CTR_Mode_ExternalCipher -//! \brief CTR mode, external cipher. -struct CTR_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher > > > Encryption; - typedef Encryption Decryption; -}; - -//! \class ECB_Mode -//! \brief ECB block cipher mode of operation. -template -struct ECB_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder Encryption; - typedef CipherModeFinalTemplate_CipherHolder Decryption; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; - -//! \class ECB_Mode_ExternalCipher -//! \brief ECB mode, external cipher. -struct ECB_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher Encryption; - typedef Encryption Decryption; -}; - -//! CBC mode -template -struct CBC_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder Encryption; - typedef CipherModeFinalTemplate_CipherHolder Decryption; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; -CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; - -//! CBC mode, external cipher -struct CBC_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher Encryption; - typedef CipherModeFinalTemplate_ExternalCipher Decryption; -}; - -//! CBC mode with ciphertext stealing -template -struct CBC_CTS_Mode : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_CipherHolder Encryption; - typedef CipherModeFinalTemplate_CipherHolder Decryption; -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; -CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher; - -//! \class CBC_CTS_Mode_ExternalCipher -//! \brief CBC mode with ciphertext stealing, external cipher -struct CBC_CTS_Mode_ExternalCipher : public CipherModeDocumentation -{ - typedef CipherModeFinalTemplate_ExternalCipher Encryption; - typedef CipherModeFinalTemplate_ExternalCipher Decryption; -}; - -#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY -typedef CFB_Mode_ExternalCipher::Encryption CFBEncryption; -typedef CFB_Mode_ExternalCipher::Decryption CFBDecryption; -typedef OFB_Mode_ExternalCipher::Encryption OFB; -typedef CTR_Mode_ExternalCipher::Encryption CounterMode; -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/modexppc.h b/external/crypto++-5.6.3/modexppc.h deleted file mode 100644 index 74f3352a3..000000000 --- a/external/crypto++-5.6.3/modexppc.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef CRYPTOPP_MODEXPPC_H -#define CRYPTOPP_MODEXPPC_H - -#include "cryptlib.h" -#include "modarith.h" -#include "integer.h" -#include "eprecomp.h" -#include "smartptr.h" -#include "pubkey.h" - -NAMESPACE_BEGIN(CryptoPP) - -CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; - -class ModExpPrecomputation : public DL_GroupPrecomputation -{ -public: - // DL_GroupPrecomputation - bool NeedConversions() const {return true;} - Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);} - virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);} - const AbstractGroup & GetGroup() const {return m_mr->MultiplicativeGroup();} - Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} - void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} - - // non-inherited - void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));} - const Integer & GetModulus() const {return m_mr->GetModulus();} - -private: - value_ptr m_mr; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/mqueue.cpp b/external/crypto++-5.6.3/mqueue.cpp deleted file mode 100644 index 1d645d83d..000000000 --- a/external/crypto++-5.6.3/mqueue.cpp +++ /dev/null @@ -1,174 +0,0 @@ -// mqueue.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "mqueue.h" - -NAMESPACE_BEGIN(CryptoPP) - -MessageQueue::MessageQueue(unsigned int nodeSize) - : m_queue(nodeSize), m_lengths(1, 0U), m_messageCounts(1, 0U) -{ -} - -size_t MessageQueue::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - if (begin >= MaxRetrievable()) - return 0; - - return m_queue.CopyRangeTo2(target, begin, STDMIN(MaxRetrievable(), end), channel, blocking); -} - -size_t MessageQueue::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - transferBytes = STDMIN(MaxRetrievable(), transferBytes); - size_t blockedBytes = m_queue.TransferTo2(target, transferBytes, channel, blocking); - m_lengths.front() -= transferBytes; - return blockedBytes; -} - -bool MessageQueue::GetNextMessage() -{ - if (NumberOfMessages() > 0 && !AnyRetrievable()) - { - m_lengths.pop_front(); - if (m_messageCounts[0] == 0 && m_messageCounts.size() > 1) - m_messageCounts.pop_front(); - return true; - } - else - return false; -} - -unsigned int MessageQueue::CopyMessagesTo(BufferedTransformation &target, unsigned int count, const std::string &channel) const -{ - ByteQueue::Walker walker(m_queue); - std::deque::const_iterator it = m_lengths.begin(); - unsigned int i; - for (i=0; i 0 && q2.AnyRetrievable()) - { - size_t len = length; - const byte *data = q2.Spy(len); - len = STDMIN(len, length); - if (memcmp(inString, data, len) != 0) - goto mismatch; - inString += len; - length -= len; - q2.Skip(len); - } - - q1.Put(inString, length); - - if (messageEnd) - { - if (q2.AnyRetrievable()) - goto mismatch; - else if (q2.AnyMessages()) - q2.GetNextMessage(); - else if (q2.NumberOfMessageSeries() > 0) - goto mismatch; - else - q1.MessageEnd(); - } - - return 0; - -mismatch: - return HandleMismatchDetected(blocking); - } -} - -bool EqualityComparisonFilter::ChannelMessageSeriesEnd(const std::string &channel, int propagation, bool blocking) -{ - unsigned int i = MapChannel(channel); - - if (i == 2) - { - OutputMessageSeriesEnd(4, propagation, blocking, channel); - return false; - } - else if (m_mismatchDetected) - return false; - else - { - MessageQueue &q1 = m_q[i], &q2 = m_q[1-i]; - - if (q2.AnyRetrievable() || q2.AnyMessages()) - goto mismatch; - else if (q2.NumberOfMessageSeries() > 0) - return Output(2, (const byte *)"\1", 1, 0, blocking) != 0; - else - q1.MessageSeriesEnd(); - - return false; - -mismatch: - return HandleMismatchDetected(blocking); - } -} - -bool EqualityComparisonFilter::HandleMismatchDetected(bool blocking) -{ - m_mismatchDetected = true; - if (m_throwIfNotEqual) - throw MismatchDetected(); - return Output(1, (const byte *)"\0", 1, 0, blocking) != 0; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/mqueue.h b/external/crypto++-5.6.3/mqueue.h deleted file mode 100644 index 702cb2d58..000000000 --- a/external/crypto++-5.6.3/mqueue.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef CRYPTOPP_MQUEUE_H -#define CRYPTOPP_MQUEUE_H - -#include "cryptlib.h" -#include "queue.h" -#include "filters.h" -#include "misc.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! Message Queue -class CRYPTOPP_DLL MessageQueue : public AutoSignaling -{ -public: - MessageQueue(unsigned int nodeSize=256); - - void IsolatedInitialize(const NameValuePairs ¶meters) - {m_queue.IsolatedInitialize(parameters); m_lengths.assign(1, 0U); m_messageCounts.assign(1, 0U);} - size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking) - { - CRYPTOPP_UNUSED(blocking); - m_queue.Put(begin, length); - m_lengths.back() += length; - if (messageEnd) - { - m_lengths.push_back(0); - m_messageCounts.back()++; - } - return 0; - } - bool IsolatedFlush(bool hardFlush, bool blocking) - {CRYPTOPP_UNUSED(hardFlush), CRYPTOPP_UNUSED(blocking); return false;} - bool IsolatedMessageSeriesEnd(bool blocking) - {CRYPTOPP_UNUSED(blocking); m_messageCounts.push_back(0); return false;} - - lword MaxRetrievable() const - {return m_lengths.front();} - bool AnyRetrievable() const - {return m_lengths.front() > 0;} - - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - - lword TotalBytesRetrievable() const - {return m_queue.MaxRetrievable();} - unsigned int NumberOfMessages() const - {return (unsigned int)m_lengths.size()-1;} - bool GetNextMessage(); - - unsigned int NumberOfMessagesInThisSeries() const - {return m_messageCounts[0];} - unsigned int NumberOfMessageSeries() const - {return (unsigned int)m_messageCounts.size()-1;} - - unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const; - - const byte * Spy(size_t &contiguousSize) const; - - void swap(MessageQueue &rhs); - -private: - ByteQueue m_queue; - std::deque m_lengths; - std::deque m_messageCounts; -}; - - -//! A filter that checks messages on two channels for equality -class CRYPTOPP_DLL EqualityComparisonFilter : public Unflushable > -{ -public: - struct MismatchDetected : public Exception {MismatchDetected() : Exception(DATA_INTEGRITY_CHECK_FAILED, "EqualityComparisonFilter: did not receive the same data on two channels") {}}; - - /*! if throwIfNotEqual is false, this filter will output a '\\0' byte when it detects a mismatch, '\\1' otherwise */ - EqualityComparisonFilter(BufferedTransformation *attachment=NULL, bool throwIfNotEqual=true, const std::string &firstChannel="0", const std::string &secondChannel="1") - : m_throwIfNotEqual(throwIfNotEqual), m_mismatchDetected(false) - , m_firstChannel(firstChannel), m_secondChannel(secondChannel) - {Detach(attachment);} - - size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); - bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); - -private: - unsigned int MapChannel(const std::string &channel) const; - bool HandleMismatchDetected(bool blocking); - - bool m_throwIfNotEqual, m_mismatchDetected; - std::string m_firstChannel, m_secondChannel; - MessageQueue m_q[2]; -}; - -NAMESPACE_END - -#ifndef __BORLANDC__ -NAMESPACE_BEGIN(std) -template<> inline void swap(CryptoPP::MessageQueue &a, CryptoPP::MessageQueue &b) -{ - a.swap(b); -} -NAMESPACE_END -#endif - -#endif diff --git a/external/crypto++-5.6.3/mqv.cpp b/external/crypto++-5.6.3/mqv.cpp deleted file mode 100644 index 247a3ef6e..000000000 --- a/external/crypto++-5.6.3/mqv.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// mqv.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "mqv.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void TestInstantiations_MQV() -{ - MQV mqv; -} -#endif - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/mqv.h b/external/crypto++-5.6.3/mqv.h deleted file mode 100644 index c42426033..000000000 --- a/external/crypto++-5.6.3/mqv.h +++ /dev/null @@ -1,155 +0,0 @@ -// mqv.h - written and placed in the public domain by Wei Dai - -//! \file mqv.h -//! \brief Classes for Menezes–Qu–Vanstone (MQV) key agreement - -#ifndef CRYPTOPP_MQV_H -#define CRYPTOPP_MQV_H - -#include "cryptlib.h" -#include "gfpcrypt.h" -#include "modarith.h" -#include "integer.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class MQV_Domain -//! \brief MQV domain for performing authenticated key agreement -//! \tparam GROUP_PARAMETERS doamin parameters -//! \tparam COFACTOR_OPTION cofactor option -//! \details GROUP_PARAMETERS paramters include the curve coefcients and the base point. -//! Binary curves use a polynomial to represent its characteristic, while prime curves -//! use a prime number. -template -class MQV_Domain : public AuthenticatedKeyAgreementDomain -{ -public: - typedef GROUP_PARAMETERS GroupParameters; - typedef typename GroupParameters::Element Element; - typedef MQV_Domain Domain; - - MQV_Domain() {} - - MQV_Domain(const GroupParameters ¶ms) - : m_groupParameters(params) {} - - MQV_Domain(BufferedTransformation &bt) - {m_groupParameters.BERDecode(bt);} - - template - MQV_Domain(T1 v1, T2 v2) - {m_groupParameters.Initialize(v1, v2);} - - template - MQV_Domain(T1 v1, T2 v2, T3 v3) - {m_groupParameters.Initialize(v1, v2, v3);} - - template - MQV_Domain(T1 v1, T2 v2, T3 v3, T4 v4) - {m_groupParameters.Initialize(v1, v2, v3, v4);} - - const GroupParameters & GetGroupParameters() const {return m_groupParameters;} - GroupParameters & AccessGroupParameters() {return m_groupParameters;} - - CryptoParameters & AccessCryptoParameters() {return AccessAbstractGroupParameters();} - - unsigned int AgreedValueLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(false);} - unsigned int StaticPrivateKeyLength() const {return GetAbstractGroupParameters().GetSubgroupOrder().ByteCount();} - unsigned int StaticPublicKeyLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(true);} - - void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const - { - Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent()); - x.Encode(privateKey, StaticPrivateKeyLength()); - } - - void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const - { - CRYPTOPP_UNUSED(rng); - const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); - Integer x(privateKey, StaticPrivateKeyLength()); - Element y = params.ExponentiateBase(x); - params.EncodeElement(true, y, publicKey); - } - - unsigned int EphemeralPrivateKeyLength() const {return StaticPrivateKeyLength() + StaticPublicKeyLength();} - unsigned int EphemeralPublicKeyLength() const {return StaticPublicKeyLength();} - - void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const - { - const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); - Integer x(rng, Integer::One(), params.GetMaxExponent()); - x.Encode(privateKey, StaticPrivateKeyLength()); - Element y = params.ExponentiateBase(x); - params.EncodeElement(true, y, privateKey+StaticPrivateKeyLength()); - } - - void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const - { - CRYPTOPP_UNUSED(rng); - memcpy(publicKey, privateKey+StaticPrivateKeyLength(), EphemeralPublicKeyLength()); - } - - bool Agree(byte *agreedValue, - const byte *staticPrivateKey, const byte *ephemeralPrivateKey, - const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, - bool validateStaticOtherPublicKey=true) const - { - try - { - const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); - Element WW = params.DecodeElement(staticOtherPublicKey, validateStaticOtherPublicKey); - Element VV = params.DecodeElement(ephemeralOtherPublicKey, true); - - Integer s(staticPrivateKey, StaticPrivateKeyLength()); - Integer u(ephemeralPrivateKey, StaticPrivateKeyLength()); - Element V = params.DecodeElement(ephemeralPrivateKey+StaticPrivateKeyLength(), false); - - const Integer &r = params.GetSubgroupOrder(); - Integer h2 = Integer::Power2((r.BitCount()+1)/2); - Integer e = ((h2+params.ConvertElementToInteger(V)%h2)*s+u) % r; - Integer tt = h2 + params.ConvertElementToInteger(VV) % h2; - - if (COFACTOR_OPTION::ToEnum() == NO_COFACTOR_MULTIPLICTION) - { - Element P = params.ExponentiateElement(WW, tt); - P = m_groupParameters.MultiplyElements(P, VV); - Element R[2]; - const Integer e2[2] = {r, e}; - params.SimultaneousExponentiate(R, P, e2, 2); - if (!params.IsIdentity(R[0]) || params.IsIdentity(R[1])) - return false; - params.EncodeElement(false, R[1], agreedValue); - } - else - { - const Integer &k = params.GetCofactor(); - if (COFACTOR_OPTION::ToEnum() == COMPATIBLE_COFACTOR_MULTIPLICTION) - e = ModularArithmetic(r).Divide(e, k); - Element P = m_groupParameters.CascadeExponentiate(VV, k*e, WW, k*(e*tt%r)); - if (params.IsIdentity(P)) - return false; - params.EncodeElement(false, P, agreedValue); - } - } - catch (DL_BadElement &) - { - return false; - } - return true; - } - -private: - DL_GroupParameters & AccessAbstractGroupParameters() {return m_groupParameters;} - const DL_GroupParameters & GetAbstractGroupParameters() const {return m_groupParameters;} - - GroupParameters m_groupParameters; -}; - -//! Menezes-Qu-Vanstone in GF(p) with key validation, AKA MQV -typedef MQV_Domain MQV; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/nbtheory.cpp b/external/crypto++-5.6.3/nbtheory.cpp deleted file mode 100644 index 2fa275a33..000000000 --- a/external/crypto++-5.6.3/nbtheory.cpp +++ /dev/null @@ -1,1125 +0,0 @@ -// nbtheory.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "nbtheory.h" -#include "integer.h" -#include "modarith.h" -#include "algparam.h" -#include "smartptr.h" -#include "misc.h" - -#include -#include - -#ifdef _OPENMP -# include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -const word s_lastSmallPrime = 32719; - -struct NewPrimeTable -{ - std::vector * operator()() const - { - const unsigned int maxPrimeTableSize = 3511; - - member_ptr > pPrimeTable(new std::vector); - std::vector &primeTable = *pPrimeTable; - primeTable.reserve(maxPrimeTableSize); - - primeTable.push_back(2); - unsigned int testEntriesEnd = 1; - - for (unsigned int p=3; p<=s_lastSmallPrime; p+=2) - { - unsigned int j; - for (j=1; j &primeTable = Singleton, NewPrimeTable>().Ref(); - size = (unsigned int)primeTable.size(); - return &primeTable[0]; -} - -bool IsSmallPrime(const Integer &p) -{ - unsigned int primeTableSize; - const word16 * primeTable = GetPrimeTable(primeTableSize); - - if (p.IsPositive() && p <= primeTable[primeTableSize-1]) - return std::binary_search(primeTable, primeTable+primeTableSize, (word16)p.ConvertToLong()); - else - return false; -} - -bool TrialDivision(const Integer &p, unsigned bound) -{ - unsigned int primeTableSize; - const word16 * primeTable = GetPrimeTable(primeTableSize); - - assert(primeTable[primeTableSize-1] >= bound); - - unsigned int i; - for (i = 0; primeTable[i]3 && b>1 && b3 && b>1 && b>a; - - Integer z = a_exp_b_mod_c(b, m, n); - if (z==1 || z==nminus1) - return true; - for (unsigned j=1; j3); - - Integer b; - for (unsigned int i=0; i2); - - Integer b=3; - unsigned int i=0; - int j; - - while ((j=Jacobi(b.Squared()-4, n)) == 1) - { - if (++i==64 && n.IsSquare()) // avoid infinite loop if n is a square - return false; - ++b; ++b; - } - - if (j==0) - return false; - else - return Lucas(n+1, b, n)==2; -} - -bool IsStrongLucasProbablePrime(const Integer &n) -{ - if (n <= 1) - return false; - - if (n.IsEven()) - return n==2; - - assert(n>2); - - Integer b=3; - unsigned int i=0; - int j; - - while ((j=Jacobi(b.Squared()-4, n)) == 1) - { - if (++i==64 && n.IsSquare()) // avoid infinite loop if n is a square - return false; - ++b; ++b; - } - - if (j==0) - return false; - - Integer n1 = n+1; - unsigned int a; - - // calculate a = largest power of 2 that divides n1 - for (a=0; ; a++) - if (n1.GetBit(a)) - break; - Integer m = n1>>a; - - Integer z = Lucas(m, b, n); - if (z==2 || z==n-2) - return true; - for (i=1; i().Ref()) - return SmallDivisorsTest(p); - else - return SmallDivisorsTest(p) && IsStrongProbablePrime(p, 3) && IsStrongLucasProbablePrime(p); -} - -bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level) -{ - bool pass = IsPrime(p) && RabinMillerTest(rng, p, 1); - if (level >= 1) - pass = pass && RabinMillerTest(rng, p, 10); - return pass; -} - -unsigned int PrimeSearchInterval(const Integer &max) -{ - return max.BitCount(); -} - -static inline bool FastProbablePrimeTest(const Integer &n) -{ - return IsStrongProbablePrime(n,2); -} - -AlgorithmParameters MakeParametersForTwoPrimesOfEqualSize(unsigned int productBitLength) -{ - if (productBitLength < 16) - throw InvalidArgument("invalid bit length"); - - Integer minP, maxP; - - if (productBitLength%2==0) - { - minP = Integer(182) << (productBitLength/2-8); - maxP = Integer::Power2(productBitLength/2)-1; - } - else - { - minP = Integer::Power2((productBitLength-1)/2); - maxP = Integer(181) << ((productBitLength+1)/2-8); - } - - return MakeParameters("RandomNumberType", Integer::PRIME)("Min", minP)("Max", maxP); -} - -class PrimeSieve -{ -public: - // delta == 1 or -1 means double sieve with p = 2*q + delta - PrimeSieve(const Integer &first, const Integer &last, const Integer &step, signed int delta=0); - bool NextCandidate(Integer &c); - - void DoSieve(); - static void SieveSingle(std::vector &sieve, word16 p, const Integer &first, const Integer &step, word16 stepInv); - - Integer m_first, m_last, m_step; - signed int m_delta; - word m_next; - std::vector m_sieve; -}; - -PrimeSieve::PrimeSieve(const Integer &first, const Integer &last, const Integer &step, signed int delta) - : m_first(first), m_last(last), m_step(step), m_delta(delta), m_next(0) -{ - DoSieve(); -} - -bool PrimeSieve::NextCandidate(Integer &c) -{ - bool safe = SafeConvert(std::find(m_sieve.begin()+m_next, m_sieve.end(), false) - m_sieve.begin(), m_next); - CRYPTOPP_UNUSED(safe); assert(safe); - if (m_next == m_sieve.size()) - { - m_first += long(m_sieve.size())*m_step; - if (m_first > m_last) - return false; - else - { - m_next = 0; - DoSieve(); - return NextCandidate(c); - } - } - else - { - c = m_first + long(m_next)*m_step; - ++m_next; - return true; - } -} - -void PrimeSieve::SieveSingle(std::vector &sieve, word16 p, const Integer &first, const Integer &step, word16 stepInv) -{ - if (stepInv) - { - size_t sieveSize = sieve.size(); - size_t j = (word32(p-(first%p))*stepInv) % p; - // if the first multiple of p is p, skip it - if (first.WordCount() <= 1 && first + step*long(j) == p) - j += p; - for (; j < sieveSize; j += p) - sieve[j] = true; - } -} - -void PrimeSieve::DoSieve() -{ - unsigned int primeTableSize; - const word16 * primeTable = GetPrimeTable(primeTableSize); - - const unsigned int maxSieveSize = 32768; - unsigned int sieveSize = STDMIN(Integer(maxSieveSize), (m_last-m_first)/m_step+1).ConvertToLong(); - - m_sieve.clear(); - m_sieve.resize(sieveSize, false); - - if (m_delta == 0) - { - for (unsigned int i = 0; i < primeTableSize; ++i) - SieveSingle(m_sieve, primeTable[i], m_first, m_step, (word16)m_step.InverseMod(primeTable[i])); - } - else - { - assert(m_step%2==0); - Integer qFirst = (m_first-m_delta) >> 1; - Integer halfStep = m_step >> 1; - for (unsigned int i = 0; i < primeTableSize; ++i) - { - word16 p = primeTable[i]; - word16 stepInv = (word16)m_step.InverseMod(p); - SieveSingle(m_sieve, p, m_first, m_step, stepInv); - - word16 halfStepInv = 2*stepInv < p ? 2*stepInv : 2*stepInv-p; - SieveSingle(m_sieve, p, qFirst, halfStep, halfStepInv); - } - } -} - -bool FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector) -{ - assert(!equiv.IsNegative() && equiv < mod); - - Integer gcd = GCD(equiv, mod); - if (gcd != Integer::One()) - { - // the only possible prime p such that p%mod==equiv where GCD(mod,equiv)!=1 is GCD(mod,equiv) - if (p <= gcd && gcd <= max && IsPrime(gcd) && (!pSelector || pSelector->IsAcceptable(gcd))) - { - p = gcd; - return true; - } - else - return false; - } - - unsigned int primeTableSize; - const word16 * primeTable = GetPrimeTable(primeTableSize); - - if (p <= primeTable[primeTableSize-1]) - { - const word16 *pItr; - - --p; - if (p.IsPositive()) - pItr = std::upper_bound(primeTable, primeTable+primeTableSize, (word)p.ConvertToLong()); - else - pItr = primeTable; - - while (pItr < primeTable+primeTableSize && !(*pItr%mod == equiv && (!pSelector || pSelector->IsAcceptable(*pItr)))) - ++pItr; - - if (pItr < primeTable+primeTableSize) - { - p = *pItr; - return p <= max; - } - - p = primeTable[primeTableSize-1]+1; - } - - assert(p > primeTable[primeTableSize-1]); - - if (mod.IsOdd()) - return FirstPrime(p, max, CRT(equiv, mod, 1, 2, 1), mod<<1, pSelector); - - p += (equiv-p)%mod; - - if (p>max) - return false; - - PrimeSieve sieve(p, max, mod); - - while (sieve.NextCandidate(p)) - { - if ((!pSelector || pSelector->IsAcceptable(p)) && FastProbablePrimeTest(p) && IsPrime(p)) - return true; - } - - return false; -} - -// the following two functions are based on code and comments provided by Preda Mihailescu -static bool ProvePrime(const Integer &p, const Integer &q) -{ - assert(p < q*q*q); - assert(p % q == 1); - -// this is the Quisquater test. Numbers p having passed the Lucas - Lehmer test -// for q and verifying p < q^3 can only be built up of two factors, both = 1 mod q, -// or be prime. The next two lines build the discriminant of a quadratic equation -// which holds iff p is built up of two factors (excercise ... ) - - Integer r = (p-1)/q; - if (((r%q).Squared()-4*(r/q)).IsSquare()) - return false; - - unsigned int primeTableSize; - const word16 * primeTable = GetPrimeTable(primeTableSize); - - assert(primeTableSize >= 50); - for (int i=0; i<50; i++) - { - Integer b = a_exp_b_mod_c(primeTable[i], r, p); - if (b != 1) - return a_exp_b_mod_c(b, q, p) == 1; - } - return false; -} - -Integer MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int pbits) -{ - Integer p; - Integer minP = Integer::Power2(pbits-1); - Integer maxP = Integer::Power2(pbits) - 1; - - if (maxP <= Integer(s_lastSmallPrime).Squared()) - { - // Randomize() will generate a prime provable by trial division - p.Randomize(rng, minP, maxP, Integer::PRIME); - return p; - } - - unsigned int qbits = (pbits+2)/3 + 1 + rng.GenerateWord32(0, pbits/36); - Integer q = MihailescuProvablePrime(rng, qbits); - Integer q2 = q<<1; - - while (true) - { - // this initializes the sieve to search in the arithmetic - // progression p = p_0 + \lambda * q2 = p_0 + 2 * \lambda * q, - // with q the recursively generated prime above. We will be able - // to use Lucas tets for proving primality. A trick of Quisquater - // allows taking q > cubic_root(p) rather then square_root: this - // decreases the recursion. - - p.Randomize(rng, minP, maxP, Integer::ANY, 1, q2); - PrimeSieve sieve(p, STDMIN(p+PrimeSearchInterval(maxP)*q2, maxP), q2); - - while (sieve.NextCandidate(p)) - { - if (FastProbablePrimeTest(p) && ProvePrime(p, q)) - return p; - } - } - - // not reached - return p; -} - -Integer MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits) -{ - const unsigned smallPrimeBound = 29, c_opt=10; - Integer p; - - unsigned int primeTableSize; - const word16 * primeTable = GetPrimeTable(primeTableSize); - - if (bits < smallPrimeBound) - { - do - p.Randomize(rng, Integer::Power2(bits-1), Integer::Power2(bits)-1, Integer::ANY, 1, 2); - while (TrialDivision(p, 1 << ((bits+1)/2))); - } - else - { - const unsigned margin = bits > 50 ? 20 : (bits-10)/2; - double relativeSize; - do - relativeSize = pow(2.0, double(rng.GenerateWord32())/0xffffffff - 1); - while (bits * relativeSize >= bits - margin); - - Integer a,b; - Integer q = MaurerProvablePrime(rng, unsigned(bits*relativeSize)); - Integer I = Integer::Power2(bits-2)/q; - Integer I2 = I << 1; - unsigned int trialDivisorBound = (unsigned int)STDMIN((unsigned long)primeTable[primeTableSize-1], (unsigned long)bits*bits/c_opt); - bool success = false; - while (!success) - { - p.Randomize(rng, I, I2, Integer::ANY); - p *= q; p <<= 1; ++p; - if (!TrialDivision(p, trialDivisorBound)) - { - a.Randomize(rng, 2, p-1, Integer::ANY); - b = a_exp_b_mod_c(a, (p-1)/q, p); - success = (GCD(b-1, p) == 1) && (a_exp_b_mod_c(b, q, p) == 1); - } - } - } - return p; -} - -Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u) -{ - // isn't operator overloading great? - return p * (u * (xq-xp) % q) + xp; -/* - Integer t1 = xq-xp; - cout << hex << t1 << endl; - Integer t2 = u * t1; - cout << hex << t2 << endl; - Integer t3 = t2 % q; - cout << hex << t3 << endl; - Integer t4 = p * t3; - cout << hex << t4 << endl; - Integer t5 = t4 + xp; - cout << hex << t5 << endl; - return t5; -*/ -} - -Integer ModularSquareRoot(const Integer &a, const Integer &p) -{ - if (p%4 == 3) - return a_exp_b_mod_c(a, (p+1)/4, p); - - Integer q=p-1; - unsigned int r=0; - while (q.IsEven()) - { - r++; - q >>= 1; - } - - Integer n=2; - while (Jacobi(n, p) != -1) - ++n; - - Integer y = a_exp_b_mod_c(n, q, p); - Integer x = a_exp_b_mod_c(a, (q-1)/2, p); - Integer b = (x.Squared()%p)*a%p; - x = a*x%p; - Integer tempb, t; - - while (b != 1) - { - unsigned m=0; - tempb = b; - do - { - m++; - b = b.Squared()%p; - if (m==r) - return Integer::Zero(); - } - while (b != 1); - - t = y; - for (unsigned i=0; i>= 1; - b >>= 1; - k++; - } - - while (a[0]==0) - a >>= 1; - - while (b[0]==0) - b >>= 1; - - while (1) - { - switch (a.Compare(b)) - { - case -1: - b -= a; - while (b[0]==0) - b >>= 1; - break; - - case 0: - return (a <<= k); - - case 1: - a -= b; - while (a[0]==0) - a >>= 1; - break; - - default: - assert(false); - } - } -} - -Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b) -{ - assert(b.Positive()); - - if (a.Negative()) - return EuclideanMultiplicativeInverse(a%b, b); - - if (b[0]==0) - { - if (!b || a[0]==0) - return Integer::Zero(); // no inverse - if (a==1) - return 1; - Integer u = EuclideanMultiplicativeInverse(b, a); - if (!u) - return Integer::Zero(); // no inverse - else - return (b*(a-u)+1)/a; - } - - Integer u=1, d=a, v1=b, v3=b, t1, t3, b2=(b+1)>>1; - - if (a[0]) - { - t1 = Integer::Zero(); - t3 = -b; - } - else - { - t1 = b2; - t3 = a>>1; - } - - while (!!t3) - { - while (t3[0]==0) - { - t3 >>= 1; - if (t1[0]==0) - t1 >>= 1; - else - { - t1 >>= 1; - t1 += b2; - } - } - if (t3.Positive()) - { - u = t1; - d = t3; - } - else - { - v1 = b-t1; - v3 = -t3; - } - t1 = u-v1; - t3 = d-v3; - if (t1.Negative()) - t1 += b; - } - if (d==1) - return u; - else - return Integer::Zero(); // no inverse -} -*/ - -int Jacobi(const Integer &aIn, const Integer &bIn) -{ - assert(bIn.IsOdd()); - - Integer b = bIn, a = aIn%bIn; - int result = 1; - - while (!!a) - { - unsigned i=0; - while (a.GetBit(i)==0) - i++; - a>>=i; - - if (i%2==1 && (b%8==3 || b%8==5)) - result = -result; - - if (a%4==3 && b%4==3) - result = -result; - - std::swap(a, b); - a %= b; - } - - return (b==1) ? result : 0; -} - -Integer Lucas(const Integer &e, const Integer &pIn, const Integer &n) -{ - unsigned i = e.BitCount(); - if (i==0) - return Integer::Two(); - - MontgomeryRepresentation m(n); - Integer p=m.ConvertIn(pIn%n), two=m.ConvertIn(Integer::Two()); - Integer v=p, v1=m.Subtract(m.Square(p), two); - - i--; - while (i--) - { - if (e.GetBit(i)) - { - // v = (v*v1 - p) % m; - v = m.Subtract(m.Multiply(v,v1), p); - // v1 = (v1*v1 - 2) % m; - v1 = m.Subtract(m.Square(v1), two); - } - else - { - // v1 = (v*v1 - p) % m; - v1 = m.Subtract(m.Multiply(v,v1), p); - // v = (v*v - 2) % m; - v = m.Subtract(m.Square(v), two); - } - } - return m.ConvertOut(v); -} - -// This is Peter Montgomery's unpublished Lucas sequence evalutation algorithm. -// The total number of multiplies and squares used is less than the binary -// algorithm (see above). Unfortunately I can't get it to run as fast as -// the binary algorithm because of the extra overhead. -/* -Integer Lucas(const Integer &n, const Integer &P, const Integer &modulus) -{ - if (!n) - return 2; - -#define f(A, B, C) m.Subtract(m.Multiply(A, B), C) -#define X2(A) m.Subtract(m.Square(A), two) -#define X3(A) m.Multiply(A, m.Subtract(m.Square(A), three)) - - MontgomeryRepresentation m(modulus); - Integer two=m.ConvertIn(2), three=m.ConvertIn(3); - Integer A=m.ConvertIn(P), B, C, p, d=n, e, r, t, T, U; - - while (d!=1) - { - p = d; - unsigned int b = WORD_BITS * p.WordCount(); - Integer alpha = (Integer(5)<<(2*b-2)).SquareRoot() - Integer::Power2(b-1); - r = (p*alpha)>>b; - e = d-r; - B = A; - C = two; - d = r; - - while (d!=e) - { - if (d>2)) - if ((dm3+em3==0 || dm3+em3==3) && (t = e, t >>= 2, t += e, d <= t)) - { - // #1 -// t = (d+d-e)/3; -// t = d; t += d; t -= e; t /= 3; -// e = (e+e-d)/3; -// e += e; e -= d; e /= 3; -// d = t; - -// t = (d+e)/3 - t = d; t += e; t /= 3; - e -= t; - d -= t; - - T = f(A, B, C); - U = f(T, A, B); - B = f(T, B, A); - A = U; - continue; - } - -// if (dm6 == em6 && d <= e + (e>>2)) - if (dm3 == em3 && dm2 == em2 && (t = e, t >>= 2, t += e, d <= t)) - { - // #2 -// d = (d-e)>>1; - d -= e; d >>= 1; - B = f(A, B, C); - A = X2(A); - continue; - } - -// if (d <= (e<<2)) - if (d <= (t = e, t <<= 2)) - { - // #3 - d -= e; - C = f(A, B, C); - swap(B, C); - continue; - } - - if (dm2 == em2) - { - // #4 -// d = (d-e)>>1; - d -= e; d >>= 1; - B = f(A, B, C); - A = X2(A); - continue; - } - - if (dm2 == 0) - { - // #5 - d >>= 1; - C = f(A, C, B); - A = X2(A); - continue; - } - - if (dm3 == 0) - { - // #6 -// d = d/3 - e; - d /= 3; d -= e; - T = X2(A); - C = f(T, f(A, B, C), C); - swap(B, C); - A = f(T, A, A); - continue; - } - - if (dm3+em3==0 || dm3+em3==3) - { - // #7 -// d = (d-e-e)/3; - d -= e; d -= e; d /= 3; - T = f(A, B, C); - B = f(T, A, B); - A = X3(A); - continue; - } - - if (dm3 == em3) - { - // #8 -// d = (d-e)/3; - d -= e; d /= 3; - T = f(A, B, C); - C = f(A, C, B); - B = T; - A = X3(A); - continue; - } - - assert(em2 == 0); - // #9 - e >>= 1; - C = f(C, B, A); - B = X2(B); - } - - A = f(A, B, C); - } - -#undef f -#undef X2 -#undef X3 - - return m.ConvertOut(A); -} -*/ - -Integer InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u) -{ - Integer d = (m*m-4); - Integer p2, q2; - #pragma omp parallel - #pragma omp sections - { - #pragma omp section - { - p2 = p-Jacobi(d,p); - p2 = Lucas(EuclideanMultiplicativeInverse(e,p2), m, p); - } - #pragma omp section - { - q2 = q-Jacobi(d,q); - q2 = Lucas(EuclideanMultiplicativeInverse(e,q2), m, q); - } - } - return CRT(p2, p, q2, q, u); -} - -unsigned int FactoringWorkFactor(unsigned int n) -{ - // extrapolated from the table in Odlyzko's "The Future of Integer Factorization" - // updated to reflect the factoring of RSA-130 - if (n<5) return 0; - else return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * pow(log(double(n)), 2.0/3.0) - 5); -} - -unsigned int DiscreteLogWorkFactor(unsigned int n) -{ - // assuming discrete log takes about the same time as factoring - if (n<5) return 0; - else return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * pow(log(double(n)), 2.0/3.0) - 5); -} - -// ******************************************************** - -void PrimeAndGenerator::Generate(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits) -{ - // no prime exists for delta = -1, qbits = 4, and pbits = 5 - assert(qbits > 4); - assert(pbits > qbits); - - if (qbits+1 == pbits) - { - Integer minP = Integer::Power2(pbits-1); - Integer maxP = Integer::Power2(pbits) - 1; - bool success = false; - - while (!success) - { - p.Randomize(rng, minP, maxP, Integer::ANY, 6+5*delta, 12); - PrimeSieve sieve(p, STDMIN(p+PrimeSearchInterval(maxP)*12, maxP), 12, delta); - - while (sieve.NextCandidate(p)) - { - assert(IsSmallPrime(p) || SmallDivisorsTest(p)); - q = (p-delta) >> 1; - assert(IsSmallPrime(q) || SmallDivisorsTest(q)); - if (FastProbablePrimeTest(q) && FastProbablePrimeTest(p) && IsPrime(q) && IsPrime(p)) - { - success = true; - break; - } - } - } - - if (delta == 1) - { - // find g such that g is a quadratic residue mod p, then g has order q - // g=4 always works, but this way we get the smallest quadratic residue (other than 1) - for (g=2; Jacobi(g, p) != 1; ++g) {} - // contributed by Walt Tuvell: g should be the following according to the Law of Quadratic Reciprocity - assert((p%8==1 || p%8==7) ? g==2 : (p%12==1 || p%12==11) ? g==3 : g==4); - } - else - { - assert(delta == -1); - // find g such that g*g-4 is a quadratic non-residue, - // and such that g has order q - for (g=3; ; ++g) - if (Jacobi(g*g-4, p)==-1 && Lucas(q, g, p)==2) - break; - } - } - else - { - Integer minQ = Integer::Power2(qbits-1); - Integer maxQ = Integer::Power2(qbits) - 1; - Integer minP = Integer::Power2(pbits-1); - Integer maxP = Integer::Power2(pbits) - 1; - - do - { - q.Randomize(rng, minQ, maxQ, Integer::PRIME); - } while (!p.Randomize(rng, minP, maxP, Integer::PRIME, delta%q, q)); - - // find a random g of order q - if (delta==1) - { - do - { - Integer h(rng, 2, p-2, Integer::ANY); - g = a_exp_b_mod_c(h, (p-1)/q, p); - } while (g <= 1); - assert(a_exp_b_mod_c(g, q, p)==1); - } - else - { - assert(delta==-1); - do - { - Integer h(rng, 3, p-1, Integer::ANY); - if (Jacobi(h*h-4, p)==1) - continue; - g = Lucas((p+1)/q, h, p); - } while (g <= 2); - assert(Lucas(q, g, p) == 2); - } - } -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/nbtheory.h b/external/crypto++-5.6.3/nbtheory.h deleted file mode 100644 index 2c8249341..000000000 --- a/external/crypto++-5.6.3/nbtheory.h +++ /dev/null @@ -1,173 +0,0 @@ -// nbtheory.h - written and placed in the public domain by Wei Dai - -//! \file nbtheory.h -//! \brief Classes and functions for number theoretic operations - -#ifndef CRYPTOPP_NBTHEORY_H -#define CRYPTOPP_NBTHEORY_H - -#include "cryptlib.h" -#include "integer.h" -#include "algparam.h" - -NAMESPACE_BEGIN(CryptoPP) - -// obtain pointer to small prime table and get its size -CRYPTOPP_DLL const word16 * CRYPTOPP_API GetPrimeTable(unsigned int &size); - -// ************ primality testing **************** - -//! \brief Generates a provable prime -//! \param rng a RandomNumberGenerator to produce keying material -//! \param bits the number of bits in the prime number -//! \returns Integer() meeting Maurer's tests for primality -CRYPTOPP_DLL Integer CRYPTOPP_API MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits); - -//! \brief Generates a provable prime -//! \param rng a RandomNumberGenerator to produce keying material -//! \param bits the number of bits in the prime number -//! \returns Integer() meeting Mihailescu's tests for primality -//! \details Mihailescu's methods performs a search using algorithmic progressions. -CRYPTOPP_DLL Integer CRYPTOPP_API MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int bits); - -//! \brief Tests whether a number is a small prime -//! \param p a candidate prime to test -//! \returns true if p is a small prime, false otherwise -//! \details Internally, the library maintains a table fo the first 32719 prime numbers -//! in sorted order. IsSmallPrime() searches the table and returns true if p is -//! in the table. -CRYPTOPP_DLL bool CRYPTOPP_API IsSmallPrime(const Integer &p); - -//! -//! \returns true if p is divisible by some prime less than bound. -//! \details TrialDivision() true if p is divisible by some prime less than bound. bound not be -//! greater than the largest entry in the prime table, which is 32719. -CRYPTOPP_DLL bool CRYPTOPP_API TrialDivision(const Integer &p, unsigned bound); - -// returns true if p is NOT divisible by small primes -CRYPTOPP_DLL bool CRYPTOPP_API SmallDivisorsTest(const Integer &p); - -// These is no reason to use these two, use the ones below instead -CRYPTOPP_DLL bool CRYPTOPP_API IsFermatProbablePrime(const Integer &n, const Integer &b); -CRYPTOPP_DLL bool CRYPTOPP_API IsLucasProbablePrime(const Integer &n); - -CRYPTOPP_DLL bool CRYPTOPP_API IsStrongProbablePrime(const Integer &n, const Integer &b); -CRYPTOPP_DLL bool CRYPTOPP_API IsStrongLucasProbablePrime(const Integer &n); - -// Rabin-Miller primality test, i.e. repeating the strong probable prime test -// for several rounds with random bases -CRYPTOPP_DLL bool CRYPTOPP_API RabinMillerTest(RandomNumberGenerator &rng, const Integer &w, unsigned int rounds); - -//! \brief Verifies a prime number -//! \param p a candidate prime to test -//! \returns true if p is a probable prime, false otherwise -//! \details IsPrime() is suitable for testing candidate primes when creating them. Internally, -//! IsPrime() utilizes SmallDivisorsTest(), IsStrongProbablePrime() and IsStrongLucasProbablePrime(). -CRYPTOPP_DLL bool CRYPTOPP_API IsPrime(const Integer &p); - -//! \brief Verifies a prime number -//! \param rng a RandomNumberGenerator for randomized testing -//! \param p a candidate prime to test -//! \param level the level of thoroughness of testing -//! \returns true if p is a strong probable prime, false otherwise -//! \details VerifyPrime() is suitable for testing candidate primes created by others. Internally, -//! VerifyPrime() utilizes IsPrime() and one-round RabinMillerTest(). If the candiate passes and -//! level is greater than 1, then 10 round RabinMillerTest() primality testing is performed. -CRYPTOPP_DLL bool CRYPTOPP_API VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level = 1); - -//! \class PrimeSelector -//! \brief Application callback to signal suitability of a cabdidate prime -class CRYPTOPP_DLL PrimeSelector -{ -public: - const PrimeSelector *GetSelectorPointer() const {return this;} - virtual bool IsAcceptable(const Integer &candidate) const =0; -}; - -//! \brief Finds a random prime of special form -//! \param p an Integer reference to receive the prime -//! \param max the maximum value -//! \param equiv the equivalence class based on the parameter mod -//! \param mod the modulus used to reduce the equivalence class -//! \param pSelector pointer to a PrimeSelector function for the application to signal suitability -//! \returns true if and only if FirstPrime() finds a prime and returns the prime through p. If FirstPrime() -//! returns false, then no such prime exists and the value of p is undefined -//! \details FirstPrime() uses a fast sieve to find the first probable prime -//! in {x | p<=x<=max and x%mod==equiv} -CRYPTOPP_DLL bool CRYPTOPP_API FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector); - -CRYPTOPP_DLL unsigned int CRYPTOPP_API PrimeSearchInterval(const Integer &max); - -CRYPTOPP_DLL AlgorithmParameters CRYPTOPP_API MakeParametersForTwoPrimesOfEqualSize(unsigned int productBitLength); - -// ********** other number theoretic functions ************ - -inline Integer GCD(const Integer &a, const Integer &b) - {return Integer::Gcd(a,b);} -inline bool RelativelyPrime(const Integer &a, const Integer &b) - {return Integer::Gcd(a,b) == Integer::One();} -inline Integer LCM(const Integer &a, const Integer &b) - {return a/Integer::Gcd(a,b)*b;} -inline Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b) - {return a.InverseMod(b);} - -// use Chinese Remainder Theorem to calculate x given x mod p and x mod q, and u = inverse of p mod q -CRYPTOPP_DLL Integer CRYPTOPP_API CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u); - -// if b is prime, then Jacobi(a, b) returns 0 if a%b==0, 1 if a is quadratic residue mod b, -1 otherwise -// check a number theory book for what Jacobi symbol means when b is not prime -CRYPTOPP_DLL int CRYPTOPP_API Jacobi(const Integer &a, const Integer &b); - -// calculates the Lucas function V_e(p, 1) mod n -CRYPTOPP_DLL Integer CRYPTOPP_API Lucas(const Integer &e, const Integer &p, const Integer &n); -// calculates x such that m==Lucas(e, x, p*q), p q primes, u=inverse of p mod q -CRYPTOPP_DLL Integer CRYPTOPP_API InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u); - -inline Integer ModularExponentiation(const Integer &a, const Integer &e, const Integer &m) - {return a_exp_b_mod_c(a, e, m);} -// returns x such that x*x%p == a, p prime -CRYPTOPP_DLL Integer CRYPTOPP_API ModularSquareRoot(const Integer &a, const Integer &p); -// returns x such that a==ModularExponentiation(x, e, p*q), p q primes, -// and e relatively prime to (p-1)*(q-1) -// dp=d%(p-1), dq=d%(q-1), (d is inverse of e mod (p-1)*(q-1)) -// and u=inverse of p mod q -CRYPTOPP_DLL Integer CRYPTOPP_API ModularRoot(const Integer &a, const Integer &dp, const Integer &dq, const Integer &p, const Integer &q, const Integer &u); - -// find r1 and r2 such that ax^2 + bx + c == 0 (mod p) for x in {r1, r2}, p prime -// returns true if solutions exist -CRYPTOPP_DLL bool CRYPTOPP_API SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, const Integer &b, const Integer &c, const Integer &p); - -// returns log base 2 of estimated number of operations to calculate discrete log or factor a number -CRYPTOPP_DLL unsigned int CRYPTOPP_API DiscreteLogWorkFactor(unsigned int bitlength); -CRYPTOPP_DLL unsigned int CRYPTOPP_API FactoringWorkFactor(unsigned int bitlength); - -// ******************************************************** - -//! generator of prime numbers of special forms -class CRYPTOPP_DLL PrimeAndGenerator -{ -public: - PrimeAndGenerator() {} - // generate a random prime p of the form 2*q+delta, where delta is 1 or -1 and q is also prime - // Precondition: pbits > 5 - // warning: this is slow, because primes of this form are harder to find - PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits) - {Generate(delta, rng, pbits, pbits-1);} - // generate a random prime p of the form 2*r*q+delta, where q is also prime - // Precondition: qbits > 4 && pbits > qbits - PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits) - {Generate(delta, rng, pbits, qbits);} - - void Generate(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits); - - const Integer& Prime() const {return p;} - const Integer& SubPrime() const {return q;} - const Integer& Generator() const {return g;} - -private: - Integer p, q, g; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/network.cpp b/external/crypto++-5.6.3/network.cpp deleted file mode 100644 index 448837a75..000000000 --- a/external/crypto++-5.6.3/network.cpp +++ /dev/null @@ -1,553 +0,0 @@ -// network.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "network.h" -#include "wait.h" - -#define CRYPTOPP_TRACE_NETWORK 0 - -NAMESPACE_BEGIN(CryptoPP) - -#ifdef HIGHRES_TIMER_AVAILABLE - -lword LimitedBandwidth::ComputeCurrentTransceiveLimit() -{ - if (!m_maxBytesPerSecond) - return ULONG_MAX; - - const double curTime = GetCurTimeAndCleanUp(); - CRYPTOPP_UNUSED(curTime); - - lword total = 0; - for (OpQueue::size_type i=0; i!=m_ops.size(); ++i) - total += m_ops[i].second; - return SaturatingSubtract(m_maxBytesPerSecond, total); -} - -double LimitedBandwidth::TimeToNextTransceive() -{ - if (!m_maxBytesPerSecond) - return 0; - - if (!m_nextTransceiveTime) - ComputeNextTransceiveTime(); - - return SaturatingSubtract(m_nextTransceiveTime, m_timer.ElapsedTimeAsDouble()); -} - -void LimitedBandwidth::NoteTransceive(lword size) -{ - if (m_maxBytesPerSecond) - { - double curTime = GetCurTimeAndCleanUp(); - m_ops.push_back(std::make_pair(curTime, size)); - m_nextTransceiveTime = 0; - } -} - -void LimitedBandwidth::ComputeNextTransceiveTime() -{ - double curTime = GetCurTimeAndCleanUp(); - lword total = 0; - for (unsigned int i=0; i!=m_ops.size(); ++i) - total += m_ops[i].second; - m_nextTransceiveTime = - (total < m_maxBytesPerSecond) ? curTime : m_ops.front().first + 1000; -} - -double LimitedBandwidth::GetCurTimeAndCleanUp() -{ - if (!m_maxBytesPerSecond) - return 0; - - double curTime = m_timer.ElapsedTimeAsDouble(); - while (m_ops.size() && (m_ops.front().first + 1000 < curTime)) - m_ops.pop_front(); - return curTime; -} - -void LimitedBandwidth::GetWaitObjects(WaitObjectContainer &container, const CallStack &callStack) -{ - double nextTransceiveTime = TimeToNextTransceive(); - if (nextTransceiveTime) - container.ScheduleEvent(nextTransceiveTime, CallStack("LimitedBandwidth::GetWaitObjects()", &callStack)); -} - -// ************************************************************* - -size_t NonblockingSource::GeneralPump2( - lword& byteCount, bool blockingOutput, - unsigned long maxTime, bool checkDelimiter, byte delimiter) -{ - m_blockedBySpeedLimit = false; - - if (!GetMaxBytesPerSecond()) - { - size_t ret = DoPump(byteCount, blockingOutput, maxTime, checkDelimiter, delimiter); - m_doPumpBlocked = (ret != 0); - return ret; - } - - bool forever = (maxTime == INFINITE_TIME); - unsigned long timeToGo = maxTime; - Timer timer(Timer::MILLISECONDS, forever); - lword maxSize = byteCount; - byteCount = 0; - - timer.StartTimer(); - - while (true) - { - lword curMaxSize = UnsignedMin(ComputeCurrentTransceiveLimit(), maxSize - byteCount); - - if (curMaxSize || m_doPumpBlocked) - { - if (!forever) timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); - size_t ret = DoPump(curMaxSize, blockingOutput, timeToGo, checkDelimiter, delimiter); - m_doPumpBlocked = (ret != 0); - if (curMaxSize) - { - NoteTransceive(curMaxSize); - byteCount += curMaxSize; - } - if (ret) - return ret; - } - - if (maxSize != ULONG_MAX && byteCount >= maxSize) - break; - - if (!forever) - { - timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); - if (!timeToGo) - break; - } - - double waitTime = TimeToNextTransceive(); - if (!forever && waitTime > timeToGo) - { - m_blockedBySpeedLimit = true; - break; - } - - WaitObjectContainer container; - LimitedBandwidth::GetWaitObjects(container, CallStack("NonblockingSource::GeneralPump2() - speed limit", 0)); - container.Wait((unsigned long)waitTime); - } - - return 0; -} - -size_t NonblockingSource::PumpMessages2(unsigned int &messageCount, bool blocking) -{ - if (messageCount == 0) - return 0; - - messageCount = 0; - - lword byteCount; - do { - byteCount = LWORD_MAX; - RETURN_IF_NONZERO(Pump2(byteCount, blocking)); - } while(byteCount == LWORD_MAX); - - if (!m_messageEndSent && SourceExhausted()) - { - RETURN_IF_NONZERO(AttachedTransformation()->Put2(NULL, 0, GetAutoSignalPropagation(), true)); - m_messageEndSent = true; - messageCount = 1; - } - return 0; -} - -lword NonblockingSink::TimedFlush(unsigned long maxTime, size_t targetSize) -{ - m_blockedBySpeedLimit = false; - - size_t curBufSize = GetCurrentBufferSize(); - if (curBufSize <= targetSize && (targetSize || !EofPending())) - return 0; - - if (!GetMaxBytesPerSecond()) - return DoFlush(maxTime, targetSize); - - bool forever = (maxTime == INFINITE_TIME); - unsigned long timeToGo = maxTime; - Timer timer(Timer::MILLISECONDS, forever); - lword totalFlushed = 0; - - timer.StartTimer(); - - while (true) - { - size_t flushSize = UnsignedMin(curBufSize - targetSize, ComputeCurrentTransceiveLimit()); - if (flushSize || EofPending()) - { - if (!forever) timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); - size_t ret = (size_t)DoFlush(timeToGo, curBufSize - flushSize); - if (ret) - { - NoteTransceive(ret); - curBufSize -= ret; - totalFlushed += ret; - } - } - - if (curBufSize <= targetSize && (targetSize || !EofPending())) - break; - - if (!forever) - { - timeToGo = SaturatingSubtract(maxTime, timer.ElapsedTime()); - if (!timeToGo) - break; - } - - double waitTime = TimeToNextTransceive(); - if (!forever && waitTime > timeToGo) - { - m_blockedBySpeedLimit = true; - break; - } - - WaitObjectContainer container; - LimitedBandwidth::GetWaitObjects(container, CallStack("NonblockingSink::TimedFlush() - speed limit", 0)); - container.Wait((unsigned long)waitTime); - } - - return totalFlushed; -} - -bool NonblockingSink::IsolatedFlush(bool hardFlush, bool blocking) -{ - TimedFlush(blocking ? INFINITE_TIME : 0); - return hardFlush && (!!GetCurrentBufferSize() || EofPending()); -} - -// ************************************************************* - -NetworkSource::NetworkSource(BufferedTransformation *attachment) - : NonblockingSource(attachment), m_buf(1024*16) - , m_putSize(0), m_dataBegin(0), m_dataEnd(0) - , m_waitingForResult(false), m_outputBlocked(false) -{ -} - -unsigned int NetworkSource::GetMaxWaitObjectCount() const -{ - return LimitedBandwidth::GetMaxWaitObjectCount() - + GetReceiver().GetMaxWaitObjectCount() - + AttachedTransformation()->GetMaxWaitObjectCount(); -} - -void NetworkSource::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (BlockedBySpeedLimit()) - LimitedBandwidth::GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - speed limit", &callStack)); - else if (!m_outputBlocked) - { - if (m_dataBegin == m_dataEnd) - AccessReceiver().GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - no data", &callStack)); - else - container.SetNoWait(CallStack("NetworkSource::GetWaitObjects() - have data", &callStack)); - } - - AttachedTransformation()->GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - attachment", &callStack)); -} - -size_t NetworkSource::DoPump(lword &byteCount, bool blockingOutput, unsigned long maxTime, bool checkDelimiter, byte delimiter) -{ - NetworkReceiver &receiver = AccessReceiver(); - - lword maxSize = byteCount; - byteCount = 0; - bool forever = maxTime == INFINITE_TIME; - Timer timer(Timer::MILLISECONDS, forever); - BufferedTransformation *t = AttachedTransformation(); - - if (m_outputBlocked) - goto DoOutput; - - while (true) - { - if (m_dataBegin == m_dataEnd) - { - if (receiver.EofReceived()) - break; - - if (m_waitingForResult) - { - if (receiver.MustWaitForResult() && - !receiver.Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), - CallStack("NetworkSource::DoPump() - wait receive result", 0))) - break; - - unsigned int recvResult = receiver.GetReceiveResult(); -#if CRYPTOPP_TRACE_NETWORK - OutputDebugString((IntToString((unsigned int)this) + ": Received " + IntToString(recvResult) + " bytes\n").c_str()); -#endif - m_dataEnd += recvResult; - m_waitingForResult = false; - - if (!receiver.MustWaitToReceive() && !receiver.EofReceived() && m_dataEnd != m_buf.size()) - goto ReceiveNoWait; - } - else - { - m_dataEnd = m_dataBegin = 0; - - if (receiver.MustWaitToReceive()) - { - if (!receiver.Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), - CallStack("NetworkSource::DoPump() - wait receive", 0))) - break; - - receiver.Receive(m_buf+m_dataEnd, m_buf.size()-m_dataEnd); - m_waitingForResult = true; - } - else - { -ReceiveNoWait: - m_waitingForResult = true; - // call Receive repeatedly as long as data is immediately available, - // because some receivers tend to return data in small pieces -#if CRYPTOPP_TRACE_NETWORK - OutputDebugString((IntToString((unsigned int)this) + ": Receiving " + IntToString(m_buf.size()-m_dataEnd) + " bytes\n").c_str()); -#endif - while (receiver.Receive(m_buf+m_dataEnd, m_buf.size()-m_dataEnd)) - { - unsigned int recvResult = receiver.GetReceiveResult(); -#if CRYPTOPP_TRACE_NETWORK - OutputDebugString((IntToString((unsigned int)this) + ": Received " + IntToString(recvResult) + " bytes\n").c_str()); -#endif - m_dataEnd += recvResult; - if (receiver.EofReceived() || m_dataEnd > m_buf.size() /2) - { - m_waitingForResult = false; - break; - } - } - } - } - } - else - { - m_putSize = UnsignedMin(m_dataEnd - m_dataBegin, maxSize - byteCount); - - if (checkDelimiter) - m_putSize = std::find(m_buf+m_dataBegin, m_buf+m_dataBegin+m_putSize, delimiter) - (m_buf+m_dataBegin); - -DoOutput: - size_t result = t->PutModifiable2(m_buf+m_dataBegin, m_putSize, 0, forever || blockingOutput); - if (result) - { - if (t->Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), - CallStack("NetworkSource::DoPump() - wait attachment", 0))) - goto DoOutput; - else - { - m_outputBlocked = true; - return result; - } - } - m_outputBlocked = false; - - byteCount += m_putSize; - m_dataBegin += m_putSize; - if (checkDelimiter && m_dataBegin < m_dataEnd && m_buf[m_dataBegin] == delimiter) - break; - if (maxSize != ULONG_MAX && byteCount == maxSize) - break; - // once time limit is reached, return even if there is more data waiting - // but make 0 a special case so caller can request a large amount of data to be - // pumped as long as it is immediately available - if (maxTime > 0 && timer.ElapsedTime() > maxTime) - break; - } - } - - return 0; -} - -// ************************************************************* - -NetworkSink::NetworkSink(unsigned int maxBufferSize, unsigned int autoFlushBound) - : m_maxBufferSize(maxBufferSize), m_autoFlushBound(autoFlushBound) - , m_needSendResult(false), m_wasBlocked(false), m_eofState(EOF_NONE) - , m_buffer(STDMIN(16U*1024U+256, maxBufferSize)), m_skipBytes(0) - , m_speedTimer(Timer::MILLISECONDS), m_byteCountSinceLastTimerReset(0) - , m_currentSpeed(0), m_maxObservedSpeed(0) -{ -} - -float NetworkSink::ComputeCurrentSpeed() -{ - if (m_speedTimer.ElapsedTime() > 1000) - { - m_currentSpeed = m_byteCountSinceLastTimerReset * 1000 / m_speedTimer.ElapsedTime(); - m_maxObservedSpeed = STDMAX(m_currentSpeed, m_maxObservedSpeed * 0.98f); - m_byteCountSinceLastTimerReset = 0; - m_speedTimer.StartTimer(); -// OutputDebugString(("max speed: " + IntToString((int)m_maxObservedSpeed) + " current speed: " + IntToString((int)m_currentSpeed) + "\n").c_str()); - } - return m_currentSpeed; -} - -float NetworkSink::GetMaxObservedSpeed() const -{ - lword m = GetMaxBytesPerSecond(); - return m ? STDMIN(m_maxObservedSpeed, float(CRYPTOPP_VC6_INT64 m)) : m_maxObservedSpeed; -} - -unsigned int NetworkSink::GetMaxWaitObjectCount() const -{ - return LimitedBandwidth::GetMaxWaitObjectCount() + GetSender().GetMaxWaitObjectCount(); -} - -void NetworkSink::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (BlockedBySpeedLimit()) - LimitedBandwidth::GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - speed limit", &callStack)); - else if (m_wasBlocked) - AccessSender().GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - was blocked", &callStack)); - else if (!m_buffer.IsEmpty()) - AccessSender().GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - buffer not empty", &callStack)); - else if (EofPending()) - AccessSender().GetWaitObjects(container, CallStack("NetworkSink::GetWaitObjects() - EOF pending", &callStack)); -} - -size_t NetworkSink::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) -{ - if (m_eofState == EOF_DONE) - { - if (length || messageEnd) - throw Exception(Exception::OTHER_ERROR, "NetworkSink::Put2() being called after EOF had been sent"); - - return 0; - } - - if (m_eofState > EOF_NONE) - goto EofSite; - - { - if (m_skipBytes) - { - assert(length >= m_skipBytes); - inString += m_skipBytes; - length -= m_skipBytes; - } - - m_buffer.Put(inString, length); - - if (!blocking || m_buffer.CurrentSize() > m_autoFlushBound) - TimedFlush(0, 0); - - size_t targetSize = messageEnd ? 0 : m_maxBufferSize; - if (blocking) - TimedFlush(INFINITE_TIME, targetSize); - - if (m_buffer.CurrentSize() > targetSize) - { - assert(!blocking); - m_wasBlocked = true; - m_skipBytes += length; - size_t blockedBytes = UnsignedMin(length, m_buffer.CurrentSize() - targetSize); - return STDMAX(blockedBytes, 1); - } - - m_wasBlocked = false; - m_skipBytes = 0; - } - - if (messageEnd) - { - m_eofState = EOF_PENDING_SEND; - - EofSite: - TimedFlush(blocking ? INFINITE_TIME : 0, 0); - if (m_eofState != EOF_DONE) - return 1; - } - - return 0; -} - -lword NetworkSink::DoFlush(unsigned long maxTime, size_t targetSize) -{ - NetworkSender &sender = AccessSender(); - - bool forever = maxTime == INFINITE_TIME; - Timer timer(Timer::MILLISECONDS, forever); - unsigned int totalFlushSize = 0; - - while (true) - { - if (m_buffer.CurrentSize() <= targetSize) - break; - - if (m_needSendResult) - { - if (sender.MustWaitForResult() && - !sender.Wait(SaturatingSubtract(maxTime, timer.ElapsedTime()), - CallStack("NetworkSink::DoFlush() - wait send result", 0))) - break; - - unsigned int sendResult = sender.GetSendResult(); -#if CRYPTOPP_TRACE_NETWORK - OutputDebugString((IntToString((unsigned int)this) + ": Sent " + IntToString(sendResult) + " bytes\n").c_str()); -#endif - m_buffer.Skip(sendResult); - totalFlushSize += sendResult; - m_needSendResult = false; - - if (!m_buffer.AnyRetrievable()) - break; - } - - unsigned long timeOut = maxTime ? SaturatingSubtract(maxTime, timer.ElapsedTime()) : 0; - if (sender.MustWaitToSend() && !sender.Wait(timeOut, CallStack("NetworkSink::DoFlush() - wait send", 0))) - break; - - size_t contiguousSize = 0; - const byte *block = m_buffer.Spy(contiguousSize); - -#if CRYPTOPP_TRACE_NETWORK - OutputDebugString((IntToString((unsigned int)this) + ": Sending " + IntToString(contiguousSize) + " bytes\n").c_str()); -#endif - sender.Send(block, contiguousSize); - m_needSendResult = true; - - if (maxTime > 0 && timeOut == 0) - break; // once time limit is reached, return even if there is more data waiting - } - - m_byteCountSinceLastTimerReset += totalFlushSize; - ComputeCurrentSpeed(); - - if (m_buffer.IsEmpty() && !m_needSendResult) - { - if (m_eofState == EOF_PENDING_SEND) - { - sender.SendEof(); - m_eofState = sender.MustWaitForEof() ? EOF_PENDING_DELIVERY : EOF_DONE; - } - - while (m_eofState == EOF_PENDING_DELIVERY) - { - unsigned long timeOut = maxTime ? SaturatingSubtract(maxTime, timer.ElapsedTime()) : 0; - if (!sender.Wait(timeOut, CallStack("NetworkSink::DoFlush() - wait EOF", 0))) - break; - - if (sender.EofSent()) - m_eofState = EOF_DONE; - } - } - - return totalFlushSize; -} - -#endif // #ifdef HIGHRES_TIMER_AVAILABLE - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/network.h b/external/crypto++-5.6.3/network.h deleted file mode 100644 index 96cd4567e..000000000 --- a/external/crypto++-5.6.3/network.h +++ /dev/null @@ -1,235 +0,0 @@ -#ifndef CRYPTOPP_NETWORK_H -#define CRYPTOPP_NETWORK_H - -#include "config.h" - -#ifdef HIGHRES_TIMER_AVAILABLE - -#include "filters.h" -#include "hrtimer.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -class LimitedBandwidth -{ -public: - LimitedBandwidth(lword maxBytesPerSecond = 0) - : m_maxBytesPerSecond(maxBytesPerSecond), m_timer(Timer::MILLISECONDS) - , m_nextTransceiveTime(0) - { m_timer.StartTimer(); } - - lword GetMaxBytesPerSecond() const - { return m_maxBytesPerSecond; } - - void SetMaxBytesPerSecond(lword v) - { m_maxBytesPerSecond = v; } - - lword ComputeCurrentTransceiveLimit(); - - double TimeToNextTransceive(); - - void NoteTransceive(lword size); - -public: - /*! GetWaitObjects() must be called despite the 0 return from GetMaxWaitObjectCount(); - the 0 is because the ScheduleEvent() method is used instead of adding a wait object */ - unsigned int GetMaxWaitObjectCount() const { return 0; } - void GetWaitObjects(WaitObjectContainer &container, const CallStack &callStack); - -private: - lword m_maxBytesPerSecond; - - typedef std::deque > OpQueue; - OpQueue m_ops; - - Timer m_timer; - double m_nextTransceiveTime; - - void ComputeNextTransceiveTime(); - double GetCurTimeAndCleanUp(); -}; - -//! a Source class that can pump from a device for a specified amount of time. -class CRYPTOPP_NO_VTABLE NonblockingSource : public AutoSignaling, public LimitedBandwidth -{ -public: - NonblockingSource(BufferedTransformation *attachment) - : m_messageEndSent(false) , m_doPumpBlocked(false), m_blockedBySpeedLimit(false) {Detach(attachment);} - - //! \name NONBLOCKING SOURCE - //@{ - - //! pump up to maxSize bytes using at most maxTime milliseconds - /*! If checkDelimiter is true, pump up to delimiter, which itself is not extracted or pumped. */ - size_t GeneralPump2(lword &byteCount, bool blockingOutput=true, unsigned long maxTime=INFINITE_TIME, bool checkDelimiter=false, byte delimiter='\n'); - - lword GeneralPump(lword maxSize=LWORD_MAX, unsigned long maxTime=INFINITE_TIME, bool checkDelimiter=false, byte delimiter='\n') - { - GeneralPump2(maxSize, true, maxTime, checkDelimiter, delimiter); - return maxSize; - } - lword TimedPump(unsigned long maxTime) - {return GeneralPump(LWORD_MAX, maxTime);} - lword PumpLine(byte delimiter='\n', lword maxSize=1024) - {return GeneralPump(maxSize, INFINITE_TIME, true, delimiter);} - - size_t Pump2(lword &byteCount, bool blocking=true) - {return GeneralPump2(byteCount, blocking, blocking ? INFINITE_TIME : 0);} - size_t PumpMessages2(unsigned int &messageCount, bool blocking=true); - //@} - -protected: - virtual size_t DoPump(lword &byteCount, bool blockingOutput, - unsigned long maxTime, bool checkDelimiter, byte delimiter) =0; - - bool BlockedBySpeedLimit() const { return m_blockedBySpeedLimit; } - -private: - bool m_messageEndSent, m_doPumpBlocked, m_blockedBySpeedLimit; -}; - -//! Network Receiver -class CRYPTOPP_NO_VTABLE NetworkReceiver : public Waitable -{ -public: - virtual bool MustWaitToReceive() {return false;} - virtual bool MustWaitForResult() {return false;} - //! receive data from network source, returns whether result is immediately available - virtual bool Receive(byte* buf, size_t bufLen) =0; - virtual unsigned int GetReceiveResult() =0; - virtual bool EofReceived() const =0; -}; - -class CRYPTOPP_NO_VTABLE NonblockingSinkInfo -{ -public: - virtual ~NonblockingSinkInfo() {} - virtual size_t GetMaxBufferSize() const =0; - virtual size_t GetCurrentBufferSize() const =0; - virtual bool EofPending() const =0; - //! compute the current speed of this sink in bytes per second - virtual float ComputeCurrentSpeed() =0; - //! get the maximum observed speed of this sink in bytes per second - virtual float GetMaxObservedSpeed() const =0; -}; - -//! a Sink class that queues input and can flush to a device for a specified amount of time. -class CRYPTOPP_NO_VTABLE NonblockingSink : public Sink, public NonblockingSinkInfo, public LimitedBandwidth -{ -public: - NonblockingSink() : m_blockedBySpeedLimit(false) {} - - bool IsolatedFlush(bool hardFlush, bool blocking); - - //! flush to device for no more than maxTime milliseconds - /*! This function will repeatedly attempt to flush data to some device, until - the queue is empty, or a total of maxTime milliseconds have elapsed. - If maxTime == 0, at least one attempt will be made to flush some data, but - it is likely that not all queued data will be flushed, even if the device - is ready to receive more data without waiting. If you want to flush as much data - as possible without waiting for the device, call this function in a loop. - For example: while (sink.TimedFlush(0) > 0) {} - \return number of bytes flushed - */ - lword TimedFlush(unsigned long maxTime, size_t targetSize = 0); - - virtual void SetMaxBufferSize(size_t maxBufferSize) =0; - //! set a bound which will cause sink to flush if exceeded by GetCurrentBufferSize() - virtual void SetAutoFlushBound(size_t bound) =0; - -protected: - virtual lword DoFlush(unsigned long maxTime, size_t targetSize) = 0; - - bool BlockedBySpeedLimit() const { return m_blockedBySpeedLimit; } - -private: - bool m_blockedBySpeedLimit; -}; - -//! Network Sender -class CRYPTOPP_NO_VTABLE NetworkSender : public Waitable -{ -public: - virtual bool MustWaitToSend() {return false;} - virtual bool MustWaitForResult() {return false;} - virtual void Send(const byte* buf, size_t bufLen) =0; - virtual unsigned int GetSendResult() =0; - virtual bool MustWaitForEof() {return false;} - virtual void SendEof() =0; - virtual bool EofSent() {return false;} // implement if MustWaitForEof() == true -}; - -//! Network Source -class CRYPTOPP_NO_VTABLE NetworkSource : public NonblockingSource -{ -public: - NetworkSource(BufferedTransformation *attachment); - - unsigned int GetMaxWaitObjectCount() const; - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - - bool SourceExhausted() const {return m_dataBegin == m_dataEnd && GetReceiver().EofReceived();} - -protected: - size_t DoPump(lword &byteCount, bool blockingOutput, unsigned long maxTime, bool checkDelimiter, byte delimiter); - - virtual NetworkReceiver & AccessReceiver() =0; - const NetworkReceiver & GetReceiver() const {return const_cast(this)->AccessReceiver();} - -private: - SecByteBlock m_buf; - size_t m_putSize, m_dataBegin, m_dataEnd; - bool m_waitingForResult, m_outputBlocked; -}; - -//! Network Sink -class CRYPTOPP_NO_VTABLE NetworkSink : public NonblockingSink -{ -public: - NetworkSink(unsigned int maxBufferSize, unsigned int autoFlushBound); - - unsigned int GetMaxWaitObjectCount() const; - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - - void SetMaxBufferSize(size_t maxBufferSize) {m_maxBufferSize = maxBufferSize; m_buffer.SetNodeSize(UnsignedMin(maxBufferSize, 16U*1024U+256U));} - void SetAutoFlushBound(size_t bound) {m_autoFlushBound = bound;} - - size_t GetMaxBufferSize() const {return m_maxBufferSize;} - size_t GetCurrentBufferSize() const {return (size_t)m_buffer.CurrentSize();} - - void ClearBuffer() { m_buffer.Clear(); } - - bool EofPending() const { return m_eofState > EOF_NONE && m_eofState < EOF_DONE; } - - //! compute the current speed of this sink in bytes per second - float ComputeCurrentSpeed(); - //! get the maximum observed speed of this sink in bytes per second - float GetMaxObservedSpeed() const; - -protected: - lword DoFlush(unsigned long maxTime, size_t targetSize); - - virtual NetworkSender & AccessSender() =0; - const NetworkSender & GetSender() const {return const_cast(this)->AccessSender();} - -private: - enum EofState { EOF_NONE, EOF_PENDING_SEND, EOF_PENDING_DELIVERY, EOF_DONE }; - - size_t m_maxBufferSize, m_autoFlushBound; - bool m_needSendResult, m_wasBlocked; - EofState m_eofState; - ByteQueue m_buffer; - size_t m_skipBytes; - Timer m_speedTimer; - float m_byteCountSinceLastTimerReset, m_currentSpeed, m_maxObservedSpeed; -}; - -NAMESPACE_END - -#endif // #ifdef HIGHRES_TIMER_AVAILABLE - -#endif diff --git a/external/crypto++-5.6.3/nr.h b/external/crypto++-5.6.3/nr.h deleted file mode 100644 index c398e3550..000000000 --- a/external/crypto++-5.6.3/nr.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CRYPTOPP_NR_H -#define CRYPTOPP_NR_H - -#include "gfpcrypt.h" - -#endif diff --git a/external/crypto++-5.6.3/oaep.cpp b/external/crypto++-5.6.3/oaep.cpp deleted file mode 100644 index 55625cbdd..000000000 --- a/external/crypto++-5.6.3/oaep.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// oaep.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "oaep.h" -#include "stdcpp.h" -#include "smartptr.h" - -NAMESPACE_BEGIN(CryptoPP) - -// ******************************************************** - -size_t OAEP_Base::MaxUnpaddedLength(size_t paddedLength) const -{ - return SaturatingSubtract(paddedLength/8, 1+2*DigestSize()); -} - -void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputLength, byte *oaepBlock, size_t oaepBlockLen, const NameValuePairs ¶meters) const -{ - assert (inputLength <= MaxUnpaddedLength(oaepBlockLen)); - - // convert from bit length to byte length - if (oaepBlockLen % 8 != 0) - { - oaepBlock[0] = 0; - oaepBlock++; - } - oaepBlockLen /= 8; - - member_ptr pHash(NewHash()); - const size_t hLen = pHash->DigestSize(); - const size_t seedLen = hLen, dbLen = oaepBlockLen-seedLen; - byte *const maskedSeed = oaepBlock; - byte *const maskedDB = oaepBlock+seedLen; - - ConstByteArrayParameter encodingParameters; - parameters.GetValue(Name::EncodingParameters(), encodingParameters); - - // DB = pHash || 00 ... || 01 || M - pHash->CalculateDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()); - memset(maskedDB+hLen, 0, dbLen-hLen-inputLength-1); - maskedDB[dbLen-inputLength-1] = 0x01; - memcpy(maskedDB+dbLen-inputLength, input, inputLength); - - rng.GenerateBlock(maskedSeed, seedLen); - member_ptr pMGF(NewMGF()); - pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen); - pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen); -} - -DecodingResult OAEP_Base::Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte *output, const NameValuePairs ¶meters) const -{ - bool invalid = false; - - // convert from bit length to byte length - if (oaepBlockLen % 8 != 0) - { - invalid = (oaepBlock[0] != 0) || invalid; - oaepBlock++; - } - oaepBlockLen /= 8; - - member_ptr pHash(NewHash()); - const size_t hLen = pHash->DigestSize(); - const size_t seedLen = hLen, dbLen = oaepBlockLen-seedLen; - - invalid = (oaepBlockLen < 2*hLen+1) || invalid; - - SecByteBlock t(oaepBlock, oaepBlockLen); - byte *const maskedSeed = t; - byte *const maskedDB = t+seedLen; - - member_ptr pMGF(NewMGF()); - pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen); - pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen); - - ConstByteArrayParameter encodingParameters; - parameters.GetValue(Name::EncodingParameters(), encodingParameters); - - // DB = pHash' || 00 ... || 01 || M - byte *M = std::find(maskedDB+hLen, maskedDB+dbLen, 0x01); - invalid = (M == maskedDB+dbLen) || invalid; - invalid = (std::find_if(maskedDB+hLen, M, std::bind2nd(std::not_equal_to(), byte(0))) != M) || invalid; - invalid = !pHash->VerifyDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()) || invalid; - - if (invalid) - return DecodingResult(); - - M++; - memcpy(output, M, maskedDB+dbLen-M); - return DecodingResult(maskedDB+dbLen-M); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/oaep.h b/external/crypto++-5.6.3/oaep.h deleted file mode 100644 index a1c2d74a3..000000000 --- a/external/crypto++-5.6.3/oaep.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef CRYPTOPP_OAEP_H -#define CRYPTOPP_OAEP_H - -#include "cryptlib.h" -#include "pubkey.h" -#include "sha.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class CRYPTOPP_DLL OAEP_Base : public PK_EncryptionMessageEncodingMethod -{ -public: - bool ParameterSupported(const char *name) const {return strcmp(name, Name::EncodingParameters()) == 0;} - size_t MaxUnpaddedLength(size_t paddedLength) const; - void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedLength, const NameValuePairs ¶meters) const; - DecodingResult Unpad(const byte *padded, size_t paddedLength, byte *raw, const NameValuePairs ¶meters) const; - -protected: - virtual unsigned int DigestSize() const =0; - virtual HashTransformation * NewHash() const =0; - virtual MaskGeneratingFunction * NewMGF() const =0; -}; - -//! EME-OAEP, for use with classes derived from TF_ES -template -class OAEP : public OAEP_Base, public EncryptionStandard -{ -public: - static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string("OAEP-") + MGF::StaticAlgorithmName() + "(" + H::StaticAlgorithmName() + ")";} - typedef OAEP EncryptionMessageEncodingMethod; - -protected: - unsigned int DigestSize() const {return H::DIGESTSIZE;} - HashTransformation * NewHash() const {return new H;} - MaskGeneratingFunction * NewMGF() const {return new MGF;} -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS OAEP; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/oids.h b/external/crypto++-5.6.3/oids.h deleted file mode 100644 index 961fb82e0..000000000 --- a/external/crypto++-5.6.3/oids.h +++ /dev/null @@ -1,129 +0,0 @@ -// oids.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile oids.h -//! \brief Object identifiers for algorthms and schemes - -#ifndef CRYPTOPP_OIDS_H -#define CRYPTOPP_OIDS_H - -// crypto-related ASN.1 object identifiers - -#include "asn.h" - -NAMESPACE_BEGIN(CryptoPP) - -NAMESPACE_BEGIN(ASN1) - -#define DEFINE_OID(value, name) inline OID name() {return value;} - -DEFINE_OID(1, iso) - DEFINE_OID(iso()+2, member_body) - DEFINE_OID(member_body()+840, iso_us) - DEFINE_OID(iso_us()+10040, ansi_x9_57) - DEFINE_OID(ansi_x9_57()+4+1, id_dsa) - DEFINE_OID(iso_us()+10045, ansi_x9_62) - DEFINE_OID(ansi_x9_62()+1, id_fieldType) - DEFINE_OID(id_fieldType()+1, prime_field) - DEFINE_OID(id_fieldType()+2, characteristic_two_field) - DEFINE_OID(characteristic_two_field()+3, id_characteristic_two_basis) - DEFINE_OID(id_characteristic_two_basis()+1, gnBasis) - DEFINE_OID(id_characteristic_two_basis()+2, tpBasis) - DEFINE_OID(id_characteristic_two_basis()+3, ppBasis) - DEFINE_OID(ansi_x9_62()+2, id_publicKeyType) - DEFINE_OID(id_publicKeyType()+1, id_ecPublicKey) - DEFINE_OID(ansi_x9_62()+3, ansi_x9_62_curves) - DEFINE_OID(ansi_x9_62_curves()+1, ansi_x9_62_curves_prime) - DEFINE_OID(ansi_x9_62_curves_prime()+1, secp192r1) - DEFINE_OID(ansi_x9_62_curves_prime()+7, secp256r1) - DEFINE_OID(iso_us()+113549, rsadsi) - DEFINE_OID(rsadsi()+1, pkcs) - DEFINE_OID(pkcs()+1, pkcs_1) - DEFINE_OID(pkcs_1()+1, rsaEncryption); - DEFINE_OID(rsadsi()+2, rsadsi_digestAlgorithm) - DEFINE_OID(rsadsi_digestAlgorithm()+2, id_md2) - DEFINE_OID(rsadsi_digestAlgorithm()+5, id_md5) - DEFINE_OID(iso()+3, identified_organization); - DEFINE_OID(identified_organization()+14, oiw); - DEFINE_OID(oiw()+3, oiw_secsig); - DEFINE_OID(oiw_secsig()+2, oiw_secsig_algorithms); - DEFINE_OID(oiw_secsig_algorithms()+26, id_sha1); - - DEFINE_OID(identified_organization()+36, teletrust); - DEFINE_OID(teletrust()+3, teletrust_algorithm) - DEFINE_OID(teletrust_algorithm()+2+1, id_ripemd160) - DEFINE_OID(teletrust_algorithm()+3+2+8+1, teletrust_ellipticCurve) - DEFINE_OID(teletrust_ellipticCurve()+1+1, brainpoolP160r1) - DEFINE_OID(teletrust_ellipticCurve()+1+3, brainpoolP192r1) - DEFINE_OID(teletrust_ellipticCurve()+1+5, brainpoolP224r1) - DEFINE_OID(teletrust_ellipticCurve()+1+7, brainpoolP256r1) - DEFINE_OID(teletrust_ellipticCurve()+1+9, brainpoolP320r1) - DEFINE_OID(teletrust_ellipticCurve()+1+11, brainpoolP384r1) - DEFINE_OID(teletrust_ellipticCurve()+1+13, brainpoolP512r1) - - DEFINE_OID(identified_organization()+132, certicom); - DEFINE_OID(certicom()+0, certicom_ellipticCurve); - // these are sorted by curve type and then by OID - // first curves based on GF(p) - DEFINE_OID(certicom_ellipticCurve()+6, secp112r1); - DEFINE_OID(certicom_ellipticCurve()+7, secp112r2); - DEFINE_OID(certicom_ellipticCurve()+8, secp160r1); - DEFINE_OID(certicom_ellipticCurve()+9, secp160k1); - DEFINE_OID(certicom_ellipticCurve()+10, secp256k1); - DEFINE_OID(certicom_ellipticCurve()+28, secp128r1); - DEFINE_OID(certicom_ellipticCurve()+29, secp128r2); - DEFINE_OID(certicom_ellipticCurve()+30, secp160r2); - DEFINE_OID(certicom_ellipticCurve()+31, secp192k1); - DEFINE_OID(certicom_ellipticCurve()+32, secp224k1); - DEFINE_OID(certicom_ellipticCurve()+33, secp224r1); - DEFINE_OID(certicom_ellipticCurve()+34, secp384r1); - DEFINE_OID(certicom_ellipticCurve()+35, secp521r1); - // then curves based on GF(2^n) - DEFINE_OID(certicom_ellipticCurve()+1, sect163k1); - DEFINE_OID(certicom_ellipticCurve()+2, sect163r1); - DEFINE_OID(certicom_ellipticCurve()+3, sect239k1); - DEFINE_OID(certicom_ellipticCurve()+4, sect113r1); - DEFINE_OID(certicom_ellipticCurve()+5, sect113r2); - DEFINE_OID(certicom_ellipticCurve()+15, sect163r2); - DEFINE_OID(certicom_ellipticCurve()+16, sect283k1); - DEFINE_OID(certicom_ellipticCurve()+17, sect283r1); - DEFINE_OID(certicom_ellipticCurve()+22, sect131r1); - DEFINE_OID(certicom_ellipticCurve()+23, sect131r2); - DEFINE_OID(certicom_ellipticCurve()+24, sect193r1); - DEFINE_OID(certicom_ellipticCurve()+25, sect193r2); - DEFINE_OID(certicom_ellipticCurve()+26, sect233k1); - DEFINE_OID(certicom_ellipticCurve()+27, sect233r1); - DEFINE_OID(certicom_ellipticCurve()+36, sect409k1); - DEFINE_OID(certicom_ellipticCurve()+37, sect409r1); - DEFINE_OID(certicom_ellipticCurve()+38, sect571k1); - DEFINE_OID(certicom_ellipticCurve()+39, sect571r1); -DEFINE_OID(2, joint_iso_ccitt) - DEFINE_OID(joint_iso_ccitt()+16, country) - DEFINE_OID(country()+840, joint_iso_ccitt_us) - DEFINE_OID(joint_iso_ccitt_us()+1, us_organization) - DEFINE_OID(us_organization()+101, us_gov) - DEFINE_OID(us_gov()+3, csor) - DEFINE_OID(csor()+4, nistalgorithms) - DEFINE_OID(nistalgorithms()+1, aes) - DEFINE_OID(aes()+1, id_aes128_ECB) - DEFINE_OID(aes()+2, id_aes128_cbc) - DEFINE_OID(aes()+3, id_aes128_ofb) - DEFINE_OID(aes()+4, id_aes128_cfb) - DEFINE_OID(aes()+21, id_aes192_ECB) - DEFINE_OID(aes()+22, id_aes192_cbc) - DEFINE_OID(aes()+23, id_aes192_ofb) - DEFINE_OID(aes()+24, id_aes192_cfb) - DEFINE_OID(aes()+41, id_aes256_ECB) - DEFINE_OID(aes()+42, id_aes256_cbc) - DEFINE_OID(aes()+43, id_aes256_ofb) - DEFINE_OID(aes()+44, id_aes256_cfb) - DEFINE_OID(nistalgorithms()+2, nist_hashalgs) - DEFINE_OID(nist_hashalgs()+1, id_sha256) - DEFINE_OID(nist_hashalgs()+2, id_sha384) - DEFINE_OID(nist_hashalgs()+3, id_sha512) - -NAMESPACE_END - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/osrng.cpp b/external/crypto++-5.6.3/osrng.cpp deleted file mode 100644 index f0cd6c49c..000000000 --- a/external/crypto++-5.6.3/osrng.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// osrng.cpp - written and placed in the public domain by Wei Dai - -// Thanks to Leonard Janke for the suggestion for AutoSeededRandomPool. - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "osrng.h" - -#ifdef OS_RNG_AVAILABLE - -#include "rng.h" - -#ifdef CRYPTOPP_WIN32_AVAILABLE -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0400 -#endif -#include -#include -#endif - -#ifdef CRYPTOPP_UNIX_AVAILABLE -#include -#include -#include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#if defined(NONBLOCKING_RNG_AVAILABLE) || defined(BLOCKING_RNG_AVAILABLE) -OS_RNG_Err::OS_RNG_Err(const std::string &operation) - : Exception(OTHER_ERROR, "OS_Rng: " + operation + " operation failed with error " + -#ifdef CRYPTOPP_WIN32_AVAILABLE - "0x" + IntToString(GetLastError(), 16) -#else - IntToString(errno) -#endif - ) -{ -} -#endif - -#ifdef NONBLOCKING_RNG_AVAILABLE - -#ifdef CRYPTOPP_WIN32_AVAILABLE - -MicrosoftCryptoProvider::MicrosoftCryptoProvider() -{ - //if(!CryptAcquireContext(&m_hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) - // throw OS_RNG_Err("CryptAcquireContext"); -} - -MicrosoftCryptoProvider::~MicrosoftCryptoProvider() -{ - //CryptReleaseContext(m_hProvider, 0); -} - -#endif - -NonblockingRng::NonblockingRng() -{ -#ifndef CRYPTOPP_WIN32_AVAILABLE - m_fd = open("/dev/urandom",O_RDONLY); - if (m_fd == -1) - throw OS_RNG_Err("open /dev/urandom"); -#endif -} - -NonblockingRng::~NonblockingRng() -{ -#ifndef CRYPTOPP_WIN32_AVAILABLE - close(m_fd); -#endif -} - -void NonblockingRng::GenerateBlock(byte *output, size_t size) -{ -#ifdef CRYPTOPP_WIN32_AVAILABLE -//# ifdef WORKAROUND_MS_BUG_Q258000 -// const MicrosoftCryptoProvider &m_Provider = Singleton().Ref(); -//# endif -// if (!CryptGenRandom(m_Provider.GetProviderHandle(), (DWORD)size, output)) -// throw OS_RNG_Err("CryptGenRandom"); - static BOOL (__stdcall * s_pfnRtlGenRandom)( PVOID, ULONG ) = 0; - if ( !s_pfnRtlGenRandom ) - { - HMODULE hModAdvApi = ::LoadLibraryA( "advapi32.dll" ); - if ( hModAdvApi ) - s_pfnRtlGenRandom = (BOOL(__stdcall*)(PVOID,ULONG)) GetProcAddress( hModAdvApi, "SystemFunction036" ); - } - _ReadWriteBarrier(); - if ( !s_pfnRtlGenRandom || s_pfnRtlGenRandom( output, size ) == 0 ) - throw OS_RNG_Err("RtlGenRandom"); -#else - while (size) - { - ssize_t len = read(m_fd, output, size); - - if (len < 0) - { - // /dev/urandom reads CAN give EAGAIN errors! (maybe EINTR as well) - if (errno != EINTR && errno != EAGAIN) - throw OS_RNG_Err("read /dev/urandom"); - - continue; - } - - output += len; - size -= len; - } -#endif -} - -#endif - -// ************************************************************* - -#ifdef BLOCKING_RNG_AVAILABLE - -#ifndef CRYPTOPP_BLOCKING_RNG_FILENAME -#ifdef __OpenBSD__ -#define CRYPTOPP_BLOCKING_RNG_FILENAME "/dev/srandom" -#else -#define CRYPTOPP_BLOCKING_RNG_FILENAME "/dev/random" -#endif -#endif - -BlockingRng::BlockingRng() -{ - m_fd = open(CRYPTOPP_BLOCKING_RNG_FILENAME,O_RDONLY); - if (m_fd == -1) - throw OS_RNG_Err("open " CRYPTOPP_BLOCKING_RNG_FILENAME); -} - -BlockingRng::~BlockingRng() -{ - close(m_fd); -} - -void BlockingRng::GenerateBlock(byte *output, size_t size) -{ - while (size) - { - // on some systems /dev/random will block until all bytes - // are available, on others it returns immediately - ssize_t len = read(m_fd, output, size); - if (len < 0) - { - // /dev/random reads CAN give EAGAIN errors! (maybe EINTR as well) - if (errno != EINTR && errno != EAGAIN) - throw OS_RNG_Err("read " CRYPTOPP_BLOCKING_RNG_FILENAME); - - continue; - } - - size -= len; - output += len; - if (size) - sleep(1); - } -} - -#endif - -// ************************************************************* - -void OS_GenerateRandomBlock(bool blocking, byte *output, size_t size) -{ -#ifdef NONBLOCKING_RNG_AVAILABLE - if (blocking) -#endif - { -#ifdef BLOCKING_RNG_AVAILABLE - BlockingRng rng; - rng.GenerateBlock(output, size); -#endif - } - -#ifdef BLOCKING_RNG_AVAILABLE - if (!blocking) -#endif - { -#ifdef NONBLOCKING_RNG_AVAILABLE - NonblockingRng rng; - rng.GenerateBlock(output, size); -#endif - } -} - -void AutoSeededRandomPool::Reseed(bool blocking, unsigned int seedSize) -{ - SecByteBlock seed(seedSize); - OS_GenerateRandomBlock(blocking, seed, seedSize); - IncorporateEntropy(seed, seedSize); -} - -NAMESPACE_END - -#endif - -#endif diff --git a/external/crypto++-5.6.3/osrng.h b/external/crypto++-5.6.3/osrng.h deleted file mode 100644 index cb712ddb4..000000000 --- a/external/crypto++-5.6.3/osrng.h +++ /dev/null @@ -1,256 +0,0 @@ -// osrng.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile osrng.h -//! \brief Classes for access to the operating system's random number generators - -#ifndef CRYPTOPP_OSRNG_H -#define CRYPTOPP_OSRNG_H - -#include "config.h" - -#ifdef OS_RNG_AVAILABLE - -#include "cryptlib.h" -#include "randpool.h" -#include "smartptr.h" -#include "fips140.h" -#include "rng.h" -#include "aes.h" -#include "sha.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class OS_RNG_Err -//! \brief Exception thrown when an operating system error is encountered -class CRYPTOPP_DLL OS_RNG_Err : public Exception -{ -public: - //! \brief Constructs an OS_RNG_Err - //! \param operation the operation or API call when the error occurs - OS_RNG_Err(const std::string &operation); -}; - -#ifdef NONBLOCKING_RNG_AVAILABLE - -#ifdef CRYPTOPP_WIN32_AVAILABLE -//! \class MicrosoftCryptoProvider -//! \brief Wrapper for Microsoft crypto service provider -//! \sa \def USE_MS_CRYPTOAPI, \def WORKAROUND_MS_BUG_Q258000 -class CRYPTOPP_DLL MicrosoftCryptoProvider -{ -public: - //! \brief Construct a MicrosoftCryptoProvider - MicrosoftCryptoProvider(); - ~MicrosoftCryptoProvider(); - -// type HCRYPTPROV, avoid #include -#if defined(__CYGWIN__) && defined(__x86_64__) - typedef unsigned long long ProviderHandle; -#elif defined(WIN64) || defined(_WIN64) - typedef unsigned __int64 ProviderHandle; -#else - typedef unsigned long ProviderHandle; -#endif - - //! \brief Retrieves the CryptoAPI provider handle - //! \returns CryptoAPI provider handle - //! \details The handle is acquired by a call to CryptAcquireContext(). - //! CryptReleaseContext() is called upon destruction. - ProviderHandle GetProviderHandle() const {return m_hProvider;} - -private: - ProviderHandle m_hProvider; -}; - -#if defined(_MSC_VER) -# pragma comment(lib, "advapi32.lib") -#endif - -#endif //CRYPTOPP_WIN32_AVAILABLE - -//! \class NonblockingRng -//! \brief Wrapper class for /dev/random and /dev/srandom -//! \details Encapsulates CryptoAPI's CryptGenRandom() on Windows, or /dev/urandom on Unix and compatibles. -class CRYPTOPP_DLL NonblockingRng : public RandomNumberGenerator -{ -public: - //! \brief Construct a NonblockingRng - NonblockingRng(); - ~NonblockingRng(); - - //! \brief Generate random array of bytes - //! \param output the byte buffer - //! \param size the length of the buffer, in bytes - //! \details GenerateIntoBufferedTransformation() calls are routed to GenerateBlock(). - void GenerateBlock(byte *output, size_t size); - -protected: -#ifdef CRYPTOPP_WIN32_AVAILABLE -//# ifndef WORKAROUND_MS_BUG_Q258000 -// MicrosoftCryptoProvider m_Provider; -//# endif -#else - int m_fd; -#endif -}; - -#endif - -#if defined(BLOCKING_RNG_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) - -//! \class BlockingRng -//! \brief Wrapper class for /dev/random and /dev/srandom -//! \details Encapsulates /dev/random on Linux, OS X and Unix; and /dev/srandom on the BSDs. -class CRYPTOPP_DLL BlockingRng : public RandomNumberGenerator -{ -public: - //! \brief Construct a BlockingRng - BlockingRng(); - ~BlockingRng(); - - //! \brief Generate random array of bytes - //! \param output the byte buffer - //! \param size the length of the buffer, in bytes - //! \details GenerateIntoBufferedTransformation() calls are routed to GenerateBlock(). - void GenerateBlock(byte *output, size_t size); - -protected: - int m_fd; -}; - -#endif - -//! OS_GenerateRandomBlock -//! \brief Generate random array of bytes -//! \param blocking specifies whther a bobcking or non-blocking generator should be used -//! \param output the byte buffer -//! \param size the length of the buffer, in bytes -//! \details OS_GenerateRandomBlock() uses the underlying operating system's -//! random number generator. On Windows, CryptGenRandom() is called using NonblockingRng. -//! \details On Unix and compatibles, /dev/urandom is called if blocking is false using -//! NonblockingRng. If blocking is true, then either /dev/randomd or /dev/srandom is used -//! by way of BlockingRng, if available. -CRYPTOPP_DLL void CRYPTOPP_API OS_GenerateRandomBlock(bool blocking, byte *output, size_t size); - - -//! \class AutoSeededRandomPool -//! \brief Automatically Seeded Randomness Pool -//! \details This class seeds itself using an operating system provided RNG. -class CRYPTOPP_DLL AutoSeededRandomPool : public RandomPool -{ -public: - //! \brief Construct an AutoSeededRandomPool - //! \param blocking controls seeding with BlockingRng or NonblockingRng - //! \param seedSize the size of the seed, in bytes - //! \details Use blocking to choose seeding with BlockingRng or NonblockingRng. - //! The parameter is ignored if only one of these is available. - explicit AutoSeededRandomPool(bool blocking = false, unsigned int seedSize = 32) - {Reseed(blocking, seedSize);} - - //! \brief Reseed an AutoSeededRandomPool - //! \param blocking controls seeding with BlockingRng or NonblockingRng - //! \param seedSize the size of the seed, in bytes - void Reseed(bool blocking = false, unsigned int seedSize = 32); -}; - -//! \class AutoSeededX917RNG -//! \tparam BLOCK_CIPHER a block cipher -//! \brief Automatically Seeded X9.17 RNG -//! \details AutoSeededX917RNG is from ANSI X9.17 Appendix C, seeded using an OS provided RNG. -//! If 3-key TripleDES (DES_EDE3) is used, then its a X9.17 conforming generator. If AES is -//! used, then its a X9.31 conforming generator. -//! \details Though ANSI X9 prescribes 3-key TripleDES, the template parameter BLOCK_CIPHER can be any -//! BlockTransformation derived class. -//! \sa X917RNG, DefaultAutoSeededRNG -template -class AutoSeededX917RNG : public RandomNumberGenerator, public NotCopyable -{ -public: - //! \brief Construct an AutoSeededX917RNG - //! \param blocking controls seeding with BlockingRng or NonblockingRng - //! \param autoSeed controls auto seeding of the generator - //! \details Use blocking to choose seeding with BlockingRng or NonblockingRng. - //! The parameter is ignored if only one of these is available. - //! \sa X917RNG - explicit AutoSeededX917RNG(bool blocking = false, bool autoSeed = true) - {if (autoSeed) Reseed(blocking);} - - //! \brief Reseed an AutoSeededX917RNG - //! \param blocking controls seeding with BlockingRng or NonblockingRng - //! \param additionalEntropy additional entropy to add to the generator - //! \param length the size of the additional entropy, in bytes - //! \details Internally, the generator uses SHA256 to extract the entropy from - //! from the seed and then stretch the material for the block cipher's key - //! and initialization vector. - void Reseed(bool blocking = false, const byte *additionalEntropy = NULL, size_t length = 0); - - //! \brief Deterministically reseed an AutoSeededX917RNG for testing - //! \param key the key to use for the deterministic reseeding - //! \param keylength the size of the key, in bytes - //! \param seed the seed to use for the deterministic reseeding - //! \param timeVector a time vector to use for deterministic reseeding - //! \details This is a testing interface for testing purposes, and should \a NOT - //! be used in production. - void Reseed(const byte *key, size_t keylength, const byte *seed, const byte *timeVector); - - bool CanIncorporateEntropy() const {return true;} - void IncorporateEntropy(const byte *input, size_t length) {Reseed(false, input, length);} - void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length) - {m_rng->GenerateIntoBufferedTransformation(target, channel, length);} - -private: - member_ptr m_rng; -}; - -template -void AutoSeededX917RNG::Reseed(const byte *key, size_t keylength, const byte *seed, const byte *timeVector) -{ - m_rng.reset(new X917RNG(new typename BLOCK_CIPHER::Encryption(key, keylength), seed, timeVector)); -} - -template -void AutoSeededX917RNG::Reseed(bool blocking, const byte *input, size_t length) -{ - SecByteBlock seed(BLOCK_CIPHER::BLOCKSIZE + BLOCK_CIPHER::DEFAULT_KEYLENGTH); - const byte *key; - do - { - OS_GenerateRandomBlock(blocking, seed, seed.size()); - if (length > 0) - { - SHA256 hash; - hash.Update(seed, seed.size()); - hash.Update(input, length); - hash.TruncatedFinal(seed, UnsignedMin(hash.DigestSize(), seed.size())); - } - key = seed + BLOCK_CIPHER::BLOCKSIZE; - } // check that seed and key don't have same value - while (memcmp(key, seed, STDMIN((unsigned int)BLOCK_CIPHER::BLOCKSIZE, (unsigned int)BLOCK_CIPHER::DEFAULT_KEYLENGTH)) == 0); - - Reseed(key, BLOCK_CIPHER::DEFAULT_KEYLENGTH, seed, NULL); -} - -CRYPTOPP_DLL_TEMPLATE_CLASS AutoSeededX917RNG; - -#if defined(CRYPTOPP_DOXYGEN_PROCESSING) -//! \class DefaultAutoSeededRNG -//! \brief A typedef providing a default generator -//! \details DefaultAutoSeededRNG is a typedef of either AutoSeededX917RNG or AutoSeededRandomPool. -//! If CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined, then DefaultAutoSeededRNG is -//! AutoSeededX917RNG. Otherwise, DefaultAutoSeededRNG is AutoSeededRandomPool. -class DefaultAutoSeededRNG {} -#else -// AutoSeededX917RNG in FIPS mode, otherwise it's AutoSeededRandomPool -#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 -typedef AutoSeededX917RNG DefaultAutoSeededRNG; -#else -typedef AutoSeededRandomPool DefaultAutoSeededRNG; -#endif -#endif // CRYPTOPP_DOXYGEN_PROCESSING - -NAMESPACE_END - -#endif - -#endif diff --git a/external/crypto++-5.6.3/panama.cpp b/external/crypto++-5.6.3/panama.cpp deleted file mode 100644 index a4a53266a..000000000 --- a/external/crypto++-5.6.3/panama.cpp +++ /dev/null @@ -1,518 +0,0 @@ -// panama.cpp - written and placed in the public domain by Wei Dai - -// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM panama.cpp" to generate MASM code - -#include "pch.h" - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#include "panama.h" -#include "secblock.h" -#include "misc.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4731) -#endif - -template -void Panama::Reset() -{ - memset(m_state, 0, m_state.SizeInBytes()); -#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) - m_state[17] = HasSSSE3(); -#endif -} - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -void Panama_SSE2_Pull(size_t count, word32 *state, word32 *z, const word32 *y); -} -#elif CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) - -#ifdef CRYPTOPP_GENERATE_X64_MASM - Panama_SSE2_Pull PROC FRAME - rex_push_reg rdi - alloc_stack(2*16) - save_xmm128 xmm6, 0h - save_xmm128 xmm7, 10h - .endprolog -#else -void CRYPTOPP_NOINLINE Panama_SSE2_Pull(size_t count, word32 *state, word32 *z, const word32 *y) -{ -#if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) - asm __volatile__ - ( - INTEL_NOPREFIX - AS_PUSH_IF86( bx) -#else - AS2( mov AS_REG_1, count) - AS2( mov AS_REG_2, state) - AS2( mov AS_REG_3, z) - AS2( mov AS_REG_4, y) -#endif -#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM - -#if CRYPTOPP_BOOL_X32 - #define REG_loopEnd r8d -#elif CRYPTOPP_BOOL_X86 - #define REG_loopEnd [esp] -#elif defined(CRYPTOPP_GENERATE_X64_MASM) - #define REG_loopEnd rdi -#else - #define REG_loopEnd r8 -#endif - - AS2( shl AS_REG_1, 5) - ASJ( jz, 5, f) - AS2( mov AS_REG_6d, [AS_REG_2+4*17]) - AS2( add AS_REG_1, AS_REG_6) - - #if CRYPTOPP_BOOL_X64 - AS2( mov REG_loopEnd, AS_REG_1) - #else - AS_PUSH_IF86( bp) - // AS1( push AS_REG_1) // AS_REG_1 is defined as ecx uner X86 and X32 (see cpu.h) - AS_PUSH_IF86( cx) - #endif - - AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_2+0*16]) - AS2( movdqa xmm1, XMMWORD_PTR [AS_REG_2+1*16]) - AS2( movdqa xmm2, XMMWORD_PTR [AS_REG_2+2*16]) - AS2( movdqa xmm3, XMMWORD_PTR [AS_REG_2+3*16]) - AS2( mov eax, dword ptr [AS_REG_2+4*16]) - - ASL(4) - // gamma and pi -#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE - AS2( test AS_REG_6, 1) - ASJ( jnz, 6, f) -#endif - AS2( movdqa xmm6, xmm2) - AS2( movss xmm6, xmm3) - ASS( pshufd xmm5, xmm6, 0, 3, 2, 1) - AS2( movd xmm6, eax) - AS2( movdqa xmm7, xmm3) - AS2( movss xmm7, xmm6) - ASS( pshufd xmm6, xmm7, 0, 3, 2, 1) -#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE - ASJ( jmp, 7, f) - ASL(6) - AS2( movdqa xmm5, xmm3) - AS3( palignr xmm5, xmm2, 4) - AS2( movd xmm6, eax) - AS3( palignr xmm6, xmm3, 4) - ASL(7) -#endif - - AS2( movd AS_REG_1d, xmm2) - AS1( not AS_REG_1d) - AS2( movd AS_REG_7d, xmm3) - AS2( or AS_REG_1d, AS_REG_7d) - AS2( xor eax, AS_REG_1d) - -#define SSE2_Index(i) ASM_MOD(((i)*13+16), 17) - -#define pi(i) \ - AS2( movd AS_REG_1d, xmm7)\ - AS2( rol AS_REG_1d, ASM_MOD((ASM_MOD(5*i,17)*(ASM_MOD(5*i,17)+1)/2), 32))\ - AS2( mov [AS_REG_2+SSE2_Index(ASM_MOD(5*(i), 17))*4], AS_REG_1d) - -#define pi4(x, y, z, a, b, c, d) \ - AS2( pcmpeqb xmm7, xmm7)\ - AS2( pxor xmm7, x)\ - AS2( por xmm7, y)\ - AS2( pxor xmm7, z)\ - pi(a)\ - ASS( pshuflw xmm7, xmm7, 1, 0, 3, 2)\ - pi(b)\ - AS2( punpckhqdq xmm7, xmm7)\ - pi(c)\ - ASS( pshuflw xmm7, xmm7, 1, 0, 3, 2)\ - pi(d) - - pi4(xmm1, xmm2, xmm3, 1, 5, 9, 13) - pi4(xmm0, xmm1, xmm2, 2, 6, 10, 14) - pi4(xmm6, xmm0, xmm1, 3, 7, 11, 15) - pi4(xmm5, xmm6, xmm0, 4, 8, 12, 16) - - // output keystream and update buffer here to hide partial memory stalls between pi and theta - AS2( movdqa xmm4, xmm3) - AS2( punpcklqdq xmm3, xmm2) // 1 5 2 6 - AS2( punpckhdq xmm4, xmm2) // 9 10 13 14 - AS2( movdqa xmm2, xmm1) - AS2( punpcklqdq xmm1, xmm0) // 3 7 4 8 - AS2( punpckhdq xmm2, xmm0) // 11 12 15 16 - - // keystream - AS2( test AS_REG_3, AS_REG_3) - ASJ( jz, 0, f) - AS2( movdqa xmm6, xmm4) - AS2( punpcklqdq xmm4, xmm2) - AS2( punpckhqdq xmm6, xmm2) - AS2( test AS_REG_4, 15) - ASJ( jnz, 2, f) - AS2( test AS_REG_4, AS_REG_4) - ASJ( jz, 1, f) - AS2( pxor xmm4, [AS_REG_4]) - AS2( pxor xmm6, [AS_REG_4+16]) - AS2( add AS_REG_4, 32) - ASJ( jmp, 1, f) - ASL(2) - AS2( movdqu xmm0, [AS_REG_4]) - AS2( movdqu xmm2, [AS_REG_4+16]) - AS2( pxor xmm4, xmm0) - AS2( pxor xmm6, xmm2) - AS2( add AS_REG_4, 32) - ASL(1) - AS2( test AS_REG_3, 15) - ASJ( jnz, 3, f) - AS2( movdqa XMMWORD_PTR [AS_REG_3], xmm4) - AS2( movdqa XMMWORD_PTR [AS_REG_3+16], xmm6) - AS2( add AS_REG_3, 32) - ASJ( jmp, 0, f) - ASL(3) - AS2( movdqu XMMWORD_PTR [AS_REG_3], xmm4) - AS2( movdqu XMMWORD_PTR [AS_REG_3+16], xmm6) - AS2( add AS_REG_3, 32) - ASL(0) - - // buffer update - AS2( lea AS_REG_1, [AS_REG_6 + 32]) - AS2( and AS_REG_1, 31*32) - AS2( lea AS_REG_7, [AS_REG_6 + (32-24)*32]) - AS2( and AS_REG_7, 31*32) - - AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+0*8]) - AS2( pxor xmm3, xmm0) - ASS( pshufd xmm0, xmm0, 2, 3, 0, 1) - AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+0*8], xmm3) - AS2( pxor xmm0, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+2*8]) - AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+2*8], xmm0) - - AS2( movdqa xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+2*8]) - AS2( pxor xmm1, xmm4) - AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+2*8], xmm1) - AS2( pxor xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+0*8]) - AS2( movdqa XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+0*8], xmm4) - - // theta - AS2( movdqa xmm3, XMMWORD_PTR [AS_REG_2+3*16]) - AS2( movdqa xmm2, XMMWORD_PTR [AS_REG_2+2*16]) - AS2( movdqa xmm1, XMMWORD_PTR [AS_REG_2+1*16]) - AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_2+0*16]) - -#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE - AS2( test AS_REG_6, 1) - ASJ( jnz, 8, f) -#endif - AS2( movd xmm6, eax) - AS2( movdqa xmm7, xmm3) - AS2( movss xmm7, xmm6) - AS2( movdqa xmm6, xmm2) - AS2( movss xmm6, xmm3) - AS2( movdqa xmm5, xmm1) - AS2( movss xmm5, xmm2) - AS2( movdqa xmm4, xmm0) - AS2( movss xmm4, xmm1) - ASS( pshufd xmm7, xmm7, 0, 3, 2, 1) - ASS( pshufd xmm6, xmm6, 0, 3, 2, 1) - ASS( pshufd xmm5, xmm5, 0, 3, 2, 1) - ASS( pshufd xmm4, xmm4, 0, 3, 2, 1) -#if CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE - ASJ( jmp, 9, f) - ASL(8) - AS2( movd xmm7, eax) - AS3( palignr xmm7, xmm3, 4) - AS2( movq xmm6, xmm3) - AS3( palignr xmm6, xmm2, 4) - AS2( movq xmm5, xmm2) - AS3( palignr xmm5, xmm1, 4) - AS2( movq xmm4, xmm1) - AS3( palignr xmm4, xmm0, 4) - ASL(9) -#endif - - AS2( xor eax, 1) - AS2( movd AS_REG_1d, xmm0) - AS2( xor eax, AS_REG_1d) - AS2( movd AS_REG_1d, xmm3) - AS2( xor eax, AS_REG_1d) - - AS2( pxor xmm3, xmm2) - AS2( pxor xmm2, xmm1) - AS2( pxor xmm1, xmm0) - AS2( pxor xmm0, xmm7) - AS2( pxor xmm3, xmm7) - AS2( pxor xmm2, xmm6) - AS2( pxor xmm1, xmm5) - AS2( pxor xmm0, xmm4) - - // sigma - AS2( lea AS_REG_1, [AS_REG_6 + (32-4)*32]) - AS2( and AS_REG_1, 31*32) - AS2( lea AS_REG_7, [AS_REG_6 + 16*32]) - AS2( and AS_REG_7, 31*32) - - AS2( movdqa xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+0*16]) - AS2( movdqa xmm5, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+0*16]) - AS2( movdqa xmm6, xmm4) - AS2( punpcklqdq xmm4, xmm5) - AS2( punpckhqdq xmm6, xmm5) - AS2( pxor xmm3, xmm4) - AS2( pxor xmm2, xmm6) - - AS2( movdqa xmm4, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_1+1*16]) - AS2( movdqa xmm5, XMMWORD_PTR [AS_REG_2+20*4+AS_REG_7+1*16]) - AS2( movdqa xmm6, xmm4) - AS2( punpcklqdq xmm4, xmm5) - AS2( punpckhqdq xmm6, xmm5) - AS2( pxor xmm1, xmm4) - AS2( pxor xmm0, xmm6) - - // loop - AS2( add AS_REG_6, 32) - AS2( cmp AS_REG_6, REG_loopEnd) - ASJ( jne, 4, b) - - // save state - AS2( mov [AS_REG_2+4*16], eax) - AS2( movdqa XMMWORD_PTR [AS_REG_2+3*16], xmm3) - AS2( movdqa XMMWORD_PTR [AS_REG_2+2*16], xmm2) - AS2( movdqa XMMWORD_PTR [AS_REG_2+1*16], xmm1) - AS2( movdqa XMMWORD_PTR [AS_REG_2+0*16], xmm0) - - #if CRYPTOPP_BOOL_X32 - AS2( add esp, 8) - AS_POP_IF86( bp) - #elif CRYPTOPP_BOOL_X86 - AS2( add esp, 4) - AS_POP_IF86( bp) - #endif - ASL(5) - -#if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) - AS_POP_IF86( bx) - ATT_PREFIX - : - #if CRYPTOPP_BOOL_X64 - : "D" (count), "S" (state), "d" (z), "c" (y) - : "%r8", "%r9", "r10", "%eax", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7" - #else - : "c" (count), "d" (state), "S" (z), "D" (y) - : "%eax", "memory", "cc" - #endif - ); -#endif - -#ifdef CRYPTOPP_GENERATE_X64_MASM - movdqa xmm6, [rsp + 0h] - movdqa xmm7, [rsp + 10h] - add rsp, 2*16 - pop rdi - ret - Panama_SSE2_Pull ENDP -#else -} -#endif -#endif // #ifdef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -template -void Panama::Iterate(size_t count, const word32 *p, byte *output, const byte *input, KeystreamOperation operation) -{ - word32 bstart = m_state[17]; - word32 *const aPtr = m_state; - word32 cPtr[17]; - -#define bPtr ((byte *)(aPtr+20)) - -// reorder the state for SSE2 -// a and c: 4 8 12 16 | 3 7 11 15 | 2 6 10 14 | 1 5 9 13 | 0 -// xmm0 xmm1 xmm2 xmm3 eax -#define a(i) aPtr[((i)*13+16) % 17] // 13 is inverse of 4 mod 17 -#define c(i) cPtr[((i)*13+16) % 17] -// b: 0 4 | 1 5 | 2 6 | 3 7 -#define b(i, j) b##i[(j)*2%8 + (j)/4] - -// buffer update -#define US(i) {word32 t=b(0,i); b(0,i)=ConditionalByteReverse(B::ToEnum(), p[i])^t; b(25,(i+6)%8)^=t;} -#define UL(i) {word32 t=b(0,i); b(0,i)=a(i+1)^t; b(25,(i+6)%8)^=t;} -// gamma and pi -#define GP(i) c(5*i%17) = rotlFixed(a(i) ^ (a((i+1)%17) | ~a((i+2)%17)), ((5*i%17)*((5*i%17)+1)/2)%32) -// theta and sigma -#define T(i,x) a(i) = c(i) ^ c((i+1)%17) ^ c((i+4)%17) ^ x -#define TS1S(i) T(i+1, ConditionalByteReverse(B::ToEnum(), p[i])) -#define TS1L(i) T(i+1, b(4,i)) -#define TS2(i) T(i+9, b(16,i)) - - while (count--) - { - if (output) - { -#define PANAMA_OUTPUT(x) \ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, a(0+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, a(1+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, a(2+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a(3+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 4, a(4+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 5, a(5+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 6, a(6+9));\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 7, a(7+9)); - - typedef word32 WordType; - CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(PANAMA_OUTPUT, 4*8); - } - - word32 *const b16 = (word32 *)(bPtr+((bstart+16*32) & 31*32)); - word32 *const b4 = (word32 *)(bPtr+((bstart+(32-4)*32) & 31*32)); - bstart += 32; - word32 *const b0 = (word32 *)(bPtr+((bstart) & 31*32)); - word32 *const b25 = (word32 *)(bPtr+((bstart+(32-25)*32) & 31*32)); - - if (p) - { - US(0); US(1); US(2); US(3); US(4); US(5); US(6); US(7); - } - else - { - UL(0); UL(1); UL(2); UL(3); UL(4); UL(5); UL(6); UL(7); - } - - GP(0); - GP(1); - GP(2); - GP(3); - GP(4); - GP(5); - GP(6); - GP(7); - GP(8); - GP(9); - GP(10); - GP(11); - GP(12); - GP(13); - GP(14); - GP(15); - GP(16); - - T(0,1); - - if (p) - { - TS1S(0); TS1S(1); TS1S(2); TS1S(3); TS1S(4); TS1S(5); TS1S(6); TS1S(7); - p += 8; - } - else - { - TS1L(0); TS1L(1); TS1L(2); TS1L(3); TS1L(4); TS1L(5); TS1L(6); TS1L(7); - } - - TS2(0); TS2(1); TS2(2); TS2(3); TS2(4); TS2(5); TS2(6); TS2(7); - } - m_state[17] = bstart; -} - -namespace Weak { -template -size_t PanamaHash::HashMultipleBlocks(const word32 *input, size_t length) -{ - this->Iterate(length / this->BLOCKSIZE, input); - return length % this->BLOCKSIZE; -} - -template -void PanamaHash::TruncatedFinal(byte *hash, size_t size) -{ - this->ThrowIfInvalidTruncatedSize(size); - - this->PadLastBlock(this->BLOCKSIZE, 0x01); - - HashEndianCorrectedBlock(this->m_data); - - this->Iterate(32); // pull - - FixedSizeSecBlock buf; - this->Iterate(1, NULL, buf.BytePtr(), NULL); - - memcpy(hash, buf, size); - - this->Restart(); // reinit for next use -} -} - -template -void PanamaCipherPolicy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) -{ - CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(length); - assert(length==32); - memcpy(m_key, key, 32); -} - -template -void PanamaCipherPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer); CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(length); - assert(length==32); - this->Reset(); - this->Iterate(1, m_key); - if (iv && IsAligned(iv)) - this->Iterate(1, (const word32 *)iv); - else - { - FixedSizeSecBlock buf; - if (iv) - memcpy(buf, iv, 32); - else - memset(buf, 0, 32); - this->Iterate(1, buf); - } - -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) - if (B::ToEnum() == LITTLE_ENDIAN_ORDER && HasSSE2() && !IsP4()) // SSE2 code is slower on P4 Prescott - Panama_SSE2_Pull(32, this->m_state, NULL, NULL); - else -#endif - this->Iterate(32); -} - -template -unsigned int PanamaCipherPolicy::GetAlignment() const -{ -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) - if (B::ToEnum() == LITTLE_ENDIAN_ORDER && HasSSE2()) - return 16; - else -#endif - return 1; -} - -template -void PanamaCipherPolicy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) -{ -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_PANAMA_ASM) - if (B::ToEnum() == LITTLE_ENDIAN_ORDER && HasSSE2()) - Panama_SSE2_Pull(iterationCount, this->m_state, (word32 *)output, (const word32 *)input); - else -#endif - this->Iterate(iterationCount, NULL, output, input, operation); -} - -template class Panama; -template class Panama; - -template class Weak::PanamaHash; -template class Weak::PanamaHash; - -template class PanamaCipherPolicy; -template class PanamaCipherPolicy; - -NAMESPACE_END - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM diff --git a/external/crypto++-5.6.3/panama.h b/external/crypto++-5.6.3/panama.h deleted file mode 100644 index 976467a6c..000000000 --- a/external/crypto++-5.6.3/panama.h +++ /dev/null @@ -1,154 +0,0 @@ -// panama.h - written and placed in the public domain by Wei Dai - -//! \file panama.h -//! \brief Classes for Panama stream cipher - -#ifndef CRYPTOPP_PANAMA_H -#define CRYPTOPP_PANAMA_H - -#include "strciphr.h" -#include "iterhash.h" -#include "secblock.h" - -#if CRYPTOPP_BOOL_X32 -# define CRYPTOPP_DISABLE_PANAMA_ASM -#endif - -NAMESPACE_BEGIN(CryptoPP) - -/// base class, do not use directly -template -class CRYPTOPP_NO_VTABLE Panama -{ -public: - void Reset(); - void Iterate(size_t count, const word32 *p=NULL, byte *output=NULL, const byte *input=NULL, KeystreamOperation operation=WRITE_KEYSTREAM); - -protected: - typedef word32 Stage[8]; - CRYPTOPP_CONSTANT(STAGES = 32) - - FixedSizeAlignedSecBlock m_state; -}; - -namespace Weak { -/// Panama Hash -template -class PanamaHash : protected Panama, public AlgorithmImpl, PanamaHash > -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 32) - PanamaHash() {Panama::Reset();} - unsigned int DigestSize() const {return DIGESTSIZE;} - void TruncatedFinal(byte *hash, size_t size); - static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} - -protected: - void Init() {Panama::Reset();} - void HashEndianCorrectedBlock(const word32 *data) {this->Iterate(1, data);} // push - size_t HashMultipleBlocks(const word32 *input, size_t length); - word32* StateBuf() {return NULL;} -}; -} - -//! MAC construction using a hermetic hash function -template -class HermeticHashFunctionMAC : public AlgorithmImpl > >, T_Info> -{ -public: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) - { - CRYPTOPP_UNUSED(params); - - m_key.Assign(key, length); - Restart(); - } - - void Restart() - { - m_hash.Restart(); - m_keyed = false; - } - - void Update(const byte *input, size_t length) - { - if (!m_keyed) - KeyHash(); - m_hash.Update(input, length); - } - - void TruncatedFinal(byte *digest, size_t digestSize) - { - if (!m_keyed) - KeyHash(); - m_hash.TruncatedFinal(digest, digestSize); - m_keyed = false; - } - - unsigned int DigestSize() const - {return m_hash.DigestSize();} - unsigned int BlockSize() const - {return m_hash.BlockSize();} - unsigned int OptimalBlockSize() const - {return m_hash.OptimalBlockSize();} - unsigned int OptimalDataAlignment() const - {return m_hash.OptimalDataAlignment();} - -protected: - void KeyHash() - { - m_hash.Update(m_key, m_key.size()); - m_keyed = true; - } - - T_Hash m_hash; - bool m_keyed; - SecByteBlock m_key; -}; - -namespace Weak { -/// Panama MAC -template -class PanamaMAC : public HermeticHashFunctionMAC > -{ -public: - PanamaMAC() {} - PanamaMAC(const byte *key, unsigned int length) - {this->SetKey(key, length);} -}; -} - -//! algorithm info -template -struct PanamaCipherInfo : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 32> -{ - static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} -}; - -//! _ -template -class PanamaCipherPolicy : public AdditiveCipherConcretePolicy, - public PanamaCipherInfo, - protected Panama -{ -protected: - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); - bool CipherIsRandomAccess() const {return false;} - void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); - unsigned int GetAlignment() const; - - FixedSizeSecBlock m_key; -}; - -//! Panama Stream Cipher -template -struct PanamaCipher : public PanamaCipherInfo, public SymmetricCipherDocumentation -{ - typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, PanamaCipherInfo > Encryption; - typedef Encryption Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/pch.cpp b/external/crypto++-5.6.3/pch.cpp deleted file mode 100644 index 1d9f38c57..000000000 --- a/external/crypto++-5.6.3/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pch.h" diff --git a/external/crypto++-5.6.3/pch.h b/external/crypto++-5.6.3/pch.h deleted file mode 100644 index 1c14f5aa0..000000000 --- a/external/crypto++-5.6.3/pch.h +++ /dev/null @@ -1,24 +0,0 @@ -// pch.h - written and placed in the public domain by Wei Dai - -//! \headerfile pch.h -//! \brief Precompiled header file - -#ifndef CRYPTOPP_PCH_H -#define CRYPTOPP_PCH_H - -# ifdef CRYPTOPP_GENERATE_X64_MASM - #include "cpu.h" - -# else - #include "config.h" - - #ifdef USE_PRECOMPILED_HEADERS - #include "simple.h" - #include "secblock.h" - #include "misc.h" - #include "smartptr.h" - #include "stdcpp.h" - #endif -# endif - -#endif // CRYPTOPP_PCH_H diff --git a/external/crypto++-5.6.3/pkcspad.cpp b/external/crypto++-5.6.3/pkcspad.cpp deleted file mode 100644 index 6bacee3cd..000000000 --- a/external/crypto++-5.6.3/pkcspad.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// pkcspad.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_PKCSPAD_CPP // SunCC workaround: compiler could cause this file to be included twice -#define CRYPTOPP_PKCSPAD_CPP - -#include "pkcspad.h" -#include "misc.h" -#include - -NAMESPACE_BEGIN(CryptoPP) - -// more in dll.cpp -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x02,0x05,0x00,0x04,0x10}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x04,0x10}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2b,0x24,0x03,0x02,0x01,0x05,0x00,0x04,0x14}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -template<> const byte PKCS_DigestDecoration::decoration[] = {0x30,0x29,0x30,0x0D,0x06,0x09,0x2B,0x06,0x01,0x04,0x01,0xDA,0x47,0x0C,0x02,0x05,0x00,0x04,0x18}; -template<> const unsigned int PKCS_DigestDecoration::length = sizeof(PKCS_DigestDecoration::decoration); - -size_t PKCS_EncryptionPaddingScheme::MaxUnpaddedLength(size_t paddedLength) const -{ - return SaturatingSubtract(paddedLength/8, 10U); -} - -void PKCS_EncryptionPaddingScheme::Pad(RandomNumberGenerator& rng, const byte *input, size_t inputLen, byte *pkcsBlock, size_t pkcsBlockLen, const NameValuePairs& parameters) const -{ - CRYPTOPP_UNUSED(parameters); - assert (inputLen <= MaxUnpaddedLength(pkcsBlockLen)); // this should be checked by caller - - // convert from bit length to byte length - if (pkcsBlockLen % 8 != 0) - { - pkcsBlock[0] = 0; - pkcsBlock++; - } - pkcsBlockLen /= 8; - - pkcsBlock[0] = 2; // block type 2 - - // pad with non-zero random bytes - for (unsigned i = 1; i < pkcsBlockLen-inputLen-1; i++) - pkcsBlock[i] = (byte)rng.GenerateWord32(1, 0xff); - - pkcsBlock[pkcsBlockLen-inputLen-1] = 0; // separator - memcpy(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen); -} - -DecodingResult PKCS_EncryptionPaddingScheme::Unpad(const byte *pkcsBlock, size_t pkcsBlockLen, byte *output, const NameValuePairs& parameters) const -{ - CRYPTOPP_UNUSED(parameters); - bool invalid = false; - size_t maxOutputLen = MaxUnpaddedLength(pkcsBlockLen); - - // convert from bit length to byte length - if (pkcsBlockLen % 8 != 0) - { - invalid = (pkcsBlock[0] != 0) || invalid; - pkcsBlock++; - } - pkcsBlockLen /= 8; - - // Require block type 2. - invalid = (pkcsBlock[0] != 2) || invalid; - - // skip past the padding until we find the separator - size_t i=1; - while (i maxOutputLen) || invalid; - - if (invalid) - return DecodingResult(); - - memcpy (output, pkcsBlock+i, outputLen); - return DecodingResult(outputLen); -} - -// ******************************************************** - -#ifndef CRYPTOPP_IMPORTS - -void PKCS1v15_SignatureMessageEncodingMethod::ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); - CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); - assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); - - size_t pkcsBlockLen = representativeBitLength; - // convert from bit length to byte length - if (pkcsBlockLen % 8 != 0) - { - representative[0] = 0; - representative++; - } - pkcsBlockLen /= 8; - - representative[0] = 1; // block type 1 - - unsigned int digestSize = hash.DigestSize(); - byte *pPadding = representative + 1; - byte *pDigest = representative + pkcsBlockLen - digestSize; - byte *pHashId = pDigest - hashIdentifier.second; - byte *pSeparator = pHashId - 1; - - // pad with 0xff - memset(pPadding, 0xff, pSeparator-pPadding); - *pSeparator = 0; - memcpy(pHashId, hashIdentifier.first, hashIdentifier.second); - hash.Final(pDigest); -} - -#endif - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/pkcspad.h b/external/crypto++-5.6.3/pkcspad.h deleted file mode 100644 index 99b752021..000000000 --- a/external/crypto++-5.6.3/pkcspad.h +++ /dev/null @@ -1,99 +0,0 @@ -// pkcspad.h - written and placed in the public domain by Wei Dai - -//! \headerfile pkcspad.h -//! \brief Classes for PKCS padding schemes - -#ifndef CRYPTOPP_PKCSPAD_H -#define CRYPTOPP_PKCSPAD_H - -#include "cryptlib.h" -#include "pubkey.h" - -#ifdef CRYPTOPP_IS_DLL -#include "sha.h" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -//! EME-PKCS1-v1_5 -class PKCS_EncryptionPaddingScheme : public PK_EncryptionMessageEncodingMethod -{ -public: - static const char * StaticAlgorithmName() {return "EME-PKCS1-v1_5";} - - size_t MaxUnpaddedLength(size_t paddedLength) const; - void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedLength, const NameValuePairs ¶meters) const; - DecodingResult Unpad(const byte *padded, size_t paddedLength, byte *raw, const NameValuePairs ¶meters) const; -}; - -template class PKCS_DigestDecoration -{ -public: - static const byte decoration[]; - static const unsigned int length; -}; - -// PKCS_DigestDecoration can be instantiated with the following -// classes as specified in PKCS#1 v2.0 and P1363a -class SHA1; -class RIPEMD160; -class Tiger; -class SHA224; -class SHA256; -class SHA384; -class SHA512; -namespace Weak1 { -class MD2; -class MD5; -} -// end of list - -#ifdef CRYPTOPP_IS_DLL -CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; -CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; -CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; -CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; -CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; -#endif - -//! EMSA-PKCS1-v1_5 -class CRYPTOPP_DLL PKCS1v15_SignatureMessageEncodingMethod : public PK_DeterministicSignatureMessageEncodingMethod -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "EMSA-PKCS1-v1_5";} - - size_t MinRepresentativeBitLength(size_t hashIdentifierSize, size_t digestSize) const - {return 8 * (digestSize + hashIdentifierSize + 10);} - - void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; - - struct HashIdentifierLookup - { - template struct HashIdentifierLookup2 - { - static HashIdentifier Lookup() - { - return HashIdentifier(PKCS_DigestDecoration::decoration, PKCS_DigestDecoration::length); - } - }; - }; -}; - -//! PKCS #1 version 1.5, for use with RSAES and RSASS -/*! Only the following hash functions are supported by this signature standard: - \dontinclude pkcspad.h - \skip can be instantiated - \until end of list -*/ -struct PKCS1v15 : public SignatureStandard, public EncryptionStandard -{ - typedef PKCS_EncryptionPaddingScheme EncryptionMessageEncodingMethod; - typedef PKCS1v15_SignatureMessageEncodingMethod SignatureMessageEncodingMethod; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/polynomi.cpp b/external/crypto++-5.6.3/polynomi.cpp deleted file mode 100644 index 734cae926..000000000 --- a/external/crypto++-5.6.3/polynomi.cpp +++ /dev/null @@ -1,577 +0,0 @@ -// polynomi.cpp - written and placed in the public domain by Wei Dai - -// Part of the code for polynomial evaluation and interpolation -// originally came from Hal Finney's public domain secsplit.c. - -#include "pch.h" -#include "polynomi.h" -#include "secblock.h" - -#include -#include - -NAMESPACE_BEGIN(CryptoPP) - -template -void PolynomialOver::Randomize(RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) -{ - m_coefficients.resize(parameter.m_coefficientCount); - for (unsigned int i=0; i -void PolynomialOver::FromStr(const char *str, const Ring &ring) -{ - std::istringstream in((char *)str); - bool positive = true; - CoefficientType coef; - unsigned int power; - - while (in) - { - std::ws(in); - if (in.peek() == 'x') - coef = ring.MultiplicativeIdentity(); - else - in >> coef; - - std::ws(in); - if (in.peek() == 'x') - { - in.get(); - std::ws(in); - if (in.peek() == '^') - { - in.get(); - in >> power; - } - else - power = 1; - } - else - power = 0; - - if (!positive) - coef = ring.Inverse(coef); - - SetCoefficient(power, coef, ring); - - std::ws(in); - switch (in.get()) - { - case '+': - positive = true; - break; - case '-': - positive = false; - break; - default: - return; // something's wrong with the input string - } - } -} - -template -unsigned int PolynomialOver::CoefficientCount(const Ring &ring) const -{ - unsigned count = m_coefficients.size(); - while (count && ring.Equal(m_coefficients[count-1], ring.Identity())) - count--; - const_cast &>(m_coefficients).resize(count); - return count; -} - -template -typename PolynomialOver::CoefficientType PolynomialOver::GetCoefficient(unsigned int i, const Ring &ring) const -{ - return (i < m_coefficients.size()) ? m_coefficients[i] : ring.Identity(); -} - -template -PolynomialOver& PolynomialOver::operator=(const PolynomialOver& t) -{ - if (this != &t) - { - m_coefficients.resize(t.m_coefficients.size()); - for (unsigned int i=0; i -PolynomialOver& PolynomialOver::Accumulate(const PolynomialOver& t, const Ring &ring) -{ - unsigned int count = t.CoefficientCount(ring); - - if (count > CoefficientCount(ring)) - m_coefficients.resize(count, ring.Identity()); - - for (unsigned int i=0; i -PolynomialOver& PolynomialOver::Reduce(const PolynomialOver& t, const Ring &ring) -{ - unsigned int count = t.CoefficientCount(ring); - - if (count > CoefficientCount(ring)) - m_coefficients.resize(count, ring.Identity()); - - for (unsigned int i=0; i -typename PolynomialOver::CoefficientType PolynomialOver::EvaluateAt(const CoefficientType &x, const Ring &ring) const -{ - int degree = Degree(ring); - - if (degree < 0) - return ring.Identity(); - - CoefficientType result = m_coefficients[degree]; - for (int j=degree-1; j>=0; j--) - { - result = ring.Multiply(result, x); - ring.Accumulate(result, m_coefficients[j]); - } - return result; -} - -template -PolynomialOver& PolynomialOver::ShiftLeft(unsigned int n, const Ring &ring) -{ - unsigned int i = CoefficientCount(ring) + n; - m_coefficients.resize(i, ring.Identity()); - while (i > n) - { - i--; - m_coefficients[i] = m_coefficients[i-n]; - } - while (i) - { - i--; - m_coefficients[i] = ring.Identity(); - } - return *this; -} - -template -PolynomialOver& PolynomialOver::ShiftRight(unsigned int n, const Ring &ring) -{ - unsigned int count = CoefficientCount(ring); - if (count > n) - { - for (unsigned int i=0; i -void PolynomialOver::SetCoefficient(unsigned int i, const CoefficientType &value, const Ring &ring) -{ - if (i >= m_coefficients.size()) - m_coefficients.resize(i+1, ring.Identity()); - m_coefficients[i] = value; -} - -template -void PolynomialOver::Negate(const Ring &ring) -{ - unsigned int count = CoefficientCount(ring); - for (unsigned int i=0; i -void PolynomialOver::swap(PolynomialOver &t) -{ - m_coefficients.swap(t.m_coefficients); -} - -template -bool PolynomialOver::Equals(const PolynomialOver& t, const Ring &ring) const -{ - unsigned int count = CoefficientCount(ring); - - if (count != t.CoefficientCount(ring)) - return false; - - for (unsigned int i=0; i -PolynomialOver PolynomialOver::Plus(const PolynomialOver& t, const Ring &ring) const -{ - unsigned int i; - unsigned int count = CoefficientCount(ring); - unsigned int tCount = t.CoefficientCount(ring); - - if (count > tCount) - { - PolynomialOver result(ring, count); - - for (i=0; i result(ring, tCount); - - for (i=0; i -PolynomialOver PolynomialOver::Minus(const PolynomialOver& t, const Ring &ring) const -{ - unsigned int i; - unsigned int count = CoefficientCount(ring); - unsigned int tCount = t.CoefficientCount(ring); - - if (count > tCount) - { - PolynomialOver result(ring, count); - - for (i=0; i result(ring, tCount); - - for (i=0; i -PolynomialOver PolynomialOver::Inverse(const Ring &ring) const -{ - unsigned int count = CoefficientCount(ring); - PolynomialOver result(ring, count); - - for (unsigned int i=0; i -PolynomialOver PolynomialOver::Times(const PolynomialOver& t, const Ring &ring) const -{ - if (IsZero(ring) || t.IsZero(ring)) - return PolynomialOver(); - - unsigned int count1 = CoefficientCount(ring), count2 = t.CoefficientCount(ring); - PolynomialOver result(ring, count1 + count2 - 1); - - for (unsigned int i=0; i -PolynomialOver PolynomialOver::DividedBy(const PolynomialOver& t, const Ring &ring) const -{ - PolynomialOver remainder, quotient; - Divide(remainder, quotient, *this, t, ring); - return quotient; -} - -template -PolynomialOver PolynomialOver::Modulo(const PolynomialOver& t, const Ring &ring) const -{ - PolynomialOver remainder, quotient; - Divide(remainder, quotient, *this, t, ring); - return remainder; -} - -template -PolynomialOver PolynomialOver::MultiplicativeInverse(const Ring &ring) const -{ - return Degree(ring)==0 ? ring.MultiplicativeInverse(m_coefficients[0]) : ring.Identity(); -} - -template -bool PolynomialOver::IsUnit(const Ring &ring) const -{ - return Degree(ring)==0 && ring.IsUnit(m_coefficients[0]); -} - -template -std::istream& PolynomialOver::Input(std::istream &in, const Ring &ring) -{ - char c; - unsigned int length = 0; - SecBlock str(length + 16); - bool paren = false; - - std::ws(in); - - if (in.peek() == '(') - { - paren = true; - in.get(); - } - - do - { - in.read(&c, 1); - str[length++] = c; - if (length >= str.size()) - str.Grow(length + 16); - } - // if we started with a left paren, then read until we find a right paren, - // otherwise read until the end of the line - while (in && ((paren && c != ')') || (!paren && c != '\n'))); - - str[length-1] = '\0'; - *this = PolynomialOver(str, ring); - - return in; -} - -template -std::ostream& PolynomialOver::Output(std::ostream &out, const Ring &ring) const -{ - unsigned int i = CoefficientCount(ring); - if (i) - { - bool firstTerm = true; - - while (i--) - { - if (m_coefficients[i] != ring.Identity()) - { - if (firstTerm) - { - firstTerm = false; - if (!i || !ring.Equal(m_coefficients[i], ring.MultiplicativeIdentity())) - out << m_coefficients[i]; - } - else - { - CoefficientType inverse = ring.Inverse(m_coefficients[i]); - std::ostringstream pstr, nstr; - - pstr << m_coefficients[i]; - nstr << inverse; - - if (pstr.str().size() <= nstr.str().size()) - { - out << " + "; - if (!i || !ring.Equal(m_coefficients[i], ring.MultiplicativeIdentity())) - out << m_coefficients[i]; - } - else - { - out << " - "; - if (!i || !ring.Equal(inverse, ring.MultiplicativeIdentity())) - out << inverse; - } - } - - switch (i) - { - case 0: - break; - case 1: - out << "x"; - break; - default: - out << "x^" << i; - } - } - } - } - else - { - out << ring.Identity(); - } - return out; -} - -template -void PolynomialOver::Divide(PolynomialOver &r, PolynomialOver &q, const PolynomialOver &a, const PolynomialOver &d, const Ring &ring) -{ - unsigned int i = a.CoefficientCount(ring); - const int dDegree = d.Degree(ring); - - if (dDegree < 0) - throw DivideByZero(); - - r = a; - q.m_coefficients.resize(STDMAX(0, int(i - dDegree))); - - while (i > (unsigned int)dDegree) - { - --i; - q.m_coefficients[i-dDegree] = ring.Divide(r.m_coefficients[i], d.m_coefficients[dDegree]); - for (int j=0; j<=dDegree; j++) - ring.Reduce(r.m_coefficients[i-dDegree+j], ring.Multiply(q.m_coefficients[i-dDegree], d.m_coefficients[j])); - } - - r.CoefficientCount(ring); // resize r.m_coefficients -} - -// ******************************************************** - -// helper function for Interpolate() and InterpolateAt() -template -void RingOfPolynomialsOver::CalculateAlpha(std::vector &alpha, const CoefficientType x[], const CoefficientType y[], unsigned int n) const -{ - for (unsigned int j=0; j=k; --j) - { - m_ring.Reduce(alpha[j], alpha[j-1]); - - CoefficientType d = m_ring.Subtract(x[j], x[j-k]); - if (!m_ring.IsUnit(d)) - throw InterpolationFailed(); - alpha[j] = m_ring.Divide(alpha[j], d); - } - } -} - -template -typename RingOfPolynomialsOver::Element RingOfPolynomialsOver::Interpolate(const CoefficientType x[], const CoefficientType y[], unsigned int n) const -{ - assert(n > 0); - - std::vector alpha(n); - CalculateAlpha(alpha, x, y, n); - - std::vector coefficients((size_t)n, m_ring.Identity()); - coefficients[0] = alpha[n-1]; - - for (int j=n-2; j>=0; --j) - { - for (unsigned int i=n-j-1; i>0; i--) - coefficients[i] = m_ring.Subtract(coefficients[i-1], m_ring.Multiply(coefficients[i], x[j])); - - coefficients[0] = m_ring.Subtract(alpha[j], m_ring.Multiply(coefficients[0], x[j])); - } - - return PolynomialOver(coefficients.begin(), coefficients.end()); -} - -template -typename RingOfPolynomialsOver::CoefficientType RingOfPolynomialsOver::InterpolateAt(const CoefficientType &position, const CoefficientType x[], const CoefficientType y[], unsigned int n) const -{ - assert(n > 0); - - std::vector alpha(n); - CalculateAlpha(alpha, x, y, n); - - CoefficientType result = alpha[n-1]; - for (int j=n-2; j>=0; --j) - { - result = m_ring.Multiply(result, m_ring.Subtract(position, x[j])); - m_ring.Accumulate(result, alpha[j]); - } - return result; -} - -template -void PrepareBulkPolynomialInterpolation(const Ring &ring, Element *w, const Element x[], unsigned int n) -{ - for (unsigned int i=0; i -void PrepareBulkPolynomialInterpolationAt(const Ring &ring, Element *v, const Element &position, const Element x[], const Element w[], unsigned int n) -{ - assert(n > 0); - - std::vector a(2*n-1); - unsigned int i; - - for (i=0; i1; i--) - a[i-1] = ring.Multiply(a[2*i], a[2*i-1]); - - a[0] = ring.MultiplicativeIdentity(); - - for (i=0; i -Element BulkPolynomialInterpolateAt(const Ring &ring, const Element y[], const Element v[], unsigned int n) -{ - Element result = ring.Identity(); - for (unsigned int i=0; i -const PolynomialOverFixedRing &PolynomialOverFixedRing::Zero() -{ - return Singleton().Ref(); -} - -template -const PolynomialOverFixedRing &PolynomialOverFixedRing::One() -{ - return Singleton().Ref(); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/polynomi.h b/external/crypto++-5.6.3/polynomi.h deleted file mode 100644 index de043e6d8..000000000 --- a/external/crypto++-5.6.3/polynomi.h +++ /dev/null @@ -1,467 +0,0 @@ -// polynomi.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile polynomi.h -//! \brief Classes for polynomial basis and operations - - -#ifndef CRYPTOPP_POLYNOMI_H -#define CRYPTOPP_POLYNOMI_H - -/*! \file */ - -#include "cryptlib.h" -#include "secblock.h" -#include "algebra.h" -#include "misc.h" - -#include -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! represents single-variable polynomials over arbitrary rings -/*! \nosubgrouping */ -template class PolynomialOver -{ -public: - //! \name ENUMS, EXCEPTIONS, and TYPEDEFS - //@{ - //! division by zero exception - class DivideByZero : public Exception - { - public: - DivideByZero() : Exception(OTHER_ERROR, "PolynomialOver: division by zero") {} - }; - - //! specify the distribution for randomization functions - class RandomizationParameter - { - public: - RandomizationParameter(unsigned int coefficientCount, const typename T::RandomizationParameter &coefficientParameter ) - : m_coefficientCount(coefficientCount), m_coefficientParameter(coefficientParameter) {} - - private: - unsigned int m_coefficientCount; - typename T::RandomizationParameter m_coefficientParameter; - friend class PolynomialOver; - }; - - typedef T Ring; - typedef typename T::Element CoefficientType; - //@} - - //! \name CREATORS - //@{ - //! creates the zero polynomial - PolynomialOver() {} - - //! - PolynomialOver(const Ring &ring, unsigned int count) - : m_coefficients((size_t)count, ring.Identity()) {} - - //! copy constructor - PolynomialOver(const PolynomialOver &t) - : m_coefficients(t.m_coefficients.size()) {*this = t;} - - //! construct constant polynomial - PolynomialOver(const CoefficientType &element) - : m_coefficients(1, element) {} - - //! construct polynomial with specified coefficients, starting from coefficient of x^0 - template PolynomialOver(Iterator begin, Iterator end) - : m_coefficients(begin, end) {} - - //! convert from string - PolynomialOver(const char *str, const Ring &ring) {FromStr(str, ring);} - - //! convert from big-endian byte array - PolynomialOver(const byte *encodedPolynomialOver, unsigned int byteCount); - - //! convert from Basic Encoding Rules encoded byte array - explicit PolynomialOver(const byte *BEREncodedPolynomialOver); - - //! convert from BER encoded byte array stored in a BufferedTransformation object - explicit PolynomialOver(BufferedTransformation &bt); - - //! create a random PolynomialOver - PolynomialOver(RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) - {Randomize(rng, parameter, ring);} - //@} - - //! \name ACCESSORS - //@{ - //! the zero polynomial will return a degree of -1 - int Degree(const Ring &ring) const {return int(CoefficientCount(ring))-1;} - //! - unsigned int CoefficientCount(const Ring &ring) const; - //! return coefficient for x^i - CoefficientType GetCoefficient(unsigned int i, const Ring &ring) const; - //@} - - //! \name MANIPULATORS - //@{ - //! - PolynomialOver& operator=(const PolynomialOver& t); - - //! - void Randomize(RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring); - - //! set the coefficient for x^i to value - void SetCoefficient(unsigned int i, const CoefficientType &value, const Ring &ring); - - //! - void Negate(const Ring &ring); - - //! - void swap(PolynomialOver &t); - //@} - - - //! \name BASIC ARITHMETIC ON POLYNOMIALS - //@{ - bool Equals(const PolynomialOver &t, const Ring &ring) const; - bool IsZero(const Ring &ring) const {return CoefficientCount(ring)==0;} - - PolynomialOver Plus(const PolynomialOver& t, const Ring &ring) const; - PolynomialOver Minus(const PolynomialOver& t, const Ring &ring) const; - PolynomialOver Inverse(const Ring &ring) const; - - PolynomialOver Times(const PolynomialOver& t, const Ring &ring) const; - PolynomialOver DividedBy(const PolynomialOver& t, const Ring &ring) const; - PolynomialOver Modulo(const PolynomialOver& t, const Ring &ring) const; - PolynomialOver MultiplicativeInverse(const Ring &ring) const; - bool IsUnit(const Ring &ring) const; - - PolynomialOver& Accumulate(const PolynomialOver& t, const Ring &ring); - PolynomialOver& Reduce(const PolynomialOver& t, const Ring &ring); - - //! - PolynomialOver Doubled(const Ring &ring) const {return Plus(*this, ring);} - //! - PolynomialOver Squared(const Ring &ring) const {return Times(*this, ring);} - - CoefficientType EvaluateAt(const CoefficientType &x, const Ring &ring) const; - - PolynomialOver& ShiftLeft(unsigned int n, const Ring &ring); - PolynomialOver& ShiftRight(unsigned int n, const Ring &ring); - - //! calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d) - static void Divide(PolynomialOver &r, PolynomialOver &q, const PolynomialOver &a, const PolynomialOver &d, const Ring &ring); - //@} - - //! \name INPUT/OUTPUT - //@{ - std::istream& Input(std::istream &in, const Ring &ring); - std::ostream& Output(std::ostream &out, const Ring &ring) const; - //@} - -private: - void FromStr(const char *str, const Ring &ring); - - std::vector m_coefficients; -}; - -//! Polynomials over a fixed ring -/*! Having a fixed ring allows overloaded operators */ -template class PolynomialOverFixedRing : private PolynomialOver -{ - typedef PolynomialOver B; - typedef PolynomialOverFixedRing ThisType; - -public: - typedef T Ring; - typedef typename T::Element CoefficientType; - typedef typename B::DivideByZero DivideByZero; - typedef typename B::RandomizationParameter RandomizationParameter; - - //! \name CREATORS - //@{ - //! creates the zero polynomial - PolynomialOverFixedRing(unsigned int count = 0) : B(ms_fixedRing, count) {} - - //! copy constructor - PolynomialOverFixedRing(const ThisType &t) : B(t) {} - - explicit PolynomialOverFixedRing(const B &t) : B(t) {} - - //! construct constant polynomial - PolynomialOverFixedRing(const CoefficientType &element) : B(element) {} - - //! construct polynomial with specified coefficients, starting from coefficient of x^0 - template PolynomialOverFixedRing(Iterator first, Iterator last) - : B(first, last) {} - - //! convert from string - explicit PolynomialOverFixedRing(const char *str) : B(str, ms_fixedRing) {} - - //! convert from big-endian byte array - PolynomialOverFixedRing(const byte *encodedPoly, unsigned int byteCount) : B(encodedPoly, byteCount) {} - - //! convert from Basic Encoding Rules encoded byte array - explicit PolynomialOverFixedRing(const byte *BEREncodedPoly) : B(BEREncodedPoly) {} - - //! convert from BER encoded byte array stored in a BufferedTransformation object - explicit PolynomialOverFixedRing(BufferedTransformation &bt) : B(bt) {} - - //! create a random PolynomialOverFixedRing - PolynomialOverFixedRing(RandomNumberGenerator &rng, const RandomizationParameter ¶meter) : B(rng, parameter, ms_fixedRing) {} - - static const ThisType &Zero(); - static const ThisType &One(); - //@} - - //! \name ACCESSORS - //@{ - //! the zero polynomial will return a degree of -1 - int Degree() const {return B::Degree(ms_fixedRing);} - //! degree + 1 - unsigned int CoefficientCount() const {return B::CoefficientCount(ms_fixedRing);} - //! return coefficient for x^i - CoefficientType GetCoefficient(unsigned int i) const {return B::GetCoefficient(i, ms_fixedRing);} - //! return coefficient for x^i - CoefficientType operator[](unsigned int i) const {return B::GetCoefficient(i, ms_fixedRing);} - //@} - - //! \name MANIPULATORS - //@{ - //! - ThisType& operator=(const ThisType& t) {B::operator=(t); return *this;} - //! - ThisType& operator+=(const ThisType& t) {Accumulate(t, ms_fixedRing); return *this;} - //! - ThisType& operator-=(const ThisType& t) {Reduce(t, ms_fixedRing); return *this;} - //! - ThisType& operator*=(const ThisType& t) {return *this = *this*t;} - //! - ThisType& operator/=(const ThisType& t) {return *this = *this/t;} - //! - ThisType& operator%=(const ThisType& t) {return *this = *this%t;} - - //! - ThisType& operator<<=(unsigned int n) {ShiftLeft(n, ms_fixedRing); return *this;} - //! - ThisType& operator>>=(unsigned int n) {ShiftRight(n, ms_fixedRing); return *this;} - - //! set the coefficient for x^i to value - void SetCoefficient(unsigned int i, const CoefficientType &value) {B::SetCoefficient(i, value, ms_fixedRing);} - - //! - void Randomize(RandomNumberGenerator &rng, const RandomizationParameter ¶meter) {B::Randomize(rng, parameter, ms_fixedRing);} - - //! - void Negate() {B::Negate(ms_fixedRing);} - - void swap(ThisType &t) {B::swap(t);} - //@} - - //! \name UNARY OPERATORS - //@{ - //! - bool operator!() const {return CoefficientCount()==0;} - //! - ThisType operator+() const {return *this;} - //! - ThisType operator-() const {return ThisType(Inverse(ms_fixedRing));} - //@} - - //! \name BINARY OPERATORS - //@{ - //! - friend ThisType operator>>(ThisType a, unsigned int n) {return ThisType(a>>=n);} - //! - friend ThisType operator<<(ThisType a, unsigned int n) {return ThisType(a<<=n);} - //@} - - //! \name OTHER ARITHMETIC FUNCTIONS - //@{ - //! - ThisType MultiplicativeInverse() const {return ThisType(B::MultiplicativeInverse(ms_fixedRing));} - //! - bool IsUnit() const {return B::IsUnit(ms_fixedRing);} - - //! - ThisType Doubled() const {return ThisType(B::Doubled(ms_fixedRing));} - //! - ThisType Squared() const {return ThisType(B::Squared(ms_fixedRing));} - - CoefficientType EvaluateAt(const CoefficientType &x) const {return B::EvaluateAt(x, ms_fixedRing);} - - //! calculate r and q such that (a == d*q + r) && (0 <= r < abs(d)) - static void Divide(ThisType &r, ThisType &q, const ThisType &a, const ThisType &d) - {B::Divide(r, q, a, d, ms_fixedRing);} - //@} - - //! \name INPUT/OUTPUT - //@{ - //! - friend std::istream& operator>>(std::istream& in, ThisType &a) - {return a.Input(in, ms_fixedRing);} - //! - friend std::ostream& operator<<(std::ostream& out, const ThisType &a) - {return a.Output(out, ms_fixedRing);} - //@} - -private: - struct NewOnePolynomial - { - ThisType * operator()() const - { - return new ThisType(ms_fixedRing.MultiplicativeIdentity()); - } - }; - - static const Ring ms_fixedRing; -}; - -//! Ring of polynomials over another ring -template class RingOfPolynomialsOver : public AbstractEuclideanDomain > -{ -public: - typedef T CoefficientRing; - typedef PolynomialOver Element; - typedef typename Element::CoefficientType CoefficientType; - typedef typename Element::RandomizationParameter RandomizationParameter; - - RingOfPolynomialsOver(const CoefficientRing &ring) : m_ring(ring) {} - - Element RandomElement(RandomNumberGenerator &rng, const RandomizationParameter ¶meter) - {return Element(rng, parameter, m_ring);} - - bool Equal(const Element &a, const Element &b) const - {return a.Equals(b, m_ring);} - - const Element& Identity() const - {return this->result = m_ring.Identity();} - - const Element& Add(const Element &a, const Element &b) const - {return this->result = a.Plus(b, m_ring);} - - Element& Accumulate(Element &a, const Element &b) const - {a.Accumulate(b, m_ring); return a;} - - const Element& Inverse(const Element &a) const - {return this->result = a.Inverse(m_ring);} - - const Element& Subtract(const Element &a, const Element &b) const - {return this->result = a.Minus(b, m_ring);} - - Element& Reduce(Element &a, const Element &b) const - {return a.Reduce(b, m_ring);} - - const Element& Double(const Element &a) const - {return this->result = a.Doubled(m_ring);} - - const Element& MultiplicativeIdentity() const - {return this->result = m_ring.MultiplicativeIdentity();} - - const Element& Multiply(const Element &a, const Element &b) const - {return this->result = a.Times(b, m_ring);} - - const Element& Square(const Element &a) const - {return this->result = a.Squared(m_ring);} - - bool IsUnit(const Element &a) const - {return a.IsUnit(m_ring);} - - const Element& MultiplicativeInverse(const Element &a) const - {return this->result = a.MultiplicativeInverse(m_ring);} - - const Element& Divide(const Element &a, const Element &b) const - {return this->result = a.DividedBy(b, m_ring);} - - const Element& Mod(const Element &a, const Element &b) const - {return this->result = a.Modulo(b, m_ring);} - - void DivisionAlgorithm(Element &r, Element &q, const Element &a, const Element &d) const - {Element::Divide(r, q, a, d, m_ring);} - - class InterpolationFailed : public Exception - { - public: - InterpolationFailed() : Exception(OTHER_ERROR, "RingOfPolynomialsOver: interpolation failed") {} - }; - - Element Interpolate(const CoefficientType x[], const CoefficientType y[], unsigned int n) const; - - // a faster version of Interpolate(x, y, n).EvaluateAt(position) - CoefficientType InterpolateAt(const CoefficientType &position, const CoefficientType x[], const CoefficientType y[], unsigned int n) const; -/* - void PrepareBulkInterpolation(CoefficientType *w, const CoefficientType x[], unsigned int n) const; - void PrepareBulkInterpolationAt(CoefficientType *v, const CoefficientType &position, const CoefficientType x[], const CoefficientType w[], unsigned int n) const; - CoefficientType BulkInterpolateAt(const CoefficientType y[], const CoefficientType v[], unsigned int n) const; -*/ -protected: - void CalculateAlpha(std::vector &alpha, const CoefficientType x[], const CoefficientType y[], unsigned int n) const; - - CoefficientRing m_ring; -}; - -template -void PrepareBulkPolynomialInterpolation(const Ring &ring, Element *w, const Element x[], unsigned int n); -template -void PrepareBulkPolynomialInterpolationAt(const Ring &ring, Element *v, const Element &position, const Element x[], const Element w[], unsigned int n); -template -Element BulkPolynomialInterpolateAt(const Ring &ring, const Element y[], const Element v[], unsigned int n); - -//! -template -inline bool operator==(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return a.Equals(b, a.ms_fixedRing);} -//! -template -inline bool operator!=(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return !(a==b);} - -//! -template -inline bool operator> (const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return a.Degree() > b.Degree();} -//! -template -inline bool operator>=(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return a.Degree() >= b.Degree();} -//! -template -inline bool operator< (const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return a.Degree() < b.Degree();} -//! -template -inline bool operator<=(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return a.Degree() <= b.Degree();} - -//! -template -inline CryptoPP::PolynomialOverFixedRing operator+(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return CryptoPP::PolynomialOverFixedRing(a.Plus(b, a.ms_fixedRing));} -//! -template -inline CryptoPP::PolynomialOverFixedRing operator-(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return CryptoPP::PolynomialOverFixedRing(a.Minus(b, a.ms_fixedRing));} -//! -template -inline CryptoPP::PolynomialOverFixedRing operator*(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return CryptoPP::PolynomialOverFixedRing(a.Times(b, a.ms_fixedRing));} -//! -template -inline CryptoPP::PolynomialOverFixedRing operator/(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return CryptoPP::PolynomialOverFixedRing(a.DividedBy(b, a.ms_fixedRing));} -//! -template -inline CryptoPP::PolynomialOverFixedRing operator%(const CryptoPP::PolynomialOverFixedRing &a, const CryptoPP::PolynomialOverFixedRing &b) - {return CryptoPP::PolynomialOverFixedRing(a.Modulo(b, a.ms_fixedRing));} - -NAMESPACE_END - -NAMESPACE_BEGIN(std) -template inline void swap(CryptoPP::PolynomialOver &a, CryptoPP::PolynomialOver &b) -{ - a.swap(b); -} -template inline void swap(CryptoPP::PolynomialOverFixedRing &a, CryptoPP::PolynomialOverFixedRing &b) -{ - a.swap(b); -} -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/pssr.cpp b/external/crypto++-5.6.3/pssr.cpp deleted file mode 100644 index fd873bb61..000000000 --- a/external/crypto++-5.6.3/pssr.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// pssr.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "pssr.h" -#include "misc.h" - -#include - -NAMESPACE_BEGIN(CryptoPP) - -// more in dll.cpp -template<> const byte EMSA2HashId::id = 0x31; -template<> const byte EMSA2HashId::id = 0x32; -template<> const byte EMSA2HashId::id = 0x37; - -#ifndef CRYPTOPP_IMPORTS - -size_t PSSR_MEM_Base::MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const -{ - size_t saltLen = SaltLen(digestLength); - size_t minPadLen = MinPadLen(digestLength); - return 9 + 8*(minPadLen + saltLen + digestLength + hashIdentifierLength); -} - -size_t PSSR_MEM_Base::MaxRecoverableLength(size_t representativeBitLength, size_t hashIdentifierLength, size_t digestLength) const -{ - if (AllowRecovery()) - return SaturatingSubtract(representativeBitLength, MinRepresentativeBitLength(hashIdentifierLength, digestLength)) / 8; - return 0; -} - -bool PSSR_MEM_Base::IsProbabilistic() const -{ - return SaltLen(1) > 0; -} - -bool PSSR_MEM_Base::AllowNonrecoverablePart() const -{ - return true; -} - -bool PSSR_MEM_Base::RecoverablePartFirst() const -{ - return false; -} - -void PSSR_MEM_Base::ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength); - CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); - assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); - - const size_t u = hashIdentifier.second + 1; - const size_t representativeByteLength = BitsToBytes(representativeBitLength); - const size_t digestSize = hash.DigestSize(); - const size_t saltSize = SaltLen(digestSize); - byte *const h = representative + representativeByteLength - u - digestSize; - - SecByteBlock digest(digestSize), salt(saltSize); - hash.Final(digest); - rng.GenerateBlock(salt, saltSize); - - // compute H = hash of M' - byte c[8]; - PutWord(false, BIG_ENDIAN_ORDER, c, (word32)SafeRightShift<29>(recoverableMessageLength)); - PutWord(false, BIG_ENDIAN_ORDER, c+4, word32(recoverableMessageLength << 3)); - hash.Update(c, 8); - hash.Update(recoverableMessage, recoverableMessageLength); - hash.Update(digest, digestSize); - hash.Update(salt, saltSize); - hash.Final(h); - - // compute representative - GetMGF().GenerateAndMask(hash, representative, representativeByteLength - u - digestSize, h, digestSize, false); - byte *xorStart = representative + representativeByteLength - u - digestSize - salt.size() - recoverableMessageLength - 1; - xorStart[0] ^= 1; - if (recoverableMessage && recoverableMessageLength) - xorbuf(xorStart + 1, recoverableMessage, recoverableMessageLength); - xorbuf(xorStart + 1 + recoverableMessageLength, salt, salt.size()); - if (hashIdentifier.first && hashIdentifier.second) - { - memcpy(representative + representativeByteLength - u, hashIdentifier.first, hashIdentifier.second); - representative[representativeByteLength - 1] = 0xcc; - } - else - { - representative[representativeByteLength - 1] = 0xbc; - } - if (representativeBitLength % 8 != 0) - representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); -} - -DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength, - byte *recoverableMessage) const -{ - CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier); - assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); - - const size_t u = hashIdentifier.second + 1; - const size_t representativeByteLength = BitsToBytes(representativeBitLength); - const size_t digestSize = hash.DigestSize(); - const size_t saltSize = SaltLen(digestSize); - const byte *const h = representative + representativeByteLength - u - digestSize; - - SecByteBlock digest(digestSize); - hash.Final(digest); - - DecodingResult result(0); - bool &valid = result.isValidCoding; - size_t &recoverableMessageLength = result.messageLength; - - valid = (representative[representativeByteLength - 1] == (hashIdentifier.second ? 0xcc : 0xbc)) && valid; - - if (hashIdentifier.first && hashIdentifier.second) - valid = VerifyBufsEqual(representative + representativeByteLength - u, hashIdentifier.first, hashIdentifier.second) && valid; - - GetMGF().GenerateAndMask(hash, representative, representativeByteLength - u - digestSize, h, digestSize); - if (representativeBitLength % 8 != 0) - representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); - - // extract salt and recoverableMessage from DB = 00 ... || 01 || M || salt - byte *salt = representative + representativeByteLength - u - digestSize - saltSize; - byte *M = std::find_if(representative, salt-1, std::bind2nd(std::not_equal_to(), byte(0))); - recoverableMessageLength = salt-M-1; - if (*M == 0x01 && - (size_t)(M - representative - (representativeBitLength % 8 != 0)) >= MinPadLen(digestSize) && - recoverableMessageLength <= MaxRecoverableLength(representativeBitLength, hashIdentifier.second, digestSize)) - { - if (recoverableMessage) - memcpy(recoverableMessage, M+1, recoverableMessageLength); - } - else - { - recoverableMessageLength = 0; - valid = false; - } - - // verify H = hash of M' - byte c[8]; - PutWord(false, BIG_ENDIAN_ORDER, c, (word32)SafeRightShift<29>(recoverableMessageLength)); - PutWord(false, BIG_ENDIAN_ORDER, c+4, word32(recoverableMessageLength << 3)); - hash.Update(c, 8); - hash.Update(recoverableMessage, recoverableMessageLength); - hash.Update(digest, digestSize); - hash.Update(salt, saltSize); - valid = hash.Verify(h) && valid; - - if (!AllowRecovery() && valid && recoverableMessageLength != 0) - {throw NotImplemented("PSSR_MEM: message recovery disabled");} - - return result; -} - -#endif - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/pssr.h b/external/crypto++-5.6.3/pssr.h deleted file mode 100644 index 99e2bc1d8..000000000 --- a/external/crypto++-5.6.3/pssr.h +++ /dev/null @@ -1,73 +0,0 @@ -// pssr.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile pssr.h -//! \brief Classes for probablistic signature schemes - -#ifndef CRYPTOPP_PSSR_H -#define CRYPTOPP_PSSR_H - -#include "cryptlib.h" -#include "pubkey.h" -#include "emsa2.h" - -#ifdef CRYPTOPP_IS_DLL -#include "sha.h" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -class CRYPTOPP_DLL PSSR_MEM_Base : public PK_RecoverableSignatureMessageEncodingMethod -{ - virtual bool AllowRecovery() const =0; - virtual size_t SaltLen(size_t hashLen) const =0; - virtual size_t MinPadLen(size_t hashLen) const =0; - virtual const MaskGeneratingFunction & GetMGF() const =0; - -public: - size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const; - size_t MaxRecoverableLength(size_t representativeBitLength, size_t hashIdentifierLength, size_t digestLength) const; - bool IsProbabilistic() const; - bool AllowNonrecoverablePart() const; - bool RecoverablePartFirst() const; - void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; - DecodingResult RecoverMessageFromRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength, - byte *recoverableMessage) const; -}; - -template class PSSR_MEM_BaseWithHashId; -template<> class PSSR_MEM_BaseWithHashId : public EMSA2HashIdLookup {}; -template<> class PSSR_MEM_BaseWithHashId : public PSSR_MEM_Base {}; - -template -class PSSR_MEM : public PSSR_MEM_BaseWithHashId -{ - virtual bool AllowRecovery() const {return ALLOW_RECOVERY;} - virtual size_t SaltLen(size_t hashLen) const {return SALT_LEN < 0 ? hashLen : SALT_LEN;} - virtual size_t MinPadLen(size_t hashLen) const {return MIN_PAD_LEN < 0 ? hashLen : MIN_PAD_LEN;} - virtual const MaskGeneratingFunction & GetMGF() const {static MGF mgf; return mgf;} - -public: - static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(ALLOW_RECOVERY ? "PSSR-" : "PSS-") + MGF::StaticAlgorithmName();} -}; - -//! PSSR-MGF1 -struct PSSR : public SignatureStandard -{ - typedef PSSR_MEM SignatureMessageEncodingMethod; -}; - -//! PSS-MGF1 -struct PSS : public SignatureStandard -{ - typedef PSSR_MEM SignatureMessageEncodingMethod; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/pubkey.cpp b/external/crypto++-5.6.3/pubkey.cpp deleted file mode 100644 index 9260b5474..000000000 --- a/external/crypto++-5.6.3/pubkey.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// pubkey.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "pubkey.h" -#include "integer.h" -#include "filters.h" - -NAMESPACE_BEGIN(CryptoPP) - -void P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, const byte *derivationParams, size_t derivationParamsLength, bool mask, unsigned int counterStart) -{ - ArraySink *sink; - HashFilter filter(hash, sink = mask ? new ArrayXorSink(output, outputLength) : new ArraySink(output, outputLength)); - word32 counter = counterStart; - while (sink->AvailableSize() > 0) - { - filter.Put(input, inputLength); - filter.PutWord32(counter++); - filter.Put(derivationParams, derivationParamsLength); - filter.MessageEnd(); - } -} - -bool PK_DeterministicSignatureMessageEncodingMethod::VerifyMessageRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - SecByteBlock computedRepresentative(BitsToBytes(representativeBitLength)); - ComputeMessageRepresentative(NullRNG(), NULL, 0, hash, hashIdentifier, messageEmpty, computedRepresentative, representativeBitLength); - return VerifyBufsEqual(representative, computedRepresentative, computedRepresentative.size()); -} - -bool PK_RecoverableSignatureMessageEncodingMethod::VerifyMessageRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const -{ - SecByteBlock recoveredMessage(MaxRecoverableLength(representativeBitLength, hashIdentifier.second, hash.DigestSize())); - DecodingResult result = RecoverMessageFromRepresentative( - hash, hashIdentifier, messageEmpty, representative, representativeBitLength, recoveredMessage); - return result.isValidCoding && result.messageLength == 0; -} - -void TF_SignerBase::InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const -{ - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - HashIdentifier id = GetHashIdentifier(); - const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); - - if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) - throw PK_SignatureScheme::KeyTooShort(); - - size_t maxRecoverableLength = encoding.MaxRecoverableLength(MessageRepresentativeBitLength(), GetHashIdentifier().second, ma.AccessHash().DigestSize()); - - if (maxRecoverableLength == 0) - {throw NotImplemented("TF_SignerBase: this algorithm does not support messsage recovery or the key is too short");} - if (recoverableMessageLength > maxRecoverableLength) - throw InvalidArgument("TF_SignerBase: the recoverable message part is too long for the given key and algorithm"); - - ma.m_recoverableMessage.Assign(recoverableMessage, recoverableMessageLength); - encoding.ProcessRecoverableMessage( - ma.AccessHash(), - recoverableMessage, recoverableMessageLength, - NULL, 0, ma.m_semisignature); -} - -size_t TF_SignerBase::SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart) const -{ - CRYPTOPP_UNUSED(restart); - - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - HashIdentifier id = GetHashIdentifier(); - const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); - - if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) - throw PK_SignatureScheme::KeyTooShort(); - - SecByteBlock representative(MessageRepresentativeLength()); - encoding.ComputeMessageRepresentative(rng, - ma.m_recoverableMessage, ma.m_recoverableMessage.size(), - ma.AccessHash(), id, ma.m_empty, - representative, MessageRepresentativeBitLength()); - ma.m_empty = true; - - Integer r(representative, representative.size()); - size_t signatureLength = SignatureLength(); - GetTrapdoorFunctionInterface().CalculateRandomizedInverse(rng, r).Encode(signature, signatureLength); - return signatureLength; -} - -void TF_VerifierBase::InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const -{ - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - HashIdentifier id = GetHashIdentifier(); - const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); - - if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) - throw PK_SignatureScheme::KeyTooShort(); - - ma.m_representative.New(MessageRepresentativeLength()); - Integer x = GetTrapdoorFunctionInterface().ApplyFunction(Integer(signature, signatureLength)); - if (x.BitCount() > MessageRepresentativeBitLength()) - x = Integer::Zero(); // don't return false here to prevent timing attack - x.Encode(ma.m_representative, ma.m_representative.size()); -} - -bool TF_VerifierBase::VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const -{ - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - HashIdentifier id = GetHashIdentifier(); - const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); - - if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) - throw PK_SignatureScheme::KeyTooShort(); - - bool result = encoding.VerifyMessageRepresentative( - ma.AccessHash(), id, ma.m_empty, ma.m_representative, MessageRepresentativeBitLength()); - ma.m_empty = true; - return result; -} - -DecodingResult TF_VerifierBase::RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const -{ - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - HashIdentifier id = GetHashIdentifier(); - const MessageEncodingInterface &encoding = GetMessageEncodingInterface(); - - if (MessageRepresentativeBitLength() < encoding.MinRepresentativeBitLength(id.second, ma.AccessHash().DigestSize())) - throw PK_SignatureScheme::KeyTooShort(); - - DecodingResult result = encoding.RecoverMessageFromRepresentative( - ma.AccessHash(), id, ma.m_empty, ma.m_representative, MessageRepresentativeBitLength(), recoveredMessage); - ma.m_empty = true; - return result; -} - -DecodingResult TF_DecryptorBase::Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const -{ - if (ciphertextLength != FixedCiphertextLength()) - throw InvalidArgument(AlgorithmName() + ": ciphertext length of " + IntToString(ciphertextLength) + " doesn't match the required length of " + IntToString(FixedCiphertextLength()) + " for this key"); - - SecByteBlock paddedBlock(PaddedBlockByteLength()); - Integer x = GetTrapdoorFunctionInterface().CalculateInverse(rng, Integer(ciphertext, ciphertextLength)); - if (x.ByteCount() > paddedBlock.size()) - x = Integer::Zero(); // don't return false here to prevent timing attack - x.Encode(paddedBlock, paddedBlock.size()); - return GetMessageEncodingInterface().Unpad(paddedBlock, PaddedBlockBitLength(), plaintext, parameters); -} - -void TF_EncryptorBase::Encrypt(RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const -{ - if (plaintextLength > FixedMaxPlaintextLength()) - { - if (FixedMaxPlaintextLength() < 1) - throw InvalidArgument(AlgorithmName() + ": this key is too short to encrypt any messages"); - else - throw InvalidArgument(AlgorithmName() + ": message length of " + IntToString(plaintextLength) + " exceeds the maximum of " + IntToString(FixedMaxPlaintextLength()) + " for this public key"); - } - - SecByteBlock paddedBlock(PaddedBlockByteLength()); - GetMessageEncodingInterface().Pad(rng, plaintext, plaintextLength, paddedBlock, PaddedBlockBitLength(), parameters); - GetTrapdoorFunctionInterface().ApplyRandomizedFunction(rng, Integer(paddedBlock, paddedBlock.size())).Encode(ciphertext, FixedCiphertextLength()); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/pubkey.h b/external/crypto++-5.6.3/pubkey.h deleted file mode 100644 index 198f1f909..000000000 --- a/external/crypto++-5.6.3/pubkey.h +++ /dev/null @@ -1,1968 +0,0 @@ -// pubkey.h - written and placed in the public domain by Wei Dai - -#ifndef CRYPTOPP_PUBKEY_H -#define CRYPTOPP_PUBKEY_H - -//! \file -//! \brief This file contains helper classes/functions for implementing public key algorithms. -//! \details the class hierachies in this header file tend to look like this: -//! -//!
-//!                   x1
-//!                  +--+
-//!                  |  |
-//!                 y1  z1
-//!                  |  |
-//!             x2  x2
-//!                  |  |
-//!                 y2  z2
-//!                  |  |
-//!             x3  x3
-//!                  |  |
-//!                 y3  z3
-//! 
-//! -//!
    -//!
  • x1, y1, z1 are abstract interface classes defined in cryptlib.h -//!
  • x2, y2, z2 are implementations of the interfaces using "abstract policies", which -//! are pure virtual functions that should return interfaces to interchangeable algorithms. -//! These classes have \p Base suffixes. -//!
  • x3, y3, z3 hold actual algorithms and implement those virtual functions. -//! These classes have \p Impl suffixes. -//!
-//! -//! \details The \p TF_ prefix means an implementation using trapdoor functions on integers. -//! \details The \p DL_ prefix means an implementation using group operations (in groups where discrete log is hard). - -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4702) -#endif - -#include "cryptlib.h" -#include "integer.h" -#include "modarith.h" -#include "filters.h" -#include "eprecomp.h" -#include "fips140.h" -#include "argnames.h" -#include "smartptr.h" -#include "stdcpp.h" - -// VC60 workaround: this macro is defined in shlobj.h and conflicts with a template parameter used in this file -#undef INTERFACE - -NAMESPACE_BEGIN(CryptoPP) - -//! \class TrapdoorFunctionBounds -//! \brief Provides range for plaintext and ciphertext lengths -//! \details A trapdoor function is a function that is easy to compute in one direction, -//! but difficult to compute in the opposite direction without special knowledge. -//! The special knowledge is usually the private key. -//! \details Trapdoor functions only handle messages of a limited length or size. -//! \p MaxPreimage is the plaintext's maximum length, and \p MaxImage is the -//! ciphertext's maximum length. -//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), -//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionBounds -{ -public: - virtual ~TrapdoorFunctionBounds() {} - - //! \brief Returns the maximum size of a message before the trapdoor function is applied - //! \returns the maximum size of a message before the trapdoor function is applied - //! \details Derived classes must implement \p PreimageBound(). - virtual Integer PreimageBound() const =0; - //! \brief Returns the maximum size of a message after the trapdoor function is applied - //! \returns the maximum size of a message after the trapdoor function is applied - //! \details Derived classes must implement \p ImageBound(). - virtual Integer ImageBound() const =0; - //! \brief Returns the maximum size of a message before the trapdoor function is applied bound to a public key - //! \returns the maximum size of a message before the trapdoor function is applied bound to a public key - //! \details The default implementation returns PreimageBound() - 1. - virtual Integer MaxPreimage() const {return --PreimageBound();} - //! \brief Returns the maximum size of a message after the trapdoor function is applied bound to a public key - //! \returns the the maximum size of a message after the trapdoor function is applied bound to a public key - //! \details The default implementation returns ImageBound() - 1. - virtual Integer MaxImage() const {return --ImageBound();} -}; - -//! \class RandomizedTrapdoorFunction -//! \brief Applies the trapdoor function, using random data if required -//! \details \p ApplyFunction() is the foundation for encrypting a message under a public key. -//! Derived classes will override it at some point. -//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), -//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunction : public TrapdoorFunctionBounds -{ -public: - - //! \brief Applies the trapdoor function, using random data if required - //! \param rng a \p RandomNumberGenerator derived class - //! \param x the message on which the encryption function is applied - //! \returns the message \p x encrypted under the public key - //! \details \p ApplyRandomizedFunction is a generalization of encryption under a public key - //! cryptosystem. The \p RandomNumberGenerator may (or may not) be required. - //! Derived classes must implement it. - virtual Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const =0; - - //! \brief Determines if the encryption algorithm is randomized - //! \returns \p true if the encryption algorithm is randomized, \p false otherwise - //! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used. - virtual bool IsRandomized() const {return true;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~RandomizedTrapdoorFunction() { } -#endif -}; - -//! \class TrapdoorFunction -//! \brief Applies the trapdoor function -//! \details \p ApplyFunction() is the foundation for encrypting a message under a public key. -//! Derived classes will override it at some point. -//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), -//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunction : public RandomizedTrapdoorFunction -{ -public: -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TrapdoorFunction() { } -#endif - - //! \brief Applies the trapdoor function - //! \param rng a \p RandomNumberGenerator derived class - //! \param x the message on which the encryption function is applied - //! \details \p ApplyRandomizedFunction is a generalization of encryption under a public key - //! cryptosystem. The \p RandomNumberGenerator may (or may not) be required. - //! \details Internally, \p ApplyRandomizedFunction() calls \p ApplyFunction() \a - //! without the \p RandomNumberGenerator. - Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const - {CRYPTOPP_UNUSED(rng); return ApplyFunction(x);} - bool IsRandomized() const {return false;} - - //! \brief Applies the trapdoor - //! \param x the message on which the encryption function is applied - //! \returns the message \p x encrypted under the public key - //! \details \p ApplyFunction is a generalization of encryption under a public key - //! cryptosystem. Derived classes must implement it. - virtual Integer ApplyFunction(const Integer &x) const =0; -}; - -//! \class RandomizedTrapdoorFunctionInverse -//! \brief Applies the inverse of the trapdoor function, using random data if required -//! \details \p CalculateInverse() is the foundation for decrypting a message under a private key -//! in a public key cryptosystem. Derived classes will override it at some point. -//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), -//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunctionInverse -{ -public: - virtual ~RandomizedTrapdoorFunctionInverse() {} - - //! \brief Applies the inverse of the trapdoor function, using random data if required - //! \param rng a \p RandomNumberGenerator derived class - //! \param x the message on which the decryption function is applied - //! \returns the message \p x decrypted under the private key - //! \details \p CalculateRandomizedInverse is a generalization of decryption using the private key - //! The \p RandomNumberGenerator may (or may not) be required. Derived classes must implement it. - virtual Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const =0; - - //! \brief Determines if the decryption algorithm is randomized - //! \returns \p true if the decryption algorithm is randomized, \p false otherwise - //! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used. - virtual bool IsRandomized() const {return true;} -}; - -//! \class TrapdoorFunctionInverse -//! \brief Applies the inverse of the trapdoor function -//! \details \p CalculateInverse() is the foundation for decrypting a message under a private key -//! in a public key cryptosystem. Derived classes will override it at some point. -//! \sa TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), -//! RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse() -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionInverse : public RandomizedTrapdoorFunctionInverse -{ -public: - virtual ~TrapdoorFunctionInverse() {} - - //! \brief Applies the inverse of the trapdoor function - //! \param rng a \p RandomNumberGenerator derived class - //! \param x the message on which the decryption function is applied - //! \returns the message \p x decrypted under the private key - //! \details \p CalculateRandomizedInverse is a generalization of decryption using the private key - //! \details Internally, \p CalculateRandomizedInverse() calls \p CalculateInverse() \a - //! without the \p RandomNumberGenerator. - Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const - {return CalculateInverse(rng, x);} - - //! \brief Determines if the decryption algorithm is randomized - //! \returns \p true if the decryption algorithm is randomized, \p false otherwise - //! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used. - bool IsRandomized() const {return false;} - - virtual Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const =0; -}; - -// ******************************************************** - -//! \class PK_EncryptionMessageEncodingMethod -//! \brief Message encoding method for public key encryption -class CRYPTOPP_NO_VTABLE PK_EncryptionMessageEncodingMethod -{ -public: - virtual ~PK_EncryptionMessageEncodingMethod() {} - - virtual bool ParameterSupported(const char *name) const - {CRYPTOPP_UNUSED(name); return false;} - - //! max size of unpadded message in bytes, given max size of padded message in bits (1 less than size of modulus) - virtual size_t MaxUnpaddedLength(size_t paddedLength) const =0; - - virtual void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedBitLength, const NameValuePairs ¶meters) const =0; - - virtual DecodingResult Unpad(const byte *padded, size_t paddedBitLength, byte *raw, const NameValuePairs ¶meters) const =0; -}; - -// ******************************************************** - -//! \class TF_Base -//! \brief The base for trapdoor based cryptosystems -//! \tparam TFI trapdoor function interface derived class -//! \tparam MEI message encoding interface derived class -template -class CRYPTOPP_NO_VTABLE TF_Base -{ -protected: - virtual const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const =0; - - typedef TFI TrapdoorFunctionInterface; - virtual const TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const =0; - - typedef MEI MessageEncodingInterface; - virtual const MessageEncodingInterface & GetMessageEncodingInterface() const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_Base() { } -#endif -}; - -// ******************************************************** - -//! \class PK_FixedLengthCryptoSystemImpl -//! \brief Public key trapdoor function base class -//! \tparam BASE public key cryptosystem with a fixed length -template -class CRYPTOPP_NO_VTABLE PK_FixedLengthCryptoSystemImpl : public BASE -{ -public: - size_t MaxPlaintextLength(size_t ciphertextLength) const - {return ciphertextLength == FixedCiphertextLength() ? FixedMaxPlaintextLength() : 0;} - size_t CiphertextLength(size_t plaintextLength) const - {return plaintextLength <= FixedMaxPlaintextLength() ? FixedCiphertextLength() : 0;} - - virtual size_t FixedMaxPlaintextLength() const =0; - virtual size_t FixedCiphertextLength() const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~PK_FixedLengthCryptoSystemImpl() { } -#endif -}; - -//! \class TF_CryptoSystemBase -//! \brief Trapdoor function cryptosystem base class -//! \tparam INTERFACE public key cryptosystem base interface -//! \tparam BASE public key cryptosystem implementation base -template -class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl, protected BASE -{ -public: - bool ParameterSupported(const char *name) const {return this->GetMessageEncodingInterface().ParameterSupported(name);} - size_t FixedMaxPlaintextLength() const {return this->GetMessageEncodingInterface().MaxUnpaddedLength(PaddedBlockBitLength());} - size_t FixedCiphertextLength() const {return this->GetTrapdoorFunctionBounds().MaxImage().ByteCount();} - -protected: - size_t PaddedBlockByteLength() const {return BitsToBytes(PaddedBlockBitLength());} - // Coverity finding on potential overflow/underflow. - size_t PaddedBlockBitLength() const {return SaturatingSubtract(this->GetTrapdoorFunctionBounds().PreimageBound().BitCount(),1U);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_CryptoSystemBase() { } -#endif -}; - -//! \class TF_DecryptorBase -//! \brief Trapdoor function cryptosystems decryption base class -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_DecryptorBase : public TF_CryptoSystemBase > -{ -public: - DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_DecryptorBase() { } -#endif -}; - -//! \class TF_DecryptorBase -//! \brief Trapdoor function cryptosystems encryption base class -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_EncryptorBase : public TF_CryptoSystemBase > -{ -public: - void Encrypt(RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_EncryptorBase() { } -#endif -}; - -// ******************************************************** - -typedef std::pair HashIdentifier; - -//! \class PK_SignatureMessageEncodingMethod -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p PK_SignatureMessageEncodingMethod provides interfaces for message -//! encoding method for public key signature schemes. The methods support both -//! trapdoor functions (TF_*) and discrete logarithm (DL_*) -//! based schemes. -class CRYPTOPP_NO_VTABLE PK_SignatureMessageEncodingMethod -{ -public: - virtual ~PK_SignatureMessageEncodingMethod() {} - - virtual size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const - {CRYPTOPP_UNUSED(hashIdentifierLength); CRYPTOPP_UNUSED(digestLength); return 0;} - virtual size_t MaxRecoverableLength(size_t representativeBitLength, size_t hashIdentifierLength, size_t digestLength) const - {CRYPTOPP_UNUSED(representativeBitLength); CRYPTOPP_UNUSED(representativeBitLength); CRYPTOPP_UNUSED(hashIdentifierLength); CRYPTOPP_UNUSED(digestLength); return 0;} - - bool IsProbabilistic() const - {return true;} - bool AllowNonrecoverablePart() const - {throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} - virtual bool RecoverablePartFirst() const - {throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} - - // for verification, DL - virtual void ProcessSemisignature(HashTransformation &hash, const byte *semisignature, size_t semisignatureLength) const - {CRYPTOPP_UNUSED(hash); CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength);} - - // for signature - virtual void ProcessRecoverableMessage(HashTransformation &hash, - const byte *recoverableMessage, size_t recoverableMessageLength, - const byte *presignature, size_t presignatureLength, - SecByteBlock &semisignature) const - { - CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(recoverableMessage); CRYPTOPP_UNUSED(recoverableMessageLength); - CRYPTOPP_UNUSED(presignature); CRYPTOPP_UNUSED(presignatureLength); CRYPTOPP_UNUSED(semisignature); - if (RecoverablePartFirst()) - assert(!"ProcessRecoverableMessage() not implemented"); - } - - virtual void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const =0; - - virtual bool VerifyMessageRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const =0; - - virtual DecodingResult RecoverMessageFromRepresentative( // for TF - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength, - byte *recoveredMessage) const - {CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(messageEmpty); - CRYPTOPP_UNUSED(representative); CRYPTOPP_UNUSED(representativeBitLength); CRYPTOPP_UNUSED(recoveredMessage); - throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} - - virtual DecodingResult RecoverMessageFromSemisignature( // for DL - HashTransformation &hash, HashIdentifier hashIdentifier, - const byte *presignature, size_t presignatureLength, - const byte *semisignature, size_t semisignatureLength, - byte *recoveredMessage) const - {CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(presignature); CRYPTOPP_UNUSED(presignatureLength); - CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength); CRYPTOPP_UNUSED(recoveredMessage); - throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");} - - // VC60 workaround - struct HashIdentifierLookup - { - template struct HashIdentifierLookup2 - { - static HashIdentifier CRYPTOPP_API Lookup() - { - return HashIdentifier((const byte *)NULL, 0); - } - }; - }; -}; - -//! \class PK_DeterministicSignatureMessageEncodingMethod -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p PK_DeterministicSignatureMessageEncodingMethod provides interfaces -//! for message encoding method for public key signature schemes. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_DeterministicSignatureMessageEncodingMethod : public PK_SignatureMessageEncodingMethod -{ -public: - bool VerifyMessageRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; -}; - -//! \class PK_RecoverableSignatureMessageEncodingMethod -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p PK_RecoverableSignatureMessageEncodingMethod provides interfaces -//! for message encoding method for public key signature schemes. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_RecoverableSignatureMessageEncodingMethod : public PK_SignatureMessageEncodingMethod -{ -public: - bool VerifyMessageRepresentative( - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; -}; - -//! \class DL_SignatureMessageEncodingMethod_DSA -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p DL_SignatureMessageEncodingMethod_DSA provides interfaces -//! for message encoding method for DSA. -class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_DSA : public PK_DeterministicSignatureMessageEncodingMethod -{ -public: - void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; -}; - -//! \class DL_SignatureMessageEncodingMethod_NR -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p DL_SignatureMessageEncodingMethod_NR provides interfaces -//! for message encoding method for Nyberg-Rueppel. -class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_NR : public PK_DeterministicSignatureMessageEncodingMethod -{ -public: - void ComputeMessageRepresentative(RandomNumberGenerator &rng, - const byte *recoverableMessage, size_t recoverableMessageLength, - HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, - byte *representative, size_t representativeBitLength) const; -}; - -//! \class PK_MessageAccumulatorBase -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p PK_MessageAccumulatorBase provides interfaces -//! for message encoding method. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulatorBase : public PK_MessageAccumulator -{ -public: - PK_MessageAccumulatorBase() : m_empty(true) {} - - virtual HashTransformation & AccessHash() =0; - - void Update(const byte *input, size_t length) - { - AccessHash().Update(input, length); - m_empty = m_empty && length == 0; - } - - SecByteBlock m_recoverableMessage, m_representative, m_presignature, m_semisignature; - Integer m_k, m_s; - bool m_empty; -}; - -//! \class PK_MessageAccumulatorImpl -//! \brief Interface for message encoding method for public key signature schemes. -//! \details \p PK_MessageAccumulatorBase provides interfaces -//! for message encoding method. -template -class PK_MessageAccumulatorImpl : public PK_MessageAccumulatorBase, protected ObjectHolder -{ -public: - HashTransformation & AccessHash() {return this->m_object;} -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE -{ -public: - size_t SignatureLength() const - {return this->GetTrapdoorFunctionBounds().MaxPreimage().ByteCount();} - size_t MaxRecoverableLength() const - {return this->GetMessageEncodingInterface().MaxRecoverableLength(MessageRepresentativeBitLength(), GetHashIdentifier().second, GetDigestSize());} - size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const - {CRYPTOPP_UNUSED(signatureLength); return this->MaxRecoverableLength();} - - bool IsProbabilistic() const - {return this->GetTrapdoorFunctionInterface().IsRandomized() || this->GetMessageEncodingInterface().IsProbabilistic();} - bool AllowNonrecoverablePart() const - {return this->GetMessageEncodingInterface().AllowNonrecoverablePart();} - bool RecoverablePartFirst() const - {return this->GetMessageEncodingInterface().RecoverablePartFirst();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_SignatureSchemeBase() { } -#endif - -protected: - size_t MessageRepresentativeLength() const {return BitsToBytes(MessageRepresentativeBitLength());} - // Coverity finding on potential overflow/underflow. - size_t MessageRepresentativeBitLength() const {return SaturatingSubtract(this->GetTrapdoorFunctionBounds().ImageBound().BitCount(),1U);} - virtual HashIdentifier GetHashIdentifier() const =0; - virtual size_t GetDigestSize() const =0; -}; - -//! _ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_SignerBase : public TF_SignatureSchemeBase > -{ -public: - void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const; - size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_SignerBase() { } -#endif -}; - -//! _ -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_VerifierBase : public TF_SignatureSchemeBase > -{ -public: - void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const; - bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const; - DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &recoveryAccumulator) const; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_VerifierBase() { } -#endif -}; - -// ******************************************************** - -//! _ -template -struct TF_CryptoSchemeOptions -{ - typedef T1 AlgorithmInfo; - typedef T2 Keys; - typedef typename Keys::PrivateKey PrivateKey; - typedef typename Keys::PublicKey PublicKey; - typedef T3 MessageEncodingMethod; -}; - -//! _ -template -struct TF_SignatureSchemeOptions : public TF_CryptoSchemeOptions -{ - typedef T4 HashFunction; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE TF_ObjectImplBase : public AlgorithmImpl -{ -public: - typedef SCHEME_OPTIONS SchemeOptions; - typedef KEY_CLASS KeyClass; - - PublicKey & AccessPublicKey() {return AccessKey();} - const PublicKey & GetPublicKey() const {return GetKey();} - - PrivateKey & AccessPrivateKey() {return AccessKey();} - const PrivateKey & GetPrivateKey() const {return GetKey();} - - virtual const KeyClass & GetKey() const =0; - virtual KeyClass & AccessKey() =0; - - const KeyClass & GetTrapdoorFunction() const {return GetKey();} - - PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const - { - CRYPTOPP_UNUSED(rng); - return new PK_MessageAccumulatorImpl; - } - PK_MessageAccumulator * NewVerificationAccumulator() const - { - return new PK_MessageAccumulatorImpl; - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_ObjectImplBase() { } -#endif - -protected: - const typename BASE::MessageEncodingInterface & GetMessageEncodingInterface() const - {return Singleton().Ref();} - const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const - {return GetKey();} - const typename BASE::TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const - {return GetKey();} - - // for signature scheme - HashIdentifier GetHashIdentifier() const - { - typedef CPP_TYPENAME SchemeOptions::MessageEncodingMethod::HashIdentifierLookup::template HashIdentifierLookup2 L; - return L::Lookup(); - } - size_t GetDigestSize() const - { - typedef CPP_TYPENAME SchemeOptions::HashFunction H; - return H::DIGESTSIZE; - } -}; - -//! _ -template -class TF_ObjectImplExtRef : public TF_ObjectImplBase -{ -public: - TF_ObjectImplExtRef(const KEY *pKey = NULL) : m_pKey(pKey) {} - void SetKeyPtr(const KEY *pKey) {m_pKey = pKey;} - - const KEY & GetKey() const {return *m_pKey;} - KEY & AccessKey() {throw NotImplemented("TF_ObjectImplExtRef: cannot modify refererenced key");} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_ObjectImplExtRef() { } -#endif - -private: - const KEY * m_pKey; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE TF_ObjectImpl : public TF_ObjectImplBase -{ -public: - typedef KEY_CLASS KeyClass; - - const KeyClass & GetKey() const {return m_trapdoorFunction;} - KeyClass & AccessKey() {return m_trapdoorFunction;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~TF_ObjectImpl() { } -#endif - -private: - KeyClass m_trapdoorFunction; -}; - -//! _ -template -class TF_DecryptorImpl : public TF_ObjectImpl -{ -}; - -//! _ -template -class TF_EncryptorImpl : public TF_ObjectImpl -{ -}; - -//! _ -template -class TF_SignerImpl : public TF_ObjectImpl -{ -}; - -//! _ -template -class TF_VerifierImpl : public TF_ObjectImpl -{ -}; - -// ******************************************************** - -//! _ -class CRYPTOPP_NO_VTABLE MaskGeneratingFunction -{ -public: - virtual ~MaskGeneratingFunction() {} - virtual void GenerateAndMask(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, bool mask = true) const =0; -}; - -CRYPTOPP_DLL void CRYPTOPP_API P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, const byte *derivationParams, size_t derivationParamsLength, bool mask, unsigned int counterStart); - -//! _ -class P1363_MGF1 : public MaskGeneratingFunction -{ -public: - static const char * CRYPTOPP_API StaticAlgorithmName() {return "MGF1";} - void GenerateAndMask(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, bool mask = true) const - { - P1363_MGF1KDF2_Common(hash, output, outputLength, input, inputLength, NULL, 0, mask, 0); - } -}; - -// ******************************************************** - -//! _ -template -class P1363_KDF2 -{ -public: - static void CRYPTOPP_API DeriveKey(byte *output, size_t outputLength, const byte *input, size_t inputLength, const byte *derivationParams, size_t derivationParamsLength) - { - H h; - P1363_MGF1KDF2_Common(h, output, outputLength, input, inputLength, derivationParams, derivationParamsLength, false, 1); - } -}; - -// ******************************************************** - -//! to be thrown by DecodeElement and AgreeWithStaticPrivateKey -class DL_BadElement : public InvalidDataFormat -{ -public: - DL_BadElement() : InvalidDataFormat("CryptoPP: invalid group element") {} -}; - -//! interface for DL group parameters -template -class CRYPTOPP_NO_VTABLE DL_GroupParameters : public CryptoParameters -{ - typedef DL_GroupParameters ThisClass; - -public: - typedef T Element; - - DL_GroupParameters() : m_validationLevel(0) {} - - // CryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const - { - if (!GetBasePrecomputation().IsInitialized()) - return false; - - if (m_validationLevel > level) - return true; - - bool pass = ValidateGroup(rng, level); - pass = pass && ValidateElement(level, GetSubgroupGenerator(), &GetBasePrecomputation()); - - m_validationLevel = pass ? level+1 : 0; - - return pass; - } - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper(this, name, valueType, pValue) - CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupOrder) - CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupGenerator) - ; - } - - bool SupportsPrecomputation() const {return true;} - - void Precompute(unsigned int precomputationStorage=16) - { - AccessBasePrecomputation().Precompute(GetGroupPrecomputation(), GetSubgroupOrder().BitCount(), precomputationStorage); - } - - void LoadPrecomputation(BufferedTransformation &storedPrecomputation) - { - AccessBasePrecomputation().Load(GetGroupPrecomputation(), storedPrecomputation); - m_validationLevel = 0; - } - - void SavePrecomputation(BufferedTransformation &storedPrecomputation) const - { - GetBasePrecomputation().Save(GetGroupPrecomputation(), storedPrecomputation); - } - - // non-inherited - virtual const Element & GetSubgroupGenerator() const {return GetBasePrecomputation().GetBase(GetGroupPrecomputation());} - virtual void SetSubgroupGenerator(const Element &base) {AccessBasePrecomputation().SetBase(GetGroupPrecomputation(), base);} - virtual Element ExponentiateBase(const Integer &exponent) const - { - return GetBasePrecomputation().Exponentiate(GetGroupPrecomputation(), exponent); - } - virtual Element ExponentiateElement(const Element &base, const Integer &exponent) const - { - Element result; - SimultaneousExponentiate(&result, base, &exponent, 1); - return result; - } - - virtual const DL_GroupPrecomputation & GetGroupPrecomputation() const =0; - virtual const DL_FixedBasePrecomputation & GetBasePrecomputation() const =0; - virtual DL_FixedBasePrecomputation & AccessBasePrecomputation() =0; - virtual const Integer & GetSubgroupOrder() const =0; // order of subgroup generated by base element - virtual Integer GetMaxExponent() const =0; - virtual Integer GetGroupOrder() const {return GetSubgroupOrder()*GetCofactor();} // one of these two needs to be overriden - virtual Integer GetCofactor() const {return GetGroupOrder()/GetSubgroupOrder();} - virtual unsigned int GetEncodedElementSize(bool reversible) const =0; - virtual void EncodeElement(bool reversible, const Element &element, byte *encoded) const =0; - virtual Element DecodeElement(const byte *encoded, bool checkForGroupMembership) const =0; - virtual Integer ConvertElementToInteger(const Element &element) const =0; - virtual bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const =0; - virtual bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation *precomp) const =0; - virtual bool FastSubgroupCheckAvailable() const =0; - virtual bool IsIdentity(const Element &element) const =0; - virtual void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParameters() { } -#endif - -protected: - void ParametersChanged() {m_validationLevel = 0;} - -private: - mutable unsigned int m_validationLevel; -}; - -//! _ -template , class BASE = DL_GroupParameters > -class DL_GroupParametersImpl : public BASE -{ -public: - typedef GROUP_PRECOMP GroupPrecomputation; - typedef typename GROUP_PRECOMP::Element Element; - typedef BASE_PRECOMP BasePrecomputation; - - const DL_GroupPrecomputation & GetGroupPrecomputation() const {return m_groupPrecomputation;} - const DL_FixedBasePrecomputation & GetBasePrecomputation() const {return m_gpc;} - DL_FixedBasePrecomputation & AccessBasePrecomputation() {return m_gpc;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_GroupParametersImpl() { } -#endif - -protected: - GROUP_PRECOMP m_groupPrecomputation; - BASE_PRECOMP m_gpc; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_Key -{ -public: - virtual const DL_GroupParameters & GetAbstractGroupParameters() const =0; - virtual DL_GroupParameters & AccessAbstractGroupParameters() =0; -}; - -//! interface for DL public keys -template -class CRYPTOPP_NO_VTABLE DL_PublicKey : public DL_Key -{ - typedef DL_PublicKey ThisClass; - -public: - typedef T Element; - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper(this, name, valueType, pValue, &this->GetAbstractGroupParameters()) - CRYPTOPP_GET_FUNCTION_ENTRY(PublicElement); - } - - void AssignFrom(const NameValuePairs &source); - - // non-inherited - virtual const Element & GetPublicElement() const {return GetPublicPrecomputation().GetBase(this->GetAbstractGroupParameters().GetGroupPrecomputation());} - virtual void SetPublicElement(const Element &y) {AccessPublicPrecomputation().SetBase(this->GetAbstractGroupParameters().GetGroupPrecomputation(), y);} - virtual Element ExponentiatePublicElement(const Integer &exponent) const - { - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - return GetPublicPrecomputation().Exponentiate(params.GetGroupPrecomputation(), exponent); - } - virtual Element CascadeExponentiateBaseAndPublicElement(const Integer &baseExp, const Integer &publicExp) const - { - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - return params.GetBasePrecomputation().CascadeExponentiate(params.GetGroupPrecomputation(), baseExp, GetPublicPrecomputation(), publicExp); - } - - virtual const DL_FixedBasePrecomputation & GetPublicPrecomputation() const =0; - virtual DL_FixedBasePrecomputation & AccessPublicPrecomputation() =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PublicKey() { } -#endif -}; - -//! interface for DL private keys -template -class CRYPTOPP_NO_VTABLE DL_PrivateKey : public DL_Key -{ - typedef DL_PrivateKey ThisClass; - -public: - typedef T Element; - - void MakePublicKey(DL_PublicKey &pub) const - { - pub.AccessAbstractGroupParameters().AssignFrom(this->GetAbstractGroupParameters()); - pub.SetPublicElement(this->GetAbstractGroupParameters().ExponentiateBase(GetPrivateExponent())); - } - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper(this, name, valueType, pValue, &this->GetAbstractGroupParameters()) - CRYPTOPP_GET_FUNCTION_ENTRY(PrivateExponent); - } - - void AssignFrom(const NameValuePairs &source) - { - this->AccessAbstractGroupParameters().AssignFrom(source); - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(PrivateExponent); - } - - virtual const Integer & GetPrivateExponent() const =0; - virtual void SetPrivateExponent(const Integer &x) =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_PrivateKey() { } -#endif -}; - -template -void DL_PublicKey::AssignFrom(const NameValuePairs &source) -{ - DL_PrivateKey *pPrivateKey = NULL; - if (source.GetThisPointer(pPrivateKey)) - pPrivateKey->MakePublicKey(*this); - else - { - this->AccessAbstractGroupParameters().AssignFrom(source); - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(PublicElement); - } -} - -class OID; - -//! _ -template -class DL_KeyImpl : public PK -{ -public: - typedef GP GroupParameters; - - O GetAlgorithmID() const {return GetGroupParameters().GetAlgorithmID();} -// void BERDecode(BufferedTransformation &bt) -// {PK::BERDecode(bt);} -// void DEREncode(BufferedTransformation &bt) const -// {PK::DEREncode(bt);} - bool BERDecodeAlgorithmParameters(BufferedTransformation &bt) - {AccessGroupParameters().BERDecode(bt); return true;} - bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const - {GetGroupParameters().DEREncode(bt); return true;} - - const GP & GetGroupParameters() const {return m_groupParameters;} - GP & AccessGroupParameters() {return m_groupParameters;} - -private: - GP m_groupParameters; -}; - -class X509PublicKey; -class PKCS8PrivateKey; - -//! _ -template -class DL_PrivateKeyImpl : public DL_PrivateKey, public DL_KeyImpl -{ -public: - typedef typename GP::Element Element; - - // GeneratableCryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const - { - bool pass = GetAbstractGroupParameters().Validate(rng, level); - - const Integer &q = GetAbstractGroupParameters().GetSubgroupOrder(); - const Integer &x = GetPrivateExponent(); - - pass = pass && x.IsPositive() && x < q; - if (level >= 1) - pass = pass && Integer::Gcd(x, q) == Integer::One(); - return pass; - } - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper >(this, name, valueType, pValue).Assignable(); - } - - void AssignFrom(const NameValuePairs &source) - { - AssignFromHelper >(this, source); - } - - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms) - { - if (!params.GetThisObject(this->AccessGroupParameters())) - this->AccessGroupParameters().GenerateRandom(rng, params); -// std::pair seed; - Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent()); -// Integer::ANY, Integer::Zero(), Integer::One(), -// params.GetValue("DeterministicKeyGenerationSeed", seed) ? &seed : NULL); - SetPrivateExponent(x); - } - - bool SupportsPrecomputation() const {return true;} - - void Precompute(unsigned int precomputationStorage=16) - {AccessAbstractGroupParameters().Precompute(precomputationStorage);} - - void LoadPrecomputation(BufferedTransformation &storedPrecomputation) - {AccessAbstractGroupParameters().LoadPrecomputation(storedPrecomputation);} - - void SavePrecomputation(BufferedTransformation &storedPrecomputation) const - {GetAbstractGroupParameters().SavePrecomputation(storedPrecomputation);} - - // DL_Key - const DL_GroupParameters & GetAbstractGroupParameters() const {return this->GetGroupParameters();} - DL_GroupParameters & AccessAbstractGroupParameters() {return this->AccessGroupParameters();} - - // DL_PrivateKey - const Integer & GetPrivateExponent() const {return m_x;} - void SetPrivateExponent(const Integer &x) {m_x = x;} - - // PKCS8PrivateKey - void BERDecodePrivateKey(BufferedTransformation &bt, bool, size_t) - {m_x.BERDecode(bt);} - void DEREncodePrivateKey(BufferedTransformation &bt) const - {m_x.DEREncode(bt);} - -private: - Integer m_x; -}; - -//! _ -template -class DL_PrivateKey_WithSignaturePairwiseConsistencyTest : public BASE -{ -public: - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms) - { - BASE::GenerateRandom(rng, params); - - if (FIPS_140_2_ComplianceEnabled()) - { - typename SIGNATURE_SCHEME::Signer signer(*this); - typename SIGNATURE_SCHEME::Verifier verifier(signer); - SignaturePairwiseConsistencyTest_FIPS_140_Only(signer, verifier); - } - } -}; - -//! _ -template -class DL_PublicKeyImpl : public DL_PublicKey, public DL_KeyImpl -{ -public: - typedef typename GP::Element Element; - - // CryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const - { - bool pass = GetAbstractGroupParameters().Validate(rng, level); - pass = pass && GetAbstractGroupParameters().ValidateElement(level, this->GetPublicElement(), &GetPublicPrecomputation()); - return pass; - } - - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - { - return GetValueHelper >(this, name, valueType, pValue).Assignable(); - } - - void AssignFrom(const NameValuePairs &source) - { - AssignFromHelper >(this, source); - } - - bool SupportsPrecomputation() const {return true;} - - void Precompute(unsigned int precomputationStorage=16) - { - AccessAbstractGroupParameters().Precompute(precomputationStorage); - AccessPublicPrecomputation().Precompute(GetAbstractGroupParameters().GetGroupPrecomputation(), GetAbstractGroupParameters().GetSubgroupOrder().BitCount(), precomputationStorage); - } - - void LoadPrecomputation(BufferedTransformation &storedPrecomputation) - { - AccessAbstractGroupParameters().LoadPrecomputation(storedPrecomputation); - AccessPublicPrecomputation().Load(GetAbstractGroupParameters().GetGroupPrecomputation(), storedPrecomputation); - } - - void SavePrecomputation(BufferedTransformation &storedPrecomputation) const - { - GetAbstractGroupParameters().SavePrecomputation(storedPrecomputation); - GetPublicPrecomputation().Save(GetAbstractGroupParameters().GetGroupPrecomputation(), storedPrecomputation); - } - - // DL_Key - const DL_GroupParameters & GetAbstractGroupParameters() const {return this->GetGroupParameters();} - DL_GroupParameters & AccessAbstractGroupParameters() {return this->AccessGroupParameters();} - - // DL_PublicKey - const DL_FixedBasePrecomputation & GetPublicPrecomputation() const {return m_ypc;} - DL_FixedBasePrecomputation & AccessPublicPrecomputation() {return m_ypc;} - - // non-inherited - bool operator==(const DL_PublicKeyImpl &rhs) const - {return this->GetGroupParameters() == rhs.GetGroupParameters() && this->GetPublicElement() == rhs.GetPublicElement();} - -private: - typename GP::BasePrecomputation m_ypc; -}; - -//! interface for Elgamal-like signature algorithms -template -class CRYPTOPP_NO_VTABLE DL_ElgamalLikeSignatureAlgorithm -{ -public: - virtual void Sign(const DL_GroupParameters ¶ms, const Integer &privateKey, const Integer &k, const Integer &e, Integer &r, Integer &s) const =0; - virtual bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const =0; - virtual Integer RecoverPresignature(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &r, const Integer &s) const - { - CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(publicKey); CRYPTOPP_UNUSED(r); CRYPTOPP_UNUSED(s); - throw NotImplemented("DL_ElgamalLikeSignatureAlgorithm: this signature scheme does not support message recovery"); - } - virtual size_t RLen(const DL_GroupParameters ¶ms) const - {return params.GetSubgroupOrder().ByteCount();} - virtual size_t SLen(const DL_GroupParameters ¶ms) const - {return params.GetSubgroupOrder().ByteCount();} -}; - -//! interface for DL key agreement algorithms -template -class CRYPTOPP_NO_VTABLE DL_KeyAgreementAlgorithm -{ -public: - typedef T Element; - - virtual Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters ¶ms, const DL_FixedBasePrecomputation &publicPrecomputation, const Integer &privateExponent) const =0; - virtual Element AgreeWithStaticPrivateKey(const DL_GroupParameters ¶ms, const Element &publicElement, bool validateOtherPublicKey, const Integer &privateExponent) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_KeyAgreementAlgorithm() { } -#endif -}; - -//! interface for key derivation algorithms used in DL cryptosystems -template -class CRYPTOPP_NO_VTABLE DL_KeyDerivationAlgorithm -{ -public: - virtual bool ParameterSupported(const char *name) const - {CRYPTOPP_UNUSED(name); return false;} - virtual void Derive(const DL_GroupParameters &groupParams, byte *derivedKey, size_t derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs &derivationParams) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_KeyDerivationAlgorithm() { } -#endif -}; - -//! interface for symmetric encryption algorithms used in DL cryptosystems -class CRYPTOPP_NO_VTABLE DL_SymmetricEncryptionAlgorithm -{ -public: - virtual bool ParameterSupported(const char *name) const - {CRYPTOPP_UNUSED(name); return false;} - virtual size_t GetSymmetricKeyLength(size_t plaintextLength) const =0; - virtual size_t GetSymmetricCiphertextLength(size_t plaintextLength) const =0; - virtual size_t GetMaxSymmetricPlaintextLength(size_t ciphertextLength) const =0; - virtual void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const =0; - virtual DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_SymmetricEncryptionAlgorithm() { } -#endif -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_Base -{ -protected: - typedef KI KeyInterface; - typedef typename KI::Element Element; - - const DL_GroupParameters & GetAbstractGroupParameters() const {return GetKeyInterface().GetAbstractGroupParameters();} - DL_GroupParameters & AccessAbstractGroupParameters() {return AccessKeyInterface().AccessAbstractGroupParameters();} - - virtual KeyInterface & AccessKeyInterface() =0; - virtual const KeyInterface & GetKeyInterface() const =0; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_Base() { } -#endif -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_SignatureSchemeBase : public INTERFACE, public DL_Base -{ -public: - size_t SignatureLength() const - { - return GetSignatureAlgorithm().RLen(this->GetAbstractGroupParameters()) - + GetSignatureAlgorithm().SLen(this->GetAbstractGroupParameters()); - } - size_t MaxRecoverableLength() const - {return GetMessageEncodingInterface().MaxRecoverableLength(0, GetHashIdentifier().second, GetDigestSize());} - size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const - {CRYPTOPP_UNUSED(signatureLength); assert(false); return 0;} // TODO - - bool IsProbabilistic() const - {return true;} - bool AllowNonrecoverablePart() const - {return GetMessageEncodingInterface().AllowNonrecoverablePart();} - bool RecoverablePartFirst() const - {return GetMessageEncodingInterface().RecoverablePartFirst();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_SignatureSchemeBase() { } -#endif - -protected: - size_t MessageRepresentativeLength() const {return BitsToBytes(MessageRepresentativeBitLength());} - size_t MessageRepresentativeBitLength() const {return this->GetAbstractGroupParameters().GetSubgroupOrder().BitCount();} - - virtual const DL_ElgamalLikeSignatureAlgorithm & GetSignatureAlgorithm() const =0; - virtual const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const =0; - virtual HashIdentifier GetHashIdentifier() const =0; - virtual size_t GetDigestSize() const =0; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_SignerBase : public DL_SignatureSchemeBase > -{ -public: - // for validation testing - void RawSign(const Integer &k, const Integer &e, Integer &r, Integer &s) const - { - const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - const DL_PrivateKey &key = this->GetKeyInterface(); - - r = params.ConvertElementToInteger(params.ExponentiateBase(k)); - alg.Sign(params, key.GetPrivateExponent(), k, e, r, s); - } - - void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const - { - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - ma.m_recoverableMessage.Assign(recoverableMessage, recoverableMessageLength); - this->GetMessageEncodingInterface().ProcessRecoverableMessage(ma.AccessHash(), - recoverableMessage, recoverableMessageLength, - ma.m_presignature, ma.m_presignature.size(), - ma.m_semisignature); - } - - size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart) const - { - this->GetMaterial().DoQuickSanityCheck(); - - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - const DL_PrivateKey &key = this->GetKeyInterface(); - - SecByteBlock representative(this->MessageRepresentativeLength()); - this->GetMessageEncodingInterface().ComputeMessageRepresentative( - rng, - ma.m_recoverableMessage, ma.m_recoverableMessage.size(), - ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty, - representative, this->MessageRepresentativeBitLength()); - ma.m_empty = true; - Integer e(representative, representative.size()); - - // hash message digest into random number k to prevent reusing the same k on a different messages - // after virtual machine rollback - if (rng.CanIncorporateEntropy()) - rng.IncorporateEntropy(representative, representative.size()); - Integer k(rng, 1, params.GetSubgroupOrder()-1); - Integer r, s; - r = params.ConvertElementToInteger(params.ExponentiateBase(k)); - alg.Sign(params, key.GetPrivateExponent(), k, e, r, s); - - /* - Integer r, s; - if (this->MaxRecoverableLength() > 0) - r.Decode(ma.m_semisignature, ma.m_semisignature.size()); - else - r.Decode(ma.m_presignature, ma.m_presignature.size()); - alg.Sign(params, key.GetPrivateExponent(), ma.m_k, e, r, s); - */ - - size_t rLen = alg.RLen(params); - r.Encode(signature, rLen); - s.Encode(signature+rLen, alg.SLen(params)); - - if (restart) - RestartMessageAccumulator(rng, ma); - - return this->SignatureLength(); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_SignerBase() { } -#endif - -protected: - void RestartMessageAccumulator(RandomNumberGenerator &rng, PK_MessageAccumulatorBase &ma) const - { - // k needs to be generated before hashing for signature schemes with recovery - // but to defend against VM rollbacks we need to generate k after hashing. - // so this code is commented out, since no DL-based signature scheme with recovery - // has been implemented in Crypto++ anyway - /* - const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - ma.m_k.Randomize(rng, 1, params.GetSubgroupOrder()-1); - ma.m_presignature.New(params.GetEncodedElementSize(false)); - params.ConvertElementToInteger(params.ExponentiateBase(ma.m_k)).Encode(ma.m_presignature, ma.m_presignature.size()); - */ - CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(ma); - } -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_VerifierBase : public DL_SignatureSchemeBase > -{ -public: - void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const - { - CRYPTOPP_UNUSED(signature); CRYPTOPP_UNUSED(signatureLength); - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - - size_t rLen = alg.RLen(params); - ma.m_semisignature.Assign(signature, rLen); - ma.m_s.Decode(signature+rLen, alg.SLen(params)); - - this->GetMessageEncodingInterface().ProcessSemisignature(ma.AccessHash(), ma.m_semisignature, ma.m_semisignature.size()); - } - - bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const - { - this->GetMaterial().DoQuickSanityCheck(); - - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - const DL_PublicKey &key = this->GetKeyInterface(); - - SecByteBlock representative(this->MessageRepresentativeLength()); - this->GetMessageEncodingInterface().ComputeMessageRepresentative(NullRNG(), ma.m_recoverableMessage, ma.m_recoverableMessage.size(), - ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty, - representative, this->MessageRepresentativeBitLength()); - ma.m_empty = true; - Integer e(representative, representative.size()); - - Integer r(ma.m_semisignature, ma.m_semisignature.size()); - return alg.Verify(params, key, e, r, ma.m_s); - } - - DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const - { - this->GetMaterial().DoQuickSanityCheck(); - - PK_MessageAccumulatorBase &ma = static_cast(messageAccumulator); - const DL_ElgamalLikeSignatureAlgorithm &alg = this->GetSignatureAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - const DL_PublicKey &key = this->GetKeyInterface(); - - SecByteBlock representative(this->MessageRepresentativeLength()); - this->GetMessageEncodingInterface().ComputeMessageRepresentative( - NullRNG(), - ma.m_recoverableMessage, ma.m_recoverableMessage.size(), - ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty, - representative, this->MessageRepresentativeBitLength()); - ma.m_empty = true; - Integer e(representative, representative.size()); - - ma.m_presignature.New(params.GetEncodedElementSize(false)); - Integer r(ma.m_semisignature, ma.m_semisignature.size()); - alg.RecoverPresignature(params, key, r, ma.m_s).Encode(ma.m_presignature, ma.m_presignature.size()); - - return this->GetMessageEncodingInterface().RecoverMessageFromSemisignature( - ma.AccessHash(), this->GetHashIdentifier(), - ma.m_presignature, ma.m_presignature.size(), - ma.m_semisignature, ma.m_semisignature.size(), - recoveredMessage); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_VerifierBase() { } -#endif -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_CryptoSystemBase : public PK, public DL_Base -{ -public: - typedef typename DL_Base::Element Element; - - size_t MaxPlaintextLength(size_t ciphertextLength) const - { - unsigned int minLen = this->GetAbstractGroupParameters().GetEncodedElementSize(true); - return ciphertextLength < minLen ? 0 : GetSymmetricEncryptionAlgorithm().GetMaxSymmetricPlaintextLength(ciphertextLength - minLen); - } - - size_t CiphertextLength(size_t plaintextLength) const - { - size_t len = GetSymmetricEncryptionAlgorithm().GetSymmetricCiphertextLength(plaintextLength); - return len == 0 ? 0 : this->GetAbstractGroupParameters().GetEncodedElementSize(true) + len; - } - - bool ParameterSupported(const char *name) const - {return GetKeyDerivationAlgorithm().ParameterSupported(name) || GetSymmetricEncryptionAlgorithm().ParameterSupported(name);} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_CryptoSystemBase() { } -#endif - -protected: - virtual const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const =0; - virtual const DL_KeyDerivationAlgorithm & GetKeyDerivationAlgorithm() const =0; - virtual const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const =0; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_DecryptorBase : public DL_CryptoSystemBase > -{ -public: - typedef T Element; - - DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const - { - try - { - CRYPTOPP_UNUSED(rng); - const DL_KeyAgreementAlgorithm &agreeAlg = this->GetKeyAgreementAlgorithm(); - const DL_KeyDerivationAlgorithm &derivAlg = this->GetKeyDerivationAlgorithm(); - const DL_SymmetricEncryptionAlgorithm &encAlg = this->GetSymmetricEncryptionAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - const DL_PrivateKey &key = this->GetKeyInterface(); - - Element q = params.DecodeElement(ciphertext, true); - size_t elementSize = params.GetEncodedElementSize(true); - ciphertext += elementSize; - ciphertextLength -= elementSize; - - Element z = agreeAlg.AgreeWithStaticPrivateKey(params, q, true, key.GetPrivateExponent()); - - SecByteBlock derivedKey(encAlg.GetSymmetricKeyLength(encAlg.GetMaxSymmetricPlaintextLength(ciphertextLength))); - derivAlg.Derive(params, derivedKey, derivedKey.size(), z, q, parameters); - - return encAlg.SymmetricDecrypt(derivedKey, ciphertext, ciphertextLength, plaintext, parameters); - } - catch (DL_BadElement &) - { - return DecodingResult(); - } - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_DecryptorBase() { } -#endif -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_EncryptorBase : public DL_CryptoSystemBase > -{ -public: - typedef T Element; - - void Encrypt(RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const - { - const DL_KeyAgreementAlgorithm &agreeAlg = this->GetKeyAgreementAlgorithm(); - const DL_KeyDerivationAlgorithm &derivAlg = this->GetKeyDerivationAlgorithm(); - const DL_SymmetricEncryptionAlgorithm &encAlg = this->GetSymmetricEncryptionAlgorithm(); - const DL_GroupParameters ¶ms = this->GetAbstractGroupParameters(); - const DL_PublicKey &key = this->GetKeyInterface(); - - Integer x(rng, Integer::One(), params.GetMaxExponent()); - Element q = params.ExponentiateBase(x); - params.EncodeElement(true, q, ciphertext); - unsigned int elementSize = params.GetEncodedElementSize(true); - ciphertext += elementSize; - - Element z = agreeAlg.AgreeWithEphemeralPrivateKey(params, key.GetPublicPrecomputation(), x); - - SecByteBlock derivedKey(encAlg.GetSymmetricKeyLength(plaintextLength)); - derivAlg.Derive(params, derivedKey, derivedKey.size(), z, q, parameters); - - encAlg.SymmetricEncrypt(rng, derivedKey, plaintext, plaintextLength, ciphertext, parameters); - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_EncryptorBase() { } -#endif -}; - -//! _ -template -struct DL_SchemeOptionsBase -{ - typedef T1 AlgorithmInfo; - typedef T2 GroupParameters; - typedef typename GroupParameters::Element Element; -}; - -//! _ -template -struct DL_KeyedSchemeOptions : public DL_SchemeOptionsBase -{ - typedef T2 Keys; - typedef typename Keys::PrivateKey PrivateKey; - typedef typename Keys::PublicKey PublicKey; -}; - -//! _ -template -struct DL_SignatureSchemeOptions : public DL_KeyedSchemeOptions -{ - typedef T3 SignatureAlgorithm; - typedef T4 MessageEncodingMethod; - typedef T5 HashFunction; -}; - -//! _ -template -struct DL_CryptoSchemeOptions : public DL_KeyedSchemeOptions -{ - typedef T3 KeyAgreementAlgorithm; - typedef T4 KeyDerivationAlgorithm; - typedef T5 SymmetricEncryptionAlgorithm; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_ObjectImplBase : public AlgorithmImpl -{ -public: - typedef SCHEME_OPTIONS SchemeOptions; - typedef typename KEY::Element Element; - - PrivateKey & AccessPrivateKey() {return m_key;} - PublicKey & AccessPublicKey() {return m_key;} - - // KeyAccessor - const KEY & GetKey() const {return m_key;} - KEY & AccessKey() {return m_key;} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_ObjectImplBase() { } -#endif - -protected: - typename BASE::KeyInterface & AccessKeyInterface() {return m_key;} - const typename BASE::KeyInterface & GetKeyInterface() const {return m_key;} - - // for signature scheme - HashIdentifier GetHashIdentifier() const - { - typedef typename SchemeOptions::MessageEncodingMethod::HashIdentifierLookup HashLookup; - return HashLookup::template HashIdentifierLookup2::Lookup(); - } - size_t GetDigestSize() const - { - typedef CPP_TYPENAME SchemeOptions::HashFunction H; - return H::DIGESTSIZE; - } - -private: - KEY m_key; -}; - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_ObjectImpl : public DL_ObjectImplBase -{ -public: - typedef typename KEY::Element Element; - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_ObjectImpl() { } -#endif - -protected: - const DL_ElgamalLikeSignatureAlgorithm & GetSignatureAlgorithm() const - {return Singleton().Ref();} - const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const - {return Singleton().Ref();} - const DL_KeyDerivationAlgorithm & GetKeyDerivationAlgorithm() const - {return Singleton().Ref();} - const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const - {return Singleton().Ref();} - HashIdentifier GetHashIdentifier() const - {return HashIdentifier();} - const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const - {return Singleton().Ref();} -}; - -//! _ -template -class DL_SignerImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PrivateKey> -{ -public: - PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const - { - member_ptr p(new PK_MessageAccumulatorImpl); - this->RestartMessageAccumulator(rng, *p); - return p.release(); - } -}; - -//! _ -template -class DL_VerifierImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PublicKey> -{ -public: - PK_MessageAccumulator * NewVerificationAccumulator() const - { - return new PK_MessageAccumulatorImpl; - } -}; - -//! _ -template -class DL_EncryptorImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PublicKey> -{ -}; - -//! _ -template -class DL_DecryptorImpl : public DL_ObjectImpl, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PrivateKey> -{ -}; - -// ******************************************************** - -//! _ -template -class CRYPTOPP_NO_VTABLE DL_SimpleKeyAgreementDomainBase : public SimpleKeyAgreementDomain -{ -public: - typedef T Element; - - CryptoParameters & AccessCryptoParameters() {return AccessAbstractGroupParameters();} - unsigned int AgreedValueLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(false);} - unsigned int PrivateKeyLength() const {return GetAbstractGroupParameters().GetSubgroupOrder().ByteCount();} - unsigned int PublicKeyLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(true);} - - void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const - { - Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent()); - x.Encode(privateKey, PrivateKeyLength()); - } - - void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const - { - CRYPTOPP_UNUSED(rng); - const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); - Integer x(privateKey, PrivateKeyLength()); - Element y = params.ExponentiateBase(x); - params.EncodeElement(true, y, publicKey); - } - - bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const - { - try - { - const DL_GroupParameters ¶ms = GetAbstractGroupParameters(); - Integer x(privateKey, PrivateKeyLength()); - Element w = params.DecodeElement(otherPublicKey, validateOtherPublicKey); - - Element z = GetKeyAgreementAlgorithm().AgreeWithStaticPrivateKey( - GetAbstractGroupParameters(), w, validateOtherPublicKey, x); - params.EncodeElement(false, z, agreedValue); - } - catch (DL_BadElement &) - { - return false; - } - return true; - } - - const Element &GetGenerator() const {return GetAbstractGroupParameters().GetSubgroupGenerator();} - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_SimpleKeyAgreementDomainBase() { } -#endif - -protected: - virtual const DL_KeyAgreementAlgorithm & GetKeyAgreementAlgorithm() const =0; - virtual DL_GroupParameters & AccessAbstractGroupParameters() =0; - const DL_GroupParameters & GetAbstractGroupParameters() const {return const_cast *>(this)->AccessAbstractGroupParameters();} -}; - -enum CofactorMultiplicationOption {NO_COFACTOR_MULTIPLICTION, COMPATIBLE_COFACTOR_MULTIPLICTION, INCOMPATIBLE_COFACTOR_MULTIPLICTION}; -typedef EnumToType NoCofactorMultiplication; -typedef EnumToType CompatibleCofactorMultiplication; -typedef EnumToType IncompatibleCofactorMultiplication; - -//! DH key agreement algorithm -template -class DL_KeyAgreementAlgorithm_DH : public DL_KeyAgreementAlgorithm -{ -public: - typedef ELEMENT Element; - - static const char * CRYPTOPP_API StaticAlgorithmName() - {return COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? "DHC" : "DH";} - - Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters ¶ms, const DL_FixedBasePrecomputation &publicPrecomputation, const Integer &privateExponent) const - { - return publicPrecomputation.Exponentiate(params.GetGroupPrecomputation(), - COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? privateExponent*params.GetCofactor() : privateExponent); - } - - Element AgreeWithStaticPrivateKey(const DL_GroupParameters ¶ms, const Element &publicElement, bool validateOtherPublicKey, const Integer &privateExponent) const - { - if (COFACTOR_OPTION::ToEnum() == COMPATIBLE_COFACTOR_MULTIPLICTION) - { - const Integer &k = params.GetCofactor(); - return params.ExponentiateElement(publicElement, - ModularArithmetic(params.GetSubgroupOrder()).Divide(privateExponent, k)*k); - } - else if (COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION) - return params.ExponentiateElement(publicElement, privateExponent*params.GetCofactor()); - else - { - assert(COFACTOR_OPTION::ToEnum() == NO_COFACTOR_MULTIPLICTION); - - if (!validateOtherPublicKey) - return params.ExponentiateElement(publicElement, privateExponent); - - if (params.FastSubgroupCheckAvailable()) - { - if (!params.ValidateElement(2, publicElement, NULL)) - throw DL_BadElement(); - return params.ExponentiateElement(publicElement, privateExponent); - } - else - { - const Integer e[2] = {params.GetSubgroupOrder(), privateExponent}; - Element r[2]; - params.SimultaneousExponentiate(r, publicElement, e, 2); - if (!params.IsIdentity(r[0])) - throw DL_BadElement(); - return r[1]; - } - } - } - -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~DL_KeyAgreementAlgorithm_DH() {} -#endif -}; - -// ******************************************************** - -//! A template implementing constructors for public key algorithm classes -template -class CRYPTOPP_NO_VTABLE PK_FinalTemplate : public BASE -{ -public: - PK_FinalTemplate() {} - - PK_FinalTemplate(const CryptoMaterial &key) - {this->AccessKey().AssignFrom(key);} - - PK_FinalTemplate(BufferedTransformation &bt) - {this->AccessKey().BERDecode(bt);} - - PK_FinalTemplate(const AsymmetricAlgorithm &algorithm) - {this->AccessKey().AssignFrom(algorithm.GetMaterial());} - - PK_FinalTemplate(const Integer &v1) - {this->AccessKey().Initialize(v1);} - -#if (defined(_MSC_VER) && _MSC_VER < 1300) - - template - PK_FinalTemplate(T1 &v1, T2 &v2) - {this->AccessKey().Initialize(v1, v2);} - - template - PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3) - {this->AccessKey().Initialize(v1, v2, v3);} - - template - PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4) - {this->AccessKey().Initialize(v1, v2, v3, v4);} - - template - PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5);} - - template - PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5, T6 &v6) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6);} - - template - PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5, T6 &v6, T7 &v7) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7);} - - template - PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4, T5 &v5, T6 &v6, T7 &v7, T8 &v8) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7, v8);} - -#else - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2) - {this->AccessKey().Initialize(v1, v2);} - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3) - {this->AccessKey().Initialize(v1, v2, v3);} - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) - {this->AccessKey().Initialize(v1, v2, v3, v4);} - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5);} - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6);} - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7);} - - template - PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7, const T8 &v8) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7, v8);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2) - {this->AccessKey().Initialize(v1, v2);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3) - {this->AccessKey().Initialize(v1, v2, v3);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) - {this->AccessKey().Initialize(v1, v2, v3, v4);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7);} - - template - PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7, const T8 &v8) - {this->AccessKey().Initialize(v1, v2, v3, v4, v5, v6, v7, v8);} - -#endif -}; - -//! \brief Base class for public key encryption standard classes. -//! \details These classes are used to select from variants of algorithms. -//! \note Not all standards apply to all algorithms. -struct EncryptionStandard {}; - -//! \brief Base class for public key signature standard classes. -//! \details These classes are used to select from variants of algorithms. -//! \note Not all standards apply to all algorithms. -struct SignatureStandard {}; - -template -class TF_ES; - -//! Trapdoor Function Based Encryption Scheme -template > -class TF_ES : public KEYS -{ - typedef typename STANDARD::EncryptionMessageEncodingMethod MessageEncodingMethod; - -public: - //! see EncryptionStandard for a list of standards - typedef STANDARD Standard; - typedef TF_CryptoSchemeOptions SchemeOptions; - - static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(KEYS::StaticAlgorithmName()) + "/" + MessageEncodingMethod::StaticAlgorithmName();} - - //! implements PK_Decryptor interface - typedef PK_FinalTemplate > Decryptor; - //! implements PK_Encryptor interface - typedef PK_FinalTemplate > Encryptor; -}; - -template // VC60 workaround: doesn't work if KEYS is first parameter -class TF_SS; - -//! Trapdoor Function Based Signature Scheme -template > // VC60 workaround: doesn't work if KEYS is first parameter -class TF_SS : public KEYS -{ -public: - //! see SignatureStandard for a list of standards - typedef STANDARD Standard; - typedef typename Standard::SignatureMessageEncodingMethod MessageEncodingMethod; - typedef TF_SignatureSchemeOptions SchemeOptions; - - static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(KEYS::StaticAlgorithmName()) + "/" + MessageEncodingMethod::StaticAlgorithmName() + "(" + H::StaticAlgorithmName() + ")";} - - //! implements PK_Signer interface - typedef PK_FinalTemplate > Signer; - //! implements PK_Verifier interface - typedef PK_FinalTemplate > Verifier; -}; - -template -class DL_SS; - -//! Discrete Log Based Signature Scheme -template > -class DL_SS : public KEYS -{ - typedef DL_SignatureSchemeOptions SchemeOptions; - -public: - static std::string StaticAlgorithmName() {return SA::StaticAlgorithmName() + std::string("/EMSA1(") + H::StaticAlgorithmName() + ")";} - - //! implements PK_Signer interface - typedef PK_FinalTemplate > Signer; - //! implements PK_Verifier interface - typedef PK_FinalTemplate > Verifier; -}; - -//! Discrete Log Based Encryption Scheme -template -class DL_ES : public KEYS -{ - typedef DL_CryptoSchemeOptions SchemeOptions; - -public: - //! implements PK_Decryptor interface - typedef PK_FinalTemplate > Decryptor; - //! implements PK_Encryptor interface - typedef PK_FinalTemplate > Encryptor; -}; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/pwdbased.h b/external/crypto++-5.6.3/pwdbased.h deleted file mode 100644 index e4c686246..000000000 --- a/external/crypto++-5.6.3/pwdbased.h +++ /dev/null @@ -1,227 +0,0 @@ -// pwdbased.h - written and placed in the public domain by Wei Dai - -#ifndef CRYPTOPP_PWDBASED_H -#define CRYPTOPP_PWDBASED_H - -#include "cryptlib.h" -#include "hrtimer.h" -#include "integer.h" -#include "hmac.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! abstract base class for password based key derivation function -class PasswordBasedKeyDerivationFunction -{ -public: - virtual size_t MaxDerivedKeyLength() const =0; - virtual bool UsesPurposeByte() const =0; - //! derive key from password - /*! If timeInSeconds != 0, will iterate until time elapsed, as measured by ThreadUserTimer - Returns actual iteration count, which is equal to iterations if timeInSeconds == 0, and not less than iterations otherwise. */ - virtual unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const =0; -}; - -//! PBKDF1 from PKCS #5, T should be a HashTransformation class -template -class PKCS5_PBKDF1 : public PasswordBasedKeyDerivationFunction -{ -public: - size_t MaxDerivedKeyLength() const {return T::DIGESTSIZE;} - bool UsesPurposeByte() const {return false;} - // PKCS #5 says PBKDF1 should only take 8-byte salts. This implementation allows salts of any length. - unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const; -}; - -//! PBKDF2 from PKCS #5, T should be a HashTransformation class -template -class PKCS5_PBKDF2_HMAC : public PasswordBasedKeyDerivationFunction -{ -public: - size_t MaxDerivedKeyLength() const {return 0xffffffffU;} // should multiply by T::DIGESTSIZE, but gets overflow that way - bool UsesPurposeByte() const {return false;} - unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const; -}; - -/* -class PBKDF2Params -{ -public: - SecByteBlock m_salt; - unsigned int m_interationCount; - ASNOptional > m_keyLength; -}; -*/ - -template -unsigned int PKCS5_PBKDF1::DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const -{ - CRYPTOPP_UNUSED(purpose); - assert(derivedLen <= MaxDerivedKeyLength()); - assert(iterations > 0 || timeInSeconds > 0); - - if (!iterations) - iterations = 1; - - T hash; - hash.Update(password, passwordLen); - hash.Update(salt, saltLen); - - SecByteBlock buffer(hash.DigestSize()); - hash.Final(buffer); - - unsigned int i; - ThreadUserTimer timer; - - if (timeInSeconds) - timer.StartTimer(); - - for (i=1; i -unsigned int PKCS5_PBKDF2_HMAC::DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const -{ - CRYPTOPP_UNUSED(purpose); - assert(derivedLen <= MaxDerivedKeyLength()); - assert(iterations > 0 || timeInSeconds > 0); - - if (!iterations) - iterations = 1; - - HMAC hmac(password, passwordLen); - SecByteBlock buffer(hmac.DigestSize()); - ThreadUserTimer timer; - - unsigned int i=1; - while (derivedLen > 0) - { - hmac.Update(salt, saltLen); - unsigned int j; - for (j=0; j<4; j++) - { - byte b = byte(i >> ((3-j)*8)); - hmac.Update(&b, 1); - } - hmac.Final(buffer); - -#if CRYPTOPP_MSC_VERSION - const size_t segmentLen = STDMIN(derivedLen, buffer.size()); - memcpy_s(derived, segmentLen, buffer, segmentLen); -#else - const size_t segmentLen = STDMIN(derivedLen, buffer.size()); - memcpy(derived, buffer, segmentLen); -#endif - - if (timeInSeconds) - { - timeInSeconds = timeInSeconds / ((derivedLen + buffer.size() - 1) / buffer.size()); - timer.StartTimer(); - } - - for (j=1; j -class PKCS12_PBKDF : public PasswordBasedKeyDerivationFunction -{ -public: - size_t MaxDerivedKeyLength() const {return size_t(0)-1;} - bool UsesPurposeByte() const {return true;} - unsigned int DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const; -}; - -template -unsigned int PKCS12_PBKDF::DeriveKey(byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const -{ - assert(derivedLen <= MaxDerivedKeyLength()); - assert(iterations > 0 || timeInSeconds > 0); - - if (!iterations) - iterations = 1; - - const size_t v = T::BLOCKSIZE; // v is in bytes rather than bits as in PKCS #12 - const size_t DLen = v, SLen = RoundUpToMultipleOf(saltLen, v); - const size_t PLen = RoundUpToMultipleOf(passwordLen, v), ILen = SLen + PLen; - SecByteBlock buffer(DLen + SLen + PLen); - byte *D = buffer, *S = buffer+DLen, *P = buffer+DLen+SLen, *I = S; - - memset(D, purpose, DLen); - size_t i; - for (i=0; i 0) - { - hash.CalculateDigest(Ai, buffer, buffer.size()); - - if (timeInSeconds) - { - timeInSeconds = timeInSeconds / ((derivedLen + Ai.size() - 1) / Ai.size()); - timer.StartTimer(); - } - - for (i=1; i(), m_autoNodeSize(!nodeSize), m_nodeSize(nodeSize) - , m_head(NULL), m_tail(NULL), m_lazyString(NULL), m_lazyLength(0), m_lazyStringModifiable(false) -{ - SetNodeSize(nodeSize); - m_head = m_tail = new ByteQueueNode(m_nodeSize); -} - -void ByteQueue::SetNodeSize(size_t nodeSize) -{ - m_autoNodeSize = !nodeSize; - m_nodeSize = m_autoNodeSize ? 256 : nodeSize; -} - -ByteQueue::ByteQueue(const ByteQueue ©) - : Bufferless(copy), m_lazyString(NULL), m_lazyLength(0) -{ - CopyFrom(copy); -} - -void ByteQueue::CopyFrom(const ByteQueue ©) -{ - m_lazyLength = 0; - m_autoNodeSize = copy.m_autoNodeSize; - m_nodeSize = copy.m_nodeSize; - m_head = m_tail = new ByteQueueNode(*copy.m_head); - - for (ByteQueueNode *current=copy.m_head->next; current; current=current->next) - { - m_tail->next = new ByteQueueNode(*current); - m_tail = m_tail->next; - } - - m_tail->next = NULL; - - Put(copy.m_lazyString, copy.m_lazyLength); -} - -ByteQueue::~ByteQueue() -{ - Destroy(); -} - -void ByteQueue::Destroy() -{ - for (ByteQueueNode *next, *current=m_head; current; current=next) - { - next=current->next; - delete current; - } -} - -void ByteQueue::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_nodeSize = parameters.GetIntValueWithDefault("NodeSize", 256); - Clear(); -} - -lword ByteQueue::CurrentSize() const -{ - lword size=0; - - for (ByteQueueNode *current=m_head; current; current=current->next) - size += current->CurrentSize(); - - return size + m_lazyLength; -} - -bool ByteQueue::IsEmpty() const -{ - return m_head==m_tail && m_head->CurrentSize()==0 && m_lazyLength==0; -} - -void ByteQueue::Clear() -{ - for (ByteQueueNode *next, *current=m_head->next; current; current=next) - { - next=current->next; - delete current; - } - - m_tail = m_head; - m_head->Clear(); - m_head->next = NULL; - m_lazyLength = 0; -} - -size_t ByteQueue::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) -{ - CRYPTOPP_UNUSED(messageEnd), CRYPTOPP_UNUSED(blocking); - - if (m_lazyLength > 0) - FinalizeLazyPut(); - - size_t len; - while ((len=m_tail->Put(inString, length)) < length) - { - inString += len; - length -= len; - if (m_autoNodeSize && m_nodeSize < s_maxAutoNodeSize) - do - { - m_nodeSize *= 2; - } - while (m_nodeSize < length && m_nodeSize < s_maxAutoNodeSize); - m_tail->next = new ByteQueueNode(STDMAX(m_nodeSize, length)); - m_tail = m_tail->next; - } - - return 0; -} - -void ByteQueue::CleanupUsedNodes() -{ - // Test for m_head due to Enterprise Anlysis finding - while (m_head && m_head != m_tail && m_head->UsedUp()) - { - ByteQueueNode *temp=m_head; - m_head=m_head->next; - delete temp; - } - - // Test for m_head due to Enterprise Anlysis finding - if (m_head && m_head->CurrentSize() == 0) - m_head->Clear(); -} - -void ByteQueue::LazyPut(const byte *inString, size_t size) -{ - if (m_lazyLength > 0) - FinalizeLazyPut(); - - if (inString == m_tail->buf+m_tail->m_tail) - Put(inString, size); - else - { - m_lazyString = const_cast(inString); - m_lazyLength = size; - m_lazyStringModifiable = false; - } -} - -void ByteQueue::LazyPutModifiable(byte *inString, size_t size) -{ - if (m_lazyLength > 0) - FinalizeLazyPut(); - m_lazyString = inString; - m_lazyLength = size; - m_lazyStringModifiable = true; -} - -void ByteQueue::UndoLazyPut(size_t size) -{ - if (m_lazyLength < size) - throw InvalidArgument("ByteQueue: size specified for UndoLazyPut is too large"); - - m_lazyLength -= size; -} - -void ByteQueue::FinalizeLazyPut() -{ - size_t len = m_lazyLength; - m_lazyLength = 0; - if (len) - Put(m_lazyString, len); -} - -size_t ByteQueue::Get(byte &outByte) -{ - if (m_head->Get(outByte)) - { - if (m_head->UsedUp()) - CleanupUsedNodes(); - return 1; - } - else if (m_lazyLength > 0) - { - outByte = *m_lazyString++; - m_lazyLength--; - return 1; - } - else - return 0; -} - -size_t ByteQueue::Get(byte *outString, size_t getMax) -{ - ArraySink sink(outString, getMax); - return (size_t)TransferTo(sink, getMax); -} - -size_t ByteQueue::Peek(byte &outByte) const -{ - if (m_head->Peek(outByte)) - return 1; - else if (m_lazyLength > 0) - { - outByte = *m_lazyString; - return 1; - } - else - return 0; -} - -size_t ByteQueue::Peek(byte *outString, size_t peekMax) const -{ - ArraySink sink(outString, peekMax); - return (size_t)CopyTo(sink, peekMax); -} - -size_t ByteQueue::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - if (blocking) - { - lword bytesLeft = transferBytes; - for (ByteQueueNode *current=m_head; bytesLeft && current; current=current->next) - bytesLeft -= current->TransferTo(target, bytesLeft, channel); - CleanupUsedNodes(); - - size_t len = (size_t)STDMIN(bytesLeft, (lword)m_lazyLength); - if (len) - { - if (m_lazyStringModifiable) - target.ChannelPutModifiable(channel, m_lazyString, len); - else - target.ChannelPut(channel, m_lazyString, len); - m_lazyString += len; - m_lazyLength -= len; - bytesLeft -= len; - } - transferBytes -= bytesLeft; - return 0; - } - else - { - Walker walker(*this); - size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking); - Skip(transferBytes); - return blockedBytes; - } -} - -size_t ByteQueue::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - Walker walker(*this); - walker.Skip(begin); - lword transferBytes = end-begin; - size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking); - begin += transferBytes; - return blockedBytes; -} - -void ByteQueue::Unget(byte inByte) -{ - Unget(&inByte, 1); -} - -void ByteQueue::Unget(const byte *inString, size_t length) -{ - size_t len = STDMIN(length, m_head->m_head); - length -= len; - m_head->m_head -= len; - memcpy(m_head->buf + m_head->m_head, inString + length, len); - - if (length > 0) - { - ByteQueueNode *newHead = new ByteQueueNode(length); - newHead->next = m_head; - m_head = newHead; - m_head->Put(inString, length); - } -} - -const byte * ByteQueue::Spy(size_t &contiguousSize) const -{ - contiguousSize = m_head->m_tail - m_head->m_head; - if (contiguousSize == 0 && m_lazyLength > 0) - { - contiguousSize = m_lazyLength; - return m_lazyString; - } - else - return m_head->buf + m_head->m_head; -} - -byte * ByteQueue::CreatePutSpace(size_t &size) -{ - if (m_lazyLength > 0) - FinalizeLazyPut(); - - if (m_tail->m_tail == m_tail->MaxSize()) - { - m_tail->next = new ByteQueueNode(STDMAX(m_nodeSize, size)); - m_tail = m_tail->next; - } - - size = m_tail->MaxSize() - m_tail->m_tail; - return m_tail->buf + m_tail->m_tail; -} - -ByteQueue & ByteQueue::operator=(const ByteQueue &rhs) -{ - Destroy(); - CopyFrom(rhs); - return *this; -} - -bool ByteQueue::operator==(const ByteQueue &rhs) const -{ - const lword currentSize = CurrentSize(); - - if (currentSize != rhs.CurrentSize()) - return false; - - Walker walker1(*this), walker2(rhs); - byte b1, b2; - - while (walker1.Get(b1) && walker2.Get(b2)) - if (b1 != b2) - return false; - - return true; -} - -byte ByteQueue::operator[](lword i) const -{ - for (ByteQueueNode *current=m_head; current; current=current->next) - { - if (i < current->CurrentSize()) - return (*current)[(size_t)i]; - - i -= current->CurrentSize(); - } - - assert(i < m_lazyLength); - return m_lazyString[i]; -} - -void ByteQueue::swap(ByteQueue &rhs) -{ - std::swap(m_autoNodeSize, rhs.m_autoNodeSize); - std::swap(m_nodeSize, rhs.m_nodeSize); - std::swap(m_head, rhs.m_head); - std::swap(m_tail, rhs.m_tail); - std::swap(m_lazyString, rhs.m_lazyString); - std::swap(m_lazyLength, rhs.m_lazyLength); - std::swap(m_lazyStringModifiable, rhs.m_lazyStringModifiable); -} - -// ******************************************************** - -void ByteQueue::Walker::IsolatedInitialize(const NameValuePairs ¶meters) -{ - CRYPTOPP_UNUSED(parameters); - - m_node = m_queue.m_head; - m_position = 0; - m_offset = 0; - m_lazyString = m_queue.m_lazyString; - m_lazyLength = m_queue.m_lazyLength; -} - -size_t ByteQueue::Walker::Get(byte &outByte) -{ - ArraySink sink(&outByte, 1); - return (size_t)TransferTo(sink, 1); -} - -size_t ByteQueue::Walker::Get(byte *outString, size_t getMax) -{ - ArraySink sink(outString, getMax); - return (size_t)TransferTo(sink, getMax); -} - -size_t ByteQueue::Walker::Peek(byte &outByte) const -{ - ArraySink sink(&outByte, 1); - return (size_t)CopyTo(sink, 1); -} - -size_t ByteQueue::Walker::Peek(byte *outString, size_t peekMax) const -{ - ArraySink sink(outString, peekMax); - return (size_t)CopyTo(sink, peekMax); -} - -size_t ByteQueue::Walker::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking) -{ - lword bytesLeft = transferBytes; - size_t blockedBytes = 0; - - while (m_node) - { - size_t len = (size_t)STDMIN(bytesLeft, (lword)m_node->CurrentSize()-m_offset); - blockedBytes = target.ChannelPut2(channel, m_node->buf+m_node->m_head+m_offset, len, 0, blocking); - - if (blockedBytes) - goto done; - - m_position += len; - bytesLeft -= len; - - if (!bytesLeft) - { - m_offset += len; - goto done; - } - - m_node = m_node->next; - m_offset = 0; - } - - if (bytesLeft && m_lazyLength) - { - size_t len = (size_t)STDMIN(bytesLeft, (lword)m_lazyLength); - blockedBytes = target.ChannelPut2(channel, m_lazyString, len, 0, blocking); - if (blockedBytes) - goto done; - - m_lazyString += len; - m_lazyLength -= len; - bytesLeft -= len; - } - -done: - transferBytes -= bytesLeft; - return blockedBytes; -} - -size_t ByteQueue::Walker::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const -{ - Walker walker(*this); - walker.Skip(begin); - lword transferBytes = end-begin; - size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking); - begin += transferBytes; - return blockedBytes; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/queue.h b/external/crypto++-5.6.3/queue.h deleted file mode 100644 index bc1b2aac3..000000000 --- a/external/crypto++-5.6.3/queue.h +++ /dev/null @@ -1,149 +0,0 @@ -// queue.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile queue.h -//! \brief Classes for an unlimited queue to store bytes - -#ifndef CRYPTOPP_QUEUE_H -#define CRYPTOPP_QUEUE_H - -#include "cryptlib.h" -#include "simple.h" - -NAMESPACE_BEGIN(CryptoPP) - -/** The queue is implemented as a linked list of byte arrays, but you don't need to - know about that. So just ignore this next line. :) */ -class ByteQueueNode; - -//! Byte Queue -class CRYPTOPP_DLL ByteQueue : public Bufferless -{ -public: - ByteQueue(size_t nodeSize=0); - ByteQueue(const ByteQueue ©); - ~ByteQueue(); - - lword MaxRetrievable() const - {return CurrentSize();} - bool AnyRetrievable() const - {return !IsEmpty();} - - void IsolatedInitialize(const NameValuePairs ¶meters); - byte * CreatePutSpace(size_t &size); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - - size_t Get(byte &outByte); - size_t Get(byte *outString, size_t getMax); - - size_t Peek(byte &outByte) const; - size_t Peek(byte *outString, size_t peekMax) const; - - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - - // these member functions are not inherited - void SetNodeSize(size_t nodeSize); - - lword CurrentSize() const; - bool IsEmpty() const; - - void Clear(); - - void Unget(byte inByte); - void Unget(const byte *inString, size_t length); - - const byte * Spy(size_t &contiguousSize) const; - - void LazyPut(const byte *inString, size_t size); - void LazyPutModifiable(byte *inString, size_t size); - void UndoLazyPut(size_t size); - void FinalizeLazyPut(); - - ByteQueue & operator=(const ByteQueue &rhs); - bool operator==(const ByteQueue &rhs) const; - bool operator!=(const ByteQueue &rhs) const {return !operator==(rhs);} - byte operator[](lword i) const; - void swap(ByteQueue &rhs); - - class Walker : public InputRejecting - { - public: - Walker(const ByteQueue &queue) - : m_queue(queue), m_node(NULL), m_position(0), m_offset(0), m_lazyString(NULL), m_lazyLength(0) - {Initialize();} - - lword GetCurrentPosition() {return m_position;} - - lword MaxRetrievable() const - {return m_queue.CurrentSize() - m_position;} - - void IsolatedInitialize(const NameValuePairs ¶meters); - - size_t Get(byte &outByte); - size_t Get(byte *outString, size_t getMax); - - size_t Peek(byte &outByte) const; - size_t Peek(byte *outString, size_t peekMax) const; - - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; - - private: - const ByteQueue &m_queue; - const ByteQueueNode *m_node; - lword m_position; - size_t m_offset; - const byte *m_lazyString; - size_t m_lazyLength; - }; - - friend class Walker; - -private: - void CleanupUsedNodes(); - void CopyFrom(const ByteQueue ©); - void Destroy(); - - bool m_autoNodeSize; - size_t m_nodeSize; - ByteQueueNode *m_head, *m_tail; - byte *m_lazyString; - size_t m_lazyLength; - bool m_lazyStringModifiable; -}; - -//! use this to make sure LazyPut is finalized in event of exception -class CRYPTOPP_DLL LazyPutter -{ -public: - LazyPutter(ByteQueue &bq, const byte *inString, size_t size) - : m_bq(bq) {bq.LazyPut(inString, size);} - ~LazyPutter() - {try {m_bq.FinalizeLazyPut();} catch(const Exception&) {assert(0);}} -protected: - LazyPutter(ByteQueue &bq) : m_bq(bq) {} -private: - ByteQueue &m_bq; -}; - -//! like LazyPutter, but does a LazyPutModifiable instead -class LazyPutterModifiable : public LazyPutter -{ -public: - LazyPutterModifiable(ByteQueue &bq, byte *inString, size_t size) - : LazyPutter(bq) {bq.LazyPutModifiable(inString, size);} -}; - -NAMESPACE_END - -#ifndef __BORLANDC__ -NAMESPACE_BEGIN(std) -template<> inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b) -{ - a.swap(b); -} -NAMESPACE_END -#endif - -#endif diff --git a/external/crypto++-5.6.3/rabin.cpp b/external/crypto++-5.6.3/rabin.cpp deleted file mode 100644 index a1bd7d88d..000000000 --- a/external/crypto++-5.6.3/rabin.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// rabin.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "rabin.h" -#include "integer.h" -#include "nbtheory.h" -#include "modarith.h" -#include "asn.h" -#include "sha.h" - -NAMESPACE_BEGIN(CryptoPP) - -void RabinFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - m_n.BERDecode(seq); - m_r.BERDecode(seq); - m_s.BERDecode(seq); - seq.MessageEnd(); -} - -void RabinFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_n.DEREncode(seq); - m_r.DEREncode(seq); - m_s.DEREncode(seq); - seq.MessageEnd(); -} - -Integer RabinFunction::ApplyFunction(const Integer &in) const -{ - DoQuickSanityCheck(); - - Integer out = in.Squared()%m_n; - if (in.IsOdd()) - out = out*m_r%m_n; - if (Jacobi(in, m_n)==-1) - out = out*m_s%m_n; - return out; -} - -bool RabinFunction::Validate(RandomNumberGenerator& /*rng*/, unsigned int level) const -{ - bool pass = true; - pass = pass && m_n > Integer::One() && m_n%4 == 1; - pass = pass && m_r > Integer::One() && m_r < m_n; - pass = pass && m_s > Integer::One() && m_s < m_n; - if (level >= 1) - pass = pass && Jacobi(m_r, m_n) == -1 && Jacobi(m_s, m_n) == -1; - return pass; -} - -bool RabinFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_GET_FUNCTION_ENTRY(QuadraticResidueModPrime1) - CRYPTOPP_GET_FUNCTION_ENTRY(QuadraticResidueModPrime2) - ; -} - -void RabinFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_SET_FUNCTION_ENTRY(QuadraticResidueModPrime1) - CRYPTOPP_SET_FUNCTION_ENTRY(QuadraticResidueModPrime2) - ; -} - -// ***************************************************************************** -// private key operations: - -// generate a random private key -void InvertibleRabinFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - int modulusSize = 2048; - alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); - - if (modulusSize < 16) - throw InvalidArgument("InvertibleRabinFunction: specified modulus size is too small"); - - // VC70 workaround: putting these after primeParam causes overlapped stack allocation - bool rFound=false, sFound=false; - Integer t=2; - - AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) - ("EquivalentTo", 3)("Mod", 4); - m_p.GenerateRandom(rng, primeParam); - m_q.GenerateRandom(rng, primeParam); - - while (!(rFound && sFound)) - { - int jp = Jacobi(t, m_p); - int jq = Jacobi(t, m_q); - - if (!rFound && jp==1 && jq==-1) - { - m_r = t; - rFound = true; - } - - if (!sFound && jp==-1 && jq==1) - { - m_s = t; - sFound = true; - } - - ++t; - } - - m_n = m_p * m_q; - m_u = m_q.InverseMod(m_p); -} - -void InvertibleRabinFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - m_n.BERDecode(seq); - m_r.BERDecode(seq); - m_s.BERDecode(seq); - m_p.BERDecode(seq); - m_q.BERDecode(seq); - m_u.BERDecode(seq); - seq.MessageEnd(); -} - -void InvertibleRabinFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_n.DEREncode(seq); - m_r.DEREncode(seq); - m_s.DEREncode(seq); - m_p.DEREncode(seq); - m_q.DEREncode(seq); - m_u.DEREncode(seq); - seq.MessageEnd(); -} - -Integer InvertibleRabinFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &in) const -{ - DoQuickSanityCheck(); - - ModularArithmetic modn(m_n); - Integer r(rng, Integer::One(), m_n - Integer::One()); - r = modn.Square(r); - Integer r2 = modn.Square(r); - Integer c = modn.Multiply(in, r2); // blind - - Integer cp=c%m_p, cq=c%m_q; - - int jp = Jacobi(cp, m_p); - int jq = Jacobi(cq, m_q); - - if (jq==-1) - { - cp = cp*EuclideanMultiplicativeInverse(m_r, m_p)%m_p; - cq = cq*EuclideanMultiplicativeInverse(m_r, m_q)%m_q; - } - - if (jp==-1) - { - cp = cp*EuclideanMultiplicativeInverse(m_s, m_p)%m_p; - cq = cq*EuclideanMultiplicativeInverse(m_s, m_q)%m_q; - } - - cp = ModularSquareRoot(cp, m_p); - cq = ModularSquareRoot(cq, m_q); - - if (jp==-1) - cp = m_p-cp; - - Integer out = CRT(cq, m_q, cp, m_p, m_u); - - out = modn.Divide(out, r); // unblind - - if ((jq==-1 && out.IsEven()) || (jq==1 && out.IsOdd())) - out = m_n-out; - - return out; -} - -bool InvertibleRabinFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = RabinFunction::Validate(rng, level); - pass = pass && m_p > Integer::One() && m_p%4 == 3 && m_p < m_n; - pass = pass && m_q > Integer::One() && m_q%4 == 3 && m_q < m_n; - pass = pass && m_u.IsPositive() && m_u < m_p; - if (level >= 1) - { - pass = pass && m_p * m_q == m_n; - pass = pass && m_u * m_q % m_p == 1; - pass = pass && Jacobi(m_r, m_p) == 1; - pass = pass && Jacobi(m_r, m_q) == -1; - pass = pass && Jacobi(m_s, m_p) == -1; - pass = pass && Jacobi(m_s, m_q) == 1; - } - if (level >= 2) - pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); - return pass; -} - -bool InvertibleRabinFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -void InvertibleRabinFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/rabin.h b/external/crypto++-5.6.3/rabin.h deleted file mode 100644 index 615104cff..000000000 --- a/external/crypto++-5.6.3/rabin.h +++ /dev/null @@ -1,111 +0,0 @@ -// rabin.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile rabin.h -//! \brief Classes for Rabin encryption and signature schemes - -#ifndef CRYPTOPP_RABIN_H -#define CRYPTOPP_RABIN_H - -#include "cryptlib.h" -#include "oaep.h" -#include "pssr.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class RabinFunction : public TrapdoorFunction, public PublicKey -{ - typedef RabinFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &r, const Integer &s) - {m_n = n; m_r = r; m_s = s;} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - Integer ApplyFunction(const Integer &x) const; - Integer PreimageBound() const {return m_n;} - Integer ImageBound() const {return m_n;} - - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - const Integer& GetModulus() const {return m_n;} - const Integer& GetQuadraticResidueModPrime1() const {return m_r;} - const Integer& GetQuadraticResidueModPrime2() const {return m_s;} - - void SetModulus(const Integer &n) {m_n = n;} - void SetQuadraticResidueModPrime1(const Integer &r) {m_r = r;} - void SetQuadraticResidueModPrime2(const Integer &s) {m_s = s;} - -protected: - Integer m_n, m_r, m_s; -}; - -//! _ -class InvertibleRabinFunction : public RabinFunction, public TrapdoorFunctionInverse, public PrivateKey -{ - typedef InvertibleRabinFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &r, const Integer &s, - const Integer &p, const Integer &q, const Integer &u) - {m_n = n; m_r = r; m_s = s; m_p = p; m_q = q; m_u = u;} - void Initialize(RandomNumberGenerator &rng, unsigned int keybits) - {GenerateRandomWithKeySize(rng, keybits);} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; - - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - /*! parameters: (ModulusSize) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - const Integer& GetPrime1() const {return m_p;} - const Integer& GetPrime2() const {return m_q;} - const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} - - void SetPrime1(const Integer &p) {m_p = p;} - void SetPrime2(const Integer &q) {m_q = q;} - void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} - -protected: - Integer m_p, m_q, m_u; -}; - -//! Rabin -struct Rabin -{ - static std::string StaticAlgorithmName() {return "Rabin-Crypto++Variant";} - typedef RabinFunction PublicKey; - typedef InvertibleRabinFunction PrivateKey; -}; - -//! Rabin encryption -template -struct RabinES : public TF_ES -{ -}; - -//! Rabin signature -template -struct RabinSS : public TF_SS -{ -}; - -// More typedefs for backwards compatibility -class SHA1; -typedef RabinES >::Decryptor RabinDecryptor; -typedef RabinES >::Encryptor RabinEncryptor; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/randpool.cpp b/external/crypto++-5.6.3/randpool.cpp deleted file mode 100644 index f1a9596e5..000000000 --- a/external/crypto++-5.6.3/randpool.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// randpool.cpp - written and placed in the public domain by Wei Dai -// RandomPool used to follow the design of randpool in PGP 2.6.x, -// but as of version 5.5 it has been redesigned to reduce the risk -// of reusing random numbers after state rollback (which may occur -// when running in a virtual machine like VMware). - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "randpool.h" -#include "aes.h" -#include "sha.h" -#include "hrtimer.h" -#include - -NAMESPACE_BEGIN(CryptoPP) - -RandomPool::RandomPool() - : m_pCipher(new AES::Encryption), m_keySet(false) -{ - memset(m_key, 0, m_key.SizeInBytes()); - memset(m_seed, 0, m_seed.SizeInBytes()); -} - -void RandomPool::IncorporateEntropy(const byte *input, size_t length) -{ - SHA256 hash; - hash.Update(m_key, 32); - hash.Update(input, length); - hash.Final(m_key); - m_keySet = false; -} - -void RandomPool::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size) -{ - if (size > 0) - { - if (!m_keySet) - m_pCipher->SetKey(m_key, 32); - - Timer timer; - TimerWord tw = timer.GetCurrentTimerValue(); - CRYPTOPP_COMPILE_ASSERT(sizeof(tw) <= 16); - *(TimerWord *)m_seed.data() += tw; - - time_t t = time(NULL); - CRYPTOPP_COMPILE_ASSERT(sizeof(t) <= 8); - - // UBsan finding: signed integer overflow: 1876017710 + 1446085457 cannot be represented in type 'long int' - // *(time_t *)(m_seed.data()+8) += t; - assert(m_seed.size() >= 16); - word64 tt1, tt2 = (word64)t; - memcpy(&tt1, m_seed.data()+8, 8); - memcpy(m_seed.data()+8, &(tt2 += tt1), 8); - - // Wipe the intermediates - *((volatile TimerWord*)&tw) = 0; - *((volatile word64*)&tt1) = 0; - *((volatile word64*)&tt2) = 0; - - do - { - m_pCipher->ProcessBlock(m_seed); - size_t len = UnsignedMin(16, size); - target.ChannelPut(channel, m_seed, len); - size -= len; - } while (size > 0); - } -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/randpool.h b/external/crypto++-5.6.3/randpool.h deleted file mode 100644 index 8921e7a43..000000000 --- a/external/crypto++-5.6.3/randpool.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef CRYPTOPP_RANDPOOL_H -#define CRYPTOPP_RANDPOOL_H - -#include "cryptlib.h" -#include "filters.h" -#include "secblock.h" -#include "smartptr.h" -#include "aes.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Randomness Pool -/*! This class can be used to generate cryptographic quality - pseudorandom bytes after seeding the pool with IncorporateEntropy() */ -class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator, public NotCopyable -{ -public: - RandomPool(); - - bool CanIncorporateEntropy() const {return true;} - void IncorporateEntropy(const byte *input, size_t length); - void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size); - - // for backwards compatibility. use RandomNumberSource, RandomNumberStore, and RandomNumberSink for other BufferTransformation functionality - void Put(const byte *input, size_t length) {IncorporateEntropy(input, length);} - -private: - FixedSizeSecBlock m_key; - FixedSizeSecBlock m_seed; - member_ptr m_pCipher; - bool m_keySet; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rc2.cpp b/external/crypto++-5.6.3/rc2.cpp deleted file mode 100644 index b8710f0d6..000000000 --- a/external/crypto++-5.6.3/rc2.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// rc2.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "rc2.h" -#include "misc.h" -#include "argnames.h" - -NAMESPACE_BEGIN(CryptoPP) - -void RC2::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(keyLen); - - int effectiveLen = params.GetIntValueWithDefault(Name::EffectiveKeyLength(), DEFAULT_EFFECTIVE_KEYLENGTH); - if (effectiveLen > MAX_EFFECTIVE_KEYLENGTH) - throw InvalidArgument("RC2: effective key length parameter exceeds maximum"); - - static const unsigned char PITABLE[256] = { - 217,120,249,196, 25,221,181,237, 40,233,253,121, 74,160,216,157, - 198,126, 55,131, 43,118, 83,142, 98, 76,100,136, 68,139,251,162, - 23,154, 89,245,135,179, 79, 19, 97, 69,109,141, 9,129,125, 50, - 189,143, 64,235,134,183,123, 11,240,149, 33, 34, 92,107, 78,130, - 84,214,101,147,206, 96,178, 28,115, 86,192, 20,167,140,241,220, - 18,117,202, 31, 59,190,228,209, 66, 61,212, 48,163, 60,182, 38, - 111,191, 14,218, 70,105, 7, 87, 39,242, 29,155,188,148, 67, 3, - 248, 17,199,246,144,239, 62,231, 6,195,213, 47,200,102, 30,215, - 8,232,234,222,128, 82,238,247,132,170,114,172, 53, 77,106, 42, - 150, 26,210,113, 90, 21, 73,116, 75,159,208, 94, 4, 24,164,236, - 194,224, 65,110, 15, 81,203,204, 36,145,175, 80,161,244,112, 57, - 153,124, 58,133, 35,184,180,122,252, 2, 54, 91, 37, 85,151, 49, - 45, 93,250,152,227,138,146,174, 5,223, 41, 16,103,108,186,201, - 211, 0,230,207,225,158,168, 44, 99, 22, 1, 63, 88,226,137,169, - 13, 56, 52, 27,171, 51,255,176,187, 72, 12, 95,185,177,205, 46, - 197,243,219, 71,229,165,156,119, 10,166, 32,104,254,127,193,173}; - - SecByteBlock L(128); - memcpy(L, key, keyLen); - - int i; - for (i=keyLen; i<128; i++) - L[i] = PITABLE[(L[i-1] + L[i-keyLen]) & 255]; - - unsigned int T8 = (effectiveLen+7) / 8; - byte TM = byte((int)255 >> ((8-(effectiveLen%8))%8)); - L[128-T8] = PITABLE[L[128-T8] & TM]; - - for (i=127-T8; i>=0; i--) - L[i] = PITABLE[L[i+1] ^ L[i+T8]]; - - for (i=0; i<64; i++) - K[i] = L[2*i] + (L[2*i+1] << 8); -} - -typedef BlockGetAndPut Block; - -void RC2::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word16 R0, R1, R2, R3; - Block::Get(inBlock)(R0)(R1)(R2)(R3); - - for (int i = 0; i < 16; i++) - { - R0 += (R1 & ~R3) + (R2 & R3) + K[4*i+0]; - R0 = rotlFixed(R0, 1); - - R1 += (R2 & ~R0) + (R3 & R0) + K[4*i+1]; - R1 = rotlFixed(R1, 2); - - R2 += (R3 & ~R1) + (R0 & R1) + K[4*i+2]; - R2 = rotlFixed(R2, 3); - - R3 += (R0 & ~R2) + (R1 & R2) + K[4*i+3]; - R3 = rotlFixed(R3, 5); - - if (i == 4 || i == 10) - { - R0 = word16(R0 + K[R3 & 63]); - R1 = word16(R1 + K[R0 & 63]); - R2 = word16(R2 + K[R1 & 63]); - R3 = word16(R3 + K[R2 & 63]); - } - } - - Block::Put(xorBlock, outBlock)(R0)(R1)(R2)(R3); -} - -void RC2::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word16 R0, R1, R2, R3; - Block::Get(inBlock)(R0)(R1)(R2)(R3); - - for (int i = 15; i >= 0; i--) - { - if (i == 4 || i == 10) - { - R3 = word16(R3 - K[R2 & 63]); - R2 = word16(R2 - K[R1 & 63]); - R1 = word16(R1 - K[R0 & 63]); - R0 = word16(R0 - K[R3 & 63]); - } - - R3 = rotrFixed(R3, 5); - R3 = word16(R3 - ((R0 & ~R2) + (R1 & R2) + K[4*i+3])); - - R2 = rotrFixed(R2, 3); - R2 = word16(R2 - ((R3 & ~R1) + (R0 & R1) + K[4*i+2])); - - R1 = rotrFixed(R1, 2); - R1 = word16(R1 - ((R2 & ~R0) + (R3 & R0) + K[4*i+1])); - - R0 = rotrFixed(R0, 1); - R0 = word16(R0 - ((R1 & ~R3) + (R2 & R3) + K[4*i+0])); - } - - Block::Put(xorBlock, outBlock)(R0)(R1)(R2)(R3); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/rc2.h b/external/crypto++-5.6.3/rc2.h deleted file mode 100644 index 406bd0cb4..000000000 --- a/external/crypto++-5.6.3/rc2.h +++ /dev/null @@ -1,95 +0,0 @@ -// rc2.h - written and placed in the public domain by Wei Dai - -//! \file rc2.h -//! \brief Classes for the RC2 block cipher - -#ifndef CRYPTOPP_RC2_H -#define CRYPTOPP_RC2_H - -#include "seckey.h" -#include "secblock.h" -#include "algparam.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class RC2_Info -//! \brief The RC2 cipher's key, iv, block size and name information. -struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128> -{ - CRYPTOPP_CONSTANT(DEFAULT_EFFECTIVE_KEYLENGTH = 1024) - CRYPTOPP_CONSTANT(MAX_EFFECTIVE_KEYLENGTH = 1024) - static const char *StaticAlgorithmName() {return "RC2";} -}; - -//! \class RC2 -//! \brief The RC2 stream cipher -//! \sa RC2 on the Crypto Lounge. -class RC2 : public RC2_Info, public BlockCipherDocumentation -{ - //! \class Base - //! \brief Class specific methods used to operate the cipher. - //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} - - protected: - FixedSizeSecBlock K; // expanded key table - }; - - //! \class Enc - //! \brief Class specific methods used to operate the cipher in the forward direction. - //! \details Implementations and overrides in \p Enc apply to \p ENCRYPTION. - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - //! \class Dec - //! \brief Class specific methods used to operate the cipher in the reverse direction. - //! \details Implementations and overrides in \p Dec apply to \p DECRYPTION. - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - - //! \class Encryption - //! \brief Class specific methods used to operate the cipher in the forward direction. - //! \details Implementations and overrides in \p Encryption apply to \p ENCRYPTION. - class Encryption : public BlockCipherFinal - { - public: - Encryption() {} - Encryption(const byte *key, size_t keyLen=DEFAULT_KEYLENGTH) - {SetKey(key, keyLen);} - Encryption(const byte *key, size_t keyLen, int effectiveKeyLen) - {SetKey(key, keyLen, MakeParameters("EffectiveKeyLength", effectiveKeyLen));} - }; - - //! \class Decryption - //! \brief Class specific methods used to operate the cipher in the reverse direction. - //! \details Implementations and overrides in \p Decryption apply to \p DECRYPTION. - class Decryption : public BlockCipherFinal - { - public: - Decryption() {} - Decryption(const byte *key, size_t keyLen=DEFAULT_KEYLENGTH) - {SetKey(key, keyLen);} - Decryption(const byte *key, size_t keyLen, int effectiveKeyLen) - {SetKey(key, keyLen, MakeParameters("EffectiveKeyLength", effectiveKeyLen));} - }; -}; - -typedef RC2::Encryption RC2Encryption; -typedef RC2::Decryption RC2Decryption; - -NAMESPACE_END - -#endif - diff --git a/external/crypto++-5.6.3/rc5.cpp b/external/crypto++-5.6.3/rc5.cpp deleted file mode 100644 index 66deeec18..000000000 --- a/external/crypto++-5.6.3/rc5.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// rc5.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "rc5.h" -#include "misc.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -void RC5::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(keylen); - - r = GetRoundsAndThrowIfInvalid(params, this); - sTable.New(2*(r+1)); - - static const RC5_WORD MAGIC_P = 0xb7e15163L; // magic constant P for wordsize - static const RC5_WORD MAGIC_Q = 0x9e3779b9L; // magic constant Q for wordsize - static const int U=sizeof(RC5_WORD); - - const unsigned int c = STDMAX((keylen+U-1)/U, 1U); // RC6 paper says c=1 if keylen==0 - SecBlock l(c); - - GetUserKey(LITTLE_ENDIAN_ORDER, l.begin(), c, k, keylen); - - sTable[0] = MAGIC_P; - for (unsigned j=1; j Block; - -void RC5::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - const RC5_WORD *sptr = sTable; - RC5_WORD a, b; - - Block::Get(inBlock)(a)(b); - a += sptr[0]; - b += sptr[1]; - sptr += 2; - - for(unsigned i=0; i, public VariableKeyLength<16, 0, 255>, public VariableRounds<16> -{ - static const char *StaticAlgorithmName() {return "RC5";} - typedef word32 RC5_WORD; -}; - -/// RC5 -class RC5 : public RC5_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - unsigned int r; // number of rounds - SecBlock sTable; // expanded key table - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef RC5::Encryption RC5Encryption; -typedef RC5::Decryption RC5Decryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rc6.cpp b/external/crypto++-5.6.3/rc6.cpp deleted file mode 100644 index c6ddd09cc..000000000 --- a/external/crypto++-5.6.3/rc6.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// rc6.cpp - written and placed in the public domain by Sean Woods -// based on Wei Dai's RC5 code. - -#include "pch.h" -#include "rc6.h" -#include "misc.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -void RC6::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(keylen); - - r = GetRoundsAndThrowIfInvalid(params, this); - sTable.New(2*(r+2)); - - static const RC6_WORD MAGIC_P = 0xb7e15163L; // magic constant P for wordsize - static const RC6_WORD MAGIC_Q = 0x9e3779b9L; // magic constant Q for wordsize - static const int U=sizeof(RC6_WORD); - - const unsigned int c = STDMAX((keylen+U-1)/U, 1U); // RC6 paper says c=1 if keylen==0 - SecBlock l(c); - - GetUserKey(LITTLE_ENDIAN_ORDER, l.begin(), c, k, keylen); - - sTable[0] = MAGIC_P; - for (unsigned j=1; j Block; - -void RC6::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - const RC6_WORD *sptr = sTable; - RC6_WORD a, b, c, d, t, u; - - Block::Get(inBlock)(a)(b)(c)(d); - b += sptr[0]; - d += sptr[1]; - sptr += 2; - - for(unsigned i=0; i, public VariableKeyLength<16, 0, 255>, public VariableRounds<20> -{ - static const char *StaticAlgorithmName() {return "RC6";} - typedef word32 RC6_WORD; -}; - -/// RC6 -class RC6 : public RC6_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - unsigned int r; // number of rounds - SecBlock sTable; // expanded key table - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef RC6::Encryption RC6Encryption; -typedef RC6::Decryption RC6Decryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rdrand-masm.cmd b/external/crypto++-5.6.3/rdrand-masm.cmd deleted file mode 100644 index 7a5e5ae98..000000000 --- a/external/crypto++-5.6.3/rdrand-masm.cmd +++ /dev/null @@ -1,117 +0,0 @@ -REM make-rdrand -@echo OFF - -@cls - -@del rdrand.obj rdrand-x86.obj rdrand-x64.obj rdrand-x86.lib rdrand-x64.lib /Q > nul - -REM Visual Studio 2005 -REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin -REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\amd64 - -REM Visual Studio 2010 -REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 10\VC\bin -REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 10\VC\bin\amd64 - -REM Visual Studio 2012 -REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin -REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64 - -REM Visual Studio 2013 -@set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x86 -@set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64 - -@set MASM="%TOOLS32%\ml.exe" -@set MASM64="%TOOLS64%\ml64.exe" -@set DUMPBIN="%TOOLS32%\dumpbin.exe" -@set LIBTOOL="%TOOLS32%\lib.exe" - -REM /W3 - Warning level -REM /Cx - Preserve case in external symbols -REM /Zi - Porgram Database information -@set ASFLAGS=/nologo /D_M_X86 /W3 /Cx /Zi /safeseh -@set ASFLAGS64=/nologo /D_M_X64 /W3 /Cx /Zi -@set LIBFLAGS=/nologo /SUBSYSTEM:CONSOLE - -REM Use _M_X86 and _M_X64 becuase cl.exe uses them. It keeps preprocessor defines consistent. -echo **************************************** -echo Assembling rdrand.asm into rdrand-x86.obj -call %MASM% %ASFLAGS% /Fo rdrand-x86.obj /c rdrand.asm > nul -@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to assemble rdrand.asm with X86 && goto SCRIPT_FAILED) -echo Done... - -echo **************************************** -echo Assembling rdrand.asm into rdrand-x64.obj -call %MASM64% %ASFLAGS64% /Fo rdrand-x64.obj /c rdrand.asm > nul -@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to assemble rdrand.asm with X64 && goto SCRIPT_FAILED) -echo Done... - -echo **************************************** -echo Creating static library rdrand-x86.lib -call %LIBTOOL% %LIBFLAGS% /MACHINE:X86 /OUT:rdrand-x86.lib rdrand-x86.obj > nul -@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to create rdrand-x86.lib && goto SCRIPT_FAILED) -echo Done... - -echo **************************************** -echo Creating static library rdrand-x64.lib -call %LIBTOOL% %LIBFLAGS% /MACHINE:X64 /OUT:rdrand-x64.lib rdrand-x64.obj > nul -@IF NOT %ERRORLEVEL% EQU 0 (echo Failed to create rdrand-x64.lib && goto SCRIPT_FAILED) -echo Done... - -goto SKIP_SYMBOL_DUMP_OBJ - -echo **************************************** -echo Dumping symbols for rdrand-x86.obj -echo. -call %DUMPBIN% /SYMBOLS rdrand-x86.obj - -echo **************************************** -echo Dumping symbols for rdrand-x64.obj -echo. -call %DUMPBIN% /SYMBOLS rdrand-x64.obj - -:SKIP_SYMBOL_DUMP_OBJ - -goto SKIP_SYMBOL_DUMP_LIB - -echo **************************************** -echo Dumping symbols for rdrand-x86.lib -echo. -call %DUMPBIN% /SYMBOLS rdrand-x86.lib - -echo **************************************** -echo Dumping symbols for rdrand-x64.lib -echo. -call %DUMPBIN% /SYMBOLS rdrand-x64.lib - -:SKIP_SYMBOL_DUMP_LIB - -goto SKIP_EXPORT_DUMP - -echo **************************************** -echo Dumping exports for rdrand-x86.lib -echo. -call %DUMPBIN% /EXPORTS rdrand-x86.lib - -echo **************************************** -echo Dumping exports for rdrand-x64.lib -echo. -call %DUMPBIN% /EXPORTS rdrand-x64.lib - -:SKIP_EXPORT_DUMP - -REM goto SKIP_DISASSEMBLY - -echo **************************************** -echo Disassembling rdrand-x64.obj -echo. -call %DUMPBIN% /DISASM:NOBYTES rdrand-x64.obj - -echo **************************************** -echo Disassembling rdrand-x86.obj -echo. -call %DUMPBIN% /DISASM:NOBYTES rdrand-x86.obj - -:SKIP_DISASSEMBLY - -:SCRIPT_FAILED diff --git a/external/crypto++-5.6.3/rdrand-nasm.sh b/external/crypto++-5.6.3/rdrand-nasm.sh deleted file mode 100644 index bc135c16a..000000000 --- a/external/crypto++-5.6.3/rdrand-nasm.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -reset - -nasm -f elf32 rdrand.S -DX86 -g -o rdrand-x86.o -nasm -f elfx32 rdrand.S -DX32 -g -o rdrand-x32.o -nasm -f elf64 rdrand.S -DX64 -g -o rdrand-x64.o - -echo "**************************************" -echo "**************************************" - -objdump --disassemble rdrand-x86.o - -echo -echo "**************************************" -echo "**************************************" - -objdump --disassemble rdrand-x32.o - -echo -echo "**************************************" -echo "**************************************" - -objdump --disassemble rdrand-x64.o diff --git a/external/crypto++-5.6.3/rdrand.S b/external/crypto++-5.6.3/rdrand.S deleted file mode 100644 index 9a1c4f1ea..000000000 --- a/external/crypto++-5.6.3/rdrand.S +++ /dev/null @@ -1,596 +0,0 @@ -;; rdrand.asm - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. -;; Copyright assigned to the Crypto++ project. - -;; This ASM file provides RDRAND and RDSEED to downlevel Unix and Linux tool chains. -;; Additionally, the inline assembly code produced by GCC and Clang is not that -;; impressive. However, using this code requires NASM and an edit to the GNUmakefile. - -;; nasm -f elf32 rdrand.S -DX86 -g -o rdrand-x86.o -;; nasm -f elfx32 rdrand.S -DX32 -g -o rdrand-x32.o -;; nasm -f elf64 rdrand.S -DX64 -g -o rdrand-x64.o - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; Naming convention used in rdrand.{h|cpp|asm|S} -;; MSC = Microsoft Compiler (and compatibles) -;; GCC = GNU Compiler (and compatibles) -;; ALL = MSC and GCC (and compatibles) -;; RRA = RDRAND, Assembly -;; RSA = RDSEED, Assembly -;; RRI = RDRAND, Intrinsic -;; RSA = RDSEED, Intrinsic - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; C/C++ Function prototypes -;; X86, X32 and X64: -;; extern "C" int NASM_RRA_GenerateBlock(byte* ptr, size_t size, unsigned int safety); - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; Return values -%define RDRAND_SUCCESS 1 -%define RDRAND_FAILURE 0 - -%define RDSEED_SUCCESS 1 -%define RDSEED_FAILURE 0 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%ifdef X86 or X32 ;; Set via the command line - -;; Arg1, byte* buffer -;; Arg2, size_t bsize -;; Arg3, unsigned int safety -;; EAX (out): success (1), failure (0) - -global NASM_RRA_GenerateBlock -section .text - -%ifdef X86 -align 8 -cpu 486 -%else -align 16 -%endif - -NASM_RRA_GenerateBlock: - -%ifdef X86 -%define arg1 [ebp+04h] -%define arg2 [ebp+08h] -%define arg3 [ebp+0ch] -%define MWSIZE 04h ;; machine word size -%else -%define MWSIZE 08h ;; machine word size -%endif - - %define buffer edi - %define bsize esi - %define safety edx - -%ifdef X86 -.Load_Arguments: - - mov buffer, arg1 - mov bsize, arg2 - mov safety, arg3 -%endif - -.Validate_Pointer: - - cmp buffer, 0 - je .GenerateBlock_PreRet - - ;; Top of While loop -.GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je .GenerateBlock_Success - -%ifdef X86 -.Call_RDRAND_EAX: -%else -.Call_RDRAND_RAX: - DB 48h ;; X32 can use the full register, issue the REX.w prefix -%endif - ;; RDRAND is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdrand eax`. - DB 0Fh, 07h, F0h - - ;; If CF=1, the number returned by RDRAND is valid. - ;; If CF=0, a random number was not available. - jc .RDRAND_succeeded - -.RDRAND_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je .GenerateBlock_Failure - - dec safety - jmp .GenerateBlock_Top - -.RDRAND_succeeded: - - cmp bsize, MWSIZE - jb .Partial_Machine_Word - -.Full_Machine_Word: - -%ifdef X32 - mov [buffer+4], eax ;; We can only move 4 at a time - DB 048h ;; Combined, these result in - shr eax, 32 ;; `shr rax, 32` -%endif - - mov [buffer], eax - add buffer, MWSIZE ;; No need for Intel Core 2 slow word workarounds, - sub bsize, MWSIZE ;; like `lea buffer,[buffer+MWSIZE]` for faster adds - - ;; Continue - jmp .GenerateBlock_Top - - ;; 1,2,3 bytes remain for X86 - ;; 1,2,3,4,5,6,7 remain for X32 -.Partial_Machine_Word: - -%ifdef X32 - ;; Test bit 2 to see if size is at least 4 - test bsize, 4 - jz .Bit_2_Not_Set - - mov [buffer], eax - add buffer, 4 - - DB 048h ;; Combined, these result in - shr eax, 32 ;; `shr rax, 32` - -.Bit_2_Not_Set: -%endif - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz .Bit_1_Not_Set - - mov [buffer], ax - shr eax, 16 - add buffer, 2 - -.Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz .GenerateBlock_Success - - mov [buffer], al - -.Bit_0_Not_Set: - - ;; We've hit all the bits - jmp .GenerateBlock_Success - -.GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je .GenerateBlock_Success - -.GenerateBlock_Failure: - - xor eax, eax - mov al, RDRAND_FAILURE - ret - -.GenerateBlock_Success: - - xor eax, eax - mov al, RDRAND_SUCCESS - ret - -%endif ;; X86 and X32 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%ifdef X64 ;; Set via the command line - -global NASM_RRA_GenerateBlock -section .text -align 16 - -;; Arg1, byte* buffer -;; Arg2, size_t bsize -;; Arg3, unsigned int safety -;; RAX (out): success (1), failure (0) - -NASM_RRA_GenerateBlock: - -%define MWSIZE 08h ;; machine word size -%define buffer rdi -%define bsize rsi -%define safety edx - - ;; No need for Load_Arguments due to fastcall - -.Validate_Pointer: - - ;; Validate pointer - cmp buffer, 0 - je .GenerateBlock_PreRet - - ;; Top of While loop -.GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je .GenerateBlock_Success - -.Call_RDRAND_RAX: - ;; RDRAND is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdrand rax`. - DB 048h, 0Fh, 0C7h, 0F0h - - ;; If CF=1, the number returned by RDRAND is valid. - ;; If CF=0, a random number was not available. - jc .RDRAND_succeeded - -.RDRAND_failed: - - ;; Exit if we've reached the limit - cmp safety, 0h - je .GenerateBlock_Failure - - dec safety - jmp .GenerateBlock_Top - -.RDRAND_succeeded: - - cmp bsize, MWSIZE - jb .Partial_Machine_Word - -.Full_Machine_Word: - - mov [buffer], rax - add buffer, MWSIZE - sub bsize, MWSIZE - - ;; Continue - jmp .GenerateBlock_Top - - ;; 1,2,3,4,5,6,7 bytes remain -.Partial_Machine_Word: - - ;; Test bit 2 to see if size is at least 4 - test bsize, 4 - jz .Bit_2_Not_Set - - mov [buffer], eax - shr rax, 32 - add buffer, 4 - -.Bit_2_Not_Set: - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz .Bit_1_Not_Set - - mov [buffer], ax - shr eax, 16 - add buffer, 2 - -.Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz .GenerateBlock_Success - - mov [buffer], al - -.Bit_0_Not_Set: - - ;; We've hit all the bits - jmp .GenerateBlock_Success - -.GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je .GenerateBlock_Success - -.GenerateBlock_Failure: - - xor rax, rax - mov al, RDRAND_FAILURE - ret - -.GenerateBlock_Success: - - xor rax, rax - mov al, RDRAND_SUCCESS - ret - -%endif ;; X64 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%ifdef X86 or X32 ;; Set via the command line - -;; Arg1, byte* buffer -;; Arg2, size_t bsize -;; Arg3, unsigned int safety -;; EAX (out): success (1), failure (0) - -global NASM_RSA_GenerateBlock -section .text -align 8 - -%ifdef X86 -align 8 -cpu 486 -%else -align 16 -%endif - -NASM_RSA_GenerateBlock: - -%ifdef X86 -%define arg1 [ebp+04h] -%define arg2 [ebp+08h] -%define arg3 [ebp+0ch] -%define MWSIZE 04h ;; machine word size -%else -%define MWSIZE 08h ;; machine word size -%endif - - %define buffer edi - %define bsize esi - %define safety edx - -%ifdef X86 -.Load_Arguments: - - mov buffer, arg1 - mov bsize, arg2 - mov safety, arg3 -%endif - -.Validate_Pointer: - - cmp buffer, 0 - je .GenerateBlock_PreRet - - ;; Top of While loop -.GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je .GenerateBlock_Success - -%ifdef X86 -.Call_RDSEED_EAX: -%else -.Call_RDSEED_RAX: - DB 48h ;; X32 can use the full register, issue the REX.w prefix -%endif - ;; RDSEED is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdseed eax`. - DB 0Fh, 0C7h, 0F8h - - ;; If CF=1, the number returned by RDSEED is valid. - ;; If CF=0, a random number was not available. - jc .RDSEED_succeeded - -.RDSEED_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je .GenerateBlock_Failure - - dec safety - jmp .GenerateBlock_Top - -.RDSEED_succeeded: - - cmp bsize, MWSIZE - jb .Partial_Machine_Word - -.Full_Machine_Word: - - mov [buffer], eax - add buffer, MWSIZE ;; No need for Intel Core 2 slow word workarounds, - sub bsize, MWSIZE ;; like `lea buffer,[buffer+MWSIZE]` for faster adds - - ;; Continue - jmp .GenerateBlock_Top - - ;; 1,2,3 bytes remain for X86 - ;; 1,2,3,4,5,6,7 remain for X32 -.Partial_Machine_Word: - -%ifdef X32 - ;; Test bit 2 to see if size is at least 4 - test bsize, 4 - jz .Bit_2_Not_Set - - mov [buffer], eax - add buffer, 4 - - DB 048h ;; Combined, these result in - shr eax, 32 ;; `shr rax, 32` - -.Bit_2_Not_Set: -%endif - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz .Bit_1_Not_Set - - mov [buffer], ax - shr eax, 16 - add buffer, 2 - -.Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz .GenerateBlock_Success - - mov [buffer], al - -.Bit_0_Not_Set: - - ;; We've hit all the bits - jmp .GenerateBlock_Success - -.GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je .GenerateBlock_Success - -.GenerateBlock_Failure: - - xor eax, eax - mov al, RDSEED_FAILURE - ret - -.GenerateBlock_Success: - - xor eax, eax - mov al, RDSEED_SUCCESS - ret - -%endif ;; X86 and X32 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%ifdef X64 ;; Set via the command line - -global NASM_RSA_GenerateBlock -section .text -align 16 - -;; Arg1, byte* buffer -;; Arg2, size_t bsize -;; Arg3, unsigned int safety -;; RAX (out): success (1), failure (0) - -NASM_RSA_GenerateBlock: - -%define MWSIZE 08h ;; machine word size -%define buffer rdi -%define bsize rsi -%define safety edx - - ;; No need for Load_Arguments due to fastcall - -.Validate_Pointer: - - ;; Validate pointer - cmp buffer, 0 - je .GenerateBlock_PreRet - - ;; Top of While loop -.GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je .GenerateBlock_Success - -.Call_RDSEED_RAX: - ;; RDSEED is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdseed rax`. - DB 048h, 0Fh, 0C7h, 0F8h - - ;; If CF=1, the number returned by RDSEED is valid. - ;; If CF=0, a random number was not available. - jc .RDSEED_succeeded - -.RDSEED_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je .GenerateBlock_Failure - - dec safety - jmp .GenerateBlock_Top - -.RDSEED_succeeded: - - cmp bsize, MWSIZE - jb .Partial_Machine_Word - -.Full_Machine_Word: - - mov [buffer], rax - add buffer, MWSIZE - sub bsize, MWSIZE - - ;; Continue - jmp .GenerateBlock_Top - - ;; 1,2,3,4,5,6,7 bytes remain -.Partial_Machine_Word: - - ;; Test bit 2 to see if size is at least 4 - test bsize, 4 - jz .Bit_2_Not_Set - - mov [buffer], eax - shr rax, 32 - add buffer, 4 - -.Bit_2_Not_Set: - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz .Bit_1_Not_Set - - mov [buffer], ax - shr eax, 16 - add buffer, 2 - -.Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz .GenerateBlock_Success - - mov [buffer], al - -.Bit_0_Not_Set: - - ;; We've hit all the bits - jmp .GenerateBlock_Success - -.GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je .GenerateBlock_Success - -.GenerateBlock_Failure: - - xor rax, rax - mov al, RDSEED_FAILURE - ret - -.GenerateBlock_Success: - - xor rax, rax - mov al, RDSEED_SUCCESS - ret - -%endif ;; _M_X64 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - diff --git a/external/crypto++-5.6.3/rdrand.asm b/external/crypto++-5.6.3/rdrand.asm deleted file mode 100644 index 725b65ebb..000000000 --- a/external/crypto++-5.6.3/rdrand.asm +++ /dev/null @@ -1,557 +0,0 @@ -;; rdrand.asm - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. -;; Copyright assigned to the Crypto++ project. - -;; This ASM file provides RDRAND and RDSEED to downlevel Microsoft tool chains. -;; Everything "just works" under Visual Studio. Other platforms will have to -;; run MASM/MASM-64 and then link to the object files. - -;; set ASFLAGS=/nologo /D_M_X86 /W3 /Cx /Zi /safeseh -;; set ASFLAGS64=/nologo /D_M_X64 /W3 /Cx /Zi -;; "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\ml.exe" %ASFLAGS% /Fo rdrand-x86.obj /c rdrand.asm -;; "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\ml64.exe" %ASFLAGS64% /Fo rdrand-x64.obj /c rdrand.asm - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -TITLE MASM_RRA_GenerateBlock and MASM_RSA_GenerateBlock -SUBTITLE Microsoft specific ASM code to utilize RDRAND and RDSEED for down level Microsoft toolchains - -PUBLIC MASM_RRA_GenerateBlock -PUBLIC MASM_RSA_GenerateBlock - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; Naming convention used in rdrand.{h|cpp|asm} -;; MSC = Microsoft Compiler (and compatibles) -;; GCC = GNU Compiler (and compatibles) -;; ALL = MSC and GCC (and compatibles) -;; RRA = RDRAND, Assembly -;; RSA = RDSEED, Assembly -;; RRI = RDRAND, Intrinsic -;; RSA = RDSEED, Intrinsic - -;; Caller/Callee Saved Registers -;; https://msdn.microsoft.com/en-us/library/6t169e9c.aspx - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; C/C++ Function prototypes -;; X86: -;; extern "C" int MASM_RRA_GenerateBlock(byte* ptr, size_t size, unsigned int safety); -;; X64: -;; extern "C" int __fastcall MASM_RRA_GenerateBlock(byte* ptr, size_t size, unsigned int safety); - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; Return values -RDRAND_SUCCESS EQU 1 -RDRAND_FAILURE EQU 0 - -RDSEED_SUCCESS EQU 1 -RDSEED_FAILURE EQU 0 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -IFDEF _M_X86 ;; Set via the command line - -.486 -.MODEL FLAT - -ENDIF - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -IFDEF _M_X86 ;; Set via the command line - -.CODE -ALIGN 8 -OPTION LANGUAGE:C -OPTION PROLOGUE:NONE -OPTION EPILOGUE:NONE - -;; Base relative (in): arg1, byte* buffer -;; Base relative (in): arg2, size_t bsize -;; Base relative (in): arg3, unsigned int safety -;; EAX (out): success (1), failure (0) - -MASM_RRA_GenerateBlock PROC arg1:DWORD,arg2:DWORD,arg3:DWORD - - MWSIZE EQU 04h ;; machine word size - buffer EQU edi - bsize EQU edx - safety EQU ecx - -Load_Arguments: - - mov buffer, arg1 - mov bsize, arg2 - mov safety, arg3 - -Validate_Pointer: - - cmp buffer, 0 - je GenerateBlock_PreRet - - ;; Top of While loop -GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je GenerateBlock_Success - -Call_RDRAND_EAX: - ;; RDRAND is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdrand eax`. - DB 0Fh, 0C7h, 0F0h - - ;; If CF=1, the number returned by RDRAND is valid. - ;; If CF=0, a random number was not available. - jc RDRAND_succeeded - -RDRAND_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je GenerateBlock_Failure - - dec safety - jmp GenerateBlock_Top - -RDRAND_succeeded: - - cmp bsize, MWSIZE - jb Partial_Machine_Word - -Full_Machine_Word: - - mov DWORD PTR [buffer], eax - add buffer, MWSIZE ;; No need for Intel Core 2 slow workarounds, like - sub bsize, MWSIZE ;; `lea buffer,[buffer+MWSIZE]` for faster adds - - ;; Continue - jmp GenerateBlock_Top - - ;; 1,2,3 bytes remain -Partial_Machine_Word: - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz Bit_1_Not_Set - - mov WORD PTR [buffer], ax - shr eax, 16 - add buffer, 2 - -Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz GenerateBlock_Success - - mov BYTE PTR [buffer], al - -Bit_0_Not_Set: - - ;; We've hit all the bits - jmp GenerateBlock_Success - -GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je GenerateBlock_Success - -GenerateBlock_Failure: - - xor eax, eax - mov al, RDRAND_FAILURE - ret - -GenerateBlock_Success: - - xor eax, eax - mov al, RDRAND_SUCCESS - ret - -MASM_RRA_GenerateBlock ENDP - -ENDIF ;; _M_X86 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -IFDEF _M_X64 ;; Set via the command line - -.CODE -ALIGN 16 -OPTION PROLOGUE:NONE -OPTION EPILOGUE:NONE - -;; RCX (in): arg1, byte* buffer -;; RDX (in): arg2, size_t bsize -;; R8d (in): arg3, unsigned int safety -;; RAX (out): success (1), failure (0) - -MASM_RRA_GenerateBlock PROC - - MWSIZE EQU 08h ;; machine word size - buffer EQU rcx - bsize EQU rdx - safety EQU r8d - - ;; No need for Load_Arguments due to fastcall - -Validate_Pointer: - - ;; Validate pointer - cmp buffer, 0 - je GenerateBlock_PreRet - - ;; Top of While loop -GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je GenerateBlock_Success - -Call_RDRAND_RAX: - ;; RDRAND is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdrand rax`. - DB 048h, 0Fh, 0C7h, 0F0h - - ;; If CF=1, the number returned by RDRAND is valid. - ;; If CF=0, a random number was not available. - jc RDRAND_succeeded - -RDRAND_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je GenerateBlock_Failure - - dec safety - jmp GenerateBlock_Top - -RDRAND_succeeded: - - cmp bsize, MWSIZE - jb Partial_Machine_Word - -Full_Machine_Word: - - mov QWORD PTR [buffer], rax - add buffer, MWSIZE - sub bsize, MWSIZE - - ;; Continue - jmp GenerateBlock_Top - - ;; 1,2,3,4,5,6,7 bytes remain -Partial_Machine_Word: - - ;; Test bit 2 to see if size is at least 4 - test bsize, 4 - jz Bit_2_Not_Set - - mov DWORD PTR [buffer], eax - shr rax, 32 - add buffer, 4 - -Bit_2_Not_Set: - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz Bit_1_Not_Set - - mov WORD PTR [buffer], ax - shr eax, 16 - add buffer, 2 - -Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz GenerateBlock_Success - - mov BYTE PTR [buffer], al - -Bit_0_Not_Set: - - ;; We've hit all the bits - jmp GenerateBlock_Success - -GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je GenerateBlock_Success - -GenerateBlock_Failure: - - xor rax, rax - mov al, RDRAND_FAILURE - ret - -GenerateBlock_Success: - - xor rax, rax - mov al, RDRAND_SUCCESS - ret - -MASM_RRA_GenerateBlock ENDP - -ENDIF ;; _M_X64 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -IFDEF _M_X86 ;; Set via the command line - -.CODE -ALIGN 8 -OPTION LANGUAGE:C -OPTION PROLOGUE:NONE -OPTION EPILOGUE:NONE - -;; Base relative (in): arg1, byte* buffer -;; Base relative (in): arg2, size_t bsize -;; Base relative (in): arg3, unsigned int safety -;; EAX (out): success (1), failure (0) - -MASM_RSA_GenerateBlock PROC arg1:DWORD,arg2:DWORD,arg3:DWORD - - MWSIZE EQU 04h ;; machine word size - buffer EQU edi - bsize EQU edx - safety EQU ecx - -Load_Arguments: - - mov buffer, arg1 - mov bsize, arg2 - mov safety, arg3 - -Validate_Pointer: - - cmp buffer, 0 - je GenerateBlock_PreRet - - ;; Top of While loop -GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je GenerateBlock_Success - -Call_RDSEED_EAX: - ;; RDSEED is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdseed eax`. - DB 0Fh, 0C7h, 0F8h - - ;; If CF=1, the number returned by RDSEED is valid. - ;; If CF=0, a random number was not available. - jc RDSEED_succeeded - -RDSEED_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je GenerateBlock_Failure - - dec safety - jmp GenerateBlock_Top - -RDSEED_succeeded: - - cmp bsize, MWSIZE - jb Partial_Machine_Word - -Full_Machine_Word: - - mov DWORD PTR [buffer], eax - add buffer, MWSIZE ;; No need for Intel Core 2 slow workarounds, like - sub bsize, MWSIZE ;; `lea buffer,[buffer+MWSIZE]` for faster adds - - ;; Continue - jmp GenerateBlock_Top - - ;; 1,2,3 bytes remain -Partial_Machine_Word: - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz Bit_1_Not_Set - - mov WORD PTR [buffer], ax - shr eax, 16 - add buffer, 2 - -Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz GenerateBlock_Success - - mov BYTE PTR [buffer], al - -Bit_0_Not_Set: - - ;; We've hit all the bits - jmp GenerateBlock_Success - -GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je GenerateBlock_Success - -GenerateBlock_Failure: - - xor eax, eax - mov al, RDSEED_FAILURE - ret - -GenerateBlock_Success: - - xor eax, eax - mov al, RDSEED_SUCCESS - ret - -MASM_RSA_GenerateBlock ENDP - -ENDIF ;; _M_X86 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -IFDEF _M_X64 ;; Set via the command line - -.CODE -ALIGN 16 -OPTION PROLOGUE:NONE -OPTION EPILOGUE:NONE - -;; RCX (in): arg1, byte* buffer -;; RDX (in): arg2, size_t bsize -;; R8d (in): arg3, unsigned int safety -;; RAX (out): success (1), failure (0) - -MASM_RSA_GenerateBlock PROC ;; arg1:QWORD,arg2:QWORD,arg3:DWORD - - MWSIZE EQU 08h ;; machine word size - buffer EQU rcx - bsize EQU rdx - safety EQU r8d - - ;; No need for Load_Arguments due to fastcall - -Validate_Pointer: - - ;; Validate pointer - cmp buffer, 0 - je GenerateBlock_PreRet - - ;; Top of While loop -GenerateBlock_Top: - - ;; Check remaining size - cmp bsize, 0 - je GenerateBlock_Success - -Call_RDSEED_RAX: - ;; RDSEED is not available prior to VS2012. Just emit - ;; the byte codes using DB. This is `rdseed rax`. - DB 048h, 0Fh, 0C7h, 0F8h - - ;; If CF=1, the number returned by RDSEED is valid. - ;; If CF=0, a random number was not available. - jc RDSEED_succeeded - -RDSEED_failed: - - ;; Exit if we've reached the limit - cmp safety, 0 - je GenerateBlock_Failure - - dec safety - jmp GenerateBlock_Top - -RDSEED_succeeded: - - cmp bsize, MWSIZE - jb Partial_Machine_Word - -Full_Machine_Word: - - mov QWORD PTR [buffer], rax - add buffer, MWSIZE - sub bsize, MWSIZE - - ;; Continue - jmp GenerateBlock_Top - - ;; 1,2,3,4,5,6,7 bytes remain -Partial_Machine_Word: - - ;; Test bit 2 to see if size is at least 4 - test bsize, 4 - jz Bit_2_Not_Set - - mov DWORD PTR [buffer], eax - shr rax, 32 - add buffer, 4 - -Bit_2_Not_Set: - - ;; Test bit 1 to see if size is at least 2 - test bsize, 2 - jz Bit_1_Not_Set - - mov WORD PTR [buffer], ax - shr eax, 16 - add buffer, 2 - -Bit_1_Not_Set: - - ;; Test bit 0 to see if size is at least 1 - test bsize, 1 - jz GenerateBlock_Success - - mov BYTE PTR [buffer], al - -Bit_0_Not_Set: - - ;; We've hit all the bits - jmp GenerateBlock_Success - -GenerateBlock_PreRet: - - ;; Test for success (was the request completely fulfilled?) - cmp bsize, 0 - je GenerateBlock_Success - -GenerateBlock_Failure: - - xor rax, rax - mov al, RDSEED_FAILURE - ret - -GenerateBlock_Success: - - xor rax, rax - mov al, RDSEED_SUCCESS - ret - -MASM_RSA_GenerateBlock ENDP - -ENDIF ;; _M_X64 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -END diff --git a/external/crypto++-5.6.3/rdrand.cpp b/external/crypto++-5.6.3/rdrand.cpp deleted file mode 100644 index fb4f47724..000000000 --- a/external/crypto++-5.6.3/rdrand.cpp +++ /dev/null @@ -1,515 +0,0 @@ -// rdrand.cpp - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. -// Copyright assigned to Crypto++ project. - -#include "pch.h" -#include "config.h" -#include "cryptlib.h" -#include "secblock.h" -#include "rdrand.h" -#include "cpu.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100) -#endif - -// This file (and friends) provides both RDRAND and RDSEED, but its somewhat -// experimental. They were added at Crypto++ 5.6.3. At compile time, it -// indirectly uses CRYPTOPP_BOOL_{X86|X32|X64} (via CRYPTOPP_CPUID_AVAILABLE) -// to select an implementation or "throw NotImplemented". At runtime, the -// class uses the result of CPUID to determine if RDRAND or RDSEED are -// available. A lazy throw strategy is used in case the CPU does not support -// the instruction. I.e., the throw is deferred until GenerateBlock is called. - -// Here's the naming convention for the functions.... -// MSC = Microsoft Compiler (and compatibles) -// GCC = GNU Compiler (and compatibles) -// ALL = MSC and GCC (and compatibles) -// RRA = RDRAND, Assembly -// RSA = RDSEED, Assembly -// RRI = RDRAND, Intrinsic -// RSA = RDSEED, Intrinsic - -///////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////// - -// For Linux, install NASM, run rdrand-nasm.asm, add the apppropriate -// object file to the Makefile's LIBOBJS (rdrand-x{86|32|64}.o). After -// that, define these. They are not enabled by default because they -// are not easy to cut-in in the Makefile. - -#if 0 -#define NASM_RDRAND_ASM_AVAILABLE 1 -#define NASM_RDSEED_ASM_AVAILABLE 1 -#endif - -///////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////// - -// According to Wei, CRYPTOPP_DISABLE_ASM is a failsafe due to the assembler. -// We sidestep it because it does not limit us. The assembler does not limit -// us because we emit out own byte codes as needed. To diasble RDRAND or -// RDSEED, set CRYPTOPP_BOOL_RDRAND_ASM or CRYPTOPP_BOOL_RDSEED_ASM to 0. -#ifndef CRYPTOPP_CPUID_AVAILABLE -# if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -# define CRYPTOPP_CPUID_AVAILABLE -# endif -#endif - -#if defined(CRYPTOPP_CPUID_AVAILABLE) && !defined(CRYPTOPP_BOOL_RDRAND_ASM) -# define CRYPTOPP_BOOL_RDRAND_ASM 1 -#else -# define CRYPTOPP_BOOL_RDRAND_ASM 0 -#endif -#if defined(CRYPTOPP_CPUID_AVAILABLE) && !defined(CRYPTOPP_BOOL_RDSEED_ASM) -# define CRYPTOPP_BOOL_RDSEED_ASM 1 -#else -# define CRYPTOPP_BOOL_RDSEED_ASM 0 -#endif - -#if defined(CRYPTOPP_CPUID_AVAILABLE) -# define MSC_INTRIN_COMPILER ((CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) -# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) -#else -# define MSC_INTRIN_COMPILER 0 -# define GCC_INTRIN_COMPILER 0 -#endif - -// In general, the library's ASM code is best on Windows, and Intrinsics is -// the best code under GCC and compatibles. We favor them accordingly. -// The NASM code is optimized well on Linux, but its not easy to cut-in. -#if defined(CRYPTOPP_CPUID_AVAILABLE) && (CRYPTOPP_MSC_VERSION >= 1200) -# if CRYPTOPP_BOOL_RDRAND_ASM -# define MASM_RDRAND_ASM_AVAILABLE 1 -# elif MSC_INTRIN_COMPILER -# define ALL_RDRAND_INTRIN_AVAILABLE 1 -# endif -# if CRYPTOPP_BOOL_RDSEED_ASM -# define MASM_RDSEED_ASM_AVAILABLE 1 -# elif MSC_INTRIN_COMPILER -# define ALL_RDSEED_INTRIN_AVAILABLE 1 -# endif -#elif defined(CRYPTOPP_CPUID_AVAILABLE) && (CRYPTOPP_GCC_VERSION >= 30200) -# if GCC_INTRIN_COMPILER && defined(__RDRND__) -# define ALL_RDRAND_INTRIN_AVAILABLE 1 -# elif CRYPTOPP_BOOL_RDRAND_ASM -# define GCC_RDRAND_ASM_AVAILABLE 1 -# endif -# if GCC_INTRIN_COMPILER && defined(__RDSEED__) -# define ALL_RDSEED_INTRIN_AVAILABLE 1 -# elif CRYPTOPP_BOOL_RDSEED_ASM -# define GCC_RDSEED_ASM_AVAILABLE 1 -# endif -#endif - -// Debug diagnostics -#if 0 -# if MASM_RDRAND_ASM_AVAILABLE -# pragma message ("MASM_RDRAND_ASM_AVAILABLE is 1") -# elif NASM_RDRAND_ASM_AVAILABLE -# pragma message ("NASM_RDRAND_ASM_AVAILABLE is 1") -# elif GCC_RDRAND_ASM_AVAILABLE -# pragma message ("GCC_RDRAND_ASM_AVAILABLE is 1") -# elif ALL_RDRAND_INTRIN_AVAILABLE -# pragma message ("ALL_RDRAND_INTRIN_AVAILABLE is 1") -# else -# pragma message ("RDRAND is not available") -# endif -# if MASM_RDSEED_ASM_AVAILABLE -# pragma message ("MASM_RDSEED_ASM_AVAILABLE is 1") -# elif NASM_RDSEED_ASM_AVAILABLE -# pragma message ("NASM_RDSEED_ASM_AVAILABLE is 1") -# elif GCC_RDSEED_ASM_AVAILABLE -# pragma message ("GCC_RDSEED_ASM_AVAILABLE is 1") -# elif ALL_RDSEED_INTRIN_AVAILABLE -# pragma message ("ALL_RDSEED_INTRIN_AVAILABLE is 1") -# else -# pragma message ("RDSEED is not available") -# endif -#endif - -///////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////// - -#if (ALL_RDRAND_INTRIN_AVAILABLE || ALL_RDSEED_INTRIN_AVAILABLE) -# include // rdrand, MSC, ICC, and GCC -# if defined(__has_include) -# if __has_include() -# include // rdseed for some compilers, like GCC -# endif -# endif -#endif - -#if MASM_RDRAND_ASM_AVAILABLE -# ifdef _M_X64 -extern "C" int CRYPTOPP_FASTCALL MASM_RRA_GenerateBlock(byte*, size_t, unsigned int); -// # pragma comment(lib, "rdrand-x64.lib") -# else -extern "C" int MASM_RRA_GenerateBlock(byte*, size_t, unsigned int); -// # pragma comment(lib, "rdrand-x86.lib") -# endif -#endif - -#if MASM_RDSEED_ASM_AVAILABLE -# ifdef _M_X64 -extern "C" int CRYPTOPP_FASTCALL MASM_RSA_GenerateBlock(byte*, size_t, unsigned int); -// # pragma comment(lib, "rdrand-x64.lib") -# else -extern "C" int MASM_RSA_GenerateBlock(byte*, size_t, unsigned int); -// # pragma comment(lib, "rdrand-x86.lib") -# endif -#endif - -#if NASM_RDRAND_ASM_AVAILABLE -extern "C" int NASM_RRA_GenerateBlock(byte*, size_t, unsigned int); -#endif - -#if NASM_RDSEED_ASM_AVAILABLE -extern "C" int NASM_RSA_GenerateBlock(byte*, size_t, unsigned int); -#endif - -///////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////// - -NAMESPACE_BEGIN(CryptoPP) - -#if ALL_RDRAND_INTRIN_AVAILABLE -static int ALL_RRI_GenerateBlock(byte *output, size_t size, unsigned int safety) -{ - assert((output && size) || !(output || size)); -#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 - word64 val; -#else - word32 val; -#endif - - while (size >= sizeof(val)) - { -#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 - if (_rdrand64_step((word64*)output)) -#else - if (_rdrand32_step((word32*)output)) -#endif - { - output += sizeof(val); - size -= sizeof(val); - } - else - { - if (!safety--) - return 0; - } - } - - if (size) - { -#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 - if (_rdrand64_step(&val)) -#else - if (_rdrand32_step(&val)) -#endif - { - memcpy(output, &val, size); - size = 0; - } - else - { - if (!safety--) - return 0; - } - } - -#if CRYPTOPP_BOOL_X64 || CRYTPOPP_BOOL_X32 - *((volatile word64*)&val) = 0; -#else - *((volatile word32*)&val) = 0; -#endif - - return int(size == 0); -} -#endif // ALL_RDRAND_INTRINSIC_AVAILABLE - -#if GCC_RDRAND_ASM_AVAILABLE -static int GCC_RRA_GenerateBlock(byte *output, size_t size, unsigned int safety) -{ - assert((output && size) || !(output || size)); -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - word64 val; -#else - word32 val; -#endif - char rc; - while (size) - { - __asm__ volatile( -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - ".byte 0x48, 0x0f, 0xc7, 0xf0;\n" // rdrand rax -#else - ".byte 0x0f, 0xc7, 0xf0;\n" // rdrand eax -#endif - "setc %1; " - : "=a" (val), "=qm" (rc) - : - : "cc" - ); - - if (rc) - { - if (size >= sizeof(val)) - { -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32) - *((word64*)output) = val; -#elif defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X86) - *((word32*)output) = val; -#else - memcpy(output, &val, sizeof(val)); -#endif - output += sizeof(val); - size -= sizeof(val); - } - else - { - memcpy(output, &val, size); - size = 0; - } - } - else - { - if (!safety--) - break; - } - } - -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - *((volatile word64*)&val) = 0; -#else - *((volatile word32*)&val) = 0; -#endif - - return int(size == 0); -} - -#endif // GCC_RDRAND_ASM_AVAILABLE - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -void RDRAND::GenerateBlock(byte *output, size_t size) -{ - CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); - assert((output && size) || !(output || size)); - - if(!HasRDRAND()) - throw NotImplemented("RDRAND: rdrand is not available on this platform"); - - int rc; CRYPTOPP_UNUSED(rc); -#if MASM_RDRAND_ASM_AVAILABLE - rc = MASM_RRA_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDRAND_Err("MASM_RRA_GenerateBlock"); } -#elif NASM_RDRAND_ASM_AVAILABLE - rc = NASM_RRA_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDRAND_Err("NASM_RRA_GenerateBlock"); } -#elif ALL_RDRAND_INTRIN_AVAILABLE - rc = ALL_RRI_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDRAND_Err("ALL_RRI_GenerateBlock"); } -#elif GCC_RDRAND_ASM_AVAILABLE - rc = GCC_RRA_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDRAND_Err("GCC_RRA_GenerateBlock"); } -#else - // RDRAND not detected at compile time, and no suitable compiler found - throw NotImplemented("RDRAND: failed to find a suitable implementation???"); -#endif // CRYPTOPP_CPUID_AVAILABLE -} - -void RDRAND::DiscardBytes(size_t n) -{ - // RoundUpToMultipleOf is used because a full word is read, and its cheaper - // to discard full words. There's no sense in dealing with tail bytes. - assert(HasRDRAND()); -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - FixedSizeSecBlock discard; - n = RoundUpToMultipleOf(n, sizeof(word64)); -#else - FixedSizeSecBlock discard; - n = RoundUpToMultipleOf(n, sizeof(word32)); -#endif - - size_t count = STDMIN(n, discard.SizeInBytes()); - while (count) - { - GenerateBlock(discard.BytePtr(), count); - n -= count; - count = STDMIN(n, discard.SizeInBytes()); - } -} -#endif // CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 - -///////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////// - -#if ALL_RDSEED_INTRIN_AVAILABLE -static int ALL_RSI_GenerateBlock(byte *output, size_t size, unsigned int safety) -{ - assert((output && size) || !(output || size)); -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - word64 val; -#else - word32 val; -#endif - - while (size >= sizeof(val)) - { -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - if (_rdseed64_step((word64*)output)) -#else - if (_rdseed32_step((word32*)output)) -#endif - { - output += sizeof(val); - size -= sizeof(val); - } - else - { - if (!safety--) - return 0; - } - } - - if (size) - { -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - if (_rdseed64_step(&val)) -#else - if (_rdseed32_step(&val)) -#endif - { - memcpy(output, &val, size); - size = 0; - } - else - { - if (!safety--) - return 0; - } - } - -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - *((volatile word64*)&val) = 0; -#else - *((volatile word32*)&val) = 0; -#endif - - return int(size == 0); -} -#endif // ALL_RDSEED_INTRIN_AVAILABLE - -#if GCC_RDSEED_ASM_AVAILABLE -static int GCC_RSA_GenerateBlock(byte *output, size_t size, unsigned int safety) -{ - assert((output && size) || !(output || size)); -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - word64 val; -#else - word32 val; -#endif - char rc; - while (size) - { - __asm__ volatile( -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - ".byte 0x48, 0x0f, 0xc7, 0xf8;\n" // rdseed rax -#else - ".byte 0x0f, 0xc7, 0xf8;\n" // rdseed eax -#endif - "setc %1; " - : "=a" (val), "=qm" (rc) - : - : "cc" - ); - - if (rc) - { - if (size >= sizeof(val)) - { -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32) - *((word64*)output) = val; -#elif defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) && (CRYPTOPP_BOOL_X86) - *((word32*)output) = val; -#else - memcpy(output, &val, sizeof(val)); -#endif - output += sizeof(val); - size -= sizeof(val); - } - else - { - memcpy(output, &val, size); - size = 0; - } - } - else - { - if (!safety--) - break; - } - } - -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - *((volatile word64*)&val) = 0; -#else - *((volatile word32*)&val) = 0; -#endif - - return int(size == 0); -} -#endif // GCC_RDSEED_ASM_AVAILABLE - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -void RDSEED::GenerateBlock(byte *output, size_t size) -{ - CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); - assert((output && size) || !(output || size)); - - if(!HasRDSEED()) - throw NotImplemented("RDSEED: rdseed is not available on this platform"); - - int rc; CRYPTOPP_UNUSED(rc); -#if MASM_RDSEED_ASM_AVAILABLE - rc = MASM_RSA_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDSEED_Err("MASM_RSA_GenerateBlock"); } -#elif NASM_RDSEED_ASM_AVAILABLE - rc = NASM_RSA_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDRAND_Err("NASM_RSA_GenerateBlock"); } -#elif ALL_RDSEED_INTRIN_AVAILABLE - rc = ALL_RSI_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDSEED_Err("ALL_RSI_GenerateBlock"); } -#elif GCC_RDSEED_ASM_AVAILABLE - rc = GCC_RSA_GenerateBlock(output, size, m_retries); - if (!rc) { throw RDSEED_Err("GCC_RSA_GenerateBlock"); } -#else - // RDSEED not detected at compile time, and no suitable compiler found - throw NotImplemented("RDSEED: failed to find a suitable implementation???"); -#endif -} - -void RDSEED::DiscardBytes(size_t n) -{ - // RoundUpToMultipleOf is used because a full word is read, and its cheaper - // to discard full words. There's no sense in dealing with tail bytes. - assert(HasRDSEED()); -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 - FixedSizeSecBlock discard; - n = RoundUpToMultipleOf(n, sizeof(word64)); -#else - FixedSizeSecBlock discard; - n = RoundUpToMultipleOf(n, sizeof(word32)); -#endif - - size_t count = STDMIN(n, discard.SizeInBytes()); - while (count) - { - GenerateBlock(discard.BytePtr(), count); - n -= count; - count = STDMIN(n, discard.SizeInBytes()); - } -} -#endif // CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/rdrand.h b/external/crypto++-5.6.3/rdrand.h deleted file mode 100644 index 81c62152c..000000000 --- a/external/crypto++-5.6.3/rdrand.h +++ /dev/null @@ -1,186 +0,0 @@ -// rdrand.h - written and placed in public domain by Jeffrey Walton and Uri Blumenthal. -// Copyright assigned to Crypto++ project. - -//! \file -//! \headerfile rdrand.h -//! \brief Classes for RDRAND and RDSEED - -#ifndef CRYPTOPP_RDRAND_H -#define CRYPTOPP_RDRAND_H - -#include "cryptlib.h" - -// This file (and friends) provides both RDRAND and RDSEED, but its somewhat -// experimental. They were added at Crypto++ 5.6.3. At compile time, it -// indirectly uses CRYPTOPP_BOOL_{X86|X32|X64} (via CRYPTOPP_CPUID_AVAILABLE) -// to select an implementation or "throw NotImplemented". At runtime, the -// class uses the result of CPUID to determine if RDRAND or RDSEED are -// available. A lazy throw strategy is used in case the CPU does not support -// the instruction. I.e., the throw is deferred until GenerateBlock() is called. - -// Microsoft added RDRAND in August 2012, VS2012. GCC added RDRAND in December 2010, GCC 4.6. -// Clang added RDRAND in July 2012, Clang 3.2. Intel added RDRAND in September 2011, ICC 12.1. - -NAMESPACE_BEGIN(CryptoPP) - -//! \brief Exception thrown when a RDRAND generator encounters -//! a generator related error. -class RDRAND_Err : public Exception -{ -public: - RDRAND_Err(const std::string &operation) - : Exception(OTHER_ERROR, "RDRAND: " + operation + " operation failed") {} -}; - -//! \brief Hardware generated random numbers using RDRAND instruction -//! \sa MaurerRandomnessTest() for random bit generators -class RDRAND : public RandomNumberGenerator -{ -public: - std::string AlgorithmName() const {return "RDRAND";} - - //! \brief Construct a RDRAND generator - //! \param retries the number of retries for failed calls to the hardware - //! \details RDRAND() constructs a generator with a maximum number of retires - //! for failed generation attempts. - RDRAND(unsigned int retries = 8) : m_retries(retries) {} - - virtual ~RDRAND() {} - - //! \brief Retrieve the number of retries used by the generator - //! \returns the number of times GenerateBlock() will attempt to recover from a failed generation - unsigned int GetRetries() const - { - return m_retries; - } - - //! \brief Set the number of retries used by the generator - //! \param retries number of times GenerateBlock() will attempt to recover from a failed generation - void SetRetries(unsigned int retries) - { - m_retries = retries; - } - - //! \brief Generate random array of bytes - //! \param output the byte buffer - //! \param size the length of the buffer, in bytes -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) - virtual void GenerateBlock(byte *output, size_t size); -#else - virtual void GenerateBlock(byte *output, size_t size) { - CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); - throw NotImplemented("RDRAND: rdrand is not available on this platform"); - } -#endif - - //! \brief Generate and discard n bytes - //! \param n the number of bytes to generate and discard - //! \details the RDSEED generator discards words, not bytes. If n is - //! not a multiple of a machine word, then it is rounded up to - //! that size. -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) - virtual void DiscardBytes(size_t n); -#else - virtual void DiscardBytes(size_t n) { - CRYPTOPP_UNUSED(n); - throw NotImplemented("RDRAND: rdrand is not available on this platform"); - } -#endif - - //! Update RNG state with additional unpredictable values - //! \param input unused - //! \param length unused - //! \details The operation is a nop for this generator. - virtual void IncorporateEntropy(const byte *input, size_t length) - { - // Override to avoid the base class' throw. - CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length); - assert(0); // warn in debug builds - } - -private: - unsigned int m_retries; -}; - -//! \brief Exception thrown when a RDSEED generator encounters -//! a generator related error. -class RDSEED_Err : public Exception -{ -public: - RDSEED_Err(const std::string &operation) - : Exception(OTHER_ERROR, "RDSEED: " + operation + " operation failed") {} -}; - -//! \brief Hardware generated random numbers using RDSEED instruction -//! \sa MaurerRandomnessTest() for random bit generators -class RDSEED : public RandomNumberGenerator -{ -public: - std::string AlgorithmName() const {return "RDSEED";} - - //! \brief Construct a RDSEED generator - //! \param retries the number of retries for failed calls to the hardware - //! \details RDSEED() constructs a generator with a maximum number of retires - //! for failed generation attempts. - RDSEED(unsigned int retries = 8) : m_retries(retries) {} - - virtual ~RDSEED() {} - - //! \brief Retrieve the number of retries used by the generator - //! \returns the number of times GenerateBlock() will attempt to recover from a failed generation - unsigned int GetRetries() const - { - return m_retries; - } - - //! \brief Set the number of retries used by the generator - //! \param retries number of times GenerateBlock() will attempt to recover from a failed generation - void SetRetries(unsigned int retries) - { - m_retries = retries; - } - - //! \brief Generate random array of bytes - //! \param output the byte buffer - //! \param size the length of the buffer, in bytes -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) - virtual void GenerateBlock(byte *output, size_t size); -#else - virtual void GenerateBlock(byte *output, size_t size) { - CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); - throw NotImplemented("RDSEED: rdseed is not available on this platform"); - } -#endif - - //! \brief Generate and discard n bytes - //! \param n the number of bytes to generate and discard - //! \details the RDSEED generator discards words, not bytes. If n is - //! not a multiple of a machine word, then it is rounded up to - //! that size. -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) - virtual void DiscardBytes(size_t n); -#else - virtual void DiscardBytes(size_t n) { - CRYPTOPP_UNUSED(n); - throw NotImplemented("RDSEED: rdseed is not available on this platform"); - } -#endif - - //! Update RNG state with additional unpredictable values - //! \param input unused - //! \param length unused - //! \details The operation is a nop for this generator. - virtual void IncorporateEntropy(const byte *input, size_t length) - { - // Override to avoid the base class' throw. - CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length); - assert(0); // warn in debug builds - } - -private: - unsigned int m_retries; -}; - -NAMESPACE_END - -#endif // CRYPTOPP_RDRAND_H diff --git a/external/crypto++-5.6.3/rdtables.cpp b/external/crypto++-5.6.3/rdtables.cpp deleted file mode 100644 index 493793252..000000000 --- a/external/crypto++-5.6.3/rdtables.cpp +++ /dev/null @@ -1,172 +0,0 @@ -// Rijndael tables - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "rijndael.h" - -// VC60 workaround: gives a C4786 warning without this function -// when runtime lib is set to multithread debug DLL -// even though warning 4786 is disabled! -void Rijndael_VC60Workaround() -{ -} - -NAMESPACE_BEGIN(CryptoPP) - -/* -Te0[x] = S [x].[02, 01, 01, 03]; -Te1[x] = S [x].[03, 02, 01, 01]; -Te2[x] = S [x].[01, 03, 02, 01]; -Te3[x] = S [x].[01, 01, 03, 02]; - -Td0[x] = Si[x].[0e, 09, 0d, 0b]; -Td1[x] = Si[x].[0b, 0e, 09, 0d]; -Td2[x] = Si[x].[0d, 0b, 0e, 09]; -Td3[x] = Si[x].[09, 0d, 0b, 0e]; -*/ - -const byte Rijndael::Base::Se[256] = { - 0x63, 0x7c, 0x77, 0x7b, - 0xf2, 0x6b, 0x6f, 0xc5, - 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab, 0x76, - 0xca, 0x82, 0xc9, 0x7d, - 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, - 0x9c, 0xa4, 0x72, 0xc0, - 0xb7, 0xfd, 0x93, 0x26, - 0x36, 0x3f, 0xf7, 0xcc, - 0x34, 0xa5, 0xe5, 0xf1, - 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23, 0xc3, - 0x18, 0x96, 0x05, 0x9a, - 0x07, 0x12, 0x80, 0xe2, - 0xeb, 0x27, 0xb2, 0x75, - 0x09, 0x83, 0x2c, 0x1a, - 0x1b, 0x6e, 0x5a, 0xa0, - 0x52, 0x3b, 0xd6, 0xb3, - 0x29, 0xe3, 0x2f, 0x84, - 0x53, 0xd1, 0x00, 0xed, - 0x20, 0xfc, 0xb1, 0x5b, - 0x6a, 0xcb, 0xbe, 0x39, - 0x4a, 0x4c, 0x58, 0xcf, - 0xd0, 0xef, 0xaa, 0xfb, - 0x43, 0x4d, 0x33, 0x85, - 0x45, 0xf9, 0x02, 0x7f, - 0x50, 0x3c, 0x9f, 0xa8, - 0x51, 0xa3, 0x40, 0x8f, - 0x92, 0x9d, 0x38, 0xf5, - 0xbc, 0xb6, 0xda, 0x21, - 0x10, 0xff, 0xf3, 0xd2, - 0xcd, 0x0c, 0x13, 0xec, - 0x5f, 0x97, 0x44, 0x17, - 0xc4, 0xa7, 0x7e, 0x3d, - 0x64, 0x5d, 0x19, 0x73, - 0x60, 0x81, 0x4f, 0xdc, - 0x22, 0x2a, 0x90, 0x88, - 0x46, 0xee, 0xb8, 0x14, - 0xde, 0x5e, 0x0b, 0xdb, - 0xe0, 0x32, 0x3a, 0x0a, - 0x49, 0x06, 0x24, 0x5c, - 0xc2, 0xd3, 0xac, 0x62, - 0x91, 0x95, 0xe4, 0x79, - 0xe7, 0xc8, 0x37, 0x6d, - 0x8d, 0xd5, 0x4e, 0xa9, - 0x6c, 0x56, 0xf4, 0xea, - 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, - 0x1c, 0xa6, 0xb4, 0xc6, - 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, - 0x70, 0x3e, 0xb5, 0x66, - 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, - 0x86, 0xc1, 0x1d, 0x9e, - 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, - 0x9b, 0x1e, 0x87, 0xe9, - 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, - 0xbf, 0xe6, 0x42, 0x68, - 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16, -}; - -const byte Rijndael::Base::Sd[256] = { - 0x52, 0x09, 0x6a, 0xd5, - 0x30, 0x36, 0xa5, 0x38, - 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, - 0x7c, 0xe3, 0x39, 0x82, - 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, - 0xc4, 0xde, 0xe9, 0xcb, - 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, - 0xee, 0x4c, 0x95, 0x0b, - 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, - 0x28, 0xd9, 0x24, 0xb2, - 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, - 0x72, 0xf8, 0xf6, 0x64, - 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, - 0x5d, 0x65, 0xb6, 0x92, - 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, - 0x5e, 0x15, 0x46, 0x57, - 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, - 0x8c, 0xbc, 0xd3, 0x0a, - 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, - 0xd0, 0x2c, 0x1e, 0x8f, - 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, - 0x01, 0x13, 0x8a, 0x6b, - 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, - 0x97, 0xf2, 0xcf, 0xce, - 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, - 0xe7, 0xad, 0x35, 0x85, - 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, - 0x47, 0xf1, 0x1a, 0x71, - 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, - 0xaa, 0x18, 0xbe, 0x1b, - 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, - 0x9a, 0xdb, 0xc0, 0xfe, - 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, - 0x88, 0x07, 0xc7, 0x31, - 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, - 0x60, 0x51, 0x7f, 0xa9, - 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, - 0x93, 0xc9, 0x9c, 0xef, - 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, - 0xc8, 0xeb, 0xbb, 0x3c, - 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, - 0xba, 0x77, 0xd6, 0x26, - 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d, -}; - -const word32 Rijndael::Base::rcon[] = { - 0x01000000, 0x02000000, 0x04000000, 0x08000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/regtest.cpp b/external/crypto++-5.6.3/regtest.cpp deleted file mode 100644 index c5dd04d54..000000000 --- a/external/crypto++-5.6.3/regtest.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// regtest.cpp - written and placed in the public domain by Wei Dai - -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 - -#include "cryptlib.h" -#include "factory.h" -#include "modes.h" -#include "dh.h" -#include "esign.h" -#include "md2.h" -#include "rw.h" -#include "md5.h" -#include "rsa.h" -#include "ripemd.h" -#include "dsa.h" -#include "seal.h" -#include "whrlpool.h" -#include "ttmac.h" -#include "camellia.h" -#include "shacal2.h" -#include "tea.h" -#include "panama.h" -#include "pssr.h" -#include "aes.h" -#include "salsa.h" -#include "vmac.h" -#include "tiger.h" -#include "md5.h" -#include "sosemanuk.h" -#include "arc4.h" -#include "ccm.h" -#include "gcm.h" -#include "eax.h" -#include "twofish.h" -#include "serpent.h" -#include "cast.h" -#include "rc6.h" -#include "mars.h" -#include "des.h" -#include "idea.h" -#include "rc5.h" -#include "tea.h" -#include "skipjack.h" -#include "cmac.h" -#include "dmac.h" -#include "blowfish.h" -#include "seed.h" -#include "wake.h" -#include "seal.h" -#include "crc.h" -#include "adler32.h" -#include "sha3.h" -#include "hkdf.h" - -// Aggressive stack checking with VS2005 SP1 and above. -#if (CRYPTOPP_MSC_VERSION >= 1410) -# pragma strict_gs_check (on) -#endif - -USING_NAMESPACE(CryptoPP) - -void RegisterFactories() -{ - static bool s_registered = false; - if (s_registered) - return; - - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterAsymmetricCipherDefaultFactories > >("RSA/OAEP-MGF1(SHA-1)"); - RegisterAsymmetricCipherDefaultFactories >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)"); - RegisterSignatureSchemeDefaultFactories(); - RegisterSignatureSchemeDefaultFactories >(); - RegisterSignatureSchemeDefaultFactories >(); - RegisterSignatureSchemeDefaultFactories >(); - RegisterSignatureSchemeDefaultFactories >(); - RegisterSignatureSchemeDefaultFactories >("NR(1363)/EMSA1(SHA-1)"); - RegisterSignatureSchemeDefaultFactories >("DSA-1363/EMSA1(SHA-1)"); - RegisterSignatureSchemeDefaultFactories >("RSA/PKCS1-1.5(MD2)"); - RegisterSignatureSchemeDefaultFactories >("RSA/PKCS1-1.5(SHA-1)"); - RegisterSignatureSchemeDefaultFactories >("ESIGN/EMSA5-MGF1(SHA-1)"); - RegisterSignatureSchemeDefaultFactories >("RW/EMSA2(SHA-1)"); - RegisterSignatureSchemeDefaultFactories >("RSA/PSS-MGF1(SHA-1)"); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories(); - RegisterSymmetricCipherDefaultFactories(); - RegisterSymmetricCipherDefaultFactories(); - RegisterSymmetricCipherDefaultFactories(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterAuthenticatedSymmetricCipherDefaultFactories >(); - RegisterAuthenticatedSymmetricCipherDefaultFactories >(); - RegisterAuthenticatedSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterSymmetricCipherDefaultFactories >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - RegisterDefaultFactoryFor >(); - - s_registered = true; -} diff --git a/external/crypto++-5.6.3/resource.h b/external/crypto++-5.6.3/resource.h deleted file mode 100644 index 861e22ba3..000000000 --- a/external/crypto++-5.6.3/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by cryptopp.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/external/crypto++-5.6.3/rijndael.cpp b/external/crypto++-5.6.3/rijndael.cpp deleted file mode 100644 index 99e6b8c81..000000000 --- a/external/crypto++-5.6.3/rijndael.cpp +++ /dev/null @@ -1,1277 +0,0 @@ -// rijndael.cpp - modified by Chris Morgan -// and Wei Dai from Paulo Baretto's Rijndael implementation -// The original code and all modifications are in the public domain. - -// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM rijndael.cpp" to generate MASM code - -/* -July 2010: Added support for AES-NI instructions via compiler intrinsics. -*/ - -/* -Feb 2009: The x86/x64 assembly code was rewritten in by Wei Dai to do counter mode -caching, which was invented by Hongjun Wu and popularized by Daniel J. Bernstein -and Peter Schwabe in their paper "New AES software speed records". The round -function was also modified to include a trick similar to one in Brian Gladman's -x86 assembly code, doing an 8-bit register move to minimize the number of -register spills. Also switched to compressed tables and copying round keys to -the stack. - -The C++ implementation now uses compressed tables if -CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is defined. -*/ - -/* -July 2006: Defense against timing attacks was added in by Wei Dai. - -The code now uses smaller tables in the first and last rounds, -and preloads them into L1 cache before usage (by loading at least -one element in each cache line). - -We try to delay subsequent accesses to each table (used in the first -and last rounds) until all of the table has been preloaded. Hopefully -the compiler isn't smart enough to optimize that code away. - -After preloading the table, we also try not to access any memory location -other than the table and the stack, in order to prevent table entries from -being unloaded from L1 cache, until that round is finished. -(Some popular CPUs have 2-way associative caches.) -*/ - -// This is the original introductory comment: - -/** - * version 3.0 (December 2000) - * - * Optimised ANSI C code for the Rijndael cipher (now AES) - * - * author Vincent Rijmen - * author Antoon Bosselaers - * author Paulo Barreto - * - * This code is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "pch.h" -#include "config.h" - -#ifndef CRYPTOPP_IMPORTS -#ifndef CRYPTOPP_GENERATE_X64_MASMrij - -#include "rijndael.h" -#include "stdcpp.h" // alloca -#include "misc.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -// Hack for https://github.com/weidai11/cryptopp/issues/42 -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) -# define CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS 1 -#endif - -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) -# if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) -namespace rdtable {CRYPTOPP_ALIGN_DATA(16) word64 Te[256+2];} -using namespace rdtable; -# else -static word64 Te[256]; -# endif -static word64 Td[256]; -#else -static word32 Te[256*4], Td[256*4]; -#endif -static volatile bool s_TeFilled = false, s_TdFilled = false; - -// ************************* Portable Code ************************************ - -#define QUARTER_ROUND(L, T, t, a, b, c, d) \ - a ^= L(T, 3, byte(t)); t >>= 8;\ - b ^= L(T, 2, byte(t)); t >>= 8;\ - c ^= L(T, 1, byte(t)); t >>= 8;\ - d ^= L(T, 0, t); - -#define QUARTER_ROUND_LE(t, a, b, c, d) \ - tempBlock[a] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\ - tempBlock[b] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\ - tempBlock[c] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\ - tempBlock[d] = ((byte *)(Te+t))[1]; - -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - #define QUARTER_ROUND_LD(t, a, b, c, d) \ - tempBlock[a] = ((byte *)(Td+byte(t)))[GetNativeByteOrder()*7]; t >>= 8;\ - tempBlock[b] = ((byte *)(Td+byte(t)))[GetNativeByteOrder()*7]; t >>= 8;\ - tempBlock[c] = ((byte *)(Td+byte(t)))[GetNativeByteOrder()*7]; t >>= 8;\ - tempBlock[d] = ((byte *)(Td+t))[GetNativeByteOrder()*7]; -#else - #define QUARTER_ROUND_LD(t, a, b, c, d) \ - tempBlock[a] = Sd[byte(t)]; t >>= 8;\ - tempBlock[b] = Sd[byte(t)]; t >>= 8;\ - tempBlock[c] = Sd[byte(t)]; t >>= 8;\ - tempBlock[d] = Sd[t]; -#endif - -#define QUARTER_ROUND_E(t, a, b, c, d) QUARTER_ROUND(TL_M, Te, t, a, b, c, d) -#define QUARTER_ROUND_D(t, a, b, c, d) QUARTER_ROUND(TL_M, Td, t, a, b, c, d) - -#ifdef IS_LITTLE_ENDIAN - #define QUARTER_ROUND_FE(t, a, b, c, d) QUARTER_ROUND(TL_F, Te, t, d, c, b, a) - #define QUARTER_ROUND_FD(t, a, b, c, d) QUARTER_ROUND(TL_F, Td, t, d, c, b, a) - #if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - #define TL_F(T, i, x) (*(word32 *)((byte *)T + x*8 + (6-i)%4+1)) - #define TL_M(T, i, x) (*(word32 *)((byte *)T + x*8 + (i+3)%4+1)) - #else - #define TL_F(T, i, x) rotrFixed(T[x], (3-i)*8) - #define TL_M(T, i, x) T[i*256 + x] - #endif -#else - #define QUARTER_ROUND_FE(t, a, b, c, d) QUARTER_ROUND(TL_F, Te, t, a, b, c, d) - #define QUARTER_ROUND_FD(t, a, b, c, d) QUARTER_ROUND(TL_F, Td, t, a, b, c, d) - #if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - #define TL_F(T, i, x) (*(word32 *)((byte *)T + x*8 + (4-i)%4)) - #define TL_M TL_F - #else - #define TL_F(T, i, x) rotrFixed(T[x], i*8) - #define TL_M(T, i, x) T[i*256 + x] - #endif -#endif - - -#define f2(x) ((x<<1)^(((x>>7)&1)*0x11b)) -#define f4(x) ((x<<2)^(((x>>6)&1)*0x11b)^(((x>>6)&2)*0x11b)) -#define f8(x) ((x<<3)^(((x>>5)&1)*0x11b)^(((x>>5)&2)*0x11b)^(((x>>5)&4)*0x11b)) - -#define f3(x) (f2(x) ^ x) -#define f9(x) (f8(x) ^ x) -#define fb(x) (f8(x) ^ f2(x) ^ x) -#define fd(x) (f8(x) ^ f4(x) ^ x) -#define fe(x) (f8(x) ^ f4(x) ^ f2(x)) - -void Rijndael::Base::FillEncTable() -{ - for (int i=0; i<256; i++) - { - byte x = Se[i]; -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - word32 y = word32(x)<<8 | word32(x)<<16 | word32(f2(x))<<24; - Te[i] = word64(y | f3(x))<<32 | y; -#else - word32 y = f3(x) | word32(x)<<8 | word32(x)<<16 | word32(f2(x))<<24; - for (int j=0; j<4; j++) - { - Te[i+j*256] = y; - y = rotrFixed(y, 8); - } -#endif - } -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) - Te[256] = Te[257] = 0; -#endif - s_TeFilled = true; -} - -void Rijndael::Base::FillDecTable() -{ - for (int i=0; i<256; i++) - { - byte x = Sd[i]; -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - word32 y = word32(fd(x))<<8 | word32(f9(x))<<16 | word32(fe(x))<<24; - Td[i] = word64(y | fb(x))<<32 | y | x; -#else - word32 y = fb(x) | word32(fd(x))<<8 | word32(f9(x))<<16 | word32(fe(x))<<24;; - for (int j=0; j<4; j++) - { - Td[i+j*256] = y; - y = rotrFixed(y, 8); - } -#endif - } - s_TdFilled = true; -} - -void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, const NameValuePairs &) -{ - AssertValidKeyLength(keylen); - - m_rounds = keylen/4 + 6; - m_key.New(4*(m_rounds+1)); - - word32 *rk = m_key; - -#if (CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && (!defined(_MSC_VER) || _MSC_VER >= 1600 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)) - // MSVC 2008 SP1 generates bad code for _mm_extract_epi32() when compiling for X64 - if (HasAESNI()) - { - static const word32 rcLE[] = { - 0x01, 0x02, 0x04, 0x08, - 0x10, 0x20, 0x40, 0x80, - 0x1B, 0x36, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ - }; - const word32 *rc = rcLE; - - __m128i temp = _mm_loadu_si128((__m128i *)(userKey+keylen-16)); - memcpy(rk, userKey, keylen); - - while (true) - { - rk[keylen/4] = rk[0] ^ _mm_extract_epi32(_mm_aeskeygenassist_si128(temp, 0), 3) ^ *(rc++); - rk[keylen/4+1] = rk[1] ^ rk[keylen/4]; - rk[keylen/4+2] = rk[2] ^ rk[keylen/4+1]; - rk[keylen/4+3] = rk[3] ^ rk[keylen/4+2]; - - if (rk + keylen/4 + 4 == m_key.end()) - break; - - if (keylen == 24) - { - rk[10] = rk[ 4] ^ rk[ 9]; - rk[11] = rk[ 5] ^ rk[10]; - temp = _mm_insert_epi32(temp, rk[11], 3); - } - else if (keylen == 32) - { - temp = _mm_insert_epi32(temp, rk[11], 3); - rk[12] = rk[ 4] ^ _mm_extract_epi32(_mm_aeskeygenassist_si128(temp, 0), 2); - rk[13] = rk[ 5] ^ rk[12]; - rk[14] = rk[ 6] ^ rk[13]; - rk[15] = rk[ 7] ^ rk[14]; - temp = _mm_insert_epi32(temp, rk[15], 3); - } - else - temp = _mm_insert_epi32(temp, rk[7], 3); - - rk += keylen/4; - } - - if (!IsForwardTransformation()) - { - rk = m_key; - unsigned int i, j; - - std::swap(*(__m128i *)(rk), *(__m128i *)(rk+4*m_rounds)); - - for (i = 4, j = 4*m_rounds-4; i < j; i += 4, j -= 4) - { - temp = _mm_aesimc_si128(*(__m128i *)(rk+i)); - *(__m128i *)(rk+i) = _mm_aesimc_si128(*(__m128i *)(rk+j)); - *(__m128i *)(rk+j) = temp; - } - - *(__m128i *)(rk+i) = _mm_aesimc_si128(*(__m128i *)(rk+i)); - } - - return; - } -#endif - - GetUserKey(BIG_ENDIAN_ORDER, rk, keylen/4, userKey, keylen); - const word32 *rc = rcon; - word32 temp; - - while (true) - { - temp = rk[keylen/4-1]; - word32 x = (word32(Se[GETBYTE(temp, 2)]) << 24) ^ (word32(Se[GETBYTE(temp, 1)]) << 16) ^ (word32(Se[GETBYTE(temp, 0)]) << 8) ^ Se[GETBYTE(temp, 3)]; - rk[keylen/4] = rk[0] ^ x ^ *(rc++); - rk[keylen/4+1] = rk[1] ^ rk[keylen/4]; - rk[keylen/4+2] = rk[2] ^ rk[keylen/4+1]; - rk[keylen/4+3] = rk[3] ^ rk[keylen/4+2]; - - if (rk + keylen/4 + 4 == m_key.end()) - break; - - if (keylen == 24) - { - rk[10] = rk[ 4] ^ rk[ 9]; - rk[11] = rk[ 5] ^ rk[10]; - } - else if (keylen == 32) - { - temp = rk[11]; - rk[12] = rk[ 4] ^ (word32(Se[GETBYTE(temp, 3)]) << 24) ^ (word32(Se[GETBYTE(temp, 2)]) << 16) ^ (word32(Se[GETBYTE(temp, 1)]) << 8) ^ Se[GETBYTE(temp, 0)]; - rk[13] = rk[ 5] ^ rk[12]; - rk[14] = rk[ 6] ^ rk[13]; - rk[15] = rk[ 7] ^ rk[14]; - } - rk += keylen/4; - } - - rk = m_key; - - if (IsForwardTransformation()) - { - if (!s_TeFilled) - FillEncTable(); - - ConditionalByteReverse(BIG_ENDIAN_ORDER, rk, rk, 16); - ConditionalByteReverse(BIG_ENDIAN_ORDER, rk + m_rounds*4, rk + m_rounds*4, 16); - } - else - { - if (!s_TdFilled) - FillDecTable(); - - unsigned int i, j; - -#define InverseMixColumn(x) TL_M(Td, 0, Se[GETBYTE(x, 3)]) ^ TL_M(Td, 1, Se[GETBYTE(x, 2)]) ^ TL_M(Td, 2, Se[GETBYTE(x, 1)]) ^ TL_M(Td, 3, Se[GETBYTE(x, 0)]) - - for (i = 4, j = 4*m_rounds-4; i < j; i += 4, j -= 4) - { - temp = InverseMixColumn(rk[i ]); rk[i ] = InverseMixColumn(rk[j ]); rk[j ] = temp; - temp = InverseMixColumn(rk[i + 1]); rk[i + 1] = InverseMixColumn(rk[j + 1]); rk[j + 1] = temp; - temp = InverseMixColumn(rk[i + 2]); rk[i + 2] = InverseMixColumn(rk[j + 2]); rk[j + 2] = temp; - temp = InverseMixColumn(rk[i + 3]); rk[i + 3] = InverseMixColumn(rk[j + 3]); rk[j + 3] = temp; - } - - rk[i+0] = InverseMixColumn(rk[i+0]); - rk[i+1] = InverseMixColumn(rk[i+1]); - rk[i+2] = InverseMixColumn(rk[i+2]); - rk[i+3] = InverseMixColumn(rk[i+3]); - - temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[0]); rk[0] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+0]); rk[4*m_rounds+0] = temp; - temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[1]); rk[1] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+1]); rk[4*m_rounds+1] = temp; - temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[2]); rk[2] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+2]); rk[4*m_rounds+2] = temp; - temp = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[3]); rk[3] = ConditionalByteReverse(BIG_ENDIAN_ORDER, rk[4*m_rounds+3]); rk[4*m_rounds+3] = temp; - } - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasAESNI()) - ConditionalByteReverse(BIG_ENDIAN_ORDER, rk+4, rk+4, (m_rounds-1)*16); -#endif -} - -void Rijndael::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) - if (HasSSE2()) -#else - if (HasAESNI()) -#endif - { - return (void)Rijndael::Enc::AdvancedProcessBlocks(inBlock, xorBlock, outBlock, 16, 0); - } -#endif - - typedef BlockGetAndPut Block; - - word32 s0, s1, s2, s3, t0, t1, t2, t3; - Block::Get(inBlock)(s0)(s1)(s2)(s3); - - const word32 *rk = m_key; - s0 ^= rk[0]; - s1 ^= rk[1]; - s2 ^= rk[2]; - s3 ^= rk[3]; - t0 = rk[4]; - t1 = rk[5]; - t2 = rk[6]; - t3 = rk[7]; - rk += 8; - - // timing attack countermeasure. see comments at top for more details - const int cacheLineSize = GetCacheLineSize(); - unsigned int i; - word32 u = 0; -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - for (i=0; i<2048; i+=cacheLineSize) -#else - for (i=0; i<1024; i+=cacheLineSize) -#endif - u &= *(const word32 *)(((const byte *)Te)+i); - u &= Te[255]; - s0 |= u; s1 |= u; s2 |= u; s3 |= u; - - QUARTER_ROUND_FE(s3, t0, t1, t2, t3) - QUARTER_ROUND_FE(s2, t3, t0, t1, t2) - QUARTER_ROUND_FE(s1, t2, t3, t0, t1) - QUARTER_ROUND_FE(s0, t1, t2, t3, t0) - - // Nr - 2 full rounds: - unsigned int r = m_rounds/2 - 1; - do - { - s0 = rk[0]; s1 = rk[1]; s2 = rk[2]; s3 = rk[3]; - - QUARTER_ROUND_E(t3, s0, s1, s2, s3) - QUARTER_ROUND_E(t2, s3, s0, s1, s2) - QUARTER_ROUND_E(t1, s2, s3, s0, s1) - QUARTER_ROUND_E(t0, s1, s2, s3, s0) - - t0 = rk[4]; t1 = rk[5]; t2 = rk[6]; t3 = rk[7]; - - QUARTER_ROUND_E(s3, t0, t1, t2, t3) - QUARTER_ROUND_E(s2, t3, t0, t1, t2) - QUARTER_ROUND_E(s1, t2, t3, t0, t1) - QUARTER_ROUND_E(s0, t1, t2, t3, t0) - - rk += 8; - } while (--r); - - word32 tbw[4]; - byte *const tempBlock = (byte *)tbw; - - QUARTER_ROUND_LE(t2, 15, 2, 5, 8) - QUARTER_ROUND_LE(t1, 11, 14, 1, 4) - QUARTER_ROUND_LE(t0, 7, 10, 13, 0) - QUARTER_ROUND_LE(t3, 3, 6, 9, 12) - - Block::Put(xorBlock, outBlock)(tbw[0]^rk[0])(tbw[1]^rk[1])(tbw[2]^rk[2])(tbw[3]^rk[3]); -} - -void Rijndael::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasAESNI()) - { - Rijndael::Dec::AdvancedProcessBlocks(inBlock, xorBlock, outBlock, 16, 0); - return; - } -#endif - - typedef BlockGetAndPut Block; - - word32 s0, s1, s2, s3, t0, t1, t2, t3; - Block::Get(inBlock)(s0)(s1)(s2)(s3); - - const word32 *rk = m_key; - s0 ^= rk[0]; - s1 ^= rk[1]; - s2 ^= rk[2]; - s3 ^= rk[3]; - t0 = rk[4]; - t1 = rk[5]; - t2 = rk[6]; - t3 = rk[7]; - rk += 8; - - // timing attack countermeasure. see comments at top for more details - const int cacheLineSize = GetCacheLineSize(); - unsigned int i; - word32 u = 0; -#if defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS) - for (i=0; i<2048; i+=cacheLineSize) -#else - for (i=0; i<1024; i+=cacheLineSize) -#endif - u &= *(const word32 *)(((const byte *)Td)+i); - u &= Td[255]; - s0 |= u; s1 |= u; s2 |= u; s3 |= u; - - QUARTER_ROUND_FD(s3, t2, t1, t0, t3) - QUARTER_ROUND_FD(s2, t1, t0, t3, t2) - QUARTER_ROUND_FD(s1, t0, t3, t2, t1) - QUARTER_ROUND_FD(s0, t3, t2, t1, t0) - - // Nr - 2 full rounds: - unsigned int r = m_rounds/2 - 1; - do - { - s0 = rk[0]; s1 = rk[1]; s2 = rk[2]; s3 = rk[3]; - - QUARTER_ROUND_D(t3, s2, s1, s0, s3) - QUARTER_ROUND_D(t2, s1, s0, s3, s2) - QUARTER_ROUND_D(t1, s0, s3, s2, s1) - QUARTER_ROUND_D(t0, s3, s2, s1, s0) - - t0 = rk[4]; t1 = rk[5]; t2 = rk[6]; t3 = rk[7]; - - QUARTER_ROUND_D(s3, t2, t1, t0, t3) - QUARTER_ROUND_D(s2, t1, t0, t3, t2) - QUARTER_ROUND_D(s1, t0, t3, t2, t1) - QUARTER_ROUND_D(s0, t3, t2, t1, t0) - - rk += 8; - } while (--r); - -#if !(defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) || defined(CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS)) - // timing attack countermeasure. see comments at top for more details - // If CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is defined, - // QUARTER_ROUND_LD will use Td, which is already preloaded. - u = 0; - for (i=0; i<256; i+=cacheLineSize) - u &= *(const word32 *)(Sd+i); - u &= *(const word32 *)(Sd+252); - t0 |= u; t1 |= u; t2 |= u; t3 |= u; -#endif - - word32 tbw[4]; - byte *const tempBlock = (byte *)tbw; - - QUARTER_ROUND_LD(t2, 7, 2, 13, 8) - QUARTER_ROUND_LD(t1, 3, 14, 9, 4) - QUARTER_ROUND_LD(t0, 15, 10, 5, 0) - QUARTER_ROUND_LD(t3, 11, 6, 1, 12) - - Block::Put(xorBlock, outBlock)(tbw[0]^rk[0])(tbw[1]^rk[1])(tbw[2]^rk[2])(tbw[3]^rk[3]); -} - -// ************************* Assembly Code ************************************ - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code -#endif - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) - -CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k) -{ - CRYPTOPP_UNUSED(locals); CRYPTOPP_UNUSED(k); - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - -#define L_REG esp -#define L_INDEX(i) (L_REG+768+i) -#define L_INXORBLOCKS L_INBLOCKS+4 -#define L_OUTXORBLOCKS L_INBLOCKS+8 -#define L_OUTBLOCKS L_INBLOCKS+12 -#define L_INCREMENTS L_INDEX(16*15) -#define L_SP L_INDEX(16*16) -#define L_LENGTH L_INDEX(16*16+4) -#define L_KEYS_BEGIN L_INDEX(16*16+8) - -#define MOVD movd -#define MM(i) mm##i - -#define MXOR(a,b,c) \ - AS2( movzx esi, b)\ - AS2( movd mm7, DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ - AS2( pxor MM(a), mm7)\ - -#define MMOV(a,b,c) \ - AS2( movzx esi, b)\ - AS2( movd MM(a), DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ - -#else - -#define L_REG r8 -#define L_INDEX(i) (L_REG+i) -#define L_INXORBLOCKS L_INBLOCKS+8 -#define L_OUTXORBLOCKS L_INBLOCKS+16 -#define L_OUTBLOCKS L_INBLOCKS+24 -#define L_INCREMENTS L_INDEX(16*16) -#define L_LENGTH L_INDEX(16*18+8) -#define L_KEYS_BEGIN L_INDEX(16*19) - -#define MOVD mov -#define MM_0 r9d -#define MM_1 r12d -#ifdef __GNUC__ -#define MM_2 r11d -#else -#define MM_2 r10d -#endif -#define MM(i) MM_##i - -#define MXOR(a,b,c) \ - AS2( movzx esi, b)\ - AS2( xor MM(a), DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ - -#define MMOV(a,b,c) \ - AS2( movzx esi, b)\ - AS2( mov MM(a), DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ - -#endif - -#define L_SUBKEYS L_INDEX(0) -#define L_SAVED_X L_SUBKEYS -#define L_KEY12 L_INDEX(16*12) -#define L_LASTROUND L_INDEX(16*13) -#define L_INBLOCKS L_INDEX(16*14) -#define MAP0TO4(i) (ASM_MOD(i+3,4)+1) - -#define XOR(a,b,c) \ - AS2( movzx esi, b)\ - AS2( xor a, DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ - -#define MOV(a,b,c) \ - AS2( movzx esi, b)\ - AS2( mov a, DWORD PTR [AS_REG_7+8*WORD_REG(si)+MAP0TO4(c)])\ - -#ifdef CRYPTOPP_GENERATE_X64_MASM - ALIGN 8 - Rijndael_Enc_AdvancedProcessBlocks PROC FRAME - rex_push_reg rsi - push_reg rdi - push_reg rbx - push_reg r12 - .endprolog - mov L_REG, rcx - mov AS_REG_7, ?Te@rdtable@CryptoPP@@3PA_KA - mov edi, DWORD PTR [?g_cacheLineSize@CryptoPP@@3IA] -#elif defined(__GNUC__) - __asm__ __volatile__ - ( - INTEL_NOPREFIX - #if CRYPTOPP_BOOL_X64 - AS2( mov L_REG, rcx) - #endif - AS_PUSH_IF86(bx) - AS_PUSH_IF86(bp) - AS2( mov AS_REG_7, WORD_REG(si)) -#else - AS_PUSH_IF86(si) - AS_PUSH_IF86(di) - AS_PUSH_IF86(bx) - AS_PUSH_IF86(bp) - AS2( lea AS_REG_7, [Te]) - AS2( mov edi, [g_cacheLineSize]) -#endif - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( mov [ecx+16*12+16*4], esp) // save esp to L_SP - AS2( lea esp, [ecx-768]) -#endif - - // copy subkeys to stack - AS2( mov WORD_REG(si), [L_KEYS_BEGIN]) - AS2( mov WORD_REG(ax), 16) - AS2( and WORD_REG(ax), WORD_REG(si)) - AS2( movdqa xmm3, XMMWORD_PTR [WORD_REG(dx)+16+WORD_REG(ax)]) // subkey 1 (non-counter) or 2 (counter) - AS2( movdqa [L_KEY12], xmm3) - AS2( lea WORD_REG(ax), [WORD_REG(dx)+WORD_REG(ax)+2*16]) - AS2( sub WORD_REG(ax), WORD_REG(si)) - ASL(0) - AS2( movdqa xmm0, [WORD_REG(ax)+WORD_REG(si)]) - AS2( movdqa XMMWORD_PTR [L_SUBKEYS+WORD_REG(si)], xmm0) - AS2( add WORD_REG(si), 16) - AS2( cmp WORD_REG(si), 16*12) - ASJ( jl, 0, b) - - // read subkeys 0, 1 and last - AS2( movdqa xmm4, [WORD_REG(ax)+WORD_REG(si)]) // last subkey - AS2( movdqa xmm1, [WORD_REG(dx)]) // subkey 0 - AS2( MOVD MM(1), [WORD_REG(dx)+4*4]) // 0,1,2,3 - AS2( mov ebx, [WORD_REG(dx)+5*4]) // 4,5,6,7 - AS2( mov ecx, [WORD_REG(dx)+6*4]) // 8,9,10,11 - AS2( mov edx, [WORD_REG(dx)+7*4]) // 12,13,14,15 - - // load table into cache - AS2( xor WORD_REG(ax), WORD_REG(ax)) - ASL(9) - AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) - AS2( add WORD_REG(ax), WORD_REG(di)) - AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) - AS2( add WORD_REG(ax), WORD_REG(di)) - AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) - AS2( add WORD_REG(ax), WORD_REG(di)) - AS2( mov esi, [AS_REG_7+WORD_REG(ax)]) - AS2( add WORD_REG(ax), WORD_REG(di)) - AS2( cmp WORD_REG(ax), 2048) - ASJ( jl, 9, b) - AS1( lfence) - - AS2( test DWORD PTR [L_LENGTH], 1) - ASJ( jz, 8, f) - - // counter mode one-time setup - AS2( mov WORD_REG(si), [L_INBLOCKS]) - AS2( movdqu xmm2, [WORD_REG(si)]) // counter - AS2( pxor xmm2, xmm1) - AS2( psrldq xmm1, 14) - AS2( movd eax, xmm1) - AS2( mov al, BYTE PTR [WORD_REG(si)+15]) - AS2( MOVD MM(2), eax) -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( mov eax, 1) - AS2( movd mm3, eax) -#endif - - // partial first round, in: xmm2(15,14,13,12;11,10,9,8;7,6,5,4;3,2,1,0), out: mm1, ebx, ecx, edx - AS2( movd eax, xmm2) - AS2( psrldq xmm2, 4) - AS2( movd edi, xmm2) - AS2( psrldq xmm2, 4) - MXOR( 1, al, 0) // 0 - XOR( edx, ah, 1) // 1 - AS2( shr eax, 16) - XOR( ecx, al, 2) // 2 - XOR( ebx, ah, 3) // 3 - AS2( mov eax, edi) - AS2( movd edi, xmm2) - AS2( psrldq xmm2, 4) - XOR( ebx, al, 0) // 4 - MXOR( 1, ah, 1) // 5 - AS2( shr eax, 16) - XOR( edx, al, 2) // 6 - XOR( ecx, ah, 3) // 7 - AS2( mov eax, edi) - AS2( movd edi, xmm2) - XOR( ecx, al, 0) // 8 - XOR( ebx, ah, 1) // 9 - AS2( shr eax, 16) - MXOR( 1, al, 2) // 10 - XOR( edx, ah, 3) // 11 - AS2( mov eax, edi) - XOR( edx, al, 0) // 12 - XOR( ecx, ah, 1) // 13 - AS2( shr eax, 16) - XOR( ebx, al, 2) // 14 - AS2( psrldq xmm2, 3) - - // partial second round, in: ebx(4,5,6,7), ecx(8,9,10,11), edx(12,13,14,15), out: eax, ebx, edi, mm0 - AS2( mov eax, [L_KEY12+0*4]) - AS2( mov edi, [L_KEY12+2*4]) - AS2( MOVD MM(0), [L_KEY12+3*4]) - MXOR( 0, cl, 3) /* 11 */ - XOR( edi, bl, 3) /* 7 */ - MXOR( 0, bh, 2) /* 6 */ - AS2( shr ebx, 16) /* 4,5 */ - XOR( eax, bl, 1) /* 5 */ - MOV( ebx, bh, 0) /* 4 */ - AS2( xor ebx, [L_KEY12+1*4]) - XOR( eax, ch, 2) /* 10 */ - AS2( shr ecx, 16) /* 8,9 */ - XOR( eax, dl, 3) /* 15 */ - XOR( ebx, dh, 2) /* 14 */ - AS2( shr edx, 16) /* 12,13 */ - XOR( edi, ch, 0) /* 8 */ - XOR( ebx, cl, 1) /* 9 */ - XOR( edi, dl, 1) /* 13 */ - MXOR( 0, dh, 0) /* 12 */ - - AS2( movd ecx, xmm2) - AS2( MOVD edx, MM(1)) - AS2( MOVD [L_SAVED_X+3*4], MM(0)) - AS2( mov [L_SAVED_X+0*4], eax) - AS2( mov [L_SAVED_X+1*4], ebx) - AS2( mov [L_SAVED_X+2*4], edi) - ASJ( jmp, 5, f) - - ASL(3) - // non-counter mode per-block setup - AS2( MOVD MM(1), [L_KEY12+0*4]) // 0,1,2,3 - AS2( mov ebx, [L_KEY12+1*4]) // 4,5,6,7 - AS2( mov ecx, [L_KEY12+2*4]) // 8,9,10,11 - AS2( mov edx, [L_KEY12+3*4]) // 12,13,14,15 - ASL(8) - AS2( mov WORD_REG(ax), [L_INBLOCKS]) - AS2( movdqu xmm2, [WORD_REG(ax)]) - AS2( mov WORD_REG(si), [L_INXORBLOCKS]) - AS2( movdqu xmm5, [WORD_REG(si)]) - AS2( pxor xmm2, xmm1) - AS2( pxor xmm2, xmm5) - - // first round, in: xmm2(15,14,13,12;11,10,9,8;7,6,5,4;3,2,1,0), out: eax, ebx, ecx, edx - AS2( movd eax, xmm2) - AS2( psrldq xmm2, 4) - AS2( movd edi, xmm2) - AS2( psrldq xmm2, 4) - MXOR( 1, al, 0) // 0 - XOR( edx, ah, 1) // 1 - AS2( shr eax, 16) - XOR( ecx, al, 2) // 2 - XOR( ebx, ah, 3) // 3 - AS2( mov eax, edi) - AS2( movd edi, xmm2) - AS2( psrldq xmm2, 4) - XOR( ebx, al, 0) // 4 - MXOR( 1, ah, 1) // 5 - AS2( shr eax, 16) - XOR( edx, al, 2) // 6 - XOR( ecx, ah, 3) // 7 - AS2( mov eax, edi) - AS2( movd edi, xmm2) - XOR( ecx, al, 0) // 8 - XOR( ebx, ah, 1) // 9 - AS2( shr eax, 16) - MXOR( 1, al, 2) // 10 - XOR( edx, ah, 3) // 11 - AS2( mov eax, edi) - XOR( edx, al, 0) // 12 - XOR( ecx, ah, 1) // 13 - AS2( shr eax, 16) - XOR( ebx, al, 2) // 14 - MXOR( 1, ah, 3) // 15 - AS2( MOVD eax, MM(1)) - - AS2( add L_REG, [L_KEYS_BEGIN]) - AS2( add L_REG, 4*16) - ASJ( jmp, 2, f) - - ASL(1) - // counter-mode per-block setup - AS2( MOVD ecx, MM(2)) - AS2( MOVD edx, MM(1)) - AS2( mov eax, [L_SAVED_X+0*4]) - AS2( mov ebx, [L_SAVED_X+1*4]) - AS2( xor cl, ch) - AS2( and WORD_REG(cx), 255) - ASL(5) -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( paddb MM(2), mm3) -#else - AS2( add MM(2), 1) -#endif - // remaining part of second round, in: edx(previous round),esi(keyed counter byte) eax,ebx,[L_SAVED_X+2*4],[L_SAVED_X+3*4], out: eax,ebx,ecx,edx - AS2( xor edx, DWORD PTR [AS_REG_7+WORD_REG(cx)*8+3]) - XOR( ebx, dl, 3) - MOV( ecx, dh, 2) - AS2( shr edx, 16) - AS2( xor ecx, [L_SAVED_X+2*4]) - XOR( eax, dh, 0) - MOV( edx, dl, 1) - AS2( xor edx, [L_SAVED_X+3*4]) - - AS2( add L_REG, [L_KEYS_BEGIN]) - AS2( add L_REG, 3*16) - ASJ( jmp, 4, f) - -// in: eax(0,1,2,3), ebx(4,5,6,7), ecx(8,9,10,11), edx(12,13,14,15) -// out: eax, ebx, edi, mm0 -#define ROUND() \ - MXOR( 0, cl, 3) /* 11 */\ - AS2( mov cl, al) /* 8,9,10,3 */\ - XOR( edi, ah, 2) /* 2 */\ - AS2( shr eax, 16) /* 0,1 */\ - XOR( edi, bl, 3) /* 7 */\ - MXOR( 0, bh, 2) /* 6 */\ - AS2( shr ebx, 16) /* 4,5 */\ - MXOR( 0, al, 1) /* 1 */\ - MOV( eax, ah, 0) /* 0 */\ - XOR( eax, bl, 1) /* 5 */\ - MOV( ebx, bh, 0) /* 4 */\ - XOR( eax, ch, 2) /* 10 */\ - XOR( ebx, cl, 3) /* 3 */\ - AS2( shr ecx, 16) /* 8,9 */\ - XOR( eax, dl, 3) /* 15 */\ - XOR( ebx, dh, 2) /* 14 */\ - AS2( shr edx, 16) /* 12,13 */\ - XOR( edi, ch, 0) /* 8 */\ - XOR( ebx, cl, 1) /* 9 */\ - XOR( edi, dl, 1) /* 13 */\ - MXOR( 0, dh, 0) /* 12 */\ - - ASL(2) // 2-round loop - AS2( MOVD MM(0), [L_SUBKEYS-4*16+3*4]) - AS2( mov edi, [L_SUBKEYS-4*16+2*4]) - ROUND() - AS2( mov ecx, edi) - AS2( xor eax, [L_SUBKEYS-4*16+0*4]) - AS2( xor ebx, [L_SUBKEYS-4*16+1*4]) - AS2( MOVD edx, MM(0)) - - ASL(4) - AS2( MOVD MM(0), [L_SUBKEYS-4*16+7*4]) - AS2( mov edi, [L_SUBKEYS-4*16+6*4]) - ROUND() - AS2( mov ecx, edi) - AS2( xor eax, [L_SUBKEYS-4*16+4*4]) - AS2( xor ebx, [L_SUBKEYS-4*16+5*4]) - AS2( MOVD edx, MM(0)) - - AS2( add L_REG, 32) - AS2( test L_REG, 255) - ASJ( jnz, 2, b) - AS2( sub L_REG, 16*16) - -#define LAST(a, b, c) \ - AS2( movzx esi, a )\ - AS2( movzx edi, BYTE PTR [AS_REG_7+WORD_REG(si)*8+1] )\ - AS2( movzx esi, b )\ - AS2( xor edi, DWORD PTR [AS_REG_7+WORD_REG(si)*8+0] )\ - AS2( mov WORD PTR [L_LASTROUND+c], di )\ - - // last round - LAST(ch, dl, 2) - LAST(dh, al, 6) - AS2( shr edx, 16) - LAST(ah, bl, 10) - AS2( shr eax, 16) - LAST(bh, cl, 14) - AS2( shr ebx, 16) - LAST(dh, al, 12) - AS2( shr ecx, 16) - LAST(ah, bl, 0) - LAST(bh, cl, 4) - LAST(ch, dl, 8) - - AS2( mov WORD_REG(ax), [L_OUTXORBLOCKS]) - AS2( mov WORD_REG(bx), [L_OUTBLOCKS]) - - AS2( mov WORD_REG(cx), [L_LENGTH]) - AS2( sub WORD_REG(cx), 16) - - AS2( movdqu xmm2, [WORD_REG(ax)]) - AS2( pxor xmm2, xmm4) - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( movdqa xmm0, [L_INCREMENTS]) - AS2( paddd xmm0, [L_INBLOCKS]) - AS2( movdqa [L_INBLOCKS], xmm0) -#else - AS2( movdqa xmm0, [L_INCREMENTS+16]) - AS2( paddq xmm0, [L_INBLOCKS+16]) - AS2( movdqa [L_INBLOCKS+16], xmm0) -#endif - - AS2( pxor xmm2, [L_LASTROUND]) - AS2( movdqu [WORD_REG(bx)], xmm2) - - ASJ( jle, 7, f) - AS2( mov [L_LENGTH], WORD_REG(cx)) - AS2( test WORD_REG(cx), 1) - ASJ( jnz, 1, b) -#if CRYPTOPP_BOOL_X64 - AS2( movdqa xmm0, [L_INCREMENTS]) - AS2( paddq xmm0, [L_INBLOCKS]) - AS2( movdqa [L_INBLOCKS], xmm0) -#endif - ASJ( jmp, 3, b) - - ASL(7) - // erase keys on stack - AS2( xorps xmm0, xmm0) - AS2( lea WORD_REG(ax), [L_SUBKEYS+7*16]) - AS2( movaps [WORD_REG(ax)-7*16], xmm0) - AS2( movaps [WORD_REG(ax)-6*16], xmm0) - AS2( movaps [WORD_REG(ax)-5*16], xmm0) - AS2( movaps [WORD_REG(ax)-4*16], xmm0) - AS2( movaps [WORD_REG(ax)-3*16], xmm0) - AS2( movaps [WORD_REG(ax)-2*16], xmm0) - AS2( movaps [WORD_REG(ax)-1*16], xmm0) - AS2( movaps [WORD_REG(ax)+0*16], xmm0) - AS2( movaps [WORD_REG(ax)+1*16], xmm0) - AS2( movaps [WORD_REG(ax)+2*16], xmm0) - AS2( movaps [WORD_REG(ax)+3*16], xmm0) - AS2( movaps [WORD_REG(ax)+4*16], xmm0) - AS2( movaps [WORD_REG(ax)+5*16], xmm0) - AS2( movaps [WORD_REG(ax)+6*16], xmm0) -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( mov esp, [L_SP]) - AS1( emms) -#endif - AS_POP_IF86(bp) - AS_POP_IF86(bx) -#if defined(_MSC_VER) && CRYPTOPP_BOOL_X86 - AS_POP_IF86(di) - AS_POP_IF86(si) - AS1(ret) -#endif -#ifdef CRYPTOPP_GENERATE_X64_MASM - pop r12 - pop rbx - pop rdi - pop rsi - ret - Rijndael_Enc_AdvancedProcessBlocks ENDP -#endif -#ifdef __GNUC__ - ATT_PREFIX - : - : "c" (locals), "d" (k), "S" (Te), "D" (g_cacheLineSize) - : "memory", "cc", "%eax" - #if CRYPTOPP_BOOL_X64 - , "%rbx", "%r8", "%r9", "%r10", "%r11", "%r12" - #endif - ); -#endif -} - -#endif - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -void Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k); -} -#endif - -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 - -static inline bool AliasedWithTable(const byte *begin, const byte *end) -{ - size_t s0 = size_t(begin)%4096, s1 = size_t(end)%4096; - size_t t0 = size_t(Te)%4096, t1 = (size_t(Te)+sizeof(Te))%4096; - if (t1 > t0) - return (s0 >= t0 && s0 < t1) || (s1 > t0 && s1 <= t1); - else - return (s0 < t1 || s1 <= t1) || (s0 >= t0 || s1 > t0); -} - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - -inline void AESNI_Enc_Block(__m128i &block, const __m128i *subkeys, unsigned int rounds) -{ - block = _mm_xor_si128(block, subkeys[0]); - for (unsigned int i=1; i -inline size_t AESNI_AdvancedProcessBlocks(F1 func1, F4 func4, const __m128i *subkeys, unsigned int rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) -{ - size_t blockSize = 16; - size_t inIncrement = (flags & (BlockTransformation::BT_InBlockIsCounter|BlockTransformation::BT_DontIncrementInOutPointers)) ? 0 : blockSize; - size_t xorIncrement = xorBlocks ? blockSize : 0; - size_t outIncrement = (flags & BlockTransformation::BT_DontIncrementInOutPointers) ? 0 : blockSize; - - if (flags & BlockTransformation::BT_ReverseDirection) - { - assert(length % blockSize == 0); - inBlocks += length - blockSize; - xorBlocks += length - blockSize; - outBlocks += length - blockSize; - inIncrement = 0-inIncrement; - xorIncrement = 0-xorIncrement; - outIncrement = 0-outIncrement; - } - - if (flags & BlockTransformation::BT_AllowParallel) - { - while (length >= 4*blockSize) - { - __m128i block0 = _mm_loadu_si128((const __m128i *)inBlocks), block1, block2, block3; - if (flags & BlockTransformation::BT_InBlockIsCounter) - { - const __m128i be1 = *(const __m128i *)s_one; - block1 = _mm_add_epi32(block0, be1); - block2 = _mm_add_epi32(block1, be1); - block3 = _mm_add_epi32(block2, be1); - _mm_storeu_si128((__m128i *)inBlocks, _mm_add_epi32(block3, be1)); - } - else - { - inBlocks += inIncrement; - block1 = _mm_loadu_si128((const __m128i *)inBlocks); - inBlocks += inIncrement; - block2 = _mm_loadu_si128((const __m128i *)inBlocks); - inBlocks += inIncrement; - block3 = _mm_loadu_si128((const __m128i *)inBlocks); - inBlocks += inIncrement; - } - - if (flags & BlockTransformation::BT_XorInput) - { - block0 = _mm_xor_si128(block0, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - block1 = _mm_xor_si128(block1, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - block2 = _mm_xor_si128(block2, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - block3 = _mm_xor_si128(block3, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - } - - func4(block0, block1, block2, block3, subkeys, rounds); - - if (xorBlocks && !(flags & BlockTransformation::BT_XorInput)) - { - block0 = _mm_xor_si128(block0, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - block1 = _mm_xor_si128(block1, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - block2 = _mm_xor_si128(block2, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - block3 = _mm_xor_si128(block3, _mm_loadu_si128((const __m128i *)xorBlocks)); - xorBlocks += xorIncrement; - } - - _mm_storeu_si128((__m128i *)outBlocks, block0); - outBlocks += outIncrement; - _mm_storeu_si128((__m128i *)outBlocks, block1); - outBlocks += outIncrement; - _mm_storeu_si128((__m128i *)outBlocks, block2); - outBlocks += outIncrement; - _mm_storeu_si128((__m128i *)outBlocks, block3); - outBlocks += outIncrement; - - length -= 4*blockSize; - } - } - - while (length >= blockSize) - { - __m128i block = _mm_loadu_si128((const __m128i *)inBlocks); - - if (flags & BlockTransformation::BT_XorInput) - block = _mm_xor_si128(block, _mm_loadu_si128((const __m128i *)xorBlocks)); - - if (flags & BlockTransformation::BT_InBlockIsCounter) - const_cast(inBlocks)[15]++; - - func1(block, subkeys, rounds); - - if (xorBlocks && !(flags & BlockTransformation::BT_XorInput)) - block = _mm_xor_si128(block, _mm_loadu_si128((const __m128i *)xorBlocks)); - - _mm_storeu_si128((__m128i *)outBlocks, block); - - inBlocks += inIncrement; - outBlocks += outIncrement; - xorBlocks += xorIncrement; - length -= blockSize; - } - - return length; -} -#endif - -size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const -{ -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - if (HasAESNI()) - return AESNI_AdvancedProcessBlocks(AESNI_Enc_Block, AESNI_Enc_4_Blocks, (const __m128i *)m_key.begin(), m_rounds, inBlocks, xorBlocks, outBlocks, length, flags); -#endif - -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) - if (HasSSE2()) - { - if (length < BLOCKSIZE) - return length; - - struct Locals - { - word32 subkeys[4*12], workspace[8]; - const byte *inBlocks, *inXorBlocks, *outXorBlocks; - byte *outBlocks; - size_t inIncrement, inXorIncrement, outXorIncrement, outIncrement; - size_t regSpill, lengthAndCounterFlag, keysBegin; - }; - - size_t increment = BLOCKSIZE; - const byte* zeros = (byte *)(Te+256); - byte *space; - - do { - // https://msdn.microsoft.com/en-us/library/5471dc8s.aspx -#if (CRYPTOPP_MSC_VERION >= 1400) - space = (byte *)_malloca(255+sizeof(Locals)); - space += (256-(size_t)space%256)%256; -#else - space = (byte *)alloca(255+sizeof(Locals)); - space += (256-(size_t)space%256)%256; -#endif - } - while (AliasedWithTable(space, space+sizeof(Locals))); - - if (flags & BT_ReverseDirection) - { - assert(length % BLOCKSIZE == 0); - inBlocks += length - BLOCKSIZE; - xorBlocks += length - BLOCKSIZE; - outBlocks += length - BLOCKSIZE; - increment = 0-increment; - } - - Locals &locals = *(Locals *)space; - - locals.inBlocks = inBlocks; - locals.inXorBlocks = (flags & BT_XorInput) && xorBlocks ? xorBlocks : zeros; - locals.outXorBlocks = (flags & BT_XorInput) || !xorBlocks ? zeros : xorBlocks; - locals.outBlocks = outBlocks; - - locals.inIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : increment; - locals.inXorIncrement = (flags & BT_XorInput) && xorBlocks ? increment : 0; - locals.outXorIncrement = (flags & BT_XorInput) || !xorBlocks ? 0 : increment; - locals.outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : increment; - - locals.lengthAndCounterFlag = length - (length%16) - bool(flags & BT_InBlockIsCounter); - int keysToCopy = m_rounds - (flags & BT_InBlockIsCounter ? 3 : 2); - locals.keysBegin = (12-keysToCopy)*16; - - Rijndael_Enc_AdvancedProcessBlocks(&locals, m_key); - return length % BLOCKSIZE; - } -#endif - - return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags); -} - -#endif - -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - -size_t Rijndael::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const -{ - if (HasAESNI()) - return AESNI_AdvancedProcessBlocks(AESNI_Dec_Block, AESNI_Dec_4_Blocks, (const __m128i *)m_key.begin(), m_rounds, inBlocks, xorBlocks, outBlocks, length, flags); - - return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags); -} - -#endif // #if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - -NAMESPACE_END - -#endif -#endif diff --git a/external/crypto++-5.6.3/rijndael.h b/external/crypto++-5.6.3/rijndael.h deleted file mode 100644 index 2afa93092..000000000 --- a/external/crypto++-5.6.3/rijndael.h +++ /dev/null @@ -1,83 +0,0 @@ -// rijndael.h - written and placed in the public domain by Wei Dai - -//! \file rijndael.h -//! \brief Classes for Rijndael encryption algorithm -//! \details All key sizes are supported. The library only provides Rijndael with 128-bit blocks, -//! and not 192-bit or 256-bit blocks - -#ifndef CRYPTOPP_RIJNDAEL_H -#define CRYPTOPP_RIJNDAEL_H - -#include "seckey.h" -#include "secblock.h" - -#if CRYPTOPP_BOOL_X32 -# define CRYPTOPP_DISABLE_RIJNDAEL_ASM -#endif - -NAMESPACE_BEGIN(CryptoPP) - -//! \brief Rijndael block cipher information -struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8> -{ - CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return CRYPTOPP_RIJNDAEL_NAME;} -}; - -//! \brief Rijndael block cipher implementation details -//! \sa Rijndael -class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentation -{ - //! \brief Rijndael block cipher data processing functionss - //! \details Provides implementation common to encryption and decryption - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - static void FillEncTable(); - static void FillDecTable(); - - // VS2005 workaround: have to put these on separate lines, or error C2487 is triggered in DLL build - static const byte Se[256]; - static const byte Sd[256]; - - static const word32 rcon[]; - - unsigned int m_rounds; - FixedSizeAlignedSecBlock m_key; - }; - - //! \brief Rijndael block cipher data processing functions - //! \details Provides implementation for encryption transformation - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; -#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 - size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const; -#endif - }; - - //! \brief Rijndael block cipher data processing functions - //! \details Provides implementation for decryption transformation - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; -#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE - size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const; -#endif - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef Rijndael::Encryption RijndaelEncryption; -typedef Rijndael::Decryption RijndaelDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ripemd.cpp b/external/crypto++-5.6.3/ripemd.cpp deleted file mode 100644 index 3476aa8b5..000000000 --- a/external/crypto++-5.6.3/ripemd.cpp +++ /dev/null @@ -1,803 +0,0 @@ -// ripemd.cpp -// RIPEMD-160 written and placed in the public domain by Wei Dai -// RIPEMD-320, RIPEMD-128, RIPEMD-256 written by Kevin Springle -// and also placed in the public domain - -#include "pch.h" -#include "ripemd.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -#define F(x, y, z) (x ^ y ^ z) -#define G(x, y, z) (z ^ (x & (y^z))) -#define H(x, y, z) (z ^ (x | ~y)) -#define I(x, y, z) (y ^ (z & (x^y))) -#define J(x, y, z) (x ^ (y | ~z)) - -#define k0 0 -#define k1 0x5a827999UL -#define k2 0x6ed9eba1UL -#define k3 0x8f1bbcdcUL -#define k4 0xa953fd4eUL -#define k5 0x50a28be6UL -#define k6 0x5c4dd124UL -#define k7 0x6d703ef3UL -#define k8 0x7a6d76e9UL -#define k9 0 - -// ************************************************************* - -// for 160 and 320 -#define Subround(f, a, b, c, d, e, x, s, k) \ - a += f(b, c, d) + x + k;\ - a = rotlFixed((word32)a, s) + e;\ - c = rotlFixed((word32)c, 10U) - -void RIPEMD160::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xefcdab89L; - state[2] = 0x98badcfeL; - state[3] = 0x10325476L; - state[4] = 0xc3d2e1f0L; -} - -void RIPEMD160::Transform (word32 *digest, const word32 *X) -{ - unsigned long a1, b1, c1, d1, e1, a2, b2, c2, d2, e2; - a1 = a2 = digest[0]; - b1 = b2 = digest[1]; - c1 = c2 = digest[2]; - d1 = d2 = digest[3]; - e1 = e2 = digest[4]; - - Subround(F, a1, b1, c1, d1, e1, X[ 0], 11, k0); - Subround(F, e1, a1, b1, c1, d1, X[ 1], 14, k0); - Subround(F, d1, e1, a1, b1, c1, X[ 2], 15, k0); - Subround(F, c1, d1, e1, a1, b1, X[ 3], 12, k0); - Subround(F, b1, c1, d1, e1, a1, X[ 4], 5, k0); - Subround(F, a1, b1, c1, d1, e1, X[ 5], 8, k0); - Subround(F, e1, a1, b1, c1, d1, X[ 6], 7, k0); - Subround(F, d1, e1, a1, b1, c1, X[ 7], 9, k0); - Subround(F, c1, d1, e1, a1, b1, X[ 8], 11, k0); - Subround(F, b1, c1, d1, e1, a1, X[ 9], 13, k0); - Subround(F, a1, b1, c1, d1, e1, X[10], 14, k0); - Subround(F, e1, a1, b1, c1, d1, X[11], 15, k0); - Subround(F, d1, e1, a1, b1, c1, X[12], 6, k0); - Subround(F, c1, d1, e1, a1, b1, X[13], 7, k0); - Subround(F, b1, c1, d1, e1, a1, X[14], 9, k0); - Subround(F, a1, b1, c1, d1, e1, X[15], 8, k0); - - Subround(G, e1, a1, b1, c1, d1, X[ 7], 7, k1); - Subround(G, d1, e1, a1, b1, c1, X[ 4], 6, k1); - Subround(G, c1, d1, e1, a1, b1, X[13], 8, k1); - Subround(G, b1, c1, d1, e1, a1, X[ 1], 13, k1); - Subround(G, a1, b1, c1, d1, e1, X[10], 11, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 6], 9, k1); - Subround(G, d1, e1, a1, b1, c1, X[15], 7, k1); - Subround(G, c1, d1, e1, a1, b1, X[ 3], 15, k1); - Subround(G, b1, c1, d1, e1, a1, X[12], 7, k1); - Subround(G, a1, b1, c1, d1, e1, X[ 0], 12, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 9], 15, k1); - Subround(G, d1, e1, a1, b1, c1, X[ 5], 9, k1); - Subround(G, c1, d1, e1, a1, b1, X[ 2], 11, k1); - Subround(G, b1, c1, d1, e1, a1, X[14], 7, k1); - Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1); - - Subround(H, d1, e1, a1, b1, c1, X[ 3], 11, k2); - Subround(H, c1, d1, e1, a1, b1, X[10], 13, k2); - Subround(H, b1, c1, d1, e1, a1, X[14], 6, k2); - Subround(H, a1, b1, c1, d1, e1, X[ 4], 7, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 9], 14, k2); - Subround(H, d1, e1, a1, b1, c1, X[15], 9, k2); - Subround(H, c1, d1, e1, a1, b1, X[ 8], 13, k2); - Subround(H, b1, c1, d1, e1, a1, X[ 1], 15, k2); - Subround(H, a1, b1, c1, d1, e1, X[ 2], 14, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 7], 8, k2); - Subround(H, d1, e1, a1, b1, c1, X[ 0], 13, k2); - Subround(H, c1, d1, e1, a1, b1, X[ 6], 6, k2); - Subround(H, b1, c1, d1, e1, a1, X[13], 5, k2); - Subround(H, a1, b1, c1, d1, e1, X[11], 12, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 5], 7, k2); - Subround(H, d1, e1, a1, b1, c1, X[12], 5, k2); - - Subround(I, c1, d1, e1, a1, b1, X[ 1], 11, k3); - Subround(I, b1, c1, d1, e1, a1, X[ 9], 12, k3); - Subround(I, a1, b1, c1, d1, e1, X[11], 14, k3); - Subround(I, e1, a1, b1, c1, d1, X[10], 15, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 0], 14, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 8], 15, k3); - Subround(I, b1, c1, d1, e1, a1, X[12], 9, k3); - Subround(I, a1, b1, c1, d1, e1, X[ 4], 8, k3); - Subround(I, e1, a1, b1, c1, d1, X[13], 9, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 3], 14, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 7], 5, k3); - Subround(I, b1, c1, d1, e1, a1, X[15], 6, k3); - Subround(I, a1, b1, c1, d1, e1, X[14], 8, k3); - Subround(I, e1, a1, b1, c1, d1, X[ 5], 6, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 6], 5, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 2], 12, k3); - - Subround(J, b1, c1, d1, e1, a1, X[ 4], 9, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 0], 15, k4); - Subround(J, e1, a1, b1, c1, d1, X[ 5], 5, k4); - Subround(J, d1, e1, a1, b1, c1, X[ 9], 11, k4); - Subround(J, c1, d1, e1, a1, b1, X[ 7], 6, k4); - Subround(J, b1, c1, d1, e1, a1, X[12], 8, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 2], 13, k4); - Subround(J, e1, a1, b1, c1, d1, X[10], 12, k4); - Subround(J, d1, e1, a1, b1, c1, X[14], 5, k4); - Subround(J, c1, d1, e1, a1, b1, X[ 1], 12, k4); - Subround(J, b1, c1, d1, e1, a1, X[ 3], 13, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 8], 14, k4); - Subround(J, e1, a1, b1, c1, d1, X[11], 11, k4); - Subround(J, d1, e1, a1, b1, c1, X[ 6], 8, k4); - Subround(J, c1, d1, e1, a1, b1, X[15], 5, k4); - Subround(J, b1, c1, d1, e1, a1, X[13], 6, k4); - - Subround(J, a2, b2, c2, d2, e2, X[ 5], 8, k5); - Subround(J, e2, a2, b2, c2, d2, X[14], 9, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 7], 9, k5); - Subround(J, c2, d2, e2, a2, b2, X[ 0], 11, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 9], 13, k5); - Subround(J, a2, b2, c2, d2, e2, X[ 2], 15, k5); - Subround(J, e2, a2, b2, c2, d2, X[11], 15, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 4], 5, k5); - Subround(J, c2, d2, e2, a2, b2, X[13], 7, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 6], 7, k5); - Subround(J, a2, b2, c2, d2, e2, X[15], 8, k5); - Subround(J, e2, a2, b2, c2, d2, X[ 8], 11, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 1], 14, k5); - Subround(J, c2, d2, e2, a2, b2, X[10], 14, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5); - Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5); - - Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6); - Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6); - Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6); - Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6); - Subround(I, a2, b2, c2, d2, e2, X[ 0], 12, k6); - Subround(I, e2, a2, b2, c2, d2, X[13], 8, k6); - Subround(I, d2, e2, a2, b2, c2, X[ 5], 9, k6); - Subround(I, c2, d2, e2, a2, b2, X[10], 11, k6); - Subround(I, b2, c2, d2, e2, a2, X[14], 7, k6); - Subround(I, a2, b2, c2, d2, e2, X[15], 7, k6); - Subround(I, e2, a2, b2, c2, d2, X[ 8], 12, k6); - Subround(I, d2, e2, a2, b2, c2, X[12], 7, k6); - Subround(I, c2, d2, e2, a2, b2, X[ 4], 6, k6); - Subround(I, b2, c2, d2, e2, a2, X[ 9], 15, k6); - Subround(I, a2, b2, c2, d2, e2, X[ 1], 13, k6); - Subround(I, e2, a2, b2, c2, d2, X[ 2], 11, k6); - - Subround(H, d2, e2, a2, b2, c2, X[15], 9, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 5], 7, k7); - Subround(H, b2, c2, d2, e2, a2, X[ 1], 15, k7); - Subround(H, a2, b2, c2, d2, e2, X[ 3], 11, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 7], 8, k7); - Subround(H, d2, e2, a2, b2, c2, X[14], 6, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 6], 6, k7); - Subround(H, b2, c2, d2, e2, a2, X[ 9], 14, k7); - Subround(H, a2, b2, c2, d2, e2, X[11], 12, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 8], 13, k7); - Subround(H, d2, e2, a2, b2, c2, X[12], 5, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 2], 14, k7); - Subround(H, b2, c2, d2, e2, a2, X[10], 13, k7); - Subround(H, a2, b2, c2, d2, e2, X[ 0], 13, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 4], 7, k7); - Subround(H, d2, e2, a2, b2, c2, X[13], 5, k7); - - Subround(G, c2, d2, e2, a2, b2, X[ 8], 15, k8); - Subround(G, b2, c2, d2, e2, a2, X[ 6], 5, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 4], 8, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 1], 11, k8); - Subround(G, d2, e2, a2, b2, c2, X[ 3], 14, k8); - Subround(G, c2, d2, e2, a2, b2, X[11], 14, k8); - Subround(G, b2, c2, d2, e2, a2, X[15], 6, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 0], 14, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 5], 6, k8); - Subround(G, d2, e2, a2, b2, c2, X[12], 9, k8); - Subround(G, c2, d2, e2, a2, b2, X[ 2], 12, k8); - Subround(G, b2, c2, d2, e2, a2, X[13], 9, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 9], 12, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 7], 5, k8); - Subround(G, d2, e2, a2, b2, c2, X[10], 15, k8); - Subround(G, c2, d2, e2, a2, b2, X[14], 8, k8); - - Subround(F, b2, c2, d2, e2, a2, X[12], 8, k9); - Subround(F, a2, b2, c2, d2, e2, X[15], 5, k9); - Subround(F, e2, a2, b2, c2, d2, X[10], 12, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 4], 9, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 1], 12, k9); - Subround(F, b2, c2, d2, e2, a2, X[ 5], 5, k9); - Subround(F, a2, b2, c2, d2, e2, X[ 8], 14, k9); - Subround(F, e2, a2, b2, c2, d2, X[ 7], 6, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 6], 8, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 2], 13, k9); - Subround(F, b2, c2, d2, e2, a2, X[13], 6, k9); - Subround(F, a2, b2, c2, d2, e2, X[14], 5, k9); - Subround(F, e2, a2, b2, c2, d2, X[ 0], 15, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 3], 13, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 9], 11, k9); - Subround(F, b2, c2, d2, e2, a2, X[11], 11, k9); - - c1 = digest[1] + c1 + d2; - digest[1] = digest[2] + d1 + e2; - digest[2] = digest[3] + e1 + a2; - digest[3] = digest[4] + a1 + b2; - digest[4] = digest[0] + b1 + c2; - digest[0] = c1; -} - -// ************************************************************* - -void RIPEMD320::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xefcdab89L; - state[2] = 0x98badcfeL; - state[3] = 0x10325476L; - state[4] = 0xc3d2e1f0L; - state[5] = 0x76543210L; - state[6] = 0xfedcba98L; - state[7] = 0x89abcdefL; - state[8] = 0x01234567L; - state[9] = 0x3c2d1e0fL; -} - -void RIPEMD320::Transform (word32 *digest, const word32 *X) -{ - unsigned long a1, b1, c1, d1, e1, a2, b2, c2, d2, e2, t; - a1 = digest[0]; - b1 = digest[1]; - c1 = digest[2]; - d1 = digest[3]; - e1 = digest[4]; - a2 = digest[5]; - b2 = digest[6]; - c2 = digest[7]; - d2 = digest[8]; - e2 = digest[9]; - - Subround(F, a1, b1, c1, d1, e1, X[ 0], 11, k0); - Subround(F, e1, a1, b1, c1, d1, X[ 1], 14, k0); - Subround(F, d1, e1, a1, b1, c1, X[ 2], 15, k0); - Subround(F, c1, d1, e1, a1, b1, X[ 3], 12, k0); - Subround(F, b1, c1, d1, e1, a1, X[ 4], 5, k0); - Subround(F, a1, b1, c1, d1, e1, X[ 5], 8, k0); - Subround(F, e1, a1, b1, c1, d1, X[ 6], 7, k0); - Subround(F, d1, e1, a1, b1, c1, X[ 7], 9, k0); - Subround(F, c1, d1, e1, a1, b1, X[ 8], 11, k0); - Subround(F, b1, c1, d1, e1, a1, X[ 9], 13, k0); - Subround(F, a1, b1, c1, d1, e1, X[10], 14, k0); - Subround(F, e1, a1, b1, c1, d1, X[11], 15, k0); - Subround(F, d1, e1, a1, b1, c1, X[12], 6, k0); - Subround(F, c1, d1, e1, a1, b1, X[13], 7, k0); - Subround(F, b1, c1, d1, e1, a1, X[14], 9, k0); - Subround(F, a1, b1, c1, d1, e1, X[15], 8, k0); - - Subround(J, a2, b2, c2, d2, e2, X[ 5], 8, k5); - Subround(J, e2, a2, b2, c2, d2, X[14], 9, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 7], 9, k5); - Subround(J, c2, d2, e2, a2, b2, X[ 0], 11, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 9], 13, k5); - Subround(J, a2, b2, c2, d2, e2, X[ 2], 15, k5); - Subround(J, e2, a2, b2, c2, d2, X[11], 15, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 4], 5, k5); - Subround(J, c2, d2, e2, a2, b2, X[13], 7, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 6], 7, k5); - Subround(J, a2, b2, c2, d2, e2, X[15], 8, k5); - Subround(J, e2, a2, b2, c2, d2, X[ 8], 11, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 1], 14, k5); - Subround(J, c2, d2, e2, a2, b2, X[10], 14, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5); - Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5); - - t = a1; a1 = a2; a2 = t; - - Subround(G, e1, a1, b1, c1, d1, X[ 7], 7, k1); - Subround(G, d1, e1, a1, b1, c1, X[ 4], 6, k1); - Subround(G, c1, d1, e1, a1, b1, X[13], 8, k1); - Subround(G, b1, c1, d1, e1, a1, X[ 1], 13, k1); - Subround(G, a1, b1, c1, d1, e1, X[10], 11, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 6], 9, k1); - Subround(G, d1, e1, a1, b1, c1, X[15], 7, k1); - Subround(G, c1, d1, e1, a1, b1, X[ 3], 15, k1); - Subround(G, b1, c1, d1, e1, a1, X[12], 7, k1); - Subround(G, a1, b1, c1, d1, e1, X[ 0], 12, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 9], 15, k1); - Subround(G, d1, e1, a1, b1, c1, X[ 5], 9, k1); - Subround(G, c1, d1, e1, a1, b1, X[ 2], 11, k1); - Subround(G, b1, c1, d1, e1, a1, X[14], 7, k1); - Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1); - - Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6); - Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6); - Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6); - Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6); - Subround(I, a2, b2, c2, d2, e2, X[ 0], 12, k6); - Subround(I, e2, a2, b2, c2, d2, X[13], 8, k6); - Subround(I, d2, e2, a2, b2, c2, X[ 5], 9, k6); - Subround(I, c2, d2, e2, a2, b2, X[10], 11, k6); - Subround(I, b2, c2, d2, e2, a2, X[14], 7, k6); - Subround(I, a2, b2, c2, d2, e2, X[15], 7, k6); - Subround(I, e2, a2, b2, c2, d2, X[ 8], 12, k6); - Subround(I, d2, e2, a2, b2, c2, X[12], 7, k6); - Subround(I, c2, d2, e2, a2, b2, X[ 4], 6, k6); - Subround(I, b2, c2, d2, e2, a2, X[ 9], 15, k6); - Subround(I, a2, b2, c2, d2, e2, X[ 1], 13, k6); - Subround(I, e2, a2, b2, c2, d2, X[ 2], 11, k6); - - t = b1; b1 = b2; b2 = t; - - Subround(H, d1, e1, a1, b1, c1, X[ 3], 11, k2); - Subround(H, c1, d1, e1, a1, b1, X[10], 13, k2); - Subround(H, b1, c1, d1, e1, a1, X[14], 6, k2); - Subround(H, a1, b1, c1, d1, e1, X[ 4], 7, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 9], 14, k2); - Subround(H, d1, e1, a1, b1, c1, X[15], 9, k2); - Subround(H, c1, d1, e1, a1, b1, X[ 8], 13, k2); - Subround(H, b1, c1, d1, e1, a1, X[ 1], 15, k2); - Subround(H, a1, b1, c1, d1, e1, X[ 2], 14, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 7], 8, k2); - Subround(H, d1, e1, a1, b1, c1, X[ 0], 13, k2); - Subround(H, c1, d1, e1, a1, b1, X[ 6], 6, k2); - Subround(H, b1, c1, d1, e1, a1, X[13], 5, k2); - Subround(H, a1, b1, c1, d1, e1, X[11], 12, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 5], 7, k2); - Subround(H, d1, e1, a1, b1, c1, X[12], 5, k2); - - Subround(H, d2, e2, a2, b2, c2, X[15], 9, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 5], 7, k7); - Subround(H, b2, c2, d2, e2, a2, X[ 1], 15, k7); - Subround(H, a2, b2, c2, d2, e2, X[ 3], 11, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 7], 8, k7); - Subround(H, d2, e2, a2, b2, c2, X[14], 6, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 6], 6, k7); - Subround(H, b2, c2, d2, e2, a2, X[ 9], 14, k7); - Subround(H, a2, b2, c2, d2, e2, X[11], 12, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 8], 13, k7); - Subround(H, d2, e2, a2, b2, c2, X[12], 5, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 2], 14, k7); - Subround(H, b2, c2, d2, e2, a2, X[10], 13, k7); - Subround(H, a2, b2, c2, d2, e2, X[ 0], 13, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 4], 7, k7); - Subround(H, d2, e2, a2, b2, c2, X[13], 5, k7); - - t = c1; c1 = c2; c2 = t; - - Subround(I, c1, d1, e1, a1, b1, X[ 1], 11, k3); - Subround(I, b1, c1, d1, e1, a1, X[ 9], 12, k3); - Subround(I, a1, b1, c1, d1, e1, X[11], 14, k3); - Subround(I, e1, a1, b1, c1, d1, X[10], 15, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 0], 14, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 8], 15, k3); - Subround(I, b1, c1, d1, e1, a1, X[12], 9, k3); - Subround(I, a1, b1, c1, d1, e1, X[ 4], 8, k3); - Subround(I, e1, a1, b1, c1, d1, X[13], 9, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 3], 14, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 7], 5, k3); - Subround(I, b1, c1, d1, e1, a1, X[15], 6, k3); - Subround(I, a1, b1, c1, d1, e1, X[14], 8, k3); - Subround(I, e1, a1, b1, c1, d1, X[ 5], 6, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 6], 5, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 2], 12, k3); - - Subround(G, c2, d2, e2, a2, b2, X[ 8], 15, k8); - Subround(G, b2, c2, d2, e2, a2, X[ 6], 5, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 4], 8, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 1], 11, k8); - Subround(G, d2, e2, a2, b2, c2, X[ 3], 14, k8); - Subround(G, c2, d2, e2, a2, b2, X[11], 14, k8); - Subround(G, b2, c2, d2, e2, a2, X[15], 6, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 0], 14, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 5], 6, k8); - Subround(G, d2, e2, a2, b2, c2, X[12], 9, k8); - Subround(G, c2, d2, e2, a2, b2, X[ 2], 12, k8); - Subround(G, b2, c2, d2, e2, a2, X[13], 9, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 9], 12, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 7], 5, k8); - Subround(G, d2, e2, a2, b2, c2, X[10], 15, k8); - Subround(G, c2, d2, e2, a2, b2, X[14], 8, k8); - - t = d1; d1 = d2; d2 = t; - - Subround(J, b1, c1, d1, e1, a1, X[ 4], 9, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 0], 15, k4); - Subround(J, e1, a1, b1, c1, d1, X[ 5], 5, k4); - Subround(J, d1, e1, a1, b1, c1, X[ 9], 11, k4); - Subround(J, c1, d1, e1, a1, b1, X[ 7], 6, k4); - Subround(J, b1, c1, d1, e1, a1, X[12], 8, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 2], 13, k4); - Subround(J, e1, a1, b1, c1, d1, X[10], 12, k4); - Subround(J, d1, e1, a1, b1, c1, X[14], 5, k4); - Subround(J, c1, d1, e1, a1, b1, X[ 1], 12, k4); - Subround(J, b1, c1, d1, e1, a1, X[ 3], 13, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 8], 14, k4); - Subround(J, e1, a1, b1, c1, d1, X[11], 11, k4); - Subround(J, d1, e1, a1, b1, c1, X[ 6], 8, k4); - Subround(J, c1, d1, e1, a1, b1, X[15], 5, k4); - Subround(J, b1, c1, d1, e1, a1, X[13], 6, k4); - - Subround(F, b2, c2, d2, e2, a2, X[12], 8, k9); - Subround(F, a2, b2, c2, d2, e2, X[15], 5, k9); - Subround(F, e2, a2, b2, c2, d2, X[10], 12, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 4], 9, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 1], 12, k9); - Subround(F, b2, c2, d2, e2, a2, X[ 5], 5, k9); - Subround(F, a2, b2, c2, d2, e2, X[ 8], 14, k9); - Subround(F, e2, a2, b2, c2, d2, X[ 7], 6, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 6], 8, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 2], 13, k9); - Subround(F, b2, c2, d2, e2, a2, X[13], 6, k9); - Subround(F, a2, b2, c2, d2, e2, X[14], 5, k9); - Subround(F, e2, a2, b2, c2, d2, X[ 0], 15, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 3], 13, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 9], 11, k9); - Subround(F, b2, c2, d2, e2, a2, X[11], 11, k9); - - t = e1; e1 = e2; e2 = t; - - digest[0] += a1; - digest[1] += b1; - digest[2] += c1; - digest[3] += d1; - digest[4] += e1; - digest[5] += a2; - digest[6] += b2; - digest[7] += c2; - digest[8] += d2; - digest[9] += e2; -} - -#undef Subround - -// ************************************************************* - -// for 128 and 256 -#define Subround(f, a, b, c, d, x, s, k) \ - a += f(b, c, d) + x + k;\ - a = rotlFixed((word32)a, s); - -void RIPEMD128::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xefcdab89L; - state[2] = 0x98badcfeL; - state[3] = 0x10325476L; -} - -void RIPEMD128::Transform (word32 *digest, const word32 *X) -{ - unsigned long a1, b1, c1, d1, a2, b2, c2, d2; - a1 = a2 = digest[0]; - b1 = b2 = digest[1]; - c1 = c2 = digest[2]; - d1 = d2 = digest[3]; - - Subround(F, a1, b1, c1, d1, X[ 0], 11, k0); - Subround(F, d1, a1, b1, c1, X[ 1], 14, k0); - Subround(F, c1, d1, a1, b1, X[ 2], 15, k0); - Subround(F, b1, c1, d1, a1, X[ 3], 12, k0); - Subround(F, a1, b1, c1, d1, X[ 4], 5, k0); - Subround(F, d1, a1, b1, c1, X[ 5], 8, k0); - Subround(F, c1, d1, a1, b1, X[ 6], 7, k0); - Subround(F, b1, c1, d1, a1, X[ 7], 9, k0); - Subround(F, a1, b1, c1, d1, X[ 8], 11, k0); - Subround(F, d1, a1, b1, c1, X[ 9], 13, k0); - Subround(F, c1, d1, a1, b1, X[10], 14, k0); - Subround(F, b1, c1, d1, a1, X[11], 15, k0); - Subround(F, a1, b1, c1, d1, X[12], 6, k0); - Subround(F, d1, a1, b1, c1, X[13], 7, k0); - Subround(F, c1, d1, a1, b1, X[14], 9, k0); - Subround(F, b1, c1, d1, a1, X[15], 8, k0); - - Subround(G, a1, b1, c1, d1, X[ 7], 7, k1); - Subround(G, d1, a1, b1, c1, X[ 4], 6, k1); - Subround(G, c1, d1, a1, b1, X[13], 8, k1); - Subround(G, b1, c1, d1, a1, X[ 1], 13, k1); - Subround(G, a1, b1, c1, d1, X[10], 11, k1); - Subround(G, d1, a1, b1, c1, X[ 6], 9, k1); - Subround(G, c1, d1, a1, b1, X[15], 7, k1); - Subround(G, b1, c1, d1, a1, X[ 3], 15, k1); - Subround(G, a1, b1, c1, d1, X[12], 7, k1); - Subround(G, d1, a1, b1, c1, X[ 0], 12, k1); - Subround(G, c1, d1, a1, b1, X[ 9], 15, k1); - Subround(G, b1, c1, d1, a1, X[ 5], 9, k1); - Subround(G, a1, b1, c1, d1, X[ 2], 11, k1); - Subround(G, d1, a1, b1, c1, X[14], 7, k1); - Subround(G, c1, d1, a1, b1, X[11], 13, k1); - Subround(G, b1, c1, d1, a1, X[ 8], 12, k1); - - Subround(H, a1, b1, c1, d1, X[ 3], 11, k2); - Subround(H, d1, a1, b1, c1, X[10], 13, k2); - Subround(H, c1, d1, a1, b1, X[14], 6, k2); - Subround(H, b1, c1, d1, a1, X[ 4], 7, k2); - Subround(H, a1, b1, c1, d1, X[ 9], 14, k2); - Subround(H, d1, a1, b1, c1, X[15], 9, k2); - Subround(H, c1, d1, a1, b1, X[ 8], 13, k2); - Subround(H, b1, c1, d1, a1, X[ 1], 15, k2); - Subround(H, a1, b1, c1, d1, X[ 2], 14, k2); - Subround(H, d1, a1, b1, c1, X[ 7], 8, k2); - Subround(H, c1, d1, a1, b1, X[ 0], 13, k2); - Subround(H, b1, c1, d1, a1, X[ 6], 6, k2); - Subround(H, a1, b1, c1, d1, X[13], 5, k2); - Subround(H, d1, a1, b1, c1, X[11], 12, k2); - Subround(H, c1, d1, a1, b1, X[ 5], 7, k2); - Subround(H, b1, c1, d1, a1, X[12], 5, k2); - - Subround(I, a1, b1, c1, d1, X[ 1], 11, k3); - Subround(I, d1, a1, b1, c1, X[ 9], 12, k3); - Subround(I, c1, d1, a1, b1, X[11], 14, k3); - Subround(I, b1, c1, d1, a1, X[10], 15, k3); - Subround(I, a1, b1, c1, d1, X[ 0], 14, k3); - Subround(I, d1, a1, b1, c1, X[ 8], 15, k3); - Subround(I, c1, d1, a1, b1, X[12], 9, k3); - Subround(I, b1, c1, d1, a1, X[ 4], 8, k3); - Subround(I, a1, b1, c1, d1, X[13], 9, k3); - Subround(I, d1, a1, b1, c1, X[ 3], 14, k3); - Subround(I, c1, d1, a1, b1, X[ 7], 5, k3); - Subround(I, b1, c1, d1, a1, X[15], 6, k3); - Subround(I, a1, b1, c1, d1, X[14], 8, k3); - Subround(I, d1, a1, b1, c1, X[ 5], 6, k3); - Subround(I, c1, d1, a1, b1, X[ 6], 5, k3); - Subround(I, b1, c1, d1, a1, X[ 2], 12, k3); - - Subround(I, a2, b2, c2, d2, X[ 5], 8, k5); - Subround(I, d2, a2, b2, c2, X[14], 9, k5); - Subround(I, c2, d2, a2, b2, X[ 7], 9, k5); - Subround(I, b2, c2, d2, a2, X[ 0], 11, k5); - Subround(I, a2, b2, c2, d2, X[ 9], 13, k5); - Subround(I, d2, a2, b2, c2, X[ 2], 15, k5); - Subround(I, c2, d2, a2, b2, X[11], 15, k5); - Subround(I, b2, c2, d2, a2, X[ 4], 5, k5); - Subround(I, a2, b2, c2, d2, X[13], 7, k5); - Subround(I, d2, a2, b2, c2, X[ 6], 7, k5); - Subround(I, c2, d2, a2, b2, X[15], 8, k5); - Subround(I, b2, c2, d2, a2, X[ 8], 11, k5); - Subround(I, a2, b2, c2, d2, X[ 1], 14, k5); - Subround(I, d2, a2, b2, c2, X[10], 14, k5); - Subround(I, c2, d2, a2, b2, X[ 3], 12, k5); - Subround(I, b2, c2, d2, a2, X[12], 6, k5); - - Subround(H, a2, b2, c2, d2, X[ 6], 9, k6); - Subround(H, d2, a2, b2, c2, X[11], 13, k6); - Subround(H, c2, d2, a2, b2, X[ 3], 15, k6); - Subround(H, b2, c2, d2, a2, X[ 7], 7, k6); - Subround(H, a2, b2, c2, d2, X[ 0], 12, k6); - Subround(H, d2, a2, b2, c2, X[13], 8, k6); - Subround(H, c2, d2, a2, b2, X[ 5], 9, k6); - Subround(H, b2, c2, d2, a2, X[10], 11, k6); - Subround(H, a2, b2, c2, d2, X[14], 7, k6); - Subround(H, d2, a2, b2, c2, X[15], 7, k6); - Subround(H, c2, d2, a2, b2, X[ 8], 12, k6); - Subround(H, b2, c2, d2, a2, X[12], 7, k6); - Subround(H, a2, b2, c2, d2, X[ 4], 6, k6); - Subround(H, d2, a2, b2, c2, X[ 9], 15, k6); - Subround(H, c2, d2, a2, b2, X[ 1], 13, k6); - Subround(H, b2, c2, d2, a2, X[ 2], 11, k6); - - Subround(G, a2, b2, c2, d2, X[15], 9, k7); - Subround(G, d2, a2, b2, c2, X[ 5], 7, k7); - Subround(G, c2, d2, a2, b2, X[ 1], 15, k7); - Subround(G, b2, c2, d2, a2, X[ 3], 11, k7); - Subround(G, a2, b2, c2, d2, X[ 7], 8, k7); - Subround(G, d2, a2, b2, c2, X[14], 6, k7); - Subround(G, c2, d2, a2, b2, X[ 6], 6, k7); - Subround(G, b2, c2, d2, a2, X[ 9], 14, k7); - Subround(G, a2, b2, c2, d2, X[11], 12, k7); - Subround(G, d2, a2, b2, c2, X[ 8], 13, k7); - Subround(G, c2, d2, a2, b2, X[12], 5, k7); - Subround(G, b2, c2, d2, a2, X[ 2], 14, k7); - Subround(G, a2, b2, c2, d2, X[10], 13, k7); - Subround(G, d2, a2, b2, c2, X[ 0], 13, k7); - Subround(G, c2, d2, a2, b2, X[ 4], 7, k7); - Subround(G, b2, c2, d2, a2, X[13], 5, k7); - - Subround(F, a2, b2, c2, d2, X[ 8], 15, k9); - Subround(F, d2, a2, b2, c2, X[ 6], 5, k9); - Subround(F, c2, d2, a2, b2, X[ 4], 8, k9); - Subround(F, b2, c2, d2, a2, X[ 1], 11, k9); - Subround(F, a2, b2, c2, d2, X[ 3], 14, k9); - Subround(F, d2, a2, b2, c2, X[11], 14, k9); - Subround(F, c2, d2, a2, b2, X[15], 6, k9); - Subround(F, b2, c2, d2, a2, X[ 0], 14, k9); - Subround(F, a2, b2, c2, d2, X[ 5], 6, k9); - Subround(F, d2, a2, b2, c2, X[12], 9, k9); - Subround(F, c2, d2, a2, b2, X[ 2], 12, k9); - Subround(F, b2, c2, d2, a2, X[13], 9, k9); - Subround(F, a2, b2, c2, d2, X[ 9], 12, k9); - Subround(F, d2, a2, b2, c2, X[ 7], 5, k9); - Subround(F, c2, d2, a2, b2, X[10], 15, k9); - Subround(F, b2, c2, d2, a2, X[14], 8, k9); - - c1 = digest[1] + c1 + d2; - digest[1] = digest[2] + d1 + a2; - digest[2] = digest[3] + a1 + b2; - digest[3] = digest[0] + b1 + c2; - digest[0] = c1; -} - -// ************************************************************* - -void RIPEMD256::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xefcdab89L; - state[2] = 0x98badcfeL; - state[3] = 0x10325476L; - state[4] = 0x76543210L; - state[5] = 0xfedcba98L; - state[6] = 0x89abcdefL; - state[7] = 0x01234567L; -} - -void RIPEMD256::Transform (word32 *digest, const word32 *X) -{ - unsigned long a1, b1, c1, d1, a2, b2, c2, d2, t; - a1 = digest[0]; - b1 = digest[1]; - c1 = digest[2]; - d1 = digest[3]; - a2 = digest[4]; - b2 = digest[5]; - c2 = digest[6]; - d2 = digest[7]; - - Subround(F, a1, b1, c1, d1, X[ 0], 11, k0); - Subround(F, d1, a1, b1, c1, X[ 1], 14, k0); - Subround(F, c1, d1, a1, b1, X[ 2], 15, k0); - Subround(F, b1, c1, d1, a1, X[ 3], 12, k0); - Subround(F, a1, b1, c1, d1, X[ 4], 5, k0); - Subround(F, d1, a1, b1, c1, X[ 5], 8, k0); - Subround(F, c1, d1, a1, b1, X[ 6], 7, k0); - Subround(F, b1, c1, d1, a1, X[ 7], 9, k0); - Subround(F, a1, b1, c1, d1, X[ 8], 11, k0); - Subround(F, d1, a1, b1, c1, X[ 9], 13, k0); - Subround(F, c1, d1, a1, b1, X[10], 14, k0); - Subround(F, b1, c1, d1, a1, X[11], 15, k0); - Subround(F, a1, b1, c1, d1, X[12], 6, k0); - Subround(F, d1, a1, b1, c1, X[13], 7, k0); - Subround(F, c1, d1, a1, b1, X[14], 9, k0); - Subround(F, b1, c1, d1, a1, X[15], 8, k0); - - Subround(I, a2, b2, c2, d2, X[ 5], 8, k5); - Subround(I, d2, a2, b2, c2, X[14], 9, k5); - Subround(I, c2, d2, a2, b2, X[ 7], 9, k5); - Subround(I, b2, c2, d2, a2, X[ 0], 11, k5); - Subround(I, a2, b2, c2, d2, X[ 9], 13, k5); - Subround(I, d2, a2, b2, c2, X[ 2], 15, k5); - Subround(I, c2, d2, a2, b2, X[11], 15, k5); - Subround(I, b2, c2, d2, a2, X[ 4], 5, k5); - Subround(I, a2, b2, c2, d2, X[13], 7, k5); - Subround(I, d2, a2, b2, c2, X[ 6], 7, k5); - Subround(I, c2, d2, a2, b2, X[15], 8, k5); - Subround(I, b2, c2, d2, a2, X[ 8], 11, k5); - Subround(I, a2, b2, c2, d2, X[ 1], 14, k5); - Subround(I, d2, a2, b2, c2, X[10], 14, k5); - Subround(I, c2, d2, a2, b2, X[ 3], 12, k5); - Subround(I, b2, c2, d2, a2, X[12], 6, k5); - - t = a1; a1 = a2; a2 = t; - - Subround(G, a1, b1, c1, d1, X[ 7], 7, k1); - Subround(G, d1, a1, b1, c1, X[ 4], 6, k1); - Subround(G, c1, d1, a1, b1, X[13], 8, k1); - Subround(G, b1, c1, d1, a1, X[ 1], 13, k1); - Subround(G, a1, b1, c1, d1, X[10], 11, k1); - Subround(G, d1, a1, b1, c1, X[ 6], 9, k1); - Subround(G, c1, d1, a1, b1, X[15], 7, k1); - Subround(G, b1, c1, d1, a1, X[ 3], 15, k1); - Subround(G, a1, b1, c1, d1, X[12], 7, k1); - Subround(G, d1, a1, b1, c1, X[ 0], 12, k1); - Subround(G, c1, d1, a1, b1, X[ 9], 15, k1); - Subround(G, b1, c1, d1, a1, X[ 5], 9, k1); - Subround(G, a1, b1, c1, d1, X[ 2], 11, k1); - Subround(G, d1, a1, b1, c1, X[14], 7, k1); - Subround(G, c1, d1, a1, b1, X[11], 13, k1); - Subround(G, b1, c1, d1, a1, X[ 8], 12, k1); - - Subround(H, a2, b2, c2, d2, X[ 6], 9, k6); - Subround(H, d2, a2, b2, c2, X[11], 13, k6); - Subround(H, c2, d2, a2, b2, X[ 3], 15, k6); - Subround(H, b2, c2, d2, a2, X[ 7], 7, k6); - Subround(H, a2, b2, c2, d2, X[ 0], 12, k6); - Subround(H, d2, a2, b2, c2, X[13], 8, k6); - Subround(H, c2, d2, a2, b2, X[ 5], 9, k6); - Subround(H, b2, c2, d2, a2, X[10], 11, k6); - Subround(H, a2, b2, c2, d2, X[14], 7, k6); - Subround(H, d2, a2, b2, c2, X[15], 7, k6); - Subround(H, c2, d2, a2, b2, X[ 8], 12, k6); - Subround(H, b2, c2, d2, a2, X[12], 7, k6); - Subround(H, a2, b2, c2, d2, X[ 4], 6, k6); - Subround(H, d2, a2, b2, c2, X[ 9], 15, k6); - Subround(H, c2, d2, a2, b2, X[ 1], 13, k6); - Subround(H, b2, c2, d2, a2, X[ 2], 11, k6); - - t = b1; b1 = b2; b2 = t; - - Subround(H, a1, b1, c1, d1, X[ 3], 11, k2); - Subround(H, d1, a1, b1, c1, X[10], 13, k2); - Subround(H, c1, d1, a1, b1, X[14], 6, k2); - Subround(H, b1, c1, d1, a1, X[ 4], 7, k2); - Subround(H, a1, b1, c1, d1, X[ 9], 14, k2); - Subround(H, d1, a1, b1, c1, X[15], 9, k2); - Subround(H, c1, d1, a1, b1, X[ 8], 13, k2); - Subround(H, b1, c1, d1, a1, X[ 1], 15, k2); - Subround(H, a1, b1, c1, d1, X[ 2], 14, k2); - Subround(H, d1, a1, b1, c1, X[ 7], 8, k2); - Subround(H, c1, d1, a1, b1, X[ 0], 13, k2); - Subround(H, b1, c1, d1, a1, X[ 6], 6, k2); - Subround(H, a1, b1, c1, d1, X[13], 5, k2); - Subround(H, d1, a1, b1, c1, X[11], 12, k2); - Subround(H, c1, d1, a1, b1, X[ 5], 7, k2); - Subround(H, b1, c1, d1, a1, X[12], 5, k2); - - Subround(G, a2, b2, c2, d2, X[15], 9, k7); - Subround(G, d2, a2, b2, c2, X[ 5], 7, k7); - Subround(G, c2, d2, a2, b2, X[ 1], 15, k7); - Subround(G, b2, c2, d2, a2, X[ 3], 11, k7); - Subround(G, a2, b2, c2, d2, X[ 7], 8, k7); - Subround(G, d2, a2, b2, c2, X[14], 6, k7); - Subround(G, c2, d2, a2, b2, X[ 6], 6, k7); - Subround(G, b2, c2, d2, a2, X[ 9], 14, k7); - Subround(G, a2, b2, c2, d2, X[11], 12, k7); - Subround(G, d2, a2, b2, c2, X[ 8], 13, k7); - Subround(G, c2, d2, a2, b2, X[12], 5, k7); - Subround(G, b2, c2, d2, a2, X[ 2], 14, k7); - Subround(G, a2, b2, c2, d2, X[10], 13, k7); - Subround(G, d2, a2, b2, c2, X[ 0], 13, k7); - Subround(G, c2, d2, a2, b2, X[ 4], 7, k7); - Subround(G, b2, c2, d2, a2, X[13], 5, k7); - - t = c1; c1 = c2; c2 = t; - - Subround(I, a1, b1, c1, d1, X[ 1], 11, k3); - Subround(I, d1, a1, b1, c1, X[ 9], 12, k3); - Subround(I, c1, d1, a1, b1, X[11], 14, k3); - Subround(I, b1, c1, d1, a1, X[10], 15, k3); - Subround(I, a1, b1, c1, d1, X[ 0], 14, k3); - Subround(I, d1, a1, b1, c1, X[ 8], 15, k3); - Subround(I, c1, d1, a1, b1, X[12], 9, k3); - Subround(I, b1, c1, d1, a1, X[ 4], 8, k3); - Subround(I, a1, b1, c1, d1, X[13], 9, k3); - Subround(I, d1, a1, b1, c1, X[ 3], 14, k3); - Subround(I, c1, d1, a1, b1, X[ 7], 5, k3); - Subround(I, b1, c1, d1, a1, X[15], 6, k3); - Subround(I, a1, b1, c1, d1, X[14], 8, k3); - Subround(I, d1, a1, b1, c1, X[ 5], 6, k3); - Subround(I, c1, d1, a1, b1, X[ 6], 5, k3); - Subround(I, b1, c1, d1, a1, X[ 2], 12, k3); - - Subround(F, a2, b2, c2, d2, X[ 8], 15, k9); - Subround(F, d2, a2, b2, c2, X[ 6], 5, k9); - Subround(F, c2, d2, a2, b2, X[ 4], 8, k9); - Subround(F, b2, c2, d2, a2, X[ 1], 11, k9); - Subround(F, a2, b2, c2, d2, X[ 3], 14, k9); - Subround(F, d2, a2, b2, c2, X[11], 14, k9); - Subround(F, c2, d2, a2, b2, X[15], 6, k9); - Subround(F, b2, c2, d2, a2, X[ 0], 14, k9); - Subround(F, a2, b2, c2, d2, X[ 5], 6, k9); - Subround(F, d2, a2, b2, c2, X[12], 9, k9); - Subround(F, c2, d2, a2, b2, X[ 2], 12, k9); - Subround(F, b2, c2, d2, a2, X[13], 9, k9); - Subround(F, a2, b2, c2, d2, X[ 9], 12, k9); - Subround(F, d2, a2, b2, c2, X[ 7], 5, k9); - Subround(F, c2, d2, a2, b2, X[10], 15, k9); - Subround(F, b2, c2, d2, a2, X[14], 8, k9); - - t = d1; d1 = d2; d2 = t; - - digest[0] += a1; - digest[1] += b1; - digest[2] += c1; - digest[3] += d1; - digest[4] += a2; - digest[5] += b2; - digest[6] += c2; - digest[7] += d2; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/ripemd.h b/external/crypto++-5.6.3/ripemd.h deleted file mode 100644 index 302ecedd7..000000000 --- a/external/crypto++-5.6.3/ripemd.h +++ /dev/null @@ -1,54 +0,0 @@ -// ripemd.h - written and placed in the public domain by Wei Dai - -//! \file -//! \brief Classes for RIPEMD message digest - -#ifndef CRYPTOPP_RIPEMD_H -#define CRYPTOPP_RIPEMD_H - -#include "iterhash.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! RIPEMD-160 -/*! Digest Length = 160 bits */ -class RIPEMD160 : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word32 *digest, const word32 *data); - static const char * StaticAlgorithmName() {return "RIPEMD-160";} -}; - -/*! Digest Length = 320 bits, Security is similar to RIPEMD-160 */ -class RIPEMD320 : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word32 *digest, const word32 *data); - static const char * StaticAlgorithmName() {return "RIPEMD-320";} -}; - -/*! \warning RIPEMD-128 is considered insecure, and should not be used - unless you absolutely need it for compatibility. */ -class RIPEMD128 : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word32 *digest, const word32 *data); - static const char * StaticAlgorithmName() {return "RIPEMD-128";} -}; - -/*! \warning RIPEMD-256 is considered insecure, and should not be used - unless you absolutely need it for compatibility. */ -class RIPEMD256 : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word32 *digest, const word32 *data); - static const char * StaticAlgorithmName() {return "RIPEMD-256";} -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rng.cpp b/external/crypto++-5.6.3/rng.cpp deleted file mode 100644 index f3d5cbd1f..000000000 --- a/external/crypto++-5.6.3/rng.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// rng.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "rng.h" -#include "fips140.h" - -#include -#include - -NAMESPACE_BEGIN(CryptoPP) - -// linear congruential generator -// originally by William S. England - -// do not use for cryptographic purposes - -/* -** Original_numbers are the original published m and q in the -** ACM article above. John Burton has furnished numbers for -** a reportedly better generator. The new numbers are now -** used in this program by default. -*/ - -#ifndef LCRNG_ORIGINAL_NUMBERS -const word32 LC_RNG::m=2147483647L; -const word32 LC_RNG::q=44488L; - -const word16 LC_RNG::a=(unsigned int)48271L; -const word16 LC_RNG::r=3399; -#else -const word32 LC_RNG::m=2147483647L; -const word32 LC_RNG::q=127773L; - -const word16 LC_RNG::a=16807; -const word16 LC_RNG::r=2836; -#endif - -void LC_RNG::GenerateBlock(byte *output, size_t size) -{ - while (size--) - { - word32 hi = seed/q; - word32 lo = seed%q; - - long test = a*lo - r*hi; - - if (test > 0) - seed = test; - else - seed = test+ m; - - *output++ = byte((GETBYTE(seed, 0) ^ GETBYTE(seed, 1) ^ GETBYTE(seed, 2) ^ GETBYTE(seed, 3))); - } -} - -// ******************************************************** - -#ifndef CRYPTOPP_IMPORTS - -X917RNG::X917RNG(BlockTransformation *c, const byte *seed, const byte *deterministicTimeVector) - : cipher(c), - S(cipher->BlockSize()), - dtbuf(S), - randseed(seed, S), - m_lastBlock(S), - m_deterministicTimeVector(deterministicTimeVector, deterministicTimeVector ? S : 0) -{ - if (!deterministicTimeVector) - { - time_t tstamp1 = time(0); - xorbuf(dtbuf, (byte *)&tstamp1, UnsignedMin(sizeof(tstamp1), S)); - cipher->ProcessBlock(dtbuf); - clock_t tstamp2 = clock(); - xorbuf(dtbuf, (byte *)&tstamp2, UnsignedMin(sizeof(tstamp2), S)); - cipher->ProcessBlock(dtbuf); - } - - // for FIPS 140-2 - GenerateBlock(m_lastBlock, S); -} - -void X917RNG::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size) -{ - while (size > 0) - { - // calculate new enciphered timestamp - if (m_deterministicTimeVector.size()) - { - cipher->ProcessBlock(m_deterministicTimeVector, dtbuf); - IncrementCounterByOne(m_deterministicTimeVector, S); - } - else - { - clock_t c = clock(); - xorbuf(dtbuf, (byte *)&c, UnsignedMin(sizeof(c), S)); - time_t t = time(NULL); - xorbuf(dtbuf+S-UnsignedMin(sizeof(t), S), (byte *)&t, UnsignedMin(sizeof(t), S)); - cipher->ProcessBlock(dtbuf); - } - - // combine enciphered timestamp with seed - xorbuf(randseed, dtbuf, S); - - // generate a new block of random bytes - cipher->ProcessBlock(randseed); - if (memcmp(m_lastBlock, randseed, S) == 0) - throw SelfTestFailure("X917RNG: Continuous random number generator test failed."); - - // output random bytes - size_t len = UnsignedMin(S, size); - target.ChannelPut(channel, randseed, len); - size -= len; - - // compute new seed vector - memcpy(m_lastBlock, randseed, S); - xorbuf(randseed, dtbuf, S); - cipher->ProcessBlock(randseed); - } -} - -#endif - -MaurerRandomnessTest::MaurerRandomnessTest() - : sum(0.0), n(0) -{ - for (unsigned i=0; i= Q) - sum += log(double(n - tab[inByte])); - tab[inByte] = n; - n++; - } - return 0; -} - -double MaurerRandomnessTest::GetTestValue() const -{ - if (BytesNeeded() > 0) - throw Exception(Exception::OTHER_ERROR, "MaurerRandomnessTest: " + IntToString(BytesNeeded()) + " more bytes of input needed"); - - double fTu = (sum/(n-Q))/log(2.0); // this is the test value defined by Maurer - - double value = fTu * 0.1392; // arbitrarily normalize it to - return value > 1.0 ? 1.0 : value; // a number between 0 and 1 -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/rng.h b/external/crypto++-5.6.3/rng.h deleted file mode 100644 index 22237807d..000000000 --- a/external/crypto++-5.6.3/rng.h +++ /dev/null @@ -1,110 +0,0 @@ -// rng.h - written and placed in the public domain by Wei Dai - -//! \file rng.h -//! \brief Miscellaneous classes for RNGs -//! \details This file contains miscellaneous classes for RNGs, including LC_RNG(), -//! X917RNG() and MaurerRandomnessTest() -//! \sa osrng.h, randpool.h - -#ifndef CRYPTOPP_RNG_H -#define CRYPTOPP_RNG_H - -#include "cryptlib.h" -#include "filters.h" -#include "smartptr.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \brief Linear Congruential Generator (LCG) -//! \details Originally propsed by William S. England. -//! \warning LC_RNG is suitable for simulations, where uniformaly distrubuted numbers are -//! required quickly. It should not be used for cryptographic purposes. -class LC_RNG : public RandomNumberGenerator -{ -public: - //! \brief Construct a Linear Congruential Generator (LCG) - //! \param init_seed the initial value for the generator - LC_RNG(word32 init_seed) - : seed(init_seed) {} - - void GenerateBlock(byte *output, size_t size); - - word32 GetSeed() {return seed;} - -private: - word32 seed; - - static const word32 m; - static const word32 q; - static const word16 a; - static const word16 r; -}; - -//! \class X917RNG -//! \brief ANSI X9.17 RNG -//! \details X917RNG is from ANSI X9.17 Appendix C. -//! \sa AutoSeededX917RNG, DefaultAutoSeededRNG -class CRYPTOPP_DLL X917RNG : public RandomNumberGenerator, public NotCopyable -{ -public: - //! \brief Construct a X917RNG - //! \param cipher the block cipher to use for the generator - //! \param seed a byte buffer to use as a seed - //! \param deterministicTimeVector additional entropy - //! \details cipher will be deleted by the destructor. seed must be at least - //! BlockSize() in length. deterministicTimeVector = 0 means obtain time vector - //! from the system. - //! \details When constructing an AutoSeededX917RNG, the generator must be keyed or an - //! access violation will occur because the time vector is encrypted using the block cipher. - //! To key the generator during constructions, perform the following: - //!
-	//!   SecByteBlock key(AES::DEFAULT_KEYLENGTH), seed(AES::BLOCKSIZE);
-	//!   OS_GenerateRandomBlock(false, key, key.size());
-	//!   OS_GenerateRandomBlock(false, seed, seed.size());
-	//!   X917RNG prng(new AES::Encryption(key, AES::DEFAULT_KEYLENGTH), seed, NULL);
-	//! 
- //! \sa AutoSeededX917RNG - X917RNG(BlockTransformation *cipher, const byte *seed, const byte *deterministicTimeVector = 0); - - void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size); - -private: - member_ptr cipher; - const unsigned int S; // blocksize of cipher - SecByteBlock dtbuf; // buffer for enciphered timestamp - SecByteBlock randseed, m_lastBlock, m_deterministicTimeVector; -}; - -//! \class MaurerRandomnessTest -//! \brief Maurer's Universal Statistical Test for Random Bit Generators -//! \details This class implements Maurer's Universal Statistical Test for -//! Random Bit Generators. It is intended for measuring the randomness of -//! *PHYSICAL* RNGs. -//! \details For more details see Maurer's paper in Journal of Cryptology, 1992. -class MaurerRandomnessTest : public Bufferless -{ -public: - MaurerRandomnessTest(); - - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - - //! \brief Provides the number of bytes of input is needed by the test - //! \returns how many more bytes of input is needed by the test - // BytesNeeded() returns how many more bytes of input is needed by the test - // GetTestValue() should not be called before BytesNeeded()==0 - unsigned int BytesNeeded() const {return n >= (Q+K) ? 0 : Q+K-n;} - - // returns a number between 0.0 and 1.0, describing the quality of the - // random numbers entered - double GetTestValue() const; - -private: - enum {L=8, V=256, Q=2000, K=2000}; - double sum; - unsigned int n; - unsigned int tab[V]; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rsa.cpp b/external/crypto++-5.6.3/rsa.cpp deleted file mode 100644 index 2d7e25a2b..000000000 --- a/external/crypto++-5.6.3/rsa.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// rsa.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "rsa.h" -#include "asn.h" -#include "sha.h" -#include "oids.h" -#include "modarith.h" -#include "nbtheory.h" -#include "algparam.h" -#include "fips140.h" - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL) -#include "pssr.h" -NAMESPACE_BEGIN(CryptoPP) -void RSA_TestInstantiations() -{ - RSASS::Verifier x1(1, 1); - RSASS::Signer x2(NullRNG(), 1); - RSASS::Verifier x3(x2); - RSASS::Verifier x4(x2.GetKey()); - RSASS::Verifier x5(x3); -#ifndef __MWERKS__ - RSASS::Signer x6 = x2; - x3 = x2; - x6 = x2; -#endif - RSAES::Encryptor x7(x2); -#ifndef __GNUC__ - RSAES::Encryptor x8(x3); -#endif - RSAES >::Encryptor x9(x2); - - x4 = x2.GetKey(); -} -NAMESPACE_END -#endif - -#ifndef CRYPTOPP_IMPORTS - -NAMESPACE_BEGIN(CryptoPP) - -OID RSAFunction::GetAlgorithmID() const -{ - return ASN1::rsaEncryption(); -} - -void RSAFunction::BERDecodePublicKey(BufferedTransformation &bt, bool, size_t) -{ - BERSequenceDecoder seq(bt); - m_n.BERDecode(seq); - m_e.BERDecode(seq); - seq.MessageEnd(); -} - -void RSAFunction::DEREncodePublicKey(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_n.DEREncode(seq); - m_e.DEREncode(seq); - seq.MessageEnd(); -} - -Integer RSAFunction::ApplyFunction(const Integer &x) const -{ - DoQuickSanityCheck(); - return a_exp_b_mod_c(x, m_e, m_n); -} - -bool RSAFunction::Validate(RandomNumberGenerator& rng, unsigned int level) const -{ - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level); - - bool pass = true; - pass = pass && m_n > Integer::One() && m_n.IsOdd(); - pass = pass && m_e > Integer::One() && m_e.IsOdd() && m_e < m_n; - return pass; -} - -bool RSAFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_GET_FUNCTION_ENTRY(PublicExponent) - ; -} - -void RSAFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_SET_FUNCTION_ENTRY(PublicExponent) - ; -} - -// ***************************************************************************** - -class RSAPrimeSelector : public PrimeSelector -{ -public: - RSAPrimeSelector(const Integer &e) : m_e(e) {} - bool IsAcceptable(const Integer &candidate) const {return RelativelyPrime(m_e, candidate-Integer::One());} - Integer m_e; -}; - -void InvertibleRSAFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - int modulusSize = 2048; - alg.GetIntValue(Name::ModulusSize(), modulusSize) || alg.GetIntValue(Name::KeySize(), modulusSize); - - assert(modulusSize >= 16); - if (modulusSize < 16) - throw InvalidArgument("InvertibleRSAFunction: specified modulus size is too small"); - - m_e = alg.GetValueWithDefault(Name::PublicExponent(), Integer(17)); - - assert(m_e >= 3); assert(!m_e.IsEven()); - if (m_e < 3 || m_e.IsEven()) - throw InvalidArgument("InvertibleRSAFunction: invalid public exponent"); - - RSAPrimeSelector selector(m_e); - AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) - (Name::PointerToPrimeSelector(), selector.GetSelectorPointer()); - m_p.GenerateRandom(rng, primeParam); - m_q.GenerateRandom(rng, primeParam); - - m_d = m_e.InverseMod(LCM(m_p-1, m_q-1)); - assert(m_d.IsPositive()); - - m_dp = m_d % (m_p-1); - m_dq = m_d % (m_q-1); - m_n = m_p * m_q; - m_u = m_q.InverseMod(m_p); - - if (FIPS_140_2_ComplianceEnabled()) - { - RSASS::Signer signer(*this); - RSASS::Verifier verifier(signer); - SignaturePairwiseConsistencyTest_FIPS_140_Only(signer, verifier); - - RSAES >::Decryptor decryptor(*this); - RSAES >::Encryptor encryptor(decryptor); - EncryptionPairwiseConsistencyTest_FIPS_140_Only(encryptor, decryptor); - } -} - -void InvertibleRSAFunction::Initialize(RandomNumberGenerator &rng, unsigned int keybits, const Integer &e) -{ - GenerateRandom(rng, MakeParameters(Name::ModulusSize(), (int)keybits)(Name::PublicExponent(), e+e.IsEven())); -} - -void InvertibleRSAFunction::Initialize(const Integer &n, const Integer &e, const Integer &d) -{ - if (n.IsEven() || e.IsEven() | d.IsEven()) - throw InvalidArgument("InvertibleRSAFunction: input is not a valid RSA private key"); - - m_n = n; - m_e = e; - m_d = d; - - Integer r = --(d*e); - unsigned int s = 0; - while (r.IsEven()) - { - r >>= 1; - s++; - } - - ModularArithmetic modn(n); - for (Integer i = 2; ; ++i) - { - Integer a = modn.Exponentiate(i, r); - if (a == 1) - continue; - Integer b; - unsigned int j = 0; - while (a != n-1) - { - b = modn.Square(a); - if (b == 1) - { - m_p = GCD(a-1, n); - m_q = n/m_p; - m_dp = m_d % (m_p-1); - m_dq = m_d % (m_q-1); - m_u = m_q.InverseMod(m_p); - return; - } - if (++j == s) - throw InvalidArgument("InvertibleRSAFunction: input is not a valid RSA private key"); - a = b; - } - } -} - -void InvertibleRSAFunction::BERDecodePrivateKey(BufferedTransformation &bt, bool, size_t) -{ - BERSequenceDecoder privateKey(bt); - word32 version; - BERDecodeUnsigned(privateKey, version, INTEGER, 0, 0); // check version - m_n.BERDecode(privateKey); - m_e.BERDecode(privateKey); - m_d.BERDecode(privateKey); - m_p.BERDecode(privateKey); - m_q.BERDecode(privateKey); - m_dp.BERDecode(privateKey); - m_dq.BERDecode(privateKey); - m_u.BERDecode(privateKey); - privateKey.MessageEnd(); -} - -void InvertibleRSAFunction::DEREncodePrivateKey(BufferedTransformation &bt) const -{ - DERSequenceEncoder privateKey(bt); - DEREncodeUnsigned(privateKey, 0); // version - m_n.DEREncode(privateKey); - m_e.DEREncode(privateKey); - m_d.DEREncode(privateKey); - m_p.DEREncode(privateKey); - m_q.DEREncode(privateKey); - m_dp.DEREncode(privateKey); - m_dq.DEREncode(privateKey); - m_u.DEREncode(privateKey); - privateKey.MessageEnd(); -} - -Integer InvertibleRSAFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const -{ - DoQuickSanityCheck(); - ModularArithmetic modn(m_n); - Integer r, rInv; - do { // do this in a loop for people using small numbers for testing - r.Randomize(rng, Integer::One(), m_n - Integer::One()); - rInv = modn.MultiplicativeInverse(r); - } while (rInv.IsZero()); - Integer re = modn.Exponentiate(r, m_e); - re = modn.Multiply(re, x); // blind - // here we follow the notation of PKCS #1 and let u=q inverse mod p - // but in ModRoot, u=p inverse mod q, so we reverse the order of p and q - Integer y = ModularRoot(re, m_dq, m_dp, m_q, m_p, m_u); - y = modn.Multiply(y, rInv); // unblind - if (modn.Exponentiate(y, m_e) != x) // check - throw Exception(Exception::OTHER_ERROR, "InvertibleRSAFunction: computational error during private key operation"); - return y; -} - -bool InvertibleRSAFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = RSAFunction::Validate(rng, level); - pass = pass && m_p > Integer::One() && m_p.IsOdd() && m_p < m_n; - pass = pass && m_q > Integer::One() && m_q.IsOdd() && m_q < m_n; - pass = pass && m_d > Integer::One() && m_d.IsOdd() && m_d < m_n; - pass = pass && m_dp > Integer::One() && m_dp.IsOdd() && m_dp < m_p; - pass = pass && m_dq > Integer::One() && m_dq.IsOdd() && m_dq < m_q; - pass = pass && m_u.IsPositive() && m_u < m_p; - if (level >= 1) - { - pass = pass && m_p * m_q == m_n; - pass = pass && m_e*m_d % LCM(m_p-1, m_q-1) == 1; - pass = pass && m_dp == m_d%(m_p-1) && m_dq == m_d%(m_q-1); - pass = pass && m_u * m_q % m_p == 1; - } - if (level >= 2) - pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); - return pass; -} - -bool InvertibleRSAFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_GET_FUNCTION_ENTRY(PrivateExponent) - CRYPTOPP_GET_FUNCTION_ENTRY(ModPrime1PrivateExponent) - CRYPTOPP_GET_FUNCTION_ENTRY(ModPrime2PrivateExponent) - CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -void InvertibleRSAFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_SET_FUNCTION_ENTRY(PrivateExponent) - CRYPTOPP_SET_FUNCTION_ENTRY(ModPrime1PrivateExponent) - CRYPTOPP_SET_FUNCTION_ENTRY(ModPrime2PrivateExponent) - CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -// ***************************************************************************** - -Integer RSAFunction_ISO::ApplyFunction(const Integer &x) const -{ - Integer t = RSAFunction::ApplyFunction(x); - return t % 16 == 12 ? t : m_n - t; -} - -Integer InvertibleRSAFunction_ISO::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const -{ - Integer t = InvertibleRSAFunction::CalculateInverse(rng, x); - return STDMIN(t, m_n-t); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rsa.h b/external/crypto++-5.6.3/rsa.h deleted file mode 100644 index 46e5b5a96..000000000 --- a/external/crypto++-5.6.3/rsa.h +++ /dev/null @@ -1,178 +0,0 @@ -// rsa.h - written and placed in the public domain by Wei Dai - -//! \file rsa.h -//! \brief Classes for the RSA cryptosystem -//! \details This file contains classes that implement the RSA -//! ciphers and signature schemes as defined in PKCS #1 v2.0. - -#ifndef CRYPTOPP_RSA_H -#define CRYPTOPP_RSA_H - -#include "cryptlib.h" -#include "pubkey.h" -#include "integer.h" -#include "pkcspad.h" -#include "oaep.h" -#include "emsa2.h" -#include "asn.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class CRYPTOPP_DLL RSAFunction : public TrapdoorFunction, public X509PublicKey -{ - typedef RSAFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &e) - {m_n = n; m_e = e;} - - // X509PublicKey - OID GetAlgorithmID() const; - void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size); - void DEREncodePublicKey(BufferedTransformation &bt) const; - - // CryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // TrapdoorFunction - Integer ApplyFunction(const Integer &x) const; - Integer PreimageBound() const {return m_n;} - Integer ImageBound() const {return m_n;} - - // non-derived - const Integer & GetModulus() const {return m_n;} - const Integer & GetPublicExponent() const {return m_e;} - - void SetModulus(const Integer &n) {m_n = n;} - void SetPublicExponent(const Integer &e) {m_e = e;} - -protected: - Integer m_n, m_e; -}; - -//! _ -class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey -{ - typedef InvertibleRSAFunction ThisClass; - -public: - void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits, const Integer &e = 17); - void Initialize(const Integer &n, const Integer &e, const Integer &d, const Integer &p, const Integer &q, const Integer &dp, const Integer &dq, const Integer &u) - {m_n = n; m_e = e; m_d = d; m_p = p; m_q = q; m_dp = dp; m_dq = dq; m_u = u;} - //! factor n given private exponent - void Initialize(const Integer &n, const Integer &e, const Integer &d); - - // PKCS8PrivateKey - void BERDecode(BufferedTransformation &bt) - {PKCS8PrivateKey::BERDecode(bt);} - void DEREncode(BufferedTransformation &bt) const - {PKCS8PrivateKey::DEREncode(bt);} - void Load(BufferedTransformation &bt) - {PKCS8PrivateKey::BERDecode(bt);} - void Save(BufferedTransformation &bt) const - {PKCS8PrivateKey::DEREncode(bt);} - OID GetAlgorithmID() const {return RSAFunction::GetAlgorithmID();} - void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size); - void DEREncodePrivateKey(BufferedTransformation &bt) const; - - // TrapdoorFunctionInverse - Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; - - // GeneratableCryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - /*! parameters: (ModulusSize, PublicExponent (default 17)) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - // non-derived interface - const Integer& GetPrime1() const {return m_p;} - const Integer& GetPrime2() const {return m_q;} - const Integer& GetPrivateExponent() const {return m_d;} - const Integer& GetModPrime1PrivateExponent() const {return m_dp;} - const Integer& GetModPrime2PrivateExponent() const {return m_dq;} - const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} - - void SetPrime1(const Integer &p) {m_p = p;} - void SetPrime2(const Integer &q) {m_q = q;} - void SetPrivateExponent(const Integer &d) {m_d = d;} - void SetModPrime1PrivateExponent(const Integer &dp) {m_dp = dp;} - void SetModPrime2PrivateExponent(const Integer &dq) {m_dq = dq;} - void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} - -protected: - Integer m_d, m_p, m_q, m_dp, m_dq, m_u; -}; - -class CRYPTOPP_DLL RSAFunction_ISO : public RSAFunction -{ -public: - Integer ApplyFunction(const Integer &x) const; - Integer PreimageBound() const {return ++(m_n>>1);} -}; - -class CRYPTOPP_DLL InvertibleRSAFunction_ISO : public InvertibleRSAFunction -{ -public: - Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; - Integer PreimageBound() const {return ++(m_n>>1);} -}; - -//! RSA -struct CRYPTOPP_DLL RSA -{ - static const char * CRYPTOPP_API StaticAlgorithmName() {return "RSA";} - typedef RSAFunction PublicKey; - typedef InvertibleRSAFunction PrivateKey; -}; - -//! RSA cryptosystem -template -struct RSAES : public TF_ES -{ -}; - -//! RSA signature scheme with appendix -/*! See documentation of PKCS1v15 for a list of hash functions that can be used with it. */ -template -struct RSASS : public TF_SS -{ -}; - -struct CRYPTOPP_DLL RSA_ISO -{ - static const char * CRYPTOPP_API StaticAlgorithmName() {return "RSA-ISO";} - typedef RSAFunction_ISO PublicKey; - typedef InvertibleRSAFunction_ISO PrivateKey; -}; - -template -struct RSASS_ISO : public TF_SS -{ -}; - -// The two RSA encryption schemes defined in PKCS #1 v2.0 -typedef RSAES::Decryptor RSAES_PKCS1v15_Decryptor; -typedef RSAES::Encryptor RSAES_PKCS1v15_Encryptor; - -typedef RSAES >::Decryptor RSAES_OAEP_SHA_Decryptor; -typedef RSAES >::Encryptor RSAES_OAEP_SHA_Encryptor; - -// The three RSA signature schemes defined in PKCS #1 v2.0 -typedef RSASS::Signer RSASSA_PKCS1v15_SHA_Signer; -typedef RSASS::Verifier RSASSA_PKCS1v15_SHA_Verifier; - -namespace Weak { -typedef RSASS::Signer RSASSA_PKCS1v15_MD2_Signer; -typedef RSASS::Verifier RSASSA_PKCS1v15_MD2_Verifier; - -typedef RSASS::Signer RSASSA_PKCS1v15_MD5_Signer; -typedef RSASS::Verifier RSASSA_PKCS1v15_MD5_Verifier; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rw.cpp b/external/crypto++-5.6.3/rw.cpp deleted file mode 100644 index 3d14d11c8..000000000 --- a/external/crypto++-5.6.3/rw.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// rw.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "rw.h" -#include "asn.h" -#include "integer.h" -#include "nbtheory.h" -#include "modarith.h" - -#ifndef CRYPTOPP_IMPORTS - -NAMESPACE_BEGIN(CryptoPP) - -void RWFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - m_n.BERDecode(seq); - seq.MessageEnd(); -} - -void RWFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_n.DEREncode(seq); - seq.MessageEnd(); -} - -Integer RWFunction::ApplyFunction(const Integer &in) const -{ - DoQuickSanityCheck(); - - Integer out = in.Squared()%m_n; - const word r = 12; - // this code was written to handle both r = 6 and r = 12, - // but now only r = 12 is used in P1363 - const word r2 = r/2; - const word r3a = (16 + 5 - r) % 16; // n%16 could be 5 or 13 - const word r3b = (16 + 13 - r) % 16; - const word r4 = (8 + 5 - r/2) % 8; // n%8 == 5 - switch (out % 16) - { - case r: - break; - case r2: - case r2+8: - out <<= 1; - break; - case r3a: - case r3b: - out.Negate(); - out += m_n; - break; - case r4: - case r4+8: - out.Negate(); - out += m_n; - out <<= 1; - break; - default: - out = Integer::Zero(); - } - return out; -} - -bool RWFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level); - bool pass = true; - pass = pass && m_n > Integer::One() && m_n%8 == 5; - return pass; -} - -bool RWFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) - ; -} - -void RWFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) - ; -} - -// ***************************************************************************** -// private key operations: - -// generate a random private key -void InvertibleRWFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) -{ - int modulusSize = 2048; - alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); - - if (modulusSize < 16) - throw InvalidArgument("InvertibleRWFunction: specified modulus length is too small"); - - AlgorithmParameters primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize); - m_p.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("EquivalentTo", 3)("Mod", 8))); - m_q.GenerateRandom(rng, CombinedNameValuePairs(primeParam, MakeParameters("EquivalentTo", 7)("Mod", 8))); - - m_n = m_p * m_q; - m_u = m_q.InverseMod(m_p); -} - -void InvertibleRWFunction::BERDecode(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - m_n.BERDecode(seq); - m_p.BERDecode(seq); - m_q.BERDecode(seq); - m_u.BERDecode(seq); - seq.MessageEnd(); -} - -void InvertibleRWFunction::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_n.DEREncode(seq); - m_p.DEREncode(seq); - m_q.DEREncode(seq); - m_u.DEREncode(seq); - seq.MessageEnd(); -} - -Integer InvertibleRWFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const -{ - DoQuickSanityCheck(); - ModularArithmetic modn(m_n); - Integer r, rInv; - do { - // do this in a loop for people using small numbers for testing - r.Randomize(rng, Integer::One(), m_n - Integer::One()); - // Fix for CVE-2015-2141. Thanks to Evgeny Sidorov for reporting. - // Squaring to satisfy Jacobi requirements suggested by Jean-Pierre Münch. - r = modn.Square(r); - rInv = modn.MultiplicativeInverse(r); - } while (rInv.IsZero()); - Integer re = modn.Square(r); - re = modn.Multiply(re, x); // blind - - Integer cp=re%m_p, cq=re%m_q; - if (Jacobi(cp, m_p) * Jacobi(cq, m_q) != 1) - { - cp = cp.IsOdd() ? (cp+m_p) >> 1 : cp >> 1; - cq = cq.IsOdd() ? (cq+m_q) >> 1 : cq >> 1; - } - - #pragma omp parallel - #pragma omp sections - { - #pragma omp section - cp = ModularSquareRoot(cp, m_p); - #pragma omp section - cq = ModularSquareRoot(cq, m_q); - } - - Integer y = CRT(cq, m_q, cp, m_p, m_u); - y = modn.Multiply(y, rInv); // unblind - y = STDMIN(y, m_n-y); - if (ApplyFunction(y) != x) // check - throw Exception(Exception::OTHER_ERROR, "InvertibleRWFunction: computational error during private key operation"); - return y; -} - -bool InvertibleRWFunction::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = RWFunction::Validate(rng, level); - pass = pass && m_p > Integer::One() && m_p%8 == 3 && m_p < m_n; - pass = pass && m_q > Integer::One() && m_q%8 == 7 && m_q < m_n; - pass = pass && m_u.IsPositive() && m_u < m_p; - if (level >= 1) - { - pass = pass && m_p * m_q == m_n; - pass = pass && m_u * m_q % m_p == 1; - } - if (level >= 2) - pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); - return pass; -} - -bool InvertibleRWFunction::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_GET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -void InvertibleRWFunction::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime1) - CRYPTOPP_SET_FUNCTION_ENTRY(Prime2) - CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1) - ; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/rw.h b/external/crypto++-5.6.3/rw.h deleted file mode 100644 index 95e6ce798..000000000 --- a/external/crypto++-5.6.3/rw.h +++ /dev/null @@ -1,106 +0,0 @@ -// rw.h - written and placed in the public domain by Wei Dai - -//! \file rw.h -//! \brief Classes for Rabin-Williams signature schemes -//! \details Rabin-Williams signature schemes as defined in IEEE P1363. - -#ifndef CRYPTOPP_RW_H -#define CRYPTOPP_RW_H - - -#include "cryptlib.h" -#include "pubkey.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class CRYPTOPP_DLL RWFunction : public TrapdoorFunction, public PublicKey -{ - typedef RWFunction ThisClass; - -public: - void Initialize(const Integer &n) - {m_n = n;} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - void Save(BufferedTransformation &bt) const - {DEREncode(bt);} - void Load(BufferedTransformation &bt) - {BERDecode(bt);} - - Integer ApplyFunction(const Integer &x) const; - Integer PreimageBound() const {return ++(m_n>>1);} - Integer ImageBound() const {return m_n;} - - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - - const Integer& GetModulus() const {return m_n;} - void SetModulus(const Integer &n) {m_n = n;} - -protected: - Integer m_n; -}; - -//! _ -class CRYPTOPP_DLL InvertibleRWFunction : public RWFunction, public TrapdoorFunctionInverse, public PrivateKey -{ - typedef InvertibleRWFunction ThisClass; - -public: - void Initialize(const Integer &n, const Integer &p, const Integer &q, const Integer &u) - {m_n = n; m_p = p; m_q = q; m_u = u;} - // generate a random private key - void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits) - {GenerateRandomWithKeySize(rng, modulusBits);} - - void BERDecode(BufferedTransformation &bt); - void DEREncode(BufferedTransformation &bt) const; - - void Save(BufferedTransformation &bt) const - {DEREncode(bt);} - void Load(BufferedTransformation &bt) - {BERDecode(bt);} - - Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; - - // GeneratibleCryptoMaterial - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - /*! parameters: (ModulusSize) */ - void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg); - - const Integer& GetPrime1() const {return m_p;} - const Integer& GetPrime2() const {return m_q;} - const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const {return m_u;} - - void SetPrime1(const Integer &p) {m_p = p;} - void SetPrime2(const Integer &q) {m_q = q;} - void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer &u) {m_u = u;} - -protected: - Integer m_p, m_q, m_u; -}; - -//! RW -struct RW -{ - static std::string StaticAlgorithmName() {return "RW";} - typedef RWFunction PublicKey; - typedef InvertibleRWFunction PrivateKey; -}; - -//! RWSS -template -struct RWSS : public TF_SS -{ -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/safer.cpp b/external/crypto++-5.6.3/safer.cpp deleted file mode 100644 index 717fef1df..000000000 --- a/external/crypto++-5.6.3/safer.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// safer.cpp - modified by by Wei Dai from Richard De Moliner's safer.c - -#include "pch.h" -#include "safer.h" -#include "misc.h" -#include "argnames.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4244) -#endif - -NAMESPACE_BEGIN(CryptoPP) - -const byte SAFER::Base::exp_tab[256] = - {1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63, - 8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247, - 64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177, - 255, 167, 62, 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131, - 241, 51, 239, 218, 44, 181, 178, 43, 136, 209, 153, 203, 140, 132, 29, 20, - 129, 151, 113, 202, 95, 163, 139, 87, 60, 130, 196, 82, 92, 28, 232, 160, - 4, 180, 133, 74, 246, 19, 84, 182, 223, 12, 26, 142, 222, 224, 57, 252, - 32, 155, 36, 78, 169, 152, 158, 171, 242, 96, 208, 108, 234, 250, 199, 217, - 0, 212, 31, 110, 67, 188, 236, 83, 137, 254, 122, 93, 73, 201, 50, 194, - 249, 154, 248, 109, 22, 219, 89, 150, 68, 233, 205, 230, 70, 66, 143, 10, - 193, 204, 185, 101, 176, 210, 198, 172, 30, 65, 98, 41, 46, 14, 116, 80, - 2, 90, 195, 37, 123, 138, 42, 91, 240, 6, 13, 71, 111, 112, 157, 126, - 16, 206, 18, 39, 213, 76, 79, 214, 121, 48, 104, 54, 117, 125, 228, 237, - 128, 106, 144, 55, 162, 94, 118, 170, 197, 127, 61, 175, 165, 229, 25, 97, - 253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35, 33, 200, 5, - 225, 102, 221, 179, 88, 105, 99, 86, 15, 161, 49, 149, 23, 7, 58, 40}; - -const byte SAFER::Base::log_tab[256] = - {128, 0, 176, 9, 96, 239, 185, 253, 16, 18, 159, 228, 105, 186, 173, 248, - 192, 56, 194, 101, 79, 6, 148, 252, 25, 222, 106, 27, 93, 78, 168, 130, - 112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37, - 201, 250, 142, 65, 26, 33, 203, 211, 13, 110, 254, 38, 88, 218, 50, 15, - 32, 169, 157, 132, 152, 5, 156, 187, 34, 140, 99, 231, 197, 225, 115, 198, - 175, 36, 91, 135, 102, 39, 247, 87, 244, 150, 177, 183, 92, 139, 213, 84, - 121, 223, 170, 246, 62, 163, 241, 17, 202, 245, 209, 23, 123, 147, 131, 188, - 189, 82, 30, 235, 174, 204, 214, 53, 8, 200, 138, 180, 226, 205, 191, 217, - 208, 80, 89, 63, 77, 98, 52, 10, 72, 136, 181, 86, 76, 46, 107, 158, - 210, 61, 60, 3, 19, 251, 151, 81, 117, 74, 145, 113, 35, 190, 118, 42, - 95, 249, 212, 85, 11, 220, 55, 49, 22, 116, 215, 119, 167, 230, 7, 219, - 164, 47, 70, 243, 97, 69, 103, 227, 12, 162, 59, 28, 133, 24, 4, 29, - 41, 160, 143, 178, 90, 216, 166, 126, 238, 141, 83, 75, 161, 154, 193, 14, - 122, 73, 165, 44, 129, 196, 199, 54, 43, 127, 67, 149, 51, 242, 108, 104, - 109, 240, 2, 40, 206, 221, 155, 234, 94, 153, 124, 20, 134, 207, 229, 66, - 184, 64, 120, 45, 58, 233, 100, 31, 146, 144, 125, 57, 111, 224, 137, 48}; - -#define EXP(x) exp_tab[(x)] -#define LOG(x) log_tab[(x)] -#define PHT(x, y) { y += x; x += y; } -#define IPHT(x, y) { x -= y; y -= x; } - -static const unsigned int BLOCKSIZE = 8; -static const unsigned int MAX_ROUNDS = 13; - -void SAFER::Base::UncheckedSetKey(const byte *userkey_1, unsigned int length, const NameValuePairs ¶ms) -{ - bool strengthened = Strengthened(); - unsigned int nof_rounds = params.GetIntValueWithDefault(Name::Rounds(), length == 8 ? (strengthened ? 8 : 6) : 10); - - const byte *userkey_2 = length == 8 ? userkey_1 : userkey_1 + 8; - keySchedule.New(1 + BLOCKSIZE * (1 + 2 * nof_rounds)); - - unsigned int i, j; - byte *key = keySchedule; - SecByteBlock ka(BLOCKSIZE + 1), kb(BLOCKSIZE + 1); - - if (MAX_ROUNDS < nof_rounds) - nof_rounds = MAX_ROUNDS; - *key++ = (unsigned char)nof_rounds; - ka[BLOCKSIZE] = 0; - kb[BLOCKSIZE] = 0; - for (j = 0; j < BLOCKSIZE; j++) - { - ka[BLOCKSIZE] ^= ka[j] = rotlFixed(userkey_1[j], 5U); - kb[BLOCKSIZE] ^= kb[j] = *key++ = userkey_2[j]; - } - - for (i = 1; i <= nof_rounds; i++) - { - for (j = 0; j < BLOCKSIZE + 1; j++) - { - ka[j] = rotlFixed(ka[j], 6U); - kb[j] = rotlFixed(kb[j], 6U); - } - for (j = 0; j < BLOCKSIZE; j++) - if (strengthened) - *key++ = (ka[(j + 2 * i - 1) % (BLOCKSIZE + 1)] - + exp_tab[exp_tab[18 * i + j + 1]]) & 0xFF; - else - *key++ = (ka[j] + exp_tab[exp_tab[18 * i + j + 1]]) & 0xFF; - for (j = 0; j < BLOCKSIZE; j++) - if (strengthened) - *key++ = (kb[(j + 2 * i) % (BLOCKSIZE + 1)] - + exp_tab[exp_tab[18 * i + j + 10]]) & 0xFF; - else - *key++ = (kb[j] + exp_tab[exp_tab[18 * i + j + 10]]) & 0xFF; - } -} - -typedef BlockGetAndPut Block; - -void SAFER::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - byte a, b, c, d, e, f, g, h, t; - const byte *key = keySchedule+1; - unsigned int round = keySchedule[0]; - - Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); - while(round--) - { - a ^= key[0]; b += key[1]; c += key[2]; d ^= key[3]; - e ^= key[4]; f += key[5]; g += key[6]; h ^= key[7]; - a = EXP(a) + key[ 8]; b = LOG(b) ^ key[ 9]; - c = LOG(c) ^ key[10]; d = EXP(d) + key[11]; - e = EXP(e) + key[12]; f = LOG(f) ^ key[13]; - g = LOG(g) ^ key[14]; h = EXP(h) + key[15]; - key += 16; - PHT(a, b); PHT(c, d); PHT(e, f); PHT(g, h); - PHT(a, c); PHT(e, g); PHT(b, d); PHT(f, h); - PHT(a, e); PHT(b, f); PHT(c, g); PHT(d, h); - t = b; b = e; e = c; c = t; t = d; d = f; f = g; g = t; - } - a ^= key[0]; b += key[1]; c += key[2]; d ^= key[3]; - e ^= key[4]; f += key[5]; g += key[6]; h ^= key[7]; - Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); -} - -void SAFER::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - byte a, b, c, d, e, f, g, h, t; - unsigned int round = keySchedule[0]; - const byte *key = keySchedule + BLOCKSIZE * (1 + 2 * round) - 7; - - Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); - h ^= key[7]; g -= key[6]; f -= key[5]; e ^= key[4]; - d ^= key[3]; c -= key[2]; b -= key[1]; a ^= key[0]; - while (round--) - { - key -= 16; - t = e; e = b; b = c; c = t; t = f; f = d; d = g; g = t; - IPHT(a, e); IPHT(b, f); IPHT(c, g); IPHT(d, h); - IPHT(a, c); IPHT(e, g); IPHT(b, d); IPHT(f, h); - IPHT(a, b); IPHT(c, d); IPHT(e, f); IPHT(g, h); - h -= key[15]; g ^= key[14]; f ^= key[13]; e -= key[12]; - d -= key[11]; c ^= key[10]; b ^= key[9]; a -= key[8]; - h = LOG(h) ^ key[7]; g = EXP(g) - key[6]; - f = EXP(f) - key[5]; e = LOG(e) ^ key[4]; - d = LOG(d) ^ key[3]; c = EXP(c) - key[2]; - b = EXP(b) - key[1]; a = LOG(a) ^ key[0]; - } - Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/safer.h b/external/crypto++-5.6.3/safer.h deleted file mode 100644 index 3f5ec2110..000000000 --- a/external/crypto++-5.6.3/safer.h +++ /dev/null @@ -1,88 +0,0 @@ -// safer.h - written and placed in the public domain by Wei Dai - -//! \file safer.h -//! \brief Classes for the SAFER block cipher - -#ifndef CRYPTOPP_SAFER_H -#define CRYPTOPP_SAFER_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// base class, do not use directly -class SAFER -{ -public: - class CRYPTOPP_NO_VTABLE Base : public BlockCipher - { - public: - unsigned int OptimalDataAlignment() const {return 1;} - void UncheckedSetKey(const byte *userkey, unsigned int length, const NameValuePairs ¶ms); - - protected: - virtual bool Strengthened() const =0; - - SecByteBlock keySchedule; - static const byte exp_tab[256]; - static const byte log_tab[256]; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; -}; - -template -class CRYPTOPP_NO_VTABLE SAFER_Impl : public BlockCipherImpl -{ -protected: - bool Strengthened() const {return STR;} -}; - -//! _ -struct SAFER_K_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13> -{ - static const char *StaticAlgorithmName() {return "SAFER-K";} -}; - -/// SAFER-K -class SAFER_K : public SAFER_K_Info, public SAFER, public BlockCipherDocumentation -{ -public: - typedef BlockCipherFinal > Encryption; - typedef BlockCipherFinal > Decryption; -}; - -//! _ -struct SAFER_SK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13> -{ - static const char *StaticAlgorithmName() {return "SAFER-SK";} -}; - -/// SAFER-SK -class SAFER_SK : public SAFER_SK_Info, public SAFER, public BlockCipherDocumentation -{ -public: - typedef BlockCipherFinal > Encryption; - typedef BlockCipherFinal > Decryption; -}; - -typedef SAFER_K::Encryption SAFER_K_Encryption; -typedef SAFER_K::Decryption SAFER_K_Decryption; - -typedef SAFER_SK::Encryption SAFER_SK_Encryption; -typedef SAFER_SK::Decryption SAFER_SK_Decryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/salsa.cpp b/external/crypto++-5.6.3/salsa.cpp deleted file mode 100644 index 9db2f3957..000000000 --- a/external/crypto++-5.6.3/salsa.cpp +++ /dev/null @@ -1,625 +0,0 @@ -// salsa.cpp - written and placed in the public domain by Wei Dai - -// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM salsa.cpp" to generate MASM code - -#include "pch.h" -#include "config.h" - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#include "salsa.h" -#include "argnames.h" -#include "misc.h" -#include "cpu.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4702 4740) -#endif - -// TODO: work around GCC 4.8+ issue with SSE2 ASM until the exact details are known -// and fix is released. Duplicate with "valgrind ./cryptest.exe tv salsa" -// Clang due to "Inline assembly operands don't work with .intel_syntax" -// https://llvm.org/bugs/show_bug.cgi?id=24232 -#if defined(CRYPTOPP_DISABLE_SALSA_ASM) -# undef CRYPTOPP_X86_ASM_AVAILABLE -# undef CRYPTOPP_X32_ASM_AVAILABLE -# undef CRYPTOPP_X64_ASM_AVAILABLE -# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE -# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 -# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void Salsa20_TestInstantiations() -{ - Salsa20::Encryption x; -} -#endif - -void Salsa20_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) -{ - m_rounds = params.GetIntValueWithDefault(Name::Rounds(), 20); - - if (!(m_rounds == 8 || m_rounds == 12 || m_rounds == 20)) - throw InvalidRounds(Salsa20::StaticAlgorithmName(), m_rounds); - - // m_state is reordered for SSE2 - GetBlock get1(key); - get1(m_state[13])(m_state[10])(m_state[7])(m_state[4]); - GetBlock get2(key + length - 16); - get2(m_state[15])(m_state[12])(m_state[9])(m_state[6]); - - // "expand 16-byte k" or "expand 32-byte k" - m_state[0] = 0x61707865; - m_state[1] = (length == 16) ? 0x3120646e : 0x3320646e; - m_state[2] = (length == 16) ? 0x79622d36 : 0x79622d32; - m_state[3] = 0x6b206574; -} - -void Salsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); - assert(length==8); - - GetBlock get(IV); - get(m_state[14])(m_state[11]); - m_state[8] = m_state[5] = 0; -} - -void Salsa20_Policy::SeekToIteration(lword iterationCount) -{ - m_state[8] = (word32)iterationCount; - m_state[5] = (word32)SafeRightShift<32>(iterationCount); -} - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SALSA_ASM) -unsigned int Salsa20_Policy::GetAlignment() const -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - if (HasSSE2()) - return 16; - else -#endif - return GetAlignmentOf(); -} - -unsigned int Salsa20_Policy::GetOptimalBlockSize() const -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - if (HasSSE2()) - return 4*BYTES_PER_ITERATION; - else -#endif - return BYTES_PER_ITERATION; -} -#endif - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -void Salsa20_OperateKeystream(byte *output, const byte *input, size_t iterationCount, int rounds, void *state); -} -#endif - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code -#endif - -void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) -{ -#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE - Salsa20_OperateKeystream(output, input, iterationCount, m_rounds, m_state.data()); - return; -#endif - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -#ifdef CRYPTOPP_GENERATE_X64_MASM - ALIGN 8 - Salsa20_OperateKeystream PROC FRAME - mov r10, [rsp + 5*8] ; state - alloc_stack(10*16 + 32*16 + 8) - save_xmm128 xmm6, 0200h - save_xmm128 xmm7, 0210h - save_xmm128 xmm8, 0220h - save_xmm128 xmm9, 0230h - save_xmm128 xmm10, 0240h - save_xmm128 xmm11, 0250h - save_xmm128 xmm12, 0260h - save_xmm128 xmm13, 0270h - save_xmm128 xmm14, 0280h - save_xmm128 xmm15, 0290h - .endprolog - - #define REG_output rcx - #define REG_input rdx - #define REG_iterationCount r8 - #define REG_state r10 - #define REG_rounds e9d - #define REG_roundsLeft eax - #define REG_temp32 r11d - #define REG_temp r11 - #define SSE2_WORKSPACE rsp -#else - if (HasSSE2()) - { - #if CRYPTOPP_BOOL_X64 - #define REG_output %1 - #define REG_input %0 - #define REG_iterationCount %2 - #define REG_state %4 /* constant */ - #define REG_rounds %3 /* constant */ - #define REG_roundsLeft eax - #define REG_temp32 edx - #define REG_temp rdx - #define SSE2_WORKSPACE %5 /* constant */ - - CRYPTOPP_ALIGN_DATA(16) byte workspace[16*32]; - #else - #define REG_output edi - #define REG_input eax - #define REG_iterationCount ecx - #define REG_state esi - #define REG_rounds edx - #define REG_roundsLeft ebx - #define REG_temp32 ebp - #define REG_temp ebp - #define SSE2_WORKSPACE esp + WORD_SZ - #endif - - #ifdef __GNUC__ - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS_PUSH_IF86( bx) - #else - void *s = m_state.data(); - word32 r = m_rounds; - - AS2( mov REG_iterationCount, iterationCount) - AS2( mov REG_input, input) - AS2( mov REG_output, output) - AS2( mov REG_state, s) - AS2( mov REG_rounds, r) - #endif -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM - - AS_PUSH_IF86( bp) - AS2( cmp REG_iterationCount, 4) - ASJ( jl, 5, f) - -#if CRYPTOPP_BOOL_X86 - AS2( mov ebx, esp) - AS2( and esp, -16) - AS2( sub esp, 32*16) - AS1( push ebx) -#endif - -#define SSE2_EXPAND_S(i, j) \ - ASS( pshufd xmm4, xmm##i, j, j, j, j) \ - AS2( movdqa [SSE2_WORKSPACE + (i*4+j)*16 + 256], xmm4) - - AS2( movdqa xmm0, [REG_state + 0*16]) - AS2( movdqa xmm1, [REG_state + 1*16]) - AS2( movdqa xmm2, [REG_state + 2*16]) - AS2( movdqa xmm3, [REG_state + 3*16]) - SSE2_EXPAND_S(0, 0) - SSE2_EXPAND_S(0, 1) - SSE2_EXPAND_S(0, 2) - SSE2_EXPAND_S(0, 3) - SSE2_EXPAND_S(1, 0) - SSE2_EXPAND_S(1, 2) - SSE2_EXPAND_S(1, 3) - SSE2_EXPAND_S(2, 1) - SSE2_EXPAND_S(2, 2) - SSE2_EXPAND_S(2, 3) - SSE2_EXPAND_S(3, 0) - SSE2_EXPAND_S(3, 1) - SSE2_EXPAND_S(3, 2) - SSE2_EXPAND_S(3, 3) - -#define SSE2_EXPAND_S85(i) \ - AS2( mov dword ptr [SSE2_WORKSPACE + 8*16 + i*4 + 256], REG_roundsLeft) \ - AS2( mov dword ptr [SSE2_WORKSPACE + 5*16 + i*4 + 256], REG_temp32) \ - AS2( add REG_roundsLeft, 1) \ - AS2( adc REG_temp32, 0) - - ASL(1) - AS2( mov REG_roundsLeft, dword ptr [REG_state + 8*4]) - AS2( mov REG_temp32, dword ptr [REG_state + 5*4]) - SSE2_EXPAND_S85(0) - SSE2_EXPAND_S85(1) - SSE2_EXPAND_S85(2) - SSE2_EXPAND_S85(3) - AS2( mov dword ptr [REG_state + 8*4], REG_roundsLeft) - AS2( mov dword ptr [REG_state + 5*4], REG_temp32) - -#define SSE2_QUARTER_ROUND(a, b, d, i) \ - AS2( movdqa xmm4, xmm##d) \ - AS2( paddd xmm4, xmm##a) \ - AS2( movdqa xmm5, xmm4) \ - AS2( pslld xmm4, i) \ - AS2( psrld xmm5, 32-i) \ - AS2( pxor xmm##b, xmm4) \ - AS2( pxor xmm##b, xmm5) - -#define L01(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##A, [SSE2_WORKSPACE + d*16 + i*256]) /* y3 */ -#define L02(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##C, [SSE2_WORKSPACE + a*16 + i*256]) /* y0 */ -#define L03(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##C) /* y0+y3 */ -#define L04(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##B, xmm##A) -#define L05(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 7) -#define L06(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##B, 32-7) -#define L07(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, [SSE2_WORKSPACE + b*16 + i*256]) -#define L08(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##B) /* z1 */ -#define L09(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + b*16], xmm##A) -#define L10(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##B, xmm##A) -#define L11(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##C) /* z1+y0 */ -#define L12(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##D, xmm##A) -#define L13(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 9) -#define L14(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##D, 32-9) -#define L15(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, [SSE2_WORKSPACE + c*16 + i*256]) -#define L16(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##D) /* z2 */ -#define L17(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + c*16], xmm##A) -#define L18(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##D, xmm##A) -#define L19(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##B) /* z2+z1 */ -#define L20(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##B, xmm##A) -#define L21(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 13) -#define L22(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##B, 32-13) -#define L23(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, [SSE2_WORKSPACE + d*16 + i*256]) -#define L24(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##B) /* z3 */ -#define L25(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + d*16], xmm##A) -#define L26(A,B,C,D,a,b,c,d,i) AS2( paddd xmm##A, xmm##D) /* z3+z2 */ -#define L27(A,B,C,D,a,b,c,d,i) AS2( movdqa xmm##D, xmm##A) -#define L28(A,B,C,D,a,b,c,d,i) AS2( pslld xmm##A, 18) -#define L29(A,B,C,D,a,b,c,d,i) AS2( psrld xmm##D, 32-18) -#define L30(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##C) /* xor y0 */ -#define L31(A,B,C,D,a,b,c,d,i) AS2( pxor xmm##A, xmm##D) /* z0 */ -#define L32(A,B,C,D,a,b,c,d,i) AS2( movdqa [SSE2_WORKSPACE + a*16], xmm##A) - -#define SSE2_QUARTER_ROUND_X8(i, a, b, c, d, e, f, g, h) \ - L01(0,1,2,3, a,b,c,d, i) L01(4,5,6,7, e,f,g,h, i) \ - L02(0,1,2,3, a,b,c,d, i) L02(4,5,6,7, e,f,g,h, i) \ - L03(0,1,2,3, a,b,c,d, i) L03(4,5,6,7, e,f,g,h, i) \ - L04(0,1,2,3, a,b,c,d, i) L04(4,5,6,7, e,f,g,h, i) \ - L05(0,1,2,3, a,b,c,d, i) L05(4,5,6,7, e,f,g,h, i) \ - L06(0,1,2,3, a,b,c,d, i) L06(4,5,6,7, e,f,g,h, i) \ - L07(0,1,2,3, a,b,c,d, i) L07(4,5,6,7, e,f,g,h, i) \ - L08(0,1,2,3, a,b,c,d, i) L08(4,5,6,7, e,f,g,h, i) \ - L09(0,1,2,3, a,b,c,d, i) L09(4,5,6,7, e,f,g,h, i) \ - L10(0,1,2,3, a,b,c,d, i) L10(4,5,6,7, e,f,g,h, i) \ - L11(0,1,2,3, a,b,c,d, i) L11(4,5,6,7, e,f,g,h, i) \ - L12(0,1,2,3, a,b,c,d, i) L12(4,5,6,7, e,f,g,h, i) \ - L13(0,1,2,3, a,b,c,d, i) L13(4,5,6,7, e,f,g,h, i) \ - L14(0,1,2,3, a,b,c,d, i) L14(4,5,6,7, e,f,g,h, i) \ - L15(0,1,2,3, a,b,c,d, i) L15(4,5,6,7, e,f,g,h, i) \ - L16(0,1,2,3, a,b,c,d, i) L16(4,5,6,7, e,f,g,h, i) \ - L17(0,1,2,3, a,b,c,d, i) L17(4,5,6,7, e,f,g,h, i) \ - L18(0,1,2,3, a,b,c,d, i) L18(4,5,6,7, e,f,g,h, i) \ - L19(0,1,2,3, a,b,c,d, i) L19(4,5,6,7, e,f,g,h, i) \ - L20(0,1,2,3, a,b,c,d, i) L20(4,5,6,7, e,f,g,h, i) \ - L21(0,1,2,3, a,b,c,d, i) L21(4,5,6,7, e,f,g,h, i) \ - L22(0,1,2,3, a,b,c,d, i) L22(4,5,6,7, e,f,g,h, i) \ - L23(0,1,2,3, a,b,c,d, i) L23(4,5,6,7, e,f,g,h, i) \ - L24(0,1,2,3, a,b,c,d, i) L24(4,5,6,7, e,f,g,h, i) \ - L25(0,1,2,3, a,b,c,d, i) L25(4,5,6,7, e,f,g,h, i) \ - L26(0,1,2,3, a,b,c,d, i) L26(4,5,6,7, e,f,g,h, i) \ - L27(0,1,2,3, a,b,c,d, i) L27(4,5,6,7, e,f,g,h, i) \ - L28(0,1,2,3, a,b,c,d, i) L28(4,5,6,7, e,f,g,h, i) \ - L29(0,1,2,3, a,b,c,d, i) L29(4,5,6,7, e,f,g,h, i) \ - L30(0,1,2,3, a,b,c,d, i) L30(4,5,6,7, e,f,g,h, i) \ - L31(0,1,2,3, a,b,c,d, i) L31(4,5,6,7, e,f,g,h, i) \ - L32(0,1,2,3, a,b,c,d, i) L32(4,5,6,7, e,f,g,h, i) - -#define SSE2_QUARTER_ROUND_X16(i, a, b, c, d, e, f, g, h, A, B, C, D, E, F, G, H) \ - L01(0,1,2,3, a,b,c,d, i) L01(4,5,6,7, e,f,g,h, i) L01(8,9,10,11, A,B,C,D, i) L01(12,13,14,15, E,F,G,H, i) \ - L02(0,1,2,3, a,b,c,d, i) L02(4,5,6,7, e,f,g,h, i) L02(8,9,10,11, A,B,C,D, i) L02(12,13,14,15, E,F,G,H, i) \ - L03(0,1,2,3, a,b,c,d, i) L03(4,5,6,7, e,f,g,h, i) L03(8,9,10,11, A,B,C,D, i) L03(12,13,14,15, E,F,G,H, i) \ - L04(0,1,2,3, a,b,c,d, i) L04(4,5,6,7, e,f,g,h, i) L04(8,9,10,11, A,B,C,D, i) L04(12,13,14,15, E,F,G,H, i) \ - L05(0,1,2,3, a,b,c,d, i) L05(4,5,6,7, e,f,g,h, i) L05(8,9,10,11, A,B,C,D, i) L05(12,13,14,15, E,F,G,H, i) \ - L06(0,1,2,3, a,b,c,d, i) L06(4,5,6,7, e,f,g,h, i) L06(8,9,10,11, A,B,C,D, i) L06(12,13,14,15, E,F,G,H, i) \ - L07(0,1,2,3, a,b,c,d, i) L07(4,5,6,7, e,f,g,h, i) L07(8,9,10,11, A,B,C,D, i) L07(12,13,14,15, E,F,G,H, i) \ - L08(0,1,2,3, a,b,c,d, i) L08(4,5,6,7, e,f,g,h, i) L08(8,9,10,11, A,B,C,D, i) L08(12,13,14,15, E,F,G,H, i) \ - L09(0,1,2,3, a,b,c,d, i) L09(4,5,6,7, e,f,g,h, i) L09(8,9,10,11, A,B,C,D, i) L09(12,13,14,15, E,F,G,H, i) \ - L10(0,1,2,3, a,b,c,d, i) L10(4,5,6,7, e,f,g,h, i) L10(8,9,10,11, A,B,C,D, i) L10(12,13,14,15, E,F,G,H, i) \ - L11(0,1,2,3, a,b,c,d, i) L11(4,5,6,7, e,f,g,h, i) L11(8,9,10,11, A,B,C,D, i) L11(12,13,14,15, E,F,G,H, i) \ - L12(0,1,2,3, a,b,c,d, i) L12(4,5,6,7, e,f,g,h, i) L12(8,9,10,11, A,B,C,D, i) L12(12,13,14,15, E,F,G,H, i) \ - L13(0,1,2,3, a,b,c,d, i) L13(4,5,6,7, e,f,g,h, i) L13(8,9,10,11, A,B,C,D, i) L13(12,13,14,15, E,F,G,H, i) \ - L14(0,1,2,3, a,b,c,d, i) L14(4,5,6,7, e,f,g,h, i) L14(8,9,10,11, A,B,C,D, i) L14(12,13,14,15, E,F,G,H, i) \ - L15(0,1,2,3, a,b,c,d, i) L15(4,5,6,7, e,f,g,h, i) L15(8,9,10,11, A,B,C,D, i) L15(12,13,14,15, E,F,G,H, i) \ - L16(0,1,2,3, a,b,c,d, i) L16(4,5,6,7, e,f,g,h, i) L16(8,9,10,11, A,B,C,D, i) L16(12,13,14,15, E,F,G,H, i) \ - L17(0,1,2,3, a,b,c,d, i) L17(4,5,6,7, e,f,g,h, i) L17(8,9,10,11, A,B,C,D, i) L17(12,13,14,15, E,F,G,H, i) \ - L18(0,1,2,3, a,b,c,d, i) L18(4,5,6,7, e,f,g,h, i) L18(8,9,10,11, A,B,C,D, i) L18(12,13,14,15, E,F,G,H, i) \ - L19(0,1,2,3, a,b,c,d, i) L19(4,5,6,7, e,f,g,h, i) L19(8,9,10,11, A,B,C,D, i) L19(12,13,14,15, E,F,G,H, i) \ - L20(0,1,2,3, a,b,c,d, i) L20(4,5,6,7, e,f,g,h, i) L20(8,9,10,11, A,B,C,D, i) L20(12,13,14,15, E,F,G,H, i) \ - L21(0,1,2,3, a,b,c,d, i) L21(4,5,6,7, e,f,g,h, i) L21(8,9,10,11, A,B,C,D, i) L21(12,13,14,15, E,F,G,H, i) \ - L22(0,1,2,3, a,b,c,d, i) L22(4,5,6,7, e,f,g,h, i) L22(8,9,10,11, A,B,C,D, i) L22(12,13,14,15, E,F,G,H, i) \ - L23(0,1,2,3, a,b,c,d, i) L23(4,5,6,7, e,f,g,h, i) L23(8,9,10,11, A,B,C,D, i) L23(12,13,14,15, E,F,G,H, i) \ - L24(0,1,2,3, a,b,c,d, i) L24(4,5,6,7, e,f,g,h, i) L24(8,9,10,11, A,B,C,D, i) L24(12,13,14,15, E,F,G,H, i) \ - L25(0,1,2,3, a,b,c,d, i) L25(4,5,6,7, e,f,g,h, i) L25(8,9,10,11, A,B,C,D, i) L25(12,13,14,15, E,F,G,H, i) \ - L26(0,1,2,3, a,b,c,d, i) L26(4,5,6,7, e,f,g,h, i) L26(8,9,10,11, A,B,C,D, i) L26(12,13,14,15, E,F,G,H, i) \ - L27(0,1,2,3, a,b,c,d, i) L27(4,5,6,7, e,f,g,h, i) L27(8,9,10,11, A,B,C,D, i) L27(12,13,14,15, E,F,G,H, i) \ - L28(0,1,2,3, a,b,c,d, i) L28(4,5,6,7, e,f,g,h, i) L28(8,9,10,11, A,B,C,D, i) L28(12,13,14,15, E,F,G,H, i) \ - L29(0,1,2,3, a,b,c,d, i) L29(4,5,6,7, e,f,g,h, i) L29(8,9,10,11, A,B,C,D, i) L29(12,13,14,15, E,F,G,H, i) \ - L30(0,1,2,3, a,b,c,d, i) L30(4,5,6,7, e,f,g,h, i) L30(8,9,10,11, A,B,C,D, i) L30(12,13,14,15, E,F,G,H, i) \ - L31(0,1,2,3, a,b,c,d, i) L31(4,5,6,7, e,f,g,h, i) L31(8,9,10,11, A,B,C,D, i) L31(12,13,14,15, E,F,G,H, i) \ - L32(0,1,2,3, a,b,c,d, i) L32(4,5,6,7, e,f,g,h, i) L32(8,9,10,11, A,B,C,D, i) L32(12,13,14,15, E,F,G,H, i) - -#if CRYPTOPP_BOOL_X64 - SSE2_QUARTER_ROUND_X16(1, 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15) -#else - SSE2_QUARTER_ROUND_X8(1, 2, 6, 10, 14, 3, 7, 11, 15) - SSE2_QUARTER_ROUND_X8(1, 0, 4, 8, 12, 1, 5, 9, 13) -#endif - AS2( mov REG_roundsLeft, REG_rounds) - ASJ( jmp, 2, f) - - ASL(SSE2_Salsa_Output) - AS2( movdqa xmm0, xmm4) - AS2( punpckldq xmm4, xmm5) - AS2( movdqa xmm1, xmm6) - AS2( punpckldq xmm6, xmm7) - AS2( movdqa xmm2, xmm4) - AS2( punpcklqdq xmm4, xmm6) // e - AS2( punpckhqdq xmm2, xmm6) // f - AS2( punpckhdq xmm0, xmm5) - AS2( punpckhdq xmm1, xmm7) - AS2( movdqa xmm6, xmm0) - AS2( punpcklqdq xmm0, xmm1) // g - AS2( punpckhqdq xmm6, xmm1) // h - AS_XMM_OUTPUT4(SSE2_Salsa_Output_A, REG_input, REG_output, 4, 2, 0, 6, 1, 0, 4, 8, 12, 1) - AS1( ret) - - ASL(6) -#if CRYPTOPP_BOOL_X64 - SSE2_QUARTER_ROUND_X16(0, 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15) - ASL(2) - SSE2_QUARTER_ROUND_X16(0, 0, 13, 10, 7, 1, 14, 11, 4, 2, 15, 8, 5, 3, 12, 9, 6) -#else - SSE2_QUARTER_ROUND_X8(0, 2, 6, 10, 14, 3, 7, 11, 15) - SSE2_QUARTER_ROUND_X8(0, 0, 4, 8, 12, 1, 5, 9, 13) - ASL(2) - SSE2_QUARTER_ROUND_X8(0, 2, 15, 8, 5, 3, 12, 9, 6) - SSE2_QUARTER_ROUND_X8(0, 0, 13, 10, 7, 1, 14, 11, 4) -#endif - AS2( sub REG_roundsLeft, 2) - ASJ( jnz, 6, b) - -#define SSE2_OUTPUT_4(a, b, c, d) \ - AS2( movdqa xmm4, [SSE2_WORKSPACE + a*16 + 256])\ - AS2( paddd xmm4, [SSE2_WORKSPACE + a*16])\ - AS2( movdqa xmm5, [SSE2_WORKSPACE + b*16 + 256])\ - AS2( paddd xmm5, [SSE2_WORKSPACE + b*16])\ - AS2( movdqa xmm6, [SSE2_WORKSPACE + c*16 + 256])\ - AS2( paddd xmm6, [SSE2_WORKSPACE + c*16])\ - AS2( movdqa xmm7, [SSE2_WORKSPACE + d*16 + 256])\ - AS2( paddd xmm7, [SSE2_WORKSPACE + d*16])\ - ASC( call, SSE2_Salsa_Output) - - SSE2_OUTPUT_4(0, 13, 10, 7) - SSE2_OUTPUT_4(4, 1, 14, 11) - SSE2_OUTPUT_4(8, 5, 2, 15) - SSE2_OUTPUT_4(12, 9, 6, 3) - AS2( test REG_input, REG_input) - ASJ( jz, 9, f) - AS2( add REG_input, 12*16) - ASL(9) - AS2( add REG_output, 12*16) - AS2( sub REG_iterationCount, 4) - AS2( cmp REG_iterationCount, 4) - ASJ( jge, 1, b) - AS_POP_IF86( sp) - - ASL(5) - AS2( sub REG_iterationCount, 1) - ASJ( jl, 4, f) - AS2( movdqa xmm0, [REG_state + 0*16]) - AS2( movdqa xmm1, [REG_state + 1*16]) - AS2( movdqa xmm2, [REG_state + 2*16]) - AS2( movdqa xmm3, [REG_state + 3*16]) - AS2( mov REG_roundsLeft, REG_rounds) - - ASL(0) - SSE2_QUARTER_ROUND(0, 1, 3, 7) - SSE2_QUARTER_ROUND(1, 2, 0, 9) - SSE2_QUARTER_ROUND(2, 3, 1, 13) - SSE2_QUARTER_ROUND(3, 0, 2, 18) - ASS( pshufd xmm1, xmm1, 2, 1, 0, 3) - ASS( pshufd xmm2, xmm2, 1, 0, 3, 2) - ASS( pshufd xmm3, xmm3, 0, 3, 2, 1) - SSE2_QUARTER_ROUND(0, 3, 1, 7) - SSE2_QUARTER_ROUND(3, 2, 0, 9) - SSE2_QUARTER_ROUND(2, 1, 3, 13) - SSE2_QUARTER_ROUND(1, 0, 2, 18) - ASS( pshufd xmm1, xmm1, 0, 3, 2, 1) - ASS( pshufd xmm2, xmm2, 1, 0, 3, 2) - ASS( pshufd xmm3, xmm3, 2, 1, 0, 3) - AS2( sub REG_roundsLeft, 2) - ASJ( jnz, 0, b) - - AS2( paddd xmm0, [REG_state + 0*16]) - AS2( paddd xmm1, [REG_state + 1*16]) - AS2( paddd xmm2, [REG_state + 2*16]) - AS2( paddd xmm3, [REG_state + 3*16]) - - AS2( add dword ptr [REG_state + 8*4], 1) - AS2( adc dword ptr [REG_state + 5*4], 0) - - AS2( pcmpeqb xmm6, xmm6) // all ones - AS2( psrlq xmm6, 32) // lo32 mask - ASS( pshufd xmm7, xmm6, 0, 1, 2, 3) // hi32 mask - AS2( movdqa xmm4, xmm0) - AS2( movdqa xmm5, xmm3) - AS2( pand xmm0, xmm7) - AS2( pand xmm4, xmm6) - AS2( pand xmm3, xmm6) - AS2( pand xmm5, xmm7) - AS2( por xmm4, xmm5) // 0,13,2,15 - AS2( movdqa xmm5, xmm1) - AS2( pand xmm1, xmm7) - AS2( pand xmm5, xmm6) - AS2( por xmm0, xmm5) // 4,1,6,3 - AS2( pand xmm6, xmm2) - AS2( pand xmm2, xmm7) - AS2( por xmm1, xmm6) // 8,5,10,7 - AS2( por xmm2, xmm3) // 12,9,14,11 - - AS2( movdqa xmm5, xmm4) - AS2( movdqa xmm6, xmm0) - AS3( shufpd xmm4, xmm1, 2) // 0,13,10,7 - AS3( shufpd xmm0, xmm2, 2) // 4,1,14,11 - AS3( shufpd xmm1, xmm5, 2) // 8,5,2,15 - AS3( shufpd xmm2, xmm6, 2) // 12,9,6,3 - - // output keystream - AS_XMM_OUTPUT4(SSE2_Salsa_Output_B, REG_input, REG_output, 4, 0, 1, 2, 3, 0, 1, 2, 3, 4) - ASJ( jmp, 5, b) - ASL(4) - - AS_POP_IF86( bp) -#ifdef __GNUC__ - AS_POP_IF86( bx) - ATT_PREFIX - #if CRYPTOPP_BOOL_X64 - : "+r" (input), "+r" (output), "+r" (iterationCount) - : "r" (m_rounds), "r" (m_state.m_ptr), "r" (workspace) - : "%eax", "%rdx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" - #else - : "+a" (input), "+D" (output), "+c" (iterationCount) - : "d" (m_rounds), "S" (m_state.m_ptr) - : "memory", "cc" - #endif - ); -#endif -#ifdef CRYPTOPP_GENERATE_X64_MASM - movdqa xmm6, [rsp + 0200h] - movdqa xmm7, [rsp + 0210h] - movdqa xmm8, [rsp + 0220h] - movdqa xmm9, [rsp + 0230h] - movdqa xmm10, [rsp + 0240h] - movdqa xmm11, [rsp + 0250h] - movdqa xmm12, [rsp + 0260h] - movdqa xmm13, [rsp + 0270h] - movdqa xmm14, [rsp + 0280h] - movdqa xmm15, [rsp + 0290h] - add rsp, 10*16 + 32*16 + 8 - ret -Salsa20_OperateKeystream ENDP -#else - } - else -#endif -#endif -#ifndef CRYPTOPP_GENERATE_X64_MASM - { - word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - - while (iterationCount--) - { - x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3]; - x4 = m_state[4]; x5 = m_state[5]; x6 = m_state[6]; x7 = m_state[7]; - x8 = m_state[8]; x9 = m_state[9]; x10 = m_state[10]; x11 = m_state[11]; - x12 = m_state[12]; x13 = m_state[13]; x14 = m_state[14]; x15 = m_state[15]; - - for (int i=m_rounds; i>0; i-=2) - { - #define QUARTER_ROUND(a, b, c, d) \ - b = b ^ rotlFixed(a + d, 7); \ - c = c ^ rotlFixed(b + a, 9); \ - d = d ^ rotlFixed(c + b, 13); \ - a = a ^ rotlFixed(d + c, 18); - - QUARTER_ROUND(x0, x4, x8, x12) - QUARTER_ROUND(x1, x5, x9, x13) - QUARTER_ROUND(x2, x6, x10, x14) - QUARTER_ROUND(x3, x7, x11, x15) - - QUARTER_ROUND(x0, x13, x10, x7) - QUARTER_ROUND(x1, x14, x11, x4) - QUARTER_ROUND(x2, x15, x8, x5) - QUARTER_ROUND(x3, x12, x9, x6) - } - - #define SALSA_OUTPUT(x) {\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, x0 + m_state[0]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, x13 + m_state[13]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, x10 + m_state[10]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, x7 + m_state[7]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 4, x4 + m_state[4]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 5, x1 + m_state[1]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 6, x14 + m_state[14]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 7, x11 + m_state[11]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 8, x8 + m_state[8]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 9, x5 + m_state[5]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 10, x2 + m_state[2]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 11, x15 + m_state[15]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 12, x12 + m_state[12]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 13, x9 + m_state[9]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 14, x6 + m_state[6]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 15, x3 + m_state[3]);} - -#ifndef CRYPTOPP_DOXYGEN_PROCESSING - CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SALSA_OUTPUT, BYTES_PER_ITERATION); -#endif - - if (++m_state[8] == 0) - ++m_state[5]; - } - } -} // see comment above if an internal compiler error occurs here - -void XSalsa20_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) -{ - m_rounds = params.GetIntValueWithDefault(Name::Rounds(), 20); - - if (!(m_rounds == 8 || m_rounds == 12 || m_rounds == 20)) - throw InvalidRounds(XSalsa20::StaticAlgorithmName(), m_rounds); - - GetUserKey(LITTLE_ENDIAN_ORDER, m_key.begin(), m_key.size(), key, length); - if (length == 16) - memcpy(m_key.begin()+4, m_key.begin(), 16); - - // "expand 32-byte k" - m_state[0] = 0x61707865; - m_state[1] = 0x3320646e; - m_state[2] = 0x79622d32; - m_state[3] = 0x6b206574; -} - -void XSalsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length); - assert(length==24); - - word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - - GetBlock get(IV); - get(x14)(x11)(x8)(x5)(m_state[14])(m_state[11]); - - x13 = m_key[0]; x10 = m_key[1]; x7 = m_key[2]; x4 = m_key[3]; - x15 = m_key[4]; x12 = m_key[5]; x9 = m_key[6]; x6 = m_key[7]; - x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3]; - - for (int i=m_rounds; i>0; i-=2) - { - QUARTER_ROUND(x0, x4, x8, x12) - QUARTER_ROUND(x1, x5, x9, x13) - QUARTER_ROUND(x2, x6, x10, x14) - QUARTER_ROUND(x3, x7, x11, x15) - - QUARTER_ROUND(x0, x13, x10, x7) - QUARTER_ROUND(x1, x14, x11, x4) - QUARTER_ROUND(x2, x15, x8, x5) - QUARTER_ROUND(x3, x12, x9, x6) - } - - m_state[13] = x0; m_state[10] = x1; m_state[7] = x2; m_state[4] = x3; - m_state[15] = x14; m_state[12] = x11; m_state[9] = x8; m_state[6] = x5; - m_state[8] = m_state[5] = 0; -} - -NAMESPACE_END - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM diff --git a/external/crypto++-5.6.3/salsa.h b/external/crypto++-5.6.3/salsa.h deleted file mode 100644 index 92dd0fb50..000000000 --- a/external/crypto++-5.6.3/salsa.h +++ /dev/null @@ -1,84 +0,0 @@ -// salsa.h - written and placed in the public domain by Wei Dai - -//! \file salsa.h -//! \brief Classes for Salsa and Salsa20 stream ciphers - -#ifndef CRYPTOPP_SALSA_H -#define CRYPTOPP_SALSA_H - -#include "strciphr.h" -#include "secblock.h" - -// TODO: work around GCC 4.8+ issue with SSE2 ASM until the exact details are known -// and fix is released. Duplicate with "valgrind ./cryptest.exe tv salsa" -// "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 -#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) || (CRYPTOPP_GCC_VERSION >= 40800) -# define CRYPTOPP_DISABLE_SALSA_ASM -#endif - -NAMESPACE_BEGIN(CryptoPP) - -//! \class Salsa20_Info -//! \brief Salsa block cipher information -struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8> -{ - static const char *StaticAlgorithmName() {return "Salsa20";} -}; - -class CRYPTOPP_NO_VTABLE Salsa20_Policy : public AdditiveCipherConcretePolicy -{ -protected: - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); - void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); - bool CipherIsRandomAccess() const {return true;} - void SeekToIteration(lword iterationCount); -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SALSA_ASM) - unsigned int GetAlignment() const; - unsigned int GetOptimalBlockSize() const; -#endif - - FixedSizeAlignedSecBlock m_state; - int m_rounds; -}; - -// Salsa20, variable rounds: 8, 12 or 20 (default 20) -//! \class Salsa20 -//! \brief Salsa20 block cipher information -//! \details Salsa20 provides a variable number of rounds: 8, 12 or 20. The default number of rounds is 20. -struct Salsa20 : public Salsa20_Info, public SymmetricCipherDocumentation -{ - typedef SymmetricCipherFinal >, Salsa20_Info> Encryption; - typedef Encryption Decryption; -}; - -//! \class XSalsa20_Info -//! \brief XSalsa20 block cipher information -struct XSalsa20_Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 24> -{ - static const char *StaticAlgorithmName() {return "XSalsa20";} -}; - -class CRYPTOPP_NO_VTABLE XSalsa20_Policy : public Salsa20_Policy -{ -public: - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); - -protected: - FixedSizeSecBlock m_key; -}; - -// XSalsa20, variable rounds: 8, 12 or 20 (default 20) -//! \class XSalsa20 -//! \brief XSalsa20 block cipher information -//! \details XSalsa20 provides a variable number of rounds: 8, 12 or 20. The default number of rounds is 20. -struct XSalsa20 : public XSalsa20_Info, public SymmetricCipherDocumentation -{ - typedef SymmetricCipherFinal >, XSalsa20_Info> Encryption; - typedef Encryption Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/seal.cpp b/external/crypto++-5.6.3/seal.cpp deleted file mode 100644 index 7ec9775ab..000000000 --- a/external/crypto++-5.6.3/seal.cpp +++ /dev/null @@ -1,219 +0,0 @@ -// seal.cpp - written and placed in the public domain by Wei Dai -// updated to SEAL 3.0 by Leonard Janke - -#include "pch.h" - -#include "seal.h" -#include "sha.h" -#include "misc.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void SEAL_TestInstantiations() -{ - SEAL<>::Encryption x; -} -#endif - -struct SEAL_Gamma -{ - SEAL_Gamma(const byte *key) - : H(5), Z(5), D(16), lastIndex(0xffffffff) - { - GetUserKey(BIG_ENDIAN_ORDER, H.begin(), 5, key, 20); - memset(D, 0, 64); - } - - word32 Apply(word32 i); - - SecBlock H, Z, D; - word32 lastIndex; -}; - -word32 SEAL_Gamma::Apply(word32 i) -{ - word32 shaIndex = i/5; - if (shaIndex != lastIndex) - { - memcpy(Z, H, 20); - D[0] = shaIndex; - SHA::Transform(Z, D); - lastIndex = shaIndex; - } - return Z[i%5]; -} - -template -void SEAL_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) -{ - CRYPTOPP_UNUSED(length); - m_insideCounter = m_outsideCounter = m_startCount = 0; - - unsigned int L = params.GetIntValueWithDefault("NumberOfOutputBitsPerPositionIndex", 32*1024); - m_iterationsPerCount = L / 8192; - - SEAL_Gamma gamma(key); - unsigned int i; - - for (i=0; i<512; i++) - m_T[i] = gamma.Apply(i); - - for (i=0; i<256; i++) - m_S[i] = gamma.Apply(0x1000+i); - - m_R.New(4*(L/8192)); - - for (i=0; i -void SEAL_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(IV), CRYPTOPP_UNUSED(length); - assert(length==4); - - m_outsideCounter = IV ? GetWord(false, BIG_ENDIAN_ORDER, IV) : 0; - m_startCount = m_outsideCounter; - m_insideCounter = 0; -} - -template -void SEAL_Policy::SeekToIteration(lword iterationCount) -{ - m_outsideCounter = m_startCount + (unsigned int)(iterationCount / m_iterationsPerCount); - m_insideCounter = (unsigned int)(iterationCount % m_iterationsPerCount); -} - -template -void SEAL_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) -{ - word32 a, b, c, d, n1, n2, n3, n4; - unsigned int p, q; - - for (size_t iteration = 0; iteration < iterationCount; ++iteration) - { -#define Ttab(x) *(word32 *)((byte *)m_T.begin()+x) - - a = m_outsideCounter ^ m_R[4*m_insideCounter]; - b = rotrFixed(m_outsideCounter, 8U) ^ m_R[4*m_insideCounter+1]; - c = rotrFixed(m_outsideCounter, 16U) ^ m_R[4*m_insideCounter+2]; - d = rotrFixed(m_outsideCounter, 24U) ^ m_R[4*m_insideCounter+3]; - - for (unsigned int j=0; j<2; j++) - { - p = a & 0x7fc; - b += Ttab(p); - a = rotrFixed(a, 9U); - - p = b & 0x7fc; - c += Ttab(p); - b = rotrFixed(b, 9U); - - p = c & 0x7fc; - d += Ttab(p); - c = rotrFixed(c, 9U); - - p = d & 0x7fc; - a += Ttab(p); - d = rotrFixed(d, 9U); - } - - n1 = d, n2 = b, n3 = a, n4 = c; - - p = a & 0x7fc; - b += Ttab(p); - a = rotrFixed(a, 9U); - - p = b & 0x7fc; - c += Ttab(p); - b = rotrFixed(b, 9U); - - p = c & 0x7fc; - d += Ttab(p); - c = rotrFixed(c, 9U); - - p = d & 0x7fc; - a += Ttab(p); - d = rotrFixed(d, 9U); - - // generate 8192 bits - for (unsigned int i=0; i<64; i++) - { - p = a & 0x7fc; - a = rotrFixed(a, 9U); - b += Ttab(p); - b ^= a; - - q = b & 0x7fc; - b = rotrFixed(b, 9U); - c ^= Ttab(q); - c += b; - - p = (p+c) & 0x7fc; - c = rotrFixed(c, 9U); - d += Ttab(p); - d ^= c; - - q = (q+d) & 0x7fc; - d = rotrFixed(d, 9U); - a ^= Ttab(q); - a += d; - - p = (p+a) & 0x7fc; - b ^= Ttab(p); - a = rotrFixed(a, 9U); - - q = (q+b) & 0x7fc; - c += Ttab(q); - b = rotrFixed(b, 9U); - - p = (p+c) & 0x7fc; - d ^= Ttab(p); - c = rotrFixed(c, 9U); - - q = (q+d) & 0x7fc; - d = rotrFixed(d, 9U); - a += Ttab(q); - -#define SEAL_OUTPUT(x) \ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, b + m_S[4*i+0]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, c ^ m_S[4*i+1]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, d + m_S[4*i+2]);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a ^ m_S[4*i+3]); - - CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SEAL_OUTPUT, 4*4); - - if (i & 1) - { - a += n3; - b += n4; - c ^= n3; - d ^= n4; - } - else - { - a += n1; - b += n2; - c ^= n1; - d ^= n2; - } - } - - if (++m_insideCounter == m_iterationsPerCount) - { - ++m_outsideCounter; - m_insideCounter = 0; - } - } - - a = b = c = d = n1 = n2 = n3 = n4 = 0; - p = q = 0; -} - -template class SEAL_Policy; -template class SEAL_Policy; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/seal.h b/external/crypto++-5.6.3/seal.h deleted file mode 100644 index 386eeb2a0..000000000 --- a/external/crypto++-5.6.3/seal.h +++ /dev/null @@ -1,50 +0,0 @@ -// seal.h - written and placed in the public domain by Wei Dai - -//! \file seal.h -//! \brief Classes for SEAL stream cipher - -#ifndef CRYPTOPP_SEAL_H -#define CRYPTOPP_SEAL_H - -#include "strciphr.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -template -struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4> -{ - static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";} -}; - -template -class CRYPTOPP_NO_VTABLE SEAL_Policy : public AdditiveCipherConcretePolicy, public SEAL_Info -{ -protected: - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); - void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); - bool CipherIsRandomAccess() const {return true;} - void SeekToIteration(lword iterationCount); - -private: - FixedSizeSecBlock m_T; - FixedSizeSecBlock m_S; - SecBlock m_R; - - word32 m_startCount, m_iterationsPerCount; - word32 m_outsideCounter, m_insideCounter; -}; - -//! SEAL -template -struct SEAL : public SEAL_Info, public SymmetricCipherDocumentation -{ - typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, SEAL_Info > Encryption; - typedef Encryption Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/secblock.h b/external/crypto++-5.6.3/secblock.h deleted file mode 100644 index ef8cab103..000000000 --- a/external/crypto++-5.6.3/secblock.h +++ /dev/null @@ -1,804 +0,0 @@ -// secblock.h - written and placed in the public domain by Wei Dai - -//! \file secblock.h -//! \brief Classes and functions for secure memory allocations. - -#ifndef CRYPTOPP_SECBLOCK_H -#define CRYPTOPP_SECBLOCK_H - -#include "config.h" -#include "stdcpp.h" -#include "misc.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4700) -# if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(disable: 6386) -# endif -#endif - -NAMESPACE_BEGIN(CryptoPP) - -// ************** secure memory allocation *************** - -//! \class AllocatorBase -//! \brief Base class for all allocators used by SecBlock -//! \tparam T the class or type -template -class AllocatorBase -{ -public: - typedef T value_type; - typedef size_t size_type; -#ifdef CRYPTOPP_MSVCRT6 - typedef ptrdiff_t difference_type; -#else - typedef std::ptrdiff_t difference_type; -#endif - typedef T * pointer; - typedef const T * const_pointer; - typedef T & reference; - typedef const T & const_reference; - - pointer address(reference r) const {return (&r);} - const_pointer address(const_reference r) const {return (&r); } - void construct(pointer p, const T& val) {new (p) T(val);} - void destroy(pointer p) {CRYPTOPP_UNUSED(p); p->~T();} - - //! \brief Returns the maximum number of elements the allocator can provide - //! \returns the maximum number of elements the allocator can provide - //! \details Internally, preprocessor macros are used rather than std::numeric_limits - //! because the latter is \a not a \a constexpr. Some compilers, like Clang, do not - //! optimize it well under all circumstances. Compilers like GCC, ICC and MSVC appear - //! to optimize it well in either form. - size_type max_size() const {return (SIZE_MAX/sizeof(T));} - -#if defined(CRYPTOPP_CXX11_VARIADIC_TEMPLATES) || defined(CRYPTOPP_DOXYGEN_PROCESSING) - - //! \brief Constructs a new U using variadic arguments - //! \tparam U the type to be forwarded - //! \tparam Args the arguments to be forwarded - //! \param ptr pointer to type U - //! \param args variadic arguments - //! \details This is a C++11 feature. It is available when CRYPTOPP_CXX11_VARIADIC_TEMPLATES - //! is defined. The define is controlled by compiler versions detected in config.h. - template - void construct(U* ptr, Args&&... args) {::new ((void*)ptr) U(std::forward(args)...);} - - //! \brief Destroys an U constructed with variadic arguments - //! \tparam U the type to be forwarded - //! \details This is a C++11 feature. It is available when CRYPTOPP_CXX11_VARIADIC_TEMPLATES - //! is defined. The define is controlled by compiler versions detected in config.h. - template - void destroy(U* ptr) {if(ptr) ptr->~U();} - -#endif - -protected: - - //! \brief Verifies the allocator can satisfy a request based on size - //! \param size the number of elements - //! \throws InvalidArgument - //! \details CheckSize verifies the number of elements requested is valid. - //! \details If size is greater than max_size(), then InvalidArgument is thrown. - //! The library throws InvalidArgument if the size is too large to satisfy. - //! \details Internally, preprocessor macros are used rather than std::numeric_limits - //! because the latter is \a not a \a constexpr. Some compilers, like Clang, do not - //! optimize it well under all circumstances. Compilers like GCC, ICC and MSVC appear - //! to optimize it well in either form. - //! \note size is the count of elements, and not the number of bytes - static void CheckSize(size_t size) - { - // C++ throws std::bad_alloc (C++03) or std::bad_array_new_length (C++11) here. - if (size > (SIZE_MAX/sizeof(T))) - throw InvalidArgument("AllocatorBase: requested size would cause integer overflow"); - } -}; - -#define CRYPTOPP_INHERIT_ALLOCATOR_TYPES \ -typedef typename AllocatorBase::value_type value_type;\ -typedef typename AllocatorBase::size_type size_type;\ -typedef typename AllocatorBase::difference_type difference_type;\ -typedef typename AllocatorBase::pointer pointer;\ -typedef typename AllocatorBase::const_pointer const_pointer;\ -typedef typename AllocatorBase::reference reference;\ -typedef typename AllocatorBase::const_reference const_reference; - -//! \brief Reallocation function -//! \tparam T the class or type -//! \tparam A the class or type's allocator -//! \param alloc the allocator -//! \param oldPtr the previous allocation -//! \param oldSize the size of the previous allocation -//! \param newSize the new, requested size -//! \param preserve flag that indicates if the old allocation should be preserved -//! \note oldSize and newSize are the count of elements, and not the -//! number of bytes. -template -typename A::pointer StandardReallocate(A& alloc, T *oldPtr, typename A::size_type oldSize, typename A::size_type newSize, bool preserve) -{ - assert((oldPtr && oldSize) || !(oldPtr || oldSize)); - if (oldSize == newSize) - return oldPtr; - - if (preserve) - { - typename A::pointer newPointer = alloc.allocate(newSize, NULL); - const size_t copySize = STDMIN(oldSize, newSize) * sizeof(T); - - if (oldPtr && newPointer) {memcpy_s(newPointer, copySize, oldPtr, copySize);} - alloc.deallocate(oldPtr, oldSize); - return newPointer; - } - else - { - alloc.deallocate(oldPtr, oldSize); - return alloc.allocate(newSize, NULL); - } -} - -//! \class AllocatorWithCleanup -//! \brief Allocates a block of memory with cleanup -//! \tparam T class or type -//! \tparam T_Align16 boolean that determines whether allocations should be aligned on 16-byte boundaries -//! \details If T_Align16 is true, then AllocatorWithCleanup calls AlignedAllocate() -//! for memory allocations. If T_Align16 is false, then AllocatorWithCleanup() calls -//! UnalignedAllocate() for memory allocations. -//! \details Template parameter T_Align16 is effectively controlled by cryptlib.h and mirrors -//! CRYPTOPP_BOOL_ALIGN16. CRYPTOPP_BOOL_ALIGN16 is often used as the template parameter. -template -class AllocatorWithCleanup : public AllocatorBase -{ -public: - CRYPTOPP_INHERIT_ALLOCATOR_TYPES - - //! \brief Allocates a block of memory - //! \param ptr the size of the allocation - //! \param size the size of the allocation - //! \returns a memory block - //! \throws InvalidArgument - //! \details allocate() first checks the size of the request. If it is non-0 - //! and less than max_size(), then an attempt is made to fulfill the request using either - //! AlignedAllocate() or UnalignedAllocate(). - //! \details AlignedAllocate() is used if T_Align16 is true. - //! UnalignedAllocate() used if T_Align16 is false. - //! \details This is the C++ *Placement New* operator. ptr is not used, and the function - //! asserts in Debug builds if ptr is non-NULL. - //! \sa CallNewHandler() for the methods used to recover from a failed - //! allocation attempt. - //! \note size is the count of elements, and not the number of bytes - pointer allocate(size_type size, const void *ptr = NULL) - { - CRYPTOPP_UNUSED(ptr); assert(ptr == NULL); - this->CheckSize(size); - if (size == 0) - return NULL; - -#if CRYPTOPP_BOOL_ALIGN16 - // TODO: should this need the test 'size*sizeof(T) >= 16'? - if (T_Align16 && size*sizeof(T) >= 16) - return (pointer)AlignedAllocate(size*sizeof(T)); -#endif - - return (pointer)UnalignedAllocate(size*sizeof(T)); - } - - //! \brief Deallocates a block of memory - //! \param ptr the size of the allocation - //! \param size the size of the allocation - //! \details Internally, SecureWipeArray() is called before deallocating the memory. - //! Once the memory block is wiped or zeroized, AlignedDeallocate() or - //! UnalignedDeallocate() is called. - //! \details AlignedDeallocate() is used if T_Align16 is true. - //! UnalignedDeallocate() used if T_Align16 is false. - void deallocate(void *ptr, size_type size) - { - assert((ptr && size) || !(ptr || size)); - SecureWipeArray((pointer)ptr, size); - -#if CRYPTOPP_BOOL_ALIGN16 - if (T_Align16 && size*sizeof(T) >= 16) - return AlignedDeallocate(ptr); -#endif - - UnalignedDeallocate(ptr); - } - - //! \brief Reallocates a block of memory - //! \param oldPtr the previous allocation - //! \param oldSize the size of the previous allocation - //! \param newSize the new, requested size - //! \param preserve flag that indicates if the old allocation should be preserved - //! \returns pointer to the new memory block - //! \details Internally, reallocate() calls StandardReallocate(). - //! \details If preserve is true, then index 0 is used to begin copying the - //! old memory block to the new one. If the block grows, then the old array - //! is copied in its entirety. If the block shrinks, then only newSize - //! elements are copied from the old block to the new one. - //! \note oldSize and newSize are the count of elements, and not the - //! number of bytes. - pointer reallocate(T *oldPtr, size_type oldSize, size_type newSize, bool preserve) - { - assert((oldPtr && oldSize) || !(oldPtr || oldSize)); - return StandardReallocate(*this, oldPtr, oldSize, newSize, preserve); - } - - // VS.NET STL enforces the policy of "All STL-compliant allocators have to provide a - // template class member called rebind". - template struct rebind { typedef AllocatorWithCleanup other; }; -#if _MSC_VER >= 1500 - AllocatorWithCleanup() {} - template AllocatorWithCleanup(const AllocatorWithCleanup &) {} -#endif -}; - -CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; -CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; -CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; -CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; -#if CRYPTOPP_BOOL_X86 -CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup; // for Integer -#endif - -//! \class NullAllocator -//! \brief NULL allocator -//! \tparam T class or type -//! \details A NullAllocator is useful for fixed-size, stack based allocations -//! (i.e., static arrays used by FixedSizeAllocatorWithCleanup). -//! \details A NullAllocator always returns 0 for max_size(), and always returns -//! NULL for allocation requests. Though the allocator does not allocate at -//! runtime, it does perform a secure wipe or zeroization during cleanup. -template -class NullAllocator : public AllocatorBase -{ -public: - CRYPTOPP_INHERIT_ALLOCATOR_TYPES - - // TODO: should this return NULL or throw bad_alloc? Non-Windows C++ standard - // libraries always throw. And late mode Windows throws. Early model Windows - // (circa VC++ 6.0) returned NULL. - pointer allocate(size_type n, const void* unused = NULL) - { - CRYPTOPP_UNUSED(n); CRYPTOPP_UNUSED(unused); - assert(false); return NULL; - } - - void deallocate(void *p, size_type n) - { - CRYPTOPP_UNUSED(p); CRYPTOPP_UNUSED(n); - assert(false); - } - - size_type max_size() const {return 0;} -}; - -//! \class FixedSizeAllocatorWithCleanup -//! \brief Static secure memory block with cleanup -//! \tparam T class or type -//! \tparam S fixed-size of the stack-based memory block -//! \tparam A AllocatorBase derived class for allocation and cleanup -//! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- -//! based allocation at compile time. The class can grow its memory -//! block at runtime if a suitable allocator is available. If size -//! grows beyond S and a suitable allocator is available, then the -//! statically allocated array is obsoleted. -//! \note This allocator can't be used with standard collections because -//! they require that all objects of the same allocator type are equivalent. -template , bool T_Align16 = false> -class FixedSizeAllocatorWithCleanup : public AllocatorBase -{ -public: - CRYPTOPP_INHERIT_ALLOCATOR_TYPES - - //! \brief Constructs a FixedSizeAllocatorWithCleanup - FixedSizeAllocatorWithCleanup() : m_allocated(false) {} - - //! \brief Allocates a block of memory - //! \param size size of the memory block - //! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- - //! based allocation at compile time. If size is less than or equal to - //! S, then a pointer to the static array is returned. - //! \details The class can grow its memory block at runtime if a suitable - //! allocator is available. If size grows beyond S and a suitable - //! allocator is available, then the statically allocated array is - //! obsoleted. If a suitable allocator is \a not available, as with a - //! NullAllocator, then the function returns NULL and a runtime error - //! eventually occurs. - //! \note size is the count of elements, and not the number of bytes. - //! \sa reallocate(), SecBlockWithHint - pointer allocate(size_type size) - { - assert(IsAlignedOn(m_array, 8)); - - if (size <= S && !m_allocated) - { - m_allocated = true; - return GetAlignedArray(); - } - else - return m_fallbackAllocator.allocate(size); - } - - //! \brief Allocates a block of memory - //! \param size size of the memory block - //! \param hint an unused hint - //! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- - //! based allocation at compile time. If size is less than or equal to - //! S, then a pointer to the static array is returned. - //! \details The class can grow its memory block at runtime if a suitable - //! allocator is available. If size grows beyond S and a suitable - //! allocator is available, then the statically allocated array is - //! obsoleted. If a suitable allocator is \a not available, as with a - //! NullAllocator, then the function returns NULL and a runtime error - //! eventually occurs. - //! \note size is the count of elements, and not the number of bytes. - //! \sa reallocate(), SecBlockWithHint - pointer allocate(size_type size, const void *hint) - { - if (size <= S && !m_allocated) - { - m_allocated = true; - return GetAlignedArray(); - } - else - return m_fallbackAllocator.allocate(size, hint); - } - - //! \brief Deallocates a block of memory - //! \param ptr a pointer to the memory block to deallocate - //! \param size size of the memory block - //! \details The memory block is wiped or zeroized before deallocation. - //! If the statically allocated memory block is active, then no - //! additional actions are taken after the wipe. - //! \details If a dynamic memory block is active, then the pointer and - //! size are passed to the allocator for deallocation. - void deallocate(void *ptr, size_type size) - { - if (ptr == GetAlignedArray()) - { - assert(size <= S); - assert(m_allocated); - m_allocated = false; - SecureWipeArray((pointer)ptr, size); - } - else - m_fallbackAllocator.deallocate(ptr, size); - } - - //! \brief Reallocates a block of memory - //! \param oldPtr the previous allocation - //! \param oldSize the size of the previous allocation - //! \param newSize the new, requested size - //! \param preserve flag that indicates if the old allocation should be preserved - //! \returns pointer to the new memory block - //! \details FixedSizeAllocatorWithCleanup provides a fixed-size, stack- - //! based allocation at compile time. If size is less than or equal to - //! S, then a pointer to the static array is returned. - //! \details The class can grow its memory block at runtime if a suitable - //! allocator is available. If size grows beyond S and a suitable - //! allocator is available, then the statically allocated array is - //! obsoleted. If a suitable allocator is \a not available, as with a - //! NullAllocator, then the function returns NULL and a runtime error - //! eventually occurs. - //! \note size is the count of elements, and not the number of bytes. - //! \sa reallocate(), SecBlockWithHint - pointer reallocate(pointer oldPtr, size_type oldSize, size_type newSize, bool preserve) - { - if (oldPtr == GetAlignedArray() && newSize <= S) - { - assert(oldSize <= S); - if (oldSize > newSize) - SecureWipeArray(oldPtr+newSize, oldSize-newSize); - return oldPtr; - } - - pointer newPointer = allocate(newSize, NULL); - if (preserve && newSize) - { - const size_t copySize = STDMIN(oldSize, newSize); - memcpy_s(newPointer, copySize, oldPtr, copySize); - } - deallocate(oldPtr, oldSize); - return newPointer; - } - - size_type max_size() const {return STDMAX(m_fallbackAllocator.max_size(), S);} - -private: -#ifdef __BORLANDC__ - T* GetAlignedArray() {return m_array;} - T m_array[S]; -#else - T* GetAlignedArray() {return (CRYPTOPP_BOOL_ALIGN16 && T_Align16) ? (T*)(((byte *)m_array) + (0-(size_t)m_array)%16) : m_array;} - CRYPTOPP_ALIGN_DATA(8) T m_array[(CRYPTOPP_BOOL_ALIGN16 && T_Align16) ? S+8/sizeof(T) : S]; -#endif - A m_fallbackAllocator; - bool m_allocated; -}; - -//! \class SecBlock -//! \brief Secure memory block with allocator and cleanup -//! \tparam T a class or type -//! \tparam A AllocatorWithCleanup derived class for allocation and cleanup -template > -class SecBlock -{ -public: - typedef typename A::value_type value_type; - typedef typename A::pointer iterator; - typedef typename A::const_pointer const_iterator; - typedef typename A::size_type size_type; - - //! \brief Construct a SecBlock with space for size elements. - //! \param size the number of elements in the allocation - //! \throws std::bad_alloc - //! \details The elements are not initialized. - //! \note size is the count of elements, and not the number of bytes - explicit SecBlock(size_type size=0) - : m_size(size), m_ptr(m_alloc.allocate(size, NULL)) { } - - //! \brief Copy construct a SecBlock from another SecBlock - //! \param t the other SecBlock - //! \throws std::bad_alloc - SecBlock(const SecBlock &t) - : m_size(t.m_size), m_ptr(m_alloc.allocate(t.m_size, NULL)) { - assert((!t.m_ptr && !m_size) || (t.m_ptr && m_size)); - if (t.m_ptr) {memcpy_s(m_ptr, m_size*sizeof(T), t.m_ptr, t.m_size*sizeof(T));} - } - - //! \brief Construct a SecBlock from an array of elements. - //! \param ptr a pointer to an array of T - //! \param len the number of elements in the memory block - //! \throws std::bad_alloc - //! \details If ptr!=NULL and len!=0, then the block is initialized from the pointer ptr. - //! If ptr==NULL and len!=0, then the block is initialized to 0. - //! Otherwise, the block is empty and uninitialized. - //! \note size is the count of elements, and not the number of bytes - SecBlock(const T *ptr, size_type len) - : m_size(len), m_ptr(m_alloc.allocate(len, NULL)) { - assert((!m_ptr && !m_size) || (m_ptr && m_size)); - if (ptr && m_ptr) - memcpy_s(m_ptr, m_size*sizeof(T), ptr, len*sizeof(T)); - else if (m_size) - memset(m_ptr, 0, m_size*sizeof(T)); - } - - ~SecBlock() - {m_alloc.deallocate(m_ptr, m_size);} - -#ifdef __BORLANDC__ - operator T *() const - {return (T*)m_ptr;} -#else - operator const void *() const - {return m_ptr;} - operator void *() - {return m_ptr;} - - operator const T *() const - {return m_ptr;} - operator T *() - {return m_ptr;} -#endif - - //! \brief Provides an iterator pointing to the first element in the memory block - //! \returns iterator pointing to the first element in the memory block - iterator begin() - {return m_ptr;} - //! \brief Provides a constant iterator pointing to the first element in the memory block - //! \returns constant iterator pointing to the first element in the memory block - const_iterator begin() const - {return m_ptr;} - //! \brief Provides an iterator pointing beyond the last element in the memory block - //! \returns iterator pointing beyond the last element in the memory block - iterator end() - {return m_ptr+m_size;} - //! \brief Provides a constant iterator pointing beyond the last element in the memory block - //! \returns constant iterator pointing beyond the last element in the memory block - const_iterator end() const - {return m_ptr+m_size;} - - //! \brief Provides a pointer to the first element in the memory block - //! \returns pointer to the first element in the memory block - typename A::pointer data() {return m_ptr;} - //! \brief Provides a pointer to the first element in the memory block - //! \returns constant pointer to the first element in the memory block - typename A::const_pointer data() const {return m_ptr;} - - //! \brief Provides the count of elements in the SecBlock - //! \returns number of elements in the memory block - //! \note the return value is the count of elements, and not the number of bytes - size_type size() const {return m_size;} - //! \brief Determines if the SecBlock is empty - //! \returns true if number of elements in the memory block is 0, false otherwise - bool empty() const {return m_size == 0;} - - //! \brief Provides a byte pointer to the first element in the memory block - //! \returns byte pointer to the first element in the memory block - byte * BytePtr() {return (byte *)m_ptr;} - //! \brief Return a byte pointer to the first element in the memory block - //! \returns constant byte pointer to the first element in the memory block - const byte * BytePtr() const {return (const byte *)m_ptr;} - //! \brief Provides the number of bytes in the SecBlock - //! \return the number of bytes in the memory block - //! \note the return value is the number of bytes, and not count of elements. - size_type SizeInBytes() const {return m_size*sizeof(T);} - - //! \brief Set contents and size from an array - //! \param ptr a pointer to an array of T - //! \param len the number of elements in the memory block - //! \details If the memory block is reduced in size, then the unused area is set to 0. - void Assign(const T *ptr, size_type len) - { - New(len); - if (m_ptr && ptr && len) - {memcpy_s(m_ptr, m_size*sizeof(T), ptr, len*sizeof(T));} - } - - //! \brief Copy contents from another SecBlock - //! \param t the other SecBlock - //! \details Assign checks for self assignment. - //! \details If the memory block is reduced in size, then the unused area is set to 0. - void Assign(const SecBlock &t) - { - if (this != &t) - { - New(t.m_size); - if (m_ptr && t.m_ptr && t.m_size) - {memcpy_s(m_ptr, m_size*sizeof(T), t, t.m_size*sizeof(T));} - } - } - - //! \brief Assign contents from another SecBlock - //! \param t the other SecBlock - //! \details Internally, operator=() calls Assign(). - //! \details If the memory block is reduced in size, then the unused area is set to 0. - SecBlock& operator=(const SecBlock &t) - { - // Assign guards for self-assignment - Assign(t); - return *this; - } - - //! \brief Append contents from another SecBlock - //! \param t the other SecBlock - //! \details Internally, this SecBlock calls Grow and then copies the new content. - //! \details If the memory block is reduced in size, then the unused area is set to 0. - SecBlock& operator+=(const SecBlock &t) - { - assert((!t.m_ptr && !t.m_size) || (t.m_ptr && t.m_ptr.m_size)); - - if(t.size) - { - size_type oldSize = m_size; - Grow(m_size+t.m_size); - - if (m_ptr && t.m_ptr) - {memcpy_s(m_ptr+oldSize, (m_size-oldSize)*sizeof(T), t.m_ptr, t.m_size*sizeof(T));} - } - return *this; - } - - //! \brief Concatenate contents from another SecBlock - //! \param t the other SecBlock - //! \returns a newly constructed SecBlock that is a conacentation of this and t - //! \details Internally, a temporary SecBlock is created and the content from this - //! SecBlock and the other SecBlock are concatenated. The temporary - //! SecBlock is returned to the caller. - SecBlock operator+(const SecBlock &t) - { - assert((!m_ptr && !m_size) || (m_ptr && m_size)); - assert((!t.m_ptr && !t.m_size) || (t.m_ptr && t.m_ptr.m_size)); - if(!t.size) return SecBlock(*this); - - SecBlock result(m_size+t.m_size); - memcpy_s(result.m_ptr, result.m_size*sizeof(T), m_ptr, m_size*sizeof(T)); - memcpy_s(result.m_ptr+m_size, (t.m_size-m_size)*sizeof(T), t.m_ptr, t.m_size*sizeof(T)); - return result; - } - - //! \brief Bitwise compare two SecBlocks - //! \param t the other SecBlock - //! \returns true if the size and bits are equal, false otherwise - //! \details Uses a constant time compare if the arrays are equal size. The constant time - //! compare is VerifyBufsEqual() found in misc.h. - //! \sa operator!=() - bool operator==(const SecBlock &t) const - { - return m_size == t.m_size && VerifyBufsEqual(m_ptr, t.m_ptr, m_size*sizeof(T)); - } - - //! \brief Bitwise compare two SecBlocks - //! \param t the other SecBlock - //! \returns true if the size and bits are equal, false otherwise - //! \details Uses a constant time compare if the arrays are equal size. The constant time - //! compare is VerifyBufsEqual() found in misc.h. - //! \details Internally, operator!=() returns the inverse of operator==(). - //! \sa operator==() - bool operator!=(const SecBlock &t) const - { - return !operator==(t); - } - - //! \brief Change size without preserving contents - //! \param newSize the new size of the memory block - //! \details Old content is \a not preserved. If the memory block is reduced in size, - //! then the unused content is set to 0. If the memory block grows in size, then - //! all content is uninitialized. - //! \details Internally, this SecBlock calls reallocate(). - //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() - void New(size_type newSize) - { - m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, false); - m_size = newSize; - } - - //! \brief Change size without preserving contents - //! \param newSize the new size of the memory block - //! \details Old content is not preserved. If the memory block is reduced in size, - //! then the unused content is set to 0. Existing and new content is set to 0. - //! \details Internally, this SecBlock calls reallocate(). - //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() - void CleanNew(size_type newSize) - { - New(newSize); - if (m_ptr) {memset_z(m_ptr, 0, m_size*sizeof(T));} - } - - //! \brief Change size and preserve contents - //! \param newSize the new size of the memory block - //! \details Old content is preserved. If the memory block grows in size, then - //! all content is uninitialized. - //! \details Internally, this SecBlock calls reallocate(). - //! \note reallocate() is called if the size increases. If the size does not - //! increase, then Grow does not take action. If the size must change, - //! then use resize(). - //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() - void Grow(size_type newSize) - { - if (newSize > m_size) - { - m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true); - m_size = newSize; - } - } - - //! \brief Change size and preserve contents - //! \param newSize the new size of the memory block - //! \details Old content is preserved. If the memory block is reduced in size, - //! then the unused content is set to 0. If the memory block grows in size, - //! then the new content is uninitialized. - //! \details Internally, this SecBlock calls reallocate(). - //! \note reallocate() is called if the size increases. If the size does not - //! increase, then Grow does not take action. If the size must change, - //! then use resize(). - //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() - void CleanGrow(size_type newSize) - { - if (newSize > m_size) - { - m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true); - memset_z(m_ptr+m_size, 0, (newSize-m_size)*sizeof(T)); - m_size = newSize; - } - } - - //! \brief Change size and preserve contents - //! \param newSize the new size of the memory block - //! \details Old content is preserved. If the memory block grows in size, then - //! all content is uninitialized. - //! \details Internally, this SecBlock calls reallocate(). - //! \note reallocate() is called if the size increases. If the size does not - //! increase, then Grow does not take action. If the size must change, - //! then use resize(). - //! \sa New(), CleanNew(), Grow(), CleanGrow(), resize() - void resize(size_type newSize) - { - m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true); - m_size = newSize; - } - - //! \brief Swap contents with another SecBlock - //! \param b the other SecBlock - //! \details Internally, std::swap() is called on m_alloc, m_size and m_ptr. - void swap(SecBlock &b) - { - // Swap must occur on the allocator in case its FixedSize that spilled into the heap. - std::swap(m_alloc, b.m_alloc); - std::swap(m_size, b.m_size); - std::swap(m_ptr, b.m_ptr); - } - -// protected: - A m_alloc; - size_type m_size; - T *m_ptr; -}; - -#ifdef CRYPTOPP_DOXYGEN_PROCESSING -//! \class SecByteBlock -//! \brief SecByteBlock is a SecBlock typedef. -class SecByteBlock : public SecBlock {}; -//! \class SecWordBlock -//! \brief SecWordBlock is a SecBlock typedef. -class SecWordBlock : public SecBlock {}; -//! \class AlignedSecByteBlock -//! \brief AlignedSecByteBlock is a SecBlock > typedef. -class AlignedSecByteBlock SecBlock > {}; -#else -typedef SecBlock SecByteBlock; -typedef SecBlock SecWordBlock; -typedef SecBlock > AlignedSecByteBlock; -#endif - -// No need for move semantics on derived class *if* the class does not add any -// data members; see http://stackoverflow.com/q/31755703, and Rule of {0|3|5}. - -//! \class FixedSizeSecBlock -//! \brief Fixed size stack-based SecBlock -//! \tparam T class or type -//! \tparam S fixed-size of the stack-based memory block -//! \tparam A AllocatorBase derived class for allocation and cleanup -template > -class FixedSizeSecBlock : public SecBlock -{ -public: - //! \brief Construct a FixedSizeSecBlock - explicit FixedSizeSecBlock() : SecBlock(S) {} -}; - -//! \class FixedSizeAlignedSecBlock -//! \brief Fixed size stack-based SecBlock with 16-byte alignment -//! \tparam T class or type -//! \tparam S fixed-size of the stack-based memory block -//! \tparam A AllocatorBase derived class for allocation and cleanup -template -class FixedSizeAlignedSecBlock : public FixedSizeSecBlock, T_Align16> > -{ -}; - -//! \class SecBlockWithHint -//! \brief Stack-based SecBlock that grows into the heap -//! \tparam T class or type -//! \tparam S fixed-size of the stack-based memory block -//! \tparam A AllocatorBase derived class for allocation and cleanup -template > > -class SecBlockWithHint : public SecBlock -{ -public: - //! construct a SecBlockWithHint with a count of elements - explicit SecBlockWithHint(size_t size) : SecBlock(size) {} -}; - -template -inline bool operator==(const CryptoPP::AllocatorWithCleanup&, const CryptoPP::AllocatorWithCleanup&) {return (true);} -template -inline bool operator!=(const CryptoPP::AllocatorWithCleanup&, const CryptoPP::AllocatorWithCleanup&) {return (false);} - -NAMESPACE_END - -NAMESPACE_BEGIN(std) -template -inline void swap(CryptoPP::SecBlock &a, CryptoPP::SecBlock &b) -{ - a.swap(b); -} - -#if defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) || (defined(_STLPORT_VERSION) && !defined(_STLP_MEMBER_TEMPLATE_CLASSES)) -// working for STLport 5.1.3 and MSVC 6 SP5 -template -inline CryptoPP::AllocatorWithCleanup<_Tp2>& -__stl_alloc_rebind(CryptoPP::AllocatorWithCleanup<_Tp1>& __a, const _Tp2*) -{ - return (CryptoPP::AllocatorWithCleanup<_Tp2>&)(__a); -} -#endif - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/seckey.h b/external/crypto++-5.6.3/seckey.h deleted file mode 100644 index f03ea8450..000000000 --- a/external/crypto++-5.6.3/seckey.h +++ /dev/null @@ -1,428 +0,0 @@ -// seckey.h - written and placed in the public domain by Wei Dai - -//! \file -//! \brief Classes and functions for implementing secret key algorithms. - -#ifndef CRYPTOPP_SECKEY_H -#define CRYPTOPP_SECKEY_H - -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4189) -#endif - -#include "cryptlib.h" -#include "misc.h" -#include "simple.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \brief Inverts the cipher's direction -//! \param dir the cipher's direction -//! \returns DECRYPTION if dir is ENCRYPTION, DECRYPTION otherwise -inline CipherDir ReverseCipherDir(CipherDir dir) -{ - return (dir == ENCRYPTION) ? DECRYPTION : ENCRYPTION; -} - -//! \class FixedBlockSize -//! \brief Inherited by block ciphers with fixed block size -//! \tparam N the blocksize of the cipher -template -class FixedBlockSize -{ -public: - //! \brief The block size of the cipher provided as a constant. - CRYPTOPP_CONSTANT(BLOCKSIZE = N) -}; - -// ************** rounds *************** - -//! \class FixedRounds -//! \brief Inherited by ciphers with fixed number of rounds -//! \tparam R the number of rounds used by the cipher -template -class FixedRounds -{ -public: - //! \brief The number of rounds for the cipher provided as a constant. - CRYPTOPP_CONSTANT(ROUNDS = R) -}; - -//! \class VariableRounds -//! \brief Inherited by ciphers with variable number of rounds -//! \tparam D Default number of rounds -//! \tparam N Minimum number of rounds -//! \tparam D Maximum number of rounds -template // use INT_MAX here because enums are treated as signed ints -class VariableRounds -{ -public: - //! \brief The default number of rounds for the cipher provided as a constant. - CRYPTOPP_CONSTANT(DEFAULT_ROUNDS = D) - //! \brief The minimum number of rounds for the cipher provided as a constant. - CRYPTOPP_CONSTANT(MIN_ROUNDS = N) - //! \brief The maximum number of rounds for the cipher provided as a constant. - CRYPTOPP_CONSTANT(MAX_ROUNDS = M) - //! \brief The default number of rounds for the cipher based on key length - //! provided by a static function. - //! \param keylength the size of the key, in bytes - //! \details keylength is unused in the default implementation. - static unsigned int StaticGetDefaultRounds(size_t keylength) - {CRYPTOPP_UNUSED(keylength); return DEFAULT_ROUNDS;} - -protected: - //! \brief Validates the number of rounds for a cipher. - //! \param rounds the canddiate number of rounds - //! \param alg an Algorithm object used if the number of rounds are invalid - //! \throws InvalidRounds if the number of rounds are invalid - inline void ThrowIfInvalidRounds(int rounds, const Algorithm *alg) - { -#if (M==INT_MAX) // Coverity and result_independent_of_operands - if (rounds < MIN_ROUNDS) - throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds); -#else - if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS) - throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds); -#endif - } - - //! \brief Validates the number of rounds for a cipher - //! \param param the canddiate number of rounds - //! \param alg an Algorithm object used if the number of rounds are invalid - //! \returns the number of rounds for the cipher - //! \throws InvalidRounds if the number of rounds are invalid - inline unsigned int GetRoundsAndThrowIfInvalid(const NameValuePairs ¶m, const Algorithm *alg) - { - int rounds = param.GetIntValueWithDefault("Rounds", DEFAULT_ROUNDS); - ThrowIfInvalidRounds(rounds, alg); - return (unsigned int)rounds; - } -}; - -// ************** key length *************** - -//! \class FixedKeyLength -//! \brief Inherited by keyed algorithms with fixed key length -//! \tparam N Default key length, in bytes -//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values -//! \tparam IV_L Default IV length, in bytes -template -class FixedKeyLength -{ -public: - //! \brief The default key length used by the cipher provided as a constant - //! \details KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(KEYLENGTH=N) - //! \brief The minimum key length used by the cipher provided as a constant - //! \details MIN_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N) - //! \brief The maximum key length used by the cipher provided as a constant - //! \details MAX_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(MAX_KEYLENGTH=N) - //! \brief The default key length used by the cipher provided as a constant - //! \details DEFAULT_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=N) - //! \brief The default IV requirements for the cipher provided as a constant - //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement - //! in cryptlib.h for allowed values. - CRYPTOPP_CONSTANT(IV_REQUIREMENT = IV_REQ) - //! \brief The default IV length used by the cipher provided as a constant - //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0. - CRYPTOPP_CONSTANT(IV_LENGTH = IV_L) - //! \brief The default key length for the cipher provided by a static function. - //! \param keylength the size of the key, in bytes - //! \details The default implementation returns KEYLENGTH. keylength is unused - //! in the default implementation. - static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) - {CRYPTOPP_UNUSED(keylength); return KEYLENGTH;} -}; - -//! \class VariableKeyLength -//! \brief Inherited by keyed algorithms with variable key length -//! \tparam D Default key length, in bytes -//! \tparam N Minimum key length, in bytes -//! \tparam M Maximum key length, in bytes -//! \tparam M Default key length multiple, in bytes. The default multiple is 1. -//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values -//! \tparam IV_L Default IV length, in bytes. The default length is 0. -template -class VariableKeyLength -{ - // Make these private to avoid Doxygen documenting them in all derived classes - CRYPTOPP_COMPILE_ASSERT(Q > 0); - CRYPTOPP_COMPILE_ASSERT(N % Q == 0); - CRYPTOPP_COMPILE_ASSERT(M % Q == 0); - CRYPTOPP_COMPILE_ASSERT(N < M); - CRYPTOPP_COMPILE_ASSERT(D >= N); - CRYPTOPP_COMPILE_ASSERT(M >= D); - -public: - //! \brief The minimum key length used by the cipher provided as a constant - //! \details MIN_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N) - //! \brief The maximum key length used by the cipher provided as a constant - //! \details MAX_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(MAX_KEYLENGTH=M) - //! \brief The default key length used by the cipher provided as a constant - //! \details DEFAULT_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=D) - //! \brief The key length multiple used by the cipher provided as a constant - //! \details MAX_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(KEYLENGTH_MULTIPLE=Q) - //! \brief The default IV requirements for the cipher provided as a constant - //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement - //! in cryptlib.h for allowed values. - CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ) - //! \brief The default initialization vector length for the cipher provided as a constant - //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0. - CRYPTOPP_CONSTANT(IV_LENGTH=IV_L) - //! \brief Provides a valid key length for the cipher provided by a static function. - //! \param keylength the size of the key, in bytes - //! \details If keylength is less than MIN_KEYLENGTH, then the function returns - //! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function - //! returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE, - //! then keylength is returned. Otherwise, the function returns keylength rounded - //! \a down to the next smaller multiple of KEYLENGTH_MULTIPLE. - //! \details keylength is provided in bytes, not bits. - static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) - { -#if MIN_KEYLENGTH > 0 - if (keylength < (size_t)MIN_KEYLENGTH) - return MIN_KEYLENGTH; - else -#endif - if (keylength > (size_t)MAX_KEYLENGTH) - return (size_t)MAX_KEYLENGTH; - else - { - keylength += KEYLENGTH_MULTIPLE-1; - return keylength - keylength%KEYLENGTH_MULTIPLE; - } - } -}; - -//! \class SameKeyLengthAs -//! \brief Provides key lengths based on another class's key length -//! \tparam T another FixedKeyLength or VariableKeyLength class -//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values -//! \tparam IV_L Default IV length, in bytes -template -class SameKeyLengthAs -{ -public: - //! \brief The minimum key length used by the cipher provided as a constant - //! \details MIN_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(MIN_KEYLENGTH=T::MIN_KEYLENGTH) - //! \brief The maximum key length used by the cipher provided as a constant - //! \details MIN_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(MAX_KEYLENGTH=T::MAX_KEYLENGTH) - //! \brief The default key length used by the cipher provided as a constant - //! \details MIN_KEYLENGTH is provided in bytes, not bits - CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH) - //! \brief The default IV requirements for the cipher provided as a constant - //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement - //! in cryptlib.h for allowed values. - CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ) - //! \brief The default initialization vector length for the cipher provided as a constant - //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0. - CRYPTOPP_CONSTANT(IV_LENGTH=IV_L) - //! \brief Provides a valid key length for the cipher provided by a static function. - //! \param keylength the size of the key, in bytes - //! \details If keylength is less than MIN_KEYLENGTH, then the function returns - //! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function - //! returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE, - //! then keylength is returned. Otherwise, the function returns keylength rounded - //! \a down to the next smaller multiple of KEYLENGTH_MULTIPLE. - //! \details keylength is provided in bytes, not bits. - static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) - {return T::StaticGetValidKeyLength(keylength);} -}; - -// ************** implementation helper for SimpleKeyed *************** - -//! \class SimpleKeyingInterfaceImpl -//! \brief Provides class member functions to access SimpleKeyingInterface constants -//! \tparam BASE a SimpleKeyingInterface derived class -//! \tparam INFO a SimpleKeyingInterface derived class -template -class CRYPTOPP_NO_VTABLE SimpleKeyingInterfaceImpl : public BASE -{ -public: - //! \brief The minimum key length used by the cipher - size_t MinKeyLength() const - {return INFO::MIN_KEYLENGTH;} - - //! \brief The maximum key length used by the cipher - size_t MaxKeyLength() const - {return (size_t)INFO::MAX_KEYLENGTH;} - - //! \brief The default key length used by the cipher - size_t DefaultKeyLength() const - {return INFO::DEFAULT_KEYLENGTH;} - - //! \brief Provides a valid key length for the cipher - //! \param keylength the size of the key, in bytes - //! \details keylength is provided in bytes, not bits. If keylength is less than MIN_KEYLENGTH, - //! then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, - //! then the function returns MAX_KEYLENGTH. if If keylength is a multiple of KEYLENGTH_MULTIPLE, - //! then keylength is returned. Otherwise, the function returns a \a lower multiple of - //! KEYLENGTH_MULTIPLE. - size_t GetValidKeyLength(size_t keylength) const {return INFO::StaticGetValidKeyLength(keylength);} - - //! \brief The default IV requirements for the cipher - //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement - //! in cryptlib.h for allowed values. - SimpleKeyingInterface::IV_Requirement IVRequirement() const - {return (SimpleKeyingInterface::IV_Requirement)INFO::IV_REQUIREMENT;} - - //! \brief The default initialization vector length for the cipher - //! \details IVSize is provided in bytes, not bits. The default implementation uses IV_LENGTH, which is 0. - unsigned int IVSize() const - {return INFO::IV_LENGTH;} -}; - -//! \class BlockCipherImpl -//! \brief Provides class member functions to access BlockCipher constants -//! \tparam INFO a SimpleKeyingInterface derived class -//! \tparam BASE a SimpleKeyingInterface derived class -template -class CRYPTOPP_NO_VTABLE BlockCipherImpl : public AlgorithmImpl > > -{ -public: - //! Provides the block size of the cipher - //! \returns the block size of the cipher, in bytes - unsigned int BlockSize() const {return this->BLOCKSIZE;} -}; - -//! \class BlockCipherFinal -//! \brief Provides class member functions to key a block cipher -//! \tparam DIR a CipherDir -//! \tparam BASE a BlockCipherImpl derived class -template -class BlockCipherFinal : public ClonableImpl, BASE> -{ -public: - //! \brief Construct a default BlockCipherFinal - //! \details The cipher is not keyed. - BlockCipherFinal() {} - - //! \brief Construct a BlockCipherFinal - //! \param key a byte array used to key the cipher - //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls - //! SimpleKeyingInterface::SetKey. - BlockCipherFinal(const byte *key) - {this->SetKey(key, this->DEFAULT_KEYLENGTH);} - - //! \brief Construct a BlockCipherFinal - //! \param key a byte array used to key the cipher - //! \param length the length of the byte array - //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls - //! SimpleKeyingInterface::SetKey. - BlockCipherFinal(const byte *key, size_t length) - {this->SetKey(key, length);} - - //! \brief Construct a BlockCipherFinal - //! \param key a byte array used to key the cipher - //! \param length the length of the byte array - //! \param rounds the number of rounds - //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls - //! SimpleKeyingInterface::SetKeyWithRounds. - BlockCipherFinal(const byte *key, size_t length, unsigned int rounds) - {this->SetKeyWithRounds(key, length, rounds);} - - //! \brief Provides the direction of the cipher - //! \returns true if DIR is ENCRYPTION, false otherwise - //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection() - bool IsForwardTransformation() const {return DIR == ENCRYPTION;} -}; - -//! \class MessageAuthenticationCodeImpl -//! \brief Provides class member functions to access MessageAuthenticationCode constants -//! \tparam INFO a SimpleKeyingInterface derived class -//! \tparam BASE a SimpleKeyingInterface derived class -template -class MessageAuthenticationCodeImpl : public AlgorithmImpl, INFO> -{ -}; - -//! \class MessageAuthenticationCodeFinal -//! \brief Provides class member functions to key a message authentication code -//! \tparam DIR a CipherDir -//! \tparam BASE a BlockCipherImpl derived class -template -class MessageAuthenticationCodeFinal : public ClonableImpl, MessageAuthenticationCodeImpl > -{ -public: - //! \brief Construct a default MessageAuthenticationCodeFinal - //! \details The message authentication code is not keyed. - MessageAuthenticationCodeFinal() {} - //! \brief Construct a BlockCipherFinal - //! \param key a byte array used to key the cipher - //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls - //! SimpleKeyingInterface::SetKey. - MessageAuthenticationCodeFinal(const byte *key) - {this->SetKey(key, this->DEFAULT_KEYLENGTH);} - //! \brief Construct a BlockCipherFinal - //! \param key a byte array used to key the cipher - //! \param length the length of the byte array - //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls - //! SimpleKeyingInterface::SetKey. - MessageAuthenticationCodeFinal(const byte *key, size_t length) - {this->SetKey(key, length);} -}; - -// ************** documentation *************** - -//! \class BlockCipherDocumentation -//! \brief Provides Encryption and Decryption typedefs used by derived classes to -//! implement a block cipher -//! \details These objects usually should not be used directly. See CipherModeDocumentation -//! instead. Each class derived from this one defines two types, Encryption and Decryption, -//! both of which implement the BlockCipher interface. -struct BlockCipherDocumentation -{ - //! implements the BlockCipher interface - typedef BlockCipher Encryption; - //! implements the BlockCipher interface - typedef BlockCipher Decryption; -}; - -//! \class SymmetricCipherDocumentation -//! \brief Provides Encryption and Decryption typedefs used by derived classes to -//! implement a symmetric cipher -//! \details Each class derived from this one defines two types, Encryption and Decryption, -//! both of which implement the SymmetricCipher interface. Two types of classes derive -//! from this class: stream ciphers and block cipher modes. Stream ciphers can be used -//! alone, cipher mode classes need to be used with a block cipher. See CipherModeDocumentation -//! for more for information about using cipher modes and block ciphers. -struct SymmetricCipherDocumentation -{ - //! implements the SymmetricCipher interface - typedef SymmetricCipher Encryption; - //! implements the SymmetricCipher interface - typedef SymmetricCipher Decryption; -}; - -//! \class AuthenticatedSymmetricCipherDocumentation -//! \brief Provides Encryption and Decryption typedefs used by derived classes to -//! implement an authenticated encryption cipher -//! \details Each class derived from this one defines two types, Encryption and Decryption, -//! both of which implement the AuthenticatedSymmetricCipher interface. -struct AuthenticatedSymmetricCipherDocumentation -{ - //! implements the AuthenticatedSymmetricCipher interface - typedef AuthenticatedSymmetricCipher Encryption; - //! implements the AuthenticatedSymmetricCipher interface - typedef AuthenticatedSymmetricCipher Decryption; -}; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/seed.cpp b/external/crypto++-5.6.3/seed.cpp deleted file mode 100644 index 6779f38ae..000000000 --- a/external/crypto++-5.6.3/seed.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// seed.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "seed.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const word32 s_kc[16] = { - 0x9e3779b9, 0x3c6ef373, 0x78dde6e6, 0xf1bbcdcc, 0xe3779b99, 0xc6ef3733, 0x8dde6e67, 0x1bbcdccf, - 0x3779b99e, 0x6ef3733c, 0xdde6e678, 0xbbcdccf1, 0x779b99e3, 0xef3733c6, 0xde6e678d, 0xbcdccf1b}; - -static const byte s_s0[256] = { - 0xA9, 0x85, 0xD6, 0xD3, 0x54, 0x1D, 0xAC, 0x25, 0x5D, 0x43, 0x18, 0x1E, 0x51, 0xFC, 0xCA, 0x63, 0x28, - 0x44, 0x20, 0x9D, 0xE0, 0xE2, 0xC8, 0x17, 0xA5, 0x8F, 0x03, 0x7B, 0xBB, 0x13, 0xD2, 0xEE, 0x70, 0x8C, - 0x3F, 0xA8, 0x32, 0xDD, 0xF6, 0x74, 0xEC, 0x95, 0x0B, 0x57, 0x5C, 0x5B, 0xBD, 0x01, 0x24, 0x1C, 0x73, - 0x98, 0x10, 0xCC, 0xF2, 0xD9, 0x2C, 0xE7, 0x72, 0x83, 0x9B, 0xD1, 0x86, 0xC9, 0x60, 0x50, 0xA3, 0xEB, - 0x0D, 0xB6, 0x9E, 0x4F, 0xB7, 0x5A, 0xC6, 0x78, 0xA6, 0x12, 0xAF, 0xD5, 0x61, 0xC3, 0xB4, 0x41, 0x52, - 0x7D, 0x8D, 0x08, 0x1F, 0x99, 0x00, 0x19, 0x04, 0x53, 0xF7, 0xE1, 0xFD, 0x76, 0x2F, 0x27, 0xB0, 0x8B, - 0x0E, 0xAB, 0xA2, 0x6E, 0x93, 0x4D, 0x69, 0x7C, 0x09, 0x0A, 0xBF, 0xEF, 0xF3, 0xC5, 0x87, 0x14, 0xFE, - 0x64, 0xDE, 0x2E, 0x4B, 0x1A, 0x06, 0x21, 0x6B, 0x66, 0x02, 0xF5, 0x92, 0x8A, 0x0C, 0xB3, 0x7E, 0xD0, - 0x7A, 0x47, 0x96, 0xE5, 0x26, 0x80, 0xAD, 0xDF, 0xA1, 0x30, 0x37, 0xAE, 0x36, 0x15, 0x22, 0x38, 0xF4, - 0xA7, 0x45, 0x4C, 0x81, 0xE9, 0x84, 0x97, 0x35, 0xCB, 0xCE, 0x3C, 0x71, 0x11, 0xC7, 0x89, 0x75, 0xFB, - 0xDA, 0xF8, 0x94, 0x59, 0x82, 0xC4, 0xFF, 0x49, 0x39, 0x67, 0xC0, 0xCF, 0xD7, 0xB8, 0x0F, 0x8E, 0x42, - 0x23, 0x91, 0x6C, 0xDB, 0xA4, 0x34, 0xF1, 0x48, 0xC2, 0x6F, 0x3D, 0x2D, 0x40, 0xBE, 0x3E, 0xBC, 0xC1, - 0xAA, 0xBA, 0x4E, 0x55, 0x3B, 0xDC, 0x68, 0x7F, 0x9C, 0xD8, 0x4A, 0x56, 0x77, 0xA0, 0xED, 0x46, 0xB5, - 0x2B, 0x65, 0xFA, 0xE3, 0xB9, 0xB1, 0x9F, 0x5E, 0xF9, 0xE6, 0xB2, 0x31, 0xEA, 0x6D, 0x5F, 0xE4, 0xF0, - 0xCD, 0x88, 0x16, 0x3A, 0x58, 0xD4, 0x62, 0x29, 0x07, 0x33, 0xE8, 0x1B, 0x05, 0x79, 0x90, 0x6A, 0x2A, - 0x9A}; - -static const byte s_s1[256] = { - 0x38, 0xE8, 0x2D, 0xA6, 0xCF, 0xDE, 0xB3, 0xB8, 0xAF, 0x60, 0x55, 0xC7, 0x44, 0x6F, 0x6B, 0x5B, 0xC3, - 0x62, 0x33, 0xB5, 0x29, 0xA0, 0xE2, 0xA7, 0xD3, 0x91, 0x11, 0x06, 0x1C, 0xBC, 0x36, 0x4B, 0xEF, 0x88, - 0x6C, 0xA8, 0x17, 0xC4, 0x16, 0xF4, 0xC2, 0x45, 0xE1, 0xD6, 0x3F, 0x3D, 0x8E, 0x98, 0x28, 0x4E, 0xF6, - 0x3E, 0xA5, 0xF9, 0x0D, 0xDF, 0xD8, 0x2B, 0x66, 0x7A, 0x27, 0x2F, 0xF1, 0x72, 0x42, 0xD4, 0x41, 0xC0, - 0x73, 0x67, 0xAC, 0x8B, 0xF7, 0xAD, 0x80, 0x1F, 0xCA, 0x2C, 0xAA, 0x34, 0xD2, 0x0B, 0xEE, 0xE9, 0x5D, - 0x94, 0x18, 0xF8, 0x57, 0xAE, 0x08, 0xC5, 0x13, 0xCD, 0x86, 0xB9, 0xFF, 0x7D, 0xC1, 0x31, 0xF5, 0x8A, - 0x6A, 0xB1, 0xD1, 0x20, 0xD7, 0x02, 0x22, 0x04, 0x68, 0x71, 0x07, 0xDB, 0x9D, 0x99, 0x61, 0xBE, 0xE6, - 0x59, 0xDD, 0x51, 0x90, 0xDC, 0x9A, 0xA3, 0xAB, 0xD0, 0x81, 0x0F, 0x47, 0x1A, 0xE3, 0xEC, 0x8D, 0xBF, - 0x96, 0x7B, 0x5C, 0xA2, 0xA1, 0x63, 0x23, 0x4D, 0xC8, 0x9E, 0x9C, 0x3A, 0x0C, 0x2E, 0xBA, 0x6E, 0x9F, - 0x5A, 0xF2, 0x92, 0xF3, 0x49, 0x78, 0xCC, 0x15, 0xFB, 0x70, 0x75, 0x7F, 0x35, 0x10, 0x03, 0x64, 0x6D, - 0xC6, 0x74, 0xD5, 0xB4, 0xEA, 0x09, 0x76, 0x19, 0xFE, 0x40, 0x12, 0xE0, 0xBD, 0x05, 0xFA, 0x01, 0xF0, - 0x2A, 0x5E, 0xA9, 0x56, 0x43, 0x85, 0x14, 0x89, 0x9B, 0xB0, 0xE5, 0x48, 0x79, 0x97, 0xFC, 0x1E, 0x82, - 0x21, 0x8C, 0x1B, 0x5F, 0x77, 0x54, 0xB2, 0x1D, 0x25, 0x4F, 0x00, 0x46, 0xED, 0x58, 0x52, 0xEB, 0x7E, - 0xDA, 0xC9, 0xFD, 0x30, 0x95, 0x65, 0x3C, 0xB6, 0xE4, 0xBB, 0x7C, 0x0E, 0x50, 0x39, 0x26, 0x32, 0x84, - 0x69, 0x93, 0x37, 0xE7, 0x24, 0xA4, 0xCB, 0x53, 0x0A, 0x87, 0xD9, 0x4C, 0x83, 0x8F, 0xCE, 0x3B, 0x4A, - 0xB7}; - -#define SS0(x) ((s_s0[x]*0x01010101UL) & 0x3FCFF3FC) -#define SS1(x) ((s_s1[x]*0x01010101UL) & 0xFC3FCFF3) -#define SS2(x) ((s_s0[x]*0x01010101UL) & 0xF3FC3FCF) -#define SS3(x) ((s_s1[x]*0x01010101UL) & 0xCFF3FC3F) -#define G(x) (SS0(GETBYTE(x, 0)) ^ SS1(GETBYTE(x, 1)) ^ SS2(GETBYTE(x, 2)) ^ SS3(GETBYTE(x, 3))) - -void SEED::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs& /*params*/) -{ - AssertValidKeyLength(length); - - word64 key01, key23; - GetBlock get(userKey); - get(key01)(key23); - word32 *k = m_k; - size_t kInc = 2; - if (!IsForwardTransformation()) - { - k = k+30; - kInc = 0-kInc; - } - - for (unsigned int i=0; i>32) + word32(key23>>32) - s_kc[i]; - word32 t1 = word32(key01) - word32(key23) + s_kc[i]; - k[0] = G(t0); - k[1] = G(t1); - k+=kInc; - if (i&1) - key23 = rotlFixed(key23, 8); - else - key01 = rotrFixed(key01, 8); - } -} - -void SEED::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - typedef BlockGetAndPut Block; - word32 a0, a1, b0, b1, t0, t1; - Block::Get(inBlock)(a0)(a1)(b0)(b1); - - for (int i=0; i, public FixedKeyLength<16>, public FixedRounds<16> -{ - static const char *StaticAlgorithmName() {return "SEED";} -}; - -/// SEED -class SEED : public SEED_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - protected: - FixedSizeSecBlock m_k; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/serpent.cpp b/external/crypto++-5.6.3/serpent.cpp deleted file mode 100644 index 64b12a7c4..000000000 --- a/external/crypto++-5.6.3/serpent.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// serpent.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "serpent.h" -#include "secblock.h" -#include "misc.h" - -#include "serpentp.h" - -NAMESPACE_BEGIN(CryptoPP) - -void Serpent_KeySchedule(word32 *k, unsigned int rounds, const byte *userKey, size_t keylen) -{ - FixedSizeSecBlock k0; - GetUserKey(LITTLE_ENDIAN_ORDER, k0.begin(), 8, userKey, keylen); - if (keylen < 32) - k0[keylen/4] |= word32(1) << ((keylen%4)*8); - - word32 t = k0[7]; - unsigned int i; - for (i = 0; i < 8; ++i) - k[i] = k0[i] = t = rotlFixed(k0[i] ^ k0[(i+3)%8] ^ k0[(i+5)%8] ^ t ^ 0x9e3779b9 ^ i, 11); - for (i = 8; i < 4*(rounds+1); ++i) - k[i] = t = rotlFixed(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11); - k -= 20; - - word32 a,b,c,d,e; - for (i=0; i Block; - -void Serpent::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 a, b, c, d, e; - - Block::Get(inBlock)(a)(b)(c)(d); - - const word32 *k = m_key; - unsigned int i=1; - - do - { - beforeS0(KX); beforeS0(S0); afterS0(LT); - afterS0(KX); afterS0(S1); afterS1(LT); - afterS1(KX); afterS1(S2); afterS2(LT); - afterS2(KX); afterS2(S3); afterS3(LT); - afterS3(KX); afterS3(S4); afterS4(LT); - afterS4(KX); afterS4(S5); afterS5(LT); - afterS5(KX); afterS5(S6); afterS6(LT); - afterS6(KX); afterS6(S7); - - if (i == 4) - break; - - ++i; - c = b; - b = e; - e = d; - d = a; - a = e; - k += 32; - beforeS0(LT); - } - while (true); - - afterS7(KX); - - Block::Put(xorBlock, outBlock)(d)(e)(b)(a); -} - -void Serpent::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 a, b, c, d, e; - - Block::Get(inBlock)(a)(b)(c)(d); - - const word32 *k = m_key + 96; - unsigned int i=4; - - beforeI7(KX); - goto start; - - do - { - c = b; - b = d; - d = e; - k -= 32; - beforeI7(ILT); -start: - beforeI7(I7); afterI7(KX); - afterI7(ILT); afterI7(I6); afterI6(KX); - afterI6(ILT); afterI6(I5); afterI5(KX); - afterI5(ILT); afterI5(I4); afterI4(KX); - afterI4(ILT); afterI4(I3); afterI3(KX); - afterI3(ILT); afterI3(I2); afterI2(KX); - afterI2(ILT); afterI2(I1); afterI1(KX); - afterI1(ILT); afterI1(I0); afterI0(KX); - } - while (--i != 0); - - Block::Put(xorBlock, outBlock)(a)(d)(b)(e); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/serpent.h b/external/crypto++-5.6.3/serpent.h deleted file mode 100644 index 1782669d3..000000000 --- a/external/crypto++-5.6.3/serpent.h +++ /dev/null @@ -1,54 +0,0 @@ -// serpent.h - written and placed in the public domain by Wei Dai - -//! \file serpent.h -//! \brief Classes for the Serpent block cipher - -#ifndef CRYPTOPP_SERPENT_H -#define CRYPTOPP_SERPENT_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, public FixedRounds<32> -{ - static const char *StaticAlgorithmName() {return "Serpent";} -}; - -/// Serpent -class Serpent : public Serpent_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - FixedSizeSecBlock m_key; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef Serpent::Encryption SerpentEncryption; -typedef Serpent::Decryption SerpentDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/serpentp.h b/external/crypto++-5.6.3/serpentp.h deleted file mode 100644 index 7869a3fcf..000000000 --- a/external/crypto++-5.6.3/serpentp.h +++ /dev/null @@ -1,434 +0,0 @@ -// private header for Serpent and Sosemanuk - -NAMESPACE_BEGIN(CryptoPP) - -// linear transformation -#define LT(i,a,b,c,d,e) {\ - a = rotlFixed(a, 13); \ - c = rotlFixed(c, 3); \ - d = rotlFixed(d ^ c ^ (a << 3), 7); \ - b = rotlFixed(b ^ a ^ c, 1); \ - a = rotlFixed(a ^ b ^ d, 5); \ - c = rotlFixed(c ^ d ^ (b << 7), 22);} - -// inverse linear transformation -#define ILT(i,a,b,c,d,e) {\ - c = rotrFixed(c, 22); \ - a = rotrFixed(a, 5); \ - c ^= d ^ (b << 7); \ - a ^= b ^ d; \ - b = rotrFixed(b, 1); \ - d = rotrFixed(d, 7) ^ c ^ (a << 3); \ - b ^= a ^ c; \ - c = rotrFixed(c, 3); \ - a = rotrFixed(a, 13);} - -// order of output from S-box functions -#define beforeS0(f) f(0,a,b,c,d,e) -#define afterS0(f) f(1,b,e,c,a,d) -#define afterS1(f) f(2,c,b,a,e,d) -#define afterS2(f) f(3,a,e,b,d,c) -#define afterS3(f) f(4,e,b,d,c,a) -#define afterS4(f) f(5,b,a,e,c,d) -#define afterS5(f) f(6,a,c,b,e,d) -#define afterS6(f) f(7,a,c,d,b,e) -#define afterS7(f) f(8,d,e,b,a,c) - -// order of output from inverse S-box functions -#define beforeI7(f) f(8,a,b,c,d,e) -#define afterI7(f) f(7,d,a,b,e,c) -#define afterI6(f) f(6,a,b,c,e,d) -#define afterI5(f) f(5,b,d,e,c,a) -#define afterI4(f) f(4,b,c,e,a,d) -#define afterI3(f) f(3,a,b,e,c,d) -#define afterI2(f) f(2,b,d,e,c,a) -#define afterI1(f) f(1,a,b,c,e,d) -#define afterI0(f) f(0,a,d,b,e,c) - -// The instruction sequences for the S-box functions -// come from Dag Arne Osvik's paper "Speeding up Serpent". - -#define S0(i, r0, r1, r2, r3, r4) \ - { \ - r3 ^= r0; \ - r4 = r1; \ - r1 &= r3; \ - r4 ^= r2; \ - r1 ^= r0; \ - r0 |= r3; \ - r0 ^= r4; \ - r4 ^= r3; \ - r3 ^= r2; \ - r2 |= r1; \ - r2 ^= r4; \ - r4 = ~r4; \ - r4 |= r1; \ - r1 ^= r3; \ - r1 ^= r4; \ - r3 |= r0; \ - r1 ^= r3; \ - r4 ^= r3; \ - } - -#define I0(i, r0, r1, r2, r3, r4) \ - { \ - r2 = ~r2; \ - r4 = r1; \ - r1 |= r0; \ - r4 = ~r4; \ - r1 ^= r2; \ - r2 |= r4; \ - r1 ^= r3; \ - r0 ^= r4; \ - r2 ^= r0; \ - r0 &= r3; \ - r4 ^= r0; \ - r0 |= r1; \ - r0 ^= r2; \ - r3 ^= r4; \ - r2 ^= r1; \ - r3 ^= r0; \ - r3 ^= r1; \ - r2 &= r3; \ - r4 ^= r2; \ - } - -#define S1(i, r0, r1, r2, r3, r4) \ - { \ - r0 = ~r0; \ - r2 = ~r2; \ - r4 = r0; \ - r0 &= r1; \ - r2 ^= r0; \ - r0 |= r3; \ - r3 ^= r2; \ - r1 ^= r0; \ - r0 ^= r4; \ - r4 |= r1; \ - r1 ^= r3; \ - r2 |= r0; \ - r2 &= r4; \ - r0 ^= r1; \ - r1 &= r2; \ - r1 ^= r0; \ - r0 &= r2; \ - r0 ^= r4; \ - } - -#define I1(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r1; \ - r1 ^= r3; \ - r3 &= r1; \ - r4 ^= r2; \ - r3 ^= r0; \ - r0 |= r1; \ - r2 ^= r3; \ - r0 ^= r4; \ - r0 |= r2; \ - r1 ^= r3; \ - r0 ^= r1; \ - r1 |= r3; \ - r1 ^= r0; \ - r4 = ~r4; \ - r4 ^= r1; \ - r1 |= r0; \ - r1 ^= r0; \ - r1 |= r4; \ - r3 ^= r1; \ - } - -#define S2(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r0; \ - r0 &= r2; \ - r0 ^= r3; \ - r2 ^= r1; \ - r2 ^= r0; \ - r3 |= r4; \ - r3 ^= r1; \ - r4 ^= r2; \ - r1 = r3; \ - r3 |= r4; \ - r3 ^= r0; \ - r0 &= r1; \ - r4 ^= r0; \ - r1 ^= r3; \ - r1 ^= r4; \ - r4 = ~r4; \ - } - -#define I2(i, r0, r1, r2, r3, r4) \ - { \ - r2 ^= r3; \ - r3 ^= r0; \ - r4 = r3; \ - r3 &= r2; \ - r3 ^= r1; \ - r1 |= r2; \ - r1 ^= r4; \ - r4 &= r3; \ - r2 ^= r3; \ - r4 &= r0; \ - r4 ^= r2; \ - r2 &= r1; \ - r2 |= r0; \ - r3 = ~r3; \ - r2 ^= r3; \ - r0 ^= r3; \ - r0 &= r1; \ - r3 ^= r4; \ - r3 ^= r0; \ - } - -#define S3(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r0; \ - r0 |= r3; \ - r3 ^= r1; \ - r1 &= r4; \ - r4 ^= r2; \ - r2 ^= r3; \ - r3 &= r0; \ - r4 |= r1; \ - r3 ^= r4; \ - r0 ^= r1; \ - r4 &= r0; \ - r1 ^= r3; \ - r4 ^= r2; \ - r1 |= r0; \ - r1 ^= r2; \ - r0 ^= r3; \ - r2 = r1; \ - r1 |= r3; \ - r1 ^= r0; \ - } - -#define I3(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r2; \ - r2 ^= r1; \ - r1 &= r2; \ - r1 ^= r0; \ - r0 &= r4; \ - r4 ^= r3; \ - r3 |= r1; \ - r3 ^= r2; \ - r0 ^= r4; \ - r2 ^= r0; \ - r0 |= r3; \ - r0 ^= r1; \ - r4 ^= r2; \ - r2 &= r3; \ - r1 |= r3; \ - r1 ^= r2; \ - r4 ^= r0; \ - r2 ^= r4; \ - } - -#define S4(i, r0, r1, r2, r3, r4) \ - { \ - r1 ^= r3; \ - r3 = ~r3; \ - r2 ^= r3; \ - r3 ^= r0; \ - r4 = r1; \ - r1 &= r3; \ - r1 ^= r2; \ - r4 ^= r3; \ - r0 ^= r4; \ - r2 &= r4; \ - r2 ^= r0; \ - r0 &= r1; \ - r3 ^= r0; \ - r4 |= r1; \ - r4 ^= r0; \ - r0 |= r3; \ - r0 ^= r2; \ - r2 &= r3; \ - r0 = ~r0; \ - r4 ^= r2; \ - } - -#define I4(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r2; \ - r2 &= r3; \ - r2 ^= r1; \ - r1 |= r3; \ - r1 &= r0; \ - r4 ^= r2; \ - r4 ^= r1; \ - r1 &= r2; \ - r0 = ~r0; \ - r3 ^= r4; \ - r1 ^= r3; \ - r3 &= r0; \ - r3 ^= r2; \ - r0 ^= r1; \ - r2 &= r0; \ - r3 ^= r0; \ - r2 ^= r4; \ - r2 |= r3; \ - r3 ^= r0; \ - r2 ^= r1; \ - } - -#define S5(i, r0, r1, r2, r3, r4) \ - { \ - r0 ^= r1; \ - r1 ^= r3; \ - r3 = ~r3; \ - r4 = r1; \ - r1 &= r0; \ - r2 ^= r3; \ - r1 ^= r2; \ - r2 |= r4; \ - r4 ^= r3; \ - r3 &= r1; \ - r3 ^= r0; \ - r4 ^= r1; \ - r4 ^= r2; \ - r2 ^= r0; \ - r0 &= r3; \ - r2 = ~r2; \ - r0 ^= r4; \ - r4 |= r3; \ - r2 ^= r4; \ - } - -#define I5(i, r0, r1, r2, r3, r4) \ - { \ - r1 = ~r1; \ - r4 = r3; \ - r2 ^= r1; \ - r3 |= r0; \ - r3 ^= r2; \ - r2 |= r1; \ - r2 &= r0; \ - r4 ^= r3; \ - r2 ^= r4; \ - r4 |= r0; \ - r4 ^= r1; \ - r1 &= r2; \ - r1 ^= r3; \ - r4 ^= r2; \ - r3 &= r4; \ - r4 ^= r1; \ - r3 ^= r0; \ - r3 ^= r4; \ - r4 = ~r4; \ - } - -#define S6(i, r0, r1, r2, r3, r4) \ - { \ - r2 = ~r2; \ - r4 = r3; \ - r3 &= r0; \ - r0 ^= r4; \ - r3 ^= r2; \ - r2 |= r4; \ - r1 ^= r3; \ - r2 ^= r0; \ - r0 |= r1; \ - r2 ^= r1; \ - r4 ^= r0; \ - r0 |= r3; \ - r0 ^= r2; \ - r4 ^= r3; \ - r4 ^= r0; \ - r3 = ~r3; \ - r2 &= r4; \ - r2 ^= r3; \ - } - -#define I6(i, r0, r1, r2, r3, r4) \ - { \ - r0 ^= r2; \ - r4 = r2; \ - r2 &= r0; \ - r4 ^= r3; \ - r2 = ~r2; \ - r3 ^= r1; \ - r2 ^= r3; \ - r4 |= r0; \ - r0 ^= r2; \ - r3 ^= r4; \ - r4 ^= r1; \ - r1 &= r3; \ - r1 ^= r0; \ - r0 ^= r3; \ - r0 |= r2; \ - r3 ^= r1; \ - r4 ^= r0; \ - } - -#define S7(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r2; \ - r2 &= r1; \ - r2 ^= r3; \ - r3 &= r1; \ - r4 ^= r2; \ - r2 ^= r1; \ - r1 ^= r0; \ - r0 |= r4; \ - r0 ^= r2; \ - r3 ^= r1; \ - r2 ^= r3; \ - r3 &= r0; \ - r3 ^= r4; \ - r4 ^= r2; \ - r2 &= r0; \ - r4 = ~r4; \ - r2 ^= r4; \ - r4 &= r0; \ - r1 ^= r3; \ - r4 ^= r1; \ - } - -#define I7(i, r0, r1, r2, r3, r4) \ - { \ - r4 = r2; \ - r2 ^= r0; \ - r0 &= r3; \ - r2 = ~r2; \ - r4 |= r3; \ - r3 ^= r1; \ - r1 |= r0; \ - r0 ^= r2; \ - r2 &= r4; \ - r1 ^= r2; \ - r2 ^= r0; \ - r0 |= r2; \ - r3 &= r4; \ - r0 ^= r3; \ - r4 ^= r1; \ - r3 ^= r4; \ - r4 |= r0; \ - r3 ^= r2; \ - r4 ^= r2; \ - } - -// key xor -#define KX(r, a, b, c, d, e) {\ - a ^= k[4 * r + 0]; \ - b ^= k[4 * r + 1]; \ - c ^= k[4 * r + 2]; \ - d ^= k[4 * r + 3];} - -#define LK(r, a, b, c, d, e) {\ - a = k[(8-r)*4 + 0]; \ - b = k[(8-r)*4 + 1]; \ - c = k[(8-r)*4 + 2]; \ - d = k[(8-r)*4 + 3];} - -#define SK(r, a, b, c, d, e) {\ - k[(8-r)*4 + 4] = a; \ - k[(8-r)*4 + 5] = b; \ - k[(8-r)*4 + 6] = c; \ - k[(8-r)*4 + 7] = d;} - -void Serpent_KeySchedule(word32 *k, unsigned int rounds, const byte *userKey, size_t keylen); - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/sha.cpp b/external/crypto++-5.6.3/sha.cpp deleted file mode 100644 index 7b02059ac..000000000 --- a/external/crypto++-5.6.3/sha.cpp +++ /dev/null @@ -1,925 +0,0 @@ -// sha.cpp - modified by Wei Dai from Steve Reid's public domain sha1.c - -// Steve Reid implemented SHA-1. Wei Dai implemented SHA-2. -// Both are in the public domain. - -// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM sha.cpp" to generate MASM code - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4100 4731) -#endif - -#ifndef CRYPTOPP_IMPORTS -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#include "secblock.h" -#include "sha.h" -#include "misc.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -// start of Steve Reid's code - -#define blk0(i) (W[i] = data[i]) -#define blk1(i) (W[i&15] = rotlFixed(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1)) - -void SHA1::InitState(HashWordType *state) -{ - state[0] = 0x67452301L; - state[1] = 0xEFCDAB89L; - state[2] = 0x98BADCFEL; - state[3] = 0x10325476L; - state[4] = 0xC3D2E1F0L; -} - -#define f1(x,y,z) (z^(x&(y^z))) -#define f2(x,y,z) (x^y^z) -#define f3(x,y,z) ((x&y)|(z&(x|y))) -#define f4(x,y,z) (x^y^z) - -/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define R0(v,w,x,y,z,i) z+=f1(w,x,y)+blk0(i)+0x5A827999+rotlFixed(v,5);w=rotlFixed(w,30); -#define R1(v,w,x,y,z,i) z+=f1(w,x,y)+blk1(i)+0x5A827999+rotlFixed(v,5);w=rotlFixed(w,30); -#define R2(v,w,x,y,z,i) z+=f2(w,x,y)+blk1(i)+0x6ED9EBA1+rotlFixed(v,5);w=rotlFixed(w,30); -#define R3(v,w,x,y,z,i) z+=f3(w,x,y)+blk1(i)+0x8F1BBCDC+rotlFixed(v,5);w=rotlFixed(w,30); -#define R4(v,w,x,y,z,i) z+=f4(w,x,y)+blk1(i)+0xCA62C1D6+rotlFixed(v,5);w=rotlFixed(w,30); - -void SHA1::Transform(word32 *state, const word32 *data) -{ - word32 W[16]; - /* Copy context->state[] to working vars */ - word32 a = state[0]; - word32 b = state[1]; - word32 c = state[2]; - word32 d = state[3]; - word32 e = state[4]; - /* 4 rounds of 20 operations each. Loop unrolled. */ - R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); - R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); - R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); - R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); - R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); - R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); - R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); - R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); - R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); - R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); - R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); - R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); - R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); - R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); - R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); - R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); - R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); - R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); - R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); - R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); - /* Add the working vars back into context.state[] */ - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; -} - -// end of Steve Reid's code - -// ************************************************************* - -void SHA224::InitState(HashWordType *state) -{ - static const word32 s[8] = {0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4}; - memcpy(state, s, sizeof(s)); -} - -void SHA256::InitState(HashWordType *state) -{ - static const word32 s[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; - memcpy(state, s, sizeof(s)); -} - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -CRYPTOPP_ALIGN_DATA(16) extern const word32 SHA256_K[64] CRYPTOPP_SECTION_ALIGN16 = { -#else -extern const word32 SHA256_K[64] = { -#endif - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM - -#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_GENERATE_X64_MASM) - -static void CRYPTOPP_FASTCALL X86_SHA256_HashBlocks(word32 *state, const word32 *data, size_t len -#if defined(_MSC_VER) && (_MSC_VER == 1200) - , ... // VC60 workaround: prevent VC 6 from inlining this function -#endif - ) -{ -#if defined(_MSC_VER) && (_MSC_VER == 1200) - AS2(mov ecx, [state]) - AS2(mov edx, [data]) -#endif - - #define LOCALS_SIZE 8*4 + 16*4 + 4*WORD_SZ - #define H(i) [BASE+ASM_MOD(1024+7-(i),8)*4] - #define G(i) H(i+1) - #define F(i) H(i+2) - #define E(i) H(i+3) - #define D(i) H(i+4) - #define C(i) H(i+5) - #define B(i) H(i+6) - #define A(i) H(i+7) - #define Wt(i) BASE+8*4+ASM_MOD(1024+15-(i),16)*4 - #define Wt_2(i) Wt((i)-2) - #define Wt_15(i) Wt((i)-15) - #define Wt_7(i) Wt((i)-7) - #define K_END [BASE+8*4+16*4+0*WORD_SZ] - #define STATE_SAVE [BASE+8*4+16*4+1*WORD_SZ] - #define DATA_SAVE [BASE+8*4+16*4+2*WORD_SZ] - #define DATA_END [BASE+8*4+16*4+3*WORD_SZ] - #define Kt(i) WORD_REG(si)+(i)*4 -#if CRYPTOPP_BOOL_X32 - #define BASE esp+8 -#elif CRYPTOPP_BOOL_X86 - #define BASE esp+4 -#elif defined(__GNUC__) - #define BASE r8 -#else - #define BASE rsp -#endif - -#define RA0(i, edx, edi) \ - AS2( add edx, [Kt(i)] )\ - AS2( add edx, [Wt(i)] )\ - AS2( add edx, H(i) )\ - -#define RA1(i, edx, edi) - -#define RB0(i, edx, edi) - -#define RB1(i, edx, edi) \ - AS2( mov AS_REG_7d, [Wt_2(i)] )\ - AS2( mov edi, [Wt_15(i)])\ - AS2( mov ebx, AS_REG_7d )\ - AS2( shr AS_REG_7d, 10 )\ - AS2( ror ebx, 17 )\ - AS2( xor AS_REG_7d, ebx )\ - AS2( ror ebx, 2 )\ - AS2( xor ebx, AS_REG_7d )/* s1(W_t-2) */\ - AS2( add ebx, [Wt_7(i)])\ - AS2( mov AS_REG_7d, edi )\ - AS2( shr AS_REG_7d, 3 )\ - AS2( ror edi, 7 )\ - AS2( add ebx, [Wt(i)])/* s1(W_t-2) + W_t-7 + W_t-16 */\ - AS2( xor AS_REG_7d, edi )\ - AS2( add edx, [Kt(i)])\ - AS2( ror edi, 11 )\ - AS2( add edx, H(i) )\ - AS2( xor AS_REG_7d, edi )/* s0(W_t-15) */\ - AS2( add AS_REG_7d, ebx )/* W_t = s1(W_t-2) + W_t-7 + s0(W_t-15) W_t-16*/\ - AS2( mov [Wt(i)], AS_REG_7d)\ - AS2( add edx, AS_REG_7d )\ - -#define ROUND(i, r, eax, ecx, edi, edx)\ - /* in: edi = E */\ - /* unused: eax, ecx, temp: ebx, AS_REG_7d, out: edx = T1 */\ - AS2( mov edx, F(i) )\ - AS2( xor edx, G(i) )\ - AS2( and edx, edi )\ - AS2( xor edx, G(i) )/* Ch(E,F,G) = (G^(E&(F^G))) */\ - AS2( mov AS_REG_7d, edi )\ - AS2( ror edi, 6 )\ - AS2( ror AS_REG_7d, 25 )\ - RA##r(i, edx, edi )/* H + Wt + Kt + Ch(E,F,G) */\ - AS2( xor AS_REG_7d, edi )\ - AS2( ror edi, 5 )\ - AS2( xor AS_REG_7d, edi )/* S1(E) */\ - AS2( add edx, AS_REG_7d )/* T1 = S1(E) + Ch(E,F,G) + H + Wt + Kt */\ - RB##r(i, edx, edi )/* H + Wt + Kt + Ch(E,F,G) */\ - /* in: ecx = A, eax = B^C, edx = T1 */\ - /* unused: edx, temp: ebx, AS_REG_7d, out: eax = A, ecx = B^C, edx = E */\ - AS2( mov ebx, ecx )\ - AS2( xor ecx, B(i) )/* A^B */\ - AS2( and eax, ecx )\ - AS2( xor eax, B(i) )/* Maj(A,B,C) = B^((A^B)&(B^C) */\ - AS2( mov AS_REG_7d, ebx )\ - AS2( ror ebx, 2 )\ - AS2( add eax, edx )/* T1 + Maj(A,B,C) */\ - AS2( add edx, D(i) )\ - AS2( mov D(i), edx )\ - AS2( ror AS_REG_7d, 22 )\ - AS2( xor AS_REG_7d, ebx )\ - AS2( ror ebx, 11 )\ - AS2( xor AS_REG_7d, ebx )\ - AS2( add eax, AS_REG_7d )/* T1 + S0(A) + Maj(A,B,C) */\ - AS2( mov H(i), eax )\ - -// Unroll the use of CRYPTOPP_BOOL_X64 in assembler math. The GAS assembler on X32 (version 2.25) -// complains "Error: invalid operands (*ABS* and *UND* sections) for `*` and `-`" -#if CRYPTOPP_BOOL_X64 -#define SWAP_COPY(i) \ - AS2( mov WORD_REG(bx), [WORD_REG(dx)+i*WORD_SZ])\ - AS1( bswap WORD_REG(bx))\ - AS2( mov [Wt(i*2+1)], WORD_REG(bx)) -#else // X86 and X32 -#define SWAP_COPY(i) \ - AS2( mov WORD_REG(bx), [WORD_REG(dx)+i*WORD_SZ])\ - AS1( bswap WORD_REG(bx))\ - AS2( mov [Wt(i)], WORD_REG(bx)) -#endif - -#if defined(__GNUC__) - #if CRYPTOPP_BOOL_X64 - FixedSizeAlignedSecBlock workspace; - #endif - __asm__ __volatile__ - ( - #if CRYPTOPP_BOOL_X64 - "lea %4, %%r8;" - #endif - INTEL_NOPREFIX -#elif defined(CRYPTOPP_GENERATE_X64_MASM) - ALIGN 8 - X86_SHA256_HashBlocks PROC FRAME - rex_push_reg rsi - push_reg rdi - push_reg rbx - push_reg rbp - alloc_stack(LOCALS_SIZE+8) - .endprolog - mov rdi, r8 - lea rsi, [?SHA256_K@CryptoPP@@3QBIB + 48*4] -#endif - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - #ifndef __GNUC__ - AS2( mov edi, [len]) - AS2( lea WORD_REG(si), [SHA256_K+48*4]) - #endif - #if !defined(_MSC_VER) || (_MSC_VER < 1400) - AS_PUSH_IF86(bx) - #endif - - AS_PUSH_IF86(bp) - AS2( mov ebx, esp) - AS2( and esp, -16) - AS2( sub WORD_REG(sp), LOCALS_SIZE) - AS_PUSH_IF86(bx) -#endif - AS2( mov STATE_SAVE, WORD_REG(cx)) - AS2( mov DATA_SAVE, WORD_REG(dx)) - AS2( lea WORD_REG(ax), [WORD_REG(di) + WORD_REG(dx)]) - AS2( mov DATA_END, WORD_REG(ax)) - AS2( mov K_END, WORD_REG(si)) - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( test edi, 1) - ASJ( jnz, 2, f) - AS1( dec DWORD PTR K_END) -#endif - AS2( movdqa xmm0, XMMWORD_PTR [WORD_REG(cx)+0*16]) - AS2( movdqa xmm1, XMMWORD_PTR [WORD_REG(cx)+1*16]) -#endif - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - ASJ( jmp, 0, f) -#endif - ASL(2) // non-SSE2 - AS2( mov esi, ecx) - AS2( lea edi, A(0)) - AS2( mov ecx, 8) - AS1( rep movsd) - AS2( mov esi, K_END) - ASJ( jmp, 3, f) -#endif - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - ASL(0) - AS2( movdqa E(0), xmm1) - AS2( movdqa A(0), xmm0) -#endif -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - ASL(3) -#endif - AS2( sub WORD_REG(si), 48*4) - SWAP_COPY(0) SWAP_COPY(1) SWAP_COPY(2) SWAP_COPY(3) - SWAP_COPY(4) SWAP_COPY(5) SWAP_COPY(6) SWAP_COPY(7) -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - SWAP_COPY(8) SWAP_COPY(9) SWAP_COPY(10) SWAP_COPY(11) - SWAP_COPY(12) SWAP_COPY(13) SWAP_COPY(14) SWAP_COPY(15) -#endif - AS2( mov edi, E(0)) // E - AS2( mov eax, B(0)) // B - AS2( xor eax, C(0)) // B^C - AS2( mov ecx, A(0)) // A - - ROUND(0, 0, eax, ecx, edi, edx) - ROUND(1, 0, ecx, eax, edx, edi) - ROUND(2, 0, eax, ecx, edi, edx) - ROUND(3, 0, ecx, eax, edx, edi) - ROUND(4, 0, eax, ecx, edi, edx) - ROUND(5, 0, ecx, eax, edx, edi) - ROUND(6, 0, eax, ecx, edi, edx) - ROUND(7, 0, ecx, eax, edx, edi) - ROUND(8, 0, eax, ecx, edi, edx) - ROUND(9, 0, ecx, eax, edx, edi) - ROUND(10, 0, eax, ecx, edi, edx) - ROUND(11, 0, ecx, eax, edx, edi) - ROUND(12, 0, eax, ecx, edi, edx) - ROUND(13, 0, ecx, eax, edx, edi) - ROUND(14, 0, eax, ecx, edi, edx) - ROUND(15, 0, ecx, eax, edx, edi) - - ASL(1) - AS2(add WORD_REG(si), 4*16) - ROUND(0, 1, eax, ecx, edi, edx) - ROUND(1, 1, ecx, eax, edx, edi) - ROUND(2, 1, eax, ecx, edi, edx) - ROUND(3, 1, ecx, eax, edx, edi) - ROUND(4, 1, eax, ecx, edi, edx) - ROUND(5, 1, ecx, eax, edx, edi) - ROUND(6, 1, eax, ecx, edi, edx) - ROUND(7, 1, ecx, eax, edx, edi) - ROUND(8, 1, eax, ecx, edi, edx) - ROUND(9, 1, ecx, eax, edx, edi) - ROUND(10, 1, eax, ecx, edi, edx) - ROUND(11, 1, ecx, eax, edx, edi) - ROUND(12, 1, eax, ecx, edi, edx) - ROUND(13, 1, ecx, eax, edx, edi) - ROUND(14, 1, eax, ecx, edi, edx) - ROUND(15, 1, ecx, eax, edx, edi) - AS2( cmp WORD_REG(si), K_END) - ASJ( jb, 1, b) - - AS2( mov WORD_REG(dx), DATA_SAVE) - AS2( add WORD_REG(dx), 64) - AS2( mov AS_REG_7, STATE_SAVE) - AS2( mov DATA_SAVE, WORD_REG(dx)) - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( test DWORD PTR K_END, 1) - ASJ( jz, 4, f) -#endif - AS2( movdqa xmm1, XMMWORD_PTR [AS_REG_7+1*16]) - AS2( movdqa xmm0, XMMWORD_PTR [AS_REG_7+0*16]) - AS2( paddd xmm1, E(0)) - AS2( paddd xmm0, A(0)) - AS2( movdqa [AS_REG_7+1*16], xmm1) - AS2( movdqa [AS_REG_7+0*16], xmm0) - AS2( cmp WORD_REG(dx), DATA_END) - ASJ( jb, 0, b) -#endif - -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - ASJ( jmp, 5, f) - ASL(4) // non-SSE2 -#endif - AS2( add [AS_REG_7+0*4], ecx) // A - AS2( add [AS_REG_7+4*4], edi) // E - AS2( mov eax, B(0)) - AS2( mov ebx, C(0)) - AS2( mov ecx, D(0)) - AS2( add [AS_REG_7+1*4], eax) - AS2( add [AS_REG_7+2*4], ebx) - AS2( add [AS_REG_7+3*4], ecx) - AS2( mov eax, F(0)) - AS2( mov ebx, G(0)) - AS2( mov ecx, H(0)) - AS2( add [AS_REG_7+5*4], eax) - AS2( add [AS_REG_7+6*4], ebx) - AS2( add [AS_REG_7+7*4], ecx) - AS2( mov ecx, AS_REG_7d) - AS2( cmp WORD_REG(dx), DATA_END) - ASJ( jb, 2, b) -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - ASL(5) -#endif -#endif - - AS_POP_IF86(sp) - AS_POP_IF86(bp) - #if !defined(_MSC_VER) || (_MSC_VER < 1400) - AS_POP_IF86(bx) - #endif - -#ifdef CRYPTOPP_GENERATE_X64_MASM - add rsp, LOCALS_SIZE+8 - pop rbp - pop rbx - pop rdi - pop rsi - ret - X86_SHA256_HashBlocks ENDP -#endif - -#ifdef __GNUC__ - ATT_PREFIX - : - : "c" (state), "d" (data), "S" (SHA256_K+48), "D" (len) - #if CRYPTOPP_BOOL_X64 - , "m" (workspace[0]) - #endif - : "memory", "cc", "%eax" - #if CRYPTOPP_BOOL_X64 - , "%rbx", "%r8", "%r10" - #endif - ); -#endif -} - -#endif // (defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_GENERATE_X64_MASM)) - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -void CRYPTOPP_FASTCALL X86_SHA256_HashBlocks(word32 *state, const word32 *data, size_t len); -} -#endif - -#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) - -size_t SHA256::HashMultipleBlocks(const word32 *input, size_t length) -{ - X86_SHA256_HashBlocks(m_state, input, (length&(size_t(0)-BLOCKSIZE)) - !HasSSE2()); - return length % BLOCKSIZE; -} - -size_t SHA224::HashMultipleBlocks(const word32 *input, size_t length) -{ - X86_SHA256_HashBlocks(m_state, input, (length&(size_t(0)-BLOCKSIZE)) - !HasSSE2()); - return length % BLOCKSIZE; -} - -#endif - -#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15])) - -#define Ch(x,y,z) (z^(x&(y^z))) -#define Maj(x,y,z) (y^((x^y)&(y^z))) - -#define a(i) T[(0-i)&7] -#define b(i) T[(1-i)&7] -#define c(i) T[(2-i)&7] -#define d(i) T[(3-i)&7] -#define e(i) T[(4-i)&7] -#define f(i) T[(5-i)&7] -#define g(i) T[(6-i)&7] -#define h(i) T[(7-i)&7] - -#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+SHA256_K[i+j]+(j?blk2(i):blk0(i));\ - d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) - -// for SHA256 -#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22)) -#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25)) -#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3)) -#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10)) - -void SHA256::Transform(word32 *state, const word32 *data) -{ - word32 W[16]; -#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) - // this byte reverse is a waste of time, but this function is only called by MDC - ByteReverse(W, data, BLOCKSIZE); - X86_SHA256_HashBlocks(state, W, BLOCKSIZE - !HasSSE2()); -#else - word32 T[8]; - /* Copy context->state[] to working vars */ - memcpy(T, state, sizeof(T)); - /* 64 operations, partially loop unrolled */ - for (unsigned int j=0; j<64; j+=16) - { - R( 0); R( 1); R( 2); R( 3); - R( 4); R( 5); R( 6); R( 7); - R( 8); R( 9); R(10); R(11); - R(12); R(13); R(14); R(15); - } - /* Add the working vars back into context.state[] */ - state[0] += a(0); - state[1] += b(0); - state[2] += c(0); - state[3] += d(0); - state[4] += e(0); - state[5] += f(0); - state[6] += g(0); - state[7] += h(0); -#endif -} - -/* -// smaller but slower -void SHA256::Transform(word32 *state, const word32 *data) -{ - word32 T[20]; - word32 W[32]; - unsigned int i = 0, j = 0; - word32 *t = T+8; - - memcpy(t, state, 8*4); - word32 e = t[4], a = t[0]; - - do - { - word32 w = data[j]; - W[j] = w; - w += SHA256_K[j]; - w += t[7]; - w += S1(e); - w += Ch(e, t[5], t[6]); - e = t[3] + w; - t[3] = t[3+8] = e; - w += S0(t[0]); - a = w + Maj(a, t[1], t[2]); - t[-1] = t[7] = a; - --t; - ++j; - if (j%8 == 0) - t += 8; - } while (j<16); - - do - { - i = j&0xf; - word32 w = s1(W[i+16-2]) + s0(W[i+16-15]) + W[i] + W[i+16-7]; - W[i+16] = W[i] = w; - w += SHA256_K[j]; - w += t[7]; - w += S1(e); - w += Ch(e, t[5], t[6]); - e = t[3] + w; - t[3] = t[3+8] = e; - w += S0(t[0]); - a = w + Maj(a, t[1], t[2]); - t[-1] = t[7] = a; - - w = s1(W[(i+1)+16-2]) + s0(W[(i+1)+16-15]) + W[(i+1)] + W[(i+1)+16-7]; - W[(i+1)+16] = W[(i+1)] = w; - w += SHA256_K[j+1]; - w += (t-1)[7]; - w += S1(e); - w += Ch(e, (t-1)[5], (t-1)[6]); - e = (t-1)[3] + w; - (t-1)[3] = (t-1)[3+8] = e; - w += S0((t-1)[0]); - a = w + Maj(a, (t-1)[1], (t-1)[2]); - (t-1)[-1] = (t-1)[7] = a; - - t-=2; - j+=2; - if (j%8 == 0) - t += 8; - } while (j<64); - - state[0] += a; - state[1] += t[1]; - state[2] += t[2]; - state[3] += t[3]; - state[4] += e; - state[5] += t[5]; - state[6] += t[6]; - state[7] += t[7]; -} -*/ - -#undef S0 -#undef S1 -#undef s0 -#undef s1 -#undef R - -// ************************************************************* - -void SHA384::InitState(HashWordType *state) -{ - static const word64 s[8] = { - W64LIT(0xcbbb9d5dc1059ed8), W64LIT(0x629a292a367cd507), - W64LIT(0x9159015a3070dd17), W64LIT(0x152fecd8f70e5939), - W64LIT(0x67332667ffc00b31), W64LIT(0x8eb44a8768581511), - W64LIT(0xdb0c2e0d64f98fa7), W64LIT(0x47b5481dbefa4fa4)}; - memcpy(state, s, sizeof(s)); -} - -void SHA512::InitState(HashWordType *state) -{ - static const word64 s[8] = { - W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b), - W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1), - W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f), - W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179)}; - memcpy(state, s, sizeof(s)); -} - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) -CRYPTOPP_ALIGN_DATA(16) static const word64 SHA512_K[80] CRYPTOPP_SECTION_ALIGN16 = { -#else -static const word64 SHA512_K[80] = { -#endif - W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd), - W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc), - W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019), - W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118), - W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe), - W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2), - W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1), - W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694), - W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3), - W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65), - W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483), - W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5), - W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210), - W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4), - W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725), - W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70), - W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926), - W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df), - W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8), - W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b), - W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001), - W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30), - W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910), - W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8), - W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53), - W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8), - W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb), - W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3), - W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60), - W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec), - W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9), - W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b), - W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207), - W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178), - W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6), - W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b), - W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493), - W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c), - W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a), - W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817) -}; - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) -// put assembly version in separate function, otherwise MSVC 2005 SP1 doesn't generate correct code for the non-assembly version -CRYPTOPP_NAKED static void CRYPTOPP_FASTCALL SHA512_SSE2_Transform(word64 *state, const word64 *data) -{ -#ifdef __GNUC__ - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS_PUSH_IF86( bx) - AS2( mov ebx, eax) -#else - AS1( push ebx) - AS1( push esi) - AS1( push edi) - AS2( lea ebx, SHA512_K) -#endif - - AS2( mov eax, esp) - AS2( and esp, 0xfffffff0) - AS2( sub esp, 27*16) // 17*16 for expanded data, 20*8 for state - AS_PUSH_IF86( ax) - AS2( xor eax, eax) - -#if CRYPTOPP_BOOL_X32 - AS2( lea edi, [esp+8+8*8]) // start at middle of state buffer. will decrement pointer each round to avoid copying - AS2( lea esi, [esp+8+20*8+8]) // 16-byte alignment, then add 8 -#else - AS2( lea edi, [esp+4+8*8]) // start at middle of state buffer. will decrement pointer each round to avoid copying - AS2( lea esi, [esp+4+20*8+8]) // 16-byte alignment, then add 8 -#endif - - AS2( movdqa xmm0, [ecx+0*16]) - AS2( movdq2q mm4, xmm0) - AS2( movdqa [edi+0*16], xmm0) - AS2( movdqa xmm0, [ecx+1*16]) - AS2( movdqa [edi+1*16], xmm0) - AS2( movdqa xmm0, [ecx+2*16]) - AS2( movdq2q mm5, xmm0) - AS2( movdqa [edi+2*16], xmm0) - AS2( movdqa xmm0, [ecx+3*16]) - AS2( movdqa [edi+3*16], xmm0) - ASJ( jmp, 0, f) - -#define SSE2_S0_S1(r, a, b, c) \ - AS2( movq mm6, r)\ - AS2( psrlq r, a)\ - AS2( movq mm7, r)\ - AS2( psllq mm6, 64-c)\ - AS2( pxor mm7, mm6)\ - AS2( psrlq r, b-a)\ - AS2( pxor mm7, r)\ - AS2( psllq mm6, c-b)\ - AS2( pxor mm7, mm6)\ - AS2( psrlq r, c-b)\ - AS2( pxor r, mm7)\ - AS2( psllq mm6, b-a)\ - AS2( pxor r, mm6) - -#define SSE2_s0(r, a, b, c) \ - AS2( movdqa xmm6, r)\ - AS2( psrlq r, a)\ - AS2( movdqa xmm7, r)\ - AS2( psllq xmm6, 64-c)\ - AS2( pxor xmm7, xmm6)\ - AS2( psrlq r, b-a)\ - AS2( pxor xmm7, r)\ - AS2( psrlq r, c-b)\ - AS2( pxor r, xmm7)\ - AS2( psllq xmm6, c-a)\ - AS2( pxor r, xmm6) - -#define SSE2_s1(r, a, b, c) \ - AS2( movdqa xmm6, r)\ - AS2( psrlq r, a)\ - AS2( movdqa xmm7, r)\ - AS2( psllq xmm6, 64-c)\ - AS2( pxor xmm7, xmm6)\ - AS2( psrlq r, b-a)\ - AS2( pxor xmm7, r)\ - AS2( psllq xmm6, c-b)\ - AS2( pxor xmm7, xmm6)\ - AS2( psrlq r, c-b)\ - AS2( pxor r, xmm7) - - ASL(SHA512_Round) - // k + w is in mm0, a is in mm4, e is in mm5 - AS2( paddq mm0, [edi+7*8]) // h - AS2( movq mm2, [edi+5*8]) // f - AS2( movq mm3, [edi+6*8]) // g - AS2( pxor mm2, mm3) - AS2( pand mm2, mm5) - SSE2_S0_S1(mm5,14,18,41) - AS2( pxor mm2, mm3) - AS2( paddq mm0, mm2) // h += Ch(e,f,g) - AS2( paddq mm5, mm0) // h += S1(e) - AS2( movq mm2, [edi+1*8]) // b - AS2( movq mm1, mm2) - AS2( por mm2, mm4) - AS2( pand mm2, [edi+2*8]) // c - AS2( pand mm1, mm4) - AS2( por mm1, mm2) - AS2( paddq mm1, mm5) // temp = h + Maj(a,b,c) - AS2( paddq mm5, [edi+3*8]) // e = d + h - AS2( movq [edi+3*8], mm5) - AS2( movq [edi+11*8], mm5) - SSE2_S0_S1(mm4,28,34,39) // S0(a) - AS2( paddq mm4, mm1) // a = temp + S0(a) - AS2( movq [edi-8], mm4) - AS2( movq [edi+7*8], mm4) - AS1( ret) - - // first 16 rounds - ASL(0) - AS2( movq mm0, [edx+eax*8]) - AS2( movq [esi+eax*8], mm0) - AS2( movq [esi+eax*8+16*8], mm0) - AS2( paddq mm0, [ebx+eax*8]) - ASC( call, SHA512_Round) - AS1( inc eax) - AS2( sub edi, 8) - AS2( test eax, 7) - ASJ( jnz, 0, b) - AS2( add edi, 8*8) - AS2( cmp eax, 16) - ASJ( jne, 0, b) - - // rest of the rounds - AS2( movdqu xmm0, [esi+(16-2)*8]) - ASL(1) - // data expansion, W[i-2] already in xmm0 - AS2( movdqu xmm3, [esi]) - AS2( paddq xmm3, [esi+(16-7)*8]) - AS2( movdqa xmm2, [esi+(16-15)*8]) - SSE2_s1(xmm0, 6, 19, 61) - AS2( paddq xmm0, xmm3) - SSE2_s0(xmm2, 1, 7, 8) - AS2( paddq xmm0, xmm2) - AS2( movdq2q mm0, xmm0) - AS2( movhlps xmm1, xmm0) - AS2( paddq mm0, [ebx+eax*8]) - AS2( movlps [esi], xmm0) - AS2( movlps [esi+8], xmm1) - AS2( movlps [esi+8*16], xmm0) - AS2( movlps [esi+8*17], xmm1) - // 2 rounds - ASC( call, SHA512_Round) - AS2( sub edi, 8) - AS2( movdq2q mm0, xmm1) - AS2( paddq mm0, [ebx+eax*8+8]) - ASC( call, SHA512_Round) - // update indices and loop - AS2( add esi, 16) - AS2( add eax, 2) - AS2( sub edi, 8) - AS2( test eax, 7) - ASJ( jnz, 1, b) - // do housekeeping every 8 rounds - AS2( mov esi, 0xf) - AS2( and esi, eax) -#if CRYPTOPP_BOOL_X32 - AS2( lea esi, [esp+8+20*8+8+esi*8]) -#else - AS2( lea esi, [esp+4+20*8+8+esi*8]) -#endif - AS2( add edi, 8*8) - AS2( cmp eax, 80) - ASJ( jne, 1, b) - -#define SSE2_CombineState(i) \ - AS2( movdqa xmm0, [edi+i*16])\ - AS2( paddq xmm0, [ecx+i*16])\ - AS2( movdqa [ecx+i*16], xmm0) - - SSE2_CombineState(0) - SSE2_CombineState(1) - SSE2_CombineState(2) - SSE2_CombineState(3) - - AS_POP_IF86( sp) - AS1( emms) - -#if defined(__GNUC__) - AS_POP_IF86( bx) - ATT_PREFIX - : - : "a" (SHA512_K), "c" (state), "d" (data) - : "%esi", "%edi", "memory", "cc" - ); -#else - AS1( pop edi) - AS1( pop esi) - AS1( pop ebx) - AS1( ret) -#endif -} -#endif // #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - -void SHA512::Transform(word64 *state, const word64 *data) -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) - if (HasSSE2()) - { - SHA512_SSE2_Transform(state, data); - return; - } -#endif - -#define S0(x) (rotrFixed(x,28)^rotrFixed(x,34)^rotrFixed(x,39)) -#define S1(x) (rotrFixed(x,14)^rotrFixed(x,18)^rotrFixed(x,41)) -#define s0(x) (rotrFixed(x,1)^rotrFixed(x,8)^(x>>7)) -#define s1(x) (rotrFixed(x,19)^rotrFixed(x,61)^(x>>6)) - -#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+SHA512_K[i+j]+(j?blk2(i):blk0(i));\ - d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) - - word64 W[16]; - word64 T[8]; - /* Copy context->state[] to working vars */ - memcpy(T, state, sizeof(T)); - /* 80 operations, partially loop unrolled */ - for (unsigned int j=0; j<80; j+=16) - { - R( 0); R( 1); R( 2); R( 3); - R( 4); R( 5); R( 6); R( 7); - R( 8); R( 9); R(10); R(11); - R(12); R(13); R(14); R(15); - } - /* Add the working vars back into context.state[] */ - state[0] += a(0); - state[1] += b(0); - state[2] += c(0); - state[3] += d(0); - state[4] += e(0); - state[5] += f(0); - state[6] += g(0); - state[7] += h(0); -} - -NAMESPACE_END - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM -#endif // #ifndef CRYPTOPP_IMPORTS diff --git a/external/crypto++-5.6.3/sha.h b/external/crypto++-5.6.3/sha.h deleted file mode 100644 index bf6d1227f..000000000 --- a/external/crypto++-5.6.3/sha.h +++ /dev/null @@ -1,70 +0,0 @@ -// sha.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile sha.h -//! \brief Classes for SHA-1 and SHA-2 family of message digests - -#ifndef CRYPTOPP_SHA_H -#define CRYPTOPP_SHA_H - -#include "config.h" -#include "iterhash.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// SHA-1 -class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform -{ -public: - static void CRYPTOPP_API InitState(HashWordType *state); - static void CRYPTOPP_API Transform(word32 *digest, const word32 *data); - static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-1";} -}; - -typedef SHA1 SHA; // for backwards compatibility - -//! implements the SHA-256 standard -class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform -{ -public: -#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) && !defined(CRYPTOPP_DISABLE_SHA_ASM) - size_t HashMultipleBlocks(const word32 *input, size_t length); -#endif - static void CRYPTOPP_API InitState(HashWordType *state); - static void CRYPTOPP_API Transform(word32 *digest, const word32 *data); - static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-256";} -}; - -//! implements the SHA-224 standard -class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform -{ -public: -#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE) && !defined(CRYPTOPP_DISABLE_SHA_ASM) - size_t HashMultipleBlocks(const word32 *input, size_t length); -#endif - static void CRYPTOPP_API InitState(HashWordType *state); - static void CRYPTOPP_API Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);} - static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-224";} -}; - -//! implements the SHA-512 standard -class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform -{ -public: - static void CRYPTOPP_API InitState(HashWordType *state); - static void CRYPTOPP_API Transform(word64 *digest, const word64 *data); - static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-512";} -}; - -//! implements the SHA-384 standard -class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform -{ -public: - static void CRYPTOPP_API InitState(HashWordType *state); - static void CRYPTOPP_API Transform(word64 *digest, const word64 *data) {SHA512::Transform(digest, data);} - static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-384";} -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/sha3.cpp b/external/crypto++-5.6.3/sha3.cpp deleted file mode 100644 index 987975612..000000000 --- a/external/crypto++-5.6.3/sha3.cpp +++ /dev/null @@ -1,290 +0,0 @@ -// sha3.cpp - modified by Wei Dai from Ronny Van Keer's public domain Keccak-simple.c -// all modifications here are placed in the public domain by Wei Dai - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michael Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by Ronny Van Keer, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#include "pch.h" -#include "sha3.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const word64 KeccakF_RoundConstants[24] = -{ - W64LIT(0x0000000000000001), W64LIT(0x0000000000008082), W64LIT(0x800000000000808a), - W64LIT(0x8000000080008000), W64LIT(0x000000000000808b), W64LIT(0x0000000080000001), - W64LIT(0x8000000080008081), W64LIT(0x8000000000008009), W64LIT(0x000000000000008a), - W64LIT(0x0000000000000088), W64LIT(0x0000000080008009), W64LIT(0x000000008000000a), - W64LIT(0x000000008000808b), W64LIT(0x800000000000008b), W64LIT(0x8000000000008089), - W64LIT(0x8000000000008003), W64LIT(0x8000000000008002), W64LIT(0x8000000000000080), - W64LIT(0x000000000000800a), W64LIT(0x800000008000000a), W64LIT(0x8000000080008081), - W64LIT(0x8000000000008080), W64LIT(0x0000000080000001), W64LIT(0x8000000080008008) -}; - -static void KeccakF1600(word64 *state) -{ - { - word64 Aba, Abe, Abi, Abo, Abu; - word64 Aga, Age, Agi, Ago, Agu; - word64 Aka, Ake, Aki, Ako, Aku; - word64 Ama, Ame, Ami, Amo, Amu; - word64 Asa, Ase, Asi, Aso, Asu; - word64 BCa, BCe, BCi, BCo, BCu; - word64 Da, De, Di, Do, Du; - word64 Eba, Ebe, Ebi, Ebo, Ebu; - word64 Ega, Ege, Egi, Ego, Egu; - word64 Eka, Eke, Eki, Eko, Eku; - word64 Ema, Eme, Emi, Emo, Emu; - word64 Esa, Ese, Esi, Eso, Esu; - - //copyFromState(A, state) - typedef BlockGetAndPut Block; - Block::Get(state)(Aba)(Abe)(Abi)(Abo)(Abu)(Aga)(Age)(Agi)(Ago)(Agu)(Aka)(Ake)(Aki)(Ako)(Aku)(Ama)(Ame)(Ami)(Amo)(Amu)(Asa)(Ase)(Asi)(Aso)(Asu); - - for( unsigned int round = 0; round < 24; round += 2 ) - { - // prepareTheta - BCa = Aba^Aga^Aka^Ama^Asa; - BCe = Abe^Age^Ake^Ame^Ase; - BCi = Abi^Agi^Aki^Ami^Asi; - BCo = Abo^Ago^Ako^Amo^Aso; - BCu = Abu^Agu^Aku^Amu^Asu; - - //thetaRhoPiChiIotaPrepareTheta(round , A, E) - Da = BCu^rotlFixed(BCe, 1); - De = BCa^rotlFixed(BCi, 1); - Di = BCe^rotlFixed(BCo, 1); - Do = BCi^rotlFixed(BCu, 1); - Du = BCo^rotlFixed(BCa, 1); - - Aba ^= Da; - BCa = Aba; - Age ^= De; - BCe = rotlFixed(Age, 44); - Aki ^= Di; - BCi = rotlFixed(Aki, 43); - Amo ^= Do; - BCo = rotlFixed(Amo, 21); - Asu ^= Du; - BCu = rotlFixed(Asu, 14); - Eba = BCa ^((~BCe)& BCi ); - Eba ^= (word64)KeccakF_RoundConstants[round]; - Ebe = BCe ^((~BCi)& BCo ); - Ebi = BCi ^((~BCo)& BCu ); - Ebo = BCo ^((~BCu)& BCa ); - Ebu = BCu ^((~BCa)& BCe ); - - Abo ^= Do; - BCa = rotlFixed(Abo, 28); - Agu ^= Du; - BCe = rotlFixed(Agu, 20); - Aka ^= Da; - BCi = rotlFixed(Aka, 3); - Ame ^= De; - BCo = rotlFixed(Ame, 45); - Asi ^= Di; - BCu = rotlFixed(Asi, 61); - Ega = BCa ^((~BCe)& BCi ); - Ege = BCe ^((~BCi)& BCo ); - Egi = BCi ^((~BCo)& BCu ); - Ego = BCo ^((~BCu)& BCa ); - Egu = BCu ^((~BCa)& BCe ); - - Abe ^= De; - BCa = rotlFixed(Abe, 1); - Agi ^= Di; - BCe = rotlFixed(Agi, 6); - Ako ^= Do; - BCi = rotlFixed(Ako, 25); - Amu ^= Du; - BCo = rotlFixed(Amu, 8); - Asa ^= Da; - BCu = rotlFixed(Asa, 18); - Eka = BCa ^((~BCe)& BCi ); - Eke = BCe ^((~BCi)& BCo ); - Eki = BCi ^((~BCo)& BCu ); - Eko = BCo ^((~BCu)& BCa ); - Eku = BCu ^((~BCa)& BCe ); - - Abu ^= Du; - BCa = rotlFixed(Abu, 27); - Aga ^= Da; - BCe = rotlFixed(Aga, 36); - Ake ^= De; - BCi = rotlFixed(Ake, 10); - Ami ^= Di; - BCo = rotlFixed(Ami, 15); - Aso ^= Do; - BCu = rotlFixed(Aso, 56); - Ema = BCa ^((~BCe)& BCi ); - Eme = BCe ^((~BCi)& BCo ); - Emi = BCi ^((~BCo)& BCu ); - Emo = BCo ^((~BCu)& BCa ); - Emu = BCu ^((~BCa)& BCe ); - - Abi ^= Di; - BCa = rotlFixed(Abi, 62); - Ago ^= Do; - BCe = rotlFixed(Ago, 55); - Aku ^= Du; - BCi = rotlFixed(Aku, 39); - Ama ^= Da; - BCo = rotlFixed(Ama, 41); - Ase ^= De; - BCu = rotlFixed(Ase, 2); - Esa = BCa ^((~BCe)& BCi ); - Ese = BCe ^((~BCi)& BCo ); - Esi = BCi ^((~BCo)& BCu ); - Eso = BCo ^((~BCu)& BCa ); - Esu = BCu ^((~BCa)& BCe ); - - // prepareTheta - BCa = Eba^Ega^Eka^Ema^Esa; - BCe = Ebe^Ege^Eke^Eme^Ese; - BCi = Ebi^Egi^Eki^Emi^Esi; - BCo = Ebo^Ego^Eko^Emo^Eso; - BCu = Ebu^Egu^Eku^Emu^Esu; - - //thetaRhoPiChiIotaPrepareTheta(round+1, E, A) - Da = BCu^rotlFixed(BCe, 1); - De = BCa^rotlFixed(BCi, 1); - Di = BCe^rotlFixed(BCo, 1); - Do = BCi^rotlFixed(BCu, 1); - Du = BCo^rotlFixed(BCa, 1); - - Eba ^= Da; - BCa = Eba; - Ege ^= De; - BCe = rotlFixed(Ege, 44); - Eki ^= Di; - BCi = rotlFixed(Eki, 43); - Emo ^= Do; - BCo = rotlFixed(Emo, 21); - Esu ^= Du; - BCu = rotlFixed(Esu, 14); - Aba = BCa ^((~BCe)& BCi ); - Aba ^= (word64)KeccakF_RoundConstants[round+1]; - Abe = BCe ^((~BCi)& BCo ); - Abi = BCi ^((~BCo)& BCu ); - Abo = BCo ^((~BCu)& BCa ); - Abu = BCu ^((~BCa)& BCe ); - - Ebo ^= Do; - BCa = rotlFixed(Ebo, 28); - Egu ^= Du; - BCe = rotlFixed(Egu, 20); - Eka ^= Da; - BCi = rotlFixed(Eka, 3); - Eme ^= De; - BCo = rotlFixed(Eme, 45); - Esi ^= Di; - BCu = rotlFixed(Esi, 61); - Aga = BCa ^((~BCe)& BCi ); - Age = BCe ^((~BCi)& BCo ); - Agi = BCi ^((~BCo)& BCu ); - Ago = BCo ^((~BCu)& BCa ); - Agu = BCu ^((~BCa)& BCe ); - - Ebe ^= De; - BCa = rotlFixed(Ebe, 1); - Egi ^= Di; - BCe = rotlFixed(Egi, 6); - Eko ^= Do; - BCi = rotlFixed(Eko, 25); - Emu ^= Du; - BCo = rotlFixed(Emu, 8); - Esa ^= Da; - BCu = rotlFixed(Esa, 18); - Aka = BCa ^((~BCe)& BCi ); - Ake = BCe ^((~BCi)& BCo ); - Aki = BCi ^((~BCo)& BCu ); - Ako = BCo ^((~BCu)& BCa ); - Aku = BCu ^((~BCa)& BCe ); - - Ebu ^= Du; - BCa = rotlFixed(Ebu, 27); - Ega ^= Da; - BCe = rotlFixed(Ega, 36); - Eke ^= De; - BCi = rotlFixed(Eke, 10); - Emi ^= Di; - BCo = rotlFixed(Emi, 15); - Eso ^= Do; - BCu = rotlFixed(Eso, 56); - Ama = BCa ^((~BCe)& BCi ); - Ame = BCe ^((~BCi)& BCo ); - Ami = BCi ^((~BCo)& BCu ); - Amo = BCo ^((~BCu)& BCa ); - Amu = BCu ^((~BCa)& BCe ); - - Ebi ^= Di; - BCa = rotlFixed(Ebi, 62); - Ego ^= Do; - BCe = rotlFixed(Ego, 55); - Eku ^= Du; - BCi = rotlFixed(Eku, 39); - Ema ^= Da; - BCo = rotlFixed(Ema, 41); - Ese ^= De; - BCu = rotlFixed(Ese, 2); - Asa = BCa ^((~BCe)& BCi ); - Ase = BCe ^((~BCi)& BCo ); - Asi = BCi ^((~BCo)& BCu ); - Aso = BCo ^((~BCu)& BCa ); - Asu = BCu ^((~BCa)& BCe ); - } - - //copyToState(state, A) - Block::Put(NULL, state)(Aba)(Abe)(Abi)(Abo)(Abu)(Aga)(Age)(Agi)(Ago)(Agu)(Aka)(Ake)(Aki)(Ako)(Aku)(Ama)(Ame)(Ami)(Amo)(Amu)(Asa)(Ase)(Asi)(Aso)(Asu); - } -} - -void SHA3::Update(const byte *input, size_t length) -{ - assert((input && length) || !(input || length)); - if (!length) - return; - - size_t spaceLeft; - while (length >= (spaceLeft = r() - m_counter)) - { - if (spaceLeft) - xorbuf(m_state.BytePtr() + m_counter, input, spaceLeft); - KeccakF1600(m_state); - input += spaceLeft; - length -= spaceLeft; - m_counter = 0; - } - - if (length) - xorbuf(m_state.BytePtr() + m_counter, input, length); - m_counter += (unsigned int)length; -} - -void SHA3::Restart() -{ - memset(m_state, 0, m_state.SizeInBytes()); - m_counter = 0; -} - -void SHA3::TruncatedFinal(byte *hash, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - m_state.BytePtr()[m_counter] ^= 1; - m_state.BytePtr()[r()-1] ^= 0x80; - KeccakF1600(m_state); - memcpy(hash, m_state, size); - Restart(); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/sha3.h b/external/crypto++-5.6.3/sha3.h deleted file mode 100644 index 5183e52db..000000000 --- a/external/crypto++-5.6.3/sha3.h +++ /dev/null @@ -1,69 +0,0 @@ -// sha3.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile sha3.h -//! \brief Classes for SHA-3 message digests - -#ifndef CRYPTOPP_SHA3_H -#define CRYPTOPP_SHA3_H - -#include "cryptlib.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// SHA-3 -class SHA3 : public HashTransformation -{ -public: - SHA3(unsigned int digestSize) : m_digestSize(digestSize) {Restart();} - unsigned int DigestSize() const {return m_digestSize;} - std::string AlgorithmName() const {return "SHA-3-" + IntToString(m_digestSize*8);} - unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} - - void Update(const byte *input, size_t length); - void Restart(); - void TruncatedFinal(byte *hash, size_t size); - -protected: - inline unsigned int r() const {return 200 - 2 * m_digestSize;} - - FixedSizeSecBlock m_state; - unsigned int m_digestSize, m_counter; -}; - -class SHA3_224 : public SHA3 -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 28) - SHA3_224() : SHA3(DIGESTSIZE) {} - static const char * StaticAlgorithmName() {return "SHA-3-224";} -}; - -class SHA3_256 : public SHA3 -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 32) - SHA3_256() : SHA3(DIGESTSIZE) {} - static const char * StaticAlgorithmName() {return "SHA-3-256";} -}; - -class SHA3_384 : public SHA3 -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 48) - SHA3_384() : SHA3(DIGESTSIZE) {} - static const char * StaticAlgorithmName() {return "SHA-3-384";} -}; - -class SHA3_512 : public SHA3 -{ -public: - CRYPTOPP_CONSTANT(DIGESTSIZE = 64) - SHA3_512() : SHA3(DIGESTSIZE) {} - static const char * StaticAlgorithmName() {return "SHA-3-512";} -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/shacal2.cpp b/external/crypto++-5.6.3/shacal2.cpp deleted file mode 100644 index b0360e404..000000000 --- a/external/crypto++-5.6.3/shacal2.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// shacal2.cpp - by Kevin Springle, 2003 -// -// Portions of this code were derived from -// Wei Dai's implementation of SHA-2 -// -// The original code and all modifications are in the public domain. - -#include "pch.h" -#include "shacal2.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -// SHACAL-2 function and round definitions - -#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22)) -#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25)) -#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3)) -#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10)) - -#define Ch(x,y,z) (z^(x&(y^z))) -#define Maj(x,y,z) ((x&y)|(z&(x|y))) - -/* R is the SHA-256 round function. */ -/* This macro increments the k argument as a side effect. */ -#define R(a,b,c,d,e,f,g,h,k) \ - h+=S1(e)+Ch(e,f,g)+*k++;d+=h;h+=S0(a)+Maj(a,b,c); - -/* P is the inverse of the SHA-256 round function. */ -/* This macro decrements the k argument as a side effect. */ -#define P(a,b,c,d,e,f,g,h,k) \ - h-=S0(a)+Maj(a,b,c);d-=h;h-=S1(e)+Ch(e,f,g)+*--k; - -void SHACAL2::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, const NameValuePairs &) -{ - AssertValidKeyLength(keylen); - - word32 *rk = m_key; - unsigned int i; - - GetUserKey(BIG_ENDIAN_ORDER, rk, m_key.size(), userKey, keylen); - for (i = 0; i < 48; i++, rk++) - { - rk[16] = rk[0] + s0(rk[1]) + rk[9] + s1(rk[14]); - rk[0] += K[i]; - } - for (i = 48; i < 64; i++, rk++) - { - rk[0] += K[i]; - } -} - -typedef BlockGetAndPut Block; - -void SHACAL2::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 a, b, c, d, e, f, g, h; - const word32 *rk = m_key; - - /* - * map byte array block to cipher state: - */ - Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); - - // Perform SHA-256 transformation. - - /* 64 operations, partially loop unrolled */ - for (unsigned int j=0; j<64; j+=8) - { - R(a,b,c,d,e,f,g,h,rk); - R(h,a,b,c,d,e,f,g,rk); - R(g,h,a,b,c,d,e,f,rk); - R(f,g,h,a,b,c,d,e,rk); - R(e,f,g,h,a,b,c,d,rk); - R(d,e,f,g,h,a,b,c,rk); - R(c,d,e,f,g,h,a,b,rk); - R(b,c,d,e,f,g,h,a,rk); - } - - /* - * map cipher state to byte array block: - */ - - Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); -} - -void SHACAL2::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 a, b, c, d, e, f, g, h; - const word32 *rk = m_key + 64; - - /* - * map byte array block to cipher state: - */ - Block::Get(inBlock)(a)(b)(c)(d)(e)(f)(g)(h); - - // Perform inverse SHA-256 transformation. - - /* 64 operations, partially loop unrolled */ - for (unsigned int j=0; j<64; j+=8) - { - P(b,c,d,e,f,g,h,a,rk); - P(c,d,e,f,g,h,a,b,rk); - P(d,e,f,g,h,a,b,c,rk); - P(e,f,g,h,a,b,c,d,rk); - P(f,g,h,a,b,c,d,e,rk); - P(g,h,a,b,c,d,e,f,rk); - P(h,a,b,c,d,e,f,g,rk); - P(a,b,c,d,e,f,g,h,rk); - } - - /* - * map cipher state to byte array block: - */ - - Block::Put(xorBlock, outBlock)(a)(b)(c)(d)(e)(f)(g)(h); -} - -// The SHACAL-2 round constants are identical to the SHA-256 round constants. -const word32 SHACAL2::Base::K[64] = -{ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/shacal2.h b/external/crypto++-5.6.3/shacal2.h deleted file mode 100644 index 94a09922b..000000000 --- a/external/crypto++-5.6.3/shacal2.h +++ /dev/null @@ -1,56 +0,0 @@ -// shacal.h - written and placed in the public domain by Wei Dai - -//! \file shacal.h -//! \brief Classes for the SHACAL-2 block cipher - -#ifndef CRYPTOPP_SHACAL2_H -#define CRYPTOPP_SHACAL2_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64> -{ - static const char *StaticAlgorithmName() {return "SHACAL-2";} -}; - -/// SHACAL-2 -class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - FixedSizeSecBlock m_key; - - static const word32 K[64]; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef SHACAL2::Encryption SHACAL2Encryption; -typedef SHACAL2::Decryption SHACAL2Decryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/shark.cpp b/external/crypto++-5.6.3/shark.cpp deleted file mode 100644 index eb2ecc334..000000000 --- a/external/crypto++-5.6.3/shark.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// shark.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "shark.h" -#include "misc.h" -#include "modes.h" -#include "gf256.h" - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wmissing-braces" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -static word64 SHARKTransform(word64 a) -{ - static const byte iG[8][8] = { - 0xe7, 0x30, 0x90, 0x85, 0xd0, 0x4b, 0x91, 0x41, - 0x53, 0x95, 0x9b, 0xa5, 0x96, 0xbc, 0xa1, 0x68, - 0x02, 0x45, 0xf7, 0x65, 0x5c, 0x1f, 0xb6, 0x52, - 0xa2, 0xca, 0x22, 0x94, 0x44, 0x63, 0x2a, 0xa2, - 0xfc, 0x67, 0x8e, 0x10, 0x29, 0x75, 0x85, 0x71, - 0x24, 0x45, 0xa2, 0xcf, 0x2f, 0x22, 0xc1, 0x0e, - 0xa1, 0xf1, 0x71, 0x40, 0x91, 0x27, 0x18, 0xa5, - 0x56, 0xf4, 0xaf, 0x32, 0xd2, 0xa4, 0xdc, 0x71, - }; - - word64 result=0; - GF256 gf256(0xf5); - for (unsigned int i=0; i<8; i++) - for(unsigned int j=0; j<8; j++) - result ^= word64(gf256.Multiply(iG[i][j], GF256::Element(a>>(56-8*j)))) << (56-8*i); - return result; -} - -void SHARK::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(keyLen); - - m_rounds = GetRoundsAndThrowIfInvalid(params, this); - m_roundKeys.New(m_rounds+1); - - // concatenate key enought times to fill a - for (unsigned int i=0; i<(m_rounds+1)*8; i++) - ((byte *)m_roundKeys.begin())[i] = key[i%keyLen]; - - SHARK::Encryption e; - e.InitForKeySetup(); - byte IV[8] = {0,0,0,0,0,0,0,0}; - CFB_Mode_ExternalCipher::Encryption cfb(e, IV); - - cfb.ProcessString((byte *)m_roundKeys.begin(), (m_rounds+1)*8); - - ConditionalByteReverse(BIG_ENDIAN_ORDER, m_roundKeys.begin(), m_roundKeys.begin(), (m_rounds+1)*8); - - m_roundKeys[m_rounds] = SHARKTransform(m_roundKeys[m_rounds]); - - if (!IsForwardTransformation()) - { - unsigned int i; - - // transform encryption round keys into decryption round keys - for (i=0; i -struct SharkProcessAndXorBlock{ // VC60 workaround: problem with template functions -inline SharkProcessAndXorBlock(const word64 *roundKeys, unsigned int rounds, const byte *inBlock, const byte *xorBlock, byte *outBlock) -{ - word64 tmp = *(word64 *)inBlock ^ roundKeys[0]; - - ByteOrder order = GetNativeByteOrder(); - tmp = cbox[0][GetByte(order, tmp, 0)] ^ cbox[1][GetByte(order, tmp, 1)] - ^ cbox[2][GetByte(order, tmp, 2)] ^ cbox[3][GetByte(order, tmp, 3)] - ^ cbox[4][GetByte(order, tmp, 4)] ^ cbox[5][GetByte(order, tmp, 5)] - ^ cbox[6][GetByte(order, tmp, 6)] ^ cbox[7][GetByte(order, tmp, 7)] - ^ roundKeys[1]; - - for(unsigned int i=2; i(xorBlock, outBlock) - (sbox[GETBYTE(tmp, 7)]) - (sbox[GETBYTE(tmp, 6)]) - (sbox[GETBYTE(tmp, 5)]) - (sbox[GETBYTE(tmp, 4)]) - (sbox[GETBYTE(tmp, 3)]) - (sbox[GETBYTE(tmp, 2)]) - (sbox[GETBYTE(tmp, 1)]) - (sbox[GETBYTE(tmp, 0)]); - - *(word64 *)outBlock ^= roundKeys[rounds]; -}}; - -void SHARK::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - SharkProcessAndXorBlock(m_roundKeys, m_rounds, inBlock, xorBlock, outBlock); -} - -void SHARK::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - SharkProcessAndXorBlock(m_roundKeys, m_rounds, inBlock, xorBlock, outBlock); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/shark.h b/external/crypto++-5.6.3/shark.h deleted file mode 100644 index 93f505be3..000000000 --- a/external/crypto++-5.6.3/shark.h +++ /dev/null @@ -1,67 +0,0 @@ -// shark.h - written and placed in the public domain by Wei Dai - -//! \file shark.h -//! \brief Classes for the SHARK block cipher - -#ifndef CRYPTOPP_SHARK_H -#define CRYPTOPP_SHARK_H - -#include "config.h" -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct SHARK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 16>, public VariableRounds<6, 2> -{ - static const char *StaticAlgorithmName() {return "SHARK-E";} -}; - -/// SHARK-E -class SHARK : public SHARK_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶m); - - protected: - unsigned int m_rounds; - SecBlock m_roundKeys; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - // used by Base to do key setup - void InitForKeySetup(); - - private: - static const byte sbox[256]; - static const word64 cbox[8][256]; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - private: - static const byte sbox[256]; - static const word64 cbox[8][256]; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef SHARK::Encryption SHARKEncryption; -typedef SHARK::Decryption SHARKDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/sharkbox.cpp b/external/crypto++-5.6.3/sharkbox.cpp deleted file mode 100644 index 230456d9b..000000000 --- a/external/crypto++-5.6.3/sharkbox.cpp +++ /dev/null @@ -1,4166 +0,0 @@ -#include "pch.h" -#include "shark.h" - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wmissing-braces" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -const byte SHARK::Enc::sbox[256] = { -177, 206, 195, 149, 90, 173, 231, 2, 77, 68, 251, 145, 12, 135, 161, 80, -203, 103, 84, 221, 70, 143, 225, 78, 240, 253, 252, 235, 249, 196, 26, 110, - 94, 245, 204, 141, 28, 86, 67, 254, 7, 97, 248, 117, 89, 255, 3, 34, -138, 209, 19, 238, 136, 0, 14, 52, 21, 128, 148, 227, 237, 181, 83, 35, - 75, 71, 23, 167, 144, 53, 171, 216, 184, 223, 79, 87, 154, 146, 219, 27, - 60, 200, 153, 4, 142, 224, 215, 125, 133, 187, 64, 44, 58, 69, 241, 66, -101, 32, 65, 24, 114, 37, 147, 112, 54, 5, 242, 11, 163, 121, 236, 8, - 39, 49, 50, 182, 124, 176, 10, 115, 91, 123, 183, 129, 210, 13, 106, 38, -158, 88, 156, 131, 116, 179, 172, 48, 122, 105, 119, 15, 174, 33, 222, 208, - 46, 151, 16, 164, 152, 168, 212, 104, 45, 98, 41, 109, 22, 73, 118, 199, -232, 193, 150, 55, 229, 202, 244, 233, 99, 18, 194, 166, 20, 188, 211, 40, -175, 47, 230, 36, 82, 198, 160, 9, 189, 140, 207, 93, 17, 95, 1, 197, -159, 61, 162, 155, 201, 59, 190, 81, 25, 31, 63, 92, 178, 239, 74, 205, -191, 186, 111, 100, 217, 243, 62, 180, 170, 220, 213, 6, 192, 126, 246, 102, -108, 132, 113, 56, 185, 29, 127, 157, 72, 139, 42, 218, 165, 51, 130, 57, -214, 120, 134, 250, 228, 43, 169, 30, 137, 96, 107, 234, 85, 76, 247, 226, -}; - -const byte SHARK::Dec::sbox[256] = { - 53, 190, 7, 46, 83, 105, 219, 40, 111, 183, 118, 107, 12, 125, 54, 139, -146, 188, 169, 50, 172, 56, 156, 66, 99, 200, 30, 79, 36, 229, 247, 201, - 97, 141, 47, 63, 179, 101, 127, 112, 175, 154, 234, 245, 91, 152, 144, 177, -135, 113, 114, 237, 55, 69, 104, 163, 227, 239, 92, 197, 80, 193, 214, 202, - 90, 98, 95, 38, 9, 93, 20, 65, 232, 157, 206, 64, 253, 8, 23, 74, - 15, 199, 180, 62, 18, 252, 37, 75, 129, 44, 4, 120, 203, 187, 32, 189, -249, 41, 153, 168, 211, 96, 223, 17, 151, 137, 126, 250, 224, 155, 31, 210, -103, 226, 100, 119, 132, 43, 158, 138, 241, 109, 136, 121, 116, 87, 221, 230, - 57, 123, 238, 131, 225, 88, 242, 13, 52, 248, 48, 233, 185, 35, 84, 21, - 68, 11, 77, 102, 58, 3, 162, 145, 148, 82, 76, 195, 130, 231, 128, 192, -182, 14, 194, 108, 147, 236, 171, 67, 149, 246, 216, 70, 134, 5, 140, 176, -117, 0, 204, 133, 215, 61, 115, 122, 72, 228, 209, 89, 173, 184, 198, 208, -220, 161, 170, 2, 29, 191, 181, 159, 81, 196, 165, 16, 34, 207, 1, 186, -143, 49, 124, 174, 150, 218, 240, 86, 71, 212, 235, 78, 217, 19, 142, 73, - 85, 22, 255, 59, 244, 164, 178, 6, 160, 167, 251, 27, 110, 60, 51, 205, - 24, 94, 106, 213, 166, 33, 222, 254, 42, 28, 243, 10, 26, 25, 39, 45, -}; - -const word64 SHARK::Enc::cbox[8][256] = { -/* box 0 */ -W64LIT(0x060d838f16f3a365), -W64LIT(0xa68857ee5cae56f6), -W64LIT(0xebf516353c2c4d89), -W64LIT(0x652174be88e85bdc), -W64LIT(0x0d4e9a8086c17921), -W64LIT(0x27ba7d33cffa58a1), -W64LIT(0x88d9e104a237b530), -W64LIT(0x693b8755a4fbe816), -W64LIT(0xdac9591826b254a0), -W64LIT(0x45c2e369fb336af3), -W64LIT(0xa96e1fb87b3e4ef4), -W64LIT(0xb7578f1435eb7ef0), -W64LIT(0x839af80b32056f74), -W64LIT(0xae37f55cc71f277a), -W64LIT(0xa4208538fdff37d5), -W64LIT(0x35991e74ad3cdb6f), -W64LIT(0xba191594b32a07d1), -W64LIT(0x5344d1772e572b7b), -W64LIT(0xe7efe5de103ffe43), -W64LIT(0xa3796fdc41de5e5b), -W64LIT(0x2cf9643c5fc882e5), -W64LIT(0xffdbf6fd48196d22), -W64LIT(0x33949dfbbbcf780a), -W64LIT(0x7d15679dd0cec8bd), -W64LIT(0x5f5e229c024498b1), -W64LIT(0x1223634762c683ce), -W64LIT(0xdcc4da973041f7c5), -W64LIT(0x0b43190f9032da44), -W64LIT(0xc05598eddfc5a6e2), -W64LIT(0x9e5fd31a7753f4b8), -W64LIT(0x9afa8243c0f136fe), -W64LIT(0xcc4f6b06f3d61528), -W64LIT(0xdf38612a3bc25c0d), -W64LIT(0x43cf60e6edc0c996), -W64LIT(0xcfb3d0bbf855bee0), -W64LIT(0x96e071a8ece28534), -W64LIT(0x21b7febcd909fbc4), -W64LIT(0x8ed4628bb4c41655), -W64LIT(0x30682646b04cd3c2), -W64LIT(0xb5ff5dc294ba1fd3), -W64LIT(0x75aac52f4b7fb931), -W64LIT(0xe809ad8837afe641), -W64LIT(0x0eb2213d8d42d2e9), -W64LIT(0x9852509561a057dd), -W64LIT(0xaa92a40570bde53c), -W64LIT(0x7b18e412c63d6bd8), -W64LIT(0xa7dc3e85f67c9c1d), -W64LIT(0xd8618bce87e33583), -W64LIT(0xe34ab487a79d3c05), -W64LIT(0x20e397d773db312f), -W64LIT(0x05f138321d7008ad), -W64LIT(0x17d25b757fb68b63), -W64LIT(0x8a7133d20366d413), -W64LIT(0x0000000000000000), -W64LIT(0xeaa17f5e96fe8762), -W64LIT(0xc101f18675176c09), -W64LIT(0xbebc44cd0488c597), -W64LIT(0xdb9d30738c609e4b), -W64LIT(0xabc6cd6eda6f2fd7), -W64LIT(0x5aaf1aae1f34901c), -W64LIT(0xb00e65f089ca177e), -W64LIT(0xd47b7825abf08649), -W64LIT(0x924520f15b404772), -W64LIT(0x1686321ed5644188), -W64LIT(0x618425e73f4a999a), -W64LIT(0xe21eddec0d4ff6ee), -W64LIT(0xd787c398a0732d81), -W64LIT(0x1f6df9c7e407faef), -W64LIT(0x79b036c4676c0afb), -W64LIT(0x0fe6485627901802), -W64LIT(0x9cf701ccd602959b), -W64LIT(0xbfe82da6ae5a0f7c), -W64LIT(0x990639fecb729d36), -W64LIT(0xca42e889e525b64d), -W64LIT(0xb3f2de4d8249bcb6), -W64LIT(0x4033db5be643625e), -W64LIT(0x4167b2304c91a8b5), -W64LIT(0x108bb191c397e2ed), -W64LIT(0x1834132358269361), -W64LIT(0x541d3b93927642f5), -W64LIT(0x90edf227fa112651), -W64LIT(0x1dc52b1145569bcc), -W64LIT(0xe6bb8cb5baed34a8), -W64LIT(0xd276fbaabd03252c), -W64LIT(0x313c4f2d1a9e1929), -W64LIT(0xfd73242be9480c01), -W64LIT(0x9baeeb286a23fc15), -W64LIT(0xc9be5334eea61d85), -W64LIT(0xc70c720963e4cf6c), -W64LIT(0x3eda077b3d0e012b), -W64LIT(0x97b418c346304fdf), -W64LIT(0x32c0f490111db2e1), -W64LIT(0x2ba08ed8e3e9eb6b), -W64LIT(0x8b255ab9a9b41ef8), -W64LIT(0x91b99b4c50c3ecba), -W64LIT(0xfe8f9f96e2cba7c9), -W64LIT(0x3a7f56228aacc36d), -W64LIT(0xb15a0c9b2318dd95), -W64LIT(0x5953a11314b73bd4), -W64LIT(0xf3c10516640adee8), -W64LIT(0xedf895ba2adfeeec), -W64LIT(0xadcb4ee1cc9c8cb2), -W64LIT(0xde6c0841911096e6), -W64LIT(0x84c312ef8e2406fa), -W64LIT(0xa83a76d3d1ec841f), -W64LIT(0x1c91427aef845127), -W64LIT(0x3665a5c9a6bf70a7), -W64LIT(0xf6303d24797ad645), -W64LIT(0xcd1b026d5904dfc3), -W64LIT(0x1bc8a89e53a538a9), -W64LIT(0x7ee9dc20db4d6375), -W64LIT(0x51ec03a18f064a58), -W64LIT(0xc4f0c9b4686764a4), -W64LIT(0xdd90b3fc9a933d2e), -W64LIT(0x7a4c8d796cefa133), -W64LIT(0x73a746a05d8c1a54), -W64LIT(0x0759eae4bc21698e), -W64LIT(0xc8ea3a5f4474d76e), -W64LIT(0x38d784f42bfda24e), -W64LIT(0x231f2c6a78589ae7), -W64LIT(0xc3a92350d4460d2a), -W64LIT(0x72f32fcbf75ed0bf), -W64LIT(0xbd40ff700f0b6e5f), -W64LIT(0x157a89a3dee7ea40), -W64LIT(0x873fa95285a7ad32), -W64LIT(0x4d7d41db60821b7f), -W64LIT(0x1e3990ac4ed53004), -W64LIT(0x0a1770643ae010af), -W64LIT(0x9311499af1928d99), -W64LIT(0x64751dd5223a9137), -W64LIT(0xfa2acecf5569658f), -W64LIT(0x7c410ef67a1c0256), -W64LIT(0x56b5e945332723d6), -W64LIT(0x6f3604dab2084b73), -W64LIT(0xe95dc4e39d7d2caa), -W64LIT(0x13770a2cc8144925), -W64LIT(0xbc14961ba5d9a4b4), -W64LIT(0xb9e5ae29b8a9ac19), -W64LIT(0xf169d7c0c55bbfcb), -W64LIT(0x2446c68ec479f369), -W64LIT(0x806643b63986c4bc), -W64LIT(0x7fbdb54b719fa99e), -W64LIT(0x04a55159b7a2c246), -W64LIT(0xee042e07215c4524), -W64LIT(0x5bfb73c5b5e65af7), -W64LIT(0x0c1af3eb2c13b3ca), -W64LIT(0xa22d06b7eb0c94b0), -W64LIT(0xb8b1c742127b66f2), -W64LIT(0x285c3565e86a40a3), -W64LIT(0x3b2b3f49207e0986), -W64LIT(0x3c72d5ad9c5f6008), -W64LIT(0x770217f9ea2ed812), -W64LIT(0xfc274d40439ac6ea), -W64LIT(0x4fd5930dc1d37a5c), -W64LIT(0x2e51b6eafe99e3c6), -W64LIT(0x6b93558305aa8935), -W64LIT(0x19607a48f2f4598a), -W64LIT(0x08bfa2b29bb1718c), -W64LIT(0x3f8e6e1097dccbc0), -W64LIT(0x3983ed9f812f68a5), -W64LIT(0xac9f278a664e4659), -W64LIT(0x82ce916098d7a59f), -W64LIT(0xc2fd4a3b7e94c7c1), -W64LIT(0x66ddcf03836bf014), -W64LIT(0xe1e2665106cc5d26), -W64LIT(0x74feac44e1ad73da), -W64LIT(0x8d28d936bf47bd9d), -W64LIT(0x62789e5a34c93252), -W64LIT(0x81322add93540e57), -W64LIT(0xcb1681e24ff77ca6), -W64LIT(0x2512afe56eab3982), -W64LIT(0xd18a4017b6808ee4), -W64LIT(0x705bfd1d560fb19c), -W64LIT(0x4b70c2547671b81a), -W64LIT(0x49d81082d720d939), -W64LIT(0xe0b60f3aac1e97cd), -W64LIT(0x4e81fa666b01b0b7), -W64LIT(0x951cca15e7612efc), -W64LIT(0x463e58d4f0b0c13b), -W64LIT(0x632cf7319e1bf8b9), -W64LIT(0x5ca2992109c73379), -W64LIT(0xf764544fd3a81cae), -W64LIT(0x6ac73ce8af7843de), -W64LIT(0x9f0bba71dd813e53), -W64LIT(0x85977b8424f6cc11), -W64LIT(0x5807c878be65f13f), -W64LIT(0x686fee3e0e2922fd), -W64LIT(0x78e45fafcdbec010), -W64LIT(0x6ccabf67b98be0bb), -W64LIT(0x11dfd8fa69452806), -W64LIT(0xcee7b9d05287740b), -W64LIT(0x50b86aca25d480b3), -W64LIT(0x5df6f04aa315f992), -W64LIT(0x5e0a4bf7a896525a), -W64LIT(0x03fcbbbd0b83abc8), -W64LIT(0x8f800be01e16dcbe), -W64LIT(0xd32292c117d1efc7), -W64LIT(0xe5473708b16e9f60), -W64LIT(0x224b4501d28a500c), -W64LIT(0xfb7ea7a4ffbbaf64), -W64LIT(0x3d26bcc6368daae3), -W64LIT(0x866bc0392f7567d9), -W64LIT(0x3731cca20c6dba4c), -W64LIT(0xb603e67f9f39b41b), -W64LIT(0xa1d1bd0ae08f3f78), -W64LIT(0xd935e2a52d31ff68), -W64LIT(0xaf639c376dcded91), -W64LIT(0x0154696baad2caeb), -W64LIT(0xecacfcd1800d2407), -W64LIT(0xf03dbeab6f897520), -W64LIT(0x02a8d2d6a1516123), -W64LIT(0xf498eff2d82bb766), -W64LIT(0x710f9476fcdd7b77), -W64LIT(0xf8821c19f43804ac), -W64LIT(0xf9d675725eeace47), -W64LIT(0x1a9cc1f5f977f242), -W64LIT(0x5210b81c8485e190), -W64LIT(0x6d9ed60c13592a50), -W64LIT(0xf2956c7dced81403), -W64LIT(0xbb4d7cff19f8cd3a), -W64LIT(0x4c2928b0ca50d194), -W64LIT(0x6e626db118da8198), -W64LIT(0xe4135e631bbc558b), -W64LIT(0x9da368a77cd05f70), -W64LIT(0xa574ec53572dfd3e), -W64LIT(0x09ebcbd93163bb67), -W64LIT(0x4a24ab3fdca372f1), -W64LIT(0x429b098d4712037d), -W64LIT(0x57e1802e99f5e93d), -W64LIT(0xef50476c8b8e8fcf), -W64LIT(0xa085d4614a5df593), -W64LIT(0x34cd771f07ee1184), -W64LIT(0xc6581b62c9360587), -W64LIT(0x2dad0d57f51a480e), -W64LIT(0x898d886f08e57fdb), -W64LIT(0xd6d3aaf30aa1e76a), -W64LIT(0x76567e9240fc12f9), -W64LIT(0xb4ab34a93e68d538), -W64LIT(0xb2a6b726289b765d), -W64LIT(0x8c7cb05d15957776), -W64LIT(0x554952f838a4881e), -W64LIT(0xd52f114e01224ca2), -W64LIT(0x60d04c8c95985371), -W64LIT(0x6789a66829b93aff), -W64LIT(0x2f05df81544b292d), -W64LIT(0x476a31bf5a620bd0), -W64LIT(0xf5cc869972f97d8d), -W64LIT(0x488c79e97df213d2), -W64LIT(0x44968a0251e1a018), -W64LIT(0x26ee14586528924a), -W64LIT(0xd0de297c1c52440f), -W64LIT(0xc5a4a0dfc2b5ae4f), -W64LIT(0x29085c0e42b88a48), -W64LIT(0x142ee0c8743520ab), -W64LIT(0x2af4e7b3493b2180), -W64LIT(0x9448a37e4db3e417), -/* box 1 */ -W64LIT(0xe2795ba105ba30ce), -W64LIT(0x65b5d634f5e0fbdd), -W64LIT(0x2d7d7f1464dd8c55), -W64LIT(0xeefbf778add1c20b), -W64LIT(0x1eb0fbd1f11968e7), -W64LIT(0xe6073f45ce30cd8d), -W64LIT(0x21ffd3cdccb67e90), -W64LIT(0xdf0941cfa750a262), -W64LIT(0xc61df5b1b75ef18a), -W64LIT(0xc5c7defa9dc337c6), -W64LIT(0x2581b729073c83d3), -W64LIT(0xa5e97513167173cf), -W64LIT(0xdd3673bd381526b9), -W64LIT(0xe8baa1eef91ebb93), -W64LIT(0x3b314cf8f625eb34), -W64LIT(0x579d4bc8d5fc5df8), -W64LIT(0xbb598ec2e7681b28), -W64LIT(0xc8a06b1a80708794), -W64LIT(0x1c8fc9a36e5cec3c), -W64LIT(0xf60a5a3f0807d374), -W64LIT(0x1ace9f353a9395a4), -W64LIT(0x7e9e50387aab2cee), -W64LIT(0xb5e41069d0466d36), -W64LIT(0x8cea6ee3b92602d9), -W64LIT(0xf952ddad8af1e7fd), -W64LIT(0xb19a748d1bcc9075), -W64LIT(0x2464ae10b2e4c144), -W64LIT(0xfcc9a070f4a35829), -W64LIT(0xfa88f6e6a06c21b1), -W64LIT(0x2c98662dd105cec2), -W64LIT(0x9065a740d77aeee5), -W64LIT(0xcb7a4051aaed41d8), -W64LIT(0x55a279ba4ab9d923), -W64LIT(0x27be855b98790708), -W64LIT(0xbabc97fb52b059bf), -W64LIT(0xa19711f7ddfb8e8c), -W64LIT(0x047e64e4cb8afd43), -W64LIT(0xc386886cc90c4e5e), -W64LIT(0xc422c7c3281b7551), -W64LIT(0xfb6defdf15b46326), -W64LIT(0x01e51939b5d84297), -W64LIT(0x5cbba8be9c809432), -W64LIT(0x6f762c7b09447080), -W64LIT(0xcee13d8cd4bffe0c), -W64LIT(0x54476083ff619bb4), -W64LIT(0x6e933542bc9c3217), -W64LIT(0x4af79b520e78f353), -W64LIT(0x98996f7db49be163), -W64LIT(0xa07208ce6823cc1b), -W64LIT(0x2b3c29823012f5cd), -W64LIT(0x93bf8c0bfde728a9), -W64LIT(0x2225f886e62bb8dc), -W64LIT(0x7f7b4901cf736e79), -W64LIT(0x0000000000000000), -W64LIT(0x023f32729f4584db), -W64LIT(0xd5cabb805bf4293f), -W64LIT(0x07a44fafe1173b0f), -W64LIT(0xe95fb8d74cc6f904), -W64LIT(0x7b052de504f9933a), -W64LIT(0x6aed51a67716cf54), -W64LIT(0x68d263d4e8534b8f), -W64LIT(0xa96bd9cabe1a810a), -W64LIT(0x1d6ad09adb84aeab), -W64LIT(0x0d67b5e01db3b052), -W64LIT(0x52063615abaee22c), -W64LIT(0x8f3045a893bbc495), -W64LIT(0xd8ad0e604647996d), -W64LIT(0xaf2a8f5cead5f892), -W64LIT(0x3017af8ebf5922fe), -W64LIT(0x4034611df2dc780e), -W64LIT(0x721cfce1d2c0de2b), -W64LIT(0x28e602c91a8f3381), -W64LIT(0xe1a370ea2f27f682), -W64LIT(0x29031bf0af577116), -W64LIT(0x1914b47e100e53e8), -W64LIT(0x567852f160241f6f), -W64LIT(0x793a1f979bbc17e1), -W64LIT(0xef1eee411809809c), -W64LIT(0x6211999b14f7c0d2), -W64LIT(0x059b7ddd7e52bfd4), -W64LIT(0x43ee4a56d841be42), -W64LIT(0xf1ae1590e910e87b), -W64LIT(0x33cd84c595c4e4b2), -W64LIT(0x4b12826bbba0b1c4), -W64LIT(0xeb608aa5d3837ddf), -W64LIT(0x201acaf4796e3c07), -W64LIT(0xbf27ea262ce2e66b), -W64LIT(0x58c5cc5a570a6971), -W64LIT(0x37b3e0215e4e19f1), -W64LIT(0xab54ebb8215f05d1), -W64LIT(0x8ed55c9126638602), -W64LIT(0x9aa65d0f2bde65b8), -W64LIT(0xd7f589f2c4b1ade4), -W64LIT(0x5039046734eb66f7), -W64LIT(0x6cac073023d9b6cc), -W64LIT(0x51dc1d5e81332460), -W64LIT(0x17a92ad5272025f6), -W64LIT(0x47902eb213cb4301), -W64LIT(0x1b2b860c8f4bd733), -W64LIT(0x4f6ce68f702a4c87), -W64LIT(0xcf0424b56167bc9b), -W64LIT(0x997c76440143a3f4), -W64LIT(0x7ae034dcb121d1ad), -W64LIT(0x100d657ac6371ef9), -W64LIT(0x0ac3fa4ffca48b5d), -W64LIT(0xdeec58f61288e0f5), -W64LIT(0x265b9c622da1459f), -W64LIT(0xdcd36a848dcd642e), -W64LIT(0xe4380d3751754956), -W64LIT(0x13d74e31ecaad8b5), -W64LIT(0xfd2cb949417b1abe), -W64LIT(0x9624f1d683b5977d), -W64LIT(0x4675378ba6130196), -W64LIT(0x0b26e376497cc9ca), -W64LIT(0x41d1782447043a99), -W64LIT(0xe39c4298b0627259), -W64LIT(0xcd3b16c7fe223840), -W64LIT(0x7787813cac9261ff), -W64LIT(0x492db01924e5351f), -W64LIT(0x5afafe28c84fedaa), -W64LIT(0x8b4e214c583139d6), -W64LIT(0xccde0ffe4bfa7ad7), -W64LIT(0x76629805194a2368), -W64LIT(0x7ca1624ae5eea835), -W64LIT(0x61cbb2d03e6a069e), -W64LIT(0x48c8a920913d7788), -W64LIT(0x8068c23a114df01c), -W64LIT(0xd38bed160f3b50a7), -W64LIT(0x32289dfc201ca625), -W64LIT(0xc1b9ba1e5649ca85), -W64LIT(0xed21dc33874c0447), -W64LIT(0xa3a8238542be0a57), -W64LIT(0x5b1fe7117d97af3d), -W64LIT(0x3d701a6ea2ea92ac), -W64LIT(0x73f9e5d867189cbc), -W64LIT(0x9ed839ebe05498fb), -W64LIT(0x5920d563e2d22be6), -W64LIT(0xca9f59681f35034f), -W64LIT(0x11e87c4373ef5c6e), -W64LIT(0x97c1e8ef366dd5ea), -W64LIT(0xacf0a417c0483ede), -W64LIT(0xd26ef42fbae31230), -W64LIT(0xbcfdc16d067f2027), -W64LIT(0xbec2f31f993aa4fc), -W64LIT(0x45af1cc08c8ec7da), -W64LIT(0x31f2b6b70a816069), -W64LIT(0xd9481759f39fdbfa), -W64LIT(0xe5dd140ee4ad0bc1), -W64LIT(0xa6335e583cecb583), -W64LIT(0x38eb67b3dcb82d78), -W64LIT(0xf5d07174229a1538), -W64LIT(0x5f6183f5b61d527e), -W64LIT(0x0f58879282f63489), -W64LIT(0x164c33ec92f86761), -W64LIT(0x444a05f93956854d), -W64LIT(0x818ddb03a495b28b), -W64LIT(0x4d53d4fdef6fc85c), -W64LIT(0x8d0f77da0cfe404e), -W64LIT(0x8416a6dedac70d5f), -W64LIT(0x666ffd7fdf7d3d91), -W64LIT(0xb63e3b22fadbab7a), -W64LIT(0xf2743edbc38d2e37), -W64LIT(0xa40c6c2aa3a93158), -W64LIT(0x9f3d20d2558cda6c), -W64LIT(0xfef692026be6dcf2), -W64LIT(0x2ea7545f4e404a19), -W64LIT(0xb2405fc631515639), -W64LIT(0x23c0e1bf53f3fa4b), -W64LIT(0x83b2e9713bd03650), -W64LIT(0x0641569654cf7998), -W64LIT(0xb883a589cdf5dd64), -W64LIT(0x3ad455c143fda9a3), -W64LIT(0x925a9532483f6a3e), -W64LIT(0xaab1f28194874746), -W64LIT(0xf435684d974257af), -W64LIT(0xd1b4df64907ed47c), -W64LIT(0x390e7e8a69606fef), -W64LIT(0xd051c65d25a696eb), -W64LIT(0xb4010950659e2fa1), -W64LIT(0x0c82acd9a86bf2c5), -W64LIT(0x88940a0772acff9a), -W64LIT(0xf39127e276556ca0), -W64LIT(0xaecf96655f0dba05), -W64LIT(0x03da2b4b2a9dc64c), -W64LIT(0x3f4f281c3daf1677), -W64LIT(0x3469cb6a74d3dfbd), -W64LIT(0xf04b0ca95cc8aaec), -W64LIT(0x1f55e2e844c12a70), -W64LIT(0x4cb6cdc45ab78acb), -W64LIT(0xc05ca327e3918812), -W64LIT(0x95feda9da9285131), -W64LIT(0xb966bcb0782d9ff3), -W64LIT(0xa7d647618934f714), -W64LIT(0xd61090cb7169ef73), -W64LIT(0x71c6d7aaf85d1867), -W64LIT(0xecc4c50a329446d0), -W64LIT(0x6450cf0d4038b94a), -W64LIT(0x420b536f6d99fcd5), -W64LIT(0x75b8b34e33d7e524), -W64LIT(0xc26391557cd40cc9), -W64LIT(0xda923c12d9021db6), -W64LIT(0x4e89ffb6c5f20e10), -W64LIT(0x0919d104d6394d11), -W64LIT(0x8aab3875ede97b41), -W64LIT(0xa88ec0f30bc2c39d), -W64LIT(0xb7db221b4f03e9ed), -W64LIT(0xc7f8ec880286b31d), -W64LIT(0x2f424d66fb98088e), -W64LIT(0xe04669d39affb415), -W64LIT(0x3eaa3125887754e0), -W64LIT(0x5e849acc03c510e9), -W64LIT(0x8257f0488e0874c7), -W64LIT(0xbd18d854b3a762b0), -W64LIT(0xb3a546ff848914ae), -W64LIT(0x9ce70b997f111c20), -W64LIT(0x3c9503571732d03b), -W64LIT(0xe7e2267c7be88f1a), -W64LIT(0x63f480a2a12f8245), -W64LIT(0x602eabe98bb24409), -W64LIT(0x941bc3a41cf013a6), -W64LIT(0x678ae4466aa57f06), -W64LIT(0x1232570859729a22), -W64LIT(0x6d491e099601f45b), -W64LIT(0x5d5eb1872958d6a5), -W64LIT(0x1473019e0dbde3ba), -W64LIT(0xa24d3abcf76648c0), -W64LIT(0x85f3bfe76f1f4fc8), -W64LIT(0x08fcc83d63e10f86), -W64LIT(0x745daa77860fa7b3), -W64LIT(0x9180be7962a2ac72), -W64LIT(0x87cc8d95f05acb13), -W64LIT(0x78df06ae2e645576), -W64LIT(0x18f1ad47a5d6117f), -W64LIT(0x358cd253c10b9d2a), -W64LIT(0x0ebd9eab372e761e), -W64LIT(0xf7ef4306bddf91e3), -W64LIT(0x7023ce934d855af0), -W64LIT(0xd42fa2b9ee2c6ba8), -W64LIT(0x3656f918eb965b66), -W64LIT(0x9d0212a0cac95eb7), -W64LIT(0x2ad930bb85cab75a), -W64LIT(0x862994ac45828984), -W64LIT(0x7d447b735036eaa2), -W64LIT(0xb07f6db4ae14d2e2), -W64LIT(0x6b08489fc2ce8dc3), -W64LIT(0x9b4344369e06272f), -W64LIT(0xad15bd2e75907c49), -W64LIT(0xdb77252b6cda5f21), -W64LIT(0xea85939c665b3f48), -W64LIT(0xc945722335a8c503), -W64LIT(0x159618a7b865a12d), -W64LIT(0x69377aed5d8b0918), -W64LIT(0x8971133ec774bd0d), -W64LIT(0x53e32f2c1e76a0bb), -W64LIT(0xf8b7c4943f29a56a), -W64LIT(0xff138b3bde3e9e65), -/* box 2 */ -W64LIT(0x7c6a2eb5fdabecc6), -W64LIT(0x401cda0a752bbea0), -W64LIT(0x1925217156dc57c4), -W64LIT(0x56dec6d301d70787), -W64LIT(0x41c751ff73c6ac58), -W64LIT(0xc9067697a92cb5f9), -W64LIT(0x3391c917aaa0bc85), -W64LIT(0xae0a9a4c0e742afe), -W64LIT(0xaa8ca972162a62f4), -W64LIT(0x5aa193912935df99), -W64LIT(0x86fd9135fe27e5ba), -W64LIT(0xffca074b1d3f538e), -W64LIT(0x0e3cb65d24cdfc1b), -W64LIT(0x4384b2e07fe9885d), -W64LIT(0xc73ac0ca8de149e2), -W64LIT(0x48e5bc7645972eb4), -W64LIT(0xbe0d56b46ef9ffd6), -W64LIT(0x200e6d05c0ef5f50), -W64LIT(0xe1f17dee597f7abd), -W64LIT(0x0243e31f0c2f2405), -W64LIT(0xf4ab09dd2741f567), -W64LIT(0xe4acc52547cc204f), -W64LIT(0x348f92c3b83cc272), -W64LIT(0x53837e181f645d75), -W64LIT(0xd8da319acf4c7229), -W64LIT(0x81e3cae1ecbb9b4d), -W64LIT(0xd6e687c7eb818e32), -W64LIT(0x3dad7f4a8e6d409e), -W64LIT(0x28f70b79f053cf44), -W64LIT(0x493e3783437a3c4c), -W64LIT(0xb27203f6461b27c8), -W64LIT(0xd02357e6fff0e23d), -W64LIT(0xe8d390676f2ef851), -W64LIT(0x26cbbd24d49e335f), -W64LIT(0xee1640467b5f945e), -W64LIT(0x4aa65f6949b80ab1), -W64LIT(0xb56c58225487593f), -W64LIT(0x4ffbe7a2570b5043), -W64LIT(0x0aba85633c93b411), -W64LIT(0x78ec1d8be5f5a4cc), -W64LIT(0x501b16f215a66b88), -W64LIT(0x271036d1d27321a7), -W64LIT(0x7ff2465ff769da3b), -W64LIT(0x35541936bed1d08a), -W64LIT(0xb8c886957a8893d9), -W64LIT(0x2fe950ade2cfb1b3), -W64LIT(0xf90fd76a094e3f81), -W64LIT(0x2daab3b2eee095b6), -W64LIT(0x1abd499b5c1e6139), -W64LIT(0x0c7f554228e2d81e), -W64LIT(0x425f391579049aa5), -W64LIT(0xc3bcf3f495bf01e8), -W64LIT(0xb4b7d3d7526a4bc7), -W64LIT(0x0000000000000000), -W64LIT(0xa0362c112ab9d6e5), -W64LIT(0x91e406198c364e65), -W64LIT(0x454162c16b98e452), -W64LIT(0x139fa4126a4fe3d5), -W64LIT(0x01db8bf506ed12f8), -W64LIT(0x9a85088fb648e88c), -W64LIT(0x3ab3249e9cf13e69), -W64LIT(0xd57eef2de143b8cf), -W64LIT(0xb1ea6b1c4cd91135), -W64LIT(0x7aaffe94e9da80c9), -W64LIT(0xad92f2a604b61c03), -W64LIT(0xa3ae44fb207be018), -W64LIT(0xeb4bf88d65ecceac), -W64LIT(0xc0249b1e9f7d3715), -W64LIT(0xa8cf4a6d1a0546f1), -W64LIT(0xc6e14b3f8b0c5b1a), -W64LIT(0xce182d43bbb0cb0e), -W64LIT(0xfc526fa117fd6573), -W64LIT(0x8c471456c2b451ab), -W64LIT(0xac497953025b0efb), -W64LIT(0x0486333e185e480a), -W64LIT(0x18feaa845031453c), -W64LIT(0xa1eda7e42c54c41d), -W64LIT(0x06c5d02114716c0f), -W64LIT(0x055db8cb1eb35af2), -W64LIT(0xe5774ed0412132b7), -W64LIT(0x36cc71dcb413e677), -W64LIT(0x470281de67b7c057), -W64LIT(0x58e2708e251afb9c), -W64LIT(0xa914c1981ce85409), -W64LIT(0xb3a9880340f63530), -W64LIT(0x638adfe5bf06d70d), -W64LIT(0x0b610e963a7ea6e9), -W64LIT(0x927c6ef386f47898), -W64LIT(0xed8e28ac719da2a3), -W64LIT(0x7548c33ccbfa6e2a), -W64LIT(0xf3b5520935dd8b90), -W64LIT(0x8d9c9fa3c4594353), -W64LIT(0x31d22a08a68f9880), -W64LIT(0x0da4deb72e0fcae6), -W64LIT(0x8fdf7cbcc8766756), -W64LIT(0x5dbfc8453ba9a16e), -W64LIT(0x8e04f749ce9b75ae), -W64LIT(0x83a029fee094bf48), -W64LIT(0xa4b01f2f32e79eef), -W64LIT(0x1c7899ba486f0d36), -W64LIT(0x654f0fc4ab77bb02), -W64LIT(0x7db1a540fb46fe3e), -W64LIT(0x51c09d07134b7970), -W64LIT(0xcb459588a50391fc), -W64LIT(0x3fee9c558242649b), -W64LIT(0xfe118cbe1bd24176), -W64LIT(0x76d0abd6c13858d7), -W64LIT(0x5e27a0af316b9793), -W64LIT(0x69305a868395631c), -W64LIT(0x3b68af6b9a1c2c91), -W64LIT(0x6db669b89bcb2b16), -W64LIT(0xa72877c53825a812), -W64LIT(0xd3bb3f0cf532d4c0), -W64LIT(0x6ff58aa797e40f13), -W64LIT(0x96fa5dcd9eaa3092), -W64LIT(0x2c713847e80d874e), -W64LIT(0xc57923d581ce6de7), -W64LIT(0x2b6f6393fa91f9b9), -W64LIT(0x0922ed89365182ec), -W64LIT(0x324a42e2ac4dae7d), -W64LIT(0x16c21cd974fcb927), -W64LIT(0x956235279468066f), -W64LIT(0x7b747561ef379231), -W64LIT(0x449ae9346d75f6aa), -W64LIT(0xf570822821ace79f), -W64LIT(0x5939fb7b23f7e964), -W64LIT(0x7937967ee318b634), -W64LIT(0x84be722af208c1bf), -W64LIT(0x08f9667c30bc9014), -W64LIT(0xefcdcbb37db286a6), -W64LIT(0xa6f3fc303ec8baea), -W64LIT(0xea9073786301dc54), -W64LIT(0x62515410b9ebc5f5), -W64LIT(0xd260b4f9f3dfc638), -W64LIT(0x9e033bb1ae16a086), -W64LIT(0x38f0c78190de1a6c), -W64LIT(0xc267780193521310), -W64LIT(0x80384114ea5689b5), -W64LIT(0x9b5e837ab0a5fa74), -W64LIT(0xf73361372d83c39a), -W64LIT(0x3009a1fda0628a78), -W64LIT(0xd4a564d8e7aeaa37), -W64LIT(0xfb4c347505611b84), -W64LIT(0x5b7a18642fd8cd61), -W64LIT(0x239605efca2d69ad), -W64LIT(0xf8d45c9f0fa32d79), -W64LIT(0xbb50ee7f704aa524), -W64LIT(0x392b4c7496330894), -W64LIT(0x0fe73da82220eee3), -W64LIT(0x3717fa29b2fef48f), -W64LIT(0xf26ed9fc33309968), -W64LIT(0xd73d0c32ed6c9cca), -W64LIT(0xda99d285c363562c), -W64LIT(0xde1fe1bbdb3d1e26), -W64LIT(0x738d131ddf8b0225), -W64LIT(0x292c808cf6beddbc), -W64LIT(0xbc4eb5ab62d6dbd3), -W64LIT(0x039868ea0ac236fd), -W64LIT(0xcc5bce5cb79fef0b), -W64LIT(0xb031e0e94a3403cd), -W64LIT(0xc4a2a82087237f1f), -W64LIT(0xb72fbb3d58a87d3a), -W64LIT(0xafd111b908993806), -W64LIT(0x68ebd173857871e4), -W64LIT(0x9d9b535ba4d4967b), -W64LIT(0xe9081b9269c3eaa9), -W64LIT(0x71cef002d3a42620), -W64LIT(0x93a7e50680196a60), -W64LIT(0x891aac9ddc070b59), -W64LIT(0x155a74337e3e8fda), -W64LIT(0x4e206c5751e642bb), -W64LIT(0x9721d6389847226a), -W64LIT(0x12442fe76ca2f12d), -W64LIT(0x2553d5cede5c05a2), -W64LIT(0xa275cf0e2696f2e0), -W64LIT(0x24885e3bd8b1175a), -W64LIT(0x670cecdba7589f07), -W64LIT(0x749348c9cd177cd2), -W64LIT(0x64948431ad9aa9fa), -W64LIT(0x2ab4e866fc7ceb41), -W64LIT(0xe6ef263a4be3044a), -W64LIT(0xe734adcf4d0e16b2), -W64LIT(0x903f8dec8adb5c9d), -W64LIT(0xf02d3ae33f1fbd6d), -W64LIT(0x725698e8d96610dd), -W64LIT(0x1da3124f4e821fce), -W64LIT(0x1719972c7211abdf), -W64LIT(0x11dc470d6660c7d0), -W64LIT(0xec55a3597770b05b), -W64LIT(0xbfd6dd416814ed2e), -W64LIT(0x57054d26073a157f), -W64LIT(0x1e3b7aa544402933), -W64LIT(0x5ffc2b5a3786856b), -W64LIT(0x61c93cfab329f308), -W64LIT(0x3e3517a084af7663), -W64LIT(0xf6e8eac22b6ed162), -W64LIT(0x1007ccf8608dd528), -W64LIT(0x66d7672ea1b58dff), -W64LIT(0x8b594f82d0282f5c), -W64LIT(0x1fe0f15042ad3bcb), -W64LIT(0x4b7dd49c4f551849), -W64LIT(0x4c638f485dc966be), -W64LIT(0xcfc3a6b6bd5dd9f6), -W64LIT(0x46d90a2b615ad2af), -W64LIT(0x8565f9dff4e5d347), -W64LIT(0x94b9bed292851497), -W64LIT(0xfa97bf80038c097c), -W64LIT(0xb9130d607c658121), -W64LIT(0xdc5c02a4d7123a23), -W64LIT(0x224d8e1accc07b55), -W64LIT(0x87261ac0f8caf742), -W64LIT(0xd901ba6fc9a160d1), -W64LIT(0xab57228710c7700c), -W64LIT(0x21d5e6f0c6024da8), -W64LIT(0x98c6eb90ba67cc89), -W64LIT(0x827ba20be679adb0), -W64LIT(0x991d6065bc8ade71), -W64LIT(0x5546ae390b15317a), -W64LIT(0xa56b94da340a8c17), -W64LIT(0x071e5bd4129c7ef7), -W64LIT(0xe02af61b5f926845), -W64LIT(0x6b73b9998fba4719), -W64LIT(0xdfc46a4eddd00cde), -W64LIT(0x770b2023c7d54a2f), -W64LIT(0x7e29cdaaf184c8c3), -W64LIT(0xba8b658a76a7b7dc), -W64LIT(0x9c40d8aea2398483), -W64LIT(0x9fd8b044a8fbb27e), -W64LIT(0xdb425970c58e44d4), -W64LIT(0xe269150453bd4c40), -W64LIT(0x3c76f4bf88805266), -W64LIT(0xf1f6b11639f2af95), -W64LIT(0x549d25cc0df82382), -W64LIT(0x4db804bd5b247446), -W64LIT(0x8a82c477d6c53da4), -W64LIT(0x5258f5ed19894f8d), -W64LIT(0x6e2e015291091deb), -W64LIT(0xc1ff10eb999025ed), -W64LIT(0xbd953e5e643bc92b), -W64LIT(0xc8ddfd62afc1a701), -W64LIT(0x5c6443b03d44b396), -W64LIT(0x6c6de24d9d2639ee), -W64LIT(0x1481ffc678d39d22), -W64LIT(0xd1f8dc13f91df0c5), -W64LIT(0xca9e1e7da3ee8304), -W64LIT(0xdd878951d1ff28db), -W64LIT(0x6012b70fb5c4e1f0), -W64LIT(0x1b66c26e5af373c1), -W64LIT(0xe3b29ef155505eb8), -W64LIT(0x70157bf7d54934d8), -W64LIT(0x2e32db58e422a34b), -W64LIT(0x6aa8326c895755e1), -W64LIT(0xb6f430c85e456fc2), -W64LIT(0xfd89e4541110778b), -W64LIT(0x88c12768daea19a1), -W64LIT(0xcd8045a9b172fdf3), -/* box 3 */ -W64LIT(0x99183e616655b742), -W64LIT(0xb2872032a50d6860), -W64LIT(0x0946f63b060528ef), -W64LIT(0x36612b9a141ef07d), -W64LIT(0x0634da84dd49579b), -W64LIT(0xfc9c9e9b486c8a57), -W64LIT(0xa63fe3c0744e6fd0), -W64LIT(0xf1515758d8b46bf9), -W64LIT(0x3e82559fcd5197ff), -W64LIT(0x92e12d262bc40177), -W64LIT(0xc3bb433a5a7752c5), -W64LIT(0x21c3852a5183267a), -W64LIT(0x39130725cf528f09), -W64LIT(0x9ba7db1d2dc12998), -W64LIT(0xc58f99be873e055e), -W64LIT(0xd9d424498f32656c), -W64LIT(0x27f75fae8cca71e1), -W64LIT(0x59b91019a8fc3430), -W64LIT(0xce768af9caafb36b), -W64LIT(0x9d930199f0887e03), -W64LIT(0x63b07a7ef3706a8e), -W64LIT(0xb5167288a70e7096), -W64LIT(0x40cc1a28e967d22e), -W64LIT(0x4d01d3eb79bf3380), -W64LIT(0x9e896cdb6456afb4), -W64LIT(0x2548bad2c75eef3b), -W64LIT(0xa79a6bfeab0420bd), -W64LIT(0x9f2ce4e5bb1ce0d9), -W64LIT(0x32ea146282c3393c), -W64LIT(0x6d67defff7765a97), -W64LIT(0x83775912b31080eb), -W64LIT(0xf5da68a04e69a2b8), -W64LIT(0x1196743498d4819c), -W64LIT(0x0bf913474d91b635), -W64LIT(0x43d6776a7db90399), -W64LIT(0x444725d07fba1b6f), -W64LIT(0x6584a0fa2e393d15), -W64LIT(0x3f27dda1121bd892), -W64LIT(0xf6c005e2dab7730f), -W64LIT(0x56cb3ca673b04b44), -W64LIT(0x642128c4f1737278), -W64LIT(0xbf4ae9f135d589ce), -W64LIT(0xb038c54eee99f6ba), -W64LIT(0xf47fe09e9123edd5), -W64LIT(0x75b75cf069a7f3e4), -W64LIT(0xd419ed8a1fea84c2), -W64LIT(0x73838674b4eea47f), -W64LIT(0x498aec13ef62fac1), -W64LIT(0x20660d148ec96917), -W64LIT(0xa48006bc3fdaf10a), -W64LIT(0x2f1421ab55851663), -W64LIT(0x0a5c9b7992dbf958), -W64LIT(0xd1375a4c567d02ee), -W64LIT(0x0000000000000000), -W64LIT(0xc842507d17e6e4f0), -W64LIT(0xf3eeb2249320f523), -W64LIT(0xc9e7d843c8acab9d), -W64LIT(0xff86f3d9dcb25be0), -W64LIT(0xb4b3fab678443ffb), -W64LIT(0xb19d4d7031d3b9d7), -W64LIT(0x79df1d0d26355d27), -W64LIT(0x8eba90d123c86145), -W64LIT(0xaa57a23d3bdcc113), -W64LIT(0xcb583d3f83383547), -W64LIT(0xd871ac7750782a01), -W64LIT(0xe162ab529f2aa508), -W64LIT(0x38b68f1b1018c064), -W64LIT(0x237c60561a17b8a0), -W64LIT(0xa31154063dd9e9fc), -W64LIT(0x713c6308ff7a3aa5), -W64LIT(0x1a6f6773d54537a9), -W64LIT(0x08e37e05d94f6782), -W64LIT(0x357b46d880c021ca), -W64LIT(0x6cc256c1283c15fa), -W64LIT(0xcfd302c715e5fc06), -W64LIT(0xbdf50c8d7e411714), -W64LIT(0x7cf1aacb6fa2db0b), -W64LIT(0x5240035ee56d8205), -W64LIT(0x7b60f8716da1c3fd), -W64LIT(0x01a5883edf4a4f6d), -W64LIT(0xdd5f1bb119efac2d), -W64LIT(0x5474d9da3824d59e), -W64LIT(0x0f722cbfdb4c7f74), -W64LIT(0x17a2aeb0459dd607), -W64LIT(0x37c4a3a4cb54bf10), -W64LIT(0xc21ecb04853d1da8), -W64LIT(0x4273ff54a2f34cf4), -W64LIT(0xdace490b1becb4db), -W64LIT(0x6af68c45f5754261), -W64LIT(0x46f8c0ac342e85b5), -W64LIT(0x854383966e59d770), -W64LIT(0x81c8bc6ef8841e31), -W64LIT(0x3bace25984c611d3), -W64LIT(0x1033fc0a479ecef1), -W64LIT(0x1c5bbdf7080c6032), -W64LIT(0x7412d4ceb6edbc89), -W64LIT(0xa8e8474170485fc9), -W64LIT(0xb8dbbb4b37d69138), -W64LIT(0x079152ba020318f6), -W64LIT(0x72260e4a6ba4eb12), -W64LIT(0x905ec85a60509fad), -W64LIT(0x2dabc4d71e1188b9), -W64LIT(0xd092d27289374d83), -W64LIT(0x610f9f02b8e4f454), -W64LIT(0x02bfe57c4b949eda), -W64LIT(0x95707f9c29c71981), -W64LIT(0x6fd83b83bce2c44d), -W64LIT(0x5d322fe13e21fd71), -W64LIT(0x34decee65f8a6ea7), -W64LIT(0xcd6ce7bb5e7162dc), -W64LIT(0xfb0dcc214a6f92a1), -W64LIT(0x2eb1a9958acf590e), -W64LIT(0xdcfa938fc6a5e340), -W64LIT(0x669ecdb8bae7eca2), -W64LIT(0x151d4bcc0e0948dd), -W64LIT(0xfd3916a59726c53a), -W64LIT(0x581c982777b67b5d), -W64LIT(0x1bcaef4d0a0f78c4), -W64LIT(0xdfe0fecd527b32f7), -W64LIT(0x128c19760c0a502b), -W64LIT(0x84e60ba8b113981d), -W64LIT(0x3c3db0e386c50925), -W64LIT(0x7febc789fb7c0abc), -W64LIT(0x7d5422f5b0e89466), -W64LIT(0xd70380c88b345575), -W64LIT(0xbbc1d609a308408f), -W64LIT(0xe278c6100bf474bf), -W64LIT(0x5e2842a3aaff2cc6), -W64LIT(0x6b53047b2a3f0d0c), -W64LIT(0xf7658ddc05fd3c62), -W64LIT(0x9a025323f28b66f5), -W64LIT(0x8c0575ad685cff9f), -W64LIT(0x76ad31b2fd792253), -W64LIT(0x68496939bee1dcbb), -W64LIT(0x7e4e4fb7243645d1), -W64LIT(0xe44c1c94d6bd2324), -W64LIT(0xbeef61cfea9fc6a3), -W64LIT(0x91fb4064bf1ad0c0), -W64LIT(0x052eb7c64997862c), -W64LIT(0x4a9081517bbc2b76), -W64LIT(0x8f1f18effc822e28), -W64LIT(0x3a096a675b8c5ebe), -W64LIT(0xee1087ed4466da7c), -W64LIT(0x2652d79053803e8c), -W64LIT(0x7099eb36203075c8), -W64LIT(0xc7307cc2ccaa9b84), -W64LIT(0x5c97a7dfe16bb21c), -W64LIT(0x50ffe622aef91cdf), -W64LIT(0x8da0fd93b716b0f2), -W64LIT(0x69ece10761ab93d6), -W64LIT(0x31f07920161de88b), -W64LIT(0x13299148d3401f46), -W64LIT(0x031a6d4294ded1b7), -W64LIT(0xccc96f85813b2db1), -W64LIT(0x14b8c3f2d14307b0), -W64LIT(0x8659eed4fa8706c7), -W64LIT(0xba645e377c420fe2), -W64LIT(0x2920fb2f88cc41f8), -W64LIT(0x87fc66ea25cd49aa), -W64LIT(0x1ee4588b4398fee8), -W64LIT(0xecaf62910ff244a6), -W64LIT(0xf817a163deb14316), -W64LIT(0x45e2adeea0f05402), -W64LIT(0x806d345027ce515c), -W64LIT(0x576eb498acfa0429), -W64LIT(0xa5258e82e090be67), -W64LIT(0x892bc26b21cb79b3), -W64LIT(0x6e7db3bd63a88b20), -W64LIT(0x4e1bbea9ed61e237), -W64LIT(0xadc6f08739dfd9e5), -W64LIT(0x8b9427176a5fe769), -W64LIT(0xa1aeb17a764d7726), -W64LIT(0x4b35096fa4f6641b), -W64LIT(0x22d9e868c55df7cd), -W64LIT(0x55d151e4e76e9af3), -W64LIT(0x966a12debd19c836), -W64LIT(0x0dcdc9c390d8e1ae), -W64LIT(0xf24b3a1a4c6aba4e), -W64LIT(0x24ed32ec1814a056), -W64LIT(0xaf7915fb724b473f), -W64LIT(0x2885731157860e95), -W64LIT(0x9c3689a72fc2316e), -W64LIT(0x475d4892eb64cad8), -W64LIT(0xac6378b9e6959688), -W64LIT(0xa00b3944a907384b), -W64LIT(0xc695f4fc13e0d4e9), -W64LIT(0x3055f11ec957a7e6), -W64LIT(0x6215f2402c3a25e3), -W64LIT(0xde4576f38d317d9a), -W64LIT(0x9344a518f48e4e1a), -W64LIT(0x82d2d12c6c5acf86), -W64LIT(0xefb50fd39b2c9511), -W64LIT(0xe981d5574665c28a), -W64LIT(0x5f8dca9d75b563ab), -W64LIT(0xb60c1fca33d0a121), -W64LIT(0xfe237be703f8148d), -W64LIT(0xd6a608f6547e1a18), -W64LIT(0xb97e3375e89cde55), -W64LIT(0xd388bf301de99c34), -W64LIT(0x5b06f565e368aaea), -W64LIT(0xf0f4df6607fe2494), -W64LIT(0x1607268e9ad7996a), -W64LIT(0xaedc9dc5ad010852), -W64LIT(0xe0c7236c4060ea65), -W64LIT(0xea9bb815d2bb133d), -W64LIT(0x888e4a55fe8136de), -W64LIT(0x5aa37d5b3c22e587), -W64LIT(0xc104a64611e3cc1f), -W64LIT(0x515a6e1c71b353b2), -W64LIT(0xc42a118058744a33), -W64LIT(0x7708b98c22336d3e), -W64LIT(0x2a3a966d1c12904f), -W64LIT(0x8a31af29b515a804), -W64LIT(0xed0aeaafd0b80bcb), -W64LIT(0x2c0e4ce9c15bc7d4), -W64LIT(0x0c6841fd4f92aec3), -W64LIT(0x98bdb65fb91ff82f), -W64LIT(0x1f41d0b59cd2b185), -W64LIT(0xb322a80c7a47270d), -W64LIT(0xe6f3f9e89d29bdfe), -W64LIT(0x7ac5704fb2eb8c90), -W64LIT(0xa94dcf7faf0210a4), -W64LIT(0x787a9533f97f124a), -W64LIT(0xdb6bc135c4a6fbb6), -W64LIT(0x048b3ff896ddc941), -W64LIT(0xe8245d69992f8de7), -W64LIT(0xe3dd4e2ed4be3bd2), -W64LIT(0xcafdb5015c727a2a), -W64LIT(0xb7a997f4ec9aee4c), -W64LIT(0xe75671d64263f293), -W64LIT(0x2b9f1e53c358df22), -W64LIT(0x18d0820f9ed1a973), -W64LIT(0xabf22a03e4968e7e), -W64LIT(0xa2b4dc38e293a691), -W64LIT(0x673b458665ada3cf), -W64LIT(0xf9b2295d01fb0c7b), -W64LIT(0xd22d370ec2a3d359), -W64LIT(0x97cf9ae06253875b), -W64LIT(0x0ed7a48104063019), -W64LIT(0x482f642d3028b5ac), -W64LIT(0xc0a12e78cea98372), -W64LIT(0x4fbe3697322bad5a), -W64LIT(0x19750a31419be61e), -W64LIT(0x41699216362d9d43), -W64LIT(0xd5bc65b4c0a0cbaf), -W64LIT(0xe5e994aa09f76c49), -W64LIT(0xeb3e302b0df15c50), -W64LIT(0x94d5f7a2f68d56ec), -W64LIT(0x53e58b603a27cd68), -W64LIT(0x3d9838dd598f4648), -W64LIT(0x60aa173c67aebb39), -W64LIT(0x1dfe35c9d7462f5f), -W64LIT(0x4ca45bd5a6f57ced), -W64LIT(0xbc5084b3a10b5879), -W64LIT(0xfaa8441f9525ddcc), -W64LIT(0x334f9c5c5d897651), -/* box 4 */ -W64LIT(0xda1687a883adf27e), -W64LIT(0xe35c9378578d9f22), -W64LIT(0x303ca4531637fa40), -W64LIT(0xa088321f74b20375), -W64LIT(0xc9863f3a9acb95e9), -W64LIT(0x5fcf47c57d0b0ed4), -W64LIT(0x4aa211e4e1280b4b), -W64LIT(0xe1a4c9ba871d1289), -W64LIT(0x4926664759f03a4f), -W64LIT(0xadfb36ede3707bca), -W64LIT(0xcf7bd1891f8ef7e1), -W64LIT(0x9735559e8f882792), -W64LIT(0x5932a976f84e6cdc), -W64LIT(0x9dc792bef547818a), -W64LIT(0x06fdeeb385456208), -W64LIT(0x46ad38771ea2cf5b), -W64LIT(0x5eb36aa41543b27b), -W64LIT(0x8b2eb33cd1bcb511), -W64LIT(0x71105ff6e598ebbc), -W64LIT(0x5441ad846f8c1463), -W64LIT(0x4c5fff57646d6943), -W64LIT(0xf3485c49f633c9b1), -W64LIT(0x9cbbbfdf9d0f3d25), -W64LIT(0x22d031a067192178), -W64LIT(0xca0248992213a4ed), -W64LIT(0x19627fb263a9c18f), -W64LIT(0x9330e1efda5dc831), -W64LIT(0x1390b89219666797), -W64LIT(0x2edf18339893e568), -W64LIT(0x6c779435d3e4c590), -W64LIT(0x53c06e568281cac4), -W64LIT(0x6ff3e3966b3cf494), -W64LIT(0xfe3b58bb61f1b10e), -W64LIT(0x77edb14560dd89b4), -W64LIT(0x02f85ac2d0908dab), -W64LIT(0x12ec95f3712edb38), -W64LIT(0x85d9c06dfea6fcaa), -W64LIT(0x90b4964c6285f935), -W64LIT(0xf1b0068b26a3441a), -W64LIT(0x729428555d40dab8), -W64LIT(0x5c4b3066c5d33fd0), -W64LIT(0x5d371d07ad9b837f), -W64LIT(0xa48d866e2167ecd6), -W64LIT(0xb661139d504937ee), -W64LIT(0xa27068dda4228ede), -W64LIT(0xf8c6b608e4b4d306), -W64LIT(0x6bf657e73ee91b37), -W64LIT(0xac871b8c8b38c765), -W64LIT(0x4ea7a595b4fde4e8), -W64LIT(0x0d7304f297c278bf), -W64LIT(0xb71d3efc38018b41), -W64LIT(0xae7f414e5ba84ace), -W64LIT(0xaf036c2f33e0f661), -W64LIT(0x0000000000000000), -W64LIT(0xb89660cc7f537e55), -W64LIT(0xa675dcacf1f7617d), -W64LIT(0x610490c74426bd2f), -W64LIT(0xc18ca2d83094be5a), -W64LIT(0x2adaac42cd460acb), -W64LIT(0x7d1f76651a122fac), -W64LIT(0xc58916a9654151f9), -W64LIT(0xedabe0297897d699), -W64LIT(0x2d5b6f90204bd46c), -W64LIT(0x26d585d132cccedb), -W64LIT(0x9f3fc87c25d70c21), -W64LIT(0xc60d610add9960fd), -W64LIT(0x80a0597dc33bafa6), -W64LIT(0xd0e44088f9625466), -W64LIT(0x1d67cbc3367c2e2c), -W64LIT(0x2c2742f1480368c3), -W64LIT(0x89d6e9fe012c38ba), -W64LIT(0xe9ae54582d42393a), -W64LIT(0x3ecbd702392db3fb), -W64LIT(0xb5e5643ee89106ea), -W64LIT(0xa882affddeed28c6), -W64LIT(0x1ae60811db71f08b), -W64LIT(0x924ccc8eb215749e), -W64LIT(0xfcc30279b1613ca5), -W64LIT(0x825803bf13ab220d), -W64LIT(0xd992f00b3b75c37a), -W64LIT(0xc8fa125bf2832946), -W64LIT(0x35453d432baaa94c), -W64LIT(0xf9ba9b698cfc6fa9), -W64LIT(0x37bd6781fb3a24e7), -W64LIT(0x791ac2144fc7c00f), -W64LIT(0x16e9218224fb349b), -W64LIT(0xdb6aaac9ebe54ed1), -W64LIT(0xd8eedd6a533d7fd5), -W64LIT(0x7c635b04725a9303), -W64LIT(0x553d80e507c4a8cc), -W64LIT(0x9a46516c184a5f2d), -W64LIT(0x14117b40f46bb930), -W64LIT(0x1ee3bc608ea41f28), -W64LIT(0x27a9a8b05a847274), -W64LIT(0x4050d6c49be7ad53), -W64LIT(0x7be298d69f574da4), -W64LIT(0x6a8a7a8656a1a798), -W64LIT(0x4d23d2360c25d5ec), -W64LIT(0x1014cf31a1be5693), -W64LIT(0xb264a7ec059cd84d), -W64LIT(0xea2a23fb959a083e), -W64LIT(0xf0cc2bea4eebf8b5), -W64LIT(0x76919c240895351b), -W64LIT(0x0b8eea4112871ab7), -W64LIT(0x47d1151676ea73f4), -W64LIT(0xbdeff9dc42ce2d59), -W64LIT(0x2ba68123a50eb664), -W64LIT(0x057999103d9d530c), -W64LIT(0xe759270902587081), -W64LIT(0xef53baeba8075b32), -W64LIT(0x4fdb88f4dcb55847), -W64LIT(0x6e8fcef70374483b), -W64LIT(0x1168e250c9f6ea3c), -W64LIT(0x1b9a2570b3394c24), -W64LIT(0x706c72978dd05713), -W64LIT(0x865db7ce467ecdae), -W64LIT(0x52bc4337eac9766b), -W64LIT(0x504419f53a59fbc0), -W64LIT(0x8f2b074d84695ab2), -W64LIT(0x6078bda62c6e0180), -W64LIT(0x43d4a167233f9c57), -W64LIT(0x0ef773512f1a49bb), -W64LIT(0x0c0f2993ff8ac410), -W64LIT(0x4bde3c858960b7e4), -W64LIT(0x66855315a92b6388), -W64LIT(0xd360372b41ba6562), -W64LIT(0x584e84179006d073), -W64LIT(0x9b3a7c0d7002e382), -W64LIT(0xa5f1ab0f492f5079), -W64LIT(0x2822f6801dd68760), -W64LIT(0x445562b5ce3242f0), -W64LIT(0xaa7af53f0e7da56d), -W64LIT(0x3c338dc0e9bd3e50), -W64LIT(0x3bb24e1204b0e0f7), -W64LIT(0xd59dd998c4ff076a), -W64LIT(0x91c8bb2d0acd459a), -W64LIT(0x84a5ed0c96ee4005), -W64LIT(0x33b8d3f0aeefcb44), -W64LIT(0x57c5da27d7542567), -W64LIT(0x32c4fe91c6a777eb), -W64LIT(0x3439102243e215e3), -W64LIT(0xc7714c6bb5d1dc52), -W64LIT(0x3fb7fa6351650f54), -W64LIT(0x87219aaf2e367101), -W64LIT(0xf5b5b2fa7376abb9), -W64LIT(0x412cfba5f3af11fc), -W64LIT(0xdceb691b06e89076), -W64LIT(0xbb12176fc78b4f51), -W64LIT(0x73e8053435086617), -W64LIT(0xe220be193fc5238d), -W64LIT(0xb09cfd2ed50c55e6), -W64LIT(0xb9ea4dad171bc2fa), -W64LIT(0x9e43e51d4d9fb08e), -W64LIT(0x36c14ae093729848), -W64LIT(0xa9fe829cb6a59469), -W64LIT(0x0405b47155d5efa3), -W64LIT(0x0af2c7207acfa618), -W64LIT(0x7e9b01c6a2ca1ea8), -W64LIT(0xdd97447a6ea02cd9), -W64LIT(0x0781c3d2ed0ddea7), -W64LIT(0x7866ef75278f7ca0), -W64LIT(0xd1986de9912ae8c9), -W64LIT(0xcb7e65f84a5b1842), -W64LIT(0xcd838b4bcf1e7a4a), -W64LIT(0xab06d85e663519c2), -W64LIT(0xd4e1f4f9acb7bbc5), -W64LIT(0xfdbf2f18d929800a), -W64LIT(0xf23471289e7b751e), -W64LIT(0xbc93d4bd2a8691f6), -W64LIT(0x3d4fa0a181f582ff), -W64LIT(0xba6e3a0eafc3f3fe), -W64LIT(0x5ab6ded540965dd8), -W64LIT(0xeb560e9afdd2b491), -W64LIT(0x0976b083c217971c), -W64LIT(0xecd7cd4810df6a36), -W64LIT(0x23ac1cc10f519dd7), -W64LIT(0xbe6b8e7ffa161c5d), -W64LIT(0x7fe72ca7ca82a207), -W64LIT(0xc0f08fb958dc02f5), -W64LIT(0x7a9eb5b7f71ff10b), -W64LIT(0xa709f1cd99bfddd2), -W64LIT(0x8dd35d8f54f9d719), -W64LIT(0x8caf70ee3cb16bb6), -W64LIT(0xe4dd50aaba804185), -W64LIT(0x83242ede7be39ea2), -W64LIT(0x98be0baec8dad286), -W64LIT(0x690e0d25ee79969c), -W64LIT(0x95cd0f5c5f18aa39), -W64LIT(0x56b9f746bf1c99c8), -W64LIT(0x7469c6e6d805b8b0), -W64LIT(0x8a529e5db9f409be), -W64LIT(0xe6250a686a10cc2e), -W64LIT(0x2fa33552f0db59c7), -W64LIT(0x42a88c064b7720f8), -W64LIT(0x6d0bb954bbac793f), -W64LIT(0x181e52d30be17d20), -W64LIT(0xbf17a31e925ea0f2), -W64LIT(0x94b1223d37501696), -W64LIT(0xe8d27939450a8595), -W64LIT(0xccffa62aa756c6e5), -W64LIT(0x383639b1bc68d1f3), -W64LIT(0xee2f978ac04fe79d), -W64LIT(0xa30c45bccc6a3271), -W64LIT(0x1f9f9101e6eca387), -W64LIT(0xb1e0d04fbd44e949), -W64LIT(0x242ddf13e25c4370), -W64LIT(0x156d56219c23059f), -W64LIT(0x88aac49f69648415), -W64LIT(0x6280e764fcfe8c2b), -W64LIT(0xdf6f1eb8be30a172), -W64LIT(0xe5a17dcbd2c8fd2a), -W64LIT(0xe0d8e4dbef55ae26), -W64LIT(0x63fcca0594b63084), -W64LIT(0xa1f41f7e1cfabfda), -W64LIT(0x295edbe1759e3bcf), -W64LIT(0x67f97e74c163df27), -W64LIT(0x038477a3b8d83104), -W64LIT(0xde1333d9d6781ddd), -W64LIT(0x3ace63736cf85c58), -W64LIT(0xd619ae3b7c27366e), -W64LIT(0x5bcaf3b428dee177), -W64LIT(0xb3188a8d6dd464e2), -W64LIT(0x1c1be6a25e349283), -W64LIT(0x017c2d616848bcaf), -W64LIT(0x8e572a2cec21e61d), -W64LIT(0xf631c559cbae9abd), -W64LIT(0x81dc741cab731309), -W64LIT(0xff4775da09b90da1), -W64LIT(0xb499495f80d9ba45), -W64LIT(0x0f8b5e304752f514), -W64LIT(0x394a14d0d4206d5c), -W64LIT(0xce07fce877c64b4e), -W64LIT(0xf4c99f9b1b3e1716), -W64LIT(0xc4f53bc80d09ed56), -W64LIT(0xc208d57b884c8f5e), -W64LIT(0x080a9de2aa5f2bb3), -W64LIT(0x314089327e7f46ef), -W64LIT(0xfa3eecca34245ead), -W64LIT(0x20286b62b789acd3), -W64LIT(0x7515eb87b04d041f), -W64LIT(0x513834945211476f), -W64LIT(0x650124b611f3528c), -W64LIT(0x17950ce34cb38834), -W64LIT(0x45294fd4a67afe5f), -W64LIT(0x21544603dfc1107c), -W64LIT(0x485a4b2631b886e0), -W64LIT(0x6872204486312a33), -W64LIT(0x647d09d779bbee23), -W64LIT(0x2551f2728a14ffdf), -W64LIT(0xd765835a146f8ac1), -W64LIT(0xd21c1a4a29f2d9cd), -W64LIT(0x99c226cfa0926e29), -W64LIT(0xfb42c1ab5c6ce202), -W64LIT(0xc374f81ae00433f1), -W64LIT(0x964978ffe7c09b3d), -W64LIT(0xf74de838a3e62612), -/* box 5 */ -W64LIT(0x74b87b36b0592c6a), -W64LIT(0x3d82d75dffb4b81c), -W64LIT(0x8884246715267825), -W64LIT(0xdaf2d8a77ed4e5de), -W64LIT(0xfeb118650e53f9c7), -W64LIT(0xbd2d1aea59226b06), -W64LIT(0x26ce87f6dbabb191), -W64LIT(0x32772ecbeb66bd0a), -W64LIT(0xd4bbf82bc5104c8c), -W64LIT(0x055357720c4e03a1), -W64LIT(0xef5be62a32d0f6fd), -W64LIT(0xbe1c84c45d186aca), -W64LIT(0xacc7e4a565a1643c), -W64LIT(0x8dd7731519687b84), -W64LIT(0x11eafe4f3c830f3a), -W64LIT(0x04ef8e68a358afe5), -W64LIT(0x40ad9ca1534b930d), -W64LIT(0xe44191d4855a5c0e), -W64LIT(0x6001d20b809420f1), -W64LIT(0x73666b70173b8243), -W64LIT(0x372479b9e728beab), -W64LIT(0x45fecbd35f0590ac), -W64LIT(0x7057f55e1301838f), -W64LIT(0xff0dc17fa1455583), -W64LIT(0x0cc467b810e804da), -W64LIT(0xb9c29482fa7ac4e3), -W64LIT(0xa003831d754960e6), -W64LIT(0x8a096353be0ad5ad), -W64LIT(0xdd2cc8e1d9b64bf7), -W64LIT(0xc7dc415052bfee3e), -W64LIT(0x9f0c137421d17572), -W64LIT(0x35a93e8d4c041323), -W64LIT(0x9a5f44062d9f76d3), -W64LIT(0x71eb2c44bc172fcb), -W64LIT(0x0ff5f99614d20516), -W64LIT(0x7789e518b4632da6), -W64LIT(0xc99561dce97b476c), -W64LIT(0x5276fcc06bf29dfb), -W64LIT(0x4a0b32454bd795ba), -W64LIT(0x9274add69e2fddec), -W64LIT(0x4f5865374799961b), -W64LIT(0xb2d8e37c4df06e10), -W64LIT(0xc4eddf7e5685eff2), -W64LIT(0xb3643a66e2e6c254), -W64LIT(0xd50721316a06e0c8), -W64LIT(0x8bb5ba49111c79e9), -W64LIT(0x2bb639546455190f), -W64LIT(0xf8d3d1390627fbaa), -W64LIT(0x38d1802ff3fabbbd), -W64LIT(0xdfa18fd5729ae67f), -W64LIT(0x4ee4bc2de88f3a5f), -W64LIT(0xf72628af12f5febc), -W64LIT(0x0aa6aee4189c06b7), -W64LIT(0x0000000000000000), -W64LIT(0x9eb0ca6e8ec7d936), -W64LIT(0xcb1826e84257eae4), -W64LIT(0x187dce8520250841), -W64LIT(0xc28f16225ef1ed9f), -W64LIT(0xc333cf38f1e741db), -W64LIT(0x4220db95f8673e85), -W64LIT(0xdc9011fb76a0e7b3), -W64LIT(0x105627559395a37e), -W64LIT(0x2f59b73cc70db6ea), -W64LIT(0xe112c6a689145faf), -W64LIT(0x82228a830dba7e92), -W64LIT(0x2ee56e26681b1aae), -W64LIT(0x2a0ae04ecb43b54b), -W64LIT(0x47738ce7f4293d24), -W64LIT(0xa7dd935bd22bcecf), -W64LIT(0xd2d93177cd644ee1), -W64LIT(0xebb4684291885918), -W64LIT(0x0e49208cbbc4a952), -W64LIT(0xa550d46f79076347), -W64LIT(0x411145bbfc5d3f49), -W64LIT(0xe6ccd6e02e76f186), -W64LIT(0x4bb7eb5fe4c139fe), -W64LIT(0x5d8305567f2098ed), -W64LIT(0x95aabd90394d73c5), -W64LIT(0x25ff19d8df91b05d), -W64LIT(0x86cd04ebaee2d177), -W64LIT(0x03319e2e043a01cc), -W64LIT(0x6b1ba5f5371e8a02), -W64LIT(0x76353c021b7581e2), -W64LIT(0x64ee5c6323cc8f14), -W64LIT(0x5c3fdc4cd03634a9), -W64LIT(0x6996e2c19c32278a), -W64LIT(0x8938fd7dba30d461), -W64LIT(0x7b4d82a0a48b297c), -W64LIT(0xbfa05ddef20ec68e), -W64LIT(0x8ee6ed3b1d527a48), -W64LIT(0x61bd0b112f828cb5), -W64LIT(0x66631b5788e0229c), -W64LIT(0x55a8ec86cc9033d2), -W64LIT(0x1c9240ed837da7a4), -W64LIT(0x150570279fdba0df), -W64LIT(0x53ca25dac4e431bf), -W64LIT(0xd636bf1f6e3ce104), -W64LIT(0xcaa4fff2ed4146a0), -W64LIT(0x787c1c8ea0b128b0), -W64LIT(0xad7b3dbfcab7c878), -W64LIT(0xfc3c5f51a57f544f), -W64LIT(0xb78bb40e41be6db1), -W64LIT(0x8c6baa0fb67ed7c0), -W64LIT(0xce4b719a4e19e945), -W64LIT(0xf96f0823a93157ee), -W64LIT(0x7d2f4bfcacff2b11), -W64LIT(0x3eb34973fb8eb9d0), -W64LIT(0xe39f81922238f227), -W64LIT(0x239dd084d7e5b230), -W64LIT(0x1fa3dec38747a668), -W64LIT(0xc5510664f99343b6), -W64LIT(0xc829b8c6466deb28), -W64LIT(0x85fc9ac5aad8d0bb), -W64LIT(0xb6376d14eea8c1f5), -W64LIT(0x9d8154408afdd8fa), -W64LIT(0x3be01e01f7c0ba71), -W64LIT(0x628c953f2bb88d79), -W64LIT(0x6d796ca93f6a886f), -W64LIT(0xfa5e960dad0b5622), -W64LIT(0xe5fd48ce2a4cf04a), -W64LIT(0xe7700ffa81605dc2), -W64LIT(0x2dd4f0086c211b62), -W64LIT(0x2221099e78f31e74), -W64LIT(0xdb4e01bdd1c2499a), -W64LIT(0xf417b68116cfff70), -W64LIT(0xb506f33aea92c039), -W64LIT(0x514762ee6fc89c37), -W64LIT(0x9c3d8d5a25eb74be), -W64LIT(0x396d59355cec17f9), -W64LIT(0xccc636aee53544cd), -W64LIT(0x0b1a77feb78aaaf3), -W64LIT(0xe9392f763aa4f490), -W64LIT(0xaaa52df96dd56651), -W64LIT(0x46cf55fd5b3f9160), -W64LIT(0xa4ec0d75d611cf03), -W64LIT(0xaff67a8b619b65f0), -W64LIT(0x3415e797e312bf67), -W64LIT(0x7af15bba0b9d8538), -W64LIT(0x811314ad09807f5e), -W64LIT(0x8771ddf101f47d33), -W64LIT(0x969b23be3d777209), -W64LIT(0xd365e86d6272e2a5), -W64LIT(0x58d05224736e9b4c), -W64LIT(0xc660984afda9427a), -W64LIT(0x5414359c63869f96), -W64LIT(0xe885f66c95b258d4), -W64LIT(0x655285798cda2350), -W64LIT(0x6cc5b5b3907c242b), -W64LIT(0x6ff42b9d944625e7), -W64LIT(0xc0025116f5dd4017), -W64LIT(0xa28ec429de65cd6e), -W64LIT(0x63304c2584ae213d), -W64LIT(0x7fa20cc807d38699), -W64LIT(0x996eda2829a5771f), -W64LIT(0x1b4c50ab241f098d), -W64LIT(0x1e1f07d928510a2c), -W64LIT(0x33cbf7d14470114e), -W64LIT(0xb055a448e6dcc398), -W64LIT(0x98d2033286b3db5b), -W64LIT(0xec6a780436eaf731), -W64LIT(0xa1bf5a07da5fcca2), -W64LIT(0xbaf30aacfe40c52f), -W64LIT(0xf144e1f31a81fcd1), -W64LIT(0xe0ae1fbc2602f3eb), -W64LIT(0x14b9a93d30cd0c9b), -W64LIT(0x596c8b3edc783708), -W64LIT(0x682a3bdb33248bce), -W64LIT(0xb87e4d98556c68a7), -W64LIT(0x80afcdb7a696d31a), -W64LIT(0x5725abb267bc9e5a), -W64LIT(0x914533f89a15dc20), -W64LIT(0x5eb29b787b1a9921), -W64LIT(0x01bcd91aaf16ac44), -W64LIT(0xc1be880c5acbec53), -W64LIT(0xedd6a11e99fc5b75), -W64LIT(0x028d4734ab2cad88), -W64LIT(0x8f5a3421b244d60c), -W64LIT(0x4dd52203ecb53b93), -W64LIT(0x3f0f906954981594), -W64LIT(0xae4aa391ce8dc9b4), -W64LIT(0x3698a0a3483e12ef), -W64LIT(0xf5ab6f9bb9d95334), -W64LIT(0x082be9d0b3b0ab3f), -W64LIT(0xd1e8af59c95e4f2d), -W64LIT(0xd87f9f93d5f84856), -W64LIT(0x6e48f2873b5089a3), -W64LIT(0x2443c0c270871c19), -W64LIT(0xb1e97d5249ca6fdc), -W64LIT(0x7c9392e603e98755), -W64LIT(0x839e5399a2acd2d6), -W64LIT(0x19c1179f8f33a405), -W64LIT(0xde1d56cfdd8c4a3b), -W64LIT(0x20ac4eaad3dfb3fc), -W64LIT(0x1af089b18b09a5c9), -W64LIT(0x3a5cc71b58d61635), -W64LIT(0x444212c9f0133ce8), -W64LIT(0x72dab26ab82d2e07), -W64LIT(0x4c69fb1943a397d7), -W64LIT(0xf3c9a6c7b1ad5159), -W64LIT(0x1d2e99f72c6b0be0), -W64LIT(0xb4ba2a2045846c7d), -W64LIT(0xe22358888d2e5e63), -W64LIT(0x2887a77a606f18c3), -W64LIT(0xa8286acdc6f9cbd9), -W64LIT(0x5f0e4262d40c3565), -W64LIT(0xeee73f309dc65ab9), -W64LIT(0x9be39d1c8289da97), -W64LIT(0x1634ee099be1a113), -W64LIT(0xea08b1583e9ef55c), -W64LIT(0x9727faa49261de4d), -W64LIT(0x2c682912c337b726), -W64LIT(0xcff7a880e10f4501), -W64LIT(0x1788371334f70d57), -W64LIT(0x27725eec74bd1dd5), -W64LIT(0x3146b0e5ef5cbcc6), -W64LIT(0x099730ca1ca6077b), -W64LIT(0xf2757fdd1ebbfd1d), -W64LIT(0x6aa77cef98082646), -W64LIT(0xbb4fd3b65156696b), -W64LIT(0x569972a8c8aa321e), -W64LIT(0xa3321d337173612a), -W64LIT(0x50fbbbf4c0de3073), -W64LIT(0x5a5d1510d84236c4), -W64LIT(0xfd80864b0a69f80b), -W64LIT(0x07de1046a762ae29), -W64LIT(0xa6614a417d3d628b), -W64LIT(0xd78a6605c12a4d40), -W64LIT(0x67dfc24d27f68ed8), -W64LIT(0xbc91c3f0f634c742), -W64LIT(0xd05476436648e369), -W64LIT(0x493aac6b4fed9476), -W64LIT(0x12db606138b90ef6), -W64LIT(0xa994b3d769ef679d), -W64LIT(0x211097b07cc91fb8), -W64LIT(0x30fa69ff404a1082), -W64LIT(0x3c3e0e4750a21458), -W64LIT(0x7504a22c1f4f802e), -W64LIT(0x844043df05ce7cff), -W64LIT(0xf0f838e9b5975095), -W64LIT(0x7e1ed5d2a8c52add), -W64LIT(0x90f9eae235037064), -W64LIT(0x0662c95c0874026d), -W64LIT(0x9416648a965bdf81), -W64LIT(0xf69af1b5bde352f8), -W64LIT(0x0d78bea2bffea89e), -W64LIT(0x293b7e60cf79b487), -W64LIT(0xd9c346897aeee412), -W64LIT(0xfbe24f17021dfa66), -W64LIT(0x1367b97b97afa2b2), -W64LIT(0xab19f4e3c2c3ca15), -W64LIT(0x48867571e0fb3832), -W64LIT(0x93c874cc313971a8), -W64LIT(0x79c0c5940fa784f4), -W64LIT(0xcd7aefb44a23e889), -W64LIT(0x439c028f577192c1), -W64LIT(0x5be1cc0a77549a80), -/* box 6 */ -W64LIT(0x714d28d778656928), -W64LIT(0xc88a7c6b84f64f7c), -W64LIT(0xec43cac5ab89aaca), -W64LIT(0x777fa38110dc16a3), -W64LIT(0x0f7d5c87e4213b5c), -W64LIT(0x73f051e5f3a1ef51), -W64LIT(0xea714193c330d541), -W64LIT(0x95e5f3dae016c4f3), -W64LIT(0x63d3738095a0e173), -W64LIT(0x9825d66f8ff379d6), -W64LIT(0xe8cc38a148f45338), -W64LIT(0xa840b0c025f06bb0), -W64LIT(0x944135c35f748735), -W64LIT(0x74661caa247ad31c), -W64LIT(0xe7b16426acd56864), -W64LIT(0xd1e689df6e6f0589), -W64LIT(0xa73dec47c1d150ec), -W64LIT(0x64453ecf427bdd3e), -W64LIT(0x0ed99a9e5b43789a), -W64LIT(0x7b1b402dc05be840), -W64LIT(0x0dc025b56fe5bd25), -W64LIT(0x3f183a284e22293a), -W64LIT(0xa0aba108160a6ca1), -W64LIT(0x46be033705bd4703), -W64LIT(0x86df6e94b2b10f6e), -W64LIT(0xa216d83a9dceead8), -W64LIT(0x129e5b57edc5885b), -W64LIT(0x7e3074509c445274), -W64LIT(0x7d29cb7ba8e297cb), -W64LIT(0x1611a9330eb871a9), -W64LIT(0x486799a95efe3f99), -W64LIT(0x9fb39b205828459b), -W64LIT(0xd0424fc6d10d464f), -W64LIT(0xe968feb8f79610fe), -W64LIT(0x5d6f8fb164e08b8f), -W64LIT(0xaafdc9f2ae34edc9), -W64LIT(0x02bd79328bc48679), -W64LIT(0x9b3c6944bb55bc69), -W64LIT(0x6277b5992ac2a2b5), -W64LIT(0x877ba88d0dd34ca8), -W64LIT(0xfa5263f6a531db63), -W64LIT(0x2e9fde54974164de), -W64LIT(0xcda14816d8e9f548), -W64LIT(0x675c81e476dd1881), -W64LIT(0x2a102c30743c9d2c), -W64LIT(0x37f32be07dd82e2b), -W64LIT(0x256d70b7901da670), -W64LIT(0x4ce86bcdbd83c66b), -W64LIT(0x50afaa040b0536aa), -W64LIT(0xef5a75ee9f2f6f75), -W64LIT(0xb3913c4644ada73c), -W64LIT(0x1187e47cd9634de4), -W64LIT(0xc54a59deeb13f259), -W64LIT(0x0000000000000000), -W64LIT(0x01a4c619bf6243c6), -W64LIT(0x90cec7a7bc097ec7), -W64LIT(0xf94bdcdd91971edc), -W64LIT(0x8e347f5c814b087f), -W64LIT(0xc7f720ec60d77420), -W64LIT(0x354e52d2f61ca852), -W64LIT(0x34ea94cb497eeb94), -W64LIT(0xae723b964d49143b), -W64LIT(0xf48bf968fe72a3f9), -W64LIT(0xfc60e8a0cd88a4e8), -W64LIT(0x2909931b409a5893), -W64LIT(0xbd48a6d81feedfa6), -W64LIT(0x6cae2f077181da2f), -W64LIT(0xad6b84bd79efd184), -W64LIT(0x18c833ad55fb0933), -W64LIT(0x204644cacc021c44), -W64LIT(0x392ab17e269b56b1), -W64LIT(0x14acd001857cf7d0), -W64LIT(0x8abb8d386236f18d), -W64LIT(0xeefeb3f7204d2cb3), -W64LIT(0xf636805a75b62580), -W64LIT(0x2bb4ea29cb5edeea), -W64LIT(0xc653e6f5dfb537e6), -W64LIT(0x8d2dc077b5edcdc0), -W64LIT(0x31c1a0b6156151a0), -W64LIT(0xf8ef1ac42ef55d1a), -W64LIT(0xdbb0e125d65184e1), -W64LIT(0x82509cf051ccf69c), -W64LIT(0xe33e96424fa89196), -W64LIT(0xdf3f1341352c7d13), -W64LIT(0x8f90b9453e294bb9), -W64LIT(0x1023226566010e22), -W64LIT(0xa58095754a15d695), -W64LIT(0x2c22a7661c85e2a7), -W64LIT(0xe183ef70c46c17ef), -W64LIT(0xafd6fd8ff22b57fd), -W64LIT(0x471ac52ebadf04c5), -W64LIT(0x4d4cadd402e185ad), -W64LIT(0x916a01be036b3d01), -W64LIT(0x28ad5502fff81b55), -W64LIT(0x3657edf9c2ba6ded), -W64LIT(0xd2ff36f45ac9c036), -W64LIT(0xf1a0cd15a26d19cd), -W64LIT(0xd90d98175d950298), -W64LIT(0xf7924643cad46646), -W64LIT(0xdd826a73bee8fb6a), -W64LIT(0x9d0ee212d3ecc3e2), -W64LIT(0xb6ba083b18b21d08), -W64LIT(0x3da5431ac5e6af43), -W64LIT(0x08eb11c833fa0711), -W64LIT(0x052b347d5c1fba34), -W64LIT(0x6fb7902c45271f90), -W64LIT(0x133a9d4e52a7cb9d), -W64LIT(0x6e135635fa455c56), -W64LIT(0x725497fc4cc3ac97), -W64LIT(0xf31db42729a99fb4), -W64LIT(0x846217a639758917), -W64LIT(0x4b7e26826a58fa26), -W64LIT(0x235ffbe1f8a4d9fb), -W64LIT(0xff79578bf92e6157), -W64LIT(0xda14273c6933c727), -W64LIT(0x8b1f4b21dd54b24b), -W64LIT(0x9caa240b6c8e8024), -W64LIT(0xc1c5abba086e0bab), -W64LIT(0xde9bd5588a4e3ed5), -W64LIT(0x2d86617fa3e7a161), -W64LIT(0xbff5dfea942a59df), -W64LIT(0x66f847fdc9bf5b47), -W64LIT(0x3b97c84cad5fd0c8), -W64LIT(0x3ebcfc31f1406afc), -W64LIT(0xca3705590f32c905), -W64LIT(0x24c9b6ae2f7fe5b6), -W64LIT(0x408c88616d043888), -W64LIT(0x93d7788c88afbb78), -W64LIT(0x196cf5b4ea994af5), -W64LIT(0x9a98af5d0437ffaf), -W64LIT(0x8c89066e0a8f8e06), -W64LIT(0xab590feb1156ae0f), -W64LIT(0xd7d4028906d67a02), -W64LIT(0xe4a8db0d9873addb), -W64LIT(0xc378d28883aa8dd2), -W64LIT(0x4ff1d4e6892503d4), -W64LIT(0xd670c490b9b439c4), -W64LIT(0x65e1f8d6fd199ef8), -W64LIT(0xf2b9723e96cbdc72), -W64LIT(0xb12c4574cf692145), -W64LIT(0x569d215263bc4921), -W64LIT(0x69851b7a2d9e601b), -W64LIT(0x5e76309a50464e30), -W64LIT(0x5fd2f683ef240df6), -W64LIT(0xd8a95e0ee2f7415e), -W64LIT(0xe29a505bf0cad250), -W64LIT(0x96fc4cf1d4b0014c), -W64LIT(0x8806f40ae9f277f4), -W64LIT(0x53b6152f3fa3f315), -W64LIT(0x1c47c1c9b686f0c1), -W64LIT(0x80ede5c2da0870e5), -W64LIT(0xd5697bbb8d12fc7b), -W64LIT(0xfdc42eb972eae72e), -W64LIT(0x0bf2aee3075cc2ae), -W64LIT(0x22fb3df847c69a3d), -W64LIT(0xbadeeb97c835e3eb), -W64LIT(0xdc26ac6a018ab8ac), -W64LIT(0xbcec60c1a08c9c60), -W64LIT(0x4231f153e6c0bef1), -W64LIT(0x337cd9849ea5d7d9), -W64LIT(0x5b5d04e70c59f404), -W64LIT(0x79a6391f4b9f6e39), -W64LIT(0x5212d33680c1b0d3), -W64LIT(0xb5a3b7102c14d8b7), -W64LIT(0x7f94b249232611b2), -W64LIT(0x17b56f2ab1da326f), -W64LIT(0x59e07dd5879d727d), -W64LIT(0xebd5878a7c529687), -W64LIT(0xbb7a2d8e7757a02d), -W64LIT(0x0319bf2b34a6c5bf), -W64LIT(0x5ccb49a8db82c849), -W64LIT(0x1de307d009e4b307), -W64LIT(0x49c35fb0e19c7c5f), -W64LIT(0x55849e79571a8c9e), -W64LIT(0x7abf86347f39ab86), -W64LIT(0x9273be9537cdf8be), -W64LIT(0xe615a23f13b72ba2), -W64LIT(0x6821dd6392fc23dd), -W64LIT(0x5af9c2feb33bb7c2), -W64LIT(0x06328b5668b97f8b), -W64LIT(0x44037a058e79c17a), -W64LIT(0x83f45ae9eeaeb55a), -W64LIT(0x5739e74bdcde0ae7), -W64LIT(0xfbf6a5ef1a5398a5), -W64LIT(0xe50c1d142711ee1d), -W64LIT(0x1a754a9fde3f8f4a), -W64LIT(0x7802ff06f4fd2dff), -W64LIT(0xf52f3f714110e03f), -W64LIT(0x2674cf9ca4bb63cf), -W64LIT(0x60caccaba10624cc), -W64LIT(0xb088836d700b6283), -W64LIT(0xa6992a5e7eb3132a), -W64LIT(0xa9e476d99a922876), -W64LIT(0x6b386248a65ae662), -W64LIT(0xc2dc14913cc8ce14), -W64LIT(0x76db6598afbe5565), -W64LIT(0x32d81f9d21c7941f), -W64LIT(0x21e282d373605f82), -W64LIT(0xc0616da3b70c486d), -W64LIT(0x616e0ab21e64670a), -W64LIT(0x6d0ae91ecee399e9), -W64LIT(0x27d009851bd92009), -W64LIT(0xfedd9192464c2291), -W64LIT(0x45a7bc1c311b82bc), -W64LIT(0x54205860e878cf58), -W64LIT(0xa10f6711a9682f67), -W64LIT(0x9981107630913a10), -W64LIT(0xede70cdc14ebe90c), -W64LIT(0x70e9eecec7072aee), -W64LIT(0x1f5e7ee28220357e), -W64LIT(0x2f3b184d28232718), -W64LIT(0x41284e78d2667b4e), -W64LIT(0xa424536cf5779553), -W64LIT(0xa3b21e2322aca91e), -W64LIT(0x4e5512ff36474012), -W64LIT(0x1efab8fb3d4276b8), -W64LIT(0x89a2321356903432), -W64LIT(0xcb93c340b0508ac3), -W64LIT(0x306566afaa031266), -W64LIT(0x4adae09bd53ab9e0), -W64LIT(0xc92eba723b940cba), -W64LIT(0x094fd7d18c9844d7), -W64LIT(0xcc058e0f678bb68e), -W64LIT(0xd4cdbda23270bfbd), -W64LIT(0x0a5668fab83e8168), -W64LIT(0x510b6c1db467756c), -W64LIT(0xb86392a543f16592), -W64LIT(0x048ff264e37df9f2), -W64LIT(0x3a330e55123d930e), -W64LIT(0xb235fa5ffbcfe4fa), -W64LIT(0xb9c754bcfc932654), -W64LIT(0x3c0185037a84ec85), -W64LIT(0x0c64e3acd087fee3), -W64LIT(0xe02729697b0e5429), -W64LIT(0x07964d4fd7db3c4d), -W64LIT(0x814923db656a3323), -W64LIT(0x388e776799f91577), -W64LIT(0x6a9ca4511938a5a4), -W64LIT(0x1bd18c86615dcc8c), -W64LIT(0xb407710993769b71), -W64LIT(0x150816183a1eb416), -W64LIT(0x4395374a59a2fd37), -W64LIT(0xc4ee9fc75471b19f), -W64LIT(0x5844bbcc38ff31bb), -W64LIT(0xcf1c3124532d7331), -W64LIT(0xb71ece22a7d05ece), -W64LIT(0xaccf42a4c68d9242), -W64LIT(0x97588ae86bd2428a), -W64LIT(0x75c2dab39b1890da), -W64LIT(0x9e175d39e74a065d), -W64LIT(0xf0040b0c1d0f5a0b), -W64LIT(0xceb8f73dec4f30f7), -W64LIT(0xbe5119f32b481a19), -W64LIT(0xd35bf0ede5ab83f0), -W64LIT(0x7c8d0d621780d40d), -W64LIT(0x85c6d1bf8617cad1), -/* box 7 */ -W64LIT(0xb1c742127b66f2a4), -W64LIT(0xce916098d7a59fc1), -W64LIT(0xc312ef8e2406fa70), -W64LIT(0x956c7dced81403d5), -W64LIT(0x5a0c9b2318dd9520), -W64LIT(0xad0d57f51a480e8b), -W64LIT(0xe7b9d05287740b01), -W64LIT(0x0217f9ea2ed81268), -W64LIT(0x4d7cff19f8cd3a06), -W64LIT(0x44d1772e572b7b67), -W64LIT(0xfb73c5b5e65af72e), -W64LIT(0x91427aef84512705), -W64LIT(0x0c720963e4cf6c85), -W64LIT(0x87c398a0732d8117), -W64LIT(0xa17f5e96fe87620e), -W64LIT(0x50476c8b8e8fcf1d), -W64LIT(0xcb4ee1cc9c8cb225), -W64LIT(0x67b2304c91a8b59a), -W64LIT(0x54696baad2caebcd), -W64LIT(0xddcf03836bf01437), -W64LIT(0x46c68ec479f3690f), -W64LIT(0x8f9f96e2cba7c942), -W64LIT(0xe1802e99f5e93db9), -W64LIT(0x4e9a8086c179215a), -W64LIT(0xf0c9b4686764a427), -W64LIT(0xfd4a3b7e94c7c196), -W64LIT(0xfcbbbd0b83abc8a2), -W64LIT(0xebcbd93163bb6784), -W64LIT(0xf9643c5fc882e546), -W64LIT(0xc4da973041f7c5fc), -W64LIT(0x1af3eb2c13b3ca97), -W64LIT(0x6e1fb87b3e4ef4fb), -W64LIT(0x5e229c024498b1f0), -W64LIT(0xf516353c2c4d89c3), -W64LIT(0xcc869972f97d8da9), -W64LIT(0x8d886f08e57fdb2a), -W64LIT(0x1cca15e7612efc2f), -W64LIT(0x567e9240fc12f9a5), -W64LIT(0x43190f9032da44eb), -W64LIT(0xfeac44e1ad73daca), -W64LIT(0x07c878be65f13f8c), -W64LIT(0x618bce87e3358322), -W64LIT(0xf895ba2adfeeec72), -W64LIT(0x751dd5223a913758), -W64LIT(0x59eae4bc21698e7c), -W64LIT(0xff5dc294ba1fd3fe), -W64LIT(0x03e67f9f39b41b5c), -W64LIT(0x2292c117d1efc7c9), -W64LIT(0x8a4017b6808ee4a6), -W64LIT(0xd1bd0ae08f3f78b2), -W64LIT(0x135e631bbc558bf6), -W64LIT(0xee14586528924a60), -W64LIT(0x8857ee5cae56f6ce), -W64LIT(0x0000000000000000), -W64LIT(0x0e65f089ca177eed), -W64LIT(0x34132358269361db), -W64LIT(0x15679dd0cec8bd4e), -W64LIT(0x800be01e16dcbe9b), -W64LIT(0x949dfbbbcf780ae1), -W64LIT(0xe397d773db312fd1), -W64LIT(0xedf227fa1126513c), -W64LIT(0xb5e945332723d674), -W64LIT(0x53a11314b73bd441), -W64LIT(0x23634762c683cefd), -W64LIT(0x4b4501d28a500cbe), -W64LIT(0x473708b16e9f603b), -W64LIT(0x1770643ae010af26), -W64LIT(0xa746a05d8c1a54b6), -W64LIT(0x90b3fc9a933d2e31), -W64LIT(0x35e2a52d31ff68ef), -W64LIT(0xab34a93e68d53833), -W64LIT(0xd81082d720d939d3), -W64LIT(0xb86aca25d480b3c5), -W64LIT(0xdfd8fa694528065f), -W64LIT(0x4f6b06f3d615286e), -W64LIT(0x578f1435eb7ef091), -W64LIT(0x9af80b32056f740c), -W64LIT(0x92a40570bde53c59), -W64LIT(0xdbf6fd48196d228f), -W64LIT(0x1b026d5904dfc3a3), -W64LIT(0x3c4f2d1a9e19298e), -W64LIT(0xc8a89e53a538a979), -W64LIT(0x991e74ad3cdb6f50), -W64LIT(0x042e07215c4524d0), -W64LIT(0x8e6e1097dccbc076), -W64LIT(0xe071a8ece285348d), -W64LIT(0xd784f42bfda24e0a), -W64LIT(0x7d41db60821b7f0d), -W64LIT(0x85d4614a5df5937f), -W64LIT(0xbb8cb5baed34a899), -W64LIT(0x40ff700f0b6e5fb7), -W64LIT(0x2cf7319e1bf8b924), -W64LIT(0x3a76d3d1ec841f36), -W64LIT(0x4520f15b40477253), -W64LIT(0xf138321d7008ad13), -W64LIT(0x42e889e525b64ddf), -W64LIT(0x65a5c9a6bf70a7f2), -W64LIT(0x208538fdff37d5a1), -W64LIT(0x410ef67a1c025683), -W64LIT(0x18e412c63d6bd8ff), -W64LIT(0x72d5ad9c5f6008d4), -W64LIT(0x255ab9a9b41ef845), -W64LIT(0x93558305aa89356d), -W64LIT(0x70c2547671b81abc), -W64LIT(0x3604dab2084b73b3), -W64LIT(0x05df81544b292de4), -W64LIT(0xf2de4d8249bcb64f), -W64LIT(0x0bba71dd813e5309), -W64LIT(0xa368a77cd05f7066), -W64LIT(0x796fdc41de5e5bdd), -W64LIT(0xec03a18f064a5808), -W64LIT(0x085c0e42b88a4855), -W64LIT(0x274d40439ac6ea2d), -W64LIT(0x31cca20c6dba4c3f), -W64LIT(0x322add93540e5763), -W64LIT(0xb60f3aac1e97cd28), -W64LIT(0x7cb05d1595777639), -W64LIT(0xb036c4676c0afb90), -W64LIT(0x0a4bf7a896525a3d), -W64LIT(0x73242be9480c01e0), -W64LIT(0x5bfd1d560fb19c14), -W64LIT(0x7b7825abf08649b5), -W64LIT(0xb7febcd909fbc41c), -W64LIT(0x81fa666b01b0b7af), -W64LIT(0xd25b757fb68b63ee), -W64LIT(0x0d838f16f3a365b1), -W64LIT(0x6a31bf5a620bd02b), -W64LIT(0x26bcc6368daae319), -W64LIT(0x9ed60c13592a50dc), -W64LIT(0x581b62c936058748), -W64LIT(0x9cc1f5f977f242b4), -W64LIT(0x83ed9f812f68a5c7), -W64LIT(0x74ec53572dfd3e6c), -W64LIT(0xb3d0bbf855bee0cc), -W64LIT(0xacfcd1800d2407bf), -W64LIT(0x303d24797ad6450b), -W64LIT(0x7a89a3dee7ea4081), -W64LIT(0x69d7c0c55bbfcb77), -W64LIT(0x770a2cc814492530), -W64LIT(0x0f9476fcdd7b77d9), -W64LIT(0xaeeb286a23fc15d7), -W64LIT(0x2174be88e85bdc95), -W64LIT(0xde297c1c52440f6b), -W64LIT(0xd04c8c9598537186), -W64LIT(0x2ee0c8743520ab4c), -W64LIT(0x977b8424f6cc11bd), -W64LIT(0x10b81c8485e190aa), -W64LIT(0xa4a0dfc2b5ae4fea), -W64LIT(0x98eff2d82bb76664), -W64LIT(0xa8d2d6a15161236f), -W64LIT(0xd4628bb4c4165556), -W64LIT(0x682646b04cd3c243), -W64LIT(0x2d06b7eb0c94b010), -W64LIT(0x626db118da81987e), -W64LIT(0x2928b0ca50d194c0), -W64LIT(0x6df9c7e407faefa7), -W64LIT(0x1681e24ff77ca612), -W64LIT(0x4952f838a4881ed6), -W64LIT(0x76fbaabd03252c04), -W64LIT(0xc73ce8af7843dea0), -W64LIT(0xe82da6ae5a0f7cd8), -W64LIT(0xc10516640adee818), -W64LIT(0x968a0251e1a01889), -W64LIT(0x37f55cc71f277a87), -W64LIT(0xe5ae29b8a9ac1969), -W64LIT(0xcabf67b98be0bb11), -W64LIT(0xf4e7b3493b2180f7), -W64LIT(0xe9dc20db4d6375ec), -W64LIT(0x639c376dcded914a), -W64LIT(0x12afe56eab3982c2), -W64LIT(0xc2e369fb336af344), -W64LIT(0xa6b726289b765d82), -W64LIT(0x14961ba5d9a4b47a), -W64LIT(0xbc44cd0488c59715), -W64LIT(0xd3aaf30aa1e76ada), -W64LIT(0x28d936bf47bd9df4), -W64LIT(0xaf1aae1f34901ce3), -W64LIT(0x2f114e01224ca278), -W64LIT(0xe648562790180235), -W64LIT(0x24ab3fdca372f171), -W64LIT(0x52509561a057dd75), -W64LIT(0xc6cd6eda6f2fd794), -W64LIT(0xa08ed8e3e9eb6b3a), -W64LIT(0x09ad8837afe64161), -W64LIT(0xbdb54b719fa99e21), -W64LIT(0x8c79e97df213d21e), -W64LIT(0xcf60e6edc0c996f5), -W64LIT(0x5dc4e39d7d2caaac), -W64LIT(0x11499af1928d999e), -W64LIT(0x5fd31a7753f4b8c4), -W64LIT(0x01f18675176c0934), -W64LIT(0xc52b1145569bccc8), -W64LIT(0x9f278a664e4659e8), -W64LIT(0x3dbeab6f897520ba), -W64LIT(0xa2992109c7337952), -W64LIT(0x9b098d4712037d38), -W64LIT(0xc9591826b254a04d), -W64LIT(0x3b8755a4fbe81602), -W64LIT(0xbe5334eea61d857d), -W64LIT(0x51b6eafe99e3c629), -W64LIT(0x191594b32a07d1cb), -W64LIT(0x1f2c6a78589ae773), -W64LIT(0x3fa95285a7ad32d2), -W64LIT(0x5c3565e86a40a398), -W64LIT(0xb2213d8d42d2e9f8), -W64LIT(0xefe5de103ffe4354), -W64LIT(0x4ab487a79d3c058a), -W64LIT(0xcd771f07ee11849d), -W64LIT(0xbfa2b29bb1718c49), -W64LIT(0xba7d33cffa58a1ad), -W64LIT(0x6fee3e0e2922fdcf), -W64LIT(0x64544fd3a81caec6), -W64LIT(0xd9e104a237b530e7), -W64LIT(0xf32fcbf75ed0bf7b), -W64LIT(0x3e58d4f0b0c13be6), -W64LIT(0xb418c346304fdf40), -W64LIT(0xaac52f4b7fb93107), -W64LIT(0xdc3e85f67c9c1d03), -W64LIT(0xd5930dc1d37a5c62), -W64LIT(0x0639fecb729d36b8), -W64LIT(0xc0f490111db2e12c), -W64LIT(0x7ea7a4ffbbaf6451), -W64LIT(0xf6f04aa315f9929f), -W64LIT(0x6643b63986c4bcae), -W64LIT(0x6c0841911096e693), -W64LIT(0x8425e73f4a999a4b), -W64LIT(0x7133d20366d41388), -W64LIT(0x38612a3bc25c0d5e), -W64LIT(0xb99b4c50c3ecbaf1), -W64LIT(0x1d3b93927642f51b), -W64LIT(0x7f56228aacc36d65), -W64LIT(0x9d30738c609e4b80), -W64LIT(0x48a37e4db3e417e2), -W64LIT(0x8bb191c397e2ed92), -W64LIT(0x2acecf5569658f9c), -W64LIT(0xda077b3d0e012bbb), -W64LIT(0xa55159b7a2c246de), -W64LIT(0x33db5be643625e57), -W64LIT(0x821c19f43804acf3), -W64LIT(0x3990ac4ed530046a), -W64LIT(0xd675725eeace473e), -W64LIT(0x789e5a34c93252e9), -W64LIT(0x86321ed564418823), -W64LIT(0xfa8243c0f136fe1a), -W64LIT(0xe45fafcdbec0105d), -W64LIT(0x2b3f49207e0986a8), -W64LIT(0xa92350d4460d2a5b), -W64LIT(0x1eddec0d4ff6ee47), -W64LIT(0x89a66829b93afffa), -W64LIT(0x607a48f2f4598a16), -W64LIT(0x6bc0392f7567d91f), -W64LIT(0xea3a5f4474d76eb0), -W64LIT(0x5598eddfc5a6e2f9), -W64LIT(0x4c8d796cefa13332), -W64LIT(0xf701ccd602959bab), -W64LIT(0xe2665106cc5d26e5), -}; - -const word64 SHARK::Dec::cbox[8][256] = { -/* box 0 */ -W64LIT(0xe6126af05e55aff3), -W64LIT(0x4b6c893f310b0835), -W64LIT(0xaa4c0e84ebfc8d57), -W64LIT(0xfb9b5c7bf3b3090d), -W64LIT(0x4508a6a9ccba5ce2), -W64LIT(0xe5d1d2064dc6bde9), -W64LIT(0x348343755288edde), -W64LIT(0xb684505de46b250c), -W64LIT(0xa8cede205a1e91e8), -W64LIT(0x40b89b46f9fa6acc), -W64LIT(0x8ee1ec1afab080ba), -W64LIT(0xde77d6b7408e0a45), -W64LIT(0x9a3e184c2e455802), -W64LIT(0xbe93fad23f0955ef), -W64LIT(0x3ae76ce3af39b909), -W64LIT(0xad7ee3cf6f5ea7c6), -W64LIT(0x8b51d1f5cff0b694), -W64LIT(0x70ca8d8e3c43bf99), -W64LIT(0xccdba7f8b2a8f6c9), -W64LIT(0x4c5e6474b5a922a4), -W64LIT(0x5d31adcd541ccc32), -W64LIT(0x9b7f701e8c3456a7), -W64LIT(0x2ac9cd08ecfd593a), -W64LIT(0x8fa0844858c18e1f), -W64LIT(0x32f0c66c745bc9ea), -W64LIT(0xc58d6525cbbb888f), -W64LIT(0x8c633cbe4b529c05), -W64LIT(0xf2cd9ea68aa0774b), -W64LIT(0x2cba4811ca2e7d0e), -W64LIT(0xe2e33f4dc9649778), -W64LIT(0xf4be1bbfac73537f), -W64LIT(0x22de6787379f29d9), -W64LIT(0x0956c2dd79137e46), -W64LIT(0xe061efe978868bc7), -W64LIT(0x1cc85ed90f97a85b), -W64LIT(0x31337e9a67c8dbf0), -W64LIT(0x360193d1e36af161), -W64LIT(0x7fefca4a6383e5eb), -W64LIT(0x8535fe633241e243), -W64LIT(0xc3fee03ced68acbb), -W64LIT(0x81c4abdea570dac8), -W64LIT(0x67d6c12efb25753b), -W64LIT(0xa4282112164dd980), -W64LIT(0xcf181f0ea13be4d3), -W64LIT(0xa98fb672f86f9f4d), -W64LIT(0x5c70c59ff66dc297), -W64LIT(0xb0f7d544c2b80138), -W64LIT(0x0da79760ee2246cd), -W64LIT(0x3740fb83411bffc4), -W64LIT(0x24ade29e114c0ded), -W64LIT(0xf858e48de0201b17), -W64LIT(0x0e642f96fdb154d7), -W64LIT(0xddb46e41531d185f), -W64LIT(0x25ec8accb33d0348), -W64LIT(0x0282d0a4b1e21cbf), -W64LIT(0x1bfab3928b3582ca), -W64LIT(0xaffc336bdebcbb79), -W64LIT(0x35c22b27f0f9e37b), -W64LIT(0x03c3b8f61393121a), -W64LIT(0xb8e07fcb19da71db), -W64LIT(0x99fda0ba3dd64a18), -W64LIT(0xce59775c034aea76), -W64LIT(0x49ee599b80e9148a), -W64LIT(0xfe2b6194c6f33f23), -W64LIT(0x4edcb4d0044b3e1b), -W64LIT(0xd5a3c4ce887f68bc), -W64LIT(0xdf36bee5e2ff04e0), -W64LIT(0x171c4ca0c766caa2), -W64LIT(0x0bd41279c8f162f9), -W64LIT(0xe490ba54efb7b34c), -W64LIT(0x5b4228d472cfe806), -W64LIT(0x5355825ba9ad98e5), -W64LIT(0x9f8e25a31b056e2c), -W64LIT(0xcd9acfaa10d9f86c), -W64LIT(0x88926903dc63a48e), -W64LIT(0xb40680f9558939b3), -W64LIT(0x239f0fd595ee277c), -W64LIT(0xec8710db34d5c3af), -W64LIT(0x87b72ec783a3fefc), -W64LIT(0x632794936c144db0), -W64LIT(0x46cb1e5fdf294ef8), -W64LIT(0x83467b7a1492c677), -W64LIT(0x9c4d9d5508967c36), -W64LIT(0xd6607c389bec7aa6), -W64LIT(0x165d24f26517c407), -W64LIT(0xc4cc0d7769ca862a), -W64LIT(0xcbe94ab3360adc58), -W64LIT(0x847496319030ece6), -W64LIT(0x7a5ff7a556c3d3c5), -W64LIT(0xc03d58cafefbbea1), -W64LIT(0x76b908971a909bad), -W64LIT(0x2f79f0e7d9bd6f14), -W64LIT(0x197863363ad79e75), -W64LIT(0xda86830ad7bf32ce), -W64LIT(0x5a034086d0bee6a3), -W64LIT(0x97998f2cc0671ecf), -W64LIT(0x552607428f7ebcd1), -W64LIT(0x51d752ff184f845a), -W64LIT(0xbb23c73d0a4963c1), -W64LIT(0x2b88a55a4e8c579f), -W64LIT(0xd80453ae665d2e71), -W64LIT(0xee05c07f8537df10), -W64LIT(0x423a4be248187673), -W64LIT(0xcaa822e1947bd2fd), -W64LIT(0x1abbdbc029448c6f), -W64LIT(0x96d8e77e6216106a), -W64LIT(0x6266fcc1ce654315), -W64LIT(0x89d301517e12aa2b), -W64LIT(0x730935782fd0ad83), -W64LIT(0x8085c38c0701d46d), -W64LIT(0x6b303e1cb7763d53), -W64LIT(0x3f57510c9a798f27), -W64LIT(0x4449cefb6ecb5247), -W64LIT(0x48af31c922981a2f), -W64LIT(0x98bcc8e89fa744bd), -W64LIT(0x69b2eeb8069421ec), -W64LIT(0xebb5fd90b077e93e), -W64LIT(0x6a71564e150733f6), -W64LIT(0x116fc9b9e1b5ee96), -W64LIT(0x4a2de16d937a0690), -W64LIT(0xb9a11799bbab7f7e), -W64LIT(0x9368da9157562644), -W64LIT(0x718be5dc9e32b13c), -W64LIT(0xc82af2452599ce42), -W64LIT(0xb547e8abf7f83716), -W64LIT(0x33b1ae3ed62ac74f), -W64LIT(0x799c4f534550c1df), -W64LIT(0x3e16395e38088182), -W64LIT(0x7c2c72bc7010f7f1), -W64LIT(0xf38cf6f428d179ee), -W64LIT(0xd29129850cdd422d), -W64LIT(0x41f9f3145b8b6469), -W64LIT(0x945a37dad3f40cd5), -W64LIT(0x757ab061090389b7), -W64LIT(0x6554118a4ac76984), -W64LIT(0x7d6d1aeed261f954), -W64LIT(0x01416852a2710ea5), -W64LIT(0xb27505e0735a1d87), -W64LIT(0x77f860c5b8e19508), -W64LIT(0x78dd2701e721cf7a), -W64LIT(0xe12087bbdaf78562), -W64LIT(0x86f6469521d2f059), -W64LIT(0xef44a82d2746d1b5), -W64LIT(0xbc112a768eeb4950), -W64LIT(0xc2bf886e4f19a21e), -W64LIT(0x307216c8c5b9d555), -W64LIT(0xc96b9a1787e8c0e7), -W64LIT(0xa31acc5992eff311), -W64LIT(0xa0d974af817ce10b), -W64LIT(0xdcf50613f16c16fa), -W64LIT(0xfca9b1307711239c), -W64LIT(0x57a4d7e63e9ca06e), -W64LIT(0xc64eddd3d8289a95), -W64LIT(0xa25ba40b309efdb4), -W64LIT(0x2e3898b57bcc61b1), -W64LIT(0xf5ff73ed0e025dda), -W64LIT(0xa6aaf1b6a7afc53f), -W64LIT(0xd9453bfcc42c20d4), -W64LIT(0x9d0cf507aae77293), -W64LIT(0x290a75feff6e4b20), -W64LIT(0xa7eb99e405decb9a), -W64LIT(0xa1981cfd230defae), -W64LIT(0x12ac714ff226fc8c), -W64LIT(0x743bd833ab728712), -W64LIT(0x6c02d35733d417c2), -W64LIT(0xe9372d340195f581), -W64LIT(0xf77da349bfe04165), -W64LIT(0x68f386eaa4e52f49), -W64LIT(0x211ddf71240c3bc3), -W64LIT(0x13ed191d5057f229), -W64LIT(0xe8764566a3e4fb24), -W64LIT(0xf9198cdf425115b2), -W64LIT(0xd013f921bd3f5e92), -W64LIT(0x91ea0a35e6b43afb), -W64LIT(0x0732ed4b84a22a91), -W64LIT(0xeaf495c21206e79b), -W64LIT(0x5214ea090bdc9640), -W64LIT(0x0000000000000000), -W64LIT(0xb3346db2d12b1322), -W64LIT(0x0ce6ff324c534868), -W64LIT(0xaebd5b397ccdb5dc), -W64LIT(0x0a957a2b6a806c5c), -W64LIT(0x1f0be62f1c04ba41), -W64LIT(0x14dff456d4f5d8b8), -W64LIT(0x58819022615cfa1c), -W64LIT(0x05b03def3540362e), -W64LIT(0xe3a2571f6b1599dd), -W64LIT(0x9229b2c3f52728e1), -W64LIT(0xba62af6fa8386d64), -W64LIT(0x0673851926d32434), -W64LIT(0x641579d8e8b66721), -W64LIT(0x04f155bd9731388b), -W64LIT(0x9ecf4df1b9746089), -W64LIT(0x205cb723867d3566), -W64LIT(0x102ea1eb43c4e033), -W64LIT(0x3ba604b10d48b7ac), -W64LIT(0x50963aadba3e8aff), -W64LIT(0xac3f8b9dcd2fa963), -W64LIT(0x7b1e9ff7f4b2dd60), -W64LIT(0xf63ccb1b1d914fc0), -W64LIT(0x7eaea218c1f2eb4e), -W64LIT(0x5fb37d69e5fed08d), -W64LIT(0x56e5bfb49cedaecb), -W64LIT(0x2dfb2043685f73ab), -W64LIT(0x61a54437ddf6510f), -W64LIT(0x6fc16ba1204705d8), -W64LIT(0xe75302a2fc24a156), -W64LIT(0x3dd581a82b9b9398), -W64LIT(0xdbc7eb5875ce3c6b), -W64LIT(0x90ab626744c5345e), -W64LIT(0x59c0f870c32df4b9), -W64LIT(0x6697a97c59547b9e), -W64LIT(0xfde8d962d5602d39), -W64LIT(0xd3d041d7aeac4c88), -W64LIT(0x5ef2153b478fde28), -W64LIT(0xd4e2ac9c2a0e6619), -W64LIT(0x1e4a8e7dbe75b4e4), -W64LIT(0x72485d2a8da1a326), -W64LIT(0x437b23b0ea6978d6), -W64LIT(0x159e9c047684d61d), -W64LIT(0x0f2547c45fc05a72), -W64LIT(0xf10e265099336551), -W64LIT(0x3c94e9fa89ea9d3d), -W64LIT(0xbfd292809d785b4a), -W64LIT(0x0817aa8fdb6270e3), -W64LIT(0x60e42c657f875faa), -W64LIT(0x18390b6498a690d0), -W64LIT(0x478a760d7d58405d), -W64LIT(0x284b1dac5d1f4585), -W64LIT(0xb1b6bd1660c90f9d), -W64LIT(0xd15291731f4e5037), -W64LIT(0x4d1f0c2617d82c01), -W64LIT(0xc70fb5817a599430), -W64LIT(0x6d43bb0591a51967), -W64LIT(0x6e8003f382360b7d), -W64LIT(0x1d89368bade6a6fe), -W64LIT(0x4f9ddc82a63a30be), -W64LIT(0xedc6788996a4cd0a), -W64LIT(0xab0d66d6498d83f2), -W64LIT(0x54676f102d0fb274), -W64LIT(0xc17c30985c8ab004), -W64LIT(0x3865bc471edba5b6), -W64LIT(0x3924d415bcaaab13), -W64LIT(0x951b5f8871850270), -W64LIT(0x8a10b9a76d81b831), -W64LIT(0xbd5042242c9a47f5), -W64LIT(0xa5694940b43cd725), -W64LIT(0xff6a09c664823186), -W64LIT(0x8d2254ece92392a0), -W64LIT(0xb7c5380f461a2ba9), -W64LIT(0x82071328b6e3c8d2), -W64LIT(0xd721146a399d7403), -W64LIT(0xfada342951c207a8), -W64LIT(0x262f323aa0ae1152), -W64LIT(0xf04f4e023b426bf4), -W64LIT(0x276e5a6802df1ff7), -/* box 1 */ -W64LIT(0x3b4016dbfd16e203), -W64LIT(0x9a7574c51174530a), -W64LIT(0x90012e69c02ec8d3), -W64LIT(0xf44580e3d780e076), -W64LIT(0xf81dec2b49eca14b), -W64LIT(0x26cae3e8a6e3d7ef), -W64LIT(0x0962419e0c41f6ab), -W64LIT(0x54d1eb4070ebd951), -W64LIT(0x865e884b0188eec8), -W64LIT(0xdf76067ea406fe8a), -W64LIT(0x29849412e594fba0), -W64LIT(0x461569896869c0f2), -W64LIT(0xb5ddd6b3bbd6724e), -W64LIT(0x0c586cc89e6c413d), -W64LIT(0x6b0ad97054d904ea), -W64LIT(0xa135621eec62b109), -W64LIT(0x0eef7e47087ea461), -W64LIT(0xfaaafea4dffe4417), -W64LIT(0xe0ad344e80342331), -W64LIT(0xab4138b23d382ad0), -W64LIT(0x107390468e90fcff), -W64LIT(0xbe0885a2218561b9), -W64LIT(0xdbed22957d22c132), -W64LIT(0x2251c7037fc7e857), -W64LIT(0x33835ef8ba5e9c86), -W64LIT(0xb3f1e0d7f4e0a8aa), -W64LIT(0x3fdb32302432ddbb), -W64LIT(0xa719547aa3546bed), -W64LIT(0xe10c3df3cb3dab1f), -W64LIT(0x17feaf9f8aafae35), -W64LIT(0x9df84b1c154b01c0), -W64LIT(0x8364a51d93a5595e), -W64LIT(0x535cd49974d48b9b), -W64LIT(0x01a109bd4b09882e), -W64LIT(0xc4d0c529b0c51182), -W64LIT(0x2e09abcbe1aba96a), -W64LIT(0x1f3de7bccde7d0b0), -W64LIT(0x9317355b1d35a5a1), -W64LIT(0x6c87e6a950e65620), -W64LIT(0x8910ffb142ffc287), -W64LIT(0x40395fed275f1a16), -W64LIT(0x7b794936da49f815), -W64LIT(0xf269b68798b63a92), -W64LIT(0xfd27c17ddbc116dd), -W64LIT(0x8d8bdb5a9bdbfd3f), -W64LIT(0x1ba6c35714c3ef08), -W64LIT(0x6e30f426c6f4b37c), -W64LIT(0x7fe26ddd036dc7ad), -W64LIT(0x14e8b4ad57b4c347), -W64LIT(0xb985ba7b25ba3373), -W64LIT(0xe9cf75d08c75d59a), -W64LIT(0x626898ee5898f241), -W64LIT(0x5b9f9cba339cf51e), -W64LIT(0xb250e96abfe92084), -W64LIT(0x165fa622c1a6261b), -W64LIT(0xf5e4895e9c896858), -W64LIT(0xb76ac43c2dc49712), -W64LIT(0x02b7128f9612e55c), -W64LIT(0x1d8af5335bf535ec), -W64LIT(0x36b973ae28732b10), -W64LIT(0xa8572380e02347a2), -W64LIT(0xf6f2926c4192052a), -W64LIT(0x8c2ad2e7d0d27511), -W64LIT(0xd32e6ab63a6abfb7), -W64LIT(0xbd1e9e90fc9e0ccb), -W64LIT(0x03161b32dd1b6d72), -W64LIT(0x4dc03a98f23ad305), -W64LIT(0x81d3b79205b7bc02), -W64LIT(0x450372bbb572ad80), -W64LIT(0x2d1fb0f93cb0c418), -W64LIT(0x2a928f20388f96d2), -W64LIT(0x721b08a8d6080ebe), -W64LIT(0x92b63ce6563c2d8f), -W64LIT(0xeb78675f1a6730c6), -W64LIT(0x13658b74538b918d), -W64LIT(0x428e4d62b14dff4a), -W64LIT(0x88b1f60c09f64aa9), -W64LIT(0x75963771d2375c74), -W64LIT(0x7ad8408b9140703b), -W64LIT(0x57c7f072adf0b423), -W64LIT(0xe5971918121994a7), -W64LIT(0x5666f9cfe6f93c0d), -W64LIT(0x8f3cc9d50dc91863), -W64LIT(0x1e9cee0186ee589e), -W64LIT(0x8a06e4839fe4aff5), -W64LIT(0xb824b3c66eb3bb5d), -W64LIT(0xd1997839ac785aeb), -W64LIT(0x6752b5b8cab545d7), -W64LIT(0xb47cdf0ef0dffa60), -W64LIT(0x949a0a82190af76b), -W64LIT(0xc04be1c269e12e3a), -W64LIT(0xfc86c8c090c89ef3), -W64LIT(0xe3bb2f7c5d2f4e43), -W64LIT(0x6aabd0cd1fd08cc4), -W64LIT(0x2147dc31a2dc8525), -W64LIT(0xca3fbb6eb8bbb5e3), -W64LIT(0x48fa17ce60176493), -W64LIT(0x6444ae8a17ae28a5), -W64LIT(0x2b33869d73861efc), -W64LIT(0xd0387184e771d2c5), -W64LIT(0x7cf476efde76aadf), -W64LIT(0x63c9915313917a6f), -W64LIT(0xc929a05c65a0d891), -W64LIT(0xda4c2b28362b491c), -W64LIT(0xfe31da4f06da7baf), -W64LIT(0xc1eae87f22e8a614), -W64LIT(0x5c12a36337a3a7d4), -W64LIT(0x18b0d865c9d8827a), -W64LIT(0xe7200b97840b71fb), -W64LIT(0x4bec0cfcbd0c09e1), -W64LIT(0x0f4e77fa43772c4f), -W64LIT(0x4c613325b9335b2b), -W64LIT(0xf3c8bf3ad3bfb2bc), -W64LIT(0x87ff81f64a8166e6), -W64LIT(0xa38270917a705455), -W64LIT(0x1911d1d882d10a54), -W64LIT(0x44a27b06fe7b25ae), -W64LIT(0x049b24ebd9243fb8), -W64LIT(0xbb32a8f4b3a8d62f), -W64LIT(0x91a027d48b2740fd), -W64LIT(0x3d6c20bfb22038e7), -W64LIT(0xe681022acf02f9d5), -W64LIT(0xf17fadb545ad57e0), -W64LIT(0xcc138d0af78d6f07), -W64LIT(0x495b1e732b1eecbd), -W64LIT(0x38560de9200d8f71), -W64LIT(0xa9f62a3dab2acf8c), -W64LIT(0x47b46034236048dc), -W64LIT(0x8e9dc06846c0904d), -W64LIT(0xaccc076b3907781a), -W64LIT(0x32225745f15714a8), -W64LIT(0xd4a3556f3e55ed7d), -W64LIT(0xd7b54e5de34e800f), -W64LIT(0xddc114f132141bd6), -W64LIT(0x6d26ef141befde0e), -W64LIT(0x85489379dc9383ba), -W64LIT(0x0bd553119a5313f7), -W64LIT(0x786f520407529567), -W64LIT(0xcb9eb2d3f3b23dcd), -W64LIT(0xa223792c3179dc7b), -W64LIT(0x0a745aacd15a9bd9), -W64LIT(0x710d139a0b1363cc), -W64LIT(0x681cc24289c26998), -W64LIT(0x1a07caea5fca6726), -W64LIT(0x82c5aca0d8acd170), -W64LIT(0x25dcf8da7bf8ba9d), -W64LIT(0xc7c6de1b6dde7cf0), -W64LIT(0xc35dfaf0b4fa4348), -W64LIT(0xded70fc3ef0f76a4), -W64LIT(0x504acfaba9cfe6e9), -W64LIT(0xc571cc94fbcc99ac), -W64LIT(0x5ea5b1eca1b14288), -W64LIT(0xae7b15e4af159d46), -W64LIT(0xc888a9e12ea950bf), -W64LIT(0xf7539bd10a9b8d04), -W64LIT(0x962d180d8f181237), -W64LIT(0xe43610a559101c89), -W64LIT(0x772125fe4425b928), -W64LIT(0x84e99ac4979a0b94), -W64LIT(0xc667d7a626d7f4de), -W64LIT(0xefe343b4c3430f7e), -W64LIT(0xd5025cd2755c6553), -W64LIT(0xa6b85dc7e85de3c3), -W64LIT(0xd61447e0a8470821), -W64LIT(0x3e7a3b8d6f3b5595), -W64LIT(0x52fddd243fdd03b5), -W64LIT(0x8072be2f4ebe342c), -W64LIT(0x12c482c9188219a3), -W64LIT(0x9eee502ec8506cb2), -W64LIT(0xad6d0ed6720ef034), -W64LIT(0x59288e35a58e1042), -W64LIT(0xe21a26c11626c66d), -W64LIT(0x247df16730f132b3), -W64LIT(0xf0dea4080ea4dfce), -W64LIT(0x31344c772c4c79da), -W64LIT(0x4f77281764283659), -W64LIT(0x79ce5bb94c5b1d49), -W64LIT(0x0000000000000000), -W64LIT(0x73ba01159d018690), -W64LIT(0x74373ecc993ed45a), -W64LIT(0xbcbf972db79784e5), -W64LIT(0x4ed621aa2f21be77), -W64LIT(0xd95a301aeb30246e), -W64LIT(0x9c5942a15e4289ee), -W64LIT(0x37187a13637aa33e), -W64LIT(0x276bea55edea5fc1), -W64LIT(0x1c2bfc8e10fcbdc2), -W64LIT(0xed54513b5551ea22), -W64LIT(0x20e6d58ce9d50d0b), -W64LIT(0x3ae11f66b61f6a2d), -W64LIT(0x66f3bc0581bccdf9), -W64LIT(0x2cbeb94477b94c36), -W64LIT(0x99636ff7cc6f3e78), -W64LIT(0x953b033f52037f45), -W64LIT(0xb0e7fbe529fbc5d8), -W64LIT(0x60df8a61ce8a171d), -W64LIT(0x6f91fd9b8dfd3b52), -W64LIT(0xaae0310f7631a2fe), -W64LIT(0xbfa98c1f6a8ce997), -W64LIT(0x8ba7ed3ed4ed27db), -W64LIT(0x98c2664a8766b656), -W64LIT(0x062c36644f36dae4), -W64LIT(0x5570e2fd3be2517f), -W64LIT(0xead96ee2516eb8e8), -W64LIT(0x419856506c569238), -W64LIT(0x23f0cebe34ce6079), -W64LIT(0x309545ca6745f1f4), -W64LIT(0x5a3e950778957d30), -W64LIT(0x617e83dc85839f33), -W64LIT(0xfb0bf71994f7cc39), -W64LIT(0x3ccd2902f929b0c9), -W64LIT(0x70ac1a27401aebe2), -W64LIT(0xcea49f85619f8a5b), -W64LIT(0x39f704546b04075f), -W64LIT(0x0df96575d565c913), -W64LIT(0x08c3482347487e85), -W64LIT(0xd28f630b71633799), -W64LIT(0xecf558861e58620c), -W64LIT(0xc2fcf34dfff3cb66), -W64LIT(0x978c11b0c4119a19), -W64LIT(0x69bdcbffc2cbe1b6), -W64LIT(0xba93a149f8a15e01), -W64LIT(0x51ebc616e2c66ec7), -W64LIT(0x078d3fd9043f52ca), -W64LIT(0x58898788ee87986c), -W64LIT(0x4a4d0541f60581cf), -W64LIT(0xe86e7c6dc77c5db4), -W64LIT(0xee424a09884a8750), -W64LIT(0xcdb284b7bc84e729), -W64LIT(0x65e5a7375ca7a08b), -W64LIT(0x2fa8a276aaa22144), -W64LIT(0xa0946ba3a76b3927), -W64LIT(0xa5ae46f535468eb1), -W64LIT(0x35af689cf5684662), -W64LIT(0x28259dafae9d738e), -W64LIT(0xcf0596382a960275), -W64LIT(0xb6cbcd8166cd1f3c), -W64LIT(0x7e43646048644f83), -W64LIT(0x9bd47d785a7ddb24), -W64LIT(0x432f44dffa447764), -W64LIT(0x9f4f59938359e49c), -W64LIT(0x7d557f52957f22f1), -W64LIT(0x76802c430f2c3106), -W64LIT(0xdc601d4c791d93f8), -W64LIT(0x053a2d56922db796), -W64LIT(0x11d299fbc59974d1), -W64LIT(0xf9bce59602e52965), -W64LIT(0xd8fb39a7a039ac40), -W64LIT(0x340e6121be61ce4c), -W64LIT(0x5f04b851eab8caa6), -W64LIT(0x5db3aade7caa2ffa), -W64LIT(0x1549bd101cbd4b69), -W64LIT(0xff90d3f24dd3f381), -W64LIT(0xafda1c59e41c1568), -W64LIT(0xb146f25862f24df6), -W64LIT(0xa40f4f487e4f069f), -/* box 2 */ -W64LIT(0xa1a35cebf8f0f94c), -W64LIT(0x2c203d650f3f095d), -W64LIT(0x1a2bdaee4084a2a7), -W64LIT(0xd32404574d7bcc68), -W64LIT(0xf785bea594a9adc4), -W64LIT(0xf2eb54456206949c), -W64LIT(0x3f5e334d0475ced1), -W64LIT(0x5994299b835d1f60), -W64LIT(0x785b7989ac204794), -W64LIT(0x025da6a2cf461a41), -W64LIT(0xdf1f3a71f01a901b), -W64LIT(0x27284f018bb77637), -W64LIT(0xe1955a6d694c5310), -W64LIT(0x24a1baf2d9d261ac), -W64LIT(0xe4fbb08d9fe36a48), -W64LIT(0x8d83618ef7cff011), -W64LIT(0x2ac72276abf5279e), -W64LIT(0xf9e32621e68eebf6), -W64LIT(0xbf323fb4d3f86f69), -W64LIT(0xbb888605b8745beb), -W64LIT(0x70dafe1e7acd2f65), -W64LIT(0xd0adf1a41f1edbf3), -W64LIT(0x1e91635f2b089625), -W64LIT(0xee2791b8864818f8), -W64LIT(0x99ce23e4c56c1484), -W64LIT(0xf33f0714ff259946), -W64LIT(0xbd6f99161cbe7528), -W64LIT(0x9f293cf761a63a47), -W64LIT(0xb80173f6ea114c70), -W64LIT(0x6543ef25d54dc62a), -W64LIT(0x39b92c5ea0bfe012), -W64LIT(0x63a4f0367187e8e9), -W64LIT(0x4c0d38a02cddf62f), -W64LIT(0x07334c4239e92319), -W64LIT(0x43bff375c3d9bdc7), -W64LIT(0xca862b4a5f9a7954), -W64LIT(0x5d2e902ae8d12be2), -W64LIT(0x137e0e280b4ac78c), -W64LIT(0xf162a1b630638307), -W64LIT(0x55af17bd3e3c4313), -W64LIT(0x358212781ddebc61), -W64LIT(0x94214e93e52e452d), -W64LIT(0xc18e592edb12063e), -W64LIT(0xec7a371a490e02b9), -W64LIT(0x4963d240da72cf77), -W64LIT(0x41e255d70c9fa786), -W64LIT(0xff0439324244c535), -W64LIT(0x88ed8b6e0160c949), -W64LIT(0x6c163be39e83a301), -W64LIT(0xc534e09fb09e32bc), -W64LIT(0x806c0cf9d78da1b8), -W64LIT(0xdba583c09b96a499), -W64LIT(0x746047af11411be7), -W64LIT(0xf40c4b56c6ccba5f), -W64LIT(0x6270a367eca4e533), -W64LIT(0xd41748157492ef71), -W64LIT(0xeff3c2e91b6b1522), -W64LIT(0x0e66988472274632), -W64LIT(0x534808ae9af66dd0), -W64LIT(0x8231aa5b18cbbbf9), -W64LIT(0xb2dd52c3f3ba3ec0), -W64LIT(0xdd429cd33f5c8a5a), -W64LIT(0x4e509e02e39bec6e), -W64LIT(0x26fc1c5016947bed), -W64LIT(0xd9f8256254d0bed8), -W64LIT(0x0955d4c64bce652b), -W64LIT(0x1610e4c8fde5fed4), -W64LIT(0x6dc268b203a0aedb), -W64LIT(0x2e7d9bc7c079131c), -W64LIT(0xc3d3ff8c14541c7f), -W64LIT(0xd64aeeb7bbd4f530), -W64LIT(0xab7f7ddee15b8bfc), -W64LIT(0x144d426a32a3e495), -W64LIT(0x8e0a947da5aae78a), -W64LIT(0x798f2ad831034a4e), -W64LIT(0x3be48afc6ff9fa53), -W64LIT(0x529c5bff07d5600a), -W64LIT(0xbee66ce54edb62b3), -W64LIT(0x931202d1dcc76634), -W64LIT(0x50c1fd5dc8937a4b), -W64LIT(0xa4cdb60b0e5fc014), -W64LIT(0x57f2b11ff17a5952), -W64LIT(0x47054ac4a8558945), -W64LIT(0x5a1ddc68d13808fb), -W64LIT(0x5cfac37b75f22638), -W64LIT(0xc207acdd897711a5), -W64LIT(0x289a84d464b33ddf), -W64LIT(0xc05a0a7f46310be4), -W64LIT(0xe6a6162f50a57009), -W64LIT(0x06e71f13a4ca2ec3), -W64LIT(0x5f733688279731a3), -W64LIT(0xeb497b5870e721a0), -W64LIT(0xb667eb7298360a42), -W64LIT(0xe3c8fccfa60a4951), -W64LIT(0xe772457ecd867dd3), -W64LIT(0x6978d103682c9a59), -W64LIT(0x0def6d77204251a9), -W64LIT(0xc90fdeb90dff6ecf), -W64LIT(0xd179a2f5823dd629), -W64LIT(0x2fa9c8965d5a1ec6), -W64LIT(0x81b85fa84aaeac62), -W64LIT(0xdc96cf82a27f8780), -W64LIT(0x602d05c523e2ff72), -W64LIT(0x19a22f1d12e1b53c), -W64LIT(0xe52fe3dc02c06792), -W64LIT(0x58407aca1e7e12ba), -W64LIT(0x61f95694bec1f2a8), -W64LIT(0x48b781114751c2ad), -W64LIT(0xaaab2e8f7c788626), -W64LIT(0x04bab9b16b8c3482), -W64LIT(0x2df46e34921c0487), -W64LIT(0x1123a88ac40cddcd), -W64LIT(0xc6bd156ce2fb2527), -W64LIT(0x7f6835cb95c9648d), -W64LIT(0x83e5f90a85e8b623), -W64LIT(0x4f84cd537eb8e1b4), -W64LIT(0x294ed785f9903005), -W64LIT(0x1cccc5fde44e8c64), -W64LIT(0xcb52781bc2b9748e), -W64LIT(0x1d1896ac796d81be), -W64LIT(0xb30901926e99331a), -W64LIT(0xad9862cd4591a53f), -W64LIT(0xc8db8de890dc6315), -W64LIT(0x7bd28c7afe45500f), -W64LIT(0x0adc213519ab72b0), -W64LIT(0xa8f6882db33e9c67), -W64LIT(0xb5ee1e81ca531dd9), -W64LIT(0x201b0343b25e552e), -W64LIT(0x4036068691bcaa5c), -W64LIT(0xae11973e17f4b2a4), -W64LIT(0x9efd6fa6fc85379d), -W64LIT(0x33650d6bb91492a2), -W64LIT(0x3a30d9adf2daf789), -W64LIT(0x0c3b3e26bd615c73), -W64LIT(0xf651edf4098aa01e), -W64LIT(0x710ead4fe7ee22bf), -W64LIT(0x3138abc9765288e3), -W64LIT(0x9d749a55aee02006), -W64LIT(0x6e4b9d4151c5b940), -W64LIT(0x84d6b548bc01953a), -W64LIT(0x360be78b4fbbabfa), -W64LIT(0xa22aa918aa95eed7), -W64LIT(0xedae644bd42d0f63), -W64LIT(0x46d119953576849f), -W64LIT(0x6497bc74486ecbf0), -W64LIT(0xfbbe808329c8f1b7), -W64LIT(0x4aea27b38817d8ec), -W64LIT(0x5626e24e6c595488), -W64LIT(0x056eeae0f6af3958), -W64LIT(0x4558ec6667139304), -W64LIT(0x448cbf37fa309ede), -W64LIT(0x6f9fce10cce6b49a), -W64LIT(0xa0770fba65d3f496), -W64LIT(0x671e49871a0bdc6b), -W64LIT(0xda71d09106b5a943), -W64LIT(0x08818797d6ed68f1), -W64LIT(0xa3fefa4937b6e30d), -W64LIT(0xb080f4613cfc2481), -W64LIT(0x763de10dde0701a6), -W64LIT(0x4dd96bf1b1fefbf5), -W64LIT(0x92c6518041e46bee), -W64LIT(0x3456412980fdb1bb), -W64LIT(0x981a70b5584f195e), -W64LIT(0x3d0395efcb33d490), -W64LIT(0xba5cd55425575631), -W64LIT(0x4b3e74e21534d536), -W64LIT(0x6af124f03a498dc2), -W64LIT(0x7ebc669a08ea6957), -W64LIT(0x30ecf898eb718539), -W64LIT(0xa922db7c2e1d91bd), -W64LIT(0x7a06df2b63665dd5), -W64LIT(0xb154a730a1df295b), -W64LIT(0xfc8dccc11021d2ae), -W64LIT(0xcfe8c1aaa935400c), -W64LIT(0x97a8bb60b74b52b6), -W64LIT(0x18767c4c8fc2b8e6), -W64LIT(0x9a47d6179709031f), -W64LIT(0x0000000000000000), -W64LIT(0xac4c319cd8b2a8e5), -W64LIT(0xb9d520a7773241aa), -W64LIT(0xdecb69206d399dc1), -W64LIT(0x1f45300eb62b9bff), -W64LIT(0x10f7fbdb592fd017), -W64LIT(0x3e8a601c9956c30b), -W64LIT(0x8502e619212298e0), -W64LIT(0xf5d818075befb785), -W64LIT(0x547b44eca31f4ec9), -W64LIT(0x9ca0c90433c32ddc), -W64LIT(0xe041093cf46f5eca), -W64LIT(0xa69010a9c119da55), -W64LIT(0xc769463d7fd828fd), -W64LIT(0xc4e0b3ce2dbd3f66), -W64LIT(0x2575e9a344f16c76), -W64LIT(0x01d453519d230dda), -W64LIT(0xfa6ad3d2b4ebfc6d), -W64LIT(0xd5c31b44e9b1e2ab), -W64LIT(0xf83775707bade62c), -W64LIT(0xbcbbca47819d78f2), -W64LIT(0xd79ebde626f7f8ea), -W64LIT(0x5bc98f394c1b0521), -W64LIT(0x2246a5e17d184f6f), -W64LIT(0x12aa5d799669ca56), -W64LIT(0x5ea765d9bab43c79), -W64LIT(0x8939d83f9c43c493), -W64LIT(0x32b15e3a24379f78), -W64LIT(0xe914ddfabfa13be1), -W64LIT(0x909bf7228ea271af), -W64LIT(0x73530bed28a838fe), -W64LIT(0xd2f05706d058c1b2), -W64LIT(0xfed06a63df67c8ef), -W64LIT(0xb43a4dd057701003), -W64LIT(0xa519e55a937ccdce), -W64LIT(0x75b414fe8c62163d), -W64LIT(0xafc5c46f8ad7bf7e), -W64LIT(0x2392f6b0e03b42b5), -W64LIT(0x386d7f0f3d9cedc8), -W64LIT(0x21cf50122f7d58f4), -W64LIT(0x9b9385460a2a0ec5), -W64LIT(0x5115ae0c55b07791), -W64LIT(0x0fb2cbd5ef044be8), -W64LIT(0xea9d2809edc42c7a), -W64LIT(0xcc613459fb505797), -W64LIT(0x426ba0245efab01d), -W64LIT(0x1599113baf80e94f), -W64LIT(0x7d3593695a8f7ecc), -W64LIT(0x0389f5f35265179b), -W64LIT(0x875f40bbee6482a1), -W64LIT(0x95f51dc2780d48f7), -W64LIT(0x7ce1c038c7ac7316), -W64LIT(0xce3c92fb34164dd6), -W64LIT(0xcdb5670866735a4d), -W64LIT(0x8ab02dccce26d308), -W64LIT(0x914fa47313817c75), -W64LIT(0x8b647e9d5305ded2), -W64LIT(0xd82c7633c9f3b302), -W64LIT(0x728758bcb58b3524), -W64LIT(0xe8c08eab2282363b), -W64LIT(0x8fdec72c3889ea50), -W64LIT(0x2b13712736d62a44), -W64LIT(0x3cd7c6be5610d94a), -W64LIT(0x37dfb4dad298a620), -W64LIT(0x868b13ea73478f7b), -W64LIT(0xb7b3b82305150798), -W64LIT(0x0b08726484887f6a), -W64LIT(0x1bff89bfdda7af7d), -W64LIT(0x77e9b25c43240c7c), -W64LIT(0xf0b6f2e7ad408edd), -W64LIT(0x17c4b79960c6f30e), -W64LIT(0x8c5732df6aecfdcb), -W64LIT(0x68ac8252f50f9783), -W64LIT(0x66ca1ad68728d1b1), -W64LIT(0x6b2577a1a76a8018), -W64LIT(0xe21caf9e3b29448b), -W64LIT(0xa74443f85c3ad78f), -W64LIT(0xfd599f908d02df74), -W64LIT(0x967ce8312a685f6c), -/* box 3 */ -W64LIT(0xfa7b9775ba3af751), -W64LIT(0x03ef98cb769c2d13), -W64LIT(0x7191ce067072359e), -W64LIT(0xbab18b6bff7516a8), -W64LIT(0xe6e5ef4efbc1065e), -W64LIT(0x7bec74a3b1d0dbf4), -W64LIT(0x656b4fb907c31c4a), -W64LIT(0x4e8520f99fc86304), -W64LIT(0x8fd8df31d16dae58), -W64LIT(0x90a93fc1e60a7244), -W64LIT(0x30ad09f2b449cfc5), -W64LIT(0x8453be7e91bb5b90), -W64LIT(0x1d68a3d1c08feaad), -W64LIT(0x5c54642504b410f6), -W64LIT(0x8061383c8a9e3707), -W64LIT(0xf9940fbecca6da42), -W64LIT(0x46e1d97da982bbdf), -W64LIT(0xfc50521656f7ad77), -W64LIT(0x5e4d2704f35c2647), -W64LIT(0x8bea5973ca48c2cf), -W64LIT(0xd06323dfa34593bd), -W64LIT(0x62b651306a7a5dce), -W64LIT(0xa436b0714966d116), -W64LIT(0x4f73fb131ebc78a6), -W64LIT(0x92b07ce011e244f5), -W64LIT(0x33429139c2d5e2d6), -W64LIT(0xcee418c515565403), -W64LIT(0xd7be3d56cefcd239), -W64LIT(0x53ed83285f4789a9), -W64LIT(0xf3e9b51b0d043428), -W64LIT(0x20650e0fd8dd8a86), -W64LIT(0xb6e7f4add21aa2e4), -W64LIT(0x6d0fb63d3189c491), -W64LIT(0x0da0a42cac1bafee), -W64LIT(0x3f14eeffefba569a), -W64LIT(0x13279f361a086850), -W64LIT(0x9b225e8ea6dc878c), -W64LIT(0x6684d772715f3159), -W64LIT(0xa3ebaef824df9092), -W64LIT(0xc499a260d4f4ba69), -W64LIT(0xaa798c9693e153eb), -W64LIT(0x50021be329dba4ba), -W64LIT(0x949bb983fd2f1ed3), -W64LIT(0xdfdac4d2f8b60ae2), -W64LIT(0xf0062dd07b98193b), -W64LIT(0xafbdd13e09b024de), -W64LIT(0xb95e13a089e93bbb), -W64LIT(0x649d945386b707e8), -W64LIT(0xe4fcac6f0c2930ef), -W64LIT(0x413cc7f4c43bfa5b), -W64LIT(0x3b2668bdf49f3a0d), -W64LIT(0xe50a77858d5d2b4d), -W64LIT(0x05c45da89a517735), -W64LIT(0x3ee235156ece4d38), -W64LIT(0xfe491137a11f9bc6), -W64LIT(0xb7112f47536eb946), -W64LIT(0x07dd1e896db94184), -W64LIT(0x1ab5bd58ad36ab29), -W64LIT(0x8197e3d60bea2ca5), -W64LIT(0xab8f577c12954849), -W64LIT(0x9cff4007cb65c608), -W64LIT(0xa00436335243bd81), -W64LIT(0xfda689fcd783b6d5), -W64LIT(0xccfd5be4e2be62b2), -W64LIT(0x75a348446b575909), -W64LIT(0x17151974012d04c7), -W64LIT(0xfb8d4c9f3b4eecf3), -W64LIT(0xac5249f57f2c09cd), -W64LIT(0x9346a70a90965f57), -W64LIT(0x043286421b256c97), -W64LIT(0x27b81086b564cb02), -W64LIT(0x3569545a2e18b8f0), -W64LIT(0x6b24735edd449eb7), -W64LIT(0x2193d5e559a99124), -W64LIT(0xc7763aaba268977a), -W64LIT(0xb0cc31ce3ed7f8c2), -W64LIT(0xc939064c78ef1587), -W64LIT(0x16e3c29e80591f65), -W64LIT(0x5da2bfcf85c00b54), -W64LIT(0x5990398d9ee567c3), -W64LIT(0x67720c98f02b2afb), -W64LIT(0x54309da132fec82d), -W64LIT(0xeab39088d6aeb212), -W64LIT(0x9682faa20ac72862), -W64LIT(0xd38cbb14d5d9beae), -W64LIT(0x4c9c63d8682055b5), -W64LIT(0xd648e6bc4f88c99b), -W64LIT(0xdc355c198e2a27f1), -W64LIT(0x10c807fd6c944543), -W64LIT(0x450e41b6df1e96cc), -W64LIT(0x0b8b614f40d6f5c8), -W64LIT(0xd27a60fe54ada50c), -W64LIT(0x49583e70f2712280), -W64LIT(0x8dc19c10268598e9), -W64LIT(0x5866e2671f917c61), -W64LIT(0x79f537824638ed45), -W64LIT(0xc2b267033839e04f), -W64LIT(0xcb20456d8f072336), -W64LIT(0x2a18b4aa197f64ec), -W64LIT(0xdbe84290e3936675), -W64LIT(0x73888d27879a032f), -W64LIT(0xe8aad3a9214684a3), -W64LIT(0x6ee02ef64715e982), -W64LIT(0xa996145de57d7ef8), -W64LIT(0xc8cfdda6f99b0e25), -W64LIT(0x062bc563eccd5a26), -W64LIT(0x264ecb6c3410d0a0), -W64LIT(0xb8a8c84a089d2019), -W64LIT(0x7dc7b1c05d1d81d2), -W64LIT(0xd5a77e773914e488), -W64LIT(0x4b417d5105991431), -W64LIT(0xf62de8b39755431d), -W64LIT(0x993b1daf5134b13d), -W64LIT(0x82787b1d7d7601b6), -W64LIT(0xe321b2e66190716b), -W64LIT(0xb5086c66a4868ff7), -W64LIT(0x9ee603263c8df0b9), -W64LIT(0x349f8fb0af6ca352), -W64LIT(0x5b897aac690d5172), -W64LIT(0x7c316a2adc699a70), -W64LIT(0xd451a59db860ff2a), -W64LIT(0x706715ecf1062e3c), -W64LIT(0x838ea0f7fc021a14), -W64LIT(0x57df056a4462e53e), -W64LIT(0xcf12c32f94224fa1), -W64LIT(0xed6e8e01bb17f396), -W64LIT(0x915fe42b677e69e6), -W64LIT(0x89f31a523da0f47e), -W64LIT(0xe71334a47ab51dfc), -W64LIT(0xa860cfb76409655a), -W64LIT(0x9f10d8ccbdf9eb1b), -W64LIT(0xef77cd204cffc527), -W64LIT(0xf862d4544dd2c1e0), -W64LIT(0x8a1c82994b3cd96d), -W64LIT(0xae4b0ad488c43f7c), -W64LIT(0x98cdc645d040aa9f), -W64LIT(0x7fdef2e1aaf5b763), -W64LIT(0x4717029728f6a07d), -W64LIT(0x745593aeea2342ab), -W64LIT(0xee8116cacd8bde85), -W64LIT(0x727e56cd06ee188d), -W64LIT(0x227c4d2e2f35bc37), -W64LIT(0x977421488bb333c0), -W64LIT(0xa21d7512a5ab8b30), -W64LIT(0xbb4750817e010d0a), -W64LIT(0x6cf96dd7b0fddf33), -W64LIT(0x2801f78bee97525d), -W64LIT(0x1c9e783b41fbf10f), -W64LIT(0x9d099bed4a11ddaa), -W64LIT(0x7a1aaf4930a4c056), -W64LIT(0x32b44ad343a1f974), -W64LIT(0x3cfb763499267b89), -W64LIT(0xb2d572efc93fce73), -W64LIT(0x63408adaeb0e466c), -W64LIT(0xada4921ffe58126f), -W64LIT(0x5fbbfcee72283de5), -W64LIT(0x6ad2a8b45c308515), -W64LIT(0x0c567fc62d6fb44c), -W64LIT(0x956d62697c5b0571), -W64LIT(0x25a153a7428cfdb3), -W64LIT(0x150c5a55f6c53276), -W64LIT(0xe2d7690ce0e46ac9), -W64LIT(0xda1e997a62e77dd7), -W64LIT(0xf5c27078e1c96e0e), -W64LIT(0xc344bce9b94dfbed), -W64LIT(0x60af12119d926b7f), -W64LIT(0xa1f2edd9d337a623), -W64LIT(0xcad69e870e733894), -W64LIT(0x3770177bd9f08e41), -W64LIT(0xa5c06b9bc812cab4), -W64LIT(0x1f71e0f03767dc1c), -W64LIT(0x44f89a5c5e6a8d6e), -W64LIT(0x6159c9fb1ce670dd), -W64LIT(0x8e2e04db5019b5fa), -W64LIT(0x8805c1b8bcd4efdc), -W64LIT(0xe138f1c7967847da), -W64LIT(0x4ab7a6bb84ed0f93), -W64LIT(0x0000000000000000), -W64LIT(0x38c9f0768203171e), -W64LIT(0x1b4366b22c42b08b), -W64LIT(0x7803ec68c74cf6e7), -W64LIT(0xec9855eb3a63e834), -W64LIT(0xbe830d29e4507a3f), -W64LIT(0x2dc5aa2374c62568), -W64LIT(0xa62ff350be8ee7a7), -W64LIT(0x764cd08f1dcb741a), -W64LIT(0x8c3747faa7f1834b), -W64LIT(0x0fb9e70d5bf3995f), -W64LIT(0x55c6464bb38ad38f), -W64LIT(0xf7db3359162158bf), -W64LIT(0xd195f8352231881f), -W64LIT(0x0992226eb73ec379), -W64LIT(0x14fa81bf77b129d4), -W64LIT(0x48aee59a73053922), -W64LIT(0x2457884dc3f8e611), -W64LIT(0xffbfcadd206b8064), -W64LIT(0xb4feb78c25f29455), -W64LIT(0x864afd5f66536d21), -W64LIT(0x6f16f51cc661f220), -W64LIT(0xde2c1f3879c21140), -W64LIT(0x195a2593dbaa863a), -W64LIT(0x2e2a32e8025a087b), -W64LIT(0x432584d533d3ccea), -W64LIT(0x2c3371c9f5b23eca), -W64LIT(0xa7d928ba3ffafc05), -W64LIT(0x42d35f3fb2a7d748), -W64LIT(0x85a5659410cf4032), -W64LIT(0x0864f984364ad8db), -W64LIT(0xf21f6ef18c702f8a), -W64LIT(0xf1f0f63afaec0299), -W64LIT(0xd9f101b1147b50c4), -W64LIT(0x2fdce902832e13d9), -W64LIT(0x4d6ab832e9544e17), -W64LIT(0xe0ce2a2d170c5c78), -W64LIT(0x51f4c009a8afbf18), -W64LIT(0x68cbeb95abd8b3a4), -W64LIT(0xc15dffc84ea5cd5c), -W64LIT(0x02194321f7e836b1), -W64LIT(0x113edc17ede05ee1), -W64LIT(0x521b58c2de33920b), -W64LIT(0x9ad4856427a89c2e), -W64LIT(0x5629de80c516fe9c), -W64LIT(0x77ba0b659cbf6fb8), -W64LIT(0x238a96c4ae41a795), -W64LIT(0x12d144dc9b7c73f2), -W64LIT(0xd807da5b950f4b66), -W64LIT(0x3686cc91588495e3), -W64LIT(0x18acfe795ade9d98), -W64LIT(0x5a7fa146e8794ad0), -W64LIT(0xc680e141231c8cd8), -W64LIT(0x1e873b1ab613c7be), -W64LIT(0xf434ab9260bd75ac), -W64LIT(0xcd0b800e63ca7910), -W64LIT(0xbc9a4e0813b84c8e), -W64LIT(0x3d0dadde1852602b), -W64LIT(0x40ca1c1e454fe1f9), -W64LIT(0x0a7dbaa5c1a2ee6a), -W64LIT(0x693d307f2aaca806), -W64LIT(0x0e4f3ce7da8782fd), -W64LIT(0xbd6c95e292cc572c), -W64LIT(0x3ad0b35775eb21af), -W64LIT(0x7e28290b2b81acc1), -W64LIT(0x01f6dbea81741ba2), -W64LIT(0x87bc26b5e7277683), -W64LIT(0x393f2b9c03770cbc), -W64LIT(0xddc387f30f5e3c53), -W64LIT(0xeb454b6257daa9b0), -W64LIT(0xb323a905484bd5d1), -W64LIT(0xb13aea24bfa3e360), -W64LIT(0x315bd218353dd467), -W64LIT(0x2bee6f40980b7f4e), -W64LIT(0xe95c0843a0329f01), -W64LIT(0xc56f798a5580a1cb), -W64LIT(0xbf75d6c36524619d), -W64LIT(0x29f72c616fe349ff), -W64LIT(0xc0ab2422cfd1d6fe), -/* box 4 */ -W64LIT(0x561fc423e957943c), -W64LIT(0x014287ca69079288), -W64LIT(0x2f086129dfcd1d21), -W64LIT(0xc537d4aea044fd99), -W64LIT(0xf1e8c3bfd7c8a457), -W64LIT(0x2971998a5cdf9bfb), -W64LIT(0x23fa649a2ce9e460), -W64LIT(0x3aa9e9c356a6716a), -W64LIT(0xd6efa4e7aa3d1708), -W64LIT(0x705a24b1fda5b5eb), -W64LIT(0x101e0ce2b170a9fc), -W64LIT(0x7ca821020e814caa), -W64LIT(0x0bc97ada1931ed13), -W64LIT(0x34df1711778c59ce), -W64LIT(0xd35020ef9226d2bf), -W64LIT(0x575d43e9805006b4), -W64LIT(0x91acebec9b1db840), -W64LIT(0x549b3f423b5945d9), -W64LIT(0x99a3ed9d3925163e), -W64LIT(0x7917a50a369a891d), -W64LIT(0xe372343cb4b6dc4e), -W64LIT(0x8d40e2bdd949e8fd), -W64LIT(0xcfbc29bed0728202), -W64LIT(0x969794857108ac12), -W64LIT(0xdd26de3db30cfa1b), -W64LIT(0x115c8b28d8773b74), -W64LIT(0xe9f9c92cc480a3d5), -W64LIT(0x4dc8b21b4116d0d3), -W64LIT(0x316093194f979c79), -W64LIT(0x5124bb4a0342806e), -W64LIT(0xb31408bcdef3cea8), -W64LIT(0xc1cad76cf158aaa6), -W64LIT(0x88ff66b5e1522d4a), -W64LIT(0xa8c37e8476b28a47), -W64LIT(0x15a188ea896b6c4b), -W64LIT(0xa24883940684f5dc), -W64LIT(0xda1da1545919ee49), -W64LIT(0x22b8e35045ee76e8), -W64LIT(0x6106af9925d28e9f), -W64LIT(0xef80318f4792250f), -W64LIT(0x663dd0f0cfc79acd), -W64LIT(0x302214d326900ef1), -W64LIT(0xdfa2255c61022bfe), -W64LIT(0xe6cdb0348cad19f9), -W64LIT(0x50663c806a4512e6), -W64LIT(0x65fbac5b74ced9a0), -W64LIT(0xc4755364c9436f11), -W64LIT(0x8fc419dc0b473918), -W64LIT(0x5c9439339961eba7), -W64LIT(0x3f166dcb6ebdb4dd), -W64LIT(0xba59890715ccf25e), -W64LIT(0xf0aa4475becf36df), -W64LIT(0x03c67cabbb09436d), -W64LIT(0xb99ff5acaec5b133), -W64LIT(0xf9e7c5ce75f00a29), -W64LIT(0x6df4aa2ad6f677de), -W64LIT(0xaeba8627f5a00c9d), -W64LIT(0xa573fcfdec91e18e), -W64LIT(0x7f6e5da9b5880fc7), -W64LIT(0xca03adb6e86947b5), -W64LIT(0x74a72773acb9e2d4), -W64LIT(0x604428534cd51c17), -W64LIT(0xf8a542041cf798a1), -W64LIT(0x448533a08a29ec25), -W64LIT(0x80f060c4436a8334), -W64LIT(0x0db082799a236bc9), -W64LIT(0xfa21b965cef94944), -W64LIT(0x64b92b911dc94b28), -W64LIT(0x7118a37b94a22763), -W64LIT(0xaff801ed9ca79e15), -W64LIT(0x1dae8e9b2b53c235), -W64LIT(0x13d870490a79ea91), -W64LIT(0x8a7b9dd4335cfcaf), -W64LIT(0x1f2a75faf95d13d0), -W64LIT(0xeec2b6452e95b787), -W64LIT(0xc34e2c0d23567b43), -W64LIT(0x47434f0b3120af48), -W64LIT(0xa18eff3fbd8db6b1), -W64LIT(0x98e16a57502284b6), -W64LIT(0x37196bbacc851aa3), -W64LIT(0x8e869e166240ab90), -W64LIT(0x9fda153eba3790e4), -W64LIT(0xf515c07d86d4f368), -W64LIT(0x72dedfd02fab640e), -W64LIT(0xe230b3f6ddb14ec6), -W64LIT(0x97d5134f180f3e9a), -W64LIT(0xe1f6cf5d66b80dab), -W64LIT(0xe78f37fee5aa8b71), -W64LIT(0xa30a045e6f836754), -W64LIT(0x90ee6c26f21a2ac8), -W64LIT(0xaa4785e5a4bc5ba2), -W64LIT(0x4e0eceb0fa1f93be), -W64LIT(0x94136fe4a3067df7), -W64LIT(0x7b935e6be49458f8), -W64LIT(0x9b2716fceb2bc7db), -W64LIT(0x840d63061276d40b), -W64LIT(0xed04caee959cf4ea), -W64LIT(0xea3fb5877f89e0b8), -W64LIT(0xb56df01f5de14872), -W64LIT(0x4935b1d9100a87ec), -W64LIT(0x82749ba5916452d1), -W64LIT(0x58693af1c87dbc98), -W64LIT(0x89bde17f8855bfc2), -W64LIT(0x677f573aa6c00845), -W64LIT(0xeb7d324d168e7230), -W64LIT(0x0284fb61d20ed1e5), -W64LIT(0xb190f3dd0cfd1f4d), -W64LIT(0x684b2e22eeedb269), -W64LIT(0x2bf562eb8ed14a1e), -W64LIT(0xe0b448970fbf9f23), -W64LIT(0x396f9568edaf3207), -W64LIT(0x52e2c7e1b84bc303), -W64LIT(0x77615bd817b0a1b9), -W64LIT(0x7e2cda63dc8f9d4f), -W64LIT(0xf22ebf146cc1e73a), -W64LIT(0xc08850a6985f382e), -W64LIT(0xd9dbddffe210ad24), -W64LIT(0xbfe60d0f2dd737e9), -W64LIT(0x9a659136822c5553), -W64LIT(0x87cb1fada97f9766), -W64LIT(0x4c8a35d12811425b), -W64LIT(0x83361c6ff863c059), -W64LIT(0xd212a725fb214037), -W64LIT(0x9e9892f4d330026c), -W64LIT(0x45c7b46ae32e7ead), -W64LIT(0x5baf465a7374fff5), -W64LIT(0xdc6459f7da0b6893), -W64LIT(0xd46b5f867833c6ed), -W64LIT(0x5dd6bef9f066792f), -W64LIT(0xcb412a7c816ed53d), -W64LIT(0x75e5a0b9c5be705c), -W64LIT(0xf6d3bcd63dddb005), -W64LIT(0xfb633eafa7fedbcc), -W64LIT(0xd529d84c11345465), -W64LIT(0xc9c5d11d536004d8), -W64LIT(0xdb5f269e301e7cc1), -W64LIT(0x86899867c07805ee), -W64LIT(0x3d9296aabcb36538), -W64LIT(0x2cce1d8264c45e4c), -W64LIT(0x5aedc1901a736d7d), -W64LIT(0x2e4ae6e3b6ca8fa9), -W64LIT(0x1e68f230905a8158), -W64LIT(0xdee0a2960805b976), -W64LIT(0xcd38d2df027c53e7), -W64LIT(0x6909a9e887ea20e1), -W64LIT(0x24c11bf3c6fcf032), -W64LIT(0x18110a9313480782), -W64LIT(0xa7f7079c3e9f306b), -W64LIT(0xd8995a358b173fac), -W64LIT(0x854fe4cc7b714683), -W64LIT(0xbd62f66effd9e60c), -W64LIT(0x14e30f20e06cfec3), -W64LIT(0x6e32d6816dff34b3), -W64LIT(0x217e9ffbfee73585), -W64LIT(0xc88756d73a679650), -W64LIT(0x359d90db1e8bcb46), -W64LIT(0x2645e09214f221d7), -W64LIT(0x04fd03c2511c573f), -W64LIT(0x739c581a46acf686), -W64LIT(0xb0d2741765fa8dc5), -W64LIT(0xa0cc78f5d48a2439), -W64LIT(0x5e10c2524b6f3a42), -W64LIT(0xe50bcc9f37a45a94), -W64LIT(0x53a0402bd14c518b), -W64LIT(0x413ab7a8b2322992), -W64LIT(0x203c183197e0a70d), -W64LIT(0xcc7a55156b7bc16f), -W64LIT(0x4601c8c158273dc0), -W64LIT(0xbea48ac544d0a561), -W64LIT(0x638254f8f7dc5f7a), -W64LIT(0xa6b580565798a2e3), -W64LIT(0x3cd01160d5b4f7b0), -W64LIT(0x8c026577b04e7a75), -W64LIT(0x7ad1d9a18d93ca70), -W64LIT(0x785522c05f9d1b95), -W64LIT(0x5f5245982268a8ca), -W64LIT(0x9551e82eca01ef7f), -W64LIT(0x0000000000000000), -W64LIT(0xbb1b0ecd7ccb60d6), -W64LIT(0x094d81bbcb3f3cf6), -W64LIT(0x28331e4035d80973), -W64LIT(0xf7913b1c54da228d), -W64LIT(0x6acfd5433ce3638c), -W64LIT(0x1bd77638a84144ef), -W64LIT(0x62c0d3329edbcdf2), -W64LIT(0x81b2e70e2a6d11bc), -W64LIT(0xd7ad232dc33a8580), -W64LIT(0x05bf8408381bc5b7), -W64LIT(0x33e468789d994d9c), -W64LIT(0xfedcbaa79fe51e7b), -W64LIT(0x4f4c497a93180136), -W64LIT(0x073b7f69ea151452), -W64LIT(0x0cf205b3f324f941), -W64LIT(0x382d12a284a8a08f), -W64LIT(0x1cec0951425450bd), -W64LIT(0x55d9b888525ed751), -W64LIT(0x6cb62de0bff1e556), -W64LIT(0xd1d4db8e4028035a), -W64LIT(0x25839c39affb62ba), -W64LIT(0x4af3cd72ab03c481), -W64LIT(0xa4317b3785967306), -W64LIT(0x1a95f1f2c146d667), -W64LIT(0x926a97472014fb2d), -W64LIT(0xb7e90b7e8fef9997), -W64LIT(0xcefeae74b975108a), -W64LIT(0x3e54ea0107ba2655), -W64LIT(0xd0965c44292f91d2), -W64LIT(0xab05022fcdbbc92a), -W64LIT(0xfd1ac60c24ec5d16), -W64LIT(0xfc5841c64debcf9e), -W64LIT(0xe4494b555ea3c81c), -W64LIT(0xb6ab8cb4e6e80b1f), -W64LIT(0x3beb6e093fa1e3e2), -W64LIT(0xf36c38de05c675b2), -W64LIT(0x9c1c6995013ed389), -W64LIT(0x8b391a1e5a5b6e27), -W64LIT(0xec464d24fc9b6662), -W64LIT(0xad7cfa8c4ea94ff0), -W64LIT(0x0f347918482dba2c), -W64LIT(0x9d5eee5f68394101), -W64LIT(0x7623dc127eb73331), -W64LIT(0x32a6efb2f49edf14), -W64LIT(0x2d8c9a480dc3ccc4), -W64LIT(0xb2568f76b7f45c20), -W64LIT(0x0e76fed2212a28a4), -W64LIT(0x48773613790d1564), -W64LIT(0x129af783637e7819), -W64LIT(0x080f0671a238ae7e), -W64LIT(0x365bec70a582882b), -W64LIT(0x42fccb03093b6aff), -W64LIT(0x0a8bfd1070367f9b), -W64LIT(0xff9e3d6df6e28cf3), -W64LIT(0xe8bb4ee6ad87315d), -W64LIT(0xc7b32fcf724a2c7c), -W64LIT(0xb8dd7266c7c223bb), -W64LIT(0x9328108d491369a5), -W64LIT(0x0679f8a3831286da), -W64LIT(0x270767587df5b35f), -W64LIT(0xa981f94e1fb518cf), -W64LIT(0x6b8d528955e4f104), -W64LIT(0x1667f44132622f26), -W64LIT(0x2ab7e521e7d6d896), -W64LIT(0xac3e7d4627aedd78), -W64LIT(0x7deaa6c86786de22), -W64LIT(0x1725738b5b65bdae), -W64LIT(0x4bb14ab8c2045609), -W64LIT(0x592bbd3ba17a2e10), -W64LIT(0xc20cabc74a51e9cb), -W64LIT(0x6f70514b04f8a63b), -W64LIT(0xbc2071a496de7484), -W64LIT(0x19538d597a4f950a), -W64LIT(0xf45747b7efd361e0), -W64LIT(0x43be4cc9603cf877), -W64LIT(0xc6f1a8051b4dbef4), -W64LIT(0xb42f77d534e6dafa), -W64LIT(0x40783062db35bb1a), -/* box 5 */ -W64LIT(0xf5a96c292deb0a4e), -W64LIT(0x211c9df6ee653c51), -W64LIT(0x04de5ddcbeeef596), -W64LIT(0xe1e5b06f7457c19f), -W64LIT(0x74ca30f014a54fb6), -W64LIT(0xc296f9f7c5457d85), -W64LIT(0x7d4ee08a484d10b0), -W64LIT(0xae87f2d0bf9b13ad), -W64LIT(0x8df4bb480e89afb7), -W64LIT(0x2d8b7a67d9a2d61e), -W64LIT(0x0f3559c8bd712adb), -W64LIT(0x541bc7312f013338), -W64LIT(0x9ec4848b636d5164), -W64LIT(0x952f809f60f28e29), -W64LIT(0x28984d8cb28d6357), -W64LIT(0xd4b5f1dfc38e361f), -W64LIT(0x5674135f7076b373), -W64LIT(0xb791a330042172ec), -W64LIT(0xab94c53bd4b4a6e4), -W64LIT(0xf17731f59305ffd8), -W64LIT(0x39c7a621801e1dcf), -W64LIT(0x20d1f7c13ba47c8e), -W64LIT(0x5e3da912f95facaa), -W64LIT(0xb1202a82e5b80731), -W64LIT(0x13303fc36de4fed3), -W64LIT(0x2e29c43e5314168a), -W64LIT(0x861fbf5c0d1670fa), -W64LIT(0x6458b16af3f771f1), -W64LIT(0x3043765bdcf642c9), -W64LIT(0x12fd55f4b825be0c), -W64LIT(0x0a266e23d65e9f92), -W64LIT(0x6595db5d2636312e), -W64LIT(0x85bd010587a0b06e), -W64LIT(0x9bd7b3600842e42d), -W64LIT(0xaa59af0c0175e63b), -W64LIT(0x240faa1d854a8918), -W64LIT(0xf464061ef82a4a91), -W64LIT(0x5c527d7ca6282ce1), -W64LIT(0x03a2be598ab6c094), -W64LIT(0x40571b7776bdf8e9), -W64LIT(0xe4f687841f7874d6), -W64LIT(0x115febad32937e98), -W64LIT(0x5108f0da442e8671), -W64LIT(0x9cab50e53c1ad12f), -W64LIT(0x33e1c8025640825d), -W64LIT(0x87d2d56bd8d73025), -W64LIT(0xc0f92d999a32fdce), -W64LIT(0x62e938d8126e042c), -W64LIT(0x4a717554a0e3677b), -W64LIT(0x0beb0414039fdf4d), -W64LIT(0xd6da25b19cf9b654), -W64LIT(0x55d6ad06fac073e7), -W64LIT(0x632452efc7af44f3), -W64LIT(0xb5fe775e5b56f2a7), -W64LIT(0x892ae694b0675a21), -W64LIT(0x7a32030f7c1525b2), -W64LIT(0x5d9f174b73e96c3e), -W64LIT(0xc35b93c010843d5a), -W64LIT(0x373f95dee8ae77cb), -W64LIT(0xfb515fd6455b604a), -W64LIT(0xa9fb11558bc326af), -W64LIT(0x22be23af64d3fcc5), -W64LIT(0xa8367b625e026670), -W64LIT(0xb8a4faf8b9505837), -W64LIT(0x785dd7612362a5f9), -W64LIT(0x588c20a018c6d977), -W64LIT(0xea0eb47b77c81ed2), -W64LIT(0xa6ce489d36b20c74), -W64LIT(0x0c97e79137c7ea4f), -W64LIT(0x7c838abd9d8c506f), -W64LIT(0x57b97968a5b7f3ac), -W64LIT(0x6c110b277ade6e28), -W64LIT(0xc785ce1cae6ac8cc), -W64LIT(0x1581b6718c7d8b0e), -W64LIT(0x614b868198d8c4b8), -W64LIT(0x27ad14440ffc498c), -W64LIT(0xdb80a8177eff1cc4), -W64LIT(0x472bf8f242e5cdeb), -W64LIT(0x8a8858cd3ad19ab5), -W64LIT(0xf60bd270a75dcada), -W64LIT(0x43f5a52efc0b387d), -W64LIT(0x6ddc6110af1f2ef7), -W64LIT(0xf0ba5bc246c4bf07), -W64LIT(0x6fb3b57ef068aebc), -W64LIT(0x18db3bd76e7b219e), -W64LIT(0x903cb7740bdd3b60), -W64LIT(0x7bff6938a9d4656d), -W64LIT(0xbdb7cd13d27fed7e), -W64LIT(0x051337eb6b2fb549), -W64LIT(0x77688ea99e138f22), -W64LIT(0xd9ef7c7921889c8f), -W64LIT(0x077ce38534583502), -W64LIT(0xf318e59bcc727f93), -W64LIT(0xb34ffeecbacf877a), -W64LIT(0xe9ac0a22fd7ede46), -W64LIT(0xfc2dbc5371035548), -W64LIT(0x026fd46e5f77804b), -W64LIT(0xe53bedb3cab93409), -W64LIT(0xcc6eca08adf51781), -W64LIT(0xe028da58a1968140), -W64LIT(0x3a6518780aa8dd5b), -W64LIT(0xce011e66f28297ca), -W64LIT(0xa4a19cf369c58c3f), -W64LIT(0xc5ea1a72f11d4887), -W64LIT(0xc427704524dc0858), -W64LIT(0x4238cf1929ca78a2), -W64LIT(0x481ea13aff94e730), -W64LIT(0xdf5ef5cbc011e952), -W64LIT(0x80ae36eeec8f0527), -W64LIT(0x5ae3f4ce47b1593c), -W64LIT(0xcda3a03f7834575e), -W64LIT(0x71d9071b7f8afaff), -W64LIT(0xcadf43ba4c6c625c), -W64LIT(0x1623082806cb4b9a), -W64LIT(0x17ee621fd30a0b45), -W64LIT(0x448946abc8530d7f), -W64LIT(0x974054f13f850e62), -W64LIT(0x73b6d37520fd7ab4), -W64LIT(0xc8b097d4131be217), -W64LIT(0x9f09eebcb6ac11bb), -W64LIT(0x45442c9c1d924da0), -W64LIT(0x1b79858ee4cde10a), -W64LIT(0x0984d07a5ce85f06), -W64LIT(0x4cc0fce6417a12a6), -W64LIT(0x99b8670e57356466), -W64LIT(0xad254c89352dd339), -W64LIT(0x322ca2358381c282), -W64LIT(0xcfcc74512743d715), -W64LIT(0x6b6de8a24e865b2a), -W64LIT(0xda4dc220ab3e5c1b), -W64LIT(0x88e78ca365a61afe), -W64LIT(0x939e092d816bfbf4), -W64LIT(0xcb12298d99ad2283), -W64LIT(0xeed0e9a7c926eb44), -W64LIT(0x98750d3982f424b9), -W64LIT(0xd5789be8164f76c0), -W64LIT(0xbe15734a58c92dea), -W64LIT(0x49d3cb0d2a55a7ef), -W64LIT(0x67fa0f337941b165), -W64LIT(0x8c39d17fdb48ef68), -W64LIT(0x25c2c02a508bc9c7), -W64LIT(0x349d2b876218b75f), -W64LIT(0x70146d2caa4bba20), -W64LIT(0x1c05660bd095d408), -W64LIT(0xfe42683d2e74d503), -W64LIT(0x9a1ad957dd83a4f2), -W64LIT(0xf2d58fac19b33f4c), -W64LIT(0x81635cd9394e45f8), -W64LIT(0xb65cc907d1e03233), -W64LIT(0xdd3121a59f666919), -W64LIT(0x318e1c6c09370216), -W64LIT(0x8b4532faef10da6a), -W64LIT(0x191651e0bbba6141), -W64LIT(0x3f762f9361876812), -W64LIT(0xb96990cf6c9118e8), -W64LIT(0xb4331d698e97b278), -W64LIT(0xd822164ef449dc50), -W64LIT(0x84706b325261f0b1), -W64LIT(0x4eaf28881e0d92ed), -W64LIT(0x69023ccc11f1db61), -W64LIT(0x66376504ac80f1ba), -W64LIT(0x0849ba4d89291fd9), -W64LIT(0xff8f020afbb595dc), -W64LIT(0x50c59aed91efc6ae), -W64LIT(0x1dc80c3c055494d7), -W64LIT(0x1e6ab2658fe25443), -W64LIT(0x3d19fbfd3ef0e859), -W64LIT(0xfa9c35e1909a2095), -W64LIT(0x52aa4e83ce9846e5), -W64LIT(0x419a7140a37cb836), -W64LIT(0xa07fc12fd72b79a9), -W64LIT(0x68cf56fbc4309bbe), -W64LIT(0x01cd6a37d5c140df), -W64LIT(0x9253631a54aabb2b), -W64LIT(0xd06bac037d60c389), -W64LIT(0x295527bb674c2388), -W64LIT(0xd204786d221743c2), -W64LIT(0x0000000000000000), -W64LIT(0xf7c6b847729c8a05), -W64LIT(0xdcfc4b924aa729c6), -W64LIT(0xe38a64012b2041d4), -W64LIT(0xb28294db6f0ec7a5), -W64LIT(0x9d663ad2e9db91f0), -W64LIT(0x91f1dd43de1c7bbf), -W64LIT(0x6086ecb64d198467), -W64LIT(0x59414a97cd0799a8), -W64LIT(0xace826bee0ec93e6), -W64LIT(0xa56cf6c4bc04cce0), -W64LIT(0x727bb942f53c3a6b), -W64LIT(0x6e7edf4925a9ee63), -W64LIT(0x26607e73da3d0953), -W64LIT(0xe75439dd95ceb442), -W64LIT(0x7990bd56f6a3e526), -W64LIT(0xecbf3dc996516b0f), -W64LIT(0x76a5e49e4bd2cffd), -W64LIT(0x968d3ec6ea444ebd), -W64LIT(0x5b2e9ef9927019e3), -W64LIT(0x6aa082959b471bf5), -W64LIT(0xbb0644a133e698a3), -W64LIT(0x830c88b76639c5b3), -W64LIT(0xe2470e36fee1010b), -W64LIT(0xb0ed40b5307947ee), -W64LIT(0x355041b0b7d9f780), -W64LIT(0x8e560511843f6f23), -W64LIT(0x7f2134e4173a90fb), -W64LIT(0x2af799e2edfae31c), -W64LIT(0x4bbc1f63752227a4), -W64LIT(0xf8f3e18fcfeda0de), -W64LIT(0x0d5a8da6e206aa90), -W64LIT(0x2c4610500c6396c1), -W64LIT(0xde939ffc15d0a98d), -W64LIT(0xaf4a98e76a5a5372), -W64LIT(0x8f9b6f2651fe2ffc), -W64LIT(0x36f2ffe93d6f3714), -W64LIT(0x0ef833ff68b06a04), -W64LIT(0xe69953ea400ff49d), -W64LIT(0x23734998b112bc1a), -W64LIT(0x3ebb45a4b44628cd), -W64LIT(0x1ab4efb9310ca1d5), -W64LIT(0x2fe4ae0986d55655), -W64LIT(0xebc3de4ca2095e0d), -W64LIT(0x536724b41b59063a), -W64LIT(0x46e692c597248d34), -W64LIT(0x2b3af3d5383ba3c3), -W64LIT(0x3ba8724fdf699d84), -W64LIT(0xc13447ae4ff3bd11), -W64LIT(0x4d0d96d194bb5279), -W64LIT(0xfde0d664a4c21597), -W64LIT(0xd7174f864938f68b), -W64LIT(0x7eec5ed3c2fbd024), -W64LIT(0xbfd8197d8d086d35), -W64LIT(0x4f6242bfcbccd232), -W64LIT(0xa70322aae3734cab), -W64LIT(0xa3dd7f765d9db93d), -W64LIT(0x94e2eaa8b533cef6), -W64LIT(0x144cdc4659bccbd1), -W64LIT(0xc648a42b7bab8813), -W64LIT(0xf93e8bb81a2ce001), -W64LIT(0xbacb2e96e627d87c), -W64LIT(0xbc7aa72407beada1), -W64LIT(0xc97dfde3c6daa2c8), -W64LIT(0xa1b2ab1802ea3976), -W64LIT(0x1fa7d8525a23149c), -W64LIT(0x75075ac7c1640f69), -W64LIT(0xe861601528bf9e99), -W64LIT(0xa2101541885cf9e2), -W64LIT(0xef1d83901ce7ab9b), -W64LIT(0x06b189b2e19975dd), -W64LIT(0x380acc1655df5d10), -W64LIT(0x1092819ae7523e47), -W64LIT(0xd3c9125af7d6031d), -W64LIT(0xd1a6c634a8a18356), -W64LIT(0x5ff0c3252c9eec75), -W64LIT(0x82c1e280b3f8856c), -W64LIT(0xed7257fe43902bd0), -W64LIT(0x3cd491caeb31a886), -/* box 6 */ -W64LIT(0x94af9eb6fad9e7df), -W64LIT(0x9208ae5e03c94ddd), -W64LIT(0x1d8de8d67158480b), -W64LIT(0xfd093cd2ba147af8), -W64LIT(0xa45ceb22e6597ccf), -W64LIT(0x9bbde6e77bf113da), -W64LIT(0xe4edf4b465fffe5c), -W64LIT(0x7125622e4e8d2a2f), -W64LIT(0x1791b81b8f68430d), -W64LIT(0xb56a63d1902195c0), -W64LIT(0xa980832b30d2ee67), -W64LIT(0x4c0a7fb384862397), -W64LIT(0xed58bc0d1dc7a05b), -W64LIT(0x5955d7f05c4d0637), -W64LIT(0xd2b9b1c8806fcf4e), -W64LIT(0x06a730e8f910aa02), -W64LIT(0xb8b60bd846aa0768), -W64LIT(0x45bf370afcbe7d90), -W64LIT(0x16f6b0375ec370a1), -W64LIT(0x892276608b81afd4), -W64LIT(0xdcccc1b5d0ec08e7), -W64LIT(0xe856949162df5f58), -W64LIT(0x82592e81a41a977e), -W64LIT(0xac8eabb74fca1164), -W64LIT(0xfac9041692afe356), -W64LIT(0x3b882d75331ba3ba), -W64LIT(0xa39cd3e6cee2e561), -W64LIT(0xd077a190d7cca9e3), -W64LIT(0x9c7dde23534a8a74), -W64LIT(0x80973ed9f3b9f1d3), -W64LIT(0xce535132209cb4e9), -W64LIT(0xaa299b5fb6dabb66), -W64LIT(0x2d7e9d426dd8d31b), -W64LIT(0x8a8b6e140d89fad5), -W64LIT(0x6ca88af83fd56224), -W64LIT(0xf5db7c4713871753), -W64LIT(0xeef1a4799bcff55a), -W64LIT(0x76e55aea6636b381), -W64LIT(0x8ee24ea4a33a367a), -W64LIT(0x25acddd7c44bbeb0), -W64LIT(0x9adaeecbaa5a2076), -W64LIT(0x0e75707d5083c7a9), -W64LIT(0x2bd9adaa94c87919), -W64LIT(0x19e4c866dfeb84a4), -W64LIT(0x129f9087f070bc0e), -W64LIT(0xd9c2e929aff4f7e4), -W64LIT(0x6f01928cb9dd3725), -W64LIT(0x39463d2d64b8c517), -W64LIT(0xebff8ce5e4d70a59), -W64LIT(0xb40d6bfd418aa66c), -W64LIT(0xf21b44833b3c8efd), -W64LIT(0x3654457ce5903112), -W64LIT(0x431807e205aed792), -W64LIT(0xb10343613e92596f), -W64LIT(0x0a1c50cdfe300b06), -W64LIT(0x778252c6b79d802d), -W64LIT(0x0cbb60250720a104), -W64LIT(0xe1e3dc281ae7015f), -W64LIT(0x0f1278518128f405), -W64LIT(0x47712752ab1d1b3d), -W64LIT(0xe24ac45c9cef545e), -W64LIT(0x1ceae0faa0f37ba7), -W64LIT(0x9814fe93fdf946db), -W64LIT(0xec3fb421cc6c93f7), -W64LIT(0x833e26ad75b1a4d2), -W64LIT(0x6b68b23c176efb8a), -W64LIT(0x4904572ffb9edc94), -W64LIT(0x4bca4777ac3dba39), -W64LIT(0x2762cd8f93e8d81d), -W64LIT(0x9eb3ce7b04e9ecd9), -W64LIT(0xc2e8311727bc15ed), -W64LIT(0xea9884c9357c39f5), -W64LIT(0xfc6e34fe6bbf4954), -W64LIT(0x13f898ab21db8fa2), -W64LIT(0xb7a47389c782f36d), -W64LIT(0x7b3932e3b0bd2129), -W64LIT(0xaf27b3c3c9c24465), -W64LIT(0xb6c37ba51629c0c1), -W64LIT(0x84fe1e695d0a3d7c), -W64LIT(0x1a4dd01259e3d1a5), -W64LIT(0xab4e9373677188ca), -W64LIT(0x90c6be06546a2b70), -W64LIT(0xf37c4cafea97bd51), -W64LIT(0x647aca6d96460f8f), -W64LIT(0x4ec46febd325453a), -W64LIT(0x3e8605e94c035cb9), -W64LIT(0x0ddc6809d68b92a8), -W64LIT(0x8bec6638dc22c979), -W64LIT(0x67d3d219104e5a8e), -W64LIT(0x2abea58645634ab5), -W64LIT(0x5b9bc7a80bee609a), -W64LIT(0x936fa672d2627e71), -W64LIT(0x7d9e020b49ad8b2b), -W64LIT(0x5832dfdc8de6359b), -W64LIT(0xc7e6198b58a4eaee), -W64LIT(0xd41e8120797f654c), -W64LIT(0xf4bc746bc22c24ff), -W64LIT(0xe084d404cb4c32f3), -W64LIT(0x48635f032a35ef38), -W64LIT(0x8757061ddb02687d), -W64LIT(0x522e8f1173d63e9d), -W64LIT(0xbcdf2b68e819cbc7), -W64LIT(0xbf76331c6e119ec6), -W64LIT(0x08d24095a9936dab), -W64LIT(0x728c7a5ac8857f2e), -W64LIT(0xd110a9bc06679a4f), -W64LIT(0x1f43f88e26fb2ea6), -W64LIT(0xb2aa5b15b89a0c6e), -W64LIT(0x4aad4f5b7d968995), -W64LIT(0x9fd4c657d542df75), -W64LIT(0x323d65cc4b23fdbd), -W64LIT(0xc38f393bf6172641), -W64LIT(0xa152c3be994183cc), -W64LIT(0x9d1ad60f82e1b9d8), -W64LIT(0xe744ecc0e3f7ab5d), -W64LIT(0x38213501b513f6bb), -W64LIT(0xade9a39b9e6122c8), -W64LIT(0x37334d50343b02be), -W64LIT(0x55eeb7d55b6da733), -W64LIT(0x970686c27cd1b2de), -W64LIT(0x427f0fced405e43e), -W64LIT(0xc026214f701f7340), -W64LIT(0x40b11f9683a68293), -W64LIT(0x02ce105857a366ad), -W64LIT(0x7e371a7fcfa5de2a), -W64LIT(0xffc72c8aedb71c55), -W64LIT(0x68c1aa489166ae8b), -W64LIT(0xc68111a7890fd942), -W64LIT(0x79f722bbe71e4784), -W64LIT(0xd579890ca8d456e0), -W64LIT(0x70426a029f261983), -W64LIT(0xb0644b4def396ac3), -W64LIT(0xdb0cf971f8579149), -W64LIT(0x5489bff98ac6949f), -W64LIT(0x046920b0aeb3ccaf), -W64LIT(0x7cf90a279806b887), -W64LIT(0x050e289c7f18ff03), -W64LIT(0x651dc24147ed3c23), -W64LIT(0x5e95ef3474f69f99), -W64LIT(0x6dcf82d4ee7e5188), -W64LIT(0x8f854688729105d6), -W64LIT(0x81f036f52212c27f), -W64LIT(0xb9d103f4970134c4), -W64LIT(0x5349873da27d0d31), -W64LIT(0x20a2f54bbb5341b3), -W64LIT(0xf0d554db6c9fe850), -W64LIT(0x07c038c428bb99ae), -W64LIT(0x30f375941c809b10), -W64LIT(0x3fe10dc59da86f15), -W64LIT(0x46162f7e7ab62891), -W64LIT(0xe623e4ec325c98f1), -W64LIT(0xfea024a63c1c2ff9), -W64LIT(0x349a5524b23357bf), -W64LIT(0x35fd5d0863986413), -W64LIT(0x96618eeead7a8172), -W64LIT(0xcb5d79ae5f844bea), -W64LIT(0x21c5fd676af8721f), -W64LIT(0x5720a78d0ccec19e), -W64LIT(0xf6726433958f4252), -W64LIT(0x8d4b56d02532637b), -W64LIT(0x24cbd5fb15e08d1c), -W64LIT(0x3aef2559e2b09016), -W64LIT(0x5afccf84da455336), -W64LIT(0x51879765f5de6b9c), -W64LIT(0x2917bdf2c36b1fb4), -W64LIT(0xa7f5f356605129ce), -W64LIT(0xc1412963a1b440ec), -W64LIT(0x3d2f1d9dca0b09b8), -W64LIT(0xa53be30e37f24f63), -W64LIT(0x5ff2e718a55dac35), -W64LIT(0xa2fbdbca1f49d6cd), -W64LIT(0xf7156c1f442471fe), -W64LIT(0x7a5e3acf61161285), -W64LIT(0xca3a71828e2f7846), -W64LIT(0x1b2ad83e8848e209), -W64LIT(0xa8e78b07e179ddcb), -W64LIT(0xef96ac554a64c6f6), -W64LIT(0x0000000000000000), -W64LIT(0x6013eadd38f5c320), -W64LIT(0x3c4815b11ba03a14), -W64LIT(0x09b548b978385e07), -W64LIT(0x226ce513ecf0271e), -W64LIT(0x63baf2a9befd9621), -W64LIT(0x44d83f262d154e3c), -W64LIT(0xcdfa4946a694e1e8), -W64LIT(0x113688f37678e90f), -W64LIT(0x859916458ca10ed0), -W64LIT(0xc52809d30f078c43), -W64LIT(0x4d6d779f552d103b), -W64LIT(0x1e24f0a2f7501d0a), -W64LIT(0x0167082cd1ab33ac), -W64LIT(0x1438a06f0960160c), -W64LIT(0xf9601c6214a7b657), -W64LIT(0xa035cb9248eab060), -W64LIT(0x50e09f4924755830), -W64LIT(0xd7b79954ff77304d), -W64LIT(0xe58afc98b454cdf0), -W64LIT(0x03a9187486085501), -W64LIT(0x62ddfa856f56a58d), -W64LIT(0xc44f01ffdeacbfef), -W64LIT(0x73eb7276192e4c82), -W64LIT(0xd6d091782edc03e1), -W64LIT(0xfbae0c3a4304d0fa), -W64LIT(0x9973f6bf2c527577), -W64LIT(0x105180dfa7d3daa3), -W64LIT(0x2605c5a34243ebb1), -W64LIT(0x91a1b62a85c118dc), -W64LIT(0xc99369f608272d47), -W64LIT(0x5d3cf740f2feca98), -W64LIT(0xcf34591ef1378745), -W64LIT(0xc8f461dad98c1eeb), -W64LIT(0x0b7b58e12f9b38aa), -W64LIT(0xe32dcc704d4467f2), -W64LIT(0x754c429ee03ee680), -W64LIT(0xd3deb9e451c4fce2), -W64LIT(0x6e669aa068760489), -W64LIT(0x66b4da35c1e56922), -W64LIT(0x4fa367c7028e7696), -W64LIT(0xba781b80110961c5), -W64LIT(0x41d617ba520db13f), -W64LIT(0x335a6de09a88ce11), -W64LIT(0xdf65d9c156e45de6), -W64LIT(0xcc9d416a773fd244), -W64LIT(0x5c5bff6c2355f934), -W64LIT(0x2870b5de12c02c18), -W64LIT(0x155fa843d8cb25a0), -W64LIT(0x78902a9736b57428), -W64LIT(0xae40bbef186977c9), -W64LIT(0x88457e4c5a2a9c78), -W64LIT(0x6a0fba10c6c5c826), -W64LIT(0x7f5012531e0eed86), -W64LIT(0x8c2c5efcf49950d7), -W64LIT(0x31947db8cd2ba8bc), -W64LIT(0x2c19956ebc73e0b7), -W64LIT(0x230bed3f3d5b14b2), -W64LIT(0x69a6a26440cd9d27), -W64LIT(0x86300e310aa95bd1), -W64LIT(0xb3cd533969313fc2), -W64LIT(0x1883c04a0e40b708), -W64LIT(0xf1b25cf7bd34dbfc), -W64LIT(0x2fb08d1a3a7bb5b6), -W64LIT(0xd8a5e1057e5fc448), -W64LIT(0xddabc99901473b4b), -W64LIT(0xde02d1ed874f6e4a), -W64LIT(0xbdb8234439b2f86b), -W64LIT(0x5647afa1dd65f232), -W64LIT(0x2ed78536ebd0861a), -W64LIT(0xe9319cbdb3746cf4), -W64LIT(0xa692fb7ab1fa1a62), -W64LIT(0x742b4ab23195d52c), -W64LIT(0x95c8969a2b72d473), -W64LIT(0x6174e2f1e95ef08c), -W64LIT(0xf807144ec50c85fb), -W64LIT(0xbe113b30bfbaad6a), -W64LIT(0xda6bf15d29fca2e5), -W64LIT(0xbb1f13acc0a25269), -/* box 7 */ -W64LIT(0xc22b27f0f9e37bf9), -W64LIT(0x93fad23f0955ef09), -W64LIT(0x32ed4b84a22a91a2), -W64LIT(0x3898b57bcc61b1cc), -W64LIT(0x55825ba9ad98e5ad), -W64LIT(0xb2eeb8069421ec94), -W64LIT(0xc7eb5875ce3c6bce), -W64LIT(0x4b1dac5d1f45851f), -W64LIT(0xc16ba1204705d847), -W64LIT(0xc5380f461a2ba91a), -W64LIT(0xb908971a909bad90), -W64LIT(0x303e1cb7763d5376), -W64LIT(0xe6ff324c53486853), -W64LIT(0x6d1aeed261f95461), -W64LIT(0x0193d1e36af1616a), -W64LIT(0x51d1f5cff0b694f0), -W64LIT(0x29b2c3f52728e127), -W64LIT(0x112a768eeb4950eb), -W64LIT(0x8fb672f86f9f4d6f), -W64LIT(0xf0c66c745bc9ea5b), -W64LIT(0x3f8b9dcd2fa9632f), -W64LIT(0x65bc471edba5b6db), -W64LIT(0x4d9d5508967c3696), -W64LIT(0x3a4be24818767318), -W64LIT(0x2794936c144db014), -W64LIT(0x2af2452599ce4299), -W64LIT(0x4a8e7dbe75b4e475), -W64LIT(0x9ddc82a63a30be3a), -W64LIT(0xade29e114c0ded4c), -W64LIT(0xd1d2064dc6bde9c6), -W64LIT(0x7da349bfe04165e0), -W64LIT(0x6b9a1787e8c0e7e8), -W64LIT(0xa54437ddf6510ff6), -W64LIT(0x2254ece92392a023), -W64LIT(0x79f0e7d9bd6f14bd), -W64LIT(0x57510c9a798f2779), -W64LIT(0x346db2d12b13222b), -W64LIT(0x54118a4ac76984c7), -W64LIT(0xefca4a6383e5eb83), -W64LIT(0xca8d8e3c43bf9943), -W64LIT(0xfc336bdebcbb79bc), -W64LIT(0x3e184c2e45580245), -W64LIT(0xf495c21206e79b06), -W64LIT(0xff73ed0e025dda02), -W64LIT(0x4228d472cfe806cf), -W64LIT(0xbcc8e89fa744bda7), -W64LIT(0xab626744c5345ec5), -W64LIT(0xb6bd1660c90f9dc9), -W64LIT(0xb72ec783a3fefca3), -W64LIT(0x8be5dc9e32b13c32), -W64LIT(0x485d2a8da1a326a1), -W64LIT(0xc6788996a4cd0aa4), -W64LIT(0x40fb83411bffc41b), -W64LIT(0x08a6a9ccba5ce2ba), -W64LIT(0xf386eaa4e52f49e5), -W64LIT(0x1acc5992eff311ef), -W64LIT(0xa2571f6b1599dd15), -W64LIT(0x44a82d2746d1b546), -W64LIT(0x70c59ff66dc2976d), -W64LIT(0x8d6525cbbb888fbb), -W64LIT(0x963aadba3e8aff3e), -W64LIT(0x7c30985c8ab0048a), -W64LIT(0x607c389bec7aa6ec), -W64LIT(0xa822e1947bd2fd7b), -W64LIT(0x034086d0bee6a3be), -W64LIT(0x66fcc1ce65431565), -W64LIT(0xb37d69e5fed08dfe), -W64LIT(0x2f323aa0ae1152ae), -W64LIT(0x56c2dd79137e4613), -W64LIT(0x31adcd541ccc321c), -W64LIT(0xdff456d4f5d8b8f5), -W64LIT(0xf9f3145b8b64698b), -W64LIT(0x764566a3e4fb24e4), -W64LIT(0x0cf507aae77293e7), -W64LIT(0x59775c034aea764a), -W64LIT(0xb89b46f9fa6accfa), -W64LIT(0xe8d962d5602d3960), -W64LIT(0x17aa8fdb6270e362), -W64LIT(0x1c4ca0c766caa266), -W64LIT(0x2de16d937a06907a), -W64LIT(0x2547c45fc05a72c0), -W64LIT(0x0fb5817a59943059), -W64LIT(0x0680f9558939b389), -W64LIT(0x16395e3808818208), -W64LIT(0xac714ff226fc8c26), -W64LIT(0xa9b1307711239c11), -W64LIT(0xec8accb33d03483d), -W64LIT(0x6c893f310b08350b), -W64LIT(0xc4abdea570dac870), -W64LIT(0xba4811ca2e7d0e2e), -W64LIT(0xf155bd9731388b31), -W64LIT(0xdd2701e721cf7a21), -W64LIT(0xe94ab3360adc580a), -W64LIT(0x23c73d0a4963c149), -W64LIT(0x5cb723867d35667d), -W64LIT(0x5042242c9a47f59a), -W64LIT(0x198cdf425115b251), -W64LIT(0x0a75feff6e4b206e), -W64LIT(0xfda0ba3dd64a18d6), -W64LIT(0xcede205a1e91e81e), -W64LIT(0xd041d7aeac4c88ac), -W64LIT(0xe42c657f875faa87), -W64LIT(0x36bee5e2ff04e0ff), -W64LIT(0x6fc9b9e1b5ee96b5), -W64LIT(0x998f2cc0671ecf67), -W64LIT(0xd301517e12aa2b12), -W64LIT(0xaea218c1f2eb4ef2), -W64LIT(0xda342951c207a8c2), -W64LIT(0x61efe978868bc786), -W64LIT(0x7f701e8c3456a734), -W64LIT(0x0be62f1c04ba4104), -W64LIT(0x9129850cdd422ddd), -W64LIT(0xd6c12efb25753b25), -W64LIT(0xe33f4dc964977864), -W64LIT(0x1579d8e8b66721b6), -W64LIT(0xf860c5b8e19508e1), -W64LIT(0x7496319030ece630), -W64LIT(0x88a55a4e8c579f8c), -W64LIT(0xcf4df1b974608974), -W64LIT(0x10b9a76d81b83181), -W64LIT(0x0e26509933655133), -W64LIT(0x43bb0591a51967a5), -W64LIT(0x926903dc63a48e63), -W64LIT(0x9c4f534550c1df50), -W64LIT(0x3bd833ab72871272), -W64LIT(0xa4d7e63e9ca06e9c), -W64LIT(0xb46e41531d185f1d), -W64LIT(0x126af05e55aff355), -W64LIT(0x24d415bcaaab13aa), -W64LIT(0x1e9ff7f4b2dd60b2), -W64LIT(0x05c07f8537df1037), -W64LIT(0x467b7a1492c67792), -W64LIT(0x2087bbdaf78562f7), -W64LIT(0x819022615cfa1c5c), -W64LIT(0xcd9ea68aa0774ba0), -W64LIT(0xa79760ee2246cd22), -W64LIT(0x8343755288edde88), -W64LIT(0x58e48de0201b1720), -W64LIT(0x7216c8c5b9d555b9), -W64LIT(0x372d340195f58195), -W64LIT(0xa11799bbab7f7eab), -W64LIT(0x9f0fd595ee277cee), -W64LIT(0x676f102d0fb2740f), -W64LIT(0x9e9c047684d61d84), -W64LIT(0x49cefb6ecb5247cb), -W64LIT(0xd41279c8f162f9f1), -W64LIT(0x1f0c2617d82c01d8), -W64LIT(0x97a97c59547b9e54), -W64LIT(0xe76ce3af39b90939), -W64LIT(0xc3b8f61393121a93), -W64LIT(0x5ba40b309efdb49e), -W64LIT(0xea0a35e6b43afbb4), -W64LIT(0x5a37dad3f40cd5f4), -W64LIT(0x14ea090bdc9640dc), -W64LIT(0x5e6474b5a922a4a9), -W64LIT(0xfee03ced68acbb68), -W64LIT(0x071328b6e3c8d2e3), -W64LIT(0x5302a2fc24a15624), -W64LIT(0x85c38c0701d46d01), -W64LIT(0x3d58cafefbbea1fb), -W64LIT(0x84505de46b250c6b), -W64LIT(0x642f96fdb154d7b1), -W64LIT(0xbf886e4f19a21e19), -W64LIT(0x02d35733d417c2d4), -W64LIT(0x68da915756264456), -W64LIT(0x8710db34d5c3afd5), -W64LIT(0x0d66d6498d83f28d), -W64LIT(0x7b23b0ea6978d669), -W64LIT(0x1b5f887185027085), -W64LIT(0x3ccb1b1d914fc091), -W64LIT(0x0453ae665d2e715d), -W64LIT(0xcb1e5fdf294ef829), -W64LIT(0xf6469521d2f059d2), -W64LIT(0xb03def3540362e40), -W64LIT(0x633cbe4b529c0552), -W64LIT(0xf7d544c2b80138b8), -W64LIT(0x7ab061090389b703), -W64LIT(0x0000000000000000), -W64LIT(0xdba7f8b2a8f6c9a8), -W64LIT(0x35fe633241e24341), -W64LIT(0x21146a399d74039d), -W64LIT(0xd581a82b9b93989b), -W64LIT(0x0935782fd0ad83d0), -W64LIT(0x5ff7a556c3d3c5c3), -W64LIT(0xaf31c922981a2f98), -W64LIT(0x90ba54efb7b34cb7), -W64LIT(0x5291731f4e50374e), -W64LIT(0xc0f870c32df4b92d), -W64LIT(0x7ee3cf6f5ea7c65e), -W64LIT(0xe07fcb19da71dbda), -W64LIT(0x4eddd3d8289a9528), -W64LIT(0x13f921bd3f5e923f), -W64LIT(0xf50613f16c16fa6c), -W64LIT(0x981cfd230defae0d), -W64LIT(0x4c0e84ebfc8d57fc), -W64LIT(0x82d0a4b1e21cbfe2), -W64LIT(0x89368bade6a6fee6), -W64LIT(0xd292809d785b4a78), -W64LIT(0x47e8abf7f83716f8), -W64LIT(0x8e25a31b056e2c05), -W64LIT(0xd752ff184f845a4f), -W64LIT(0xcc0d7769ca862aca), -W64LIT(0x694940b43cd7253c), -W64LIT(0x2ea1eb43c4e033c4), -W64LIT(0xde6787379f29d99f), -W64LIT(0x181f0ea13be4d33b), -W64LIT(0x416852a2710ea571), -W64LIT(0x62af6fa8386d6438), -W64LIT(0xa0844858c18e1fc1), -W64LIT(0x337e9a67c8dbf0c8), -W64LIT(0x2c72bc7010f7f110), -W64LIT(0xbd5b397ccdb5dccd), -W64LIT(0xd8e77e6216106a16), -W64LIT(0x86830ad7bf32cebf), -W64LIT(0x4f4e023b426bf442), -W64LIT(0xe5bfb49cedaecbed), -W64LIT(0x8a760d7d58405d58), -W64LIT(0xe2ac9c2a0e66190e), -W64LIT(0xb5fd90b077e93e77), -W64LIT(0xdcb4d0044b3e1b4b), -W64LIT(0x453bfcc42c20d42c), -W64LIT(0xed191d5057f22957), -W64LIT(0xe1ec1afab080bab0), -W64LIT(0xee599b80e9148ae9), -W64LIT(0x2607428f7ebcd17e), -W64LIT(0x5d24f26517c40717), -W64LIT(0x6a09c66482318682), -W64LIT(0xa604b10d48b7ac48), -W64LIT(0xbe1bbfac73537f73), -W64LIT(0x282112164dd9804d), -W64LIT(0x7505e0735a1d875a), -W64LIT(0x73851926d32434d3), -W64LIT(0xd974af817ce10b7c), -W64LIT(0xeb99e405decb9ade), -W64LIT(0x9b5c7bf3b3090db3), -W64LIT(0xfab3928b3582ca35), -W64LIT(0x8003f382360b7d36), -W64LIT(0x94e9fa89ea9d3dea), -W64LIT(0xb1ae3ed62ac74f2a), -W64LIT(0x9acfaa10d9f86cd9), -W64LIT(0x390b6498a690d0a6), -W64LIT(0xf2153b478fde288f), -W64LIT(0x71564e150733f607), -W64LIT(0xa3c4ce887f68bc7f), -W64LIT(0xaaf1b6a7afc53faf), -W64LIT(0x1ddf71240c3bc30c), -W64LIT(0x77d6b7408e0a458e), -W64LIT(0x2b6194c6f33f23f3), -W64LIT(0xc9cd08ecfd593afd), -W64LIT(0xc85ed90f97a85b97), -W64LIT(0x8cf6f428d179eed1), -W64LIT(0x957a2b6a806c5c80), -W64LIT(0xbbdbc029448c6f44), -W64LIT(0x7863363ad79e75d7), -W64LIT(0x6e5a6802df1ff7df), -W64LIT(0xfb2043685f73ab5f), -}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/simple.cpp b/external/crypto++-5.6.3/simple.cpp deleted file mode 100644 index 82564dae3..000000000 --- a/external/crypto++-5.6.3/simple.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// simple.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "simple.h" - -NAMESPACE_BEGIN(CryptoPP) - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/simple.h b/external/crypto++-5.6.3/simple.h deleted file mode 100644 index c1cd1c92f..000000000 --- a/external/crypto++-5.6.3/simple.h +++ /dev/null @@ -1,289 +0,0 @@ -// simple.h - written and placed in the public domain by Wei Dai - -//! \file simple.h -//! \brief Classes providing simple keying interfaces. - -#ifndef CRYPTOPP_SIMPLE_H -#define CRYPTOPP_SIMPLE_H - -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4127 4189) -#endif - -#include "cryptlib.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class ClonableImpl -//! \brief Base class for identifying alogorithm -//! \tparam BASE base class from which to derive -//! \tparam DERIVED class which to clone -template -class CRYPTOPP_NO_VTABLE ClonableImpl : public BASE -{ -public: - Clonable * Clone() const {return new DERIVED(*static_cast(this));} -}; - -//! \class AlgorithmImpl -//! \brief Base class for identifying alogorithm -//! \tparam BASE an Algorithm derived class -//! \tparam ALGORITHM_INFO an Algorithm derived class -//! \details AlgorithmImpl provides StaticAlgorithmName from the template parameter BASE -template -class CRYPTOPP_NO_VTABLE AlgorithmImpl : public BASE -{ -public: - static std::string CRYPTOPP_API StaticAlgorithmName() {return ALGORITHM_INFO::StaticAlgorithmName();} - std::string AlgorithmName() const {return ALGORITHM_INFO::StaticAlgorithmName();} -}; - -//! \class InvalidKeyLength -//! \brief Exception thrown when an invalid key length is encountered -class CRYPTOPP_DLL InvalidKeyLength : public InvalidArgument -{ -public: - explicit InvalidKeyLength(const std::string &algorithm, size_t length) : InvalidArgument(algorithm + ": " + IntToString(length) + " is not a valid key length") {} -}; - -//! \class InvalidRounds -//! \brief Exception thrown when an invalid number of rounds is encountered -class CRYPTOPP_DLL InvalidRounds : public InvalidArgument -{ -public: - explicit InvalidRounds(const std::string &algorithm, unsigned int rounds) : InvalidArgument(algorithm + ": " + IntToString(rounds) + " is not a valid number of rounds") {} -}; - -// ***************************** - -//! \class Bufferless -//! \brief Base class for bufferless filters -//! \tparam T the class or type -template -class CRYPTOPP_NO_VTABLE Bufferless : public T -{ -public: - bool IsolatedFlush(bool hardFlush, bool blocking) - {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); return false;} -}; - -//! \class Unflushable -//! \brief Base class for unflushable filters -//! \tparam T the class or type -template -class CRYPTOPP_NO_VTABLE Unflushable : public T -{ -public: - bool Flush(bool completeFlush, int propagation=-1, bool blocking=true) - {return ChannelFlush(DEFAULT_CHANNEL, completeFlush, propagation, blocking);} - bool IsolatedFlush(bool hardFlush, bool blocking) - {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); assert(false); return false;} - bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) - { - if (hardFlush && !InputBufferIsEmpty()) - throw CannotFlush("Unflushable: this object has buffered input that cannot be flushed"); - else - { - BufferedTransformation *attached = this->AttachedTransformation(); - return attached && propagation ? attached->ChannelFlush(channel, hardFlush, propagation-1, blocking) : false; - } - } - -protected: - virtual bool InputBufferIsEmpty() const {return false;} -}; - -//! \class InputRejecting -//! \brief Base class for input rejecting filters -//! \tparam T the class or type -//! \details T should be a BufferedTransformation derived class -template -class CRYPTOPP_NO_VTABLE InputRejecting : public T -{ -public: - struct InputRejected : public NotImplemented - {InputRejected() : NotImplemented("BufferedTransformation: this object doesn't allow input") {}}; - - //! \name INPUT - //@{ - - //! \brief Input a byte array for processing - //! \param inString the byte array to process - //! \param length the size of the string, in bytes - //! \param messageEnd means how many filters to signal MessageEnd() to, including this one - //! \param blocking specifies whether the object should block when processing input - //! \throws InputRejected - //! \returns the number of bytes that remain in the block (i.e., bytes not processed) - //! \details Internally, the default implmentation throws InputRejected. - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); throw InputRejected();} - //@} - - //! \name SIGNALS - //@{ - bool IsolatedFlush(bool hardFlush, bool blocking) - {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); return false;} - bool IsolatedMessageSeriesEnd(bool blocking) - {CRYPTOPP_UNUSED(blocking); throw InputRejected();} - size_t ChannelPut2(const std::string &channel, const byte *inString, size_t length, int messageEnd, bool blocking) - {CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); throw InputRejected();} - bool ChannelMessageSeriesEnd(const std::string& channel, int messageEnd, bool blocking) - {CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); throw InputRejected();} - //@} -}; - -//! \class CustomFlushPropagation -//! \brief Provides interface for custom flush signals -//! \tparam T the class or type -//! \details T should be a BufferedTransformation derived class -template -class CRYPTOPP_NO_VTABLE CustomFlushPropagation : public T -{ -public: - //! \name SIGNALS - //@{ - virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) =0; - //@} - -private: - bool IsolatedFlush(bool hardFlush, bool blocking) - {CRYPTOPP_UNUSED(hardFlush); CRYPTOPP_UNUSED(blocking); assert(false); return false;} -}; - -//! \class CustomSignalPropagation -//! \brief Provides interface for initialization of derived filters -//! \tparam T the class or type -//! \details T should be a BufferedTransformation derived class -template -class CRYPTOPP_NO_VTABLE CustomSignalPropagation : public CustomFlushPropagation -{ -public: - virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1) =0; - -private: - void IsolatedInitialize(const NameValuePairs ¶meters) - {CRYPTOPP_UNUSED(parameters); assert(false);} -}; - -//! \class Multichannel -//! \brief Provides multiple channels support for custom flush signal processing -//! \tparam T the class or type -//! \details T should be a BufferedTransformation derived class -template -class CRYPTOPP_NO_VTABLE Multichannel : public CustomFlushPropagation -{ -public: - bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) - {return this->ChannelFlush(DEFAULT_CHANNEL, hardFlush, propagation, blocking);} - bool MessageSeriesEnd(int propagation=-1, bool blocking=true) - {return this->ChannelMessageSeriesEnd(DEFAULT_CHANNEL, propagation, blocking);} - byte * CreatePutSpace(size_t &size) - {return this->ChannelCreatePutSpace(DEFAULT_CHANNEL, size);} - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - {return this->ChannelPut2(DEFAULT_CHANNEL, inString, length, messageEnd, blocking);} - size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking) - {return this->ChannelPutModifiable2(DEFAULT_CHANNEL, inString, length, messageEnd, blocking);} - -// void ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1) -// {PropagateMessageSeriesEnd(propagation, channel);} - byte * ChannelCreatePutSpace(const std::string &channel, size_t &size) - {CRYPTOPP_UNUSED(channel); size = 0; return NULL;} - bool ChannelPutModifiable(const std::string &channel, byte *inString, size_t length) - {this->ChannelPut(channel, inString, length); return false;} - - virtual size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking) =0; - size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking) - {return ChannelPut2(channel, begin, length, messageEnd, blocking);} - - virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) =0; -}; - -//! \class AutoSignaling -//! \brief Provides auto signaling support -//! \tparam T the class or type -//! \details T should be a BufferedTransformation derived class -template -class CRYPTOPP_NO_VTABLE AutoSignaling : public T -{ -public: - AutoSignaling(int propagation=-1) : m_autoSignalPropagation(propagation) {} - - void SetAutoSignalPropagation(int propagation) - {m_autoSignalPropagation = propagation;} - int GetAutoSignalPropagation() const - {return m_autoSignalPropagation;} - -private: - int m_autoSignalPropagation; -}; - -//! \class Store -//! \brief Acts as a Source for pre-existing, static data -//! \tparam T the class or type -//! \details A BufferedTransformation that only contains pre-existing data as "output" -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Store : public AutoSignaling > -{ -public: - Store() : m_messageEnd(false) {} - - void IsolatedInitialize(const NameValuePairs ¶meters) - { - m_messageEnd = false; - StoreInitialize(parameters); - } - - unsigned int NumberOfMessages() const {return m_messageEnd ? 0 : 1;} - bool GetNextMessage(); - unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const; - -protected: - virtual void StoreInitialize(const NameValuePairs ¶meters) =0; - - bool m_messageEnd; -}; - -//! \class Sink -//! \brief Implementation of BufferedTransformation's attachment interface -//! \details Sink is a cornerstone of the Pipeline trinitiy. Data flows from -//! Sources, through Filters, and then terminates in Sinks. The difference -//! between a Source and Filter is a Source \a pumps data, while a Filter does -//! not. The difference between a Filter and a Sink is a Filter allows an -//! attached transformation, while a Sink does not. -//! \details A Sink doesnot produce any retrievable output. -//! \details See the discussion of BufferedTransformation in cryptlib.h for -//! more details. -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Sink : public BufferedTransformation -{ -public: - size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) - {CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(transferBytes); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking); transferBytes = 0; return 0;} - size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const - {CRYPTOPP_UNUSED(target); CRYPTOPP_UNUSED(begin); CRYPTOPP_UNUSED(end); CRYPTOPP_UNUSED(channel); CRYPTOPP_UNUSED(blocking); return 0;} -}; - -//! \class BitBucket -//! \brief Acts as an input discarding Filter or Sink -//! \tparam T the class or type -//! \details The BitBucket discards all input and returns 0 to the caller -//! to indicate all data was processed. -class CRYPTOPP_DLL BitBucket : public Bufferless -{ -public: - std::string AlgorithmName() const {return "BitBucket";} - void IsolatedInitialize(const NameValuePairs ¶ms) - {CRYPTOPP_UNUSED(params);} - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - {CRYPTOPP_UNUSED(inString); CRYPTOPP_UNUSED(length); CRYPTOPP_UNUSED(messageEnd); CRYPTOPP_UNUSED(blocking); return 0;} -}; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/skipjack.cpp b/external/crypto++-5.6.3/skipjack.cpp deleted file mode 100644 index dad14bd76..000000000 --- a/external/crypto++-5.6.3/skipjack.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// skipjack.cpp - modified by Wei Dai from Paulo Barreto's skipjack32.c, -// which is public domain according to his web site. - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "skipjack.h" - -/* - * Optimized implementation of SKIPJACK algorithm - * - * originally written by Panu Rissanen 1998.06.24 - * optimized by Mark Tillotson 1998.06.25 - * optimized by Paulo Barreto 1998.06.30 - */ - -NAMESPACE_BEGIN(CryptoPP) - -/** - * The F-table byte permutation (see description of the G-box permutation) - */ -const byte SKIPJACK::Base::fTable[256] = { - 0xa3,0xd7,0x09,0x83,0xf8,0x48,0xf6,0xf4,0xb3,0x21,0x15,0x78,0x99,0xb1,0xaf,0xf9, - 0xe7,0x2d,0x4d,0x8a,0xce,0x4c,0xca,0x2e,0x52,0x95,0xd9,0x1e,0x4e,0x38,0x44,0x28, - 0x0a,0xdf,0x02,0xa0,0x17,0xf1,0x60,0x68,0x12,0xb7,0x7a,0xc3,0xe9,0xfa,0x3d,0x53, - 0x96,0x84,0x6b,0xba,0xf2,0x63,0x9a,0x19,0x7c,0xae,0xe5,0xf5,0xf7,0x16,0x6a,0xa2, - 0x39,0xb6,0x7b,0x0f,0xc1,0x93,0x81,0x1b,0xee,0xb4,0x1a,0xea,0xd0,0x91,0x2f,0xb8, - 0x55,0xb9,0xda,0x85,0x3f,0x41,0xbf,0xe0,0x5a,0x58,0x80,0x5f,0x66,0x0b,0xd8,0x90, - 0x35,0xd5,0xc0,0xa7,0x33,0x06,0x65,0x69,0x45,0x00,0x94,0x56,0x6d,0x98,0x9b,0x76, - 0x97,0xfc,0xb2,0xc2,0xb0,0xfe,0xdb,0x20,0xe1,0xeb,0xd6,0xe4,0xdd,0x47,0x4a,0x1d, - 0x42,0xed,0x9e,0x6e,0x49,0x3c,0xcd,0x43,0x27,0xd2,0x07,0xd4,0xde,0xc7,0x67,0x18, - 0x89,0xcb,0x30,0x1f,0x8d,0xc6,0x8f,0xaa,0xc8,0x74,0xdc,0xc9,0x5d,0x5c,0x31,0xa4, - 0x70,0x88,0x61,0x2c,0x9f,0x0d,0x2b,0x87,0x50,0x82,0x54,0x64,0x26,0x7d,0x03,0x40, - 0x34,0x4b,0x1c,0x73,0xd1,0xc4,0xfd,0x3b,0xcc,0xfb,0x7f,0xab,0xe6,0x3e,0x5b,0xa5, - 0xad,0x04,0x23,0x9c,0x14,0x51,0x22,0xf0,0x29,0x79,0x71,0x7e,0xff,0x8c,0x0e,0xe2, - 0x0c,0xef,0xbc,0x72,0x75,0x6f,0x37,0xa1,0xec,0xd3,0x8e,0x62,0x8b,0x86,0x10,0xe8, - 0x08,0x77,0x11,0xbe,0x92,0x4f,0x24,0xc5,0x32,0x36,0x9d,0xcf,0xf3,0xa6,0xbb,0xac, - 0x5e,0x6c,0xa9,0x13,0x57,0x25,0xb5,0xe3,0xbd,0xa8,0x3a,0x01,0x05,0x59,0x2a,0x46 -}; - -/** - * The key-dependent permutation G on V^16 is a four-round Feistel network. - * The round function is a fixed byte-substitution table (permutation on V^8), - * the F-table. Each round of G incorporates a single byte from the key. - */ -#define g(tab, w, i, j, k, l) \ -{ \ - w ^= (word)tab[i*256 + (w & 0xff)] << 8; \ - w ^= (word)tab[j*256 + (w >> 8)]; \ - w ^= (word)tab[k*256 + (w & 0xff)] << 8; \ - w ^= (word)tab[l*256 + (w >> 8)]; \ -} - -#define g0(tab, w) g(tab, w, 0, 1, 2, 3) -#define g1(tab, w) g(tab, w, 4, 5, 6, 7) -#define g2(tab, w) g(tab, w, 8, 9, 0, 1) -#define g3(tab, w) g(tab, w, 2, 3, 4, 5) -#define g4(tab, w) g(tab, w, 6, 7, 8, 9) - -/** - * The inverse of the G permutation. - */ -#define h(tab, w, i, j, k, l) \ -{ \ - w ^= (word)tab[l*256 + (w >> 8)]; \ - w ^= (word)tab[k*256 + (w & 0xff)] << 8; \ - w ^= (word)tab[j*256 + (w >> 8)]; \ - w ^= (word)tab[i*256 + (w & 0xff)] << 8; \ -} - -#define h0(tab, w) h(tab, w, 0, 1, 2, 3) -#define h1(tab, w) h(tab, w, 4, 5, 6, 7) -#define h2(tab, w) h(tab, w, 8, 9, 0, 1) -#define h3(tab, w) h(tab, w, 2, 3, 4, 5) -#define h4(tab, w) h(tab, w, 6, 7, 8, 9) - -/** - * Preprocess a user key into a table to save an XOR at each F-table access. - */ -void SKIPJACK::Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - /* tab[i][c] = fTable[c ^ key[i]] */ - int i; - for (i = 0; i < 10; i++) { - byte *t = tab+i*256, k = key[9-i]; - int c; - for (c = 0; c < 256; c++) { - t[c] = fTable[c ^ k]; - } - } -} - -typedef BlockGetAndPut Block; - -/** - * Encrypt a single block of data. - */ -void SKIPJACK::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word16 w1, w2, w3, w4; - Block::Get(inBlock)(w4)(w3)(w2)(w1); - - /* stepping rule A: */ - g0(tab, w1); w4 ^= w1 ^ 1; - g1(tab, w4); w3 ^= w4 ^ 2; - g2(tab, w3); w2 ^= w3 ^ 3; - g3(tab, w2); w1 ^= w2 ^ 4; - g4(tab, w1); w4 ^= w1 ^ 5; - g0(tab, w4); w3 ^= w4 ^ 6; - g1(tab, w3); w2 ^= w3 ^ 7; - g2(tab, w2); w1 ^= w2 ^ 8; - - /* stepping rule B: */ - w2 ^= w1 ^ 9; g3(tab, w1); - w1 ^= w4 ^ 10; g4(tab, w4); - w4 ^= w3 ^ 11; g0(tab, w3); - w3 ^= w2 ^ 12; g1(tab, w2); - w2 ^= w1 ^ 13; g2(tab, w1); - w1 ^= w4 ^ 14; g3(tab, w4); - w4 ^= w3 ^ 15; g4(tab, w3); - w3 ^= w2 ^ 16; g0(tab, w2); - - /* stepping rule A: */ - g1(tab, w1); w4 ^= w1 ^ 17; - g2(tab, w4); w3 ^= w4 ^ 18; - g3(tab, w3); w2 ^= w3 ^ 19; - g4(tab, w2); w1 ^= w2 ^ 20; - g0(tab, w1); w4 ^= w1 ^ 21; - g1(tab, w4); w3 ^= w4 ^ 22; - g2(tab, w3); w2 ^= w3 ^ 23; - g3(tab, w2); w1 ^= w2 ^ 24; - - /* stepping rule B: */ - w2 ^= w1 ^ 25; g4(tab, w1); - w1 ^= w4 ^ 26; g0(tab, w4); - w4 ^= w3 ^ 27; g1(tab, w3); - w3 ^= w2 ^ 28; g2(tab, w2); - w2 ^= w1 ^ 29; g3(tab, w1); - w1 ^= w4 ^ 30; g4(tab, w4); - w4 ^= w3 ^ 31; g0(tab, w3); - w3 ^= w2 ^ 32; g1(tab, w2); - - Block::Put(xorBlock, outBlock)(w4)(w3)(w2)(w1); -} - -/** - * Decrypt a single block of data. - */ -void SKIPJACK::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word16 w1, w2, w3, w4; - Block::Get(inBlock)(w4)(w3)(w2)(w1); - - /* stepping rule A: */ - h1(tab, w2); w3 ^= w2 ^ 32; - h0(tab, w3); w4 ^= w3 ^ 31; - h4(tab, w4); w1 ^= w4 ^ 30; - h3(tab, w1); w2 ^= w1 ^ 29; - h2(tab, w2); w3 ^= w2 ^ 28; - h1(tab, w3); w4 ^= w3 ^ 27; - h0(tab, w4); w1 ^= w4 ^ 26; - h4(tab, w1); w2 ^= w1 ^ 25; - - /* stepping rule B: */ - w1 ^= w2 ^ 24; h3(tab, w2); - w2 ^= w3 ^ 23; h2(tab, w3); - w3 ^= w4 ^ 22; h1(tab, w4); - w4 ^= w1 ^ 21; h0(tab, w1); - w1 ^= w2 ^ 20; h4(tab, w2); - w2 ^= w3 ^ 19; h3(tab, w3); - w3 ^= w4 ^ 18; h2(tab, w4); - w4 ^= w1 ^ 17; h1(tab, w1); - - /* stepping rule A: */ - h0(tab, w2); w3 ^= w2 ^ 16; - h4(tab, w3); w4 ^= w3 ^ 15; - h3(tab, w4); w1 ^= w4 ^ 14; - h2(tab, w1); w2 ^= w1 ^ 13; - h1(tab, w2); w3 ^= w2 ^ 12; - h0(tab, w3); w4 ^= w3 ^ 11; - h4(tab, w4); w1 ^= w4 ^ 10; - h3(tab, w1); w2 ^= w1 ^ 9; - - /* stepping rule B: */ - w1 ^= w2 ^ 8; h2(tab, w2); - w2 ^= w3 ^ 7; h1(tab, w3); - w3 ^= w4 ^ 6; h0(tab, w4); - w4 ^= w1 ^ 5; h4(tab, w1); - w1 ^= w2 ^ 4; h3(tab, w2); - w2 ^= w3 ^ 3; h2(tab, w3); - w3 ^= w4 ^ 2; h1(tab, w4); - w4 ^= w1 ^ 1; h0(tab, w1); - - Block::Put(xorBlock, outBlock)(w4)(w3)(w2)(w1); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/skipjack.h b/external/crypto++-5.6.3/skipjack.h deleted file mode 100644 index 76960a5aa..000000000 --- a/external/crypto++-5.6.3/skipjack.h +++ /dev/null @@ -1,63 +0,0 @@ -// skipjack.h - written and placed in the public domain by Wei Dai - -//! \file skipjack.h -//! \brief Classes for the SKIPJACK block cipher - -#ifndef CRYPTOPP_SKIPJACK_H -#define CRYPTOPP_SKIPJACK_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10> -{ - CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "SKIPJACK";} -}; - -/// SKIPJACK -class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} - - protected: - static const byte fTable[256]; - - FixedSizeSecBlock tab; - }; - - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - private: - static const byte Se[256]; - static const word32 Te[4][256]; - }; - - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - private: - static const byte Sd[256]; - static const word32 Td[4][256]; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef SKIPJACK::Encryption SKIPJACKEncryption; -typedef SKIPJACK::Decryption SKIPJACKDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/smartptr.h b/external/crypto++-5.6.3/smartptr.h deleted file mode 100644 index bf06f5f86..000000000 --- a/external/crypto++-5.6.3/smartptr.h +++ /dev/null @@ -1,321 +0,0 @@ -// smartptr.h - written and placed in the public domain by Wei Dai - -//! \file -//! \headerfile smartptr.h -//! \brief Classes for automatic resource management - -#ifndef CRYPTOPP_SMARTPTR_H -#define CRYPTOPP_SMARTPTR_H - -#include "config.h" -#include "stdcpp.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! \class simple_ptr -//! \brief Manages resources for a single object -//! \tparam T class or type -//! \details \p simple_ptr is used frequently in the library to manage resources and -//! ensure cleanup under the RAII pattern (Resource Acquisition Is Initialization). -template class simple_ptr -{ -public: - simple_ptr(T *p = NULL) : m_p(p) {} - ~simple_ptr() - { - delete m_p; - *((volatile T**)&m_p) = NULL; - } - - T *m_p; -}; - -//! \class member_ptr -//! \brief Pointer that overloads operator→ -//! \tparam T class or type -//! \details member_ptr is used frequently in the library to avoid the issues related to -//! std::auto_ptr in C++11 (deprecated) and std::unique_ptr in C++03 (non-existent). -//! \bug Issue 48: "Use of auto_ptr causes dirty compile under C++11" -template class member_ptr -{ -public: - explicit member_ptr(T *p = NULL) : m_p(p) {} - - ~member_ptr(); - - const T& operator*() const { return *m_p; } - T& operator*() { return *m_p; } - - const T* operator->() const { return m_p; } - T* operator->() { return m_p; } - - const T* get() const { return m_p; } - T* get() { return m_p; } - - T* release() - { - T *old_p = m_p; - *((volatile T**)&m_p) = NULL; - return old_p; - } - - void reset(T *p = 0); - -protected: - member_ptr(const member_ptr& rhs); // copy not allowed - void operator=(const member_ptr& rhs); // assignment not allowed - - T *m_p; -}; - -template member_ptr::~member_ptr() {delete m_p;} -template void member_ptr::reset(T *p) {delete m_p; m_p = p;} - -// ******************************************************** - -//! \class value_ptr -//! \brief Value pointer -//! \tparam T class or type -template class value_ptr : public member_ptr -{ -public: - value_ptr(const T &obj) : member_ptr(new T(obj)) {} - value_ptr(T *p = NULL) : member_ptr(p) {} - value_ptr(const value_ptr& rhs) - : member_ptr(rhs.m_p ? new T(*rhs.m_p) : NULL) {} - - value_ptr& operator=(const value_ptr& rhs); - bool operator==(const value_ptr& rhs) - { - return (!this->m_p && !rhs.m_p) || (this->m_p && rhs.m_p && *this->m_p == *rhs.m_p); - } -}; - -template value_ptr& value_ptr::operator=(const value_ptr& rhs) -{ - T *old_p = this->m_p; - this->m_p = rhs.m_p ? new T(*rhs.m_p) : NULL; - delete old_p; - return *this; -} - -// ******************************************************** - -//! \class clonable_ptr -//! \brief A pointer which can be copied and cloned -//! \tparam T class or type -//! \details \p T should adhere to the \p Clonable interface -template class clonable_ptr : public member_ptr -{ -public: - clonable_ptr(const T &obj) : member_ptr(obj.Clone()) {} - clonable_ptr(T *p = NULL) : member_ptr(p) {} - clonable_ptr(const clonable_ptr& rhs) - : member_ptr(rhs.m_p ? rhs.m_p->Clone() : NULL) {} - - clonable_ptr& operator=(const clonable_ptr& rhs); -}; - -template clonable_ptr& clonable_ptr::operator=(const clonable_ptr& rhs) -{ - T *old_p = this->m_p; - this->m_p = rhs.m_p ? rhs.m_p->Clone() : NULL; - delete old_p; - return *this; -} - -// ******************************************************** - -//! \class counted_ptr -//! \brief Reference counted pointer -//! \tparam T class or type -//! \details users should declare \p m_referenceCount as std::atomic -//! (or similar) under C++ 11 -template class counted_ptr -{ -public: - explicit counted_ptr(T *p = 0); - counted_ptr(const T &r) : m_p(0) {attach(r);} - counted_ptr(const counted_ptr& rhs); - - ~counted_ptr(); - - const T& operator*() const { return *m_p; } - T& operator*() { return *m_p; } - - const T* operator->() const { return m_p; } - T* operator->() { return get(); } - - const T* get() const { return m_p; } - T* get(); - - void attach(const T &p); - - counted_ptr & operator=(const counted_ptr& rhs); - -private: - T *m_p; -}; - -template counted_ptr::counted_ptr(T *p) - : m_p(p) -{ - if (m_p) - m_p->m_referenceCount = 1; -} - -template counted_ptr::counted_ptr(const counted_ptr& rhs) - : m_p(rhs.m_p) -{ - if (m_p) - m_p->m_referenceCount++; -} - -template counted_ptr::~counted_ptr() -{ - if (m_p && --m_p->m_referenceCount == 0) - delete m_p; -} - -template void counted_ptr::attach(const T &r) -{ - if (m_p && --m_p->m_referenceCount == 0) - delete m_p; - if (r.m_referenceCount == 0) - { - m_p = r.clone(); - m_p->m_referenceCount = 1; - } - else - { - m_p = const_cast(&r); - m_p->m_referenceCount++; - } -} - -template T* counted_ptr::get() -{ - if (m_p && m_p->m_referenceCount > 1) - { - T *temp = m_p->clone(); - m_p->m_referenceCount--; - m_p = temp; - m_p->m_referenceCount = 1; - } - return m_p; -} - -template counted_ptr & counted_ptr::operator=(const counted_ptr& rhs) -{ - if (m_p != rhs.m_p) - { - if (m_p && --m_p->m_referenceCount == 0) - delete m_p; - m_p = rhs.m_p; - if (m_p) - m_p->m_referenceCount++; - } - return *this; -} - -// ******************************************************** - -//! \class vector_ptr -//! \brief Manages resources for an array of objects -//! \tparam T class or type -//! \details \p vector_ptr is used frequently in the library to avoid large stack allocations, -//! and manage resources and ensure cleanup under the RAII pattern (Resource Acquisition -//! Is Initialization). -template class vector_ptr -{ -public: - //! Construct an arry of \p T - //! \param size the size of the array, in elements - //! \details If \p T is a Plain Old Dataype (POD), then the array is uninitialized. - vector_ptr(size_t size=0) - : m_size(size), m_ptr(new T[m_size]) {} - ~vector_ptr() - {delete [] m_ptr;} - - T& operator[](size_t index) - {assert(m_size && indexm_size); return this->m_ptr[index];} - const T& operator[](size_t index) const - {assert(m_size && indexm_size); return this->m_ptr[index];} - - size_t size() const {return this->m_size;} - void resize(size_t newSize) - { - T *newPtr = new T[newSize]; - for (size_t i=0; im_size && im_ptr; - this->m_size = newSize; - this->m_ptr = newPtr; - } - -#ifdef __BORLANDC__ - operator T *() const - {return (T*)m_ptr;} -#else - operator const void *() const - {return m_ptr;} - operator void *() - {return m_ptr;} - - operator const T *() const - {return m_ptr;} - operator T *() - {return m_ptr;} -#endif - -private: - vector_ptr(const vector_ptr &c); // copy not allowed - void operator=(const vector_ptr &x); // assignment not allowed - - size_t m_size; - T *m_ptr; -}; - -// ******************************************************** - -//! \class vector_member_ptrs -//! \brief Manages resources for an array of objects -//! \tparam T class or type -template class vector_member_ptrs -{ -public: - //! Construct an arry of \p T - //! \param size the size of the array, in elements - //! \details If \p T is a Plain Old Dataype (POD), then the array is uninitialized. - vector_member_ptrs(size_t size=0) - : m_size(size), m_ptr(new member_ptr[size]) {} - ~vector_member_ptrs() - {delete [] this->m_ptr;} - - member_ptr& operator[](size_t index) - {assert(indexm_size); return this->m_ptr[index];} - const member_ptr& operator[](size_t index) const - {assert(indexm_size); return this->m_ptr[index];} - - size_t size() const {return this->m_size;} - void resize(size_t newSize) - { - member_ptr *newPtr = new member_ptr[newSize]; - for (size_t i=0; im_size && im_ptr[i].release()); - delete [] this->m_ptr; - this->m_size = newSize; - this->m_ptr = newPtr; - } - -private: - vector_member_ptrs(const vector_member_ptrs &c); // copy not allowed - void operator=(const vector_member_ptrs &x); // assignment not allowed - - size_t m_size; - member_ptr *m_ptr; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/socketft.cpp b/external/crypto++-5.6.3/socketft.cpp deleted file mode 100644 index 21ba01f75..000000000 --- a/external/crypto++-5.6.3/socketft.cpp +++ /dev/null @@ -1,546 +0,0 @@ -// socketft.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -// TODO: http://github.com/weidai11/cryptopp/issues/19 -#define _WINSOCK_DEPRECATED_NO_WARNINGS -#include "socketft.h" - -#ifdef SOCKETS_AVAILABLE - -#include "wait.h" - -#ifdef USE_BERKELEY_STYLE_SOCKETS -#include -#include -#include -#include -#include -#include -#endif - -#ifdef PREFER_WINDOWS_STYLE_SOCKETS -# pragma comment(lib, "ws2_32.lib") -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#ifdef USE_WINDOWS_STYLE_SOCKETS -const int SOCKET_EINVAL = WSAEINVAL; -const int SOCKET_EWOULDBLOCK = WSAEWOULDBLOCK; -typedef int socklen_t; -#else -const int SOCKET_EINVAL = EINVAL; -const int SOCKET_EWOULDBLOCK = EWOULDBLOCK; -#endif - -// Solaris doesn't have INADDR_NONE -#ifndef INADDR_NONE -# define INADDR_NONE 0xffffffff -#endif /* INADDR_NONE */ - -Socket::Err::Err(socket_t s, const std::string& operation, int error) - : OS_Error(IO_ERROR, "Socket: " + operation + " operation failed with error " + IntToString(error), operation, error) - , m_s(s) -{ -} - -Socket::~Socket() -{ - if (m_own) - { - try - { - CloseSocket(); - } - catch (const Exception&) - { - assert(0); - } - } -} - -void Socket::AttachSocket(socket_t s, bool own) -{ - if (m_own) - CloseSocket(); - - m_s = s; - m_own = own; - SocketChanged(); -} - -socket_t Socket::DetachSocket() -{ - socket_t s = m_s; - m_s = INVALID_SOCKET; - SocketChanged(); - return s; -} - -void Socket::Create(int nType) -{ - assert(m_s == INVALID_SOCKET); - m_s = socket(AF_INET, nType, 0); - CheckAndHandleError("socket", m_s); - m_own = true; - SocketChanged(); -} - -void Socket::CloseSocket() -{ - if (m_s != INVALID_SOCKET) - { -#ifdef USE_WINDOWS_STYLE_SOCKETS - CancelIo((HANDLE) m_s); - CheckAndHandleError_int("closesocket", closesocket(m_s)); -#else - CheckAndHandleError_int("close", close(m_s)); -#endif - m_s = INVALID_SOCKET; - SocketChanged(); - } -} - -void Socket::Bind(unsigned int port, const char *addr) -{ - sockaddr_in sa; - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; - - if (addr == NULL) - sa.sin_addr.s_addr = htonl(INADDR_ANY); - else - { - unsigned long result = inet_addr(addr); - if (result == INADDR_NONE) - { - SetLastError(SOCKET_EINVAL); - CheckAndHandleError_int("inet_addr", SOCKET_ERROR); - } - sa.sin_addr.s_addr = result; - } - - sa.sin_port = htons((u_short)port); - - Bind((sockaddr *)&sa, sizeof(sa)); -} - -void Socket::Bind(const sockaddr *psa, socklen_t saLen) -{ - assert(m_s != INVALID_SOCKET); - // cygwin workaround: needs const_cast - CheckAndHandleError_int("bind", bind(m_s, const_cast(psa), saLen)); -} - -void Socket::Listen(int backlog) -{ - assert(m_s != INVALID_SOCKET); - CheckAndHandleError_int("listen", listen(m_s, backlog)); -} - -bool Socket::Connect(const char *addr, unsigned int port) -{ - assert(addr != NULL); - - sockaddr_in sa; - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; - sa.sin_addr.s_addr = inet_addr(addr); - - if (sa.sin_addr.s_addr == INADDR_NONE) - { - hostent *lphost = gethostbyname(addr); - if (lphost == NULL) - { - SetLastError(SOCKET_EINVAL); - CheckAndHandleError_int("gethostbyname", SOCKET_ERROR); - } - else - { - sa.sin_addr.s_addr = ((in_addr *)lphost->h_addr)->s_addr; - } - } - - sa.sin_port = htons((u_short)port); - - return Connect((const sockaddr *)&sa, sizeof(sa)); -} - -bool Socket::Connect(const sockaddr* psa, socklen_t saLen) -{ - assert(m_s != INVALID_SOCKET); - int result = connect(m_s, const_cast(psa), saLen); - if (result == SOCKET_ERROR && GetLastError() == SOCKET_EWOULDBLOCK) - return false; - CheckAndHandleError_int("connect", result); - return true; -} - -bool Socket::Accept(Socket& target, sockaddr *psa, socklen_t *psaLen) -{ - assert(m_s != INVALID_SOCKET); - socket_t s = accept(m_s, psa, psaLen); - if (s == INVALID_SOCKET && GetLastError() == SOCKET_EWOULDBLOCK) - return false; - CheckAndHandleError("accept", s); - target.AttachSocket(s, true); - return true; -} - -void Socket::GetSockName(sockaddr *psa, socklen_t *psaLen) -{ - assert(m_s != INVALID_SOCKET); - CheckAndHandleError_int("getsockname", getsockname(m_s, psa, psaLen)); -} - -void Socket::GetPeerName(sockaddr *psa, socklen_t *psaLen) -{ - assert(m_s != INVALID_SOCKET); - CheckAndHandleError_int("getpeername", getpeername(m_s, psa, psaLen)); -} - -unsigned int Socket::Send(const byte* buf, size_t bufLen, int flags) -{ - assert(m_s != INVALID_SOCKET); - int result = send(m_s, (const char *)buf, UnsignedMin(INT_MAX, bufLen), flags); - CheckAndHandleError_int("send", result); - return result; -} - -unsigned int Socket::Receive(byte* buf, size_t bufLen, int flags) -{ - assert(m_s != INVALID_SOCKET); - int result = recv(m_s, (char *)buf, UnsignedMin(INT_MAX, bufLen), flags); - CheckAndHandleError_int("recv", result); - return result; -} - -void Socket::ShutDown(int how) -{ - assert(m_s != INVALID_SOCKET); - int result = shutdown(m_s, how); - CheckAndHandleError_int("shutdown", result); -} - -void Socket::IOCtl(long cmd, unsigned long *argp) -{ - assert(m_s != INVALID_SOCKET); -#ifdef USE_WINDOWS_STYLE_SOCKETS - CheckAndHandleError_int("ioctlsocket", ioctlsocket(m_s, cmd, argp)); -#else - CheckAndHandleError_int("ioctl", ioctl(m_s, cmd, argp)); -#endif -} - -bool Socket::SendReady(const timeval *timeout) -{ - fd_set fds; - FD_ZERO(&fds); - FD_SET(m_s, &fds); - int ready; - if (timeout == NULL) - ready = select((int)m_s+1, NULL, &fds, NULL, NULL); - else - { - timeval timeoutCopy = *timeout; // select() modified timeout on Linux - ready = select((int)m_s+1, NULL, &fds, NULL, &timeoutCopy); - } - CheckAndHandleError_int("select", ready); - return ready > 0; -} - -bool Socket::ReceiveReady(const timeval *timeout) -{ - fd_set fds; - FD_ZERO(&fds); - FD_SET(m_s, &fds); - int ready; - if (timeout == NULL) - ready = select((int)m_s+1, &fds, NULL, NULL, NULL); - else - { - timeval timeoutCopy = *timeout; // select() modified timeout on Linux - ready = select((int)m_s+1, &fds, NULL, NULL, &timeoutCopy); - } - CheckAndHandleError_int("select", ready); - return ready > 0; -} - -unsigned int Socket::PortNameToNumber(const char *name, const char *protocol) -{ - int port = atoi(name); - if (IntToString(port) == name) - return port; - - servent *se = getservbyname(name, protocol); - if (!se) - throw Err(INVALID_SOCKET, "getservbyname", SOCKET_EINVAL); - return ntohs(se->s_port); -} - -void Socket::StartSockets() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - WSADATA wsd; - int result = WSAStartup(0x0202, &wsd); - if (result != 0) - throw Err(INVALID_SOCKET, "WSAStartup", result); -#endif -} - -void Socket::ShutdownSockets() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - int result = WSACleanup(); - if (result != 0) - throw Err(INVALID_SOCKET, "WSACleanup", result); -#endif -} - -int Socket::GetLastError() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - return WSAGetLastError(); -#else - return errno; -#endif -} - -void Socket::SetLastError(int errorCode) -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - WSASetLastError(errorCode); -#else - errno = errorCode; -#endif -} - -void Socket::HandleError(const char *operation) const -{ - int err = GetLastError(); - throw Err(m_s, operation, err); -} - -#ifdef USE_WINDOWS_STYLE_SOCKETS - -SocketReceiver::SocketReceiver(Socket &s) - : m_s(s), m_eofReceived(false), m_resultPending(false) -{ - m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); - m_s.CheckAndHandleError("CreateEvent", m_event.HandleValid()); - memset(&m_overlapped, 0, sizeof(m_overlapped)); - m_overlapped.hEvent = m_event; -} - -SocketReceiver::~SocketReceiver() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - CancelIo((HANDLE) m_s.GetSocket()); -#endif -} - -bool SocketReceiver::Receive(byte* buf, size_t bufLen) -{ - assert(!m_resultPending && !m_eofReceived); - - DWORD flags = 0; - // don't queue too much at once, or we might use up non-paged memory - WSABUF wsabuf = {UnsignedMin((u_long)128*1024, bufLen), (char *)buf}; - if (WSARecv(m_s, &wsabuf, 1, &m_lastResult, &flags, &m_overlapped, NULL) == 0) - { - if (m_lastResult == 0) - m_eofReceived = true; - } - else - { - switch (WSAGetLastError()) - { - default: - m_s.CheckAndHandleError_int("WSARecv", SOCKET_ERROR); - case WSAEDISCON: - m_lastResult = 0; - m_eofReceived = true; - break; - case WSA_IO_PENDING: - m_resultPending = true; - } - } - return !m_resultPending; -} - -void SocketReceiver::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (m_resultPending) - container.AddHandle(m_event, CallStack("SocketReceiver::GetWaitObjects() - result pending", &callStack)); - else if (!m_eofReceived) - container.SetNoWait(CallStack("SocketReceiver::GetWaitObjects() - result ready", &callStack)); -} - -unsigned int SocketReceiver::GetReceiveResult() -{ - if (m_resultPending) - { - DWORD flags = 0; - if (WSAGetOverlappedResult(m_s, &m_overlapped, &m_lastResult, false, &flags)) - { - if (m_lastResult == 0) - m_eofReceived = true; - } - else - { - switch (WSAGetLastError()) - { - default: - m_s.CheckAndHandleError("WSAGetOverlappedResult", FALSE); - case WSAEDISCON: - m_lastResult = 0; - m_eofReceived = true; - } - } - m_resultPending = false; - } - return m_lastResult; -} - -// ************************************************************* - -SocketSender::SocketSender(Socket &s) - : m_s(s), m_resultPending(false), m_lastResult(0) -{ - m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); - m_s.CheckAndHandleError("CreateEvent", m_event.HandleValid()); - memset(&m_overlapped, 0, sizeof(m_overlapped)); - m_overlapped.hEvent = m_event; -} - - -SocketSender::~SocketSender() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - CancelIo((HANDLE) m_s.GetSocket()); -#endif -} - -void SocketSender::Send(const byte* buf, size_t bufLen) -{ - assert(!m_resultPending); - DWORD written = 0; - // don't queue too much at once, or we might use up non-paged memory - WSABUF wsabuf = {UnsignedMin((u_long)128*1024, bufLen), (char *)buf}; - if (WSASend(m_s, &wsabuf, 1, &written, 0, &m_overlapped, NULL) == 0) - { - m_resultPending = false; - m_lastResult = written; - } - else - { - if (WSAGetLastError() != WSA_IO_PENDING) - m_s.CheckAndHandleError_int("WSASend", SOCKET_ERROR); - - m_resultPending = true; - } -} - -void SocketSender::SendEof() -{ - assert(!m_resultPending); - m_s.ShutDown(SD_SEND); - m_s.CheckAndHandleError("ResetEvent", ResetEvent(m_event)); - m_s.CheckAndHandleError_int("WSAEventSelect", WSAEventSelect(m_s, m_event, FD_CLOSE)); - m_resultPending = true; -} - -bool SocketSender::EofSent() -{ - if (m_resultPending) - { - WSANETWORKEVENTS events; - m_s.CheckAndHandleError_int("WSAEnumNetworkEvents", WSAEnumNetworkEvents(m_s, m_event, &events)); - if ((events.lNetworkEvents & FD_CLOSE) != FD_CLOSE) - throw Socket::Err(m_s, "WSAEnumNetworkEvents (FD_CLOSE not present)", E_FAIL); - if (events.iErrorCode[FD_CLOSE_BIT] != 0) - throw Socket::Err(m_s, "FD_CLOSE (via WSAEnumNetworkEvents)", events.iErrorCode[FD_CLOSE_BIT]); - m_resultPending = false; - } - return m_lastResult != 0; -} - -void SocketSender::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (m_resultPending) - container.AddHandle(m_event, CallStack("SocketSender::GetWaitObjects() - result pending", &callStack)); - else - container.SetNoWait(CallStack("SocketSender::GetWaitObjects() - result ready", &callStack)); -} - -unsigned int SocketSender::GetSendResult() -{ - if (m_resultPending) - { - DWORD flags = 0; - BOOL result = WSAGetOverlappedResult(m_s, &m_overlapped, &m_lastResult, false, &flags); - m_s.CheckAndHandleError("WSAGetOverlappedResult", result); - m_resultPending = false; - } - return m_lastResult; -} - -#endif - -#ifdef USE_BERKELEY_STYLE_SOCKETS - -SocketReceiver::SocketReceiver(Socket &s) - : m_s(s), m_eofReceived(false), m_lastResult(0) -{ -} - -void SocketReceiver::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (!m_eofReceived) - container.AddReadFd(m_s, CallStack("SocketReceiver::GetWaitObjects()", &callStack)); -} - -bool SocketReceiver::Receive(byte* buf, size_t bufLen) -{ - m_lastResult = m_s.Receive(buf, bufLen); - if (bufLen > 0 && m_lastResult == 0) - m_eofReceived = true; - return true; -} - -unsigned int SocketReceiver::GetReceiveResult() -{ - return m_lastResult; -} - -SocketSender::SocketSender(Socket &s) - : m_s(s), m_lastResult(0) -{ -} - -void SocketSender::Send(const byte* buf, size_t bufLen) -{ - m_lastResult = m_s.Send(buf, bufLen); -} - -void SocketSender::SendEof() -{ - m_s.ShutDown(SD_SEND); -} - -unsigned int SocketSender::GetSendResult() -{ - return m_lastResult; -} - -void SocketSender::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - container.AddWriteFd(m_s, CallStack("SocketSender::GetWaitObjects()", &callStack)); -} - -#endif - -NAMESPACE_END - -#endif // #ifdef SOCKETS_AVAILABLE diff --git a/external/crypto++-5.6.3/socketft.h b/external/crypto++-5.6.3/socketft.h deleted file mode 100644 index 7c605582e..000000000 --- a/external/crypto++-5.6.3/socketft.h +++ /dev/null @@ -1,223 +0,0 @@ -#ifndef CRYPTOPP_SOCKETFT_H -#define CRYPTOPP_SOCKETFT_H - -#ifdef SOCKETS_AVAILABLE - -#include "cryptlib.h" -#include "network.h" -#include "queue.h" - -#ifdef USE_WINDOWS_STYLE_SOCKETS -# if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) -# error Winsock 1 is not supported by this library. Please include this file or winsock2.h before windows.h. -# endif -#include -#include "winpipes.h" -#else -#include -#include -#include -#include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#ifdef USE_WINDOWS_STYLE_SOCKETS -typedef ::SOCKET socket_t; -#else -typedef int socket_t; -const socket_t INVALID_SOCKET = -1; -// cygwin 1.1.4 doesn't have SHUT_RD -const int SD_RECEIVE = 0; -const int SD_SEND = 1; -const int SD_BOTH = 2; -const int SOCKET_ERROR = -1; -#endif - -#ifndef socklen_t -typedef TYPE_OF_SOCKLEN_T socklen_t; // see config.h -#endif - -//! wrapper for Windows or Berkeley Sockets -class Socket -{ -public: - //! exception thrown by Socket class - class Err : public OS_Error - { - public: - Err(socket_t s, const std::string& operation, int error); - socket_t GetSocket() const {return m_s;} - - private: - socket_t m_s; - }; - - Socket(socket_t s = INVALID_SOCKET, bool own=false) : m_s(s), m_own(own) {} - Socket(const Socket &s) : m_s(s.m_s), m_own(false) {} - virtual ~Socket(); - - bool GetOwnership() const {return m_own;} - void SetOwnership(bool own) {m_own = own;} - - operator socket_t() {return m_s;} - socket_t GetSocket() const {return m_s;} - void AttachSocket(socket_t s, bool own=false); - socket_t DetachSocket(); - void CloseSocket(); - - void Create(int nType = SOCK_STREAM); - void Bind(unsigned int port, const char *addr=NULL); - void Bind(const sockaddr* psa, socklen_t saLen); - void Listen(int backlog=5); - // the next three functions return false if the socket is in nonblocking mode - // and the operation cannot be completed immediately - bool Connect(const char *addr, unsigned int port); - bool Connect(const sockaddr* psa, socklen_t saLen); - bool Accept(Socket& s, sockaddr *psa=NULL, socklen_t *psaLen=NULL); - void GetSockName(sockaddr *psa, socklen_t *psaLen); - void GetPeerName(sockaddr *psa, socklen_t *psaLen); - unsigned int Send(const byte* buf, size_t bufLen, int flags=0); - unsigned int Receive(byte* buf, size_t bufLen, int flags=0); - void ShutDown(int how = SD_SEND); - - void IOCtl(long cmd, unsigned long *argp); - bool SendReady(const timeval *timeout); - bool ReceiveReady(const timeval *timeout); - - virtual void HandleError(const char *operation) const; - void CheckAndHandleError_int(const char *operation, int result) const - {if (result == SOCKET_ERROR) HandleError(operation);} - void CheckAndHandleError(const char *operation, socket_t result) const - {if (result == static_cast(SOCKET_ERROR)) HandleError(operation);} -#ifdef USE_WINDOWS_STYLE_SOCKETS - void CheckAndHandleError(const char *operation, BOOL result) const - {assert(result==TRUE || result==FALSE); if (!result) HandleError(operation);} - void CheckAndHandleError(const char *operation, bool result) const - {if (!result) HandleError(operation);} -#endif - - //! look up the port number given its name, returns 0 if not found - static unsigned int PortNameToNumber(const char *name, const char *protocol="tcp"); - //! start Windows Sockets 2 - static void StartSockets(); - //! calls WSACleanup for Windows Sockets - static void ShutdownSockets(); - //! returns errno or WSAGetLastError - static int GetLastError(); - //! sets errno or calls WSASetLastError - static void SetLastError(int errorCode); - -protected: - virtual void SocketChanged() {} - - socket_t m_s; - bool m_own; -}; - -class SocketsInitializer -{ -public: - SocketsInitializer() {Socket::StartSockets();} - ~SocketsInitializer() {try {Socket::ShutdownSockets();} catch (const Exception&) {assert(0);}} -}; - -class SocketReceiver : public NetworkReceiver -{ -public: - SocketReceiver(Socket &s); - -#ifdef USE_BERKELEY_STYLE_SOCKETS - bool MustWaitToReceive() {return true;} -#else - ~SocketReceiver(); - bool MustWaitForResult() {return true;} -#endif - bool Receive(byte* buf, size_t bufLen); - unsigned int GetReceiveResult(); - bool EofReceived() const {return m_eofReceived;} - - unsigned int GetMaxWaitObjectCount() const {return 1;} - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - -private: - Socket &m_s; - bool m_eofReceived; - -#ifdef USE_WINDOWS_STYLE_SOCKETS - WindowsHandle m_event; - OVERLAPPED m_overlapped; - bool m_resultPending; - DWORD m_lastResult; -#else - unsigned int m_lastResult; -#endif -}; - -class SocketSender : public NetworkSender -{ -public: - SocketSender(Socket &s); - -#ifdef USE_BERKELEY_STYLE_SOCKETS - bool MustWaitToSend() {return true;} -#else - ~SocketSender(); - bool MustWaitForResult() {return true;} - bool MustWaitForEof() { return true; } - bool EofSent(); -#endif - void Send(const byte* buf, size_t bufLen); - unsigned int GetSendResult(); - void SendEof(); - - unsigned int GetMaxWaitObjectCount() const {return 1;} - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - -private: - Socket &m_s; -#ifdef USE_WINDOWS_STYLE_SOCKETS - WindowsHandle m_event; - OVERLAPPED m_overlapped; - bool m_resultPending; - DWORD m_lastResult; -#else - unsigned int m_lastResult; -#endif -}; - -//! socket-based implementation of NetworkSource -class SocketSource : public NetworkSource, public Socket -{ -public: - SocketSource(socket_t s = INVALID_SOCKET, bool pumpAll = false, BufferedTransformation *attachment = NULL) - : NetworkSource(attachment), Socket(s), m_receiver(*this) - { - if (pumpAll) - PumpAll(); - } - -private: - NetworkReceiver & AccessReceiver() {return m_receiver;} - SocketReceiver m_receiver; -}; - -//! socket-based implementation of NetworkSink -class SocketSink : public NetworkSink, public Socket -{ -public: - SocketSink(socket_t s=INVALID_SOCKET, unsigned int maxBufferSize=0, unsigned int autoFlushBound=16*1024) - : NetworkSink(maxBufferSize, autoFlushBound), Socket(s), m_sender(*this) {} - - void SendEof() {ShutDown(SD_SEND);} - -private: - NetworkSender & AccessSender() {return m_sender;} - SocketSender m_sender; -}; - -NAMESPACE_END - -#endif // #ifdef SOCKETS_AVAILABLE - -#endif diff --git a/external/crypto++-5.6.3/sosemanuk.cpp b/external/crypto++-5.6.3/sosemanuk.cpp deleted file mode 100644 index 76c70037a..000000000 --- a/external/crypto++-5.6.3/sosemanuk.cpp +++ /dev/null @@ -1,717 +0,0 @@ -// sosemanuk.cpp - written and placed in the public domain by Wei Dai - -// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM sosemanuk.cpp" to generate MASM code - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4702 4731) -#endif - -#ifndef CRYPTOPP_GENERATE_X64_MASM - -#include "sosemanuk.h" -#include "serpentp.h" -#include "secblock.h" -#include "misc.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -void SosemanukPolicy::CipherSetKey(const NameValuePairs ¶ms, const byte *userKey, size_t keylen) -{ - CRYPTOPP_UNUSED(params); - Serpent_KeySchedule(m_key, 24, userKey, keylen); -} - -void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) -{ - CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(iv), CRYPTOPP_UNUSED(length); - assert(length==16); - - word32 a, b, c, d, e; - - typedef BlockGetAndPut Block; - Block::Get(iv)(a)(b)(c)(d); - - const word32 *k = m_key; - unsigned int i=1; - - do - { - beforeS0(KX); beforeS0(S0); afterS0(LT); - afterS0(KX); afterS0(S1); afterS1(LT); - if (i == 3) // after 18th round - { - m_state[4] = b; - m_state[5] = e; - m_state[10] = c; - m_state[11] = a; - } - afterS1(KX); afterS1(S2); afterS2(LT); - afterS2(KX); afterS2(S3); afterS3(LT); - if (i == 2) // after 12th round - { - m_state[6] = c; - m_state[7] = d; - m_state[8] = b; - m_state[9] = e; - } - afterS3(KX); afterS3(S4); afterS4(LT); - afterS4(KX); afterS4(S5); afterS5(LT); - afterS5(KX); afterS5(S6); afterS6(LT); - afterS6(KX); afterS6(S7); afterS7(LT); - - if (i == 3) - break; - - ++i; - c = b; - b = e; - e = d; - d = a; - a = e; - k += 32; - } - while (true); - - afterS7(KX); - - m_state[0] = a; - m_state[1] = b; - m_state[2] = e; - m_state[3] = d; - -#define XMUX(c, x, y) (x ^ (y & (0 - (c & 1)))) - m_state[11] += XMUX(m_state[10], m_state[1], m_state[8]); - m_state[10] = rotlFixed(m_state[10] * 0x54655307, 7); -} - -extern "C" { -word32 s_sosemanukMulTables[512] = { -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) - 0x00000000, 0xE19FCF12, 0x6B973724, 0x8A08F836, - 0xD6876E48, 0x3718A15A, 0xBD10596C, 0x5C8F967E, - 0x05A7DC90, 0xE4381382, 0x6E30EBB4, 0x8FAF24A6, - 0xD320B2D8, 0x32BF7DCA, 0xB8B785FC, 0x59284AEE, - 0x0AE71189, 0xEB78DE9B, 0x617026AD, 0x80EFE9BF, - 0xDC607FC1, 0x3DFFB0D3, 0xB7F748E5, 0x566887F7, - 0x0F40CD19, 0xEEDF020B, 0x64D7FA3D, 0x8548352F, - 0xD9C7A351, 0x38586C43, 0xB2509475, 0x53CF5B67, - 0x146722BB, 0xF5F8EDA9, 0x7FF0159F, 0x9E6FDA8D, - 0xC2E04CF3, 0x237F83E1, 0xA9777BD7, 0x48E8B4C5, - 0x11C0FE2B, 0xF05F3139, 0x7A57C90F, 0x9BC8061D, - 0xC7479063, 0x26D85F71, 0xACD0A747, 0x4D4F6855, - 0x1E803332, 0xFF1FFC20, 0x75170416, 0x9488CB04, - 0xC8075D7A, 0x29989268, 0xA3906A5E, 0x420FA54C, - 0x1B27EFA2, 0xFAB820B0, 0x70B0D886, 0x912F1794, - 0xCDA081EA, 0x2C3F4EF8, 0xA637B6CE, 0x47A879DC, - 0x28CE44DF, 0xC9518BCD, 0x435973FB, 0xA2C6BCE9, - 0xFE492A97, 0x1FD6E585, 0x95DE1DB3, 0x7441D2A1, - 0x2D69984F, 0xCCF6575D, 0x46FEAF6B, 0xA7616079, - 0xFBEEF607, 0x1A713915, 0x9079C123, 0x71E60E31, - 0x22295556, 0xC3B69A44, 0x49BE6272, 0xA821AD60, - 0xF4AE3B1E, 0x1531F40C, 0x9F390C3A, 0x7EA6C328, - 0x278E89C6, 0xC61146D4, 0x4C19BEE2, 0xAD8671F0, - 0xF109E78E, 0x1096289C, 0x9A9ED0AA, 0x7B011FB8, - 0x3CA96664, 0xDD36A976, 0x573E5140, 0xB6A19E52, - 0xEA2E082C, 0x0BB1C73E, 0x81B93F08, 0x6026F01A, - 0x390EBAF4, 0xD89175E6, 0x52998DD0, 0xB30642C2, - 0xEF89D4BC, 0x0E161BAE, 0x841EE398, 0x65812C8A, - 0x364E77ED, 0xD7D1B8FF, 0x5DD940C9, 0xBC468FDB, - 0xE0C919A5, 0x0156D6B7, 0x8B5E2E81, 0x6AC1E193, - 0x33E9AB7D, 0xD276646F, 0x587E9C59, 0xB9E1534B, - 0xE56EC535, 0x04F10A27, 0x8EF9F211, 0x6F663D03, - 0x50358817, 0xB1AA4705, 0x3BA2BF33, 0xDA3D7021, - 0x86B2E65F, 0x672D294D, 0xED25D17B, 0x0CBA1E69, - 0x55925487, 0xB40D9B95, 0x3E0563A3, 0xDF9AACB1, - 0x83153ACF, 0x628AF5DD, 0xE8820DEB, 0x091DC2F9, - 0x5AD2999E, 0xBB4D568C, 0x3145AEBA, 0xD0DA61A8, - 0x8C55F7D6, 0x6DCA38C4, 0xE7C2C0F2, 0x065D0FE0, - 0x5F75450E, 0xBEEA8A1C, 0x34E2722A, 0xD57DBD38, - 0x89F22B46, 0x686DE454, 0xE2651C62, 0x03FAD370, - 0x4452AAAC, 0xA5CD65BE, 0x2FC59D88, 0xCE5A529A, - 0x92D5C4E4, 0x734A0BF6, 0xF942F3C0, 0x18DD3CD2, - 0x41F5763C, 0xA06AB92E, 0x2A624118, 0xCBFD8E0A, - 0x97721874, 0x76EDD766, 0xFCE52F50, 0x1D7AE042, - 0x4EB5BB25, 0xAF2A7437, 0x25228C01, 0xC4BD4313, - 0x9832D56D, 0x79AD1A7F, 0xF3A5E249, 0x123A2D5B, - 0x4B1267B5, 0xAA8DA8A7, 0x20855091, 0xC11A9F83, - 0x9D9509FD, 0x7C0AC6EF, 0xF6023ED9, 0x179DF1CB, - 0x78FBCCC8, 0x996403DA, 0x136CFBEC, 0xF2F334FE, - 0xAE7CA280, 0x4FE36D92, 0xC5EB95A4, 0x24745AB6, - 0x7D5C1058, 0x9CC3DF4A, 0x16CB277C, 0xF754E86E, - 0xABDB7E10, 0x4A44B102, 0xC04C4934, 0x21D38626, - 0x721CDD41, 0x93831253, 0x198BEA65, 0xF8142577, - 0xA49BB309, 0x45047C1B, 0xCF0C842D, 0x2E934B3F, - 0x77BB01D1, 0x9624CEC3, 0x1C2C36F5, 0xFDB3F9E7, - 0xA13C6F99, 0x40A3A08B, 0xCAAB58BD, 0x2B3497AF, - 0x6C9CEE73, 0x8D032161, 0x070BD957, 0xE6941645, - 0xBA1B803B, 0x5B844F29, 0xD18CB71F, 0x3013780D, - 0x693B32E3, 0x88A4FDF1, 0x02AC05C7, 0xE333CAD5, - 0xBFBC5CAB, 0x5E2393B9, 0xD42B6B8F, 0x35B4A49D, - 0x667BFFFA, 0x87E430E8, 0x0DECC8DE, 0xEC7307CC, - 0xB0FC91B2, 0x51635EA0, 0xDB6BA696, 0x3AF46984, - 0x63DC236A, 0x8243EC78, 0x084B144E, 0xE9D4DB5C, - 0xB55B4D22, 0x54C48230, 0xDECC7A06, 0x3F53B514, -#else - 0x00000000, 0xE19FCF13, 0x6B973726, 0x8A08F835, - 0xD6876E4C, 0x3718A15F, 0xBD10596A, 0x5C8F9679, - 0x05A7DC98, 0xE438138B, 0x6E30EBBE, 0x8FAF24AD, - 0xD320B2D4, 0x32BF7DC7, 0xB8B785F2, 0x59284AE1, - 0x0AE71199, 0xEB78DE8A, 0x617026BF, 0x80EFE9AC, - 0xDC607FD5, 0x3DFFB0C6, 0xB7F748F3, 0x566887E0, - 0x0F40CD01, 0xEEDF0212, 0x64D7FA27, 0x85483534, - 0xD9C7A34D, 0x38586C5E, 0xB250946B, 0x53CF5B78, - 0x1467229B, 0xF5F8ED88, 0x7FF015BD, 0x9E6FDAAE, - 0xC2E04CD7, 0x237F83C4, 0xA9777BF1, 0x48E8B4E2, - 0x11C0FE03, 0xF05F3110, 0x7A57C925, 0x9BC80636, - 0xC747904F, 0x26D85F5C, 0xACD0A769, 0x4D4F687A, - 0x1E803302, 0xFF1FFC11, 0x75170424, 0x9488CB37, - 0xC8075D4E, 0x2998925D, 0xA3906A68, 0x420FA57B, - 0x1B27EF9A, 0xFAB82089, 0x70B0D8BC, 0x912F17AF, - 0xCDA081D6, 0x2C3F4EC5, 0xA637B6F0, 0x47A879E3, - 0x28CE449F, 0xC9518B8C, 0x435973B9, 0xA2C6BCAA, - 0xFE492AD3, 0x1FD6E5C0, 0x95DE1DF5, 0x7441D2E6, - 0x2D699807, 0xCCF65714, 0x46FEAF21, 0xA7616032, - 0xFBEEF64B, 0x1A713958, 0x9079C16D, 0x71E60E7E, - 0x22295506, 0xC3B69A15, 0x49BE6220, 0xA821AD33, - 0xF4AE3B4A, 0x1531F459, 0x9F390C6C, 0x7EA6C37F, - 0x278E899E, 0xC611468D, 0x4C19BEB8, 0xAD8671AB, - 0xF109E7D2, 0x109628C1, 0x9A9ED0F4, 0x7B011FE7, - 0x3CA96604, 0xDD36A917, 0x573E5122, 0xB6A19E31, - 0xEA2E0848, 0x0BB1C75B, 0x81B93F6E, 0x6026F07D, - 0x390EBA9C, 0xD891758F, 0x52998DBA, 0xB30642A9, - 0xEF89D4D0, 0x0E161BC3, 0x841EE3F6, 0x65812CE5, - 0x364E779D, 0xD7D1B88E, 0x5DD940BB, 0xBC468FA8, - 0xE0C919D1, 0x0156D6C2, 0x8B5E2EF7, 0x6AC1E1E4, - 0x33E9AB05, 0xD2766416, 0x587E9C23, 0xB9E15330, - 0xE56EC549, 0x04F10A5A, 0x8EF9F26F, 0x6F663D7C, - 0x50358897, 0xB1AA4784, 0x3BA2BFB1, 0xDA3D70A2, - 0x86B2E6DB, 0x672D29C8, 0xED25D1FD, 0x0CBA1EEE, - 0x5592540F, 0xB40D9B1C, 0x3E056329, 0xDF9AAC3A, - 0x83153A43, 0x628AF550, 0xE8820D65, 0x091DC276, - 0x5AD2990E, 0xBB4D561D, 0x3145AE28, 0xD0DA613B, - 0x8C55F742, 0x6DCA3851, 0xE7C2C064, 0x065D0F77, - 0x5F754596, 0xBEEA8A85, 0x34E272B0, 0xD57DBDA3, - 0x89F22BDA, 0x686DE4C9, 0xE2651CFC, 0x03FAD3EF, - 0x4452AA0C, 0xA5CD651F, 0x2FC59D2A, 0xCE5A5239, - 0x92D5C440, 0x734A0B53, 0xF942F366, 0x18DD3C75, - 0x41F57694, 0xA06AB987, 0x2A6241B2, 0xCBFD8EA1, - 0x977218D8, 0x76EDD7CB, 0xFCE52FFE, 0x1D7AE0ED, - 0x4EB5BB95, 0xAF2A7486, 0x25228CB3, 0xC4BD43A0, - 0x9832D5D9, 0x79AD1ACA, 0xF3A5E2FF, 0x123A2DEC, - 0x4B12670D, 0xAA8DA81E, 0x2085502B, 0xC11A9F38, - 0x9D950941, 0x7C0AC652, 0xF6023E67, 0x179DF174, - 0x78FBCC08, 0x9964031B, 0x136CFB2E, 0xF2F3343D, - 0xAE7CA244, 0x4FE36D57, 0xC5EB9562, 0x24745A71, - 0x7D5C1090, 0x9CC3DF83, 0x16CB27B6, 0xF754E8A5, - 0xABDB7EDC, 0x4A44B1CF, 0xC04C49FA, 0x21D386E9, - 0x721CDD91, 0x93831282, 0x198BEAB7, 0xF81425A4, - 0xA49BB3DD, 0x45047CCE, 0xCF0C84FB, 0x2E934BE8, - 0x77BB0109, 0x9624CE1A, 0x1C2C362F, 0xFDB3F93C, - 0xA13C6F45, 0x40A3A056, 0xCAAB5863, 0x2B349770, - 0x6C9CEE93, 0x8D032180, 0x070BD9B5, 0xE69416A6, - 0xBA1B80DF, 0x5B844FCC, 0xD18CB7F9, 0x301378EA, - 0x693B320B, 0x88A4FD18, 0x02AC052D, 0xE333CA3E, - 0xBFBC5C47, 0x5E239354, 0xD42B6B61, 0x35B4A472, - 0x667BFF0A, 0x87E43019, 0x0DECC82C, 0xEC73073F, - 0xB0FC9146, 0x51635E55, 0xDB6BA660, 0x3AF46973, - 0x63DC2392, 0x8243EC81, 0x084B14B4, 0xE9D4DBA7, - 0xB55B4DDE, 0x54C482CD, 0xDECC7AF8, 0x3F53B5EB, -#endif - 0x00000000, 0x180F40CD, 0x301E8033, 0x2811C0FE, - 0x603CA966, 0x7833E9AB, 0x50222955, 0x482D6998, - 0xC078FBCC, 0xD877BB01, 0xF0667BFF, 0xE8693B32, - 0xA04452AA, 0xB84B1267, 0x905AD299, 0x88559254, - 0x29F05F31, 0x31FF1FFC, 0x19EEDF02, 0x01E19FCF, - 0x49CCF657, 0x51C3B69A, 0x79D27664, 0x61DD36A9, - 0xE988A4FD, 0xF187E430, 0xD99624CE, 0xC1996403, - 0x89B40D9B, 0x91BB4D56, 0xB9AA8DA8, 0xA1A5CD65, - 0x5249BE62, 0x4A46FEAF, 0x62573E51, 0x7A587E9C, - 0x32751704, 0x2A7A57C9, 0x026B9737, 0x1A64D7FA, - 0x923145AE, 0x8A3E0563, 0xA22FC59D, 0xBA208550, - 0xF20DECC8, 0xEA02AC05, 0xC2136CFB, 0xDA1C2C36, - 0x7BB9E153, 0x63B6A19E, 0x4BA76160, 0x53A821AD, - 0x1B854835, 0x038A08F8, 0x2B9BC806, 0x339488CB, - 0xBBC11A9F, 0xA3CE5A52, 0x8BDF9AAC, 0x93D0DA61, - 0xDBFDB3F9, 0xC3F2F334, 0xEBE333CA, 0xF3EC7307, - 0xA492D5C4, 0xBC9D9509, 0x948C55F7, 0x8C83153A, - 0xC4AE7CA2, 0xDCA13C6F, 0xF4B0FC91, 0xECBFBC5C, - 0x64EA2E08, 0x7CE56EC5, 0x54F4AE3B, 0x4CFBEEF6, - 0x04D6876E, 0x1CD9C7A3, 0x34C8075D, 0x2CC74790, - 0x8D628AF5, 0x956DCA38, 0xBD7C0AC6, 0xA5734A0B, - 0xED5E2393, 0xF551635E, 0xDD40A3A0, 0xC54FE36D, - 0x4D1A7139, 0x551531F4, 0x7D04F10A, 0x650BB1C7, - 0x2D26D85F, 0x35299892, 0x1D38586C, 0x053718A1, - 0xF6DB6BA6, 0xEED42B6B, 0xC6C5EB95, 0xDECAAB58, - 0x96E7C2C0, 0x8EE8820D, 0xA6F942F3, 0xBEF6023E, - 0x36A3906A, 0x2EACD0A7, 0x06BD1059, 0x1EB25094, - 0x569F390C, 0x4E9079C1, 0x6681B93F, 0x7E8EF9F2, - 0xDF2B3497, 0xC724745A, 0xEF35B4A4, 0xF73AF469, - 0xBF179DF1, 0xA718DD3C, 0x8F091DC2, 0x97065D0F, - 0x1F53CF5B, 0x075C8F96, 0x2F4D4F68, 0x37420FA5, - 0x7F6F663D, 0x676026F0, 0x4F71E60E, 0x577EA6C3, - 0xE18D0321, 0xF98243EC, 0xD1938312, 0xC99CC3DF, - 0x81B1AA47, 0x99BEEA8A, 0xB1AF2A74, 0xA9A06AB9, - 0x21F5F8ED, 0x39FAB820, 0x11EB78DE, 0x09E43813, - 0x41C9518B, 0x59C61146, 0x71D7D1B8, 0x69D89175, - 0xC87D5C10, 0xD0721CDD, 0xF863DC23, 0xE06C9CEE, - 0xA841F576, 0xB04EB5BB, 0x985F7545, 0x80503588, - 0x0805A7DC, 0x100AE711, 0x381B27EF, 0x20146722, - 0x68390EBA, 0x70364E77, 0x58278E89, 0x4028CE44, - 0xB3C4BD43, 0xABCBFD8E, 0x83DA3D70, 0x9BD57DBD, - 0xD3F81425, 0xCBF754E8, 0xE3E69416, 0xFBE9D4DB, - 0x73BC468F, 0x6BB30642, 0x43A2C6BC, 0x5BAD8671, - 0x1380EFE9, 0x0B8FAF24, 0x239E6FDA, 0x3B912F17, - 0x9A34E272, 0x823BA2BF, 0xAA2A6241, 0xB225228C, - 0xFA084B14, 0xE2070BD9, 0xCA16CB27, 0xD2198BEA, - 0x5A4C19BE, 0x42435973, 0x6A52998D, 0x725DD940, - 0x3A70B0D8, 0x227FF015, 0x0A6E30EB, 0x12617026, - 0x451FD6E5, 0x5D109628, 0x750156D6, 0x6D0E161B, - 0x25237F83, 0x3D2C3F4E, 0x153DFFB0, 0x0D32BF7D, - 0x85672D29, 0x9D686DE4, 0xB579AD1A, 0xAD76EDD7, - 0xE55B844F, 0xFD54C482, 0xD545047C, 0xCD4A44B1, - 0x6CEF89D4, 0x74E0C919, 0x5CF109E7, 0x44FE492A, - 0x0CD320B2, 0x14DC607F, 0x3CCDA081, 0x24C2E04C, - 0xAC977218, 0xB49832D5, 0x9C89F22B, 0x8486B2E6, - 0xCCABDB7E, 0xD4A49BB3, 0xFCB55B4D, 0xE4BA1B80, - 0x17566887, 0x0F59284A, 0x2748E8B4, 0x3F47A879, - 0x776AC1E1, 0x6F65812C, 0x477441D2, 0x5F7B011F, - 0xD72E934B, 0xCF21D386, 0xE7301378, 0xFF3F53B5, - 0xB7123A2D, 0xAF1D7AE0, 0x870CBA1E, 0x9F03FAD3, - 0x3EA637B6, 0x26A9777B, 0x0EB8B785, 0x16B7F748, - 0x5E9A9ED0, 0x4695DE1D, 0x6E841EE3, 0x768B5E2E, - 0xFEDECC7A, 0xE6D18CB7, 0xCEC04C49, 0xD6CF0C84, - 0x9EE2651C, 0x86ED25D1, 0xAEFCE52F, 0xB6F3A5E2 -}; -} - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) -unsigned int SosemanukPolicy::GetAlignment() const -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) -#ifdef __INTEL_COMPILER - if (HasSSE2() && !IsP4()) // Intel compiler produces faster code for this algorithm on the P4 -#else - if (HasSSE2()) -#endif - return 16; - else -#endif - return GetAlignmentOf(); -} - -unsigned int SosemanukPolicy::GetOptimalBlockSize() const -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) -#ifdef __INTEL_COMPILER - if (HasSSE2() && !IsP4()) // Intel compiler produces faster code for this algorithm on the P4 -#else - if (HasSSE2()) -#endif - return 4*BYTES_PER_ITERATION; - else -#endif - return BYTES_PER_ITERATION; -} -#endif - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE -extern "C" { -void Sosemanuk_OperateKeystream(size_t iterationCount, const byte *input, byte *output, word32 *state); -} -#endif - -void SosemanukPolicy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) -{ -#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM - -#ifdef CRYPTOPP_X64_MASM_AVAILABLE - Sosemanuk_OperateKeystream(iterationCount, input, output, m_state.data()); - return; -#endif - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) -#ifdef CRYPTOPP_GENERATE_X64_MASM - ALIGN 8 - Sosemanuk_OperateKeystream PROC FRAME - rex_push_reg rsi - push_reg rdi - alloc_stack(80*4*2+12*4+8*WORD_SZ + 2*16+8) - save_xmm128 xmm6, 02f0h - save_xmm128 xmm7, 0300h - .endprolog - mov rdi, r8 - mov rax, r9 -#else -#ifdef __INTEL_COMPILER - if (HasSSE2() && !IsP4()) // Intel compiler produces faster code for this algorithm on the P4 -#else - if (HasSSE2()) -#endif - { -#ifdef __GNUC__ - #if CRYPTOPP_BOOL_X64 - FixedSizeAlignedSecBlock workspace; - #endif - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS_PUSH_IF86( bx) -#else - word32 *state = m_state; - AS2( mov WORD_REG(ax), state) - AS2( mov WORD_REG(di), output) - AS2( mov WORD_REG(dx), input) - AS2( mov WORD_REG(cx), iterationCount) -#endif -#endif // #ifdef CRYPTOPP_GENERATE_X64_MASM - -#if defined(__GNUC__) && CRYPTOPP_BOOL_X64 - #define SSE2_workspace %5 -#else - #define SSE2_workspace WORD_REG(sp) -#endif - -#define SSE2_output WORD_PTR [SSE2_workspace+1*WORD_SZ] -#define SSE2_input WORD_PTR [SSE2_workspace+2*WORD_SZ] -#define SSE2_wordsLeft WORD_PTR [SSE2_workspace+3*WORD_SZ] -#define SSE2_diEnd WORD_PTR [SSE2_workspace+4*WORD_SZ] -#define SSE2_pMulTables WORD_PTR [SSE2_workspace+5*WORD_SZ] -#define SSE2_state WORD_PTR [SSE2_workspace+6*WORD_SZ] -#define SSE2_wordsLeft2 WORD_PTR [SSE2_workspace+7*WORD_SZ] -#define SSE2_stateCopy SSE2_workspace + 8*WORD_SZ -#define SSE2_uvStart SSE2_stateCopy + 12*4 - -#if (CRYPTOPP_BOOL_X86) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) - AS_PUSH_IF86( bp) - AS2( mov AS_REG_6, esp) - AS2( and esp, -16) - AS2( sub esp, 80*4*2+12*4+8*WORD_SZ) // 80 v's, 80 u's, 12 state, 8 locals - AS2( mov [esp], AS_REG_6) -#endif - AS2( mov SSE2_output, WORD_REG(di)) - AS2( mov SSE2_input, WORD_REG(dx)) - AS2( mov SSE2_state, WORD_REG(ax)) -#ifndef _MSC_VER - AS2( mov SSE2_pMulTables, WORD_REG(si)) -#endif - AS2( lea WORD_REG(cx), [4*WORD_REG(cx)+WORD_REG(cx)]) - AS2( lea WORD_REG(si), [4*WORD_REG(cx)]) - AS2( mov SSE2_wordsLeft, WORD_REG(si)) - AS2( movdqa xmm0, [WORD_REG(ax)+0*16]) // copy state to stack to save a register - AS2( movdqa [SSE2_stateCopy+0*16], xmm0) - AS2( movdqa xmm0, [WORD_REG(ax)+1*16]) - AS2( movdqa [SSE2_stateCopy+1*16], xmm0) - AS2( movq xmm0, QWORD PTR [WORD_REG(ax)+2*16]) - AS2( movq QWORD PTR [SSE2_stateCopy+2*16], xmm0) - AS2( psrlq xmm0, 32) - AS2( movd AS_REG_6d, xmm0) // s(9) - AS2( mov ecx, [WORD_REG(ax)+10*4]) - AS2( mov edx, [WORD_REG(ax)+11*4]) - AS2( pcmpeqb xmm7, xmm7) // all ones - -#define s(i) SSE2_stateCopy + ASM_MOD(i,10)*4 -#define u(j) WORD_REG(di) + (ASM_MOD(j,4)*20 + (j/4)) * 4 -#define v(j) WORD_REG(di) + (ASM_MOD(j,4)*20 + (j/4)) * 4 + 80*4 - -#define R10 ecx -#define R11 edx -#define R20 edx -#define R21 ecx -// workaround bug in GAS 2.15 -#define R20r WORD_REG(dx) -#define R21r WORD_REG(cx) - -#define SSE2_STEP(i, j) \ - AS2( mov eax, [s(i+0)])\ - AS2( mov [v(i)], eax)\ - AS2( rol eax, 8)\ - AS2( lea AS_REG_7, [AS_REG_6 + R2##j##r])\ - AS2( xor AS_REG_7d, R1##j)\ - AS2( mov [u(i)], AS_REG_7d)\ - AS2( mov AS_REG_7d, 1)\ - AS2( and AS_REG_7d, R2##j)\ - AS1( neg AS_REG_7d)\ - AS2( and AS_REG_7d, AS_REG_6d)\ - AS2( xor AS_REG_6d, eax)\ - AS2( movzx eax, al)\ - AS2( xor AS_REG_6d, [WORD_REG(si)+WORD_REG(ax)*4])\ - AS2( mov eax, [s(i+3)])\ - AS2( xor AS_REG_7d, [s(i+2)])\ - AS2( add R1##j, AS_REG_7d)\ - AS2( movzx AS_REG_7d, al)\ - AS2( shr eax, 8)\ - AS2( xor AS_REG_6d, [WORD_REG(si)+1024+AS_REG_7*4])\ - AS2( xor AS_REG_6d, eax)\ - AS2( imul R2##j, AS_HEX(54655307))\ - AS2( rol R2##j, 7)\ - AS2( mov [s(i+0)], AS_REG_6d)\ - - ASL(2) // outer loop, each iteration of this processes 80 words - AS2( lea WORD_REG(di), [SSE2_uvStart]) // start of v and u - AS2( mov WORD_REG(ax), 80) - AS2( cmp WORD_REG(si), 80) - AS2( cmovg WORD_REG(si), WORD_REG(ax)) - AS2( mov SSE2_wordsLeft2, WORD_REG(si)) - AS2( lea WORD_REG(si), [WORD_REG(di)+WORD_REG(si)]) // use to end first inner loop - AS2( mov SSE2_diEnd, WORD_REG(si)) -#ifdef _MSC_VER - AS2( lea WORD_REG(si), s_sosemanukMulTables) -#else - AS2( mov WORD_REG(si), SSE2_pMulTables) -#endif - - ASL(0) // first inner loop, 20 words each, 4 iterations - SSE2_STEP(0, 0) - SSE2_STEP(1, 1) - SSE2_STEP(2, 0) - SSE2_STEP(3, 1) - SSE2_STEP(4, 0) - SSE2_STEP(5, 1) - SSE2_STEP(6, 0) - SSE2_STEP(7, 1) - SSE2_STEP(8, 0) - SSE2_STEP(9, 1) - SSE2_STEP(10, 0) - SSE2_STEP(11, 1) - SSE2_STEP(12, 0) - SSE2_STEP(13, 1) - SSE2_STEP(14, 0) - SSE2_STEP(15, 1) - SSE2_STEP(16, 0) - SSE2_STEP(17, 1) - SSE2_STEP(18, 0) - SSE2_STEP(19, 1) - // loop - AS2( add WORD_REG(di), 5*4) - AS2( cmp WORD_REG(di), SSE2_diEnd) - ASJ( jne, 0, b) - - AS2( mov WORD_REG(ax), SSE2_input) - AS2( mov AS_REG_7, SSE2_output) - AS2( lea WORD_REG(di), [SSE2_uvStart]) // start of v and u - AS2( mov WORD_REG(si), SSE2_wordsLeft2) - - ASL(1) // second inner loop, 16 words each, 5 iterations - AS2( movdqa xmm0, [WORD_REG(di)+0*20*4]) - AS2( movdqa xmm2, [WORD_REG(di)+2*20*4]) - AS2( movdqa xmm3, [WORD_REG(di)+3*20*4]) - AS2( movdqa xmm1, [WORD_REG(di)+1*20*4]) - // S2 - AS2( movdqa xmm4, xmm0) - AS2( pand xmm0, xmm2) - AS2( pxor xmm0, xmm3) - AS2( pxor xmm2, xmm1) - AS2( pxor xmm2, xmm0) - AS2( por xmm3, xmm4) - AS2( pxor xmm3, xmm1) - AS2( pxor xmm4, xmm2) - AS2( movdqa xmm1, xmm3) - AS2( por xmm3, xmm4) - AS2( pxor xmm3, xmm0) - AS2( pand xmm0, xmm1) - AS2( pxor xmm4, xmm0) - AS2( pxor xmm1, xmm3) - AS2( pxor xmm1, xmm4) - AS2( pxor xmm4, xmm7) - // xor with v - AS2( pxor xmm2, [WORD_REG(di)+80*4]) - AS2( pxor xmm3, [WORD_REG(di)+80*5]) - AS2( pxor xmm1, [WORD_REG(di)+80*6]) - AS2( pxor xmm4, [WORD_REG(di)+80*7]) - // exit loop early if less than 16 words left to output - // this is necessary because block size is 20 words, and we output 16 words in each iteration of this loop - AS2( cmp WORD_REG(si), 16) - ASJ( jl, 4, f) - // unpack - AS2( movdqa xmm6, xmm2) - AS2( punpckldq xmm2, xmm3) - AS2( movdqa xmm5, xmm1) - AS2( punpckldq xmm1, xmm4) - AS2( movdqa xmm0, xmm2) - AS2( punpcklqdq xmm2, xmm1) - AS2( punpckhqdq xmm0, xmm1) - AS2( punpckhdq xmm6, xmm3) - AS2( punpckhdq xmm5, xmm4) - AS2( movdqa xmm3, xmm6) - AS2( punpcklqdq xmm6, xmm5) - AS2( punpckhqdq xmm3, xmm5) - - // output keystream - AS_XMM_OUTPUT4(SSE2_Sosemanuk_Output, WORD_REG(ax), AS_REG_7, 2,0,6,3, 1, 0,1,2,3, 4) - - // loop - AS2( add WORD_REG(di), 4*4) - AS2( sub WORD_REG(si), 16) - ASJ( jnz, 1, b) - - // outer loop - AS2( mov WORD_REG(si), SSE2_wordsLeft) - AS2( sub WORD_REG(si), 80) - ASJ( jz, 6, f) - AS2( mov SSE2_wordsLeft, WORD_REG(si)) - AS2( mov SSE2_input, WORD_REG(ax)) - AS2( mov SSE2_output, AS_REG_7) - ASJ( jmp, 2, b) - - ASL(4) // final output of less than 16 words - AS2( test WORD_REG(ax), WORD_REG(ax)) - ASJ( jz, 5, f) - AS2( movd xmm0, dword ptr [WORD_REG(ax)+0*4]) - AS2( pxor xmm2, xmm0) - AS2( movd xmm0, dword ptr [WORD_REG(ax)+1*4]) - AS2( pxor xmm3, xmm0) - AS2( movd xmm0, dword ptr [WORD_REG(ax)+2*4]) - AS2( pxor xmm1, xmm0) - AS2( movd xmm0, dword ptr [WORD_REG(ax)+3*4]) - AS2( pxor xmm4, xmm0) - AS2( add WORD_REG(ax), 16) - ASL(5) - AS2( movd dword ptr [AS_REG_7+0*4], xmm2) - AS2( movd dword ptr [AS_REG_7+1*4], xmm3) - AS2( movd dword ptr [AS_REG_7+2*4], xmm1) - AS2( movd dword ptr [AS_REG_7+3*4], xmm4) - AS2( sub WORD_REG(si), 4) - ASJ( jz, 6, f) - AS2( add AS_REG_7, 16) - AS2( psrldq xmm2, 4) - AS2( psrldq xmm3, 4) - AS2( psrldq xmm1, 4) - AS2( psrldq xmm4, 4) - ASJ( jmp, 4, b) - - ASL(6) // save state - AS2( mov AS_REG_6, SSE2_state) - AS2( movdqa xmm0, [SSE2_stateCopy+0*16]) - AS2( movdqa [AS_REG_6+0*16], xmm0) - AS2( movdqa xmm0, [SSE2_stateCopy+1*16]) - AS2( movdqa [AS_REG_6+1*16], xmm0) - AS2( movq xmm0, QWORD PTR [SSE2_stateCopy+2*16]) - AS2( movq QWORD PTR [AS_REG_6+2*16], xmm0) - AS2( mov [AS_REG_6+10*4], ecx) - AS2( mov [AS_REG_6+11*4], edx) - - AS_POP_IF86( sp) - AS_POP_IF86( bp) - -#ifdef __GNUC__ - AS_POP_IF86( bx) - ATT_PREFIX - : - : "a" (m_state.m_ptr), "c" (iterationCount), "S" (s_sosemanukMulTables), "D" (output), "d" (input) - #if CRYPTOPP_BOOL_X64 - , "r" (workspace.m_ptr) - : "memory", "cc", "%r9", "%r10", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7" - #else - : "memory", "cc" - #endif - ); -#endif -#ifdef CRYPTOPP_GENERATE_X64_MASM - movdqa xmm6, [rsp + 02f0h] - movdqa xmm7, [rsp + 0300h] - add rsp, 80*4*2+12*4+8*WORD_SZ + 2*16+8 - pop rdi - pop rsi - ret - Sosemanuk_OperateKeystream ENDP -#else - } - else -#endif -#endif -#ifndef CRYPTOPP_GENERATE_X64_MASM - { -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) -#define MUL_A(x) (x = rotlFixed(x, 8), x ^ s_sosemanukMulTables[byte(x)]) -#else -#define MUL_A(x) (((x) << 8) ^ s_sosemanukMulTables[(x) >> 24]) -#endif - -#define DIV_A(x) (((x) >> 8) ^ s_sosemanukMulTables[256 + byte(x)]) - -#define r1(i) ((i%2) ? reg2 : reg1) -#define r2(i) ((i%2) ? reg1 : reg2) - -#define STEP(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, v, u) \ - u = (s##x9 + r2(x0)) ^ r1(x0);\ - v = s##x0;\ - s##x0 = MUL_A(s##x0) ^ DIV_A(s##x3) ^ s##x9;\ - r1(x0) += XMUX(r2(x0), s##x2, s##x9);\ - r2(x0) = rotlFixed(r2(x0) * 0x54655307, 7);\ - -#define SOSEMANUK_OUTPUT(x) \ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, u2 ^ v0);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, u3 ^ v1);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, u1 ^ v2);\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, u4 ^ v3); - -#define OUTPUT4 \ - S2(0, u0, u1, u2, u3, u4);\ - CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(SOSEMANUK_OUTPUT, 4*4); - - word32 s0 = m_state[0]; - word32 s1 = m_state[1]; - word32 s2 = m_state[2]; - word32 s3 = m_state[3]; - word32 s4 = m_state[4]; - word32 s5 = m_state[5]; - word32 s6 = m_state[6]; - word32 s7 = m_state[7]; - word32 s8 = m_state[8]; - word32 s9 = m_state[9]; - word32 reg1 = m_state[10]; - word32 reg2 = m_state[11]; - word32 u0, u1, u2, u3, u4, v0, v1, v2, v3; - - do - { - STEP(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, v0, u0) - STEP(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, v1, u1) - STEP(2, 3, 4, 5, 6, 7, 8, 9, 0, 1, v2, u2) - STEP(3, 4, 5, 6, 7, 8, 9, 0, 1, 2, v3, u3) - OUTPUT4 - STEP(4, 5, 6, 7, 8, 9, 0, 1, 2, 3, v0, u0) - STEP(5, 6, 7, 8, 9, 0, 1, 2, 3, 4, v1, u1) - STEP(6, 7, 8, 9, 0, 1, 2, 3, 4, 5, v2, u2) - STEP(7, 8, 9, 0, 1, 2, 3, 4, 5, 6, v3, u3) - OUTPUT4 - STEP(8, 9, 0, 1, 2, 3, 4, 5, 6, 7, v0, u0) - STEP(9, 0, 1, 2, 3, 4, 5, 6, 7, 8, v1, u1) - STEP(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, v2, u2) - STEP(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, v3, u3) - OUTPUT4 - STEP(2, 3, 4, 5, 6, 7, 8, 9, 0, 1, v0, u0) - STEP(3, 4, 5, 6, 7, 8, 9, 0, 1, 2, v1, u1) - STEP(4, 5, 6, 7, 8, 9, 0, 1, 2, 3, v2, u2) - STEP(5, 6, 7, 8, 9, 0, 1, 2, 3, 4, v3, u3) - OUTPUT4 - STEP(6, 7, 8, 9, 0, 1, 2, 3, 4, 5, v0, u0) - STEP(7, 8, 9, 0, 1, 2, 3, 4, 5, 6, v1, u1) - STEP(8, 9, 0, 1, 2, 3, 4, 5, 6, 7, v2, u2) - STEP(9, 0, 1, 2, 3, 4, 5, 6, 7, 8, v3, u3) - OUTPUT4 - } - while (--iterationCount); - - m_state[0] = s0; - m_state[1] = s1; - m_state[2] = s2; - m_state[3] = s3; - m_state[4] = s4; - m_state[5] = s5; - m_state[6] = s6; - m_state[7] = s7; - m_state[8] = s8; - m_state[9] = s9; - m_state[10] = reg1; - m_state[11] = reg2; - } -} - -NAMESPACE_END - -#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM diff --git a/external/crypto++-5.6.3/sosemanuk.h b/external/crypto++-5.6.3/sosemanuk.h deleted file mode 100644 index 5a55157d1..000000000 --- a/external/crypto++-5.6.3/sosemanuk.h +++ /dev/null @@ -1,52 +0,0 @@ -// sosemanuk.h - written and placed in the public domain by Wei Dai - -//! \file sosemanuk.h -//! \brief Classes for Sosemanuk stream cipher - -#ifndef CRYPTOPP_SOSEMANUK_H -#define CRYPTOPP_SOSEMANUK_H - -#include "strciphr.h" -#include "secblock.h" - -// Clang due to "Inline assembly operands don't work with .intel_syntax" -// https://llvm.org/bugs/show_bug.cgi?id=24232 -#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) -# define CRYPTOPP_DISABLE_SOSEMANUK_ASM -#endif - -NAMESPACE_BEGIN(CryptoPP) - -//! algorithm info -struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16> -{ - static const char * StaticAlgorithmName() {return "Sosemanuk";} -}; - -//! _ -class SosemanukPolicy : public AdditiveCipherConcretePolicy, public SosemanukInfo -{ -protected: - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); - void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); - bool CipherIsRandomAccess() const {return false;} -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM) - unsigned int GetAlignment() const; - unsigned int GetOptimalBlockSize() const; -#endif - - FixedSizeSecBlock m_key; - FixedSizeAlignedSecBlock m_state; -}; - -//! Sosemanuk -struct Sosemanuk : public SosemanukInfo, public SymmetricCipherDocumentation -{ - typedef SymmetricCipherFinal >, SosemanukInfo> Encryption; - typedef Encryption Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/square.cpp b/external/crypto++-5.6.3/square.cpp deleted file mode 100644 index 8524e1a87..000000000 --- a/external/crypto++-5.6.3/square.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// square.cpp - written and placed in the public domain by Wei Dai -// Based on Paulo S.L.M. Barreto's public domain implementation - -#include "pch.h" -#include "config.h" - -#include "square.h" -#include "misc.h" -#include "gf256.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4244) -#endif - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wmissing-braces" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -// apply theta to a roundkey -static void SquareTransform (word32 in[4], word32 out[4]) -{ - static const byte G[4][4] = - { - 0x02U, 0x01U, 0x01U, 0x03U, - 0x03U, 0x02U, 0x01U, 0x01U, - 0x01U, 0x03U, 0x02U, 0x01U, - 0x01U, 0x01U, 0x03U, 0x02U - }; - - GF256 gf256(0xf5); - - for (int i = 0; i < 4; i++) - { - word32 temp = 0; - for (unsigned int j = 0; j < 4; j++) - for (unsigned int k = 0; k < 4; k++) - temp ^= (word32)gf256.Multiply(GETBYTE(in[i], 3-k), G[k][j]) << ((3-j)*8); - out[i] = temp; - } -} - -#define roundkeys(i, j) m_roundkeys[(i)*4+(j)] -#define roundkeys4(i) (m_roundkeys+(i)*4) - -void Square::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &) -{ - AssertValidKeyLength(length); - - static const word32 offset[ROUNDS] = { - 0x01000000UL, 0x02000000UL, 0x04000000UL, 0x08000000UL, - 0x10000000UL, 0x20000000UL, 0x40000000UL, 0x80000000UL, - }; - - GetUserKey(BIG_ENDIAN_ORDER, m_roundkeys.data(), KEYLENGTH/4, userKey, KEYLENGTH); - - /* apply the key evolution function */ - for (int i = 1; i < ROUNDS+1; i++) - { - roundkeys(i, 0) = roundkeys(i-1, 0) ^ rotlFixed(roundkeys(i-1, 3), 8U) ^ offset[i-1]; - roundkeys(i, 1) = roundkeys(i-1, 1) ^ roundkeys(i, 0); - roundkeys(i, 2) = roundkeys(i-1, 2) ^ roundkeys(i, 1); - roundkeys(i, 3) = roundkeys(i-1, 3) ^ roundkeys(i, 2); - } - - /* produce the round keys */ - if (IsForwardTransformation()) - { - for (int i = 0; i < ROUNDS; i++) - SquareTransform (roundkeys4(i), roundkeys4(i)); - } - else - { - for (int i = 0; i < ROUNDS/2; i++) - for (int j = 0; j < 4; j++) - std::swap(roundkeys(i, j), roundkeys(ROUNDS-i, j)); - SquareTransform (roundkeys4(ROUNDS), roundkeys4(ROUNDS)); - } -} - -#define MSB(x) (((x) >> 24) & 0xffU) /* most significant byte */ -#define SSB(x) (((x) >> 16) & 0xffU) /* second in significance */ -#define TSB(x) (((x) >> 8) & 0xffU) /* third in significance */ -#define LSB(x) (((x) ) & 0xffU) /* least significant byte */ - -#define squareRound(text, temp, T0, T1, T2, T3, roundkey) \ -{ \ - temp[0] = T0[MSB (text[0])] \ - ^ T1[MSB (text[1])] \ - ^ T2[MSB (text[2])] \ - ^ T3[MSB (text[3])] \ - ^ roundkey[0]; \ - temp[1] = T0[SSB (text[0])] \ - ^ T1[SSB (text[1])] \ - ^ T2[SSB (text[2])] \ - ^ T3[SSB (text[3])] \ - ^ roundkey[1]; \ - temp[2] = T0[TSB (text[0])] \ - ^ T1[TSB (text[1])] \ - ^ T2[TSB (text[2])] \ - ^ T3[TSB (text[3])] \ - ^ roundkey[2]; \ - temp[3] = T0[LSB (text[0])] \ - ^ T1[LSB (text[1])] \ - ^ T2[LSB (text[2])] \ - ^ T3[LSB (text[3])] \ - ^ roundkey[3]; \ -} /* squareRound */ - -#define squareFinal(text, temp, S, roundkey) \ -{ \ - text[0] = ((word32) (S[MSB (temp[0])]) << 24) \ - ^ ((word32) (S[MSB (temp[1])]) << 16) \ - ^ ((word32) (S[MSB (temp[2])]) << 8) \ - ^ (word32) (S[MSB (temp[3])]) \ - ^ roundkey[0]; \ - text[1] = ((word32) (S[SSB (temp[0])]) << 24) \ - ^ ((word32) (S[SSB (temp[1])]) << 16) \ - ^ ((word32) (S[SSB (temp[2])]) << 8) \ - ^ (word32) (S[SSB (temp[3])]) \ - ^ roundkey[1]; \ - text[2] = ((word32) (S[TSB (temp[0])]) << 24) \ - ^ ((word32) (S[TSB (temp[1])]) << 16) \ - ^ ((word32) (S[TSB (temp[2])]) << 8) \ - ^ (word32) (S[TSB (temp[3])]) \ - ^ roundkey[2]; \ - text[3] = ((word32) (S[LSB (temp[0])]) << 24) \ - ^ ((word32) (S[LSB (temp[1])]) << 16) \ - ^ ((word32) (S[LSB (temp[2])]) << 8) \ - ^ (word32) (S[LSB (temp[3])]) \ - ^ roundkey[3]; \ -} /* squareFinal */ - -typedef BlockGetAndPut Block; - -void Square::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 text[4], temp[4]; - Block::Get(inBlock)(text[0])(text[1])(text[2])(text[3]); - - /* initial key addition */ - text[0] ^= roundkeys(0, 0); - text[1] ^= roundkeys(0, 1); - text[2] ^= roundkeys(0, 2); - text[3] ^= roundkeys(0, 3); - - /* ROUNDS - 1 full rounds */ - for (int i=1; i+1, public FixedKeyLength<16>, FixedRounds<8> -{ - static const char *StaticAlgorithmName() {return "Square";} -}; - -/// Square -class Square : public Square_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - FixedSizeSecBlock m_roundkeys; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - private: - static const byte Se[256]; - static const word32 Te[4][256]; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - private: - static const byte Sd[256]; - static const word32 Td[4][256]; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef Square::Encryption SquareEncryption; -typedef Square::Decryption SquareDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/squaretb.cpp b/external/crypto++-5.6.3/squaretb.cpp deleted file mode 100644 index bc3bee7df..000000000 --- a/external/crypto++-5.6.3/squaretb.cpp +++ /dev/null @@ -1,582 +0,0 @@ -#include "pch.h" -#include "square.h" - -NAMESPACE_BEGIN(CryptoPP) - -const byte Square::Enc::Se[256] = { -177, 206, 195, 149, 90, 173, 231, 2, 77, 68, 251, 145, 12, 135, 161, 80, -203, 103, 84, 221, 70, 143, 225, 78, 240, 253, 252, 235, 249, 196, 26, 110, - 94, 245, 204, 141, 28, 86, 67, 254, 7, 97, 248, 117, 89, 255, 3, 34, -138, 209, 19, 238, 136, 0, 14, 52, 21, 128, 148, 227, 237, 181, 83, 35, - 75, 71, 23, 167, 144, 53, 171, 216, 184, 223, 79, 87, 154, 146, 219, 27, - 60, 200, 153, 4, 142, 224, 215, 125, 133, 187, 64, 44, 58, 69, 241, 66, -101, 32, 65, 24, 114, 37, 147, 112, 54, 5, 242, 11, 163, 121, 236, 8, - 39, 49, 50, 182, 124, 176, 10, 115, 91, 123, 183, 129, 210, 13, 106, 38, -158, 88, 156, 131, 116, 179, 172, 48, 122, 105, 119, 15, 174, 33, 222, 208, - 46, 151, 16, 164, 152, 168, 212, 104, 45, 98, 41, 109, 22, 73, 118, 199, -232, 193, 150, 55, 229, 202, 244, 233, 99, 18, 194, 166, 20, 188, 211, 40, -175, 47, 230, 36, 82, 198, 160, 9, 189, 140, 207, 93, 17, 95, 1, 197, -159, 61, 162, 155, 201, 59, 190, 81, 25, 31, 63, 92, 178, 239, 74, 205, -191, 186, 111, 100, 217, 243, 62, 180, 170, 220, 213, 6, 192, 126, 246, 102, -108, 132, 113, 56, 185, 29, 127, 157, 72, 139, 42, 218, 165, 51, 130, 57, -214, 120, 134, 250, 228, 43, 169, 30, 137, 96, 107, 234, 85, 76, 247, 226, -}; - -const byte Square::Dec::Sd[256] = { - 53, 190, 7, 46, 83, 105, 219, 40, 111, 183, 118, 107, 12, 125, 54, 139, -146, 188, 169, 50, 172, 56, 156, 66, 99, 200, 30, 79, 36, 229, 247, 201, - 97, 141, 47, 63, 179, 101, 127, 112, 175, 154, 234, 245, 91, 152, 144, 177, -135, 113, 114, 237, 55, 69, 104, 163, 227, 239, 92, 197, 80, 193, 214, 202, - 90, 98, 95, 38, 9, 93, 20, 65, 232, 157, 206, 64, 253, 8, 23, 74, - 15, 199, 180, 62, 18, 252, 37, 75, 129, 44, 4, 120, 203, 187, 32, 189, -249, 41, 153, 168, 211, 96, 223, 17, 151, 137, 126, 250, 224, 155, 31, 210, -103, 226, 100, 119, 132, 43, 158, 138, 241, 109, 136, 121, 116, 87, 221, 230, - 57, 123, 238, 131, 225, 88, 242, 13, 52, 248, 48, 233, 185, 35, 84, 21, - 68, 11, 77, 102, 58, 3, 162, 145, 148, 82, 76, 195, 130, 231, 128, 192, -182, 14, 194, 108, 147, 236, 171, 67, 149, 246, 216, 70, 134, 5, 140, 176, -117, 0, 204, 133, 215, 61, 115, 122, 72, 228, 209, 89, 173, 184, 198, 208, -220, 161, 170, 2, 29, 191, 181, 159, 81, 196, 165, 16, 34, 207, 1, 186, -143, 49, 124, 174, 150, 218, 240, 86, 71, 212, 235, 78, 217, 19, 142, 73, - 85, 22, 255, 59, 244, 164, 178, 6, 160, 167, 251, 27, 110, 60, 51, 205, - 24, 94, 106, 213, 166, 33, 222, 254, 42, 28, 243, 10, 26, 25, 39, 45, -}; - -const word32 Square::Enc::Te[4][256] = { -{ -0x97b1b126UL, 0x69cecea7UL, 0x73c3c3b0UL, 0xdf95954aUL, -0xb45a5aeeUL, 0xafadad02UL, 0x3be7e7dcUL, 0x04020206UL, -0x9a4d4dd7UL, 0x884444ccUL, 0x03fbfbf8UL, 0xd7919146UL, -0x180c0c14UL, 0xfb87877cUL, 0xb7a1a116UL, 0xa05050f0UL, -0x63cbcba8UL, 0xce6767a9UL, 0xa85454fcUL, 0x4fdddd92UL, -0x8c4646caUL, 0xeb8f8f64UL, 0x37e1e1d6UL, 0x9c4e4ed2UL, -0x15f0f0e5UL, 0x0ffdfdf2UL, 0x0dfcfcf1UL, 0x23ebebc8UL, -0x07f9f9feUL, 0x7dc4c4b9UL, 0x341a1a2eUL, 0xdc6e6eb2UL, -0xbc5e5ee2UL, 0x1ff5f5eaUL, 0x6dcccca1UL, 0xef8d8d62UL, -0x381c1c24UL, 0xac5656faUL, 0x864343c5UL, 0x09fefef7UL, -0x0e070709UL, 0xc26161a3UL, 0x05f8f8fdUL, 0xea75759fUL, -0xb25959ebUL, 0x0bfffff4UL, 0x06030305UL, 0x44222266UL, -0xe18a8a6bUL, 0x57d1d186UL, 0x26131335UL, 0x29eeeec7UL, -0xe588886dUL, 0x00000000UL, 0x1c0e0e12UL, 0x6834345cUL, -0x2a15153fUL, 0xf5808075UL, 0xdd949449UL, 0x33e3e3d0UL, -0x2fededc2UL, 0x9fb5b52aUL, 0xa65353f5UL, 0x46232365UL, -0x964b4bddUL, 0x8e4747c9UL, 0x2e171739UL, 0xbba7a71cUL, -0xd5909045UL, 0x6a35355fUL, 0xa3abab08UL, 0x45d8d89dUL, -0x85b8b83dUL, 0x4bdfdf94UL, 0x9e4f4fd1UL, 0xae5757f9UL, -0xc19a9a5bUL, 0xd1929243UL, 0x43dbdb98UL, 0x361b1b2dUL, -0x783c3c44UL, 0x65c8c8adUL, 0xc799995eUL, 0x0804040cUL, -0xe98e8e67UL, 0x35e0e0d5UL, 0x5bd7d78cUL, 0xfa7d7d87UL, -0xff85857aUL, 0x83bbbb38UL, 0x804040c0UL, 0x582c2c74UL, -0x743a3a4eUL, 0x8a4545cfUL, 0x17f1f1e6UL, 0x844242c6UL, -0xca6565afUL, 0x40202060UL, 0x824141c3UL, 0x30181828UL, -0xe4727296UL, 0x4a25256fUL, 0xd3939340UL, 0xe0707090UL, -0x6c36365aUL, 0x0a05050fUL, 0x11f2f2e3UL, 0x160b0b1dUL, -0xb3a3a310UL, 0xf279798bUL, 0x2dececc1UL, 0x10080818UL, -0x4e272769UL, 0x62313153UL, 0x64323256UL, 0x99b6b62fUL, -0xf87c7c84UL, 0x95b0b025UL, 0x140a0a1eUL, 0xe6737395UL, -0xb65b5bedUL, 0xf67b7b8dUL, 0x9bb7b72cUL, 0xf7818176UL, -0x51d2d283UL, 0x1a0d0d17UL, 0xd46a6abeUL, 0x4c26266aUL, -0xc99e9e57UL, 0xb05858e8UL, 0xcd9c9c51UL, 0xf3838370UL, -0xe874749cUL, 0x93b3b320UL, 0xadacac01UL, 0x60303050UL, -0xf47a7a8eUL, 0xd26969bbUL, 0xee777799UL, 0x1e0f0f11UL, -0xa9aeae07UL, 0x42212163UL, 0x49dede97UL, 0x55d0d085UL, -0x5c2e2e72UL, 0xdb97974cUL, 0x20101030UL, 0xbda4a419UL, -0xc598985dUL, 0xa5a8a80dUL, 0x5dd4d489UL, 0xd06868b8UL, -0x5a2d2d77UL, 0xc46262a6UL, 0x5229297bUL, 0xda6d6db7UL, -0x2c16163aUL, 0x924949dbUL, 0xec76769aUL, 0x7bc7c7bcUL, -0x25e8e8cdUL, 0x77c1c1b6UL, 0xd996964fUL, 0x6e373759UL, -0x3fe5e5daUL, 0x61cacaabUL, 0x1df4f4e9UL, 0x27e9e9ceUL, -0xc66363a5UL, 0x24121236UL, 0x71c2c2b3UL, 0xb9a6a61fUL, -0x2814143cUL, 0x8dbcbc31UL, 0x53d3d380UL, 0x50282878UL, -0xabafaf04UL, 0x5e2f2f71UL, 0x39e6e6dfUL, 0x4824246cUL, -0xa45252f6UL, 0x79c6c6bfUL, 0xb5a0a015UL, 0x1209091bUL, -0x8fbdbd32UL, 0xed8c8c61UL, 0x6bcfcfa4UL, 0xba5d5de7UL, -0x22111133UL, 0xbe5f5fe1UL, 0x02010103UL, 0x7fc5c5baUL, -0xcb9f9f54UL, 0x7a3d3d47UL, 0xb1a2a213UL, 0xc39b9b58UL, -0x67c9c9aeUL, 0x763b3b4dUL, 0x89bebe37UL, 0xa25151f3UL, -0x3219192bUL, 0x3e1f1f21UL, 0x7e3f3f41UL, 0xb85c5ce4UL, -0x91b2b223UL, 0x2befefc4UL, 0x944a4adeUL, 0x6fcdcda2UL, -0x8bbfbf34UL, 0x81baba3bUL, 0xde6f6fb1UL, 0xc86464acUL, -0x47d9d99eUL, 0x13f3f3e0UL, 0x7c3e3e42UL, 0x9db4b429UL, -0xa1aaaa0bUL, 0x4ddcdc91UL, 0x5fd5d58aUL, 0x0c06060aUL, -0x75c0c0b5UL, 0xfc7e7e82UL, 0x19f6f6efUL, 0xcc6666aaUL, -0xd86c6cb4UL, 0xfd848479UL, 0xe2717193UL, 0x70383848UL, -0x87b9b93eUL, 0x3a1d1d27UL, 0xfe7f7f81UL, 0xcf9d9d52UL, -0x904848d8UL, 0xe38b8b68UL, 0x542a2a7eUL, 0x41dada9bUL, -0xbfa5a51aUL, 0x66333355UL, 0xf1828273UL, 0x7239394bUL, -0x59d6d68fUL, 0xf0787888UL, 0xf986867fUL, 0x01fafafbUL, -0x3de4e4d9UL, 0x562b2b7dUL, 0xa7a9a90eUL, 0x3c1e1e22UL, -0xe789896eUL, 0xc06060a0UL, 0xd66b6bbdUL, 0x21eaeacbUL, -0xaa5555ffUL, 0x984c4cd4UL, 0x1bf7f7ecUL, 0x31e2e2d3UL, -}, - -{ -0x2697b1b1UL, 0xa769ceceUL, 0xb073c3c3UL, 0x4adf9595UL, -0xeeb45a5aUL, 0x02afadadUL, 0xdc3be7e7UL, 0x06040202UL, -0xd79a4d4dUL, 0xcc884444UL, 0xf803fbfbUL, 0x46d79191UL, -0x14180c0cUL, 0x7cfb8787UL, 0x16b7a1a1UL, 0xf0a05050UL, -0xa863cbcbUL, 0xa9ce6767UL, 0xfca85454UL, 0x924fddddUL, -0xca8c4646UL, 0x64eb8f8fUL, 0xd637e1e1UL, 0xd29c4e4eUL, -0xe515f0f0UL, 0xf20ffdfdUL, 0xf10dfcfcUL, 0xc823ebebUL, -0xfe07f9f9UL, 0xb97dc4c4UL, 0x2e341a1aUL, 0xb2dc6e6eUL, -0xe2bc5e5eUL, 0xea1ff5f5UL, 0xa16dccccUL, 0x62ef8d8dUL, -0x24381c1cUL, 0xfaac5656UL, 0xc5864343UL, 0xf709fefeUL, -0x090e0707UL, 0xa3c26161UL, 0xfd05f8f8UL, 0x9fea7575UL, -0xebb25959UL, 0xf40bffffUL, 0x05060303UL, 0x66442222UL, -0x6be18a8aUL, 0x8657d1d1UL, 0x35261313UL, 0xc729eeeeUL, -0x6de58888UL, 0x00000000UL, 0x121c0e0eUL, 0x5c683434UL, -0x3f2a1515UL, 0x75f58080UL, 0x49dd9494UL, 0xd033e3e3UL, -0xc22fededUL, 0x2a9fb5b5UL, 0xf5a65353UL, 0x65462323UL, -0xdd964b4bUL, 0xc98e4747UL, 0x392e1717UL, 0x1cbba7a7UL, -0x45d59090UL, 0x5f6a3535UL, 0x08a3ababUL, 0x9d45d8d8UL, -0x3d85b8b8UL, 0x944bdfdfUL, 0xd19e4f4fUL, 0xf9ae5757UL, -0x5bc19a9aUL, 0x43d19292UL, 0x9843dbdbUL, 0x2d361b1bUL, -0x44783c3cUL, 0xad65c8c8UL, 0x5ec79999UL, 0x0c080404UL, -0x67e98e8eUL, 0xd535e0e0UL, 0x8c5bd7d7UL, 0x87fa7d7dUL, -0x7aff8585UL, 0x3883bbbbUL, 0xc0804040UL, 0x74582c2cUL, -0x4e743a3aUL, 0xcf8a4545UL, 0xe617f1f1UL, 0xc6844242UL, -0xafca6565UL, 0x60402020UL, 0xc3824141UL, 0x28301818UL, -0x96e47272UL, 0x6f4a2525UL, 0x40d39393UL, 0x90e07070UL, -0x5a6c3636UL, 0x0f0a0505UL, 0xe311f2f2UL, 0x1d160b0bUL, -0x10b3a3a3UL, 0x8bf27979UL, 0xc12dececUL, 0x18100808UL, -0x694e2727UL, 0x53623131UL, 0x56643232UL, 0x2f99b6b6UL, -0x84f87c7cUL, 0x2595b0b0UL, 0x1e140a0aUL, 0x95e67373UL, -0xedb65b5bUL, 0x8df67b7bUL, 0x2c9bb7b7UL, 0x76f78181UL, -0x8351d2d2UL, 0x171a0d0dUL, 0xbed46a6aUL, 0x6a4c2626UL, -0x57c99e9eUL, 0xe8b05858UL, 0x51cd9c9cUL, 0x70f38383UL, -0x9ce87474UL, 0x2093b3b3UL, 0x01adacacUL, 0x50603030UL, -0x8ef47a7aUL, 0xbbd26969UL, 0x99ee7777UL, 0x111e0f0fUL, -0x07a9aeaeUL, 0x63422121UL, 0x9749dedeUL, 0x8555d0d0UL, -0x725c2e2eUL, 0x4cdb9797UL, 0x30201010UL, 0x19bda4a4UL, -0x5dc59898UL, 0x0da5a8a8UL, 0x895dd4d4UL, 0xb8d06868UL, -0x775a2d2dUL, 0xa6c46262UL, 0x7b522929UL, 0xb7da6d6dUL, -0x3a2c1616UL, 0xdb924949UL, 0x9aec7676UL, 0xbc7bc7c7UL, -0xcd25e8e8UL, 0xb677c1c1UL, 0x4fd99696UL, 0x596e3737UL, -0xda3fe5e5UL, 0xab61cacaUL, 0xe91df4f4UL, 0xce27e9e9UL, -0xa5c66363UL, 0x36241212UL, 0xb371c2c2UL, 0x1fb9a6a6UL, -0x3c281414UL, 0x318dbcbcUL, 0x8053d3d3UL, 0x78502828UL, -0x04abafafUL, 0x715e2f2fUL, 0xdf39e6e6UL, 0x6c482424UL, -0xf6a45252UL, 0xbf79c6c6UL, 0x15b5a0a0UL, 0x1b120909UL, -0x328fbdbdUL, 0x61ed8c8cUL, 0xa46bcfcfUL, 0xe7ba5d5dUL, -0x33221111UL, 0xe1be5f5fUL, 0x03020101UL, 0xba7fc5c5UL, -0x54cb9f9fUL, 0x477a3d3dUL, 0x13b1a2a2UL, 0x58c39b9bUL, -0xae67c9c9UL, 0x4d763b3bUL, 0x3789bebeUL, 0xf3a25151UL, -0x2b321919UL, 0x213e1f1fUL, 0x417e3f3fUL, 0xe4b85c5cUL, -0x2391b2b2UL, 0xc42befefUL, 0xde944a4aUL, 0xa26fcdcdUL, -0x348bbfbfUL, 0x3b81babaUL, 0xb1de6f6fUL, 0xacc86464UL, -0x9e47d9d9UL, 0xe013f3f3UL, 0x427c3e3eUL, 0x299db4b4UL, -0x0ba1aaaaUL, 0x914ddcdcUL, 0x8a5fd5d5UL, 0x0a0c0606UL, -0xb575c0c0UL, 0x82fc7e7eUL, 0xef19f6f6UL, 0xaacc6666UL, -0xb4d86c6cUL, 0x79fd8484UL, 0x93e27171UL, 0x48703838UL, -0x3e87b9b9UL, 0x273a1d1dUL, 0x81fe7f7fUL, 0x52cf9d9dUL, -0xd8904848UL, 0x68e38b8bUL, 0x7e542a2aUL, 0x9b41dadaUL, -0x1abfa5a5UL, 0x55663333UL, 0x73f18282UL, 0x4b723939UL, -0x8f59d6d6UL, 0x88f07878UL, 0x7ff98686UL, 0xfb01fafaUL, -0xd93de4e4UL, 0x7d562b2bUL, 0x0ea7a9a9UL, 0x223c1e1eUL, -0x6ee78989UL, 0xa0c06060UL, 0xbdd66b6bUL, 0xcb21eaeaUL, -0xffaa5555UL, 0xd4984c4cUL, 0xec1bf7f7UL, 0xd331e2e2UL, -}, - -{ -0xb12697b1UL, 0xcea769ceUL, 0xc3b073c3UL, 0x954adf95UL, -0x5aeeb45aUL, 0xad02afadUL, 0xe7dc3be7UL, 0x02060402UL, -0x4dd79a4dUL, 0x44cc8844UL, 0xfbf803fbUL, 0x9146d791UL, -0x0c14180cUL, 0x877cfb87UL, 0xa116b7a1UL, 0x50f0a050UL, -0xcba863cbUL, 0x67a9ce67UL, 0x54fca854UL, 0xdd924fddUL, -0x46ca8c46UL, 0x8f64eb8fUL, 0xe1d637e1UL, 0x4ed29c4eUL, -0xf0e515f0UL, 0xfdf20ffdUL, 0xfcf10dfcUL, 0xebc823ebUL, -0xf9fe07f9UL, 0xc4b97dc4UL, 0x1a2e341aUL, 0x6eb2dc6eUL, -0x5ee2bc5eUL, 0xf5ea1ff5UL, 0xcca16dccUL, 0x8d62ef8dUL, -0x1c24381cUL, 0x56faac56UL, 0x43c58643UL, 0xfef709feUL, -0x07090e07UL, 0x61a3c261UL, 0xf8fd05f8UL, 0x759fea75UL, -0x59ebb259UL, 0xfff40bffUL, 0x03050603UL, 0x22664422UL, -0x8a6be18aUL, 0xd18657d1UL, 0x13352613UL, 0xeec729eeUL, -0x886de588UL, 0x00000000UL, 0x0e121c0eUL, 0x345c6834UL, -0x153f2a15UL, 0x8075f580UL, 0x9449dd94UL, 0xe3d033e3UL, -0xedc22fedUL, 0xb52a9fb5UL, 0x53f5a653UL, 0x23654623UL, -0x4bdd964bUL, 0x47c98e47UL, 0x17392e17UL, 0xa71cbba7UL, -0x9045d590UL, 0x355f6a35UL, 0xab08a3abUL, 0xd89d45d8UL, -0xb83d85b8UL, 0xdf944bdfUL, 0x4fd19e4fUL, 0x57f9ae57UL, -0x9a5bc19aUL, 0x9243d192UL, 0xdb9843dbUL, 0x1b2d361bUL, -0x3c44783cUL, 0xc8ad65c8UL, 0x995ec799UL, 0x040c0804UL, -0x8e67e98eUL, 0xe0d535e0UL, 0xd78c5bd7UL, 0x7d87fa7dUL, -0x857aff85UL, 0xbb3883bbUL, 0x40c08040UL, 0x2c74582cUL, -0x3a4e743aUL, 0x45cf8a45UL, 0xf1e617f1UL, 0x42c68442UL, -0x65afca65UL, 0x20604020UL, 0x41c38241UL, 0x18283018UL, -0x7296e472UL, 0x256f4a25UL, 0x9340d393UL, 0x7090e070UL, -0x365a6c36UL, 0x050f0a05UL, 0xf2e311f2UL, 0x0b1d160bUL, -0xa310b3a3UL, 0x798bf279UL, 0xecc12decUL, 0x08181008UL, -0x27694e27UL, 0x31536231UL, 0x32566432UL, 0xb62f99b6UL, -0x7c84f87cUL, 0xb02595b0UL, 0x0a1e140aUL, 0x7395e673UL, -0x5bedb65bUL, 0x7b8df67bUL, 0xb72c9bb7UL, 0x8176f781UL, -0xd28351d2UL, 0x0d171a0dUL, 0x6abed46aUL, 0x266a4c26UL, -0x9e57c99eUL, 0x58e8b058UL, 0x9c51cd9cUL, 0x8370f383UL, -0x749ce874UL, 0xb32093b3UL, 0xac01adacUL, 0x30506030UL, -0x7a8ef47aUL, 0x69bbd269UL, 0x7799ee77UL, 0x0f111e0fUL, -0xae07a9aeUL, 0x21634221UL, 0xde9749deUL, 0xd08555d0UL, -0x2e725c2eUL, 0x974cdb97UL, 0x10302010UL, 0xa419bda4UL, -0x985dc598UL, 0xa80da5a8UL, 0xd4895dd4UL, 0x68b8d068UL, -0x2d775a2dUL, 0x62a6c462UL, 0x297b5229UL, 0x6db7da6dUL, -0x163a2c16UL, 0x49db9249UL, 0x769aec76UL, 0xc7bc7bc7UL, -0xe8cd25e8UL, 0xc1b677c1UL, 0x964fd996UL, 0x37596e37UL, -0xe5da3fe5UL, 0xcaab61caUL, 0xf4e91df4UL, 0xe9ce27e9UL, -0x63a5c663UL, 0x12362412UL, 0xc2b371c2UL, 0xa61fb9a6UL, -0x143c2814UL, 0xbc318dbcUL, 0xd38053d3UL, 0x28785028UL, -0xaf04abafUL, 0x2f715e2fUL, 0xe6df39e6UL, 0x246c4824UL, -0x52f6a452UL, 0xc6bf79c6UL, 0xa015b5a0UL, 0x091b1209UL, -0xbd328fbdUL, 0x8c61ed8cUL, 0xcfa46bcfUL, 0x5de7ba5dUL, -0x11332211UL, 0x5fe1be5fUL, 0x01030201UL, 0xc5ba7fc5UL, -0x9f54cb9fUL, 0x3d477a3dUL, 0xa213b1a2UL, 0x9b58c39bUL, -0xc9ae67c9UL, 0x3b4d763bUL, 0xbe3789beUL, 0x51f3a251UL, -0x192b3219UL, 0x1f213e1fUL, 0x3f417e3fUL, 0x5ce4b85cUL, -0xb22391b2UL, 0xefc42befUL, 0x4ade944aUL, 0xcda26fcdUL, -0xbf348bbfUL, 0xba3b81baUL, 0x6fb1de6fUL, 0x64acc864UL, -0xd99e47d9UL, 0xf3e013f3UL, 0x3e427c3eUL, 0xb4299db4UL, -0xaa0ba1aaUL, 0xdc914ddcUL, 0xd58a5fd5UL, 0x060a0c06UL, -0xc0b575c0UL, 0x7e82fc7eUL, 0xf6ef19f6UL, 0x66aacc66UL, -0x6cb4d86cUL, 0x8479fd84UL, 0x7193e271UL, 0x38487038UL, -0xb93e87b9UL, 0x1d273a1dUL, 0x7f81fe7fUL, 0x9d52cf9dUL, -0x48d89048UL, 0x8b68e38bUL, 0x2a7e542aUL, 0xda9b41daUL, -0xa51abfa5UL, 0x33556633UL, 0x8273f182UL, 0x394b7239UL, -0xd68f59d6UL, 0x7888f078UL, 0x867ff986UL, 0xfafb01faUL, -0xe4d93de4UL, 0x2b7d562bUL, 0xa90ea7a9UL, 0x1e223c1eUL, -0x896ee789UL, 0x60a0c060UL, 0x6bbdd66bUL, 0xeacb21eaUL, -0x55ffaa55UL, 0x4cd4984cUL, 0xf7ec1bf7UL, 0xe2d331e2UL, -}, - -{ -0xb1b12697UL, 0xcecea769UL, 0xc3c3b073UL, 0x95954adfUL, -0x5a5aeeb4UL, 0xadad02afUL, 0xe7e7dc3bUL, 0x02020604UL, -0x4d4dd79aUL, 0x4444cc88UL, 0xfbfbf803UL, 0x919146d7UL, -0x0c0c1418UL, 0x87877cfbUL, 0xa1a116b7UL, 0x5050f0a0UL, -0xcbcba863UL, 0x6767a9ceUL, 0x5454fca8UL, 0xdddd924fUL, -0x4646ca8cUL, 0x8f8f64ebUL, 0xe1e1d637UL, 0x4e4ed29cUL, -0xf0f0e515UL, 0xfdfdf20fUL, 0xfcfcf10dUL, 0xebebc823UL, -0xf9f9fe07UL, 0xc4c4b97dUL, 0x1a1a2e34UL, 0x6e6eb2dcUL, -0x5e5ee2bcUL, 0xf5f5ea1fUL, 0xcccca16dUL, 0x8d8d62efUL, -0x1c1c2438UL, 0x5656faacUL, 0x4343c586UL, 0xfefef709UL, -0x0707090eUL, 0x6161a3c2UL, 0xf8f8fd05UL, 0x75759feaUL, -0x5959ebb2UL, 0xfffff40bUL, 0x03030506UL, 0x22226644UL, -0x8a8a6be1UL, 0xd1d18657UL, 0x13133526UL, 0xeeeec729UL, -0x88886de5UL, 0x00000000UL, 0x0e0e121cUL, 0x34345c68UL, -0x15153f2aUL, 0x808075f5UL, 0x949449ddUL, 0xe3e3d033UL, -0xededc22fUL, 0xb5b52a9fUL, 0x5353f5a6UL, 0x23236546UL, -0x4b4bdd96UL, 0x4747c98eUL, 0x1717392eUL, 0xa7a71cbbUL, -0x909045d5UL, 0x35355f6aUL, 0xabab08a3UL, 0xd8d89d45UL, -0xb8b83d85UL, 0xdfdf944bUL, 0x4f4fd19eUL, 0x5757f9aeUL, -0x9a9a5bc1UL, 0x929243d1UL, 0xdbdb9843UL, 0x1b1b2d36UL, -0x3c3c4478UL, 0xc8c8ad65UL, 0x99995ec7UL, 0x04040c08UL, -0x8e8e67e9UL, 0xe0e0d535UL, 0xd7d78c5bUL, 0x7d7d87faUL, -0x85857affUL, 0xbbbb3883UL, 0x4040c080UL, 0x2c2c7458UL, -0x3a3a4e74UL, 0x4545cf8aUL, 0xf1f1e617UL, 0x4242c684UL, -0x6565afcaUL, 0x20206040UL, 0x4141c382UL, 0x18182830UL, -0x727296e4UL, 0x25256f4aUL, 0x939340d3UL, 0x707090e0UL, -0x36365a6cUL, 0x05050f0aUL, 0xf2f2e311UL, 0x0b0b1d16UL, -0xa3a310b3UL, 0x79798bf2UL, 0xececc12dUL, 0x08081810UL, -0x2727694eUL, 0x31315362UL, 0x32325664UL, 0xb6b62f99UL, -0x7c7c84f8UL, 0xb0b02595UL, 0x0a0a1e14UL, 0x737395e6UL, -0x5b5bedb6UL, 0x7b7b8df6UL, 0xb7b72c9bUL, 0x818176f7UL, -0xd2d28351UL, 0x0d0d171aUL, 0x6a6abed4UL, 0x26266a4cUL, -0x9e9e57c9UL, 0x5858e8b0UL, 0x9c9c51cdUL, 0x838370f3UL, -0x74749ce8UL, 0xb3b32093UL, 0xacac01adUL, 0x30305060UL, -0x7a7a8ef4UL, 0x6969bbd2UL, 0x777799eeUL, 0x0f0f111eUL, -0xaeae07a9UL, 0x21216342UL, 0xdede9749UL, 0xd0d08555UL, -0x2e2e725cUL, 0x97974cdbUL, 0x10103020UL, 0xa4a419bdUL, -0x98985dc5UL, 0xa8a80da5UL, 0xd4d4895dUL, 0x6868b8d0UL, -0x2d2d775aUL, 0x6262a6c4UL, 0x29297b52UL, 0x6d6db7daUL, -0x16163a2cUL, 0x4949db92UL, 0x76769aecUL, 0xc7c7bc7bUL, -0xe8e8cd25UL, 0xc1c1b677UL, 0x96964fd9UL, 0x3737596eUL, -0xe5e5da3fUL, 0xcacaab61UL, 0xf4f4e91dUL, 0xe9e9ce27UL, -0x6363a5c6UL, 0x12123624UL, 0xc2c2b371UL, 0xa6a61fb9UL, -0x14143c28UL, 0xbcbc318dUL, 0xd3d38053UL, 0x28287850UL, -0xafaf04abUL, 0x2f2f715eUL, 0xe6e6df39UL, 0x24246c48UL, -0x5252f6a4UL, 0xc6c6bf79UL, 0xa0a015b5UL, 0x09091b12UL, -0xbdbd328fUL, 0x8c8c61edUL, 0xcfcfa46bUL, 0x5d5de7baUL, -0x11113322UL, 0x5f5fe1beUL, 0x01010302UL, 0xc5c5ba7fUL, -0x9f9f54cbUL, 0x3d3d477aUL, 0xa2a213b1UL, 0x9b9b58c3UL, -0xc9c9ae67UL, 0x3b3b4d76UL, 0xbebe3789UL, 0x5151f3a2UL, -0x19192b32UL, 0x1f1f213eUL, 0x3f3f417eUL, 0x5c5ce4b8UL, -0xb2b22391UL, 0xefefc42bUL, 0x4a4ade94UL, 0xcdcda26fUL, -0xbfbf348bUL, 0xbaba3b81UL, 0x6f6fb1deUL, 0x6464acc8UL, -0xd9d99e47UL, 0xf3f3e013UL, 0x3e3e427cUL, 0xb4b4299dUL, -0xaaaa0ba1UL, 0xdcdc914dUL, 0xd5d58a5fUL, 0x06060a0cUL, -0xc0c0b575UL, 0x7e7e82fcUL, 0xf6f6ef19UL, 0x6666aaccUL, -0x6c6cb4d8UL, 0x848479fdUL, 0x717193e2UL, 0x38384870UL, -0xb9b93e87UL, 0x1d1d273aUL, 0x7f7f81feUL, 0x9d9d52cfUL, -0x4848d890UL, 0x8b8b68e3UL, 0x2a2a7e54UL, 0xdada9b41UL, -0xa5a51abfUL, 0x33335566UL, 0x828273f1UL, 0x39394b72UL, -0xd6d68f59UL, 0x787888f0UL, 0x86867ff9UL, 0xfafafb01UL, -0xe4e4d93dUL, 0x2b2b7d56UL, 0xa9a90ea7UL, 0x1e1e223cUL, -0x89896ee7UL, 0x6060a0c0UL, 0x6b6bbdd6UL, 0xeaeacb21UL, -0x5555ffaaUL, 0x4c4cd498UL, 0xf7f7ec1bUL, 0xe2e2d331UL, -}}; - -const word32 Square::Dec::Td[4][256] = { -{ -0xe368bc02UL, 0x5585620cUL, 0x2a3f2331UL, 0x61ab13f7UL, -0x98d46d72UL, 0x21cb9a19UL, 0x3c22a461UL, 0x459d3dcdUL, -0x05fdb423UL, 0x2bc4075fUL, 0x9b2c01c0UL, 0x3dd9800fUL, -0x486c5c74UL, 0xf97f7e85UL, 0xf173ab1fUL, 0xb6edde0eUL, -0x283c6bedUL, 0x4997781aUL, 0x9f2a918dUL, 0xc9579f33UL, -0xa907a8aaUL, 0xa50ded7dUL, 0x7c422d8fUL, 0x764db0c9UL, -0x4d91e857UL, 0xcea963ccUL, 0xb4ee96d2UL, 0x3028e1b6UL, -0x0df161b9UL, 0xbd196726UL, 0x419bad80UL, 0xc0a06ec7UL, -0x5183f241UL, 0x92dbf034UL, 0x6fa21efcUL, 0x8f32ce4cUL, -0x13e03373UL, 0x69a7c66dUL, 0xe56d6493UL, 0xbf1a2ffaUL, -0xbb1cbfb7UL, 0x587403b5UL, 0xe76e2c4fUL, 0x5d89b796UL, -0xe89c052aUL, 0x446619a3UL, 0x342e71fbUL, 0x0ff22965UL, -0xfe81827aUL, 0xb11322f1UL, 0xa30835ecUL, 0xcd510f7eUL, -0xff7aa614UL, 0x5c7293f8UL, 0x2fc29712UL, 0xf370e3c3UL, -0x992f491cUL, 0xd1431568UL, 0xc2a3261bUL, 0x88cc32b3UL, -0x8acf7a6fUL, 0xb0e8069fUL, 0x7a47f51eUL, 0xd2bb79daUL, -0xe6950821UL, 0x4398e55cUL, 0xd0b83106UL, 0x11e37bafUL, -0x7e416553UL, 0xccaa2b10UL, 0xd8b4e49cUL, 0x6456a7d4UL, -0xfb7c3659UL, 0x724b2084UL, 0xea9f4df6UL, 0x6a5faadfUL, -0x2dc1dfceUL, 0x70486858UL, 0xcaaff381UL, 0x0605d891UL, -0x5a774b69UL, 0x94de28a5UL, 0x39df1042UL, 0x813bc347UL, -0xfc82caa6UL, 0x23c8d2c5UL, 0x03f86cb2UL, 0x080cd59aUL, -0xdab7ac40UL, 0x7db909e1UL, 0x3824342cUL, 0xcf5247a2UL, -0xdcb274d1UL, 0x63a85b2bUL, 0x35d55595UL, 0x479e7511UL, -0x15e5ebe2UL, 0x4b9430c6UL, 0x4a6f14a8UL, 0x91239c86UL, -0x4c6acc39UL, 0x5f8aff4aUL, 0x0406904dUL, 0xee99ddbbUL, -0x1e1152caUL, 0xaaffc418UL, 0xeb646998UL, 0x07fefcffUL, -0x8b345e01UL, 0x567d0ebeUL, 0xbae79bd9UL, 0x4263c132UL, -0x75b5dc7bUL, 0x97264417UL, 0x67aecb66UL, 0x95250ccbUL, -0xec9a9567UL, 0x57862ad0UL, 0x60503799UL, 0xb8e4d305UL, -0x65ad83baUL, 0x19efae35UL, 0xa4f6c913UL, 0xc15b4aa9UL, -0x873e1bd6UL, 0xa0f0595eUL, 0x18148a5bUL, 0xaf02703bUL, -0xab04e076UL, 0xdd4950bfUL, 0xdf4a1863UL, 0xc6a5b656UL, -0x853d530aUL, 0xfa871237UL, 0x77b694a7UL, 0x4665517fUL, -0xed61b109UL, 0x1bece6e9UL, 0xd5458525UL, 0xf5753b52UL, -0x7fba413dUL, 0x27ce4288UL, 0xb2eb4e43UL, 0xd6bde997UL, -0x527b9ef3UL, 0x62537f45UL, 0x2c3afba0UL, 0x7bbcd170UL, -0xb91ff76bUL, 0x121b171dUL, 0xfd79eec8UL, 0x3a277cf0UL, -0x0c0a45d7UL, 0x96dd6079UL, 0x2233f6abUL, 0xacfa1c89UL, -0xc8acbb5dUL, 0xa10b7d30UL, 0xd4bea14bUL, 0xbee10b94UL, -0x25cd0a54UL, 0x547e4662UL, 0xa2f31182UL, 0x17e6a33eUL, -0x263566e6UL, 0xc3580275UL, 0x83388b9bUL, 0x7844bdc2UL, -0x020348dcUL, 0x4f92a08bUL, 0x2e39b37cUL, 0x4e6984e5UL, -0xf0888f71UL, 0x362d3927UL, 0x9cd2fd3fUL, 0x01fb246eUL, -0x893716ddUL, 0x00000000UL, 0xf68d57e0UL, 0xe293986cUL, -0x744ef815UL, 0x9320d45aUL, 0xad0138e7UL, 0xd3405db4UL, -0x1a17c287UL, 0xb3106a2dUL, 0x5078d62fUL, 0xf48e1f3cUL, -0xa70ea5a1UL, 0x71b34c36UL, 0x9ad725aeUL, 0x5e71db24UL, -0x161d8750UL, 0xef62f9d5UL, 0x8d318690UL, 0x1c121a16UL, -0xa6f581cfUL, 0x5b8c6f07UL, 0x37d61d49UL, 0x6e593a92UL, -0x84c67764UL, 0x86c53fb8UL, 0xd746cdf9UL, 0xe090d0b0UL, -0x29c74f83UL, 0xe49640fdUL, 0x0e090d0bUL, 0x6da15620UL, -0x8ec9ea22UL, 0xdb4c882eUL, 0xf776738eUL, 0xb515b2bcUL, -0x10185fc1UL, 0x322ba96aUL, 0x6ba48eb1UL, 0xaef95455UL, -0x406089eeUL, 0x6655ef08UL, 0xe9672144UL, 0x3e21ecbdUL, -0x2030be77UL, 0xf28bc7adUL, 0x80c0e729UL, 0x141ecf8cUL, -0xbce24348UL, 0xc4a6fe8aUL, 0x31d3c5d8UL, 0xb716fa60UL, -0x5380ba9dUL, 0xd94fc0f2UL, 0x1de93e78UL, 0x24362e3aUL, -0xe16bf4deUL, 0xcb54d7efUL, 0x09f7f1f4UL, 0x82c3aff5UL, -0x0bf4b928UL, 0x9d29d951UL, 0xc75e9238UL, 0xf8845aebUL, -0x90d8b8e8UL, 0xdeb13c0dUL, 0x33d08d04UL, 0x685ce203UL, -0xc55ddae4UL, 0x3bdc589eUL, 0x0a0f9d46UL, 0x3fdac8d3UL, -0x598f27dbUL, 0xa8fc8cc4UL, 0x79bf99acUL, 0x6c5a724eUL, -0x8ccaa2feUL, 0x9ed1b5e3UL, 0x1fea76a4UL, 0x73b004eaUL, -}, - -{ -0x02e368bcUL, 0x0c558562UL, 0x312a3f23UL, 0xf761ab13UL, -0x7298d46dUL, 0x1921cb9aUL, 0x613c22a4UL, 0xcd459d3dUL, -0x2305fdb4UL, 0x5f2bc407UL, 0xc09b2c01UL, 0x0f3dd980UL, -0x74486c5cUL, 0x85f97f7eUL, 0x1ff173abUL, 0x0eb6eddeUL, -0xed283c6bUL, 0x1a499778UL, 0x8d9f2a91UL, 0x33c9579fUL, -0xaaa907a8UL, 0x7da50dedUL, 0x8f7c422dUL, 0xc9764db0UL, -0x574d91e8UL, 0xcccea963UL, 0xd2b4ee96UL, 0xb63028e1UL, -0xb90df161UL, 0x26bd1967UL, 0x80419badUL, 0xc7c0a06eUL, -0x415183f2UL, 0x3492dbf0UL, 0xfc6fa21eUL, 0x4c8f32ceUL, -0x7313e033UL, 0x6d69a7c6UL, 0x93e56d64UL, 0xfabf1a2fUL, -0xb7bb1cbfUL, 0xb5587403UL, 0x4fe76e2cUL, 0x965d89b7UL, -0x2ae89c05UL, 0xa3446619UL, 0xfb342e71UL, 0x650ff229UL, -0x7afe8182UL, 0xf1b11322UL, 0xeca30835UL, 0x7ecd510fUL, -0x14ff7aa6UL, 0xf85c7293UL, 0x122fc297UL, 0xc3f370e3UL, -0x1c992f49UL, 0x68d14315UL, 0x1bc2a326UL, 0xb388cc32UL, -0x6f8acf7aUL, 0x9fb0e806UL, 0x1e7a47f5UL, 0xdad2bb79UL, -0x21e69508UL, 0x5c4398e5UL, 0x06d0b831UL, 0xaf11e37bUL, -0x537e4165UL, 0x10ccaa2bUL, 0x9cd8b4e4UL, 0xd46456a7UL, -0x59fb7c36UL, 0x84724b20UL, 0xf6ea9f4dUL, 0xdf6a5faaUL, -0xce2dc1dfUL, 0x58704868UL, 0x81caaff3UL, 0x910605d8UL, -0x695a774bUL, 0xa594de28UL, 0x4239df10UL, 0x47813bc3UL, -0xa6fc82caUL, 0xc523c8d2UL, 0xb203f86cUL, 0x9a080cd5UL, -0x40dab7acUL, 0xe17db909UL, 0x2c382434UL, 0xa2cf5247UL, -0xd1dcb274UL, 0x2b63a85bUL, 0x9535d555UL, 0x11479e75UL, -0xe215e5ebUL, 0xc64b9430UL, 0xa84a6f14UL, 0x8691239cUL, -0x394c6accUL, 0x4a5f8affUL, 0x4d040690UL, 0xbbee99ddUL, -0xca1e1152UL, 0x18aaffc4UL, 0x98eb6469UL, 0xff07fefcUL, -0x018b345eUL, 0xbe567d0eUL, 0xd9bae79bUL, 0x324263c1UL, -0x7b75b5dcUL, 0x17972644UL, 0x6667aecbUL, 0xcb95250cUL, -0x67ec9a95UL, 0xd057862aUL, 0x99605037UL, 0x05b8e4d3UL, -0xba65ad83UL, 0x3519efaeUL, 0x13a4f6c9UL, 0xa9c15b4aUL, -0xd6873e1bUL, 0x5ea0f059UL, 0x5b18148aUL, 0x3baf0270UL, -0x76ab04e0UL, 0xbfdd4950UL, 0x63df4a18UL, 0x56c6a5b6UL, -0x0a853d53UL, 0x37fa8712UL, 0xa777b694UL, 0x7f466551UL, -0x09ed61b1UL, 0xe91bece6UL, 0x25d54585UL, 0x52f5753bUL, -0x3d7fba41UL, 0x8827ce42UL, 0x43b2eb4eUL, 0x97d6bde9UL, -0xf3527b9eUL, 0x4562537fUL, 0xa02c3afbUL, 0x707bbcd1UL, -0x6bb91ff7UL, 0x1d121b17UL, 0xc8fd79eeUL, 0xf03a277cUL, -0xd70c0a45UL, 0x7996dd60UL, 0xab2233f6UL, 0x89acfa1cUL, -0x5dc8acbbUL, 0x30a10b7dUL, 0x4bd4bea1UL, 0x94bee10bUL, -0x5425cd0aUL, 0x62547e46UL, 0x82a2f311UL, 0x3e17e6a3UL, -0xe6263566UL, 0x75c35802UL, 0x9b83388bUL, 0xc27844bdUL, -0xdc020348UL, 0x8b4f92a0UL, 0x7c2e39b3UL, 0xe54e6984UL, -0x71f0888fUL, 0x27362d39UL, 0x3f9cd2fdUL, 0x6e01fb24UL, -0xdd893716UL, 0x00000000UL, 0xe0f68d57UL, 0x6ce29398UL, -0x15744ef8UL, 0x5a9320d4UL, 0xe7ad0138UL, 0xb4d3405dUL, -0x871a17c2UL, 0x2db3106aUL, 0x2f5078d6UL, 0x3cf48e1fUL, -0xa1a70ea5UL, 0x3671b34cUL, 0xae9ad725UL, 0x245e71dbUL, -0x50161d87UL, 0xd5ef62f9UL, 0x908d3186UL, 0x161c121aUL, -0xcfa6f581UL, 0x075b8c6fUL, 0x4937d61dUL, 0x926e593aUL, -0x6484c677UL, 0xb886c53fUL, 0xf9d746cdUL, 0xb0e090d0UL, -0x8329c74fUL, 0xfde49640UL, 0x0b0e090dUL, 0x206da156UL, -0x228ec9eaUL, 0x2edb4c88UL, 0x8ef77673UL, 0xbcb515b2UL, -0xc110185fUL, 0x6a322ba9UL, 0xb16ba48eUL, 0x55aef954UL, -0xee406089UL, 0x086655efUL, 0x44e96721UL, 0xbd3e21ecUL, -0x772030beUL, 0xadf28bc7UL, 0x2980c0e7UL, 0x8c141ecfUL, -0x48bce243UL, 0x8ac4a6feUL, 0xd831d3c5UL, 0x60b716faUL, -0x9d5380baUL, 0xf2d94fc0UL, 0x781de93eUL, 0x3a24362eUL, -0xdee16bf4UL, 0xefcb54d7UL, 0xf409f7f1UL, 0xf582c3afUL, -0x280bf4b9UL, 0x519d29d9UL, 0x38c75e92UL, 0xebf8845aUL, -0xe890d8b8UL, 0x0ddeb13cUL, 0x0433d08dUL, 0x03685ce2UL, -0xe4c55ddaUL, 0x9e3bdc58UL, 0x460a0f9dUL, 0xd33fdac8UL, -0xdb598f27UL, 0xc4a8fc8cUL, 0xac79bf99UL, 0x4e6c5a72UL, -0xfe8ccaa2UL, 0xe39ed1b5UL, 0xa41fea76UL, 0xea73b004UL, -}, - -{ -0xbc02e368UL, 0x620c5585UL, 0x23312a3fUL, 0x13f761abUL, -0x6d7298d4UL, 0x9a1921cbUL, 0xa4613c22UL, 0x3dcd459dUL, -0xb42305fdUL, 0x075f2bc4UL, 0x01c09b2cUL, 0x800f3dd9UL, -0x5c74486cUL, 0x7e85f97fUL, 0xab1ff173UL, 0xde0eb6edUL, -0x6bed283cUL, 0x781a4997UL, 0x918d9f2aUL, 0x9f33c957UL, -0xa8aaa907UL, 0xed7da50dUL, 0x2d8f7c42UL, 0xb0c9764dUL, -0xe8574d91UL, 0x63cccea9UL, 0x96d2b4eeUL, 0xe1b63028UL, -0x61b90df1UL, 0x6726bd19UL, 0xad80419bUL, 0x6ec7c0a0UL, -0xf2415183UL, 0xf03492dbUL, 0x1efc6fa2UL, 0xce4c8f32UL, -0x337313e0UL, 0xc66d69a7UL, 0x6493e56dUL, 0x2ffabf1aUL, -0xbfb7bb1cUL, 0x03b55874UL, 0x2c4fe76eUL, 0xb7965d89UL, -0x052ae89cUL, 0x19a34466UL, 0x71fb342eUL, 0x29650ff2UL, -0x827afe81UL, 0x22f1b113UL, 0x35eca308UL, 0x0f7ecd51UL, -0xa614ff7aUL, 0x93f85c72UL, 0x97122fc2UL, 0xe3c3f370UL, -0x491c992fUL, 0x1568d143UL, 0x261bc2a3UL, 0x32b388ccUL, -0x7a6f8acfUL, 0x069fb0e8UL, 0xf51e7a47UL, 0x79dad2bbUL, -0x0821e695UL, 0xe55c4398UL, 0x3106d0b8UL, 0x7baf11e3UL, -0x65537e41UL, 0x2b10ccaaUL, 0xe49cd8b4UL, 0xa7d46456UL, -0x3659fb7cUL, 0x2084724bUL, 0x4df6ea9fUL, 0xaadf6a5fUL, -0xdfce2dc1UL, 0x68587048UL, 0xf381caafUL, 0xd8910605UL, -0x4b695a77UL, 0x28a594deUL, 0x104239dfUL, 0xc347813bUL, -0xcaa6fc82UL, 0xd2c523c8UL, 0x6cb203f8UL, 0xd59a080cUL, -0xac40dab7UL, 0x09e17db9UL, 0x342c3824UL, 0x47a2cf52UL, -0x74d1dcb2UL, 0x5b2b63a8UL, 0x559535d5UL, 0x7511479eUL, -0xebe215e5UL, 0x30c64b94UL, 0x14a84a6fUL, 0x9c869123UL, -0xcc394c6aUL, 0xff4a5f8aUL, 0x904d0406UL, 0xddbbee99UL, -0x52ca1e11UL, 0xc418aaffUL, 0x6998eb64UL, 0xfcff07feUL, -0x5e018b34UL, 0x0ebe567dUL, 0x9bd9bae7UL, 0xc1324263UL, -0xdc7b75b5UL, 0x44179726UL, 0xcb6667aeUL, 0x0ccb9525UL, -0x9567ec9aUL, 0x2ad05786UL, 0x37996050UL, 0xd305b8e4UL, -0x83ba65adUL, 0xae3519efUL, 0xc913a4f6UL, 0x4aa9c15bUL, -0x1bd6873eUL, 0x595ea0f0UL, 0x8a5b1814UL, 0x703baf02UL, -0xe076ab04UL, 0x50bfdd49UL, 0x1863df4aUL, 0xb656c6a5UL, -0x530a853dUL, 0x1237fa87UL, 0x94a777b6UL, 0x517f4665UL, -0xb109ed61UL, 0xe6e91becUL, 0x8525d545UL, 0x3b52f575UL, -0x413d7fbaUL, 0x428827ceUL, 0x4e43b2ebUL, 0xe997d6bdUL, -0x9ef3527bUL, 0x7f456253UL, 0xfba02c3aUL, 0xd1707bbcUL, -0xf76bb91fUL, 0x171d121bUL, 0xeec8fd79UL, 0x7cf03a27UL, -0x45d70c0aUL, 0x607996ddUL, 0xf6ab2233UL, 0x1c89acfaUL, -0xbb5dc8acUL, 0x7d30a10bUL, 0xa14bd4beUL, 0x0b94bee1UL, -0x0a5425cdUL, 0x4662547eUL, 0x1182a2f3UL, 0xa33e17e6UL, -0x66e62635UL, 0x0275c358UL, 0x8b9b8338UL, 0xbdc27844UL, -0x48dc0203UL, 0xa08b4f92UL, 0xb37c2e39UL, 0x84e54e69UL, -0x8f71f088UL, 0x3927362dUL, 0xfd3f9cd2UL, 0x246e01fbUL, -0x16dd8937UL, 0x00000000UL, 0x57e0f68dUL, 0x986ce293UL, -0xf815744eUL, 0xd45a9320UL, 0x38e7ad01UL, 0x5db4d340UL, -0xc2871a17UL, 0x6a2db310UL, 0xd62f5078UL, 0x1f3cf48eUL, -0xa5a1a70eUL, 0x4c3671b3UL, 0x25ae9ad7UL, 0xdb245e71UL, -0x8750161dUL, 0xf9d5ef62UL, 0x86908d31UL, 0x1a161c12UL, -0x81cfa6f5UL, 0x6f075b8cUL, 0x1d4937d6UL, 0x3a926e59UL, -0x776484c6UL, 0x3fb886c5UL, 0xcdf9d746UL, 0xd0b0e090UL, -0x4f8329c7UL, 0x40fde496UL, 0x0d0b0e09UL, 0x56206da1UL, -0xea228ec9UL, 0x882edb4cUL, 0x738ef776UL, 0xb2bcb515UL, -0x5fc11018UL, 0xa96a322bUL, 0x8eb16ba4UL, 0x5455aef9UL, -0x89ee4060UL, 0xef086655UL, 0x2144e967UL, 0xecbd3e21UL, -0xbe772030UL, 0xc7adf28bUL, 0xe72980c0UL, 0xcf8c141eUL, -0x4348bce2UL, 0xfe8ac4a6UL, 0xc5d831d3UL, 0xfa60b716UL, -0xba9d5380UL, 0xc0f2d94fUL, 0x3e781de9UL, 0x2e3a2436UL, -0xf4dee16bUL, 0xd7efcb54UL, 0xf1f409f7UL, 0xaff582c3UL, -0xb9280bf4UL, 0xd9519d29UL, 0x9238c75eUL, 0x5aebf884UL, -0xb8e890d8UL, 0x3c0ddeb1UL, 0x8d0433d0UL, 0xe203685cUL, -0xdae4c55dUL, 0x589e3bdcUL, 0x9d460a0fUL, 0xc8d33fdaUL, -0x27db598fUL, 0x8cc4a8fcUL, 0x99ac79bfUL, 0x724e6c5aUL, -0xa2fe8ccaUL, 0xb5e39ed1UL, 0x76a41feaUL, 0x04ea73b0UL, -}, - -{ -0x68bc02e3UL, 0x85620c55UL, 0x3f23312aUL, 0xab13f761UL, -0xd46d7298UL, 0xcb9a1921UL, 0x22a4613cUL, 0x9d3dcd45UL, -0xfdb42305UL, 0xc4075f2bUL, 0x2c01c09bUL, 0xd9800f3dUL, -0x6c5c7448UL, 0x7f7e85f9UL, 0x73ab1ff1UL, 0xedde0eb6UL, -0x3c6bed28UL, 0x97781a49UL, 0x2a918d9fUL, 0x579f33c9UL, -0x07a8aaa9UL, 0x0ded7da5UL, 0x422d8f7cUL, 0x4db0c976UL, -0x91e8574dUL, 0xa963ccceUL, 0xee96d2b4UL, 0x28e1b630UL, -0xf161b90dUL, 0x196726bdUL, 0x9bad8041UL, 0xa06ec7c0UL, -0x83f24151UL, 0xdbf03492UL, 0xa21efc6fUL, 0x32ce4c8fUL, -0xe0337313UL, 0xa7c66d69UL, 0x6d6493e5UL, 0x1a2ffabfUL, -0x1cbfb7bbUL, 0x7403b558UL, 0x6e2c4fe7UL, 0x89b7965dUL, -0x9c052ae8UL, 0x6619a344UL, 0x2e71fb34UL, 0xf229650fUL, -0x81827afeUL, 0x1322f1b1UL, 0x0835eca3UL, 0x510f7ecdUL, -0x7aa614ffUL, 0x7293f85cUL, 0xc297122fUL, 0x70e3c3f3UL, -0x2f491c99UL, 0x431568d1UL, 0xa3261bc2UL, 0xcc32b388UL, -0xcf7a6f8aUL, 0xe8069fb0UL, 0x47f51e7aUL, 0xbb79dad2UL, -0x950821e6UL, 0x98e55c43UL, 0xb83106d0UL, 0xe37baf11UL, -0x4165537eUL, 0xaa2b10ccUL, 0xb4e49cd8UL, 0x56a7d464UL, -0x7c3659fbUL, 0x4b208472UL, 0x9f4df6eaUL, 0x5faadf6aUL, -0xc1dfce2dUL, 0x48685870UL, 0xaff381caUL, 0x05d89106UL, -0x774b695aUL, 0xde28a594UL, 0xdf104239UL, 0x3bc34781UL, -0x82caa6fcUL, 0xc8d2c523UL, 0xf86cb203UL, 0x0cd59a08UL, -0xb7ac40daUL, 0xb909e17dUL, 0x24342c38UL, 0x5247a2cfUL, -0xb274d1dcUL, 0xa85b2b63UL, 0xd5559535UL, 0x9e751147UL, -0xe5ebe215UL, 0x9430c64bUL, 0x6f14a84aUL, 0x239c8691UL, -0x6acc394cUL, 0x8aff4a5fUL, 0x06904d04UL, 0x99ddbbeeUL, -0x1152ca1eUL, 0xffc418aaUL, 0x646998ebUL, 0xfefcff07UL, -0x345e018bUL, 0x7d0ebe56UL, 0xe79bd9baUL, 0x63c13242UL, -0xb5dc7b75UL, 0x26441797UL, 0xaecb6667UL, 0x250ccb95UL, -0x9a9567ecUL, 0x862ad057UL, 0x50379960UL, 0xe4d305b8UL, -0xad83ba65UL, 0xefae3519UL, 0xf6c913a4UL, 0x5b4aa9c1UL, -0x3e1bd687UL, 0xf0595ea0UL, 0x148a5b18UL, 0x02703bafUL, -0x04e076abUL, 0x4950bfddUL, 0x4a1863dfUL, 0xa5b656c6UL, -0x3d530a85UL, 0x871237faUL, 0xb694a777UL, 0x65517f46UL, -0x61b109edUL, 0xece6e91bUL, 0x458525d5UL, 0x753b52f5UL, -0xba413d7fUL, 0xce428827UL, 0xeb4e43b2UL, 0xbde997d6UL, -0x7b9ef352UL, 0x537f4562UL, 0x3afba02cUL, 0xbcd1707bUL, -0x1ff76bb9UL, 0x1b171d12UL, 0x79eec8fdUL, 0x277cf03aUL, -0x0a45d70cUL, 0xdd607996UL, 0x33f6ab22UL, 0xfa1c89acUL, -0xacbb5dc8UL, 0x0b7d30a1UL, 0xbea14bd4UL, 0xe10b94beUL, -0xcd0a5425UL, 0x7e466254UL, 0xf31182a2UL, 0xe6a33e17UL, -0x3566e626UL, 0x580275c3UL, 0x388b9b83UL, 0x44bdc278UL, -0x0348dc02UL, 0x92a08b4fUL, 0x39b37c2eUL, 0x6984e54eUL, -0x888f71f0UL, 0x2d392736UL, 0xd2fd3f9cUL, 0xfb246e01UL, -0x3716dd89UL, 0x00000000UL, 0x8d57e0f6UL, 0x93986ce2UL, -0x4ef81574UL, 0x20d45a93UL, 0x0138e7adUL, 0x405db4d3UL, -0x17c2871aUL, 0x106a2db3UL, 0x78d62f50UL, 0x8e1f3cf4UL, -0x0ea5a1a7UL, 0xb34c3671UL, 0xd725ae9aUL, 0x71db245eUL, -0x1d875016UL, 0x62f9d5efUL, 0x3186908dUL, 0x121a161cUL, -0xf581cfa6UL, 0x8c6f075bUL, 0xd61d4937UL, 0x593a926eUL, -0xc6776484UL, 0xc53fb886UL, 0x46cdf9d7UL, 0x90d0b0e0UL, -0xc74f8329UL, 0x9640fde4UL, 0x090d0b0eUL, 0xa156206dUL, -0xc9ea228eUL, 0x4c882edbUL, 0x76738ef7UL, 0x15b2bcb5UL, -0x185fc110UL, 0x2ba96a32UL, 0xa48eb16bUL, 0xf95455aeUL, -0x6089ee40UL, 0x55ef0866UL, 0x672144e9UL, 0x21ecbd3eUL, -0x30be7720UL, 0x8bc7adf2UL, 0xc0e72980UL, 0x1ecf8c14UL, -0xe24348bcUL, 0xa6fe8ac4UL, 0xd3c5d831UL, 0x16fa60b7UL, -0x80ba9d53UL, 0x4fc0f2d9UL, 0xe93e781dUL, 0x362e3a24UL, -0x6bf4dee1UL, 0x54d7efcbUL, 0xf7f1f409UL, 0xc3aff582UL, -0xf4b9280bUL, 0x29d9519dUL, 0x5e9238c7UL, 0x845aebf8UL, -0xd8b8e890UL, 0xb13c0ddeUL, 0xd08d0433UL, 0x5ce20368UL, -0x5ddae4c5UL, 0xdc589e3bUL, 0x0f9d460aUL, 0xdac8d33fUL, -0x8f27db59UL, 0xfc8cc4a8UL, 0xbf99ac79UL, 0x5a724e6cUL, -0xcaa2fe8cUL, 0xd1b5e39eUL, 0xea76a41fUL, 0xb004ea73UL, -}}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/stdcpp.h b/external/crypto++-5.6.3/stdcpp.h deleted file mode 100644 index b3edab700..000000000 --- a/external/crypto++-5.6.3/stdcpp.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef CRYPTOPP_STDCPP_H -#define CRYPTOPP_STDCPP_H - -#if _MSC_VER >= 1500 -#define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if _MSC_VER >= 1600 -// for make_unchecked_array_iterator -#include -#endif - -#include -#include -#include -#include -#include - -#ifdef CRYPTOPP_INCLUDE_VECTOR_CC -// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 -#include -#endif - -// for alloca -#if defined(CRYPTOPP_BSD_AVAILABLE) -#include -#elif defined(CRYPTOPP_UNIX_AVAILABLE) || defined(__sun) || defined(QNX) -#include -#elif defined(CRYPTOPP_WIN32_AVAILABLE) || defined(__MINGW32__) || defined(__BORLANDC__) -#include -#endif - -#ifdef _MSC_VER -#pragma warning(disable: 4231) // re-disable this -#ifdef _CRTAPI1 -#define CRYPTOPP_MSVCRT6 -#endif -#endif - -#endif diff --git a/external/crypto++-5.6.3/strciphr.cpp b/external/crypto++-5.6.3/strciphr.cpp deleted file mode 100644 index 53e007376..000000000 --- a/external/crypto++-5.6.3/strciphr.cpp +++ /dev/null @@ -1,252 +0,0 @@ -// strciphr.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#ifndef CRYPTOPP_IMPORTS - -#include "strciphr.h" - -NAMESPACE_BEGIN(CryptoPP) - -template -void AdditiveCipherTemplate::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) -{ - PolicyInterface &policy = this->AccessPolicy(); - policy.CipherSetKey(params, key, length); - m_leftOver = 0; - unsigned int bufferByteSize = policy.CanOperateKeystream() ? GetBufferByteSize(policy) : RoundUpToMultipleOf(1024U, GetBufferByteSize(policy)); - m_buffer.New(bufferByteSize); - - if (this->IsResynchronizable()) - { - size_t ivLength; - const byte *iv = this->GetIVAndThrowIfInvalid(params, ivLength); - policy.CipherResynchronize(m_buffer, iv, ivLength); - } -} - -template -void AdditiveCipherTemplate::GenerateBlock(byte *outString, size_t length) -{ - if (m_leftOver > 0) - { - size_t len = STDMIN(m_leftOver, length); - memcpy(outString, KeystreamBufferEnd()-m_leftOver, len); - length -= len; - m_leftOver -= len; - outString += len; - - if (!length) - return; - } - assert(m_leftOver == 0); - - PolicyInterface &policy = this->AccessPolicy(); - unsigned int bytesPerIteration = policy.GetBytesPerIteration(); - - if (length >= bytesPerIteration) - { - size_t iterations = length / bytesPerIteration; - policy.WriteKeystream(outString, iterations); - outString += iterations * bytesPerIteration; - length -= iterations * bytesPerIteration; - } - - if (length > 0) - { - size_t bufferByteSize = RoundUpToMultipleOf(length, bytesPerIteration); - size_t bufferIterations = bufferByteSize / bytesPerIteration; - - policy.WriteKeystream(KeystreamBufferEnd()-bufferByteSize, bufferIterations); - memcpy(outString, KeystreamBufferEnd()-bufferByteSize, length); - m_leftOver = bufferByteSize - length; - } -} - -template -void AdditiveCipherTemplate::ProcessData(byte *outString, const byte *inString, size_t length) -{ - if (m_leftOver > 0) - { - size_t len = STDMIN(m_leftOver, length); - xorbuf(outString, inString, KeystreamBufferEnd()-m_leftOver, len); - length -= len; - m_leftOver -= len; - inString += len; - outString += len; - - if (!length) - return; - } - assert(m_leftOver == 0); - - PolicyInterface &policy = this->AccessPolicy(); - unsigned int bytesPerIteration = policy.GetBytesPerIteration(); - - if (policy.CanOperateKeystream() && length >= bytesPerIteration) - { - size_t iterations = length / bytesPerIteration; - unsigned int alignment = policy.GetAlignment(); - KeystreamOperation operation = KeystreamOperation((IsAlignedOn(inString, alignment) * 2) | (int)IsAlignedOn(outString, alignment)); - - policy.OperateKeystream(operation, outString, inString, iterations); - - inString += iterations * bytesPerIteration; - outString += iterations * bytesPerIteration; - length -= iterations * bytesPerIteration; - - if (!length) - return; - } - - size_t bufferByteSize = m_buffer.size(); - size_t bufferIterations = bufferByteSize / bytesPerIteration; - - while (length >= bufferByteSize) - { - policy.WriteKeystream(m_buffer, bufferIterations); - xorbuf(outString, inString, KeystreamBufferBegin(), bufferByteSize); - length -= bufferByteSize; - inString += bufferByteSize; - outString += bufferByteSize; - } - - if (length > 0) - { - bufferByteSize = RoundUpToMultipleOf(length, bytesPerIteration); - bufferIterations = bufferByteSize / bytesPerIteration; - - policy.WriteKeystream(KeystreamBufferEnd()-bufferByteSize, bufferIterations); - xorbuf(outString, inString, KeystreamBufferEnd()-bufferByteSize, length); - m_leftOver = bufferByteSize - length; - } -} - -template -void AdditiveCipherTemplate::Resynchronize(const byte *iv, int length) -{ - PolicyInterface &policy = this->AccessPolicy(); - m_leftOver = 0; - m_buffer.New(GetBufferByteSize(policy)); - policy.CipherResynchronize(m_buffer, iv, this->ThrowIfInvalidIVLength(length)); -} - -template -void AdditiveCipherTemplate::Seek(lword position) -{ - PolicyInterface &policy = this->AccessPolicy(); - unsigned int bytesPerIteration = policy.GetBytesPerIteration(); - - policy.SeekToIteration(position / bytesPerIteration); - position %= bytesPerIteration; - - if (position > 0) - { - policy.WriteKeystream(KeystreamBufferEnd()-bytesPerIteration, 1); - m_leftOver = bytesPerIteration - (unsigned int)position; - } - else - m_leftOver = 0; -} - -template -void CFB_CipherTemplate::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) -{ - PolicyInterface &policy = this->AccessPolicy(); - policy.CipherSetKey(params, key, length); - - if (this->IsResynchronizable()) - { - size_t ivLength; - const byte *iv = this->GetIVAndThrowIfInvalid(params, ivLength); - policy.CipherResynchronize(iv, ivLength); - } - - m_leftOver = policy.GetBytesPerIteration(); -} - -template -void CFB_CipherTemplate::Resynchronize(const byte *iv, int length) -{ - PolicyInterface &policy = this->AccessPolicy(); - policy.CipherResynchronize(iv, this->ThrowIfInvalidIVLength(length)); - m_leftOver = policy.GetBytesPerIteration(); -} - -template -void CFB_CipherTemplate::ProcessData(byte *outString, const byte *inString, size_t length) -{ - assert(length % this->MandatoryBlockSize() == 0); - - PolicyInterface &policy = this->AccessPolicy(); - unsigned int bytesPerIteration = policy.GetBytesPerIteration(); - unsigned int alignment = policy.GetAlignment(); - byte *reg = policy.GetRegisterBegin(); - - if (m_leftOver) - { - size_t len = STDMIN(m_leftOver, length); - CombineMessageAndShiftRegister(outString, reg + bytesPerIteration - m_leftOver, inString, len); - m_leftOver -= len; - length -= len; - inString += len; - outString += len; - } - - if (!length) - return; - - assert(m_leftOver == 0); - - if (policy.CanIterate() && length >= bytesPerIteration && IsAlignedOn(outString, alignment)) - { - if (IsAlignedOn(inString, alignment)) - policy.Iterate(outString, inString, GetCipherDir(*this), length / bytesPerIteration); - else - { - memcpy(outString, inString, length); - policy.Iterate(outString, outString, GetCipherDir(*this), length / bytesPerIteration); - } - inString += length - length % bytesPerIteration; - outString += length - length % bytesPerIteration; - length %= bytesPerIteration; - } - - while (length >= bytesPerIteration) - { - policy.TransformRegister(); - CombineMessageAndShiftRegister(outString, reg, inString, bytesPerIteration); - length -= bytesPerIteration; - inString += bytesPerIteration; - outString += bytesPerIteration; - } - - if (length > 0) - { - policy.TransformRegister(); - CombineMessageAndShiftRegister(outString, reg, inString, length); - m_leftOver = bytesPerIteration - length; - } -} - -template -void CFB_EncryptionTemplate::CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length) -{ - xorbuf(reg, message, length); - memcpy(output, reg, length); -} - -template -void CFB_DecryptionTemplate::CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length) -{ - for (unsigned int i=0; i, AdditiveCipherTemplate\<\> \> \> Encryption; - - AdditiveCipherTemplate and CFB_CipherTemplate are designed so that they don't need - to take a policy class as a template parameter (although this is allowed), so that - their code is not duplicated for each new cipher. Instead they each - get a reference to an abstract policy interface by calling AccessPolicy() on itself, so - AccessPolicy() must be overriden to return the actual policy reference. This is done - by the ConceretePolicyHolder class. Finally, SymmetricCipherFinal implements the constructors and - other functions that must be implemented by the most derived class. -*/ - -#ifndef CRYPTOPP_STRCIPHR_H -#define CRYPTOPP_STRCIPHR_H - -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(push) -# pragma warning(disable: 4127 4189) -#endif - -#include "cryptlib.h" -#include "seckey.h" -#include "secblock.h" -#include "argnames.h" - -NAMESPACE_BEGIN(CryptoPP) - -template -class CRYPTOPP_NO_VTABLE AbstractPolicyHolder : public BASE -{ -public: - typedef POLICY_INTERFACE PolicyInterface; - virtual ~AbstractPolicyHolder() {} - -protected: - virtual const POLICY_INTERFACE & GetPolicy() const =0; - virtual POLICY_INTERFACE & AccessPolicy() =0; -}; - -template -class ConcretePolicyHolder : public BASE, protected POLICY -{ -protected: - const POLICY_INTERFACE & GetPolicy() const {return *this;} - POLICY_INTERFACE & AccessPolicy() {return *this;} -}; - -enum KeystreamOperationFlags {OUTPUT_ALIGNED=1, INPUT_ALIGNED=2, INPUT_NULL = 4}; -enum KeystreamOperation { - WRITE_KEYSTREAM = INPUT_NULL, - WRITE_KEYSTREAM_ALIGNED = INPUT_NULL | OUTPUT_ALIGNED, - XOR_KEYSTREAM = 0, - XOR_KEYSTREAM_INPUT_ALIGNED = INPUT_ALIGNED, - XOR_KEYSTREAM_OUTPUT_ALIGNED= OUTPUT_ALIGNED, - XOR_KEYSTREAM_BOTH_ALIGNED = OUTPUT_ALIGNED | INPUT_ALIGNED}; - -struct CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AdditiveCipherAbstractPolicy -{ - virtual ~AdditiveCipherAbstractPolicy() {} - virtual unsigned int GetAlignment() const {return 1;} - virtual unsigned int GetBytesPerIteration() const =0; - virtual unsigned int GetOptimalBlockSize() const {return GetBytesPerIteration();} - virtual unsigned int GetIterationsToBuffer() const =0; - virtual void WriteKeystream(byte *keystream, size_t iterationCount) - {OperateKeystream(KeystreamOperation(INPUT_NULL | (KeystreamOperationFlags)IsAlignedOn(keystream, GetAlignment())), keystream, NULL, iterationCount);} - virtual bool CanOperateKeystream() const {return false;} - virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) - {CRYPTOPP_UNUSED(operation); CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(iterationCount); assert(false);} - virtual void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) =0; - virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) - {CRYPTOPP_UNUSED(keystreamBuffer); CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(length); throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");} - virtual bool CipherIsRandomAccess() const =0; - virtual void SeekToIteration(lword iterationCount) - {CRYPTOPP_UNUSED(iterationCount); assert(!CipherIsRandomAccess()); throw NotImplemented("StreamTransformation: this object doesn't support random access");} -}; - -template -struct CRYPTOPP_NO_VTABLE AdditiveCipherConcretePolicy : public BASE -{ - typedef WT WordType; - CRYPTOPP_CONSTANT(BYTES_PER_ITERATION = sizeof(WordType) * W) - -#if !(CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64) - unsigned int GetAlignment() const {return GetAlignmentOf();} -#endif - unsigned int GetBytesPerIteration() const {return BYTES_PER_ITERATION;} - unsigned int GetIterationsToBuffer() const {return X;} - bool CanOperateKeystream() const {return true;} - virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) =0; -}; - -// use these to implement OperateKeystream -#define CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, b, i, a) \ - PutWord(bool(x & OUTPUT_ALIGNED), b, output+i*sizeof(WordType), (x & INPUT_NULL) ? (a) : (a) ^ GetWord(bool(x & INPUT_ALIGNED), b, input+i*sizeof(WordType))); -#define CRYPTOPP_KEYSTREAM_OUTPUT_XMM(x, i, a) {\ - __m128i t = (x & INPUT_NULL) ? a : _mm_xor_si128(a, (x & INPUT_ALIGNED) ? _mm_load_si128((__m128i *)input+i) : _mm_loadu_si128((__m128i *)input+i));\ - if (x & OUTPUT_ALIGNED) _mm_store_si128((__m128i *)output+i, t);\ - else _mm_storeu_si128((__m128i *)output+i, t);} -#define CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(x, y) \ - switch (operation) \ - { \ - case WRITE_KEYSTREAM: \ - x(WRITE_KEYSTREAM) \ - break; \ - case XOR_KEYSTREAM: \ - x(XOR_KEYSTREAM) \ - input += y; \ - break; \ - case XOR_KEYSTREAM_INPUT_ALIGNED: \ - x(XOR_KEYSTREAM_INPUT_ALIGNED) \ - input += y; \ - break; \ - case XOR_KEYSTREAM_OUTPUT_ALIGNED: \ - x(XOR_KEYSTREAM_OUTPUT_ALIGNED) \ - input += y; \ - break; \ - case WRITE_KEYSTREAM_ALIGNED: \ - x(WRITE_KEYSTREAM_ALIGNED) \ - break; \ - case XOR_KEYSTREAM_BOTH_ALIGNED: \ - x(XOR_KEYSTREAM_BOTH_ALIGNED) \ - input += y; \ - break; \ - } \ - output += y; - -template > -class CRYPTOPP_NO_VTABLE AdditiveCipherTemplate : public BASE, public RandomNumberGenerator -{ -public: - void GenerateBlock(byte *output, size_t size); - void ProcessData(byte *outString, const byte *inString, size_t length); - void Resynchronize(const byte *iv, int length=-1); - unsigned int OptimalBlockSize() const {return this->GetPolicy().GetOptimalBlockSize();} - unsigned int GetOptimalNextBlockSize() const {return (unsigned int)this->m_leftOver;} - unsigned int OptimalDataAlignment() const {return this->GetPolicy().GetAlignment();} - bool IsSelfInverting() const {return true;} - bool IsForwardTransformation() const {return true;} - bool IsRandomAccess() const {return this->GetPolicy().CipherIsRandomAccess();} - void Seek(lword position); - - typedef typename BASE::PolicyInterface PolicyInterface; - -protected: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - - unsigned int GetBufferByteSize(const PolicyInterface &policy) const {return policy.GetBytesPerIteration() * policy.GetIterationsToBuffer();} - - inline byte * KeystreamBufferBegin() {return this->m_buffer.data();} - inline byte * KeystreamBufferEnd() {return (this->m_buffer.data() + this->m_buffer.size());} - - SecByteBlock m_buffer; - size_t m_leftOver; -}; - -class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_CipherAbstractPolicy -{ -public: - virtual ~CFB_CipherAbstractPolicy() {} - virtual unsigned int GetAlignment() const =0; - virtual unsigned int GetBytesPerIteration() const =0; - virtual byte * GetRegisterBegin() =0; - virtual void TransformRegister() =0; - virtual bool CanIterate() const {return false;} - virtual void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount) - {CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(dir); CRYPTOPP_UNUSED(iterationCount); - assert(false); /*throw 0;*/ throw Exception(Exception::OTHER_ERROR, "SimpleKeyingInterface: unexpected error");} - virtual void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) =0; - virtual void CipherResynchronize(const byte *iv, size_t length) - {CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(length); throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");} -}; - -template -struct CRYPTOPP_NO_VTABLE CFB_CipherConcretePolicy : public BASE -{ - typedef WT WordType; - - unsigned int GetAlignment() const {return sizeof(WordType);} - unsigned int GetBytesPerIteration() const {return sizeof(WordType) * W;} - bool CanIterate() const {return true;} - void TransformRegister() {this->Iterate(NULL, NULL, ENCRYPTION, 1);} - - template - struct RegisterOutput - { - RegisterOutput(byte *output, const byte *input, CipherDir dir) - : m_output(output), m_input(input), m_dir(dir) {} - - inline RegisterOutput& operator()(WordType ®isterWord) - { - assert(IsAligned(m_output)); - assert(IsAligned(m_input)); - - if (!NativeByteOrderIs(B::ToEnum())) - registerWord = ByteReverse(registerWord); - - if (m_dir == ENCRYPTION) - { - if (m_input == NULL) - assert(m_output == NULL); - else - { - WordType ct = *(const WordType *)m_input ^ registerWord; - registerWord = ct; - *(WordType*)m_output = ct; - m_input += sizeof(WordType); - m_output += sizeof(WordType); - } - } - else - { - WordType ct = *(const WordType *)m_input; - *(WordType*)m_output = registerWord ^ ct; - registerWord = ct; - m_input += sizeof(WordType); - m_output += sizeof(WordType); - } - - // registerWord is left unreversed so it can be xor-ed with further input - - return *this; - } - - byte *m_output; - const byte *m_input; - CipherDir m_dir; - }; -}; - -template -class CRYPTOPP_NO_VTABLE CFB_CipherTemplate : public BASE -{ -public: - void ProcessData(byte *outString, const byte *inString, size_t length); - void Resynchronize(const byte *iv, int length=-1); - unsigned int OptimalBlockSize() const {return this->GetPolicy().GetBytesPerIteration();} - unsigned int GetOptimalNextBlockSize() const {return (unsigned int)m_leftOver;} - unsigned int OptimalDataAlignment() const {return this->GetPolicy().GetAlignment();} - bool IsRandomAccess() const {return false;} - bool IsSelfInverting() const {return false;} - - typedef typename BASE::PolicyInterface PolicyInterface; - -protected: - virtual void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length) =0; - - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); - - size_t m_leftOver; -}; - -template > -class CRYPTOPP_NO_VTABLE CFB_EncryptionTemplate : public CFB_CipherTemplate -{ - bool IsForwardTransformation() const {return true;} - void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length); -}; - -template > -class CRYPTOPP_NO_VTABLE CFB_DecryptionTemplate : public CFB_CipherTemplate -{ - bool IsForwardTransformation() const {return false;} - void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length); -}; - -template -class CFB_RequireFullDataBlocks : public BASE -{ -public: - unsigned int MandatoryBlockSize() const {return this->OptimalBlockSize();} -}; - -//! _ -template -class SymmetricCipherFinal : public AlgorithmImpl, INFO> -{ -public: - SymmetricCipherFinal() {} - SymmetricCipherFinal(const byte *key) - {this->SetKey(key, this->DEFAULT_KEYLENGTH);} - SymmetricCipherFinal(const byte *key, size_t length) - {this->SetKey(key, length);} - SymmetricCipherFinal(const byte *key, size_t length, const byte *iv) - {this->SetKeyWithIV(key, length, iv);} - - Clonable * Clone() const {return static_cast(new SymmetricCipherFinal(*this));} -}; - -NAMESPACE_END - -#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES -#include "strciphr.cpp" -#endif - -NAMESPACE_BEGIN(CryptoPP) -CRYPTOPP_DLL_TEMPLATE_CLASS AbstractPolicyHolder; -CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate >; -CRYPTOPP_DLL_TEMPLATE_CLASS CFB_CipherTemplate >; -CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate >; -CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate >; - -NAMESPACE_END - -#if CRYPTOPP_MSC_VERSION -# pragma warning(pop) -#endif - -#endif diff --git a/external/crypto++-5.6.3/tea.cpp b/external/crypto++-5.6.3/tea.cpp deleted file mode 100644 index 80f2052ab..000000000 --- a/external/crypto++-5.6.3/tea.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// tea.cpp - modified by Wei Dai from code in the original paper - -#include "pch.h" -#include "tea.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const word32 DELTA = 0x9e3779b9; -typedef BlockGetAndPut Block; - -void TEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(length); - - GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, userKey, KEYLENGTH); - m_limit = GetRoundsAndThrowIfInvalid(params, this) * DELTA; -} - -void TEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 y, z; - Block::Get(inBlock)(y)(z); - - word32 sum = 0; - while (sum != m_limit) - { - sum += DELTA; - y += ((z << 4) + m_k[0]) ^ (z + sum) ^ ((z >> 5) + m_k[1]); - z += ((y << 4) + m_k[2]) ^ (y + sum) ^ ((y >> 5) + m_k[3]); - } - - Block::Put(xorBlock, outBlock)(y)(z); -} - -void TEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 y, z; - Block::Get(inBlock)(y)(z); - - word32 sum = m_limit; - while (sum != 0) - { - z -= ((y << 4) + m_k[2]) ^ (y + sum) ^ ((y >> 5) + m_k[3]); - y -= ((z << 4) + m_k[0]) ^ (z + sum) ^ ((z >> 5) + m_k[1]); - sum -= DELTA; - } - - Block::Put(xorBlock, outBlock)(y)(z); -} - -void XTEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) -{ - AssertValidKeyLength(length); - - GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, userKey, KEYLENGTH); - m_limit = GetRoundsAndThrowIfInvalid(params, this) * DELTA; -} - -void XTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 y, z; - Block::Get(inBlock)(y)(z); - -#ifdef __SUNPRO_CC - // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 - size_t sum = 0; - while ((sum&0xffffffff) != m_limit) -#else - word32 sum = 0; - while (sum != m_limit) -#endif - { - y += ((z<<4 ^ z>>5) + z) ^ (sum + m_k[sum&3]); - sum += DELTA; - z += ((y<<4 ^ y>>5) + y) ^ (sum + m_k[sum>>11 & 3]); - } - - Block::Put(xorBlock, outBlock)(y)(z); -} - -void XTEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 y, z; - Block::Get(inBlock)(y)(z); - -#ifdef __SUNPRO_CC - // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 - size_t sum = m_limit; - while ((sum&0xffffffff) != 0) -#else - word32 sum = m_limit; - while (sum != 0) -#endif - { - z -= ((y<<4 ^ y>>5) + y) ^ (sum + m_k[sum>>11 & 3]); - sum -= DELTA; - y -= ((z<<4 ^ z>>5) + z) ^ (sum + m_k[sum&3]); - } - - Block::Put(xorBlock, outBlock)(y)(z); -} - -#define MX ((z>>5^y<<2)+(y>>3^z<<4))^((sum^y)+(m_k[(p&3)^e]^z)) - -void BTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - CRYPTOPP_UNUSED(xorBlock); - unsigned int n = m_blockSize / 4; - word32 *v = (word32*)outBlock; - ConditionalByteReverse(BIG_ENDIAN_ORDER, v, (const word32*)inBlock, m_blockSize); - - word32 y = v[0], z = v[n-1], e; - word32 p, q = 6+52/n; - word32 sum = 0; - - while (q-- > 0) - { - sum += DELTA; - e = sum>>2 & 3; - for (p = 0; p < n-1; p++) - { - y = v[p+1]; - z = v[p] += MX; - } - y = v[0]; - z = v[n-1] += MX; - } - - ConditionalByteReverse(BIG_ENDIAN_ORDER, v, v, m_blockSize); -} - -void BTEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - CRYPTOPP_UNUSED(xorBlock); - unsigned int n = m_blockSize / 4; - word32 *v = (word32*)outBlock; - ConditionalByteReverse(BIG_ENDIAN_ORDER, v, (const word32*)inBlock, m_blockSize); - - word32 y = v[0], z = v[n-1], e; - word32 p, q = 6+52/n; - word32 sum = q * DELTA; - - while (sum != 0) - { - e = sum>>2 & 3; - for (p = n-1; p > 0; p--) - { - z = v[p-1]; - y = v[p] -= MX; - } - - z = v[n-1]; - y = v[0] -= MX; - sum -= DELTA; - } - - ConditionalByteReverse(BIG_ENDIAN_ORDER, v, v, m_blockSize); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/tea.h b/external/crypto++-5.6.3/tea.h deleted file mode 100644 index 3b0907551..000000000 --- a/external/crypto++-5.6.3/tea.h +++ /dev/null @@ -1,136 +0,0 @@ -// tea.h - written and placed in the public domain by Wei Dai - -//! \file tea.h -//! \brief Classes for the TEA, BTEA and XTEA block ciphers - -#ifndef CRYPTOPP_TEA_H -#define CRYPTOPP_TEA_H - -#include "seckey.h" -#include "secblock.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct TEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32> -{ - static const char *StaticAlgorithmName() {return "TEA";} -}; - -/// TEA -class TEA : public TEA_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - FixedSizeSecBlock m_k; - word32 m_limit; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef TEA::Encryption TEAEncryption; -typedef TEA::Decryption TEADecryption; - -//! _ -struct XTEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32> -{ - static const char *StaticAlgorithmName() {return "XTEA";} -}; - -/// XTEA -class XTEA : public XTEA_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - FixedSizeSecBlock m_k; - word32 m_limit; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -//! _ -struct BTEA_Info : public FixedKeyLength<16> -{ - static const char *StaticAlgorithmName() {return "BTEA";} -}; - -//! corrected Block TEA (as described in "xxtea"). -/*! This class hasn't been tested yet. */ -class BTEA : public BTEA_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public AlgorithmImpl, BTEA_Info>, public BTEA_Info - { - public: - void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) - { - CRYPTOPP_UNUSED(length), CRYPTOPP_UNUSED(params); - m_blockSize = params.GetIntValueWithDefault("BlockSize", 60*4); - GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, key, KEYLENGTH); - } - - unsigned int BlockSize() const {return m_blockSize;} - - protected: - FixedSizeSecBlock m_k; - unsigned int m_blockSize; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/test.cpp b/external/crypto++-5.6.3/test.cpp deleted file mode 100644 index 3d691d038..000000000 --- a/external/crypto++-5.6.3/test.cpp +++ /dev/null @@ -1,963 +0,0 @@ -// test.cpp - written and placed in the public domain by Wei Dai - -#define CRYPTOPP_DEFAULT_NO_DLL -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 - -#include "dll.h" -#include "aes.h" -#include "cryptlib.h" -#include "filters.h" -#include "md5.h" -#include "ripemd.h" -#include "rng.h" -#include "gzip.h" -#include "default.h" -#include "randpool.h" -#include "ida.h" -#include "base64.h" -#include "socketft.h" -#include "wait.h" -#include "factory.h" -#include "whrlpool.h" -#include "tiger.h" -#include "smartptr.h" - -#include "validate.h" -#include "bench.h" - -#include -#include -#include -#include -#include -#include - -#ifdef CRYPTOPP_WIN32_AVAILABLE -#include -#endif - -#if defined(USE_BERKELEY_STYLE_SOCKETS) && !defined(macintosh) -#include -#include -#endif - -#if (_MSC_VER >= 1000) -#include // for the debug heap -#endif - -#if defined(__MWERKS__) && defined(macintosh) -#include -#endif - -#ifdef _OPENMP -# include -#endif - -#ifdef __BORLANDC__ -#pragma comment(lib, "cryptlib_bds.lib") -#pragma comment(lib, "ws2_32.lib") -#endif - -// Aggressive stack checking with VS2005 SP1 and above. -#if (CRYPTOPP_MSC_VERSION >= 1410) -# pragma strict_gs_check (on) -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -const int MAX_PHRASE_LENGTH=250; - -void RegisterFactories(); -void PrintSeedAndThreads(const std::string& seed); - -void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed); -string RSAEncryptString(const char *pubFilename, const char *seed, const char *message); -string RSADecryptString(const char *privFilename, const char *ciphertext); -void RSASignFile(const char *privFilename, const char *messageFilename, const char *signatureFilename); -bool RSAVerifyFile(const char *pubFilename, const char *messageFilename, const char *signatureFilename); - -void DigestFile(const char *file); -void HmacFile(const char *hexKey, const char *file); - -void AES_CTR_Encrypt(const char *hexKey, const char *hexIV, const char *infile, const char *outfile); - -string EncryptString(const char *plaintext, const char *passPhrase); -string DecryptString(const char *ciphertext, const char *passPhrase); - -void EncryptFile(const char *in, const char *out, const char *passPhrase); -void DecryptFile(const char *in, const char *out, const char *passPhrase); - -void SecretShareFile(int threshold, int nShares, const char *filename, const char *seed); -void SecretRecoverFile(int threshold, const char *outFilename, char *const *inFilenames); - -void InformationDisperseFile(int threshold, int nShares, const char *filename); -void InformationRecoverFile(int threshold, const char *outFilename, char *const *inFilenames); - -void GzipFile(const char *in, const char *out, int deflate_level); -void GunzipFile(const char *in, const char *out); - -void Base64Encode(const char *infile, const char *outfile); -void Base64Decode(const char *infile, const char *outfile); -void HexEncode(const char *infile, const char *outfile); -void HexDecode(const char *infile, const char *outfile); - -void ForwardTcpPort(const char *sourcePort, const char *destinationHost, const char *destinationPort); - -void FIPS140_SampleApplication(); -void FIPS140_GenerateRandomFiles(); - -bool Validate(int, bool, const char *); -void PrintSeedAndThreads(const std::string& seed); - -int (*AdhocTest)(int argc, char *argv[]) = NULL; - -RandomNumberGenerator & GlobalRNG() -{ - static OFB_Mode::Encryption s_globalRNG; - return dynamic_cast(s_globalRNG); -} - -int CRYPTOPP_API main(int argc, char *argv[]) -{ -#ifdef _CRTDBG_LEAK_CHECK_DF - // Turn on leak-checking - int tempflag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); - tempflag |= _CRTDBG_LEAK_CHECK_DF; - _CrtSetDbgFlag( tempflag ); -#endif - -#if defined(__MWERKS__) && defined(macintosh) - argc = ccommand(&argv); -#endif - - try - { - RegisterFactories(); - - // Some editors have problems with the '\0' character when redirecting output. - std::string seed = IntToString(time(NULL)); - seed.resize(16, ' '); - - OFB_Mode::Encryption& prng = dynamic_cast::Encryption&>(GlobalRNG()); - prng.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data()); - - std::string command, executableName, macFilename; - - if (argc < 2) - command = 'h'; - else - command = argv[1]; - - if (command == "g") - { - char thisSeed[1024], privFilename[128], pubFilename[128]; - unsigned int keyLength; - - cout << "Key length in bits: "; - cin >> keyLength; - - cout << "\nSave private key to file: "; - cin >> privFilename; - - cout << "\nSave public key to file: "; - cin >> pubFilename; - - cout << "\nRandom Seed: "; - ws(cin); - cin.getline(thisSeed, 1024); - - GenerateRSAKey(keyLength, privFilename, pubFilename, thisSeed); - } - else if (command == "rs") - RSASignFile(argv[2], argv[3], argv[4]); - else if (command == "rv") - { - bool verified = RSAVerifyFile(argv[2], argv[3], argv[4]); - cout << (verified ? "valid signature" : "invalid signature") << endl; - } - else if (command == "r") - { - char privFilename[128], pubFilename[128]; - char thisSeed[1024], message[1024]; - - cout << "Private key file: "; - cin >> privFilename; - - cout << "\nPublic key file: "; - cin >> pubFilename; - - cout << "\nRandom Seed: "; - ws(cin); - cin.getline(thisSeed, 1024); - - cout << "\nMessage: "; - cin.getline(message, 1024); - - string ciphertext = RSAEncryptString(pubFilename, thisSeed, message); - cout << "\nCiphertext: " << ciphertext << endl; - - string decrypted = RSADecryptString(privFilename, ciphertext.c_str()); - cout << "\nDecrypted: " << decrypted << endl; - } - else if (command == "mt") - { - MaurerRandomnessTest mt; - FileStore fs(argv[2]); - fs.TransferAllTo(mt); - cout << "Maurer Test Value: " << mt.GetTestValue() << endl; - } - else if (command == "mac_dll") - { - std::string fname(argv[2] ? argv[2] : ""); - - // sanity check on file size - std::fstream dllFile(fname.c_str(), ios::in | ios::out | ios::binary); - if (!dllFile.good()) - { - cerr << "Failed to open file \"" << fname << "\"\n"; - return 1; - } - - std::ifstream::pos_type fileEnd = dllFile.seekg(0, std::ios_base::end).tellg(); - if (fileEnd > 20*1000*1000) - { - cerr << "Input file " << fname << " is too large"; - cerr << "(size is " << fileEnd << ").\n"; - return 1; - } - - // read file into memory - unsigned int fileSize = (unsigned int)fileEnd; - SecByteBlock buf(fileSize); - dllFile.seekg(0, std::ios_base::beg); - dllFile.read((char *)buf.begin(), fileSize); - - // find positions of relevant sections in the file, based on version 8 of documentation from http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx - word32 coffPos = *(word16 *)(buf+0x3c); - word32 optionalHeaderPos = coffPos + 24; - word16 optionalHeaderMagic = *(word16 *)(buf+optionalHeaderPos); - if (optionalHeaderMagic != 0x10b && optionalHeaderMagic != 0x20b) - { - cerr << "Target file is not a PE32 or PE32+ image.\n"; - return 3; - } - word32 checksumPos = optionalHeaderPos + 64; - word32 certificateTableDirectoryPos = optionalHeaderPos + (optionalHeaderMagic == 0x10b ? 128 : 144); - word32 certificateTablePos = *(word32 *)(buf+certificateTableDirectoryPos); - word32 certificateTableSize = *(word32 *)(buf+certificateTableDirectoryPos+4); - if (certificateTableSize != 0) - cerr << "Warning: certificate table (IMAGE_DIRECTORY_ENTRY_SECURITY) of target image is not empty.\n"; - - // find where to place computed MAC - byte mac[] = CRYPTOPP_DUMMY_DLL_MAC; - byte *found = std::search(buf.begin(), buf.end(), mac+0, mac+sizeof(mac)); - if (found == buf.end()) - { - cerr << "MAC placeholder not found. The MAC may already be placed.\n"; - return 2; - } - word32 macPos = (unsigned int)(found-buf.begin()); - - // compute MAC - member_ptr pMac(NewIntegrityCheckingMAC()); - assert(pMac->DigestSize() == sizeof(mac)); - MeterFilter f(new HashFilter(*pMac, new ArraySink(mac, sizeof(mac)))); - f.AddRangeToSkip(0, checksumPos, 4); - f.AddRangeToSkip(0, certificateTableDirectoryPos, 8); - f.AddRangeToSkip(0, macPos, sizeof(mac)); - f.AddRangeToSkip(0, certificateTablePos, certificateTableSize); - f.PutMessageEnd(buf.begin(), buf.size()); - - // place MAC - cout << "Placing MAC in file " << fname << ", location " << macPos; - cout << " (0x" << std::hex << macPos << std::dec << ").\n"; - dllFile.seekg(macPos, std::ios_base::beg); - dllFile.write((char *)mac, sizeof(mac)); - } - else if (command == "m") - DigestFile(argv[2]); - else if (command == "tv") - { - std::string fname = (argv[2] ? argv[2] : "all"); - if (fname.find(".txt") == std::string::npos) - fname = "TestVectors/" + fname + ".txt"; - - PrintSeedAndThreads(seed); - return !RunTestDataFile(fname.c_str()); - } - else if (command == "t") - { - // VC60 workaround: use char array instead of std::string to workaround MSVC's getline bug - char passPhrase[MAX_PHRASE_LENGTH], plaintext[1024]; - - cout << "Passphrase: "; - cin.getline(passPhrase, MAX_PHRASE_LENGTH); - - cout << "\nPlaintext: "; - cin.getline(plaintext, 1024); - - string ciphertext = EncryptString(plaintext, passPhrase); - cout << "\nCiphertext: " << ciphertext << endl; - - string decrypted = DecryptString(ciphertext.c_str(), passPhrase); - cout << "\nDecrypted: " << decrypted << endl; - - return 0; - } - else if (command == "e64") - Base64Encode(argv[2], argv[3]); - else if (command == "d64") - Base64Decode(argv[2], argv[3]); - else if (command == "e16") - HexEncode(argv[2], argv[3]); - else if (command == "d16") - HexDecode(argv[2], argv[3]); - else if (command == "e" || command == "d") - { - char passPhrase[MAX_PHRASE_LENGTH]; - cout << "Passphrase: "; - cin.getline(passPhrase, MAX_PHRASE_LENGTH); - if (command == "e") - EncryptFile(argv[2], argv[3], passPhrase); - else - DecryptFile(argv[2], argv[3], passPhrase); - } - else if (command == "ss") - { - char thisSeed[1024]; - cout << "\nRandom Seed: "; - ws(cin); - cin.getline(thisSeed, 1024); - SecretShareFile(StringToValue(argv[2]), StringToValue(argv[3]), argv[4], thisSeed); - } - else if (command == "sr") - SecretRecoverFile(argc-3, argv[2], argv+3); - else if (command == "id") - InformationDisperseFile(StringToValue(argv[2]), StringToValue(argv[3]), argv[4]); - else if (command == "ir") - InformationRecoverFile(argc-3, argv[2], argv+3); - else if (command == "v" || command == "vv") - return !Validate(argc>2 ? StringToValue(argv[2]) : 0, argv[1][1] == 'v', argc>3 ? argv[3] : NULL); - else if (command == "b") - BenchmarkAll(argc<3 ? 1 : StringToValue(argv[2]), argc<4 ? 0 : StringToValue(argv[3])*1e9); - else if (command == "b2") - BenchmarkAll2(argc<3 ? 1 : StringToValue(argv[2]), argc<4 ? 0 : StringToValue(argv[3])*1e9); - else if (command == "z") - GzipFile(argv[3], argv[4], argv[2][0]-'0'); - else if (command == "u") - GunzipFile(argv[2], argv[3]); - else if (command == "fips") - FIPS140_SampleApplication(); - else if (command == "fips-rand") - FIPS140_GenerateRandomFiles(); - else if (command == "ft") - ForwardTcpPort(argv[2], argv[3], argv[4]); - else if (command == "a") - { - if (AdhocTest) - return (*AdhocTest)(argc, argv); - else - { - cerr << "AdhocTest not defined.\n"; - return 1; - } - } - else if (command == "hmac") - HmacFile(argv[2], argv[3]); - else if (command == "ae") - AES_CTR_Encrypt(argv[2], argv[3], argv[4], argv[5]); - else if (command == "h") - { - FileSource usage("TestData/usage.dat", true, new FileSink(cout)); - return 1; - } - else if (command == "V") - { - cout << CRYPTOPP_VERSION / 100 << '.' << (CRYPTOPP_VERSION % 100) / 10 << '.' << CRYPTOPP_VERSION % 10 << endl; - } - else - { - cerr << "Unrecognized command. Run \"cryptest h\" to obtain usage information.\n"; - return 1; - } - return 0; - } - catch(const CryptoPP::Exception &e) - { - cout << "\nCryptoPP::Exception caught: " << e.what() << endl; - return -1; - } - catch(const std::exception &e) - { - cout << "\nstd::exception caught: " << e.what() << endl; - return -2; - } -} // End main() - -void FIPS140_GenerateRandomFiles() -{ -#ifdef OS_RNG_AVAILABLE - DefaultAutoSeededRNG rng; - RandomNumberStore store(rng, ULONG_MAX); - - for (unsigned int i=0; i<100000; i++) - store.TransferTo(FileSink((IntToString(i) + ".rnd").c_str()).Ref(), 20000); -#else - cout << "OS provided RNG not available.\n"; - exit(-1); -#endif -} - -template -T StringToValue(const std::string& str) { - std::istringstream iss(str); - T value; - iss >> value; - - // Use fail(), not bad() - if (iss.fail()) - throw InvalidArgument("cryptest.exe: '" + str +"' is not a value"); - -#if NON_NEGATIVE - if (value < 0) - throw InvalidArgument("cryptest.exe: '" + str +"' is negative"); -#endif - - return value; -} - -template<> -int StringToValue(const std::string& str) -{ - Integer n(str.c_str()); - long l = n.ConvertToLong(); - - int r; - if(!SafeConvert(l, r)) - throw InvalidArgument("cryptest.exe: '" + str +"' is not an integer value"); - - return r; -} - -void PrintSeedAndThreads(const std::string& seed) -{ - cout << "Using seed: " << seed << endl; - -#ifdef _OPENMP - int tc = 0; - #pragma omp parallel - { - tc = omp_get_num_threads(); - } - - std::cout << "Using " << tc << " OMP " << (tc == 1 ? "thread" : "threads") << std::endl; -#endif -} - -SecByteBlock HexDecodeString(const char *hex) -{ - StringSource ss(hex, true, new HexDecoder); - SecByteBlock result((size_t)ss.MaxRetrievable()); - ss.Get(result, result.size()); - return result; -} - -void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed) -{ - RandomPool randPool; - randPool.IncorporateEntropy((byte *)seed, strlen(seed)); - - RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength); - HexEncoder privFile(new FileSink(privFilename)); - priv.DEREncode(privFile); - privFile.MessageEnd(); - - RSAES_OAEP_SHA_Encryptor pub(priv); - HexEncoder pubFile(new FileSink(pubFilename)); - pub.DEREncode(pubFile); - pubFile.MessageEnd(); -} - -string RSAEncryptString(const char *pubFilename, const char *seed, const char *message) -{ - FileSource pubFile(pubFilename, true, new HexDecoder); - RSAES_OAEP_SHA_Encryptor pub(pubFile); - - RandomPool randPool; - randPool.IncorporateEntropy((byte *)seed, strlen(seed)); - - string result; - StringSource(message, true, new PK_EncryptorFilter(randPool, pub, new HexEncoder(new StringSink(result)))); - return result; -} - -string RSADecryptString(const char *privFilename, const char *ciphertext) -{ - FileSource privFile(privFilename, true, new HexDecoder); - RSAES_OAEP_SHA_Decryptor priv(privFile); - - string result; - StringSource(ciphertext, true, new HexDecoder(new PK_DecryptorFilter(GlobalRNG(), priv, new StringSink(result)))); - return result; -} - -void RSASignFile(const char *privFilename, const char *messageFilename, const char *signatureFilename) -{ - FileSource privFile(privFilename, true, new HexDecoder); - RSASS::Signer priv(privFile); - FileSource f(messageFilename, true, new SignerFilter(GlobalRNG(), priv, new HexEncoder(new FileSink(signatureFilename)))); -} - -bool RSAVerifyFile(const char *pubFilename, const char *messageFilename, const char *signatureFilename) -{ - FileSource pubFile(pubFilename, true, new HexDecoder); - RSASS::Verifier pub(pubFile); - - FileSource signatureFile(signatureFilename, true, new HexDecoder); - if (signatureFile.MaxRetrievable() != pub.SignatureLength()) - return false; - SecByteBlock signature(pub.SignatureLength()); - signatureFile.Get(signature, signature.size()); - - VerifierFilter *verifierFilter = new VerifierFilter(pub); - verifierFilter->Put(signature, pub.SignatureLength()); - FileSource f(messageFilename, true, verifierFilter); - - return verifierFilter->GetLastResult(); -} - -void DigestFile(const char *filename) -{ - SHA1 sha; - RIPEMD160 ripemd; - SHA256 sha256; - Tiger tiger; - SHA512 sha512; - Whirlpool whirlpool; - vector_member_ptrs filters(6); - filters[0].reset(new HashFilter(sha)); - filters[1].reset(new HashFilter(ripemd)); - filters[2].reset(new HashFilter(tiger)); - filters[3].reset(new HashFilter(sha256)); - filters[4].reset(new HashFilter(sha512)); - filters[5].reset(new HashFilter(whirlpool)); - - member_ptr channelSwitch(new ChannelSwitch); - size_t i; - for (i=0; iAddDefaultRoute(*filters[i]); - FileSource(filename, true, channelSwitch.release()); - - HexEncoder encoder(new FileSink(cout), false); - for (i=0; iAlgorithmName() << ": "; - filters[i]->TransferTo(encoder); - cout << "\n"; - } -} - -void HmacFile(const char *hexKey, const char *file) -{ - member_ptr mac; - if (strcmp(hexKey, "selftest") == 0) - { - cerr << "Computing HMAC/SHA1 value for self test.\n"; - mac.reset(NewIntegrityCheckingMAC()); - } - else - { - std::string decodedKey; - StringSource(hexKey, true, new HexDecoder(new StringSink(decodedKey))); - mac.reset(new HMAC((const byte *)decodedKey.data(), decodedKey.size())); - } - FileSource(file, true, new HashFilter(*mac, new HexEncoder(new FileSink(cout)))); -} - -void AES_CTR_Encrypt(const char *hexKey, const char *hexIV, const char *infile, const char *outfile) -{ - SecByteBlock key = HexDecodeString(hexKey); - SecByteBlock iv = HexDecodeString(hexIV); - CTR_Mode::Encryption aes(key, key.size(), iv); - FileSource(infile, true, new StreamTransformationFilter(aes, new FileSink(outfile))); -} - -string EncryptString(const char *instr, const char *passPhrase) -{ - string outstr; - - DefaultEncryptorWithMAC encryptor(passPhrase, new HexEncoder(new StringSink(outstr))); - encryptor.Put((byte *)instr, strlen(instr)); - encryptor.MessageEnd(); - - return outstr; -} - -string DecryptString(const char *instr, const char *passPhrase) -{ - string outstr; - - HexDecoder decryptor(new DefaultDecryptorWithMAC(passPhrase, new StringSink(outstr))); - decryptor.Put((byte *)instr, strlen(instr)); - decryptor.MessageEnd(); - - return outstr; -} - -void EncryptFile(const char *in, const char *out, const char *passPhrase) -{ - FileSource f(in, true, new DefaultEncryptorWithMAC(passPhrase, new FileSink(out))); -} - -void DecryptFile(const char *in, const char *out, const char *passPhrase) -{ - FileSource f(in, true, new DefaultDecryptorWithMAC(passPhrase, new FileSink(out))); -} - -void SecretShareFile(int threshold, int nShares, const char *filename, const char *seed) -{ - assert(nShares >= 1 && nShares<=1000); - if (nShares < 1 || nShares > 1000) - throw InvalidArgument("SecretShareFile: " + IntToString(nShares) + " is not in range [1, 1000]"); - - RandomPool rng; - rng.IncorporateEntropy((byte *)seed, strlen(seed)); - - ChannelSwitch *channelSwitch; - FileSource source(filename, false, new SecretSharing(rng, threshold, nShares, channelSwitch = new ChannelSwitch)); - - vector_member_ptrs fileSinks(nShares); - string channel; - for (int i=0; i(i); - fileSinks[i]->Put((const byte *)channel.data(), 4); - channelSwitch->AddRoute(channel, *fileSinks[i], DEFAULT_CHANNEL); - } - - source.PumpAll(); -} - -void SecretRecoverFile(int threshold, const char *outFilename, char *const *inFilenames) -{ - assert(threshold >= 1 && threshold <=1000); - if (threshold < 1 || threshold > 1000) - throw InvalidArgument("SecretRecoverFile: " + IntToString(threshold) + " is not in range [1, 1000]"); - - SecretRecovery recovery(threshold, new FileSink(outFilename)); - - vector_member_ptrs fileSources(threshold); - SecByteBlock channel(4); - int i; - for (i=0; iPump(4); - fileSources[i]->Get(channel, 4); - fileSources[i]->Attach(new ChannelSwitch(recovery, string((char *)channel.begin(), 4))); - } - - while (fileSources[0]->Pump(256)) - for (i=1; iPump(256); - - for (i=0; iPumpAll(); -} - -void InformationDisperseFile(int threshold, int nShares, const char *filename) -{ - assert(threshold >= 1 && threshold <=1000); - if (threshold < 1 || threshold > 1000) - throw InvalidArgument("InformationDisperseFile: " + IntToString(nShares) + " is not in range [1, 1000]"); - - ChannelSwitch *channelSwitch; - FileSource source(filename, false, new InformationDispersal(threshold, nShares, channelSwitch = new ChannelSwitch)); - - vector_member_ptrs fileSinks(nShares); - string channel; - for (int i=0; i(i); - fileSinks[i]->Put((const byte *)channel.data(), 4); - channelSwitch->AddRoute(channel, *fileSinks[i], DEFAULT_CHANNEL); - } - - source.PumpAll(); -} - -void InformationRecoverFile(int threshold, const char *outFilename, char *const *inFilenames) -{ - assert(threshold<=1000); - if (threshold < 1 || threshold > 1000) - throw InvalidArgument("InformationRecoverFile: " + IntToString(threshold) + " is not in range [1, 1000]"); - - InformationRecovery recovery(threshold, new FileSink(outFilename)); - - vector_member_ptrs fileSources(threshold); - SecByteBlock channel(4); - int i; - for (i=0; iPump(4); - fileSources[i]->Get(channel, 4); - fileSources[i]->Attach(new ChannelSwitch(recovery, string((char *)channel.begin(), 4))); - } - - while (fileSources[0]->Pump(256)) - for (i=1; iPump(256); - - for (i=0; iPumpAll(); -} - -void GzipFile(const char *in, const char *out, int deflate_level) -{ -// FileSource(in, true, new Gzip(new FileSink(out), deflate_level)); - - // use a filter graph to compare decompressed data with original - // - // Source ----> Gzip ------> Sink - // \ | - // \ Gunzip - // \ | - // \ v - // > ComparisonFilter - - EqualityComparisonFilter comparison; - - Gunzip gunzip(new ChannelSwitch(comparison, "0")); - gunzip.SetAutoSignalPropagation(0); - - FileSink sink(out); - - ChannelSwitch *cs; - Gzip gzip(cs = new ChannelSwitch(sink), deflate_level); - cs->AddDefaultRoute(gunzip); - - cs = new ChannelSwitch(gzip); - cs->AddDefaultRoute(comparison, "1"); - FileSource source(in, true, cs); - - comparison.ChannelMessageSeriesEnd("0"); - comparison.ChannelMessageSeriesEnd("1"); -} - -void GunzipFile(const char *in, const char *out) -{ - FileSource(in, true, new Gunzip(new FileSink(out))); -} - -void Base64Encode(const char *in, const char *out) -{ - FileSource(in, true, new Base64Encoder(new FileSink(out))); -} - -void Base64Decode(const char *in, const char *out) -{ - FileSource(in, true, new Base64Decoder(new FileSink(out))); -} - -void HexEncode(const char *in, const char *out) -{ - FileSource(in, true, new HexEncoder(new FileSink(out))); -} - -void HexDecode(const char *in, const char *out) -{ - FileSource(in, true, new HexDecoder(new FileSink(out))); -} - -void ForwardTcpPort(const char *sourcePortName, const char *destinationHost, const char *destinationPortName) -{ -#ifdef SOCKETS_AVAILABLE - SocketsInitializer sockInit; - - Socket sockListen, sockSource, sockDestination; - - int sourcePort = Socket::PortNameToNumber(sourcePortName); - int destinationPort = Socket::PortNameToNumber(destinationPortName); - - sockListen.Create(); - sockListen.Bind(sourcePort); - - int err = setsockopt(sockListen, IPPROTO_TCP, TCP_NODELAY, "\x01", 1); - assert(err == 0); - if(err != 0) - throw Socket::Err(sockListen, "setsockopt", sockListen.GetLastError()); - - cout << "Listing on port " << sourcePort << ".\n"; - sockListen.Listen(); - - sockListen.Accept(sockSource); - cout << "Connection accepted on port " << sourcePort << ".\n"; - sockListen.CloseSocket(); - - cout << "Making connection to " << destinationHost << ", port " << destinationPort << ".\n"; - sockDestination.Create(); - sockDestination.Connect(destinationHost, destinationPort); - - cout << "Connection made to " << destinationHost << ", starting to forward.\n"; - - SocketSource out(sockSource, false, new SocketSink(sockDestination)); - SocketSource in(sockDestination, false, new SocketSink(sockSource)); - - WaitObjectContainer waitObjects; - - while (!(in.SourceExhausted() && out.SourceExhausted())) - { - waitObjects.Clear(); - - out.GetWaitObjects(waitObjects, CallStack("ForwardTcpPort - out", NULL)); - in.GetWaitObjects(waitObjects, CallStack("ForwardTcpPort - in", NULL)); - - waitObjects.Wait(INFINITE_TIME); - - if (!out.SourceExhausted()) - { - cout << "o" << flush; - out.PumpAll2(false); - if (out.SourceExhausted()) - cout << "EOF received on source socket.\n"; - } - - if (!in.SourceExhausted()) - { - cout << "i" << flush; - in.PumpAll2(false); - if (in.SourceExhausted()) - cout << "EOF received on destination socket.\n"; - } - } -#else - cout << "Socket support was not enabled at compile time.\n"; - exit(-1); -#endif -} - -bool Validate(int alg, bool thorough, const char *seedInput) -{ - bool result; - - // Some editors have problems with the '\0' character when redirecting output. - // seedInput is argv[3] when issuing 'cryptest.exe v all ' - std::string seed = (seedInput ? seedInput : IntToString(time(NULL))); - seed.resize(16, ' '); - - OFB_Mode::Encryption& prng = dynamic_cast::Encryption&>(GlobalRNG()); - prng.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data()); - - PrintSeedAndThreads(seed); - - switch (alg) - { - case 0: result = ValidateAll(thorough); break; - case 1: result = TestSettings(); break; - case 2: result = TestOS_RNG(); break; - case 3: result = ValidateMD5(); break; - case 4: result = ValidateSHA(); break; - case 5: result = ValidateDES(); break; - case 6: result = ValidateIDEA(); break; - case 7: result = ValidateARC4(); break; - case 8: result = ValidateRC5(); break; - case 9: result = ValidateBlowfish(); break; -// case 10: result = ValidateDiamond2(); break; - case 11: result = ValidateThreeWay(); break; - case 12: result = ValidateBBS(); break; - case 13: result = ValidateDH(); break; - case 14: result = ValidateRSA(); break; - case 15: result = ValidateElGamal(); break; - case 16: result = ValidateDSA(thorough); break; -// case 17: result = ValidateHAVAL(); break; - case 18: result = ValidateSAFER(); break; - case 19: result = ValidateLUC(); break; - case 20: result = ValidateRabin(); break; -// case 21: result = ValidateBlumGoldwasser(); break; - case 22: result = ValidateECP(); break; - case 23: result = ValidateEC2N(); break; -// case 24: result = ValidateMD5MAC(); break; - case 25: result = ValidateGOST(); break; - case 26: result = ValidateTiger(); break; - case 27: result = ValidateRIPEMD(); break; - case 28: result = ValidateHMAC(); break; -// case 29: result = ValidateXMACC(); break; - case 30: result = ValidateSHARK(); break; - case 32: result = ValidateLUC_DH(); break; - case 33: result = ValidateLUC_DL(); break; - case 34: result = ValidateSEAL(); break; - case 35: result = ValidateCAST(); break; - case 36: result = ValidateSquare(); break; - case 37: result = ValidateRC2(); break; - case 38: result = ValidateRC6(); break; - case 39: result = ValidateMARS(); break; - case 40: result = ValidateRW(); break; - case 41: result = ValidateMD2(); break; - case 42: result = ValidateNR(); break; - case 43: result = ValidateMQV(); break; - case 44: result = ValidateRijndael(); break; - case 45: result = ValidateTwofish(); break; - case 46: result = ValidateSerpent(); break; - case 47: result = ValidateCipherModes(); break; - case 48: result = ValidateCRC32(); break; - case 49: result = ValidateECDSA(); break; - case 50: result = ValidateXTR_DH(); break; - case 51: result = ValidateSKIPJACK(); break; - case 52: result = ValidateSHA2(); break; - case 53: result = ValidatePanama(); break; - case 54: result = ValidateAdler32(); break; - case 55: result = ValidateMD4(); break; - case 56: result = ValidatePBKDF(); break; - case 57: result = ValidateESIGN(); break; - case 58: result = ValidateDLIES(); break; - case 59: result = ValidateBaseCode(); break; - case 60: result = ValidateSHACAL2(); break; - case 61: result = ValidateCamellia(); break; - case 62: result = ValidateWhirlpool(); break; - case 63: result = ValidateTTMAC(); break; - case 64: result = ValidateSalsa(); break; - case 65: result = ValidateSosemanuk(); break; - case 66: result = ValidateVMAC(); break; - case 67: result = ValidateCCM(); break; - case 68: result = ValidateGCM(); break; - case 69: result = ValidateCMAC(); break; - case 70: result = ValidateHKDF(); break; - default: return false; - } - -// Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55 -#if (CRYPTOPP_MSC_VERSION >= 1400) - tm localTime = {}; - char timeBuf[64]; - errno_t err; - - const time_t endTime = time(NULL); - err = localtime_s(&localTime, &endTime); - assert(err == 0); - err = asctime_s(timeBuf, sizeof(timeBuf), &localTime); - assert(err == 0); - - cout << "\nTest ended at " << timeBuf; -#else - const time_t endTime = time(NULL); - cout << "\nTest ended at " << asctime(localtime(&endTime)); -#endif - - cout << "Seed used was: " << seed << endl; - - return result; -} diff --git a/external/crypto++-5.6.3/tftables.cpp b/external/crypto++-5.6.3/tftables.cpp deleted file mode 100644 index b74b35a1e..000000000 --- a/external/crypto++-5.6.3/tftables.cpp +++ /dev/null @@ -1,323 +0,0 @@ -// Twofish tables - -#include "pch.h" -#include "config.h" - -#include "twofish.h" - -#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE -# pragma GCC diagnostic ignored "-Wmissing-braces" -#endif - -NAMESPACE_BEGIN(CryptoPP) - -const byte Twofish::Base::q[2][256] = { - 0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, - 0xE4, 0xDD, 0xD1, 0x38, 0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C, - 0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 0xF2, 0xD0, 0x8B, 0x30, - 0x84, 0x54, 0xDF, 0x23, 0x19, 0x5B, 0x3D, 0x59, 0xF3, 0xAE, 0xA2, 0x82, - 0x63, 0x01, 0x83, 0x2E, 0xD9, 0x51, 0x9B, 0x7C, 0xA6, 0xEB, 0xA5, 0xBE, - 0x16, 0x0C, 0xE3, 0x61, 0xC0, 0x8C, 0x3A, 0xF5, 0x73, 0x2C, 0x25, 0x0B, - 0xBB, 0x4E, 0x89, 0x6B, 0x53, 0x6A, 0xB4, 0xF1, 0xE1, 0xE6, 0xBD, 0x45, - 0xE2, 0xF4, 0xB6, 0x66, 0xCC, 0x95, 0x03, 0x56, 0xD4, 0x1C, 0x1E, 0xD7, - 0xFB, 0xC3, 0x8E, 0xB5, 0xE9, 0xCF, 0xBF, 0xBA, 0xEA, 0x77, 0x39, 0xAF, - 0x33, 0xC9, 0x62, 0x71, 0x81, 0x79, 0x09, 0xAD, 0x24, 0xCD, 0xF9, 0xD8, - 0xE5, 0xC5, 0xB9, 0x4D, 0x44, 0x08, 0x86, 0xE7, 0xA1, 0x1D, 0xAA, 0xED, - 0x06, 0x70, 0xB2, 0xD2, 0x41, 0x7B, 0xA0, 0x11, 0x31, 0xC2, 0x27, 0x90, - 0x20, 0xF6, 0x60, 0xFF, 0x96, 0x5C, 0xB1, 0xAB, 0x9E, 0x9C, 0x52, 0x1B, - 0x5F, 0x93, 0x0A, 0xEF, 0x91, 0x85, 0x49, 0xEE, 0x2D, 0x4F, 0x8F, 0x3B, - 0x47, 0x87, 0x6D, 0x46, 0xD6, 0x3E, 0x69, 0x64, 0x2A, 0xCE, 0xCB, 0x2F, - 0xFC, 0x97, 0x05, 0x7A, 0xAC, 0x7F, 0xD5, 0x1A, 0x4B, 0x0E, 0xA7, 0x5A, - 0x28, 0x14, 0x3F, 0x29, 0x88, 0x3C, 0x4C, 0x02, 0xB8, 0xDA, 0xB0, 0x17, - 0x55, 0x1F, 0x8A, 0x7D, 0x57, 0xC7, 0x8D, 0x74, 0xB7, 0xC4, 0x9F, 0x72, - 0x7E, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34, 0x6E, 0x50, 0xDE, 0x68, - 0x65, 0xBC, 0xDB, 0xF8, 0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, - 0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 0x6F, 0x9D, 0x36, 0x42, - 0x4A, 0x5E, 0xC1, 0xE0, - - 0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 0x4A, 0xD3, 0xE6, 0x6B, - 0x45, 0x7D, 0xE8, 0x4B, 0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1, - 0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 0x5E, 0xBA, 0xAE, 0x5B, - 0x8A, 0x00, 0xBC, 0x9D, 0x6D, 0xC1, 0xB1, 0x0E, 0x80, 0x5D, 0xD2, 0xD5, - 0xA0, 0x84, 0x07, 0x14, 0xB5, 0x90, 0x2C, 0xA3, 0xB2, 0x73, 0x4C, 0x54, - 0x92, 0x74, 0x36, 0x51, 0x38, 0xB0, 0xBD, 0x5A, 0xFC, 0x60, 0x62, 0x96, - 0x6C, 0x42, 0xF7, 0x10, 0x7C, 0x28, 0x27, 0x8C, 0x13, 0x95, 0x9C, 0xC7, - 0x24, 0x46, 0x3B, 0x70, 0xCA, 0xE3, 0x85, 0xCB, 0x11, 0xD0, 0x93, 0xB8, - 0xA6, 0x83, 0x20, 0xFF, 0x9F, 0x77, 0xC3, 0xCC, 0x03, 0x6F, 0x08, 0xBF, - 0x40, 0xE7, 0x2B, 0xE2, 0x79, 0x0C, 0xAA, 0x82, 0x41, 0x3A, 0xEA, 0xB9, - 0xE4, 0x9A, 0xA4, 0x97, 0x7E, 0xDA, 0x7A, 0x17, 0x66, 0x94, 0xA1, 0x1D, - 0x3D, 0xF0, 0xDE, 0xB3, 0x0B, 0x72, 0xA7, 0x1C, 0xEF, 0xD1, 0x53, 0x3E, - 0x8F, 0x33, 0x26, 0x5F, 0xEC, 0x76, 0x2A, 0x49, 0x81, 0x88, 0xEE, 0x21, - 0xC4, 0x1A, 0xEB, 0xD9, 0xC5, 0x39, 0x99, 0xCD, 0xAD, 0x31, 0x8B, 0x01, - 0x18, 0x23, 0xDD, 0x1F, 0x4E, 0x2D, 0xF9, 0x48, 0x4F, 0xF2, 0x65, 0x8E, - 0x78, 0x5C, 0x58, 0x19, 0x8D, 0xE5, 0x98, 0x57, 0x67, 0x7F, 0x05, 0x64, - 0xAF, 0x63, 0xB6, 0xFE, 0xF5, 0xB7, 0x3C, 0xA5, 0xCE, 0xE9, 0x68, 0x44, - 0xE0, 0x4D, 0x43, 0x69, 0x29, 0x2E, 0xAC, 0x15, 0x59, 0xA8, 0x0A, 0x9E, - 0x6E, 0x47, 0xDF, 0x34, 0x35, 0x6A, 0xCF, 0xDC, 0x22, 0xC9, 0xC0, 0x9B, - 0x89, 0xD4, 0xED, 0xAB, 0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, - 0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 0x16, 0x25, 0x86, 0x56, - 0x55, 0x09, 0xBE, 0x91 -}; - -const word32 Twofish::Base::mds[4][256] = { - 0xbcbc3275, 0xecec21f3, 0x202043c6, 0xb3b3c9f4, - 0xdada03db, 0x02028b7b, 0xe2e22bfb, 0x9e9efac8, - 0xc9c9ec4a, 0xd4d409d3, 0x18186be6, 0x1e1e9f6b, - 0x98980e45, 0xb2b2387d, 0xa6a6d2e8, 0x2626b74b, - 0x3c3c57d6, 0x93938a32, 0x8282eed8, 0x525298fd, - 0x7b7bd437, 0xbbbb3771, 0x5b5b97f1, 0x474783e1, - 0x24243c30, 0x5151e20f, 0xbabac6f8, 0x4a4af31b, - 0xbfbf4887, 0x0d0d70fa, 0xb0b0b306, 0x7575de3f, - 0xd2d2fd5e, 0x7d7d20ba, 0x666631ae, 0x3a3aa35b, - 0x59591c8a, 0x00000000, 0xcdcd93bc, 0x1a1ae09d, - 0xaeae2c6d, 0x7f7fabc1, 0x2b2bc7b1, 0xbebeb90e, - 0xe0e0a080, 0x8a8a105d, 0x3b3b52d2, 0x6464bad5, - 0xd8d888a0, 0xe7e7a584, 0x5f5fe807, 0x1b1b1114, - 0x2c2cc2b5, 0xfcfcb490, 0x3131272c, 0x808065a3, - 0x73732ab2, 0x0c0c8173, 0x79795f4c, 0x6b6b4154, - 0x4b4b0292, 0x53536974, 0x94948f36, 0x83831f51, - 0x2a2a3638, 0xc4c49cb0, 0x2222c8bd, 0xd5d5f85a, - 0xbdbdc3fc, 0x48487860, 0xffffce62, 0x4c4c0796, - 0x4141776c, 0xc7c7e642, 0xebeb24f7, 0x1c1c1410, - 0x5d5d637c, 0x36362228, 0x6767c027, 0xe9e9af8c, - 0x4444f913, 0x1414ea95, 0xf5f5bb9c, 0xcfcf18c7, - 0x3f3f2d24, 0xc0c0e346, 0x7272db3b, 0x54546c70, - 0x29294cca, 0xf0f035e3, 0x0808fe85, 0xc6c617cb, - 0xf3f34f11, 0x8c8ce4d0, 0xa4a45993, 0xcaca96b8, - 0x68683ba6, 0xb8b84d83, 0x38382820, 0xe5e52eff, - 0xadad569f, 0x0b0b8477, 0xc8c81dc3, 0x9999ffcc, - 0x5858ed03, 0x19199a6f, 0x0e0e0a08, 0x95957ebf, - 0x70705040, 0xf7f730e7, 0x6e6ecf2b, 0x1f1f6ee2, - 0xb5b53d79, 0x09090f0c, 0x616134aa, 0x57571682, - 0x9f9f0b41, 0x9d9d803a, 0x111164ea, 0x2525cdb9, - 0xafafdde4, 0x4545089a, 0xdfdf8da4, 0xa3a35c97, - 0xeaead57e, 0x353558da, 0xededd07a, 0x4343fc17, - 0xf8f8cb66, 0xfbfbb194, 0x3737d3a1, 0xfafa401d, - 0xc2c2683d, 0xb4b4ccf0, 0x32325dde, 0x9c9c71b3, - 0x5656e70b, 0xe3e3da72, 0x878760a7, 0x15151b1c, - 0xf9f93aef, 0x6363bfd1, 0x3434a953, 0x9a9a853e, - 0xb1b1428f, 0x7c7cd133, 0x88889b26, 0x3d3da65f, - 0xa1a1d7ec, 0xe4e4df76, 0x8181942a, 0x91910149, - 0x0f0ffb81, 0xeeeeaa88, 0x161661ee, 0xd7d77321, - 0x9797f5c4, 0xa5a5a81a, 0xfefe3feb, 0x6d6db5d9, - 0x7878aec5, 0xc5c56d39, 0x1d1de599, 0x7676a4cd, - 0x3e3edcad, 0xcbcb6731, 0xb6b6478b, 0xefef5b01, - 0x12121e18, 0x6060c523, 0x6a6ab0dd, 0x4d4df61f, - 0xcecee94e, 0xdede7c2d, 0x55559df9, 0x7e7e5a48, - 0x2121b24f, 0x03037af2, 0xa0a02665, 0x5e5e198e, - 0x5a5a6678, 0x65654b5c, 0x62624e58, 0xfdfd4519, - 0x0606f48d, 0x404086e5, 0xf2f2be98, 0x3333ac57, - 0x17179067, 0x05058e7f, 0xe8e85e05, 0x4f4f7d64, - 0x89896aaf, 0x10109563, 0x74742fb6, 0x0a0a75fe, - 0x5c5c92f5, 0x9b9b74b7, 0x2d2d333c, 0x3030d6a5, - 0x2e2e49ce, 0x494989e9, 0x46467268, 0x77775544, - 0xa8a8d8e0, 0x9696044d, 0x2828bd43, 0xa9a92969, - 0xd9d97929, 0x8686912e, 0xd1d187ac, 0xf4f44a15, - 0x8d8d1559, 0xd6d682a8, 0xb9b9bc0a, 0x42420d9e, - 0xf6f6c16e, 0x2f2fb847, 0xdddd06df, 0x23233934, - 0xcccc6235, 0xf1f1c46a, 0xc1c112cf, 0x8585ebdc, - 0x8f8f9e22, 0x7171a1c9, 0x9090f0c0, 0xaaaa539b, - 0x0101f189, 0x8b8be1d4, 0x4e4e8ced, 0x8e8e6fab, - 0xababa212, 0x6f6f3ea2, 0xe6e6540d, 0xdbdbf252, - 0x92927bbb, 0xb7b7b602, 0x6969ca2f, 0x3939d9a9, - 0xd3d30cd7, 0xa7a72361, 0xa2a2ad1e, 0xc3c399b4, - 0x6c6c4450, 0x07070504, 0x04047ff6, 0x272746c2, - 0xacaca716, 0xd0d07625, 0x50501386, 0xdcdcf756, - 0x84841a55, 0xe1e15109, 0x7a7a25be, 0x1313ef91, - - 0xa9d93939, 0x67901717, 0xb3719c9c, 0xe8d2a6a6, - 0x04050707, 0xfd985252, 0xa3658080, 0x76dfe4e4, - 0x9a084545, 0x92024b4b, 0x80a0e0e0, 0x78665a5a, - 0xe4ddafaf, 0xddb06a6a, 0xd1bf6363, 0x38362a2a, - 0x0d54e6e6, 0xc6432020, 0x3562cccc, 0x98bef2f2, - 0x181e1212, 0xf724ebeb, 0xecd7a1a1, 0x6c774141, - 0x43bd2828, 0x7532bcbc, 0x37d47b7b, 0x269b8888, - 0xfa700d0d, 0x13f94444, 0x94b1fbfb, 0x485a7e7e, - 0xf27a0303, 0xd0e48c8c, 0x8b47b6b6, 0x303c2424, - 0x84a5e7e7, 0x54416b6b, 0xdf06dddd, 0x23c56060, - 0x1945fdfd, 0x5ba33a3a, 0x3d68c2c2, 0x59158d8d, - 0xf321ecec, 0xae316666, 0xa23e6f6f, 0x82165757, - 0x63951010, 0x015befef, 0x834db8b8, 0x2e918686, - 0xd9b56d6d, 0x511f8383, 0x9b53aaaa, 0x7c635d5d, - 0xa63b6868, 0xeb3ffefe, 0xa5d63030, 0xbe257a7a, - 0x16a7acac, 0x0c0f0909, 0xe335f0f0, 0x6123a7a7, - 0xc0f09090, 0x8cafe9e9, 0x3a809d9d, 0xf5925c5c, - 0x73810c0c, 0x2c273131, 0x2576d0d0, 0x0be75656, - 0xbb7b9292, 0x4ee9cece, 0x89f10101, 0x6b9f1e1e, - 0x53a93434, 0x6ac4f1f1, 0xb499c3c3, 0xf1975b5b, - 0xe1834747, 0xe66b1818, 0xbdc82222, 0x450e9898, - 0xe26e1f1f, 0xf4c9b3b3, 0xb62f7474, 0x66cbf8f8, - 0xccff9999, 0x95ea1414, 0x03ed5858, 0x56f7dcdc, - 0xd4e18b8b, 0x1c1b1515, 0x1eada2a2, 0xd70cd3d3, - 0xfb2be2e2, 0xc31dc8c8, 0x8e195e5e, 0xb5c22c2c, - 0xe9894949, 0xcf12c1c1, 0xbf7e9595, 0xba207d7d, - 0xea641111, 0x77840b0b, 0x396dc5c5, 0xaf6a8989, - 0x33d17c7c, 0xc9a17171, 0x62ceffff, 0x7137bbbb, - 0x81fb0f0f, 0x793db5b5, 0x0951e1e1, 0xaddc3e3e, - 0x242d3f3f, 0xcda47676, 0xf99d5555, 0xd8ee8282, - 0xe5864040, 0xc5ae7878, 0xb9cd2525, 0x4d049696, - 0x44557777, 0x080a0e0e, 0x86135050, 0xe730f7f7, - 0xa1d33737, 0x1d40fafa, 0xaa346161, 0xed8c4e4e, - 0x06b3b0b0, 0x706c5454, 0xb22a7373, 0xd2523b3b, - 0x410b9f9f, 0x7b8b0202, 0xa088d8d8, 0x114ff3f3, - 0x3167cbcb, 0xc2462727, 0x27c06767, 0x90b4fcfc, - 0x20283838, 0xf67f0404, 0x60784848, 0xff2ee5e5, - 0x96074c4c, 0x5c4b6565, 0xb1c72b2b, 0xab6f8e8e, - 0x9e0d4242, 0x9cbbf5f5, 0x52f2dbdb, 0x1bf34a4a, - 0x5fa63d3d, 0x9359a4a4, 0x0abcb9b9, 0xef3af9f9, - 0x91ef1313, 0x85fe0808, 0x49019191, 0xee611616, - 0x2d7cdede, 0x4fb22121, 0x8f42b1b1, 0x3bdb7272, - 0x47b82f2f, 0x8748bfbf, 0x6d2caeae, 0x46e3c0c0, - 0xd6573c3c, 0x3e859a9a, 0x6929a9a9, 0x647d4f4f, - 0x2a948181, 0xce492e2e, 0xcb17c6c6, 0x2fca6969, - 0xfcc3bdbd, 0x975ca3a3, 0x055ee8e8, 0x7ad0eded, - 0xac87d1d1, 0x7f8e0505, 0xd5ba6464, 0x1aa8a5a5, - 0x4bb72626, 0x0eb9bebe, 0xa7608787, 0x5af8d5d5, - 0x28223636, 0x14111b1b, 0x3fde7575, 0x2979d9d9, - 0x88aaeeee, 0x3c332d2d, 0x4c5f7979, 0x02b6b7b7, - 0xb896caca, 0xda583535, 0xb09cc4c4, 0x17fc4343, - 0x551a8484, 0x1ff64d4d, 0x8a1c5959, 0x7d38b2b2, - 0x57ac3333, 0xc718cfcf, 0x8df40606, 0x74695353, - 0xb7749b9b, 0xc4f59797, 0x9f56adad, 0x72dae3e3, - 0x7ed5eaea, 0x154af4f4, 0x229e8f8f, 0x12a2abab, - 0x584e6262, 0x07e85f5f, 0x99e51d1d, 0x34392323, - 0x6ec1f6f6, 0x50446c6c, 0xde5d3232, 0x68724646, - 0x6526a0a0, 0xbc93cdcd, 0xdb03dada, 0xf8c6baba, - 0xc8fa9e9e, 0xa882d6d6, 0x2bcf6e6e, 0x40507070, - 0xdceb8585, 0xfe750a0a, 0x328a9393, 0xa48ddfdf, - 0xca4c2929, 0x10141c1c, 0x2173d7d7, 0xf0ccb4b4, - 0xd309d4d4, 0x5d108a8a, 0x0fe25151, 0x00000000, - 0x6f9a1919, 0x9de01a1a, 0x368f9494, 0x42e6c7c7, - 0x4aecc9c9, 0x5efdd2d2, 0xc1ab7f7f, 0xe0d8a8a8, - - 0xbc75bc32, 0xecf3ec21, 0x20c62043, 0xb3f4b3c9, - 0xdadbda03, 0x027b028b, 0xe2fbe22b, 0x9ec89efa, - 0xc94ac9ec, 0xd4d3d409, 0x18e6186b, 0x1e6b1e9f, - 0x9845980e, 0xb27db238, 0xa6e8a6d2, 0x264b26b7, - 0x3cd63c57, 0x9332938a, 0x82d882ee, 0x52fd5298, - 0x7b377bd4, 0xbb71bb37, 0x5bf15b97, 0x47e14783, - 0x2430243c, 0x510f51e2, 0xbaf8bac6, 0x4a1b4af3, - 0xbf87bf48, 0x0dfa0d70, 0xb006b0b3, 0x753f75de, - 0xd25ed2fd, 0x7dba7d20, 0x66ae6631, 0x3a5b3aa3, - 0x598a591c, 0x00000000, 0xcdbccd93, 0x1a9d1ae0, - 0xae6dae2c, 0x7fc17fab, 0x2bb12bc7, 0xbe0ebeb9, - 0xe080e0a0, 0x8a5d8a10, 0x3bd23b52, 0x64d564ba, - 0xd8a0d888, 0xe784e7a5, 0x5f075fe8, 0x1b141b11, - 0x2cb52cc2, 0xfc90fcb4, 0x312c3127, 0x80a38065, - 0x73b2732a, 0x0c730c81, 0x794c795f, 0x6b546b41, - 0x4b924b02, 0x53745369, 0x9436948f, 0x8351831f, - 0x2a382a36, 0xc4b0c49c, 0x22bd22c8, 0xd55ad5f8, - 0xbdfcbdc3, 0x48604878, 0xff62ffce, 0x4c964c07, - 0x416c4177, 0xc742c7e6, 0xebf7eb24, 0x1c101c14, - 0x5d7c5d63, 0x36283622, 0x672767c0, 0xe98ce9af, - 0x441344f9, 0x149514ea, 0xf59cf5bb, 0xcfc7cf18, - 0x3f243f2d, 0xc046c0e3, 0x723b72db, 0x5470546c, - 0x29ca294c, 0xf0e3f035, 0x088508fe, 0xc6cbc617, - 0xf311f34f, 0x8cd08ce4, 0xa493a459, 0xcab8ca96, - 0x68a6683b, 0xb883b84d, 0x38203828, 0xe5ffe52e, - 0xad9fad56, 0x0b770b84, 0xc8c3c81d, 0x99cc99ff, - 0x580358ed, 0x196f199a, 0x0e080e0a, 0x95bf957e, - 0x70407050, 0xf7e7f730, 0x6e2b6ecf, 0x1fe21f6e, - 0xb579b53d, 0x090c090f, 0x61aa6134, 0x57825716, - 0x9f419f0b, 0x9d3a9d80, 0x11ea1164, 0x25b925cd, - 0xafe4afdd, 0x459a4508, 0xdfa4df8d, 0xa397a35c, - 0xea7eead5, 0x35da3558, 0xed7aedd0, 0x431743fc, - 0xf866f8cb, 0xfb94fbb1, 0x37a137d3, 0xfa1dfa40, - 0xc23dc268, 0xb4f0b4cc, 0x32de325d, 0x9cb39c71, - 0x560b56e7, 0xe372e3da, 0x87a78760, 0x151c151b, - 0xf9eff93a, 0x63d163bf, 0x345334a9, 0x9a3e9a85, - 0xb18fb142, 0x7c337cd1, 0x8826889b, 0x3d5f3da6, - 0xa1eca1d7, 0xe476e4df, 0x812a8194, 0x91499101, - 0x0f810ffb, 0xee88eeaa, 0x16ee1661, 0xd721d773, - 0x97c497f5, 0xa51aa5a8, 0xfeebfe3f, 0x6dd96db5, - 0x78c578ae, 0xc539c56d, 0x1d991de5, 0x76cd76a4, - 0x3ead3edc, 0xcb31cb67, 0xb68bb647, 0xef01ef5b, - 0x1218121e, 0x602360c5, 0x6add6ab0, 0x4d1f4df6, - 0xce4ecee9, 0xde2dde7c, 0x55f9559d, 0x7e487e5a, - 0x214f21b2, 0x03f2037a, 0xa065a026, 0x5e8e5e19, - 0x5a785a66, 0x655c654b, 0x6258624e, 0xfd19fd45, - 0x068d06f4, 0x40e54086, 0xf298f2be, 0x335733ac, - 0x17671790, 0x057f058e, 0xe805e85e, 0x4f644f7d, - 0x89af896a, 0x10631095, 0x74b6742f, 0x0afe0a75, - 0x5cf55c92, 0x9bb79b74, 0x2d3c2d33, 0x30a530d6, - 0x2ece2e49, 0x49e94989, 0x46684672, 0x77447755, - 0xa8e0a8d8, 0x964d9604, 0x284328bd, 0xa969a929, - 0xd929d979, 0x862e8691, 0xd1acd187, 0xf415f44a, - 0x8d598d15, 0xd6a8d682, 0xb90ab9bc, 0x429e420d, - 0xf66ef6c1, 0x2f472fb8, 0xdddfdd06, 0x23342339, - 0xcc35cc62, 0xf16af1c4, 0xc1cfc112, 0x85dc85eb, - 0x8f228f9e, 0x71c971a1, 0x90c090f0, 0xaa9baa53, - 0x018901f1, 0x8bd48be1, 0x4eed4e8c, 0x8eab8e6f, - 0xab12aba2, 0x6fa26f3e, 0xe60de654, 0xdb52dbf2, - 0x92bb927b, 0xb702b7b6, 0x692f69ca, 0x39a939d9, - 0xd3d7d30c, 0xa761a723, 0xa21ea2ad, 0xc3b4c399, - 0x6c506c44, 0x07040705, 0x04f6047f, 0x27c22746, - 0xac16aca7, 0xd025d076, 0x50865013, 0xdc56dcf7, - 0x8455841a, 0xe109e151, 0x7abe7a25, 0x139113ef, - - 0xd939a9d9, 0x90176790, 0x719cb371, 0xd2a6e8d2, - 0x05070405, 0x9852fd98, 0x6580a365, 0xdfe476df, - 0x08459a08, 0x024b9202, 0xa0e080a0, 0x665a7866, - 0xddafe4dd, 0xb06addb0, 0xbf63d1bf, 0x362a3836, - 0x54e60d54, 0x4320c643, 0x62cc3562, 0xbef298be, - 0x1e12181e, 0x24ebf724, 0xd7a1ecd7, 0x77416c77, - 0xbd2843bd, 0x32bc7532, 0xd47b37d4, 0x9b88269b, - 0x700dfa70, 0xf94413f9, 0xb1fb94b1, 0x5a7e485a, - 0x7a03f27a, 0xe48cd0e4, 0x47b68b47, 0x3c24303c, - 0xa5e784a5, 0x416b5441, 0x06dddf06, 0xc56023c5, - 0x45fd1945, 0xa33a5ba3, 0x68c23d68, 0x158d5915, - 0x21ecf321, 0x3166ae31, 0x3e6fa23e, 0x16578216, - 0x95106395, 0x5bef015b, 0x4db8834d, 0x91862e91, - 0xb56dd9b5, 0x1f83511f, 0x53aa9b53, 0x635d7c63, - 0x3b68a63b, 0x3ffeeb3f, 0xd630a5d6, 0x257abe25, - 0xa7ac16a7, 0x0f090c0f, 0x35f0e335, 0x23a76123, - 0xf090c0f0, 0xafe98caf, 0x809d3a80, 0x925cf592, - 0x810c7381, 0x27312c27, 0x76d02576, 0xe7560be7, - 0x7b92bb7b, 0xe9ce4ee9, 0xf10189f1, 0x9f1e6b9f, - 0xa93453a9, 0xc4f16ac4, 0x99c3b499, 0x975bf197, - 0x8347e183, 0x6b18e66b, 0xc822bdc8, 0x0e98450e, - 0x6e1fe26e, 0xc9b3f4c9, 0x2f74b62f, 0xcbf866cb, - 0xff99ccff, 0xea1495ea, 0xed5803ed, 0xf7dc56f7, - 0xe18bd4e1, 0x1b151c1b, 0xada21ead, 0x0cd3d70c, - 0x2be2fb2b, 0x1dc8c31d, 0x195e8e19, 0xc22cb5c2, - 0x8949e989, 0x12c1cf12, 0x7e95bf7e, 0x207dba20, - 0x6411ea64, 0x840b7784, 0x6dc5396d, 0x6a89af6a, - 0xd17c33d1, 0xa171c9a1, 0xceff62ce, 0x37bb7137, - 0xfb0f81fb, 0x3db5793d, 0x51e10951, 0xdc3eaddc, - 0x2d3f242d, 0xa476cda4, 0x9d55f99d, 0xee82d8ee, - 0x8640e586, 0xae78c5ae, 0xcd25b9cd, 0x04964d04, - 0x55774455, 0x0a0e080a, 0x13508613, 0x30f7e730, - 0xd337a1d3, 0x40fa1d40, 0x3461aa34, 0x8c4eed8c, - 0xb3b006b3, 0x6c54706c, 0x2a73b22a, 0x523bd252, - 0x0b9f410b, 0x8b027b8b, 0x88d8a088, 0x4ff3114f, - 0x67cb3167, 0x4627c246, 0xc06727c0, 0xb4fc90b4, - 0x28382028, 0x7f04f67f, 0x78486078, 0x2ee5ff2e, - 0x074c9607, 0x4b655c4b, 0xc72bb1c7, 0x6f8eab6f, - 0x0d429e0d, 0xbbf59cbb, 0xf2db52f2, 0xf34a1bf3, - 0xa63d5fa6, 0x59a49359, 0xbcb90abc, 0x3af9ef3a, - 0xef1391ef, 0xfe0885fe, 0x01914901, 0x6116ee61, - 0x7cde2d7c, 0xb2214fb2, 0x42b18f42, 0xdb723bdb, - 0xb82f47b8, 0x48bf8748, 0x2cae6d2c, 0xe3c046e3, - 0x573cd657, 0x859a3e85, 0x29a96929, 0x7d4f647d, - 0x94812a94, 0x492ece49, 0x17c6cb17, 0xca692fca, - 0xc3bdfcc3, 0x5ca3975c, 0x5ee8055e, 0xd0ed7ad0, - 0x87d1ac87, 0x8e057f8e, 0xba64d5ba, 0xa8a51aa8, - 0xb7264bb7, 0xb9be0eb9, 0x6087a760, 0xf8d55af8, - 0x22362822, 0x111b1411, 0xde753fde, 0x79d92979, - 0xaaee88aa, 0x332d3c33, 0x5f794c5f, 0xb6b702b6, - 0x96cab896, 0x5835da58, 0x9cc4b09c, 0xfc4317fc, - 0x1a84551a, 0xf64d1ff6, 0x1c598a1c, 0x38b27d38, - 0xac3357ac, 0x18cfc718, 0xf4068df4, 0x69537469, - 0x749bb774, 0xf597c4f5, 0x56ad9f56, 0xdae372da, - 0xd5ea7ed5, 0x4af4154a, 0x9e8f229e, 0xa2ab12a2, - 0x4e62584e, 0xe85f07e8, 0xe51d99e5, 0x39233439, - 0xc1f66ec1, 0x446c5044, 0x5d32de5d, 0x72466872, - 0x26a06526, 0x93cdbc93, 0x03dadb03, 0xc6baf8c6, - 0xfa9ec8fa, 0x82d6a882, 0xcf6e2bcf, 0x50704050, - 0xeb85dceb, 0x750afe75, 0x8a93328a, 0x8ddfa48d, - 0x4c29ca4c, 0x141c1014, 0x73d72173, 0xccb4f0cc, - 0x09d4d309, 0x108a5d10, 0xe2510fe2, 0x00000000, - 0x9a196f9a, 0xe01a9de0, 0x8f94368f, 0xe6c742e6, - 0xecc94aec, 0xfdd25efd, 0xab7fc1ab, 0xd8a8e0d8}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/tiger.cpp b/external/crypto++-5.6.3/tiger.cpp deleted file mode 100644 index a837636a7..000000000 --- a/external/crypto++-5.6.3/tiger.cpp +++ /dev/null @@ -1,276 +0,0 @@ -// tiger.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -#include "tiger.h" -#include "misc.h" -#include "cpu.h" - -NAMESPACE_BEGIN(CryptoPP) - -void Tiger::InitState(HashWordType *state) -{ - state[0] = W64LIT(0x0123456789ABCDEF); - state[1] = W64LIT(0xFEDCBA9876543210); - state[2] = W64LIT(0xF096A5B4C3B2E187); -} - -void Tiger::TruncatedFinal(byte *hash, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - PadLastBlock(56, 0x01); - CorrectEndianess(m_data, m_data, 56); - - m_data[7] = GetBitCountLo(); - - Transform(m_state, m_data); - CorrectEndianess(m_state, m_state, DigestSize()); - memcpy(hash, m_state, size); - - Restart(); // reinit for next use -} - -void Tiger::Transform (word64 *digest, const word64 *X) -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) - if (HasSSE2()) - { -#ifdef __GNUC__ - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS_PUSH_IF86(bx) -#else - #if _MSC_VER < 1300 - const word64 *t = table; - AS2( mov edx, t) - #else - AS2( lea edx, [table]) - #endif - AS2( mov eax, digest) - AS2( mov esi, X) -#endif - AS2( movq mm0, [eax]) - AS2( movq mm1, [eax+1*8]) - AS2( movq mm5, mm1) - AS2( movq mm2, [eax+2*8]) - AS2( movq mm7, [edx+4*2048+0*8]) - AS2( movq mm6, [edx+4*2048+1*8]) - AS2( mov ecx, esp) - AS2( and esp, 0xfffffff0) - AS2( sub esp, 8*8) - AS_PUSH_IF86(cx) - -#define SSE2_round(a,b,c,x,mul) \ - AS2( pxor c, [x])\ - AS2( movd ecx, c)\ - AS2( movzx edi, cl)\ - AS2( movq mm3, [edx+0*2048+edi*8])\ - AS2( movzx edi, ch)\ - AS2( movq mm4, [edx+3*2048+edi*8])\ - AS2( shr ecx, 16)\ - AS2( movzx edi, cl)\ - AS2( pxor mm3, [edx+1*2048+edi*8])\ - AS2( movzx edi, ch)\ - AS2( pxor mm4, [edx+2*2048+edi*8])\ - AS3( pextrw ecx, c, 2)\ - AS2( movzx edi, cl)\ - AS2( pxor mm3, [edx+2*2048+edi*8])\ - AS2( movzx edi, ch)\ - AS2( pxor mm4, [edx+1*2048+edi*8])\ - AS3( pextrw ecx, c, 3)\ - AS2( movzx edi, cl)\ - AS2( pxor mm3, [edx+3*2048+edi*8])\ - AS2( psubq a, mm3)\ - AS2( movzx edi, ch)\ - AS2( pxor mm4, [edx+0*2048+edi*8])\ - AS2( paddq b, mm4)\ - SSE2_mul_##mul(b) - -#define SSE2_mul_5(b) \ - AS2( movq mm3, b)\ - AS2( psllq b, 2)\ - AS2( paddq b, mm3) - -#define SSE2_mul_7(b) \ - AS2( movq mm3, b)\ - AS2( psllq b, 3)\ - AS2( psubq b, mm3) - -#define SSE2_mul_9(b) \ - AS2( movq mm3, b)\ - AS2( psllq b, 3)\ - AS2( paddq b, mm3) - -#define label2_5 1 -#define label2_7 2 -#define label2_9 3 - -#define SSE2_pass(A,B,C,mul,X) \ - AS2( xor ebx, ebx)\ - ASL(mul)\ - SSE2_round(A,B,C,X+0*8+ebx,mul)\ - SSE2_round(B,C,A,X+1*8+ebx,mul)\ - AS2( cmp ebx, 6*8)\ - ASJ( je, label2_##mul, f)\ - SSE2_round(C,A,B,X+2*8+ebx,mul)\ - AS2( add ebx, 3*8)\ - ASJ( jmp, mul, b)\ - ASL(label2_##mul) - -#define SSE2_key_schedule(Y,X) \ - AS2( movq mm3, [X+7*8])\ - AS2( pxor mm3, mm6)\ - AS2( movq mm4, [X+0*8])\ - AS2( psubq mm4, mm3)\ - AS2( movq [Y+0*8], mm4)\ - AS2( pxor mm4, [X+1*8])\ - AS2( movq mm3, mm4)\ - AS2( movq [Y+1*8], mm4)\ - AS2( paddq mm4, [X+2*8])\ - AS2( pxor mm3, mm7)\ - AS2( psllq mm3, 19)\ - AS2( movq [Y+2*8], mm4)\ - AS2( pxor mm3, mm4)\ - AS2( movq mm4, [X+3*8])\ - AS2( psubq mm4, mm3)\ - AS2( movq [Y+3*8], mm4)\ - AS2( pxor mm4, [X+4*8])\ - AS2( movq mm3, mm4)\ - AS2( movq [Y+4*8], mm4)\ - AS2( paddq mm4, [X+5*8])\ - AS2( pxor mm3, mm7)\ - AS2( psrlq mm3, 23)\ - AS2( movq [Y+5*8], mm4)\ - AS2( pxor mm3, mm4)\ - AS2( movq mm4, [X+6*8])\ - AS2( psubq mm4, mm3)\ - AS2( movq [Y+6*8], mm4)\ - AS2( pxor mm4, [X+7*8])\ - AS2( movq mm3, mm4)\ - AS2( movq [Y+7*8], mm4)\ - AS2( paddq mm4, [Y+0*8])\ - AS2( pxor mm3, mm7)\ - AS2( psllq mm3, 19)\ - AS2( movq [Y+0*8], mm4)\ - AS2( pxor mm3, mm4)\ - AS2( movq mm4, [Y+1*8])\ - AS2( psubq mm4, mm3)\ - AS2( movq [Y+1*8], mm4)\ - AS2( pxor mm4, [Y+2*8])\ - AS2( movq mm3, mm4)\ - AS2( movq [Y+2*8], mm4)\ - AS2( paddq mm4, [Y+3*8])\ - AS2( pxor mm3, mm7)\ - AS2( psrlq mm3, 23)\ - AS2( movq [Y+3*8], mm4)\ - AS2( pxor mm3, mm4)\ - AS2( movq mm4, [Y+4*8])\ - AS2( psubq mm4, mm3)\ - AS2( movq [Y+4*8], mm4)\ - AS2( pxor mm4, [Y+5*8])\ - AS2( movq [Y+5*8], mm4)\ - AS2( paddq mm4, [Y+6*8])\ - AS2( movq [Y+6*8], mm4)\ - AS2( pxor mm4, [edx+4*2048+2*8])\ - AS2( movq mm3, [Y+7*8])\ - AS2( psubq mm3, mm4)\ - AS2( movq [Y+7*8], mm3) - -#if CRYPTOPP_BOOL_X32 - SSE2_pass(mm0, mm1, mm2, 5, esi) - SSE2_key_schedule(esp+8, esi) - SSE2_pass(mm2, mm0, mm1, 7, esp+8) - SSE2_key_schedule(esp+8, esp+8) - SSE2_pass(mm1, mm2, mm0, 9, esp+8) -#else - SSE2_pass(mm0, mm1, mm2, 5, esi) - SSE2_key_schedule(esp+4, esi) - SSE2_pass(mm2, mm0, mm1, 7, esp+4) - SSE2_key_schedule(esp+4, esp+4) - SSE2_pass(mm1, mm2, mm0, 9, esp+4) -#endif - - AS2( pxor mm0, [eax+0*8]) - AS2( movq [eax+0*8], mm0) - AS2( psubq mm1, mm5) - AS2( movq [eax+1*8], mm1) - AS2( paddq mm2, [eax+2*8]) - AS2( movq [eax+2*8], mm2) - - AS_POP_IF86(sp) - AS1( emms) - -#ifdef __GNUC__ - AS_POP_IF86(bx) - ATT_PREFIX - : - : "a" (digest), "S" (X), "d" (table) - : "%ecx", "%edi", "memory", "cc" - ); -#endif - } - else -#endif - { - word64 a = digest[0]; - word64 b = digest[1]; - word64 c = digest[2]; - word64 Y[8]; - -#define t1 (table) -#define t2 (table+256) -#define t3 (table+256*2) -#define t4 (table+256*3) - -#define round(a,b,c,x,mul) \ - c ^= x; \ - a -= t1[GETBYTE(c,0)] ^ t2[GETBYTE(c,2)] ^ t3[GETBYTE(c,4)] ^ t4[GETBYTE(c,6)]; \ - b += t4[GETBYTE(c,1)] ^ t3[GETBYTE(c,3)] ^ t2[GETBYTE(c,5)] ^ t1[GETBYTE(c,7)]; \ - b *= mul - -#define pass(a,b,c,mul,X) {\ - int i=0;\ - while (true)\ - {\ - round(a,b,c,X[i+0],mul); \ - round(b,c,a,X[i+1],mul); \ - if (i==6)\ - break;\ - round(c,a,b,X[i+2],mul); \ - i+=3;\ - }} - -#define key_schedule(Y,X) \ - Y[0] = X[0] - (X[7]^W64LIT(0xA5A5A5A5A5A5A5A5)); \ - Y[1] = X[1] ^ Y[0]; \ - Y[2] = X[2] + Y[1]; \ - Y[3] = X[3] - (Y[2] ^ ((~Y[1])<<19)); \ - Y[4] = X[4] ^ Y[3]; \ - Y[5] = X[5] + Y[4]; \ - Y[6] = X[6] - (Y[5] ^ ((~Y[4])>>23)); \ - Y[7] = X[7] ^ Y[6]; \ - Y[0] += Y[7]; \ - Y[1] -= Y[0] ^ ((~Y[7])<<19); \ - Y[2] ^= Y[1]; \ - Y[3] += Y[2]; \ - Y[4] -= Y[3] ^ ((~Y[2])>>23); \ - Y[5] ^= Y[4]; \ - Y[6] += Y[5]; \ - Y[7] -= Y[6] ^ W64LIT(0x0123456789ABCDEF) - - pass(a,b,c,5,X); - key_schedule(Y,X); - pass(c,a,b,7,Y); - key_schedule(Y,Y); - pass(b,c,a,9,Y); - - digest[0] = a ^ digest[0]; - digest[1] = b - digest[1]; - digest[2] = c + digest[2]; - } -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/tiger.h b/external/crypto++-5.6.3/tiger.h deleted file mode 100644 index 5f6e941ac..000000000 --- a/external/crypto++-5.6.3/tiger.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef CRYPTOPP_TIGER_H -#define CRYPTOPP_TIGER_H - -#include "config.h" -#include "iterhash.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// Tiger -class Tiger : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word64 *digest, const word64 *data); - void TruncatedFinal(byte *hash, size_t size); - static const char * StaticAlgorithmName() {return "Tiger";} - -protected: - static const word64 table[4*256+3]; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/tigertab.cpp b/external/crypto++-5.6.3/tigertab.cpp deleted file mode 100644 index 5c1595b5b..000000000 --- a/external/crypto++-5.6.3/tigertab.cpp +++ /dev/null @@ -1,525 +0,0 @@ -#include "pch.h" -#include "tiger.h" - -NAMESPACE_BEGIN(CryptoPP) - -const word64 Tiger::table[4*256+3] = -{ - W64LIT(0x02AAB17CF7E90C5E) /* 0 */, W64LIT(0xAC424B03E243A8EC) /* 1 */, - W64LIT(0x72CD5BE30DD5FCD3) /* 2 */, W64LIT(0x6D019B93F6F97F3A) /* 3 */, - W64LIT(0xCD9978FFD21F9193) /* 4 */, W64LIT(0x7573A1C9708029E2) /* 5 */, - W64LIT(0xB164326B922A83C3) /* 6 */, W64LIT(0x46883EEE04915870) /* 7 */, - W64LIT(0xEAACE3057103ECE6) /* 8 */, W64LIT(0xC54169B808A3535C) /* 9 */, - W64LIT(0x4CE754918DDEC47C) /* 10 */, W64LIT(0x0AA2F4DFDC0DF40C) /* 11 */, - W64LIT(0x10B76F18A74DBEFA) /* 12 */, W64LIT(0xC6CCB6235AD1AB6A) /* 13 */, - W64LIT(0x13726121572FE2FF) /* 14 */, W64LIT(0x1A488C6F199D921E) /* 15 */, - W64LIT(0x4BC9F9F4DA0007CA) /* 16 */, W64LIT(0x26F5E6F6E85241C7) /* 17 */, - W64LIT(0x859079DBEA5947B6) /* 18 */, W64LIT(0x4F1885C5C99E8C92) /* 19 */, - W64LIT(0xD78E761EA96F864B) /* 20 */, W64LIT(0x8E36428C52B5C17D) /* 21 */, - W64LIT(0x69CF6827373063C1) /* 22 */, W64LIT(0xB607C93D9BB4C56E) /* 23 */, - W64LIT(0x7D820E760E76B5EA) /* 24 */, W64LIT(0x645C9CC6F07FDC42) /* 25 */, - W64LIT(0xBF38A078243342E0) /* 26 */, W64LIT(0x5F6B343C9D2E7D04) /* 27 */, - W64LIT(0xF2C28AEB600B0EC6) /* 28 */, W64LIT(0x6C0ED85F7254BCAC) /* 29 */, - W64LIT(0x71592281A4DB4FE5) /* 30 */, W64LIT(0x1967FA69CE0FED9F) /* 31 */, - W64LIT(0xFD5293F8B96545DB) /* 32 */, W64LIT(0xC879E9D7F2A7600B) /* 33 */, - W64LIT(0x860248920193194E) /* 34 */, W64LIT(0xA4F9533B2D9CC0B3) /* 35 */, - W64LIT(0x9053836C15957613) /* 36 */, W64LIT(0xDB6DCF8AFC357BF1) /* 37 */, - W64LIT(0x18BEEA7A7A370F57) /* 38 */, W64LIT(0x037117CA50B99066) /* 39 */, - W64LIT(0x6AB30A9774424A35) /* 40 */, W64LIT(0xF4E92F02E325249B) /* 41 */, - W64LIT(0x7739DB07061CCAE1) /* 42 */, W64LIT(0xD8F3B49CECA42A05) /* 43 */, - W64LIT(0xBD56BE3F51382F73) /* 44 */, W64LIT(0x45FAED5843B0BB28) /* 45 */, - W64LIT(0x1C813D5C11BF1F83) /* 46 */, W64LIT(0x8AF0E4B6D75FA169) /* 47 */, - W64LIT(0x33EE18A487AD9999) /* 48 */, W64LIT(0x3C26E8EAB1C94410) /* 49 */, - W64LIT(0xB510102BC0A822F9) /* 50 */, W64LIT(0x141EEF310CE6123B) /* 51 */, - W64LIT(0xFC65B90059DDB154) /* 52 */, W64LIT(0xE0158640C5E0E607) /* 53 */, - W64LIT(0x884E079826C3A3CF) /* 54 */, W64LIT(0x930D0D9523C535FD) /* 55 */, - W64LIT(0x35638D754E9A2B00) /* 56 */, W64LIT(0x4085FCCF40469DD5) /* 57 */, - W64LIT(0xC4B17AD28BE23A4C) /* 58 */, W64LIT(0xCAB2F0FC6A3E6A2E) /* 59 */, - W64LIT(0x2860971A6B943FCD) /* 60 */, W64LIT(0x3DDE6EE212E30446) /* 61 */, - W64LIT(0x6222F32AE01765AE) /* 62 */, W64LIT(0x5D550BB5478308FE) /* 63 */, - W64LIT(0xA9EFA98DA0EDA22A) /* 64 */, W64LIT(0xC351A71686C40DA7) /* 65 */, - W64LIT(0x1105586D9C867C84) /* 66 */, W64LIT(0xDCFFEE85FDA22853) /* 67 */, - W64LIT(0xCCFBD0262C5EEF76) /* 68 */, W64LIT(0xBAF294CB8990D201) /* 69 */, - W64LIT(0xE69464F52AFAD975) /* 70 */, W64LIT(0x94B013AFDF133E14) /* 71 */, - W64LIT(0x06A7D1A32823C958) /* 72 */, W64LIT(0x6F95FE5130F61119) /* 73 */, - W64LIT(0xD92AB34E462C06C0) /* 74 */, W64LIT(0xED7BDE33887C71D2) /* 75 */, - W64LIT(0x79746D6E6518393E) /* 76 */, W64LIT(0x5BA419385D713329) /* 77 */, - W64LIT(0x7C1BA6B948A97564) /* 78 */, W64LIT(0x31987C197BFDAC67) /* 79 */, - W64LIT(0xDE6C23C44B053D02) /* 80 */, W64LIT(0x581C49FED002D64D) /* 81 */, - W64LIT(0xDD474D6338261571) /* 82 */, W64LIT(0xAA4546C3E473D062) /* 83 */, - W64LIT(0x928FCE349455F860) /* 84 */, W64LIT(0x48161BBACAAB94D9) /* 85 */, - W64LIT(0x63912430770E6F68) /* 86 */, W64LIT(0x6EC8A5E602C6641C) /* 87 */, - W64LIT(0x87282515337DDD2B) /* 88 */, W64LIT(0x2CDA6B42034B701B) /* 89 */, - W64LIT(0xB03D37C181CB096D) /* 90 */, W64LIT(0xE108438266C71C6F) /* 91 */, - W64LIT(0x2B3180C7EB51B255) /* 92 */, W64LIT(0xDF92B82F96C08BBC) /* 93 */, - W64LIT(0x5C68C8C0A632F3BA) /* 94 */, W64LIT(0x5504CC861C3D0556) /* 95 */, - W64LIT(0xABBFA4E55FB26B8F) /* 96 */, W64LIT(0x41848B0AB3BACEB4) /* 97 */, - W64LIT(0xB334A273AA445D32) /* 98 */, W64LIT(0xBCA696F0A85AD881) /* 99 */, - W64LIT(0x24F6EC65B528D56C) /* 100 */, W64LIT(0x0CE1512E90F4524A) /* 101 */, - W64LIT(0x4E9DD79D5506D35A) /* 102 */, W64LIT(0x258905FAC6CE9779) /* 103 */, - W64LIT(0x2019295B3E109B33) /* 104 */, W64LIT(0xF8A9478B73A054CC) /* 105 */, - W64LIT(0x2924F2F934417EB0) /* 106 */, W64LIT(0x3993357D536D1BC4) /* 107 */, - W64LIT(0x38A81AC21DB6FF8B) /* 108 */, W64LIT(0x47C4FBF17D6016BF) /* 109 */, - W64LIT(0x1E0FAADD7667E3F5) /* 110 */, W64LIT(0x7ABCFF62938BEB96) /* 111 */, - W64LIT(0xA78DAD948FC179C9) /* 112 */, W64LIT(0x8F1F98B72911E50D) /* 113 */, - W64LIT(0x61E48EAE27121A91) /* 114 */, W64LIT(0x4D62F7AD31859808) /* 115 */, - W64LIT(0xECEBA345EF5CEAEB) /* 116 */, W64LIT(0xF5CEB25EBC9684CE) /* 117 */, - W64LIT(0xF633E20CB7F76221) /* 118 */, W64LIT(0xA32CDF06AB8293E4) /* 119 */, - W64LIT(0x985A202CA5EE2CA4) /* 120 */, W64LIT(0xCF0B8447CC8A8FB1) /* 121 */, - W64LIT(0x9F765244979859A3) /* 122 */, W64LIT(0xA8D516B1A1240017) /* 123 */, - W64LIT(0x0BD7BA3EBB5DC726) /* 124 */, W64LIT(0xE54BCA55B86ADB39) /* 125 */, - W64LIT(0x1D7A3AFD6C478063) /* 126 */, W64LIT(0x519EC608E7669EDD) /* 127 */, - W64LIT(0x0E5715A2D149AA23) /* 128 */, W64LIT(0x177D4571848FF194) /* 129 */, - W64LIT(0xEEB55F3241014C22) /* 130 */, W64LIT(0x0F5E5CA13A6E2EC2) /* 131 */, - W64LIT(0x8029927B75F5C361) /* 132 */, W64LIT(0xAD139FABC3D6E436) /* 133 */, - W64LIT(0x0D5DF1A94CCF402F) /* 134 */, W64LIT(0x3E8BD948BEA5DFC8) /* 135 */, - W64LIT(0xA5A0D357BD3FF77E) /* 136 */, W64LIT(0xA2D12E251F74F645) /* 137 */, - W64LIT(0x66FD9E525E81A082) /* 138 */, W64LIT(0x2E0C90CE7F687A49) /* 139 */, - W64LIT(0xC2E8BCBEBA973BC5) /* 140 */, W64LIT(0x000001BCE509745F) /* 141 */, - W64LIT(0x423777BBE6DAB3D6) /* 142 */, W64LIT(0xD1661C7EAEF06EB5) /* 143 */, - W64LIT(0xA1781F354DAACFD8) /* 144 */, W64LIT(0x2D11284A2B16AFFC) /* 145 */, - W64LIT(0xF1FC4F67FA891D1F) /* 146 */, W64LIT(0x73ECC25DCB920ADA) /* 147 */, - W64LIT(0xAE610C22C2A12651) /* 148 */, W64LIT(0x96E0A810D356B78A) /* 149 */, - W64LIT(0x5A9A381F2FE7870F) /* 150 */, W64LIT(0xD5AD62EDE94E5530) /* 151 */, - W64LIT(0xD225E5E8368D1427) /* 152 */, W64LIT(0x65977B70C7AF4631) /* 153 */, - W64LIT(0x99F889B2DE39D74F) /* 154 */, W64LIT(0x233F30BF54E1D143) /* 155 */, - W64LIT(0x9A9675D3D9A63C97) /* 156 */, W64LIT(0x5470554FF334F9A8) /* 157 */, - W64LIT(0x166ACB744A4F5688) /* 158 */, W64LIT(0x70C74CAAB2E4AEAD) /* 159 */, - W64LIT(0xF0D091646F294D12) /* 160 */, W64LIT(0x57B82A89684031D1) /* 161 */, - W64LIT(0xEFD95A5A61BE0B6B) /* 162 */, W64LIT(0x2FBD12E969F2F29A) /* 163 */, - W64LIT(0x9BD37013FEFF9FE8) /* 164 */, W64LIT(0x3F9B0404D6085A06) /* 165 */, - W64LIT(0x4940C1F3166CFE15) /* 166 */, W64LIT(0x09542C4DCDF3DEFB) /* 167 */, - W64LIT(0xB4C5218385CD5CE3) /* 168 */, W64LIT(0xC935B7DC4462A641) /* 169 */, - W64LIT(0x3417F8A68ED3B63F) /* 170 */, W64LIT(0xB80959295B215B40) /* 171 */, - W64LIT(0xF99CDAEF3B8C8572) /* 172 */, W64LIT(0x018C0614F8FCB95D) /* 173 */, - W64LIT(0x1B14ACCD1A3ACDF3) /* 174 */, W64LIT(0x84D471F200BB732D) /* 175 */, - W64LIT(0xC1A3110E95E8DA16) /* 176 */, W64LIT(0x430A7220BF1A82B8) /* 177 */, - W64LIT(0xB77E090D39DF210E) /* 178 */, W64LIT(0x5EF4BD9F3CD05E9D) /* 179 */, - W64LIT(0x9D4FF6DA7E57A444) /* 180 */, W64LIT(0xDA1D60E183D4A5F8) /* 181 */, - W64LIT(0xB287C38417998E47) /* 182 */, W64LIT(0xFE3EDC121BB31886) /* 183 */, - W64LIT(0xC7FE3CCC980CCBEF) /* 184 */, W64LIT(0xE46FB590189BFD03) /* 185 */, - W64LIT(0x3732FD469A4C57DC) /* 186 */, W64LIT(0x7EF700A07CF1AD65) /* 187 */, - W64LIT(0x59C64468A31D8859) /* 188 */, W64LIT(0x762FB0B4D45B61F6) /* 189 */, - W64LIT(0x155BAED099047718) /* 190 */, W64LIT(0x68755E4C3D50BAA6) /* 191 */, - W64LIT(0xE9214E7F22D8B4DF) /* 192 */, W64LIT(0x2ADDBF532EAC95F4) /* 193 */, - W64LIT(0x32AE3909B4BD0109) /* 194 */, W64LIT(0x834DF537B08E3450) /* 195 */, - W64LIT(0xFA209DA84220728D) /* 196 */, W64LIT(0x9E691D9B9EFE23F7) /* 197 */, - W64LIT(0x0446D288C4AE8D7F) /* 198 */, W64LIT(0x7B4CC524E169785B) /* 199 */, - W64LIT(0x21D87F0135CA1385) /* 200 */, W64LIT(0xCEBB400F137B8AA5) /* 201 */, - W64LIT(0x272E2B66580796BE) /* 202 */, W64LIT(0x3612264125C2B0DE) /* 203 */, - W64LIT(0x057702BDAD1EFBB2) /* 204 */, W64LIT(0xD4BABB8EACF84BE9) /* 205 */, - W64LIT(0x91583139641BC67B) /* 206 */, W64LIT(0x8BDC2DE08036E024) /* 207 */, - W64LIT(0x603C8156F49F68ED) /* 208 */, W64LIT(0xF7D236F7DBEF5111) /* 209 */, - W64LIT(0x9727C4598AD21E80) /* 210 */, W64LIT(0xA08A0896670A5FD7) /* 211 */, - W64LIT(0xCB4A8F4309EBA9CB) /* 212 */, W64LIT(0x81AF564B0F7036A1) /* 213 */, - W64LIT(0xC0B99AA778199ABD) /* 214 */, W64LIT(0x959F1EC83FC8E952) /* 215 */, - W64LIT(0x8C505077794A81B9) /* 216 */, W64LIT(0x3ACAAF8F056338F0) /* 217 */, - W64LIT(0x07B43F50627A6778) /* 218 */, W64LIT(0x4A44AB49F5ECCC77) /* 219 */, - W64LIT(0x3BC3D6E4B679EE98) /* 220 */, W64LIT(0x9CC0D4D1CF14108C) /* 221 */, - W64LIT(0x4406C00B206BC8A0) /* 222 */, W64LIT(0x82A18854C8D72D89) /* 223 */, - W64LIT(0x67E366B35C3C432C) /* 224 */, W64LIT(0xB923DD61102B37F2) /* 225 */, - W64LIT(0x56AB2779D884271D) /* 226 */, W64LIT(0xBE83E1B0FF1525AF) /* 227 */, - W64LIT(0xFB7C65D4217E49A9) /* 228 */, W64LIT(0x6BDBE0E76D48E7D4) /* 229 */, - W64LIT(0x08DF828745D9179E) /* 230 */, W64LIT(0x22EA6A9ADD53BD34) /* 231 */, - W64LIT(0xE36E141C5622200A) /* 232 */, W64LIT(0x7F805D1B8CB750EE) /* 233 */, - W64LIT(0xAFE5C7A59F58E837) /* 234 */, W64LIT(0xE27F996A4FB1C23C) /* 235 */, - W64LIT(0xD3867DFB0775F0D0) /* 236 */, W64LIT(0xD0E673DE6E88891A) /* 237 */, - W64LIT(0x123AEB9EAFB86C25) /* 238 */, W64LIT(0x30F1D5D5C145B895) /* 239 */, - W64LIT(0xBB434A2DEE7269E7) /* 240 */, W64LIT(0x78CB67ECF931FA38) /* 241 */, - W64LIT(0xF33B0372323BBF9C) /* 242 */, W64LIT(0x52D66336FB279C74) /* 243 */, - W64LIT(0x505F33AC0AFB4EAA) /* 244 */, W64LIT(0xE8A5CD99A2CCE187) /* 245 */, - W64LIT(0x534974801E2D30BB) /* 246 */, W64LIT(0x8D2D5711D5876D90) /* 247 */, - W64LIT(0x1F1A412891BC038E) /* 248 */, W64LIT(0xD6E2E71D82E56648) /* 249 */, - W64LIT(0x74036C3A497732B7) /* 250 */, W64LIT(0x89B67ED96361F5AB) /* 251 */, - W64LIT(0xFFED95D8F1EA02A2) /* 252 */, W64LIT(0xE72B3BD61464D43D) /* 253 */, - W64LIT(0xA6300F170BDC4820) /* 254 */, W64LIT(0xEBC18760ED78A77A) /* 255 */, - W64LIT(0xE6A6BE5A05A12138) /* 256 */, W64LIT(0xB5A122A5B4F87C98) /* 257 */, - W64LIT(0x563C6089140B6990) /* 258 */, W64LIT(0x4C46CB2E391F5DD5) /* 259 */, - W64LIT(0xD932ADDBC9B79434) /* 260 */, W64LIT(0x08EA70E42015AFF5) /* 261 */, - W64LIT(0xD765A6673E478CF1) /* 262 */, W64LIT(0xC4FB757EAB278D99) /* 263 */, - W64LIT(0xDF11C6862D6E0692) /* 264 */, W64LIT(0xDDEB84F10D7F3B16) /* 265 */, - W64LIT(0x6F2EF604A665EA04) /* 266 */, W64LIT(0x4A8E0F0FF0E0DFB3) /* 267 */, - W64LIT(0xA5EDEEF83DBCBA51) /* 268 */, W64LIT(0xFC4F0A2A0EA4371E) /* 269 */, - W64LIT(0xE83E1DA85CB38429) /* 270 */, W64LIT(0xDC8FF882BA1B1CE2) /* 271 */, - W64LIT(0xCD45505E8353E80D) /* 272 */, W64LIT(0x18D19A00D4DB0717) /* 273 */, - W64LIT(0x34A0CFEDA5F38101) /* 274 */, W64LIT(0x0BE77E518887CAF2) /* 275 */, - W64LIT(0x1E341438B3C45136) /* 276 */, W64LIT(0xE05797F49089CCF9) /* 277 */, - W64LIT(0xFFD23F9DF2591D14) /* 278 */, W64LIT(0x543DDA228595C5CD) /* 279 */, - W64LIT(0x661F81FD99052A33) /* 280 */, W64LIT(0x8736E641DB0F7B76) /* 281 */, - W64LIT(0x15227725418E5307) /* 282 */, W64LIT(0xE25F7F46162EB2FA) /* 283 */, - W64LIT(0x48A8B2126C13D9FE) /* 284 */, W64LIT(0xAFDC541792E76EEA) /* 285 */, - W64LIT(0x03D912BFC6D1898F) /* 286 */, W64LIT(0x31B1AAFA1B83F51B) /* 287 */, - W64LIT(0xF1AC2796E42AB7D9) /* 288 */, W64LIT(0x40A3A7D7FCD2EBAC) /* 289 */, - W64LIT(0x1056136D0AFBBCC5) /* 290 */, W64LIT(0x7889E1DD9A6D0C85) /* 291 */, - W64LIT(0xD33525782A7974AA) /* 292 */, W64LIT(0xA7E25D09078AC09B) /* 293 */, - W64LIT(0xBD4138B3EAC6EDD0) /* 294 */, W64LIT(0x920ABFBE71EB9E70) /* 295 */, - W64LIT(0xA2A5D0F54FC2625C) /* 296 */, W64LIT(0xC054E36B0B1290A3) /* 297 */, - W64LIT(0xF6DD59FF62FE932B) /* 298 */, W64LIT(0x3537354511A8AC7D) /* 299 */, - W64LIT(0xCA845E9172FADCD4) /* 300 */, W64LIT(0x84F82B60329D20DC) /* 301 */, - W64LIT(0x79C62CE1CD672F18) /* 302 */, W64LIT(0x8B09A2ADD124642C) /* 303 */, - W64LIT(0xD0C1E96A19D9E726) /* 304 */, W64LIT(0x5A786A9B4BA9500C) /* 305 */, - W64LIT(0x0E020336634C43F3) /* 306 */, W64LIT(0xC17B474AEB66D822) /* 307 */, - W64LIT(0x6A731AE3EC9BAAC2) /* 308 */, W64LIT(0x8226667AE0840258) /* 309 */, - W64LIT(0x67D4567691CAECA5) /* 310 */, W64LIT(0x1D94155C4875ADB5) /* 311 */, - W64LIT(0x6D00FD985B813FDF) /* 312 */, W64LIT(0x51286EFCB774CD06) /* 313 */, - W64LIT(0x5E8834471FA744AF) /* 314 */, W64LIT(0xF72CA0AEE761AE2E) /* 315 */, - W64LIT(0xBE40E4CDAEE8E09A) /* 316 */, W64LIT(0xE9970BBB5118F665) /* 317 */, - W64LIT(0x726E4BEB33DF1964) /* 318 */, W64LIT(0x703B000729199762) /* 319 */, - W64LIT(0x4631D816F5EF30A7) /* 320 */, W64LIT(0xB880B5B51504A6BE) /* 321 */, - W64LIT(0x641793C37ED84B6C) /* 322 */, W64LIT(0x7B21ED77F6E97D96) /* 323 */, - W64LIT(0x776306312EF96B73) /* 324 */, W64LIT(0xAE528948E86FF3F4) /* 325 */, - W64LIT(0x53DBD7F286A3F8F8) /* 326 */, W64LIT(0x16CADCE74CFC1063) /* 327 */, - W64LIT(0x005C19BDFA52C6DD) /* 328 */, W64LIT(0x68868F5D64D46AD3) /* 329 */, - W64LIT(0x3A9D512CCF1E186A) /* 330 */, W64LIT(0x367E62C2385660AE) /* 331 */, - W64LIT(0xE359E7EA77DCB1D7) /* 332 */, W64LIT(0x526C0773749ABE6E) /* 333 */, - W64LIT(0x735AE5F9D09F734B) /* 334 */, W64LIT(0x493FC7CC8A558BA8) /* 335 */, - W64LIT(0xB0B9C1533041AB45) /* 336 */, W64LIT(0x321958BA470A59BD) /* 337 */, - W64LIT(0x852DB00B5F46C393) /* 338 */, W64LIT(0x91209B2BD336B0E5) /* 339 */, - W64LIT(0x6E604F7D659EF19F) /* 340 */, W64LIT(0xB99A8AE2782CCB24) /* 341 */, - W64LIT(0xCCF52AB6C814C4C7) /* 342 */, W64LIT(0x4727D9AFBE11727B) /* 343 */, - W64LIT(0x7E950D0C0121B34D) /* 344 */, W64LIT(0x756F435670AD471F) /* 345 */, - W64LIT(0xF5ADD442615A6849) /* 346 */, W64LIT(0x4E87E09980B9957A) /* 347 */, - W64LIT(0x2ACFA1DF50AEE355) /* 348 */, W64LIT(0xD898263AFD2FD556) /* 349 */, - W64LIT(0xC8F4924DD80C8FD6) /* 350 */, W64LIT(0xCF99CA3D754A173A) /* 351 */, - W64LIT(0xFE477BACAF91BF3C) /* 352 */, W64LIT(0xED5371F6D690C12D) /* 353 */, - W64LIT(0x831A5C285E687094) /* 354 */, W64LIT(0xC5D3C90A3708A0A4) /* 355 */, - W64LIT(0x0F7F903717D06580) /* 356 */, W64LIT(0x19F9BB13B8FDF27F) /* 357 */, - W64LIT(0xB1BD6F1B4D502843) /* 358 */, W64LIT(0x1C761BA38FFF4012) /* 359 */, - W64LIT(0x0D1530C4E2E21F3B) /* 360 */, W64LIT(0x8943CE69A7372C8A) /* 361 */, - W64LIT(0xE5184E11FEB5CE66) /* 362 */, W64LIT(0x618BDB80BD736621) /* 363 */, - W64LIT(0x7D29BAD68B574D0B) /* 364 */, W64LIT(0x81BB613E25E6FE5B) /* 365 */, - W64LIT(0x071C9C10BC07913F) /* 366 */, W64LIT(0xC7BEEB7909AC2D97) /* 367 */, - W64LIT(0xC3E58D353BC5D757) /* 368 */, W64LIT(0xEB017892F38F61E8) /* 369 */, - W64LIT(0xD4EFFB9C9B1CC21A) /* 370 */, W64LIT(0x99727D26F494F7AB) /* 371 */, - W64LIT(0xA3E063A2956B3E03) /* 372 */, W64LIT(0x9D4A8B9A4AA09C30) /* 373 */, - W64LIT(0x3F6AB7D500090FB4) /* 374 */, W64LIT(0x9CC0F2A057268AC0) /* 375 */, - W64LIT(0x3DEE9D2DEDBF42D1) /* 376 */, W64LIT(0x330F49C87960A972) /* 377 */, - W64LIT(0xC6B2720287421B41) /* 378 */, W64LIT(0x0AC59EC07C00369C) /* 379 */, - W64LIT(0xEF4EAC49CB353425) /* 380 */, W64LIT(0xF450244EEF0129D8) /* 381 */, - W64LIT(0x8ACC46E5CAF4DEB6) /* 382 */, W64LIT(0x2FFEAB63989263F7) /* 383 */, - W64LIT(0x8F7CB9FE5D7A4578) /* 384 */, W64LIT(0x5BD8F7644E634635) /* 385 */, - W64LIT(0x427A7315BF2DC900) /* 386 */, W64LIT(0x17D0C4AA2125261C) /* 387 */, - W64LIT(0x3992486C93518E50) /* 388 */, W64LIT(0xB4CBFEE0A2D7D4C3) /* 389 */, - W64LIT(0x7C75D6202C5DDD8D) /* 390 */, W64LIT(0xDBC295D8E35B6C61) /* 391 */, - W64LIT(0x60B369D302032B19) /* 392 */, W64LIT(0xCE42685FDCE44132) /* 393 */, - W64LIT(0x06F3DDB9DDF65610) /* 394 */, W64LIT(0x8EA4D21DB5E148F0) /* 395 */, - W64LIT(0x20B0FCE62FCD496F) /* 396 */, W64LIT(0x2C1B912358B0EE31) /* 397 */, - W64LIT(0xB28317B818F5A308) /* 398 */, W64LIT(0xA89C1E189CA6D2CF) /* 399 */, - W64LIT(0x0C6B18576AAADBC8) /* 400 */, W64LIT(0xB65DEAA91299FAE3) /* 401 */, - W64LIT(0xFB2B794B7F1027E7) /* 402 */, W64LIT(0x04E4317F443B5BEB) /* 403 */, - W64LIT(0x4B852D325939D0A6) /* 404 */, W64LIT(0xD5AE6BEEFB207FFC) /* 405 */, - W64LIT(0x309682B281C7D374) /* 406 */, W64LIT(0xBAE309A194C3B475) /* 407 */, - W64LIT(0x8CC3F97B13B49F05) /* 408 */, W64LIT(0x98A9422FF8293967) /* 409 */, - W64LIT(0x244B16B01076FF7C) /* 410 */, W64LIT(0xF8BF571C663D67EE) /* 411 */, - W64LIT(0x1F0D6758EEE30DA1) /* 412 */, W64LIT(0xC9B611D97ADEB9B7) /* 413 */, - W64LIT(0xB7AFD5887B6C57A2) /* 414 */, W64LIT(0x6290AE846B984FE1) /* 415 */, - W64LIT(0x94DF4CDEACC1A5FD) /* 416 */, W64LIT(0x058A5BD1C5483AFF) /* 417 */, - W64LIT(0x63166CC142BA3C37) /* 418 */, W64LIT(0x8DB8526EB2F76F40) /* 419 */, - W64LIT(0xE10880036F0D6D4E) /* 420 */, W64LIT(0x9E0523C9971D311D) /* 421 */, - W64LIT(0x45EC2824CC7CD691) /* 422 */, W64LIT(0x575B8359E62382C9) /* 423 */, - W64LIT(0xFA9E400DC4889995) /* 424 */, W64LIT(0xD1823ECB45721568) /* 425 */, - W64LIT(0xDAFD983B8206082F) /* 426 */, W64LIT(0xAA7D29082386A8CB) /* 427 */, - W64LIT(0x269FCD4403B87588) /* 428 */, W64LIT(0x1B91F5F728BDD1E0) /* 429 */, - W64LIT(0xE4669F39040201F6) /* 430 */, W64LIT(0x7A1D7C218CF04ADE) /* 431 */, - W64LIT(0x65623C29D79CE5CE) /* 432 */, W64LIT(0x2368449096C00BB1) /* 433 */, - W64LIT(0xAB9BF1879DA503BA) /* 434 */, W64LIT(0xBC23ECB1A458058E) /* 435 */, - W64LIT(0x9A58DF01BB401ECC) /* 436 */, W64LIT(0xA070E868A85F143D) /* 437 */, - W64LIT(0x4FF188307DF2239E) /* 438 */, W64LIT(0x14D565B41A641183) /* 439 */, - W64LIT(0xEE13337452701602) /* 440 */, W64LIT(0x950E3DCF3F285E09) /* 441 */, - W64LIT(0x59930254B9C80953) /* 442 */, W64LIT(0x3BF299408930DA6D) /* 443 */, - W64LIT(0xA955943F53691387) /* 444 */, W64LIT(0xA15EDECAA9CB8784) /* 445 */, - W64LIT(0x29142127352BE9A0) /* 446 */, W64LIT(0x76F0371FFF4E7AFB) /* 447 */, - W64LIT(0x0239F450274F2228) /* 448 */, W64LIT(0xBB073AF01D5E868B) /* 449 */, - W64LIT(0xBFC80571C10E96C1) /* 450 */, W64LIT(0xD267088568222E23) /* 451 */, - W64LIT(0x9671A3D48E80B5B0) /* 452 */, W64LIT(0x55B5D38AE193BB81) /* 453 */, - W64LIT(0x693AE2D0A18B04B8) /* 454 */, W64LIT(0x5C48B4ECADD5335F) /* 455 */, - W64LIT(0xFD743B194916A1CA) /* 456 */, W64LIT(0x2577018134BE98C4) /* 457 */, - W64LIT(0xE77987E83C54A4AD) /* 458 */, W64LIT(0x28E11014DA33E1B9) /* 459 */, - W64LIT(0x270CC59E226AA213) /* 460 */, W64LIT(0x71495F756D1A5F60) /* 461 */, - W64LIT(0x9BE853FB60AFEF77) /* 462 */, W64LIT(0xADC786A7F7443DBF) /* 463 */, - W64LIT(0x0904456173B29A82) /* 464 */, W64LIT(0x58BC7A66C232BD5E) /* 465 */, - W64LIT(0xF306558C673AC8B2) /* 466 */, W64LIT(0x41F639C6B6C9772A) /* 467 */, - W64LIT(0x216DEFE99FDA35DA) /* 468 */, W64LIT(0x11640CC71C7BE615) /* 469 */, - W64LIT(0x93C43694565C5527) /* 470 */, W64LIT(0xEA038E6246777839) /* 471 */, - W64LIT(0xF9ABF3CE5A3E2469) /* 472 */, W64LIT(0x741E768D0FD312D2) /* 473 */, - W64LIT(0x0144B883CED652C6) /* 474 */, W64LIT(0xC20B5A5BA33F8552) /* 475 */, - W64LIT(0x1AE69633C3435A9D) /* 476 */, W64LIT(0x97A28CA4088CFDEC) /* 477 */, - W64LIT(0x8824A43C1E96F420) /* 478 */, W64LIT(0x37612FA66EEEA746) /* 479 */, - W64LIT(0x6B4CB165F9CF0E5A) /* 480 */, W64LIT(0x43AA1C06A0ABFB4A) /* 481 */, - W64LIT(0x7F4DC26FF162796B) /* 482 */, W64LIT(0x6CBACC8E54ED9B0F) /* 483 */, - W64LIT(0xA6B7FFEFD2BB253E) /* 484 */, W64LIT(0x2E25BC95B0A29D4F) /* 485 */, - W64LIT(0x86D6A58BDEF1388C) /* 486 */, W64LIT(0xDED74AC576B6F054) /* 487 */, - W64LIT(0x8030BDBC2B45805D) /* 488 */, W64LIT(0x3C81AF70E94D9289) /* 489 */, - W64LIT(0x3EFF6DDA9E3100DB) /* 490 */, W64LIT(0xB38DC39FDFCC8847) /* 491 */, - W64LIT(0x123885528D17B87E) /* 492 */, W64LIT(0xF2DA0ED240B1B642) /* 493 */, - W64LIT(0x44CEFADCD54BF9A9) /* 494 */, W64LIT(0x1312200E433C7EE6) /* 495 */, - W64LIT(0x9FFCC84F3A78C748) /* 496 */, W64LIT(0xF0CD1F72248576BB) /* 497 */, - W64LIT(0xEC6974053638CFE4) /* 498 */, W64LIT(0x2BA7B67C0CEC4E4C) /* 499 */, - W64LIT(0xAC2F4DF3E5CE32ED) /* 500 */, W64LIT(0xCB33D14326EA4C11) /* 501 */, - W64LIT(0xA4E9044CC77E58BC) /* 502 */, W64LIT(0x5F513293D934FCEF) /* 503 */, - W64LIT(0x5DC9645506E55444) /* 504 */, W64LIT(0x50DE418F317DE40A) /* 505 */, - W64LIT(0x388CB31A69DDE259) /* 506 */, W64LIT(0x2DB4A83455820A86) /* 507 */, - W64LIT(0x9010A91E84711AE9) /* 508 */, W64LIT(0x4DF7F0B7B1498371) /* 509 */, - W64LIT(0xD62A2EABC0977179) /* 510 */, W64LIT(0x22FAC097AA8D5C0E) /* 511 */, - W64LIT(0xF49FCC2FF1DAF39B) /* 512 */, W64LIT(0x487FD5C66FF29281) /* 513 */, - W64LIT(0xE8A30667FCDCA83F) /* 514 */, W64LIT(0x2C9B4BE3D2FCCE63) /* 515 */, - W64LIT(0xDA3FF74B93FBBBC2) /* 516 */, W64LIT(0x2FA165D2FE70BA66) /* 517 */, - W64LIT(0xA103E279970E93D4) /* 518 */, W64LIT(0xBECDEC77B0E45E71) /* 519 */, - W64LIT(0xCFB41E723985E497) /* 520 */, W64LIT(0xB70AAA025EF75017) /* 521 */, - W64LIT(0xD42309F03840B8E0) /* 522 */, W64LIT(0x8EFC1AD035898579) /* 523 */, - W64LIT(0x96C6920BE2B2ABC5) /* 524 */, W64LIT(0x66AF4163375A9172) /* 525 */, - W64LIT(0x2174ABDCCA7127FB) /* 526 */, W64LIT(0xB33CCEA64A72FF41) /* 527 */, - W64LIT(0xF04A4933083066A5) /* 528 */, W64LIT(0x8D970ACDD7289AF5) /* 529 */, - W64LIT(0x8F96E8E031C8C25E) /* 530 */, W64LIT(0xF3FEC02276875D47) /* 531 */, - W64LIT(0xEC7BF310056190DD) /* 532 */, W64LIT(0xF5ADB0AEBB0F1491) /* 533 */, - W64LIT(0x9B50F8850FD58892) /* 534 */, W64LIT(0x4975488358B74DE8) /* 535 */, - W64LIT(0xA3354FF691531C61) /* 536 */, W64LIT(0x0702BBE481D2C6EE) /* 537 */, - W64LIT(0x89FB24057DEDED98) /* 538 */, W64LIT(0xAC3075138596E902) /* 539 */, - W64LIT(0x1D2D3580172772ED) /* 540 */, W64LIT(0xEB738FC28E6BC30D) /* 541 */, - W64LIT(0x5854EF8F63044326) /* 542 */, W64LIT(0x9E5C52325ADD3BBE) /* 543 */, - W64LIT(0x90AA53CF325C4623) /* 544 */, W64LIT(0xC1D24D51349DD067) /* 545 */, - W64LIT(0x2051CFEEA69EA624) /* 546 */, W64LIT(0x13220F0A862E7E4F) /* 547 */, - W64LIT(0xCE39399404E04864) /* 548 */, W64LIT(0xD9C42CA47086FCB7) /* 549 */, - W64LIT(0x685AD2238A03E7CC) /* 550 */, W64LIT(0x066484B2AB2FF1DB) /* 551 */, - W64LIT(0xFE9D5D70EFBF79EC) /* 552 */, W64LIT(0x5B13B9DD9C481854) /* 553 */, - W64LIT(0x15F0D475ED1509AD) /* 554 */, W64LIT(0x0BEBCD060EC79851) /* 555 */, - W64LIT(0xD58C6791183AB7F8) /* 556 */, W64LIT(0xD1187C5052F3EEE4) /* 557 */, - W64LIT(0xC95D1192E54E82FF) /* 558 */, W64LIT(0x86EEA14CB9AC6CA2) /* 559 */, - W64LIT(0x3485BEB153677D5D) /* 560 */, W64LIT(0xDD191D781F8C492A) /* 561 */, - W64LIT(0xF60866BAA784EBF9) /* 562 */, W64LIT(0x518F643BA2D08C74) /* 563 */, - W64LIT(0x8852E956E1087C22) /* 564 */, W64LIT(0xA768CB8DC410AE8D) /* 565 */, - W64LIT(0x38047726BFEC8E1A) /* 566 */, W64LIT(0xA67738B4CD3B45AA) /* 567 */, - W64LIT(0xAD16691CEC0DDE19) /* 568 */, W64LIT(0xC6D4319380462E07) /* 569 */, - W64LIT(0xC5A5876D0BA61938) /* 570 */, W64LIT(0x16B9FA1FA58FD840) /* 571 */, - W64LIT(0x188AB1173CA74F18) /* 572 */, W64LIT(0xABDA2F98C99C021F) /* 573 */, - W64LIT(0x3E0580AB134AE816) /* 574 */, W64LIT(0x5F3B05B773645ABB) /* 575 */, - W64LIT(0x2501A2BE5575F2F6) /* 576 */, W64LIT(0x1B2F74004E7E8BA9) /* 577 */, - W64LIT(0x1CD7580371E8D953) /* 578 */, W64LIT(0x7F6ED89562764E30) /* 579 */, - W64LIT(0xB15926FF596F003D) /* 580 */, W64LIT(0x9F65293DA8C5D6B9) /* 581 */, - W64LIT(0x6ECEF04DD690F84C) /* 582 */, W64LIT(0x4782275FFF33AF88) /* 583 */, - W64LIT(0xE41433083F820801) /* 584 */, W64LIT(0xFD0DFE409A1AF9B5) /* 585 */, - W64LIT(0x4325A3342CDB396B) /* 586 */, W64LIT(0x8AE77E62B301B252) /* 587 */, - W64LIT(0xC36F9E9F6655615A) /* 588 */, W64LIT(0x85455A2D92D32C09) /* 589 */, - W64LIT(0xF2C7DEA949477485) /* 590 */, W64LIT(0x63CFB4C133A39EBA) /* 591 */, - W64LIT(0x83B040CC6EBC5462) /* 592 */, W64LIT(0x3B9454C8FDB326B0) /* 593 */, - W64LIT(0x56F56A9E87FFD78C) /* 594 */, W64LIT(0x2DC2940D99F42BC6) /* 595 */, - W64LIT(0x98F7DF096B096E2D) /* 596 */, W64LIT(0x19A6E01E3AD852BF) /* 597 */, - W64LIT(0x42A99CCBDBD4B40B) /* 598 */, W64LIT(0xA59998AF45E9C559) /* 599 */, - W64LIT(0x366295E807D93186) /* 600 */, W64LIT(0x6B48181BFAA1F773) /* 601 */, - W64LIT(0x1FEC57E2157A0A1D) /* 602 */, W64LIT(0x4667446AF6201AD5) /* 603 */, - W64LIT(0xE615EBCACFB0F075) /* 604 */, W64LIT(0xB8F31F4F68290778) /* 605 */, - W64LIT(0x22713ED6CE22D11E) /* 606 */, W64LIT(0x3057C1A72EC3C93B) /* 607 */, - W64LIT(0xCB46ACC37C3F1F2F) /* 608 */, W64LIT(0xDBB893FD02AAF50E) /* 609 */, - W64LIT(0x331FD92E600B9FCF) /* 610 */, W64LIT(0xA498F96148EA3AD6) /* 611 */, - W64LIT(0xA8D8426E8B6A83EA) /* 612 */, W64LIT(0xA089B274B7735CDC) /* 613 */, - W64LIT(0x87F6B3731E524A11) /* 614 */, W64LIT(0x118808E5CBC96749) /* 615 */, - W64LIT(0x9906E4C7B19BD394) /* 616 */, W64LIT(0xAFED7F7E9B24A20C) /* 617 */, - W64LIT(0x6509EADEEB3644A7) /* 618 */, W64LIT(0x6C1EF1D3E8EF0EDE) /* 619 */, - W64LIT(0xB9C97D43E9798FB4) /* 620 */, W64LIT(0xA2F2D784740C28A3) /* 621 */, - W64LIT(0x7B8496476197566F) /* 622 */, W64LIT(0x7A5BE3E6B65F069D) /* 623 */, - W64LIT(0xF96330ED78BE6F10) /* 624 */, W64LIT(0xEEE60DE77A076A15) /* 625 */, - W64LIT(0x2B4BEE4AA08B9BD0) /* 626 */, W64LIT(0x6A56A63EC7B8894E) /* 627 */, - W64LIT(0x02121359BA34FEF4) /* 628 */, W64LIT(0x4CBF99F8283703FC) /* 629 */, - W64LIT(0x398071350CAF30C8) /* 630 */, W64LIT(0xD0A77A89F017687A) /* 631 */, - W64LIT(0xF1C1A9EB9E423569) /* 632 */, W64LIT(0x8C7976282DEE8199) /* 633 */, - W64LIT(0x5D1737A5DD1F7ABD) /* 634 */, W64LIT(0x4F53433C09A9FA80) /* 635 */, - W64LIT(0xFA8B0C53DF7CA1D9) /* 636 */, W64LIT(0x3FD9DCBC886CCB77) /* 637 */, - W64LIT(0xC040917CA91B4720) /* 638 */, W64LIT(0x7DD00142F9D1DCDF) /* 639 */, - W64LIT(0x8476FC1D4F387B58) /* 640 */, W64LIT(0x23F8E7C5F3316503) /* 641 */, - W64LIT(0x032A2244E7E37339) /* 642 */, W64LIT(0x5C87A5D750F5A74B) /* 643 */, - W64LIT(0x082B4CC43698992E) /* 644 */, W64LIT(0xDF917BECB858F63C) /* 645 */, - W64LIT(0x3270B8FC5BF86DDA) /* 646 */, W64LIT(0x10AE72BB29B5DD76) /* 647 */, - W64LIT(0x576AC94E7700362B) /* 648 */, W64LIT(0x1AD112DAC61EFB8F) /* 649 */, - W64LIT(0x691BC30EC5FAA427) /* 650 */, W64LIT(0xFF246311CC327143) /* 651 */, - W64LIT(0x3142368E30E53206) /* 652 */, W64LIT(0x71380E31E02CA396) /* 653 */, - W64LIT(0x958D5C960AAD76F1) /* 654 */, W64LIT(0xF8D6F430C16DA536) /* 655 */, - W64LIT(0xC8FFD13F1BE7E1D2) /* 656 */, W64LIT(0x7578AE66004DDBE1) /* 657 */, - W64LIT(0x05833F01067BE646) /* 658 */, W64LIT(0xBB34B5AD3BFE586D) /* 659 */, - W64LIT(0x095F34C9A12B97F0) /* 660 */, W64LIT(0x247AB64525D60CA8) /* 661 */, - W64LIT(0xDCDBC6F3017477D1) /* 662 */, W64LIT(0x4A2E14D4DECAD24D) /* 663 */, - W64LIT(0xBDB5E6D9BE0A1EEB) /* 664 */, W64LIT(0x2A7E70F7794301AB) /* 665 */, - W64LIT(0xDEF42D8A270540FD) /* 666 */, W64LIT(0x01078EC0A34C22C1) /* 667 */, - W64LIT(0xE5DE511AF4C16387) /* 668 */, W64LIT(0x7EBB3A52BD9A330A) /* 669 */, - W64LIT(0x77697857AA7D6435) /* 670 */, W64LIT(0x004E831603AE4C32) /* 671 */, - W64LIT(0xE7A21020AD78E312) /* 672 */, W64LIT(0x9D41A70C6AB420F2) /* 673 */, - W64LIT(0x28E06C18EA1141E6) /* 674 */, W64LIT(0xD2B28CBD984F6B28) /* 675 */, - W64LIT(0x26B75F6C446E9D83) /* 676 */, W64LIT(0xBA47568C4D418D7F) /* 677 */, - W64LIT(0xD80BADBFE6183D8E) /* 678 */, W64LIT(0x0E206D7F5F166044) /* 679 */, - W64LIT(0xE258A43911CBCA3E) /* 680 */, W64LIT(0x723A1746B21DC0BC) /* 681 */, - W64LIT(0xC7CAA854F5D7CDD3) /* 682 */, W64LIT(0x7CAC32883D261D9C) /* 683 */, - W64LIT(0x7690C26423BA942C) /* 684 */, W64LIT(0x17E55524478042B8) /* 685 */, - W64LIT(0xE0BE477656A2389F) /* 686 */, W64LIT(0x4D289B5E67AB2DA0) /* 687 */, - W64LIT(0x44862B9C8FBBFD31) /* 688 */, W64LIT(0xB47CC8049D141365) /* 689 */, - W64LIT(0x822C1B362B91C793) /* 690 */, W64LIT(0x4EB14655FB13DFD8) /* 691 */, - W64LIT(0x1ECBBA0714E2A97B) /* 692 */, W64LIT(0x6143459D5CDE5F14) /* 693 */, - W64LIT(0x53A8FBF1D5F0AC89) /* 694 */, W64LIT(0x97EA04D81C5E5B00) /* 695 */, - W64LIT(0x622181A8D4FDB3F3) /* 696 */, W64LIT(0xE9BCD341572A1208) /* 697 */, - W64LIT(0x1411258643CCE58A) /* 698 */, W64LIT(0x9144C5FEA4C6E0A4) /* 699 */, - W64LIT(0x0D33D06565CF620F) /* 700 */, W64LIT(0x54A48D489F219CA1) /* 701 */, - W64LIT(0xC43E5EAC6D63C821) /* 702 */, W64LIT(0xA9728B3A72770DAF) /* 703 */, - W64LIT(0xD7934E7B20DF87EF) /* 704 */, W64LIT(0xE35503B61A3E86E5) /* 705 */, - W64LIT(0xCAE321FBC819D504) /* 706 */, W64LIT(0x129A50B3AC60BFA6) /* 707 */, - W64LIT(0xCD5E68EA7E9FB6C3) /* 708 */, W64LIT(0xB01C90199483B1C7) /* 709 */, - W64LIT(0x3DE93CD5C295376C) /* 710 */, W64LIT(0xAED52EDF2AB9AD13) /* 711 */, - W64LIT(0x2E60F512C0A07884) /* 712 */, W64LIT(0xBC3D86A3E36210C9) /* 713 */, - W64LIT(0x35269D9B163951CE) /* 714 */, W64LIT(0x0C7D6E2AD0CDB5FA) /* 715 */, - W64LIT(0x59E86297D87F5733) /* 716 */, W64LIT(0x298EF221898DB0E7) /* 717 */, - W64LIT(0x55000029D1A5AA7E) /* 718 */, W64LIT(0x8BC08AE1B5061B45) /* 719 */, - W64LIT(0xC2C31C2B6C92703A) /* 720 */, W64LIT(0x94CC596BAF25EF42) /* 721 */, - W64LIT(0x0A1D73DB22540456) /* 722 */, W64LIT(0x04B6A0F9D9C4179A) /* 723 */, - W64LIT(0xEFFDAFA2AE3D3C60) /* 724 */, W64LIT(0xF7C8075BB49496C4) /* 725 */, - W64LIT(0x9CC5C7141D1CD4E3) /* 726 */, W64LIT(0x78BD1638218E5534) /* 727 */, - W64LIT(0xB2F11568F850246A) /* 728 */, W64LIT(0xEDFABCFA9502BC29) /* 729 */, - W64LIT(0x796CE5F2DA23051B) /* 730 */, W64LIT(0xAAE128B0DC93537C) /* 731 */, - W64LIT(0x3A493DA0EE4B29AE) /* 732 */, W64LIT(0xB5DF6B2C416895D7) /* 733 */, - W64LIT(0xFCABBD25122D7F37) /* 734 */, W64LIT(0x70810B58105DC4B1) /* 735 */, - W64LIT(0xE10FDD37F7882A90) /* 736 */, W64LIT(0x524DCAB5518A3F5C) /* 737 */, - W64LIT(0x3C9E85878451255B) /* 738 */, W64LIT(0x4029828119BD34E2) /* 739 */, - W64LIT(0x74A05B6F5D3CECCB) /* 740 */, W64LIT(0xB610021542E13ECA) /* 741 */, - W64LIT(0x0FF979D12F59E2AC) /* 742 */, W64LIT(0x6037DA27E4F9CC50) /* 743 */, - W64LIT(0x5E92975A0DF1847D) /* 744 */, W64LIT(0xD66DE190D3E623FE) /* 745 */, - W64LIT(0x5032D6B87B568048) /* 746 */, W64LIT(0x9A36B7CE8235216E) /* 747 */, - W64LIT(0x80272A7A24F64B4A) /* 748 */, W64LIT(0x93EFED8B8C6916F7) /* 749 */, - W64LIT(0x37DDBFF44CCE1555) /* 750 */, W64LIT(0x4B95DB5D4B99BD25) /* 751 */, - W64LIT(0x92D3FDA169812FC0) /* 752 */, W64LIT(0xFB1A4A9A90660BB6) /* 753 */, - W64LIT(0x730C196946A4B9B2) /* 754 */, W64LIT(0x81E289AA7F49DA68) /* 755 */, - W64LIT(0x64669A0F83B1A05F) /* 756 */, W64LIT(0x27B3FF7D9644F48B) /* 757 */, - W64LIT(0xCC6B615C8DB675B3) /* 758 */, W64LIT(0x674F20B9BCEBBE95) /* 759 */, - W64LIT(0x6F31238275655982) /* 760 */, W64LIT(0x5AE488713E45CF05) /* 761 */, - W64LIT(0xBF619F9954C21157) /* 762 */, W64LIT(0xEABAC46040A8EAE9) /* 763 */, - W64LIT(0x454C6FE9F2C0C1CD) /* 764 */, W64LIT(0x419CF6496412691C) /* 765 */, - W64LIT(0xD3DC3BEF265B0F70) /* 766 */, W64LIT(0x6D0E60F5C3578A9E) /* 767 */, - W64LIT(0x5B0E608526323C55) /* 768 */, W64LIT(0x1A46C1A9FA1B59F5) /* 769 */, - W64LIT(0xA9E245A17C4C8FFA) /* 770 */, W64LIT(0x65CA5159DB2955D7) /* 771 */, - W64LIT(0x05DB0A76CE35AFC2) /* 772 */, W64LIT(0x81EAC77EA9113D45) /* 773 */, - W64LIT(0x528EF88AB6AC0A0D) /* 774 */, W64LIT(0xA09EA253597BE3FF) /* 775 */, - W64LIT(0x430DDFB3AC48CD56) /* 776 */, W64LIT(0xC4B3A67AF45CE46F) /* 777 */, - W64LIT(0x4ECECFD8FBE2D05E) /* 778 */, W64LIT(0x3EF56F10B39935F0) /* 779 */, - W64LIT(0x0B22D6829CD619C6) /* 780 */, W64LIT(0x17FD460A74DF2069) /* 781 */, - W64LIT(0x6CF8CC8E8510ED40) /* 782 */, W64LIT(0xD6C824BF3A6ECAA7) /* 783 */, - W64LIT(0x61243D581A817049) /* 784 */, W64LIT(0x048BACB6BBC163A2) /* 785 */, - W64LIT(0xD9A38AC27D44CC32) /* 786 */, W64LIT(0x7FDDFF5BAAF410AB) /* 787 */, - W64LIT(0xAD6D495AA804824B) /* 788 */, W64LIT(0xE1A6A74F2D8C9F94) /* 789 */, - W64LIT(0xD4F7851235DEE8E3) /* 790 */, W64LIT(0xFD4B7F886540D893) /* 791 */, - W64LIT(0x247C20042AA4BFDA) /* 792 */, W64LIT(0x096EA1C517D1327C) /* 793 */, - W64LIT(0xD56966B4361A6685) /* 794 */, W64LIT(0x277DA5C31221057D) /* 795 */, - W64LIT(0x94D59893A43ACFF7) /* 796 */, W64LIT(0x64F0C51CCDC02281) /* 797 */, - W64LIT(0x3D33BCC4FF6189DB) /* 798 */, W64LIT(0xE005CB184CE66AF1) /* 799 */, - W64LIT(0xFF5CCD1D1DB99BEA) /* 800 */, W64LIT(0xB0B854A7FE42980F) /* 801 */, - W64LIT(0x7BD46A6A718D4B9F) /* 802 */, W64LIT(0xD10FA8CC22A5FD8C) /* 803 */, - W64LIT(0xD31484952BE4BD31) /* 804 */, W64LIT(0xC7FA975FCB243847) /* 805 */, - W64LIT(0x4886ED1E5846C407) /* 806 */, W64LIT(0x28CDDB791EB70B04) /* 807 */, - W64LIT(0xC2B00BE2F573417F) /* 808 */, W64LIT(0x5C9590452180F877) /* 809 */, - W64LIT(0x7A6BDDFFF370EB00) /* 810 */, W64LIT(0xCE509E38D6D9D6A4) /* 811 */, - W64LIT(0xEBEB0F00647FA702) /* 812 */, W64LIT(0x1DCC06CF76606F06) /* 813 */, - W64LIT(0xE4D9F28BA286FF0A) /* 814 */, W64LIT(0xD85A305DC918C262) /* 815 */, - W64LIT(0x475B1D8732225F54) /* 816 */, W64LIT(0x2D4FB51668CCB5FE) /* 817 */, - W64LIT(0xA679B9D9D72BBA20) /* 818 */, W64LIT(0x53841C0D912D43A5) /* 819 */, - W64LIT(0x3B7EAA48BF12A4E8) /* 820 */, W64LIT(0x781E0E47F22F1DDF) /* 821 */, - W64LIT(0xEFF20CE60AB50973) /* 822 */, W64LIT(0x20D261D19DFFB742) /* 823 */, - W64LIT(0x16A12B03062A2E39) /* 824 */, W64LIT(0x1960EB2239650495) /* 825 */, - W64LIT(0x251C16FED50EB8B8) /* 826 */, W64LIT(0x9AC0C330F826016E) /* 827 */, - W64LIT(0xED152665953E7671) /* 828 */, W64LIT(0x02D63194A6369570) /* 829 */, - W64LIT(0x5074F08394B1C987) /* 830 */, W64LIT(0x70BA598C90B25CE1) /* 831 */, - W64LIT(0x794A15810B9742F6) /* 832 */, W64LIT(0x0D5925E9FCAF8C6C) /* 833 */, - W64LIT(0x3067716CD868744E) /* 834 */, W64LIT(0x910AB077E8D7731B) /* 835 */, - W64LIT(0x6A61BBDB5AC42F61) /* 836 */, W64LIT(0x93513EFBF0851567) /* 837 */, - W64LIT(0xF494724B9E83E9D5) /* 838 */, W64LIT(0xE887E1985C09648D) /* 839 */, - W64LIT(0x34B1D3C675370CFD) /* 840 */, W64LIT(0xDC35E433BC0D255D) /* 841 */, - W64LIT(0xD0AAB84234131BE0) /* 842 */, W64LIT(0x08042A50B48B7EAF) /* 843 */, - W64LIT(0x9997C4EE44A3AB35) /* 844 */, W64LIT(0x829A7B49201799D0) /* 845 */, - W64LIT(0x263B8307B7C54441) /* 846 */, W64LIT(0x752F95F4FD6A6CA6) /* 847 */, - W64LIT(0x927217402C08C6E5) /* 848 */, W64LIT(0x2A8AB754A795D9EE) /* 849 */, - W64LIT(0xA442F7552F72943D) /* 850 */, W64LIT(0x2C31334E19781208) /* 851 */, - W64LIT(0x4FA98D7CEAEE6291) /* 852 */, W64LIT(0x55C3862F665DB309) /* 853 */, - W64LIT(0xBD0610175D53B1F3) /* 854 */, W64LIT(0x46FE6CB840413F27) /* 855 */, - W64LIT(0x3FE03792DF0CFA59) /* 856 */, W64LIT(0xCFE700372EB85E8F) /* 857 */, - W64LIT(0xA7BE29E7ADBCE118) /* 858 */, W64LIT(0xE544EE5CDE8431DD) /* 859 */, - W64LIT(0x8A781B1B41F1873E) /* 860 */, W64LIT(0xA5C94C78A0D2F0E7) /* 861 */, - W64LIT(0x39412E2877B60728) /* 862 */, W64LIT(0xA1265EF3AFC9A62C) /* 863 */, - W64LIT(0xBCC2770C6A2506C5) /* 864 */, W64LIT(0x3AB66DD5DCE1CE12) /* 865 */, - W64LIT(0xE65499D04A675B37) /* 866 */, W64LIT(0x7D8F523481BFD216) /* 867 */, - W64LIT(0x0F6F64FCEC15F389) /* 868 */, W64LIT(0x74EFBE618B5B13C8) /* 869 */, - W64LIT(0xACDC82B714273E1D) /* 870 */, W64LIT(0xDD40BFE003199D17) /* 871 */, - W64LIT(0x37E99257E7E061F8) /* 872 */, W64LIT(0xFA52626904775AAA) /* 873 */, - W64LIT(0x8BBBF63A463D56F9) /* 874 */, W64LIT(0xF0013F1543A26E64) /* 875 */, - W64LIT(0xA8307E9F879EC898) /* 876 */, W64LIT(0xCC4C27A4150177CC) /* 877 */, - W64LIT(0x1B432F2CCA1D3348) /* 878 */, W64LIT(0xDE1D1F8F9F6FA013) /* 879 */, - W64LIT(0x606602A047A7DDD6) /* 880 */, W64LIT(0xD237AB64CC1CB2C7) /* 881 */, - W64LIT(0x9B938E7225FCD1D3) /* 882 */, W64LIT(0xEC4E03708E0FF476) /* 883 */, - W64LIT(0xFEB2FBDA3D03C12D) /* 884 */, W64LIT(0xAE0BCED2EE43889A) /* 885 */, - W64LIT(0x22CB8923EBFB4F43) /* 886 */, W64LIT(0x69360D013CF7396D) /* 887 */, - W64LIT(0x855E3602D2D4E022) /* 888 */, W64LIT(0x073805BAD01F784C) /* 889 */, - W64LIT(0x33E17A133852F546) /* 890 */, W64LIT(0xDF4874058AC7B638) /* 891 */, - W64LIT(0xBA92B29C678AA14A) /* 892 */, W64LIT(0x0CE89FC76CFAADCD) /* 893 */, - W64LIT(0x5F9D4E0908339E34) /* 894 */, W64LIT(0xF1AFE9291F5923B9) /* 895 */, - W64LIT(0x6E3480F60F4A265F) /* 896 */, W64LIT(0xEEBF3A2AB29B841C) /* 897 */, - W64LIT(0xE21938A88F91B4AD) /* 898 */, W64LIT(0x57DFEFF845C6D3C3) /* 899 */, - W64LIT(0x2F006B0BF62CAAF2) /* 900 */, W64LIT(0x62F479EF6F75EE78) /* 901 */, - W64LIT(0x11A55AD41C8916A9) /* 902 */, W64LIT(0xF229D29084FED453) /* 903 */, - W64LIT(0x42F1C27B16B000E6) /* 904 */, W64LIT(0x2B1F76749823C074) /* 905 */, - W64LIT(0x4B76ECA3C2745360) /* 906 */, W64LIT(0x8C98F463B91691BD) /* 907 */, - W64LIT(0x14BCC93CF1ADE66A) /* 908 */, W64LIT(0x8885213E6D458397) /* 909 */, - W64LIT(0x8E177DF0274D4711) /* 910 */, W64LIT(0xB49B73B5503F2951) /* 911 */, - W64LIT(0x10168168C3F96B6B) /* 912 */, W64LIT(0x0E3D963B63CAB0AE) /* 913 */, - W64LIT(0x8DFC4B5655A1DB14) /* 914 */, W64LIT(0xF789F1356E14DE5C) /* 915 */, - W64LIT(0x683E68AF4E51DAC1) /* 916 */, W64LIT(0xC9A84F9D8D4B0FD9) /* 917 */, - W64LIT(0x3691E03F52A0F9D1) /* 918 */, W64LIT(0x5ED86E46E1878E80) /* 919 */, - W64LIT(0x3C711A0E99D07150) /* 920 */, W64LIT(0x5A0865B20C4E9310) /* 921 */, - W64LIT(0x56FBFC1FE4F0682E) /* 922 */, W64LIT(0xEA8D5DE3105EDF9B) /* 923 */, - W64LIT(0x71ABFDB12379187A) /* 924 */, W64LIT(0x2EB99DE1BEE77B9C) /* 925 */, - W64LIT(0x21ECC0EA33CF4523) /* 926 */, W64LIT(0x59A4D7521805C7A1) /* 927 */, - W64LIT(0x3896F5EB56AE7C72) /* 928 */, W64LIT(0xAA638F3DB18F75DC) /* 929 */, - W64LIT(0x9F39358DABE9808E) /* 930 */, W64LIT(0xB7DEFA91C00B72AC) /* 931 */, - W64LIT(0x6B5541FD62492D92) /* 932 */, W64LIT(0x6DC6DEE8F92E4D5B) /* 933 */, - W64LIT(0x353F57ABC4BEEA7E) /* 934 */, W64LIT(0x735769D6DA5690CE) /* 935 */, - W64LIT(0x0A234AA642391484) /* 936 */, W64LIT(0xF6F9508028F80D9D) /* 937 */, - W64LIT(0xB8E319A27AB3F215) /* 938 */, W64LIT(0x31AD9C1151341A4D) /* 939 */, - W64LIT(0x773C22A57BEF5805) /* 940 */, W64LIT(0x45C7561A07968633) /* 941 */, - W64LIT(0xF913DA9E249DBE36) /* 942 */, W64LIT(0xDA652D9B78A64C68) /* 943 */, - W64LIT(0x4C27A97F3BC334EF) /* 944 */, W64LIT(0x76621220E66B17F4) /* 945 */, - W64LIT(0x967743899ACD7D0B) /* 946 */, W64LIT(0xF3EE5BCAE0ED6782) /* 947 */, - W64LIT(0x409F753600C879FC) /* 948 */, W64LIT(0x06D09A39B5926DB6) /* 949 */, - W64LIT(0x6F83AEB0317AC588) /* 950 */, W64LIT(0x01E6CA4A86381F21) /* 951 */, - W64LIT(0x66FF3462D19F3025) /* 952 */, W64LIT(0x72207C24DDFD3BFB) /* 953 */, - W64LIT(0x4AF6B6D3E2ECE2EB) /* 954 */, W64LIT(0x9C994DBEC7EA08DE) /* 955 */, - W64LIT(0x49ACE597B09A8BC4) /* 956 */, W64LIT(0xB38C4766CF0797BA) /* 957 */, - W64LIT(0x131B9373C57C2A75) /* 958 */, W64LIT(0xB1822CCE61931E58) /* 959 */, - W64LIT(0x9D7555B909BA1C0C) /* 960 */, W64LIT(0x127FAFDD937D11D2) /* 961 */, - W64LIT(0x29DA3BADC66D92E4) /* 962 */, W64LIT(0xA2C1D57154C2ECBC) /* 963 */, - W64LIT(0x58C5134D82F6FE24) /* 964 */, W64LIT(0x1C3AE3515B62274F) /* 965 */, - W64LIT(0xE907C82E01CB8126) /* 966 */, W64LIT(0xF8ED091913E37FCB) /* 967 */, - W64LIT(0x3249D8F9C80046C9) /* 968 */, W64LIT(0x80CF9BEDE388FB63) /* 969 */, - W64LIT(0x1881539A116CF19E) /* 970 */, W64LIT(0x5103F3F76BD52457) /* 971 */, - W64LIT(0x15B7E6F5AE47F7A8) /* 972 */, W64LIT(0xDBD7C6DED47E9CCF) /* 973 */, - W64LIT(0x44E55C410228BB1A) /* 974 */, W64LIT(0xB647D4255EDB4E99) /* 975 */, - W64LIT(0x5D11882BB8AAFC30) /* 976 */, W64LIT(0xF5098BBB29D3212A) /* 977 */, - W64LIT(0x8FB5EA14E90296B3) /* 978 */, W64LIT(0x677B942157DD025A) /* 979 */, - W64LIT(0xFB58E7C0A390ACB5) /* 980 */, W64LIT(0x89D3674C83BD4A01) /* 981 */, - W64LIT(0x9E2DA4DF4BF3B93B) /* 982 */, W64LIT(0xFCC41E328CAB4829) /* 983 */, - W64LIT(0x03F38C96BA582C52) /* 984 */, W64LIT(0xCAD1BDBD7FD85DB2) /* 985 */, - W64LIT(0xBBB442C16082AE83) /* 986 */, W64LIT(0xB95FE86BA5DA9AB0) /* 987 */, - W64LIT(0xB22E04673771A93F) /* 988 */, W64LIT(0x845358C9493152D8) /* 989 */, - W64LIT(0xBE2A488697B4541E) /* 990 */, W64LIT(0x95A2DC2DD38E6966) /* 991 */, - W64LIT(0xC02C11AC923C852B) /* 992 */, W64LIT(0x2388B1990DF2A87B) /* 993 */, - W64LIT(0x7C8008FA1B4F37BE) /* 994 */, W64LIT(0x1F70D0C84D54E503) /* 995 */, - W64LIT(0x5490ADEC7ECE57D4) /* 996 */, W64LIT(0x002B3C27D9063A3A) /* 997 */, - W64LIT(0x7EAEA3848030A2BF) /* 998 */, W64LIT(0xC602326DED2003C0) /* 999 */, - W64LIT(0x83A7287D69A94086) /* 1000 */, W64LIT(0xC57A5FCB30F57A8A) /* 1001 */, - W64LIT(0xB56844E479EBE779) /* 1002 */, W64LIT(0xA373B40F05DCBCE9) /* 1003 */, - W64LIT(0xD71A786E88570EE2) /* 1004 */, W64LIT(0x879CBACDBDE8F6A0) /* 1005 */, - W64LIT(0x976AD1BCC164A32F) /* 1006 */, W64LIT(0xAB21E25E9666D78B) /* 1007 */, - W64LIT(0x901063AAE5E5C33C) /* 1008 */, W64LIT(0x9818B34448698D90) /* 1009 */, - W64LIT(0xE36487AE3E1E8ABB) /* 1010 */, W64LIT(0xAFBDF931893BDCB4) /* 1011 */, - W64LIT(0x6345A0DC5FBBD519) /* 1012 */, W64LIT(0x8628FE269B9465CA) /* 1013 */, - W64LIT(0x1E5D01603F9C51EC) /* 1014 */, W64LIT(0x4DE44006A15049B7) /* 1015 */, - W64LIT(0xBF6C70E5F776CBB1) /* 1016 */, W64LIT(0x411218F2EF552BED) /* 1017 */, - W64LIT(0xCB0C0708705A36A3) /* 1018 */, W64LIT(0xE74D14754F986044) /* 1019 */, - W64LIT(0xCD56D9430EA8280E) /* 1020 */, W64LIT(0xC12591D7535F5065) /* 1021 */, - W64LIT(0xC83223F1720AEF96) /* 1022 */, W64LIT(0xC3A0396F7363A51F) /* 1023 */, - W64LIT(0xffffffffffffffff), - W64LIT(0xA5A5A5A5A5A5A5A5), - W64LIT(0x0123456789ABCDEF), -}; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/trdlocal.cpp b/external/crypto++-5.6.3/trdlocal.cpp deleted file mode 100644 index aded14602..000000000 --- a/external/crypto++-5.6.3/trdlocal.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// trdlocal.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "config.h" - -// TODO: fix this when more complete C++11 support is cut-in -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4297) -#endif - -#ifndef CRYPTOPP_IMPORTS -#ifdef THREADS_AVAILABLE - -#include "trdlocal.h" - -#ifdef HAS_WINTHREADS -#include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -ThreadLocalStorage::Err::Err(const std::string& operation, int error) - : OS_Error(OTHER_ERROR, "ThreadLocalStorage: " + operation + " operation failed with error 0x" + IntToString(error, 16), operation, error) -{ -} - -ThreadLocalStorage::ThreadLocalStorage() -{ -#ifdef HAS_WINTHREADS - m_index = TlsAlloc(); - assert(m_index != TLS_OUT_OF_INDEXES); - if (m_index == TLS_OUT_OF_INDEXES) - throw Err("TlsAlloc", GetLastError()); -#else - m_index = 0; - int error = pthread_key_create(&m_index, NULL); - assert(!error); - if (error) - throw Err("pthread_key_create", error); -#endif -} - -ThreadLocalStorage::~ThreadLocalStorage() CRYPTOPP_THROW -{ -#ifdef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE - if (!std::uncaught_exception()) -#else - try -#endif -#ifdef HAS_WINTHREADS - { - int rc = TlsFree(m_index); - assert(rc); - if (!rc) - throw Err("TlsFree", GetLastError()); - } -#else - { - int error = pthread_key_delete(m_index); - assert(!error); - if (error) - throw Err("pthread_key_delete", error); - } -#endif -#ifndef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE - catch(const Exception&) - { - } -#endif -} - -void ThreadLocalStorage::SetValue(void *value) -{ -#ifdef HAS_WINTHREADS - if (!TlsSetValue(m_index, value)) - throw Err("TlsSetValue", GetLastError()); -#else - int error = pthread_setspecific(m_index, value); - if (error) - throw Err("pthread_key_getspecific", error); -#endif -} - -void *ThreadLocalStorage::GetValue() const -{ -#ifdef HAS_WINTHREADS - void *result = TlsGetValue(m_index); - const DWORD dwRet = GetLastError(); - - assert(result || (!result && (dwRet == NO_ERROR))); - if (!result && dwRet != NO_ERROR) - throw Err("TlsGetValue", dwRet); -#else - // Null is a valid return value. Posix does not provide a way to - // check for a "good" Null vs a "bad" Null (errno is not set). - void *result = pthread_getspecific(m_index); -#endif - return result; -} - -NAMESPACE_END - -#endif // #ifdef THREADS_AVAILABLE -#endif diff --git a/external/crypto++-5.6.3/trdlocal.h b/external/crypto++-5.6.3/trdlocal.h deleted file mode 100644 index cfc5a532a..000000000 --- a/external/crypto++-5.6.3/trdlocal.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CRYPTOPP_TRDLOCAL_H -#define CRYPTOPP_TRDLOCAL_H - -#include "config.h" - -#ifdef THREADS_AVAILABLE - -#include "misc.h" - -#ifdef HAS_WINTHREADS -typedef unsigned long ThreadLocalIndexType; -#else -#include -typedef pthread_key_t ThreadLocalIndexType; -#endif - -NAMESPACE_BEGIN(CryptoPP) - -//! thread local storage -class CRYPTOPP_DLL ThreadLocalStorage : public NotCopyable -{ -public: - //! exception thrown by ThreadLocalStorage class - class Err : public OS_Error - { - public: - Err(const std::string& operation, int error); - }; - - ThreadLocalStorage(); - ~ThreadLocalStorage() CRYPTOPP_THROW; - - void SetValue(void *value); - void *GetValue() const; - -private: - ThreadLocalIndexType m_index; -}; - -NAMESPACE_END - -#endif // #ifdef THREADS_AVAILABLE - -#endif diff --git a/external/crypto++-5.6.3/trunhash.h b/external/crypto++-5.6.3/trunhash.h deleted file mode 100644 index dd0cfa1d3..000000000 --- a/external/crypto++-5.6.3/trunhash.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef CRYPTOPP_TRUNHASH_H -#define CRYPTOPP_TRUNHASH_H - -#include "cryptlib.h" - -NAMESPACE_BEGIN(CryptoPP) - -class NullHash : public HashTransformation -{ -public: - void Update(const byte *input, size_t length) - {CRYPTOPP_UNUSED(input);CRYPTOPP_UNUSED(length);} - unsigned int DigestSize() const - {return 0;} - void TruncatedFinal(byte *digest, size_t digestSize) - {CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestSize);} - bool TruncatedVerify(const byte *digest, size_t digestLength) - {CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestLength);return true;} -}; - -//! construct new HashModule with smaller DigestSize() from existing one -template -class TruncatedHashTemplate : public HashTransformation -{ -public: - TruncatedHashTemplate(T hm, unsigned int digestSize) - : m_hm(hm), m_digestSize(digestSize) {} - TruncatedHashTemplate(const byte *key, size_t keyLength, unsigned int digestSize) - : m_hm(key, keyLength), m_digestSize(digestSize) {} - TruncatedHashTemplate(size_t digestSize) - : m_digestSize(digestSize) {} - - void Restart() - {m_hm.Restart();} - void Update(const byte *input, size_t length) - {m_hm.Update(input, length);} - unsigned int DigestSize() const {return m_digestSize;} - void TruncatedFinal(byte *digest, size_t digestSize) - {m_hm.TruncatedFinal(digest, digestSize);} - bool TruncatedVerify(const byte *digest, size_t digestLength) - {return m_hm.TruncatedVerify(digest, digestLength);} - -private: - T m_hm; - unsigned int m_digestSize; -}; - -typedef TruncatedHashTemplate TruncatedHashModule; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/ttmac.cpp b/external/crypto++-5.6.3/ttmac.cpp deleted file mode 100644 index 177b898b3..000000000 --- a/external/crypto++-5.6.3/ttmac.cpp +++ /dev/null @@ -1,338 +0,0 @@ -// ttmac.cpp - written and placed in the public domain by Kevin Springle - -#include "pch.h" -#include "ttmac.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -void TTMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) -{ - AssertValidKeyLength(keylength); - - memcpy(m_key, userKey, KEYLENGTH); - CorrectEndianess(m_key, m_key, KEYLENGTH); - - Init(); -} - -void TTMAC_Base::Init() -{ - m_digest[0] = m_digest[5] = m_key[0]; - m_digest[1] = m_digest[6] = m_key[1]; - m_digest[2] = m_digest[7] = m_key[2]; - m_digest[3] = m_digest[8] = m_key[3]; - m_digest[4] = m_digest[9] = m_key[4]; -} - -void TTMAC_Base::TruncatedFinal(byte *hash, size_t size) -{ - PadLastBlock(BlockSize() - 2*sizeof(HashWordType)); - CorrectEndianess(m_data, m_data, BlockSize() - 2*sizeof(HashWordType)); - - m_data[m_data.size()-2] = GetBitCountLo(); - m_data[m_data.size()-1] = GetBitCountHi(); - - Transform(m_digest, m_data, true); - - word32 t2 = m_digest[2]; - word32 t3 = m_digest[3]; - if (size != DIGESTSIZE) - { - switch (size) - { - case 16: - m_digest[3] += m_digest[1] + m_digest[4]; - // fall through - case 12: - m_digest[2] += m_digest[0] + t3; - // fall through - case 8: - m_digest[0] += m_digest[1] + t3; - m_digest[1] += m_digest[4] + t2; - break; - - case 4: - m_digest[0] += - m_digest[1] + - m_digest[2] + - m_digest[3] + - m_digest[4]; - break; - - case 0: - // Used by HashTransformation::Restart() - break; - - default: - throw InvalidArgument("TTMAC_Base: can't truncate a Two-Track-MAC 20 byte digest to " + IntToString(size) + " bytes"); - break; - } - } - - CorrectEndianess(m_digest, m_digest, size); - memcpy(hash, m_digest, size); - - Restart(); // reinit for next use -} - -// RIPEMD-160 definitions used by Two-Track-MAC - -#define F(x, y, z) (x ^ y ^ z) -#define G(x, y, z) (z ^ (x & (y^z))) -#define H(x, y, z) (z ^ (x | ~y)) -#define I(x, y, z) (y ^ (z & (x^y))) -#define J(x, y, z) (x ^ (y | ~z)) - -#define k0 0 -#define k1 0x5a827999UL -#define k2 0x6ed9eba1UL -#define k3 0x8f1bbcdcUL -#define k4 0xa953fd4eUL -#define k5 0x50a28be6UL -#define k6 0x5c4dd124UL -#define k7 0x6d703ef3UL -#define k8 0x7a6d76e9UL -#define k9 0 - -void TTMAC_Base::Transform(word32 *digest, const word32 *X, bool last) -{ -#define Subround(f, a, b, c, d, e, x, s, k) \ - a += f(b, c, d) + x + k;\ - a = rotlFixed((word32)a, s) + e;\ - c = rotlFixed((word32)c, 10U) - - word32 a1, b1, c1, d1, e1, a2, b2, c2, d2, e2; - word32 *trackA, *trackB; - - if (!last) - { - trackA = digest; - trackB = digest+5; - } - else - { - trackB = digest; - trackA = digest+5; - } - a1 = trackA[0]; - b1 = trackA[1]; - c1 = trackA[2]; - d1 = trackA[3]; - e1 = trackA[4]; - a2 = trackB[0]; - b2 = trackB[1]; - c2 = trackB[2]; - d2 = trackB[3]; - e2 = trackB[4]; - - Subround(F, a1, b1, c1, d1, e1, X[ 0], 11, k0); - Subround(F, e1, a1, b1, c1, d1, X[ 1], 14, k0); - Subround(F, d1, e1, a1, b1, c1, X[ 2], 15, k0); - Subround(F, c1, d1, e1, a1, b1, X[ 3], 12, k0); - Subround(F, b1, c1, d1, e1, a1, X[ 4], 5, k0); - Subround(F, a1, b1, c1, d1, e1, X[ 5], 8, k0); - Subround(F, e1, a1, b1, c1, d1, X[ 6], 7, k0); - Subround(F, d1, e1, a1, b1, c1, X[ 7], 9, k0); - Subround(F, c1, d1, e1, a1, b1, X[ 8], 11, k0); - Subround(F, b1, c1, d1, e1, a1, X[ 9], 13, k0); - Subround(F, a1, b1, c1, d1, e1, X[10], 14, k0); - Subround(F, e1, a1, b1, c1, d1, X[11], 15, k0); - Subround(F, d1, e1, a1, b1, c1, X[12], 6, k0); - Subround(F, c1, d1, e1, a1, b1, X[13], 7, k0); - Subround(F, b1, c1, d1, e1, a1, X[14], 9, k0); - Subround(F, a1, b1, c1, d1, e1, X[15], 8, k0); - - Subround(G, e1, a1, b1, c1, d1, X[ 7], 7, k1); - Subround(G, d1, e1, a1, b1, c1, X[ 4], 6, k1); - Subround(G, c1, d1, e1, a1, b1, X[13], 8, k1); - Subround(G, b1, c1, d1, e1, a1, X[ 1], 13, k1); - Subround(G, a1, b1, c1, d1, e1, X[10], 11, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 6], 9, k1); - Subround(G, d1, e1, a1, b1, c1, X[15], 7, k1); - Subround(G, c1, d1, e1, a1, b1, X[ 3], 15, k1); - Subround(G, b1, c1, d1, e1, a1, X[12], 7, k1); - Subround(G, a1, b1, c1, d1, e1, X[ 0], 12, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 9], 15, k1); - Subround(G, d1, e1, a1, b1, c1, X[ 5], 9, k1); - Subround(G, c1, d1, e1, a1, b1, X[ 2], 11, k1); - Subround(G, b1, c1, d1, e1, a1, X[14], 7, k1); - Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1); - Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1); - - Subround(H, d1, e1, a1, b1, c1, X[ 3], 11, k2); - Subround(H, c1, d1, e1, a1, b1, X[10], 13, k2); - Subround(H, b1, c1, d1, e1, a1, X[14], 6, k2); - Subround(H, a1, b1, c1, d1, e1, X[ 4], 7, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 9], 14, k2); - Subround(H, d1, e1, a1, b1, c1, X[15], 9, k2); - Subround(H, c1, d1, e1, a1, b1, X[ 8], 13, k2); - Subround(H, b1, c1, d1, e1, a1, X[ 1], 15, k2); - Subround(H, a1, b1, c1, d1, e1, X[ 2], 14, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 7], 8, k2); - Subround(H, d1, e1, a1, b1, c1, X[ 0], 13, k2); - Subround(H, c1, d1, e1, a1, b1, X[ 6], 6, k2); - Subround(H, b1, c1, d1, e1, a1, X[13], 5, k2); - Subround(H, a1, b1, c1, d1, e1, X[11], 12, k2); - Subround(H, e1, a1, b1, c1, d1, X[ 5], 7, k2); - Subround(H, d1, e1, a1, b1, c1, X[12], 5, k2); - - Subround(I, c1, d1, e1, a1, b1, X[ 1], 11, k3); - Subround(I, b1, c1, d1, e1, a1, X[ 9], 12, k3); - Subround(I, a1, b1, c1, d1, e1, X[11], 14, k3); - Subround(I, e1, a1, b1, c1, d1, X[10], 15, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 0], 14, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 8], 15, k3); - Subround(I, b1, c1, d1, e1, a1, X[12], 9, k3); - Subround(I, a1, b1, c1, d1, e1, X[ 4], 8, k3); - Subround(I, e1, a1, b1, c1, d1, X[13], 9, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 3], 14, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 7], 5, k3); - Subround(I, b1, c1, d1, e1, a1, X[15], 6, k3); - Subround(I, a1, b1, c1, d1, e1, X[14], 8, k3); - Subround(I, e1, a1, b1, c1, d1, X[ 5], 6, k3); - Subround(I, d1, e1, a1, b1, c1, X[ 6], 5, k3); - Subround(I, c1, d1, e1, a1, b1, X[ 2], 12, k3); - - Subround(J, b1, c1, d1, e1, a1, X[ 4], 9, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 0], 15, k4); - Subround(J, e1, a1, b1, c1, d1, X[ 5], 5, k4); - Subround(J, d1, e1, a1, b1, c1, X[ 9], 11, k4); - Subround(J, c1, d1, e1, a1, b1, X[ 7], 6, k4); - Subround(J, b1, c1, d1, e1, a1, X[12], 8, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 2], 13, k4); - Subround(J, e1, a1, b1, c1, d1, X[10], 12, k4); - Subround(J, d1, e1, a1, b1, c1, X[14], 5, k4); - Subround(J, c1, d1, e1, a1, b1, X[ 1], 12, k4); - Subround(J, b1, c1, d1, e1, a1, X[ 3], 13, k4); - Subround(J, a1, b1, c1, d1, e1, X[ 8], 14, k4); - Subround(J, e1, a1, b1, c1, d1, X[11], 11, k4); - Subround(J, d1, e1, a1, b1, c1, X[ 6], 8, k4); - Subround(J, c1, d1, e1, a1, b1, X[15], 5, k4); - Subround(J, b1, c1, d1, e1, a1, X[13], 6, k4); - - Subround(J, a2, b2, c2, d2, e2, X[ 5], 8, k5); - Subround(J, e2, a2, b2, c2, d2, X[14], 9, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 7], 9, k5); - Subround(J, c2, d2, e2, a2, b2, X[ 0], 11, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 9], 13, k5); - Subround(J, a2, b2, c2, d2, e2, X[ 2], 15, k5); - Subround(J, e2, a2, b2, c2, d2, X[11], 15, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 4], 5, k5); - Subround(J, c2, d2, e2, a2, b2, X[13], 7, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 6], 7, k5); - Subround(J, a2, b2, c2, d2, e2, X[15], 8, k5); - Subround(J, e2, a2, b2, c2, d2, X[ 8], 11, k5); - Subround(J, d2, e2, a2, b2, c2, X[ 1], 14, k5); - Subround(J, c2, d2, e2, a2, b2, X[10], 14, k5); - Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5); - Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5); - - Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6); - Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6); - Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6); - Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6); - Subround(I, a2, b2, c2, d2, e2, X[ 0], 12, k6); - Subround(I, e2, a2, b2, c2, d2, X[13], 8, k6); - Subround(I, d2, e2, a2, b2, c2, X[ 5], 9, k6); - Subround(I, c2, d2, e2, a2, b2, X[10], 11, k6); - Subround(I, b2, c2, d2, e2, a2, X[14], 7, k6); - Subround(I, a2, b2, c2, d2, e2, X[15], 7, k6); - Subround(I, e2, a2, b2, c2, d2, X[ 8], 12, k6); - Subround(I, d2, e2, a2, b2, c2, X[12], 7, k6); - Subround(I, c2, d2, e2, a2, b2, X[ 4], 6, k6); - Subround(I, b2, c2, d2, e2, a2, X[ 9], 15, k6); - Subround(I, a2, b2, c2, d2, e2, X[ 1], 13, k6); - Subround(I, e2, a2, b2, c2, d2, X[ 2], 11, k6); - - Subround(H, d2, e2, a2, b2, c2, X[15], 9, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 5], 7, k7); - Subround(H, b2, c2, d2, e2, a2, X[ 1], 15, k7); - Subround(H, a2, b2, c2, d2, e2, X[ 3], 11, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 7], 8, k7); - Subround(H, d2, e2, a2, b2, c2, X[14], 6, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 6], 6, k7); - Subround(H, b2, c2, d2, e2, a2, X[ 9], 14, k7); - Subround(H, a2, b2, c2, d2, e2, X[11], 12, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 8], 13, k7); - Subround(H, d2, e2, a2, b2, c2, X[12], 5, k7); - Subround(H, c2, d2, e2, a2, b2, X[ 2], 14, k7); - Subround(H, b2, c2, d2, e2, a2, X[10], 13, k7); - Subround(H, a2, b2, c2, d2, e2, X[ 0], 13, k7); - Subround(H, e2, a2, b2, c2, d2, X[ 4], 7, k7); - Subround(H, d2, e2, a2, b2, c2, X[13], 5, k7); - - Subround(G, c2, d2, e2, a2, b2, X[ 8], 15, k8); - Subround(G, b2, c2, d2, e2, a2, X[ 6], 5, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 4], 8, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 1], 11, k8); - Subround(G, d2, e2, a2, b2, c2, X[ 3], 14, k8); - Subround(G, c2, d2, e2, a2, b2, X[11], 14, k8); - Subround(G, b2, c2, d2, e2, a2, X[15], 6, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 0], 14, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 5], 6, k8); - Subround(G, d2, e2, a2, b2, c2, X[12], 9, k8); - Subround(G, c2, d2, e2, a2, b2, X[ 2], 12, k8); - Subround(G, b2, c2, d2, e2, a2, X[13], 9, k8); - Subround(G, a2, b2, c2, d2, e2, X[ 9], 12, k8); - Subround(G, e2, a2, b2, c2, d2, X[ 7], 5, k8); - Subround(G, d2, e2, a2, b2, c2, X[10], 15, k8); - Subround(G, c2, d2, e2, a2, b2, X[14], 8, k8); - - Subround(F, b2, c2, d2, e2, a2, X[12], 8, k9); - Subround(F, a2, b2, c2, d2, e2, X[15], 5, k9); - Subround(F, e2, a2, b2, c2, d2, X[10], 12, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 4], 9, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 1], 12, k9); - Subround(F, b2, c2, d2, e2, a2, X[ 5], 5, k9); - Subround(F, a2, b2, c2, d2, e2, X[ 8], 14, k9); - Subround(F, e2, a2, b2, c2, d2, X[ 7], 6, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 6], 8, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 2], 13, k9); - Subround(F, b2, c2, d2, e2, a2, X[13], 6, k9); - Subround(F, a2, b2, c2, d2, e2, X[14], 5, k9); - Subround(F, e2, a2, b2, c2, d2, X[ 0], 15, k9); - Subround(F, d2, e2, a2, b2, c2, X[ 3], 13, k9); - Subround(F, c2, d2, e2, a2, b2, X[ 9], 11, k9); - Subround(F, b2, c2, d2, e2, a2, X[11], 11, k9); - - a1 -= trackA[0]; - b1 -= trackA[1]; - c1 -= trackA[2]; - d1 -= trackA[3]; - e1 -= trackA[4]; - a2 -= trackB[0]; - b2 -= trackB[1]; - c2 -= trackB[2]; - d2 -= trackB[3]; - e2 -= trackB[4]; - - if (!last) - { - trackA[0] = (b1 + e1) - d2; - trackA[1] = c1 - e2; - trackA[2] = d1 - a2; - trackA[3] = e1 - b2; - trackA[4] = a1 - c2; - trackB[0] = d1 - e2; - trackB[1] = (e1 + c1) - a2; - trackB[2] = a1 - b2; - trackB[3] = b1 - c2; - trackB[4] = c1 - d2; - } - else - { - trackB[0] = a2 - a1; - trackB[1] = b2 - b1; - trackB[2] = c2 - c1; - trackB[3] = d2 - d1; - trackB[4] = e2 - e1; - trackA[0] = 0; - trackA[1] = 0; - trackA[2] = 0; - trackA[3] = 0; - trackA[4] = 0; - } -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/ttmac.h b/external/crypto++-5.6.3/ttmac.h deleted file mode 100644 index c0ab7e9fb..000000000 --- a/external/crypto++-5.6.3/ttmac.h +++ /dev/null @@ -1,39 +0,0 @@ -// ttmac.h - written and placed in the public domain by Kevin Springle - -#ifndef CRYPTOPP_TTMAC_H -#define CRYPTOPP_TTMAC_H - -#include "seckey.h" -#include "iterhash.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash -{ -public: - static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");} - CRYPTOPP_CONSTANT(DIGESTSIZE=20) - - unsigned int DigestSize() const {return DIGESTSIZE;}; - void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); - void TruncatedFinal(byte *mac, size_t size); - -protected: - static void Transform (word32 *digest, const word32 *X, bool last); - void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, false);} - void Init(); - word32* StateBuf() {return m_digest;} - - FixedSizeSecBlock m_digest; - FixedSizeSecBlock m_key; -}; - -//! Two-Track-MAC -/*! 160 Bit MAC with 160 Bit Key */ -DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal, TTMAC) - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/twofish.cpp b/external/crypto++-5.6.3/twofish.cpp deleted file mode 100644 index 14abd9f25..000000000 --- a/external/crypto++-5.6.3/twofish.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// twofish.cpp - modified by Wei Dai from Matthew Skala's twofish.c -// The original code and all modifications are in the public domain. - -#include "pch.h" -#include "twofish.h" -#include "secblock.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -// compute (c * x^4) mod (x^4 + (a + 1/a) * x^3 + a * x^2 + (a + 1/a) * x + 1) -// over GF(256) -static inline unsigned int Mod(unsigned int c) -{ - static const unsigned int modulus = 0x14d; - unsigned int c2 = (c<<1) ^ ((c & 0x80) ? modulus : 0); - unsigned int c1 = c2 ^ (c>>1) ^ ((c & 1) ? (modulus>>1) : 0); - return c | (c1 << 8) | (c2 << 16) | (c1 << 24); -} - -// compute RS(12,8) code with the above polynomial as generator -// this is equivalent to multiplying by the RS matrix -static word32 ReedSolomon(word32 high, word32 low) -{ - for (unsigned int i=0; i<8; i++) - { - high = Mod(high>>24) ^ (high<<8) ^ (low>>24); - low <<= 8; - } - return high; -} - -inline word32 Twofish::Base::h0(word32 x, const word32 *key, unsigned int kLen) -{ - x = x | (x<<8) | (x<<16) | (x<<24); - switch(kLen) - { -#define Q(a, b, c, d, t) q[a][GETBYTE(t,0)] ^ (q[b][GETBYTE(t,1)] << 8) ^ (q[c][GETBYTE(t,2)] << 16) ^ (q[d][GETBYTE(t,3)] << 24) - case 4: x = Q(1, 0, 0, 1, x) ^ key[6]; - case 3: x = Q(1, 1, 0, 0, x) ^ key[4]; - case 2: x = Q(0, 1, 0, 1, x) ^ key[2]; - x = Q(0, 0, 1, 1, x) ^ key[0]; - } - return x; -} - -inline word32 Twofish::Base::h(word32 x, const word32 *key, unsigned int kLen) -{ - x = h0(x, key, kLen); - return mds[0][GETBYTE(x,0)] ^ mds[1][GETBYTE(x,1)] ^ mds[2][GETBYTE(x,2)] ^ mds[3][GETBYTE(x,3)]; -} - -void Twofish::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) -{ - AssertValidKeyLength(keylength); - - unsigned int len = (keylength <= 16 ? 2 : (keylength <= 24 ? 3 : 4)); - SecBlock key(len*2); - GetUserKey(LITTLE_ENDIAN_ORDER, key.begin(), len*2, userKey, keylength); - - unsigned int i; - for (i=0; i<40; i+=2) - { - word32 a = h(i, key, len); - word32 b = rotlFixed(h(i+1, key+1, len), 8); - m_k[i] = a+b; - m_k[i+1] = rotlFixed(a+2*b, 9); - } - - SecBlock svec(2*len); - for (i=0; i Block; - -void Twofish::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 x, y, a, b, c, d; - - Block::Get(inBlock)(a)(b)(c)(d); - - a ^= m_k[0]; - b ^= m_k[1]; - c ^= m_k[2]; - d ^= m_k[3]; - - const word32 *k = m_k+8; - ENCCYCLE (0); - ENCCYCLE (1); - ENCCYCLE (2); - ENCCYCLE (3); - ENCCYCLE (4); - ENCCYCLE (5); - ENCCYCLE (6); - ENCCYCLE (7); - - c ^= m_k[4]; - d ^= m_k[5]; - a ^= m_k[6]; - b ^= m_k[7]; - - Block::Put(xorBlock, outBlock)(c)(d)(a)(b); -} - -void Twofish::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -{ - word32 x, y, a, b, c, d; - - Block::Get(inBlock)(c)(d)(a)(b); - - c ^= m_k[4]; - d ^= m_k[5]; - a ^= m_k[6]; - b ^= m_k[7]; - - const word32 *k = m_k+8; - DECCYCLE (7); - DECCYCLE (6); - DECCYCLE (5); - DECCYCLE (4); - DECCYCLE (3); - DECCYCLE (2); - DECCYCLE (1); - DECCYCLE (0); - - a ^= m_k[0]; - b ^= m_k[1]; - c ^= m_k[2]; - d ^= m_k[3]; - - Block::Put(xorBlock, outBlock)(a)(b)(c)(d); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/twofish.h b/external/crypto++-5.6.3/twofish.h deleted file mode 100644 index 0ab3e36d4..000000000 --- a/external/crypto++-5.6.3/twofish.h +++ /dev/null @@ -1,61 +0,0 @@ -// twofish.h - written and placed in the public domain by Wei Dai - -//! \file twofish.h -//! \brief Classes for the Twofish block cipher - -#ifndef CRYPTOPP_TWOFISH_H -#define CRYPTOPP_TWOFISH_H - -#include "seckey.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, FixedRounds<16> -{ - static const char *StaticAlgorithmName() {return "Twofish";} -}; - -/// Twofish -class Twofish : public Twofish_Info, public BlockCipherDocumentation -{ - class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl - { - public: - void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); - - protected: - static word32 h0(word32 x, const word32 *key, unsigned int kLen); - static word32 h(word32 x, const word32 *key, unsigned int kLen); - - static const byte q[2][256]; - static const word32 mds[4][256]; - - FixedSizeSecBlock m_k; - FixedSizeSecBlock m_s; - }; - - class CRYPTOPP_NO_VTABLE Enc : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - - class CRYPTOPP_NO_VTABLE Dec : public Base - { - public: - void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - }; - -public: - typedef BlockCipherFinal Encryption; - typedef BlockCipherFinal Decryption; -}; - -typedef Twofish::Encryption TwofishEncryption; -typedef Twofish::Decryption TwofishDecryption; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/validat1.cpp b/external/crypto++-5.6.3/validat1.cpp deleted file mode 100644 index 96993c507..000000000 --- a/external/crypto++-5.6.3/validat1.cpp +++ /dev/null @@ -1,1639 +0,0 @@ -// validat1.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 - -#include "cryptlib.h" -#include "pubkey.h" -#include "gfpcrypt.h" -#include "eccrypto.h" -#include "filters.h" -#include "files.h" -#include "hex.h" -#include "base32.h" -#include "base64.h" -#include "modes.h" -#include "cbcmac.h" -#include "dmac.h" -#include "idea.h" -#include "des.h" -#include "rc2.h" -#include "arc4.h" -#include "rc5.h" -#include "blowfish.h" -#include "3way.h" -#include "safer.h" -#include "gost.h" -#include "shark.h" -#include "cast.h" -#include "square.h" -#include "seal.h" -#include "rc6.h" -#include "mars.h" -#include "aes.h" -#include "cpu.h" -#include "rng.h" -#include "rijndael.h" -#include "twofish.h" -#include "serpent.h" -#include "skipjack.h" -#include "shacal2.h" -#include "camellia.h" -#include "osrng.h" -#include "rdrand.h" -#include "zdeflate.h" -#include "smartptr.h" -#include "channels.h" - -#include -#include -#include -#include - -#include "validate.h" - -// Aggressive stack checking with VS2005 SP1 and above. -#if (CRYPTOPP_MSC_VERSION >= 1410) -# pragma strict_gs_check (on) -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -bool ValidateAll(bool thorough) -{ - bool pass=TestSettings(); - pass=TestOS_RNG() && pass; - pass=TestAutoSeeded() && pass; - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) - pass=TestRDRAND() && pass; - pass=TestRDSEED() && pass; -#else - -#endif - -#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS) - // http://github.com/weidai11/cryptopp/issues/64 - pass=TestPolynomialMod2() && pass; -#endif - - pass=ValidateCRC32() && pass; - pass=ValidateAdler32() && pass; - pass=ValidateMD2() && pass; - pass=ValidateMD5() && pass; - pass=ValidateSHA() && pass; - pass=RunTestDataFile("TestVectors/sha3.txt") && pass; - pass=ValidateTiger() && pass; - pass=ValidateRIPEMD() && pass; - pass=ValidatePanama() && pass; - pass=ValidateWhirlpool() && pass; - - pass=ValidateHMAC() && pass; - pass=ValidateTTMAC() && pass; - - pass=ValidatePBKDF() && pass; - pass=ValidateHKDF() && pass; - - pass=ValidateDES() && pass; - pass=ValidateCipherModes() && pass; - pass=ValidateIDEA() && pass; - pass=ValidateSAFER() && pass; - pass=ValidateRC2() && pass; - pass=ValidateARC4() && pass; - pass=ValidateRC5() && pass; - pass=ValidateBlowfish() && pass; - pass=ValidateThreeWay() && pass; - pass=ValidateGOST() && pass; - pass=ValidateSHARK() && pass; - pass=ValidateCAST() && pass; - pass=ValidateSquare() && pass; - pass=ValidateSKIPJACK() && pass; - pass=ValidateSEAL() && pass; - pass=ValidateRC6() && pass; - pass=ValidateMARS() && pass; - pass=ValidateRijndael() && pass; - pass=ValidateTwofish() && pass; - pass=ValidateSerpent() && pass; - pass=ValidateSHACAL2() && pass; - pass=ValidateCamellia() && pass; - pass=ValidateSalsa() && pass; - pass=ValidateSosemanuk() && pass; - pass=ValidateVMAC() && pass; - pass=ValidateCCM() && pass; - pass=ValidateGCM() && pass; - pass=ValidateCMAC() && pass; - pass=RunTestDataFile("TestVectors/eax.txt") && pass; - pass=RunTestDataFile("TestVectors/seed.txt") && pass; - - pass=ValidateBBS() && pass; - pass=ValidateDH() && pass; - pass=ValidateMQV() && pass; - pass=ValidateRSA() && pass; - pass=ValidateElGamal() && pass; - pass=ValidateDLIES() && pass; - pass=ValidateNR() && pass; - pass=ValidateDSA(thorough) && pass; - pass=ValidateLUC() && pass; - pass=ValidateLUC_DH() && pass; - pass=ValidateLUC_DL() && pass; - pass=ValidateXTR_DH() && pass; - pass=ValidateRabin() && pass; - pass=ValidateRW() && pass; -// pass=ValidateBlumGoldwasser() && pass; - pass=ValidateECP() && pass; - pass=ValidateEC2N() && pass; - pass=ValidateECDSA() && pass; - pass=ValidateESIGN() && pass; - - if (pass) - cout << "\nAll tests passed!\n"; - else - cout << "\nOops! Not all tests passed.\n"; - - return pass; -} - -bool TestSettings() -{ - // Thanks to IlyaBizyaev and Zireael-N, http://github.com/weidai11/cryptopp/issues/28 -#if defined(__MINGW32__) - using CryptoPP::memcpy_s; -#endif - - bool pass = true; - - cout << "\nTesting Settings...\n\n"; - - word32 w; - memcpy_s(&w, sizeof(w), "\x01\x02\x03\x04", 4); - - if (w == 0x04030201L) - { -#ifdef IS_LITTLE_ENDIAN - cout << "passed: "; -#else - cout << "FAILED: "; - pass = false; -#endif - cout << "Your machine is little endian.\n"; - } - else if (w == 0x01020304L) - { -#ifndef IS_LITTLE_ENDIAN - cout << "passed: "; -#else - cout << "FAILED: "; - pass = false; -#endif - cout << "Your machine is big endian.\n"; - } - else - { - cout << "FAILED: Your machine is neither big endian nor little endian.\n"; - pass = false; - } - -#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS - byte testvals[10] = {1,2,2,3,3,3,3,2,2,1}; - if (*(word32 *)(testvals+3) == 0x03030303 && *(word64 *)(testvals+1) == W64LIT(0x0202030303030202)) - cout << "passed: Your machine allows unaligned data access.\n"; - else - { - cout << "FAILED: Unaligned data access gave incorrect results.\n"; - pass = false; - } -#else - cout << "passed: CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is not defined. Will restrict to aligned data access.\n"; -#endif - - if (sizeof(byte) == 1) - cout << "passed: "; - else - { - cout << "FAILED: "; - pass = false; - } - cout << "sizeof(byte) == " << sizeof(byte) << endl; - - if (sizeof(word16) == 2) - cout << "passed: "; - else - { - cout << "FAILED: "; - pass = false; - } - cout << "sizeof(word16) == " << sizeof(word16) << endl; - - if (sizeof(word32) == 4) - cout << "passed: "; - else - { - cout << "FAILED: "; - pass = false; - } - cout << "sizeof(word32) == " << sizeof(word32) << endl; - - if (sizeof(word64) == 8) - cout << "passed: "; - else - { - cout << "FAILED: "; - pass = false; - } - cout << "sizeof(word64) == " << sizeof(word64) << endl; - -#ifdef CRYPTOPP_WORD128_AVAILABLE - if (sizeof(word128) == 16) - cout << "passed: "; - else - { - cout << "FAILED: "; - pass = false; - } - cout << "sizeof(word128) == " << sizeof(word128) << endl; -#endif - - if (sizeof(word) == 2*sizeof(hword) -#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - && sizeof(dword) == 2*sizeof(word) -#endif - ) - cout << "passed: "; - else - { - cout << "FAILED: "; - pass = false; - } - cout << "sizeof(hword) == " << sizeof(hword) << ", sizeof(word) == " << sizeof(word); -#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE - cout << ", sizeof(dword) == " << sizeof(dword); -#endif - cout << endl; - -#ifdef CRYPTOPP_CPUID_AVAILABLE - bool hasMMX = HasMMX(); - bool hasISSE = HasISSE(); - bool hasSSE2 = HasSSE2(); - bool hasSSSE3 = HasSSSE3(); - bool isP4 = IsP4(); - int cacheLineSize = GetCacheLineSize(); - - if ((isP4 && (!hasMMX || !hasSSE2)) || (hasSSE2 && !hasMMX) || (cacheLineSize < 16 || cacheLineSize > 256 || !IsPowerOf2(cacheLineSize))) - { - cout << "FAILED: "; - pass = false; - } - else - cout << "passed: "; - - cout << "hasMMX == " << hasMMX << ", hasISSE == " << hasISSE << ", hasSSE2 == " << hasSSE2 << ", hasSSSE3 == " << hasSSSE3 << ", hasAESNI == " << HasAESNI() << ", hasRDRAND == " << HasRDRAND() << ", hasRDSEED == " << HasRDSEED() << ", hasCLMUL == " << HasCLMUL() << ", isP4 == " << isP4 << ", cacheLineSize == " << cacheLineSize; - cout << ", AESNI_INTRINSICS == " << CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE << endl; -#endif - - if (!pass) - { - cout << "Some critical setting in config.h is in error. Please fix it and recompile." << endl; - abort(); - } - return pass; -} - -bool TestOS_RNG() -{ - bool pass = true; - - member_ptr rng; - -#ifdef BLOCKING_RNG_AVAILABLE - try {rng.reset(new BlockingRng);} - catch (OS_RNG_Err &) {} -#endif - - if (rng.get()) - { - cout << "\nTesting operating system provided blocking random number generator...\n\n"; - - MeterFilter meter(new Redirector(TheBitBucket())); - RandomNumberSource test(*rng, UINT_MAX, false, new Deflator(new Redirector(meter))); - unsigned long total=0, length=0; - time_t t = time(NULL), t1 = 0; - CRYPTOPP_UNUSED(length); - - // check that it doesn't take too long to generate a reasonable amount of randomness - while (total < 16 && (t1 < 10 || total*8 > (unsigned long)t1)) - { - test.Pump(1); - total += 1; - t1 = time(NULL) - t; - } - - if (total < 16) - { - cout << "FAILED:"; - pass = false; - } - else - cout << "passed:"; - cout << " it took " << long(t1) << " seconds to generate " << total << " bytes" << endl; - -#if 0 // disable this part. it's causing an unpredictable pause during the validation testing - if (t1 < 2) - { - // that was fast, are we really blocking? - // first exhaust the extropy reserve - t = time(NULL); - while (time(NULL) - t < 2) - { - test.Pump(1); - total += 1; - } - - // if it generates too many bytes in a certain amount of time, - // something's probably wrong - t = time(NULL); - while (time(NULL) - t < 2) - { - test.Pump(1); - total += 1; - length += 1; - } - if (length > 1024) - { - cout << "FAILED:"; - pass = false; - } - else - cout << "passed:"; - cout << " it generated " << length << " bytes in " << long(time(NULL) - t) << " seconds" << endl; - } -#endif - - test.AttachedTransformation()->MessageEnd(); - - if (meter.GetTotalBytes() < total) - { - cout << "FAILED:"; - pass = false; - } - else - cout << "passed:"; - cout << " " << total << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE" << endl; - } - else - cout << "\nNo operating system provided blocking random number generator, skipping test." << endl; - - rng.reset(NULL); -#ifdef NONBLOCKING_RNG_AVAILABLE - try {rng.reset(new NonblockingRng);} - catch (OS_RNG_Err &) {} -#endif - - if (rng.get()) - { - cout << "\nTesting operating system provided nonblocking random number generator...\n\n"; - - MeterFilter meter(new Redirector(TheBitBucket())); - RandomNumberSource test(*rng, 100000, true, new Deflator(new Redirector(meter))); - - if (meter.GetTotalBytes() < 100000) - { - cout << "FAILED:"; - pass = false; - } - else - cout << "passed:"; - cout << " 100000 generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE" << endl; - } - else - cout << "\nNo operating system provided nonblocking random number generator, skipping test." << endl; - - return pass; -} - -#if NO_OS_DEPENDENCE -bool TestAutoSeeded() -{ - return true; -} -#else -bool TestAutoSeeded() -{ - // This tests Auto-Seeding and GenerateIntoBufferedTransformation. - cout << "\nTesting AutoSeeded generator...\n\n"; - - AutoSeededRandomPool prng; - bool generate = true, discard = true; - - MeterFilter meter(new Redirector(TheBitBucket())); - RandomNumberSource test(prng, 100000, true, new Deflator(new Redirector(meter))); - - if (meter.GetTotalBytes() < 100000) - { - cout << "FAILED:"; - generate = false; - } - else - cout << "passed:"; - cout << " 100000 generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE" << endl; - - try - { - prng.DiscardBytes(100000); - } - catch(const Exception&) - { - discard = false; - } - - if (!discard) - cout << "FAILED:"; - else - cout << "passed:"; - cout << " discarded 10000 bytes" << endl; - - return generate && discard; -} -#endif // NO_OS_DEPENDENCE - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -bool TestRDRAND() -{ - RDRAND rdrand; - bool entropy = true, compress = true, discard = true; - static const unsigned int SIZE = 10000; - - if (HasRDRAND()) - { - cout << "\nTesting RDRAND generator...\n\n"; - - MeterFilter meter(new Redirector(TheBitBucket())); - Deflator deflator(new Redirector(meter)); - MaurerRandomnessTest maurer; - - ChannelSwitch chsw; - chsw.AddDefaultRoute(deflator); - chsw.AddDefaultRoute(maurer); - - RandomNumberSource rns(rdrand, SIZE, true, new Redirector(chsw)); - deflator.Flush(true); - - assert(0 == maurer.BytesNeeded()); - const double mv = maurer.GetTestValue(); - if (mv < 0.98f) - { - cout << "FAILED:"; - entropy = false; - } - else - cout << "passed:"; - - const std::streamsize oldp = cout.precision(6); - const std::ios::fmtflags oldf = cout.setf(std::ios::fixed, std::ios::floatfield); - cout << " Maurer Randomness Test returned value " << mv << endl; - cout.precision(oldp); - cout.setf(oldf, std::ios::floatfield); - - if (meter.GetTotalBytes() < SIZE) - { - cout << "FAILED:"; - compress = false; - } - else - cout << "passed:"; - cout << " " << SIZE << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE\n"; - - try - { - rdrand.DiscardBytes(SIZE); - } - catch(const Exception&) - { - discard = false; - } - - if (!discard) - cout << "FAILED:"; - else - cout << "passed:"; - cout << " discarded " << SIZE << " bytes\n"; - } - else - cout << "\nRDRAND generator not available, skipping test.\n"; - - if (!(entropy && compress && discard)) - cout.flush(); - - return entropy && compress && discard; -} -#endif - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -bool TestRDSEED() -{ - RDSEED rdseed; - bool entropy = true, compress = true, discard = true; - static const unsigned int SIZE = 10000; - - if (HasRDSEED()) - { - cout << "\nTesting RDSEED generator...\n\n"; - - MeterFilter meter(new Redirector(TheBitBucket())); - Deflator deflator(new Redirector(meter)); - MaurerRandomnessTest maurer; - - ChannelSwitch chsw; - chsw.AddDefaultRoute(deflator); - chsw.AddDefaultRoute(maurer); - - RandomNumberSource rns(rdseed, SIZE, true, new Redirector(chsw)); - deflator.Flush(true); - - assert(0 == maurer.BytesNeeded()); - const double mv = maurer.GetTestValue(); - if (mv < 0.98f) - { - cout << "FAILED:"; - entropy = false; - } - else - cout << "passed:"; - - const std::streamsize oldp = cout.precision(6); - const std::ios::fmtflags oldf = cout.setf(std::ios::fixed, std::ios::floatfield); - cout << " Maurer Randomness Test returned value " << mv << endl; - cout.precision(oldp); - cout.setf(oldf, std::ios::floatfield); - - if (meter.GetTotalBytes() < SIZE) - { - cout << "FAILED:"; - compress = false; - } - else - cout << "passed:"; - cout << " " << SIZE << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE\n"; - - try - { - rdseed.DiscardBytes(SIZE); - } - catch(const Exception&) - { - discard = false; - } - - if (!discard) - cout << "FAILED:"; - else - cout << "passed:"; - cout << " discarded " << SIZE << " bytes\n"; - } - else - cout << "\nRDSEED generator not available, skipping test.\n"; - - if (!(entropy && compress && discard)) - cout.flush(); - - return entropy && compress && discard; -} -#endif - -// VC50 workaround -typedef auto_ptr apbt; - -class CipherFactory -{ -public: - virtual unsigned int BlockSize() const =0; - virtual unsigned int KeyLength() const =0; - - virtual apbt NewEncryption(const byte *key) const =0; - virtual apbt NewDecryption(const byte *key) const =0; -}; - -template class FixedRoundsCipherFactory : public CipherFactory -{ -public: - FixedRoundsCipherFactory(unsigned int keylen=0) : m_keylen(keylen?keylen:E::DEFAULT_KEYLENGTH) {} - unsigned int BlockSize() const {return E::BLOCKSIZE;} - unsigned int KeyLength() const {return m_keylen;} - - apbt NewEncryption(const byte *key) const - {return apbt(new E(key, m_keylen));} - apbt NewDecryption(const byte *key) const - {return apbt(new D(key, m_keylen));} - - unsigned int m_keylen; -}; - -template class VariableRoundsCipherFactory : public CipherFactory -{ -public: - VariableRoundsCipherFactory(unsigned int keylen=0, unsigned int rounds=0) - : m_keylen(keylen ? keylen : E::DEFAULT_KEYLENGTH), m_rounds(rounds ? rounds : E::DEFAULT_ROUNDS) {} - unsigned int BlockSize() const {return E::BLOCKSIZE;} - unsigned int KeyLength() const {return m_keylen;} - - apbt NewEncryption(const byte *key) const - {return apbt(new E(key, m_keylen, m_rounds));} - apbt NewDecryption(const byte *key) const - {return apbt(new D(key, m_keylen, m_rounds));} - - unsigned int m_keylen, m_rounds; -}; - -bool BlockTransformationTest(const CipherFactory &cg, BufferedTransformation &valdata, unsigned int tuples = 0xffff) -{ - HexEncoder output(new FileSink(cout)); - SecByteBlock plain(cg.BlockSize()), cipher(cg.BlockSize()), out(cg.BlockSize()), outplain(cg.BlockSize()); - SecByteBlock key(cg.KeyLength()); - bool pass=true, fail; - - while (valdata.MaxRetrievable() && tuples--) - { - valdata.Get(key, cg.KeyLength()); - valdata.Get(plain, cg.BlockSize()); - valdata.Get(cipher, cg.BlockSize()); - - apbt transE = cg.NewEncryption(key); - transE->ProcessBlock(plain, out); - fail = memcmp(out, cipher, cg.BlockSize()) != 0; - - apbt transD = cg.NewDecryption(key); - transD->ProcessBlock(out, outplain); - fail=fail || memcmp(outplain, plain, cg.BlockSize()); - - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - output.Put(key, cg.KeyLength()); - cout << " "; - output.Put(outplain, cg.BlockSize()); - cout << " "; - output.Put(out, cg.BlockSize()); - cout << endl; - } - return pass; -} - -class FilterTester : public Unflushable -{ -public: - FilterTester(const byte *validOutput, size_t outputLen) - : validOutput(validOutput), outputLen(outputLen), counter(0), fail(false) {} - void PutByte(byte inByte) - { - if (counter >= outputLen || validOutput[counter] != inByte) - { - std::cerr << "incorrect output " << counter << ", " << (word16)validOutput[counter] << ", " << (word16)inByte << "\n"; - fail = true; - assert(false); - } - counter++; - } - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) - { - CRYPTOPP_UNUSED(messageEnd), CRYPTOPP_UNUSED(blocking); - - while (length--) - FilterTester::PutByte(*inString++); - - if (messageEnd) - if (counter != outputLen) - { - fail = true; - assert(false); - } - - return 0; - } - bool GetResult() - { - return !fail; - } - - const byte *validOutput; - size_t outputLen, counter; - bool fail; -}; - -bool TestFilter(BufferedTransformation &bt, const byte *in, size_t inLen, const byte *out, size_t outLen) -{ - FilterTester *ft; - bt.Attach(ft = new FilterTester(out, outLen)); - - while (inLen) - { - size_t randomLen = GlobalRNG().GenerateWord32(0, (word32)inLen); - bt.Put(in, randomLen); - in += randomLen; - inLen -= randomLen; - } - bt.MessageEnd(); - return ft->GetResult(); -} - -bool ValidateDES() -{ - cout << "\nDES validation suite running...\n\n"; - - FileSource valdata("TestData/descert.dat", true, new HexDecoder); - bool pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata); - - cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n"; - - FileSource valdata1("TestData/3desval.dat", true, new HexDecoder); - pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(), valdata1, 1) && pass; - - return pass; -} - -bool TestModeIV(SymmetricCipher &e, SymmetricCipher &d) -{ - SecByteBlock lastIV, iv(e.IVSize()); - StreamTransformationFilter filter(e, new StreamTransformationFilter(d)); - - // vector_ptr due to Enterprise Analysis finding on the stack based array. - vector_ptr plaintext(20480); - - for (unsigned int i=1; i<20480; i*=2) - { - e.GetNextIV(GlobalRNG(), iv); - if (iv == lastIV) - return false; - else - lastIV = iv; - - e.Resynchronize(iv); - d.Resynchronize(iv); - - unsigned int length = STDMAX(GlobalRNG().GenerateWord32(0, i), (word32)e.MinLastBlockSize()); - GlobalRNG().GenerateBlock(plaintext, length); - - if (!TestFilter(filter, plaintext, length, plaintext, length)) - return false; - } - - return true; -} - -bool ValidateCipherModes() -{ - cout << "\nTesting DES modes...\n\n"; - const byte key[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; - const byte iv[] = {0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}; - const byte plain[] = { // "Now is the time for all " without tailing 0 - 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, - 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, - 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20}; - DESEncryption desE(key); - DESDecryption desD(key); - bool pass=true, fail; - - { - // from FIPS 81 - const byte encrypted[] = { - 0x3f, 0xa4, 0x0e, 0x8a, 0x98, 0x4d, 0x48, 0x15, - 0x6a, 0x27, 0x17, 0x87, 0xab, 0x88, 0x83, 0xf9, - 0x89, 0x3d, 0x51, 0xec, 0x4b, 0x56, 0x3b, 0x53}; - - ECB_Mode_ExternalCipher::Encryption modeE(desE); - fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::NO_PADDING).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "ECB encryption" << endl; - - ECB_Mode_ExternalCipher::Decryption modeD(desD); - fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::NO_PADDING).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "ECB decryption" << endl; - } - { - // from FIPS 81 - const byte encrypted[] = { - 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, - 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F, - 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6}; - - CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::NO_PADDING).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC encryption with no padding" << endl; - - CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); - fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::NO_PADDING).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC decryption with no padding" << endl; - - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC mode IV generation" << endl; - } - { - // generated with Crypto++, matches FIPS 81 - // but has extra 8 bytes as result of padding - const byte encrypted[] = { - 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, - 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F, - 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6, - 0x62, 0xC1, 0x6A, 0x27, 0xE4, 0xFC, 0xF2, 0x77}; - - CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC encryption with PKCS #7 padding" << endl; - - CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC decryption with PKCS #7 padding" << endl; - } - { - // generated with Crypto++ 5.2, matches FIPS 81 - // but has extra 8 bytes as result of padding - const byte encrypted[] = { - 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, - 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F, - 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6, - 0xcf, 0xb7, 0xc7, 0x64, 0x0e, 0x7c, 0xd9, 0xa7}; - - CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::ONE_AND_ZEROS_PADDING).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC encryption with one-and-zeros padding" << endl; - - CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); - fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::ONE_AND_ZEROS_PADDING).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC decryption with one-and-zeros padding" << endl; - } - { - const byte plain_1[] = {'a', 0, 0, 0, 0, 0, 0, 0}; - // generated with Crypto++ - const byte encrypted[] = { - 0x9B, 0x47, 0x57, 0x59, 0xD6, 0x9C, 0xF6, 0xD0}; - - CBC_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE, NULL, StreamTransformationFilter::ZEROS_PADDING).Ref(), - plain_1, 1, encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC encryption with zeros padding" << endl; - - CBC_Mode_ExternalCipher::Decryption modeD(desD, iv); - fail = !TestFilter(StreamTransformationFilter(modeD, NULL, StreamTransformationFilter::ZEROS_PADDING).Ref(), - encrypted, sizeof(encrypted), plain_1, sizeof(plain_1)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC decryption with zeros padding" << endl; - } - { - // generated with Crypto++, matches FIPS 81 - // but with last two blocks swapped as result of CTS - const byte encrypted[] = { - 0xE5, 0xC7, 0xCD, 0xDE, 0x87, 0x2B, 0xF2, 0x7C, - 0x68, 0x37, 0x88, 0x49, 0x9A, 0x7C, 0x05, 0xF6, - 0x43, 0xE9, 0x34, 0x00, 0x8C, 0x38, 0x9C, 0x0F}; - - CBC_CTS_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC encryption with ciphertext stealing (CTS)" << endl; - - CBC_CTS_Mode_ExternalCipher::Decryption modeD(desD, iv); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC decryption with ciphertext stealing (CTS)" << endl; - - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC CTS IV generation" << endl; - } - { - // generated with Crypto++ - const byte decryptionIV[] = {0x4D, 0xD0, 0xAC, 0x8F, 0x47, 0xCF, 0x79, 0xCE}; - const byte encrypted[] = {0x12, 0x34, 0x56}; - - byte stolenIV[8]; - - CBC_CTS_Mode_ExternalCipher::Encryption modeE(desE, iv); - modeE.SetStolenIV(stolenIV); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain, 3, encrypted, sizeof(encrypted)); - fail = memcmp(stolenIV, decryptionIV, 8) != 0 || fail; - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC encryption with ciphertext and IV stealing" << endl; - - CBC_CTS_Mode_ExternalCipher::Decryption modeD(desD, stolenIV); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain, 3); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC decryption with ciphertext and IV stealing" << endl; - } - { - const byte encrypted[] = { // from FIPS 81 - 0xF3,0x09,0x62,0x49,0xC7,0xF4,0x6E,0x51, - 0xA6,0x9E,0x83,0x9B,0x1A,0x92,0xF7,0x84, - 0x03,0x46,0x71,0x33,0x89,0x8E,0xA6,0x22}; - - CFB_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CFB encryption" << endl; - - CFB_Mode_ExternalCipher::Decryption modeD(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CFB decryption" << endl; - - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CFB mode IV generation" << endl; - } - { - const byte plain_2[] = { // "Now is the." without tailing 0 - 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,0x68,0x65}; - const byte encrypted[] = { // from FIPS 81 - 0xf3,0x1f,0xda,0x07,0x01,0x14,0x62,0xee,0x18,0x7f}; - - CFB_Mode_ExternalCipher::Encryption modeE(desE, iv, 1); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain_2, sizeof(plain_2), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CFB (8-bit feedback) encryption" << endl; - - CFB_Mode_ExternalCipher::Decryption modeD(desE, iv, 1); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain_2, sizeof(plain_2)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CFB (8-bit feedback) decryption" << endl; - - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CFB (8-bit feedback) IV generation" << endl; - } - { - const byte encrypted[] = { // from Eric Young's libdes - 0xf3,0x09,0x62,0x49,0xc7,0xf4,0x6e,0x51, - 0x35,0xf2,0x4a,0x24,0x2e,0xeb,0x3d,0x3f, - 0x3d,0x6d,0x5b,0xe3,0x25,0x5a,0xf8,0xc3}; - - OFB_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "OFB encryption" << endl; - - OFB_Mode_ExternalCipher::Decryption modeD(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "OFB decryption" << endl; - - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "OFB IV generation" << endl; - } - { - const byte encrypted[] = { // generated with Crypto++ - 0xF3, 0x09, 0x62, 0x49, 0xC7, 0xF4, 0x6E, 0x51, - 0x16, 0x3A, 0x8C, 0xA0, 0xFF, 0xC9, 0x4C, 0x27, - 0xFA, 0x2F, 0x80, 0xF4, 0x80, 0xB8, 0x6F, 0x75}; - - CTR_Mode_ExternalCipher::Encryption modeE(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeE).Ref(), - plain, sizeof(plain), encrypted, sizeof(encrypted)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "Counter Mode encryption" << endl; - - CTR_Mode_ExternalCipher::Decryption modeD(desE, iv); - fail = !TestFilter(StreamTransformationFilter(modeD).Ref(), - encrypted, sizeof(encrypted), plain, sizeof(plain)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "Counter Mode decryption" << endl; - - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "Counter Mode IV generation" << endl; - } - { - const byte plain_3[] = { // "7654321 Now is the time for " - 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20, - 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, - 0x66, 0x6f, 0x72, 0x20}; - const byte mac1[] = { // from FIPS 113 - 0xf1, 0xd3, 0x0f, 0x68, 0x49, 0x31, 0x2c, 0xa4}; - const byte mac2[] = { // generated with Crypto++ - 0x35, 0x80, 0xC5, 0xC4, 0x6B, 0x81, 0x24, 0xE2}; - - CBC_MAC cbcmac(key); - HashFilter cbcmacFilter(cbcmac); - fail = !TestFilter(cbcmacFilter, plain_3, sizeof(plain_3), mac1, sizeof(mac1)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "CBC MAC" << endl; - - DMAC dmac(key); - HashFilter dmacFilter(dmac); - fail = !TestFilter(dmacFilter, plain_3, sizeof(plain_3), mac2, sizeof(mac2)); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "DMAC" << endl; - } - { - CTR_Mode::Encryption modeE(plain, 16, plain); - CTR_Mode::Decryption modeD(plain, 16, plain); - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "AES CTR Mode" << endl; - } - { - OFB_Mode::Encryption modeE(plain, 16, plain); - OFB_Mode::Decryption modeD(plain, 16, plain); - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "AES OFB Mode" << endl; - } - { - CFB_Mode::Encryption modeE(plain, 16, plain); - CFB_Mode::Decryption modeD(plain, 16, plain); - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "AES CFB Mode" << endl; - } - { - CBC_Mode::Encryption modeE(plain, 16, plain); - CBC_Mode::Decryption modeD(plain, 16, plain); - fail = !TestModeIV(modeE, modeD); - pass = pass && !fail; - cout << (fail ? "FAILED " : "passed ") << "AES CBC Mode" << endl; - } - - return pass; -} - -bool ValidateIDEA() -{ - cout << "\nIDEA validation suite running...\n\n"; - - FileSource valdata("TestData/ideaval.dat", true, new HexDecoder); - return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -} - -bool ValidateSAFER() -{ - cout << "\nSAFER validation suite running...\n\n"; - - FileSource valdata("TestData/saferval.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(VariableRoundsCipherFactory(8,6), valdata, 4) && pass; - pass = BlockTransformationTest(VariableRoundsCipherFactory(16,12), valdata, 4) && pass; - pass = BlockTransformationTest(VariableRoundsCipherFactory(8,6), valdata, 4) && pass; - pass = BlockTransformationTest(VariableRoundsCipherFactory(16,10), valdata, 4) && pass; - return pass; -} - -bool ValidateRC2() -{ - cout << "\nRC2 validation suite running...\n\n"; - - FileSource valdata("TestData/rc2val.dat", true, new HexDecoder); - HexEncoder output(new FileSink(cout)); - SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE); - SecByteBlock key(128); - bool pass=true, fail; - - while (valdata.MaxRetrievable()) - { - byte keyLen, effectiveLen; - - valdata.Get(keyLen); - valdata.Get(effectiveLen); - valdata.Get(key, keyLen); - valdata.Get(plain, RC2Encryption::BLOCKSIZE); - valdata.Get(cipher, RC2Encryption::BLOCKSIZE); - - apbt transE(new RC2Encryption(key, keyLen, effectiveLen)); - transE->ProcessBlock(plain, out); - fail = memcmp(out, cipher, RC2Encryption::BLOCKSIZE) != 0; - - apbt transD(new RC2Decryption(key, keyLen, effectiveLen)); - transD->ProcessBlock(out, outplain); - fail=fail || memcmp(outplain, plain, RC2Encryption::BLOCKSIZE); - - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - output.Put(key, keyLen); - cout << " "; - output.Put(outplain, RC2Encryption::BLOCKSIZE); - cout << " "; - output.Put(out, RC2Encryption::BLOCKSIZE); - cout << endl; - } - return pass; -} - -bool ValidateARC4() -{ - unsigned char Key0[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; - unsigned char Input0[]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; - unsigned char Output0[] = {0x75,0xb7,0x87,0x80,0x99,0xe0,0xc5,0x96}; - - unsigned char Key1[]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; - unsigned char Input1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - unsigned char Output1[]={0x74,0x94,0xc2,0xe7,0x10,0x4b,0x08,0x79}; - - unsigned char Key2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - unsigned char Input2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - unsigned char Output2[]={0xde,0x18,0x89,0x41,0xa3,0x37,0x5d,0x3a}; - - unsigned char Key3[]={0xef,0x01,0x23,0x45}; - unsigned char Input3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - unsigned char Output3[]={0xd6,0xa1,0x41,0xa7,0xec,0x3c,0x38,0xdf,0xbd,0x61}; - - unsigned char Key4[]={ 0x01,0x23,0x45,0x67,0x89,0xab, 0xcd,0xef }; - unsigned char Input4[] = - {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01}; - unsigned char Output4[]= { - 0x75,0x95,0xc3,0xe6,0x11,0x4a,0x09,0x78,0x0c,0x4a,0xd4, - 0x52,0x33,0x8e,0x1f,0xfd,0x9a,0x1b,0xe9,0x49,0x8f, - 0x81,0x3d,0x76,0x53,0x34,0x49,0xb6,0x77,0x8d,0xca, - 0xd8,0xc7,0x8a,0x8d,0x2b,0xa9,0xac,0x66,0x08,0x5d, - 0x0e,0x53,0xd5,0x9c,0x26,0xc2,0xd1,0xc4,0x90,0xc1, - 0xeb,0xbe,0x0c,0xe6,0x6d,0x1b,0x6b,0x1b,0x13,0xb6, - 0xb9,0x19,0xb8,0x47,0xc2,0x5a,0x91,0x44,0x7a,0x95, - 0xe7,0x5e,0x4e,0xf1,0x67,0x79,0xcd,0xe8,0xbf,0x0a, - 0x95,0x85,0x0e,0x32,0xaf,0x96,0x89,0x44,0x4f,0xd3, - 0x77,0x10,0x8f,0x98,0xfd,0xcb,0xd4,0xe7,0x26,0x56, - 0x75,0x00,0x99,0x0b,0xcc,0x7e,0x0c,0xa3,0xc4,0xaa, - 0xa3,0x04,0xa3,0x87,0xd2,0x0f,0x3b,0x8f,0xbb,0xcd, - 0x42,0xa1,0xbd,0x31,0x1d,0x7a,0x43,0x03,0xdd,0xa5, - 0xab,0x07,0x88,0x96,0xae,0x80,0xc1,0x8b,0x0a,0xf6, - 0x6d,0xff,0x31,0x96,0x16,0xeb,0x78,0x4e,0x49,0x5a, - 0xd2,0xce,0x90,0xd7,0xf7,0x72,0xa8,0x17,0x47,0xb6, - 0x5f,0x62,0x09,0x3b,0x1e,0x0d,0xb9,0xe5,0xba,0x53, - 0x2f,0xaf,0xec,0x47,0x50,0x83,0x23,0xe6,0x71,0x32, - 0x7d,0xf9,0x44,0x44,0x32,0xcb,0x73,0x67,0xce,0xc8, - 0x2f,0x5d,0x44,0xc0,0xd0,0x0b,0x67,0xd6,0x50,0xa0, - 0x75,0xcd,0x4b,0x70,0xde,0xdd,0x77,0xeb,0x9b,0x10, - 0x23,0x1b,0x6b,0x5b,0x74,0x13,0x47,0x39,0x6d,0x62, - 0x89,0x74,0x21,0xd4,0x3d,0xf9,0xb4,0x2e,0x44,0x6e, - 0x35,0x8e,0x9c,0x11,0xa9,0xb2,0x18,0x4e,0xcb,0xef, - 0x0c,0xd8,0xe7,0xa8,0x77,0xef,0x96,0x8f,0x13,0x90, - 0xec,0x9b,0x3d,0x35,0xa5,0x58,0x5c,0xb0,0x09,0x29, - 0x0e,0x2f,0xcd,0xe7,0xb5,0xec,0x66,0xd9,0x08,0x4b, - 0xe4,0x40,0x55,0xa6,0x19,0xd9,0xdd,0x7f,0xc3,0x16, - 0x6f,0x94,0x87,0xf7,0xcb,0x27,0x29,0x12,0x42,0x64, - 0x45,0x99,0x85,0x14,0xc1,0x5d,0x53,0xa1,0x8c,0x86, - 0x4c,0xe3,0xa2,0xb7,0x55,0x57,0x93,0x98,0x81,0x26, - 0x52,0x0e,0xac,0xf2,0xe3,0x06,0x6e,0x23,0x0c,0x91, - 0xbe,0xe4,0xdd,0x53,0x04,0xf5,0xfd,0x04,0x05,0xb3, - 0x5b,0xd9,0x9c,0x73,0x13,0x5d,0x3d,0x9b,0xc3,0x35, - 0xee,0x04,0x9e,0xf6,0x9b,0x38,0x67,0xbf,0x2d,0x7b, - 0xd1,0xea,0xa5,0x95,0xd8,0xbf,0xc0,0x06,0x6f,0xf8, - 0xd3,0x15,0x09,0xeb,0x0c,0x6c,0xaa,0x00,0x6c,0x80, - 0x7a,0x62,0x3e,0xf8,0x4c,0x3d,0x33,0xc1,0x95,0xd2, - 0x3e,0xe3,0x20,0xc4,0x0d,0xe0,0x55,0x81,0x57,0xc8, - 0x22,0xd4,0xb8,0xc5,0x69,0xd8,0x49,0xae,0xd5,0x9d, - 0x4e,0x0f,0xd7,0xf3,0x79,0x58,0x6b,0x4b,0x7f,0xf6, - 0x84,0xed,0x6a,0x18,0x9f,0x74,0x86,0xd4,0x9b,0x9c, - 0x4b,0xad,0x9b,0xa2,0x4b,0x96,0xab,0xf9,0x24,0x37, - 0x2c,0x8a,0x8f,0xff,0xb1,0x0d,0x55,0x35,0x49,0x00, - 0xa7,0x7a,0x3d,0xb5,0xf2,0x05,0xe1,0xb9,0x9f,0xcd, - 0x86,0x60,0x86,0x3a,0x15,0x9a,0xd4,0xab,0xe4,0x0f, - 0xa4,0x89,0x34,0x16,0x3d,0xdd,0xe5,0x42,0xa6,0x58, - 0x55,0x40,0xfd,0x68,0x3c,0xbf,0xd8,0xc0,0x0f,0x12, - 0x12,0x9a,0x28,0x4d,0xea,0xcc,0x4c,0xde,0xfe,0x58, - 0xbe,0x71,0x37,0x54,0x1c,0x04,0x71,0x26,0xc8,0xd4, - 0x9e,0x27,0x55,0xab,0x18,0x1a,0xb7,0xe9,0x40,0xb0, - 0xc0}; - - // VC60 workaround: auto_ptr lacks reset() - member_ptr arc4; - bool pass=true, fail; - unsigned int i; - - cout << "\nARC4 validation suite running...\n\n"; - - arc4.reset(new Weak::ARC4(Key0, sizeof(Key0))); - arc4->ProcessString(Input0, sizeof(Input0)); - fail = memcmp(Input0, Output0, sizeof(Input0)) != 0; - cout << (fail ? "FAILED" : "passed") << " Test 0" << endl; - pass = pass && !fail; - - arc4.reset(new Weak::ARC4(Key1, sizeof(Key1))); - arc4->ProcessString(Key1, Input1, sizeof(Key1)); - fail = memcmp(Output1, Key1, sizeof(Key1)) != 0; - cout << (fail ? "FAILED" : "passed") << " Test 1" << endl; - pass = pass && !fail; - - arc4.reset(new Weak::ARC4(Key2, sizeof(Key2))); - for (i=0, fail=false; iProcessByte(Input2[i]) != Output2[i]) - fail = true; - cout << (fail ? "FAILED" : "passed") << " Test 2" << endl; - pass = pass && !fail; - - arc4.reset(new Weak::ARC4(Key3, sizeof(Key3))); - for (i=0, fail=false; iProcessByte(Input3[i]) != Output3[i]) - fail = true; - cout << (fail ? "FAILED" : "passed") << " Test 3" << endl; - pass = pass && !fail; - - arc4.reset(new Weak::ARC4(Key4, sizeof(Key4))); - for (i=0, fail=false; iProcessByte(Input4[i]) != Output4[i]) - fail = true; - cout << (fail ? "FAILED" : "passed") << " Test 4" << endl; - pass = pass && !fail; - - return pass; -} - -bool ValidateRC5() -{ - cout << "\nRC5 validation suite running...\n\n"; - - FileSource valdata("TestData/rc5val.dat", true, new HexDecoder); - return BlockTransformationTest(VariableRoundsCipherFactory(16, 12), valdata); -} - -bool ValidateRC6() -{ - cout << "\nRC6 validation suite running...\n\n"; - - FileSource valdata("TestData/rc6val.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 2) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 2) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; - return pass; -} - -bool ValidateMARS() -{ - cout << "\nMARS validation suite running...\n\n"; - - FileSource valdata("TestData/marsval.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; - return pass; -} - -bool ValidateRijndael() -{ - cout << "\nRijndael (AES) validation suite running...\n\n"; - - FileSource valdata("TestData/rijndael.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; - pass = RunTestDataFile("TestVectors/aes.txt") && pass; - return pass; -} - -bool ValidateTwofish() -{ - cout << "\nTwofish validation suite running...\n\n"; - - FileSource valdata("TestData/twofishv.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; - return pass; -} - -bool ValidateSerpent() -{ - cout << "\nSerpent validation suite running...\n\n"; - - FileSource valdata("TestData/serpentv.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 5) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 4) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 3) && pass; - return pass; -} - -bool ValidateBlowfish() -{ - cout << "\nBlowfish validation suite running...\n\n"; - - HexEncoder output(new FileSink(cout)); - const char *key[]={"abcdefghijklmnopqrstuvwxyz", "Who is John Galt?"}; - byte *plain[]={(byte *)"BLOWFISH", (byte *)"\xfe\xdc\xba\x98\x76\x54\x32\x10"}; - byte *cipher[]={(byte *)"\x32\x4e\xd0\xfe\xf4\x13\xa2\x03", (byte *)"\xcc\x91\x73\x2b\x80\x22\xf6\x84"}; - byte out[8], outplain[8]; - bool pass=true, fail; - - for (int i=0; i<2; i++) - { - ECB_Mode::Encryption enc((byte *)key[i], strlen(key[i])); - enc.ProcessData(out, plain[i], 8); - fail = memcmp(out, cipher[i], 8) != 0; - - ECB_Mode::Decryption dec((byte *)key[i], strlen(key[i])); - dec.ProcessData(outplain, cipher[i], 8); - fail = fail || memcmp(outplain, plain[i], 8); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << '\"' << key[i] << '\"'; - for (int j=0; j<(signed int)(30-strlen(key[i])); j++) - cout << ' '; - output.Put(outplain, 8); - cout << " "; - output.Put(out, 8); - cout << endl; - } - return pass; -} - -bool ValidateThreeWay() -{ - cout << "\n3-WAY validation suite running...\n\n"; - - FileSource valdata("TestData/3wayval.dat", true, new HexDecoder); - return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -} - -bool ValidateGOST() -{ - cout << "\nGOST validation suite running...\n\n"; - - FileSource valdata("TestData/gostval.dat", true, new HexDecoder); - return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -} - -bool ValidateSHARK() -{ - cout << "\nSHARK validation suite running...\n\n"; - - FileSource valdata("TestData/sharkval.dat", true, new HexDecoder); - return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -} - -bool ValidateCAST() -{ - bool pass = true; - - cout << "\nCAST-128 validation suite running...\n\n"; - - FileSource val128("TestData/cast128v.dat", true, new HexDecoder); - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), val128, 1) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(10), val128, 1) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(5), val128, 1) && pass; - - cout << "\nCAST-256 validation suite running...\n\n"; - - FileSource val256("TestData/cast256v.dat", true, new HexDecoder); - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), val256, 1) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), val256, 1) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), val256, 1) && pass; - - return pass; -} - -bool ValidateSquare() -{ - cout << "\nSquare validation suite running...\n\n"; - - FileSource valdata("TestData/squareva.dat", true, new HexDecoder); - return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -} - -bool ValidateSKIPJACK() -{ - cout << "\nSKIPJACK validation suite running...\n\n"; - - FileSource valdata("TestData/skipjack.dat", true, new HexDecoder); - return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -} - -bool ValidateSEAL() -{ - byte input[] = {0x37,0xa0,0x05,0x95,0x9b,0x84,0xc4,0x9c,0xa4,0xbe,0x1e,0x05,0x06,0x73,0x53,0x0f,0x5f,0xb0,0x97,0xfd,0xf6,0xa1,0x3f,0xbd,0x6c,0x2c,0xde,0xcd,0x81,0xfd,0xee,0x7c}; - byte output[32]; - byte key[] = {0x67, 0x45, 0x23, 0x01, 0xef, 0xcd, 0xab, 0x89, 0x98, 0xba, 0xdc, 0xfe, 0x10, 0x32, 0x54, 0x76, 0xc3, 0xd2, 0xe1, 0xf0}; - byte iv[] = {0x01, 0x35, 0x77, 0xaf}; - - cout << "\nSEAL validation suite running...\n\n"; - - SEAL<>::Encryption seal(key, sizeof(key), iv); - unsigned int size = sizeof(input); - bool pass = true; - - memset(output, 1, size); - seal.ProcessString(output, input, size); - for (unsigned int i=0; i(16), valdata, 4) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(64), valdata, 10) && pass; - return pass; -} - -bool ValidateCamellia() -{ - cout << "\nCamellia validation suite running...\n\n"; - - bool pass = true; - FileSource valdata("TestData/camellia.dat", true, new HexDecoder); - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 15) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 15) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 15) && pass; - return pass; -} - -bool ValidateSalsa() -{ - cout << "\nSalsa validation suite running...\n"; - - return RunTestDataFile("TestVectors/salsa.txt"); -} - -bool ValidateSosemanuk() -{ - cout << "\nSosemanuk validation suite running...\n"; - return RunTestDataFile("TestVectors/sosemanuk.txt"); -} - -bool ValidateVMAC() -{ - cout << "\nVMAC validation suite running...\n"; - return RunTestDataFile("TestVectors/vmac.txt"); -} - -bool ValidateCCM() -{ - cout << "\nAES/CCM validation suite running...\n"; - return RunTestDataFile("TestVectors/ccm.txt"); -} - -bool ValidateGCM() -{ - cout << "\nAES/GCM validation suite running...\n"; - cout << "\n2K tables:"; - bool pass = RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)2048)); - cout << "\n64K tables:"; - return RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)64*1024)) && pass; -} - -bool ValidateCMAC() -{ - cout << "\nCMAC validation suite running...\n"; - return RunTestDataFile("TestVectors/cmac.txt"); -} diff --git a/external/crypto++-5.6.3/validat2.cpp b/external/crypto++-5.6.3/validat2.cpp deleted file mode 100644 index b13d9bfdc..000000000 --- a/external/crypto++-5.6.3/validat2.cpp +++ /dev/null @@ -1,852 +0,0 @@ -// validat2.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 - -#include "cryptlib.h" -#include "pubkey.h" -#include "gfpcrypt.h" -#include "eccrypto.h" -#include "blumshub.h" -#include "filters.h" -#include "files.h" -#include "rsa.h" -#include "md2.h" -#include "elgamal.h" -#include "nr.h" -#include "dsa.h" -#include "dh.h" -#include "mqv.h" -#include "luc.h" -#include "xtrcrypt.h" -#include "rabin.h" -#include "rw.h" -#include "eccrypto.h" -#include "integer.h" -#include "gf2n.h" -#include "ecp.h" -#include "ec2n.h" -#include "asn.h" -#include "rng.h" -#include "hex.h" -#include "oids.h" -#include "esign.h" -#include "osrng.h" -#include "smartptr.h" - -#include -#include -#include - -#include "validate.h" - -// Aggressive stack checking with VS2005 SP1 and above. -#if (CRYPTOPP_MSC_VERSION >= 1410) -# pragma strict_gs_check (on) -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -class FixedRNG : public RandomNumberGenerator -{ -public: - FixedRNG(BufferedTransformation &source) : m_source(source) {} - - void GenerateBlock(byte *output, size_t size) - { - m_source.Get(output, size); - } - -private: - BufferedTransformation &m_source; -}; - -bool ValidateBBS() -{ - cout << "\nBlumBlumShub validation suite running...\n\n"; - - Integer p("212004934506826557583707108431463840565872545889679278744389317666981496005411448865750399674653351"); - Integer q("100677295735404212434355574418077394581488455772477016953458064183204108039226017738610663984508231"); - Integer seed("63239752671357255800299643604761065219897634268887145610573595874544114193025997412441121667211431"); - BlumBlumShub bbs(p, q, seed); - bool pass = true, fail; - int j; - - const byte output1[] = { - 0x49,0xEA,0x2C,0xFD,0xB0,0x10,0x64,0xA0,0xBB,0xB9, - 0x2A,0xF1,0x01,0xDA,0xC1,0x8A,0x94,0xF7,0xB7,0xCE}; - const byte output2[] = { - 0x74,0x45,0x48,0xAE,0xAC,0xB7,0x0E,0xDF,0xAF,0xD7, - 0xD5,0x0E,0x8E,0x29,0x83,0x75,0x6B,0x27,0x46,0xA1}; - - byte buf[20]; - - bbs.GenerateBlock(buf, 20); - fail = memcmp(output1, buf, 20) != 0; - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - for (j=0;j<20;j++) - cout << setw(2) << setfill('0') << hex << (int)buf[j]; - cout << endl; - - bbs.Seek(10); - bbs.GenerateBlock(buf, 10); - fail = memcmp(output1+10, buf, 10) != 0; - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - for (j=0;j<10;j++) - cout << setw(2) << setfill('0') << hex << (int)buf[j]; - cout << endl; - - bbs.Seek(1234567); - bbs.GenerateBlock(buf, 20); - fail = memcmp(output2, buf, 20) != 0; - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - for (j=0;j<20;j++) - cout << setw(2) << setfill('0') << hex << (int)buf[j]; - cout << endl; - - return pass; -} - -bool SignatureValidate(PK_Signer &priv, PK_Verifier &pub, bool thorough = false) -{ - bool pass = true, fail; - - fail = !pub.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2) || !priv.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "signature key validation\n"; - - const byte *message = (byte *)"test message"; - const int messageLen = 12; - - SecByteBlock signature(priv.MaxSignatureLength()); - size_t signatureLength = priv.SignMessage(GlobalRNG(), message, messageLen, signature); - fail = !pub.VerifyMessage(message, messageLen, signature, signatureLength); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "signature and verification\n"; - - ++signature[0]; - fail = pub.VerifyMessage(message, messageLen, signature, signatureLength); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "checking invalid signature" << endl; - - if (priv.MaxRecoverableLength() > 0) - { - signatureLength = priv.SignMessageWithRecovery(GlobalRNG(), message, messageLen, NULL, 0, signature); - SecByteBlock recovered(priv.MaxRecoverableLengthFromSignatureLength(signatureLength)); - DecodingResult result = pub.RecoverMessage(recovered, NULL, 0, signature, signatureLength); - fail = !(result.isValidCoding && result.messageLength == messageLen && memcmp(recovered, message, messageLen) == 0); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "signature and verification with recovery" << endl; - - ++signature[0]; - result = pub.RecoverMessage(recovered, NULL, 0, signature, signatureLength); - fail = result.isValidCoding; - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "recovery with invalid signature" << endl; - } - - return pass; -} - -bool CryptoSystemValidate(PK_Decryptor &priv, PK_Encryptor &pub, bool thorough = false) -{ - bool pass = true, fail; - - fail = !pub.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2) || !priv.GetMaterial().Validate(GlobalRNG(), thorough ? 3 : 2); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "cryptosystem key validation\n"; - - const byte *message = (byte *)"test message"; - const int messageLen = 12; - SecByteBlock ciphertext(priv.CiphertextLength(messageLen)); - SecByteBlock plaintext(priv.MaxPlaintextLength(ciphertext.size())); - - pub.Encrypt(GlobalRNG(), message, messageLen, ciphertext); - fail = priv.Decrypt(GlobalRNG(), ciphertext, priv.CiphertextLength(messageLen), plaintext) != DecodingResult(messageLen); - fail = fail || memcmp(message, plaintext, messageLen); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "encryption and decryption\n"; - - return pass; -} - -bool SimpleKeyAgreementValidate(SimpleKeyAgreementDomain &d) -{ - if (d.GetCryptoParameters().Validate(GlobalRNG(), 3)) - cout << "passed simple key agreement domain parameters validation" << endl; - else - { - cout << "FAILED simple key agreement domain parameters invalid" << endl; - return false; - } - - SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength()); - SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength()); - SecByteBlock val1(d.AgreedValueLength()), val2(d.AgreedValueLength()); - - d.GenerateKeyPair(GlobalRNG(), priv1, pub1); - d.GenerateKeyPair(GlobalRNG(), priv2, pub2); - - memset(val1.begin(), 0x10, val1.size()); - memset(val2.begin(), 0x11, val2.size()); - - if (!(d.Agree(val1, priv1, pub2) && d.Agree(val2, priv2, pub1))) - { - cout << "FAILED simple key agreement failed" << endl; - return false; - } - - if (memcmp(val1.begin(), val2.begin(), d.AgreedValueLength())) - { - cout << "FAILED simple agreed values not equal" << endl; - return false; - } - - cout << "passed simple key agreement" << endl; - return true; -} - -bool AuthenticatedKeyAgreementValidate(AuthenticatedKeyAgreementDomain &d) -{ - if (d.GetCryptoParameters().Validate(GlobalRNG(), 3)) - cout << "passed authenticated key agreement domain parameters validation" << endl; - else - { - cout << "FAILED authenticated key agreement domain parameters invalid" << endl; - return false; - } - - SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength()); - SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength()); - SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength()); - SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength()); - SecByteBlock val1(d.AgreedValueLength()), val2(d.AgreedValueLength()); - - d.GenerateStaticKeyPair(GlobalRNG(), spriv1, spub1); - d.GenerateStaticKeyPair(GlobalRNG(), spriv2, spub2); - d.GenerateEphemeralKeyPair(GlobalRNG(), epriv1, epub1); - d.GenerateEphemeralKeyPair(GlobalRNG(), epriv2, epub2); - - memset(val1.begin(), 0x10, val1.size()); - memset(val2.begin(), 0x11, val2.size()); - - if (!(d.Agree(val1, spriv1, epriv1, spub2, epub2) && d.Agree(val2, spriv2, epriv2, spub1, epub1))) - { - cout << "FAILED authenticated key agreement failed" << endl; - return false; - } - - if (memcmp(val1.begin(), val2.begin(), d.AgreedValueLength())) - { - cout << "FAILED authenticated agreed values not equal" << endl; - return false; - } - - cout << "passed authenticated key agreement" << endl; - return true; -} - -bool ValidateRSA() -{ - cout << "\nRSA validation suite running...\n\n"; - - byte out[100], outPlain[100]; - bool pass = true, fail; - - { - const char *plain = "Everyone gets Friday off."; - static const byte signature[] = - "\x05\xfa\x6a\x81\x2f\xc7\xdf\x8b\xf4\xf2\x54\x25\x09\xe0\x3e\x84" - "\x6e\x11\xb9\xc6\x20\xbe\x20\x09\xef\xb4\x40\xef\xbc\xc6\x69\x21" - "\x69\x94\xac\x04\xf3\x41\xb5\x7d\x05\x20\x2d\x42\x8f\xb2\xa2\x7b" - "\x5c\x77\xdf\xd9\xb1\x5b\xfc\x3d\x55\x93\x53\x50\x34\x10\xc1\xe1"; - - FileSource keys("TestData/rsa512a.dat", true, new HexDecoder); - Weak::RSASSA_PKCS1v15_MD2_Signer rsaPriv(keys); - Weak::RSASSA_PKCS1v15_MD2_Verifier rsaPub(rsaPriv); - - size_t signatureLength = rsaPriv.SignMessage(GlobalRNG(), (byte *)plain, strlen(plain), out); - fail = memcmp(signature, out, 64) != 0; - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "signature check against test vector\n"; - - fail = !rsaPub.VerifyMessage((byte *)plain, strlen(plain), out, signatureLength); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "verification check against test vector\n"; - - out[10]++; - fail = rsaPub.VerifyMessage((byte *)plain, strlen(plain), out, signatureLength); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "invalid signature verification\n"; - } - { - FileSource keys("TestData/rsa1024.dat", true, new HexDecoder); - RSAES_PKCS1v15_Decryptor rsaPriv(keys); - RSAES_PKCS1v15_Encryptor rsaPub(rsaPriv); - - pass = CryptoSystemValidate(rsaPriv, rsaPub) && pass; - } - { - RSAES >::Decryptor rsaPriv(GlobalRNG(), 512); - RSAES >::Encryptor rsaPub(rsaPriv); - - pass = CryptoSystemValidate(rsaPriv, rsaPub) && pass; - } - { - byte *plain = (byte *) - "\x54\x85\x9b\x34\x2c\x49\xea\x2a"; - static const byte encrypted[] = - "\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a" - "\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4" - "\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52" - "\x62\x51"; - static const byte oaepSeed[] = - "\xaa\xfd\x12\xf6\x59\xca\xe6\x34\x89\xb4\x79\xe5\x07\x6d\xde\xc2" - "\xf0\x6c\xb5\x8f"; - ByteQueue bq; - bq.Put(oaepSeed, 20); - FixedRNG rng(bq); - - FileSource privFile("TestData/rsa400pv.dat", true, new HexDecoder); - FileSource pubFile("TestData/rsa400pb.dat", true, new HexDecoder); - RSAES_OAEP_SHA_Decryptor rsaPriv; - rsaPriv.AccessKey().BERDecodePrivateKey(privFile, false, 0); - RSAES_OAEP_SHA_Encryptor rsaPub(pubFile); - - memset(out, 0, 50); - memset(outPlain, 0, 8); - rsaPub.Encrypt(rng, plain, 8, out); - DecodingResult result = rsaPriv.FixedLengthDecrypt(GlobalRNG(), encrypted, outPlain); - fail = !result.isValidCoding || (result.messageLength!=8) || memcmp(out, encrypted, 50) || memcmp(plain, outPlain, 8); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "PKCS 2.0 encryption and decryption\n"; - } - - return pass; -} - -bool ValidateDH() -{ - cout << "\nDH validation suite running...\n\n"; - - FileSource f("TestData/dh1024.dat", true, new HexDecoder()); - DH dh(f); - return SimpleKeyAgreementValidate(dh); -} - -bool ValidateMQV() -{ - cout << "\nMQV validation suite running...\n\n"; - - FileSource f("TestData/mqv1024.dat", true, new HexDecoder()); - MQV mqv(f); - return AuthenticatedKeyAgreementValidate(mqv); -} - -bool ValidateLUC_DH() -{ - cout << "\nLUC-DH validation suite running...\n\n"; - - FileSource f("TestData/lucd512.dat", true, new HexDecoder()); - LUC_DH dh(f); - return SimpleKeyAgreementValidate(dh); -} - -bool ValidateXTR_DH() -{ - cout << "\nXTR-DH validation suite running...\n\n"; - - FileSource f("TestData/xtrdh171.dat", true, new HexDecoder()); - XTR_DH dh(f); - return SimpleKeyAgreementValidate(dh); -} - -bool ValidateElGamal() -{ - cout << "\nElGamal validation suite running...\n\n"; - bool pass = true; - { - FileSource fc("TestData/elgc1024.dat", true, new HexDecoder); - ElGamalDecryptor privC(fc); - ElGamalEncryptor pubC(privC); - privC.AccessKey().Precompute(); - ByteQueue queue; - privC.AccessKey().SavePrecomputation(queue); - privC.AccessKey().LoadPrecomputation(queue); - - pass = CryptoSystemValidate(privC, pubC) && pass; - } - return pass; -} - -bool ValidateDLIES() -{ - cout << "\nDLIES validation suite running...\n\n"; - bool pass = true; - { - FileSource fc("TestData/dlie1024.dat", true, new HexDecoder); - DLIES<>::Decryptor privC(fc); - DLIES<>::Encryptor pubC(privC); - pass = CryptoSystemValidate(privC, pubC) && pass; - } - { - cout << "Generating new encryption key..." << endl; - DLIES<>::GroupParameters gp; - gp.GenerateRandomWithKeySize(GlobalRNG(), 128); - DLIES<>::Decryptor decryptor; - decryptor.AccessKey().GenerateRandom(GlobalRNG(), gp); - DLIES<>::Encryptor encryptor(decryptor); - - pass = CryptoSystemValidate(decryptor, encryptor) && pass; - } - return pass; -} - -bool ValidateNR() -{ - cout << "\nNR validation suite running...\n\n"; - bool pass = true; - { - FileSource f("TestData/nr2048.dat", true, new HexDecoder); - NR::Signer privS(f); - privS.AccessKey().Precompute(); - NR::Verifier pubS(privS); - - pass = SignatureValidate(privS, pubS) && pass; - } - { - cout << "Generating new signature key..." << endl; - NR::Signer privS(GlobalRNG(), 256); - NR::Verifier pubS(privS); - - pass = SignatureValidate(privS, pubS) && pass; - } - return pass; -} - -bool ValidateDSA(bool thorough) -{ - cout << "\nDSA validation suite running...\n\n"; - - bool pass = true; - FileSource fs1("TestData/dsa1024.dat", true, new HexDecoder()); - DSA::Signer priv(fs1); - DSA::Verifier pub(priv); - FileSource fs2("TestData/dsa1024b.dat", true, new HexDecoder()); - DSA::Verifier pub1(fs2); - assert(pub.GetKey() == pub1.GetKey()); - pass = SignatureValidate(priv, pub, thorough) && pass; - pass = RunTestDataFile("TestVectors/dsa.txt", g_nullNameValuePairs, thorough) && pass; - - return pass; -} - -bool ValidateLUC() -{ - cout << "\nLUC validation suite running...\n\n"; - bool pass=true; - - { - FileSource f("TestData/luc1024.dat", true, new HexDecoder); - LUCSSA_PKCS1v15_SHA_Signer priv(f); - LUCSSA_PKCS1v15_SHA_Verifier pub(priv); - pass = SignatureValidate(priv, pub) && pass; - } - { - LUCES_OAEP_SHA_Decryptor priv(GlobalRNG(), 512); - LUCES_OAEP_SHA_Encryptor pub(priv); - pass = CryptoSystemValidate(priv, pub) && pass; - } - return pass; -} - -bool ValidateLUC_DL() -{ - cout << "\nLUC-HMP validation suite running...\n\n"; - - FileSource f("TestData/lucs512.dat", true, new HexDecoder); - LUC_HMP::Signer privS(f); - LUC_HMP::Verifier pubS(privS); - bool pass = SignatureValidate(privS, pubS); - - cout << "\nLUC-IES validation suite running...\n\n"; - - FileSource fc("TestData/lucc512.dat", true, new HexDecoder); - LUC_IES<>::Decryptor privC(fc); - LUC_IES<>::Encryptor pubC(privC); - pass = CryptoSystemValidate(privC, pubC) && pass; - - return pass; -} - -bool ValidateRabin() -{ - cout << "\nRabin validation suite running...\n\n"; - bool pass=true; - - { - FileSource f("TestData/rabi1024.dat", true, new HexDecoder); - RabinSS::Signer priv(f); - RabinSS::Verifier pub(priv); - pass = SignatureValidate(priv, pub) && pass; - } - { - RabinES >::Decryptor priv(GlobalRNG(), 512); - RabinES >::Encryptor pub(priv); - pass = CryptoSystemValidate(priv, pub) && pass; - } - return pass; -} - -bool ValidateRW() -{ - cout << "\nRW validation suite running...\n\n"; - - FileSource f("TestData/rw1024.dat", true, new HexDecoder); - RWSS::Signer priv(f); - RWSS::Verifier pub(priv); - - return SignatureValidate(priv, pub); -} - -/* -bool ValidateBlumGoldwasser() -{ - cout << "\nBlumGoldwasser validation suite running...\n\n"; - - FileSource f("TestData/blum512.dat", true, new HexDecoder); - BlumGoldwasserPrivateKey priv(f); - BlumGoldwasserPublicKey pub(priv); - - return CryptoSystemValidate(priv, pub); -} -*/ - -#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS) -// Issue 64: "PolynomialMod2::operator<<=", http://github.com/weidai11/cryptopp/issues/64 -bool TestPolynomialMod2() -{ - bool pass1 = true, pass2 = true, pass3 = true; - - cout << "\nTesting PolynomialMod2 bit operations...\n\n"; - - static const unsigned int start = 0; - static const unsigned int stop = 4 * WORD_BITS + 1; - - for (unsigned int i=start; i < stop; i++) - { - PolynomialMod2 p(1); - p <<= i; - - Integer n(Integer::One()); - n <<= i; - - std::ostringstream oss1; - oss1 << p; - - std::string str1, str2; - - // str1 needs the commas removed used for grouping - str1 = oss1.str(); - str1.erase(std::remove(str1.begin(), str1.end(), ','), str1.end()); - - // str1 needs the trailing 'b' removed - str1.erase(str1.end() - 1); - - // str2 is fine as-is - str2 = IntToString(n, 2); - - pass1 &= (str1 == str2); - } - - for (unsigned int i=start; i < stop; i++) - { - const word w(SIZE_MAX); - - PolynomialMod2 p(w); - p <<= i; - - Integer n(Integer::POSITIVE, static_cast(w)); - n <<= i; - - std::ostringstream oss1; - oss1 << p; - - std::string str1, str2; - - // str1 needs the commas removed used for grouping - str1 = oss1.str(); - str1.erase(std::remove(str1.begin(), str1.end(), ','), str1.end()); - - // str1 needs the trailing 'b' removed - str1.erase(str1.end() - 1); - - // str2 is fine as-is - str2 = IntToString(n, 2); - - pass2 &= (str1 == str2); - } - - RandomNumberGenerator& prng = GlobalRNG(); - for (unsigned int i=start; i < stop; i++) - { - word w; // Cast to lword due to Visual Studio - prng.GenerateBlock((byte*)&w, sizeof(w)); - - PolynomialMod2 p(w); - p <<= i; - - Integer n(Integer::POSITIVE, static_cast(w)); - n <<= i; - - std::ostringstream oss1; - oss1 << p; - - std::string str1, str2; - - // str1 needs the commas removed used for grouping - str1 = oss1.str(); - str1.erase(std::remove(str1.begin(), str1.end(), ','), str1.end()); - - // str1 needs the trailing 'b' removed - str1.erase(str1.end() - 1); - - // str2 is fine as-is - str2 = IntToString(n, 2); - - if (str1 != str2) - { - cout << " Oops..." << "\n"; - cout << " random: " << std::hex << n << std::dec << "\n"; - cout << " str1: " << str1 << "\n"; - cout << " str2: " << str2 << "\n"; - } - - pass3 &= (str1 == str2); - } - - cout << (!pass1 ? "FAILED" : "passed") << " " << "1 shifted over range [" << dec << start << "," << stop << "]" << "\n"; - cout << (!pass2 ? "FAILED" : "passed") << " " << "0x" << hex << word(SIZE_MAX) << dec << " shifted over range [" << start << "," << stop << "]" << "\n"; - cout << (!pass3 ? "FAILED" : "passed") << " " << "random values shifted over range [" << dec << start << "," << stop << "]" << "\n"; - - if (!(pass1 && pass2 && pass3)) - cout.flush(); - - return pass1 && pass2 && pass3; -} -#endif - -bool ValidateECP() -{ - cout << "\nECP validation suite running...\n\n"; - - ECIES::Decryptor cpriv(GlobalRNG(), ASN1::secp192r1()); - ECIES::Encryptor cpub(cpriv); - ByteQueue bq; - cpriv.GetKey().DEREncode(bq); - cpub.AccessKey().AccessGroupParameters().SetEncodeAsOID(true); - cpub.GetKey().DEREncode(bq); - ECDSA::Signer spriv(bq); - ECDSA::Verifier spub(bq); - ECDH::Domain ecdhc(ASN1::secp192r1()); - ECMQV::Domain ecmqvc(ASN1::secp192r1()); - - spriv.AccessKey().Precompute(); - ByteQueue queue; - spriv.AccessKey().SavePrecomputation(queue); - spriv.AccessKey().LoadPrecomputation(queue); - - bool pass = SignatureValidate(spriv, spub); - cpub.AccessKey().Precompute(); - cpriv.AccessKey().Precompute(); - pass = CryptoSystemValidate(cpriv, cpub) && pass; - pass = SimpleKeyAgreementValidate(ecdhc) && pass; - pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; - - cout << "Turning on point compression..." << endl; - cpriv.AccessKey().AccessGroupParameters().SetPointCompression(true); - cpub.AccessKey().AccessGroupParameters().SetPointCompression(true); - ecdhc.AccessGroupParameters().SetPointCompression(true); - ecmqvc.AccessGroupParameters().SetPointCompression(true); - pass = CryptoSystemValidate(cpriv, cpub) && pass; - pass = SimpleKeyAgreementValidate(ecdhc) && pass; - pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; - - cout << "Testing SEC 2, NIST, and Brainpool recommended curves..." << endl; - OID oid; - while (!(oid = DL_GroupParameters_EC::GetNextRecommendedParametersOID(oid)).m_values.empty()) - { - DL_GroupParameters_EC params(oid); - bool fail = !params.Validate(GlobalRNG(), 2); - cout << (fail ? "FAILED" : "passed") << " " << dec << params.GetCurve().GetField().MaxElementBitLength() << " bits" << endl; - pass = pass && !fail; - } - - return pass; -} - -bool ValidateEC2N() -{ - cout << "\nEC2N validation suite running...\n\n"; - - ECIES::Decryptor cpriv(GlobalRNG(), ASN1::sect193r1()); - ECIES::Encryptor cpub(cpriv); - ByteQueue bq; - cpriv.DEREncode(bq); - cpub.AccessKey().AccessGroupParameters().SetEncodeAsOID(true); - cpub.DEREncode(bq); - ECDSA::Signer spriv(bq); - ECDSA::Verifier spub(bq); - ECDH::Domain ecdhc(ASN1::sect193r1()); - ECMQV::Domain ecmqvc(ASN1::sect193r1()); - - spriv.AccessKey().Precompute(); - ByteQueue queue; - spriv.AccessKey().SavePrecomputation(queue); - spriv.AccessKey().LoadPrecomputation(queue); - - bool pass = SignatureValidate(spriv, spub); - pass = CryptoSystemValidate(cpriv, cpub) && pass; - pass = SimpleKeyAgreementValidate(ecdhc) && pass; - pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; - - cout << "Turning on point compression..." << endl; - cpriv.AccessKey().AccessGroupParameters().SetPointCompression(true); - cpub.AccessKey().AccessGroupParameters().SetPointCompression(true); - ecdhc.AccessGroupParameters().SetPointCompression(true); - ecmqvc.AccessGroupParameters().SetPointCompression(true); - pass = CryptoSystemValidate(cpriv, cpub) && pass; - pass = SimpleKeyAgreementValidate(ecdhc) && pass; - pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass; - -#if 0 // TODO: turn this back on when I make EC2N faster for pentanomial basis - cout << "Testing SEC 2 recommended curves..." << endl; - OID oid; - while (!(oid = DL_GroupParameters_EC::GetNextRecommendedParametersOID(oid)).m_values.empty()) - { - DL_GroupParameters_EC params(oid); - bool fail = !params.Validate(GlobalRNG(), 2); - cout << (fail ? "FAILED" : "passed") << " " << params.GetCurve().GetField().MaxElementBitLength() << " bits" << endl; - pass = pass && !fail; - } -#endif - - return pass; -} - -bool ValidateECDSA() -{ - cout << "\nECDSA validation suite running...\n\n"; - - // from Sample Test Vectors for P1363 - GF2NT gf2n(191, 9, 0); - byte a[]="\x28\x66\x53\x7B\x67\x67\x52\x63\x6A\x68\xF5\x65\x54\xE1\x26\x40\x27\x6B\x64\x9E\xF7\x52\x62\x67"; - byte b[]="\x2E\x45\xEF\x57\x1F\x00\x78\x6F\x67\xB0\x08\x1B\x94\x95\xA3\xD9\x54\x62\xF5\xDE\x0A\xA1\x85\xEC"; - EC2N ec(gf2n, PolynomialMod2(a,24), PolynomialMod2(b,24)); - - EC2N::Point P; - ec.DecodePoint(P, (byte *)"\x04\x36\xB3\xDA\xF8\xA2\x32\x06\xF9\xC4\xF2\x99\xD7\xB2\x1A\x9C\x36\x91\x37\xF2\xC8\x4A\xE1\xAA\x0D" - "\x76\x5B\xE7\x34\x33\xB3\xF9\x5E\x33\x29\x32\xE7\x0E\xA2\x45\xCA\x24\x18\xEA\x0E\xF9\x80\x18\xFB", ec.EncodedPointSize()); - Integer n("40000000000000000000000004a20e90c39067c893bbb9a5H"); - Integer d("340562e1dda332f9d2aec168249b5696ee39d0ed4d03760fH"); - EC2N::Point Q(ec.Multiply(d, P)); - ECDSA::Signer priv(ec, P, n, d); - ECDSA::Verifier pub(priv); - - Integer h("A9993E364706816ABA3E25717850C26C9CD0D89DH"); - Integer k("3eeace72b4919d991738d521879f787cb590aff8189d2b69H"); - static const byte sig[]="\x03\x8e\x5a\x11\xfb\x55\xe4\xc6\x54\x71\xdc\xd4\x99\x84\x52\xb1\xe0\x2d\x8a\xf7\x09\x9b\xb9\x30" - "\x0c\x9a\x08\xc3\x44\x68\xc2\x44\xb4\xe5\xd6\xb2\x1b\x3c\x68\x36\x28\x07\x41\x60\x20\x32\x8b\x6e"; - Integer r(sig, 24); - Integer s(sig+24, 24); - - Integer rOut, sOut; - bool fail, pass=true; - - priv.RawSign(k, h, rOut, sOut); - fail = (rOut != r) || (sOut != s); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "signature check against test vector\n"; - - fail = !pub.VerifyMessage((byte *)"abc", 3, sig, sizeof(sig)); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "verification check against test vector\n"; - - fail = pub.VerifyMessage((byte *)"xyz", 3, sig, sizeof(sig)); - pass = pass && !fail; - - pass = SignatureValidate(priv, pub) && pass; - - return pass; -} - -bool ValidateESIGN() -{ - cout << "\nESIGN validation suite running...\n\n"; - - bool pass = true, fail; - - static const char plain[] = "test"; - static const byte signature[] = - "\xA3\xE3\x20\x65\xDE\xDA\xE7\xEC\x05\xC1\xBF\xCD\x25\x79\x7D\x99\xCD\xD5\x73\x9D\x9D\xF3\xA4\xAA\x9A\xA4\x5A\xC8\x23\x3D\x0D\x37\xFE\xBC\x76\x3F\xF1\x84\xF6\x59" - "\x14\x91\x4F\x0C\x34\x1B\xAE\x9A\x5C\x2E\x2E\x38\x08\x78\x77\xCB\xDC\x3C\x7E\xA0\x34\x44\x5B\x0F\x67\xD9\x35\x2A\x79\x47\x1A\x52\x37\x71\xDB\x12\x67\xC1\xB6\xC6" - "\x66\x73\xB3\x40\x2E\xD6\xF2\x1A\x84\x0A\xB6\x7B\x0F\xEB\x8B\x88\xAB\x33\xDD\xE4\x83\x21\x90\x63\x2D\x51\x2A\xB1\x6F\xAB\xA7\x5C\xFD\x77\x99\xF2\xE1\xEF\x67\x1A" - "\x74\x02\x37\x0E\xED\x0A\x06\xAD\xF4\x15\x65\xB8\xE1\xD1\x45\xAE\x39\x19\xB4\xFF\x5D\xF1\x45\x7B\xE0\xFE\x72\xED\x11\x92\x8F\x61\x41\x4F\x02\x00\xF2\x76\x6F\x7C" - "\x79\xA2\xE5\x52\x20\x5D\x97\x5E\xFE\x39\xAE\x21\x10\xFB\x35\xF4\x80\x81\x41\x13\xDD\xE8\x5F\xCA\x1E\x4F\xF8\x9B\xB2\x68\xFB\x28"; - - FileSource keys("TestData/esig1536.dat", true, new HexDecoder); - ESIGN::Signer signer(keys); - ESIGN::Verifier verifier(signer); - - fail = !SignatureValidate(signer, verifier); - pass = pass && !fail; - - fail = !verifier.VerifyMessage((byte *)plain, strlen(plain), signature, verifier.SignatureLength()); - pass = pass && !fail; - - cout << (fail ? "FAILED " : "passed "); - cout << "verification check against test vector\n"; - - cout << "Generating signature key from seed..." << endl; - signer.AccessKey().GenerateRandom(GlobalRNG(), MakeParameters("Seed", ConstByteArrayParameter((const byte *)"test", 4))("KeySize", 3*512)); - verifier = signer; - - fail = !SignatureValidate(signer, verifier); - pass = pass && !fail; - - return pass; -} diff --git a/external/crypto++-5.6.3/validat3.cpp b/external/crypto++-5.6.3/validat3.cpp deleted file mode 100644 index 53d1aabb6..000000000 --- a/external/crypto++-5.6.3/validat3.cpp +++ /dev/null @@ -1,741 +0,0 @@ -// validat3.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 - -#include "cryptlib.h" -#include "pubkey.h" -#include "gfpcrypt.h" -#include "eccrypto.h" - -#include "smartptr.h" -#include "crc.h" -#include "adler32.h" -#include "md2.h" -#include "md4.h" -#include "md5.h" -#include "sha.h" -#include "tiger.h" -#include "ripemd.h" -#include "whrlpool.h" -#include "hkdf.h" -#include "hmac.h" -#include "ttmac.h" -#include "integer.h" -#include "pwdbased.h" -#include "filters.h" -#include "files.h" -#include "hex.h" -#include "smartptr.h" - -#include -#include -#include - -#include "validate.h" - -// Aggressive stack checking with VS2005 SP1 and above. -#if (CRYPTOPP_MSC_VERSION >= 1410) -# pragma strict_gs_check (on) -#endif - -USING_NAMESPACE(CryptoPP) -USING_NAMESPACE(std) - -struct HashTestTuple -{ - HashTestTuple(const char *input, const char *output, unsigned int repeatTimes=1) - : input((byte *)input), output((byte *)output), inputLen(strlen(input)), repeatTimes(repeatTimes) {} - - HashTestTuple(const char *input, unsigned int inputLen, const char *output, unsigned int repeatTimes) - : input((byte *)input), output((byte *)output), inputLen(inputLen), repeatTimes(repeatTimes) {} - - const byte *input, *output; - size_t inputLen; - unsigned int repeatTimes; -}; - -bool HashModuleTest(HashTransformation &md, const HashTestTuple *testSet, unsigned int testSetSize) -{ - bool pass=true, fail; - SecByteBlock digest(md.DigestSize()); - - // Coverity finding (http://stackoverflow.com/a/30968371 does not squash the finding) - std::ostringstream out; - out.copyfmt(cout); - - for (unsigned int i=0; i XMACC_MD5; - - const byte keys[2][XMACC_MD5::KEYLENGTH]={ - {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xaa,0xbb}, - {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98}}; - - const word32 counters[2]={0xccddeeff, 0x76543210}; - - const char *TestVals[7]={ - "", - "a", - "abc", - "message digest", - "abcdefghijklmnopqrstuvwxyz", - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", - "12345678901234567890123456789012345678901234567890123456789012345678901234567890"}; - - const byte output[2][7][XMACC_MD5::DIGESTSIZE]={ - {{0xcc,0xdd,0xef,0x00,0xfa,0x89,0x54,0x92,0x86,0x32,0xda,0x2a,0x3f,0x29,0xc5,0x52,0xa0,0x0d,0x05,0x13}, - {0xcc,0xdd,0xef,0x01,0xae,0xdb,0x8b,0x7b,0x69,0x71,0xc7,0x91,0x71,0x48,0x9d,0x18,0xe7,0xdf,0x9d,0x5a}, - {0xcc,0xdd,0xef,0x02,0x5e,0x01,0x2e,0x2e,0x4b,0xc3,0x83,0x62,0xc2,0xf4,0xe6,0x18,0x1c,0x44,0xaf,0xca}, - {0xcc,0xdd,0xef,0x03,0x3e,0xa9,0xf1,0xe0,0x97,0x91,0xf8,0xe2,0xbe,0xe0,0xdf,0xf3,0x41,0x03,0xb3,0x5a}, - {0xcc,0xdd,0xef,0x04,0x2e,0x6a,0x8d,0xb9,0x72,0xe3,0xce,0x9f,0xf4,0x28,0x45,0xe7,0xbc,0x80,0xa9,0xc7}, - {0xcc,0xdd,0xef,0x05,0x1a,0xd5,0x40,0x78,0xfb,0x16,0x37,0xfc,0x7a,0x1d,0xce,0xb4,0x77,0x10,0xb2,0xa0}, - {0xcc,0xdd,0xef,0x06,0x13,0x2f,0x11,0x47,0xd7,0x1b,0xb5,0x52,0x36,0x51,0x26,0xb0,0x96,0xd7,0x60,0x81}}, - {{0x76,0x54,0x32,0x11,0xe9,0xcb,0x74,0x32,0x07,0x93,0xfe,0x01,0xdd,0x27,0xdb,0xde,0x6b,0x77,0xa4,0x56}, - {0x76,0x54,0x32,0x12,0xcd,0x55,0x87,0x5c,0xc0,0x35,0x85,0x99,0x44,0x02,0xa5,0x0b,0x8c,0xe7,0x2c,0x68}, - {0x76,0x54,0x32,0x13,0xac,0xfd,0x87,0x50,0xc3,0x8f,0xcd,0x58,0xaa,0xa5,0x7e,0x7a,0x25,0x63,0x26,0xd1}, - {0x76,0x54,0x32,0x14,0xe3,0x30,0xf5,0xdd,0x27,0x2b,0x76,0x22,0x7f,0xaa,0x90,0x73,0x6a,0x48,0xdb,0x00}, - {0x76,0x54,0x32,0x15,0xfc,0x57,0x00,0x20,0x7c,0x9d,0xf6,0x30,0x6f,0xbd,0x46,0x3e,0xfb,0x8a,0x2c,0x60}, - {0x76,0x54,0x32,0x16,0xfb,0x0f,0xd3,0xdf,0x4c,0x4b,0xc3,0x05,0x9d,0x63,0x1e,0xba,0x25,0x2b,0xbe,0x35}, - {0x76,0x54,0x32,0x17,0xc6,0xfe,0xe6,0x5f,0xb1,0x35,0x8a,0xf5,0x32,0x7a,0x80,0xbd,0xb8,0x72,0xee,0xae}}}; - - byte digest[XMACC_MD5::DIGESTSIZE]; - bool pass=true, fail; - - cout << "\nXMACC/MD5 validation suite running...\n"; - - for (int k=0; k<2; k++) - { - XMACC_MD5 mac(keys[k], counters[k]); - cout << "\nKEY: "; - for (int j=0;j pbkdf; - - cout << "\nPKCS #12 PBKDF validation suite running...\n\n"; - pass = TestPBKDF(pbkdf, testSet, sizeof(testSet)/sizeof(testSet[0])) && pass; - } - - { - // from draft-ietf-smime-password-03.txt, at http://www.imc.org/draft-ietf-smime-password - PBKDF_TestTuple testSet[] = - { - {0, 5, "70617373776f7264", "1234567878563412", "D1DAA78615F287E6"}, - {0, 500, "416C6C206E2D656E746974696573206D75737420636F6D6D756E69636174652077697468206F74686572206E2d656E74697469657320766961206E2D3120656E746974656568656568656573", "1234567878563412","6A8970BF68C92CAEA84A8DF28510858607126380CC47AB2D"} - }; - - PKCS5_PBKDF2_HMAC pbkdf; - - cout << "\nPKCS #5 PBKDF2 validation suite running...\n\n"; - pass = TestPBKDF(pbkdf, testSet, sizeof(testSet)/sizeof(testSet[0])) && pass; - } - - return pass; -} - -struct HKDF_TestTuple -{ - const char *hexSecret, *hexSalt, *hexInfo, *hexExpected; - size_t len; -}; - -bool TestHKDF(KeyDerivationFunction &kdf, const HKDF_TestTuple *testSet, unsigned int testSetSize) -{ - bool pass = true; - - for (unsigned int i=0; i(secret.data()), secret.size(), - (tuple.hexSalt ? reinterpret_cast(salt.data()) : NULL), salt.size(), - (tuple.hexInfo ? reinterpret_cast(info.data()) : NULL), info.size()); - - bool fail = !VerifyBufsEqual(derived, reinterpret_cast(expected.data()), derived.size()); - pass = pass && (ret == tuple.len) && !fail; - - HexEncoder enc(new FileSink(std::cout)); - std::cout << (fail ? "FAILED " : "passed "); - std::cout << " " << tuple.hexSecret << " "; - std::cout << (tuple.hexSalt ? (strlen(tuple.hexSalt) ? tuple.hexSalt : "<0-LEN SALT>") : ""); - std::cout << " "; - std::cout << (tuple.hexInfo ? (strlen(tuple.hexInfo) ? tuple.hexInfo : "<0-LEN INFO>") : ""); - std::cout << " "; - enc.Put(derived, derived.size()); - std::cout << std::endl; - } - - return pass; -} - -bool ValidateHKDF() -{ - bool pass = true; - - { - // SHA-1 from RFC 5869, Appendix A, https://tools.ietf.org/html/rfc5869 - static const HKDF_TestTuple testSet[] = - { - // Test Case #4 - {"0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "085a01ea1b10f36933068b56efa5ad81 a4f14b822f5b091568a9cdd4f155fda2 c22e422478d305f3f896", 42}, - // Test Case #5 - {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "0bd770a74d1160f7c9f12cd5912a06eb ff6adcae899d92191fe4305673ba2ffe 8fa3f1a4e5ad79f3f334b3b202b2173c 486ea37ce3d397ed034c7f9dfeb15c5e 927336d0441f4c4300e2cff0d0900b52 d3b4", 82}, - // Test Case #6 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "0ac1af7002b3d761d1e55298da9d0506 b9ae52057220a306e07b6b87e8df21d0 ea00033de03984d34918", 42}, - // Test Case #7 - {"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", NULL, "", "2c91117204d745f3500d636a62f64f0 ab3bae548aa53d423b0d1f27ebba6f5e5 673a081d70cce7acfc48", 42} - }; - - HKDF hkdf; - - std::cout << "\nRFC 5869 HKDF(SHA-1) validation suite running...\n\n"; - pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; - } - - { - // SHA-256 from RFC 5869, Appendix A, https://tools.ietf.org/html/rfc5869 - static const HKDF_TestTuple testSet[] = - { - // Test Case #1 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "3cb25f25faacd57a90434f64d0362f2a 2d2d0a90cf1a5a4c5db02d56ecc4c5bf 34007208d5b887185865", 42}, - // Test Case #2 - {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "b11e398dc80327a1c8e7f78c596a4934 4f012eda2d4efad8a050cc4c19afa97c 59045a99cac7827271cb41c65e590e09 da3275600c2f09b8367793a9aca3db71 cc30c58179ec3e87c14c01d5c1f3434f 1d87", 82}, - // Test Case #3 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "8da4e775a563c18f715f802a063c5a31 b8a11f5c5ee1879ec3454e5f3c738d2d 9d201395faa4b61a96c8", 42} - }; - - HKDF hkdf; - - std::cout << "\nRFC 5869 HKDF(SHA-256) validation suite running...\n\n"; - pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; - } - - { - // SHA-512, Crypto++ generated, based on RFC 5869, https://tools.ietf.org/html/rfc5869 - static const HKDF_TestTuple testSet[] = - { - // Test Case #0 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "832390086CDA71FB47625BB5CEB168E4 C8E26A1A16ED34D9FC7FE92C14815793 38DA362CB8D9F925D7CB", 42}, - // Test Case #0 - {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "CE6C97192805B346E6161E821ED16567 3B84F400A2B514B2FE23D84CD189DDF1 B695B48CBD1C8388441137B3CE28F16A A64BA33BA466B24DF6CFCB021ECFF235 F6A2056CE3AF1DE44D572097A8505D9E 7A93", 82}, - // Test Case #0 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "F5FA02B18298A72A8C23898A8703472C 6EB179DC204C03425C970E3B164BF90F FF22D04836D0E2343BAC", 42}, - // Test Case #0 - {"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", NULL, "", "1407D46013D98BC6DECEFCFEE55F0F90 B0C7F63D68EB1A80EAF07E953CFC0A3A 5240A155D6E4DAA965BB", 42} - }; - - HKDF hkdf; - - std::cout << "\nRFC 5869 HKDF(SHA-512) validation suite running...\n\n"; - pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; - } - - - - { - // Whirlpool, Crypto++ generated, based on RFC 5869, https://tools.ietf.org/html/rfc5869 - static const HKDF_TestTuple testSet[] = - { - // Test Case #0 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", "f0f1f2f3f4f5f6f7f8f9", "0D29F74CCD8640F44B0DD9638111C1B5 766EFED752AF358109E2E7C9CD4A28EF 2F90B2AD461FBA0744D4", 42}, - // Test Case #0 - {"000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262728292a2b2c2d2e2f 303132333435363738393a3b3c3d3e3f 404142434445464748494a4b4c4d4e4f", "606162636465666768696a6b6c6d6e6f 707172737475767778797a7b7c7d7e7f 808182838485868788898a8b8c8d8e8f 909192939495969798999a9b9c9d9e9f a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf c0c1c2c3c4c5c6c7c8c9cacbcccdcecf d0d1d2d3d4d5d6d7d8d9dadbdcdddedf e0e1e2e3e4e5e6e7e8e9eaebecedeeef f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "4EBE4FE2DCCEC42661699500BE279A99 3FED90351E19373B3926FAA3A410700B2 BBF77E254CF1451AE6068D64A0904D96 6F4FF25498445A501B88F50D21E3A68A8 90E09445DC5886DD00E7F4F7C58A5121 70", 82}, - // Test Case #0 - {"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "", "", "110632D0F7AEFAC31771FC66C22BB346 2614B81E4B04BA7F2B662E0BD694F564 58615F9A9CB56C57ECF2", 42}, - // Test Case #0 - {"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c" /*key*/, NULL /*salt*/, "" /*info*/, "4089286EBFB23DD8A02F0C9DAA35D538 EB09CD0A8CBAB203F39083AA3E0BD313 E6F91E64F21A187510B0", 42} - }; - - HKDF hkdf; - - std::cout << "\nRFC 5869 HKDF(Whirlpool) validation suite running...\n\n"; - pass = TestHKDF(hkdf, testSet, COUNTOF(testSet)) && pass; - } - - - return pass; -} diff --git a/external/crypto++-5.6.3/validate.h b/external/crypto++-5.6.3/validate.h deleted file mode 100644 index 4f19e1a01..000000000 --- a/external/crypto++-5.6.3/validate.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef CRYPTOPP_VALIDATE_H -#define CRYPTOPP_VALIDATE_H - -#include "cryptlib.h" - -bool ValidateAll(bool thorough); -bool TestSettings(); -bool TestOS_RNG(); -bool TestAutoSeeded(); - -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -bool TestRDRAND(); -bool TestRDSEED(); -#endif - -bool ValidateBaseCode(); -bool ValidateCRC32(); -bool ValidateAdler32(); -bool ValidateMD2(); -bool ValidateMD4(); -bool ValidateMD5(); -bool ValidateSHA(); -bool ValidateSHA2(); -bool ValidateTiger(); -bool ValidateRIPEMD(); -bool ValidatePanama(); -bool ValidateWhirlpool(); - -bool ValidateHMAC(); -bool ValidateTTMAC(); - -bool ValidateCipherModes(); -bool ValidatePBKDF(); -bool ValidateHKDF(); - -bool ValidateDES(); -bool ValidateIDEA(); -bool ValidateSAFER(); -bool ValidateRC2(); -bool ValidateARC4(); - -bool ValidateRC5(); -bool ValidateBlowfish(); -bool ValidateThreeWay(); -bool ValidateGOST(); -bool ValidateSHARK(); -bool ValidateSEAL(); -bool ValidateCAST(); -bool ValidateSquare(); -bool ValidateSKIPJACK(); -bool ValidateRC6(); -bool ValidateMARS(); -bool ValidateRijndael(); -bool ValidateTwofish(); -bool ValidateSerpent(); -bool ValidateSHACAL2(); -bool ValidateCamellia(); -bool ValidateSalsa(); -bool ValidateSosemanuk(); -bool ValidateVMAC(); -bool ValidateCCM(); -bool ValidateGCM(); -bool ValidateCMAC(); - -bool ValidateBBS(); -bool ValidateDH(); -bool ValidateMQV(); -bool ValidateRSA(); -bool ValidateElGamal(); -bool ValidateDLIES(); -bool ValidateNR(); -bool ValidateDSA(bool thorough); -bool ValidateLUC(); -bool ValidateLUC_DL(); -bool ValidateLUC_DH(); -bool ValidateXTR_DH(); -bool ValidateRabin(); -bool ValidateRW(); -//bool ValidateBlumGoldwasser(); -bool ValidateECP(); -bool ValidateEC2N(); -bool ValidateECDSA(); -bool ValidateESIGN(); - -#if !defined(NDEBUG) -bool TestPolynomialMod2(); -#endif - -// Coverity findings -template -T StringToValue(const std::string& str); -template<> -int StringToValue(const std::string& str); - -// Functions that need a RNG; uses AES inf CFB mode with Seed. -CryptoPP::RandomNumberGenerator & GlobalRNG(); - -bool RunTestDataFile(const char *filename, const CryptoPP::NameValuePairs &overrideParameters=CryptoPP::g_nullNameValuePairs, bool thorough=true); - -#endif diff --git a/external/crypto++-5.6.3/vmac.cpp b/external/crypto++-5.6.3/vmac.cpp deleted file mode 100644 index e44b772df..000000000 --- a/external/crypto++-5.6.3/vmac.cpp +++ /dev/null @@ -1,910 +0,0 @@ -// vmac.cpp - written and placed in the public domain by Wei Dai -// based on Ted Krovetz's public domain vmac.c and draft-krovetz-vmac-01.txt - -#include "pch.h" -#include "config.h" - -#include "vmac.h" -#include "cpu.h" -#include "argnames.h" -#include "secblock.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4731) -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#if defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64 -#include -#endif - -#define VMAC_BOOL_WORD128 (defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(CRYPTOPP_X64_ASM_AVAILABLE)) -#ifdef __BORLANDC__ -#define const // Turbo C++ 2006 workaround -#endif -static const word64 p64 = W64LIT(0xfffffffffffffeff); /* 2^64 - 257 prime */ -static const word64 m62 = W64LIT(0x3fffffffffffffff); /* 62-bit mask */ -static const word64 m63 = W64LIT(0x7fffffffffffffff); /* 63-bit mask */ -static const word64 m64 = W64LIT(0xffffffffffffffff); /* 64-bit mask */ -static const word64 mpoly = W64LIT(0x1fffffff1fffffff); /* Poly key mask */ -#ifdef __BORLANDC__ -#undef const -#endif -#if VMAC_BOOL_WORD128 -#ifdef __powerpc__ -// workaround GCC Bug 31690: ICE with const __uint128_t and C++ front-end -#define m126 ((word128(m62)<<64)|m64) -#else -static const word128 m126 = (word128(m62)<<64)|m64; /* 126-bit mask */ -#endif -#endif - -void VMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms) -{ - int digestLength = params.GetIntValueWithDefault(Name::DigestSize(), DefaultDigestSize()); - if (digestLength != 8 && digestLength != 16) - throw InvalidArgument("VMAC: DigestSize must be 8 or 16"); - m_is128 = digestLength == 16; - - m_L1KeyLength = params.GetIntValueWithDefault(Name::L1KeyLength(), 128); - if (m_L1KeyLength <= 0 || m_L1KeyLength % 128 != 0) - throw InvalidArgument("VMAC: L1KeyLength must be a positive multiple of 128"); - - AllocateBlocks(); - - BlockCipher &cipher = AccessCipher(); - cipher.SetKey(userKey, keylength, params); - const unsigned int blockSize = cipher.BlockSize(); - const unsigned int blockSizeInWords = blockSize / sizeof(word64); - SecBlock out(blockSizeInWords); - SecByteBlock in; - in.CleanNew(blockSize); - size_t i; - - /* Fill nh key */ - in[0] = 0x80; - cipher.AdvancedProcessBlocks(in, NULL, (byte *)m_nhKey(), m_nhKeySize()*sizeof(word64), cipher.BT_InBlockIsCounter); - ConditionalByteReverse(BIG_ENDIAN_ORDER, m_nhKey(), m_nhKey(), m_nhKeySize()*sizeof(word64)); - - /* Fill poly key */ - in[0] = 0xC0; - in[15] = 0; - for (i = 0; i <= (size_t)m_is128; i++) - { - cipher.ProcessBlock(in, out.BytePtr()); - m_polyState()[i*4+2] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()) & mpoly; - m_polyState()[i*4+3] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()+8) & mpoly; - in[15]++; - } - - /* Fill ip key */ - in[0] = 0xE0; - in[15] = 0; - word64 *l3Key = m_l3Key(); - for (i = 0; i <= (size_t)m_is128; i++) - do - { - cipher.ProcessBlock(in, out.BytePtr()); - l3Key[i*2+0] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()); - l3Key[i*2+1] = GetWord(true, BIG_ENDIAN_ORDER, out.BytePtr()+8); - in[15]++; - } while ((l3Key[i*2+0] >= p64) || (l3Key[i*2+1] >= p64)); - - m_padCached = false; - size_t nonceLength; - const byte *nonce = GetIVAndThrowIfInvalid(params, nonceLength); - Resynchronize(nonce, (int)nonceLength); -} - -void VMAC_Base::GetNextIV(RandomNumberGenerator &rng, byte *IV) -{ - SimpleKeyingInterface::GetNextIV(rng, IV); - IV[0] &= 0x7f; -} - -void VMAC_Base::Resynchronize(const byte *nonce, int len) -{ - size_t length = ThrowIfInvalidIVLength(len); - size_t s = IVSize(); - byte *storedNonce = m_nonce(); - - if (m_is128) - { - memset(storedNonce, 0, s-length); - memcpy(storedNonce+s-length, nonce, length); - AccessCipher().ProcessBlock(storedNonce, m_pad()); - } - else - { - if (m_padCached && (storedNonce[s-1] | 1) == (nonce[length-1] | 1)) - { - m_padCached = VerifyBufsEqual(storedNonce+s-length, nonce, length-1); - for (size_t i=0; m_padCached && i>64); rl = word64(p);} - #define AccumulateNH(a, b, c) a += word128(b)*(c) - #define Multiply128(r, i1, i2) r = word128(word64(i1)) * word64(i2) -#else - #if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) - #define MUL32(a, b) __emulu(word32(a), word32(b)) - #else - #define MUL32(a, b) ((word64)((word32)(a)) * (word32)(b)) - #endif - #if defined(CRYPTOPP_X64_ASM_AVAILABLE) - #define DeclareNH(a) word64 a##0=0, a##1=0 - #define MUL64(rh,rl,i1,i2) asm ("mulq %3" : "=a"(rl), "=d"(rh) : "a"(i1), "g"(i2) : "cc"); - #define AccumulateNH(a, b, c) asm ("mulq %3; addq %%rax, %0; adcq %%rdx, %1" : "+r"(a##0), "+r"(a##1) : "a"(b), "g"(c) : "%rdx", "cc"); - #define ADD128(rh,rl,ih,il) asm ("addq %3, %1; adcq %2, %0" : "+r"(rh),"+r"(rl) : "r"(ih),"r"(il) : "cc"); - #elif defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64 - #define DeclareNH(a) word64 a##0=0, a##1=0 - #define MUL64(rh,rl,i1,i2) (rl) = _umul128(i1,i2,&(rh)); - #define AccumulateNH(a, b, c) {\ - word64 ph, pl;\ - pl = _umul128(b,c,&ph);\ - a##0 += pl;\ - a##1 += ph + (a##0 < pl);} - #else - #define VMAC_BOOL_32BIT 1 - #define DeclareNH(a) word64 a##0=0, a##1=0, a##2=0 - #define MUL64(rh,rl,i1,i2) \ - { word64 _i1 = (i1), _i2 = (i2); \ - word64 m1= MUL32(_i1,_i2>>32); \ - word64 m2= MUL32(_i1>>32,_i2); \ - rh = MUL32(_i1>>32,_i2>>32); \ - rl = MUL32(_i1,_i2); \ - ADD128(rh,rl,(m1 >> 32),(m1 << 32)); \ - ADD128(rh,rl,(m2 >> 32),(m2 << 32)); \ - } - #define AccumulateNH(a, b, c) {\ - word64 p = MUL32(b, c);\ - a##1 += word32((p)>>32);\ - a##0 += word32(p);\ - p = MUL32((b)>>32, c);\ - a##2 += word32((p)>>32);\ - a##1 += word32(p);\ - p = MUL32((b)>>32, (c)>>32);\ - a##2 += p;\ - p = MUL32(b, (c)>>32);\ - a##1 += word32(p);\ - a##2 += word32(p>>32);} - #endif -#endif -#ifndef VMAC_BOOL_32BIT - #define VMAC_BOOL_32BIT 0 -#endif -#ifndef ADD128 - #define ADD128(rh,rl,ih,il) \ - { word64 _il = (il); \ - (rl) += (_il); \ - (rh) += (ih) + ((rl) < (_il)); \ - } -#endif - -#if !(defined(_MSC_VER) && _MSC_VER < 1300) -template -#endif -void VMAC_Base::VHASH_Update_Template(const word64 *data, size_t blocksRemainingInWord64) -{ - #define INNER_LOOP_ITERATION(j) {\ - word64 d0 = ConditionalByteReverse(LITTLE_ENDIAN_ORDER, data[i+2*j+0]);\ - word64 d1 = ConditionalByteReverse(LITTLE_ENDIAN_ORDER, data[i+2*j+1]);\ - AccumulateNH(nhA, d0+nhK[i+2*j+0], d1+nhK[i+2*j+1]);\ - if (T_128BitTag)\ - AccumulateNH(nhB, d0+nhK[i+2*j+2], d1+nhK[i+2*j+3]);\ - } - -#if (defined(_MSC_VER) && _MSC_VER < 1300) - bool T_128BitTag = m_is128; -#endif - size_t L1KeyLengthInWord64 = m_L1KeyLength / 8; - size_t innerLoopEnd = L1KeyLengthInWord64; - const word64 *nhK = m_nhKey(); - word64 *polyS = m_polyState(); - bool isFirstBlock = true; - size_t i; - - #if !VMAC_BOOL_32BIT - #if VMAC_BOOL_WORD128 - word128 a1=0, a2=0; - #else - word64 ah1=0, al1=0, ah2=0, al2=0; - #endif - word64 kh1, kl1, kh2, kl2; - kh1=(polyS+0*4+2)[0]; kl1=(polyS+0*4+2)[1]; - if (T_128BitTag) - { - kh2=(polyS+1*4+2)[0]; kl2=(polyS+1*4+2)[1]; - } - #endif - - do - { - DeclareNH(nhA); - DeclareNH(nhB); - - i = 0; - if (blocksRemainingInWord64 < L1KeyLengthInWord64) - { - if (blocksRemainingInWord64 % 8) - { - innerLoopEnd = blocksRemainingInWord64 % 8; - for (; i> 32); - nh1[0] = word32(nhA1); - nh2[0] = (nhA2 + (nhA1 >> 32)) & m62; - - if (T_128BitTag) - { - nh0[1] = word32(nhB0); - nhB1 += (nhB0 >> 32); - nh1[1] = word32(nhB1); - nh2[1] = (nhB2 + (nhB1 >> 32)) & m62; - } - - #define a0 (((word32 *)(polyS+i*4))[2+NativeByteOrder::ToEnum()]) - #define a1 (*(((word32 *)(polyS+i*4))+3-NativeByteOrder::ToEnum())) // workaround for GCC 3.2 - #define a2 (((word32 *)(polyS+i*4))[0+NativeByteOrder::ToEnum()]) - #define a3 (*(((word32 *)(polyS+i*4))+1-NativeByteOrder::ToEnum())) - #define aHi ((polyS+i*4)[0]) - #define k0 (((word32 *)(polyS+i*4+2))[2+NativeByteOrder::ToEnum()]) - #define k1 (*(((word32 *)(polyS+i*4+2))+3-NativeByteOrder::ToEnum())) - #define k2 (((word32 *)(polyS+i*4+2))[0+NativeByteOrder::ToEnum()]) - #define k3 (*(((word32 *)(polyS+i*4+2))+1-NativeByteOrder::ToEnum())) - #define kHi ((polyS+i*4+2)[0]) - - if (isFirstBlock) - { - isFirstBlock = false; - if (m_isFirstBlock) - { - m_isFirstBlock = false; - for (i=0; i<=(size_t)T_128BitTag; i++) - { - word64 t = (word64)nh0[i] + k0; - a0 = (word32)t; - t = (t >> 32) + nh1[i] + k1; - a1 = (word32)t; - aHi = (t >> 32) + nh2[i] + kHi; - } - continue; - } - } - for (i=0; i<=(size_t)T_128BitTag; i++) - { - word64 p, t; - word32 t2; - - p = MUL32(a3, 2*k3); - p += nh2[i]; - p += MUL32(a0, k2); - p += MUL32(a1, k1); - p += MUL32(a2, k0); - t2 = (word32)p; - p >>= 32; - p += MUL32(a0, k3); - p += MUL32(a1, k2); - p += MUL32(a2, k1); - p += MUL32(a3, k0); - t = (word64(word32(p) & 0x7fffffff) << 32) | t2; - p >>= 31; - p += nh0[i]; - p += MUL32(a0, k0); - p += MUL32(a1, 2*k3); - p += MUL32(a2, 2*k2); - p += MUL32(a3, 2*k1); - t2 = (word32)p; - p >>= 32; - p += nh1[i]; - p += MUL32(a0, k1); - p += MUL32(a1, k0); - p += MUL32(a2, 2*k3); - p += MUL32(a3, 2*k2); - a0 = t2; - a1 = (word32)p; - aHi = (p >> 32) + t; - } - - #undef a0 - #undef a1 - #undef a2 - #undef a3 - #undef aHi - #undef k0 - #undef k1 - #undef k2 - #undef k3 - #undef kHi - #else // #if VMAC_BOOL_32BIT - if (isFirstBlock) - { - isFirstBlock = false; - if (m_isFirstBlock) - { - m_isFirstBlock = false; - #if VMAC_BOOL_WORD128 - #define first_poly_step(a, kh, kl, m) a = (m & m126) + ((word128(kh) << 64) | kl) - - first_poly_step(a1, kh1, kl1, nhA); - if (T_128BitTag) - first_poly_step(a2, kh2, kl2, nhB); - #else - #define first_poly_step(ah, al, kh, kl, mh, ml) {\ - mh &= m62;\ - ADD128(mh, ml, kh, kl); \ - ah = mh; al = ml;} - - first_poly_step(ah1, al1, kh1, kl1, nhA1, nhA0); - if (T_128BitTag) - first_poly_step(ah2, al2, kh2, kl2, nhB1, nhB0); - #endif - continue; - } - else - { - #if VMAC_BOOL_WORD128 - a1 = (word128((polyS+0*4)[0]) << 64) | (polyS+0*4)[1]; - #else - ah1=(polyS+0*4)[0]; al1=(polyS+0*4)[1]; - #endif - if (T_128BitTag) - { - #if VMAC_BOOL_WORD128 - a2 = (word128((polyS+1*4)[0]) << 64) | (polyS+1*4)[1]; - #else - ah2=(polyS+1*4)[0]; al2=(polyS+1*4)[1]; - #endif - } - } - } - - #if VMAC_BOOL_WORD128 - #define poly_step(a, kh, kl, m) \ - { word128 t1, t2, t3, t4;\ - Multiply128(t2, a>>64, kl);\ - Multiply128(t3, a, kh);\ - Multiply128(t1, a, kl);\ - Multiply128(t4, a>>64, 2*kh);\ - t2 += t3;\ - t4 += t1;\ - t2 += t4>>64;\ - a = (word128(word64(t2)&m63) << 64) | word64(t4);\ - t2 *= 2;\ - a += m & m126;\ - a += t2>>64;} - - poly_step(a1, kh1, kl1, nhA); - if (T_128BitTag) - poly_step(a2, kh2, kl2, nhB); - #else - #define poly_step(ah, al, kh, kl, mh, ml) \ - { word64 t1h, t1l, t2h, t2l, t3h, t3l, z=0; \ - /* compute ab*cd, put bd into result registers */ \ - MUL64(t2h,t2l,ah,kl); \ - MUL64(t3h,t3l,al,kh); \ - MUL64(t1h,t1l,ah,2*kh); \ - MUL64(ah,al,al,kl); \ - /* add together ad + bc */ \ - ADD128(t2h,t2l,t3h,t3l); \ - /* add 2 * ac to result */ \ - ADD128(ah,al,t1h,t1l); \ - /* now (ah,al), (t2l,2*t2h) need summing */ \ - /* first add the high registers, carrying into t2h */ \ - ADD128(t2h,ah,z,t2l); \ - /* double t2h and add top bit of ah */ \ - t2h += t2h + (ah >> 63); \ - ah &= m63; \ - /* now add the low registers */ \ - mh &= m62; \ - ADD128(ah,al,mh,ml); \ - ADD128(ah,al,z,t2h); \ - } - - poly_step(ah1, al1, kh1, kl1, nhA1, nhA0); - if (T_128BitTag) - poly_step(ah2, al2, kh2, kl2, nhB1, nhB0); - #endif - #endif // #if VMAC_BOOL_32BIT - } while (blocksRemainingInWord64); - - #if VMAC_BOOL_WORD128 - (polyS+0*4)[0]=word64(a1>>64); (polyS+0*4)[1]=word64(a1); - if (T_128BitTag) - { - (polyS+1*4)[0]=word64(a2>>64); (polyS+1*4)[1]=word64(a2); - } - #elif !VMAC_BOOL_32BIT - (polyS+0*4)[0]=ah1; (polyS+0*4)[1]=al1; - if (T_128BitTag) - { - (polyS+1*4)[0]=ah2; (polyS+1*4)[1]=al2; - } - #endif -} - -inline void VMAC_Base::VHASH_Update(const word64 *data, size_t blocksRemainingInWord64) -{ -#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || (CRYPTOPP_BOOL_X32 && !defined(CRYPTOPP_DISABLE_VMAC_ASM)))) - if (HasSSE2()) - { - VHASH_Update_SSE2(data, blocksRemainingInWord64, 0); - if (m_is128) - VHASH_Update_SSE2(data, blocksRemainingInWord64, 1); - m_isFirstBlock = false; - } - else -#endif - { -#if defined(_MSC_VER) && _MSC_VER < 1300 - VHASH_Update_Template(data, blocksRemainingInWord64); -#else - if (m_is128) - VHASH_Update_Template(data, blocksRemainingInWord64); - else - VHASH_Update_Template(data, blocksRemainingInWord64); -#endif - } -} - -size_t VMAC_Base::HashMultipleBlocks(const word64 *data, size_t length) -{ - size_t remaining = ModPowerOf2(length, m_L1KeyLength); - VHASH_Update(data, (length-remaining)/8); - return remaining; -} - -static word64 L3Hash(const word64 *input, const word64 *l3Key, size_t len) -{ - word64 rh, rl, t, z=0; - word64 p1 = input[0], p2 = input[1]; - word64 k1 = l3Key[0], k2 = l3Key[1]; - - /* fully reduce (p1,p2)+(len,0) mod p127 */ - t = p1 >> 63; - p1 &= m63; - ADD128(p1, p2, len, t); - /* At this point, (p1,p2) is at most 2^127+(len<<64) */ - t = (p1 > m63) + ((p1 == m63) & (p2 == m64)); - ADD128(p1, p2, z, t); - p1 &= m63; - - /* compute (p1,p2)/(2^64-2^32) and (p1,p2)%(2^64-2^32) */ - t = p1 + (p2 >> 32); - t += (t >> 32); - t += (word32)t > 0xfffffffeU; - p1 += (t >> 32); - p2 += (p1 << 32); - - /* compute (p1+k1)%p64 and (p2+k2)%p64 */ - p1 += k1; - p1 += (0 - (p1 < k1)) & 257; - p2 += k2; - p2 += (0 - (p2 < k2)) & 257; - - /* compute (p1+k1)*(p2+k2)%p64 */ - MUL64(rh, rl, p1, p2); - t = rh >> 56; - ADD128(t, rl, z, rh); - rh <<= 8; - ADD128(t, rl, z, rh); - t += t << 8; - rl += t; - rl += (0 - (rl < t)) & 257; - rl += (0 - (rl > p64-1)) & 257; - return rl; -} - -void VMAC_Base::TruncatedFinal(byte *mac, size_t size) -{ - size_t len = ModPowerOf2(GetBitCountLo()/8, m_L1KeyLength); - - if (len) - { - memset(m_data()+len, 0, (0-len)%16); - VHASH_Update(DataBuf(), ((len+15)/16)*2); - len *= 8; // convert to bits - } - else if (m_isFirstBlock) - { - // special case for empty string - m_polyState()[0] = m_polyState()[2]; - m_polyState()[1] = m_polyState()[3]; - if (m_is128) - { - m_polyState()[4] = m_polyState()[6]; - m_polyState()[5] = m_polyState()[7]; - } - } - - if (m_is128) - { - word64 t[2]; - t[0] = L3Hash(m_polyState(), m_l3Key(), len) + GetWord(true, BIG_ENDIAN_ORDER, m_pad()); - t[1] = L3Hash(m_polyState()+4, m_l3Key()+2, len) + GetWord(true, BIG_ENDIAN_ORDER, m_pad()+8); - if (size == 16) - { - PutWord(false, BIG_ENDIAN_ORDER, mac, t[0]); - PutWord(false, BIG_ENDIAN_ORDER, mac+8, t[1]); - } - else - { - t[0] = ConditionalByteReverse(BIG_ENDIAN_ORDER, t[0]); - t[1] = ConditionalByteReverse(BIG_ENDIAN_ORDER, t[1]); - memcpy(mac, t, size); - } - } - else - { - word64 t = L3Hash(m_polyState(), m_l3Key(), len); - t += GetWord(true, BIG_ENDIAN_ORDER, m_pad() + (m_nonce()[IVSize()-1]&1) * 8); - if (size == 8) - PutWord(false, BIG_ENDIAN_ORDER, mac, t); - else - { - t = ConditionalByteReverse(BIG_ENDIAN_ORDER, t); - memcpy(mac, &t, size); - } - } -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/vmac.h b/external/crypto++-5.6.3/vmac.h deleted file mode 100644 index 229f89cd8..000000000 --- a/external/crypto++-5.6.3/vmac.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef CRYPTOPP_VMAC_H -#define CRYPTOPP_VMAC_H - -#include "cryptlib.h" -#include "iterhash.h" -#include "seckey.h" - -#if CRYPTOPP_BOOL_X32 -# define CRYPTOPP_DISABLE_VMAC_ASM -#endif - -NAMESPACE_BEGIN(CryptoPP) - -//! \class VMAC_Base -//! \brief Class specific methods used to operate the MAC. -class VMAC_Base : public IteratedHashBase -{ -public: - std::string AlgorithmName() const {return std::string("VMAC(") + GetCipher().AlgorithmName() + ")-" + IntToString(DigestSize()*8);} - unsigned int IVSize() const {return GetCipher().BlockSize();} - unsigned int MinIVLength() const {return 1;} - void Resynchronize(const byte *nonce, int length=-1); - void GetNextIV(RandomNumberGenerator &rng, byte *IV); - unsigned int DigestSize() const {return m_is128 ? 16 : 8;}; - void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); - void TruncatedFinal(byte *mac, size_t size); - unsigned int BlockSize() const {return m_L1KeyLength;} - ByteOrder GetByteOrder() const {return LITTLE_ENDIAN_ORDER;} - unsigned int OptimalDataAlignment() const; - -protected: - virtual BlockCipher & AccessCipher() =0; - virtual int DefaultDigestSize() const =0; - const BlockCipher & GetCipher() const {return const_cast(this)->AccessCipher();} - void HashEndianCorrectedBlock(const word64 *data); - size_t HashMultipleBlocks(const word64 *input, size_t length); - void Init() {} - word64* StateBuf() {return NULL;} - word64* DataBuf() {return (word64 *)m_data();} - - void VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWord64, int tagPart); -#if !(defined(_MSC_VER) && _MSC_VER < 1300) // can't use function template here with VC6 - template -#endif - void VHASH_Update_Template(const word64 *data, size_t blockRemainingInWord128); - void VHASH_Update(const word64 *data, size_t blocksRemainingInWord128); - -#if CRYPTOPP_DOXYGEN_PROCESSING - private: // hide from documentation -#endif - - CRYPTOPP_BLOCK_1(polyState, word64, 4*(m_is128+1)) - CRYPTOPP_BLOCK_2(nhKey, word64, m_L1KeyLength/sizeof(word64) + 2*m_is128) - CRYPTOPP_BLOCK_3(data, byte, m_L1KeyLength) - CRYPTOPP_BLOCK_4(l3Key, word64, 2*(m_is128+1)) - CRYPTOPP_BLOCK_5(nonce, byte, IVSize()) - CRYPTOPP_BLOCK_6(pad, byte, IVSize()) - CRYPTOPP_BLOCKS_END(6) - - bool m_is128, m_padCached, m_isFirstBlock; - int m_L1KeyLength; -}; - -//! \class VMAC -//! \brief The VMAC message authentication code -//! \details VMAC is a block cipher-based message authentication code algorithm -//! using a universal hash proposed by Ted Krovetz and Wei Dai in April 2007. The -//! algorithm was designed for high performance backed by a formal analysis. -//! \tparam T_BlockCipher block cipher -//! \tparam T_DigestBitSize digest size, in bits -//! \sa VMAC at the Crypto Lounge. -template -class VMAC : public SimpleKeyingInterfaceImpl > -{ -public: - static std::string StaticAlgorithmName() {return std::string("VMAC(") + T_BlockCipher::StaticAlgorithmName() + ")-" + IntToString(T_DigestBitSize);} - -private: - BlockCipher & AccessCipher() {return m_cipher;} - int DefaultDigestSize() const {return T_DigestBitSize/8;} - typename T_BlockCipher::Encryption m_cipher; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/vs2010.zip b/external/crypto++-5.6.3/vs2010.zip deleted file mode 100644 index b4cc9e3d3854c0af0b822f66ed97c17a8adf292e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19917 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 Wmt$pghaK83Ql?(yR<{!+LG`==$Qm<|O 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 -#include -#include -#include -#endif - -NAMESPACE_BEGIN(CryptoPP) - -unsigned int WaitObjectContainer::MaxWaitObjects() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - return MAXIMUM_WAIT_OBJECTS * (MAXIMUM_WAIT_OBJECTS-1); -#else - return FD_SETSIZE; -#endif -} - -WaitObjectContainer::WaitObjectContainer(WaitObjectsTracer* tracer) - : m_tracer(tracer), m_eventTimer(Timer::MILLISECONDS), m_lastResult(0) - , m_sameResultCount(0), m_noWaitTimer(Timer::MILLISECONDS) -{ - Clear(); - m_eventTimer.StartTimer(); -} - -void WaitObjectContainer::Clear() -{ -#ifdef USE_WINDOWS_STYLE_SOCKETS - m_handles.clear(); -#else - m_maxFd = 0; - FD_ZERO(&m_readfds); - FD_ZERO(&m_writefds); -#endif - m_noWait = false; - m_firstEventTime = 0; -} - -inline void WaitObjectContainer::SetLastResult(LastResultType result) -{ - if (result == m_lastResult) - m_sameResultCount++; - else - { - m_lastResult = result; - m_sameResultCount = 0; - } -} - -void WaitObjectContainer::DetectNoWait(LastResultType result, CallStack const& callStack) -{ - if (result == m_lastResult && m_noWaitTimer.ElapsedTime() > 1000) - { - if (m_sameResultCount > m_noWaitTimer.ElapsedTime()) - { - if (m_tracer) - { - std::string desc = "No wait loop detected - m_lastResult: "; - desc.append(IntToString(m_lastResult)).append(", call stack:"); - for (CallStack const* cs = &callStack; cs; cs = cs->Prev()) - desc.append("\n- ").append(cs->Format()); - m_tracer->TraceNoWaitLoop(desc); - } - try { throw 0; } catch (...) {} // help debugger break - } - - m_noWaitTimer.StartTimer(); - m_sameResultCount = 0; - } -} - -void WaitObjectContainer::SetNoWait(CallStack const& callStack) -{ - DetectNoWait(LastResultType(LASTRESULT_NOWAIT), CallStack("WaitObjectContainer::SetNoWait()", &callStack)); - m_noWait = true; -} - -void WaitObjectContainer::ScheduleEvent(double milliseconds, CallStack const& callStack) -{ - if (milliseconds <= 3) - DetectNoWait(LastResultType(LASTRESULT_SCHEDULED), CallStack("WaitObjectContainer::ScheduleEvent()", &callStack)); - double thisEventTime = m_eventTimer.ElapsedTimeAsDouble() + milliseconds; - if (!m_firstEventTime || thisEventTime < m_firstEventTime) - m_firstEventTime = thisEventTime; -} - -#ifdef USE_WINDOWS_STYLE_SOCKETS - -struct WaitingThreadData -{ - bool waitingToWait, terminate; - HANDLE startWaiting, stopWaiting; - const HANDLE *waitHandles; - unsigned int count; - HANDLE threadHandle; - DWORD threadId; - DWORD* error; -}; - -WaitObjectContainer::~WaitObjectContainer() -{ - try // don't let exceptions escape destructor - { - if (!m_threads.empty()) - { - HANDLE threadHandles[MAXIMUM_WAIT_OBJECTS] = {0}; - - unsigned int i; - for (i=0; i= WAIT_OBJECT_0) && (dwResult < (DWORD)m_threads.size())); - - for (i=0; i pThread((WaitingThreadData *)lParam); - WaitingThreadData &thread = *pThread; - std::vector handles; - - while (true) - { - thread.waitingToWait = true; - DWORD result = ::WaitForSingleObject(thread.startWaiting, INFINITE); - assert(result != WAIT_FAILED); - - thread.waitingToWait = false; - if (thread.terminate) - break; - if (!thread.count) - continue; - - handles.resize(thread.count + 1); - handles[0] = thread.stopWaiting; - std::copy(thread.waitHandles, thread.waitHandles+thread.count, handles.begin()+1); - - result = ::WaitForMultipleObjects((DWORD)handles.size(), &handles[0], FALSE, INFINITE); - assert(result != WAIT_FAILED); - - if (result == WAIT_OBJECT_0) - continue; // another thread finished waiting first, so do nothing - SetEvent(thread.stopWaiting); - if (!(result > WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + handles.size())) - { - assert(!"error in WaitingThread"); // break here so we can see which thread has an error - *thread.error = ::GetLastError(); - } - } - - return S_OK; // return a value here to avoid compiler warning -} - -void WaitObjectContainer::CreateThreads(unsigned int count) -{ - size_t currentCount = m_threads.size(); - if (currentCount == 0) - { - m_startWaiting = ::CreateEvent(NULL, TRUE, FALSE, NULL); - m_stopWaiting = ::CreateEvent(NULL, TRUE, FALSE, NULL); - } - - if (currentCount < count) - { - m_threads.resize(count); - for (size_t i=currentCount; i MAXIMUM_WAIT_OBJECTS) - { - // too many wait objects for a single WaitForMultipleObjects call, so use multiple threads - static const unsigned int WAIT_OBJECTS_PER_THREAD = MAXIMUM_WAIT_OBJECTS-1; - unsigned int nThreads = (unsigned int)((m_handles.size() + WAIT_OBJECTS_PER_THREAD - 1) / WAIT_OBJECTS_PER_THREAD); - if (nThreads > MAXIMUM_WAIT_OBJECTS) // still too many wait objects, maybe implement recursive threading later? - throw Err("WaitObjectContainer: number of wait objects exceeds limit"); - CreateThreads(nThreads); - DWORD error = S_OK; - - for (unsigned int i=0; i 0) - { - unsigned long timeAfterWait = t.ElapsedTime(); - OutputDebugString(("Handles " + IntToString(m_handles.size()) + ", Woke up by " + IntToString(result-WAIT_OBJECT_0) + ", Busied for " + IntToString(timeBeforeWait-lastTime) + " us, Waited for " + IntToString(timeAfterWait-timeBeforeWait) + " us, max " + IntToString(milliseconds) + "ms\n").c_str()); - lastTime = timeAfterWait; - } -#endif - if (result >= WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + m_handles.size()) - { - if (result == m_lastResult) - m_sameResultCount++; - else - { - m_lastResult = result; - m_sameResultCount = 0; - } - return true; - } - else if (result == WAIT_TIMEOUT) - { - SetLastResult(timeoutIsScheduledEvent ? LASTRESULT_SCHEDULED : LASTRESULT_TIMEOUT); - return timeoutIsScheduledEvent; - } - else - throw Err("WaitObjectContainer: WaitForMultipleObjects failed with error " + IntToString(::GetLastError())); - } -} - -#else // #ifdef USE_WINDOWS_STYLE_SOCKETS - -void WaitObjectContainer::AddReadFd(int fd, CallStack const& callStack) // TODO: do something with callStack -{ - CRYPTOPP_UNUSED(callStack); - FD_SET(fd, &m_readfds); - m_maxFd = STDMAX(m_maxFd, fd); -} - -void WaitObjectContainer::AddWriteFd(int fd, CallStack const& callStack) // TODO: do something with callStack -{ - CRYPTOPP_UNUSED(callStack); - FD_SET(fd, &m_writefds); - m_maxFd = STDMAX(m_maxFd, fd); -} - -bool WaitObjectContainer::Wait(unsigned long milliseconds) -{ - if (m_noWait || (!m_maxFd && !m_firstEventTime)) - return true; - - bool timeoutIsScheduledEvent = false; - - if (m_firstEventTime) - { - double timeToFirstEvent = SaturatingSubtract(m_firstEventTime, m_eventTimer.ElapsedTimeAsDouble()); - if (timeToFirstEvent <= milliseconds) - { - milliseconds = (unsigned long)timeToFirstEvent; - timeoutIsScheduledEvent = true; - } - } - - timeval tv, *timeout; - - if (milliseconds == INFINITE_TIME) - timeout = NULL; - else - { - tv.tv_sec = milliseconds / 1000; - tv.tv_usec = (milliseconds % 1000) * 1000; - timeout = &tv; - } - - int result = select(m_maxFd+1, &m_readfds, &m_writefds, NULL, timeout); - - if (result > 0) - return true; - else if (result == 0) - return timeoutIsScheduledEvent; - else - throw Err("WaitObjectContainer: select failed with error " + IntToString(errno)); -} - -#endif - -// ******************************************************** - -std::string CallStack::Format() const -{ - return m_info; -} - -std::string CallStackWithNr::Format() const -{ - return std::string(m_info) + " / nr: " + IntToString(m_nr); -} - -std::string CallStackWithStr::Format() const -{ - return std::string(m_info) + " / " + std::string(m_z); -} - -bool Waitable::Wait(unsigned long milliseconds, CallStack const& callStack) -{ - WaitObjectContainer container; - GetWaitObjects(container, callStack); // reduce clutter by not adding this func to stack - return container.Wait(milliseconds); -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/wait.h b/external/crypto++-5.6.3/wait.h deleted file mode 100644 index 773a747ea..000000000 --- a/external/crypto++-5.6.3/wait.h +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef CRYPTOPP_WAIT_H -#define CRYPTOPP_WAIT_H - -#include "config.h" - -#ifdef SOCKETS_AVAILABLE - -#include "misc.h" -#include "cryptlib.h" -#include - -#ifdef USE_WINDOWS_STYLE_SOCKETS -#include -#else -#include -#endif - -#if defined(__ANDROID__) -#include -#endif - -#include "hrtimer.h" - -NAMESPACE_BEGIN(CryptoPP) - -class Tracer -{ -public: - Tracer(unsigned int level) : m_level(level) {} - virtual ~Tracer() {} - -protected: - //! Override this in your most-derived tracer to do the actual tracing. - virtual void Trace(unsigned int n, std::string const& s) = 0; - - /*! By default, tracers will decide which trace messages to trace according to a trace level - mechanism. If your most-derived tracer uses a different mechanism, override this to - return false. If this method returns false, the default TraceXxxx(void) methods will all - return 0 and must be overridden explicitly by your tracer for trace messages you want. */ - virtual bool UsingDefaults() const { return true; } - -protected: - unsigned int m_level; - - void TraceIf(unsigned int n, std::string const&s) - { if (n) Trace(n, s); } - - /*! Returns nr if, according to the default log settings mechanism (using log levels), - the message should be traced. Returns 0 if the default trace level mechanism is not - in use, or if it is in use but the event should not be traced. Provided as a utility - method for easier and shorter coding of default TraceXxxx(void) implementations. */ - unsigned int Tracing(unsigned int nr, unsigned int minLevel) const - { return (UsingDefaults() && m_level >= minLevel) ? nr : 0; } -}; - -// Your Tracer-derived class should inherit as virtual public from Tracer or another -// Tracer-derived class, and should pass the log level in its constructor. You can use the -// following methods to begin and end your Tracer definition. - -// This constructor macro initializes Tracer directly even if not derived directly from it; -// this is intended, virtual base classes are always initialized by the most derived class. -#define CRYPTOPP_TRACER_CONSTRUCTOR(DERIVED) \ - public: DERIVED(unsigned int level = 0) : Tracer(level) {} - -#define CRYPTOPP_BEGIN_TRACER_CLASS_1(DERIVED, BASE1) \ - class DERIVED : virtual public BASE1, public NotCopyable { CRYPTOPP_TRACER_CONSTRUCTOR(DERIVED) - -#define CRYPTOPP_BEGIN_TRACER_CLASS_2(DERIVED, BASE1, BASE2) \ - class DERIVED : virtual public BASE1, virtual public BASE2, public NotCopyable { CRYPTOPP_TRACER_CONSTRUCTOR(DERIVED) - -#define CRYPTOPP_END_TRACER_CLASS }; - -// In your Tracer-derived class, you should define a globally unique event number for each -// new event defined. This can be done using the following macros. - -#define CRYPTOPP_BEGIN_TRACER_EVENTS(UNIQUENR) enum { EVENTBASE = UNIQUENR, -#define CRYPTOPP_TRACER_EVENT(EVENTNAME) EventNr_##EVENTNAME, -#define CRYPTOPP_END_TRACER_EVENTS }; - -// In your own Tracer-derived class, you must define two methods per new trace event type: -// - unsigned int TraceXxxx() const -// Your default implementation of this method should return the event number if according -// to the default trace level system the event should be traced, or 0 if it should not. -// - void TraceXxxx(string const& s) -// This method should call TraceIf(TraceXxxx(), s); to do the tracing. -// For your convenience, a macro to define these two types of methods are defined below. -// If you use this macro, you should also use the TRACER_EVENTS macros above to associate -// event names with numbers. - -#define CRYPTOPP_TRACER_EVENT_METHODS(EVENTNAME, LOGLEVEL) \ - virtual unsigned int Trace##EVENTNAME() const { return Tracing(EventNr_##EVENTNAME, LOGLEVEL); } \ - virtual void Trace##EVENTNAME(std::string const& s) { TraceIf(Trace##EVENTNAME(), s); } - - -/*! A simple unidirectional linked list with m_prev == 0 to indicate the final entry. - The aim of this implementation is to provide a very lightweight and practical - tracing mechanism with a low performance impact. Functions and methods supporting - this call-stack mechanism would take a parameter of the form "CallStack const& callStack", - and would pass this parameter to subsequent functions they call using the construct: - - SubFunc(arg1, arg2, CallStack("my func at place such and such", &callStack)); - - The advantage of this approach is that it is easy to use and should be very efficient, - involving no allocation from the heap, just a linked list of stack objects containing - pointers to static ASCIIZ strings (or possibly additional but simple data if derived). */ -class CallStack -{ -public: - CallStack(char const* i, CallStack const* p) : m_info(i), m_prev(p) {} - CallStack const* Prev() const { return m_prev; } - virtual std::string Format() const; - -protected: - char const* m_info; - CallStack const* m_prev; -}; - -/*! An extended CallStack entry type with an additional numeric parameter. */ -class CallStackWithNr : public CallStack -{ -public: - CallStackWithNr(char const* i, word32 n, CallStack const* p) : CallStack(i, p), m_nr(n) {} - std::string Format() const; - -protected: - word32 m_nr; -}; - -/*! An extended CallStack entry type with an additional string parameter. */ -class CallStackWithStr : public CallStack -{ -public: - CallStackWithStr(char const* i, char const* z, CallStack const* p) : CallStack(i, p), m_z(z) {} - std::string Format() const; - -protected: - char const* m_z; -}; - -// Thanks to Maximilian Zamorsky for help with http://connect.microsoft.com/VisualStudio/feedback/details/1570496/ -CRYPTOPP_BEGIN_TRACER_CLASS_1(WaitObjectsTracer, Tracer) - CRYPTOPP_BEGIN_TRACER_EVENTS(0x48752841) - CRYPTOPP_TRACER_EVENT(NoWaitLoop) - CRYPTOPP_END_TRACER_EVENTS - CRYPTOPP_TRACER_EVENT_METHODS(NoWaitLoop, 1) -CRYPTOPP_END_TRACER_CLASS - -struct WaitingThreadData; - -//! container of wait objects -class WaitObjectContainer : public NotCopyable -{ -public: - //! exception thrown by WaitObjectContainer - class Err : public Exception - { - public: - Err(const std::string& s) : Exception(IO_ERROR, s) {} - }; - - static unsigned int MaxWaitObjects(); - - WaitObjectContainer(WaitObjectsTracer* tracer = 0); - - void Clear(); - void SetNoWait(CallStack const& callStack); - void ScheduleEvent(double milliseconds, CallStack const& callStack); - // returns false if timed out - bool Wait(unsigned long milliseconds); - -#ifdef USE_WINDOWS_STYLE_SOCKETS -# ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~WaitObjectContainer(); -# else - ~WaitObjectContainer(); -#endif - void AddHandle(HANDLE handle, CallStack const& callStack); -#else - void AddReadFd(int fd, CallStack const& callStack); - void AddWriteFd(int fd, CallStack const& callStack); -#endif - -private: - WaitObjectsTracer* m_tracer; - -#ifdef USE_WINDOWS_STYLE_SOCKETS - void CreateThreads(unsigned int count); - std::vector m_handles; - std::vector m_threads; - HANDLE m_startWaiting; - HANDLE m_stopWaiting; -#else - fd_set m_readfds, m_writefds; - int m_maxFd; -#endif - bool m_noWait; - double m_firstEventTime; - Timer m_eventTimer; - -#ifdef USE_WINDOWS_STYLE_SOCKETS - typedef size_t LastResultType; -#else - typedef int LastResultType; -#endif - enum { LASTRESULT_NOWAIT = -1, LASTRESULT_SCHEDULED = -2, LASTRESULT_TIMEOUT = -3 }; - LastResultType m_lastResult; - unsigned int m_sameResultCount; - Timer m_noWaitTimer; - void SetLastResult(LastResultType result); - void DetectNoWait(LastResultType result, CallStack const& callStack); -}; - -NAMESPACE_END - -#endif - -#endif diff --git a/external/crypto++-5.6.3/wake.cpp b/external/crypto++-5.6.3/wake.cpp deleted file mode 100644 index 9bc7f79bc..000000000 --- a/external/crypto++-5.6.3/wake.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// wake.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "wake.h" -#include "smartptr.h" - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void WAKE_TestInstantiations() -{ - WAKE_OFB<>::Encryption x2; - WAKE_OFB<>::Decryption x4; -} -#endif - -inline word32 WAKE_Base::M(word32 x, word32 y) -{ - word32 w = x+y; - return (w>>8) ^ t[w & 0xff]; -} - -void WAKE_Base::GenKey(word32 k0, word32 k1, word32 k2, word32 k3) -{ - // this code is mostly copied from David Wheeler's paper "A Bulk Data Encryption Algorithm" - signed int x, z, p; - // x and z were declared as "long" in Wheeler's paper, which is a signed type. I don't know if that was intentional, but it's too late to change it now. -- Wei 7/4/2010 - CRYPTOPP_COMPILE_ASSERT(sizeof(x) == 4); - static unsigned int tt[10]= { - 0x726a8f3b, // table - 0xe69a3b5c, - 0xd3c71fe5, - 0xab3c73d2, - 0x4d3a8eb3, - 0x0396d6e8, - 0x3d4c2f7a, - 0x9ee27cf3, } ; - t[0] = k0; - t[1] = k1; - t[2] = k2; - t[3] = k3; - for (p=4 ; p<256 ; p++) - { - x=t[p-4]+t[p-1] ; // fill t - t[p]= (x>>3) ^ tt[x&7] ; - } - - for (p=0 ; p<23 ; p++) - t[p]+=t[p+89] ; // mix first entries - x=t[33] ; z=t[59] | 0x01000001 ; - z=z&0xff7fffff ; - for (p=0 ; p<256 ; p++) { //change top byte to - x=(x&0xff7fffff)+z ; // a permutation etc - t[p]=(t[p] & 0x00ffffff) ^ x ; } - - t[256]=t[0] ; - byte y=byte(x); - for (p=0 ; p<256 ; p++) { // further change perm. - t[p]=t[y=byte(t[p^y]^y)] ; // and other digits - t[y]=t[p+1] ; } -} - -template -void WAKE_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) -{ - CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(key); CRYPTOPP_UNUSED(length); - word32 k0, k1, k2, k3; - BlockGetAndPut::Get(key)(r3)(r4)(r5)(r6)(k0)(k1)(k2)(k3); - GenKey(k0, k1, k2, k3); -} - -// OFB -template -void WAKE_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) -{ -#define WAKE_OUTPUT(x)\ - while (iterationCount--)\ - {\ - CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, r6);\ - r3 = M(r3, r6);\ - r4 = M(r4, r3);\ - r5 = M(r5, r4);\ - r6 = M(r6, r5);\ - output += 4;\ - if (!(x & INPUT_NULL))\ - input += 4;\ - } - - typedef word32 WordType; - CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(WAKE_OUTPUT, 0); -} -/* -template -void WAKE_ROFB_Policy::Iterate(KeystreamOperation operation, byte *output, const byte *input, unsigned int iterationCount) -{ - KeystreamOutput keystreamOperation(operation, output, input); - - while (iterationCount--) - { - keystreamOperation(r6); - r3 = M(r3, r6); - r4 = M(r4, r3); - r5 = M(r5, r4); - r6 = M(r6, r5); - } -} -*/ -template class WAKE_Policy; -template class WAKE_Policy; -//template class WAKE_ROFB_Policy; -//template class WAKE_ROFB_Policy; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/wake.h b/external/crypto++-5.6.3/wake.h deleted file mode 100644 index c5c6fbe13..000000000 --- a/external/crypto++-5.6.3/wake.h +++ /dev/null @@ -1,68 +0,0 @@ -// wake.h - written and placed in the public domain by Wei Dai - -//! \file wake.h -//! \brief Classes for WAKE stream cipher - -#ifndef CRYPTOPP_WAKE_H -#define CRYPTOPP_WAKE_H - -#include "seckey.h" -#include "secblock.h" -#include "strciphr.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -template -struct WAKE_OFB_Info : public FixedKeyLength<32> -{ - static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";} -}; - -class CRYPTOPP_NO_VTABLE WAKE_Base -{ -protected: - word32 M(word32 x, word32 y); - void GenKey(word32 k0, word32 k1, word32 k2, word32 k3); - - word32 t[257]; - word32 r3, r4, r5, r6; -}; - -template -class CRYPTOPP_NO_VTABLE WAKE_Policy : public AdditiveCipherConcretePolicy, protected WAKE_Base -{ -protected: - void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - // OFB - void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); - bool CipherIsRandomAccess() const {return false;} -}; - -//! WAKE-OFB -template -struct WAKE_OFB : public WAKE_OFB_Info, public SymmetricCipherDocumentation -{ - typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, WAKE_OFB_Info > Encryption; - typedef Encryption Decryption; -}; - -/* -template -class WAKE_ROFB_Policy : public WAKE_Policy -{ -protected: - void Iterate(KeystreamOperation operation, byte *output, const byte *input, unsigned int iterationCount); -}; - -template -struct WAKE_ROFB : public WAKE_Info -{ - typedef SymmetricCipherTemplate, WAKE_ROFB_Policy > > Encryption; - typedef Encryption Decryption; -}; -*/ - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/whrlpool.cpp b/external/crypto++-5.6.3/whrlpool.cpp deleted file mode 100644 index bf70f320c..000000000 --- a/external/crypto++-5.6.3/whrlpool.cpp +++ /dev/null @@ -1,723 +0,0 @@ -// whrlpool.cpp - originally modified by Kevin Springle from -// Paulo Barreto and Vincent Rijmen's public domain code, whirlpool.c. -// Updated to Whirlpool version 3.0, optimized and SSE version added by Wei Dai -// All modifications are placed in the public domain - -// This is the original introductory comment: - -/** - * The Whirlpool hashing function. - * - *

- * References - * - *

- * The Whirlpool algorithm was developed by - * Paulo S. L. M. Barreto and - * Vincent Rijmen. - * - * See - * P.S.L.M. Barreto, V. Rijmen, - * ``The Whirlpool hashing function,'' - * NESSIE submission, 2000 (tweaked version, 2001), - * - * - * @author Paulo S.L.M. Barreto - * @author Vincent Rijmen. - * - * @version 3.0 (2003.03.12) - * - * ============================================================================= - * - * Differences from version 2.1: - * - * - Suboptimal diffusion matrix replaced by cir(1, 1, 4, 1, 8, 5, 2, 9). - * - * ============================================================================= - * - * Differences from version 2.0: - * - * - Generation of ISO/IEC 10118-3 test vectors. - * - Bug fix: nonzero carry was ignored when tallying the data length - * (this bug apparently only manifested itself when feeding data - * in pieces rather than in a single chunk at once). - * - Support for MS Visual C++ 64-bit integer arithmetic. - * - * Differences from version 1.0: - * - * - Original S-box replaced by the tweaked, hardware-efficient version. - * - * ============================================================================= - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "pch.h" -#include "config.h" - -#if CRYPTOPP_MSC_VERSION -# pragma warning(disable: 4127) -#endif - -#include "whrlpool.h" -#include "misc.h" -#include "cpu.h" - -// "Inline assembly operands don't work with .intel_syntax", -// http://llvm.org/bugs/show_bug.cgi?id=24232 -#if defined(CRYPTOPP_DISABLE_INTEL_ASM) -# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE -# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 -# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 -#endif - -NAMESPACE_BEGIN(CryptoPP) - -#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) -void Whirlpool_TestInstantiations() -{ - Whirlpool x; -} -#endif - -void Whirlpool::InitState(HashWordType *state) -{ - memset(state, 0, 8*sizeof(state[0])); -} - -void Whirlpool::TruncatedFinal(byte *hash, size_t size) -{ - ThrowIfInvalidTruncatedSize(size); - - PadLastBlock(32); - CorrectEndianess(m_data, m_data, 32); - - m_data[m_data.size()-4] = 0; - m_data[m_data.size()-3] = 0; - m_data[m_data.size()-2] = GetBitCountHi(); - m_data[m_data.size()-1] = GetBitCountLo(); - - Transform(m_state, m_data); - CorrectEndianess(m_state, m_state, DigestSize()); - memcpy(hash, m_state, size); - - Restart(); // reinit for next use -} - -/* - * The number of rounds of the internal dedicated block cipher. - */ -#define R 10 - -/* - * Though Whirlpool is endianness-neutral, the encryption tables are listed - * in BIG-ENDIAN format, which is adopted throughout this implementation - * (but little-endian notation would be equally suitable if consistently - * employed). - */ - -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE -CRYPTOPP_ALIGN_DATA(16) static const word64 Whirlpool_C[4*256+R] CRYPTOPP_SECTION_ALIGN16 = { -#else -static const word64 Whirlpool_C[4*256+R] = { -#endif - W64LIT(0x18186018c07830d8), W64LIT(0x23238c2305af4626), W64LIT(0xc6c63fc67ef991b8), W64LIT(0xe8e887e8136fcdfb), - W64LIT(0x878726874ca113cb), W64LIT(0xb8b8dab8a9626d11), W64LIT(0x0101040108050209), W64LIT(0x4f4f214f426e9e0d), - W64LIT(0x3636d836adee6c9b), W64LIT(0xa6a6a2a6590451ff), W64LIT(0xd2d26fd2debdb90c), W64LIT(0xf5f5f3f5fb06f70e), - W64LIT(0x7979f979ef80f296), W64LIT(0x6f6fa16f5fcede30), W64LIT(0x91917e91fcef3f6d), W64LIT(0x52525552aa07a4f8), - W64LIT(0x60609d6027fdc047), W64LIT(0xbcbccabc89766535), W64LIT(0x9b9b569baccd2b37), W64LIT(0x8e8e028e048c018a), - W64LIT(0xa3a3b6a371155bd2), W64LIT(0x0c0c300c603c186c), W64LIT(0x7b7bf17bff8af684), W64LIT(0x3535d435b5e16a80), - W64LIT(0x1d1d741de8693af5), W64LIT(0xe0e0a7e05347ddb3), W64LIT(0xd7d77bd7f6acb321), W64LIT(0xc2c22fc25eed999c), - W64LIT(0x2e2eb82e6d965c43), W64LIT(0x4b4b314b627a9629), W64LIT(0xfefedffea321e15d), W64LIT(0x575741578216aed5), - W64LIT(0x15155415a8412abd), W64LIT(0x7777c1779fb6eee8), W64LIT(0x3737dc37a5eb6e92), W64LIT(0xe5e5b3e57b56d79e), - W64LIT(0x9f9f469f8cd92313), W64LIT(0xf0f0e7f0d317fd23), W64LIT(0x4a4a354a6a7f9420), W64LIT(0xdada4fda9e95a944), - W64LIT(0x58587d58fa25b0a2), W64LIT(0xc9c903c906ca8fcf), W64LIT(0x2929a429558d527c), W64LIT(0x0a0a280a5022145a), - W64LIT(0xb1b1feb1e14f7f50), W64LIT(0xa0a0baa0691a5dc9), W64LIT(0x6b6bb16b7fdad614), W64LIT(0x85852e855cab17d9), - W64LIT(0xbdbdcebd8173673c), W64LIT(0x5d5d695dd234ba8f), W64LIT(0x1010401080502090), W64LIT(0xf4f4f7f4f303f507), - W64LIT(0xcbcb0bcb16c08bdd), W64LIT(0x3e3ef83eedc67cd3), W64LIT(0x0505140528110a2d), W64LIT(0x676781671fe6ce78), - W64LIT(0xe4e4b7e47353d597), W64LIT(0x27279c2725bb4e02), W64LIT(0x4141194132588273), W64LIT(0x8b8b168b2c9d0ba7), - W64LIT(0xa7a7a6a7510153f6), W64LIT(0x7d7de97dcf94fab2), W64LIT(0x95956e95dcfb3749), W64LIT(0xd8d847d88e9fad56), - W64LIT(0xfbfbcbfb8b30eb70), W64LIT(0xeeee9fee2371c1cd), W64LIT(0x7c7ced7cc791f8bb), W64LIT(0x6666856617e3cc71), - W64LIT(0xdddd53dda68ea77b), W64LIT(0x17175c17b84b2eaf), W64LIT(0x4747014702468e45), W64LIT(0x9e9e429e84dc211a), - W64LIT(0xcaca0fca1ec589d4), W64LIT(0x2d2db42d75995a58), W64LIT(0xbfbfc6bf9179632e), W64LIT(0x07071c07381b0e3f), - W64LIT(0xadad8ead012347ac), W64LIT(0x5a5a755aea2fb4b0), W64LIT(0x838336836cb51bef), W64LIT(0x3333cc3385ff66b6), - W64LIT(0x636391633ff2c65c), W64LIT(0x02020802100a0412), W64LIT(0xaaaa92aa39384993), W64LIT(0x7171d971afa8e2de), - W64LIT(0xc8c807c80ecf8dc6), W64LIT(0x19196419c87d32d1), W64LIT(0x494939497270923b), W64LIT(0xd9d943d9869aaf5f), - W64LIT(0xf2f2eff2c31df931), W64LIT(0xe3e3abe34b48dba8), W64LIT(0x5b5b715be22ab6b9), W64LIT(0x88881a8834920dbc), - W64LIT(0x9a9a529aa4c8293e), W64LIT(0x262698262dbe4c0b), W64LIT(0x3232c8328dfa64bf), W64LIT(0xb0b0fab0e94a7d59), - W64LIT(0xe9e983e91b6acff2), W64LIT(0x0f0f3c0f78331e77), W64LIT(0xd5d573d5e6a6b733), W64LIT(0x80803a8074ba1df4), - W64LIT(0xbebec2be997c6127), W64LIT(0xcdcd13cd26de87eb), W64LIT(0x3434d034bde46889), W64LIT(0x48483d487a759032), - W64LIT(0xffffdbffab24e354), W64LIT(0x7a7af57af78ff48d), W64LIT(0x90907a90f4ea3d64), W64LIT(0x5f5f615fc23ebe9d), - W64LIT(0x202080201da0403d), W64LIT(0x6868bd6867d5d00f), W64LIT(0x1a1a681ad07234ca), W64LIT(0xaeae82ae192c41b7), - W64LIT(0xb4b4eab4c95e757d), W64LIT(0x54544d549a19a8ce), W64LIT(0x93937693ece53b7f), W64LIT(0x222288220daa442f), - W64LIT(0x64648d6407e9c863), W64LIT(0xf1f1e3f1db12ff2a), W64LIT(0x7373d173bfa2e6cc), W64LIT(0x12124812905a2482), - W64LIT(0x40401d403a5d807a), W64LIT(0x0808200840281048), W64LIT(0xc3c32bc356e89b95), W64LIT(0xecec97ec337bc5df), - W64LIT(0xdbdb4bdb9690ab4d), W64LIT(0xa1a1bea1611f5fc0), W64LIT(0x8d8d0e8d1c830791), W64LIT(0x3d3df43df5c97ac8), - W64LIT(0x97976697ccf1335b), W64LIT(0x0000000000000000), W64LIT(0xcfcf1bcf36d483f9), W64LIT(0x2b2bac2b4587566e), - W64LIT(0x7676c57697b3ece1), W64LIT(0x8282328264b019e6), W64LIT(0xd6d67fd6fea9b128), W64LIT(0x1b1b6c1bd87736c3), - W64LIT(0xb5b5eeb5c15b7774), W64LIT(0xafaf86af112943be), W64LIT(0x6a6ab56a77dfd41d), W64LIT(0x50505d50ba0da0ea), - W64LIT(0x45450945124c8a57), W64LIT(0xf3f3ebf3cb18fb38), W64LIT(0x3030c0309df060ad), W64LIT(0xefef9bef2b74c3c4), - W64LIT(0x3f3ffc3fe5c37eda), W64LIT(0x55554955921caac7), W64LIT(0xa2a2b2a2791059db), W64LIT(0xeaea8fea0365c9e9), - W64LIT(0x656589650fecca6a), W64LIT(0xbabad2bab9686903), W64LIT(0x2f2fbc2f65935e4a), W64LIT(0xc0c027c04ee79d8e), - W64LIT(0xdede5fdebe81a160), W64LIT(0x1c1c701ce06c38fc), W64LIT(0xfdfdd3fdbb2ee746), W64LIT(0x4d4d294d52649a1f), - W64LIT(0x92927292e4e03976), W64LIT(0x7575c9758fbceafa), W64LIT(0x06061806301e0c36), W64LIT(0x8a8a128a249809ae), - W64LIT(0xb2b2f2b2f940794b), W64LIT(0xe6e6bfe66359d185), W64LIT(0x0e0e380e70361c7e), W64LIT(0x1f1f7c1ff8633ee7), - W64LIT(0x6262956237f7c455), W64LIT(0xd4d477d4eea3b53a), W64LIT(0xa8a89aa829324d81), W64LIT(0x96966296c4f43152), - W64LIT(0xf9f9c3f99b3aef62), W64LIT(0xc5c533c566f697a3), W64LIT(0x2525942535b14a10), W64LIT(0x59597959f220b2ab), - W64LIT(0x84842a8454ae15d0), W64LIT(0x7272d572b7a7e4c5), W64LIT(0x3939e439d5dd72ec), W64LIT(0x4c4c2d4c5a619816), - W64LIT(0x5e5e655eca3bbc94), W64LIT(0x7878fd78e785f09f), W64LIT(0x3838e038ddd870e5), W64LIT(0x8c8c0a8c14860598), - W64LIT(0xd1d163d1c6b2bf17), W64LIT(0xa5a5aea5410b57e4), W64LIT(0xe2e2afe2434dd9a1), W64LIT(0x616199612ff8c24e), - W64LIT(0xb3b3f6b3f1457b42), W64LIT(0x2121842115a54234), W64LIT(0x9c9c4a9c94d62508), W64LIT(0x1e1e781ef0663cee), - W64LIT(0x4343114322528661), W64LIT(0xc7c73bc776fc93b1), W64LIT(0xfcfcd7fcb32be54f), W64LIT(0x0404100420140824), - W64LIT(0x51515951b208a2e3), W64LIT(0x99995e99bcc72f25), W64LIT(0x6d6da96d4fc4da22), W64LIT(0x0d0d340d68391a65), - W64LIT(0xfafacffa8335e979), W64LIT(0xdfdf5bdfb684a369), W64LIT(0x7e7ee57ed79bfca9), W64LIT(0x242490243db44819), - W64LIT(0x3b3bec3bc5d776fe), W64LIT(0xabab96ab313d4b9a), W64LIT(0xcece1fce3ed181f0), W64LIT(0x1111441188552299), - W64LIT(0x8f8f068f0c890383), W64LIT(0x4e4e254e4a6b9c04), W64LIT(0xb7b7e6b7d1517366), W64LIT(0xebeb8beb0b60cbe0), - W64LIT(0x3c3cf03cfdcc78c1), W64LIT(0x81813e817cbf1ffd), W64LIT(0x94946a94d4fe3540), W64LIT(0xf7f7fbf7eb0cf31c), - W64LIT(0xb9b9deb9a1676f18), W64LIT(0x13134c13985f268b), W64LIT(0x2c2cb02c7d9c5851), W64LIT(0xd3d36bd3d6b8bb05), - W64LIT(0xe7e7bbe76b5cd38c), W64LIT(0x6e6ea56e57cbdc39), W64LIT(0xc4c437c46ef395aa), W64LIT(0x03030c03180f061b), - W64LIT(0x565645568a13acdc), W64LIT(0x44440d441a49885e), W64LIT(0x7f7fe17fdf9efea0), W64LIT(0xa9a99ea921374f88), - W64LIT(0x2a2aa82a4d825467), W64LIT(0xbbbbd6bbb16d6b0a), W64LIT(0xc1c123c146e29f87), W64LIT(0x53535153a202a6f1), - W64LIT(0xdcdc57dcae8ba572), W64LIT(0x0b0b2c0b58271653), W64LIT(0x9d9d4e9d9cd32701), W64LIT(0x6c6cad6c47c1d82b), - W64LIT(0x3131c43195f562a4), W64LIT(0x7474cd7487b9e8f3), W64LIT(0xf6f6fff6e309f115), W64LIT(0x464605460a438c4c), - W64LIT(0xacac8aac092645a5), W64LIT(0x89891e893c970fb5), W64LIT(0x14145014a04428b4), W64LIT(0xe1e1a3e15b42dfba), - W64LIT(0x16165816b04e2ca6), W64LIT(0x3a3ae83acdd274f7), W64LIT(0x6969b9696fd0d206), W64LIT(0x09092409482d1241), - W64LIT(0x7070dd70a7ade0d7), W64LIT(0xb6b6e2b6d954716f), W64LIT(0xd0d067d0ceb7bd1e), W64LIT(0xeded93ed3b7ec7d6), - W64LIT(0xcccc17cc2edb85e2), W64LIT(0x424215422a578468), W64LIT(0x98985a98b4c22d2c), W64LIT(0xa4a4aaa4490e55ed), - W64LIT(0x2828a0285d885075), W64LIT(0x5c5c6d5cda31b886), W64LIT(0xf8f8c7f8933fed6b), W64LIT(0x8686228644a411c2), - - W64LIT(0xd818186018c07830), W64LIT(0x2623238c2305af46), W64LIT(0xb8c6c63fc67ef991), W64LIT(0xfbe8e887e8136fcd), - W64LIT(0xcb878726874ca113), W64LIT(0x11b8b8dab8a9626d), W64LIT(0x0901010401080502), W64LIT(0x0d4f4f214f426e9e), - W64LIT(0x9b3636d836adee6c), W64LIT(0xffa6a6a2a6590451), W64LIT(0x0cd2d26fd2debdb9), W64LIT(0x0ef5f5f3f5fb06f7), - W64LIT(0x967979f979ef80f2), W64LIT(0x306f6fa16f5fcede), W64LIT(0x6d91917e91fcef3f), W64LIT(0xf852525552aa07a4), - W64LIT(0x4760609d6027fdc0), W64LIT(0x35bcbccabc897665), W64LIT(0x379b9b569baccd2b), W64LIT(0x8a8e8e028e048c01), - W64LIT(0xd2a3a3b6a371155b), W64LIT(0x6c0c0c300c603c18), W64LIT(0x847b7bf17bff8af6), W64LIT(0x803535d435b5e16a), - W64LIT(0xf51d1d741de8693a), W64LIT(0xb3e0e0a7e05347dd), W64LIT(0x21d7d77bd7f6acb3), W64LIT(0x9cc2c22fc25eed99), - W64LIT(0x432e2eb82e6d965c), W64LIT(0x294b4b314b627a96), W64LIT(0x5dfefedffea321e1), W64LIT(0xd5575741578216ae), - W64LIT(0xbd15155415a8412a), W64LIT(0xe87777c1779fb6ee), W64LIT(0x923737dc37a5eb6e), W64LIT(0x9ee5e5b3e57b56d7), - W64LIT(0x139f9f469f8cd923), W64LIT(0x23f0f0e7f0d317fd), W64LIT(0x204a4a354a6a7f94), W64LIT(0x44dada4fda9e95a9), - W64LIT(0xa258587d58fa25b0), W64LIT(0xcfc9c903c906ca8f), W64LIT(0x7c2929a429558d52), W64LIT(0x5a0a0a280a502214), - W64LIT(0x50b1b1feb1e14f7f), W64LIT(0xc9a0a0baa0691a5d), W64LIT(0x146b6bb16b7fdad6), W64LIT(0xd985852e855cab17), - W64LIT(0x3cbdbdcebd817367), W64LIT(0x8f5d5d695dd234ba), W64LIT(0x9010104010805020), W64LIT(0x07f4f4f7f4f303f5), - W64LIT(0xddcbcb0bcb16c08b), W64LIT(0xd33e3ef83eedc67c), W64LIT(0x2d0505140528110a), W64LIT(0x78676781671fe6ce), - W64LIT(0x97e4e4b7e47353d5), W64LIT(0x0227279c2725bb4e), W64LIT(0x7341411941325882), W64LIT(0xa78b8b168b2c9d0b), - W64LIT(0xf6a7a7a6a7510153), W64LIT(0xb27d7de97dcf94fa), W64LIT(0x4995956e95dcfb37), W64LIT(0x56d8d847d88e9fad), - W64LIT(0x70fbfbcbfb8b30eb), W64LIT(0xcdeeee9fee2371c1), W64LIT(0xbb7c7ced7cc791f8), W64LIT(0x716666856617e3cc), - W64LIT(0x7bdddd53dda68ea7), W64LIT(0xaf17175c17b84b2e), W64LIT(0x454747014702468e), W64LIT(0x1a9e9e429e84dc21), - W64LIT(0xd4caca0fca1ec589), W64LIT(0x582d2db42d75995a), W64LIT(0x2ebfbfc6bf917963), W64LIT(0x3f07071c07381b0e), - W64LIT(0xacadad8ead012347), W64LIT(0xb05a5a755aea2fb4), W64LIT(0xef838336836cb51b), W64LIT(0xb63333cc3385ff66), - W64LIT(0x5c636391633ff2c6), W64LIT(0x1202020802100a04), W64LIT(0x93aaaa92aa393849), W64LIT(0xde7171d971afa8e2), - W64LIT(0xc6c8c807c80ecf8d), W64LIT(0xd119196419c87d32), W64LIT(0x3b49493949727092), W64LIT(0x5fd9d943d9869aaf), - W64LIT(0x31f2f2eff2c31df9), W64LIT(0xa8e3e3abe34b48db), W64LIT(0xb95b5b715be22ab6), W64LIT(0xbc88881a8834920d), - W64LIT(0x3e9a9a529aa4c829), W64LIT(0x0b262698262dbe4c), W64LIT(0xbf3232c8328dfa64), W64LIT(0x59b0b0fab0e94a7d), - W64LIT(0xf2e9e983e91b6acf), W64LIT(0x770f0f3c0f78331e), W64LIT(0x33d5d573d5e6a6b7), W64LIT(0xf480803a8074ba1d), - W64LIT(0x27bebec2be997c61), W64LIT(0xebcdcd13cd26de87), W64LIT(0x893434d034bde468), W64LIT(0x3248483d487a7590), - W64LIT(0x54ffffdbffab24e3), W64LIT(0x8d7a7af57af78ff4), W64LIT(0x6490907a90f4ea3d), W64LIT(0x9d5f5f615fc23ebe), - W64LIT(0x3d202080201da040), W64LIT(0x0f6868bd6867d5d0), W64LIT(0xca1a1a681ad07234), W64LIT(0xb7aeae82ae192c41), - W64LIT(0x7db4b4eab4c95e75), W64LIT(0xce54544d549a19a8), W64LIT(0x7f93937693ece53b), W64LIT(0x2f222288220daa44), - W64LIT(0x6364648d6407e9c8), W64LIT(0x2af1f1e3f1db12ff), W64LIT(0xcc7373d173bfa2e6), W64LIT(0x8212124812905a24), - W64LIT(0x7a40401d403a5d80), W64LIT(0x4808082008402810), W64LIT(0x95c3c32bc356e89b), W64LIT(0xdfecec97ec337bc5), - W64LIT(0x4ddbdb4bdb9690ab), W64LIT(0xc0a1a1bea1611f5f), W64LIT(0x918d8d0e8d1c8307), W64LIT(0xc83d3df43df5c97a), - W64LIT(0x5b97976697ccf133), W64LIT(0x0000000000000000), W64LIT(0xf9cfcf1bcf36d483), W64LIT(0x6e2b2bac2b458756), - W64LIT(0xe17676c57697b3ec), W64LIT(0xe68282328264b019), W64LIT(0x28d6d67fd6fea9b1), W64LIT(0xc31b1b6c1bd87736), - W64LIT(0x74b5b5eeb5c15b77), W64LIT(0xbeafaf86af112943), W64LIT(0x1d6a6ab56a77dfd4), W64LIT(0xea50505d50ba0da0), - W64LIT(0x5745450945124c8a), W64LIT(0x38f3f3ebf3cb18fb), W64LIT(0xad3030c0309df060), W64LIT(0xc4efef9bef2b74c3), - W64LIT(0xda3f3ffc3fe5c37e), W64LIT(0xc755554955921caa), W64LIT(0xdba2a2b2a2791059), W64LIT(0xe9eaea8fea0365c9), - W64LIT(0x6a656589650fecca), W64LIT(0x03babad2bab96869), W64LIT(0x4a2f2fbc2f65935e), W64LIT(0x8ec0c027c04ee79d), - W64LIT(0x60dede5fdebe81a1), W64LIT(0xfc1c1c701ce06c38), W64LIT(0x46fdfdd3fdbb2ee7), W64LIT(0x1f4d4d294d52649a), - W64LIT(0x7692927292e4e039), W64LIT(0xfa7575c9758fbcea), W64LIT(0x3606061806301e0c), W64LIT(0xae8a8a128a249809), - W64LIT(0x4bb2b2f2b2f94079), W64LIT(0x85e6e6bfe66359d1), W64LIT(0x7e0e0e380e70361c), W64LIT(0xe71f1f7c1ff8633e), - W64LIT(0x556262956237f7c4), W64LIT(0x3ad4d477d4eea3b5), W64LIT(0x81a8a89aa829324d), W64LIT(0x5296966296c4f431), - W64LIT(0x62f9f9c3f99b3aef), W64LIT(0xa3c5c533c566f697), W64LIT(0x102525942535b14a), W64LIT(0xab59597959f220b2), - W64LIT(0xd084842a8454ae15), W64LIT(0xc57272d572b7a7e4), W64LIT(0xec3939e439d5dd72), W64LIT(0x164c4c2d4c5a6198), - W64LIT(0x945e5e655eca3bbc), W64LIT(0x9f7878fd78e785f0), W64LIT(0xe53838e038ddd870), W64LIT(0x988c8c0a8c148605), - W64LIT(0x17d1d163d1c6b2bf), W64LIT(0xe4a5a5aea5410b57), W64LIT(0xa1e2e2afe2434dd9), W64LIT(0x4e616199612ff8c2), - W64LIT(0x42b3b3f6b3f1457b), W64LIT(0x342121842115a542), W64LIT(0x089c9c4a9c94d625), W64LIT(0xee1e1e781ef0663c), - W64LIT(0x6143431143225286), W64LIT(0xb1c7c73bc776fc93), W64LIT(0x4ffcfcd7fcb32be5), W64LIT(0x2404041004201408), - W64LIT(0xe351515951b208a2), W64LIT(0x2599995e99bcc72f), W64LIT(0x226d6da96d4fc4da), W64LIT(0x650d0d340d68391a), - W64LIT(0x79fafacffa8335e9), W64LIT(0x69dfdf5bdfb684a3), W64LIT(0xa97e7ee57ed79bfc), W64LIT(0x19242490243db448), - W64LIT(0xfe3b3bec3bc5d776), W64LIT(0x9aabab96ab313d4b), W64LIT(0xf0cece1fce3ed181), W64LIT(0x9911114411885522), - W64LIT(0x838f8f068f0c8903), W64LIT(0x044e4e254e4a6b9c), W64LIT(0x66b7b7e6b7d15173), W64LIT(0xe0ebeb8beb0b60cb), - W64LIT(0xc13c3cf03cfdcc78), W64LIT(0xfd81813e817cbf1f), W64LIT(0x4094946a94d4fe35), W64LIT(0x1cf7f7fbf7eb0cf3), - W64LIT(0x18b9b9deb9a1676f), W64LIT(0x8b13134c13985f26), W64LIT(0x512c2cb02c7d9c58), W64LIT(0x05d3d36bd3d6b8bb), - W64LIT(0x8ce7e7bbe76b5cd3), W64LIT(0x396e6ea56e57cbdc), W64LIT(0xaac4c437c46ef395), W64LIT(0x1b03030c03180f06), - W64LIT(0xdc565645568a13ac), W64LIT(0x5e44440d441a4988), W64LIT(0xa07f7fe17fdf9efe), W64LIT(0x88a9a99ea921374f), - W64LIT(0x672a2aa82a4d8254), W64LIT(0x0abbbbd6bbb16d6b), W64LIT(0x87c1c123c146e29f), W64LIT(0xf153535153a202a6), - W64LIT(0x72dcdc57dcae8ba5), W64LIT(0x530b0b2c0b582716), W64LIT(0x019d9d4e9d9cd327), W64LIT(0x2b6c6cad6c47c1d8), - W64LIT(0xa43131c43195f562), W64LIT(0xf37474cd7487b9e8), W64LIT(0x15f6f6fff6e309f1), W64LIT(0x4c464605460a438c), - W64LIT(0xa5acac8aac092645), W64LIT(0xb589891e893c970f), W64LIT(0xb414145014a04428), W64LIT(0xbae1e1a3e15b42df), - W64LIT(0xa616165816b04e2c), W64LIT(0xf73a3ae83acdd274), W64LIT(0x066969b9696fd0d2), W64LIT(0x4109092409482d12), - W64LIT(0xd77070dd70a7ade0), W64LIT(0x6fb6b6e2b6d95471), W64LIT(0x1ed0d067d0ceb7bd), W64LIT(0xd6eded93ed3b7ec7), - W64LIT(0xe2cccc17cc2edb85), W64LIT(0x68424215422a5784), W64LIT(0x2c98985a98b4c22d), W64LIT(0xeda4a4aaa4490e55), - W64LIT(0x752828a0285d8850), W64LIT(0x865c5c6d5cda31b8), W64LIT(0x6bf8f8c7f8933fed), W64LIT(0xc28686228644a411), - - W64LIT(0x30d818186018c078), W64LIT(0x462623238c2305af), W64LIT(0x91b8c6c63fc67ef9), W64LIT(0xcdfbe8e887e8136f), - W64LIT(0x13cb878726874ca1), W64LIT(0x6d11b8b8dab8a962), W64LIT(0x0209010104010805), W64LIT(0x9e0d4f4f214f426e), - W64LIT(0x6c9b3636d836adee), W64LIT(0x51ffa6a6a2a65904), W64LIT(0xb90cd2d26fd2debd), W64LIT(0xf70ef5f5f3f5fb06), - W64LIT(0xf2967979f979ef80), W64LIT(0xde306f6fa16f5fce), W64LIT(0x3f6d91917e91fcef), W64LIT(0xa4f852525552aa07), - W64LIT(0xc04760609d6027fd), W64LIT(0x6535bcbccabc8976), W64LIT(0x2b379b9b569baccd), W64LIT(0x018a8e8e028e048c), - W64LIT(0x5bd2a3a3b6a37115), W64LIT(0x186c0c0c300c603c), W64LIT(0xf6847b7bf17bff8a), W64LIT(0x6a803535d435b5e1), - W64LIT(0x3af51d1d741de869), W64LIT(0xddb3e0e0a7e05347), W64LIT(0xb321d7d77bd7f6ac), W64LIT(0x999cc2c22fc25eed), - W64LIT(0x5c432e2eb82e6d96), W64LIT(0x96294b4b314b627a), W64LIT(0xe15dfefedffea321), W64LIT(0xaed5575741578216), - W64LIT(0x2abd15155415a841), W64LIT(0xeee87777c1779fb6), W64LIT(0x6e923737dc37a5eb), W64LIT(0xd79ee5e5b3e57b56), - W64LIT(0x23139f9f469f8cd9), W64LIT(0xfd23f0f0e7f0d317), W64LIT(0x94204a4a354a6a7f), W64LIT(0xa944dada4fda9e95), - W64LIT(0xb0a258587d58fa25), W64LIT(0x8fcfc9c903c906ca), W64LIT(0x527c2929a429558d), W64LIT(0x145a0a0a280a5022), - W64LIT(0x7f50b1b1feb1e14f), W64LIT(0x5dc9a0a0baa0691a), W64LIT(0xd6146b6bb16b7fda), W64LIT(0x17d985852e855cab), - W64LIT(0x673cbdbdcebd8173), W64LIT(0xba8f5d5d695dd234), W64LIT(0x2090101040108050), W64LIT(0xf507f4f4f7f4f303), - W64LIT(0x8bddcbcb0bcb16c0), W64LIT(0x7cd33e3ef83eedc6), W64LIT(0x0a2d050514052811), W64LIT(0xce78676781671fe6), - W64LIT(0xd597e4e4b7e47353), W64LIT(0x4e0227279c2725bb), W64LIT(0x8273414119413258), W64LIT(0x0ba78b8b168b2c9d), - W64LIT(0x53f6a7a7a6a75101), W64LIT(0xfab27d7de97dcf94), W64LIT(0x374995956e95dcfb), W64LIT(0xad56d8d847d88e9f), - W64LIT(0xeb70fbfbcbfb8b30), W64LIT(0xc1cdeeee9fee2371), W64LIT(0xf8bb7c7ced7cc791), W64LIT(0xcc716666856617e3), - W64LIT(0xa77bdddd53dda68e), W64LIT(0x2eaf17175c17b84b), W64LIT(0x8e45474701470246), W64LIT(0x211a9e9e429e84dc), - W64LIT(0x89d4caca0fca1ec5), W64LIT(0x5a582d2db42d7599), W64LIT(0x632ebfbfc6bf9179), W64LIT(0x0e3f07071c07381b), - W64LIT(0x47acadad8ead0123), W64LIT(0xb4b05a5a755aea2f), W64LIT(0x1bef838336836cb5), W64LIT(0x66b63333cc3385ff), - W64LIT(0xc65c636391633ff2), W64LIT(0x041202020802100a), W64LIT(0x4993aaaa92aa3938), W64LIT(0xe2de7171d971afa8), - W64LIT(0x8dc6c8c807c80ecf), W64LIT(0x32d119196419c87d), W64LIT(0x923b494939497270), W64LIT(0xaf5fd9d943d9869a), - W64LIT(0xf931f2f2eff2c31d), W64LIT(0xdba8e3e3abe34b48), W64LIT(0xb6b95b5b715be22a), W64LIT(0x0dbc88881a883492), - W64LIT(0x293e9a9a529aa4c8), W64LIT(0x4c0b262698262dbe), W64LIT(0x64bf3232c8328dfa), W64LIT(0x7d59b0b0fab0e94a), - W64LIT(0xcff2e9e983e91b6a), W64LIT(0x1e770f0f3c0f7833), W64LIT(0xb733d5d573d5e6a6), W64LIT(0x1df480803a8074ba), - W64LIT(0x6127bebec2be997c), W64LIT(0x87ebcdcd13cd26de), W64LIT(0x68893434d034bde4), W64LIT(0x903248483d487a75), - W64LIT(0xe354ffffdbffab24), W64LIT(0xf48d7a7af57af78f), W64LIT(0x3d6490907a90f4ea), W64LIT(0xbe9d5f5f615fc23e), - W64LIT(0x403d202080201da0), W64LIT(0xd00f6868bd6867d5), W64LIT(0x34ca1a1a681ad072), W64LIT(0x41b7aeae82ae192c), - W64LIT(0x757db4b4eab4c95e), W64LIT(0xa8ce54544d549a19), W64LIT(0x3b7f93937693ece5), W64LIT(0x442f222288220daa), - W64LIT(0xc86364648d6407e9), W64LIT(0xff2af1f1e3f1db12), W64LIT(0xe6cc7373d173bfa2), W64LIT(0x248212124812905a), - W64LIT(0x807a40401d403a5d), W64LIT(0x1048080820084028), W64LIT(0x9b95c3c32bc356e8), W64LIT(0xc5dfecec97ec337b), - W64LIT(0xab4ddbdb4bdb9690), W64LIT(0x5fc0a1a1bea1611f), W64LIT(0x07918d8d0e8d1c83), W64LIT(0x7ac83d3df43df5c9), - W64LIT(0x335b97976697ccf1), W64LIT(0x0000000000000000), W64LIT(0x83f9cfcf1bcf36d4), W64LIT(0x566e2b2bac2b4587), - W64LIT(0xece17676c57697b3), W64LIT(0x19e68282328264b0), W64LIT(0xb128d6d67fd6fea9), W64LIT(0x36c31b1b6c1bd877), - W64LIT(0x7774b5b5eeb5c15b), W64LIT(0x43beafaf86af1129), W64LIT(0xd41d6a6ab56a77df), W64LIT(0xa0ea50505d50ba0d), - W64LIT(0x8a5745450945124c), W64LIT(0xfb38f3f3ebf3cb18), W64LIT(0x60ad3030c0309df0), W64LIT(0xc3c4efef9bef2b74), - W64LIT(0x7eda3f3ffc3fe5c3), W64LIT(0xaac755554955921c), W64LIT(0x59dba2a2b2a27910), W64LIT(0xc9e9eaea8fea0365), - W64LIT(0xca6a656589650fec), W64LIT(0x6903babad2bab968), W64LIT(0x5e4a2f2fbc2f6593), W64LIT(0x9d8ec0c027c04ee7), - W64LIT(0xa160dede5fdebe81), W64LIT(0x38fc1c1c701ce06c), W64LIT(0xe746fdfdd3fdbb2e), W64LIT(0x9a1f4d4d294d5264), - W64LIT(0x397692927292e4e0), W64LIT(0xeafa7575c9758fbc), W64LIT(0x0c3606061806301e), W64LIT(0x09ae8a8a128a2498), - W64LIT(0x794bb2b2f2b2f940), W64LIT(0xd185e6e6bfe66359), W64LIT(0x1c7e0e0e380e7036), W64LIT(0x3ee71f1f7c1ff863), - W64LIT(0xc4556262956237f7), W64LIT(0xb53ad4d477d4eea3), W64LIT(0x4d81a8a89aa82932), W64LIT(0x315296966296c4f4), - W64LIT(0xef62f9f9c3f99b3a), W64LIT(0x97a3c5c533c566f6), W64LIT(0x4a102525942535b1), W64LIT(0xb2ab59597959f220), - W64LIT(0x15d084842a8454ae), W64LIT(0xe4c57272d572b7a7), W64LIT(0x72ec3939e439d5dd), W64LIT(0x98164c4c2d4c5a61), - W64LIT(0xbc945e5e655eca3b), W64LIT(0xf09f7878fd78e785), W64LIT(0x70e53838e038ddd8), W64LIT(0x05988c8c0a8c1486), - W64LIT(0xbf17d1d163d1c6b2), W64LIT(0x57e4a5a5aea5410b), W64LIT(0xd9a1e2e2afe2434d), W64LIT(0xc24e616199612ff8), - W64LIT(0x7b42b3b3f6b3f145), W64LIT(0x42342121842115a5), W64LIT(0x25089c9c4a9c94d6), W64LIT(0x3cee1e1e781ef066), - W64LIT(0x8661434311432252), W64LIT(0x93b1c7c73bc776fc), W64LIT(0xe54ffcfcd7fcb32b), W64LIT(0x0824040410042014), - W64LIT(0xa2e351515951b208), W64LIT(0x2f2599995e99bcc7), W64LIT(0xda226d6da96d4fc4), W64LIT(0x1a650d0d340d6839), - W64LIT(0xe979fafacffa8335), W64LIT(0xa369dfdf5bdfb684), W64LIT(0xfca97e7ee57ed79b), W64LIT(0x4819242490243db4), - W64LIT(0x76fe3b3bec3bc5d7), W64LIT(0x4b9aabab96ab313d), W64LIT(0x81f0cece1fce3ed1), W64LIT(0x2299111144118855), - W64LIT(0x03838f8f068f0c89), W64LIT(0x9c044e4e254e4a6b), W64LIT(0x7366b7b7e6b7d151), W64LIT(0xcbe0ebeb8beb0b60), - W64LIT(0x78c13c3cf03cfdcc), W64LIT(0x1ffd81813e817cbf), W64LIT(0x354094946a94d4fe), W64LIT(0xf31cf7f7fbf7eb0c), - W64LIT(0x6f18b9b9deb9a167), W64LIT(0x268b13134c13985f), W64LIT(0x58512c2cb02c7d9c), W64LIT(0xbb05d3d36bd3d6b8), - W64LIT(0xd38ce7e7bbe76b5c), W64LIT(0xdc396e6ea56e57cb), W64LIT(0x95aac4c437c46ef3), W64LIT(0x061b03030c03180f), - W64LIT(0xacdc565645568a13), W64LIT(0x885e44440d441a49), W64LIT(0xfea07f7fe17fdf9e), W64LIT(0x4f88a9a99ea92137), - W64LIT(0x54672a2aa82a4d82), W64LIT(0x6b0abbbbd6bbb16d), W64LIT(0x9f87c1c123c146e2), W64LIT(0xa6f153535153a202), - W64LIT(0xa572dcdc57dcae8b), W64LIT(0x16530b0b2c0b5827), W64LIT(0x27019d9d4e9d9cd3), W64LIT(0xd82b6c6cad6c47c1), - W64LIT(0x62a43131c43195f5), W64LIT(0xe8f37474cd7487b9), W64LIT(0xf115f6f6fff6e309), W64LIT(0x8c4c464605460a43), - W64LIT(0x45a5acac8aac0926), W64LIT(0x0fb589891e893c97), W64LIT(0x28b414145014a044), W64LIT(0xdfbae1e1a3e15b42), - W64LIT(0x2ca616165816b04e), W64LIT(0x74f73a3ae83acdd2), W64LIT(0xd2066969b9696fd0), W64LIT(0x124109092409482d), - W64LIT(0xe0d77070dd70a7ad), W64LIT(0x716fb6b6e2b6d954), W64LIT(0xbd1ed0d067d0ceb7), W64LIT(0xc7d6eded93ed3b7e), - W64LIT(0x85e2cccc17cc2edb), W64LIT(0x8468424215422a57), W64LIT(0x2d2c98985a98b4c2), W64LIT(0x55eda4a4aaa4490e), - W64LIT(0x50752828a0285d88), W64LIT(0xb8865c5c6d5cda31), W64LIT(0xed6bf8f8c7f8933f), W64LIT(0x11c28686228644a4), - - W64LIT(0x7830d818186018c0), W64LIT(0xaf462623238c2305), W64LIT(0xf991b8c6c63fc67e), W64LIT(0x6fcdfbe8e887e813), - W64LIT(0xa113cb878726874c), W64LIT(0x626d11b8b8dab8a9), W64LIT(0x0502090101040108), W64LIT(0x6e9e0d4f4f214f42), - W64LIT(0xee6c9b3636d836ad), W64LIT(0x0451ffa6a6a2a659), W64LIT(0xbdb90cd2d26fd2de), W64LIT(0x06f70ef5f5f3f5fb), - W64LIT(0x80f2967979f979ef), W64LIT(0xcede306f6fa16f5f), W64LIT(0xef3f6d91917e91fc), W64LIT(0x07a4f852525552aa), - W64LIT(0xfdc04760609d6027), W64LIT(0x766535bcbccabc89), W64LIT(0xcd2b379b9b569bac), W64LIT(0x8c018a8e8e028e04), - W64LIT(0x155bd2a3a3b6a371), W64LIT(0x3c186c0c0c300c60), W64LIT(0x8af6847b7bf17bff), W64LIT(0xe16a803535d435b5), - W64LIT(0x693af51d1d741de8), W64LIT(0x47ddb3e0e0a7e053), W64LIT(0xacb321d7d77bd7f6), W64LIT(0xed999cc2c22fc25e), - W64LIT(0x965c432e2eb82e6d), W64LIT(0x7a96294b4b314b62), W64LIT(0x21e15dfefedffea3), W64LIT(0x16aed55757415782), - W64LIT(0x412abd15155415a8), W64LIT(0xb6eee87777c1779f), W64LIT(0xeb6e923737dc37a5), W64LIT(0x56d79ee5e5b3e57b), - W64LIT(0xd923139f9f469f8c), W64LIT(0x17fd23f0f0e7f0d3), W64LIT(0x7f94204a4a354a6a), W64LIT(0x95a944dada4fda9e), - W64LIT(0x25b0a258587d58fa), W64LIT(0xca8fcfc9c903c906), W64LIT(0x8d527c2929a42955), W64LIT(0x22145a0a0a280a50), - W64LIT(0x4f7f50b1b1feb1e1), W64LIT(0x1a5dc9a0a0baa069), W64LIT(0xdad6146b6bb16b7f), W64LIT(0xab17d985852e855c), - W64LIT(0x73673cbdbdcebd81), W64LIT(0x34ba8f5d5d695dd2), W64LIT(0x5020901010401080), W64LIT(0x03f507f4f4f7f4f3), - W64LIT(0xc08bddcbcb0bcb16), W64LIT(0xc67cd33e3ef83eed), W64LIT(0x110a2d0505140528), W64LIT(0xe6ce78676781671f), - W64LIT(0x53d597e4e4b7e473), W64LIT(0xbb4e0227279c2725), W64LIT(0x5882734141194132), W64LIT(0x9d0ba78b8b168b2c), - W64LIT(0x0153f6a7a7a6a751), W64LIT(0x94fab27d7de97dcf), W64LIT(0xfb374995956e95dc), W64LIT(0x9fad56d8d847d88e), - W64LIT(0x30eb70fbfbcbfb8b), W64LIT(0x71c1cdeeee9fee23), W64LIT(0x91f8bb7c7ced7cc7), W64LIT(0xe3cc716666856617), - W64LIT(0x8ea77bdddd53dda6), W64LIT(0x4b2eaf17175c17b8), W64LIT(0x468e454747014702), W64LIT(0xdc211a9e9e429e84), - W64LIT(0xc589d4caca0fca1e), W64LIT(0x995a582d2db42d75), W64LIT(0x79632ebfbfc6bf91), W64LIT(0x1b0e3f07071c0738), - W64LIT(0x2347acadad8ead01), W64LIT(0x2fb4b05a5a755aea), W64LIT(0xb51bef838336836c), W64LIT(0xff66b63333cc3385), - W64LIT(0xf2c65c636391633f), W64LIT(0x0a04120202080210), W64LIT(0x384993aaaa92aa39), W64LIT(0xa8e2de7171d971af), - W64LIT(0xcf8dc6c8c807c80e), W64LIT(0x7d32d119196419c8), W64LIT(0x70923b4949394972), W64LIT(0x9aaf5fd9d943d986), - W64LIT(0x1df931f2f2eff2c3), W64LIT(0x48dba8e3e3abe34b), W64LIT(0x2ab6b95b5b715be2), W64LIT(0x920dbc88881a8834), - W64LIT(0xc8293e9a9a529aa4), W64LIT(0xbe4c0b262698262d), W64LIT(0xfa64bf3232c8328d), W64LIT(0x4a7d59b0b0fab0e9), - W64LIT(0x6acff2e9e983e91b), W64LIT(0x331e770f0f3c0f78), W64LIT(0xa6b733d5d573d5e6), W64LIT(0xba1df480803a8074), - W64LIT(0x7c6127bebec2be99), W64LIT(0xde87ebcdcd13cd26), W64LIT(0xe468893434d034bd), W64LIT(0x75903248483d487a), - W64LIT(0x24e354ffffdbffab), W64LIT(0x8ff48d7a7af57af7), W64LIT(0xea3d6490907a90f4), W64LIT(0x3ebe9d5f5f615fc2), - W64LIT(0xa0403d202080201d), W64LIT(0xd5d00f6868bd6867), W64LIT(0x7234ca1a1a681ad0), W64LIT(0x2c41b7aeae82ae19), - W64LIT(0x5e757db4b4eab4c9), W64LIT(0x19a8ce54544d549a), W64LIT(0xe53b7f93937693ec), W64LIT(0xaa442f222288220d), - W64LIT(0xe9c86364648d6407), W64LIT(0x12ff2af1f1e3f1db), W64LIT(0xa2e6cc7373d173bf), W64LIT(0x5a24821212481290), - W64LIT(0x5d807a40401d403a), W64LIT(0x2810480808200840), W64LIT(0xe89b95c3c32bc356), W64LIT(0x7bc5dfecec97ec33), - W64LIT(0x90ab4ddbdb4bdb96), W64LIT(0x1f5fc0a1a1bea161), W64LIT(0x8307918d8d0e8d1c), W64LIT(0xc97ac83d3df43df5), - W64LIT(0xf1335b97976697cc), W64LIT(0x0000000000000000), W64LIT(0xd483f9cfcf1bcf36), W64LIT(0x87566e2b2bac2b45), - W64LIT(0xb3ece17676c57697), W64LIT(0xb019e68282328264), W64LIT(0xa9b128d6d67fd6fe), W64LIT(0x7736c31b1b6c1bd8), - W64LIT(0x5b7774b5b5eeb5c1), W64LIT(0x2943beafaf86af11), W64LIT(0xdfd41d6a6ab56a77), W64LIT(0x0da0ea50505d50ba), - W64LIT(0x4c8a574545094512), W64LIT(0x18fb38f3f3ebf3cb), W64LIT(0xf060ad3030c0309d), W64LIT(0x74c3c4efef9bef2b), - W64LIT(0xc37eda3f3ffc3fe5), W64LIT(0x1caac75555495592), W64LIT(0x1059dba2a2b2a279), W64LIT(0x65c9e9eaea8fea03), - W64LIT(0xecca6a656589650f), W64LIT(0x686903babad2bab9), W64LIT(0x935e4a2f2fbc2f65), W64LIT(0xe79d8ec0c027c04e), - W64LIT(0x81a160dede5fdebe), W64LIT(0x6c38fc1c1c701ce0), W64LIT(0x2ee746fdfdd3fdbb), W64LIT(0x649a1f4d4d294d52), - W64LIT(0xe0397692927292e4), W64LIT(0xbceafa7575c9758f), W64LIT(0x1e0c360606180630), W64LIT(0x9809ae8a8a128a24), - W64LIT(0x40794bb2b2f2b2f9), W64LIT(0x59d185e6e6bfe663), W64LIT(0x361c7e0e0e380e70), W64LIT(0x633ee71f1f7c1ff8), - W64LIT(0xf7c4556262956237), W64LIT(0xa3b53ad4d477d4ee), W64LIT(0x324d81a8a89aa829), W64LIT(0xf4315296966296c4), - W64LIT(0x3aef62f9f9c3f99b), W64LIT(0xf697a3c5c533c566), W64LIT(0xb14a102525942535), W64LIT(0x20b2ab59597959f2), - W64LIT(0xae15d084842a8454), W64LIT(0xa7e4c57272d572b7), W64LIT(0xdd72ec3939e439d5), W64LIT(0x6198164c4c2d4c5a), - W64LIT(0x3bbc945e5e655eca), W64LIT(0x85f09f7878fd78e7), W64LIT(0xd870e53838e038dd), W64LIT(0x8605988c8c0a8c14), - W64LIT(0xb2bf17d1d163d1c6), W64LIT(0x0b57e4a5a5aea541), W64LIT(0x4dd9a1e2e2afe243), W64LIT(0xf8c24e616199612f), - W64LIT(0x457b42b3b3f6b3f1), W64LIT(0xa542342121842115), W64LIT(0xd625089c9c4a9c94), W64LIT(0x663cee1e1e781ef0), - W64LIT(0x5286614343114322), W64LIT(0xfc93b1c7c73bc776), W64LIT(0x2be54ffcfcd7fcb3), W64LIT(0x1408240404100420), - W64LIT(0x08a2e351515951b2), W64LIT(0xc72f2599995e99bc), W64LIT(0xc4da226d6da96d4f), W64LIT(0x391a650d0d340d68), - W64LIT(0x35e979fafacffa83), W64LIT(0x84a369dfdf5bdfb6), W64LIT(0x9bfca97e7ee57ed7), W64LIT(0xb44819242490243d), - W64LIT(0xd776fe3b3bec3bc5), W64LIT(0x3d4b9aabab96ab31), W64LIT(0xd181f0cece1fce3e), W64LIT(0x5522991111441188), - W64LIT(0x8903838f8f068f0c), W64LIT(0x6b9c044e4e254e4a), W64LIT(0x517366b7b7e6b7d1), W64LIT(0x60cbe0ebeb8beb0b), - W64LIT(0xcc78c13c3cf03cfd), W64LIT(0xbf1ffd81813e817c), W64LIT(0xfe354094946a94d4), W64LIT(0x0cf31cf7f7fbf7eb), - W64LIT(0x676f18b9b9deb9a1), W64LIT(0x5f268b13134c1398), W64LIT(0x9c58512c2cb02c7d), W64LIT(0xb8bb05d3d36bd3d6), - W64LIT(0x5cd38ce7e7bbe76b), W64LIT(0xcbdc396e6ea56e57), W64LIT(0xf395aac4c437c46e), W64LIT(0x0f061b03030c0318), - W64LIT(0x13acdc565645568a), W64LIT(0x49885e44440d441a), W64LIT(0x9efea07f7fe17fdf), W64LIT(0x374f88a9a99ea921), - W64LIT(0x8254672a2aa82a4d), W64LIT(0x6d6b0abbbbd6bbb1), W64LIT(0xe29f87c1c123c146), W64LIT(0x02a6f153535153a2), - W64LIT(0x8ba572dcdc57dcae), W64LIT(0x2716530b0b2c0b58), W64LIT(0xd327019d9d4e9d9c), W64LIT(0xc1d82b6c6cad6c47), - W64LIT(0xf562a43131c43195), W64LIT(0xb9e8f37474cd7487), W64LIT(0x09f115f6f6fff6e3), W64LIT(0x438c4c464605460a), - W64LIT(0x2645a5acac8aac09), W64LIT(0x970fb589891e893c), W64LIT(0x4428b414145014a0), W64LIT(0x42dfbae1e1a3e15b), - W64LIT(0x4e2ca616165816b0), W64LIT(0xd274f73a3ae83acd), W64LIT(0xd0d2066969b9696f), W64LIT(0x2d12410909240948), - W64LIT(0xade0d77070dd70a7), W64LIT(0x54716fb6b6e2b6d9), W64LIT(0xb7bd1ed0d067d0ce), W64LIT(0x7ec7d6eded93ed3b), - W64LIT(0xdb85e2cccc17cc2e), W64LIT(0x578468424215422a), W64LIT(0xc22d2c98985a98b4), W64LIT(0x0e55eda4a4aaa449), - W64LIT(0x8850752828a0285d), W64LIT(0x31b8865c5c6d5cda), W64LIT(0x3fed6bf8f8c7f893), W64LIT(0xa411c28686228644), - - W64LIT(0x1823c6e887b8014f), - W64LIT(0x36a6d2f5796f9152), - W64LIT(0x60bc9b8ea30c7b35), - W64LIT(0x1de0d7c22e4bfe57), - W64LIT(0x157737e59ff04ada), - W64LIT(0x58c9290ab1a06b85), - W64LIT(0xbd5d10f4cb3e0567), - W64LIT(0xe427418ba77d95d8), - W64LIT(0xfbee7c66dd17479e), - W64LIT(0xca2dbf07ad5a8333) -}; - -// Whirlpool basic transformation. Transforms state based on block. -void Whirlpool::Transform(word64 *digest, const word64 *block) -{ -#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE - if (HasISSE()) - { - // MMX version has the same structure as C version below -#ifdef __GNUC__ - #if CRYPTOPP_BOOL_X64 - word64 workspace[16]; - #endif - __asm__ __volatile__ - ( - INTEL_NOPREFIX - AS_PUSH_IF86( bx) - AS2( mov AS_REG_6, WORD_REG(ax)) -#else - #if _MSC_VER < 1300 - AS_PUSH_IF86( bx) - #endif - AS2( lea AS_REG_6, [Whirlpool_C]) - AS2( mov WORD_REG(cx), digest) - AS2( mov WORD_REG(dx), block) -#endif -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 - AS2( mov eax, esp) - AS2( and esp, -16) - AS2( sub esp, 16*8) - AS_PUSH_IF86( ax) - #if CRYPTOPP_BOOL_X86 - #define SSE2_workspace esp+WORD_SZ - #elif CRYPTOPP_BOOL_X32 - #define SSE2_workspace esp+(WORD_SZ*2) - #endif -#else - #define SSE2_workspace %3 -#endif - AS2( xor esi, esi) - ASL(0) - AS2( movq mm0, [WORD_REG(cx)+8*WORD_REG(si)]) - AS2( movq [SSE2_workspace+8*WORD_REG(si)], mm0) // k - AS2( pxor mm0, [WORD_REG(dx)+8*WORD_REG(si)]) - AS2( movq [SSE2_workspace+64+8*WORD_REG(si)], mm0) // s - AS2( movq [WORD_REG(cx)+8*WORD_REG(si)], mm0) - AS1( inc WORD_REG(si)) - AS2( cmp WORD_REG(si), 8) - ASJ( jne, 0, b) - - AS2( xor esi, esi) - ASL(1) - -#define KSL0(a, b) AS2(movq mm##a, b) -#define KSL1(a, b) AS2(pxor mm##a, b) - -#define KSL(op, i, a, b, c, d) \ - AS2(mov eax, [SSE2_workspace+8*i])\ - AS2(movzx edi, al)\ - KSL##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ - AS2(movzx edi, ah)\ - KSL##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ - AS2(shr eax, 16)\ - AS2(movzx edi, al)\ - AS2(shr eax, 8)\ - KSL##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ - KSL##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) - -#define KSH0(a, b) \ - ASS(pshufw mm##a, mm##a, 1, 0, 3, 2)\ - AS2(pxor mm##a, b) -#define KSH1(a, b) \ - AS2(pxor mm##a, b) -#define KSH2(a, b) \ - AS2(pxor mm##a, b)\ - AS2(movq [SSE2_workspace+8*a], mm##a) - -#define KSH(op, i, a, b, c, d) \ - AS2(mov eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\ - AS2(movzx edi, al)\ - KSH##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ - AS2(movzx edi, ah)\ - KSH##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ - AS2(shr eax, 16)\ - AS2(movzx edi, al)\ - AS2(shr eax, 8)\ - KSH##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ - KSH##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) - -#define TSL(op, i, a, b, c, d) \ - AS2(mov eax, [SSE2_workspace+64+8*i])\ - AS2(movzx edi, al)\ - KSL##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ - AS2(movzx edi, ah)\ - KSL##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ - AS2(shr eax, 16)\ - AS2(movzx edi, al)\ - AS2(shr eax, 8)\ - KSL##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ - KSL##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) - -#define TSH0(a, b) \ - ASS(pshufw mm##a, mm##a, 1, 0, 3, 2)\ - AS2(pxor mm##a, [SSE2_workspace+8*a])\ - AS2(pxor mm##a, b) -#define TSH1(a, b) \ - AS2(pxor mm##a, b) -#define TSH2(a, b) \ - AS2(pxor mm##a, b)\ - AS2(movq [SSE2_workspace+64+8*a], mm##a) -#define TSH3(a, b) \ - AS2(pxor mm##a, b)\ - AS2(pxor mm##a, [WORD_REG(cx)+8*a])\ - AS2(movq [WORD_REG(cx)+8*a], mm##a) - -#define TSH(op, i, a, b, c, d) \ - AS2(mov eax, [SSE2_workspace+64+8*((i+4)-8*((i+4)/8))+4])\ - AS2(movzx edi, al)\ - TSH##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\ - AS2(movzx edi, ah)\ - TSH##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\ - AS2(shr eax, 16)\ - AS2(movzx edi, al)\ - AS2(shr eax, 8)\ - TSH##op(c, [AS_REG_6+1*2048+8*WORD_REG(di)])\ - TSH##op(d, [AS_REG_6+0*2048+8*WORD_REG(ax)]) - - KSL(0, 4, 3, 2, 1, 0) - KSL(0, 0, 7, 6, 5, 4) - KSL(1, 1, 0, 7, 6, 5) - KSL(1, 2, 1, 0, 7, 6) - KSL(1, 3, 2, 1, 0, 7) - KSL(1, 5, 4, 3, 2, 1) - KSL(1, 6, 5, 4, 3, 2) - KSL(1, 7, 6, 5, 4, 3) - KSH(0, 0, 7, 6, 5, 4) - KSH(0, 4, 3, 2, 1, 0) - KSH(1, 1, 0, 7, 6, 5) - KSH(1, 2, 1, 0, 7, 6) - KSH(1, 5, 4, 3, 2, 1) - KSH(1, 6, 5, 4, 3, 2) - KSH(2, 3, 2, 1, 0, 7) - KSH(2, 7, 6, 5, 4, 3) - - AS2( pxor mm0, [AS_REG_6 + 8*1024 + WORD_REG(si)*8]) - AS2( movq [SSE2_workspace], mm0) - - TSL(0, 4, 3, 2, 1, 0) - TSL(0, 0, 7, 6, 5, 4) - TSL(1, 1, 0, 7, 6, 5) - TSL(1, 2, 1, 0, 7, 6) - TSL(1, 3, 2, 1, 0, 7) - TSL(1, 5, 4, 3, 2, 1) - TSL(1, 6, 5, 4, 3, 2) - TSL(1, 7, 6, 5, 4, 3) - TSH(0, 0, 7, 6, 5, 4) - TSH(0, 4, 3, 2, 1, 0) - TSH(1, 1, 0, 7, 6, 5) - TSH(1, 2, 1, 0, 7, 6) - TSH(1, 5, 4, 3, 2, 1) - TSH(1, 6, 5, 4, 3, 2) - - AS1( inc WORD_REG(si)) - AS2( cmp WORD_REG(si), 10) - ASJ( je, 2, f) - - TSH(2, 3, 2, 1, 0, 7) - TSH(2, 7, 6, 5, 4, 3) - - ASJ( jmp, 1, b) - ASL(2) - - TSH(3, 3, 2, 1, 0, 7) - TSH(3, 7, 6, 5, 4, 3) - -#undef KSL -#undef KSH -#undef TSL -#undef TSH - - AS_POP_IF86( sp) - AS1( emms) - -#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER < 1300) - AS_POP_IF86( bx) -#endif -#ifdef __GNUC__ - ATT_PREFIX - : - : "a" (Whirlpool_C), "c" (digest), "d" (block) - #if CRYPTOPP_BOOL_X64 - , "r" (workspace) - #endif - : "%esi", "%edi", "memory", "cc" - #if CRYPTOPP_BOOL_X64 - , "%r9" - #endif - ); -#endif - } - else -#endif // #ifdef CRYPTOPP_X86_ASM_AVAILABLE - { - word64 s[8]; // the cipher state - word64 k[8]; // the round key - - // Compute and apply K^0 to the cipher state - // Also apply part of the Miyaguchi-Preneel compression function - for (int i=0; i<8; i++) - digest[i] = s[i] = block[i] ^ (k[i] = digest[i]); - -#define KSL(op, i, a, b, c, d) \ - t = (word32)k[i];\ - w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : 0);\ - t >>= 8;\ - w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : 0);\ - t >>= 8;\ - w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : 0);\ - t >>= 8;\ - w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : 0); - -#define KSH(op, i, a, b, c, d) \ - t = (word32)(k[(i+4)%8]>>32);\ - w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : rotrFixed(w##a, 32));\ - if (op==2) k[a] = w##a;\ - t >>= 8;\ - w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : rotrFixed(w##b, 32));\ - if (op==2) k[b] = w##b;\ - t >>= 8;\ - w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : rotrFixed(w##c, 32));\ - if (op==2) k[c] = w##c;\ - t >>= 8;\ - w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : rotrFixed(w##d, 32));\ - if (op==2) k[d] = w##d;\ - -#define TSL(op, i, a, b, c, d) \ - t = (word32)s[i];\ - w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : 0);\ - t >>= 8;\ - w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : 0);\ - t >>= 8;\ - w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : 0);\ - t >>= 8;\ - w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : 0); - -#define TSH_OP(op, a, b) \ - w##a = Whirlpool_C[b*256 + (byte)t] ^ (op ? w##a : rotrFixed(w##a, 32) ^ k[a]);\ - if (op==2) s[a] = w##a;\ - if (op==3) digest[a] ^= w##a;\ - -#define TSH(op, i, a, b, c, d) \ - t = (word32)(s[(i+4)%8]>>32);\ - TSH_OP(op, a, 3);\ - t >>= 8;\ - TSH_OP(op, b, 2);\ - t >>= 8;\ - TSH_OP(op, c, 1);\ - t >>= 8;\ - TSH_OP(op, d, 0);\ - - // Iterate over all rounds: - int r=0; - while (true) - { - // Added initialization due to Coverity findings. - word64 w0=0, w1=0, w2=0, w3=0, w4=0, w5=0, w6=0, w7=0; - word32 t=0; - - KSL(0, 4, 3, 2, 1, 0) - KSL(0, 0, 7, 6, 5, 4) - KSL(1, 1, 0, 7, 6, 5) - KSL(1, 2, 1, 0, 7, 6) - KSL(1, 3, 2, 1, 0, 7) - KSL(1, 5, 4, 3, 2, 1) - KSL(1, 6, 5, 4, 3, 2) - KSL(1, 7, 6, 5, 4, 3) - KSH(0, 0, 7, 6, 5, 4) - KSH(0, 4, 3, 2, 1, 0) - KSH(1, 1, 0, 7, 6, 5) - KSH(1, 2, 1, 0, 7, 6) - KSH(1, 5, 4, 3, 2, 1) - KSH(1, 6, 5, 4, 3, 2) - KSH(2, 3, 2, 1, 0, 7) - KSH(2, 7, 6, 5, 4, 3) - - k[0] ^= Whirlpool_C[1024+r]; - - TSL(0, 4, 3, 2, 1, 0) - TSL(0, 0, 7, 6, 5, 4) - TSL(1, 1, 0, 7, 6, 5) - TSL(1, 2, 1, 0, 7, 6) - TSL(1, 3, 2, 1, 0, 7) - TSL(1, 5, 4, 3, 2, 1) - TSL(1, 6, 5, 4, 3, 2) - TSL(1, 7, 6, 5, 4, 3) - TSH(0, 0, 7, 6, 5, 4) - TSH(0, 4, 3, 2, 1, 0) - TSH(1, 1, 0, 7, 6, 5) - TSH(1, 2, 1, 0, 7, 6) - TSH(1, 5, 4, 3, 2, 1) - TSH(1, 6, 5, 4, 3, 2) - - if (++r < R) - { - TSH(2, 3, 2, 1, 0, 7) - TSH(2, 7, 6, 5, 4, 3) - } - else - { - TSH(3, 3, 2, 1, 0, 7) - TSH(3, 7, 6, 5, 4, 3) - break; - } - } - } -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/whrlpool.h b/external/crypto++-5.6.3/whrlpool.h deleted file mode 100644 index 62c9d8a53..000000000 --- a/external/crypto++-5.6.3/whrlpool.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CRYPTOPP_WHIRLPOOL_H -#define CRYPTOPP_WHIRLPOOL_H - -#include "config.h" -#include "iterhash.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! Whirlpool -class Whirlpool : public IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state); - static void Transform(word64 *digest, const word64 *data); - void TruncatedFinal(byte *hash, size_t size); - static const char * StaticAlgorithmName() {return "Whirlpool";} -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/winpipes.cpp b/external/crypto++-5.6.3/winpipes.cpp deleted file mode 100644 index 685e83c24..000000000 --- a/external/crypto++-5.6.3/winpipes.cpp +++ /dev/null @@ -1,206 +0,0 @@ -// winpipes.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" -#include "winpipes.h" - -#ifdef WINDOWS_PIPES_AVAILABLE - -#include "wait.h" - -NAMESPACE_BEGIN(CryptoPP) - -WindowsHandle::WindowsHandle(HANDLE h, bool own) - : m_h(h), m_own(own) -{ -} - -WindowsHandle::~WindowsHandle() -{ - if (m_own) - { - try - { - CloseHandle(); - } - catch (const Exception&) - { - assert(0); - } - } -} - -bool WindowsHandle::HandleValid() const -{ - return m_h && m_h != INVALID_HANDLE_VALUE; -} - -void WindowsHandle::AttachHandle(HANDLE h, bool own) -{ - if (m_own) - CloseHandle(); - - m_h = h; - m_own = own; - HandleChanged(); -} - -HANDLE WindowsHandle::DetachHandle() -{ - HANDLE h = m_h; - m_h = INVALID_HANDLE_VALUE; - HandleChanged(); - return h; -} - -void WindowsHandle::CloseHandle() -{ - if (m_h != INVALID_HANDLE_VALUE) - { - ::CloseHandle(m_h); - m_h = INVALID_HANDLE_VALUE; - HandleChanged(); - } -} - -// ******************************************************** - -void WindowsPipe::HandleError(const char *operation) const -{ - DWORD err = GetLastError(); - throw Err(GetHandle(), operation, err); -} - -WindowsPipe::Err::Err(HANDLE s, const std::string& operation, int error) - : OS_Error(IO_ERROR, "WindowsPipe: " + operation + " operation failed with error 0x" + IntToString(error, 16), operation, error) - , m_h(s) -{ -} - -// ************************************************************* - -WindowsPipeReceiver::WindowsPipeReceiver() - : m_resultPending(false), m_eofReceived(false) -{ - m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); - CheckAndHandleError("CreateEvent", m_event.HandleValid()); - memset(&m_overlapped, 0, sizeof(m_overlapped)); - m_overlapped.hEvent = m_event; -} - -bool WindowsPipeReceiver::Receive(byte* buf, size_t bufLen) -{ - assert(!m_resultPending && !m_eofReceived); - - const HANDLE h = GetHandle(); - // don't queue too much at once, or we might use up non-paged memory - if (ReadFile(h, buf, UnsignedMin((DWORD)128*1024, bufLen), &m_lastResult, &m_overlapped)) - { - if (m_lastResult == 0) - m_eofReceived = true; - } - else - { - switch (GetLastError()) - { - default: - CheckAndHandleError("ReadFile", false); - case ERROR_BROKEN_PIPE: - case ERROR_HANDLE_EOF: - m_lastResult = 0; - m_eofReceived = true; - break; - case ERROR_IO_PENDING: - m_resultPending = true; - } - } - return !m_resultPending; -} - -void WindowsPipeReceiver::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (m_resultPending) - container.AddHandle(m_event, CallStack("WindowsPipeReceiver::GetWaitObjects() - result pending", &callStack)); - else if (!m_eofReceived) - container.SetNoWait(CallStack("WindowsPipeReceiver::GetWaitObjects() - result ready", &callStack)); -} - -unsigned int WindowsPipeReceiver::GetReceiveResult() -{ - if (m_resultPending) - { - const HANDLE h = GetHandle(); - if (GetOverlappedResult(h, &m_overlapped, &m_lastResult, false)) - { - if (m_lastResult == 0) - m_eofReceived = true; - } - else - { - switch (GetLastError()) - { - default: - CheckAndHandleError("GetOverlappedResult", false); - case ERROR_BROKEN_PIPE: - case ERROR_HANDLE_EOF: - m_lastResult = 0; - m_eofReceived = true; - } - } - m_resultPending = false; - } - return m_lastResult; -} - -// ************************************************************* - -WindowsPipeSender::WindowsPipeSender() - : m_resultPending(false), m_lastResult(0) -{ - m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); - CheckAndHandleError("CreateEvent", m_event.HandleValid()); - memset(&m_overlapped, 0, sizeof(m_overlapped)); - m_overlapped.hEvent = m_event; -} - -void WindowsPipeSender::Send(const byte* buf, size_t bufLen) -{ - DWORD written = 0; - const HANDLE h = GetHandle(); - // don't queue too much at once, or we might use up non-paged memory - if (WriteFile(h, buf, UnsignedMin((DWORD)128*1024, bufLen), &written, &m_overlapped)) - { - m_resultPending = false; - m_lastResult = written; - } - else - { - if (GetLastError() != ERROR_IO_PENDING) - CheckAndHandleError("WriteFile", false); - - m_resultPending = true; - } -} - -void WindowsPipeSender::GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) -{ - if (m_resultPending) - container.AddHandle(m_event, CallStack("WindowsPipeSender::GetWaitObjects() - result pending", &callStack)); - else - container.SetNoWait(CallStack("WindowsPipeSender::GetWaitObjects() - result ready", &callStack)); -} - -unsigned int WindowsPipeSender::GetSendResult() -{ - if (m_resultPending) - { - const HANDLE h = GetHandle(); - BOOL result = GetOverlappedResult(h, &m_overlapped, &m_lastResult, false); - CheckAndHandleError("GetOverlappedResult", result); - m_resultPending = false; - } - return m_lastResult; -} - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/winpipes.h b/external/crypto++-5.6.3/winpipes.h deleted file mode 100644 index 14dc5d0d6..000000000 --- a/external/crypto++-5.6.3/winpipes.h +++ /dev/null @@ -1,143 +0,0 @@ -#ifndef CRYPTOPP_WINPIPES_H -#define CRYPTOPP_WINPIPES_H - -#ifdef WINDOWS_PIPES_AVAILABLE - -#include "cryptlib.h" -#include "network.h" -#include "queue.h" -#include - -NAMESPACE_BEGIN(CryptoPP) - -//! Windows Handle -class WindowsHandle -{ -public: - WindowsHandle(HANDLE h = INVALID_HANDLE_VALUE, bool own=false); - WindowsHandle(const WindowsHandle &h) : m_h(h.m_h), m_own(false) {} - virtual ~WindowsHandle(); - - bool GetOwnership() const {return m_own;} - void SetOwnership(bool own) {m_own = own;} - - operator HANDLE() const {return m_h;} - HANDLE GetHandle() const {return m_h;} - bool HandleValid() const; - void AttachHandle(HANDLE h, bool own=false); - HANDLE DetachHandle(); - void CloseHandle(); - -protected: - virtual void HandleChanged() {} - - HANDLE m_h; - bool m_own; -}; - -//! Windows Pipe -class WindowsPipe -{ -public: - class Err : public OS_Error - { - public: - Err(HANDLE h, const std::string& operation, int error); - HANDLE GetHandle() const {return m_h;} - - private: - HANDLE m_h; - }; - -protected: - virtual HANDLE GetHandle() const =0; - virtual void HandleError(const char *operation) const; - void CheckAndHandleError(const char *operation, BOOL result) const - {assert(result==TRUE || result==FALSE); if (!result) HandleError(operation);} -}; - -//! pipe-based implementation of NetworkReceiver -class WindowsPipeReceiver : public WindowsPipe, public NetworkReceiver -{ -public: - WindowsPipeReceiver(); - - bool MustWaitForResult() {return true;} - bool Receive(byte* buf, size_t bufLen); - unsigned int GetReceiveResult(); - bool EofReceived() const {return m_eofReceived;} - - HANDLE GetHandle() const {return m_event;} - unsigned int GetMaxWaitObjectCount() const {return 1;} - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - -private: - WindowsHandle m_event; - OVERLAPPED m_overlapped; - bool m_resultPending; - DWORD m_lastResult; - bool m_eofReceived; -}; - -//! pipe-based implementation of NetworkSender -class WindowsPipeSender : public WindowsPipe, public NetworkSender -{ -public: - WindowsPipeSender(); - - bool MustWaitForResult() {return true;} - void Send(const byte* buf, size_t bufLen); - unsigned int GetSendResult(); - bool MustWaitForEof() { return false; } - void SendEof() {} - - HANDLE GetHandle() const {return m_event;} - unsigned int GetMaxWaitObjectCount() const {return 1;} - void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack); - -private: - WindowsHandle m_event; - OVERLAPPED m_overlapped; - bool m_resultPending; - DWORD m_lastResult; -}; - -//! Windows Pipe Source -class WindowsPipeSource : public WindowsHandle, public NetworkSource, public WindowsPipeReceiver -{ -public: - WindowsPipeSource(HANDLE h=INVALID_HANDLE_VALUE, bool pumpAll=false, BufferedTransformation *attachment=NULL) - : WindowsHandle(h), NetworkSource(attachment) - { - if (pumpAll) - PumpAll(); - } - - using NetworkSource::GetMaxWaitObjectCount; - using NetworkSource::GetWaitObjects; - -private: - HANDLE GetHandle() const {return WindowsHandle::GetHandle();} - NetworkReceiver & AccessReceiver() {return *this;} -}; - -//! Windows Pipe Sink -class WindowsPipeSink : public WindowsHandle, public NetworkSink, public WindowsPipeSender -{ -public: - WindowsPipeSink(HANDLE h=INVALID_HANDLE_VALUE, unsigned int maxBufferSize=0, unsigned int autoFlushBound=16*1024) - : WindowsHandle(h), NetworkSink(maxBufferSize, autoFlushBound) {} - - using NetworkSink::GetMaxWaitObjectCount; - using NetworkSink::GetWaitObjects; - -private: - HANDLE GetHandle() const {return WindowsHandle::GetHandle();} - NetworkSender & AccessSender() {return *this;} -}; - -NAMESPACE_END - -#endif // WINDOWS_PIPES_AVAILABLE - -#endif diff --git a/external/crypto++-5.6.3/words.h b/external/crypto++-5.6.3/words.h deleted file mode 100644 index 8fdec94ea..000000000 --- a/external/crypto++-5.6.3/words.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef CRYPTOPP_WORDS_H -#define CRYPTOPP_WORDS_H - -#include "config.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -inline size_t CountWords(const word *X, size_t N) -{ - while (N && X[N-1]==0) - N--; - return N; -} - -inline void SetWords(word *r, word a, size_t n) -{ - for (size_t i=0; i> (WORD_BITS-shiftBits); - } - return carry; -} - -inline word ShiftWordsRightByBits(word *r, size_t n, unsigned int shiftBits) -{ - assert (shiftBits0; i--) - { - u = r[i-1]; - r[i-1] = (u >> shiftBits) | carry; - carry = u << (WORD_BITS-shiftBits); - } - return carry; -} - -inline void ShiftWordsLeftByWords(word *r, size_t n, size_t shiftWords) -{ - shiftWords = STDMIN(shiftWords, n); - if (shiftWords) - { - for (size_t i=n-1; i>=shiftWords; i--) - r[i] = r[i-shiftWords]; - SetWords(r, 0, shiftWords); - } -} - -inline void ShiftWordsRightByWords(word *r, size_t n, size_t shiftWords) -{ - shiftWords = STDMIN(shiftWords, n); - if (shiftWords) - { - for (size_t i=0; i+shiftWords().Ref(); -} - -void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits) -{ - assert(qbits > 9); // no primes exist for pbits = 10, qbits = 9 - assert(pbits > qbits); - - const Integer minQ = Integer::Power2(qbits - 1); - const Integer maxQ = Integer::Power2(qbits) - 1; - const Integer minP = Integer::Power2(pbits - 1); - const Integer maxP = Integer::Power2(pbits) - 1; - - Integer r1, r2; - do - { - bool qFound = q.Randomize(rng, minQ, maxQ, Integer::PRIME, 7, 12); - CRYPTOPP_UNUSED(qFound); assert(qFound); - bool solutionsExist = SolveModularQuadraticEquation(r1, r2, 1, -1, 1, q); - CRYPTOPP_UNUSED(solutionsExist); assert(solutionsExist); - } while (!p.Randomize(rng, minP, maxP, Integer::PRIME, CRT(rng.GenerateBit()?r1:r2, q, 2, 3, EuclideanMultiplicativeInverse(p, 3)), 3*q)); - assert(((p.Squared() - p + 1) % q).IsZero()); - - GFP2_ONB gfp2(p); - GFP2Element three = gfp2.ConvertIn(3), t; - - while (true) - { - g.c1.Randomize(rng, Integer::Zero(), p-1); - g.c2.Randomize(rng, Integer::Zero(), p-1); - t = XTR_Exponentiate(g, p+1, p); - if (t.c1 == t.c2) - continue; - g = XTR_Exponentiate(g, (p.Squared()-p+1)/q, p); - if (g != three) - break; - } - assert(XTR_Exponentiate(g, q, p) == three); -} - -GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p) -{ - unsigned int bitCount = e.BitCount(); - if (bitCount == 0) - return GFP2Element(-3, -3); - - // find the lowest bit of e that is 1 - unsigned int lowest1bit; - for (lowest1bit=0; e.GetBit(lowest1bit) == 0; lowest1bit++) {} - - GFP2_ONB gfp2(p); - GFP2Element c = gfp2.ConvertIn(b); - GFP2Element cp = gfp2.PthPower(c); - GFP2Element S[5] = {gfp2.ConvertIn(3), c, gfp2.SpecialOperation1(c)}; - - // do all exponents bits except the lowest zeros starting from the top - unsigned int i; - for (i = e.BitCount() - 1; i>lowest1bit; i--) - { - if (e.GetBit(i)) - { - gfp2.RaiseToPthPower(S[0]); - gfp2.Accumulate(S[0], gfp2.SpecialOperation2(S[2], c, S[1])); - S[1] = gfp2.SpecialOperation1(S[1]); - S[2] = gfp2.SpecialOperation1(S[2]); - S[0].swap(S[1]); - } - else - { - gfp2.RaiseToPthPower(S[2]); - gfp2.Accumulate(S[2], gfp2.SpecialOperation2(S[0], cp, S[1])); - S[1] = gfp2.SpecialOperation1(S[1]); - S[0] = gfp2.SpecialOperation1(S[0]); - S[2].swap(S[1]); - } - } - - // now do the lowest zeros - while (i--) - S[1] = gfp2.SpecialOperation1(S[1]); - - return gfp2.ConvertOut(S[1]); -} - -template class AbstractRing; -template class AbstractGroup; - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/xtr.h b/external/crypto++-5.6.3/xtr.h deleted file mode 100644 index 3317feb90..000000000 --- a/external/crypto++-5.6.3/xtr.h +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef CRYPTOPP_XTR_H -#define CRYPTOPP_XTR_H - -/** \file - "The XTR public key system" by Arjen K. Lenstra and Eric R. Verheul -*/ - -#include "cryptlib.h" -#include "modarith.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! an element of GF(p^2) -class GFP2Element -{ -public: - GFP2Element() {} - GFP2Element(const Integer &c1, const Integer &c2) : c1(c1), c2(c2) {} - GFP2Element(const byte *encodedElement, unsigned int size) - : c1(encodedElement, size/2), c2(encodedElement+size/2, size/2) {} - - void Encode(byte *encodedElement, unsigned int size) - { - c1.Encode(encodedElement, size/2); - c2.Encode(encodedElement+size/2, size/2); - } - - bool operator==(const GFP2Element &rhs) const {return c1 == rhs.c1 && c2 == rhs.c2;} - bool operator!=(const GFP2Element &rhs) const {return !operator==(rhs);} - - void swap(GFP2Element &a) - { - c1.swap(a.c1); - c2.swap(a.c2); - } - - static const GFP2Element & Zero(); - - Integer c1, c2; -}; - -//! GF(p^2), optimal normal basis -template -class GFP2_ONB : public AbstractRing -{ -public: - typedef F BaseField; - - GFP2_ONB(const Integer &p) : modp(p) - { - if (p%3 != 2) - throw InvalidArgument("GFP2_ONB: modulus must be equivalent to 2 mod 3"); - } - - const Integer& GetModulus() const {return modp.GetModulus();} - - GFP2Element ConvertIn(const Integer &a) const - { - t = modp.Inverse(modp.ConvertIn(a)); - return GFP2Element(t, t); - } - - GFP2Element ConvertIn(const GFP2Element &a) const - {return GFP2Element(modp.ConvertIn(a.c1), modp.ConvertIn(a.c2));} - - GFP2Element ConvertOut(const GFP2Element &a) const - {return GFP2Element(modp.ConvertOut(a.c1), modp.ConvertOut(a.c2));} - - bool Equal(const GFP2Element &a, const GFP2Element &b) const - { - return modp.Equal(a.c1, b.c1) && modp.Equal(a.c2, b.c2); - } - - const Element& Identity() const - { - return GFP2Element::Zero(); - } - - const Element& Add(const Element &a, const Element &b) const - { - result.c1 = modp.Add(a.c1, b.c1); - result.c2 = modp.Add(a.c2, b.c2); - return result; - } - - const Element& Inverse(const Element &a) const - { - result.c1 = modp.Inverse(a.c1); - result.c2 = modp.Inverse(a.c2); - return result; - } - - const Element& Double(const Element &a) const - { - result.c1 = modp.Double(a.c1); - result.c2 = modp.Double(a.c2); - return result; - } - - const Element& Subtract(const Element &a, const Element &b) const - { - result.c1 = modp.Subtract(a.c1, b.c1); - result.c2 = modp.Subtract(a.c2, b.c2); - return result; - } - - Element& Accumulate(Element &a, const Element &b) const - { - modp.Accumulate(a.c1, b.c1); - modp.Accumulate(a.c2, b.c2); - return a; - } - - Element& Reduce(Element &a, const Element &b) const - { - modp.Reduce(a.c1, b.c1); - modp.Reduce(a.c2, b.c2); - return a; - } - - bool IsUnit(const Element &a) const - { - return a.c1.NotZero() || a.c2.NotZero(); - } - - const Element& MultiplicativeIdentity() const - { - result.c1 = result.c2 = modp.Inverse(modp.MultiplicativeIdentity()); - return result; - } - - const Element& Multiply(const Element &a, const Element &b) const - { - t = modp.Add(a.c1, a.c2); - t = modp.Multiply(t, modp.Add(b.c1, b.c2)); - result.c1 = modp.Multiply(a.c1, b.c1); - result.c2 = modp.Multiply(a.c2, b.c2); - result.c1.swap(result.c2); - modp.Reduce(t, result.c1); - modp.Reduce(t, result.c2); - modp.Reduce(result.c1, t); - modp.Reduce(result.c2, t); - return result; - } - - const Element& MultiplicativeInverse(const Element &a) const - { - return result = Exponentiate(a, modp.GetModulus()-2); - } - - const Element& Square(const Element &a) const - { - const Integer &ac1 = (&a == &result) ? (t = a.c1) : a.c1; - result.c1 = modp.Multiply(modp.Subtract(modp.Subtract(a.c2, a.c1), a.c1), a.c2); - result.c2 = modp.Multiply(modp.Subtract(modp.Subtract(ac1, a.c2), a.c2), ac1); - return result; - } - - Element Exponentiate(const Element &a, const Integer &e) const - { - Integer edivp, emodp; - Integer::Divide(emodp, edivp, e, modp.GetModulus()); - Element b = PthPower(a); - return AbstractRing::CascadeExponentiate(a, emodp, b, edivp); - } - - const Element & PthPower(const Element &a) const - { - result = a; - result.c1.swap(result.c2); - return result; - } - - void RaiseToPthPower(Element &a) const - { - a.c1.swap(a.c2); - } - - // a^2 - 2a^p - const Element & SpecialOperation1(const Element &a) const - { - assert(&a != &result); - result = Square(a); - modp.Reduce(result.c1, a.c2); - modp.Reduce(result.c1, a.c2); - modp.Reduce(result.c2, a.c1); - modp.Reduce(result.c2, a.c1); - return result; - } - - // x * z - y * z^p - const Element & SpecialOperation2(const Element &x, const Element &y, const Element &z) const - { - assert(&x != &result && &y != &result && &z != &result); - t = modp.Add(x.c2, y.c2); - result.c1 = modp.Multiply(z.c1, modp.Subtract(y.c1, t)); - modp.Accumulate(result.c1, modp.Multiply(z.c2, modp.Subtract(t, x.c1))); - t = modp.Add(x.c1, y.c1); - result.c2 = modp.Multiply(z.c2, modp.Subtract(y.c2, t)); - modp.Accumulate(result.c2, modp.Multiply(z.c1, modp.Subtract(t, x.c2))); - return result; - } - -protected: - BaseField modp; - mutable GFP2Element result; - mutable Integer t; -}; - -void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits); - -GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p); - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/xtrcrypt.cpp b/external/crypto++-5.6.3/xtrcrypt.cpp deleted file mode 100644 index a9fd7879b..000000000 --- a/external/crypto++-5.6.3/xtrcrypt.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// xtrcrypt.cpp - written and placed in the public domain by Wei Dai - -#include "pch.h" - -#include "asn.h" -#include "integer.h" -#include "xtrcrypt.h" -#include "nbtheory.h" -#include "modarith.h" -#include "argnames.h" - -NAMESPACE_BEGIN(CryptoPP) - -XTR_DH::XTR_DH(const Integer &p, const Integer &q, const GFP2Element &g) - : m_p(p), m_q(q), m_g(g) -{ -} - -XTR_DH::XTR_DH(RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits) -{ - XTR_FindPrimesAndGenerator(rng, m_p, m_q, m_g, pbits, qbits); -} - -XTR_DH::XTR_DH(BufferedTransformation &bt) -{ - BERSequenceDecoder seq(bt); - m_p.BERDecode(seq); - m_q.BERDecode(seq); - m_g.c1.BERDecode(seq); - m_g.c2.BERDecode(seq); - seq.MessageEnd(); -} - -void XTR_DH::DEREncode(BufferedTransformation &bt) const -{ - DERSequenceEncoder seq(bt); - m_p.DEREncode(seq); - m_q.DEREncode(seq); - m_g.c1.DEREncode(seq); - m_g.c2.DEREncode(seq); - seq.MessageEnd(); -} - -bool XTR_DH::Validate(RandomNumberGenerator &rng, unsigned int level) const -{ - bool pass = true; - pass = pass && m_p > Integer::One() && m_p.IsOdd(); - pass = pass && m_q > Integer::One() && m_q.IsOdd(); - GFP2Element three = GFP2_ONB(m_p).ConvertIn(3); - pass = pass && !(m_g.c1.IsNegative() || m_g.c2.IsNegative() || m_g.c1 >= m_p || m_g.c2 >= m_p || m_g == three); - if (level >= 1) - pass = pass && ((m_p.Squared()-m_p+1)%m_q).IsZero(); - if (level >= 2) - { - pass = pass && VerifyPrime(rng, m_p, level-2) && VerifyPrime(rng, m_q, level-2); - pass = pass && XTR_Exponentiate(m_g, (m_p.Squared()-m_p+1)/m_q, m_p) != three; - pass = pass && XTR_Exponentiate(m_g, m_q, m_p) == three; - } - return pass; -} - -bool XTR_DH::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const -{ - return GetValueHelper(this, name, valueType, pValue).Assignable() - CRYPTOPP_GET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupOrder) - CRYPTOPP_GET_FUNCTION_ENTRY(SubgroupGenerator) - ; -} - -void XTR_DH::AssignFrom(const NameValuePairs &source) -{ - AssignFromHelper(this, source) - CRYPTOPP_SET_FUNCTION_ENTRY(Modulus) - CRYPTOPP_SET_FUNCTION_ENTRY(SubgroupOrder) - CRYPTOPP_SET_FUNCTION_ENTRY(SubgroupGenerator) - ; -} - -void XTR_DH::GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const -{ - Integer x(rng, Integer::Zero(), m_q-1); - x.Encode(privateKey, PrivateKeyLength()); -} - -void XTR_DH::GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const -{ - CRYPTOPP_UNUSED(rng); - Integer x(privateKey, PrivateKeyLength()); - GFP2Element y = XTR_Exponentiate(m_g, x, m_p); - y.Encode(publicKey, PublicKeyLength()); -} - -bool XTR_DH::Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey) const -{ - GFP2Element w(otherPublicKey, PublicKeyLength()); - if (validateOtherPublicKey) - { - GFP2_ONB gfp2(m_p); - GFP2Element three = gfp2.ConvertIn(3); - if (w.c1.IsNegative() || w.c2.IsNegative() || w.c1 >= m_p || w.c2 >= m_p || w == three) - return false; - if (XTR_Exponentiate(w, m_q, m_p) != three) - return false; - } - Integer s(privateKey, PrivateKeyLength()); - GFP2Element z = XTR_Exponentiate(w, s, m_p); - z.Encode(agreedValue, AgreedValueLength()); - return true; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/xtrcrypt.h b/external/crypto++-5.6.3/xtrcrypt.h deleted file mode 100644 index c8a2f820f..000000000 --- a/external/crypto++-5.6.3/xtrcrypt.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef CRYPTOPP_XTRCRYPT_H -#define CRYPTOPP_XTRCRYPT_H - -/** \file - "The XTR public key system" by Arjen K. Lenstra and Eric R. Verheul -*/ - -#include "cryptlib.h" -#include "xtr.h" -#include "integer.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! XTR-DH with key validation - -class XTR_DH : public SimpleKeyAgreementDomain, public CryptoParameters -{ - typedef XTR_DH ThisClass; - -public: - XTR_DH(const Integer &p, const Integer &q, const GFP2Element &g); - XTR_DH(RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits); - XTR_DH(BufferedTransformation &domainParams); - - void DEREncode(BufferedTransformation &domainParams) const; - - bool Validate(RandomNumberGenerator &rng, unsigned int level) const; - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - void AssignFrom(const NameValuePairs &source); - CryptoParameters & AccessCryptoParameters() {return *this;} - unsigned int AgreedValueLength() const {return 2*m_p.ByteCount();} - unsigned int PrivateKeyLength() const {return m_q.ByteCount();} - unsigned int PublicKeyLength() const {return 2*m_p.ByteCount();} - - void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const; - void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const; - bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const; - - const Integer &GetModulus() const {return m_p;} - const Integer &GetSubgroupOrder() const {return m_q;} - const GFP2Element &GetSubgroupGenerator() const {return m_g;} - - void SetModulus(const Integer &p) {m_p = p;} - void SetSubgroupOrder(const Integer &q) {m_q = q;} - void SetSubgroupGenerator(const GFP2Element &g) {m_g = g;} - -private: - unsigned int ExponentBitLength() const; - - Integer m_p, m_q; - GFP2Element m_g; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/zdeflate.cpp b/external/crypto++-5.6.3/zdeflate.cpp deleted file mode 100644 index 407c2a263..000000000 --- a/external/crypto++-5.6.3/zdeflate.cpp +++ /dev/null @@ -1,815 +0,0 @@ -// zdeflate.cpp - written and placed in the public domain by Wei Dai - -// Many of the algorithms and tables used here came from the deflate implementation -// by Jean-loup Gailly, which was included in Crypto++ 4.0 and earlier. I completely -// rewrote it in order to fix a bug that I could not figure out. This code -// is less clever, but hopefully more understandable and maintainable. - -#include "pch.h" -#include "zdeflate.h" -#include "stdcpp.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -LowFirstBitWriter::LowFirstBitWriter(BufferedTransformation *attachment) - : Filter(attachment), m_counting(false), m_bitCount(0), m_buffer(0) - , m_bitsBuffered(0), m_bytesBuffered(0) -{ -} - -void LowFirstBitWriter::StartCounting() -{ - assert(!m_counting); - m_counting = true; - m_bitCount = 0; -} - -unsigned long LowFirstBitWriter::FinishCounting() -{ - assert(m_counting); - m_counting = false; - return m_bitCount; -} - -void LowFirstBitWriter::PutBits(unsigned long value, unsigned int length) -{ - if (m_counting) - m_bitCount += length; - else - { - m_buffer |= value << m_bitsBuffered; - m_bitsBuffered += length; - assert(m_bitsBuffered <= sizeof(unsigned long)*8); - while (m_bitsBuffered >= 8) - { - m_outputBuffer[m_bytesBuffered++] = (byte)m_buffer; - if (m_bytesBuffered == m_outputBuffer.size()) - { - AttachedTransformation()->PutModifiable(m_outputBuffer, m_bytesBuffered); - m_bytesBuffered = 0; - } - m_buffer >>= 8; - m_bitsBuffered -= 8; - } - } -} - -void LowFirstBitWriter::FlushBitBuffer() -{ - if (m_counting) - m_bitCount += 8*(m_bitsBuffered > 0); - else - { - if (m_bytesBuffered > 0) - { - AttachedTransformation()->PutModifiable(m_outputBuffer, m_bytesBuffered); - m_bytesBuffered = 0; - } - if (m_bitsBuffered > 0) - { - AttachedTransformation()->Put((byte)m_buffer); - m_buffer = 0; - m_bitsBuffered = 0; - } - } -} - -void LowFirstBitWriter::ClearBitBuffer() -{ - m_buffer = 0; - m_bytesBuffered = 0; - m_bitsBuffered = 0; -} - -HuffmanEncoder::HuffmanEncoder(const unsigned int *codeBits, unsigned int nCodes) -{ - Initialize(codeBits, nCodes); -} - -struct HuffmanNode -{ - // Coverity finding on uninitalized 'symbol' member - HuffmanNode() - : symbol(0), parent(0) {} - HuffmanNode(const HuffmanNode& rhs) - : symbol(rhs.symbol), parent(rhs.parent) {} - - size_t symbol; - union {size_t parent; unsigned depth, freq;}; -}; - -struct FreqLessThan -{ - inline bool operator()(unsigned int lhs, const HuffmanNode &rhs) {return lhs < rhs.freq;} - inline bool operator()(const HuffmanNode &lhs, const HuffmanNode &rhs) const {return lhs.freq < rhs.freq;} - // needed for MSVC .NET 2005 - inline bool operator()(const HuffmanNode &lhs, unsigned int rhs) {return lhs.freq < rhs;} -}; - -void HuffmanEncoder::GenerateCodeLengths(unsigned int *codeBits, unsigned int maxCodeBits, const unsigned int *codeCounts, size_t nCodes) -{ - assert(nCodes > 0); - assert(nCodes <= ((size_t)1 << maxCodeBits)); - - size_t i; - SecBlockWithHint tree(nCodes); - for (i=0; i= 2) - for (i=tree.size()-2; i>=nCodes; i--) - tree[i].depth = tree[tree[i].parent].depth + 1; - unsigned int sum = 0; - SecBlockWithHint blCount(maxCodeBits+1); - std::fill(blCount.begin(), blCount.end(), 0); - for (i=treeBegin; i (unsigned int)(1 << maxCodeBits) ? sum - (1 << maxCodeBits) : 0; - - while (overflow--) - { - unsigned int bits = maxCodeBits-1; - while (blCount[bits] == 0) - bits--; - blCount[bits]--; - blCount[bits+1] += 2; - assert(blCount[maxCodeBits] > 0); - blCount[maxCodeBits]--; - } - - for (i=0; i 0); - unsigned int maxCodeBits = *std::max_element(codeBits, codeBits+nCodes); - if (maxCodeBits == 0) - return; // assume this object won't be used - - SecBlockWithHint blCount(maxCodeBits+1); - std::fill(blCount.begin(), blCount.end(), 0); - unsigned int i; - for (i=0; i nextCode(maxCodeBits+1); - nextCode[1] = 0; - for (i=2; i<=maxCodeBits; i++) - { - code = (code + blCount[i-1]) << 1; - nextCode[i] = code; - } - assert(maxCodeBits == 1 || code == (1 << maxCodeBits) - blCount[maxCodeBits]); - - m_valueToCode.resize(nCodes); - for (i=0; i> (8*sizeof(code_t)-len); - } -} - -inline void HuffmanEncoder::Encode(LowFirstBitWriter &writer, value_t value) const -{ - assert(m_valueToCode[value].len > 0); - writer.PutBits(m_valueToCode[value].code, m_valueToCode[value].len); -} - -Deflator::Deflator(BufferedTransformation *attachment, int deflateLevel, int log2WindowSize, bool detectUncompressible) - : LowFirstBitWriter(attachment) - , m_deflateLevel(-1) -{ - InitializeStaticEncoders(); - IsolatedInitialize(MakeParameters("DeflateLevel", deflateLevel)("Log2WindowSize", log2WindowSize)("DetectUncompressible", detectUncompressible)); -} - -Deflator::Deflator(const NameValuePairs ¶meters, BufferedTransformation *attachment) - : LowFirstBitWriter(attachment) - , m_deflateLevel(-1) -{ - InitializeStaticEncoders(); - IsolatedInitialize(parameters); -} - -void Deflator::InitializeStaticEncoders() -{ - unsigned int codeLengths[288]; - std::fill(codeLengths + 0, codeLengths + 144, 8); - std::fill(codeLengths + 144, codeLengths + 256, 9); - std::fill(codeLengths + 256, codeLengths + 280, 7); - std::fill(codeLengths + 280, codeLengths + 288, 8); - m_staticLiteralEncoder.Initialize(codeLengths, 288); - std::fill(codeLengths + 0, codeLengths + 32, 5); - m_staticDistanceEncoder.Initialize(codeLengths, 32); -} - -void Deflator::IsolatedInitialize(const NameValuePairs ¶meters) -{ - int log2WindowSize = parameters.GetIntValueWithDefault("Log2WindowSize", DEFAULT_LOG2_WINDOW_SIZE); - if (!(MIN_LOG2_WINDOW_SIZE <= log2WindowSize && log2WindowSize <= MAX_LOG2_WINDOW_SIZE)) - throw InvalidArgument("Deflator: " + IntToString(log2WindowSize) + " is an invalid window size"); - - m_log2WindowSize = log2WindowSize; - DSIZE = 1 << m_log2WindowSize; - DMASK = DSIZE - 1; - HSIZE = 1 << m_log2WindowSize; - HMASK = HSIZE - 1; - m_byteBuffer.New(2*DSIZE); - m_head.New(HSIZE); - m_prev.New(DSIZE); - m_matchBuffer.New(DSIZE/2); - Reset(true); - - const int deflateLevel = parameters.GetIntValueWithDefault("DeflateLevel", DEFAULT_DEFLATE_LEVEL); - assert(deflateLevel >= MIN_DEFLATE_LEVEL /*0*/ && deflateLevel <= MAX_DEFLATE_LEVEL /*9*/); - SetDeflateLevel(deflateLevel); - bool detectUncompressible = parameters.GetValueWithDefault("DetectUncompressible", true); - m_compressibleDeflateLevel = detectUncompressible ? m_deflateLevel : 0; -} - -void Deflator::Reset(bool forceReset) -{ - if (forceReset) - ClearBitBuffer(); - else - assert(m_bitsBuffered == 0); - - m_headerWritten = false; - m_matchAvailable = false; - m_dictionaryEnd = 0; - m_stringStart = 0; - m_lookahead = 0; - m_minLookahead = MAX_MATCH; - m_matchBufferEnd = 0; - m_blockStart = 0; - m_blockLength = 0; - - m_detectCount = 1; - m_detectSkip = 0; - - // m_prev will be initialized automaticly in InsertString - std::fill(m_head.begin(), m_head.end(), byte(0)); - - std::fill(m_literalCounts.begin(), m_literalCounts.end(), byte(0)); - std::fill(m_distanceCounts.begin(), m_distanceCounts.end(), byte(0)); -} - -void Deflator::SetDeflateLevel(int deflateLevel) -{ - if (!(MIN_DEFLATE_LEVEL <= deflateLevel && deflateLevel <= MAX_DEFLATE_LEVEL)) - throw InvalidArgument("Deflator: " + IntToString(deflateLevel) + " is an invalid deflate level"); - - if (deflateLevel == m_deflateLevel) - return; - - EndBlock(false); - - static const unsigned int configurationTable[10][4] = { - /* good lazy nice chain */ - /* 0 */ {0, 0, 0, 0}, /* store only */ - /* 1 */ {4, 3, 8, 4}, /* maximum speed, no lazy matches */ - /* 2 */ {4, 3, 16, 8}, - /* 3 */ {4, 3, 32, 32}, - /* 4 */ {4, 4, 16, 16}, /* lazy matches */ - /* 5 */ {8, 16, 32, 32}, - /* 6 */ {8, 16, 128, 128}, - /* 7 */ {8, 32, 128, 256}, - /* 8 */ {32, 128, 258, 1024}, - /* 9 */ {32, 258, 258, 4096}}; /* maximum compression */ - - GOOD_MATCH = configurationTable[deflateLevel][0]; - MAX_LAZYLENGTH = configurationTable[deflateLevel][1]; - MAX_CHAIN_LENGTH = configurationTable[deflateLevel][3]; - - m_deflateLevel = deflateLevel; -} - -unsigned int Deflator::FillWindow(const byte *str, size_t length) -{ - unsigned int maxBlockSize = (unsigned int)STDMIN(2UL*DSIZE, 0xffffUL); - - if (m_stringStart >= maxBlockSize - MAX_MATCH) - { - if (m_blockStart < DSIZE) - EndBlock(false); - - memcpy(m_byteBuffer, m_byteBuffer + DSIZE, DSIZE); - - m_dictionaryEnd = m_dictionaryEnd < DSIZE ? 0 : m_dictionaryEnd-DSIZE; - assert(m_stringStart >= DSIZE); - m_stringStart -= DSIZE; - assert(!m_matchAvailable || m_previousMatch >= DSIZE); - m_previousMatch -= DSIZE; - assert(m_blockStart >= DSIZE); - m_blockStart -= DSIZE; - - // These are set to the same value in IsolatedInitialize(). If they - // are the same, then we can clear a Coverity false alarm. - assert(DSIZE == HSIZE); - - unsigned int i; - for (i=0; i m_stringStart+m_lookahead); - unsigned int accepted = UnsignedMin(maxBlockSize-(m_stringStart+m_lookahead), length); - assert(accepted > 0); - memcpy(m_byteBuffer + m_stringStart + m_lookahead, str, accepted); - m_lookahead += accepted; - return accepted; -} - -inline unsigned int Deflator::ComputeHash(const byte *str) const -{ - assert(str+3 <= m_byteBuffer + m_stringStart + m_lookahead); - return ((str[0] << 10) ^ (str[1] << 5) ^ str[2]) & HMASK; -} - -unsigned int Deflator::LongestMatch(unsigned int &bestMatch) const -{ - assert(m_previousLength < MAX_MATCH); - - bestMatch = 0; - unsigned int bestLength = STDMAX(m_previousLength, (unsigned int)MIN_MATCH-1); - if (m_lookahead <= bestLength) - return 0; - - const byte *scan = m_byteBuffer + m_stringStart, *scanEnd = scan + STDMIN((unsigned int)MAX_MATCH, m_lookahead); - unsigned int limit = m_stringStart > (DSIZE-MAX_MATCH) ? m_stringStart - (DSIZE-MAX_MATCH) : 0; - unsigned int current = m_head[ComputeHash(scan)]; - - unsigned int chainLength = MAX_CHAIN_LENGTH; - if (m_previousLength >= GOOD_MATCH) - chainLength >>= 2; - - while (current > limit && --chainLength > 0) - { - const byte *match = m_byteBuffer + current; - assert(scan + bestLength < m_byteBuffer + m_stringStart + m_lookahead); - if (scan[bestLength-1] == match[bestLength-1] && scan[bestLength] == match[bestLength] && scan[0] == match[0] && scan[1] == match[1]) - { - assert(scan[2] == match[2]); - unsigned int len = (unsigned int)( -#if defined(_STDEXT_BEGIN) && !(defined(_MSC_VER) && (_MSC_VER < 1400 || _MSC_VER >= 1600)) && !defined(_STLPORT_VERSION) - stdext::unchecked_mismatch -#else - std::mismatch -#endif -#if _MSC_VER >= 1600 - (stdext::make_unchecked_array_iterator(scan)+3, stdext::make_unchecked_array_iterator(scanEnd), stdext::make_unchecked_array_iterator(match)+3).first - stdext::make_unchecked_array_iterator(scan)); -#else - (scan+3, scanEnd, match+3).first - scan); -#endif - assert(len != bestLength); - if (len > bestLength) - { - bestLength = len; - bestMatch = current; - - assert(scanEnd >= scan); - if (len == (unsigned int)(scanEnd - scan)) - break; - } - } - current = m_prev[current & DMASK]; - } - return (bestMatch > 0) ? bestLength : 0; -} - -inline void Deflator::InsertString(unsigned int start) -{ - assert(start <= 0xffff); - unsigned int hash = ComputeHash(m_byteBuffer + start); - m_prev[start & DMASK] = m_head[hash]; - m_head[hash] = word16(start); -} - -void Deflator::ProcessBuffer() -{ - if (!m_headerWritten) - { - WritePrestreamHeader(); - m_headerWritten = true; - } - - if (m_deflateLevel == 0) - { - m_stringStart += m_lookahead; - m_lookahead = 0; - m_blockLength = m_stringStart - m_blockStart; - m_matchAvailable = false; - return; - } - - while (m_lookahead > m_minLookahead) - { - while (m_dictionaryEnd < m_stringStart && m_dictionaryEnd+3 <= m_stringStart+m_lookahead) - InsertString(m_dictionaryEnd++); - - if (m_matchAvailable) - { - unsigned int matchPosition = 0, matchLength = 0; - bool usePreviousMatch; - if (m_previousLength >= MAX_LAZYLENGTH) - usePreviousMatch = true; - else - { - matchLength = LongestMatch(matchPosition); - usePreviousMatch = (matchLength == 0); - } - if (usePreviousMatch) - { - MatchFound(m_stringStart-1-m_previousMatch, m_previousLength); - m_stringStart += m_previousLength-1; - m_lookahead -= m_previousLength-1; - m_matchAvailable = false; - } - else - { - m_previousLength = matchLength; - m_previousMatch = matchPosition; - LiteralByte(m_byteBuffer[m_stringStart-1]); - m_stringStart++; - m_lookahead--; - } - } - else - { - m_previousLength = 0; - m_previousLength = LongestMatch(m_previousMatch); - if (m_previousLength) - m_matchAvailable = true; - else - LiteralByte(m_byteBuffer[m_stringStart]); - m_stringStart++; - m_lookahead--; - } - - assert(m_stringStart - (m_blockStart+m_blockLength) == (unsigned int)m_matchAvailable); - } - - if (m_minLookahead == 0 && m_matchAvailable) - { - LiteralByte(m_byteBuffer[m_stringStart-1]); - m_matchAvailable = false; - } -} - -size_t Deflator::Put2(const byte *str, size_t length, int messageEnd, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("Deflator"); - - size_t accepted = 0; - while (accepted < length) - { - unsigned int newAccepted = FillWindow(str+accepted, length-accepted); - ProcessBuffer(); - // call ProcessUncompressedData() after WritePrestreamHeader() - ProcessUncompressedData(str+accepted, newAccepted); - accepted += newAccepted; - } - assert(accepted == length); - - if (messageEnd) - { - m_minLookahead = 0; - ProcessBuffer(); - EndBlock(true); - FlushBitBuffer(); - WritePoststreamTail(); - Reset(); - } - - Output(0, NULL, 0, messageEnd, blocking); - return 0; -} - -bool Deflator::IsolatedFlush(bool hardFlush, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("Deflator"); - - m_minLookahead = 0; - ProcessBuffer(); - m_minLookahead = MAX_MATCH; - EndBlock(false); - if (hardFlush) - EncodeBlock(false, STORED); - return false; -} - -void Deflator::LiteralByte(byte b) -{ - if (m_matchBufferEnd == m_matchBuffer.size()) - EndBlock(false); - - m_matchBuffer[m_matchBufferEnd++].literalCode = b; - m_literalCounts[b]++; - m_blockLength++; -} - -void Deflator::MatchFound(unsigned int distance, unsigned int length) -{ - if (m_matchBufferEnd == m_matchBuffer.size()) - EndBlock(false); - - static const unsigned int lengthCodes[] = { - 257, 258, 259, 260, 261, 262, 263, 264, 265, 265, 266, 266, 267, 267, 268, 268, - 269, 269, 269, 269, 270, 270, 270, 270, 271, 271, 271, 271, 272, 272, 272, 272, - 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 274, 274, 274, 274, 274, 274, - 275, 275, 275, 275, 275, 275, 275, 275, 276, 276, 276, 276, 276, 276, 276, 276, - 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, - 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 285}; - static const unsigned int lengthBases[] = - {3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195, - 227,258}; - static const unsigned int distanceBases[30] = - {1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073, - 4097,6145,8193,12289,16385,24577}; - - assert(m_matchBufferEnd < m_matchBuffer.size()); - EncodedMatch &m = m_matchBuffer[m_matchBufferEnd++]; - assert(length >= 3 && length < COUNTOF(lengthCodes)); - unsigned int lengthCode = lengthCodes[length-3]; - m.literalCode = lengthCode; - m.literalExtra = length - lengthBases[lengthCode-257]; - unsigned int distanceCode = (unsigned int)(std::upper_bound(distanceBases, distanceBases+30, distance) - distanceBases - 1); - m.distanceCode = distanceCode; - m.distanceExtra = distance - distanceBases[distanceCode]; - - m_literalCounts[lengthCode]++; - m_distanceCounts[distanceCode]++; - m_blockLength += length; -} - -inline unsigned int CodeLengthEncode(const unsigned int *begin, - const unsigned int *end, - const unsigned int *& p, - unsigned int &extraBits, - unsigned int &extraBitsLength) -{ - unsigned int v = *p; - if ((end-p) >= 3) - { - const unsigned int *oldp = p; - if (v==0 && p[1]==0 && p[2]==0) - { - for (p=p+3; p!=end && *p==0 && p!=oldp+138; p++) {} - unsigned int repeat = (unsigned int)(p - oldp); - if (repeat <= 10) - { - extraBits = repeat-3; - extraBitsLength = 3; - return 17; - } - else - { - extraBits = repeat-11; - extraBitsLength = 7; - return 18; - } - } - else if (p!=begin && v==p[-1] && v==p[1] && v==p[2]) - { - for (p=p+3; p!=end && *p==v && p!=oldp+6; p++) {} - unsigned int repeat = (unsigned int)(p - oldp); - extraBits = repeat-3; - extraBitsLength = 2; - return 16; - } - } - p++; - extraBits = 0; - extraBitsLength = 0; - return v; -} - -void Deflator::EncodeBlock(bool eof, unsigned int blockType) -{ - PutBits(eof, 1); - PutBits(blockType, 2); - - if (blockType == STORED) - { - assert(m_blockStart + m_blockLength <= m_byteBuffer.size()); - assert(m_blockLength <= 0xffff); - FlushBitBuffer(); - AttachedTransformation()->PutWord16(word16(m_blockLength), LITTLE_ENDIAN_ORDER); - AttachedTransformation()->PutWord16(word16(~m_blockLength), LITTLE_ENDIAN_ORDER); - AttachedTransformation()->Put(m_byteBuffer + m_blockStart, m_blockLength); - } - else - { - if (blockType == DYNAMIC) - { -#if defined(_MSC_VER) && !defined(__MWERKS__) && (_MSC_VER <= 1300) - // VC60 and VC7 workaround: built-in std::reverse_iterator has two template parameters, Dinkumware only has one - typedef reverse_bidirectional_iterator RevIt; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator RevIt; -#else - typedef std::reverse_iterator RevIt; -#endif - - FixedSizeSecBlock literalCodeLengths; - FixedSizeSecBlock distanceCodeLengths; - - m_literalCounts[256] = 1; - HuffmanEncoder::GenerateCodeLengths(literalCodeLengths, 15, m_literalCounts, 286); - m_dynamicLiteralEncoder.Initialize(literalCodeLengths, 286); - unsigned int hlit = (unsigned int)(std::find_if(RevIt(literalCodeLengths.end()), RevIt(literalCodeLengths.begin()+257), std::bind2nd(std::not_equal_to(), 0)).base() - (literalCodeLengths.begin()+257)); - - HuffmanEncoder::GenerateCodeLengths(distanceCodeLengths, 15, m_distanceCounts, 30); - m_dynamicDistanceEncoder.Initialize(distanceCodeLengths, 30); - unsigned int hdist = (unsigned int)(std::find_if(RevIt(distanceCodeLengths.end()), RevIt(distanceCodeLengths.begin()+1), std::bind2nd(std::not_equal_to(), 0)).base() - (distanceCodeLengths.begin()+1)); - - SecBlockWithHint combinedLengths(hlit+257+hdist+1); - memcpy(combinedLengths, literalCodeLengths, (hlit+257)*sizeof(unsigned int)); - memcpy(combinedLengths+hlit+257, distanceCodeLengths, (hdist+1)*sizeof(unsigned int)); - - FixedSizeSecBlock codeLengthCodeCounts, codeLengthCodeLengths; - std::fill(codeLengthCodeCounts.begin(), codeLengthCodeCounts.end(), 0); - const unsigned int *p = combinedLengths.begin(), *begin = combinedLengths.begin(), *end = combinedLengths.end(); - while (p != end) - { - unsigned int code=0, extraBits=0, extraBitsLength=0; - code = CodeLengthEncode(begin, end, p, extraBits, extraBitsLength); - codeLengthCodeCounts[code]++; - } - HuffmanEncoder::GenerateCodeLengths(codeLengthCodeLengths, 7, codeLengthCodeCounts, 19); - HuffmanEncoder codeLengthEncoder(codeLengthCodeLengths, 19); - static const unsigned int border[] = { // Order of the bit length code lengths - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - unsigned int hclen = 19; - while (hclen > 4 && codeLengthCodeLengths[border[hclen-1]] == 0) - hclen--; - hclen -= 4; - - PutBits(hlit, 5); - PutBits(hdist, 5); - PutBits(hclen, 4); - - for (unsigned int i=0; i= 257) - { - assert(literalCode <= 285); - PutBits(m_matchBuffer[i].literalExtra, lengthExtraBits[literalCode-257]); - unsigned int distanceCode = m_matchBuffer[i].distanceCode; - distanceEncoder.Encode(*this, distanceCode); - PutBits(m_matchBuffer[i].distanceExtra, distanceExtraBits[distanceCode]); - } - } - literalEncoder.Encode(*this, 256); // end of block - } -} - -void Deflator::EndBlock(bool eof) -{ - if (m_blockLength == 0 && !eof) - return; - - if (m_deflateLevel == 0) - { - EncodeBlock(eof, STORED); - - if (m_compressibleDeflateLevel > 0 && ++m_detectCount == m_detectSkip) - { - m_deflateLevel = m_compressibleDeflateLevel; - m_detectCount = 1; - } - } - else - { - unsigned long storedLen = 8*((unsigned long)m_blockLength+4) + RoundUpToMultipleOf(m_bitsBuffered+3, 8U)-m_bitsBuffered; - - StartCounting(); - EncodeBlock(eof, STATIC); - unsigned long staticLen = FinishCounting(); - - unsigned long dynamicLen; - if (m_blockLength < 128 && m_deflateLevel < 8) - dynamicLen = ULONG_MAX; - else - { - StartCounting(); - EncodeBlock(eof, DYNAMIC); - dynamicLen = FinishCounting(); - } - - if (storedLen <= staticLen && storedLen <= dynamicLen) - { - EncodeBlock(eof, STORED); - - if (m_compressibleDeflateLevel > 0) - { - if (m_detectSkip) - m_deflateLevel = 0; - m_detectSkip = m_detectSkip ? STDMIN(2*m_detectSkip, 128U) : 1; - } - } - else - { - if (staticLen <= dynamicLen) - EncodeBlock(eof, STATIC); - else - EncodeBlock(eof, DYNAMIC); - - if (m_compressibleDeflateLevel > 0) - m_detectSkip = 0; - } - } - - m_matchBufferEnd = 0; - m_blockStart += m_blockLength; - m_blockLength = 0; - std::fill(m_literalCounts.begin(), m_literalCounts.end(), 0); - std::fill(m_distanceCounts.begin(), m_distanceCounts.end(), 0); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/zdeflate.h b/external/crypto++-5.6.3/zdeflate.h deleted file mode 100644 index 6c0a79287..000000000 --- a/external/crypto++-5.6.3/zdeflate.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef CRYPTOPP_ZDEFLATE_H -#define CRYPTOPP_ZDEFLATE_H - -#include "cryptlib.h" -#include "filters.h" -#include "misc.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class LowFirstBitWriter : public Filter -{ -public: - LowFirstBitWriter(BufferedTransformation *attachment); - void PutBits(unsigned long value, unsigned int length); - void FlushBitBuffer(); - void ClearBitBuffer(); - - void StartCounting(); - unsigned long FinishCounting(); - -protected: - bool m_counting; - unsigned long m_bitCount; - unsigned long m_buffer; - unsigned int m_bitsBuffered, m_bytesBuffered; - FixedSizeSecBlock m_outputBuffer; -}; - -//! \class HuffmanEncoder -class HuffmanEncoder -{ -public: - typedef unsigned int code_t; - typedef unsigned int value_t; - - //! \brief Construct a HuffmanEncoder - HuffmanEncoder() {} - - //! \brief Construct a HuffmanEncoder - //! \param codeBits a table of code bits - //! \param nCodes the number of codes in the table - HuffmanEncoder(const unsigned int *codeBits, unsigned int nCodes); - - //! \brief Initialize or reinitialize this object - //! \param codeBits a table of code bits - //! \param nCodes the number of codes in the table - void Initialize(const unsigned int *codeBits, unsigned int nCodes); - - static void GenerateCodeLengths(unsigned int *codeBits, unsigned int maxCodeBits, const unsigned int *codeCounts, size_t nCodes); - - void Encode(LowFirstBitWriter &writer, value_t value) const; - - struct Code - { - unsigned int code; - unsigned int len; - }; - - SecBlock m_valueToCode; -}; - -//! DEFLATE (RFC 1951) compressor - -class Deflator : public LowFirstBitWriter -{ -public: - enum {MIN_DEFLATE_LEVEL = 0, DEFAULT_DEFLATE_LEVEL = 6, MAX_DEFLATE_LEVEL = 9}; - enum {MIN_LOG2_WINDOW_SIZE = 9, DEFAULT_LOG2_WINDOW_SIZE = 15, MAX_LOG2_WINDOW_SIZE = 15}; - /*! \note detectUncompressible makes it faster to process uncompressible files, but - if a file has both compressible and uncompressible parts, it may fail to compress some of the - compressible parts. */ - Deflator(BufferedTransformation *attachment=NULL, int deflateLevel=DEFAULT_DEFLATE_LEVEL, int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true); - //! possible parameter names: Log2WindowSize, DeflateLevel, DetectUncompressible - Deflator(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL); - - //! this function can be used to set the deflate level in the middle of compression - void SetDeflateLevel(int deflateLevel); - int GetDeflateLevel() const {return m_deflateLevel;} - int GetLog2WindowSize() const {return m_log2WindowSize;} - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - bool IsolatedFlush(bool hardFlush, bool blocking); - -protected: - virtual void WritePrestreamHeader() {} - virtual void ProcessUncompressedData(const byte *string, size_t length) - {CRYPTOPP_UNUSED(string), CRYPTOPP_UNUSED(length);} - virtual void WritePoststreamTail() {} - - enum {STORED = 0, STATIC = 1, DYNAMIC = 2}; - enum {MIN_MATCH = 3, MAX_MATCH = 258}; - - void InitializeStaticEncoders(); - void Reset(bool forceReset = false); - unsigned int FillWindow(const byte *str, size_t length); - unsigned int ComputeHash(const byte *str) const; - unsigned int LongestMatch(unsigned int &bestMatch) const; - void InsertString(unsigned int start); - void ProcessBuffer(); - - void LiteralByte(byte b); - void MatchFound(unsigned int distance, unsigned int length); - void EncodeBlock(bool eof, unsigned int blockType); - void EndBlock(bool eof); - - struct EncodedMatch - { - unsigned literalCode : 9; - unsigned literalExtra : 5; - unsigned distanceCode : 5; - unsigned distanceExtra : 13; - }; - - int m_deflateLevel, m_log2WindowSize, m_compressibleDeflateLevel; - unsigned int m_detectSkip, m_detectCount; - unsigned int DSIZE, DMASK, HSIZE, HMASK, GOOD_MATCH, MAX_LAZYLENGTH, MAX_CHAIN_LENGTH; - bool m_headerWritten, m_matchAvailable; - unsigned int m_dictionaryEnd, m_stringStart, m_lookahead, m_minLookahead, m_previousMatch, m_previousLength; - HuffmanEncoder m_staticLiteralEncoder, m_staticDistanceEncoder, m_dynamicLiteralEncoder, m_dynamicDistanceEncoder; - SecByteBlock m_byteBuffer; - SecBlock m_head, m_prev; - FixedSizeSecBlock m_literalCounts; - FixedSizeSecBlock m_distanceCounts; - SecBlock m_matchBuffer; - unsigned int m_matchBufferEnd, m_blockStart, m_blockLength; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/zinflate.cpp b/external/crypto++-5.6.3/zinflate.cpp deleted file mode 100644 index 669efba32..000000000 --- a/external/crypto++-5.6.3/zinflate.cpp +++ /dev/null @@ -1,637 +0,0 @@ -// zinflate.cpp - written and placed in the public domain by Wei Dai - -// This is a complete reimplementation of the DEFLATE decompression algorithm. -// It should not be affected by any security vulnerabilities in the zlib -// compression library. In particular it is not affected by the double free bug -// (http://www.kb.cert.org/vuls/id/368819). - -#include "pch.h" - -#include "zinflate.h" -#include "secblock.h" -#include "smartptr.h" - -NAMESPACE_BEGIN(CryptoPP) - -struct CodeLessThan -{ - inline bool operator()(CryptoPP::HuffmanDecoder::code_t lhs, const CryptoPP::HuffmanDecoder::CodeInfo &rhs) - {return lhs < rhs.code;} - // needed for MSVC .NET 2005 - inline bool operator()(const CryptoPP::HuffmanDecoder::CodeInfo &lhs, const CryptoPP::HuffmanDecoder::CodeInfo &rhs) - {return lhs.code < rhs.code;} -}; - -inline bool LowFirstBitReader::FillBuffer(unsigned int length) -{ - while (m_bitsBuffered < length) - { - byte b; - if (!m_store.Get(b)) - return false; - m_buffer |= (unsigned long)b << m_bitsBuffered; - m_bitsBuffered += 8; - } - assert(m_bitsBuffered <= sizeof(unsigned long)*8); - return true; -} - -inline unsigned long LowFirstBitReader::PeekBits(unsigned int length) -{ - bool result = FillBuffer(length); - CRYPTOPP_UNUSED(result); assert(result); - return m_buffer & (((unsigned long)1 << length) - 1); -} - -inline void LowFirstBitReader::SkipBits(unsigned int length) -{ - assert(m_bitsBuffered >= length); - m_buffer >>= length; - m_bitsBuffered -= length; -} - -inline unsigned long LowFirstBitReader::GetBits(unsigned int length) -{ - unsigned long result = PeekBits(length); - SkipBits(length); - return result; -} - -inline HuffmanDecoder::code_t HuffmanDecoder::NormalizeCode(HuffmanDecoder::code_t code, unsigned int codeBits) -{ - return code << (MAX_CODE_BITS - codeBits); -} - -void HuffmanDecoder::Initialize(const unsigned int *codeBits, unsigned int nCodes) -{ - // the Huffman codes are represented in 3 ways in this code: - // - // 1. most significant code bit (i.e. top of code tree) in the least significant bit position - // 2. most significant code bit (i.e. top of code tree) in the most significant bit position - // 3. most significant code bit (i.e. top of code tree) in n-th least significant bit position, - // where n is the maximum code length for this code tree - // - // (1) is the way the codes come in from the deflate stream - // (2) is used to sort codes so they can be binary searched - // (3) is used in this function to compute codes from code lengths - // - // a code in representation (2) is called "normalized" here - // The BitReverse() function is used to convert between (1) and (2) - // The NormalizeCode() function is used to convert from (3) to (2) - - if (nCodes == 0) - throw Err("null code"); - - m_maxCodeBits = *std::max_element(codeBits, codeBits+nCodes); - - if (m_maxCodeBits > MAX_CODE_BITS) - throw Err("code length exceeds maximum"); - - if (m_maxCodeBits == 0) - throw Err("null code"); - - // count number of codes of each length - SecBlockWithHint blCount(m_maxCodeBits+1); - std::fill(blCount.begin(), blCount.end(), 0); - unsigned int i; - for (i=0; i nextCode(m_maxCodeBits+1); - nextCode[1] = 0; - for (i=2; i<=m_maxCodeBits; i++) - { - // compute this while checking for overflow: code = (code + blCount[i-1]) << 1 - if (code > code + blCount[i-1]) - throw Err("codes oversubscribed"); - code += blCount[i-1]; - if (code > (code << 1)) - throw Err("codes oversubscribed"); - code <<= 1; - nextCode[i] = code; - } - - // MAX_CODE_BITS is 32, m_maxCodeBits may be smaller. - const unsigned long long shiftedMaxCode = (1ULL << m_maxCodeBits); - if (code > shiftedMaxCode - blCount[m_maxCodeBits]) - throw Err("codes oversubscribed"); - else if (m_maxCodeBits != 1 && code < shiftedMaxCode - blCount[m_maxCodeBits]) - throw Err("codes incomplete"); - - // compute a vector of triples sorted by code - m_codeToValue.resize(nCodes - blCount[0]); - unsigned int j=0; - for (i=0; ilen) - { - entry.type = 2; - entry.len = codeInfo.len; - } - else - { - entry.type = 3; - entry.end = last+1; - } - } -} - -inline unsigned int HuffmanDecoder::Decode(code_t code, /* out */ value_t &value) const -{ - assert(m_codeToValue.size() > 0); - LookupEntry &entry = m_cache[code & m_cacheMask]; - - code_t normalizedCode = 0; - if (entry.type != 1) - normalizedCode = BitReverse(code); - - if (entry.type == 0) - FillCacheEntry(entry, normalizedCode); - - if (entry.type == 1) - { - value = entry.value; - return entry.len; - } - else - { - const CodeInfo &codeInfo = (entry.type == 2) - ? entry.begin[(normalizedCode << m_cacheBits) >> (MAX_CODE_BITS - (entry.len - m_cacheBits))] - : *(std::upper_bound(entry.begin, entry.end, normalizedCode, CodeLessThan())-1); - value = codeInfo.value; - return codeInfo.len; - } -} - -bool HuffmanDecoder::Decode(LowFirstBitReader &reader, value_t &value) const -{ - bool result = reader.FillBuffer(m_maxCodeBits); - if(!result) return false; - - unsigned int codeBits = Decode(reader.PeekBuffer(), value); - if (codeBits > reader.BitsBuffered()) - return false; - reader.SkipBits(codeBits); - return true; -} - -// ************************************************************* - -Inflator::Inflator(BufferedTransformation *attachment, bool repeat, int propagation) - : AutoSignaling(propagation) - , m_state(PRE_STREAM), m_repeat(repeat), m_eof(0), m_wrappedAround(0) - , m_blockType(0xff), m_storedLen(0xffff), m_nextDecode(), m_literal(0) - , m_distance(0), m_reader(m_inQueue), m_current(0), m_lastFlush(0) -{ - Detach(attachment); -} - -void Inflator::IsolatedInitialize(const NameValuePairs ¶meters) -{ - m_state = PRE_STREAM; - parameters.GetValue("Repeat", m_repeat); - m_inQueue.Clear(); - m_reader.SkipBits(m_reader.BitsBuffered()); -} - -void Inflator::OutputByte(byte b) -{ - m_window[m_current++] = b; - if (m_current == m_window.size()) - { - ProcessDecompressedData(m_window + m_lastFlush, m_window.size() - m_lastFlush); - m_lastFlush = 0; - m_current = 0; - m_wrappedAround = true; - } -} - -void Inflator::OutputString(const byte *string, size_t length) -{ - while (length) - { - size_t len = UnsignedMin(length, m_window.size() - m_current); - memcpy(m_window + m_current, string, len); - m_current += len; - if (m_current == m_window.size()) - { - ProcessDecompressedData(m_window + m_lastFlush, m_window.size() - m_lastFlush); - m_lastFlush = 0; - m_current = 0; - m_wrappedAround = true; - } - string += len; - length -= len; - } -} - -void Inflator::OutputPast(unsigned int length, unsigned int distance) -{ - size_t start; - if (distance <= m_current) - start = m_current - distance; - else if (m_wrappedAround && distance <= m_window.size()) - start = m_current + m_window.size() - distance; - else - throw BadBlockErr(); - - if (start + length > m_window.size()) - { - for (; start < m_window.size(); start++, length--) - OutputByte(m_window[start]); - start = 0; - } - - if (start + length > m_current || m_current + length >= m_window.size()) - { - while (length--) - OutputByte(m_window[start++]); - } - else - { - memcpy(m_window + m_current, m_window + start, length); - m_current += length; - } -} - -size_t Inflator::Put2(const byte *inString, size_t length, int messageEnd, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("Inflator"); - - LazyPutter lp(m_inQueue, inString, length); - ProcessInput(messageEnd != 0); - - if (messageEnd) - if (!(m_state == PRE_STREAM || m_state == AFTER_END)) - throw UnexpectedEndErr(); - - Output(0, NULL, 0, messageEnd, blocking); - return 0; -} - -bool Inflator::IsolatedFlush(bool hardFlush, bool blocking) -{ - if (!blocking) - throw BlockingInputOnly("Inflator"); - - if (hardFlush) - ProcessInput(true); - FlushOutput(); - - return false; -} - -void Inflator::ProcessInput(bool flush) -{ - while (true) - { - switch (m_state) - { - case PRE_STREAM: - if (!flush && m_inQueue.CurrentSize() < MaxPrestreamHeaderSize()) - return; - ProcessPrestreamHeader(); - m_state = WAIT_HEADER; - m_wrappedAround = false; - m_current = 0; - m_lastFlush = 0; - m_window.New(1 << GetLog2WindowSize()); - break; - case WAIT_HEADER: - { - // maximum number of bytes before actual compressed data starts - const size_t MAX_HEADER_SIZE = BitsToBytes(3+5+5+4+19*7+286*15+19*15); - if (m_inQueue.CurrentSize() < (flush ? 1 : MAX_HEADER_SIZE)) - return; - DecodeHeader(); - break; - } - case DECODING_BODY: - if (!DecodeBody()) - return; - break; - case POST_STREAM: - if (!flush && m_inQueue.CurrentSize() < MaxPoststreamTailSize()) - return; - ProcessPoststreamTail(); - m_state = m_repeat ? PRE_STREAM : AFTER_END; - Output(0, NULL, 0, GetAutoSignalPropagation(), true); // TODO: non-blocking - if (m_inQueue.IsEmpty()) - return; - break; - case AFTER_END: - m_inQueue.TransferTo(*AttachedTransformation()); - return; - } - } -} - -void Inflator::DecodeHeader() -{ - if (!m_reader.FillBuffer(3)) - throw UnexpectedEndErr(); - m_eof = m_reader.GetBits(1) != 0; - m_blockType = (byte)m_reader.GetBits(2); - switch (m_blockType) - { - case 0: // stored - { - m_reader.SkipBits(m_reader.BitsBuffered() % 8); - if (!m_reader.FillBuffer(32)) - throw UnexpectedEndErr(); - m_storedLen = (word16)m_reader.GetBits(16); - word16 nlen = (word16)m_reader.GetBits(16); - if (nlen != (word16)~m_storedLen) - throw BadBlockErr(); - break; - } - case 1: // fixed codes - m_nextDecode = LITERAL; - break; - case 2: // dynamic codes - { - if (!m_reader.FillBuffer(5+5+4)) - throw UnexpectedEndErr(); - unsigned int hlit = m_reader.GetBits(5); - unsigned int hdist = m_reader.GetBits(5); - unsigned int hclen = m_reader.GetBits(4); - - FixedSizeSecBlock codeLengths; - unsigned int i; - static const unsigned int border[] = { // Order of the bit length code lengths - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - std::fill(codeLengths.begin(), codeLengths+19, 0); - for (i=0; i hlit+257+hdist+1) - throw BadBlockErr(); - std::fill(codeLengths + i, codeLengths + i + count, repeater); - i += count; - } - m_dynamicLiteralDecoder.Initialize(codeLengths, hlit+257); - if (hdist == 0 && codeLengths[hlit+257] == 0) - { - if (hlit != 0) // a single zero distance code length means all literals - throw BadBlockErr(); - } - else - m_dynamicDistanceDecoder.Initialize(codeLengths+hlit+257, hdist+1); - m_nextDecode = LITERAL; - } - catch (HuffmanDecoder::Err &) - { - throw BadBlockErr(); - } - break; - } - default: - throw BadBlockErr(); // reserved block type - } - m_state = DECODING_BODY; -} - -bool Inflator::DecodeBody() -{ - bool blockEnd = false; - switch (m_blockType) - { - case 0: // stored - assert(m_reader.BitsBuffered() == 0); - while (!m_inQueue.IsEmpty() && !blockEnd) - { - size_t size; - const byte *block = m_inQueue.Spy(size); - size = UnsignedMin(m_storedLen, size); - assert(size <= 0xffff); - - OutputString(block, size); - m_inQueue.Skip(size); - m_storedLen = m_storedLen - (word16)size; - if (m_storedLen == 0) - blockEnd = true; - } - break; - case 1: // fixed codes - case 2: // dynamic codes - static const unsigned int lengthStarts[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; - static const unsigned int lengthExtraBits[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; - static const unsigned int distanceStarts[] = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577}; - static const unsigned int distanceExtraBits[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13}; - - const HuffmanDecoder& literalDecoder = GetLiteralDecoder(); - const HuffmanDecoder& distanceDecoder = GetDistanceDecoder(); - - switch (m_nextDecode) - { - case LITERAL: - while (true) - { - if (!literalDecoder.Decode(m_reader, m_literal)) - { - m_nextDecode = LITERAL; - break; - } - if (m_literal < 256) - OutputByte((byte)m_literal); - else if (m_literal == 256) // end of block - { - blockEnd = true; - break; - } - else - { - if (m_literal > 285) - throw BadBlockErr(); - unsigned int bits; - case LENGTH_BITS: - bits = lengthExtraBits[m_literal-257]; - if (!m_reader.FillBuffer(bits)) - { - m_nextDecode = LENGTH_BITS; - break; - } - m_literal = m_reader.GetBits(bits) + lengthStarts[m_literal-257]; - case DISTANCE: - if (!distanceDecoder.Decode(m_reader, m_distance)) - { - m_nextDecode = DISTANCE; - break; - } - case DISTANCE_BITS: - bits = distanceExtraBits[m_distance]; - if (!m_reader.FillBuffer(bits)) - { - m_nextDecode = DISTANCE_BITS; - break; - } - m_distance = m_reader.GetBits(bits) + distanceStarts[m_distance]; - OutputPast(m_literal, m_distance); - } - } - break; - default: - assert(0); - } - } - if (blockEnd) - { - if (m_eof) - { - FlushOutput(); - m_reader.SkipBits(m_reader.BitsBuffered()%8); - if (m_reader.BitsBuffered()) - { - // undo too much lookahead - SecBlockWithHint buffer(m_reader.BitsBuffered() / 8); - for (unsigned int i=0; i= m_lastFlush); - ProcessDecompressedData(m_window + m_lastFlush, m_current - m_lastFlush); - m_lastFlush = m_current; - } -} - -struct NewFixedLiteralDecoder -{ - HuffmanDecoder * operator()() const - { - unsigned int codeLengths[288]; - std::fill(codeLengths + 0, codeLengths + 144, 8); - std::fill(codeLengths + 144, codeLengths + 256, 9); - std::fill(codeLengths + 256, codeLengths + 280, 7); - std::fill(codeLengths + 280, codeLengths + 288, 8); - member_ptr pDecoder(new HuffmanDecoder); - pDecoder->Initialize(codeLengths, 288); - return pDecoder.release(); - } -}; - -struct NewFixedDistanceDecoder -{ - HuffmanDecoder * operator()() const - { - unsigned int codeLengths[32]; - std::fill(codeLengths + 0, codeLengths + 32, 5); - member_ptr pDecoder(new HuffmanDecoder); - pDecoder->Initialize(codeLengths, 32); - return pDecoder.release(); - } -}; - -const HuffmanDecoder& Inflator::GetLiteralDecoder() const -{ - return m_blockType == 1 ? Singleton().Ref() : m_dynamicLiteralDecoder; -} - -const HuffmanDecoder& Inflator::GetDistanceDecoder() const -{ - return m_blockType == 1 ? Singleton().Ref() : m_dynamicDistanceDecoder; -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/zinflate.h b/external/crypto++-5.6.3/zinflate.h deleted file mode 100644 index e2fd23700..000000000 --- a/external/crypto++-5.6.3/zinflate.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef CRYPTOPP_ZINFLATE_H -#define CRYPTOPP_ZINFLATE_H - -#include "cryptlib.h" -#include "secblock.h" -#include "filters.h" -#include "stdcpp.h" - -NAMESPACE_BEGIN(CryptoPP) - -//! _ -class LowFirstBitReader -{ -public: - LowFirstBitReader(BufferedTransformation &store) - : m_store(store), m_buffer(0), m_bitsBuffered(0) {} - unsigned int BitsBuffered() const {return m_bitsBuffered;} - unsigned long PeekBuffer() const {return m_buffer;} - bool FillBuffer(unsigned int length); - unsigned long PeekBits(unsigned int length); - void SkipBits(unsigned int length); - unsigned long GetBits(unsigned int length); - -private: - BufferedTransformation &m_store; - unsigned long m_buffer; - unsigned int m_bitsBuffered; -}; - -struct CodeLessThan; - -//! Huffman Decoder -class HuffmanDecoder -{ -public: - typedef unsigned int code_t; - typedef unsigned int value_t; - enum {MAX_CODE_BITS = sizeof(code_t)*8}; - - class Err : public Exception {public: Err(const std::string &what) : Exception(INVALID_DATA_FORMAT, "HuffmanDecoder: " + what) {}}; - - HuffmanDecoder() : m_maxCodeBits(0), m_cacheBits(0), m_cacheMask(0), m_normalizedCacheMask(0) {} - HuffmanDecoder(const unsigned int *codeBitLengths, unsigned int nCodes) - : m_maxCodeBits(0), m_cacheBits(0), m_cacheMask(0), m_normalizedCacheMask(0) - {Initialize(codeBitLengths, nCodes);} - - void Initialize(const unsigned int *codeBitLengths, unsigned int nCodes); - unsigned int Decode(code_t code, /* out */ value_t &value) const; - bool Decode(LowFirstBitReader &reader, value_t &value) const; - -private: - friend struct CodeLessThan; - - struct CodeInfo - { - CodeInfo(code_t code=0, unsigned int len=0, value_t value=0) : code(code), len(len), value(value) {} - inline bool operator<(const CodeInfo &rhs) const {return code < rhs.code;} - code_t code; - unsigned int len; - value_t value; - }; - - struct LookupEntry - { - unsigned int type; - union - { - value_t value; - const CodeInfo *begin; - }; - union - { - unsigned int len; - const CodeInfo *end; - }; - }; - - static code_t NormalizeCode(code_t code, unsigned int codeBits); - void FillCacheEntry(LookupEntry &entry, code_t normalizedCode) const; - - unsigned int m_maxCodeBits, m_cacheBits, m_cacheMask, m_normalizedCacheMask; - std::vector > m_codeToValue; - mutable std::vector > m_cache; -}; - -//! DEFLATE (RFC 1951) decompressor - -class Inflator : public AutoSignaling -{ -public: - class Err : public Exception - { - public: - Err(ErrorType e, const std::string &s) - : Exception(e, s) {} - }; - class UnexpectedEndErr : public Err {public: UnexpectedEndErr() : Err(INVALID_DATA_FORMAT, "Inflator: unexpected end of compressed block") {}}; - class BadBlockErr : public Err {public: BadBlockErr() : Err(INVALID_DATA_FORMAT, "Inflator: error in compressed block") {}}; - - //! \brief RFC 1951 Decompressor - //! \param attachment the filter's attached transformation - //! \param repeat decompress multiple compressed streams in series - //! \param autoSignalPropagation 0 to turn off MessageEnd signal - Inflator(BufferedTransformation *attachment = NULL, bool repeat = false, int autoSignalPropagation = -1); - - void IsolatedInitialize(const NameValuePairs ¶meters); - size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); - bool IsolatedFlush(bool hardFlush, bool blocking); - - virtual unsigned int GetLog2WindowSize() const {return 15;} - -protected: - ByteQueue m_inQueue; - -private: - virtual unsigned int MaxPrestreamHeaderSize() const {return 0;} - virtual void ProcessPrestreamHeader() {} - virtual void ProcessDecompressedData(const byte *string, size_t length) - {AttachedTransformation()->Put(string, length);} - virtual unsigned int MaxPoststreamTailSize() const {return 0;} - virtual void ProcessPoststreamTail() {} - - void ProcessInput(bool flush); - void DecodeHeader(); - bool DecodeBody(); - void FlushOutput(); - void OutputByte(byte b); - void OutputString(const byte *string, size_t length); - void OutputPast(unsigned int length, unsigned int distance); - - static const HuffmanDecoder *FixedLiteralDecoder(); - static const HuffmanDecoder *FixedDistanceDecoder(); - - const HuffmanDecoder& GetLiteralDecoder() const; - const HuffmanDecoder& GetDistanceDecoder() const; - - enum State {PRE_STREAM, WAIT_HEADER, DECODING_BODY, POST_STREAM, AFTER_END}; - State m_state; - bool m_repeat, m_eof, m_wrappedAround; - byte m_blockType; - word16 m_storedLen; - enum NextDecode {LITERAL, LENGTH_BITS, DISTANCE, DISTANCE_BITS}; - NextDecode m_nextDecode; - unsigned int m_literal, m_distance; // for LENGTH_BITS or DISTANCE_BITS - HuffmanDecoder m_dynamicLiteralDecoder, m_dynamicDistanceDecoder; - LowFirstBitReader m_reader; - SecByteBlock m_window; - size_t m_current, m_lastFlush; -}; - -NAMESPACE_END - -#endif diff --git a/external/crypto++-5.6.3/zlib.cpp b/external/crypto++-5.6.3/zlib.cpp deleted file mode 100644 index e30c05174..000000000 --- a/external/crypto++-5.6.3/zlib.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// zlib.cpp - written and placed in the public domain by Wei Dai - -// "zlib" is the name of a well known C language compression library -// (http://www.zlib.org) and also the name of a compression format -// (RFC 1950) that the library implements. This file is part of a -// complete reimplementation of the zlib compression format. - -#include "pch.h" -#include "zlib.h" -#include "zdeflate.h" -#include "zinflate.h" -#include "secblock.h" - -NAMESPACE_BEGIN(CryptoPP) - -static const byte DEFLATE_METHOD = 8; -static const byte FDICT_FLAG = (1 << 5); - -// ************************************************************* - -void ZlibCompressor::WritePrestreamHeader() -{ - m_adler32.Restart(); - assert(((GetLog2WindowSize()-8) << 4) <= 255); - byte cmf = byte(DEFLATE_METHOD | ((GetLog2WindowSize()-8) << 4)); - assert((GetCompressionLevel() << 6) <= 255); - byte flags = byte(GetCompressionLevel() << 6); - AttachedTransformation()->PutWord16(RoundUpToMultipleOf(word16(cmf*256+flags), word16(31))); -} - -void ZlibCompressor::ProcessUncompressedData(const byte *inString, size_t length) -{ - m_adler32.Update(inString, length); -} - -void ZlibCompressor::WritePoststreamTail() -{ - FixedSizeSecBlock adler32; - m_adler32.Final(adler32); - AttachedTransformation()->Put(adler32, 4); -} - -unsigned int ZlibCompressor::GetCompressionLevel() const -{ - static const unsigned int deflateToCompressionLevel[] = {0, 1, 1, 1, 2, 2, 2, 2, 2, 3}; - return deflateToCompressionLevel[GetDeflateLevel()]; -} - -// ************************************************************* - -ZlibDecompressor::ZlibDecompressor(BufferedTransformation *attachment, bool repeat, int propagation) - : Inflator(attachment, repeat, propagation), m_log2WindowSize(0) -{ -} - -void ZlibDecompressor::ProcessPrestreamHeader() -{ - m_adler32.Restart(); - - byte cmf; - byte flags; - - if (!m_inQueue.Get(cmf) || !m_inQueue.Get(flags)) - throw HeaderErr(); - - if ((cmf*256+flags) % 31 != 0) - throw HeaderErr(); // if you hit this exception, you're probably trying to decompress invalid data - - if ((cmf & 0xf) != DEFLATE_METHOD) - throw UnsupportedAlgorithm(); - - if (flags & FDICT_FLAG) - throw UnsupportedPresetDictionary(); - - m_log2WindowSize = 8 + (cmf >> 4); -} - -void ZlibDecompressor::ProcessDecompressedData(const byte *inString, size_t length) -{ - AttachedTransformation()->Put(inString, length); - m_adler32.Update(inString, length); -} - -void ZlibDecompressor::ProcessPoststreamTail() -{ - FixedSizeSecBlock adler32; - if (m_inQueue.Get(adler32, 4) != 4) - throw Adler32Err(); - if (!m_adler32.Verify(adler32)) - throw Adler32Err(); -} - -NAMESPACE_END diff --git a/external/crypto++-5.6.3/zlib.h b/external/crypto++-5.6.3/zlib.h deleted file mode 100644 index ef7cbcd95..000000000 --- a/external/crypto++-5.6.3/zlib.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef CRYPTOPP_ZLIB_H -#define CRYPTOPP_ZLIB_H - -#include "cryptlib.h" -#include "adler32.h" -#include "zdeflate.h" -#include "zinflate.h" - -NAMESPACE_BEGIN(CryptoPP) - -/// ZLIB Compressor (RFC 1950) -class ZlibCompressor : public Deflator -{ -public: - ZlibCompressor(BufferedTransformation *attachment=NULL, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true) - : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible) {} - ZlibCompressor(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL) - : Deflator(parameters, attachment) {} - - unsigned int GetCompressionLevel() const; - -protected: - void WritePrestreamHeader(); - void ProcessUncompressedData(const byte *string, size_t length); - void WritePoststreamTail(); - - Adler32 m_adler32; -}; - -/// ZLIB Decompressor (RFC 1950) -class ZlibDecompressor : public Inflator -{ -public: - typedef Inflator::Err Err; - class HeaderErr : public Err {public: HeaderErr() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: header decoding error") {}}; - class Adler32Err : public Err {public: Adler32Err() : Err(DATA_INTEGRITY_CHECK_FAILED, "ZlibDecompressor: ADLER32 check error") {}}; - class UnsupportedAlgorithm : public Err {public: UnsupportedAlgorithm() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: unsupported algorithm") {}}; - class UnsupportedPresetDictionary : public Err {public: UnsupportedPresetDictionary() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: unsupported preset dictionary") {}}; - - //! \brief Construct a ZlibDecompressor - //! \param attachment a \ BufferedTransformation to attach to this object - //! \param repeat decompress multiple compressed streams in series - //! \param autoSignalPropagation 0 to turn off MessageEnd signal - ZlibDecompressor(BufferedTransformation *attachment = NULL, bool repeat = false, int autoSignalPropagation = -1); - unsigned int GetLog2WindowSize() const {return m_log2WindowSize;} - -private: - unsigned int MaxPrestreamHeaderSize() const {return 2;} - void ProcessPrestreamHeader(); - void ProcessDecompressedData(const byte *string, size_t length); - unsigned int MaxPoststreamTailSize() const {return 4;} - void ProcessPoststreamTail(); - - unsigned int m_log2WindowSize; - Adler32 m_adler32; -}; - -NAMESPACE_END - -#endif From a0b40b69393b4a35ac2038c14f3ba52f356815e4 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Tue, 6 Apr 2021 14:45:10 -0300 Subject: [PATCH 20/24] add missing vtable --- public/ispatialpartition.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/ispatialpartition.h b/public/ispatialpartition.h index c4adb0428..f8f380189 100644 --- a/public/ispatialpartition.h +++ b/public/ispatialpartition.h @@ -112,6 +112,8 @@ enum abstract_class ISpatialPartition { public: + virtual ~ISpatialPartition() = 0; + // Create/destroy a handle for this dude in our system. Destroy // will also remove it from all lists it happens to be in virtual SpatialPartitionHandle_t CreateHandle( IHandleEntity *pHandleEntity ) = 0; From 63861b20123ee250979f1e9b5baa162bcb34f647 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Fri, 9 Apr 2021 18:31:29 -0300 Subject: [PATCH 21/24] make TheNavAreas a vector --- game/server/nav_area.h | 2 +- game/server/nav_mesh.h | 14 +++++++------- public/tier1/utlvector.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/game/server/nav_area.h b/game/server/nav_area.h index c055de5a5..9953de8e0 100644 --- a/game/server/nav_area.h +++ b/game/server/nav_area.h @@ -738,7 +738,7 @@ class CNavArea : protected CNavAreaCriticalData }; typedef CUtlVector< CNavArea * > NavAreaVector; -extern NavAreaVector TheNavAreas; +extern NavAreaVector *TheNavAreas; //-------------------------------------------------------------------------------------------------------------- diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index 54323815f..945f2f4cf 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -464,9 +464,9 @@ class CNavMesh : public CGameEventListener template < typename Functor > bool ForAllAreas( Functor &func ) { - FOR_EACH_VEC( TheNavAreas, it ) + FOR_EACH_VEC( *TheNavAreas, it ) { - CNavArea *area = TheNavAreas[ it ]; + CNavArea *area = (*TheNavAreas)[ it ]; if (func( area ) == false) return false; @@ -479,9 +479,9 @@ class CNavMesh : public CGameEventListener template < typename Functor > bool ForAllAreas( Functor &func ) const { - FOR_EACH_VEC( TheNavAreas, it ) + FOR_EACH_VEC( *TheNavAreas, it ) { - const CNavArea *area = TheNavAreas[ it ]; + const CNavArea *area = (*TheNavAreas)[ it ]; if (func( area ) == false) return false; @@ -503,7 +503,7 @@ class CNavMesh : public CGameEventListener if ( !m_grid.Count() ) { #if _DEBUG - //Warning("Query before nav mesh is loaded! %d\n", TheNavAreas.Count() ); + Warning("Query before nav mesh is loaded! %d\n", TheNavAreas->Count() ); #endif return true; } @@ -673,9 +673,9 @@ class CNavMesh : public CGameEventListener template < typename Functor > bool StitchMesh( Functor &func ) { - FOR_EACH_VEC( TheNavAreas, it ) + FOR_EACH_VEC( *TheNavAreas, it ) { - CNavArea *area = TheNavAreas[ it ]; + CNavArea *area = (*TheNavAreas)[ it ]; if ( func( area ) ) { diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index 53df41aaf..f555ae267 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -25,7 +25,7 @@ #include "tier1/strtools.h" #define FOR_EACH_VEC( vecName, iteratorName ) \ - for ( int iteratorName = 0; iteratorName < vecName.Count(); iteratorName++ ) + for ( int iteratorName = 0; iteratorName < (vecName).Count(); iteratorName++ ) #define FOR_EACH_VEC_BACK( vecName, iteratorName ) \ for ( int iteratorName = (vecName).Count()-1; iteratorName >= 0; iteratorName-- ) From 2f8cf5cdf135b7312344d315f16b9268a2678ff7 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Fri, 9 Apr 2021 18:38:48 -0300 Subject: [PATCH 22/24] pad navmesh members --- game/server/nav_area.h | 3 +++ game/server/nav_mesh.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/game/server/nav_area.h b/game/server/nav_area.h index 9953de8e0..fcb135094 100644 --- a/game/server/nav_area.h +++ b/game/server/nav_area.h @@ -646,6 +646,9 @@ class CNavArea : protected CNavAreaCriticalData */ static unsigned int m_nextID; // used to allocate unique IDs + + char pad1[4]; + unsigned int m_id; // unique area ID unsigned int m_debugid; diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index 945f2f4cf..4d2645763 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -725,6 +725,8 @@ class CNavMesh : public CGameEventListener friend class CNavArea; friend class CNavNode; friend class CNavUIBasePanel; + + char pad1[4]; mutable CUtlVector m_grid; float m_gridCellSize; // the width/height of a grid cell for spatially partitioning nav areas for fast access From a2dac1b61f55e2d486a84e3bef9f9eb6f7d53397 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Sat, 10 Apr 2021 23:02:09 -0300 Subject: [PATCH 23/24] add radius to CTakeDamageInfo --- game/shared/takedamageinfo.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/game/shared/takedamageinfo.h b/game/shared/takedamageinfo.h index c7678aecf..031e2a769 100644 --- a/game/shared/takedamageinfo.h +++ b/game/shared/takedamageinfo.h @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// +//========= Copyright ? 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // @@ -80,6 +80,9 @@ class CTakeDamageInfo void SetAmmoType( int iAmmoType ); const char * GetAmmoName() const; + float GetRadius() const; + void SetRadius( float fRadius ); + void Set( CBaseEntity *pInflictor, CBaseEntity *pAttacker, float flDamage, int bitsDamageType, int iKillType = 0 ); void Set( CBaseEntity *pInflictor, CBaseEntity *pAttacker, CBaseEntity *pWeapon, float flDamage, int bitsDamageType, int iKillType = 0 ); void Set( CBaseEntity *pInflictor, CBaseEntity *pAttacker, const Vector &damageForce, const Vector &damagePosition, float flDamage, int bitsDamageType, int iKillType = 0, Vector *reportedPosition = NULL ); @@ -113,6 +116,7 @@ class CTakeDamageInfo int m_iDamageCustom; int m_iDamageStats; int m_iAmmoType; // AmmoType of the weapon used to cause this damage, if any + float m_flRadius; DECLARE_SIMPLE_DATADESC(); }; @@ -331,6 +335,16 @@ inline void CTakeDamageInfo::CopyDamageToBaseDamage() m_flBaseDamage = m_flDamage; } +inline float CTakeDamageInfo::GetRadius() const +{ + return m_flRadius; +} + +inline void CTakeDamageInfo::SetRadius( float flRadius ) +{ + m_flRadius = flRadius; +} + // -------------------------------------------------------------------------------------------------- // // Inlines. From 03c029b73ed9379102cf0f218a7706823d6cfae6 Mon Sep 17 00:00:00 2001 From: arthurdead Date: Sun, 18 Apr 2021 12:06:41 -0300 Subject: [PATCH 24/24] add back the materialsystem version define --- public/materialsystem/imaterialsystem.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/materialsystem/imaterialsystem.h b/public/materialsystem/imaterialsystem.h index e6997b710..ddbf71d57 100644 --- a/public/materialsystem/imaterialsystem.h +++ b/public/materialsystem/imaterialsystem.h @@ -70,6 +70,8 @@ class IPaintMapTextureManager; //----------------------------------------------------------------------------- typedef uint64 VertexFormat_t; +#define MATERIAL_SYSTEM_INTERFACE_VERSION "VMaterialSystem080" + //----------------------------------------------------------------------------- // important enumeration //-----------------------------------------------------------------------------